diff --git a/.patch-version b/.patch-version index 0cfbf088..00750edc 100644 --- a/.patch-version +++ b/.patch-version @@ -1 +1 @@ -2 +3 diff --git a/dist/0.e84aae32c1142e0538ad.css b/dist/0.1ebe794c83bdc1b89fad.css similarity index 99% rename from dist/0.e84aae32c1142e0538ad.css rename to dist/0.1ebe794c83bdc1b89fad.css index 7fede0f8..20488a10 100644 --- a/dist/0.e84aae32c1142e0538ad.css +++ b/dist/0.1ebe794c83bdc1b89fad.css @@ -61,4 +61,4 @@ .Picker{height:100%;display:flex;flex-direction:column;overflow:hidden}.Picker .picker-header{padding:0 1rem 0.25rem 0.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:0.5rem;margin-left:0.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:0.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=0.e84aae32c1142e0538ad.css.map*/ \ No newline at end of file +/*# sourceMappingURL=0.1ebe794c83bdc1b89fad.css.map*/ \ No newline at end of file diff --git a/dist/0.e84aae32c1142e0538ad.css.map b/dist/0.1ebe794c83bdc1b89fad.css.map similarity index 99% rename from dist/0.e84aae32c1142e0538ad.css.map rename to dist/0.1ebe794c83bdc1b89fad.css.map index e39d7ad9..e696185d 100644 --- a/dist/0.e84aae32c1142e0538ad.css.map +++ b/dist/0.1ebe794c83bdc1b89fad.css.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///./src/components/ui/Transition.scss","webpack:///./src/components/common/Avatar.scss","webpack:///./src/components/ui/ProgressSpinner.scss","webpack:///./src/components/ui/Modal.scss","webpack:///./src/components/ui/ListItem.scss","webpack:///./src/components/common/VerifiedIcon.scss","webpack:///./src/components/common/TypingStatus.scss","webpack:///./src/components/ui/Notification.scss","webpack:///./src/components/ui/Radio.scss","webpack:///./src/components/ui/Tab.scss","webpack:///./src/components/ui/TabList.scss","webpack:///./src/components/common/DeleteChatModal.scss","webpack:///./src/components/ui/SearchInput.scss","webpack:///./src/components/common/PickerSelectedItem.scss","webpack:///./src/components/common/MessageOutgoingStatus.scss","webpack:///./src/components/common/LastMessageMeta.scss","webpack:///./src/components/left/main/Badge.scss","webpack:///./src/components/left/main/Chat.scss","webpack:///./src/components/common/AnimatedEmoji.scss","webpack:///./src/components/left/main/EmptyFolder.scss","webpack:///./src/components/common/NothingFound.scss","webpack:///./src/components/common/Media.scss","webpack:///./src/components/common/WebLink.scss","webpack:///./src/components/common/File.scss","webpack:///./src/components/common/Audio.scss","webpack:///./src/components/middle/composer/DropTarget.scss","webpack:///./src/components/ui/FloatingActionButton.scss","webpack:///./src/components/middle/composer/DropArea.scss","webpack:///./src/components/common/StickerButton.scss","webpack:///./src/components/middle/composer/TextFormatter.scss","webpack:///./src/components/common/Picker.scss"],"names":[],"mappings":"AAAA,YAAY,kBAAkB,cAAc,WAAW,YAAY,wCAAwC,gCAAgC,oCAAoC,kBAAkB,MAAM,OAAO,+CAA+C,wBAAwB,kCAAkC,2BAA2B,yBAAyB,WAAW,YAAY,gBAAgB,aAAa,iBAAiB,2BAA2B,gBAAgB,cAAc,4DAA4D,yBAAyB,mBAAmB,oEAAoE,wBAAwB,sBAAsB,2BAA2B,kCAAkC,4CAA4C,gCAAgC,2CAA2C,gCAAgC,4BAA4B,4CAA4C,qDAAqD,0CAA0C,sDAAsD,+BAA+B,4BAA4B,2CAA2C,4CAA4C,yCAAyC,2CAA2C,yCAAyC,2BAA2B,qDAAqD,qDAAqD,mDAAmD,sDAAsD,2BAA2B,wCAAwC,6BAA6B,4BAA4B,yCAAyC,gCAAgC,uCAAuC,+BAA+B,uCAAuC,6BAA6B,mDAAmD,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AmC,4CAA4C,wBAAwB,iDAAiD,4BAA4B,OAAO,MAAM,UAAU,oBAAoB,4BAA4B,mCAAmC,eAAe,0BAA0B,4BAA4B,2DAA2D,kCAAkC,uBAAuB,wBAAwB,WAAW,wBAAwB,yCAAyC,uDAAuD,aAAa,iBAAiB,mBAAmB,uBAAuB,UAAU,eAAe,iBAAiB,sCAAsC,sCAAsC,YAAY,kBAAkB,eAAe,0BAA0B,sCAAsC,gBAAgB,2FAA2F,WAAW,cAAc,kBAAkB,MAAM,SAAS,WAAW,UAAU,UAAU,4BAA4B,8CAA8C,OAAO,wFAAwF,6CAA6C,QAAQ,uFAAuF,wDAAwD,UAAU,wDAAwD,UAAU,gCAAgC,cAAc,UAAU,4BAA4B,sCAAsC,UAAU,8DAA8D,UAAU,mBAAmB,uBAAuB,WAAW,YAAY,gBAAgB,iBAAiB,kBAAkB,kDAAkD,cAAc,eAAe,8BAA8B,iDAAiD,YAAY,gCAAgC,WAAW;;ACA/pE,QAAQ,YAAY,aAAa,sBAAsB,gBAAgB,uBAAuB,+BAA+B,6CAA6C,aAAa,mBAAmB,cAAc,gBAAgB,iBAAiB,oCAAoC,qBAAqB,mBAAmB,YAAY,qCAAqC,YAAY,YAAY,gBAAgB,UAAU,gBAAgB,qBAAqB,YAAY,gBAAgB,kBAAkB,eAAe,0BAA0B,qBAAqB,0BAA0B,4BAA4B,oBAAoB,YAAY,SAAS,kBAAkB,aAAa,mBAAmB,uBAAuB","file":"0.e84aae32c1142e0538ad.css","sourcesContent":[".Transition{position:relative}.Transition>*{width:100%;height:100%;animation-fill-mode:forwards !important;transition:background-color .2s}.Transition>*.from,.Transition>*.to{position:absolute;top:0;left:0}.Transition>*:not(.active):not(.from):not(.to){display:none !important}.Transition.skip-slide-transition{transition:none !important}.Transition.scroll-slide{width:100%;height:100%;overflow:hidden;display:flex;flex-wrap:nowrap}.Transition.scroll-slide>*{position:static;flex-shrink:0}.Transition.scroll-slide>*:not(.active):not(.from):not(.to){display:block !important;transform:scale(0)}.Transition.scroll-slide>*:not(.active):not(.from):not(.to).through{display:none !important}.Transition.slide>.to{transform:translateX(100%)}.Transition.slide.animating>.from{animation:slide-out var(--slide-transition)}.Transition.slide.animating>.to{animation:slide-in var(--slide-transition)}.Transition.slide.backwards>.to{transform:translateX(-100%)}.Transition.slide.backwards.animating>.from{animation:slide-in-backwards var(--slide-transition)}.Transition.slide.backwards.animating>.to{animation:slide-out-backwards var(--slide-transition)}.Transition.slide-reversed>.to{transform:translateX(-100%)}.Transition.slide-reversed.animating>.from{animation:slide-out var(--slide-transition)}.Transition.slide-reversed.animating>.to{animation:slide-in var(--slide-transition)}.Transition.slide-reversed.backwards>.to{transform:translateX(100%)}.Transition.slide-reversed.backwards.animating>.from{animation:slide-in-backwards var(--slide-transition)}.Transition.slide-reversed.backwards.animating>.to{animation:slide-out-backwards var(--slide-transition)}.Transition.mv-slide>*>div{animation-fill-mode:forwards !important}.Transition.mv-slide>.to>div{transform:translateX(100vw)}.Transition.mv-slide.animating>.from>div{animation:mv-slide-out .4s ease}.Transition.mv-slide.animating>.to>div{animation:mv-slide-in .4s ease}.Transition.mv-slide.backwards>.to>div{transform:translateX(-100vw)}.Transition.mv-slide.backwards.animating>.from>div{animation:mv-slide-in-backwards .4s ease}.Transition.mv-slide.backwards.animating>.to>div{animation:mv-slide-out-backwards .4s ease}.Transition.slide-fade>.from{transform-origin:left;transform:translateX(0);opacity:1}.Transition.slide-fade>.to{transform-origin:left;transform:translateX(1.5rem);opacity:0}.Transition.slide-fade.animating>.from{animation:fade-out-opacity var(--slide-transition),slide-fade-out-move var(--slide-transition)}.Transition.slide-fade.animating>.to{animation:fade-in-opacity var(--slide-transition),slide-fade-in-move var(--slide-transition)}.Transition.slide-fade.backwards>.from{transform:translateX(0);opacity:1}.Transition.slide-fade.backwards>.to{transform:translateX(-1.5rem);opacity:0}.Transition.slide-fade.backwards.animating>.from{animation:fade-in-backwards-opacity var(--slide-transition),slide-fade-in-backwards-move var(--slide-transition)}.Transition.slide-fade.backwards.animating>.to{animation:fade-out-backwards-opacity var(--slide-transition),slide-fade-out-backwards-move var(--slide-transition)}.Transition.zoom-fade>.from{transform-origin:center;transform:scale(1);opacity:1}.Transition.zoom-fade>.to{transform-origin:center;opacity:0}.Transition.zoom-fade.animating>.from{animation:fade-out-opacity .15s ease}.Transition.zoom-fade.animating>.to{animation:fade-in-opacity .15s ease, zoom-fade-in-move .15s ease}.Transition.zoom-fade.backwards>.from{transform:scale(1)}.Transition.zoom-fade.backwards>.to{transform:scale(0.95)}.Transition.zoom-fade.backwards.animating>.from{animation:fade-in-backwards-opacity .1s ease, zoom-fade-in-backwards-move .15s ease}.Transition.zoom-fade.backwards.animating>.to{animation:fade-out-backwards-opacity .15s ease, zoom-fade-out-backwards-move .15s ease}.Transition.fade>.from{opacity:1}.Transition.fade>.to{opacity:0}.Transition.fade.animating>.from{animation:fade-out-opacity .15s ease}.Transition.fade.animating>.to{animation:fade-in-opacity .15s ease}.Transition.slide-layers{--background-color: var(--color-background);background:black}.Transition.slide-layers>div{background:var(--background-color)}.Transition.slide-layers>.to{transform:translateX(100%)}.Transition.slide-layers.animating>.from{animation:slide-layers-out var(--layer-transition)}.Transition.slide-layers.animating>.to{animation:slide-in var(--layer-transition)}.Transition.slide-layers.backwards>.to{transform:translateX(-20%);opacity:0.75}.Transition.slide-layers.backwards.animating>.from{animation:slide-in-backwards var(--layer-transition)}.Transition.slide-layers.backwards.animating>.to{animation:slide-layers-out-backwards var(--layer-transition)}.Transition.push-slide>div{background:var(--color-background)}.Transition.push-slide>.from{transform-origin:center;transform:scale(1);opacity:1}.Transition.push-slide>.from .custom-scroll{scrollbar-color:transparent !important}.Transition.push-slide>.from .custom-scroll::-webkit-scrollbar-thumb{background-color:transparent !important}.Transition.push-slide>.to{transform:translateX(100%)}.Transition.push-slide.animating>.from{animation:push-out .3s ease-in-out}.Transition.push-slide.animating>.to{animation:slide-in-200 .3s ease-in-out}.Transition.push-slide.backwards>.to{transform:scale(0.7)}.Transition.push-slide.backwards.animating>.from{animation:slide-in-200-backwards .3s ease-in-out}.Transition.push-slide.backwards.animating>.to{animation:push-out-backwards .3s ease-in-out}.Transition.reveal>.to{-webkit-clip-path:inset(0 100% 0 0);clip-path:inset(0 100% 0 0)}.Transition.reveal.animating>.to{animation:reveal-in 350ms ease-in}.Transition.reveal.backwards>.from{-webkit-clip-path:inset(0 0 0 0);clip-path:inset(0 0 0 0)}.Transition.reveal.backwards>.to{-webkit-clip-path:none;clip-path:none}.Transition.reveal.backwards.animating>.from{animation:reveal-in-backwards 350ms ease-out}.Transition.reveal.backwards.animating>.to{animation:none}@keyframes fade-in-opacity{0%{opacity:0}100%{opacity:1}}@keyframes fade-out-opacity{0%{opacity:1}100%{opacity:0}}@keyframes fade-in-backwards-opacity{0%{opacity:1}100%{opacity:0}}@keyframes fade-out-backwards-opacity{0%{opacity:0}100%{opacity:1}}@keyframes slide-in{0%{transform:translateX(100%)}100%{transform:translateX(0)}}@keyframes slide-out{0%{transform:translateX(0)}100%{transform:translateX(-100%)}}@keyframes slide-in-backwards{0%{transform:translateX(0)}100%{transform:translateX(100%)}}@keyframes slide-out-backwards{0%{transform:translateX(-100%)}100%{transform:translateX(0)}}@keyframes mv-slide-in{0%{transform:translateX(100vw)}100%{transform:translateX(0)}}@keyframes mv-slide-out{0%{transform:translateX(0)}100%{transform:translateX(-100vw)}}@keyframes mv-slide-in-backwards{0%{transform:translateX(0)}100%{transform:translateX(100vw)}}@keyframes mv-slide-out-backwards{0%{transform:translateX(-100vw)}100%{transform:translateX(0)}}@keyframes slide-fade-in-move{0%{transform:translateX(1.5rem)}100%{transform:translateX(0)}}@keyframes slide-fade-out-move{0%{transform:translateX(0)}100%{transform:translateX(-1.5rem)}}@keyframes slide-fade-in-backwards-move{0%{transform:translateX(0)}100%{transform:translateX(1.5rem)}}@keyframes slide-fade-out-backwards-move{0%{transform:translateX(-1.5rem)}100%{transform:translateX(0)}}@keyframes zoom-fade-in-move{0%{transform:scale(1.1)}100%{transform:scale(1)}}@keyframes zoom-fade-in-backwards-move{0%{transform:scale(1)}100%{transform:scale(1.1)}}@keyframes zoom-fade-out-backwards-move{0%{transform:scale(0.95)}100%{transform:scale(1)}}@keyframes slide-layers-out{0%{transform:translateX(0);opacity:1}100%{transform:translateX(-20%);opacity:calc(1 - var(--layer-blackout-opacity))}}@keyframes slide-layers-out-backwards{0%{transform:translateX(-20%);opacity:calc(1 - var(--layer-blackout-opacity))}100%{transform:translateX(0);opacity:1}}@keyframes push-out{0%{transform:scale(1);opacity:1}100%{transform:scale(0.7);opacity:0}}@keyframes push-out-backwards{0%{transform:scale(0.7);opacity:0}100%{transform:scale(1);opacity:1}}@keyframes slide-in-200{0%{transform:translateX(200%)}100%{transform:translateX(0)}}@keyframes slide-in-200-backwards{0%{transform:translateX(0)}100%{transform:translateX(200%)}}@keyframes reveal-in{0%{-webkit-clip-path:inset(0 100% 0 0);clip-path:inset(0 100% 0 0)}100%{-webkit-clip-path:inset(0 0 0 0);clip-path:inset(0 0 0 0)}}@keyframes reveal-in-backwards{0%{-webkit-clip-path:inset(0 0 0 0);clip-path:inset(0 0 0 0)}100%{-webkit-clip-path:inset(0 100% 0 0);clip-path:inset(0 100% 0 0)}}\n",".Avatar{--color-user: var(--color-primary);flex:none;align-items:center;justify-content:center;width:3.375rem;height:3.375rem;border-radius:50%;background:linear-gradient(var(--color-white) -125%, var(--color-user));color:white;font-weight:bold;display:flex;white-space:nowrap}.Avatar img:not(.emoji){border-radius:50%}.Avatar .emoji{width:1rem;height:1rem}.Avatar i{font-size:2.5rem}.Avatar.size-micro{width:1rem;height:1rem;font-size:0.5125rem}.Avatar.size-micro .emoji{width:.5625rem;height:.5625rem}.Avatar.size-tiny{width:2rem;height:2rem;font-size:.875rem}.Avatar.size-tiny .emoji{width:.875rem;height:.875rem}.Avatar.size-small{width:2.125rem;height:2.125rem;font-size:0.875rem}.Avatar.size-small .emoji{width:.875rem;height:.875rem}.Avatar.size-medium{width:2.75rem;height:2.75rem;font-size:1.1875rem}.Avatar.size-medium .emoji{width:1rem;height:1rem}.Avatar.size-large{font-size:1.3125rem}.Avatar.size-large i{font-size:3.5rem}.Avatar.size-large .emoji{width:1.3125rem;height:1.3125rem}.Avatar.size-jumbo{width:7.5rem;height:7.5rem;font-size:3.5rem}.Avatar.size-jumbo i{font-size:6rem}.Avatar.size-jumbo .emoji{width:3.5rem;height:3.5rem}.Avatar.online{position:relative}.Avatar.online::after{content:'';display:block;position:absolute;bottom:0.05rem;right:0.05rem;width:0.875rem;height:0.875rem;border-radius:50%;border:2px solid var(--color-background);background-color:#0ac630;flex-shrink:0}.Avatar.interactive{cursor:pointer}.Avatar img:not(.emoji){width:100%;height:100%}\n",".ProgressSpinner{position:relative;z-index:1;width:3.375rem;height:3.375rem;background:rgba(0,0,0,0.25) url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTkiIGhlaWdodD0iMTkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEwLjcxNyA5Ljc1TDE4LjMgMi4xNjdhLjY4NC42ODQgMCAxMC0uOTY3LS45NjdMOS43NSA4Ljc4MyAyLjE2NyAxLjJhLjY4NC42ODQgMCAxMC0uOTY3Ljk2N0w4Ljc4MyA5Ljc1IDEuMiAxNy4zMzNhLjY4NC42ODQgMCAxMC45NjcuOTY3bDcuNTgzLTcuNTgzIDcuNTgzIDcuNTgzYS42ODEuNjgxIDAgMDAuOTY3IDAgLjY4NC42ODQgMCAwMDAtLjk2N0wxMC43MTcgOS43NXoiIGZpbGw9IiNGRkYiIGZpbGwtcnVsZT0ibm9uemVybyIgc3Ryb2tlPSIjRkZGIiBzdHJva2Utd2lkdGg9Ii43NSIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPjwvc3ZnPg==) no-repeat 49% 49%;border-radius:50%;cursor:pointer}.ProgressSpinner.no-cross{background:transparent !important;pointer-events:none}.ProgressSpinner.square{background-image:none}.ProgressSpinner.square::after{content:'';position:absolute;width:.8125rem;height:.8125rem;border-radius:.125rem;background-color:#fff;left:50%;top:50%;transform:translate3d(-50%, -50%, 0)}.ProgressSpinner.size-s,.ProgressSpinner.size-m{width:auto;height:auto;background:transparent url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTUiIGhlaWdodD0iMTUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTguMjE4IDcuNWw1LjYzMy01LjYzM2EuNTA4LjUwOCAwIDEwLS43MTgtLjcxOEw3LjUgNi43ODIgMS44NjcgMS4xNDlhLjUwOC41MDggMCAxMC0uNzE4LjcxOEw2Ljc4MiA3LjVsLTUuNjMzIDUuNjMzYS41MDguNTA4IDAgMTAuNzE4LjcxOEw3LjUgOC4yMThsNS42MzMgNS42MzNhLjUwNi41MDYgMCAwMC43MTggMCAuNTA4LjUwOCAwIDAwMC0uNzE4TDguMjE4IDcuNXoiIGZpbGw9IiNGRkYiIGZpbGwtcnVsZT0ibm9uemVybyIgc3Ryb2tlPSIjRkZGIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+PC9zdmc+) no-repeat 49% 49%}.ProgressSpinner.size-s.square,.ProgressSpinner.size-m.square{background-image:none;width:.75rem;height:.75rem}.ProgressSpinner.size-xl{width:3.25rem;height:3.25rem}.ProgressSpinner.size-xl svg{width:3rem;height:3rem;margin:.125rem}.ProgressSpinner.size-xl circle{stroke-width:3px}.ProgressSpinner.transparent{background-color:transparent !important}.ProgressSpinner svg{display:block;transform:rotate(-90deg);transform-origin:50% 50%;animation:4s linear 0s infinite ProgressSpinnerAnimation}.ProgressSpinner circle{transition:stroke-dashoffset .5s}@keyframes ProgressSpinnerAnimation{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}\n",".Modal{position:relative;z-index:var(--z-modal)}.Modal.delete .modal-dialog,.Modal.error .modal-dialog,.Modal.confirm .modal-dialog,.Modal.pin .modal-dialog,.Modal.unpin-all .modal-dialog{max-width:23rem}.Modal.error .modal-content>div{margin-top:1rem}.Modal.narrow .modal-dialog{max-width:20rem}.Modal.report .modal-dialog{max-width:15rem}.Modal .modal-container{position:fixed;top:0;bottom:0;left:0;right:0;display:flex;justify-content:center;align-items:center}.Modal .modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:-1;background-color:rgba(0,0,0,0.25)}.Modal.transparent-backdrop .modal-backdrop{background-color:transparent}.Modal .modal-dialog{position:relative;display:inline-flex;flex-direction:column;width:100%;max-width:35rem;min-width:17.5rem;margin:2rem auto;background-color:var(--color-background);box-shadow:0 0.25rem 0.5rem 0.125rem var(--color-default-shadow);border-radius:var(--border-radius-default);transform:translate3d(0, -1rem, 0);transition:transform .2s ease, opacity .2s ease}body.animation-level-0 .Modal .modal-dialog{transition:none;transform:none !important}@media (max-width: 450px){.Modal .modal-dialog{max-width:calc(100vw - 3rem) !important}}.Modal.open .modal-dialog{transform:translate3d(0, 0, 0)}.Modal.closing .modal-dialog{transform:translate3d(0, 1rem, 0)}.Modal .modal-header,.Modal .modal-header-condensed{padding:1rem 1rem 0;display:flex;align-items:center;flex-shrink:0}.Modal .modal-title{font-size:1.25rem;font-weight:500;flex:1 1 auto;overflow:hidden;text-overflow:ellipsis}.Modal .modal-title:not(:only-child){margin:0 1.3125rem}.Modal .modal-header-condensed{padding:.5rem 1.25rem 0 .9375rem !important}.Modal .modal-header-condensed .modal-action-button{font-size:0.875rem;height:2.25rem;width:auto;line-height:1.625rem;margin-left:auto;padding-left:1.25rem;padding-right:1.25rem;min-width:5rem}.Modal .modal-content{width:100%;flex-grow:1;padding:1rem;overflow-y:auto}.Modal .modal-content b,.Modal .modal-content strong{word-break:break-word}.Modal .modal-title,.Modal .modal-content,.Modal .modal-content>p{unicode-bidi:plaintext;text-align:initial}.Modal .dialog-buttons{display:flex;align-items:flex-end}.Modal .dialog-buttons .confirm-dialog-button+.confirm-dialog-button{margin-left:1rem}.Modal .confirm-dialog-button{width:auto;height:auto;margin-left:auto;text-align:right;font-weight:500;white-space:pre-wrap}\n",".ListItem{position:relative}.ListItem .ListItem-button{width:100%;background-color:var(--background-color);border:none !important;box-shadow:none !important;outline:none !important;display:flex;padding:1rem;position:relative;overflow:hidden;line-height:1.5rem;white-space:nowrap;color:var(--color-text);border-radius:var(--border-radius-default);--ripple-color: rgba(0, 0, 0, .08)}.ListItem .ListItem-button>i{font-size:1.5rem;margin-right:2rem;color:var(--color-text-secondary)}.ListItem .user-status,.ListItem .group-status,.ListItem .title,.ListItem .subtitle{text-align:initial;unicode-bidi:plaintext}.ListItem.multiline .ListItem-button>i{position:relative;top:.25rem}.ListItem.disabled{pointer-events:none}.ListItem.disabled .ListItem-button{opacity:0.5}.ListItem:not(.disabled):not(.is-static) .ListItem-button{cursor:pointer}@media (hover: hover){.ListItem:not(.disabled):not(.is-static) .ListItem-button:hover,.ListItem:not(.disabled):not(.is-static) .ListItem-button:focus{--background-color: var(--color-chat-hover)}}@media (max-width: 600px){.ListItem:not(.disabled):not(.is-static) .ListItem-button.active{--background-color: var(--color-chat-hover)}}@media (min-width: 600px){.ListItem:not(.has-ripple):not(.is-static) .ListItem-button:active,body.animation-level-0 .ListItem .ListItem-button:active{--background-color: var(--color-item-active) !important}}.ListItem.has-menu-open .ListItem-button{--background-color: var(--color-chat-hover)}.ListItem.narrow{margin-bottom:0.75rem}.ListItem.narrow .ListItem-button{padding:0.5rem 1rem}.ListItem.inactive{pointer-events:none}.ListItem.focus{--background-color: var(--color-chat-hover)}.ListItem.destructive .ListItem-button{color:var(--color-error)}.ListItem.destructive .ListItem-button i{color:inherit}.ListItem-context-menu{position:absolute}.ListItem-context-menu .bubble{width:auto}.ListItem-context-menu .bubble .MenuItem button{padding-left:1rem !important;padding-right:2rem !important}.ListItem.chat-item-clickable{margin:0 -0.5rem}body.is-ios .ListItem.chat-item-clickable,body.is-macos .ListItem.chat-item-clickable{--color-text-secondary: var(--color-text-secondary-apple)}.ListItem.chat-item-clickable .ListItem-button{padding:.5625rem .6975rem .5625rem .5625rem}.ListItem.chat-item-clickable .Avatar{flex-shrink:0;margin-right:0.5rem}.ListItem.chat-item-clickable .info{flex-grow:1;overflow:hidden}.ListItem.chat-item-clickable .title,.ListItem.chat-item-clickable .subtitle{overflow:hidden;display:flex;justify-content:flex-start;align-items:center}.ListItem.chat-item-clickable h3,.ListItem.chat-item-clickable .last-message,.ListItem.chat-item-clickable .status,.ListItem.chat-item-clickable .typing-status{font-size:1rem;line-height:1.6875rem;margin:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;text-align:initial}.ListItem.chat-item-clickable .title h3{font-weight:500}.ListItem.chat-item-clickable .title .VerifiedIcon{width:1.25rem;height:1.25rem;margin-left:0.25rem}.ListItem.chat-item-clickable .title .emoji{vertical-align:text-bottom;background-position:0 0;flex-shrink:0}.ListItem.chat-item-clickable .contact-phone,.ListItem.chat-item-clickable .contact-username{font-size:0.875rem;line-height:1.25rem;color:var(--color-text-secondary)}.ListItem.chat-item-clickable .ChatInfo{display:flex;align-items:center;flex-grow:1;overflow:hidden}.ListItem.chat-item-clickable .ChatInfo .status,.ListItem.chat-item-clickable .ChatInfo .typing-status{font-size:0.875rem;line-height:1.25rem;color:var(--color-text-secondary);display:inline-block}.ListItem.chat-item-clickable .ChatInfo .status.online,.ListItem.chat-item-clickable .ChatInfo .typing-status.online{color:var(--color-primary)}.ListItem.chat-item-clickable .ChatInfo .status[dir=rtl],.ListItem.chat-item-clickable .ChatInfo .status[dir=auto],.ListItem.chat-item-clickable .ChatInfo .typing-status[dir=rtl],.ListItem.chat-item-clickable .ChatInfo .typing-status[dir=auto]{text-align:initial;width:100%}.ListItem.chat-item-clickable .ChatInfo .status .group-status:only-child,.ListItem.chat-item-clickable .ChatInfo .status .user-status:only-child,.ListItem.chat-item-clickable .ChatInfo .typing-status .group-status:only-child,.ListItem.chat-item-clickable .ChatInfo .typing-status .user-status:only-child{display:flow-root}.ListItem.chat-item-clickable .contact-phone,.ListItem.chat-item-clickable .contact-username,.ListItem.chat-item-clickable h3,.ListItem.chat-item-clickable .last-message,.ListItem.chat-item-clickable .status,.ListItem.chat-item-clickable .typing-status{text-align:initial;unicode-bidi:plaintext}body.is-ios .ListItem.chat-item-clickable .last-message,body.is-macos .ListItem.chat-item-clickable .last-message,body.is-ios .ListItem.chat-item-clickable .status,body.is-macos .ListItem.chat-item-clickable .status,body.is-ios .ListItem.chat-item-clickable .typing-status,body.is-macos .ListItem.chat-item-clickable .typing-status{font-size:.9375rem}.ListItem.chat-item-clickable[dir=rtl] .ListItem-button{padding:.5625rem .5625rem .5625rem .6975rem}.ListItem.chat-item-clickable[dir=rtl] .Avatar{margin-left:0.5rem;margin-right:0}.ListItem.chat-item-clickable[dir=rtl] .info>.status{width:100%}.ListItem.search-result-message .title{padding-right:.15rem}.ListItem.search-result-message h3{max-width:80%}.ListItem.search-result-message h3,.ListItem.search-result-message .subtitle{font-size:1rem;line-height:1.5rem;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;text-align:left}.ListItem.search-result-message .LastMessageMeta{margin-left:auto;margin-right:0}.ListItem.search-result-message .subtitle{color:var(--color-text-secondary);margin-right:2rem}.ListItem.search-result-message .subtitle .matching-text-highlight{color:var(--color-text);background:#CAE3F7;border-radius:0.25rem;padding:0 0.125rem}.ListItem.search-result-message[dir=rtl] .LastMessageMeta{margin-left:0;margin-right:auto}.ListItem.search-result-message[dir=rtl] .subtitle{margin-right:0;display:block}.ListItem.picker-list-item{margin:0}.ListItem.picker-list-item .ListItem-button{padding-left:0;display:flex;align-items:center}.ListItem.picker-list-item .Avatar{width:3rem;height:3rem}.ListItem.picker-list-item .Checkbox{flex-shrink:0;height:1.5rem;margin:0;padding-left:4rem}.ListItem.picker-list-item[dir=rtl] .Checkbox{padding-left:0;padding-right:4rem}.ListItem .multiline-item{white-space:initial;overflow:hidden}.ListItem .multiline-item .title,.ListItem .multiline-item .subtitle{display:block;text-align:initial}.ListItem .multiline-item .title{line-height:1.25rem;overflow:hidden;text-overflow:ellipsis}.ListItem .multiline-item .subtitle{font-size:0.875rem;line-height:1.5rem;color:var(--color-text-secondary)}.ListItem .multiline-item .subtitle+.subtitle{margin-top:-0.25rem}.ListItem .multiline-item .subtitle.black{color:var(--color-text)}.ListItem[dir=rtl] .ListItem-button>i{margin-left:2rem;margin-right:0}\n",".VerifiedIcon{display:inline-block;flex-shrink:0;width:1.5rem;height:1.5rem;background-image:url(icon-verified.a2a4fb48197a45cb301b64e39d1a8427.svg);background-repeat:no-repeat;background-size:100%;background-position:center}\n",".typing-status{display:flex;align-items:baseline}.typing-status .sender-name::after{content:'\\00a0';color:var(--color-text-secondary)}.typing-status .ellipsis{display:flex;width:1rem;overflow:hidden}.typing-status .ellipsis::after{content:'...';animation:typing-animation 1s steps(4, start) infinite}html[lang=ar] .typing-status .ellipsis::after,html[lang=fa] .typing-status .ellipsis::after{animation-name:typing-animation-rtl}@keyframes typing-animation{from{transform:translateX(-1rem)}}@keyframes typing-animation-rtl{from{transform:translateX(1rem)}}\n",".Notification-container{position:relative;width:24rem;max-width:100vw;margin:.25rem auto;z-index:var(--z-notification)}@media (min-width: 1276px){.Notification-container{transition:transform var(--layer-transition)}}.Notification-container:first-of-type{margin-top:4.25rem}.has-header-tools .Notification-container:first-of-type{margin-top:7.375rem}.Notification{background:rgba(32,32,32,0.8) url(\"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48Y2lyY2xlIGZpbGw9IiNGRkYiIGN4PSIxMiIgY3k9IjEyIiByPSIxMiIvPjxjaXJjbGUgZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJub256ZXJvIiBjeD0iMTIiIGN5PSI2LjUiIHI9IjEuNSIvPjxwYXRoIGQ9Ik0xMiA5LjVjLS41NTIgMC0xIC4zNy0xIC44MjZ2Ny4zNDhjMCAuNDU2LjQ0OC44MjYgMSAuODI2czEtLjM3IDEtLjgyNnYtNy4zNDhjMC0uNDU2LS40NDgtLjgyNi0xLS44MjZ6IiBmaWxsPSIjMDAwIiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48L2c+PC9zdmc+\") no-repeat 0.9375rem 50%;background-size:1.5rem;border-radius:var(--border-radius-default);padding:.9375rem .9375rem .9375rem 3.375rem;color:#fff;margin:0 .5rem}.Notification .text-entity-link,.Notification .text-entity-link:hover,.Notification .text-entity-link:active{color:#fff !important;text-decoration:underline}.Notification .content{line-height:1.25;word-break:break-word;font-size:.9375rem}\n",".Radio{display:block;position:relative;padding-left:4.5rem;text-align:left;margin-bottom:1.5rem;line-height:1.5rem;cursor:pointer}.Radio.disabled{pointer-events:none;opacity:0.5}.Radio.hidden-widget{cursor:default}.Radio.hidden-widget .Radio-main::before,.Radio.hidden-widget .Radio-main::after{visibility:hidden}.Radio>input{position:absolute;z-index:var(--z-below);opacity:0}.Radio .Radio-main::before,.Radio .Radio-main::after{content:'';display:block;position:absolute;left:1.0625rem;top:50%;width:1.25rem;height:1.25rem;transform:translateY(-50%)}.Radio .Radio-main::before{border:2px solid var(--color-borders-input);border-radius:50%;background-color:var(--color-background);opacity:1;transition:border-color .1s ease, opacity .1s ease}.Radio .Radio-main::after{left:1.375rem;width:0.625rem;height:0.625rem;border-radius:50%;background:var(--color-primary);opacity:0;transition:opacity .1s ease}.Radio .Radio-main .label{display:block;word-break:break-word;unicode-bidi:plaintext;text-align:left}.Radio .Radio-main .subLabel{display:block;font-size:0.875rem;line-height:1rem;color:var(--color-text-secondary);unicode-bidi:plaintext}.Radio input:checked ~ .Radio-main::before{border-color:var(--color-primary)}.Radio input:checked ~ .Radio-main::after{opacity:1}.Radio.loading .Radio-main::before,.Radio.loading .Radio-main::after{opacity:0 !important}.Radio.loading .Spinner{position:absolute;left:1.0625rem;top:50%;transform:translateY(-50%);opacity:0;animation:fade-in .2s ease forwards;--spinner-size: 1.25rem}.Radio[dir=rtl]{padding-left:0;padding-right:4.5rem}.Radio[dir=rtl] .Radio-main{text-align:right}.Radio[dir=rtl] .Radio-main::before{left:auto;right:1.0625rem}.Radio[dir=rtl] .Radio-main::after{left:auto;right:1.375rem}.Radio[dir=rtl] .label,.Radio[dir=rtl] .subLabel{text-align:right}.Radio[dir=rtl].loading .Spinner{left:auto;right:1.0625rem}@keyframes fade-in{from{opacity:0}to{opacity:1}}\n",".Tab{flex:1 1 auto;-webkit-appearance:none;appearance:none;background:none;width:auto;margin:0;border:none;padding:.625rem .25rem;font-weight:500;color:var(--color-text-secondary);cursor:pointer;border-top-left-radius:var(--border-radius-messages-small);border-top-right-radius:var(--border-radius-messages-small)}.Tab,.Tab:active,.Tab:focus{outline:none}.Tab.active{cursor:default;color:var(--color-primary)}.Tab.active i{opacity:1}.Tab:not(.active):hover{background:var(--color-interactive-element-hover)}.Tab>span{position:relative;display:inline-flex;align-items:center}.Tab .badge{min-width:1.25rem;height:1.25rem;margin-inline-start:0.5rem;background:var(--color-gray);border-radius:0.75rem;padding:0 .3125rem;color:white;font-size:0.875rem;line-height:1.3125rem;font-weight:500;text-align:center;flex-shrink:0}body.is-ios .Tab .badge,body.is-macos .Tab .badge{line-height:1.25rem}.Tab .badge.active{background:var(--color-primary)}.Tab i{position:absolute;bottom:calc(-.625rem - 1px);left:0;opacity:0;background-color:var(--color-primary);height:.1875rem;width:100%;border-radius:.1875rem .1875rem 0 0;pointer-events:none;box-sizing:content-box;transform-origin:left}.Tab i.animate{transition:transform var(--slide-transition)}body.animation-level-0 .Tab i.animate{transition:none !important}\n",".TabList{position:sticky;top:0;flex-shrink:0;display:flex;justify-content:space-between;align-items:flex-end;font-size:.875rem;flex-wrap:nowrap;box-shadow:0 2px 2px var(--color-light-shadow);background-color:var(--color-background);overflow-x:auto;overflow-y:hidden;scrollbar-width:none;scrollbar-color:rgba(0,0,0,0)}.TabList.big{font-size:1rem;--border-radius-messages-small: 0}.TabList::-webkit-scrollbar{height:0}.TabList::-webkit-scrollbar-thumb{background-color:rgba(0,0,0,0)}\n",".DeleteChatModal .modal-dialog{max-width:20rem}.DeleteChatModal .modal-header{padding:1.125rem 1.25rem 0}.DeleteChatModal .modal-title:not(:only-child){margin:0 0 0 .75rem}.DeleteChatModal .modal-content{padding:.5rem 1.25rem}.DeleteChatModal .confirm-dialog-button{margin-right:-.625rem}\n",".SearchInput{position:relative;width:100%;color:rgba(var(--color-text-secondary-rgb), 0.5);background-color:var(--color-chat-hover);border:2px solid var(--color-chat-hover);border-radius:1.375rem;transition:border-color 0.15s ease}.SearchInput.with-picker-item{display:flex}.SearchInput.with-picker-item .icon-search{display:none}.SearchInput.with-picker-item input{padding-left:.5rem}.SearchInput.with-picker-item[dir=rtl] input{padding-right:.5rem;padding-left:0}.SearchInput.has-focus{border-color:var(--color-primary);caret-color:var(--color-primary);background-color:var(--color-background)}.SearchInput.has-focus input+i{color:var(--color-primary)}.SearchInput input{height:2.5rem;margin-bottom:0;border:none !important;border-radius:1.375rem;background-color:transparent !important;box-shadow:none !important;padding:calc(0.4375rem - var(--border-width)) calc(2.625rem - var(--border-width)) calc(0.5rem - var(--border-width)) calc(2.625rem - var(--border-width))}.SearchInput input::placeholder{color:var(--color-placeholders)}.SearchInput>i{position:absolute;top:.5rem;left:.75rem;font-size:1.5rem}.SearchInput .Loading{position:absolute;top:.5rem;right:.5rem;height:1.5rem}.SearchInput .Loading .Spinner{--spinner-size: 1.5rem}.SearchInput .Button{position:absolute;top:.125rem;right:.125rem;font-size:1rem}@media (max-width: 600px){.SearchInput input{height:2.5rem;border-radius:1.25rem;padding-left:calc(2.625rem - var(--border-width))}.SearchInput i{top:0.5rem}}.SearchInput[dir=rtl] input{direction:rtl}.SearchInput[dir=rtl]>i{left:auto;right:.75rem}.SearchInput[dir=rtl] .Loading{left:.5rem;right:auto}.SearchInput[dir=rtl] .Button{left:.125rem;right:auto}\n",".PickerSelectedItem{display:flex;align-items:center;background:var(--color-chat-hover);height:2rem;min-width:2rem;margin-left:0.5rem;margin-bottom:0.5rem;padding-right:1rem;border-radius:1rem;cursor:pointer;position:relative;overflow:hidden;flex-shrink:1;transition:background-color .15s ease;max-width:calc(50% - 0.5rem)}.PickerSelectedItem.minimized{padding-right:0}.PickerSelectedItem:hover{background-color:var(--color-item-active)}.PickerSelectedItem.closeable:hover{background-color:rgba(var(--color-error-rgb), 0.16)}.PickerSelectedItem.closeable:hover .item-remove{opacity:1}.PickerSelectedItem.closeable:hover .Avatar,.PickerSelectedItem.closeable:hover .item-icon{opacity:0}.PickerSelectedItem.search-date .item-remove{background:var(--color-primary)}.PickerSelectedItem.search-date:hover{background:var(--color-chat-hover)}.PickerSelectedItem.search-date .item-name{font-size:0.875rem}.SearchInput .PickerSelectedItem{flex:1 0 auto;position:relative;top:.25rem;left:-.125rem;color:var(--color-text-secondary)}.PickerSelectedItem .Avatar,.PickerSelectedItem .item-icon{width:2rem;height:2rem;opacity:1;flex-shrink:0;transition:opacity .15s ease}.PickerSelectedItem .Avatar i,.PickerSelectedItem .item-icon i{font-size:2rem}.PickerSelectedItem .item-icon{display:flex;align-items:center;justify-content:center;padding:0.375rem;border-radius:50%;background-color:var(--color-primary);color:white}.PickerSelectedItem .item-icon i{font-size:1.25rem;position:relative;top:-1px}.PickerSelectedItem .item-name{margin-left:0.5rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.PickerSelectedItem .item-name .emoji.emoji-small{width:1.125rem;height:1.125rem;background-size:1.125rem;vertical-align:-2px}.PickerSelectedItem .item-remove{position:absolute;left:0;top:0;width:2rem;height:2rem;border-radius:50%;display:flex;align-items:center;justify-content:center;background-color:var(--color-error);font-size:1.5rem;color:white;opacity:0;transition:opacity .15s ease}.PickerSelectedItem[dir=rtl]{padding-left:1rem;padding-right:0}.PickerSelectedItem[dir=rtl].minimized{padding-right:0;padding-left:0}.SearchInput .PickerSelectedItem[dir=rtl]{left:auto;right:-.125rem}.PickerSelectedItem[dir=rtl] .item-name{margin-left:0;margin-right:0.5rem}.PickerSelectedItem[dir=rtl] .item-remove{left:auto;right:0}\n",".MessageOutgoingStatus{width:1.19rem;height:1.19rem;overflow:hidden;display:inline-block;line-height:1;font-size:1.1875rem}.MessageOutgoingStatus i{background:var(--background-color)}.MessageOutgoingStatus .icon-message-succeeded{padding-left:0.13rem}.MessageOutgoingStatus .Transition{width:100%;height:100%}\n",".LastMessageMeta{margin-right:.2rem;padding:.3rem 0 .15rem;flex-shrink:0;font-size:0.75rem;line-height:1;display:flex;align-items:center}.LastMessageMeta .MessageOutgoingStatus{color:var(--color-text-meta-colored);margin-right:0.1rem;font-size:1.15rem}body.is-ios .LastMessageMeta .MessageOutgoingStatus{margin-bottom:-.125rem}.LastMessageMeta .time{color:var(--color-text-meta);line-height:1.15rem}\n",".Badge-transition{opacity:1;transition:transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1)}.Badge-transition:not(.open){transform:scale(0);opacity:0}.Badge-transition:not(.shown){display:none}.Badge-transition.closing{transition:transform .2s ease-out, opacity .2s ease-out}.Badge-wrapper{display:flex}.Badge-wrapper .Badge{margin-inline-start:.5rem}.Badge{min-width:1.5rem;height:1.5rem;background:var(--color-gray);border-radius:0.75rem;padding:0 .4375rem;color:white;font-size:0.875rem;line-height:1.5625rem;font-weight:500;text-align:center;flex-shrink:0}body.is-macos .Badge{line-height:1.5rem}body.is-ios .Badge{line-height:1.375rem;min-width:1.375rem;height:1.375rem;padding:0 .375rem}.Badge.mention,.Badge.unread:not(.muted){background:var(--color-green);color:var(--color-white)}.Badge.pinned:not(.unread){color:var(--color-pinned);background:transparent;width:1.5rem;padding:0}.Badge.pinned:not(.unread) i{font-size:1.5rem}.Badge.mention{width:1.5rem;padding:0.25rem}.Badge.mention i{font-size:1rem;vertical-align:super}body.is-ios .Badge.mention{width:1.375rem;padding:0.25rem}body.is-ios .Badge.mention i{font-size:.875rem}\n",".Chat{--background-color: var(--color-background);position:absolute;top:0;left:0;margin:0;width:100%}body.is-ios .Chat,body.is-macos .Chat{--color-text-meta: var(--color-text-meta-apple)}.Chat.animate-opacity{will-change:opacity;transition:opacity .2s ease-out}.Chat.animate-transform{will-change:transform;transition:transform .2s ease-out}.Chat:hover .Avatar.online::after,.Chat.ListItem.has-menu-open .Avatar.online::after{border-color:var(--color-chat-hover)}@media (max-width: 600px){.Chat.selected{--background-color: var(--color-chat-hover) !important}.Chat.selected .Avatar.online::after{border-color:var(--color-chat-hover)}}@media (min-width: 600px){.Chat.selected,.Chat.selected:hover{--background-color: var(--color-chat-active) !important}.Chat.selected .Avatar.online::after,.Chat.selected:hover .Avatar.online::after{border-color:var(--color-chat-active) !important;background:var(--color-white)}.Chat.selected .ListItem-button,.Chat.selected:hover .ListItem-button{--background-color: var(--color-chat-active) !important;--color-text: var(--color-white);--color-text-meta-colored: var(--color-white);--color-text-meta: var(--color-white);--color-text-secondary: var(--color-white);--color-error: var(--color-white);--color-pinned: var(--color-white)}.Chat.selected .icon-muted-chat,.Chat.selected:hover .icon-muted-chat{color:var(--color-white) !important}.Chat.selected .Badge:not(.pinned),.Chat.selected:hover .Badge:not(.pinned){background:var(--color-white);color:var(--color-chat-active)}}.Chat .status{flex-shrink:0}.Chat .info .title,.Chat .info .subtitle{padding-right:.125rem}.Chat .info .subtitle{margin-top:-.125rem}.Chat .info h3{width:auto;max-width:80%}.Chat .info .icon-muted-chat{font-size:1.25rem;margin-left:0.25rem;margin-top:-.0625rem;color:#C6C8CA}body.is-ios .Chat .info .icon-muted-chat{margin-top:0;margin-right:.5rem}.Chat .info .LastMessageMeta{margin-left:auto}body.is-ios .Chat .info .LastMessageMeta{font-size:.875rem;margin-right:0}.Chat .info .last-message,.Chat .info .typing-status{padding-right:0.25rem;flex-grow:1;color:var(--color-text-secondary);unicode-bidi:plaintext}.Chat .info .last-message[dir=ltr],.Chat .info .typing-status[dir=ltr]{text-align:left}.Chat .info .last-message .sender-name,.Chat .info .typing-status .sender-name{color:var(--color-text)}.Chat .info .last-message .draft,.Chat .info .typing-status .draft{color:var(--color-error)}.Chat .info .last-message .draft::after{content:': '}.Chat .info .last-message .colon{margin-inline-end:.25rem}.Chat .info .last-message img{width:1.25rem;height:1.25rem;object-fit:cover;border-radius:.125rem;vertical-align:-.25rem;margin-inline-end:.25rem}body.is-ios .Chat .info .last-message img{width:1.125rem;height:1.125rem;vertical-align:-.1875rem}.Chat .info .last-message img.round{border-radius:.625rem}.Chat .info .last-message .emoji-small{width:1rem;height:1rem;vertical-align:-.125rem}.Chat .info .last-message .icon-play{position:relative;display:inline-block;font-size:.75rem;color:#fff;margin-inline-start:-1.25rem;margin-inline-end:0.5rem;bottom:0.0625rem}body.is-ios .Chat .info .last-message .icon-play{margin-inline-start:-1.125rem;bottom:0}.Chat[dir=rtl] .info .LastMessageMeta{margin-left:0;margin-right:auto}.Chat[dir=rtl] .info .title,.Chat[dir=rtl] .info .subtitle{padding-left:.15rem;padding-right:0}.Chat[dir=rtl] .info .icon-muted-chat{margin-left:0;margin-right:0.25rem}.Chat[dir=rtl] .info .last-message,.Chat[dir=rtl] .info .typing-status{padding-left:0.5rem;padding-right:0;text-align:right;unicode-bidi:plaintext}\n",".AnimatedEmoji{margin-bottom:0.75rem}.AnimatedEmoji img{position:absolute;width:100%;height:100%}.AnimatedEmoji img.like-sticker-thumb{transform:scale(0.8)}\n",".EmptyFolder{width:100%;height:80%;display:flex;align-items:center;justify-content:center;flex-direction:column}@media (max-height: 480px){.EmptyFolder{height:100%}}.EmptyFolder .sticker{height:8rem;margin-bottom:1.875rem}.EmptyFolder .title{font-size:1.25rem;margin-bottom:.125rem}.EmptyFolder .description{font-size:.875rem;color:var(--color-text-secondary)}body.is-ios .EmptyFolder .description,body.is-macos .EmptyFolder .description{color:var(--color-text-secondary-apple)}.EmptyFolder .Button.pill{margin-top:.625rem;font-weight:500;padding-inline-start:.75rem;unicode-bidi:plaintext}.EmptyFolder .Button.pill i{margin-inline-end:.625rem;font-size:1.5rem}\n",".NothingFound{display:flex;align-items:center;justify-content:center;color:var(--color-text-meta)}.NothingFound.with-description{flex-direction:column}.NothingFound .AnimatedSticker{margin:0 auto}.NothingFound .description{color:var(--color-text-secondary);font-size:.875rem;text-align:center;margin:1rem 0 0;unicode-bidi:plaintext}\n",".Media{height:0;padding-bottom:100%;overflow:hidden;position:relative;cursor:pointer}.Media .video-duration{position:absolute;left:.25rem;top:.25rem;background:rgba(0,0,0,0.25);color:#fff;font-size:.75rem;padding:0 .3125rem;border-radius:.1875rem;line-height:1.125rem}.Media img{position:absolute;left:0;top:0;width:100%;height:100%;object-fit:cover}\n",".WebLink{min-height:3rem;padding:.25rem 0 0 3.75rem;font-size:0.875rem;line-height:1.125rem;position:relative}.WebLink+.WebLink{margin-top:1.5rem}.WebLink.without-media::before{content:attr(data-initial);width:3rem;height:3rem;position:absolute;left:0;top:0;background-color:var(--color-webpage-initial-background);color:#fff;display:flex;align-items:center;justify-content:center;border-radius:var(--border-radius-messages-small);text-transform:uppercase;font-weight:500;font-size:1.5rem}.WebLink .Media{position:absolute;left:0;top:0;width:3rem;height:3rem;cursor:default !important;padding-bottom:unset !important;border-radius:var(--border-radius-messages-small) !important}.WebLink .site-name,.WebLink .site-description,.WebLink .site-title{word-break:break-word;text-align:initial}.WebLink .site-name{display:block;color:var(--color-links);font-weight:400;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.WebLink .site-title{font-size:1rem;font-weight:400;margin-bottom:.0625rem;line-height:1.3125rem}.WebLink .sender-name,.WebLink .site-description{margin-bottom:0;color:var(--color-text-secondary);line-height:1.125rem;max-height:2.25rem;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.WebLink .sender-name{margin-top:.25rem}.WebLink .site-description .emoji{width:1rem !important;height:1rem !important}.WebLink[dir=rtl]{padding:.25rem 3.75rem 0 0}.WebLink[dir=rtl] .Media,.WebLink[dir=rtl].without-media::before{left:auto;right:0}.WebLink[dir=rtl] .content{text-align:right}\n",".File{--secondary-color: var(--color-text-secondary);display:flex;align-items:center}.Message.own .File{--secondary-color: var(--color-text-green)}.content-inner .File{min-width:14rem}@media (max-width: 340px){.content-inner .File{min-width:11rem}}.File .file-icon-container{position:relative}.File .file-progress,.File .file-icon,.File .file-preview{width:3.375rem;height:3.375rem;margin-inline-end:.75rem;border-radius:var(--border-radius-messages-small);background:var(--color-primary);display:flex;align-items:center;justify-content:center}.File .file-progress{position:absolute;top:0;left:0}.File .file-icon{padding:1rem .75rem .5rem;align-items:flex-end;flex-shrink:0;position:relative;color:white}.File .file-icon .file-ext{font-size:1rem;font-weight:500;transition:opacity .15s}.File .file-icon::after{content:\"\";display:block;position:absolute;top:0;right:0;border-bottom-left-radius:0.25rem;background:rgba(0,0,0,0.25);border-color:transparent var(--background-color) transparent var(--background-color);border-width:0 1.125rem 1.125rem 0;border-style:solid;transition:border-width .15s ease-in}.File .file-preview{background:transparent;overflow:hidden}.File .file-preview+.action-icon,.File .file-preview+.file-progress{background:rgba(0,0,0,0.5);border-radius:var(--border-radius-messages-small)}.File .file-preview img{object-fit:cover}.File .action-icon{color:#fff;font-size:1.5rem;position:absolute;top:0;start:0;width:3.375rem;height:3.375rem;display:flex;align-items:center;justify-content:center;opacity:0;transition:opacity .25s}.File.interactive .file-icon-container{cursor:pointer}.File.interactive .file-icon-container:hover .file-icon::after{border-width:0}.File.interactive .file-icon-container:hover .action-icon{opacity:1}.File.interactive .file-icon-container:hover .action-icon.hidden{opacity:0}.File.interactive .file-icon-container:hover .file-ext{opacity:0}.File .file-info{margin-top:.1875rem;margin-right:.125rem;white-space:nowrap;overflow:hidden;flex-grow:1}.File .file-info+.Link{font-size:.75rem;color:var(--color-text-secondary);padding-left:1rem;white-space:nowrap}.File .file-title{font-size:1rem;line-height:1.5rem;font-weight:500;overflow:hidden;text-overflow:ellipsis}.File .file-title .emoji{vertical-align:-4px}.File .file-subtitle{font-size:.875rem;line-height:.9375rem;color:var(--secondary-color);max-width:100%;overflow:hidden;text-overflow:ellipsis}.File .file-subtitle span+span::before{content:'\\00a0\\2022\\00a0'}.File.smaller{--background-color: var(--color-background);--border-radius-messages-small: .3125rem}.File.smaller .action-icon,.File.smaller .file-progress,.File.smaller .file-icon,.File.smaller .file-preview{width:3rem;height:3rem}.File.smaller .file-icon{padding-bottom:.375rem}.File.smaller .file-icon::after{border-width:0 1rem 1rem 0}.File.smaller .file-info{margin-top:-.125rem}.File.smaller .file-title{font-weight:400}.File.smaller .file-subtitle{line-height:1rem}.File:dir(rtl) .file-progress,.File:dir(rtl) .file-icon,.File:dir(rtl) .file-preview,.File[dir=rtl] .file-progress,.File[dir=rtl] .file-icon,.File[dir=rtl] .file-preview{margin-left:.75rem;margin-right:0}.File:dir(rtl) .file-info,.File[dir=rtl] .file-info{text-align:right}.File:dir(rtl) .file-info+.Link,.File[dir=rtl] .file-info+.Link{padding-left:0;padding-right:1rem}.File:dir(rtl) .action-icon,.File[dir=rtl] .action-icon{left:auto;right:0}.File .file-progress.red,.File .file-icon.red{background-color:var(--color-error)}.File .file-progress.orange,.File .file-icon.orange{background-color:var(--color-warning)}.File .file-progress.green,.File .file-icon.green{background-color:var(--color-text-green)}\n",".Audio{display:flex;align-items:flex-start}.Audio.media-inner{overflow:visible}.Audio.own{--color-text-secondary: var(--accent-color);--color-interactive-active: var(--color-text-green);--color-interactive-inactive: rgba(var(--color-text-green-rgb), 0.4);--color-interactive-buffered: rgba(var(--color-text-green-rgb), 0.4)}.theme-dark .Audio.own{--color-text-green-rgb: 255, 255, 255;--color-text-green: var(--color-white)}.Audio.own .Button{--color-primary: var(--color-text-green);--color-primary-shade: var(--color-green);--color-primary-shade-darker: var(--color-green-darker);--color-white: var(--color-background-own)}.theme-dark .Audio.own .Button{--color-primary-shade: #fff;--color-primary-shade-darker: #fff}.Audio .toggle-play{margin-inline-end:.5rem}.Audio .toggle-play.smaller{width:3rem;height:3rem;margin-inline-end:.75rem}.Audio .toggle-play.smaller i{font-size:1.625rem;margin-top:-.025rem}.Audio .toggle-play i{position:absolute}.Audio .toggle-play i.icon-play{margin-left:.125rem}@media (max-width: 600px){.Audio .toggle-play i.icon-play{margin-left:.0625rem}}.Audio .toggle-play .icon-play,.Audio .toggle-play .icon-pause{opacity:1;transform:scale(1);transition:opacity 0.4s,transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1)}.Audio .toggle-play.play .icon-pause,.Audio .toggle-play.pause .icon-play,.Audio .toggle-play.loading .icon-play,.Audio .toggle-play.loading .icon-pause{opacity:0;transform:scale(0.5)}.Audio .media-loading{pointer-events:none}.Audio .media-loading .interactive{pointer-events:auto}.Audio .download-button{position:absolute;width:1.125rem !important;height:1.125rem !important;padding:0;left:1.5rem;top:1.5rem;border:0.125rem solid var(--background-color);z-index:1}.Audio .download-button i{font-size:0.8125rem}.Audio.bigger .download-button{left:2rem;top:2rem;border:0.125rem solid var(--color-background)}.Audio .content{align-self:center;min-width:0;flex-grow:1;text-align:initial}.Audio .content-row{display:flex;justify-content:space-between}.Audio .title{font-weight:500;margin:0;line-height:1.25;overflow:hidden;text-overflow:ellipsis}.Audio .voice-duration{margin:.25rem 0 0;font-size:.875rem;color:var(--color-text-secondary)}.Audio .voice-duration span{margin-left:0.25rem;font-size:1.5rem;line-height:.875rem;vertical-align:middle}.Audio:not(.own) .voice-duration span{color:var(--color-primary)}.Audio .waveform{cursor:pointer;margin-left:1px}.Audio .meta,.Audio .performer,.Audio .date{font-size:.875rem;line-height:1;color:var(--color-text-secondary);margin:0}.Audio .duration{margin:.1875rem 0 0;font-size:.875rem;color:var(--color-text-secondary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.Audio .seekline{width:calc(100% - 2px);padding-left:6px;margin-bottom:.3125rem;height:12px;position:relative;margin-left:-6px;top:1px;cursor:pointer}.Audio .seekline::before{content:'';position:absolute;width:100%;left:6px;top:6px;height:2px;background-color:var(--color-interactive-inactive);border-radius:2px}.Audio .seekline-buffered-progress,.Audio .seekline-play-progress{position:absolute;height:2px;border-radius:2px;overflow:hidden;width:100%;top:6px;left:6px}.Audio .seekline-buffered-progress i,.Audio .seekline-play-progress i{position:absolute;width:100%;background-color:var(--color-interactive-active);height:2px;border-radius:2px;right:100%}.Audio .seekline-buffered-progress i{background-color:var(--color-interactive-buffered) !important}.Audio .seekline-thumb{position:absolute;width:100%;top:7px;left:0}.Audio .seekline-thumb i{pointer-events:none;position:absolute;width:100%;right:100%}.Audio .seekline-thumb i::after{content:'';position:absolute;top:-6px;right:-12px;width:12px;height:12px;border-radius:6px;background:var(--color-interactive-active)}.Audio.bigger .content{margin-top:.1875rem}.Audio.bigger .title{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-weight:400;line-height:1.5rem}.Audio.bigger .meta,.Audio.bigger .performer,.Audio.bigger .date{line-height:1.0625rem}.Audio.bigger .seekline{top:2px;margin-bottom:.5rem}.Audio.bigger .duration{line-height:1rem}.Audio.bigger .media-loading{top:0.1875rem;left:0.1875rem}.Audio.bigger[dir=rtl] .media-loading{left:auto !important;right:0}.Audio .ProgressSpinner.size-s svg{width:2.25rem;height:2.25rem}.Audio[dir=rtl] .toggle-play{margin-left:.5rem;margin-right:0}.Audio[dir=rtl] .toggle-play.smaller{margin-left:.75rem;margin-right:0}.Audio[dir=rtl] .content,.Audio[dir=rtl] .duration{text-align:right}.Audio[dir=rtl] .download-button{left:auto;right:1.5rem}\n",".DropTarget{border-radius:var(--border-radius-default);background:var(--color-background);padding:1.25rem;flex:1 1 auto;width:100%;max-width:43.75rem;margin-left:auto;margin-right:auto;margin-bottom:.3125rem;display:flex;color:#A4ACB3;box-shadow:0 1px 2px var(--color-default-shadow)}@media (max-height: 350px){.DropTarget{padding:.75rem}}.DropTarget.hovered .target-content{color:var(--color-primary);background-image:var(--drag-target-border-hovered)}.DropTarget+.DropTarget{margin-top:.3125rem}.DropTarget:last-child{margin-bottom:0}.DropTarget .target-content{pointer-events:none;background-image:var(--drag-target-border);border-radius:.5rem;flex:1 1 100%;display:flex;flex-direction:column;align-items:center;justify-content:center;transition:.2s color, .2s background}.DropTarget .icon{font-size:6.25rem;line-height:4.6875rem;margin-bottom:2.25rem}@media (max-height: 520px){.DropTarget .icon{font-size:4.25rem;line-height:3.5rem;margin-bottom:1rem}}@media (max-height: 450px){.DropTarget .icon{font-size:2rem;line-height:1rem;margin-bottom:.5rem;margin-top:.25rem}}.DropTarget .title{font-size:1.3125rem;font-weight:500;letter-spacing:-.18px}@media (max-height: 450px){.DropTarget .title{font-size:1rem}}.DropTarget .description{font-size:1rem;letter-spacing:.3px}@media (max-height: 450px){.DropTarget .description{font-size:.875rem}}\n",".FloatingActionButton{position:absolute;right:1rem;bottom:1rem;transform:translateY(5rem);transition:transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1)}body.animation-level-0 .FloatingActionButton{transition:none !important}.FloatingActionButton.revealed{transform:translateY(0)}\n",".DropArea{position:absolute;top:0;right:0;left:0;height:100vh;z-index:var(--z-drop-area);padding:80px 20px 20px;display:flex;flex-direction:column}#Main.right-column-open .DropArea{max-width:calc(100% - var(--right-column-width))}\n",".StickerButton{display:inline-block;width:4rem;height:4rem;margin:0.5rem;border-radius:var(--border-radius-messages-small);background:transparent no-repeat center;background-size:contain;cursor:pointer;transition:background-color .15s ease, opacity .3s ease !important;position:relative}@media (max-width: 600px){.StickerButton{margin:0.25rem}}.StickerButton.set-button{width:2.75rem !important;height:2.75rem;margin:0 0.5rem}.StickerButton.large{width:10rem;height:10rem;margin:0}.StickerButton .AnimatedSticker,.StickerButton img{position:absolute;top:0;left:0;width:100%;height:100%}.StickerButton img{object-fit:contain}.StickerButton .sticker-unfave-button{position:absolute;top:-0.5rem;right:-0.5rem;width:1.25rem;height:1.25rem;padding:0.125rem;opacity:0}.StickerButton .sticker-unfave-button i{font-size:1rem}.StickerButton:hover{background-color:var(--color-interactive-element-hover)}.StickerButton:hover .sticker-unfave-button{opacity:1}\n",".TextFormatter{transform:translate(-50%, -3.25rem)}.TextFormatter,.TextFormatter-link-control{position:absolute;background:var(--color-background);border-radius:var(--border-radius-messages);padding:0.5rem 0.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 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:0.25rem;font-size:1.5rem;margin:0 0.125rem;border-radius:var(--border-radius-messages-small);flex-shrink:0;cursor:pointer}.TextFormatter .Button.active{background-color:var(--color-primary) !important;color:white}.TextFormatter .Button.disabled{opacity:.5;pointer-events:none}\n",".Picker{height:100%;display:flex;flex-direction:column;overflow:hidden}.Picker .picker-header{padding:0 1rem 0.25rem 0.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:0.5rem;margin-left:0.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:0.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)}\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///./src/components/ui/Transition.scss","webpack:///./src/components/common/Avatar.scss","webpack:///./src/components/ui/ProgressSpinner.scss","webpack:///./src/components/ui/Modal.scss","webpack:///./src/components/ui/ListItem.scss","webpack:///./src/components/common/VerifiedIcon.scss","webpack:///./src/components/common/TypingStatus.scss","webpack:///./src/components/ui/Notification.scss","webpack:///./src/components/ui/Radio.scss","webpack:///./src/components/ui/Tab.scss","webpack:///./src/components/ui/TabList.scss","webpack:///./src/components/common/DeleteChatModal.scss","webpack:///./src/components/ui/SearchInput.scss","webpack:///./src/components/common/PickerSelectedItem.scss","webpack:///./src/components/common/MessageOutgoingStatus.scss","webpack:///./src/components/common/LastMessageMeta.scss","webpack:///./src/components/left/main/Badge.scss","webpack:///./src/components/left/main/Chat.scss","webpack:///./src/components/common/AnimatedEmoji.scss","webpack:///./src/components/left/main/EmptyFolder.scss","webpack:///./src/components/common/NothingFound.scss","webpack:///./src/components/common/Media.scss","webpack:///./src/components/common/WebLink.scss","webpack:///./src/components/common/File.scss","webpack:///./src/components/common/Audio.scss","webpack:///./src/components/middle/composer/DropTarget.scss","webpack:///./src/components/ui/FloatingActionButton.scss","webpack:///./src/components/middle/composer/DropArea.scss","webpack:///./src/components/common/StickerButton.scss","webpack:///./src/components/middle/composer/TextFormatter.scss","webpack:///./src/components/common/Picker.scss"],"names":[],"mappings":"AAAA,YAAY,kBAAkB,cAAc,WAAW,YAAY,wCAAwC,gCAAgC,oCAAoC,kBAAkB,MAAM,OAAO,+C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AgB,kBAAkB,eAAe,0BAA0B,qBAAqB,0BAA0B,4BAA4B,oBAAoB,YAAY,SAAS,kBAAkB,aAAa,mBAAmB,uBAAuB","file":"0.1ebe794c83bdc1b89fad.css","sourcesContent":[".Transition{position:relative}.Transition>*{width:100%;height:100%;animation-fill-mode:forwards !important;transition:background-color .2s}.Transition>*.from,.Transition>*.to{position:absolute;top:0;left:0}.Transition>*:not(.active):not(.from):not(.to){display:none !important}.Transition.skip-slide-transition{transition:none !important}.Transition.scroll-slide{width:100%;height:100%;overflow:hidden;display:flex;flex-wrap:nowrap}.Transition.scroll-slide>*{position:static;flex-shrink:0}.Transition.scroll-slide>*:not(.active):not(.from):not(.to){display:block !important;transform:scale(0)}.Transition.scroll-slide>*:not(.active):not(.from):not(.to).through{display:none !important}.Transition.slide>.to{transform:translateX(100%)}.Transition.slide.animating>.from{animation:slide-out var(--slide-transition)}.Transition.slide.animating>.to{animation:slide-in var(--slide-transition)}.Transition.slide.backwards>.to{transform:translateX(-100%)}.Transition.slide.backwards.animating>.from{animation:slide-in-backwards var(--slide-transition)}.Transition.slide.backwards.animating>.to{animation:slide-out-backwards var(--slide-transition)}.Transition.slide-reversed>.to{transform:translateX(-100%)}.Transition.slide-reversed.animating>.from{animation:slide-out var(--slide-transition)}.Transition.slide-reversed.animating>.to{animation:slide-in var(--slide-transition)}.Transition.slide-reversed.backwards>.to{transform:translateX(100%)}.Transition.slide-reversed.backwards.animating>.from{animation:slide-in-backwards var(--slide-transition)}.Transition.slide-reversed.backwards.animating>.to{animation:slide-out-backwards var(--slide-transition)}.Transition.mv-slide>*>div{animation-fill-mode:forwards !important}.Transition.mv-slide>.to>div{transform:translateX(100vw)}.Transition.mv-slide.animating>.from>div{animation:mv-slide-out .4s ease}.Transition.mv-slide.animating>.to>div{animation:mv-slide-in .4s ease}.Transition.mv-slide.backwards>.to>div{transform:translateX(-100vw)}.Transition.mv-slide.backwards.animating>.from>div{animation:mv-slide-in-backwards .4s ease}.Transition.mv-slide.backwards.animating>.to>div{animation:mv-slide-out-backwards .4s ease}.Transition.slide-fade>.from{transform-origin:left;transform:translateX(0);opacity:1}.Transition.slide-fade>.to{transform-origin:left;transform:translateX(1.5rem);opacity:0}.Transition.slide-fade.animating>.from{animation:fade-out-opacity var(--slide-transition),slide-fade-out-move var(--slide-transition)}.Transition.slide-fade.animating>.to{animation:fade-in-opacity var(--slide-transition),slide-fade-in-move var(--slide-transition)}.Transition.slide-fade.backwards>.from{transform:translateX(0);opacity:1}.Transition.slide-fade.backwards>.to{transform:translateX(-1.5rem);opacity:0}.Transition.slide-fade.backwards.animating>.from{animation:fade-in-backwards-opacity var(--slide-transition),slide-fade-in-backwards-move var(--slide-transition)}.Transition.slide-fade.backwards.animating>.to{animation:fade-out-backwards-opacity var(--slide-transition),slide-fade-out-backwards-move var(--slide-transition)}.Transition.zoom-fade>.from{transform-origin:center;transform:scale(1);opacity:1}.Transition.zoom-fade>.to{transform-origin:center;opacity:0}.Transition.zoom-fade.animating>.from{animation:fade-out-opacity .15s ease}.Transition.zoom-fade.animating>.to{animation:fade-in-opacity .15s ease, zoom-fade-in-move .15s ease}.Transition.zoom-fade.backwards>.from{transform:scale(1)}.Transition.zoom-fade.backwards>.to{transform:scale(0.95)}.Transition.zoom-fade.backwards.animating>.from{animation:fade-in-backwards-opacity .1s ease, zoom-fade-in-backwards-move .15s ease}.Transition.zoom-fade.backwards.animating>.to{animation:fade-out-backwards-opacity .15s ease, zoom-fade-out-backwards-move .15s ease}.Transition.fade>.from{opacity:1}.Transition.fade>.to{opacity:0}.Transition.fade.animating>.from{animation:fade-out-opacity .15s ease}.Transition.fade.animating>.to{animation:fade-in-opacity .15s ease}.Transition.slide-layers{--background-color: var(--color-background);background:black}.Transition.slide-layers>div{background:var(--background-color)}.Transition.slide-layers>.to{transform:translateX(100%)}.Transition.slide-layers.animating>.from{animation:slide-layers-out var(--layer-transition)}.Transition.slide-layers.animating>.to{animation:slide-in var(--layer-transition)}.Transition.slide-layers.backwards>.to{transform:translateX(-20%);opacity:0.75}.Transition.slide-layers.backwards.animating>.from{animation:slide-in-backwards var(--layer-transition)}.Transition.slide-layers.backwards.animating>.to{animation:slide-layers-out-backwards var(--layer-transition)}.Transition.push-slide>div{background:var(--color-background)}.Transition.push-slide>.from{transform-origin:center;transform:scale(1);opacity:1}.Transition.push-slide>.from .custom-scroll{scrollbar-color:transparent !important}.Transition.push-slide>.from .custom-scroll::-webkit-scrollbar-thumb{background-color:transparent !important}.Transition.push-slide>.to{transform:translateX(100%)}.Transition.push-slide.animating>.from{animation:push-out .3s ease-in-out}.Transition.push-slide.animating>.to{animation:slide-in-200 .3s ease-in-out}.Transition.push-slide.backwards>.to{transform:scale(0.7)}.Transition.push-slide.backwards.animating>.from{animation:slide-in-200-backwards .3s ease-in-out}.Transition.push-slide.backwards.animating>.to{animation:push-out-backwards .3s ease-in-out}.Transition.reveal>.to{-webkit-clip-path:inset(0 100% 0 0);clip-path:inset(0 100% 0 0)}.Transition.reveal.animating>.to{animation:reveal-in 350ms ease-in}.Transition.reveal.backwards>.from{-webkit-clip-path:inset(0 0 0 0);clip-path:inset(0 0 0 0)}.Transition.reveal.backwards>.to{-webkit-clip-path:none;clip-path:none}.Transition.reveal.backwards.animating>.from{animation:reveal-in-backwards 350ms ease-out}.Transition.reveal.backwards.animating>.to{animation:none}@keyframes fade-in-opacity{0%{opacity:0}100%{opacity:1}}@keyframes fade-out-opacity{0%{opacity:1}100%{opacity:0}}@keyframes fade-in-backwards-opacity{0%{opacity:1}100%{opacity:0}}@keyframes fade-out-backwards-opacity{0%{opacity:0}100%{opacity:1}}@keyframes slide-in{0%{transform:translateX(100%)}100%{transform:translateX(0)}}@keyframes slide-out{0%{transform:translateX(0)}100%{transform:translateX(-100%)}}@keyframes slide-in-backwards{0%{transform:translateX(0)}100%{transform:translateX(100%)}}@keyframes slide-out-backwards{0%{transform:translateX(-100%)}100%{transform:translateX(0)}}@keyframes mv-slide-in{0%{transform:translateX(100vw)}100%{transform:translateX(0)}}@keyframes mv-slide-out{0%{transform:translateX(0)}100%{transform:translateX(-100vw)}}@keyframes mv-slide-in-backwards{0%{transform:translateX(0)}100%{transform:translateX(100vw)}}@keyframes mv-slide-out-backwards{0%{transform:translateX(-100vw)}100%{transform:translateX(0)}}@keyframes slide-fade-in-move{0%{transform:translateX(1.5rem)}100%{transform:translateX(0)}}@keyframes slide-fade-out-move{0%{transform:translateX(0)}100%{transform:translateX(-1.5rem)}}@keyframes slide-fade-in-backwards-move{0%{transform:translateX(0)}100%{transform:translateX(1.5rem)}}@keyframes slide-fade-out-backwards-move{0%{transform:translateX(-1.5rem)}100%{transform:translateX(0)}}@keyframes zoom-fade-in-move{0%{transform:scale(1.1)}100%{transform:scale(1)}}@keyframes zoom-fade-in-backwards-move{0%{transform:scale(1)}100%{transform:scale(1.1)}}@keyframes zoom-fade-out-backwards-move{0%{transform:scale(0.95)}100%{transform:scale(1)}}@keyframes slide-layers-out{0%{transform:translateX(0);opacity:1}100%{transform:translateX(-20%);opacity:calc(1 - var(--layer-blackout-opacity))}}@keyframes slide-layers-out-backwards{0%{transform:translateX(-20%);opacity:calc(1 - var(--layer-blackout-opacity))}100%{transform:translateX(0);opacity:1}}@keyframes push-out{0%{transform:scale(1);opacity:1}100%{transform:scale(0.7);opacity:0}}@keyframes push-out-backwards{0%{transform:scale(0.7);opacity:0}100%{transform:scale(1);opacity:1}}@keyframes slide-in-200{0%{transform:translateX(200%)}100%{transform:translateX(0)}}@keyframes slide-in-200-backwards{0%{transform:translateX(0)}100%{transform:translateX(200%)}}@keyframes reveal-in{0%{-webkit-clip-path:inset(0 100% 0 0);clip-path:inset(0 100% 0 0)}100%{-webkit-clip-path:inset(0 0 0 0);clip-path:inset(0 0 0 0)}}@keyframes reveal-in-backwards{0%{-webkit-clip-path:inset(0 0 0 0);clip-path:inset(0 0 0 0)}100%{-webkit-clip-path:inset(0 100% 0 0);clip-path:inset(0 100% 0 0)}}\n",".Avatar{--color-user: var(--color-primary);flex:none;align-items:center;justify-content:center;width:3.375rem;height:3.375rem;border-radius:50%;background:linear-gradient(var(--color-white) -125%, var(--color-user));color:white;font-weight:bold;display:flex;white-space:nowrap}.Avatar img:not(.emoji){border-radius:50%}.Avatar .emoji{width:1rem;height:1rem}.Avatar i{font-size:2.5rem}.Avatar.size-micro{width:1rem;height:1rem;font-size:0.5125rem}.Avatar.size-micro .emoji{width:.5625rem;height:.5625rem}.Avatar.size-tiny{width:2rem;height:2rem;font-size:.875rem}.Avatar.size-tiny .emoji{width:.875rem;height:.875rem}.Avatar.size-small{width:2.125rem;height:2.125rem;font-size:0.875rem}.Avatar.size-small .emoji{width:.875rem;height:.875rem}.Avatar.size-medium{width:2.75rem;height:2.75rem;font-size:1.1875rem}.Avatar.size-medium .emoji{width:1rem;height:1rem}.Avatar.size-large{font-size:1.3125rem}.Avatar.size-large i{font-size:3.5rem}.Avatar.size-large .emoji{width:1.3125rem;height:1.3125rem}.Avatar.size-jumbo{width:7.5rem;height:7.5rem;font-size:3.5rem}.Avatar.size-jumbo i{font-size:6rem}.Avatar.size-jumbo .emoji{width:3.5rem;height:3.5rem}.Avatar.online{position:relative}.Avatar.online::after{content:'';display:block;position:absolute;bottom:0.05rem;right:0.05rem;width:0.875rem;height:0.875rem;border-radius:50%;border:2px solid var(--color-background);background-color:#0ac630;flex-shrink:0}.Avatar.interactive{cursor:pointer}.Avatar img:not(.emoji){width:100%;height:100%}\n",".ProgressSpinner{position:relative;z-index:1;width:3.375rem;height:3.375rem;background:rgba(0,0,0,0.25) url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTkiIGhlaWdodD0iMTkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEwLjcxNyA5Ljc1TDE4LjMgMi4xNjdhLjY4NC42ODQgMCAxMC0uOTY3LS45NjdMOS43NSA4Ljc4MyAyLjE2NyAxLjJhLjY4NC42ODQgMCAxMC0uOTY3Ljk2N0w4Ljc4MyA5Ljc1IDEuMiAxNy4zMzNhLjY4NC42ODQgMCAxMC45NjcuOTY3bDcuNTgzLTcuNTgzIDcuNTgzIDcuNTgzYS42ODEuNjgxIDAgMDAuOTY3IDAgLjY4NC42ODQgMCAwMDAtLjk2N0wxMC43MTcgOS43NXoiIGZpbGw9IiNGRkYiIGZpbGwtcnVsZT0ibm9uemVybyIgc3Ryb2tlPSIjRkZGIiBzdHJva2Utd2lkdGg9Ii43NSIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPjwvc3ZnPg==) no-repeat 49% 49%;border-radius:50%;cursor:pointer}.ProgressSpinner.no-cross{background:transparent !important;pointer-events:none}.ProgressSpinner.square{background-image:none}.ProgressSpinner.square::after{content:'';position:absolute;width:.8125rem;height:.8125rem;border-radius:.125rem;background-color:#fff;left:50%;top:50%;transform:translate3d(-50%, -50%, 0)}.ProgressSpinner.size-s,.ProgressSpinner.size-m{width:auto;height:auto;background:transparent url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTUiIGhlaWdodD0iMTUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTguMjE4IDcuNWw1LjYzMy01LjYzM2EuNTA4LjUwOCAwIDEwLS43MTgtLjcxOEw3LjUgNi43ODIgMS44NjcgMS4xNDlhLjUwOC41MDggMCAxMC0uNzE4LjcxOEw2Ljc4MiA3LjVsLTUuNjMzIDUuNjMzYS41MDguNTA4IDAgMTAuNzE4LjcxOEw3LjUgOC4yMThsNS42MzMgNS42MzNhLjUwNi41MDYgMCAwMC43MTggMCAuNTA4LjUwOCAwIDAwMC0uNzE4TDguMjE4IDcuNXoiIGZpbGw9IiNGRkYiIGZpbGwtcnVsZT0ibm9uemVybyIgc3Ryb2tlPSIjRkZGIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+PC9zdmc+) no-repeat 49% 49%}.ProgressSpinner.size-s.square,.ProgressSpinner.size-m.square{background-image:none;width:.75rem;height:.75rem}.ProgressSpinner.size-xl{width:3.25rem;height:3.25rem}.ProgressSpinner.size-xl svg{width:3rem;height:3rem;margin:.125rem}.ProgressSpinner.size-xl circle{stroke-width:3px}.ProgressSpinner.transparent{background-color:transparent !important}.ProgressSpinner svg{display:block;transform:rotate(-90deg);transform-origin:50% 50%;animation:4s linear 0s infinite ProgressSpinnerAnimation}.ProgressSpinner circle{transition:stroke-dashoffset .5s}@keyframes ProgressSpinnerAnimation{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}\n",".Modal{position:relative;z-index:var(--z-modal)}.Modal.delete .modal-dialog,.Modal.error .modal-dialog,.Modal.confirm .modal-dialog,.Modal.pin .modal-dialog,.Modal.unpin-all .modal-dialog{max-width:23rem}.Modal.error .modal-content>div{margin-top:1rem}.Modal.narrow .modal-dialog{max-width:20rem}.Modal.report .modal-dialog{max-width:15rem}.Modal .modal-container{position:fixed;top:0;bottom:0;left:0;right:0;display:flex;justify-content:center;align-items:center}.Modal .modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:-1;background-color:rgba(0,0,0,0.25)}.Modal.transparent-backdrop .modal-backdrop{background-color:transparent}.Modal .modal-dialog{position:relative;display:inline-flex;flex-direction:column;width:100%;max-width:35rem;min-width:17.5rem;margin:2rem auto;background-color:var(--color-background);box-shadow:0 0.25rem 0.5rem 0.125rem var(--color-default-shadow);border-radius:var(--border-radius-default);transform:translate3d(0, -1rem, 0);transition:transform .2s ease, opacity .2s ease}body.animation-level-0 .Modal .modal-dialog{transition:none;transform:none !important}@media (max-width: 450px){.Modal .modal-dialog{max-width:calc(100vw - 3rem) !important}}.Modal.open .modal-dialog{transform:translate3d(0, 0, 0)}.Modal.closing .modal-dialog{transform:translate3d(0, 1rem, 0)}.Modal .modal-header,.Modal .modal-header-condensed{padding:1rem 1rem 0;display:flex;align-items:center;flex-shrink:0}.Modal .modal-title{font-size:1.25rem;font-weight:500;flex:1 1 auto;overflow:hidden;text-overflow:ellipsis}.Modal .modal-title:not(:only-child){margin:0 1.3125rem}.Modal .modal-header-condensed{padding:.5rem 1.25rem 0 .9375rem !important}.Modal .modal-header-condensed .modal-action-button{font-size:0.875rem;height:2.25rem;width:auto;line-height:1.625rem;margin-left:auto;padding-left:1.25rem;padding-right:1.25rem;min-width:5rem}.Modal .modal-content{width:100%;flex-grow:1;padding:1rem;overflow-y:auto}.Modal .modal-content b,.Modal .modal-content strong{word-break:break-word}.Modal .modal-title,.Modal .modal-content,.Modal .modal-content>p{unicode-bidi:plaintext;text-align:initial}.Modal .dialog-buttons{display:flex;align-items:flex-end}.Modal .dialog-buttons .confirm-dialog-button+.confirm-dialog-button{margin-left:1rem}.Modal .confirm-dialog-button{width:auto;height:auto;margin-left:auto;text-align:right;font-weight:500;white-space:pre-wrap}\n",".ListItem{position:relative}.ListItem .ListItem-button{width:100%;background-color:var(--background-color);border:none !important;box-shadow:none !important;outline:none !important;display:flex;padding:1rem;position:relative;overflow:hidden;line-height:1.5rem;white-space:nowrap;color:var(--color-text);border-radius:var(--border-radius-default);--ripple-color: rgba(0, 0, 0, .08)}.ListItem .ListItem-button>i{font-size:1.5rem;margin-right:2rem;color:var(--color-text-secondary)}.ListItem .user-status,.ListItem .group-status,.ListItem .title,.ListItem .subtitle{text-align:initial;unicode-bidi:plaintext}.ListItem.multiline .ListItem-button>i{position:relative;top:.25rem}.ListItem.disabled{pointer-events:none}.ListItem.disabled .ListItem-button{opacity:0.5}.ListItem:not(.disabled):not(.is-static) .ListItem-button{cursor:pointer}@media (hover: hover){.ListItem:not(.disabled):not(.is-static) .ListItem-button:hover,.ListItem:not(.disabled):not(.is-static) .ListItem-button:focus{--background-color: var(--color-chat-hover)}}@media (max-width: 600px){.ListItem:not(.disabled):not(.is-static) .ListItem-button.active{--background-color: var(--color-chat-hover)}}@media (min-width: 600px){.ListItem:not(.has-ripple):not(.is-static) .ListItem-button:active,body.animation-level-0 .ListItem .ListItem-button:active{--background-color: var(--color-item-active) !important}}.ListItem.has-menu-open .ListItem-button{--background-color: var(--color-chat-hover)}.ListItem.narrow{margin-bottom:0.75rem}.ListItem.narrow .ListItem-button{padding:0.5rem 1rem}.ListItem.inactive{pointer-events:none}.ListItem.focus{--background-color: var(--color-chat-hover)}.ListItem.destructive .ListItem-button{color:var(--color-error)}.ListItem.destructive .ListItem-button i{color:inherit}.ListItem-context-menu{position:absolute}.ListItem-context-menu .bubble{width:auto}.ListItem-context-menu .bubble .MenuItem button{padding-left:1rem !important;padding-right:2rem !important}.ListItem.chat-item-clickable{margin:0 -0.5rem}body.is-ios .ListItem.chat-item-clickable,body.is-macos .ListItem.chat-item-clickable{--color-text-secondary: var(--color-text-secondary-apple)}.ListItem.chat-item-clickable .ListItem-button{padding:.5625rem .6975rem .5625rem .5625rem}.ListItem.chat-item-clickable .Avatar{flex-shrink:0;margin-right:0.5rem}.ListItem.chat-item-clickable .info{flex-grow:1;overflow:hidden}.ListItem.chat-item-clickable .title,.ListItem.chat-item-clickable .subtitle{overflow:hidden;display:flex;justify-content:flex-start;align-items:center}.ListItem.chat-item-clickable h3,.ListItem.chat-item-clickable .last-message,.ListItem.chat-item-clickable .status,.ListItem.chat-item-clickable .typing-status{font-size:1rem;line-height:1.6875rem;margin:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;text-align:initial}.ListItem.chat-item-clickable .title h3{font-weight:500}.ListItem.chat-item-clickable .title .VerifiedIcon{width:1.25rem;height:1.25rem;margin-left:0.25rem}.ListItem.chat-item-clickable .title .emoji{vertical-align:text-bottom;background-position:0 0;flex-shrink:0}.ListItem.chat-item-clickable .contact-phone,.ListItem.chat-item-clickable .contact-username{font-size:0.875rem;line-height:1.25rem;color:var(--color-text-secondary)}.ListItem.chat-item-clickable .ChatInfo{display:flex;align-items:center;flex-grow:1;overflow:hidden}.ListItem.chat-item-clickable .ChatInfo .status,.ListItem.chat-item-clickable .ChatInfo .typing-status{font-size:0.875rem;line-height:1.25rem;color:var(--color-text-secondary);display:inline-block}.ListItem.chat-item-clickable .ChatInfo .status.online,.ListItem.chat-item-clickable .ChatInfo .typing-status.online{color:var(--color-primary)}.ListItem.chat-item-clickable .ChatInfo .status[dir=rtl],.ListItem.chat-item-clickable .ChatInfo .status[dir=auto],.ListItem.chat-item-clickable .ChatInfo .typing-status[dir=rtl],.ListItem.chat-item-clickable .ChatInfo .typing-status[dir=auto]{text-align:initial;width:100%}.ListItem.chat-item-clickable .ChatInfo .status .group-status:only-child,.ListItem.chat-item-clickable .ChatInfo .status .user-status:only-child,.ListItem.chat-item-clickable .ChatInfo .typing-status .group-status:only-child,.ListItem.chat-item-clickable .ChatInfo .typing-status .user-status:only-child{display:flow-root}.ListItem.chat-item-clickable .contact-phone,.ListItem.chat-item-clickable .contact-username,.ListItem.chat-item-clickable h3,.ListItem.chat-item-clickable .last-message,.ListItem.chat-item-clickable .status,.ListItem.chat-item-clickable .typing-status{text-align:initial;unicode-bidi:plaintext}body.is-ios .ListItem.chat-item-clickable .last-message,body.is-macos .ListItem.chat-item-clickable .last-message,body.is-ios .ListItem.chat-item-clickable .status,body.is-macos .ListItem.chat-item-clickable .status,body.is-ios .ListItem.chat-item-clickable .typing-status,body.is-macos .ListItem.chat-item-clickable .typing-status{font-size:.9375rem}.ListItem.chat-item-clickable[dir=rtl] .ListItem-button{padding:.5625rem .5625rem .5625rem .6975rem}.ListItem.chat-item-clickable[dir=rtl] .Avatar{margin-left:0.5rem;margin-right:0}.ListItem.chat-item-clickable[dir=rtl] .info>.status{width:100%}.ListItem.search-result-message .title{padding-right:.15rem}.ListItem.search-result-message h3{max-width:80%}.ListItem.search-result-message h3,.ListItem.search-result-message .subtitle{font-size:1rem;line-height:1.5rem;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;text-align:left}.ListItem.search-result-message .LastMessageMeta{margin-left:auto;margin-right:0}.ListItem.search-result-message .subtitle{color:var(--color-text-secondary);margin-right:2rem}.ListItem.search-result-message .subtitle .matching-text-highlight{color:var(--color-text);background:#CAE3F7;border-radius:0.25rem;padding:0 0.125rem}.ListItem.search-result-message[dir=rtl] .LastMessageMeta{margin-left:0;margin-right:auto}.ListItem.search-result-message[dir=rtl] .subtitle{margin-right:0;display:block}.ListItem.picker-list-item{margin:0}.ListItem.picker-list-item .ListItem-button{padding-left:0;display:flex;align-items:center}.ListItem.picker-list-item .Avatar{width:3rem;height:3rem}.ListItem.picker-list-item .Checkbox{flex-shrink:0;height:1.5rem;margin:0;padding-left:4rem}.ListItem.picker-list-item[dir=rtl] .Checkbox{padding-left:0;padding-right:4rem}.ListItem .multiline-item{white-space:initial;overflow:hidden}.ListItem .multiline-item .title,.ListItem .multiline-item .subtitle{display:block;text-align:initial}.ListItem .multiline-item .title{line-height:1.25rem;overflow:hidden;text-overflow:ellipsis}.ListItem .multiline-item .subtitle{font-size:0.875rem;line-height:1.5rem;color:var(--color-text-secondary)}.ListItem .multiline-item .subtitle+.subtitle{margin-top:-0.25rem}.ListItem .multiline-item .subtitle.black{color:var(--color-text)}.ListItem[dir=rtl] .ListItem-button>i{margin-left:2rem;margin-right:0}\n",".VerifiedIcon{display:inline-block;flex-shrink:0;width:1.5rem;height:1.5rem;background-image:url(icon-verified.a2a4fb48197a45cb301b64e39d1a8427.svg);background-repeat:no-repeat;background-size:100%;background-position:center}\n",".typing-status{display:flex;align-items:baseline}.typing-status .sender-name::after{content:'\\00a0';color:var(--color-text-secondary)}.typing-status .ellipsis{display:flex;width:1rem;overflow:hidden}.typing-status .ellipsis::after{content:'...';animation:typing-animation 1s steps(4, start) infinite}html[lang=ar] .typing-status .ellipsis::after,html[lang=fa] .typing-status .ellipsis::after{animation-name:typing-animation-rtl}@keyframes typing-animation{from{transform:translateX(-1rem)}}@keyframes typing-animation-rtl{from{transform:translateX(1rem)}}\n",".Notification-container{position:relative;width:24rem;max-width:100vw;margin:.25rem auto;z-index:var(--z-notification)}@media (min-width: 1276px){.Notification-container{transition:transform var(--layer-transition)}}.Notification-container:first-of-type{margin-top:4.25rem}.has-header-tools .Notification-container:first-of-type{margin-top:7.375rem}.Notification{background:rgba(32,32,32,0.8) url(\"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48Y2lyY2xlIGZpbGw9IiNGRkYiIGN4PSIxMiIgY3k9IjEyIiByPSIxMiIvPjxjaXJjbGUgZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJub256ZXJvIiBjeD0iMTIiIGN5PSI2LjUiIHI9IjEuNSIvPjxwYXRoIGQ9Ik0xMiA5LjVjLS41NTIgMC0xIC4zNy0xIC44MjZ2Ny4zNDhjMCAuNDU2LjQ0OC44MjYgMSAuODI2czEtLjM3IDEtLjgyNnYtNy4zNDhjMC0uNDU2LS40NDgtLjgyNi0xLS44MjZ6IiBmaWxsPSIjMDAwIiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48L2c+PC9zdmc+\") no-repeat 0.9375rem 50%;background-size:1.5rem;border-radius:var(--border-radius-default);padding:.9375rem .9375rem .9375rem 3.375rem;color:#fff;margin:0 .5rem}.Notification .text-entity-link,.Notification .text-entity-link:hover,.Notification .text-entity-link:active{color:#fff !important;text-decoration:underline}.Notification .content{line-height:1.25;word-break:break-word;font-size:.9375rem}\n",".Radio{display:block;position:relative;padding-left:4.5rem;text-align:left;margin-bottom:1.5rem;line-height:1.5rem;cursor:pointer}.Radio.disabled{pointer-events:none;opacity:0.5}.Radio.hidden-widget{cursor:default}.Radio.hidden-widget .Radio-main::before,.Radio.hidden-widget .Radio-main::after{visibility:hidden}.Radio>input{position:absolute;z-index:var(--z-below);opacity:0}.Radio .Radio-main::before,.Radio .Radio-main::after{content:'';display:block;position:absolute;left:1.0625rem;top:50%;width:1.25rem;height:1.25rem;transform:translateY(-50%)}.Radio .Radio-main::before{border:2px solid var(--color-borders-input);border-radius:50%;background-color:var(--color-background);opacity:1;transition:border-color .1s ease, opacity .1s ease}.Radio .Radio-main::after{left:1.375rem;width:0.625rem;height:0.625rem;border-radius:50%;background:var(--color-primary);opacity:0;transition:opacity .1s ease}.Radio .Radio-main .label{display:block;word-break:break-word;unicode-bidi:plaintext;text-align:left}.Radio .Radio-main .subLabel{display:block;font-size:0.875rem;line-height:1rem;color:var(--color-text-secondary);unicode-bidi:plaintext}.Radio input:checked ~ .Radio-main::before{border-color:var(--color-primary)}.Radio input:checked ~ .Radio-main::after{opacity:1}.Radio.loading .Radio-main::before,.Radio.loading .Radio-main::after{opacity:0 !important}.Radio.loading .Spinner{position:absolute;left:1.0625rem;top:50%;transform:translateY(-50%);opacity:0;animation:fade-in .2s ease forwards;--spinner-size: 1.25rem}.Radio[dir=rtl]{padding-left:0;padding-right:4.5rem}.Radio[dir=rtl] .Radio-main{text-align:right}.Radio[dir=rtl] .Radio-main::before{left:auto;right:1.0625rem}.Radio[dir=rtl] .Radio-main::after{left:auto;right:1.375rem}.Radio[dir=rtl] .label,.Radio[dir=rtl] .subLabel{text-align:right}.Radio[dir=rtl].loading .Spinner{left:auto;right:1.0625rem}@keyframes fade-in{from{opacity:0}to{opacity:1}}\n",".Tab{flex:1 1 auto;-webkit-appearance:none;appearance:none;background:none;width:auto;margin:0;border:none;padding:.625rem .25rem;font-weight:500;color:var(--color-text-secondary);cursor:pointer;border-top-left-radius:var(--border-radius-messages-small);border-top-right-radius:var(--border-radius-messages-small)}.Tab,.Tab:active,.Tab:focus{outline:none}.Tab.active{cursor:default;color:var(--color-primary)}.Tab.active i{opacity:1}.Tab:not(.active):hover{background:var(--color-interactive-element-hover)}.Tab>span{position:relative;display:inline-flex;align-items:center}.Tab .badge{min-width:1.25rem;height:1.25rem;margin-inline-start:0.5rem;background:var(--color-gray);border-radius:0.75rem;padding:0 .3125rem;color:white;font-size:0.875rem;line-height:1.3125rem;font-weight:500;text-align:center;flex-shrink:0}body.is-ios .Tab .badge,body.is-macos .Tab .badge{line-height:1.25rem}.Tab .badge.active{background:var(--color-primary)}.Tab i{position:absolute;bottom:calc(-.625rem - 1px);left:0;opacity:0;background-color:var(--color-primary);height:.1875rem;width:100%;border-radius:.1875rem .1875rem 0 0;pointer-events:none;box-sizing:content-box;transform-origin:left}.Tab i.animate{transition:transform var(--slide-transition)}body.animation-level-0 .Tab i.animate{transition:none !important}\n",".TabList{position:sticky;top:0;flex-shrink:0;display:flex;justify-content:space-between;align-items:flex-end;font-size:.875rem;flex-wrap:nowrap;box-shadow:0 2px 2px var(--color-light-shadow);background-color:var(--color-background);overflow-x:auto;overflow-y:hidden;scrollbar-width:none;scrollbar-color:rgba(0,0,0,0)}.TabList.big{font-size:1rem;--border-radius-messages-small: 0}.TabList::-webkit-scrollbar{height:0}.TabList::-webkit-scrollbar-thumb{background-color:rgba(0,0,0,0)}\n",".DeleteChatModal .modal-dialog{max-width:20rem}.DeleteChatModal .modal-header{padding:1.125rem 1.25rem 0}.DeleteChatModal .modal-title:not(:only-child){margin:0 0 0 .75rem}.DeleteChatModal .modal-content{padding:.5rem 1.25rem}.DeleteChatModal .confirm-dialog-button{margin-right:-.625rem}\n",".SearchInput{position:relative;width:100%;color:rgba(var(--color-text-secondary-rgb), 0.5);background-color:var(--color-chat-hover);border:2px solid var(--color-chat-hover);border-radius:1.375rem;transition:border-color 0.15s ease}.SearchInput.with-picker-item{display:flex}.SearchInput.with-picker-item .icon-search{display:none}.SearchInput.with-picker-item input{padding-left:.5rem}.SearchInput.with-picker-item[dir=rtl] input{padding-right:.5rem;padding-left:0}.SearchInput.has-focus{border-color:var(--color-primary);caret-color:var(--color-primary);background-color:var(--color-background)}.SearchInput.has-focus input+i{color:var(--color-primary)}.SearchInput input{height:2.5rem;margin-bottom:0;border:none !important;border-radius:1.375rem;background-color:transparent !important;box-shadow:none !important;padding:calc(0.4375rem - var(--border-width)) calc(2.625rem - var(--border-width)) calc(0.5rem - var(--border-width)) calc(2.625rem - var(--border-width))}.SearchInput input::placeholder{color:var(--color-placeholders)}.SearchInput>i{position:absolute;top:.5rem;left:.75rem;font-size:1.5rem}.SearchInput .Loading{position:absolute;top:.5rem;right:.5rem;height:1.5rem}.SearchInput .Loading .Spinner{--spinner-size: 1.5rem}.SearchInput .Button{position:absolute;top:.125rem;right:.125rem;font-size:1rem}@media (max-width: 600px){.SearchInput input{height:2.5rem;border-radius:1.25rem;padding-left:calc(2.625rem - var(--border-width))}.SearchInput i{top:0.5rem}}.SearchInput[dir=rtl] input{direction:rtl}.SearchInput[dir=rtl]>i{left:auto;right:.75rem}.SearchInput[dir=rtl] .Loading{left:.5rem;right:auto}.SearchInput[dir=rtl] .Button{left:.125rem;right:auto}\n",".PickerSelectedItem{display:flex;align-items:center;background:var(--color-chat-hover);height:2rem;min-width:2rem;margin-left:0.5rem;margin-bottom:0.5rem;padding-right:1rem;border-radius:1rem;cursor:pointer;position:relative;overflow:hidden;flex-shrink:1;transition:background-color .15s ease;max-width:calc(50% - 0.5rem)}.PickerSelectedItem.minimized{padding-right:0}.PickerSelectedItem:hover{background-color:var(--color-item-active)}.PickerSelectedItem.closeable:hover{background-color:rgba(var(--color-error-rgb), 0.16)}.PickerSelectedItem.closeable:hover .item-remove{opacity:1}.PickerSelectedItem.closeable:hover .Avatar,.PickerSelectedItem.closeable:hover .item-icon{opacity:0}.PickerSelectedItem.search-date .item-remove{background:var(--color-primary)}.PickerSelectedItem.search-date:hover{background:var(--color-chat-hover)}.PickerSelectedItem.search-date .item-name{font-size:0.875rem}.SearchInput .PickerSelectedItem{flex:1 0 auto;position:relative;top:.25rem;left:-.125rem;color:var(--color-text-secondary)}.PickerSelectedItem .Avatar,.PickerSelectedItem .item-icon{width:2rem;height:2rem;opacity:1;flex-shrink:0;transition:opacity .15s ease}.PickerSelectedItem .Avatar i,.PickerSelectedItem .item-icon i{font-size:2rem}.PickerSelectedItem .item-icon{display:flex;align-items:center;justify-content:center;padding:0.375rem;border-radius:50%;background-color:var(--color-primary);color:white}.PickerSelectedItem .item-icon i{font-size:1.25rem;position:relative;top:-1px}.PickerSelectedItem .item-name{margin-left:0.5rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.PickerSelectedItem .item-name .emoji.emoji-small{width:1.125rem;height:1.125rem;background-size:1.125rem;vertical-align:-2px}.PickerSelectedItem .item-remove{position:absolute;left:0;top:0;width:2rem;height:2rem;border-radius:50%;display:flex;align-items:center;justify-content:center;background-color:var(--color-error);font-size:1.5rem;color:white;opacity:0;transition:opacity .15s ease}.PickerSelectedItem[dir=rtl]{padding-left:1rem;padding-right:0}.PickerSelectedItem[dir=rtl].minimized{padding-right:0;padding-left:0}.SearchInput .PickerSelectedItem[dir=rtl]{left:auto;right:-.125rem}.PickerSelectedItem[dir=rtl] .item-name{margin-left:0;margin-right:0.5rem}.PickerSelectedItem[dir=rtl] .item-remove{left:auto;right:0}\n",".MessageOutgoingStatus{width:1.19rem;height:1.19rem;overflow:hidden;display:inline-block;line-height:1;font-size:1.1875rem}.MessageOutgoingStatus i{background:var(--background-color)}.MessageOutgoingStatus .icon-message-succeeded{padding-left:0.13rem}.MessageOutgoingStatus .Transition{width:100%;height:100%}\n",".LastMessageMeta{margin-right:.2rem;padding:.3rem 0 .15rem;flex-shrink:0;font-size:0.75rem;line-height:1;display:flex;align-items:center}.LastMessageMeta .MessageOutgoingStatus{color:var(--color-text-meta-colored);margin-right:0.1rem;font-size:1.15rem}body.is-ios .LastMessageMeta .MessageOutgoingStatus{margin-bottom:-.125rem}.LastMessageMeta .time{color:var(--color-text-meta);line-height:1.15rem}\n",".Badge-transition{opacity:1;transition:transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1)}.Badge-transition:not(.open){transform:scale(0);opacity:0}.Badge-transition:not(.shown){display:none}.Badge-transition.closing{transition:transform .2s ease-out, opacity .2s ease-out}.Badge-wrapper{display:flex}.Badge-wrapper .Badge{margin-inline-start:.5rem}.Badge{min-width:1.5rem;height:1.5rem;background:var(--color-gray);border-radius:0.75rem;padding:0 .4375rem;color:white;font-size:0.875rem;line-height:1.5625rem;font-weight:500;text-align:center;flex-shrink:0}body.is-macos .Badge{line-height:1.5rem}body.is-ios .Badge{line-height:1.375rem;min-width:1.375rem;height:1.375rem;padding:0 .375rem}.Badge.mention,.Badge.unread:not(.muted){background:var(--color-green);color:var(--color-white)}.Badge.pinned:not(.unread){color:var(--color-pinned);background:transparent;width:1.5rem;padding:0}.Badge.pinned:not(.unread) i{font-size:1.5rem}.Badge.mention{width:1.5rem;padding:0.25rem}.Badge.mention i{font-size:1rem;vertical-align:super}body.is-ios .Badge.mention{width:1.375rem;padding:0.25rem}body.is-ios .Badge.mention i{font-size:.875rem}\n",".Chat{--background-color: var(--color-background);position:absolute;top:0;left:0;margin:0;width:100%}body.is-ios .Chat,body.is-macos .Chat{--color-text-meta: var(--color-text-meta-apple)}.Chat.animate-opacity{will-change:opacity;transition:opacity .2s ease-out}.Chat.animate-transform{will-change:transform;transition:transform .2s ease-out}.Chat:hover .Avatar.online::after,.Chat.ListItem.has-menu-open .Avatar.online::after{border-color:var(--color-chat-hover)}@media (max-width: 600px){.Chat.selected{--background-color: var(--color-chat-hover) !important}.Chat.selected .Avatar.online::after{border-color:var(--color-chat-hover)}}@media (min-width: 600px){.Chat.selected,.Chat.selected:hover{--background-color: var(--color-chat-active) !important}.Chat.selected .Avatar.online::after,.Chat.selected:hover .Avatar.online::after{border-color:var(--color-chat-active) !important;background:var(--color-white)}.Chat.selected .ListItem-button,.Chat.selected:hover .ListItem-button{--background-color: var(--color-chat-active) !important;--color-text: var(--color-white);--color-text-meta-colored: var(--color-white);--color-text-meta: var(--color-white);--color-text-secondary: var(--color-white);--color-error: var(--color-white);--color-pinned: var(--color-white)}.Chat.selected .icon-muted-chat,.Chat.selected:hover .icon-muted-chat{color:var(--color-white) !important}.Chat.selected .Badge:not(.pinned),.Chat.selected:hover .Badge:not(.pinned){background:var(--color-white);color:var(--color-chat-active)}}.Chat .status{flex-shrink:0}.Chat .info .title,.Chat .info .subtitle{padding-right:.125rem}.Chat .info .subtitle{margin-top:-.125rem}.Chat .info h3{width:auto;max-width:80%}.Chat .info .icon-muted-chat{font-size:1.25rem;margin-left:0.25rem;margin-top:-.0625rem;color:#C6C8CA}body.is-ios .Chat .info .icon-muted-chat{margin-top:0;margin-right:.5rem}.Chat .info .LastMessageMeta{margin-left:auto}body.is-ios .Chat .info .LastMessageMeta{font-size:.875rem;margin-right:0}.Chat .info .last-message,.Chat .info .typing-status{padding-right:0.25rem;flex-grow:1;color:var(--color-text-secondary);unicode-bidi:plaintext}.Chat .info .last-message[dir=ltr],.Chat .info .typing-status[dir=ltr]{text-align:left}.Chat .info .last-message .sender-name,.Chat .info .typing-status .sender-name{color:var(--color-text)}.Chat .info .last-message .draft,.Chat .info .typing-status .draft{color:var(--color-error)}.Chat .info .last-message .draft::after{content:': '}.Chat .info .last-message .colon{margin-inline-end:.25rem}.Chat .info .last-message img{width:1.25rem;height:1.25rem;object-fit:cover;border-radius:.125rem;vertical-align:-.25rem;margin-inline-end:.25rem}body.is-ios .Chat .info .last-message img{width:1.125rem;height:1.125rem;vertical-align:-.1875rem}.Chat .info .last-message img.round{border-radius:.625rem}.Chat .info .last-message .emoji-small{width:1rem;height:1rem;vertical-align:-.125rem}.Chat .info .last-message .icon-play{position:relative;display:inline-block;font-size:.75rem;color:#fff;margin-inline-start:-1.25rem;margin-inline-end:0.5rem;bottom:0.0625rem}body.is-ios .Chat .info .last-message .icon-play{margin-inline-start:-1.125rem;bottom:0}.Chat[dir=rtl] .info .LastMessageMeta{margin-left:0;margin-right:auto}.Chat[dir=rtl] .info .title,.Chat[dir=rtl] .info .subtitle{padding-left:.15rem;padding-right:0}.Chat[dir=rtl] .info .icon-muted-chat{margin-left:0;margin-right:0.25rem}.Chat[dir=rtl] .info .last-message,.Chat[dir=rtl] .info .typing-status{padding-left:0.5rem;padding-right:0;text-align:right;unicode-bidi:plaintext}\n",".AnimatedEmoji{margin-bottom:0.75rem}.AnimatedEmoji img{position:absolute;width:100%;height:100%}.AnimatedEmoji img.like-sticker-thumb{transform:scale(0.8)}\n",".EmptyFolder{width:100%;height:80%;display:flex;align-items:center;justify-content:center;flex-direction:column}@media (max-height: 480px){.EmptyFolder{height:100%}}.EmptyFolder .sticker{height:8rem;margin-bottom:1.875rem}.EmptyFolder .title{font-size:1.25rem;margin-bottom:.125rem}.EmptyFolder .description{font-size:.875rem;color:var(--color-text-secondary)}body.is-ios .EmptyFolder .description,body.is-macos .EmptyFolder .description{color:var(--color-text-secondary-apple)}.EmptyFolder .Button.pill{margin-top:.625rem;font-weight:500;padding-inline-start:.75rem;unicode-bidi:plaintext}.EmptyFolder .Button.pill i{margin-inline-end:.625rem;font-size:1.5rem}\n",".NothingFound{display:flex;align-items:center;justify-content:center;color:var(--color-text-meta)}.NothingFound.with-description{flex-direction:column}.NothingFound .AnimatedSticker{margin:0 auto}.NothingFound .description{color:var(--color-text-secondary);font-size:.875rem;text-align:center;margin:1rem 0 0;unicode-bidi:plaintext}\n",".Media{height:0;padding-bottom:100%;overflow:hidden;position:relative;cursor:pointer}.Media .video-duration{position:absolute;left:.25rem;top:.25rem;background:rgba(0,0,0,0.25);color:#fff;font-size:.75rem;padding:0 .3125rem;border-radius:.1875rem;line-height:1.125rem}.Media img{position:absolute;left:0;top:0;width:100%;height:100%;object-fit:cover}\n",".WebLink{min-height:3rem;padding:.25rem 0 0 3.75rem;font-size:0.875rem;line-height:1.125rem;position:relative}.WebLink+.WebLink{margin-top:1.5rem}.WebLink.without-media::before{content:attr(data-initial);width:3rem;height:3rem;position:absolute;left:0;top:0;background-color:var(--color-webpage-initial-background);color:#fff;display:flex;align-items:center;justify-content:center;border-radius:var(--border-radius-messages-small);text-transform:uppercase;font-weight:500;font-size:1.5rem}.WebLink .Media{position:absolute;left:0;top:0;width:3rem;height:3rem;cursor:default !important;padding-bottom:unset !important;border-radius:var(--border-radius-messages-small) !important}.WebLink .site-name,.WebLink .site-description,.WebLink .site-title{word-break:break-word;text-align:initial}.WebLink .site-name{display:block;color:var(--color-links);font-weight:400;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.WebLink .site-title{font-size:1rem;font-weight:400;margin-bottom:.0625rem;line-height:1.3125rem}.WebLink .sender-name,.WebLink .site-description{margin-bottom:0;color:var(--color-text-secondary);line-height:1.125rem;max-height:2.25rem;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.WebLink .sender-name{margin-top:.25rem}.WebLink .site-description .emoji{width:1rem !important;height:1rem !important}.WebLink[dir=rtl]{padding:.25rem 3.75rem 0 0}.WebLink[dir=rtl] .Media,.WebLink[dir=rtl].without-media::before{left:auto;right:0}.WebLink[dir=rtl] .content{text-align:right}\n",".File{--secondary-color: var(--color-text-secondary);display:flex;align-items:center}.Message.own .File{--secondary-color: var(--color-text-green)}.content-inner .File{min-width:14rem}@media (max-width: 340px){.content-inner .File{min-width:11rem}}.File .file-icon-container{position:relative}.File .file-progress,.File .file-icon,.File .file-preview{width:3.375rem;height:3.375rem;margin-inline-end:.75rem;border-radius:var(--border-radius-messages-small);background:var(--color-primary);display:flex;align-items:center;justify-content:center}.File .file-progress{position:absolute;top:0;left:0}.File .file-icon{padding:1rem .75rem .5rem;align-items:flex-end;flex-shrink:0;position:relative;color:white}.File .file-icon .file-ext{font-size:1rem;font-weight:500;transition:opacity .15s}.File .file-icon::after{content:\"\";display:block;position:absolute;top:0;right:0;border-bottom-left-radius:0.25rem;background:rgba(0,0,0,0.25);border-color:transparent var(--background-color) transparent var(--background-color);border-width:0 1.125rem 1.125rem 0;border-style:solid;transition:border-width .15s ease-in}.File .file-preview{background:transparent;overflow:hidden}.File .file-preview+.action-icon,.File .file-preview+.file-progress{background:rgba(0,0,0,0.5);border-radius:var(--border-radius-messages-small)}.File .file-preview img{object-fit:cover}.File .action-icon{color:#fff;font-size:1.5rem;position:absolute;top:0;start:0;width:3.375rem;height:3.375rem;display:flex;align-items:center;justify-content:center;opacity:0;transition:opacity .25s}.File.interactive .file-icon-container{cursor:pointer}.File.interactive .file-icon-container:hover .file-icon::after{border-width:0}.File.interactive .file-icon-container:hover .action-icon{opacity:1}.File.interactive .file-icon-container:hover .action-icon.hidden{opacity:0}.File.interactive .file-icon-container:hover .file-ext{opacity:0}.File .file-info{margin-top:.1875rem;margin-right:.125rem;white-space:nowrap;overflow:hidden;flex-grow:1}.File .file-info+.Link{font-size:.75rem;color:var(--color-text-secondary);padding-left:1rem;white-space:nowrap}.File .file-title{font-size:1rem;line-height:1.5rem;font-weight:500;overflow:hidden;text-overflow:ellipsis}.File .file-title .emoji{vertical-align:-4px}.File .file-subtitle{font-size:.875rem;line-height:.9375rem;color:var(--secondary-color);max-width:100%;overflow:hidden;text-overflow:ellipsis}.File .file-subtitle span+span::before{content:'\\00a0\\2022\\00a0'}.File.smaller{--background-color: var(--color-background);--border-radius-messages-small: .3125rem}.File.smaller .action-icon,.File.smaller .file-progress,.File.smaller .file-icon,.File.smaller .file-preview{width:3rem;height:3rem}.File.smaller .file-icon{padding-bottom:.375rem}.File.smaller .file-icon::after{border-width:0 1rem 1rem 0}.File.smaller .file-info{margin-top:-.125rem}.File.smaller .file-title{font-weight:400}.File.smaller .file-subtitle{line-height:1rem}.File:dir(rtl) .file-progress,.File:dir(rtl) .file-icon,.File:dir(rtl) .file-preview,.File[dir=rtl] .file-progress,.File[dir=rtl] .file-icon,.File[dir=rtl] .file-preview{margin-left:.75rem;margin-right:0}.File:dir(rtl) .file-info,.File[dir=rtl] .file-info{text-align:right}.File:dir(rtl) .file-info+.Link,.File[dir=rtl] .file-info+.Link{padding-left:0;padding-right:1rem}.File:dir(rtl) .action-icon,.File[dir=rtl] .action-icon{left:auto;right:0}.File .file-progress.red,.File .file-icon.red{background-color:var(--color-error)}.File .file-progress.orange,.File .file-icon.orange{background-color:var(--color-warning)}.File .file-progress.green,.File .file-icon.green{background-color:var(--color-text-green)}\n",".Audio{display:flex;align-items:flex-start}.Audio.media-inner{overflow:visible}.Audio.own{--color-text-secondary: var(--accent-color);--color-interactive-active: var(--color-text-green);--color-interactive-inactive: rgba(var(--color-text-green-rgb), 0.4);--color-interactive-buffered: rgba(var(--color-text-green-rgb), 0.4)}.theme-dark .Audio.own{--color-text-green-rgb: 255, 255, 255;--color-text-green: var(--color-white)}.Audio.own .Button{--color-primary: var(--color-text-green);--color-primary-shade: var(--color-green);--color-primary-shade-darker: var(--color-green-darker);--color-white: var(--color-background-own)}.theme-dark .Audio.own .Button{--color-primary-shade: #fff;--color-primary-shade-darker: #fff}.Audio .toggle-play{margin-inline-end:.5rem}.Audio .toggle-play.smaller{width:3rem;height:3rem;margin-inline-end:.75rem}.Audio .toggle-play.smaller i{font-size:1.625rem;margin-top:-.025rem}.Audio .toggle-play i{position:absolute}.Audio .toggle-play i.icon-play{margin-left:.125rem}@media (max-width: 600px){.Audio .toggle-play i.icon-play{margin-left:.0625rem}}.Audio .toggle-play .icon-play,.Audio .toggle-play .icon-pause{opacity:1;transform:scale(1);transition:opacity 0.4s,transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1)}.Audio .toggle-play.play .icon-pause,.Audio .toggle-play.pause .icon-play,.Audio .toggle-play.loading .icon-play,.Audio .toggle-play.loading .icon-pause{opacity:0;transform:scale(0.5)}.Audio .media-loading{pointer-events:none}.Audio .media-loading .interactive{pointer-events:auto}.Audio .download-button{position:absolute;width:1.125rem !important;height:1.125rem !important;padding:0;left:1.5rem;top:1.5rem;border:0.125rem solid var(--background-color);z-index:1}.Audio .download-button i{font-size:0.8125rem}.Audio.bigger .download-button{left:2rem;top:2rem;border:0.125rem solid var(--color-background)}.Audio .content{align-self:center;min-width:0;flex-grow:1;text-align:initial}.Audio .content-row{display:flex;justify-content:space-between}.Audio .title{font-weight:500;margin:0;line-height:1.25;overflow:hidden;text-overflow:ellipsis}.Audio .voice-duration{margin:.25rem 0 0;font-size:.875rem;color:var(--color-text-secondary)}.Audio .voice-duration span{margin-left:0.25rem;font-size:1.5rem;line-height:.875rem;vertical-align:middle}.Audio:not(.own) .voice-duration span{color:var(--color-primary)}.Audio .waveform{cursor:pointer;margin-left:1px}.Audio .meta,.Audio .performer,.Audio .date{font-size:.875rem;line-height:1;color:var(--color-text-secondary);margin:0}.Audio .duration{margin:.1875rem 0 0;font-size:.875rem;color:var(--color-text-secondary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.Audio .seekline{width:calc(100% - 2px);padding-left:6px;margin-bottom:.3125rem;height:12px;position:relative;margin-left:-6px;top:1px;cursor:pointer}.Audio .seekline::before{content:'';position:absolute;width:100%;left:6px;top:6px;height:2px;background-color:var(--color-interactive-inactive);border-radius:2px}.Audio .seekline-buffered-progress,.Audio .seekline-play-progress{position:absolute;height:2px;border-radius:2px;overflow:hidden;width:100%;top:6px;left:6px}.Audio .seekline-buffered-progress i,.Audio .seekline-play-progress i{position:absolute;width:100%;background-color:var(--color-interactive-active);height:2px;border-radius:2px;right:100%}.Audio .seekline-buffered-progress i{background-color:var(--color-interactive-buffered) !important}.Audio .seekline-thumb{position:absolute;width:100%;top:7px;left:0}.Audio .seekline-thumb i{pointer-events:none;position:absolute;width:100%;right:100%}.Audio .seekline-thumb i::after{content:'';position:absolute;top:-6px;right:-12px;width:12px;height:12px;border-radius:6px;background:var(--color-interactive-active)}.Audio.bigger .content{margin-top:.1875rem}.Audio.bigger .title{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-weight:400;line-height:1.5rem}.Audio.bigger .meta,.Audio.bigger .performer,.Audio.bigger .date{line-height:1.0625rem}.Audio.bigger .seekline{top:2px;margin-bottom:.5rem}.Audio.bigger .duration{line-height:1rem}.Audio.bigger .media-loading{top:0.1875rem;left:0.1875rem}.Audio.bigger[dir=rtl] .media-loading{left:auto !important;right:0}.Audio .ProgressSpinner.size-s svg{width:2.25rem;height:2.25rem}.Audio[dir=rtl] .toggle-play{margin-left:.5rem;margin-right:0}.Audio[dir=rtl] .toggle-play.smaller{margin-left:.75rem;margin-right:0}.Audio[dir=rtl] .content,.Audio[dir=rtl] .duration{text-align:right}.Audio[dir=rtl] .download-button{left:auto;right:1.5rem}\n",".DropTarget{border-radius:var(--border-radius-default);background:var(--color-background);padding:1.25rem;flex:1 1 auto;width:100%;max-width:43.75rem;margin-left:auto;margin-right:auto;margin-bottom:.3125rem;display:flex;color:#A4ACB3;box-shadow:0 1px 2px var(--color-default-shadow)}@media (max-height: 350px){.DropTarget{padding:.75rem}}.DropTarget.hovered .target-content{color:var(--color-primary);background-image:var(--drag-target-border-hovered)}.DropTarget+.DropTarget{margin-top:.3125rem}.DropTarget:last-child{margin-bottom:0}.DropTarget .target-content{pointer-events:none;background-image:var(--drag-target-border);border-radius:.5rem;flex:1 1 100%;display:flex;flex-direction:column;align-items:center;justify-content:center;transition:.2s color, .2s background}.DropTarget .icon{font-size:6.25rem;line-height:4.6875rem;margin-bottom:2.25rem}@media (max-height: 520px){.DropTarget .icon{font-size:4.25rem;line-height:3.5rem;margin-bottom:1rem}}@media (max-height: 450px){.DropTarget .icon{font-size:2rem;line-height:1rem;margin-bottom:.5rem;margin-top:.25rem}}.DropTarget .title{font-size:1.3125rem;font-weight:500;letter-spacing:-.18px}@media (max-height: 450px){.DropTarget .title{font-size:1rem}}.DropTarget .description{font-size:1rem;letter-spacing:.3px}@media (max-height: 450px){.DropTarget .description{font-size:.875rem}}\n",".FloatingActionButton{position:absolute;right:1rem;bottom:1rem;transform:translateY(5rem);transition:transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1)}body.animation-level-0 .FloatingActionButton{transition:none !important}.FloatingActionButton.revealed{transform:translateY(0)}\n",".DropArea{position:absolute;top:0;right:0;left:0;height:100vh;z-index:var(--z-drop-area);padding:80px 20px 20px;display:flex;flex-direction:column}#Main.right-column-open .DropArea{max-width:calc(100% - var(--right-column-width))}\n",".StickerButton{display:inline-block;width:4rem;height:4rem;margin:0.5rem;border-radius:var(--border-radius-messages-small);background:transparent no-repeat center;background-size:contain;cursor:pointer;transition:background-color .15s ease, opacity .3s ease !important;position:relative}@media (max-width: 600px){.StickerButton{margin:0.25rem}}.StickerButton.set-button{width:2.75rem !important;height:2.75rem;margin:0 0.5rem}.StickerButton.large{width:10rem;height:10rem;margin:0}.StickerButton .AnimatedSticker,.StickerButton img{position:absolute;top:0;left:0;width:100%;height:100%}.StickerButton img{object-fit:contain}.StickerButton .sticker-unfave-button{position:absolute;top:-0.5rem;right:-0.5rem;width:1.25rem;height:1.25rem;padding:0.125rem;opacity:0}.StickerButton .sticker-unfave-button i{font-size:1rem}.StickerButton:hover{background-color:var(--color-interactive-element-hover)}.StickerButton:hover .sticker-unfave-button{opacity:1}\n",".TextFormatter{transform:translate(-50%, -3.25rem)}.TextFormatter,.TextFormatter-link-control{position:absolute;background:var(--color-background);border-radius:var(--border-radius-messages);padding:0.5rem 0.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 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:0.25rem;font-size:1.5rem;margin:0 0.125rem;border-radius:var(--border-radius-messages-small);flex-shrink:0;cursor:pointer}.TextFormatter .Button.active{background-color:var(--color-primary) !important;color:white}.TextFormatter .Button.disabled{opacity:.5;pointer-events:none}\n",".Picker{height:100%;display:flex;flex-direction:column;overflow:hidden}.Picker .picker-header{padding:0 1rem 0.25rem 0.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:0.5rem;margin-left:0.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:0.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)}\n"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/0.1ebe794c83bdc1b89fad.js b/dist/0.1ebe794c83bdc1b89fad.js new file mode 100644 index 00000000..4ecd53bb --- /dev/null +++ b/dist/0.1ebe794c83bdc1b89fad.js @@ -0,0 +1,2 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[0],Array(108).concat([function(e,t,n){"use strict";var a=n(0),r=n(6),c=n(10),i=n(9),s=n(150),o=n(183),l=n(25),d=n(17),u=n(45),m=n(56),b=n(44);n(217);t.a=e=>{const{ref:t,buttonRef:n,icon:h,className:f,style:p,children:O,disabled:g,ripple:v,narrow:j,inactive:E,focus:y,destructive:C,multiline:N,isStatic:T,contextActions:w,onClick:I}=e;let M=Object(a.q)(null);t&&(M=t);const[k,S,L]=Object(l.a)(),{isContextMenuOpen:A,contextMenuPosition:x,handleBeforeContextMenu:D,handleContextMenu:R,handleContextMenuClose:F,handleContextMenuHide:_}=Object(s.a)(M,!w),P=Object(a.m)(()=>M.current,[]),U=Object(a.m)(()=>M.current.closest(".custom-scroll"),[]),B=Object(a.m)(()=>M.current.querySelector(".ListItem-context-menu .bubble"),[]),{positionX:q,positionY:H,style:$}=Object(o.a)(x,P,U,B),K=Object(a.m)(e=>{!g&&I&&(I(e),r.n&&!v&&(S(),Object(c.b)(L)))},[g,S,I,v,L]),z=Object(a.m)(e=>{E||r.n||(!w||2!==e.button&&I||D(e),0===e.button&&(I?K(e):R(e)))},[E,w,I,D,R,K]),V=Object(d.a)(),Y=Object(i.a)("ListItem",f,!T&&"no-selection",v&&"has-ripple",j&&"narrow",g&&"disabled",E&&"inactive",x&&"has-menu-open",y&&"focus",C&&"destructive",N&&"multiline",T&&"is-static");return a.a.createElement("div",{ref:M,className:Y,dir:V.isRtl?"rtl":void 0,style:p},a.a.createElement("div",{className:Object(i.a)("ListItem-button",k&&"active"),role:"button",ref:n,tabIndex:0,onClick:!E&&r.n?K:void 0,onMouseDown:z,onContextMenu:!E&&w?R:void 0},h&&a.a.createElement("i",{className:"icon-"+h}),N&&a.a.createElement("div",{className:"multiline-item"},O),!N&&O,!g&&!E&&v&&a.a.createElement(u.a,null)),w&&void 0!==x&&a.a.createElement(m.a,{isOpen:A,positionX:q,positionY:H,style:$,className:"ListItem-context-menu",autoClose:!0,onClose:F,onCloseAnimationEnd:_},w.map(e=>a.a.createElement(b.a,{key:e.title,icon:e.icon,destructive:e.destructive,disabled:!e.handler,onClick:e.handler},e.title))))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i})),n.d(t,"c",(function(){return s})),n.d(t,"b",(function(){return o}));var a=n(0),r=n(10),c=n(38);function i({rootRef:e,throttleMs:t,debounceMs:n,shouldSkipFirst:i,margin:s,threshold:o,isDisabled:l},d){const u=Object(a.q)(),m=Object(a.q)(),b=Object(a.q)(0),h=Object(a.q)();m.current=d;const f=Object(a.m)(()=>{b.current++},[]),p=Object(a.m)(()=>{b.current&&(b.current--,!b.current&&h.current&&(h.current(),h.current=void 0))},[]);Object(c.c)(f,p),Object(a.n)(()=>{if(!l)return()=>{u.current&&(u.current.observer.disconnect(),u.current.callbacks.clear(),u.current=void 0)}},[l]);return{observe:Object(a.m)((a,c)=>{u.current||function(){const a=new Map,c=new Map,l=()=>{const e=Array.from(c.values());e.forEach(t=>{const n=a.get(t.target);n&&n(t,e)}),m.current&&m.current(e),c.clear()},d=t?r.h:n?r.a:void 0,f=d?d(l,t||n,!i):l,p=new IntersectionObserver(e=>{e.forEach(e=>{c.set(e.target,e)}),b.current?h.current=()=>{f()}:f()},{root:e.current,rootMargin:s?s+"px":void 0,threshold:o});u.current={observer:p,callbacks:a}}();const l=u.current;return l.observer.observe(a),c&&l.callbacks.set(a,c),()=>{c&&l.callbacks.delete(a),l.observer.unobserve(a)}},[l]),freeze:f,unfreeze:p}}function s(e,t,n){Object(a.n)(()=>t?t(e.current,n):void 0,[])}function o(e,t,n){const[r,c]=Object(a.r)(!t);return s(e,t,e=>{c(e.isIntersecting),n&&n(e)}),r}},function(e,t,n){"use strict";var a=n(0),r=n(8),c=n(33),i=n(32);t.a=(e,t=!1,n=r.ApiMediaFormat.BlobUrl,s,o)=>{const l=e?c.c(e):void 0,d=Object(i.a)();return Object(a.n)(()=>{if(!t&&e&&!l){const t=Date.now();c.b(e,n).then(()=>{const e=Date.now()-t;!o||e>=o?d():setTimeout(d,o-e)})}},[t,e,l,n,s,d,o]),l}},function(e,t,n){"use strict";var a=n(0),r=n(1),c=n(13),i=n(7),s=n(4),o=n(23),l=n(3),d=n(17),u=n(114),m=n(138),b=n(162);t.a=Object(a.h)(Object(r.h)((e,{userId:t,forceShowSelf:n})=>{const{lastSyncTime:a,serverTimeOffset:r}=e,c=Object(i.Jb)(e,t);return{lastSyncTime:a,user:c,isSavedMessages:!n&&c&&c.isSelf,areMessagesLoaded:Boolean(Object(i.n)(e,t)),serverTimeOffset:r}},(e,t)=>Object(l.l)(t,["loadFullUser","openMediaViewer"]))(({typingStatus:e,avatarSize:t="medium",status:n,withMediaViewer:r,withUsername:i,withFullInfo:l,withUpdatingStatus:h,noStatusOrTyping:f,noRtl:p,user:O,isSavedMessages:g,areMessagesLoaded:v,lastSyncTime:j,loadFullUser:E,openMediaViewer:y,serverTimeOffset:C})=>{const{id:N}=O||{},T=Object(s.bb)(O);Object(a.n)(()=>{l&&j&&N&&E({userId:N})},[N,E,j,l]);const w=Object(a.m)((e,n)=>{O&&n&&(e.stopPropagation(),y({avatarOwnerId:O.id,origin:"jumbo"===t?c.h.ProfileAvatar:c.h.MiddleHeaderAvatar}))},[O,t,y]),I=Object(d.a)();if(O)return a.a.createElement("div",{className:"ChatInfo",dir:!p&&I.isRtl?"rtl":void 0},a.a.createElement(u.a,{key:O.id,size:t,user:O,isSavedMessages:g,onClick:r?w:void 0}),a.a.createElement("div",{className:"info"},g?a.a.createElement("div",{className:"title"},a.a.createElement("h3",null,I("SavedMessages"))):a.a.createElement("div",{className:"title"},a.a.createElement("h3",{dir:"auto"},T&&Object(o.a)(T)),O&&O.isVerified&&a.a.createElement(m.a,null)),(n||!g&&!f)&&(n?a.a.createElement("span",{className:"status",dir:"auto"},n):h&&!v?a.a.createElement("span",{className:"status",dir:"auto"},I("Updating")):O?e?a.a.createElement(b.a,{typingStatus:e}):a.a.createElement("div",{className:"status "+(Object(s.Cb)(O)?"online":"")},i&&O.username&&a.a.createElement("span",{className:"handle"},O.username),a.a.createElement("span",{className:"user-status",dir:"auto"},Object(s.cb)(I,O,C))):void 0)))}))},function(e,t,n){"use strict";var a=n(0),r=n(57);var c=n(9),i=n(38),s=n(41),o=n(58),l=n(17),d=n(40),u=n(22),m=n(128);n(156);t.a=({title:e,className:t,isOpen:n,header:b,hasCloseButton:h,noBackdrop:f,children:p,onClose:O,onCloseAnimationEnd:g,onEnter:v,shouldSkipHistoryAnimations:j})=>{const{shouldRender:E,transitionClassNames:y}=Object(s.a)(n,g,j,void 0,j),C=Object(a.q)(null);Object(a.n)(()=>n?Object(r.a)({onEsc:O,onEnter:v}):void 0,[n,O,v]),Object(a.n)(()=>n&&C.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 r=0;a>=0&&(r=t.shiftKey?a>0?a-1:n.length-1:a{document.removeEventListener("keydown",t,!1)}}(C.current):void 0,[n]);const{forceClose:N}=Object(d.a)(n,O);Object(a.n)(()=>()=>{n&&N()},[]),Object(o.a)(([e])=>(document.body.classList.toggle("has-open-dialog",n),(n||!n&&void 0!==e)&&Object(i.d)(200),()=>{document.body.classList.remove("has-open-dialog")}),[n]);const T=Object(l.a)();if(!E)return;const w=Object(c.a)("Modal",t,y,f&&"transparent-backdrop");return a.a.createElement(m.a,null,a.a.createElement("div",{ref:C,className:w,tabIndex:-1,role:"dialog"},a.a.createElement("div",{className:"modal-container"},a.a.createElement("div",{className:"modal-backdrop",onClick:O}),a.a.createElement("div",{className:"modal-dialog"},b||(e?a.a.createElement("div",{className:"modal-header"},h&&a.a.createElement(u.a,{round:!0,color:"translucent",size:"smaller",ariaLabel:T("Close"),onClick:O},a.a.createElement("i",{className:"icon-close"})),a.a.createElement("div",{className:"modal-title"},e)):void 0),a.a.createElement("div",{className:"modal-content custom-scroll"},p)))))}},function(e,t,n){"use strict";var a=n(0),r=n(1),c=n(32),i=n(30),s=n(9),o=n(38),l=n(179);n(203);const d=Symbol("CLEANED_UP");t.a=({ref:e,activeKey:t,name:n,direction:u="auto",renderCount:m,shouldRestoreHeight:b,shouldCleanup:h,cleanupExceptionKey:f,id:p,className:O,onStart:g,onStop:v,children:j})=>{const{animationLevel:E}=Object(r.e)().settings.byKey;let y=Object(a.q)(null);e&&(y=e);const C=Object(a.q)({}),N=Object(i.a)(t),T=Object(c.a)(),w=void 0!==N&&t!==N;!m&&w&&(C.current={[N]:C.current[N]}),C.current[t]=j,Object(a.o)(()=>{function e(){!h||void 0!==f&&f===N||(C.current={[N]:d},T())}const a=y.current,r=a.children;if(1===r.length&&!w)return void r[0].classList.add("active");const c=Array.from(a.childNodes);if(!w||!c.length)return;const i=-1===u||"auto"===u&&N>t||"inverse"===u&&N{e instanceof HTMLElement&&(e.classList.remove("from","through","to"),e.classList.toggle("active",t===O))}),void e();let j;c.forEach((e,t)=>{e instanceof HTMLElement&&(e.classList.remove("active"),e.classList.toggle("from",t===p),e.classList.toggle("through",t>p&&tO),e.classList.toggle("to",t===O))}),E>0&&(j=Object(o.d)()),requestAnimationFrame(()=>{function t(){requestAnimationFrame(()=>{if(a.classList.remove("animating","backwards"),c.forEach((e,t)=>{e instanceof HTMLElement&&(e.classList.remove("from","through","to"),e.classList.toggle("active",t===O))}),b){const e=a.querySelector(".active");e&&(e.style.height="auto",a.style.height=e.clientHeight+"px")}j&&j(),e(),v&&v()})}a.classList.add("animating"),g&&g();const r="mv-slide"===n?c[O]&&c[O].firstChild:c[O];E>0&&r?Object(l.a)(r,t):t()})},[t,N,w,u,n,g,v,m,b,h,f,E,T]),Object(a.o)(()=>{if(b){const e=y.current,t=e.querySelector(".active")||e.querySelector(".from");t&&(t.style.height="auto",e.style.height=t.clientHeight+"px",e.style.flexBasis=t.clientHeight+"px")}},[b,j]);const I=C.current,M=Object.keys(m?new Array(m).fill(void 0):I).map(Number).map(e=>{const n=I[e];return"function"==typeof n?a.a.createElement("div",{key:e},n(e===t,e===N,t)):void 0}),k=Object(s.a)("Transition",O,n);return a.a.createElement("div",{ref:y,id:p,className:k},M)}},function(e,t,n){"use strict";var a=n(0),r=n(8),c=n(2),i=n(4),s=n(51),o=n(9),l=n(23),d=n(110),u=n(117),m=n(17);n(205);t.a=Object(a.h)(({className:e,size:t="large",chat:n,user:b,text:h,withOnlineStatus:f,isSavedMessages:p,lastSyncTime:O,onClick:g})=>{const v=b&&Object(i.sb)(b);let j;p||v||(b?j=Object(i.e)(b):n&&(j=Object(i.e)(n)));const E=Object(d.a)(j,!1,r.ApiMediaFormat.DataUri,O),{shouldRenderFullMedia:y,transitionClassNames:C}=Object(u.a)(E,"slow"),N=Object(m.a)();let T="";if(p)T=a.a.createElement("i",{className:"icon-avatar-saved-messages"});else if(v)T=a.a.createElement("i",{className:"icon-avatar-deleted-account"});else if(y)T=a.a.createElement("img",{src:E,className:C+" avatar-media",alt:"",decoding:"async"});else if(b){const e=Object(i.bb)(b);T=e?Object(s.c)(e,2):void 0}else if(n){const e=Object(i.k)(N,n);T=e&&Object(s.c)(e,Object(i.ob)(n.id)?2:1)}else h&&(T=Object(s.c)(h,2));const w=!p&&b&&Object(i.Cb)(b),I=Object(o.a)("Avatar size-"+t,e,"color-bg-"+Object(i.Z)(b||n),p&&"saved-messages",v&&"deleted-account",f&&w&&"online",g&&"interactive",!p&&!y&&"no-photo"),M=Object(a.m)(e=>{g&&g(e,p||y)},[g,p,y]),k=(b||n)&&(b||n).id;return a.a.createElement("div",{className:I,onClick:M,"data-test-sender-id":c.N?k:void 0},"string"==typeof T?Object(l.a)(T,["jumbo"===t?"hq_emoji":"emoji"]):T)})},function(e,t,n){"use strict";var a=n(13),r=n(0),c=n(10),i=n(161);t.a=({ref:e,className:t,onLoadMore:n,onScroll:s,onKeyDown:o,items:l,itemSelector:d=".ListItem",preloadBackwards:u=20,sensitiveArea:m=800,noScrollRestore:b=!1,noScrollRestoreOnTop:h=!1,noFastList:f,cacheBuster:p,children:O})=>{let g=Object(r.q)(null);e&&(g=e);const v=Object(r.q)({}),[j,E]=Object(r.p)(()=>n?[Object(c.a)((e=!1)=>{n({direction:a.e.Backwards,noScroll:e})},1e3,!0,!1),Object(c.a)(()=>{n({direction:a.e.Forwards})},1e3,!0,!1)]:[],[n,l]);Object(r.n)(()=>{if(!j)return;if(u>0&&(!l||l.length{const e=g.current,t=v.current;let n;if(t.listItemElements=e.querySelectorAll(d),t.currentAnchor&&Array.from(t.listItemElements).includes(t.currentAnchor)){const{scrollTop:a}=e;n=a+(t.currentAnchor.getBoundingClientRect().top-t.currentAnchorTop)}else{const e=t.listItemElements[0];e&&(t.currentAnchor=e,t.currentAnchorTop=e.getBoundingClientRect().top)}b||h&&0===e.scrollTop||(Object(i.a)(e,n),t.isScrollTopJustUpdated=!0)},[l,d,b,h,p]);const y=Object(r.m)(e=>{if(E&&j){const{listItemElements:e,isScrollTopJustUpdated:t,currentAnchor:n,currentAnchorTop:a}=v.current;if(t)return void(v.current.isScrollTopJustUpdated=!1);const r=e.length,c=g.current,{scrollTop:s,scrollHeight:o,offsetHeight:l}=c,d=s<=(r?e[0].offsetTop:0)+m,u=(r?e[r-1].offsetTop+e[r-1].offsetHeight:o)-(s+l)<=m;let b=!1;if(d){const t=e[0];if(t){const e=t.getBoundingClientRect().top,r=n&&n.offsetParent&&n!==t?n.getBoundingClientRect().top:e;n&&void 0!==a&&r>a&&(v.current.currentAnchor=t,v.current.currentAnchorTop=e,b=!0,Object(i.a)(c),E())}}if(u){const t=e[r-1];if(t){const e=t.getBoundingClientRect().top,r=n&&n.offsetParent&&n!==t?n.getBoundingClientRect().top:e;n&&void 0!==a&&r{const d=Object(r.a)("FloatingActionButton",e&&"revealed",t);return a.a.createElement(c.a,{className:d,color:n,round:!0,disabled:s,onClick:e&&!s?o:void 0,ariaLabel:i,tabIndex:-1},l)}},function(e,t,n){"use strict";var a=n(0),r=n(41);const c={fast:200,slow:350};t.a=(e,t="fast",n=!1)=>{const i=Boolean(e),s=!Object(a.q)(i).current&&!n,[o,l]=Object(a.r)(!i),{shouldRender:d,transitionClassNames:u}=Object(r.a)(i,void 0,!s,t);return Object(a.n)(()=>{d&&(s?setTimeout(()=>{l(!1)},c[t]):l(!1))},[s,d,t]),{shouldRenderThumb:o,shouldRenderFullMedia:d,transitionClassNames:u}}},function(e,t,n){"use strict";n.d(t,"c",(function(){return s})),n.d(t,"d",(function(){return o})),n.d(t,"e",(function(){return l})),n.d(t,"a",(function(){return d})),n.d(t,"b",(function(){return u})),n.d(t,"j",(function(){return p})),n.d(t,"l",(function(){return g})),n.d(t,"g",(function(){return v})),n.d(t,"i",(function(){return j})),n.d(t,"m",(function(){return E})),n.d(t,"k",(function(){return y})),n.d(t,"n",(function(){return C})),n.d(t,"h",(function(){return N})),n.d(t,"f",(function(){return T}));var a=n(2),r=n(6),c=n(55),i=n(4);const s="(max-height: 640px)",o=parseInt(getComputedStyle(document.documentElement).fontSize,10),l=200,d={width:640,height:640},u="1258816259753933",m={width:100,height:100};let b,h,f;function p(e,t,n,a){const i=t||n?1.625:0;return(function(e,t){const n=e?30:29;if(!r.l)return n;const{width:a}=c.a.get();return b||(b=Math.min(30,a/o-4.5)),h||(h=Math.min(29,a/o-7)),f||(f=Math.min(29,a/o-4.5)),e?b:t?f:h}(e,a)-i)*o}function O({width:e,height:t,fromOwnMessage:n,isForwarded:a,isWebPagePhoto:r,isGif:c,noAvatars:i}){const s=t/e;return T(p(n,a,r,i),function(e,t){return e&&t&&t>=.75&&t<=1.25?20*o:27*o}(c,s),e,t)}function g(e,t){const n=window.matchMedia(s),{width:a,height:r}=c.a.get();let i=t&&n.matches?10:8.25;return e&&(i=n.matches?10:15),{width:a,height:r-i*o}}function v(e,t,n,a,r){const{width:c,height:s}=Object(i.V)(e)||m;return O({width:c,height:s,fromOwnMessage:t,isForwarded:n,isWebPagePhoto:a,noAvatars:r})}function j(e,t,n,a){const{width:r,height:c}=Object(i.db)(e)||m;return O({width:r,height:c,fromOwnMessage:t,isForwarded:n,isGif:e.isGif,noAvatars:a})}function E(){return{width:2*o,height:2*o}}function y(e){return e?{width:3*o,height:3*o}:{width:3.375*o,height:3.375*o}}function C(e){const{width:t}=e;let{height:n}=e;e.id===u&&(n=t);const c=n&&t&&n/t,i=o*(r.l?a.Jb:a.Ib),s=c?i*c:i;return c&&s>i?{width:Math.round(i/c),height:i}:{width:i,height:s}}function N({width:e,height:t},n,a=!1){const{width:r,height:c}=g(n,a);return T(r,c,e,t)}function T(e,t,n,a){const r=a/n,c=Math.min(n,e);return Math.round(c*r)>t?{width:Math.round(t/r),height:t}:{width:c,height:Math.round(c*r)}}},function(e,t,n){"use strict";var a=n(0),r=n(10),c=n(9),i=n(38),s=n(127);let o,l;async function d(){return o||(o=n.e(7).then(n.bind(null,202)),l=(await o).default),o}setTimeout(d,5e3);t.a=Object(a.h)(({className:e,id:t,animationData:n,play:o,playSegment:u,speed:m,noLoop:b,size:h,quality:f,isLowPriority:p,onLoad:O})=>{const[g,v]=Object(a.r)(),j=Object(a.q)(null),E=Object(a.q)(!1),y=Object(a.q)(!1),C=Object(a.q)();C.current=o;const N=Object(a.q)();N.current=u,Object(a.n)(()=>{if(g||!n)return;const e=()=>{if(!j.current)return;const e=new l(t,j.current,n,{noLoop:b,size:h,quality:f,isLowPriority:p},O);m&&e.setSpeed(m),v(e)};l?e():d().then(()=>{Object(r.b)(()=>{j.current&&e()})})},[g,n,t,p,b,O,f,h,m]),Object(a.n)(()=>()=>{g&&g.destroy()},[g]);const T=Object(a.m)((e=!1)=>{g&&(C.current||N.current)&&(N.current?g.playSegment(N.current):e?g.goToAndPlay(0):g.play())},[g]),w=Object(a.m)(()=>{g&&g.pause()},[g]),I=Object(a.m)(()=>{y.current=!0,g&&(E.current||(E.current=g.isPlaying()),w())},[g,w]),M=Object(a.m)(()=>{E.current&&T(),E.current=!1,y.current=!1},[T]),k=Object(a.m)(()=>{Object(r.b)(M)},[M]);Object(a.n)(()=>{g&&(o||u?y.current?E.current=!0:T(b):y.current?E.current=!1:w())},[g,o,u,b,T,w]),Object(i.c)(I,M),Object(s.a)(I,k);const S=Object(c.a)("AnimatedSticker",e),L=h?`width: ${h}px; height: ${h}px;`:void 0;return a.a.createElement("div",{ref:j,className:S,style:L})})},function(e,t,n){"use strict";var a=n(0),r=n(17),c=n(112),i=n(22);t.a=Object(a.h)(({isOpen:e,onClose:t,onCloseAnimationEnd:n,title:s,header:o,text:l,textParts:d,confirmLabel:u="Confirm",confirmHandler:m,confirmIsDestructive:b,isButtonsInOneRow:h})=>{const f=Object(r.a)();return a.a.createElement(c.a,{className:"confirm",title:s,header:o,isOpen:e,onClose:t,onCloseAnimationEnd:n,onEnter:m},l&&l.split("\\n").map(e=>a.a.createElement("p",null,e)),d,a.a.createElement("div",{className:h?"dialog-buttons mt-2":""},a.a.createElement(i.a,{className:"confirm-dialog-button",isText:!0,onClick:m,color:b?"danger":"primary"},u),a.a.createElement(i.a,{className:"confirm-dialog-button",isText:!0,onClick:t},f("Cancel"))))})},function(e,t,n){"use strict";var a=n(0),r=n(9),c=n(41),i=n(23),s=n(17);n(263);t.a=Object(a.h)(({text:e="Nothing found.",description:t})=>{const n=Object(s.a)(),{transitionClassNames:o}=Object(c.a)(!0);return a.a.createElement("div",{className:Object(r.a)("NothingFound",o,t&&"with-description")},e,t&&a.a.createElement("p",{className:"description"},Object(i.a)(n(t),["br"])))})},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var a=n(0),r=n(53),c=n(32);function i(e,t){const n=void 0===t,i=Object(a.q)(n),s=Object(a.q)(),o=Object(c.a)();return Object(r.a)(()=>{n||(i.current=!1,s.current&&(clearTimeout(s.current),s.current=void 0))},e),Object(a.n)(()=>{if(n||i.current)return;const e=()=>{i.current=!0,o()};t>0?s.current=window.setTimeout(e,t):e()},e),i.current}},function(e,t,n){"use strict";var a=n(0),r=n(6),c=n(8),i=n(10),s=n(33),o=n(32);t.a=(e,t=!1,n=c.ApiMediaFormat.BlobUrl,l,d)=>{const u=e?s.c(e):void 0,m=n===c.ApiMediaFormat.Stream||r.h&&n===c.ApiMediaFormat.Progressive,b=Object(o.a)(),[h,f]=Object(a.r)(u&&!m?1:0),p=Object(a.q)(),O=Object(a.p)(()=>Object(i.h)(e=>{(!d||Date.now()-p.current>d)&&f(e)},500,!0),[d]);return Object(a.n)(()=>{!t&&e&&(u?m&&setTimeout(()=>{f(.75)},1500):(f(0),p.current&&s.a(O),p.current=Date.now(),s.b(e,n,O).then(()=>{const e=Date.now()-p.current;p.current=void 0,!d||e>=d?b():setTimeout(b,d-e)})))},[t,e,u,n,l,b,m,d,O]),Object(a.n)(()=>{t&&p.current&&(s.a(O),f(0))},[O,t]),{mediaData:u,downloadProgress:h}}},function(e,t,n){"use strict";var a=n(0),r=n(9);n(230);const c={s:22,m:25,l:28,xl:20};t.a=Object(a.h)(({progress:e=0,size:t="l",square:n,transparent:i,noCross:s,onClick:o})=>{const l=c[t],d=l-4,u=l-1,m=2*d*Math.PI,b=Object(a.q)(null);Object(a.n)(()=>{if(!b.current)return;const t=b.current.firstElementChild,n=m-Math.min(Math.max(.05,e),1)*m;t?t.firstElementChild.setAttribute("stroke-dashoffset",n.toString()):b.current.innerHTML=`\n \n `},[b,m,u,d,e]);const h=Object(r.a)("ProgressSpinner size-"+t,i&&"transparent",n&&"square",s&&"no-cross");return a.a.createElement("div",{ref:b,className:h,onClick:o})})},function(e,t,n){"use strict";var a=n(0),r=n(8),c=n(109),i=n(110),s=n(117),o=n(25),l=n(9),d=n(119),u=n(22);n(247);t.a=Object(a.h)(({sticker:e,size:t,observeIntersection:n,noAnimate:m,title:b,className:h,onClick:f,clickArg:p,onUnfaveClick:O})=>{const g=Object(a.q)(null),v="sticker"+e.id,j="sticker-button-"+e.id,E=Object(c.b)(g,n),y=e.thumbnail?e.thumbnail.dataUri:void 0,C=Object(i.a)(v+"?size=m",!E,r.ApiMediaFormat.BlobUrl),N=E&&!m,T=Object(i.a)(e.isAnimated&&v,!N,r.ApiMediaFormat.Lottie),[w,I,M]=Object(o.a)(Boolean(T)),k=w&&N,{shouldRenderThumb:S,shouldRenderFullMedia:L,transitionClassNames:A}=Object(s.a)(C||k,"slow");Object(a.n)(()=>{N||M()},[M,N]);const x=Object(l.a)("StickerButton",e.isAnimated&&"animated",j,h),D=S&&y?`background-image: url('${y}');`:"";return a.a.createElement("div",{ref:g,className:x,title:b||e&&e.emoji,style:D,"data-sticker-id":e.id,onClick:function(){f&&f(p)}},L&&!k&&a.a.createElement("img",{src:C,className:A}),N&&T&&a.a.createElement(d.a,{id:v,animationData:T,play:!0,size:t,isLowPriority:!0,onLoad:I}),O&&a.a.createElement(u.a,{className:"sticker-unfave-button",color:"dark",round:!0,onClick:function(t){t.stopPropagation(),t.preventDefault(),O(e)}},a.a.createElement("i",{className:"icon-close"})))})},function(e,t,n){"use strict";var a=n(0),r=n(9),c=n(17),i=n(27);n(236);var s=Object(a.h)(({id:e,label:t,subLabel:n,value:s,name:o,checked:l,disabled:d,hidden:u,isLoading:m,onChange:b})=>{const h=Object(c.a)(),f=Object(r.a)("Radio",d&&"disabled",u&&"hidden-widget",m&&"loading");return a.a.createElement("label",{className:f,dir:h.isRtl?"rtl":void 0},a.a.createElement("input",{type:"radio",name:o,value:s,id:e,checked:l,onChange:b,disabled:d||u}),a.a.createElement("div",{className:"Radio-main"},a.a.createElement("span",{className:"label",dir:h.isRtl?"auto":void 0},t),n&&a.a.createElement("span",{className:"subLabel",dir:h.isRtl?"auto":void 0},n)),m&&a.a.createElement(i.a,null))});t.a=Object(a.h)(({id:e,name:t,options:n,selected:r,disabled:c,loadingOption:i,onChange:o})=>{const l=Object(a.m)(e=>{const{value:t}=e.currentTarget;o(t)},[o]);return a.a.createElement("div",{id:e,className:"radio-group"},n.map(e=>a.a.createElement(s,{name:t,label:e.label,subLabel:e.subLabel,value:e.value,checked:e.value===r,hidden:e.hidden,disabled:c,isLoading:i?i===e.value:void 0,onChange:l})))})},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var a=n(0);function r(e,t){Object(a.n)(()=>(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])}},function(e,t,n){"use strict";var a=n(0),r=n(67);t.a=({containerId:e,className:t,children:n})=>{const c=Object(a.q)(document.createElement("div"));return Object(a.o)(()=>{const n=document.querySelector(e||"#portals");if(!n)return;const a=c.current;return t&&a.classList.add(t),n.appendChild(a),()=>{r.a.render(void 0,a),n.removeChild(a)}},[t,e]),r.a.render(n,c.current)}},function(e,t,n){"use strict";var a=n(0),r=n(8),c=n(118),i=n(109),s=n(110),o=n(117),l=n(25),d=n(119);n(220);const u={large:160,medium:128,small:104};t.a=({sticker:e,size:t="medium",observeIntersection:n,lastSyncTime:m,forceLoadPreview:b})=>{const h=Object(a.q)(null),[f,p]=Object(l.a)(),O="sticker"+e.id,g=Object(i.b)(h,n),v=e.thumbnail&&e.thumbnail.dataUri,j=Object(s.a)(O+"?size=m",!g&&!b,r.ApiMediaFormat.BlobUrl,m),{transitionClassNames:E}=Object(o.a)(j,"slow"),y=Object(s.a)(O,!g,r.ApiMediaFormat.Lottie,m),C=Boolean(y),[N,T]=Object(a.r)(String(Math.random())),w=Object(a.m)(()=>{T(String(Math.random()))},[]),I=u[t],M=`width: ${I}px; height: ${I}px;`;return a.a.createElement("div",{ref:h,className:"AnimatedEmoji media-inner",style:M,onClick:w},!f&&v&&a.a.createElement("img",{src:v,className:e.id===c.b?"like-sticker-thumb":void 0,alt:""}),!f&&j&&a.a.createElement("img",{src:j,className:E,alt:""}),C&&a.a.createElement(d.a,{key:O,id:O,animationData:y,size:I,quality:1,play:g&&N,noLoop:!0,onLoad:p}))}},function(e,t,n){"use strict";var a=n(0),r=n(1),c=n(13),i=n(4),s=n(7),o=n(23),l=n(3),d=n(17),u=n(114),m=n(138),b=n(162);t.a=Object(a.h)(Object(r.h)((e,{chatId:t})=>{const{lastSyncTime:n}=e,a=Object(s.g)(e,t);return{lastSyncTime:n,chat:a,onlineCount:a?Object(s.o)(e,a):void 0,areMessagesLoaded:Boolean(Object(s.n)(e,t))}},(e,t)=>Object(l.l)(t,["loadFullChat","openMediaViewer"]))(({typingStatus:e,avatarSize:t="medium",withMediaViewer:n,withUsername:r,withFullInfo:s,withUpdatingStatus:l,withChatType:h,noRtl:f,chat:p,onlineCount:O,areMessagesLoaded:g,lastSyncTime:v,loadFullChat:j,openMediaViewer:E})=>{const y=p&&Object(i.qb)(p),{id:C,isMin:N,isRestricted:T}=p||{};Object(a.n)(()=>{C&&!N&&s&&v&&j({chatId:C})},[C,N,v,s,j,y]);const w=Object(a.m)((e,n)=>{p&&n&&(e.stopPropagation(),E({avatarOwnerId:p.id,origin:"jumbo"===t?c.h.ProfileAvatar:c.h.MiddleHeaderAvatar}))},[p,t,E]),I=Object(d.a)();if(p)return a.a.createElement("div",{className:"ChatInfo",dir:!f&&I.isRtl?"rtl":void 0},a.a.createElement(u.a,{key:p.id,size:t,chat:p,onClick:n?w:void 0}),a.a.createElement("div",{className:"info"},a.a.createElement("div",{className:"title"},a.a.createElement("h3",{dir:"auto"},Object(o.a)(Object(i.k)(I,p))),p.isVerified&&a.a.createElement(m.a,null)),function(){if(l&&!g&&!T)return a.a.createElement("span",{className:"status",dir:"auto"},I("Updating"));if(!p)return;if(e)return a.a.createElement(b.a,{typingStatus:e});if(h)return a.a.createElement("div",{className:"status",dir:"auto"},I(Object(i.l)(p)));const t=r?p.username:void 0,n=function(e,t){const n=e(Object(i.l)(t)),{membersCount:a}=t;if(t.isRestricted)return"Channel"===n?"channel is inaccessible":"group is inaccessible";if(!a)return n;return e("Channel"===n?"Subscribers":"Members",a,"i")}(I,p),c=O?", "+I("OnlineCount",O,"i"):void 0;return a.a.createElement("div",{className:"status"},t&&a.a.createElement("span",{className:"handle"},t),a.a.createElement("span",{className:"group-status"},n),c&&a.a.createElement("span",{className:"online-status"},c))}()))}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return l})),n.d(t,"b",(function(){return d}));var a=n(1),r=n(13),c=n(2),i=n(38),s=n(62);let o=!1;function l(e,t,n,i=0,s=c.B,o,l,d){const m=function(e,t,n=c.B,a){const{offsetTop:i}=t,{scrollTop:s}=e;if(void 0===a){const t=i-e.scrollTop;if(t<-n)return s+(t+n);if(t>n)return s+(t-n)}else{if(a===r.b.Up)return i+n;if(a===r.b.Down)return Math.max(0,i-n)}return s}(e,t,s,o);o!==r.b.Static?(Object(a.e)().settings.byKey.animationLevel===c.f&&(l=0),u(e,t,m,n,i,l,d)):u(e,t,m,n,i,0)}function d(){return o}function u(e,t,n,a,r=0,l,d){const{offsetTop:u,offsetHeight:h}=t,{scrollTop:f,offsetHeight:p,scrollHeight:O}=e,g=!d&&e.dataset.normalHeight?Number(e.dataset.normalHeight):p;let v;switch(f!==n&&(e.scrollTop=n),a){case"start":v=u-r-n;break;case"end":v=u+h+r-(n+g);break;case"nearest":case"center":case"centerOrTop":v=h0){const e=O-(n+g);v=Math.min(v,e)}if(0===v)return;const j=n+v;if(0===l)return void(e.scrollTop=j);o=!0;const E=Math.abs(v),y=E{const t=Math.min((Date.now()-N)/C,1),n=v*(1-y(t));return e.scrollTop=Math.round(j-n),o=t<1,o||T(),o})}function m(e){return 1-(1-e)**5}function b(e){return 1-(1-e)**3.5}},,function(e,t,n){"use strict";var a=n(0),r=n(13),c=n(3),i=n(32),s=n(30);function o(e,t=0,n,a){const{length:c}=e,i=e.indexOf(t),s=n===r.e.Forwards?i:i+1||c,o=Math.max(0,s-a),l=s+a-1,d=e.slice(Math.max(0,o),l+1);let u,m;switch(n){case r.e.Forwards:u=s>0,m=o>=0;break;case r.e.Backwards:u=s{const u=Object(a.q)(),m=Object(a.q)((()=>{if(!t||u.current)return;const{newViewportIds:e}=o(t,t[0],r.e.Forwards,l);return e})()),b=Object(i.a)(),h=Object(s.a)(t),f=Object(s.a)(n);if(t&&!n&&(t!==h||n!==f)){const{offsetId:e=t[0],direction:n=r.e.Forwards}=u.current||{},{newViewportIds:a}=o(t,e,n,l);m.current&&Object(c.a)(m.current,a)||(m.current=a)}Object(a.n)(()=>{if(t&&!n&&e&&d){const t=m.current;e({offsetId:t[t.length-1]})}},[t,n,e,d]);const p=Object(a.m)(({direction:n,noScroll:a})=>{const i=m.current,s=i?n===r.e.Backwards?i[i.length-1]:i[0]:void 0;if(!t)return void(e&&e({offsetId:s}));a||(u.current={...u.current,direction:n,offsetId:s});const{newViewportIds:d,areSomeLocal:h,areAllLocal:f}=o(t,s,n,l);!h||i&&Object(c.a)(i,d)||(m.current=d,b()),!f&&e&&e({offsetId:s})},[t,l,e,b]);return n?[t]:[m.current,p]}},function(e,t,n){"use strict";function a(e,t){return t-Math.floor(t/e)*e}n.d(t,"a",(function(){return a}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var a=n(6);function r(e,t){if(!t&&e===document.activeElement)return;const n=window.getSelection(),r=document.createRange(),c=e.lastChild||e;a.n||c&&c.nodeValue?(r.selectNodeContents(c),r.collapse(!1),n.removeAllRanges(),n.addRange(r)):e.focus()}},,function(e,t,n){"use strict";let a;n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return r})),function(e){e[e.Up=0]="Up",e[e.Down=1]="Down",e[e.Left=2]="Left",e[e.Right=3]="Right"}(a||(a={}));function r(e,t){let n,r,c=!1;function i(e){t.excludedClosestSelector&&(e.target.matches(t.excludedClosestSelector)||e.target.closest(t.excludedClosestSelector))||(n=e,"mousedown"===e.type?(document.addEventListener("mousemove",o),document.addEventListener("mouseup",s)):"touchstart"===e.type&&(document.addEventListener("touchmove",o),document.addEventListener("touchend",s),document.addEventListener("touchcancel",s),"touches"in e&&(void 0===e.pageX&&(e.pageX=e.touches[0].pageX),void 0===e.pageY&&(e.pageY=e.touches[0].pageY))),document.body.classList.add("no-selection"),t.withCursor&&document.body.classList.add("cursor-grabbing"),t.onCapture&&t.onCapture(e))}function s(e){n&&(t.withCursor&&document.body.classList.remove("cursor-grabbing"),document.body.classList.remove("no-selection"),document.removeEventListener("mouseup",s),document.removeEventListener("mousemove",o),document.removeEventListener("touchcancel",s),document.removeEventListener("touchend",s),document.removeEventListener("touchmove",o),n=void 0,c?t.onRelease&&t.onRelease(e):!t.onClick||"button"in e&&0!==e.button||t.onClick(e)),c=!1,r=void 0}function o(e){if(n){"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));const i=e.pageX-n.pageX,s=e.pageY-n.pageY;(Math.abs(i)>=15||Math.abs(s)>=15)&&(c=!0),t.onDrag&&(e.preventDefault(),t.onDrag(e,n,{dragOffsetX:i,dragOffsetY:s})),t.onSwipe&&function(e,n,c){if(!r){const e=Math.abs(n),t=Math.abs(c);if(n&&c){if(Math.max(e,t)/Math.min(e,t)<2)return}e>=50?r="x":t>=50&&(r="y")}!function(e,t,n,r,c){"x"===t?c(e,n<0?a.Left:a.Right):"y"===t&&c(e,r<0?a.Up:a.Down)}(e,r,n,c,t.onSwipe)}(e,i,s)}}return e.addEventListener("mousedown",i),e.addEventListener("touchstart",i,{passive:!0}),()=>{e.removeEventListener("mousedown",i),e.removeEventListener("touchstart",i)}}},function(e,t,n){"use strict";var a=n(0);n(212);t.a=()=>a.a.createElement("span",{className:"VerifiedIcon"})},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var a=n(30);function r(e,t=!1,n=!1){const r=Object(a.a)(e,t);return n||null!=e?e:r}},function(e,t,n){"use strict";var a=n(2);t.a=e=>{e.play().catch(e=>{a.r&&console.warn(e)})}},function(e,t,n){"use strict";var a=n(0),r=n(10),c=n(165);t.a=(e=!1)=>{const[t,n]=Object(a.r)(!e),[i,s]=Object(a.r)(0),o=Object(a.p)(()=>Object(r.a)(n,200,!1,!0),[]),l=Object(a.m)(e=>{const t=e.currentTarget;Object(c.a)(t)||(t.buffered.length&&s(t.buffered.end(0)/t.duration),o(t.readyState>=3||t.currentTime>0))},[o]);return{isBuffered:t,bufferedProgress:i,bufferingHandlers:{onLoadedData:l,onPlaying:l,onLoadStart:l,onPause:l,onTimeUpdate:l,onProgress:l},checkBuffering(e){o(e.readyState>=3)}}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var a=n(8),r=n(6);const c={B:a.ApiMessageEntityTypes.Bold,STRONG:a.ApiMessageEntityTypes.Bold,I:a.ApiMessageEntityTypes.Italic,EM:a.ApiMessageEntityTypes.Italic,U:a.ApiMessageEntityTypes.Underline,S:a.ApiMessageEntityTypes.Strike,STRIKE:a.ApiMessageEntityTypes.Strike,DEL:a.ApiMessageEntityTypes.Strike,CODE:a.ApiMessageEntityTypes.Code,PRE:a.ApiMessageEntityTypes.Pre,BLOCKQUOTE:a.ApiMessageEntityTypes.Blockquote};function i(e){const t=document.createElement("div");t.innerHTML=function(e){let t=e.slice(0);r.d||(t=t.replace(/]+alt="([^"]+)"[^>]*>/gm,"$1"));return t=t.replace(/<\/?span([^>]*)?>/g,""),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(/[*]{2}([^*\n]+)[*]{2}/g,"$1"),t=t.replace(/[_]{2}([^*\n]+)[_]{2}/g,"$1"),t=t.replace(/[~]{2}([^~\n]+)[~]{2}/g,"$1"),t}(e);const n=t.innerText.trim().replace(/\u200b+/g,"").slice(0,4096);let i=0,s=0;const o=[];function l(e){const{index:t,entity:r}=function(e,t,n){const r=function(e){if(c[e.nodeName])return c[e.nodeName];if("A"===e.nodeName){const t=e;return t.dataset.entityType===a.ApiMessageEntityTypes.MentionName?a.ApiMessageEntityTypes.MentionName:t.dataset.entityType===a.ApiMessageEntityTypes.Url?a.ApiMessageEntityTypes.Url:t.href.startsWith("mailto:")?a.ApiMessageEntityTypes.Email:t.href.startsWith("tel:")?a.ApiMessageEntityTypes.Phone:t.href!==t.textContent?a.ApiMessageEntityTypes.TextUrl:a.ApiMessageEntityTypes.Url}if("SPAN"===e.nodeName)return e.dataset.entityType;return}(e);if(!r||!e.textContent)return{index:n,entity:void 0};const i=t.indexOf(e.textContent,n),s=i>=0?i:n,o=t.substring(0,s).length,{length:l}=t.substring(s,s+e.textContent.length);let d,u;r===a.ApiMessageEntityTypes.TextUrl&&(d=e.href);r===a.ApiMessageEntityTypes.MentionName&&(u=Number(e.dataset.userId));return{index:s,entity:{type:r,offset:o,length:l,...d&&{url:d},...u&&{userId:u}}}}(e,n,i);r?(i=t,o.push(r)):e.textContent&&(i+=e.textContent.length),e.hasChildNodes()&&s<=3&&(s+=1,Array.from(e.childNodes).forEach(l))}return Array.from(t.childNodes).forEach(e=>{s=1,l(e)}),{text:n,entities:o.length?o:void 0}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return d}));var a=n(0),r=n(41),c=n(9),i=n(50),s=n(30),o=n(25);n(225);var l=Object(a.h)(({isQuick:e,onFileSelect:t})=>{const[n,r,i]=Object(o.a)(),s=Object(c.a)("DropTarget",n&&"hovered");return a.a.createElement("div",{className:s,onDrop:t,onDragEnter:()=>{r()},onDragLeave:e=>{const{relatedTarget:t}=e;t&&e.stopPropagation(),i()}},a.a.createElement("div",{className:"target-content"},a.a.createElement("div",{className:"icon icon-"+(e?"photo":"document")}),a.a.createElement("div",{className:"title"},"Drop files here to send them"),a.a.createElement("div",{className:"description"},e?"in a quick way":"without compression")))});n(226);let d;!function(e){e.None="none",e.Document="document",e.QuickFile="quick_file"}(d||(d={}));t.b=Object(a.h)(({isOpen:e,withQuick:t,onHide:n,onFileSelect:o})=>{const d=Object(a.q)(null),u=Object(s.a)(t),{shouldRender:m,transitionClassNames:b}=Object(r.a)(e);Object(a.n)(()=>e?Object(i.a)(n):void 0,[e,n]);const h=Object(a.m)(e=>{const{dataTransfer:t}=e;t.files&&t.files.length>0&&(n(),o(Array.from(t.files),!1))},[o,n]),f=Object(a.m)(e=>{const{dataTransfer:t}=e;t.files&&t.files.length>0&&(n(),o(Array.from(t.files),!0))},[o,n]),p=Object(a.m)(e=>{e.stopPropagation();const{target:t,relatedTarget:a}=e;t.matches(".DropTarget, .DropArea")&&!a&&(d.current=window.setTimeout(()=>{n()},150))},[n]);if(!m)return;const O=Object(c.a)("DropArea",b);return a.a.createElement("div",{className:O,onDragLeave:p,onDragOver:()=>{d.current&&window.clearTimeout(d.current)},onDrop:n},a.a.createElement(l,{onFileSelect:h}),(t||u)&&a.a.createElement(l,{onFileSelect:f,isQuick:!0}))})},,function(e,t,n){"use strict";n.d(t,"b",(function(){return c})),n.d(t,"a",(function(){return i})),n.d(t,"d",(function(){return l}));var a=n(159),r=n(3);const c=[{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"}],i=[{icon:"mute",title:"FilterMuted",key:"excludeMuted"},{icon:"archive",title:"FilterArchived",key:"excludeArchived"},{icon:"readchats",title:"FilterRead",key:"excludeRead"}],s=["includedChatIds","bots","channels","groups","contacts","nonContacts"],o=["excludedChatIds","excludeArchived","excludeMuted","excludeRead"];function l(e,t,n){let a=[],c=[];if("included"===t){const{includedChatIds:t,...i}=n?e.includeFilters||{}:Object(r.l)(e.folder,s);a=t||[],c=Object.keys(i).filter(e=>Boolean(i[e]))}else{const{excludedChatIds:t,...i}=n?e.excludeFilters||{}:Object(r.l)(e.folder,o);a=t||[],c=Object.keys(i).filter(e=>Boolean(i[e]))}return{selectedChatIds:a,selectedChatTypes:c}}function d(e){if(e){const{includedChatIds:t,...n}=e;if(Object.values(n).filter(Boolean).length>1||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:Object(r.l)(e.folder,s)};case"editExcludeFilters":return{...e,excludeFilters:Object(r.l)(e.folder,o)};case"setIncludeFilters":return{...e,includeFilters:t.payload,chatFilter:""};case"setExcludeFilters":return{...e,excludeFilters:t.payload,chatFilter:""};case"saveFilters":return e.includeFilters?{...e,folder:{...Object(r.j)(e.folder,s),title:e.folder.title?e.folder.title:d(e.includeFilters),...e.includeFilters},includeFilters:void 0,chatFilter:"",isTouched:!0}:e.excludeFilters?{...e,folder:{...Object(r.j)(e.folder,o),...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}};t.c=()=>Object(a.a)(m,u)},function(e,t,n){"use strict";var a=n(0),r=n(1),c=n(7),i=n(4),s=n(23),o=n(9),l=n(17),d=n(114);n(206);t.a=Object(a.h)(Object(r.h)((e,{chatOrUserId:t})=>{if(!t)return{};return{chat:t?Object(c.g)(e,t):void 0,user:Object(i.ob)(t)?Object(c.Jb)(e,t):void 0}})(({icon:e,title:t,isMinimized:n,canClose:r,onClick:c,clickArg:u,chat:m,user:b,className:h})=>{const f=Object(l.a)();let p,O;if(e&&t)p=a.a.createElement("div",{className:"item-icon"},a.a.createElement("i",{className:"icon-"+e})),O=t;else if(m||b){p=a.a.createElement(d.a,{chat:m,user:b,size:"small",isSavedMessages:b&&b.isSelf});const e=!m||b&&!b.isSelf?Object(i.ab)(b):Object(i.k)(f,m,b);O=e?Object(s.a)(e):void 0}const g=Object(o.a)("PickerSelectedItem",h,n&&"minimized",r&&"closeable");return a.a.createElement("div",{className:g,onClick:()=>c(u),title:n?O:void 0,dir:f.isRtl?"rtl":void 0},p,!n&&a.a.createElement("div",{className:"item-name",dir:"auto"},O),r&&a.a.createElement("div",{className:"item-remove"},a.a.createElement("i",{className:"icon-close"})))}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var a=n(1),r=n(2),c=n(6),i=n(62);function s(e,t,n=300){Object(a.e)().settings.byKey.animationLevel===r.f&&(n=0),c.e?function(e,t,n){const{scrollLeft:a,offsetWidth:r,scrollWidth:c}=e;let s=t-a;if(s<0){const e=-a;s=Math.max(s,e)}else if(s>0){const e=c-(a+r);s=Math.min(s,e)}if(0===s)return;const o=a+s;if(0===n)return void(e.scrollLeft=o);const l=Date.now();Object(i.a)(()=>{const t=Math.min((Date.now()-l)/n,1),a=s*(1-function(e){return 1-(1-e)**3.5}(t));return e.scrollLeft=Math.round(o-a),t<1})}(e,t,n):e.scrollTo({left:t,...n&&{behavior:"smooth"}})}},function(e,t,n){"use strict";var a=n(0);t.a=(e,t)=>{Object(a.n)(()=>{if(e)return e.addEventListener("wheel",t,{passive:!0}),()=>{e.removeEventListener("wheel",t)};function t(t){t.deltaX||(e.scrollLeft+=t.deltaY/4)}},[e,t])}},function(e,t,n){"use strict";var a=n(0),r=n(1),c=n(10);t.a=(e,t,n,i)=>{const{loadMessage:s}=Object(r.d)(),o=Object(a.p)(()=>{const n=Object(c.h)(s,500,!0);return()=>{n({chatId:e,messageId:t,replyOriginForId:i})}},[s,e,t,i]);Object(a.n)(()=>{t&&!n&&o()})}},function(e,t,n){"use strict";var a=n(0),r=n(6);let c=0;t.a=(e,t,n,i)=>{const[s,o]=Object(a.r)(!1),[l,d]=Object(a.r)(void 0),u=Object(a.m)(e=>{t||2!==e.button||document.body.classList.add("no-selection")},[t]),m=Object(a.m)(e=>{document.body.classList.remove("no-selection"),t||n&&e.target.matches("a.text-entity-link[href]")||(e.preventDefault(),l||(document.body.classList.remove("no-selection"),0===c&&document.body.classList.add("has-context-menu"),c++,o(!0),d({x:e.clientX,y:e.clientY})))},[t,n,l]),b=Object(a.m)(()=>{o(!1)},[]),h=Object(a.m)(()=>{d(void 0),document.body.classList.remove("no-selection"),setTimeout(()=>{c--,0===c&&document.body.classList.remove("has-context-menu")},200)},[]);return Object(a.n)(()=>{if(t||!r.n||i)return;const a=e.current;if(!a)return;let c;const s=()=>{c&&(clearTimeout(c),c=void 0)},u=e=>{t||r.l&&window.document.body.classList.contains("enable-symbol-menu-transforms")||(s(),c=window.setTimeout(()=>(e=>{s();const{clientX:t,clientY:r,target:c}=e.touches[0];l||n&&c.matches("a.text-entity-link[href]")||(a.addEventListener("touchend",(function e(t){a.removeEventListener("touchend",e,!0),t.stopImmediatePropagation(),t.preventDefault(),t.stopPropagation()}),!0),document.body.classList.add("no-selection"),o(!0),d({x:t,y:r}))})(e),250))};return a.addEventListener("touchstart",u,{passive:!0}),a.addEventListener("touchcancel",s,!0),a.addEventListener("touchend",s,!0),a.addEventListener("touchmove",s,{passive:!0}),()=>{s(),a.removeEventListener("touchstart",u),a.removeEventListener("touchcancel",s,!0),a.removeEventListener("touchend",s,!0),a.removeEventListener("touchmove",s)}},[l,t,i,e,n]),{isContextMenuOpen:s,contextMenuPosition:l,handleBeforeContextMenu:u,handleContextMenu:m,handleContextMenuClose:b,handleContextMenuHide:h}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return d})),n.d(t,"b",(function(){return m}));var a=n(0),r=n(1),c=n(8),i=n(4),s=n(23),o=n(78),l=n(59);function d(e,t,n){const a=e.content.text;if(!a||!a.text){const t=Object(i.P)(e);return t?[t]:void 0}const{text:r,entities:c}=a;return m(r,c,t,n)}function u(e){const t=new Set,n=[];return e.forEach((a,r)=>{if(t.has(r))return;const c=function e(t,n,a,r){const{offset:c,length:i}=t,s=new Set([n]);if(r.has(n))return;const o=[];return a.filter((e,t)=>t>n&&e.offset>=c&&e.offsete(t,a.indexOf(t),a,r)).filter(Boolean).forEach(e=>{let t=!1;e.organizedIndexes.forEach(e=>{t||s.has(e)||(t=!0),s.add(e)}),t&&o.push(e)}),{entity:t,organizedIndexes:s,nestedEntities:o}}(a,r,e,t);c&&(c.organizedIndexes.forEach(e=>{t.add(e)}),n.push(c))}),n}function m(e,t,n,r,i){if(!t||!t.length)return b(e,n,r,i);const d=[];let m=!1;const O=u(t);function g(t,d,u,O){const v=[],{entity:j,nestedEntities:E}=u,{offset:y,length:C,type:N}=j;let T=e.substring(t,y);const w=T.length;T&&(m&&T.length>0&&"\n"===T[0]&&(T=T.substr(1),m=!1),T&&v.push(...b(T,n,r,i)));const I=t+w,M=I+C;let k=e.substring(y,y+C);const S=[];if(m&&k.length>0&&"\n"===k[0]&&(k=k.substr(1),m=!1),N===c.ApiMessageEntityTypes.Pre&&(m=!0),E.length){let e=I;E.forEach((t,n)=>{const{renderResult:a,entityEndIndex:r}=g(e,M,t,n===E.length-1);S.push(...a),e=r})}const L=i?function(e,t,n){const a="string"==typeof t&&t,r=n.length?n.join(""):Object(s.a)(t,["escape_html","emoji_html","br_html"]).join("");if(!a)return r;switch(e.type){case c.ApiMessageEntityTypes.Bold:return`${r}`;case c.ApiMessageEntityTypes.Italic:return`${r}`;case c.ApiMessageEntityTypes.Underline:return`${r}`;case c.ApiMessageEntityTypes.Code:return`${r}`;case c.ApiMessageEntityTypes.Pre:return`\`\`\`
${r}
\`\`\``;case c.ApiMessageEntityTypes.Strike:return`${r}`;case c.ApiMessageEntityTypes.MentionName:return`${r}`;case c.ApiMessageEntityTypes.Url:case c.ApiMessageEntityTypes.TextUrl:return`${r}`;default:return r}}(j,k,S):function(e,t,n){const r="string"==typeof t&&t,i=n.length?n:t;if(!r)return b(i);switch(e.type){case c.ApiMessageEntityTypes.Bold:return a.a.createElement("strong",null,b(i));case c.ApiMessageEntityTypes.Blockquote:return a.a.createElement("blockquote",null,b(i));case c.ApiMessageEntityTypes.BotCommand:return a.a.createElement("a",{onClick:f,className:"text-entity-link",dir:"auto"},b(i));case c.ApiMessageEntityTypes.Hashtag:case c.ApiMessageEntityTypes.Cashtag:return a.a.createElement("a",{onClick:p,className:"text-entity-link",dir:"auto"},b(i));case c.ApiMessageEntityTypes.Code:return a.a.createElement("code",{className:"text-entity-code"},b(i));case c.ApiMessageEntityTypes.Email:return a.a.createElement("a",{href:"mailto:"+r,target:"_blank",rel:"noopener noreferrer",className:"text-entity-link",dir:"auto"},b(i));case c.ApiMessageEntityTypes.Italic:return a.a.createElement("em",null,b(i));case c.ApiMessageEntityTypes.MentionName:return a.a.createElement(o.a,{userId:e.userId},b(i));case c.ApiMessageEntityTypes.Mention:return a.a.createElement(o.a,{username:r},b(i));case c.ApiMessageEntityTypes.Phone:return a.a.createElement("a",{href:"tel:"+r,className:"text-entity-link",dir:"auto"},b(i));case c.ApiMessageEntityTypes.Pre:return a.a.createElement("pre",{className:"text-entity-pre"},b(i));case c.ApiMessageEntityTypes.Strike:return a.a.createElement("del",null,b(i));case c.ApiMessageEntityTypes.TextUrl:case c.ApiMessageEntityTypes.Url:return a.a.createElement(l.a,{url:h(r,e),text:r},b(i));case c.ApiMessageEntityTypes.Underline:return a.a.createElement("ins",null,b(i));default:return b(i)}}(j,k,S);if(Array.isArray(L)?v.push(...L):v.push(L),O&&M0&&"\n"===t[0]&&(t=t.substring(1)),t&&v.push(...b(t,n,r,i))}return{renderResult:v,entityEndIndex:M}}let v=0;return O.forEach((t,n)=>{const{renderResult:a,entityEndIndex:r}=g(v,e.length,t,n===O.length-1);d.push(...a),v=r}),d}function b(e,t,n,a){if(Array.isArray(e)){const r=[];return e.forEach(e=>{r.push(...b(e,t,n,a))}),r}if(a)return Object(s.a)(e,["escape_html","emoji_html","br_html"]);const r=n?"hq_emoji":"emoji";return t?Object(s.a)(e,[r,"br","highlight"],{highlight:t}):Object(s.a)(e,[r,"br"])}function h(e,t){const{type:n,url:a}=t;return n===c.ApiMessageEntityTypes.TextUrl&&a?a:e}function f(e){Object(r.d)().sendBotCommand({command:e.currentTarget.innerText})}function p(e){Object(r.d)().setLocalTextSearchQuery({query:e.currentTarget.innerText}),Object(r.d)().searchTextMessagesLocal()}},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var a=n(0),r=n(10);function c(e,t){Object(a.n)(()=>{const t=e.current;return()=>{t&&Object(r.b)(()=>{t.pause(),t.src="",t.load()})}},t)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var a=n(0),r=n(6);let c;function i(e,t,n=250,i=!1){const s=Object(a.q)(!1);Object(a.n)(()=>{c&&(clearTimeout(c),c=void 0),!e||r.n||i||(c=window.setTimeout(()=>{s.current||t()},2*n))},[i,e,n,t]);return[Object(a.m)(()=>{s.current=!0},[]),Object(a.m)(()=>{s.current=!1,c&&(clearTimeout(c),c=void 0),c=window.setTimeout(()=>{s.current||t()},n)},[n,t])]}},,,function(e,t,n){},,,function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var a=n(0);function r(e,t){const n=Object(a.q)(e),[r,c]=Object(a.r)(t);return[r,Object(a.m)(e=>{c(t=>n.current(t,e))},[])]}},function(e,t,n){"use strict";var a=n(0),r=n(9),c=n(25),i=n(17),s=n(20),o=n(22);n(204);t.a=Object(a.h)(({ref:e,children:t,parentContainerClassName:n,value:l,inputId:d,className:u,focused:m,isLoading:b,placeholder:h,disabled:f,autoComplete:p,canClose:O,onChange:g,onReset:v,onFocus:j,onBlur:E})=>{let y=Object(a.q)(null);e&&(y=e);const[C,N,T]=Object(c.a)(m);Object(a.n)(()=>{y.current&&(m?y.current.focus():y.current.blur())},[m,h]);const w=Object(i.a)();const I=Object(a.m)(e=>{if("ArrowDown"===e.key||"Enter"===e.key){const e=document.querySelector(`.${n} .ListItem-button`);e&&e.focus()}},[n]);return a.a.createElement("div",{className:Object(r.a)("SearchInput",u,C&&"has-focus"),dir:w.isRtl?"rtl":void 0},t,a.a.createElement("input",{ref:y,id:d,type:"text",dir:"auto",placeholder:h||w("Search"),className:"form-control",value:l,disabled:f,autoComplete:p,onChange:function(e){const{currentTarget:t}=e;g(t.value)},onFocus:function(){N(),j&&j()},onBlur:function(){T(),E&&E()},onKeyDown:I}),a.a.createElement("i",{className:"icon-search"}),b&&a.a.createElement(s.a,null),!b&&(l||O)&&v&&a.a.createElement(o.a,{round:!0,size:"tiny",color:"translucent",onClick:v},a.a.createElement("span",{className:"icon-close"})))})},function(e,t,n){"use strict";var a=n(6);t.a=(e,t)=>{a.e&&(e.style.overflow="hidden"),void 0!==t&&(e.scrollTop=t),a.e&&(e.style.overflow="")}},function(e,t,n){"use strict";var a=n(0),r=n(1),c=n(7),i=n(4),s=n(23),o=n(17);n(213);t.a=Object(a.h)(Object(r.h)((e,{typingStatus:t})=>{if(!t.userId)return{};return{typingUser:Object(c.Jb)(e,t.userId)}})(({typingStatus:e,typingUser:t})=>{const n=Object(o.a)(),r=t&&!t.isSelf&&Object(i.ab)(t);return a.a.createElement("p",{className:"typing-status",dir:n.isRtl?"rtl":"auto"},r&&a.a.createElement("span",{className:"sender-name",dir:"auto"},Object(s.a)(r)),n(e.action).replace("{user}","").trim(),a.a.createElement("span",{className:"ellipsis"}))}))},function(e,t,n){"use strict";var a=n(0),r=n(1),c=n(7),i=n(4),s=n(3),o=n(17),l=n(23),d=n(114),u=n(112),m=n(22);n(216);t.a=Object(a.h)(Object(r.h)((e,{chat:t})=>{const n=Object(i.ob)(t.id),a=Object(c.P)(e,t.id),r=n&&Object(c.Jb)(e,Object(i.W)(t)),s=r&&Object(i.Bb)(r)&&!t.isSupport,o=n&&!a&&!s,l=n?Object(i.ab)(Object(c.Jb)(e,Object(i.W)(t))):void 0;return{isPrivateChat:n,isChatWithSelf:a,isBot:s,isChannel:Object(i.mb)(t),isBasicGroup:Object(i.lb)(t),isSuperGroup:Object(i.qb)(t),currentUserId:e.currentUserId,canDeleteForAll:o,contactName:l}},(e,t)=>Object(s.l)(t,["leaveChannel","deleteHistory","deleteChannel","deleteChatUser","blockContact"]))(({isOpen:e,chat:t,isChannel:n,isPrivateChat:r,isChatWithSelf:c,isBot:s,isBasicGroup:b,isSuperGroup:h,currentUserId:f,canDeleteForAll:p,contactName:O,onClose:g,onCloseAnimationEnd:v,leaveChannel:j,deleteHistory:E,deleteChannel:y,deleteChatUser:C,blockContact:N})=>{const T=Object(o.a)(),w=Object(i.k)(T,t),I=Object(a.m)(()=>{E({chatId:t.id,shouldDeleteForAll:!0}),g()},[E,t.id,g]),M=Object(a.m)(()=>{E({chatId:t.id,shouldDeleteForAll:!0}),N({contactId:t.id,accessHash:t.accessHash}),g()},[E,t.id,t.accessHash,N,g]),k=Object(a.m)(()=>{r?E({chatId:t.id,shouldDeleteForAll:!1}):b?(C({chatId:t.id,userId:f}),E({chatId:t.id,shouldDeleteForAll:!1})):!n&&!h||t.isCreator?(n||h)&&t.isCreator&&y({chatId:t.id}):j({chatId:t.id}),g()},[r,b,n,h,f,t.isCreator,t.id,g,E,C,j,y]);return a.a.createElement(u.a,{isOpen:e,className:"DeleteChatModal",header:a.a.createElement("div",{className:"modal-header",dir:T.isRtl?"rtl":void 0},a.a.createElement(d.a,{size:"tiny",chat:t,isSavedMessages:c}),a.a.createElement("h3",{className:"modal-title"},T(n&&!t.isCreator?"LeaveChannel":n&&t.isCreator?"ChannelDelete":b||h?"Group.LeaveGroup":"DeleteChatUser"))),onClose:g,onCloseAnimationEnd:v},n&&t.isCreator?a.a.createElement("p",null,Object(l.a)(T("ChatList.DeleteAndLeaveGroupConfirmation",w),["simple_markdown"])):n&&!t.isCreator||b||h?a.a.createElement("p",null,Object(l.a)(T("ChannelLeaveAlertWithName",w),["simple_markdown"])):a.a.createElement("p",null,Object(l.a)(T("ChatList.DeleteChatConfirmation",O),["simple_markdown"])),s&&a.a.createElement(m.a,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:M},T("DeleteAndStop")),p&&a.a.createElement(m.a,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:I},O?Object(l.a)(T("ChatList.DeleteForEveryone",O)):T("DeleteForAll")),a.a.createElement(m.a,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:k},T(n&&!t.isCreator?"LeaveChannel":n&&t.isCreator?"Chat.Input.Delete":b||h?"Group.LeaveGroup":p?"ChatList.DeleteForCurrentUser":"Delete")),a.a.createElement(m.a,{className:"confirm-dialog-button",isText:!0,onClick:g},T("Cancel")))}))},function(e,t,n){"use strict";var a=n(0),r=n(41),c=n(30),i=n(9);t.a=({isOpen:e,isCustom:t,id:n,className:s,onClick:o,children:l})=>{const{shouldRender:d,transitionClassNames:u}=Object(r.a)(e,void 0,void 0,!t&&void 0),m=Object(c.a)(e),b=Object(c.a)(l),h=Object(a.q)();return m&&!e&&(h.current=b),d&&a.a.createElement("div",{id:n,className:Object(i.a)(s,u),onClick:o},e?l():h.current())}},function(e,t,n){"use strict";function a(e){e.dataset.patchedForSafari||(e.addEventListener("play",()=>{const t=e.currentTime;e.addEventListener("progress",(function n(){e.buffered.length&&(e.dataset.patchForSafariInProgress="true",e.currentTime=e.duration-1,e.addEventListener("progress",()=>{delete e.dataset.patchForSafariInProgress,e.currentTime=t,e.paused&&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",(function(){return a})),n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";var a=n(0),r=n(30);t.a=(e,t,n)=>{const c=Object(r.a)(t);return Object(a.o)(()=>e(c||[]),t,n)}},function(e,t,n){"use strict";var a=n(0),r=n(60),c=n(4),i=n(109),s=n(123),o=n(110),l=n(187),d=n(188);t.a=Object(a.h)(({message:e,observeIntersection:t,smaller:n,uploadProgress:u,withDate:m,datetime:b,className:h,sender:f,isSelected:p,isSelectable:O,onCancelUpload:g,onMediaClick:v,onDateClick:j})=>{const E=Object(a.q)(null),y=e.content.document,C=Object(r.b)(y)||"",{fileName:N,size:T,timestamp:w}=y,I=v&&Boolean(y.mediaType),M=Object(i.b)(E,t),[k,S]=Object(a.r)(!1),{mediaData:L,downloadProgress:A}=Object(s.a)(Object(c.E)(e,"download"),!k),{isUploading:x,isTransferring:D,transferProgress:R}=Object(c.r)(e,u||A,k),F=Object(r.c)(y),_=F?Object(c.F)(e):void 0,P=F?y.previewBlobUrl:void 0,U=Object(o.a)(Object(c.E)(e,"pictogram"),!M),B=Object(a.m)(()=>{I?v():x?g&&g():S(e=>!e)},[I,x,g,v]),q=Object(a.m)(()=>{j(e.id,e.chatId)},[j,e.id,e.chatId]);return Object(a.n)(()=>{k&&L&&(Object(l.a)(L,N),S(!1))},[N,L,k]),a.a.createElement(d.a,{ref:E,name:N,extension:C,size:T,timestamp:m?b||w:void 0,thumbnailDataUri:_,previewData:P||U,smaller:n,isTransferring:D,isUploading:x,transferProgress:R,className:h,sender:f,isSelectable:O,isSelected:p,actionIcon:I?Object(c.wb)(e)?"icon-play":"icon-eye":"icon-download",onClick:B,onDateClick:j?q:void 0})})},function(e,t,n){"use strict";var a=n(0),r=n(15),c=n(26);t.a=Object(a.h)(e=>{const{isOpen:t}=e,n=Object(c.a)(r.a.Extra,"StickerSetModal",!t);return n?a.a.createElement(n,e):void 0})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var a=n(0),r=n(170),c=n(32),i=n(6);function s(e,t=!1,n){const s=Object(a.q)(null),o=Object(c.a)();return Object(a.n)(()=>{const a=s.current;if(!e||!a||t)return;const c=new Image,o=()=>{a.width=c.width,a.height=c.height;const e=a.getContext("2d",{alpha:!1});i.c&&(e.filter="blur(2px)"),e.drawImage(c,-4,-4,a.width+8,a.height+8),i.c||Object(r.a)(e,0,0,a.width,a.height,2,2)};c.onload=()=>{n?requestAnimationFrame(o):o()},c.src=e},[s,e,o,t,n]),s}},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));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 c(e,t,n,c,i,s,o){if(Number.isNaN(s)||s<1)return;s|=0,Number.isNaN(o)&&(o=1),(o|=0)>3&&(o=3),o<1&&(o=1);const l=e.getImageData(t,n,c,i),d=l.data;let u,m,b,h,f,p,O,g,v,j,E,y,C=c-1,N=i-1,T=s+1,w=[],I=[],M=[],k=a[s],S=r[s],L=[],A=[];for(;o-- >0;){for(y=E=0,f=0;fC?C:p)<<2),u+=d[O++],m+=d[O++],b+=d[O++];for(h=0;h0?O<<2:0),g=y+L[h],v=y+A[h],u+=d[g++]-d[v++],m+=d[g++]-d[v++],b+=d[g++]-d[v++],E++;y+=c<<2}for(h=0;hN?0:c,u+=w[j],m+=I[j],b+=M[j];for(E=h<<2,f=0;f>>S,d[E+1]=m*k>>>S,d[E+2]=b*k>>>S,0==h&&(L[f]=((O=f+T)0?O*c:0),g=h+L[f],v=h+A[f],u+=w[g]-w[v],m+=I[g]-I[v],b+=M[g]-M[v],E+=c<<2}}e.putImageData(l,t,n)}},function(e,t,n){"use strict";var a=n(0),r=n(2),c=n(9),i=n(50),s=n(41),o=n(80),l=n(25),d=n(17),u=n(22);n(253);const m={B:"bold",STRONG:"bold",I:"italic",EM:"italic",U:"underline",DEL:"strikethrough",CODE:"monospace"},b=document.createElement("div");t.a=Object(a.h)(({isOpen:e,anchorPosition:t,selectedRange:n,onClose:h})=>{const f=Object(a.q)(null),p=Object(a.q)(null),{shouldRender:O,transitionClassNames:g}=Object(s.a)(e),[v,j,E]=Object(l.a)(),[y,C]=Object(a.r)(""),[N,T]=Object(a.r)(!1),[w,I]=Object(a.r)(),[M,k]=Object(a.r)({});Object(a.n)(()=>e?Object(i.a)(h):void 0,[e,h]),Object(o.a)(e,f,h),Object(a.n)(()=>{v?p.current.focus():(C(""),T(!1))},[v]),Object(a.n)(()=>{O||(E(),k({}),I(void 0))},[E,O]),Object(a.n)(()=>{if(!e||!n)return;const t={};let{parentElement:a}=n.commonAncestorContainer;for(;a&&a.id!==r.z;){const e=m[a.tagName];e&&(t[e]=!0),a=a.parentElement}k(t)},[e,n,j]);const S=Object(a.m)(()=>{if(n)return b.innerText=n.toString(),b.innerHTML},[n]),L=Object(a.m)(()=>{if(n)return n.commonAncestorContainer.parentElement},[n]);function A(){const e=p.current;if(!e)return;const{offsetWidth:t,scrollWidth:n,scrollLeft:a}=e;if(n<=t)return void I(void 0);let r="";a0&&(r+=" mask-left"),I(r)}function x(e){if(M[e])return"active";if("monospace"===e||"strikethrough"===e){if(Object.keys(M).some(t=>t!==e&&!!M[t]))return"disabled"}else if(M.monospace||M.strikethrough)return"disabled"}const D=Object(a.m)(()=>{k(e=>(document.execCommand(e.bold?"removeFormat":"bold"),Object.keys(e).forEach(t=>{"italic"!==t&&"underline"!==t||!e[t]||document.execCommand(t)}),{...e,bold:!e.bold}))},[]),R=Object(a.m)(()=>{document.execCommand("italic"),k(e=>({...e,italic:!e.italic}))},[]),F=Object(a.m)(()=>{document.execCommand("underline"),k(e=>({...e,underline:!e.underline}))},[]),_=Object(a.m)(()=>{if(M.strikethrough){const e=L();if(!n||!e||"DEL"!==e.tagName||!e.textContent)return;return e.replaceWith(e.textContent),void k(e=>({...e,strikethrough:!1}))}const e=S();document.execCommand("insertHTML",!1,`${e}`),h()},[L,S,h,n,M.strikethrough]),P=Object(a.m)(()=>{if(M.monospace){const e=L();if(!n||!e||"CODE"!==e.tagName||!e.textContent)return;return e.replaceWith(e.textContent),void k(e=>({...e,monospace:!1}))}const e=S();document.execCommand("insertHTML",!1,`${e}`),h()},[L,S,h,n,M.monospace]);function U(){const e=encodeURI(y.includes("://")?y:"http://"+y);if(N){const t=L();if(!t||"A"!==t.tagName)return;return t.href=e,void h()}const t=S();!function(){if(!n)return;const e=window.getSelection();e&&(e.removeAllRanges(),e.addRange(n))}(),document.execCommand("insertHTML",!1,`${t}`),h()}const B=Object(a.m)(e=>{const t={KeyK:j,KeyB:D,KeyU:F,KeyI:R,KeyM:P,KeyS:_}[e.code];!e.altKey&&(e.ctrlKey||e.metaKey)&&t&&(e.preventDefault(),e.stopPropagation(),t())},[D,R,F,P,_,j]);Object(a.n)(()=>(e&&document.addEventListener("keydown",B),()=>document.removeEventListener("keydown",B)),[e,B]);const q=Object(d.a)();if(!O)return;const H=Object(c.a)("TextFormatter",g,v&&"link-control-shown"),$=Object(c.a)("TextFormatter-link-url-confirm",!!y.length&&"shown"),K=t?`left: ${t.x}px; top: ${t.y}px;--text-formatter-left: ${t.x}px;`:"";return a.a.createElement("div",{ref:f,className:H,style:K,onKeyDown:function(e){"Enter"===e.key&&v&&(U(),e.preventDefault())}},a.a.createElement("div",{className:"TextFormatter-buttons"},a.a.createElement(u.a,{color:"translucent",ariaLabel:"Bold text",className:x("bold"),onClick:D},a.a.createElement("i",{className:"icon-bold"})),a.a.createElement(u.a,{color:"translucent",ariaLabel:"Italic text",className:x("italic"),onClick:R},a.a.createElement("i",{className:"icon-italic"})),a.a.createElement(u.a,{color:"translucent",ariaLabel:"Underlined text",className:x("underline"),onClick:F},a.a.createElement("i",{className:"icon-underlined"})),a.a.createElement(u.a,{color:"translucent",ariaLabel:"Strikethrough text",className:x("strikethrough"),onClick:_},a.a.createElement("i",{className:"icon-strikethrough"})),a.a.createElement(u.a,{color:"translucent",ariaLabel:"Monospace text",className:x("monospace"),onClick:P},a.a.createElement("i",{className:"icon-monospace"})),a.a.createElement("div",{className:"TextFormatter-divider"}),a.a.createElement(u.a,{color:"translucent",ariaLabel:q("TextFormat.AddLinkTitle"),onClick:j},a.a.createElement("i",{className:"icon-link"}))),a.a.createElement("div",{className:"TextFormatter-link-control"},a.a.createElement("div",{className:"TextFormatter-buttons"},a.a.createElement(u.a,{color:"translucent",ariaLabel:q("Cancel"),onClick:E},a.a.createElement("i",{className:"icon-arrow-left"})),a.a.createElement("div",{className:"TextFormatter-divider"}),a.a.createElement("div",{className:Object(c.a)("TextFormatter-link-url-input-wrapper",w)},a.a.createElement("input",{ref:p,className:"TextFormatter-link-url-input",type:"text",value:y,placeholder:"Enter URL...",autoComplete:"off",inputMode:"url",dir:"auto",onChange:function(e){C(e.target.value),A()},onScroll:A})),a.a.createElement("div",{className:$},a.a.createElement("div",{className:"TextFormatter-divider"}),a.a.createElement(u.a,{color:"translucent",ariaLabel:q("Save"),className:"color-primary",onClick:U},a.a.createElement("i",{className:"icon-check"}))))))})},function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"c",(function(){return i})),n.d(t,"b",(function(){return s}));var a=n(2);const r=navigator.clipboard&&window.ClipboardItem,c=document.createElement("textarea");c.setAttribute("readonly",""),c.tabIndex=-1,c.className="visually-hidden";const i=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)},s=e=>{if(!e)return;const t=document.createElement("canvas"),n=t.getContext("2d"),a=new Image;a.onload=e=>{if(n&&e.currentTarget){const a=e.currentTarget;t.width=a.width,t.height=a.height,n.drawImage(a,0,0,a.width,a.height),t.toBlob(o,"image/png",1)}},a.src=e};async function o(e){if(e&&r)try{await navigator.clipboard.write([new window.ClipboardItem({[e.type]:e})])}catch(e){a.r&&console.error(e)}}},function(e,t,n){"use strict";var a=n(0),r=n(31),c=n(4),i=n(110),s=n(117);n(261);t.a=Object(a.h)(({message:e,idPrefix:t="shared-media",onClick:n})=>{const o=Object(a.m)(()=>{n(e.id,e.chatId)},[e.id,e.chatId,n]),l=Object(c.F)(e),d=Object(i.a)(Object(c.E)(e,"pictogram")),{shouldRenderThumb:u,shouldRenderFullMedia:m,transitionClassNames:b}=Object(s.a)(d,"slow"),h=Object(c.Q)(e);return a.a.createElement("div",{id:`${t}${e.id}`,className:"Media scroll-item",onClick:n?o:void 0},u&&a.a.createElement("img",{src:l,alt:""}),m&&a.a.createElement("img",{src:d,className:b+" full-media",alt:""}),h&&a.a.createElement("span",{className:"video-duration"},h.isGif?"GIF":Object(r.e)(h.duration)))})},function(e,t,n){"use strict";var a=n(0),r=n(4),c=n(115),i=n(49),s=n(48),o=n(108),l=n(111),d=n(130),u=n(146),m=n(133),b=n(17),h=n(20);n(196);t.a=Object(a.h)(({itemIds:e,selectedIds:t,filterValue:n,filterPlaceholder:f,notFoundText:p,searchInputId:O,isLoading:g,noScrollRestore:v,onSelectedIdsChange:j,onFilterChange:E,onLoadMore:y})=>{const C=Object(a.q)(null),N=t.length>10;Object(a.n)(()=>{setTimeout(()=>{requestAnimationFrame(()=>{C.current.focus()})},500)},[]);const T=Object(a.m)(e=>{const n=[...t];n.includes(e)?n.splice(n.indexOf(e),1):n.push(e),j(n),E("")},[t,j,E]),w=Object(a.m)(e=>{const{value:t}=e.currentTarget;E(t)},[E]),[I,M]=Object(m.a)(y,e,Boolean(n)),k=Object(b.a)();return a.a.createElement("div",{className:"Picker"},a.a.createElement("div",{className:"picker-header custom-scroll",dir:k.isRtl?"rtl":void 0},t.map((e,n)=>a.a.createElement(u.a,{chatOrUserId:e,isMinimized:N&&na.a.createElement(o.a,{key:e,className:"chat-item-clickable picker-list-item",onClick:()=>T(e),ripple:!0},a.a.createElement(i.a,{label:"",checked:t.includes(e)}),Object(r.ob)(e)?a.a.createElement(l.a,{userId:e}):a.a.createElement(d.a,{chatId:e})))):g||!I||I.length?a.a.createElement(h.a,null):a.a.createElement("p",{className:"no-results"},p||"Sorry, nothing found."))})},,function(e,t,n){"use strict";var a=n(0),r=n(6),c=n(31),i=n(4);var s=n(9),o=n(23);var l=n(123),d=n(41),u=n(141),m=n(185),b=n(189),h=n(17),f=n(22),p=n(124),O=n(34);n(232);const g=r.l?20:25,v=r.l?50:75;function j(e,t,{handleStartSeek:n,handleSeek:r,handleStopSeek:c}){return a.a.createElement("div",{className:"seekline no-selection",onMouseDown:n,onMouseMove:r,onMouseUp:c},a.a.createElement("span",{className:"seekline-buffered-progress"},a.a.createElement("i",{style:`transform: translateX(${100*t}%)`})),a.a.createElement("span",{className:"seekline-play-progress"},a.a.createElement("i",{style:`transform: translateX(${100*e}%)`})),a.a.createElement("span",{className:"seekline-thumb"},a.a.createElement("i",{style:`transform: translateX(${100*e}%)`})))}t.a=Object(a.h)(({theme:e,message:t,senderTitle:n,uploadProgress:E,target:y,date:C,lastSyncTime:N,className:T,isSelectable:w,isSelected:I,onPlay:M,onReadMedia:k,onCancelUpload:S,onDateClick:L})=>{const{content:{audio:A,voice:x},isMediaUnread:D}=t,R=Boolean(x),F=Object(a.q)(!1),_=Object(h.a)(),[P,U]=Object(a.r)(!1),B=N,{mediaData:q,downloadProgress:H}=Object(l.a)(Object(i.E)(t,"inline"),!B,Object(i.D)(t,"inline"));const{isBuffered:$,bufferedProgress:K,bufferingHandlers:z,checkBuffering:V}=Object(u.a)(),{isPlaying:Y,playProgress:W,playPause:G,setCurrentTime:X,duration:J}=Object(m.a)(Object(i.C)(t),Object(i.q)(t),q,z,V,P,(function(){U(!0),M(t.id,t.chatId)}),Object(i.xb)(t));Object(a.n)(()=>{U(Y)},[Y]);const{isDownloadStarted:Q,downloadProgress:Z,handleDownloadClick:ee}=Object(b.a)(Object(i.E)(t,"download"),Object(i.u)(t)),te=P&&!$,{isUploading:ne,isTransferring:ae,transferProgress:re}=Object(i.r)(t,Q?Z:E||H,te||Q),{shouldRender:ce,transitionClassNames:ie}=Object(d.a)(ae),se=Object(a.m)(()=>{ne?S&&S():(Y||M(t.id,t.chatId),U(!P),G())},[Y,ne,t.id,t.chatId,S,M,G,P]);Object(a.n)(()=>{Y&&k&&D&&k()},[Y,D,k]);const oe=Object(a.m)(e=>{if(F.current){const t=e.currentTarget.closest(".seekline,.waveform");if(t){const{width:n,left:a}=t.getBoundingClientRect();X(J*((e.clientX-a)/n))}}},[J,X]),le=Object(a.m)(e=>{F.current=!0,oe(e)},[oe]),de=Object(a.m)(()=>{F.current=!1},[]),ue=Object(a.m)(()=>{L(t.id,t.chatId)},[L,t.id,t.chatId]);const me={handleStartSeek:le,handleSeek:oe,handleStopSeek:de},be=Object(i.yb)(t),he=Object(a.p)(()=>x&&function(e,t=0,n=!1,{handleStartSeek:r,handleSeek:c,handleStopSeek:i},s){const{waveform:o,duration:l}=e;if(!o)return;const d="dark"===s?"#494B75":"#CBCBCB",u="dark"===s?"#C0BBED":"#B0DEA6",m="dark"===s?"#868DF5":"#54a3e6",b="dark"===s?"#FFFFFF":"#53ad53",h=Math.min(l/30,1),f=Math.round(g+(v-g)*h),p=function(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),c=r[t]+(r[t+1]<<8);a[e]=c>>n&31}const c=Math.floor(5*(n-1)/8),i=Math.floor(5*(n-1)%8),s=r[c]+(r[c+1]<<8);return a[n-1]=s>>i&31,a}(new Uint8Array(o)),{data:O,peak:j}=function(e,t){let n=0;const a=new Array(t),r=e.length/t,c=e[0],i=e[e.length-1];for(let d=0;d{s.globalAlpha=i/e.length>=t?.5:1,s.fillStyle=t>i/e.length?r:a;const o=Math.max(2,c/Math.max(1,n)*23);!function(e,t,n,a,r,c){a<2*c&&(c=a/2);r<2*c&&(c=r/2);e.beginPath(),e.moveTo(t+c,n),e.arcTo(t+a,n,t+a,n-r,c),e.arcTo(t+a,n-r,t,n-r,c),e.arcTo(t,n-r,t,n,c),e.arcTo(t,n,t+a,n,c),e.closePath()}(s,4*i,23,2,o,1),s.fill()}),{src:i.toDataURL(),width:c,height:23}}(O,t,{peak:j,fillStyle:n?u:d,progressFillStyle:n?b:m});return a.a.createElement("img",{src:E,alt:"",width:y,height:C,className:"waveform",draggable:!1,onMouseDown:r,onMouseMove:c,onMouseUp:i})}(x,W,be,me,e),[x,W,be,me,e]),fe=Object(s.a)("Audio media-inner",T,be&&!y&&"own",y&&"bigger",I&&"audio-is-selected"),pe=["toggle-play"];te?pe.push("loading"):Y?pe.push("pause"):Y||pe.push("play");const Oe=Y||W>0&&W<1,ge=Object(s.a)("content",Oe&&"with-seekline");return a.a.createElement("div",{className:fe,dir:_.isRtl?"rtl":void 0},w&&a.a.createElement("div",{className:"message-select-control"},I&&a.a.createElement("i",{className:"icon-select"})),a.a.createElement(f.a,{round:!0,ripple:!r.l,size:y?"smaller":"tiny",className:pe.join(" "),ariaLabel:Y?"Pause audio":"Play audio",onClick:se,isRtl:_.isRtl},a.a.createElement("i",{className:"icon-play"}),a.a.createElement("i",{className:"icon-pause"})),ce&&a.a.createElement("div",{className:Object(s.a)("media-loading",ie,te&&"interactive")},a.a.createElement(p.a,{progress:re,transparent:!0,size:y?"m":"s",onClick:te?se:void 0,noCross:!te})),A&&a.a.createElement(f.a,{round:!0,size:"tiny",className:"download-button",ariaLabel:Q?"Cancel download":"Download",onClick:ee},a.a.createElement("i",{className:Q?"icon-close":"icon-arrow-down"})),"searchResult"===y&&a.a.createElement(a.a.Fragment,null,a.a.createElement("div",{className:ge},a.a.createElement("div",{className:"content-row"},a.a.createElement("p",{className:"title",dir:"auto"},Object(o.a)(function(){if(R)return n||"Voice";const{title:e,fileName:t}=A;return e||t}())),a.a.createElement("div",{className:"message-date"},C&&a.a.createElement(O.a,{className:"date",onClick:ue},Object(c.g)(_,1e3*C)))),Oe&&j(W,K,me),!Oe&&a.a.createElement("p",{className:"duration",dir:"auto"},W>0?Object(c.e)(J*W)+" / ":void 0,function(){if(R)return Object(c.e)(x.duration);const{performer:e}=A;return a.a.createElement(a.a.Fragment,null,e&&Object(o.a)(e),e&&n&&a.a.createElement("span",null,"•"),n&&Object(o.a)(n))}()))),"searchResult"!==y&&A&&function(e,t,n,r,i,s,l,d){const{title:u,performer:m,duration:b,fileName:h}=t,f=n||r>0&&r<1;return a.a.createElement("div",{className:"content"},a.a.createElement("p",{className:"title",dir:"auto"},Object(o.a)(u||h)),f&&j(r,i,s),!f&&a.a.createElement("div",{className:"meta",dir:"auto"},a.a.createElement("span",{className:"performer"},Object(o.a)(m||"Unknown")),l&&a.a.createElement(a.a.Fragment,null," ","•"," ",a.a.createElement(O.a,{className:"date",onClick:d},Object(c.d)(e,1e3*l)))),a.a.createElement("p",{className:"duration",dir:"auto"},r>0?Object(c.e)(b*r)+" / ":void 0,Object(c.e)(b)))}(_,A,Y,W,K,me,C,L?ue:void 0),"searchResult"!==y&&x&&function(e,t,n){return a.a.createElement("div",{className:"content"},t,a.a.createElement("p",{className:"voice-duration",dir:"auto"},Object(c.e)(e.duration),n&&a.a.createElement("span",null,"•")))}(x,he,D))})},function(e,t,n){"use strict";var a=n(0),r=n(147),c=n(30),i=n(148),s=n(17),o=n(9),l=n(23);n(210);var d=Object(a.h)(({className:e,title:t,active:n,badgeCount:r,isBadgeActive:c,previousActiveTab:i,onClick:s,clickArg:d})=>{const u=Object(a.q)(null);return Object(a.o)(()=>{if(!n||void 0===i)return;const e=u.current,t=e.querySelector("i"),a=e.parentElement.children[i];if(!a)return;const r=a.querySelector("i");r.classList.remove("animate"),t.classList.remove("animate");const c=r.parentElement.offsetLeft-t.parentElement.offsetLeft,s=r.clientWidth/t.clientWidth;t.style.transform=`translate3d(${c}px, 0, 0) scale3d(${s}, 1, 1)`,requestAnimationFrame(()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{t.classList.add("animate"),t.style.transform="none"})})})},[n,i]),a.a.createElement("button",{type:"button",className:Object(o.a)("Tab",e,n&&"active"),onClick:()=>s(d),ref:u},a.a.createElement("span",null,Object(l.a)(t),!!r&&a.a.createElement("span",{className:Object(o.a)("badge",c&&"active")},r),a.a.createElement("i",null)))});n(211);t.a=Object(a.h)(({tabs:e,activeTab:t,big:n,onSwitchTab:o})=>{const l=Object(a.q)(null),u=Object(c.a)(t);Object(i.a)(l.current),Object(a.n)(()=>{const e=l.current;if(e.scrollWidth<=e.offsetWidth)return;const t=e.querySelector(".Tab.active");if(t){const n=t.offsetLeft-e.offsetWidth/2+t.offsetWidth/2;if(Math.abs(n-e.scrollLeft)<16)return;Object(r.a)(e,n)}},[t]);const m=Object(s.a)();return a.a.createElement("div",{className:"TabList no-selection no-scrollbar "+(n?"big":""),ref:l,dir:m.isRtl?"rtl":void 0},e.map((e,n)=>a.a.createElement(d,{key:e.title,title:m(e.title),active:n===t,badgeCount:e.badgeCount,isBadgeActive:e.isBadgeActive,previousActiveTab:u,onClick:o,clickArg:n})))})},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));const a={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",SERVICE_WORKER_DISABLED:"Service Worker is disabled. Please reload the page without holding key.",CAPTION_TOO_LONG_PLEASE_REMOVE_CHARACTERS:"The provided caption 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"};function r(e){const{message:t,isSlowMode:n,textParams:r}=e;if(n){const e=t.indexOf(" (caused by");return e>0?t.substring(0,e):t}let c=a[t];return c&&r&&(c=Object.keys(r).reduce((e,t)=>e.replace(t,r[t]),c)),c}},function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return r}));function a(e,t,n){c("transitionend",e,t,n)}function r(e,t,n){c("animationend",e,t,n)}function c(e,t,n,a){let r=!1;t.addEventListener(e,(function c(i){r||i.target!==i.currentTarget||a&&(i instanceof TransitionEvent&&i.propertyName===a||i instanceof AnimationEvent&&i.animationName===a)||(r=!0,t.removeEventListener(e,c),setTimeout(()=>{n()},50))}))}},function(e,t,n){"use strict";var a=n(0),r=n(1),c=n(4),i=n(17);t.a=({chat:e,privateChatUser:t,handleDelete:n,folderId:s,isPinned:o,isMuted:l})=>{const d=Object(i.a)(),{toggleChatPinned:u,updateChatMutedState:m,toggleChatArchived:b,toggleChatUnread:h}=Object(r.d)();return Object(a.p)(()=>{if(!e)return;const a=t&&t.isSelf,r=e.unreadCount||e.hasUnreadMark?{title:d("MarkAsRead"),icon:"readchats",handler:()=>h({id:e.id})}:{title:d("MarkAsUnread"),icon:"unread",handler:()=>h({id:e.id})},i=o?{title:d("UnpinFromTop"),icon:"unpin",handler:()=>u({id:e.id,folderId:s})}:{title:d("PinToTop"),icon:"pin",handler:()=>u({id:e.id,folderId:s})},f=l?{title:d("ChatList.Unmute"),icon:"unmute",handler:()=>m({chatId:e.id,isMuted:!1})}:{title:d("ChatList.Mute"),icon:"mute",handler:()=>m({chatId:e.id,isMuted:!0})},p=Object(c.kb)(e)?{title:d("Unarchive"),icon:"unarchive",handler:()=>b({id:e.id})}:{title:d("Archive"),icon:"archive",handler:()=>b({id:e.id})};return[r,i,...a?[]:[f,p],{title:Object(c.ob)(e.id)?d("Delete"):d(Object(c.c)(e)?"DeleteChat":Object(c.mb)(e)?"LeaveChannel":"Group.LeaveGroup"),icon:"delete",destructive:!0,handler:n}]},[e,t,d,o,n,h,u,s,m,b,l])}},function(e,t,n){"use strict";var a=n(0),r=n(31),c=n(17),i=n(182);n(215);t.a=Object(a.h)(({message:e,outgoingStatus:t})=>{const n=Object(c.a)();return a.a.createElement("div",{className:"LastMessageMeta"},t&&a.a.createElement(i.a,{status:t}),a.a.createElement("span",{className:"time"},Object(r.g)(n,1e3*e.date)))})},function(e,t,n){"use strict";var a,r=n(0),c=n(113);n(214);!function(e){e[e.failed=0]="failed",e[e.pending=1]="pending",e[e.succeeded=2]="succeeded",e[e.read=3]="read"}(a||(a={}));t.a=Object(r.h)(({status:e})=>r.a.createElement("div",{className:"MessageOutgoingStatus"},r.a.createElement(c.a,{name:"reveal",activeKey:a[e]},()=>r.a.createElement("i",{className:"icon-message-"+e}))))},function(e,t,n){"use strict";var a=n(0);t.a=(e,t,n,r,c=0,i=0)=>{const[s,o]=Object(a.r)("right"),[l,d]=Object(a.r)("bottom"),[u,m]=Object(a.r)("");return Object(a.n)(()=>{const a=t();if(!e||!a)return;let{x:s,y:l}=e;const u={width:0,left:0,height:0,top:0},b=r(),h=n(),f=a.getBoundingClientRect(),p=b?{width:b.offsetWidth,height:b.offsetHeight}:u,O=h?h.getBoundingClientRect():u;let g;s+p.width+c0?(g="right",s-=3):(g="left",s=16),o(g),l+p.height{t&&!l&&d&&!s.current&&(s.current=window.setTimeout(()=>{s.current=void 0,o()},t))},[e]),s.current&&t&&!l?n:e}},function(e,t,n){"use strict";var a=n(0),r=n(186),c=n(58),i=n(165),s=n(53);t.a=(e,t,n,o,l,d=!1,u,m=!1)=>{const b=Object(a.q)(null),[h,f]=Object(a.r)(!1);let p=h;const[O,g]=Object(a.r)(0);Object(s.a)(()=>{b.current=Object(r.a)(e,(e,n)=>{switch(e){case"onPlay":f(!0);break;case"onPause":f(!1);break;case"onTimeUpdate":{const{proxy:e}=b.current,n=e.duration&&Number.isFinite(e.duration)?e.duration:t;g(e.currentTime/n);break}}o&&o[e]&&o[e](n)},u);const{proxy:n}=b.current;h||n.paused||(f(!0),p=!0),l&&l(n)},[e]);const{play:v,pause:j,setCurrentTime:E,proxy:y,destroy:C}=b.current,N=y.duration&&Number.isFinite(y.duration)?y.duration:t;Object(a.n)(()=>{N&&!Object(i.a)(y)&&g(y.currentTime/N)},[N,O,y]),Object(a.n)(()=>()=>{C(m)},[C,m]),Object(c.a)(([e,t])=>{e===d&&n===t||y.src&&y.paused||d&&n&&!h&&v(n)},[d,n,h,v,y.src,y.paused]);const T=Object(a.m)(()=>{h?j():n&&v(n)},[n,j,v,h]);return{isPlaying:p,playProgress:O,playPause:T,setCurrentTime:E,audioProxy:y,duration:N}}},function(e,t,n){"use strict";n.d(t,"b",(function(){return u})),n.d(t,"a",(function(){return m}));var a=n(6),r=n(140),c=n(165),i=n(1),s=n(4);const o=new Map;let l,d=[];function u(){const e=l&&o.get(l);e&&e.audio.pause()}function m(e,t,n){o.has(e)||(o.set(e,function(e,t){const n=new Audio;function a(t){return a=>{o.has(e)&&(Object(c.a)(n)||o.get(e).handlers.forEach(e=>{e(t,a)}))}}return n.addEventListener("timeupdate",a("onTimeUpdate")),n.addEventListener("play",a("onPlay")),n.addEventListener("pause",a("onPause")),n.addEventListener("loadstart",a("onLoadStart")),n.addEventListener("loadeddata",a("onLoadedData")),n.addEventListener("playing",a("onPlaying")),n.addEventListener("ended",()=>{if(Object(c.a)(n))return;const t=d[d.indexOf(e)+1];if(!t)return;if(!o.has(t))return void Object(i.d)().openAudioPlayer(Object(s.Eb)(t));const a=o.get(t);a.onForcePlay&&a.onForcePlay(),l=t,a.audio.src&&Object(r.a)(a.audio)}),{audio:n,proxy:new Proxy(n,{get:(e,t)=>e[t]}),handlers:[],onForcePlay:t}}(e,n)),d.includes(e)||d.push(e));const{audio:u,proxy:m,handlers:b}=o.get(e);return b.push(t),{play(t){l&&l!==e&&o.get(l).audio.pause(),l=e,u.src||(u.src=t,u.preload="auto",t.includes("/progressive/")&&a.j&&Object(c.b)(u)),Object(r.a)(u)},pause(){l===e&&u.pause()},setCurrentTime(t){l===e&&(u.currentTime=t)},proxy:m,destroy(n=!1){const a=o.get(e);a&&(a.handlers=a.handlers.filter(e=>e!==t),a.handlers.length||(a.audio.pause(),o.delete(e),n&&(d=d.filter(t=>t!==e)),e===l&&(l=void 0)))}}}},function(e,t,n){"use strict";function a(e,t){const n=document.createElement("a");n.href=e,n.download=t,n.click()}n.d(t,"a",(function(){return a}))},function(e,t,n){"use strict";var a=n(0),r=n(41),c=n(117),i=n(9),s=n(31),o=n(60),l=n(118),d=n(23),u=n(17),m=n(124),b=n(34);n(231);t.a=Object(a.h)(({ref:e,name:t,size:n,extension:h="",timestamp:f,sender:p,thumbnailDataUri:O,previewData:g,className:v,smaller:j,isTransferring:E,isUploading:y,isSelectable:C,isSelected:N,transferProgress:T,actionIcon:w,onClick:I,onDateClick:M})=>{const k=Object(u.a)();let S=Object(a.q)(null);e&&(S=e);const{shouldRender:L,transitionClassNames:A}=Object(r.a)(E,void 0,!0),x=Object(o.a)(h),D=Object(o.e)(n),{shouldRenderThumb:R,shouldRenderFullMedia:F,transitionClassNames:_}=Object(c.a)(g,"slow"),{width:P,height:U}=Object(l.k)(j),B=Object(i.a)("File",v,j&&"smaller",I&&!y&&"interactive",N&&"file-is-selected");return a.a.createElement("div",{ref:S,className:B,dir:k.isRtl?"rtl":void 0},C&&a.a.createElement("div",{className:"message-select-control"},N&&a.a.createElement("i",{className:"icon-select"})),a.a.createElement("div",{className:"file-icon-container",onClick:y?void 0:I},O||g?a.a.createElement("div",{className:"file-preview media-inner"},R&&a.a.createElement("img",{src:O,width:P,height:U,className:"thumbnail",alt:""}),F&&a.a.createElement("img",{src:g,className:"full-media "+_,width:P,height:U,alt:""})):a.a.createElement("div",{className:"file-icon "+x},h.length<=4&&a.a.createElement("span",{className:"file-ext",dir:"auto"},h)),L&&a.a.createElement("div",{className:Object(i.a)("file-progress",x,A)},a.a.createElement(m.a,{progress:T,size:j?"s":"m",onClick:y?I:void 0})),I&&a.a.createElement("i",{className:Object(i.a)("action-icon",w||"icon-download",L&&"hidden")})),a.a.createElement("div",{className:"file-info"},a.a.createElement("div",{className:"file-title",dir:"auto"},Object(d.a)(t)),a.a.createElement("div",{className:"file-subtitle",dir:"auto"},a.a.createElement("span",null,E&&T?Math.round(100*T)+"%":D),p&&a.a.createElement("span",{className:"file-sender"},Object(d.a)(p)),!p&&f&&a.a.createElement(a.a.Fragment,null," ",a.a.createElement(b.a,{onClick:M},Object(s.d)(k,1e3*f))))),p&&f&&a.a.createElement(b.a,{onClick:M},Object(s.g)(k,1e3*f)))})},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var a=n(0),r=n(123),c=n(187);function i(e,t){const[n,i]=Object(a.r)(!1),{mediaData:s,downloadProgress:o}=Object(r.a)(e,!n);Object(a.n)(()=>{n&&s&&(Object(c.a)(s,t),i(!1))},[t,s,n]),Object(a.n)(()=>{i(!1)},[e]);const l=Object(a.m)(e=>{e.stopPropagation(),i(e=>!e)},[]);return{isDownloadStarted:n,downloadProgress:o,handleDownloadClick:l}}},function(e,t,n){"use strict";var a=n(0),r=n(2),c=n(41),i=n(9),s=n(50),o=n(128);n(237);t.a=Object(a.h)(({message:e,duration:t=3e3,containerId:n,onDismiss:l})=>{const[d,u]=Object(a.r)(!0),m=Object(a.q)(null),{transitionClassNames:b}=Object(c.a)(d),h=Object(a.m)(()=>{u(!1),setTimeout(l,150+r.c)},[l]);Object(a.n)(()=>d?Object(s.a)(h):void 0,[d,h]),Object(a.n)(()=>(m.current=window.setTimeout(h,t),()=>{m.current&&(clearTimeout(m.current),m.current=void 0)}),[t,h]);const f=Object(a.m)(()=>{m.current&&(clearTimeout(m.current),m.current=void 0)},[]),p=Object(a.m)(()=>{m.current=window.setTimeout(h,t)},[t,h]);return a.a.createElement(o.a,{className:"Notification-container",containerId:n},a.a.createElement("div",{className:Object(i.a)("Notification",b),onClick:h,onMouseEnter:f,onMouseLeave:p},a.a.createElement("div",{className:"content"},e)))})},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));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)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return O}));var a=n(0),r=n(2),c=n(52),i=n(66),s=n(135),o=n(3),l=n(25);let d,u,m,b;const h=/(
|)/g,f=/ /g,p=/(
|<\/div>)/gi;try{b=new RegExp("(^|\\s):[-+_:\\p{L}\\p{N}]*$","gui")}catch(e){b=new RegExp("(^|\\s):[-+_:\\d\\wа-яё]*$","gi")}function O(e,t,O,g=r.z,v,j,E,y=!1){const[C,N,T]=Object(l.a)(),[w,I]=Object(a.r)(),[M,k]=Object(a.r)(),[S,L]=Object(a.r)({}),[A,x]=Object(a.r)(),[D,R]=Object(a.r)({}),[F,_]=Object(a.r)(!1),[P,U]=Object(a.r)(c.a),B=Object(a.p)(()=>w&&O.length?Object.values(Object(o.m)(w,O)):[],[w,O]);Object(a.n)(()=>{if(y)return;const e=()=>{I(m.emojis)};m?e():async function(){d||(d=n.e(1).then(n.t.bind(null,332,3)),u=(await d).default,m=Object(i.b)(u));return d}().then(e)},[y]),Object(a.n)(()=>{if(!w||y)return;const e=Object.values(w),t=Object(o.c)(e,"native"),n=j?Object(o.i)(j,e=>Object.values(Object(o.m)(t,e))):{},a=E?Object(o.i)(E,e=>Object.values(Object(o.m)(t,e))):{};L({...n,...a}),k([...Object.keys(n),...Object.keys(a)]);const r=e.reduce((e,t)=>(t.names.forEach(n=>{e[n]||(e[n]=[]),e[n].push(t)}),e),{});R(r),x(Object.keys(r))},[y,j,w,E]),Object(a.n)(()=>{if(!(e&&t&&w&&M&&M.length))return void T();const n=t.includes(":")&&function(e){const t=e.replace(f," ").replace(h,"\n").replace(p,"").match(b);return t?t[0].trim():void 0}(t);if(!n)return U(c.a),void T();const a=n.length>2&&n.endsWith(":"),r=n.substr(1,a?n.length-2:void 0);let i=[];if(_(a),r){if(r.length>=2){const e=M.filter(e=>e.startsWith(r)).sort();i=i.concat(Object(o.h)(Object.values(Object(o.m)(S,e))));const t=A.filter(e=>e.startsWith(r));i=i.concat(Object(o.h)(Object.values(Object(o.m)(D,t)))),i=Object(o.o)(i)}}else i=B;i.length?(a||N(),U(i.slice(0,36))):T()},[w,S,M,D,A,t,e,N,B,T,_]);const q=Object(a.m)((e,n)=>{const a=t.lastIndexOf(":",n?t.lastIndexOf(":")-1:void 0);if(-1!==a){v(`${t.substr(0,a)}${e}`);const n=document.getElementById(g);requestAnimationFrame(()=>{Object(s.a)(n,!0)})}T()},[t,g,v,T]);return Object(a.n)(()=>{C&&F&&P.length&&q(P[0].native,!0)},[P,q,C,F]),{isEmojiTooltipOpen:C,closeEmojiTooltip:T,filteredEmojis:P,insertEmoji:q}}},function(e,t,n){"use strict";var a=n(0),r=n(15),c=n(26);t.a=Object(a.h)(e=>{const{isOpen:t}=e,n=Object(c.a)(r.a.Extra,"EmojiTooltip",!t);return n?a.a.createElement(n,e):void 0})},function(e,t,n){"use strict";var a=n(0),r=n(1),c=n(2),i=n(7),s=n(10),o=n(135),l=n(9),d=n(3),u=n(6),m=n(57),b=n(166),h=n(25),f=n(65),p=n(191),O=n(17),g=n(23),v=n(171);const j=u.l?256:416;t.a=Object(a.h)(Object(r.h)(e=>{const{chatId:t,threadId:n}=Object(i.z)(e)||{},{messageSendKeyCombo:a}=e.settings.byKey;return{currentChatId:t,messageSendKeyCombo:a,replyingToId:t&&n?Object(i.ob)(e,t,n):void 0,noTabCapture:e.isPollModalOpen||e.payment.isPaymentModalOpen}},(e,t)=>Object(d.l)(t,["editLastMessage","replyToNextMessage"]))(({id:e,isAttachmentModalInput:t,editableInputId:n,html:r,placeholder:i,forcedPlaceholder:d,shouldSetFocus:E,shouldSuppressFocus:y,shouldSuppressTextFormatter:C,onUpdate:N,onSuppressedFocus:T,onSend:w,currentChatId:I,replyingToId:M,noTabCapture:k,messageSendKeyCombo:S,editLastMessage:L,replyToNextMessage:A})=>{const x=Object(a.q)(null),D=Object(a.q)(null),R=Object(O.a)(),F=Object(a.q)(!1),[_,P,U]=Object(h.a)(),[B,q]=Object(a.r)(),[H,$]=Object(a.r)();Object(a.n)(()=>{t&&Y(!1)},[t]),Object(b.a)(([e])=>{r!==x.current.innerHTML&&(x.current.innerHTML=r),r!==D.current.innerHTML&&(D.current.innerHTML=r),void 0!==e&&e!==r&&Y(!r.length)},[r]);const K=Object(a.m)(()=>{x.current.closest(".from, .to")?setTimeout(K,350):Object(o.a)(x.current)},[]),z=Object(a.m)(()=>{U(),function(){const e=window.getSelection();e&&(e.removeAllRanges?e.removeAllRanges():e.empty&&e.empty())}()},[U]);function V(){if(u.e)return;const e=window.getSelection();if(!e||!e.rangeCount||F.current)return void U();const t=e.getRangeAt(0),a=t.toString().trim();if(C||!Object(p.a)(t,n||c.z)||!a||Object(f.a)(a)||!t.START_TO_END)return void U();const r=t.getBoundingClientRect(),i=x.current.getBoundingClientRect();let s=r.left+r.width/2-i.left;s<90?s=90:s>i.width-90&&(s=i.width-90),q({x:s,y:r.top-i.top}),$(t),P()}function Y(e=!1){const t=x.current,n=D.current,a=Number(t.style.height.replace("px","")),r=Math.min(n.scrollHeight,j);if(r===a)return;const c=Math.round(50*Math.log(Math.abs(r-a))),i=()=>{t.style.height=r+"px",t.style.transitionDuration=c+"ms",t.classList.toggle("overflown",n.scrollHeight>j)};e?requestAnimationFrame(i):i()}Object(a.n)(()=>{u.n||K()},[I,K,M,E]),Object(a.n)(()=>{if(k)return;const e=Object(s.a)(e=>{"Tab"===e.key&&(e.preventDefault(),requestAnimationFrame(K))},2e3,!0,!1);return Object(m.a)({onTab:e})},[K,k]),Object(a.n)(()=>{const e=x.current;function t(){e.blur()}return y&&e.addEventListener("focus",t),()=>{e.removeEventListener("focus",t)}},[y]);const W=Object(l.a)("form-control custom-scroll",r.length>0&&"touched",y&&"focus-disabled");return a.a.createElement("div",{id:e,onClick:y?T:void 0,dir:R.isRtl?"rtl":void 0},a.a.createElement("div",{ref:x,id:n||c.z,className:W,contentEditable:!0,dir:"auto",onClick:K,onChange:function(e){const{innerHTML:t,textContent:n}=e.currentTarget;if(N("
"===t?"":t),!(u.n||n&&n.length)){const e=window.getSelection();e&&(x.current.blur(),e.removeAllRanges(),Object(o.a)(x.current,!0))}},onKeyDown:function(e){if(e.metaKey&&!r.length){const t="ArrowDown"===e.key?1:"ArrowUp"===e.key?-1:void 0;if(t)return e.preventDefault(),void A({targetIndexDelta:t})}"Enter"!==e.key||e.shiftKey?"ArrowUp"!==e.key||r.length||e.metaKey?e.target.addEventListener("keyup",(function t(){V(),e.target.removeEventListener("keyup",t)})):(e.preventDefault(),L()):u.e||u.b||!("enter"===S&&!e.shiftKey||"ctrl-enter"===S&&(e.ctrlKey||e.metaKey))||(e.preventDefault(),U(),w())},onMouseDown:function(e){2===e.button?!0!==F.current&&(F.current=!0,document.addEventListener("mousedown",(function e(){setTimeout(()=>{F.current=!1},100),window.removeEventListener("mouseup",e)})),document.addEventListener("keydown",(function e(t){"Esc"!==t.key&&"Escape"!==t.key||(setTimeout(()=>{F.current=!1},100),window.removeEventListener("keydown",e))}))):e.target.addEventListener("mouseup",(function t(){V(),e.target.removeEventListener("mouseup",t)}))},onContextMenu:function(e){u.b&&(e.preventDefault(),e.stopPropagation())},onTouchCancel:function(){u.b&&V()}}),a.a.createElement("div",{ref:D,className:Object(l.a)(W,"clone"),dir:"auto"}),!d&&a.a.createElement("span",{className:"placeholder-text",dir:"auto"},i),a.a.createElement(v.a,{isOpen:_,anchorPosition:B,selectedRange:H,onClose:z}),d&&a.a.createElement("span",{className:"forced-placeholder"},Object(g.a)(d)))}))},function(e,t,n){"use strict";var a=n(0),r=n(4),c=n(9),i=n(42),s=n(23),o=n(31),l=n(17),d=n(173),u=n(34),m=n(59);n(262);t.a=Object(a.h)(({message:e,senderTitle:t,onMessageClick:n})=>{const b=Object(l.a)();let h=Object(r.R)(e);if(!h){const t=Object(r.m)(e);if(t){const{url:n,domain:a}=t,c=Object(r.O)(b,e);h={siteName:a.replace(/^www./,""),url:n.includes("://")?n:n.includes("@")?"mailto:"+n:"http://"+n,description:c!==n?c:void 0}}}const f=Object(a.m)(()=>{n(e.id,e.chatId)},[n,e.id,e.chatId]);if(!h)return;const{siteName:p,url:O,displayUrl:g,title:v,description:j,photo:E,video:y}=h,C=!t&&Object(i.a)(j,170),N=Object(c.a)("WebLink scroll-item",!E&&!y&&"without-media");return a.a.createElement("div",{className:N,"data-initial":(p||g)[0],dir:b.isRtl?"rtl":void 0},E&&a.a.createElement(d.a,{message:e}),a.a.createElement("div",{className:"content"},a.a.createElement(u.a,{isRtl:b.isRtl,className:"site-title",onClick:f},Object(s.a)(v||p||g)),C&&a.a.createElement(u.a,{isRtl:b.isRtl,className:"site-description",onClick:f},Object(s.a)(C)),a.a.createElement(m.a,{url:O,className:"site-name",text:"",isRtl:b.isRtl},O.replace("mailto:","")||g),t&&a.a.createElement("div",{className:"sender-name"},Object(s.a)(t))),t&&a.a.createElement("div",{className:"message-date"},a.a.createElement(u.a,{className:"date",onClick:f,isRtl:b.isRtl},Object(o.g)(b,1e3*e.date))))})},function(e,t,n){},,,function(e,t,n){"use strict";var a=n(0),r=n(1),c=n(2),i=n(6),s=n(30),o=n(3),l=n(4),d=n(7),u=n(133);let m;!function(e){e[e.Move=0]="Move",e[e.Opacity=1]="Opacity",e[e.None=2]="None"}(m||(m={}));var b=n(115),h=n(20),f=n(17),p=n(8),O=n(68),g=n(23),v=n(10),j=n(9),E=n(149),y=n(180),C=n(25),N=n(110),T=n(114),w=n(138),I=n(162),M=n(181),k=n(163),S=n(108),L=n(51),A=n(164);n(218);var x=Object(a.h)(({chat:e,isPinned:t,isMuted:n})=>{const r=Boolean(e.unreadCount||e.hasUnreadMark||t),c=Object(j.a)("Badge",n&&"muted",t&&"pinned",Boolean(e.unreadCount||e.hasUnreadMark)&&"unread");function i(){return e.unreadCount?e.unreadMentionsCount?a.a.createElement("div",{className:"Badge-wrapper"},a.a.createElement("div",{className:"Badge mention"},a.a.createElement("i",{className:"icon-mention"})),a.a.createElement("div",{className:c},Object(L.b)(e.unreadCount))):a.a.createElement("div",{className:c},Object(L.b)(e.unreadCount)):e.hasUnreadMark?a.a.createElement("div",{className:c}):t?a.a.createElement("div",{className:c},a.a.createElement("i",{className:"icon-pinned-chat"})):void 0}return a.a.createElement(A.a,{isCustom:!0,className:"Badge-transition",isOpen:r},i)});n(219);var D=Object(a.h)(Object(r.h)((e,{chatId:t})=>{const n=Object(d.g)(e,t);if(!n||!n.lastMessage)return{};const{senderId:a,replyToMessageId:r,isOutgoing:c}=n.lastMessage,i=a?Object(d.Jb)(e,a):void 0,s=Object(l.s)(n.lastMessage),o=s&&r?Object(d.l)(e,n.id,r):void 0,{targetUserIds:u,targetChatId:m}=s||{},b=Object(l.W)(n),{byId:h}=e.users,{chatId:f,threadId:O,type:g}=Object(d.z)(e)||{},v=t===f&&O===p.MAIN_THREAD_ID;return{chat:n,isMuted:Object(l.Hb)(n,Object(d.fb)(e),Object(d.eb)(e)),lastMessageSender:i,actionTargetUserIds:u,actionTargetChatId:m,actionTargetMessage:o,draft:Object(d.C)(e,t,p.MAIN_THREAD_ID),animationLevel:e.settings.byKey.animationLevel,isSelected:v,canScrollDown:v&&"thread"===g,lastSyncTime:e.lastSyncTime,...c&&{lastMessageOutgoingStatus:Object(d.gb)(e,n.lastMessage)},...b&&{privateChatUser:Object(d.Jb)(e,b)},...u&&{usersById:h}}},(e,t)=>Object(o.l)(t,["openChat","focusLastMessage"]))(({style:e,chatId:t,folderId:n,orderDiff:r,animationType:s,isPinned:o,chat:d,isMuted:u,privateChatUser:b,actionTargetUserIds:h,usersById:p,lastMessageSender:L,lastMessageOutgoingStatus:A,actionTargetMessage:D,actionTargetChatId:R,draft:F,animationLevel:_,isSelected:P,canScrollDown:U,lastSyncTime:B,openChat:q,focusLastMessage:H})=>{const $=Object(a.q)(null),[K,z,V]=Object(C.a)(),[Y,W,G]=Object(C.a)(),{lastMessage:X,typingStatus:J}=d||{},Q=X&&Object(l.gb)(X);Object(E.a)(t,Q?X.replyToMessageId:void 0,D);const Z=X&&!Object(l.N)(X)?Object(l.F)(X):void 0,ee=Object(N.a)(X?Object(l.E)(X,"micro"):void 0),te=Boolean(X&&Object(l.J)(X)),ne=Object(a.p)(()=>h?h.map(e=>p&&p[e]).filter(Boolean):void 0,[h,p]);Object(a.o)(()=>{const e=$.current;if(0!==_&&e){if(s===m.Opacity)e.style.opacity="0",Object(v.b)(()=>{e.classList.add("animate-opacity"),e.style.opacity="1"});else{if(s!==m.Move)return;e.style.transform=`translate3d(0, ${100*-r}%, 0)`,Object(v.b)(()=>{e.classList.add("animate-transform"),e.style.transform=""})}setTimeout(()=>{Object(v.b)(()=>{e.classList.remove("animate-opacity","animate-transform"),e.style.opacity="",e.style.transform=""})},200+c.c)}},[_,r,s]);const ae=Object(a.m)(()=>{q({id:t,shouldReplaceHistory:!0}),P&&U&&H()},[P,U,q,t,H]);const re=Object(y.a)({chat:d,privateChatUser:b,handleDelete:function(){W(),z()},folderId:n,isPinned:o,isMuted:u}),ce=Object(f.a)();if(!d)return;const ie=Object(j.a)("Chat chat-item-clickable",Object(l.ob)(t)?"private":"group",P&&"selected");return a.a.createElement(S.a,{ref:$,className:ie,style:e,ripple:!i.l,contextActions:re,onClick:ae},a.a.createElement("div",{className:"status"},a.a.createElement(T.a,{chat:d,user:b,withOnlineStatus:!0,isSavedMessages:b&&b.isSelf,lastSyncTime:B})),a.a.createElement("div",{className:"info"},a.a.createElement("div",{className:"title"},a.a.createElement("h3",null,Object(g.a)(Object(l.k)(ce,d,b))),d.isVerified&&a.a.createElement(w.a,null),u&&a.a.createElement("i",{className:"icon-muted-chat"}),d.lastMessage&&a.a.createElement(M.a,{message:d.lastMessage,outgoingStatus:A})),a.a.createElement("div",{className:"subtitle"},function(){if(J&&X&&J.timestamp>1e3*X.date)return a.a.createElement(I.a,{typingStatus:J});if(F&&F.text.length)return a.a.createElement("p",{className:"last-message",dir:ce.isRtl?"auto":"ltr"},a.a.createElement("span",{className:"draft"},ce("Draft")),Object(g.a)(F.text));if(!X)return;if(Q){const e=d&&(Object(l.mb)(d)||X.senderId===X.chatId)?d:L;return a.a.createElement("p",{className:"last-message",dir:ce.isRtl?"auto":"ltr"},Object(g.a)(Object(O.a)(ce,X,e,ne,D,R,{asPlain:!0})))}const e=Object(l.K)(ce,t,L);return a.a.createElement("p",{className:"last-message",dir:ce.isRtl?"auto":"ltr"},e&&a.a.createElement(a.a.Fragment,null,a.a.createElement("span",{className:"sender-name"},Object(g.a)(e)),a.a.createElement("span",{className:"colon"},":")),function(e,t,n,r){if(!n)return Object(g.a)(Object(l.O)(e,t));return a.a.createElement("span",{className:"media-preview"},a.a.createElement("img",{src:n,alt:"",className:r?"round":void 0}),Object(l.Q)(t)&&a.a.createElement("i",{className:"icon-play"}),Object(g.a)(Object(l.O)(e,t,!0)))}(ce,X,ee||Z,te))}(),a.a.createElement(x,{chat:d,isPinned:o,isMuted:u}))),Y&&a.a.createElement(k.a,{isOpen:K,onClose:V,onCloseAnimationEnd:G,chat:d}))})),R=n(13),F=n(22),_=n(129);n(221);var P,U=Object(a.h)(Object(r.h)((e,{folderId:t,folderType:n})=>({chatFolder:t&&"folder"===n?Object(d.j)(e,t):void 0,animatedEmoji:Object(d.c)(e,"📂")}))(({chatFolder:e,animatedEmoji:t,foldersDispatch:n,onScreenSelect:r})=>{const c=Object(f.a)(),s=Object(a.m)(()=>{n({type:"editFolder",payload:e}),r(R.n.FoldersEditFolderFromChatList)},[e,n,r]);return a.a.createElement("div",{className:"EmptyFolder"},a.a.createElement("div",{className:"sticker"},t&&a.a.createElement(_.a,{sticker:t})),a.a.createElement("h3",{className:"title",dir:"auto"},c("FilterNoChatsToDisplay")),a.a.createElement("p",{className:"description",dir:"auto"},c(e?"ChatList.EmptyChatListFilterText":"Chat.EmptyChat")),e&&n&&r&&a.a.createElement(F.a,{ripple:!i.l,fluid:!0,pill:!0,onClick:s,size:"smaller",isRtl:c.isRtl},a.a.createElement("i",{className:"icon-settings"}),c("ChatList.EmptyChatListEditFilter")))}));!function(e){e.all="active",e.archived="archived"}(P||(P={}));t.a=Object(a.h)(Object(r.h)((e,{folderType:t,folderId:n})=>{const{chats:{listIds:a,byId:r,orderedPinnedIds:c},users:{byId:i},lastSyncTime:s}=e,o="folder"!==t?P[t]:void 0,l=n?Object(d.j)(e,n):void 0;return{chatsById:r,usersById:i,lastSyncTime:s,notifySettings:Object(d.fb)(e),notifyExceptions:Object(d.eb)(e),...o?{listIds:a[o],orderedPinnedIds:c[o]}:{chatFolder:l}}},(e,t)=>Object(o.l)(t,["loadMoreChats","preloadTopChatMessages","openChat","openNextChat"]))(({folderType:e,folderId:t,isActive:n,chatFolder:r,chatsById:d,usersById:f,listIds:p,orderedPinnedIds:O,lastSyncTime:g,foldersDispatch:v,notifySettings:j,notifyExceptions:E,onScreenSelect:y,loadMoreChats:C,preloadTopChatMessages:N,openChat:T,openNextChat:w})=>{const[I,M]=Object(a.p)(()=>"folder"===e&&r?Object(l.Gb)(d,f,r,j,E):[p,O],[e,r,d,f,j,E,p,O]),[k,S]=Object(a.p)(()=>{if(!I||"folder"===e&&!r)return[];const t=Object(l.Fb)(d,I,M,e),n=[...t.pinnedChats,...t.otherChats],a=n.map(({id:e})=>e);return[n.reduce((e,t,n)=>(e[t.id]=n,e),{}),a]},[I,M,e,r,d]),L=Object(s.a)(k),A=Object(a.p)(()=>k&&L?Object(o.i)(k,(e,t)=>e-(void 0!==L[t]?L[t]:1/0)):{},[k,L]),x=Object(a.m)(()=>{C({listType:"archived"===e?"archived":"active"})},[C,e]),[R,F]=Object(u.a)(g?x:void 0,S,void 0,c.m,"all"===e&&!c.a),_=R&&Object(l.Fb)(d,R,M,e);Object(a.n)(()=>{g&&"all"===e&&N()},[g,e,N]);const P=function(e){const t=Object(a.m)(t=>e[t]<0,[e]),n=Object(a.m)(t=>e[t]>0,[e]),r=Object.keys(e).map(Number),c=r.filter(t).length,i=r.filter(n).length;return Object(a.m)(a=>{const r=e[a];return 0===r?m.None:r===1/0||r===-1/0||t(a)&&c<=i||n(a)&&i{const e=e=>{if(n&&S){if(i.i&&(i.f&&e.metaKey||!i.f&&e.ctrlKey)&&e.code.startsWith("Digit")){const[,t]=e.code.match(/Digit(\d)/)||[];if(!t)return;const n=Number(t)-1;if(n>S.length-1)return;T({id:S[n],shouldReplaceHistory:!0})}if(e.altKey){const t="ArrowDown"===e.key?1:"ArrowUp"===e.key?-1:void 0;if(!t)return;e.preventDefault(),w({targetIndexDelta:t,orderedIds:S})}}};return document.addEventListener("keydown",e,!1),()=>{document.removeEventListener("keydown",e,!1)}}),a.a.createElement(b.a,{className:"chat-list custom-scroll",items:R,onLoadMore:F,preloadBackwards:c.m,noFastList:!0,noScrollRestore:!0},R&&R.length&&_?function(){const e=S.indexOf(R[0]),n=e+_.pinnedChats.length;return a.a.createElement("div",{className:"scroll-container",style:i.b?`height: ${S.length*c.k}px`:void 0,teactFastList:!0},_.pinnedChats.map(({id:n},r)=>a.a.createElement(D,{key:n,teactOrderKey:r,chatId:n,isPinned:!0,folderId:t,animationType:P(n),orderDiff:A[n],style:`top: ${(e+r)*c.k}px;`})),_.otherChats.map((e,r)=>a.a.createElement(D,{key:e.id,teactOrderKey:Object(l.i)(e),chatId:e.id,folderId:t,animationType:P(e.id),orderDiff:A[e.id],style:`top: ${(n+r)*c.k}px;`})))}():R&&!R.length?a.a.createElement(U,{folderId:t,folderType:e,foldersDispatch:v,onScreenSelect:y}):a.a.createElement(h.a,{key:"loading"}))}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return g}));var a=n(0),r=n(8),c=n(2),i=n(4),s=n(54);function o(e,t){const n=t.username.toLowerCase(),a=Object(i.bb)(t),r=a&&a.toLowerCase(),c=e.toLowerCase();return n.startsWith(c)||r&&Object(s.a)(r,c)}var l=n(135),d=n(25),u=n(3),m=n(10);const b=Object(m.h)(e=>e(),500,!0),h=/(
|)/g,f=/ /g,p=/(
|<\/div>)/gi,O=new RegExp("(^|\\s)@[\\w\\d_-]*$","gi");function g(e,t,n,s=c.z,m,g,v,j){const[E,y,C]=Object(d.a)(),[N,T]=Object(a.r)(""),[w,I]=Object(a.r)(),M=Object(a.p)(()=>(g||[]).map(e=>j&&j[e]).filter(Boolean),[g,j]),k=Object(a.m)((e,t)=>{(m||g)&&j?b(()=>{const n=(t?M:[]).filter(t=>!e||o(e,t)),a=(m||[]).map(({userId:e})=>j[e]).filter(t=>!(!t||t.id===v)&&(!e||o(e,t)));I(Object(u.o)(n.concat(a)))}):I(void 0)},[v,m,g,M,j]);Object(a.n)(()=>{if(!e||!t.length)return void C();const n=t.includes("@")&&function(e){const t=e.replace(f," ").replace(h,"\n").replace(p,"").replace(/\n$/i,"").match(O);return t?t[0].trim():void 0}(t);if(n){const e=n?n.substr(1):"";T(e),k(e,function(e){return e.startsWith("@")}(t))}else C()},[e,t,k,y,C]),Object(a.n)(()=>{w&&w.length?y():C()},[y,C,w]);const S=Object(a.m)((e,a=!1)=>{if(!e.username&&!Object(i.ab)(e))return;const c=e.username?"@"+e.username:`${Object(i.ab)(e)}`,o=t.lastIndexOf("@");if(-1!==o){n(`${t.substr(0,o)}${c} `);const e=document.getElementById(s);requestAnimationFrame(()=>{Object(l.a)(e,a)})}C()},[t,s,n,C]);return{isMentionTooltipOpen:E,mentionFilter:N,closeMentionTooltip:C,insertMention:S,mentionFilteredUsers:w}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var a=n(0),r=n(170),c=n(53),i=n(16),s=n(32);const o=new Map;function l(e){const t=Object(a.q)();let n=!1;Object(c.a)(()=>{if(n=!0,t.current=void 0,!e)return;const a=new Image;if(a.src=e,!a.width)return;const c=Object(i.f)(a);Object(r.a)(c.getContext("2d"),0,0,c.width,c.height,2,2),t.current=c.toDataURL()},[e]);const l=function(e,t=!1,n){const c=Object(a.q)(e?o.get(e):void 0),l=Object(a.q)(),d=Object(s.a)();return l.current&&t&&(clearTimeout(l.current),l.current=void 0),Object(a.n)(()=>{if(!e||c.current||t)return;const a=new Image;a.onload=()=>{const t=Object(i.f)(a);Object(r.a)(t.getContext("2d"),0,0,t.width,t.height,2,2);const n=t.toDataURL();c.current=n,d(),o.size>=1e3&&o.clear(),o.set(e,n)},n?l.current=window.setTimeout(()=>{a.src=e},n):a.src=e},[e,n,d,t]),c.current}(e||void 0,Boolean(t.current));return t.current||!n&&l||e||void 0}},,function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},,,,function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},,,,function(e,t,n){},function(e,t,n){},,,,function(e,t,n){},function(e,t,n){},function(e,t,n){},,,,function(e,t,n){},function(e,t,n){},,,,,,,,,,function(e,t,n){},,,,,,function(e,t,n){},,,,,,,,function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){}])]); +//# sourceMappingURL=0.1ebe794c83bdc1b89fad.js.map \ No newline at end of file diff --git a/dist/0.1ebe794c83bdc1b89fad.js.map b/dist/0.1ebe794c83bdc1b89fad.js.map new file mode 100644 index 00000000..eff04542 --- /dev/null +++ b/dist/0.1ebe794c83bdc1b89fad.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack:///./src/components/ui/ListItem.tsx","webpack:///./src/hooks/useIntersectionObserver.ts","webpack:///./src/hooks/useMedia.ts","webpack:///./src/components/common/PrivateChatInfo.tsx","webpack:///./src/components/ui/Modal.tsx","webpack:///./src/util/trapFocus.ts","webpack:///./src/components/ui/Transition.tsx","webpack:///./src/components/common/Avatar.tsx","webpack:///./src/components/ui/InfiniteScroll.tsx","webpack:///./src/components/ui/FloatingActionButton.tsx","webpack:///./src/hooks/useTransitionForMedia.ts","webpack:///./src/components/common/helpers/mediaDimensions.ts","webpack:///./src/components/common/AnimatedSticker.tsx","webpack:///./src/components/ui/ConfirmDialog.tsx","webpack:///./src/components/common/NothingFound.tsx","webpack:///./src/components/right/hooks/useAsyncRendering.ts","webpack:///./src/hooks/useMediaWithDownloadProgress.ts","webpack:///./src/components/ui/ProgressSpinner.tsx","webpack:///./src/components/common/StickerButton.tsx","webpack:///./src/components/ui/Radio.tsx","webpack:///./src/components/ui/RadioGroup.tsx","webpack:///./src/hooks/useBackgroundMode.ts","webpack:///./src/components/ui/Portal.ts","webpack:///./src/components/common/AnimatedEmoji.tsx","webpack:///./src/components/common/GroupChatInfo.tsx","webpack:///./src/util/fastSmoothScroll.ts","webpack:///./src/hooks/useInfiniteScroll.ts","webpack:///./src/util/cycleRestrict.ts","webpack:///./src/util/focusEditableElement.ts","webpack:///./src/util/captureEvents.ts","webpack:///./src/components/common/VerifiedIcon.tsx","webpack:///./src/hooks/useCurrentOrPrev.ts","webpack:///./src/util/safePlay.ts","webpack:///./src/hooks/useBuffering.ts","webpack:///./src/components/middle/composer/helpers/parseMessageInput.ts","webpack:///./src/components/middle/composer/DropTarget.tsx","webpack:///./src/components/middle/composer/DropArea.tsx","webpack:///./src/hooks/reducers/useFoldersReducer.ts","webpack:///./src/components/common/PickerSelectedItem.tsx","webpack:///./src/util/fastSmoothScrollHorizontal.ts","webpack:///./src/hooks/useHorizontalScroll.ts","webpack:///./src/hooks/useEnsureMessage.ts","webpack:///./src/hooks/useContextMenuHandlers.ts","webpack:///./src/components/common/helpers/renderMessageText.tsx","webpack:///./src/hooks/useVideoCleanup.ts","webpack:///./src/hooks/useMouseInside.ts","webpack:///./src/hooks/useReducer.ts","webpack:///./src/components/ui/SearchInput.tsx","webpack:///./src/util/resetScroll.ts","webpack:///./src/components/common/TypingStatus.tsx","webpack:///./src/components/common/DeleteChatModal.tsx","webpack:///./src/components/ui/ShowTransition.tsx","webpack:///./src/util/patchSafariProgressiveAudio.ts","webpack:///./src/hooks/useLayoutEffectWithPrevDeps.ts","webpack:///./src/components/common/Document.tsx","webpack:///./src/components/common/StickerSetModal.async.tsx","webpack:///./src/hooks/useCanvasBlur.ts","webpack:///./src/lib/fastBlur.js","webpack:///./src/components/middle/composer/TextFormatter.tsx","webpack:///./src/util/clipboard.ts","webpack:///./src/components/common/Media.tsx","webpack:///./src/components/common/Picker.tsx","webpack:///./src/components/common/Audio.tsx","webpack:///./src/util/waveform.ts","webpack:///./src/components/common/helpers/waveform.ts","webpack:///./src/components/ui/Tab.tsx","webpack:///./src/components/ui/TabList.tsx","webpack:///./src/util/getReadableErrorText.ts","webpack:///./src/util/cssAnimationEndListeners.ts","webpack:///./src/hooks/useChatContextActions.ts","webpack:///./src/components/common/LastMessageMeta.tsx","webpack:///./src/components/common/MessageOutgoingStatus.tsx","webpack:///./src/hooks/useContextMenuPosition.ts","webpack:///./src/hooks/usePrevDuringAnimation.ts","webpack:///./src/hooks/useAudioPlayer.ts","webpack:///./src/util/audioPlayer.ts","webpack:///./src/util/download.ts","webpack:///./src/components/common/File.tsx","webpack:///./src/hooks/useMediaDownload.ts","webpack:///./src/components/ui/Notification.tsx","webpack:///./src/components/middle/composer/helpers/selection.ts","webpack:///./src/components/middle/composer/hooks/useEmojiTooltip.ts","webpack:///./src/components/middle/composer/EmojiTooltip.async.tsx","webpack:///./src/components/middle/composer/MessageInput.tsx","webpack:///./src/components/common/WebLink.tsx","webpack:///./src/components/left/main/hooks/useChatAnimationType.ts","webpack:///./src/components/left/main/Badge.tsx","webpack:///./src/components/left/main/Chat.tsx","webpack:///./src/components/left/main/EmptyFolder.tsx","webpack:///./src/components/left/main/ChatList.tsx","webpack:///./src/components/middle/composer/helpers/searchUserName.ts","webpack:///./src/components/middle/composer/hooks/useMentionTooltip.ts","webpack:///./src/hooks/useBlur.ts","webpack:///./src/hooks/useBlurSync.ts"],"names":["ListItem","props","ref","buttonRef","icon","className","style","children","disabled","ripple","narrow","inactive","focus","destructive","multiline","isStatic","contextActions","onClick","containerRef","useRef","isTouched","markIsTouched","unmarkIsTouched","useFlag","isContextMenuOpen","contextMenuPosition","handleBeforeContextMenu","handleContextMenu","handleContextMenuClose","handleContextMenuHide","useContextMenuHandlers","getTriggerElement","useCallback","current","getRootElement","closest","getMenuElement","querySelector","positionX","positionY","menuStyle","useContextMenuPosition","handleClick","e","IS_TOUCH_ENV","fastRaf","handleMouseDown","button","lang","useLang","fullClassName","buildClassName","dir","isRtl","undefined","role","tabIndex","onMouseDown","onContextMenu","isOpen","autoClose","onClose","onCloseAnimationEnd","map","action","key","title","handler","useIntersectionObserver","rootRef","throttleMs","debounceMs","shouldSkipFirst","margin","threshold","isDisabled","rootCallback","controllerRef","rootCallbackRef","freezeFlagsRef","onUnfreezeRef","freeze","unfreeze","useHeavyAnimationCheck","useEffect","observer","disconnect","callbacks","clear","observe","target","targetCallback","Map","entriesAccumulator","observerCallbackSync","entries","Array","from","values","forEach","entry","callback","get","scheduler","throttle","debounce","observerCallback","IntersectionObserver","set","root","rootMargin","initController","controller","delete","unobserve","useOnIntersect","targetRef","useIsIntersecting","isIntersecting","setIsIntersecting","useState","mediaHash","noLoad","mediaFormat","ApiMediaFormat","BlobUrl","cacheBuster","delay","mediaData","mediaLoader","forceUpdate","useForceUpdate","startedAt","Date","now","then","spentTime","setTimeout","memo","withGlobal","global","userId","forceShowSelf","lastSyncTime","serverTimeOffset","user","selectUser","isSavedMessages","isSelf","areMessagesLoaded","Boolean","selectChatMessages","setGlobal","actions","pick","typingStatus","avatarSize","status","withMediaViewer","withUsername","withFullInfo","withUpdatingStatus","noStatusOrTyping","noRtl","loadFullUser","openMediaViewer","id","fullName","getUserFullName","handleAvatarViewerOpen","hasPhoto","stopPropagation","avatarOwnerId","origin","MediaViewerOrigin","ProfileAvatar","MiddleHeaderAvatar","size","renderText","isVerified","isUserOnline","username","getUserStatus","Modal","header","hasCloseButton","noBackdrop","onEnter","shouldSkipHistoryAnimations","shouldRender","transitionClassNames","useShowTransition","modalRef","captureKeyboardListeners","onEsc","element","handleKeyDown","preventDefault","focusableElements","querySelectorAll","length","currentFocusedIndex","findIndex","em","isSameNode","document","activeElement","newFocusedIndex","shiftKey","addEventListener","removeEventListener","trapFocus","forceClose","useHistoryBack","useEffectWithPrevDeps","prevIsOpen","body","classList","toggle","dispatchHeavyAnimationEvent","remove","Portal","Button","round","color","ariaLabel","CLEANED_UP","Symbol","Transition","activeKey","name","direction","renderCount","shouldRestoreHeight","shouldCleanup","cleanupExceptionKey","onStart","onStop","animationLevel","getGlobal","settings","byKey","rendersRef","prevActiveKey","usePrevious","activeKeyChanged","useLayoutEffect","cleanup","container","childElements","add","childNodes","isBackwards","keys","Object","Number","prevActiveIndex","indexOf","activeIndex","node","i","HTMLElement","dispatchHeavyAnimationStop","requestAnimationFrame","onAnimationEnd","height","clientHeight","toNode","firstChild","waitForAnimationEnd","flexBasis","renders","contents","fill","render","chat","text","withOnlineStatus","isDeleted","isDeletedUser","imageHash","getChatAvatarHash","dataUri","useMedia","DataUri","shouldRenderFullMedia","useTransitionForMedia","content","src","alt","decoding","userFullName","getFirstLetters","getChatTitle","isChatPrivate","isOnline","getUserColorKey","senderId","data-test-sender-id","IS_TEST","InfiniteScroll","onLoadMore","onScroll","onKeyDown","items","itemSelector","preloadBackwards","sensitiveArea","noScrollRestore","noScrollRestoreOnTop","noFastList","stateRef","loadMoreBackwards","loadMoreForwards","useMemo","noScroll","LoadMoreDirection","Backwards","Forwards","scrollHeight","state","newScrollTop","listItemElements","currentAnchor","includes","scrollTop","getBoundingClientRect","top","currentAnchorTop","nextAnchor","resetScroll","isScrollTopJustUpdated","handleScroll","listLength","offsetHeight","isNearTop","offsetTop","isNearBottom","isUpdated","nextAnchorTop","newAnchorTop","offsetParent","teactFastList","FloatingActionButton","isShown","buttonClassName","SPEED","fast","slow","speed","noAnimate","isMediaLoaded","willAnimate","shouldRenderThumb","setShouldRenderThumb","MEDIA_VIEWER_MEDIA_QUERY","REM","parseInt","getComputedStyle","documentElement","fontSize","ROUND_VIDEO_DIMENSIONS","AVATAR_FULL_DIMENSIONS","width","LIKE_STICKER_ID","DEFAULT_MEDIA_DIMENSIONS","cachedMaxWidthOwn","cachedMaxWidth","cachedMaxWidthNoAvatar","getAvailableWidth","fromOwnMessage","isForwarded","isWebPagePhoto","noAvatars","extraPaddingRem","regularMaxWidth","IS_SINGLE_COLUMN_LAYOUT","windowWidth","windowSize","Math","min","getMaxMessageWidthRem","calculateDimensionsForMessageMedia","isGif","aspectRatio","calculateDimensions","getAvailableHeight","getMediaViewerAvailableDimensions","withFooter","isVideo","mql","window","matchMedia","windowHeight","occupiedHeightRem","matches","calculateInlineImageDimensions","photo","getPhotoInlineDimensions","calculateVideoDimensions","video","getVideoDimensions","getPictogramDimensions","getDocumentThumbnailDimensions","smaller","getStickerDimensions","sticker","baseWidth","STICKER_SIZE_INLINE_MOBILE_FACTOR","STICKER_SIZE_INLINE_DESKTOP_FACTOR","calculatedHeight","calculateMediaViewerDimensions","availableWidth","availableHeight","mediaWidth","mediaHeight","calculatedWidth","lottiePromise","RLottie","async","ensureLottie","default","animationData","play","playSegment","noLoop","quality","isLowPriority","onLoad","animation","setAnimation","wasPlaying","isFrozen","playRef","playSegmentRef","exec","newAnimation","setSpeed","destroy","playAnimation","shouldRestart","goToAndPlay","pauseAnimation","pause","freezeAnimation","isPlaying","unfreezeAnimation","unfreezeAnimationOnRaf","useBackgroundMode","textParts","confirmLabel","confirmHandler","confirmIsDestructive","isButtonsInOneRow","split","textPart","isText","description","useAsyncRendering","dependencies","shouldRenderRef","timeoutRef","useOnChange","clearTimeout","isStreaming","Stream","IS_PROGRESSIVE_SUPPORTED","Progressive","downloadProgress","setDownloadProgress","startedAtRef","handleProgress","progress","RADIUSES","s","m","l","xl","square","transparent","noCross","radius","circleRadius","STROKE_WIDTH","borderRadius","circumference","PI","svg","firstElementChild","strokeDashOffset","max","setAttribute","toString","innerHTML","observeIntersection","clickArg","onUnfaveClick","localMediaHash","stickerSelector","thumbDataUri","thumbnail","previewBlobUrl","shouldPlay","lottieData","isAnimated","Lottie","isAnimationLoaded","markLoaded","unmarkLoaded","canAnimatedPlay","shouldRenderPreview","previewTransitionClassNames","emoji","data-sticker-id","label","subLabel","value","checked","hidden","isLoading","onChange","type","Spinner","options","selected","loadingOption","handleChange","event","currentTarget","option","onBlur","onFocus","hasFocus","containerId","elementRef","createElement","appendChild","TeactDOM","removeChild","WIDTH","large","medium","small","AnimatedEmoji","forceLoadPreview","markAnimationLoaded","playKey","setPlayKey","String","random","chatId","selectChat","onlineCount","selectChatOnlineCount","withChatType","loadFullChat","isSuperGroup","isChatSuperGroup","isMin","isRestricted","getChatTypeString","handle","groupStatus","chatTypeString","membersCount","getGroupStatus","onlineStatus","renderStatusOrTyping","isAnimating","fastSmoothScroll","position","maxDistance","FAST_SMOOTH_MAX_DISTANCE","forceDirection","forceDuration","forceCurrentContainerHeight","scrollFrom","elementTop","offset","FocusDirection","Up","Down","calculateScrollFrom","Static","ANIMATION_LEVEL_MIN","scrollWithJs","isAnimatingScroll","elementHeight","currentScrollTop","containerHeight","targetContainerHeight","dataset","normalHeight","path","remainingPath","absPath","abs","transition","FAST_SMOOTH_SHORT_TRANSITION_MAX_DISTANCE","shortTransition","longTransition","duration","FAST_SMOOTH_MIN_DURATION","FAST_SMOOTH_MAX_DURATION","startAt","onHeavyAnimationStop","animateSingle","t","currentPath","getViewportSlice","sourceIds","offsetId","listSlice","index","indexForDirection","to","newViewportIds","slice","areSomeLocal","areAllLocal","listIds","forceFullPreload","lastParamsRef","viewportIdsRef","prevListIds","prevIsDisabled","areSortedArraysEqual","viewportIds","getMore","cycleRestrict","floor","focusEditableElement","force","selection","getSelection","range","createRange","lastChild","nodeValue","selectNodeContents","collapse","removeAllRanges","addRange","SwipeDirection","captureEvents","captureEvent","currentSwipeAxis","hasMoved","onCapture","excludedClosestSelector","onMove","onRelease","pageX","touches","pageY","withCursor","dragOffsetX","dragOffsetY","onDrag","onSwipe","xAbs","yAbs","Left","Right","processSwipe","passive","VerifiedIcon","useCurrentOrPrev","shouldSkipUndefined","shouldForceCurrent","prev","mediaEl","catch","err","DEBUG","console","warn","noInitiallyBuffered","isBuffered","setIsBuffered","bufferedProgress","setBufferedProgress","setIsBufferedDebounced","handleBuffering","media","isSafariPatchInProgress","buffered","end","readyState","currentTime","bufferingHandlers","onLoadedData","onPlaying","onLoadStart","onPause","onTimeUpdate","onProgress","checkBuffering","ENTITY_CLASS_BY_NODE_NAME","B","ApiMessageEntityTypes","Bold","STRONG","I","Italic","EM","U","Underline","S","Strike","STRIKE","DEL","CODE","Code","PRE","Pre","BLOCKQUOTE","Blockquote","parseMessageInput","html","fragment","parsedHtml","IS_EMOJI_SUPPORTED","replace","parseMarkdown","innerText","trim","textIndex","recursionDeepness","entities","addEntity","entity","rawText","nodeName","anchor","entityType","MentionName","Url","href","startsWith","Email","Phone","textContent","TextUrl","getEntityTypeFromNode","rawIndex","substring","url","getEntityDataFromNode","push","hasChildNodes","isQuick","onFileSelect","isHovered","markHovered","unmarkHovered","onDrop","onDragEnter","onDragLeave","relatedTarget","toTarget","DropAreaState","withQuick","onHide","hideTimeoutRef","prevWithQuick","captureEscKeyListener","handleFilesDrop","dataTransfer","dt","files","handleQuickFilesDrop","handleDragLeave","fromTarget","onDragOver","INCLUDED_CHAT_TYPES","EXCLUDED_CHAT_TYPES","INCLUDE_FILTER_FIELDS","EXCLUDE_FILTER_FIELDS","selectChatFilters","mode","selectTemp","selectedChatIds","selectedChatTypes","includedChatIds","includeFilters","folder","filter","excludedChatIds","excludeFilters","getSuggestedFolderName","filters","bots","groups","channels","contacts","nonContacts","INITIAL_STATE","chatFilter","foldersReducer","payload","omit","folderId","error","useReducer","chatOrUserId","isMinimized","canClose","iconElement","titleText","getUserFirstOrLastName","fastSmoothScrollHorizontal","left","IS_IOS","scrollLeft","offsetWidth","containerWidth","scrollWidth","animate","scrollTo","behavior","deltaX","deltaY","messageId","message","replyOriginForId","loadMessage","getDispatch","loadMessageThrottled","throttled","contextMenuCounter","isMenuDisabled","shouldDisableOnLink","shouldDisableOnLongTap","setIsContextMenuOpen","setContextMenuPosition","x","clientX","y","clientY","timer","clearLongPressTimer","startLongPressTimer","contains","originalEvent","cancelClickOnce","stopImmediatePropagation","emulateContextMenuEvent","renderMessageText","highlight","shouldRenderHqEmoji","formattedText","getMessageText","renderTextWithEntities","organizeEntities","organizedEntityIndexes","Set","organizedEntities","has","organizedEntity","organizeEntity","organizedIndexes","nestedEntities","parsedEntity","isChanged","organizedIndex","shouldRenderAsHtml","renderMessagePart","result","deleteLineBreakAfterPre","renderEntity","textPartStart","textPartEnd","isLastEntity","renderResult","textBefore","textBeforeLength","substr","entityStartIndex","entityEndIndex","entityContent","nestedEntityContent","nestedIndex","nestedEntity","nestedEntityIndex","nestedResult","nestedEntityEndIndex","newEntity","rawEntityText","renderedContent","join","getLinkUrl","processEntityAsHtml","entityText","BotCommand","handleBotCommandClick","Hashtag","Cashtag","handleHashtagClick","rel","Mention","processEntity","isArray","textAfter","arrayIndex","c","emojiFilter","sendBotCommand","command","setLocalTextSearchQuery","query","searchTextMessagesLocal","useVideoCleanup","videoRef","videoEl","load","closeTimeout","useMouseInside","menuCloseTimeout","isMouseInside","reducer","initialState","reducerRef","setState","currentState","parentContainerClassName","inputId","focused","placeholder","autoComplete","onReset","inputRef","isInputFocused","markInputFocused","unmarkInputFocused","blur","overflow","typingUser","typingUserName","isPrivateChat","isChatWithSelf","selectIsChatWithSelf","getPrivateChatUserId","isBot","isUserBot","isSupport","canDeleteForAll","contactName","isChannel","isChatChannel","isBasicGroup","isChatBasicGroup","currentUserId","leaveChannel","deleteHistory","deleteChannel","deleteChatUser","blockContact","chatTitle","handleDeleteMessageForAll","shouldDeleteForAll","handleDeleteAndStop","contactId","accessHash","handleDeleteChat","isCreator","ShowTransition","isCustom","prevChildren","fromChildrenRef","patchSafariProgressiveAudio","audioEl","patchedForSafari","patchForSafariInProgress","paused","once","cb","debugKey","prevDeps","uploadProgress","withDate","datetime","sender","isSelected","isSelectable","onCancelUpload","onMediaClick","onDateClick","extension","getDocumentExtension","fileName","timestamp","mediaType","isDownloadAllowed","setIsDownloadAllowed","useMediaWithDownloadProgress","getMessageMediaHash","isUploading","isTransferring","transferProgress","getMediaTransferState","hasPreview","getDocumentHasPreview","getMessageMediaThumbDataUri","localBlobUrl","previewData","isAllowed","handleDateClick","download","thumbnailDataUri","actionIcon","isMessageDocumentVideo","StickerSetModal","useModuleLoader","Bundles","Extra","useCanvasBlur","withRaf","canvasRef","canvas","img","Image","processBlur","ctx","getContext","alpha","IS_CANVAS_FILTER_SUPPORTED","drawImage","RADIUS","fastBlur","onload","mul_table","shg_table","boxBlurCanvasRGB","context","top_x","top_y","iterations","isNaN","imageData","getImageData","pixels","data","rsum","gsum","bsum","p","p1","p2","yp","yi","yw","wm","hm","rad1","r","g","b","mul_sum","shg_sum","vmin","vmax","putImageData","TEXT_FORMAT_BY_TAG_NAME","fragmentEl","anchorPosition","selectedRange","linkUrlInputRef","isLinkControlOpen","openLinkControl","closeLinkControl","linkUrl","setLinkUrl","isEditingLink","setIsEditingLink","inputClassName","setInputClassName","selectedTextFormats","setSelectedTextFormats","useVirtualBackdrop","selectedFormats","parentElement","commonAncestorContainer","EDITABLE_INPUT_ID","textFormat","tagName","getSelectedText","getSelectedElement","updateInputStyles","input","getFormatButtonClassName","some","fKey","monospace","strikethrough","handleBoldText","execCommand","bold","handleItalicText","italic","handleUnderlineText","underline","handleStrikethroughText","replaceWith","handleMonospaceText","handleLinkUrlConfirm","formattedLinkUrl","encodeURI","restoreSelection","KeyK","KeyB","KeyU","KeyI","KeyM","KeyS","code","altKey","ctrlKey","metaKey","linkUrlConfirmClassName","inputMode","CLIPBOARD_ITEM_SUPPORTED","navigator","clipboard","ClipboardItem","textCopyEl","copyTextToClipboard","str","rangeToRestore","rangeCount","getRangeAt","select","copyImageToClipboard","imageUrl","imageEl","toBlob","copyBlobToClipboard","pngBlob","write","idPrefix","mediaBlobUrl","getMessageVideo","formatMediaDuration","itemIds","selectedIds","filterValue","filterPlaceholder","notFoundText","searchInputId","onSelectedIdsChange","onFilterChange","shouldMinimize","handleItemClick","newSelectedIds","splice","handleFilterChange","useInfiniteScroll","MIN_SPIKES","MAX_SPIKES","renderSeekline","playProgress","handleStartSeek","handleSeek","handleStopSeek","onMouseMove","onMouseUp","theme","senderTitle","date","onPlay","onReadMedia","audio","voice","isMediaUnread","isVoice","isSeeking","isActivated","setIsActivated","shouldDownload","getMessageMediaFormat","useBuffering","playPause","setCurrentTime","useAudioPlayer","getMessageKey","getMediaDuration","isMessageLocal","isDownloadStarted","directDownloadProgress","handleDownloadClick","useMediaDownload","getMessageAudioCaption","isLoadingForPlaying","shouldRenderSpinner","spinnerClassNames","handleButtonClick","seekBar","seekHandlers","isOwn","isOwnMessage","renderedWaveform","waveform","fillColor","fillOwnColor","progressFillColor","progressFillOwnColor","durationFactor","spikesCount","decodedWaveform","encoded5bit","bitsCount","valuesCount","bitsData","byteIndex","bitShift","lastByteIndex","lastBitShift","lastValue","decodeWaveform","Uint8Array","spikes","peak","fitCount","newData","springFactor","leftFiller","rightFiller","idx","val","interpolateArray","fillStyle","progressFillStyle","scale","item","globalAlpha","spikeHeight","beginPath","moveTo","arcTo","closePath","roundedRectangle","toDataURL","renderWaveformToDataUri","draggable","renderWaveform","buttonClassNames","showSeekline","contentClassName","ProgressSpinner","getFirstLine","Link","formatPastTimeShort","performer","getSecondLine","formatMediaDateTime","renderAudio","renderVoice","active","badgeCount","isBadgeActive","previousActiveTab","tabRef","tab","indicator","prevTab","currentIndicator","shiftLeft","offsetLeft","scaleFactor","clientWidth","transform","tabs","activeTab","big","onSwitchTab","useHorizontalScroll","activeTabElement","newLeft","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","SERVICE_WORKER_DISABLED","CAPTION_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","getReadableErrorText","isSlowMode","textParams","extraPartIndex","errorMessage","reduce","acc","waitForTransitionEnd","propertyName","waitForEndEvent","animationName","eventType","detailedName","isHandled","handleAnimationEnd","TransitionEvent","AnimationEvent","privateChatUser","handleDelete","isPinned","isMuted","toggleChatPinned","updateChatMutedState","toggleChatArchived","toggleChatUnread","actionUnreadMark","unreadCount","hasUnreadMark","actionPin","actionMute","actionArchive","isChatArchived","getCanDeleteChat","outgoingStatus","Keys","extraPaddingX","extraTopPadding","setPositionX","setPositionY","setStyle","triggerEl","emptyRect","menuEl","rootEl","triggerRect","menuRect","rootRect","horizontalPostition","usePrevDuringAnimation","isCurrentPresent","isPrevPresent","trackId","originalDuration","handlers","onInit","onForcePlay","noPlaylist","setIsPlaying","isPlayingSync","setPlayProgress","register","eventName","proxy","isFinite","prevShouldPlay","prevSrc","audioProxy","tracks","currentTrackId","queue","stopCurrentAudio","currentTrack","Audio","handleEvent","nextTrackId","openAudioPlayer","parseMessageKey","nextTrack","safePlay","Proxy","createAudio","preload","IS_SAFARI","time","shouldRemoveFromQueue","track","h","filename","link","click","shouldSpinnerRender","getColorFromExtension","sizeString","getFileSizeString","setIsDownloadStarted","onDismiss","setIsOpen","timerRef","closeAndDismiss","ANIMATION_END_DELAY","handleMouseEnter","handleMouseLeave","onMouseEnter","onMouseLeave","isSelectionInsideInput","selectionRange","parentNode","emojiDataPromise","emojiRawData","emojiData","RE_EMOJI_SEARCH","RE_BR","RE_SPACE","RE_CLEAN_HTML","RegExp","useEmojiTooltip","recentEmojiIds","onUpdateHtml","baseEmojiKeywords","emojiKeywords","markIsOpen","unmarkIsOpen","byId","setById","keywords","setKeywords","byKeyword","setByKeyword","names","setNames","byName","setByName","shouldForceInsertEmoji","setShouldForceInsertEmoji","filteredEmojis","setFilteredEmojis","MEMO_EMPTY_ARRAY","recentEmojis","pickTruthy","emojis","uncompressEmoji","ensureEmojiData","byNative","buildCollectionByKey","baseEmojisByKeyword","mapValues","natives","emojisByKeyword","emojisByName","match","getEmojiCode","forceSend","endsWith","matched","matchedKeywords","keyword","sort","concat","flatten","matchedNames","unique","insertEmoji","textEmoji","isForce","atIndex","lastIndexOf","messageInput","getElementById","native","isEmojiTooltipOpen","closeEmojiTooltip","EmojiTooltip","MAX_INPUT_HEIGHT","currentChatId","threadId","selectCurrentMessageList","messageSendKeyCombo","replyingToId","selectReplyingToId","noTabCapture","isPollModalOpen","payment","isPaymentModalOpen","isAttachmentModalInput","editableInputId","forcedPlaceholder","shouldSetFocus","shouldSuppressFocus","shouldSuppressTextFormatter","onUpdate","onSuppressedFocus","onSend","editLastMessage","replyToNextMessage","cloneRef","isContextMenuOpenRef","isTextFormatterOpen","openTextFormatter","closeTextFormatter","textFormatterAnchorPosition","setTextFormatterAnchorPosition","setSelectedRange","updateInputHeight","useLayoutEffectWithPrevDeps","prevHtml","focusInput","handleCloseTextFormatter","empty","clearSelection","checkSelection","selectedText","parseEmojiOnlyString","START_TO_END","selectionRect","inputRect","willSend","clone","currentHeight","newHeight","transitionDuration","log","captureFirstTab","onTab","suppressFocus","contentEditable","targetIndexDelta","handleKeyUp","IS_ANDROID","closeContextMenuMouseListener","closeContextMenuKeyListener","handleMouseUp","onTouchCancel","onMessageClick","linkData","getMessageWebPage","getFirstLinkInMessage","domain","messageText","getMessageSummaryText","siteName","handleMessageClick","displayUrl","truncatedDescription","trimText","data-initial","ChatAnimationTypes","renderContent","unreadMentionsCount","formatIntegerCompact","lastMessage","replyToMessageId","isOutgoing","lastMessageSender","lastMessageAction","getMessageAction","actionTargetMessage","selectChatMessage","targetUserIds","actionTargetUserIds","targetChatId","actionTargetChatId","privateChatUserId","usersById","users","currentThreadId","messageListType","MAIN_THREAD_ID","selectIsChatMuted","selectNotifySettings","selectNotifyExceptions","draft","selectDraft","canScrollDown","lastMessageOutgoingStatus","selectOutgoingStatus","orderDiff","animationType","openChat","focusLastMessage","isDeleteModalOpen","openDeleteModal","closeDeleteModal","shouldRenderDeleteModal","markRenderDeleteModal","unmarkRenderDeleteModal","isAction","isActionMessage","useEnsureMessage","mediaThumbnail","getMessageSticker","isRoundVideo","getMessageRoundVideo","actionTargetUsers","Opacity","opacity","Move","shouldReplaceHistory","useChatContextActions","Avatar","LastMessageMeta","TypingStatus","actionOrigin","renderActionMessageText","asPlain","senderName","getMessageSenderName","blobUrl","renderMessageSummary","renderLastMessageOrTyping","DeleteChatModal","FolderTypeToListType","folderType","chatFolder","selectChatFolder","animatedEmoji","selectAnimatedEmoji","foldersDispatch","onScreenSelect","handleEditFolder","SettingsScreens","FoldersEditFolderFromChatList","fluid","pill","chats","chatsById","orderedPinnedIds","listType","notifySettings","notifyExceptions","isActive","loadMoreChats","preloadTopChatMessages","openNextChat","currentListIds","currentPinnedIds","prepareFolderListIds","orderById","orderedIds","newChatArrays","prepareChatList","singleList","pinnedChats","otherChats","newOrderedIds","prevOrderById","orderDiffById","order","Infinity","loadMoreOfType","CHAT_LIST_SLICE","ALL_CHATS_PRELOAD_DISABLED","chatArrays","getAnimationType","movesUp","movesDown","orderDiffIds","numberOfUp","numberOfDown","None","useChatAnimationType","IS_PWA","IS_MAC_OS","digit","viewportOffset","pinnedOffset","CHAT_HEIGHT_PX","teactOrderKey","getChatOrder","renderChats","Loading","searchUserName","usernameLowered","toLowerCase","fullNameLowered","filterLowered","searchWords","runThrottled","RE_USERNAME_SEARCH","useMentionTooltip","canSuggestMembers","groupChatMembers","topInlineBotIds","currentFilter","setCurrentFilter","usersToMention","setUsersToMention","topInlineBots","getFilteredUsers","withInlineBots","inlineBots","inlineBot","chatMembers","usernameFilter","getUsernameFilter","canSuggestInlineBots","insertMention","forceFocus","insertedHtml","isMentionTooltipOpen","mentionFilter","closeMentionTooltip","mentionFilteredUsers","cache","useBlurSync","blurredRef","imgToCanvas","blurredAsync","blurredDataUri","useBlur"],"mappings":"wGACA,kGAmMeA,IAvJiBC,IAC9B,MAAM,IACJC,EADI,UAEJC,EAFI,KAGJC,EAHI,UAIJC,EAJI,MAKJC,EALI,SAMJC,EANI,SAOJC,EAPI,OAQJC,EARI,OASJC,EATI,SAUJC,EAVI,MAWJC,EAXI,YAYJC,EAZI,UAaJC,EAbI,SAcJC,EAdI,eAeJC,EAfI,QAgBJC,GACEhB,EAGJ,IAAIiB,EAAeC,YAAuB,MACtCjB,IACFgB,EAAehB,GAEjB,MAAOkB,EAAWC,EAAeC,GAAmBC,eAE9C,kBACJC,EADI,oBACeC,EADf,wBAEJC,EAFI,kBAEqBC,EAFrB,uBAGJC,EAHI,sBAGoBC,GACtBC,YAAuBZ,GAAeF,GAEpCe,EAAoBC,YAAY,IAAMd,EAAae,QAAS,IAE5DC,EAAiBF,YACrB,IAAMd,EAAae,QAASE,QAAQ,kBACpC,IAGIC,EAAiBJ,YACrB,IAAMd,EAAae,QAASI,cAAc,kCAC1C,KAGI,UAAEC,EAAF,UAAaC,EAAWjC,MAAOkC,GAAcC,YACjDhB,EACAM,EACAG,EACAE,GAGIM,EAAcV,YAAaW,KAC3BnC,GAAaS,IAGjBA,EAAQ0B,GAEJC,MAAiBnC,IACnBY,IACAwB,YAAQvB,MAET,CAACd,EAAUa,EAAeJ,EAASR,EAAQa,IAExCwB,EAAkBd,YAAaW,IAC/BhC,GAAYiC,OAGZ5B,GAAgC,IAAb2B,EAAEI,QAAiB9B,GACxCS,EAAwBiB,GAET,IAAbA,EAAEI,SACC9B,EAGHyB,EAAYC,GAFZhB,EAAkBgB,MAKrB,CAAChC,EAAUK,EAAgBC,EAASS,EAAyBC,EAAmBe,IAE7EM,EAAOC,cAEPC,EAAgBC,YACpB,WACA9C,GACCU,GAAY,eACbN,GAAU,aACVC,GAAU,SACVF,GAAY,WACZG,GAA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AAIU,OAAS,KACX,MAAMX,EAAS6sB,YAAY5sB,GAC3BS,YAASV,EAAOK,WAAW,MAAO,EAAG,EAAGL,EAAOhpB,MAAOgpB,EAAOlvB,OAzBpD,EACI,GAyBb,MAAMi8C,EAAiB/sB,EAAO8N,YAE9B8e,EAAWtqD,QAAUyqD,EACrBxkD,IAEImkD,EAAMphD,MA7BO,KA8BfohD,EAAM7mD,QAER6mD,EAAMzlD,IAAI8K,EAASg7C,IAGjB3kD,EACF8U,EAAW5a,QAAUsW,OAAO9P,WAAW,KACrCm3B,EAAI5tB,IAAMN,GACT3J,GAEH63B,EAAI5tB,IAAMN,GAEX,CAACA,EAAS3J,EAAOG,EAAavD,IAE1B4nD,EAAWtqD,QCdG0qD,CAAQj7C,QAAWpO,EAAWgG,QAAQijD,EAAWtqD,UAEtE,OAAOsqD,EAAWtqD,UAAa+zB,GAAay2B,GAAiB/6C,QAAWpO,I","file":"0.1ebe794c83bdc1b89fad.js","sourcesContent":["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';\n\nimport './ListItem.scss';\n\ntype OnClickHandler = (e: React.MouseEvent) => void;\n\ntype MenuItemContextAction = {\n title: string;\n icon: string;\n destructive?: boolean;\n handler?: () => void;\n};\n\ntype OwnProps = {\n ref?: RefObject;\n buttonRef?: RefObject;\n icon?: string;\n className?: string;\n style?: string;\n children: any;\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 onClick?: OnClickHandler;\n};\n\nconst ListItem: FC = (props) => {\n const {\n ref,\n buttonRef,\n icon,\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 onClick,\n } = props;\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 { positionX, positionY, style: menuStyle } = 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 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
\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 { 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 } from '../lib/teact/teact';\n\nimport { ApiMediaFormat } from '../api/types';\n\nimport * as mediaLoader from '../util/mediaLoader';\nimport useForceUpdate from './useForceUpdate';\n\nexport default (\n mediaHash: string | false | undefined,\n noLoad = false,\n // @ts-ignore (workaround for \"could be instantiated with a different subtype\" issue)\n mediaFormat: T = 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","import { MouseEvent as ReactMouseEvent } from 'react';\nimport React, {\n FC, useEffect, useCallback, memo,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiUser, ApiTypingStatus } from '../../api/types';\nimport { GlobalActions, GlobalState } from '../../global/types';\nimport { MediaViewerOrigin } from '../../types';\n\nimport { selectChatMessages, selectUser } from '../../modules/selectors';\nimport { getUserFullName, getUserStatus, isUserOnline } from '../../modules/helpers';\nimport renderText from './helpers/renderText';\nimport { pick } from '../../util/iteratees';\nimport useLang from '../../hooks/useLang';\n\nimport Avatar from './Avatar';\nimport VerifiedIcon from './VerifiedIcon';\nimport TypingStatus from './TypingStatus';\n\ntype OwnProps = {\n userId: number;\n typingStatus?: ApiTypingStatus;\n avatarSize?: 'tiny' | 'small' | 'medium' | 'large' | 'jumbo';\n forceShowSelf?: boolean;\n status?: string;\n withMediaViewer?: boolean;\n withUsername?: boolean;\n withFullInfo?: boolean;\n withUpdatingStatus?: boolean;\n noStatusOrTyping?: boolean;\n noRtl?: boolean;\n};\n\ntype StateProps = {\n user?: ApiUser;\n isSavedMessages?: boolean;\n areMessagesLoaded: boolean;\n serverTimeOffset: number;\n} & Pick;\n\ntype DispatchProps = Pick;\n\nconst PrivateChatInfo: FC = ({\n typingStatus,\n avatarSize = 'medium',\n status,\n withMediaViewer,\n withUsername,\n withFullInfo,\n withUpdatingStatus,\n noStatusOrTyping,\n noRtl,\n user,\n isSavedMessages,\n areMessagesLoaded,\n lastSyncTime,\n loadFullUser,\n openMediaViewer,\n serverTimeOffset,\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 (\n {status}\n );\n }\n\n if (withUpdatingStatus && !areMessagesLoaded) {\n return (\n {lang('Updating')}\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, 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 && 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 isSavedMessages = !forceShowSelf && user && user.isSelf;\n const areMessagesLoaded = Boolean(selectChatMessages(global, userId));\n\n return {\n lastSyncTime, user, isSavedMessages, areMessagesLoaded, serverTimeOffset,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['loadFullUser', 'openMediaViewer']),\n)(PrivateChatInfo));\n","import 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: any;\n onClose: () => void;\n onCloseAnimationEnd?: () => void;\n onEnter?: () => void;\n};\n\ntype StateProps = {\n shouldSkipHistoryAnimations?: boolean;\n};\n\nconst Modal: FC = ({\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\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 { RefObject } from 'react';\nimport React, {\n FC, useLayoutEffect, useRef,\n} from '../../lib/teact/teact';\nimport { getGlobal } from '../../lib/teact/teactn';\n\nimport useForceUpdate from '../../hooks/useForceUpdate';\nimport usePrevious from '../../hooks/usePrevious';\nimport buildClassName from '../../util/buildClassName';\nimport { dispatchHeavyAnimationEvent } from '../../hooks/useHeavyAnimationCheck';\nimport { waitForAnimationEnd } from '../../util/cssAnimationEndListeners';\n\nimport './Transition.scss';\n\ntype ChildrenFn = (isActive: boolean, isFrom: boolean, currentKey: number) => any;\ntype OwnProps = {\n ref?: RefObject;\n activeKey: number;\n name: (\n 'none' | 'slide' | 'slide-reversed' | 'mv-slide' | 'slide-fade' | 'zoom-fade' | 'slide-layers'\n | 'fade' | 'push-slide' | 'reveal'\n );\n direction?: 'auto' | 'inverse' | 1 | -1;\n renderCount?: number;\n shouldRestoreHeight?: boolean;\n shouldCleanup?: boolean;\n cleanupExceptionKey?: number;\n id?: string;\n className?: string;\n onStart?: () => void;\n onStop?: () => void;\n children: ChildrenFn;\n};\n\nconst CLEANED_UP = Symbol('CLEANED_UP');\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\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 || (cleanupExceptionKey !== undefined && cleanupExceptionKey === prevActiveKey)) {\n return;\n }\n\n rendersRef.current = { [prevActiveKey]: CLEANED_UP };\n forceUpdate();\n }\n\n const container = containerRef.current!;\n\n const childElements = container.children;\n if (childElements.length === 1 && !activeKeyChanged) {\n childElements[0].classList.add('active');\n\n return;\n }\n\n const childNodes = Array.from(container.childNodes);\n\n if (!activeKeyChanged || !childNodes.length) {\n return;\n }\n\n const isBackwards = (\n direction === -1\n || (direction === 'auto' && prevActiveKey > activeKey)\n || (direction === 'inverse' && prevActiveKey < activeKey)\n );\n\n container.classList.remove('animating');\n container.classList.toggle('backwards', isBackwards);\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 === 'none' || animationLevel === 0) {\n childNodes.forEach((node, i) => {\n if (node instanceof HTMLElement) {\n node.classList.remove('from', 'through', 'to');\n node.classList.toggle('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('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 let dispatchHeavyAnimationStop: NoneToVoidFunction;\n if (animationLevel > 0) {\n dispatchHeavyAnimationStop = dispatchHeavyAnimationEvent();\n }\n\n requestAnimationFrame(() => {\n container.classList.add('animating');\n\n if (onStart) {\n onStart();\n }\n\n function onAnimationEnd() {\n requestAnimationFrame(() => {\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('active', i === activeIndex);\n }\n });\n\n if (shouldRestoreHeight) {\n const activeElement = container.querySelector('.active');\n\n if (activeElement) {\n activeElement.style.height = 'auto';\n container.style.height = `${activeElement.clientHeight}px`;\n }\n }\n\n if (dispatchHeavyAnimationStop) {\n dispatchHeavyAnimationStop();\n }\n\n cleanup();\n\n if (onStop) {\n onStop();\n }\n });\n }\n\n const toNode = name === 'mv-slide'\n ? childNodes[activeIndex] && childNodes[activeIndex].firstChild\n : childNodes[activeIndex];\n\n if (animationLevel > 0 && toNode) {\n waitForAnimationEnd(toNode, 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('.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 const contents = collection.map((key) => {\n const render = renders[key];\n\n return (\n typeof render === 'function'\n ?
{render(key === activeKey, key === prevActiveKey, activeKey)}
\n : undefined\n );\n });\n\n const fullClassName = buildClassName(\n 'Transition',\n className,\n name,\n );\n\n return (\n
\n {contents}\n
\n );\n};\n\nexport default Transition;\n","import { MouseEvent as ReactMouseEvent } from 'react';\nimport React, { FC, useCallback, memo } from '../../lib/teact/teact';\n\nimport { ApiUser, ApiChat, ApiMediaFormat } from '../../api/types';\n\nimport { IS_TEST } from '../../config';\nimport {\n getChatAvatarHash, getChatTitle, isChatPrivate,\n getUserFullName, isUserOnline, isDeletedUser, getUserColorKey,\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 useTransitionForMedia from '../../hooks/useTransitionForMedia';\nimport useLang from '../../hooks/useLang';\n\nimport './Avatar.scss';\n\ntype OwnProps = {\n className?: string;\n size?: 'micro' | 'tiny' | 'small' | 'medium' | 'large' | 'jumbo';\n withOnlineStatus?: boolean;\n chat?: ApiChat;\n user?: ApiUser;\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 text,\n withOnlineStatus,\n isSavedMessages,\n lastSyncTime,\n onClick,\n}) => {\n const isDeleted = user && isDeletedUser(user);\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 }\n }\n\n const dataUri = useMedia(imageHash, false, ApiMediaFormat.DataUri, lastSyncTime);\n const { shouldRenderFullMedia, transitionClassNames } = useTransitionForMedia(dataUri, '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 (shouldRenderFullMedia) {\n content = \"\";\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, isChatPrivate(chat.id) ? 2 : 1);\n } else if (text) {\n content = getFirstLetters(text, 2);\n }\n\n const isOnline = !isSavedMessages && user && isUserOnline(user);\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 withOnlineStatus && isOnline && 'online',\n onClick && 'interactive',\n (!isSavedMessages && !shouldRenderFullMedia) && 'no-photo',\n );\n\n const handleClick = useCallback((e: ReactMouseEvent) => {\n if (onClick) {\n onClick(e, isSavedMessages || shouldRenderFullMedia);\n }\n }, [onClick, isSavedMessages, shouldRenderFullMedia]);\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 { 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';\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 noScrollRestore?: boolean;\n noScrollRestoreOnTop?: boolean;\n noFastList?: boolean;\n cacheBuster?: any;\n children: any;\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 // 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 }>({} as any);\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 (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]);\n\n const handleScroll = useCallback((e: UIEvent) => {\n if (loadMoreForwards && loadMoreBackwards) {\n const {\n listItemElements, isScrollTopJustUpdated, currentAnchor, currentAnchorTop,\n } = stateRef.current;\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 && 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 resetScroll(container);\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 && 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 resetScroll(container);\n loadMoreBackwards();\n }\n }\n }\n\n if (!isUpdated) {\n if (currentAnchor && 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 {children}\n
\n );\n};\n\nexport default InfiniteScroll;\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: any;\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 { useEffect, useRef, useState } from '../lib/teact/teact';\n\nimport useShowTransition from './useShowTransition';\n\nconst SPEED = {\n fast: 200,\n slow: 350,\n};\n\nexport default (mediaData?: any, speed: keyof typeof SPEED = 'fast', noAnimate = false) => {\n const isMediaLoaded = Boolean(mediaData);\n const willAnimate = !useRef(isMediaLoaded).current && !noAnimate;\n const [shouldRenderThumb, setShouldRenderThumb] = useState(!isMediaLoaded);\n\n const {\n shouldRender: shouldRenderFullMedia,\n transitionClassNames,\n } = useShowTransition(isMediaLoaded, undefined, !willAnimate, speed);\n\n useEffect(() => {\n if (shouldRenderFullMedia) {\n if (willAnimate) {\n setTimeout(() => {\n setShouldRenderThumb(false);\n }, SPEED[speed]);\n } else {\n setShouldRenderThumb(false);\n }\n }\n }, [willAnimate, shouldRenderFullMedia, speed]);\n\n return {\n shouldRenderThumb,\n shouldRenderFullMedia,\n transitionClassNames,\n };\n};\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 } 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 = 200;\nexport const AVATAR_FULL_DIMENSIONS = { width: 640, height: 640 };\nexport const LIKE_STICKER_ID = '1258816259753933';\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\n return calculateDimensions(availableWidth, availableHeight, width, height);\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) {\n occupiedHeightRem = mql.matches ? 10 : 15;\n }\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 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: AnyLiteral;\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};\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 supposed for judges to measure \"Transferred Size\" in Dev Tools\nconst LOTTIE_LOAD_DELAY = 5000;\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 onLoad,\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\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 );\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 }, [animation, animationData, id, isLowPriority, noLoop, onLoad, quality, size, speed]);\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 useHeavyAnimationCheck(freezeAnimation, unfreezeAnimation);\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 React, { FC, memo } from '../../lib/teact/teact';\n\nimport useLang from '../../hooks/useLang';\nimport { TextPart } from '../common/helpers/renderMessageText';\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};\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}) => {\n const lang = useLang();\n\n return (\n \n {text && text.split('\\\\n').map((textPart) => (\n

{textPart}

\n ))}\n {textParts}\n
\n \n {confirmLabel}\n \n \n
\n \n );\n};\n\nexport default memo(ConfirmDialog);\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 { 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 {\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';\n\nconst STREAMING_PROGRESS = 0.75;\nconst STREAMING_TIMEOUT = 1500;\nconst PROGRESS_THROTTLE = 500;\n\nexport default (\n mediaHash: string | undefined,\n noLoad = false,\n // @ts-ignore (workaround for \"could be instantiated with a different subtype\" issue)\n mediaFormat: T = ApiMediaFormat.BlobUrl,\n cacheBuster?: number,\n delay?: number | 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 [downloadProgress, setDownloadProgress] = useState(mediaData && !isStreaming ? 1 : 0);\n const startedAtRef = useRef();\n\n const handleProgress = useMemo(() => {\n return throttle((progress: number) => {\n if (!delay || (Date.now() - startedAtRef.current! > delay)) {\n setDownloadProgress(progress);\n }\n }, PROGRESS_THROTTLE, true);\n }, [delay]);\n\n useEffect(() => {\n if (!noLoad && mediaHash) {\n if (!mediaData) {\n setDownloadProgress(0);\n\n if (startedAtRef.current) {\n mediaLoader.cancelProgress(handleProgress);\n }\n\n startedAtRef.current = Date.now();\n\n mediaLoader.fetch(mediaHash, mediaFormat, handleProgress).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 setDownloadProgress(STREAMING_PROGRESS);\n }, STREAMING_TIMEOUT);\n }\n }\n }, [noLoad, mediaHash, mediaData, mediaFormat, cacheBuster, forceUpdate, isStreaming, delay, handleProgress]);\n\n useEffect(() => {\n if (noLoad && startedAtRef.current) {\n mediaLoader.cancelProgress(handleProgress);\n setDownloadProgress(0);\n }\n }, [handleProgress, noLoad]);\n\n return { mediaData, downloadProgress };\n};\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 { 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 useTransitionForMedia from '../../hooks/useTransitionForMedia';\nimport useFlag from '../../hooks/useFlag';\nimport buildClassName from '../../util/buildClassName';\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.isAnimated && localMediaHash, !shouldPlay, ApiMediaFormat.Lottie);\n const [isAnimationLoaded, markLoaded, unmarkLoaded] = useFlag(Boolean(lottieData));\n const canAnimatedPlay = isAnimationLoaded && shouldPlay;\n\n const {\n shouldRenderThumb,\n shouldRenderFullMedia: shouldRenderPreview,\n transitionClassNames: previewTransitionClassNames,\n } = useTransitionForMedia(previewBlobUrl || canAnimatedPlay, 'slow');\n\n // To avoid flickering\n useEffect(() => {\n if (!shouldPlay) {\n unmarkLoaded();\n }\n }, [unmarkLoaded, shouldPlay]);\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 sticker.isAnimated && 'animated',\n stickerSelector,\n className,\n );\n\n const style = shouldRenderThumb && thumbDataUri ? `background-image: url('${thumbDataUri}');` : '';\n\n return (\n \n {shouldRenderPreview && !canAnimatedPlay && (\n // eslint-disable-next-line jsx-a11y/alt-text\n \n )}\n {shouldPlay && lottieData && (\n \n )}\n {onUnfaveClick && (\n \n \n \n )}\n
\n );\n};\n\nexport default memo(StickerButton);\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\ntype 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 { 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 { FC, useRef, useLayoutEffect } from '../../lib/teact/teact';\nimport TeactDOM from '../../lib/teact/teact-dom';\n\ntype OwnProps = {\n containerId?: string;\n className?: string;\n children: any;\n};\n\nconst Portal: FC = ({ containerId, className, children }) => {\n const elementRef = useRef(document.createElement('div'));\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, elementRef.current);\n};\n\nexport default Portal;\n","import React, {\n FC, useCallback, useRef, useState,\n} from '../../lib/teact/teact';\n\nimport { ApiMediaFormat, ApiSticker } from '../../api/types';\n\nimport { LIKE_STICKER_ID } from './helpers/mediaDimensions';\nimport { ObserveFn, useIsIntersecting } from '../../hooks/useIntersectionObserver';\nimport useMedia from '../../hooks/useMedia';\nimport useTransitionForMedia from '../../hooks/useTransitionForMedia';\nimport useFlag from '../../hooks/useFlag';\n\nimport AnimatedSticker from './AnimatedSticker';\n\nimport './AnimatedEmoji.scss';\n\ntype OwnProps = {\n sticker: ApiSticker;\n observeIntersection?: ObserveFn;\n size?: 'large' | 'medium' | 'small';\n lastSyncTime?: number;\n forceLoadPreview?: boolean;\n};\n\nconst QUALITY = 1;\nconst WIDTH = {\n large: 160,\n medium: 128,\n small: 104,\n};\n\nconst AnimatedEmoji: FC = ({\n sticker,\n size = 'medium',\n observeIntersection,\n lastSyncTime,\n forceLoadPreview,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const ref = useRef(null);\n\n const [isAnimationLoaded, markAnimationLoaded] = useFlag();\n const localMediaHash = `sticker${sticker.id}`;\n\n const isIntersecting = useIsIntersecting(ref, observeIntersection);\n\n const thumbDataUri = sticker.thumbnail && sticker.thumbnail.dataUri;\n const previewBlobUrl = useMedia(\n `${localMediaHash}?size=m`,\n !isIntersecting && !forceLoadPreview,\n ApiMediaFormat.BlobUrl,\n lastSyncTime,\n );\n const { transitionClassNames } = useTransitionForMedia(previewBlobUrl, 'slow');\n\n const mediaData = useMedia(localMediaHash, !isIntersecting, ApiMediaFormat.Lottie, lastSyncTime);\n const isMediaLoaded = Boolean(mediaData);\n\n const [playKey, setPlayKey] = useState(String(Math.random()));\n const handleClick = useCallback(() => {\n setPlayKey(String(Math.random()));\n }, []);\n\n const width = WIDTH[size];\n const style = `width: ${width}px; height: ${width}px;`;\n\n return (\n \n {!isAnimationLoaded && thumbDataUri && (\n \"\"\n )}\n {!isAnimationLoaded && previewBlobUrl && (\n \"\"\n )}\n {isMediaLoaded && (\n \n )}\n
\n );\n};\n\nexport default AnimatedEmoji;\n","import { MouseEvent as ReactMouseEvent } from 'react';\nimport React, {\n FC, useEffect, useCallback, memo,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiChat, ApiTypingStatus } from '../../api/types';\nimport { GlobalActions, 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 { pick } from '../../util/iteratees';\nimport useLang, { LangFn } from '../../hooks/useLang';\n\nimport Avatar from './Avatar';\nimport VerifiedIcon from './VerifiedIcon';\nimport TypingStatus from './TypingStatus';\n\ntype OwnProps = {\n chatId: number;\n typingStatus?: ApiTypingStatus;\n avatarSize?: 'small' | 'medium' | 'large' | 'jumbo';\n withMediaViewer?: boolean;\n withUsername?: boolean;\n withFullInfo?: boolean;\n withUpdatingStatus?: boolean;\n withChatType?: boolean;\n noRtl?: boolean;\n};\n\ntype StateProps = {\n chat?: ApiChat;\n onlineCount?: number;\n areMessagesLoaded: boolean;\n} & Pick;\n\ntype DispatchProps = Pick;\n\nconst GroupChatInfo: FC = ({\n typingStatus,\n avatarSize = 'medium',\n withMediaViewer,\n withUsername,\n withFullInfo,\n withUpdatingStatus,\n withChatType,\n noRtl,\n chat,\n onlineCount,\n areMessagesLoaded,\n lastSyncTime,\n loadFullChat,\n openMediaViewer,\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 (withUpdatingStatus && !areMessagesLoaded && !isRestricted) {\n return (\n {lang('Updating')}\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 (setGlobal, actions): DispatchProps => pick(actions, ['loadFullChat', 'openMediaViewer']),\n)(GroupChatInfo));\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 { dispatchHeavyAnimationEvent } from '../hooks/useHeavyAnimationCheck';\nimport { animateSingle } from './animation';\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 forceCurrentContainerHeight?: 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\n if (getGlobal().settings.byKey.animationLevel === ANIMATION_LEVEL_MIN) {\n forceDuration = 0;\n }\n\n scrollWithJs(container, element, scrollFrom, position, margin, forceDuration, forceCurrentContainerHeight);\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 forceCurrentContainerHeight?: boolean,\n) {\n const { offsetTop: elementTop, offsetHeight: elementHeight } = element;\n const { scrollTop: currentScrollTop, offsetHeight: containerHeight, scrollHeight } = container;\n const targetContainerHeight = !forceCurrentContainerHeight && 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;\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 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\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 { useCallback, useEffect, 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?: number }) => void;\n\nconst DEFAULT_LIST_SLICE = 30;\n\nexport default (\n loadMoreBackwards?: LoadMoreBackwards,\n listIds?: number[],\n isDisabled = false,\n listSlice = DEFAULT_LIST_SLICE,\n forceFullPreload = false,\n): [number[]?, GetMore?] => {\n const lastParamsRef = useRef<{\n direction?: LoadMoreDirection;\n offsetId?: number;\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, listIds[0], LoadMoreDirection.Forwards, listSlice);\n return newViewportIds;\n })());\n\n const forceUpdate = useForceUpdate();\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, offsetId, direction, listSlice);\n\n if (!viewportIdsRef.current || !areSortedArraysEqual(viewportIdsRef.current, newViewportIds)) {\n viewportIdsRef.current = newViewportIds;\n }\n }\n\n useEffect(() => {\n if (listIds && !isDisabled && loadMoreBackwards && forceFullPreload) {\n const viewportIds = viewportIdsRef.current!;\n loadMoreBackwards({ offsetId: viewportIds[viewportIds.length - 1] });\n }\n }, [listIds, isDisabled, loadMoreBackwards, forceFullPreload]);\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, offsetId, direction, listSlice);\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: number[],\n offsetId = 0,\n direction: LoadMoreDirection,\n listSlice: number,\n) {\n const { length } = sourceIds;\n const index = sourceIds.indexOf(offsetId);\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","export default function cycleRestrict(length: number, index: number) {\n return index - Math.floor(index / length) * length;\n}\n","import { IS_TOUCH_ENV } from './environment';\n\nexport default function focusEditableElement(element: HTMLElement, force?: 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 && (!lastChild || !lastChild.nodeValue)) {\n element.focus();\n return;\n }\n\n range.selectNodeContents(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 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) => void;\n onClick?: (e: MouseEvent | TouchEvent) => void;\n excludedClosestSelector?: string;\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 = 'x' | 'y' | undefined;\n\nconst MOVED_THRESHOLD = 15;\nconst SWIPE_THRESHOLD = 50;\n\nexport function captureEvents(element: HTMLElement, options: CaptureOptions) {\n let captureEvent: MouseEvent | RealTouchEvent | undefined;\n let hasMoved = false;\n let currentSwipeAxis: TSwipeAxis;\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 document.addEventListener('touchmove', onMove);\n document.addEventListener('touchend', onRelease);\n document.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 }\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 document.removeEventListener('touchcancel', onRelease);\n document.removeEventListener('touchend', onRelease);\n document.removeEventListener('touchmove', onMove);\n\n captureEvent = undefined;\n\n if (hasMoved) {\n if (options.onRelease) {\n options.onRelease(e);\n }\n } else if (options.onClick && (!('button' in e) || e.button === 0)) {\n options.onClick(e);\n }\n }\n\n hasMoved = false;\n currentSwipeAxis = 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\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 if (options.onDrag) {\n e.preventDefault();\n options.onDrag(e, captureEvent, { dragOffsetX, dragOffsetY });\n }\n\n if (options.onSwipe) {\n onSwipe(e, dragOffsetX, dragOffsetY);\n }\n }\n }\n\n function onSwipe(e: Event, dragOffsetX: number, dragOffsetY: number) {\n if (!currentSwipeAxis) {\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;\n }\n }\n\n if (xAbs >= SWIPE_THRESHOLD) {\n currentSwipeAxis = 'x';\n } else if (yAbs >= SWIPE_THRESHOLD) {\n currentSwipeAxis = 'y';\n }\n }\n\n processSwipe(e, currentSwipeAxis, dragOffsetX, dragOffsetY, options.onSwipe!);\n }\n\n element.addEventListener('mousedown', onCapture);\n element.addEventListener('touchstart', onCapture, { passive: true });\n\n return () => {\n element.removeEventListener('mousedown', onCapture);\n element.removeEventListener('touchstart', onCapture);\n };\n}\n\nfunction processSwipe(\n e: Event,\n currentSwipeAxis:TSwipeAxis,\n dragOffsetX: number,\n dragOffsetY: number,\n onSwipe: (e: Event, direction: SwipeDirection) => void,\n) {\n if (currentSwipeAxis === 'x') {\n if (dragOffsetX < 0) {\n onSwipe(e, SwipeDirection.Left);\n } else {\n onSwipe(e, SwipeDirection.Right);\n }\n } else if (currentSwipeAxis === 'y') {\n if (dragOffsetY < 0) {\n onSwipe(e, SwipeDirection.Up);\n } else {\n onSwipe(e, SwipeDirection.Down);\n }\n }\n}\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 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 { DEBUG } from '../config';\n\nexport default (mediaEl: HTMLMediaElement) => {\n mediaEl.play().catch((err) => {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.warn(err);\n }\n });\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\nexport default (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","import { ApiMessageEntity, ApiMessageEntityTypes, ApiFormattedText } from '../../../../api/types';\nimport { IS_EMOJI_SUPPORTED } from '../../../../util/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;\nconst MAX_MESSAGE_LENGTH = 4096;\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, '').slice(0, MAX_MESSAGE_LENGTH);\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 tags\n parsedHtml = parsedHtml.replace(/<\\/?span([^>]*)?>/g, '');\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(/[*]{2}([^*\\n]+)[*]{2}/g, '$1');\n parsedHtml = parsedHtml.replace(/[_]{2}([^*\\n]+)[_]{2}/g, '$1');\n parsedHtml = parsedHtml.replace(/[~]{2}([^~\\n]+)[~]{2}/g, '$1');\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: number | undefined;\n if (type === ApiMessageEntityTypes.TextUrl) {\n url = (node as HTMLAnchorElement).href;\n }\n if (type === ApiMessageEntityTypes.MentionName) {\n userId = Number((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","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';\n\nimport captureEscKeyListener from '../../../util/captureEscKeyListener';\nimport usePrevious from '../../../hooks/usePrevious';\n\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((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), false);\n }\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 {(withQuick || prevWithQuick) && }\n
\n );\n};\n\nexport default memo(DropArea);\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: number[] = [];\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 && 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\nexport default () => {\n return useReducer(foldersReducer, INITIAL_STATE);\n};\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, isChatPrivate } 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?: number;\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 = isChatPrivate(chatOrUserId) ? selectUser(global, chatOrUserId) : undefined;\n\n return {\n chat,\n user,\n };\n },\n)(PickerSelectedItem));\n","import { getGlobal } from '../lib/teact/teactn';\n\nimport { ANIMATION_LEVEL_MIN } from '../config';\nimport { IS_IOS } from './environment';\nimport { animate } from './animation';\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 // Native way seems to be smoother in Chrome\n if (!IS_IOS) {\n container.scrollTo({\n left,\n ...(duration && { behavior: 'smooth' }),\n });\n } else {\n scrollWithJs(container, left, duration);\n }\n}\n\nfunction scrollWithJs(container: HTMLElement, left: number, duration: number) {\n const { scrollLeft, offsetWidth: containerWidth, scrollWidth } = container;\n let path = left - scrollLeft;\n\n if (path < 0) {\n const remainingPath = -scrollLeft;\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 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\nfunction transition(t: number) {\n return 1 - ((1 - t) ** 3.5);\n}\n","import { useEffect } from '../lib/teact/teact';\n\nexport default (container: HTMLElement | null, isDisabled?: boolean) => {\n useEffect(() => {\n if (!container) {\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","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\nexport default (\n chatId: number,\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","import { RefObject } from 'react';\nimport { useState, useEffect, useCallback } from '../lib/teact/teact';\n\nimport { IAnchorPosition } from '../types';\nimport { IS_TOUCH_ENV, IS_SINGLE_COLUMN_LAYOUT } from '../util/environment';\n\nconst LONG_TAP_DURATION_MS = 250;\nconst SELECTION_ANIMATION_DURATION_MS = 200;\n\nlet contextMenuCounter = 0;\n\nfunction checkIsDisabledForMobile() {\n return IS_SINGLE_COLUMN_LAYOUT\n && window.document.body.classList.contains('enable-symbol-menu-transforms');\n}\n\nexport default (\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 document.body.classList.add('no-selection');\n }\n }, [isMenuDisabled]);\n\n const handleContextMenu = useCallback((e: React.MouseEvent) => {\n document.body.classList.remove('no-selection');\n\n if (isMenuDisabled || (shouldDisableOnLink && (e.target as HTMLElement).matches('a.text-entity-link[href]'))) {\n return;\n }\n e.preventDefault();\n\n if (contextMenuPosition) {\n return;\n }\n document.body.classList.remove('no-selection');\n if (contextMenuCounter === 0) {\n document.body.classList.add('has-context-menu');\n }\n contextMenuCounter++;\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 setTimeout(() => {\n contextMenuCounter--;\n if (contextMenuCounter === 0) {\n document.body.classList.remove('has-context-menu');\n }\n }, SELECTION_ANIMATION_DURATION_MS);\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.text-entity-link[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 e.stopImmediatePropagation();\n e.preventDefault();\n e.stopPropagation();\n }, true);\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","import { MouseEvent } from 'react';\nimport React from '../../../lib/teact/teact';\nimport { getDispatch } from '../../../lib/teact/teactn';\n\nimport { ApiMessageEntity, ApiMessageEntityTypes, ApiMessage } from '../../../api/types';\n\nimport { getMessageText } from '../../../modules/helpers';\nimport renderText from './renderText';\n\nimport MentionLink from '../../middle/message/MentionLink';\nimport SafeLink from '../SafeLink';\n\nexport type TextPart = string | Element;\n\nexport function renderMessageText(message: ApiMessage, highlight?: string, shouldRenderHqEmoji?: boolean) {\n const formattedText = message.content.text;\n\n if (!formattedText || !formattedText.text) {\n const rawText = getMessageText(message);\n return rawText ? [rawText] : undefined;\n }\n const { text, entities } = formattedText;\n\n return renderTextWithEntities(text, entities, highlight, shouldRenderHqEmoji);\n}\n\ninterface IOrganizedEntity {\n entity: ApiMessageEntity;\n organizedIndexes: Set;\n nestedEntities: IOrganizedEntity[];\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\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\nexport function renderTextWithEntities(\n text: string,\n entities?: ApiMessageEntity[],\n highlight?: string,\n shouldRenderHqEmoji?: boolean,\n shouldRenderAsHtml?: boolean,\n) {\n if (!entities || !entities.length) {\n return renderMessagePart(text, highlight, shouldRenderHqEmoji, shouldRenderAsHtml);\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,\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);\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,\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\nfunction processEntity(\n entity: ApiMessageEntity,\n entityContent: TextPart,\n nestedEntityContent: TextPart[],\n) {\n const entityText = typeof entityContent === 'string' && entityContent;\n const renderedContent = nestedEntityContent.length ? nestedEntityContent : entityContent;\n\n if (!entityText) {\n return renderMessagePart(renderedContent);\n }\n\n switch (entity.type) {\n case ApiMessageEntityTypes.Bold:\n return {renderMessagePart(renderedContent)};\n case ApiMessageEntityTypes.Blockquote:\n return
{renderMessagePart(renderedContent)}
;\n case ApiMessageEntityTypes.BotCommand:\n return (\n \n {renderMessagePart(renderedContent)}\n \n );\n case ApiMessageEntityTypes.Hashtag:\n return (\n \n {renderMessagePart(renderedContent)}\n \n );\n case ApiMessageEntityTypes.Cashtag:\n return (\n \n {renderMessagePart(renderedContent)}\n \n );\n case ApiMessageEntityTypes.Code:\n return {renderMessagePart(renderedContent)};\n case ApiMessageEntityTypes.Email:\n return (\n \n {renderMessagePart(renderedContent)}\n \n );\n case ApiMessageEntityTypes.Italic:\n return {renderMessagePart(renderedContent)};\n case ApiMessageEntityTypes.MentionName:\n return (\n \n {renderMessagePart(renderedContent)}\n \n );\n case ApiMessageEntityTypes.Mention:\n return (\n \n {renderMessagePart(renderedContent)}\n \n );\n case ApiMessageEntityTypes.Phone:\n return (\n \n {renderMessagePart(renderedContent)}\n \n );\n case ApiMessageEntityTypes.Pre:\n return
{renderMessagePart(renderedContent)}
;\n case ApiMessageEntityTypes.Strike:\n return {renderMessagePart(renderedContent)};\n case ApiMessageEntityTypes.TextUrl:\n case ApiMessageEntityTypes.Url:\n return (\n \n {renderMessagePart(renderedContent)}\n \n );\n case ApiMessageEntityTypes.Underline:\n return {renderMessagePart(renderedContent)};\n default:\n return renderMessagePart(renderedContent);\n }\n}\n\nfunction renderMessagePart(\n content: TextPart | TextPart[],\n highlight?: string,\n shouldRenderHqEmoji?: boolean,\n shouldRenderAsHtml?: boolean,\n) {\n if (Array.isArray(content)) {\n const result: TextPart[] = [];\n\n content.forEach((c) => {\n result.push(...renderMessagePart(c, highlight, shouldRenderHqEmoji, shouldRenderAsHtml));\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 if (highlight) {\n return renderText(content, [emojiFilter, 'br', 'highlight'], { highlight });\n } else {\n return renderText(content, [emojiFilter, 'br']);\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\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 default:\n return renderedContent;\n }\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","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 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];\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 { 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';\n\nimport Loading from './Loading';\nimport Button from './Button';\n\nimport './SearchInput.scss';\n\ntype OwnProps = {\n ref?: RefObject;\n children?: any;\n parentContainerClassName?: string;\n className?: string;\n inputId?: string;\n value?: string;\n focused?: boolean;\n isLoading?: boolean;\n placeholder?: string;\n disabled?: boolean;\n autoComplete?: string;\n canClose?: boolean;\n onChange: (value: string) => void;\n onReset?: NoneToVoidFunction;\n onFocus?: NoneToVoidFunction;\n onBlur?: NoneToVoidFunction;\n};\n\nconst SearchInput: FC = ({\n ref,\n children,\n parentContainerClassName,\n value,\n inputId,\n className,\n focused,\n isLoading,\n placeholder,\n disabled,\n autoComplete,\n canClose,\n onChange,\n onReset,\n onFocus,\n onBlur,\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 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 {isLoading && (\n \n )}\n {!isLoading && (value || canClose) && onReset && (\n \n \n \n )}\n
\n );\n};\n\nexport default memo(SearchInput);\n","import { IS_IOS } from './environment';\n\nexport default (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","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 './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\n return (\n

\n {typingUserName && (\n {renderText(typingUserName)}\n )}\n {/* fix for translation \"username _is_ typing\" */}\n {lang(typingStatus.action).replace('{user}', '').trim()}\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, useCallback, memo } from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiChat } from '../../api/types';\nimport { GlobalActions } from '../../global/types';\n\nimport { selectIsChatWithSelf, selectUser } from '../../modules/selectors';\nimport {\n isChatPrivate,\n isUserBot,\n getUserFirstOrLastName,\n getPrivateChatUserId,\n isChatBasicGroup,\n isChatSuperGroup,\n isChatChannel,\n getChatTitle,\n} from '../../modules/helpers';\nimport { pick } from '../../util/iteratees';\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: number | undefined;\n canDeleteForAll?: boolean;\n contactName?: string;\n};\n\ntype DispatchProps = Pick;\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 leaveChannel,\n deleteHistory,\n deleteChannel,\n deleteChatUser,\n blockContact,\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 = isChatPrivate(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 (setGlobal, actions): DispatchProps => pick(actions,\n ['leaveChannel', 'deleteHistory', 'deleteChannel', 'deleteChatUser', 'blockContact']),\n)(DeleteChatModal));\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\ntype ChildrenFn = () => any;\n\ntype OwnProps = {\n isOpen: boolean;\n isCustom?: boolean;\n id?: string;\n className?: string;\n onClick?: (e: React.MouseEvent) => void;\n children: ChildrenFn;\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","/*\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 function onProgress() {\n if (!audioEl.buffered.length) {\n return;\n }\n\n audioEl.dataset.patchForSafariInProgress = 'true';\n audioEl.currentTime = audioEl.duration - 1;\n audioEl.addEventListener('progress', () => {\n delete audioEl.dataset.patchForSafariInProgress;\n audioEl.currentTime = t;\n if (audioEl.paused) {\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 { useLayoutEffect } from '../lib/teact/teact';\nimport usePrevious from './usePrevious';\n\nexport default (cb: (args: PT) => void, dependencies: T, debugKey?: string) => {\n const prevDeps = usePrevious(dependencies);\n return useLayoutEffect(() => {\n // @ts-ignore (workaround for \"could be instantiated with a different subtype\" issue)\n return cb(prevDeps || []);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, dependencies, debugKey);\n};\n","import React, {\n FC, useCallback, useEffect, useState, memo, useRef,\n} from '../../lib/teact/teact';\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 useMediaWithDownloadProgress from '../../hooks/useMediaWithDownloadProgress';\nimport useMedia from '../../hooks/useMedia';\nimport download from '../../util/download';\n\nimport File from './File';\n\ntype OwnProps = {\n message: ApiMessage;\n observeIntersection?: ObserveFn;\n smaller?: boolean;\n isSelected?: boolean;\n isSelectable?: boolean;\n uploadProgress?: number;\n withDate?: boolean;\n datetime?: number;\n className?: string;\n sender?: string;\n onCancelUpload?: () => void;\n onMediaClick?: () => void;\n onDateClick?: (messageId: number, chatId: number) => void;\n};\n\nconst Document: FC = ({\n message,\n observeIntersection,\n smaller,\n uploadProgress,\n withDate,\n datetime,\n className,\n sender,\n isSelected,\n isSelectable,\n onCancelUpload,\n onMediaClick,\n onDateClick,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const ref = useRef(null);\n\n const document = message.content.document!;\n const extension = getDocumentExtension(document) || '';\n const { fileName, size, timestamp } = document;\n const withMediaViewer = onMediaClick && Boolean(document.mediaType);\n\n const isIntersecting = useIsIntersecting(ref, observeIntersection);\n\n const [isDownloadAllowed, setIsDownloadAllowed] = useState(false);\n const {\n mediaData, downloadProgress,\n } = useMediaWithDownloadProgress(getMessageMediaHash(message, 'download'), !isDownloadAllowed);\n const {\n isUploading, isTransferring, transferProgress,\n } = getMediaTransferState(message, uploadProgress || downloadProgress, isDownloadAllowed);\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 handleClick = useCallback(() => {\n if (withMediaViewer) {\n onMediaClick!();\n } else if (isUploading) {\n if (onCancelUpload) {\n onCancelUpload();\n }\n } else {\n setIsDownloadAllowed((isAllowed) => !isAllowed);\n }\n }, [withMediaViewer, isUploading, onCancelUpload, onMediaClick]);\n\n const handleDateClick = useCallback(() => {\n onDateClick!(message.id, message.chatId);\n }, [onDateClick, message.id, message.chatId]);\n\n useEffect(() => {\n if (isDownloadAllowed && mediaData) {\n download(mediaData, fileName);\n setIsDownloadAllowed(false);\n }\n }, [fileName, mediaData, isDownloadAllowed]);\n\n return (\n \n );\n};\n\nexport default memo(Document);\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 { 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","/* 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 React, {\n FC, memo, useCallback, useEffect, useRef, useState,\n} from '../../../lib/teact/teact';\n\nimport { IAnchorPosition } from '../../../types';\n\nimport { EDITABLE_INPUT_ID } from '../../../config';\nimport buildClassName from '../../../util/buildClassName';\nimport captureEscKeyListener from '../../../util/captureEscKeyListener';\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 onClose: () => void;\n};\n\ninterface ISelectedTextFormats {\n bold?: boolean;\n italic?: boolean;\n underline?: boolean;\n strikethrough?: boolean;\n monospace?: 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};\nconst fragmentEl = document.createElement('div');\n\nconst TextFormatter: FC = ({\n isOpen,\n anchorPosition,\n selectedRange,\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 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 && !!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 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') && !!selectedFormats[key]) {\n document.execCommand(key);\n }\n });\n\n return {\n ...selectedFormats,\n bold: !selectedFormats.bold,\n };\n });\n }, []);\n\n const handleItalicText = useCallback(() => {\n document.execCommand('italic');\n setSelectedTextFormats((selectedFormats) => ({\n ...selectedFormats,\n italic: !selectedFormats.italic,\n }));\n }, []);\n\n const handleUnderlineText = useCallback(() => {\n document.execCommand('underline');\n setSelectedTextFormats((selectedFormats) => ({\n ...selectedFormats,\n underline: !selectedFormats.underline,\n }));\n }, []);\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,\n 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 return;\n }\n\n const text = getSelectedText();\n document.execCommand('insertHTML', false, `${text}`);\n onClose();\n }, [\n getSelectedElement, getSelectedText, onClose,\n selectedRange, selectedTextFormats.monospace,\n ]);\n\n function handleLinkUrlConfirm() {\n const formattedLinkUrl = encodeURI(linkUrl.includes('://') ? linkUrl : `http://${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 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_CODE: Record = {\n KeyK: openLinkControl,\n KeyB: handleBoldText,\n KeyU: handleUnderlineText,\n KeyI: handleItalicText,\n KeyM: handleMonospaceText,\n KeyS: handleStrikethroughText,\n };\n\n const handler = HANDLERS_BY_KEY_CODE[e.code];\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 handleBoldText, handleItalicText, handleUnderlineText,\n handleMonospaceText, handleStrikethroughText,\n openLinkControl,\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 !!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\nexport default memo(TextFormatter);\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 window.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","import React, { FC, memo, useCallback } from '../../lib/teact/teact';\n\nimport { ApiMessage } from '../../api/types';\n\nimport { formatMediaDuration } from '../../util/dateFormat';\nimport {\n getMessageMediaHash,\n getMessageMediaThumbDataUri,\n getMessageVideo,\n} from '../../modules/helpers';\nimport useMedia from '../../hooks/useMedia';\nimport useTransitionForMedia from '../../hooks/useTransitionForMedia';\n\nimport './Media.scss';\n\ntype OwnProps = {\n message: ApiMessage;\n idPrefix?: string;\n onClick?: (messageId: number, chatId: number) => void;\n};\n\nconst Media: FC = ({ message, idPrefix = 'shared-media', onClick }) => {\n const handleClick = useCallback(() => {\n onClick!(message.id, message.chatId);\n }, [message.id, message.chatId, onClick]);\n\n const thumbDataUri = getMessageMediaThumbDataUri(message);\n const mediaBlobUrl = useMedia(getMessageMediaHash(message, 'pictogram'));\n const {\n shouldRenderThumb, shouldRenderFullMedia, transitionClassNames,\n } = useTransitionForMedia(mediaBlobUrl, 'slow');\n\n const video = getMessageVideo(message);\n\n return (\n
\n {shouldRenderThumb && (\n \"\"\n )}\n {shouldRenderFullMedia && (\n \"\"\n )}\n {video && {video.isGif ? 'GIF' : formatMediaDuration(video.duration)}}\n
\n );\n};\n\nexport default memo(Media);\n","import React, {\n FC, useCallback, useRef, useEffect, memo,\n} from '../../lib/teact/teact';\n\nimport { isChatPrivate } 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: number[];\n selectedIds: number[];\n filterValue?: string;\n filterPlaceholder?: string;\n notFoundText?: string;\n searchInputId?: string;\n isLoading?: boolean;\n noScrollRestore?: boolean;\n onSelectedIdsChange: (ids: number[]) => 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: number) => {\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 && viewportIds.length ? (\n \n {viewportIds.map((id) => (\n handleItemClick(id)}\n ripple\n >\n \n {isChatPrivate(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, {\n FC, memo, useCallback, useEffect, useMemo, useRef, useState,\n} from '../../lib/teact/teact';\n\nimport {\n ApiAudio, ApiMessage, ApiVoice,\n} from '../../api/types';\nimport { 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 getMessageAudioCaption,\n getMessageKey,\n getMessageMediaFormat,\n getMessageMediaHash,\n isMessageLocal,\n isOwnMessage,\n} from '../../modules/helpers';\nimport { renderWaveformToDataUri } from './helpers/waveform';\nimport buildClassName from '../../util/buildClassName';\nimport renderText from './helpers/renderText';\nimport { decodeWaveform, interpolateArray } from '../../util/waveform';\nimport useMediaWithDownloadProgress from '../../hooks/useMediaWithDownloadProgress';\nimport useShowTransition from '../../hooks/useShowTransition';\nimport useBuffering from '../../hooks/useBuffering';\nimport useAudioPlayer from '../../hooks/useAudioPlayer';\nimport useMediaDownload from '../../hooks/useMediaDownload';\nimport useLang, { LangFn } from '../../hooks/useLang';\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 target?: 'searchResult' | 'sharedMedia';\n date?: number;\n lastSyncTime?: number;\n className?: string;\n isSelectable?: boolean;\n isSelected?: boolean;\n onPlay: (messageId: number, chatId: number) => void;\n onReadMedia?: () => void;\n onCancelUpload?: () => void;\n onDateClick?: (messageId: number, chatId: number) => void;\n};\n\ninterface ISeekMethods {\n handleStartSeek: (e: React.MouseEvent) => void;\n handleSeek: (e: React.MouseEvent) => void;\n handleStopSeek: () => void;\n}\n\nconst AVG_VOICE_DURATION = 30;\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 target,\n date,\n lastSyncTime,\n className,\n isSelectable,\n isSelected,\n onPlay,\n onReadMedia,\n onCancelUpload,\n onDateClick,\n}) => {\n const { content: { audio, voice }, isMediaUnread } = message;\n const isVoice = Boolean(voice);\n const isSeeking = useRef(false);\n const lang = useLang();\n\n const [isActivated, setIsActivated] = useState(false);\n const shouldDownload = (isActivated || PRELOAD) && lastSyncTime;\n\n const { mediaData, downloadProgress } = useMediaWithDownloadProgress(\n getMessageMediaHash(message, 'inline'),\n !shouldDownload,\n getMessageMediaFormat(message, 'inline'),\n );\n\n function handleForcePlay() {\n setIsActivated(true);\n onPlay(message.id, message.chatId);\n }\n\n const {\n isBuffered, bufferedProgress, bufferingHandlers, checkBuffering,\n } = useBuffering();\n\n const {\n isPlaying, playProgress, playPause, setCurrentTime, duration,\n } = useAudioPlayer(\n getMessageKey(message),\n getMediaDuration(message)!,\n mediaData,\n bufferingHandlers,\n checkBuffering,\n isActivated,\n handleForcePlay,\n isMessageLocal(message),\n );\n\n useEffect(() => {\n setIsActivated(isPlaying);\n }, [isPlaying]);\n\n const {\n isDownloadStarted,\n downloadProgress: directDownloadProgress,\n handleDownloadClick,\n } = useMediaDownload(getMessageMediaHash(message, 'download'), getMessageAudioCaption(message));\n\n const isLoadingForPlaying = isActivated && !isBuffered;\n\n const {\n isUploading, isTransferring, transferProgress,\n } = getMediaTransferState(\n message,\n isDownloadStarted ? directDownloadProgress : (uploadProgress || downloadProgress),\n isLoadingForPlaying || isDownloadStarted,\n );\n\n const {\n shouldRender: shouldRenderSpinner,\n transitionClassNames: spinnerClassNames,\n } = useShowTransition(isTransferring);\n\n const handleButtonClick = useCallback(() => {\n if (isUploading) {\n if (onCancelUpload) {\n onCancelUpload();\n }\n\n return;\n }\n\n if (!isPlaying) {\n onPlay(message.id, message.chatId);\n }\n\n setIsActivated(!isActivated);\n playPause();\n }, [isPlaying, isUploading, message.id, message.chatId, onCancelUpload, onPlay, playPause, isActivated]);\n\n useEffect(() => {\n if (isPlaying && onReadMedia && isMediaUnread) {\n onReadMedia();\n }\n }, [isPlaying, isMediaUnread, onReadMedia]);\n\n const handleSeek = useCallback((e: React.MouseEvent) => {\n if (isSeeking.current) {\n const seekBar = e.currentTarget.closest('.seekline,.waveform');\n if (seekBar) {\n const { width, left } = seekBar.getBoundingClientRect();\n setCurrentTime(duration * ((e.clientX - left) / width));\n }\n }\n }, [duration, setCurrentTime]);\n\n const handleStartSeek = useCallback((e: React.MouseEvent) => {\n isSeeking.current = true;\n handleSeek(e);\n }, [handleSeek]);\n\n const handleStopSeek = useCallback(() => {\n isSeeking.current = false;\n }, []);\n\n const handleDateClick = useCallback(() => {\n onDateClick!(message.id, message.chatId);\n }, [onDateClick, message.id, message.chatId]);\n\n function getFirstLine() {\n if (isVoice) {\n return senderTitle || 'Voice';\n }\n\n const { title, fileName } = audio!;\n\n return title || fileName;\n }\n\n function getSecondLine() {\n if (isVoice) {\n return formatMediaDuration(voice!.duration);\n }\n\n const { performer } = audio!;\n\n return (\n <>\n {performer && renderText(performer)}\n {performer && senderTitle && }\n {senderTitle && renderText(senderTitle)}\n \n );\n }\n\n const seekHandlers = { handleStartSeek, handleSeek, handleStopSeek };\n const isOwn = isOwnMessage(message);\n const renderedWaveform = useMemo(\n () => voice && renderWaveform(voice, playProgress, isOwn, seekHandlers, theme),\n [voice, playProgress, isOwn, seekHandlers, theme],\n );\n\n const fullClassName = buildClassName(\n 'Audio media-inner',\n className,\n isOwn && !target && 'own',\n target && 'bigger',\n isSelected && 'audio-is-selected',\n );\n\n const buttonClassNames = ['toggle-play'];\n if (isLoadingForPlaying) {\n buttonClassNames.push('loading');\n } else if (isPlaying) {\n buttonClassNames.push('pause');\n } else if (!isPlaying) {\n buttonClassNames.push('play');\n }\n\n const showSeekline = isPlaying || (playProgress > 0 && playProgress < 1);\n const contentClassName = buildClassName('content', showSeekline && 'with-seekline');\n\n function renderSearchResult() {\n return (\n <>\n
\n
\n

{renderText(getFirstLine())}

\n\n
\n {date && (\n \n {formatPastTimeShort(lang, date * 1000)}\n \n )}\n
\n
\n\n {showSeekline && renderSeekline(playProgress, bufferedProgress, seekHandlers)}\n {!showSeekline && (\n

\n {playProgress > 0 ? `${formatMediaDuration(duration * playProgress)} / ` : undefined}\n {getSecondLine()}\n

\n )}\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 && (\n \n \n \n )}\n {target === 'searchResult' && renderSearchResult()}\n {target !== 'searchResult' && audio && renderAudio(\n lang, audio, isPlaying, playProgress, bufferedProgress, seekHandlers, date,\n onDateClick ? handleDateClick : undefined,\n )}\n {target !== 'searchResult' && voice && renderVoice(voice, renderedWaveform, isMediaUnread)}\n
\n );\n};\n\nfunction renderAudio(\n lang: LangFn,\n audio: ApiAudio,\n isPlaying: boolean,\n playProgress: number,\n bufferedProgress: number,\n seekHandlers: ISeekMethods,\n date?: number,\n handleDateClick?: NoneToVoidFunction,\n) {\n const {\n title, performer, duration, fileName,\n } = audio;\n const showSeekline = isPlaying || (playProgress > 0 && playProgress < 1);\n\n return (\n
\n

{renderText(title || fileName)}

\n {showSeekline && renderSeekline(playProgress, bufferedProgress, seekHandlers)}\n {!showSeekline && (\n
\n {renderText(performer || 'Unknown')}\n {date && (\n <>\n {' '}\n •\n {' '}\n {formatMediaDateTime(lang, date * 1000)}\n \n )}\n
\n )}\n

\n {playProgress > 0 ? `${formatMediaDuration(duration * playProgress)} / ` : undefined}\n {formatMediaDuration(duration)}\n

\n
\n );\n}\n\nfunction renderVoice(voice: ApiVoice, renderedWaveform: any, isMediaUnread?: boolean) {\n return (\n
\n {renderedWaveform}\n

\n {formatMediaDuration(voice.duration)}\n {isMediaUnread && }\n

\n
\n );\n}\n\nfunction renderWaveform(\n voice: ApiVoice,\n playProgress = 0,\n isOwn = false,\n { handleStartSeek, handleSeek, handleStopSeek }: ISeekMethods,\n theme: ISettings['theme'],\n) {\n const { waveform, duration } = voice;\n\n if (!waveform) {\n return undefined;\n }\n\n const fillColor = theme === 'dark' ? '#494B75' : '#CBCBCB';\n const fillOwnColor = theme === 'dark' ? '#C0BBED' : '#B0DEA6';\n const progressFillColor = theme === 'dark' ? '#868DF5' : '#54a3e6';\n const progressFillOwnColor = theme === 'dark' ? '#FFFFFF' : '#53ad53';\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 const { data: spikes, peak } = interpolateArray(decodedWaveform, spikesCount);\n const { src, width, height } = renderWaveformToDataUri(spikes, playProgress, {\n peak,\n fillStyle: isOwn ? fillOwnColor : fillColor,\n progressFillStyle: isOwn ? progressFillOwnColor : progressFillColor,\n });\n\n return (\n // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions\n \n );\n}\n\nfunction renderSeekline(\n playProgress: number,\n bufferedProgress: number,\n { handleStartSeek, handleSeek, handleStopSeek }: ISeekMethods,\n) {\n return (\n \n \n \n \n \n \n \n \n \n \n
\n );\n}\n\nexport default memo(Audio);\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","type IWaveformProps = {\n peak: number;\n fillStyle: string;\n progressFillStyle: string;\n};\n\nconst SPIKE_WIDTH = 2;\nconst SPIKE_STEP = 4;\nconst SPIKE_RADIUS = 1;\nconst HEIGHT = 23;\n\nexport function renderWaveformToDataUri(\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 const canvas = document.createElement('canvas');\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 return {\n src: canvas.toDataURL(),\n width,\n height,\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","import React, {\n FC, useLayoutEffect, useRef, memo,\n} from '../../lib/teact/teact';\n\nimport buildClassName from '../../util/buildClassName';\nimport renderText from '../common/helpers/renderText';\n\nimport './Tab.scss';\n\ntype OwnProps = {\n className?: string;\n title: string;\n active?: boolean;\n badgeCount?: number;\n isBadgeActive?: boolean;\n previousActiveTab?: number;\n onClick: (arg: number) => void;\n clickArg: number;\n};\n\nconst Tab: FC = ({\n className,\n title,\n active,\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 useLayoutEffect(() => {\n if (!active || previousActiveTab === undefined) {\n return;\n }\n\n const tab = tabRef.current!;\n const indicator = tab.querySelector('i')!;\n const prevTab = tab.parentElement!.children[previousActiveTab];\n if (!prevTab) {\n return;\n }\n const currentIndicator = prevTab.querySelector('i')!;\n\n currentIndicator.classList.remove('animate');\n indicator.classList.remove('animate');\n\n // We move and resize our indicator so it repeats the position and size of the previous one.\n const shiftLeft = currentIndicator.parentElement!.offsetLeft - indicator.parentElement!.offsetLeft;\n const scaleFactor = currentIndicator.clientWidth / indicator.clientWidth;\n indicator.style.transform = `translate3d(${shiftLeft}px, 0, 0) scale3d(${scaleFactor}, 1, 1)`;\n\n // 3 AFs needed here to synchronize animations with Transition component\n requestAnimationFrame(() => {\n requestAnimationFrame(() => {\n requestAnimationFrame(() => {\n // Now we remove the transform to let it animate to its own position and size.\n indicator.classList.add('animate');\n indicator.style.transform = 'none';\n });\n });\n });\n }, [active, previousActiveTab]);\n\n return (\n onClick(clickArg)}\n ref={tabRef}\n >\n \n {renderText(title)}\n {!!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 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\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 if (container.scrollWidth <= container.offsetWidth) {\n return;\n }\n\n const activeTabElement = container.querySelector('.Tab.active') as HTMLElement | null;\n if (activeTabElement) {\n const newLeft = activeTabElement.offsetLeft - (container.offsetWidth / 2) + (activeTabElement.offsetWidth / 2);\n\n // Prevent scrolling by only a couple of pixels, which doesn't look smooth\n if (Math.abs(newLeft - container.scrollLeft) < TAB_SCROLL_THRESHOLD_PX) {\n return;\n }\n\n fastSmoothScrollHorizontal(container, newLeft);\n }\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 { ApiError } 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\n // Non-API errors\n SERVICE_WORKER_DISABLED: 'Service Worker is disabled. Please reload the page without holding key.',\n // eslint-disable-next-line max-len\n CAPTION_TOO_LONG_PLEASE_REMOVE_CHARACTERS: 'The provided caption 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};\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","// 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","import { useMemo } from '../lib/teact/teact';\nimport { getDispatch } from '../lib/teact/teactn';\n\nimport { ApiChat, ApiUser } from '../api/types';\n\nimport {\n isChatArchived, getCanDeleteChat, isChatPrivate, isChatChannel,\n} from '../modules/helpers';\nimport useLang from './useLang';\n\nexport default ({\n chat,\n privateChatUser,\n handleDelete,\n folderId,\n isPinned,\n isMuted,\n}: {\n chat: ApiChat | undefined;\n privateChatUser: ApiUser | undefined;\n handleDelete: () => void;\n folderId?: number;\n isPinned?: boolean;\n isMuted?: boolean;\n}) => {\n const lang = useLang();\n\n const {\n toggleChatPinned,\n updateChatMutedState,\n toggleChatArchived,\n toggleChatUnread,\n } = getDispatch();\n\n return useMemo(() => {\n if (!chat) {\n return undefined;\n }\n\n const isChatWithSelf = privateChatUser && privateChatUser.isSelf;\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 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 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: isChatPrivate(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 return [\n actionUnreadMark,\n actionPin,\n ...(!isChatWithSelf ? [\n actionMute,\n actionArchive,\n ] : []),\n actionDelete,\n ];\n }, [\n chat, privateChatUser, lang, isPinned, handleDelete, toggleChatUnread, toggleChatPinned, folderId,\n updateChatMutedState, toggleChatArchived, isMuted,\n ]);\n};\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 } 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 );\n};\n\nexport default memo(MessageOutgoingStatus);\n","import { useState, useEffect } from '../lib/teact/teact';\nimport { IAnchorPosition } from '../types';\n\nconst MENU_POSITION_VISUAL_COMFORT_SPACE_PX = 16;\n\nexport default (\n anchor: IAnchorPosition | undefined,\n getTriggerElement: () => HTMLElement | null,\n getRootElement: () => HTMLElement | null,\n getMenuElement: () => HTMLElement | null,\n extraPaddingX = 0,\n extraTopPadding = 0,\n) => {\n const [positionX, setPositionX] = useState<'right' | 'left'>('right');\n const [positionY, setPositionY] = useState<'top' | 'bottom'>('bottom');\n const [style, setStyle] = useState('');\n\n useEffect(() => {\n const triggerEl = getTriggerElement();\n if (!anchor || !triggerEl) {\n return;\n }\n\n let { x, y } = anchor;\n const emptyRect = {\n width: 0, left: 0, height: 0, top: 0,\n };\n\n const menuEl = getMenuElement();\n const rootEl = getRootElement();\n\n const triggerRect = triggerEl.getBoundingClientRect();\n const menuRect = menuEl ? { width: menuEl.offsetWidth, height: menuEl.offsetHeight } : emptyRect;\n const rootRect = rootEl ? rootEl.getBoundingClientRect() : emptyRect;\n\n let horizontalPostition: 'left' | 'right';\n if (x + menuRect.width + extraPaddingX < rootRect.width + rootRect.left) {\n x += 3;\n horizontalPostition = 'left';\n } else if (x - menuRect.width > 0) {\n horizontalPostition = 'right';\n x -= 3;\n } else {\n horizontalPostition = 'left';\n x = 16;\n }\n setPositionX(horizontalPostition);\n\n if (y + menuRect.height < rootRect.height + rootRect.top) {\n setPositionY('top');\n } else {\n setPositionY('bottom');\n\n if (y - menuRect.height < rootRect.top + extraTopPadding) {\n y = rootRect.top + extraTopPadding + menuRect.height;\n }\n }\n\n const left = horizontalPostition === '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\n setStyle(`left: ${left}px; top: ${y - triggerRect.top}px;`);\n }, [\n anchor, extraPaddingX, extraTopPadding,\n getMenuElement, getRootElement, getTriggerElement,\n ]);\n\n return {\n positionX,\n positionY,\n style,\n };\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 {\n useCallback, useEffect, useRef, useState,\n} from '../lib/teact/teact';\n\nimport { register } from '../util/audioPlayer';\nimport useEffectWithPrevDeps from './useEffectWithPrevDeps';\nimport { isSafariPatchInProgress } from '../util/patchSafariProgressiveAudio';\nimport useOnChange from './useOnChange';\n\ntype Handler = (e: Event) => void;\n\nexport default (\n trackId: string,\n originalDuration: number, // Sometimes incorrect for voice messages\n src?: string,\n handlers?: Record,\n onInit?: (element: HTMLAudioElement) => void,\n shouldPlay = false,\n onForcePlay?: NoneToVoidFunction,\n noPlaylist = 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 useOnChange(() => {\n controllerRef.current = register(trackId, (eventName, e) => {\n switch (eventName) {\n case 'onPlay':\n setIsPlaying(true);\n break;\n case 'onPause':\n setIsPlaying(false);\n break;\n case 'onTimeUpdate': {\n const { proxy } = controllerRef.current!;\n const duration = proxy.duration && Number.isFinite(proxy.duration) ? proxy.duration : originalDuration;\n setPlayProgress(proxy.currentTime / duration);\n break;\n }\n }\n\n if (handlers && handlers[eventName]) {\n handlers[eventName](e);\n }\n }, onForcePlay);\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 const {\n play, pause, setCurrentTime, proxy, destroy,\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)) {\n setPlayProgress(proxy.currentTime / duration);\n }\n }, [duration, playProgress, proxy]);\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 playPause = useCallback(() => {\n if (isPlaying) {\n pause();\n } else if (src) {\n play(src);\n }\n }, [src, pause, play, isPlaying]);\n\n return {\n isPlaying: isPlayingSync,\n playProgress,\n playPause,\n setCurrentTime,\n audioProxy: proxy,\n duration,\n };\n};\n","import { IS_SAFARI } from './environment';\nimport safePlay from './safePlay';\nimport { patchSafariProgressiveAudio, isSafariPatchInProgress } from './patchSafariProgressiveAudio';\nimport { getDispatch } from '../lib/teact/teactn';\nimport { parseMessageKey } from '../modules/helpers';\n\ntype Handler = (eventName: string, e: Event) => void;\n\ninterface Track {\n audio: HTMLAudioElement;\n proxy: HTMLAudioElement;\n handlers: Handler[];\n onForcePlay?: NoneToVoidFunction;\n}\n\nconst tracks = new Map();\nlet queue: string[] = [];\n\nlet currentTrackId: string | undefined;\n\nfunction createAudio(trackId: string, onForcePlay?: NoneToVoidFunction) {\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 (isSafariPatchInProgress(audio)) {\n return;\n }\n\n const nextTrackId = queue[queue.indexOf(trackId) + 1];\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(nextTrackId));\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\n return {\n audio,\n proxy: new Proxy(audio, {\n get: (origin, key: keyof HTMLAudioElement) => origin[key],\n }),\n handlers: [],\n onForcePlay,\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(trackId: string, handler: Handler, onForcePlay?: NoneToVoidFunction) {\n if (!tracks.has(trackId)) {\n tracks.set(trackId, createAudio(trackId, onForcePlay));\n\n if (!queue.includes(trackId)) {\n queue.push(trackId);\n }\n }\n\n const { audio, proxy, handlers } = tracks.get(trackId)!;\n\n handlers.push(handler);\n\n return {\n play(src: string) {\n if (currentTrackId && currentTrackId !== trackId) {\n tracks.get(currentTrackId)!.audio.pause();\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 patchSafariProgressiveAudio(audio);\n }\n }\n\n safePlay(audio);\n },\n\n pause() {\n if (currentTrackId === trackId) {\n audio.pause();\n }\n },\n\n setCurrentTime(time: number) {\n if (currentTrackId === trackId) {\n audio.currentTime = time;\n }\n },\n\n proxy,\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 queue = queue.filter((id) => id !== trackId);\n }\n\n if (trackId === currentTrackId) {\n currentTrackId = undefined;\n }\n }\n },\n };\n}\n","export default function download(url: string, filename: string) {\n const link = document.createElement('a');\n link.href = url;\n link.download = filename;\n link.click();\n}\n","import { RefObject } from 'react';\nimport React, { FC, memo, useRef } from '../../lib/teact/teact';\n\nimport useShowTransition from '../../hooks/useShowTransition';\nimport useTransitionForMedia from '../../hooks/useTransitionForMedia';\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 {\n shouldRender: shouldSpinnerRender,\n transitionClassNames: spinnerClassNames,\n } = useShowTransition(isTransferring, undefined, true);\n const color = getColorFromExtension(extension);\n const sizeString = getFileSizeString(size);\n\n const {\n shouldRenderThumb, shouldRenderFullMedia, transitionClassNames,\n } = useTransitionForMedia(previewData, 'slow');\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 {shouldRenderThumb && (\n \n )}\n {shouldRenderFullMedia && (\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)}\n \n )}\n
\n
\n {sender && timestamp && (\n {formatPastTimeShort(lang, timestamp * 1000)}\n )}\n
\n );\n};\n\nexport default memo(File);\n","import React, { useCallback, useEffect, useState } from '../lib/teact/teact';\n\nimport useMediaWithDownloadProgress from './useMediaWithDownloadProgress';\nimport download from '../util/download';\n\nexport default function useMediaDownload(\n mediaHash?: string,\n fileName?: string,\n) {\n const [isDownloadStarted, setIsDownloadStarted] = useState(false);\n\n const { mediaData, downloadProgress } = useMediaWithDownloadProgress(mediaHash, !isDownloadStarted);\n\n // Download with browser when fully loaded\n useEffect(() => {\n if (isDownloadStarted && mediaData) {\n download(mediaData, fileName!);\n setIsDownloadStarted(false);\n }\n }, [fileName, mediaData, isDownloadStarted]);\n\n // Cancel download on source change\n useEffect(() => {\n setIsDownloadStarted(false);\n }, [mediaHash]);\n\n const handleDownloadClick = useCallback((e: React.SyntheticEvent) => {\n e.stopPropagation();\n setIsDownloadStarted((isAllowed) => !isAllowed);\n }, []);\n\n return {\n isDownloadStarted,\n downloadProgress,\n handleDownloadClick,\n };\n}\n","import React, {\n FC,\n memo,\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 { TextPart } from '../common/helpers/renderMessageText';\nimport buildClassName from '../../util/buildClassName';\nimport captureEscKeyListener from '../../util/captureEscKeyListener';\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 memo(Notification);\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 {\n useCallback, useEffect, useMemo, useState,\n} from '../../../../lib/teact/teact';\n\nimport { EDITABLE_INPUT_ID } from '../../../../config';\nimport { MEMO_EMPTY_ARRAY } from '../../../../util/memo';\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 useFlag from '../../../../hooks/useFlag';\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;\nconst RE_BR = /(
|)/g;\nconst RE_SPACE = / /g;\nconst RE_CLEAN_HTML = /(
|<\\/div>)/gi;\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 html: 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\n const [byId, setById] = useState | undefined>();\n const [keywords, setKeywords] = useState();\n const [byKeyword, setByKeyword] = useState>({});\n const [names, setNames] = useState();\n const [byName, setByName] = useState>({});\n const [shouldForceInsertEmoji, setShouldForceInsertEmoji] = useState(false);\n\n const [filteredEmojis, setFilteredEmojis] = useState(MEMO_EMPTY_ARRAY);\n\n const recentEmojis = useMemo(\n () => {\n if (!byId || !recentEmojiIds.length) {\n return [];\n }\n\n return Object.values(pickTruthy(byId, recentEmojiIds));\n },\n [byId, recentEmojiIds],\n );\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 useEffect(() => {\n if (!byId || isDisabled) {\n return;\n }\n\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 setByKeyword({ ...baseEmojisByKeyword, ...emojisByKeyword });\n setKeywords([...Object.keys(baseEmojisByKeyword), ...Object.keys(emojisByKeyword)]);\n\n const emojisByName = 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 setByName(emojisByName);\n setNames(Object.keys(emojisByName));\n }, [isDisabled, baseEmojiKeywords, byId, emojiKeywords]);\n\n useEffect(() => {\n if (!isAllowed || !html || !byId || !keywords || !keywords.length) {\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[] = [];\n\n setShouldForceInsertEmoji(forceSend);\n\n if (!filter) {\n matched = recentEmojis;\n } else if (filter.length >= FILTER_MIN_LENGTH) {\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\n if (matched.length) {\n if (!forceSend) {\n markIsOpen();\n }\n setFilteredEmojis(matched.slice(0, EMOJIS_LIMIT));\n } else {\n unmarkIsOpen();\n }\n }, [\n byId, byKeyword, keywords, byName, names, html, isAllowed, markIsOpen,\n recentEmojis, unmarkIsOpen, setShouldForceInsertEmoji,\n ]);\n\n const insertEmoji = useCallback((textEmoji: string, isForce?: boolean) => {\n const atIndex = html.lastIndexOf(':', isForce ? html.lastIndexOf(':') - 1 : undefined);\n if (atIndex !== -1) {\n onUpdateHtml(`${html.substr(0, atIndex)}${textEmoji}`);\n const messageInput = document.getElementById(inputId)!;\n requestAnimationFrame(() => {\n focusEditableElement(messageInput, true);\n });\n }\n\n unmarkIsOpen();\n }, [html, 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 = html\n .replace(RE_SPACE, ' ')\n .replace(RE_BR, '\\n')\n .replace(RE_CLEAN_HTML, '')\n .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","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 { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { IAnchorPosition, ISettings } from '../../../types';\n\nimport { EDITABLE_INPUT_ID } from '../../../config';\nimport { selectCurrentMessageList, selectReplyingToId } from '../../../modules/selectors';\nimport { debounce } from '../../../util/schedulers';\nimport focusEditableElement from '../../../util/focusEditableElement';\nimport buildClassName from '../../../util/buildClassName';\nimport { pick } from '../../../util/iteratees';\nimport {\n IS_ANDROID, 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 parseEmojiOnlyString from '../../common/helpers/parseEmojiOnlyString';\nimport { isSelectionInsideInput } from './helpers/selection';\nimport useLang from '../../../hooks/useLang';\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 isAttachmentModalInput?: boolean;\n editableInputId?: string;\n html: string;\n placeholder: string;\n forcedPlaceholder?: string;\n shouldSetFocus: boolean;\n shouldSuppressFocus?: boolean;\n shouldSuppressTextFormatter?: boolean;\n onUpdate: (html: string) => void;\n onSuppressedFocus?: () => void;\n onSend: () => void;\n};\n\ntype StateProps = {\n currentChatId?: number;\n replyingToId?: number;\n noTabCapture?: boolean;\n messageSendKeyCombo?: ISettings['messageSendKeyCombo'];\n};\n\ntype DispatchProps = Pick;\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 isAttachmentModalInput,\n editableInputId,\n html,\n placeholder,\n forcedPlaceholder,\n shouldSetFocus,\n shouldSuppressFocus,\n shouldSuppressTextFormatter,\n onUpdate,\n onSuppressedFocus,\n onSend,\n currentChatId,\n replyingToId,\n noTabCapture,\n messageSendKeyCombo,\n editLastMessage,\n replyToNextMessage,\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 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 focusInput = useCallback(() => {\n // Avoid focusing during animation\n if (inputRef.current!.closest('.from, .to')) {\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;\n }\n\n const selection = window.getSelection();\n if (!selection || !selection.rangeCount || isContextMenuOpenRef.current) {\n closeTextFormatter();\n return;\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;\n }\n\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 checkSelection();\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 checkSelection();\n\n e.target.removeEventListener('keyup', handleKeyUp);\n }\n\n if (e.metaKey && !html.length) {\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) {\n e.preventDefault();\n editLastMessage();\n } else {\n e.target.addEventListener('keyup', handleKeyUp);\n }\n }\n\n function handleTouchSelection() {\n if (!IS_ANDROID) {\n return;\n }\n\n checkSelection();\n }\n\n function handleChange(e: ChangeEvent) {\n const { innerHTML, textContent } = e.currentTarget;\n\n onUpdate(innerHTML === SAFARI_BR ? '' : innerHTML);\n\n // Reset focus on the input to remove any active styling when input is cleared\n if (!IS_TOUCH_ENV && (!textContent || !textContent.length)) {\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 (!IS_ANDROID) {\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 focusInput();\n }, [currentChatId, focusInput, replyingToId, shouldSetFocus]);\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): StateProps => {\n const { chatId: currentChatId, threadId } = selectCurrentMessageList(global) || {};\n const { messageSendKeyCombo } = global.settings.byKey;\n\n return {\n currentChatId,\n messageSendKeyCombo,\n replyingToId: currentChatId && threadId ? selectReplyingToId(global, currentChatId, threadId) : undefined,\n noTabCapture: global.isPollModalOpen || global.payment.isPaymentModalOpen,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['editLastMessage', 'replyToNextMessage']),\n)(MessageInput));\n","import React, { FC, memo, useCallback } from '../../lib/teact/teact';\n\nimport { ApiMessage, ApiWebPage } from '../../api/types';\n\nimport { getFirstLinkInMessage, getMessageSummaryText, getMessageWebPage } 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';\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 onMessageClick: (messageId: number, chatId: number) => void;\n};\n\nconst WebLink: FC = ({ message, senderTitle, onMessageClick }) => {\n const lang = useLang();\n\n let linkData: ApiWebPage | undefined = getMessageWebPage(message);\n\n if (!linkData) {\n const link = getFirstLinkInMessage(message);\n if (link) {\n const { url, domain } = link;\n const messageText = getMessageSummaryText(lang, message);\n\n linkData = {\n siteName: domain.replace(/^www./, ''),\n url: url.includes('://') ? url : url.includes('@') ? `mailto:${url}` : `http://${url}`,\n description: messageText !== url ? messageText : undefined,\n } as ApiWebPage;\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 photo,\n video,\n } = linkData;\n\n const truncatedDescription = !senderTitle && 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 && (\n \n {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 { useCallback } from '../../../../lib/teact/teact';\n\nexport enum ChatAnimationTypes {\n Move,\n Opacity,\n None,\n}\n\nexport function useChatAnimationType(orderDiffById: Record) {\n const movesUp = useCallback((id: number) => orderDiffById[id] < 0, [orderDiffById]);\n const movesDown = useCallback((id: number) => orderDiffById[id] > 0, [orderDiffById]);\n\n const orderDiffIds = Object.keys(orderDiffById).map(Number);\n const numberOfUp = orderDiffIds.filter(movesUp).length;\n const numberOfDown = orderDiffIds.filter(movesDown).length;\n\n return useCallback((chatId: number): ChatAnimationTypes => {\n const orderDiff = orderDiffById[chatId];\n\n if (orderDiff === 0) {\n return ChatAnimationTypes.None;\n }\n\n if (\n orderDiff === Infinity\n || orderDiff === -Infinity\n || (movesUp(chatId) && numberOfUp <= numberOfDown)\n || (movesDown(chatId) && numberOfDown < numberOfUp)\n ) {\n return ChatAnimationTypes.Opacity;\n }\n\n return ChatAnimationTypes.Move;\n }, [movesDown, movesUp, numberOfDown, numberOfUp, 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, {\n FC, memo, useCallback, useLayoutEffect, useMemo, useRef,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport useLang, { LangFn } from '../../../hooks/useLang';\n\nimport { GlobalActions } from '../../../global/types';\nimport {\n ApiChat, ApiUser, ApiMessage, ApiMessageOutgoingStatus, ApiFormattedText, MAIN_THREAD_ID,\n} from '../../../api/types';\n\nimport { ANIMATION_END_DELAY } from '../../../config';\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../../util/environment';\nimport {\n getChatTitle,\n isChatPrivate,\n isActionMessage,\n getPrivateChatUserId,\n getMessageAction,\n getMessageSenderName,\n isChatChannel,\n getMessageMediaHash,\n getMessageSummaryText,\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,\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 { pick } from '../../../util/iteratees';\nimport useEnsureMessage from '../../../hooks/useEnsureMessage';\nimport useChatContextActions from '../../../hooks/useChatContextActions';\nimport useFlag from '../../../hooks/useFlag';\nimport useMedia from '../../../hooks/useMedia';\nimport { ChatAnimationTypes } from './hooks';\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';\n\nimport './Chat.scss';\n\ntype OwnProps = {\n style?: string;\n chatId: number;\n folderId?: number;\n orderDiff: number;\n animationType: ChatAnimationTypes;\n isPinned?: boolean;\n};\n\ntype StateProps = {\n chat?: ApiChat;\n isMuted?: boolean;\n privateChatUser?: ApiUser;\n actionTargetUserIds?: number[];\n usersById?: Record;\n actionTargetMessage?: ApiMessage;\n actionTargetChatId?: number;\n lastMessageSender?: ApiUser;\n lastMessageOutgoingStatus?: ApiMessageOutgoingStatus;\n draft?: ApiFormattedText;\n animationLevel?: number;\n isSelected?: boolean;\n canScrollDown?: boolean;\n lastSyncTime?: number;\n};\n\ntype DispatchProps = Pick;\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 privateChatUser,\n actionTargetUserIds,\n usersById,\n lastMessageSender,\n lastMessageOutgoingStatus,\n actionTargetMessage,\n actionTargetChatId,\n draft,\n animationLevel,\n isSelected,\n canScrollDown,\n lastSyncTime,\n openChat,\n focusLastMessage,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const ref = useRef(null);\n\n const [isDeleteModalOpen, openDeleteModal, closeDeleteModal] = useFlag();\n const [shouldRenderDeleteModal, markRenderDeleteModal, unmarkRenderDeleteModal] = 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 return actionTargetUserIds\n ? actionTargetUserIds.map((userId) => usersById && usersById[userId]).filter(Boolean as any)\n : undefined;\n }, [actionTargetUserIds, usersById]);\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 const contextActions = useChatContextActions({\n chat,\n privateChatUser,\n handleDelete,\n folderId,\n isPinned,\n isMuted,\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 && 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 actionOrigin = chat && (isChatChannel(chat) || lastMessage.senderId === lastMessage.chatId)\n ? chat\n : lastMessageSender;\n\n return (\n

\n {renderText(renderActionMessageText(\n lang,\n lastMessage,\n actionOrigin,\n actionTargetUsers,\n actionTargetMessage,\n actionTargetChatId,\n { asPlain: true },\n ) as string)}\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 {renderMessageSummary(lang, lastMessage!, mediaBlobUrl || mediaThumbnail, isRoundVideo)}\n

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

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

\n {chat.isVerified && }\n {isMuted && }\n {chat.lastMessage && (\n \n )}\n
\n
\n {renderLastMessageOrTyping()}\n \n
\n
\n {shouldRenderDeleteModal && (\n \n )}\n \n );\n};\n\nfunction renderMessageSummary(lang: LangFn, message: ApiMessage, blobUrl?: string, isRoundVideo?: boolean) {\n if (!blobUrl) {\n return renderText(getMessageSummaryText(lang, message));\n }\n\n return (\n \n \"\"\n {getMessageVideo(message) && }\n {renderText(getMessageSummaryText(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 { byId: usersById } = global.users;\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 lastSyncTime: global.lastSyncTime,\n ...(isOutgoing && { lastMessageOutgoingStatus: selectOutgoingStatus(global, chat.lastMessage) }),\n ...(privateChatUserId && { privateChatUser: selectUser(global, privateChatUserId) }),\n ...(actionTargetUserIds && { usersById }),\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'openChat',\n 'focusLastMessage',\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, useCallback, useEffect,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport {\n ApiChat, ApiChatFolder, ApiUser,\n} from '../../../api/types';\nimport { NotifyException, NotifySettings, SettingsScreens } from '../../../types';\nimport { FolderEditDispatch } from '../../../hooks/reducers/useFoldersReducer';\n\nimport { ALL_CHATS_PRELOAD_DISABLED, CHAT_HEIGHT_PX, CHAT_LIST_SLICE } from '../../../config';\nimport { IS_ANDROID, IS_MAC_OS, IS_PWA } from '../../../util/environment';\nimport usePrevious from '../../../hooks/usePrevious';\nimport { mapValues, pick } from '../../../util/iteratees';\nimport { getChatOrder, prepareChatList, prepareFolderListIds } from '../../../modules/helpers';\nimport {\n selectChatFolder, selectNotifyExceptions, selectNotifySettings,\n} from '../../../modules/selectors';\nimport useInfiniteScroll from '../../../hooks/useInfiniteScroll';\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 onScreenSelect?: (screen: SettingsScreens) => void;\n foldersDispatch?: FolderEditDispatch;\n};\n\ntype StateProps = {\n chatsById: Record;\n usersById: Record;\n chatFolder?: ApiChatFolder;\n listIds?: number[];\n orderedPinnedIds?: number[];\n lastSyncTime?: number;\n notifySettings: NotifySettings;\n notifyExceptions?: Record;\n};\n\ntype DispatchProps = Pick;\n\nenum FolderTypeToListType {\n 'all' = 'active',\n 'archived' = 'archived'\n}\n\nconst ChatList: FC = ({\n folderType,\n folderId,\n isActive,\n chatFolder,\n chatsById,\n usersById,\n listIds,\n orderedPinnedIds,\n lastSyncTime,\n foldersDispatch,\n notifySettings,\n notifyExceptions,\n onScreenSelect,\n loadMoreChats,\n preloadTopChatMessages,\n openChat,\n openNextChat,\n}) => {\n const [currentListIds, currentPinnedIds] = useMemo(() => {\n return folderType === 'folder' && chatFolder\n ? prepareFolderListIds(chatsById, usersById, chatFolder, notifySettings, notifyExceptions)\n : [listIds, orderedPinnedIds];\n }, [folderType, chatFolder, chatsById, usersById, notifySettings, notifyExceptions, listIds, orderedPinnedIds]);\n\n const [orderById, orderedIds] = useMemo(() => {\n if (!currentListIds || (folderType === 'folder' && !chatFolder)) {\n return [];\n }\n const newChatArrays = prepareChatList(chatsById, currentListIds, currentPinnedIds, folderType);\n const singleList = [...newChatArrays.pinnedChats, ...newChatArrays.otherChats];\n const newOrderedIds = singleList.map(({ id }) => id);\n const newOrderById = singleList.reduce((acc, chat, i) => {\n acc[chat.id] = i;\n return acc;\n }, {} as Record);\n\n return [newOrderById, newOrderedIds];\n }, [currentListIds, currentPinnedIds, folderType, chatFolder, chatsById]);\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 order - (prevOrderById[id] !== undefined ? prevOrderById[id] : Infinity);\n });\n }, [orderById, prevOrderById]);\n\n const loadMoreOfType = useCallback(() => {\n loadMoreChats({ listType: folderType === 'archived' ? 'archived' : 'active' });\n }, [loadMoreChats, folderType]);\n\n const [viewportIds, getMore] = useInfiniteScroll(\n lastSyncTime ? loadMoreOfType : undefined,\n orderedIds,\n undefined,\n CHAT_LIST_SLICE,\n folderType === 'all' && !ALL_CHATS_PRELOAD_DISABLED,\n );\n\n // TODO Refactor to not call `prepareChatList` twice\n const chatArrays = viewportIds && prepareChatList(chatsById, viewportIds, currentPinnedIds, folderType);\n\n useEffect(() => {\n if (lastSyncTime && folderType === 'all') {\n preloadTopChatMessages();\n }\n }, [lastSyncTime, folderType, preloadTopChatMessages]);\n\n const getAnimationType = useChatAnimationType(orderDiffById);\n\n function renderChats() {\n const viewportOffset = orderedIds!.indexOf(viewportIds![0]);\n const pinnedOffset = viewportOffset + chatArrays!.pinnedChats.length;\n\n return (\n \n {chatArrays!.pinnedChats.map(({ id }, i) => (\n \n ))}\n {chatArrays!.otherChats.map((chat, i) => (\n \n ))}\n
\n );\n }\n\n useEffect(() => {\n const handleKeyDown = (e: KeyboardEvent) => {\n if (isActive && orderedIds) {\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\n document.addEventListener('keydown', handleKeyDown, false);\n\n return () => {\n document.removeEventListener('keydown', handleKeyDown, false);\n };\n });\n\n return (\n \n {viewportIds && viewportIds.length && chatArrays ? (\n renderChats()\n ) : viewportIds && !viewportIds.length ? (\n (\n \n )\n ) : (\n \n )}\n \n );\n};\n\nexport default memo(withGlobal(\n (global, { folderType, folderId }): StateProps => {\n const {\n chats: {\n listIds,\n byId: chatsById,\n orderedPinnedIds,\n },\n users: { byId: usersById },\n lastSyncTime,\n } = global;\n const listType = folderType !== 'folder' ? FolderTypeToListType[folderType] : undefined;\n const chatFolder = folderId ? selectChatFolder(global, folderId) : undefined;\n\n return {\n chatsById,\n usersById,\n lastSyncTime,\n notifySettings: selectNotifySettings(global),\n notifyExceptions: selectNotifyExceptions(global),\n ...(listType ? {\n listIds: listIds[listType],\n orderedPinnedIds: orderedPinnedIds[listType],\n } : {\n chatFolder,\n }),\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'loadMoreChats',\n 'preloadTopChatMessages',\n 'openChat',\n 'openNextChat',\n ]),\n)(ChatList));\n","import { ApiUser } from '../../../../api/types';\nimport { getUserFullName } from '../../../../modules/helpers';\nimport searchWords from '../../../../util/searchWords';\n\n// TODO: Support cyrillic translit search\nexport default function searchUserName(filter: string, user: ApiUser) {\n const usernameLowered = user.username.toLowerCase();\n const fullName = getUserFullName(user);\n const fullNameLowered = fullName && fullName.toLowerCase();\n const filterLowered = filter.toLowerCase();\n\n return usernameLowered.startsWith(filterLowered) || (\n fullNameLowered && searchWords(fullNameLowered, filterLowered)\n );\n}\n","import {\n useCallback, useEffect, useState, useMemo,\n} from '../../../../lib/teact/teact';\n\nimport { ApiMessageEntityTypes, ApiChatMember, ApiUser } from '../../../../api/types';\nimport { EDITABLE_INPUT_ID } from '../../../../config';\nimport { getUserFirstOrLastName } from '../../../../modules/helpers';\nimport searchUserName from '../helpers/searchUserName';\nimport focusEditableElement from '../../../../util/focusEditableElement';\nimport useFlag from '../../../../hooks/useFlag';\nimport { unique } from '../../../../util/iteratees';\nimport { throttle } from '../../../../util/schedulers';\n\nconst runThrottled = throttle((cb) => cb(), 500, true);\nconst RE_BR = /(
|)/g;\nconst RE_SPACE = / /g;\nconst RE_CLEAN_HTML = /(
|<\\/div>)/gi;\nconst RE_USERNAME_SEARCH = new RegExp('(^|\\\\s)@[\\\\w\\\\d_-]*$', 'gi');\n\nexport default function useMentionTooltip(\n canSuggestMembers: boolean | undefined,\n html: string,\n onUpdateHtml: (html: string) => void,\n inputId: string = EDITABLE_INPUT_ID,\n groupChatMembers?: ApiChatMember[],\n topInlineBotIds?: number[],\n currentUserId?: number,\n usersById?: Record,\n) {\n const [isOpen, markIsOpen, unmarkIsOpen] = useFlag();\n const [currentFilter, setCurrentFilter] = useState('');\n const [usersToMention, setUsersToMention] = useState();\n\n const topInlineBots = useMemo(() => {\n return (topInlineBotIds || []).map((id) => usersById && usersById[id]).filter(Boolean as any);\n }, [topInlineBotIds, usersById]);\n\n const getFilteredUsers = useCallback((filter, withInlineBots: boolean) => {\n if (!(groupChatMembers || topInlineBotIds) || !usersById) {\n setUsersToMention(undefined);\n\n return;\n }\n runThrottled(() => {\n const inlineBots = (withInlineBots ? topInlineBots : []).filter((inlineBot) => {\n return !filter || searchUserName(filter, inlineBot);\n });\n\n const chatMembers = (groupChatMembers || [])\n .map(({ userId }) => usersById[userId])\n .filter((user) => {\n if (!user || user.id === currentUserId) {\n return false;\n }\n\n return !filter || searchUserName(filter, user);\n });\n\n setUsersToMention(unique(inlineBots.concat(chatMembers)));\n });\n }, [currentUserId, groupChatMembers, topInlineBotIds, topInlineBots, usersById]);\n\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 setCurrentFilter(filter);\n getFilteredUsers(filter, canSuggestInlineBots(html));\n } else {\n unmarkIsOpen();\n }\n }, [canSuggestMembers, html, getFilteredUsers, markIsOpen, unmarkIsOpen]);\n\n useEffect(() => {\n if (usersToMention && 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 atIndex = html.lastIndexOf('@');\n if (atIndex !== -1) {\n onUpdateHtml(`${html.substr(0, atIndex)}${insertedHtml} `);\n const messageInput = document.getElementById(inputId)!;\n requestAnimationFrame(() => {\n focusEditableElement(messageInput, forceFocus);\n });\n }\n\n unmarkIsOpen();\n }, [html, inputId, onUpdateHtml, unmarkIsOpen]);\n\n return {\n isMentionTooltipOpen: isOpen,\n mentionFilter: currentFilter,\n closeMentionTooltip: unmarkIsOpen,\n insertMention,\n mentionFilteredUsers: usersToMention,\n };\n}\n\nfunction getUsernameFilter(html: string) {\n const username = html\n .replace(RE_SPACE, ' ')\n .replace(RE_BR, '\\n')\n .replace(RE_CLEAN_HTML, '')\n .replace(/\\n$/i, '')\n .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 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"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/0.e84aae32c1142e0538ad.js b/dist/0.e84aae32c1142e0538ad.js deleted file mode 100644 index bb5512bd..00000000 --- a/dist/0.e84aae32c1142e0538ad.js +++ /dev/null @@ -1,2 +0,0 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[0],Array(108).concat([function(e,t,n){"use strict";var a=n(0),r=n(6),c=n(10),i=n(9),s=n(150),o=n(182),l=n(25),d=n(16),u=n(44),m=n(55),b=n(43);n(216);t.a=e=>{const{ref:t,buttonRef:n,icon:h,className:f,style:p,children:O,disabled:g,ripple:v,narrow:j,inactive:E,focus:y,destructive:C,multiline:N,isStatic:T,contextActions:w,onClick:I}=e;let M=Object(a.q)(null);t&&(M=t);const[k,S,L]=Object(l.a)(),{isContextMenuOpen:A,contextMenuPosition:x,handleBeforeContextMenu:D,handleContextMenu:R,handleContextMenuClose:F,handleContextMenuHide:_}=Object(s.a)(M,!w),P=Object(a.m)(()=>M.current,[]),U=Object(a.m)(()=>M.current.closest(".custom-scroll"),[]),B=Object(a.m)(()=>M.current.querySelector(".ListItem-context-menu .bubble"),[]),{positionX:q,positionY:H,style:$}=Object(o.a)(x,P,U,B),K=Object(a.m)(e=>{!g&&I&&(I(e),r.n&&!v&&(S(),Object(c.b)(L)))},[g,S,I,v,L]),z=Object(a.m)(e=>{E||r.n||(!w||2!==e.button&&I||D(e),0===e.button&&(I?K(e):R(e)))},[E,w,I,D,R,K]),V=Object(d.a)(),Y=Object(i.a)("ListItem",f,!T&&"no-selection",v&&"has-ripple",j&&"narrow",g&&"disabled",E&&"inactive",x&&"has-menu-open",y&&"focus",C&&"destructive",N&&"multiline",T&&"is-static");return a.a.createElement("div",{ref:M,className:Y,dir:V.isRtl?"rtl":void 0,style:p},a.a.createElement("div",{className:Object(i.a)("ListItem-button",k&&"active"),role:"button",ref:n,tabIndex:0,onClick:!E&&r.n?K:void 0,onMouseDown:z,onContextMenu:!E&&w?R:void 0},h&&a.a.createElement("i",{className:"icon-"+h}),N&&a.a.createElement("div",{className:"multiline-item"},O),!N&&O,!g&&!E&&v&&a.a.createElement(u.a,null)),w&&void 0!==x&&a.a.createElement(m.a,{isOpen:A,positionX:q,positionY:H,style:$,className:"ListItem-context-menu",autoClose:!0,onClose:F,onCloseAnimationEnd:_},w.map(e=>a.a.createElement(b.a,{key:e.title,icon:e.icon,destructive:e.destructive,disabled:!e.handler,onClick:e.handler},e.title))))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i})),n.d(t,"c",(function(){return s})),n.d(t,"b",(function(){return o}));var a=n(0),r=n(10),c=n(37);function i({rootRef:e,throttleMs:t,debounceMs:n,shouldSkipFirst:i,margin:s,threshold:o,isDisabled:l},d){const u=Object(a.q)(),m=Object(a.q)(),b=Object(a.q)(0),h=Object(a.q)();m.current=d;const f=Object(a.m)(()=>{b.current++},[]),p=Object(a.m)(()=>{b.current&&(b.current--,!b.current&&h.current&&(h.current(),h.current=void 0))},[]);Object(c.c)(f,p),Object(a.n)(()=>{if(!l)return()=>{u.current&&(u.current.observer.disconnect(),u.current.callbacks.clear(),u.current=void 0)}},[l]);return{observe:Object(a.m)((a,c)=>{u.current||function(){const a=new Map,c=new Map,l=()=>{const e=Array.from(c.values());e.forEach(t=>{const n=a.get(t.target);n&&n(t,e)}),m.current&&m.current(e),c.clear()},d=t?r.h:n?r.a:void 0,f=d?d(l,t||n,!i):l,p=new IntersectionObserver(e=>{e.forEach(e=>{c.set(e.target,e)}),b.current?h.current=()=>{f()}:f()},{root:e.current,rootMargin:s?s+"px":void 0,threshold:o});u.current={observer:p,callbacks:a}}();const l=u.current;return l.observer.observe(a),c&&l.callbacks.set(a,c),()=>{c&&l.callbacks.delete(a),l.observer.unobserve(a)}},[l]),freeze:f,unfreeze:p}}function s(e,t,n){Object(a.n)(()=>t?t(e.current,n):void 0,[])}function o(e,t,n){const[r,c]=Object(a.r)(!t);return s(e,t,e=>{c(e.isIntersecting),n&&n(e)}),r}},function(e,t,n){"use strict";var a=n(0),r=n(8),c=n(57),i=n(31);t.a=(e,t=!1,n=r.ApiMediaFormat.BlobUrl,s,o)=>{const l=e?c.c(e):void 0,d=Object(i.a)();return Object(a.n)(()=>{if(!t&&e&&!l){const t=Date.now();c.b(e,n).then(()=>{const e=Date.now()-t;!o||e>=o?d():setTimeout(d,o-e)})}},[t,e,l,n,s,d,o]),l}},function(e,t,n){"use strict";var a=n(0),r=n(1),c=n(13),i=n(7),s=n(4),o=n(22),l=n(3),d=n(16),u=n(114),m=n(138),b=n(161);t.a=Object(a.h)(Object(r.h)((e,{userId:t,forceShowSelf:n})=>{const{lastSyncTime:a,serverTimeOffset:r}=e,c=Object(i.Jb)(e,t);return{lastSyncTime:a,user:c,isSavedMessages:!n&&c&&c.isSelf,areMessagesLoaded:Boolean(Object(i.n)(e,t)),serverTimeOffset:r}},(e,t)=>Object(l.l)(t,["loadFullUser","openMediaViewer"]))(({typingStatus:e,avatarSize:t="medium",status:n,withMediaViewer:r,withUsername:i,withFullInfo:l,withUpdatingStatus:h,noStatusOrTyping:f,noRtl:p,user:O,isSavedMessages:g,areMessagesLoaded:v,lastSyncTime:j,loadFullUser:E,openMediaViewer:y,serverTimeOffset:C})=>{const{id:N}=O||{},T=Object(s.bb)(O);Object(a.n)(()=>{l&&j&&N&&E({userId:N})},[N,E,j,l]);const w=Object(a.m)((e,n)=>{O&&n&&(e.stopPropagation(),y({avatarOwnerId:O.id,origin:"jumbo"===t?c.h.ProfileAvatar:c.h.MiddleHeaderAvatar}))},[O,t,y]),I=Object(d.a)();if(O)return a.a.createElement("div",{className:"ChatInfo",dir:!p&&I.isRtl?"rtl":void 0},a.a.createElement(u.a,{key:O.id,size:t,user:O,isSavedMessages:g,onClick:r?w:void 0}),a.a.createElement("div",{className:"info"},g?a.a.createElement("div",{className:"title"},a.a.createElement("h3",null,I("SavedMessages"))):a.a.createElement("div",{className:"title"},a.a.createElement("h3",{dir:"auto"},T&&Object(o.a)(T)),O&&O.isVerified&&a.a.createElement(m.a,null)),(n||!g&&!f)&&(n?a.a.createElement("span",{className:"status",dir:"auto"},n):h&&!v?a.a.createElement("span",{className:"status",dir:"auto"},I("Updating")):O?e?a.a.createElement(b.a,{typingStatus:e}):a.a.createElement("div",{className:"status "+(Object(s.Cb)(O)?"online":"")},i&&O.username&&a.a.createElement("span",{className:"handle"},O.username),a.a.createElement("span",{className:"user-status",dir:"auto"},Object(s.cb)(I,O,C))):void 0)))}))},function(e,t,n){"use strict";var a=n(0),r=n(56);var c=n(9),i=n(37),s=n(40),o=n(58),l=n(16),d=n(39),u=n(21),m=n(128);n(155);t.a=({title:e,className:t,isOpen:n,header:b,hasCloseButton:h,noBackdrop:f,children:p,onClose:O,onCloseAnimationEnd:g,onEnter:v,shouldSkipHistoryAnimations:j})=>{const{shouldRender:E,transitionClassNames:y}=Object(s.a)(n,g,j,void 0,j),C=Object(a.q)(null);Object(a.n)(()=>n?Object(r.a)({onEsc:O,onEnter:v}):void 0,[n,O,v]),Object(a.n)(()=>n&&C.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 r=0;a>=0&&(r=t.shiftKey?a>0?a-1:n.length-1:a{document.removeEventListener("keydown",t,!1)}}(C.current):void 0,[n]);const{forceClose:N}=Object(d.a)(n,O);Object(a.n)(()=>()=>{n&&N()},[]),Object(o.a)(([e])=>(document.body.classList.toggle("has-open-dialog",n),(n||!n&&void 0!==e)&&Object(i.d)(200),()=>{document.body.classList.remove("has-open-dialog")}),[n]);const T=Object(l.a)();if(!E)return;const w=Object(c.a)("Modal",t,y,f&&"transparent-backdrop");return a.a.createElement(m.a,null,a.a.createElement("div",{ref:C,className:w,tabIndex:-1,role:"dialog"},a.a.createElement("div",{className:"modal-container"},a.a.createElement("div",{className:"modal-backdrop",onClick:O}),a.a.createElement("div",{className:"modal-dialog"},b||(e?a.a.createElement("div",{className:"modal-header"},h&&a.a.createElement(u.a,{round:!0,color:"translucent",size:"smaller",ariaLabel:T("Close"),onClick:O},a.a.createElement("i",{className:"icon-close"})),a.a.createElement("div",{className:"modal-title"},e)):void 0),a.a.createElement("div",{className:"modal-content custom-scroll"},p)))))}},function(e,t,n){"use strict";var a=n(0),r=n(1),c=n(31),i=n(29),s=n(9),o=n(37),l=n(178);n(202);const d=Symbol("CLEANED_UP");t.a=({ref:e,activeKey:t,name:n,direction:u="auto",renderCount:m,shouldRestoreHeight:b,shouldCleanup:h,cleanupExceptionKey:f,id:p,className:O,onStart:g,onStop:v,children:j})=>{const{animationLevel:E}=Object(r.e)().settings.byKey;let y=Object(a.q)(null);e&&(y=e);const C=Object(a.q)({}),N=Object(i.a)(t),T=Object(c.a)(),w=void 0!==N&&t!==N;!m&&w&&(C.current={[N]:C.current[N]}),C.current[t]=j,Object(a.o)(()=>{function e(){!h||void 0!==f&&f===N||(C.current={[N]:d},T())}const a=y.current,r=a.children;if(1===r.length&&!w)return void r[0].classList.add("active");const c=Array.from(a.childNodes);if(!w||!c.length)return;const i=-1===u||"auto"===u&&N>t||"inverse"===u&&N{e instanceof HTMLElement&&(e.classList.remove("from","through","to"),e.classList.toggle("active",t===O))}),void e();let j;c.forEach((e,t)=>{e instanceof HTMLElement&&(e.classList.remove("active"),e.classList.toggle("from",t===p),e.classList.toggle("through",t>p&&tO),e.classList.toggle("to",t===O))}),E>0&&(j=Object(o.d)()),requestAnimationFrame(()=>{function t(){requestAnimationFrame(()=>{if(a.classList.remove("animating","backwards"),c.forEach((e,t)=>{e instanceof HTMLElement&&(e.classList.remove("from","through","to"),e.classList.toggle("active",t===O))}),b){const e=a.querySelector(".active");e&&(e.style.height="auto",a.style.height=e.clientHeight+"px")}j&&j(),e(),v&&v()})}a.classList.add("animating"),g&&g();const r="mv-slide"===n?c[O]&&c[O].firstChild:c[O];E>0&&r?Object(l.a)(r,t):t()})},[t,N,w,u,n,g,v,m,b,h,f,E,T]),Object(a.o)(()=>{if(b){const e=y.current,t=e.querySelector(".active")||e.querySelector(".from");t&&(t.style.height="auto",e.style.height=t.clientHeight+"px",e.style.flexBasis=t.clientHeight+"px")}},[b,j]);const I=C.current,M=Object.keys(m?new Array(m).fill(void 0):I).map(Number).map(e=>{const n=I[e];return"function"==typeof n?a.a.createElement("div",{key:e},n(e===t,e===N,t)):void 0}),k=Object(s.a)("Transition",O,n);return a.a.createElement("div",{ref:y,id:p,className:k},M)}},function(e,t,n){"use strict";var a=n(0),r=n(8),c=n(2),i=n(4),s=n(50),o=n(9),l=n(22),d=n(110),u=n(117),m=n(16);n(204);t.a=Object(a.h)(({className:e,size:t="large",chat:n,user:b,text:h,withOnlineStatus:f,isSavedMessages:p,lastSyncTime:O,onClick:g})=>{const v=b&&Object(i.sb)(b);let j;p||v||(b?j=Object(i.e)(b):n&&(j=Object(i.e)(n)));const E=Object(d.a)(j,!1,r.ApiMediaFormat.DataUri,O),{shouldRenderFullMedia:y,transitionClassNames:C}=Object(u.a)(E,"slow"),N=Object(m.a)();let T="";if(p)T=a.a.createElement("i",{className:"icon-avatar-saved-messages"});else if(v)T=a.a.createElement("i",{className:"icon-avatar-deleted-account"});else if(y)T=a.a.createElement("img",{src:E,className:C+" avatar-media",alt:"",decoding:"async"});else if(b){const e=Object(i.bb)(b);T=e?Object(s.c)(e,2):void 0}else if(n){const e=Object(i.k)(N,n);T=e&&Object(s.c)(e,Object(i.ob)(n.id)?2:1)}else h&&(T=Object(s.c)(h,2));const w=!p&&b&&Object(i.Cb)(b),I=Object(o.a)("Avatar size-"+t,e,"color-bg-"+Object(i.Z)(b||n),p&&"saved-messages",v&&"deleted-account",f&&w&&"online",g&&"interactive",!p&&!y&&"no-photo"),M=Object(a.m)(e=>{g&&g(e,p||y)},[g,p,y]),k=(b||n)&&(b||n).id;return a.a.createElement("div",{className:I,onClick:M,"data-test-sender-id":c.N?k:void 0},"string"==typeof T?Object(l.a)(T,["jumbo"===t?"hq_emoji":"emoji"]):T)})},function(e,t,n){"use strict";var a=n(13),r=n(0),c=n(10),i=n(160);t.a=({ref:e,className:t,onLoadMore:n,onScroll:s,onKeyDown:o,items:l,itemSelector:d=".ListItem",preloadBackwards:u=20,sensitiveArea:m=800,noScrollRestore:b=!1,noScrollRestoreOnTop:h=!1,noFastList:f,cacheBuster:p,children:O})=>{let g=Object(r.q)(null);e&&(g=e);const v=Object(r.q)({}),[j,E]=Object(r.p)(()=>n?[Object(c.a)((e=!1)=>{n({direction:a.e.Backwards,noScroll:e})},1e3,!0,!1),Object(c.a)(()=>{n({direction:a.e.Forwards})},1e3,!0,!1)]:[],[n,l]);Object(r.n)(()=>{if(!j)return;if(u>0&&(!l||l.length{const e=g.current,t=v.current;let n;if(t.listItemElements=e.querySelectorAll(d),t.currentAnchor&&Array.from(t.listItemElements).includes(t.currentAnchor)){const{scrollTop:a}=e;n=a+(t.currentAnchor.getBoundingClientRect().top-t.currentAnchorTop)}else{const e=t.listItemElements[0];e&&(t.currentAnchor=e,t.currentAnchorTop=e.getBoundingClientRect().top)}b||h&&0===e.scrollTop||(Object(i.a)(e,n),t.isScrollTopJustUpdated=!0)},[l,d,b,h,p]);const y=Object(r.m)(e=>{if(E&&j){const{listItemElements:e,isScrollTopJustUpdated:t,currentAnchor:n,currentAnchorTop:a}=v.current;if(t)return void(v.current.isScrollTopJustUpdated=!1);const r=e.length,c=g.current,{scrollTop:s,scrollHeight:o,offsetHeight:l}=c,d=s<=(r?e[0].offsetTop:0)+m,u=(r?e[r-1].offsetTop+e[r-1].offsetHeight:o)-(s+l)<=m;let b=!1;if(d){const t=e[0];if(t){const e=t.getBoundingClientRect().top,r=n&&n.offsetParent&&n!==t?n.getBoundingClientRect().top:e;n&&void 0!==a&&r>a&&(v.current.currentAnchor=t,v.current.currentAnchorTop=e,b=!0,Object(i.a)(c),E())}}if(u){const t=e[r-1];if(t){const e=t.getBoundingClientRect().top,r=n&&n.offsetParent&&n!==t?n.getBoundingClientRect().top:e;n&&void 0!==a&&r{const d=Object(r.a)("FloatingActionButton",e&&"revealed",t);return a.a.createElement(c.a,{className:d,color:n,round:!0,disabled:s,onClick:e&&!s?o:void 0,ariaLabel:i,tabIndex:-1},l)}},function(e,t,n){"use strict";var a=n(0),r=n(40);const c={fast:200,slow:350};t.a=(e,t="fast",n=!1)=>{const i=Boolean(e),s=!Object(a.q)(i).current&&!n,[o,l]=Object(a.r)(!i),{shouldRender:d,transitionClassNames:u}=Object(r.a)(i,void 0,!s,t);return Object(a.n)(()=>{d&&(s?setTimeout(()=>{l(!1)},c[t]):l(!1))},[s,d,t]),{shouldRenderThumb:o,shouldRenderFullMedia:d,transitionClassNames:u}}},function(e,t,n){"use strict";n.d(t,"c",(function(){return s})),n.d(t,"d",(function(){return o})),n.d(t,"e",(function(){return l})),n.d(t,"a",(function(){return d})),n.d(t,"b",(function(){return u})),n.d(t,"j",(function(){return p})),n.d(t,"l",(function(){return g})),n.d(t,"g",(function(){return v})),n.d(t,"i",(function(){return j})),n.d(t,"m",(function(){return E})),n.d(t,"k",(function(){return y})),n.d(t,"n",(function(){return C})),n.d(t,"h",(function(){return N})),n.d(t,"f",(function(){return T}));var a=n(2),r=n(6),c=n(54),i=n(4);const s="(max-height: 640px)",o=parseInt(getComputedStyle(document.documentElement).fontSize,10),l=200,d={width:640,height:640},u="1258816259753933",m={width:100,height:100};let b,h,f;function p(e,t,n,a){const i=t||n?1.625:0;return(function(e,t){const n=e?30:29;if(!r.l)return n;const{width:a}=c.a.get();return b||(b=Math.min(30,a/o-4.5)),h||(h=Math.min(29,a/o-7)),f||(f=Math.min(29,a/o-4.5)),e?b:t?f:h}(e,a)-i)*o}function O({width:e,height:t,fromOwnMessage:n,isForwarded:a,isWebPagePhoto:r,isGif:c,noAvatars:i}){const s=t/e;return T(p(n,a,r,i),function(e,t){return e&&t&&t>=.75&&t<=1.25?20*o:27*o}(c,s),e,t)}function g(e,t){const n=window.matchMedia(s),{width:a,height:r}=c.a.get();let i=t&&n.matches?10:8.25;return e&&(i=n.matches?10:15),{width:a,height:r-i*o}}function v(e,t,n,a,r){const{width:c,height:s}=Object(i.V)(e)||m;return O({width:c,height:s,fromOwnMessage:t,isForwarded:n,isWebPagePhoto:a,noAvatars:r})}function j(e,t,n,a){const{width:r,height:c}=Object(i.db)(e)||m;return O({width:r,height:c,fromOwnMessage:t,isForwarded:n,isGif:e.isGif,noAvatars:a})}function E(){return{width:2*o,height:2*o}}function y(e){return e?{width:3*o,height:3*o}:{width:3.375*o,height:3.375*o}}function C(e){const{width:t}=e;let{height:n}=e;e.id===u&&(n=t);const c=n&&t&&n/t,i=o*(r.l?a.Jb:a.Ib),s=c?i*c:i;return c&&s>i?{width:Math.round(i/c),height:i}:{width:i,height:s}}function N({width:e,height:t},n,a=!1){const{width:r,height:c}=g(n,a);return T(r,c,e,t)}function T(e,t,n,a){const r=a/n,c=Math.min(n,e);return Math.round(c*r)>t?{width:Math.round(t/r),height:t}:{width:c,height:Math.round(c*r)}}},function(e,t,n){"use strict";var a=n(0),r=n(10),c=n(9),i=n(37),s=n(127);let o,l;async function d(){return o||(o=n.e(7).then(n.bind(null,201)),l=(await o).default),o}setTimeout(d,5e3);t.a=Object(a.h)(({className:e,id:t,animationData:n,play:o,playSegment:u,speed:m,noLoop:b,size:h,quality:f,isLowPriority:p,onLoad:O})=>{const[g,v]=Object(a.r)(),j=Object(a.q)(null),E=Object(a.q)(!1),y=Object(a.q)(!1),C=Object(a.q)();C.current=o;const N=Object(a.q)();N.current=u,Object(a.n)(()=>{if(g||!n)return;const e=()=>{if(!j.current)return;const e=new l(t,j.current,n,{noLoop:b,size:h,quality:f,isLowPriority:p},O);m&&e.setSpeed(m),v(e)};l?e():d().then(()=>{Object(r.b)(()=>{j.current&&e()})})},[g,n,t,p,b,O,f,h,m]),Object(a.n)(()=>()=>{g&&g.destroy()},[g]);const T=Object(a.m)((e=!1)=>{g&&(C.current||N.current)&&(N.current?g.playSegment(N.current):e?g.goToAndPlay(0):g.play())},[g]),w=Object(a.m)(()=>{g&&g.pause()},[g]),I=Object(a.m)(()=>{y.current=!0,g&&(E.current||(E.current=g.isPlaying()),w())},[g,w]),M=Object(a.m)(()=>{E.current&&T(),E.current=!1,y.current=!1},[T]),k=Object(a.m)(()=>{Object(r.b)(M)},[M]);Object(a.n)(()=>{g&&(o||u?y.current?E.current=!0:T(b):y.current?E.current=!1:w())},[g,o,u,b,T,w]),Object(i.c)(I,M),Object(s.a)(I,k);const S=Object(c.a)("AnimatedSticker",e),L=h?`width: ${h}px; height: ${h}px;`:void 0;return a.a.createElement("div",{ref:j,className:S,style:L})})},function(e,t,n){"use strict";var a=n(0),r=n(16),c=n(112),i=n(21);t.a=Object(a.h)(({isOpen:e,onClose:t,onCloseAnimationEnd:n,title:s,header:o,text:l,textParts:d,confirmLabel:u="Confirm",confirmHandler:m,confirmIsDestructive:b,isButtonsInOneRow:h})=>{const f=Object(r.a)();return a.a.createElement(c.a,{className:"confirm",title:s,header:o,isOpen:e,onClose:t,onCloseAnimationEnd:n,onEnter:m},l&&l.split("\\n").map(e=>a.a.createElement("p",null,e)),d,a.a.createElement("div",{className:h?"dialog-buttons mt-2":""},a.a.createElement(i.a,{className:"confirm-dialog-button",isText:!0,onClick:m,color:b?"danger":"primary"},u),a.a.createElement(i.a,{className:"confirm-dialog-button",isText:!0,onClick:t},f("Cancel"))))})},function(e,t,n){"use strict";var a=n(0),r=n(9),c=n(40),i=n(22),s=n(16);n(261);t.a=Object(a.h)(({text:e="Nothing found.",description:t})=>{const n=Object(s.a)(),{transitionClassNames:o}=Object(c.a)(!0);return a.a.createElement("div",{className:Object(r.a)("NothingFound",o,t&&"with-description")},e,t&&a.a.createElement("p",{className:"description"},Object(i.a)(n(t),["br"])))})},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var a=n(0),r=n(52),c=n(31);function i(e,t){const n=void 0===t,i=Object(a.q)(n),s=Object(a.q)(),o=Object(c.a)();return Object(r.a)(()=>{n||(i.current=!1,s.current&&(clearTimeout(s.current),s.current=void 0))},e),Object(a.n)(()=>{if(n||i.current)return;const e=()=>{i.current=!0,o()};t>0?s.current=window.setTimeout(e,t):e()},e),i.current}},function(e,t,n){"use strict";var a=n(0),r=n(6),c=n(8),i=n(10),s=n(57),o=n(31);t.a=(e,t=!1,n=c.ApiMediaFormat.BlobUrl,l,d)=>{const u=e?s.c(e):void 0,m=n===c.ApiMediaFormat.Stream||r.h&&n===c.ApiMediaFormat.Progressive,b=Object(o.a)(),[h,f]=Object(a.r)(u&&!m?1:0),p=Object(a.q)(),O=Object(a.p)(()=>Object(i.h)(e=>{(!d||Date.now()-p.current>d)&&f(e)},500,!0),[d]);return Object(a.n)(()=>{!t&&e&&(u?m&&setTimeout(()=>{f(.75)},1500):(f(0),p.current&&s.a(O),p.current=Date.now(),s.b(e,n,O).then(()=>{const e=Date.now()-p.current;p.current=void 0,!d||e>=d?b():setTimeout(b,d-e)})))},[t,e,u,n,l,b,m,d,O]),Object(a.n)(()=>{t&&p.current&&(s.a(O),f(0))},[O,t]),{mediaData:u,downloadProgress:h}}},function(e,t,n){"use strict";var a=n(0),r=n(9);n(229);const c={s:22,m:25,l:28,xl:20};t.a=Object(a.h)(({progress:e=0,size:t="l",square:n,transparent:i,noCross:s,onClick:o})=>{const l=c[t],d=l-4,u=l-1,m=2*d*Math.PI,b=Object(a.q)(null);Object(a.n)(()=>{if(!b.current)return;const t=b.current.firstElementChild,n=m-Math.min(Math.max(.05,e),1)*m;t?t.firstElementChild.setAttribute("stroke-dashoffset",n.toString()):b.current.innerHTML=`\n \n `},[b,m,u,d,e]);const h=Object(r.a)("ProgressSpinner size-"+t,i&&"transparent",n&&"square",s&&"no-cross");return a.a.createElement("div",{ref:b,className:h,onClick:o})})},function(e,t,n){"use strict";var a=n(0),r=n(8),c=n(109),i=n(110),s=n(117),o=n(25),l=n(9),d=n(119),u=n(21);n(246);t.a=Object(a.h)(({sticker:e,size:t,observeIntersection:n,noAnimate:m,title:b,className:h,onClick:f,clickArg:p,onUnfaveClick:O})=>{const g=Object(a.q)(null),v="sticker"+e.id,j="sticker-button-"+e.id,E=Object(c.b)(g,n),y=e.thumbnail?e.thumbnail.dataUri:void 0,C=Object(i.a)(v+"?size=m",!E,r.ApiMediaFormat.BlobUrl),N=E&&!m,T=Object(i.a)(e.isAnimated&&v,!N,r.ApiMediaFormat.Lottie),[w,I,M]=Object(o.a)(Boolean(T)),k=w&&N,{shouldRenderThumb:S,shouldRenderFullMedia:L,transitionClassNames:A}=Object(s.a)(C||k,"slow");Object(a.n)(()=>{N||M()},[M,N]);const x=Object(l.a)("StickerButton",e.isAnimated&&"animated",j,h),D=S&&y?`background-image: url('${y}');`:"";return a.a.createElement("div",{ref:g,className:x,title:b||e&&e.emoji,style:D,"data-sticker-id":e.id,onClick:function(){f&&f(p)}},L&&!k&&a.a.createElement("img",{src:C,className:A}),N&&T&&a.a.createElement(d.a,{id:v,animationData:T,play:!0,size:t,isLowPriority:!0,onLoad:I}),O&&a.a.createElement(u.a,{className:"sticker-unfave-button",color:"dark",round:!0,onClick:function(t){t.stopPropagation(),t.preventDefault(),O(e)}},a.a.createElement("i",{className:"icon-close"})))})},function(e,t,n){"use strict";var a=n(0),r=n(9),c=n(16),i=n(26);n(235);var s=Object(a.h)(({id:e,label:t,subLabel:n,value:s,name:o,checked:l,disabled:d,hidden:u,isLoading:m,onChange:b})=>{const h=Object(c.a)(),f=Object(r.a)("Radio",d&&"disabled",u&&"hidden-widget",m&&"loading");return a.a.createElement("label",{className:f,dir:h.isRtl?"rtl":void 0},a.a.createElement("input",{type:"radio",name:o,value:s,id:e,checked:l,onChange:b,disabled:d||u}),a.a.createElement("div",{className:"Radio-main"},a.a.createElement("span",{className:"label",dir:h.isRtl?"auto":void 0},t),n&&a.a.createElement("span",{className:"subLabel",dir:h.isRtl?"auto":void 0},n)),m&&a.a.createElement(i.a,null))});t.a=Object(a.h)(({id:e,name:t,options:n,selected:r,disabled:c,loadingOption:i,onChange:o})=>{const l=Object(a.m)(e=>{const{value:t}=e.currentTarget;o(t)},[o]);return a.a.createElement("div",{id:e,className:"radio-group"},n.map(e=>a.a.createElement(s,{name:t,label:e.label,subLabel:e.subLabel,value:e.value,checked:e.value===r,hidden:e.hidden,disabled:c,isLoading:i?i===e.value:void 0,onChange:l})))})},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var a=n(0);function r(e,t){Object(a.n)(()=>(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])}},function(e,t,n){"use strict";var a=n(0),r=n(67);t.a=({containerId:e,className:t,children:n})=>{const c=Object(a.q)(document.createElement("div"));return Object(a.o)(()=>{const n=document.querySelector(e||"#portals");if(!n)return;const a=c.current;return t&&a.classList.add(t),n.appendChild(a),()=>{r.a.render(void 0,a),n.removeChild(a)}},[t,e]),r.a.render(n,c.current)}},function(e,t,n){"use strict";var a=n(0),r=n(8),c=n(118),i=n(109),s=n(110),o=n(117),l=n(25),d=n(119);n(219);const u={large:160,medium:128,small:104};t.a=({sticker:e,size:t="medium",observeIntersection:n,lastSyncTime:m,forceLoadPreview:b})=>{const h=Object(a.q)(null),[f,p]=Object(l.a)(),O="sticker"+e.id,g=Object(i.b)(h,n),v=e.thumbnail&&e.thumbnail.dataUri,j=Object(s.a)(O+"?size=m",!g&&!b,r.ApiMediaFormat.BlobUrl,m),{transitionClassNames:E}=Object(o.a)(j,"slow"),y=Object(s.a)(O,!g,r.ApiMediaFormat.Lottie,m),C=Boolean(y),[N,T]=Object(a.r)(String(Math.random())),w=Object(a.m)(()=>{T(String(Math.random()))},[]),I=u[t],M=`width: ${I}px; height: ${I}px;`;return a.a.createElement("div",{ref:h,className:"AnimatedEmoji media-inner",style:M,onClick:w},!f&&v&&a.a.createElement("img",{src:v,className:e.id===c.b?"like-sticker-thumb":void 0,alt:""}),!f&&j&&a.a.createElement("img",{src:j,className:E,alt:""}),C&&a.a.createElement(d.a,{key:O,id:O,animationData:y,size:I,quality:1,play:g&&N,noLoop:!0,onLoad:p}))}},function(e,t,n){"use strict";var a=n(0),r=n(1),c=n(13),i=n(4),s=n(7),o=n(22),l=n(3),d=n(16),u=n(114),m=n(138),b=n(161);t.a=Object(a.h)(Object(r.h)((e,{chatId:t})=>{const{lastSyncTime:n}=e,a=Object(s.g)(e,t);return{lastSyncTime:n,chat:a,onlineCount:a?Object(s.o)(e,a):void 0,areMessagesLoaded:Boolean(Object(s.n)(e,t))}},(e,t)=>Object(l.l)(t,["loadFullChat","openMediaViewer"]))(({typingStatus:e,avatarSize:t="medium",withMediaViewer:n,withUsername:r,withFullInfo:s,withUpdatingStatus:l,withChatType:h,noRtl:f,chat:p,onlineCount:O,areMessagesLoaded:g,lastSyncTime:v,loadFullChat:j,openMediaViewer:E})=>{const y=p&&Object(i.qb)(p),{id:C,isMin:N,isRestricted:T}=p||{};Object(a.n)(()=>{C&&!N&&s&&v&&j({chatId:C})},[C,N,v,s,j,y]);const w=Object(a.m)((e,n)=>{p&&n&&(e.stopPropagation(),E({avatarOwnerId:p.id,origin:"jumbo"===t?c.h.ProfileAvatar:c.h.MiddleHeaderAvatar}))},[p,t,E]),I=Object(d.a)();if(p)return a.a.createElement("div",{className:"ChatInfo",dir:!f&&I.isRtl?"rtl":void 0},a.a.createElement(u.a,{key:p.id,size:t,chat:p,onClick:n?w:void 0}),a.a.createElement("div",{className:"info"},a.a.createElement("div",{className:"title"},a.a.createElement("h3",{dir:"auto"},Object(o.a)(Object(i.k)(I,p))),p.isVerified&&a.a.createElement(m.a,null)),function(){if(l&&!g&&!T)return a.a.createElement("span",{className:"status",dir:"auto"},I("Updating"));if(!p)return;if(e)return a.a.createElement(b.a,{typingStatus:e});if(h)return a.a.createElement("div",{className:"status",dir:"auto"},I(Object(i.l)(p)));const t=r?p.username:void 0,n=function(e,t){const n=e(Object(i.l)(t)),{membersCount:a}=t;if(t.isRestricted)return"Channel"===n?"channel is inaccessible":"group is inaccessible";if(!a)return n;return e("Channel"===n?"Subscribers":"Members",a,"i")}(I,p),c=O?", "+I("OnlineCount",O,"i"):void 0;return a.a.createElement("div",{className:"status"},t&&a.a.createElement("span",{className:"handle"},t),a.a.createElement("span",{className:"group-status"},n),c&&a.a.createElement("span",{className:"online-status"},c))}()))}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return l})),n.d(t,"b",(function(){return d}));var a=n(1),r=n(13),c=n(2),i=n(37),s=n(62);let o=!1;function l(e,t,n,i=0,s=c.B,o,l,d){const m=function(e,t,n=c.B,a){const{offsetTop:i}=t,{scrollTop:s}=e;if(void 0===a){const t=i-e.scrollTop;if(t<-n)return s+(t+n);if(t>n)return s+(t-n)}else{if(a===r.b.Up)return i+n;if(a===r.b.Down)return Math.max(0,i-n)}return s}(e,t,s,o);o!==r.b.Static?(Object(a.e)().settings.byKey.animationLevel===c.f&&(l=0),u(e,t,m,n,i,l,d)):u(e,t,m,n,i,0)}function d(){return o}function u(e,t,n,a,r=0,l,d){const{offsetTop:u,offsetHeight:h}=t,{scrollTop:f,offsetHeight:p,scrollHeight:O}=e,g=!d&&e.dataset.normalHeight?Number(e.dataset.normalHeight):p;let v;switch(f!==n&&(e.scrollTop=n),a){case"start":v=u-r-n;break;case"end":v=u+h+r-(n+g);break;case"nearest":case"center":case"centerOrTop":v=h0){const e=O-(n+g);v=Math.min(v,e)}if(0===v)return;const j=n+v;if(0===l)return void(e.scrollTop=j);o=!0;const E=Math.abs(v),y=E{const t=Math.min((Date.now()-N)/C,1),n=v*(1-y(t));return e.scrollTop=Math.round(j-n),o=t<1,o||T(),o})}function m(e){return 1-(1-e)**5}function b(e){return 1-(1-e)**3.5}},,function(e,t,n){"use strict";var a=n(0),r=n(13),c=n(3),i=n(31),s=n(29);function o(e,t=0,n,a){const{length:c}=e,i=e.indexOf(t),s=n===r.e.Forwards?i:i+1||c,o=Math.max(0,s-a),l=s+a-1,d=e.slice(Math.max(0,o),l+1);let u,m;switch(n){case r.e.Forwards:u=s>0,m=o>=0;break;case r.e.Backwards:u=s{const u=Object(a.q)(),m=Object(a.q)((()=>{if(!t||u.current)return;const{newViewportIds:e}=o(t,t[0],r.e.Forwards,l);return e})()),b=Object(i.a)(),h=Object(s.a)(t),f=Object(s.a)(n);if(t&&!n&&(t!==h||n!==f)){const{offsetId:e=t[0],direction:n=r.e.Forwards}=u.current||{},{newViewportIds:a}=o(t,e,n,l);m.current&&Object(c.a)(m.current,a)||(m.current=a)}Object(a.n)(()=>{if(t&&!n&&e&&d){const t=m.current;e({offsetId:t[t.length-1]})}},[t,n,e,d]);const p=Object(a.m)(({direction:n,noScroll:a})=>{const i=m.current,s=i?n===r.e.Backwards?i[i.length-1]:i[0]:void 0;if(!t)return void(e&&e({offsetId:s}));a||(u.current={...u.current,direction:n,offsetId:s});const{newViewportIds:d,areSomeLocal:h,areAllLocal:f}=o(t,s,n,l);!h||i&&Object(c.a)(i,d)||(m.current=d,b()),!f&&e&&e({offsetId:s})},[t,l,e,b]);return n?[t]:[m.current,p]}},function(e,t,n){"use strict";function a(e,t){return t-Math.floor(t/e)*e}n.d(t,"a",(function(){return a}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var a=n(6);function r(e,t){if(!t&&e===document.activeElement)return;const n=window.getSelection(),r=document.createRange(),c=e.lastChild||e;a.n||c&&c.nodeValue?(r.selectNodeContents(c),r.collapse(!1),n.removeAllRanges(),n.addRange(r)):e.focus()}},,function(e,t,n){"use strict";let a;n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return r})),function(e){e[e.Up=0]="Up",e[e.Down=1]="Down",e[e.Left=2]="Left",e[e.Right=3]="Right"}(a||(a={}));function r(e,t){let n,r,c=!1;function i(e){t.excludedClosestSelector&&(e.target.matches(t.excludedClosestSelector)||e.target.closest(t.excludedClosestSelector))||(n=e,"mousedown"===e.type?(document.addEventListener("mousemove",o),document.addEventListener("mouseup",s)):"touchstart"===e.type&&(document.addEventListener("touchmove",o),document.addEventListener("touchend",s),document.addEventListener("touchcancel",s),"touches"in e&&(void 0===e.pageX&&(e.pageX=e.touches[0].pageX),void 0===e.pageY&&(e.pageY=e.touches[0].pageY))),document.body.classList.add("no-selection"),t.withCursor&&document.body.classList.add("cursor-grabbing"),t.onCapture&&t.onCapture(e))}function s(e){n&&(t.withCursor&&document.body.classList.remove("cursor-grabbing"),document.body.classList.remove("no-selection"),document.removeEventListener("mouseup",s),document.removeEventListener("mousemove",o),document.removeEventListener("touchcancel",s),document.removeEventListener("touchend",s),document.removeEventListener("touchmove",o),n=void 0,c?t.onRelease&&t.onRelease(e):!t.onClick||"button"in e&&0!==e.button||t.onClick(e)),c=!1,r=void 0}function o(e){if(n){"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));const i=e.pageX-n.pageX,s=e.pageY-n.pageY;(Math.abs(i)>=15||Math.abs(s)>=15)&&(c=!0),t.onDrag&&(e.preventDefault(),t.onDrag(e,n,{dragOffsetX:i,dragOffsetY:s})),t.onSwipe&&function(e,n,c){if(!r){const e=Math.abs(n),t=Math.abs(c);if(n&&c){if(Math.max(e,t)/Math.min(e,t)<2)return}e>=50?r="x":t>=50&&(r="y")}!function(e,t,n,r,c){"x"===t?c(e,n<0?a.Left:a.Right):"y"===t&&c(e,r<0?a.Up:a.Down)}(e,r,n,c,t.onSwipe)}(e,i,s)}}return e.addEventListener("mousedown",i),e.addEventListener("touchstart",i,{passive:!0}),()=>{e.removeEventListener("mousedown",i),e.removeEventListener("touchstart",i)}}},function(e,t,n){"use strict";var a=n(0);n(211);t.a=()=>a.a.createElement("span",{className:"VerifiedIcon"})},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var a=n(29);function r(e,t=!1,n=!1){const r=Object(a.a)(e,t);return n||null!=e?e:r}},function(e,t,n){"use strict";var a=n(2);t.a=e=>{e.play().catch(e=>{a.r&&console.warn(e)})}},function(e,t,n){"use strict";var a=n(0),r=n(10),c=n(164);t.a=(e=!1)=>{const[t,n]=Object(a.r)(!e),[i,s]=Object(a.r)(0),o=Object(a.p)(()=>Object(r.a)(n,200,!1,!0),[]),l=Object(a.m)(e=>{const t=e.currentTarget;Object(c.a)(t)||(t.buffered.length&&s(t.buffered.end(0)/t.duration),o(t.readyState>=3||t.currentTime>0))},[o]);return{isBuffered:t,bufferedProgress:i,bufferingHandlers:{onLoadedData:l,onPlaying:l,onLoadStart:l,onPause:l,onTimeUpdate:l,onProgress:l},checkBuffering(e){o(e.readyState>=3)}}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var a=n(8),r=n(6);const c={B:a.ApiMessageEntityTypes.Bold,STRONG:a.ApiMessageEntityTypes.Bold,I:a.ApiMessageEntityTypes.Italic,EM:a.ApiMessageEntityTypes.Italic,U:a.ApiMessageEntityTypes.Underline,S:a.ApiMessageEntityTypes.Strike,STRIKE:a.ApiMessageEntityTypes.Strike,DEL:a.ApiMessageEntityTypes.Strike,CODE:a.ApiMessageEntityTypes.Code,PRE:a.ApiMessageEntityTypes.Pre,BLOCKQUOTE:a.ApiMessageEntityTypes.Blockquote};function i(e){const t=document.createElement("div");t.innerHTML=function(e){let t=e.slice(0);r.d||(t=t.replace(/]+alt="([^"]+)"[^>]*>/gm,"$1"));return t=t.replace(/<\/?span([^>]*)?>/g,""),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(/[*]{2}([^*\n]+)[*]{2}/g,"$1"),t=t.replace(/[_]{2}([^*\n]+)[_]{2}/g,"$1"),t=t.replace(/[~]{2}([^~\n]+)[~]{2}/g,"$1"),t}(e);const n=t.innerText.trim().replace(/\u200b+/g,"").slice(0,4096);let i=0,s=0;const o=[];function l(e){const{index:t,entity:r}=function(e,t,n){const r=function(e){if(c[e.nodeName])return c[e.nodeName];if("A"===e.nodeName){const t=e;return t.dataset.entityType===a.ApiMessageEntityTypes.MentionName?a.ApiMessageEntityTypes.MentionName:t.dataset.entityType===a.ApiMessageEntityTypes.Url?a.ApiMessageEntityTypes.Url:t.href.startsWith("mailto:")?a.ApiMessageEntityTypes.Email:t.href.startsWith("tel:")?a.ApiMessageEntityTypes.Phone:t.href!==t.textContent?a.ApiMessageEntityTypes.TextUrl:a.ApiMessageEntityTypes.Url}if("SPAN"===e.nodeName)return e.dataset.entityType;return}(e);if(!r||!e.textContent)return{index:n,entity:void 0};const i=t.indexOf(e.textContent,n),s=i>=0?i:n,o=t.substring(0,s).length,{length:l}=t.substring(s,s+e.textContent.length);let d,u;r===a.ApiMessageEntityTypes.TextUrl&&(d=e.href);r===a.ApiMessageEntityTypes.MentionName&&(u=Number(e.dataset.userId));return{index:s,entity:{type:r,offset:o,length:l,...d&&{url:d},...u&&{userId:u}}}}(e,n,i);r?(i=t,o.push(r)):e.textContent&&(i+=e.textContent.length),e.hasChildNodes()&&s<=3&&(s+=1,Array.from(e.childNodes).forEach(l))}return Array.from(t.childNodes).forEach(e=>{s=1,l(e)}),{text:n,entities:o.length?o:void 0}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return d}));var a=n(0),r=n(40),c=n(9),i=n(49),s=n(29),o=n(25);n(224);var l=Object(a.h)(({isQuick:e,onFileSelect:t})=>{const[n,r,i]=Object(o.a)(),s=Object(c.a)("DropTarget",n&&"hovered");return a.a.createElement("div",{className:s,onDrop:t,onDragEnter:()=>{r()},onDragLeave:e=>{const{relatedTarget:t}=e;t&&e.stopPropagation(),i()}},a.a.createElement("div",{className:"target-content"},a.a.createElement("div",{className:"icon icon-"+(e?"photo":"document")}),a.a.createElement("div",{className:"title"},"Drop files here to send them"),a.a.createElement("div",{className:"description"},e?"in a quick way":"without compression")))});n(225);let d;!function(e){e.None="none",e.Document="document",e.QuickFile="quick_file"}(d||(d={}));t.b=Object(a.h)(({isOpen:e,withQuick:t,onHide:n,onFileSelect:o})=>{const d=Object(a.q)(null),u=Object(s.a)(t),{shouldRender:m,transitionClassNames:b}=Object(r.a)(e);Object(a.n)(()=>e?Object(i.a)(n):void 0,[e,n]);const h=Object(a.m)(e=>{const{dataTransfer:t}=e;t.files&&t.files.length>0&&(n(),o(Array.from(t.files),!1))},[o,n]),f=Object(a.m)(e=>{const{dataTransfer:t}=e;t.files&&t.files.length>0&&(n(),o(Array.from(t.files),!0))},[o,n]),p=Object(a.m)(e=>{e.stopPropagation();const{target:t,relatedTarget:a}=e;t.matches(".DropTarget, .DropArea")&&!a&&(d.current=window.setTimeout(()=>{n()},150))},[n]);if(!m)return;const O=Object(c.a)("DropArea",b);return a.a.createElement("div",{className:O,onDragLeave:p,onDragOver:()=>{d.current&&window.clearTimeout(d.current)},onDrop:n},a.a.createElement(l,{onFileSelect:h}),(t||u)&&a.a.createElement(l,{onFileSelect:f,isQuick:!0}))})},,function(e,t,n){"use strict";n.d(t,"b",(function(){return c})),n.d(t,"a",(function(){return i})),n.d(t,"d",(function(){return l}));var a=n(158),r=n(3);const c=[{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"}],i=[{icon:"mute",title:"FilterMuted",key:"excludeMuted"},{icon:"archive",title:"FilterArchived",key:"excludeArchived"},{icon:"readchats",title:"FilterRead",key:"excludeRead"}],s=["includedChatIds","bots","channels","groups","contacts","nonContacts"],o=["excludedChatIds","excludeArchived","excludeMuted","excludeRead"];function l(e,t,n){let a=[],c=[];if("included"===t){const{includedChatIds:t,...i}=n?e.includeFilters||{}:Object(r.l)(e.folder,s);a=t||[],c=Object.keys(i).filter(e=>Boolean(i[e]))}else{const{excludedChatIds:t,...i}=n?e.excludeFilters||{}:Object(r.l)(e.folder,o);a=t||[],c=Object.keys(i).filter(e=>Boolean(i[e]))}return{selectedChatIds:a,selectedChatTypes:c}}function d(e){if(e){const{includedChatIds:t,...n}=e;if(Object.values(n).filter(Boolean).length>1||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:Object(r.l)(e.folder,s)};case"editExcludeFilters":return{...e,excludeFilters:Object(r.l)(e.folder,o)};case"setIncludeFilters":return{...e,includeFilters:t.payload,chatFilter:""};case"setExcludeFilters":return{...e,excludeFilters:t.payload,chatFilter:""};case"saveFilters":return e.includeFilters?{...e,folder:{...Object(r.j)(e.folder,s),title:e.folder.title?e.folder.title:d(e.includeFilters),...e.includeFilters},includeFilters:void 0,chatFilter:"",isTouched:!0}:e.excludeFilters?{...e,folder:{...Object(r.j)(e.folder,o),...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}};t.c=()=>Object(a.a)(m,u)},function(e,t,n){"use strict";var a=n(0),r=n(1),c=n(7),i=n(4),s=n(22),o=n(9),l=n(16),d=n(114);n(205);t.a=Object(a.h)(Object(r.h)((e,{chatOrUserId:t})=>{if(!t)return{};return{chat:t?Object(c.g)(e,t):void 0,user:Object(i.ob)(t)?Object(c.Jb)(e,t):void 0}})(({icon:e,title:t,isMinimized:n,canClose:r,onClick:c,clickArg:u,chat:m,user:b,className:h})=>{const f=Object(l.a)();let p,O;if(e&&t)p=a.a.createElement("div",{className:"item-icon"},a.a.createElement("i",{className:"icon-"+e})),O=t;else if(m||b){p=a.a.createElement(d.a,{chat:m,user:b,size:"small",isSavedMessages:b&&b.isSelf});const e=!m||b&&!b.isSelf?Object(i.ab)(b):Object(i.k)(f,m,b);O=e?Object(s.a)(e):void 0}const g=Object(o.a)("PickerSelectedItem",h,n&&"minimized",r&&"closeable");return a.a.createElement("div",{className:g,onClick:()=>c(u),title:n?O:void 0,dir:f.isRtl?"rtl":void 0},p,!n&&a.a.createElement("div",{className:"item-name",dir:"auto"},O),r&&a.a.createElement("div",{className:"item-remove"},a.a.createElement("i",{className:"icon-close"})))}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var a=n(1),r=n(2),c=n(6),i=n(62);function s(e,t,n=300){Object(a.e)().settings.byKey.animationLevel===r.f&&(n=0),c.e?function(e,t,n){const{scrollLeft:a,offsetWidth:r,scrollWidth:c}=e;let s=t-a;if(s<0){const e=-a;s=Math.max(s,e)}else if(s>0){const e=c-(a+r);s=Math.min(s,e)}if(0===s)return;const o=a+s;if(0===n)return void(e.scrollLeft=o);const l=Date.now();Object(i.a)(()=>{const t=Math.min((Date.now()-l)/n,1),a=s*(1-function(e){return 1-(1-e)**3.5}(t));return e.scrollLeft=Math.round(o-a),t<1})}(e,t,n):e.scrollTo({left:t,...n&&{behavior:"smooth"}})}},function(e,t,n){"use strict";var a=n(0);t.a=(e,t)=>{Object(a.n)(()=>{if(e)return e.addEventListener("wheel",t,{passive:!0}),()=>{e.removeEventListener("wheel",t)};function t(t){t.deltaX||(e.scrollLeft+=t.deltaY/4)}},[e,t])}},function(e,t,n){"use strict";var a=n(0),r=n(1),c=n(10);t.a=(e,t,n,i)=>{const{loadMessage:s}=Object(r.d)(),o=Object(a.p)(()=>{const n=Object(c.h)(s,500,!0);return()=>{n({chatId:e,messageId:t,replyOriginForId:i})}},[s,e,t,i]);Object(a.n)(()=>{t&&!n&&o()})}},function(e,t,n){"use strict";var a=n(0),r=n(6);let c=0;t.a=(e,t,n,i)=>{const[s,o]=Object(a.r)(!1),[l,d]=Object(a.r)(void 0),u=Object(a.m)(e=>{t||2!==e.button||document.body.classList.add("no-selection")},[t]),m=Object(a.m)(e=>{document.body.classList.remove("no-selection"),t||n&&e.target.matches("a.text-entity-link[href]")||(e.preventDefault(),l||(document.body.classList.remove("no-selection"),0===c&&document.body.classList.add("has-context-menu"),c++,o(!0),d({x:e.clientX,y:e.clientY})))},[t,n,l]),b=Object(a.m)(()=>{o(!1)},[]),h=Object(a.m)(()=>{d(void 0),document.body.classList.remove("no-selection"),setTimeout(()=>{c--,0===c&&document.body.classList.remove("has-context-menu")},200)},[]);return Object(a.n)(()=>{if(t||!r.n||i)return;const a=e.current;if(!a)return;let c;const s=()=>{c&&(clearTimeout(c),c=void 0)},u=e=>{t||r.l&&window.document.body.classList.contains("enable-symbol-menu-transforms")||(s(),c=window.setTimeout(()=>(e=>{s();const{clientX:t,clientY:r,target:c}=e.touches[0];l||n&&c.matches("a.text-entity-link[href]")||(a.addEventListener("touchend",(function e(t){a.removeEventListener("touchend",e,!0),t.stopImmediatePropagation(),t.preventDefault(),t.stopPropagation()}),!0),document.body.classList.add("no-selection"),o(!0),d({x:t,y:r}))})(e),250))};return a.addEventListener("touchstart",u,{passive:!0}),a.addEventListener("touchcancel",s,!0),a.addEventListener("touchend",s,!0),a.addEventListener("touchmove",s,{passive:!0}),()=>{s(),a.removeEventListener("touchstart",u),a.removeEventListener("touchcancel",s,!0),a.removeEventListener("touchend",s,!0),a.removeEventListener("touchmove",s)}},[l,t,i,e,n]),{isContextMenuOpen:s,contextMenuPosition:l,handleBeforeContextMenu:u,handleContextMenu:m,handleContextMenuClose:b,handleContextMenuHide:h}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return d})),n.d(t,"b",(function(){return m}));var a=n(0),r=n(1),c=n(8),i=n(4),s=n(22),o=n(78),l=n(59);function d(e,t,n){const a=e.content.text;if(!a||!a.text){const t=Object(i.P)(e);return t?[t]:void 0}const{text:r,entities:c}=a;return m(r,c,t,n)}function u(e){const t=new Set,n=[];return e.forEach((a,r)=>{if(t.has(r))return;const c=function e(t,n,a,r){const{offset:c,length:i}=t,s=new Set([n]);if(r.has(n))return;const o=[];return a.filter((e,t)=>t>n&&e.offset>=c&&e.offsete(t,a.indexOf(t),a,r)).filter(Boolean).forEach(e=>{let t=!1;e.organizedIndexes.forEach(e=>{t||s.has(e)||(t=!0),s.add(e)}),t&&o.push(e)}),{entity:t,organizedIndexes:s,nestedEntities:o}}(a,r,e,t);c&&(c.organizedIndexes.forEach(e=>{t.add(e)}),n.push(c))}),n}function m(e,t,n,r,i){if(!t||!t.length)return b(e,n,r,i);const d=[];let m=!1;const O=u(t);function g(t,d,u,O){const v=[],{entity:j,nestedEntities:E}=u,{offset:y,length:C,type:N}=j;let T=e.substring(t,y);const w=T.length;T&&(m&&T.length>0&&"\n"===T[0]&&(T=T.substr(1),m=!1),T&&v.push(...b(T,n,r,i)));const I=t+w,M=I+C;let k=e.substring(y,y+C);const S=[];if(m&&k.length>0&&"\n"===k[0]&&(k=k.substr(1),m=!1),N===c.ApiMessageEntityTypes.Pre&&(m=!0),E.length){let e=I;E.forEach((t,n)=>{const{renderResult:a,entityEndIndex:r}=g(e,M,t,n===E.length-1);S.push(...a),e=r})}const L=i?function(e,t,n){const a="string"==typeof t&&t,r=n.length?n.join(""):Object(s.a)(t,["escape_html","emoji_html","br_html"]).join("");if(!a)return r;switch(e.type){case c.ApiMessageEntityTypes.Bold:return`${r}`;case c.ApiMessageEntityTypes.Italic:return`${r}`;case c.ApiMessageEntityTypes.Underline:return`${r}`;case c.ApiMessageEntityTypes.Code:return`${r}`;case c.ApiMessageEntityTypes.Pre:return`\`\`\`
${r}
\`\`\``;case c.ApiMessageEntityTypes.Strike:return`${r}`;case c.ApiMessageEntityTypes.MentionName:return`${r}`;case c.ApiMessageEntityTypes.Url:case c.ApiMessageEntityTypes.TextUrl:return`${r}`;default:return r}}(j,k,S):function(e,t,n){const r="string"==typeof t&&t,i=n.length?n:t;if(!r)return b(i);switch(e.type){case c.ApiMessageEntityTypes.Bold:return a.a.createElement("strong",null,b(i));case c.ApiMessageEntityTypes.Blockquote:return a.a.createElement("blockquote",null,b(i));case c.ApiMessageEntityTypes.BotCommand:return a.a.createElement("a",{onClick:f,className:"text-entity-link",dir:"auto"},b(i));case c.ApiMessageEntityTypes.Hashtag:case c.ApiMessageEntityTypes.Cashtag:return a.a.createElement("a",{onClick:p,className:"text-entity-link",dir:"auto"},b(i));case c.ApiMessageEntityTypes.Code:return a.a.createElement("code",{className:"text-entity-code"},b(i));case c.ApiMessageEntityTypes.Email:return a.a.createElement("a",{href:"mailto:"+r,target:"_blank",rel:"noopener noreferrer",className:"text-entity-link",dir:"auto"},b(i));case c.ApiMessageEntityTypes.Italic:return a.a.createElement("em",null,b(i));case c.ApiMessageEntityTypes.MentionName:return a.a.createElement(o.a,{userId:e.userId},b(i));case c.ApiMessageEntityTypes.Mention:return a.a.createElement(o.a,{username:r},b(i));case c.ApiMessageEntityTypes.Phone:return a.a.createElement("a",{href:"tel:"+r,className:"text-entity-link",dir:"auto"},b(i));case c.ApiMessageEntityTypes.Pre:return a.a.createElement("pre",{className:"text-entity-pre"},b(i));case c.ApiMessageEntityTypes.Strike:return a.a.createElement("del",null,b(i));case c.ApiMessageEntityTypes.TextUrl:case c.ApiMessageEntityTypes.Url:return a.a.createElement(l.a,{url:h(r,e),text:r},b(i));case c.ApiMessageEntityTypes.Underline:return a.a.createElement("ins",null,b(i));default:return b(i)}}(j,k,S);if(Array.isArray(L)?v.push(...L):v.push(L),O&&M0&&"\n"===t[0]&&(t=t.substring(1)),t&&v.push(...b(t,n,r,i))}return{renderResult:v,entityEndIndex:M}}let v=0;return O.forEach((t,n)=>{const{renderResult:a,entityEndIndex:r}=g(v,e.length,t,n===O.length-1);d.push(...a),v=r}),d}function b(e,t,n,a){if(Array.isArray(e)){const r=[];return e.forEach(e=>{r.push(...b(e,t,n,a))}),r}if(a)return Object(s.a)(e,["escape_html","emoji_html","br_html"]);const r=n?"hq_emoji":"emoji";return t?Object(s.a)(e,[r,"br","highlight"],{highlight:t}):Object(s.a)(e,[r,"br"])}function h(e,t){const{type:n,url:a}=t;return n===c.ApiMessageEntityTypes.TextUrl&&a?a:e}function f(e){Object(r.d)().sendBotCommand({command:e.currentTarget.innerText})}function p(e){Object(r.d)().setLocalTextSearchQuery({query:e.currentTarget.innerText}),Object(r.d)().searchTextMessagesLocal()}},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var a=n(0),r=n(10);function c(e,t){Object(a.n)(()=>{const t=e.current;return()=>{t&&Object(r.b)(()=>{t.pause(),t.src="",t.load()})}},t)}},,,function(e,t,n){},,,function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var a=n(0);function r(e,t){const n=Object(a.q)(e),[r,c]=Object(a.r)(t);return[r,Object(a.m)(e=>{c(t=>n.current(t,e))},[])]}},function(e,t,n){"use strict";var a=n(0),r=n(9),c=n(25),i=n(16),s=n(20),o=n(21);n(203);t.a=Object(a.h)(({ref:e,children:t,parentContainerClassName:n,value:l,inputId:d,className:u,focused:m,isLoading:b,placeholder:h,disabled:f,autoComplete:p,canClose:O,onChange:g,onReset:v,onFocus:j,onBlur:E})=>{let y=Object(a.q)(null);e&&(y=e);const[C,N,T]=Object(c.a)(m);Object(a.n)(()=>{y.current&&(m?y.current.focus():y.current.blur())},[m,h]);const w=Object(i.a)();const I=Object(a.m)(e=>{if("ArrowDown"===e.key||"Enter"===e.key){const e=document.querySelector(`.${n} .ListItem-button`);e&&e.focus()}},[n]);return a.a.createElement("div",{className:Object(r.a)("SearchInput",u,C&&"has-focus"),dir:w.isRtl?"rtl":void 0},t,a.a.createElement("input",{ref:y,id:d,type:"text",dir:"auto",placeholder:h||w("Search"),className:"form-control",value:l,disabled:f,autoComplete:p,onChange:function(e){const{currentTarget:t}=e;g(t.value)},onFocus:function(){N(),j&&j()},onBlur:function(){T(),E&&E()},onKeyDown:I}),a.a.createElement("i",{className:"icon-search"}),b&&a.a.createElement(s.a,null),!b&&(l||O)&&v&&a.a.createElement(o.a,{round:!0,size:"tiny",color:"translucent",onClick:v},a.a.createElement("span",{className:"icon-close"})))})},function(e,t,n){"use strict";var a=n(6);t.a=(e,t)=>{a.e&&(e.style.overflow="hidden"),void 0!==t&&(e.scrollTop=t),a.e&&(e.style.overflow="")}},function(e,t,n){"use strict";var a=n(0),r=n(1),c=n(7),i=n(4),s=n(22),o=n(16);n(212);t.a=Object(a.h)(Object(r.h)((e,{typingStatus:t})=>{if(!t.userId)return{};return{typingUser:Object(c.Jb)(e,t.userId)}})(({typingStatus:e,typingUser:t})=>{const n=Object(o.a)(),r=t&&!t.isSelf&&Object(i.ab)(t);return a.a.createElement("p",{className:"typing-status",dir:n.isRtl?"rtl":"auto"},r&&a.a.createElement("span",{className:"sender-name",dir:"auto"},Object(s.a)(r)),n(e.action).replace("{user}","").trim(),a.a.createElement("span",{className:"ellipsis"}))}))},function(e,t,n){"use strict";var a=n(0),r=n(1),c=n(7),i=n(4),s=n(3),o=n(16),l=n(22),d=n(114),u=n(112),m=n(21);n(215);t.a=Object(a.h)(Object(r.h)((e,{chat:t})=>{const n=Object(i.ob)(t.id),a=Object(c.P)(e,t.id),r=n&&Object(c.Jb)(e,Object(i.W)(t)),s=r&&Object(i.Bb)(r)&&!t.isSupport,o=n&&!a&&!s,l=n?Object(i.ab)(Object(c.Jb)(e,Object(i.W)(t))):void 0;return{isPrivateChat:n,isChatWithSelf:a,isBot:s,isChannel:Object(i.mb)(t),isBasicGroup:Object(i.lb)(t),isSuperGroup:Object(i.qb)(t),currentUserId:e.currentUserId,canDeleteForAll:o,contactName:l}},(e,t)=>Object(s.l)(t,["leaveChannel","deleteHistory","deleteChannel","deleteChatUser","blockContact"]))(({isOpen:e,chat:t,isChannel:n,isPrivateChat:r,isChatWithSelf:c,isBot:s,isBasicGroup:b,isSuperGroup:h,currentUserId:f,canDeleteForAll:p,contactName:O,onClose:g,onCloseAnimationEnd:v,leaveChannel:j,deleteHistory:E,deleteChannel:y,deleteChatUser:C,blockContact:N})=>{const T=Object(o.a)(),w=Object(i.k)(T,t),I=Object(a.m)(()=>{E({chatId:t.id,shouldDeleteForAll:!0}),g()},[E,t.id,g]),M=Object(a.m)(()=>{E({chatId:t.id,shouldDeleteForAll:!0}),N({contactId:t.id,accessHash:t.accessHash}),g()},[E,t.id,t.accessHash,N,g]),k=Object(a.m)(()=>{r?E({chatId:t.id,shouldDeleteForAll:!1}):b?(C({chatId:t.id,userId:f}),E({chatId:t.id,shouldDeleteForAll:!1})):!n&&!h||t.isCreator?(n||h)&&t.isCreator&&y({chatId:t.id}):j({chatId:t.id}),g()},[r,b,n,h,f,t.isCreator,t.id,g,E,C,j,y]);return a.a.createElement(u.a,{isOpen:e,className:"DeleteChatModal",header:a.a.createElement("div",{className:"modal-header",dir:T.isRtl?"rtl":void 0},a.a.createElement(d.a,{size:"tiny",chat:t,isSavedMessages:c}),a.a.createElement("h3",{className:"modal-title"},T(n&&!t.isCreator?"LeaveChannel":n&&t.isCreator?"ChannelDelete":b||h?"Group.LeaveGroup":"DeleteChatUser"))),onClose:g,onCloseAnimationEnd:v},n&&t.isCreator?a.a.createElement("p",null,Object(l.a)(T("ChatList.DeleteAndLeaveGroupConfirmation",w),["simple_markdown"])):n&&!t.isCreator||b||h?a.a.createElement("p",null,Object(l.a)(T("ChannelLeaveAlertWithName",w),["simple_markdown"])):a.a.createElement("p",null,Object(l.a)(T("ChatList.DeleteChatConfirmation",O),["simple_markdown"])),s&&a.a.createElement(m.a,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:M},T("DeleteAndStop")),p&&a.a.createElement(m.a,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:I},O?Object(l.a)(T("ChatList.DeleteForEveryone",O)):T("DeleteForAll")),a.a.createElement(m.a,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:k},T(n&&!t.isCreator?"LeaveChannel":n&&t.isCreator?"Chat.Input.Delete":b||h?"Group.LeaveGroup":p?"ChatList.DeleteForCurrentUser":"Delete")),a.a.createElement(m.a,{className:"confirm-dialog-button",isText:!0,onClick:g},T("Cancel")))}))},function(e,t,n){"use strict";var a=n(0),r=n(40),c=n(29),i=n(9);t.a=({isOpen:e,isCustom:t,id:n,className:s,onClick:o,children:l})=>{const{shouldRender:d,transitionClassNames:u}=Object(r.a)(e,void 0,void 0,!t&&void 0),m=Object(c.a)(e),b=Object(c.a)(l),h=Object(a.q)();return m&&!e&&(h.current=b),d&&a.a.createElement("div",{id:n,className:Object(i.a)(s,u),onClick:o},e?l():h.current())}},function(e,t,n){"use strict";function a(e){e.dataset.patchedForSafari||(e.addEventListener("play",()=>{const t=e.currentTime;e.addEventListener("progress",(function n(){e.buffered.length&&(e.dataset.patchForSafariInProgress="true",e.currentTime=e.duration-1,e.addEventListener("progress",()=>{delete e.dataset.patchForSafariInProgress,e.currentTime=t,e.paused&&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",(function(){return a})),n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";var a=n(0),r=n(29);t.a=(e,t,n)=>{const c=Object(r.a)(t);return Object(a.o)(()=>e(c||[]),t,n)}},function(e,t,n){"use strict";var a=n(0),r=n(60),c=n(4),i=n(109),s=n(123),o=n(110),l=n(186),d=n(187);t.a=Object(a.h)(({message:e,observeIntersection:t,smaller:n,uploadProgress:u,withDate:m,datetime:b,className:h,sender:f,isSelected:p,isSelectable:O,onCancelUpload:g,onMediaClick:v,onDateClick:j})=>{const E=Object(a.q)(null),y=e.content.document,C=Object(r.b)(y)||"",{fileName:N,size:T,timestamp:w}=y,I=v&&Boolean(y.mediaType),M=Object(i.b)(E,t),[k,S]=Object(a.r)(!1),{mediaData:L,downloadProgress:A}=Object(s.a)(Object(c.E)(e,"download"),!k),{isUploading:x,isTransferring:D,transferProgress:R}=Object(c.r)(e,u||A,k),F=Object(r.c)(y),_=F?Object(c.F)(e):void 0,P=F?y.previewBlobUrl:void 0,U=Object(o.a)(Object(c.E)(e,"pictogram"),!M),B=Object(a.m)(()=>{I?v():x?g&&g():S(e=>!e)},[I,x,g,v]),q=Object(a.m)(()=>{j(e.id,e.chatId)},[j,e.id,e.chatId]);return Object(a.n)(()=>{k&&L&&(Object(l.a)(L,N),S(!1))},[N,L,k]),a.a.createElement(d.a,{ref:E,name:N,extension:C,size:T,timestamp:m?b||w:void 0,thumbnailDataUri:_,previewData:P||U,smaller:n,isTransferring:D,isUploading:x,transferProgress:R,className:h,sender:f,isSelectable:O,isSelected:p,actionIcon:I?Object(c.wb)(e)?"icon-play":"icon-eye":"icon-download",onClick:B,onDateClick:j?q:void 0})})},function(e,t,n){"use strict";var a=n(0),r=n(15),c=n(24);t.a=Object(a.h)(e=>{const{isOpen:t}=e,n=Object(c.a)(r.a.Extra,"StickerSetModal",!t);return n?a.a.createElement(n,e):void 0})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var a=n(0),r=n(169),c=n(31),i=n(6);function s(e,t=!1,n){const s=Object(a.q)(null),o=Object(c.a)();return Object(a.n)(()=>{const a=s.current;if(!e||!a||t)return;const c=new Image,o=()=>{a.width=c.width,a.height=c.height;const e=a.getContext("2d",{alpha:!1});i.c&&(e.filter="blur(2px)"),e.drawImage(c,-4,-4,a.width+8,a.height+8),i.c||Object(r.a)(e,0,0,a.width,a.height,2,2)};c.onload=()=>{n?requestAnimationFrame(o):o()},c.src=e},[s,e,o,t,n]),s}},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));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 c(e,t,n,c,i,s,o){if(Number.isNaN(s)||s<1)return;s|=0,Number.isNaN(o)&&(o=1),(o|=0)>3&&(o=3),o<1&&(o=1);const l=e.getImageData(t,n,c,i),d=l.data;let u,m,b,h,f,p,O,g,v,j,E,y,C=c-1,N=i-1,T=s+1,w=[],I=[],M=[],k=a[s],S=r[s],L=[],A=[];for(;o-- >0;){for(y=E=0,f=0;fC?C:p)<<2),u+=d[O++],m+=d[O++],b+=d[O++];for(h=0;h0?O<<2:0),g=y+L[h],v=y+A[h],u+=d[g++]-d[v++],m+=d[g++]-d[v++],b+=d[g++]-d[v++],E++;y+=c<<2}for(h=0;hN?0:c,u+=w[j],m+=I[j],b+=M[j];for(E=h<<2,f=0;f>>S,d[E+1]=m*k>>>S,d[E+2]=b*k>>>S,0==h&&(L[f]=((O=f+T)0?O*c:0),g=h+L[f],v=h+A[f],u+=w[g]-w[v],m+=I[g]-I[v],b+=M[g]-M[v],E+=c<<2}}e.putImageData(l,t,n)}},function(e,t,n){"use strict";var a=n(0),r=n(2),c=n(9),i=n(49),s=n(40),o=n(80),l=n(25),d=n(16),u=n(21);n(251);const m={B:"bold",STRONG:"bold",I:"italic",EM:"italic",U:"underline",DEL:"strikethrough",CODE:"monospace"},b=document.createElement("div");t.a=Object(a.h)(({isOpen:e,anchorPosition:t,selectedRange:n,onClose:h})=>{const f=Object(a.q)(null),p=Object(a.q)(null),{shouldRender:O,transitionClassNames:g}=Object(s.a)(e),[v,j,E]=Object(l.a)(),[y,C]=Object(a.r)(""),[N,T]=Object(a.r)(!1),[w,I]=Object(a.r)(),[M,k]=Object(a.r)({});Object(a.n)(()=>e?Object(i.a)(h):void 0,[e,h]),Object(o.a)(e,f,h),Object(a.n)(()=>{v?p.current.focus():(C(""),T(!1))},[v]),Object(a.n)(()=>{O||(E(),k({}),I(void 0))},[E,O]),Object(a.n)(()=>{if(!e||!n)return;const t={};let{parentElement:a}=n.commonAncestorContainer;for(;a&&a.id!==r.z;){const e=m[a.tagName];e&&(t[e]=!0),a=a.parentElement}k(t)},[e,n,j]);const S=Object(a.m)(()=>{if(n)return b.innerText=n.toString(),b.innerHTML},[n]),L=Object(a.m)(()=>{if(n)return n.commonAncestorContainer.parentElement},[n]);function A(){const e=p.current;if(!e)return;const{offsetWidth:t,scrollWidth:n,scrollLeft:a}=e;if(n<=t)return void I(void 0);let r="";a0&&(r+=" mask-left"),I(r)}function x(e){if(M[e])return"active";if("monospace"===e||"strikethrough"===e){if(Object.keys(M).some(t=>t!==e&&!!M[t]))return"disabled"}else if(M.monospace||M.strikethrough)return"disabled"}const D=Object(a.m)(()=>{k(e=>(document.execCommand(e.bold?"removeFormat":"bold"),Object.keys(e).forEach(t=>{"italic"!==t&&"underline"!==t||!e[t]||document.execCommand(t)}),{...e,bold:!e.bold}))},[]),R=Object(a.m)(()=>{document.execCommand("italic"),k(e=>({...e,italic:!e.italic}))},[]),F=Object(a.m)(()=>{document.execCommand("underline"),k(e=>({...e,underline:!e.underline}))},[]),_=Object(a.m)(()=>{if(M.strikethrough){const e=L();if(!n||!e||"DEL"!==e.tagName||!e.textContent)return;return e.replaceWith(e.textContent),void k(e=>({...e,strikethrough:!1}))}const e=S();document.execCommand("insertHTML",!1,`${e}`),h()},[L,S,h,n,M.strikethrough]),P=Object(a.m)(()=>{if(M.monospace){const e=L();if(!n||!e||"CODE"!==e.tagName||!e.textContent)return;return e.replaceWith(e.textContent),void k(e=>({...e,monospace:!1}))}const e=S();document.execCommand("insertHTML",!1,`${e}`),h()},[L,S,h,n,M.monospace]);function U(){const e=encodeURI(y.includes("://")?y:"http://"+y);if(N){const t=L();if(!t||"A"!==t.tagName)return;return t.href=e,void h()}const t=S();!function(){if(!n)return;const e=window.getSelection();e&&(e.removeAllRanges(),e.addRange(n))}(),document.execCommand("insertHTML",!1,`${t}`),h()}const B=Object(a.m)(e=>{const t={KeyK:j,KeyB:D,KeyU:F,KeyI:R,KeyM:P,KeyS:_}[e.code];!e.altKey&&(e.ctrlKey||e.metaKey)&&t&&(e.preventDefault(),e.stopPropagation(),t())},[D,R,F,P,_,j]);Object(a.n)(()=>(e&&document.addEventListener("keydown",B),()=>document.removeEventListener("keydown",B)),[e,B]);const q=Object(d.a)();if(!O)return;const H=Object(c.a)("TextFormatter",g,v&&"link-control-shown"),$=Object(c.a)("TextFormatter-link-url-confirm",!!y.length&&"shown"),K=t?`left: ${t.x}px; top: ${t.y}px;--text-formatter-left: ${t.x}px;`:"";return a.a.createElement("div",{ref:f,className:H,style:K,onKeyDown:function(e){"Enter"===e.key&&v&&(U(),e.preventDefault())}},a.a.createElement("div",{className:"TextFormatter-buttons"},a.a.createElement(u.a,{color:"translucent",ariaLabel:"Bold text",className:x("bold"),onClick:D},a.a.createElement("i",{className:"icon-bold"})),a.a.createElement(u.a,{color:"translucent",ariaLabel:"Italic text",className:x("italic"),onClick:R},a.a.createElement("i",{className:"icon-italic"})),a.a.createElement(u.a,{color:"translucent",ariaLabel:"Underlined text",className:x("underline"),onClick:F},a.a.createElement("i",{className:"icon-underlined"})),a.a.createElement(u.a,{color:"translucent",ariaLabel:"Strikethrough text",className:x("strikethrough"),onClick:_},a.a.createElement("i",{className:"icon-strikethrough"})),a.a.createElement(u.a,{color:"translucent",ariaLabel:"Monospace text",className:x("monospace"),onClick:P},a.a.createElement("i",{className:"icon-monospace"})),a.a.createElement("div",{className:"TextFormatter-divider"}),a.a.createElement(u.a,{color:"translucent",ariaLabel:q("TextFormat.AddLinkTitle"),onClick:j},a.a.createElement("i",{className:"icon-link"}))),a.a.createElement("div",{className:"TextFormatter-link-control"},a.a.createElement("div",{className:"TextFormatter-buttons"},a.a.createElement(u.a,{color:"translucent",ariaLabel:q("Cancel"),onClick:E},a.a.createElement("i",{className:"icon-arrow-left"})),a.a.createElement("div",{className:"TextFormatter-divider"}),a.a.createElement("div",{className:Object(c.a)("TextFormatter-link-url-input-wrapper",w)},a.a.createElement("input",{ref:p,className:"TextFormatter-link-url-input",type:"text",value:y,placeholder:"Enter URL...",autoComplete:"off",inputMode:"url",dir:"auto",onChange:function(e){C(e.target.value),A()},onScroll:A})),a.a.createElement("div",{className:$},a.a.createElement("div",{className:"TextFormatter-divider"}),a.a.createElement(u.a,{color:"translucent",ariaLabel:q("Save"),className:"color-primary",onClick:U},a.a.createElement("i",{className:"icon-check"}))))))})},function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"c",(function(){return i})),n.d(t,"b",(function(){return s}));var a=n(2);const r=navigator.clipboard&&window.ClipboardItem,c=document.createElement("textarea");c.setAttribute("readonly",""),c.tabIndex=-1,c.className="visually-hidden";const i=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)},s=e=>{if(!e)return;const t=document.createElement("canvas"),n=t.getContext("2d"),a=new Image;a.onload=e=>{if(n&&e.currentTarget){const a=e.currentTarget;t.width=a.width,t.height=a.height,n.drawImage(a,0,0,a.width,a.height),t.toBlob(o,"image/png",1)}},a.src=e};async function o(e){if(e&&r)try{await navigator.clipboard.write([new window.ClipboardItem({[e.type]:e})])}catch(e){a.r&&console.error(e)}}},function(e,t,n){"use strict";var a=n(0),r=n(30),c=n(4),i=n(110),s=n(117);n(259);t.a=Object(a.h)(({message:e,idPrefix:t="shared-media",onClick:n})=>{const o=Object(a.m)(()=>{n(e.id,e.chatId)},[e.id,e.chatId,n]),l=Object(c.F)(e),d=Object(i.a)(Object(c.E)(e,"pictogram")),{shouldRenderThumb:u,shouldRenderFullMedia:m,transitionClassNames:b}=Object(s.a)(d,"slow"),h=Object(c.Q)(e);return a.a.createElement("div",{id:`${t}${e.id}`,className:"Media scroll-item",onClick:n?o:void 0},u&&a.a.createElement("img",{src:l,alt:""}),m&&a.a.createElement("img",{src:d,className:b+" full-media",alt:""}),h&&a.a.createElement("span",{className:"video-duration"},h.isGif?"GIF":Object(r.e)(h.duration)))})},function(e,t,n){"use strict";var a=n(0),r=n(4),c=n(115),i=n(48),s=n(47),o=n(108),l=n(111),d=n(130),u=n(146),m=n(133),b=n(16),h=n(20);n(195);t.a=Object(a.h)(({itemIds:e,selectedIds:t,filterValue:n,filterPlaceholder:f,notFoundText:p,searchInputId:O,isLoading:g,noScrollRestore:v,onSelectedIdsChange:j,onFilterChange:E,onLoadMore:y})=>{const C=Object(a.q)(null),N=t.length>10;Object(a.n)(()=>{setTimeout(()=>{requestAnimationFrame(()=>{C.current.focus()})},500)},[]);const T=Object(a.m)(e=>{const n=[...t];n.includes(e)?n.splice(n.indexOf(e),1):n.push(e),j(n),E("")},[t,j,E]),w=Object(a.m)(e=>{const{value:t}=e.currentTarget;E(t)},[E]),[I,M]=Object(m.a)(y,e,Boolean(n)),k=Object(b.a)();return a.a.createElement("div",{className:"Picker"},a.a.createElement("div",{className:"picker-header custom-scroll",dir:k.isRtl?"rtl":void 0},t.map((e,n)=>a.a.createElement(u.a,{chatOrUserId:e,isMinimized:N&&na.a.createElement(o.a,{key:e,className:"chat-item-clickable picker-list-item",onClick:()=>T(e),ripple:!0},a.a.createElement(i.a,{label:"",checked:t.includes(e)}),Object(r.ob)(e)?a.a.createElement(l.a,{userId:e}):a.a.createElement(d.a,{chatId:e})))):g||!I||I.length?a.a.createElement(h.a,null):a.a.createElement("p",{className:"no-results"},p||"Sorry, nothing found."))})},,function(e,t,n){"use strict";var a=n(0),r=n(6),c=n(30),i=n(4);var s=n(9),o=n(22);var l=n(123),d=n(40),u=n(141),m=n(184),b=n(188),h=n(16),f=n(21),p=n(124),O=n(32);n(231);const g=r.l?20:25,v=r.l?50:75;function j(e,t,{handleStartSeek:n,handleSeek:r,handleStopSeek:c}){return a.a.createElement("div",{className:"seekline no-selection",onMouseDown:n,onMouseMove:r,onMouseUp:c},a.a.createElement("span",{className:"seekline-buffered-progress"},a.a.createElement("i",{style:`transform: translateX(${100*t}%)`})),a.a.createElement("span",{className:"seekline-play-progress"},a.a.createElement("i",{style:`transform: translateX(${100*e}%)`})),a.a.createElement("span",{className:"seekline-thumb"},a.a.createElement("i",{style:`transform: translateX(${100*e}%)`})))}t.a=Object(a.h)(({theme:e,message:t,senderTitle:n,uploadProgress:E,target:y,date:C,lastSyncTime:N,className:T,isSelectable:w,isSelected:I,onPlay:M,onReadMedia:k,onCancelUpload:S,onDateClick:L})=>{const{content:{audio:A,voice:x},isMediaUnread:D}=t,R=Boolean(x),F=Object(a.q)(!1),_=Object(h.a)(),[P,U]=Object(a.r)(!1),B=N,{mediaData:q,downloadProgress:H}=Object(l.a)(Object(i.E)(t,"inline"),!B,Object(i.D)(t,"inline"));const{isBuffered:$,bufferedProgress:K,bufferingHandlers:z,checkBuffering:V}=Object(u.a)(),{isPlaying:Y,playProgress:W,playPause:G,setCurrentTime:X,duration:J}=Object(m.a)(Object(i.C)(t),Object(i.q)(t),q,z,V,P,(function(){U(!0),M(t.id,t.chatId)}),Object(i.xb)(t));Object(a.n)(()=>{U(Y)},[Y]);const{isDownloadStarted:Q,downloadProgress:Z,handleDownloadClick:ee}=Object(b.a)(Object(i.E)(t,"download"),Object(i.u)(t)),te=P&&!$,{isUploading:ne,isTransferring:ae,transferProgress:re}=Object(i.r)(t,Q?Z:E||H,te||Q),{shouldRender:ce,transitionClassNames:ie}=Object(d.a)(ae),se=Object(a.m)(()=>{ne?S&&S():(Y||M(t.id,t.chatId),U(!P),G())},[Y,ne,t.id,t.chatId,S,M,G,P]);Object(a.n)(()=>{Y&&k&&D&&k()},[Y,D,k]);const oe=Object(a.m)(e=>{if(F.current){const t=e.currentTarget.closest(".seekline,.waveform");if(t){const{width:n,left:a}=t.getBoundingClientRect();X(J*((e.clientX-a)/n))}}},[J,X]),le=Object(a.m)(e=>{F.current=!0,oe(e)},[oe]),de=Object(a.m)(()=>{F.current=!1},[]),ue=Object(a.m)(()=>{L(t.id,t.chatId)},[L,t.id,t.chatId]);const me={handleStartSeek:le,handleSeek:oe,handleStopSeek:de},be=Object(i.yb)(t),he=Object(a.p)(()=>x&&function(e,t=0,n=!1,{handleStartSeek:r,handleSeek:c,handleStopSeek:i},s){const{waveform:o,duration:l}=e;if(!o)return;const d="dark"===s?"#494B75":"#CBCBCB",u="dark"===s?"#C0BBED":"#B0DEA6",m="dark"===s?"#868DF5":"#54a3e6",b="dark"===s?"#FFFFFF":"#53ad53",h=Math.min(l/30,1),f=Math.round(g+(v-g)*h),p=function(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),c=r[t]+(r[t+1]<<8);a[e]=c>>n&31}const c=Math.floor(5*(n-1)/8),i=Math.floor(5*(n-1)%8),s=r[c]+(r[c+1]<<8);return a[n-1]=s>>i&31,a}(new Uint8Array(o)),{data:O,peak:j}=function(e,t){let n=0;const a=new Array(t),r=e.length/t,c=e[0],i=e[e.length-1];for(let d=0;d{s.globalAlpha=i/e.length>=t?.5:1,s.fillStyle=t>i/e.length?r:a;const o=Math.max(2,c/Math.max(1,n)*23);!function(e,t,n,a,r,c){a<2*c&&(c=a/2);r<2*c&&(c=r/2);e.beginPath(),e.moveTo(t+c,n),e.arcTo(t+a,n,t+a,n-r,c),e.arcTo(t+a,n-r,t,n-r,c),e.arcTo(t,n-r,t,n,c),e.arcTo(t,n,t+a,n,c),e.closePath()}(s,4*i,23,2,o,1),s.fill()}),{src:i.toDataURL(),width:c,height:23}}(O,t,{peak:j,fillStyle:n?u:d,progressFillStyle:n?b:m});return a.a.createElement("img",{src:E,alt:"",width:y,height:C,className:"waveform",draggable:!1,onMouseDown:r,onMouseMove:c,onMouseUp:i})}(x,W,be,me,e),[x,W,be,me,e]),fe=Object(s.a)("Audio media-inner",T,be&&!y&&"own",y&&"bigger",I&&"audio-is-selected"),pe=["toggle-play"];te?pe.push("loading"):Y?pe.push("pause"):Y||pe.push("play");const Oe=Y||W>0&&W<1,ge=Object(s.a)("content",Oe&&"with-seekline");return a.a.createElement("div",{className:fe,dir:_.isRtl?"rtl":void 0},w&&a.a.createElement("div",{className:"message-select-control"},I&&a.a.createElement("i",{className:"icon-select"})),a.a.createElement(f.a,{round:!0,ripple:!r.l,size:y?"smaller":"tiny",className:pe.join(" "),ariaLabel:Y?"Pause audio":"Play audio",onClick:se,isRtl:_.isRtl},a.a.createElement("i",{className:"icon-play"}),a.a.createElement("i",{className:"icon-pause"})),ce&&a.a.createElement("div",{className:Object(s.a)("media-loading",ie,te&&"interactive")},a.a.createElement(p.a,{progress:re,transparent:!0,size:y?"m":"s",onClick:te?se:void 0,noCross:!te})),A&&a.a.createElement(f.a,{round:!0,size:"tiny",className:"download-button",ariaLabel:Q?"Cancel download":"Download",onClick:ee},a.a.createElement("i",{className:Q?"icon-close":"icon-arrow-down"})),"searchResult"===y&&a.a.createElement(a.a.Fragment,null,a.a.createElement("div",{className:ge},a.a.createElement("div",{className:"content-row"},a.a.createElement("p",{className:"title",dir:"auto"},Object(o.a)(function(){if(R)return n||"Voice";const{title:e,fileName:t}=A;return e||t}())),a.a.createElement("div",{className:"message-date"},C&&a.a.createElement(O.a,{className:"date",onClick:ue},Object(c.g)(_,1e3*C)))),Oe&&j(W,K,me),!Oe&&a.a.createElement("p",{className:"duration",dir:"auto"},W>0?Object(c.e)(J*W)+" / ":void 0,function(){if(R)return Object(c.e)(x.duration);const{performer:e}=A;return a.a.createElement(a.a.Fragment,null,e&&Object(o.a)(e),e&&n&&a.a.createElement("span",null,"•"),n&&Object(o.a)(n))}()))),"searchResult"!==y&&A&&function(e,t,n,r,i,s,l,d){const{title:u,performer:m,duration:b,fileName:h}=t,f=n||r>0&&r<1;return a.a.createElement("div",{className:"content"},a.a.createElement("p",{className:"title",dir:"auto"},Object(o.a)(u||h)),f&&j(r,i,s),!f&&a.a.createElement("div",{className:"meta",dir:"auto"},a.a.createElement("span",{className:"performer"},Object(o.a)(m||"Unknown")),l&&a.a.createElement(a.a.Fragment,null," ","•"," ",a.a.createElement(O.a,{className:"date",onClick:d},Object(c.d)(e,1e3*l)))),a.a.createElement("p",{className:"duration",dir:"auto"},r>0?Object(c.e)(b*r)+" / ":void 0,Object(c.e)(b)))}(_,A,Y,W,K,me,C,L?ue:void 0),"searchResult"!==y&&x&&function(e,t,n){return a.a.createElement("div",{className:"content"},t,a.a.createElement("p",{className:"voice-duration",dir:"auto"},Object(c.e)(e.duration),n&&a.a.createElement("span",null,"•")))}(x,he,D))})},function(e,t,n){"use strict";var a=n(0),r=n(147),c=n(29),i=n(148),s=n(16),o=n(9),l=n(22);n(209);var d=Object(a.h)(({className:e,title:t,active:n,badgeCount:r,isBadgeActive:c,previousActiveTab:i,onClick:s,clickArg:d})=>{const u=Object(a.q)(null);return Object(a.o)(()=>{if(!n||void 0===i)return;const e=u.current,t=e.querySelector("i"),a=e.parentElement.children[i];if(!a)return;const r=a.querySelector("i");r.classList.remove("animate"),t.classList.remove("animate");const c=r.parentElement.offsetLeft-t.parentElement.offsetLeft,s=r.clientWidth/t.clientWidth;t.style.transform=`translate3d(${c}px, 0, 0) scale3d(${s}, 1, 1)`,requestAnimationFrame(()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{t.classList.add("animate"),t.style.transform="none"})})})},[n,i]),a.a.createElement("button",{type:"button",className:Object(o.a)("Tab",e,n&&"active"),onClick:()=>s(d),ref:u},a.a.createElement("span",null,Object(l.a)(t),!!r&&a.a.createElement("span",{className:Object(o.a)("badge",c&&"active")},r),a.a.createElement("i",null)))});n(210);t.a=Object(a.h)(({tabs:e,activeTab:t,big:n,onSwitchTab:o})=>{const l=Object(a.q)(null),u=Object(c.a)(t);Object(i.a)(l.current),Object(a.n)(()=>{const e=l.current;if(e.scrollWidth<=e.offsetWidth)return;const t=e.querySelector(".Tab.active");if(t){const n=t.offsetLeft-e.offsetWidth/2+t.offsetWidth/2;if(Math.abs(n-e.scrollLeft)<16)return;Object(r.a)(e,n)}},[t]);const m=Object(s.a)();return a.a.createElement("div",{className:"TabList no-selection no-scrollbar "+(n?"big":""),ref:l,dir:m.isRtl?"rtl":void 0},e.map((e,n)=>a.a.createElement(d,{key:e.title,title:m(e.title),active:n===t,badgeCount:e.badgeCount,isBadgeActive:e.isBadgeActive,previousActiveTab:u,onClick:o,clickArg:n})))})},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));const a={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",SERVICE_WORKER_DISABLED:"Service Worker is disabled. Please reload the page without holding key.",CAPTION_TOO_LONG_PLEASE_REMOVE_CHARACTERS:"The provided caption 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"};function r(e){const{message:t,isSlowMode:n,textParams:r}=e;if(n){const e=t.indexOf(" (caused by");return e>0?t.substring(0,e):t}let c=a[t];return c&&r&&(c=Object.keys(r).reduce((e,t)=>e.replace(t,r[t]),c)),c}},function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return r}));function a(e,t,n){c("transitionend",e,t,n)}function r(e,t,n){c("animationend",e,t,n)}function c(e,t,n,a){let r=!1;t.addEventListener(e,(function c(i){r||i.target!==i.currentTarget||a&&(i instanceof TransitionEvent&&i.propertyName===a||i instanceof AnimationEvent&&i.animationName===a)||(r=!0,t.removeEventListener(e,c),setTimeout(()=>{n()},50))}))}},function(e,t,n){"use strict";var a=n(0),r=n(1),c=n(4),i=n(16);t.a=({chat:e,privateChatUser:t,handleDelete:n,folderId:s,isPinned:o,isMuted:l})=>{const d=Object(i.a)(),{toggleChatPinned:u,updateChatMutedState:m,toggleChatArchived:b,toggleChatUnread:h}=Object(r.d)();return Object(a.p)(()=>{if(!e)return;const a=t&&t.isSelf,r=e.unreadCount||e.hasUnreadMark?{title:d("MarkAsRead"),icon:"readchats",handler:()=>h({id:e.id})}:{title:d("MarkAsUnread"),icon:"unread",handler:()=>h({id:e.id})},i=o?{title:d("UnpinFromTop"),icon:"unpin",handler:()=>u({id:e.id,folderId:s})}:{title:d("PinToTop"),icon:"pin",handler:()=>u({id:e.id,folderId:s})},f=l?{title:d("ChatList.Unmute"),icon:"unmute",handler:()=>m({chatId:e.id,isMuted:!1})}:{title:d("ChatList.Mute"),icon:"mute",handler:()=>m({chatId:e.id,isMuted:!0})},p=Object(c.kb)(e)?{title:d("Unarchive"),icon:"unarchive",handler:()=>b({id:e.id})}:{title:d("Archive"),icon:"archive",handler:()=>b({id:e.id})};return[r,i,...a?[]:[f,p],{title:Object(c.ob)(e.id)?d("Delete"):d(Object(c.c)(e)?"DeleteChat":Object(c.mb)(e)?"LeaveChannel":"Group.LeaveGroup"),icon:"delete",destructive:!0,handler:n}]},[e,t,d,o,n,h,u,s,m,b,l])}},function(e,t,n){"use strict";var a=n(0),r=n(30),c=n(16),i=n(181);n(214);t.a=Object(a.h)(({message:e,outgoingStatus:t})=>{const n=Object(c.a)();return a.a.createElement("div",{className:"LastMessageMeta"},t&&a.a.createElement(i.a,{status:t}),a.a.createElement("span",{className:"time"},Object(r.g)(n,1e3*e.date)))})},function(e,t,n){"use strict";var a,r=n(0),c=n(113);n(213);!function(e){e[e.failed=0]="failed",e[e.pending=1]="pending",e[e.succeeded=2]="succeeded",e[e.read=3]="read"}(a||(a={}));t.a=Object(r.h)(({status:e})=>r.a.createElement("div",{className:"MessageOutgoingStatus"},r.a.createElement(c.a,{name:"reveal",activeKey:a[e]},()=>r.a.createElement("i",{className:"icon-message-"+e}))))},function(e,t,n){"use strict";var a=n(0);t.a=(e,t,n,r,c=0,i=0)=>{const[s,o]=Object(a.r)("right"),[l,d]=Object(a.r)("bottom"),[u,m]=Object(a.r)("");return Object(a.n)(()=>{const a=t();if(!e||!a)return;let{x:s,y:l}=e;const u={width:0,left:0,height:0,top:0},b=r(),h=n(),f=a.getBoundingClientRect(),p=b?{width:b.offsetWidth,height:b.offsetHeight}:u,O=h?h.getBoundingClientRect():u;let g;s+p.width+c0?(g="right",s-=3):(g="left",s=16),o(g),l+p.height{t&&!l&&d&&!s.current&&(s.current=window.setTimeout(()=>{s.current=void 0,o()},t))},[e]),s.current&&t&&!l?n:e}},function(e,t,n){"use strict";var a=n(0),r=n(185),c=n(58),i=n(164),s=n(52);t.a=(e,t,n,o,l,d=!1,u,m=!1)=>{const b=Object(a.q)(null),[h,f]=Object(a.r)(!1);let p=h;const[O,g]=Object(a.r)(0);Object(s.a)(()=>{b.current=Object(r.a)(e,(e,n)=>{switch(e){case"onPlay":f(!0);break;case"onPause":f(!1);break;case"onTimeUpdate":{const{proxy:e}=b.current,n=e.duration&&Number.isFinite(e.duration)?e.duration:t;g(e.currentTime/n);break}}o&&o[e]&&o[e](n)},u);const{proxy:n}=b.current;h||n.paused||(f(!0),p=!0),l&&l(n)},[e]);const{play:v,pause:j,setCurrentTime:E,proxy:y,destroy:C}=b.current,N=y.duration&&Number.isFinite(y.duration)?y.duration:t;Object(a.n)(()=>{N&&!Object(i.a)(y)&&g(y.currentTime/N)},[N,O,y]),Object(a.n)(()=>()=>{C(m)},[C,m]),Object(c.a)(([e,t])=>{e===d&&n===t||y.src&&y.paused||d&&n&&!h&&v(n)},[d,n,h,v,y.src,y.paused]);const T=Object(a.m)(()=>{h?j():n&&v(n)},[n,j,v,h]);return{isPlaying:p,playProgress:O,playPause:T,setCurrentTime:E,audioProxy:y,duration:N}}},function(e,t,n){"use strict";n.d(t,"b",(function(){return u})),n.d(t,"a",(function(){return m}));var a=n(6),r=n(140),c=n(164),i=n(1),s=n(4);const o=new Map;let l,d=[];function u(){const e=l&&o.get(l);e&&e.audio.pause()}function m(e,t,n){o.has(e)||(o.set(e,function(e,t){const n=new Audio;function a(t){return a=>{o.has(e)&&(Object(c.a)(n)||o.get(e).handlers.forEach(e=>{e(t,a)}))}}return n.addEventListener("timeupdate",a("onTimeUpdate")),n.addEventListener("play",a("onPlay")),n.addEventListener("pause",a("onPause")),n.addEventListener("loadstart",a("onLoadStart")),n.addEventListener("loadeddata",a("onLoadedData")),n.addEventListener("playing",a("onPlaying")),n.addEventListener("ended",()=>{if(Object(c.a)(n))return;const t=d[d.indexOf(e)+1];if(!t)return;if(!o.has(t))return void Object(i.d)().openAudioPlayer(Object(s.Eb)(t));const a=o.get(t);a.onForcePlay&&a.onForcePlay(),l=t,a.audio.src&&Object(r.a)(a.audio)}),{audio:n,proxy:new Proxy(n,{get:(e,t)=>e[t]}),handlers:[],onForcePlay:t}}(e,n)),d.includes(e)||d.push(e));const{audio:u,proxy:m,handlers:b}=o.get(e);return b.push(t),{play(t){l&&l!==e&&o.get(l).audio.pause(),l=e,u.src||(u.src=t,u.preload="auto",t.includes("/progressive/")&&a.j&&Object(c.b)(u)),Object(r.a)(u)},pause(){l===e&&u.pause()},setCurrentTime(t){l===e&&(u.currentTime=t)},proxy:m,destroy(n=!1){const a=o.get(e);a&&(a.handlers=a.handlers.filter(e=>e!==t),a.handlers.length||(a.audio.pause(),o.delete(e),n&&(d=d.filter(t=>t!==e)),e===l&&(l=void 0)))}}}},function(e,t,n){"use strict";function a(e,t){const n=document.createElement("a");n.href=e,n.download=t,n.click()}n.d(t,"a",(function(){return a}))},function(e,t,n){"use strict";var a=n(0),r=n(40),c=n(117),i=n(9),s=n(30),o=n(60),l=n(118),d=n(22),u=n(16),m=n(124),b=n(32);n(230);t.a=Object(a.h)(({ref:e,name:t,size:n,extension:h="",timestamp:f,sender:p,thumbnailDataUri:O,previewData:g,className:v,smaller:j,isTransferring:E,isUploading:y,isSelectable:C,isSelected:N,transferProgress:T,actionIcon:w,onClick:I,onDateClick:M})=>{const k=Object(u.a)();let S=Object(a.q)(null);e&&(S=e);const{shouldRender:L,transitionClassNames:A}=Object(r.a)(E,void 0,!0),x=Object(o.a)(h),D=Object(o.e)(n),{shouldRenderThumb:R,shouldRenderFullMedia:F,transitionClassNames:_}=Object(c.a)(g,"slow"),{width:P,height:U}=Object(l.k)(j),B=Object(i.a)("File",v,j&&"smaller",I&&!y&&"interactive",N&&"file-is-selected");return a.a.createElement("div",{ref:S,className:B,dir:k.isRtl?"rtl":void 0},C&&a.a.createElement("div",{className:"message-select-control"},N&&a.a.createElement("i",{className:"icon-select"})),a.a.createElement("div",{className:"file-icon-container",onClick:y?void 0:I},O||g?a.a.createElement("div",{className:"file-preview media-inner"},R&&a.a.createElement("img",{src:O,width:P,height:U,className:"thumbnail",alt:""}),F&&a.a.createElement("img",{src:g,className:"full-media "+_,width:P,height:U,alt:""})):a.a.createElement("div",{className:"file-icon "+x},h.length<=4&&a.a.createElement("span",{className:"file-ext",dir:"auto"},h)),L&&a.a.createElement("div",{className:Object(i.a)("file-progress",x,A)},a.a.createElement(m.a,{progress:T,size:j?"s":"m",onClick:y?I:void 0})),I&&a.a.createElement("i",{className:Object(i.a)("action-icon",w||"icon-download",L&&"hidden")})),a.a.createElement("div",{className:"file-info"},a.a.createElement("div",{className:"file-title",dir:"auto"},Object(d.a)(t)),a.a.createElement("div",{className:"file-subtitle",dir:"auto"},a.a.createElement("span",null,E&&T?Math.round(100*T)+"%":D),p&&a.a.createElement("span",{className:"file-sender"},Object(d.a)(p)),!p&&f&&a.a.createElement(a.a.Fragment,null," ",a.a.createElement(b.a,{onClick:M},Object(s.d)(k,1e3*f))))),p&&f&&a.a.createElement(b.a,{onClick:M},Object(s.g)(k,1e3*f)))})},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var a=n(0),r=n(123),c=n(186);function i(e,t){const[n,i]=Object(a.r)(!1),{mediaData:s,downloadProgress:o}=Object(r.a)(e,!n);Object(a.n)(()=>{n&&s&&(Object(c.a)(s,t),i(!1))},[t,s,n]),Object(a.n)(()=>{i(!1)},[e]);const l=Object(a.m)(e=>{e.stopPropagation(),i(e=>!e)},[]);return{isDownloadStarted:n,downloadProgress:o,handleDownloadClick:l}}},function(e,t,n){"use strict";var a=n(0),r=n(2),c=n(40),i=n(9),s=n(49),o=n(128);n(236);t.a=Object(a.h)(({message:e,duration:t=3e3,containerId:n,onDismiss:l})=>{const[d,u]=Object(a.r)(!0),m=Object(a.q)(null),{transitionClassNames:b}=Object(c.a)(d),h=Object(a.m)(()=>{u(!1),setTimeout(l,150+r.c)},[l]);Object(a.n)(()=>d?Object(s.a)(h):void 0,[d,h]),Object(a.n)(()=>(m.current=window.setTimeout(h,t),()=>{m.current&&(clearTimeout(m.current),m.current=void 0)}),[t,h]);const f=Object(a.m)(()=>{m.current&&(clearTimeout(m.current),m.current=void 0)},[]),p=Object(a.m)(()=>{m.current=window.setTimeout(h,t)},[t,h]);return a.a.createElement(o.a,{className:"Notification-container",containerId:n},a.a.createElement("div",{className:Object(i.a)("Notification",b),onClick:h,onMouseEnter:f,onMouseLeave:p},a.a.createElement("div",{className:"content"},e)))})},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));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)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return O}));var a=n(0),r=n(2),c=n(51),i=n(66),s=n(135),o=n(3),l=n(25);let d,u,m,b;const h=/(
|)/g,f=/ /g,p=/(
|<\/div>)/gi;try{b=new RegExp("(^|\\s):[-+_:\\p{L}\\p{N}]*$","gui")}catch(e){b=new RegExp("(^|\\s):[-+_:\\d\\wа-яё]*$","gi")}function O(e,t,O,g=r.z,v,j,E,y=!1){const[C,N,T]=Object(l.a)(),[w,I]=Object(a.r)(),[M,k]=Object(a.r)(),[S,L]=Object(a.r)({}),[A,x]=Object(a.r)(),[D,R]=Object(a.r)({}),[F,_]=Object(a.r)(!1),[P,U]=Object(a.r)(c.a),B=Object(a.p)(()=>w&&O.length?Object.values(Object(o.m)(w,O)):[],[w,O]);Object(a.n)(()=>{if(y)return;const e=()=>{I(m.emojis)};m?e():async function(){d||(d=n.e(1).then(n.t.bind(null,331,3)),u=(await d).default,m=Object(i.b)(u));return d}().then(e)},[y]),Object(a.n)(()=>{if(!w||y)return;const e=Object.values(w),t=Object(o.c)(e,"native"),n=j?Object(o.i)(j,e=>Object.values(Object(o.m)(t,e))):{},a=E?Object(o.i)(E,e=>Object.values(Object(o.m)(t,e))):{};L({...n,...a}),k([...Object.keys(n),...Object.keys(a)]);const r=e.reduce((e,t)=>(t.names.forEach(n=>{e[n]||(e[n]=[]),e[n].push(t)}),e),{});R(r),x(Object.keys(r))},[y,j,w,E]),Object(a.n)(()=>{if(!(e&&t&&w&&M&&M.length))return void T();const n=t.includes(":")&&function(e){const t=e.replace(f," ").replace(h,"\n").replace(p,"").match(b);return t?t[0].trim():void 0}(t);if(!n)return U(c.a),void T();const a=n.length>2&&n.endsWith(":"),r=n.substr(1,a?n.length-2:void 0);let i=[];if(_(a),r){if(r.length>=2){const e=M.filter(e=>e.startsWith(r)).sort();i=i.concat(Object(o.h)(Object.values(Object(o.m)(S,e))));const t=A.filter(e=>e.startsWith(r));i=i.concat(Object(o.h)(Object.values(Object(o.m)(D,t)))),i=Object(o.o)(i)}}else i=B;i.length?(a||N(),U(i.slice(0,36))):T()},[w,S,M,D,A,t,e,N,B,T,_]);const q=Object(a.m)((e,n)=>{const a=t.lastIndexOf(":",n?t.lastIndexOf(":")-1:void 0);if(-1!==a){v(`${t.substr(0,a)}${e}`);const n=document.getElementById(g);requestAnimationFrame(()=>{Object(s.a)(n,!0)})}T()},[t,g,v,T]);return Object(a.n)(()=>{C&&F&&P.length&&q(P[0].native,!0)},[P,q,C,F]),{isEmojiTooltipOpen:C,closeEmojiTooltip:T,filteredEmojis:P,insertEmoji:q}}},function(e,t,n){"use strict";var a=n(0),r=n(15),c=n(24);t.a=Object(a.h)(e=>{const{isOpen:t}=e,n=Object(c.a)(r.a.Extra,"EmojiTooltip",!t);return n?a.a.createElement(n,e):void 0})},function(e,t,n){"use strict";var a=n(0),r=n(1),c=n(2),i=n(7),s=n(10),o=n(135),l=n(9),d=n(3),u=n(6),m=n(56),b=n(165),h=n(25),f=n(65),p=n(190),O=n(16),g=n(22),v=n(170);const j=u.l?256:416;t.a=Object(a.h)(Object(r.h)(e=>{const{chatId:t,threadId:n}=Object(i.z)(e)||{},{messageSendKeyCombo:a}=e.settings.byKey;return{currentChatId:t,messageSendKeyCombo:a,replyingToId:t&&n?Object(i.ob)(e,t,n):void 0,noTabCapture:e.isPollModalOpen||e.payment.isPaymentModalOpen}},(e,t)=>Object(d.l)(t,["editLastMessage","replyToNextMessage"]))(({id:e,isAttachmentModalInput:t,editableInputId:n,html:r,placeholder:i,forcedPlaceholder:d,shouldSetFocus:E,shouldSuppressFocus:y,shouldSuppressTextFormatter:C,onUpdate:N,onSuppressedFocus:T,onSend:w,currentChatId:I,replyingToId:M,noTabCapture:k,messageSendKeyCombo:S,editLastMessage:L,replyToNextMessage:A})=>{const x=Object(a.q)(null),D=Object(a.q)(null),R=Object(O.a)(),F=Object(a.q)(!1),[_,P,U]=Object(h.a)(),[B,q]=Object(a.r)(),[H,$]=Object(a.r)();Object(a.n)(()=>{t&&Y(!1)},[t]),Object(b.a)(([e])=>{r!==x.current.innerHTML&&(x.current.innerHTML=r),r!==D.current.innerHTML&&(D.current.innerHTML=r),void 0!==e&&e!==r&&Y(!r.length)},[r]);const K=Object(a.m)(()=>{x.current.closest(".from, .to")?setTimeout(K,350):Object(o.a)(x.current)},[]),z=Object(a.m)(()=>{U(),function(){const e=window.getSelection();e&&(e.removeAllRanges?e.removeAllRanges():e.empty&&e.empty())}()},[U]);function V(){if(u.e)return;const e=window.getSelection();if(!e||!e.rangeCount||F.current)return void U();const t=e.getRangeAt(0),a=t.toString().trim();if(C||!Object(p.a)(t,n||c.z)||!a||Object(f.a)(a)||!t.START_TO_END)return void U();const r=t.getBoundingClientRect(),i=x.current.getBoundingClientRect();let s=r.left+r.width/2-i.left;s<90?s=90:s>i.width-90&&(s=i.width-90),q({x:s,y:r.top-i.top}),$(t),P()}function Y(e=!1){const t=x.current,n=D.current,a=Number(t.style.height.replace("px","")),r=Math.min(n.scrollHeight,j);if(r===a)return;const c=Math.round(50*Math.log(Math.abs(r-a))),i=()=>{t.style.height=r+"px",t.style.transitionDuration=c+"ms",t.classList.toggle("overflown",n.scrollHeight>j)};e?requestAnimationFrame(i):i()}Object(a.n)(()=>{u.n||K()},[I,K,M,E]),Object(a.n)(()=>{if(k)return;const e=Object(s.a)(e=>{"Tab"===e.key&&(e.preventDefault(),requestAnimationFrame(K))},2e3,!0,!1);return Object(m.a)({onTab:e})},[K,k]),Object(a.n)(()=>{const e=x.current;function t(){e.blur()}return y&&e.addEventListener("focus",t),()=>{e.removeEventListener("focus",t)}},[y]);const W=Object(l.a)("form-control custom-scroll",r.length>0&&"touched",y&&"focus-disabled");return a.a.createElement("div",{id:e,onClick:y?T:void 0,dir:R.isRtl?"rtl":void 0},a.a.createElement("div",{ref:x,id:n||c.z,className:W,contentEditable:!0,dir:"auto",onClick:K,onChange:function(e){const{innerHTML:t,textContent:n}=e.currentTarget;if(N("
"===t?"":t),!(u.n||n&&n.length)){const e=window.getSelection();e&&(x.current.blur(),e.removeAllRanges(),Object(o.a)(x.current,!0))}},onKeyDown:function(e){if(e.metaKey&&!r.length){const t="ArrowDown"===e.key?1:"ArrowUp"===e.key?-1:void 0;if(t)return e.preventDefault(),void A({targetIndexDelta:t})}"Enter"!==e.key||e.shiftKey?"ArrowUp"!==e.key||r.length||e.metaKey?e.target.addEventListener("keyup",(function t(){V(),e.target.removeEventListener("keyup",t)})):(e.preventDefault(),L()):u.e||u.b||!("enter"===S&&!e.shiftKey||"ctrl-enter"===S&&(e.ctrlKey||e.metaKey))||(e.preventDefault(),U(),w())},onMouseDown:function(e){2===e.button?!0!==F.current&&(F.current=!0,document.addEventListener("mousedown",(function e(){setTimeout(()=>{F.current=!1},100),window.removeEventListener("mouseup",e)})),document.addEventListener("keydown",(function e(t){"Esc"!==t.key&&"Escape"!==t.key||(setTimeout(()=>{F.current=!1},100),window.removeEventListener("keydown",e))}))):e.target.addEventListener("mouseup",(function t(){V(),e.target.removeEventListener("mouseup",t)}))},onContextMenu:function(e){u.b&&(e.preventDefault(),e.stopPropagation())},onTouchCancel:function(){u.b&&V()}}),a.a.createElement("div",{ref:D,className:Object(l.a)(W,"clone"),dir:"auto"}),!d&&a.a.createElement("span",{className:"placeholder-text",dir:"auto"},i),a.a.createElement(v.a,{isOpen:_,anchorPosition:B,selectedRange:H,onClose:z}),d&&a.a.createElement("span",{className:"forced-placeholder"},Object(g.a)(d)))}))},function(e,t,n){"use strict";var a=n(0),r=n(4),c=n(9),i=n(41),s=n(22),o=n(30),l=n(16),d=n(172),u=n(32),m=n(59);n(260);t.a=Object(a.h)(({message:e,senderTitle:t,onMessageClick:n})=>{const b=Object(l.a)();let h=Object(r.R)(e);if(!h){const t=Object(r.m)(e);if(t){const{url:n,domain:a}=t,c=Object(r.O)(b,e);h={siteName:a.replace(/^www./,""),url:n.includes("://")?n:n.includes("@")?"mailto:"+n:"http://"+n,description:c!==n?c:void 0}}}const f=Object(a.m)(()=>{n(e.id,e.chatId)},[n,e.id,e.chatId]);if(!h)return;const{siteName:p,url:O,displayUrl:g,title:v,description:j,photo:E,video:y}=h,C=!t&&Object(i.a)(j,170),N=Object(c.a)("WebLink scroll-item",!E&&!y&&"without-media");return a.a.createElement("div",{className:N,"data-initial":(p||g)[0],dir:b.isRtl?"rtl":void 0},E&&a.a.createElement(d.a,{message:e}),a.a.createElement("div",{className:"content"},a.a.createElement(u.a,{isRtl:b.isRtl,className:"site-title",onClick:f},Object(s.a)(v||p||g)),C&&a.a.createElement(u.a,{isRtl:b.isRtl,className:"site-description",onClick:f},Object(s.a)(C)),a.a.createElement(m.a,{url:O,className:"site-name",text:"",isRtl:b.isRtl},O.replace("mailto:","")||g),t&&a.a.createElement("div",{className:"sender-name"},Object(s.a)(t))),t&&a.a.createElement("div",{className:"message-date"},a.a.createElement(u.a,{className:"date",onClick:f,isRtl:b.isRtl},Object(o.g)(b,1e3*e.date))))})},function(e,t,n){},,,function(e,t,n){"use strict";var a=n(0),r=n(1),c=n(2),i=n(6),s=n(29),o=n(3),l=n(4),d=n(7),u=n(133);let m;!function(e){e[e.Move=0]="Move",e[e.Opacity=1]="Opacity",e[e.None=2]="None"}(m||(m={}));var b=n(115),h=n(20),f=n(16),p=n(8),O=n(68),g=n(22),v=n(10),j=n(9),E=n(149),y=n(179),C=n(25),N=n(110),T=n(114),w=n(138),I=n(161),M=n(180),k=n(162),S=n(108),L=n(50),A=n(163);n(217);var x=Object(a.h)(({chat:e,isPinned:t,isMuted:n})=>{const r=Boolean(e.unreadCount||e.hasUnreadMark||t),c=Object(j.a)("Badge",n&&"muted",t&&"pinned",Boolean(e.unreadCount||e.hasUnreadMark)&&"unread");function i(){return e.unreadCount?e.unreadMentionsCount?a.a.createElement("div",{className:"Badge-wrapper"},a.a.createElement("div",{className:"Badge mention"},a.a.createElement("i",{className:"icon-mention"})),a.a.createElement("div",{className:c},Object(L.b)(e.unreadCount))):a.a.createElement("div",{className:c},Object(L.b)(e.unreadCount)):e.hasUnreadMark?a.a.createElement("div",{className:c}):t?a.a.createElement("div",{className:c},a.a.createElement("i",{className:"icon-pinned-chat"})):void 0}return a.a.createElement(A.a,{isCustom:!0,className:"Badge-transition",isOpen:r},i)});n(218);var D=Object(a.h)(Object(r.h)((e,{chatId:t})=>{const n=Object(d.g)(e,t);if(!n||!n.lastMessage)return{};const{senderId:a,replyToMessageId:r,isOutgoing:c}=n.lastMessage,i=a?Object(d.Jb)(e,a):void 0,s=Object(l.s)(n.lastMessage),o=s&&r?Object(d.l)(e,n.id,r):void 0,{targetUserIds:u,targetChatId:m}=s||{},b=Object(l.W)(n),{byId:h}=e.users,{chatId:f,threadId:O,type:g}=Object(d.z)(e)||{},v=t===f&&O===p.MAIN_THREAD_ID;return{chat:n,isMuted:Object(l.Hb)(n,Object(d.fb)(e),Object(d.eb)(e)),lastMessageSender:i,actionTargetUserIds:u,actionTargetChatId:m,actionTargetMessage:o,draft:Object(d.C)(e,t,p.MAIN_THREAD_ID),animationLevel:e.settings.byKey.animationLevel,isSelected:v,canScrollDown:v&&"thread"===g,lastSyncTime:e.lastSyncTime,...c&&{lastMessageOutgoingStatus:Object(d.gb)(e,n.lastMessage)},...b&&{privateChatUser:Object(d.Jb)(e,b)},...u&&{usersById:h}}},(e,t)=>Object(o.l)(t,["openChat","focusLastMessage"]))(({style:e,chatId:t,folderId:n,orderDiff:r,animationType:s,isPinned:o,chat:d,isMuted:u,privateChatUser:b,actionTargetUserIds:h,usersById:p,lastMessageSender:L,lastMessageOutgoingStatus:A,actionTargetMessage:D,actionTargetChatId:R,draft:F,animationLevel:_,isSelected:P,canScrollDown:U,lastSyncTime:B,openChat:q,focusLastMessage:H})=>{const $=Object(a.q)(null),[K,z,V]=Object(C.a)(),[Y,W,G]=Object(C.a)(),{lastMessage:X,typingStatus:J}=d||{},Q=X&&Object(l.gb)(X);Object(E.a)(t,Q?X.replyToMessageId:void 0,D);const Z=X&&!Object(l.N)(X)?Object(l.F)(X):void 0,ee=Object(N.a)(X?Object(l.E)(X,"micro"):void 0),te=Boolean(X&&Object(l.J)(X)),ne=Object(a.p)(()=>h?h.map(e=>p&&p[e]).filter(Boolean):void 0,[h,p]);Object(a.o)(()=>{const e=$.current;if(0!==_&&e){if(s===m.Opacity)e.style.opacity="0",Object(v.b)(()=>{e.classList.add("animate-opacity"),e.style.opacity="1"});else{if(s!==m.Move)return;e.style.transform=`translate3d(0, ${100*-r}%, 0)`,Object(v.b)(()=>{e.classList.add("animate-transform"),e.style.transform=""})}setTimeout(()=>{Object(v.b)(()=>{e.classList.remove("animate-opacity","animate-transform"),e.style.opacity="",e.style.transform=""})},200+c.c)}},[_,r,s]);const ae=Object(a.m)(()=>{q({id:t,shouldReplaceHistory:!0}),P&&U&&H()},[P,U,q,t,H]);const re=Object(y.a)({chat:d,privateChatUser:b,handleDelete:function(){W(),z()},folderId:n,isPinned:o,isMuted:u}),ce=Object(f.a)();if(!d)return;const ie=Object(j.a)("Chat chat-item-clickable",Object(l.ob)(t)?"private":"group",P&&"selected");return a.a.createElement(S.a,{ref:$,className:ie,style:e,ripple:!i.l,contextActions:re,onClick:ae},a.a.createElement("div",{className:"status"},a.a.createElement(T.a,{chat:d,user:b,withOnlineStatus:!0,isSavedMessages:b&&b.isSelf,lastSyncTime:B})),a.a.createElement("div",{className:"info"},a.a.createElement("div",{className:"title"},a.a.createElement("h3",null,Object(g.a)(Object(l.k)(ce,d,b))),d.isVerified&&a.a.createElement(w.a,null),u&&a.a.createElement("i",{className:"icon-muted-chat"}),d.lastMessage&&a.a.createElement(M.a,{message:d.lastMessage,outgoingStatus:A})),a.a.createElement("div",{className:"subtitle"},function(){if(J&&X&&J.timestamp>1e3*X.date)return a.a.createElement(I.a,{typingStatus:J});if(F&&F.text.length)return a.a.createElement("p",{className:"last-message",dir:ce.isRtl?"auto":"ltr"},a.a.createElement("span",{className:"draft"},ce("Draft")),Object(g.a)(F.text));if(!X)return;if(Q){const e=d&&(Object(l.mb)(d)||X.senderId===X.chatId)?d:L;return a.a.createElement("p",{className:"last-message",dir:ce.isRtl?"auto":"ltr"},Object(g.a)(Object(O.a)(ce,X,e,ne,D,R,{asPlain:!0})))}const e=Object(l.K)(ce,t,L);return a.a.createElement("p",{className:"last-message",dir:ce.isRtl?"auto":"ltr"},e&&a.a.createElement(a.a.Fragment,null,a.a.createElement("span",{className:"sender-name"},Object(g.a)(e)),a.a.createElement("span",{className:"colon"},":")),function(e,t,n,r){if(!n)return Object(g.a)(Object(l.O)(e,t));return a.a.createElement("span",{className:"media-preview"},a.a.createElement("img",{src:n,alt:"",className:r?"round":void 0}),Object(l.Q)(t)&&a.a.createElement("i",{className:"icon-play"}),Object(g.a)(Object(l.O)(e,t,!0)))}(ce,X,ee||Z,te))}(),a.a.createElement(x,{chat:d,isPinned:o,isMuted:u}))),Y&&a.a.createElement(k.a,{isOpen:K,onClose:V,onCloseAnimationEnd:G,chat:d}))})),R=n(13),F=n(21),_=n(129);n(220);var P,U=Object(a.h)(Object(r.h)((e,{folderId:t,folderType:n})=>({chatFolder:t&&"folder"===n?Object(d.j)(e,t):void 0,animatedEmoji:Object(d.c)(e,"📂")}))(({chatFolder:e,animatedEmoji:t,foldersDispatch:n,onScreenSelect:r})=>{const c=Object(f.a)(),s=Object(a.m)(()=>{n({type:"editFolder",payload:e}),r(R.n.FoldersEditFolderFromChatList)},[e,n,r]);return a.a.createElement("div",{className:"EmptyFolder"},a.a.createElement("div",{className:"sticker"},t&&a.a.createElement(_.a,{sticker:t})),a.a.createElement("h3",{className:"title",dir:"auto"},c("FilterNoChatsToDisplay")),a.a.createElement("p",{className:"description",dir:"auto"},c(e?"ChatList.EmptyChatListFilterText":"Chat.EmptyChat")),e&&n&&r&&a.a.createElement(F.a,{ripple:!i.l,fluid:!0,pill:!0,onClick:s,size:"smaller",isRtl:c.isRtl},a.a.createElement("i",{className:"icon-settings"}),c("ChatList.EmptyChatListEditFilter")))}));!function(e){e.all="active",e.archived="archived"}(P||(P={}));t.a=Object(a.h)(Object(r.h)((e,{folderType:t,folderId:n})=>{const{chats:{listIds:a,byId:r,orderedPinnedIds:c},users:{byId:i},lastSyncTime:s}=e,o="folder"!==t?P[t]:void 0,l=n?Object(d.j)(e,n):void 0;return{chatsById:r,usersById:i,lastSyncTime:s,notifySettings:Object(d.fb)(e),notifyExceptions:Object(d.eb)(e),...o?{listIds:a[o],orderedPinnedIds:c[o]}:{chatFolder:l}}},(e,t)=>Object(o.l)(t,["loadMoreChats","preloadTopChatMessages","openChat","openNextChat"]))(({folderType:e,folderId:t,isActive:n,chatFolder:r,chatsById:d,usersById:f,listIds:p,orderedPinnedIds:O,lastSyncTime:g,foldersDispatch:v,notifySettings:j,notifyExceptions:E,onScreenSelect:y,loadMoreChats:C,preloadTopChatMessages:N,openChat:T,openNextChat:w})=>{const[I,M]=Object(a.p)(()=>"folder"===e&&r?Object(l.Gb)(d,f,r,j,E):[p,O],[e,r,d,f,j,E,p,O]),[k,S]=Object(a.p)(()=>{if(!I||"folder"===e&&!r)return[];const t=Object(l.Fb)(d,I,M,e),n=[...t.pinnedChats,...t.otherChats],a=n.map(({id:e})=>e);return[n.reduce((e,t,n)=>(e[t.id]=n,e),{}),a]},[I,M,e,r,d]),L=Object(s.a)(k),A=Object(a.p)(()=>k&&L?Object(o.i)(k,(e,t)=>e-(void 0!==L[t]?L[t]:1/0)):{},[k,L]),x=Object(a.m)(()=>{C({listType:"archived"===e?"archived":"active"})},[C,e]),[R,F]=Object(u.a)(g?x:void 0,S,void 0,c.m,"all"===e&&!c.a),_=R&&Object(l.Fb)(d,R,M,e);Object(a.n)(()=>{g&&"all"===e&&N()},[g,e,N]);const P=function(e){const t=Object(a.m)(t=>e[t]<0,[e]),n=Object(a.m)(t=>e[t]>0,[e]),r=Object.keys(e).map(Number),c=r.filter(t).length,i=r.filter(n).length;return Object(a.m)(a=>{const r=e[a];return 0===r?m.None:r===1/0||r===-1/0||t(a)&&c<=i||n(a)&&i{const e=e=>{if(n&&S){if(i.i&&(i.f&&e.metaKey||!i.f&&e.ctrlKey)&&e.code.startsWith("Digit")){const[,t]=e.code.match(/Digit(\d)/)||[];if(!t)return;const n=Number(t)-1;if(n>S.length-1)return;T({id:S[n],shouldReplaceHistory:!0})}if(e.altKey){const t="ArrowDown"===e.key?1:"ArrowUp"===e.key?-1:void 0;if(!t)return;e.preventDefault(),w({targetIndexDelta:t,orderedIds:S})}}};return document.addEventListener("keydown",e,!1),()=>{document.removeEventListener("keydown",e,!1)}}),a.a.createElement(b.a,{className:"chat-list custom-scroll",items:R,onLoadMore:F,preloadBackwards:c.m,noFastList:!0,noScrollRestore:!0},R&&R.length&&_?function(){const e=S.indexOf(R[0]),n=e+_.pinnedChats.length;return a.a.createElement("div",{className:"scroll-container",style:i.b?`height: ${S.length*c.k}px`:void 0,teactFastList:!0},_.pinnedChats.map(({id:n},r)=>a.a.createElement(D,{key:n,teactOrderKey:r,chatId:n,isPinned:!0,folderId:t,animationType:P(n),orderDiff:A[n],style:`top: ${(e+r)*c.k}px;`})),_.otherChats.map((e,r)=>a.a.createElement(D,{key:e.id,teactOrderKey:Object(l.i)(e),chatId:e.id,folderId:t,animationType:P(e.id),orderDiff:A[e.id],style:`top: ${(n+r)*c.k}px;`})))}():R&&!R.length?a.a.createElement(U,{folderId:t,folderType:e,foldersDispatch:v,onScreenSelect:y}):a.a.createElement(h.a,{key:"loading"}))}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return g}));var a=n(0),r=n(8),c=n(2),i=n(4),s=n(53);function o(e,t){const n=t.username.toLowerCase(),a=Object(i.bb)(t),r=a&&a.toLowerCase(),c=e.toLowerCase();return n.startsWith(c)||r&&Object(s.a)(r,c)}var l=n(135),d=n(25),u=n(3),m=n(10);const b=Object(m.h)(e=>e(),500,!0),h=/(
|)/g,f=/ /g,p=/(
|<\/div>)/gi,O=new RegExp("(^|\\s)@[\\w\\d_-]*$","gi");function g(e,t,n,s=c.z,m,g,v,j){const[E,y,C]=Object(d.a)(),[N,T]=Object(a.r)(""),[w,I]=Object(a.r)(),M=Object(a.p)(()=>(g||[]).map(e=>j&&j[e]).filter(Boolean),[g,j]),k=Object(a.m)((e,t)=>{(m||g)&&j?b(()=>{const n=(t?M:[]).filter(t=>!e||o(e,t)),a=(m||[]).map(({userId:e})=>j[e]).filter(t=>!(!t||t.id===v)&&(!e||o(e,t)));I(Object(u.o)(n.concat(a)))}):I(void 0)},[v,m,g,M,j]);Object(a.n)(()=>{if(!e||!t.length)return void C();const n=t.includes("@")&&function(e){const t=e.replace(f," ").replace(h,"\n").replace(p,"").replace(/\n$/i,"").match(O);return t?t[0].trim():void 0}(t);if(n){const e=n?n.substr(1):"";T(e),k(e,function(e){return e.startsWith("@")}(t))}else C()},[e,t,k,y,C]),Object(a.n)(()=>{w&&w.length?y():C()},[y,C,w]);const S=Object(a.m)((e,a=!1)=>{if(!e.username&&!Object(i.ab)(e))return;const c=e.username?"@"+e.username:`${Object(i.ab)(e)}`,o=t.lastIndexOf("@");if(-1!==o){n(`${t.substr(0,o)}${c} `);const e=document.getElementById(s);requestAnimationFrame(()=>{Object(l.a)(e,a)})}C()},[t,s,n,C]);return{isMentionTooltipOpen:E,mentionFilter:N,closeMentionTooltip:C,insertMention:S,mentionFilteredUsers:w}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var a=n(0),r=n(169),c=n(52),i=n(17),s=n(31);const o=new Map;function l(e){const t=Object(a.q)();let n=!1;Object(c.a)(()=>{if(n=!0,t.current=void 0,!e)return;const a=new Image;if(a.src=e,!a.width)return;const c=Object(i.f)(a);Object(r.a)(c.getContext("2d"),0,0,c.width,c.height,2,2),t.current=c.toDataURL()},[e]);const l=function(e,t=!1,n){const c=Object(a.q)(e?o.get(e):void 0),l=Object(a.q)(),d=Object(s.a)();return l.current&&t&&(clearTimeout(l.current),l.current=void 0),Object(a.n)(()=>{if(!e||c.current||t)return;const a=new Image;a.onload=()=>{const t=Object(i.f)(a);Object(r.a)(t.getContext("2d"),0,0,t.width,t.height,2,2);const n=t.toDataURL();c.current=n,d(),o.size>=1e3&&o.clear(),o.set(e,n)},n?l.current=window.setTimeout(()=>{a.src=e},n):a.src=e},[e,n,d,t]),c.current}(e||void 0,Boolean(t.current));return t.current||!n&&l||e||void 0}},,function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},,,,function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},,,,function(e,t,n){},function(e,t,n){},,,,function(e,t,n){},function(e,t,n){},function(e,t,n){},,,,function(e,t,n){},function(e,t,n){},,,,,,,,,,function(e,t,n){},,,,,function(e,t,n){},,,,,,,,function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){}])]); -//# sourceMappingURL=0.e84aae32c1142e0538ad.js.map \ No newline at end of file diff --git a/dist/0.e84aae32c1142e0538ad.js.map b/dist/0.e84aae32c1142e0538ad.js.map deleted file mode 100644 index 03bcd8f9..00000000 --- a/dist/0.e84aae32c1142e0538ad.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["webpack:///./src/components/ui/ListItem.tsx","webpack:///./src/hooks/useIntersectionObserver.ts","webpack:///./src/hooks/useMedia.ts","webpack:///./src/components/common/PrivateChatInfo.tsx","webpack:///./src/components/ui/Modal.tsx","webpack:///./src/util/trapFocus.ts","webpack:///./src/components/ui/Transition.tsx","webpack:///./src/components/common/Avatar.tsx","webpack:///./src/components/ui/InfiniteScroll.tsx","webpack:///./src/components/ui/FloatingActionButton.tsx","webpack:///./src/hooks/useTransitionForMedia.ts","webpack:///./src/components/common/helpers/mediaDimensions.ts","webpack:///./src/components/common/AnimatedSticker.tsx","webpack:///./src/components/ui/ConfirmDialog.tsx","webpack:///./src/components/common/NothingFound.tsx","webpack:///./src/components/right/hooks/useAsyncRendering.ts","webpack:///./src/hooks/useMediaWithDownloadProgress.ts","webpack:///./src/components/ui/ProgressSpinner.tsx","webpack:///./src/components/common/StickerButton.tsx","webpack:///./src/components/ui/Radio.tsx","webpack:///./src/components/ui/RadioGroup.tsx","webpack:///./src/hooks/useBackgroundMode.ts","webpack:///./src/components/ui/Portal.ts","webpack:///./src/components/common/AnimatedEmoji.tsx","webpack:///./src/components/common/GroupChatInfo.tsx","webpack:///./src/util/fastSmoothScroll.ts","webpack:///./src/hooks/useInfiniteScroll.ts","webpack:///./src/util/cycleRestrict.ts","webpack:///./src/util/focusEditableElement.ts","webpack:///./src/util/captureEvents.ts","webpack:///./src/components/common/VerifiedIcon.tsx","webpack:///./src/hooks/useCurrentOrPrev.ts","webpack:///./src/util/safePlay.ts","webpack:///./src/hooks/useBuffering.ts","webpack:///./src/components/middle/composer/helpers/parseMessageInput.ts","webpack:///./src/components/middle/composer/DropTarget.tsx","webpack:///./src/components/middle/composer/DropArea.tsx","webpack:///./src/hooks/reducers/useFoldersReducer.ts","webpack:///./src/components/common/PickerSelectedItem.tsx","webpack:///./src/util/fastSmoothScrollHorizontal.ts","webpack:///./src/hooks/useHorizontalScroll.ts","webpack:///./src/hooks/useEnsureMessage.ts","webpack:///./src/hooks/useContextMenuHandlers.ts","webpack:///./src/components/common/helpers/renderMessageText.tsx","webpack:///./src/hooks/useVideoCleanup.ts","webpack:///./src/hooks/useReducer.ts","webpack:///./src/components/ui/SearchInput.tsx","webpack:///./src/util/resetScroll.ts","webpack:///./src/components/common/TypingStatus.tsx","webpack:///./src/components/common/DeleteChatModal.tsx","webpack:///./src/components/ui/ShowTransition.tsx","webpack:///./src/util/patchSafariProgressiveAudio.ts","webpack:///./src/hooks/useLayoutEffectWithPrevDeps.ts","webpack:///./src/components/common/Document.tsx","webpack:///./src/components/common/StickerSetModal.async.tsx","webpack:///./src/hooks/useCanvasBlur.ts","webpack:///./src/lib/fastBlur.js","webpack:///./src/components/middle/composer/TextFormatter.tsx","webpack:///./src/util/clipboard.ts","webpack:///./src/components/common/Media.tsx","webpack:///./src/components/common/Picker.tsx","webpack:///./src/components/common/Audio.tsx","webpack:///./src/util/waveform.ts","webpack:///./src/components/common/helpers/waveform.ts","webpack:///./src/components/ui/Tab.tsx","webpack:///./src/components/ui/TabList.tsx","webpack:///./src/util/getReadableErrorText.ts","webpack:///./src/util/cssAnimationEndListeners.ts","webpack:///./src/hooks/useChatContextActions.ts","webpack:///./src/components/common/LastMessageMeta.tsx","webpack:///./src/components/common/MessageOutgoingStatus.tsx","webpack:///./src/hooks/useContextMenuPosition.ts","webpack:///./src/hooks/usePrevDuringAnimation.ts","webpack:///./src/hooks/useAudioPlayer.ts","webpack:///./src/util/audioPlayer.ts","webpack:///./src/util/download.ts","webpack:///./src/components/common/File.tsx","webpack:///./src/hooks/useMediaDownload.ts","webpack:///./src/components/ui/Notification.tsx","webpack:///./src/components/middle/composer/helpers/selection.ts","webpack:///./src/components/middle/composer/hooks/useEmojiTooltip.ts","webpack:///./src/components/middle/composer/EmojiTooltip.async.tsx","webpack:///./src/components/middle/composer/MessageInput.tsx","webpack:///./src/components/common/WebLink.tsx","webpack:///./src/components/left/main/hooks/useChatAnimationType.ts","webpack:///./src/components/left/main/Badge.tsx","webpack:///./src/components/left/main/Chat.tsx","webpack:///./src/components/left/main/EmptyFolder.tsx","webpack:///./src/components/left/main/ChatList.tsx","webpack:///./src/components/middle/composer/helpers/searchUserName.ts","webpack:///./src/components/middle/composer/hooks/useMentionTooltip.ts","webpack:///./src/hooks/useBlur.ts","webpack:///./src/hooks/useBlurSync.ts"],"names":["ListItem","props","ref","buttonRef","icon","className","style","children","disabled","ripple","narrow","inactive","focus","destructive","multiline","isStatic","contextActions","onClick","containerRef","useRef","isTouched","markIsTouched","unmarkIsTouched","useFlag","isContextMenuOpen","contextMenuPosition","handleBeforeContextMenu","handleContextMenu","handleContextMenuClose","handleContextMenuHide","useContextMenuHandlers","getTriggerElement","useCallback","current","getRootElement","closest","getMenuElement","querySelector","positionX","positionY","menuStyle","useContextMenuPosition","handleClick","e","IS_TOUCH_ENV","fastRaf","handleMouseDown","button","lang","useLang","fullClassName","buildClassName","dir","isRtl","undefined","role","tabIndex","onMouseDown","onContextMenu","isOpen","autoClose","onClose","onCloseAnimationEnd","map","action","key","title","handler","useIntersectionObserver","rootRef","throttleMs","debounceMs","shouldSkipFirst","margin","threshold","isDisabled","rootCallback","controllerRef","rootCallbackRef","freezeFlagsRef","onUnfreezeRef","freeze","unfreeze","useHeavyAnimationCheck","useEffect","observer","disconnect","callbacks","clear","observe","target","targetCallback","Map","entriesAccumulator","observerCallbackSync","entries","Array","from","values","forEach","entry","callback","get","scheduler","throttle","debounce","observerCallback","IntersectionObserver","set","root","rootMargin","initController","controller","delete","unobserve","useOnIntersect","targetRef","useIsIntersecting","isIntersecting","setIsIntersecting","useState","mediaHash","noLoad","mediaFormat","ApiMediaFormat","BlobUrl","cacheBuster","delay","mediaData","mediaLoader","forceUpdate","useForceUpdate","startedAt","Date","now","then","spentTime","setTimeout","memo","withGlobal","global","userId","forceShowSelf","lastSyncTime","serverTimeOffset","user","selectUser","isSavedMessages","isSelf","areMessagesLoaded","Boolean","selectChatMessages","setGlobal","actions","pick","typingStatus","avatarSize","status","withMediaViewer","withUsername","withFullInfo","withUpdatingStatus","noStatusOrTyping","noRtl","loadFullUser","openMediaViewer","id","fullName","getUserFullName","handleAvatarViewerOpen","hasPhoto","stopPropagation","avatarOwnerId","origin","MediaViewerOrigin","ProfileAvatar","MiddleHeaderAvatar","size","renderText","isVerified","isUserOnline","username","getUserStatus","Modal","header","hasCloseButton","noBackdrop","onEnter","shouldSkipHistoryAnimations","shouldRender","transitionClassNames","useShowTransition","modalRef","captureKeyboardListeners","onEsc","element","handleKeyDown","preventDefault","focusableElements","querySelectorAll","length","currentFocusedIndex","findIndex","em","isSameNode","document","activeElement","newFocusedIndex","shiftKey","addEventListener","removeEventListener","trapFocus","forceClose","useHistoryBack","useEffectWithPrevDeps","prevIsOpen","body","classList","toggle","dispatchHeavyAnimationEvent","remove","Portal","Button","round","color","ariaLabel","CLEANED_UP","Symbol","Transition","activeKey","name","direction","renderCount","shouldRestoreHeight","shouldCleanup","cleanupExceptionKey","onStart","onStop","animationLevel","getGlobal","settings","byKey","rendersRef","prevActiveKey","usePrevious","activeKeyChanged","useLayoutEffect","cleanup","container","childElements","add","childNodes","isBackwards","keys","Object","Number","prevActiveIndex","indexOf","activeIndex","node","i","HTMLElement","dispatchHeavyAnimationStop","requestAnimationFrame","onAnimationEnd","height","clientHeight","toNode","firstChild","waitForAnimationEnd","flexBasis","renders","contents","fill","render","chat","text","withOnlineStatus","isDeleted","isDeletedUser","imageHash","getChatAvatarHash","dataUri","useMedia","DataUri","shouldRenderFullMedia","useTransitionForMedia","content","src","alt","decoding","userFullName","getFirstLetters","getChatTitle","isChatPrivate","isOnline","getUserColorKey","senderId","data-test-sender-id","IS_TEST","InfiniteScroll","onLoadMore","onScroll","onKeyDown","items","itemSelector","preloadBackwards","sensitiveArea","noScrollRestore","noScrollRestoreOnTop","noFastList","stateRef","loadMoreBackwards","loadMoreForwards","useMemo","noScroll","LoadMoreDirection","Backwards","Forwards","scrollHeight","state","newScrollTop","listItemElements","currentAnchor","includes","scrollTop","getBoundingClientRect","top","currentAnchorTop","nextAnchor","resetScroll","isScrollTopJustUpdated","handleScroll","listLength","offsetHeight","isNearTop","offsetTop","isNearBottom","isUpdated","nextAnchorTop","newAnchorTop","offsetParent","teactFastList","FloatingActionButton","isShown","buttonClassName","SPEED","fast","slow","speed","noAnimate","isMediaLoaded","willAnimate","shouldRenderThumb","setShouldRenderThumb","MEDIA_VIEWER_MEDIA_QUERY","REM","parseInt","getComputedStyle","documentElement","fontSize","ROUND_VIDEO_DIMENSIONS","AVATAR_FULL_DIMENSIONS","width","LIKE_STICKER_ID","DEFAULT_MEDIA_DIMENSIONS","cachedMaxWidthOwn","cachedMaxWidth","cachedMaxWidthNoAvatar","getAvailableWidth","fromOwnMessage","isForwarded","isWebPagePhoto","noAvatars","extraPaddingRem","regularMaxWidth","IS_SINGLE_COLUMN_LAYOUT","windowWidth","windowSize","Math","min","getMaxMessageWidthRem","calculateDimensionsForMessageMedia","isGif","aspectRatio","calculateDimensions","getAvailableHeight","getMediaViewerAvailableDimensions","withFooter","isVideo","mql","window","matchMedia","windowHeight","occupiedHeightRem","matches","calculateInlineImageDimensions","photo","getPhotoInlineDimensions","calculateVideoDimensions","video","getVideoDimensions","getPictogramDimensions","getDocumentThumbnailDimensions","smaller","getStickerDimensions","sticker","baseWidth","STICKER_SIZE_INLINE_MOBILE_FACTOR","STICKER_SIZE_INLINE_DESKTOP_FACTOR","calculatedHeight","calculateMediaViewerDimensions","availableWidth","availableHeight","mediaWidth","mediaHeight","calculatedWidth","lottiePromise","RLottie","async","ensureLottie","default","animationData","play","playSegment","noLoop","quality","isLowPriority","onLoad","animation","setAnimation","wasPlaying","isFrozen","playRef","playSegmentRef","exec","newAnimation","setSpeed","destroy","playAnimation","shouldRestart","goToAndPlay","pauseAnimation","pause","freezeAnimation","isPlaying","unfreezeAnimation","unfreezeAnimationOnRaf","useBackgroundMode","textParts","confirmLabel","confirmHandler","confirmIsDestructive","isButtonsInOneRow","split","textPart","isText","description","useAsyncRendering","dependencies","shouldRenderRef","timeoutRef","useOnChange","clearTimeout","isStreaming","Stream","IS_PROGRESSIVE_SUPPORTED","Progressive","downloadProgress","setDownloadProgress","startedAtRef","handleProgress","progress","RADIUSES","s","m","l","xl","square","transparent","noCross","radius","circleRadius","STROKE_WIDTH","borderRadius","circumference","PI","svg","firstElementChild","strokeDashOffset","max","setAttribute","toString","innerHTML","observeIntersection","clickArg","onUnfaveClick","localMediaHash","stickerSelector","thumbDataUri","thumbnail","previewBlobUrl","shouldPlay","lottieData","isAnimated","Lottie","isAnimationLoaded","markLoaded","unmarkLoaded","canAnimatedPlay","shouldRenderPreview","previewTransitionClassNames","emoji","data-sticker-id","label","subLabel","value","checked","hidden","isLoading","onChange","type","Spinner","options","selected","loadingOption","handleChange","event","currentTarget","option","onBlur","onFocus","hasFocus","containerId","elementRef","createElement","appendChild","TeactDOM","removeChild","WIDTH","large","medium","small","AnimatedEmoji","forceLoadPreview","markAnimationLoaded","playKey","setPlayKey","String","random","chatId","selectChat","onlineCount","selectChatOnlineCount","withChatType","loadFullChat","isSuperGroup","isChatSuperGroup","isMin","isRestricted","getChatTypeString","handle","groupStatus","chatTypeString","membersCount","getGroupStatus","onlineStatus","renderStatusOrTyping","isAnimating","fastSmoothScroll","position","maxDistance","FAST_SMOOTH_MAX_DISTANCE","forceDirection","forceDuration","forceCurrentContainerHeight","scrollFrom","elementTop","offset","FocusDirection","Up","Down","calculateScrollFrom","Static","ANIMATION_LEVEL_MIN","scrollWithJs","isAnimatingScroll","elementHeight","currentScrollTop","containerHeight","targetContainerHeight","dataset","normalHeight","path","remainingPath","absPath","abs","transition","FAST_SMOOTH_SHORT_TRANSITION_MAX_DISTANCE","shortTransition","longTransition","duration","FAST_SMOOTH_MIN_DURATION","FAST_SMOOTH_MAX_DURATION","startAt","onHeavyAnimationStop","animateSingle","t","currentPath","getViewportSlice","sourceIds","offsetId","listSlice","index","indexForDirection","to","newViewportIds","slice","areSomeLocal","areAllLocal","listIds","forceFullPreload","lastParamsRef","viewportIdsRef","prevListIds","prevIsDisabled","areSortedArraysEqual","viewportIds","getMore","cycleRestrict","floor","focusEditableElement","force","selection","getSelection","range","createRange","lastChild","nodeValue","selectNodeContents","collapse","removeAllRanges","addRange","SwipeDirection","captureEvents","captureEvent","currentSwipeAxis","hasMoved","onCapture","excludedClosestSelector","onMove","onRelease","pageX","touches","pageY","withCursor","dragOffsetX","dragOffsetY","onDrag","onSwipe","xAbs","yAbs","Left","Right","processSwipe","passive","VerifiedIcon","useCurrentOrPrev","shouldSkipUndefined","shouldForceCurrent","prev","mediaEl","catch","err","DEBUG","console","warn","noInitiallyBuffered","isBuffered","setIsBuffered","bufferedProgress","setBufferedProgress","setIsBufferedDebounced","handleBuffering","media","isSafariPatchInProgress","buffered","end","readyState","currentTime","bufferingHandlers","onLoadedData","onPlaying","onLoadStart","onPause","onTimeUpdate","onProgress","checkBuffering","ENTITY_CLASS_BY_NODE_NAME","B","ApiMessageEntityTypes","Bold","STRONG","I","Italic","EM","U","Underline","S","Strike","STRIKE","DEL","CODE","Code","PRE","Pre","BLOCKQUOTE","Blockquote","parseMessageInput","html","fragment","parsedHtml","IS_EMOJI_SUPPORTED","replace","parseMarkdown","innerText","trim","textIndex","recursionDeepness","entities","addEntity","entity","rawText","nodeName","anchor","entityType","MentionName","Url","href","startsWith","Email","Phone","textContent","TextUrl","getEntityTypeFromNode","rawIndex","substring","url","getEntityDataFromNode","push","hasChildNodes","isQuick","onFileSelect","isHovered","markHovered","unmarkHovered","onDrop","onDragEnter","onDragLeave","relatedTarget","toTarget","DropAreaState","withQuick","onHide","hideTimeoutRef","prevWithQuick","captureEscKeyListener","handleFilesDrop","dataTransfer","dt","files","handleQuickFilesDrop","handleDragLeave","fromTarget","onDragOver","INCLUDED_CHAT_TYPES","EXCLUDED_CHAT_TYPES","INCLUDE_FILTER_FIELDS","EXCLUDE_FILTER_FIELDS","selectChatFilters","mode","selectTemp","selectedChatIds","selectedChatTypes","includedChatIds","includeFilters","folder","filter","excludedChatIds","excludeFilters","getSuggestedFolderName","filters","bots","groups","channels","contacts","nonContacts","INITIAL_STATE","chatFilter","foldersReducer","payload","omit","folderId","error","useReducer","chatOrUserId","isMinimized","canClose","iconElement","titleText","getUserFirstOrLastName","fastSmoothScrollHorizontal","left","IS_IOS","scrollLeft","offsetWidth","containerWidth","scrollWidth","animate","scrollTo","behavior","deltaX","deltaY","messageId","message","replyOriginForId","loadMessage","getDispatch","loadMessageThrottled","throttled","contextMenuCounter","isMenuDisabled","shouldDisableOnLink","shouldDisableOnLongTap","setIsContextMenuOpen","setContextMenuPosition","x","clientX","y","clientY","timer","clearLongPressTimer","startLongPressTimer","contains","originalEvent","cancelClickOnce","stopImmediatePropagation","emulateContextMenuEvent","renderMessageText","highlight","shouldRenderHqEmoji","formattedText","getMessageText","renderTextWithEntities","organizeEntities","organizedEntityIndexes","Set","organizedEntities","has","organizedEntity","organizeEntity","organizedIndexes","nestedEntities","parsedEntity","isChanged","organizedIndex","shouldRenderAsHtml","renderMessagePart","result","deleteLineBreakAfterPre","renderEntity","textPartStart","textPartEnd","isLastEntity","renderResult","textBefore","textBeforeLength","substr","entityStartIndex","entityEndIndex","entityContent","nestedEntityContent","nestedIndex","nestedEntity","nestedEntityIndex","nestedResult","nestedEntityEndIndex","newEntity","rawEntityText","renderedContent","join","getLinkUrl","processEntityAsHtml","entityText","BotCommand","handleBotCommandClick","Hashtag","Cashtag","handleHashtagClick","rel","Mention","processEntity","isArray","textAfter","arrayIndex","c","emojiFilter","sendBotCommand","command","setLocalTextSearchQuery","query","searchTextMessagesLocal","useVideoCleanup","videoRef","videoEl","load","reducer","initialState","reducerRef","setState","currentState","parentContainerClassName","inputId","focused","placeholder","autoComplete","onReset","inputRef","isInputFocused","markInputFocused","unmarkInputFocused","blur","overflow","typingUser","typingUserName","isPrivateChat","isChatWithSelf","selectIsChatWithSelf","getPrivateChatUserId","isBot","isUserBot","isSupport","canDeleteForAll","contactName","isChannel","isChatChannel","isBasicGroup","isChatBasicGroup","currentUserId","leaveChannel","deleteHistory","deleteChannel","deleteChatUser","blockContact","chatTitle","handleDeleteMessageForAll","shouldDeleteForAll","handleDeleteAndStop","contactId","accessHash","handleDeleteChat","isCreator","ShowTransition","isCustom","prevChildren","fromChildrenRef","patchSafariProgressiveAudio","audioEl","patchedForSafari","patchForSafariInProgress","paused","once","cb","debugKey","prevDeps","uploadProgress","withDate","datetime","sender","isSelected","isSelectable","onCancelUpload","onMediaClick","onDateClick","extension","getDocumentExtension","fileName","timestamp","mediaType","isDownloadAllowed","setIsDownloadAllowed","useMediaWithDownloadProgress","getMessageMediaHash","isUploading","isTransferring","transferProgress","getMediaTransferState","hasPreview","getDocumentHasPreview","getMessageMediaThumbDataUri","localBlobUrl","previewData","isAllowed","handleDateClick","download","thumbnailDataUri","actionIcon","isMessageDocumentVideo","StickerSetModal","useModuleLoader","Bundles","Extra","useCanvasBlur","withRaf","canvasRef","canvas","img","Image","processBlur","ctx","getContext","alpha","IS_CANVAS_FILTER_SUPPORTED","drawImage","RADIUS","fastBlur","onload","mul_table","shg_table","boxBlurCanvasRGB","context","top_x","top_y","iterations","isNaN","imageData","getImageData","pixels","data","rsum","gsum","bsum","p","p1","p2","yp","yi","yw","wm","hm","rad1","r","g","b","mul_sum","shg_sum","vmin","vmax","putImageData","TEXT_FORMAT_BY_TAG_NAME","fragmentEl","anchorPosition","selectedRange","linkUrlInputRef","isLinkControlOpen","openLinkControl","closeLinkControl","linkUrl","setLinkUrl","isEditingLink","setIsEditingLink","inputClassName","setInputClassName","selectedTextFormats","setSelectedTextFormats","useVirtualBackdrop","selectedFormats","parentElement","commonAncestorContainer","EDITABLE_INPUT_ID","textFormat","tagName","getSelectedText","getSelectedElement","updateInputStyles","input","getFormatButtonClassName","some","fKey","monospace","strikethrough","handleBoldText","execCommand","bold","handleItalicText","italic","handleUnderlineText","underline","handleStrikethroughText","replaceWith","handleMonospaceText","handleLinkUrlConfirm","formattedLinkUrl","encodeURI","restoreSelection","KeyK","KeyB","KeyU","KeyI","KeyM","KeyS","code","altKey","ctrlKey","metaKey","linkUrlConfirmClassName","inputMode","CLIPBOARD_ITEM_SUPPORTED","navigator","clipboard","ClipboardItem","textCopyEl","copyTextToClipboard","str","rangeToRestore","rangeCount","getRangeAt","select","copyImageToClipboard","imageUrl","imageEl","toBlob","copyBlobToClipboard","pngBlob","write","idPrefix","mediaBlobUrl","getMessageVideo","formatMediaDuration","itemIds","selectedIds","filterValue","filterPlaceholder","notFoundText","searchInputId","onSelectedIdsChange","onFilterChange","shouldMinimize","handleItemClick","newSelectedIds","splice","handleFilterChange","useInfiniteScroll","MIN_SPIKES","MAX_SPIKES","renderSeekline","playProgress","handleStartSeek","handleSeek","handleStopSeek","onMouseMove","onMouseUp","theme","senderTitle","date","onPlay","onReadMedia","audio","voice","isMediaUnread","isVoice","isSeeking","isActivated","setIsActivated","shouldDownload","getMessageMediaFormat","useBuffering","playPause","setCurrentTime","useAudioPlayer","getMessageKey","getMediaDuration","isMessageLocal","isDownloadStarted","directDownloadProgress","handleDownloadClick","useMediaDownload","getMessageAudioCaption","isLoadingForPlaying","shouldRenderSpinner","spinnerClassNames","handleButtonClick","seekBar","seekHandlers","isOwn","isOwnMessage","renderedWaveform","waveform","fillColor","fillOwnColor","progressFillColor","progressFillOwnColor","durationFactor","spikesCount","decodedWaveform","encoded5bit","bitsCount","valuesCount","bitsData","byteIndex","bitShift","lastByteIndex","lastBitShift","lastValue","decodeWaveform","Uint8Array","spikes","peak","fitCount","newData","springFactor","leftFiller","rightFiller","idx","val","interpolateArray","fillStyle","progressFillStyle","scale","item","globalAlpha","spikeHeight","beginPath","moveTo","arcTo","closePath","roundedRectangle","toDataURL","renderWaveformToDataUri","draggable","renderWaveform","buttonClassNames","showSeekline","contentClassName","ProgressSpinner","getFirstLine","Link","formatPastTimeShort","performer","getSecondLine","formatMediaDateTime","renderAudio","renderVoice","active","badgeCount","isBadgeActive","previousActiveTab","tabRef","tab","indicator","prevTab","currentIndicator","shiftLeft","offsetLeft","scaleFactor","clientWidth","transform","tabs","activeTab","big","onSwitchTab","useHorizontalScroll","activeTabElement","newLeft","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","SERVICE_WORKER_DISABLED","CAPTION_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","getReadableErrorText","isSlowMode","textParams","extraPartIndex","errorMessage","reduce","acc","waitForTransitionEnd","propertyName","waitForEndEvent","animationName","eventType","detailedName","isHandled","handleAnimationEnd","TransitionEvent","AnimationEvent","privateChatUser","handleDelete","isPinned","isMuted","toggleChatPinned","updateChatMutedState","toggleChatArchived","toggleChatUnread","actionUnreadMark","unreadCount","hasUnreadMark","actionPin","actionMute","actionArchive","isChatArchived","getCanDeleteChat","outgoingStatus","Keys","extraPaddingX","extraTopPadding","setPositionX","setPositionY","setStyle","triggerEl","emptyRect","menuEl","rootEl","triggerRect","menuRect","rootRect","horizontalPostition","usePrevDuringAnimation","isCurrentPresent","isPrevPresent","trackId","originalDuration","handlers","onInit","onForcePlay","noPlaylist","setIsPlaying","isPlayingSync","setPlayProgress","register","eventName","proxy","isFinite","prevShouldPlay","prevSrc","audioProxy","tracks","currentTrackId","queue","stopCurrentAudio","currentTrack","Audio","handleEvent","nextTrackId","openAudioPlayer","parseMessageKey","nextTrack","safePlay","Proxy","createAudio","preload","IS_SAFARI","time","shouldRemoveFromQueue","track","h","filename","link","click","shouldSpinnerRender","getColorFromExtension","sizeString","getFileSizeString","setIsDownloadStarted","onDismiss","setIsOpen","timerRef","closeAndDismiss","ANIMATION_END_DELAY","handleMouseEnter","handleMouseLeave","onMouseEnter","onMouseLeave","isSelectionInsideInput","selectionRange","parentNode","emojiDataPromise","emojiRawData","emojiData","RE_EMOJI_SEARCH","RE_BR","RE_SPACE","RE_CLEAN_HTML","RegExp","useEmojiTooltip","recentEmojiIds","onUpdateHtml","baseEmojiKeywords","emojiKeywords","markIsOpen","unmarkIsOpen","byId","setById","keywords","setKeywords","byKeyword","setByKeyword","names","setNames","byName","setByName","shouldForceInsertEmoji","setShouldForceInsertEmoji","filteredEmojis","setFilteredEmojis","MEMO_EMPTY_ARRAY","recentEmojis","pickTruthy","emojis","uncompressEmoji","ensureEmojiData","byNative","buildCollectionByKey","baseEmojisByKeyword","mapValues","natives","emojisByKeyword","emojisByName","match","getEmojiCode","forceSend","endsWith","matched","matchedKeywords","keyword","sort","concat","flatten","matchedNames","unique","insertEmoji","textEmoji","isForce","atIndex","lastIndexOf","messageInput","getElementById","native","isEmojiTooltipOpen","closeEmojiTooltip","EmojiTooltip","MAX_INPUT_HEIGHT","currentChatId","threadId","selectCurrentMessageList","messageSendKeyCombo","replyingToId","selectReplyingToId","noTabCapture","isPollModalOpen","payment","isPaymentModalOpen","isAttachmentModalInput","editableInputId","forcedPlaceholder","shouldSetFocus","shouldSuppressFocus","shouldSuppressTextFormatter","onUpdate","onSuppressedFocus","onSend","editLastMessage","replyToNextMessage","cloneRef","isContextMenuOpenRef","isTextFormatterOpen","openTextFormatter","closeTextFormatter","textFormatterAnchorPosition","setTextFormatterAnchorPosition","setSelectedRange","updateInputHeight","useLayoutEffectWithPrevDeps","prevHtml","focusInput","handleCloseTextFormatter","empty","clearSelection","checkSelection","selectedText","parseEmojiOnlyString","START_TO_END","selectionRect","inputRect","willSend","clone","currentHeight","newHeight","transitionDuration","log","captureFirstTab","onTab","suppressFocus","contentEditable","targetIndexDelta","handleKeyUp","IS_ANDROID","closeContextMenuMouseListener","closeContextMenuKeyListener","handleMouseUp","onTouchCancel","onMessageClick","linkData","getMessageWebPage","getFirstLinkInMessage","domain","messageText","getMessageSummaryText","siteName","handleMessageClick","displayUrl","truncatedDescription","trimText","data-initial","ChatAnimationTypes","renderContent","unreadMentionsCount","formatIntegerCompact","lastMessage","replyToMessageId","isOutgoing","lastMessageSender","lastMessageAction","getMessageAction","actionTargetMessage","selectChatMessage","targetUserIds","actionTargetUserIds","targetChatId","actionTargetChatId","privateChatUserId","usersById","users","currentThreadId","messageListType","MAIN_THREAD_ID","selectIsChatMuted","selectNotifySettings","selectNotifyExceptions","draft","selectDraft","canScrollDown","lastMessageOutgoingStatus","selectOutgoingStatus","orderDiff","animationType","openChat","focusLastMessage","isDeleteModalOpen","openDeleteModal","closeDeleteModal","shouldRenderDeleteModal","markRenderDeleteModal","unmarkRenderDeleteModal","isAction","isActionMessage","useEnsureMessage","mediaThumbnail","getMessageSticker","isRoundVideo","getMessageRoundVideo","actionTargetUsers","Opacity","opacity","Move","shouldReplaceHistory","useChatContextActions","Avatar","LastMessageMeta","TypingStatus","actionOrigin","renderActionMessageText","asPlain","senderName","getMessageSenderName","blobUrl","renderMessageSummary","renderLastMessageOrTyping","DeleteChatModal","FolderTypeToListType","folderType","chatFolder","selectChatFolder","animatedEmoji","selectAnimatedEmoji","foldersDispatch","onScreenSelect","handleEditFolder","SettingsScreens","FoldersEditFolderFromChatList","fluid","pill","chats","chatsById","orderedPinnedIds","listType","notifySettings","notifyExceptions","isActive","loadMoreChats","preloadTopChatMessages","openNextChat","currentListIds","currentPinnedIds","prepareFolderListIds","orderById","orderedIds","newChatArrays","prepareChatList","singleList","pinnedChats","otherChats","newOrderedIds","prevOrderById","orderDiffById","order","Infinity","loadMoreOfType","CHAT_LIST_SLICE","ALL_CHATS_PRELOAD_DISABLED","chatArrays","getAnimationType","movesUp","movesDown","orderDiffIds","numberOfUp","numberOfDown","None","useChatAnimationType","IS_PWA","IS_MAC_OS","digit","viewportOffset","pinnedOffset","CHAT_HEIGHT_PX","teactOrderKey","getChatOrder","renderChats","Loading","searchUserName","usernameLowered","toLowerCase","fullNameLowered","filterLowered","searchWords","runThrottled","RE_USERNAME_SEARCH","useMentionTooltip","canSuggestMembers","groupChatMembers","topInlineBotIds","currentFilter","setCurrentFilter","usersToMention","setUsersToMention","topInlineBots","getFilteredUsers","withInlineBots","inlineBots","inlineBot","chatMembers","usernameFilter","getUsernameFilter","canSuggestInlineBots","insertMention","forceFocus","insertedHtml","isMentionTooltipOpen","mentionFilter","closeMentionTooltip","mentionFilteredUsers","cache","useBlurSync","blurredRef","imgToCanvas","blurredAsync","blurredDataUri","useBlur"],"mappings":"wGACA,kGAmMeA,IAvJiBC,IAC9B,MAAM,IACJC,EADI,UAEJC,EAFI,KAGJC,EAHI,UAIJC,EAJI,MAKJC,EALI,SAMJC,EANI,SAOJC,EAPI,OAQJC,EARI,OASJC,EATI,SAUJC,EAVI,MAWJC,EAXI,YAYJC,EAZI,UAaJC,EAbI,SAcJC,EAdI,eAeJC,EAfI,QAgBJC,GACEhB,EAGJ,IAAIiB,EAAeC,YAAuB,MACtCjB,IACFgB,EAAehB,GAEjB,MAAOkB,EAAWC,EAAeC,GAAmBC,eAE9C,kBACJC,EADI,oBACeC,EADf,wBAEJC,EAFI,kBAEqBC,EAFrB,uBAGJC,EAHI,sBAGoBC,GACtBC,YAAuBZ,GAAeF,GAEpCe,EAAoBC,YAAY,IAAMd,EAAae,QAA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,MAAMX,EAAS6sB,YAAY5sB,GAC3BS,YAASV,EAAOK,WAAW,MAAO,EAAG,EAAGL,EAAO5oB,MAAO4oB,EAAO9uB,OAzBpD,EACI,GAyBb,MAAM67C,EAAiB/sB,EAAO8N,YAE9B8e,EAAWlqD,QAAUqqD,EACrBpkD,IAEI+jD,EAAMhhD,MA7BO,KA8BfghD,EAAMzmD,QAERymD,EAAMrlD,IAAI8K,EAAS46C,IAGjBvkD,EACF8U,EAAW5a,QAAUsW,OAAO9P,WAAW,KACrC+2B,EAAIxtB,IAAMN,GACT3J,GAEHy3B,EAAIxtB,IAAMN,GAEX,CAACA,EAAS3J,EAAOG,EAAavD,IAE1BwnD,EAAWlqD,QCdGsqD,CAAQ76C,QAAWpO,EAAWgG,QAAQ6iD,EAAWlqD,UAEtE,OAAOkqD,EAAWlqD,UAAa+zB,GAAaq2B,GAAiB36C,QAAWpO,I","file":"0.e84aae32c1142e0538ad.js","sourcesContent":["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';\n\nimport './ListItem.scss';\n\ntype OnClickHandler = (e: React.MouseEvent) => void;\n\ntype MenuItemContextAction = {\n title: string;\n icon: string;\n destructive?: boolean;\n handler?: () => void;\n};\n\ntype OwnProps = {\n ref?: RefObject;\n buttonRef?: RefObject;\n icon?: string;\n className?: string;\n style?: string;\n children: any;\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 onClick?: OnClickHandler;\n};\n\nconst ListItem: FC = (props) => {\n const {\n ref,\n buttonRef,\n icon,\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 onClick,\n } = props;\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 { positionX, positionY, style: menuStyle } = 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 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
\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 { 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 } from '../lib/teact/teact';\n\nimport { ApiMediaFormat } from '../api/types';\n\nimport * as mediaLoader from '../util/mediaLoader';\nimport useForceUpdate from './useForceUpdate';\n\nexport default (\n mediaHash: string | false | undefined,\n noLoad = false,\n // @ts-ignore (workaround for \"could be instantiated with a different subtype\" issue)\n mediaFormat: T = 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","import { MouseEvent as ReactMouseEvent } from 'react';\nimport React, {\n FC, useEffect, useCallback, memo,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiUser, ApiTypingStatus } from '../../api/types';\nimport { GlobalActions, GlobalState } from '../../global/types';\nimport { MediaViewerOrigin } from '../../types';\n\nimport { selectChatMessages, selectUser } from '../../modules/selectors';\nimport { getUserFullName, getUserStatus, isUserOnline } from '../../modules/helpers';\nimport renderText from './helpers/renderText';\nimport { pick } from '../../util/iteratees';\nimport useLang from '../../hooks/useLang';\n\nimport Avatar from './Avatar';\nimport VerifiedIcon from './VerifiedIcon';\nimport TypingStatus from './TypingStatus';\n\ntype OwnProps = {\n userId: number;\n typingStatus?: ApiTypingStatus;\n avatarSize?: 'tiny' | 'small' | 'medium' | 'large' | 'jumbo';\n forceShowSelf?: boolean;\n status?: string;\n withMediaViewer?: boolean;\n withUsername?: boolean;\n withFullInfo?: boolean;\n withUpdatingStatus?: boolean;\n noStatusOrTyping?: boolean;\n noRtl?: boolean;\n};\n\ntype StateProps = {\n user?: ApiUser;\n isSavedMessages?: boolean;\n areMessagesLoaded: boolean;\n serverTimeOffset: number;\n} & Pick;\n\ntype DispatchProps = Pick;\n\nconst PrivateChatInfo: FC = ({\n typingStatus,\n avatarSize = 'medium',\n status,\n withMediaViewer,\n withUsername,\n withFullInfo,\n withUpdatingStatus,\n noStatusOrTyping,\n noRtl,\n user,\n isSavedMessages,\n areMessagesLoaded,\n lastSyncTime,\n loadFullUser,\n openMediaViewer,\n serverTimeOffset,\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 (\n {status}\n );\n }\n\n if (withUpdatingStatus && !areMessagesLoaded) {\n return (\n {lang('Updating')}\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, 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 && 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 isSavedMessages = !forceShowSelf && user && user.isSelf;\n const areMessagesLoaded = Boolean(selectChatMessages(global, userId));\n\n return {\n lastSyncTime, user, isSavedMessages, areMessagesLoaded, serverTimeOffset,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['loadFullUser', 'openMediaViewer']),\n)(PrivateChatInfo));\n","import 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: any;\n onClose: () => void;\n onCloseAnimationEnd?: () => void;\n onEnter?: () => void;\n};\n\ntype StateProps = {\n shouldSkipHistoryAnimations?: boolean;\n};\n\nconst Modal: FC = ({\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\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 { RefObject } from 'react';\nimport React, {\n FC, useLayoutEffect, useRef,\n} from '../../lib/teact/teact';\nimport { getGlobal } from '../../lib/teact/teactn';\n\nimport useForceUpdate from '../../hooks/useForceUpdate';\nimport usePrevious from '../../hooks/usePrevious';\nimport buildClassName from '../../util/buildClassName';\nimport { dispatchHeavyAnimationEvent } from '../../hooks/useHeavyAnimationCheck';\nimport { waitForAnimationEnd } from '../../util/cssAnimationEndListeners';\n\nimport './Transition.scss';\n\ntype ChildrenFn = (isActive: boolean, isFrom: boolean, currentKey: number) => any;\ntype OwnProps = {\n ref?: RefObject;\n activeKey: number;\n name: (\n 'none' | 'slide' | 'slide-reversed' | 'mv-slide' | 'slide-fade' | 'zoom-fade' | 'slide-layers'\n | 'fade' | 'push-slide' | 'reveal'\n );\n direction?: 'auto' | 'inverse' | 1 | -1;\n renderCount?: number;\n shouldRestoreHeight?: boolean;\n shouldCleanup?: boolean;\n cleanupExceptionKey?: number;\n id?: string;\n className?: string;\n onStart?: () => void;\n onStop?: () => void;\n children: ChildrenFn;\n};\n\nconst CLEANED_UP = Symbol('CLEANED_UP');\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\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 || (cleanupExceptionKey !== undefined && cleanupExceptionKey === prevActiveKey)) {\n return;\n }\n\n rendersRef.current = { [prevActiveKey]: CLEANED_UP };\n forceUpdate();\n }\n\n const container = containerRef.current!;\n\n const childElements = container.children;\n if (childElements.length === 1 && !activeKeyChanged) {\n childElements[0].classList.add('active');\n\n return;\n }\n\n const childNodes = Array.from(container.childNodes);\n\n if (!activeKeyChanged || !childNodes.length) {\n return;\n }\n\n const isBackwards = (\n direction === -1\n || (direction === 'auto' && prevActiveKey > activeKey)\n || (direction === 'inverse' && prevActiveKey < activeKey)\n );\n\n container.classList.remove('animating');\n container.classList.toggle('backwards', isBackwards);\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 === 'none' || animationLevel === 0) {\n childNodes.forEach((node, i) => {\n if (node instanceof HTMLElement) {\n node.classList.remove('from', 'through', 'to');\n node.classList.toggle('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('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 let dispatchHeavyAnimationStop: NoneToVoidFunction;\n if (animationLevel > 0) {\n dispatchHeavyAnimationStop = dispatchHeavyAnimationEvent();\n }\n\n requestAnimationFrame(() => {\n container.classList.add('animating');\n\n if (onStart) {\n onStart();\n }\n\n function onAnimationEnd() {\n requestAnimationFrame(() => {\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('active', i === activeIndex);\n }\n });\n\n if (shouldRestoreHeight) {\n const activeElement = container.querySelector('.active');\n\n if (activeElement) {\n activeElement.style.height = 'auto';\n container.style.height = `${activeElement.clientHeight}px`;\n }\n }\n\n if (dispatchHeavyAnimationStop) {\n dispatchHeavyAnimationStop();\n }\n\n cleanup();\n\n if (onStop) {\n onStop();\n }\n });\n }\n\n const toNode = name === 'mv-slide'\n ? childNodes[activeIndex] && childNodes[activeIndex].firstChild\n : childNodes[activeIndex];\n\n if (animationLevel > 0 && toNode) {\n waitForAnimationEnd(toNode, 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('.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 const contents = collection.map((key) => {\n const render = renders[key];\n\n return (\n typeof render === 'function'\n ?
{render(key === activeKey, key === prevActiveKey, activeKey)}
\n : undefined\n );\n });\n\n const fullClassName = buildClassName(\n 'Transition',\n className,\n name,\n );\n\n return (\n
\n {contents}\n
\n );\n};\n\nexport default Transition;\n","import { MouseEvent as ReactMouseEvent } from 'react';\nimport React, { FC, useCallback, memo } from '../../lib/teact/teact';\n\nimport { ApiUser, ApiChat, ApiMediaFormat } from '../../api/types';\n\nimport { IS_TEST } from '../../config';\nimport {\n getChatAvatarHash, getChatTitle, isChatPrivate,\n getUserFullName, isUserOnline, isDeletedUser, getUserColorKey,\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 useTransitionForMedia from '../../hooks/useTransitionForMedia';\nimport useLang from '../../hooks/useLang';\n\nimport './Avatar.scss';\n\ntype OwnProps = {\n className?: string;\n size?: 'micro' | 'tiny' | 'small' | 'medium' | 'large' | 'jumbo';\n withOnlineStatus?: boolean;\n chat?: ApiChat;\n user?: ApiUser;\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 text,\n withOnlineStatus,\n isSavedMessages,\n lastSyncTime,\n onClick,\n}) => {\n const isDeleted = user && isDeletedUser(user);\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 }\n }\n\n const dataUri = useMedia(imageHash, false, ApiMediaFormat.DataUri, lastSyncTime);\n const { shouldRenderFullMedia, transitionClassNames } = useTransitionForMedia(dataUri, '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 (shouldRenderFullMedia) {\n content = \"\";\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, isChatPrivate(chat.id) ? 2 : 1);\n } else if (text) {\n content = getFirstLetters(text, 2);\n }\n\n const isOnline = !isSavedMessages && user && isUserOnline(user);\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 withOnlineStatus && isOnline && 'online',\n onClick && 'interactive',\n (!isSavedMessages && !shouldRenderFullMedia) && 'no-photo',\n );\n\n const handleClick = useCallback((e: ReactMouseEvent) => {\n if (onClick) {\n onClick(e, isSavedMessages || shouldRenderFullMedia);\n }\n }, [onClick, isSavedMessages, shouldRenderFullMedia]);\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 { 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';\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 noScrollRestore?: boolean;\n noScrollRestoreOnTop?: boolean;\n noFastList?: boolean;\n cacheBuster?: any;\n children: any;\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 // 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 }>({} as any);\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 (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]);\n\n const handleScroll = useCallback((e: UIEvent) => {\n if (loadMoreForwards && loadMoreBackwards) {\n const {\n listItemElements, isScrollTopJustUpdated, currentAnchor, currentAnchorTop,\n } = stateRef.current;\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 && 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 resetScroll(container);\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 && 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 resetScroll(container);\n loadMoreBackwards();\n }\n }\n }\n\n if (!isUpdated) {\n if (currentAnchor && 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 {children}\n
\n );\n};\n\nexport default InfiniteScroll;\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: any;\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 { useEffect, useRef, useState } from '../lib/teact/teact';\n\nimport useShowTransition from './useShowTransition';\n\nconst SPEED = {\n fast: 200,\n slow: 350,\n};\n\nexport default (mediaData?: any, speed: keyof typeof SPEED = 'fast', noAnimate = false) => {\n const isMediaLoaded = Boolean(mediaData);\n const willAnimate = !useRef(isMediaLoaded).current && !noAnimate;\n const [shouldRenderThumb, setShouldRenderThumb] = useState(!isMediaLoaded);\n\n const {\n shouldRender: shouldRenderFullMedia,\n transitionClassNames,\n } = useShowTransition(isMediaLoaded, undefined, !willAnimate, speed);\n\n useEffect(() => {\n if (shouldRenderFullMedia) {\n if (willAnimate) {\n setTimeout(() => {\n setShouldRenderThumb(false);\n }, SPEED[speed]);\n } else {\n setShouldRenderThumb(false);\n }\n }\n }, [willAnimate, shouldRenderFullMedia, speed]);\n\n return {\n shouldRenderThumb,\n shouldRenderFullMedia,\n transitionClassNames,\n };\n};\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 } 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 = 200;\nexport const AVATAR_FULL_DIMENSIONS = { width: 640, height: 640 };\nexport const LIKE_STICKER_ID = '1258816259753933';\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\n return calculateDimensions(availableWidth, availableHeight, width, height);\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) {\n occupiedHeightRem = mql.matches ? 10 : 15;\n }\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 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: AnyLiteral;\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};\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 supposed for judges to measure \"Transferred Size\" in Dev Tools\nconst LOTTIE_LOAD_DELAY = 5000;\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 onLoad,\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\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 );\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 }, [animation, animationData, id, isLowPriority, noLoop, onLoad, quality, size, speed]);\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 useHeavyAnimationCheck(freezeAnimation, unfreezeAnimation);\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 React, { FC, memo } from '../../lib/teact/teact';\n\nimport useLang from '../../hooks/useLang';\nimport { TextPart } from '../common/helpers/renderMessageText';\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};\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}) => {\n const lang = useLang();\n\n return (\n \n {text && text.split('\\\\n').map((textPart) => (\n

{textPart}

\n ))}\n {textParts}\n
\n \n {confirmLabel}\n \n \n
\n \n );\n};\n\nexport default memo(ConfirmDialog);\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 { 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 {\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';\n\nconst STREAMING_PROGRESS = 0.75;\nconst STREAMING_TIMEOUT = 1500;\nconst PROGRESS_THROTTLE = 500;\n\nexport default (\n mediaHash: string | undefined,\n noLoad = false,\n // @ts-ignore (workaround for \"could be instantiated with a different subtype\" issue)\n mediaFormat: T = ApiMediaFormat.BlobUrl,\n cacheBuster?: number,\n delay?: number | 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 [downloadProgress, setDownloadProgress] = useState(mediaData && !isStreaming ? 1 : 0);\n const startedAtRef = useRef();\n\n const handleProgress = useMemo(() => {\n return throttle((progress: number) => {\n if (!delay || (Date.now() - startedAtRef.current! > delay)) {\n setDownloadProgress(progress);\n }\n }, PROGRESS_THROTTLE, true);\n }, [delay]);\n\n useEffect(() => {\n if (!noLoad && mediaHash) {\n if (!mediaData) {\n setDownloadProgress(0);\n\n if (startedAtRef.current) {\n mediaLoader.cancelProgress(handleProgress);\n }\n\n startedAtRef.current = Date.now();\n\n mediaLoader.fetch(mediaHash, mediaFormat, handleProgress).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 setDownloadProgress(STREAMING_PROGRESS);\n }, STREAMING_TIMEOUT);\n }\n }\n }, [noLoad, mediaHash, mediaData, mediaFormat, cacheBuster, forceUpdate, isStreaming, delay, handleProgress]);\n\n useEffect(() => {\n if (noLoad && startedAtRef.current) {\n mediaLoader.cancelProgress(handleProgress);\n setDownloadProgress(0);\n }\n }, [handleProgress, noLoad]);\n\n return { mediaData, downloadProgress };\n};\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 { 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 useTransitionForMedia from '../../hooks/useTransitionForMedia';\nimport useFlag from '../../hooks/useFlag';\nimport buildClassName from '../../util/buildClassName';\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.isAnimated && localMediaHash, !shouldPlay, ApiMediaFormat.Lottie);\n const [isAnimationLoaded, markLoaded, unmarkLoaded] = useFlag(Boolean(lottieData));\n const canAnimatedPlay = isAnimationLoaded && shouldPlay;\n\n const {\n shouldRenderThumb,\n shouldRenderFullMedia: shouldRenderPreview,\n transitionClassNames: previewTransitionClassNames,\n } = useTransitionForMedia(previewBlobUrl || canAnimatedPlay, 'slow');\n\n // To avoid flickering\n useEffect(() => {\n if (!shouldPlay) {\n unmarkLoaded();\n }\n }, [unmarkLoaded, shouldPlay]);\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 sticker.isAnimated && 'animated',\n stickerSelector,\n className,\n );\n\n const style = shouldRenderThumb && thumbDataUri ? `background-image: url('${thumbDataUri}');` : '';\n\n return (\n \n {shouldRenderPreview && !canAnimatedPlay && (\n // eslint-disable-next-line jsx-a11y/alt-text\n \n )}\n {shouldPlay && lottieData && (\n \n )}\n {onUnfaveClick && (\n \n \n \n )}\n
\n );\n};\n\nexport default memo(StickerButton);\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\ntype 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 { 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 { FC, useRef, useLayoutEffect } from '../../lib/teact/teact';\nimport TeactDOM from '../../lib/teact/teact-dom';\n\ntype OwnProps = {\n containerId?: string;\n className?: string;\n children: any;\n};\n\nconst Portal: FC = ({ containerId, className, children }) => {\n const elementRef = useRef(document.createElement('div'));\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, elementRef.current);\n};\n\nexport default Portal;\n","import React, {\n FC, useCallback, useRef, useState,\n} from '../../lib/teact/teact';\n\nimport { ApiMediaFormat, ApiSticker } from '../../api/types';\n\nimport { LIKE_STICKER_ID } from './helpers/mediaDimensions';\nimport { ObserveFn, useIsIntersecting } from '../../hooks/useIntersectionObserver';\nimport useMedia from '../../hooks/useMedia';\nimport useTransitionForMedia from '../../hooks/useTransitionForMedia';\nimport useFlag from '../../hooks/useFlag';\n\nimport AnimatedSticker from './AnimatedSticker';\n\nimport './AnimatedEmoji.scss';\n\ntype OwnProps = {\n sticker: ApiSticker;\n observeIntersection?: ObserveFn;\n size?: 'large' | 'medium' | 'small';\n lastSyncTime?: number;\n forceLoadPreview?: boolean;\n};\n\nconst QUALITY = 1;\nconst WIDTH = {\n large: 160,\n medium: 128,\n small: 104,\n};\n\nconst AnimatedEmoji: FC = ({\n sticker,\n size = 'medium',\n observeIntersection,\n lastSyncTime,\n forceLoadPreview,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const ref = useRef(null);\n\n const [isAnimationLoaded, markAnimationLoaded] = useFlag();\n const localMediaHash = `sticker${sticker.id}`;\n\n const isIntersecting = useIsIntersecting(ref, observeIntersection);\n\n const thumbDataUri = sticker.thumbnail && sticker.thumbnail.dataUri;\n const previewBlobUrl = useMedia(\n `${localMediaHash}?size=m`,\n !isIntersecting && !forceLoadPreview,\n ApiMediaFormat.BlobUrl,\n lastSyncTime,\n );\n const { transitionClassNames } = useTransitionForMedia(previewBlobUrl, 'slow');\n\n const mediaData = useMedia(localMediaHash, !isIntersecting, ApiMediaFormat.Lottie, lastSyncTime);\n const isMediaLoaded = Boolean(mediaData);\n\n const [playKey, setPlayKey] = useState(String(Math.random()));\n const handleClick = useCallback(() => {\n setPlayKey(String(Math.random()));\n }, []);\n\n const width = WIDTH[size];\n const style = `width: ${width}px; height: ${width}px;`;\n\n return (\n \n {!isAnimationLoaded && thumbDataUri && (\n \"\"\n )}\n {!isAnimationLoaded && previewBlobUrl && (\n \"\"\n )}\n {isMediaLoaded && (\n \n )}\n
\n );\n};\n\nexport default AnimatedEmoji;\n","import { MouseEvent as ReactMouseEvent } from 'react';\nimport React, {\n FC, useEffect, useCallback, memo,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiChat, ApiTypingStatus } from '../../api/types';\nimport { GlobalActions, 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 { pick } from '../../util/iteratees';\nimport useLang, { LangFn } from '../../hooks/useLang';\n\nimport Avatar from './Avatar';\nimport VerifiedIcon from './VerifiedIcon';\nimport TypingStatus from './TypingStatus';\n\ntype OwnProps = {\n chatId: number;\n typingStatus?: ApiTypingStatus;\n avatarSize?: 'small' | 'medium' | 'large' | 'jumbo';\n withMediaViewer?: boolean;\n withUsername?: boolean;\n withFullInfo?: boolean;\n withUpdatingStatus?: boolean;\n withChatType?: boolean;\n noRtl?: boolean;\n};\n\ntype StateProps = {\n chat?: ApiChat;\n onlineCount?: number;\n areMessagesLoaded: boolean;\n} & Pick;\n\ntype DispatchProps = Pick;\n\nconst GroupChatInfo: FC = ({\n typingStatus,\n avatarSize = 'medium',\n withMediaViewer,\n withUsername,\n withFullInfo,\n withUpdatingStatus,\n withChatType,\n noRtl,\n chat,\n onlineCount,\n areMessagesLoaded,\n lastSyncTime,\n loadFullChat,\n openMediaViewer,\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 (withUpdatingStatus && !areMessagesLoaded && !isRestricted) {\n return (\n {lang('Updating')}\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 (setGlobal, actions): DispatchProps => pick(actions, ['loadFullChat', 'openMediaViewer']),\n)(GroupChatInfo));\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 { dispatchHeavyAnimationEvent } from '../hooks/useHeavyAnimationCheck';\nimport { animateSingle } from './animation';\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 forceCurrentContainerHeight?: 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\n if (getGlobal().settings.byKey.animationLevel === ANIMATION_LEVEL_MIN) {\n forceDuration = 0;\n }\n\n scrollWithJs(container, element, scrollFrom, position, margin, forceDuration, forceCurrentContainerHeight);\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 forceCurrentContainerHeight?: boolean,\n) {\n const { offsetTop: elementTop, offsetHeight: elementHeight } = element;\n const { scrollTop: currentScrollTop, offsetHeight: containerHeight, scrollHeight } = container;\n const targetContainerHeight = !forceCurrentContainerHeight && 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;\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 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\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 { useCallback, useEffect, 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?: number }) => void;\n\nconst DEFAULT_LIST_SLICE = 30;\n\nexport default (\n loadMoreBackwards?: LoadMoreBackwards,\n listIds?: number[],\n isDisabled = false,\n listSlice = DEFAULT_LIST_SLICE,\n forceFullPreload = false,\n): [number[]?, GetMore?] => {\n const lastParamsRef = useRef<{\n direction?: LoadMoreDirection;\n offsetId?: number;\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, listIds[0], LoadMoreDirection.Forwards, listSlice);\n return newViewportIds;\n })());\n\n const forceUpdate = useForceUpdate();\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, offsetId, direction, listSlice);\n\n if (!viewportIdsRef.current || !areSortedArraysEqual(viewportIdsRef.current, newViewportIds)) {\n viewportIdsRef.current = newViewportIds;\n }\n }\n\n useEffect(() => {\n if (listIds && !isDisabled && loadMoreBackwards && forceFullPreload) {\n const viewportIds = viewportIdsRef.current!;\n loadMoreBackwards({ offsetId: viewportIds[viewportIds.length - 1] });\n }\n }, [listIds, isDisabled, loadMoreBackwards, forceFullPreload]);\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, offsetId, direction, listSlice);\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: number[],\n offsetId = 0,\n direction: LoadMoreDirection,\n listSlice: number,\n) {\n const { length } = sourceIds;\n const index = sourceIds.indexOf(offsetId);\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","export default function cycleRestrict(length: number, index: number) {\n return index - Math.floor(index / length) * length;\n}\n","import { IS_TOUCH_ENV } from './environment';\n\nexport default function focusEditableElement(element: HTMLElement, force?: 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 && (!lastChild || !lastChild.nodeValue)) {\n element.focus();\n return;\n }\n\n range.selectNodeContents(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 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) => void;\n onClick?: (e: MouseEvent | TouchEvent) => void;\n excludedClosestSelector?: string;\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 = 'x' | 'y' | undefined;\n\nconst MOVED_THRESHOLD = 15;\nconst SWIPE_THRESHOLD = 50;\n\nexport function captureEvents(element: HTMLElement, options: CaptureOptions) {\n let captureEvent: MouseEvent | RealTouchEvent | undefined;\n let hasMoved = false;\n let currentSwipeAxis: TSwipeAxis;\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 document.addEventListener('touchmove', onMove);\n document.addEventListener('touchend', onRelease);\n document.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 }\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 document.removeEventListener('touchcancel', onRelease);\n document.removeEventListener('touchend', onRelease);\n document.removeEventListener('touchmove', onMove);\n\n captureEvent = undefined;\n\n if (hasMoved) {\n if (options.onRelease) {\n options.onRelease(e);\n }\n } else if (options.onClick && (!('button' in e) || e.button === 0)) {\n options.onClick(e);\n }\n }\n\n hasMoved = false;\n currentSwipeAxis = 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\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 if (options.onDrag) {\n e.preventDefault();\n options.onDrag(e, captureEvent, { dragOffsetX, dragOffsetY });\n }\n\n if (options.onSwipe) {\n onSwipe(e, dragOffsetX, dragOffsetY);\n }\n }\n }\n\n function onSwipe(e: Event, dragOffsetX: number, dragOffsetY: number) {\n if (!currentSwipeAxis) {\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;\n }\n }\n\n if (xAbs >= SWIPE_THRESHOLD) {\n currentSwipeAxis = 'x';\n } else if (yAbs >= SWIPE_THRESHOLD) {\n currentSwipeAxis = 'y';\n }\n }\n\n processSwipe(e, currentSwipeAxis, dragOffsetX, dragOffsetY, options.onSwipe!);\n }\n\n element.addEventListener('mousedown', onCapture);\n element.addEventListener('touchstart', onCapture, { passive: true });\n\n return () => {\n element.removeEventListener('mousedown', onCapture);\n element.removeEventListener('touchstart', onCapture);\n };\n}\n\nfunction processSwipe(\n e: Event,\n currentSwipeAxis:TSwipeAxis,\n dragOffsetX: number,\n dragOffsetY: number,\n onSwipe: (e: Event, direction: SwipeDirection) => void,\n) {\n if (currentSwipeAxis === 'x') {\n if (dragOffsetX < 0) {\n onSwipe(e, SwipeDirection.Left);\n } else {\n onSwipe(e, SwipeDirection.Right);\n }\n } else if (currentSwipeAxis === 'y') {\n if (dragOffsetY < 0) {\n onSwipe(e, SwipeDirection.Up);\n } else {\n onSwipe(e, SwipeDirection.Down);\n }\n }\n}\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 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 { DEBUG } from '../config';\n\nexport default (mediaEl: HTMLMediaElement) => {\n mediaEl.play().catch((err) => {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.warn(err);\n }\n });\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\nexport default (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","import { ApiMessageEntity, ApiMessageEntityTypes, ApiFormattedText } from '../../../../api/types';\nimport { IS_EMOJI_SUPPORTED } from '../../../../util/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;\nconst MAX_MESSAGE_LENGTH = 4096;\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, '').slice(0, MAX_MESSAGE_LENGTH);\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 tags\n parsedHtml = parsedHtml.replace(/<\\/?span([^>]*)?>/g, '');\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(/[*]{2}([^*\\n]+)[*]{2}/g, '$1');\n parsedHtml = parsedHtml.replace(/[_]{2}([^*\\n]+)[_]{2}/g, '$1');\n parsedHtml = parsedHtml.replace(/[~]{2}([^~\\n]+)[~]{2}/g, '$1');\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: number | undefined;\n if (type === ApiMessageEntityTypes.TextUrl) {\n url = (node as HTMLAnchorElement).href;\n }\n if (type === ApiMessageEntityTypes.MentionName) {\n userId = Number((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","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';\n\nimport captureEscKeyListener from '../../../util/captureEscKeyListener';\nimport usePrevious from '../../../hooks/usePrevious';\n\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((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), false);\n }\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 {(withQuick || prevWithQuick) && }\n
\n );\n};\n\nexport default memo(DropArea);\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: number[] = [];\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 && 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\nexport default () => {\n return useReducer(foldersReducer, INITIAL_STATE);\n};\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, isChatPrivate } 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?: number;\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 = isChatPrivate(chatOrUserId) ? selectUser(global, chatOrUserId) : undefined;\n\n return {\n chat,\n user,\n };\n },\n)(PickerSelectedItem));\n","import { getGlobal } from '../lib/teact/teactn';\n\nimport { ANIMATION_LEVEL_MIN } from '../config';\nimport { IS_IOS } from './environment';\nimport { animate } from './animation';\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 // Native way seems to be smoother in Chrome\n if (!IS_IOS) {\n container.scrollTo({\n left,\n ...(duration && { behavior: 'smooth' }),\n });\n } else {\n scrollWithJs(container, left, duration);\n }\n}\n\nfunction scrollWithJs(container: HTMLElement, left: number, duration: number) {\n const { scrollLeft, offsetWidth: containerWidth, scrollWidth } = container;\n let path = left - scrollLeft;\n\n if (path < 0) {\n const remainingPath = -scrollLeft;\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 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\nfunction transition(t: number) {\n return 1 - ((1 - t) ** 3.5);\n}\n","import { useEffect } from '../lib/teact/teact';\n\nexport default (container: HTMLElement | null, isDisabled?: boolean) => {\n useEffect(() => {\n if (!container) {\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","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\nexport default (\n chatId: number,\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","import { RefObject } from 'react';\nimport { useState, useEffect, useCallback } from '../lib/teact/teact';\n\nimport { IAnchorPosition } from '../types';\nimport { IS_TOUCH_ENV, IS_SINGLE_COLUMN_LAYOUT } from '../util/environment';\n\nconst LONG_TAP_DURATION_MS = 250;\nconst SELECTION_ANIMATION_DURATION_MS = 200;\n\nlet contextMenuCounter = 0;\n\nfunction checkIsDisabledForMobile() {\n return IS_SINGLE_COLUMN_LAYOUT\n && window.document.body.classList.contains('enable-symbol-menu-transforms');\n}\n\nexport default (\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 document.body.classList.add('no-selection');\n }\n }, [isMenuDisabled]);\n\n const handleContextMenu = useCallback((e: React.MouseEvent) => {\n document.body.classList.remove('no-selection');\n\n if (isMenuDisabled || (shouldDisableOnLink && (e.target as HTMLElement).matches('a.text-entity-link[href]'))) {\n return;\n }\n e.preventDefault();\n\n if (contextMenuPosition) {\n return;\n }\n document.body.classList.remove('no-selection');\n if (contextMenuCounter === 0) {\n document.body.classList.add('has-context-menu');\n }\n contextMenuCounter++;\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 setTimeout(() => {\n contextMenuCounter--;\n if (contextMenuCounter === 0) {\n document.body.classList.remove('has-context-menu');\n }\n }, SELECTION_ANIMATION_DURATION_MS);\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.text-entity-link[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 e.stopImmediatePropagation();\n e.preventDefault();\n e.stopPropagation();\n }, true);\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","import { MouseEvent } from 'react';\nimport React from '../../../lib/teact/teact';\nimport { getDispatch } from '../../../lib/teact/teactn';\n\nimport { ApiMessageEntity, ApiMessageEntityTypes, ApiMessage } from '../../../api/types';\n\nimport { getMessageText } from '../../../modules/helpers';\nimport renderText from './renderText';\n\nimport MentionLink from '../../middle/message/MentionLink';\nimport SafeLink from '../SafeLink';\n\nexport type TextPart = string | Element;\n\nexport function renderMessageText(message: ApiMessage, highlight?: string, shouldRenderHqEmoji?: boolean) {\n const formattedText = message.content.text;\n\n if (!formattedText || !formattedText.text) {\n const rawText = getMessageText(message);\n return rawText ? [rawText] : undefined;\n }\n const { text, entities } = formattedText;\n\n return renderTextWithEntities(text, entities, highlight, shouldRenderHqEmoji);\n}\n\ninterface IOrganizedEntity {\n entity: ApiMessageEntity;\n organizedIndexes: Set;\n nestedEntities: IOrganizedEntity[];\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\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\nexport function renderTextWithEntities(\n text: string,\n entities?: ApiMessageEntity[],\n highlight?: string,\n shouldRenderHqEmoji?: boolean,\n shouldRenderAsHtml?: boolean,\n) {\n if (!entities || !entities.length) {\n return renderMessagePart(text, highlight, shouldRenderHqEmoji, shouldRenderAsHtml);\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,\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);\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,\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\nfunction processEntity(\n entity: ApiMessageEntity,\n entityContent: TextPart,\n nestedEntityContent: TextPart[],\n) {\n const entityText = typeof entityContent === 'string' && entityContent;\n const renderedContent = nestedEntityContent.length ? nestedEntityContent : entityContent;\n\n if (!entityText) {\n return renderMessagePart(renderedContent);\n }\n\n switch (entity.type) {\n case ApiMessageEntityTypes.Bold:\n return {renderMessagePart(renderedContent)};\n case ApiMessageEntityTypes.Blockquote:\n return
{renderMessagePart(renderedContent)}
;\n case ApiMessageEntityTypes.BotCommand:\n return (\n \n {renderMessagePart(renderedContent)}\n \n );\n case ApiMessageEntityTypes.Hashtag:\n return (\n \n {renderMessagePart(renderedContent)}\n \n );\n case ApiMessageEntityTypes.Cashtag:\n return (\n \n {renderMessagePart(renderedContent)}\n \n );\n case ApiMessageEntityTypes.Code:\n return {renderMessagePart(renderedContent)};\n case ApiMessageEntityTypes.Email:\n return (\n \n {renderMessagePart(renderedContent)}\n \n );\n case ApiMessageEntityTypes.Italic:\n return {renderMessagePart(renderedContent)};\n case ApiMessageEntityTypes.MentionName:\n return (\n \n {renderMessagePart(renderedContent)}\n \n );\n case ApiMessageEntityTypes.Mention:\n return (\n \n {renderMessagePart(renderedContent)}\n \n );\n case ApiMessageEntityTypes.Phone:\n return (\n \n {renderMessagePart(renderedContent)}\n \n );\n case ApiMessageEntityTypes.Pre:\n return
{renderMessagePart(renderedContent)}
;\n case ApiMessageEntityTypes.Strike:\n return {renderMessagePart(renderedContent)};\n case ApiMessageEntityTypes.TextUrl:\n case ApiMessageEntityTypes.Url:\n return (\n \n {renderMessagePart(renderedContent)}\n \n );\n case ApiMessageEntityTypes.Underline:\n return {renderMessagePart(renderedContent)};\n default:\n return renderMessagePart(renderedContent);\n }\n}\n\nfunction renderMessagePart(\n content: TextPart | TextPart[],\n highlight?: string,\n shouldRenderHqEmoji?: boolean,\n shouldRenderAsHtml?: boolean,\n) {\n if (Array.isArray(content)) {\n const result: TextPart[] = [];\n\n content.forEach((c) => {\n result.push(...renderMessagePart(c, highlight, shouldRenderHqEmoji, shouldRenderAsHtml));\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 if (highlight) {\n return renderText(content, [emojiFilter, 'br', 'highlight'], { highlight });\n } else {\n return renderText(content, [emojiFilter, 'br']);\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\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 default:\n return renderedContent;\n }\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","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 { 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';\n\nimport Loading from './Loading';\nimport Button from './Button';\n\nimport './SearchInput.scss';\n\ntype OwnProps = {\n ref?: RefObject;\n children?: any;\n parentContainerClassName?: string;\n className?: string;\n inputId?: string;\n value?: string;\n focused?: boolean;\n isLoading?: boolean;\n placeholder?: string;\n disabled?: boolean;\n autoComplete?: string;\n canClose?: boolean;\n onChange: (value: string) => void;\n onReset?: NoneToVoidFunction;\n onFocus?: NoneToVoidFunction;\n onBlur?: NoneToVoidFunction;\n};\n\nconst SearchInput: FC = ({\n ref,\n children,\n parentContainerClassName,\n value,\n inputId,\n className,\n focused,\n isLoading,\n placeholder,\n disabled,\n autoComplete,\n canClose,\n onChange,\n onReset,\n onFocus,\n onBlur,\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 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 {isLoading && (\n \n )}\n {!isLoading && (value || canClose) && onReset && (\n \n \n \n )}\n
\n );\n};\n\nexport default memo(SearchInput);\n","import { IS_IOS } from './environment';\n\nexport default (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","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 './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\n return (\n

\n {typingUserName && (\n {renderText(typingUserName)}\n )}\n {/* fix for translation \"username _is_ typing\" */}\n {lang(typingStatus.action).replace('{user}', '').trim()}\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, useCallback, memo } from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiChat } from '../../api/types';\nimport { GlobalActions } from '../../global/types';\n\nimport { selectIsChatWithSelf, selectUser } from '../../modules/selectors';\nimport {\n isChatPrivate,\n isUserBot,\n getUserFirstOrLastName,\n getPrivateChatUserId,\n isChatBasicGroup,\n isChatSuperGroup,\n isChatChannel,\n getChatTitle,\n} from '../../modules/helpers';\nimport { pick } from '../../util/iteratees';\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: number | undefined;\n canDeleteForAll?: boolean;\n contactName?: string;\n};\n\ntype DispatchProps = Pick;\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 leaveChannel,\n deleteHistory,\n deleteChannel,\n deleteChatUser,\n blockContact,\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 = isChatPrivate(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 (setGlobal, actions): DispatchProps => pick(actions,\n ['leaveChannel', 'deleteHistory', 'deleteChannel', 'deleteChatUser', 'blockContact']),\n)(DeleteChatModal));\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\ntype ChildrenFn = () => any;\n\ntype OwnProps = {\n isOpen: boolean;\n isCustom?: boolean;\n id?: string;\n className?: string;\n onClick?: (e: React.MouseEvent) => void;\n children: ChildrenFn;\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","/*\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 function onProgress() {\n if (!audioEl.buffered.length) {\n return;\n }\n\n audioEl.dataset.patchForSafariInProgress = 'true';\n audioEl.currentTime = audioEl.duration - 1;\n audioEl.addEventListener('progress', () => {\n delete audioEl.dataset.patchForSafariInProgress;\n audioEl.currentTime = t;\n if (audioEl.paused) {\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 { useLayoutEffect } from '../lib/teact/teact';\nimport usePrevious from './usePrevious';\n\nexport default (cb: (args: PT) => void, dependencies: T, debugKey?: string) => {\n const prevDeps = usePrevious(dependencies);\n return useLayoutEffect(() => {\n // @ts-ignore (workaround for \"could be instantiated with a different subtype\" issue)\n return cb(prevDeps || []);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, dependencies, debugKey);\n};\n","import React, {\n FC, useCallback, useEffect, useState, memo, useRef,\n} from '../../lib/teact/teact';\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 useMediaWithDownloadProgress from '../../hooks/useMediaWithDownloadProgress';\nimport useMedia from '../../hooks/useMedia';\nimport download from '../../util/download';\n\nimport File from './File';\n\ntype OwnProps = {\n message: ApiMessage;\n observeIntersection?: ObserveFn;\n smaller?: boolean;\n isSelected?: boolean;\n isSelectable?: boolean;\n uploadProgress?: number;\n withDate?: boolean;\n datetime?: number;\n className?: string;\n sender?: string;\n onCancelUpload?: () => void;\n onMediaClick?: () => void;\n onDateClick?: (messageId: number, chatId: number) => void;\n};\n\nconst Document: FC = ({\n message,\n observeIntersection,\n smaller,\n uploadProgress,\n withDate,\n datetime,\n className,\n sender,\n isSelected,\n isSelectable,\n onCancelUpload,\n onMediaClick,\n onDateClick,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const ref = useRef(null);\n\n const document = message.content.document!;\n const extension = getDocumentExtension(document) || '';\n const { fileName, size, timestamp } = document;\n const withMediaViewer = onMediaClick && Boolean(document.mediaType);\n\n const isIntersecting = useIsIntersecting(ref, observeIntersection);\n\n const [isDownloadAllowed, setIsDownloadAllowed] = useState(false);\n const {\n mediaData, downloadProgress,\n } = useMediaWithDownloadProgress(getMessageMediaHash(message, 'download'), !isDownloadAllowed);\n const {\n isUploading, isTransferring, transferProgress,\n } = getMediaTransferState(message, uploadProgress || downloadProgress, isDownloadAllowed);\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 handleClick = useCallback(() => {\n if (withMediaViewer) {\n onMediaClick!();\n } else if (isUploading) {\n if (onCancelUpload) {\n onCancelUpload();\n }\n } else {\n setIsDownloadAllowed((isAllowed) => !isAllowed);\n }\n }, [withMediaViewer, isUploading, onCancelUpload, onMediaClick]);\n\n const handleDateClick = useCallback(() => {\n onDateClick!(message.id, message.chatId);\n }, [onDateClick, message.id, message.chatId]);\n\n useEffect(() => {\n if (isDownloadAllowed && mediaData) {\n download(mediaData, fileName);\n setIsDownloadAllowed(false);\n }\n }, [fileName, mediaData, isDownloadAllowed]);\n\n return (\n \n );\n};\n\nexport default memo(Document);\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 { 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","/* 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 React, {\n FC, memo, useCallback, useEffect, useRef, useState,\n} from '../../../lib/teact/teact';\n\nimport { IAnchorPosition } from '../../../types';\n\nimport { EDITABLE_INPUT_ID } from '../../../config';\nimport buildClassName from '../../../util/buildClassName';\nimport captureEscKeyListener from '../../../util/captureEscKeyListener';\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 onClose: () => void;\n};\n\ninterface ISelectedTextFormats {\n bold?: boolean;\n italic?: boolean;\n underline?: boolean;\n strikethrough?: boolean;\n monospace?: 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};\nconst fragmentEl = document.createElement('div');\n\nconst TextFormatter: FC = ({\n isOpen,\n anchorPosition,\n selectedRange,\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 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 && !!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 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') && !!selectedFormats[key]) {\n document.execCommand(key);\n }\n });\n\n return {\n ...selectedFormats,\n bold: !selectedFormats.bold,\n };\n });\n }, []);\n\n const handleItalicText = useCallback(() => {\n document.execCommand('italic');\n setSelectedTextFormats((selectedFormats) => ({\n ...selectedFormats,\n italic: !selectedFormats.italic,\n }));\n }, []);\n\n const handleUnderlineText = useCallback(() => {\n document.execCommand('underline');\n setSelectedTextFormats((selectedFormats) => ({\n ...selectedFormats,\n underline: !selectedFormats.underline,\n }));\n }, []);\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,\n 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 return;\n }\n\n const text = getSelectedText();\n document.execCommand('insertHTML', false, `${text}`);\n onClose();\n }, [\n getSelectedElement, getSelectedText, onClose,\n selectedRange, selectedTextFormats.monospace,\n ]);\n\n function handleLinkUrlConfirm() {\n const formattedLinkUrl = encodeURI(linkUrl.includes('://') ? linkUrl : `http://${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 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_CODE: Record = {\n KeyK: openLinkControl,\n KeyB: handleBoldText,\n KeyU: handleUnderlineText,\n KeyI: handleItalicText,\n KeyM: handleMonospaceText,\n KeyS: handleStrikethroughText,\n };\n\n const handler = HANDLERS_BY_KEY_CODE[e.code];\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 handleBoldText, handleItalicText, handleUnderlineText,\n handleMonospaceText, handleStrikethroughText,\n openLinkControl,\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 !!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\nexport default memo(TextFormatter);\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 window.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","import React, { FC, memo, useCallback } from '../../lib/teact/teact';\n\nimport { ApiMessage } from '../../api/types';\n\nimport { formatMediaDuration } from '../../util/dateFormat';\nimport {\n getMessageMediaHash,\n getMessageMediaThumbDataUri,\n getMessageVideo,\n} from '../../modules/helpers';\nimport useMedia from '../../hooks/useMedia';\nimport useTransitionForMedia from '../../hooks/useTransitionForMedia';\n\nimport './Media.scss';\n\ntype OwnProps = {\n message: ApiMessage;\n idPrefix?: string;\n onClick?: (messageId: number, chatId: number) => void;\n};\n\nconst Media: FC = ({ message, idPrefix = 'shared-media', onClick }) => {\n const handleClick = useCallback(() => {\n onClick!(message.id, message.chatId);\n }, [message.id, message.chatId, onClick]);\n\n const thumbDataUri = getMessageMediaThumbDataUri(message);\n const mediaBlobUrl = useMedia(getMessageMediaHash(message, 'pictogram'));\n const {\n shouldRenderThumb, shouldRenderFullMedia, transitionClassNames,\n } = useTransitionForMedia(mediaBlobUrl, 'slow');\n\n const video = getMessageVideo(message);\n\n return (\n
\n {shouldRenderThumb && (\n \"\"\n )}\n {shouldRenderFullMedia && (\n \"\"\n )}\n {video && {video.isGif ? 'GIF' : formatMediaDuration(video.duration)}}\n
\n );\n};\n\nexport default memo(Media);\n","import React, {\n FC, useCallback, useRef, useEffect, memo,\n} from '../../lib/teact/teact';\n\nimport { isChatPrivate } 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: number[];\n selectedIds: number[];\n filterValue?: string;\n filterPlaceholder?: string;\n notFoundText?: string;\n searchInputId?: string;\n isLoading?: boolean;\n noScrollRestore?: boolean;\n onSelectedIdsChange: (ids: number[]) => 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: number) => {\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 && viewportIds.length ? (\n \n {viewportIds.map((id) => (\n handleItemClick(id)}\n ripple\n >\n \n {isChatPrivate(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, {\n FC, memo, useCallback, useEffect, useMemo, useRef, useState,\n} from '../../lib/teact/teact';\n\nimport {\n ApiAudio, ApiMessage, ApiVoice,\n} from '../../api/types';\nimport { 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 getMessageAudioCaption,\n getMessageKey,\n getMessageMediaFormat,\n getMessageMediaHash,\n isMessageLocal,\n isOwnMessage,\n} from '../../modules/helpers';\nimport { renderWaveformToDataUri } from './helpers/waveform';\nimport buildClassName from '../../util/buildClassName';\nimport renderText from './helpers/renderText';\nimport { decodeWaveform, interpolateArray } from '../../util/waveform';\nimport useMediaWithDownloadProgress from '../../hooks/useMediaWithDownloadProgress';\nimport useShowTransition from '../../hooks/useShowTransition';\nimport useBuffering from '../../hooks/useBuffering';\nimport useAudioPlayer from '../../hooks/useAudioPlayer';\nimport useMediaDownload from '../../hooks/useMediaDownload';\nimport useLang, { LangFn } from '../../hooks/useLang';\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 target?: 'searchResult' | 'sharedMedia';\n date?: number;\n lastSyncTime?: number;\n className?: string;\n isSelectable?: boolean;\n isSelected?: boolean;\n onPlay: (messageId: number, chatId: number) => void;\n onReadMedia?: () => void;\n onCancelUpload?: () => void;\n onDateClick?: (messageId: number, chatId: number) => void;\n};\n\ninterface ISeekMethods {\n handleStartSeek: (e: React.MouseEvent) => void;\n handleSeek: (e: React.MouseEvent) => void;\n handleStopSeek: () => void;\n}\n\nconst AVG_VOICE_DURATION = 30;\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 target,\n date,\n lastSyncTime,\n className,\n isSelectable,\n isSelected,\n onPlay,\n onReadMedia,\n onCancelUpload,\n onDateClick,\n}) => {\n const { content: { audio, voice }, isMediaUnread } = message;\n const isVoice = Boolean(voice);\n const isSeeking = useRef(false);\n const lang = useLang();\n\n const [isActivated, setIsActivated] = useState(false);\n const shouldDownload = (isActivated || PRELOAD) && lastSyncTime;\n\n const { mediaData, downloadProgress } = useMediaWithDownloadProgress(\n getMessageMediaHash(message, 'inline'),\n !shouldDownload,\n getMessageMediaFormat(message, 'inline'),\n );\n\n function handleForcePlay() {\n setIsActivated(true);\n onPlay(message.id, message.chatId);\n }\n\n const {\n isBuffered, bufferedProgress, bufferingHandlers, checkBuffering,\n } = useBuffering();\n\n const {\n isPlaying, playProgress, playPause, setCurrentTime, duration,\n } = useAudioPlayer(\n getMessageKey(message),\n getMediaDuration(message)!,\n mediaData,\n bufferingHandlers,\n checkBuffering,\n isActivated,\n handleForcePlay,\n isMessageLocal(message),\n );\n\n useEffect(() => {\n setIsActivated(isPlaying);\n }, [isPlaying]);\n\n const {\n isDownloadStarted,\n downloadProgress: directDownloadProgress,\n handleDownloadClick,\n } = useMediaDownload(getMessageMediaHash(message, 'download'), getMessageAudioCaption(message));\n\n const isLoadingForPlaying = isActivated && !isBuffered;\n\n const {\n isUploading, isTransferring, transferProgress,\n } = getMediaTransferState(\n message,\n isDownloadStarted ? directDownloadProgress : (uploadProgress || downloadProgress),\n isLoadingForPlaying || isDownloadStarted,\n );\n\n const {\n shouldRender: shouldRenderSpinner,\n transitionClassNames: spinnerClassNames,\n } = useShowTransition(isTransferring);\n\n const handleButtonClick = useCallback(() => {\n if (isUploading) {\n if (onCancelUpload) {\n onCancelUpload();\n }\n\n return;\n }\n\n if (!isPlaying) {\n onPlay(message.id, message.chatId);\n }\n\n setIsActivated(!isActivated);\n playPause();\n }, [isPlaying, isUploading, message.id, message.chatId, onCancelUpload, onPlay, playPause, isActivated]);\n\n useEffect(() => {\n if (isPlaying && onReadMedia && isMediaUnread) {\n onReadMedia();\n }\n }, [isPlaying, isMediaUnread, onReadMedia]);\n\n const handleSeek = useCallback((e: React.MouseEvent) => {\n if (isSeeking.current) {\n const seekBar = e.currentTarget.closest('.seekline,.waveform');\n if (seekBar) {\n const { width, left } = seekBar.getBoundingClientRect();\n setCurrentTime(duration * ((e.clientX - left) / width));\n }\n }\n }, [duration, setCurrentTime]);\n\n const handleStartSeek = useCallback((e: React.MouseEvent) => {\n isSeeking.current = true;\n handleSeek(e);\n }, [handleSeek]);\n\n const handleStopSeek = useCallback(() => {\n isSeeking.current = false;\n }, []);\n\n const handleDateClick = useCallback(() => {\n onDateClick!(message.id, message.chatId);\n }, [onDateClick, message.id, message.chatId]);\n\n function getFirstLine() {\n if (isVoice) {\n return senderTitle || 'Voice';\n }\n\n const { title, fileName } = audio!;\n\n return title || fileName;\n }\n\n function getSecondLine() {\n if (isVoice) {\n return formatMediaDuration(voice!.duration);\n }\n\n const { performer } = audio!;\n\n return (\n <>\n {performer && renderText(performer)}\n {performer && senderTitle && }\n {senderTitle && renderText(senderTitle)}\n \n );\n }\n\n const seekHandlers = { handleStartSeek, handleSeek, handleStopSeek };\n const isOwn = isOwnMessage(message);\n const renderedWaveform = useMemo(\n () => voice && renderWaveform(voice, playProgress, isOwn, seekHandlers, theme),\n [voice, playProgress, isOwn, seekHandlers, theme],\n );\n\n const fullClassName = buildClassName(\n 'Audio media-inner',\n className,\n isOwn && !target && 'own',\n target && 'bigger',\n isSelected && 'audio-is-selected',\n );\n\n const buttonClassNames = ['toggle-play'];\n if (isLoadingForPlaying) {\n buttonClassNames.push('loading');\n } else if (isPlaying) {\n buttonClassNames.push('pause');\n } else if (!isPlaying) {\n buttonClassNames.push('play');\n }\n\n const showSeekline = isPlaying || (playProgress > 0 && playProgress < 1);\n const contentClassName = buildClassName('content', showSeekline && 'with-seekline');\n\n function renderSearchResult() {\n return (\n <>\n
\n
\n

{renderText(getFirstLine())}

\n\n
\n {date && (\n \n {formatPastTimeShort(lang, date * 1000)}\n \n )}\n
\n
\n\n {showSeekline && renderSeekline(playProgress, bufferedProgress, seekHandlers)}\n {!showSeekline && (\n

\n {playProgress > 0 ? `${formatMediaDuration(duration * playProgress)} / ` : undefined}\n {getSecondLine()}\n

\n )}\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 && (\n \n \n \n )}\n {target === 'searchResult' && renderSearchResult()}\n {target !== 'searchResult' && audio && renderAudio(\n lang, audio, isPlaying, playProgress, bufferedProgress, seekHandlers, date,\n onDateClick ? handleDateClick : undefined,\n )}\n {target !== 'searchResult' && voice && renderVoice(voice, renderedWaveform, isMediaUnread)}\n
\n );\n};\n\nfunction renderAudio(\n lang: LangFn,\n audio: ApiAudio,\n isPlaying: boolean,\n playProgress: number,\n bufferedProgress: number,\n seekHandlers: ISeekMethods,\n date?: number,\n handleDateClick?: NoneToVoidFunction,\n) {\n const {\n title, performer, duration, fileName,\n } = audio;\n const showSeekline = isPlaying || (playProgress > 0 && playProgress < 1);\n\n return (\n
\n

{renderText(title || fileName)}

\n {showSeekline && renderSeekline(playProgress, bufferedProgress, seekHandlers)}\n {!showSeekline && (\n
\n {renderText(performer || 'Unknown')}\n {date && (\n <>\n {' '}\n •\n {' '}\n {formatMediaDateTime(lang, date * 1000)}\n \n )}\n
\n )}\n

\n {playProgress > 0 ? `${formatMediaDuration(duration * playProgress)} / ` : undefined}\n {formatMediaDuration(duration)}\n

\n
\n );\n}\n\nfunction renderVoice(voice: ApiVoice, renderedWaveform: any, isMediaUnread?: boolean) {\n return (\n
\n {renderedWaveform}\n

\n {formatMediaDuration(voice.duration)}\n {isMediaUnread && }\n

\n
\n );\n}\n\nfunction renderWaveform(\n voice: ApiVoice,\n playProgress = 0,\n isOwn = false,\n { handleStartSeek, handleSeek, handleStopSeek }: ISeekMethods,\n theme: ISettings['theme'],\n) {\n const { waveform, duration } = voice;\n\n if (!waveform) {\n return undefined;\n }\n\n const fillColor = theme === 'dark' ? '#494B75' : '#CBCBCB';\n const fillOwnColor = theme === 'dark' ? '#C0BBED' : '#B0DEA6';\n const progressFillColor = theme === 'dark' ? '#868DF5' : '#54a3e6';\n const progressFillOwnColor = theme === 'dark' ? '#FFFFFF' : '#53ad53';\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 const { data: spikes, peak } = interpolateArray(decodedWaveform, spikesCount);\n const { src, width, height } = renderWaveformToDataUri(spikes, playProgress, {\n peak,\n fillStyle: isOwn ? fillOwnColor : fillColor,\n progressFillStyle: isOwn ? progressFillOwnColor : progressFillColor,\n });\n\n return (\n // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions\n \n );\n}\n\nfunction renderSeekline(\n playProgress: number,\n bufferedProgress: number,\n { handleStartSeek, handleSeek, handleStopSeek }: ISeekMethods,\n) {\n return (\n \n \n \n \n \n \n \n \n \n \n
\n );\n}\n\nexport default memo(Audio);\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","type IWaveformProps = {\n peak: number;\n fillStyle: string;\n progressFillStyle: string;\n};\n\nconst SPIKE_WIDTH = 2;\nconst SPIKE_STEP = 4;\nconst SPIKE_RADIUS = 1;\nconst HEIGHT = 23;\n\nexport function renderWaveformToDataUri(\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 const canvas = document.createElement('canvas');\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 return {\n src: canvas.toDataURL(),\n width,\n height,\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","import React, {\n FC, useLayoutEffect, useRef, memo,\n} from '../../lib/teact/teact';\n\nimport buildClassName from '../../util/buildClassName';\nimport renderText from '../common/helpers/renderText';\n\nimport './Tab.scss';\n\ntype OwnProps = {\n className?: string;\n title: string;\n active?: boolean;\n badgeCount?: number;\n isBadgeActive?: boolean;\n previousActiveTab?: number;\n onClick: (arg: number) => void;\n clickArg: number;\n};\n\nconst Tab: FC = ({\n className,\n title,\n active,\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 useLayoutEffect(() => {\n if (!active || previousActiveTab === undefined) {\n return;\n }\n\n const tab = tabRef.current!;\n const indicator = tab.querySelector('i')!;\n const prevTab = tab.parentElement!.children[previousActiveTab];\n if (!prevTab) {\n return;\n }\n const currentIndicator = prevTab.querySelector('i')!;\n\n currentIndicator.classList.remove('animate');\n indicator.classList.remove('animate');\n\n // We move and resize our indicator so it repeats the position and size of the previous one.\n const shiftLeft = currentIndicator.parentElement!.offsetLeft - indicator.parentElement!.offsetLeft;\n const scaleFactor = currentIndicator.clientWidth / indicator.clientWidth;\n indicator.style.transform = `translate3d(${shiftLeft}px, 0, 0) scale3d(${scaleFactor}, 1, 1)`;\n\n // 3 AFs needed here to synchronize animations with Transition component\n requestAnimationFrame(() => {\n requestAnimationFrame(() => {\n requestAnimationFrame(() => {\n // Now we remove the transform to let it animate to its own position and size.\n indicator.classList.add('animate');\n indicator.style.transform = 'none';\n });\n });\n });\n }, [active, previousActiveTab]);\n\n return (\n onClick(clickArg)}\n ref={tabRef}\n >\n \n {renderText(title)}\n {!!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 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\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 if (container.scrollWidth <= container.offsetWidth) {\n return;\n }\n\n const activeTabElement = container.querySelector('.Tab.active') as HTMLElement | null;\n if (activeTabElement) {\n const newLeft = activeTabElement.offsetLeft - (container.offsetWidth / 2) + (activeTabElement.offsetWidth / 2);\n\n // Prevent scrolling by only a couple of pixels, which doesn't look smooth\n if (Math.abs(newLeft - container.scrollLeft) < TAB_SCROLL_THRESHOLD_PX) {\n return;\n }\n\n fastSmoothScrollHorizontal(container, newLeft);\n }\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 { ApiError } 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\n // Non-API errors\n SERVICE_WORKER_DISABLED: 'Service Worker is disabled. Please reload the page without holding key.',\n // eslint-disable-next-line max-len\n CAPTION_TOO_LONG_PLEASE_REMOVE_CHARACTERS: 'The provided caption 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};\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","// 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","import { useMemo } from '../lib/teact/teact';\nimport { getDispatch } from '../lib/teact/teactn';\n\nimport { ApiChat, ApiUser } from '../api/types';\n\nimport {\n isChatArchived, getCanDeleteChat, isChatPrivate, isChatChannel,\n} from '../modules/helpers';\nimport useLang from './useLang';\n\nexport default ({\n chat,\n privateChatUser,\n handleDelete,\n folderId,\n isPinned,\n isMuted,\n}: {\n chat: ApiChat | undefined;\n privateChatUser: ApiUser | undefined;\n handleDelete: () => void;\n folderId?: number;\n isPinned?: boolean;\n isMuted?: boolean;\n}) => {\n const lang = useLang();\n\n const {\n toggleChatPinned,\n updateChatMutedState,\n toggleChatArchived,\n toggleChatUnread,\n } = getDispatch();\n\n return useMemo(() => {\n if (!chat) {\n return undefined;\n }\n\n const isChatWithSelf = privateChatUser && privateChatUser.isSelf;\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 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 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: isChatPrivate(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 return [\n actionUnreadMark,\n actionPin,\n ...(!isChatWithSelf ? [\n actionMute,\n actionArchive,\n ] : []),\n actionDelete,\n ];\n }, [\n chat, privateChatUser, lang, isPinned, handleDelete, toggleChatUnread, toggleChatPinned, folderId,\n updateChatMutedState, toggleChatArchived, isMuted,\n ]);\n};\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 } 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 );\n};\n\nexport default memo(MessageOutgoingStatus);\n","import { useState, useEffect } from '../lib/teact/teact';\nimport { IAnchorPosition } from '../types';\n\nconst MENU_POSITION_VISUAL_COMFORT_SPACE_PX = 16;\n\nexport default (\n anchor: IAnchorPosition | undefined,\n getTriggerElement: () => HTMLElement | null,\n getRootElement: () => HTMLElement | null,\n getMenuElement: () => HTMLElement | null,\n extraPaddingX = 0,\n extraTopPadding = 0,\n) => {\n const [positionX, setPositionX] = useState<'right' | 'left'>('right');\n const [positionY, setPositionY] = useState<'top' | 'bottom'>('bottom');\n const [style, setStyle] = useState('');\n\n useEffect(() => {\n const triggerEl = getTriggerElement();\n if (!anchor || !triggerEl) {\n return;\n }\n\n let { x, y } = anchor;\n const emptyRect = {\n width: 0, left: 0, height: 0, top: 0,\n };\n\n const menuEl = getMenuElement();\n const rootEl = getRootElement();\n\n const triggerRect = triggerEl.getBoundingClientRect();\n const menuRect = menuEl ? { width: menuEl.offsetWidth, height: menuEl.offsetHeight } : emptyRect;\n const rootRect = rootEl ? rootEl.getBoundingClientRect() : emptyRect;\n\n let horizontalPostition: 'left' | 'right';\n if (x + menuRect.width + extraPaddingX < rootRect.width + rootRect.left) {\n x += 3;\n horizontalPostition = 'left';\n } else if (x - menuRect.width > 0) {\n horizontalPostition = 'right';\n x -= 3;\n } else {\n horizontalPostition = 'left';\n x = 16;\n }\n setPositionX(horizontalPostition);\n\n if (y + menuRect.height < rootRect.height + rootRect.top) {\n setPositionY('top');\n } else {\n setPositionY('bottom');\n\n if (y - menuRect.height < rootRect.top + extraTopPadding) {\n y = rootRect.top + extraTopPadding + menuRect.height;\n }\n }\n\n const left = horizontalPostition === '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\n setStyle(`left: ${left}px; top: ${y - triggerRect.top}px;`);\n }, [\n anchor, extraPaddingX, extraTopPadding,\n getMenuElement, getRootElement, getTriggerElement,\n ]);\n\n return {\n positionX,\n positionY,\n style,\n };\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 {\n useCallback, useEffect, useRef, useState,\n} from '../lib/teact/teact';\n\nimport { register } from '../util/audioPlayer';\nimport useEffectWithPrevDeps from './useEffectWithPrevDeps';\nimport { isSafariPatchInProgress } from '../util/patchSafariProgressiveAudio';\nimport useOnChange from './useOnChange';\n\ntype Handler = (e: Event) => void;\n\nexport default (\n trackId: string,\n originalDuration: number, // Sometimes incorrect for voice messages\n src?: string,\n handlers?: Record,\n onInit?: (element: HTMLAudioElement) => void,\n shouldPlay = false,\n onForcePlay?: NoneToVoidFunction,\n noPlaylist = 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 useOnChange(() => {\n controllerRef.current = register(trackId, (eventName, e) => {\n switch (eventName) {\n case 'onPlay':\n setIsPlaying(true);\n break;\n case 'onPause':\n setIsPlaying(false);\n break;\n case 'onTimeUpdate': {\n const { proxy } = controllerRef.current!;\n const duration = proxy.duration && Number.isFinite(proxy.duration) ? proxy.duration : originalDuration;\n setPlayProgress(proxy.currentTime / duration);\n break;\n }\n }\n\n if (handlers && handlers[eventName]) {\n handlers[eventName](e);\n }\n }, onForcePlay);\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 const {\n play, pause, setCurrentTime, proxy, destroy,\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)) {\n setPlayProgress(proxy.currentTime / duration);\n }\n }, [duration, playProgress, proxy]);\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 playPause = useCallback(() => {\n if (isPlaying) {\n pause();\n } else if (src) {\n play(src);\n }\n }, [src, pause, play, isPlaying]);\n\n return {\n isPlaying: isPlayingSync,\n playProgress,\n playPause,\n setCurrentTime,\n audioProxy: proxy,\n duration,\n };\n};\n","import { IS_SAFARI } from './environment';\nimport safePlay from './safePlay';\nimport { patchSafariProgressiveAudio, isSafariPatchInProgress } from './patchSafariProgressiveAudio';\nimport { getDispatch } from '../lib/teact/teactn';\nimport { parseMessageKey } from '../modules/helpers';\n\ntype Handler = (eventName: string, e: Event) => void;\n\ninterface Track {\n audio: HTMLAudioElement;\n proxy: HTMLAudioElement;\n handlers: Handler[];\n onForcePlay?: NoneToVoidFunction;\n}\n\nconst tracks = new Map();\nlet queue: string[] = [];\n\nlet currentTrackId: string | undefined;\n\nfunction createAudio(trackId: string, onForcePlay?: NoneToVoidFunction) {\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 (isSafariPatchInProgress(audio)) {\n return;\n }\n\n const nextTrackId = queue[queue.indexOf(trackId) + 1];\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(nextTrackId));\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\n return {\n audio,\n proxy: new Proxy(audio, {\n get: (origin, key: keyof HTMLAudioElement) => origin[key],\n }),\n handlers: [],\n onForcePlay,\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(trackId: string, handler: Handler, onForcePlay?: NoneToVoidFunction) {\n if (!tracks.has(trackId)) {\n tracks.set(trackId, createAudio(trackId, onForcePlay));\n\n if (!queue.includes(trackId)) {\n queue.push(trackId);\n }\n }\n\n const { audio, proxy, handlers } = tracks.get(trackId)!;\n\n handlers.push(handler);\n\n return {\n play(src: string) {\n if (currentTrackId && currentTrackId !== trackId) {\n tracks.get(currentTrackId)!.audio.pause();\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 patchSafariProgressiveAudio(audio);\n }\n }\n\n safePlay(audio);\n },\n\n pause() {\n if (currentTrackId === trackId) {\n audio.pause();\n }\n },\n\n setCurrentTime(time: number) {\n if (currentTrackId === trackId) {\n audio.currentTime = time;\n }\n },\n\n proxy,\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 queue = queue.filter((id) => id !== trackId);\n }\n\n if (trackId === currentTrackId) {\n currentTrackId = undefined;\n }\n }\n },\n };\n}\n","export default function download(url: string, filename: string) {\n const link = document.createElement('a');\n link.href = url;\n link.download = filename;\n link.click();\n}\n","import { RefObject } from 'react';\nimport React, { FC, memo, useRef } from '../../lib/teact/teact';\n\nimport useShowTransition from '../../hooks/useShowTransition';\nimport useTransitionForMedia from '../../hooks/useTransitionForMedia';\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 {\n shouldRender: shouldSpinnerRender,\n transitionClassNames: spinnerClassNames,\n } = useShowTransition(isTransferring, undefined, true);\n const color = getColorFromExtension(extension);\n const sizeString = getFileSizeString(size);\n\n const {\n shouldRenderThumb, shouldRenderFullMedia, transitionClassNames,\n } = useTransitionForMedia(previewData, 'slow');\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 {shouldRenderThumb && (\n \n )}\n {shouldRenderFullMedia && (\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)}\n \n )}\n
\n
\n {sender && timestamp && (\n {formatPastTimeShort(lang, timestamp * 1000)}\n )}\n
\n );\n};\n\nexport default memo(File);\n","import React, { useCallback, useEffect, useState } from '../lib/teact/teact';\n\nimport useMediaWithDownloadProgress from './useMediaWithDownloadProgress';\nimport download from '../util/download';\n\nexport default function useMediaDownload(\n mediaHash?: string,\n fileName?: string,\n) {\n const [isDownloadStarted, setIsDownloadStarted] = useState(false);\n\n const { mediaData, downloadProgress } = useMediaWithDownloadProgress(mediaHash, !isDownloadStarted);\n\n // Download with browser when fully loaded\n useEffect(() => {\n if (isDownloadStarted && mediaData) {\n download(mediaData, fileName!);\n setIsDownloadStarted(false);\n }\n }, [fileName, mediaData, isDownloadStarted]);\n\n // Cancel download on source change\n useEffect(() => {\n setIsDownloadStarted(false);\n }, [mediaHash]);\n\n const handleDownloadClick = useCallback((e: React.SyntheticEvent) => {\n e.stopPropagation();\n setIsDownloadStarted((isAllowed) => !isAllowed);\n }, []);\n\n return {\n isDownloadStarted,\n downloadProgress,\n handleDownloadClick,\n };\n}\n","import React, {\n FC,\n memo,\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 { TextPart } from '../common/helpers/renderMessageText';\nimport buildClassName from '../../util/buildClassName';\nimport captureEscKeyListener from '../../util/captureEscKeyListener';\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 memo(Notification);\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 {\n useCallback, useEffect, useMemo, useState,\n} from '../../../../lib/teact/teact';\n\nimport { EDITABLE_INPUT_ID } from '../../../../config';\nimport { MEMO_EMPTY_ARRAY } from '../../../../util/memo';\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 useFlag from '../../../../hooks/useFlag';\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;\nconst RE_BR = /(
|)/g;\nconst RE_SPACE = / /g;\nconst RE_CLEAN_HTML = /(
|<\\/div>)/gi;\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 html: 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\n const [byId, setById] = useState | undefined>();\n const [keywords, setKeywords] = useState();\n const [byKeyword, setByKeyword] = useState>({});\n const [names, setNames] = useState();\n const [byName, setByName] = useState>({});\n const [shouldForceInsertEmoji, setShouldForceInsertEmoji] = useState(false);\n\n const [filteredEmojis, setFilteredEmojis] = useState(MEMO_EMPTY_ARRAY);\n\n const recentEmojis = useMemo(\n () => {\n if (!byId || !recentEmojiIds.length) {\n return [];\n }\n\n return Object.values(pickTruthy(byId, recentEmojiIds));\n },\n [byId, recentEmojiIds],\n );\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 useEffect(() => {\n if (!byId || isDisabled) {\n return;\n }\n\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 setByKeyword({ ...baseEmojisByKeyword, ...emojisByKeyword });\n setKeywords([...Object.keys(baseEmojisByKeyword), ...Object.keys(emojisByKeyword)]);\n\n const emojisByName = 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 setByName(emojisByName);\n setNames(Object.keys(emojisByName));\n }, [isDisabled, baseEmojiKeywords, byId, emojiKeywords]);\n\n useEffect(() => {\n if (!isAllowed || !html || !byId || !keywords || !keywords.length) {\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[] = [];\n\n setShouldForceInsertEmoji(forceSend);\n\n if (!filter) {\n matched = recentEmojis;\n } else if (filter.length >= FILTER_MIN_LENGTH) {\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\n if (matched.length) {\n if (!forceSend) {\n markIsOpen();\n }\n setFilteredEmojis(matched.slice(0, EMOJIS_LIMIT));\n } else {\n unmarkIsOpen();\n }\n }, [\n byId, byKeyword, keywords, byName, names, html, isAllowed, markIsOpen,\n recentEmojis, unmarkIsOpen, setShouldForceInsertEmoji,\n ]);\n\n const insertEmoji = useCallback((textEmoji: string, isForce?: boolean) => {\n const atIndex = html.lastIndexOf(':', isForce ? html.lastIndexOf(':') - 1 : undefined);\n if (atIndex !== -1) {\n onUpdateHtml(`${html.substr(0, atIndex)}${textEmoji}`);\n const messageInput = document.getElementById(inputId)!;\n requestAnimationFrame(() => {\n focusEditableElement(messageInput, true);\n });\n }\n\n unmarkIsOpen();\n }, [html, 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 = html\n .replace(RE_SPACE, ' ')\n .replace(RE_BR, '\\n')\n .replace(RE_CLEAN_HTML, '')\n .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","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 { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { IAnchorPosition, ISettings } from '../../../types';\n\nimport { EDITABLE_INPUT_ID } from '../../../config';\nimport { selectCurrentMessageList, selectReplyingToId } from '../../../modules/selectors';\nimport { debounce } from '../../../util/schedulers';\nimport focusEditableElement from '../../../util/focusEditableElement';\nimport buildClassName from '../../../util/buildClassName';\nimport { pick } from '../../../util/iteratees';\nimport {\n IS_ANDROID, 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 parseEmojiOnlyString from '../../common/helpers/parseEmojiOnlyString';\nimport { isSelectionInsideInput } from './helpers/selection';\nimport useLang from '../../../hooks/useLang';\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 isAttachmentModalInput?: boolean;\n editableInputId?: string;\n html: string;\n placeholder: string;\n forcedPlaceholder?: string;\n shouldSetFocus: boolean;\n shouldSuppressFocus?: boolean;\n shouldSuppressTextFormatter?: boolean;\n onUpdate: (html: string) => void;\n onSuppressedFocus?: () => void;\n onSend: () => void;\n};\n\ntype StateProps = {\n currentChatId?: number;\n replyingToId?: number;\n noTabCapture?: boolean;\n messageSendKeyCombo?: ISettings['messageSendKeyCombo'];\n};\n\ntype DispatchProps = Pick;\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 isAttachmentModalInput,\n editableInputId,\n html,\n placeholder,\n forcedPlaceholder,\n shouldSetFocus,\n shouldSuppressFocus,\n shouldSuppressTextFormatter,\n onUpdate,\n onSuppressedFocus,\n onSend,\n currentChatId,\n replyingToId,\n noTabCapture,\n messageSendKeyCombo,\n editLastMessage,\n replyToNextMessage,\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 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 focusInput = useCallback(() => {\n // Avoid focusing during animation\n if (inputRef.current!.closest('.from, .to')) {\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;\n }\n\n const selection = window.getSelection();\n if (!selection || !selection.rangeCount || isContextMenuOpenRef.current) {\n closeTextFormatter();\n return;\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;\n }\n\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 checkSelection();\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 checkSelection();\n\n e.target.removeEventListener('keyup', handleKeyUp);\n }\n\n if (e.metaKey && !html.length) {\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) {\n e.preventDefault();\n editLastMessage();\n } else {\n e.target.addEventListener('keyup', handleKeyUp);\n }\n }\n\n function handleTouchSelection() {\n if (!IS_ANDROID) {\n return;\n }\n\n checkSelection();\n }\n\n function handleChange(e: ChangeEvent) {\n const { innerHTML, textContent } = e.currentTarget;\n\n onUpdate(innerHTML === SAFARI_BR ? '' : innerHTML);\n\n // Reset focus on the input to remove any active styling when input is cleared\n if (!IS_TOUCH_ENV && (!textContent || !textContent.length)) {\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 (!IS_ANDROID) {\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 focusInput();\n }, [currentChatId, focusInput, replyingToId, shouldSetFocus]);\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): StateProps => {\n const { chatId: currentChatId, threadId } = selectCurrentMessageList(global) || {};\n const { messageSendKeyCombo } = global.settings.byKey;\n\n return {\n currentChatId,\n messageSendKeyCombo,\n replyingToId: currentChatId && threadId ? selectReplyingToId(global, currentChatId, threadId) : undefined,\n noTabCapture: global.isPollModalOpen || global.payment.isPaymentModalOpen,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['editLastMessage', 'replyToNextMessage']),\n)(MessageInput));\n","import React, { FC, memo, useCallback } from '../../lib/teact/teact';\n\nimport { ApiMessage, ApiWebPage } from '../../api/types';\n\nimport { getFirstLinkInMessage, getMessageSummaryText, getMessageWebPage } 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';\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 onMessageClick: (messageId: number, chatId: number) => void;\n};\n\nconst WebLink: FC = ({ message, senderTitle, onMessageClick }) => {\n const lang = useLang();\n\n let linkData: ApiWebPage | undefined = getMessageWebPage(message);\n\n if (!linkData) {\n const link = getFirstLinkInMessage(message);\n if (link) {\n const { url, domain } = link;\n const messageText = getMessageSummaryText(lang, message);\n\n linkData = {\n siteName: domain.replace(/^www./, ''),\n url: url.includes('://') ? url : url.includes('@') ? `mailto:${url}` : `http://${url}`,\n description: messageText !== url ? messageText : undefined,\n } as ApiWebPage;\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 photo,\n video,\n } = linkData;\n\n const truncatedDescription = !senderTitle && 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 && (\n \n {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 { useCallback } from '../../../../lib/teact/teact';\n\nexport enum ChatAnimationTypes {\n Move,\n Opacity,\n None,\n}\n\nexport function useChatAnimationType(orderDiffById: Record) {\n const movesUp = useCallback((id: number) => orderDiffById[id] < 0, [orderDiffById]);\n const movesDown = useCallback((id: number) => orderDiffById[id] > 0, [orderDiffById]);\n\n const orderDiffIds = Object.keys(orderDiffById).map(Number);\n const numberOfUp = orderDiffIds.filter(movesUp).length;\n const numberOfDown = orderDiffIds.filter(movesDown).length;\n\n return useCallback((chatId: number): ChatAnimationTypes => {\n const orderDiff = orderDiffById[chatId];\n\n if (orderDiff === 0) {\n return ChatAnimationTypes.None;\n }\n\n if (\n orderDiff === Infinity\n || orderDiff === -Infinity\n || (movesUp(chatId) && numberOfUp <= numberOfDown)\n || (movesDown(chatId) && numberOfDown < numberOfUp)\n ) {\n return ChatAnimationTypes.Opacity;\n }\n\n return ChatAnimationTypes.Move;\n }, [movesDown, movesUp, numberOfDown, numberOfUp, 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, {\n FC, memo, useCallback, useLayoutEffect, useMemo, useRef,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport useLang, { LangFn } from '../../../hooks/useLang';\n\nimport { GlobalActions } from '../../../global/types';\nimport {\n ApiChat, ApiUser, ApiMessage, ApiMessageOutgoingStatus, ApiFormattedText, MAIN_THREAD_ID,\n} from '../../../api/types';\n\nimport { ANIMATION_END_DELAY } from '../../../config';\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../../util/environment';\nimport {\n getChatTitle,\n isChatPrivate,\n isActionMessage,\n getPrivateChatUserId,\n getMessageAction,\n getMessageSenderName,\n isChatChannel,\n getMessageMediaHash,\n getMessageSummaryText,\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,\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 { pick } from '../../../util/iteratees';\nimport useEnsureMessage from '../../../hooks/useEnsureMessage';\nimport useChatContextActions from '../../../hooks/useChatContextActions';\nimport useFlag from '../../../hooks/useFlag';\nimport useMedia from '../../../hooks/useMedia';\nimport { ChatAnimationTypes } from './hooks';\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';\n\nimport './Chat.scss';\n\ntype OwnProps = {\n style?: string;\n chatId: number;\n folderId?: number;\n orderDiff: number;\n animationType: ChatAnimationTypes;\n isPinned?: boolean;\n};\n\ntype StateProps = {\n chat?: ApiChat;\n isMuted?: boolean;\n privateChatUser?: ApiUser;\n actionTargetUserIds?: number[];\n usersById?: Record;\n actionTargetMessage?: ApiMessage;\n actionTargetChatId?: number;\n lastMessageSender?: ApiUser;\n lastMessageOutgoingStatus?: ApiMessageOutgoingStatus;\n draft?: ApiFormattedText;\n animationLevel?: number;\n isSelected?: boolean;\n canScrollDown?: boolean;\n lastSyncTime?: number;\n};\n\ntype DispatchProps = Pick;\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 privateChatUser,\n actionTargetUserIds,\n usersById,\n lastMessageSender,\n lastMessageOutgoingStatus,\n actionTargetMessage,\n actionTargetChatId,\n draft,\n animationLevel,\n isSelected,\n canScrollDown,\n lastSyncTime,\n openChat,\n focusLastMessage,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const ref = useRef(null);\n\n const [isDeleteModalOpen, openDeleteModal, closeDeleteModal] = useFlag();\n const [shouldRenderDeleteModal, markRenderDeleteModal, unmarkRenderDeleteModal] = 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 return actionTargetUserIds\n ? actionTargetUserIds.map((userId) => usersById && usersById[userId]).filter(Boolean as any)\n : undefined;\n }, [actionTargetUserIds, usersById]);\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 const contextActions = useChatContextActions({\n chat,\n privateChatUser,\n handleDelete,\n folderId,\n isPinned,\n isMuted,\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 && 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 actionOrigin = chat && (isChatChannel(chat) || lastMessage.senderId === lastMessage.chatId)\n ? chat\n : lastMessageSender;\n\n return (\n

\n {renderText(renderActionMessageText(\n lang,\n lastMessage,\n actionOrigin,\n actionTargetUsers,\n actionTargetMessage,\n actionTargetChatId,\n { asPlain: true },\n ) as string)}\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 {renderMessageSummary(lang, lastMessage!, mediaBlobUrl || mediaThumbnail, isRoundVideo)}\n

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

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

\n {chat.isVerified && }\n {isMuted && }\n {chat.lastMessage && (\n \n )}\n
\n
\n {renderLastMessageOrTyping()}\n \n
\n
\n {shouldRenderDeleteModal && (\n \n )}\n \n );\n};\n\nfunction renderMessageSummary(lang: LangFn, message: ApiMessage, blobUrl?: string, isRoundVideo?: boolean) {\n if (!blobUrl) {\n return renderText(getMessageSummaryText(lang, message));\n }\n\n return (\n \n \"\"\n {getMessageVideo(message) && }\n {renderText(getMessageSummaryText(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 { byId: usersById } = global.users;\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 lastSyncTime: global.lastSyncTime,\n ...(isOutgoing && { lastMessageOutgoingStatus: selectOutgoingStatus(global, chat.lastMessage) }),\n ...(privateChatUserId && { privateChatUser: selectUser(global, privateChatUserId) }),\n ...(actionTargetUserIds && { usersById }),\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'openChat',\n 'focusLastMessage',\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, useCallback, useEffect,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport {\n ApiChat, ApiChatFolder, ApiUser,\n} from '../../../api/types';\nimport { NotifyException, NotifySettings, SettingsScreens } from '../../../types';\nimport { FolderEditDispatch } from '../../../hooks/reducers/useFoldersReducer';\n\nimport { ALL_CHATS_PRELOAD_DISABLED, CHAT_HEIGHT_PX, CHAT_LIST_SLICE } from '../../../config';\nimport { IS_ANDROID, IS_MAC_OS, IS_PWA } from '../../../util/environment';\nimport usePrevious from '../../../hooks/usePrevious';\nimport { mapValues, pick } from '../../../util/iteratees';\nimport { getChatOrder, prepareChatList, prepareFolderListIds } from '../../../modules/helpers';\nimport {\n selectChatFolder, selectNotifyExceptions, selectNotifySettings,\n} from '../../../modules/selectors';\nimport useInfiniteScroll from '../../../hooks/useInfiniteScroll';\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 onScreenSelect?: (screen: SettingsScreens) => void;\n foldersDispatch?: FolderEditDispatch;\n};\n\ntype StateProps = {\n chatsById: Record;\n usersById: Record;\n chatFolder?: ApiChatFolder;\n listIds?: number[];\n orderedPinnedIds?: number[];\n lastSyncTime?: number;\n notifySettings: NotifySettings;\n notifyExceptions?: Record;\n};\n\ntype DispatchProps = Pick;\n\nenum FolderTypeToListType {\n 'all' = 'active',\n 'archived' = 'archived'\n}\n\nconst ChatList: FC = ({\n folderType,\n folderId,\n isActive,\n chatFolder,\n chatsById,\n usersById,\n listIds,\n orderedPinnedIds,\n lastSyncTime,\n foldersDispatch,\n notifySettings,\n notifyExceptions,\n onScreenSelect,\n loadMoreChats,\n preloadTopChatMessages,\n openChat,\n openNextChat,\n}) => {\n const [currentListIds, currentPinnedIds] = useMemo(() => {\n return folderType === 'folder' && chatFolder\n ? prepareFolderListIds(chatsById, usersById, chatFolder, notifySettings, notifyExceptions)\n : [listIds, orderedPinnedIds];\n }, [folderType, chatFolder, chatsById, usersById, notifySettings, notifyExceptions, listIds, orderedPinnedIds]);\n\n const [orderById, orderedIds] = useMemo(() => {\n if (!currentListIds || (folderType === 'folder' && !chatFolder)) {\n return [];\n }\n const newChatArrays = prepareChatList(chatsById, currentListIds, currentPinnedIds, folderType);\n const singleList = [...newChatArrays.pinnedChats, ...newChatArrays.otherChats];\n const newOrderedIds = singleList.map(({ id }) => id);\n const newOrderById = singleList.reduce((acc, chat, i) => {\n acc[chat.id] = i;\n return acc;\n }, {} as Record);\n\n return [newOrderById, newOrderedIds];\n }, [currentListIds, currentPinnedIds, folderType, chatFolder, chatsById]);\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 order - (prevOrderById[id] !== undefined ? prevOrderById[id] : Infinity);\n });\n }, [orderById, prevOrderById]);\n\n const loadMoreOfType = useCallback(() => {\n loadMoreChats({ listType: folderType === 'archived' ? 'archived' : 'active' });\n }, [loadMoreChats, folderType]);\n\n const [viewportIds, getMore] = useInfiniteScroll(\n lastSyncTime ? loadMoreOfType : undefined,\n orderedIds,\n undefined,\n CHAT_LIST_SLICE,\n folderType === 'all' && !ALL_CHATS_PRELOAD_DISABLED,\n );\n\n // TODO Refactor to not call `prepareChatList` twice\n const chatArrays = viewportIds && prepareChatList(chatsById, viewportIds, currentPinnedIds, folderType);\n\n useEffect(() => {\n if (lastSyncTime && folderType === 'all') {\n preloadTopChatMessages();\n }\n }, [lastSyncTime, folderType, preloadTopChatMessages]);\n\n const getAnimationType = useChatAnimationType(orderDiffById);\n\n function renderChats() {\n const viewportOffset = orderedIds!.indexOf(viewportIds![0]);\n const pinnedOffset = viewportOffset + chatArrays!.pinnedChats.length;\n\n return (\n \n {chatArrays!.pinnedChats.map(({ id }, i) => (\n \n ))}\n {chatArrays!.otherChats.map((chat, i) => (\n \n ))}\n
\n );\n }\n\n useEffect(() => {\n const handleKeyDown = (e: KeyboardEvent) => {\n if (isActive && orderedIds) {\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\n document.addEventListener('keydown', handleKeyDown, false);\n\n return () => {\n document.removeEventListener('keydown', handleKeyDown, false);\n };\n });\n\n return (\n \n {viewportIds && viewportIds.length && chatArrays ? (\n renderChats()\n ) : viewportIds && !viewportIds.length ? (\n (\n \n )\n ) : (\n \n )}\n \n );\n};\n\nexport default memo(withGlobal(\n (global, { folderType, folderId }): StateProps => {\n const {\n chats: {\n listIds,\n byId: chatsById,\n orderedPinnedIds,\n },\n users: { byId: usersById },\n lastSyncTime,\n } = global;\n const listType = folderType !== 'folder' ? FolderTypeToListType[folderType] : undefined;\n const chatFolder = folderId ? selectChatFolder(global, folderId) : undefined;\n\n return {\n chatsById,\n usersById,\n lastSyncTime,\n notifySettings: selectNotifySettings(global),\n notifyExceptions: selectNotifyExceptions(global),\n ...(listType ? {\n listIds: listIds[listType],\n orderedPinnedIds: orderedPinnedIds[listType],\n } : {\n chatFolder,\n }),\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'loadMoreChats',\n 'preloadTopChatMessages',\n 'openChat',\n 'openNextChat',\n ]),\n)(ChatList));\n","import { ApiUser } from '../../../../api/types';\nimport { getUserFullName } from '../../../../modules/helpers';\nimport searchWords from '../../../../util/searchWords';\n\n// TODO: Support cyrillic translit search\nexport default function searchUserName(filter: string, user: ApiUser) {\n const usernameLowered = user.username.toLowerCase();\n const fullName = getUserFullName(user);\n const fullNameLowered = fullName && fullName.toLowerCase();\n const filterLowered = filter.toLowerCase();\n\n return usernameLowered.startsWith(filterLowered) || (\n fullNameLowered && searchWords(fullNameLowered, filterLowered)\n );\n}\n","import {\n useCallback, useEffect, useState, useMemo,\n} from '../../../../lib/teact/teact';\n\nimport { ApiMessageEntityTypes, ApiChatMember, ApiUser } from '../../../../api/types';\nimport { EDITABLE_INPUT_ID } from '../../../../config';\nimport { getUserFirstOrLastName } from '../../../../modules/helpers';\nimport searchUserName from '../helpers/searchUserName';\nimport focusEditableElement from '../../../../util/focusEditableElement';\nimport useFlag from '../../../../hooks/useFlag';\nimport { unique } from '../../../../util/iteratees';\nimport { throttle } from '../../../../util/schedulers';\n\nconst runThrottled = throttle((cb) => cb(), 500, true);\nconst RE_BR = /(
|)/g;\nconst RE_SPACE = / /g;\nconst RE_CLEAN_HTML = /(
|<\\/div>)/gi;\nconst RE_USERNAME_SEARCH = new RegExp('(^|\\\\s)@[\\\\w\\\\d_-]*$', 'gi');\n\nexport default function useMentionTooltip(\n canSuggestMembers: boolean | undefined,\n html: string,\n onUpdateHtml: (html: string) => void,\n inputId: string = EDITABLE_INPUT_ID,\n groupChatMembers?: ApiChatMember[],\n topInlineBotIds?: number[],\n currentUserId?: number,\n usersById?: Record,\n) {\n const [isOpen, markIsOpen, unmarkIsOpen] = useFlag();\n const [currentFilter, setCurrentFilter] = useState('');\n const [usersToMention, setUsersToMention] = useState();\n\n const topInlineBots = useMemo(() => {\n return (topInlineBotIds || []).map((id) => usersById && usersById[id]).filter(Boolean as any);\n }, [topInlineBotIds, usersById]);\n\n const getFilteredUsers = useCallback((filter, withInlineBots: boolean) => {\n if (!(groupChatMembers || topInlineBotIds) || !usersById) {\n setUsersToMention(undefined);\n\n return;\n }\n runThrottled(() => {\n const inlineBots = (withInlineBots ? topInlineBots : []).filter((inlineBot) => {\n return !filter || searchUserName(filter, inlineBot);\n });\n\n const chatMembers = (groupChatMembers || [])\n .map(({ userId }) => usersById[userId])\n .filter((user) => {\n if (!user || user.id === currentUserId) {\n return false;\n }\n\n return !filter || searchUserName(filter, user);\n });\n\n setUsersToMention(unique(inlineBots.concat(chatMembers)));\n });\n }, [currentUserId, groupChatMembers, topInlineBotIds, topInlineBots, usersById]);\n\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 setCurrentFilter(filter);\n getFilteredUsers(filter, canSuggestInlineBots(html));\n } else {\n unmarkIsOpen();\n }\n }, [canSuggestMembers, html, getFilteredUsers, markIsOpen, unmarkIsOpen]);\n\n useEffect(() => {\n if (usersToMention && 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 atIndex = html.lastIndexOf('@');\n if (atIndex !== -1) {\n onUpdateHtml(`${html.substr(0, atIndex)}${insertedHtml} `);\n const messageInput = document.getElementById(inputId)!;\n requestAnimationFrame(() => {\n focusEditableElement(messageInput, forceFocus);\n });\n }\n\n unmarkIsOpen();\n }, [html, inputId, onUpdateHtml, unmarkIsOpen]);\n\n return {\n isMentionTooltipOpen: isOpen,\n mentionFilter: currentFilter,\n closeMentionTooltip: unmarkIsOpen,\n insertMention,\n mentionFilteredUsers: usersToMention,\n };\n}\n\nfunction getUsernameFilter(html: string) {\n const username = html\n .replace(RE_SPACE, ' ')\n .replace(RE_BR, '\\n')\n .replace(RE_CLEAN_HTML, '')\n .replace(/\\n$/i, '')\n .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 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"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/1.6110220c0cd22a07afe2.js.map b/dist/1.6110220c0cd22a07afe2.js.map deleted file mode 100644 index 6b4b6bea..00000000 --- a/dist/1.6110220c0cd22a07afe2.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":[],"names":[],"mappings":"","file":"1.6110220c0cd22a07afe2.js","sourceRoot":""} \ No newline at end of file diff --git a/dist/1.6110220c0cd22a07afe2.js b/dist/1.f0613d67642ddda53eb4.js similarity index 99% rename from dist/1.6110220c0cd22a07afe2.js rename to dist/1.f0613d67642ddda53eb4.js index 55a836c9..4e790b2f 100644 --- a/dist/1.6110220c0cd22a07afe2.js +++ b/dist/1.f0613d67642ddda53eb4.js @@ -1,2 +1,2 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[1],{331:function(F){F.exports=JSON.parse('[["people",["Smileys & People"]],[["1F600",["grinning"]],["1F603",["smiley"]],["1F604",["smile"]],["1F601",["grin"]],["1F606",["laughing","satisfied"]],["1F605",["sweat_smile"]],["1F923",["rolling_on_the_floor_laughing"]],["1F602",["joy"]],["1F642",["slightly_smiling_face"]],["1F643",["upside_down_face"]],["1F609",["wink"]],["1F60A",["blush"]],["1F607",["innocent"]],["1F970",["smiling_face_with_3_hearts"]],["1F60D",["heart_eyes"]],["1F929",["star-struck","grinning_face_with_star_eyes"]],["1F618",["kissing_heart"]],["1F617",["kissing"]],["263A-FE0F",["relaxed"]],["1F61A",["kissing_closed_eyes"]],["1F619",["kissing_smiling_eyes"]],["1F60B",["yum"]],["1F61B",["stuck_out_tongue"]],["1F61C",["stuck_out_tongue_winking_eye"]],["1F92A",["zany_face","grinning_face_with_one_large_and_one_small_eye"]],["1F61D",["stuck_out_tongue_closed_eyes"]],["1F911",["money_mouth_face"]],["1F917",["hugging_face"]],["1F92D",["face_with_hand_over_mouth","smiling_face_with_smiling_eyes_and_hand_covering_mouth"]],["1F92B",["shushing_face","face_with_finger_covering_closed_lips"]],["1F914",["thinking_face"]],["1F910",["zipper_mouth_face"]],["1F928",["face_with_raised_eyebrow","face_with_one_eyebrow_raised"]],["1F610",["neutral_face"]],["1F611",["expressionless"]],["1F636",["no_mouth"]],["1F60F",["smirk"]],["1F612",["unamused"]],["1F644",["face_with_rolling_eyes"]],["1F62C",["grimacing"]],["1F925",["lying_face"]],["1F60C",["relieved"]],["1F614",["pensive"]],["1F62A",["sleepy"]],["1F924",["drooling_face"]],["1F634",["sleeping"]],["1F637",["mask"]],["1F912",["face_with_thermometer"]],["1F915",["face_with_head_bandage"]],["1F922",["nauseated_face"]],["1F92E",["face_vomiting","face_with_open_mouth_vomiting"]],["1F927",["sneezing_face"]],["1F975",["hot_face"]],["1F976",["cold_face"]],["1F974",["woozy_face"]],["1F635",["dizzy_face"]],["1F92F",["exploding_head","shocked_face_with_exploding_head"]],["1F920",["face_with_cowboy_hat"]],["1F973",["partying_face"]],["1F60E",["sunglasses"]],["1F913",["nerd_face"]],["1F9D0",["face_with_monocle"]],["1F615",["confused"]],["1F61F",["worried"]],["1F641",["slightly_frowning_face"]],["2639-FE0F",["white_frowning_face"]],["1F62E",["open_mouth"]],["1F62F",["hushed"]],["1F632",["astonished"]],["1F633",["flushed"]],["1F97A",["pleading_face"]],["1F626",["frowning"]],["1F627",["anguished"]],["1F628",["fearful"]],["1F630",["cold_sweat"]],["1F625",["disappointed_relieved"]],["1F622",["cry"]],["1F62D",["sob"]],["1F631",["scream"]],["1F616",["confounded"]],["1F623",["persevere"]],["1F61E",["disappointed"]],["1F613",["sweat"]],["1F629",["weary"]],["1F62B",["tired_face"]],["1F971",["yawning_face"]],["1F624",["triumph"]],["1F621",["rage"]],["1F620",["angry"]],["1F92C",["face_with_symbols_on_mouth","serious_face_with_symbols_covering_mouth"]],["1F608",["smiling_imp"]],["1F47F",["imp"]],["1F480",["skull"]],["2620-FE0F",["skull_and_crossbones"]],["1F4A9",["hankey","poop","shit"]],["1F921",["clown_face"]],["1F479",["japanese_ogre"]],["1F47A",["japanese_goblin"]],["1F47B",["ghost"]],["1F47D",["alien"]],["1F47E",["space_invader"]],["1F916",["robot_face"]],["1F63A",["smiley_cat"]],["1F638",["smile_cat"]],["1F639",["joy_cat"]],["1F63B",["heart_eyes_cat"]],["1F63C",["smirk_cat"]],["1F63D",["kissing_cat"]],["1F640",["scream_cat"]],["1F63F",["crying_cat_face"]],["1F63E",["pouting_cat"]],["1F648",["see_no_evil"]],["1F649",["hear_no_evil"]],["1F64A",["speak_no_evil"]],["1F48B",["kiss"]],["1F48C",["love_letter"]],["1F498",["cupid"]],["1F49D",["gift_heart"]],["1F496",["sparkling_heart"]],["1F497",["heartpulse"]],["1F493",["heartbeat"]],["1F49E",["revolving_hearts"]],["1F495",["two_hearts"]],["1F49F",["heart_decoration"]],["2763-FE0F",["heavy_heart_exclamation_mark_ornament"]],["1F494",["broken_heart"]],["2764-FE0F",["heart"]],["1F9E1",["orange_heart"]],["1F49B",["yellow_heart"]],["1F49A",["green_heart"]],["1F499",["blue_heart"]],["1F49C",["purple_heart"]],["1F90E",["brown_heart"]],["1F5A4",["black_heart"]],["1F90D",["white_heart"]],["1F4AF",["100"]],["1F4A2",["anger"]],["1F4A5",["boom","collision"]],["1F4AB",["dizzy"]],["1F4A6",["sweat_drops"]],["1F4A8",["dash"]],["1F573-FE0F",["hole"]],["1F4A3",["bomb"]],["1F4AC",["speech_balloon"]],["1F441-FE0F-200D-1F5E8-FE0F",["eye-in-speech-bubble"]],["1F5E8-FE0F",["left_speech_bubble"]],["1F5EF-FE0F",["right_anger_bubble"]],["1F4AD",["thought_balloon"]],["1F4A4",["zzz"]],["1F44B",["wave"]],["1F91A",["raised_back_of_hand"]],["1F590-FE0F",["raised_hand_with_fingers_splayed"]],["270B",["hand","raised_hand"]],["1F596",["spock-hand"]],["1F44C",["ok_hand"]],["1F90F",["pinching_hand"]],["270C-FE0F",["v"]],["1F91E",["crossed_fingers","hand_with_index_and_middle_fingers_crossed"]],["1F91F",["i_love_you_hand_sign"]],["1F918",["the_horns","sign_of_the_horns"]],["1F919",["call_me_hand"]],["1F448",["point_left"]],["1F449",["point_right"]],["1F446",["point_up_2"]],["1F595",["middle_finger","reversed_hand_with_middle_finger_extended"]],["1F447",["point_down"]],["261D-FE0F",["point_up"]],["1F44D",["+1","thumbsup"]],["1F44E",["-1","thumbsdown"]],["270A",["fist"]],["1F44A",["facepunch","punch"]],["1F91B",["left-facing_fist"]],["1F91C",["right-facing_fist"]],["1F44F",["clap"]],["1F64C",["raised_hands"]],["1F450",["open_hands"]],["1F932",["palms_up_together"]],["1F91D",["handshake"]],["1F64F",["pray"]],["270D-FE0F",["writing_hand"]],["1F485",["nail_care"]],["1F933",["selfie"]],["1F4AA",["muscle"]],["1F9BE",["mechanical_arm"]],["1F9BF",["mechanical_leg"]],["1F9B5",["leg"]],["1F9B6",["foot"]],["1F442",["ear"]],["1F9BB",["ear_with_hearing_aid"]],["1F443",["nose"]],["1F9E0",["brain"]],["1F9B7",["tooth"]],["1F9B4",["bone"]],["1F440",["eyes"]],["1F441-FE0F",["eye"]],["1F445",["tongue"]],["1F444",["lips"]],["1F476",["baby"]],["1F9D2",["child"]],["1F466",["boy"]],["1F467",["girl"]],["1F9D1",["adult"]],["1F471",["person_with_blond_hair"]],["1F468",["man"]],["1F9D4",["bearded_person"]],["1F468-200D-1F9B0",["red_haired_man"]],["1F468-200D-1F9B1",["curly_haired_man"]],["1F468-200D-1F9B3",["white_haired_man"]],["1F468-200D-1F9B2",["bald_man"]],["1F469",["woman"]],["1F469-200D-1F9B0",["red_haired_woman"]],["1F9D1-200D-1F9B0",["red_haired_person"]],["1F469-200D-1F9B1",["curly_haired_woman"]],["1F9D1-200D-1F9B1",["curly_haired_person"]],["1F469-200D-1F9B3",["white_haired_woman"]],["1F9D1-200D-1F9B3",["white_haired_person"]],["1F469-200D-1F9B2",["bald_woman"]],["1F9D1-200D-1F9B2",["bald_person"]],["1F471-200D-2640-FE0F",["blond-haired-woman"]],["1F471-200D-2642-FE0F",["blond-haired-man"]],["1F9D3",["older_adult"]],["1F474",["older_man"]],["1F475",["older_woman"]],["1F64D",["person_frowning"]],["1F64D-200D-2642-FE0F",["man-frowning"]],["1F64D-200D-2640-FE0F",["woman-frowning"]],["1F64E",["person_with_pouting_face"]],["1F64E-200D-2642-FE0F",["man-pouting"]],["1F64E-200D-2640-FE0F",["woman-pouting"]],["1F645",["no_good"]],["1F645-200D-2642-FE0F",["man-gesturing-no"]],["1F645-200D-2640-FE0F",["woman-gesturing-no"]],["1F646",["ok_woman"]],["1F646-200D-2642-FE0F",["man-gesturing-ok"]],["1F646-200D-2640-FE0F",["woman-gesturing-ok"]],["1F481",["information_desk_person"]],["1F481-200D-2642-FE0F",["man-tipping-hand"]],["1F481-200D-2640-FE0F",["woman-tipping-hand"]],["1F64B",["raising_hand"]],["1F64B-200D-2642-FE0F",["man-raising-hand"]],["1F64B-200D-2640-FE0F",["woman-raising-hand"]],["1F9CF",["deaf_person"]],["1F9CF-200D-2642-FE0F",["deaf_man"]],["1F9CF-200D-2640-FE0F",["deaf_woman"]],["1F647",["bow"]],["1F647-200D-2642-FE0F",["man-bowing"]],["1F647-200D-2640-FE0F",["woman-bowing"]],["1F926",["face_palm"]],["1F926-200D-2642-FE0F",["man-facepalming"]],["1F926-200D-2640-FE0F",["woman-facepalming"]],["1F937",["shrug"]],["1F937-200D-2642-FE0F",["man-shrugging"]],["1F937-200D-2640-FE0F",["woman-shrugging"]],["1F9D1-200D-2695-FE0F",["health_worker"]],["1F468-200D-2695-FE0F",["male-doctor"]],["1F469-200D-2695-FE0F",["female-doctor"]],["1F9D1-200D-1F393",["student"]],["1F468-200D-1F393",["male-student"]],["1F469-200D-1F393",["female-student"]],["1F9D1-200D-1F3EB",["teacher"]],["1F468-200D-1F3EB",["male-teacher"]],["1F469-200D-1F3EB",["female-teacher"]],["1F9D1-200D-2696-FE0F",["judge"]],["1F468-200D-2696-FE0F",["male-judge"]],["1F469-200D-2696-FE0F",["female-judge"]],["1F9D1-200D-1F33E",["farmer"]],["1F468-200D-1F33E",["male-farmer"]],["1F469-200D-1F33E",["female-farmer"]],["1F9D1-200D-1F373",["cook"]],["1F468-200D-1F373",["male-cook"]],["1F469-200D-1F373",["female-cook"]],["1F9D1-200D-1F527",["mechanic"]],["1F468-200D-1F527",["male-mechanic"]],["1F469-200D-1F527",["female-mechanic"]],["1F9D1-200D-1F3ED",["factory_worker"]],["1F468-200D-1F3ED",["male-factory-worker"]],["1F469-200D-1F3ED",["female-factory-worker"]],["1F9D1-200D-1F4BC",["office_worker"]],["1F468-200D-1F4BC",["male-office-worker"]],["1F469-200D-1F4BC",["female-office-worker"]],["1F9D1-200D-1F52C",["scientist"]],["1F468-200D-1F52C",["male-scientist"]],["1F469-200D-1F52C",["female-scientist"]],["1F9D1-200D-1F4BB",["technologist"]],["1F468-200D-1F4BB",["male-technologist"]],["1F469-200D-1F4BB",["female-technologist"]],["1F9D1-200D-1F3A4",["singer"]],["1F468-200D-1F3A4",["male-singer"]],["1F469-200D-1F3A4",["female-singer"]],["1F9D1-200D-1F3A8",["artist"]],["1F468-200D-1F3A8",["male-artist"]],["1F469-200D-1F3A8",["female-artist"]],["1F9D1-200D-2708-FE0F",["pilot"]],["1F468-200D-2708-FE0F",["male-pilot"]],["1F469-200D-2708-FE0F",["female-pilot"]],["1F9D1-200D-1F680",["astronaut"]],["1F468-200D-1F680",["male-astronaut"]],["1F469-200D-1F680",["female-astronaut"]],["1F9D1-200D-1F692",["firefighter"]],["1F468-200D-1F692",["male-firefighter"]],["1F469-200D-1F692",["female-firefighter"]],["1F46E",["cop"]],["1F46E-200D-2642-FE0F",["male-police-officer"]],["1F46E-200D-2640-FE0F",["female-police-officer"]],["1F575-FE0F",["sleuth_or_spy"]],["1F575-FE0F-200D-2642-FE0F",["male-detective"]],["1F575-FE0F-200D-2640-FE0F",["female-detective"]],["1F482",["guardsman"]],["1F482-200D-2642-FE0F",["male-guard"]],["1F482-200D-2640-FE0F",["female-guard"]],["1F477",["construction_worker"]],["1F477-200D-2642-FE0F",["male-construction-worker"]],["1F477-200D-2640-FE0F",["female-construction-worker"]],["1F934",["prince"]],["1F478",["princess"]],["1F473",["man_with_turban"]],["1F473-200D-2642-FE0F",["man-wearing-turban"]],["1F473-200D-2640-FE0F",["woman-wearing-turban"]],["1F472",["man_with_gua_pi_mao"]],["1F9D5",["person_with_headscarf"]],["1F935",["man_in_tuxedo"]],["1F470",["bride_with_veil"]],["1F930",["pregnant_woman"]],["1F931",["breast-feeding"]],["1F47C",["angel"]],["1F385",["santa"]],["1F936",["mrs_claus","mother_christmas"]],["1F9B8",["superhero"]],["1F9B8-200D-2642-FE0F",["male_superhero"]],["1F9B8-200D-2640-FE0F",["female_superhero"]],["1F9B9",["supervillain"]],["1F9B9-200D-2642-FE0F",["male_supervillain"]],["1F9B9-200D-2640-FE0F",["female_supervillain"]],["1F9D9",["mage"]],["1F9D9-200D-2642-FE0F",["male_mage"]],["1F9D9-200D-2640-FE0F",["female_mage"]],["1F9DA",["fairy"]],["1F9DA-200D-2642-FE0F",["male_fairy"]],["1F9DA-200D-2640-FE0F",["female_fairy"]],["1F9DB",["vampire"]],["1F9DB-200D-2642-FE0F",["male_vampire"]],["1F9DB-200D-2640-FE0F",["female_vampire"]],["1F9DC",["merperson"]],["1F9DC-200D-2642-FE0F",["merman"]],["1F9DC-200D-2640-FE0F",["mermaid"]],["1F9DD",["elf"]],["1F9DD-200D-2642-FE0F",["male_elf"]],["1F9DD-200D-2640-FE0F",["female_elf"]],["1F9DE",["genie"]],["1F9DE-200D-2642-FE0F",["male_genie"]],["1F9DE-200D-2640-FE0F",["female_genie"]],["1F9DF",["zombie"]],["1F9DF-200D-2642-FE0F",["male_zombie"]],["1F9DF-200D-2640-FE0F",["female_zombie"]],["1F486",["massage"]],["1F486-200D-2642-FE0F",["man-getting-massage"]],["1F486-200D-2640-FE0F",["woman-getting-massage"]],["1F487",["haircut"]],["1F487-200D-2642-FE0F",["man-getting-haircut"]],["1F487-200D-2640-FE0F",["woman-getting-haircut"]],["1F6B6",["walking"]],["1F6B6-200D-2642-FE0F",["man-walking"]],["1F6B6-200D-2640-FE0F",["woman-walking"]],["1F9CD",["standing_person"]],["1F9CD-200D-2642-FE0F",["man_standing"]],["1F9CD-200D-2640-FE0F",["woman_standing"]],["1F9CE",["kneeling_person"]],["1F9CE-200D-2642-FE0F",["man_kneeling"]],["1F9CE-200D-2640-FE0F",["woman_kneeling"]],["1F9D1-200D-1F9AF",["person_with_probing_cane"]],["1F468-200D-1F9AF",["man_with_probing_cane"]],["1F469-200D-1F9AF",["woman_with_probing_cane"]],["1F9D1-200D-1F9BC",["person_in_motorized_wheelchair"]],["1F468-200D-1F9BC",["man_in_motorized_wheelchair"]],["1F469-200D-1F9BC",["woman_in_motorized_wheelchair"]],["1F9D1-200D-1F9BD",["person_in_manual_wheelchair"]],["1F468-200D-1F9BD",["man_in_manual_wheelchair"]],["1F469-200D-1F9BD",["woman_in_manual_wheelchair"]],["1F3C3",["runner","running"]],["1F3C3-200D-2642-FE0F",["man-running"]],["1F3C3-200D-2640-FE0F",["woman-running"]],["1F483",["dancer"]],["1F57A",["man_dancing"]],["1F574-FE0F",["man_in_business_suit_levitating"]],["1F46F",["dancers"]],["1F46F-200D-2642-FE0F",["man-with-bunny-ears-partying"]],["1F46F-200D-2640-FE0F",["woman-with-bunny-ears-partying"]],["1F9D6",["person_in_steamy_room"]],["1F9D6-200D-2642-FE0F",["man_in_steamy_room"]],["1F9D6-200D-2640-FE0F",["woman_in_steamy_room"]],["1F9D7",["person_climbing"]],["1F9D7-200D-2642-FE0F",["man_climbing"]],["1F9D7-200D-2640-FE0F",["woman_climbing"]],["1F93A",["fencer"]],["1F3C7",["horse_racing"]],["26F7-FE0F",["skier"]],["1F3C2",["snowboarder"]],["1F3CC-FE0F",["golfer"]],["1F3CC-FE0F-200D-2642-FE0F",["man-golfing"]],["1F3CC-FE0F-200D-2640-FE0F",["woman-golfing"]],["1F3C4",["surfer"]],["1F3C4-200D-2642-FE0F",["man-surfing"]],["1F3C4-200D-2640-FE0F",["woman-surfing"]],["1F6A3",["rowboat"]],["1F6A3-200D-2642-FE0F",["man-rowing-boat"]],["1F6A3-200D-2640-FE0F",["woman-rowing-boat"]],["1F3CA",["swimmer"]],["1F3CA-200D-2642-FE0F",["man-swimming"]],["1F3CA-200D-2640-FE0F",["woman-swimming"]],["26F9-FE0F",["person_with_ball"]],["26F9-FE0F-200D-2642-FE0F",["man-bouncing-ball"]],["26F9-FE0F-200D-2640-FE0F",["woman-bouncing-ball"]],["1F3CB-FE0F",["weight_lifter"]],["1F3CB-FE0F-200D-2642-FE0F",["man-lifting-weights"]],["1F3CB-FE0F-200D-2640-FE0F",["woman-lifting-weights"]],["1F6B4",["bicyclist"]],["1F6B4-200D-2642-FE0F",["man-biking"]],["1F6B4-200D-2640-FE0F",["woman-biking"]],["1F6B5",["mountain_bicyclist"]],["1F6B5-200D-2642-FE0F",["man-mountain-biking"]],["1F6B5-200D-2640-FE0F",["woman-mountain-biking"]],["1F938",["person_doing_cartwheel"]],["1F938-200D-2642-FE0F",["man-cartwheeling"]],["1F938-200D-2640-FE0F",["woman-cartwheeling"]],["1F93C",["wrestlers"]],["1F93C-200D-2642-FE0F",["man-wrestling"]],["1F93C-200D-2640-FE0F",["woman-wrestling"]],["1F93D",["water_polo"]],["1F93D-200D-2642-FE0F",["man-playing-water-polo"]],["1F93D-200D-2640-FE0F",["woman-playing-water-polo"]],["1F93E",["handball"]],["1F93E-200D-2642-FE0F",["man-playing-handball"]],["1F93E-200D-2640-FE0F",["woman-playing-handball"]],["1F939",["juggling"]],["1F939-200D-2642-FE0F",["man-juggling"]],["1F939-200D-2640-FE0F",["woman-juggling"]],["1F9D8",["person_in_lotus_position"]],["1F9D8-200D-2642-FE0F",["man_in_lotus_position"]],["1F9D8-200D-2640-FE0F",["woman_in_lotus_position"]],["1F6C0",["bath"]],["1F6CC",["sleeping_accommodation"]],["1F9D1-200D-1F91D-200D-1F9D1",["people_holding_hands"]],["1F46D",["two_women_holding_hands","women_holding_hands"]],["1F46B",["couple","man_and_woman_holding_hands","woman_and_man_holding_hands"]],["1F46C",["two_men_holding_hands","men_holding_hands"]],["1F48F",["couplekiss"]],["1F469-200D-2764-FE0F-200D-1F48B-200D-1F468",["woman-kiss-man"]],["1F468-200D-2764-FE0F-200D-1F48B-200D-1F468",["man-kiss-man"]],["1F469-200D-2764-FE0F-200D-1F48B-200D-1F469",["woman-kiss-woman"]],["1F491",["couple_with_heart"]],["1F469-200D-2764-FE0F-200D-1F468",["woman-heart-man"]],["1F468-200D-2764-FE0F-200D-1F468",["man-heart-man"]],["1F469-200D-2764-FE0F-200D-1F469",["woman-heart-woman"]],["1F46A",["family","man-woman-boy"]],["1F468-200D-1F469-200D-1F466",["man-woman-boy","family"]],["1F468-200D-1F469-200D-1F467",["man-woman-girl"]],["1F468-200D-1F469-200D-1F467-200D-1F466",["man-woman-girl-boy"]],["1F468-200D-1F469-200D-1F466-200D-1F466",["man-woman-boy-boy"]],["1F468-200D-1F469-200D-1F467-200D-1F467",["man-woman-girl-girl"]],["1F468-200D-1F468-200D-1F466",["man-man-boy"]],["1F468-200D-1F468-200D-1F467",["man-man-girl"]],["1F468-200D-1F468-200D-1F467-200D-1F466",["man-man-girl-boy"]],["1F468-200D-1F468-200D-1F466-200D-1F466",["man-man-boy-boy"]],["1F468-200D-1F468-200D-1F467-200D-1F467",["man-man-girl-girl"]],["1F469-200D-1F469-200D-1F466",["woman-woman-boy"]],["1F469-200D-1F469-200D-1F467",["woman-woman-girl"]],["1F469-200D-1F469-200D-1F467-200D-1F466",["woman-woman-girl-boy"]],["1F469-200D-1F469-200D-1F466-200D-1F466",["woman-woman-boy-boy"]],["1F469-200D-1F469-200D-1F467-200D-1F467",["woman-woman-girl-girl"]],["1F468-200D-1F466",["man-boy"]],["1F468-200D-1F466-200D-1F466",["man-boy-boy"]],["1F468-200D-1F467",["man-girl"]],["1F468-200D-1F467-200D-1F466",["man-girl-boy"]],["1F468-200D-1F467-200D-1F467",["man-girl-girl"]],["1F469-200D-1F466",["woman-boy"]],["1F469-200D-1F466-200D-1F466",["woman-boy-boy"]],["1F469-200D-1F467",["woman-girl"]],["1F469-200D-1F467-200D-1F466",["woman-girl-boy"]],["1F469-200D-1F467-200D-1F467",["woman-girl-girl"]],["1F5E3-FE0F",["speaking_head_in_silhouette"]],["1F464",["bust_in_silhouette"]],["1F465",["busts_in_silhouette"]],["1F463",["footprints"]]],["nature",["Animals & Nature"]],[["1F435",["monkey_face"]],["1F412",["monkey"]],["1F98D",["gorilla"]],["1F9A7",["orangutan"]],["1F436",["dog"]],["1F415",["dog2"]],["1F9AE",["guide_dog"]],["1F415-200D-1F9BA",["service_dog"]],["1F429",["poodle"]],["1F43A",["wolf"]],["1F98A",["fox_face"]],["1F99D",["raccoon"]],["1F431",["cat"]],["1F408",["cat2"]],["1F981",["lion_face"]],["1F42F",["tiger"]],["1F405",["tiger2"]],["1F406",["leopard"]],["1F434",["horse"]],["1F40E",["racehorse"]],["1F984",["unicorn_face"]],["1F993",["zebra_face"]],["1F98C",["deer"]],["1F42E",["cow"]],["1F402",["ox"]],["1F403",["water_buffalo"]],["1F404",["cow2"]],["1F437",["pig"]],["1F416",["pig2"]],["1F417",["boar"]],["1F43D",["pig_nose"]],["1F40F",["ram"]],["1F411",["sheep"]],["1F410",["goat"]],["1F42A",["dromedary_camel"]],["1F42B",["camel"]],["1F999",["llama"]],["1F992",["giraffe_face"]],["1F418",["elephant"]],["1F98F",["rhinoceros"]],["1F99B",["hippopotamus"]],["1F42D",["mouse"]],["1F401",["mouse2"]],["1F400",["rat"]],["1F439",["hamster"]],["1F430",["rabbit"]],["1F407",["rabbit2"]],["1F43F-FE0F",["chipmunk"]],["1F994",["hedgehog"]],["1F987",["bat"]],["1F43B",["bear"]],["1F428",["koala"]],["1F43C",["panda_face"]],["1F9A5",["sloth"]],["1F9A6",["otter"]],["1F9A8",["skunk"]],["1F998",["kangaroo"]],["1F9A1",["badger"]],["1F43E",["feet","paw_prints"]],["1F983",["turkey"]],["1F414",["chicken"]],["1F413",["rooster"]],["1F423",["hatching_chick"]],["1F424",["baby_chick"]],["1F425",["hatched_chick"]],["1F426",["bird"]],["1F427",["penguin"]],["1F54A-FE0F",["dove_of_peace"]],["1F985",["eagle"]],["1F986",["duck"]],["1F9A2",["swan"]],["1F989",["owl"]],["1F9A9",["flamingo"]],["1F99A",["peacock"]],["1F99C",["parrot"]],["1F438",["frog"]],["1F40A",["crocodile"]],["1F422",["turtle"]],["1F98E",["lizard"]],["1F40D",["snake"]],["1F432",["dragon_face"]],["1F409",["dragon"]],["1F995",["sauropod"]],["1F996",["t-rex"]],["1F433",["whale"]],["1F40B",["whale2"]],["1F42C",["dolphin","flipper"]],["1F41F",["fish"]],["1F420",["tropical_fish"]],["1F421",["blowfish"]],["1F988",["shark"]],["1F419",["octopus"]],["1F41A",["shell"]],["1F40C",["snail"]],["1F98B",["butterfly"]],["1F41B",["bug"]],["1F41C",["ant"]],["1F41D",["bee","honeybee"]],["1F41E",["beetle"]],["1F997",["cricket"]],["1F577-FE0F",["spider"]],["1F578-FE0F",["spider_web"]],["1F982",["scorpion"]],["1F99F",["mosquito"]],["1F9A0",["microbe"]],["1F490",["bouquet"]],["1F338",["cherry_blossom"]],["1F4AE",["white_flower"]],["1F3F5-FE0F",["rosette"]],["1F339",["rose"]],["1F940",["wilted_flower"]],["1F33A",["hibiscus"]],["1F33B",["sunflower"]],["1F33C",["blossom"]],["1F337",["tulip"]],["1F331",["seedling"]],["1F332",["evergreen_tree"]],["1F333",["deciduous_tree"]],["1F334",["palm_tree"]],["1F335",["cactus"]],["1F33E",["ear_of_rice"]],["1F33F",["herb"]],["2618-FE0F",["shamrock"]],["1F340",["four_leaf_clover"]],["1F341",["maple_leaf"]],["1F342",["fallen_leaf"]],["1F343",["leaves"]]],["foods",["Food & Drink"]],[["1F347",["grapes"]],["1F348",["melon"]],["1F349",["watermelon"]],["1F34A",["tangerine"]],["1F34B",["lemon"]],["1F34C",["banana"]],["1F34D",["pineapple"]],["1F96D",["mango"]],["1F34E",["apple"]],["1F34F",["green_apple"]],["1F350",["pear"]],["1F351",["peach"]],["1F352",["cherries"]],["1F353",["strawberry"]],["1F95D",["kiwifruit"]],["1F345",["tomato"]],["1F965",["coconut"]],["1F951",["avocado"]],["1F346",["eggplant"]],["1F954",["potato"]],["1F955",["carrot"]],["1F33D",["corn"]],["1F336-FE0F",["hot_pepper"]],["1F952",["cucumber"]],["1F96C",["leafy_green"]],["1F966",["broccoli"]],["1F9C4",["garlic"]],["1F9C5",["onion"]],["1F344",["mushroom"]],["1F95C",["peanuts"]],["1F330",["chestnut"]],["1F35E",["bread"]],["1F950",["croissant"]],["1F956",["baguette_bread"]],["1F968",["pretzel"]],["1F96F",["bagel"]],["1F95E",["pancakes"]],["1F9C7",["waffle"]],["1F9C0",["cheese_wedge"]],["1F356",["meat_on_bone"]],["1F357",["poultry_leg"]],["1F969",["cut_of_meat"]],["1F953",["bacon"]],["1F354",["hamburger"]],["1F35F",["fries"]],["1F355",["pizza"]],["1F32D",["hotdog"]],["1F96A",["sandwich"]],["1F32E",["taco"]],["1F32F",["burrito"]],["1F959",["stuffed_flatbread"]],["1F9C6",["falafel"]],["1F95A",["egg"]],["1F373",["fried_egg","cooking"]],["1F958",["shallow_pan_of_food"]],["1F372",["stew"]],["1F963",["bowl_with_spoon"]],["1F957",["green_salad"]],["1F37F",["popcorn"]],["1F9C8",["butter"]],["1F9C2",["salt"]],["1F96B",["canned_food"]],["1F371",["bento"]],["1F358",["rice_cracker"]],["1F359",["rice_ball"]],["1F35A",["rice"]],["1F35B",["curry"]],["1F35C",["ramen"]],["1F35D",["spaghetti"]],["1F360",["sweet_potato"]],["1F362",["oden"]],["1F363",["sushi"]],["1F364",["fried_shrimp"]],["1F365",["fish_cake"]],["1F96E",["moon_cake"]],["1F361",["dango"]],["1F95F",["dumpling"]],["1F960",["fortune_cookie"]],["1F961",["takeout_box"]],["1F980",["crab"]],["1F99E",["lobster"]],["1F990",["shrimp"]],["1F991",["squid"]],["1F9AA",["oyster"]],["1F366",["icecream"]],["1F367",["shaved_ice"]],["1F368",["ice_cream"]],["1F369",["doughnut"]],["1F36A",["cookie"]],["1F382",["birthday"]],["1F370",["cake"]],["1F9C1",["cupcake"]],["1F967",["pie"]],["1F36B",["chocolate_bar"]],["1F36C",["candy"]],["1F36D",["lollipop"]],["1F36E",["custard"]],["1F36F",["honey_pot"]],["1F37C",["baby_bottle"]],["1F95B",["glass_of_milk"]],["2615",["coffee"]],["1F375",["tea"]],["1F376",["sake"]],["1F37E",["champagne"]],["1F377",["wine_glass"]],["1F378",["cocktail"]],["1F379",["tropical_drink"]],["1F37A",["beer"]],["1F37B",["beers"]],["1F942",["clinking_glasses"]],["1F943",["tumbler_glass"]],["1F964",["cup_with_straw"]],["1F9C3",["beverage_box"]],["1F9C9",["mate_drink"]],["1F9CA",["ice_cube"]],["1F962",["chopsticks"]],["1F37D-FE0F",["knife_fork_plate"]],["1F374",["fork_and_knife"]],["1F944",["spoon"]],["1F52A",["hocho","knife"]],["1F3FA",["amphora"]]],["activity",["Activities"]],[["1F383",["jack_o_lantern"]],["1F384",["christmas_tree"]],["1F386",["fireworks"]],["1F387",["sparkler"]],["1F9E8",["firecracker"]],["2728",["sparkles"]],["1F388",["balloon"]],["1F389",["tada"]],["1F38A",["confetti_ball"]],["1F38B",["tanabata_tree"]],["1F38D",["bamboo"]],["1F38E",["dolls"]],["1F38F",["flags"]],["1F390",["wind_chime"]],["1F391",["rice_scene"]],["1F9E7",["red_envelope"]],["1F380",["ribbon"]],["1F381",["gift"]],["1F397-FE0F",["reminder_ribbon"]],["1F39F-FE0F",["admission_tickets"]],["1F3AB",["ticket"]],["1F396-FE0F",["medal"]],["1F3C6",["trophy"]],["1F3C5",["sports_medal"]],["1F947",["first_place_medal"]],["1F948",["second_place_medal"]],["1F949",["third_place_medal"]],["26BD",["soccer"]],["26BE",["baseball"]],["1F94E",["softball"]],["1F3C0",["basketball"]],["1F3D0",["volleyball"]],["1F3C8",["football"]],["1F3C9",["rugby_football"]],["1F3BE",["tennis"]],["1F94F",["flying_disc"]],["1F3B3",["bowling"]],["1F3CF",["cricket_bat_and_ball"]],["1F3D1",["field_hockey_stick_and_ball"]],["1F3D2",["ice_hockey_stick_and_puck"]],["1F94D",["lacrosse"]],["1F3D3",["table_tennis_paddle_and_ball"]],["1F3F8",["badminton_racquet_and_shuttlecock"]],["1F94A",["boxing_glove"]],["1F94B",["martial_arts_uniform"]],["1F945",["goal_net"]],["26F3",["golf"]],["26F8-FE0F",["ice_skate"]],["1F3A3",["fishing_pole_and_fish"]],["1F93F",["diving_mask"]],["1F3BD",["running_shirt_with_sash"]],["1F3BF",["ski"]],["1F6F7",["sled"]],["1F94C",["curling_stone"]],["1F3AF",["dart"]],["1FA80",["yo-yo"]],["1FA81",["kite"]],["1F3B1",["8ball"]],["1F52E",["crystal_ball"]],["1F9FF",["nazar_amulet"]],["1F3AE",["video_game"]],["1F579-FE0F",["joystick"]],["1F3B0",["slot_machine"]],["1F3B2",["game_die"]],["1F9E9",["jigsaw"]],["1F9F8",["teddy_bear"]],["2660-FE0F",["spades"]],["2665-FE0F",["hearts"]],["2666-FE0F",["diamonds"]],["2663-FE0F",["clubs"]],["265F-FE0F",["chess_pawn"]],["1F0CF",["black_joker"]],["1F004",["mahjong"]],["1F3B4",["flower_playing_cards"]],["1F3AD",["performing_arts"]],["1F5BC-FE0F",["frame_with_picture"]],["1F3A8",["art"]],["1F9F5",["thread"]],["1F9F6",["yarn"]]],["places",["Travel & Places"]],[["1F30D",["earth_africa"]],["1F30E",["earth_americas"]],["1F30F",["earth_asia"]],["1F310",["globe_with_meridians"]],["1F5FA-FE0F",["world_map"]],["1F5FE",["japan"]],["1F9ED",["compass"]],["1F3D4-FE0F",["snow_capped_mountain"]],["26F0-FE0F",["mountain"]],["1F30B",["volcano"]],["1F5FB",["mount_fuji"]],["1F3D5-FE0F",["camping"]],["1F3D6-FE0F",["beach_with_umbrella"]],["1F3DC-FE0F",["desert"]],["1F3DD-FE0F",["desert_island"]],["1F3DE-FE0F",["national_park"]],["1F3DF-FE0F",["stadium"]],["1F3DB-FE0F",["classical_building"]],["1F3D7-FE0F",["building_construction"]],["1F9F1",["bricks"]],["1F3D8-FE0F",["house_buildings"]],["1F3DA-FE0F",["derelict_house_building"]],["1F3E0",["house"]],["1F3E1",["house_with_garden"]],["1F3E2",["office"]],["1F3E3",["post_office"]],["1F3E4",["european_post_office"]],["1F3E5",["hospital"]],["1F3E6",["bank"]],["1F3E8",["hotel"]],["1F3E9",["love_hotel"]],["1F3EA",["convenience_store"]],["1F3EB",["school"]],["1F3EC",["department_store"]],["1F3ED",["factory"]],["1F3EF",["japanese_castle"]],["1F3F0",["european_castle"]],["1F492",["wedding"]],["1F5FC",["tokyo_tower"]],["1F5FD",["statue_of_liberty"]],["26EA",["church"]],["1F54C",["mosque"]],["1F6D5",["hindu_temple"]],["1F54D",["synagogue"]],["26E9-FE0F",["shinto_shrine"]],["1F54B",["kaaba"]],["26F2",["fountain"]],["26FA",["tent"]],["1F301",["foggy"]],["1F303",["night_with_stars"]],["1F3D9-FE0F",["cityscape"]],["1F304",["sunrise_over_mountains"]],["1F305",["sunrise"]],["1F306",["city_sunset"]],["1F307",["city_sunrise"]],["1F309",["bridge_at_night"]],["2668-FE0F",["hotsprings"]],["1F3A0",["carousel_horse"]],["1F3A1",["ferris_wheel"]],["1F3A2",["roller_coaster"]],["1F488",["barber"]],["1F3AA",["circus_tent"]],["1F682",["steam_locomotive"]],["1F683",["railway_car"]],["1F684",["bullettrain_side"]],["1F685",["bullettrain_front"]],["1F686",["train2"]],["1F687",["metro"]],["1F688",["light_rail"]],["1F689",["station"]],["1F68A",["tram"]],["1F69D",["monorail"]],["1F69E",["mountain_railway"]],["1F68B",["train"]],["1F68C",["bus"]],["1F68D",["oncoming_bus"]],["1F68E",["trolleybus"]],["1F690",["minibus"]],["1F691",["ambulance"]],["1F692",["fire_engine"]],["1F693",["police_car"]],["1F694",["oncoming_police_car"]],["1F695",["taxi"]],["1F696",["oncoming_taxi"]],["1F697",["car","red_car"]],["1F698",["oncoming_automobile"]],["1F699",["blue_car"]],["1F69A",["truck"]],["1F69B",["articulated_lorry"]],["1F69C",["tractor"]],["1F3CE-FE0F",["racing_car"]],["1F3CD-FE0F",["racing_motorcycle"]],["1F6F5",["motor_scooter"]],["1F9BD",["manual_wheelchair"]],["1F9BC",["motorized_wheelchair"]],["1F6FA",["auto_rickshaw"]],["1F6B2",["bike"]],["1F6F4",["scooter"]],["1F6F9",["skateboard"]],["1F68F",["busstop"]],["1F6E3-FE0F",["motorway"]],["1F6E4-FE0F",["railway_track"]],["1F6E2-FE0F",["oil_drum"]],["26FD",["fuelpump"]],["1F6A8",["rotating_light"]],["1F6A5",["traffic_light"]],["1F6A6",["vertical_traffic_light"]],["1F6D1",["octagonal_sign"]],["1F6A7",["construction"]],["2693",["anchor"]],["26F5",["boat","sailboat"]],["1F6F6",["canoe"]],["1F6A4",["speedboat"]],["1F6F3-FE0F",["passenger_ship"]],["26F4-FE0F",["ferry"]],["1F6E5-FE0F",["motor_boat"]],["1F6A2",["ship"]],["2708-FE0F",["airplane"]],["1F6E9-FE0F",["small_airplane"]],["1F6EB",["airplane_departure"]],["1F6EC",["airplane_arriving"]],["1FA82",["parachute"]],["1F4BA",["seat"]],["1F681",["helicopter"]],["1F69F",["suspension_railway"]],["1F6A0",["mountain_cableway"]],["1F6A1",["aerial_tramway"]],["1F6F0-FE0F",["satellite"]],["1F680",["rocket"]],["1F6F8",["flying_saucer"]],["1F6CE-FE0F",["bellhop_bell"]],["1F9F3",["luggage"]],["231B",["hourglass"]],["23F3",["hourglass_flowing_sand"]],["231A",["watch"]],["23F0",["alarm_clock"]],["23F1-FE0F",["stopwatch"]],["23F2-FE0F",["timer_clock"]],["1F570-FE0F",["mantelpiece_clock"]],["1F55B",["clock12"]],["1F567",["clock1230"]],["1F550",["clock1"]],["1F55C",["clock130"]],["1F551",["clock2"]],["1F55D",["clock230"]],["1F552",["clock3"]],["1F55E",["clock330"]],["1F553",["clock4"]],["1F55F",["clock430"]],["1F554",["clock5"]],["1F560",["clock530"]],["1F555",["clock6"]],["1F561",["clock630"]],["1F556",["clock7"]],["1F562",["clock730"]],["1F557",["clock8"]],["1F563",["clock830"]],["1F558",["clock9"]],["1F564",["clock930"]],["1F559",["clock10"]],["1F565",["clock1030"]],["1F55A",["clock11"]],["1F566",["clock1130"]],["1F311",["new_moon"]],["1F312",["waxing_crescent_moon"]],["1F313",["first_quarter_moon"]],["1F314",["moon","waxing_gibbous_moon"]],["1F315",["full_moon"]],["1F316",["waning_gibbous_moon"]],["1F317",["last_quarter_moon"]],["1F318",["waning_crescent_moon"]],["1F319",["crescent_moon"]],["1F31A",["new_moon_with_face"]],["1F31B",["first_quarter_moon_with_face"]],["1F31C",["last_quarter_moon_with_face"]],["1F321-FE0F",["thermometer"]],["2600-FE0F",["sunny"]],["1F31D",["full_moon_with_face"]],["1F31E",["sun_with_face"]],["1FA90",["ringed_planet"]],["2B50",["star"]],["1F31F",["star2"]],["1F320",["stars"]],["1F30C",["milky_way"]],["2601-FE0F",["cloud"]],["26C5",["partly_sunny"]],["26C8-FE0F",["thunder_cloud_and_rain"]],["1F324-FE0F",["mostly_sunny","sun_small_cloud"]],["1F325-FE0F",["barely_sunny","sun_behind_cloud"]],["1F326-FE0F",["partly_sunny_rain","sun_behind_rain_cloud"]],["1F327-FE0F",["rain_cloud"]],["1F328-FE0F",["snow_cloud"]],["1F329-FE0F",["lightning","lightning_cloud"]],["1F32A-FE0F",["tornado","tornado_cloud"]],["1F32B-FE0F",["fog"]],["1F32C-FE0F",["wind_blowing_face"]],["1F300",["cyclone"]],["1F308",["rainbow"]],["1F302",["closed_umbrella"]],["2602-FE0F",["umbrella"]],["2614",["umbrella_with_rain_drops"]],["26F1-FE0F",["umbrella_on_ground"]],["26A1",["zap"]],["2744-FE0F",["snowflake"]],["2603-FE0F",["snowman"]],["26C4",["snowman_without_snow"]],["2604-FE0F",["comet"]],["1F525",["fire"]],["1F4A7",["droplet"]],["1F30A",["ocean"]]],["objects",["Objects"]],[["1F453",["eyeglasses"]],["1F576-FE0F",["dark_sunglasses"]],["1F97D",["goggles"]],["1F97C",["lab_coat"]],["1F9BA",["safety_vest"]],["1F454",["necktie"]],["1F455",["shirt","tshirt"]],["1F456",["jeans"]],["1F9E3",["scarf"]],["1F9E4",["gloves"]],["1F9E5",["coat"]],["1F9E6",["socks"]],["1F457",["dress"]],["1F458",["kimono"]],["1F97B",["sari"]],["1FA71",["one-piece_swimsuit"]],["1FA72",["briefs"]],["1FA73",["shorts"]],["1F459",["bikini"]],["1F45A",["womans_clothes"]],["1F45B",["purse"]],["1F45C",["handbag"]],["1F45D",["pouch"]],["1F6CD-FE0F",["shopping_bags"]],["1F392",["school_satchel"]],["1F45E",["mans_shoe","shoe"]],["1F45F",["athletic_shoe"]],["1F97E",["hiking_boot"]],["1F97F",["womans_flat_shoe"]],["1F460",["high_heel"]],["1F461",["sandal"]],["1FA70",["ballet_shoes"]],["1F462",["boot"]],["1F451",["crown"]],["1F452",["womans_hat"]],["1F3A9",["tophat"]],["1F393",["mortar_board"]],["1F9E2",["billed_cap"]],["26D1-FE0F",["helmet_with_white_cross"]],["1F4FF",["prayer_beads"]],["1F484",["lipstick"]],["1F48D",["ring"]],["1F48E",["gem"]],["1F507",["mute"]],["1F508",["speaker"]],["1F509",["sound"]],["1F50A",["loud_sound"]],["1F4E2",["loudspeaker"]],["1F4E3",["mega"]],["1F4EF",["postal_horn"]],["1F514",["bell"]],["1F515",["no_bell"]],["1F3BC",["musical_score"]],["1F3B5",["musical_note"]],["1F3B6",["notes"]],["1F399-FE0F",["studio_microphone"]],["1F39A-FE0F",["level_slider"]],["1F39B-FE0F",["control_knobs"]],["1F3A4",["microphone"]],["1F3A7",["headphones"]],["1F4FB",["radio"]],["1F3B7",["saxophone"]],["1F3B8",["guitar"]],["1F3B9",["musical_keyboard"]],["1F3BA",["trumpet"]],["1F3BB",["violin"]],["1FA95",["banjo"]],["1F941",["drum_with_drumsticks"]],["1F4F1",["iphone"]],["1F4F2",["calling"]],["260E-FE0F",["phone","telephone"]],["1F4DE",["telephone_receiver"]],["1F4DF",["pager"]],["1F4E0",["fax"]],["1F50B",["battery"]],["1F50C",["electric_plug"]],["1F4BB",["computer"]],["1F5A5-FE0F",["desktop_computer"]],["1F5A8-FE0F",["printer"]],["2328-FE0F",["keyboard"]],["1F5B1-FE0F",["three_button_mouse"]],["1F5B2-FE0F",["trackball"]],["1F4BD",["minidisc"]],["1F4BE",["floppy_disk"]],["1F4BF",["cd"]],["1F4C0",["dvd"]],["1F9EE",["abacus"]],["1F3A5",["movie_camera"]],["1F39E-FE0F",["film_frames"]],["1F4FD-FE0F",["film_projector"]],["1F3AC",["clapper"]],["1F4FA",["tv"]],["1F4F7",["camera"]],["1F4F8",["camera_with_flash"]],["1F4F9",["video_camera"]],["1F4FC",["vhs"]],["1F50D",["mag"]],["1F50E",["mag_right"]],["1F56F-FE0F",["candle"]],["1F4A1",["bulb"]],["1F526",["flashlight"]],["1F3EE",["izakaya_lantern","lantern"]],["1FA94",["diya_lamp"]],["1F4D4",["notebook_with_decorative_cover"]],["1F4D5",["closed_book"]],["1F4D6",["book","open_book"]],["1F4D7",["green_book"]],["1F4D8",["blue_book"]],["1F4D9",["orange_book"]],["1F4DA",["books"]],["1F4D3",["notebook"]],["1F4D2",["ledger"]],["1F4C3",["page_with_curl"]],["1F4DC",["scroll"]],["1F4C4",["page_facing_up"]],["1F4F0",["newspaper"]],["1F5DE-FE0F",["rolled_up_newspaper"]],["1F4D1",["bookmark_tabs"]],["1F516",["bookmark"]],["1F3F7-FE0F",["label"]],["1F4B0",["moneybag"]],["1F4B4",["yen"]],["1F4B5",["dollar"]],["1F4B6",["euro"]],["1F4B7",["pound"]],["1F4B8",["money_with_wings"]],["1F4B3",["credit_card"]],["1F9FE",["receipt"]],["1F4B9",["chart"]],["1F4B1",["currency_exchange"]],["1F4B2",["heavy_dollar_sign"]],["2709-FE0F",["email","envelope"]],["1F4E7",["e-mail"]],["1F4E8",["incoming_envelope"]],["1F4E9",["envelope_with_arrow"]],["1F4E4",["outbox_tray"]],["1F4E5",["inbox_tray"]],["1F4E6",["package"]],["1F4EB",["mailbox"]],["1F4EA",["mailbox_closed"]],["1F4EC",["mailbox_with_mail"]],["1F4ED",["mailbox_with_no_mail"]],["1F4EE",["postbox"]],["1F5F3-FE0F",["ballot_box_with_ballot"]],["270F-FE0F",["pencil2"]],["2712-FE0F",["black_nib"]],["1F58B-FE0F",["lower_left_fountain_pen"]],["1F58A-FE0F",["lower_left_ballpoint_pen"]],["1F58C-FE0F",["lower_left_paintbrush"]],["1F58D-FE0F",["lower_left_crayon"]],["1F4DD",["memo","pencil"]],["1F4BC",["briefcase"]],["1F4C1",["file_folder"]],["1F4C2",["open_file_folder"]],["1F5C2-FE0F",["card_index_dividers"]],["1F4C5",["date"]],["1F4C6",["calendar"]],["1F5D2-FE0F",["spiral_note_pad"]],["1F5D3-FE0F",["spiral_calendar_pad"]],["1F4C7",["card_index"]],["1F4C8",["chart_with_upwards_trend"]],["1F4C9",["chart_with_downwards_trend"]],["1F4CA",["bar_chart"]],["1F4CB",["clipboard"]],["1F4CC",["pushpin"]],["1F4CD",["round_pushpin"]],["1F4CE",["paperclip"]],["1F587-FE0F",["linked_paperclips"]],["1F4CF",["straight_ruler"]],["1F4D0",["triangular_ruler"]],["2702-FE0F",["scissors"]],["1F5C3-FE0F",["card_file_box"]],["1F5C4-FE0F",["file_cabinet"]],["1F5D1-FE0F",["wastebasket"]],["1F512",["lock"]],["1F513",["unlock"]],["1F50F",["lock_with_ink_pen"]],["1F510",["closed_lock_with_key"]],["1F511",["key"]],["1F5DD-FE0F",["old_key"]],["1F528",["hammer"]],["1FA93",["axe"]],["26CF-FE0F",["pick"]],["2692-FE0F",["hammer_and_pick"]],["1F6E0-FE0F",["hammer_and_wrench"]],["1F5E1-FE0F",["dagger_knife"]],["2694-FE0F",["crossed_swords"]],["1F52B",["gun"]],["1F3F9",["bow_and_arrow"]],["1F6E1-FE0F",["shield"]],["1F527",["wrench"]],["1F529",["nut_and_bolt"]],["2699-FE0F",["gear"]],["1F5DC-FE0F",["compression"]],["2696-FE0F",["scales"]],["1F9AF",["probing_cane"]],["1F517",["link"]],["26D3-FE0F",["chains"]],["1F9F0",["toolbox"]],["1F9F2",["magnet"]],["2697-FE0F",["alembic"]],["1F9EA",["test_tube"]],["1F9EB",["petri_dish"]],["1F9EC",["dna"]],["1F52C",["microscope"]],["1F52D",["telescope"]],["1F4E1",["satellite_antenna"]],["1F489",["syringe"]],["1FA78",["drop_of_blood"]],["1F48A",["pill"]],["1FA79",["adhesive_bandage"]],["1FA7A",["stethoscope"]],["1F6AA",["door"]],["1F6CF-FE0F",["bed"]],["1F6CB-FE0F",["couch_and_lamp"]],["1FA91",["chair"]],["1F6BD",["toilet"]],["1F6BF",["shower"]],["1F6C1",["bathtub"]],["1FA92",["razor"]],["1F9F4",["lotion_bottle"]],["1F9F7",["safety_pin"]],["1F9F9",["broom"]],["1F9FA",["basket"]],["1F9FB",["roll_of_paper"]],["1F9FC",["soap"]],["1F9FD",["sponge"]],["1F9EF",["fire_extinguisher"]],["1F6D2",["shopping_trolley"]],["1F6AC",["smoking"]],["26B0-FE0F",["coffin"]],["26B1-FE0F",["funeral_urn"]],["1F5FF",["moyai"]]],["symbols",["Symbols"]],[["1F3E7",["atm"]],["1F6AE",["put_litter_in_its_place"]],["1F6B0",["potable_water"]],["267F",["wheelchair"]],["1F6B9",["mens"]],["1F6BA",["womens"]],["1F6BB",["restroom"]],["1F6BC",["baby_symbol"]],["1F6BE",["wc"]],["1F6C2",["passport_control"]],["1F6C3",["customs"]],["1F6C4",["baggage_claim"]],["1F6C5",["left_luggage"]],["26A0-FE0F",["warning"]],["1F6B8",["children_crossing"]],["26D4",["no_entry"]],["1F6AB",["no_entry_sign"]],["1F6B3",["no_bicycles"]],["1F6AD",["no_smoking"]],["1F6AF",["do_not_litter"]],["1F6B1",["non-potable_water"]],["1F6B7",["no_pedestrians"]],["1F4F5",["no_mobile_phones"]],["1F51E",["underage"]],["2622-FE0F",["radioactive_sign"]],["2623-FE0F",["biohazard_sign"]],["2B06-FE0F",["arrow_up"]],["2197-FE0F",["arrow_upper_right"]],["27A1-FE0F",["arrow_right"]],["2198-FE0F",["arrow_lower_right"]],["2B07-FE0F",["arrow_down"]],["2199-FE0F",["arrow_lower_left"]],["2B05-FE0F",["arrow_left"]],["2196-FE0F",["arrow_upper_left"]],["2195-FE0F",["arrow_up_down"]],["2194-FE0F",["left_right_arrow"]],["21A9-FE0F",["leftwards_arrow_with_hook"]],["21AA-FE0F",["arrow_right_hook"]],["2934-FE0F",["arrow_heading_up"]],["2935-FE0F",["arrow_heading_down"]],["1F503",["arrows_clockwise"]],["1F504",["arrows_counterclockwise"]],["1F519",["back"]],["1F51A",["end"]],["1F51B",["on"]],["1F51C",["soon"]],["1F51D",["top"]],["1F6D0",["place_of_worship"]],["269B-FE0F",["atom_symbol"]],["1F549-FE0F",["om_symbol"]],["2721-FE0F",["star_of_david"]],["2638-FE0F",["wheel_of_dharma"]],["262F-FE0F",["yin_yang"]],["271D-FE0F",["latin_cross"]],["2626-FE0F",["orthodox_cross"]],["262A-FE0F",["star_and_crescent"]],["262E-FE0F",["peace_symbol"]],["1F54E",["menorah_with_nine_branches"]],["1F52F",["six_pointed_star"]],["2648",["aries"]],["2649",["taurus"]],["264A",["gemini"]],["264B",["cancer"]],["264C",["leo"]],["264D",["virgo"]],["264E",["libra"]],["264F",["scorpius"]],["2650",["sagittarius"]],["2651",["capricorn"]],["2652",["aquarius"]],["2653",["pisces"]],["26CE",["ophiuchus"]],["1F500",["twisted_rightwards_arrows"]],["1F501",["repeat"]],["1F502",["repeat_one"]],["25B6-FE0F",["arrow_forward"]],["23E9",["fast_forward"]],["23ED-FE0F",["black_right_pointing_double_triangle_with_vertical_bar"]],["23EF-FE0F",["black_right_pointing_triangle_with_double_vertical_bar"]],["25C0-FE0F",["arrow_backward"]],["23EA",["rewind"]],["23EE-FE0F",["black_left_pointing_double_triangle_with_vertical_bar"]],["1F53C",["arrow_up_small"]],["23EB",["arrow_double_up"]],["1F53D",["arrow_down_small"]],["23EC",["arrow_double_down"]],["23F8-FE0F",["double_vertical_bar"]],["23F9-FE0F",["black_square_for_stop"]],["23FA-FE0F",["black_circle_for_record"]],["23CF-FE0F",["eject"]],["1F3A6",["cinema"]],["1F505",["low_brightness"]],["1F506",["high_brightness"]],["1F4F6",["signal_strength"]],["1F4F3",["vibration_mode"]],["1F4F4",["mobile_phone_off"]],["2640-FE0F",["female_sign"]],["2642-FE0F",["male_sign"]],["2695-FE0F",["medical_symbol","staff_of_aesculapius"]],["267E-FE0F",["infinity"]],["267B-FE0F",["recycle"]],["269C-FE0F",["fleur_de_lis"]],["1F531",["trident"]],["1F4DB",["name_badge"]],["1F530",["beginner"]],["2B55",["o"]],["2705",["white_check_mark"]],["2611-FE0F",["ballot_box_with_check"]],["2714-FE0F",["heavy_check_mark"]],["2716-FE0F",["heavy_multiplication_x"]],["274C",["x"]],["274E",["negative_squared_cross_mark"]],["2795",["heavy_plus_sign"]],["2796",["heavy_minus_sign"]],["2797",["heavy_division_sign"]],["27B0",["curly_loop"]],["27BF",["loop"]],["303D-FE0F",["part_alternation_mark"]],["2733-FE0F",["eight_spoked_asterisk"]],["2734-FE0F",["eight_pointed_black_star"]],["2747-FE0F",["sparkle"]],["203C-FE0F",["bangbang"]],["2049-FE0F",["interrobang"]],["2753",["question"]],["2754",["grey_question"]],["2755",["grey_exclamation"]],["2757",["exclamation","heavy_exclamation_mark"]],["3030-FE0F",["wavy_dash"]],["00A9-FE0F",["copyright"]],["00AE-FE0F",["registered"]],["2122-FE0F",["tm"]],["0023-FE0F-20E3",["hash"]],["002A-FE0F-20E3",["keycap_star"]],["0030-FE0F-20E3",["zero"]],["0031-FE0F-20E3",["one"]],["0032-FE0F-20E3",["two"]],["0033-FE0F-20E3",["three"]],["0034-FE0F-20E3",["four"]],["0035-FE0F-20E3",["five"]],["0036-FE0F-20E3",["six"]],["0037-FE0F-20E3",["seven"]],["0038-FE0F-20E3",["eight"]],["0039-FE0F-20E3",["nine"]],["1F51F",["keycap_ten"]],["1F520",["capital_abcd"]],["1F521",["abcd"]],["1F522",["1234"]],["1F523",["symbols"]],["1F524",["abc"]],["1F170-FE0F",["a"]],["1F18E",["ab"]],["1F171-FE0F",["b"]],["1F191",["cl"]],["1F192",["cool"]],["1F193",["free"]],["2139-FE0F",["information_source"]],["1F194",["id"]],["24C2-FE0F",["m"]],["1F195",["new"]],["1F196",["ng"]],["1F17E-FE0F",["o2"]],["1F197",["ok"]],["1F17F-FE0F",["parking"]],["1F198",["sos"]],["1F199",["up"]],["1F19A",["vs"]],["1F201",["koko"]],["1F202-FE0F",["sa"]],["1F237-FE0F",["u6708"]],["1F236",["u6709"]],["1F22F",["u6307"]],["1F250",["ideograph_advantage"]],["1F239",["u5272"]],["1F21A",["u7121"]],["1F232",["u7981"]],["1F251",["accept"]],["1F238",["u7533"]],["1F234",["u5408"]],["1F233",["u7a7a"]],["3297-FE0F",["congratulations"]],["3299-FE0F",["secret"]],["1F23A",["u55b6"]],["1F235",["u6e80"]],["1F534",["red_circle"]],["1F7E0",["large_orange_circle"]],["1F7E1",["large_yellow_circle"]],["1F7E2",["large_green_circle"]],["1F535",["large_blue_circle"]],["1F7E3",["large_purple_circle"]],["1F7E4",["large_brown_circle"]],["26AB",["black_circle"]],["26AA",["white_circle"]],["1F7E5",["large_red_square"]],["1F7E7",["large_orange_square"]],["1F7E8",["large_yellow_square"]],["1F7E9",["large_green_square"]],["1F7E6",["large_blue_square"]],["1F7EA",["large_purple_square"]],["1F7EB",["large_brown_square"]],["2B1B",["black_large_square"]],["2B1C",["white_large_square"]],["25FC-FE0F",["black_medium_square"]],["25FB-FE0F",["white_medium_square"]],["25FE",["black_medium_small_square"]],["25FD",["white_medium_small_square"]],["25AA-FE0F",["black_small_square"]],["25AB-FE0F",["white_small_square"]],["1F536",["large_orange_diamond"]],["1F537",["large_blue_diamond"]],["1F538",["small_orange_diamond"]],["1F539",["small_blue_diamond"]],["1F53A",["small_red_triangle"]],["1F53B",["small_red_triangle_down"]],["1F4A0",["diamond_shape_with_a_dot_inside"]],["1F518",["radio_button"]],["1F533",["white_square_button"]],["1F532",["black_square_button"]]],["flags",["Flags"]],[["1F3C1",["checkered_flag"]],["1F6A9",["triangular_flag_on_post"]],["1F38C",["crossed_flags"]],["1F3F4",["waving_black_flag"]],["1F3F3-FE0F",["waving_white_flag"]],["1F3F3-FE0F-200D-1F308",["rainbow-flag"]],["1F3F4-200D-2620-FE0F",["pirate_flag"]],["1F1E6-1F1E8",["flag-ac"]],["1F1E6-1F1E9",["flag-ad"]],["1F1E6-1F1EA",["flag-ae"]],["1F1E6-1F1EB",["flag-af"]],["1F1E6-1F1EC",["flag-ag"]],["1F1E6-1F1EE",["flag-ai"]],["1F1E6-1F1F1",["flag-al"]],["1F1E6-1F1F2",["flag-am"]],["1F1E6-1F1F4",["flag-ao"]],["1F1E6-1F1F6",["flag-aq"]],["1F1E6-1F1F7",["flag-ar"]],["1F1E6-1F1F8",["flag-as"]],["1F1E6-1F1F9",["flag-at"]],["1F1E6-1F1FA",["flag-au"]],["1F1E6-1F1FC",["flag-aw"]],["1F1E6-1F1FD",["flag-ax"]],["1F1E6-1F1FF",["flag-az"]],["1F1E7-1F1E6",["flag-ba"]],["1F1E7-1F1E7",["flag-bb"]],["1F1E7-1F1E9",["flag-bd"]],["1F1E7-1F1EA",["flag-be"]],["1F1E7-1F1EB",["flag-bf"]],["1F1E7-1F1EC",["flag-bg"]],["1F1E7-1F1ED",["flag-bh"]],["1F1E7-1F1EE",["flag-bi"]],["1F1E7-1F1EF",["flag-bj"]],["1F1E7-1F1F1",["flag-bl"]],["1F1E7-1F1F2",["flag-bm"]],["1F1E7-1F1F3",["flag-bn"]],["1F1E7-1F1F4",["flag-bo"]],["1F1E7-1F1F6",["flag-bq"]],["1F1E7-1F1F7",["flag-br"]],["1F1E7-1F1F8",["flag-bs"]],["1F1E7-1F1F9",["flag-bt"]],["1F1E7-1F1FB",["flag-bv"]],["1F1E7-1F1FC",["flag-bw"]],["1F1E7-1F1FE",["flag-by"]],["1F1E7-1F1FF",["flag-bz"]],["1F1E8-1F1E6",["flag-ca"]],["1F1E8-1F1E8",["flag-cc"]],["1F1E8-1F1E9",["flag-cd"]],["1F1E8-1F1EB",["flag-cf"]],["1F1E8-1F1EC",["flag-cg"]],["1F1E8-1F1ED",["flag-ch"]],["1F1E8-1F1EE",["flag-ci"]],["1F1E8-1F1F0",["flag-ck"]],["1F1E8-1F1F1",["flag-cl"]],["1F1E8-1F1F2",["flag-cm"]],["1F1E8-1F1F3",["cn","flag-cn"]],["1F1E8-1F1F4",["flag-co"]],["1F1E8-1F1F5",["flag-cp"]],["1F1E8-1F1F7",["flag-cr"]],["1F1E8-1F1FA",["flag-cu"]],["1F1E8-1F1FB",["flag-cv"]],["1F1E8-1F1FC",["flag-cw"]],["1F1E8-1F1FD",["flag-cx"]],["1F1E8-1F1FE",["flag-cy"]],["1F1E8-1F1FF",["flag-cz"]],["1F1E9-1F1EA",["de","flag-de"]],["1F1E9-1F1EC",["flag-dg"]],["1F1E9-1F1EF",["flag-dj"]],["1F1E9-1F1F0",["flag-dk"]],["1F1E9-1F1F2",["flag-dm"]],["1F1E9-1F1F4",["flag-do"]],["1F1E9-1F1FF",["flag-dz"]],["1F1EA-1F1E6",["flag-ea"]],["1F1EA-1F1E8",["flag-ec"]],["1F1EA-1F1EA",["flag-ee"]],["1F1EA-1F1EC",["flag-eg"]],["1F1EA-1F1ED",["flag-eh"]],["1F1EA-1F1F7",["flag-er"]],["1F1EA-1F1F8",["es","flag-es"]],["1F1EA-1F1F9",["flag-et"]],["1F1EA-1F1FA",["flag-eu"]],["1F1EB-1F1EE",["flag-fi"]],["1F1EB-1F1EF",["flag-fj"]],["1F1EB-1F1F0",["flag-fk"]],["1F1EB-1F1F2",["flag-fm"]],["1F1EB-1F1F4",["flag-fo"]],["1F1EB-1F1F7",["fr","flag-fr"]],["1F1EC-1F1E6",["flag-ga"]],["1F1EC-1F1E7",["gb","uk","flag-gb"]],["1F1EC-1F1E9",["flag-gd"]],["1F1EC-1F1EA",["flag-ge"]],["1F1EC-1F1EB",["flag-gf"]],["1F1EC-1F1EC",["flag-gg"]],["1F1EC-1F1ED",["flag-gh"]],["1F1EC-1F1EE",["flag-gi"]],["1F1EC-1F1F1",["flag-gl"]],["1F1EC-1F1F2",["flag-gm"]],["1F1EC-1F1F3",["flag-gn"]],["1F1EC-1F1F5",["flag-gp"]],["1F1EC-1F1F6",["flag-gq"]],["1F1EC-1F1F7",["flag-gr"]],["1F1EC-1F1F8",["flag-gs"]],["1F1EC-1F1F9",["flag-gt"]],["1F1EC-1F1FA",["flag-gu"]],["1F1EC-1F1FC",["flag-gw"]],["1F1EC-1F1FE",["flag-gy"]],["1F1ED-1F1F0",["flag-hk"]],["1F1ED-1F1F2",["flag-hm"]],["1F1ED-1F1F3",["flag-hn"]],["1F1ED-1F1F7",["flag-hr"]],["1F1ED-1F1F9",["flag-ht"]],["1F1ED-1F1FA",["flag-hu"]],["1F1EE-1F1E8",["flag-ic"]],["1F1EE-1F1E9",["flag-id"]],["1F1EE-1F1EA",["flag-ie"]],["1F1EE-1F1F1",["flag-il"]],["1F1EE-1F1F2",["flag-im"]],["1F1EE-1F1F3",["flag-in"]],["1F1EE-1F1F4",["flag-io"]],["1F1EE-1F1F6",["flag-iq"]],["1F1EE-1F1F7",["flag-ir"]],["1F1EE-1F1F8",["flag-is"]],["1F1EE-1F1F9",["it","flag-it"]],["1F1EF-1F1EA",["flag-je"]],["1F1EF-1F1F2",["flag-jm"]],["1F1EF-1F1F4",["flag-jo"]],["1F1EF-1F1F5",["jp","flag-jp"]],["1F1F0-1F1EA",["flag-ke"]],["1F1F0-1F1EC",["flag-kg"]],["1F1F0-1F1ED",["flag-kh"]],["1F1F0-1F1EE",["flag-ki"]],["1F1F0-1F1F2",["flag-km"]],["1F1F0-1F1F3",["flag-kn"]],["1F1F0-1F1F5",["flag-kp"]],["1F1F0-1F1F7",["kr","flag-kr"]],["1F1F0-1F1FC",["flag-kw"]],["1F1F0-1F1FE",["flag-ky"]],["1F1F0-1F1FF",["flag-kz"]],["1F1F1-1F1E6",["flag-la"]],["1F1F1-1F1E7",["flag-lb"]],["1F1F1-1F1E8",["flag-lc"]],["1F1F1-1F1EE",["flag-li"]],["1F1F1-1F1F0",["flag-lk"]],["1F1F1-1F1F7",["flag-lr"]],["1F1F1-1F1F8",["flag-ls"]],["1F1F1-1F1F9",["flag-lt"]],["1F1F1-1F1FA",["flag-lu"]],["1F1F1-1F1FB",["flag-lv"]],["1F1F1-1F1FE",["flag-ly"]],["1F1F2-1F1E6",["flag-ma"]],["1F1F2-1F1E8",["flag-mc"]],["1F1F2-1F1E9",["flag-md"]],["1F1F2-1F1EA",["flag-me"]],["1F1F2-1F1EB",["flag-mf"]],["1F1F2-1F1EC",["flag-mg"]],["1F1F2-1F1ED",["flag-mh"]],["1F1F2-1F1F0",["flag-mk"]],["1F1F2-1F1F1",["flag-ml"]],["1F1F2-1F1F2",["flag-mm"]],["1F1F2-1F1F3",["flag-mn"]],["1F1F2-1F1F4",["flag-mo"]],["1F1F2-1F1F5",["flag-mp"]],["1F1F2-1F1F6",["flag-mq"]],["1F1F2-1F1F7",["flag-mr"]],["1F1F2-1F1F8",["flag-ms"]],["1F1F2-1F1F9",["flag-mt"]],["1F1F2-1F1FA",["flag-mu"]],["1F1F2-1F1FB",["flag-mv"]],["1F1F2-1F1FC",["flag-mw"]],["1F1F2-1F1FD",["flag-mx"]],["1F1F2-1F1FE",["flag-my"]],["1F1F2-1F1FF",["flag-mz"]],["1F1F3-1F1E6",["flag-na"]],["1F1F3-1F1E8",["flag-nc"]],["1F1F3-1F1EA",["flag-ne"]],["1F1F3-1F1EB",["flag-nf"]],["1F1F3-1F1EC",["flag-ng"]],["1F1F3-1F1EE",["flag-ni"]],["1F1F3-1F1F1",["flag-nl"]],["1F1F3-1F1F4",["flag-no"]],["1F1F3-1F1F5",["flag-np"]],["1F1F3-1F1F7",["flag-nr"]],["1F1F3-1F1FA",["flag-nu"]],["1F1F3-1F1FF",["flag-nz"]],["1F1F4-1F1F2",["flag-om"]],["1F1F5-1F1E6",["flag-pa"]],["1F1F5-1F1EA",["flag-pe"]],["1F1F5-1F1EB",["flag-pf"]],["1F1F5-1F1EC",["flag-pg"]],["1F1F5-1F1ED",["flag-ph"]],["1F1F5-1F1F0",["flag-pk"]],["1F1F5-1F1F1",["flag-pl"]],["1F1F5-1F1F2",["flag-pm"]],["1F1F5-1F1F3",["flag-pn"]],["1F1F5-1F1F7",["flag-pr"]],["1F1F5-1F1F8",["flag-ps"]],["1F1F5-1F1F9",["flag-pt"]],["1F1F5-1F1FC",["flag-pw"]],["1F1F5-1F1FE",["flag-py"]],["1F1F6-1F1E6",["flag-qa"]],["1F1F7-1F1EA",["flag-re"]],["1F1F7-1F1F4",["flag-ro"]],["1F1F7-1F1F8",["flag-rs"]],["1F1F7-1F1FA",["ru","flag-ru"]],["1F1F7-1F1FC",["flag-rw"]],["1F1F8-1F1E6",["flag-sa"]],["1F1F8-1F1E7",["flag-sb"]],["1F1F8-1F1E8",["flag-sc"]],["1F1F8-1F1E9",["flag-sd"]],["1F1F8-1F1EA",["flag-se"]],["1F1F8-1F1EC",["flag-sg"]],["1F1F8-1F1ED",["flag-sh"]],["1F1F8-1F1EE",["flag-si"]],["1F1F8-1F1EF",["flag-sj"]],["1F1F8-1F1F0",["flag-sk"]],["1F1F8-1F1F1",["flag-sl"]],["1F1F8-1F1F2",["flag-sm"]],["1F1F8-1F1F3",["flag-sn"]],["1F1F8-1F1F4",["flag-so"]],["1F1F8-1F1F7",["flag-sr"]],["1F1F8-1F1F8",["flag-ss"]],["1F1F8-1F1F9",["flag-st"]],["1F1F8-1F1FB",["flag-sv"]],["1F1F8-1F1FD",["flag-sx"]],["1F1F8-1F1FE",["flag-sy"]],["1F1F8-1F1FF",["flag-sz"]],["1F1F9-1F1E6",["flag-ta"]],["1F1F9-1F1E8",["flag-tc"]],["1F1F9-1F1E9",["flag-td"]],["1F1F9-1F1EB",["flag-tf"]],["1F1F9-1F1EC",["flag-tg"]],["1F1F9-1F1ED",["flag-th"]],["1F1F9-1F1EF",["flag-tj"]],["1F1F9-1F1F0",["flag-tk"]],["1F1F9-1F1F1",["flag-tl"]],["1F1F9-1F1F2",["flag-tm"]],["1F1F9-1F1F3",["flag-tn"]],["1F1F9-1F1F4",["flag-to"]],["1F1F9-1F1F7",["flag-tr"]],["1F1F9-1F1F9",["flag-tt"]],["1F1F9-1F1FB",["flag-tv"]],["1F1F9-1F1FC",["flag-tw"]],["1F1F9-1F1FF",["flag-tz"]],["1F1FA-1F1E6",["flag-ua"]],["1F1FA-1F1EC",["flag-ug"]],["1F1FA-1F1F2",["flag-um"]],["1F1FA-1F1F3",["flag-un"]],["1F1FA-1F1F8",["us","flag-us"]],["1F1FA-1F1FE",["flag-uy"]],["1F1FA-1F1FF",["flag-uz"]],["1F1FB-1F1E6",["flag-va"]],["1F1FB-1F1E8",["flag-vc"]],["1F1FB-1F1EA",["flag-ve"]],["1F1FB-1F1EC",["flag-vg"]],["1F1FB-1F1EE",["flag-vi"]],["1F1FB-1F1F3",["flag-vn"]],["1F1FB-1F1FA",["flag-vu"]],["1F1FC-1F1EB",["flag-wf"]],["1F1FC-1F1F8",["flag-ws"]],["1F1FD-1F1F0",["flag-xk"]],["1F1FE-1F1EA",["flag-ye"]],["1F1FE-1F1F9",["flag-yt"]],["1F1FF-1F1E6",["flag-za"]],["1F1FF-1F1F2",["flag-zm"]],["1F1FF-1F1FC",["flag-zw"]],["1F3F4-E0067-E0062-E0065-E006E-E0067-E007F",["flag-england"]],["1F3F4-E0067-E0062-E0073-E0063-E0074-E007F",["flag-scotland"]],["1F3F4-E0067-E0062-E0077-E006C-E0073-E007F",["flag-wales"]]]]')}}]); -//# sourceMappingURL=1.6110220c0cd22a07afe2.js.map \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[1],{332:function(F){F.exports=JSON.parse('[["people",["Smileys & People"]],[["1F600",["grinning"]],["1F603",["smiley"]],["1F604",["smile"]],["1F601",["grin"]],["1F606",["laughing","satisfied"]],["1F605",["sweat_smile"]],["1F923",["rolling_on_the_floor_laughing"]],["1F602",["joy"]],["1F642",["slightly_smiling_face"]],["1F643",["upside_down_face"]],["1F609",["wink"]],["1F60A",["blush"]],["1F607",["innocent"]],["1F970",["smiling_face_with_3_hearts"]],["1F60D",["heart_eyes"]],["1F929",["star-struck","grinning_face_with_star_eyes"]],["1F618",["kissing_heart"]],["1F617",["kissing"]],["263A-FE0F",["relaxed"]],["1F61A",["kissing_closed_eyes"]],["1F619",["kissing_smiling_eyes"]],["1F60B",["yum"]],["1F61B",["stuck_out_tongue"]],["1F61C",["stuck_out_tongue_winking_eye"]],["1F92A",["zany_face","grinning_face_with_one_large_and_one_small_eye"]],["1F61D",["stuck_out_tongue_closed_eyes"]],["1F911",["money_mouth_face"]],["1F917",["hugging_face"]],["1F92D",["face_with_hand_over_mouth","smiling_face_with_smiling_eyes_and_hand_covering_mouth"]],["1F92B",["shushing_face","face_with_finger_covering_closed_lips"]],["1F914",["thinking_face"]],["1F910",["zipper_mouth_face"]],["1F928",["face_with_raised_eyebrow","face_with_one_eyebrow_raised"]],["1F610",["neutral_face"]],["1F611",["expressionless"]],["1F636",["no_mouth"]],["1F60F",["smirk"]],["1F612",["unamused"]],["1F644",["face_with_rolling_eyes"]],["1F62C",["grimacing"]],["1F925",["lying_face"]],["1F60C",["relieved"]],["1F614",["pensive"]],["1F62A",["sleepy"]],["1F924",["drooling_face"]],["1F634",["sleeping"]],["1F637",["mask"]],["1F912",["face_with_thermometer"]],["1F915",["face_with_head_bandage"]],["1F922",["nauseated_face"]],["1F92E",["face_vomiting","face_with_open_mouth_vomiting"]],["1F927",["sneezing_face"]],["1F975",["hot_face"]],["1F976",["cold_face"]],["1F974",["woozy_face"]],["1F635",["dizzy_face"]],["1F92F",["exploding_head","shocked_face_with_exploding_head"]],["1F920",["face_with_cowboy_hat"]],["1F973",["partying_face"]],["1F60E",["sunglasses"]],["1F913",["nerd_face"]],["1F9D0",["face_with_monocle"]],["1F615",["confused"]],["1F61F",["worried"]],["1F641",["slightly_frowning_face"]],["2639-FE0F",["white_frowning_face"]],["1F62E",["open_mouth"]],["1F62F",["hushed"]],["1F632",["astonished"]],["1F633",["flushed"]],["1F97A",["pleading_face"]],["1F626",["frowning"]],["1F627",["anguished"]],["1F628",["fearful"]],["1F630",["cold_sweat"]],["1F625",["disappointed_relieved"]],["1F622",["cry"]],["1F62D",["sob"]],["1F631",["scream"]],["1F616",["confounded"]],["1F623",["persevere"]],["1F61E",["disappointed"]],["1F613",["sweat"]],["1F629",["weary"]],["1F62B",["tired_face"]],["1F971",["yawning_face"]],["1F624",["triumph"]],["1F621",["rage"]],["1F620",["angry"]],["1F92C",["face_with_symbols_on_mouth","serious_face_with_symbols_covering_mouth"]],["1F608",["smiling_imp"]],["1F47F",["imp"]],["1F480",["skull"]],["2620-FE0F",["skull_and_crossbones"]],["1F4A9",["hankey","poop","shit"]],["1F921",["clown_face"]],["1F479",["japanese_ogre"]],["1F47A",["japanese_goblin"]],["1F47B",["ghost"]],["1F47D",["alien"]],["1F47E",["space_invader"]],["1F916",["robot_face"]],["1F63A",["smiley_cat"]],["1F638",["smile_cat"]],["1F639",["joy_cat"]],["1F63B",["heart_eyes_cat"]],["1F63C",["smirk_cat"]],["1F63D",["kissing_cat"]],["1F640",["scream_cat"]],["1F63F",["crying_cat_face"]],["1F63E",["pouting_cat"]],["1F648",["see_no_evil"]],["1F649",["hear_no_evil"]],["1F64A",["speak_no_evil"]],["1F48B",["kiss"]],["1F48C",["love_letter"]],["1F498",["cupid"]],["1F49D",["gift_heart"]],["1F496",["sparkling_heart"]],["1F497",["heartpulse"]],["1F493",["heartbeat"]],["1F49E",["revolving_hearts"]],["1F495",["two_hearts"]],["1F49F",["heart_decoration"]],["2763-FE0F",["heavy_heart_exclamation_mark_ornament"]],["1F494",["broken_heart"]],["2764-FE0F",["heart"]],["1F9E1",["orange_heart"]],["1F49B",["yellow_heart"]],["1F49A",["green_heart"]],["1F499",["blue_heart"]],["1F49C",["purple_heart"]],["1F90E",["brown_heart"]],["1F5A4",["black_heart"]],["1F90D",["white_heart"]],["1F4AF",["100"]],["1F4A2",["anger"]],["1F4A5",["boom","collision"]],["1F4AB",["dizzy"]],["1F4A6",["sweat_drops"]],["1F4A8",["dash"]],["1F573-FE0F",["hole"]],["1F4A3",["bomb"]],["1F4AC",["speech_balloon"]],["1F441-FE0F-200D-1F5E8-FE0F",["eye-in-speech-bubble"]],["1F5E8-FE0F",["left_speech_bubble"]],["1F5EF-FE0F",["right_anger_bubble"]],["1F4AD",["thought_balloon"]],["1F4A4",["zzz"]],["1F44B",["wave"]],["1F91A",["raised_back_of_hand"]],["1F590-FE0F",["raised_hand_with_fingers_splayed"]],["270B",["hand","raised_hand"]],["1F596",["spock-hand"]],["1F44C",["ok_hand"]],["1F90F",["pinching_hand"]],["270C-FE0F",["v"]],["1F91E",["crossed_fingers","hand_with_index_and_middle_fingers_crossed"]],["1F91F",["i_love_you_hand_sign"]],["1F918",["the_horns","sign_of_the_horns"]],["1F919",["call_me_hand"]],["1F448",["point_left"]],["1F449",["point_right"]],["1F446",["point_up_2"]],["1F595",["middle_finger","reversed_hand_with_middle_finger_extended"]],["1F447",["point_down"]],["261D-FE0F",["point_up"]],["1F44D",["+1","thumbsup"]],["1F44E",["-1","thumbsdown"]],["270A",["fist"]],["1F44A",["facepunch","punch"]],["1F91B",["left-facing_fist"]],["1F91C",["right-facing_fist"]],["1F44F",["clap"]],["1F64C",["raised_hands"]],["1F450",["open_hands"]],["1F932",["palms_up_together"]],["1F91D",["handshake"]],["1F64F",["pray"]],["270D-FE0F",["writing_hand"]],["1F485",["nail_care"]],["1F933",["selfie"]],["1F4AA",["muscle"]],["1F9BE",["mechanical_arm"]],["1F9BF",["mechanical_leg"]],["1F9B5",["leg"]],["1F9B6",["foot"]],["1F442",["ear"]],["1F9BB",["ear_with_hearing_aid"]],["1F443",["nose"]],["1F9E0",["brain"]],["1F9B7",["tooth"]],["1F9B4",["bone"]],["1F440",["eyes"]],["1F441-FE0F",["eye"]],["1F445",["tongue"]],["1F444",["lips"]],["1F476",["baby"]],["1F9D2",["child"]],["1F466",["boy"]],["1F467",["girl"]],["1F9D1",["adult"]],["1F471",["person_with_blond_hair"]],["1F468",["man"]],["1F9D4",["bearded_person"]],["1F468-200D-1F9B0",["red_haired_man"]],["1F468-200D-1F9B1",["curly_haired_man"]],["1F468-200D-1F9B3",["white_haired_man"]],["1F468-200D-1F9B2",["bald_man"]],["1F469",["woman"]],["1F469-200D-1F9B0",["red_haired_woman"]],["1F9D1-200D-1F9B0",["red_haired_person"]],["1F469-200D-1F9B1",["curly_haired_woman"]],["1F9D1-200D-1F9B1",["curly_haired_person"]],["1F469-200D-1F9B3",["white_haired_woman"]],["1F9D1-200D-1F9B3",["white_haired_person"]],["1F469-200D-1F9B2",["bald_woman"]],["1F9D1-200D-1F9B2",["bald_person"]],["1F471-200D-2640-FE0F",["blond-haired-woman"]],["1F471-200D-2642-FE0F",["blond-haired-man"]],["1F9D3",["older_adult"]],["1F474",["older_man"]],["1F475",["older_woman"]],["1F64D",["person_frowning"]],["1F64D-200D-2642-FE0F",["man-frowning"]],["1F64D-200D-2640-FE0F",["woman-frowning"]],["1F64E",["person_with_pouting_face"]],["1F64E-200D-2642-FE0F",["man-pouting"]],["1F64E-200D-2640-FE0F",["woman-pouting"]],["1F645",["no_good"]],["1F645-200D-2642-FE0F",["man-gesturing-no"]],["1F645-200D-2640-FE0F",["woman-gesturing-no"]],["1F646",["ok_woman"]],["1F646-200D-2642-FE0F",["man-gesturing-ok"]],["1F646-200D-2640-FE0F",["woman-gesturing-ok"]],["1F481",["information_desk_person"]],["1F481-200D-2642-FE0F",["man-tipping-hand"]],["1F481-200D-2640-FE0F",["woman-tipping-hand"]],["1F64B",["raising_hand"]],["1F64B-200D-2642-FE0F",["man-raising-hand"]],["1F64B-200D-2640-FE0F",["woman-raising-hand"]],["1F9CF",["deaf_person"]],["1F9CF-200D-2642-FE0F",["deaf_man"]],["1F9CF-200D-2640-FE0F",["deaf_woman"]],["1F647",["bow"]],["1F647-200D-2642-FE0F",["man-bowing"]],["1F647-200D-2640-FE0F",["woman-bowing"]],["1F926",["face_palm"]],["1F926-200D-2642-FE0F",["man-facepalming"]],["1F926-200D-2640-FE0F",["woman-facepalming"]],["1F937",["shrug"]],["1F937-200D-2642-FE0F",["man-shrugging"]],["1F937-200D-2640-FE0F",["woman-shrugging"]],["1F9D1-200D-2695-FE0F",["health_worker"]],["1F468-200D-2695-FE0F",["male-doctor"]],["1F469-200D-2695-FE0F",["female-doctor"]],["1F9D1-200D-1F393",["student"]],["1F468-200D-1F393",["male-student"]],["1F469-200D-1F393",["female-student"]],["1F9D1-200D-1F3EB",["teacher"]],["1F468-200D-1F3EB",["male-teacher"]],["1F469-200D-1F3EB",["female-teacher"]],["1F9D1-200D-2696-FE0F",["judge"]],["1F468-200D-2696-FE0F",["male-judge"]],["1F469-200D-2696-FE0F",["female-judge"]],["1F9D1-200D-1F33E",["farmer"]],["1F468-200D-1F33E",["male-farmer"]],["1F469-200D-1F33E",["female-farmer"]],["1F9D1-200D-1F373",["cook"]],["1F468-200D-1F373",["male-cook"]],["1F469-200D-1F373",["female-cook"]],["1F9D1-200D-1F527",["mechanic"]],["1F468-200D-1F527",["male-mechanic"]],["1F469-200D-1F527",["female-mechanic"]],["1F9D1-200D-1F3ED",["factory_worker"]],["1F468-200D-1F3ED",["male-factory-worker"]],["1F469-200D-1F3ED",["female-factory-worker"]],["1F9D1-200D-1F4BC",["office_worker"]],["1F468-200D-1F4BC",["male-office-worker"]],["1F469-200D-1F4BC",["female-office-worker"]],["1F9D1-200D-1F52C",["scientist"]],["1F468-200D-1F52C",["male-scientist"]],["1F469-200D-1F52C",["female-scientist"]],["1F9D1-200D-1F4BB",["technologist"]],["1F468-200D-1F4BB",["male-technologist"]],["1F469-200D-1F4BB",["female-technologist"]],["1F9D1-200D-1F3A4",["singer"]],["1F468-200D-1F3A4",["male-singer"]],["1F469-200D-1F3A4",["female-singer"]],["1F9D1-200D-1F3A8",["artist"]],["1F468-200D-1F3A8",["male-artist"]],["1F469-200D-1F3A8",["female-artist"]],["1F9D1-200D-2708-FE0F",["pilot"]],["1F468-200D-2708-FE0F",["male-pilot"]],["1F469-200D-2708-FE0F",["female-pilot"]],["1F9D1-200D-1F680",["astronaut"]],["1F468-200D-1F680",["male-astronaut"]],["1F469-200D-1F680",["female-astronaut"]],["1F9D1-200D-1F692",["firefighter"]],["1F468-200D-1F692",["male-firefighter"]],["1F469-200D-1F692",["female-firefighter"]],["1F46E",["cop"]],["1F46E-200D-2642-FE0F",["male-police-officer"]],["1F46E-200D-2640-FE0F",["female-police-officer"]],["1F575-FE0F",["sleuth_or_spy"]],["1F575-FE0F-200D-2642-FE0F",["male-detective"]],["1F575-FE0F-200D-2640-FE0F",["female-detective"]],["1F482",["guardsman"]],["1F482-200D-2642-FE0F",["male-guard"]],["1F482-200D-2640-FE0F",["female-guard"]],["1F477",["construction_worker"]],["1F477-200D-2642-FE0F",["male-construction-worker"]],["1F477-200D-2640-FE0F",["female-construction-worker"]],["1F934",["prince"]],["1F478",["princess"]],["1F473",["man_with_turban"]],["1F473-200D-2642-FE0F",["man-wearing-turban"]],["1F473-200D-2640-FE0F",["woman-wearing-turban"]],["1F472",["man_with_gua_pi_mao"]],["1F9D5",["person_with_headscarf"]],["1F935",["man_in_tuxedo"]],["1F470",["bride_with_veil"]],["1F930",["pregnant_woman"]],["1F931",["breast-feeding"]],["1F47C",["angel"]],["1F385",["santa"]],["1F936",["mrs_claus","mother_christmas"]],["1F9B8",["superhero"]],["1F9B8-200D-2642-FE0F",["male_superhero"]],["1F9B8-200D-2640-FE0F",["female_superhero"]],["1F9B9",["supervillain"]],["1F9B9-200D-2642-FE0F",["male_supervillain"]],["1F9B9-200D-2640-FE0F",["female_supervillain"]],["1F9D9",["mage"]],["1F9D9-200D-2642-FE0F",["male_mage"]],["1F9D9-200D-2640-FE0F",["female_mage"]],["1F9DA",["fairy"]],["1F9DA-200D-2642-FE0F",["male_fairy"]],["1F9DA-200D-2640-FE0F",["female_fairy"]],["1F9DB",["vampire"]],["1F9DB-200D-2642-FE0F",["male_vampire"]],["1F9DB-200D-2640-FE0F",["female_vampire"]],["1F9DC",["merperson"]],["1F9DC-200D-2642-FE0F",["merman"]],["1F9DC-200D-2640-FE0F",["mermaid"]],["1F9DD",["elf"]],["1F9DD-200D-2642-FE0F",["male_elf"]],["1F9DD-200D-2640-FE0F",["female_elf"]],["1F9DE",["genie"]],["1F9DE-200D-2642-FE0F",["male_genie"]],["1F9DE-200D-2640-FE0F",["female_genie"]],["1F9DF",["zombie"]],["1F9DF-200D-2642-FE0F",["male_zombie"]],["1F9DF-200D-2640-FE0F",["female_zombie"]],["1F486",["massage"]],["1F486-200D-2642-FE0F",["man-getting-massage"]],["1F486-200D-2640-FE0F",["woman-getting-massage"]],["1F487",["haircut"]],["1F487-200D-2642-FE0F",["man-getting-haircut"]],["1F487-200D-2640-FE0F",["woman-getting-haircut"]],["1F6B6",["walking"]],["1F6B6-200D-2642-FE0F",["man-walking"]],["1F6B6-200D-2640-FE0F",["woman-walking"]],["1F9CD",["standing_person"]],["1F9CD-200D-2642-FE0F",["man_standing"]],["1F9CD-200D-2640-FE0F",["woman_standing"]],["1F9CE",["kneeling_person"]],["1F9CE-200D-2642-FE0F",["man_kneeling"]],["1F9CE-200D-2640-FE0F",["woman_kneeling"]],["1F9D1-200D-1F9AF",["person_with_probing_cane"]],["1F468-200D-1F9AF",["man_with_probing_cane"]],["1F469-200D-1F9AF",["woman_with_probing_cane"]],["1F9D1-200D-1F9BC",["person_in_motorized_wheelchair"]],["1F468-200D-1F9BC",["man_in_motorized_wheelchair"]],["1F469-200D-1F9BC",["woman_in_motorized_wheelchair"]],["1F9D1-200D-1F9BD",["person_in_manual_wheelchair"]],["1F468-200D-1F9BD",["man_in_manual_wheelchair"]],["1F469-200D-1F9BD",["woman_in_manual_wheelchair"]],["1F3C3",["runner","running"]],["1F3C3-200D-2642-FE0F",["man-running"]],["1F3C3-200D-2640-FE0F",["woman-running"]],["1F483",["dancer"]],["1F57A",["man_dancing"]],["1F574-FE0F",["man_in_business_suit_levitating"]],["1F46F",["dancers"]],["1F46F-200D-2642-FE0F",["man-with-bunny-ears-partying"]],["1F46F-200D-2640-FE0F",["woman-with-bunny-ears-partying"]],["1F9D6",["person_in_steamy_room"]],["1F9D6-200D-2642-FE0F",["man_in_steamy_room"]],["1F9D6-200D-2640-FE0F",["woman_in_steamy_room"]],["1F9D7",["person_climbing"]],["1F9D7-200D-2642-FE0F",["man_climbing"]],["1F9D7-200D-2640-FE0F",["woman_climbing"]],["1F93A",["fencer"]],["1F3C7",["horse_racing"]],["26F7-FE0F",["skier"]],["1F3C2",["snowboarder"]],["1F3CC-FE0F",["golfer"]],["1F3CC-FE0F-200D-2642-FE0F",["man-golfing"]],["1F3CC-FE0F-200D-2640-FE0F",["woman-golfing"]],["1F3C4",["surfer"]],["1F3C4-200D-2642-FE0F",["man-surfing"]],["1F3C4-200D-2640-FE0F",["woman-surfing"]],["1F6A3",["rowboat"]],["1F6A3-200D-2642-FE0F",["man-rowing-boat"]],["1F6A3-200D-2640-FE0F",["woman-rowing-boat"]],["1F3CA",["swimmer"]],["1F3CA-200D-2642-FE0F",["man-swimming"]],["1F3CA-200D-2640-FE0F",["woman-swimming"]],["26F9-FE0F",["person_with_ball"]],["26F9-FE0F-200D-2642-FE0F",["man-bouncing-ball"]],["26F9-FE0F-200D-2640-FE0F",["woman-bouncing-ball"]],["1F3CB-FE0F",["weight_lifter"]],["1F3CB-FE0F-200D-2642-FE0F",["man-lifting-weights"]],["1F3CB-FE0F-200D-2640-FE0F",["woman-lifting-weights"]],["1F6B4",["bicyclist"]],["1F6B4-200D-2642-FE0F",["man-biking"]],["1F6B4-200D-2640-FE0F",["woman-biking"]],["1F6B5",["mountain_bicyclist"]],["1F6B5-200D-2642-FE0F",["man-mountain-biking"]],["1F6B5-200D-2640-FE0F",["woman-mountain-biking"]],["1F938",["person_doing_cartwheel"]],["1F938-200D-2642-FE0F",["man-cartwheeling"]],["1F938-200D-2640-FE0F",["woman-cartwheeling"]],["1F93C",["wrestlers"]],["1F93C-200D-2642-FE0F",["man-wrestling"]],["1F93C-200D-2640-FE0F",["woman-wrestling"]],["1F93D",["water_polo"]],["1F93D-200D-2642-FE0F",["man-playing-water-polo"]],["1F93D-200D-2640-FE0F",["woman-playing-water-polo"]],["1F93E",["handball"]],["1F93E-200D-2642-FE0F",["man-playing-handball"]],["1F93E-200D-2640-FE0F",["woman-playing-handball"]],["1F939",["juggling"]],["1F939-200D-2642-FE0F",["man-juggling"]],["1F939-200D-2640-FE0F",["woman-juggling"]],["1F9D8",["person_in_lotus_position"]],["1F9D8-200D-2642-FE0F",["man_in_lotus_position"]],["1F9D8-200D-2640-FE0F",["woman_in_lotus_position"]],["1F6C0",["bath"]],["1F6CC",["sleeping_accommodation"]],["1F9D1-200D-1F91D-200D-1F9D1",["people_holding_hands"]],["1F46D",["two_women_holding_hands","women_holding_hands"]],["1F46B",["couple","man_and_woman_holding_hands","woman_and_man_holding_hands"]],["1F46C",["two_men_holding_hands","men_holding_hands"]],["1F48F",["couplekiss"]],["1F469-200D-2764-FE0F-200D-1F48B-200D-1F468",["woman-kiss-man"]],["1F468-200D-2764-FE0F-200D-1F48B-200D-1F468",["man-kiss-man"]],["1F469-200D-2764-FE0F-200D-1F48B-200D-1F469",["woman-kiss-woman"]],["1F491",["couple_with_heart"]],["1F469-200D-2764-FE0F-200D-1F468",["woman-heart-man"]],["1F468-200D-2764-FE0F-200D-1F468",["man-heart-man"]],["1F469-200D-2764-FE0F-200D-1F469",["woman-heart-woman"]],["1F46A",["family","man-woman-boy"]],["1F468-200D-1F469-200D-1F466",["man-woman-boy","family"]],["1F468-200D-1F469-200D-1F467",["man-woman-girl"]],["1F468-200D-1F469-200D-1F467-200D-1F466",["man-woman-girl-boy"]],["1F468-200D-1F469-200D-1F466-200D-1F466",["man-woman-boy-boy"]],["1F468-200D-1F469-200D-1F467-200D-1F467",["man-woman-girl-girl"]],["1F468-200D-1F468-200D-1F466",["man-man-boy"]],["1F468-200D-1F468-200D-1F467",["man-man-girl"]],["1F468-200D-1F468-200D-1F467-200D-1F466",["man-man-girl-boy"]],["1F468-200D-1F468-200D-1F466-200D-1F466",["man-man-boy-boy"]],["1F468-200D-1F468-200D-1F467-200D-1F467",["man-man-girl-girl"]],["1F469-200D-1F469-200D-1F466",["woman-woman-boy"]],["1F469-200D-1F469-200D-1F467",["woman-woman-girl"]],["1F469-200D-1F469-200D-1F467-200D-1F466",["woman-woman-girl-boy"]],["1F469-200D-1F469-200D-1F466-200D-1F466",["woman-woman-boy-boy"]],["1F469-200D-1F469-200D-1F467-200D-1F467",["woman-woman-girl-girl"]],["1F468-200D-1F466",["man-boy"]],["1F468-200D-1F466-200D-1F466",["man-boy-boy"]],["1F468-200D-1F467",["man-girl"]],["1F468-200D-1F467-200D-1F466",["man-girl-boy"]],["1F468-200D-1F467-200D-1F467",["man-girl-girl"]],["1F469-200D-1F466",["woman-boy"]],["1F469-200D-1F466-200D-1F466",["woman-boy-boy"]],["1F469-200D-1F467",["woman-girl"]],["1F469-200D-1F467-200D-1F466",["woman-girl-boy"]],["1F469-200D-1F467-200D-1F467",["woman-girl-girl"]],["1F5E3-FE0F",["speaking_head_in_silhouette"]],["1F464",["bust_in_silhouette"]],["1F465",["busts_in_silhouette"]],["1F463",["footprints"]]],["nature",["Animals & Nature"]],[["1F435",["monkey_face"]],["1F412",["monkey"]],["1F98D",["gorilla"]],["1F9A7",["orangutan"]],["1F436",["dog"]],["1F415",["dog2"]],["1F9AE",["guide_dog"]],["1F415-200D-1F9BA",["service_dog"]],["1F429",["poodle"]],["1F43A",["wolf"]],["1F98A",["fox_face"]],["1F99D",["raccoon"]],["1F431",["cat"]],["1F408",["cat2"]],["1F981",["lion_face"]],["1F42F",["tiger"]],["1F405",["tiger2"]],["1F406",["leopard"]],["1F434",["horse"]],["1F40E",["racehorse"]],["1F984",["unicorn_face"]],["1F993",["zebra_face"]],["1F98C",["deer"]],["1F42E",["cow"]],["1F402",["ox"]],["1F403",["water_buffalo"]],["1F404",["cow2"]],["1F437",["pig"]],["1F416",["pig2"]],["1F417",["boar"]],["1F43D",["pig_nose"]],["1F40F",["ram"]],["1F411",["sheep"]],["1F410",["goat"]],["1F42A",["dromedary_camel"]],["1F42B",["camel"]],["1F999",["llama"]],["1F992",["giraffe_face"]],["1F418",["elephant"]],["1F98F",["rhinoceros"]],["1F99B",["hippopotamus"]],["1F42D",["mouse"]],["1F401",["mouse2"]],["1F400",["rat"]],["1F439",["hamster"]],["1F430",["rabbit"]],["1F407",["rabbit2"]],["1F43F-FE0F",["chipmunk"]],["1F994",["hedgehog"]],["1F987",["bat"]],["1F43B",["bear"]],["1F428",["koala"]],["1F43C",["panda_face"]],["1F9A5",["sloth"]],["1F9A6",["otter"]],["1F9A8",["skunk"]],["1F998",["kangaroo"]],["1F9A1",["badger"]],["1F43E",["feet","paw_prints"]],["1F983",["turkey"]],["1F414",["chicken"]],["1F413",["rooster"]],["1F423",["hatching_chick"]],["1F424",["baby_chick"]],["1F425",["hatched_chick"]],["1F426",["bird"]],["1F427",["penguin"]],["1F54A-FE0F",["dove_of_peace"]],["1F985",["eagle"]],["1F986",["duck"]],["1F9A2",["swan"]],["1F989",["owl"]],["1F9A9",["flamingo"]],["1F99A",["peacock"]],["1F99C",["parrot"]],["1F438",["frog"]],["1F40A",["crocodile"]],["1F422",["turtle"]],["1F98E",["lizard"]],["1F40D",["snake"]],["1F432",["dragon_face"]],["1F409",["dragon"]],["1F995",["sauropod"]],["1F996",["t-rex"]],["1F433",["whale"]],["1F40B",["whale2"]],["1F42C",["dolphin","flipper"]],["1F41F",["fish"]],["1F420",["tropical_fish"]],["1F421",["blowfish"]],["1F988",["shark"]],["1F419",["octopus"]],["1F41A",["shell"]],["1F40C",["snail"]],["1F98B",["butterfly"]],["1F41B",["bug"]],["1F41C",["ant"]],["1F41D",["bee","honeybee"]],["1F41E",["beetle"]],["1F997",["cricket"]],["1F577-FE0F",["spider"]],["1F578-FE0F",["spider_web"]],["1F982",["scorpion"]],["1F99F",["mosquito"]],["1F9A0",["microbe"]],["1F490",["bouquet"]],["1F338",["cherry_blossom"]],["1F4AE",["white_flower"]],["1F3F5-FE0F",["rosette"]],["1F339",["rose"]],["1F940",["wilted_flower"]],["1F33A",["hibiscus"]],["1F33B",["sunflower"]],["1F33C",["blossom"]],["1F337",["tulip"]],["1F331",["seedling"]],["1F332",["evergreen_tree"]],["1F333",["deciduous_tree"]],["1F334",["palm_tree"]],["1F335",["cactus"]],["1F33E",["ear_of_rice"]],["1F33F",["herb"]],["2618-FE0F",["shamrock"]],["1F340",["four_leaf_clover"]],["1F341",["maple_leaf"]],["1F342",["fallen_leaf"]],["1F343",["leaves"]]],["foods",["Food & Drink"]],[["1F347",["grapes"]],["1F348",["melon"]],["1F349",["watermelon"]],["1F34A",["tangerine"]],["1F34B",["lemon"]],["1F34C",["banana"]],["1F34D",["pineapple"]],["1F96D",["mango"]],["1F34E",["apple"]],["1F34F",["green_apple"]],["1F350",["pear"]],["1F351",["peach"]],["1F352",["cherries"]],["1F353",["strawberry"]],["1F95D",["kiwifruit"]],["1F345",["tomato"]],["1F965",["coconut"]],["1F951",["avocado"]],["1F346",["eggplant"]],["1F954",["potato"]],["1F955",["carrot"]],["1F33D",["corn"]],["1F336-FE0F",["hot_pepper"]],["1F952",["cucumber"]],["1F96C",["leafy_green"]],["1F966",["broccoli"]],["1F9C4",["garlic"]],["1F9C5",["onion"]],["1F344",["mushroom"]],["1F95C",["peanuts"]],["1F330",["chestnut"]],["1F35E",["bread"]],["1F950",["croissant"]],["1F956",["baguette_bread"]],["1F968",["pretzel"]],["1F96F",["bagel"]],["1F95E",["pancakes"]],["1F9C7",["waffle"]],["1F9C0",["cheese_wedge"]],["1F356",["meat_on_bone"]],["1F357",["poultry_leg"]],["1F969",["cut_of_meat"]],["1F953",["bacon"]],["1F354",["hamburger"]],["1F35F",["fries"]],["1F355",["pizza"]],["1F32D",["hotdog"]],["1F96A",["sandwich"]],["1F32E",["taco"]],["1F32F",["burrito"]],["1F959",["stuffed_flatbread"]],["1F9C6",["falafel"]],["1F95A",["egg"]],["1F373",["fried_egg","cooking"]],["1F958",["shallow_pan_of_food"]],["1F372",["stew"]],["1F963",["bowl_with_spoon"]],["1F957",["green_salad"]],["1F37F",["popcorn"]],["1F9C8",["butter"]],["1F9C2",["salt"]],["1F96B",["canned_food"]],["1F371",["bento"]],["1F358",["rice_cracker"]],["1F359",["rice_ball"]],["1F35A",["rice"]],["1F35B",["curry"]],["1F35C",["ramen"]],["1F35D",["spaghetti"]],["1F360",["sweet_potato"]],["1F362",["oden"]],["1F363",["sushi"]],["1F364",["fried_shrimp"]],["1F365",["fish_cake"]],["1F96E",["moon_cake"]],["1F361",["dango"]],["1F95F",["dumpling"]],["1F960",["fortune_cookie"]],["1F961",["takeout_box"]],["1F980",["crab"]],["1F99E",["lobster"]],["1F990",["shrimp"]],["1F991",["squid"]],["1F9AA",["oyster"]],["1F366",["icecream"]],["1F367",["shaved_ice"]],["1F368",["ice_cream"]],["1F369",["doughnut"]],["1F36A",["cookie"]],["1F382",["birthday"]],["1F370",["cake"]],["1F9C1",["cupcake"]],["1F967",["pie"]],["1F36B",["chocolate_bar"]],["1F36C",["candy"]],["1F36D",["lollipop"]],["1F36E",["custard"]],["1F36F",["honey_pot"]],["1F37C",["baby_bottle"]],["1F95B",["glass_of_milk"]],["2615",["coffee"]],["1F375",["tea"]],["1F376",["sake"]],["1F37E",["champagne"]],["1F377",["wine_glass"]],["1F378",["cocktail"]],["1F379",["tropical_drink"]],["1F37A",["beer"]],["1F37B",["beers"]],["1F942",["clinking_glasses"]],["1F943",["tumbler_glass"]],["1F964",["cup_with_straw"]],["1F9C3",["beverage_box"]],["1F9C9",["mate_drink"]],["1F9CA",["ice_cube"]],["1F962",["chopsticks"]],["1F37D-FE0F",["knife_fork_plate"]],["1F374",["fork_and_knife"]],["1F944",["spoon"]],["1F52A",["hocho","knife"]],["1F3FA",["amphora"]]],["activity",["Activities"]],[["1F383",["jack_o_lantern"]],["1F384",["christmas_tree"]],["1F386",["fireworks"]],["1F387",["sparkler"]],["1F9E8",["firecracker"]],["2728",["sparkles"]],["1F388",["balloon"]],["1F389",["tada"]],["1F38A",["confetti_ball"]],["1F38B",["tanabata_tree"]],["1F38D",["bamboo"]],["1F38E",["dolls"]],["1F38F",["flags"]],["1F390",["wind_chime"]],["1F391",["rice_scene"]],["1F9E7",["red_envelope"]],["1F380",["ribbon"]],["1F381",["gift"]],["1F397-FE0F",["reminder_ribbon"]],["1F39F-FE0F",["admission_tickets"]],["1F3AB",["ticket"]],["1F396-FE0F",["medal"]],["1F3C6",["trophy"]],["1F3C5",["sports_medal"]],["1F947",["first_place_medal"]],["1F948",["second_place_medal"]],["1F949",["third_place_medal"]],["26BD",["soccer"]],["26BE",["baseball"]],["1F94E",["softball"]],["1F3C0",["basketball"]],["1F3D0",["volleyball"]],["1F3C8",["football"]],["1F3C9",["rugby_football"]],["1F3BE",["tennis"]],["1F94F",["flying_disc"]],["1F3B3",["bowling"]],["1F3CF",["cricket_bat_and_ball"]],["1F3D1",["field_hockey_stick_and_ball"]],["1F3D2",["ice_hockey_stick_and_puck"]],["1F94D",["lacrosse"]],["1F3D3",["table_tennis_paddle_and_ball"]],["1F3F8",["badminton_racquet_and_shuttlecock"]],["1F94A",["boxing_glove"]],["1F94B",["martial_arts_uniform"]],["1F945",["goal_net"]],["26F3",["golf"]],["26F8-FE0F",["ice_skate"]],["1F3A3",["fishing_pole_and_fish"]],["1F93F",["diving_mask"]],["1F3BD",["running_shirt_with_sash"]],["1F3BF",["ski"]],["1F6F7",["sled"]],["1F94C",["curling_stone"]],["1F3AF",["dart"]],["1FA80",["yo-yo"]],["1FA81",["kite"]],["1F3B1",["8ball"]],["1F52E",["crystal_ball"]],["1F9FF",["nazar_amulet"]],["1F3AE",["video_game"]],["1F579-FE0F",["joystick"]],["1F3B0",["slot_machine"]],["1F3B2",["game_die"]],["1F9E9",["jigsaw"]],["1F9F8",["teddy_bear"]],["2660-FE0F",["spades"]],["2665-FE0F",["hearts"]],["2666-FE0F",["diamonds"]],["2663-FE0F",["clubs"]],["265F-FE0F",["chess_pawn"]],["1F0CF",["black_joker"]],["1F004",["mahjong"]],["1F3B4",["flower_playing_cards"]],["1F3AD",["performing_arts"]],["1F5BC-FE0F",["frame_with_picture"]],["1F3A8",["art"]],["1F9F5",["thread"]],["1F9F6",["yarn"]]],["places",["Travel & Places"]],[["1F30D",["earth_africa"]],["1F30E",["earth_americas"]],["1F30F",["earth_asia"]],["1F310",["globe_with_meridians"]],["1F5FA-FE0F",["world_map"]],["1F5FE",["japan"]],["1F9ED",["compass"]],["1F3D4-FE0F",["snow_capped_mountain"]],["26F0-FE0F",["mountain"]],["1F30B",["volcano"]],["1F5FB",["mount_fuji"]],["1F3D5-FE0F",["camping"]],["1F3D6-FE0F",["beach_with_umbrella"]],["1F3DC-FE0F",["desert"]],["1F3DD-FE0F",["desert_island"]],["1F3DE-FE0F",["national_park"]],["1F3DF-FE0F",["stadium"]],["1F3DB-FE0F",["classical_building"]],["1F3D7-FE0F",["building_construction"]],["1F9F1",["bricks"]],["1F3D8-FE0F",["house_buildings"]],["1F3DA-FE0F",["derelict_house_building"]],["1F3E0",["house"]],["1F3E1",["house_with_garden"]],["1F3E2",["office"]],["1F3E3",["post_office"]],["1F3E4",["european_post_office"]],["1F3E5",["hospital"]],["1F3E6",["bank"]],["1F3E8",["hotel"]],["1F3E9",["love_hotel"]],["1F3EA",["convenience_store"]],["1F3EB",["school"]],["1F3EC",["department_store"]],["1F3ED",["factory"]],["1F3EF",["japanese_castle"]],["1F3F0",["european_castle"]],["1F492",["wedding"]],["1F5FC",["tokyo_tower"]],["1F5FD",["statue_of_liberty"]],["26EA",["church"]],["1F54C",["mosque"]],["1F6D5",["hindu_temple"]],["1F54D",["synagogue"]],["26E9-FE0F",["shinto_shrine"]],["1F54B",["kaaba"]],["26F2",["fountain"]],["26FA",["tent"]],["1F301",["foggy"]],["1F303",["night_with_stars"]],["1F3D9-FE0F",["cityscape"]],["1F304",["sunrise_over_mountains"]],["1F305",["sunrise"]],["1F306",["city_sunset"]],["1F307",["city_sunrise"]],["1F309",["bridge_at_night"]],["2668-FE0F",["hotsprings"]],["1F3A0",["carousel_horse"]],["1F3A1",["ferris_wheel"]],["1F3A2",["roller_coaster"]],["1F488",["barber"]],["1F3AA",["circus_tent"]],["1F682",["steam_locomotive"]],["1F683",["railway_car"]],["1F684",["bullettrain_side"]],["1F685",["bullettrain_front"]],["1F686",["train2"]],["1F687",["metro"]],["1F688",["light_rail"]],["1F689",["station"]],["1F68A",["tram"]],["1F69D",["monorail"]],["1F69E",["mountain_railway"]],["1F68B",["train"]],["1F68C",["bus"]],["1F68D",["oncoming_bus"]],["1F68E",["trolleybus"]],["1F690",["minibus"]],["1F691",["ambulance"]],["1F692",["fire_engine"]],["1F693",["police_car"]],["1F694",["oncoming_police_car"]],["1F695",["taxi"]],["1F696",["oncoming_taxi"]],["1F697",["car","red_car"]],["1F698",["oncoming_automobile"]],["1F699",["blue_car"]],["1F69A",["truck"]],["1F69B",["articulated_lorry"]],["1F69C",["tractor"]],["1F3CE-FE0F",["racing_car"]],["1F3CD-FE0F",["racing_motorcycle"]],["1F6F5",["motor_scooter"]],["1F9BD",["manual_wheelchair"]],["1F9BC",["motorized_wheelchair"]],["1F6FA",["auto_rickshaw"]],["1F6B2",["bike"]],["1F6F4",["scooter"]],["1F6F9",["skateboard"]],["1F68F",["busstop"]],["1F6E3-FE0F",["motorway"]],["1F6E4-FE0F",["railway_track"]],["1F6E2-FE0F",["oil_drum"]],["26FD",["fuelpump"]],["1F6A8",["rotating_light"]],["1F6A5",["traffic_light"]],["1F6A6",["vertical_traffic_light"]],["1F6D1",["octagonal_sign"]],["1F6A7",["construction"]],["2693",["anchor"]],["26F5",["boat","sailboat"]],["1F6F6",["canoe"]],["1F6A4",["speedboat"]],["1F6F3-FE0F",["passenger_ship"]],["26F4-FE0F",["ferry"]],["1F6E5-FE0F",["motor_boat"]],["1F6A2",["ship"]],["2708-FE0F",["airplane"]],["1F6E9-FE0F",["small_airplane"]],["1F6EB",["airplane_departure"]],["1F6EC",["airplane_arriving"]],["1FA82",["parachute"]],["1F4BA",["seat"]],["1F681",["helicopter"]],["1F69F",["suspension_railway"]],["1F6A0",["mountain_cableway"]],["1F6A1",["aerial_tramway"]],["1F6F0-FE0F",["satellite"]],["1F680",["rocket"]],["1F6F8",["flying_saucer"]],["1F6CE-FE0F",["bellhop_bell"]],["1F9F3",["luggage"]],["231B",["hourglass"]],["23F3",["hourglass_flowing_sand"]],["231A",["watch"]],["23F0",["alarm_clock"]],["23F1-FE0F",["stopwatch"]],["23F2-FE0F",["timer_clock"]],["1F570-FE0F",["mantelpiece_clock"]],["1F55B",["clock12"]],["1F567",["clock1230"]],["1F550",["clock1"]],["1F55C",["clock130"]],["1F551",["clock2"]],["1F55D",["clock230"]],["1F552",["clock3"]],["1F55E",["clock330"]],["1F553",["clock4"]],["1F55F",["clock430"]],["1F554",["clock5"]],["1F560",["clock530"]],["1F555",["clock6"]],["1F561",["clock630"]],["1F556",["clock7"]],["1F562",["clock730"]],["1F557",["clock8"]],["1F563",["clock830"]],["1F558",["clock9"]],["1F564",["clock930"]],["1F559",["clock10"]],["1F565",["clock1030"]],["1F55A",["clock11"]],["1F566",["clock1130"]],["1F311",["new_moon"]],["1F312",["waxing_crescent_moon"]],["1F313",["first_quarter_moon"]],["1F314",["moon","waxing_gibbous_moon"]],["1F315",["full_moon"]],["1F316",["waning_gibbous_moon"]],["1F317",["last_quarter_moon"]],["1F318",["waning_crescent_moon"]],["1F319",["crescent_moon"]],["1F31A",["new_moon_with_face"]],["1F31B",["first_quarter_moon_with_face"]],["1F31C",["last_quarter_moon_with_face"]],["1F321-FE0F",["thermometer"]],["2600-FE0F",["sunny"]],["1F31D",["full_moon_with_face"]],["1F31E",["sun_with_face"]],["1FA90",["ringed_planet"]],["2B50",["star"]],["1F31F",["star2"]],["1F320",["stars"]],["1F30C",["milky_way"]],["2601-FE0F",["cloud"]],["26C5",["partly_sunny"]],["26C8-FE0F",["thunder_cloud_and_rain"]],["1F324-FE0F",["mostly_sunny","sun_small_cloud"]],["1F325-FE0F",["barely_sunny","sun_behind_cloud"]],["1F326-FE0F",["partly_sunny_rain","sun_behind_rain_cloud"]],["1F327-FE0F",["rain_cloud"]],["1F328-FE0F",["snow_cloud"]],["1F329-FE0F",["lightning","lightning_cloud"]],["1F32A-FE0F",["tornado","tornado_cloud"]],["1F32B-FE0F",["fog"]],["1F32C-FE0F",["wind_blowing_face"]],["1F300",["cyclone"]],["1F308",["rainbow"]],["1F302",["closed_umbrella"]],["2602-FE0F",["umbrella"]],["2614",["umbrella_with_rain_drops"]],["26F1-FE0F",["umbrella_on_ground"]],["26A1",["zap"]],["2744-FE0F",["snowflake"]],["2603-FE0F",["snowman"]],["26C4",["snowman_without_snow"]],["2604-FE0F",["comet"]],["1F525",["fire"]],["1F4A7",["droplet"]],["1F30A",["ocean"]]],["objects",["Objects"]],[["1F453",["eyeglasses"]],["1F576-FE0F",["dark_sunglasses"]],["1F97D",["goggles"]],["1F97C",["lab_coat"]],["1F9BA",["safety_vest"]],["1F454",["necktie"]],["1F455",["shirt","tshirt"]],["1F456",["jeans"]],["1F9E3",["scarf"]],["1F9E4",["gloves"]],["1F9E5",["coat"]],["1F9E6",["socks"]],["1F457",["dress"]],["1F458",["kimono"]],["1F97B",["sari"]],["1FA71",["one-piece_swimsuit"]],["1FA72",["briefs"]],["1FA73",["shorts"]],["1F459",["bikini"]],["1F45A",["womans_clothes"]],["1F45B",["purse"]],["1F45C",["handbag"]],["1F45D",["pouch"]],["1F6CD-FE0F",["shopping_bags"]],["1F392",["school_satchel"]],["1F45E",["mans_shoe","shoe"]],["1F45F",["athletic_shoe"]],["1F97E",["hiking_boot"]],["1F97F",["womans_flat_shoe"]],["1F460",["high_heel"]],["1F461",["sandal"]],["1FA70",["ballet_shoes"]],["1F462",["boot"]],["1F451",["crown"]],["1F452",["womans_hat"]],["1F3A9",["tophat"]],["1F393",["mortar_board"]],["1F9E2",["billed_cap"]],["26D1-FE0F",["helmet_with_white_cross"]],["1F4FF",["prayer_beads"]],["1F484",["lipstick"]],["1F48D",["ring"]],["1F48E",["gem"]],["1F507",["mute"]],["1F508",["speaker"]],["1F509",["sound"]],["1F50A",["loud_sound"]],["1F4E2",["loudspeaker"]],["1F4E3",["mega"]],["1F4EF",["postal_horn"]],["1F514",["bell"]],["1F515",["no_bell"]],["1F3BC",["musical_score"]],["1F3B5",["musical_note"]],["1F3B6",["notes"]],["1F399-FE0F",["studio_microphone"]],["1F39A-FE0F",["level_slider"]],["1F39B-FE0F",["control_knobs"]],["1F3A4",["microphone"]],["1F3A7",["headphones"]],["1F4FB",["radio"]],["1F3B7",["saxophone"]],["1F3B8",["guitar"]],["1F3B9",["musical_keyboard"]],["1F3BA",["trumpet"]],["1F3BB",["violin"]],["1FA95",["banjo"]],["1F941",["drum_with_drumsticks"]],["1F4F1",["iphone"]],["1F4F2",["calling"]],["260E-FE0F",["phone","telephone"]],["1F4DE",["telephone_receiver"]],["1F4DF",["pager"]],["1F4E0",["fax"]],["1F50B",["battery"]],["1F50C",["electric_plug"]],["1F4BB",["computer"]],["1F5A5-FE0F",["desktop_computer"]],["1F5A8-FE0F",["printer"]],["2328-FE0F",["keyboard"]],["1F5B1-FE0F",["three_button_mouse"]],["1F5B2-FE0F",["trackball"]],["1F4BD",["minidisc"]],["1F4BE",["floppy_disk"]],["1F4BF",["cd"]],["1F4C0",["dvd"]],["1F9EE",["abacus"]],["1F3A5",["movie_camera"]],["1F39E-FE0F",["film_frames"]],["1F4FD-FE0F",["film_projector"]],["1F3AC",["clapper"]],["1F4FA",["tv"]],["1F4F7",["camera"]],["1F4F8",["camera_with_flash"]],["1F4F9",["video_camera"]],["1F4FC",["vhs"]],["1F50D",["mag"]],["1F50E",["mag_right"]],["1F56F-FE0F",["candle"]],["1F4A1",["bulb"]],["1F526",["flashlight"]],["1F3EE",["izakaya_lantern","lantern"]],["1FA94",["diya_lamp"]],["1F4D4",["notebook_with_decorative_cover"]],["1F4D5",["closed_book"]],["1F4D6",["book","open_book"]],["1F4D7",["green_book"]],["1F4D8",["blue_book"]],["1F4D9",["orange_book"]],["1F4DA",["books"]],["1F4D3",["notebook"]],["1F4D2",["ledger"]],["1F4C3",["page_with_curl"]],["1F4DC",["scroll"]],["1F4C4",["page_facing_up"]],["1F4F0",["newspaper"]],["1F5DE-FE0F",["rolled_up_newspaper"]],["1F4D1",["bookmark_tabs"]],["1F516",["bookmark"]],["1F3F7-FE0F",["label"]],["1F4B0",["moneybag"]],["1F4B4",["yen"]],["1F4B5",["dollar"]],["1F4B6",["euro"]],["1F4B7",["pound"]],["1F4B8",["money_with_wings"]],["1F4B3",["credit_card"]],["1F9FE",["receipt"]],["1F4B9",["chart"]],["1F4B1",["currency_exchange"]],["1F4B2",["heavy_dollar_sign"]],["2709-FE0F",["email","envelope"]],["1F4E7",["e-mail"]],["1F4E8",["incoming_envelope"]],["1F4E9",["envelope_with_arrow"]],["1F4E4",["outbox_tray"]],["1F4E5",["inbox_tray"]],["1F4E6",["package"]],["1F4EB",["mailbox"]],["1F4EA",["mailbox_closed"]],["1F4EC",["mailbox_with_mail"]],["1F4ED",["mailbox_with_no_mail"]],["1F4EE",["postbox"]],["1F5F3-FE0F",["ballot_box_with_ballot"]],["270F-FE0F",["pencil2"]],["2712-FE0F",["black_nib"]],["1F58B-FE0F",["lower_left_fountain_pen"]],["1F58A-FE0F",["lower_left_ballpoint_pen"]],["1F58C-FE0F",["lower_left_paintbrush"]],["1F58D-FE0F",["lower_left_crayon"]],["1F4DD",["memo","pencil"]],["1F4BC",["briefcase"]],["1F4C1",["file_folder"]],["1F4C2",["open_file_folder"]],["1F5C2-FE0F",["card_index_dividers"]],["1F4C5",["date"]],["1F4C6",["calendar"]],["1F5D2-FE0F",["spiral_note_pad"]],["1F5D3-FE0F",["spiral_calendar_pad"]],["1F4C7",["card_index"]],["1F4C8",["chart_with_upwards_trend"]],["1F4C9",["chart_with_downwards_trend"]],["1F4CA",["bar_chart"]],["1F4CB",["clipboard"]],["1F4CC",["pushpin"]],["1F4CD",["round_pushpin"]],["1F4CE",["paperclip"]],["1F587-FE0F",["linked_paperclips"]],["1F4CF",["straight_ruler"]],["1F4D0",["triangular_ruler"]],["2702-FE0F",["scissors"]],["1F5C3-FE0F",["card_file_box"]],["1F5C4-FE0F",["file_cabinet"]],["1F5D1-FE0F",["wastebasket"]],["1F512",["lock"]],["1F513",["unlock"]],["1F50F",["lock_with_ink_pen"]],["1F510",["closed_lock_with_key"]],["1F511",["key"]],["1F5DD-FE0F",["old_key"]],["1F528",["hammer"]],["1FA93",["axe"]],["26CF-FE0F",["pick"]],["2692-FE0F",["hammer_and_pick"]],["1F6E0-FE0F",["hammer_and_wrench"]],["1F5E1-FE0F",["dagger_knife"]],["2694-FE0F",["crossed_swords"]],["1F52B",["gun"]],["1F3F9",["bow_and_arrow"]],["1F6E1-FE0F",["shield"]],["1F527",["wrench"]],["1F529",["nut_and_bolt"]],["2699-FE0F",["gear"]],["1F5DC-FE0F",["compression"]],["2696-FE0F",["scales"]],["1F9AF",["probing_cane"]],["1F517",["link"]],["26D3-FE0F",["chains"]],["1F9F0",["toolbox"]],["1F9F2",["magnet"]],["2697-FE0F",["alembic"]],["1F9EA",["test_tube"]],["1F9EB",["petri_dish"]],["1F9EC",["dna"]],["1F52C",["microscope"]],["1F52D",["telescope"]],["1F4E1",["satellite_antenna"]],["1F489",["syringe"]],["1FA78",["drop_of_blood"]],["1F48A",["pill"]],["1FA79",["adhesive_bandage"]],["1FA7A",["stethoscope"]],["1F6AA",["door"]],["1F6CF-FE0F",["bed"]],["1F6CB-FE0F",["couch_and_lamp"]],["1FA91",["chair"]],["1F6BD",["toilet"]],["1F6BF",["shower"]],["1F6C1",["bathtub"]],["1FA92",["razor"]],["1F9F4",["lotion_bottle"]],["1F9F7",["safety_pin"]],["1F9F9",["broom"]],["1F9FA",["basket"]],["1F9FB",["roll_of_paper"]],["1F9FC",["soap"]],["1F9FD",["sponge"]],["1F9EF",["fire_extinguisher"]],["1F6D2",["shopping_trolley"]],["1F6AC",["smoking"]],["26B0-FE0F",["coffin"]],["26B1-FE0F",["funeral_urn"]],["1F5FF",["moyai"]]],["symbols",["Symbols"]],[["1F3E7",["atm"]],["1F6AE",["put_litter_in_its_place"]],["1F6B0",["potable_water"]],["267F",["wheelchair"]],["1F6B9",["mens"]],["1F6BA",["womens"]],["1F6BB",["restroom"]],["1F6BC",["baby_symbol"]],["1F6BE",["wc"]],["1F6C2",["passport_control"]],["1F6C3",["customs"]],["1F6C4",["baggage_claim"]],["1F6C5",["left_luggage"]],["26A0-FE0F",["warning"]],["1F6B8",["children_crossing"]],["26D4",["no_entry"]],["1F6AB",["no_entry_sign"]],["1F6B3",["no_bicycles"]],["1F6AD",["no_smoking"]],["1F6AF",["do_not_litter"]],["1F6B1",["non-potable_water"]],["1F6B7",["no_pedestrians"]],["1F4F5",["no_mobile_phones"]],["1F51E",["underage"]],["2622-FE0F",["radioactive_sign"]],["2623-FE0F",["biohazard_sign"]],["2B06-FE0F",["arrow_up"]],["2197-FE0F",["arrow_upper_right"]],["27A1-FE0F",["arrow_right"]],["2198-FE0F",["arrow_lower_right"]],["2B07-FE0F",["arrow_down"]],["2199-FE0F",["arrow_lower_left"]],["2B05-FE0F",["arrow_left"]],["2196-FE0F",["arrow_upper_left"]],["2195-FE0F",["arrow_up_down"]],["2194-FE0F",["left_right_arrow"]],["21A9-FE0F",["leftwards_arrow_with_hook"]],["21AA-FE0F",["arrow_right_hook"]],["2934-FE0F",["arrow_heading_up"]],["2935-FE0F",["arrow_heading_down"]],["1F503",["arrows_clockwise"]],["1F504",["arrows_counterclockwise"]],["1F519",["back"]],["1F51A",["end"]],["1F51B",["on"]],["1F51C",["soon"]],["1F51D",["top"]],["1F6D0",["place_of_worship"]],["269B-FE0F",["atom_symbol"]],["1F549-FE0F",["om_symbol"]],["2721-FE0F",["star_of_david"]],["2638-FE0F",["wheel_of_dharma"]],["262F-FE0F",["yin_yang"]],["271D-FE0F",["latin_cross"]],["2626-FE0F",["orthodox_cross"]],["262A-FE0F",["star_and_crescent"]],["262E-FE0F",["peace_symbol"]],["1F54E",["menorah_with_nine_branches"]],["1F52F",["six_pointed_star"]],["2648",["aries"]],["2649",["taurus"]],["264A",["gemini"]],["264B",["cancer"]],["264C",["leo"]],["264D",["virgo"]],["264E",["libra"]],["264F",["scorpius"]],["2650",["sagittarius"]],["2651",["capricorn"]],["2652",["aquarius"]],["2653",["pisces"]],["26CE",["ophiuchus"]],["1F500",["twisted_rightwards_arrows"]],["1F501",["repeat"]],["1F502",["repeat_one"]],["25B6-FE0F",["arrow_forward"]],["23E9",["fast_forward"]],["23ED-FE0F",["black_right_pointing_double_triangle_with_vertical_bar"]],["23EF-FE0F",["black_right_pointing_triangle_with_double_vertical_bar"]],["25C0-FE0F",["arrow_backward"]],["23EA",["rewind"]],["23EE-FE0F",["black_left_pointing_double_triangle_with_vertical_bar"]],["1F53C",["arrow_up_small"]],["23EB",["arrow_double_up"]],["1F53D",["arrow_down_small"]],["23EC",["arrow_double_down"]],["23F8-FE0F",["double_vertical_bar"]],["23F9-FE0F",["black_square_for_stop"]],["23FA-FE0F",["black_circle_for_record"]],["23CF-FE0F",["eject"]],["1F3A6",["cinema"]],["1F505",["low_brightness"]],["1F506",["high_brightness"]],["1F4F6",["signal_strength"]],["1F4F3",["vibration_mode"]],["1F4F4",["mobile_phone_off"]],["2640-FE0F",["female_sign"]],["2642-FE0F",["male_sign"]],["2695-FE0F",["medical_symbol","staff_of_aesculapius"]],["267E-FE0F",["infinity"]],["267B-FE0F",["recycle"]],["269C-FE0F",["fleur_de_lis"]],["1F531",["trident"]],["1F4DB",["name_badge"]],["1F530",["beginner"]],["2B55",["o"]],["2705",["white_check_mark"]],["2611-FE0F",["ballot_box_with_check"]],["2714-FE0F",["heavy_check_mark"]],["2716-FE0F",["heavy_multiplication_x"]],["274C",["x"]],["274E",["negative_squared_cross_mark"]],["2795",["heavy_plus_sign"]],["2796",["heavy_minus_sign"]],["2797",["heavy_division_sign"]],["27B0",["curly_loop"]],["27BF",["loop"]],["303D-FE0F",["part_alternation_mark"]],["2733-FE0F",["eight_spoked_asterisk"]],["2734-FE0F",["eight_pointed_black_star"]],["2747-FE0F",["sparkle"]],["203C-FE0F",["bangbang"]],["2049-FE0F",["interrobang"]],["2753",["question"]],["2754",["grey_question"]],["2755",["grey_exclamation"]],["2757",["exclamation","heavy_exclamation_mark"]],["3030-FE0F",["wavy_dash"]],["00A9-FE0F",["copyright"]],["00AE-FE0F",["registered"]],["2122-FE0F",["tm"]],["0023-FE0F-20E3",["hash"]],["002A-FE0F-20E3",["keycap_star"]],["0030-FE0F-20E3",["zero"]],["0031-FE0F-20E3",["one"]],["0032-FE0F-20E3",["two"]],["0033-FE0F-20E3",["three"]],["0034-FE0F-20E3",["four"]],["0035-FE0F-20E3",["five"]],["0036-FE0F-20E3",["six"]],["0037-FE0F-20E3",["seven"]],["0038-FE0F-20E3",["eight"]],["0039-FE0F-20E3",["nine"]],["1F51F",["keycap_ten"]],["1F520",["capital_abcd"]],["1F521",["abcd"]],["1F522",["1234"]],["1F523",["symbols"]],["1F524",["abc"]],["1F170-FE0F",["a"]],["1F18E",["ab"]],["1F171-FE0F",["b"]],["1F191",["cl"]],["1F192",["cool"]],["1F193",["free"]],["2139-FE0F",["information_source"]],["1F194",["id"]],["24C2-FE0F",["m"]],["1F195",["new"]],["1F196",["ng"]],["1F17E-FE0F",["o2"]],["1F197",["ok"]],["1F17F-FE0F",["parking"]],["1F198",["sos"]],["1F199",["up"]],["1F19A",["vs"]],["1F201",["koko"]],["1F202-FE0F",["sa"]],["1F237-FE0F",["u6708"]],["1F236",["u6709"]],["1F22F",["u6307"]],["1F250",["ideograph_advantage"]],["1F239",["u5272"]],["1F21A",["u7121"]],["1F232",["u7981"]],["1F251",["accept"]],["1F238",["u7533"]],["1F234",["u5408"]],["1F233",["u7a7a"]],["3297-FE0F",["congratulations"]],["3299-FE0F",["secret"]],["1F23A",["u55b6"]],["1F235",["u6e80"]],["1F534",["red_circle"]],["1F7E0",["large_orange_circle"]],["1F7E1",["large_yellow_circle"]],["1F7E2",["large_green_circle"]],["1F535",["large_blue_circle"]],["1F7E3",["large_purple_circle"]],["1F7E4",["large_brown_circle"]],["26AB",["black_circle"]],["26AA",["white_circle"]],["1F7E5",["large_red_square"]],["1F7E7",["large_orange_square"]],["1F7E8",["large_yellow_square"]],["1F7E9",["large_green_square"]],["1F7E6",["large_blue_square"]],["1F7EA",["large_purple_square"]],["1F7EB",["large_brown_square"]],["2B1B",["black_large_square"]],["2B1C",["white_large_square"]],["25FC-FE0F",["black_medium_square"]],["25FB-FE0F",["white_medium_square"]],["25FE",["black_medium_small_square"]],["25FD",["white_medium_small_square"]],["25AA-FE0F",["black_small_square"]],["25AB-FE0F",["white_small_square"]],["1F536",["large_orange_diamond"]],["1F537",["large_blue_diamond"]],["1F538",["small_orange_diamond"]],["1F539",["small_blue_diamond"]],["1F53A",["small_red_triangle"]],["1F53B",["small_red_triangle_down"]],["1F4A0",["diamond_shape_with_a_dot_inside"]],["1F518",["radio_button"]],["1F533",["white_square_button"]],["1F532",["black_square_button"]]],["flags",["Flags"]],[["1F3C1",["checkered_flag"]],["1F6A9",["triangular_flag_on_post"]],["1F38C",["crossed_flags"]],["1F3F4",["waving_black_flag"]],["1F3F3-FE0F",["waving_white_flag"]],["1F3F3-FE0F-200D-1F308",["rainbow-flag"]],["1F3F4-200D-2620-FE0F",["pirate_flag"]],["1F1E6-1F1E8",["flag-ac"]],["1F1E6-1F1E9",["flag-ad"]],["1F1E6-1F1EA",["flag-ae"]],["1F1E6-1F1EB",["flag-af"]],["1F1E6-1F1EC",["flag-ag"]],["1F1E6-1F1EE",["flag-ai"]],["1F1E6-1F1F1",["flag-al"]],["1F1E6-1F1F2",["flag-am"]],["1F1E6-1F1F4",["flag-ao"]],["1F1E6-1F1F6",["flag-aq"]],["1F1E6-1F1F7",["flag-ar"]],["1F1E6-1F1F8",["flag-as"]],["1F1E6-1F1F9",["flag-at"]],["1F1E6-1F1FA",["flag-au"]],["1F1E6-1F1FC",["flag-aw"]],["1F1E6-1F1FD",["flag-ax"]],["1F1E6-1F1FF",["flag-az"]],["1F1E7-1F1E6",["flag-ba"]],["1F1E7-1F1E7",["flag-bb"]],["1F1E7-1F1E9",["flag-bd"]],["1F1E7-1F1EA",["flag-be"]],["1F1E7-1F1EB",["flag-bf"]],["1F1E7-1F1EC",["flag-bg"]],["1F1E7-1F1ED",["flag-bh"]],["1F1E7-1F1EE",["flag-bi"]],["1F1E7-1F1EF",["flag-bj"]],["1F1E7-1F1F1",["flag-bl"]],["1F1E7-1F1F2",["flag-bm"]],["1F1E7-1F1F3",["flag-bn"]],["1F1E7-1F1F4",["flag-bo"]],["1F1E7-1F1F6",["flag-bq"]],["1F1E7-1F1F7",["flag-br"]],["1F1E7-1F1F8",["flag-bs"]],["1F1E7-1F1F9",["flag-bt"]],["1F1E7-1F1FB",["flag-bv"]],["1F1E7-1F1FC",["flag-bw"]],["1F1E7-1F1FE",["flag-by"]],["1F1E7-1F1FF",["flag-bz"]],["1F1E8-1F1E6",["flag-ca"]],["1F1E8-1F1E8",["flag-cc"]],["1F1E8-1F1E9",["flag-cd"]],["1F1E8-1F1EB",["flag-cf"]],["1F1E8-1F1EC",["flag-cg"]],["1F1E8-1F1ED",["flag-ch"]],["1F1E8-1F1EE",["flag-ci"]],["1F1E8-1F1F0",["flag-ck"]],["1F1E8-1F1F1",["flag-cl"]],["1F1E8-1F1F2",["flag-cm"]],["1F1E8-1F1F3",["cn","flag-cn"]],["1F1E8-1F1F4",["flag-co"]],["1F1E8-1F1F5",["flag-cp"]],["1F1E8-1F1F7",["flag-cr"]],["1F1E8-1F1FA",["flag-cu"]],["1F1E8-1F1FB",["flag-cv"]],["1F1E8-1F1FC",["flag-cw"]],["1F1E8-1F1FD",["flag-cx"]],["1F1E8-1F1FE",["flag-cy"]],["1F1E8-1F1FF",["flag-cz"]],["1F1E9-1F1EA",["de","flag-de"]],["1F1E9-1F1EC",["flag-dg"]],["1F1E9-1F1EF",["flag-dj"]],["1F1E9-1F1F0",["flag-dk"]],["1F1E9-1F1F2",["flag-dm"]],["1F1E9-1F1F4",["flag-do"]],["1F1E9-1F1FF",["flag-dz"]],["1F1EA-1F1E6",["flag-ea"]],["1F1EA-1F1E8",["flag-ec"]],["1F1EA-1F1EA",["flag-ee"]],["1F1EA-1F1EC",["flag-eg"]],["1F1EA-1F1ED",["flag-eh"]],["1F1EA-1F1F7",["flag-er"]],["1F1EA-1F1F8",["es","flag-es"]],["1F1EA-1F1F9",["flag-et"]],["1F1EA-1F1FA",["flag-eu"]],["1F1EB-1F1EE",["flag-fi"]],["1F1EB-1F1EF",["flag-fj"]],["1F1EB-1F1F0",["flag-fk"]],["1F1EB-1F1F2",["flag-fm"]],["1F1EB-1F1F4",["flag-fo"]],["1F1EB-1F1F7",["fr","flag-fr"]],["1F1EC-1F1E6",["flag-ga"]],["1F1EC-1F1E7",["gb","uk","flag-gb"]],["1F1EC-1F1E9",["flag-gd"]],["1F1EC-1F1EA",["flag-ge"]],["1F1EC-1F1EB",["flag-gf"]],["1F1EC-1F1EC",["flag-gg"]],["1F1EC-1F1ED",["flag-gh"]],["1F1EC-1F1EE",["flag-gi"]],["1F1EC-1F1F1",["flag-gl"]],["1F1EC-1F1F2",["flag-gm"]],["1F1EC-1F1F3",["flag-gn"]],["1F1EC-1F1F5",["flag-gp"]],["1F1EC-1F1F6",["flag-gq"]],["1F1EC-1F1F7",["flag-gr"]],["1F1EC-1F1F8",["flag-gs"]],["1F1EC-1F1F9",["flag-gt"]],["1F1EC-1F1FA",["flag-gu"]],["1F1EC-1F1FC",["flag-gw"]],["1F1EC-1F1FE",["flag-gy"]],["1F1ED-1F1F0",["flag-hk"]],["1F1ED-1F1F2",["flag-hm"]],["1F1ED-1F1F3",["flag-hn"]],["1F1ED-1F1F7",["flag-hr"]],["1F1ED-1F1F9",["flag-ht"]],["1F1ED-1F1FA",["flag-hu"]],["1F1EE-1F1E8",["flag-ic"]],["1F1EE-1F1E9",["flag-id"]],["1F1EE-1F1EA",["flag-ie"]],["1F1EE-1F1F1",["flag-il"]],["1F1EE-1F1F2",["flag-im"]],["1F1EE-1F1F3",["flag-in"]],["1F1EE-1F1F4",["flag-io"]],["1F1EE-1F1F6",["flag-iq"]],["1F1EE-1F1F7",["flag-ir"]],["1F1EE-1F1F8",["flag-is"]],["1F1EE-1F1F9",["it","flag-it"]],["1F1EF-1F1EA",["flag-je"]],["1F1EF-1F1F2",["flag-jm"]],["1F1EF-1F1F4",["flag-jo"]],["1F1EF-1F1F5",["jp","flag-jp"]],["1F1F0-1F1EA",["flag-ke"]],["1F1F0-1F1EC",["flag-kg"]],["1F1F0-1F1ED",["flag-kh"]],["1F1F0-1F1EE",["flag-ki"]],["1F1F0-1F1F2",["flag-km"]],["1F1F0-1F1F3",["flag-kn"]],["1F1F0-1F1F5",["flag-kp"]],["1F1F0-1F1F7",["kr","flag-kr"]],["1F1F0-1F1FC",["flag-kw"]],["1F1F0-1F1FE",["flag-ky"]],["1F1F0-1F1FF",["flag-kz"]],["1F1F1-1F1E6",["flag-la"]],["1F1F1-1F1E7",["flag-lb"]],["1F1F1-1F1E8",["flag-lc"]],["1F1F1-1F1EE",["flag-li"]],["1F1F1-1F1F0",["flag-lk"]],["1F1F1-1F1F7",["flag-lr"]],["1F1F1-1F1F8",["flag-ls"]],["1F1F1-1F1F9",["flag-lt"]],["1F1F1-1F1FA",["flag-lu"]],["1F1F1-1F1FB",["flag-lv"]],["1F1F1-1F1FE",["flag-ly"]],["1F1F2-1F1E6",["flag-ma"]],["1F1F2-1F1E8",["flag-mc"]],["1F1F2-1F1E9",["flag-md"]],["1F1F2-1F1EA",["flag-me"]],["1F1F2-1F1EB",["flag-mf"]],["1F1F2-1F1EC",["flag-mg"]],["1F1F2-1F1ED",["flag-mh"]],["1F1F2-1F1F0",["flag-mk"]],["1F1F2-1F1F1",["flag-ml"]],["1F1F2-1F1F2",["flag-mm"]],["1F1F2-1F1F3",["flag-mn"]],["1F1F2-1F1F4",["flag-mo"]],["1F1F2-1F1F5",["flag-mp"]],["1F1F2-1F1F6",["flag-mq"]],["1F1F2-1F1F7",["flag-mr"]],["1F1F2-1F1F8",["flag-ms"]],["1F1F2-1F1F9",["flag-mt"]],["1F1F2-1F1FA",["flag-mu"]],["1F1F2-1F1FB",["flag-mv"]],["1F1F2-1F1FC",["flag-mw"]],["1F1F2-1F1FD",["flag-mx"]],["1F1F2-1F1FE",["flag-my"]],["1F1F2-1F1FF",["flag-mz"]],["1F1F3-1F1E6",["flag-na"]],["1F1F3-1F1E8",["flag-nc"]],["1F1F3-1F1EA",["flag-ne"]],["1F1F3-1F1EB",["flag-nf"]],["1F1F3-1F1EC",["flag-ng"]],["1F1F3-1F1EE",["flag-ni"]],["1F1F3-1F1F1",["flag-nl"]],["1F1F3-1F1F4",["flag-no"]],["1F1F3-1F1F5",["flag-np"]],["1F1F3-1F1F7",["flag-nr"]],["1F1F3-1F1FA",["flag-nu"]],["1F1F3-1F1FF",["flag-nz"]],["1F1F4-1F1F2",["flag-om"]],["1F1F5-1F1E6",["flag-pa"]],["1F1F5-1F1EA",["flag-pe"]],["1F1F5-1F1EB",["flag-pf"]],["1F1F5-1F1EC",["flag-pg"]],["1F1F5-1F1ED",["flag-ph"]],["1F1F5-1F1F0",["flag-pk"]],["1F1F5-1F1F1",["flag-pl"]],["1F1F5-1F1F2",["flag-pm"]],["1F1F5-1F1F3",["flag-pn"]],["1F1F5-1F1F7",["flag-pr"]],["1F1F5-1F1F8",["flag-ps"]],["1F1F5-1F1F9",["flag-pt"]],["1F1F5-1F1FC",["flag-pw"]],["1F1F5-1F1FE",["flag-py"]],["1F1F6-1F1E6",["flag-qa"]],["1F1F7-1F1EA",["flag-re"]],["1F1F7-1F1F4",["flag-ro"]],["1F1F7-1F1F8",["flag-rs"]],["1F1F7-1F1FA",["ru","flag-ru"]],["1F1F7-1F1FC",["flag-rw"]],["1F1F8-1F1E6",["flag-sa"]],["1F1F8-1F1E7",["flag-sb"]],["1F1F8-1F1E8",["flag-sc"]],["1F1F8-1F1E9",["flag-sd"]],["1F1F8-1F1EA",["flag-se"]],["1F1F8-1F1EC",["flag-sg"]],["1F1F8-1F1ED",["flag-sh"]],["1F1F8-1F1EE",["flag-si"]],["1F1F8-1F1EF",["flag-sj"]],["1F1F8-1F1F0",["flag-sk"]],["1F1F8-1F1F1",["flag-sl"]],["1F1F8-1F1F2",["flag-sm"]],["1F1F8-1F1F3",["flag-sn"]],["1F1F8-1F1F4",["flag-so"]],["1F1F8-1F1F7",["flag-sr"]],["1F1F8-1F1F8",["flag-ss"]],["1F1F8-1F1F9",["flag-st"]],["1F1F8-1F1FB",["flag-sv"]],["1F1F8-1F1FD",["flag-sx"]],["1F1F8-1F1FE",["flag-sy"]],["1F1F8-1F1FF",["flag-sz"]],["1F1F9-1F1E6",["flag-ta"]],["1F1F9-1F1E8",["flag-tc"]],["1F1F9-1F1E9",["flag-td"]],["1F1F9-1F1EB",["flag-tf"]],["1F1F9-1F1EC",["flag-tg"]],["1F1F9-1F1ED",["flag-th"]],["1F1F9-1F1EF",["flag-tj"]],["1F1F9-1F1F0",["flag-tk"]],["1F1F9-1F1F1",["flag-tl"]],["1F1F9-1F1F2",["flag-tm"]],["1F1F9-1F1F3",["flag-tn"]],["1F1F9-1F1F4",["flag-to"]],["1F1F9-1F1F7",["flag-tr"]],["1F1F9-1F1F9",["flag-tt"]],["1F1F9-1F1FB",["flag-tv"]],["1F1F9-1F1FC",["flag-tw"]],["1F1F9-1F1FF",["flag-tz"]],["1F1FA-1F1E6",["flag-ua"]],["1F1FA-1F1EC",["flag-ug"]],["1F1FA-1F1F2",["flag-um"]],["1F1FA-1F1F3",["flag-un"]],["1F1FA-1F1F8",["us","flag-us"]],["1F1FA-1F1FE",["flag-uy"]],["1F1FA-1F1FF",["flag-uz"]],["1F1FB-1F1E6",["flag-va"]],["1F1FB-1F1E8",["flag-vc"]],["1F1FB-1F1EA",["flag-ve"]],["1F1FB-1F1EC",["flag-vg"]],["1F1FB-1F1EE",["flag-vi"]],["1F1FB-1F1F3",["flag-vn"]],["1F1FB-1F1FA",["flag-vu"]],["1F1FC-1F1EB",["flag-wf"]],["1F1FC-1F1F8",["flag-ws"]],["1F1FD-1F1F0",["flag-xk"]],["1F1FE-1F1EA",["flag-ye"]],["1F1FE-1F1F9",["flag-yt"]],["1F1FF-1F1E6",["flag-za"]],["1F1FF-1F1F2",["flag-zm"]],["1F1FF-1F1FC",["flag-zw"]],["1F3F4-E0067-E0062-E0065-E006E-E0067-E007F",["flag-england"]],["1F3F4-E0067-E0062-E0073-E0063-E0074-E007F",["flag-scotland"]],["1F3F4-E0067-E0062-E0077-E006C-E0073-E007F",["flag-wales"]]]]')}}]); +//# sourceMappingURL=1.f0613d67642ddda53eb4.js.map \ No newline at end of file diff --git a/dist/1.f0613d67642ddda53eb4.js.map b/dist/1.f0613d67642ddda53eb4.js.map new file mode 100644 index 00000000..ebf0f903 --- /dev/null +++ b/dist/1.f0613d67642ddda53eb4.js.map @@ -0,0 +1 @@ +{"version":3,"sources":[],"names":[],"mappings":"","file":"1.f0613d67642ddda53eb4.js","sourceRoot":""} \ No newline at end of file diff --git a/dist/10.0f031682109823f02d37.js b/dist/10.081974f38a996f9d205f.js similarity index 98% rename from dist/10.0f031682109823f02d37.js rename to dist/10.081974f38a996f9d205f.js index 348b2134..a837a238 100644 --- a/dist/10.0f031682109823f02d37.js +++ b/dist/10.081974f38a996f9d205f.js @@ -1,2 +1,2 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[10],{334:function(e,t,o){"undefined"!=typeof self&&self,e.exports=function(e){var t={};function o(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,o),i.l=!0,i.exports}return o.m=e,o.c=t,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)o.d(n,i,function(t){return e[t]}.bind(null,i));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=0)}([function(e,t,o){"use strict";(function(t){var o=t.AudioContext||t.webkitAudioContext,n=function e(){var t=this,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!e.isRecordingSupported())throw new Error("Recording is not supported in this browser");this.state="inactive",this.config=Object.assign({bufferLength:4096,encoderApplication:2049,encoderFrameSize:20,encoderPath:"encoderWorker.min.js",encoderSampleRate:48e3,maxFramesPerPage:40,mediaTrackConstraints:!0,monitorGain:0,numberOfChannels:1,recordingGain:1,resampleQuality:3,streamPages:!1,wavBitDepth:16,sourceNode:{context:null}},o),this.encodedSamplePosition=0,this.initAudioContext(),this.initialize=this.initWorklet().then((function(){return t.initEncoder()}))};n.isRecordingSupported=function(){var e=t.navigator&&t.navigator.mediaDevices&&t.navigator.mediaDevices.getUserMedia;return o&&e&&t.WebAssembly},n.version="8.0.3",n.prototype.clearStream=function(){this.stream&&(this.stream.getTracks?this.stream.getTracks().forEach((function(e){return e.stop()})):this.stream.stop())},n.prototype.close=function(){return this.monitorGainNode.disconnect(),this.recordingGainNode.disconnect(),this.sourceNode&&this.sourceNode.disconnect(),this.clearStream(),this.encoder&&(this.encoderNode.disconnect(),this.encoder.postMessage({command:"close"})),this.config.sourceNode.context?Promise.resolve():this.audioContext.close()},n.prototype.encodeBuffers=function(e){if("recording"===this.state){for(var t=[],o=0;o=0||(i[o]=e[o]);return i}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(i[o]=e[o])}return i}(n,["sourceNode"]));e.encoder.postMessage(Object.assign({command:"init",originalSampleRate:e.audioContext.sampleRate,wavSampleRate:e.audioContext.sampleRate},i))}))},n.prototype.initWorklet=function(){return this.audioContext.audioWorklet?this.audioContext.audioWorklet.addModule(this.config.encoderPath):Promise.resolve()},n.prototype.pause=function(e){var t=this;if("recording"===this.state)return this.state="paused",this.recordingGainNode.disconnect(),e&&this.config.streamPages?new Promise((function(e){t.encoder.addEventListener("message",(function o(n){"flushed"===n.data.message&&(t.encoder.removeEventListener("message",o),t.onpause(),e())})),t.encoder.start&&t.encoder.start(),t.encoder.postMessage({command:"flush"})})):(this.onpause(),Promise.resolve())},n.prototype.resume=function(){"paused"===this.state&&(this.state="recording",this.recordingGainNode.connect(this.encoderNode),this.onresume())},n.prototype.setRecordingGain=function(e){this.config.recordingGain=e,this.recordingGainNode&&this.audioContext&&this.recordingGainNode.gain.setTargetAtTime(e,this.audioContext.currentTime,.01)},n.prototype.setMonitorGain=function(e){this.config.monitorGain=e,this.monitorGainNode&&this.audioContext&&this.monitorGainNode.gain.setTargetAtTime(e,this.audioContext.currentTime,.01)},n.prototype.start=function(){var e=this;return"inactive"===this.state?(this.state="loading",this.encodedSamplePosition=0,this.audioContext.resume().then((function(){return e.initialize})).then((function(){return Promise.all([e.initSourceNode(),e.initWorker()])})).then((function(){e.state="recording",e.encoder.postMessage({command:"getHeaderPages"}),e.sourceNode.connect(e.monitorGainNode),e.sourceNode.connect(e.recordingGainNode),e.monitorGainNode.connect(e.audioContext.destination),e.recordingGainNode.connect(e.encoderNode),e.onstart()})).catch((function(t){throw e.state="inactive",t}))):Promise.resolve()},n.prototype.stop=function(){var e=this;return"paused"===this.state||"recording"===this.state?(this.state="inactive",this.recordingGainNode.connect(this.encoderNode),this.monitorGainNode.disconnect(),this.clearStream(),new Promise((function(t){e.encoder.addEventListener("message",(function o(n){"done"===n.data.message&&(e.encoder.removeEventListener("message",o),t())})),e.encoder.start&&e.encoder.start(),e.encoder.postMessage({command:"done"})}))):Promise.resolve()},n.prototype.storePage=function(e){this.recordedPages.push(e),this.totalLength+=e.length},n.prototype.streamPage=function(e){this.ondataavailable(e)},n.prototype.finish=function(){if(!this.config.streamPages){var e=new Uint8Array(this.totalLength);this.recordedPages.reduce((function(t,o){return e.set(o,t),t+o.length}),0),this.ondataavailable(e)}this.onstop()},n.prototype.ondataavailable=function(){},n.prototype.onpause=function(){},n.prototype.onresume=function(){},n.prototype.onstart=function(){},n.prototype.onstop=function(){},e.exports=n}).call(this,o(1))},function(e,t){var o;o=function(){return this}();try{o=o||new Function("return this")()}catch(e){"object"==typeof window&&(o=window)}e.exports=o}])}}]); -//# sourceMappingURL=10.0f031682109823f02d37.js.map \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[10],{335:function(e,t,o){"undefined"!=typeof self&&self,e.exports=function(e){var t={};function o(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,o),i.l=!0,i.exports}return o.m=e,o.c=t,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)o.d(n,i,function(t){return e[t]}.bind(null,i));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=0)}([function(e,t,o){"use strict";(function(t){var o=t.AudioContext||t.webkitAudioContext,n=function e(){var t=this,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!e.isRecordingSupported())throw new Error("Recording is not supported in this browser");this.state="inactive",this.config=Object.assign({bufferLength:4096,encoderApplication:2049,encoderFrameSize:20,encoderPath:"encoderWorker.min.js",encoderSampleRate:48e3,maxFramesPerPage:40,mediaTrackConstraints:!0,monitorGain:0,numberOfChannels:1,recordingGain:1,resampleQuality:3,streamPages:!1,wavBitDepth:16,sourceNode:{context:null}},o),this.encodedSamplePosition=0,this.initAudioContext(),this.initialize=this.initWorklet().then((function(){return t.initEncoder()}))};n.isRecordingSupported=function(){var e=t.navigator&&t.navigator.mediaDevices&&t.navigator.mediaDevices.getUserMedia;return o&&e&&t.WebAssembly},n.version="8.0.3",n.prototype.clearStream=function(){this.stream&&(this.stream.getTracks?this.stream.getTracks().forEach((function(e){return e.stop()})):this.stream.stop())},n.prototype.close=function(){return this.monitorGainNode.disconnect(),this.recordingGainNode.disconnect(),this.sourceNode&&this.sourceNode.disconnect(),this.clearStream(),this.encoder&&(this.encoderNode.disconnect(),this.encoder.postMessage({command:"close"})),this.config.sourceNode.context?Promise.resolve():this.audioContext.close()},n.prototype.encodeBuffers=function(e){if("recording"===this.state){for(var t=[],o=0;o=0||(i[o]=e[o]);return i}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(i[o]=e[o])}return i}(n,["sourceNode"]));e.encoder.postMessage(Object.assign({command:"init",originalSampleRate:e.audioContext.sampleRate,wavSampleRate:e.audioContext.sampleRate},i))}))},n.prototype.initWorklet=function(){return this.audioContext.audioWorklet?this.audioContext.audioWorklet.addModule(this.config.encoderPath):Promise.resolve()},n.prototype.pause=function(e){var t=this;if("recording"===this.state)return this.state="paused",this.recordingGainNode.disconnect(),e&&this.config.streamPages?new Promise((function(e){t.encoder.addEventListener("message",(function o(n){"flushed"===n.data.message&&(t.encoder.removeEventListener("message",o),t.onpause(),e())})),t.encoder.start&&t.encoder.start(),t.encoder.postMessage({command:"flush"})})):(this.onpause(),Promise.resolve())},n.prototype.resume=function(){"paused"===this.state&&(this.state="recording",this.recordingGainNode.connect(this.encoderNode),this.onresume())},n.prototype.setRecordingGain=function(e){this.config.recordingGain=e,this.recordingGainNode&&this.audioContext&&this.recordingGainNode.gain.setTargetAtTime(e,this.audioContext.currentTime,.01)},n.prototype.setMonitorGain=function(e){this.config.monitorGain=e,this.monitorGainNode&&this.audioContext&&this.monitorGainNode.gain.setTargetAtTime(e,this.audioContext.currentTime,.01)},n.prototype.start=function(){var e=this;return"inactive"===this.state?(this.state="loading",this.encodedSamplePosition=0,this.audioContext.resume().then((function(){return e.initialize})).then((function(){return Promise.all([e.initSourceNode(),e.initWorker()])})).then((function(){e.state="recording",e.encoder.postMessage({command:"getHeaderPages"}),e.sourceNode.connect(e.monitorGainNode),e.sourceNode.connect(e.recordingGainNode),e.monitorGainNode.connect(e.audioContext.destination),e.recordingGainNode.connect(e.encoderNode),e.onstart()})).catch((function(t){throw e.state="inactive",t}))):Promise.resolve()},n.prototype.stop=function(){var e=this;return"paused"===this.state||"recording"===this.state?(this.state="inactive",this.recordingGainNode.connect(this.encoderNode),this.monitorGainNode.disconnect(),this.clearStream(),new Promise((function(t){e.encoder.addEventListener("message",(function o(n){"done"===n.data.message&&(e.encoder.removeEventListener("message",o),t())})),e.encoder.start&&e.encoder.start(),e.encoder.postMessage({command:"done"})}))):Promise.resolve()},n.prototype.storePage=function(e){this.recordedPages.push(e),this.totalLength+=e.length},n.prototype.streamPage=function(e){this.ondataavailable(e)},n.prototype.finish=function(){if(!this.config.streamPages){var e=new Uint8Array(this.totalLength);this.recordedPages.reduce((function(t,o){return e.set(o,t),t+o.length}),0),this.ondataavailable(e)}this.onstop()},n.prototype.ondataavailable=function(){},n.prototype.onpause=function(){},n.prototype.onresume=function(){},n.prototype.onstart=function(){},n.prototype.onstop=function(){},e.exports=n}).call(this,o(1))},function(e,t){var o;o=function(){return this}();try{o=o||new Function("return this")()}catch(e){"object"==typeof window&&(o=window)}e.exports=o}])}}]); +//# sourceMappingURL=10.081974f38a996f9d205f.js.map \ No newline at end of file diff --git a/dist/10.0f031682109823f02d37.js.map b/dist/10.081974f38a996f9d205f.js.map similarity index 99% rename from dist/10.0f031682109823f02d37.js.map rename to dist/10.081974f38a996f9d205f.js.map index cee8ad83..1ca035d9 100644 --- a/dist/10.0f031682109823f02d37.js.map +++ b/dist/10.081974f38a996f9d205f.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///./node_modules/opus-recorder/dist/recorder.min.js"],"names":["self","module","exports","e","t","o","n","i","l","call","m","c","d","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","__esModule","create","bind","default","prototype","hasOwnProperty","p","s","AudioContext","webkitAudioContext","this","arguments","length","isRecordingSupported","Error","state","config","assign","bufferLength","encoderApplication","encoderFrameSize","encoderPath","encoderSampleRate","maxFramesPerPage","mediaTrackConstraints","monitorGain","numberOfChannels","recordingGain","resampleQuality","streamPages","wavBitDepth","sourceNode","context","encodedSamplePosition","initAudioContext","initialize","initWorklet","then","initEncoder","navigator","mediaDevices","getUserMedia","WebAssembly","version","clearStream","stream","getTracks","forEach","stop","close","monitorGainNode","disconnect","recordingGainNode","encoder","encoderNode","postMessage","command","Promise","resolve","audioContext","encodeBuffers","getChannelData","buffers","createGain","setMonitorGain","setRecordingGain","audioWorklet","AudioWorkletNode","numberOfOutputs","port","console","log","createScriptProcessor","onaudioprocess","inputBuffer","connect","destination","Worker","initSourceNode","audio","createMediaStreamSource","initWorker","streamPage","storePage","recordedPages","totalLength","addEventListener","data","message","samplePosition","page","removeEventListener","finish","start","keys","indexOf","getOwnPropertySymbols","propertyIsEnumerable","originalSampleRate","sampleRate","wavSampleRate","addModule","pause","onpause","resume","onresume","gain","setTargetAtTime","currentTime","all","onstart","catch","push","ondataavailable","Uint8Array","reduce","set","onstop","Function","window"],"mapp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\"object\"==typeof exports&&\"object\"==typeof module?module.exports=t():\"function\"==typeof define&&define.amd?define([],t):\"object\"==typeof exports?exports.Recorder=t():e.Recorder=t()}(\"undefined\"!=typeof self?self:this,(function(){return function(e){var t={};function o(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,o),i.l=!0,i.exports}return o.m=e,o.c=t,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(e,\"__esModule\",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&\"object\"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,\"default\",{enumerable:!0,value:e}),2&t&&\"string\"!=typeof e)for(var i in e)o.d(n,i,function(t){return e[t]}.bind(null,i));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,\"a\",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p=\"\",o(o.s=0)}([function(e,t,o){\"use strict\";(function(t){function o(e,t){if(null==e)return{};var o,n,i=function(e,t){if(null==e)return{};var o,n,i={},r=Object.keys(e);for(n=0;n=0||(i[o]=e[o]);return i}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(i[o]=e[o])}return i}var n=t.AudioContext||t.webkitAudioContext,i=function e(){var t=this,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!e.isRecordingSupported())throw new Error(\"Recording is not supported in this browser\");this.state=\"inactive\",this.config=Object.assign({bufferLength:4096,encoderApplication:2049,encoderFrameSize:20,encoderPath:\"encoderWorker.min.js\",encoderSampleRate:48e3,maxFramesPerPage:40,mediaTrackConstraints:!0,monitorGain:0,numberOfChannels:1,recordingGain:1,resampleQuality:3,streamPages:!1,wavBitDepth:16,sourceNode:{context:null}},o),this.encodedSamplePosition=0,this.initAudioContext(),this.initialize=this.initWorklet().then((function(){return t.initEncoder()}))};i.isRecordingSupported=function(){var e=t.navigator&&t.navigator.mediaDevices&&t.navigator.mediaDevices.getUserMedia;return n&&e&&t.WebAssembly},i.version=\"8.0.3\",i.prototype.clearStream=function(){this.stream&&(this.stream.getTracks?this.stream.getTracks().forEach((function(e){return e.stop()})):this.stream.stop())},i.prototype.close=function(){return this.monitorGainNode.disconnect(),this.recordingGainNode.disconnect(),this.sourceNode&&this.sourceNode.disconnect(),this.clearStream(),this.encoder&&(this.encoderNode.disconnect(),this.encoder.postMessage({command:\"close\"})),this.config.sourceNode.context?Promise.resolve():this.audioContext.close()},i.prototype.encodeBuffers=function(e){if(\"recording\"===this.state){for(var t=[],o=0;o=0||(i[o]=e[o]);return i}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(i[o]=e[o])}return i}var n=t.AudioContext||t.webkitAudioContext,i=function e(){var t=this,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!e.isRecordingSupported())throw new Error(\"Recording is not supported in this browser\");this.state=\"inactive\",this.config=Object.assign({bufferLength:4096,encoderApplication:2049,encoderFrameSize:20,encoderPath:\"encoderWorker.min.js\",encoderSampleRate:48e3,maxFramesPerPage:40,mediaTrackConstraints:!0,monitorGain:0,numberOfChannels:1,recordingGain:1,resampleQuality:3,streamPages:!1,wavBitDepth:16,sourceNode:{context:null}},o),this.encodedSamplePosition=0,this.initAudioContext(),this.initialize=this.initWorklet().then((function(){return t.initEncoder()}))};i.isRecordingSupported=function(){var e=t.navigator&&t.navigator.mediaDevices&&t.navigator.mediaDevices.getUserMedia;return n&&e&&t.WebAssembly},i.version=\"8.0.3\",i.prototype.clearStream=function(){this.stream&&(this.stream.getTracks?this.stream.getTracks().forEach((function(e){return e.stop()})):this.stream.stop())},i.prototype.close=function(){return this.monitorGainNode.disconnect(),this.recordingGainNode.disconnect(),this.sourceNode&&this.sourceNode.disconnect(),this.clearStream(),this.encoder&&(this.encoderNode.disconnect(),this.encoder.postMessage({command:\"close\"})),this.config.sourceNode.context?Promise.resolve():this.audioContext.close()},i.prototype.encodeBuffers=function(e){if(\"recording\"===this.state){for(var t=[],o=0;o{console.error(e),o({type:"unhandledError",error:{message:e.error.message||"Uncaught exception in worker"}})},self.addEventListener("unhandledrejection",e=>{console.error(e),o({type:"unhandledError",error:{message:e.reason.message||"Uncaught rejection in worker"}})});const n=new Map;function o(e,r){r?postMessage(e,r):postMessage(e)}let a;self.importScripts("rlottie-wasm.js");const s=new Promise(e=>{Module.onRuntimeInitialized=()=>{a={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()}}),i=new Map;var d;d={init:async function(e,r,t,n,o,d){a||await s;const c=JSON.stringify(r),u=allocate(intArrayFromString(c),"i8",0),l=a.init(),f=a.loadFromData(l,u);a.resize(l,t,t),i.set(e,{imgSize:t,reduceFactor:o,handle:l}),d(Math.ceil(f/o))},renderFrames:async function(e,r,t,n){a||await s;const{imgSize:o,reduceFactor:d,handle:c}=i.get(e);for(let e=r;e<=t;e++){const r=e*d;a.render(c,r);const t=a.buffer(c),s=Module.HEAPU8.subarray(t,t+o*o*4);n(e,new Uint8ClampedArray(s).buffer)}},destroy:function(e){const r=i.get(e);a.destroy(r.handle),i.delete(e)}},onmessage=async e=>{const{data:r}=e;switch(r.type){case"callMethod":{const{messageId:e,name:t,args:a}=r;try{if(e){const r=(...r)=>{const t=r[r.length-1];o({type:"methodCallback",messageId:e,callbackArgs:r},t instanceof ArrayBuffer?[t]:void 0)};n.set(e,r),a.push(r)}const[r,s]=await d[t](...a)||[];e&&o({type:"methodResponse",messageId:e,response:r},s)}catch(r){e&&o({type:"methodResponse",messageId:e,error:{message:r.message}})}e&&n.delete(e);break}case"cancelProgress":{const e=n.get(r.messageId);e&&(e.isCanceled=!0);break}}}}]); -//# sourceMappingURL=56e8755feac92cbac7ab.worker.js.map \ No newline at end of file +//# sourceMappingURL=2234fe4113e6b0a9c696.worker.js.map \ No newline at end of file diff --git a/dist/2234fe4113e6b0a9c696.worker.js.map b/dist/2234fe4113e6b0a9c696.worker.js.map new file mode 100644 index 00000000..dc00c6b4 --- /dev/null +++ b/dist/2234fe4113e6b0a9c696.worker.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/config.ts","webpack:///./src/util/createWorkerInterface.ts","webpack:///./src/lib/rlottie/rlottie.worker.ts"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","window","innerHeight","Math","round","Set","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","api","async","animationData","imgSize","isLowPriority","reduceFactor","onInit","json","JSON","stringify","stringOnWasmHeap","allocate","intArrayFromString","handle","framesCount","set","ceil","renderFrames","fromIndex","toIndex","onProgress","realIndex","bufferPointer","HEAPU8","subarray","Uint8ClampedArray","renderer","delete","onmessage","messageId","args","callback","callbackArgs","lastArg","length","ArrayBuffer","undefined","push","response","isCanceled"],"mappings":"aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ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,iBACNqD,YACAvD,MAAO,CAAEG,QAASH,EAAMG,WAK1BoD,GACFjD,EAAc+C,OAAOE,GAGvB,MAEF,IAAK,iBAAkB,CACrB,MAAME,EAAWnD,EAAclC,IAAIoC,EAAK+C,WACpCE,IACFA,EAASQ,YAAa,GAGxB","file":"2234fe4113e6b0a9c696.worker.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n","export const PAGE_TITLE = 'Telegram';\nexport const INACTIVE_MARKER = ' [Inactive]';\n\nexport const APP_NAME = process.env.APP_NAME || 'Telegram WebZ';\nexport const APP_VERSION = process.env.APP_VERSION || 'dev';\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 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_CHAT_LIST_LIMIT = 30;\nexport const GLOBAL_STATE_CACHE_USER_LIST_LIMIT = 5000;\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-v5';\nexport const ASSET_CACHE_NAME = 'tt-assets';\nexport const TRANSPARENT_PIXEL = 'data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==';\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_SENSITIVE_AREA = 750;\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;\n\nexport const TOP_CHAT_MESSAGES_PRELOAD_LIMIT = 20;\nexport const ALL_CHATS_PRELOAD_DISABLED = false;\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\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;\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 = 80;\nexport const STICKER_SIZE_INLINE_BOT_RESULT = 100;\nexport const RECENT_STICKERS_LIMIT = 20;\nexport const MEMOJI_STICKER_ID = 'MEMOJI_STICKER';\n\nexport const BASE_EMOJI_KEYWORD_LANG = 'en';\n\nexport const MENU_TRANSITION_DURATION = 200;\nexport const SLIDE_TRANSITION_DURATION = 450;\n\nexport const CONTENT_TYPES_FOR_QUICK_UPLOAD = new Set([\n 'image/png', 'image/gif', 'image/jpeg', 'video/mp4', 'video/avi', 'video/quicktime',\n]);\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_TME_LINK = /^(?:https?:\\/\\/)?(?:t\\.me\\/)([\\d\\w_]+)(?:\\/([\\d]+))?(?:\\/([\\d]+))?$/gm;\nexport const RE_TME_INVITE_LINK = /^(?:https?:\\/\\/)?(?:t\\.me\\/joinchat\\/)([\\d\\w_-]+)?$/gm;\n\n// MTProto constants\nexport const SERVICE_NOTIFICATIONS_USER_ID = 777000;\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","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) {\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 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 renderers = new Map();\n\nasync function init(\n key: string,\n animationData: AnyLiteral,\n imgSize: number,\n isLowPriority: boolean,\n reduceFactor: number,\n onInit: CancellableCallback,\n) {\n if (!rLottieApi) {\n await rLottieApiPromise;\n }\n\n const json = JSON.stringify(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 renderers.set(key, { imgSize, reduceFactor, handle });\n\n onInit(Math.ceil(framesCount / reduceFactor));\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 renderFrames,\n destroy,\n});\n"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/3.86fc6942f17ca54599b3.css b/dist/3.33a9836ed01b17d89349.css similarity index 94% rename from dist/3.86fc6942f17ca54599b3.css rename to dist/3.33a9836ed01b17d89349.css index 78cdafde..484098eb 100644 --- a/dist/3.86fc6942f17ca54599b3.css +++ b/dist/3.33a9836ed01b17d89349.css @@ -52,7 +52,7 @@ #monkey{position:relative;display:block;margin-left:auto;margin-right:auto;width:7.5rem;height:7.5rem;margin-bottom:1.75rem}@media (min-width: 600px) and (min-height: 450px){#monkey{width:10rem;height:10rem;margin-bottom:2.5rem}}#monkey.big{width:10rem;height:10rem}#monkey .AnimatedSticker{position:absolute;left:0;top:0;width:100%;height:100%}#monkey .AnimatedSticker.hidden{display:none}#monkey .monkey-preview{width:100%;height:100%;background-size:100%;background:url(monkey.a3d5fcdc50b18dc55695f7dd4101a8c9.svg) center} -#Settings{height:100%}#Settings>div{display:flex;flex-direction:column;overflow:hidden}.settings-main-header{display:flex;flex-grow:1;justify-content:space-between;align-items:center}.settings-more-menu .bubble{width:auto}.settings-more-menu .bubble .MenuItem button{padding-left:1rem !important;padding-right:2rem !important}.settings-content{background:var(--color-background);height:calc(100% - var(--header-height));overflow-y:auto}.settings-content.infinite-scroll{display:flex;flex-direction:column}.settings-content.infinite-scroll>.custom-scroll{flex:1 1 auto;height:auto}.settings-content #monkey{margin-top:.5rem;margin-bottom:1rem}.settings-content .AnimatedEmoji{margin-top:.5rem;margin-bottom:1.5rem}.settings-content-header{display:flex;flex-direction:column;align-items:center;padding:0 1.5rem 1rem;text-align:center}.settings-content-header .input-group{width:100%}.settings-content-icon{width:5rem;height:5rem;margin-bottom:2.5rem;position:relative}.settings-content-icon .AnimatedSticker{position:absolute;left:0;top:0;width:100%;height:100%}.settings-content-icon .AnimatedSticker.hidden{display:none}.settings-main-menu{padding:0 0.5rem 1rem}.settings-current-user{margin-bottom:1.125rem;text-align:center}.settings-current-user .Avatar{margin:0 auto 1.5rem}.settings-current-user .name{display:flex;justify-content:center;align-items:center;font-weight:500;font-size:1.5rem;line-height:2rem;margin:0}.settings-current-user .name .VerifiedIcon{margin-left:0.25rem;margin-top:0.1rem}.settings-current-user .phone{font-size:0.875rem;color:#868e96;margin:0}.settings-item{border-top:1px solid var(--color-borders);padding:1.5rem 1.5rem 1rem}.settings-item.no-border{border-top:none}.settings-item-header{font-size:1rem;color:var(--color-text-secondary);margin-bottom:2rem;position:relative}.settings-item-header[dir=rtl]{text-align:right}.settings-item-description{font-size:0.875rem;color:var(--color-text-secondary);margin-top:-0.5rem;margin-bottom:1.5rem}.settings-content.two-fa .settings-item-description{font-size:1rem}.settings-item-description[dir=rtl]{text-align:right;unicode-bidi:plaintext}.settings-item-description-larger{font-size:1rem;line-height:1.3125rem;color:var(--color-text-secondary);margin-top:2rem;margin-bottom:0.75rem}.settings-item-description-larger[dir=rtl]{text-align:right}.settings-item .ListItem{margin:0 -1rem 1rem}.settings-item .ListItem:last-child{margin-bottom:0}.settings-item .ListItem .multiline-menu-item{white-space:initial}.settings-item .ListItem .multiline-menu-item.full-size{width:100%}.settings-item .ListItem .multiline-menu-item .date{float:right;font-size:0.75rem;margin-left:1rem;color:var(--color-text-secondary)}.settings-item .ListItem .multiline-menu-item .title,.settings-item .ListItem .multiline-menu-item .subtitle{display:block;text-align:left}.settings-item .ListItem .multiline-menu-item .title{line-height:1.25rem}.settings-item .ListItem .multiline-menu-item .subtitle{font-size:0.875rem;line-height:1.5rem;color:var(--color-text-secondary)}.settings-item .ListItem .multiline-menu-item .subtitle+.subtitle{margin-top:-0.25rem}.settings-item .ListItem .multiline-menu-item .subtitle.black{color:var(--color-text)}.settings-item .ListItem .multiline-menu-item .subtitle.tight{line-height:1.3125rem;margin-bottom:.1875rem}.settings-item .ListItem.destructive .ListItem-button{color:var(--color-error)}.settings-item .ListItem.destructive .ListItem-button i{color:inherit}.settings-item .ListItem.blocked-list-item{margin-bottom:0.5rem}.settings-item .ListItem.blocked-list-item .ListItem-button{align-items:center;text-align:left;padding:0.5rem}.settings-item .ListItem.blocked-list-item .Avatar{width:3rem;height:3rem;margin-right:1rem}.settings-item .ListItem.blocked-list-item .contact-name{font-size:1rem;line-height:1rem;margin-bottom:0.25rem;font-weight:500}.settings-item .ListItem.blocked-list-item .contact-phone{font-size:0.875rem;line-height:1rem;color:var(--color-text-secondary)}.settings-item .ListItem[dir=rtl] .multiline-menu-item .title,.settings-item .ListItem[dir=rtl] .multiline-menu-item .subtitle{text-align:right}.settings-item .ListItem[dir=rtl] .multiline-menu-item .date{float:left;margin-left:0;margin-right:1rem}.settings-item .RangeSlider{margin-bottom:1.0625rem}.settings-item .Checkbox,.settings-item .radio-group{margin:0 -1rem 0.5rem}.settings-item .radio-group .Radio:last-child{margin-bottom:0}.settings-item .Radio+.Radio,.settings-item .Checkbox+.Checkbox{margin-top:2rem}.settings-fab-wrapper{height:calc(100% - var(--header-height));position:relative;overflow:hidden}.settings-fab-wrapper .settings-content{height:100%}.settings-fab-wrapper .FloatingActionButton{right:1.5rem}.settings-edit-profile{padding:0 1.5rem}.username-link{color:var(--color-links)} +#Settings{height:100%}#Settings>div{display:flex;flex-direction:column;overflow:hidden}.settings-main-header{display:flex;flex-grow:1;justify-content:space-between;align-items:center}.settings-more-menu .bubble{width:auto}.settings-more-menu .bubble .MenuItem button{padding-left:1rem !important;padding-right:2rem !important}.settings-content{background:var(--color-background);height:calc(100% - var(--header-height));overflow-y:auto}.settings-content.infinite-scroll{display:flex;flex-direction:column}.settings-content.infinite-scroll>.custom-scroll{flex:1 1 auto;height:auto}.settings-content #monkey{margin-top:.5rem;margin-bottom:1rem}.settings-content .AnimatedEmoji{margin-top:.5rem;margin-bottom:1.5rem}.settings-content-header{display:flex;flex-direction:column;align-items:center;padding:0 1.5rem 1rem;text-align:center}.settings-content-header .input-group{width:100%}.settings-content-icon{width:5rem;height:5rem;margin-bottom:2.5rem;position:relative}.settings-content-icon .AnimatedSticker{position:absolute;left:0;top:0;width:100%;height:100%}.settings-content-icon .AnimatedSticker.hidden{display:none}.settings-main-menu{padding:0 0.5rem 1rem}.settings-current-user{margin-bottom:1.125rem;text-align:center}.settings-current-user .Avatar{margin:0 auto 1.5rem}.settings-current-user .name{display:flex;justify-content:center;align-items:center;font-weight:500;font-size:1.5rem;line-height:2rem;margin:0}.settings-current-user .name .VerifiedIcon{margin-left:0.25rem;margin-top:0.1rem}.settings-current-user .phone{font-size:0.875rem;color:#868e96;margin:0}.settings-item{border-top:1px solid var(--color-borders);padding:1.5rem 1.5rem 1rem}.settings-item.no-border{border-top:none}.settings-item-header{font-size:1rem;color:var(--color-text-secondary);margin-bottom:2rem;position:relative}.settings-item-header[dir=rtl]{text-align:right}.settings-item-slider{margin-top:2rem}.settings-item-description{font-size:0.875rem;color:var(--color-text-secondary);margin-top:-0.5rem;margin-bottom:1.5rem}.settings-content.two-fa .settings-item-description{font-size:1rem}.settings-item-description[dir=rtl]{text-align:right;unicode-bidi:plaintext}.settings-item-description-larger{font-size:1rem;line-height:1.3125rem;color:var(--color-text-secondary);margin-top:2rem;margin-bottom:0.75rem}.settings-item-description-larger[dir=rtl]{text-align:right}.settings-item .ListItem{margin:0 -1rem 1rem}.settings-item .ListItem:last-child{margin-bottom:0}.settings-item .ListItem .multiline-menu-item{white-space:initial}.settings-item .ListItem .multiline-menu-item.full-size{width:100%}.settings-item .ListItem .multiline-menu-item .date{float:right;font-size:0.75rem;margin-left:1rem;color:var(--color-text-secondary)}.settings-item .ListItem .multiline-menu-item .title,.settings-item .ListItem .multiline-menu-item .subtitle{display:block;text-align:left}.settings-item .ListItem .multiline-menu-item .title{line-height:1.25rem}.settings-item .ListItem .multiline-menu-item .subtitle{font-size:0.875rem;line-height:1.5rem;color:var(--color-text-secondary)}.settings-item .ListItem .multiline-menu-item .subtitle+.subtitle{margin-top:-0.25rem}.settings-item .ListItem .multiline-menu-item .subtitle.black{color:var(--color-text)}.settings-item .ListItem .multiline-menu-item .subtitle.tight{line-height:1.3125rem;margin-bottom:.1875rem}.settings-item .ListItem.destructive .ListItem-button{color:var(--color-error)}.settings-item .ListItem.destructive .ListItem-button i{color:inherit}.settings-item .ListItem.blocked-list-item{margin-bottom:0.5rem}.settings-item .ListItem.blocked-list-item .ListItem-button{align-items:center;text-align:left;padding:0.5rem}.settings-item .ListItem.blocked-list-item .Avatar{width:3rem;height:3rem;margin-right:1rem}.settings-item .ListItem.blocked-list-item .contact-name{font-size:1rem;line-height:1rem;margin-bottom:0.25rem;font-weight:500}.settings-item .ListItem.blocked-list-item .contact-phone{font-size:0.875rem;line-height:1rem;color:var(--color-text-secondary)}.settings-item .ListItem[dir=rtl] .multiline-menu-item .title,.settings-item .ListItem[dir=rtl] .multiline-menu-item .subtitle{text-align:right}.settings-item .ListItem[dir=rtl] .multiline-menu-item .date{float:left;margin-left:0;margin-right:1rem}.settings-item .RangeSlider{margin-bottom:1.0625rem}.settings-item .Checkbox,.settings-item .radio-group{margin:0 -1rem 0.5rem}.settings-item .radio-group .Radio:last-child{margin-bottom:0}.settings-item .Radio+.Radio,.settings-item .Checkbox+.Checkbox{margin-top:2rem}.settings-fab-wrapper{height:calc(100% - var(--header-height));position:relative;overflow:hidden}.settings-fab-wrapper .settings-content{height:100%}.settings-fab-wrapper .FloatingActionButton{right:1.5rem}.settings-edit-profile{padding:0 1.5rem}.username-link{color:var(--color-links)} .NewChat{height:100%;overflow:hidden;position:relative}.NewChat-inner{height:calc(100% - var(--header-height));overflow:hidden}.NewChat-inner.step-2{padding:0 1.25rem;display:flex;flex-direction:column}.NewChat-inner.step-2 .note,.NewChat-inner.step-2 .error{font-size:0.875rem;line-height:1.25rem;margin:1.5rem 0.25rem}.NewChat-inner.step-2 .error{color:var(--color-error)}.NewChat-inner.step-2 .note{margin-top:-0.5625rem;color:var(--color-text-secondary)}.NewChat-inner.step-2 .chat-members-heading{color:var(--color-text-secondary);font-size:1rem;font-weight:500;margin:1rem 0.25rem}.NewChat-inner.step-2 .chat-members-list{margin:0 -1.25rem;padding:0 1rem 1rem;overflow-x:hidden;flex-grow:1} @@ -88,8 +88,6 @@ .StickerTooltip{display:grid;grid-template-columns:repeat(auto-fill, minmax(5rem, 1fr));grid-auto-rows:auto;place-items:center}.StickerTooltip.hidden{display:none} -.KeyboardMenu .bubble{width:100% !important;max-width:27rem;border-radius:var(--border-radius-default-small)}.KeyboardMenu .content{display:flex;flex-direction:column;padding:.1875rem .625rem;max-height:80vh;overflow:auto}@media (max-width: 600px){.KeyboardMenu .content{max-height:75vh}}.KeyboardMenu .content .row{display:flex;flex-direction:row}.KeyboardMenu .content .row+.row{margin-top:.375rem}.KeyboardMenu .content .Button{flex:1;width:auto;height:auto;min-height:3.0625rem;border-radius:var(--border-radius-messages-small);border:2px solid var(--color-primary);background:var(--color-background);color:var(--color-primary);font-weight:500;text-transform:none}.KeyboardMenu .content .Button:hover{color:#fff;border-color:var(--color-primary-shade)}.KeyboardMenu .content .Button+.Button{margin-left:.375rem} - .CustomSendMenu{position:relative;bottom:3.5rem}.is-pointer-env .CustomSendMenu>.backdrop{position:absolute;top:-1rem;left:auto;right:0;width:3.5rem}.CustomSendMenu .media-disabled>button{white-space:normal}.CustomSendMenu .bubble{width:16rem} .EmojiTooltip{display:flex;padding-left:.25rem;overflow-x:auto;overflow-x:overlay;overflow-y:hidden}.EmojiTooltip .EmojiButton{flex:0 0 2.5rem} @@ -125,4 +123,4 @@ .PaymentModal .modal-backdrop{pointer-events:none}.PaymentModal .header{position:relative;border-top-left-radius:10px;border-top-right-radius:10px;width:100%;padding:.25rem 1rem;display:flex;align-items:center;flex-direction:row;background:var(--color-background);border-bottom:1px var(--color-borders) solid}.PaymentModal .header h3{margin-bottom:0;margin-left:1.5rem;unicode-bidi:plaintext;text-align:initial}.PaymentModal .Transition{height:25rem}.PaymentModal .empty-content{height:25rem;max-height:90%;display:flex;align-items:center;justify-content:center}.PaymentModal .receipt-content{height:25rem;overflow-y:auto}.PaymentModal .content{overflow:auto;width:100%;height:100%;position:relative}.PaymentModal .footer{position:relative;border-bottom-left-radius:10px;border-bottom-right-radius:10px;width:100%;padding:.75rem 1rem;background:var(--color-background);border-top:1px var(--color-borders) solid}.PaymentModal .footer button{text-transform:none;font-weight:500}.PaymentModal .modal-dialog{width:25rem}.PaymentModal .modal-content{padding:0;overflow:hidden}@media screen and (max-device-width: 640px) and (max-height: 640px) and (orientation: landscape){.PaymentModal .modal-dialog{max-height:100%}.PaymentModal .Transition{height:10rem}} -/*# sourceMappingURL=3.86fc6942f17ca54599b3.css.map*/ \ No newline at end of file +/*# sourceMappingURL=3.33a9836ed01b17d89349.css.map*/ \ No newline at end of file diff --git a/dist/3.33a9836ed01b17d89349.css.map b/dist/3.33a9836ed01b17d89349.css.map new file mode 100644 index 00000000..a81ffd29 --- /dev/null +++ b/dist/3.33a9836ed01b17d89349.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack:///./src/components/mediaViewer/SenderInfo.scss","webpack:///./src/components/mediaViewer/MediaViewerActions.scss","webpack:///./src/components/mediaViewer/MediaViewerFooter.scss","webpack:///./src/components/mediaViewer/VideoPlayerControls.scss","webpack:///./src/components/mediaViewer/VideoPlayer.scss","webpack:///./src/components/mediaViewer/ZoomControls.scss","webpack:///./src/components/mediaViewer/PanZoom.scss","webpack:///./src/components/mediaViewer/MediaViewer.scss","webpack:///./src/components/main/ForwardPicker.scss","webpack:///./src/components/main/Dialogs.scss","webpack:///./src/components/common/CalendarModal.scss","webpack:///./src/components/middle/MessageSelectToolbar.scss","webpack:///./src/components/left/search/RecentContacts.scss","webpack:///./src/components/left/search/ChatMessage.scss","webpack:///./src/components/left/search/DateSuggest.scss","webpack:///./src/components/left/search/LeftSearch.scss","webpack:///./src/components/ui/CropModal.scss","webpack:///./src/components/ui/AvatarEditable.scss","webpack:///./src/components/ui/ShowMoreButton.scss","webpack:///./src/components/left/settings/folders/SettingsFoldersChatsPicker.scss","webpack:///./src/components/left/settings/folders/SettingsFolders.scss","webpack:///./src/components/ui/RangeSlider.scss","webpack:///./src/components/left/settings/SettingsStickerSet.scss","webpack:///./src/components/left/settings/WallpaperTile.scss","webpack:///./src/components/left/settings/SettingsGeneralBackground.scss","webpack:///./src/components/left/settings/SettingsGeneralBackgroundColor.scss","webpack:///./src/components/common/PasswordMonkey.scss","webpack:///./src/components/left/settings/Settings.scss","webpack:///./src/components/left/newChat/NewChat.scss","webpack:///./src/components/left/ArchivedChats.scss","webpack:///./src/components/middle/message/MessageContextMenu.scss","webpack:///./src/components/common/StickerSetModal.scss","webpack:///./src/components/middle/HeaderMenuContainer.scss","webpack:///./src/components/middle/MobileSearch.scss","webpack:///./src/components/middle/composer/MentionTooltip.scss","webpack:///./src/components/middle/composer/AttachmentModal.scss","webpack:///./src/components/middle/composer/PollModal.scss","webpack:///./src/components/middle/composer/EmojiButton.scss","webpack:///./src/components/middle/composer/EmojiPicker.scss","webpack:///./src/components/middle/composer/StickerPicker.scss","webpack:///./src/components/common/GifButton.scss","webpack:///./src/components/middle/composer/GifPicker.scss","webpack:///./src/components/middle/composer/SymbolMenu.scss","webpack:///./src/components/middle/composer/AttachMenu.scss","webpack:///./src/components/middle/composer/StickerTooltip.scss","webpack:///./src/components/middle/composer/CustomSendMenu.scss","webpack:///./src/components/middle/composer/EmojiTooltip.scss","webpack:///./src/components/middle/composer/inlineResults/BaseResult.scss","webpack:///./src/components/middle/composer/inlineResults/MediaResult.scss","webpack:///./src/components/middle/composer/InlineBotTooltip.scss","webpack:///./src/components/right/RightSearch.scss","webpack:///./src/components/right/StickerSearch.scss","webpack:///./src/components/right/GifSearch.scss","webpack:///./src/components/right/PollAnswerResults.scss","webpack:///./src/components/right/PollResults.scss","webpack:///./src/components/right/management/Management.scss","webpack:///./src/components/payment/ShippingInfo.scss","webpack:///./src/components/payment/Shipping.scss","webpack:///./src/components/payment/Checkout.scss","webpack:///./src/components/payment/CardInput.scss","webpack:///./src/components/payment/PaymentInfo.scss","webpack:///./src/components/payment/PaymentModal.scss"],"names":[],"mappings":"AAAA,YAAY,aAAa,qBAAqB,YAAY,eAAe,WAAW,wBAAwB,kBAAkB,UAAU,oBAAoB,uBAAuB,0BAA0B,oBAAoB,cAAc,kBAAkB,aAAa,sBAAsB,uBAAuB,eAAe,mBAAmB,oBAAoB,gBAAgB,gBAAgB,gBAAgB,uBAAuB,kBAAkB,oBAAoB,mBAAmB;;ACAjf,oBAAoB,aAAa,yBAAyB,2BAA2B,4BAA4B,2BAA2B,2BAA2B,kBAAkB,4CAA4C,kBAAkB,MAAM;;ACA7P,mBAAmB,kBAAkB,SAAS,eAAe,WAAW,wBAAwB,uCAAuC,aAAa,2BAA2B,mBAAmB,mBAAmB,0BAA0B,mBAAmB,sBAAsB,gEAAgE,gCAAgC,UAAU,oBAAoB,wDAAwD,UAAU,oBAAoB,gDAAgD,kBAAkB,0CAA0C,YAAY,eAAe,WAAW,wBAAwB,sDAAsD,UAAU,0BAA0B,gDAAg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Content":[".SenderInfo{display:flex;align-content:center;color:white;cursor:pointer;opacity:.5;transition:.15s opacity}.SenderInfo:hover{opacity:1}.SenderInfo .Avatar{margin-inline-end:1rem}@media (max-width: 600px){.SenderInfo .Avatar{display:none}}.SenderInfo .meta{display:flex;flex-direction:column;justify-content:center;max-width:100%}.SenderInfo .title{line-height:1.45rem;font-weight:500;white-space:pre;overflow:hidden;text-overflow:ellipsis}.SenderInfo .date{line-height:1.25rem;font-size:0.875rem;letter-spacing:-0.01rem}\n",".MediaViewerActions{display:flex;margin-inline-start:auto;margin-inline-end:-.375rem}.MediaViewerActions .Button{margin-inline-start:.25rem}.MediaViewerActions-mobile{position:relative}.MediaViewerActions-mobile .ProgressSpinner{position:absolute;top:0;left:0}\n",".MediaViewerFooter{position:absolute;bottom:0;padding:1rem 0;width:100%;transition:opacity .15s}#MediaViewer.zoomed .MediaViewerFooter{display:none}@media (max-height: 640px){.MediaViewerFooter{padding:.5rem 0 0}}@media (max-width: 600px){.MediaViewerFooter{padding-bottom:4.5rem;background:linear-gradient(to top, #000 0%, rgba(0,0,0,0) 100%)}.MediaViewerFooter.is-for-video{opacity:0;pointer-events:none}.video-controls-visible .MediaViewerFooter.is-for-video{opacity:1;pointer-events:all}}.MediaViewerFooter .media-viewer-footer-content{position:relative;max-width:var(--messages-container-width);margin:auto;cursor:pointer;opacity:.5;transition:opacity .15s}.MediaViewerFooter .media-viewer-footer-content:hover{opacity:1}@media (max-width: 600px){.MediaViewerFooter .media-viewer-footer-content{opacity:1}}.MediaViewerFooter.is-hidden{opacity:0}.MediaViewerFooter .media-text{margin-bottom:0;overflow:auto;padding:0 .5rem;text-align:center;color:rgba(255,255,255,0.9);font-size:.9375rem;letter-spacing:.025rem;max-height:4.25rem}@media (max-height: 640px){.MediaViewerFooter .media-text{max-height:2.75rem}}.MediaViewerFooter .media-text .emoji{width:.9375rem;height:.9375rem;vertical-align:-2px}.MediaViewerFooter .media-text.multiline::before{content:'';position:absolute;left:-.75rem;right:-.75rem;top:-.25rem;bottom:-.25rem;background:rgba(0,0,0,0.75);border-radius:var(--border-radius-default);z-index:var(--z-below)}@media (max-width: 600px){.MediaViewerFooter .media-text.multiline::before{display:none;background:none}}.MediaViewerFooter a{color:var(--color-links)}.MediaViewerFooter a:hover,.MediaViewerFooter a:focus{color:var(--color-links-hover)}\n",".VideoPlayerControls{display:flex;align-items:center;position:absolute;left:0;bottom:0;width:100%;padding-top:.625rem;font-size:.875rem;background:linear-gradient(to top, #000 0%, rgba(0,0,0,0) 100%)}#MediaViewer.zoomed .VideoPlayerControls{display:none}@media (max-width: 600px){.VideoPlayerControls{position:fixed;padding:1.25rem .5rem .75rem;background:none;z-index:var(--z-media-viewer)}}.VideoPlayerControls.mobile .player-file-size{position:static;left:auto;transform:none;margin-left:auto}.VideoPlayerControls.mobile .fullscreen{margin-left:1rem}.VideoPlayerControls.mobile .player-time+.fullscreen{margin-left:auto}.VideoPlayerControls .Button{width:2.25rem;padding:0;margin:.25rem;height:1.75rem}@media (max-width: 600px){.VideoPlayerControls .Button{height:2.25rem}}.VideoPlayerControls .play i{line-height:1.5rem}.VideoPlayerControls .player-time{margin:0 1rem;white-space:nowrap}.VideoPlayerControls .fullscreen{margin-left:auto}@media (max-width: 600px){.VideoPlayerControls .fullscreen{margin-left:1rem}}.VideoPlayerControls .fullscreen i{line-height:1.75rem}@media (max-width: 600px){.VideoPlayerControls .fullscreen i{font-size:1.5rem}}@media (max-width: 600px){.VideoPlayerControls .player-time+.fullscreen{margin-left:auto}}.VideoPlayerControls .player-file-size{position:absolute;left:50%;transform:translateX(-50%);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}@media (max-width: 600px){.VideoPlayerControls .player-file-size{position:static;left:auto;transform:none;margin-left:auto;margin-right:1rem}.VideoPlayerControls .player-file-size+.fullscreen{margin-left:0}}.VideoPlayerControls .player-seekline{position:absolute;left:1rem;right:1rem;top:0;height:1rem}.VideoPlayerControls .player-seekline-track{position:absolute;top:50%;left:-.25rem;right:-.25rem;height:5px;transform:translateY(-50%);background-color:rgba(255,255,255,0.16);border-radius:var(--border-radius-default)}.VideoPlayerControls .player-seekline-buffered,.VideoPlayerControls .player-seekline-played,.VideoPlayerControls .player-seekline-input{position:absolute;top:0;left:0;height:100%;border-radius:var(--border-radius-default)}.VideoPlayerControls .player-seekline-buffered{background-color:rgba(255,255,255,0.5)}.VideoPlayerControls .player-seekline-played{background:var(--color-primary)}.VideoPlayerControls .player-seekline-played::after{content:'';position:absolute;width:.75rem;height:.75rem;border-radius:50%;background-color:var(--color-primary);right:0;top:50%;transform:translate(0.325rem, -50%)}.VideoPlayerControls .player-seekline-input{width:100%;opacity:0;margin:0;padding:0;cursor:pointer;overflow:hidden}.VideoPlayerControls .player-seekline-input::-webkit-slider-thumb{margin-top:-2rem}\n",".VideoPlayer{position:relative;display:inline-flex;flex-direction:column;overflow:hidden}#MediaViewer.zoomed .VideoPlayer{position:absolute;top:0;right:0;bottom:0;left:0}#MediaViewer.zoomed .VideoPlayer>div{width:100% !important;height:100% !important}#MediaViewer.zoomed .VideoPlayer video{max-height:none !important}@media (min-width: 601px){.VideoPlayer{z-index:1}}@media (max-width: 600px){.VideoPlayer{overflow:visible}}@media (max-height: 640px){.VideoPlayer{margin-bottom:1.75rem}.has-footer .VideoPlayer{margin-bottom:0}}.VideoPlayer video{display:block;max-height:calc(100vh - 8.25rem);margin:auto;object-fit:contain;outline:none;width:100%;height:100%;background:no-repeat 50% 50%;background-size:contain}@media (max-height: 640px){.VideoPlayer video{max-height:calc(100vh - 10rem)}}.has-footer .VideoPlayer video{max-height:calc(100vh - 15rem)}@media (max-height: 640px){.has-footer .VideoPlayer video{max-height:calc(100vh - 10rem)}}.VideoPlayer .play-button{position:absolute;left:50%;top:50%;transform:translate(-50%, -50%);width:3.25rem;height:3.25rem;background-color:rgba(0,0,0,0.5) !important}body:not(.animation-level-0) .VideoPlayer .play-button{transition:opacity .3s ease !important}.VideoPlayer .play-button .icon-play{font-size:1.75rem;position:relative;left:.125rem}.VideoPlayer .spinner-container{position:absolute;top:0;left:0;width:100%;height:100%;display:flex;align-items:center;justify-content:center}.VideoPlayer .spinner-container .buffering{background:rgba(0,0,0,0.25);color:#fff;font-size:0.75rem;position:absolute;left:0.1875rem;top:0.1875rem;z-index:1;padding:0 0.375rem;border-radius:0.75rem;line-height:1.125rem}.VideoPlayer .spinner-container .ProgressSpinner{cursor:pointer}\n",".ZoomControls{position:absolute;bottom:1.25rem;left:50%;background:rgba(0,0,0,0.5);border-radius:var(--border-radius-default);width:100%;height:3.375rem;max-width:274px;transform:translate3d(-50%, 0, 10px);transition:opacity .3s ease-in;pointer-events:none}.ZoomControls.open{z-index:var(--z-media-viewer);pointer-events:all}.ZoomControls .zoom-out,.ZoomControls .zoom-in{position:absolute;top:0.4375rem;width:2.5rem;height:2.5rem;color:#fff}.ZoomControls .zoom-out i,.ZoomControls .zoom-in i{font-size:1.5rem}.ZoomControls .zoom-out{left:.5rem}.ZoomControls .zoom-in{right:.5rem}.ZoomControls .seekline{position:absolute;left:3.25rem;right:3.25rem;top:1.125rem;height:1rem}.ZoomControls .seekline-track{position:absolute;top:50%;left:-.25rem;right:-.25rem;height:2px;transform:translateY(-50%);background-color:rgba(255,255,255,0.5);border-radius:var(--border-radius-default)}.ZoomControls .seekline-played,.ZoomControls .seekline-input{position:absolute;top:0;left:0;height:100%;border-radius:var(--border-radius-default)}.ZoomControls .seekline-played{background:#fff;transition:width 200ms}.ZoomControls .seekline-played::after{content:'';position:absolute;width:.75rem;height:.75rem;border-radius:50%;background-color:var(--color-white);right:0;top:50%;transform:translate(0.325rem, -50%)}.ZoomControls .seekline-input{width:100%;height:1rem;top:-.375rem;opacity:0;margin:0;padding:0;cursor:pointer;overflow:hidden}.ZoomControls .seekline-input::-webkit-slider-thumb{margin-top:-2rem}\n",".pan-wrapper,.pan-container{position:relative;width:100%;height:100%}.pan-wrapper{cursor:move;-webkit-user-select:none;user-select:none}.pan-container{transition:transform .2s ease-in}.pan-wrapper.move .pan-container{transition:none}.zoomed .pan-container{position:fixed;top:0;left:0}\n","#MediaViewer{position:fixed;top:0;left:0;width:100vw;height:100%;background:rgba(0,0,0,0.9);color:#fff;z-index:var(--z-media-viewer);padding:0.5rem 0;display:grid;grid-template-columns:auto;grid-template-rows:2.75rem 1fr;grid-column-gap:0;grid-row-gap:0;justify-items:stretch;align-items:center}#MediaViewer:not(.shown){display:block !important;transform:scale(0)}body.ghost-animating #MediaViewer>.pan-wrapper,body.ghost-animating #MediaViewer>.Transition,body.ghost-animating #MediaViewer>button{display:none}body.animation-level-2 #MediaViewer{transition-duration:.3s !important}#MediaViewer:not(.open) .SenderInfo,#MediaViewer .closing .SenderInfo{pointer-events:none;transition:none}#MediaViewer.zoomed .navigation{display:none}#MediaViewer.zoomed .media-viewer-head{z-index:2}#MediaViewer.zoomed .media-viewer-content{position:fixed;top:0;left:0;width:100vw;height:100vh;padding:0;z-index:1}#MediaViewer .media-viewer-head{display:flex;grid-area:1 / 1 / 2 / -2;padding:0 1.25rem;position:relative;z-index:var(--z-media-viewer-head);min-width:0}#MediaViewer .media-viewer-head>.Transition{width:100%;min-width:0}@media (max-width: 600px){#MediaViewer .media-viewer-head{padding:0 0.5rem}#MediaViewer .media-viewer-head .media-viewer-close{margin-right:1.5rem}}#MediaViewer>.Transition,#MediaViewer>.pan-wrapper{grid-area:1 / 1 / -1 / -1}#MediaViewer>.Transition,#MediaViewer>.pan-wrapper .Transition{position:relative;justify-self:center;text-align:center;width:100%;height:100%;display:flex;align-items:center;overflow:hidden}#MediaViewer .media-viewer-content{position:relative;z-index:1;padding:3.25rem 0;height:100%;display:inline-flex;justify-content:center;align-items:center}#MediaViewer .media-viewer-content.has-footer{padding:7rem 0}@media (min-width: 600px){#MediaViewer .media-viewer-content.has-footer{min-width:600px}}@media (max-height: 640px){#MediaViewer .media-viewer-content.has-footer{padding:4rem 0}}#MediaViewer .media-viewer-content.has-footer>img{max-height:calc(100vh - 15rem)}@media (max-height: 640px){#MediaViewer .media-viewer-content.has-footer>img{max-height:calc(100vh - 10rem)}}#MediaViewer .media-viewer-content .thumbnail{position:relative}#MediaViewer .media-viewer-content .thumbnail img{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%)}#MediaViewer .media-viewer-content>img{max-width:100vw;max-height:calc(100vh - 8.25rem);object-fit:contain;transition:transform .2s}#MediaViewer .media-viewer-content .spinner-wrapper{max-width:100vw;margin:auto}#MediaViewer .media-viewer-content .Spinner{margin:auto}#MediaViewer .navigation{position:fixed;top:4rem;width:10vw;bottom:0;border:none;padding:0;margin:0;-webkit-appearance:none;appearance:none;background:transparent no-repeat;background-size:1.25rem;opacity:0;transition:opacity .15s;outline:none;cursor:pointer;z-index:1}@media (max-width: 600px){#MediaViewer .navigation{width:20vw}}#MediaViewer .navigation:hover,.is-touch-env #MediaViewer .navigation{opacity:1}#MediaViewer .navigation.prev{left:0;background-image:url(media_navigation_previous.11f3cfece8fead5a78e6349db2545210.svg);background-position:1.25rem calc(50% - 2rem)}#MediaViewer .navigation.prev[dir=rtl]{left:auto;right:0;transform:scaleX(-1)}#MediaViewer .navigation.next{right:0;background-image:url(media_navigation_next.3d6e264d21e73ad725738beb8e9dbbb8.svg);background-position:calc(100% - 1.25rem) calc(50% - 2rem)}#MediaViewer .navigation.next[dir=rtl]{left:0;right:auto;transform:scaleX(-1)}#MediaViewer .navigation.inline{top:calc(50% - 3rem);bottom:unset;height:6rem;background-position-y:center}@media (max-width: 600px){#MediaViewer .navigation.inline{opacity:0;transition:opacity .15s ease-in;pointer-events:none}.video-controls-visible #MediaViewer .navigation.inline{opacity:1;pointer-events:all}}.ghost{position:absolute;z-index:var(--z-media-viewer);will-change:transform, opacity;overflow:hidden;border-radius:0;transition:transform .2s ease, opacity .2s ease}.ghost.rounded-corners{border-radius:var(--border-radius-messages)}.ghost.circle{border-radius:50%}body.is-ios .ghost{transition:transform .2s ease, opacity .2s ease, border-radius .2s ease !important}.ghost img,.ghost video{width:100%;height:100%;user-select:none;-webkit-user-select:none;object-fit:cover}\n",".ForwardPicker{z-index:var(--z-media-viewer)}.ForwardPicker .modal-dialog{height:70%;max-width:25rem}@media (max-width: 600px){.ForwardPicker .modal-dialog{height:90%}}.ForwardPicker .modal-header{display:flex;align-items:center;padding:0.25rem 0.5rem}.ForwardPicker .modal-header .Button{margin-right:0.5rem}.ForwardPicker .modal-header .input-group{margin:0}.ForwardPicker .modal-header .form-control{border:none;box-shadow:none !important;height:2.75rem;padding:0.5rem;font-size:1.25rem;line-height:1.75rem;unicode-bidi:plaintext}.ForwardPicker .modal-content{padding:0;overflow:hidden;display:flex;flex-direction:column}.ForwardPicker .modal-content .picker-list{height:100%;overflow-x:hidden;overflow-y:auto;padding:0 1rem 1rem}.ForwardPicker .no-results{height:100%;margin:0;padding:1rem 1rem;display:flex;align-items:center;justify-content:center;color:var(--color-text-secondary)}@media (max-width: 600px){.ForwardPicker .ListItem.chat-item-clickable:not(.force-rounded-corners){margin:0}.ForwardPicker .ListItem.chat-item-clickable:not(.force-rounded-corners) .ListItem-button{border-radius:0}}\n","#Dialogs{position:fixed;top:0;left:0;width:100vw;height:100vh;z-index:var(--z-modal)}\n",".CalendarModal .modal-dialog{max-width:26.25rem}.CalendarModal .modal-dialog .modal-content{padding:.375rem 1rem 1rem}.CalendarModal .timepicker{display:flex;align-items:center;justify-content:center;margin-bottom:1.5rem}.CalendarModal .timepicker .form-control{max-width:5rem;text-align:center}.CalendarModal .timepicker .form-control:first-child{margin-right:1rem}.CalendarModal .timepicker .form-control:last-child{margin-left:1rem}.CalendarModal .footer{display:flex;justify-content:flex-end;flex-direction:column}.CalendarModal .footer .Button{text-transform:none}.CalendarModal .footer .Button+.Button{margin-top:.5rem}.CalendarModal .month-selector{display:flex;align-items:center}.CalendarModal .month-selector h4{flex:1;margin:0 0 0 1.25rem;font-size:1.25rem}@media (max-width: 600px){.CalendarModal .month-selector h4{margin-left:.75rem}}.CalendarModal .month-selector h4 ~ .Button{color:var(--color-primary)}.CalendarModal .month-selector .Button.hidden{opacity:0.5;pointer-events:none}.CalendarModal .day-button{position:relative;border-radius:4rem;outline:none !important;font-weight:500;margin:.125rem .625rem}@media (max-width: 600px){.CalendarModal .day-button{margin:.25rem .375rem}}.CalendarModal .day-button.weekday{margin-bottom:0;height:1rem}.CalendarModal .day-button.clickable{cursor:pointer}.CalendarModal .day-button.clickable:hover{background-color:var(--color-interactive-element-hover)}.CalendarModal .day-button.clickable.selected{background-color:var(--color-primary);color:white}.CalendarModal .day-button.disabled{opacity:0.25;pointer-events:none}.CalendarModal .day-button::before{content:\"\";display:block;padding-top:100%}.CalendarModal .day-button span{position:absolute;top:0;left:0;width:100%;height:100%;display:flex;align-items:center;justify-content:center;font-size:0.875rem}.CalendarModal .calendar-wrapper{display:flex;align-items:center;justify-content:center;min-height:17rem;margin:1.5rem -0.5rem 0.5rem}.CalendarModal .calendar-grid{display:grid;grid-template-columns:repeat(7, 1fr);width:100%}\n",".MessageSelectToolbar{position:absolute;bottom:0.5rem;left:0.5rem;right:0.5rem;width:auto;z-index:20;justify-content:center;margin:0;opacity:1}.mask-image-disabled .MessageSelectToolbar::before{left:auto !important;right:auto !important}.no-composer .MessageSelectToolbar{width:100%}@media (min-width: 601px){.MessageSelectToolbar{left:1rem;right:1rem;bottom:1.25rem}.no-composer .MessageSelectToolbar{top:-4.75rem}}.MessageSelectToolbar-inner{transform:scaleX(1);transition:transform var(--select-transition),opacity var(--select-transition)}.MessageSelectToolbar .MessageSelectToolbar-inner{transform:scaleX(1) translateX(0)}.no-composer .unpin-button-container+.MessageSelectToolbar,.no-composer .messaging-disabled+.MessageSelectToolbar{top:auto}body.animation-level-0 .MessageSelectToolbar{transition:none !important}.MessageSelectToolbar:not(.shown){opacity:0;pointer-events:none}.MessageSelectToolbar:not(.shown)-inner{transform:scaleX(var(--toolbar-hidden-scale, 1))}.MessageSelectToolbar:not(.shown).with-composer .MessageSelectToolbar-inner{transform:scaleX(var(--toolbar-hidden-scale, 1)) translateX(var(--toolbar-translate-x, 0))}.MessageSelectToolbar:not(.shown):not(.with-composer) .MessageSelectToolbar-inner{transform:scaleX(var(--toolbar-unpin-hidden-scale)) translateX(0)}.MessageSelectToolbar::before{z-index:-1;max-width:32rem;width:100%;left:auto;right:auto}.MessageSelectToolbar-inner{width:100%;max-width:32rem;display:flex;align-items:center;padding:0.25rem;background:var(--color-background);border-radius:var(--border-radius-messages);box-shadow:0 1px 2px var(--color-default-shadow);font-weight:500}@media (max-width: 600px){.MessageSelectToolbar-inner{padding:0;max-width:none}}.MessageSelectToolbar-inner>.Button{width:3rem;height:3rem}@media (max-width: 600px){.MessageSelectToolbar-inner>.Button{width:2.875rem;height:2.875rem}}.MessageSelectToolbar-count{margin-left:1rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex-grow:1}@media (max-width: 600px){.MessageSelectToolbar-count{margin-right:0.5rem}}.MessageSelectToolbar-actions{margin-left:auto;display:flex}.MessageSelectToolbar-actions .MenuItem{padding:0.6875rem;border-radius:50%}.MessageSelectToolbar-actions .MenuItem i{margin-right:0}.MessageSelectToolbar-actions .MenuItem .item-text{display:none}\n",".RecentContacts .Loading{min-height:75vh}.RecentContacts .top-peers-section{padding:.5rem 1rem}.RecentContacts .top-peers{height:6rem;margin:0 -1rem;overflow-x:auto;overflow-y:hidden;white-space:nowrap;scrollbar-width:none;scrollbar-color:rgba(0,0,0,0)}.RecentContacts .top-peers::-webkit-scrollbar{height:0}.RecentContacts .top-peers::-webkit-scrollbar-thumb{background-color:rgba(0,0,0,0)}.RecentContacts .top-peer-item{display:inline-block;width:4.5rem;height:6rem;padding:0.625rem 0.25rem;margin-left:0.5rem;border-radius:var(--border-radius-default);cursor:pointer;position:relative;overflow:hidden}.RecentContacts .top-peer-item:first-child{margin-left:0.125rem}.RecentContacts .top-peer-item:last-child{margin-right:0.125rem}.RecentContacts .top-peer-item .Avatar{margin:0 auto 0.375rem}.RecentContacts .top-peer-item:hover{background:var(--color-chat-hover)}.RecentContacts .top-peer-item .top-peer-name{text-align:center;white-space:nowrap;font-size:0.75rem;overflow:hidden;text-overflow:ellipsis}.RecentContacts .top-peer-item .top-peer-name .emoji-small{width:1rem;height:1rem;background-size:1rem;margin-inline-end:1px;vertical-align:-3px}.RecentContacts .recent-chats-header{display:flex;align-items:center}.RecentContacts .recent-chats-header .Button{margin-left:auto}.RecentContacts .recent-chats-header[dir=rtl] .Button{margin-left:0;margin-right:auto}\n",".ChatMessage:first-child{margin-top:.5rem}.ChatMessage:hover .Avatar.online::after,.ChatMessage.selected .Avatar.online::after{border-color:var(--color-chat-hover)}.ChatMessage .ListItem-button{padding:.25rem .5rem}.ChatMessage .info .title{flex-grow:1}.ChatMessage .info h3{font-size:1rem;width:auto}.ChatMessage .info .subtitle{color:var(--color-text-secondary)}.ChatMessage .info .subtitle .matching-text-highlight{color:var(--color-text);background:#CAE3F7;border-radius:0.25rem;padding:0 0.125rem}.ChatMessage .info .message{flex-grow:1;color:var(--color-text-secondary);overflow:hidden;text-overflow:ellipsis}.ChatMessage .info .message .sender-name{color:var(--color-text)}.ChatMessage .info .message .sender-name::after{content:': '}.ChatMessage .info .message img{width:1.25rem;height:1.25rem;object-fit:cover;border-radius:.125rem;vertical-align:-.25rem;margin-right:.25rem}.ChatMessage .info .message .icon-play{position:relative;display:inline-block;font-size:.75rem;color:#fff;margin-inline-start:-1.25rem;margin-inline-end:0.5rem;bottom:0.0625rem}.ChatMessage .info-row{display:flex;justify-content:space-between}.ChatMessage[dir=rtl] .subtitle{text-align:right}\n",".DateSuggest{display:flex;height:2rem;flex-direction:row;justify-content:space-between;margin-left:.5rem;margin-bottom:.5rem}.DateSuggest .date-item{display:flex;flex:1 1 auto;min-width:8rem;margin-top:.375rem;cursor:pointer;font-size:.875rem;font-weight:500;color:var(--color-text-secondary)}.DateSuggest .date-item .icon-calendar{font-size:1.25rem;margin-right:.25rem}\n",".LeftSearch{display:flex;flex-direction:column;height:100%;overflow:hidden}.LeftSearch>.Transition{flex:1;overflow:hidden}.LeftSearch .TabList{padding-bottom:1px;z-index:1}.LeftSearch .documents-list{padding:0 1.25rem 1.25rem}.LeftSearch .documents-list .ListItem+.ListItem{margin-top:1.25rem}.LeftSearch .section-heading{position:relative;padding-top:1.25rem;padding-left:1.25rem;margin:0 0 1rem -1.25rem !important;font-weight:500;font-size:.9375rem;color:var(--color-text-secondary)}.LeftSearch .section-heading::before{content:'';position:absolute;width:100%;height:1px;background:var(--color-borders);left:.625rem;top:-1px}.LeftSearch .section-heading[dir=rtl],.LeftSearch .section-heading[dir=auto]{padding-left:0;padding-right:1.25rem;margin:0 -1.25rem 0 1rem !important;text-align:initial}.LeftSearch .section-heading[dir=rtl]::before,.LeftSearch .section-heading[dir=auto]::before{left:auto;right:.625rem}.LeftSearch .LeftSearch .search-section .section-heading,.LeftSearch .RecentContacts .search-section .section-heading{margin-left:-1rem !important;width:calc(100% + 2rem);box-shadow:0 -1px 0 0 var(--color-borders)}.LeftSearch .LeftSearch .search-section .section-heading::before,.LeftSearch .RecentContacts .search-section .section-heading::before{display:none}.LeftSearch .WebLink{display:flex}.LeftSearch .content:not(.with-seekline){align-self:center;min-width:0;flex-grow:1;overflow:hidden;text-overflow:ellipsis;word-break:break-word}.LeftSearch .message-date{font-size:.75rem;color:var(--color-text-secondary);padding-left:1rem;white-space:nowrap}.LeftSearch .media-list{display:grid;padding:.5rem;grid-template-columns:repeat(3, 1fr);grid-auto-rows:1fr;grid-gap:.25rem}.LeftSearch .Audio .duration span{padding:0 .25rem}.LeftSearch .Audio .ProgressSpinner{margin:-.1875rem 0 0 -.1875rem}.LeftSearch .ListItem.search-result .ChatInfo .handle{unicode-bidi:plaintext;color:var(--color-primary);unicode-bidi:plaintext}.LeftSearch .ListItem.search-result .ChatInfo .handle::before{content:'@'}html[lang=ar] .LeftSearch .ListItem.search-result .ChatInfo .handle::before{content:' ،@';margin-inline-end:.25rem}.LeftSearch .ListItem.search-result .ChatInfo .handle::after{content:', ';color:var(--color-text-secondary)}html[lang=ar] .LeftSearch .ListItem.search-result .ChatInfo .handle::after{content:''}.LeftSearch .ListItem.search-result .ChatInfo[dir=rtl] .status{text-align:right}.LeftSearch .ListItem.search-result .ChatInfo[dir=rtl] .status .handle{float:right}.LeftSearch .ListItem.search-result-message .sender-name{color:var(--color-text)}.LeftSearch .ListItem.search-result-message .sender-name::after{content:': ';white-space:pre}@media (max-width: 600px){.LeftSearch .ListItem{margin:0 -0.625rem}}.LeftSearch .search-section{padding:0 1rem 0.5rem}.LeftSearch .search-section .section-heading{color:var(--color-text-secondary);font-size:.9375rem;font-weight:500;margin-bottom:0 !important;padding-top:.875rem}.LeftSearch .search-section .section-heading .Link{float:right;color:var(--color-links);font-weight:400;margin-right:1rem}.LeftSearch .search-section .section-heading .Link:focus,.LeftSearch .search-section .section-heading .Link:hover{color:var(--color-links-hover)}.LeftSearch .search-section .section-heading[dir=rtl] .Link,.LeftSearch .search-section .section-heading[dir=auto] .Link{float:left;margin-left:1rem;margin-right:0}.LeftSearch .search-section .Loading{height:4.5rem;margin-bottom:0.5rem}.LeftSearch .chat-selection{padding-top:.5rem;display:flex;flex-shrink:0;flex-wrap:nowrap;justify-content:space-between;align-items:flex-end;box-shadow:inset 0 -1px 0 0 var(--color-borders);background-color:var(--color-background);-webkit-overflow-scrolling:touch;overflow-x:auto;overflow-y:hidden;scrollbar-color:rgba(0,0,0,0)}.LeftSearch .chat-selection>.PickerSelectedItem{flex:0 0 auto}.LeftSearch .chat-selection>.PickerSelectedItem:last-child{margin-right:auto}.LeftSearch .chat-selection[dir=rtl]>.PickerSelectedItem:last-child{margin-left:auto;margin-right:0}.LeftSearch .NothingFound{height:100%}.LeftSearch [dir=rtl] .message-date{padding-left:0;padding-right:1rem}\n",".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(255,255,255,0.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)}\n",".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:white;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(.active) .AvatarEditable label input,.Transition>div:not(.active) .AvatarEditable label i,.Transition>div:not(.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(.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,0.4)}.AvatarEditable label.disabled{pointer-events:none}.AvatarEditable label.disabled i{display:none}.AvatarEditable label.disabled::after{display:none}\n",".ShowMoreButton{color:var(--text-color) !important;display:flex;align-items:center;text-align:left;text-transform:none;padding-left:.75rem !important;opacity:1 !important}.ShowMoreButton i{font-size:1.5rem;margin-right:2rem;color:var(--color-text-secondary)}.ShowMoreButton .Spinner{top:0.4375rem}\n",".SettingsFoldersChatsPicker{height:calc(100% - var(--header-height))}.SettingsFoldersChatsPicker .picker-header{box-shadow:0 0 2px var(--color-default-shadow)}.SettingsFoldersChatsPicker .picker-header .max-items-reached{margin-bottom:0.5rem;margin-left:0.5rem;flex-grow:1}.SettingsFoldersChatsPicker .picker-header .max-items-reached{color:var(--color-text-secondary)}.SettingsFoldersChatsPicker .picker-list{padding:0 0.5rem 0.5rem}.SettingsFoldersChatsPicker .picker-list .no-results{height:10rem}.SettingsFoldersChatsPicker .ListItem.picker-list-item.chat-type-item .ListItem-button{padding:0.875rem 0.75rem}.SettingsFoldersChatsPicker .ListItem.picker-list-item.chat-item .ListItem-button{padding:0.5rem 0.75rem}.SettingsFoldersChatsPicker .ListItem.picker-list-item .Checkbox{margin-left:auto;padding-left:3.25rem}.SettingsFoldersChatsPicker .ListItem.picker-list-item .chat-type{font-size:1rem;font-weight:400;margin:0}.SettingsFoldersChatsPicker .ListItem.picker-list-item[dir=rtl] .Checkbox{margin-left:0;margin-right:auto;padding-left:0;padding-right:3.25rem}.SettingsFoldersChatsPicker .settings-item-header{margin-left:0.75rem;margin-top:1rem;margin-bottom:0.5rem}.SettingsFoldersChatsPicker .picker-list-divider{margin:0.5rem -0.5rem 0;border-bottom:1px solid var(--color-borders)}\n",".settings-folders-recommended-item{width:100%;display:flex;align-items:center;justify-content:space-between}.settings-folders-list-item .ChatInfo{display:flex;align-items:center}.settings-folders-list-item .ChatInfo .Avatar{margin-left:-0.25rem;margin-right:1.5rem}.settings-folders-list-item .ChatInfo .title{display:flex;justify-content:flex-start;align-items:center}.settings-folders-list-item .ChatInfo .title h3{font-size:1rem;font-weight:500;line-height:1.3125;margin:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;text-align:left}.settings-folders-list-item .ChatInfo .status{display:none}.settings-folders-list-item .ChatInfo[dir=rtl] .title h3{text-align:right}.settings-folders-list-item .ListItem-button i{opacity:0.9}.settings-folders-list-item.color-primary .ListItem-button{color:var(--color-primary)}.settings-folders-list-item.color-primary .ListItem-button i{opacity:1;color:inherit}.settings-folders-list-item[dir=rtl] .Avatar{margin-left:1.5rem;margin-right:-0.25rem}.settings-item .ShowMoreButton{margin:0 -1rem;width:calc(100% + 2rem);padding-left:1rem !important}\n",".RangeSlider{--slider-color: var(--color-primary);margin-bottom:1rem}.RangeSlider.disabled{pointer-events:none;--slider-color: var(--color-text-secondary)}.RangeSlider .slider-top-row{display:flex;justify-content:space-between;margin-bottom:0.625rem}.RangeSlider .slider-top-row .value{flex-shrink:0;margin-left:1rem;color:var(--color-text-secondary)}.RangeSlider .slider-top-row[dir=rtl] .value{margin-left:0;margin-right:1rem}.RangeSlider .slider-main{position:relative;z-index:1}.RangeSlider .slider-main::before{content:'';position:absolute;width:100%;left:0;top:0.3125rem;height:0.125rem;background-color:var(--color-borders);border-radius:0.125rem;opacity:0.5;z-index:-1}.RangeSlider .slider-fill-track{position:absolute;width:100%;left:0;top:0.3125rem;height:0.125rem;background-color:var(--slider-color);border-radius:0.125rem;pointer-events:none}.RangeSlider input[type=\"range\"]{-webkit-appearance:none;display:block;width:100%;height:0.75rem;margin-bottom:0.5rem;background:transparent}.RangeSlider input[type=\"range\"]:focus{outline:none}.RangeSlider input[type=\"range\"]::-ms-track{width:100%;cursor:pointer;background:transparent;border-color:transparent;color:transparent}.RangeSlider input[type=\"range\"]::-webkit-slider-thumb{-webkit-appearance:none}.RangeSlider input[type=\"range\"]::-webkit-slider-thumb{background:var(--slider-color);border:none;height:0.75rem;width:0.75rem;border-radius:50%;cursor:pointer;transform:scale(1);-webkit-transition:transform .25s ease-in-out;transition:transform .25s ease-in-out}.RangeSlider input[type=\"range\"]::-webkit-slider-thumb:hover{transform:scale(1.2)}.RangeSlider input[type=\"range\"]::-moz-range-thumb{background:var(--slider-color);border:none;height:0.75rem;width:0.75rem;border-radius:50%;cursor:pointer;transform:scale(1);-moz-transition:transform .25s ease-in-out;transition:transform .25s ease-in-out}.RangeSlider input[type=\"range\"]::-moz-range-thumb:hover{transform:scale(1.2)}.RangeSlider input[type=\"range\"]::-ms-thumb{background:var(--slider-color);border:none;height:0.75rem;width:0.75rem;border-radius:50%;cursor:pointer;transform:scale(1);-ms-transition:transform .25s ease-in-out;transition:transform .25s ease-in-out}.RangeSlider input[type=\"range\"]::-ms-thumb:hover{transform:scale(1.2)}.RangeSlider .slider-options{display:grid;grid-template-rows:auto;grid-auto-columns:1fr;grid-auto-flow:column}.RangeSlider .slider-option{font-size:0.825rem;text-align:center;cursor:pointer;color:var(--color-text-secondary);transition:color .2s ease}.RangeSlider .slider-option:hover,.RangeSlider .slider-option.active{color:var(--color-text)}.RangeSlider .slider-option.active{font-weight:500}.RangeSlider .slider-option:first-child{text-align:left}.RangeSlider .slider-option:last-child{text-align:right}\n",".settings-item .SettingsStickerSet.ListItem{margin-bottom:.5rem}.SettingsStickerSet .StickerButton,.SettingsStickerSet .Button{width:3rem;height:3rem;margin:0 .5rem 0 0;padding:0;flex:0 0 3rem}.SettingsStickerSet img{max-width:100%;max-height:100%}.SettingsStickerSet .multiline-menu-item{display:flex;flex-direction:column;justify-content:center}.SettingsStickerSet[dir=rtl] .StickerButton,.SettingsStickerSet[dir=rtl] .Button{margin:0 0 0 .5rem}\n",".WallpaperTile{height:0;padding-bottom:100%;cursor:pointer;position:relative}.WallpaperTile .media-inner,.WallpaperTile::after{position:absolute;left:0;top:0;width:100%;height:100%}.WallpaperTile .media-inner{overflow:hidden;transform:scale(1);transition:transform .15s ease}.WallpaperTile .media-inner img,.WallpaperTile .media-inner canvas{position:absolute;left:0;top:0;width:100%;height:100%;object-fit:cover}.WallpaperTile::after{content:\"\";display:block;border:2px solid var(--color-primary);opacity:0;transition:opacity .15s ease}.WallpaperTile.selected::after{opacity:1}.WallpaperTile.selected .media-inner{transform:scale(0.9)}.WallpaperTile .spinner-container{height:100%;display:flex;align-items:center;justify-content:center}\n",".SettingsGeneralBackground .settings-wallpapers{display:grid;padding:.5rem;grid-template-columns:repeat(3, 1fr);grid-auto-rows:1fr;grid-gap:.25rem}.SettingsGeneralBackground .Loading{height:auto !important;margin-top:5rem}\n",".SettingsGeneralBackgroundColor:not(.is-dragging) .handle{transition:transform 300ms ease}.SettingsGeneralBackgroundColor .color-picker,.SettingsGeneralBackgroundColor .hue-picker{position:relative}.SettingsGeneralBackgroundColor .color-picker{margin-top:1rem;height:12rem;touch-action:none}.SettingsGeneralBackgroundColor .hue-picker{margin:2rem 0;height:0.5rem}.SettingsGeneralBackgroundColor canvas{display:block;width:100%;height:100%;border-radius:var(--border-radius-default);cursor:pointer}.SettingsGeneralBackgroundColor .handle{position:absolute;top:-0.75rem;left:-0.75rem;width:1.5rem;height:1.5rem;border:0.125rem solid var(--color-white);border-radius:0.75rem;cursor:grab}.SettingsGeneralBackgroundColor .hue-picker .handle{top:-0.5rem}.SettingsGeneralBackgroundColor .tools{margin-bottom:0.625rem;display:flex}.SettingsGeneralBackgroundColor .tools .input-group{margin-bottom:0}.SettingsGeneralBackgroundColor .tools .input-group[dir=rtl] label{transform:scale(0.75) translate(1.25rem, -2.25rem)}.SettingsGeneralBackgroundColor .tools .input-group:first-child{margin-right:0.5rem}.SettingsGeneralBackgroundColor .tools .input-group:last-child{margin-left:0.5rem}.SettingsGeneralBackgroundColor .predefined-colors{display:grid;padding:.5rem;grid-template-columns:repeat(3, 1fr);grid-auto-rows:1fr;grid-gap:.25rem}.SettingsGeneralBackgroundColor .predefined-colors div{cursor:pointer;box-shadow:inset 0 0 0 0 var(--color-background);transition:box-shadow 300ms ease}.SettingsGeneralBackgroundColor .predefined-colors div.active{border:0.125rem solid var(--color-primary);box-shadow:inset 0 0 0 0.3125rem var(--color-background)}.SettingsGeneralBackgroundColor .predefined-colors div:before{display:block;content:\"\";width:100%;padding-top:100%;pointer-events:none}\n","#monkey{position:relative;display:block;margin-left:auto;margin-right:auto;width:7.5rem;height:7.5rem;margin-bottom:1.75rem}@media (min-width: 600px) and (min-height: 450px){#monkey{width:10rem;height:10rem;margin-bottom:2.5rem}}#monkey.big{width:10rem;height:10rem}#monkey .AnimatedSticker{position:absolute;left:0;top:0;width:100%;height:100%}#monkey .AnimatedSticker.hidden{display:none}#monkey .monkey-preview{width:100%;height:100%;background-size:100%;background:url(monkey.a3d5fcdc50b18dc55695f7dd4101a8c9.svg) center}\n","#Settings{height:100%}#Settings>div{display:flex;flex-direction:column;overflow:hidden}.settings-main-header{display:flex;flex-grow:1;justify-content:space-between;align-items:center}.settings-more-menu .bubble{width:auto}.settings-more-menu .bubble .MenuItem button{padding-left:1rem !important;padding-right:2rem !important}.settings-content{background:var(--color-background);height:calc(100% - var(--header-height));overflow-y:auto}.settings-content.infinite-scroll{display:flex;flex-direction:column}.settings-content.infinite-scroll>.custom-scroll{flex:1 1 auto;height:auto}.settings-content #monkey{margin-top:.5rem;margin-bottom:1rem}.settings-content .AnimatedEmoji{margin-top:.5rem;margin-bottom:1.5rem}.settings-content-header{display:flex;flex-direction:column;align-items:center;padding:0 1.5rem 1rem;text-align:center}.settings-content-header .input-group{width:100%}.settings-content-icon{width:5rem;height:5rem;margin-bottom:2.5rem;position:relative}.settings-content-icon .AnimatedSticker{position:absolute;left:0;top:0;width:100%;height:100%}.settings-content-icon .AnimatedSticker.hidden{display:none}.settings-main-menu{padding:0 0.5rem 1rem}.settings-current-user{margin-bottom:1.125rem;text-align:center}.settings-current-user .Avatar{margin:0 auto 1.5rem}.settings-current-user .name{display:flex;justify-content:center;align-items:center;font-weight:500;font-size:1.5rem;line-height:2rem;margin:0}.settings-current-user .name .VerifiedIcon{margin-left:0.25rem;margin-top:0.1rem}.settings-current-user .phone{font-size:0.875rem;color:#868e96;margin:0}.settings-item{border-top:1px solid var(--color-borders);padding:1.5rem 1.5rem 1rem}.settings-item.no-border{border-top:none}.settings-item-header{font-size:1rem;color:var(--color-text-secondary);margin-bottom:2rem;position:relative}.settings-item-header[dir=rtl]{text-align:right}.settings-item-slider{margin-top:2rem}.settings-item-description{font-size:0.875rem;color:var(--color-text-secondary);margin-top:-0.5rem;margin-bottom:1.5rem}.settings-content.two-fa .settings-item-description{font-size:1rem}.settings-item-description[dir=rtl]{text-align:right;unicode-bidi:plaintext}.settings-item-description-larger{font-size:1rem;line-height:1.3125rem;color:var(--color-text-secondary);margin-top:2rem;margin-bottom:0.75rem}.settings-item-description-larger[dir=rtl]{text-align:right}.settings-item .ListItem{margin:0 -1rem 1rem}.settings-item .ListItem:last-child{margin-bottom:0}.settings-item .ListItem .multiline-menu-item{white-space:initial}.settings-item .ListItem .multiline-menu-item.full-size{width:100%}.settings-item .ListItem .multiline-menu-item .date{float:right;font-size:0.75rem;margin-left:1rem;color:var(--color-text-secondary)}.settings-item .ListItem .multiline-menu-item .title,.settings-item .ListItem .multiline-menu-item .subtitle{display:block;text-align:left}.settings-item .ListItem .multiline-menu-item .title{line-height:1.25rem}.settings-item .ListItem .multiline-menu-item .subtitle{font-size:0.875rem;line-height:1.5rem;color:var(--color-text-secondary)}.settings-item .ListItem .multiline-menu-item .subtitle+.subtitle{margin-top:-0.25rem}.settings-item .ListItem .multiline-menu-item .subtitle.black{color:var(--color-text)}.settings-item .ListItem .multiline-menu-item .subtitle.tight{line-height:1.3125rem;margin-bottom:.1875rem}.settings-item .ListItem.destructive .ListItem-button{color:var(--color-error)}.settings-item .ListItem.destructive .ListItem-button i{color:inherit}.settings-item .ListItem.blocked-list-item{margin-bottom:0.5rem}.settings-item .ListItem.blocked-list-item .ListItem-button{align-items:center;text-align:left;padding:0.5rem}.settings-item .ListItem.blocked-list-item .Avatar{width:3rem;height:3rem;margin-right:1rem}.settings-item .ListItem.blocked-list-item .contact-name{font-size:1rem;line-height:1rem;margin-bottom:0.25rem;font-weight:500}.settings-item .ListItem.blocked-list-item .contact-phone{font-size:0.875rem;line-height:1rem;color:var(--color-text-secondary)}.settings-item .ListItem[dir=rtl] .multiline-menu-item .title,.settings-item .ListItem[dir=rtl] .multiline-menu-item .subtitle{text-align:right}.settings-item .ListItem[dir=rtl] .multiline-menu-item .date{float:left;margin-left:0;margin-right:1rem}.settings-item .RangeSlider{margin-bottom:1.0625rem}.settings-item .Checkbox,.settings-item .radio-group{margin:0 -1rem 0.5rem}.settings-item .radio-group .Radio:last-child{margin-bottom:0}.settings-item .Radio+.Radio,.settings-item .Checkbox+.Checkbox{margin-top:2rem}.settings-fab-wrapper{height:calc(100% - var(--header-height));position:relative;overflow:hidden}.settings-fab-wrapper .settings-content{height:100%}.settings-fab-wrapper .FloatingActionButton{right:1.5rem}.settings-edit-profile{padding:0 1.5rem}.username-link{color:var(--color-links)}\n",".NewChat{height:100%;overflow:hidden;position:relative}.NewChat-inner{height:calc(100% - var(--header-height));overflow:hidden}.NewChat-inner.step-2{padding:0 1.25rem;display:flex;flex-direction:column}.NewChat-inner.step-2 .note,.NewChat-inner.step-2 .error{font-size:0.875rem;line-height:1.25rem;margin:1.5rem 0.25rem}.NewChat-inner.step-2 .error{color:var(--color-error)}.NewChat-inner.step-2 .note{margin-top:-0.5625rem;color:var(--color-text-secondary)}.NewChat-inner.step-2 .chat-members-heading{color:var(--color-text-secondary);font-size:1rem;font-weight:500;margin:1rem 0.25rem}.NewChat-inner.step-2 .chat-members-list{margin:0 -1.25rem;padding:0 1rem 1rem;overflow-x:hidden;flex-grow:1}\n",".ArchivedChats{height:100%;overflow:hidden}.ArchivedChats .chat-list{height:calc(100% - var(--header-height))}\n",".MessageContextMenu{position:absolute;font-size:1rem}.MessageContextMenu .bubble{transform:scale(0.5);transition:opacity 0.15s cubic-bezier(0.2, 0, 0.2, 1),transform 0.15s cubic-bezier(0.2, 0, 0.2, 1) !important}.MessageContextMenu .backdrop{position:absolute;touch-action:none}\n",".StickerSetModal .modal-dialog{width:26.25rem;max-width:100%}@media (max-width: 600px){.StickerSetModal .modal-dialog{width:18.875rem}}.StickerSetModal .modal-header{padding:0.5rem 1rem}.StickerSetModal .modal-content{text-align:center;padding:0}.StickerSetModal .stickers{position:relative;width:100%;height:19rem;max-height:50vh;overflow-y:auto;padding:0 0.25rem;text-align:left}.StickerSetModal .button-wrapper{padding:0.5rem 0;border-top:1px solid var(--color-borders);box-shadow:0 0 2px var(--color-default-shadow)}.StickerSetModal .button-wrapper button{display:inline-block}.StickerSetModal .Loading{width:100%;height:22.8125rem;max-height:calc(50vh + 3.8125rem)}\n",".HeaderMenuContainer{position:fixed;top:0;left:0;right:0;height:100vh;z-index:var(--z-header-menu)}.HeaderMenuContainer .Menu{position:absolute;font-size:1rem}.HeaderMenuContainer .Menu .backdrop{z-index:var(--z-header-menu-backdrop)}.HeaderMenuContainer .Menu .bubble{z-index:var(--z-header-menu);--offset-y: calc(100% + 1rem)}\n","#MobileSearch>.header{position:absolute;top:0;left:0;z-index:var(--z-mobile-search);width:100%;height:3.5rem;background:var(--color-background);display:flex;align-items:center;padding:0 0.5rem 0 0.25rem}#MobileSearch>.header>.SearchInput{margin-left:0.25rem;flex:1}#MobileSearch>.footer{position:absolute;bottom:0;left:0;z-index:var(--z-mobile-search);width:100%;height:3.5rem;background:var(--color-background);display:flex;align-items:center;padding-left:1rem;padding-right:0.5rem}#MobileSearch>.footer>.counter{flex:1;color:var(--color-text-secondary)}#MobileSearch:not(.active) .header,#MobileSearch:not(.active) .footer{transform:translateX(-999rem)}\n",".MentionTooltip{width:calc(100% - 4rem);max-width:20rem;flex-direction:column;z-index:-1}@media (max-width: 600px){.MentionTooltip{width:calc(100% - 3rem)}}.MentionTooltip .ListItem.chat-item-clickable{margin:0}.MentionTooltip .ListItem.chat-item-clickable .ListItem-button{border-radius:0}.MentionTooltip .ListItem.chat-item-clickable .info{display:flex}.MentionTooltip .ListItem.chat-item-clickable .title{margin-inline-end:.625rem;max-width:70%}.MentionTooltip .ListItem.chat-item-clickable .handle{font-size:1rem}.MentionTooltip .ListItem.chat-item-clickable[dir=rtl] .status{width:auto}.MentionTooltip .ChatInfo .title h3{line-height:1.25}.MentionTooltip .ChatInfo .Avatar{margin-right:0.7em}.MentionTooltip .ChatInfo .handle::before{content:'@'}.MentionTooltip .ChatInfo .user-status{display:none !important}\n",".AttachmentModal{--border-radius-default: 0.625rem}.AttachmentModal .modal-dialog{max-width:26.25rem}@media (max-width: 600px){.AttachmentModal .modal-dialog{max-height:100%;padding-bottom:1.5rem}}.AttachmentModal .modal-content{padding:.5rem 1.25rem 1.875rem;max-height:calc(100vh - 3.25rem)}@media (max-width: 600px){.AttachmentModal .modal-content{padding-bottom:.25rem}}.AttachmentModal .media-wrapper{max-height:26rem;overflow:auto;display:flex;flex-wrap:wrap;margin-bottom:1.5rem}.AttachmentModal .media-wrapper video,.AttachmentModal .media-wrapper img{flex:1;width:calc(50% - 0.15rem);height:12rem;margin-bottom:0.3rem;border-radius:var(--border-radius-default);object-fit:cover}.AttachmentModal .media-wrapper video:only-child,.AttachmentModal .media-wrapper img:only-child{height:auto;max-height:25rem;margin-bottom:0}.AttachmentModal .media-wrapper video:nth-child(even),.AttachmentModal .media-wrapper img:nth-child(even){margin-left:0.3rem}.AttachmentModal .document-wrapper{max-height:25rem;overflow:auto;flex-shrink:0;display:flex;flex-direction:column;margin:.75rem 0 1.75rem}.AttachmentModal .document-wrapper .File:not(:last-child){margin-bottom:1.5rem}.AttachmentModal .document-wrapper .file-icon{cursor:default !important}.AttachmentModal .attachment-caption-wrapper{position:relative}.AttachmentModal .attachment-caption-wrapper .form-control{background:var(--color-background)}.AttachmentModal .attachment-caption-wrapper .MentionTooltip{right:0 !important;z-index:0}.AttachmentModal .drop-target{position:relative}.AttachmentModal .drop-target::before,.AttachmentModal .drop-target::after{content:'';position:absolute;left:0;top:0;right:0;bottom:0;border-radius:var(--border-radius-default);pointer-events:none;opacity:0;transition:250ms opacity;z-index:1}.AttachmentModal .drop-target::before{background-image:var(--drag-target-border-hovered);background-color:var(--color-background)}.AttachmentModal .drop-target::after{content:attr(data-attach-description);display:flex;justify-content:center;align-items:center;color:var(--color-primary)}.AttachmentModal.hovered .drop-target::before{opacity:.95}.AttachmentModal.hovered .drop-target::after{opacity:1}.AttachmentModal.hovered .attachment-caption-wrapper,.AttachmentModal.hovered .document-wrapper,.AttachmentModal.hovered .media-wrapper{pointer-events:none}.AttachmentModal.hovered .document-wrapper,.AttachmentModal.hovered .media-wrapper{border-radius:var(--border-radius-default)}\n",".PollModal .modal-dialog{max-width:26.25rem;max-height:calc(100vh - 5rem)}.PollModal .modal-content{padding:.5rem 1.25rem 1.875rem;min-height:4.875rem}.PollModal .modal-header-condensed{margin-bottom:1rem}.PollModal .options-header{color:var(--color-text-secondary);font-size:1rem;font-weight:500;margin:1.5rem 0.25rem}.PollModal .options-list{margin:1rem -0.75rem -0.5rem;padding:0 0.75rem;border-top:1px solid var(--color-chat-hover);max-height:20rem;overflow:auto}.PollModal .options-list.overflown{padding:0 0.4rem 0.5rem 0.75rem}@media (max-width: 600px){.PollModal .options-list{overflow:hidden;max-height:none}.PollModal .options-list,.PollModal .options-list.overflown{padding:0 0.75rem}}.PollModal .option-wrapper{position:relative}.PollModal .option-wrapper .form-control{padding-right:3rem}.PollModal .option-wrapper .option-remove-button{position:absolute;top:0.3125rem;right:0.3125rem}.PollModal .quiz-mode{margin-top:1.5rem}.PollModal .quiz-mode .options-header{margin-bottom:0.5rem}.PollModal .quiz-mode .note{margin-top:0.5rem}.PollModal .note{font-size:smaller;color:var(--color-text-secondary)}.PollModal .error{font-size:smaller;color:var(--color-error);margin:-1rem 0 1rem .25rem}.PollModal .input-group:last-child{margin-bottom:0.5rem}\n",".EmojiButton{display:inline-flex;align-items:center;justify-content:center;width:2.5rem;height:2.5rem;margin:0.125rem;border-radius:var(--border-radius-messages-small);cursor:pointer;font-size:1.75rem;line-height:2.5rem;background-color:transparent;transition:background-color .15s ease}.mac-os-fix .EmojiButton{line-height:inherit}.EmojiButton.focus,.EmojiButton:hover{background-color:var(--color-background-selected)}.EmojiButton>img{width:2rem;height:2rem}\n",".EmojiPicker{height:100%}.EmojiPicker-main{height:calc(100% - 3rem);overflow-y:auto;padding:0.5rem}@media (max-width: 600px){.EmojiPicker-main{padding:0.5rem 0.25rem}}.EmojiPicker-main .symbol-set-container{display:flex;flex-wrap:wrap}.EmojiPicker-header{height:3rem;border-bottom:1px solid var(--color-borders);display:flex;align-items:center;justify-content:space-around;box-shadow:0 0 2px var(--color-default-shadow)}@media (max-width: 600px){.EmojiPicker-header{overflow-x:auto;overflow-y:hidden;display:block;white-space:nowrap;padding:0.4375rem 0;scrollbar-width:none;scrollbar-color:rgba(0,0,0,0)}.EmojiPicker-header::-webkit-scrollbar{height:0}.EmojiPicker-header::-webkit-scrollbar-thumb{background-color:rgba(0,0,0,0)}.EmojiPicker-header .symbol-set-button{display:inline-flex;vertical-align:middle}.EmojiPicker-header::after{content:\"\";display:block;flex-shrink:0;width:0.1px;height:1rem}}\n",".StickerPicker{height:100%}.StickerPicker-main{position:relative;height:calc(100% - 3rem);overflow-y:auto;padding:0.5rem}@media (max-width: 600px){.StickerPicker-main{padding:0.5rem 0.25rem}}.StickerPicker-header{height:3rem;border-bottom:1px solid var(--color-borders);padding:0.125rem 0;overflow-x:auto;overflow-y:hidden;white-space:nowrap;box-shadow:0 0 2px var(--color-default-shadow);scrollbar-width:none;scrollbar-color:rgba(0,0,0,0)}.StickerPicker-header::-webkit-scrollbar{height:0}.StickerPicker-header::-webkit-scrollbar-thumb{background-color:rgba(0,0,0,0)}.StickerPicker-header::after{content:\"\";display:block;flex-shrink:0;width:0.1px;height:1rem}.StickerPicker-header .sticker-set-button{display:inline-flex;vertical-align:middle}.StickerPicker-header .sticker-set-button.StickerButton{background-size:2rem}.StickerPicker-header .sticker-set-button.StickerButton img,.StickerPicker-header .sticker-set-button.StickerButton .AnimatedSticker{top:0.375rem;left:0.375rem;width:2rem;height:2rem}.StickerPicker-header .sticker-set-button .sticker-set-cover{width:2rem;height:2rem;position:relative;display:flex;align-items:center;justify-content:center}.StickerPicker-header .sticker-set-button .sticker-set-cover img,.StickerPicker-header .sticker-set-button .sticker-set-cover .AnimatedSticker{width:100%;height:100%;position:absolute;top:0;left:0}.StickerPicker .symbol-set-container{width:25rem;line-height:0}@media (max-width: 600px){.StickerPicker .symbol-set-container{width:100%}}.StickerPicker .sticker-set-button{width:2.75rem !important;height:2.75rem;margin:0 0.25rem;border-radius:var(--border-radius-messages-small)}\n",".GifButton{display:flex;align-items:center;justify-content:center;height:6.25rem;background-color:transparent;cursor:pointer;overflow:hidden;position:relative}.GifButton:last-child{margin-bottom:1rem}.GifButton.vertical{grid-column-end:span 1}.GifButton.horizontal{grid-column-end:span 2}.GifButton .thumbnail{background-size:cover !important;background:transparent no-repeat center}.GifButton .thumbnail ~ video{position:absolute}.GifButton .thumbnail,.GifButton video{width:100%;height:100%;object-fit:cover}.GifButton:not(.shown){display:block !important;visibility:hidden}.GifButton .Spinner{position:absolute;pointer-events:none}\n",".GifPicker{display:grid;grid-template-columns:repeat(6, 1fr);grid-auto-rows:6.25rem;grid-gap:0.25rem;grid-auto-flow:dense;height:100%;overflow-y:auto;padding:0.25rem}.GifPicker .Loading,.GifPicker .picker-disabled{grid-column:1 / -1;height:var(--menu-height)}\n",".SymbolMenu.mobile-menu{position:fixed;left:0;right:0;bottom:0;background:var(--color-background);transform:translate3d(0, calc(var(--symbol-menu-height) + var(--symbol-menu-footer-height)), 0);z-index:1;transition:transform var(--layer-transition)}.SymbolMenu.mobile-menu.open{transform:translate3d(0, 0, 0)}body.is-media-viewer-open .SymbolMenu.mobile-menu.open{transform:translate3d(0, calc(var(--symbol-menu-height) + var(--symbol-menu-footer-height)), 0)}body.animation-level-0 .SymbolMenu.mobile-menu{transition:none}.SymbolMenu.mobile-menu:not(.middle-column-open){transform:translate3d(100vw, 0, 0) !important}.SymbolMenu-main{width:var(--symbol-menu-width);height:var(--symbol-menu-height);max-height:calc(100vh - var(--symbol-menu-footer-height))}.SymbolMenu-footer{height:var(--symbol-menu-footer-height);border-top:1px solid var(--color-borders);display:flex;align-items:center;justify-content:center;box-shadow:0 0 2px var(--color-default-shadow);position:relative}.SymbolMenu-footer .Button{flex-shrink:0;width:2.125rem !important;height:2.125rem;margin:0 .25rem;padding:0}.SymbolMenu-footer .Button.activated{pointer-events:none}.SymbolMenu-footer .Button.symbol-tab-button{margin:0 0.75rem}.SymbolMenu-footer .Button.symbol-search-button{position:absolute;left:0.25rem}.SymbolMenu-footer .Button.symbol-delete-button{position:absolute;right:0.25rem}.SymbolMenu .Transition.slide{height:100%}.SymbolMenu .Transition.slide .Loading{height:var(--symbol-menu-height)}.is-pointer-env .SymbolMenu>.backdrop{position:absolute;top:-1rem;left:0;right:auto;width:3.5rem;height:4.5rem}.SymbolMenu .bubble{padding:0;width:var(--symbol-menu-width);overflow:hidden}.SymbolMenu .picker-disabled{height:var(--symbol-menu-height);display:flex;align-items:center;justify-content:center;color:var(--color-text-secondary)}.SymbolMenu .symbol-close-button{display:none;position:absolute;right:.25rem;top:.25rem}@media (orientation: landscape){.SymbolMenu .symbol-close-button{display:block}}.symbol-set{margin-bottom:1rem}.symbol-set-name{font-size:1rem;line-height:1.6875rem;font-weight:500;margin:0;padding-left:0.5rem;color:rgba(var(--color-text-secondary-rgb), 0.75);overflow:hidden;white-space:nowrap;text-overflow:ellipsis;text-align:initial;unicode-bidi:plaintext}.symbol-set-container{text-align:initial}.symbol-set-button{flex-shrink:0;width:2.125rem !important;height:2.125rem;margin:0 0.25rem;padding:0}.Transition>div:not(.active) .symbol-set,body.animating-right-column .symbol-set{overflow:hidden}.symbol-set .symbol-set-container:not(.shown){display:block}.symbol-set .symbol-set-container.closing{transition:none}\n",".AttachMenu{position:relative}.is-pointer-env .AttachMenu>.backdrop{position:absolute;top:-1rem;left:auto;right:0;width:3.5rem}.AttachMenu .media-disabled>button{white-space:normal}\n",".StickerTooltip{display:grid;grid-template-columns:repeat(auto-fill, minmax(5rem, 1fr));grid-auto-rows:auto;place-items:center}.StickerTooltip.hidden{display:none}\n",".CustomSendMenu{position:relative;bottom:3.5rem}.is-pointer-env .CustomSendMenu>.backdrop{position:absolute;top:-1rem;left:auto;right:0;width:3.5rem}.CustomSendMenu .media-disabled>button{white-space:normal}.CustomSendMenu .bubble{width:16rem}\n",".EmojiTooltip{display:flex;padding-left:.25rem;overflow-x:auto;overflow-x:overlay;overflow-y:hidden}.EmojiTooltip .EmojiButton{flex:0 0 2.5rem}\n",".BaseResult.chat-item-clickable>.ListItem-button{padding-left:1.25rem !important;padding-right:1.25rem !important}.BaseResult.chat-item-clickable>.ListItem-button .title{display:block;text-overflow:ellipsis}.BaseResult .thumb{background-color:var(--color-background-secondary);flex:0 0 3rem;width:3rem;height:3rem;line-height:3rem;border-radius:var(--border-radius-default-tiny);display:inline-flex;align-content:center;justify-content:center;margin-inline-end:.5rem;overflow:hidden;font-size:1.5rem}.BaseResult .thumb img:not(.emoji){width:100%;object-fit:cover}.BaseResult .thumb img.emoji{width:1.5rem;height:1.5rem;margin:.75rem 0 0}.BaseResult .content-inner{min-width:0}.BaseResult .title{font-weight:500;text-align:left;unicode-bidi:plaintext}.BaseResult .description{white-space:normal;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;text-align:left;unicode-bidi:plaintext}.BaseResult[dir=rtl] .title,.BaseResult[dir=rtl] .description{text-align:right}\n",".MediaResult{height:0;padding-bottom:100%;overflow:hidden;position:relative;cursor:pointer}.MediaResult img{position:absolute;left:0;top:0;width:100%;height:100%;object-fit:cover}\n",".InlineBotTooltip{--border-radius-default: 0}.InlineBotTooltip .switch-pm .title{margin:0 auto;font-weight:500}.InlineBotTooltip.gallery{display:grid;grid-template-columns:repeat(4, 1fr);grid-gap:1px;padding:0}@media (max-width: 600px){.InlineBotTooltip.gallery{grid-template-columns:repeat(3, 1fr)}}.InlineBotTooltip.gallery .switch-pm{grid-column:1 / -1}.InlineBotTooltip.gallery .switch-pm .ListItem-button{border-bottom-left-radius:0;border-bottom-right-radius:0}.InlineBotTooltip.gallery .GifButton{grid-column-end:initial}.InlineBotTooltip.gallery .StickerButton{width:initial;height:0;margin:0;padding-bottom:100%;border-radius:0}.InlineBotTooltip.gallery .StickerButton .AnimatedSticker,.InlineBotTooltip.gallery .StickerButton img,.InlineBotTooltip.gallery .StickerButton canvas{position:absolute;top:0;left:0;width:100% !important;height:100% !important}@media (min-width: 600px){.InlineBotTooltip.gallery .StickerButton .AnimatedSticker,.InlineBotTooltip.gallery .StickerButton img,.InlineBotTooltip.gallery .StickerButton canvas{top:.25rem;left:.25rem;width:calc(100% - .5rem) !important;height:calc(100% - .5rem) !important}}\n",".RightSearch{height:100%;padding:0 0.5rem;overflow-y:auto}.RightSearch .helper-text{padding:1rem;margin-bottom:0.125rem;font-weight:500;color:var(--color-text-secondary);unicode-bidi:plaintext;text-align:initial}\n",".StickerSearch{height:100%;padding:0 0.5rem;overflow-y:auto}.StickerSearch .helper-text{padding:1rem;margin-bottom:0.125rem;font-weight:500;color:var(--color-text-secondary)}.StickerSearch .sticker-set{margin-bottom:1rem}.StickerSearch .sticker-set-header{display:flex;justify-content:space-between;padding:0.5rem}.StickerSearch .sticker-set-header .title-wrapper{overflow:hidden}.StickerSearch .sticker-set-header .title{font-size:1rem;line-height:1.6875rem;margin:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.StickerSearch .sticker-set-header .count{color:var(--color-text-secondary);margin:0}.StickerSearch .sticker-set-header .Button{flex-shrink:0;margin-left:1rem}.StickerSearch .sticker-set-header .Button.is-added{background:var(--color-chat-hover);color:var(--color-text-secondary)}.StickerSearch .sticker-set-header .Button.is-added:hover,.StickerSearch .sticker-set-header .Button.is-added:active{background:var(--color-item-active) !important}.StickerSearch .sticker-set-main{display:flex;flex-wrap:nowrap;overflow:hidden}.StickerSearch .sticker-set[dir=rtl] .title-wrapper{text-align:right}.StickerSearch .sticker-set[dir=rtl] .Button{margin-left:0;margin-right:1rem}.StickerSearch .StickerButton{margin:0.125rem}\n",".GifSearch{height:100%;padding:0.25rem}.GifSearch .gif-container{height:100%;overflow:auto}.GifSearch .gif-container.grid{display:grid;grid-template-columns:repeat(6, 1fr);grid-auto-rows:6.25rem;grid-gap:0.25rem;grid-auto-flow:dense}.GifSearch .helper-text{color:var(--color-text-meta);margin-top:2rem;text-align:center}\n",".PollAnswerResults{border-bottom:1px solid var(--color-borders);padding:0 .5rem .625rem;display:flex;flex-direction:column-reverse}.PollAnswerResults .answer-head{display:flex;align-items:center;font-size:.9375rem;line-height:1.3125rem;font-weight:500;color:var(--color-text-secondary);padding:1rem .75rem .5rem 1rem;position:sticky;top:0;background:var(--color-background)}@media (max-width: 600px){.PollAnswerResults .answer-head{padding:.5rem .25rem .5rem .5rem}}.PollAnswerResults .answer-percent{margin-left:auto}.PollAnswerResults .answer-percent[dir=auto]{margin-left:0;margin-right:auto}.PollAnswerResults .poll-voters{padding:0 .75rem;position:relative;min-height:3rem}@media (max-width: 600px){.PollAnswerResults .poll-voters{padding:0 .25rem}}.PollAnswerResults .poll-voters .Spinner{--spinner-size: 1.25rem}.PollAnswerResults .chat-item-clickable .ChatInfo .Avatar.size-tiny{margin-right:1.75rem}.PollAnswerResults .chat-item-clickable[dir=rtl] .ChatInfo .Avatar.size-tiny{margin-left:1.75rem;margin-right:0}.PollAnswerResults .ShowMoreButton{margin:.25rem 0 0 -0.5rem;width:calc(100% + 1rem)}.PollAnswerResults .ShowMoreButton[dir=rtl] .icon-down{margin-left:2rem;margin-right:0}.PollAnswerResults .icon-down{vertical-align:middle;margin-right:2rem;font-size:1.5rem}\n",".PollResults{height:100%;position:relative;display:flex;flex-direction:column;pointer-events:auto}.PollResults>.Loading{position:absolute;top:0;left:0;bottom:0;right:0;background:rgba(255,255,255,0.75)}.PollResults .poll-question{padding:.75rem 1.5rem;flex-shrink:0;font-size:1.25rem}@media (max-width: 600px){.PollResults .poll-question{padding:0 1rem}}.PollResults .poll-results-list{border-top:1px solid var(--color-borders);flex-grow:1;overflow:auto}\n",".Management{position:relative;height:100%}.Management>.custom-scroll{height:100%;overflow-y:scroll;overflow-x:hidden}.Management .section{padding:1rem 1.5rem;border-top:1px solid var(--color-borders)}.Management .section.wide{padding:1.5rem}.Management .section:first-of-type{border-top:none;padding-top:1rem}.Management .section.no-border{border-top:none}.Management .section>.ChatInfo{margin:0 0 2rem !important}.Management .section>.ChatInfo .title h3{margin-bottom:0}.Management .section .section-icon{width:8.75rem;height:8.75rem;margin:0 auto 2rem;position:relative}.Management .section .section-icon .AnimatedSticker{position:absolute;left:0;top:0;width:100%;height:100%}.Management .section .section-icon .AnimatedSticker.hidden{display:none}.Management .section .ListItem{margin:0 -.75rem}.Management .section .ListItem:last-child{margin-bottom:0}.Management .section .ListItem .multiline-item .subtitle{line-height:1.25rem}.Management .section .ListItem:not(.picker-list-item) .Checkbox{margin-top:2rem;margin-bottom:2rem}.Management .section .ListItem.narrow .Checkbox{margin-top:1rem;margin-bottom:1rem}.Management .section .ListItem.exceptions-member .ChatInfo .status{white-space:pre-wrap}.Management .section .section-heading{font-weight:500;font-size:.9375rem;color:var(--color-text-secondary)}.Management .section .section-heading[dir=auto]{text-align:initial}.Management .section .section-help{color:var(--color-text-secondary);line-height:1.375rem}.Management .section .section-help[dir=auto]{text-align:initial}.Management .section .section-info{color:var(--color-text-secondary);font-size:.875rem}.Management .section[dir=rtl]{text-align:right}.Management textarea.form-control{height:auto}.Management .group-link{color:var(--color-text)}.Management .radio-group{margin-top:2rem}.Management .radio-group .Radio{padding-left:3.5rem;margin-bottom:2rem}.Management .radio-group .Radio:last-child{margin-bottom:.625rem}.Management .radio-group .Radio-main::before{left:0.125rem;top:.25rem;transform:none}.Management .radio-group .Radio-main::after{left:0.4375rem;top:.5625rem;transform:none}.ManageGroupMembers{padding:0.5rem 1rem}\n",".ShippingInfo{padding:0.5rem 1rem}.ShippingInfo h5{font-size:0.9rem;color:var(--color-text-secondary);margin:1rem 0 1.1rem}\n",".Shipping{padding:0.5rem 1rem}.Shipping form p{color:var(--color-text-secondary);font-weight:500;margin:.5rem 0 2rem}.Shipping form .Radio{margin-bottom:2rem}\n",".Checkout{padding:0.5rem 0}.Checkout .description{display:flex;flex-direction:row;margin:0 1rem}.Checkout .description img{height:6rem;margin:.5rem}.Checkout .description .text h5{margin-top:.5rem;font-size:1.125rem}.Checkout .description .text p{font-size:0.8rem;line-height:1rem;color:var(--color-text-secondary)}.Checkout .price-info{margin:1rem}.Checkout .price-info .price-info-item{margin:1rem .5rem;display:flex;flex-direction:row;align-content:space-between;color:var(--color-text-secondary);font-weight:500}.Checkout .price-info .price-info-item-main{color:var(--color-text)}.Checkout .price-info .price-info-item .title{display:flex;flex:1 auto}.Checkout .invoice-info{border-top:1px var(--color-borders) solid;padding:1rem}.Checkout .invoice-info .checkout-info-item{display:flex;padding:.75rem .5rem 1rem;text-align:left}.Checkout .invoice-info .checkout-info-item i{font-size:1.5rem;color:var(--color-text-secondary);margin-right:2rem;width:1.5rem}.Checkout .invoice-info .checkout-info-item i.stripe-provider{background:url(stripe-logo.c0c5683dcd30037389c35a31040908ed.png) no-repeat center;background-size:2rem;border-radius:1rem;height:1.5rem}.Checkout .invoice-info .checkout-info-item .info .title{font-size:1rem;line-height:1.4375rem;margin-bottom:0;font-weight:400;word-break:break-word;color:var(--color-text);text-transform:capitalize}.Checkout .invoice-info .checkout-info-item .info .data{margin-bottom:0;font-size:0.875rem;color:var(--color-text-secondary)}\n",".CardInput{position:relative}.CardInput .input-group.has-left-addon .form-control{padding-left:4rem}.CardInput .left-addon{position:absolute;top:.8rem;left:1rem;z-index:8}.CardInput .left-addon img{max-width:2rem}\n",".PaymentInfo{padding:0.5rem 1rem}.PaymentInfo h5{font-size:0.9rem;color:var(--color-text-secondary);margin:1rem 0 1.1rem}.PaymentInfo .inline-inputs{display:flex;justify-content:space-between}.PaymentInfo .inline-inputs .input-group{flex:1 10rem;max-width:45%;display:flex}\n",".PaymentModal .modal-backdrop{pointer-events:none}.PaymentModal .header{position:relative;border-top-left-radius:10px;border-top-right-radius:10px;width:100%;padding:.25rem 1rem;display:flex;align-items:center;flex-direction:row;background:var(--color-background);border-bottom:1px var(--color-borders) solid}.PaymentModal .header h3{margin-bottom:0;margin-left:1.5rem;unicode-bidi:plaintext;text-align:initial}.PaymentModal .Transition{height:25rem}.PaymentModal .empty-content{height:25rem;max-height:90%;display:flex;align-items:center;justify-content:center}.PaymentModal .receipt-content{height:25rem;overflow-y:auto}.PaymentModal .content{overflow:auto;width:100%;height:100%;position:relative}.PaymentModal .footer{position:relative;border-bottom-left-radius:10px;border-bottom-right-radius:10px;width:100%;padding:.75rem 1rem;background:var(--color-background);border-top:1px var(--color-borders) solid}.PaymentModal .footer button{text-transform:none;font-weight:500}.PaymentModal .modal-dialog{width:25rem}.PaymentModal .modal-content{padding:0;overflow:hidden}@media screen and (max-device-width: 640px) and (max-height: 640px) and (orientation: landscape){.PaymentModal .modal-dialog{max-height:100%}.PaymentModal .Transition{height:10rem}}\n"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/3.33a9836ed01b17d89349.js b/dist/3.33a9836ed01b17d89349.js new file mode 100644 index 00000000..39851e39 --- /dev/null +++ b/dist/3.33a9836ed01b17d89349.js @@ -0,0 +1,2 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[3],{106:function(e,t,a){"use strict";a.r(t),a.d(t,"MediaViewer",(function(){return me})),a.d(t,"ForwardPicker",(function(){return Ce})),a.d(t,"Dialogs",(function(){return Ne})),a.d(t,"Notifications",(function(){return we})),a.d(t,"SafeLinkModal",(function(){return Fe})),a.d(t,"HistoryCalendar",(function(){return Te})),a.d(t,"CalendarModal",(function(){return Re})),a.d(t,"DeleteMessageModal",(function(){return De})),a.d(t,"PinMessageModal",(function(){return Be})),a.d(t,"UnpinAllMessagesModal",(function(){return Ue})),a.d(t,"MessageSelectToolbar",(function(){return He})),a.d(t,"LeftSearch",(function(){return It})),a.d(t,"Settings",(function(){return mn})),a.d(t,"ContactList",(function(){return hn})),a.d(t,"NewChat",(function(){return En})),a.d(t,"NewChatStep1",(function(){return gn})),a.d(t,"NewChatStep2",(function(){return pn})),a.d(t,"ArchivedChats",(function(){return fn})),a.d(t,"ContextMenuContainer",(function(){return Ln})),a.d(t,"StickerSetModal",(function(){return An})),a.d(t,"HeaderMenuContainer",(function(){return Tn})),a.d(t,"MobileSearch",(function(){return Un})),a.d(t,"AttachmentModal",(function(){return Jn})),a.d(t,"PollModal",(function(){return Xn})),a.d(t,"SymbolMenu",(function(){return ys})),a.d(t,"AttachMenu",(function(){return ks})),a.d(t,"MentionTooltip",(function(){return Yn})),a.d(t,"StickerTooltip",(function(){return Ns})),a.d(t,"CustomSendMenu",(function(){return Ss})),a.d(t,"DropArea",(function(){return ws.b})),a.d(t,"TextFormatter",(function(){return Is.a})),a.d(t,"EmojiTooltip",(function(){return Fs})),a.d(t,"InlineBotTooltip",(function(){return Bs})),a.d(t,"RightSearch",(function(){return xs})),a.d(t,"StickerSearch",(function(){return _s})),a.d(t,"GifSearch",(function(){return Hs})),a.d(t,"PollResults",(function(){return Vs})),a.d(t,"Management",(function(){return oc})),a.d(t,"PaymentModal",(function(){return Lc})),a.d(t,"ReceiptModal",(function(){return Tc}));var n=a(0),s=a(1),c=a(8),r=a(13),o=a(2),l=a(6),i=a(55),d=a(118),m=a(7),u=a(4),h=a(3),b=a(137),g=a(50),p=a(186),v=a(32),E=a(110),O=a(123),f=a(201),j=a(30),C=a(38),y=a(151);function k(e,t,a,n,s,c){const{mediaEl:l}=P(t,c);if(!l)return;const{width:m}=i.a.get(),{width:u,height:h}=Object(d.l)(e,s),{width:b,height:g}=Object(d.f)(u,h,n.width,n.height),p=(m-b)/2,v=function(e){const t=window.matchMedia(d.c);let a=4.125;e&&(a+=t.matches?.875:3.375);return a*d.d}(e)+(h-g)/2;let{top:E,left:O,width:f,height:j}=l.getBoundingClientRect();if([r.h.SharedMedia,r.h.Album,r.h.ScheduledAlbum,r.h.SearchResult].includes(t)){const e=function(e,t,a,n,s,c){if(e===t){const r=Math.max(s,c)*(e/t);n-=(r-s)/2,a-=(r-c)/2,s=r,c=r}else if(e>t){const a=s;n-=((s=c*(e/t))-a)/2}else if(t>e){const n=c;a-=((c=s*(t/e))-n)/2}return{top:a,left:n,width:s,height:c}}(b,g,E,O,f,j);E=e.top,O=e.left,f=e.width,j=e.height}const C=O+f/2-(p+b/2),y=E+j/2-(v+g/2),k=f/b,N=j/g,w=S(a||l);I(w,{top:v+"px",left:p+"px",width:b+"px",height:g+"px",transform:`translate3d(${C}px, ${y}px, 0) scale(${k}, ${N})`}),F(w,t),document.body.classList.add("ghost-animating"),requestAnimationFrame(()=>{document.body.appendChild(w),requestAnimationFrame(()=>{w.style.transform="",function(e){e.firstChild.style.objectFit="default",e.classList.remove("rounded-corners","circle")}(w),setTimeout(()=>{requestAnimationFrame(()=>{document.body.contains(w)&&document.body.removeChild(w),document.body.classList.remove("ghost-animating")})},200+o.c)})})}function N(e,t,a){const{container:n,mediaEl:s}=P(e,a);if(!s)return;const c=document.getElementById("MediaViewer").querySelector(".active .media-viewer-content img, .active .media-viewer-content video");if(!c||!s)return;const{top:l,left:d,width:m,height:u}=c.getBoundingClientRect(),{top:h,left:b,width:g,height:p}=s.getBoundingClientRect();let v=h;if(!function(e){if("none"===e.style.display)return!1;const t=e.getBoundingClientRect(),{height:a}=i.a.get();return t.top<=a&&t.top+t.height>=0}(n)){const{height:e}=i.a.get();v=hj?f=j:j>f&&(j=f));const y=document.getElementsByClassName("ghost")[0],k=y||S(t||s,e===r.h.ProfileAvatar);y||I(k,{top:v+"px",left:b+"px",width:g+"px",height:p+"px",transform:`translate3d(${E}px, ${O}px, 0) scale(${f}, ${j})`}),requestAnimationFrame(()=>{if(y){const{top:e,left:t,width:a,height:n}=y.getBoundingClientRect();I(k,{transition:"none",top:v+"px",left:b+"px",transformOrigin:"top left",transform:`translate3d(${t-b}px, ${e-v}px, 0) scale(${a/g}, ${n/p})`,width:g+"px",height:p+"px"})}document.body.classList.add("ghost-animating"),y||document.body.appendChild(k),requestAnimationFrame(()=>{y&&(y.style.transition=""),k.style.transform="",C&&(k.style.opacity="0"),F(k,e),setTimeout(()=>{requestAnimationFrame(()=>{document.body.contains(k)&&document.body.removeChild(k),document.body.classList.remove("ghost-animating")})},200+o.c)})})}function S(e,t=!1){const a=document.createElement("div");a.classList.add("ghost");const n=new Image;if("string"==typeof e?n.src=e:e instanceof HTMLVideoElement?n.src=e.poster:n.src=e.src,a.appendChild(n),t){a.classList.add("ProfileInfo");const e=document.querySelector("#RightColumn .ProfileInfo .info");e&&a.appendChild(e.cloneNode(!0))}return a}function w(e,t){const a=document.querySelector(".active > .MessageList");let n=e.offsetTop+t.closest(".content-inner, .WebPage").offsetTop;return e.id.includes("album-media-")&&(n+=e.parentElement.offsetTop+e.closest(".Message").offsetTop),n>a.scrollTop&&n+t.offsetHeight{if(n&&t)return{sender:Object(u.ob)(t)?Object(m.Jb)(e,t):Object(m.g)(e,t)};if(!a||!t)return{};const s=Object(m.l)(e,t,a);return{message:s,sender:s&&Object(m.vb)(e,s)}},(e,t)=>Object(h.l)(t,["closeMediaViewer","focusMessage"]))(({chatId:e,messageId:t,sender:a,isAvatar:s,message:c,closeMediaViewer:r,focusMessage:o})=>{const l=Object(n.m)(()=>{r(),o({chatId:e,messageId:t})},[e,o,t,r]),i=Object(M.a)();if(!a||!c&&!s)return;const d=a.id<0,m=Object(u.X)(i,a);return n.a.createElement("div",{className:"SenderInfo",onClick:l},d?n.a.createElement(x.a,{key:a.id,size:"medium",chat:a}):n.a.createElement(x.a,{key:a.id,size:"medium",user:a}),n.a.createElement("div",{className:"meta"},n.a.createElement("div",{className:"title",dir:"auto"},m&&Object(U.a)(m)),n.a.createElement("div",{className:"date",dir:"auto"},s?i("lng_mediaview_profile_photo"):Object(B.d)(i,1e3*c.date))))}),z=a(189),q=a(63),_=a(44),H=a(124);a(270);var $=({mediaData:e,isVideo:t,isZoomed:a,message:s,fileName:c,isAvatar:r,onCloseMediaViewer:o,onForward:i,onZoomToggle:d})=>{const{isDownloadStarted:m,downloadProgress:h,handleDownloadClick:b}=Object(z.a)(s&&t?Object(u.E)(s,"download"):void 0,c),g=Object(M.a)(),p=Object(n.p)(()=>({onTrigger:e,isOpen:t})=>n.a.createElement(D.a,{round:!0,size:"smaller",color:"translucent",className:t?"active":void 0,onClick:e,ariaLabel:"More actions"},n.a.createElement("i",{className:"icon-more"})),[]);return l.l?n.a.createElement("div",{className:"MediaViewerActions-mobile"},n.a.createElement(q.a,{trigger:p,positionX:"right"},!r&&n.a.createElement(_.a,{icon:"forward",onClick:i},g("Forward")),t?n.a.createElement(_.a,{icon:m?"close":"download",onClick:b},m?Math.round(100*h)+"% Downloading...":"Download"):n.a.createElement(_.a,{icon:"download",href:e,download:c},g("AccActionDownload"))),m&&n.a.createElement(H.a,{progress:h,size:"s",noCross:!0})):n.a.createElement("div",{className:"MediaViewerActions"},!r&&n.a.createElement(n.a.Fragment,null,n.a.createElement(D.a,{round:!0,size:"smaller",color:"translucent-white",ariaLabel:g("Forward"),onClick:i},n.a.createElement("i",{className:"icon-forward"}))),t?n.a.createElement(D.a,{round:!0,size:"smaller",color:"translucent-white",ariaLabel:g("AccActionDownload"),onClick:b},m?n.a.createElement(H.a,{progress:h,size:"s",onClick:b}):n.a.createElement("i",{className:"icon-download"})):n.a.createElement(D.a,{href:e,download:c,round:!0,size:"smaller",color:"translucent-white",ariaLabel:g("AccActionDownload")},n.a.createElement("i",{className:"icon-download"})),n.a.createElement(D.a,{round:!0,size:"smaller",color:"translucent-white",ariaLabel:a?"Zoom Out":"Zoom In",onClick:d},n.a.createElement("i",{className:a?"icon-zoom-out":"icon-zoom-in"})),n.a.createElement(D.a,{round:!0,size:"smaller",color:"translucent-white",ariaLabel:g("Close"),onClick:o},n.a.createElement("i",{className:"icon-close"})))},V=a(10),W=a(9);a(271);var K=({text:e="",isHidden:t,isForVideo:a,onClick:s})=>{const[c,r]=Object(n.r)(!1);Object(n.n)(()=>{const e=document.querySelector(".MediaViewerFooter .media-text"),t=()=>{const t=e?e.clientHeight:0;r(t>2*d.d)};t();const a=Object(V.h)(t,500,!0);return window.addEventListener("resize",a,!1),()=>{window.removeEventListener("resize",a,!1)}},[]);const o=Object(W.a)("MediaViewerFooter",a&&"is-for-video",t&&"is-hidden");return n.a.createElement("div",{className:o,onClick:function(t){e&&t.stopPropagation()}},e&&n.a.createElement("div",{className:"media-viewer-footer-content",onClick:l.l?void 0:s},n.a.createElement("p",{className:"media-text custom-scroll "+(c?"multiline":""),dir:"auto"},e)))},Y=a(41),Q=a(141);const J=function(){if(void 0!==document.fullscreenElement)return"fullscreenElement";if(void 0!==document.mozFullScreenElement)return"mozFullScreenElement";if(void 0!==document.webkitFullscreenElement)return"webkitFullscreenElement";return""}();var Z=a(152),X=a(140);const ee=["bytes","kB","MB","GB","TB","PB"];var te=e=>{const t=0===e?0:Math.floor(Math.log(e)/Math.log(1024));return`${(e/1024**Math.floor(t)).toFixed(1)} ${ee[t]}`};a(272);const ae=e=>{e.stopPropagation()};var ne=({bufferedProgress:e,currentTime:t,duration:a,fileSize:s,isForceVisible:c,isForceMobileVersion:r,isPlayed:o,isFullscreenSupported:i,isFullscreen:d,onChangeFullscreen:m,onPlayPause:u,onSeek:h})=>{const[b,g]=Object(n.r)(!0);Object(n.n)(()=>{c&&g(c)},[c]),Object(n.n)(()=>{let e;return c||(l.l?g(!1):e=window.setTimeout(()=>{g(!1)},800)),()=>{e&&window.clearTimeout(e)}},[c]),Object(n.n)(()=>((b||c)&&document.body.classList.add("video-controls-visible"),()=>{document.body.classList.remove("video-controls-visible")}),[c,b]);const p=Object(M.a)();var v,E;if(b||c)return n.a.createElement("div",{className:"VideoPlayerControls "+(r?"mobile":""),onClick:ae},function(e,t,a,s){const c=e/t*100,r=100*a;return n.a.createElement("div",{className:"player-seekline"},n.a.createElement("div",{className:"player-seekline-track"},n.a.createElement("div",{className:"player-seekline-buffered",style:`width: ${r||0}%`}),n.a.createElement("div",{className:"player-seekline-played",style:`width: ${c||0}%`}),n.a.createElement("input",{min:"0",max:"100",step:.01,type:"range",onInput:s,className:"player-seekline-input",value:c||0})))}(t,a,e,h),n.a.createElement(D.a,{ariaLabel:p("AccActionPlay"),size:"tiny",ripple:!l.l,color:"translucent-white",className:"play",onClick:u},n.a.createElement("i",{className:o?"icon-pause":"icon-play"})),function(e,t){return n.a.createElement("div",{className:"player-time"},`${Object(B.e)(e)} / ${Object(B.e)(t)}`)}(t,a),e<1&&(v=e,E=s,n.a.createElement("div",{className:"player-file-size"},`${te(E*v)} / ${te(E)}`)),i&&n.a.createElement(D.a,{ariaLabel:"Fullscreen",size:"tiny",color:"translucent-white",className:"fullscreen",onClick:m},n.a.createElement("i",{className:""+(d?"icon-smallscreen":"icon-fullscreen")})))};a(273);function se(){return(se=Object.assign||function(e){for(var t=1;t{const m=Object(n.q)(null),[u,h]=Object(n.r)(!l.n||!l.e),[b,g]=Object(n.r)(0),[p,v]=Object(n.r)(!0),[E,O,f]=function(e,t){const[a,s]=Object(n.r)(Boolean(J&&document[J]));return Object(n.o)(()=>{const a=()=>{s(Boolean(J&&document[J]))},n=()=>{s(!0)},c=()=>{s(!1),t(!1)},r=e.current;return document.addEventListener("fullscreenchange",a,!1),document.addEventListener("webkitfullscreenchange",a,!1),document.addEventListener("mozfullscreenchange",a,!1),r&&(r.addEventListener("webkitbeginfullscreen",n,!1),r.addEventListener("webkitendfullscreen",c,!1)),()=>{document.removeEventListener("fullscreenchange",a,!1),document.removeEventListener("webkitfullscreenchange",a,!1),document.removeEventListener("mozfullscreenchange",a,!1),r&&(r.removeEventListener("webkitbeginfullscreen",n,!1),r.removeEventListener("webkitendfullscreen",c,!1))}},[]),J||"iOS"===l.r?[a,()=>{e.current&&(J||"iOS"===l.r)&&(e.current.requestFullscreen?e.current.requestFullscreen():e.current.webkitRequestFullscreen?e.current.webkitRequestFullscreen():e.current.webkitEnterFullscreen?e.current.webkitEnterFullscreen():e.current.mozRequestFullScreen&&e.current.mozRequestFullScreen(),s(!0))},()=>{e.current&&(document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitCancelFullScreen?document.webkitCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen(),s(!1))}]:[!1]}(m,h),{isBuffered:j,bufferedProgress:C,bufferingHandlers:y}=Object(Q.a)(),{shouldRender:k,transitionClassNames:N}=Object(Y.a)(!j,void 0,void 0,"slow"),{shouldRender:S,transitionClassNames:w}=Object(Y.a)(l.e&&!u&&!k,void 0,void 0,"slow");Object(n.n)(()=>{i||!o?m.current.pause():e&&!l.n&&Object(X.a)(m.current)},[i,o,e]),Object(n.n)(()=>{m.current.currentTime===m.current.duration?(g(0),h(!1)):g(m.current.currentTime)},[b]);const I=Object(n.m)(e=>{e.stopPropagation(),u?(m.current.pause(),h(!1)):(m.current.play(),h(!0))},[u]);Object(Z.a)(m,[]);const P=Object(n.m)(()=>{v(!0)},[]),F=Object(n.m)(()=>{v(!1)},[]),M=Object(n.m)(e=>{g(e.currentTarget.currentTime)},[]),L=Object(n.m)(()=>{g(0),h(!1)},[]),A=Object(n.m)(()=>{E&&f?f():!E&&O&&O()},[f,E,O]),R=Object(n.m)(e=>{e.stopPropagation(),m.current.currentTime=Number(e.target.value)*m.current.duration/100},[]),T=Object(n.m)(e=>{e.stopPropagation(),v(!p)},[p]);Object(n.n)(()=>{const e=e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),I(e))};return document.addEventListener("keydown",e,!1),()=>{document.removeEventListener("keydown",e,!1)}},[I]);const B=s&&`width: ${s.width}px; height: ${s.height}px`,U=`background-image: url(${a})`;return n.a.createElement("div",{className:"VideoPlayer",onClick:!t&&l.l?T:void 0,onMouseOver:t?void 0:P,onMouseOut:t?void 0:F},n.a.createElement("div",{style:B},n.a.createElement("video",se({ref:m,autoPlay:l.n,playsInline:!0,loop:t,muted:t,id:"media-viewer-video",style:U,onEnded:L,onClick:l.l?void 0:I,onDoubleClick:A},y,{onTimeUpdate:M}),e&&n.a.createElement("source",{src:e}))),S&&n.a.createElement(D.a,{round:!0,className:"play-button "+w,onClick:I},n.a.createElement("i",{className:"icon-play"})),k&&n.a.createElement("div",{className:["spinner-container",N].join(" ")},!j&&n.a.createElement("div",{className:"buffering"},"Buffering..."),n.a.createElement(H.a,{size:"xl",progress:j?1:c,square:!0,onClick:d})),!t&&!k&&n.a.createElement(ne,{isPlayed:u,bufferedProgress:C,currentTime:b,isFullscreenSupported:Boolean(O),isFullscreen:E,fileSize:r,duration:m.current?m.current.duration:0,isForceVisible:!u||p,isForceMobileVersion:s&&s.width<400,onSeek:R,onChangeFullscreen:A,onPlayPause:I}))});a(274);var re=Object(n.h)(({isShown:e,onChangeZoom:t})=>{const{transitionClassNames:a}=Object(Y.a)(e),s=Object(j.a)(e),c=Object(n.q)(null),[r,o]=Object(n.r)(1),i=Object(n.q)(!1);Object(n.n)(()=>{e&&!s&&o(1.5)},[e,s]);const d=Object(n.m)(()=>{i.current=!0},[]),m=Object(n.m)(()=>{i.current=!1,1===r&&t(r,!i.current)},[t,r]);Object(n.n)(()=>{t(r,!i.current)},[r,t]);const u=Object(M.a)(),h=Object(W.a)("ZoomControls",a);return n.a.createElement("div",{className:h},n.a.createElement(D.a,{disabled:1===r,size:"tiny",color:"translucent-white",ariaLabel:u("ZoomOut"),className:"zoom-out",ripple:!l.l,onClick:()=>{c.current&&o(Math.max(1,r-.5))}},n.a.createElement("i",{className:"icon-zoom-out"})),n.a.createElement(D.a,{disabled:3===r,size:"tiny",color:"translucent-white",ariaLabel:"Zoom In",className:"zoom-in",ripple:!l.l,onClick:()=>{c.current&&o(Math.min(3,r+.5))}},n.a.createElement("i",{className:"icon-zoom-in"})),n.a.createElement("div",{className:"seekline"},n.a.createElement("div",{className:"seekline-track"},n.a.createElement("div",{className:"seekline-played",style:`width: ${50*(r-1)}%`}),n.a.createElement("input",{ref:c,min:1,max:3,step:"0.5",value:r,type:"range",className:"seekline-input",onChange:e=>{o(Math.min(3,Math.max(Number(e.target.value),1)))},onMouseDown:d,onMouseUp:m}))))});a(275);const oe=[1,0,0,1,0,0],le={1:1,1.5:1.5,2:2.2,2.5:3.3,3:5.5};var ie=Object(n.h)(({children:e,className:t,noWrap:a,canPan:s,zoomLevel:c,panDeltaX:r,panDeltaY:o,onPan:l})=>{const i=le[c]||c,[d,m]=Object(n.r)(!1),[u,b]=Object(n.r)({dx:r,dy:o,x:0,y:0}),[g,p]=Object(n.r)(oe),v=Object(n.q)(null),E=Object(n.q)(null);Object(n.n)(()=>{const e=i||g[0],t=r||g[4],a=o||g[5],n=[...g];g[0]!==e&&(n[0]=e||n[0],n[3]=e||n[3]),g[4]!==t&&(n[4]=t),g[5]!==a&&(n[5]=a),Object(h.a)(g,n)||p(function(e,t,a){const n=a&&a.querySelector(".active img");if(!a||!n)return t;const s=a.getBoundingClientRect(),c=n.getBoundingClientRect(),r=c.width/e*t[0],o=c.height/e*t[3],l=(s.width-r)/2+t[4],i=(s.height-o)/2+t[5];return s.width&&s.width-150{s||p(oe)},[s]),Object(n.n)(()=>{E.current&&(E.current.style.transform=`matrix(${g.toString()})`)},[a,g]);return a?e:n.a.createElement("div",{ref:v,className:"pan-wrapper "+(t||""),onMouseDown:e=>{if(!s)return;e.stopPropagation(),e.preventDefault();const t={dx:g[4],dy:g[5],x:e.pageX,y:e.pageY};b(t),m(!0),v.current&&v.current.classList.add("move")},onMouseUp:()=>{m(!1),v.current&&v.current.classList.remove("move"),l&&l(g[4],g[5])},onMouseMove:e=>{if(d){const t=function(e,t){const a=[...g],n=u.x-e,s=u.y-t;return a[4]=u.dx-n,a[5]=u.dy-s,a}(e.pageX,e.pageY);p(t),E.current&&(E.current.style.transform=`matrix(${g.toString()})`)}}},n.a.createElement("div",{ref:E,className:"pan-container"},e))});a(276);function de(e,t,a){return e?n.a.createElement("img",{src:e,alt:"",style:t?`width: ${t.width}px`:"",draggable:Boolean(a)}):n.a.createElement("div",{className:"spinner-wrapper",style:t?`width: ${t.width}px`:""},n.a.createElement(A.a,{color:"white"}))}var me=Object(n.h)(Object(s.h)(e=>{const{chatId:t,threadId:a,messageId:n,avatarOwnerId:s,profilePhotoIndex:c,origin:o}=e.mediaViewer,{animationLevel:l}=e.settings.byKey;if(o===r.h.SearchResult){if(!t||!n)return{animationLevel:l};const a=Object(m.l)(e,t,n);return a?{chatId:t,messageId:n,senderId:a.senderId,origin:o,message:a,animationLevel:l}:{animationLevel:l}}if(s){return{messageId:-1,senderId:s,avatarOwner:Object(m.Jb)(e,s)||Object(m.g)(e,s),profilePhotoIndex:c||0,animationLevel:l,origin:o}}if(!(t&&a&&n))return{animationLevel:l};let i,d,u;if(i=o&&[r.h.ScheduledAlbum,r.h.ScheduledInline].includes(o)?Object(m.rb)(e,t,n):Object(m.l)(e,t,n),!i)return{animationLevel:l};if(d=o&&[r.h.ScheduledAlbum,r.h.ScheduledInline].includes(o)?Object(m.sb)(e,t):Object(m.n)(e,t),o===r.h.Inline||o===r.h.Album)u=Object(m.hb)(e,t,a)||Object(m.Z)(e,t,a);else if(o===r.h.SharedMedia){const t=Object(m.w)(e),{foundIds:a}=t&&t.resultsByType&&t.resultsByType.media||{};u=a}return{chatId:t,threadId:a,messageId:n,senderId:i.senderId,origin:o,message:i,chatMessages:d,collectionIds:u,animationLevel:l}},(e,t)=>Object(h.l)(t,["openMediaViewer","closeMediaViewer","openForwardMenu","focusMessage"]))(({chatId:e,threadId:t,messageId:a,senderId:s,origin:m,avatarOwner:h,profilePhotoIndex:S,message:w,chatMessages:I,collectionIds:P,openMediaViewer:F,closeMediaViewer:A,openForwardMenu:B,focusMessage:U,animationLevel:x})=>{const z=Boolean(h||a),q=m===r.h.SharedMedia,_=m===r.h.SearchResult,H=w?Object(u.H)(w):void 0,V=w?Object(u.Q)(w):void 0,W=w?Object(u.S)(w):void 0,Y=w?Object(u.T)(w):void 0,Q=!!w&&Object(u.vb)(w),J=!!w&&Object(u.wb)(w),Z=Boolean(V||Y||J),X=Boolean(!Z&&(H||W||Q)),{isGif:ee}=V||Y||{},te=Boolean(h),ae=Boolean(W||Y),ne=Object(n.p)(()=>ae&&a?[a]:Object(u.h)(I||{},P||[],q),[ae,a,I,P,q]),se=a?ne.indexOf(a):-1,oe=0===se||-1===se,le=se===ne.length-1||-1===se,me=Object(n.q)(),ue=Object(j.a)(s);!z||ue&&ue===s&&me.current||(me.current=se);const he=x>=1?"mv-slide":"none",be=2===x?"slide-fade":"none",ge=2===x,[pe,ve]=Object(n.r)(!1),[Ee,Oe]=Object(n.r)(!1),[fe,je]=Object(n.r)(!1),[Ce,ye]=Object(n.r)(1),[ke,Ne]=Object(n.r)({x:0,y:0});function Se(e){if(te&&void 0!==S){const{photos:t}=h;return t&&t[S]?`photo${t[S].id}?size=c`:Object(u.e)(h,e?"big":"normal")}return w&&Object(u.E)(w,e?"viewerFull":"viewerPreview")}const we=Object(E.a)(w&&(q||_)&&Object(u.E)(w,"pictogram"),void 0,c.ApiMediaFormat.BlobUrl,void 0,ge&&350),Ie=Se(),Pe=Object(E.a)(Ie,void 0,te&&Ie&&Ie.startsWith("profilePhoto")?c.ApiMediaFormat.DataUri:c.ApiMediaFormat.BlobUrl,void 0,ge&&350),{mediaData:Fe,downloadProgress:Me}=Object(O.a)(Se(!0),void 0,w&&Object(u.D)(w,"viewerFull"),void 0,ge&&350),Le=H||V?(H||V).blobUrl:void 0;let Ae=!Z&&(Le||Fe)||Pe||we;const Re=Object(f.a)(!Ae&&w&&Object(u.F)(w));Ae||m===r.h.SearchResult||(Ae=Re);const Te=w?Object(u.A)(w):void 0,De=w?Object(u.z)(w):te?`avatar${h.id}-${S}.jpg`:void 0;let Be;w?Q||J?Be=Object(u.y)(w).mediaSize:H||W?Be=Object(u.U)(H||W):(V||Y)&&(Be=Object(u.db)(V||Y)):Be=d.a,Object(n.n)(()=>{l.l&&document.body.classList.toggle("is-media-viewer-open",z)},[z]);const Ue=Object(v.a)();Object(n.n)(()=>{const e=window.matchMedia(d.c);return"function"==typeof e.addEventListener?e.addEventListener("change",Ue):"function"==typeof e.addListener&&e.addListener(Ue),()=>{"function"==typeof e.removeEventListener?e.removeEventListener("change",Ue):"function"==typeof e.removeListener&&e.removeListener(Ue)}},[Ue]);const xe=Object(j.a)(w),Ge=Object(j.a)(m),ze=Object(j.a)(h),qe=Object(j.a)(Ae);Object(n.n)(()=>{if(ge&&z&&!xe&&!ze){Object(C.d)(350+o.c);const e=w?Object(y.a)(w):void 0;k(Boolean(e),m,Ae,Be,Z,w)}ge&&!z&&(xe||ze)&&(Object(C.d)(350+o.c),N(Ge,qe,xe||void 0))},[ge,z,m,Ge,w,xe,ze,Ae,qe,Be,Z]),Object(n.n)(()=>{let e;return fe?Oe(!0):e=window.setTimeout(()=>{Oe(!1)},350),()=>{e&&window.clearTimeout(e)}},[fe]);const _e=()=>{je(!1),ye(1),Ne({x:0,y:0})},He=Object(n.m)(()=>{je(!fe),ye(fe?1:1.5),fe&&Ne({x:0,y:0})},[fe]),$e=Object(n.m)((e,t=!1)=>{ye(e),1===e&&t&&_e()},[]),Ve=Object(n.m)(()=>{A(),_e()},[A]),We=Object(n.m)(()=>{Ve(),U({chatId:e,threadId:t,messageId:a})},[Ve,e,t,U,a]),Ke=Object(n.m)(()=>{B({fromChatId:e,messageIds:[a]}),_e()},[B,e,a]);Object(n.n)(()=>z?Object(g.a)(()=>{fe?_e():Ve()}):void 0,[Ve,z,fe]),Object(n.n)(()=>{Z&&!ee&&Object(p.b)()},[ee,Z]),Object(n.n)(()=>{if(z)return i.a.disableRefresh(),()=>{i.a.enableRefresh()}},[z]);const Ye=Object(n.m)((e,t)=>{let a=ne.indexOf(e);return(-1===t&&a>0||1===t&&a{oe||F({chatId:e,threadId:t,messageId:a?Ye(a,-1):void 0,origin:m})},[e,t,Ye,oe,a,F,m]),Je=Object(n.m)(()=>{le||F({chatId:e,threadId:t,messageId:a?Ye(a,1):void 0,origin:m})},[e,t,Ye,le,a,F,m]);Object(n.n)(()=>{const e=e=>{switch(e.key){case"Left":case"ArrowLeft":Qe();break;case"Right":case"ArrowRight":Je()}};return document.addEventListener("keydown",e,!1),()=>{document.removeEventListener("keydown",e,!1)}}),Object(n.n)(()=>{const e=document.querySelector(".slide-container > .active, .slide-container > .to");if(!e)return;const t=ee&&!l.e;return Object(b.b)(e,{excludedClosestSelector:".backdrop, .navigation, .media-viewer-head, .media-viewer-footer"+(t?"":", .VideoPlayer"),onClick:()=>{fe||l.n||Ve()},onSwipe:l.n?(e,t)=>{t===b.a.Right?Qe():t===b.a.Left?Je():e.target&&e.target.closest(".MediaViewerFooter")||Ve()}:void 0})},[Ve,pe,ee,X,fe,Je,Qe]);const Ze=Object(n.m)((e,t)=>{Ne({x:e,y:t})},[]),Xe=Object(n.m)(()=>{l.n&&(X||ee)&&ve(!pe)},[pe,ee,X]),et=Object(M.a)();function tt(t){if(te)return n.a.createElement("div",{key:e,className:"media-viewer-content"},de(Fe||Pe,Object(d.h)(d.a,!1),!l.l&&!fe));if(w){const e=Object(y.a)(w),s=Boolean(e);return n.a.createElement("div",{key:a,className:"media-viewer-content "+(s?"has-footer":""),onClick:Xe},X&&de(Le||Fe||Pe||we,w&&Object(d.h)(Be,s),!l.l&&!fe),Z&&n.a.createElement(ce,{key:a,url:Le||Fe,isGif:ee,posterData:Ae,posterSize:w&&Object(d.h)(Be,s,!0),downloadProgress:Me,fileSize:Te,isMediaViewerOpen:z,noPlay:!t,onClose:Ve}),e&&n.a.createElement(K,{text:e,onClick:We,isHidden:pe&&(!Z||ee),isForVideo:Z&&!ee}))}}function at(){return te?n.a.createElement(G,{key:h.id,chatId:h.id,isAvatar:!0}):n.a.createElement(G,{key:a,chatId:e,messageId:a})}return Object(L.a)(z,A,F,{chatId:e,threadId:t,messageId:a,origin:m,avatarOwnerId:h&&h.id}),n.a.createElement(R.a,{id:"MediaViewer",className:fe?"zoomed":"",isOpen:z},()=>n.a.createElement(n.a.Fragment,null,n.a.createElement("div",{className:"media-viewer-head",dir:et.isRtl?"rtl":void 0},l.l&&n.a.createElement(D.a,{className:"media-viewer-close",round:!0,size:"smaller",color:"translucent-white",ariaLabel:et("Close"),onClick:Ve},n.a.createElement("i",{className:"icon-close"})),n.a.createElement(T.a,{activeKey:me.current,name:be},at),n.a.createElement($,{mediaData:Fe||Pe,isVideo:Z,isZoomed:fe,message:w,fileName:De,onCloseMediaViewer:Ve,onForward:Ke,onZoomToggle:He,isAvatar:te})),n.a.createElement(ie,{noWrap:!Ee,canPan:fe,panDeltaX:ke.x,panDeltaY:ke.y,zoomLevel:Ce,onPan:Ze},n.a.createElement(T.a,{className:"slide-container",activeKey:se,name:he},tt)),!oe&&n.a.createElement("button",{type:"button",className:"navigation prev "+(Z&&!ee&&"inline"),"aria-label":et("AccDescrPrevious"),dir:et.isRtl?"rtl":void 0,onClick:Qe}),!le&&n.a.createElement("button",{type:"button",className:"navigation next "+(Z&&!ee&&"inline"),"aria-label":et("Next"),dir:et.isRtl?"rtl":void 0,onClick:Je}),n.a.createElement(re,{isShown:fe,onChangeZoom:$e})))})),ue=a(54),he=a(133),be=a(64),ge=a(20),pe=a(112),ve=a(48),Ee=a(115),Oe=a(108),fe=a(111),je=a(130);a(277);var Ce=Object(n.h)(Object(s.h)(e=>{const{chats:{byId:t,listIds:a,orderedPinnedIds:n},currentUserId:s}=e;return{chatsById:t,pinnedIds:n.active,activeListIds:a.active,archivedListIds:a.archived,currentUserId:s}},(e,t)=>Object(h.l)(t,["setForwardChatId","exitForwardMode","loadMoreChats"]))(({chatsById:e,pinnedIds:t,activeListIds:a,archivedListIds:s,currentUserId:r,isOpen:o,setForwardChatId:i,exitForwardMode:d,loadMoreChats:m})=>{const[b,g]=Object(n.r)(""),p=Object(n.q)(null),v=Object(M.a)();Object(n.n)(()=>{o?l.l||setTimeout(()=>{requestAnimationFrame(()=>{p.current&&p.current.focus()})},500):(p.current&&p.current.blur(),setTimeout(()=>{g("")},300))},[o]);const E=Object(n.p)(()=>{const n=[...a||[],...s||[]];let o=t||[];return r&&(o=Object(h.o)([r,...o])),Object(u.Jb)([...n.filter(t=>{const a=e[t];return!a||!!Object(u.d)(a,c.MAIN_THREAD_ID)&&(!b||Object(ue.a)(Object(u.k)(v,e[t],void 0,t===r),b))})],e,void 0,o)},[a,s,e,r,b,v,t]),[O,f]=Object(he.a)(m,E,Boolean(b)),j=Object(n.m)(e=>{g(e.currentTarget.value)},[]),C=Object(n.q)(null),y=Object(be.a)(C,o,e=>{O&&O.length>0&&i({id:O[-1===e?0:e]})},".ListItem-button",!0),k=n.a.createElement("div",{className:"modal-header",dir:v.isRtl?"rtl":void 0},n.a.createElement(D.a,{round:!0,color:"translucent",size:"smaller",ariaLabel:v("Close"),onClick:d},n.a.createElement("i",{className:"icon-close"})),n.a.createElement(ve.a,{ref:p,value:b,onChange:j,onKeyDown:y,placeholder:v("ForwardTo")}));return n.a.createElement(pe.a,{isOpen:o,onClose:d,className:"ForwardPicker",header:k},O&&O.length?n.a.createElement(Ee.a,{className:"picker-list custom-scroll",items:O,onLoadMore:f,noScrollRestore:Boolean(b),ref:C,onKeyDown:y},O.map(e=>n.a.createElement(Oe.a,{key:e,className:"chat-item-clickable force-rounded-corners",onClick:()=>i({id:e})},Object(u.ob)(e)?n.a.createElement(fe.a,{status:e===r?v("SavedMessagesInfo"):void 0,userId:e}):n.a.createElement(je.a,{chatId:e})))):O&&!O.length?n.a.createElement("p",{className:"no-results"},"Sorry, nothing found."):n.a.createElement(ge.a,null))})),ye=a(178);a(278);function ke(e){return e.isSlowMode?"Slowmode enabled":e.hasErrorKey?"Something went wrong":"Telegram"}var Ne=Object(n.h)(Object(s.h)(e=>Object(h.l)(e,["dialogs"]),(e,t)=>Object(h.l)(t,["dismissDialog","acceptInviteConfirmation"]))(({dialogs:e,dismissDialog:t,acceptInviteConfirmation:a})=>{const s=Object(M.a)();if(!e.length)return;return n.a.createElement("div",{id:"Dialogs"},e.map(e=>{return"hash"in e?(e=>{const{hash:c,title:r,participantsCount:o,isChannel:l}=e,i=s(l?"Subscribers":"Members",o,"i"),d=s(l?"ChannelJoin":"JoinGroup");return n.a.createElement(pe.a,{isOpen:!0,onClose:t,className:"error",title:r},void 0!==o&&n.a.createElement("p",null,i),n.a.createElement(D.a,{isText:!0,className:"confirm-dialog-button",onClick:()=>{a({hash:c}),t()}},d),n.a.createElement(D.a,{isText:!0,className:"confirm-dialog-button",onClick:t},s("Cancel")))})(e):(c=e,n.a.createElement(pe.a,{isOpen:!0,onClose:t,className:"error",title:ke(c)},c.hasErrorKey?Object(ye.a)(c):Object(U.a)(c.message,["emoji","br"]),n.a.createElement("div",null,n.a.createElement(D.a,{isText:!0,onClick:t},s("OK")))));var c}))})),Se=a(190);var we=Object(n.h)(Object(s.h)(e=>Object(h.l)(e,["notifications"]),(e,t)=>Object(h.l)(t,["dismissNotification"]))(({notifications:e,dismissNotification:t})=>{if(e.length)return n.a.createElement("div",{id:"Notifications"},e.map(({message:e})=>n.a.createElement(Se.a,{message:Object(U.a)(e,["emoji","br","links","simple_markdown"]),onDismiss:t})))})),Ie=a(139),Pe=a(120);var Fe=Object(n.h)(Object(s.h)(void 0,(e,t)=>Object(h.l)(t,["toggleSafeLinkModal"]))(({url:e,toggleSafeLinkModal:t})=>{const a=Object(M.a)(),s=Object(n.m)(()=>{window.open(e),t({url:void 0})},[t,e]),c=Object(n.m)(()=>{t({url:void 0})},[t]),r=Object(Ie.a)(e);return n.a.createElement(Pe.a,{isOpen:Boolean(e),onClose:c,title:a("OpenUrlTitle"),textParts:Object(U.a)(a("OpenUrlAlert2",r),["links"]),confirmLabel:a("OpenUrlTitle"),confirmHandler:s})}));a(279);const Me=["lng_weekday1","lng_weekday2","lng_weekday3","lng_weekday4","lng_weekday5","lng_weekday6","lng_weekday7"];function Le(e,t,a,n,s){const c=new Date(e,t,a,0,0,0,0),r=n&&new Date(n.getFullYear(),n.getMonth(),n.getDate(),0,0,0,0),o=s&&new Date(s.getFullYear(),s.getMonth(),s.getDate(),0,0,0,0);return!!(o&&c>o)||!!(r&&c{const u=Object(M.a)(),h=new Date,b=Object(n.p)(()=>e?new Date(e):new Date,[e]),g=t?new Date(t):void 0,p=Object(j.a)(c),[v,E]=Object(n.r)(b),[O,f]=Object(n.r)(Ae(b.getHours())),[C,y]=Object(n.r)(Ae(b.getMinutes())),k=v.getFullYear(),N=v.getMonth(),S=v.getDate();Object(n.n)(()=>{!p&&c&&E(b)},[c,b,p]);const w=s&&k>=h.getFullYear()&&N>=h.getMonth()||g&&k>=g.getFullYear()&&N>=g.getMonth(),I=a&&k<=h.getFullYear()&&N<=h.getMonth(),P=Object(n.p)(()=>function(e,t){const a=[],n=new Date;n.setFullYear(e),n.setMonth(t),n.setDate(1);const s=n.getDay()||7;for(let e=1;e{const t=e.target.value.replace(/[^\d]+/g,"");if(!t.length)return f(""),void(e.target.value="");const a=Math.max(0,Math.min(Number(t),23)),n=new Date(v.getTime());n.setHours(a),E(n);const s=Ae(a);f(s),e.target.value=s},[v]),L=Object(n.m)(e=>{const t=e.target.value.replace(/[^\d]+/g,"");if(!t.length)return y(""),void(e.target.value="");const a=Math.max(0,Math.min(Number(t),59)),n=new Date(v.getTime());n.setMinutes(a),E(n);const s=Ae(a);y(s),e.target.value=s},[v]);return n.a.createElement(pe.a,{isOpen:c,onClose:i,className:"CalendarModal"},n.a.createElement("div",{className:"container"},n.a.createElement("div",{className:"month-selector"},n.a.createElement(D.a,{round:!0,size:"smaller",color:"translucent",onClick:i},n.a.createElement("i",{className:"icon-close"})),n.a.createElement("h4",null,u("lng_month"+(v.getMonth()+1))," ",v.getFullYear()),n.a.createElement(D.a,{round:!0,size:"smaller",color:"translucent",disabled:I,onClick:I?void 0:function(){E(e=>{const t=new Date(e);return t.setMonth(t.getMonth()-1),t})}},n.a.createElement("i",{className:"icon-previous"})),n.a.createElement(D.a,{round:!0,size:"smaller",color:"translucent",disabled:w,onClick:w?void 0:function(){E(e=>{const t=new Date(e);return t.setMonth(t.getMonth()+1),t})}},n.a.createElement("i",{className:"icon-next"})))),n.a.createElement("div",{className:"calendar-wrapper"},n.a.createElement("div",{className:"calendar-grid"},Me.map(e=>n.a.createElement("div",{className:"day-button faded weekday"},n.a.createElement("span",null,u(e)))),P.map(e=>n.a.createElement("div",{role:"button",tabIndex:0,onClick:()=>{return t=e,void E(e=>{const a=new Date(e);return a.setDate(t),a});var t},className:Object(W.a)("day-button",Le(k,N,e,a?h:void 0,s?h:g)?"disabled":""+(e?"clickable":""),e===S&&"selected")},!!e&&n.a.createElement("span",null,e))))),r&&n.a.createElement("div",{className:"timepicker"},n.a.createElement("input",{type:"text",className:"form-control",inputMode:"decimal",value:O,onChange:F}),":",n.a.createElement("input",{type:"text",className:"form-control",inputMode:"decimal",value:C,onChange:L})),n.a.createElement("div",{className:"footer"},n.a.createElement(D.a,{onClick:function(){d(v)}},r?function(e,t){const a=Object(B.a)(t,e.code),n=Object(B.a)(new Date,e.code);if(a===n)return e("Conversation.ScheduleMessage.SendToday",Object(B.h)(t));return e("Conversation.ScheduleMessage.SendOn",[a,Object(B.h)(t)])}(u,v):o),l&&n.a.createElement(D.a,{onClick:m,isText:!0},l)))});var Te=Object(n.h)(Object(s.h)(e=>({selectedAt:e.historyCalendarSelectedAt}),(e,t)=>Object(h.l)(t,["searchMessagesByDate","closeHistoryCalendar"]))(({isOpen:e,selectedAt:t,searchMessagesByDate:a,closeHistoryCalendar:s})=>{const c=Object(n.m)(e=>{a({timestamp:e.valueOf()/1e3}),s()},[s,a]),r=Object(M.a)();return n.a.createElement(Re,{isOpen:e,selectedAt:t,isPastMode:!0,submitButtonLabel:r("JumpToDate"),onClose:s,onSubmit:c})}));var De=Object(n.h)(Object(s.h)((e,{message:t,isSchedule:a})=>{const{threadId:n}=Object(m.z)(e)||{},{canDeleteForAll:s}=n&&Object(m.b)(e,t,n)||{},c=Object(m.g)(e,t.chatId);return{canDeleteForAll:!a&&s,contactName:c&&Object(u.ob)(c.id)?Object(u.ab)(Object(m.Jb)(e,Object(u.W)(c))):void 0,willDeleteForCurrentUserOnly:c&&Object(u.lb)(c)&&!s,willDeleteForAll:c&&Object(u.qb)(c)}},(e,t)=>Object(h.l)(t,["deleteMessages","deleteScheduledMessages"]))(({isOpen:e,isSchedule:t,message:a,album:s,canDeleteForAll:c,contactName:r,willDeleteForCurrentUserOnly:o,willDeleteForAll:l,onClose:i,deleteMessages:d,deleteScheduledMessages:m})=>{const u=Object(n.m)(()=>{const e=s&&s.messages?s.messages.map(({id:e})=>e):[a.id];d({messageIds:e,shouldDeleteForAll:!0}),i()},[d,a.id,i,s]),h=Object(n.m)(()=>{const e=s&&s.messages?s.messages.map(({id:e})=>e):[a.id];t?m({messageIds:e}):d({messageIds:e,shouldDeleteForAll:!1}),i()},[s,a.id,t,i,m,d]),b=Object(M.a)();return n.a.createElement(pe.a,{isOpen:e,onClose:i,onEnter:e&&!c?h:void 0,className:"delete",title:b("DeleteSingleMessagesTitle")},n.a.createElement("p",null,b("AreYouSureDeleteSingleMessage")),o&&n.a.createElement("p",null,b("lng_delete_for_me_chat_hint",1,"i")),l&&n.a.createElement("p",null,b("lng_delete_for_everyone_hint",1,"i")),c&&n.a.createElement(D.a,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:u},r&&Object(U.a)(b("Conversation.DeleteMessagesFor",r)),!r&&b("Conversation.DeleteMessagesForEveryone")),n.a.createElement(D.a,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:h},b(c?"ChatList.DeleteForCurrentUser":"Delete")),n.a.createElement(D.a,{className:"confirm-dialog-button",isText:!0,onClick:i},b("Cancel")))}));var Be=Object(n.h)(Object(s.h)((e,{chatId:t})=>{const a=Object(u.ob)(t),n=Object(m.P)(e,t),s=Object(m.g)(e,t),c=!!s&&Object(u.mb)(s),r=!!s&&Object(u.lb)(s),o=!!s&&Object(u.qb)(s);return{isPrivateChat:a,isChatWithSelf:n,isChannel:c,isGroup:r,isSuperGroup:o,canPinForAll:a&&!n||o||r,contactName:s&&Object(u.ob)(s.id)?Object(u.ab)(Object(m.Jb)(e,Object(u.W)(s))):void 0}},(e,t)=>Object(h.l)(t,["pinMessage"]))(({isOpen:e,messageId:t,chatId:a,isChannel:s,isGroup:c,isSuperGroup:r,canPinForAll:o,contactName:l,onClose:i,pinMessage:d})=>{const m=Object(n.m)(()=>{d({chatId:a,messageId:t,isUnpin:!1}),i()},[d,a,t,i]),u=Object(n.m)(()=>{d({chatId:a,messageId:t,isUnpin:!1,isOneSide:!0,isSilent:!0}),i()},[a,t,i,d]),h=Object(M.a)();return n.a.createElement(pe.a,{isOpen:e,onClose:i,className:"pin",title:h("PinMessageAlertTitle")},n.a.createElement("p",null,h(s?"PinMessageAlertChannel":c||r?"PinMessageAlert":"PinMessageAlertChat")),n.a.createElement(D.a,{className:"confirm-dialog-button",isText:!0,onClick:u},h("DialogPin")),o&&n.a.createElement(D.a,{className:"confirm-dialog-button",isText:!0,onClick:m},l?Object(U.a)(h("Conversation.PinMessagesFor",l)):h("Conversation.PinMessageAlert.PinAndNotifyMembers")),n.a.createElement(D.a,{className:"confirm-dialog-button",isText:!0,onClick:i},h("Cancel")))}));var Ue=Object(n.h)(({isOpen:e,pinnedMessagesCount:t=0,onClose:a,onUnpin:s})=>{const c=Object(M.a)();return n.a.createElement(pe.a,{isOpen:e,onClose:a,className:"unpin-all",title:c("Chat.PanelUnpinAllMessages")},n.a.createElement("p",null,c("Chat.UnpinAllMessagesConfirmation",t,"i")),n.a.createElement(D.a,{className:"confirm-dialog-button",isText:!0,onClick:s},c("DialogUnpin")),n.a.createElement(D.a,{className:"confirm-dialog-button",isText:!0,onClick:a},c("Cancel")))}),xe=a(25),Ge=a(57);var ze=Object(n.h)(Object(s.h)((e,{isSchedule:t})=>{const{messageIds:a}=e.selectedMessages||{},{canDeleteForAll:n}=Object(m.e)(e),s=Object(m.s)(e);return{selectedMessageIds:a,canDeleteForAll:!t&&n,contactName:s&&Object(u.ob)(s.id)?Object(u.ab)(Object(m.Jb)(e,Object(u.W)(s))):void 0,willDeleteForCurrentUserOnly:s&&Object(u.lb)(s)&&!n,willDeleteForAll:s&&Object(u.qb)(s)}},(e,t)=>Object(h.l)(t,["deleteMessages","deleteScheduledMessages","exitMessageSelectMode"]))(({isOpen:e,isSchedule:t,selectedMessageIds:a,canDeleteForAll:s,contactName:c,willDeleteForCurrentUserOnly:r,willDeleteForAll:o,onClose:l,deleteMessages:i,deleteScheduledMessages:d,exitMessageSelectMode:m})=>{const u=Object(j.a)(e),h=Object(n.m)(()=>{l(),i({messageIds:a,shouldDeleteForAll:!0})},[i,a,l]),b=Object(n.m)(()=>{t?d({messageIds:a}):i({messageIds:a,shouldDeleteForAll:!1}),l()},[t,l,d,a,i]),g=Object(M.a)();if(Object(n.n)(()=>{!e&&u&&m()},[m,e,u]),a)return n.a.createElement(pe.a,{isOpen:e,onClose:l,onEnter:s?void 0:b,className:"delete",title:g("Conversation.DeleteManyMessages")},n.a.createElement("p",null,g("AreYouSureDeleteFewMessages")),r&&n.a.createElement("p",null,"This will delete them just for you, not for other participants in the chat."),o&&n.a.createElement("p",null,"This will delete them for everyone in this chat."),s&&n.a.createElement(D.a,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:h},c?Object(U.a)(g("ChatList.DeleteForEveryone",c)):g("Conversation.DeleteMessagesForEveryone")),n.a.createElement(D.a,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:b},g(s?"ChatList.DeleteForCurrentUser":"Delete")),n.a.createElement(D.a,{className:"confirm-dialog-button",isText:!0,onClick:l},g("Cancel")))})),qe=a(126);var _e=Object(n.h)(Object(s.h)(void 0,(e,t)=>Object(h.l)(t,["reportMessages","exitMessageSelectMode"]))(({isOpen:e,messageIds:t,reportMessages:a,exitMessageSelectMode:s,onClose:c})=>{const[r,o]=Object(n.r)("spam"),[l,i]=Object(n.r)(""),d=()=>{a({messageIds:t,reason:r,description:l}),s(),c()},m=Object(n.m)(e=>{o(e)},[]),u=Object(n.m)(e=>{i(e.target.value)},[]),h=Object(M.a)(),b=[{value:"spam",label:h("lng_report_reason_spam")},{value:"violence",label:h("lng_report_reason_violence")},{value:"pornography",label:h("lng_report_reason_pornography")},{value:"childAbuse",label:h("lng_report_reason_child_abuse")},{value:"copyright",label:h("ReportPeer.ReasonCopyright")},{value:"other",label:h("lng_report_reason_other")}];if(t)return n.a.createElement(pe.a,{isOpen:e,onClose:c,onEnter:e?d:void 0,className:"report",title:h("lng_report_message_title")},n.a.createElement(qe.a,{name:"report-message",options:b,onChange:m,selected:r}),n.a.createElement(ve.a,{label:h("lng_report_reason_description"),value:l,onChange:u}),n.a.createElement(D.a,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:d},h("lng_report_button")),n.a.createElement(D.a,{className:"confirm-dialog-button",isText:!0,onClick:c},h("Cancel")))}));a(280);var He=Object(n.h)(Object(s.h)(e=>{const{type:t}=Object(m.z)(e)||{},{canDelete:a}=Object(m.e)(e),n=Object(m.f)(e),{messageIds:s}=e.selectedMessages||{};return{isSchedule:"scheduled"===t,selectedMessagesCount:Object(m.ub)(e),canDeleteMessages:a,canReportMessages:n,selectedMessageIds:s}},(e,t)=>Object(h.l)(t,["exitMessageSelectMode","openForwardMenuForSelectedMessages"]))(({canPost:e,isActive:t,messageListType:a,isSchedule:s,selectedMessagesCount:c,canDeleteMessages:r,canReportMessages:o,selectedMessageIds:l,exitMessageSelectMode:i,openForwardMenuForSelectedMessages:d})=>{const[m,u,h]=Object(xe.a)(),[b,g,p]=Object(xe.a)();Object(n.n)(()=>!t||m||b?void 0:Object(Ge.a)({onBackspace:u,onDelete:u,onEsc:i}),[t,m,b,u,i]);const v=Object(j.a)(c||void 0,!0),E=t?c:v,O=Object(M.a)(),f=O("VoiceOver.Chat.MessagesSelected",E),C=Object(W.a)("MessageSelectToolbar",e&&"with-composer",t&&"shown");return n.a.createElement("div",{className:C},n.a.createElement("div",{className:"MessageSelectToolbar-inner"},n.a.createElement(D.a,{color:"translucent",round:!0,onClick:i,ariaLabel:"Exit select mode"},n.a.createElement("i",{className:"icon-close"})),n.a.createElement("span",{className:"MessageSelectToolbar-count",title:f},f),!!c&&n.a.createElement("div",{className:"MessageSelectToolbar-actions"},"scheduled"!==a&&n.a.createElement(_.a,{icon:"forward",ariaLabel:"Forward Messages",onClick:d},n.a.createElement("span",{className:"item-text"},O("Forward"))),o&&n.a.createElement(_.a,{icon:"flag",onClick:g,disabled:!o,ariaLabel:O("Conversation.ReportMessages")},n.a.createElement("span",{className:"item-text"},O("Report"))),n.a.createElement(_.a,{destructive:!0,icon:"delete",onClick:u,disabled:!r,ariaLabel:O("EditAdminGroupDeleteMessages")},n.a.createElement("span",{className:"item-text"},O("Delete"))))),n.a.createElement(ze,{isOpen:m,isSchedule:s,onClose:h}),n.a.createElement(_e,{isOpen:b,onClose:p,messageIds:l}))})),$e=a(177),Ve=a(52),We=a(180),Ke=e=>{const t=Object(n.q)(null),a=Object(n.m)(a=>{if("Enter"!==a.key)return;t.current===document.activeElement&&e()},[e]);return Object(n.n)(()=>(window.addEventListener("keydown",a,!1),()=>window.removeEventListener("keydown",a)),[a]),t},Ye=a(163);var Qe=Object(n.h)(Object(s.h)((e,{chatId:t})=>{const a=Object(m.g)(e,t),n=a&&Object(u.W)(a);return{chat:a,privateChatUser:n?Object(m.Jb)(e,n):void 0,isPinned:Object(m.N)(e,t),isMuted:a?Object(u.Hb)(a,Object(m.fb)(e),Object(m.eb)(e)):void 0}})(({chatId:e,chat:t,privateChatUser:a,isPinned:s,isMuted:c,withUsername:r,onClick:o})=>{const[l,i,d]=Object(xe.a)(),m=Object(We.a)({chat:t,privateChatUser:a,isPinned:s,isMuted:c,handleDelete:i}),h=()=>{o(e)},b=Ke(h);if(t)return n.a.createElement(Oe.a,{className:"chat-item-clickable search-result",onClick:h,contextActions:m,buttonRef:b},Object(u.ob)(e)?n.a.createElement(fe.a,{userId:e,withUsername:r,avatarSize:"large"}):n.a.createElement(je.a,{chatId:e,withUsername:r,avatarSize:"large"}),n.a.createElement(Ye.a,{isOpen:l,onClose:d,chat:t}))})),Je=a(148);a(281);const Ze=Object(V.h)(e=>e(),6e4,!0);var Xe=Object(n.h)(Object(s.h)(e=>{const{userIds:t}=e.topPeers,a=e.users.byId,{recentlyFoundChatIds:n}=e.globalSearch;return{topUserIds:t,usersById:a,recentlyFoundChatIds:n}},(e,t)=>Object(h.l)(t,["loadTopUsers","loadContactList","openChat","addRecentlyFoundChatId","clearRecentlyFoundChats"]))(({topUserIds:e,usersById:t,recentlyFoundChatIds:a,onReset:s,loadTopUsers:c,loadContactList:r,openChat:o,addRecentlyFoundChatId:l,clearRecentlyFoundChats:i})=>{const d=Object(n.q)(null);Object(n.n)(()=>{Ze(()=>{c(),r()})},[c,r]),Object(Je.a)(d.current,!e);const m=Object(n.m)(e=>{o({id:e,shouldReplaceHistory:!0}),s(),setTimeout(()=>{l({id:e})},250)},[o,l,s]),h=Object(M.a)();return n.a.createElement("div",{className:"RecentContacts custom-scroll"},e&&n.a.createElement("div",{className:"top-peers-section",dir:h.isRtl?"rtl":void 0},n.a.createElement("div",{ref:d,className:"top-peers no-selection"},e.map(e=>n.a.createElement("div",{className:"top-peer-item",onClick:()=>m(e),dir:h.isRtl?"rtl":void 0},n.a.createElement(x.a,{user:t[e]}),n.a.createElement("div",{className:"top-peer-name"},Object(U.a)(Object(u.ab)(t[e])||" ")))))),a&&n.a.createElement("div",{className:"search-section pt-1"},n.a.createElement("h3",{className:"section-heading mt-0 recent-chats-header",dir:h.isRtl?"rtl":void 0},h("Recent"),n.a.createElement(D.a,{round:!0,size:"smaller",color:"translucent",ariaLabel:"Clear recent chats",onClick:i,isRtl:h.isRtl},n.a.createElement("i",{className:"icon-close"}))),a.map(e=>n.a.createElement(Qe,{chatId:e,onClick:m}))))})),et=a(138),tt=a(34);a(282);var at=Object(n.h)(Object(s.h)((e,{chatId:t})=>{const a=Object(m.g)(e,t);if(!a)return{};const n=Object(u.W)(a);return{chat:a,lastSyncTime:e.lastSyncTime,...n&&{privateChatUser:Object(m.Jb)(e,n)}}},(e,t)=>Object(h.l)(t,["focusMessage"]))(({message:e,searchQuery:t,chatId:a,chat:s,privateChatUser:c,focusMessage:r,lastSyncTime:o})=>{const i=Object(u.F)(e),d=Object(E.a)(Object(u.E)(e,"micro")),m=Boolean(Object(u.J)(e)),h=Object(n.m)(()=>{r({chatId:a,messageId:e.id})},[a,r,e.id]),b=Object(M.a)(),g=Ke(h);if(s)return n.a.createElement(Oe.a,{className:"ChatMessage chat-item-clickable",ripple:!l.l,onClick:h,buttonRef:g},n.a.createElement(x.a,{chat:s,user:c,withOnlineStatus:!0,isSavedMessages:c&&c.isSelf,lastSyncTime:o}),n.a.createElement("div",{className:"info"},n.a.createElement("div",{className:"info-row"},n.a.createElement("div",{className:"title"},n.a.createElement("h3",{dir:"auto"},Object(U.a)(Object(u.k)(b,s,c))),s.isVerified&&n.a.createElement(et.a,null)),n.a.createElement("div",{className:"message-date"},n.a.createElement(tt.a,{className:"date"},Object(B.g)(b,1e3*e.date)))),n.a.createElement("div",{className:"subtitle"},n.a.createElement("div",{className:"message",dir:"auto"},function(e,t,a,s,c){if(!a)return Object(U.a)(Object(u.O)(e,t));return n.a.createElement("span",{className:"media-preview"},n.a.createElement("img",{src:a,alt:"",className:c?"round":void 0}),Object(u.Q)(t)&&n.a.createElement("i",{className:"icon-play"}),Object(U.a)(Object(u.O)(e,t,!0),["emoji","highlight"],{highlight:s}))}(b,e,d||i,t,m)))))}));a(283);var nt=Object(n.h)(({searchDate:e,onSelect:t})=>{const a=Object(n.p)(()=>function(e){if(e.match(/^\d{2,4}-\d{2}-\d{2}$/g)){const t=new Date(e);return[{date:t,text:Object(B.a)(t)}]}const t=[],a=new Date,n=a.getFullYear(),s=a.getTime()>new Date(`${n}-${e}`).getTime()?n:n-1;for(let a=0;a<8;a++){const n=new Date(`${s-a}-${e}`);t.push({date:n,text:Object(B.a)(n)})}return t}(e),[e]);return n.a.createElement("section",{className:"DateSuggest custom-scroll custom-scroll-x"},a.map(({date:e,text:a})=>n.a.createElement("div",{onClick:()=>t(e),className:"date-item",key:a},n.a.createElement("i",{className:"icon-calendar"}),n.a.createElement("span",null,a))))}),st=a(121),ct=a(146);const rt=Object(V.h)(e=>e(),500,!0);var ot=Object(n.h)(Object(s.h)(e=>{const{byId:t}=e.chats,{byId:a}=e.users,{userIds:n}=e.contactList||{};if(!n)return{chatsById:t,usersById:a};const{currentUserId:s,messages:c,lastSyncTime:r}=e,{fetchingStatus:o,globalResults:l,localResults:i,resultsByType:d}=e.globalSearch,{chatIds:m,userIds:u}=l||{},{chatIds:h,userIds:b}=i||{},{byChatId:g}=c,{foundIds:p}=d&&d.text||{};return{currentUserId:s,localContactIds:n,localChatIds:h,localUserIds:b,globalChatIds:m,globalUserIds:u,foundIds:p,globalMessagesByChatId:g,chatsById:t,usersById:a,fetchingStatus:o,lastSyncTime:r}},(e,t)=>Object(h.l)(t,["openChat","addRecentlyFoundChatId","searchMessagesGlobal","setGlobalSearchChatId"]))(({searchQuery:e,searchDate:t,dateSearchQuery:a,currentUserId:s,localContactIds:c,localChatIds:o,localUserIds:i,globalChatIds:d,globalUserIds:m,foundIds:b,globalMessagesByChatId:g,chatsById:p,usersById:v,fetchingStatus:E,lastSyncTime:O,onReset:f,onSearchDateSelect:j,openChat:C,addRecentlyFoundChatId:y,searchMessagesGlobal:k,setGlobalSearchChatId:N})=>{const S=Object(M.a)(),[w,I]=Object(n.r)(!1),[P,F]=Object(n.r)(!1),L=Object(n.m)(({direction:t})=>{O&&t===r.e.Backwards&&rt(()=>{k({type:"text",query:e})})},[O,k,e]),A=Object(n.m)(e=>{C({id:e,shouldReplaceHistory:!0}),e!==s&&y({id:e}),l.l||f()},[s,C,y,f]),R=Object(n.m)(e=>{N({id:e})},[N]),T=Object(n.p)(()=>{if(!e||e.startsWith("@")&&e.length<2)return Ve.a;const t=c?c.filter(t=>{const a=v[t];if(!a)return!1;const n=Object(u.bb)(a);return n&&Object(ue.a)(n,e)||Object(ue.a)(a.username,e)}):[];return[...s&&Object(ue.a)(S("SavedMessages"),e)?[s]:[],...Object(u.Jb)(Object(h.o)([...t,...o||[],...i||[]]),p)]},[e,c,s,S,o,i,p,v]),D=Object(n.p)(()=>!e||e.length<4||!d||!m?Ve.a:Object(u.Jb)(Object(h.o)([...d,...m]),p,!0),[p,d,m,e]),B=Object(n.p)(()=>(e||t)&&b&&0!==b.length?b.map(e=>{const[t,a]=e.split("_").map(Number);return g&&g[t]&&g[t].byId[a]}).filter(Boolean).sort((e,t)=>t.date-e.date):Ve.a,[b,g,e,t]),U=Object(n.m)(()=>{I(!w)},[w]),x=Object(n.m)(()=>{F(!P)},[P]);const G=E&&!E.chats&&!E.messages&&!T.length&&!D.length&&!B.length;return e||t?n.a.createElement(Ee.a,{className:"LeftSearch custom-scroll",items:B,onLoadMore:L,noScrollRestoreOnTop:!0,noFastList:!0},a&&n.a.createElement("div",{className:"chat-selection no-selection no-scrollbar"},n.a.createElement(nt,{searchDate:a,onSelect:j})),G&&n.a.createElement(st.a,{text:S("ChatList.Search.NoResults"),description:S("ChatList.Search.NoResultsDescription")}),!!T.length&&n.a.createElement("div",{className:"chat-selection no-selection no-scrollbar",dir:S.isRtl?"rtl":void 0},T.map(e=>n.a.createElement(ct.a,{chatOrUserId:e,onClick:R,clickArg:e}))),!!T.length&&n.a.createElement("div",{className:"search-section"},n.a.createElement("h3",{className:"section-heading",dir:S.isRtl?"auto":void 0},T.length>3&&n.a.createElement(tt.a,{onClick:U},S(w?"ChatList.Search.ShowLess":"ChatList.Search.ShowMore")),S("DialogList.SearchSectionDialogs")),T.map((e,t)=>{if(w||!(t>=3))return n.a.createElement(Qe,{chatId:e,onClick:A})})),!!D.length&&n.a.createElement("div",{className:"search-section"},n.a.createElement("h3",{className:"section-heading",dir:S.isRtl?"auto":void 0},D.length>3&&n.a.createElement(tt.a,{onClick:x},S(P?"ChatList.Search.ShowLess":"ChatList.Search.ShowMore")),S("DialogList.SearchSectionGlobal")),D.map((e,t)=>{if(P||!(t>=3))return n.a.createElement(Qe,{chatId:e,withUsername:!0,onClick:A})})),!!B.length&&n.a.createElement("div",{className:"search-section"},n.a.createElement("h3",{className:"section-heading",dir:S.isRtl?"auto":void 0},S("SearchMessages")),B.map((function(t){const a=Object(u.O)(S,t),s=p[t.chatId];if(a&&s)return n.a.createElement(at,{chatId:t.chatId,message:t,searchQuery:e})})))):n.a.createElement(Xe,{onReset:f})}));const lt=Object(V.h)(e=>e(),500,!0);var it=Object(n.h)(Object(s.h)(e=>{const{byId:t}=e.chats,{currentUserId:a,messages:{byChatId:n},lastSyncTime:s}=e,{fetchingStatus:c,resultsByType:r}=e.globalSearch,{foundIds:o}=r&&r.text||{};return{currentUserId:a,foundIds:o,globalMessagesByChatId:n,chatsById:t,fetchingStatus:c,lastSyncTime:s}},(e,t)=>Object(h.l)(t,["searchMessagesGlobal"]))(({searchQuery:e,currentUserId:t,dateSearchQuery:a,foundIds:s,globalMessagesByChatId:c,chatsById:o,fetchingStatus:l,lastSyncTime:i,searchMessagesGlobal:d,onSearchDateSelect:m})=>{const h=Object(M.a)(),b=Object(n.m)(({direction:a})=>{i&&a===r.e.Backwards&<(()=>{d({type:"text",query:e,chatId:t})})},[t,i,d,e]),g=Object(n.p)(()=>s&&0!==s.length?s.map(e=>{const[t,a]=e.split("_").map(Number);return c&&c[t]&&c[t].byId[a]}).filter(Boolean).sort((e,t)=>t.date-e.date):Ve.a,[s,c]);const p=l&&!l.chats&&!l.messages&&!g.length;return n.a.createElement("div",{className:"LeftSearch"},n.a.createElement(Ee.a,{className:"search-content custom-scroll chat-list",items:g,onLoadMore:b,noFastList:!0},a&&n.a.createElement("div",{className:"chat-selection no-selection no-scrollbar"},n.a.createElement(nt,{searchDate:a,onSelect:m})),p&&n.a.createElement(st.a,{text:h("ChatList.Search.NoResults"),description:h("ChatList.Search.NoResultsDescription")}),!!g.length&&g.map((function(t){const a=Object(u.O)(h,t),s=o[t.chatId];if(a&&s)return n.a.createElement(at,{chatId:t.chatId,message:t,searchQuery:e})}))))}));function dt(e){return(t,a)=>{const{byId:n}=t.chats,{byId:s}=t.users,{fetchingStatus:c,resultsByType:r,chatId:o}=t.globalSearch,l="audio"!==e?e:a&&a.isVoice?"voice":"audio",{byChatId:i}=t.messages,{foundIds:d}=r&&r[l]||{};return{theme:Object(m.Db)(t),isLoading:void 0===d||!!c&&Boolean(c.chats||c.messages),chatsById:n,usersById:s,globalMessagesByChatId:i,foundIds:d,searchChatId:o,lastSyncTime:t.lastSyncTime}}}var mt=a(122),ut=a(173);const ht=Object(V.h)(e=>e(),500,!0);var bt=Object(n.h)(Object(s.h)(dt("media"),(e,t)=>Object(h.l)(t,["searchMessagesGlobal","openMediaViewer"]))(({searchQuery:e,searchChatId:t,isLoading:a,globalMessagesByChatId:s,foundIds:c,lastSyncTime:l,searchMessagesGlobal:i,openMediaViewer:d})=>{const m=Object(M.a)(),u=Object(n.m)(({direction:a})=>{l&&a===r.e.Backwards&&ht(()=>{i({type:"media",query:e,chatId:t})})},[l,i,e,t]),h=Object(n.p)(()=>c&&s?c.map(e=>{const[t,a]=e.split("_").map(Number);return s[t]&&s[t].byId[a]}).filter(Boolean):Ve.a,[s,c]),b=Object(n.m)((e,t)=>{d({chatId:t,messageId:e,origin:r.h.SearchResult})},[d]);const g=Object(mt.a)([e],o.Bb)&&!a,p=g&&c&&c.length>0&&!e,v=g&&c&&c.length>0&&e,E=Object(W.a)("search-content custom-scroll",v&&"chat-list");return n.a.createElement("div",{className:"LeftSearch"},n.a.createElement(Ee.a,{className:E,items:h,itemSelector:e?".ListItem":".Media",onLoadMore:u,noFastList:!0},!g&&n.a.createElement(ge.a,null),g&&(!c||0===c.length)&&n.a.createElement(st.a,{text:m("ChatList.Search.NoResults"),description:m("ChatList.Search.NoResultsDescription")}),p&&n.a.createElement("div",{className:"media-list",dir:m.isRtl?"rtl":void 0},h.map(e=>n.a.createElement(ut.a,{key:e.id,idPrefix:"search-media",message:e,onClick:b}))),v&&h.map(e=>n.a.createElement(at,{key:e.id,chatId:e.chatId,message:e}))))}));function gt(e,t,a,n){const{senderId:s}=t;if(!s)return;const c=Object(u.ob)(s)?n[s]:a[s];let r=Object(u.X)(e,c);const o=a[t.chatId];return o&&(Object(u.ob)(s)&&c.isSelf?r=`${e("FromYou")} → ${Object(u.k)(e,o)}`:Object(u.nb)(o)&&(r+=" → "+Object(u.k)(e,o))),r}var pt=a(195);const vt=Object(V.h)(e=>e(),500,!0);var Et=Object(n.h)(Object(s.h)(dt("links"),(e,t)=>Object(h.l)(t,["searchMessagesGlobal","focusMessage"]))(({searchQuery:e,searchChatId:t,isLoading:a,chatsById:s,usersById:c,globalMessagesByChatId:l,foundIds:i,lastSyncTime:d,searchMessagesGlobal:m,focusMessage:u})=>{const h=Object(M.a)(),b=Object(n.m)(({direction:a})=>{d&&a===r.e.Backwards&&vt(()=>{m({type:"links",query:e,chatId:t})})},[d,m,e,t]),g=Object(n.p)(()=>i&&l?i.map(e=>{const[t,a]=e.split("_").map(Number);return l[t]&&l[t].byId[a]}).filter(Boolean):Ve.a,[l,i]),p=Object(n.m)((e,t)=>{u({chatId:t,messageId:e})},[u]);const v=Object(mt.a)([e],o.Bb)&&!a;return n.a.createElement("div",{className:"LeftSearch"},n.a.createElement(Ee.a,{className:"search-content documents-list custom-scroll",items:g,onLoadMore:b,noFastList:!0},!v&&n.a.createElement(ge.a,null),v&&(!i||0===i.length)&&n.a.createElement(st.a,{text:h("ChatList.Search.NoResults"),description:h("ChatList.Search.NoResultsDescription")}),v&&i&&i.length>0&&g.map((e,t)=>{const a=0===t||Object(B.n)(e.date)!==Object(B.n)(g[t-1].date);return n.a.createElement("div",{className:"ListItem",dir:h.isRtl?"rtl":void 0,key:e.id},a&&n.a.createElement("p",{className:"section-heading",dir:h.isRtl?"rtl":void 0},Object(B.f)(h,new Date(1e3*e.date))),n.a.createElement(pt.a,{key:e.id,message:e,senderTitle:gt(h,e,s,c),onMessageClick:p}))})))})),Ot=a(167);const ft=Object(V.h)(e=>e(),500,!0);var jt=Object(n.h)(Object(s.h)(dt("documents"),(e,t)=>Object(h.l)(t,["searchMessagesGlobal","focusMessage"]))(({searchQuery:e,searchChatId:t,isLoading:a,chatsById:s,usersById:c,globalMessagesByChatId:l,foundIds:i,lastSyncTime:d,searchMessagesGlobal:m,focusMessage:h})=>{const b=Object(M.a)(),g=Object(n.m)(({direction:a})=>{d&&a===r.e.Backwards&&ft(()=>{m({type:"documents",query:e,chatId:t})})},[d,m,e,t]),p=Object(n.p)(()=>i&&l?i.map(e=>{const[t,a]=e.split("_").map(Number),n=l[t]&&l[t].byId[a];return n&&Object(u.y)(n)?n:void 0}).filter(Boolean):Ve.a,[l,i]),v=Object(n.m)((e,t)=>{h({chatId:t,messageId:e})},[h]);const E=Object(mt.a)([e],o.Bb)&&!a;return n.a.createElement("div",{className:"LeftSearch"},n.a.createElement(Ee.a,{className:"search-content documents-list custom-scroll",items:p,onLoadMore:g,noFastList:!0},!E&&n.a.createElement(ge.a,null),E&&(!i||0===i.length)&&n.a.createElement(st.a,{text:b("ChatList.Search.NoResults"),description:b("ChatList.Search.NoResultsDescription")}),E&&i&&i.length>0&&p.map((e,t)=>{const a=0===t||Object(B.n)(e.date)!==Object(B.n)(p[t-1].date);return n.a.createElement("div",{className:"ListItem",key:e.id},a&&n.a.createElement("p",{className:"section-heading"},Object(B.f)(b,new Date(1e3*e.date))),n.a.createElement(Ot.a,{message:e,withDate:!0,datetime:e.date,smaller:!0,sender:gt(b,e,s,c),className:"scroll-item",onDateClick:v}))})))})),Ct=a(176);const yt=Object(V.h)(e=>e(),500,!0);var kt=Object(n.h)(Object(s.h)(dt("audio"),(e,t)=>Object(h.l)(t,["searchMessagesGlobal","focusMessage","openAudioPlayer"]))(({theme:e,isVoice:t,searchQuery:a,searchChatId:s,isLoading:c,chatsById:l,usersById:i,globalMessagesByChatId:d,foundIds:m,lastSyncTime:u,searchMessagesGlobal:h,focusMessage:b,openAudioPlayer:g})=>{const p=Object(M.a)(),v=t?"voice":"audio",E=Object(n.m)(({direction:e})=>{u&&e===r.e.Backwards&&yt(()=>{h({type:v,query:a,chatId:s})})},[v,u,h,a,s]),O=Object(n.p)(()=>m&&d?m.map(e=>{const[t,a]=e.split("_").map(Number);return d[t]&&d[t].byId[a]}).filter(Boolean):Ve.a,[d,m]),f=Object(n.m)((e,t)=>{b({chatId:t,messageId:e})},[b]),j=Object(n.m)((e,t)=>{g({chatId:t,messageId:e})},[g]);const C=Object(mt.a)([a],o.Bb)&&!c;return n.a.createElement("div",{className:"LeftSearch"},n.a.createElement(Ee.a,{className:"search-content documents-list custom-scroll",items:O,onLoadMore:E,noFastList:!0},!C&&n.a.createElement(ge.a,null),C&&(!m||0===m.length)&&n.a.createElement(st.a,{text:p("ChatList.Search.NoResults"),description:p("ChatList.Search.NoResultsDescription")}),C&&m&&m.length>0&&O.map((t,a)=>{const s=0===a||Object(B.n)(t.date)!==Object(B.n)(O[a-1].date);return n.a.createElement("div",{className:"ListItem",key:t.id},s&&n.a.createElement("p",{className:"section-heading",dir:p.isRtl?"rtl":void 0},Object(B.f)(p,new Date(1e3*t.date))),n.a.createElement(Ct.a,{key:t.id,theme:e,message:t,target:"searchResult",senderTitle:gt(p,t,l,i),date:t.date,lastSyncTime:u,className:"scroll-item",onPlay:j,onDateClick:f}))})))}));a(284);const Nt=[{type:r.c.ChatList,title:"SearchAllChatsShort"},{type:r.c.Media,title:"SharedMediaTab2"},{type:r.c.Links,title:"SharedLinksTab2"},{type:r.c.Files,title:"SharedFilesTab2"},{type:r.c.Music,title:"SharedMusicTab2"},{type:r.c.Voice,title:"SharedVoiceTab2"}],St=[{type:r.c.ChatList,title:"All Messages"},...Nt.slice(1)],wt=Object.keys(r.c).length/2;var It=Object(n.h)(Object(s.h)(e=>{const{currentContent:t,chatId:a}=e.globalSearch;return{currentContent:t,chatId:a}},(e,t)=>Object(h.l)(t,["setGlobalSearchContent","setGlobalSearchDate"]))(({searchQuery:e,searchDate:t,isActive:a,currentContent:s=r.c.ChatList,chatId:c,setGlobalSearchContent:o,setGlobalSearchDate:l,onReset:i})=>{const d=Object(M.a)(),[m,u]=Object(n.r)(s),h=Object(n.p)(()=>Object(B.l)(e),[e]),b=Object(n.m)(e=>{const t=Nt[e];o({content:t.type}),u(e)},[o]),g=Object(n.m)(e=>{l({date:e.getTime()/1e3})},[l]);Object(L.a)(a,i,void 0,void 0,!0);const p=Object(n.q)(null),v=Object(be.a)(p,a,void 0,".ListItem-button",!0);return n.a.createElement("div",{className:"LeftSearch",ref:p,onKeyDown:v},n.a.createElement($e.a,{activeTab:m,tabs:c?St:Nt,onSwitchTab:b}),n.a.createElement(T.a,{name:d.isRtl?"slide-reversed":"slide",renderCount:wt,activeKey:s},()=>{switch(s){case r.c.ChatList:return c?n.a.createElement(it,{searchQuery:e,dateSearchQuery:h,onReset:i,onSearchDateSelect:g}):n.a.createElement(ot,{searchQuery:e,searchDate:t,dateSearchQuery:h,onReset:i,onSearchDateSelect:g});case r.c.Media:return n.a.createElement(bt,{searchQuery:e});case r.c.Links:return n.a.createElement(Et,{searchQuery:e});case r.c.Files:return n.a.createElement(jt,{searchQuery:e});case r.c.Music:return n.a.createElement(kt,{key:"audio",searchQuery:e});case r.c.Voice:return n.a.createElement(kt,{key:"voice",isVoice:!0,searchQuery:e});default:return}}))})),Pt=a(159);const Ft={currentPassword:"",password:"",hint:"",email:""},Mt=(e,t)=>{switch(t.type){case"setCurrentPassword":return{...e,currentPassword:t.payload};case"setPassword":return{...e,password:t.payload};case"setHint":return{...e,hint:t.payload};case"setEmail":return{...e,email:t.payload};case"reset":return Ft;default:return e}};var Lt=Object(n.h)(Object(s.h)(void 0,(e,t)=>Object(h.l)(t,["signOut","deleteChatFolder"]))(({currentScreen:e,editedFolderId:t,onReset:a,onSaveFilter:s,signOut:c,deleteChatFolder:o})=>{const[i,d]=Object(n.r)(!1),[m,u]=Object(n.r)(!1),h=Object(n.m)(()=>{d(!0)},[]),b=Object(n.m)(()=>{d(!1)},[]),g=Object(n.m)(()=>{u(!0)},[]),p=Object(n.m)(()=>{u(!1)},[]),v=Object(n.m)(()=>{b(),c()},[b,c]),E=Object(n.m)(()=>{p(),o({id:t}),a()},[t,p,o,a]),O=Object(n.p)(()=>({onTrigger:e,isOpen:t})=>n.a.createElement(D.a,{round:!0,ripple:!l.l,size:"smaller",color:"translucent",className:t?"active":"",onClick:e,ariaLabel:"More actions"},n.a.createElement("i",{className:"icon-more"})),[]),f=Object(M.a)();return n.a.createElement("div",{className:"left-header"},n.a.createElement(D.a,{round:!0,size:"smaller",color:"translucent",onClick:a,ariaLabel:f("AccDescrGoBack")},n.a.createElement("i",{className:"icon-arrow-left"})),function(){switch(e){case r.n.EditProfile:return n.a.createElement("h3",null,f("lng_settings_information"));case r.n.General:return n.a.createElement("h3",null,f("General"));case r.n.Notifications:return n.a.createElement("h3",null,f("Notifications"));case r.n.Privacy:return n.a.createElement("h3",null,f("PrivacySettings"));case r.n.Language:return n.a.createElement("h3",null,f("Language"));case r.n.GeneralChatBackground:return n.a.createElement("h3",null,f("ChatBackground"));case r.n.GeneralChatBackgroundColor:return n.a.createElement("h3",null,f("SetColor"));case r.n.PrivacyPhoneNumber:return n.a.createElement("h3",null,f("PrivacyPhone"));case r.n.PrivacyLastSeen:return n.a.createElement("h3",null,f("PrivacyLastSeen"));case r.n.PrivacyProfilePhoto:return n.a.createElement("h3",null,f("Privacy.ProfilePhoto"));case r.n.PrivacyForwarding:return n.a.createElement("h3",null,f("PrivacyForwards"));case r.n.PrivacyGroupChats:return n.a.createElement("h3",null,f("AutodownloadGroupChats"));case r.n.PrivacyPhoneNumberAllowedContacts:case r.n.PrivacyLastSeenAllowedContacts:case r.n.PrivacyProfilePhotoAllowedContacts:case r.n.PrivacyForwardingAllowedContacts:case r.n.PrivacyGroupChatsAllowedContacts:return n.a.createElement("h3",null,f("AlwaysShareWith"));case r.n.PrivacyPhoneNumberDeniedContacts:case r.n.PrivacyLastSeenDeniedContacts:case r.n.PrivacyProfilePhotoDeniedContacts:case r.n.PrivacyForwardingDeniedContacts:case r.n.PrivacyGroupChatsDeniedContacts:return n.a.createElement("h3",null,f("NeverShareWith"));case r.n.PrivacyActiveSessions:return n.a.createElement("h3",null,f("SessionsTitle"));case r.n.PrivacyBlockedUsers:return n.a.createElement("h3",null,f("BlockedUsers"));case r.n.TwoFaDisabled:case r.n.TwoFaEnabled:return n.a.createElement("h3",null,f("TwoStepVerification"));case r.n.TwoFaNewPassword:case r.n.TwoFaChangePasswordNew:case r.n.TwoFaChangePasswordConfirm:return n.a.createElement("h3",null,f("PleaseEnterCurrentPassword"));case r.n.TwoFaNewPasswordConfirm:return n.a.createElement("h3",null,f("PleaseReEnterPassword"));case r.n.TwoFaNewPasswordHint:case r.n.TwoFaChangePasswordHint:return n.a.createElement("h3",null,f("PasswordHint"));case r.n.TwoFaNewPasswordEmail:case r.n.TwoFaRecoveryEmail:return n.a.createElement("h3",null,f("RecoveryEmailTitle"));case r.n.TwoFaNewPasswordEmailCode:case r.n.TwoFaRecoveryEmailCode:return n.a.createElement("h3",null,"Recovery Email Code");case r.n.TwoFaCongratulations:return n.a.createElement("h3",null,f("TwoStepVerificationPasswordSet"));case r.n.TwoFaChangePasswordCurrent:case r.n.TwoFaTurnOff:case r.n.TwoFaRecoveryEmailCurrentPassword:return n.a.createElement("h3",null,f("PleaseEnterCurrentPassword"));case r.n.Folders:return n.a.createElement("h3",null,f("Filters"));case r.n.FoldersCreateFolder:return n.a.createElement("h3",null,f("FilterNew"));case r.n.FoldersEditFolder:case r.n.FoldersEditFolderFromChatList:return n.a.createElement("div",{className:"settings-main-header"},n.a.createElement("h3",null,f("FilterEdit")),t&&n.a.createElement(q.a,{className:"settings-more-menu",trigger:O,positionX:"right"},n.a.createElement(_.a,{icon:"delete",destructive:!0,onClick:g},f("Delete"))));case r.n.FoldersIncludedChats:case r.n.FoldersIncludedChatsFromChatList:case r.n.FoldersExcludedChats:case r.n.FoldersExcludedChatsFromChatList:return n.a.createElement("div",{className:"settings-main-header"},e===r.n.FoldersIncludedChats||e===r.n.FoldersIncludedChatsFromChatList?n.a.createElement("h3",null,f("FilterInclude")):n.a.createElement("h3",null,f("FilterExclude")),n.a.createElement(D.a,{round:!0,size:"smaller",color:"translucent",className:"color-primary",onClick:s,ariaLabel:f("AutoDeleteConfirm")},n.a.createElement("i",{className:"icon-check"})));default:return n.a.createElement("div",{className:"settings-main-header"},n.a.createElement("h3",null,f("SETTINGS")),n.a.createElement(q.a,{className:"settings-more-menu",trigger:O,positionX:"right"},n.a.createElement(_.a,{icon:"logout",onClick:h},f("LogOutTitle"))))}}(),n.a.createElement(Pe.a,{isOpen:i,onClose:b,text:f("lng_sure_logout"),confirmLabel:f("AccountSettings.Logout"),confirmHandler:v,confirmIsDestructive:!0}),n.a.createElement(Pe.a,{isOpen:m,onClose:p,text:f("FilterDeleteAlert"),confirmLabel:f("Delete"),confirmHandler:E,confirmIsDestructive:!0}))})),At=a(24);var Rt=Object(n.h)(Object(s.h)(e=>{const{currentUserId:t}=e;return{currentUser:t?Object(m.Jb)(e,t):void 0}})(({isActive:e,onScreenSelect:t,onReset:a,currentUser:s})=>{const c=Object(M.a)(),o=Object(u.bb)(s);return Object(L.a)(e,a,t,r.n.Main),n.a.createElement("div",{className:"settings-content custom-scroll"},n.a.createElement("div",{className:"settings-main-menu"},s&&n.a.createElement("div",{className:"settings-current-user"},n.a.createElement(x.a,{user:s,size:"jumbo"}),n.a.createElement("p",{className:"name"},o&&Object(U.a)(o)),n.a.createElement("p",{className:"phone"},Object(At.c)(s.phoneNumber))),n.a.createElement(Oe.a,{icon:"edit",onClick:()=>t(r.n.EditProfile)},c("lng_settings_information")),n.a.createElement(Oe.a,{icon:"folder",onClick:()=>t(r.n.Folders)},c("Filters")),n.a.createElement(Oe.a,{icon:"settings",onClick:()=>t(r.n.General)},c("Telegram.GeneralSettingsViewController")),n.a.createElement(Oe.a,{icon:"unmute",onClick:()=>t(r.n.Notifications)},c("Notifications")),n.a.createElement(Oe.a,{icon:"lock",onClick:()=>t(r.n.Privacy)},c("PrivacySettings")),n.a.createElement(Oe.a,{icon:"language",onClick:()=>t(r.n.Language)},c("Language"))))})),Tt=a(136),Dt=a(116);const Bt=/https:\/\/t\.me\/?/i,Ut=/^([a-zA-Z0-9_]+)$/,xt=Object(V.a)(e=>e(),250,!1);var Gt=Object(n.h)(({currentUsername:e,asLink:t,isLoading:a,isUsernameAvailable:s,checkUsername:c,onChange:r})=>{const[o,l]=Object(n.r)(e||""),i=Object(M.a)(),d=t?"SetUrl":"Username",m=i(t?"SetUrlPlaceholder":"Username"),[u,h]=Object(n.p)(()=>o.length?o.length<5?[void 0,m+" is too short"]:o.length>32?[void 0,m+" is too long"]:Ut.test(o)?void 0===s?[]:[s?i(d+"Available","Username"):void 0,!1===s?i(d+"InUse"):void 0]:[void 0,m+" contains invalid characters"]:[],[o,s,i,d,m]);Object(n.n)(()=>{l(e||"")},[t,e]);const b=Object(n.m)(e=>{const a=e.target.value.trim().replace(Bt,"");l(a),e.target.value=`${t?"https://t.me/":""}${a}`;const n=function(e){return e.length>=5&&e.length<=32&&Ut.test(e)}(a);n&&xt(()=>{c({username:a})}),r&&r(!!n&&a)},[t,c,r]);return n.a.createElement(ve.a,{value:`${t?"https://t.me/":""}${o}`,onChange:b,label:m,error:h,success:u,readOnly:a})});const zt=Object(V.h)(e=>e(),6e4,!0);var qt=Object(n.h)(Object(s.h)(e=>{const{currentUserId:t}=e,{progress:a,isUsernameAvailable:n}=e.profileEdit||{},s=t?Object(m.Jb)(e,t):void 0;if(!s)return{progress:a,isUsernameAvailable:n};const{firstName:c,lastName:r,username:o,fullInfo:l}=s,{bio:i}=l||{};return{currentAvatarHash:Object(u.e)(s),currentFirstName:c,currentLastName:r,currentBio:i,currentUsername:o,progress:a,isUsernameAvailable:n}},(e,t)=>Object(h.l)(t,["loadCurrentUser","updateProfile","checkUsername"]))(({isActive:e,onScreenSelect:t,onReset:a,currentAvatarHash:s,currentFirstName:o,currentLastName:l,currentBio:i,currentUsername:d,progress:m,isUsernameAvailable:u,loadCurrentUser:h,updateProfile:b,checkUsername:g})=>{const p=Object(M.a)(),[v,O]=Object(n.r)(!1),[f,j]=Object(n.r)(!1),[C,y]=Object(n.r)(),[k,N]=Object(n.r)(),[S,w]=Object(n.r)(o||""),[I,P]=Object(n.r)(l||""),[F,R]=Object(n.r)(i||""),[T,D]=Object(n.r)(d||""),B=Object(E.a)(s,!1,c.ApiMediaFormat.BlobUrl),x=m===r.k.InProgress,G=!1===T,z=Object(n.p)(()=>!G&&(Boolean(k)||f||!0===u),[k,f,G,u]);Object(L.a)(e,a,t,r.n.EditProfile),Object(n.n)(()=>{zt(()=>{h()})},[h]),Object(n.n)(()=>{N(void 0)},[B]),Object(n.n)(()=>{w(o||""),P(l||""),R(i||"")},[o,l,i]),Object(n.n)(()=>{D(d||"")},[d]),Object(n.n)(()=>{m===r.k.Complete&&(j(!1),O(!1),y(void 0))},[m]);const q=Object(n.m)(e=>{N(e)},[]),_=Object(n.m)(e=>{w(e.target.value),j(!0)},[]),H=Object(n.m)(e=>{P(e.target.value),j(!0)},[]),$=Object(n.m)(e=>{R(e.target.value),j(!0)},[]),V=Object(n.m)(e=>{D(e),O(!0)},[]),W=Object(n.m)(()=>{const e=S.trim(),t=I.trim(),a=F.trim();e.length?a.length>70?y("Bio can' be longer than 70 characters"):b({photo:k,...f&&{firstName:e,lastName:t,bio:a},...v&&{username:T}}):y("Please provide your first name")},[k,S,I,F,f,T,v,b]);return n.a.createElement("div",{className:"settings-fab-wrapper"},n.a.createElement("div",{className:"settings-content custom-scroll"},n.a.createElement("div",{className:"settings-edit-profile"},n.a.createElement(Tt.a,{currentAvatarBlobUrl:B,onChange:q,title:"Edit your profile photo",disabled:x}),n.a.createElement(ve.a,{value:S,onChange:_,label:p("FirstName"),disabled:x,error:"Please provide your first name"===C?C:void 0}),n.a.createElement(ve.a,{value:I,onChange:H,label:p("LastName"),disabled:x}),n.a.createElement(ve.a,{value:F,onChange:$,label:p("UserBio"),disabled:x,error:"Bio can' be longer than 70 characters"===C?C:void 0}),n.a.createElement("p",{className:"settings-item-description",dir:p.isRtl?"rtl":void 0},Object(U.a)(p("lng_settings_about_bio"),["br","simple_markdown"]))),n.a.createElement("div",{className:"settings-item"},n.a.createElement("h4",{className:"settings-item-header",dir:p.isRtl?"rtl":void 0},p("Username")),n.a.createElement(Gt,{currentUsername:T||"",isLoading:x,isUsernameAvailable:u,checkUsername:g,onChange:V}),n.a.createElement("p",{className:"settings-item-description",dir:p.isRtl?"rtl":void 0},Object(U.a)(p("UsernameHelp"),["br","simple_markdown"])),T&&n.a.createElement("p",{className:"settings-item-description",dir:p.isRtl?"rtl":void 0},p("lng_username_link"),n.a.createElement("br",null),n.a.createElement("span",{className:"username-link"},"https://t.me/",T)))),n.a.createElement(Dt.a,{isShown:z,onClick:W,disabled:x,ariaLabel:"Save changes"},x?n.a.createElement(A.a,{color:"white"}):n.a.createElement("i",{className:"icon-check"})))})),_t=a(132),Ht=a(119);const $t=Object(V.h)(e=>e(),6e4,!0);var Vt=Object(n.h)(Object(s.h)(e=>{const{chats:{byId:t},users:{byId:a}}=e,{orderedIds:n,byId:s,recommended:c}=e.chatFolders;return{chatsById:t,usersById:a,orderedFolderIds:n,foldersById:s,recommendedChatFolders:c,notifySettings:Object(m.fb)(e),notifyExceptions:Object(m.eb)(e)}},(e,t)=>Object(h.l)(t,["loadRecommendedChatFolders","addChatFolder","showDialog"]))(({onCreateFolder:e,onEditFolder:t,isActive:a,onScreenSelect:s,onReset:c,chatsById:l,usersById:i,orderedFolderIds:d,foldersById:m,recommendedChatFolders:h,notifySettings:b,notifyExceptions:g,loadRecommendedChatFolders:p,addChatFolder:v,showDialog:E})=>{const[O,f]=Object(n.r)(),[j,C]=Object(n.r)(!1),y=Object(n.m)(()=>C(!0),[]);Object(n.n)(()=>{O||Object(_t.a)("FoldersAll").then(f)},[O]),Object(n.n)(()=>{$t(()=>{p()})},[p]);const k=Object(n.m)(()=>{Object.keys(m).length>=10?E({data:{message:"DIALOG_FILTERS_TOO_MUCH",hasErrorKey:!0}}):e()},[m,E,e]),N=Object(M.a)();Object(L.a)(a,c,s,r.n.Folders);const S=Object(n.p)(()=>{if(!d)return;const e=Object.keys(l).map(Number);return d.map(t=>{const a=m[t];return{id:a.id,title:a.title,subtitle:Object(u.n)(N,l,i,a,e,b,g)}})},[d,l,m,i,b,g,N]),w=Object(n.m)(e=>{Object.keys(m).length>=10?E({data:{message:"DIALOG_FILTERS_TOO_MUCH",hasErrorKey:!0}}):v({folder:e})},[m,v,E]);return n.a.createElement("div",{className:"settings-content custom-scroll"},n.a.createElement("div",{className:"settings-content-header"},n.a.createElement("div",{className:"settings-content-icon"},O&&n.a.createElement(Ht.a,{id:"settingsFoldersMain",size:o.Fb,animationData:O,play:j,noLoop:!0,onLoad:y})),n.a.createElement("p",{className:"settings-item-description mb-3",dir:"auto"},N("CreateNewFilterInfo")),n.a.createElement(D.a,{className:"with-icon mb-2",color:"primary",size:"smaller",pill:!0,fluid:!0,onClick:k,isRtl:N.isRtl},n.a.createElement("i",{className:"icon-add"}),N("CreateNewFilter"))),n.a.createElement("div",{className:"settings-item pt-3"},n.a.createElement("h4",{className:"settings-item-header mb-3",dir:N.isRtl?"rtl":void 0},N("Filters")),S&&S.length?S.map(e=>n.a.createElement(Oe.a,{className:"mb-2",narrow:!0,multiline:!0,onClick:()=>t(m[e.id])},n.a.createElement("span",{className:"title"},e.title),n.a.createElement("span",{className:"subtitle"},e.subtitle))):S&&!S.length?n.a.createElement("p",{className:"settings-item-description my-4",dir:"auto"},"You have no folders yet."):n.a.createElement(ge.a,null)),h&&!!h.length&&n.a.createElement("div",{className:"settings-item pt-3"},n.a.createElement("h4",{className:"settings-item-header mb-3",dir:N.isRtl?"rtl":void 0},N("FilterRecommended")),h.map(e=>n.a.createElement(Oe.a,{className:"mb-2",narrow:!0,onClick:()=>w(e)},n.a.createElement("div",{className:"settings-folders-recommended-item"},n.a.createElement("div",{className:"multiline-item"},n.a.createElement("span",{className:"title"},e.title),n.a.createElement("span",{className:"subtitle"},e.description)),n.a.createElement(D.a,{className:"px-3",color:"primary",size:"tiny",pill:!0,fluid:!0,isRtl:N.isRtl},N("Add")))))))})),Wt=a(145);a(285);var Kt=({count:e,itemName:t,itemPluralName:a,isLoading:s,onClick:c})=>{const r=Object(M.a)();return n.a.createElement(D.a,{className:"ShowMoreButton",color:"translucent",size:"smaller",isText:!0,isLoading:s,isRtl:r.isRtl,onClick:c},n.a.createElement("i",{className:"icon-down"}),"Show ",e," more ",e>1?a||t+"s":t)};const Yt="Please provide a title for this folder.";var Qt=Object(n.h)(Object(s.h)(e=>{const{listIds:t}=e.chats;return{loadedActiveChatIds:t.active,loadedArchivedChatIds:t.archived}},(e,t)=>Object(h.l)(t,["editChatFolder","addChatFolder","loadMoreChats"]))(({state:e,dispatch:t,onAddIncludedChats:a,onAddExcludedChats:s,isActive:c,onScreenSelect:l,onReset:i,onBack:d,loadedActiveChatIds:m,loadedArchivedChatIds:b,editChatFolder:g,addChatFolder:p,loadMoreChats:v})=>{const[E,O]=Object(n.r)(),[f,j]=Object(n.r)(!1),C=Object(n.m)(()=>j(!0),[]),[y,k]=Object(n.r)(!1),[N,S]=Object(n.r)(!1),{selectedChatIds:w,selectedChatTypes:I}=Object(Wt.d)(e,"included"),{selectedChatIds:P,selectedChatTypes:F}=Object(Wt.d)(e,"excluded");Object(n.n)(()=>{E||Object(_t.a)("FoldersNew").then(O)},[E]),Object(n.n)(()=>{k(!1),S(!1)},[e.folderId]);const[R,T]=Object(n.p)(()=>{const e=new Set([...m||[],...b||[]]),t=Object(h.f)(w,e),a=Object(h.f)(P,e);return[y?t:t.slice(0,5-I.length),N?a:a.slice(0,5-F.length)]},[P,w,I,F,N,y,m,b]);Object(n.n)(()=>{(R.lengthk(!0):()=>S(!0);return n.a.createElement(n.a.Fragment,null,t.map(t=>function(e,t){const a="included"===t?Wt.b.find(({key:t})=>t===e):Wt.a.find(({key:t})=>t===e);if(a)return n.a.createElement(Oe.a,{key:a.key,className:"settings-folders-list-item mb-1",icon:a.icon,narrow:!0,inactive:!0},D(a.title))}(t,e)),a.map(e=>n.a.createElement(Oe.a,{className:"settings-folders-list-item mb-1",narrow:!0,inactive:!0},Object(u.ob)(e)?n.a.createElement(fe.a,{avatarSize:"small",userId:e}):n.a.createElement(je.a,{avatarSize:"small",chatId:e}))),!s&&c>0&&n.a.createElement(Kt,{count:c,itemName:"chat",onClick:r}))}return Object(L.a)(c,d,l,"edit"===e.mode?r.n.FoldersEditFolder:r.n.FoldersCreateFolder),n.a.createElement("div",{className:"settings-fab-wrapper"},n.a.createElement("div",{className:"settings-content custom-scroll"},n.a.createElement("div",{className:"settings-content-header"},n.a.createElement("div",{className:"settings-content-icon"},E&&n.a.createElement(Ht.a,{id:"settingsFoldersEdit",size:o.Fb,animationData:E,play:f&&String(e.folderId),noLoop:!0,onLoad:C})),"create"===e.mode&&n.a.createElement("p",{className:"settings-item-description mb-3",dir:D.isRtl?"rtl":void 0},D("FilterIncludeInfo")),n.a.createElement(ve.a,{className:"mb-0",label:D("FilterNameHint"),value:e.folder.title,onChange:function(e){const{currentTarget:a}=e;t({type:"setTitle",payload:a.value.trim()})},error:e.error&&e.error===Yt?Yt:void 0})),n.a.createElement("div",{className:"settings-item no-border pt-3"},e.error&&"ChatList.Filter.Error.Empty"===e.error&&n.a.createElement("p",{className:"settings-item-description color-danger mb-2",dir:D.isRtl?"rtl":void 0},D(e.error)),n.a.createElement("h4",{className:"settings-item-header mb-3",dir:D.isRtl?"rtl":void 0},D("FilterInclude")),n.a.createElement(Oe.a,{className:"settings-folders-list-item color-primary mb-0",icon:"add",onClick:a},D("FilterAddChats")),B("included")),n.a.createElement("div",{className:"settings-item no-border pt-3"},n.a.createElement("h4",{className:"settings-item-header mb-3",dir:D.isRtl?"rtl":void 0},D("FilterExclude")),n.a.createElement(Oe.a,{className:"settings-folders-list-item color-primary mb-0",icon:"add",onClick:s},D("FilterAddChats")),B("excluded"))),n.a.createElement(Dt.a,{isShown:!!e.isTouched,disabled:e.isLoading,onClick:function(){const{title:a}=e.folder;a?w.length||Object.keys(I).length?(t({type:"setIsLoading",payload:!0}),"edit"===e.mode?g({id:e.folderId,folderUpdate:e.folder}):p({folder:e.folder}),setTimeout(()=>{i()},500)):t({type:"setError",payload:"ChatList.Filter.Error.Empty"}):t({type:"setError",payload:Yt})},ariaLabel:"edit"===e.mode?"Save changes":"Create folder"},e.isLoading?n.a.createElement(A.a,{color:"white"}):n.a.createElement("i",{className:"icon-check"})))})),Jt=a(49);a(196),a(286);var Zt=Object(n.h)(({mode:e,chatIds:t,selectedIds:a,selectedChatTypes:s,filterValue:c,onSelectedIdsChange:r,onSelectedChatTypesChange:o,onFilterChange:l,onLoadMore:i})=>{const d=Object(n.q)(null),m="included"===e?Wt.b:Wt.a,h=a.length+s.length>10,b=a.length>=100;Object(n.n)(()=>{setTimeout(()=>{requestAnimationFrame(()=>{d.current.focus()})},500)},[]);const g=Object(n.m)(e=>{const t=[...a];t.includes(e)?t.splice(t.indexOf(e),1):t.push(e),r(t)},[a,r]),p=Object(n.m)(e=>{const t=[...s];t.includes(e)?t.splice(t.indexOf(e),1):t.push(e),o(t)},[s,o]),v=Object(n.m)(e=>{const{value:t}=e.currentTarget;l(t)},[l]),E=Object(M.a)();const[O,f]=Object(he.a)(i,t,Boolean(c));return n.a.createElement("div",{className:"Picker SettingsFoldersChatsPicker"},n.a.createElement("div",{className:"picker-header custom-scroll"},s.map((function(e){const t=m.find(({key:t})=>e===t);if(t)return n.a.createElement(ct.a,{icon:t.icon,title:E(t.title),isMinimized:h,canClose:!0,onClick:p,clickArg:t.key})})),a.map((e,t)=>n.a.createElement(ct.a,{chatOrUserId:e,isMinimized:h&&tp(e.key),ripple:!0},n.a.createElement("i",{className:"icon-"+e.icon}),n.a.createElement("h3",{className:"chat-type",dir:"auto"},E(e.title)),n.a.createElement(Jt.a,{label:"",checked:s.includes(e.key),round:!0}))})),n.a.createElement("div",{key:"divider",className:"picker-list-divider"}),n.a.createElement("h4",{key:"header2",className:"settings-item-header",dir:E.isRtl?"rtl":void 0},E("FilterChats"))),O&&O.length?O.map((function(e){const t=a.includes(e);return n.a.createElement(Oe.a,{key:e,className:"chat-item-clickable picker-list-item chat-item",onClick:()=>g(e),ripple:!0,disabled:!t&&b},Object(u.ob)(e)?n.a.createElement(fe.a,{userId:e}):n.a.createElement(je.a,{chatId:e,withChatType:!0}),n.a.createElement(Jt.a,{label:"",checked:t,round:!0}))})):O&&!O.length?n.a.createElement("p",{className:"no-results",key:"no-results"},"Sorry, nothing found."):n.a.createElement(ge.a,{key:"loading"})))});var Xt=Object(n.h)(Object(s.h)(e=>{const{chats:{byId:t,listIds:a,orderedPinnedIds:n}}=e;return{chatsById:t,listIds:a.active,orderedPinnedIds:n.active,archivedPinnedIds:n.archived,archivedListIds:a.archived}},(e,t)=>Object(h.l)(t,["loadMoreChats"]))(({isActive:e,onScreenSelect:t,onReset:a,mode:s,state:c,dispatch:o,chatsById:l,listIds:i,orderedPinnedIds:d,archivedListIds:m,archivedPinnedIds:h,loadMoreChats:b})=>{const{chatFilter:g}=c,{selectedChatIds:p,selectedChatTypes:v}=Object(Wt.d)(c,s,!0),E=Object(M.a)(),O=Object(n.p)(()=>{const e=i?Object(u.Fb)(l,i,d,"all"):void 0,t=m?Object(u.Fb)(l,m,h,"archived"):void 0;if(e||t)return[...e?[...e.pinnedChats,...e.otherChats]:[],...t?t.otherChats:[]]},[l,i,d,m,h]),f=Object(n.p)(()=>{if(O)return O.filter(e=>!g||Object(ue.a)(Object(u.k)(E,e),g)||p.includes(e.id)).map(({id:e})=>e)},[O,g,E,p]),j=Object(n.m)(e=>{o({type:"setChatFilter",payload:e})},[o]),C=Object(n.m)(e=>{o("included"===s?{type:"setIncludeFilters",payload:{...c.includeFilters,includedChatIds:e}}:{type:"setExcludeFilters",payload:{...c.excludeFilters,excludedChatIds:e}})},[s,c,o]),y=Object(n.m)(e=>{const t={};e.forEach(e=>{t[e]=!0}),o("included"===s?{type:"setIncludeFilters",payload:{includedChatIds:p,...t}}:{type:"setExcludeFilters",payload:{excludedChatIds:p,...t}})},[s,p,o]);return Object(L.a)(e,a,t,"included"===s?r.n.FoldersIncludedChats:r.n.FoldersExcludedChats),f?n.a.createElement(Zt,{mode:s,chatIds:f,selectedIds:p,selectedChatTypes:v,filterValue:g,onSelectedIdsChange:C,onSelectedChatTypesChange:y,onFilterChange:j,onLoadMore:b}):n.a.createElement(ge.a,null)}));a(287);var ea=Object(n.h)(({currentScreen:e,shownScreen:t,state:a,dispatch:s,isActive:c,onScreenSelect:o,onReset:l})=>{const i=Object(n.m)(()=>{e!==r.n.FoldersCreateFolder&&e!==r.n.FoldersEditFolder&&e!==r.n.FoldersEditFolderFromChatList||setTimeout(()=>{s({type:"reset"})},200),e!==r.n.FoldersIncludedChats&&e!==r.n.FoldersExcludedChats?l():"create"===a.mode?o(r.n.FoldersCreateFolder):o(r.n.FoldersEditFolder)},[a.mode,s,e,l,o]),d=Object(n.m)(()=>{s({type:"reset"}),o(r.n.FoldersCreateFolder)},[o,s]),m=Object(n.m)(e=>{s({type:"editFolder",payload:e}),o(r.n.FoldersEditFolder)},[s,o]),u=Object(n.m)(()=>{s({type:"editIncludeFilters"}),o(e===r.n.FoldersEditFolderFromChatList?r.n.FoldersIncludedChatsFromChatList:r.n.FoldersIncludedChats)},[e,s,o]),h=Object(n.m)(()=>{s({type:"editExcludeFilters"}),o(e===r.n.FoldersEditFolderFromChatList?r.n.FoldersExcludedChatsFromChatList:r.n.FoldersExcludedChats)},[e,s,o]);switch(e){case r.n.Folders:return n.a.createElement(Vt,{onCreateFolder:d,onEditFolder:m,onScreenSelect:o,isActive:c||[r.n.FoldersCreateFolder,r.n.FoldersEditFolder,r.n.FoldersIncludedChats,r.n.FoldersExcludedChats].includes(t),onReset:l});case r.n.FoldersCreateFolder:case r.n.FoldersEditFolder:case r.n.FoldersEditFolderFromChatList:return n.a.createElement(Qt,{state:a,dispatch:s,onAddIncludedChats:u,onAddExcludedChats:h,onReset:i,onScreenSelect:o,isActive:c||[r.n.FoldersIncludedChats,r.n.FoldersExcludedChats].includes(t),onBack:l});case r.n.FoldersIncludedChats:case r.n.FoldersIncludedChatsFromChatList:return n.a.createElement(Xt,{mode:"included",state:a,dispatch:s,onReset:i,onScreenSelect:o,isActive:c});case r.n.FoldersExcludedChats:case r.n.FoldersExcludedChatsFromChatList:return n.a.createElement(Xt,{mode:"excluded",state:a,dispatch:s,onReset:i,onScreenSelect:o,isActive:c});default:return}}),ta=a(109);a(288);var aa=Object(n.h)(({options:e,range:t,label:a,value:s,disabled:c,onChange:r})=>{const o=Object(M.a)(),l=Object(n.m)(e=>{r(Number(e.currentTarget.value))},[r]),i=Object(W.a)("RangeSlider",c&&"disabled"),d=Object(n.p)(()=>{if(e)return s/(e.length-1)*100;if(t){const e=(t.max-t.min)/(t.step||1);return(s-t.min)/e*100}return 0},[s,e,t]),[m,u,h]=Object(n.p)(()=>e?[0,e.length-1,1]:t?[t.min,t.max,t.step||1]:[0,0,0],[t,e]);return n.a.createElement("div",{className:i},a&&n.a.createElement("div",{className:"slider-top-row",dir:o.isRtl?"rtl":void 0},n.a.createElement("span",{className:"label",dir:"auto"},a),t&&n.a.createElement("span",{className:"value",dir:"auto"},s)),n.a.createElement("div",{className:"slider-main"},n.a.createElement("div",{className:"slider-fill-track",style:`width: ${d}%`}),n.a.createElement("input",{min:m,max:u,value:s,step:h,type:"range",onChange:l}),e&&n.a.createElement("div",{className:"slider-options"},e.map((e,t)=>n.a.createElement("div",{className:Object(W.a)("slider-option no-selection",t===s&&"active"),onClick:()=>r(t)},e)))))}),na=a(117),sa=a(51);var ca=Object(n.h)(({size:e=o.Mb,stickerSet:t,observeIntersection:a})=>{const s=Object(n.q)(null),r=Object(ta.b)(s,a),l="stickerSet"+t.id,i=Object(E.a)(l,!r,c.ApiMediaFormat.Lottie),{shouldRenderFullMedia:d,transitionClassNames:m}=Object(na.a)(i,"slow");return n.a.createElement("div",{ref:s,className:"sticker-set-cover"},!d&&Object(sa.c)(t.title,2),d&&i&&n.a.createElement(Ht.a,{id:l,size:e,animationData:i,className:m}))});var ra=Object(n.h)(({stickerSet:e,observeIntersection:t})=>{const a=Object(n.q)(null),s=Object(ta.b)(a,t),c=Object(E.a)(e.hasThumbnail&&"stickerSet"+e.id,!s),{shouldRenderFullMedia:r,transitionClassNames:o}=Object(na.a)(c,"slow");return n.a.createElement("div",{ref:a,className:"sticker-set-cover"},!r&&Object(sa.c)(e.title,2),r&&n.a.createElement("img",{src:c,className:o,alt:""}))}),oa=a(125);a(289);var la=Object(n.h)(({stickerSet:e,observeIntersection:t,onClick:a})=>{const s=Object(M.a)();if(!e||!e.stickers)return;const c=e.stickers&&e.stickers[0];return e.hasThumbnail||!c?n.a.createElement(Oe.a,{narrow:!0,className:"SettingsStickerSet",inactive:!c,onClick:()=>c&&a(c)},n.a.createElement(D.a,{ariaLabel:e.title,color:"translucent",isRtl:s.isRtl},e.isAnimated?n.a.createElement(ca,{size:o.Gb,stickerSet:e,observeIntersection:t}):n.a.createElement(ra,{stickerSet:e,observeIntersection:t})),n.a.createElement("div",{className:"multiline-menu-item"},n.a.createElement("div",{className:"title"},e.title),n.a.createElement("div",{className:"subtitle"},s("StickerPack.StickerCount",e.count,"i")))):n.a.createElement(Oe.a,{narrow:!0,className:"SettingsStickerSet",onClick:()=>a(c)},n.a.createElement(oa.a,{sticker:c,size:o.Gb,title:e.title,observeIntersection:t}),n.a.createElement("div",{className:"multiline-menu-item"},n.a.createElement("div",{className:"title"},e.title),n.a.createElement("div",{className:"subtitle"},s("StickerPack.StickerCount",e.count,"i"))))}),ia=a(168);const da=["Solid and Steady","Nice and Fast","Lots of Stuff"];var ma=Object(n.h)(Object(s.h)(e=>({...Object(h.l)(e.settings.byKey,["messageTextSize","animationLevel","messageSendKeyCombo","shouldAutoDownloadMediaFromContacts","shouldAutoDownloadMediaInPrivateChats","shouldAutoDownloadMediaInGroups","shouldAutoDownloadMediaInChannels","shouldAutoPlayGifs","shouldAutoPlayVideos","shouldSuggestStickers","shouldLoopStickers","isSensitiveEnabled","canChangeSensitive"]),stickerSetIds:e.stickers.added.setIds,stickerSetsById:e.stickers.setsById}),(e,t)=>Object(h.l)(t,["setSettingOption","loadStickerSets","loadAddedStickers"]))(({isActive:e,onScreenSelect:t,onReset:a,stickerSetIds:s,stickerSetsById:c,messageTextSize:o,animationLevel:i,messageSendKeyCombo:d,shouldAutoDownloadMediaFromContacts:m,shouldAutoDownloadMediaInPrivateChats:u,shouldAutoDownloadMediaInGroups:h,shouldAutoDownloadMediaInChannels:b,shouldAutoPlayGifs:g,shouldAutoPlayVideos:p,shouldSuggestStickers:v,shouldLoopStickers:E,setSettingOption:O,loadStickerSets:f,loadAddedStickers:j})=>{const C=Object(n.q)(null),{observe:y}=Object(ta.a)({rootRef:C}),[k,N,S]=Object(xe.a)(),[w,I]=Object(n.r)(),P=Object(M.a)(),F=l.n?void 0:[{value:"enter",label:P("lng_settings_send_enter"),subLabel:"New line by Shift + Enter"},{value:"ctrl-enter",label:P(l.f?"lng_settings_send_cmdenter":"lng_settings_send_ctrlenter"),subLabel:"New line by Enter"}];Object(n.n)(()=>{f()},[f]),Object(n.n)(()=>{s&&s.length&&j()},[s,j]);const A=Object(n.m)(e=>{da.forEach((t,a)=>{document.body.classList.toggle("animation-level-"+a,e===a)}),O({animationLevel:e})},[O]),R=Object(n.m)(e=>{document.documentElement.style.setProperty("--composer-text-size",Math.max(e,l.e?16:15)+"px"),document.documentElement.style.setProperty("--message-meta-height",Math.floor(1.3125*e)+"px"),document.documentElement.style.setProperty("--message-text-size",e+"px"),document.documentElement.setAttribute("data-message-text-size",e.toString()),O({messageTextSize:e})},[O]),T=Object(n.m)(e=>{I(e),N()},[N]),D=s&&s.map(e=>!!(c&&c[e]&&c[e].installedDate)&&c[e]).filter(Boolean);return Object(L.a)(e,a,t,r.n.General),n.a.createElement("div",{className:"settings-content custom-scroll"},n.a.createElement("div",{className:"settings-item pt-3"},n.a.createElement("h4",{className:"settings-item-header",dir:P.isRtl?"rtl":void 0},P("SETTINGS")),n.a.createElement(aa,{label:P("TextSize"),range:{min:12,max:20},value:o,onChange:R}),n.a.createElement(Oe.a,{icon:"photo",onClick:()=>t(r.n.GeneralChatBackground)},P("ChatBackground"))),n.a.createElement("div",{className:"settings-item"},n.a.createElement("h4",{className:"settings-item-header",dir:P.isRtl?"rtl":void 0},"Animation Level"),n.a.createElement("p",{className:"settings-item-description",dir:P.isRtl?"rtl":void 0},"Choose the desired animations amount."),n.a.createElement(aa,{options:da,value:i,onChange:A})),F&&n.a.createElement("div",{className:"settings-item"},n.a.createElement("h4",{className:"settings-item-header",dir:P.isRtl?"rtl":void 0},P("VoiceOver.Keyboard")),n.a.createElement(qe.a,{name:"keyboard-send-settings",options:F,onChange:e=>O({messageSendKeyCombo:e}),selected:d})),n.a.createElement("div",{className:"settings-item"},n.a.createElement("h4",{className:"settings-item-header",dir:P.isRtl?"rtl":void 0},P("AutoDownloadMedia")),n.a.createElement(Jt.a,{label:P("Contacts"),checked:m,onCheck:e=>O({shouldAutoDownloadMediaFromContacts:e})}),n.a.createElement(Jt.a,{label:P("AutodownloadPrivateChats"),checked:u,onCheck:e=>O({shouldAutoDownloadMediaInPrivateChats:e})}),n.a.createElement(Jt.a,{label:P("AutodownloadGroupChats"),checked:h,onCheck:e=>O({shouldAutoDownloadMediaInGroups:e})}),n.a.createElement(Jt.a,{label:P("FilterChannels"),checked:b,onCheck:e=>O({shouldAutoDownloadMediaInChannels:e})})),n.a.createElement("div",{className:"settings-item"},n.a.createElement("h4",{className:"settings-item-header",dir:P.isRtl?"rtl":void 0},P("AutoplayMedia")),n.a.createElement(Jt.a,{label:P("GifsTab2"),checked:g,onCheck:e=>O({shouldAutoPlayGifs:e})}),n.a.createElement(Jt.a,{label:P("DataAndStorage.Autoplay.Videos"),checked:p,onCheck:e=>O({shouldAutoPlayVideos:e})})),n.a.createElement("div",{className:"settings-item"},n.a.createElement("h4",{className:"settings-item-header",dir:P.isRtl?"rtl":void 0},P("AccDescrStickers")),n.a.createElement(Jt.a,{label:P("SuggestStickers"),checked:v,onCheck:e=>O({shouldSuggestStickers:e})}),n.a.createElement(Jt.a,{label:P("LoopAnimatedStickers"),checked:E,onCheck:e=>O({shouldLoopStickers:e})}),n.a.createElement("div",{className:"mt-4",ref:C},D&&D.map(e=>n.a.createElement(la,{key:e.id,stickerSet:e,observeIntersection:y,onClick:T}))),w&&n.a.createElement(ia.a,{isOpen:k,fromSticker:w,onClose:S})))}));let ua;function ha(e="*",t,a=!1){ua||(ua=document.createElement("input"),ua.setAttribute("type","file")),ua.setAttribute("accept",e),a?ua.removeAttribute("multiple"):ua.setAttribute("multiple","multiple"),ua.onchange=null,ua.value="",ua.onchange=t,ua.click()}var ba=a(16);function ga(e){return[parseInt(e.substring(0,2),16),parseInt(e.substring(2,4),16),parseInt(e.substring(4,6),16)]}function pa(e){const t=e[0].toString(16),a=e[1].toString(16),n=e[2].toString(16);return(1==t.length?"0"+t:t)+(1==a.length?"0"+a:a)+(1==n.length?"0"+n:n)}function va([e,t,a]){e/=255,t/=255,a/=255;let n,s,c=Math.max(e,t,a),r=Math.min(e,t,a),o=c,l=c-r;if(s=0==c?0:l/c,c==r)n=0;else{switch(c){case e:n=(t-a)/l+(t.5?Math.max(0,.65*n):Math.max(0,Math.min(1,1-.65*n)),`hsla(${360*t}, ${100*a}%, ${100*n}%, .4)`}var fa=a(12),ja=a(169);a(290);var Ca=Object(n.h)(({wallpaper:e,theme:t,isSelected:a,onClick:s})=>{const{slug:c,document:l}=e,i="wallpaper"+l.id,d=l.previewBlobUrl,m=Object(E.a)(i+"?size=m"),u=Object(ja.a)(l.thumbnail&&l.thumbnail.dataUri,Boolean(m),!0),{shouldRenderThumb:h,shouldRenderFullMedia:b,transitionClassNames:g}=Object(na.a)(m||d,"slow"),[p,v]=Object(n.r)(!1),{mediaData:f,downloadProgress:C}=Object(O.a)(i,!p),y=!1===Object(j.a)(p),{shouldRender:k,transitionClassNames:N}=Object(Y.a)(p&&!f||c===r.o,void 0,y,"slow"),S=Object(n.q)();S.current=t;const w=Object(n.m)(()=>{(async()=>{const e=await Object(ba.e)(f);await fa.d(o.o,S.current,e),s(c)})()},[f,s,c]);Object(n.n)(()=>{f&&w()},[f,w]);const I=Object(n.m)(()=>{f?w():v(e=>!e)},[f,w]),P=Object(W.a)("WallpaperTile",a&&"selected");return n.a.createElement("div",{className:P,onClick:I},n.a.createElement("div",{className:"media-inner"},h&&n.a.createElement("canvas",{ref:u,className:"thumbnail"}),b&&n.a.createElement("img",{src:m||d,className:"full-media "+g,alt:""}),k&&n.a.createElement("div",{className:Object(W.a)("spinner-container",N)},n.a.createElement(H.a,{progress:C,onClick:I}))))});a(291);const ya=Object(V.h)(e=>e(),6e4,!0);var ka=Object(n.h)(Object(s.h)(e=>{const t=Object(m.Db)(e),{background:a,isBlurred:n}=e.settings.themes[t]||{},{loadedWallpapers:s}=e.settings;return{background:a,isBlurred:n,loadedWallpapers:s,theme:t}},(e,t)=>Object(h.l)(t,["loadWallpapers","uploadWallpaper","setThemeSettings"]))(({isActive:e,onScreenSelect:t,onReset:a,background:s,isBlurred:c,loadedWallpapers:l,theme:i,loadWallpapers:d,uploadWallpaper:m,setThemeSettings:u})=>{const h=Object(n.q)();h.current=i,Object(n.n)(()=>{ya(()=>{d()})},[d]);const b=Object(n.m)(e=>{const{files:t}=e.target;t&&t.length>0&&m(t[0])},[m]),g=Object(n.m)(()=>{ha("image/jpeg",b,!0)},[b]),p=Object(n.m)(()=>{t(r.n.GeneralChatBackgroundColor)},[t]),v=Object(n.m)(()=>{u({theme:i,background:void 0,backgroundColor:void 0,isBlurred:!0,patternColor:"dark"===i?o.q:o.x})},[u,i]),E=Object(n.m)(e=>{u({theme:h.current,background:e});const t=l&&l.find(t=>t.slug===e);t&&t.document.thumbnail&&async function(e){const t=[0,0,0];let a,n,s,c,r=-4,o=[0,0,0],l=0;const i=document.createElement("canvas"),d=i.getContext&&i.getContext("2d");if(!d)return t;const m=await Object(ba.g)(e);s=m.naturalHeight||m.offsetHeight||m.height,n=m.naturalWidth||m.offsetWidth||m.width,i.height=s,i.width=n,d.drawImage(m,0,0);try{a=d.getImageData(0,0,n,s)}catch(e){return t}for(c=a.data.length;(r+=20){const t=Oa(e),a="#"+pa(e);u({theme:h.current,backgroundColor:a,patternColor:t})})},[l,u]),O=Object(n.m)(e=>{u({theme:h.current,isBlurred:e.target.checked})},[u]),f=Object(M.a)();Object(L.a)(e,a,t,r.n.GeneralChatBackground);const j=l&&l[0]&&l[0].slug===r.o;return n.a.createElement("div",{className:"SettingsGeneralBackground settings-content custom-scroll"},n.a.createElement("div",{className:"settings-item pt-3"},n.a.createElement(Oe.a,{icon:"camera-add",className:"mb-0",disabled:j,onClick:g},f("UploadImage")),n.a.createElement(Oe.a,{icon:"colorize",className:"mb-0",onClick:p},f("SetColor")),n.a.createElement(Oe.a,{icon:"favorite",onClick:v},f("ThemeResetToDefaults")),n.a.createElement(Jt.a,{label:f("BackgroundBlurred"),checked:Boolean(c),onChange:O})),l?n.a.createElement("div",{className:"settings-wallpapers"},l.map(e=>n.a.createElement(Ca,{wallpaper:e,theme:i,isSelected:s===e.slug,onClick:E}))):n.a.createElement(ge.a,null))}));a(292);const Na=va(ga("e6ebee")),Sa=["#e6ebee","#b2cee1","#008dd0","#c6e7cb","#c4e1a6","#60b16e","#ccd0af","#a6a997","#7a7072","#fdd7af","#fdb76e","#dd8851"];function wa(e,t){return{colorPosition:[Math.round(e[1]*(t.colorRect.width-1)),Math.round((1-e[2])*(t.colorRect.height-1))],huePosition:Math.round(e[0]*(t.hueRect.width-1))}}function Ia({colorPosition:e,huePosition:t},a){return[t/(a.hueRect.width-1),e[0]/(a.colorRect.width-1),1-e[1]/(a.colorRect.height-1)]}var Pa=Object(n.h)(Object(s.h)(e=>{const t=Object(m.Db)(e),{backgroundColor:a}=e.settings.themes[t]||{};return{backgroundColor:a,theme:t}},(e,t)=>Object(h.l)(t,["setThemeSettings"]))(({isActive:e,onScreenSelect:t,onReset:a,theme:s,backgroundColor:c,setThemeSettings:o})=>{const l=Object(n.q)();l.current=s;const i=Object(n.q)(null),d=Object(n.q)(null),m=Object(n.q)(null),u=Object(n.q)(!0),[g,p]=Object(n.r)(function(e){return e&&e.startsWith("#")?va(ga(e.replace("#",""))):Na}(c)),v=Object(n.q)(g);Object(n.n)(()=>{v.current=g},[g]);const[E,O,f]=Object(xe.a)(),[j,C]=Object(n.r)(""),[y,k]=Object(n.r)(""),N=Object(n.q)(),S=Object(n.q)();Object(n.n)(()=>{const e={offsetLeft:d.current.offsetLeft,...Object(h.l)(d.current.getBoundingClientRect(),["top","width","height"])},t={offsetLeft:m.current.offsetLeft,...Object(h.l)(m.current.getBoundingClientRect(),["width"])};function a(t){const a=[Math.min(Math.max(0,t.pageX-e.offsetLeft),e.width-1),Math.min(Math.max(0,t.pageY-e.top+i.current.scrollTop),e.height-1)],{huePosition:n}=wa(v.current,N.current);p(Ia({colorPosition:a,huePosition:n},N.current)),O()}function n(e){const{colorPosition:a}=wa(v.current,N.current),n=Math.min(Math.max(0,e.pageX-t.offsetLeft),t.width-1);p(Ia({colorPosition:a,huePosition:n},N.current)),O()}N.current={colorRect:e,hueRect:t},Object(b.b)(d.current,{onCapture:a,onDrag:a,onRelease:f,onClick:f,withCursor:!0}),Object(b.b)(m.current,{onCapture:n,onDrag:n,onRelease:f,onClick:f,withCursor:!0})},[O,f]);const{colorPosition:w=[0,0],huePosition:I=0}=N.current?wa(g,N.current):{},P=pa(Ea(g)),F=g[0],M=pa(Ea([F,1,1]));Object(n.n)(()=>{const e=Ea(g),t="#"+pa(e);if(C(e.join(", ")),k(t),!u.current){const a=Oa(e);o({theme:l.current,background:void 0,backgroundColor:t,patternColor:a})}u.current=!1},[g,o]),Object(n.n)(()=>{!function(e,t,a,n){let s,c,r;a.current&&n.current?(s=n.current.colorRect.width,c=n.current.colorRect.height,r=a.current):(s=e.offsetWidth,c=e.offsetHeight,r=e.getContext("2d"),e.width=s,e.height=c,a.current=r);const o=r.createImageData(s,c),l=o.data,i=Ea([t,1,1]);let d=0;for(let e=0;e{!function(e){const t=e.offsetWidth;e.width=t,e.height=1;const a=e.getContext("2d"),n=a.createImageData(t,1),s=n.data;let c=0;for(let e=0;e{const t=e.currentTarget.value.replace(/[^\d, ]/g,"").slice(0,13);if(t.match(/^\d{1,3},\s?\d{1,3},\s?\d{1,3}$/)){const e=t.split(",").map(e=>Number(e.trim()));p(va(e))}e.currentTarget.value=t},[]),R=Object(n.m)(e=>{const t=e.currentTarget.value.replace(/[^0-9a-fA-F]/g,"").slice(0,6);t.match(/^#?[0-9a-fA-F]{6}$/)&&p(va(ga(t.replace("#","")))),e.currentTarget.value=t},[]),T=Object(n.m)(e=>{p(va(ga(e.currentTarget.dataset.color.replace("#",""))))},[]),D=Object(W.a)("SettingsGeneralBackgroundColor settings-content custom-scroll",E&&"is-dragging");return Object(L.a)(e,a,t,r.n.GeneralChatBackgroundColor),n.a.createElement("div",{ref:i,className:D},n.a.createElement("div",{className:"settings-item pt-3"},n.a.createElement("div",{ref:d,className:"color-picker"},n.a.createElement("canvas",null),n.a.createElement("div",{className:"handle",style:`transform: translate(${w[0]}px, ${w[1]}px); background-color: #${P};`})),n.a.createElement("div",{ref:m,className:"hue-picker"},n.a.createElement("canvas",null),n.a.createElement("div",{className:"handle",style:`transform: translateX(${I}px); background-color: #${M};`})),n.a.createElement("div",{className:"tools"},n.a.createElement(ve.a,{value:y,label:"HEX",onChange:R}),n.a.createElement(ve.a,{value:j,label:"RGB",onChange:A}))),n.a.createElement("div",{className:"predefined-colors"},Sa.map(e=>n.a.createElement("div",{className:e==="#"+P?"active":void 0,"data-color":e,style:`background-color: ${e};`,onClick:T}))))}));var Fa=Object(n.h)(Object(s.h)(e=>({hasPrivateChatsNotifications:Boolean(e.settings.byKey.hasPrivateChatsNotifications),hasPrivateChatsMessagePreview:Boolean(e.settings.byKey.hasPrivateChatsMessagePreview),hasGroupNotifications:Boolean(e.settings.byKey.hasGroupNotifications),hasGroupMessagePreview:Boolean(e.settings.byKey.hasGroupMessagePreview),hasBroadcastNotifications:Boolean(e.settings.byKey.hasBroadcastNotifications),hasBroadcastMessagePreview:Boolean(e.settings.byKey.hasBroadcastMessagePreview),hasContactJoinedNotifications:Boolean(e.settings.byKey.hasContactJoinedNotifications),hasWebNotifications:e.settings.byKey.hasWebNotifications,hasPushNotifications:e.settings.byKey.hasPushNotifications,notificationSoundVolume:e.settings.byKey.notificationSoundVolume}),(e,t)=>Object(h.l)(t,["loadNotificationSettings","updateContactSignUpNotification","updateNotificationSettings","updateWebNotificationSettings"]))(({isActive:e,onScreenSelect:t,onReset:a,hasPrivateChatsNotifications:s,hasPrivateChatsMessagePreview:c,hasGroupNotifications:o,hasGroupMessagePreview:l,hasBroadcastNotifications:i,hasBroadcastMessagePreview:d,hasContactJoinedNotifications:m,hasPushNotifications:u,hasWebNotifications:h,notificationSoundVolume:b,loadNotificationSettings:g,updateContactSignUpNotification:p,updateNotificationSettings:v,updateWebNotificationSettings:E})=>{Object(n.n)(()=>{g()},[g]);const O=Object(n.m)((e,t,a)=>{const n="contact"===t?!s:!("group"===t?o:i),r="contact"===t?c:"group"===t?l:d;v({peerType:t,..."silent"===a&&{isSilent:!e.target.checked,shouldShowPreviews:r},..."showPreviews"===a&&{shouldShowPreviews:e.target.checked,isSilent:n}})},[d,i,l,o,c,s,v]),f=Object(n.m)(e=>{p({isSilent:!e.target.checked})},[p]),j=Object(M.a)();return Object(L.a)(e,a,t,r.n.Notifications),n.a.createElement("div",{className:"settings-content custom-scroll"},n.a.createElement("div",{className:"settings-item"},n.a.createElement("h4",{className:"settings-item-header",dir:j.isRtl?"rtl":void 0},"Web notifications"),n.a.createElement(Jt.a,{label:"Web notifications",subLabel:j(h?"UserInfo.NotificationsEnabled":"UserInfo.NotificationsDisabled"),checked:h,onChange:e=>{E({hasWebNotifications:e.target.checked})}}),n.a.createElement(Jt.a,{label:"Offline notifications",disabled:!h,subLabel:j(u?"UserInfo.NotificationsEnabled":"UserInfo.NotificationsDisabled"),checked:u,onChange:e=>{E({hasPushNotifications:e.target.checked})}}),n.a.createElement("div",{className:"settings-item-slider"},n.a.createElement(aa,{label:"Sound",disabled:!h,range:{min:0,max:10},value:b,onChange:e=>{E({notificationSoundVolume:e})}}))),n.a.createElement("div",{className:"settings-item"},n.a.createElement("h4",{className:"settings-item-header",dir:j.isRtl?"rtl":void 0},j("AutodownloadPrivateChats")),n.a.createElement(Jt.a,{label:j("NotificationsForPrivateChats"),subLabel:j(s?"UserInfo.NotificationsEnabled":"UserInfo.NotificationsDisabled"),checked:s,onChange:e=>{O(e,"contact","silent")}}),n.a.createElement(Jt.a,{label:j("MessagePreview"),disabled:!s,subLabel:j(c?"UserInfo.NotificationsEnabled":"UserInfo.NotificationsDisabled"),checked:c,onChange:e=>{O(e,"contact","showPreviews")}})),n.a.createElement("div",{className:"settings-item"},n.a.createElement("h4",{className:"settings-item-header",dir:j.isRtl?"rtl":void 0},j("FilterGroups")),n.a.createElement(Jt.a,{label:j("NotificationsForGroups"),subLabel:j(o?"UserInfo.NotificationsEnabled":"UserInfo.NotificationsDisabled"),checked:o,onChange:e=>{O(e,"group","silent")}}),n.a.createElement(Jt.a,{label:j("MessagePreview"),disabled:!o,subLabel:j(l?"UserInfo.NotificationsEnabled":"UserInfo.NotificationsDisabled"),checked:l,onChange:e=>{O(e,"group","showPreviews")}})),n.a.createElement("div",{className:"settings-item"},n.a.createElement("h4",{className:"settings-item-header",dir:j.isRtl?"rtl":void 0},j("FilterChannels")),n.a.createElement(Jt.a,{label:j("NotificationsForChannels"),subLabel:j(i?"UserInfo.NotificationsEnabled":"UserInfo.NotificationsDisabled"),checked:i,onChange:e=>{O(e,"broadcast","silent")}}),n.a.createElement(Jt.a,{label:j("MessagePreview"),disabled:!i,subLabel:j(d?"UserInfo.NotificationsEnabled":"UserInfo.NotificationsDisabled"),checked:d,onChange:e=>{O(e,"broadcast","showPreviews")}})),n.a.createElement("div",{className:"settings-item"},n.a.createElement("h4",{className:"settings-item-header",dir:j.isRtl?"rtl":void 0},j("PhoneOther")),n.a.createElement(Jt.a,{label:j("ContactJoined"),checked:m,onChange:f})))}));var Ma=Object(n.h)(Object(s.h)(e=>{const{settings:{byKey:{hasPassword:t,isSensitiveEnabled:a,canChangeSensitive:n},privacy:s},blocked:c,activeSessions:r}=e;return{hasPassword:t,blockedCount:c.totalCount,sessionsCount:r.length,isSensitiveEnabled:a,canChangeSensitive:n,visibilityPrivacyPhoneNumber:s.phoneNumber&&s.phoneNumber.visibility,visibilityPrivacyLastSeen:s.lastSeen&&s.lastSeen.visibility,visibilityPrivacyProfilePhoto:s.profilePhoto&&s.profilePhoto.visibility,visibilityPrivacyForwarding:s.forwards&&s.forwards.visibility,visibilityPrivacyGroupChats:s.chatInvite&&s.chatInvite.visibility}},(e,t)=>Object(h.l)(t,["loadBlockedContacts","loadAuthorizations","loadPrivacySettings","loadContentSettings","updateContentSettings"]))(({isActive:e,onScreenSelect:t,onReset:a,hasPassword:s,blockedCount:c,sessionsCount:o,isSensitiveEnabled:l,canChangeSensitive:i,visibilityPrivacyPhoneNumber:d,visibilityPrivacyLastSeen:m,visibilityPrivacyProfilePhoto:u,visibilityPrivacyForwarding:h,visibilityPrivacyGroupChats:b,loadPrivacySettings:g,loadBlockedContacts:p,loadAuthorizations:v,loadContentSettings:E,updateContentSettings:O})=>{Object(n.n)(()=>{p(),v(),g(),E()},[p,v,g,E]);const f=Object(M.a)();function j(e){switch(e){case"everybody":return f("P2PEverybody");case"contacts":return f("P2PContacts");case"nobody":return f("P2PNobody")}}return Object(L.a)(e,a,t,r.n.Privacy),n.a.createElement("div",{className:"settings-content custom-scroll"},n.a.createElement("div",{className:"settings-item pt-3"},n.a.createElement(Oe.a,{icon:"delete-user",narrow:!0,onClick:()=>t(r.n.PrivacyBlockedUsers)},n.a.createElement("div",{className:"multiline-menu-item"},n.a.createElement("span",{className:"title"},f("BlockedUsers")),c>0&&n.a.createElement("span",{className:"subtitle",dir:"auto"},f("Users",c)))),n.a.createElement(Oe.a,{icon:"lock",narrow:!0,onClick:()=>t(s?r.n.TwoFaEnabled:r.n.TwoFaDisabled)},n.a.createElement("div",{className:"multiline-menu-item"},n.a.createElement("span",{className:"title"},f("TwoStepVerification")),n.a.createElement("span",{className:"subtitle",dir:"auto"},f(s?"PasswordOn":"PasswordOff")))),n.a.createElement(Oe.a,{icon:"active-sessions",narrow:!0,onClick:()=>t(r.n.PrivacyActiveSessions)},n.a.createElement("div",{className:"multiline-menu-item"},n.a.createElement("span",{className:"title"},f("SessionsTitle")),o>0&&n.a.createElement("span",{className:"subtitle",dir:"auto"},1===o?"1 session":o+" sessions")))),n.a.createElement("div",{className:"settings-item"},n.a.createElement("h4",{className:"settings-item-header mb-4",dir:f.isRtl?"rtl":void 0},f("PrivacyTitle")),n.a.createElement(Oe.a,{narrow:!0,onClick:()=>t(r.n.PrivacyPhoneNumber)},n.a.createElement("div",{className:"multiline-menu-item"},n.a.createElement("span",{className:"title"},f("PrivacyPhoneTitle")),n.a.createElement("span",{className:"subtitle",dir:"auto"},j(d)))),n.a.createElement(Oe.a,{narrow:!0,onClick:()=>t(r.n.PrivacyLastSeen)},n.a.createElement("div",{className:"multiline-menu-item"},n.a.createElement("span",{className:"title"},f("LastSeenTitle")),n.a.createElement("span",{className:"subtitle",dir:"auto"},j(m)))),n.a.createElement(Oe.a,{narrow:!0,onClick:()=>t(r.n.PrivacyProfilePhoto)},n.a.createElement("div",{className:"multiline-menu-item"},n.a.createElement("span",{className:"title"},f("PrivacyProfilePhotoTitle")),n.a.createElement("span",{className:"subtitle",dir:"auto"},j(u)))),n.a.createElement(Oe.a,{narrow:!0,onClick:()=>t(r.n.PrivacyForwarding)},n.a.createElement("div",{className:"multiline-menu-item"},n.a.createElement("span",{className:"title"},f("PrivacyForwardsTitle")),n.a.createElement("span",{className:"subtitle",dir:"auto"},j(h)))),n.a.createElement(Oe.a,{narrow:!0,onClick:()=>t(r.n.PrivacyGroupChats)},n.a.createElement("div",{className:"multiline-menu-item"},n.a.createElement("span",{className:"title"},f("WhoCanAddMe")),n.a.createElement("span",{className:"subtitle",dir:"auto"},j(b))))),i&&n.a.createElement("div",{className:"settings-item"},n.a.createElement("h4",{className:"settings-item-header",dir:f.isRtl?"rtl":void 0},f("lng_settings_sensitive_title")),n.a.createElement(Jt.a,{label:f("lng_settings_sensitive_disable_filtering"),subLabel:f("lng_settings_sensitive_about"),checked:Boolean(l),disabled:!i,onCheck:O})))})),La=a(14);var Aa=Object(n.h)(Object(s.h)(e=>({languages:e.settings.byKey.languages,language:e.settings.byKey.language}),(e,t)=>Object(h.l)(t,["loadLanguages","setSettingOption"]))(({isActive:e,onScreenSelect:t,onReset:a,languages:s,language:c,loadLanguages:o,setSettingOption:l})=>{const[i,d]=Object(n.r)(c),[m,u,h]=Object(xe.a)();Object(n.n)(()=>{o()},[o]);const b=Object(n.m)(e=>{d(e),u(),Object(La.d)(e,()=>{h(),l({language:e})})},[u,h,l]),g=Object(n.p)(()=>s?function(e){const t=(window.navigator.language||"en").toLowerCase(),a=t.substr(0,2);return e.map(({langCode:e,nativeName:t,name:a})=>({value:e,label:t,subLabel:a})).sort(e=>!t||e.value!==t&&e.value!==a?0:-1)}(s):void 0,[s]);return Object(L.a)(e,a,t,r.n.Language),n.a.createElement("div",{className:"settings-content settings-item settings-language custom-scroll"},g?n.a.createElement(qe.a,{name:"keyboard-send-settings",options:g,selected:i,loadingOption:m?i:void 0,onChange:b}):n.a.createElement(ge.a,null))}));function Ra(e){switch(e){case r.n.PrivacyPhoneNumber:case r.n.PrivacyPhoneNumberAllowedContacts:case r.n.PrivacyPhoneNumberDeniedContacts:return"phoneNumber";case r.n.PrivacyLastSeen:case r.n.PrivacyLastSeenAllowedContacts:case r.n.PrivacyLastSeenDeniedContacts:return"lastSeen";case r.n.PrivacyProfilePhoto:case r.n.PrivacyProfilePhotoAllowedContacts:case r.n.PrivacyProfilePhotoDeniedContacts:return"profilePhoto";case r.n.PrivacyForwarding:case r.n.PrivacyForwardingAllowedContacts:case r.n.PrivacyForwardingDeniedContacts:return"forwards";case r.n.PrivacyGroupChats:case r.n.PrivacyGroupChatsAllowedContacts:case r.n.PrivacyGroupChatsDeniedContacts:return"chatInvite"}}var Ta=Object(n.h)(Object(s.h)((e,{screen:t})=>{let a;const{chats:{byId:n},settings:{privacy:s}}=e;switch(t){case r.n.PrivacyPhoneNumber:a=s.phoneNumber;break;case r.n.PrivacyLastSeen:a=s.lastSeen;break;case r.n.PrivacyProfilePhoto:a=s.profilePhoto;break;case r.n.PrivacyForwarding:a=s.forwards;break;case r.n.PrivacyGroupChats:a=s.chatInvite}return a?{...a,chatsById:n}:{}},(e,t)=>Object(h.l)(t,["setPrivacyVisibility"]))(({screen:e,isActive:t,onScreenSelect:a,onReset:s,visibility:c,allowUserIds:o,allowChatIds:l,blockUserIds:i,blockChatIds:d,chatsById:m,setPrivacyVisibility:u})=>{const h=Object(M.a)(),b=Object(n.p)(()=>{switch(e){case r.n.PrivacyProfilePhoto:case r.n.PrivacyGroupChats:return[{value:"everybody",label:h("P2PEverybody")},{value:"contacts",label:h("P2PContacts")}];default:return[{value:"everybody",label:h("P2PEverybody")},{value:"contacts",label:h("P2PContacts")},{value:"nobody",label:h("P2PNobody")}]}},[h,e]),g={shouldShowDenied:"nobody"!==c,shouldShowAllowed:"everybody"!==c},p=Ra(e),v=Object(n.p)(()=>{switch(e){case r.n.PrivacyPhoneNumber:return h("PrivacyPhoneTitle");case r.n.PrivacyLastSeen:return h("LastSeenTitle");case r.n.PrivacyProfilePhoto:return h("PrivacyProfilePhotoTitle");case r.n.PrivacyForwarding:return h("PrivacyForwardsTitle");case r.n.PrivacyGroupChats:return h("WhoCanAddMe");default:return}},[h,e]);Object(L.a)(t,s,a,e);const E=Object(n.p)(()=>{switch(e){case r.n.PrivacyLastSeen:return h("CustomHelp");default:return}},[h,e]),O=(()=>{switch(e){case r.n.PrivacyPhoneNumber:return r.n.PrivacyPhoneNumberAllowedContacts;case r.n.PrivacyLastSeen:return r.n.PrivacyLastSeenAllowedContacts;case r.n.PrivacyProfilePhoto:return r.n.PrivacyProfilePhotoAllowedContacts;case r.n.PrivacyForwarding:return r.n.PrivacyForwardingAllowedContacts;default:return r.n.PrivacyGroupChatsAllowedContacts}})(),f=(()=>{switch(e){case r.n.PrivacyPhoneNumber:return r.n.PrivacyPhoneNumberDeniedContacts;case r.n.PrivacyLastSeen:return r.n.PrivacyLastSeenDeniedContacts;case r.n.PrivacyProfilePhoto:return r.n.PrivacyProfilePhotoDeniedContacts;case r.n.PrivacyForwarding:return r.n.PrivacyForwardingDeniedContacts;default:return r.n.PrivacyGroupChatsDeniedContacts}})(),j=Object(n.p)(()=>o&&l&&m?l.reduce((e,t)=>e+(m[t]?m[t].membersCount:0),o.length):0,[l,o,m]),C=Object(n.p)(()=>i&&d&&m?d.reduce((e,t)=>e+(m[t]?m[t].membersCount:0),i.length):0,[d,i,m]),y=Object(n.m)(e=>{u({privacyKey:p,visibility:e})},[p,u]);return n.a.createElement("div",{className:"settings-content custom-scroll"},n.a.createElement("div",{className:"settings-item"},n.a.createElement("h4",{className:"settings-item-header",dir:h.isRtl?"rtl":void 0},v),n.a.createElement(qe.a,{name:"visibility-"+p,options:b,onChange:y,selected:c}),E&&n.a.createElement("p",{className:"settings-item-description-larger",dir:h.isRtl?"rtl":void 0},E)),n.a.createElement("div",{className:"settings-item"},n.a.createElement("h4",{className:"settings-item-header mb-4",dir:h.isRtl?"rtl":void 0},h("PrivacyExceptions")),g.shouldShowAllowed&&n.a.createElement(Oe.a,{narrow:!0,icon:"add-user",onClick:()=>{a(O)}},n.a.createElement("div",{className:"multiline-menu-item full-size"},j>0&&n.a.createElement("span",{className:"date",dir:"auto"},"+",j),n.a.createElement("span",{className:"title"},h("AlwaysShareWith")),n.a.createElement("span",{className:"subtitle"},h("EditAdminAddUsers")))),g.shouldShowDenied&&n.a.createElement(Oe.a,{narrow:!0,icon:"delete-user",onClick:()=>{a(f)}},n.a.createElement("div",{className:"multiline-menu-item full-size"},C>0&&n.a.createElement("span",{className:"date",dir:"auto"},"−",C),n.a.createElement("span",{className:"title"},h("NeverShareWith")),n.a.createElement("span",{className:"subtitle"},h("EditAdminAddUsers"))))))}));function Da(e){return[e.region,e.country].filter(Boolean).join(", ")}function Ba(e){return`${e.deviceModel}${e.deviceModel?", ":""} ${e.platform} ${e.systemVersion}`}var Ua=Object(n.h)(Object(s.h)(e=>({activeSessions:e.activeSessions}),(e,t)=>Object(h.l)(t,["loadAuthorizations","terminateAuthorization","terminateAllAuthorizations"]))(({isActive:e,onScreenSelect:t,onReset:a,activeSessions:s,loadAuthorizations:c,terminateAuthorization:o,terminateAllAuthorizations:l})=>{const[i,d,m]=Object(xe.a)();Object(n.n)(()=>{c()},[c]);const u=Object(n.m)(e=>{o({hash:e})},[o]),h=Object(n.m)(()=>{m(),l()},[m,l]),b=Object(n.p)(()=>s.find(e=>e.isCurrent),[s]),g=Object(n.p)(()=>s.filter(e=>!e.isCurrent),[s]),p=Object(M.a)();function v(e){return n.a.createElement(Oe.a,{key:e.hash,ripple:!0,narrow:!0,contextActions:[{title:"Terminate",icon:"stop",handler:()=>{u(e.hash)}}]},n.a.createElement("div",{className:"multiline-menu-item full-size",dir:"auto"},n.a.createElement("span",{className:"date"},Object(B.g)(p,1e3*e.dateActive)),n.a.createElement("span",{className:"title"},e.appName),n.a.createElement("span",{className:"subtitle black tight"},Ba(e)),n.a.createElement("span",{className:"subtitle"},e.ip," - ",Da(e))))}return Object(L.a)(e,a,t,r.n.PrivacyActiveSessions),n.a.createElement("div",{className:"settings-content custom-scroll"},b&&(O=b,n.a.createElement("div",{className:"settings-item"},n.a.createElement("h4",{className:"settings-item-header mb-4",dir:p.isRtl?"rtl":void 0},p("AuthSessions.CurrentSession")),n.a.createElement(Oe.a,{narrow:!0,inactive:!0},n.a.createElement("div",{className:"multiline-menu-item",dir:"auto"},n.a.createElement("span",{className:"title",dir:"auto"},O.appName),n.a.createElement("span",{className:"subtitle black tight"},Ba(O)),n.a.createElement("span",{className:"subtitle"},O.ip," - ",Da(O)))),n.a.createElement(Oe.a,{className:"destructive mb-0",icon:"stop",ripple:!0,narrow:!0,onClick:d},p("TerminateAllSessions")))),g&&(E=g,n.a.createElement("div",{className:"settings-item"},n.a.createElement("h4",{className:"settings-item-header mb-4",dir:p.isRtl?"rtl":void 0},p("OtherSessions")),E.map(v))),g&&n.a.createElement(Pe.a,{isOpen:i,onClose:m,text:"Are you sure you want to terminate all other sessions?",confirmLabel:"Terminate All Other Sessions",confirmHandler:h,confirmIsDestructive:!0}));var E,O}));var xa=Object(n.h)(Object(s.h)(e=>{const{chats:{byId:t},users:{byId:a},blocked:{ids:n}}=e;return{chatsByIds:t,usersByIds:a,blockedIds:n}},(e,t)=>Object(h.l)(t,["unblockContact"]))(({isActive:e,onScreenSelect:t,onReset:a,chatsByIds:s,usersByIds:c,blockedIds:l,unblockContact:i})=>{const d=Object(n.m)(e=>{i({contactId:e})},[i]),m=Object(M.a)();return Object(L.a)(e,a,t,r.n.PrivacyBlockedUsers),n.a.createElement("div",{className:"settings-fab-wrapper"},n.a.createElement("div",{className:"settings-content infinite-scroll"},n.a.createElement("div",{className:"settings-item"},n.a.createElement("p",{className:"settings-item-description-larger mt-0 mb-2",dir:m.isRtl?"rtl":void 0},m("BlockedUsersInfo"))),n.a.createElement("div",{className:"chat-list custom-scroll"},l&&l.length?n.a.createElement("div",{className:"scroll-container"},l.map((e,t)=>function(e,t,a){const r=Object(u.ob)(e),l=r?c[e]:void 0,i=r?void 0:s[e],h=Object(W.a)("Chat chat-item-clickable blocked-list-item",r?"private":"group");return n.a.createElement(Oe.a,{key:e,className:h,ripple:!0,narrow:!0,contextActions:[{title:"Unblock",icon:"unlock",handler:()=>{d(e)}}],style:`top: ${(a+t)*o.k}px;`},n.a.createElement(x.a,{size:"medium",user:l,chat:i}),n.a.createElement("div",{className:"contact-info",dir:"auto"},n.a.createElement("h3",{dir:"auto"},Object(U.a)((r?Object(u.bb)(l):Object(u.k)(m,i))||"")),l&&l.phoneNumber&&n.a.createElement("div",{className:"contact-phone",dir:"auto"},Object(At.c)(l.phoneNumber)),l&&!l.phoneNumber&&l.username&&n.a.createElement("div",{className:"contact-username",dir:"auto"},"@",l.username)))}(e,t,0))):l&&!l.length?n.a.createElement("div",{className:"no-results",dir:"auto"},"List is empty"):n.a.createElement(ge.a,{key:"loading"}))),n.a.createElement(Dt.a,{isShown:!0,onClick:()=>{},className:"not-implemented",ariaLabel:"Add a blocked user"},n.a.createElement("i",{className:"icon-add"})))})),Ga=a(129);var za=Object(n.h)(Object(s.h)(e=>({animatedEmoji:Object(m.c)(e,"🔐")}))(({isActive:e,onReset:t,animatedEmoji:a,onScreenSelect:s})=>{const c=Object(M.a)();return Object(L.a)(e,t,s,r.n.TwoFaEnabled),n.a.createElement("div",{className:"settings-content two-fa custom-scroll"},n.a.createElement("div",{className:"settings-content-header"},n.a.createElement(Ga.a,{sticker:a,size:"large"}),n.a.createElement("p",{className:"settings-item-description mb-3",dir:"auto"},Object(U.a)(c("EnabledPasswordText"),["br"]))),n.a.createElement("div",{className:"settings-item pt-0 no-border"},n.a.createElement(Oe.a,{icon:"edit",onClick:()=>s(r.n.TwoFaChangePasswordCurrent)},c("ChangePassword")),n.a.createElement(Oe.a,{icon:"password-off",onClick:()=>s(r.n.TwoFaTurnOff)},c("TurnPasswordOff")),n.a.createElement(Oe.a,{icon:"email",onClick:()=>s(r.n.TwoFaRecoveryEmailCurrentPassword)},c("SetRecoveryEmail"))))})),qa=a(154),_a=a(155);var Ha=Object(n.h)(({screen:e,isActive:t,onScreenSelect:a,onReset:s,error:c,isLoading:r,expectedPassword:o,placeholder:l="Current Password",hint:i,submitLabel:d,clearError:m,onSubmit:u})=>{const[h,b]=Object(n.r)(""),[g,p]=Object(n.r)(!1),v=Object(n.m)(e=>{o&&e!==o?b("Passwords Should Be Equal"):u(e)},[u,o]),E=Object(n.m)(()=>{m&&m(),b("")},[m]),O=Object(M.a)();return Object(L.a)(t,s,a,e),n.a.createElement("div",{className:"settings-content two-fa custom-scroll"},n.a.createElement("div",{className:"settings-content-header"},n.a.createElement(qa.a,{isBig:!0,isPasswordVisible:g})),n.a.createElement("div",{className:"settings-item pt-0 no-border"},n.a.createElement(_a.a,{error:h||c,hint:i,placeholder:l,submitLabel:d||O("Next"),clearError:E,isLoading:r,isPasswordVisible:g,onChangePasswordVisibility:p,onSubmit:v})))});var $a=Object(n.h)(Object(s.h)(e=>({animatedEmoji:Object(m.c)(e,"🔐")}))(({isActive:e,onScreenSelect:t,onReset:a,animatedEmoji:s,onStart:c})=>{const o=Object(M.a)();return Object(L.a)(e,a,t,r.n.TwoFaDisabled),n.a.createElement("div",{className:"settings-content two-fa custom-scroll"},n.a.createElement("div",{className:"settings-content-header"},n.a.createElement(Ga.a,{sticker:s,size:"large"}),n.a.createElement("p",{className:"settings-item-description mb-3",dir:"auto"},o("SetAdditionalPasswordInfo"))),n.a.createElement("div",{className:"settings-item pt-0 no-border"},n.a.createElement(D.a,{onClick:c},o("EditAdminTransferSetPassword"))))}));const Va=l.l?550:400;var Wa=Object(n.h)(Object(s.h)((e,{icon:t})=>({animatedEmoji:Object(m.c)(e,"email"===t?"💌":"💡")}))(({animatedEmoji:e,type:t="text",isLoading:a,error:s,placeholder:c,shouldConfirm:r,clearError:o,onSubmit:i,isActive:d,onScreenSelect:m,onReset:u,screen:h})=>{const b=Object(n.q)(null),[g,p]=Object(n.r)(""),[v,E,O]=Object(xe.a)(!1);Object(n.n)(()=>{l.n||setTimeout(()=>{b.current.focus()},Va)},[]);const f=Object(M.a)();return Object(L.a)(d,u,m,h),n.a.createElement("div",{className:"settings-content two-fa custom-scroll"},n.a.createElement("div",{className:"settings-content-header"},n.a.createElement(Ga.a,{sticker:e,size:"large"})),n.a.createElement("div",{className:"settings-item pt-0 no-border"},n.a.createElement("form",{action:"",onSubmit:e=>{e.preventDefault(),b.current&&i(g)}},n.a.createElement(ve.a,{ref:b,value:g,inputMode:t,label:c,error:s,onChange:e=>{s&&o&&o(),p(e.target.value)}}),g?n.a.createElement(D.a,{type:"submit",isLoading:a,ripple:!0},f("Continue")):n.a.createElement(D.a,{isText:!0,isLoading:a,ripple:!0,onClick:r?E:()=>{i()}},f("YourEmailSkip"))),r&&n.a.createElement(pe.a,{className:"narrow",isOpen:v,title:f("YourEmailSkipWarning"),onClose:O},Object(U.a)(f("YourEmailSkipWarningText"),["br","simple_markdown"]),n.a.createElement("div",{className:"dialog-buttons"},n.a.createElement(D.a,{color:"danger",ripple:!0,isText:!0,className:"confirm-dialog-button",onClick:()=>{O(),i()}},f("YourEmailSkip")),n.a.createElement(D.a,{color:"primary",ripple:!0,isText:!0,className:"confirm-dialog-button",onClick:O},f("Cancel"))))))}));var Ka=Object(n.h)(Object(s.h)(e=>({animatedEmoji:Object(m.c)(e,"🥳")}))(({isActive:e,onReset:t,animatedEmoji:a,onScreenSelect:s})=>{const c=Object(M.a)();return Object(L.a)(e,t,s,r.n.TwoFaCongratulations),n.a.createElement("div",{className:"settings-content two-fa custom-scroll"},n.a.createElement("div",{className:"settings-content-header"},n.a.createElement(Ga.a,{sticker:a,size:"large"}),n.a.createElement("p",{className:"settings-item-description mb-3",dir:"auto"},c("TwoStepVerificationPasswordSetInfo"))),n.a.createElement("div",{className:"settings-item pt-0 no-border"},n.a.createElement(D.a,{onClick:()=>{s(r.n.Privacy)}},c("TwoStepVerificationPasswordReturnSettings"))))}));const Ya=l.l?550:400;var Qa=Object(n.h)(Object(s.h)(e=>({animatedEmoji:Object(m.c)(e,"💌"),codeLength:e.twoFaSettings.waitingEmailCodeLength}))(({animatedEmoji:e,codeLength:t,isLoading:a,error:s,clearError:c,onSubmit:r,isActive:o,onScreenSelect:i,onReset:d,screen:m})=>{const u=Object(n.q)(null),[h,b]=Object(n.r)("");Object(n.n)(()=>{l.n||setTimeout(()=>{u.current.focus()},Ya)},[]);const g=Object(M.a)();Object(L.a)(o,d,i,m);return n.a.createElement("div",{className:"settings-content two-fa custom-scroll"},n.a.createElement("div",{className:"settings-content-header"},n.a.createElement(Ga.a,{sticker:e,size:"large"})),n.a.createElement("div",{className:"settings-item pt-0 no-border"},n.a.createElement(ve.a,{value:h,ref:u,inputMode:"decimal",label:g("YourEmailCode"),error:s,onChange:e=>{s&&c&&c();const a=e.target.value.slice(0,t);a.length===t&&r(a),b(a),e.target.value=a}}),a&&n.a.createElement(ge.a,null)))}));var Ja=Object(n.h)(Object(s.h)(e=>({...e.twoFaSettings}),(e,t)=>Object(h.l)(t,["updatePassword","updateRecoveryEmail","clearPassword","provideTwoFaEmailCode","checkPassword","clearTwoFaError"]))(({currentScreen:e,shownScreen:t,state:a,hint:s,isLoading:c,error:o,waitingEmailCodeLength:l,dispatch:i,isActive:d,onScreenSelect:m,onReset:u,updatePassword:h,checkPassword:b,clearTwoFaError:g,updateRecoveryEmail:p,provideTwoFaEmailCode:v,clearPassword:E})=>{Object(n.n)(()=>{l&&(e===r.n.TwoFaNewPasswordEmail?m(r.n.TwoFaNewPasswordEmailCode):e===r.n.TwoFaRecoveryEmail&&m(r.n.TwoFaRecoveryEmailCode))},[e,m,l]);const O=Object(n.m)(()=>{i({type:"reset"}),m(r.n.TwoFaNewPassword)},[i,m]),f=Object(n.m)(e=>{i({type:"setPassword",payload:e}),m(r.n.TwoFaNewPasswordConfirm)},[i,m]),j=Object(n.m)(()=>{m(r.n.TwoFaNewPasswordHint)},[m]),C=Object(n.m)(e=>{i({type:"setHint",payload:e}),m(r.n.TwoFaNewPasswordEmail)},[i,m]),y=Object(n.m)(e=>{i({type:"setEmail",payload:e}),h({...a,email:e,onSuccess:()=>{m(r.n.TwoFaCongratulations)}})},[i,m,a,h]),k=Object(n.m)(e=>{i({type:"setCurrentPassword",payload:e}),b({currentPassword:e,onSuccess:()=>{m(r.n.TwoFaChangePasswordNew)}})},[b,i,m]),N=Object(n.m)(e=>{i({type:"setPassword",payload:e}),m(r.n.TwoFaChangePasswordConfirm)},[i,m]),S=Object(n.m)(()=>{m(r.n.TwoFaChangePasswordHint)},[m]),w=Object(n.m)(e=>{i({type:"setHint",payload:e}),h({...a,hint:e,onSuccess:()=>{m(r.n.TwoFaCongratulations)}})},[i,m,a,h]),I=Object(n.m)(e=>{E({currentPassword:e,onSuccess:()=>{m(r.n.Privacy)}})},[E,m]),P=Object(n.m)(e=>{i({type:"setCurrentPassword",payload:e}),b({currentPassword:e,onSuccess:()=>{m(r.n.TwoFaRecoveryEmail)}})},[b,i,m]),F=Object(n.m)(e=>{i({type:"setEmail",payload:e}),p({...a,email:e,onSuccess:()=>{m(r.n.TwoFaCongratulations)}})},[i,m,a,p]),L=Object(n.m)(e=>{v({code:e})},[v]),A=Object(M.a)();switch(e){case r.n.TwoFaDisabled:return n.a.createElement($a,{onStart:O,onScreenSelect:m,isActive:d||[r.n.TwoFaNewPassword,r.n.TwoFaNewPasswordConfirm,r.n.TwoFaNewPasswordHint,r.n.TwoFaNewPasswordEmail,r.n.TwoFaNewPasswordEmailCode,r.n.TwoFaCongratulations].includes(t),onReset:u});case r.n.TwoFaNewPassword:return n.a.createElement(Ha,{screen:e,placeholder:A("PleaseEnterPassword"),submitLabel:A("Continue"),onSubmit:f,onScreenSelect:m,isActive:d||[r.n.TwoFaNewPasswordConfirm,r.n.TwoFaNewPasswordHint,r.n.TwoFaNewPasswordEmail,r.n.TwoFaNewPasswordEmailCode,r.n.TwoFaCongratulations].includes(t),onReset:u});case r.n.TwoFaNewPasswordConfirm:return n.a.createElement(Ha,{screen:e,expectedPassword:a.password,placeholder:A("PleaseReEnterPassword"),submitLabel:A("Continue"),onSubmit:j,onScreenSelect:m,isActive:d||[r.n.TwoFaNewPasswordHint,r.n.TwoFaNewPasswordEmail,r.n.TwoFaNewPasswordEmailCode,r.n.TwoFaCongratulations].includes(t),onReset:u});case r.n.TwoFaNewPasswordHint:return n.a.createElement(Wa,{icon:"hint",placeholder:A("PasswordHintPlaceholder"),onSubmit:C,screen:e,onScreenSelect:m,isActive:d||[r.n.TwoFaNewPasswordEmail,r.n.TwoFaNewPasswordEmailCode,r.n.TwoFaCongratulations].includes(t),onReset:u});case r.n.TwoFaNewPasswordEmail:return n.a.createElement(Wa,{icon:"email",type:"email",isLoading:c,error:o,clearError:g,placeholder:A("RecoveryEmailTitle"),shouldConfirm:!0,onSubmit:y,screen:e,onScreenSelect:m,isActive:d||[r.n.TwoFaNewPasswordEmailCode,r.n.TwoFaCongratulations].includes(t),onReset:u});case r.n.TwoFaNewPasswordEmailCode:return n.a.createElement(Qa,{isLoading:c,error:o,clearError:g,onSubmit:L,screen:e,onScreenSelect:m,isActive:d||t===r.n.TwoFaCongratulations,onReset:u});case r.n.TwoFaCongratulations:return n.a.createElement(Ka,{onScreenSelect:m,isActive:d,onReset:u});case r.n.TwoFaEnabled:return n.a.createElement(za,{onScreenSelect:m,isActive:d||[r.n.TwoFaChangePasswordCurrent,r.n.TwoFaChangePasswordNew,r.n.TwoFaChangePasswordConfirm,r.n.TwoFaChangePasswordHint,r.n.TwoFaTurnOff,r.n.TwoFaRecoveryEmailCurrentPassword,r.n.TwoFaRecoveryEmail,r.n.TwoFaRecoveryEmailCode,r.n.TwoFaCongratulations].includes(t),onReset:u});case r.n.TwoFaChangePasswordCurrent:return n.a.createElement(Ha,{screen:e,isLoading:c,error:o,clearError:g,hint:s,onSubmit:k,onScreenSelect:m,isActive:d||[r.n.TwoFaChangePasswordNew,r.n.TwoFaChangePasswordConfirm,r.n.TwoFaChangePasswordHint,r.n.TwoFaCongratulations].includes(t),onReset:u});case r.n.TwoFaChangePasswordNew:return n.a.createElement(Ha,{screen:e,placeholder:A("PleaseEnterNewFirstPassword"),onSubmit:N,onScreenSelect:m,isActive:d||[r.n.TwoFaChangePasswordConfirm,r.n.TwoFaChangePasswordHint,r.n.TwoFaCongratulations].includes(t),onReset:u});case r.n.TwoFaChangePasswordConfirm:return n.a.createElement(Ha,{screen:e,expectedPassword:a.password,placeholder:A("PleaseReEnterPassword"),onSubmit:S,onScreenSelect:m,isActive:d||[r.n.TwoFaChangePasswordHint,r.n.TwoFaCongratulations].includes(t),onReset:u});case r.n.TwoFaChangePasswordHint:return n.a.createElement(Wa,{isLoading:c,error:o,clearError:g,icon:"hint",placeholder:A("PasswordHintPlaceholder"),onSubmit:w,onScreenSelect:m,isActive:d||t===r.n.TwoFaCongratulations,onReset:u,screen:e});case r.n.TwoFaTurnOff:return n.a.createElement(Ha,{isLoading:c,error:o,clearError:g,hint:s,onSubmit:I,onScreenSelect:m,isActive:d,onReset:u,screen:e});case r.n.TwoFaRecoveryEmailCurrentPassword:return n.a.createElement(Ha,{screen:e,isLoading:c,error:o,clearError:g,hint:s,onSubmit:P,onScreenSelect:m,isActive:d||[r.n.TwoFaRecoveryEmail,r.n.TwoFaRecoveryEmailCode,r.n.TwoFaCongratulations].includes(t),onReset:u});case r.n.TwoFaRecoveryEmail:return n.a.createElement(Wa,{screen:e,icon:"email",type:"email",placeholder:A("RecoveryEmailTitle"),onSubmit:F,onScreenSelect:m,isActive:d||[r.n.TwoFaRecoveryEmailCode,r.n.TwoFaCongratulations].includes(t),onReset:u});case r.n.TwoFaRecoveryEmailCode:return n.a.createElement(Qa,{screen:e,isLoading:c,error:o,clearError:g,onSubmit:L,onScreenSelect:m,isActive:d||t===r.n.TwoFaCongratulations,onReset:u});default:return}})),Za=a(174);function Xa(e,t){const{privacy:a}=e.settings;switch(t){case r.n.PrivacyPhoneNumberAllowedContacts:case r.n.PrivacyPhoneNumberDeniedContacts:return a.phoneNumber;case r.n.PrivacyLastSeenAllowedContacts:case r.n.PrivacyLastSeenDeniedContacts:return a.lastSeen;case r.n.PrivacyProfilePhotoAllowedContacts:case r.n.PrivacyProfilePhotoDeniedContacts:return a.profilePhoto;case r.n.PrivacyForwardingAllowedContacts:case r.n.PrivacyForwardingDeniedContacts:return a.forwards;case r.n.PrivacyGroupChatsDeniedContacts:case r.n.PrivacyGroupChatsAllowedContacts:return a.chatInvite}}var en=Object(n.h)(Object(s.h)((e,{screen:t})=>{const{chats:{byId:a,listIds:n,orderedPinnedIds:s},currentUserId:c}=e;return{currentUserId:c,chatsById:a,listIds:n.active,orderedPinnedIds:s.active,archivedPinnedIds:s.archived,archivedListIds:n.archived,settings:Xa(e,t)}},(e,t)=>Object(h.l)(t,["setPrivacySettings"]))(({currentUserId:e,isAllowList:t,screen:a,settings:s,chatsById:c,listIds:o,orderedPinnedIds:l,archivedListIds:i,archivedPinnedIds:d,setPrivacySettings:m,isActive:h,onScreenSelect:b,onReset:g})=>{const p=Object(M.a)(),v=Object(n.p)(()=>s?t?[...s.allowUserIds,...s.allowChatIds]:[...s.blockUserIds,...s.blockChatIds]:[],[t,s]),[E,O]=Object(n.r)(""),[f,j]=Object(n.r)(!1),[C,y]=Object(n.r)(v),k=Object(n.p)(()=>{const e=o?Object(u.Fb)(c,o,l,"all"):void 0,t=i?Object(u.Fb)(c,i,d,"archived"):void 0;if(e||t)return[...e?[...e.pinnedChats,...e.otherChats]:[],...t?t.otherChats:[]]},[c,o,l,i,d]),N=Object(n.p)(()=>{if(k)return k.filter(t=>(Object(u.ob)(t.id)&&t.id!==e||Object(u.nb)(t))&&(!E||Object(ue.a)(Object(u.k)(p,t),E)||v.includes(t.id))).map(({id:e})=>e)},[k,e,p,E,v]),S=Object(n.m)(e=>{y(e),j(!0)},[]),w=Object(n.m)(()=>{m({privacyKey:Ra(a),isAllowList:Boolean(t),contactsIds:C}),b(r.n.Privacy)},[t,C,b,a,m]);return Object(L.a)(h,g,b,a),n.a.createElement("div",{className:"NewChat-inner step-1"},n.a.createElement(Za.a,{itemIds:N||[],selectedIds:C,filterValue:E,filterPlaceholder:p(t?"AlwaysShareWithPlaceholder":"NeverShareWithPlaceholder"),searchInputId:"new-group-picker-search",onSelectedIdsChange:S,onFilterChange:O}),n.a.createElement(Dt.a,{isShown:f,onClick:w,ariaLabel:p(t?"AlwaysShareWithTitle":"NeverShareWithTitle")},n.a.createElement("i",{className:"icon-arrow-right"})))}));a(293);const tn=Object.keys(r.n).length/2,an=[r.n.TwoFaDisabled,r.n.TwoFaNewPassword,r.n.TwoFaNewPasswordConfirm,r.n.TwoFaNewPasswordHint,r.n.TwoFaNewPasswordEmail,r.n.TwoFaNewPasswordEmailCode,r.n.TwoFaCongratulations,r.n.TwoFaEnabled,r.n.TwoFaChangePasswordCurrent,r.n.TwoFaChangePasswordNew,r.n.TwoFaChangePasswordConfirm,r.n.TwoFaChangePasswordHint,r.n.TwoFaTurnOff,r.n.TwoFaRecoveryEmailCurrentPassword,r.n.TwoFaRecoveryEmail,r.n.TwoFaRecoveryEmailCode],nn=[r.n.Folders,r.n.FoldersCreateFolder,r.n.FoldersEditFolder,r.n.FoldersEditFolderFromChatList,r.n.FoldersIncludedChats,r.n.FoldersIncludedChatsFromChatList,r.n.FoldersExcludedChats,r.n.FoldersExcludedChatsFromChatList],sn=[r.n.PrivacyBlockedUsers,r.n.PrivacyActiveSessions],cn=[r.n.PrivacyPhoneNumberAllowedContacts,r.n.PrivacyPhoneNumberDeniedContacts],rn=[r.n.PrivacyLastSeenAllowedContacts,r.n.PrivacyLastSeenDeniedContacts],on=[r.n.PrivacyProfilePhotoAllowedContacts,r.n.PrivacyProfilePhotoDeniedContacts],ln=[r.n.PrivacyForwardingAllowedContacts,r.n.PrivacyForwardingDeniedContacts],dn=[r.n.PrivacyGroupChatsAllowedContacts,r.n.PrivacyGroupChatsDeniedContacts];var mn=Object(n.h)(({isActive:e,currentScreen:t,foldersState:a,foldersDispatch:s,onScreenSelect:c,onReset:o,shouldSkipTransition:i})=>{const[d,m]=Object(Pt.a)(Mt,Ft),u=Object(n.m)(()=>{t!==r.n.FoldersCreateFolder&&t!==r.n.FoldersEditFolder&&t!==r.n.FoldersEditFolderFromChatList||setTimeout(()=>{s({type:"reset"})},200),t!==r.n.FoldersIncludedChats&&t!==r.n.FoldersExcludedChats?o():"create"===a.mode?c(r.n.FoldersCreateFolder):c(r.n.FoldersEditFolder)},[a.mode,s,t,o,c]),h=Object(n.m)(()=>{s({type:"saveFilters"}),u()},[s,u]);function b(o,l,i){return n.a.createElement(n.a.Fragment,null,n.a.createElement(Lt,{currentScreen:t,onReset:u,onSaveFilter:h,editedFolderId:a.folderId}),function(o,l){const i={[r.n.PrivacyPhoneNumber]:cn.includes(l),[r.n.PrivacyLastSeen]:rn.includes(l),[r.n.PrivacyProfilePhoto]:on.includes(l),[r.n.PrivacyForwarding]:ln.includes(l),[r.n.PrivacyGroupChats]:dn.includes(l)},h=an.includes(l),b=nn.includes(l),g=sn.includes(l)||h||Object.keys(i).includes(l.toString())||Object.values(i).find(e=>!0===e);switch(t){case r.n.Main:return n.a.createElement(Rt,{onScreenSelect:c,isActive:e,onReset:u});case r.n.EditProfile:return n.a.createElement(qt,{onScreenSelect:c,isActive:e&&o,onReset:u});case r.n.General:return n.a.createElement(ma,{onScreenSelect:c,isActive:o||l===r.n.GeneralChatBackgroundColor||l===r.n.GeneralChatBackground||g||b,onReset:u});case r.n.Notifications:return n.a.createElement(Fa,{onScreenSelect:c,isActive:o,onReset:u});case r.n.Privacy:return n.a.createElement(Ma,{onScreenSelect:c,isActive:o||g||h,onReset:u});case r.n.Language:return n.a.createElement(Aa,{onScreenSelect:c,isActive:o,onReset:u});case r.n.GeneralChatBackground:return n.a.createElement(ka,{onScreenSelect:c,isActive:o||l===r.n.GeneralChatBackgroundColor,onReset:u});case r.n.GeneralChatBackgroundColor:return n.a.createElement(Pa,{onScreenSelect:c,isActive:o,onReset:u});case r.n.PrivacyActiveSessions:return n.a.createElement(Ua,{onScreenSelect:c,isActive:o,onReset:u});case r.n.PrivacyBlockedUsers:return n.a.createElement(xa,{onScreenSelect:c,isActive:o,onReset:u});case r.n.PrivacyPhoneNumber:case r.n.PrivacyLastSeen:case r.n.PrivacyProfilePhoto:case r.n.PrivacyForwarding:case r.n.PrivacyGroupChats:return n.a.createElement(Ta,{screen:t,onScreenSelect:c,isActive:o||i[t],onReset:u});case r.n.PrivacyPhoneNumberAllowedContacts:case r.n.PrivacyLastSeenAllowedContacts:case r.n.PrivacyProfilePhotoAllowedContacts:case r.n.PrivacyForwardingAllowedContacts:case r.n.PrivacyGroupChatsAllowedContacts:return n.a.createElement(en,{isAllowList:!0,screen:t,onScreenSelect:c,isActive:o||i[t],onReset:u});case r.n.PrivacyPhoneNumberDeniedContacts:case r.n.PrivacyLastSeenDeniedContacts:case r.n.PrivacyProfilePhotoDeniedContacts:case r.n.PrivacyForwardingDeniedContacts:case r.n.PrivacyGroupChatsDeniedContacts:return n.a.createElement(en,{screen:t,onScreenSelect:c,isActive:o,onReset:u});case r.n.Folders:case r.n.FoldersCreateFolder:case r.n.FoldersEditFolder:case r.n.FoldersEditFolderFromChatList:case r.n.FoldersIncludedChats:case r.n.FoldersIncludedChatsFromChatList:case r.n.FoldersExcludedChats:case r.n.FoldersExcludedChatsFromChatList:return n.a.createElement(ea,{currentScreen:t,shownScreen:l,state:a,dispatch:s,isActive:o,onScreenSelect:c,onReset:u});case r.n.TwoFaDisabled:case r.n.TwoFaNewPassword:case r.n.TwoFaNewPasswordConfirm:case r.n.TwoFaNewPasswordHint:case r.n.TwoFaNewPasswordEmail:case r.n.TwoFaNewPasswordEmailCode:case r.n.TwoFaCongratulations:case r.n.TwoFaEnabled:case r.n.TwoFaChangePasswordCurrent:case r.n.TwoFaChangePasswordNew:case r.n.TwoFaChangePasswordConfirm:case r.n.TwoFaChangePasswordHint:case r.n.TwoFaTurnOff:case r.n.TwoFaRecoveryEmailCurrentPassword:case r.n.TwoFaRecoveryEmail:case r.n.TwoFaRecoveryEmailCode:return n.a.createElement(Ja,{currentScreen:t,state:d,dispatch:m,shownScreen:l,isActive:o,onScreenSelect:c,onReset:u});default:return}}(o,i))}return n.a.createElement(T.a,{id:"Settings",name:i?"none":l.p,activeKey:t,renderCount:tn},b)});const un=Object(V.h)(e=>e(),6e4,!0);var hn=Object(n.h)(Object(s.h)(e=>{const{userIds:t}=e.contactList||{},{byId:a}=e.users;return{usersById:a,contactIds:t,serverTimeOffset:e.serverTimeOffset}},(e,t)=>Object(h.l)(t,["loadContactList","openChat"]))(({isActive:e,onReset:t,filter:a,usersById:s,contactIds:c,loadContactList:r,openChat:o,serverTimeOffset:i})=>{Object(n.n)(()=>{un(()=>{r()})}),Object(L.a)(e,t);const d=Object(n.m)(e=>{o({id:e,shouldReplaceHistory:!0})},[o]),m=Object(n.p)(()=>{if(!c)return;const e=a?c.filter(e=>{const t=s[e];if(!t)return!1;const n=Object(u.bb)(t);return n&&Object(ue.a)(n,a)}):c;return Object(u.Kb)(e,s,void 0,i)},[c,a,s,i]),[h,b]=Object(he.a)(void 0,m,Boolean(a));return n.a.createElement(Ee.a,{items:h,onLoadMore:b,className:"chat-list custom-scroll"},h&&h.length?h.map(e=>n.a.createElement(Oe.a,{key:e,className:"chat-item-clickable",onClick:()=>d(e),ripple:!l.l},n.a.createElement(fe.a,{userId:e,forceShowSelf:!0,avatarSize:"large"}))):h&&!h.length?n.a.createElement("p",{className:"no-results",key:"no-results",dir:"auto"},a.length?"No contacts matched your search.":"Contact list is empty."):n.a.createElement(ge.a,{key:"loading"}))}));const bn=Object(V.h)(e=>e(),6e4,!0);var gn=Object(n.h)(Object(s.h)(e=>{const{userIds:t}=e.contactList||{},{byId:a}=e.users,{byId:n}=e.chats,{currentUserId:s}=e,{query:c,fetchingStatus:r,globalResults:o,localResults:l}=e.globalSearch,{userIds:i}=o||{},{userIds:d}=l||{};return{currentUserId:s,usersById:a,chatsById:n,localContactIds:t,searchQuery:c,isSearching:r&&r.chats,globalUserIds:i,localUserIds:d}},(e,t)=>Object(h.l)(t,["loadContactList","setGlobalSearchQuery"]))(({isChannel:e,isActive:t,selectedMemberIds:a,onSelectedMemberIdsChange:s,onNextStep:c,onReset:r,currentUserId:o,usersById:l,chatsById:i,localContactIds:d,searchQuery:m,isSearching:b,localUserIds:g,globalUserIds:p,loadContactList:v,setGlobalSearchQuery:E})=>{Object(n.n)(()=>{bn(()=>{v()})});const O=Object(M.a)();Object(L.a)(t,r);const f=Object(n.m)(e=>{E({query:e})},[E]),j=Object(n.p)(()=>{const e=d?Object(u.Jb)(d.filter(e=>e!==o),i):[];if(!m)return e;const t=e.filter(e=>{const t=l[e];if(!t)return!1;const a=Object(u.bb)(t);return a&&Object(ue.a)(a,m)});return Object(u.Jb)(Object(h.o)([...t,...g||[],...p||[]]).filter(e=>{const t=l[e];return!t||!Object(u.Bb)(t)||t.canBeInvitedToGroup}),i,!1,a)},[d,i,m,g,p,a,o,l]),C=Object(n.m)(()=>{(a.length||e)&&(E({query:""}),c())},[a.length,e,E,c]);return n.a.createElement("div",{className:"NewChat step-1"},n.a.createElement("div",{className:"left-header"},n.a.createElement(D.a,{round:!0,size:"smaller",color:"translucent",onClick:r,ariaLabel:"Return to Chat List"},n.a.createElement("i",{className:"icon-arrow-left"})),n.a.createElement("h3",null,O("GroupAddMembers"))),n.a.createElement("div",{className:"NewChat-inner step-1"},n.a.createElement(Za.a,{itemIds:j,selectedIds:a,filterValue:m,filterPlaceholder:O("SendMessageTo"),searchInputId:"new-group-picker-search",isLoading:b,onSelectedIdsChange:s,onFilterChange:f}),n.a.createElement(Dt.a,{isShown:Boolean(a.length||e),onClick:C,ariaLabel:e?"Continue To Channel Info":"Continue To Group Info"},n.a.createElement("i",{className:"icon-arrow-right"}))))}));var pn=Object(n.h)(Object(s.h)(e=>{const{progress:t,error:a}=e.chatCreation||{};return{creationProgress:t,creationError:a}},(e,t)=>Object(h.l)(t,["createGroupChat","createChannel"]))(({isChannel:e,isActive:t,memberIds:a,onReset:s,creationProgress:c,creationError:o,createGroupChat:l,createChannel:i})=>{const d=Object(M.a)();Object(L.a)(t,s);const[m,u]=Object(n.r)(""),[h,b]=Object(n.r)(""),[g,p]=Object(n.r)(),[v,E]=Object(n.r)(),O=c===r.a.InProgress,f=Object(n.m)(e=>{const{value:t}=e.currentTarget,a=t.replace(/^\s+/,"");u(a),a!==t&&(e.currentTarget.value=a)},[]),j=Object(n.m)(e=>{b(e.currentTarget.value)},[]),C=Object(n.m)(()=>{m.length?a.length>199?E("Sorry, creating supergroups is not yet supported"):l({title:m,photo:g,memberIds:a}):E("Chat title can't be empty")},[m,a,l,g,"Chat title can't be empty","Sorry, creating supergroups is not yet supported"]),y=Object(n.m)(()=>{m.length?i({title:m,about:h,photo:g,memberIds:a}):E("Channel title can't be empty")},[m,i,h,g,a,"Channel title can't be empty"]);Object(n.n)(()=>{c===r.a.Complete&&s(!0)},[c,s]);const k=o||("Chat title can't be empty"!==v&&"Channel title can't be empty"!==v?v:void 0);return n.a.createElement("div",{className:"NewChat"},n.a.createElement("div",{className:"left-header"},n.a.createElement(D.a,{round:!0,size:"smaller",color:"translucent",onClick:()=>s(),ariaLabel:"Return to member selection"},n.a.createElement("i",{className:"icon-arrow-left"})),n.a.createElement("h3",null,d(e?"NewChannel":"NewGroup"))),n.a.createElement("div",{className:"NewChat-inner step-2"},n.a.createElement(Tt.a,{onChange:p,title:d("AddPhoto")}),n.a.createElement(ve.a,{value:m,onChange:f,label:d(e?"EnterChannelName":"GroupName"),error:"Chat title can't be empty"===v||"Channel title can't be empty"===v?v:void 0}),e&&n.a.createElement(n.a.Fragment,null,n.a.createElement(ve.a,{value:h,onChange:j,label:d("DescriptionOptionalPlaceholder")}),n.a.createElement("p",{className:"note"},d("DescriptionInfo"))),k&&n.a.createElement("p",{className:"error"},k),a.length>0&&n.a.createElement(n.a.Fragment,null,n.a.createElement("h3",{className:"chat-members-heading"},d("GroupInfo.ParticipantCount",a.length,"i")),n.a.createElement("div",{className:"chat-members-list custom-scroll"},a.map(e=>n.a.createElement(Oe.a,{inactive:!0,className:"chat-item-clickable"},n.a.createElement(fe.a,{userId:e})))))),n.a.createElement(Dt.a,{isShown:0!==m.length,onClick:e?y:C,disabled:O,ariaLabel:e?d("ChannelIntro.CreateChannel"):"Create Group"},O?n.a.createElement(A.a,{color:"white"}):n.a.createElement("i",{className:"icon-arrow-right"})))}));a(294);const vn=Object.keys(r.d).length/2;var En=Object(n.h)(({isActive:e,isChannel:t=!1,content:a,onContentChange:s,onReset:c})=>{const[o,i]=Object(n.r)([]),d=Object(n.m)(()=>{s(t?r.d.NewChannelStep2:r.d.NewGroupStep2)},[t,s]);return n.a.createElement(T.a,{id:"NewChat",name:l.p,renderCount:vn,activeKey:a},s=>{switch(a){case r.d.NewChannelStep1:case r.d.NewGroupStep1:return n.a.createElement(gn,{isChannel:t,isActive:e,selectedMemberIds:o,onSelectedMemberIdsChange:i,onNextStep:d,onReset:c});case r.d.NewChannelStep2:case r.d.NewGroupStep2:return n.a.createElement(pn,{isChannel:t,isActive:s&&e,memberIds:o,onReset:c});default:return}})}),On=a(199);a(295);var fn=Object(n.h)(({isActive:e,onReset:t,onContentChange:a})=>{const s=Object(M.a)();return Object(L.a)(e,t,a,r.d.Archived),n.a.createElement("div",{className:"ArchivedChats"},n.a.createElement("div",{className:"left-header"},n.a.createElement(D.a,{round:!0,size:"smaller",color:"translucent",onClick:t,ariaLabel:"Return to chat list"},n.a.createElement("i",{className:"icon-arrow-left"})),n.a.createElement("h3",null,s("ArchivedChats"))),n.a.createElement(On.a,{folderType:"archived",isActive:e}))});const jn={Down:!0,ArrowDown:!0,Up:!0,ArrowUp:!0,Left:!0,ArrowLeft:!0,Right:!0,ArrowRight:!0," ":!0,PageUp:!0,PageDown:!0,End:!0,Home:!0,Tab:!0};const Cn=e=>{e.preventDefault()};function yn(e){jn[e.key]&&!function(e){if(!(e&&e instanceof HTMLElement))return!1;const t=e,a=t.tagName.toLowerCase();if("textarea"===a)return!0;if("input"!==a)return!1;const n=t.getAttribute("type");return!!n&&["text","password","number","email","tel","url","search","date","datetime","datetime-local","time","month","week"].indexOf(n.toLowerCase())>-1}(e.target)&&Cn(e)}function kn(){document.addEventListener("wheel",Cn,{passive:!1}),window.ontouchmove=Cn,document.onkeydown=yn}function Nn(){document.removeEventListener("wheel",Cn),window.ontouchmove=null,document.onkeydown=null}var Sn=a(33),wn=a(172);function In(e){return e?"lng_context_copy_selected":"lng_context_copy_text"}var Pn=a(183),Fn=a(56);a(296);var Mn=({isOpen:e,message:t,anchor:a,canSendNow:s,canReschedule:r,canReply:o,canEdit:l,canPin:i,canUnpin:d,canDelete:m,canReport:h,canForward:b,canFaveSticker:g,canUnfaveSticker:p,canCopy:v,canCopyLink:E,canSelect:O,onReply:f,onEdit:j,onPin:C,onUnpin:y,onForward:k,onDelete:N,onReport:S,onFaveSticker:w,onUnfaveSticker:I,onSelect:P,onSend:F,onReschedule:L,onClose:A,onCloseAnimationEnd:R,onCopyLink:T})=>{const D=function(e,t,a){const n=[],s=Object(u.P)(e),r=Object(u.H)(e)||(Object(u.T)(e)?void 0:Object(u.S)(e)),o=Object(u.E)(e,"inline"),l=r&&(o||Object(u.eb)(e))&&wn.a,i=window.getSelection();if(l&&n.push({label:"lng_context_copy_image",handler:()=>{Promise.resolve(o?Sn.b(o,c.ApiMediaFormat.BlobUrl):r.blobUrl).then(wn.b),t&&t()}}),s){const e=Boolean(i&&i.anchorNode&&i.anchorNode.parentNode&&i.anchorNode.parentNode.closest(".Message .content-inner")&&""!==i.toString().replace(/(?:\r\n|\r|\n)/g,""));n.push({label:In(e),handler:()=>{const a=e&&i?i.toString():s;Object(wn.c)(a),t&&t()}})}return a&&n.push({label:"lng_context_copy_message_link",handler:()=>{a(),t&&t()}}),n}(t,A,E?T:void 0),B=Object(n.m)(()=>document.querySelector(`.active > .MessageList div[data-message-id="${t.id}"]`),[t.id]),U=Object(n.m)(()=>document.querySelector(".active > .MessageList"),[]),x=Object(n.m)(()=>document.querySelector(".MessageContextMenu .bubble"),[]),{positionX:G,positionY:z,style:q}=Object(Pn.a)(a,B,U,x,10,document.querySelector(".MiddleHeader").offsetHeight),H=Object(M.a)();return n.a.createElement(Fn.a,{isOpen:e,positionX:G,positionY:z,style:q,className:"MessageContextMenu fluid",onClose:A,onCloseAnimationEnd:R},s&&n.a.createElement(_.a,{icon:"send-outline",onClick:F},H("MessageScheduleSend")),r&&n.a.createElement(_.a,{icon:"schedule",onClick:L},H("MessageScheduleEditTime")),o&&n.a.createElement(_.a,{icon:"reply",onClick:f},H("Reply")),l&&n.a.createElement(_.a,{icon:"edit",onClick:j},H("Edit")),g&&n.a.createElement(_.a,{icon:"favorite",onClick:w},H("AddToFavorites")),p&&n.a.createElement(_.a,{icon:"favorite",onClick:I},H("Stickers.RemoveFromFavorites")),v&&D.map(e=>n.a.createElement(_.a,{key:e.label,icon:"copy",onClick:e.handler},H(e.label))),i&&n.a.createElement(_.a,{icon:"pin",onClick:C},H("DialogPin")),d&&n.a.createElement(_.a,{icon:"unpin",onClick:y},H("DialogUnpin")),b&&n.a.createElement(_.a,{icon:"forward",onClick:k},H("Forward")),O&&n.a.createElement(_.a,{icon:"select",onClick:P},H("Common.Select")),h&&n.a.createElement(_.a,{icon:"flag",onClick:S},H("lng_context_report_msg")),m&&n.a.createElement(_.a,{destructive:!0,icon:"delete",onClick:N},H("Delete")))};var Ln=Object(n.h)(Object(s.h)((e,{message:t,messageListType:a})=>{const{threadId:n}=Object(m.z)(e)||{},{noOptions:s,canReply:c,canPin:r,canUnpin:o,canDelete:l,canReport:i,canEdit:d,canForward:u,canFaveSticker:h,canUnfaveSticker:b,canCopy:g,canCopyLink:p,canSelect:v}=n&&Object(m.b)(e,t,n)||{},E="pinned"===a,O="scheduled"===a;return{noOptions:s,canSendNow:O,canReschedule:O,canReply:!E&&!O&&c,canPin:!O&&r,canUnpin:!O&&o,canDelete:l,canReport:i,canEdit:!E&&d,canForward:!O&&u,canFaveSticker:!O&&h,canUnfaveSticker:!O&&b,canCopy:g,canCopyLink:!O&&p,canSelect:v}},(e,t)=>Object(h.l)(t,["setReplyingToId","setEditingId","pinMessage","openForwardMenu","faveSticker","unfaveSticker","toggleMessageSelection","sendScheduledMessages","rescheduleMessage"]))(({isOpen:e,messageListType:t,chatUsername:a,message:s,album:c,anchor:r,onClose:o,onCloseAnimationEnd:l,noOptions:i,canSendNow:d,canReschedule:m,canReply:u,canPin:h,canUnpin:b,canDelete:g,canReport:p,canEdit:v,canForward:E,canFaveSticker:O,canUnfaveSticker:f,canCopy:j,canCopyLink:C,canSelect:y,setReplyingToId:k,setEditingId:N,pinMessage:S,openForwardMenu:w,faveSticker:I,unfaveSticker:P,toggleMessageSelection:F,sendScheduledMessages:M,rescheduleMessage:L})=>{const{transitionClassNames:A}=Object(Y.a)(e,l,void 0,!1),[R,T]=Object(n.r)(!0),[D,U]=Object(n.r)(!1),[x,G]=Object(n.r)(!1),[z,q]=Object(n.r)(!1),[_,H,$]=Object(xe.a)(),V=Object(n.m)(()=>{T(!1),U(!0)},[]),W=Object(n.m)(()=>{T(!1),G(!0)},[]),K=Object(n.m)(()=>{T(!1),o()},[o]),Q=Object(n.m)(()=>{U(!1),o()},[o]),J=Object(n.m)(()=>{G(!1),o()},[o]),Z=Object(n.m)(()=>{q(!1),o()},[o]),X=Object(n.m)(()=>{$(),o()},[$,o]),ee=Object(n.m)(()=>{k({messageId:s.id}),K()},[k,s.id,K]),te=Object(n.m)(()=>{N({messageId:s.id}),K()},[N,s.id,K]),ae=Object(n.m)(()=>{T(!1),q(!0)},[]),ne=Object(n.m)(()=>{S({messageId:s.id,isUnpin:!0}),K()},[S,s.id,K]),se=Object(n.m)(()=>{if(K(),c&&c.messages){const e=c.messages.map(({id:e})=>e);w({fromChatId:s.chatId,messageIds:e})}else w({fromChatId:s.chatId,messageIds:[s.id]})},[w,s,K,c]),ce=Object(n.m)(()=>{K(),I({sticker:s.content.sticker})},[K,s.content.sticker,I]),re=Object(n.m)(()=>{K(),P({sticker:s.content.sticker})},[K,s.content.sticker,P]),oe=Object(n.m)(()=>{const e=c&&c.messages?{messageId:s.id,childMessageIds:c.messages.map(({id:e})=>e),withShift:!1}:{messageId:s.id,withShift:!1};F(e),K()},[K,s.id,F,c]),le=Object(n.m)(()=>{M({chatId:s.chatId,id:s.id}),K()},[K,s.chatId,s.id,M]),ie=Object(n.m)(()=>{T(!1),H()},[H]),de=Object(n.m)(e=>{L({chatId:s.chatId,messageId:s.id,scheduledAt:Math.round(e.getTime()/1e3)})},[s.chatId,s.id,L]),me=Object(n.m)(()=>{Object(wn.c)(`https://t.me/${a||"c/"+Math.abs(s.chatId)}/${s.id}`),K()},[a,K,s.chatId,s.id]);Object(n.n)(()=>(kn(),Nn),[]);const ue=Object(n.p)(()=>(c?c.messages:[s]).map(({id:e})=>e),[c,s]);if(i)return void K();const he=new Date;return he.setFullYear(he.getFullYear()+1),n.a.createElement("div",{className:["ContextMenuContainer",A].join(" ")},n.a.createElement(Mn,{message:s,isOpen:R,anchor:r,canSendNow:d,canReschedule:m,canReply:u,canDelete:g,canReport:p,canPin:h,canUnpin:b,canEdit:v,canForward:E,canFaveSticker:O,canUnfaveSticker:f,canCopy:j,canCopyLink:C,canSelect:y,onReply:ee,onEdit:te,onPin:ae,onUnpin:ne,onForward:se,onDelete:V,onReport:W,onFaveSticker:ce,onUnfaveSticker:re,onSelect:oe,onSend:le,onReschedule:ie,onClose:K,onCopyLink:me}),n.a.createElement(De,{isOpen:D,isSchedule:"scheduled"===t,onClose:Q,album:c,message:s}),n.a.createElement(_e,{isOpen:x,onClose:J,messageIds:ue}),n.a.createElement(Be,{isOpen:z,messageId:s.id,chatId:s.chatId,onClose:Z}),n.a.createElement(Re,{isOpen:_,withTimePicker:!0,selectedAt:1e3*s.date,maxAt:Object(B.k)(he),isFutureMode:!0,onClose:X,onSubmit:de}))}));a(297);var An=Object(n.h)(Object(s.h)((e,{fromSticker:t})=>({stickerSet:Object(m.zb)(e,t.stickerSetId)}),(e,t)=>Object(h.l)(t,["loadStickers","toggleStickerSet","sendMessage"]))(({isOpen:e,fromSticker:t,stickerSet:a,onClose:s,loadStickers:c,toggleStickerSet:r,sendMessage:l})=>{const i=Object(n.q)(null),d=Object(M.a)(),{observe:m}=Object(ta.a)({rootRef:i,throttleMs:200,isDisabled:!e});Object(n.n)(()=>{if(e){const{stickerSetId:e,stickerSetAccessHash:a}=t;c({stickerSetId:e,stickerSetAccessHash:a})}},[e,t,c]);const u=Object(n.m)(e=>{e={...e,isPreloadedGlobally:!0},l({sticker:e}),s()},[s,l]),h=Object(n.m)(()=>{r({stickerSetId:t.stickerSetId}),s()},[t.stickerSetId,s,r]);return n.a.createElement(pe.a,{className:"StickerSetModal",isOpen:e,onClose:s,hasCloseButton:!0,title:a?Object(U.a)(a.title,["emoji","links"]):d("AccDescrStickerSet")},a&&a.stickers?n.a.createElement(n.a.Fragment,null,n.a.createElement("div",{ref:i,className:"stickers custom-scroll"},a.stickers.map(e=>n.a.createElement(oa.a,{sticker:e,size:o.Kb,observeIntersection:m,onClick:u,clickArg:e}))),n.a.createElement("div",{className:"button-wrapper"},n.a.createElement(D.a,{size:"smaller",fluid:!0,color:a.installedDate?"danger":"primary",onClick:h},d(a.installedDate?"StickerPack.RemoveStickerCount":"StickerPack.AddStickerCount",a.count,"i")))):n.a.createElement(ge.a,null))})),Rn=a(128);a(298);var Tn=Object(n.h)(Object(s.h)((e,{chatId:t})=>{const a=Object(m.g)(e,t);return!a||a.isRestricted?{}:{chat:a,isMuted:Object(u.Hb)(a,Object(m.fb)(e),Object(m.eb)(e)),isPrivate:Object(u.ob)(a.id),canDeleteChat:Object(u.c)(a)}},(e,t)=>Object(h.l)(t,["updateChatMutedState","enterMessageSelectMode","sendBotCommand","restartBot"]))(({chatId:e,isOpen:t,anchor:a,isChannel:s,canStartBot:c,canRestartBot:r,canSubscribe:o,canSearch:i,canMute:d,canSelect:m,canLeave:u,chat:h,isPrivate:b,isMuted:g,canDeleteChat:p,onSubscribeChannel:v,onSearchClick:E,onClose:O,onCloseAnimationEnd:f,updateChatMutedState:j,enterMessageSelectMode:C,sendBotCommand:y,restartBot:k})=>{const[N,S]=Object(n.r)(!0),[w,I]=Object(n.r)(!1),{x:P,y:F}=a;Object(Y.a)(t,f,void 0,!1);const L=Object(n.m)(()=>{S(!1),I(!0)},[]),A=Object(n.m)(()=>{S(!1),O()},[O]),R=Object(n.m)(()=>{I(!1),O()},[O]),T=Object(n.m)(()=>{y({command:"/start"})},[y]),D=Object(n.m)(()=>{k({chatId:e})},[e,k]),B=Object(n.m)(()=>{j({chatId:e,isMuted:!g}),A()},[e,A,g,j]),U=Object(n.m)(()=>{v(),A()},[A,v]),x=Object(n.m)(()=>{E(),A()},[A,E]),G=Object(n.m)(()=>{C(),A()},[A,C]);Object(n.n)(()=>(kn(),Nn),[]);const z=Object(M.a)();return n.a.createElement(Rn.a,null,n.a.createElement("div",{className:"HeaderMenuContainer"},n.a.createElement(Fn.a,{isOpen:N,positionX:"right",style:`left: ${P}px;top: ${F}px;`,onClose:A},l.l&&c&&n.a.createElement(_.a,{icon:"bots",onClick:T},z("BotStart")),l.l&&r&&n.a.createElement(_.a,{icon:"bots",onClick:D},z("BotRestart")),l.l&&o&&n.a.createElement(_.a,{icon:s?"channel":"group",onClick:U},z(s?"Subscribe":"Join Group")),l.l&&i&&n.a.createElement(_.a,{icon:"search",onClick:x},z("Search")),d&&n.a.createElement(_.a,{icon:g?"unmute":"mute",onClick:B},z(g?"ChatsUnmute":"ChatsMute")),m&&n.a.createElement(_.a,{icon:"select",onClick:G},z("ReportSelectMessages")),u&&n.a.createElement(_.a,{destructive:!0,icon:"delete",onClick:L},z(b?"Delete":p?"GroupInfo.DeleteAndExit":s?"LeaveChannel":"Group.LeaveGroup"))),h&&n.a.createElement(Ye.a,{isOpen:w,onClose:R,chat:h})))})),Dn=a(160);a(299);const Bn=Object(V.a)(e=>e(),200,!1);var Un=Object(n.h)(Object(s.h)(e=>{const t=Object(m.s)(e);if(!t)return{};const{query:a,results:n}=Object(m.B)(e)||{},{totalCount:s,foundIds:c}=n||{};return{chat:t,query:a,totalCount:s,foundIds:c,isHistoryCalendarOpen:Boolean(e.historyCalendarSelectedAt)}},(e,t)=>Object(h.l)(t,["setLocalTextSearchQuery","searchTextMessagesLocal","focusMessage","closeLocalTextSearch","openHistoryCalendar"]))(({isActive:e,chat:t,query:a,totalCount:s,foundIds:c,isHistoryCalendarOpen:r,setLocalTextSearchQuery:o,searchTextMessagesLocal:l,focusMessage:i,closeLocalTextSearch:d,openHistoryCalendar:m})=>{const u=Object(n.q)(null),[h,b]=Object(n.r)(0);Object(n.n)(()=>{const{visualViewport:e}=window;if(!e)return;const t=document.getElementById("Main"),a=()=>{const{activeElement:a}=document;if(a&&a===u.current){const{pageTop:a,height:n}=e;t.style.transform=`translateY(${a}px)`,t.style.height=n+"px",document.documentElement.scrollTop=a}else t.style.transform="",t.style.height=""};return e.addEventListener("resize",a),()=>{e.removeEventListener("resize",a)}},[]),Object(n.n)(()=>{t&&c&&c.length?(i({chatId:t.id,messageId:c[c.length-1]}),b(0)):b(-1)},[t,i,c]),Object(n.n)(()=>{Array.from(document.querySelectorAll("input")).forEach(t=>{t.disabled=Boolean(e&&t!==u.current)}),Array.from(document.querySelectorAll("div[contenteditable]")).forEach(t=>{t.contentEditable=e?"false":"true"})},[e]),Object(n.n)(()=>{e||u.current.blur()},[e]),Object(n.o)(()=>{document.querySelector("#MobileSearch input").blur()},[r]);const g=Object(n.m)(e=>{o({query:e}),e.length&&Bn(l)},[l,o]),p=Object(n.m)(()=>{if(t&&c){const e=h+1;i({chatId:t.id,messageId:c[c.length-1-e]}),b(e)}},[t,h,i,c]),v=Object(n.m)(()=>{if(t&&c){const e=h-1;i({chatId:t.id,messageId:c[c.length-1-e]}),b(e)}},[t,h,i,c]);return n.a.createElement("div",{id:"MobileSearch",className:e?"active":""},n.a.createElement("div",{className:"header"},n.a.createElement(D.a,{size:"smaller",round:!0,color:"translucent",onClick:d},n.a.createElement("i",{className:"icon-arrow-left"})),n.a.createElement(Dn.a,{ref:u,value:a,onChange:g})),n.a.createElement("div",{className:"footer"},n.a.createElement("div",{className:"counter"},a?c&&c.length?`${h+1} of ${s}`:c&&!c.length?"No results":"":n.a.createElement(D.a,{round:!0,size:"smaller",color:"translucent",onClick:()=>m({selectedAt:Object(B.k)(Date.now())}),ariaLabel:"Search messages by date"},n.a.createElement("i",{className:"icon-calendar"}))),n.a.createElement(D.a,{round:!0,size:"smaller",color:"translucent",onClick:p,disabled:!c||!c.length||h===c.length-1},n.a.createElement("i",{className:"icon-up"})),n.a.createElement(D.a,{round:!0,size:"smaller",color:"translucent",onClick:v,disabled:!c||!c.length||0===h},n.a.createElement("i",{className:"icon-down"}))))})),xn=a(60),Gn=a(200),zn=a(192),qn=a(188),_n=a(194);function Hn(e,t,a=0,n=!1,s=!1,c=!1){const r=e[c?"scrollLeft":"scrollTop"],o=r+e[c?"offsetWidth":"offsetHeight"],l="string"==typeof t?e.querySelectorAll(t):t,{length:i}=l,d=[];let m=!1;for(let e=0;e=r-a&&u<=o+a:i<=o+a&&u>=r-a)d.push(e),m=!0;else if(m&&!n)break}return{allElements:l,visibleIndexes:d}}var $n=function(e,t,a=!1){const n=e[a?"scrollLeft":"scrollTop"],s=n+e[a?"offsetWidth":"offsetHeight"],c=t[a?"offsetLeft":"offsetTop"],r=c+t[a?"offsetWidth":"offsetHeight"];return c>n&&rs[s.length-1]?"start":"end";Object(Vn.a)(n,c[t],e,10)}}var Kn=a(134);a(300);var Yn=Object(n.h)(({isOpen:e,filter:t,onClose:a,onInsertUserName:s,usersById:c,filteredUsers:r})=>{const o=Object(n.q)(null),{shouldRender:l,transitionClassNames:i}=Object(Y.a)(e,void 0,void 0,!1),d=Object(n.m)(e=>{if(!r)return-1;const t=r.length;return Object(Kn.a)(t,e)},[r]),[m,u]=Object(n.r)(-1),h=Object(n.m)((e,t)=>{t.preventDefault(),u(t=>d(t+e))},[u,d]),b=Object(n.m)((e,t=!1)=>{const a=c&&c[e];a&&s(a,t)},[c,s]),g=Object(n.m)(e=>{if(r&&r.length&&m>-1){const t=r[m];t&&(e.preventDefault(),b(t.id,!0))}},[r,m,b]);Object(n.n)(()=>e?Object(Ge.a)({onEsc:a,onUp:e=>h(-1,e),onDown:e=>h(1,e),onEnter:g,onTab:g}):void 0,[e,a,h,g]),Object(n.n)(()=>{r&&!r.length&&a()},[r,a]),Object(n.n)(()=>{u(0)},[t]),Object(n.n)(()=>{Wn(".chat-item-clickable",m,o)},[m]);const p=Object(j.a)(r&&r.length?r:void 0,l),v=r&&!r.length?p:r;if(!l||v&&!v.length)return;const E=Object(W.a)("MentionTooltip composer-tooltip custom-scroll",i);return n.a.createElement("div",{className:E,ref:o},v&&v.map(({id:e},t)=>n.a.createElement(Oe.a,{key:e,className:"chat-item-clickable scroll-item",onClick:()=>b(e),focus:m===t},n.a.createElement(fe.a,{userId:e,avatarSize:"small",withUsername:!0}))))}),Qn=a(193);a(301);var Jn=Object(n.h)(({attachments:e,caption:t,isReady:a,currentUserId:s,groupChatMembers:c,usersById:r,recentEmojis:l,baseEmojiKeywords:i,emojiKeywords:d,addRecentEmoji:m,onCaptionUpdate:u,onSend:h,onFileAppend:b,onClear:p})=>{const v=Object(n.q)(null),E=Object(j.a)(e),O=e.length?e:E,f=Boolean(e.length),[C,y,k]=Object(xe.a)(),N=Boolean(O&&O.every(e=>e.quick)),S=Object(M.a)(),{isMentionTooltipOpen:w,mentionFilter:I,closeMentionTooltip:P,insertMention:F,mentionFilteredUsers:L}=Object(Gn.a)(f,t,u,o.A,c,void 0,s,r),{isEmojiTooltipOpen:A,closeEmojiTooltip:R,filteredEmojis:T,insertEmoji:B}=Object(zn.a)(f,t,l,o.A,u,i,d,!a);Object(n.n)(()=>f?Object(g.a)(p):void 0,[f,p]);const U=Object(n.m)(()=>{f&&h()},[f,h]),x=Object(n.m)(e=>{e.preventDefault(),k();const{dataTransfer:{files:t}}=e;if(t&&t.length){const e=N?Array.from(t).filter(e=>e.type&&o.n.has(e.type)):Array.from(t);b(e,N)}},[N,b,k]);if(!O)return;const G=O.every(e=>e.mimeType.startsWith("image/")),z=O.every(e=>e.mimeType.startsWith("video/"));let q="";return q=S(G?"PreviewSender.SendPhoto":z?"PreviewSender.SendVideo":"PreviewSender.SendFile",O.length,"i"),n.a.createElement(pe.a,{isOpen:f,onClose:p,header:function(){if(O)return n.a.createElement("div",{className:"modal-header-condensed",dir:S.isRtl?"rtl":void 0},n.a.createElement(D.a,{round:!0,color:"translucent",size:"smaller",ariaLabel:"Cancel attachments",onClick:p},n.a.createElement("i",{className:"icon-close"})),n.a.createElement("div",{className:"modal-title"},q),n.a.createElement(D.a,{color:"primary",size:"smaller",className:"modal-action-button",onClick:U},S("Send")))}(),className:"AttachmentModal "+(C?"hovered":"")},n.a.createElement("div",{className:"drop-target",onDragEnter:y,onDrop:x,onDragOver:function(e){e.preventDefault(),e.stopPropagation(),v.current&&window.clearTimeout(v.current)},onDragLeave:e=>{const{relatedTarget:t,target:a}=e;a.matches(".drop-target")&&!t&&(v.current=window.setTimeout(k,150)),a&&a.closest(".AttachmentModal.hovered")||(t&&e.stopPropagation(),k())},"data-attach-description":S("Preview.Dragging.AddItems",10)},N?n.a.createElement("div",{className:"media-wrapper custom-scroll"},O.map(e=>e.mimeType.startsWith("image/")?n.a.createElement("img",{src:e.blobUrl,alt:""}):n.a.createElement("video",{src:e.blobUrl,autoPlay:!0,muted:!0,loop:!0}))):n.a.createElement("div",{className:"document-wrapper custom-scroll"},O.map(e=>n.a.createElement(qn.a,{name:e.filename,extension:Object(xn.d)(e.filename,e.mimeType),previewData:e.previewBlobUrl,size:e.size,smaller:!0}))),n.a.createElement("div",{className:"attachment-caption-wrapper"},n.a.createElement(Yn,{isOpen:w,onClose:P,filter:I,onInsertUserName:F,filteredUsers:L,usersById:r}),n.a.createElement(Qn.a,{isOpen:A,emojis:T,onClose:R,onEmojiSelect:B,addRecentEmoji:m}),n.a.createElement(_n.a,{id:"caption-input-text",isAttachmentModalInput:!0,html:t,editableInputId:o.A,placeholder:S("Caption"),onUpdate:u,onSend:h,shouldSetFocus:f}))))}),Zn=a(142);a(302);var Xn=Object(n.h)(({isOpen:e,onSend:t,onClear:a})=>{const s=Object(n.q)(null),c=Object(n.q)(null),r=Object(n.q)(null),[o,l]=Object(n.r)(""),[i,d]=Object(n.r)([""]),[m,u]=Object(n.r)(!0),[h,b]=Object(n.r)(!1),[p,v]=Object(n.r)(!1),[E,O]=Object(n.r)(),[f,j]=Object(n.r)(),[C,y]=Object(n.r)(!1),k=Object(M.a)(),N=Object(n.m)(t=>{e&&t.current&&t.current.focus()},[e]);Object(n.n)(()=>e?Object(g.a)(a):void 0,[e,a]),Object(n.n)(()=>{e||(l(""),d([""]),u(!0),b(!1),v(!1),O(""),j(""),y(!1))},[e]),Object(n.n)(()=>N(s),[N,e]),Object(n.o)(()=>{const e=r.current;e&&E!==e.innerHTML&&(e.innerHTML=E)},[E]);const S=Object(n.m)((e=[])=>{d([...e,""]),requestAnimationFrame(()=>{const e=c.current;e&&(e.classList.toggle("overflown",e.scrollHeight>320),e.scrollTo({top:e.scrollHeight,behavior:"smooth"}))})},[]),w=Object(n.m)(()=>{if(y(!1),!e)return;const a=o.trim().substring(0,255),n=i.map(e=>e.trim().substring(0,100)).filter(e=>e.length);if(!a||n.length<2)return l(a),n.length?n.length<2?S(n):d(n):S(),void y(!0);if(p&&(!f||!n[Number(f)]))return void y(!0);const s={summary:{question:a,answers:n.map((e,t)=>({text:e.trim(),option:String(t),...String(t)===f&&{correct:!0}})),...!m&&{isPublic:!0},...h&&{multipleChoice:!0},...p&&{quiz:!0}}};if(p){const{text:e,entities:t}=E&&Object(Zn.a)(E.substring(0,200))||{};s.quiz={correctAnswers:[f],...e&&{solution:e},...t&&{solutionEntities:t}}}t(s)},[e,o,i,p,f,m,h,t,S,E]),I=Object(n.m)((e,t)=>{const a=[...i];a[e]=t,a[a.length-1].trim().length&&a.length<10?S(a):d(a)},[i,S]),P=Object(n.m)(e=>{const t=[...i];t.splice(e,1),d(t),requestAnimationFrame(()=>{c.current&&c.current.classList.toggle("overflown",c.current.scrollHeight>320)})},[i]),F=Object(n.m)(e=>{j(e)},[j]),L=Object(n.m)(e=>{u(e.target.checked)},[]),A=Object(n.m)(e=>{b(e.target.checked)},[]),R=Object(n.m)(e=>{v(e.target.checked)},[]),T=Object(n.m)(e=>{13===e.keyCode&&w()},[w]),B=Object(n.m)(()=>{if(C&&!o.trim().length)return k("lng_polls_choose_question")},[C,k,o]),U=Object(n.m)(e=>{const t=i.map(e=>e.trim()).filter(e=>e.length);if(C&&t.length<2&&!i[e].trim().length)return k("lng_polls_choose_answers")},[C,k,i]);function x(){return i.map((e,t)=>n.a.createElement("div",{className:"option-wrapper"},n.a.createElement(ve.a,{label:t!==i.length-1||10===i.length?k("OptionHint"):k("CreatePoll.AddOption"),error:U(t),value:e,onChange:e=>I(t,e.currentTarget.value),onKeyPress:T}),t!==i.length-1&&n.a.createElement(D.a,{className:"option-remove-button",round:!0,color:"translucent",size:"smaller",ariaLabel:k("Delete"),onClick:()=>P(t)},n.a.createElement("i",{className:"icon-close"}))))}return n.a.createElement(pe.a,{isOpen:e,onClose:a,header:n.a.createElement("div",{className:"modal-header-condensed"},n.a.createElement(D.a,{round:!0,color:"translucent",size:"smaller",ariaLabel:"Cancel poll creation",onClick:a},n.a.createElement("i",{className:"icon-close"})),n.a.createElement("div",{className:"modal-title"},k("NewPoll")),n.a.createElement(D.a,{color:"primary",size:"smaller",className:"modal-action-button",onClick:w},k("Create"))),className:"PollModal"},n.a.createElement(ve.a,{ref:s,label:k("AskAQuestion"),value:o,error:B(),onChange:e=>l(e.currentTarget.value),onKeyPress:T}),n.a.createElement("div",{className:"options-divider"}),n.a.createElement("div",{className:"options-list custom-scroll",ref:c},n.a.createElement("h3",{className:"options-header"},k("PollOptions")),C&&function(){const e=i.map(e=>e.trim()).filter(e=>e.length);return p&&(!f||!e[Number(f)])&&n.a.createElement("p",{className:"error"},k("lng_polls_choose_correct"))}(),p?n.a.createElement(qe.a,{name:"correctOption",options:x().map((e,t)=>({value:String(t),label:e,hidden:t===i.length-1})),onChange:F}):x()),n.a.createElement("div",{className:"options-divider"}),n.a.createElement("div",{className:"quiz-mode"},n.a.createElement(Jt.a,{label:k("PollAnonymous"),checked:m,onChange:L}),n.a.createElement(Jt.a,{label:k("PollMultiple"),checked:h,disabled:p,onChange:A}),n.a.createElement(Jt.a,{label:k("PollQuiz"),checked:p,disabled:h,onChange:R}),p&&n.a.createElement(n.a.Fragment,null,n.a.createElement("h3",{className:"options-header"},k("lng_polls_solution_title")),n.a.createElement("div",{ref:r,className:"form-control",contentEditable:!0,dir:"auto",onChange:e=>O(e.currentTarget.innerHTML)}),n.a.createElement("div",{className:"note"},k("CreatePoll.ExplanationInfo")))))}),es=a(153),ts=a(66),as=a(147);a(303);var ns=Object(n.h)(({emoji:e,focus:t,onClick:a})=>{const s=Object(n.m)(t=>{t.preventDefault(),a(e.native,e.id)},[e,a]);return n.a.createElement("div",{className:"EmojiButton "+(t?"focus":""),onMouseDown:s,title:`:${e.names[0]}:`},l.d?e.native:n.a.createElement("img",{src:`./img-apple-64/${e.image}.png`,alt:"",loading:"lazy"}))});var ss=Object(n.h)(({category:e,index:t,allEmojis:a,observeIntersection:s,shouldRender:c,onEmojiSelect:r})=>{const o=Object(n.q)(null);Object(ta.c)(o,s);const{transitionClassNames:d}=Object(Y.a)(c,void 0,void 0,"slow"),m=Object(M.a)(),u=l.l?Math.floor((i.a.get().width-8)/44):9,h=44*Math.ceil(e.emojis.length/u);return n.a.createElement("div",{ref:o,key:e.id,id:"emoji-category-"+t,className:"symbol-set"},n.a.createElement("p",{className:"symbol-set-name",dir:"auto"},m("recent"===e.id?"RecentStickers":"Emoji"+t)),n.a.createElement("div",{className:Object(W.a)("symbol-set-container",d),style:`height: ${h}px;`,dir:m.isRtl?"rtl":void 0},c&&e.emojis.map(e=>{const t=a[e],s="id"in t?t:t[1];return n.a.createElement(ns,{key:s.id,emoji:s,onClick:r})})))});a(304);const cs={recent:"icon-recent",people:"icon-smile",nature:"icon-animals",foods:"icon-eats",activity:"icon-sport",places:"icon-car",objects:"icon-lamp",symbols:"icon-language",flags:"icon-flag"},rs=[];let os,ls,is;var ds=Object(n.h)(Object(s.h)(e=>Object(h.l)(e,["recentEmojis"]))(({className:e,onEmojiSelect:t,recentEmojis:s})=>{const c=Object(n.q)(null),r=Object(n.q)(null),[i,d]=Object(n.r)(),[m,u]=Object(n.r)(),[h,b]=Object(n.r)(0),{observe:g}=Object(ta.a)({rootRef:c,throttleMs:200},e=>{e.forEach(e=>{const{id:t}=e.target;if(!t||!t.startsWith("emoji-category-"))return;const a=Number(t.replace("emoji-category-",""));rs[a]=e.isIntersecting});const t=rs.map((e,t)=>({index:t,isIntersecting:e})).filter(({isIntersecting:e})=>e);t.length&&b(t[Math.floor(t.length/2)].index)});Object(Je.a)(r.current,!l.l),Object(n.n)(()=>{if(!i)return;const e=r.current;if(!e)return;const t=42*h-e.offsetWidth/2+21;Object(as.a)(e,t)},[i,h]);const p=Object(M.a)(),v=Object(n.p)(()=>{if(!i)return Ve.a;const e=[...i];return s&&s.length&&e.unshift({id:"recent",name:p("RecentStickers"),emojis:s}),e},[i,p,s]);Object(n.n)(()=>{setTimeout(()=>{const e=()=>{d(is.categories),u(is.emojis)};is?e():async function(){os||(os=a.e(1).then(a.t.bind(null,332,3)),ls=(await os).default,is=Object(ts.b)(ls));return os}().then(e)},200)},[]);const E=Object(n.m)(e=>{b(e);const t=document.getElementById("emoji-category-"+e);Object(Vn.a)(c.current,t,"start",50,800)},[]),O=Object(n.m)((e,a)=>{t(e,a)},[t]),f=Object(mt.a)([],o.eb);const j=Object(W.a)("EmojiPicker",e);return m&&f?n.a.createElement("div",{className:j},n.a.createElement("div",{ref:r,className:"EmojiPicker-header",dir:p.isRtl?"rtl":""},v.map((function(e,t){const a=cs[e.id];return a&&n.a.createElement(D.a,{className:"symbol-set-button "+(t===h?"activated":""),round:!0,faded:!0,color:"translucent",onClick:()=>E(t),ariaLabel:e.name},n.a.createElement("i",{className:a}))}))),n.a.createElement("div",{ref:c,className:Object(W.a)("EmojiPicker-main no-selection",l.n?"no-scrollbar":"custom-scroll")},v.map((e,t)=>n.a.createElement(ss,{category:e,index:t,allEmojis:m,observeIntersection:g,shouldRender:h>=t-1&&h<=t+1,onEmojiSelect:O})))):n.a.createElement("div",{className:j},n.a.createElement(ge.a,null))}));const ms=l.l?8:16;var us=Object(n.h)(({stickerSet:e,loadAndPlay:t,index:a,observeIntersection:s,shouldRender:c,onStickerSelect:r,onStickerUnfave:d})=>{const m=Object(n.q)(null);Object(ta.c)(m,s);const{transitionClassNames:u}=Object(Y.a)(c,void 0,void 0,"slow"),h=l.l?Math.floor((i.a.get().width-8)/(o.Lb+ms)):5,b=Math.ceil(e.count/h)*(o.Lb+ms);return n.a.createElement("div",{ref:m,key:e.id,id:"sticker-set-"+a,className:"symbol-set"},n.a.createElement("p",{className:"symbol-set-name"},e.title),n.a.createElement("div",{className:Object(W.a)("symbol-set-container",u),style:`height: ${b}px;`},c&&e.stickers&&e.stickers.map(a=>n.a.createElement(oa.a,{key:a.id,sticker:a,size:o.Lb,observeIntersection:s,noAnimate:!t,onClick:r,clickArg:a,onUnfaveClick:"favorite"===e.id?d:void 0}))))});a(305);const hs=[];var bs=Object(n.h)(Object(s.h)(e=>{const{setsById:t,added:a,recent:n,favorite:s}=e.stickers;return{recentStickers:n.stickers,favoriteStickers:s.stickers,stickerSetsById:t,addedSetIds:a.setIds,shouldPlay:e.settings.byKey.shouldLoopStickers}},(e,t)=>Object(h.l)(t,["loadStickerSets","loadRecentStickers","loadFavoriteStickers","loadAddedStickers","addRecentSticker","unfaveSticker"]))(({className:e,loadAndPlay:t,canSendStickers:a,recentStickers:s,favoriteStickers:c,addedSetIds:r,stickerSetsById:i,shouldPlay:d,onStickerSelect:m,loadStickerSets:u,loadRecentStickers:h,loadFavoriteStickers:b,loadAddedStickers:g,addRecentSticker:p,unfaveSticker:v})=>{const E=Object(n.q)(null),O=Object(n.q)(null),[f,j]=Object(n.r)(0),{observe:C}=Object(ta.a)({rootRef:E,throttleMs:200},e=>{e.forEach(e=>{const{id:t}=e.target;if(!t||!t.startsWith("sticker-set-"))return;const a=Number(t.replace("sticker-set-",""));hs[a]=e.isIntersecting});const t=hs.map((e,t)=>({index:t,isIntersecting:e})).filter(({isIntersecting:e})=>e);t.length&&j(t[Math.floor(t.length/2)].index)}),{observe:y}=Object(ta.a)({rootRef:O}),k=Object(M.a)(),N=Boolean(r),S=Object(n.p)(()=>r?[{id:"recent",title:k("RecentStickers"),stickers:s,count:s.length},{id:"favorite",title:k("FavoriteStickers"),stickers:c,count:c.length},...r.map(e=>i[e]).filter(Boolean)]:Ve.a,[r,k,s,c,i]),w=Object(n.p)(()=>N&&0===S.filter(e=>e.stickers&&e.stickers.length).length,[S,N]);Object(n.n)(()=>{t&&(u(),h(),b())},[t,b,h,u]),Object(n.n)(()=>{r&&r.length&&g()},[r,g]),Object(Je.a)(O.current),Object(n.n)(()=>{if(!N)return;const e=O.current;if(!e)return;const t=52*f-(e.offsetWidth/2-26);Object(as.a)(e,t)},[N,f]);const I=Object(n.m)(e=>{j(e);const t=document.getElementById("sticker-set-"+e);Object(Vn.a)(E.current,t,"start",void 0,500)},[]),P=Object(n.m)(e=>{m(e),p({sticker:e})},[p,m]),F=Object(n.m)(e=>{v({sticker:e})},[v]),L=Object(mt.a)([],o.Bb);const A=Object(W.a)("StickerPicker",e);return N&&L&&!w&&a?n.a.createElement("div",{className:A},n.a.createElement("div",{ref:O,className:"StickerPicker-header no-selection no-scrollbar"},S.map((function(e,t){const a=e.stickers&&e.stickers[0],s=Object(W.a)("symbol-set-button sticker-set-button",t===f&&"activated");return"recent"===e.id||"favorite"===e.id||e.hasThumbnail||!a?n.a.createElement(D.a,{key:e.id,className:s,ariaLabel:e.title,round:!0,faded:"recent"===e.id||"favorite"===e.id,color:"translucent",onClick:()=>I(t)},"recent"===e.id?n.a.createElement("i",{className:"icon-recent"}):"favorite"===e.id?n.a.createElement("i",{className:"icon-favorite"}):e.isAnimated?n.a.createElement(ca,{stickerSet:e,observeIntersection:y}):n.a.createElement(ra,{stickerSet:e,observeIntersection:y})):n.a.createElement(oa.a,{key:e.id,sticker:a,size:o.Mb,title:e.title,className:s,observeIntersection:y,onClick:I,clickArg:t})}))),n.a.createElement("div",{ref:E,className:Object(W.a)("StickerPicker-main no-selection",l.n?"no-scrollbar":"custom-scroll")},S.map((e,a)=>n.a.createElement(us,{key:e.id,stickerSet:e,loadAndPlay:Boolean(d&&t),index:a,observeIntersection:C,shouldRender:f>=a-1&&f<=a+1,onStickerSelect:P,onStickerUnfave:F})))):n.a.createElement("div",{className:A},a?w?n.a.createElement("div",{className:"picker-disabled"},"You have no saved Stickers."):n.a.createElement(ge.a,null):n.a.createElement("div",{className:"picker-disabled"},"Sending stickers is not allowed in this chat."))}));a(306);function gs(){return(gs=Object.assign||function(e){for(var t=1;t{const o=Object(n.q)(null),l=Object(n.q)(null),i=e.thumbnail&&!!e.thumbnail.dataUri,d="gif"+e.id,m=Object(ta.b)(o,t)&&!a,u=Object(E.a)(d+"?size=m",!m,c.ApiMediaFormat.BlobUrl),h=Object(ja.a)(e.thumbnail&&e.thumbnail.dataUri,Boolean(u)),b=Object(E.a)(d,!m,c.ApiMediaFormat.BlobUrl),g=Boolean(m&&b),{transitionClassNames:p}=Object(na.a)(i||u||b,"slow"),{isBuffered:v,bufferingHandlers:O}=Object(Q.a)(!0),f=m&&!v;Object(Z.a)(l,[g]);const j=Object(n.m)(()=>r({...e,blobUrl:b}),[r,e,b]),C=Object(W.a)("GifButton",e.width&&e.height&&e.width({savedGifs:e.gifs.saved.gifs}),(e,t)=>Object(h.l)(t,["loadSavedGifs"]))(({className:e,loadAndPlay:t,canSendGifs:a,savedGifs:s,onGifSelect:c,loadSavedGifs:r})=>{const i=Object(n.q)(null),{observe:d}=Object(ta.a)({rootRef:i,debounceMs:300});Object(n.n)(()=>{t&&r()},[t,r]);const m=Object(mt.a)([],o.Bb);return n.a.createElement("div",{ref:i,className:Object(W.a)("GifPicker",e,l.n?"no-scrollbar":"custom-scroll")},a?m&&s&&s.length?s.map(e=>n.a.createElement(ps,{key:e.id,gif:e,observeIntersection:d,isDisabled:!t,onClick:c})):m&&s?n.a.createElement("div",{className:"picker-disabled"},"No saved GIFs."):n.a.createElement(ge.a,null):n.a.createElement("div",{className:"picker-disabled"},"Sending GIFs is not allowed in this chat."))}));let Es;!function(e){e[e.Emoji=0]="Emoji",e[e.Stickers=1]="Stickers",e[e.GIFs=2]="GIFs"}(Es||(Es={}));const Os=Object.values(Es).filter(e=>"string"==typeof e),fs={[Es.Emoji]:"icon-smile",[Es.Stickers]:"icon-stickers",[Es.GIFs]:"icon-gifs"};var js=Object(n.h)(({activeTab:e,onSwitchTab:t,onRemoveSymbol:a,onSearchOpen:s})=>{const c=Object(M.a)();function r(a){return n.a.createElement(D.a,{className:"symbol-tab-button "+(e===a?"activated":""),onClick:()=>t(a),ariaLabel:Os[a],round:!0,faded:!0,color:"translucent"},n.a.createElement("i",{className:fs[a]}))}const o=Object(n.m)(()=>{s(e===Es.Stickers?"stickers":"gifs")},[e,s]);return n.a.createElement("div",{className:"SymbolMenu-footer",onClick:function(e){e.stopPropagation()},dir:c.isRtl?"rtl":void 0},e!==Es.Emoji&&n.a.createElement(D.a,{className:"symbol-search-button",ariaLabel:e===Es.Stickers?"Search Stickers":"Search GIFs",round:!0,faded:!0,color:"translucent",onClick:o},n.a.createElement("i",{className:"icon-search"})),r(Es.Emoji),r(Es.Stickers),r(Es.GIFs),e===Es.Emoji&&n.a.createElement(D.a,{className:"symbol-delete-button",onClick:a,ariaLabel:"Remove Symbol",round:!0,faded:!0,color:"translucent"},n.a.createElement("i",{className:"icon-delete-left"})))});a(308);let Cs=!1;var ys=Object(n.h)(Object(s.h)(e=>({isLeftColumnShown:e.isLeftColumnShown}))(({isOpen:e,allowedAttachmentOptions:t,isLeftColumnShown:a,onLoad:s,onClose:c,onEmojiSelect:r,onStickerSelect:o,onGifSelect:i,onRemoveSymbol:d,onSearchOpen:m,addRecentEmoji:u})=>{const[h,b]=Object(n.r)(0),[g,p]=Object(n.r)([]),[v,E]=Object(es.a)(e,c,void 0,l.l),{shouldRender:O,transitionClassNames:f}=Object(Y.a)(e,c,!1,!1);!Cs&&e&&(Cs=!0),Object(n.n)(()=>{s()},[s]),Object(n.o)(()=>{if(l.l)return e&&(document.body.classList.add("enable-symbol-menu-transforms"),document.body.classList.add("is-symbol-menu-open")),()=>{e&&Object(V.b)(()=>{document.body.classList.remove("is-symbol-menu-open"),setTimeout(()=>{document.body.classList.remove("enable-symbol-menu-transforms")},350)})}},[e]);const j=Object(n.q)(g);j.current=g,Object(n.n)(()=>{j.current.length&&(j.current.forEach(e=>{u({emoji:e})}),p([]))},[e,h,u]);const C=Object(n.m)((e,t)=>{p(e=>[...e,t]),r(e)},[r]),y=Object(n.m)(e=>{c(),m(e)},[c,m]),k=Object(n.m)(e=>{o(e,!0)},[o]),N=Object(M.a)(),{canSendStickers:S,canSendGifs:w}=t;function I(t,a){switch(h){case Es.Emoji:return n.a.createElement(ds,{className:"picker-tab",onEmojiSelect:C});case Es.Stickers:return n.a.createElement(bs,{className:"picker-tab",loadAndPlay:!!S&&(e&&(t||a)),canSendStickers:S,onStickerSelect:k});case Es.GIFs:return n.a.createElement(vs,{className:"picker-tab",loadAndPlay:!!w&&(e&&(t||a)),canSendGifs:w,onGifSelect:i})}}const P=n.a.createElement(n.a.Fragment,null,n.a.createElement("div",{className:"SymbolMenu-main",onClick:function(e){e.stopPropagation()}},Cs&&n.a.createElement(T.a,{name:"slide",activeKey:h,renderCount:Os.length},I)),l.l&&n.a.createElement(D.a,{round:!0,faded:!0,color:"translucent",ariaLabel:N("Close"),className:"symbol-close-button",size:"tiny",onClick:c},n.a.createElement("i",{className:"icon-close"})),n.a.createElement(js,{activeTab:h,onSwitchTab:b,onRemoveSymbol:d,onSearchOpen:y}));if(l.l){if(!O)return;const e=Object(W.a)("SymbolMenu mobile-menu",f,!a&&"middle-column-open");return n.a.createElement(Rn.a,null,n.a.createElement("div",{className:e},P))}return n.a.createElement(Fn.a,{isOpen:e,positionX:"left",positionY:"bottom",onClose:c,className:"SymbolMenu",onCloseAnimationEnd:c,onMouseEnter:l.n?void 0:v,onMouseLeave:l.n?void 0:E,noCloseOnBackdrop:!l.n},P)}));a(309);var ks=Object(n.h)(({isOpen:e,allowedAttachmentOptions:t,onFileSelect:a,onPollCreate:s,onClose:c})=>{const[r,i]=Object(es.a)(e,c),d=Object(n.m)((e,t)=>{const{files:n}=e.target;n&&n.length>0&&a(Array.from(n),t)},[a]),m=Object(n.m)(()=>{ha(Array.from(o.n).join(","),e=>d(e,!0))},[d]),u=Object(n.m)(()=>{ha("*",e=>d(e,!1))},[d]),h=Object(M.a)(),{canAttachMedia:b,canAttachPolls:g}=t;return n.a.createElement(Fn.a,{isOpen:e,autoClose:!0,positionX:"right",positionY:"bottom",onClose:c,className:"AttachMenu fluid",onCloseAnimationEnd:c,onMouseEnter:l.n?void 0:r,onMouseLeave:l.n?void 0:i,noCloseOnBackdrop:!l.n},!b&&n.a.createElement(_.a,{className:"media-disabled",disabled:!0},"Posting media content is not allowed in this group."),b&&n.a.createElement(n.a.Fragment,null,n.a.createElement(_.a,{icon:"photo",onClick:m},h("AttachmentMenu.PhotoOrVideo")),n.a.createElement(_.a,{icon:"document",onClick:u},h("AttachDocument"))),g&&n.a.createElement(_.a,{icon:"poll",onClick:s},h("Poll")))});a(310);var Ns=Object(n.h)(Object(s.h)(e=>{const{stickers:t}=e.stickers.forEmoji;return{stickers:t}},(e,t)=>Object(h.l)(t,["clearStickersForEmoji"]))(({isOpen:e,onStickerSelect:t,stickers:a,clearStickersForEmoji:s})=>{const c=Object(n.q)(null),{shouldRender:r,transitionClassNames:i}=Object(Y.a)(e,void 0,void 0,!1),d=Object(j.a)(a,!0),m=a||d,{observe:u}=Object(ta.a)({rootRef:c,throttleMs:200});Object(n.n)(()=>e?Object(g.a)(s):void 0,[e,s]);const h=Object(W.a)("StickerTooltip composer-tooltip custom-scroll",i,!(m&&m.length)&&"hidden");return n.a.createElement("div",{ref:c,className:h,onMouseEnter:l.n?void 0:()=>{document.body.classList.add("no-select")},onMouseLeave:l.n?void 0:()=>{document.body.classList.remove("no-select")}},r&&m?m.map(e=>n.a.createElement(oa.a,{key:e.id,sticker:e,size:o.Lb,observeIntersection:u,onClick:t,clickArg:e})):r?n.a.createElement(ge.a,null):void 0)}));a(311);var Ss=Object(n.h)(({isOpen:e,onSilentSend:t,onScheduleSend:a,onClose:s,onCloseAnimationEnd:c})=>{const[r,o]=Object(es.a)(e,s),i=Object(M.a)();return n.a.createElement(Fn.a,{isOpen:e,autoClose:!0,positionX:"right",positionY:"bottom",className:"CustomSendMenu",onClose:s,onCloseAnimationEnd:c,onMouseEnter:l.n?void 0:r,onMouseLeave:l.n?void 0:o,noCloseOnBackdrop:!l.n},t&&n.a.createElement(_.a,{icon:"mute",onClick:t},i("SendWithoutSound")),a&&n.a.createElement(_.a,{icon:"schedule",onClick:a},i("ScheduleMessage")))}),ws=a(143),Is=a(171),Ps=a(184);a(312);var Fs=Object(n.h)(({isOpen:e,emojis:t,onClose:a,onEmojiSelect:s,addRecentEmoji:c})=>{const r=Object(n.q)(null),{shouldRender:o,transitionClassNames:i}=Object(Y.a)(e,void 0,void 0,!1),d=Object(Ps.a)(t.length?t:void 0,350)||[],[m,u]=Object(n.r)(-1);Object(n.n)(()=>{u(0)},[t]),Object(n.n)(()=>{!function(e,t){const a=t.current;if(!a)return;const{visibleIndexes:n,allElements:s}=Hn(a,".EmojiButton",8,!0,!0,!0);if(!s.length||!s[e])return;const c=n[0];if(!n.includes(e)||e===c&&!$n(a,s[c],!0)){const t="start"===(e>n[n.length-1]?"start":"end")?44*e:0;Object(as.a)(a,t)}}(m,r)},[m]);const h=Object(n.m)(e=>{if(!t.length)return-1;const a=t.length;return Object(Kn.a)(a,e)},[t]),b=Object(n.m)((e,t)=>{t.preventDefault(),u(t=>h(t+e))},[u,h]),g=Object(n.m)(e=>{if(t.length&&m>-1){const a=t[m];a&&(e.preventDefault(),s(a.native),c({emoji:a.id}))}},[c,t,s,m]),p=Object(n.m)((e,t)=>{s(e),c({emoji:t})},[c,s]);Object(n.n)(()=>e?Object(Ge.a)({onEsc:a,onLeft:e=>b(-1,e),onRight:e=>b(1,e),onEnter:g}):void 0,[b,g,e,a]);const v=Object(W.a)("EmojiTooltip composer-tooltip custom-scroll-x",i);return n.a.createElement("div",{ref:r,className:v,onMouseEnter:l.n?void 0:()=>{document.body.classList.add("no-select")},onMouseLeave:l.n?void 0:()=>{document.body.classList.remove("no-select")}},o&&d?d.map((e,t)=>n.a.createElement(ns,{key:e.id,emoji:e,focus:m===t,onClick:p})):o?n.a.createElement(ge.a,null):void 0)});a(313);var Ms=Object(n.h)(({title:e,description:t,thumbnail:a,thumbUrl:s,focus:c,transitionClassNames:r="",onClick:o})=>{let l="";const i=Object(E.a)(a?"webDocument:"+a.url:void 0);return(s=s||i)?l=n.a.createElement("img",{src:s,className:r,alt:"",decoding:"async",draggable:"false"}):e&&(l=Object(sa.c)(e,1)),n.a.createElement(Oe.a,{focus:c,className:"BaseResult chat-item-clickable",onClick:o},n.a.createElement("span",{className:"thumb"},"string"==typeof l?Object(U.a)(l):l),n.a.createElement("div",{className:"content-inner"},e&&n.a.createElement("div",{className:"title"},e),t&&n.a.createElement("div",{className:"description"},t)))});a(314);var Ls=Object(n.h)(({focus:e,isForGallery:t,inlineResult:a,onClick:s})=>{let c,r,o;"photo"in a&&(c=a.photo),"thumbnail"in a&&(r=a.thumbnail),"webThumbnail"in a&&t&&(o=a.webThumbnail);const l=Object(E.a)(o?"webDocument:"+o.url:void 0),i=Object(E.a)(c&&`photo${c.id}?size=m`),{shouldRenderThumb:d,shouldRenderFullMedia:m,transitionClassNames:u}=Object(na.a)(i,"slow"),h=Object(n.m)(()=>{s(a)},[a,s]);if(t)return n.a.createElement("div",{className:"MediaResult chat-item-clickable",onClick:h},d&&n.a.createElement("img",{src:c&&c.thumbnail&&c.thumbnail.dataUri||l,alt:""}),m&&n.a.createElement("img",{src:i,className:u+" full-media",alt:""}));const{title:b,description:g}=a;return n.a.createElement(Ms,{focus:e,thumbUrl:m?i:r&&r.dataUri||l,transitionClassNames:m?u:void 0,title:b,description:g,onClick:h})});var As=Object(n.h)(({focus:e,inlineResult:t,onClick:a})=>{const{title:s,url:c,description:r,webThumbnail:o}=t,l=Object(n.m)(()=>{a(t)},[t,a]);return n.a.createElement(Ms,{focus:e,thumbnail:o,title:s||c,description:r,onClick:l})});var Rs=Object(n.h)(({inlineResult:e,observeIntersection:t,onClick:a})=>{const{gif:s}=e,c=Object(n.m)(()=>{a(e)},[e,a]);if(s)return n.a.createElement(ps,{gif:s,observeIntersection:t,className:"chat-item-clickable",onClick:c})});var Ts=Object(n.h)(({inlineResult:e,observeIntersection:t,onClick:a})=>{const{sticker:s}=e;if(s)return n.a.createElement(oa.a,{sticker:s,size:o.Hb,observeIntersection:t,title:s.emoji,className:"chat-item-clickable",onClick:a,clickArg:e})});a(315);const Ds=Object(V.h)(e=>e(),500,!0);var Bs=Object(n.h)(Object(s.h)(void 0,(e,t)=>Object(h.l)(t,["sendBotCommand","openChat","sendInlineBotResult"]))(({isOpen:e,botId:t,isGallery:a,inlineBotResults:s,switchPm:c,loadMore:o,onClose:i,openChat:d,sendBotCommand:m,onSelectResult:u})=>{const h=Object(n.q)(null),{shouldRender:b,transitionClassNames:g}=Object(Y.a)(e,void 0,void 0,!1),[p,v]=Object(n.r)(-1),{observe:E}=Object(ta.a)({rootRef:h,debounceMs:200,isDisabled:!e});Object(n.n)(()=>{v(a?-1:0)},[s,a]),Object(n.n)(()=>{Wn(".chat-item-clickable",p,h)},[p]);const O=Object(n.m)(e=>s&&s.length?Object(Kn.a)(s.length,e):-1,[s]),f=Object(n.m)((e,t)=>{a||(t.preventDefault(),v(t=>O(t+e)))},[a,O]),C=Object(n.m)(e=>{if(s&&s.length&&p>-1){const t=s[p];t&&(e.preventDefault(),u(t))}},[s,u,p]),y=Object(n.m)(({direction:e})=>{e===r.e.Backwards&&Ds(o)},[o]);Object(n.n)(()=>e?Object(Ge.a)({onEsc:i,onUp:e=>f(-1,e),onDown:e=>f(1,e),onEnter:C}):void 0,[f,C,a,e,i]);const k=Object(n.m)(()=>{d({id:t}),m({chatId:t,command:"/start "+c.startParam})},[t,d,m,c]),N=Object(j.a)(s&&s.length?s:void 0,b),S=s&&!s.length?N:s;if(!b||!S||!S.length&&!c)return;const w=Object(W.a)("InlineBotTooltip composer-tooltip",l.n?"no-scrollbar":"custom-scroll",a&&"gallery",g);return n.a.createElement(Ee.a,{ref:h,className:w,items:S,itemSelector:".chat-item-clickable",noFastList:!0,onLoadMore:y,sensitiveArea:160},c&&n.a.createElement(Oe.a,{ripple:!0,className:"switch-pm scroll-item",onClick:k},n.a.createElement("span",{className:"title"},c.text)),S.map((e,t)=>{switch(e.type){case"gif":return n.a.createElement(Rs,{key:e.id,inlineResult:e,observeIntersection:E,onClick:u});case"photo":return n.a.createElement(Ls,{key:e.id,isForGallery:a,inlineResult:e,onClick:u});case"sticker":return n.a.createElement(Ts,{key:e.id,inlineResult:e,observeIntersection:E,onClick:u});case"video":case"game":return n.a.createElement(Ls,{key:e.id,focus:p===t,inlineResult:e,onClick:u});case"article":case"audio":return n.a.createElement(As,{key:e.id,focus:p===t,inlineResult:e,onClick:u});default:return}}))})),Us=a(181);a(316);var xs=Object(n.h)(Object(s.h)((e,{chatId:t})=>{const a=Object(m.g)(e,t),n=a&&Object(m.n)(e,a.id);if(!a||!n)return{};const{query:s,results:c}=Object(m.B)(e)||{},{totalCount:r,foundIds:o}=c||{};return{chat:a,messagesById:n,query:s,totalCount:r,foundIds:o}},(e,t)=>Object(h.l)(t,["searchTextMessagesLocal","focusMessage"]))(({chatId:e,threadId:t,onClose:a,isActive:c,chat:r,messagesById:o,query:l,totalCount:i,foundIds:d,searchTextMessagesLocal:b,focusMessage:g})=>{const p=Object(M.a)(),v=Object(n.p)(()=>{if(!(l&&d&&d.length&&o))return Ve.a;const a=d.map(a=>{const n=o[a];if(!n)return;const c=n.senderId?Object(m.Jb)(Object(s.e)(),n.senderId):void 0;let l;if(r&&Object(u.mb)(r))l=r;else if(n.forwardInfo){const{isChannelPost:e,fromChatId:t}=n.forwardInfo;l=e&&t?Object(m.g)(Object(s.e)(),t):void 0}else l=n.senderId?Object(m.g)(Object(s.e)(),n.senderId):void 0;return{message:n,senderUser:c,senderChat:l,onClick:()=>g({chatId:e,threadId:t,messageId:a})}}).filter(Boolean);return Object(h.k)(a,({message:e})=>e.date,"desc")},[e,t,g,d,r,o,l]);Object(L.a)(c,a);const E=Object(n.q)(null),O=Object(be.a)(E,!0,e=>{const t=v&&v[-1===e?0:e];t&&t.onClick()},".ListItem-button",!0);return n.a.createElement(Ee.a,{className:"RightSearch custom-scroll",items:v,preloadBackwards:0,onLoadMore:b,noFastList:!0,onKeyDown:O,ref:E},n.a.createElement("p",{className:"helper-text",dir:"auto"},l?0!==i&&v.length?1===i?"1 message found":(v.length&&(i||v.length))+" messages found":p("lng_search_no_results"):p("lng_dlg_search_for_messages")),v.map(({message:e,senderUser:t,senderChat:a,onClick:s})=>{const c=a?Object(u.k)(p,a):Object(u.bb)(t),r=Object(u.O)(p,e);return n.a.createElement(Oe.a,{className:"chat-item-clickable search-result-message m-0",onClick:s},n.a.createElement(x.a,{chat:a,user:t}),n.a.createElement("div",{className:"info"},n.a.createElement("div",{className:"title"},n.a.createElement("h3",{dir:"auto"},c&&Object(U.a)(c)),n.a.createElement(Us.a,{message:e})),n.a.createElement("div",{className:"subtitle",dir:"auto"},Object(U.a)(r,["emoji","highlight"],{highlight:l}))))}))})),Gs=a(53);var zs=Object(n.h)(Object(s.h)((e,{stickerSetId:t})=>({set:Object(m.zb)(e,t),shouldPlay:Object(m.yb)(e)}),(e,t)=>Object(h.l)(t,["loadStickers","toggleStickerSet"]))(({stickerSetId:e,observeIntersection:t,set:a,shouldPlay:s,loadStickers:c,toggleStickerSet:r,isSomeModalOpen:l,onModalToggle:i})=>{const d=Object(M.a)(),m=a&&Boolean(a.installedDate),u=Boolean(a&&a.stickers),[h,b,g]=Object(xe.a)();Object(Gs.a)(()=>{i(h)},[h,i]);const p=Object(n.p)(()=>{if(!a)return[];const e=(a.covers||[]).map(({id:e})=>e),t=a.stickers?a.stickers.filter(({id:t})=>!e.includes(t)):[];return[...a.covers||[],...t].slice(0,5)},[a]);Object(n.n)(()=>{!u&&p.length<5&&c({stickerSetId:e})},[u,p.length,c,e]);const v=Object(n.m)(()=>{r({stickerSetId:e})},[r,e]);if(!a)return;const E=p.length>0;return n.a.createElement("div",{key:a.id,className:"sticker-set",dir:d.isRtl?"rtl":void 0},n.a.createElement("div",{className:"sticker-set-header"},n.a.createElement("div",{className:"title-wrapper"},n.a.createElement("h3",{className:"title",dir:"auto"},a.title),n.a.createElement("p",{className:"count",dir:"auto"},d("Stickers",a.count,"i"))),n.a.createElement(D.a,{className:m?"is-added":void 0,color:"primary",size:"tiny",pill:!0,fluid:!0,onClick:v},d(m?"Stickers.Installed":"Stickers.Install"))),n.a.createElement("div",{className:"sticker-set-main"},!E&&n.a.createElement(A.a,null),E&&p.map(e=>n.a.createElement(oa.a,{sticker:e,size:o.Nb,observeIntersection:t,noAnimate:!s||h||l,onClick:b}))),E&&n.a.createElement(ia.a,{isOpen:h,fromSticker:p[0],onClose:g}))}));a(317);const qs=Object(V.h)(e=>e(),6e4,!0);var _s=Object(n.h)(Object(s.h)(e=>{const t=Object(m.A)(e),{query:a,resultIds:n}=t||{},{featured:s}=e.stickers;return{query:a,featuredIds:s.setIds,resultIds:n}},(e,t)=>Object(h.l)(t,["loadFeaturedStickers"]))(({onClose:e,isActive:t,query:a,featuredIds:s,resultIds:c,loadFeaturedStickers:r})=>{const o=Object(n.q)(null),l=Object(M.a)(),[i,d]=Object(n.r)(!1),{observe:m}=Object(ta.a)({rootRef:o,throttleMs:200});return Object(n.n)(()=>{qs(()=>{r()})}),Object(L.a)(t,e),n.a.createElement("div",{ref:o,className:"StickerSearch custom-scroll",dir:l.isRtl?"rtl":void 0},function(){if(void 0!==a)return!a&&s?s.map(e=>n.a.createElement(zs,{key:e,stickerSetId:e,observeIntersection:m,isSomeModalOpen:i,onModalToggle:d})):c?c.length?c.map(e=>n.a.createElement(zs,{key:e,stickerSetId:e,observeIntersection:m,isSomeModalOpen:i,onModalToggle:d})):n.a.createElement("p",{className:"helper-text",dir:"auto"},"Nothing found."):n.a.createElement(ge.a,null)}())}));a(318);var Hs=Object(n.h)(Object(s.h)(e=>{const t=Object(m.t)(e),{query:a,results:n}=t||{},{chatId:s}=Object(m.z)(e)||{},c=s?Object(m.g)(e,s):void 0;return{query:a,results:n,chat:c,isChatWithBot:c?Object(m.O)(e,c):void 0}},(e,t)=>Object(h.l)(t,["searchMoreGifs","sendMessage","setGifSearchQuery"]))(({onClose:e,isActive:t,query:a,results:s,chat:c,isChatWithBot:r,searchMoreGifs:o,sendMessage:i,setGifSearchQuery:d})=>{const m=Object(n.q)(null),{observe:h}=Object(ta.a)({rootRef:m,debounceMs:300}),{canSendGifs:b}=Object(u.b)(c,r),g=Object(n.m)(e=>{b&&i({gif:e}),l.n&&d({query:void 0})},[b,i,d]),p=Object(M.a)();Object(L.a)(t,e);const v=Boolean(void 0!==a&&s&&s.length);return n.a.createElement("div",{className:"GifSearch",dir:p.isRtl?"rtl":void 0},n.a.createElement(Ee.a,{ref:m,className:Object(W.a)("gif-container custom-scroll",v&&"grid"),items:s,itemSelector:".GifButton",preloadBackwards:96,noFastList:!0,onLoadMore:o},function(){if(void 0!==a)return s?s.length?s.map(e=>n.a.createElement(ps,{key:e.id,gif:e,observeIntersection:h,onClick:g})):n.a.createElement("p",{className:"helper-text",dir:"auto"},p("NoGIFsFound")):n.a.createElement(ge.a,null)}()))}));a(319);var $s=Object(n.h)(Object(s.h)((e,{answer:t})=>{const{voters:a,offsets:n}=e.pollResults;return{voters:a&&a[t.option],offset:n&&n[t.option]||""}},(e,t)=>Object(h.l)(t,["loadPollOptionResults","openChat","closePollResults"]))(({chat:e,message:t,answer:a,answerVote:s,totalVoters:c,voters:r,offset:o,loadPollOptionResults:l,openChat:i,closePollResults:d})=>{const m=Object(j.a)(s.votersCount),[u,h]=Object(n.r)(!0),b=Boolean(r),{option:g,text:p}=a,v=Object(M.a)();Object(n.n)(()=>{b&&m===s.votersCount||l({chat:e,messageId:t.id,option:g,offset:o,limit:4,shouldResetVoters:!0})},[s.votersCount,b]);const E=Object(n.m)(()=>{h(!0),l({chat:e,messageId:t.id,option:g,offset:o,limit:50})},[e,l,t.id,o,g]);Object(n.n)(()=>{h(!1)},[r]);const O=Object(n.m)(e=>{i({id:e}),d()},[d,i]);return n.a.createElement("div",{className:"PollAnswerResults"},n.a.createElement("div",{className:"poll-voters"},r?r.map(e=>n.a.createElement(Oe.a,{key:e,className:"chat-item-clickable",onClick:()=>O(e)},n.a.createElement(fe.a,{avatarSize:"tiny",userId:e,forceShowSelf:!0,noStatusOrTyping:!0}))):n.a.createElement(ge.a,null),r&&function(){const e=s.votersCount-r.length;return s.votersCount>4&&e>0&&n.a.createElement(Kt,{count:e,itemName:"voter",isLoading:u,onClick:E})}()),n.a.createElement("div",{className:"answer-head",dir:v.isRtl?"rtl":void 0},n.a.createElement("span",{className:"answer-title",dir:"auto"},p),n.a.createElement("span",{className:"answer-percent",dir:v.isRtl?"auto":void 0},(f=s.votersCount,(C=c)>0?(f/C*100).toFixed():0),"%")));var f,C}));a(320);var Vs=Object(n.h)(Object(s.h)(e=>{const{pollResults:{chatId:t,messageId:a},lastSyncTime:n}=e;if(!t||!a)return{};return{chat:Object(m.g)(e,t),message:Object(m.l)(e,t,a),lastSyncTime:n}})(({onClose:e,isActive:t,chat:a,message:s,lastSyncTime:c})=>{const r=Object(M.a)();if(Object(L.a)(t,e),!s||!a)return n.a.createElement(ge.a,null);const{summary:o,results:l}=Object(u.I)(s);if(!l.results)return;const i=Object(h.c)(l.results,"option");return n.a.createElement("div",{className:"PollResults",dir:r.isRtl?"rtl":void 0},n.a.createElement("h3",{className:"poll-question",dir:"auto"},o.question),n.a.createElement("div",{className:"poll-results-list custom-scroll"},c&&o.answers.map(e=>n.a.createElement($s,{key:`${s.id}-${e.option}`,chat:a,message:s,answer:e,answerVote:i[e.option],totalVoters:l.totalVoters})),!c&&n.a.createElement(ge.a,null)))}));a(175);var Ws=Object(n.h)(Object(s.h)((e,{userId:t})=>{const a=Object(m.Jb)(e,t),n=Object(m.g)(e,t),{progress:s}=e.management;return{user:a,chat:n,progress:s,isMuted:Object(u.Hb)(n,Object(m.fb)(e),Object(m.eb)(e))}},(e,t)=>Object(h.l)(t,["updateContact","deleteUser","closeManagement","openChat","deleteHistory"]))(({userId:e,user:t,chat:a,progress:s,isMuted:c,updateContact:o,deleteUser:l,deleteHistory:i,closeManagement:d,openChat:m,onClose:u,isActive:h})=>{const[b,g,p]=Object(xe.a)(),[v,E]=Object(n.r)(!1),[O,f]=Object(n.r)(),j=Object(M.a)();Object(L.a)(h,u);const C=t&&t.firstName||"",y=t&&t.lastName||"",[k,N]=Object(n.r)(C),[S,w]=Object(n.r)(y),[I,P]=Object(n.r)(!c);Object(n.n)(()=>{P(!c)},[c]),Object(n.n)(()=>{E(!1),p()},[p,e]),Object(n.n)(()=>{N(C),w(y)},[C,y,t]),Object(n.n)(()=>{s===r.f.Complete&&(E(!1),f(void 0),p())},[p,s]);const F=Object(n.m)(e=>{N(e.target.value),E(!0)},[]),R=Object(n.m)(e=>{w(e.target.value),E(!0)},[]),T=Object(n.m)(e=>{P(e.target.checked),E(!0)},[]),D=Object(n.m)(()=>{const t=k.trim(),a=S.trim();t.length||f("Please provide first name"),o({userId:e,isMuted:!I,firstName:t,lastName:a})},[k,S,o,e,I]),B=Object(n.m)(()=>{i({chatId:a.id,shouldDeleteForAll:!1}),l({userId:e}),p(),d(),m({id:void 0})},[a.id,p,d,i,l,m,e]);if(!t)return;const U=s===r.f.InProgress;return n.a.createElement("div",{className:"Management"},n.a.createElement("div",{className:"custom-scroll"},n.a.createElement("div",{className:"section"},n.a.createElement(fe.a,{userId:t.id,avatarSize:"jumbo",status:"original name",withFullInfo:!0}),n.a.createElement(ve.a,{id:"user-first-name",label:j("UserInfo.FirstNamePlaceholder"),onChange:F,value:k,error:"Please provide first name"===O?O:void 0}),n.a.createElement(ve.a,{id:"user-last-name",label:j("UserInfo.LastNamePlaceholder"),onChange:R,value:S}),n.a.createElement("div",{className:"ListItem no-selection narrow"},n.a.createElement(Jt.a,{checked:I,label:j("Notifications"),subLabel:j(I?"UserInfo.NotificationsEnabled":"UserInfo.NotificationsDisabled"),onChange:T}))),n.a.createElement("div",{className:"section"},n.a.createElement(Oe.a,{icon:"delete",ripple:!0,destructive:!0,onClick:g},j("DeleteContact")))),n.a.createElement(Dt.a,{isShown:v,onClick:D,disabled:U,ariaLabel:j("Save")},U?n.a.createElement(A.a,{color:"white"}):n.a.createElement("i",{className:"icon-check"})),n.a.createElement(Pe.a,{isOpen:b,onClose:p,text:j("AreYouSureDeleteContact"),confirmLabel:j("DeleteContact"),confirmHandler:B,confirmIsDestructive:!0}))}));var Ks=Object(n.h)(Object(s.h)((e,{chatId:t})=>{const a=Object(m.g)(e,t),{progress:n}=e.management,s=Boolean(a.fullInfo&&a.fullInfo.linkedChatId),c=Object(u.lb)(a);return{chat:a,progress:n,isBasicGroup:c,hasLinkedChannel:s,canChangeInfo:c?a.isCreator:Object(u.p)(a,"changeInfo"),canBanUsers:c?a.isCreator:Object(u.p)(a,"banUsers")}},(e,t)=>Object(h.l)(t,["togglePreHistoryHidden","updateChat","closeManagement","leaveChannel","deleteChannel","deleteChat","openChat"]))(({chatId:e,chat:t,progress:a,isBasicGroup:s,hasLinkedChannel:o,canChangeInfo:l,canBanUsers:i,onScreenSelect:d,togglePreHistoryHidden:m,updateChat:h,deleteChat:b,leaveChannel:g,deleteChannel:p,closeManagement:v,openChat:O,onClose:f,isActive:j})=>{const[C,y,k]=Object(xe.a)(),N=t.title,S=t.fullInfo&&t.fullInfo.about||"",[w,I]=Object(n.r)(!1),[P,F]=Object(n.r)(N),[R,T]=Object(n.r)(S),[D,B]=Object(n.r)(),[x,G]=Object(n.r)(),z=Object(u.e)(t),q=Object(E.a)(z,!1,c.ApiMediaFormat.BlobUrl),_=Object(M.a)();Object(L.a)(j,f),Object(n.n)(()=>{a===r.f.Complete&&(I(!1),G(void 0))},[a]);const H=Object(n.m)(()=>{d(r.g.ChatPrivacyType)},[d]),$=Object(n.m)(()=>{d(r.g.Discussion)},[d]),V=Object(n.m)(()=>{d(r.g.GroupPermissions)},[d]),W=Object(n.m)(()=>{d(r.g.ChatAdministrators)},[d]),K=Object(n.m)(e=>{B(e),I(!0)},[]),Y=Object(n.m)(e=>{F(e.target.value),I(!0)},[]),Q=Object(n.m)(e=>{T(e.target.value),I(!0)},[]),J=Object(n.m)(()=>{const t=P.trim(),a=R.trim();t.length?h({chatId:e,title:t,about:a,photo:D}):G("Group title can't be empty")},[R,e,D,P,h]),Z=Object(n.m)(()=>{d(r.g.GroupMembers)},[d]),X=Object(n.m)(()=>{if(!t.fullInfo)return;const{isPreHistoryHidden:e}=t.fullInfo;m({chatId:t.id,isEnabled:!e})},[t,m]),ee=Object(n.p)(()=>{if(!t.defaultBannedRights)return 0;let e=["sendMessages","sendMedia","embedLinks","sendPolls","changeInfo","inviteUsers","pinMessages"].filter(e=>!t.defaultBannedRights[e]).length;const{sendStickers:a,sendGifs:n}=t.defaultBannedRights;return a||n||(e+=1),e},[t]),te=t.fullInfo&&t.fullInfo.adminMembers&&t.fullInfo.adminMembers.length||0,ae=Object(n.m)(()=>{s?b({chatId:t.id}):t.isCreator?p({chatId:t.id}):g({chatId:t.id}),k(),v(),O({id:void 0})},[s,t.isCreator,t.id,k,v,g,p,b,O]);if(t.isRestricted)return;const ne=a===r.f.InProgress;return n.a.createElement("div",{className:"Management"},n.a.createElement("div",{className:"custom-scroll"},n.a.createElement("div",{className:"section"},n.a.createElement(Tt.a,{currentAvatarBlobUrl:q,onChange:K,disabled:!l}),n.a.createElement(ve.a,{id:"group-title",label:_("GroupName"),onChange:Y,value:P,error:"Group title can't be empty"===x?x:void 0,disabled:!l}),n.a.createElement(ve.a,{id:"group-about",className:"mb-2",label:_("DescriptionPlaceholder"),onChange:Q,value:R,disabled:!l}),t.isCreator&&n.a.createElement(Oe.a,{icon:"lock",multiline:!0,onClick:H},n.a.createElement("span",{className:"title"},_("GroupType")),n.a.createElement("span",{className:"subtitle"},t.username?_("TypePublic"):_("TypePrivate"))),o&&n.a.createElement(Oe.a,{icon:"message",multiline:!0,onClick:$},n.a.createElement("span",{className:"title"},_("LinkedChannel")),n.a.createElement("span",{className:"subtitle"},_("DiscussionUnlink"))),n.a.createElement(Oe.a,{icon:"permissions",multiline:!0,onClick:V,disabled:!i},n.a.createElement("span",{className:"title"},_("ChannelPermissions")),n.a.createElement("span",{className:"subtitle",dir:"auto"},ee,"/",8)),n.a.createElement(Oe.a,{icon:"admin",multiline:!0,onClick:W},n.a.createElement("span",{className:"title"},_("ChannelAdministrators")),n.a.createElement("span",{className:"subtitle"},Object(sa.a)(te)))),n.a.createElement("div",{className:"section"},n.a.createElement(Oe.a,{icon:"group",multiline:!0,onClick:Z},n.a.createElement("span",{className:"title"},_("GroupMembers")),n.a.createElement("span",{className:"subtitle"},Object(sa.a)(t.membersCount))),t.fullInfo&&n.a.createElement("div",{className:"ListItem narrow no-selection"},n.a.createElement(Jt.a,{checked:!t.fullInfo.isPreHistoryHidden,label:_("ChatHistory"),onChange:X,disabled:!i}))),n.a.createElement("div",{className:"section"},n.a.createElement(Oe.a,{icon:"delete",ripple:!0,destructive:!0,onClick:y},_("DeleteMega")))),n.a.createElement(Dt.a,{isShown:w,onClick:J,disabled:ne,ariaLabel:_("Save")},ne?n.a.createElement(A.a,{color:"white"}):n.a.createElement("i",{className:"icon-check"})),n.a.createElement(Pe.a,{isOpen:C,onClose:k,textParts:Object(U.a)(s||!t.isCreator?_("AreYouSureDeleteAndExit"):_("AreYouSureDeleteThisChatWithGroup",t.title),["br","simple_markdown"]),confirmLabel:s||!t.isCreator?_("DeleteMega"):_("DeleteGroupForAll"),confirmHandler:ae,confirmIsDestructive:!0}))}));var Ys=Object(n.h)(Object(s.h)((e,{chatId:t})=>({chat:Object(m.g)(e,t),currentUserId:e.currentUserId}),(e,t)=>Object(h.l)(t,["updateChatDefaultBannedRights"]))(({onScreenSelect:e,onChatMemberSelect:t,chat:a,currentUserId:s,updateChatDefaultBannedRights:c,onClose:o,isActive:l})=>{const[i,d]=Object(n.r)({}),[m,u]=Object(n.r)(!1),[h,b]=Object(n.r)(!1),g=Object(M.a)();Object(L.a)(l,o);const p=Object(n.m)(()=>{e(r.g.GroupRemovedUsers)},[e]),v=Object(n.m)(()=>{e(r.g.GroupUserPermissionsCreate)},[e]),E=Object(n.m)(a=>{t(a.userId,a.promotedByUserId===s),e(r.g.GroupUserPermissions)},[s,t,e]);Object(n.n)(()=>{d(a&&a.defaultBannedRights||{}),u(!1),setTimeout(()=>{b(!1)},250)},[a]);const O=Object(n.m)(e=>{const{name:t}=e.target;function a(e){return!e||void 0}d(e=>({...e,[t]:a(e[t]),..."sendStickers"===t&&{sendGifs:a(e[t])}})),u(!0)},[]),f=Object(n.m)(()=>{a&&(b(!0),c({chatId:a.id,bannedRights:i}))},[a,i,c]),j=Object(n.p)(()=>a&&a.fullInfo&&a.fullInfo.kickedMembers?a.fullInfo.kickedMembers.length:0,[a]),C=Object(n.p)(()=>a&&a.fullInfo&&a.fullInfo.members?a.fullInfo.members.filter(({bannedRights:e})=>!!e):[],[a]),y=Object(n.m)(e=>{const{bannedRights:t}=e;if(!t||!a)return;const{defaultBannedRights:n}=a;return Object.keys(t).reduce((e,a)=>{if(!t[a]||n&&n[a]||"sendInline"===a||"viewMessages"===a||"sendGames"===a)return e;const s=function(e){switch(e){case"sendMessages":return"UserRestrictionsNoSend";case"sendMedia":return"UserRestrictionsNoSendMedia";case"sendStickers":return"UserRestrictionsNoSendStickers";case"embedLinks":return"UserRestrictionsNoEmbedLinks";case"sendPolls":return"UserRestrictionsNoSendPolls";case"changeInfo":return"UserRestrictionsNoChangeInfo";case"inviteUsers":return"UserRestrictionsInviteUsers";case"pinMessages":return"UserRestrictionsPinMessages";default:return}}(a);if(!s)return e;const c=g(s);return`${e}${e.length?", "+c:c}`},"")},[a,g]);return n.a.createElement("div",{className:"Management"},n.a.createElement("div",{className:"custom-scroll"},n.a.createElement("div",{className:"section"},n.a.createElement("h3",{className:"section-heading",dir:"auto"},g("ChannelPermissionsHeader")),n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(Jt.a,{name:"sendMessages",checked:!i.sendMessages,label:g("UserRestrictionsSend"),blocking:!0,onChange:O})),n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(Jt.a,{name:"sendMedia",checked:!i.sendMedia,label:g("UserRestrictionsSendMedia"),blocking:!0,onChange:O})),n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(Jt.a,{name:"sendStickers",checked:!i.sendStickers&&!i.sendGifs,label:g("UserRestrictionsSendStickers"),blocking:!0,onChange:O})),n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(Jt.a,{name:"sendPolls",checked:!i.sendPolls,label:g("UserRestrictionsSendPolls"),blocking:!0,onChange:O})),n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(Jt.a,{name:"embedLinks",checked:!i.embedLinks,label:g("UserRestrictionsEmbedLinks"),blocking:!0,onChange:O})),n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(Jt.a,{name:"inviteUsers",checked:!i.inviteUsers,label:g("UserRestrictionsInviteUsers"),blocking:!0,onChange:O})),n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(Jt.a,{name:"pinMessages",checked:!i.pinMessages,label:g("UserRestrictionsPinMessages"),blocking:!0,onChange:O})),n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(Jt.a,{name:"changeInfo",checked:!i.changeInfo,label:g("UserRestrictionsChangeInfo"),blocking:!0,onChange:O}))),n.a.createElement("div",{className:"section"},n.a.createElement(Oe.a,{icon:"delete-user",multiline:!0,narrow:!0,onClick:p},n.a.createElement("span",{className:"title"},g("ChannelBlockedUsers")),n.a.createElement("span",{className:"subtitle"},j))),n.a.createElement("div",{className:"section"},n.a.createElement("h3",{className:"section-heading",dir:"auto"},g("PrivacyExceptions")),n.a.createElement(Oe.a,{icon:"add-user",onClick:v},g("ChannelAddException")),C.map(e=>n.a.createElement(Oe.a,{key:e.userId,className:"chat-item-clickable exceptions-member",onClick:()=>E(e)},n.a.createElement(fe.a,{userId:e.userId,status:y(e)}))))),n.a.createElement(Dt.a,{isShown:m,onClick:f,ariaLabel:g("Save"),disabled:h},h?n.a.createElement(A.a,{color:"white"}):n.a.createElement("i",{className:"icon-check"})))}));var Qs=Object(n.h)(Object(s.h)((e,{chatId:t})=>{const a=Object(m.g)(e,t),{byId:n}=e.users;return{chat:a,usersById:n}},(e,t)=>Object(h.l)(t,["updateChatMemberBannedRights"]))(({chat:e,usersById:t,updateChatMemberBannedRights:a,onClose:s,isActive:c})=>{const r=Object(M.a)();Object(L.a)(c,s);const o=Object(n.p)(()=>e&&e.fullInfo&&e.fullInfo.kickedMembers?e.fullInfo.kickedMembers:[],[e]),l=Object(n.m)(e=>{if(!e.kickedByUserId)return;const a=t[e.kickedByUserId];return a?r("UserRemovedBy",Object(u.bb)(a)):void 0},[r,t]),i=Object(n.m)(t=>{if(e)return[{title:r("Unblock"),icon:"delete",destructive:!0,handler:()=>a({chatId:e.id,userId:t.userId,bannedRights:{}})}]},[r,e,a]);return n.a.createElement("div",{className:"Management"},n.a.createElement("div",{className:"custom-scroll"},n.a.createElement("div",{className:"section",dir:r.isRtl?"rtl":void 0},n.a.createElement("p",{className:"text-muted"},r("NoBlockedGroup2")),o.map(e=>n.a.createElement(Oe.a,{key:e.userId,className:"chat-item-clickable",ripple:!0,contextActions:i(e)},n.a.createElement(fe.a,{userId:e.userId,status:l(e)}))))))}));var Js=Object(n.h)(Object(s.h)((e,{chatId:t})=>{const a=Object(m.g)(e,t),{progress:n}=e.management;return{chat:a,progress:n,isSignaturesShown:Boolean(a&&a.isSignaturesShown),canChangeInfo:Object(u.p)(a,"changeInfo")}},(e,t)=>Object(h.l)(t,["toggleSignatures","updateChat","closeManagement","leaveChannel","deleteChannel","openChat"]))(({chatId:e,chat:t,progress:a,isSignaturesShown:s,canChangeInfo:o,onScreenSelect:l,updateChat:i,toggleSignatures:d,closeManagement:m,leaveChannel:h,deleteChannel:b,openChat:g,onClose:p,isActive:v})=>{const O=t&&t.title||"",f=t&&t.fullInfo&&t.fullInfo.about||"",j=t&&t.fullInfo&&t.fullInfo.linkedChatId,[C,y,k]=Object(xe.a)(),[N,S]=Object(n.r)(!1),[w,I]=Object(n.r)(O),[P,F]=Object(n.r)(f),[R,T]=Object(n.r)(),[D,B]=Object(n.r)(),U=t&&Object(u.e)(t),x=Object(E.a)(U,!1,c.ApiMediaFormat.BlobUrl),G=Object(M.a)();Object(L.a)(v,p),Object(n.n)(()=>{a===r.f.Complete&&(S(!1),B(void 0))},[a]);const z=t&&t.fullInfo&&t.fullInfo.adminMembers&&t.fullInfo.adminMembers.length||0,q=Object(n.m)(()=>{l(r.g.ChatPrivacyType)},[l]),_=Object(n.m)(()=>{l(r.g.Discussion)},[l]),H=Object(n.m)(()=>{l(r.g.ChatAdministrators)},[l]),$=Object(n.m)(e=>{T(e),S(!0)},[]),V=Object(n.m)(e=>{I(e.target.value),S(!0)},[]),W=Object(n.m)(e=>{F(e.target.value),S(!0)},[]),K=Object(n.m)(()=>{const t=w.trim(),a=P.trim();t.length?i({chatId:e,title:t,about:a,photo:R}):B("Channel title can't be empty")},[P,e,R,w,i]),Y=Object(n.m)(()=>{d({chatId:e,isEnabled:!s})},[e,s,d]),Q=Object(n.m)(()=>{l(r.g.ChannelSubscribers)},[l]),J=Object(n.m)(()=>{t.isCreator?b({chatId:t.id}):h({chatId:t.id}),k(),m(),g({id:void 0})},[t.isCreator,t.id,k,m,h,b,g]);if(t.isRestricted)return;const Z=a===r.f.InProgress;return n.a.createElement("div",{className:"Management"},n.a.createElement("div",{className:"custom-scroll"},n.a.createElement("div",{className:"section"},n.a.createElement(Tt.a,{currentAvatarBlobUrl:x,onChange:$,disabled:!o}),n.a.createElement(ve.a,{id:"channel-title",label:G("EnterChannelName"),onChange:V,value:w,error:"Channel title can't be empty"===D?D:void 0,disabled:!o}),n.a.createElement(ve.a,{id:"channel-about",className:"mb-2",label:G("DescriptionPlaceholder"),onChange:W,value:P,disabled:!o}),t.isCreator&&n.a.createElement(Oe.a,{icon:"lock",multiline:!0,onClick:q},n.a.createElement("span",{className:"title"},G("ChannelType")),n.a.createElement("span",{className:"subtitle"},t.username?G("TypePublic"):G("TypePrivate"))),n.a.createElement(Oe.a,{icon:"message",multiline:!0,onClick:_,disabled:!o},n.a.createElement("span",{className:"title"},G("Discussion")),n.a.createElement("span",{className:"subtitle"},G(j?"DiscussionUnlink":"Add"))),n.a.createElement(Oe.a,{icon:"admin",multiline:!0,onClick:H},n.a.createElement("span",{className:"title"},G("ChannelAdministrators")),n.a.createElement("span",{className:"subtitle"},z)),n.a.createElement("div",{className:"ListItem no-selection narrow"},n.a.createElement(Jt.a,{checked:s,label:G("ChannelSignMessages"),onChange:Y}))),n.a.createElement("div",{className:"section"},n.a.createElement(Oe.a,{icon:"group",multiline:!0,onClick:Q},n.a.createElement("span",{className:"title",dir:"auto"},G("ChannelSubscribers")),n.a.createElement("span",{className:"subtitle",dir:"auto"},G("Subscribers",t.membersCount,"i")))),n.a.createElement("div",{className:"section"},n.a.createElement(Oe.a,{icon:"delete",ripple:!0,destructive:!0,onClick:y},t.isCreator?G("ChannelDelete"):G("LeaveChannel")))),n.a.createElement(Dt.a,{isShown:N,onClick:K,disabled:Z,ariaLabel:G("Save")},Z?n.a.createElement(A.a,{color:"white"}):n.a.createElement("i",{className:"icon-check"})),n.a.createElement(Pe.a,{isOpen:C,onClose:k,text:t.isCreator?G("ChannelDeleteAlert"):G("ChannelLeaveAlert"),confirmLabel:t.isCreator?G("ChannelDelete"):G("LeaveChannel"),confirmHandler:J,confirmIsDestructive:!0}))})),Zs=a(59);var Xs=Object(n.h)(Object(s.h)((e,{chatId:t})=>{const a=Object(m.g)(e,t),{isUsernameAvailable:n}=Object(m.ab)(e,t);return{chat:a,isChannel:Object(u.mb)(a),progress:e.management.progress,isUsernameAvailable:n}},(e,t)=>Object(h.l)(t,["checkPublicLink","updatePublicLink","updatePrivateLink"]))(({chat:e,onClose:t,isActive:a,isChannel:s,progress:c,isUsernameAvailable:o,checkPublicLink:l,updatePublicLink:i,updatePrivateLink:d})=>{const m=Boolean(e.username),u=e.fullInfo&&e.fullInfo.inviteLink,[h,b]=Object(n.r)(m?"public":"private"),[g,p]=Object(n.r)(),[v,E,O]=Object(xe.a)(),f="public"===h&&g&&o||"private"===h&&m;Object(L.a)(a,t),Object(n.n)(()=>{h&&!u&&d()},[h,u,d]);const j=Object(n.m)(e=>{b(e)},[]),C=Object(n.m)(()=>{i({username:"public"===h?g:""})},[h,i,g]),y=Object(n.m)(()=>{O(),d()},[O,d]),k=Object(M.a)(),N=s?"Channel":"Mega",S=s?"Channel":"Group",w=[{value:"private",label:k(N+"Private"),subLabel:k(N+"PrivateInfo")},{value:"public",label:k(N+"Public"),subLabel:k(N+"PublicInfo")}],I=c===r.f.InProgress;return n.a.createElement("div",{className:"Management"},n.a.createElement("div",{className:"custom-scroll"},n.a.createElement("div",{className:"section",dir:k.isRtl?"rtl":void 0},n.a.createElement("h3",{className:"section-heading"},k(S+"Type")),n.a.createElement(qe.a,{selected:h,name:"channel-type",options:w,onChange:j})),"private"===h?n.a.createElement("div",{className:"section",dir:k.isRtl?"rtl":void 0},u?n.a.createElement(n.a.Fragment,null,n.a.createElement(Zs.a,{url:u,className:"group-link",text:u}),n.a.createElement("p",{className:"section-info",dir:k.isRtl?"rtl":void 0},k(N+"PrivateLinkHelp")),n.a.createElement(Oe.a,{icon:"delete",ripple:!0,destructive:!0,onClick:E},k("RevokeLink")),n.a.createElement(Pe.a,{isOpen:v,onClose:O,text:k("RevokeAlert"),confirmLabel:k("RevokeButton"),confirmHandler:y,confirmIsDestructive:!0})):n.a.createElement(ge.a,null)):n.a.createElement("div",{className:"section no-border"},n.a.createElement(Gt,{asLink:!0,currentUsername:e.username,isLoading:I,isUsernameAvailable:o,checkUsername:l,onChange:p}),n.a.createElement("p",{className:"section-info",dir:"auto"},k(S+".Username.CreatePublicLinkHelp")))),n.a.createElement(Dt.a,{isShown:f,disabled:I,ariaLabel:k("Save"),onClick:C},I?n.a.createElement(A.a,{color:"white"}):n.a.createElement("i",{className:"icon-check"})))}));var ec=Object(n.h)(Object(s.h)((e,{chatId:t})=>{const a=Object(m.g)(e,t),{forDiscussionIds:n,byId:s}=e.chats;return{chat:a,chatsByIds:s,forDiscussionIds:n,linkedChat:a&&a.fullInfo&&a.fullInfo.linkedChatId?Object(m.g)(e,a.fullInfo.linkedChatId):void 0,isChannel:a&&Object(u.mb)(a)}},(e,t)=>Object(h.l)(t,["loadGroupsForDiscussion","linkDiscussionGroup","unlinkDiscussionGroup"]))(({chat:e,onClose:t,isActive:a,chatId:s,chatsByIds:c,linkedChat:l,forDiscussionIds:i,isChannel:d,onScreenSelect:m,loadGroupsForDiscussion:u,linkDiscussionGroup:h,unlinkDiscussionGroup:b})=>{const[g,p]=Object(n.r)(),[v,E]=Object(n.r)(),[O,f]=Object(n.r)(!1),j=Object(n.m)(()=>f(!0),[]),[C,y,k]=Object(xe.a)(),[N,S,w]=Object(xe.a)(),I=Object(M.a)(),P=l&&l.id;Object(L.a)(a,t),Object(n.n)(()=>{u()},[u]),Object(n.n)(()=>{v||Object(_t.a)("DiscussionGroups").then(E)},[v]);const F=Object(n.m)(()=>{k(),b({channelId:d?s:P}),d||m(r.g.Initial)},[k,b,d,s,P,m]),A=Object(n.m)(()=>{w(),h({channelId:s,chatId:g})},[w,h,s,g]);function R(){const e=c[g];if(e)return n.a.createElement("div",{className:"modal-header"},n.a.createElement(x.a,{size:"tiny",chat:e}),n.a.createElement("div",{className:"modal-title"},I("Channel.DiscussionGroup.LinkGroup")))}function T(){const t=c[g];if(t)return t.hasPrivateLink?Object(U.a)(`Do you want to make **${t.title}** the discussion board for **${e.title}**?`,["br","simple_markdown"]):Object(U.a)(`Do you want to make **${t.title}** the discussion board for **${e.title}**?\n\nAnyone from the channel will be able to see messages in this group.`,["br","simple_markdown"])}return n.a.createElement("div",{className:"Management"},n.a.createElement("div",{className:"custom-scroll"},n.a.createElement("div",{className:"section"},n.a.createElement("div",{className:"section-icon"},v&&n.a.createElement(Ht.a,{id:"discussionGroupsDucks",size:o.Eb,animationData:v,play:O,noLoop:!0,onLoad:j})),l&&n.a.createElement("div",null,n.a.createElement(Oe.a,{className:"chat-item-clickable",inactive:!0},n.a.createElement(je.a,{chatId:l.id})),n.a.createElement(Oe.a,{icon:"delete",ripple:!0,destructive:!0,onClick:y},I(d?"DiscussionUnlinkGroup":"DiscussionUnlinkChannel")),n.a.createElement(Pe.a,{isOpen:C,onClose:k,header:n.a.createElement("div",{className:"modal-header"},n.a.createElement(x.a,{size:"tiny",chat:l}),n.a.createElement("div",{className:"modal-title"},I(d?"DiscussionUnlinkGroup":"DiscussionUnlinkChannel"))),textParts:Object(U.a)(I(d?"DiscussionUnlinkChannelAlert":"DiscussionUnlinkGroupAlert",l.title),["br","simple_markdown"]),confirmLabel:I(d?"DiscussionUnlinkGroup":"DiscussionUnlinkChannel"),confirmHandler:F,confirmIsDestructive:!0})),!l&&n.a.createElement("div",null,n.a.createElement("p",{className:"section-help",dir:"auto"},I("DiscussionChannelHelp")),n.a.createElement("div",{teactFastList:!0},n.a.createElement(Oe.a,{key:"create-group",icon:"group",ripple:!0,teactOrderKey:0,className:"not-implemented"},I("DiscussionCreateGroup")),i?i.map((e,t)=>n.a.createElement(Oe.a,{key:e,teactOrderKey:t+1,className:"chat-item-clickable scroll-item",onClick:()=>{p(e),S()}},n.a.createElement(je.a,{chatId:e}))):n.a.createElement(st.a,{key:"nothing-found",teactOrderKey:0,text:"No discussion groups found"})),n.a.createElement("p",{className:"mt-4 mb-0 section-help",dir:"auto"},I("DiscussionChannelHelp2")),n.a.createElement(Pe.a,{isOpen:N,onClose:w,header:R(),textParts:T(),confirmLabel:I("DiscussionLinkGroup"),confirmHandler:A,isButtonsInOneRow:!0})))))}));var tc=Object(n.h)(Object(s.h)((e,{chatId:t,isPromotedByCurrentUser:a})=>{const n=Object(m.g)(e,t);return{chat:n,isFormFullyDisabled:!(n.isCreator||a)}},(e,t)=>Object(h.l)(t,["updateChatMemberBannedRights"]))(({chat:e,selectedChatMemberId:t,onScreenSelect:a,updateChatMemberBannedRights:s,isFormFullyDisabled:c,onClose:o,isActive:l})=>{const[i,d]=Object(n.r)({}),[m,u]=Object(n.r)(!1),[h,b]=Object(n.r)(!1),[g,p,v]=Object(xe.a)(),E=Object(M.a)();Object(L.a)(l,o);const O=Object(n.p)(()=>{if(e&&e.fullInfo&&e.fullInfo.members)return e.fullInfo.members.find(({userId:e})=>e===t)},[e,t]);Object(n.n)(()=>{e&&e.fullInfo&&t&&!O&&a(r.g.GroupPermissions)},[e,a,O,t]),Object(n.n)(()=>{d(O&&O.bannedRights||e&&e.defaultBannedRights||{}),u(!1),b(!1)},[e,O]);const f=Object(n.m)(e=>{const{name:t}=e.target;function a(e){return!e||void 0}d(e=>({...e,[t]:a(e[t]),..."sendStickers"===t&&{sendGifs:a(e[t])}})),u(!0)},[]),j=Object(n.m)(()=>{e&&t&&(b(!0),s({chatId:e.id,userId:t,bannedRights:i}))},[e,t,i,s]),C=Object(n.m)(()=>{e&&t&&s({chatId:e.id,userId:t,bannedRights:{viewMessages:!0}})},[e,t,s]),y=Object(n.m)(t=>!!c||!(!e||!e.defaultBannedRights)&&e.defaultBannedRights[t],[e,c]);if(O)return n.a.createElement("div",{className:"Management"},n.a.createElement("div",{className:"custom-scroll"},n.a.createElement("div",{className:"section"},n.a.createElement(Oe.a,{inactive:!0,className:"chat-item-clickable"},n.a.createElement(fe.a,{userId:O.userId})),n.a.createElement("h3",{className:"section-heading mt-4",dir:"auto"},E("UserRestrictionsCanDo")),n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(Jt.a,{name:"sendMessages",checked:!i.sendMessages,label:E("UserRestrictionsSend"),blocking:!0,disabled:y("sendMessages"),onChange:f})),n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(Jt.a,{name:"sendMedia",checked:!i.sendMedia,label:E("UserRestrictionsSendMedia"),blocking:!0,disabled:y("sendMedia"),onChange:f})),n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(Jt.a,{name:"sendStickers",checked:!i.sendStickers&&!i.sendGifs,label:E("UserRestrictionsSendStickers"),blocking:!0,disabled:y("sendStickers"),onChange:f})),n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(Jt.a,{name:"sendPolls",checked:!i.sendPolls,label:E("UserRestrictionsSendPolls"),blocking:!0,disabled:y("sendPolls"),onChange:f})),n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(Jt.a,{name:"embedLinks",checked:!i.embedLinks,label:E("UserRestrictionsEmbedLinks"),blocking:!0,disabled:y("embedLinks"),onChange:f})),n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(Jt.a,{name:"inviteUsers",checked:!i.inviteUsers,label:E("UserRestrictionsInviteUsers"),blocking:!0,disabled:y("inviteUsers"),onChange:f})),n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(Jt.a,{name:"pinMessages",checked:!i.pinMessages,label:E("UserRestrictionsPinMessages"),blocking:!0,disabled:y("pinMessages"),onChange:f})),n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(Jt.a,{name:"changeInfo",checked:!i.changeInfo,label:E("UserRestrictionsChangeInfo"),blocking:!0,disabled:y("changeInfo"),onChange:f}))),!c&&n.a.createElement("div",{className:"section"},n.a.createElement(Oe.a,{icon:"delete-user",ripple:!0,destructive:!0,onClick:p},E("UserRestrictionsBlock")))),n.a.createElement(Dt.a,{isShown:m,onClick:j,ariaLabel:E("Save"),disabled:h},h?n.a.createElement(A.a,{color:"white"}):n.a.createElement("i",{className:"icon-check"})),n.a.createElement(Pe.a,{isOpen:g,onClose:v,text:"Are you sure you want to ban and remove this user from the group?",confirmLabel:"Remove",confirmHandler:C,confirmIsDestructive:!0}))}));var ac=Object(n.h)(Object(s.h)((e,{chatId:t})=>{const a=Object(m.g)(e,t),{byId:n}=e.users;return{chat:a,currentUserId:e.currentUserId,isChannel:Object(u.mb)(a),usersById:n}})(({chat:e,isChannel:t,currentUserId:a,usersById:s,onScreenSelect:c,onChatMemberSelect:o,onClose:l,isActive:i})=>{const d=Object(M.a)();Object(L.a)(i,l);const m=Object(n.p)(()=>e.fullInfo&&e.fullInfo.adminMembers?e.fullInfo.adminMembers.sort((e,t)=>e.isOwner?-1:t.isOwner?1:0):[],[e]),h=Object(n.m)(e=>{o(e.userId,e.promotedByUserId===a),c(r.g.ChatAdminRights)},[a,o,c]),b=Object(n.m)(e=>{if(e.isOwner)return d("ChannelCreator");const t=e.promotedByUserId?s[e.promotedByUserId]:void 0;return t?d("EditAdminPromotedBy",Object(u.bb)(t)):d("ChannelAdmin")},[d,s]);return n.a.createElement("div",{className:"Management"},n.a.createElement("div",{className:"custom-scroll"},n.a.createElement("div",{className:"section"},n.a.createElement(Oe.a,{icon:"recent",multiline:!0,onClick:function(){c(r.g.GroupRecentActions)}},n.a.createElement("span",{className:"title"},d("EventLog")),n.a.createElement("span",{className:"subtitle"},d(t?"EventLogInfoDetailChannel":"EventLogInfoDetail")))),n.a.createElement("div",{className:"section",dir:d.isRtl?"rtl":void 0},n.a.createElement("p",{className:"text-muted",dir:"auto"},t?"You can add administrators to help you manage your channel.":"You can add administrators to help you manage your group."),m.map(e=>n.a.createElement(Oe.a,{key:e.userId,className:"chat-item-clickable",onClick:()=>h(e)},n.a.createElement(fe.a,{userId:e.userId,status:b(e),forceShowSelf:!0}))))))}));var nc=Object(n.h)(Object(s.h)((e,{chatId:t})=>({chat:Object(m.g)(e,t)}))(({chat:e,onClose:t,isActive:a})=>{const s=Object(M.a)();Object(L.a)(a,t);const c=Object(n.p)(()=>e&&e.fullInfo&&e.fullInfo.adminMembers?e.fullInfo.adminMembers.sort((e,t)=>e.isOwner?-1:t.isOwner?1:0):[],[e]),r=Object(n.m)(e=>e.isOwner?s("ChannelCreator"):s("ChannelAdmin"),[s]);return n.a.createElement("div",{className:"Management"},n.a.createElement("div",{className:"custom-scroll"},n.a.createElement("div",{className:"section not-implemented",dir:s.isRtl?"rtl":void 0},n.a.createElement("h3",{className:"section-heading",dir:"auto"},"Actions"),n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(Jt.a,{name:"changeInfo",checked:!0,label:s("EventLogAllEvents"),onChange:void 0})),n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(Jt.a,{name:"changeInfo",checked:!0,label:s("EventLogFilterNewAdmins"),onChange:void 0})),n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(Jt.a,{name:"changeInfo",checked:!0,label:s("EventLogFilterNewMembers"),onChange:void 0})),n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(Jt.a,{name:"changeInfo",checked:!0,label:s("EventLogFilterChannelInfo"),onChange:void 0})),n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(Jt.a,{name:"changeInfo",checked:!0,label:s("EventLogFilterDeletedMessages"),onChange:void 0})),n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(Jt.a,{name:"changeInfo",checked:!0,label:s("EventLogFilterEditedMessages"),onChange:void 0})),n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(Jt.a,{name:"changeInfo",checked:!0,label:s("EventLogFilterLeavingMembers"),onChange:void 0}))),n.a.createElement("div",{className:"section not-implemented",dir:s.isRtl?"rtl":void 0},n.a.createElement("h3",{className:"section-heading",dir:"auto"},s("Channel.Management.Title")),n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(Jt.a,{name:"changeInfo",checked:!0,label:s("EventLogAllAdmins"),onChange:void 0})),c.map(e=>n.a.createElement(Oe.a,{key:e.userId,className:"chat-item-clickable picker-list-item",onClick:void 0,ripple:!0},n.a.createElement(Jt.a,{label:"",checked:!0}),n.a.createElement(fe.a,{userId:e.userId,status:r(e),forceShowSelf:!0}))))))}));var sc=Object(n.h)(Object(s.h)((e,{chatId:t,isPromotedByCurrentUser:a})=>{const n=Object(m.g)(e,t),{byId:s}=e.users,{currentUserId:c}=e;return{chat:n,usersById:s,currentUserId:c,isChannel:Object(u.mb)(n),isFormFullyDisabled:!(n.isCreator||a)}},(e,t)=>Object(h.l)(t,["updateChatAdmin"]))(({selectedChatMemberId:e,onScreenSelect:t,chat:a,usersById:s,currentUserId:c,isChannel:o,isFormFullyDisabled:l,updateChatAdmin:i,onClose:d,isActive:m})=>{const[h,b]=Object(n.r)({}),[g,p]=Object(n.r)(!1),[v,E]=Object(n.r)(!1),[O,f,j]=Object(xe.a)(),[C,y]=Object(n.r)(""),k=Object(M.a)();Object(L.a)(m,d);const N=Object(n.p)(()=>{if(a.fullInfo&&a.fullInfo.adminMembers)return a.fullInfo.adminMembers.find(({userId:t})=>t===e)},[a,e]);Object(n.n)(()=>{a&&a.fullInfo&&e&&!N&&t(r.g.ChatAdministrators)},[a,t,N,e]),Object(n.n)(()=>{b(N&&N.adminRights||{}),y((N&&N.customTitle||"").substr(0,16)),p(!1),E(!1)},[N]);const S=Object(n.m)(e=>{const{name:t}=e.target;b(e=>{return{...e,[t]:(a=e[t],!a||void 0)};var a}),p(!0)},[]),w=Object(n.m)(()=>{e&&(E(!0),i({chatId:a.id,userId:e,adminRights:h,customTitle:C}))},[a,e,h,C,i]),I=Object(n.m)(()=>{e&&(i({chatId:a.id,userId:e,adminRights:{}}),j())},[a.id,j,e,i]),P=Object(n.m)(e=>!Object(u.lb)(a)&&(!(!l&&a.adminRights)||!a.adminRights[e]),[a,l]),F=Object(n.p)(()=>{if(!N)return;if(N.isOwner)return k("ChannelCreator");const e=N.promotedByUserId?s[N.promotedByUserId]:void 0;return e?k("EditAdminPromotedBy",Object(u.bb)(e)):k("ChannelAdmin")},[N,s,k]),R=Object(n.m)(e=>{const{value:t}=e.target;y(t),p(!0)},[]);if(N)return n.a.createElement("div",{className:"Management"},n.a.createElement("div",{className:"custom-scroll"},n.a.createElement("div",{className:"section"},n.a.createElement(Oe.a,{inactive:!0,className:"chat-item-clickable"},n.a.createElement(fe.a,{userId:N.userId,status:F,forceShowSelf:!0})),n.a.createElement("h3",{className:"section-heading mt-4",dir:"auto"},k("EditAdminWhatCanDo")),n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(Jt.a,{name:"changeInfo",checked:!!h.changeInfo,label:k(o?"EditAdminChangeChannelInfo":"EditAdminChangeGroupInfo"),blocking:!0,disabled:P("changeInfo"),onChange:S})),o&&n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(Jt.a,{name:"postMessages",checked:!!h.postMessages,label:k("EditAdminPostMessages"),blocking:!0,disabled:P("postMessages"),onChange:S})),o&&n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(Jt.a,{name:"editMessages",checked:!!h.editMessages,label:k("EditAdminEditMessages"),blocking:!0,disabled:P("editMessages"),onChange:S})),n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(Jt.a,{name:"deleteMessages",checked:!!h.deleteMessages,label:k(o?"EditAdminDeleteMessages":"EditAdminGroupDeleteMessages"),blocking:!0,disabled:P("deleteMessages"),onChange:S})),!o&&n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(Jt.a,{name:"banUsers",checked:!!h.banUsers,label:k("EditAdminBanUsers"),blocking:!0,disabled:P("banUsers"),onChange:S})),n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(Jt.a,{name:"inviteUsers",checked:!!h.inviteUsers,label:k("EditAdminAddUsers"),blocking:!0,disabled:P("inviteUsers"),onChange:S})),!o&&n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(Jt.a,{name:"pinMessages",checked:!!h.pinMessages,label:k("EditAdminPinMessages"),blocking:!0,disabled:P("pinMessages"),onChange:S})),n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(Jt.a,{name:"addAdmins",checked:!!h.addAdmins,label:k("EditAdminAddAdmins"),blocking:!0,disabled:P("addAdmins"),onChange:S})),!o&&n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(Jt.a,{name:"anonymous",checked:!!h.anonymous,label:k("EditAdminSendAnonymously"),blocking:!0,disabled:P("anonymous"),onChange:S})),l&&n.a.createElement("p",{className:"section-info mb-4",dir:"auto"},k("Channel.EditAdmin.CannotEdit")),!o&&n.a.createElement(ve.a,{id:"admin-title",label:k("EditAdminRank"),onChange:R,value:C,disabled:l,maxLength:16}),c!==e&&!l&&n.a.createElement(Oe.a,{icon:"delete",ripple:!0,destructive:!0,onClick:f},k("EditAdminRemoveAdmin")))),n.a.createElement(Dt.a,{isShown:g,onClick:w,ariaLabel:k("Save"),disabled:v},v?n.a.createElement(A.a,{color:"white"}):n.a.createElement("i",{className:"icon-check"})),n.a.createElement(Pe.a,{isOpen:O,onClose:j,text:"Are you sure you want to dismiss this admin?",confirmLabel:"Dismiss",confirmHandler:I,confirmIsDestructive:!0}))}));var cc=Object(n.h)(Object(s.h)((e,{chatId:t})=>{const a=Object(m.g)(e,t),{byId:n}=e.users;return{members:a&&a.fullInfo&&a.fullInfo.members,usersById:n,isChannel:a&&Object(u.mb)(a),serverTimeOffset:e.serverTimeOffset}},(e,t)=>Object(h.l)(t,["openUserInfo"]))(({members:e,usersById:t,isChannel:a,openUserInfo:s,onClose:c,isActive:r,serverTimeOffset:o})=>{const l=Object(n.p)(()=>{if(e&&t)return Object(u.Kb)(e.map(({userId:e})=>e),t,void 0,o)},[e,o,t]),i=Object(n.m)(e=>{s({id:e})},[s]);return Object(L.a)(r,c),n.a.createElement("div",{className:"Management"},n.a.createElement("div",{className:"custom-scroll"},n.a.createElement("div",{className:"section",teactFastList:!0},l?l.map((e,t)=>n.a.createElement(Oe.a,{key:e,teactOrderKey:t,className:"chat-item-clickable scroll-item",onClick:()=>i(e)},n.a.createElement(fe.a,{userId:e,forceShowSelf:!0}))):n.a.createElement(st.a,{teactOrderKey:0,key:"nothing-found",text:a?"No subscribers found":"No members found"}))))}));var rc=Object(n.h)(Object(s.h)((e,{chatId:t})=>{const a=Object(m.g)(e,t),{byId:n}=e.users;return{members:a&&a.fullInfo&&a.fullInfo.members,usersById:n,isChannel:a&&Object(u.mb)(a),serverTimeOffset:e.serverTimeOffset}})(({usersById:e,members:t,isChannel:a,onScreenSelect:s,onChatMemberSelect:c,onClose:o,isActive:l,serverTimeOffset:i})=>{Object(L.a)(l,o);const d=Object(n.p)(()=>{if(t&&e)return Object(u.Kb)(t.filter(e=>!e.isOwner).map(({userId:e})=>e),e,void 0,i)},[t,i,e]),m=Object(n.m)(e=>{c(e),s(r.g.GroupUserPermissions)},[c,s]);return n.a.createElement("div",{className:"Management"},n.a.createElement("div",{className:"custom-scroll"},n.a.createElement("div",{className:"section",teactFastList:!0},d?d.map((e,t)=>n.a.createElement(Oe.a,{key:e,teactOrderKey:t,className:"chat-item-clickable scroll-item",onClick:()=>m(e)},n.a.createElement(fe.a,{userId:e,forceShowSelf:!0}))):n.a.createElement(st.a,{teactOrderKey:0,key:"nothing-found",text:a?"No subscribers found":"No members found"}))))}));var oc=Object(n.h)(Object(s.h)(e=>({managementType:Object(m.v)(e)}))(({chatId:e,currentScreen:t,selectedChatMemberId:a,isPromotedByCurrentUser:s,onScreenSelect:c,onChatMemberSelect:o,onClose:l,isActive:i,managementType:d})=>{switch(t){case r.g.Initial:switch(d){case"user":return n.a.createElement(Ws,{key:e,userId:e,onClose:l,isActive:i});case"group":return n.a.createElement(Ks,{key:e,chatId:e,onScreenSelect:c,onClose:l,isActive:i||[r.g.ChatPrivacyType,r.g.Discussion,r.g.GroupPermissions,r.g.ChatAdministrators,r.g.GroupRemovedUsers,r.g.GroupUserPermissionsCreate,r.g.GroupUserPermissions,r.g.ChatAdminRights,r.g.GroupRecentActions].includes(t)});case"channel":return n.a.createElement(Js,{key:e,chatId:e,onScreenSelect:c,onClose:l,isActive:i||[r.g.ChannelSubscribers,r.g.ChatAdministrators,r.g.Discussion,r.g.ChatPrivacyType,r.g.ChatAdminRights,r.g.GroupRecentActions].includes(t)})}break;case r.g.ChatPrivacyType:return n.a.createElement(Xs,{chatId:e,isActive:i,onClose:l});case r.g.Discussion:return n.a.createElement(ec,{chatId:e,onScreenSelect:c,isActive:i,onClose:l});case r.g.GroupPermissions:return n.a.createElement(Ys,{chatId:e,onScreenSelect:c,onChatMemberSelect:o,isActive:i||[r.g.GroupRemovedUsers,r.g.GroupUserPermissionsCreate,r.g.GroupUserPermissions].includes(t),onClose:l});case r.g.GroupRemovedUsers:return n.a.createElement(Qs,{chatId:e,isActive:i,onClose:l});case r.g.GroupUserPermissionsCreate:return n.a.createElement(rc,{chatId:e,onChatMemberSelect:o,onScreenSelect:c,isActive:i||[r.g.GroupUserPermissions].includes(t),onClose:l});case r.g.GroupUserPermissions:return n.a.createElement(tc,{chatId:e,selectedChatMemberId:a,isPromotedByCurrentUser:s,onScreenSelect:c,isActive:i,onClose:l});case r.g.ChatAdministrators:return n.a.createElement(ac,{chatId:e,onScreenSelect:c,onChatMemberSelect:o,isActive:i||[r.g.ChatAdminRights,r.g.GroupRecentActions].includes(t),onClose:l});case r.g.GroupRecentActions:return n.a.createElement(nc,{chatId:e,isActive:i,onClose:l});case r.g.ChatAdminRights:return n.a.createElement(sc,{chatId:e,selectedChatMemberId:a,isPromotedByCurrentUser:s,onScreenSelect:c,isActive:i,onClose:l});case r.g.ChannelSubscribers:case r.g.GroupMembers:return n.a.createElement(cc,{chatId:e,isActive:i,onClose:l})}}));const lc={USD:"$",EUR:"€",GBP:"£",JPY:"¥",RUB:"₽",UAH:"₴",INR:"₹",AED:"د.إ"};function ic(e){return e&&lc[e]||""}const dc=/^4[0-9]{12}(?:[0-9]{1,3})?$/,mc=/^5[1-5][0-9]{11,14}$/,uc=/^2[2-7][0-9]{11,14}$/;let hc;!function(e){e[e.Default=0]="Default",e[e.Visa=1]="Visa",e[e.Mastercard=2]="Mastercard"}(hc||(hc={}));const bc={[hc.Default]:"",[hc.Visa]:"visa",[hc.Mastercard]:"mastercard"};function gc(e){return e=e.replace(/\s/g,""),dc.test(e)?hc.Visa:mc.test(e)||uc.test(e)?hc.Mastercard:hc.Default}var pc=a(61);const vc={streetLine1:"",streetLine2:"",city:"",state:"",countryIso2:"",postCode:"",fullName:"",email:"",phone:"",shipping:"",cardNumber:"",cardholder:"",expiry:"",cvv:"",billingCountry:"",billingZip:"",saveInfo:!0,saveCredentials:!1,formErrors:{}},Ec=(e,t)=>{switch(t.type){case"changeAddress1":return{...e,streetLine1:t.payload,formErrors:{...e.formErrors,streetLine1:void 0}};case"changeAddress2":return{...e,streetLine2:t.payload,formErrors:{...e.formErrors,streetLine2:void 0}};case"changeCity":return{...e,city:t.payload,formErrors:{...e.formErrors,city:void 0}};case"changeState":return{...e,state:t.payload,formErrors:{...e.formErrors,state:void 0}};case"changeCountry":return{...e,countryIso2:t.payload,billingCountry:Oc(t.payload),formErrors:{...e.formErrors,countryIso2:void 0}};case"changePostCode":return{...e,postCode:t.payload,formErrors:{...e.formErrors,postCode:void 0}};case"changeFullName":return{...e,fullName:t.payload,formErrors:{...e.formErrors,fullName:void 0}};case"changeEmail":return{...e,email:t.payload,formErrors:{...e.formErrors,email:void 0}};case"changePhone":return{...e,phone:t.payload,formErrors:{...e.formErrors,phone:void 0}};case"changeShipping":return{...e,shipping:t.payload};case"changeCardNumber":return{...e,cardNumber:t.payload,formErrors:{...e.formErrors,cardNumber:void 0}};case"changeCardholder":return{...e,cardholder:t.payload,formErrors:{...e.formErrors,cardholder:void 0}};case"changeExpiryDate":return{...e,expiry:t.payload,formErrors:{...e.formErrors,expiry:void 0}};case"changeCvvCode":return{...e,cvv:t.payload,formErrors:{...e.formErrors,cvv:void 0}};case"changeBillingCountry":return{...e,billingCountry:t.payload,formErrors:{...e.formErrors,billingCountry:void 0}};case"changeBillingZip":return{...e,billingZip:t.payload,formErrors:{...e.formErrors,billingZip:void 0}};case"changeSaveInfo":return{...e,saveInfo:t.payload};case"changeSaveCredentials":return{...e,saveCredentials:t.payload};case"updateUserInfo":return t.payload.countryIso2?{...e,...t.payload,billingCountry:Oc(t.payload.countryIso2)}:{...e,...t.payload};case"setFormErrors":return{...e,formErrors:{...e.formErrors,...t.payload}};default:return e}};function Oc(e){const t=At.a.find(({id:t})=>t===e);return t?t.name:""}function fc(e,t=400){Object(n.n)(()=>{l.n||setTimeout(()=>{Object(V.b)(()=>{e.current&&e.current.focus()})},t)},[e,t])}var jc=Object(n.h)(e=>{const{id:t,value:a,label:s,hasArrow:c,error:r,ref:o,placeholder:l,onChange:i,children:d}=e,m=r||s,u=Object(W.a)("input-group",a&&"touched",r&&"error",m&&"with-label",c&&"with-arrow","input-group");return n.a.createElement("div",{className:u},n.a.createElement("select",{className:"form-control",id:t,value:a||"",onChange:i,placeholder:l||s,ref:o},d),m&&t&&n.a.createElement("label",{htmlFor:t},m))});a(321);var Cc=Object(n.h)(({state:e,needEmail:t,needPhone:a,needName:s,needAddress:c,dispatch:r})=>{const o=Object(n.q)(null),l=Object(n.q)(null),i=Object(n.q)(null);Object(n.n)(()=>{i.current&&i.current.value!==e.countryIso2&&(i.current.value=e.countryIso2)},[e.countryIso2]);const d=Object(M.a)();fc(o);const m=Object(n.m)(e=>{r({type:"changeAddress1",payload:e.target.value})},[r]),u=Object(n.m)(e=>{r({type:"changeAddress2",payload:e.target.value})},[r]),h=Object(n.m)(e=>{r({type:"changeCity",payload:e.target.value})},[r]),b=Object(n.m)(e=>{r({type:"changeState",payload:e.target.value})},[r]),g=Object(n.m)(e=>{r({type:"changeCountry",payload:e.target.value})},[r]),p=Object(n.m)(e=>{r({type:"changePostCode",payload:e.target.value})},[r]),v=Object(n.m)(e=>{r({type:"changeFullName",payload:e.target.value})},[r]),E=Object(n.m)(e=>{r({type:"changeEmail",payload:e.target.value})},[r]),O=Object(n.m)(e=>{let{value:t}=e.target;t="+"+t.replace(/\D/g,""),l.current&&(l.current.value=t),r({type:"changePhone",payload:t})},[r]),f=Object(n.m)(e=>{r({type:"changeSaveInfo",payload:e.target.value})},[r]),{formErrors:j}=e;return n.a.createElement("div",{className:"ShippingInfo"},n.a.createElement("form",null,c?n.a.createElement("div",null,n.a.createElement("h5",null,d("PaymentShippingAddress")),n.a.createElement(ve.a,{ref:o,label:"Address1 (Street)",onChange:m,value:e.streetLine1,inputMode:"text",error:j.streetLine1}),n.a.createElement(ve.a,{label:"Address2 (Street)",onChange:u,value:e.streetLine2,inputMode:"text",error:j.streetLine2}),n.a.createElement(ve.a,{label:"City",onChange:h,value:e.city,inputMode:"text",error:j.city}),n.a.createElement(ve.a,{label:"State",onChange:b,value:e.state,inputMode:"text",error:j.state}),n.a.createElement(jc,{label:"Country",placeholder:"Country",onChange:g,value:e.countryIso2,hasArrow:Boolean(!0),id:"shipping-country",error:j.countryIso2,ref:i},At.a.map(({name:e,id:t})=>n.a.createElement("option",{value:t,className:"county-item"},e))),n.a.createElement(ve.a,{label:"Post Code",onChange:p,value:e.postCode,inputMode:"text",error:j.postCode})):void 0,s||t||a?n.a.createElement("h5",null,d("PaymentShippingReceiver")):void 0,s&&n.a.createElement(ve.a,{label:"Full name",onChange:v,value:e.fullName,inputMode:"text",error:j.fullName}),t&&n.a.createElement(ve.a,{label:"Email",onChange:E,value:e.email,inputMode:"email",error:j.email}),a&&n.a.createElement(ve.a,{label:"Phone number",onChange:O,value:e.phone,inputMode:"tel",error:j.phone,ref:l}),n.a.createElement(Jt.a,{label:d("PaymentShippingSave"),subLabel:d("PaymentShippingSaveInfo"),checked:Boolean(e.saveInfo),onChange:f})))});a(322);var yc=Object(n.h)(({state:e,shippingOptions:t,currency:a,dispatch:s})=>{Object(n.n)(()=>{t&&!e.shipping&&s({type:"changeShipping",payload:t[0].id})},[t,e.shipping,s]);const c=Object(n.m)(e=>{s({type:"changeShipping",payload:e})},[s]),r=Object(n.p)(()=>t.map(({id:e,title:t,amount:n})=>({label:t,subLabel:`${a} ${String(n/100)}`,value:e})),[t,a]);return n.a.createElement("div",{className:"Shipping"},n.a.createElement("form",null,n.a.createElement("p",null,"Select shipping method"),n.a.createElement(qe.a,{name:"shipping-options",options:r,onChange:c,selected:e.shipping})))});a(323);function kc(e,t,a,s=!1){return n.a.createElement("div",{className:"price-info-item "+(s?"price-info-item-main":"")},n.a.createElement("div",{className:"title"},e),n.a.createElement("div",{className:"value"},`${a||""} ${(t/100).toFixed(2)}`))}function Nc(e,t,a){return n.a.createElement("div",{className:"checkout-info-item"},n.a.createElement("i",{className:e}," "),n.a.createElement("div",{className:"info"},n.a.createElement("div",{className:"title"},t),n.a.createElement("p",{className:"data"},a)))}var Sc=Object(n.h)(({invoiceContent:e,prices:t,shippingPrices:a,checkoutInfo:s,currency:c,totalPrice:r})=>{const{photoUrl:o,title:l,text:i}=e||{},{paymentMethod:d,paymentProvider:m,shippingAddress:u,name:h,phone:b,shippingMethod:g}=s||{};return n.a.createElement("div",{className:"Checkout"},n.a.createElement("div",{className:"description has-image"},o&&n.a.createElement("img",{src:o,alt:""}),n.a.createElement("div",{className:"text"},n.a.createElement("h5",null,l),n.a.createElement("p",null,i))),n.a.createElement("div",{className:"price-info"},t&&t.map(e=>kc(e.label,e.amount,c,!1)),a&&a.map(e=>kc(e.label,e.amount,c,!1)),void 0!==r&&kc("Total",r,c,!0)),n.a.createElement("div",{className:"invoice-info"},d&&Nc("icon-card",d,"Payment method"),m&&Nc("stripe-provider",m,"Payment provider"),u&&Nc("icon-location",u,"Shipping address"),h&&Nc("icon-user",h,"Name"),b&&Nc("icon-phone",b,"Phone number"),g&&Nc("icon-truck",g,"Shipping method")))});var wc=Object(n.h)(({value:e,error:t,onChange:a})=>{const s=Object(n.q)(null),c=Object(n.m)(t=>{if("Backspace"===t.key&&"/"===e.charAt(e.length-1)){const t=e.slice(0,e.length-1);s.current&&(s.current.value=t)}},[e]),r=Object(n.m)(e=>{a(function(e){const t=(e=e.replace(/[^\d]/g,"").slice(0,4)).match(/.{1,2}/g);return t&&t[0]&&Number(t[0])>12&&(t[0]="12"),t&&t[0]&&2===t[0].length&&!t[1]&&(t[1]=""),t?t.join("/"):""}(e.target.value))},[a]);return n.a.createElement(ve.a,{label:"Expiry date",ref:s,onChange:r,onKeyDown:c,value:e,error:t,inputMode:"numeric",maxLength:5})}),Ic=(a(324),a.p+"mastercard.4216118edafe23cc2dec7b8807ba4622.svg"),Pc=a.p+"visa.e5a7c336e1deb4b92a636e2e053878c4.svg";var Fc=Object(n.h)(({value:e,error:t,onChange:a})=>{const s=Object(n.q)(null);fc(s);const[c,r]=Object(n.r)(hc.Default);Object(n.n)(()=>{const t=gc(e);r(t)},[]);const o=Object(n.m)(e=>{const t=function(e){const t=(e=e.replace(/[^\d]/g,"")).match(/.{1,4}/g);return t?t.join(" "):""}(e.target.value),n=gc(e.target.value);r(n),a(t),s.current&&(s.current.value=t)},[a,s]),l=function(e){switch(e){case hc.Mastercard:return n.a.createElement("img",{src:Ic,alt:""});case hc.Visa:return n.a.createElement("img",{src:Pc,alt:""});default:return}}(c);return n.a.createElement("div",{className:"CardInput"},n.a.createElement("span",{className:"left-addon"},l),n.a.createElement(ve.a,{ref:s,label:"Card number",onChange:o,value:e,inputMode:"numeric",className:c?"has-left-addon":"",error:t,maxLength:23}))});a(325);var Mc=Object(n.h)(({state:e,canSaveCredentials:t,needCardholderName:a,needCountry:s,needZip:c,dispatch:r})=>{const o=Object(n.q)(null);Object(n.n)(()=>{o.current&&o.current.value!==e.billingCountry&&(o.current.value=e.billingCountry)},[e.billingCountry]);const l=Object(n.m)(e=>{r({type:"changeCardNumber",payload:e})},[r]),i=Object(n.m)(e=>{r({type:"changeCardholder",payload:e.target.value.toUpperCase()})},[r]),d=Object(n.m)(e=>{r({type:"changeExpiryDate",payload:e})},[r]),m=Object(n.m)(e=>{r({type:"changeCvvCode",payload:e.target.value})},[r]),u=Object(n.m)(e=>{r({type:"changeBillingCountry",payload:e.target.value})},[r]),h=Object(n.m)(e=>{r({type:"changeBillingZip",payload:e.target.value})},[r]),b=Object(n.m)(e=>{r({type:"changeSaveCredentials",payload:e.target.value})},[r]),g=Object(M.a)(),{formErrors:p={}}=e;return n.a.createElement("div",{className:"PaymentInfo"},n.a.createElement("form",null,n.a.createElement("h5",null,g("PaymentCardTitle")),n.a.createElement(Fc,{onChange:l,value:e.cardNumber,error:p.cardNumber}),a&&n.a.createElement(ve.a,{label:"Name on card",onChange:i,value:e.cardholder,inputMode:"text",error:p.cardholder}),n.a.createElement("section",{className:"inline-inputs"},n.a.createElement(wc,{value:e.expiry,onChange:d,error:p.expiry}),n.a.createElement(ve.a,{label:"CVV code",onChange:m,value:e.cvv,inputMode:"numeric",maxLength:3,error:p.cvv})),s||c?n.a.createElement("h5",null,g("PaymentBillingAddress")):void 0,s&&n.a.createElement(jc,{label:"Country",placeholder:"Country",onChange:u,value:e.billingCountry,hasArrow:Boolean(!0),id:"billing-country",error:p.billingCountry,ref:o},At.a.map(({name:e})=>n.a.createElement("option",{value:e,className:"county-item"},e))),c&&n.a.createElement(ve.a,{label:"Post Code",onChange:h,value:e.billingZip,inputMode:"text",error:p.billingZip}),t&&n.a.createElement(Jt.a,{label:g("PaymentCardSavePaymentInformation"),checked:e.saveCredentials,onChange:b})))});a(197);var Lc=Object(n.h)(Object(s.h)(e=>{const{step:t,shippingOptions:a,savedInfo:n,canSaveCredentials:s,invoice:c,invoiceContent:r,nativeProvider:o,nativeParams:l,passwordMissing:i,error:d}=e.payment,m=Boolean(c&&(!o||"stripe"!==o)),{needCardholderName:u,needCountry:h,needZip:b}=l||{},{nameRequested:g,phoneRequested:p,emailRequested:v,shippingAddressRequested:E,flexible:O,phoneToProvider:f,emailToProvider:j,currency:C,prices:y}=c||{};return{step:t,shippingOptions:a,savedInfo:n,canSaveCredentials:s,nativeProvider:o,passwordMissing:i,nameRequested:g,shippingAddressRequested:E,phoneRequested:p,emailRequested:v,flexible:O,phoneToProvider:f,emailToProvider:j,currency:C,prices:y,isProviderError:m,invoiceContent:r,needCardholderName:u,needCountry:h,needZip:b,error:d,globalDialogs:e.dialogs}},(e,t)=>Object(h.l)(t,["validateRequestedInfo","sendPaymentForm","setPaymentStep","sendCredentialsInfo","clearPaymentError"]))(({isOpen:e,onClose:t,step:a,shippingOptions:s,savedInfo:c,canSaveCredentials:o,nameRequested:l,shippingAddressRequested:i,phoneRequested:d,emailRequested:m,phoneToProvider:u,emailToProvider:h,currency:b,passwordMissing:g,isProviderError:p,invoiceContent:v,nativeProvider:E,prices:O,needCardholderName:f,needCountry:j,needZip:C,error:y,globalDialogs:k,validateRequestedInfo:N,sendPaymentForm:S,setPaymentStep:w,sendCredentialsInfo:I,clearPaymentError:P})=>{const[F,L]=Object(Pt.a)(Ec,vc),R=ic(b),[B,U]=Object(n.r)(!1),x=Object(M.a)();Object(n.n)(()=>{(a||y||k)&&U(!1)},[a,y,k]),Object(n.n)(()=>{if(y&&y.field)L({type:"setFormErrors",payload:{[y.field]:y.fieldError}});else if(k&&k.length){const e=Object(pc.a)(k);L({type:"setFormErrors",payload:{...e}})}},[y,k,L]),Object(n.n)(()=>{if(c){const{name:e,phone:t,email:a,shippingAddress:n}=c;L({type:"updateUserInfo",payload:{fullName:e,phone:t&&"+"!==t.charAt(0)?"+"+t:t,email:a,...n||{}}})}},[c,L]);const G=Object(n.m)(()=>{P()},[P]),z=Object(n.p)(()=>a!==r.j.Checkout?0:function(e=[],t,a){const n=t?Rc(t,a):[];let s=0;const c=e.concat(n||[]);return s=c.reduce((e,t)=>e+t.amount,s),s}(O,s,F.shipping),[a,F.shipping,O,s]),q=Object(n.p)(()=>{if(a===r.j.Checkout)return function(e,t,a){const n=`${function(e){const t=gc(e);return bc[t]||""}(e.cardNumber)} *${e.cardNumber.slice(-4)}`,s=e.streetLine1?`${e.streetLine1}, ${e.city}, ${e.countryIso2}`:void 0,{phone:c,fullName:r}=e,o=t?Ac(t,e.shipping):void 0,l=o?o.title:void 0;return{paymentMethod:n,paymentProvider:a,shippingAddress:s,name:r,phone:c,shippingMethod:l}}(F,s,E||"")},[a,F,s,E]);const _=Object(n.m)(()=>{const{saveInfo:e}=F,t=function(e){const{streetLine1:t,streetLine2:a,city:n,state:s,countryIso2:c,postCode:r,fullName:o,phone:l,email:i}=e;return{name:o,phone:l,email:i,shippingAddress:{streetLine1:t,streetLine2:a,city:n,state:s,countryIso2:c,postCode:r}}}(F);N({requestInfo:t,saveInfo:e})},[N,F]),H=Object(n.m)(()=>{const e=function(e){const{cardNumber:t,cardholder:a,expiry:n,cvv:s,billingCountry:c,billingZip:r}=e,[o,l]=n.split("/");return{data:{cardNumber:t,cardholder:a,expiryMonth:o,expiryYear:l,cvv:s,country:c,zip:r}}}(F);I({credentials:e})},[I,F]),$=Object(n.m)(()=>{S({shippingOptionId:F.shipping,saveCredentials:F.saveCredentials})},[S,F]),V=Object(n.m)(e=>{w({step:e})},[w]),W=Object(n.m)(()=>{switch(U(!0),a){case r.j.ShippingInfo:return _();case r.j.Shipping:return V(r.j.PaymentInfo);case r.j.PaymentInfo:return H();case r.j.Checkout:return $();default:return()=>{}}},[a,_,V,H,$]),K=Object(n.p)(()=>{switch(a){case r.j.ShippingInfo:return x("PaymentShippingInfo");case r.j.Shipping:return x("PaymentShippingMethod");case r.j.PaymentInfo:return x("PaymentCardInfo");case r.j.Checkout:return x("PaymentCheckout");default:return""}},[a,x]),Y=Object(n.p)(()=>{switch(a){case r.j.Checkout:return x("Checkout.PayPrice",`${R}${(z/100).toFixed(2)}`);default:return x("Next")}},[a,x,R,z]);return p?n.a.createElement(pe.a,{className:"error",isOpen:e,onClose:t},n.a.createElement("p",null,"Sorry, Telegram WebZ doesn't support payments with this provider yet. ",n.a.createElement("br",null),"Please use one of our mobile apps to do this."),n.a.createElement(D.a,{isText:!0,onClick:t},x("OK"))):n.a.createElement(pe.a,{className:"PaymentModal",isOpen:e,onClose:t},n.a.createElement("div",{className:"header",dir:x.isRtl?"rtl":void 0},n.a.createElement(D.a,{className:"close-button",color:"translucent",round:!0,size:"smaller",onClick:t,ariaLabel:"Close"},n.a.createElement("i",{className:"icon-close"})),n.a.createElement("h3",null,K)),void 0!==a?n.a.createElement(T.a,{name:"slide",activeKey:a},()=>n.a.createElement("div",{className:"content custom-scroll"},function(e){switch(e){case r.j.ShippingInfo:return n.a.createElement(Cc,{state:F,dispatch:L,needAddress:Boolean(i),needEmail:Boolean(m||h),needPhone:Boolean(d||u),needName:Boolean(l)});case r.j.Shipping:return n.a.createElement(yc,{state:F,dispatch:L,shippingOptions:s||[],currency:R});case r.j.PaymentInfo:return n.a.createElement(Mc,{state:F,dispatch:L,canSaveCredentials:Boolean(!g&&o),needCardholderName:f,needCountry:j,needZip:C});case r.j.Checkout:return n.a.createElement(Sc,{prices:O,shippingPrices:F.shipping&&s?Rc(s,F.shipping):void 0,totalPrice:z,invoiceContent:v,checkoutInfo:q,currency:R});default:return}}(a))):n.a.createElement("div",{className:"empty-content"},n.a.createElement(A.a,{color:"gray"})),n.a.createElement("div",{className:"footer"},n.a.createElement(D.a,{type:"submit",onClick:W,disabled:B,isLoading:B},Y)),y&&!y.field&&function(){if(y)return n.a.createElement(pe.a,{className:"error",isOpen:Boolean(y),onClose:G},n.a.createElement("h4",null,y.description||"Error"),n.a.createElement("p",null,y.description||"Error"),n.a.createElement(D.a,{isText:!0,onClick:P},x("OK")))}())}));function Ac(e,t){return e.find(({id:e})=>e===t)}function Rc(e,t){const a=Ac(e,t);return a?a.prices:void 0}var Tc=Object(n.h)(Object(s.h)(e=>{const{receipt:t}=e.payment,{currency:a,prices:n,info:s,totalAmount:c,credentialsTitle:r,shippingPrices:o,shippingMethod:l,photoUrl:i,text:d,title:m}=t||{};return{currency:a,prices:n,info:s,totalAmount:c,credentialsTitle:r,shippingPrices:o,shippingMethod:l,photoUrl:i,text:d,title:m}})(({isOpen:e,onClose:t,prices:a,shippingPrices:s,totalAmount:c,currency:r,info:o,photoUrl:l,text:i,title:d,credentialsTitle:m,shippingMethod:u})=>{const h=Object(M.a)(),b=ic(r),g=Object(n.p)(()=>function(e,t,a){if(!t)return{paymentMethod:e};const{shippingAddress:n}=t,s=n&&n.streetLine1?`${n.streetLine1}, ${n.city}, ${n.countryIso2}`:void 0,{phone:c,name:r}=t;return{paymentMethod:e,paymentProvider:"Stripe",shippingAddress:s,name:r,phone:c,shippingMethod:a}}(m,o,u),[o,u,m]);return n.a.createElement(pe.a,{className:"PaymentModal PaymentModal-receipt",isOpen:e,onClose:t},n.a.createElement("div",null,n.a.createElement("div",{className:"header",dir:h.isRtl?"rtl":void 0},n.a.createElement(D.a,{className:"close-button",color:"translucent",round:!0,size:"smaller",onClick:t,ariaLabel:"Close"},n.a.createElement("i",{className:"icon-close"})),n.a.createElement("h3",null," ",h("PaymentReceipt")," ")),n.a.createElement("div",{className:"receipt-content custom-scroll"},n.a.createElement(Sc,{prices:a,shippingPrices:s,totalPrice:c,invoiceContent:{photoUrl:l,text:i,title:d},checkoutInfo:g,currency:b}))))}))},132:function(e,t,a){"use strict";a.d(t,"a",(function(){return r}));var n=a(8),s=a(33);const c={MonkeyIdle:a.p+"TwoFactorSetupMonkeyIdle.dea4a492c144df84ddab778dc8a3f0cd.tgs",MonkeyTracking:a.p+"TwoFactorSetupMonkeyTracking.eb5a7a6f166fb7589c12e6248561fb58.tgs",MonkeyClose:a.p+"TwoFactorSetupMonkeyClose.604c4c833d322b7e6c3ea19bef058241.tgs",MonkeyPeek:a.p+"TwoFactorSetupMonkeyPeek.1905436b042520363d7e59f5d7f903ab.tgs",FoldersAll:a.p+"FoldersAll.3f9f9e243d19f0fbf9aaaff11cbd4572.tgs",FoldersNew:a.p+"FoldersNew.9a40d71c0c8be70f5bd14ff2d7bc1593.tgs",DiscussionGroups:a.p+"DiscussionGroupsDucks.9ea453d1be9d1b0ee77a992f8e587485.tgs"};function r(e){const t=c[e].replace(window.location.origin,"");return s.b("file"+t,n.ApiMediaFormat.Lottie)}},136:function(e,t,a){"use strict";var n=a(0),s=a(9),c=a(2),r=a(16),o=a(17),l=a(22),i=a(112),d=a(20);a(157);const m={type:"blob",quality:.8,format:"jpeg",circle:!1};let u,h,b;var g=Object(n.h)(({file:e,onChange:t,onClose:s})=>{const[g,p]=Object(n.r)(!1);Object(n.n)(()=>{e&&(g?async function(e){try{const t=document.getElementById("avatar-crop");if(!t)return;const{offsetWidth:a,offsetHeight:n}=t;b=new u(t,{enableZoom:!0,boundary:{width:a,height:n},viewport:{width:a-16,height:n-16,type:"circle"}});const s=await Object(r.a)(e);await b.bind({url:s})}catch(e){c.r&&console.error(e)}}(e):async function(){return h||(h=Promise.all([a.e(6),a.e(8)]).then(a.bind(null,334)),u=(await h).default),h}().then(()=>p(!0)))},[e,g]);const v=Object(o.a)();return n.a.createElement(i.a,{isOpen:Boolean(e),onClose:s,title:"Drag to reposition",className:"CropModal",hasCloseButton:!0},g?n.a.createElement("div",{id:"avatar-crop"}):n.a.createElement(d.a,null),n.a.createElement(l.a,{className:"confirm-button",round:!0,color:"primary",onClick:async function(){if(!b)return;const e=await b.result(m),a="string"==typeof e?e:Object(r.b)(e,"avatar.jpg");t(a)},ariaLabel:v("CropImage")},n.a.createElement("i",{className:"icon-check"})))});a(158);t.a=Object(n.h)(({title:e="Change your profile picture",disabled:t,currentAvatarBlobUrl:a,onChange:c})=>{const[r,o]=Object(n.r)(),[l,i]=Object(n.r)(a);Object(n.n)(()=>{i(a)},[a]);const d=Object(s.a)(l&&"filled",t&&"disabled");return n.a.createElement("div",{className:"AvatarEditable"},n.a.createElement("label",{className:d,role:"button",tabIndex:0,title:e},n.a.createElement("input",{type:"file",onChange:function(e){const t=e.target;t&&t.files&&t.files[0]&&(o(t.files[0]),t.value="")},accept:"image/png, image/jpeg"}),n.a.createElement("i",{className:"icon-camera-add"}),l&&n.a.createElement("img",{src:l,alt:"Avatar"})),n.a.createElement(g,{file:r,onClose:function(){o(void 0)},onChange:function(e){o(void 0),c(e),l&&URL.revokeObjectURL(l),i(URL.createObjectURL(e))}}))})},144:function(e,t,a){},154:function(e,t,a){"use strict";var n=a(0),s=a(2),c=a(6),r=a(132),o=a(119);a(144);const l=[0,50],i=[0,20],d=[20,0],m=c.l?s.Db:s.Cb;t.a=Object(n.h)(({isPasswordVisible:e,isBig:t})=>{const[a,c]=Object(n.r)(),[u,h]=Object(n.r)(),[b,g]=Object(n.r)(!1),[p,v]=Object(n.r)(!1);Object(n.n)(()=>{a?setTimeout(()=>v(!0),2e3):Object(r.a)("MonkeyClose").then(c)},[a]),Object(n.n)(()=>{u||Object(r.a)("MonkeyPeek").then(h)},[u]);const E=Object(n.m)(()=>g(!0),[]);return n.a.createElement("div",{id:"monkey",className:t?"big":""},!b&&n.a.createElement("div",{className:"monkey-preview"}),a&&n.a.createElement(o.a,{id:"closeMonkey",size:t?s.Ob:m,className:p?"hidden":"shown",animationData:a,playSegment:l,noLoop:!0,onLoad:E}),u&&n.a.createElement(o.a,{id:"peekMonkey",size:t?s.Ob:m,className:p?"shown":"hidden",animationData:u,playSegment:e?i:d,noLoop:!0}))})},155:function(e,t,a){"use strict";var n=a(0),s=a(2),c=a(6),r=a(9),o=a(17),l=a(22);const i=c.l?550:400;t.a=Object(n.h)(({isLoading:e=!1,isPasswordVisible:t,error:a,hint:d,placeholder:m="Password",submitLabel:u="Next",clearError:h,onChangePasswordVisibility:b,onInputChange:g,onSubmit:p})=>{const v=Object(n.q)(null),E=Object(o.a)(),[O,f]=Object(n.r)(""),[j,C]=Object(n.r)(!1);return Object(n.n)(()=>{c.n||setTimeout(()=>{v.current.focus()},i)},[]),Object(n.n)(()=>{a&&requestAnimationFrame(()=>{v.current.focus(),v.current.select()})},[a]),n.a.createElement("form",{action:"",onSubmit:function(t){t.preventDefault(),e||j&&p(O)},autoComplete:"off"},n.a.createElement("div",{className:Object(r.a)("input-group password-input",O&&"touched",a&&"error"),dir:E.isRtl?"rtl":void 0},n.a.createElement("input",{ref:v,className:"form-control",type:t?"text":"password",id:"sign-in-password",value:O||"",autoComplete:"current-password",onChange:function(e){a&&h();const{target:t}=e;f(t.value),C(t.value.length>=s.jb),g&&g(t.value)},dir:"auto"}),n.a.createElement("label",null,a||d||m),n.a.createElement("div",{className:"toggle-password",onClick:function(){b(!t)},role:"button",tabIndex:0,title:"Toggle password visibility"},n.a.createElement("i",{className:t?"icon-eye":"icon-eye-closed"}))),j&&n.a.createElement(l.a,{type:"submit",ripple:!0,isLoading:e},u))})},157:function(e,t,a){},158:function(e,t,a){},175:function(e,t,a){},197:function(e,t,a){},269:function(e,t,a){},270:function(e,t,a){},271:function(e,t,a){},272:function(e,t,a){},273:function(e,t,a){},274:function(e,t,a){},275:function(e,t,a){},276:function(e,t,a){},277:function(e,t,a){},278:function(e,t,a){},279:function(e,t,a){},280:function(e,t,a){},281:function(e,t,a){},282:function(e,t,a){},283:function(e,t,a){},284:function(e,t,a){},285:function(e,t,a){},286:function(e,t,a){},287:function(e,t,a){},288:function(e,t,a){},289:function(e,t,a){},290:function(e,t,a){},291:function(e,t,a){},292:function(e,t,a){},293:function(e,t,a){},294:function(e,t,a){},295:function(e,t,a){},296:function(e,t,a){},297:function(e,t,a){},298:function(e,t,a){},299:function(e,t,a){},300:function(e,t,a){},301:function(e,t,a){},302:function(e,t,a){},303:function(e,t,a){},304:function(e,t,a){},305:function(e,t,a){},306:function(e,t,a){},307:function(e,t,a){},308:function(e,t,a){},309:function(e,t,a){},310:function(e,t,a){},311:function(e,t,a){},312:function(e,t,a){},313:function(e,t,a){},314:function(e,t,a){},315:function(e,t,a){},316:function(e,t,a){},317:function(e,t,a){},318:function(e,t,a){},319:function(e,t,a){},320:function(e,t,a){},321:function(e,t,a){},322:function(e,t,a){},323:function(e,t,a){},324:function(e,t,a){},325:function(e,t,a){}}]); +//# sourceMappingURL=3.33a9836ed01b17d89349.js.map \ No newline at end of file diff --git a/dist/3.33a9836ed01b17d89349.js.map b/dist/3.33a9836ed01b17d89349.js.map new file mode 100644 index 00000000..a37aabbe --- /dev/null +++ b/dist/3.33a9836ed01b17d89349.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack:///./src/components/mediaViewer/helpers/ghostAnimation.ts","webpack:///./src/components/mediaViewer/SenderInfo.tsx","webpack:///./src/components/mediaViewer/MediaViewerActions.tsx","webpack:///./src/components/mediaViewer/MediaViewerFooter.tsx","webpack:///./src/hooks/useFullscreen.ts","webpack:///./src/components/mediaViewer/helpers/formatFileSize.ts","webpack:///./src/components/mediaViewer/VideoPlayerControls.tsx","webpack:///./src/components/mediaViewer/VideoPlayer.tsx","webpack:///./src/components/mediaViewer/ZoomControls.tsx","webpack:///./src/components/mediaViewer/PanZoom.tsx","webpack:///./src/components/mediaViewer/MediaViewer.tsx","webpack:///./src/components/main/ForwardPicker.tsx","webpack:///./src/components/main/Dialogs.tsx","webpack:///./src/components/main/Notifications.tsx","webpack:///./src/components/main/SafeLinkModal.tsx","webpack:///./src/components/common/CalendarModal.tsx","webpack:///./src/components/main/HistoryCalendar.tsx","webpack:///./src/components/common/DeleteMessageModal.tsx","webpack:///./src/components/common/PinMessageModal.tsx","webpack:///./src/components/common/UnpinAllMessagesModal.tsx","webpack:///./src/components/middle/DeleteSelectedMessageModal.tsx","webpack:///./src/components/common/ReportMessageModal.tsx","webpack:///./src/components/middle/MessageSelectToolbar.tsx","webpack:///./src/hooks/useSelectWithEnter.ts","webpack:///./src/components/left/search/LeftSearchResultChat.tsx","webpack:///./src/components/left/search/RecentContacts.tsx","webpack:///./src/components/left/search/ChatMessage.tsx","webpack:///./src/components/left/search/DateSuggest.tsx","webpack:///./src/components/left/search/ChatResults.tsx","webpack:///./src/components/left/search/ChatMessageResults.tsx","webpack:///./src/components/left/search/helpers/createMapStateToProps.ts","webpack:///./src/components/left/search/MediaResults.tsx","webpack:///./src/components/left/search/helpers/getSenderName.ts","webpack:///./src/components/left/search/LinkResults.tsx","webpack:///./src/components/left/search/FileResults.tsx","webpack:///./src/components/left/search/AudioResults.tsx","webpack:///./src/components/left/search/LeftSearch.tsx","webpack:///./src/hooks/reducers/useTwoFaReducer.ts","webpack:///./src/components/left/settings/SettingsHeader.tsx","webpack:///./src/components/left/settings/SettingsMain.tsx","webpack:///./src/components/common/UsernameInput.tsx","webpack:///./src/components/left/settings/SettingsEditProfile.tsx","webpack:///./src/components/left/settings/folders/SettingsFoldersMain.tsx","webpack:///./src/components/ui/ShowMoreButton.tsx","webpack:///./src/components/left/settings/folders/SettingsFoldersEdit.tsx","webpack:///./src/components/left/settings/folders/SettingsFoldersChatsPicker.tsx","webpack:///./src/components/left/settings/folders/SettingsFoldersChatFilters.tsx","webpack:///./src/components/left/settings/folders/SettingsFolders.tsx","webpack:///./src/components/ui/RangeSlider.tsx","webpack:///./src/components/middle/composer/StickerSetCoverAnimated.tsx","webpack:///./src/components/middle/composer/StickerSetCover.tsx","webpack:///./src/components/left/settings/SettingsStickerSet.tsx","webpack:///./src/components/left/settings/SettingsGeneral.tsx","webpack:///./src/util/systemFilesDialog.ts","webpack:///./src/util/colors.ts","webpack:///./src/components/left/settings/WallpaperTile.tsx","webpack:///./src/components/left/settings/SettingsGeneralBackground.tsx","webpack:///./src/components/left/settings/SettingsGeneralBackgroundColor.tsx","webpack:///./src/components/left/settings/SettingsNotifications.tsx","webpack:///./src/components/left/settings/SettingsPrivacy.tsx","webpack:///./src/components/left/settings/SettingsLanguage.tsx","webpack:///./src/components/left/settings/helper/privacy.ts","webpack:///./src/components/left/settings/SettingsPrivacyVisibility.tsx","webpack:///./src/components/left/settings/SettingsPrivacyActiveSessions.tsx","webpack:///./src/components/left/settings/SettingsPrivacyBlockedUsers.tsx","webpack:///./src/components/left/settings/twoFa/SettingsTwoFaEnabled.tsx","webpack:///./src/components/left/settings/twoFa/SettingsTwoFaPassword.tsx","webpack:///./src/components/left/settings/twoFa/SettingsTwoFaStart.tsx","webpack:///./src/components/left/settings/twoFa/SettingsTwoFaSkippableForm.tsx","webpack:///./src/components/left/settings/twoFa/SettingsTwoFaCongratulations.tsx","webpack:///./src/components/left/settings/twoFa/SettingsTwoFaEmailCode.tsx","webpack:///./src/components/left/settings/twoFa/SettingsTwoFa.tsx","webpack:///./src/components/left/settings/SettingsPrivacyVisibilityExceptionList.tsx","webpack:///./src/components/left/settings/Settings.tsx","webpack:///./src/components/left/main/ContactList.tsx","webpack:///./src/components/left/newChat/NewChatStep1.tsx","webpack:///./src/components/left/newChat/NewChatStep2.tsx","webpack:///./src/components/left/newChat/NewChat.tsx","webpack:///./src/components/left/ArchivedChats.tsx","webpack:///./src/util/scrollLock.ts","webpack:///./src/components/middle/message/helpers/copyOptions.ts","webpack:///./src/components/middle/message/MessageContextMenu.tsx","webpack:///./src/components/middle/message/ContextMenuContainer.tsx","webpack:///./src/components/common/StickerSetModal.tsx","webpack:///./src/components/middle/HeaderMenuContainer.tsx","webpack:///./src/components/middle/MobileSearch.tsx","webpack:///./src/util/findInViewport.ts","webpack:///./src/util/isFullyVisible.ts","webpack:///./src/util/setTooltipItemVisible.ts","webpack:///./src/components/middle/composer/MentionTooltip.tsx","webpack:///./src/components/middle/composer/AttachmentModal.tsx","webpack:///./src/components/middle/composer/PollModal.tsx","webpack:///./src/components/middle/composer/EmojiButton.tsx","webpack:///./src/components/middle/composer/EmojiCategory.tsx","webpack:///./src/components/middle/composer/EmojiPicker.tsx","webpack:///./src/components/middle/composer/StickerSet.tsx","webpack:///./src/components/middle/composer/StickerPicker.tsx","webpack:///./src/components/common/GifButton.tsx","webpack:///./src/components/middle/composer/GifPicker.tsx","webpack:///./src/components/middle/composer/SymbolMenuFooter.tsx","webpack:///./src/components/middle/composer/SymbolMenu.tsx","webpack:///./src/components/middle/composer/AttachMenu.tsx","webpack:///./src/components/middle/composer/StickerTooltip.tsx","webpack:///./src/components/middle/composer/CustomSendMenu.tsx","webpack:///./src/components/middle/composer/EmojiTooltip.tsx","webpack:///./src/components/middle/composer/inlineResults/BaseResult.tsx","webpack:///./src/components/middle/composer/inlineResults/MediaResult.tsx","webpack:///./src/components/middle/composer/inlineResults/ArticleResult.tsx","webpack:///./src/components/middle/composer/inlineResults/GifResult.tsx","webpack:///./src/components/middle/composer/inlineResults/StickerResult.tsx","webpack:///./src/components/middle/composer/InlineBotTooltip.tsx","webpack:///./src/components/right/RightSearch.tsx","webpack:///./src/components/right/StickerSetResult.tsx","webpack:///./src/components/right/StickerSearch.tsx","webpack:///./src/components/right/GifSearch.tsx","webpack:///./src/components/right/PollAnswerResults.tsx","webpack:///./src/components/right/PollResults.tsx","webpack:///./src/components/right/management/ManageUser.tsx","webpack:///./src/components/right/management/ManageGroup.tsx","webpack:///./src/components/right/management/ManageGroupPermissions.tsx","webpack:///./src/components/right/management/ManageGroupRemovedUsers.tsx","webpack:///./src/components/right/management/ManageChannel.tsx","webpack:///./src/components/right/management/ManageChatPrivacyType.tsx","webpack:///./src/components/right/management/ManageDiscussion.tsx","webpack:///./src/components/right/management/ManageGroupUserPermissions.tsx","webpack:///./src/components/right/management/ManageChatAdministrators.tsx","webpack:///./src/components/right/management/ManageGroupRecentActions.tsx","webpack:///./src/components/right/management/ManageGroupAdminRights.tsx","webpack:///./src/components/right/management/ManageGroupMembers.tsx","webpack:///./src/components/right/management/ManageGroupUserPermissionsCreate.tsx","webpack:///./src/components/right/management/Management.tsx","webpack:///./src/components/middle/helpers/getCurrencySign.ts","webpack:///./src/components/common/helpers/detectCardType.ts","webpack:///./src/hooks/reducers/usePaymentReducer.ts","webpack:///./src/hooks/useFocusAfterAnimation.tsx","webpack:///./src/components/ui/Select.tsx","webpack:///./src/components/payment/ShippingInfo.tsx","webpack:///./src/components/payment/Shipping.tsx","webpack:///./src/components/payment/Checkout.tsx","webpack:///./src/components/payment/ExpiryInput.tsx","webpack:///./src/components/middle/helpers/inputFormatters.ts","webpack:///./src/assets/mastercard.svg","webpack:///./src/assets/visa.svg","webpack:///./src/components/payment/CardInput.tsx","webpack:///./src/components/payment/PaymentInfo.tsx","webpack:///./src/components/payment/PaymentModal.tsx","webpack:///./src/components/payment/ReceiptModal.tsx","webpack:///./src/components/common/helpers/animatedAssets.ts","webpack:///./src/assets/TwoFactorSetupMonkeyIdle.tgs","webpack:///./src/assets/TwoFactorSetupMonkeyTracking.tgs","webpack:///./src/assets/TwoFactorSetupMonkeyClose.tgs","webpack:///./src/assets/TwoFactorSetupMonkeyPeek.tgs","webpack:///./src/assets/FoldersAll.tgs","webpack:///./src/assets/FoldersNew.tgs","webpack:///./src/assets/DiscussionGroupsDucks.tgs","webpack:///./src/components/ui/CropModal.tsx","webpack:///./src/components/ui/AvatarEditable.tsx","webpack:///./src/components/common/PasswordMonkey.tsx","webpack:///./src/components/common/PasswordForm.tsx"],"names":["animateOpening","hasFooter","origin","bestImageData","dimensions","isVideo","message","mediaEl","fromImage","getNodes","width","windowWidth","windowSize","get","availableWidth","height","availableHeight","getMediaViewerAvailableDimensions","toWidth","toHeight","calculateDimensions","toLeft","toTop","mql","window","matchMedia","MEDIA_VIEWER_MEDIA_QUERY","topOffsetRem","matches","REM","getTopOffset","top","fromTop","left","fromLeft","fromWidth","fromHeight","getBoundingClientRect","MediaViewerOrigin","SharedMedia","Album","ScheduledAlbum","SearchResult","includes","uncovered","realWidth","realHeight","size","Math","max","srcWidth","srcHeight","uncover","fromTranslateX","fromTranslateY","fromScaleX","fromScaleY","ghost","createGhost","applyStyles","transform","applyShape","document","body","classList","add","requestAnimationFrame","appendChild","style","firstChild","objectFit","remove","clearShape","setTimeout","contains","removeChild","ANIMATION_END_DELAY","animateClosing","container","toImage","getElementById","querySelector","targetTop","el","display","rect","windowHeight","isElementInViewport","shouldFadeOut","Inline","ScheduledInline","isMessageImageFullyVisible","existingGhost","getElementsByClassName","ProfileAvatar","transition","transformOrigin","opacity","source","shouldAppendProfileInfo","createElement","img","Image","src","HTMLVideoElement","poster","profileInfo","cloneNode","imageEl","messageListElement","imgOffsetTop","offsetTop","closest","id","parentElement","scrollTop","offsetHeight","element","styles","Object","assign","containerSelector","mediaSelector","MiddleHeaderAvatar","mediaEls","querySelectorAll","length","withGlobal","global","chatId","messageId","isAvatar","sender","isChatPrivate","selectUser","selectChat","selectChatMessage","selectSender","setGlobal","actions","pick","closeMediaViewer","focusMessage","handleFocusMessage","useCallback","lang","useLang","isFromChat","senderTitle","getSenderTitle","className","onClick","Avatar","key","chat","user","dir","renderText","formatMediaDateTime","date","MediaViewerActions","mediaData","isZoomed","fileName","onCloseMediaViewer","onForward","onZoomToggle","isDownloadStarted","downloadProgress","handleDownloadClick","useMediaDownload","getMessageMediaHash","undefined","MenuButton","useMemo","onTrigger","isOpen","Button","round","color","ariaLabel","IS_SINGLE_COLUMN_LAYOUT","DropdownMenu","trigger","positionX","MenuItem","icon","href","download","ProgressSpinner","progress","noCross","MediaViewerFooter","text","isHidden","isForVideo","isMultiline","setIsMultiline","useState","useEffect","footerContent","checkIsMultiline","clientHeight","handleResize","throttle","addEventListener","removeEventListener","classNames","buildClassName","e","stopPropagation","prop","fullscreenElement","mozFullScreenElement","webkitFullscreenElement","getBrowserFullscreenElementProp","units","bytes","number","floor","log","toFixed","stopEvent","VideoPlayerControls","bufferedProgress","currentTime","duration","fileSize","isForceVisible","isForceMobileVersion","isPlayed","isFullscreenSupported","isFullscreen","onChangeFullscreen","onPlayPause","onSeek","isVisible","setVisibility","timeout","clearTimeout","downloadedPercent","totalSize","percentagePlayed","percentageBuffered","min","step","type","onInput","value","renderSeekLine","ripple","formatMediaDuration","renderTime","formatFileSize","memo","url","isGif","posterData","posterSize","isMediaViewerOpen","noPlay","onClose","videoRef","useRef","setIsPlayed","IS_TOUCH_ENV","IS_IOS","setCurrentTime","isControlsVisible","setIsControlsVisible","setFullscreen","exitFullscreen","elRef","setIsFullscreen","Boolean","useLayoutEffect","listener","listenerEnter","listenerExit","video","current","PLATFORM_ENV","requestFullscreen","webkitRequestFullscreen","webkitEnterFullscreen","mozRequestFullScreen","mozCancelFullScreen","webkitCancelFullScreen","webkitExitFullscreen","useFullscreenStatus","isBuffered","bufferingHandlers","useBuffering","shouldRender","shouldRenderSpinner","transitionClassNames","spinnerClassNames","useShowTransition","shouldRenderPlayButton","playButtonClassNames","pause","safePlay","togglePlayState","play","useVideoCleanup","handleMouseOver","handleMouseOut","handleTimeUpdate","currentTarget","handleEnded","handleFullscreenChange","handleSeek","Number","target","toggleControls","togglePayingStateBySpace","preventDefault","wrapperStyle","videoStyle","onMouseOver","onMouseOut","ref","autoPlay","playsInline","loop","muted","onEnded","onDoubleClick","onTimeUpdate","join","square","isShown","onChangeZoom","prevIsShown","usePrevious","inputRef","zoomLevel","setZoomLevel","isSeeking","handleStartSeek","handleStopSeek","disabled","onChange","onMouseDown","onMouseUp","INITIAL_MATRIX","SCALE_VALUES","1","1.5","2","2.5","3","children","noWrap","canPan","panDeltaX","panDeltaY","onPan","tunedZoomLevel","isDragging","setIsDragging","dragData","setDragData","dx","dy","x","y","matrixData","setMatrixData","panWrapperRef","panContainerRef","newZoomLevel","newPandx","newPandy","newMatrixData","areSortedArraysEqual","oldScale","wrapper","image","wrapperRect","imageRect","newImgWidth","newImgHeight","newImgX","newImgY","calculateSafeZoneOnZoom","toString","newDragData","pageX","pageY","onMouseMove","deltaX","deltaY","getNewMatrixData","renderPhoto","blobUrl","imageSize","canDrag","alt","draggable","Spinner","threadId","avatarOwnerId","profilePhotoIndex","mediaViewer","animationLevel","settings","byKey","senderId","avatarOwner","chatMessages","collectionIds","selectScheduledMessage","selectScheduledMessages","selectChatMessages","selectOutlyingIds","selectListedIds","currentSearch","selectCurrentMediaSearch","foundIds","resultsByType","media","openMediaViewer","openForwardMenu","isFromSharedMedia","isFromSearch","photo","getMessagePhoto","getMessageVideo","webPagePhoto","getMessageWebPagePhoto","webPageVideo","getMessageWebPageVideo","isDocumentPhoto","isMessageDocumentPhoto","isDocumentVideo","isMessageDocumentVideo","isPhoto","isSingleSlide","messageIds","getChatMediaMessageIds","selectedMediaMessageIndex","indexOf","isFirst","isLast","animationKey","prevSenderId","slideAnimation","headerAnimation","isGhostAnimation","isFooterHidden","setIsFooterHidden","canPanZoomWrap","setCanPanZoomWrap","setIsZoomed","panDelta","setPanDelta","getMediaHash","isFull","photos","getChatAvatarHash","blobUrlPictogram","useMedia","ApiMediaFormat","BlobUrl","previewMediaHash","blobUrlPreview","startsWith","DataUri","fullMediaData","useMediaWithDownloadProgress","getMessageMediaFormat","localBlobUrl","thumbDataUri","useBlurSync","getMessageMediaThumbDataUri","videoSize","getMessageFileSize","getMessageFileName","getMessageDocument","mediaSize","getPhotoFullDimensions","getVideoDimensions","AVATAR_FULL_DIMENSIONS","toggle","forceUpdate","useForceUpdate","addListener","removeListener","prevMessage","prevOrigin","prevAvatarOwner","prevBestImageData","dispatchHeavyAnimationEvent","textParts","renderMessageText","timer","closeZoom","handleZoomToggle","handleZoomValue","level","canCloseZoom","close","handleFooterClick","handleForward","fromChatId","captureEscKeyListener","stopCurrentAudio","disableRefresh","enableRefresh","getMessageId","fromId","direction","index","selectPreviousMedia","selectNextMedia","handleKeyDown","shouldCloseOnVideo","captureEvents","excludedClosestSelector","onSwipe","SwipeDirection","Right","Left","handlePan","handleToggleFooterVisibility","renderSlide","isActive","calculateMediaViewerDimensions","renderSenderInfo","useHistoryBack","ShowTransition","isRtl","Transition","activeKey","name","aria-label","chats","byId","chatsById","listIds","orderedPinnedIds","currentUserId","pinnedIds","active","activeListIds","archivedListIds","archived","setForwardChatId","exitForwardMode","loadMoreChats","filter","setFilter","focus","blur","chatIds","priorityIds","unique","sortChatIds","getCanPostInChat","MAIN_THREAD_ID","searchWords","getChatTitle","viewportIds","getMore","useInfiniteScroll","handleFilterChange","containerRef","useKeyboardListNavigation","modalHeader","InputText","onKeyDown","placeholder","Modal","header","InfiniteScroll","items","onLoadMore","noScrollRestore","map","ListItem","PrivateChatInfo","status","userId","GroupChatInfo","Loading","getErrorHeader","error","isSlowMode","hasErrorKey","dialogs","dismissDialog","acceptInviteConfirmation","dialog","invite","hash","title","participantsCount","isChannel","participantsText","joinText","isText","renderInvite","getReadableErrorText","notifications","dismissNotification","Notification","onDismiss","toggleSafeLinkModal","handleOpen","open","handleDismiss","renderingUrl","useCurrentOrPrev","ConfirmDialog","confirmLabel","confirmHandler","WEEKDAY_LETTERS","isDisabledDay","year","month","day","minDate","maxDate","selectedDay","Date","fixedMinDate","getFullYear","getMonth","getDate","fixedMaxDate","formatInputTime","String","padStart","selectedAt","maxAt","isFutureMode","isPastMode","withTimePicker","submitButtonLabel","secondButtonLabel","onSubmit","onSecondButtonClick","now","defaultSelectedDate","prevIsOpen","selectedDate","setSelectedDate","selectedHours","setSelectedHours","getHours","selectedMinutes","setSelectedMinutes","getMinutes","currentYear","currentMonth","currentDate","shouldDisableNextMonth","shouldDisablePrevMonth","calendarGrid","grid","setFullYear","setMonth","setDate","monthStartDay","getDay","i","push","gridDate","buildCalendarGrid","handleChangeHours","replace","hours","getTime","setHours","hoursStr","handleChangeMinutes","minutes","setMinutes","minutesStr","d","dateCopy","role","tabIndex","handleDateSelect","inputMode","formatDateToString","code","today","formatTime","formatSubmitLabel","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","selectedMessagesCount","selectSelectedMessagesCount","canDeleteMessages","canReportMessages","canPost","openForwardMenuForSelectedMessages","isDeleteModalOpen","openDeleteModal","closeDeleteModal","useFlag","isReportModalOpen","openReportModal","closeReportModal","captureKeyboardListeners","onBackspace","onDelete","onEsc","prevSelectedMessagesCount","renderingSelectedMessagesCount","formattedMessagesCount","destructive","onSelect","buttonRef","activeElement","privateChatUserId","privateChatUser","isPinned","selectIsChatPinned","isMuted","selectIsChatMuted","selectNotifySettings","selectNotifyExceptions","withUsername","contextActions","useChatContextActions","handleDelete","handleClick","useSelectWithEnter","avatarSize","DeleteChatModal","runThrottled","cb","userIds","topUserIds","topPeers","usersById","users","recentlyFoundChatIds","globalSearch","onReset","loadTopUsers","loadContactList","openChat","addRecentlyFoundChatId","clearRecentlyFoundChats","topUsersRef","useHorizontalScroll","shouldReplaceHistory","lastSyncTime","searchQuery","mediaThumbnail","mediaBlobUrl","isRoundVideo","getMessageRoundVideo","withOnlineStatus","isSavedMessages","isSelf","isVerified","VerifiedIcon","Link","formatPastTimeShort","getMessageSummaryText","highlight","renderMessageSummary","searchDate","suggestions","match","suggestion","latestYear","getSuggestionsFromDate","localContactIds","contactList","fetchingStatus","globalResults","localResults","globalChatIds","globalUserIds","localChatIds","localUserIds","byChatId","globalMessagesByChatId","dateSearchQuery","onSearchDateSelect","searchMessagesGlobal","setGlobalSearchChatId","shouldShowMoreLocal","setShouldShowMoreLocal","shouldShowMoreGlobal","setShouldShowMoreGlobal","handleLoadMore","LoadMoreDirection","Backwards","query","handleChatClick","handlePickerItemClick","MEMO_EMPTY_ARRAY","foundContactIds","fullName","getUserFullName","username","foundMessages","split","sort","a","b","handleClickShowMoreLocal","handleClickShowMoreGlobal","nothingFound","noScrollRestoreOnTop","noFastList","NothingFound","PickerSelectedItem","chatOrUserId","clickArg","createMapStateToProps","props","currentType","isVoice","theme","selectTheme","isLoading","searchChatId","handleSelectMedia","canRenderContents","useAsyncRendering","SLIDE_TRANSITION_DURATION","isMediaGrid","isMessageList","itemSelector","Media","idPrefix","getSenderName","senderName","isChatGroup","handleMessageFocus","shouldDrawDateDivider","toYearMonth","formatMonthAndYear","WebLink","onMessageClick","Document","withDate","datetime","smaller","onDateClick","openAudioPlayer","handlePlayAudio","Audio","onPlay","TABS","GlobalSearchContent","ChatList","Links","Files","Music","Voice","CHAT_TABS","slice","TRANSITION_RENDER_COUNT","keys","currentContent","setGlobalSearchContent","setGlobalSearchDate","activeTab","setActiveTab","parseDateString","handleSwitchTab","tab","content","handleSearchDateSelect","TabList","tabs","onSwitchTab","renderCount","INITIAL_STATE","currentPassword","password","hint","email","twoFaReducer","state","action","payload","currentScreen","editedFolderId","onSaveFilter","signOut","deleteChatFolder","isSignOutDialogOpen","setIsSignOutDialogOpen","isDeleteFolderDialogOpen","setIsDeleteFolderDialogOpen","openSignOutConfirmation","closeSignOutConfirmation","openDeleteFolderConfirmation","closeDeleteFolderConfirmation","handleSignOutMessage","handleDeleteFolderMessage","SettingsMenuButton","SettingsScreens","EditProfile","General","Notifications","Privacy","Language","GeneralChatBackground","GeneralChatBackgroundColor","PrivacyPhoneNumber","PrivacyLastSeen","PrivacyProfilePhoto","PrivacyForwarding","PrivacyGroupChats","PrivacyPhoneNumberAllowedContacts","PrivacyLastSeenAllowedContacts","PrivacyProfilePhotoAllowedContacts","PrivacyForwardingAllowedContacts","PrivacyGroupChatsAllowedContacts","PrivacyPhoneNumberDeniedContacts","PrivacyLastSeenDeniedContacts","PrivacyProfilePhotoDeniedContacts","PrivacyForwardingDeniedContacts","PrivacyGroupChatsDeniedContacts","PrivacyActiveSessions","PrivacyBlockedUsers","TwoFaDisabled","TwoFaEnabled","TwoFaNewPassword","TwoFaChangePasswordNew","TwoFaChangePasswordConfirm","TwoFaNewPasswordConfirm","TwoFaNewPasswordHint","TwoFaChangePasswordHint","TwoFaNewPasswordEmail","TwoFaRecoveryEmail","TwoFaNewPasswordEmailCode","TwoFaRecoveryEmailCode","TwoFaCongratulations","TwoFaChangePasswordCurrent","TwoFaTurnOff","TwoFaRecoveryEmailCurrentPassword","Folders","FoldersCreateFolder","FoldersEditFolder","FoldersEditFolderFromChatList","FoldersIncludedChats","FoldersIncludedChatsFromChatList","FoldersExcludedChats","FoldersExcludedChatsFromChatList","renderHeaderContent","confirmIsDestructive","currentUser","onScreenSelect","Main","formatPhoneNumberWithCode","phoneNumber","LINK_PREFIX_REGEX","USERNAME_REGEX","runDebouncedForCheckUsername","debounce","currentUsername","asLink","isUsernameAvailable","checkUsername","setUsername","langPrefix","usernameSuccess","usernameError","test","handleUsernameChange","newUsername","trim","isValid","isUsernameValid","success","readOnly","profileEdit","firstName","currentFirstName","lastName","currentLastName","fullInfo","bio","currentBio","currentAvatarHash","loadCurrentUser","updateProfile","isUsernameTouched","setIsUsernameTouched","isProfileFieldsTouched","setIsProfileFieldsTouched","setError","setPhoto","setFirstName","setLastName","setBio","currentAvatarBlobUrl","ProfileEditProgress","InProgress","isUsernameError","isSaveButtonShown","Complete","handlePhotoChange","newPhoto","handleFirstNameChange","handleLastNameChange","handleBioChange","handleProfileSave","trimmedFirstName","trimmedLastName","trimmedBio","AvatarEditable","UsernameInput","FloatingActionButton","runThrottledForLoadRecommended","orderedIds","orderedFolderIds","foldersById","recommended","recommendedChatFolders","chatFolders","notifySettings","notifyExceptions","onCreateFolder","onEditFolder","loadRecommendedChatFolders","addChatFolder","showDialog","animationData","setAnimationData","isAnimationLoaded","setIsAnimationLoaded","handleAnimationLoad","getAnimationData","then","handleCreateFolder","data","userFolders","folder","subtitle","getFolderDescriptionText","handleCreateFolderFromRecommended","AnimatedSticker","STICKER_SIZE_FOLDER_SETTINGS","noLoop","onLoad","pill","fluid","narrow","multiline","ShowMoreButton","count","itemName","itemPluralName","ERROR_NO_TITLE","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","listType","renderChats","mode","visibleChatIds","isExpanded","leftChatsCount","clickHandler","chatType","INCLUDED_CHAT_TYPES","find","typeKey","EXCLUDED_CHAT_TYPES","inactive","renderChatType","event","isTouched","folderUpdate","selectedIds","filterValue","onSelectedIdsChange","onSelectedChatTypesChange","onFilterChange","chatTypes","shouldMinimize","hasMaxChats","handleItemClick","newSelectedIds","splice","handleChatTypeClick","newSelectedChatTypes","selectedType","isMinimized","canClose","Checkbox","checked","isSelected","withChatType","archivedPinnedIds","chatFilter","activeChatArrays","prepareChatList","archivedChatArrays","pinnedChats","otherChats","displayedIds","newFilter","handleSelectedIdsChange","ids","includeFilters","excludeFilters","handleSelectedChatTypesChange","newFilters","forEach","shownScreen","handleReset","handleEditFolder","handleAddIncludedChats","handleAddExcludedChats","range","handleChange","trackWidth","possibleValuesLength","option","STICKER_SIZE_PICKER_HEADER","stickerSet","observeIntersection","isIntersecting","useIsIntersecting","mediaHash","lottieData","Lottie","shouldRenderFullMedia","useTransitionForMedia","getFirstLetters","hasThumbnail","stickers","firstSticker","isAnimated","STICKER_SIZE_GENERAL_SETTINGS","StickerButton","sticker","ANIMATION_LEVEL_OPTIONS","stickerSetIds","added","setIds","stickerSetsById","setsById","messageTextSize","messageSendKeyCombo","shouldAutoDownloadMediaFromContacts","shouldAutoDownloadMediaInPrivateChats","shouldAutoDownloadMediaInGroups","shouldAutoDownloadMediaInChannels","shouldAutoPlayGifs","shouldAutoPlayVideos","shouldSuggestStickers","shouldLoopStickers","setSettingOption","loadStickerSets","loadAddedStickers","stickerSettingsRef","observe","observeIntersectionForCovers","useIntersectionObserver","rootRef","isModalOpen","openModal","closeModal","setSticker","KEYBOARD_SEND_OPTIONS","subLabel","IS_MAC_OS","handleAnimationLevelChange","newLevel","_","handleMessageTextSizeChange","newSize","documentElement","setProperty","setAttribute","handleStickerSetClick","stickerSets","installedDate","onCheck","isChecked","fromSticker","fileSelector","openSystemFilesDialog","accept","callback","noMultiple","removeAttribute","onchange","click","hex2rgb","param","parseInt","substring","rgb2hex","p0","p1","p2","rgb2hsb","r","g","h","s","v","hsb2rgb","f","p","q","t","getPatternColor","rgbColor","hue","saturation","wallpaper","slug","localMediaHash","previewBlobUrl","thumbRef","useCanvasBlur","thumbnail","dataUri","shouldRenderThumb","isDownloadAllowed","setIsDownloadAllowed","fullMedia","wasDownloadDisabled","UPLOADING_WALLPAPER_SLUG","cacheKeyRef","handleSelect","blob","fetchBlob","cacheApi","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","onCapture","onDrag","onRelease","withCursor","hex","hueHex","w","ctx","imgData","createImageData","pixels","col","perY","st","ed","perX","putImageData","drawColor","drawHue","handleRgbChange","rgbValue","channel","handleHexChange","hexValue","handlePredefinedColorClick","dataset","data-color","hasPrivateChatsNotifications","hasPrivateChatsMessagePreview","hasGroupNotifications","hasGroupMessagePreview","hasBroadcastNotifications","hasBroadcastMessagePreview","hasContactJoinedNotifications","hasWebNotifications","hasPushNotifications","notificationSoundVolume","loadNotificationSettings","updateContactSignUpNotification","updateNotificationSettings","updateWebNotificationSettings","handleSettingsChange","peerType","setting","currentIsSilent","currentShouldShowPreviews","shouldShowPreviews","handleContactNotificationChange","volume","hasPassword","isSensitiveEnabled","canChangeSensitive","privacy","blocked","activeSessions","blockedCount","totalCount","sessionsCount","visibilityPrivacyPhoneNumber","visibility","visibilityPrivacyLastSeen","lastSeen","visibilityPrivacyProfilePhoto","profilePhoto","visibilityPrivacyForwarding","forwards","visibilityPrivacyGroupChats","chatInvite","loadPrivacySettings","loadBlockedContacts","loadAuthorizations","loadContentSettings","updateContentSettings","getVisibilityValue","languages","language","loadLanguages","selectedLanguage","setSelectedLanguage","markIsLoading","unmarkIsLoading","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","renderSession","handler","dateActive","appName","ip","sessions","chatsByIds","usersByIds","blockedIds","unblockContact","handleUnblockClick","contactId","viewportOffset","isPrivate","CHAT_HEIGHT_PX","renderContact","animatedEmoji","selectAnimatedEmoji","AnimatedEmoji","expectedPassword","submitLabel","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","handleSelectedContactIdsChange","contactsIds","itemIds","filterPlaceholder","searchInputId","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","renderCurrentSectionContent","LAYERS_ANIMATION_NAME","contactIds","serverTimeOffset","resultIds","sortUserIds","forceShowSelf","isSearching","selectedMemberIds","onSelectedMemberIdsChange","onNextStep","setGlobalSearchQuery","isUserBot","canBeInvitedToGroup","handleNextStep","creationProgress","creationError","chatCreation","memberIds","createGroupChat","createChannel","setTitle","about","setAbout","ChatCreationProgress","handleTitleChange","handleCreateGroup","handleCreateChannel","renderedError","RENDER_COUNT","LeftColumnContent","onContentChange","newChatMemberIds","setNewChatMemberIds","NewChannelStep2","NewGroupStep2","isStepActive","NewChannelStep1","NewGroupStep1","Archived","folderType","IGNORED_KEYS","Down","ArrowDown","Up","ArrowUp","ArrowLeft","ArrowRight","PageUp","PageDown","End","Home","Tab","preventDefaultForScrollKeys","HTMLElement","tagName","getAttribute","isTextBox","disableScrolling","passive","ontouchmove","onkeydown","enableScrolling","getCopyLabel","hasSelection","MessageContextMenu","anchor","canSendNow","canReschedule","canReply","canEdit","canPin","canUnpin","canForward","canFaveSticker","canUnfaveSticker","canCopy","canCopyLink","canSelect","onReply","onEdit","onPin","onReport","onFaveSticker","onUnfaveSticker","onSend","onReschedule","onCloseAnimationEnd","onCopyLink","copyOptions","afterEffect","getMessageText","canImageBeCopied","hasMessageLocalBlobUrl","CLIPBOARD_ITEM_SUPPORTED","selection","getSelection","Promise","resolve","mediaLoader","copyImageToClipboard","anchorNode","parentNode","clipboardText","copyTextToClipboard","getMessageCopyOptions","getTriggerElement","getRootElement","getMenuElement","positionY","useContextMenuPosition","Menu","noOptions","isScheduled","chatUsername","setReplyingToId","setEditingId","faveSticker","unfaveSticker","toggleMessageSelection","sendScheduledMessages","rescheduleMessage","isMenuOpen","setIsMenuOpen","setIsDeleteModalOpen","setIsReportModalOpen","isPinModalOpen","setIsPinModalOpen","isCalendarOpen","openCalendar","closeCalendar","closeMenu","closePinModal","handleCloseCalendar","handleReply","handleEdit","handlePin","handleUnpin","handleFaveSticker","handleUnfaveSticker","handleSelectMessage","params","childMessageIds","withShift","handleScheduledMessageSend","handleOpenCalendar","handleRescheduleMessage","scheduledAt","handleCopyLink","abs","reportMessageIds","scheduledMaxDate","getDayStartAt","selectStickerSet","stickerSetId","loadStickers","toggleStickerSet","sendMessage","throttleMs","isDisabled","stickerSetAccessHash","isPreloadedGlobally","handleButtonClick","hasCloseButton","STICKER_SIZE_MODAL","isRestricted","canDeleteChat","getCanDeleteChat","canStartBot","canRestartBot","canSubscribe","canSearch","canMute","canLeave","onSubscribeChannel","onSearchClick","updateChatMutedState","enterMessageSelectMode","sendBotCommand","restartBot","handleStartBot","command","handleRestartBot","handleToggleMuteClick","handleSubscribe","handleSearch","handleSelectMessages","Portal","runDebouncedForSearch","results","selectCurrentTextSearch","isHistoryCalendarOpen","setLocalTextSearchQuery","searchTextMessagesLocal","closeLocalTextSearch","openHistoryCalendar","focusedIndex","setFocusedIndex","visualViewport","mainEl","pageTop","Array","from","input","div","contentEditable","handleMessageSearchQueryChange","newQuery","handleUp","newFocusIndex","handleDown","SearchInput","findInViewport","selectorOrElements","margin","isDense","shouldContainBottom","isHorizontal","viewportY1","viewportY2","allElements","visibleIndexes","isFound","y1","y2","isFullyVisible","setTooltipItemVisible","selector","first","position","fastSmoothScroll","onInsertUserName","filteredUsers","getSelectedIndex","newIndex","cycleRestrict","selectedMentionIndex","setSelectedMentionIndex","handleArrowKey","handleUserSelect","forceFocus","handleSelectMention","member","onUp","onDown","onTab","prevChatMembers","renderedChatMembers","attachments","caption","isReady","groupChatMembers","recentEmojis","baseEmojiKeywords","emojiKeywords","addRecentEmoji","onCaptionUpdate","onFileAppend","onClear","hideTimeoutRef","prevAttachments","renderingAttachments","isHovered","markHovered","unmarkHovered","isQuick","every","quick","isMentionTooltipOpen","mentionFilter","closeMentionTooltip","insertMention","mentionFilteredUsers","useMentionTooltip","EDITABLE_INPUT_MODAL_ID","isEmojiTooltipOpen","closeEmojiTooltip","filteredEmojis","insertEmoji","useEmojiTooltip","sendAttachments","handleFilesDrop","dataTransfer","newFiles","file","CONTENT_TYPES_FOR_QUICK_UPLOAD","has","areAllPhotos","mimeType","areAllVideos","renderHeader","onDragEnter","onDrop","onDragOver","onDragLeave","relatedTarget","toTarget","fromTarget","data-attach-description","attachment","File","filename","extension","getFileExtension","previewData","emojis","onEmojiSelect","MessageInput","isAttachmentModalInput","html","editableInputId","onUpdate","shouldSetFocus","questionInputRef","optionsListRef","solutionRef","question","setQuestion","setOptions","isAnonymous","setIsAnonymous","isMultipleAnswers","setIsMultipleAnswers","isQuizMode","setIsQuizMode","solution","setSolution","correctOption","setCorrectOption","hasErrors","setHasErrors","focusInput","solutionEl","innerHTML","addNewOption","newOptions","list","scrollHeight","scrollTo","behavior","handleCreate","questionTrimmed","optionsTrimmed","o","summary","answers","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","canSendStickers","loadRecentStickers","loadFavoriteStickers","addRecentSticker","activeSetIndex","setActiveSetIndex","areAddedLoaded","allSets","noPopulatedSets","set","stickerSetEl","handleStickerSelect","handleStickerUnfave","fullClassName","buttonClassName","gif","videoData","shouldRenderVideo","preload","savedGifs","gifs","saved","canSendGifs","onGifSelect","loadSavedGifs","debounceMs","SymbolMenuTabs","SYMBOL_MENU_TAB_TITLES","SYMBOL_MENU_TAB_ICONS","Emoji","Stickers","GIFs","onRemoveSymbol","onSearchOpen","renderTabButton","handleSearchOpen","isActivated","isLeftColumnShown","allowedAttachmentOptions","setRecentEmojis","handleMouseEnter","handleMouseLeave","useMouseInside","fastRaf","recentEmojisRef","renderContent","onMouseEnter","onMouseLeave","noCloseOnBackdrop","onFileSelect","onPollCreate","handleQuickSelect","handleDocumentSelect","canAttachMedia","canAttachPolls","autoClose","forEmoji","clearStickersForEmoji","prevStickers","displayedStickers","onSilentSend","onScheduleSend","listEmojis","usePrevDuringAnimation","selectedIndex","setSelectedIndex","setItemVisible","emojisCount","handleSelectEmoji","onLeft","onRight","thumbUrl","thumbnailDataUrl","decoding","isForGallery","inlineResult","webThumbnail","STICKER_SIZE_INLINE_BOT_RESULT","botId","isGallery","inlineBotResults","switchPm","loadMore","onSelectResult","handleSelectInlineBotResult","handleSendPm","startParam","prevInlineBotResults","renderedInlineBotResults","sensitiveArea","inlineBotResult","messagesById","foundResults","senderUser","getGlobal","senderChat","forwardInfo","isChannelPost","orderBy","foundResult","preloadBackwards","LastMessageMeta","selectShouldLoopStickers","isSomeModalOpen","onModalToggle","isAdded","areStickersLoaded","useOnChange","coverStickerIds","covers","otherStickers","handleAddClick","canRenderStickers","STICKER_SIZE_SEARCH","selectCurrentStickerSearch","featured","featuredIds","loadFeaturedStickers","setIsModalOpen","selectCurrentGifSearch","isChatWithBot","selectIsChatWithBot","searchMoreGifs","setGifSearchQuery","getAllowedAttachmentOptions","handleGifClick","hasResults","answer","voters","offsets","pollResults","offset","answerVote","totalVoters","loadPollOptionResults","closePollResults","prevVotersCount","votersCount","setIsLoading","areVotersLoaded","limit","shouldResetVoters","handleViewMoreClick","handleMemberClick","noStatusOrTyping","leftVotersCount","renderViewMoreButton","total","getMessagePoll","resultsByOption","buildCollectionByKey","management","updateContact","deleteUser","deleteHistory","closeManagement","isDeleteDialogOpen","openDeleteDialog","closeDeleteDialog","isNotificationsEnabled","setIsNotificationsEnabled","ManagementProgress","handleNotificationChange","handleDeleteContact","withFullInfo","hasLinkedChannel","linkedChatId","isBasicGroup","canChangeInfo","isCreator","getHasAdminRight","canBanUsers","togglePreHistoryHidden","updateChat","deleteChat","leaveChannel","deleteChannel","currentTitle","currentAbout","imageHash","handleClickEditType","ManagementScreens","ChatPrivacyType","handleClickDiscussion","Discussion","handleClickPermissions","GroupPermissions","handleClickAdministrators","ChatAdministrators","handleSetPhoto","handleAboutChange","handleUpdateGroup","trimmedTitle","trimmedAbout","handleClickMembers","GroupMembers","handleTogglePreHistory","isPreHistoryHidden","isEnabled","enabledPermissionsCount","defaultBannedRights","sendStickers","sendGifs","adminsCount","adminMembers","handleDeleteGroup","formatInteger","onChatMemberSelect","updateChatDefaultBannedRights","permissions","setPermissions","havePermissionChanged","setHavePermissionChanged","handleRemovedUsersClick","GroupRemovedUsers","handleAddExceptionClick","GroupUserPermissionsCreate","handleExceptionMemberClick","promotedByUserId","GroupUserPermissions","handlePermissionChange","getUpdatedPermissionValue","handleSavePermissions","bannedRights","removedUsersCount","kickedMembers","exceptionMembers","members","getMemberExceptions","langKey","getLangKeyForBannedRightKey","translatedString","sendMessages","blocking","sendMedia","sendPolls","embedLinks","inviteUsers","pinMessages","changeInfo","updateChatMemberBannedRights","removedMembers","getRemovedBy","kickedByUserId","kickedByUser","getContextActions","isSignaturesShown","toggleSignatures","hasLinkedChat","handleUpdateChannel","handleToggleSignatures","handleClickSubscribers","ChannelSubscribers","handleDeleteChannel","selectManagement","checkPublicLink","updatePublicLink","updatePrivateLink","privateLink","inviteLink","privacyType","setPrivacyType","isRevokeConfirmDialogOpen","openRevokeConfirmDialog","closeRevokeConfirmDialog","canUpdate","handleOptionChange","handleSave","handleRevokePrivateLink","langPrefix1","langPrefix2","SafeLink","forDiscussionIds","linkedChat","loadGroupsForDiscussion","linkDiscussionGroup","unlinkDiscussionGroup","linkedGroupId","setLinkedGroupId","isConfirmUnlinkGroupDialogOpen","openConfirmUnlinkGroupDialog","closeConfirmUnlinkGroupDialog","isConfirmLinkGroupDialogOpen","openConfirmLinkGroupDialog","closeConfirmLinkGroupDialog","handleUnlinkGroupSessions","channelId","Initial","handleLinkGroupSessions","renderLinkGroupHeader","linkedGroup","renderLinkGroupConfirmText","hasPrivateLink","STICKER_SIZE_DISCUSSION_GROUPS","teactFastList","teactOrderKey","isButtonsInOneRow","isPromotedByCurrentUser","isFormFullyDisabled","selectedChatMemberId","isBanConfirmationDialogOpen","openBanConfirmationDialog","closeBanConfirmationDialog","selectedChatMember","handleBanFromGroup","viewMessages","getControlIsDisabled","isOwner","handleAdminMemberClick","ChatAdminRights","getMemberStatus","promotedByUser","GroupRecentActions","updateChatAdmin","setIsTouched","isDismissConfirmationDialogOpen","openDismissConfirmationDialog","closeDismissConfirmationDialog","customTitle","setCustomTitle","adminRights","handleDismissAdmin","memberStatus","handleCustomTitleChange","postMessages","editMessages","banUsers","addAdmins","anonymous","maxLength","openUserInfo","memberId","managementType","selectCurrentManagementType","CURRENCIES","USD","EUR","GBP","JPY","RUB","UAH","INR","AED","getCurrencySign","currency","VISA","MASTERCARD1","MASTERCARD2","CardType","cards","Default","Visa","Mastercard","detectCardType","cardNumber","streetLine1","streetLine2","city","countryIso2","postCode","phone","shipping","cardholder","expiry","cvv","billingCountry","billingZip","saveInfo","saveCredentials","formErrors","reducer","getBillingCountry","countryCode","countryList","useFocusAfterAnimation","animationDuration","hasArrow","labelText","htmlFor","needEmail","needPhone","needName","needAddress","phoneRef","selectCountryRef","handleAddress1Change","handleAddress2Change","handleCityChange","handleStateChange","handleCountryChange","handlePostCodeChange","handleFullNameChange","handleEmailChange","handlePhoneChange","handleSaveInfoChange","shippingOptions","handleShippingSelect","amount","renderPaymentItem","main","renderCheckoutItem","invoiceContent","prices","shippingPrices","checkoutInfo","totalPrice","photoUrl","paymentMethod","paymentProvider","shippingAddress","shippingMethod","item","expiryInputRef","charAt","parts","formatCardExpiry","cardNumberRef","cardType","setCardType","newCardType","formatCardNumber","cardIcon","mastercardIconPath","visaIconPath","getCardIcon","canSaveCredentials","needCardholderName","needCountry","needZip","handleCardNumberChange","handleCardholderChange","toUpperCase","handleExpiryChange","handleCvvChange","handleBillingPostCodeChange","handleChangeSaveCredentials","savedInfo","invoice","nativeProvider","nativeParams","passwordMissing","payment","isProviderError","nameRequested","phoneRequested","emailRequested","shippingAddressRequested","flexible","phoneToProvider","emailToProvider","globalDialogs","validateRequestedInfo","sendPaymentForm","setPaymentStep","sendCredentialsInfo","clearPaymentError","paymentState","paymentDispatch","currencySign","field","fieldError","errors","getShippingErrors","handleErrorModalClose","PaymentStep","Checkout","shippingOption","getShippingPrices","totalPrices","concat","acc","cur","getTotalPrice","detectCardTypeText","findShippingOption","getCheckoutInfo","validateRequest","requestInfo","getRequestInfo","sendCredentials","credentials","expiryMonth","expiryYear","zip","getCredentials","sendForm","shippingOptionId","setStep","nextStep","ShippingInfo","Shipping","PaymentInfo","buttonText","cuurentStep","renderModalContent","renderError","optionId","receipt","mapedPrices","info","totalAmount","credentialsTitle","fullAddress","ANIMATED_STICKERS_PATHS","MonkeyIdle","MonkeyTracking","MonkeyClose","MonkeyPeek","FoldersAll","FoldersNew","DiscussionGroups","path","location","cropperResultOptions","quality","format","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","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","onInputChange","setPassword","canSubmit","setCanSubmit","select","autoComplete","MIN_PASSWORD_LENGTH"],"mappings":"+lEAeO,SAASA,EACdC,EACAC,EACAC,EACAC,EACAC,EACAC,GAEA,MAAQC,QAASC,GAAcC,EAASP,EAAQI,GAChD,IAAKE,EACH,OAGF,MAAQE,MAAOC,GAAgBC,IAAWC,OAExCH,MAAOI,EAAgBC,OAAQC,GAC7BC,YAAkChB,EAAWI,IACzCK,MAAOQ,EAASH,OAAQI,GAAaC,YAC3CN,EAAgBE,EAAiBZ,EAAWM,MAAON,EAAWW,QAE1DM,GAAUV,EAAcO,GAAW,EACnCI,EAgPR,SAAsBrB,GACpB,MAAMsB,EAAMC,OAAOC,WAAWC,KAC9B,IAAIC,EAAe,MACf1B,IACF0B,GAA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kBACVC,QAnCR,WACEs3C,GAA4BF,IAmCtBj2B,KAAK,SACLC,SAAU,EACVvF,MAAM,8BAEN,uBAAG9b,UAAWq3C,EAAoB,WAAa,sBAGlD2iC,GACC,kBAAC,IAAD,CAAQh0E,KAAK,SAASI,QAAM,EAAC0nB,UAAWA,GACrC4oB,O","file":"3.33a9836ed01b17d89349.js","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';\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 '.active .media-viewer-content img, .active .media-viewer-content 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 === MediaViewerOrigin.ProfileAvatar);\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, shouldAppendProfileInfo = false) {\n const ghost = document.createElement('div');\n ghost.classList.add('ghost');\n\n const img = new Image();\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 (shouldAppendProfileInfo) {\n ghost.classList.add('ProfileInfo');\n const profileInfo = document.querySelector('#RightColumn .ProfileInfo .info');\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('.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) {\n topOffsetRem += mql.matches ? 0.875 : 3.375;\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 = `.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 .ChatInfo .Avatar';\n mediaSelector = 'img.avatar-media';\n break;\n\n case MediaViewerOrigin.ProfileAvatar:\n containerSelector = '#RightColumn .ProfileInfo .active .ProfilePhoto';\n mediaSelector = 'img.avatar-media';\n break;\n\n case MediaViewerOrigin.ScheduledInline:\n case MediaViewerOrigin.Inline:\n default:\n containerSelector = `.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[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.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, { FC, useCallback } from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\nimport { ApiChat, ApiMessage, ApiUser } from '../../api/types';\n\nimport { getSenderTitle, isChatPrivate } 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 { pick } from '../../util/iteratees';\nimport useLang from '../../hooks/useLang';\n\nimport Avatar from '../common/Avatar';\n\nimport './SenderInfo.scss';\n\ntype OwnProps = {\n chatId?: number;\n messageId?: number;\n isAvatar?: boolean;\n};\n\ntype StateProps = {\n sender?: ApiUser | ApiChat;\n message?: ApiMessage;\n};\n\ntype DispatchProps = Pick;\n\nconst SenderInfo: FC = ({\n chatId, messageId, sender, isAvatar, message, closeMediaViewer, focusMessage,\n}) => {\n const handleFocusMessage = useCallback(() => {\n closeMediaViewer();\n focusMessage({ chatId, messageId });\n }, [chatId, focusMessage, messageId, closeMediaViewer]);\n\n const lang = useLang();\n\n if (!sender || (!message && !isAvatar)) {\n return undefined;\n }\n\n const isFromChat = sender.id < 0;\n const senderTitle = getSenderTitle(lang, sender);\n\n return (\n
\n {isFromChat ? (\n \n ) : (\n \n )}\n
\n
\n {senderTitle && renderText(senderTitle)}\n
\n
\n {isAvatar ? lang('lng_mediaview_profile_photo') : formatMediaDateTime(lang, message!.date * 1000)}\n
\n
\n
\n );\n};\n\nexport default withGlobal(\n (global, { chatId, messageId, isAvatar }): StateProps => {\n if (isAvatar && chatId) {\n return {\n sender: isChatPrivate(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 (setGlobal, actions): DispatchProps => pick(actions, ['closeMediaViewer', 'focusMessage']),\n)(SenderInfo);\n","import React, { FC, useMemo } from '../../lib/teact/teact';\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 useMediaDownload from '../../hooks/useMediaDownload';\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 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 onCloseMediaViewer,\n onForward,\n onZoomToggle,\n}) => {\n const {\n isDownloadStarted,\n downloadProgress,\n handleDownloadClick,\n } = useMediaDownload(\n message && isVideo ? getMessageMediaHash(message, 'download') : undefined,\n fileName,\n );\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 if (IS_SINGLE_COLUMN_LAYOUT) {\n return (\n
\n \n {!isAvatar && (\n \n {lang('Forward')}\n \n )}\n {isVideo ? (\n \n {isDownloadStarted ? `${Math.round(downloadProgress * 100)}% Downloading...` : 'Download'}\n \n ) : (\n \n {lang('AccActionDownload')}\n \n )}\n \n {isDownloadStarted && }\n
\n );\n }\n\n return (\n
\n {!isAvatar && (\n <>\n \n \n \n \n )}\n {isVideo ? (\n \n {isDownloadStarted ? (\n \n ) : (\n \n )}\n \n ) : (\n \n \n \n )}\n \n \n \n \n \n \n
\n );\n};\n\nexport default MediaViewerActions;\n","import React, { FC, useEffect, useState } from '../../lib/teact/teact';\n\nimport { throttle } from '../../util/schedulers';\nimport { TextPart } from '../common/helpers/renderMessageText';\nimport buildClassName from '../../util/buildClassName';\nimport { REM } from '../common/helpers/mediaDimensions';\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../util/environment';\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\nexport default (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","import React, { FC, useState, useEffect } from '../../lib/teact/teact';\n\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../util/environment';\nimport { formatMediaDuration } from '../../util/dateFormat';\nimport formatFileSize from './helpers/formatFileSize';\nimport useLang from '../../hooks/useLang';\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 isForceVisible: boolean;\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 onSeek: OnChangeHandler;\n};\n\ntype OnChangeHandler = (e: React.ChangeEvent) => void;\n\nconst stopEvent = (e: React.MouseEvent) => {\n e.stopPropagation();\n};\n\nconst HIDE_CONTROLS_TIMEOUT_MS = 800;\n\nconst VideoPlayerControls: FC = ({\n bufferedProgress,\n currentTime,\n duration,\n fileSize,\n isForceVisible,\n isForceMobileVersion,\n isPlayed,\n isFullscreenSupported,\n isFullscreen,\n onChangeFullscreen,\n onPlayPause,\n onSeek,\n}) => {\n const [isVisible, setVisibility] = useState(true);\n\n useEffect(() => {\n if (isForceVisible) {\n setVisibility(isForceVisible);\n }\n }, [isForceVisible]);\n\n useEffect(() => {\n let timeout: number | undefined;\n\n if (!isForceVisible) {\n if (IS_SINGLE_COLUMN_LAYOUT) {\n setVisibility(false);\n } else {\n timeout = window.setTimeout(() => {\n setVisibility(false);\n }, HIDE_CONTROLS_TIMEOUT_MS);\n }\n }\n\n return () => {\n if (timeout) {\n window.clearTimeout(timeout);\n }\n };\n }, [isForceVisible]);\n\n useEffect(() => {\n if (isVisible || isForceVisible) {\n document.body.classList.add('video-controls-visible');\n }\n\n return () => {\n document.body.classList.remove('video-controls-visible');\n };\n }, [isForceVisible, isVisible]);\n\n const lang = useLang();\n\n if (!isVisible && !isForceVisible) {\n return undefined;\n }\n\n return (\n
\n {renderSeekLine(currentTime, duration, bufferedProgress, onSeek)}\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(downloadedPercent: number, totalSize: number) {\n return (\n
\n {`${formatFileSize(totalSize * downloadedPercent)} / ${formatFileSize(totalSize)}`}\n
\n );\n}\n\nfunction renderSeekLine(currentTime: number, duration: number, bufferedProgress: number, onSeek: OnChangeHandler) {\n const percentagePlayed = (currentTime / duration) * 100;\n const percentageBuffered = bufferedProgress * 100;\n\n return (\n
\n
\n \n \n \n
\n
\n );\n}\n\nexport default VideoPlayerControls;\n","import React, {\n FC, memo, useCallback, useEffect, useRef, useState,\n} from '../../lib/teact/teact';\n\nimport { ApiDimensions } from '../../api/types';\n\nimport { IS_IOS, IS_SINGLE_COLUMN_LAYOUT, IS_TOUCH_ENV } from '../../util/environment';\nimport useShowTransition from '../../hooks/useShowTransition';\nimport useBuffering from '../../hooks/useBuffering';\nimport useFullscreenStatus from '../../hooks/useFullscreen';\nimport useVideoCleanup from '../../hooks/useVideoCleanup';\nimport safePlay from '../../util/safePlay';\n\nimport VideoPlayerControls from './VideoPlayerControls';\nimport ProgressSpinner from '../ui/ProgressSpinner';\nimport Button from '../ui/Button';\n\nimport './VideoPlayer.scss';\n\ntype OwnProps = {\n url?: string;\n isGif?: boolean;\n posterData?: string;\n posterSize?: ApiDimensions;\n downloadProgress?: number;\n fileSize: number;\n isMediaViewerOpen?: boolean;\n noPlay?: boolean;\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 downloadProgress,\n fileSize,\n isMediaViewerOpen,\n noPlay,\n onClose,\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 const [isControlsVisible, setIsControlsVisible] = useState(true);\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 videoRef.current!.play();\n setIsPlayed(true);\n }\n }, [isPlayed]);\n\n useVideoCleanup(videoRef, []);\n\n const handleMouseOver = useCallback(() => {\n setIsControlsVisible(true);\n }, []);\n\n const handleMouseOut = useCallback(() => {\n setIsControlsVisible(false);\n }, []);\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 }, []);\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((e: React.ChangeEvent) => {\n e.stopPropagation();\n\n videoRef.current!.currentTime = (Number(e.target.value) * videoRef.current!.duration) / 100;\n }, []);\n\n const toggleControls = useCallback((e: React.MouseEvent) => {\n e.stopPropagation();\n setIsControlsVisible(!isControlsVisible);\n }, [isControlsVisible]);\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 \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, {\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","/*\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: any;\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('.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, {\n FC, memo, useCallback, useEffect, useMemo, useRef, useState,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\nimport {\n ApiChat, ApiMediaFormat, ApiMessage, ApiUser, ApiDimensions,\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 windowSize from '../../util/windowSize';\nimport {\n AVATAR_FULL_DIMENSIONS,\n MEDIA_VIEWER_MEDIA_QUERY,\n calculateMediaViewerDimensions,\n} from '../common/helpers/mediaDimensions';\nimport {\n selectChat,\n selectChatMessage,\n selectChatMessages,\n selectCurrentMediaSearch,\n selectListedIds,\n selectOutlyingIds,\n selectScheduledMessage,\n selectScheduledMessages,\n selectUser,\n} from '../../modules/selectors';\nimport {\n getChatAvatarHash,\n getChatMediaMessageIds,\n getMessageFileName,\n getMessageMediaFormat,\n getMessageMediaHash,\n getMessageMediaThumbDataUri,\n getMessagePhoto,\n getMessageVideo,\n getMessageDocument,\n isMessageDocumentPhoto,\n isMessageDocumentVideo,\n getMessageWebPagePhoto,\n getMessageWebPageVideo,\n getPhotoFullDimensions,\n getVideoDimensions, getMessageFileSize,\n} from '../../modules/helpers';\nimport { pick } from '../../util/iteratees';\nimport { captureEvents, SwipeDirection } from '../../util/captureEvents';\nimport captureEscKeyListener from '../../util/captureEscKeyListener';\nimport { stopCurrentAudio } from '../../util/audioPlayer';\nimport useForceUpdate from '../../hooks/useForceUpdate';\nimport useMedia from '../../hooks/useMedia';\nimport useMediaWithDownloadProgress from '../../hooks/useMediaWithDownloadProgress';\nimport useBlurSync from '../../hooks/useBlurSync';\nimport usePrevious from '../../hooks/usePrevious';\nimport { dispatchHeavyAnimationEvent } from '../../hooks/useHeavyAnimationCheck';\nimport { renderMessageText } from '../common/helpers/renderMessageText';\nimport { animateClosing, animateOpening } from './helpers/ghostAnimation';\nimport useLang from '../../hooks/useLang';\nimport useHistoryBack from '../../hooks/useHistoryBack';\n\nimport Spinner from '../ui/Spinner';\nimport ShowTransition from '../ui/ShowTransition';\nimport Transition from '../ui/Transition';\nimport Button from '../ui/Button';\nimport SenderInfo from './SenderInfo';\nimport MediaViewerActions from './MediaViewerActions';\nimport MediaViewerFooter from './MediaViewerFooter';\nimport VideoPlayer from './VideoPlayer';\nimport ZoomControls from './ZoomControls';\nimport PanZoom from './PanZoom';\n\nimport './MediaViewer.scss';\n\ntype StateProps = {\n chatId?: number;\n threadId?: number;\n messageId?: number;\n senderId?: number;\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\ntype DispatchProps = Pick;\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 openMediaViewer,\n closeMediaViewer,\n openForwardMenu,\n focusMessage,\n animationLevel,\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 isPhoto = Boolean(!isVideo && (photo || webPagePhoto || isDocumentPhoto));\n const { isGif } = video || webPageVideo || {};\n const isAvatar = Boolean(avatarOwner);\n\n /* Navigation */\n const isSingleSlide = Boolean(webPagePhoto || webPageVideo);\n const messageIds = useMemo(() => {\n return isSingleSlide && messageId\n ? [messageId]\n : getChatMediaMessageIds(chatMessages || {}, collectionIds || [], isFromSharedMedia);\n }, [isSingleSlide, messageId, 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 ? 'mv-slide' : 'none';\n const headerAnimation = animationLevel === 2 ? 'slide-fade' : 'none';\n const isGhostAnimation = animationLevel === 2;\n\n /* Controls */\n const [isFooterHidden, setIsFooterHidden] = useState(false);\n const [canPanZoomWrap, setCanPanZoomWrap] = useState(false);\n const [isZoomed, setIsZoomed] = useState(false);\n const [zoomLevel, setZoomLevel] = useState(1);\n const [panDelta, setPanDelta] = useState({ x: 0, y: 0 });\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 blobUrlPictogram = 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 blobUrlPreview = useMedia(\n previewMediaHash,\n undefined,\n isAvatar && previewMediaHash && previewMediaHash.startsWith('profilePhoto')\n ? ApiMediaFormat.DataUri\n : ApiMediaFormat.BlobUrl,\n undefined,\n isGhostAnimation && ANIMATION_DURATION,\n );\n const { mediaData: fullMediaData, downloadProgress } = useMediaWithDownloadProgress(\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 || fullMediaData)) || blobUrlPreview || blobUrlPictogram;\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 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 useEffect(() => {\n if (isGhostAnimation && isOpen && !prevMessage && !prevAvatarOwner) {\n dispatchHeavyAnimationEvent(ANIMATION_DURATION + ANIMATION_END_DELAY);\n const textParts = message ? renderMessageText(message) : undefined;\n const hasFooter = Boolean(textParts);\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,\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({ x: 0, y: 0 });\n };\n\n const handleZoomToggle = useCallback(() => {\n setIsZoomed(!isZoomed);\n setZoomLevel(!isZoomed ? 1.5 : 1);\n if (isZoomed) {\n setPanDelta({ x: 0, y: 0 });\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 focusMessage({ chatId, threadId, messageId });\n }, [close, chatId, threadId, focusMessage, messageId]);\n\n const handleForward = useCallback(() => {\n openForwardMenu({ fromChatId: chatId, messageIds: [messageId] });\n closeZoom();\n }, [openForwardMenu, chatId, messageId]);\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 => {\n let index = messageIds.indexOf(fromId);\n if ((direction === -1 && index > 0) || (direction === 1 && index < messageIds.length - 1)) {\n index += direction;\n }\n\n return messageIds[index];\n }, [messageIds]);\n\n const selectPreviousMedia = useCallback(() => {\n if (isFirst) {\n return;\n }\n\n openMediaViewer({\n chatId,\n threadId,\n messageId: messageId ? getMessageId(messageId, -1) : undefined,\n origin,\n });\n }, [chatId, threadId, getMessageId, isFirst, messageId, openMediaViewer, origin]);\n\n const selectNextMedia = useCallback(() => {\n if (isLast) {\n return;\n }\n\n openMediaViewer({\n chatId,\n threadId,\n messageId: messageId ? getMessageId(messageId, 1) : undefined,\n origin,\n });\n }, [chatId, threadId, getMessageId, isLast, messageId, openMediaViewer, origin]);\n\n useEffect(() => {\n const handleKeyDown = (e: KeyboardEvent) => {\n switch (e.key) {\n case 'Left': // IE/Edge specific value\n case 'ArrowLeft':\n selectPreviousMedia();\n break;\n\n case 'Right': // IE/Edge specific value\n case 'ArrowRight':\n selectNextMedia();\n break;\n }\n };\n\n document.addEventListener('keydown', handleKeyDown, false);\n\n return () => {\n document.removeEventListener('keydown', handleKeyDown, false);\n };\n });\n\n // Support for swipe gestures and closing on click\n useEffect(() => {\n const element = document.querySelector('.slide-container > .active, .slide-container > .to');\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, .media-viewer-footer${!shouldCloseOnVideo ? ', .VideoPlayer' : ''}`,\n onClick: () => {\n if (!isZoomed && !IS_TOUCH_ENV) {\n close();\n }\n },\n onSwipe: IS_TOUCH_ENV ? (e, direction) => {\n if (direction === SwipeDirection.Right) {\n selectPreviousMedia();\n } else if (direction === SwipeDirection.Left) {\n selectNextMedia();\n } else if (!(e.target && (e.target as HTMLElement).closest('.MediaViewerFooter'))) {\n close();\n }\n } : undefined,\n });\n }, [close, isFooterHidden, isGif, isPhoto, isZoomed, selectNextMedia, selectPreviousMedia]);\n\n const handlePan = useCallback((x: number, y: number) => {\n setPanDelta({ x, y });\n }, []);\n\n const handleToggleFooterVisibility = useCallback(() => {\n if (IS_TOUCH_ENV && (isPhoto || isGif)) {\n setIsFooterHidden(!isFooterHidden);\n }\n }, [isFooterHidden, isGif, isPhoto]);\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 function renderSlide(isActive: boolean) {\n if (isAvatar) {\n return (\n
\n {renderPhoto(\n fullMediaData || blobUrlPreview,\n calculateMediaViewerDimensions(AVATAR_FULL_DIMENSIONS, false),\n !IS_SINGLE_COLUMN_LAYOUT && !isZoomed,\n )}\n
\n );\n } else if (message) {\n const textParts = renderMessageText(message);\n const hasFooter = Boolean(textParts);\n\n return (\n \n {isPhoto && renderPhoto(\n localBlobUrl || fullMediaData || blobUrlPreview || blobUrlPictogram,\n message && calculateMediaViewerDimensions(dimensions!, hasFooter),\n !IS_SINGLE_COLUMN_LAYOUT && !isZoomed,\n )}\n {isVideo && (\n \n )}\n {textParts && (\n \n )}\n \n );\n }\n\n return undefined;\n }\n\n function renderSenderInfo() {\n return isAvatar ? (\n \n ) : (\n \n );\n }\n\n return (\n \n {() => (\n <>\n
\n {IS_SINGLE_COLUMN_LAYOUT && (\n \n \n \n )}\n \n {renderSenderInfo}\n \n \n
\n \n \n {renderSlide}\n \n \n {!isFirst && (\n \n )}\n {!isLast && (\n \n )}\n \n \n )}\n \n );\n};\n\nfunction renderPhoto(blobUrl?: string, imageSize?: ApiDimensions, canDrag?: boolean) {\n return blobUrl\n ? (\n \n )\n : (\n \n \n \n );\n}\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const {\n chatId, threadId, messageId, avatarOwnerId, profilePhotoIndex, 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 (setGlobal, actions): DispatchProps => pick(actions, [\n 'openMediaViewer', 'closeMediaViewer', 'openForwardMenu', 'focusMessage',\n ]),\n)(MediaViewer));\n","import React, {\n FC, useMemo, useState, memo, useRef, useEffect, useCallback,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\nimport { ApiChat, MAIN_THREAD_ID } from '../../api/types';\n\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../util/environment';\nimport {\n getCanPostInChat, getChatTitle, isChatPrivate, sortChatIds,\n} from '../../modules/helpers';\nimport searchWords from '../../util/searchWords';\nimport { pick, unique } from '../../util/iteratees';\nimport useInfiniteScroll from '../../hooks/useInfiniteScroll';\nimport useLang from '../../hooks/useLang';\nimport useKeyboardListNavigation from '../../hooks/useKeyboardListNavigation';\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 PrivateChatInfo from '../common/PrivateChatInfo';\nimport GroupChatInfo from '../common/GroupChatInfo';\n\nimport './ForwardPicker.scss';\n\nexport type OwnProps = {\n isOpen: boolean;\n};\n\ntype StateProps = {\n chatsById: Record;\n pinnedIds?: number[];\n activeListIds?: number[];\n archivedListIds?: number[];\n orderedPinnedIds?: number[];\n currentUserId?: number;\n};\n\ntype DispatchProps = Pick;\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\nconst ForwardPicker: FC = ({\n chatsById,\n pinnedIds,\n activeListIds,\n archivedListIds,\n currentUserId,\n isOpen,\n setForwardChatId,\n exitForwardMode,\n loadMoreChats,\n}) => {\n const [filter, setFilter] = useState('');\n // eslint-disable-next-line no-null/no-null\n const inputRef = useRef(null);\n\n const lang = useLang();\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 setTimeout(() => {\n setFilter('');\n }, MODAL_HIDE_DELAY_MS);\n }\n }, [isOpen]);\n\n const chatIds = useMemo(() => {\n const listIds = [\n ...activeListIds || [],\n ...archivedListIds || [],\n ];\n\n let priorityIds = pinnedIds || [];\n if (currentUserId) {\n priorityIds = unique([currentUserId, ...priorityIds]);\n }\n\n return sortChatIds([\n ...listIds.filter((id) => {\n const chat = chatsById[id];\n if (!chat) {\n return true;\n }\n\n if (!getCanPostInChat(chat, MAIN_THREAD_ID)) {\n return false;\n }\n\n if (!filter) {\n return true;\n }\n\n return searchWords(getChatTitle(lang, chatsById[id], undefined, id === currentUserId), filter);\n }),\n ], chatsById, undefined, priorityIds);\n }, [activeListIds, archivedListIds, chatsById, currentUserId, filter, lang, pinnedIds]);\n\n const [viewportIds, getMore] = useInfiniteScroll(loadMoreChats, chatIds, Boolean(filter));\n\n const handleFilterChange = useCallback((e: React.ChangeEvent) => {\n setFilter(e.currentTarget.value);\n }, []);\n\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n const handleKeyDown = useKeyboardListNavigation(containerRef, isOpen, (index) => {\n if (viewportIds && viewportIds.length > 0) {\n setForwardChatId({ id: viewportIds[index === -1 ? 0 : index] });\n }\n }, '.ListItem-button', true);\n\n const modalHeader = (\n
\n \n \n \n \n
\n );\n\n return (\n \n {viewportIds && viewportIds.length ? (\n \n {viewportIds.map((id) => (\n setForwardChatId({ id })}\n >\n {isChatPrivate(id) ? (\n \n ) : (\n \n )}\n \n ))}\n \n ) : viewportIds && !viewportIds.length ? (\n

Sorry, nothing found.

\n ) : (\n \n )}\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 pinnedIds: orderedPinnedIds.active,\n activeListIds: listIds.active,\n archivedListIds: listIds.archived,\n currentUserId,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['setForwardChatId', 'exitForwardMode', 'loadMoreChats']),\n)(ForwardPicker));\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\nimport { ApiError, ApiInviteInfo } from '../../api/types';\n\nimport getReadableErrorText from '../../util/getReadableErrorText';\nimport { pick } from '../../util/iteratees';\nimport useLang from '../../hooks/useLang';\nimport renderText from '../common/helpers/renderText';\n\nimport Modal from '../ui/Modal';\nimport Button from '../ui/Button';\n\nimport './Dialogs.scss';\n\ntype StateProps = {\n dialogs: (ApiError | ApiInviteInfo)[];\n};\n\ntype DispatchProps = Pick;\n\nconst Dialogs: FC = ({ dialogs, dismissDialog, acceptInviteConfirmation }) => {\n const lang = useLang();\n\n if (!dialogs.length) {\n return undefined;\n }\n\n const renderInvite = (invite: ApiInviteInfo) => {\n const {\n hash, title, participantsCount, isChannel,\n } = invite;\n\n const handleJoinClick = () => {\n acceptInviteConfirmation({\n hash,\n });\n dismissDialog();\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\n return (\n \n {participantsCount !== undefined &&

{participantsText}

}\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) => {\n if ('hash' in dialog) {\n return renderInvite(dialog);\n }\n\n return renderError(dialog);\n };\n\n return (\n
\n {dialogs.map(renderDialog)}\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 (setGlobal, actions): DispatchProps => pick(actions, ['dismissDialog', 'acceptInviteConfirmation']),\n)(Dialogs));\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\nimport { ApiNotification } from '../../api/types';\n\nimport { pick } from '../../util/iteratees';\n\nimport Notification from '../ui/Notification';\nimport renderText from '../common/helpers/renderText';\n\ntype StateProps = {\n notifications: ApiNotification[];\n};\n\ntype DispatchProps = Pick;\n\nconst Notifications: FC = ({ notifications, dismissNotification }) => {\n if (!notifications.length) {\n return undefined;\n }\n\n return (\n
\n {notifications.map(({ message }) => (\n \n ))}\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => pick(global, ['notifications']),\n (setGlobal, actions): DispatchProps => pick(actions, ['dismissNotification']),\n)(Notifications));\n","import React, { FC, memo, useCallback } from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\n\nimport { pick } from '../../util/iteratees';\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\ntype DispatchProps = Pick;\n\nconst SafeLinkModal: FC = ({ url, toggleSafeLinkModal }) => {\n const lang = useLang();\n\n const handleOpen = useCallback(() => {\n window.open(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(withGlobal(\n undefined,\n (setGlobal, actions): DispatchProps => pick(actions, ['toggleSafeLinkModal']),\n)(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 } from '../../util/dateFormat';\nimport useLang, { LangFn } from '../../hooks/useLang';\nimport usePrevious from '../../hooks/usePrevious';\n\nimport Modal from '../ui/Modal';\nimport Button from '../ui/Button';\n\nimport './CalendarModal.scss';\n\nexport type OwnProps = {\n selectedAt?: 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 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 const defaultSelectedDate = useMemo(() => (selectedAt ? new Date(selectedAt) : new Date()), [selectedAt]);\n const maxDate = maxAt ? new Date(maxAt) : undefined;\n const prevIsOpen = usePrevious(isOpen);\n\n const [selectedDate, setSelectedDate] = useState(defaultSelectedDate);\n const [selectedHours, setSelectedHours] = useState(\n formatInputTime(defaultSelectedDate.getHours()),\n );\n const [selectedMinutes, setSelectedMinutes] = useState(\n formatInputTime(defaultSelectedDate.getMinutes()),\n );\n\n const currentYear = selectedDate.getFullYear();\n const currentMonth = selectedDate.getMonth();\n const currentDate = selectedDate.getDate();\n\n useEffect(() => {\n if (!prevIsOpen && isOpen) {\n setSelectedDate(defaultSelectedDate);\n }\n }, [isOpen, defaultSelectedDate, prevIsOpen]);\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 calendarGrid = useMemo(() => (\n buildCalendarGrid(currentYear, currentMonth)\n ), [currentMonth, currentYear]);\n\n function handlePrevMonth() {\n setSelectedDate((d) => {\n const dateCopy = new Date(d);\n dateCopy.setMonth(dateCopy.getMonth() - 1);\n\n return dateCopy;\n });\n }\n\n function handleNextMonth() {\n setSelectedDate((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\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${selectedDate.getMonth() + 1}`)}\n {' '}\n {selectedDate.getFullYear()}\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 {calendarGrid.map((gridDate) => (\n handleDateSelect(gridDate)}\n className={buildClassName(\n 'day-button',\n isDisabledDay(\n currentYear, currentMonth, gridDate, isFutureMode ? now : undefined, isPastMode ? now : maxDate,\n )\n ? 'disabled'\n : `${gridDate ? 'clickable' : ''}`,\n gridDate === currentDate && 'selected',\n )}\n >\n {!!gridDate && (\n {gridDate}\n )}\n
\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 grid: number[] = [];\n\n const date = new Date();\n date.setFullYear(year);\n date.setMonth(month);\n date.setDate(1);\n\n const monthStartDay = date.getDay() || 7;\n // Fill empty cells\n for (let i = 1; i < monthStartDay; i++) {\n grid.push(0);\n }\n\n while (date.getMonth() === month) {\n const gridDate = date.getDate();\n grid.push(gridDate);\n date.setDate(gridDate + 1);\n }\n\n return grid;\n}\n\nfunction isDisabledDay(year: number, month: number, day: number, minDate?: Date, maxDate?: Date) {\n const selectedDay = new Date(year, month, day, 0, 0, 0, 0);\n const fixedMinDate = minDate && new Date(minDate.getFullYear(), minDate.getMonth(), minDate.getDate(), 0, 0, 0, 0);\n const fixedMaxDate = maxDate && new Date(maxDate.getFullYear(), maxDate.getMonth(), maxDate.getDate(), 0, 0, 0, 0);\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 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(date));\n }\n\n return lang('Conversation.ScheduleMessage.SendOn', [day, formatTime(date)]);\n}\n\nexport default memo(CalendarModal);\n","import React, { FC, memo, useCallback } from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\n\nimport { pick } from '../../util/iteratees';\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\ntype DispatchProps = Pick;\n\nconst HistoryCalendar: FC = ({\n isOpen, selectedAt, searchMessagesByDate, closeHistoryCalendar,\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 {\n selectedAt: global.historyCalendarSelectedAt,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'searchMessagesByDate', 'closeHistoryCalendar',\n ]),\n)(HistoryCalendar));\n","import React, { FC, useCallback, memo } from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiMessage } from '../../api/types';\nimport { IAlbum } from '../../types';\n\nimport { GlobalActions } from '../../global/types';\n\nimport {\n selectAllowedMessageActions,\n selectChat,\n selectCurrentMessageList,\n selectUser,\n} from '../../modules/selectors';\nimport {\n isChatPrivate,\n getUserFirstOrLastName,\n getPrivateChatUserId,\n isChatBasicGroup,\n isChatSuperGroup,\n} from '../../modules/helpers';\nimport renderText from './helpers/renderText';\nimport { pick } from '../../util/iteratees';\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\ntype DispatchProps = Pick;\n\nconst DeleteMessageModal: FC = ({\n isOpen,\n isSchedule,\n message,\n album,\n canDeleteForAll,\n contactName,\n willDeleteForCurrentUserOnly,\n willDeleteForAll,\n onClose,\n deleteMessages,\n deleteScheduledMessages,\n}) => {\n const handleDeleteMessageForAll = useCallback(() => {\n const messageIds = album && 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 && 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 && isChatPrivate(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 (setGlobal, actions): DispatchProps => pick(actions, [\n 'deleteMessages', 'deleteScheduledMessages',\n ]),\n)(DeleteMessageModal));\n","import React, { FC, useCallback, memo } from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\n\nimport { selectChat, selectIsChatWithSelf, selectUser } from '../../modules/selectors';\nimport {\n isChatPrivate,\n getUserFirstOrLastName,\n getPrivateChatUserId,\n isChatBasicGroup,\n isChatSuperGroup,\n isChatChannel,\n} from '../../modules/helpers';\nimport { pick } from '../../util/iteratees';\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: number;\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\ntype DispatchProps = Pick;\n\nconst PinMessageModal: FC = ({\n isOpen,\n messageId,\n chatId,\n isChannel,\n isGroup,\n isSuperGroup,\n canPinForAll,\n contactName,\n onClose,\n pinMessage,\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 = isChatPrivate(chatId);\n const isChatWithSelf = selectIsChatWithSelf(global, chatId);\n const chat = selectChat(global, chatId);\n const isChannel = !!chat && isChatChannel(chat);\n const isGroup = !!chat && isChatBasicGroup(chat);\n const isSuperGroup = !!chat && isChatSuperGroup(chat);\n const canPinForAll = (isPrivateChat && !isChatWithSelf) || isSuperGroup || isGroup;\n const contactName = chat && isChatPrivate(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 (setGlobal, actions): DispatchProps => pick(actions, ['pinMessage']),\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?: number;\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 React, {\n FC, useCallback, memo, useEffect,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\n\nimport { selectCanDeleteSelectedMessages, selectCurrentChat, selectUser } from '../../modules/selectors';\nimport {\n isChatPrivate,\n getUserFirstOrLastName,\n getPrivateChatUserId,\n isChatBasicGroup,\n isChatSuperGroup,\n} from '../../modules/helpers';\nimport renderText from '../common/helpers/renderText';\nimport { pick } from '../../util/iteratees';\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\ntype DispatchProps = Pick;\n\nconst DeleteSelectedMessageModal: FC = ({\n isOpen,\n isSchedule,\n selectedMessageIds,\n canDeleteForAll,\n contactName,\n willDeleteForCurrentUserOnly,\n willDeleteForAll,\n onClose,\n deleteMessages,\n deleteScheduledMessages,\n exitMessageSelectMode,\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 && isChatPrivate(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 (setGlobal, actions): DispatchProps => pick(actions, [\n 'deleteMessages',\n 'deleteScheduledMessages',\n 'exitMessageSelectMode',\n ]),\n)(DeleteSelectedMessageModal));\n","import { ChangeEvent } from 'react';\n\nimport React, {\n FC, memo, useCallback, useState,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiReportReason } from '../../api/types';\n\nimport { GlobalActions } from '../../global/types';\n\nimport { pick } from '../../util/iteratees';\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\ntype DispatchProps = Pick;\n\nconst ReportMessageModal: FC = ({\n isOpen,\n messageIds,\n reportMessages,\n exitMessageSelectMode,\n onClose,\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(withGlobal(\n undefined, (setGlobal, actions): DispatchProps => pick(actions, [\n 'reportMessages', 'exitMessageSelectMode',\n ]),\n)(ReportMessageModal));\n","import React, { FC, memo, useEffect } from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions, MessageListType } from '../../global/types';\n\nimport {\n selectCanDeleteSelectedMessages,\n selectCanReportSelectedMessages,\n selectCurrentMessageList,\n selectSelectedMessagesCount,\n} from '../../modules/selectors';\nimport { pick } from '../../util/iteratees';\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';\n\nimport Button from '../ui/Button';\nimport MenuItem from '../ui/MenuItem';\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 selectedMessageIds?: number[];\n};\n\ntype DispatchProps = Pick;\n\nconst MessageSelectToolbar: FC = ({\n canPost,\n isActive,\n messageListType,\n isSchedule,\n selectedMessagesCount,\n canDeleteMessages,\n canReportMessages,\n selectedMessageIds,\n exitMessageSelectMode,\n openForwardMenuForSelectedMessages,\n}) => {\n const [isDeleteModalOpen, openDeleteModal, closeDeleteModal] = useFlag();\n const [isReportModalOpen, openReportModal, closeReportModal] = useFlag();\n\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 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);\n\n const className = buildClassName(\n 'MessageSelectToolbar',\n canPost && 'with-composer',\n isActive && 'shown',\n );\n\n return (\n
\n
\n \n \n \n \n {formattedMessagesCount}\n \n\n {!!selectedMessagesCount && (\n
\n {messageListType !== 'scheduled' && (\n \n \n {lang('Forward')}\n \n \n )}\n {canReportMessages && (\n \n \n {lang('Report')}\n \n \n )}\n \n \n {lang('Delete')}\n \n \n
\n )}\n
\n \n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const { type: messageListType } = selectCurrentMessageList(global) || {};\n const { canDelete } = selectCanDeleteSelectedMessages(global);\n const canReport = selectCanReportSelectedMessages(global);\n const { messageIds: selectedMessageIds } = global.selectedMessages || {};\n\n return {\n isSchedule: messageListType === 'scheduled',\n selectedMessagesCount: selectSelectedMessagesCount(global),\n canDeleteMessages: canDelete,\n canReportMessages: canReport,\n selectedMessageIds,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['exitMessageSelectMode', 'openForwardMenuForSelectedMessages']),\n)(MessageSelectToolbar));\n","import { useCallback, useEffect, useRef } from '../lib/teact/teact';\n\nexport default (\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);\n }, [handleKeyDown]);\n\n return buttonRef;\n};\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 { isChatPrivate, 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';\n\ntype OwnProps = {\n chatId: number;\n withUsername?: boolean;\n onClick: (id: number) => void;\n};\n\ntype StateProps = {\n chat?: ApiChat;\n privateChatUser?: ApiUser;\n isPinned?: boolean;\n isMuted?: boolean;\n};\n\nconst LeftSearchResultChat: FC = ({\n chatId,\n chat,\n privateChatUser,\n isPinned,\n isMuted,\n withUsername,\n onClick,\n}) => {\n const [isDeleteModalOpen, openDeleteModal, closeDeleteModal] = useFlag();\n\n const contextActions = useChatContextActions({\n chat,\n privateChatUser,\n isPinned,\n isMuted,\n handleDelete: openDeleteModal,\n });\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 {isChatPrivate(chatId) ? (\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 privateChatUser = 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 privateChatUser,\n isPinned,\n isMuted,\n };\n },\n)(LeftSearchResultChat));\n","import React, {\n FC, useEffect, useCallback, useRef, memo,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { ApiUser } from '../../../api/types';\n\nimport { getUserFirstOrLastName } from '../../../modules/helpers';\nimport renderText from '../../common/helpers/renderText';\nimport { throttle } from '../../../util/schedulers';\nimport { pick } from '../../../util/iteratees';\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?: number[];\n usersById: Record;\n recentlyFoundChatIds?: number[];\n};\n\ntype DispatchProps = Pick;\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, loadTopUsers, loadContactList, openChat,\n addRecentlyFoundChatId, clearRecentlyFoundChats,\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(\n (id: number) => {\n openChat({ id, shouldReplaceHistory: true });\n onReset();\n setTimeout(() => {\n addRecentlyFoundChatId({ id });\n }, SEARCH_CLOSE_TIMEOUT_MS);\n },\n [openChat, addRecentlyFoundChatId, onReset],\n );\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 (setGlobal, actions): DispatchProps => pick(actions, [\n 'loadTopUsers',\n 'loadContactList',\n 'openChat',\n 'addRecentlyFoundChatId',\n 'clearRecentlyFoundChats',\n ]),\n)(RecentContacts));\n","import React, {\n FC, memo, useCallback,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\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 getMessageSummaryText,\n getMessageMediaThumbDataUri,\n getMessageVideo,\n getMessageRoundVideo,\n} from '../../../modules/helpers';\nimport { selectChat, selectUser } from '../../../modules/selectors';\nimport renderText from '../../common/helpers/renderText';\nimport { pick } from '../../../util/iteratees';\nimport useMedia from '../../../hooks/useMedia';\nimport { formatPastTimeShort } from '../../../util/dateFormat';\nimport useLang, { LangFn } from '../../../hooks/useLang';\nimport useSelectWithEnter from '../../../hooks/useSelectWithEnter';\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: number;\n};\n\ntype StateProps = {\n chat?: ApiChat;\n privateChatUser?: ApiUser;\n lastMessageOutgoingStatus?: ApiMessageOutgoingStatus;\n lastSyncTime?: number;\n};\n\ntype DispatchProps = Pick;\n\nconst ChatMessage: FC = ({\n message,\n searchQuery,\n chatId,\n chat,\n privateChatUser,\n focusMessage,\n lastSyncTime,\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 {renderMessageSummary(lang, message, mediaBlobUrl || mediaThumbnail, searchQuery, isRoundVideo)}\n
\n
\n
\n \n );\n};\n\nfunction renderMessageSummary(\n lang: LangFn, message: ApiMessage, blobUrl?: string, searchQuery?: string, isRoundVideo?: boolean,\n) {\n if (!blobUrl) {\n return renderText(getMessageSummaryText(lang, message));\n }\n\n return (\n \n \"\"\n {getMessageVideo(message) && }\n {renderText(getMessageSummaryText(lang, message, true), ['emoji', 'highlight'], { highlight: 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 (setGlobal, actions): DispatchProps => pick(actions, [\n 'focusMessage',\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 { withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiUser, ApiChat, ApiMessage } from '../../../api/types';\nimport { GlobalActions } from '../../../global/types';\nimport { LoadMoreDirection } from '../../../types';\n\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../../util/environment';\nimport searchWords from '../../../util/searchWords';\nimport { unique, pick } from '../../../util/iteratees';\nimport { getUserFullName, getMessageSummaryText, sortChatIds } from '../../../modules/helpers';\nimport { MEMO_EMPTY_ARRAY } from '../../../util/memo';\nimport { throttle } from '../../../util/schedulers';\nimport useLang from '../../../hooks/useLang';\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?: number;\n localContactIds?: number[];\n localChatIds?: number[];\n localUserIds?: number[];\n globalChatIds?: number[];\n globalUserIds?: number[];\n foundIds?: string[];\n globalMessagesByChatId?: Record }>;\n chatsById: Record;\n usersById: Record;\n fetchingStatus?: { chats?: boolean; messages?: boolean };\n lastSyncTime?: number;\n};\n\ntype DispatchProps = Pick;\n\nconst MIN_QUERY_LENGTH_FOR_GLOBAL_SEARCH = 4;\nconst LESS_LIST_ITEMS_AMOUNT = 3;\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, usersById, fetchingStatus, lastSyncTime,\n onReset, onSearchDateSelect, openChat, addRecentlyFoundChatId, searchMessagesGlobal, setGlobalSearchChatId,\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: number) => {\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: number) => {\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 foundContactIds = localContactIds\n ? localContactIds.filter((id) => {\n const user = usersById[id];\n if (!user) {\n return false;\n }\n\n const fullName = getUserFullName(user);\n return (fullName && searchWords(fullName, searchQuery)) || searchWords(user.username, searchQuery);\n })\n : [];\n\n return [\n ...(currentUserId && searchWords(lang('SavedMessages'), searchQuery) ? [currentUserId] : []),\n ...sortChatIds(unique([\n ...foundContactIds,\n ...(localChatIds || []),\n ...(localUserIds || []),\n ]), chatsById),\n ];\n }, [\n searchQuery, localContactIds, currentUserId, lang, localChatIds, localUserIds, chatsById, usersById,\n ]);\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(unique([...globalChatIds, ...globalUserIds]),\n chatsById, true);\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('_').map(Number);\n\n return (\n globalMessagesByChatId && globalMessagesByChatId[chatId] && globalMessagesByChatId[chatId].byId[messageId]\n );\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 = getMessageSummaryText(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 {!!localResults.length && (\n
\n {localResults.map((id) => (\n \n ))}\n
\n )}\n {!!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 {!!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 {!!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 const { byId: usersById } = global.users;\n\n const { userIds: localContactIds } = global.contactList || {};\n\n if (!localContactIds) {\n return {\n chatsById,\n usersById,\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 && resultsByType.text) || {};\n\n return {\n currentUserId,\n localContactIds,\n localChatIds,\n localUserIds,\n globalChatIds,\n globalUserIds,\n foundIds,\n globalMessagesByChatId,\n chatsById,\n usersById,\n fetchingStatus,\n lastSyncTime,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'openChat',\n 'addRecentlyFoundChatId',\n 'searchMessagesGlobal',\n 'setGlobalSearchChatId',\n ]),\n)(ChatResults));\n","import React, {\n FC, memo, useCallback, useMemo,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiChat, ApiMessage } from '../../../api/types';\nimport { GlobalActions } from '../../../global/types';\nimport { LoadMoreDirection } from '../../../types';\n\nimport { pick } from '../../../util/iteratees';\nimport { getMessageSummaryText } from '../../../modules/helpers';\nimport { MEMO_EMPTY_ARRAY } from '../../../util/memo';\nimport { throttle } from '../../../util/schedulers';\nimport useLang from '../../../hooks/useLang';\n\nimport InfiniteScroll from '../../ui/InfiniteScroll';\nimport ChatMessage from './ChatMessage';\nimport NothingFound from '../../common/NothingFound';\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?: number;\n foundIds?: string[];\n globalMessagesByChatId?: Record }>;\n chatsById: Record;\n fetchingStatus?: { chats?: boolean; messages?: boolean };\n lastSyncTime?: number;\n};\n\ntype DispatchProps = Pick;\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 searchMessagesGlobal,\n onSearchDateSelect,\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('_').map(Number);\n\n return (\n globalMessagesByChatId && globalMessagesByChatId[chatId] && globalMessagesByChatId[chatId].byId[messageId]\n );\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 = getMessageSummaryText(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.length && 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 && resultsByType.text) || {};\n\n return {\n currentUserId,\n foundIds,\n globalMessagesByChatId,\n chatsById,\n fetchingStatus,\n lastSyncTime,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['searchMessagesGlobal']),\n)(ChatMessageResults));\n","import { GlobalState } from '../../../../global/types';\nimport {\n ApiChat, ApiGlobalMessageSearchType, ApiMessage, ApiUser,\n} from '../../../../api/types';\nimport { ISettings } from '../../../../types';\n\nimport { 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?: number;\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 && props.isVoice ? 'voice' : 'audio');\n\n const { byChatId: globalMessagesByChatId } = global.messages;\n const { foundIds } = (resultsByType && resultsByType[currentType]) || {};\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 lastSyncTime: global.lastSyncTime,\n };\n };\n}\n","import React, {\n FC, memo, useCallback, useMemo,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\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 { pick } from '../../../util/iteratees';\nimport buildClassName from '../../../util/buildClassName';\nimport { throttle } from '../../../util/schedulers';\nimport useLang from '../../../hooks/useLang';\nimport useAsyncRendering from '../../right/hooks/useAsyncRendering';\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\ntype DispatchProps = Pick;\n\nconst CURRENT_TYPE = 'media';\nconst runThrottled = throttle((cb) => cb(), 500, true);\n\nconst MediaResults: FC = ({\n searchQuery,\n searchChatId,\n isLoading,\n globalMessagesByChatId,\n foundIds,\n lastSyncTime,\n searchMessagesGlobal,\n openMediaViewer,\n}) => {\n const lang = useLang();\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('_').map(Number);\n\n return globalMessagesByChatId[chatId] && globalMessagesByChatId[chatId].byId[messageId];\n }).filter(Boolean);\n }, [globalMessagesByChatId, foundIds]);\n\n const handleSelectMedia = useCallback((messageId: number, chatId: number) => {\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 (setGlobal, actions): DispatchProps => pick(actions, [\n 'searchMessagesGlobal',\n 'openMediaViewer',\n ]),\n)(MediaResults));\n","import { ApiChat, ApiMessage, ApiUser } from '../../../../api/types';\nimport {\n getChatTitle,\n getSenderTitle,\n isChatPrivate,\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 = isChatPrivate(senderId) ? usersById[senderId] : chatsById[senderId];\n\n let senderName = getSenderTitle(lang, sender);\n\n const chat = chatsById[message.chatId];\n if (chat) {\n if (isChatPrivate(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, {\n FC, memo, useCallback, useMemo,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/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 { pick } from '../../../util/iteratees';\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 WebLink from '../../common/WebLink';\nimport NothingFound from '../../common/NothingFound';\nimport Loading from '../../ui/Loading';\n\nexport type OwnProps = {\n searchQuery?: string;\n};\n\ntype DispatchProps = Pick;\n\nconst CURRENT_TYPE = 'links';\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 searchMessagesGlobal,\n focusMessage,\n}) => {\n const lang = useLang();\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('_').map(Number);\n\n return globalMessagesByChatId[chatId] && globalMessagesByChatId[chatId].byId[messageId];\n }).filter(Boolean);\n }, [globalMessagesByChatId, foundIds]);\n\n const handleMessageFocus = useCallback((messageId: number, chatId: number) => {\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 (setGlobal, actions): DispatchProps => pick(actions, [\n 'searchMessagesGlobal',\n 'focusMessage',\n ]),\n)(LinkResults));\n","import React, {\n FC, memo, useCallback, useMemo,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiMessage } from '../../../api/types';\nimport { GlobalActions } from '../../../global/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 { pick } from '../../../util/iteratees';\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';\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\ntype DispatchProps = Pick;\n\nconst CURRENT_TYPE = 'documents';\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 lastSyncTime,\n searchMessagesGlobal,\n focusMessage,\n}) => {\n const lang = useLang();\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('_').map(Number);\n const message = globalMessagesByChatId[chatId] && globalMessagesByChatId[chatId].byId[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: number) => {\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 (setGlobal, actions): DispatchProps => pick(actions, [\n 'searchMessagesGlobal',\n 'focusMessage',\n ]),\n)(FileResults));\n","import React, {\n FC, memo, useCallback, useMemo,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/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 { pick } from '../../../util/iteratees';\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\ntype DispatchProps = Pick;\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 searchMessagesGlobal,\n focusMessage,\n openAudioPlayer,\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('_').map(Number);\n\n return globalMessagesByChatId[chatId] && globalMessagesByChatId[chatId].byId[messageId];\n }).filter(Boolean);\n }, [globalMessagesByChatId, foundIds]);\n\n const handleMessageFocus = useCallback((messageId: number, chatId: number) => {\n focusMessage({ chatId, messageId });\n }, [focusMessage]);\n\n const handlePlayAudio = useCallback((messageId: number, chatId: number) => {\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 (setGlobal, actions): DispatchProps => pick(actions, [\n 'searchMessagesGlobal',\n 'focusMessage',\n 'openAudioPlayer',\n ]),\n)(AudioResults));\n","import React, {\n FC, memo, useCallback, useState, useMemo, useRef,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { GlobalSearchContent } from '../../../types';\n\nimport { pick } from '../../../util/iteratees';\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?: number;\n};\n\ntype DispatchProps = Pick;\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 setGlobalSearchContent,\n setGlobalSearchDate,\n onReset,\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 (setGlobal, actions): DispatchProps => pick(actions, ['setGlobalSearchContent', 'setGlobalSearchDate']),\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\nexport default () => {\n return useReducer(twoFaReducer, INITIAL_STATE);\n};\n","import React, {\n FC, memo, useCallback, useMemo, useState,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { SettingsScreens } from '../../../types';\n\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../../util/environment';\nimport { pick } from '../../../util/iteratees';\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};\n\ntype DispatchProps = Pick;\n\nconst SettingsHeader: FC = ({\n currentScreen,\n editedFolderId,\n onReset,\n onSaveFilter,\n signOut,\n deleteChatFolder,\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.Notifications:\n return

{lang('Notifications')}

;\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 \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(withGlobal(\n undefined,\n (setGlobal, actions): DispatchProps => pick(actions, ['signOut', 'deleteChatFolder']),\n)(SettingsHeader));\n","import React, { FC, memo } from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { SettingsScreens } from '../../../types';\nimport { ApiUser } from '../../../api/types';\n\nimport { selectUser } from '../../../modules/selectors';\nimport { getUserFullName } from '../../../modules/helpers';\nimport { formatPhoneNumberWithCode } from '../../../util/phoneNumber';\nimport renderText from '../../common/helpers/renderText';\nimport useLang from '../../../hooks/useLang';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport ListItem from '../../ui/ListItem';\nimport Avatar from '../../common/Avatar';\n\ntype OwnProps = {\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\ntype StateProps = {\n currentUser?: ApiUser;\n};\n\nconst SettingsMain: FC = ({\n isActive,\n onScreenSelect,\n onReset,\n currentUser,\n}) => {\n const lang = useLang();\n const fullName = getUserFullName(currentUser);\n\n useHistoryBack(isActive, onReset, onScreenSelect, SettingsScreens.Main);\n\n return (\n
\n
\n {currentUser && (\n
\n \n

{fullName && renderText(fullName)}

\n

{formatPhoneNumberWithCode(currentUser.phoneNumber)}

\n
\n )}\n onScreenSelect(SettingsScreens.EditProfile)}\n >\n {lang('lng_settings_information')}\n \n onScreenSelect(SettingsScreens.Folders)}\n >\n {lang('Filters')}\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.Language)}\n >\n {lang('Language')}\n \n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const { currentUserId } = global;\n\n return {\n currentUser: currentUserId ? selectUser(global, currentUserId) : undefined,\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 { withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiMediaFormat } from '../../../api/types';\nimport { GlobalActions } from '../../../global/types';\nimport { ProfileEditProgress, SettingsScreens } from '../../../types';\n\nimport { throttle } from '../../../util/schedulers';\nimport { pick } from '../../../util/iteratees';\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\ntype DispatchProps = Pick;\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 loadCurrentUser,\n updateProfile,\n checkUsername,\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 (setGlobal, actions): DispatchProps => pick(actions, [\n 'loadCurrentUser',\n 'updateProfile',\n 'checkUsername',\n ]),\n)(SettingsEditProfile));\n","import React, {\n FC, memo, useMemo, useCallback, useState, useEffect,\n} from '../../../../lib/teact/teact';\nimport { withGlobal } from '../../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../../global/types';\nimport { ApiChatFolder, ApiChat, ApiUser } from '../../../../api/types';\nimport { NotifyException, NotifySettings, SettingsScreens } from '../../../../types';\n\nimport { STICKER_SIZE_FOLDER_SETTINGS } from '../../../../config';\nimport { pick } from '../../../../util/iteratees';\nimport { selectNotifyExceptions, selectNotifySettings } from '../../../../modules/selectors';\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';\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 onCreateFolder: () => void;\n onEditFolder: (folder: ApiChatFolder) => void;\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\ntype StateProps = {\n chatsById: Record;\n usersById: Record;\n orderedFolderIds?: number[];\n foldersById: Record;\n recommendedChatFolders?: ApiChatFolder[];\n notifySettings: NotifySettings;\n notifyExceptions?: Record;\n};\n\ntype DispatchProps = Pick;\n\nconst runThrottledForLoadRecommended = throttle((cb) => cb(), 60000, true);\n\nconst MAX_ALLOWED_FOLDERS = 10;\n\nconst SettingsFoldersMain: FC = ({\n onCreateFolder,\n onEditFolder,\n isActive,\n onScreenSelect,\n onReset,\n chatsById,\n usersById,\n orderedFolderIds,\n foldersById,\n recommendedChatFolders,\n notifySettings,\n notifyExceptions,\n loadRecommendedChatFolders,\n addChatFolder,\n showDialog,\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 userFolders = useMemo(() => {\n if (!orderedFolderIds) {\n return undefined;\n }\n\n const chatIds = Object.keys(chatsById).map(Number);\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(\n lang, chatsById, usersById, folder, chatIds, notifySettings, notifyExceptions,\n ),\n };\n });\n }, [orderedFolderIds, chatsById, foldersById, usersById, notifySettings, notifyExceptions, lang]);\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 && 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 && !!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 chats: { byId: chatsById },\n users: { byId: usersById },\n } = global;\n\n const {\n orderedIds: orderedFolderIds,\n byId: foldersById,\n recommended: recommendedChatFolders,\n } = global.chatFolders;\n\n return {\n chatsById,\n usersById,\n orderedFolderIds,\n foldersById,\n recommendedChatFolders,\n notifySettings: selectNotifySettings(global),\n notifyExceptions: selectNotifyExceptions(global),\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['loadRecommendedChatFolders', 'addChatFolder', 'showDialog']),\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 { withGlobal } from '../../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../../global/types';\nimport { SettingsScreens } from '../../../../types';\n\nimport { STICKER_SIZE_FOLDER_SETTINGS } from '../../../../config';\nimport { findIntersectionWithSet, pick } from '../../../../util/iteratees';\nimport { isChatPrivate } 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?: number[];\n loadedArchivedChatIds?: number[];\n};\n\ntype DispatchProps = Pick;\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 editChatFolder,\n addChatFolder,\n loadMoreChats,\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 useEffect(() => {\n if (\n visibleIncludedChatIds.length < includedChatIds.length\n || visibleExcludedChatIds.length < excludedChatIds.length\n ) {\n loadMoreChats({ listType: 'active' });\n }\n }, [\n loadMoreChats,\n excludedChatIds.length,\n includedChatIds.length,\n visibleExcludedChatIds.length,\n visibleIncludedChatIds.length,\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 {isChatPrivate(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 (setGlobal, actions): DispatchProps => pick(actions, ['editChatFolder', 'addChatFolder', 'loadMoreChats']),\n)(SettingsFoldersEdit));\n","import React, {\n FC, useCallback, useRef, useEffect, memo,\n} from '../../../../lib/teact/teact';\n\nimport { isChatPrivate } 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: number[];\n selectedIds: number[];\n selectedChatTypes: string[];\n filterValue?: string;\n onSelectedIdsChange: (ids: number[]) => void;\n onSelectedChatTypesChange: (types: 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_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 onLoadMore,\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: number) => {\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: number) {\n const isSelected = selectedIds.includes(id);\n\n return (\n handleItemClick(id)}\n ripple\n disabled={!isSelected && hasMaxChats}\n >\n {isChatPrivate(id) ? (\n \n ) : (\n \n )}\n \n \n );\n }\n\n const [viewportIds, getMore] = useInfiniteScroll(onLoadMore, 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 && 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 { withGlobal } from '../../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../../global/types';\nimport { ApiChat } from '../../../../api/types';\nimport { SettingsScreens } from '../../../../types';\n\nimport useLang from '../../../../hooks/useLang';\nimport { pick } from '../../../../util/iteratees';\nimport searchWords from '../../../../util/searchWords';\nimport { prepareChatList, getChatTitle } from '../../../../modules/helpers';\nimport {\n FoldersState,\n FolderEditDispatch,\n selectChatFilters,\n} from '../../../../hooks/reducers/useFoldersReducer';\nimport useHistoryBack from '../../../../hooks/useHistoryBack';\n\nimport SettingsFoldersChatsPicker from './SettingsFoldersChatsPicker';\n\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\ntype StateProps = {\n chatsById: Record;\n listIds?: number[];\n orderedPinnedIds?: number[];\n archivedListIds?: number[];\n archivedPinnedIds?: number[];\n};\n\ntype DispatchProps = Pick;\n\nconst SettingsFoldersChatFilters: FC = ({\n isActive,\n onScreenSelect,\n onReset,\n mode,\n state,\n dispatch,\n chatsById,\n listIds,\n orderedPinnedIds,\n archivedListIds,\n archivedPinnedIds,\n loadMoreChats,\n}) => {\n const { chatFilter } = state;\n const { selectedChatIds, selectedChatTypes } = selectChatFilters(state, mode, true);\n\n const lang = useLang();\n const chats = useMemo(() => {\n const activeChatArrays = listIds\n ? prepareChatList(chatsById, listIds, orderedPinnedIds, 'all')\n : undefined;\n const archivedChatArrays = archivedListIds\n ? prepareChatList(chatsById, archivedListIds, archivedPinnedIds, 'archived')\n : undefined;\n\n if (!activeChatArrays && !archivedChatArrays) {\n return undefined;\n }\n\n return [\n ...(activeChatArrays\n ? [...activeChatArrays.pinnedChats, ...activeChatArrays.otherChats]\n : []\n ),\n ...(archivedChatArrays ? archivedChatArrays.otherChats : []),\n ];\n }, [chatsById, listIds, orderedPinnedIds, archivedListIds, archivedPinnedIds]);\n\n const displayedIds = useMemo(() => {\n if (!chats) {\n return undefined;\n }\n\n return chats\n .filter((chat) => (\n !chatFilter\n || searchWords(getChatTitle(lang, chat), chatFilter)\n || selectedChatIds.includes(chat.id)\n ))\n .map(({ id }) => id);\n }, [chats, chatFilter, lang, selectedChatIds]);\n\n const handleFilterChange = useCallback((newFilter: string) => {\n dispatch({\n type: 'setChatFilter',\n payload: newFilter,\n });\n }, [dispatch]);\n\n const handleSelectedIdsChange = useCallback((ids: number[]) => {\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(isActive, onReset, onScreenSelect,\n mode === 'included' ? SettingsScreens.FoldersIncludedChats : SettingsScreens.FoldersExcludedChats);\n\n if (!displayedIds) {\n return ;\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 } = global;\n\n return {\n chatsById,\n listIds: listIds.active,\n orderedPinnedIds: orderedPinnedIds.active,\n archivedPinnedIds: orderedPinnedIds.archived,\n archivedListIds: listIds.archived,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['loadMoreChats']),\n)(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 { 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 range?: { min: number; max: number; step?: number };\n label?: string;\n value: number;\n disabled?: boolean;\n onChange: (value: number) => void;\n};\n\nconst RangeSlider: FC = ({\n options,\n range,\n label,\n value,\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 if (range) {\n const possibleValuesLength = (range.max - range.min) / (range.step || 1);\n return ((value - range.min) / possibleValuesLength) * 100;\n }\n return 0;\n }, [value, options, range]);\n\n const [min, max, step] = useMemo(() => {\n if (options) {\n return [0, options.length - 1, 1];\n } else if (range) {\n return [range.min, range.max, range.step || 1];\n }\n\n return [0, 0, 0];\n }, [range, options]);\n\n return (\n
\n {label && (\n
\n {label}\n {range && (\n {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 React, { FC, memo, useRef } 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 useTransitionForMedia from '../../../hooks/useTransitionForMedia';\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 { shouldRenderFullMedia, transitionClassNames } = useTransitionForMedia(lottieData, 'slow');\n\n return (\n
\n {!shouldRenderFullMedia && getFirstLetters(stickerSet.title, 2)}\n {shouldRenderFullMedia && lottieData && (\n \n )}\n
\n );\n};\n\nexport default memo(StickerSetCoverAnimated);\n","import React, { FC, memo, useRef } from '../../../lib/teact/teact';\n\nimport { ApiStickerSet } from '../../../api/types';\n\nimport { ObserveFn, useIsIntersecting } from '../../../hooks/useIntersectionObserver';\nimport useMedia from '../../../hooks/useMedia';\nimport useTransitionForMedia from '../../../hooks/useTransitionForMedia';\nimport { getFirstLetters } from '../../../util/textFormat';\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 { shouldRenderFullMedia, transitionClassNames } = useTransitionForMedia(mediaData, 'slow');\n\n return (\n
\n {!shouldRenderFullMedia && getFirstLetters(stickerSet.title, 2)}\n {shouldRenderFullMedia && (\n \"\"\n )}\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 && stickerSet.stickers[0];\n\n if (stickerSet.hasThumbnail || !firstSticker) {\n return (\n firstSticker && onClick(firstSticker)}\n >\n \n {stickerSet.isAnimated ? (\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, useEffect, useRef, useState,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { SettingsScreens, ISettings } 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 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 from '../../ui/RadioGroup';\nimport SettingsStickerSet from './SettingsStickerSet';\nimport StickerSetModal from '../../common/StickerSetModal.async';\n\ntype OwnProps = {\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\ntype StateProps = Pick & {\n stickerSetIds?: string[];\n stickerSetsById?: Record;\n};\n\ntype DispatchProps = Pick;\n\nconst ANIMATION_LEVEL_OPTIONS = [\n 'Solid and Steady',\n 'Nice and Fast',\n 'Lots of Stuff',\n];\n\nconst SettingsGeneral: FC = ({\n isActive,\n onScreenSelect,\n onReset,\n stickerSetIds,\n stickerSetsById,\n messageTextSize,\n animationLevel,\n messageSendKeyCombo,\n shouldAutoDownloadMediaFromContacts,\n shouldAutoDownloadMediaInPrivateChats,\n shouldAutoDownloadMediaInGroups,\n shouldAutoDownloadMediaInChannels,\n shouldAutoPlayGifs,\n shouldAutoPlayVideos,\n shouldSuggestStickers,\n shouldLoopStickers,\n setSettingOption,\n loadStickerSets,\n loadAddedStickers,\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 useEffect(() => {\n loadStickerSets();\n }, [loadStickerSets]);\n\n useEffect(() => {\n if (stickerSetIds && stickerSetIds.length) {\n loadAddedStickers();\n }\n }, [stickerSetIds, loadAddedStickers]);\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 handleStickerSetClick = useCallback((value: ApiSticker) => {\n setSticker(value);\n openModal();\n }, [openModal]);\n\n const stickerSets = stickerSetIds && stickerSetIds.map((id: string) => {\n return stickerSetsById && stickerSetsById[id] && 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 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('AutoDownloadMedia')}

\n\n setSettingOption({ shouldAutoDownloadMediaFromContacts: isChecked })}\n />\n setSettingOption({ shouldAutoDownloadMediaInPrivateChats: isChecked })}\n />\n setSettingOption({ shouldAutoDownloadMediaInGroups: isChecked })}\n />\n setSettingOption({ shouldAutoDownloadMediaInChannels: isChecked })}\n />\n
\n\n
\n

{lang('AutoplayMedia')}

\n\n setSettingOption({ shouldAutoPlayGifs: isChecked })}\n />\n setSettingOption({ shouldAutoPlayVideos: isChecked })}\n />\n
\n\n
\n

{lang('AccDescrStickers')}

\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 'shouldAutoDownloadMediaFromContacts',\n 'shouldAutoDownloadMediaInPrivateChats',\n 'shouldAutoDownloadMediaInGroups',\n 'shouldAutoDownloadMediaInChannels',\n 'shouldAutoPlayGifs',\n 'shouldAutoPlayVideos',\n 'shouldSuggestStickers',\n 'shouldLoopStickers',\n 'isSensitiveEnabled',\n 'canChangeSensitive',\n ]),\n stickerSetIds: global.stickers.added.setIds,\n stickerSetsById: global.stickers.setsById,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'setSettingOption', 'loadStickerSets', 'loadAddedStickers',\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 useTransitionForMedia from '../../../hooks/useTransitionForMedia';\nimport buildClassName from '../../../util/buildClassName';\nimport useMedia from '../../../hooks/useMedia';\nimport useMediaWithDownloadProgress from '../../../hooks/useMediaWithDownloadProgress';\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(\n document.thumbnail && document.thumbnail.dataUri,\n Boolean(previewBlobUrl),\n true,\n );\n const {\n shouldRenderThumb, shouldRenderFullMedia, transitionClassNames,\n } = useTransitionForMedia(previewBlobUrl || localBlobUrl, 'slow');\n const [isDownloadAllowed, setIsDownloadAllowed] = useState(false);\n const {\n mediaData: fullMedia, downloadProgress,\n } = useMediaWithDownloadProgress(localMediaHash, !isDownloadAllowed);\n const wasDownloadDisabled = usePrevious(isDownloadAllowed) === false;\n const { shouldRender: shouldRenderSpinner, transitionClassNames: spinnerClassNames } = useShowTransition(\n (isDownloadAllowed && !fullMedia) || slug === UPLOADING_WALLPAPER_SLUG,\n undefined,\n wasDownloadDisabled,\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 setIsDownloadAllowed((isAllowed) => !isAllowed);\n }\n }, [fullMedia, handleSelect]);\n\n const className = buildClassName(\n 'WallpaperTile',\n isSelected && 'selected',\n );\n\n return (\n
\n
\n {shouldRenderThumb && (\n \n )}\n {shouldRenderFullMedia && (\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 { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\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 { pick } from '../../../util/iteratees';\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\ntype DispatchProps = Pick;\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 loadWallpapers,\n uploadWallpaper,\n setThemeSettings,\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 && 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 && 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 (setGlobal, actions): DispatchProps => pick(actions, [\n 'loadWallpapers', 'uploadWallpaper', 'setThemeSettings',\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 { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\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\ntype DispatchProps = Pick;\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 setThemeSettings,\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\n captureEvents(colorPickerRef.current!, {\n onCapture: handleColorDrag,\n onDrag: handleColorDrag,\n onRelease: unmarkIsDragging,\n onClick: unmarkIsDragging,\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\n captureEvents(huePickerRef.current!, {\n onCapture: handleHueDrag,\n onDrag: handleHueDrag,\n onRelease: unmarkIsDragging,\n onClick: unmarkIsDragging,\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 (setGlobal, actions): DispatchProps => pick(actions, ['setThemeSettings']),\n)(SettingsGeneralBackground));\n","import { ChangeEvent } from 'react';\nimport React, {\n FC, memo, useCallback, useEffect,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { SettingsScreens } from '../../../types';\n\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 = {\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\ntype DispatchProps = Pick;\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 loadNotificationSettings,\n updateContactSignUpNotification,\n updateNotificationSettings,\n updateWebNotificationSettings,\n}) => {\n useEffect(() => {\n loadNotificationSettings();\n }, [loadNotificationSettings]);\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 }}\n />\n
\n
\n
\n

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

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

{lang('FilterGroups')}

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

{lang('FilterChannels')}

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

{lang('PhoneOther')}

\n\n \n
\n
\n );\n};\n\nexport default memo(withGlobal((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(setGlobal, actions): DispatchProps => pick(actions, [\n 'loadNotificationSettings',\n 'updateContactSignUpNotification',\n 'updateNotificationSettings',\n 'updateWebNotificationSettings',\n]))(SettingsNotifications));\n","import React, { FC, memo, useEffect } from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { PrivacyVisibility, SettingsScreens } from '../../../types';\n\nimport { pick } from '../../../util/iteratees';\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\ntype DispatchProps = Pick;\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 loadPrivacySettings,\n loadBlockedContacts,\n loadAuthorizations,\n loadContentSettings,\n updateContentSettings,\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 && privacy.phoneNumber.visibility,\n visibilityPrivacyLastSeen: privacy.lastSeen && privacy.lastSeen.visibility,\n visibilityPrivacyProfilePhoto: privacy.profilePhoto && privacy.profilePhoto.visibility,\n visibilityPrivacyForwarding: privacy.forwards && privacy.forwards.visibility,\n visibilityPrivacyGroupChats: privacy.chatInvite && privacy.chatInvite.visibility,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'loadBlockedContacts', 'loadAuthorizations', 'loadPrivacySettings', 'loadContentSettings', 'updateContentSettings',\n ]),\n)(SettingsPrivacy));\n","import React, {\n FC, memo, useCallback, useEffect, useMemo, useState,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { ISettings, SettingsScreens } from '../../../types';\nimport { ApiLanguage } from '../../../api/types';\n\nimport { setLanguage } from '../../../util/langProvider';\nimport { pick } from '../../../util/iteratees';\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\ntype DispatchProps = Pick;\n\nconst SettingsLanguage: FC = ({\n isActive,\n onScreenSelect,\n onReset,\n languages,\n language,\n loadLanguages,\n setSettingOption,\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 setLanguage(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 (setGlobal, actions): DispatchProps => pick(actions, [\n 'loadLanguages', 'setSettingOption',\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 { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { ApiChat, ApiUser } from '../../../api/types';\nimport { ApiPrivacySettings, SettingsScreens } from '../../../types';\n\nimport useLang from '../../../hooks/useLang';\nimport { pick } from '../../../util/iteratees';\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 = Partial & {\n chatsById?: Record;\n usersById?: Record;\n};\n\ntype DispatchProps = Pick;\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 setPrivacyVisibility,\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 { onScreenSelect(allowedContactsScreen); }}\n >\n
\n {allowedCount > 0 && +{allowedCount}}\n {lang('AlwaysShareWith')}\n {lang('EditAdminAddUsers')}\n
\n \n )}\n {exceptionLists.shouldShowDenied && (\n { onScreenSelect(deniedContactsScreen); }}\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 (setGlobal, actions): DispatchProps => pick(actions, ['setPrivacyVisibility']),\n)(SettingsPrivacyVisibility));\n","import React, {\n FC, memo, useCallback, useEffect, useMemo,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { ApiSession } from '../../../api/types';\nimport { SettingsScreens } from '../../../types';\n\nimport { pick } from '../../../util/iteratees';\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\ntype DispatchProps = Pick;\n\nconst SettingsPrivacyActiveSessions: FC = ({\n isActive,\n onScreenSelect,\n onReset,\n activeSessions,\n loadAuthorizations,\n terminateAuthorization,\n terminateAllAuthorizations,\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 >\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 (setGlobal, actions): DispatchProps => pick(actions, [\n 'loadAuthorizations', 'terminateAuthorization', 'terminateAllAuthorizations',\n ]),\n)(SettingsPrivacyActiveSessions));\n","import React, {\n FC, memo, useCallback,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { ApiChat, ApiUser } from '../../../api/types';\nimport { SettingsScreens } from '../../../types';\n\nimport { CHAT_HEIGHT_PX } from '../../../config';\nimport { formatPhoneNumberWithCode } from '../../../util/phoneNumber';\nimport { pick } from '../../../util/iteratees';\nimport {\n getChatTitle, getUserFullName, isChatPrivate,\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';\n\nimport ListItem from '../../ui/ListItem';\nimport FloatingActionButton from '../../ui/FloatingActionButton';\nimport Avatar from '../../common/Avatar';\nimport Loading from '../../ui/Loading';\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: number[];\n};\n\ntype DispatchProps = Pick;\n\nconst SettingsPrivacyBlockedUsers: FC = ({\n isActive,\n onScreenSelect,\n onReset,\n chatsByIds,\n usersByIds,\n blockedIds,\n unblockContact,\n}) => {\n const handleUnblockClick = useCallback((contactId: number) => {\n unblockContact({ contactId });\n }, [unblockContact]);\n\n const lang = useLang();\n\n useHistoryBack(isActive, onReset, onScreenSelect, SettingsScreens.PrivacyBlockedUsers);\n\n function renderContact(contactId: number, i: number, viewportOffset: number) {\n const isPrivate = isChatPrivate(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',\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 && user.phoneNumber && (\n
{formatPhoneNumberWithCode(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 && blockedIds.length ? (\n
\n {blockedIds!.map((contactId, i) => renderContact(contactId, i, 0))}\n
\n ) : blockedIds && !blockedIds.length ? (\n
\n List is empty\n
\n ) : (\n \n )}\n
\n
\n\n {\n }}\n className=\"not-implemented\"\n ariaLabel=\"Add a blocked user\"\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 } = global;\n\n return {\n chatsByIds,\n usersByIds,\n blockedIds: ids,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['unblockContact']),\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 { withGlobal } from '../../../../lib/teact/teactn';\n\nimport { GlobalActions, GlobalState } from '../../../../global/types';\nimport { SettingsScreens } from '../../../../types';\n\nimport { pick } from '../../../../util/iteratees';\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\ntype DispatchProps = Pick;\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 updatePassword,\n checkPassword,\n clearTwoFaError,\n updateRecoveryEmail,\n provideTwoFaEmailCode,\n clearPassword,\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 (setGlobal, actions): DispatchProps => pick(actions, [\n 'updatePassword', 'updateRecoveryEmail', 'clearPassword', 'provideTwoFaEmailCode',\n 'checkPassword', 'clearTwoFaError',\n ]),\n)(SettingsTwoFa));\n","import React, {\n FC, memo, useCallback, useMemo, useState,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions, GlobalState } from '../../../global/types';\nimport { ApiChat } from '../../../api/types';\nimport { ApiPrivacySettings, SettingsScreens } from '../../../types';\n\nimport useLang from '../../../hooks/useLang';\nimport { pick } from '../../../util/iteratees';\nimport searchWords from '../../../util/searchWords';\nimport { getPrivacyKey } from './helper/privacy';\nimport {\n getChatTitle, isChatGroup, isChatPrivate, prepareChatList,\n} from '../../../modules/helpers';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\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?: number;\n chatsById: Record;\n listIds?: number[];\n orderedPinnedIds?: number[];\n archivedListIds?: number[];\n archivedPinnedIds?: number[];\n settings?: ApiPrivacySettings;\n};\n\ntype DispatchProps = Pick;\n\nconst SettingsPrivacyVisibilityExceptionList: FC = ({\n currentUserId,\n isAllowList,\n screen,\n settings,\n chatsById,\n listIds,\n orderedPinnedIds,\n archivedListIds,\n archivedPinnedIds,\n setPrivacySettings,\n isActive,\n onScreenSelect,\n onReset,\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 chats = useMemo(() => {\n const activeChatArrays = listIds\n ? prepareChatList(chatsById, listIds, orderedPinnedIds, 'all')\n : undefined;\n const archivedChatArrays = archivedListIds\n ? prepareChatList(chatsById, archivedListIds, archivedPinnedIds, 'archived')\n : undefined;\n\n if (!activeChatArrays && !archivedChatArrays) {\n return undefined;\n }\n\n return [\n ...(activeChatArrays\n ? [\n ...activeChatArrays.pinnedChats,\n ...activeChatArrays.otherChats,\n ]\n : []\n ),\n ...(archivedChatArrays ? archivedChatArrays.otherChats : []),\n ];\n }, [chatsById, listIds, orderedPinnedIds, archivedListIds, archivedPinnedIds]);\n\n const displayedIds = useMemo(() => {\n if (!chats) {\n return undefined;\n }\n\n return chats\n .filter((chat) => (\n ((isChatPrivate(chat.id) && chat.id !== currentUserId) || isChatGroup(chat))\n && (\n !searchQuery\n || searchWords(getChatTitle(lang, chat), searchQuery)\n || selectedContactIds.includes(chat.id)\n )\n ))\n .map(({ id }) => id);\n }, [chats, currentUserId, lang, searchQuery, selectedContactIds]);\n\n const handleSelectedContactIdsChange = useCallback((value: number[]) => {\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\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 const {\n chats: {\n byId: chatsById,\n listIds,\n orderedPinnedIds,\n },\n currentUserId,\n } = global;\n\n return {\n currentUserId,\n chatsById,\n listIds: listIds.active,\n orderedPinnedIds: orderedPinnedIds.active,\n archivedPinnedIds: orderedPinnedIds.archived,\n archivedListIds: listIds.archived,\n settings: getCurrentPrivacySettings(global, screen),\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['setPrivacySettings']),\n)(SettingsPrivacyVisibilityExceptionList));\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 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';\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.Notifications:\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 { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { ApiUser } from '../../../api/types';\n\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../../util/environment';\nimport { throttle } from '../../../util/schedulers';\nimport searchWords from '../../../util/searchWords';\nimport { pick } from '../../../util/iteratees';\nimport { getUserFullName, 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 contactIds?: number[];\n serverTimeOffset: number;\n};\n\ntype DispatchProps = Pick;\n\nconst runThrottled = throttle((cb) => cb(), 60000, true);\n\nconst ContactList: FC = ({\n isActive, onReset,\n filter, usersById, contactIds, loadContactList, openChat, serverTimeOffset,\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(\n (id: number) => {\n openChat({ id, shouldReplaceHistory: true });\n },\n [openChat],\n );\n\n const listIds = useMemo(() => {\n if (!contactIds) {\n return undefined;\n }\n\n const resultIds = filter ? contactIds.filter((id) => {\n const user = usersById[id];\n if (!user) {\n return false;\n }\n const fullName = getUserFullName(user);\n return fullName && searchWords(fullName, filter);\n }) : contactIds;\n\n return sortUserIds(resultIds, usersById, undefined, serverTimeOffset);\n }, [contactIds, filter, usersById, serverTimeOffset]);\n\n const [viewportIds, getMore] = useInfiniteScroll(undefined, listIds, Boolean(filter));\n\n return (\n \n {viewportIds && 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 } = global.users;\n\n return {\n usersById,\n contactIds,\n serverTimeOffset: global.serverTimeOffset,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['loadContactList', 'openChat']),\n)(ContactList));\n","import React, {\n FC, useCallback, useEffect, useMemo, memo,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { ApiChat, ApiUser } from '../../../api/types';\n\nimport { pick, unique } from '../../../util/iteratees';\nimport { throttle } from '../../../util/schedulers';\nimport searchWords from '../../../util/searchWords';\nimport { getUserFullName, 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: number[];\n onSelectedMemberIdsChange: (ids: number[]) => void;\n onNextStep: () => void;\n onReset: () => void;\n};\n\ntype StateProps = {\n currentUserId?: number;\n usersById: Record;\n chatsById: Record;\n localContactIds?: number[];\n searchQuery?: string;\n isSearching?: boolean;\n localUserIds?: number[];\n globalUserIds?: number[];\n};\n\ntype DispatchProps = Pick;\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 currentUserId,\n usersById,\n chatsById,\n localContactIds,\n searchQuery,\n isSearching,\n localUserIds,\n globalUserIds,\n loadContactList,\n setGlobalSearchQuery,\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 const contactIds = localContactIds\n ? sortChatIds(localContactIds.filter((id) => id !== currentUserId), chatsById)\n : [];\n\n if (!searchQuery) {\n return contactIds;\n }\n\n const foundContactIds = contactIds.filter((id) => {\n const user = usersById[id];\n if (!user) {\n return false;\n }\n const fullName = getUserFullName(user);\n return fullName && searchWords(fullName, searchQuery);\n });\n\n return sortChatIds(\n unique([\n ...foundContactIds,\n ...(localUserIds || []),\n ...(globalUserIds || []),\n ]).filter((contactId) => {\n const user = usersById[contactId];\n\n return !user || !isUserBot(user) || user.canBeInvitedToGroup;\n }),\n chatsById,\n false,\n selectedMemberIds,\n );\n }, [\n localContactIds, chatsById, searchQuery, localUserIds, globalUserIds, selectedMemberIds,\n currentUserId, usersById,\n ]);\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: usersById } = global.users;\n const { byId: chatsById } = global.chats;\n const { currentUserId } = global;\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 currentUserId,\n usersById,\n chatsById,\n localContactIds,\n searchQuery,\n isSearching: fetchingStatus && fetchingStatus.chats,\n globalUserIds,\n localUserIds,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['loadContactList', 'setGlobalSearchQuery']),\n)(NewChatStep1));\n","import React, {\n FC, useState, useCallback, useEffect, memo,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { ChatCreationProgress } from '../../../types';\n\nimport { pick } from '../../../util/iteratees';\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: number[];\n onReset: (forceReturnToChatList?: boolean) => void;\n};\n\ntype StateProps = {\n creationProgress?: ChatCreationProgress;\n creationError?: string;\n};\n\ntype DispatchProps = Pick;\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 createGroupChat,\n createChannel,\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 || (\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 (setGlobal, actions): DispatchProps => pick(actions, [\n 'createGroupChat', 'createChannel',\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","const 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\nconst preventDefault = (e: Event) => {\n e.preventDefault();\n};\n\nfunction preventDefaultForScrollKeys(e: KeyboardEvent) {\n if (IGNORED_KEYS[e.key] && !isTextBox(e.target)) {\n preventDefault(e);\n }\n}\n\nexport function disableScrolling() {\n // Disable scrolling in Chrome\n document.addEventListener('wheel', preventDefault, { passive: false });\n window.ontouchmove = preventDefault; // mobile\n document.onkeydown = preventDefaultForScrollKeys;\n}\n\nexport function enableScrolling() {\n document.removeEventListener('wheel', preventDefault); // Enable scrolling in Chrome\n // eslint-disable-next-line no-null/no-null\n window.ontouchmove = null;\n // eslint-disable-next-line no-null/no-null\n document.onkeydown = null;\n}\n","import { ApiMediaFormat, ApiMessage } from '../../../../api/types';\n\nimport * as mediaLoader from '../../../../util/mediaLoader';\nimport {\n getMessageMediaHash,\n getMessagePhoto,\n getMessageText,\n getMessageWebPagePhoto,\n getMessageWebPageVideo,\n hasMessageLocalBlobUrl,\n} from '../../../../modules/helpers';\nimport { CLIPBOARD_ITEM_SUPPORTED, copyImageToClipboard, copyTextToClipboard } from '../../../../util/clipboard';\n\ntype ICopyOptions = {\n label: string;\n handler: () => void;\n}[];\n\nexport function getMessageCopyOptions(\n message: ApiMessage, afterEffect?: () => void, onCopyLink?: () => 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\n && selection.anchorNode\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 clipboardText = hasSelection && selection ? selection.toString() : text;\n copyTextToClipboard(clipboardText);\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","import React, { FC, useCallback } from '../../../lib/teact/teact';\n\nimport { ApiMessage } from '../../../api/types';\nimport { IAnchorPosition } from '../../../types';\n\nimport { getMessageCopyOptions } from './helpers/copyOptions';\nimport useContextMenuPosition from '../../../hooks/useContextMenuPosition';\nimport useLang from '../../../hooks/useLang';\n\nimport Menu from '../../ui/Menu';\nimport MenuItem from '../../ui/MenuItem';\n\nimport './MessageContextMenu.scss';\n\ntype OwnProps = {\n isOpen: boolean;\n anchor: IAnchorPosition;\n message: ApiMessage;\n canSendNow?: boolean;\n canReschedule?: boolean;\n canReply?: boolean;\n canPin?: 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 canCopyLink?: boolean;\n canSelect?: boolean;\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};\n\nconst SCROLLBAR_WIDTH = 10;\n\nconst MessageContextMenu: FC = ({\n isOpen,\n message,\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 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}) => {\n const copyOptions = getMessageCopyOptions(message, onClose, canCopyLink ? onCopyLink : undefined);\n\n const getTriggerElement = useCallback(() => {\n return document.querySelector(`.active > .MessageList div[data-message-id=\"${message.id}\"]`);\n }, [message.id]);\n\n const getRootElement = useCallback(\n () => document.querySelector('.active > .MessageList'),\n [],\n );\n\n const getMenuElement = useCallback(\n () => document.querySelector('.MessageContextMenu .bubble'),\n [],\n );\n\n const { positionX, positionY, style } = useContextMenuPosition(\n anchor,\n getTriggerElement,\n getRootElement,\n getMenuElement,\n SCROLLBAR_WIDTH,\n (document.querySelector('.MiddleHeader') as HTMLElement).offsetHeight,\n );\n\n const lang = useLang();\n\n return (\n \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 {canForward && {lang('Forward')}}\n {canSelect && {lang('Common.Select')}}\n {canReport && {lang('lng_context_report_msg')}}\n {canDelete && {lang('Delete')}}\n \n );\n};\n\nexport default MessageContextMenu;\n","import React, {\n FC, memo, useCallback, useEffect, useMemo, useState,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions, MessageListType } from '../../../global/types';\nimport { ApiMessage } from '../../../api/types';\nimport { IAlbum, IAnchorPosition } from '../../../types';\nimport { selectAllowedMessageActions, selectCurrentMessageList } from '../../../modules/selectors';\nimport { disableScrolling, enableScrolling } from '../../../util/scrollLock';\nimport { pick } from '../../../util/iteratees';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport useFlag from '../../../hooks/useFlag';\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 { getDayStartAt } from '../../../util/dateFormat';\nimport { copyTextToClipboard } from '../../../util/clipboard';\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 noOptions?: boolean;\n canSendNow?: boolean;\n canReschedule?: boolean;\n canReply?: boolean;\n canPin?: 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 canCopyLink?: boolean;\n canSelect?: boolean;\n};\n\ntype DispatchProps = Pick;\n\nconst ContextMenuContainer: FC = ({\n isOpen,\n messageListType,\n chatUsername,\n message,\n album,\n anchor,\n onClose,\n onCloseAnimationEnd,\n noOptions,\n canSendNow,\n canReschedule,\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 setReplyingToId,\n setEditingId,\n pinMessage,\n openForwardMenu,\n faveSticker,\n unfaveSticker,\n toggleMessageSelection,\n sendScheduledMessages,\n rescheduleMessage,\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 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 && 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 && 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 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 handleCopyLink = useCallback(() => {\n copyTextToClipboard(`https://t.me/${chatUsername || `c/${Math.abs(message.chatId)}`}/${message.id}`);\n closeMenu();\n }, [chatUsername, closeMenu, message.chatId, message.id]);\n\n useEffect(() => {\n disableScrolling();\n\n return enableScrolling;\n }, []);\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 \n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { message, messageListType }): StateProps => {\n const { threadId } = selectCurrentMessageList(global) || {};\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 } = (threadId && selectAllowedMessageActions(global, message, threadId)) || {};\n const isPinned = messageListType === 'pinned';\n const isScheduled = messageListType === 'scheduled';\n\n return {\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: !isScheduled && canForward,\n canFaveSticker: !isScheduled && canFaveSticker,\n canUnfaveSticker: !isScheduled && canUnfaveSticker,\n canCopy,\n canCopyLink: !isScheduled && canCopyLink,\n canSelect,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'setReplyingToId',\n 'setEditingId',\n 'pinMessage',\n 'openForwardMenu',\n 'faveSticker',\n 'unfaveSticker',\n 'toggleMessageSelection',\n 'sendScheduledMessages',\n 'rescheduleMessage',\n ]),\n)(ContextMenuContainer));\n","import React, {\n FC, memo, useCallback, useEffect, useRef,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiSticker, ApiStickerSet } from '../../api/types';\nimport { GlobalActions } from '../../global/types';\n\nimport { STICKER_SIZE_MODAL } from '../../config';\nimport { pick } from '../../util/iteratees';\nimport { selectStickerSet } from '../../modules/selectors';\nimport { useIntersectionObserver } from '../../hooks/useIntersectionObserver';\nimport useLang from '../../hooks/useLang';\nimport renderText from './helpers/renderText';\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 onClose: () => void;\n};\n\ntype StateProps = {\n stickerSet?: ApiStickerSet;\n};\n\ntype DispatchProps = Pick;\n\nconst INTERSECTION_THROTTLE = 200;\n\nconst StickerSetModal: FC = ({\n isOpen,\n fromSticker,\n stickerSet,\n onClose,\n loadStickers,\n toggleStickerSet,\n sendMessage,\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 const { stickerSetId, stickerSetAccessHash } = fromSticker;\n loadStickers({ stickerSetId, stickerSetAccessHash });\n }\n }, [isOpen, fromSticker, loadStickers]);\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 toggleStickerSet({ stickerSetId: fromSticker.stickerSetId });\n onClose();\n }, [fromSticker.stickerSetId, onClose, toggleStickerSet]);\n\n return (\n \n {stickerSet && 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 }: OwnProps) => {\n return { stickerSet: selectStickerSet(global, fromSticker.stickerSetId) };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'loadStickers',\n 'toggleStickerSet',\n 'sendMessage',\n ]),\n)(StickerSetModal));\n","import React, {\n FC, memo, useCallback, useEffect, useState,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\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 { selectChat, selectNotifySettings, selectNotifyExceptions } from '../../modules/selectors';\nimport { pick } from '../../util/iteratees';\nimport { isChatPrivate, getCanDeleteChat, selectIsChatMuted } 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\ntype DispatchProps = Pick;\n\nexport type OwnProps = {\n chatId: number;\n threadId: number;\n isOpen: boolean;\n anchor: IAnchorPosition;\n isChannel?: boolean;\n canStartBot?: boolean;\n canRestartBot?: boolean;\n canSubscribe?: boolean;\n canSearch?: boolean;\n canMute?: boolean;\n canSelect?: boolean;\n canLeave?: 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 canDeleteChat?: boolean;\n};\n\nconst HeaderMenuContainer: FC = ({\n chatId,\n isOpen,\n anchor,\n isChannel,\n canStartBot,\n canRestartBot,\n canSubscribe,\n canSearch,\n canMute,\n canSelect,\n canLeave,\n chat,\n isPrivate,\n isMuted,\n canDeleteChat,\n onSubscribeChannel,\n onSearchClick,\n onClose,\n onCloseAnimationEnd,\n updateChatMutedState,\n enterMessageSelectMode,\n sendBotCommand,\n restartBot,\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 handleSubscribe = useCallback(() => {\n onSubscribeChannel();\n closeMenu();\n }, [closeMenu, onSubscribeChannel]);\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 {IS_SINGLE_COLUMN_LAYOUT && canStartBot && (\n \n {lang('BotStart')}\n \n )}\n {IS_SINGLE_COLUMN_LAYOUT && canRestartBot && (\n \n {lang('BotRestart')}\n \n )}\n {IS_SINGLE_COLUMN_LAYOUT && canSubscribe && (\n \n {lang(isChannel ? 'Subscribe' : 'Join Group')}\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 {canSelect && (\n \n {lang('ReportSelectMessages')}\n \n )}\n {canLeave && (\n \n {lang(isPrivate\n ? 'Delete'\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\n return {\n chat,\n isMuted: selectIsChatMuted(chat, selectNotifySettings(global), selectNotifyExceptions(global)),\n isPrivate: isChatPrivate(chat.id),\n canDeleteChat: getCanDeleteChat(chat),\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'updateChatMutedState',\n 'enterMessageSelectMode',\n 'sendBotCommand',\n 'restartBot',\n ]),\n)(HeaderMenuContainer));\n","import React, {\n FC, memo, useCallback, useEffect, useRef, useState, useLayoutEffect,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiChat } from '../../api/types';\nimport { GlobalActions } from '../../global/types';\n\nimport { debounce } from '../../util/schedulers';\nimport { selectCurrentTextSearch, selectCurrentChat } from '../../modules/selectors';\nimport { pick } from '../../util/iteratees';\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\ntype DispatchProps = Pick;\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 setLocalTextSearchQuery,\n searchTextMessagesLocal,\n focusMessage,\n closeLocalTextSearch,\n openHistoryCalendar,\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 && foundIds && foundIds.length) {\n focusMessage({ chatId: chat.id, messageId: foundIds[foundIds.length - 1] });\n setFocusedIndex(0);\n } else {\n setFocusedIndex(-1);\n }\n }, [chat, 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[foundIds.length - 1 - 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[foundIds.length - 1 - 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 && 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 (setGlobal, actions): DispatchProps => pick(actions, [\n 'setLocalTextSearchQuery',\n 'searchTextMessagesLocal',\n 'focusMessage',\n 'closeLocalTextSearch',\n 'openHistoryCalendar',\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 React, {\n FC, useCallback, useEffect, useState, useRef, memo,\n} from '../../../lib/teact/teact';\nimport usePrevious from '../../../hooks/usePrevious';\n\nimport { ApiUser } from '../../../api/types';\n\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport buildClassName from '../../../util/buildClassName';\nimport captureKeyboardListeners from '../../../util/captureKeyboardListeners';\nimport setTooltipItemVisible from '../../../util/setTooltipItemVisible';\nimport cycleRestrict from '../../../util/cycleRestrict';\n\nimport ListItem from '../../ui/ListItem';\nimport PrivateChatInfo from '../../common/PrivateChatInfo';\n\nimport './MentionTooltip.scss';\n\nexport type OwnProps = {\n isOpen: boolean;\n filter: string;\n onClose: () => void;\n onInsertUserName: (user: ApiUser, forceFocus?: boolean) => void;\n filteredUsers?: ApiUser[];\n usersById?: Record;\n};\n\nconst MentionTooltip: FC = ({\n isOpen,\n filter,\n onClose,\n onInsertUserName,\n usersById,\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 getSelectedIndex = useCallback((newIndex: number) => {\n if (!filteredUsers) {\n return -1;\n }\n const membersCount = filteredUsers!.length;\n return cycleRestrict(membersCount, newIndex);\n }, [filteredUsers]);\n\n const [selectedMentionIndex, setSelectedMentionIndex] = useState(-1);\n\n const handleArrowKey = useCallback((value: number, e: KeyboardEvent) => {\n e.preventDefault();\n setSelectedMentionIndex((index) => (getSelectedIndex(index + value)));\n }, [setSelectedMentionIndex, getSelectedIndex]);\n\n const handleUserSelect = useCallback((userId: number, forceFocus = false) => {\n const user = usersById && usersById[userId];\n if (!user) {\n return;\n }\n\n onInsertUserName(user, forceFocus);\n }, [usersById, onInsertUserName]);\n\n const handleSelectMention = useCallback((e: KeyboardEvent) => {\n if (filteredUsers && filteredUsers.length && selectedMentionIndex > -1) {\n const member = filteredUsers[selectedMentionIndex];\n if (member) {\n e.preventDefault();\n handleUserSelect(member.id, true);\n }\n }\n }, [filteredUsers, selectedMentionIndex, handleUserSelect]);\n\n useEffect(() => (isOpen ? captureKeyboardListeners({\n onEsc: onClose,\n onUp: (e: KeyboardEvent) => handleArrowKey(-1, e),\n onDown: (e: KeyboardEvent) => handleArrowKey(1, e),\n onEnter: handleSelectMention,\n onTab: handleSelectMention,\n }) : undefined), [isOpen, onClose, handleArrowKey, handleSelectMention]);\n\n useEffect(() => {\n if (filteredUsers && !filteredUsers.length) {\n onClose();\n }\n }, [filteredUsers, onClose]);\n\n useEffect(() => {\n setSelectedMentionIndex(0);\n }, [filter]);\n\n useEffect(() => {\n setTooltipItemVisible('.chat-item-clickable', selectedMentionIndex, containerRef);\n }, [selectedMentionIndex]);\n\n const prevChatMembers = usePrevious(\n filteredUsers && 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 && 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, ApiUser } from '../../../api/types';\n\nimport { CONTENT_TYPES_FOR_QUICK_UPLOAD, EDITABLE_INPUT_MODAL_ID } 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';\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 attachments: ApiAttachment[];\n caption: string;\n isReady?: boolean;\n currentUserId?: number;\n groupChatMembers?: ApiChatMember[];\n usersById?: Record;\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 attachments,\n caption,\n isReady,\n currentUserId,\n groupChatMembers,\n usersById,\n recentEmojis,\n baseEmojiKeywords,\n emojiKeywords,\n addRecentEmoji,\n onCaptionUpdate,\n onSend,\n onFileAppend,\n onClear,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const hideTimeoutRef = useRef(null);\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, mentionFilter,\n closeMentionTooltip, insertMention,\n mentionFilteredUsers,\n } = useMentionTooltip(\n isOpen,\n caption,\n onCaptionUpdate,\n EDITABLE_INPUT_MODAL_ID,\n groupChatMembers,\n undefined,\n currentUserId,\n usersById,\n );\n const {\n isEmojiTooltipOpen, closeEmojiTooltip, filteredEmojis, insertEmoji,\n } = useEmojiTooltip(\n isOpen,\n caption,\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 && files.length) {\n const newFiles = isQuick\n ? Array.from(files).filter((file) => {\n return file.type && CONTENT_TYPES_FOR_QUICK_UPLOAD.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 }\n }\n\n if (!renderingAttachments) {\n return undefined;\n }\n\n const areAllPhotos = renderingAttachments.every((a) => a.mimeType.startsWith('image/'));\n const areAllVideos = renderingAttachments.every((a) => a.mimeType.startsWith('video/'));\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 {\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 './helpers/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 useShowTransition from '../../../hooks/useShowTransition';\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 } = useShowTransition(shouldRender, undefined, undefined, 'slow');\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 // 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 && 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 useShowTransition from '../../../hooks/useShowTransition';\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 } = useShowTransition(shouldRender, undefined, undefined, 'slow');\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 { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\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 { 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 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 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\ntype DispatchProps = Pick;\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 className,\n loadAndPlay,\n canSendStickers,\n recentStickers,\n favoriteStickers,\n addedSetIds,\n stickerSetsById,\n shouldPlay,\n onStickerSelect,\n loadStickerSets,\n loadRecentStickers,\n loadFavoriteStickers,\n loadAddedStickers,\n addRecentSticker,\n unfaveSticker,\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\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 && set.stickers.length).length === 0\n ), [allSets, areAddedLoaded]);\n\n useEffect(() => {\n if (loadAndPlay) {\n loadStickerSets();\n loadRecentStickers();\n loadFavoriteStickers();\n }\n }, [loadAndPlay, loadFavoriteStickers, loadRecentStickers, loadStickerSets]);\n\n useEffect(() => {\n if (addedSetIds && addedSetIds.length) {\n loadAddedStickers();\n }\n }, [addedSetIds, loadAddedStickers]);\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 canRenderContents = useAsyncRendering([], SLIDE_TRANSITION_DURATION);\n\n function renderCover(stickerSet: StickerSetOrRecent, index: number) {\n const firstSticker = stickerSet.stickers && 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.isAnimated ? (\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
Sending stickers is not allowed in this chat.
\n ) : noPopulatedSets ? (\n
You have no saved Stickers.
\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 (setGlobal, actions): DispatchProps => pick(actions, [\n 'loadStickerSets',\n 'loadRecentStickers',\n 'loadFavoriteStickers',\n 'loadAddedStickers',\n 'addRecentSticker',\n 'unfaveSticker',\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 useTransitionForMedia from '../../hooks/useTransitionForMedia';\nimport useVideoCleanup from '../../hooks/useVideoCleanup';\nimport useBuffering from '../../hooks/useBuffering';\nimport useCanvasBlur from '../../hooks/useCanvasBlur';\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 = gif.thumbnail && !!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 && gif.thumbnail.dataUri, Boolean(previewBlobUrl));\n const videoData = useMedia(localMediaHash, !loadAndPlay, ApiMediaFormat.BlobUrl);\n const shouldRenderVideo = Boolean(loadAndPlay && videoData);\n const { transitionClassNames } = useTransitionForMedia(hasThumbnail || previewBlobUrl || videoData, 'slow');\n const { isBuffered, bufferingHandlers } = useBuffering(true);\n const shouldRenderSpinner = 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 transitionClassNames,\n localMediaHash,\n className,\n );\n\n return (\n \n {hasThumbnail && (\n \n )}\n {!hasThumbnail && previewBlobUrl && (\n \n )}\n {(shouldRenderVideo || previewBlobUrl) && (\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 { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\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 { pick } from '../../../util/iteratees';\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\ntype DispatchProps = Pick;\n\nconst INTERSECTION_DEBOUNCE = 300;\n\nconst GifPicker: FC = ({\n className,\n loadAndPlay,\n canSendGifs,\n savedGifs,\n onGifSelect,\n loadSavedGifs,\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 (setGlobal, actions): DispatchProps => pick(actions, ['loadSavedGifs']),\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 { IAllowedAttachmentOptions } from '../../../modules/helpers';\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 isOpen: boolean;\n allowedAttachmentOptions: IAllowedAttachmentOptions;\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 isOpen, allowedAttachmentOptions, isLeftColumnShown,\n onLoad, onClose,\n onEmojiSelect, onStickerSelect, onGifSelect,\n onRemoveSymbol, onSearchOpen, 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 const { canSendStickers, canSendGifs } = allowedAttachmentOptions;\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_FOR_QUICK_UPLOAD } from '../../../config';\nimport { IS_TOUCH_ENV } from '../../../util/environment';\nimport { openSystemFilesDialog } from '../../../util/systemFilesDialog';\nimport { IAllowedAttachmentOptions } from '../../../modules/helpers';\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 allowedAttachmentOptions: IAllowedAttachmentOptions;\n onFileSelect: (files: File[], isQuick: boolean) => void;\n onPollCreate: () => void;\n onClose: () => void;\n};\n\nconst AttachMenu: FC = ({\n isOpen, allowedAttachmentOptions, 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_FOR_QUICK_UPLOAD).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 const { canAttachMedia, canAttachPolls } = allowedAttachmentOptions;\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, {\n FC, memo, useEffect, useRef,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiSticker } from '../../../api/types';\nimport { GlobalActions } from '../../../global/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 { pick } from '../../../util/iteratees';\nimport { useIntersectionObserver } from '../../../hooks/useIntersectionObserver';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport usePrevious from '../../../hooks/usePrevious';\n\nimport Loading from '../../ui/Loading';\nimport StickerButton from '../../common/StickerButton';\n\nimport './StickerTooltip.scss';\n\nexport type OwnProps = {\n isOpen: boolean;\n onStickerSelect: (sticker: ApiSticker) => void;\n};\n\ntype StateProps = {\n stickers?: ApiSticker[];\n};\n\ntype DispatchProps = Pick;\n\nconst INTERSECTION_THROTTLE = 200;\n\nconst StickerTooltip: FC = ({\n isOpen,\n onStickerSelect,\n stickers,\n clearStickersForEmoji,\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\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 handleMouseLeave = () => {\n document.body.classList.remove('no-select');\n };\n\n const className = buildClassName(\n 'StickerTooltip composer-tooltip custom-scroll',\n transitionClassNames,\n !(displayedStickers && 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 (setGlobal, actions): DispatchProps => pick(actions, ['clearStickersForEmoji']),\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, useState,\n} from '../../../lib/teact/teact';\n\nimport { IS_TOUCH_ENV } from '../../../util/environment';\nimport buildClassName from '../../../util/buildClassName';\nimport cycleRestrict from '../../../util/cycleRestrict';\nimport captureKeyboardListeners from '../../../util/captureKeyboardListeners';\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';\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;\nconst NO_EMOJI_SELECTED_INDEX = -1;\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 [selectedIndex, setSelectedIndex] = useState(NO_EMOJI_SELECTED_INDEX);\n\n useEffect(() => {\n setSelectedIndex(0);\n }, [emojis]);\n\n useEffect(() => {\n setItemVisible(selectedIndex, containerRef);\n }, [selectedIndex]);\n\n const getSelectedIndex = useCallback((newIndex: number) => {\n if (!emojis.length) {\n return NO_EMOJI_SELECTED_INDEX;\n }\n\n const emojisCount = emojis.length;\n return cycleRestrict(emojisCount, newIndex);\n }, [emojis]);\n\n const handleArrowKey = useCallback((value: number, e: KeyboardEvent) => {\n e.preventDefault();\n setSelectedIndex((index) => (getSelectedIndex(index + value)));\n }, [setSelectedIndex, getSelectedIndex]);\n\n const handleSelectEmoji = useCallback((e: KeyboardEvent) => {\n if (emojis.length && selectedIndex > NO_EMOJI_SELECTED_INDEX) {\n const emoji = emojis[selectedIndex];\n if (emoji) {\n e.preventDefault();\n onEmojiSelect(emoji.native);\n addRecentEmoji({ emoji: emoji.id });\n }\n }\n }, [addRecentEmoji, emojis, onEmojiSelect, selectedIndex]);\n\n const handleClick = useCallback((native: string, id: string) => {\n onEmojiSelect(native);\n addRecentEmoji({ emoji: id });\n }, [addRecentEmoji, onEmojiSelect]);\n\n useEffect(() => (isOpen ? captureKeyboardListeners({\n onEsc: onClose,\n onLeft: (e: KeyboardEvent) => handleArrowKey(-1, e),\n onRight: (e: KeyboardEvent) => handleArrowKey(1, e),\n onEnter: handleSelectEmoji,\n }) : undefined), [handleArrowKey, handleSelectEmoji, isOpen, onClose]);\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';\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 useMedia from '../../../../hooks/useMedia';\nimport useTransitionForMedia from '../../../../hooks/useTransitionForMedia';\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 {\n shouldRenderThumb, shouldRenderFullMedia, transitionClassNames,\n } = useTransitionForMedia(mediaBlobUrl, 'slow');\n\n const handleClick = useCallback(() => {\n onClick(inlineResult);\n }, [inlineResult, onClick]);\n\n if (isForGallery) {\n return (\n
\n {shouldRenderThumb && (\n \"\"\n )}\n {shouldRenderFullMedia && (\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, useState,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { ApiBotInlineMediaResult, ApiBotInlineResult, ApiBotInlineSwitchPm } from '../../../api/types';\nimport { IAllowedAttachmentOptions } from '../../../modules/helpers';\nimport { LoadMoreDirection } from '../../../types';\n\nimport { IS_TOUCH_ENV } from '../../../util/environment';\nimport setTooltipItemVisible from '../../../util/setTooltipItemVisible';\nimport buildClassName from '../../../util/buildClassName';\nimport captureKeyboardListeners from '../../../util/captureKeyboardListeners';\nimport cycleRestrict from '../../../util/cycleRestrict';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport { throttle } from '../../../util/schedulers';\nimport { pick } from '../../../util/iteratees';\nimport { useIntersectionObserver } from '../../../hooks/useIntersectionObserver';\nimport usePrevious from '../../../hooks/usePrevious';\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';\n\nconst INTERSECTION_DEBOUNCE_MS = 200;\nconst runThrottled = throttle((cb) => cb(), 500, true);\n\nexport type OwnProps = {\n isOpen: boolean;\n botId?: number;\n isGallery?: boolean;\n allowedAttachmentOptions: IAllowedAttachmentOptions;\n inlineBotResults?: (ApiBotInlineResult | ApiBotInlineMediaResult)[];\n switchPm?: ApiBotInlineSwitchPm;\n onSelectResult: (inlineResult: ApiBotInlineMediaResult | ApiBotInlineResult) => void;\n loadMore: NoneToVoidFunction;\n onClose: NoneToVoidFunction;\n};\n\ntype DispatchProps = Pick;\n\nconst InlineBotTooltip: FC = ({\n isOpen,\n botId,\n isGallery,\n inlineBotResults,\n switchPm,\n loadMore,\n onClose,\n openChat,\n sendBotCommand,\n onSelectResult,\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 [selectedIndex, setSelectedIndex] = useState(-1);\n const {\n observe: observeIntersection,\n } = useIntersectionObserver({\n rootRef: containerRef,\n debounceMs: INTERSECTION_DEBOUNCE_MS,\n isDisabled: !isOpen,\n });\n\n useEffect(() => {\n setSelectedIndex(isGallery ? -1 : 0);\n }, [inlineBotResults, isGallery]);\n\n useEffect(() => {\n setTooltipItemVisible('.chat-item-clickable', selectedIndex, containerRef);\n }, [selectedIndex]);\n\n const getSelectedIndex = useCallback((newIndex: number) => {\n if (!inlineBotResults || !inlineBotResults.length) {\n return -1;\n }\n\n return cycleRestrict(inlineBotResults.length, newIndex);\n }, [inlineBotResults]);\n\n const handleArrowKey = useCallback((value: number, e: KeyboardEvent) => {\n if (isGallery) {\n return;\n }\n\n e.preventDefault();\n setSelectedIndex((index) => (getSelectedIndex(index + value)));\n }, [isGallery, getSelectedIndex]);\n\n const handleSelectInlineBotResult = useCallback((e: KeyboardEvent) => {\n if (inlineBotResults && inlineBotResults.length && selectedIndex > -1) {\n const inlineResult = inlineBotResults[selectedIndex];\n if (inlineResult) {\n e.preventDefault();\n onSelectResult(inlineResult);\n }\n }\n }, [inlineBotResults, onSelectResult, selectedIndex]);\n\n const handleLoadMore = useCallback(({ direction }: { direction: LoadMoreDirection }) => {\n if (direction === LoadMoreDirection.Backwards) {\n runThrottled(loadMore);\n }\n }, [loadMore]);\n\n\n useEffect(() => (isOpen ? captureKeyboardListeners({\n onEsc: onClose,\n onUp: (e: KeyboardEvent) => handleArrowKey(-1, e),\n onDown: (e: KeyboardEvent) => handleArrowKey(1, e),\n onEnter: handleSelectInlineBotResult,\n }) : undefined), [handleArrowKey, handleSelectInlineBotResult, isGallery, isOpen, onClose]);\n\n const handleSendPm = useCallback(() => {\n openChat({ id: botId });\n sendBotCommand({ chatId: botId, command: `/start ${switchPm!.startParam}` });\n }, [botId, openChat, sendBotCommand, switchPm]);\n\n\n const prevInlineBotResults = usePrevious(\n inlineBotResults && inlineBotResults.length\n ? inlineBotResults\n : undefined,\n shouldRender,\n );\n const renderedInlineBotResults = inlineBotResults && !inlineBotResults.length\n ? prevInlineBotResults\n : inlineBotResults;\n\n if (!shouldRender || !renderedInlineBotResults || (!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 '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 {renderContent()}\n \n );\n};\n\nexport default memo(withGlobal(\n undefined,\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'sendBotCommand', 'openChat', 'sendInlineBotResult',\n ]),\n)(InlineBotTooltip));\n","import React, {\n FC, useMemo, memo, useRef,\n} from '../../lib/teact/teact';\nimport { getGlobal, withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiMessage, ApiUser, ApiChat } from '../../api/types';\nimport { GlobalActions } from '../../global/types';\n\nimport {\n selectUser,\n selectChatMessages,\n selectChat,\n selectCurrentTextSearch,\n} from '../../modules/selectors';\nimport {\n getMessageSummaryText,\n getChatTitle,\n getUserFullName,\n isChatChannel,\n} from '../../modules/helpers';\nimport renderText from '../common/helpers/renderText';\nimport useLang from '../../hooks/useLang';\nimport { orderBy, pick } from '../../util/iteratees';\nimport { MEMO_EMPTY_ARRAY } from '../../util/memo';\nimport useKeyboardListNavigation from '../../hooks/useKeyboardListNavigation';\nimport useHistoryBack from '../../hooks/useHistoryBack';\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: number;\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\ntype DispatchProps = Pick;\n\ninterface Result {\n message: ApiMessage;\n senderUser?: ApiUser;\n senderChat?: ApiChat;\n onClick: NoneToVoidFunction;\n}\n\nconst RightSearch: FC = ({\n chatId,\n threadId,\n onClose,\n isActive,\n chat,\n messagesById,\n query,\n totalCount,\n foundIds,\n searchTextMessagesLocal,\n focusMessage,\n}) => {\n const lang = useLang();\n\n const foundResults = useMemo(() => {\n if (!query || !foundIds || !foundIds.length || !messagesById) {\n return MEMO_EMPTY_ARRAY;\n }\n\n const results = foundIds.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) as Result[];\n\n return orderBy(results, ({ message }) => message.date, 'desc');\n }, [chatId, threadId, focusMessage, foundIds, chat, messagesById, query]);\n\n const renderSearchResult = ({\n message, senderUser, senderChat, onClick,\n }: Result) => {\n const title = senderChat ? getChatTitle(lang, senderChat) : getUserFullName(senderUser);\n const text = getMessageSummaryText(lang, message);\n\n return (\n \n \n
\n
\n

{title && renderText(title)}

\n \n
\n
\n {renderText(text, ['emoji', 'highlight'], { highlight: query })}\n
\n
\n \n );\n };\n\n useHistoryBack(isActive, onClose);\n\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n const handleKeyDown = useKeyboardListNavigation(containerRef, true, (index) => {\n const foundResult = foundResults && foundResults[index === -1 ? 0 : index];\n if (foundResult) {\n foundResult.onClick();\n }\n }, '.ListItem-button', true);\n\n return (\n \n

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

\n {foundResults.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 (global, actions): DispatchProps => pick(actions, ['searchTextMessagesLocal', 'focusMessage']),\n)(RightSearch));\n","import React, {\n FC, useEffect, memo, useMemo, useCallback,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiStickerSet } from '../../api/types';\nimport { GlobalActions } from '../../global/types';\nimport { ObserveFn } from '../../hooks/useIntersectionObserver';\n\nimport { STICKER_SIZE_SEARCH } from '../../config';\nimport { pick } from '../../util/iteratees';\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\ntype DispatchProps = Pick;\n\nconst STICKERS_TO_DISPLAY = 5;\n\nconst StickerSetResult: FC = ({\n stickerSetId, observeIntersection, set, shouldPlay,\n loadStickers, toggleStickerSet, isSomeModalOpen, onModalToggle,\n}) => {\n const lang = useLang();\n const isAdded = set && Boolean(set.installedDate);\n const areStickersLoaded = Boolean(set && 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 (setGlobal, actions): DispatchProps => pick(actions, ['loadStickers', 'toggleStickerSet']),\n)(StickerSetResult));\n","import React, {\n FC, memo, useEffect, useRef, useState,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\n\nimport { pick } from '../../util/iteratees';\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\ntype DispatchProps = Pick;\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 loadFeaturedStickers,\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 (setGlobal, actions): DispatchProps => pick(actions, ['loadFeaturedStickers']),\n)(StickerSearch));\n","import React, {\n FC, memo, useRef, useCallback,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\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 { pick } from '../../util/iteratees';\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\ntype DispatchProps = Pick;\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 searchMoreGifs,\n sendMessage,\n setGifSearchQuery,\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 (setGlobal, actions): DispatchProps => pick(actions, ['searchMoreGifs', 'sendMessage', 'setGifSearchQuery']),\n)(GifSearch));\n","import React, {\n FC, useCallback, useState, memo, useEffect,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport {\n ApiChat,\n ApiMessage,\n ApiPollAnswer,\n ApiPollResult,\n} from '../../api/types';\nimport { GlobalActions } from '../../global/types';\nimport { pick } from '../../util/iteratees';\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?: number[];\n offset: string;\n};\n\ntype DispatchProps = Pick;\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 loadPollOptionResults,\n openChat,\n closePollResults,\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: number) => {\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 && voters[answer.option],\n offset: (offsets && offsets[answer.option]) || '',\n };\n },\n (global, actions): DispatchProps => pick(actions, ['loadPollOptionResults', 'openChat', 'closePollResults']),\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 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

{summary.question}

\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 { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { ApiChat, ApiUser } from '../../../api/types';\nimport { ManagementProgress } from '../../../types';\n\nimport { pick } from '../../../util/iteratees';\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: number;\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n user?: ApiUser;\n chat: ApiChat;\n progress?: ManagementProgress;\n isMuted?: boolean;\n};\n\ntype DispatchProps = Pick;\n\nconst ERROR_FIRST_NAME_MISSING = 'Please provide first name';\n\nconst ManageUser: FC = ({\n userId,\n user,\n chat,\n progress,\n isMuted,\n updateContact,\n deleteUser,\n deleteHistory,\n closeManagement,\n openChat,\n onClose,\n isActive,\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 deleteHistory({\n chatId: chat.id,\n shouldDeleteForAll: false,\n });\n deleteUser({ userId });\n closeDeleteDialog();\n closeManagement();\n openChat({ id: undefined });\n }, [chat.id, closeDeleteDialog, closeManagement, deleteHistory, deleteUser, openChat, 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, chat, progress, isMuted,\n };\n },\n (global, actions): DispatchProps => pick(actions, [\n 'updateContact', 'deleteUser', 'closeManagement', 'openChat', 'deleteHistory',\n ]),\n)(ManageUser));\n","import { ChangeEvent } from 'react';\nimport React, {\n FC, memo, useCallback, useEffect, useMemo, useState,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { ManagementScreens, ManagementProgress } from '../../../types';\nimport { ApiChat, ApiChatBannedRights, ApiMediaFormat } from '../../../api/types';\nimport { GlobalActions } from '../../../global/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 { pick } from '../../../util/iteratees';\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: number;\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};\n\ntype DispatchProps = Pick;\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 onScreenSelect,\n togglePreHistoryHidden,\n updateChat,\n deleteChat,\n leaveChannel,\n deleteChannel,\n closeManagement,\n openChat,\n onClose,\n isActive,\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 lang = useLang();\n\n useHistoryBack(isActive, onClose);\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 handleClickPermissions = useCallback(() => {\n onScreenSelect(ManagementScreens.GroupPermissions);\n }, [onScreenSelect]);\n\n const handleClickAdministrators = useCallback(() => {\n onScreenSelect(ManagementScreens.ChatAdministrators);\n }, [onScreenSelect]);\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 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 && chat.fullInfo.adminMembers && 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 {lang('ChannelAdministrators')}\n {formatInteger(adminsCount)}\n \n
\n
\n \n {lang('GroupMembers')}\n {formatInteger(chat.membersCount!)}\n \n\n {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 && chat.fullInfo.linkedChatId);\n const isBasicGroup = isChatBasicGroup(chat);\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 };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'togglePreHistoryHidden', 'updateChat', 'closeManagement',\n 'leaveChannel', 'deleteChannel', 'deleteChat', 'openChat',\n ]),\n)(ManageGroup));\n","import React, {\n FC, memo, useCallback, useEffect, useMemo, useState,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { ManagementScreens } from '../../../types';\nimport { ApiChat, ApiChatBannedRights, ApiChatMember } from '../../../api/types';\nimport { GlobalActions } from '../../../global/types';\n\nimport useLang from '../../../hooks/useLang';\nimport { selectChat } from '../../../modules/selectors';\nimport { pick } from '../../../util/iteratees';\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: number;\n onScreenSelect: (screen: ManagementScreens) => void;\n onChatMemberSelect: (memberId: number, isPromotedByCurrentUser?: boolean) => void;\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n chat?: ApiChat;\n currentUserId?: number;\n};\n\ntype DispatchProps = Pick;\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 updateChatDefaultBannedRights,\n onClose,\n isActive,\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 && 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 }) => !!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 && 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 (setGlobal, actions): DispatchProps => pick(actions, ['updateChatDefaultBannedRights']),\n)(ManageGroupPermissions));\n","import React, {\n FC, memo, useCallback, useMemo,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiChat, ApiChatMember, ApiUser } from '../../../api/types';\nimport { GlobalActions } from '../../../global/types';\n\nimport { selectChat } from '../../../modules/selectors';\nimport { getUserFullName } from '../../../modules/helpers';\nimport { pick } from '../../../util/iteratees';\nimport useLang from '../../../hooks/useLang';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport PrivateChatInfo from '../../common/PrivateChatInfo';\nimport ListItem from '../../ui/ListItem';\n\ntype OwnProps = {\n chatId: number;\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n chat?: ApiChat;\n usersById: Record;\n};\n\ntype DispatchProps = Pick;\n\nconst ManageGroupRemovedUsers: FC = ({\n chat,\n usersById,\n updateChatMemberBannedRights,\n onClose,\n isActive,\n}) => {\n const lang = useLang();\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('NoBlockedGroup2')}

\n\n {removedMembers.map((member) => (\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 } = global.users;\n\n return { chat, usersById };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['updateChatMemberBannedRights']),\n)(ManageGroupRemovedUsers));\n","import { ChangeEvent } from 'react';\nimport React, {\n FC, memo, useCallback, useEffect, useState,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { ManagementScreens, ManagementProgress } from '../../../types';\nimport { ApiChat, ApiMediaFormat } from '../../../api/types';\n\nimport { pick } from '../../../util/iteratees';\nimport { getChatAvatarHash, getHasAdminRight } from '../../../modules/helpers';\nimport useMedia from '../../../hooks/useMedia';\nimport useLang from '../../../hooks/useLang';\nimport { selectChat } from '../../../modules/selectors';\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';\nimport useFlag from '../../../hooks/useFlag';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport './Management.scss';\n\ntype OwnProps = {\n chatId: number;\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};\n\ntype DispatchProps = Pick;\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 onScreenSelect,\n updateChat,\n toggleSignatures,\n closeManagement,\n leaveChannel,\n deleteChannel,\n openChat,\n onClose,\n isActive,\n}) => {\n const currentTitle = chat ? (chat.title || '') : '';\n const currentAbout = chat && chat.fullInfo ? (chat.fullInfo.about || '') : '';\n const hasLinkedChat = chat && chat.fullInfo && 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 (progress === ManagementProgress.Complete) {\n setIsProfileFieldsTouched(false);\n setError(undefined);\n }\n }, [progress]);\n\n const adminsCount = (chat && chat.fullInfo && chat.fullInfo.adminMembers && chat.fullInfo.adminMembers.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 handleClickAdministrators = useCallback(() => {\n onScreenSelect(ManagementScreens.ChatAdministrators);\n }, [onScreenSelect]);\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\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 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 \n {lang('ChannelAdministrators')}\n {adminsCount}\n \n
\n \n
\n
\n
\n \n {lang('ChannelSubscribers')}\n {lang('Subscribers', chat.membersCount!, 'i')}\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 && chat.isSignaturesShown);\n\n return {\n chat,\n progress,\n isSignaturesShown,\n canChangeInfo: getHasAdminRight(chat, 'changeInfo'),\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'toggleSignatures', 'updateChat', 'closeManagement', 'leaveChannel', 'deleteChannel', 'openChat',\n ]),\n)(ManageChannel));\n","import React, {\n FC, memo, useCallback, useEffect, useState,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { ApiChat } from '../../../api/types';\nimport { ManagementProgress } from '../../../types';\n\nimport { selectChat, selectManagement } from '../../../modules/selectors';\nimport { pick } from '../../../util/iteratees';\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: number;\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n chat: ApiChat;\n isChannel: boolean;\n progress?: ManagementProgress;\n isUsernameAvailable?: boolean;\n};\n\ntype DispatchProps = Pick;\n\nconst ManageChatPrivacyType: FC = ({\n chat,\n onClose,\n isActive,\n isChannel,\n progress,\n isUsernameAvailable,\n checkPublicLink,\n updatePublicLink,\n updatePrivateLink,\n}) => {\n const isPublic = Boolean(chat.username);\n const privateLink = chat.fullInfo && 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 = (\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 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 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 {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 };\n },\n (setGlobal, actions) => pick(actions, [\n 'checkPublicLink', 'updatePublicLink', 'updatePrivateLink',\n ]),\n)(ManageChatPrivacyType));\n","import React, {\n FC, memo, useCallback, useEffect, useState,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { ApiChat } from '../../../api/types';\nimport { ManagementScreens } from '../../../types';\n\nimport { STICKER_SIZE_DISCUSSION_GROUPS } from '../../../config';\nimport { selectChat } from '../../../modules/selectors';\nimport { pick } from '../../../util/iteratees';\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: number;\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?: number[];\n isChannel?: boolean;\n};\n\ntype DispatchProps = Pick;\n\nconst ManageDiscussion: FC = ({\n chat,\n onClose,\n isActive,\n chatId,\n chatsByIds,\n linkedChat,\n forDiscussionIds,\n isChannel,\n onScreenSelect,\n loadGroupsForDiscussion,\n linkDiscussionGroup,\n unlinkDiscussionGroup,\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 && 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: number) => {\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 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 { onDiscussionClick(id); }}\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 && chat.fullInfo && 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 (setGlobal, actions): DispatchProps => pick(actions, [\n 'loadGroupsForDiscussion', 'linkDiscussionGroup', 'unlinkDiscussionGroup',\n ]),\n)(ManageDiscussion));\n","import React, {\n FC, memo, useCallback, useEffect, useMemo, useState,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiChat, ApiChatBannedRights } from '../../../api/types';\nimport { ManagementScreens } from '../../../types';\nimport { GlobalActions } from '../../../global/types';\n\nimport { pick } from '../../../util/iteratees';\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: number;\n selectedChatMemberId?: number;\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\ntype DispatchProps = Pick;\n\nconst ManageGroupUserPermissions: FC = ({\n chat,\n selectedChatMemberId,\n onScreenSelect,\n updateChatMemberBannedRights,\n isFormFullyDisabled,\n onClose,\n isActive,\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 && chat.fullInfo && selectedChatMemberId && !selectedChatMember) {\n onScreenSelect(ManagementScreens.GroupPermissions);\n }\n }, [chat, onScreenSelect, selectedChatMember, selectedChatMemberId]);\n\n useEffect(() => {\n setPermissions((selectedChatMember && selectedChatMember.bannedRights) || (chat && 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\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 (setGlobal, actions): DispatchProps => pick(actions, ['updateChatMemberBannedRights']),\n)(ManageGroupUserPermissions));\n","import React, {\n FC, memo, useCallback, useMemo,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { ManagementScreens } from '../../../types';\nimport { ApiChat, ApiChatMember, ApiUser } 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';\n\ntype OwnProps = {\n chatId: number;\n onScreenSelect: (screen: ManagementScreens) => void;\n onChatMemberSelect: (memberId: number, isPromotedByCurrentUser?: boolean) => void;\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n chat: ApiChat;\n currentUserId?: number;\n isChannel: boolean;\n usersById: Record;\n};\n\nconst ManageChatAdministrators: FC = ({\n chat,\n isChannel,\n currentUserId,\n usersById,\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 getMemberStatus = useCallback((member: ApiChatMember) => {\n if (member.isOwner) {\n return lang('ChannelCreator');\n }\n\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, usersById]);\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\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const chat = selectChat(global, chatId)!;\n const { byId: usersById } = global.users;\n\n return {\n chat,\n currentUserId: global.currentUserId,\n isChannel: isChatChannel(chat),\n usersById,\n };\n },\n // (setGlobal, actions): DispatchProps => pick(actions, ['togglePreHistoryHidden', 'updateChat']),\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: number;\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 { withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiChat, ApiChatAdminRights, ApiUser } from '../../../api/types';\nimport { ManagementScreens } from '../../../types';\nimport { GlobalActions } from '../../../global/types';\n\nimport { pick } from '../../../util/iteratees';\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: number;\n selectedChatMemberId?: number;\n isPromotedByCurrentUser?: boolean;\n onScreenSelect: (screen: ManagementScreens) => void;\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n chat: ApiChat;\n usersById: Record;\n currentUserId?: number;\n isChannel: boolean;\n isFormFullyDisabled: boolean;\n};\n\ntype DispatchProps = Pick;\n\nconst CUSTOM_TITLE_MAX_LENGTH = 16;\n\nconst ManageGroupAdminRights: FC = ({\n selectedChatMemberId,\n onScreenSelect,\n chat,\n usersById,\n currentUserId,\n isChannel,\n isFormFullyDisabled,\n updateChatAdmin,\n onClose,\n isActive,\n}) => {\n const [permissions, setPermissions] = useState({});\n const [isTouched, setIsTouched] = useState(false);\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 if (!chat.fullInfo || !chat.fullInfo.adminMembers) {\n return undefined;\n }\n\n return chat.fullInfo.adminMembers.find(({ userId }) => userId === selectedChatMemberId);\n }, [chat, selectedChatMemberId]);\n\n useEffect(() => {\n if (chat && chat.fullInfo && selectedChatMemberId && !selectedChatMember) {\n onScreenSelect(ManagementScreens.ChatAdministrators);\n }\n }, [chat, onScreenSelect, selectedChatMember, selectedChatMemberId]);\n\n useEffect(() => {\n setPermissions((selectedChatMember && selectedChatMember.adminRights) || {});\n setCustomTitle(((selectedChatMember && selectedChatMember.customTitle) || '').substr(0, CUSTOM_TITLE_MAX_LENGTH));\n setIsTouched(false);\n setIsLoading(false);\n }, [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 (!selectedChatMemberId) {\n return;\n }\n\n setIsLoading(true);\n updateChatAdmin({\n chatId: chat.id,\n userId: selectedChatMemberId,\n adminRights: permissions,\n customTitle,\n });\n }, [chat, selectedChatMemberId, permissions, customTitle, updateChatAdmin]);\n\n const handleDismissAdmin = useCallback(() => {\n if (!selectedChatMemberId) {\n return;\n }\n\n updateChatAdmin({\n chatId: chat.id,\n userId: selectedChatMemberId,\n adminRights: {},\n });\n closeDismissConfirmationDialog();\n }, [chat.id, closeDismissConfirmationDialog, selectedChatMemberId, 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 (!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 }, [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 {!isChannel && (\n
\n \n
\n )}\n\n {isFormFullyDisabled && (\n

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

\n )}\n\n {!isChannel && (\n \n )}\n\n {currentUserId !== selectedChatMemberId && !isFormFullyDisabled && (\n \n {lang('EditAdminRemoveAdmin')}\n \n )}\n
\n
\n\n \n {isLoading ? (\n \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 { 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 };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['updateChatAdmin']),\n)(ManageGroupAdminRights));\n","import React, {\n FC, memo, useCallback, useMemo,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiChatMember, ApiUser } from '../../../api/types';\nimport { GlobalActions } from '../../../global/types';\nimport { selectChat } from '../../../modules/selectors';\nimport { sortUserIds, isChatChannel } from '../../../modules/helpers';\nimport { pick } from '../../../util/iteratees';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport PrivateChatInfo from '../../common/PrivateChatInfo';\nimport NothingFound from '../../common/NothingFound';\nimport ListItem from '../../ui/ListItem';\n\ntype OwnProps = {\n chatId: number;\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n usersById: Record;\n members?: ApiChatMember[];\n isChannel?: boolean;\n serverTimeOffset: number;\n};\n\ntype DispatchProps = Pick;\n\nconst ManageGroupMembers: FC = ({\n members,\n usersById,\n isChannel,\n openUserInfo,\n onClose,\n isActive,\n serverTimeOffset,\n}) => {\n const memberIds = useMemo(() => {\n if (!members || !usersById) {\n return undefined;\n }\n\n return sortUserIds(members.map(({ userId }) => userId), usersById, undefined, serverTimeOffset);\n }, [members, serverTimeOffset, usersById]);\n\n const handleMemberClick = useCallback((id: number) => {\n openUserInfo({ id });\n }, [openUserInfo]);\n\n useHistoryBack(isActive, onClose);\n\n return (\n
\n
\n
\n {memberIds ? (\n memberIds.map((id, i) => (\n handleMemberClick(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 } = global.users;\n const members = chat && chat.fullInfo && chat.fullInfo.members;\n const isChannel = chat && isChatChannel(chat);\n\n return {\n members,\n usersById,\n isChannel,\n serverTimeOffset: global.serverTimeOffset,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'openUserInfo',\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 } 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: number;\n onScreenSelect: (screen: ManagementScreens) => void;\n onChatMemberSelect: (memberId: number) => void;\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n usersById: Record;\n members?: ApiChatMember[];\n isChannel?: boolean;\n serverTimeOffset: number;\n};\n\nconst ManageGroupUserPermissionsCreate: FC = ({\n usersById,\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, undefined, serverTimeOffset,\n );\n }, [members, serverTimeOffset, usersById]);\n\n const handleExceptionMemberClick = useCallback((memberId: number) => {\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\n\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const chat = selectChat(global, chatId);\n const { byId: usersById } = global.users;\n const members = chat && chat.fullInfo && chat.fullInfo.members;\n const isChannel = chat && isChatChannel(chat);\n\n return {\n members,\n usersById,\n isChannel,\n serverTimeOffset: global.serverTimeOffset,\n };\n },\n)(ManageGroupUserPermissionsCreate));\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 ManageGroupRemovedUsers from './ManageGroupRemovedUsers';\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';\n\nexport type OwnProps = {\n chatId: number;\n currentScreen: ManagementScreens;\n selectedChatMemberId?: number;\n isPromotedByCurrentUser?: boolean;\n onScreenSelect: (screen: ManagementScreens) => void;\n onChatMemberSelect: (memberId: number, 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.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.ChatAdminRights:\n return (\n \n );\n\n case ManagementScreens.ChannelSubscribers:\n case ManagementScreens.GroupMembers:\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 CURRENCIES: Record = {\n USD: '$',\n EUR: '€',\n GBP: '£',\n JPY: '¥',\n RUB: '₽',\n UAH: '₴',\n INR: '₹',\n AED: 'د.إ',\n};\n\nexport function getCurrencySign(currency: string | undefined): string {\n if (!currency) {\n return '';\n }\n return CURRENCIES[currency] || '';\n}\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","import useReducer, { StateReducer, Dispatch } from '../useReducer';\nimport { countryList } from '../../util/phoneNumber';\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\nexport default () => {\n return useReducer(reducer, INITIAL_STATE);\n};\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\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: any;\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/phoneNumber';\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/index';\n\nimport { FormState, FormEditDispatch } from '../../hooks/reducers/usePaymentReducer';\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 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: `${currency} ${String(amount / 100)}`,\n value,\n }))), [shippingOptions, currency]);\n\n return (\n
\n
\n

Select shipping method

\n \n \n
\n );\n};\n\nexport default memo(Shipping);\n","import React, {\n FC, memo,\n} from '../../lib/teact/teact';\n\nimport { Price } from '../../types';\n\nimport './Checkout.scss';\n\nexport type OwnProps = {\n invoiceContent?: {\n title?: string;\n description?: 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 // eslint-disable-next-line no-null/no-null\n const { photoUrl, title, text } = (invoiceContent || {});\n const {\n paymentMethod,\n paymentProvider,\n shippingAddress,\n name,\n phone,\n shippingMethod,\n } = (checkoutInfo || {});\n return (\n
\n
\n { photoUrl && (\n \"\"\n )}\n
\n
{ title }
\n

{ text }

\n
\n
\n
\n { prices && prices.map((item) => (\n renderPaymentItem(item.label, item.amount, currency, false)\n )) }\n { shippingPrices && shippingPrices.map((item) => (\n renderPaymentItem(item.label, item.amount, currency, false)\n )) }\n { totalPrice !== undefined && (\n renderPaymentItem('Total', totalPrice, currency, true)\n ) }\n
\n
\n {paymentMethod && renderCheckoutItem('icon-card', paymentMethod, 'Payment method')}\n {paymentProvider && renderCheckoutItem('stripe-provider', paymentProvider, 'Payment provider')}\n {shippingAddress && renderCheckoutItem('icon-location', shippingAddress, 'Shipping address')}\n {name && renderCheckoutItem('icon-user', name, 'Name')}\n {phone && renderCheckoutItem('icon-phone', phone, 'Phone number')}\n {shippingMethod && renderCheckoutItem('icon-truck', shippingMethod, 'Shipping method')}\n
\n
\n );\n};\n\nfunction renderPaymentItem(title: string, value: number, currency?: string, main = false) {\n return (\n
\n
\n { title }\n
\n
\n { `${currency || ''} ${(value / 100).toFixed(2)}` }\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';\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 // 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 && parts[0] && Number(parts[0]) > 12) {\n parts[0] = '12';\n }\n if (parts && 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","export default __webpack_public_path__ + \"mastercard.4216118edafe23cc2dec7b8807ba4622.svg\";","export default __webpack_public_path__ + \"visa.e5a7c336e1deb4b92a636e2e053878c4.svg\";","import React, {\n FC, memo, useCallback, useState, useRef, useEffect,\n} from '../../lib/teact/teact';\n\nimport useFocusAfterAnimation from '../../hooks/useFocusAfterAnimation';\nimport { formatCardNumber } from '../middle/helpers/inputFormatters';\nimport { detectCardType, CardType } from '../common/helpers/detectCardType';\n\nimport InputText from '../ui/InputText';\n\nimport './CardInput.scss';\n\n// @ts-ignore\nimport mastercardIconPath from '../../assets/mastercard.svg';\n// @ts-ignore\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 // 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/phoneNumber';\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, {\n FC, memo, useCallback, useEffect, useMemo, useState,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions, GlobalState } from '../../global/types';\nimport { PaymentStep, ShippingOption, Price } from '../../types';\nimport { ApiError, ApiInviteInfo } from '../../api/types';\n\nimport { pick } from '../../util/iteratees';\nimport { getCurrencySign } from '../middle/helpers/getCurrencySign';\nimport { detectCardTypeText } from '../common/helpers/detectCardType';\nimport { getShippingErrors } from '../../modules/helpers/payments';\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';\n\nimport './PaymentModal.scss';\n\nconst DEFAULT_PROVIDER = 'stripe';\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 globalDialogs?: (ApiError | ApiInviteInfo)[];\n};\n\ntype GlobalStateProps = Pick;\n\ntype DispatchProps = 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 error,\n globalDialogs,\n validateRequestedInfo,\n sendPaymentForm,\n setPaymentStep,\n sendCredentialsInfo,\n clearPaymentError,\n}) => {\n const [paymentState, paymentDispatch] = usePaymentReducer();\n const currencySign = getCurrencySign(currency);\n const [isLoading, setIsLoading] = useState(false);\n const lang = useLang();\n\n useEffect(() => {\n if (step || error || globalDialogs) {\n setIsLoading(false);\n }\n }, [step, error, globalDialogs]);\n\n useEffect(() => {\n if (error && error.field) {\n paymentDispatch({\n type: 'setFormErrors',\n payload: {\n [error.field]: error.fieldError,\n },\n });\n return;\n }\n if (globalDialogs && globalDialogs.length) {\n const errors = getShippingErrors(globalDialogs);\n paymentDispatch({\n type: 'setFormErrors',\n payload: {\n ...errors,\n },\n });\n }\n }, [error, globalDialogs, 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(cuurentStep: PaymentStep) {\n switch (cuurentStep) {\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 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 }, [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 default:\n return '';\n }\n }, [step, lang]);\n\n const buttonText = useMemo(() => {\n switch (step) {\n case PaymentStep.Checkout:\n return lang('Checkout.PayPrice', `${currencySign}${(totalPrice / 100).toFixed(2)}`);\n default:\n return lang('Next');\n }\n }, [step, lang, currencySign, 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
\n {renderModalContent(step)}\n
\n )}\n
\n ) : (\n
\n \n
\n )}\n
\n \n {buttonText}\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 } = global.payment;\n\n const isProviderError = Boolean(invoice && (!nativeProvider || nativeProvider !== DEFAULT_PROVIDER));\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 globalDialogs: global.dialogs,\n };\n },\n (setGlobal, actions): DispatchProps => {\n return pick(actions, [\n 'validateRequestedInfo',\n 'sendPaymentForm',\n 'setPaymentStep',\n 'sendCredentialsInfo',\n 'clearPaymentError',\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 ? option.prices : undefined;\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 ? shippingOption.title : undefined;\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/payments';\n\nimport useLang from '../../hooks/useLang';\nimport { getCurrencySign } from '../middle/helpers/getCurrencySign';\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 currencySign = getCurrencySign(currency);\n const checkoutInfo = useMemo(() => {\n return getCheckoutInfo(credentialsTitle, info, shippingMethod);\n }, [info, shippingMethod, credentialsTitle]);\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: mapedPrices,\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: mapedPrices,\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 && 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 { ApiMediaFormat } from '../../../api/types';\n\nimport * as mediaLoader from '../../../util/mediaLoader';\n\n// @ts-ignore\nimport MonkeyIdle from '../../../assets/TwoFactorSetupMonkeyIdle.tgs';\n// @ts-ignore\nimport MonkeyTracking from '../../../assets/TwoFactorSetupMonkeyTracking.tgs';\n// @ts-ignore\nimport MonkeyClose from '../../../assets/TwoFactorSetupMonkeyClose.tgs';\n// @ts-ignore\nimport MonkeyPeek from '../../../assets/TwoFactorSetupMonkeyPeek.tgs';\n// @ts-ignore\nimport FoldersAll from '../../../assets/FoldersAll.tgs';\n// @ts-ignore\nimport FoldersNew from '../../../assets/FoldersNew.tgs';\n// @ts-ignore\nimport DiscussionGroups from '../../../assets/DiscussionGroupsDucks.tgs';\n\nexport const ANIMATED_STICKERS_PATHS = {\n MonkeyIdle,\n MonkeyTracking,\n MonkeyClose,\n MonkeyPeek,\n FoldersAll,\n FoldersNew,\n DiscussionGroups,\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","export default __webpack_public_path__ + \"TwoFactorSetupMonkeyIdle.dea4a492c144df84ddab778dc8a3f0cd.tgs\";","export default __webpack_public_path__ + \"TwoFactorSetupMonkeyTracking.eb5a7a6f166fb7589c12e6248561fb58.tgs\";","export default __webpack_public_path__ + \"TwoFactorSetupMonkeyClose.604c4c833d322b7e6c3ea19bef058241.tgs\";","export default __webpack_public_path__ + \"TwoFactorSetupMonkeyPeek.1905436b042520363d7e59f5d7f903ab.tgs\";","export default __webpack_public_path__ + \"FoldersAll.3f9f9e243d19f0fbf9aaaff11cbd4572.tgs\";","export default __webpack_public_path__ + \"FoldersNew.9a40d71c0c8be70f5bd14ff2d7bc1593.tgs\";","export default __webpack_public_path__ + \"DiscussionGroupsDucks.9ea453d1be9d1b0ee77a992f8e587485.tgs\";","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: 0.8,\n format: 'jpeg',\n circle: false,\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 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 { 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"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/3.86fc6942f17ca54599b3.css.map b/dist/3.86fc6942f17ca54599b3.css.map deleted file mode 100644 index 8e5615fe..00000000 --- a/dist/3.86fc6942f17ca54599b3.css.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["webpack:///./src/components/mediaViewer/SenderInfo.scss","webpack:///./src/components/mediaViewer/MediaViewerActions.scss","webpack:///./src/components/mediaViewer/MediaViewerFooter.scss","webpack:///./src/components/mediaViewer/VideoPlayerControls.scss","webpack:///./src/components/mediaViewer/VideoPlayer.scss","webpack:///./src/components/mediaViewer/ZoomControls.scss","webpack:///./src/components/mediaViewer/PanZoom.scss","webpack:///./src/components/mediaViewer/MediaViewer.scss","webpack:///./src/components/main/ForwardPicker.scss","webpack:///./src/components/main/Dialogs.scss","webpack:///./src/components/common/CalendarModal.scss","webpack:///./src/components/middle/MessageSelectToolbar.scss","webpack:///./src/components/left/search/RecentContacts.scss","webpack:///./src/components/left/search/ChatMessage.scss","webpack:///./src/components/left/search/DateSuggest.scss","webpack:///./src/components/left/search/LeftSearch.scss","webpack:///./src/components/ui/CropModal.scss","webpack:///./src/components/ui/AvatarEditable.scss","webpack:///./src/components/ui/ShowMoreButton.scss","webpack:///./src/components/left/settings/folders/SettingsFoldersChatsPicker.scss","webpack:///./src/components/left/settings/folders/SettingsFolders.scss","webpack:///./src/components/ui/RangeSlider.scss","webpack:///./src/components/left/settings/SettingsStickerSet.scss","webpack:///./src/components/left/settings/WallpaperTile.scss","webpack:///./src/components/left/settings/SettingsGeneralBackground.scss","webpack:///./src/components/left/settings/SettingsGeneralBackgroundColor.scss","webpack:///./src/components/common/PasswordMonkey.scss","webpack:///./src/components/left/settings/Settings.scss","webpack:///./src/components/left/newChat/NewChat.scss","webpack:///./src/components/left/ArchivedChats.scss","webpack:///./src/components/middle/message/MessageContextMenu.scss","webpack:///./src/components/common/StickerSetModal.scss","webpack:///./src/components/middle/HeaderMenuContainer.scss","webpack:///./src/components/middle/MobileSearch.scss","webpack:///./src/components/middle/composer/MentionTooltip.scss","webpack:///./src/components/middle/composer/AttachmentModal.scss","webpack:///./src/components/middle/composer/PollModal.scss","webpack:///./src/components/middle/composer/EmojiButton.scss","webpack:///./src/components/middle/composer/EmojiPicker.scss","webpack:///./src/components/middle/composer/StickerPicker.scss","webpack:///./src/components/common/GifButton.scss","webpack:///./src/components/middle/composer/GifPicker.scss","webpack:///./src/components/middle/composer/SymbolMenu.scss","webpack:///./src/components/middle/composer/AttachMenu.scss","webpack:///./src/components/middle/composer/StickerTooltip.scss","webpack:///./src/components/middle/composer/BotKeyboardMenu.scss","webpack:///./src/components/middle/composer/CustomSendMenu.scss","webpack:///./src/components/middle/composer/EmojiTooltip.scss","webpack:///./src/components/middle/composer/inlineResults/BaseResult.scss","webpack:///./src/components/middle/composer/inlineResults/MediaResult.scss","webpack:///./src/components/middle/composer/InlineBotTooltip.scss","webpack:///./src/components/right/RightSearch.scss","webpack:///./src/components/right/StickerSearch.scss","webpack:///./src/components/right/GifSearch.scss","webpack:///./src/components/right/PollAnswerResults.scss","webpack:///./src/components/right/PollResults.scss","webpack:///./src/components/right/management/Management.scss","webpack:///./src/components/payment/ShippingInfo.scss","webpack:///./src/components/payment/Shipping.scss","webpack:///./src/components/payment/Checkout.scss","webpack:///./src/components/payment/CardInput.scss","webpack:///./src/components/payment/PaymentInf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Y,wBAAwB,0CAA0C,aAAa,4CAA4C,aAAa,0BAA0B,gBAAgB,8CAA8C,iBAAiB,kCAAkC,kBAAkB,aAAa,8DAA8D,kFAAkF,qBAAqB,mBAAmB,cAAc,yDAAyD,eAAe,sBAAsB,gBAAgB,gBAAgB,sBAAsB,wBAAwB,0BAA0B,wDAAwD,gBAAgB,mBAAmB;;ACAx6C,WAAW,kBAAkB,qDAAqD,kBAAkB,uBAAuB,kBAAkB,UAAU,UAAU,UAAU,2BAA2B;;ACAtM,aAAa,oBAAoB,gBAAgB,iBAAiB,kCAAkC,qBAAqB,4BAA4B,aAAa,8BAA8B,yCAAyC,aAAa,cAAc;;ACApQ,8BAA8B,oBAAoB,sBAAsB,kBAAkB,4BAA4B,6BAA6B,WAAW,oBAAoB,aAAa,mBAAmB,mBAAmB,mCAAmC,6CAA6C,yBAAyB,gBAAgB,mBAAmB,uBAAuB,mBAAmB,0BAA0B,aAAa,6BAA6B,aAAa,eAAe,aAAa,mBAAmB,uBAAuB,+BAA+B,aAAa,gBAAgB,uBAAuB,cAAc,WAAW,YAAY,kBAAkB,sBAAsB,kBAAkB,+BAA+B,gCAAgC,WAAW,oBAAoB,mCAAmC,0CAA0C,6BAA6B,oBAAoB,gBAAgB,4BAA4B,YAAY,6BAA6B,UAAU,gBAAgB,iGAAiG,4BAA4B,gBAAgB,0BAA0B","file":"3.86fc6942f17ca54599b3.css","sourcesContent":[".SenderInfo{display:flex;align-content:center;color:white;cursor:pointer;opacity:.5;transition:.15s opacity}.SenderInfo:hover{opacity:1}.SenderInfo .Avatar{margin-inline-end:1rem}@media (max-width: 600px){.SenderInfo .Avatar{display:none}}.SenderInfo .meta{display:flex;flex-direction:column;justify-content:center;max-width:100%}.SenderInfo .title{line-height:1.45rem;font-weight:500;white-space:pre;overflow:hidden;text-overflow:ellipsis}.SenderInfo .date{line-height:1.25rem;font-size:0.875rem;letter-spacing:-0.01rem}\n",".MediaViewerActions{display:flex;margin-inline-start:auto;margin-inline-end:-.375rem}.MediaViewerActions .Button{margin-inline-start:.25rem}.MediaViewerActions-mobile{position:relative}.MediaViewerActions-mobile .ProgressSpinner{position:absolute;top:0;left:0}\n",".MediaViewerFooter{position:absolute;bottom:0;padding:1rem 0;width:100%;transition:opacity .15s}#MediaViewer.zoomed .MediaViewerFooter{display:none}@media (max-height: 640px){.MediaViewerFooter{padding:.5rem 0 0}}@media (max-width: 600px){.MediaViewerFooter{padding-bottom:4.5rem;background:linear-gradient(to top, #000 0%, rgba(0,0,0,0) 100%)}.MediaViewerFooter.is-for-video{opacity:0;pointer-events:none}.video-controls-visible .MediaViewerFooter.is-for-video{opacity:1;pointer-events:all}}.MediaViewerFooter .media-viewer-footer-content{position:relative;max-width:var(--messages-container-width);margin:auto;cursor:pointer;opacity:.5;transition:opacity .15s}.MediaViewerFooter .media-viewer-footer-content:hover{opacity:1}@media (max-width: 600px){.MediaViewerFooter .media-viewer-footer-content{opacity:1}}.MediaViewerFooter.is-hidden{opacity:0}.MediaViewerFooter .media-text{margin-bottom:0;overflow:auto;padding:0 .5rem;text-align:center;color:rgba(255,255,255,0.9);font-size:.9375rem;letter-spacing:.025rem;max-height:4.25rem}@media (max-height: 640px){.MediaViewerFooter .media-text{max-height:2.75rem}}.MediaViewerFooter .media-text .emoji{width:.9375rem;height:.9375rem;vertical-align:-2px}.MediaViewerFooter .media-text.multiline::before{content:'';position:absolute;left:-.75rem;right:-.75rem;top:-.25rem;bottom:-.25rem;background:rgba(0,0,0,0.75);border-radius:var(--border-radius-default);z-index:var(--z-below)}@media (max-width: 600px){.MediaViewerFooter .media-text.multiline::before{display:none;background:none}}.MediaViewerFooter a{color:var(--color-links)}.MediaViewerFooter a:hover,.MediaViewerFooter a:focus{color:var(--color-links-hover)}\n",".VideoPlayerControls{display:flex;align-items:center;position:absolute;left:0;bottom:0;width:100%;padding-top:.625rem;font-size:.875rem;background:linear-gradient(to top, #000 0%, rgba(0,0,0,0) 100%)}#MediaViewer.zoomed .VideoPlayerControls{display:none}@media (max-width: 600px){.VideoPlayerControls{position:fixed;padding:1.25rem .5rem .75rem;background:none;z-index:var(--z-media-viewer)}}.VideoPlayerControls.mobile .player-file-size{position:static;left:auto;transform:none;margin-left:auto}.VideoPlayerControls.mobile .fullscreen{margin-left:1rem}.VideoPlayerControls.mobile .player-time+.fullscreen{margin-left:auto}.VideoPlayerControls .Button{width:2.25rem;padding:0;margin:.25rem;height:1.75rem}@media (max-width: 600px){.VideoPlayerControls .Button{height:2.25rem}}.VideoPlayerControls .play i{line-height:1.5rem}.VideoPlayerControls .player-time{margin:0 1rem;white-space:nowrap}.VideoPlayerControls .fullscreen{margin-left:auto}@media (max-width: 600px){.VideoPlayerControls .fullscreen{margin-left:1rem}}.VideoPlayerControls .fullscreen i{line-height:1.75rem}@media (max-width: 600px){.VideoPlayerControls .fullscreen i{font-size:1.5rem}}@media (max-width: 600px){.VideoPlayerControls .player-time+.fullscreen{margin-left:auto}}.VideoPlayerControls .player-file-size{position:absolute;left:50%;transform:translateX(-50%);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}@media (max-width: 600px){.VideoPlayerControls .player-file-size{position:static;left:auto;transform:none;margin-left:auto;margin-right:1rem}.VideoPlayerControls .player-file-size+.fullscreen{margin-left:0}}.VideoPlayerControls .player-seekline{position:absolute;left:1rem;right:1rem;top:0;height:1rem}.VideoPlayerControls .player-seekline-track{position:absolute;top:50%;left:-.25rem;right:-.25rem;height:5px;transform:translateY(-50%);background-color:rgba(255,255,255,0.16);border-radius:var(--border-radius-default)}.VideoPlayerControls .player-seekline-buffered,.VideoPlayerControls .player-seekline-played,.VideoPlayerControls .player-seekline-input{position:absolute;top:0;left:0;height:100%;border-radius:var(--border-radius-default)}.VideoPlayerControls .player-seekline-buffered{background-color:rgba(255,255,255,0.5)}.VideoPlayerControls .player-seekline-played{background:var(--color-primary)}.VideoPlayerControls .player-seekline-played::after{content:'';position:absolute;width:.75rem;height:.75rem;border-radius:50%;background-color:var(--color-primary);right:0;top:50%;transform:translate(0.325rem, -50%)}.VideoPlayerControls .player-seekline-input{width:100%;opacity:0;margin:0;padding:0;cursor:pointer;overflow:hidden}.VideoPlayerControls .player-seekline-input::-webkit-slider-thumb{margin-top:-2rem}\n",".VideoPlayer{position:relative;display:inline-flex;flex-direction:column;overflow:hidden}#MediaViewer.zoomed .VideoPlayer{position:absolute;top:0;right:0;bottom:0;left:0}#MediaViewer.zoomed .VideoPlayer>div{width:100% !important;height:100% !important}#MediaViewer.zoomed .VideoPlayer video{max-height:none !important}@media (min-width: 601px){.VideoPlayer{z-index:1}}@media (max-width: 600px){.VideoPlayer{overflow:visible}}@media (max-height: 640px){.VideoPlayer{margin-bottom:1.75rem}.has-footer .VideoPlayer{margin-bottom:0}}.VideoPlayer video{display:block;max-height:calc(100vh - 8.25rem);margin:auto;object-fit:contain;outline:none;width:100%;height:100%;background:no-repeat 50% 50%;background-size:contain}@media (max-height: 640px){.VideoPlayer video{max-height:calc(100vh - 10rem)}}.has-footer .VideoPlayer video{max-height:calc(100vh - 15rem)}@media (max-height: 640px){.has-footer .VideoPlayer video{max-height:calc(100vh - 10rem)}}.VideoPlayer .play-button{position:absolute;left:50%;top:50%;transform:translate(-50%, -50%);width:3.25rem;height:3.25rem;background-color:rgba(0,0,0,0.5) !important}body:not(.animation-level-0) .VideoPlayer .play-button{transition:opacity .3s ease !important}.VideoPlayer .play-button .icon-play{font-size:1.75rem;position:relative;left:.125rem}.VideoPlayer .spinner-container{position:absolute;top:0;left:0;width:100%;height:100%;display:flex;align-items:center;justify-content:center}.VideoPlayer .spinner-container .buffering{background:rgba(0,0,0,0.25);color:#fff;font-size:0.75rem;position:absolute;left:0.1875rem;top:0.1875rem;z-index:1;padding:0 0.375rem;border-radius:0.75rem;line-height:1.125rem}.VideoPlayer .spinner-container .ProgressSpinner{cursor:pointer}\n",".ZoomControls{position:absolute;bottom:1.25rem;left:50%;background:rgba(0,0,0,0.5);border-radius:var(--border-radius-default);width:100%;height:3.375rem;max-width:274px;transform:translate3d(-50%, 0, 10px);transition:opacity .3s ease-in;pointer-events:none}.ZoomControls.open{z-index:var(--z-media-viewer);pointer-events:all}.ZoomControls .zoom-out,.ZoomControls .zoom-in{position:absolute;top:0.4375rem;width:2.5rem;height:2.5rem;color:#fff}.ZoomControls .zoom-out i,.ZoomControls .zoom-in i{font-size:1.5rem}.ZoomControls .zoom-out{left:.5rem}.ZoomControls .zoom-in{right:.5rem}.ZoomControls .seekline{position:absolute;left:3.25rem;right:3.25rem;top:1.125rem;height:1rem}.ZoomControls .seekline-track{position:absolute;top:50%;left:-.25rem;right:-.25rem;height:2px;transform:translateY(-50%);background-color:rgba(255,255,255,0.5);border-radius:var(--border-radius-default)}.ZoomControls .seekline-played,.ZoomControls .seekline-input{position:absolute;top:0;left:0;height:100%;border-radius:var(--border-radius-default)}.ZoomControls .seekline-played{background:#fff;transition:width 200ms}.ZoomControls .seekline-played::after{content:'';position:absolute;width:.75rem;height:.75rem;border-radius:50%;background-color:var(--color-white);right:0;top:50%;transform:translate(0.325rem, -50%)}.ZoomControls .seekline-input{width:100%;height:1rem;top:-.375rem;opacity:0;margin:0;padding:0;cursor:pointer;overflow:hidden}.ZoomControls .seekline-input::-webkit-slider-thumb{margin-top:-2rem}\n",".pan-wrapper,.pan-container{position:relative;width:100%;height:100%}.pan-wrapper{cursor:move;-webkit-user-select:none;user-select:none}.pan-container{transition:transform .2s ease-in}.pan-wrapper.move .pan-container{transition:none}.zoomed .pan-container{position:fixed;top:0;left:0}\n","#MediaViewer{position:fixed;top:0;left:0;width:100vw;height:100%;background:rgba(0,0,0,0.9);color:#fff;z-index:var(--z-media-viewer);padding:0.5rem 0;display:grid;grid-template-columns:auto;grid-template-rows:2.75rem 1fr;grid-column-gap:0;grid-row-gap:0;justify-items:stretch;align-items:center}#MediaViewer:not(.shown){display:block !important;transform:scale(0)}body.ghost-animating #MediaViewer>.pan-wrapper,body.ghost-animating #MediaViewer>.Transition,body.ghost-animating #MediaViewer>button{display:none}body.animation-level-2 #MediaViewer{transition-duration:.3s !important}#MediaViewer:not(.open) .SenderInfo,#MediaViewer .closing .SenderInfo{pointer-events:none;transition:none}#MediaViewer.zoomed .navigation{display:none}#MediaViewer.zoomed .media-viewer-head{z-index:2}#MediaViewer.zoomed .media-viewer-content{position:fixed;top:0;left:0;width:100vw;height:100vh;padding:0;z-index:1}#MediaViewer .media-viewer-head{display:flex;grid-area:1 / 1 / 2 / -2;padding:0 1.25rem;position:relative;z-index:var(--z-media-viewer-head);min-width:0}#MediaViewer .media-viewer-head>.Transition{width:100%;min-width:0}@media (max-width: 600px){#MediaViewer .media-viewer-head{padding:0 0.5rem}#MediaViewer .media-viewer-head .media-viewer-close{margin-right:1.5rem}}#MediaViewer>.Transition,#MediaViewer>.pan-wrapper{grid-area:1 / 1 / -1 / -1}#MediaViewer>.Transition,#MediaViewer>.pan-wrapper .Transition{position:relative;justify-self:center;text-align:center;width:100%;height:100%;display:flex;align-items:center;overflow:hidden}#MediaViewer .media-viewer-content{position:relative;z-index:1;padding:3.25rem 0;height:100%;display:inline-flex;justify-content:center;align-items:center}#MediaViewer .media-viewer-content.has-footer{padding:7rem 0}@media (min-width: 600px){#MediaViewer .media-viewer-content.has-footer{min-width:600px}}@media (max-height: 640px){#MediaViewer .media-viewer-content.has-footer{padding:4rem 0}}#MediaViewer .media-viewer-content.has-footer>img{max-height:calc(100vh - 15rem)}@media (max-height: 640px){#MediaViewer .media-viewer-content.has-footer>img{max-height:calc(100vh - 10rem)}}#MediaViewer .media-viewer-content .thumbnail{position:relative}#MediaViewer .media-viewer-content .thumbnail img{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%)}#MediaViewer .media-viewer-content>img{max-width:100vw;max-height:calc(100vh - 8.25rem);object-fit:contain;transition:transform .2s}#MediaViewer .media-viewer-content .spinner-wrapper{max-width:100vw;margin:auto}#MediaViewer .media-viewer-content .Spinner{margin:auto}#MediaViewer .navigation{position:fixed;top:4rem;width:10vw;bottom:0;border:none;padding:0;margin:0;-webkit-appearance:none;appearance:none;background:transparent no-repeat;background-size:1.25rem;opacity:0;transition:opacity .15s;outline:none;cursor:pointer;z-index:1}@media (max-width: 600px){#MediaViewer .navigation{width:20vw}}#MediaViewer .navigation:hover,.is-touch-env #MediaViewer .navigation{opacity:1}#MediaViewer .navigation.prev{left:0;background-image:url(media_navigation_previous.11f3cfece8fead5a78e6349db2545210.svg);background-position:1.25rem calc(50% - 2rem)}#MediaViewer .navigation.prev[dir=rtl]{left:auto;right:0;transform:scaleX(-1)}#MediaViewer .navigation.next{right:0;background-image:url(media_navigation_next.3d6e264d21e73ad725738beb8e9dbbb8.svg);background-position:calc(100% - 1.25rem) calc(50% - 2rem)}#MediaViewer .navigation.next[dir=rtl]{left:0;right:auto;transform:scaleX(-1)}#MediaViewer .navigation.inline{top:calc(50% - 3rem);bottom:unset;height:6rem;background-position-y:center}@media (max-width: 600px){#MediaViewer .navigation.inline{opacity:0;transition:opacity .15s ease-in;pointer-events:none}.video-controls-visible #MediaViewer .navigation.inline{opacity:1;pointer-events:all}}.ghost{position:absolute;z-index:var(--z-media-viewer);will-change:transform, opacity;overflow:hidden;border-radius:0;transition:transform .2s ease, opacity .2s ease}.ghost.rounded-corners{border-radius:var(--border-radius-messages)}.ghost.circle{border-radius:50%}body.is-ios .ghost{transition:transform .2s ease, opacity .2s ease, border-radius .2s ease !important}.ghost img,.ghost video{width:100%;height:100%;user-select:none;-webkit-user-select:none;object-fit:cover}\n",".ForwardPicker{z-index:var(--z-media-viewer)}.ForwardPicker .modal-dialog{height:70%;max-width:25rem}@media (max-width: 600px){.ForwardPicker .modal-dialog{height:90%}}.ForwardPicker .modal-header{display:flex;align-items:center;padding:0.25rem 0.5rem}.ForwardPicker .modal-header .Button{margin-right:0.5rem}.ForwardPicker .modal-header .input-group{margin:0}.ForwardPicker .modal-header .form-control{border:none;box-shadow:none !important;height:2.75rem;padding:0.5rem;font-size:1.25rem;line-height:1.75rem;unicode-bidi:plaintext}.ForwardPicker .modal-content{padding:0;overflow:hidden;display:flex;flex-direction:column}.ForwardPicker .modal-content .picker-list{height:100%;overflow-x:hidden;overflow-y:auto;padding:0 1rem 1rem}.ForwardPicker .no-results{height:100%;margin:0;padding:1rem 1rem;display:flex;align-items:center;justify-content:center;color:var(--color-text-secondary)}@media (max-width: 600px){.ForwardPicker .ListItem.chat-item-clickable:not(.force-rounded-corners){margin:0}.ForwardPicker .ListItem.chat-item-clickable:not(.force-rounded-corners) .ListItem-button{border-radius:0}}\n","#Dialogs{position:fixed;top:0;left:0;width:100vw;height:100vh;z-index:var(--z-modal)}\n",".CalendarModal .modal-dialog{max-width:26.25rem}.CalendarModal .modal-dialog .modal-content{padding:.375rem 1rem 1rem}.CalendarModal .timepicker{display:flex;align-items:center;justify-content:center;margin-bottom:1.5rem}.CalendarModal .timepicker .form-control{max-width:5rem;text-align:center}.CalendarModal .timepicker .form-control:first-child{margin-right:1rem}.CalendarModal .timepicker .form-control:last-child{margin-left:1rem}.CalendarModal .footer{display:flex;justify-content:flex-end;flex-direction:column}.CalendarModal .footer .Button{text-transform:none}.CalendarModal .footer .Button+.Button{margin-top:.5rem}.CalendarModal .month-selector{display:flex;align-items:center}.CalendarModal .month-selector h4{flex:1;margin:0 0 0 1.25rem;font-size:1.25rem}@media (max-width: 600px){.CalendarModal .month-selector h4{margin-left:.75rem}}.CalendarModal .month-selector h4 ~ .Button{color:var(--color-primary)}.CalendarModal .month-selector .Button.hidden{opacity:0.5;pointer-events:none}.CalendarModal .day-button{position:relative;border-radius:4rem;outline:none !important;font-weight:500;margin:.125rem .625rem}@media (max-width: 600px){.CalendarModal .day-button{margin:.25rem .375rem}}.CalendarModal .day-button.weekday{margin-bottom:0;height:1rem}.CalendarModal .day-button.clickable{cursor:pointer}.CalendarModal .day-button.clickable:hover{background-color:var(--color-interactive-element-hover)}.CalendarModal .day-button.clickable.selected{background-color:var(--color-primary);color:white}.CalendarModal .day-button.disabled{opacity:0.25;pointer-events:none}.CalendarModal .day-button::before{content:\"\";display:block;padding-top:100%}.CalendarModal .day-button span{position:absolute;top:0;left:0;width:100%;height:100%;display:flex;align-items:center;justify-content:center;font-size:0.875rem}.CalendarModal .calendar-wrapper{display:flex;align-items:center;justify-content:center;min-height:17rem;margin:1.5rem -0.5rem 0.5rem}.CalendarModal .calendar-grid{display:grid;grid-template-columns:repeat(7, 1fr);width:100%}\n",".MessageSelectToolbar{position:absolute;bottom:0.5rem;left:0.5rem;right:0.5rem;width:auto;z-index:20;justify-content:center;margin:0;opacity:1}.mask-image-disabled .MessageSelectToolbar::before{left:auto !important;right:auto !important}.no-composer .MessageSelectToolbar{width:100%}@media (min-width: 601px){.MessageSelectToolbar{left:1rem;right:1rem;bottom:1.25rem}.no-composer .MessageSelectToolbar{top:-4.75rem}}.MessageSelectToolbar-inner{transform:scaleX(1);transition:transform var(--select-transition),opacity var(--select-transition)}.MessageSelectToolbar .MessageSelectToolbar-inner{transform:scaleX(1) translateX(0)}.no-composer .unpin-button-container+.MessageSelectToolbar,.no-composer .messaging-disabled+.MessageSelectToolbar{top:auto}body.animation-level-0 .MessageSelectToolbar{transition:none !important}.MessageSelectToolbar:not(.shown){opacity:0;pointer-events:none}.MessageSelectToolbar:not(.shown)-inner{transform:scaleX(var(--toolbar-hidden-scale, 1))}.MessageSelectToolbar:not(.shown).with-composer .MessageSelectToolbar-inner{transform:scaleX(var(--toolbar-hidden-scale, 1)) translateX(var(--toolbar-translate-x, 0))}.MessageSelectToolbar:not(.shown):not(.with-composer) .MessageSelectToolbar-inner{transform:scaleX(var(--toolbar-unpin-hidden-scale)) translateX(0)}.MessageSelectToolbar::before{z-index:-1;max-width:32rem;width:100%;left:auto;right:auto}.MessageSelectToolbar-inner{width:100%;max-width:32rem;display:flex;align-items:center;padding:0.25rem;background:var(--color-background);border-radius:var(--border-radius-messages);box-shadow:0 1px 2px var(--color-default-shadow);font-weight:500}@media (max-width: 600px){.MessageSelectToolbar-inner{padding:0;max-width:none}}.MessageSelectToolbar-inner>.Button{width:3rem;height:3rem}@media (max-width: 600px){.MessageSelectToolbar-inner>.Button{width:2.875rem;height:2.875rem}}.MessageSelectToolbar-count{margin-left:1rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex-grow:1}@media (max-width: 600px){.MessageSelectToolbar-count{margin-right:0.5rem}}.MessageSelectToolbar-actions{margin-left:auto;display:flex}.MessageSelectToolbar-actions .MenuItem{padding:0.6875rem;border-radius:50%}.MessageSelectToolbar-actions .MenuItem i{margin-right:0}.MessageSelectToolbar-actions .MenuItem .item-text{display:none}\n",".RecentContacts .Loading{min-height:75vh}.RecentContacts .top-peers-section{padding:.5rem 1rem}.RecentContacts .top-peers{height:6rem;margin:0 -1rem;overflow-x:auto;overflow-y:hidden;white-space:nowrap;scrollbar-width:none;scrollbar-color:rgba(0,0,0,0)}.RecentContacts .top-peers::-webkit-scrollbar{height:0}.RecentContacts .top-peers::-webkit-scrollbar-thumb{background-color:rgba(0,0,0,0)}.RecentContacts .top-peer-item{display:inline-block;width:4.5rem;height:6rem;padding:0.625rem 0.25rem;margin-left:0.5rem;border-radius:var(--border-radius-default);cursor:pointer;position:relative;overflow:hidden}.RecentContacts .top-peer-item:first-child{margin-left:0.125rem}.RecentContacts .top-peer-item:last-child{margin-right:0.125rem}.RecentContacts .top-peer-item .Avatar{margin:0 auto 0.375rem}.RecentContacts .top-peer-item:hover{background:var(--color-chat-hover)}.RecentContacts .top-peer-item .top-peer-name{text-align:center;white-space:nowrap;font-size:0.75rem;overflow:hidden;text-overflow:ellipsis}.RecentContacts .top-peer-item .top-peer-name .emoji-small{width:1rem;height:1rem;background-size:1rem;margin-inline-end:1px;vertical-align:-3px}.RecentContacts .recent-chats-header{display:flex;align-items:center}.RecentContacts .recent-chats-header .Button{margin-left:auto}.RecentContacts .recent-chats-header[dir=rtl] .Button{margin-left:0;margin-right:auto}\n",".ChatMessage:first-child{margin-top:.5rem}.ChatMessage:hover .Avatar.online::after,.ChatMessage.selected .Avatar.online::after{border-color:var(--color-chat-hover)}.ChatMessage .ListItem-button{padding:.25rem .5rem}.ChatMessage .info .title{flex-grow:1}.ChatMessage .info h3{font-size:1rem;width:auto}.ChatMessage .info .subtitle{color:var(--color-text-secondary)}.ChatMessage .info .subtitle .matching-text-highlight{color:var(--color-text);background:#CAE3F7;border-radius:0.25rem;padding:0 0.125rem}.ChatMessage .info .message{flex-grow:1;color:var(--color-text-secondary);overflow:hidden;text-overflow:ellipsis}.ChatMessage .info .message .sender-name{color:var(--color-text)}.ChatMessage .info .message .sender-name::after{content:': '}.ChatMessage .info .message img{width:1.25rem;height:1.25rem;object-fit:cover;border-radius:.125rem;vertical-align:-.25rem;margin-right:.25rem}.ChatMessage .info .message .icon-play{position:relative;display:inline-block;font-size:.75rem;color:#fff;margin-inline-start:-1.25rem;margin-inline-end:0.5rem;bottom:0.0625rem}.ChatMessage .info-row{display:flex;justify-content:space-between}.ChatMessage[dir=rtl] .subtitle{text-align:right}\n",".DateSuggest{display:flex;height:2rem;flex-direction:row;justify-content:space-between;margin-left:.5rem;margin-bottom:.5rem}.DateSuggest .date-item{display:flex;flex:1 1 auto;min-width:8rem;margin-top:.375rem;cursor:pointer;font-size:.875rem;font-weight:500;color:var(--color-text-secondary)}.DateSuggest .date-item .icon-calendar{font-size:1.25rem;margin-right:.25rem}\n",".LeftSearch{display:flex;flex-direction:column;height:100%;overflow:hidden}.LeftSearch>.Transition{flex:1;overflow:hidden}.LeftSearch .TabList{padding-bottom:1px;z-index:1}.LeftSearch .documents-list{padding:0 1.25rem 1.25rem}.LeftSearch .documents-list .ListItem+.ListItem{margin-top:1.25rem}.LeftSearch .section-heading{position:relative;padding-top:1.25rem;padding-left:1.25rem;margin:0 0 1rem -1.25rem !important;font-weight:500;font-size:.9375rem;color:var(--color-text-secondary)}.LeftSearch .section-heading::before{content:'';position:absolute;width:100%;height:1px;background:var(--color-borders);left:.625rem;top:-1px}.LeftSearch .section-heading[dir=rtl],.LeftSearch .section-heading[dir=auto]{padding-left:0;padding-right:1.25rem;margin:0 -1.25rem 0 1rem !important;text-align:initial}.LeftSearch .section-heading[dir=rtl]::before,.LeftSearch .section-heading[dir=auto]::before{left:auto;right:.625rem}.LeftSearch .LeftSearch .search-section .section-heading,.LeftSearch .RecentContacts .search-section .section-heading{margin-left:-1rem !important;width:calc(100% + 2rem);box-shadow:0 -1px 0 0 var(--color-borders)}.LeftSearch .LeftSearch .search-section .section-heading::before,.LeftSearch .RecentContacts .search-section .section-heading::before{display:none}.LeftSearch .WebLink{display:flex}.LeftSearch .content:not(.with-seekline){align-self:center;min-width:0;flex-grow:1;overflow:hidden;text-overflow:ellipsis;word-break:break-word}.LeftSearch .message-date{font-size:.75rem;color:var(--color-text-secondary);padding-left:1rem;white-space:nowrap}.LeftSearch .media-list{display:grid;padding:.5rem;grid-template-columns:repeat(3, 1fr);grid-auto-rows:1fr;grid-gap:.25rem}.LeftSearch .Audio .duration span{padding:0 .25rem}.LeftSearch .Audio .ProgressSpinner{margin:-.1875rem 0 0 -.1875rem}.LeftSearch .ListItem.search-result .ChatInfo .handle{unicode-bidi:plaintext;color:var(--color-primary);unicode-bidi:plaintext}.LeftSearch .ListItem.search-result .ChatInfo .handle::before{content:'@'}html[lang=ar] .LeftSearch .ListItem.search-result .ChatInfo .handle::before{content:' ،@';margin-inline-end:.25rem}.LeftSearch .ListItem.search-result .ChatInfo .handle::after{content:', ';color:var(--color-text-secondary)}html[lang=ar] .LeftSearch .ListItem.search-result .ChatInfo .handle::after{content:''}.LeftSearch .ListItem.search-result .ChatInfo[dir=rtl] .status{text-align:right}.LeftSearch .ListItem.search-result .ChatInfo[dir=rtl] .status .handle{float:right}.LeftSearch .ListItem.search-result-message .sender-name{color:var(--color-text)}.LeftSearch .ListItem.search-result-message .sender-name::after{content:': ';white-space:pre}@media (max-width: 600px){.LeftSearch .ListItem{margin:0 -0.625rem}}.LeftSearch .search-section{padding:0 1rem 0.5rem}.LeftSearch .search-section .section-heading{color:var(--color-text-secondary);font-size:.9375rem;font-weight:500;margin-bottom:0 !important;padding-top:.875rem}.LeftSearch .search-section .section-heading .Link{float:right;color:var(--color-links);font-weight:400;margin-right:1rem}.LeftSearch .search-section .section-heading .Link:focus,.LeftSearch .search-section .section-heading .Link:hover{color:var(--color-links-hover)}.LeftSearch .search-section .section-heading[dir=rtl] .Link,.LeftSearch .search-section .section-heading[dir=auto] .Link{float:left;margin-left:1rem;margin-right:0}.LeftSearch .search-section .Loading{height:4.5rem;margin-bottom:0.5rem}.LeftSearch .chat-selection{padding-top:.5rem;display:flex;flex-shrink:0;flex-wrap:nowrap;justify-content:space-between;align-items:flex-end;box-shadow:inset 0 -1px 0 0 var(--color-borders);background-color:var(--color-background);-webkit-overflow-scrolling:touch;overflow-x:auto;overflow-y:hidden;scrollbar-color:rgba(0,0,0,0)}.LeftSearch .chat-selection>.PickerSelectedItem{flex:0 0 auto}.LeftSearch .chat-selection>.PickerSelectedItem:last-child{margin-right:auto}.LeftSearch .chat-selection[dir=rtl]>.PickerSelectedItem:last-child{margin-left:auto;margin-right:0}.LeftSearch .NothingFound{height:100%}.LeftSearch [dir=rtl] .message-date{padding-left:0;padding-right:1rem}\n",".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(255,255,255,0.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)}\n",".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:white;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(.active) .AvatarEditable label input,.Transition>div:not(.active) .AvatarEditable label i,.Transition>div:not(.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(.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,0.4)}.AvatarEditable label.disabled{pointer-events:none}.AvatarEditable label.disabled i{display:none}.AvatarEditable label.disabled::after{display:none}\n",".ShowMoreButton{color:var(--text-color) !important;display:flex;align-items:center;text-align:left;text-transform:none;padding-left:.75rem !important;opacity:1 !important}.ShowMoreButton i{font-size:1.5rem;margin-right:2rem;color:var(--color-text-secondary)}.ShowMoreButton .Spinner{top:0.4375rem}\n",".SettingsFoldersChatsPicker{height:calc(100% - var(--header-height))}.SettingsFoldersChatsPicker .picker-header{box-shadow:0 0 2px var(--color-default-shadow)}.SettingsFoldersChatsPicker .picker-header .max-items-reached{margin-bottom:0.5rem;margin-left:0.5rem;flex-grow:1}.SettingsFoldersChatsPicker .picker-header .max-items-reached{color:var(--color-text-secondary)}.SettingsFoldersChatsPicker .picker-list{padding:0 0.5rem 0.5rem}.SettingsFoldersChatsPicker .picker-list .no-results{height:10rem}.SettingsFoldersChatsPicker .ListItem.picker-list-item.chat-type-item .ListItem-button{padding:0.875rem 0.75rem}.SettingsFoldersChatsPicker .ListItem.picker-list-item.chat-item .ListItem-button{padding:0.5rem 0.75rem}.SettingsFoldersChatsPicker .ListItem.picker-list-item .Checkbox{margin-left:auto;padding-left:3.25rem}.SettingsFoldersChatsPicker .ListItem.picker-list-item .chat-type{font-size:1rem;font-weight:400;margin:0}.SettingsFoldersChatsPicker .ListItem.picker-list-item[dir=rtl] .Checkbox{margin-left:0;margin-right:auto;padding-left:0;padding-right:3.25rem}.SettingsFoldersChatsPicker .settings-item-header{margin-left:0.75rem;margin-top:1rem;margin-bottom:0.5rem}.SettingsFoldersChatsPicker .picker-list-divider{margin:0.5rem -0.5rem 0;border-bottom:1px solid var(--color-borders)}\n",".settings-folders-recommended-item{width:100%;display:flex;align-items:center;justify-content:space-between}.settings-folders-list-item .ChatInfo{display:flex;align-items:center}.settings-folders-list-item .ChatInfo .Avatar{margin-left:-0.25rem;margin-right:1.5rem}.settings-folders-list-item .ChatInfo .title{display:flex;justify-content:flex-start;align-items:center}.settings-folders-list-item .ChatInfo .title h3{font-size:1rem;font-weight:500;line-height:1.3125;margin:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;text-align:left}.settings-folders-list-item .ChatInfo .status{display:none}.settings-folders-list-item .ChatInfo[dir=rtl] .title h3{text-align:right}.settings-folders-list-item .ListItem-button i{opacity:0.9}.settings-folders-list-item.color-primary .ListItem-button{color:var(--color-primary)}.settings-folders-list-item.color-primary .ListItem-button i{opacity:1;color:inherit}.settings-folders-list-item[dir=rtl] .Avatar{margin-left:1.5rem;margin-right:-0.25rem}.settings-item .ShowMoreButton{margin:0 -1rem;width:calc(100% + 2rem);padding-left:1rem !important}\n",".RangeSlider{--slider-color: var(--color-primary);margin-bottom:1rem}.RangeSlider.disabled{pointer-events:none;--slider-color: var(--color-text-secondary)}.RangeSlider .slider-top-row{display:flex;justify-content:space-between;margin-bottom:0.625rem}.RangeSlider .slider-top-row .value{flex-shrink:0;margin-left:1rem;color:var(--color-text-secondary)}.RangeSlider .slider-top-row[dir=rtl] .value{margin-left:0;margin-right:1rem}.RangeSlider .slider-main{position:relative;z-index:1}.RangeSlider .slider-main::before{content:'';position:absolute;width:100%;left:0;top:0.3125rem;height:0.125rem;background-color:var(--color-borders);border-radius:0.125rem;opacity:0.5;z-index:-1}.RangeSlider .slider-fill-track{position:absolute;width:100%;left:0;top:0.3125rem;height:0.125rem;background-color:var(--slider-color);border-radius:0.125rem;pointer-events:none}.RangeSlider input[type=\"range\"]{-webkit-appearance:none;display:block;width:100%;height:0.75rem;margin-bottom:0.5rem;background:transparent}.RangeSlider input[type=\"range\"]:focus{outline:none}.RangeSlider input[type=\"range\"]::-ms-track{width:100%;cursor:pointer;background:transparent;border-color:transparent;color:transparent}.RangeSlider input[type=\"range\"]::-webkit-slider-thumb{-webkit-appearance:none}.RangeSlider input[type=\"range\"]::-webkit-slider-thumb{background:var(--slider-color);border:none;height:0.75rem;width:0.75rem;border-radius:50%;cursor:pointer;transform:scale(1);-webkit-transition:transform .25s ease-in-out;transition:transform .25s ease-in-out}.RangeSlider input[type=\"range\"]::-webkit-slider-thumb:hover{transform:scale(1.2)}.RangeSlider input[type=\"range\"]::-moz-range-thumb{background:var(--slider-color);border:none;height:0.75rem;width:0.75rem;border-radius:50%;cursor:pointer;transform:scale(1);-moz-transition:transform .25s ease-in-out;transition:transform .25s ease-in-out}.RangeSlider input[type=\"range\"]::-moz-range-thumb:hover{transform:scale(1.2)}.RangeSlider input[type=\"range\"]::-ms-thumb{background:var(--slider-color);border:none;height:0.75rem;width:0.75rem;border-radius:50%;cursor:pointer;transform:scale(1);-ms-transition:transform .25s ease-in-out;transition:transform .25s ease-in-out}.RangeSlider input[type=\"range\"]::-ms-thumb:hover{transform:scale(1.2)}.RangeSlider .slider-options{display:grid;grid-template-rows:auto;grid-auto-columns:1fr;grid-auto-flow:column}.RangeSlider .slider-option{font-size:0.825rem;text-align:center;cursor:pointer;color:var(--color-text-secondary);transition:color .2s ease}.RangeSlider .slider-option:hover,.RangeSlider .slider-option.active{color:var(--color-text)}.RangeSlider .slider-option.active{font-weight:500}.RangeSlider .slider-option:first-child{text-align:left}.RangeSlider .slider-option:last-child{text-align:right}\n",".settings-item .SettingsStickerSet.ListItem{margin-bottom:.5rem}.SettingsStickerSet .StickerButton,.SettingsStickerSet .Button{width:3rem;height:3rem;margin:0 .5rem 0 0;padding:0;flex:0 0 3rem}.SettingsStickerSet img{max-width:100%;max-height:100%}.SettingsStickerSet .multiline-menu-item{display:flex;flex-direction:column;justify-content:center}.SettingsStickerSet[dir=rtl] .StickerButton,.SettingsStickerSet[dir=rtl] .Button{margin:0 0 0 .5rem}\n",".WallpaperTile{height:0;padding-bottom:100%;cursor:pointer;position:relative}.WallpaperTile .media-inner,.WallpaperTile::after{position:absolute;left:0;top:0;width:100%;height:100%}.WallpaperTile .media-inner{overflow:hidden;transform:scale(1);transition:transform .15s ease}.WallpaperTile .media-inner img,.WallpaperTile .media-inner canvas{position:absolute;left:0;top:0;width:100%;height:100%;object-fit:cover}.WallpaperTile::after{content:\"\";display:block;border:2px solid var(--color-primary);opacity:0;transition:opacity .15s ease}.WallpaperTile.selected::after{opacity:1}.WallpaperTile.selected .media-inner{transform:scale(0.9)}.WallpaperTile .spinner-container{height:100%;display:flex;align-items:center;justify-content:center}\n",".SettingsGeneralBackground .settings-wallpapers{display:grid;padding:.5rem;grid-template-columns:repeat(3, 1fr);grid-auto-rows:1fr;grid-gap:.25rem}.SettingsGeneralBackground .Loading{height:auto !important;margin-top:5rem}\n",".SettingsGeneralBackgroundColor:not(.is-dragging) .handle{transition:transform 300ms ease}.SettingsGeneralBackgroundColor .color-picker,.SettingsGeneralBackgroundColor .hue-picker{position:relative}.SettingsGeneralBackgroundColor .color-picker{margin-top:1rem;height:12rem;touch-action:none}.SettingsGeneralBackgroundColor .hue-picker{margin:2rem 0;height:0.5rem}.SettingsGeneralBackgroundColor canvas{display:block;width:100%;height:100%;border-radius:var(--border-radius-default);cursor:pointer}.SettingsGeneralBackgroundColor .handle{position:absolute;top:-0.75rem;left:-0.75rem;width:1.5rem;height:1.5rem;border:0.125rem solid var(--color-white);border-radius:0.75rem;cursor:grab}.SettingsGeneralBackgroundColor .hue-picker .handle{top:-0.5rem}.SettingsGeneralBackgroundColor .tools{margin-bottom:0.625rem;display:flex}.SettingsGeneralBackgroundColor .tools .input-group{margin-bottom:0}.SettingsGeneralBackgroundColor .tools .input-group[dir=rtl] label{transform:scale(0.75) translate(1.25rem, -2.25rem)}.SettingsGeneralBackgroundColor .tools .input-group:first-child{margin-right:0.5rem}.SettingsGeneralBackgroundColor .tools .input-group:last-child{margin-left:0.5rem}.SettingsGeneralBackgroundColor .predefined-colors{display:grid;padding:.5rem;grid-template-columns:repeat(3, 1fr);grid-auto-rows:1fr;grid-gap:.25rem}.SettingsGeneralBackgroundColor .predefined-colors div{cursor:pointer;box-shadow:inset 0 0 0 0 var(--color-background);transition:box-shadow 300ms ease}.SettingsGeneralBackgroundColor .predefined-colors div.active{border:0.125rem solid var(--color-primary);box-shadow:inset 0 0 0 0.3125rem var(--color-background)}.SettingsGeneralBackgroundColor .predefined-colors div:before{display:block;content:\"\";width:100%;padding-top:100%;pointer-events:none}\n","#monkey{position:relative;display:block;margin-left:auto;margin-right:auto;width:7.5rem;height:7.5rem;margin-bottom:1.75rem}@media (min-width: 600px) and (min-height: 450px){#monkey{width:10rem;height:10rem;margin-bottom:2.5rem}}#monkey.big{width:10rem;height:10rem}#monkey .AnimatedSticker{position:absolute;left:0;top:0;width:100%;height:100%}#monkey .AnimatedSticker.hidden{display:none}#monkey .monkey-preview{width:100%;height:100%;background-size:100%;background:url(monkey.a3d5fcdc50b18dc55695f7dd4101a8c9.svg) center}\n","#Settings{height:100%}#Settings>div{display:flex;flex-direction:column;overflow:hidden}.settings-main-header{display:flex;flex-grow:1;justify-content:space-between;align-items:center}.settings-more-menu .bubble{width:auto}.settings-more-menu .bubble .MenuItem button{padding-left:1rem !important;padding-right:2rem !important}.settings-content{background:var(--color-background);height:calc(100% - var(--header-height));overflow-y:auto}.settings-content.infinite-scroll{display:flex;flex-direction:column}.settings-content.infinite-scroll>.custom-scroll{flex:1 1 auto;height:auto}.settings-content #monkey{margin-top:.5rem;margin-bottom:1rem}.settings-content .AnimatedEmoji{margin-top:.5rem;margin-bottom:1.5rem}.settings-content-header{display:flex;flex-direction:column;align-items:center;padding:0 1.5rem 1rem;text-align:center}.settings-content-header .input-group{width:100%}.settings-content-icon{width:5rem;height:5rem;margin-bottom:2.5rem;position:relative}.settings-content-icon .AnimatedSticker{position:absolute;left:0;top:0;width:100%;height:100%}.settings-content-icon .AnimatedSticker.hidden{display:none}.settings-main-menu{padding:0 0.5rem 1rem}.settings-current-user{margin-bottom:1.125rem;text-align:center}.settings-current-user .Avatar{margin:0 auto 1.5rem}.settings-current-user .name{display:flex;justify-content:center;align-items:center;font-weight:500;font-size:1.5rem;line-height:2rem;margin:0}.settings-current-user .name .VerifiedIcon{margin-left:0.25rem;margin-top:0.1rem}.settings-current-user .phone{font-size:0.875rem;color:#868e96;margin:0}.settings-item{border-top:1px solid var(--color-borders);padding:1.5rem 1.5rem 1rem}.settings-item.no-border{border-top:none}.settings-item-header{font-size:1rem;color:var(--color-text-secondary);margin-bottom:2rem;position:relative}.settings-item-header[dir=rtl]{text-align:right}.settings-item-description{font-size:0.875rem;color:var(--color-text-secondary);margin-top:-0.5rem;margin-bottom:1.5rem}.settings-content.two-fa .settings-item-description{font-size:1rem}.settings-item-description[dir=rtl]{text-align:right;unicode-bidi:plaintext}.settings-item-description-larger{font-size:1rem;line-height:1.3125rem;color:var(--color-text-secondary);margin-top:2rem;margin-bottom:0.75rem}.settings-item-description-larger[dir=rtl]{text-align:right}.settings-item .ListItem{margin:0 -1rem 1rem}.settings-item .ListItem:last-child{margin-bottom:0}.settings-item .ListItem .multiline-menu-item{white-space:initial}.settings-item .ListItem .multiline-menu-item.full-size{width:100%}.settings-item .ListItem .multiline-menu-item .date{float:right;font-size:0.75rem;margin-left:1rem;color:var(--color-text-secondary)}.settings-item .ListItem .multiline-menu-item .title,.settings-item .ListItem .multiline-menu-item .subtitle{display:block;text-align:left}.settings-item .ListItem .multiline-menu-item .title{line-height:1.25rem}.settings-item .ListItem .multiline-menu-item .subtitle{font-size:0.875rem;line-height:1.5rem;color:var(--color-text-secondary)}.settings-item .ListItem .multiline-menu-item .subtitle+.subtitle{margin-top:-0.25rem}.settings-item .ListItem .multiline-menu-item .subtitle.black{color:var(--color-text)}.settings-item .ListItem .multiline-menu-item .subtitle.tight{line-height:1.3125rem;margin-bottom:.1875rem}.settings-item .ListItem.destructive .ListItem-button{color:var(--color-error)}.settings-item .ListItem.destructive .ListItem-button i{color:inherit}.settings-item .ListItem.blocked-list-item{margin-bottom:0.5rem}.settings-item .ListItem.blocked-list-item .ListItem-button{align-items:center;text-align:left;padding:0.5rem}.settings-item .ListItem.blocked-list-item .Avatar{width:3rem;height:3rem;margin-right:1rem}.settings-item .ListItem.blocked-list-item .contact-name{font-size:1rem;line-height:1rem;margin-bottom:0.25rem;font-weight:500}.settings-item .ListItem.blocked-list-item .contact-phone{font-size:0.875rem;line-height:1rem;color:var(--color-text-secondary)}.settings-item .ListItem[dir=rtl] .multiline-menu-item .title,.settings-item .ListItem[dir=rtl] .multiline-menu-item .subtitle{text-align:right}.settings-item .ListItem[dir=rtl] .multiline-menu-item .date{float:left;margin-left:0;margin-right:1rem}.settings-item .RangeSlider{margin-bottom:1.0625rem}.settings-item .Checkbox,.settings-item .radio-group{margin:0 -1rem 0.5rem}.settings-item .radio-group .Radio:last-child{margin-bottom:0}.settings-item .Radio+.Radio,.settings-item .Checkbox+.Checkbox{margin-top:2rem}.settings-fab-wrapper{height:calc(100% - var(--header-height));position:relative;overflow:hidden}.settings-fab-wrapper .settings-content{height:100%}.settings-fab-wrapper .FloatingActionButton{right:1.5rem}.settings-edit-profile{padding:0 1.5rem}.username-link{color:var(--color-links)}\n",".NewChat{height:100%;overflow:hidden;position:relative}.NewChat-inner{height:calc(100% - var(--header-height));overflow:hidden}.NewChat-inner.step-2{padding:0 1.25rem;display:flex;flex-direction:column}.NewChat-inner.step-2 .note,.NewChat-inner.step-2 .error{font-size:0.875rem;line-height:1.25rem;margin:1.5rem 0.25rem}.NewChat-inner.step-2 .error{color:var(--color-error)}.NewChat-inner.step-2 .note{margin-top:-0.5625rem;color:var(--color-text-secondary)}.NewChat-inner.step-2 .chat-members-heading{color:var(--color-text-secondary);font-size:1rem;font-weight:500;margin:1rem 0.25rem}.NewChat-inner.step-2 .chat-members-list{margin:0 -1.25rem;padding:0 1rem 1rem;overflow-x:hidden;flex-grow:1}\n",".ArchivedChats{height:100%;overflow:hidden}.ArchivedChats .chat-list{height:calc(100% - var(--header-height))}\n",".MessageContextMenu{position:absolute;font-size:1rem}.MessageContextMenu .bubble{transform:scale(0.5);transition:opacity 0.15s cubic-bezier(0.2, 0, 0.2, 1),transform 0.15s cubic-bezier(0.2, 0, 0.2, 1) !important}.MessageContextMenu .backdrop{position:absolute;touch-action:none}\n",".StickerSetModal .modal-dialog{width:26.25rem;max-width:100%}@media (max-width: 600px){.StickerSetModal .modal-dialog{width:18.875rem}}.StickerSetModal .modal-header{padding:0.5rem 1rem}.StickerSetModal .modal-content{text-align:center;padding:0}.StickerSetModal .stickers{position:relative;width:100%;height:19rem;max-height:50vh;overflow-y:auto;padding:0 0.25rem;text-align:left}.StickerSetModal .button-wrapper{padding:0.5rem 0;border-top:1px solid var(--color-borders);box-shadow:0 0 2px var(--color-default-shadow)}.StickerSetModal .button-wrapper button{display:inline-block}.StickerSetModal .Loading{width:100%;height:22.8125rem;max-height:calc(50vh + 3.8125rem)}\n",".HeaderMenuContainer{position:fixed;top:0;left:0;right:0;height:100vh;z-index:var(--z-header-menu)}.HeaderMenuContainer .Menu{position:absolute;font-size:1rem}.HeaderMenuContainer .Menu .backdrop{z-index:var(--z-header-menu-backdrop)}.HeaderMenuContainer .Menu .bubble{z-index:var(--z-header-menu);--offset-y: calc(100% + 1rem)}\n","#MobileSearch>.header{position:absolute;top:0;left:0;z-index:var(--z-mobile-search);width:100%;height:3.5rem;background:var(--color-background);display:flex;align-items:center;padding:0 0.5rem 0 0.25rem}#MobileSearch>.header>.SearchInput{margin-left:0.25rem;flex:1}#MobileSearch>.footer{position:absolute;bottom:0;left:0;z-index:var(--z-mobile-search);width:100%;height:3.5rem;background:var(--color-background);display:flex;align-items:center;padding-left:1rem;padding-right:0.5rem}#MobileSearch>.footer>.counter{flex:1;color:var(--color-text-secondary)}#MobileSearch:not(.active) .header,#MobileSearch:not(.active) .footer{transform:translateX(-999rem)}\n",".MentionTooltip{width:calc(100% - 4rem);max-width:20rem;flex-direction:column;z-index:-1}@media (max-width: 600px){.MentionTooltip{width:calc(100% - 3rem)}}.MentionTooltip .ListItem.chat-item-clickable{margin:0}.MentionTooltip .ListItem.chat-item-clickable .ListItem-button{border-radius:0}.MentionTooltip .ListItem.chat-item-clickable .info{display:flex}.MentionTooltip .ListItem.chat-item-clickable .title{margin-inline-end:.625rem;max-width:70%}.MentionTooltip .ListItem.chat-item-clickable .handle{font-size:1rem}.MentionTooltip .ListItem.chat-item-clickable[dir=rtl] .status{width:auto}.MentionTooltip .ChatInfo .title h3{line-height:1.25}.MentionTooltip .ChatInfo .Avatar{margin-right:0.7em}.MentionTooltip .ChatInfo .handle::before{content:'@'}.MentionTooltip .ChatInfo .user-status{display:none !important}\n",".AttachmentModal{--border-radius-default: 0.625rem}.AttachmentModal .modal-dialog{max-width:26.25rem}@media (max-width: 600px){.AttachmentModal .modal-dialog{max-height:100%;padding-bottom:1.5rem}}.AttachmentModal .modal-content{padding:.5rem 1.25rem 1.875rem;max-height:calc(100vh - 3.25rem)}@media (max-width: 600px){.AttachmentModal .modal-content{padding-bottom:.25rem}}.AttachmentModal .media-wrapper{max-height:26rem;overflow:auto;display:flex;flex-wrap:wrap;margin-bottom:1.5rem}.AttachmentModal .media-wrapper video,.AttachmentModal .media-wrapper img{flex:1;width:calc(50% - 0.15rem);height:12rem;margin-bottom:0.3rem;border-radius:var(--border-radius-default);object-fit:cover}.AttachmentModal .media-wrapper video:only-child,.AttachmentModal .media-wrapper img:only-child{height:auto;max-height:25rem;margin-bottom:0}.AttachmentModal .media-wrapper video:nth-child(even),.AttachmentModal .media-wrapper img:nth-child(even){margin-left:0.3rem}.AttachmentModal .document-wrapper{max-height:25rem;overflow:auto;flex-shrink:0;display:flex;flex-direction:column;margin:.75rem 0 1.75rem}.AttachmentModal .document-wrapper .File:not(:last-child){margin-bottom:1.5rem}.AttachmentModal .document-wrapper .file-icon{cursor:default !important}.AttachmentModal .attachment-caption-wrapper{position:relative}.AttachmentModal .attachment-caption-wrapper .form-control{background:var(--color-background)}.AttachmentModal .attachment-caption-wrapper .MentionTooltip{right:0 !important;z-index:0}.AttachmentModal .drop-target{position:relative}.AttachmentModal .drop-target::before,.AttachmentModal .drop-target::after{content:'';position:absolute;left:0;top:0;right:0;bottom:0;border-radius:var(--border-radius-default);pointer-events:none;opacity:0;transition:250ms opacity;z-index:1}.AttachmentModal .drop-target::before{background-image:var(--drag-target-border-hovered);background-color:var(--color-background)}.AttachmentModal .drop-target::after{content:attr(data-attach-description);display:flex;justify-content:center;align-items:center;color:var(--color-primary)}.AttachmentModal.hovered .drop-target::before{opacity:.95}.AttachmentModal.hovered .drop-target::after{opacity:1}.AttachmentModal.hovered .attachment-caption-wrapper,.AttachmentModal.hovered .document-wrapper,.AttachmentModal.hovered .media-wrapper{pointer-events:none}.AttachmentModal.hovered .document-wrapper,.AttachmentModal.hovered .media-wrapper{border-radius:var(--border-radius-default)}\n",".PollModal .modal-dialog{max-width:26.25rem;max-height:calc(100vh - 5rem)}.PollModal .modal-content{padding:.5rem 1.25rem 1.875rem;min-height:4.875rem}.PollModal .modal-header-condensed{margin-bottom:1rem}.PollModal .options-header{color:var(--color-text-secondary);font-size:1rem;font-weight:500;margin:1.5rem 0.25rem}.PollModal .options-list{margin:1rem -0.75rem -0.5rem;padding:0 0.75rem;border-top:1px solid var(--color-chat-hover);max-height:20rem;overflow:auto}.PollModal .options-list.overflown{padding:0 0.4rem 0.5rem 0.75rem}@media (max-width: 600px){.PollModal .options-list{overflow:hidden;max-height:none}.PollModal .options-list,.PollModal .options-list.overflown{padding:0 0.75rem}}.PollModal .option-wrapper{position:relative}.PollModal .option-wrapper .form-control{padding-right:3rem}.PollModal .option-wrapper .option-remove-button{position:absolute;top:0.3125rem;right:0.3125rem}.PollModal .quiz-mode{margin-top:1.5rem}.PollModal .quiz-mode .options-header{margin-bottom:0.5rem}.PollModal .quiz-mode .note{margin-top:0.5rem}.PollModal .note{font-size:smaller;color:var(--color-text-secondary)}.PollModal .error{font-size:smaller;color:var(--color-error);margin:-1rem 0 1rem .25rem}.PollModal .input-group:last-child{margin-bottom:0.5rem}\n",".EmojiButton{display:inline-flex;align-items:center;justify-content:center;width:2.5rem;height:2.5rem;margin:0.125rem;border-radius:var(--border-radius-messages-small);cursor:pointer;font-size:1.75rem;line-height:2.5rem;background-color:transparent;transition:background-color .15s ease}.mac-os-fix .EmojiButton{line-height:inherit}.EmojiButton.focus,.EmojiButton:hover{background-color:var(--color-background-selected)}.EmojiButton>img{width:2rem;height:2rem}\n",".EmojiPicker{height:100%}.EmojiPicker-main{height:calc(100% - 3rem);overflow-y:auto;padding:0.5rem}@media (max-width: 600px){.EmojiPicker-main{padding:0.5rem 0.25rem}}.EmojiPicker-main .symbol-set-container{display:flex;flex-wrap:wrap}.EmojiPicker-header{height:3rem;border-bottom:1px solid var(--color-borders);display:flex;align-items:center;justify-content:space-around;box-shadow:0 0 2px var(--color-default-shadow)}@media (max-width: 600px){.EmojiPicker-header{overflow-x:auto;overflow-y:hidden;display:block;white-space:nowrap;padding:0.4375rem 0;scrollbar-width:none;scrollbar-color:rgba(0,0,0,0)}.EmojiPicker-header::-webkit-scrollbar{height:0}.EmojiPicker-header::-webkit-scrollbar-thumb{background-color:rgba(0,0,0,0)}.EmojiPicker-header .symbol-set-button{display:inline-flex;vertical-align:middle}.EmojiPicker-header::after{content:\"\";display:block;flex-shrink:0;width:0.1px;height:1rem}}\n",".StickerPicker{height:100%}.StickerPicker-main{position:relative;height:calc(100% - 3rem);overflow-y:auto;padding:0.5rem}@media (max-width: 600px){.StickerPicker-main{padding:0.5rem 0.25rem}}.StickerPicker-header{height:3rem;border-bottom:1px solid var(--color-borders);padding:0.125rem 0;overflow-x:auto;overflow-y:hidden;white-space:nowrap;box-shadow:0 0 2px var(--color-default-shadow);scrollbar-width:none;scrollbar-color:rgba(0,0,0,0)}.StickerPicker-header::-webkit-scrollbar{height:0}.StickerPicker-header::-webkit-scrollbar-thumb{background-color:rgba(0,0,0,0)}.StickerPicker-header::after{content:\"\";display:block;flex-shrink:0;width:0.1px;height:1rem}.StickerPicker-header .sticker-set-button{display:inline-flex;vertical-align:middle}.StickerPicker-header .sticker-set-button.StickerButton{background-size:2rem}.StickerPicker-header .sticker-set-button.StickerButton img,.StickerPicker-header .sticker-set-button.StickerButton .AnimatedSticker{top:0.375rem;left:0.375rem;width:2rem;height:2rem}.StickerPicker-header .sticker-set-button .sticker-set-cover{width:2rem;height:2rem;position:relative;display:flex;align-items:center;justify-content:center}.StickerPicker-header .sticker-set-button .sticker-set-cover img,.StickerPicker-header .sticker-set-button .sticker-set-cover .AnimatedSticker{width:100%;height:100%;position:absolute;top:0;left:0}.StickerPicker .symbol-set-container{width:25rem;line-height:0}@media (max-width: 600px){.StickerPicker .symbol-set-container{width:100%}}.StickerPicker .sticker-set-button{width:2.75rem !important;height:2.75rem;margin:0 0.25rem;border-radius:var(--border-radius-messages-small)}\n",".GifButton{display:flex;align-items:center;justify-content:center;height:6.25rem;background-color:transparent;cursor:pointer;overflow:hidden;position:relative}.GifButton:last-child{margin-bottom:1rem}.GifButton.vertical{grid-column-end:span 1}.GifButton.horizontal{grid-column-end:span 2}.GifButton .thumbnail{background-size:cover !important;background:transparent no-repeat center}.GifButton .thumbnail ~ video{position:absolute}.GifButton .thumbnail,.GifButton video{width:100%;height:100%;object-fit:cover}.GifButton:not(.shown){display:block !important;visibility:hidden}.GifButton .Spinner{position:absolute;pointer-events:none}\n",".GifPicker{display:grid;grid-template-columns:repeat(6, 1fr);grid-auto-rows:6.25rem;grid-gap:0.25rem;grid-auto-flow:dense;height:100%;overflow-y:auto;padding:0.25rem}.GifPicker .Loading,.GifPicker .picker-disabled{grid-column:1 / -1;height:var(--menu-height)}\n",".SymbolMenu.mobile-menu{position:fixed;left:0;right:0;bottom:0;background:var(--color-background);transform:translate3d(0, calc(var(--symbol-menu-height) + var(--symbol-menu-footer-height)), 0);z-index:1;transition:transform var(--layer-transition)}.SymbolMenu.mobile-menu.open{transform:translate3d(0, 0, 0)}body.is-media-viewer-open .SymbolMenu.mobile-menu.open{transform:translate3d(0, calc(var(--symbol-menu-height) + var(--symbol-menu-footer-height)), 0)}body.animation-level-0 .SymbolMenu.mobile-menu{transition:none}.SymbolMenu.mobile-menu:not(.middle-column-open){transform:translate3d(100vw, 0, 0) !important}.SymbolMenu-main{width:var(--symbol-menu-width);height:var(--symbol-menu-height);max-height:calc(100vh - var(--symbol-menu-footer-height))}.SymbolMenu-footer{height:var(--symbol-menu-footer-height);border-top:1px solid var(--color-borders);display:flex;align-items:center;justify-content:center;box-shadow:0 0 2px var(--color-default-shadow);position:relative}.SymbolMenu-footer .Button{flex-shrink:0;width:2.125rem !important;height:2.125rem;margin:0 .25rem;padding:0}.SymbolMenu-footer .Button.activated{pointer-events:none}.SymbolMenu-footer .Button.symbol-tab-button{margin:0 0.75rem}.SymbolMenu-footer .Button.symbol-search-button{position:absolute;left:0.25rem}.SymbolMenu-footer .Button.symbol-delete-button{position:absolute;right:0.25rem}.SymbolMenu .Transition.slide{height:100%}.SymbolMenu .Transition.slide .Loading{height:var(--symbol-menu-height)}.is-pointer-env .SymbolMenu>.backdrop{position:absolute;top:-1rem;left:0;right:auto;width:3.5rem;height:4.5rem}.SymbolMenu .bubble{padding:0;width:var(--symbol-menu-width);overflow:hidden}.SymbolMenu .picker-disabled{height:var(--symbol-menu-height);display:flex;align-items:center;justify-content:center;color:var(--color-text-secondary)}.SymbolMenu .symbol-close-button{display:none;position:absolute;right:.25rem;top:.25rem}@media (orientation: landscape){.SymbolMenu .symbol-close-button{display:block}}.symbol-set{margin-bottom:1rem}.symbol-set-name{font-size:1rem;line-height:1.6875rem;font-weight:500;margin:0;padding-left:0.5rem;color:rgba(var(--color-text-secondary-rgb), 0.75);overflow:hidden;white-space:nowrap;text-overflow:ellipsis;text-align:initial;unicode-bidi:plaintext}.symbol-set-container{text-align:initial}.symbol-set-button{flex-shrink:0;width:2.125rem !important;height:2.125rem;margin:0 0.25rem;padding:0}.Transition>div:not(.active) .symbol-set,body.animating-right-column .symbol-set{overflow:hidden}.symbol-set .symbol-set-container:not(.shown){display:block}.symbol-set .symbol-set-container.closing{transition:none}\n",".AttachMenu{position:relative}.is-pointer-env .AttachMenu>.backdrop{position:absolute;top:-1rem;left:auto;right:0;width:3.5rem}.AttachMenu .media-disabled>button{white-space:normal}\n",".StickerTooltip{display:grid;grid-template-columns:repeat(auto-fill, minmax(5rem, 1fr));grid-auto-rows:auto;place-items:center}.StickerTooltip.hidden{display:none}\n",".KeyboardMenu .bubble{width:100% !important;max-width:27rem;border-radius:var(--border-radius-default-small)}.KeyboardMenu .content{display:flex;flex-direction:column;padding:.1875rem .625rem;max-height:80vh;overflow:auto}@media (max-width: 600px){.KeyboardMenu .content{max-height:75vh}}.KeyboardMenu .content .row{display:flex;flex-direction:row}.KeyboardMenu .content .row+.row{margin-top:.375rem}.KeyboardMenu .content .Button{flex:1;width:auto;height:auto;min-height:3.0625rem;border-radius:var(--border-radius-messages-small);border:2px solid var(--color-primary);background:var(--color-background);color:var(--color-primary);font-weight:500;text-transform:none}.KeyboardMenu .content .Button:hover{color:#fff;border-color:var(--color-primary-shade)}.KeyboardMenu .content .Button+.Button{margin-left:.375rem}\n",".CustomSendMenu{position:relative;bottom:3.5rem}.is-pointer-env .CustomSendMenu>.backdrop{position:absolute;top:-1rem;left:auto;right:0;width:3.5rem}.CustomSendMenu .media-disabled>button{white-space:normal}.CustomSendMenu .bubble{width:16rem}\n",".EmojiTooltip{display:flex;padding-left:.25rem;overflow-x:auto;overflow-x:overlay;overflow-y:hidden}.EmojiTooltip .EmojiButton{flex:0 0 2.5rem}\n",".BaseResult.chat-item-clickable>.ListItem-button{padding-left:1.25rem !important;padding-right:1.25rem !important}.BaseResult.chat-item-clickable>.ListItem-button .title{display:block;text-overflow:ellipsis}.BaseResult .thumb{background-color:var(--color-background-secondary);flex:0 0 3rem;width:3rem;height:3rem;line-height:3rem;border-radius:var(--border-radius-default-tiny);display:inline-flex;align-content:center;justify-content:center;margin-inline-end:.5rem;overflow:hidden;font-size:1.5rem}.BaseResult .thumb img:not(.emoji){width:100%;object-fit:cover}.BaseResult .thumb img.emoji{width:1.5rem;height:1.5rem;margin:.75rem 0 0}.BaseResult .content-inner{min-width:0}.BaseResult .title{font-weight:500;text-align:left;unicode-bidi:plaintext}.BaseResult .description{white-space:normal;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;text-align:left;unicode-bidi:plaintext}.BaseResult[dir=rtl] .title,.BaseResult[dir=rtl] .description{text-align:right}\n",".MediaResult{height:0;padding-bottom:100%;overflow:hidden;position:relative;cursor:pointer}.MediaResult img{position:absolute;left:0;top:0;width:100%;height:100%;object-fit:cover}\n",".InlineBotTooltip{--border-radius-default: 0}.InlineBotTooltip .switch-pm .title{margin:0 auto;font-weight:500}.InlineBotTooltip.gallery{display:grid;grid-template-columns:repeat(4, 1fr);grid-gap:1px;padding:0}@media (max-width: 600px){.InlineBotTooltip.gallery{grid-template-columns:repeat(3, 1fr)}}.InlineBotTooltip.gallery .switch-pm{grid-column:1 / -1}.InlineBotTooltip.gallery .switch-pm .ListItem-button{border-bottom-left-radius:0;border-bottom-right-radius:0}.InlineBotTooltip.gallery .GifButton{grid-column-end:initial}.InlineBotTooltip.gallery .StickerButton{width:initial;height:0;margin:0;padding-bottom:100%;border-radius:0}.InlineBotTooltip.gallery .StickerButton .AnimatedSticker,.InlineBotTooltip.gallery .StickerButton img,.InlineBotTooltip.gallery .StickerButton canvas{position:absolute;top:0;left:0;width:100% !important;height:100% !important}@media (min-width: 600px){.InlineBotTooltip.gallery .StickerButton .AnimatedSticker,.InlineBotTooltip.gallery .StickerButton img,.InlineBotTooltip.gallery .StickerButton canvas{top:.25rem;left:.25rem;width:calc(100% - .5rem) !important;height:calc(100% - .5rem) !important}}\n",".RightSearch{height:100%;padding:0 0.5rem;overflow-y:auto}.RightSearch .helper-text{padding:1rem;margin-bottom:0.125rem;font-weight:500;color:var(--color-text-secondary);unicode-bidi:plaintext;text-align:initial}\n",".StickerSearch{height:100%;padding:0 0.5rem;overflow-y:auto}.StickerSearch .helper-text{padding:1rem;margin-bottom:0.125rem;font-weight:500;color:var(--color-text-secondary)}.StickerSearch .sticker-set{margin-bottom:1rem}.StickerSearch .sticker-set-header{display:flex;justify-content:space-between;padding:0.5rem}.StickerSearch .sticker-set-header .title-wrapper{overflow:hidden}.StickerSearch .sticker-set-header .title{font-size:1rem;line-height:1.6875rem;margin:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.StickerSearch .sticker-set-header .count{color:var(--color-text-secondary);margin:0}.StickerSearch .sticker-set-header .Button{flex-shrink:0;margin-left:1rem}.StickerSearch .sticker-set-header .Button.is-added{background:var(--color-chat-hover);color:var(--color-text-secondary)}.StickerSearch .sticker-set-header .Button.is-added:hover,.StickerSearch .sticker-set-header .Button.is-added:active{background:var(--color-item-active) !important}.StickerSearch .sticker-set-main{display:flex;flex-wrap:nowrap;overflow:hidden}.StickerSearch .sticker-set[dir=rtl] .title-wrapper{text-align:right}.StickerSearch .sticker-set[dir=rtl] .Button{margin-left:0;margin-right:1rem}.StickerSearch .StickerButton{margin:0.125rem}\n",".GifSearch{height:100%;padding:0.25rem}.GifSearch .gif-container{height:100%;overflow:auto}.GifSearch .gif-container.grid{display:grid;grid-template-columns:repeat(6, 1fr);grid-auto-rows:6.25rem;grid-gap:0.25rem;grid-auto-flow:dense}.GifSearch .helper-text{color:var(--color-text-meta);margin-top:2rem;text-align:center}\n",".PollAnswerResults{border-bottom:1px solid var(--color-borders);padding:0 .5rem .625rem;display:flex;flex-direction:column-reverse}.PollAnswerResults .answer-head{display:flex;align-items:center;font-size:.9375rem;line-height:1.3125rem;font-weight:500;color:var(--color-text-secondary);padding:1rem .75rem .5rem 1rem;position:sticky;top:0;background:var(--color-background)}@media (max-width: 600px){.PollAnswerResults .answer-head{padding:.5rem .25rem .5rem .5rem}}.PollAnswerResults .answer-percent{margin-left:auto}.PollAnswerResults .answer-percent[dir=auto]{margin-left:0;margin-right:auto}.PollAnswerResults .poll-voters{padding:0 .75rem;position:relative;min-height:3rem}@media (max-width: 600px){.PollAnswerResults .poll-voters{padding:0 .25rem}}.PollAnswerResults .poll-voters .Spinner{--spinner-size: 1.25rem}.PollAnswerResults .chat-item-clickable .ChatInfo .Avatar.size-tiny{margin-right:1.75rem}.PollAnswerResults .chat-item-clickable[dir=rtl] .ChatInfo .Avatar.size-tiny{margin-left:1.75rem;margin-right:0}.PollAnswerResults .ShowMoreButton{margin:.25rem 0 0 -0.5rem;width:calc(100% + 1rem)}.PollAnswerResults .ShowMoreButton[dir=rtl] .icon-down{margin-left:2rem;margin-right:0}.PollAnswerResults .icon-down{vertical-align:middle;margin-right:2rem;font-size:1.5rem}\n",".PollResults{height:100%;position:relative;display:flex;flex-direction:column;pointer-events:auto}.PollResults>.Loading{position:absolute;top:0;left:0;bottom:0;right:0;background:rgba(255,255,255,0.75)}.PollResults .poll-question{padding:.75rem 1.5rem;flex-shrink:0;font-size:1.25rem}@media (max-width: 600px){.PollResults .poll-question{padding:0 1rem}}.PollResults .poll-results-list{border-top:1px solid var(--color-borders);flex-grow:1;overflow:auto}\n",".Management{position:relative;height:100%}.Management>.custom-scroll{height:100%;overflow-y:scroll;overflow-x:hidden}.Management .section{padding:1rem 1.5rem;border-top:1px solid var(--color-borders)}.Management .section.wide{padding:1.5rem}.Management .section:first-of-type{border-top:none;padding-top:1rem}.Management .section.no-border{border-top:none}.Management .section>.ChatInfo{margin:0 0 2rem !important}.Management .section>.ChatInfo .title h3{margin-bottom:0}.Management .section .section-icon{width:8.75rem;height:8.75rem;margin:0 auto 2rem;position:relative}.Management .section .section-icon .AnimatedSticker{position:absolute;left:0;top:0;width:100%;height:100%}.Management .section .section-icon .AnimatedSticker.hidden{display:none}.Management .section .ListItem{margin:0 -.75rem}.Management .section .ListItem:last-child{margin-bottom:0}.Management .section .ListItem .multiline-item .subtitle{line-height:1.25rem}.Management .section .ListItem:not(.picker-list-item) .Checkbox{margin-top:2rem;margin-bottom:2rem}.Management .section .ListItem.narrow .Checkbox{margin-top:1rem;margin-bottom:1rem}.Management .section .ListItem.exceptions-member .ChatInfo .status{white-space:pre-wrap}.Management .section .section-heading{font-weight:500;font-size:.9375rem;color:var(--color-text-secondary)}.Management .section .section-heading[dir=auto]{text-align:initial}.Management .section .section-help{color:var(--color-text-secondary);line-height:1.375rem}.Management .section .section-help[dir=auto]{text-align:initial}.Management .section .section-info{color:var(--color-text-secondary);font-size:.875rem}.Management .section[dir=rtl]{text-align:right}.Management textarea.form-control{height:auto}.Management .group-link{color:var(--color-text)}.Management .radio-group{margin-top:2rem}.Management .radio-group .Radio{padding-left:3.5rem;margin-bottom:2rem}.Management .radio-group .Radio:last-child{margin-bottom:.625rem}.Management .radio-group .Radio-main::before{left:0.125rem;top:.25rem;transform:none}.Management .radio-group .Radio-main::after{left:0.4375rem;top:.5625rem;transform:none}.ManageGroupMembers{padding:0.5rem 1rem}\n",".ShippingInfo{padding:0.5rem 1rem}.ShippingInfo h5{font-size:0.9rem;color:var(--color-text-secondary);margin:1rem 0 1.1rem}\n",".Shipping{padding:0.5rem 1rem}.Shipping form p{color:var(--color-text-secondary);font-weight:500;margin:.5rem 0 2rem}.Shipping form .Radio{margin-bottom:2rem}\n",".Checkout{padding:0.5rem 0}.Checkout .description{display:flex;flex-direction:row;margin:0 1rem}.Checkout .description img{height:6rem;margin:.5rem}.Checkout .description .text h5{margin-top:.5rem;font-size:1.125rem}.Checkout .description .text p{font-size:0.8rem;line-height:1rem;color:var(--color-text-secondary)}.Checkout .price-info{margin:1rem}.Checkout .price-info .price-info-item{margin:1rem .5rem;display:flex;flex-direction:row;align-content:space-between;color:var(--color-text-secondary);font-weight:500}.Checkout .price-info .price-info-item-main{color:var(--color-text)}.Checkout .price-info .price-info-item .title{display:flex;flex:1 auto}.Checkout .invoice-info{border-top:1px var(--color-borders) solid;padding:1rem}.Checkout .invoice-info .checkout-info-item{display:flex;padding:.75rem .5rem 1rem;text-align:left}.Checkout .invoice-info .checkout-info-item i{font-size:1.5rem;color:var(--color-text-secondary);margin-right:2rem;width:1.5rem}.Checkout .invoice-info .checkout-info-item i.stripe-provider{background:url(stripe-logo.c0c5683dcd30037389c35a31040908ed.png) no-repeat center;background-size:2rem;border-radius:1rem;height:1.5rem}.Checkout .invoice-info .checkout-info-item .info .title{font-size:1rem;line-height:1.4375rem;margin-bottom:0;font-weight:400;word-break:break-word;color:var(--color-text);text-transform:capitalize}.Checkout .invoice-info .checkout-info-item .info .data{margin-bottom:0;font-size:0.875rem;color:var(--color-text-secondary)}\n",".CardInput{position:relative}.CardInput .input-group.has-left-addon .form-control{padding-left:4rem}.CardInput .left-addon{position:absolute;top:.8rem;left:1rem;z-index:8}.CardInput .left-addon img{max-width:2rem}\n",".PaymentInfo{padding:0.5rem 1rem}.PaymentInfo h5{font-size:0.9rem;color:var(--color-text-secondary);margin:1rem 0 1.1rem}.PaymentInfo .inline-inputs{display:flex;justify-content:space-between}.PaymentInfo .inline-inputs .input-group{flex:1 10rem;max-width:45%;display:flex}\n",".PaymentModal .modal-backdrop{pointer-events:none}.PaymentModal .header{position:relative;border-top-left-radius:10px;border-top-right-radius:10px;width:100%;padding:.25rem 1rem;display:flex;align-items:center;flex-direction:row;background:var(--color-background);border-bottom:1px var(--color-borders) solid}.PaymentModal .header h3{margin-bottom:0;margin-left:1.5rem;unicode-bidi:plaintext;text-align:initial}.PaymentModal .Transition{height:25rem}.PaymentModal .empty-content{height:25rem;max-height:90%;display:flex;align-items:center;justify-content:center}.PaymentModal .receipt-content{height:25rem;overflow-y:auto}.PaymentModal .content{overflow:auto;width:100%;height:100%;position:relative}.PaymentModal .footer{position:relative;border-bottom-left-radius:10px;border-bottom-right-radius:10px;width:100%;padding:.75rem 1rem;background:var(--color-background);border-top:1px var(--color-borders) solid}.PaymentModal .footer button{text-transform:none;font-weight:500}.PaymentModal .modal-dialog{width:25rem}.PaymentModal .modal-content{padding:0;overflow:hidden}@media screen and (max-device-width: 640px) and (max-height: 640px) and (orientation: landscape){.PaymentModal .modal-dialog{max-height:100%}.PaymentModal .Transition{height:10rem}}\n"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/3.86fc6942f17ca54599b3.js b/dist/3.86fc6942f17ca54599b3.js deleted file mode 100644 index 19df9d2b..00000000 --- a/dist/3.86fc6942f17ca54599b3.js +++ /dev/null @@ -1,2 +0,0 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[3],{106:function(e,t,a){"use strict";a.r(t),a.d(t,"MediaViewer",(function(){return me})),a.d(t,"ForwardPicker",(function(){return Ce})),a.d(t,"Dialogs",(function(){return Ne})),a.d(t,"Notifications",(function(){return Se})),a.d(t,"SafeLinkModal",(function(){return Fe})),a.d(t,"HistoryCalendar",(function(){return Te})),a.d(t,"CalendarModal",(function(){return Re})),a.d(t,"DeleteMessageModal",(function(){return De})),a.d(t,"PinMessageModal",(function(){return Be})),a.d(t,"UnpinAllMessagesModal",(function(){return Ue})),a.d(t,"MessageSelectToolbar",(function(){return He})),a.d(t,"LeftSearch",(function(){return It})),a.d(t,"Settings",(function(){return mn})),a.d(t,"ContactList",(function(){return hn})),a.d(t,"NewChat",(function(){return On})),a.d(t,"NewChatStep1",(function(){return gn})),a.d(t,"NewChatStep2",(function(){return pn})),a.d(t,"ArchivedChats",(function(){return jn})),a.d(t,"ContextMenuContainer",(function(){return Ln})),a.d(t,"StickerSetModal",(function(){return An})),a.d(t,"HeaderMenuContainer",(function(){return Tn})),a.d(t,"MobileSearch",(function(){return Un})),a.d(t,"AttachmentModal",(function(){return Zn})),a.d(t,"PollModal",(function(){return Xn})),a.d(t,"SymbolMenu",(function(){return ks})),a.d(t,"AttachMenu",(function(){return Ns})),a.d(t,"MentionTooltip",(function(){return Yn})),a.d(t,"StickerTooltip",(function(){return ws})),a.d(t,"BotKeyboardMenu",(function(){return Ss})),a.d(t,"CustomSendMenu",(function(){return Is})),a.d(t,"DropArea",(function(){return Ps.b})),a.d(t,"TextFormatter",(function(){return Fs.a})),a.d(t,"EmojiTooltip",(function(){return Ls})),a.d(t,"InlineBotTooltip",(function(){return xs})),a.d(t,"RightSearch",(function(){return zs})),a.d(t,"StickerSearch",(function(){return $s})),a.d(t,"GifSearch",(function(){return Vs})),a.d(t,"PollResults",(function(){return Ks})),a.d(t,"Management",(function(){return ic})),a.d(t,"PaymentModal",(function(){return Rc})),a.d(t,"ReceiptModal",(function(){return Bc}));var n=a(0),s=a(1),c=a(8),r=a(13),o=a(2),l=a(6),i=a(54),d=a(118),m=a(7),u=a(4),h=a(3),b=a(137),g=a(49),p=a(185),v=a(31),O=a(110),E=a(123),j=a(200),f=a(29),C=a(37),y=a(151);function k(e,t,a,n,s,c){const{mediaEl:l}=P(t,c);if(!l)return;const{width:m}=i.a.get(),{width:u,height:h}=Object(d.l)(e,s),{width:b,height:g}=Object(d.f)(u,h,n.width,n.height),p=(m-b)/2,v=function(e){const t=window.matchMedia(d.c);let a=4.125;e&&(a+=t.matches?.875:3.375);return a*d.d}(e)+(h-g)/2;let{top:O,left:E,width:j,height:f}=l.getBoundingClientRect();if([r.h.SharedMedia,r.h.Album,r.h.ScheduledAlbum,r.h.SearchResult].includes(t)){const e=function(e,t,a,n,s,c){if(e===t){const r=Math.max(s,c)*(e/t);n-=(r-s)/2,a-=(r-c)/2,s=r,c=r}else if(e>t){const a=s;n-=((s=c*(e/t))-a)/2}else if(t>e){const n=c;a-=((c=s*(t/e))-n)/2}return{top:a,left:n,width:s,height:c}}(b,g,O,E,j,f);O=e.top,E=e.left,j=e.width,f=e.height}const C=E+j/2-(p+b/2),y=O+f/2-(v+g/2),k=j/b,N=f/g,S=w(a||l);I(S,{top:v+"px",left:p+"px",width:b+"px",height:g+"px",transform:`translate3d(${C}px, ${y}px, 0) scale(${k}, ${N})`}),F(S,t),document.body.classList.add("ghost-animating"),requestAnimationFrame(()=>{document.body.appendChild(S),requestAnimationFrame(()=>{S.style.transform="",function(e){e.firstChild.style.objectFit="default",e.classList.remove("rounded-corners","circle")}(S),setTimeout(()=>{requestAnimationFrame(()=>{document.body.contains(S)&&document.body.removeChild(S),document.body.classList.remove("ghost-animating")})},200+o.c)})})}function N(e,t,a){const{container:n,mediaEl:s}=P(e,a);if(!s)return;const c=document.getElementById("MediaViewer").querySelector(".active .media-viewer-content img, .active .media-viewer-content video");if(!c||!s)return;const{top:l,left:d,width:m,height:u}=c.getBoundingClientRect(),{top:h,left:b,width:g,height:p}=s.getBoundingClientRect();let v=h;if(!function(e){if("none"===e.style.display)return!1;const t=e.getBoundingClientRect(),{height:a}=i.a.get();return t.top<=a&&t.top+t.height>=0}(n)){const{height:e}=i.a.get();v=hf?j=f:f>j&&(f=j));const y=document.getElementsByClassName("ghost")[0],k=y||w(t||s,e===r.h.ProfileAvatar);y||I(k,{top:v+"px",left:b+"px",width:g+"px",height:p+"px",transform:`translate3d(${O}px, ${E}px, 0) scale(${j}, ${f})`}),requestAnimationFrame(()=>{if(y){const{top:e,left:t,width:a,height:n}=y.getBoundingClientRect();I(k,{transition:"none",top:v+"px",left:b+"px",transformOrigin:"top left",transform:`translate3d(${t-b}px, ${e-v}px, 0) scale(${a/g}, ${n/p})`,width:g+"px",height:p+"px"})}document.body.classList.add("ghost-animating"),y||document.body.appendChild(k),requestAnimationFrame(()=>{y&&(y.style.transition=""),k.style.transform="",C&&(k.style.opacity="0"),F(k,e),setTimeout(()=>{requestAnimationFrame(()=>{document.body.contains(k)&&document.body.removeChild(k),document.body.classList.remove("ghost-animating")})},200+o.c)})})}function w(e,t=!1){const a=document.createElement("div");a.classList.add("ghost");const n=new Image;if("string"==typeof e?n.src=e:e instanceof HTMLVideoElement?n.src=e.poster:n.src=e.src,a.appendChild(n),t){a.classList.add("ProfileInfo");const e=document.querySelector("#RightColumn .ProfileInfo .info");e&&a.appendChild(e.cloneNode(!0))}return a}function S(e,t){const a=document.querySelector(".active > .MessageList");let n=e.offsetTop+t.closest(".content-inner, .WebPage").offsetTop;return e.id.includes("album-media-")&&(n+=e.parentElement.offsetTop+e.closest(".Message").offsetTop),n>a.scrollTop&&n+t.offsetHeight{if(n&&t)return{sender:Object(u.ob)(t)?Object(m.Jb)(e,t):Object(m.g)(e,t)};if(!a||!t)return{};const s=Object(m.l)(e,t,a);return{message:s,sender:s&&Object(m.vb)(e,s)}},(e,t)=>Object(h.l)(t,["closeMediaViewer","focusMessage"]))(({chatId:e,messageId:t,sender:a,isAvatar:s,message:c,closeMediaViewer:r,focusMessage:o})=>{const l=Object(n.m)(()=>{r(),o({chatId:e,messageId:t})},[e,o,t,r]),i=Object(M.a)();if(!a||!c&&!s)return;const d=a.id<0,m=Object(u.X)(i,a);return n.a.createElement("div",{className:"SenderInfo",onClick:l},d?n.a.createElement(x.a,{key:a.id,size:"medium",chat:a}):n.a.createElement(x.a,{key:a.id,size:"medium",user:a}),n.a.createElement("div",{className:"meta"},n.a.createElement("div",{className:"title",dir:"auto"},m&&Object(U.a)(m)),n.a.createElement("div",{className:"date",dir:"auto"},s?i("lng_mediaview_profile_photo"):Object(B.d)(i,1e3*c.date))))}),z=a(188),q=a(63),_=a(43),H=a(124);a(268);var $=({mediaData:e,isVideo:t,isZoomed:a,message:s,fileName:c,isAvatar:r,onCloseMediaViewer:o,onForward:i,onZoomToggle:d})=>{const{isDownloadStarted:m,downloadProgress:h,handleDownloadClick:b}=Object(z.a)(s&&t?Object(u.E)(s,"download"):void 0,c),g=Object(M.a)(),p=Object(n.p)(()=>({onTrigger:e,isOpen:t})=>n.a.createElement(D.a,{round:!0,size:"smaller",color:"translucent",className:t?"active":void 0,onClick:e,ariaLabel:"More actions"},n.a.createElement("i",{className:"icon-more"})),[]);return l.l?n.a.createElement("div",{className:"MediaViewerActions-mobile"},n.a.createElement(q.a,{trigger:p,positionX:"right"},!r&&n.a.createElement(_.a,{icon:"forward",onClick:i},g("Forward")),t?n.a.createElement(_.a,{icon:m?"close":"download",onClick:b},m?Math.round(100*h)+"% Downloading...":"Download"):n.a.createElement(_.a,{icon:"download",href:e,download:c},g("AccActionDownload"))),m&&n.a.createElement(H.a,{progress:h,size:"s",noCross:!0})):n.a.createElement("div",{className:"MediaViewerActions"},!r&&n.a.createElement(n.a.Fragment,null,n.a.createElement(D.a,{round:!0,size:"smaller",color:"translucent-white",ariaLabel:g("Forward"),onClick:i},n.a.createElement("i",{className:"icon-forward"}))),t?n.a.createElement(D.a,{round:!0,size:"smaller",color:"translucent-white",ariaLabel:g("AccActionDownload"),onClick:b},m?n.a.createElement(H.a,{progress:h,size:"s",onClick:b}):n.a.createElement("i",{className:"icon-download"})):n.a.createElement(D.a,{href:e,download:c,round:!0,size:"smaller",color:"translucent-white",ariaLabel:g("AccActionDownload")},n.a.createElement("i",{className:"icon-download"})),n.a.createElement(D.a,{round:!0,size:"smaller",color:"translucent-white",ariaLabel:a?"Zoom Out":"Zoom In",onClick:d},n.a.createElement("i",{className:a?"icon-zoom-out":"icon-zoom-in"})),n.a.createElement(D.a,{round:!0,size:"smaller",color:"translucent-white",ariaLabel:g("Close"),onClick:o},n.a.createElement("i",{className:"icon-close"})))},V=a(10),W=a(9);a(269);var K=({text:e="",isHidden:t,isForVideo:a,onClick:s})=>{const[c,r]=Object(n.r)(!1);Object(n.n)(()=>{const e=document.querySelector(".MediaViewerFooter .media-text"),t=()=>{const t=e?e.clientHeight:0;r(t>2*d.d)};t();const a=Object(V.h)(t,500,!0);return window.addEventListener("resize",a,!1),()=>{window.removeEventListener("resize",a,!1)}},[]);const o=Object(W.a)("MediaViewerFooter",a&&"is-for-video",t&&"is-hidden");return n.a.createElement("div",{className:o,onClick:function(t){e&&t.stopPropagation()}},e&&n.a.createElement("div",{className:"media-viewer-footer-content",onClick:l.l?void 0:s},n.a.createElement("p",{className:"media-text custom-scroll "+(c?"multiline":""),dir:"auto"},e)))},Y=a(40),Q=a(141);const Z=function(){if(void 0!==document.fullscreenElement)return"fullscreenElement";if(void 0!==document.mozFullScreenElement)return"mozFullScreenElement";if(void 0!==document.webkitFullscreenElement)return"webkitFullscreenElement";return""}();var J=a(152),X=a(140);const ee=["bytes","kB","MB","GB","TB","PB"];var te=e=>{const t=0===e?0:Math.floor(Math.log(e)/Math.log(1024));return`${(e/1024**Math.floor(t)).toFixed(1)} ${ee[t]}`};a(270);const ae=e=>{e.stopPropagation()};var ne=({bufferedProgress:e,currentTime:t,duration:a,fileSize:s,isForceVisible:c,isForceMobileVersion:r,isPlayed:o,isFullscreenSupported:i,isFullscreen:d,onChangeFullscreen:m,onPlayPause:u,onSeek:h})=>{const[b,g]=Object(n.r)(!0);Object(n.n)(()=>{c&&g(c)},[c]),Object(n.n)(()=>{let e;return c||(l.l?g(!1):e=window.setTimeout(()=>{g(!1)},800)),()=>{e&&window.clearTimeout(e)}},[c]),Object(n.n)(()=>((b||c)&&document.body.classList.add("video-controls-visible"),()=>{document.body.classList.remove("video-controls-visible")}),[c,b]);const p=Object(M.a)();var v,O;if(b||c)return n.a.createElement("div",{className:"VideoPlayerControls "+(r?"mobile":""),onClick:ae},function(e,t,a,s){const c=e/t*100,r=100*a;return n.a.createElement("div",{className:"player-seekline"},n.a.createElement("div",{className:"player-seekline-track"},n.a.createElement("div",{className:"player-seekline-buffered",style:`width: ${r||0}%`}),n.a.createElement("div",{className:"player-seekline-played",style:`width: ${c||0}%`}),n.a.createElement("input",{min:"0",max:"100",step:.01,type:"range",onInput:s,className:"player-seekline-input",value:c||0})))}(t,a,e,h),n.a.createElement(D.a,{ariaLabel:p("AccActionPlay"),size:"tiny",ripple:!l.l,color:"translucent-white",className:"play",onClick:u},n.a.createElement("i",{className:o?"icon-pause":"icon-play"})),function(e,t){return n.a.createElement("div",{className:"player-time"},`${Object(B.e)(e)} / ${Object(B.e)(t)}`)}(t,a),e<1&&(v=e,O=s,n.a.createElement("div",{className:"player-file-size"},`${te(O*v)} / ${te(O)}`)),i&&n.a.createElement(D.a,{ariaLabel:"Fullscreen",size:"tiny",color:"translucent-white",className:"fullscreen",onClick:m},n.a.createElement("i",{className:""+(d?"icon-smallscreen":"icon-fullscreen")})))};a(271);function se(){return(se=Object.assign||function(e){for(var t=1;t{const m=Object(n.q)(null),[u,h]=Object(n.r)(!l.n||!l.e),[b,g]=Object(n.r)(0),[p,v]=Object(n.r)(!0),[O,E,j]=function(e,t){const[a,s]=Object(n.r)(Boolean(Z&&document[Z]));return Object(n.o)(()=>{const a=()=>{s(Boolean(Z&&document[Z]))},n=()=>{s(!0)},c=()=>{s(!1),t(!1)},r=e.current;return document.addEventListener("fullscreenchange",a,!1),document.addEventListener("webkitfullscreenchange",a,!1),document.addEventListener("mozfullscreenchange",a,!1),r&&(r.addEventListener("webkitbeginfullscreen",n,!1),r.addEventListener("webkitendfullscreen",c,!1)),()=>{document.removeEventListener("fullscreenchange",a,!1),document.removeEventListener("webkitfullscreenchange",a,!1),document.removeEventListener("mozfullscreenchange",a,!1),r&&(r.removeEventListener("webkitbeginfullscreen",n,!1),r.removeEventListener("webkitendfullscreen",c,!1))}},[]),Z||"iOS"===l.r?[a,()=>{e.current&&(Z||"iOS"===l.r)&&(e.current.requestFullscreen?e.current.requestFullscreen():e.current.webkitRequestFullscreen?e.current.webkitRequestFullscreen():e.current.webkitEnterFullscreen?e.current.webkitEnterFullscreen():e.current.mozRequestFullScreen&&e.current.mozRequestFullScreen(),s(!0))},()=>{e.current&&(document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitCancelFullScreen?document.webkitCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen(),s(!1))}]:[!1]}(m,h),{isBuffered:f,bufferedProgress:C,bufferingHandlers:y}=Object(Q.a)(),{shouldRender:k,transitionClassNames:N}=Object(Y.a)(!f,void 0,void 0,"slow"),{shouldRender:w,transitionClassNames:S}=Object(Y.a)(l.e&&!u&&!k,void 0,void 0,"slow");Object(n.n)(()=>{i||!o?m.current.pause():e&&!l.n&&Object(X.a)(m.current)},[i,o,e]),Object(n.n)(()=>{m.current.currentTime===m.current.duration?(g(0),h(!1)):g(m.current.currentTime)},[b]);const I=Object(n.m)(e=>{e.stopPropagation(),u?(m.current.pause(),h(!1)):(m.current.play(),h(!0))},[u]);Object(J.a)(m,[]);const P=Object(n.m)(()=>{v(!0)},[]),F=Object(n.m)(()=>{v(!1)},[]),M=Object(n.m)(e=>{g(e.currentTarget.currentTime)},[]),L=Object(n.m)(()=>{g(0),h(!1)},[]),A=Object(n.m)(()=>{O&&j?j():!O&&E&&E()},[j,O,E]),R=Object(n.m)(e=>{e.stopPropagation(),m.current.currentTime=Number(e.target.value)*m.current.duration/100},[]),T=Object(n.m)(e=>{e.stopPropagation(),v(!p)},[p]);Object(n.n)(()=>{const e=e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),I(e))};return document.addEventListener("keydown",e,!1),()=>{document.removeEventListener("keydown",e,!1)}},[I]);const B=s&&`width: ${s.width}px; height: ${s.height}px`,U=`background-image: url(${a})`;return n.a.createElement("div",{className:"VideoPlayer",onClick:!t&&l.l?T:void 0,onMouseOver:t?void 0:P,onMouseOut:t?void 0:F},n.a.createElement("div",{style:B},n.a.createElement("video",se({ref:m,autoPlay:l.n,playsInline:!0,loop:t,muted:t,id:"media-viewer-video",style:U,onEnded:L,onClick:l.l?void 0:I,onDoubleClick:A},y,{onTimeUpdate:M}),e&&n.a.createElement("source",{src:e}))),w&&n.a.createElement(D.a,{round:!0,className:"play-button "+S,onClick:I},n.a.createElement("i",{className:"icon-play"})),k&&n.a.createElement("div",{className:["spinner-container",N].join(" ")},!f&&n.a.createElement("div",{className:"buffering"},"Buffering..."),n.a.createElement(H.a,{size:"xl",progress:f?1:c,square:!0,onClick:d})),!t&&!k&&n.a.createElement(ne,{isPlayed:u,bufferedProgress:C,currentTime:b,isFullscreenSupported:Boolean(E),isFullscreen:O,fileSize:r,duration:m.current?m.current.duration:0,isForceVisible:!u||p,isForceMobileVersion:s&&s.width<400,onSeek:R,onChangeFullscreen:A,onPlayPause:I}))});a(272);var re=Object(n.h)(({isShown:e,onChangeZoom:t})=>{const{transitionClassNames:a}=Object(Y.a)(e),s=Object(f.a)(e),c=Object(n.q)(null),[r,o]=Object(n.r)(1),i=Object(n.q)(!1);Object(n.n)(()=>{e&&!s&&o(1.5)},[e,s]);const d=Object(n.m)(()=>{i.current=!0},[]),m=Object(n.m)(()=>{i.current=!1,1===r&&t(r,!i.current)},[t,r]);Object(n.n)(()=>{t(r,!i.current)},[r,t]);const u=Object(M.a)(),h=Object(W.a)("ZoomControls",a);return n.a.createElement("div",{className:h},n.a.createElement(D.a,{disabled:1===r,size:"tiny",color:"translucent-white",ariaLabel:u("ZoomOut"),className:"zoom-out",ripple:!l.l,onClick:()=>{c.current&&o(Math.max(1,r-.5))}},n.a.createElement("i",{className:"icon-zoom-out"})),n.a.createElement(D.a,{disabled:3===r,size:"tiny",color:"translucent-white",ariaLabel:"Zoom In",className:"zoom-in",ripple:!l.l,onClick:()=>{c.current&&o(Math.min(3,r+.5))}},n.a.createElement("i",{className:"icon-zoom-in"})),n.a.createElement("div",{className:"seekline"},n.a.createElement("div",{className:"seekline-track"},n.a.createElement("div",{className:"seekline-played",style:`width: ${50*(r-1)}%`}),n.a.createElement("input",{ref:c,min:1,max:3,step:"0.5",value:r,type:"range",className:"seekline-input",onChange:e=>{o(Math.min(3,Math.max(Number(e.target.value),1)))},onMouseDown:d,onMouseUp:m}))))});a(273);const oe=[1,0,0,1,0,0],le={1:1,1.5:1.5,2:2.2,2.5:3.3,3:5.5};var ie=Object(n.h)(({children:e,className:t,noWrap:a,canPan:s,zoomLevel:c,panDeltaX:r,panDeltaY:o,onPan:l})=>{const i=le[c]||c,[d,m]=Object(n.r)(!1),[u,b]=Object(n.r)({dx:r,dy:o,x:0,y:0}),[g,p]=Object(n.r)(oe),v=Object(n.q)(null),O=Object(n.q)(null);Object(n.n)(()=>{const e=i||g[0],t=r||g[4],a=o||g[5],n=[...g];g[0]!==e&&(n[0]=e||n[0],n[3]=e||n[3]),g[4]!==t&&(n[4]=t),g[5]!==a&&(n[5]=a),Object(h.a)(g,n)||p(function(e,t,a){const n=a&&a.querySelector(".active img");if(!a||!n)return t;const s=a.getBoundingClientRect(),c=n.getBoundingClientRect(),r=c.width/e*t[0],o=c.height/e*t[3],l=(s.width-r)/2+t[4],i=(s.height-o)/2+t[5];return s.width&&s.width-150{s||p(oe)},[s]),Object(n.n)(()=>{O.current&&(O.current.style.transform=`matrix(${g.toString()})`)},[a,g]);return a?e:n.a.createElement("div",{ref:v,className:"pan-wrapper "+(t||""),onMouseDown:e=>{if(!s)return;e.stopPropagation(),e.preventDefault();const t={dx:g[4],dy:g[5],x:e.pageX,y:e.pageY};b(t),m(!0),v.current&&v.current.classList.add("move")},onMouseUp:()=>{m(!1),v.current&&v.current.classList.remove("move"),l&&l(g[4],g[5])},onMouseMove:e=>{if(d){const t=function(e,t){const a=[...g],n=u.x-e,s=u.y-t;return a[4]=u.dx-n,a[5]=u.dy-s,a}(e.pageX,e.pageY);p(t),O.current&&(O.current.style.transform=`matrix(${g.toString()})`)}}},n.a.createElement("div",{ref:O,className:"pan-container"},e))});a(274);function de(e,t,a){return e?n.a.createElement("img",{src:e,alt:"",style:t?`width: ${t.width}px`:"",draggable:Boolean(a)}):n.a.createElement("div",{className:"spinner-wrapper",style:t?`width: ${t.width}px`:""},n.a.createElement(A.a,{color:"white"}))}var me=Object(n.h)(Object(s.h)(e=>{const{chatId:t,threadId:a,messageId:n,avatarOwnerId:s,profilePhotoIndex:c,origin:o}=e.mediaViewer,{animationLevel:l}=e.settings.byKey;if(o===r.h.SearchResult){if(!t||!n)return{animationLevel:l};const a=Object(m.l)(e,t,n);return a?{chatId:t,messageId:n,senderId:a.senderId,origin:o,message:a,animationLevel:l}:{animationLevel:l}}if(s){return{messageId:-1,senderId:s,avatarOwner:Object(m.Jb)(e,s)||Object(m.g)(e,s),profilePhotoIndex:c||0,animationLevel:l,origin:o}}if(!(t&&a&&n))return{animationLevel:l};let i,d,u;if(i=o&&[r.h.ScheduledAlbum,r.h.ScheduledInline].includes(o)?Object(m.rb)(e,t,n):Object(m.l)(e,t,n),!i)return{animationLevel:l};if(d=o&&[r.h.ScheduledAlbum,r.h.ScheduledInline].includes(o)?Object(m.sb)(e,t):Object(m.n)(e,t),o===r.h.Inline||o===r.h.Album)u=Object(m.hb)(e,t,a)||Object(m.Z)(e,t,a);else if(o===r.h.SharedMedia){const t=Object(m.w)(e),{foundIds:a}=t&&t.resultsByType&&t.resultsByType.media||{};u=a}return{chatId:t,threadId:a,messageId:n,senderId:i.senderId,origin:o,message:i,chatMessages:d,collectionIds:u,animationLevel:l}},(e,t)=>Object(h.l)(t,["openMediaViewer","closeMediaViewer","openForwardMenu","focusMessage"]))(({chatId:e,threadId:t,messageId:a,senderId:s,origin:m,avatarOwner:h,profilePhotoIndex:w,message:S,chatMessages:I,collectionIds:P,openMediaViewer:F,closeMediaViewer:A,openForwardMenu:B,focusMessage:U,animationLevel:x})=>{const z=Boolean(h||a),q=m===r.h.SharedMedia,_=m===r.h.SearchResult,H=S?Object(u.H)(S):void 0,V=S?Object(u.Q)(S):void 0,W=S?Object(u.S)(S):void 0,Y=S?Object(u.T)(S):void 0,Q=!!S&&Object(u.vb)(S),Z=!!S&&Object(u.wb)(S),J=Boolean(V||Y||Z),X=Boolean(!J&&(H||W||Q)),{isGif:ee}=V||Y||{},te=Boolean(h),ae=Boolean(W||Y),ne=Object(n.p)(()=>ae&&a?[a]:Object(u.h)(I||{},P||[],q),[ae,a,I,P,q]),se=a?ne.indexOf(a):-1,oe=0===se||-1===se,le=se===ne.length-1||-1===se,me=Object(n.q)(),ue=Object(f.a)(s);!z||ue&&ue===s&&me.current||(me.current=se);const he=x>=1?"mv-slide":"none",be=2===x?"slide-fade":"none",ge=2===x,[pe,ve]=Object(n.r)(!1),[Oe,Ee]=Object(n.r)(!1),[je,fe]=Object(n.r)(!1),[Ce,ye]=Object(n.r)(1),[ke,Ne]=Object(n.r)({x:0,y:0});function we(e){if(te&&void 0!==w){const{photos:t}=h;return t&&t[w]?`photo${t[w].id}?size=c`:Object(u.e)(h,e?"big":"normal")}return S&&Object(u.E)(S,e?"viewerFull":"viewerPreview")}const Se=Object(O.a)(S&&(q||_)&&Object(u.E)(S,"pictogram"),void 0,c.ApiMediaFormat.BlobUrl,void 0,ge&&350),Ie=we(),Pe=Object(O.a)(Ie,void 0,te&&Ie&&Ie.startsWith("profilePhoto")?c.ApiMediaFormat.DataUri:c.ApiMediaFormat.BlobUrl,void 0,ge&&350),{mediaData:Fe,downloadProgress:Me}=Object(E.a)(we(!0),void 0,S&&Object(u.D)(S,"viewerFull"),void 0,ge&&350),Le=H||V?(H||V).blobUrl:void 0;let Ae=!J&&(Le||Fe)||Pe||Se;const Re=Object(j.a)(!Ae&&S&&Object(u.F)(S));Ae||m===r.h.SearchResult||(Ae=Re);const Te=S?Object(u.A)(S):void 0,De=S?Object(u.z)(S):te?`avatar${h.id}-${w}.jpg`:void 0;let Be;S?Q||Z?Be=Object(u.y)(S).mediaSize:H||W?Be=Object(u.U)(H||W):(V||Y)&&(Be=Object(u.db)(V||Y)):Be=d.a,Object(n.n)(()=>{l.l&&document.body.classList.toggle("is-media-viewer-open",z)},[z]);const Ue=Object(v.a)();Object(n.n)(()=>{const e=window.matchMedia(d.c);return"function"==typeof e.addEventListener?e.addEventListener("change",Ue):"function"==typeof e.addListener&&e.addListener(Ue),()=>{"function"==typeof e.removeEventListener?e.removeEventListener("change",Ue):"function"==typeof e.removeListener&&e.removeListener(Ue)}},[Ue]);const xe=Object(f.a)(S),Ge=Object(f.a)(m),ze=Object(f.a)(h),qe=Object(f.a)(Ae);Object(n.n)(()=>{if(ge&&z&&!xe&&!ze){Object(C.d)(350+o.c);const e=S?Object(y.a)(S):void 0;k(Boolean(e),m,Ae,Be,J,S)}ge&&!z&&(xe||ze)&&(Object(C.d)(350+o.c),N(Ge,qe,xe||void 0))},[ge,z,m,Ge,S,xe,ze,Ae,qe,Be,J]),Object(n.n)(()=>{let e;return je?Ee(!0):e=window.setTimeout(()=>{Ee(!1)},350),()=>{e&&window.clearTimeout(e)}},[je]);const _e=()=>{fe(!1),ye(1),Ne({x:0,y:0})},He=Object(n.m)(()=>{fe(!je),ye(je?1:1.5),je&&Ne({x:0,y:0})},[je]),$e=Object(n.m)((e,t=!1)=>{ye(e),1===e&&t&&_e()},[]),Ve=Object(n.m)(()=>{A(),_e()},[A]),We=Object(n.m)(()=>{Ve(),U({chatId:e,threadId:t,messageId:a})},[Ve,e,t,U,a]),Ke=Object(n.m)(()=>{B({fromChatId:e,messageIds:[a]}),_e()},[B,e,a]);Object(n.n)(()=>z?Object(g.a)(()=>{je?_e():Ve()}):void 0,[Ve,z,je]),Object(n.n)(()=>{J&&!ee&&Object(p.b)()},[ee,J]),Object(n.n)(()=>{if(z)return i.a.disableRefresh(),()=>{i.a.enableRefresh()}},[z]);const Ye=Object(n.m)((e,t)=>{let a=ne.indexOf(e);return(-1===t&&a>0||1===t&&a{oe||F({chatId:e,threadId:t,messageId:a?Ye(a,-1):void 0,origin:m})},[e,t,Ye,oe,a,F,m]),Ze=Object(n.m)(()=>{le||F({chatId:e,threadId:t,messageId:a?Ye(a,1):void 0,origin:m})},[e,t,Ye,le,a,F,m]);Object(n.n)(()=>{const e=e=>{switch(e.key){case"Left":case"ArrowLeft":Qe();break;case"Right":case"ArrowRight":Ze()}};return document.addEventListener("keydown",e,!1),()=>{document.removeEventListener("keydown",e,!1)}}),Object(n.n)(()=>{const e=document.querySelector(".slide-container > .active, .slide-container > .to");if(!e)return;const t=ee&&!l.e;return Object(b.b)(e,{excludedClosestSelector:".backdrop, .navigation, .media-viewer-head, .media-viewer-footer"+(t?"":", .VideoPlayer"),onClick:()=>{je||l.n||Ve()},onSwipe:l.n?(e,t)=>{t===b.a.Right?Qe():t===b.a.Left?Ze():e.target&&e.target.closest(".MediaViewerFooter")||Ve()}:void 0})},[Ve,pe,ee,X,je,Ze,Qe]);const Je=Object(n.m)((e,t)=>{Ne({x:e,y:t})},[]),Xe=Object(n.m)(()=>{l.n&&(X||ee)&&ve(!pe)},[pe,ee,X]),et=Object(M.a)();function tt(t){if(te)return n.a.createElement("div",{key:e,className:"media-viewer-content"},de(Fe||Pe,Object(d.h)(d.a,!1),!l.l&&!je));if(S){const e=Object(y.a)(S),s=Boolean(e);return n.a.createElement("div",{key:a,className:"media-viewer-content "+(s?"has-footer":""),onClick:Xe},X&&de(Le||Fe||Pe||Se,S&&Object(d.h)(Be,s),!l.l&&!je),J&&n.a.createElement(ce,{key:a,url:Le||Fe,isGif:ee,posterData:Ae,posterSize:S&&Object(d.h)(Be,s,!0),downloadProgress:Me,fileSize:Te,isMediaViewerOpen:z,noPlay:!t,onClose:Ve}),e&&n.a.createElement(K,{text:e,onClick:We,isHidden:pe&&(!J||ee),isForVideo:J&&!ee}))}}function at(){return te?n.a.createElement(G,{key:h.id,chatId:h.id,isAvatar:!0}):n.a.createElement(G,{key:a,chatId:e,messageId:a})}return Object(L.a)(z,A,F,{chatId:e,threadId:t,messageId:a,origin:m,avatarOwnerId:h&&h.id}),n.a.createElement(R.a,{id:"MediaViewer",className:je?"zoomed":"",isOpen:z},()=>n.a.createElement(n.a.Fragment,null,n.a.createElement("div",{className:"media-viewer-head",dir:et.isRtl?"rtl":void 0},l.l&&n.a.createElement(D.a,{className:"media-viewer-close",round:!0,size:"smaller",color:"translucent-white",ariaLabel:et("Close"),onClick:Ve},n.a.createElement("i",{className:"icon-close"})),n.a.createElement(T.a,{activeKey:me.current,name:be},at),n.a.createElement($,{mediaData:Fe||Pe,isVideo:J,isZoomed:je,message:S,fileName:De,onCloseMediaViewer:Ve,onForward:Ke,onZoomToggle:He,isAvatar:te})),n.a.createElement(ie,{noWrap:!Oe,canPan:je,panDeltaX:ke.x,panDeltaY:ke.y,zoomLevel:Ce,onPan:Je},n.a.createElement(T.a,{className:"slide-container",activeKey:se,name:he},tt)),!oe&&n.a.createElement("button",{type:"button",className:"navigation prev "+(J&&!ee&&"inline"),"aria-label":et("AccDescrPrevious"),dir:et.isRtl?"rtl":void 0,onClick:Qe}),!le&&n.a.createElement("button",{type:"button",className:"navigation next "+(J&&!ee&&"inline"),"aria-label":et("Next"),dir:et.isRtl?"rtl":void 0,onClick:Ze}),n.a.createElement(re,{isShown:je,onChangeZoom:$e})))})),ue=a(53),he=a(133),be=a(64),ge=a(20),pe=a(112),ve=a(47),Oe=a(115),Ee=a(108),je=a(111),fe=a(130);a(275);var Ce=Object(n.h)(Object(s.h)(e=>{const{chats:{byId:t,listIds:a,orderedPinnedIds:n},currentUserId:s}=e;return{chatsById:t,pinnedIds:n.active,activeListIds:a.active,archivedListIds:a.archived,currentUserId:s}},(e,t)=>Object(h.l)(t,["setForwardChatId","exitForwardMode","loadMoreChats"]))(({chatsById:e,pinnedIds:t,activeListIds:a,archivedListIds:s,currentUserId:r,isOpen:o,setForwardChatId:i,exitForwardMode:d,loadMoreChats:m})=>{const[b,g]=Object(n.r)(""),p=Object(n.q)(null),v=Object(M.a)();Object(n.n)(()=>{o?l.l||setTimeout(()=>{requestAnimationFrame(()=>{p.current&&p.current.focus()})},500):(p.current&&p.current.blur(),setTimeout(()=>{g("")},300))},[o]);const O=Object(n.p)(()=>{const n=[...a||[],...s||[]];let o=t||[];return r&&(o=Object(h.o)([r,...o])),Object(u.Ib)([...n.filter(t=>{const a=e[t];return!a||!!Object(u.d)(a,c.MAIN_THREAD_ID)&&(!b||Object(ue.a)(Object(u.k)(v,e[t],void 0,t===r),b))})],e,void 0,o)},[a,s,e,r,b,v,t]),[E,j]=Object(he.a)(m,O,Boolean(b)),f=Object(n.m)(e=>{g(e.currentTarget.value)},[]),C=Object(n.q)(null),y=Object(be.a)(C,o,e=>{E&&E.length>0&&i({id:E[-1===e?0:e]})},".ListItem-button",!0),k=n.a.createElement("div",{className:"modal-header",dir:v.isRtl?"rtl":void 0},n.a.createElement(D.a,{round:!0,color:"translucent",size:"smaller",ariaLabel:v("Close"),onClick:d},n.a.createElement("i",{className:"icon-close"})),n.a.createElement(ve.a,{ref:p,value:b,onChange:f,onKeyDown:y,placeholder:v("ForwardTo")}));return n.a.createElement(pe.a,{isOpen:o,onClose:d,className:"ForwardPicker",header:k},E&&E.length?n.a.createElement(Oe.a,{className:"picker-list custom-scroll",items:E,onLoadMore:j,noScrollRestore:Boolean(b),ref:C,onKeyDown:y},E.map(e=>n.a.createElement(Ee.a,{key:e,className:"chat-item-clickable force-rounded-corners",onClick:()=>i({id:e})},Object(u.ob)(e)?n.a.createElement(je.a,{status:e===r?v("SavedMessagesInfo"):void 0,userId:e}):n.a.createElement(fe.a,{chatId:e})))):E&&!E.length?n.a.createElement("p",{className:"no-results"},"Sorry, nothing found."):n.a.createElement(ge.a,null))})),ye=a(177);a(276);function ke(e){return e.isSlowMode?"Slowmode enabled":e.hasErrorKey?"Something went wrong":"Telegram"}var Ne=Object(n.h)(Object(s.h)(e=>Object(h.l)(e,["dialogs"]),(e,t)=>Object(h.l)(t,["dismissDialog","acceptInviteConfirmation"]))(({dialogs:e,dismissDialog:t,acceptInviteConfirmation:a})=>{const s=Object(M.a)();if(!e.length)return;return n.a.createElement("div",{id:"Dialogs"},e.map(e=>{return"hash"in e?(e=>{const{hash:c,title:r,participantsCount:o,isChannel:l}=e,i=s(l?"Subscribers":"Members",o,"i"),d=s(l?"ChannelJoin":"JoinGroup");return n.a.createElement(pe.a,{isOpen:!0,onClose:t,className:"error",title:r},void 0!==o&&n.a.createElement("p",null,i),n.a.createElement(D.a,{isText:!0,className:"confirm-dialog-button",onClick:()=>{a({hash:c}),t()}},d),n.a.createElement(D.a,{isText:!0,className:"confirm-dialog-button",onClick:t},s("Cancel")))})(e):(c=e,n.a.createElement(pe.a,{isOpen:!0,onClose:t,className:"error",title:ke(c)},c.hasErrorKey?Object(ye.a)(c):Object(U.a)(c.message,["emoji","br"]),n.a.createElement("div",null,n.a.createElement(D.a,{isText:!0,onClick:t},s("OK")))));var c}))})),we=a(189);var Se=Object(n.h)(Object(s.h)(e=>Object(h.l)(e,["notifications"]),(e,t)=>Object(h.l)(t,["dismissNotification"]))(({notifications:e,dismissNotification:t})=>{if(e.length)return n.a.createElement("div",{id:"Notifications"},e.map(({message:e})=>n.a.createElement(we.a,{message:Object(U.a)(e,["emoji","br","links","simple_markdown"]),onDismiss:t})))})),Ie=a(139),Pe=a(120);var Fe=Object(n.h)(Object(s.h)(void 0,(e,t)=>Object(h.l)(t,["toggleSafeLinkModal"]))(({url:e,toggleSafeLinkModal:t})=>{const a=Object(M.a)(),s=Object(n.m)(()=>{window.open(e),t({url:void 0})},[t,e]),c=Object(n.m)(()=>{t({url:void 0})},[t]),r=Object(Ie.a)(e);return n.a.createElement(Pe.a,{isOpen:Boolean(e),onClose:c,title:a("OpenUrlTitle"),textParts:Object(U.a)(a("OpenUrlAlert2",r),["links"]),confirmLabel:a("OpenUrlTitle"),confirmHandler:s})}));a(277);const Me=["lng_weekday1","lng_weekday2","lng_weekday3","lng_weekday4","lng_weekday5","lng_weekday6","lng_weekday7"];function Le(e,t,a,n,s){const c=new Date(e,t,a,0,0,0,0),r=n&&new Date(n.getFullYear(),n.getMonth(),n.getDate(),0,0,0,0),o=s&&new Date(s.getFullYear(),s.getMonth(),s.getDate(),0,0,0,0);return!!(o&&c>o)||!!(r&&c{const u=Object(M.a)(),h=new Date,b=Object(n.p)(()=>e?new Date(e):new Date,[e]),g=t?new Date(t):void 0,p=Object(f.a)(c),[v,O]=Object(n.r)(b),[E,j]=Object(n.r)(Ae(b.getHours())),[C,y]=Object(n.r)(Ae(b.getMinutes())),k=v.getFullYear(),N=v.getMonth(),w=v.getDate();Object(n.n)(()=>{!p&&c&&O(b)},[c,b,p]);const S=s&&k>=h.getFullYear()&&N>=h.getMonth()||g&&k>=g.getFullYear()&&N>=g.getMonth(),I=a&&k<=h.getFullYear()&&N<=h.getMonth(),P=Object(n.p)(()=>function(e,t){const a=[],n=new Date;n.setFullYear(e),n.setMonth(t),n.setDate(1);const s=n.getDay()||7;for(let e=1;e{const t=e.target.value.replace(/[^\d]+/g,"");if(!t.length)return j(""),void(e.target.value="");const a=Math.max(0,Math.min(Number(t),23)),n=new Date(v.getTime());n.setHours(a),O(n);const s=Ae(a);j(s),e.target.value=s},[v]),L=Object(n.m)(e=>{const t=e.target.value.replace(/[^\d]+/g,"");if(!t.length)return y(""),void(e.target.value="");const a=Math.max(0,Math.min(Number(t),59)),n=new Date(v.getTime());n.setMinutes(a),O(n);const s=Ae(a);y(s),e.target.value=s},[v]);return n.a.createElement(pe.a,{isOpen:c,onClose:i,className:"CalendarModal"},n.a.createElement("div",{className:"container"},n.a.createElement("div",{className:"month-selector"},n.a.createElement(D.a,{round:!0,size:"smaller",color:"translucent",onClick:i},n.a.createElement("i",{className:"icon-close"})),n.a.createElement("h4",null,u("lng_month"+(v.getMonth()+1))," ",v.getFullYear()),n.a.createElement(D.a,{round:!0,size:"smaller",color:"translucent",disabled:I,onClick:I?void 0:function(){O(e=>{const t=new Date(e);return t.setMonth(t.getMonth()-1),t})}},n.a.createElement("i",{className:"icon-previous"})),n.a.createElement(D.a,{round:!0,size:"smaller",color:"translucent",disabled:S,onClick:S?void 0:function(){O(e=>{const t=new Date(e);return t.setMonth(t.getMonth()+1),t})}},n.a.createElement("i",{className:"icon-next"})))),n.a.createElement("div",{className:"calendar-wrapper"},n.a.createElement("div",{className:"calendar-grid"},Me.map(e=>n.a.createElement("div",{className:"day-button faded weekday"},n.a.createElement("span",null,u(e)))),P.map(e=>n.a.createElement("div",{role:"button",tabIndex:0,onClick:()=>{return t=e,void O(e=>{const a=new Date(e);return a.setDate(t),a});var t},className:Object(W.a)("day-button",Le(k,N,e,a?h:void 0,s?h:g)?"disabled":""+(e?"clickable":""),e===w&&"selected")},!!e&&n.a.createElement("span",null,e))))),r&&n.a.createElement("div",{className:"timepicker"},n.a.createElement("input",{type:"text",className:"form-control",inputMode:"decimal",value:E,onChange:F}),":",n.a.createElement("input",{type:"text",className:"form-control",inputMode:"decimal",value:C,onChange:L})),n.a.createElement("div",{className:"footer"},n.a.createElement(D.a,{onClick:function(){d(v)}},r?function(e,t){const a=Object(B.a)(t,e.code),n=Object(B.a)(new Date,e.code);if(a===n)return e("Conversation.ScheduleMessage.SendToday",Object(B.h)(t));return e("Conversation.ScheduleMessage.SendOn",[a,Object(B.h)(t)])}(u,v):o),l&&n.a.createElement(D.a,{onClick:m,isText:!0},l)))});var Te=Object(n.h)(Object(s.h)(e=>({selectedAt:e.historyCalendarSelectedAt}),(e,t)=>Object(h.l)(t,["searchMessagesByDate","closeHistoryCalendar"]))(({isOpen:e,selectedAt:t,searchMessagesByDate:a,closeHistoryCalendar:s})=>{const c=Object(n.m)(e=>{a({timestamp:e.valueOf()/1e3}),s()},[s,a]),r=Object(M.a)();return n.a.createElement(Re,{isOpen:e,selectedAt:t,isPastMode:!0,submitButtonLabel:r("JumpToDate"),onClose:s,onSubmit:c})}));var De=Object(n.h)(Object(s.h)((e,{message:t,isSchedule:a})=>{const{threadId:n}=Object(m.z)(e)||{},{canDeleteForAll:s}=n&&Object(m.b)(e,t,n)||{},c=Object(m.g)(e,t.chatId);return{canDeleteForAll:!a&&s,contactName:c&&Object(u.ob)(c.id)?Object(u.ab)(Object(m.Jb)(e,Object(u.W)(c))):void 0,willDeleteForCurrentUserOnly:c&&Object(u.lb)(c)&&!s,willDeleteForAll:c&&Object(u.qb)(c)}},(e,t)=>Object(h.l)(t,["deleteMessages","deleteScheduledMessages"]))(({isOpen:e,isSchedule:t,message:a,album:s,canDeleteForAll:c,contactName:r,willDeleteForCurrentUserOnly:o,willDeleteForAll:l,onClose:i,deleteMessages:d,deleteScheduledMessages:m})=>{const u=Object(n.m)(()=>{const e=s&&s.messages?s.messages.map(({id:e})=>e):[a.id];d({messageIds:e,shouldDeleteForAll:!0}),i()},[d,a.id,i,s]),h=Object(n.m)(()=>{const e=s&&s.messages?s.messages.map(({id:e})=>e):[a.id];t?m({messageIds:e}):d({messageIds:e,shouldDeleteForAll:!1}),i()},[s,a.id,t,i,m,d]),b=Object(M.a)();return n.a.createElement(pe.a,{isOpen:e,onClose:i,onEnter:e&&!c?h:void 0,className:"delete",title:b("DeleteSingleMessagesTitle")},n.a.createElement("p",null,b("AreYouSureDeleteSingleMessage")),o&&n.a.createElement("p",null,b("lng_delete_for_me_chat_hint",1,"i")),l&&n.a.createElement("p",null,b("lng_delete_for_everyone_hint",1,"i")),c&&n.a.createElement(D.a,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:u},r&&Object(U.a)(b("Conversation.DeleteMessagesFor",r)),!r&&b("Conversation.DeleteMessagesForEveryone")),n.a.createElement(D.a,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:h},b(c?"ChatList.DeleteForCurrentUser":"Delete")),n.a.createElement(D.a,{className:"confirm-dialog-button",isText:!0,onClick:i},b("Cancel")))}));var Be=Object(n.h)(Object(s.h)((e,{chatId:t})=>{const a=Object(u.ob)(t),n=Object(m.P)(e,t),s=Object(m.g)(e,t),c=!!s&&Object(u.mb)(s),r=!!s&&Object(u.lb)(s),o=!!s&&Object(u.qb)(s);return{isPrivateChat:a,isChatWithSelf:n,isChannel:c,isGroup:r,isSuperGroup:o,canPinForAll:a&&!n||o||r,contactName:s&&Object(u.ob)(s.id)?Object(u.ab)(Object(m.Jb)(e,Object(u.W)(s))):void 0}},(e,t)=>Object(h.l)(t,["pinMessage"]))(({isOpen:e,messageId:t,chatId:a,isChannel:s,isGroup:c,isSuperGroup:r,canPinForAll:o,contactName:l,onClose:i,pinMessage:d})=>{const m=Object(n.m)(()=>{d({chatId:a,messageId:t,isUnpin:!1}),i()},[d,a,t,i]),u=Object(n.m)(()=>{d({chatId:a,messageId:t,isUnpin:!1,isOneSide:!0,isSilent:!0}),i()},[a,t,i,d]),h=Object(M.a)();return n.a.createElement(pe.a,{isOpen:e,onClose:i,className:"pin",title:h("PinMessageAlertTitle")},n.a.createElement("p",null,h(s?"PinMessageAlertChannel":c||r?"PinMessageAlert":"PinMessageAlertChat")),n.a.createElement(D.a,{className:"confirm-dialog-button",isText:!0,onClick:u},h("DialogPin")),o&&n.a.createElement(D.a,{className:"confirm-dialog-button",isText:!0,onClick:m},l?Object(U.a)(h("Conversation.PinMessagesFor",l)):h("Conversation.PinMessageAlert.PinAndNotifyMembers")),n.a.createElement(D.a,{className:"confirm-dialog-button",isText:!0,onClick:i},h("Cancel")))}));var Ue=Object(n.h)(({isOpen:e,pinnedMessagesCount:t=0,onClose:a,onUnpin:s})=>{const c=Object(M.a)();return n.a.createElement(pe.a,{isOpen:e,onClose:a,className:"unpin-all",title:c("Chat.PanelUnpinAllMessages")},n.a.createElement("p",null,c("Chat.UnpinAllMessagesConfirmation",t,"i")),n.a.createElement(D.a,{className:"confirm-dialog-button",isText:!0,onClick:s},c("DialogUnpin")),n.a.createElement(D.a,{className:"confirm-dialog-button",isText:!0,onClick:a},c("Cancel")))}),xe=a(25),Ge=a(56);var ze=Object(n.h)(Object(s.h)((e,{isSchedule:t})=>{const{messageIds:a}=e.selectedMessages||{},{canDeleteForAll:n}=Object(m.e)(e),s=Object(m.s)(e);return{selectedMessageIds:a,canDeleteForAll:!t&&n,contactName:s&&Object(u.ob)(s.id)?Object(u.ab)(Object(m.Jb)(e,Object(u.W)(s))):void 0,willDeleteForCurrentUserOnly:s&&Object(u.lb)(s)&&!n,willDeleteForAll:s&&Object(u.qb)(s)}},(e,t)=>Object(h.l)(t,["deleteMessages","deleteScheduledMessages","exitMessageSelectMode"]))(({isOpen:e,isSchedule:t,selectedMessageIds:a,canDeleteForAll:s,contactName:c,willDeleteForCurrentUserOnly:r,willDeleteForAll:o,onClose:l,deleteMessages:i,deleteScheduledMessages:d,exitMessageSelectMode:m})=>{const u=Object(f.a)(e),h=Object(n.m)(()=>{l(),i({messageIds:a,shouldDeleteForAll:!0})},[i,a,l]),b=Object(n.m)(()=>{t?d({messageIds:a}):i({messageIds:a,shouldDeleteForAll:!1}),l()},[t,l,d,a,i]),g=Object(M.a)();if(Object(n.n)(()=>{!e&&u&&m()},[m,e,u]),a)return n.a.createElement(pe.a,{isOpen:e,onClose:l,onEnter:s?void 0:b,className:"delete",title:g("Conversation.DeleteManyMessages")},n.a.createElement("p",null,g("AreYouSureDeleteFewMessages")),r&&n.a.createElement("p",null,"This will delete them just for you, not for other participants in the chat."),o&&n.a.createElement("p",null,"This will delete them for everyone in this chat."),s&&n.a.createElement(D.a,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:h},c?Object(U.a)(g("ChatList.DeleteForEveryone",c)):g("Conversation.DeleteMessagesForEveryone")),n.a.createElement(D.a,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:b},g(s?"ChatList.DeleteForCurrentUser":"Delete")),n.a.createElement(D.a,{className:"confirm-dialog-button",isText:!0,onClick:l},g("Cancel")))})),qe=a(126);var _e=Object(n.h)(Object(s.h)(void 0,(e,t)=>Object(h.l)(t,["reportMessages","exitMessageSelectMode"]))(({isOpen:e,messageIds:t,reportMessages:a,exitMessageSelectMode:s,onClose:c})=>{const[r,o]=Object(n.r)("spam"),[l,i]=Object(n.r)(""),d=()=>{a({messageIds:t,reason:r,description:l}),s(),c()},m=Object(n.m)(e=>{o(e)},[]),u=Object(n.m)(e=>{i(e.target.value)},[]),h=Object(M.a)(),b=[{value:"spam",label:h("lng_report_reason_spam")},{value:"violence",label:h("lng_report_reason_violence")},{value:"pornography",label:h("lng_report_reason_pornography")},{value:"childAbuse",label:h("lng_report_reason_child_abuse")},{value:"copyright",label:h("ReportPeer.ReasonCopyright")},{value:"other",label:h("lng_report_reason_other")}];if(t)return n.a.createElement(pe.a,{isOpen:e,onClose:c,onEnter:e?d:void 0,className:"report",title:h("lng_report_message_title")},n.a.createElement(qe.a,{name:"report-message",options:b,onChange:m,selected:r}),n.a.createElement(ve.a,{label:h("lng_report_reason_description"),value:l,onChange:u}),n.a.createElement(D.a,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:d},h("lng_report_button")),n.a.createElement(D.a,{className:"confirm-dialog-button",isText:!0,onClick:c},h("Cancel")))}));a(278);var He=Object(n.h)(Object(s.h)(e=>{const{type:t}=Object(m.z)(e)||{},{canDelete:a}=Object(m.e)(e),n=Object(m.f)(e),{messageIds:s}=e.selectedMessages||{};return{isSchedule:"scheduled"===t,selectedMessagesCount:Object(m.ub)(e),canDeleteMessages:a,canReportMessages:n,selectedMessageIds:s}},(e,t)=>Object(h.l)(t,["exitMessageSelectMode","openForwardMenuForSelectedMessages"]))(({canPost:e,isActive:t,messageListType:a,isSchedule:s,selectedMessagesCount:c,canDeleteMessages:r,canReportMessages:o,selectedMessageIds:l,exitMessageSelectMode:i,openForwardMenuForSelectedMessages:d})=>{const[m,u,h]=Object(xe.a)(),[b,g,p]=Object(xe.a)();Object(n.n)(()=>!t||m||b?void 0:Object(Ge.a)({onBackspace:u,onDelete:u,onEsc:i}),[t,m,b,u,i]);const v=Object(f.a)(c||void 0,!0),O=t?c:v,E=Object(M.a)(),j=E("VoiceOver.Chat.MessagesSelected",O),C=Object(W.a)("MessageSelectToolbar",e&&"with-composer",t&&"shown");return n.a.createElement("div",{className:C},n.a.createElement("div",{className:"MessageSelectToolbar-inner"},n.a.createElement(D.a,{color:"translucent",round:!0,onClick:i,ariaLabel:"Exit select mode"},n.a.createElement("i",{className:"icon-close"})),n.a.createElement("span",{className:"MessageSelectToolbar-count",title:j},j),!!c&&n.a.createElement("div",{className:"MessageSelectToolbar-actions"},"scheduled"!==a&&n.a.createElement(_.a,{icon:"forward",ariaLabel:"Forward Messages",onClick:d},n.a.createElement("span",{className:"item-text"},E("Forward"))),o&&n.a.createElement(_.a,{icon:"flag",onClick:g,disabled:!o,ariaLabel:E("Conversation.ReportMessages")},n.a.createElement("span",{className:"item-text"},E("Report"))),n.a.createElement(_.a,{destructive:!0,icon:"delete",onClick:u,disabled:!r,ariaLabel:E("EditAdminGroupDeleteMessages")},n.a.createElement("span",{className:"item-text"},E("Delete"))))),n.a.createElement(ze,{isOpen:m,isSchedule:s,onClose:h}),n.a.createElement(_e,{isOpen:b,onClose:p,messageIds:l}))})),$e=a(176),Ve=a(51),We=a(179),Ke=e=>{const t=Object(n.q)(null),a=Object(n.m)(a=>{if("Enter"!==a.key)return;t.current===document.activeElement&&e()},[e]);return Object(n.n)(()=>(window.addEventListener("keydown",a,!1),()=>window.removeEventListener("keydown",a)),[a]),t},Ye=a(162);var Qe=Object(n.h)(Object(s.h)((e,{chatId:t})=>{const a=Object(m.g)(e,t),n=a&&Object(u.W)(a);return{chat:a,privateChatUser:n?Object(m.Jb)(e,n):void 0,isPinned:Object(m.N)(e,t),isMuted:a?Object(u.Hb)(a,Object(m.fb)(e),Object(m.eb)(e)):void 0}})(({chatId:e,chat:t,privateChatUser:a,isPinned:s,isMuted:c,withUsername:r,onClick:o})=>{const[l,i,d]=Object(xe.a)(),m=Object(We.a)({chat:t,privateChatUser:a,isPinned:s,isMuted:c,handleDelete:i}),h=()=>{o(e)},b=Ke(h);if(t)return n.a.createElement(Ee.a,{className:"chat-item-clickable search-result",onClick:h,contextActions:m,buttonRef:b},Object(u.ob)(e)?n.a.createElement(je.a,{userId:e,withUsername:r,avatarSize:"large"}):n.a.createElement(fe.a,{chatId:e,withUsername:r,avatarSize:"large"}),n.a.createElement(Ye.a,{isOpen:l,onClose:d,chat:t}))})),Ze=a(148);a(279);const Je=Object(V.h)(e=>e(),6e4,!0);var Xe=Object(n.h)(Object(s.h)(e=>{const{userIds:t}=e.topPeers,a=e.users.byId,{recentlyFoundChatIds:n}=e.globalSearch;return{topUserIds:t,usersById:a,recentlyFoundChatIds:n}},(e,t)=>Object(h.l)(t,["loadTopUsers","loadContactList","openChat","addRecentlyFoundChatId","clearRecentlyFoundChats"]))(({topUserIds:e,usersById:t,recentlyFoundChatIds:a,onReset:s,loadTopUsers:c,loadContactList:r,openChat:o,addRecentlyFoundChatId:l,clearRecentlyFoundChats:i})=>{const d=Object(n.q)(null);Object(n.n)(()=>{Je(()=>{c(),r()})},[c,r]),Object(Ze.a)(d.current,!e);const m=Object(n.m)(e=>{o({id:e,shouldReplaceHistory:!0}),s(),setTimeout(()=>{l({id:e})},250)},[o,l,s]),h=Object(M.a)();return n.a.createElement("div",{className:"RecentContacts custom-scroll"},e&&n.a.createElement("div",{className:"top-peers-section",dir:h.isRtl?"rtl":void 0},n.a.createElement("div",{ref:d,className:"top-peers no-selection"},e.map(e=>n.a.createElement("div",{className:"top-peer-item",onClick:()=>m(e),dir:h.isRtl?"rtl":void 0},n.a.createElement(x.a,{user:t[e]}),n.a.createElement("div",{className:"top-peer-name"},Object(U.a)(Object(u.ab)(t[e])||" ")))))),a&&n.a.createElement("div",{className:"search-section pt-1"},n.a.createElement("h3",{className:"section-heading mt-0 recent-chats-header",dir:h.isRtl?"rtl":void 0},h("Recent"),n.a.createElement(D.a,{round:!0,size:"smaller",color:"translucent",ariaLabel:"Clear recent chats",onClick:i,isRtl:h.isRtl},n.a.createElement("i",{className:"icon-close"}))),a.map(e=>n.a.createElement(Qe,{chatId:e,onClick:m}))))})),et=a(138),tt=a(32);a(280);var at=Object(n.h)(Object(s.h)((e,{chatId:t})=>{const a=Object(m.g)(e,t);if(!a)return{};const n=Object(u.W)(a);return{chat:a,lastSyncTime:e.lastSyncTime,...n&&{privateChatUser:Object(m.Jb)(e,n)}}},(e,t)=>Object(h.l)(t,["focusMessage"]))(({message:e,searchQuery:t,chatId:a,chat:s,privateChatUser:c,focusMessage:r,lastSyncTime:o})=>{const i=Object(u.F)(e),d=Object(O.a)(Object(u.E)(e,"micro")),m=Boolean(Object(u.J)(e)),h=Object(n.m)(()=>{r({chatId:a,messageId:e.id})},[a,r,e.id]),b=Object(M.a)(),g=Ke(h);if(s)return n.a.createElement(Ee.a,{className:"ChatMessage chat-item-clickable",ripple:!l.l,onClick:h,buttonRef:g},n.a.createElement(x.a,{chat:s,user:c,withOnlineStatus:!0,isSavedMessages:c&&c.isSelf,lastSyncTime:o}),n.a.createElement("div",{className:"info"},n.a.createElement("div",{className:"info-row"},n.a.createElement("div",{className:"title"},n.a.createElement("h3",{dir:"auto"},Object(U.a)(Object(u.k)(b,s,c))),s.isVerified&&n.a.createElement(et.a,null)),n.a.createElement("div",{className:"message-date"},n.a.createElement(tt.a,{className:"date"},Object(B.g)(b,1e3*e.date)))),n.a.createElement("div",{className:"subtitle"},n.a.createElement("div",{className:"message",dir:"auto"},function(e,t,a,s,c){if(!a)return Object(U.a)(Object(u.O)(e,t));return n.a.createElement("span",{className:"media-preview"},n.a.createElement("img",{src:a,alt:"",className:c?"round":void 0}),Object(u.Q)(t)&&n.a.createElement("i",{className:"icon-play"}),Object(U.a)(Object(u.O)(e,t,!0),["emoji","highlight"],{highlight:s}))}(b,e,d||i,t,m)))))}));a(281);var nt=Object(n.h)(({searchDate:e,onSelect:t})=>{const a=Object(n.p)(()=>function(e){if(e.match(/^\d{2,4}-\d{2}-\d{2}$/g)){const t=new Date(e);return[{date:t,text:Object(B.a)(t)}]}const t=[],a=new Date,n=a.getFullYear(),s=a.getTime()>new Date(`${n}-${e}`).getTime()?n:n-1;for(let a=0;a<8;a++){const n=new Date(`${s-a}-${e}`);t.push({date:n,text:Object(B.a)(n)})}return t}(e),[e]);return n.a.createElement("section",{className:"DateSuggest custom-scroll custom-scroll-x"},a.map(({date:e,text:a})=>n.a.createElement("div",{onClick:()=>t(e),className:"date-item",key:a},n.a.createElement("i",{className:"icon-calendar"}),n.a.createElement("span",null,a))))}),st=a(121),ct=a(146);const rt=Object(V.h)(e=>e(),500,!0);var ot=Object(n.h)(Object(s.h)(e=>{const{byId:t}=e.chats,{byId:a}=e.users,{userIds:n}=e.contactList||{};if(!n)return{chatsById:t,usersById:a};const{currentUserId:s,messages:c,lastSyncTime:r}=e,{fetchingStatus:o,globalResults:l,localResults:i,resultsByType:d}=e.globalSearch,{chatIds:m,userIds:u}=l||{},{chatIds:h,userIds:b}=i||{},{byChatId:g}=c,{foundIds:p}=d&&d.text||{};return{currentUserId:s,localContactIds:n,localChatIds:h,localUserIds:b,globalChatIds:m,globalUserIds:u,foundIds:p,globalMessagesByChatId:g,chatsById:t,usersById:a,fetchingStatus:o,lastSyncTime:r}},(e,t)=>Object(h.l)(t,["openChat","addRecentlyFoundChatId","searchMessagesGlobal","setGlobalSearchChatId"]))(({searchQuery:e,searchDate:t,dateSearchQuery:a,currentUserId:s,localContactIds:c,localChatIds:o,localUserIds:i,globalChatIds:d,globalUserIds:m,foundIds:b,globalMessagesByChatId:g,chatsById:p,usersById:v,fetchingStatus:O,lastSyncTime:E,onReset:j,onSearchDateSelect:f,openChat:C,addRecentlyFoundChatId:y,searchMessagesGlobal:k,setGlobalSearchChatId:N})=>{const w=Object(M.a)(),[S,I]=Object(n.r)(!1),[P,F]=Object(n.r)(!1),L=Object(n.m)(({direction:t})=>{E&&t===r.e.Backwards&&rt(()=>{k({type:"text",query:e})})},[E,k,e]),A=Object(n.m)(e=>{C({id:e,shouldReplaceHistory:!0}),e!==s&&y({id:e}),l.l||j()},[s,C,y,j]),R=Object(n.m)(e=>{N({id:e})},[N]),T=Object(n.p)(()=>{if(!e||e.startsWith("@")&&e.length<2)return Ve.a;const t=c?c.filter(t=>{const a=v[t];if(!a)return!1;const n=Object(u.bb)(a);return n&&Object(ue.a)(n,e)||Object(ue.a)(a.username,e)}):[];return[...s&&Object(ue.a)(w("SavedMessages"),e)?[s]:[],...Object(u.Ib)(Object(h.o)([...t,...o||[],...i||[]]),p)]},[e,c,s,w,o,i,p,v]),D=Object(n.p)(()=>!e||e.length<4||!d||!m?Ve.a:Object(u.Ib)(Object(h.o)([...d,...m]),p,!0),[p,d,m,e]),B=Object(n.p)(()=>(e||t)&&b&&0!==b.length?b.map(e=>{const[t,a]=e.split("_").map(Number);return g&&g[t]&&g[t].byId[a]}).filter(Boolean).sort((e,t)=>t.date-e.date):Ve.a,[b,g,e,t]),U=Object(n.m)(()=>{I(!S)},[S]),x=Object(n.m)(()=>{F(!P)},[P]);const G=O&&!O.chats&&!O.messages&&!T.length&&!D.length&&!B.length;return e||t?n.a.createElement(Oe.a,{className:"LeftSearch custom-scroll",items:B,onLoadMore:L,noScrollRestoreOnTop:!0,noFastList:!0},a&&n.a.createElement("div",{className:"chat-selection no-selection no-scrollbar"},n.a.createElement(nt,{searchDate:a,onSelect:f})),G&&n.a.createElement(st.a,{text:w("ChatList.Search.NoResults"),description:w("ChatList.Search.NoResultsDescription")}),!!T.length&&n.a.createElement("div",{className:"chat-selection no-selection no-scrollbar",dir:w.isRtl?"rtl":void 0},T.map(e=>n.a.createElement(ct.a,{chatOrUserId:e,onClick:R,clickArg:e}))),!!T.length&&n.a.createElement("div",{className:"search-section"},n.a.createElement("h3",{className:"section-heading",dir:w.isRtl?"auto":void 0},T.length>3&&n.a.createElement(tt.a,{onClick:U},w(S?"ChatList.Search.ShowLess":"ChatList.Search.ShowMore")),w("DialogList.SearchSectionDialogs")),T.map((e,t)=>{if(S||!(t>=3))return n.a.createElement(Qe,{chatId:e,onClick:A})})),!!D.length&&n.a.createElement("div",{className:"search-section"},n.a.createElement("h3",{className:"section-heading",dir:w.isRtl?"auto":void 0},D.length>3&&n.a.createElement(tt.a,{onClick:x},w(P?"ChatList.Search.ShowLess":"ChatList.Search.ShowMore")),w("DialogList.SearchSectionGlobal")),D.map((e,t)=>{if(P||!(t>=3))return n.a.createElement(Qe,{chatId:e,withUsername:!0,onClick:A})})),!!B.length&&n.a.createElement("div",{className:"search-section"},n.a.createElement("h3",{className:"section-heading",dir:w.isRtl?"auto":void 0},w("SearchMessages")),B.map((function(t){const a=Object(u.O)(w,t),s=p[t.chatId];if(a&&s)return n.a.createElement(at,{chatId:t.chatId,message:t,searchQuery:e})})))):n.a.createElement(Xe,{onReset:j})}));const lt=Object(V.h)(e=>e(),500,!0);var it=Object(n.h)(Object(s.h)(e=>{const{byId:t}=e.chats,{currentUserId:a,messages:{byChatId:n},lastSyncTime:s}=e,{fetchingStatus:c,resultsByType:r}=e.globalSearch,{foundIds:o}=r&&r.text||{};return{currentUserId:a,foundIds:o,globalMessagesByChatId:n,chatsById:t,fetchingStatus:c,lastSyncTime:s}},(e,t)=>Object(h.l)(t,["searchMessagesGlobal"]))(({searchQuery:e,currentUserId:t,dateSearchQuery:a,foundIds:s,globalMessagesByChatId:c,chatsById:o,fetchingStatus:l,lastSyncTime:i,searchMessagesGlobal:d,onSearchDateSelect:m})=>{const h=Object(M.a)(),b=Object(n.m)(({direction:a})=>{i&&a===r.e.Backwards&<(()=>{d({type:"text",query:e,chatId:t})})},[t,i,d,e]),g=Object(n.p)(()=>s&&0!==s.length?s.map(e=>{const[t,a]=e.split("_").map(Number);return c&&c[t]&&c[t].byId[a]}).filter(Boolean).sort((e,t)=>t.date-e.date):Ve.a,[s,c]);const p=l&&!l.chats&&!l.messages&&!g.length;return n.a.createElement("div",{className:"LeftSearch"},n.a.createElement(Oe.a,{className:"search-content custom-scroll chat-list",items:g,onLoadMore:b,noFastList:!0},a&&n.a.createElement("div",{className:"chat-selection no-selection no-scrollbar"},n.a.createElement(nt,{searchDate:a,onSelect:m})),p&&n.a.createElement(st.a,{text:h("ChatList.Search.NoResults"),description:h("ChatList.Search.NoResultsDescription")}),!!g.length&&g.map((function(t){const a=Object(u.O)(h,t),s=o[t.chatId];if(a&&s)return n.a.createElement(at,{chatId:t.chatId,message:t,searchQuery:e})}))))}));function dt(e){return(t,a)=>{const{byId:n}=t.chats,{byId:s}=t.users,{fetchingStatus:c,resultsByType:r,chatId:o}=t.globalSearch,l="audio"!==e?e:a&&a.isVoice?"voice":"audio",{byChatId:i}=t.messages,{foundIds:d}=r&&r[l]||{};return{theme:Object(m.Db)(t),isLoading:void 0===d||!!c&&Boolean(c.chats||c.messages),chatsById:n,usersById:s,globalMessagesByChatId:i,foundIds:d,searchChatId:o,lastSyncTime:t.lastSyncTime}}}var mt=a(122),ut=a(172);const ht=Object(V.h)(e=>e(),500,!0);var bt=Object(n.h)(Object(s.h)(dt("media"),(e,t)=>Object(h.l)(t,["searchMessagesGlobal","openMediaViewer"]))(({searchQuery:e,searchChatId:t,isLoading:a,globalMessagesByChatId:s,foundIds:c,lastSyncTime:l,searchMessagesGlobal:i,openMediaViewer:d})=>{const m=Object(M.a)(),u=Object(n.m)(({direction:a})=>{l&&a===r.e.Backwards&&ht(()=>{i({type:"media",query:e,chatId:t})})},[l,i,e,t]),h=Object(n.p)(()=>c&&s?c.map(e=>{const[t,a]=e.split("_").map(Number);return s[t]&&s[t].byId[a]}).filter(Boolean):Ve.a,[s,c]),b=Object(n.m)((e,t)=>{d({chatId:t,messageId:e,origin:r.h.SearchResult})},[d]);const g=Object(mt.a)([e],o.Bb)&&!a,p=g&&c&&c.length>0&&!e,v=g&&c&&c.length>0&&e,O=Object(W.a)("search-content custom-scroll",v&&"chat-list");return n.a.createElement("div",{className:"LeftSearch"},n.a.createElement(Oe.a,{className:O,items:h,itemSelector:e?".ListItem":".Media",onLoadMore:u,noFastList:!0},!g&&n.a.createElement(ge.a,null),g&&(!c||0===c.length)&&n.a.createElement(st.a,{text:m("ChatList.Search.NoResults"),description:m("ChatList.Search.NoResultsDescription")}),p&&n.a.createElement("div",{className:"media-list",dir:m.isRtl?"rtl":void 0},h.map(e=>n.a.createElement(ut.a,{key:e.id,idPrefix:"search-media",message:e,onClick:b}))),v&&h.map(e=>n.a.createElement(at,{key:e.id,chatId:e.chatId,message:e}))))}));function gt(e,t,a,n){const{senderId:s}=t;if(!s)return;const c=Object(u.ob)(s)?n[s]:a[s];let r=Object(u.X)(e,c);const o=a[t.chatId];return o&&(Object(u.ob)(s)&&c.isSelf?r=`${e("FromYou")} → ${Object(u.k)(e,o)}`:Object(u.nb)(o)&&(r+=" → "+Object(u.k)(e,o))),r}var pt=a(194);const vt=Object(V.h)(e=>e(),500,!0);var Ot=Object(n.h)(Object(s.h)(dt("links"),(e,t)=>Object(h.l)(t,["searchMessagesGlobal","focusMessage"]))(({searchQuery:e,searchChatId:t,isLoading:a,chatsById:s,usersById:c,globalMessagesByChatId:l,foundIds:i,lastSyncTime:d,searchMessagesGlobal:m,focusMessage:u})=>{const h=Object(M.a)(),b=Object(n.m)(({direction:a})=>{d&&a===r.e.Backwards&&vt(()=>{m({type:"links",query:e,chatId:t})})},[d,m,e,t]),g=Object(n.p)(()=>i&&l?i.map(e=>{const[t,a]=e.split("_").map(Number);return l[t]&&l[t].byId[a]}).filter(Boolean):Ve.a,[l,i]),p=Object(n.m)((e,t)=>{u({chatId:t,messageId:e})},[u]);const v=Object(mt.a)([e],o.Bb)&&!a;return n.a.createElement("div",{className:"LeftSearch"},n.a.createElement(Oe.a,{className:"search-content documents-list custom-scroll",items:g,onLoadMore:b,noFastList:!0},!v&&n.a.createElement(ge.a,null),v&&(!i||0===i.length)&&n.a.createElement(st.a,{text:h("ChatList.Search.NoResults"),description:h("ChatList.Search.NoResultsDescription")}),v&&i&&i.length>0&&g.map((e,t)=>{const a=0===t||Object(B.n)(e.date)!==Object(B.n)(g[t-1].date);return n.a.createElement("div",{className:"ListItem",dir:h.isRtl?"rtl":void 0,key:e.id},a&&n.a.createElement("p",{className:"section-heading",dir:h.isRtl?"rtl":void 0},Object(B.f)(h,new Date(1e3*e.date))),n.a.createElement(pt.a,{key:e.id,message:e,senderTitle:gt(h,e,s,c),onMessageClick:p}))})))})),Et=a(166);const jt=Object(V.h)(e=>e(),500,!0);var ft=Object(n.h)(Object(s.h)(dt("documents"),(e,t)=>Object(h.l)(t,["searchMessagesGlobal","focusMessage"]))(({searchQuery:e,searchChatId:t,isLoading:a,chatsById:s,usersById:c,globalMessagesByChatId:l,foundIds:i,lastSyncTime:d,searchMessagesGlobal:m,focusMessage:h})=>{const b=Object(M.a)(),g=Object(n.m)(({direction:a})=>{d&&a===r.e.Backwards&&jt(()=>{m({type:"documents",query:e,chatId:t})})},[d,m,e,t]),p=Object(n.p)(()=>i&&l?i.map(e=>{const[t,a]=e.split("_").map(Number),n=l[t]&&l[t].byId[a];return n&&Object(u.y)(n)?n:void 0}).filter(Boolean):Ve.a,[l,i]),v=Object(n.m)((e,t)=>{h({chatId:t,messageId:e})},[h]);const O=Object(mt.a)([e],o.Bb)&&!a;return n.a.createElement("div",{className:"LeftSearch"},n.a.createElement(Oe.a,{className:"search-content documents-list custom-scroll",items:p,onLoadMore:g,noFastList:!0},!O&&n.a.createElement(ge.a,null),O&&(!i||0===i.length)&&n.a.createElement(st.a,{text:b("ChatList.Search.NoResults"),description:b("ChatList.Search.NoResultsDescription")}),O&&i&&i.length>0&&p.map((e,t)=>{const a=0===t||Object(B.n)(e.date)!==Object(B.n)(p[t-1].date);return n.a.createElement("div",{className:"ListItem",key:e.id},a&&n.a.createElement("p",{className:"section-heading"},Object(B.f)(b,new Date(1e3*e.date))),n.a.createElement(Et.a,{message:e,withDate:!0,datetime:e.date,smaller:!0,sender:gt(b,e,s,c),className:"scroll-item",onDateClick:v}))})))})),Ct=a(175);const yt=Object(V.h)(e=>e(),500,!0);var kt=Object(n.h)(Object(s.h)(dt("audio"),(e,t)=>Object(h.l)(t,["searchMessagesGlobal","focusMessage","openAudioPlayer"]))(({theme:e,isVoice:t,searchQuery:a,searchChatId:s,isLoading:c,chatsById:l,usersById:i,globalMessagesByChatId:d,foundIds:m,lastSyncTime:u,searchMessagesGlobal:h,focusMessage:b,openAudioPlayer:g})=>{const p=Object(M.a)(),v=t?"voice":"audio",O=Object(n.m)(({direction:e})=>{u&&e===r.e.Backwards&&yt(()=>{h({type:v,query:a,chatId:s})})},[v,u,h,a,s]),E=Object(n.p)(()=>m&&d?m.map(e=>{const[t,a]=e.split("_").map(Number);return d[t]&&d[t].byId[a]}).filter(Boolean):Ve.a,[d,m]),j=Object(n.m)((e,t)=>{b({chatId:t,messageId:e})},[b]),f=Object(n.m)((e,t)=>{g({chatId:t,messageId:e})},[g]);const C=Object(mt.a)([a],o.Bb)&&!c;return n.a.createElement("div",{className:"LeftSearch"},n.a.createElement(Oe.a,{className:"search-content documents-list custom-scroll",items:E,onLoadMore:O,noFastList:!0},!C&&n.a.createElement(ge.a,null),C&&(!m||0===m.length)&&n.a.createElement(st.a,{text:p("ChatList.Search.NoResults"),description:p("ChatList.Search.NoResultsDescription")}),C&&m&&m.length>0&&E.map((t,a)=>{const s=0===a||Object(B.n)(t.date)!==Object(B.n)(E[a-1].date);return n.a.createElement("div",{className:"ListItem",key:t.id},s&&n.a.createElement("p",{className:"section-heading",dir:p.isRtl?"rtl":void 0},Object(B.f)(p,new Date(1e3*t.date))),n.a.createElement(Ct.a,{key:t.id,theme:e,message:t,target:"searchResult",senderTitle:gt(p,t,l,i),date:t.date,lastSyncTime:u,className:"scroll-item",onPlay:f,onDateClick:j}))})))}));a(282);const Nt=[{type:r.c.ChatList,title:"SearchAllChatsShort"},{type:r.c.Media,title:"SharedMediaTab2"},{type:r.c.Links,title:"SharedLinksTab2"},{type:r.c.Files,title:"SharedFilesTab2"},{type:r.c.Music,title:"SharedMusicTab2"},{type:r.c.Voice,title:"SharedVoiceTab2"}],wt=[{type:r.c.ChatList,title:"All Messages"},...Nt.slice(1)],St=Object.keys(r.c).length/2;var It=Object(n.h)(Object(s.h)(e=>{const{currentContent:t,chatId:a}=e.globalSearch;return{currentContent:t,chatId:a}},(e,t)=>Object(h.l)(t,["setGlobalSearchContent","setGlobalSearchDate"]))(({searchQuery:e,searchDate:t,isActive:a,currentContent:s=r.c.ChatList,chatId:c,setGlobalSearchContent:o,setGlobalSearchDate:l,onReset:i})=>{const d=Object(M.a)(),[m,u]=Object(n.r)(s),h=Object(n.p)(()=>Object(B.l)(e),[e]),b=Object(n.m)(e=>{const t=Nt[e];o({content:t.type}),u(e)},[o]),g=Object(n.m)(e=>{l({date:e.getTime()/1e3})},[l]);Object(L.a)(a,i,void 0,void 0,!0);const p=Object(n.q)(null),v=Object(be.a)(p,a,void 0,".ListItem-button",!0);return n.a.createElement("div",{className:"LeftSearch",ref:p,onKeyDown:v},n.a.createElement($e.a,{activeTab:m,tabs:c?wt:Nt,onSwitchTab:b}),n.a.createElement(T.a,{name:d.isRtl?"slide-reversed":"slide",renderCount:St,activeKey:s},()=>{switch(s){case r.c.ChatList:return c?n.a.createElement(it,{searchQuery:e,dateSearchQuery:h,onReset:i,onSearchDateSelect:g}):n.a.createElement(ot,{searchQuery:e,searchDate:t,dateSearchQuery:h,onReset:i,onSearchDateSelect:g});case r.c.Media:return n.a.createElement(bt,{searchQuery:e});case r.c.Links:return n.a.createElement(Ot,{searchQuery:e});case r.c.Files:return n.a.createElement(ft,{searchQuery:e});case r.c.Music:return n.a.createElement(kt,{key:"audio",searchQuery:e});case r.c.Voice:return n.a.createElement(kt,{key:"voice",isVoice:!0,searchQuery:e});default:return}}))})),Pt=a(158);const Ft={currentPassword:"",password:"",hint:"",email:""},Mt=(e,t)=>{switch(t.type){case"setCurrentPassword":return{...e,currentPassword:t.payload};case"setPassword":return{...e,password:t.payload};case"setHint":return{...e,hint:t.payload};case"setEmail":return{...e,email:t.payload};case"reset":return Ft;default:return e}};var Lt=Object(n.h)(Object(s.h)(void 0,(e,t)=>Object(h.l)(t,["signOut","deleteChatFolder"]))(({currentScreen:e,editedFolderId:t,onReset:a,onSaveFilter:s,signOut:c,deleteChatFolder:o})=>{const[i,d]=Object(n.r)(!1),[m,u]=Object(n.r)(!1),h=Object(n.m)(()=>{d(!0)},[]),b=Object(n.m)(()=>{d(!1)},[]),g=Object(n.m)(()=>{u(!0)},[]),p=Object(n.m)(()=>{u(!1)},[]),v=Object(n.m)(()=>{b(),c()},[b,c]),O=Object(n.m)(()=>{p(),o({id:t}),a()},[t,p,o,a]),E=Object(n.p)(()=>({onTrigger:e,isOpen:t})=>n.a.createElement(D.a,{round:!0,ripple:!l.l,size:"smaller",color:"translucent",className:t?"active":"",onClick:e,ariaLabel:"More actions"},n.a.createElement("i",{className:"icon-more"})),[]),j=Object(M.a)();return n.a.createElement("div",{className:"left-header"},n.a.createElement(D.a,{round:!0,size:"smaller",color:"translucent",onClick:a,ariaLabel:j("AccDescrGoBack")},n.a.createElement("i",{className:"icon-arrow-left"})),function(){switch(e){case r.n.EditProfile:return n.a.createElement("h3",null,j("lng_settings_information"));case r.n.General:return n.a.createElement("h3",null,j("General"));case r.n.Notifications:return n.a.createElement("h3",null,j("Notifications"));case r.n.Privacy:return n.a.createElement("h3",null,j("PrivacySettings"));case r.n.Language:return n.a.createElement("h3",null,j("Language"));case r.n.GeneralChatBackground:return n.a.createElement("h3",null,j("ChatBackground"));case r.n.GeneralChatBackgroundColor:return n.a.createElement("h3",null,j("SetColor"));case r.n.PrivacyPhoneNumber:return n.a.createElement("h3",null,j("PrivacyPhone"));case r.n.PrivacyLastSeen:return n.a.createElement("h3",null,j("PrivacyLastSeen"));case r.n.PrivacyProfilePhoto:return n.a.createElement("h3",null,j("Privacy.ProfilePhoto"));case r.n.PrivacyForwarding:return n.a.createElement("h3",null,j("PrivacyForwards"));case r.n.PrivacyGroupChats:return n.a.createElement("h3",null,j("AutodownloadGroupChats"));case r.n.PrivacyPhoneNumberAllowedContacts:case r.n.PrivacyLastSeenAllowedContacts:case r.n.PrivacyProfilePhotoAllowedContacts:case r.n.PrivacyForwardingAllowedContacts:case r.n.PrivacyGroupChatsAllowedContacts:return n.a.createElement("h3",null,j("AlwaysShareWith"));case r.n.PrivacyPhoneNumberDeniedContacts:case r.n.PrivacyLastSeenDeniedContacts:case r.n.PrivacyProfilePhotoDeniedContacts:case r.n.PrivacyForwardingDeniedContacts:case r.n.PrivacyGroupChatsDeniedContacts:return n.a.createElement("h3",null,j("NeverShareWith"));case r.n.PrivacyActiveSessions:return n.a.createElement("h3",null,j("SessionsTitle"));case r.n.PrivacyBlockedUsers:return n.a.createElement("h3",null,j("BlockedUsers"));case r.n.TwoFaDisabled:case r.n.TwoFaEnabled:return n.a.createElement("h3",null,j("TwoStepVerification"));case r.n.TwoFaNewPassword:case r.n.TwoFaChangePasswordNew:case r.n.TwoFaChangePasswordConfirm:return n.a.createElement("h3",null,j("PleaseEnterCurrentPassword"));case r.n.TwoFaNewPasswordConfirm:return n.a.createElement("h3",null,j("PleaseReEnterPassword"));case r.n.TwoFaNewPasswordHint:case r.n.TwoFaChangePasswordHint:return n.a.createElement("h3",null,j("PasswordHint"));case r.n.TwoFaNewPasswordEmail:case r.n.TwoFaRecoveryEmail:return n.a.createElement("h3",null,j("RecoveryEmailTitle"));case r.n.TwoFaNewPasswordEmailCode:case r.n.TwoFaRecoveryEmailCode:return n.a.createElement("h3",null,"Recovery Email Code");case r.n.TwoFaCongratulations:return n.a.createElement("h3",null,j("TwoStepVerificationPasswordSet"));case r.n.TwoFaChangePasswordCurrent:case r.n.TwoFaTurnOff:case r.n.TwoFaRecoveryEmailCurrentPassword:return n.a.createElement("h3",null,j("PleaseEnterCurrentPassword"));case r.n.Folders:return n.a.createElement("h3",null,j("Filters"));case r.n.FoldersCreateFolder:return n.a.createElement("h3",null,j("FilterNew"));case r.n.FoldersEditFolder:case r.n.FoldersEditFolderFromChatList:return n.a.createElement("div",{className:"settings-main-header"},n.a.createElement("h3",null,j("FilterEdit")),t&&n.a.createElement(q.a,{className:"settings-more-menu",trigger:E,positionX:"right"},n.a.createElement(_.a,{icon:"delete",destructive:!0,onClick:g},j("Delete"))));case r.n.FoldersIncludedChats:case r.n.FoldersIncludedChatsFromChatList:case r.n.FoldersExcludedChats:case r.n.FoldersExcludedChatsFromChatList:return n.a.createElement("div",{className:"settings-main-header"},e===r.n.FoldersIncludedChats||e===r.n.FoldersIncludedChatsFromChatList?n.a.createElement("h3",null,j("FilterInclude")):n.a.createElement("h3",null,j("FilterExclude")),n.a.createElement(D.a,{round:!0,size:"smaller",color:"translucent",className:"color-primary",onClick:s,ariaLabel:j("AutoDeleteConfirm")},n.a.createElement("i",{className:"icon-check"})));default:return n.a.createElement("div",{className:"settings-main-header"},n.a.createElement("h3",null,j("SETTINGS")),n.a.createElement(q.a,{className:"settings-more-menu",trigger:E,positionX:"right"},n.a.createElement(_.a,{icon:"logout",onClick:h},j("LogOutTitle"))))}}(),n.a.createElement(Pe.a,{isOpen:i,onClose:b,text:j("lng_sure_logout"),confirmLabel:j("AccountSettings.Logout"),confirmHandler:v,confirmIsDestructive:!0}),n.a.createElement(Pe.a,{isOpen:m,onClose:p,text:j("FilterDeleteAlert"),confirmLabel:j("Delete"),confirmHandler:O,confirmIsDestructive:!0}))})),At=a(23);var Rt=Object(n.h)(Object(s.h)(e=>{const{currentUserId:t}=e;return{currentUser:t?Object(m.Jb)(e,t):void 0}})(({isActive:e,onScreenSelect:t,onReset:a,currentUser:s})=>{const c=Object(M.a)(),o=Object(u.bb)(s);return Object(L.a)(e,a,t,r.n.Main),n.a.createElement("div",{className:"settings-content custom-scroll"},n.a.createElement("div",{className:"settings-main-menu"},s&&n.a.createElement("div",{className:"settings-current-user"},n.a.createElement(x.a,{user:s,size:"jumbo"}),n.a.createElement("p",{className:"name"},o&&Object(U.a)(o)),n.a.createElement("p",{className:"phone"},Object(At.c)(s.phoneNumber))),n.a.createElement(Ee.a,{icon:"edit",onClick:()=>t(r.n.EditProfile)},c("lng_settings_information")),n.a.createElement(Ee.a,{icon:"folder",onClick:()=>t(r.n.Folders)},c("Filters")),n.a.createElement(Ee.a,{icon:"settings",onClick:()=>t(r.n.General)},c("Telegram.GeneralSettingsViewController")),n.a.createElement(Ee.a,{icon:"unmute",onClick:()=>t(r.n.Notifications)},c("Notifications")),n.a.createElement(Ee.a,{icon:"lock",onClick:()=>t(r.n.Privacy)},c("PrivacySettings")),n.a.createElement(Ee.a,{icon:"language",onClick:()=>t(r.n.Language)},c("Language"))))})),Tt=a(136),Dt=a(116);const Bt=/https:\/\/t\.me\/?/i,Ut=/^([a-zA-Z0-9_]+)$/,xt=Object(V.a)(e=>e(),250,!1);var Gt=Object(n.h)(({currentUsername:e,asLink:t,isLoading:a,isUsernameAvailable:s,checkUsername:c,onChange:r})=>{const[o,l]=Object(n.r)(e||""),i=Object(M.a)(),d=t?"SetUrl":"Username",m=i(t?"SetUrlPlaceholder":"Username"),[u,h]=Object(n.p)(()=>o.length?o.length<5?[void 0,m+" is too short"]:o.length>32?[void 0,m+" is too long"]:Ut.test(o)?void 0===s?[]:[s?i(d+"Available","Username"):void 0,!1===s?i(d+"InUse"):void 0]:[void 0,m+" contains invalid characters"]:[],[o,s,i,d,m]);Object(n.n)(()=>{l(e||"")},[t,e]);const b=Object(n.m)(e=>{const a=e.target.value.trim().replace(Bt,"");l(a),e.target.value=`${t?"https://t.me/":""}${a}`;const n=function(e){return e.length>=5&&e.length<=32&&Ut.test(e)}(a);n&&xt(()=>{c({username:a})}),r&&r(!!n&&a)},[t,c,r]);return n.a.createElement(ve.a,{value:`${t?"https://t.me/":""}${o}`,onChange:b,label:m,error:h,success:u,readOnly:a})});const zt=Object(V.h)(e=>e(),6e4,!0);var qt=Object(n.h)(Object(s.h)(e=>{const{currentUserId:t}=e,{progress:a,isUsernameAvailable:n}=e.profileEdit||{},s=t?Object(m.Jb)(e,t):void 0;if(!s)return{progress:a,isUsernameAvailable:n};const{firstName:c,lastName:r,username:o,fullInfo:l}=s,{bio:i}=l||{};return{currentAvatarHash:Object(u.e)(s),currentFirstName:c,currentLastName:r,currentBio:i,currentUsername:o,progress:a,isUsernameAvailable:n}},(e,t)=>Object(h.l)(t,["loadCurrentUser","updateProfile","checkUsername"]))(({isActive:e,onScreenSelect:t,onReset:a,currentAvatarHash:s,currentFirstName:o,currentLastName:l,currentBio:i,currentUsername:d,progress:m,isUsernameAvailable:u,loadCurrentUser:h,updateProfile:b,checkUsername:g})=>{const p=Object(M.a)(),[v,E]=Object(n.r)(!1),[j,f]=Object(n.r)(!1),[C,y]=Object(n.r)(),[k,N]=Object(n.r)(),[w,S]=Object(n.r)(o||""),[I,P]=Object(n.r)(l||""),[F,R]=Object(n.r)(i||""),[T,D]=Object(n.r)(d||""),B=Object(O.a)(s,!1,c.ApiMediaFormat.BlobUrl),x=m===r.k.InProgress,G=!1===T,z=Object(n.p)(()=>!G&&(Boolean(k)||j||!0===u),[k,j,G,u]);Object(L.a)(e,a,t,r.n.EditProfile),Object(n.n)(()=>{zt(()=>{h()})},[h]),Object(n.n)(()=>{N(void 0)},[B]),Object(n.n)(()=>{S(o||""),P(l||""),R(i||"")},[o,l,i]),Object(n.n)(()=>{D(d||"")},[d]),Object(n.n)(()=>{m===r.k.Complete&&(f(!1),E(!1),y(void 0))},[m]);const q=Object(n.m)(e=>{N(e)},[]),_=Object(n.m)(e=>{S(e.target.value),f(!0)},[]),H=Object(n.m)(e=>{P(e.target.value),f(!0)},[]),$=Object(n.m)(e=>{R(e.target.value),f(!0)},[]),V=Object(n.m)(e=>{D(e),E(!0)},[]),W=Object(n.m)(()=>{const e=w.trim(),t=I.trim(),a=F.trim();e.length?a.length>70?y("Bio can' be longer than 70 characters"):b({photo:k,...j&&{firstName:e,lastName:t,bio:a},...v&&{username:T}}):y("Please provide your first name")},[k,w,I,F,j,T,v,b]);return n.a.createElement("div",{className:"settings-fab-wrapper"},n.a.createElement("div",{className:"settings-content custom-scroll"},n.a.createElement("div",{className:"settings-edit-profile"},n.a.createElement(Tt.a,{currentAvatarBlobUrl:B,onChange:q,title:"Edit your profile photo",disabled:x}),n.a.createElement(ve.a,{value:w,onChange:_,label:p("FirstName"),disabled:x,error:"Please provide your first name"===C?C:void 0}),n.a.createElement(ve.a,{value:I,onChange:H,label:p("LastName"),disabled:x}),n.a.createElement(ve.a,{value:F,onChange:$,label:p("UserBio"),disabled:x,error:"Bio can' be longer than 70 characters"===C?C:void 0}),n.a.createElement("p",{className:"settings-item-description",dir:p.isRtl?"rtl":void 0},Object(U.a)(p("lng_settings_about_bio"),["br","simple_markdown"]))),n.a.createElement("div",{className:"settings-item"},n.a.createElement("h4",{className:"settings-item-header",dir:p.isRtl?"rtl":void 0},p("Username")),n.a.createElement(Gt,{currentUsername:T||"",isLoading:x,isUsernameAvailable:u,checkUsername:g,onChange:V}),n.a.createElement("p",{className:"settings-item-description",dir:p.isRtl?"rtl":void 0},Object(U.a)(p("UsernameHelp"),["br","simple_markdown"])),T&&n.a.createElement("p",{className:"settings-item-description",dir:p.isRtl?"rtl":void 0},p("lng_username_link"),n.a.createElement("br",null),n.a.createElement("span",{className:"username-link"},"https://t.me/",T)))),n.a.createElement(Dt.a,{isShown:z,onClick:W,disabled:x,ariaLabel:"Save changes"},x?n.a.createElement(A.a,{color:"white"}):n.a.createElement("i",{className:"icon-check"})))})),_t=a(132),Ht=a(119);const $t=Object(V.h)(e=>e(),6e4,!0);var Vt=Object(n.h)(Object(s.h)(e=>{const{chats:{byId:t},users:{byId:a}}=e,{orderedIds:n,byId:s,recommended:c}=e.chatFolders;return{chatsById:t,usersById:a,orderedFolderIds:n,foldersById:s,recommendedChatFolders:c,notifySettings:Object(m.fb)(e),notifyExceptions:Object(m.eb)(e)}},(e,t)=>Object(h.l)(t,["loadRecommendedChatFolders","addChatFolder","showDialog"]))(({onCreateFolder:e,onEditFolder:t,isActive:a,onScreenSelect:s,onReset:c,chatsById:l,usersById:i,orderedFolderIds:d,foldersById:m,recommendedChatFolders:h,notifySettings:b,notifyExceptions:g,loadRecommendedChatFolders:p,addChatFolder:v,showDialog:O})=>{const[E,j]=Object(n.r)(),[f,C]=Object(n.r)(!1),y=Object(n.m)(()=>C(!0),[]);Object(n.n)(()=>{E||Object(_t.a)("FoldersAll").then(j)},[E]),Object(n.n)(()=>{$t(()=>{p()})},[p]);const k=Object(n.m)(()=>{Object.keys(m).length>=10?O({data:{message:"DIALOG_FILTERS_TOO_MUCH",hasErrorKey:!0}}):e()},[m,O,e]),N=Object(M.a)();Object(L.a)(a,c,s,r.n.Folders);const w=Object(n.p)(()=>{if(!d)return;const e=Object.keys(l).map(Number);return d.map(t=>{const a=m[t];return{id:a.id,title:a.title,subtitle:Object(u.n)(N,l,i,a,e,b,g)}})},[d,l,m,i,b,g,N]),S=Object(n.m)(e=>{Object.keys(m).length>=10?O({data:{message:"DIALOG_FILTERS_TOO_MUCH",hasErrorKey:!0}}):v({folder:e})},[m,v,O]);return n.a.createElement("div",{className:"settings-content custom-scroll"},n.a.createElement("div",{className:"settings-content-header"},n.a.createElement("div",{className:"settings-content-icon"},E&&n.a.createElement(Ht.a,{id:"settingsFoldersMain",size:o.Fb,animationData:E,play:f,noLoop:!0,onLoad:y})),n.a.createElement("p",{className:"settings-item-description mb-3",dir:"auto"},N("CreateNewFilterInfo")),n.a.createElement(D.a,{className:"with-icon mb-2",color:"primary",size:"smaller",pill:!0,fluid:!0,onClick:k,isRtl:N.isRtl},n.a.createElement("i",{className:"icon-add"}),N("CreateNewFilter"))),n.a.createElement("div",{className:"settings-item pt-3"},n.a.createElement("h4",{className:"settings-item-header mb-3",dir:N.isRtl?"rtl":void 0},N("Filters")),w&&w.length?w.map(e=>n.a.createElement(Ee.a,{className:"mb-2",narrow:!0,multiline:!0,onClick:()=>t(m[e.id])},n.a.createElement("span",{className:"title"},e.title),n.a.createElement("span",{className:"subtitle"},e.subtitle))):w&&!w.length?n.a.createElement("p",{className:"settings-item-description my-4",dir:"auto"},"You have no folders yet."):n.a.createElement(ge.a,null)),h&&!!h.length&&n.a.createElement("div",{className:"settings-item pt-3"},n.a.createElement("h4",{className:"settings-item-header mb-3",dir:N.isRtl?"rtl":void 0},N("FilterRecommended")),h.map(e=>n.a.createElement(Ee.a,{className:"mb-2",narrow:!0,onClick:()=>S(e)},n.a.createElement("div",{className:"settings-folders-recommended-item"},n.a.createElement("div",{className:"multiline-item"},n.a.createElement("span",{className:"title"},e.title),n.a.createElement("span",{className:"subtitle"},e.description)),n.a.createElement(D.a,{className:"px-3",color:"primary",size:"tiny",pill:!0,fluid:!0,isRtl:N.isRtl},N("Add")))))))})),Wt=a(145);a(283);var Kt=({count:e,itemName:t,itemPluralName:a,isLoading:s,onClick:c})=>{const r=Object(M.a)();return n.a.createElement(D.a,{className:"ShowMoreButton",color:"translucent",size:"smaller",isText:!0,isLoading:s,isRtl:r.isRtl,onClick:c},n.a.createElement("i",{className:"icon-down"}),"Show ",e," more ",e>1?a||t+"s":t)};const Yt="Please provide a title for this folder.";var Qt=Object(n.h)(Object(s.h)(e=>{const{listIds:t}=e.chats;return{loadedActiveChatIds:t.active,loadedArchivedChatIds:t.archived}},(e,t)=>Object(h.l)(t,["editChatFolder","addChatFolder","loadMoreChats"]))(({state:e,dispatch:t,onAddIncludedChats:a,onAddExcludedChats:s,isActive:c,onScreenSelect:l,onReset:i,onBack:d,loadedActiveChatIds:m,loadedArchivedChatIds:b,editChatFolder:g,addChatFolder:p,loadMoreChats:v})=>{const[O,E]=Object(n.r)(),[j,f]=Object(n.r)(!1),C=Object(n.m)(()=>f(!0),[]),[y,k]=Object(n.r)(!1),[N,w]=Object(n.r)(!1),{selectedChatIds:S,selectedChatTypes:I}=Object(Wt.d)(e,"included"),{selectedChatIds:P,selectedChatTypes:F}=Object(Wt.d)(e,"excluded");Object(n.n)(()=>{O||Object(_t.a)("FoldersNew").then(E)},[O]),Object(n.n)(()=>{k(!1),w(!1)},[e.folderId]);const[R,T]=Object(n.p)(()=>{const e=new Set([...m||[],...b||[]]),t=Object(h.f)(S,e),a=Object(h.f)(P,e);return[y?t:t.slice(0,5-I.length),N?a:a.slice(0,5-F.length)]},[P,S,I,F,N,y,m,b]);Object(n.n)(()=>{(R.lengthk(!0):()=>w(!0);return n.a.createElement(n.a.Fragment,null,t.map(t=>function(e,t){const a="included"===t?Wt.b.find(({key:t})=>t===e):Wt.a.find(({key:t})=>t===e);if(a)return n.a.createElement(Ee.a,{key:a.key,className:"settings-folders-list-item mb-1",icon:a.icon,narrow:!0,inactive:!0},D(a.title))}(t,e)),a.map(e=>n.a.createElement(Ee.a,{className:"settings-folders-list-item mb-1",narrow:!0,inactive:!0},Object(u.ob)(e)?n.a.createElement(je.a,{avatarSize:"small",userId:e}):n.a.createElement(fe.a,{avatarSize:"small",chatId:e}))),!s&&c>0&&n.a.createElement(Kt,{count:c,itemName:"chat",onClick:r}))}return Object(L.a)(c,d,l,"edit"===e.mode?r.n.FoldersEditFolder:r.n.FoldersCreateFolder),n.a.createElement("div",{className:"settings-fab-wrapper"},n.a.createElement("div",{className:"settings-content custom-scroll"},n.a.createElement("div",{className:"settings-content-header"},n.a.createElement("div",{className:"settings-content-icon"},O&&n.a.createElement(Ht.a,{id:"settingsFoldersEdit",size:o.Fb,animationData:O,play:j&&String(e.folderId),noLoop:!0,onLoad:C})),"create"===e.mode&&n.a.createElement("p",{className:"settings-item-description mb-3",dir:D.isRtl?"rtl":void 0},D("FilterIncludeInfo")),n.a.createElement(ve.a,{className:"mb-0",label:D("FilterNameHint"),value:e.folder.title,onChange:function(e){const{currentTarget:a}=e;t({type:"setTitle",payload:a.value.trim()})},error:e.error&&e.error===Yt?Yt:void 0})),n.a.createElement("div",{className:"settings-item no-border pt-3"},e.error&&"ChatList.Filter.Error.Empty"===e.error&&n.a.createElement("p",{className:"settings-item-description color-danger mb-2",dir:D.isRtl?"rtl":void 0},D(e.error)),n.a.createElement("h4",{className:"settings-item-header mb-3",dir:D.isRtl?"rtl":void 0},D("FilterInclude")),n.a.createElement(Ee.a,{className:"settings-folders-list-item color-primary mb-0",icon:"add",onClick:a},D("FilterAddChats")),B("included")),n.a.createElement("div",{className:"settings-item no-border pt-3"},n.a.createElement("h4",{className:"settings-item-header mb-3",dir:D.isRtl?"rtl":void 0},D("FilterExclude")),n.a.createElement(Ee.a,{className:"settings-folders-list-item color-primary mb-0",icon:"add",onClick:s},D("FilterAddChats")),B("excluded"))),n.a.createElement(Dt.a,{isShown:!!e.isTouched,disabled:e.isLoading,onClick:function(){const{title:a}=e.folder;a?S.length||Object.keys(I).length?(t({type:"setIsLoading",payload:!0}),"edit"===e.mode?g({id:e.folderId,folderUpdate:e.folder}):p({folder:e.folder}),setTimeout(()=>{i()},500)):t({type:"setError",payload:"ChatList.Filter.Error.Empty"}):t({type:"setError",payload:Yt})},ariaLabel:"edit"===e.mode?"Save changes":"Create folder"},e.isLoading?n.a.createElement(A.a,{color:"white"}):n.a.createElement("i",{className:"icon-check"})))})),Zt=a(48);a(195),a(284);var Jt=Object(n.h)(({mode:e,chatIds:t,selectedIds:a,selectedChatTypes:s,filterValue:c,onSelectedIdsChange:r,onSelectedChatTypesChange:o,onFilterChange:l,onLoadMore:i})=>{const d=Object(n.q)(null),m="included"===e?Wt.b:Wt.a,h=a.length+s.length>10,b=a.length>=100;Object(n.n)(()=>{setTimeout(()=>{requestAnimationFrame(()=>{d.current.focus()})},500)},[]);const g=Object(n.m)(e=>{const t=[...a];t.includes(e)?t.splice(t.indexOf(e),1):t.push(e),r(t)},[a,r]),p=Object(n.m)(e=>{const t=[...s];t.includes(e)?t.splice(t.indexOf(e),1):t.push(e),o(t)},[s,o]),v=Object(n.m)(e=>{const{value:t}=e.currentTarget;l(t)},[l]),O=Object(M.a)();const[E,j]=Object(he.a)(i,t,Boolean(c));return n.a.createElement("div",{className:"Picker SettingsFoldersChatsPicker"},n.a.createElement("div",{className:"picker-header custom-scroll"},s.map((function(e){const t=m.find(({key:t})=>e===t);if(t)return n.a.createElement(ct.a,{icon:t.icon,title:O(t.title),isMinimized:h,canClose:!0,onClick:p,clickArg:t.key})})),a.map((e,t)=>n.a.createElement(ct.a,{chatOrUserId:e,isMinimized:h&&tp(e.key),ripple:!0},n.a.createElement("i",{className:"icon-"+e.icon}),n.a.createElement("h3",{className:"chat-type",dir:"auto"},O(e.title)),n.a.createElement(Zt.a,{label:"",checked:s.includes(e.key),round:!0}))})),n.a.createElement("div",{key:"divider",className:"picker-list-divider"}),n.a.createElement("h4",{key:"header2",className:"settings-item-header",dir:O.isRtl?"rtl":void 0},O("FilterChats"))),E&&E.length?E.map((function(e){const t=a.includes(e);return n.a.createElement(Ee.a,{key:e,className:"chat-item-clickable picker-list-item chat-item",onClick:()=>g(e),ripple:!0,disabled:!t&&b},Object(u.ob)(e)?n.a.createElement(je.a,{userId:e}):n.a.createElement(fe.a,{chatId:e,withChatType:!0}),n.a.createElement(Zt.a,{label:"",checked:t,round:!0}))})):E&&!E.length?n.a.createElement("p",{className:"no-results",key:"no-results"},"Sorry, nothing found."):n.a.createElement(ge.a,{key:"loading"})))});var Xt=Object(n.h)(Object(s.h)(e=>{const{chats:{byId:t,listIds:a,orderedPinnedIds:n}}=e;return{chatsById:t,listIds:a.active,orderedPinnedIds:n.active,archivedPinnedIds:n.archived,archivedListIds:a.archived}},(e,t)=>Object(h.l)(t,["loadMoreChats"]))(({isActive:e,onScreenSelect:t,onReset:a,mode:s,state:c,dispatch:o,chatsById:l,listIds:i,orderedPinnedIds:d,archivedListIds:m,archivedPinnedIds:h,loadMoreChats:b})=>{const{chatFilter:g}=c,{selectedChatIds:p,selectedChatTypes:v}=Object(Wt.d)(c,s,!0),O=Object(M.a)(),E=Object(n.p)(()=>{const e=i?Object(u.Fb)(l,i,d,"all"):void 0,t=m?Object(u.Fb)(l,m,h,"archived"):void 0;if(e||t)return[...e?[...e.pinnedChats,...e.otherChats]:[],...t?t.otherChats:[]]},[l,i,d,m,h]),j=Object(n.p)(()=>{if(E)return E.filter(e=>!g||Object(ue.a)(Object(u.k)(O,e),g)||p.includes(e.id)).map(({id:e})=>e)},[E,g,O,p]),f=Object(n.m)(e=>{o({type:"setChatFilter",payload:e})},[o]),C=Object(n.m)(e=>{o("included"===s?{type:"setIncludeFilters",payload:{...c.includeFilters,includedChatIds:e}}:{type:"setExcludeFilters",payload:{...c.excludeFilters,excludedChatIds:e}})},[s,c,o]),y=Object(n.m)(e=>{const t={};e.forEach(e=>{t[e]=!0}),o("included"===s?{type:"setIncludeFilters",payload:{includedChatIds:p,...t}}:{type:"setExcludeFilters",payload:{excludedChatIds:p,...t}})},[s,p,o]);return Object(L.a)(e,a,t,"included"===s?r.n.FoldersIncludedChats:r.n.FoldersExcludedChats),j?n.a.createElement(Jt,{mode:s,chatIds:j,selectedIds:p,selectedChatTypes:v,filterValue:g,onSelectedIdsChange:C,onSelectedChatTypesChange:y,onFilterChange:f,onLoadMore:b}):n.a.createElement(ge.a,null)}));a(285);var ea=Object(n.h)(({currentScreen:e,shownScreen:t,state:a,dispatch:s,isActive:c,onScreenSelect:o,onReset:l})=>{const i=Object(n.m)(()=>{e!==r.n.FoldersCreateFolder&&e!==r.n.FoldersEditFolder&&e!==r.n.FoldersEditFolderFromChatList||setTimeout(()=>{s({type:"reset"})},200),e!==r.n.FoldersIncludedChats&&e!==r.n.FoldersExcludedChats?l():"create"===a.mode?o(r.n.FoldersCreateFolder):o(r.n.FoldersEditFolder)},[a.mode,s,e,l,o]),d=Object(n.m)(()=>{s({type:"reset"}),o(r.n.FoldersCreateFolder)},[o,s]),m=Object(n.m)(e=>{s({type:"editFolder",payload:e}),o(r.n.FoldersEditFolder)},[s,o]),u=Object(n.m)(()=>{s({type:"editIncludeFilters"}),o(e===r.n.FoldersEditFolderFromChatList?r.n.FoldersIncludedChatsFromChatList:r.n.FoldersIncludedChats)},[e,s,o]),h=Object(n.m)(()=>{s({type:"editExcludeFilters"}),o(e===r.n.FoldersEditFolderFromChatList?r.n.FoldersExcludedChatsFromChatList:r.n.FoldersExcludedChats)},[e,s,o]);switch(e){case r.n.Folders:return n.a.createElement(Vt,{onCreateFolder:d,onEditFolder:m,onScreenSelect:o,isActive:c||[r.n.FoldersCreateFolder,r.n.FoldersEditFolder,r.n.FoldersIncludedChats,r.n.FoldersExcludedChats].includes(t),onReset:l});case r.n.FoldersCreateFolder:case r.n.FoldersEditFolder:case r.n.FoldersEditFolderFromChatList:return n.a.createElement(Qt,{state:a,dispatch:s,onAddIncludedChats:u,onAddExcludedChats:h,onReset:i,onScreenSelect:o,isActive:c||[r.n.FoldersIncludedChats,r.n.FoldersExcludedChats].includes(t),onBack:l});case r.n.FoldersIncludedChats:case r.n.FoldersIncludedChatsFromChatList:return n.a.createElement(Xt,{mode:"included",state:a,dispatch:s,onReset:i,onScreenSelect:o,isActive:c});case r.n.FoldersExcludedChats:case r.n.FoldersExcludedChatsFromChatList:return n.a.createElement(Xt,{mode:"excluded",state:a,dispatch:s,onReset:i,onScreenSelect:o,isActive:c});default:return}}),ta=a(109);a(286);var aa=Object(n.h)(({options:e,range:t,label:a,value:s,disabled:c,onChange:r})=>{const o=Object(M.a)(),l=Object(n.m)(e=>{r(Number(e.currentTarget.value))},[r]),i=Object(W.a)("RangeSlider",c&&"disabled"),d=Object(n.p)(()=>{if(e)return s/(e.length-1)*100;if(t){const e=(t.max-t.min)/(t.step||1);return(s-t.min)/e*100}return 0},[s,e,t]),[m,u,h]=Object(n.p)(()=>e?[0,e.length-1,1]:t?[t.min,t.max,t.step||1]:[0,0,0],[t,e]);return n.a.createElement("div",{className:i},a&&n.a.createElement("div",{className:"slider-top-row",dir:o.isRtl?"rtl":void 0},n.a.createElement("span",{className:"label",dir:"auto"},a),t&&n.a.createElement("span",{className:"value",dir:"auto"},s)),n.a.createElement("div",{className:"slider-main"},n.a.createElement("div",{className:"slider-fill-track",style:`width: ${d}%`}),n.a.createElement("input",{min:m,max:u,value:s,step:h,type:"range",onChange:l}),e&&n.a.createElement("div",{className:"slider-options"},e.map((e,t)=>n.a.createElement("div",{className:Object(W.a)("slider-option no-selection",t===s&&"active"),onClick:()=>r(t)},e)))))}),na=a(117),sa=a(50);var ca=Object(n.h)(({size:e=o.Mb,stickerSet:t,observeIntersection:a})=>{const s=Object(n.q)(null),r=Object(ta.b)(s,a),l="stickerSet"+t.id,i=Object(O.a)(l,!r,c.ApiMediaFormat.Lottie),{shouldRenderFullMedia:d,transitionClassNames:m}=Object(na.a)(i,"slow");return n.a.createElement("div",{ref:s,className:"sticker-set-cover"},!d&&Object(sa.c)(t.title,2),d&&i&&n.a.createElement(Ht.a,{id:l,size:e,animationData:i,className:m}))});var ra=Object(n.h)(({stickerSet:e,observeIntersection:t})=>{const a=Object(n.q)(null),s=Object(ta.b)(a,t),c=Object(O.a)(e.hasThumbnail&&"stickerSet"+e.id,!s),{shouldRenderFullMedia:r,transitionClassNames:o}=Object(na.a)(c,"slow");return n.a.createElement("div",{ref:a,className:"sticker-set-cover"},!r&&Object(sa.c)(e.title,2),r&&n.a.createElement("img",{src:c,className:o,alt:""}))}),oa=a(125);a(287);var la=Object(n.h)(({stickerSet:e,observeIntersection:t,onClick:a})=>{const s=Object(M.a)();if(!e||!e.stickers)return;const c=e.stickers&&e.stickers[0];return e.hasThumbnail||!c?n.a.createElement(Ee.a,{narrow:!0,className:"SettingsStickerSet",inactive:!c,onClick:()=>c&&a(c)},n.a.createElement(D.a,{ariaLabel:e.title,color:"translucent",isRtl:s.isRtl},e.isAnimated?n.a.createElement(ca,{size:o.Gb,stickerSet:e,observeIntersection:t}):n.a.createElement(ra,{stickerSet:e,observeIntersection:t})),n.a.createElement("div",{className:"multiline-menu-item"},n.a.createElement("div",{className:"title"},e.title),n.a.createElement("div",{className:"subtitle"},s("StickerPack.StickerCount",e.count,"i")))):n.a.createElement(Ee.a,{narrow:!0,className:"SettingsStickerSet",onClick:()=>a(c)},n.a.createElement(oa.a,{sticker:c,size:o.Gb,title:e.title,observeIntersection:t}),n.a.createElement("div",{className:"multiline-menu-item"},n.a.createElement("div",{className:"title"},e.title),n.a.createElement("div",{className:"subtitle"},s("StickerPack.StickerCount",e.count,"i"))))}),ia=a(167);const da=["Solid and Steady","Nice and Fast","Lots of Stuff"];var ma=Object(n.h)(Object(s.h)(e=>({...Object(h.l)(e.settings.byKey,["messageTextSize","animationLevel","messageSendKeyCombo","shouldAutoDownloadMediaFromContacts","shouldAutoDownloadMediaInPrivateChats","shouldAutoDownloadMediaInGroups","shouldAutoDownloadMediaInChannels","shouldAutoPlayGifs","shouldAutoPlayVideos","shouldSuggestStickers","shouldLoopStickers","isSensitiveEnabled","canChangeSensitive"]),stickerSetIds:e.stickers.added.setIds,stickerSetsById:e.stickers.setsById}),(e,t)=>Object(h.l)(t,["setSettingOption","loadStickerSets","loadAddedStickers"]))(({isActive:e,onScreenSelect:t,onReset:a,stickerSetIds:s,stickerSetsById:c,messageTextSize:o,animationLevel:i,messageSendKeyCombo:d,shouldAutoDownloadMediaFromContacts:m,shouldAutoDownloadMediaInPrivateChats:u,shouldAutoDownloadMediaInGroups:h,shouldAutoDownloadMediaInChannels:b,shouldAutoPlayGifs:g,shouldAutoPlayVideos:p,shouldSuggestStickers:v,shouldLoopStickers:O,setSettingOption:E,loadStickerSets:j,loadAddedStickers:f})=>{const C=Object(n.q)(null),{observe:y}=Object(ta.a)({rootRef:C}),[k,N,w]=Object(xe.a)(),[S,I]=Object(n.r)(),P=Object(M.a)(),F=l.n?void 0:[{value:"enter",label:P("lng_settings_send_enter"),subLabel:"New line by Shift + Enter"},{value:"ctrl-enter",label:P(l.f?"lng_settings_send_cmdenter":"lng_settings_send_ctrlenter"),subLabel:"New line by Enter"}];Object(n.n)(()=>{j()},[j]),Object(n.n)(()=>{s&&s.length&&f()},[s,f]);const A=Object(n.m)(e=>{da.forEach((t,a)=>{document.body.classList.toggle("animation-level-"+a,e===a)}),E({animationLevel:e})},[E]),R=Object(n.m)(e=>{document.documentElement.style.setProperty("--composer-text-size",Math.max(e,l.e?16:15)+"px"),document.documentElement.style.setProperty("--message-meta-height",Math.floor(1.3125*e)+"px"),document.documentElement.style.setProperty("--message-text-size",e+"px"),document.documentElement.setAttribute("data-message-text-size",e.toString()),E({messageTextSize:e})},[E]),T=Object(n.m)(e=>{I(e),N()},[N]),D=s&&s.map(e=>!!(c&&c[e]&&c[e].installedDate)&&c[e]).filter(Boolean);return Object(L.a)(e,a,t,r.n.General),n.a.createElement("div",{className:"settings-content custom-scroll"},n.a.createElement("div",{className:"settings-item pt-3"},n.a.createElement("h4",{className:"settings-item-header",dir:P.isRtl?"rtl":void 0},P("SETTINGS")),n.a.createElement(aa,{label:P("TextSize"),range:{min:12,max:20},value:o,onChange:R}),n.a.createElement(Ee.a,{icon:"photo",onClick:()=>t(r.n.GeneralChatBackground)},P("ChatBackground"))),n.a.createElement("div",{className:"settings-item"},n.a.createElement("h4",{className:"settings-item-header",dir:P.isRtl?"rtl":void 0},"Animation Level"),n.a.createElement("p",{className:"settings-item-description",dir:P.isRtl?"rtl":void 0},"Choose the desired animations amount."),n.a.createElement(aa,{options:da,value:i,onChange:A})),F&&n.a.createElement("div",{className:"settings-item"},n.a.createElement("h4",{className:"settings-item-header",dir:P.isRtl?"rtl":void 0},P("VoiceOver.Keyboard")),n.a.createElement(qe.a,{name:"keyboard-send-settings",options:F,onChange:e=>E({messageSendKeyCombo:e}),selected:d})),n.a.createElement("div",{className:"settings-item"},n.a.createElement("h4",{className:"settings-item-header",dir:P.isRtl?"rtl":void 0},P("AutoDownloadMedia")),n.a.createElement(Zt.a,{label:P("Contacts"),checked:m,onCheck:e=>E({shouldAutoDownloadMediaFromContacts:e})}),n.a.createElement(Zt.a,{label:P("AutodownloadPrivateChats"),checked:u,onCheck:e=>E({shouldAutoDownloadMediaInPrivateChats:e})}),n.a.createElement(Zt.a,{label:P("AutodownloadGroupChats"),checked:h,onCheck:e=>E({shouldAutoDownloadMediaInGroups:e})}),n.a.createElement(Zt.a,{label:P("FilterChannels"),checked:b,onCheck:e=>E({shouldAutoDownloadMediaInChannels:e})})),n.a.createElement("div",{className:"settings-item"},n.a.createElement("h4",{className:"settings-item-header",dir:P.isRtl?"rtl":void 0},P("AutoplayMedia")),n.a.createElement(Zt.a,{label:P("GifsTab2"),checked:g,onCheck:e=>E({shouldAutoPlayGifs:e})}),n.a.createElement(Zt.a,{label:P("DataAndStorage.Autoplay.Videos"),checked:p,onCheck:e=>E({shouldAutoPlayVideos:e})})),n.a.createElement("div",{className:"settings-item"},n.a.createElement("h4",{className:"settings-item-header",dir:P.isRtl?"rtl":void 0},P("AccDescrStickers")),n.a.createElement(Zt.a,{label:P("SuggestStickers"),checked:v,onCheck:e=>E({shouldSuggestStickers:e})}),n.a.createElement(Zt.a,{label:P("LoopAnimatedStickers"),checked:O,onCheck:e=>E({shouldLoopStickers:e})}),n.a.createElement("div",{className:"mt-4",ref:C},D&&D.map(e=>n.a.createElement(la,{key:e.id,stickerSet:e,observeIntersection:y,onClick:T}))),S&&n.a.createElement(ia.a,{isOpen:k,fromSticker:S,onClose:w})))}));let ua;function ha(e="*",t,a=!1){ua||(ua=document.createElement("input"),ua.setAttribute("type","file")),ua.setAttribute("accept",e),a?ua.removeAttribute("multiple"):ua.setAttribute("multiple","multiple"),ua.onchange=null,ua.value="",ua.onchange=t,ua.click()}var ba=a(17);function ga(e){return[parseInt(e.substring(0,2),16),parseInt(e.substring(2,4),16),parseInt(e.substring(4,6),16)]}function pa(e){const t=e[0].toString(16),a=e[1].toString(16),n=e[2].toString(16);return(1==t.length?"0"+t:t)+(1==a.length?"0"+a:a)+(1==n.length?"0"+n:n)}function va([e,t,a]){e/=255,t/=255,a/=255;let n,s,c=Math.max(e,t,a),r=Math.min(e,t,a),o=c,l=c-r;if(s=0==c?0:l/c,c==r)n=0;else{switch(c){case e:n=(t-a)/l+(t.5?Math.max(0,.65*n):Math.max(0,Math.min(1,1-.65*n)),`hsla(${360*t}, ${100*a}%, ${100*n}%, .4)`}var ja=a(12),fa=a(168);a(288);var Ca=Object(n.h)(({wallpaper:e,theme:t,isSelected:a,onClick:s})=>{const{slug:c,document:l}=e,i="wallpaper"+l.id,d=l.previewBlobUrl,m=Object(O.a)(i+"?size=m"),u=Object(fa.a)(l.thumbnail&&l.thumbnail.dataUri,Boolean(m),!0),{shouldRenderThumb:h,shouldRenderFullMedia:b,transitionClassNames:g}=Object(na.a)(m||d,"slow"),[p,v]=Object(n.r)(!1),{mediaData:j,downloadProgress:C}=Object(E.a)(i,!p),y=!1===Object(f.a)(p),{shouldRender:k,transitionClassNames:N}=Object(Y.a)(p&&!j||c===r.o,void 0,y,"slow"),w=Object(n.q)();w.current=t;const S=Object(n.m)(()=>{(async()=>{const e=await Object(ba.e)(j);await ja.d(o.o,w.current,e),s(c)})()},[j,s,c]);Object(n.n)(()=>{j&&S()},[j,S]);const I=Object(n.m)(()=>{j?S():v(e=>!e)},[j,S]),P=Object(W.a)("WallpaperTile",a&&"selected");return n.a.createElement("div",{className:P,onClick:I},n.a.createElement("div",{className:"media-inner"},h&&n.a.createElement("canvas",{ref:u,className:"thumbnail"}),b&&n.a.createElement("img",{src:m||d,className:"full-media "+g,alt:""}),k&&n.a.createElement("div",{className:Object(W.a)("spinner-container",N)},n.a.createElement(H.a,{progress:C,onClick:I}))))});a(289);const ya=Object(V.h)(e=>e(),6e4,!0);var ka=Object(n.h)(Object(s.h)(e=>{const t=Object(m.Db)(e),{background:a,isBlurred:n}=e.settings.themes[t]||{},{loadedWallpapers:s}=e.settings;return{background:a,isBlurred:n,loadedWallpapers:s,theme:t}},(e,t)=>Object(h.l)(t,["loadWallpapers","uploadWallpaper","setThemeSettings"]))(({isActive:e,onScreenSelect:t,onReset:a,background:s,isBlurred:c,loadedWallpapers:l,theme:i,loadWallpapers:d,uploadWallpaper:m,setThemeSettings:u})=>{const h=Object(n.q)();h.current=i,Object(n.n)(()=>{ya(()=>{d()})},[d]);const b=Object(n.m)(e=>{const{files:t}=e.target;t&&t.length>0&&m(t[0])},[m]),g=Object(n.m)(()=>{ha("image/jpeg",b,!0)},[b]),p=Object(n.m)(()=>{t(r.n.GeneralChatBackgroundColor)},[t]),v=Object(n.m)(()=>{u({theme:i,background:void 0,backgroundColor:void 0,isBlurred:!0,patternColor:"dark"===i?o.q:o.x})},[u,i]),O=Object(n.m)(e=>{u({theme:h.current,background:e});const t=l&&l.find(t=>t.slug===e);t&&t.document.thumbnail&&async function(e){const t=[0,0,0];let a,n,s,c,r=-4,o=[0,0,0],l=0;const i=document.createElement("canvas"),d=i.getContext&&i.getContext("2d");if(!d)return t;const m=await Object(ba.g)(e);s=m.naturalHeight||m.offsetHeight||m.height,n=m.naturalWidth||m.offsetWidth||m.width,i.height=s,i.width=n,d.drawImage(m,0,0);try{a=d.getImageData(0,0,n,s)}catch(e){return t}for(c=a.data.length;(r+=20){const t=Ea(e),a="#"+pa(e);u({theme:h.current,backgroundColor:a,patternColor:t})})},[l,u]),E=Object(n.m)(e=>{u({theme:h.current,isBlurred:e.target.checked})},[u]),j=Object(M.a)();Object(L.a)(e,a,t,r.n.GeneralChatBackground);const f=l&&l[0]&&l[0].slug===r.o;return n.a.createElement("div",{className:"SettingsGeneralBackground settings-content custom-scroll"},n.a.createElement("div",{className:"settings-item pt-3"},n.a.createElement(Ee.a,{icon:"camera-add",className:"mb-0",disabled:f,onClick:g},j("UploadImage")),n.a.createElement(Ee.a,{icon:"colorize",className:"mb-0",onClick:p},j("SetColor")),n.a.createElement(Ee.a,{icon:"favorite",onClick:v},j("ThemeResetToDefaults")),n.a.createElement(Zt.a,{label:j("BackgroundBlurred"),checked:Boolean(c),onChange:E})),l?n.a.createElement("div",{className:"settings-wallpapers"},l.map(e=>n.a.createElement(Ca,{wallpaper:e,theme:i,isSelected:s===e.slug,onClick:O}))):n.a.createElement(ge.a,null))}));a(290);const Na=va(ga("e6ebee")),wa=["#e6ebee","#b2cee1","#008dd0","#c6e7cb","#c4e1a6","#60b16e","#ccd0af","#a6a997","#7a7072","#fdd7af","#fdb76e","#dd8851"];function Sa(e,t){return{colorPosition:[Math.round(e[1]*(t.colorRect.width-1)),Math.round((1-e[2])*(t.colorRect.height-1))],huePosition:Math.round(e[0]*(t.hueRect.width-1))}}function Ia({colorPosition:e,huePosition:t},a){return[t/(a.hueRect.width-1),e[0]/(a.colorRect.width-1),1-e[1]/(a.colorRect.height-1)]}var Pa=Object(n.h)(Object(s.h)(e=>{const t=Object(m.Db)(e),{backgroundColor:a}=e.settings.themes[t]||{};return{backgroundColor:a,theme:t}},(e,t)=>Object(h.l)(t,["setThemeSettings"]))(({isActive:e,onScreenSelect:t,onReset:a,theme:s,backgroundColor:c,setThemeSettings:o})=>{const l=Object(n.q)();l.current=s;const i=Object(n.q)(null),d=Object(n.q)(null),m=Object(n.q)(null),u=Object(n.q)(!0),[g,p]=Object(n.r)(function(e){return e&&e.startsWith("#")?va(ga(e.replace("#",""))):Na}(c)),v=Object(n.q)(g);Object(n.n)(()=>{v.current=g},[g]);const[O,E,j]=Object(xe.a)(),[f,C]=Object(n.r)(""),[y,k]=Object(n.r)(""),N=Object(n.q)(),w=Object(n.q)();Object(n.n)(()=>{const e={offsetLeft:d.current.offsetLeft,...Object(h.l)(d.current.getBoundingClientRect(),["top","width","height"])},t={offsetLeft:m.current.offsetLeft,...Object(h.l)(m.current.getBoundingClientRect(),["width"])};function a(t){const a=[Math.min(Math.max(0,t.pageX-e.offsetLeft),e.width-1),Math.min(Math.max(0,t.pageY-e.top+i.current.scrollTop),e.height-1)],{huePosition:n}=Sa(v.current,N.current);p(Ia({colorPosition:a,huePosition:n},N.current)),E()}function n(e){const{colorPosition:a}=Sa(v.current,N.current),n=Math.min(Math.max(0,e.pageX-t.offsetLeft),t.width-1);p(Ia({colorPosition:a,huePosition:n},N.current)),E()}N.current={colorRect:e,hueRect:t},Object(b.b)(d.current,{onCapture:a,onDrag:a,onRelease:j,onClick:j,withCursor:!0}),Object(b.b)(m.current,{onCapture:n,onDrag:n,onRelease:j,onClick:j,withCursor:!0})},[E,j]);const{colorPosition:S=[0,0],huePosition:I=0}=N.current?Sa(g,N.current):{},P=pa(Oa(g)),F=g[0],M=pa(Oa([F,1,1]));Object(n.n)(()=>{const e=Oa(g),t="#"+pa(e);if(C(e.join(", ")),k(t),!u.current){const a=Ea(e);o({theme:l.current,background:void 0,backgroundColor:t,patternColor:a})}u.current=!1},[g,o]),Object(n.n)(()=>{!function(e,t,a,n){let s,c,r;a.current&&n.current?(s=n.current.colorRect.width,c=n.current.colorRect.height,r=a.current):(s=e.offsetWidth,c=e.offsetHeight,r=e.getContext("2d"),e.width=s,e.height=c,a.current=r);const o=r.createImageData(s,c),l=o.data,i=Oa([t,1,1]);let d=0;for(let e=0;e{!function(e){const t=e.offsetWidth;e.width=t,e.height=1;const a=e.getContext("2d"),n=a.createImageData(t,1),s=n.data;let c=0;for(let e=0;e{const t=e.currentTarget.value.replace(/[^\d, ]/g,"").slice(0,13);if(t.match(/^\d{1,3},\s?\d{1,3},\s?\d{1,3}$/)){const e=t.split(",").map(e=>Number(e.trim()));p(va(e))}e.currentTarget.value=t},[]),R=Object(n.m)(e=>{const t=e.currentTarget.value.replace(/[^0-9a-fA-F]/g,"").slice(0,6);t.match(/^#?[0-9a-fA-F]{6}$/)&&p(va(ga(t.replace("#","")))),e.currentTarget.value=t},[]),T=Object(n.m)(e=>{p(va(ga(e.currentTarget.dataset.color.replace("#",""))))},[]),D=Object(W.a)("SettingsGeneralBackgroundColor settings-content custom-scroll",O&&"is-dragging");return Object(L.a)(e,a,t,r.n.GeneralChatBackgroundColor),n.a.createElement("div",{ref:i,className:D},n.a.createElement("div",{className:"settings-item pt-3"},n.a.createElement("div",{ref:d,className:"color-picker"},n.a.createElement("canvas",null),n.a.createElement("div",{className:"handle",style:`transform: translate(${S[0]}px, ${S[1]}px); background-color: #${P};`})),n.a.createElement("div",{ref:m,className:"hue-picker"},n.a.createElement("canvas",null),n.a.createElement("div",{className:"handle",style:`transform: translateX(${I}px); background-color: #${M};`})),n.a.createElement("div",{className:"tools"},n.a.createElement(ve.a,{value:y,label:"HEX",onChange:R}),n.a.createElement(ve.a,{value:f,label:"RGB",onChange:A}))),n.a.createElement("div",{className:"predefined-colors"},wa.map(e=>n.a.createElement("div",{className:e==="#"+P?"active":void 0,"data-color":e,style:`background-color: ${e};`,onClick:T}))))}));var Fa=Object(n.h)(Object(s.h)(e=>({hasPrivateChatsNotifications:Boolean(e.settings.byKey.hasPrivateChatsNotifications),hasPrivateChatsMessagePreview:Boolean(e.settings.byKey.hasPrivateChatsMessagePreview),hasGroupNotifications:Boolean(e.settings.byKey.hasGroupNotifications),hasGroupMessagePreview:Boolean(e.settings.byKey.hasGroupMessagePreview),hasBroadcastNotifications:Boolean(e.settings.byKey.hasBroadcastNotifications),hasBroadcastMessagePreview:Boolean(e.settings.byKey.hasBroadcastMessagePreview),hasContactJoinedNotifications:Boolean(e.settings.byKey.hasContactJoinedNotifications)}),(e,t)=>Object(h.l)(t,["loadNotificationSettings","updateContactSignUpNotification","updateNotificationSettings"]))(({isActive:e,onScreenSelect:t,onReset:a,hasPrivateChatsNotifications:s,hasPrivateChatsMessagePreview:c,hasGroupNotifications:o,hasGroupMessagePreview:l,hasBroadcastNotifications:i,hasBroadcastMessagePreview:d,hasContactJoinedNotifications:m,loadNotificationSettings:u,updateContactSignUpNotification:h,updateNotificationSettings:b})=>{Object(n.n)(()=>{u()},[u]);const g=Object(n.m)((e,t,a)=>{const n="contact"===t?!s:!("group"===t?o:i),r="contact"===t?c:"group"===t?l:d;b({peerType:t,..."silent"===a&&{isSilent:!e.target.checked,shouldShowPreviews:r},..."showPreviews"===a&&{shouldShowPreviews:e.target.checked,isSilent:n}})},[d,i,l,o,c,s,b]),p=Object(n.m)(e=>{h({isSilent:!e.target.checked})},[h]),v=Object(M.a)();return Object(L.a)(e,a,t,r.n.Notifications),n.a.createElement("div",{className:"settings-content custom-scroll"},n.a.createElement("div",{className:"settings-item"},n.a.createElement("h4",{className:"settings-item-header",dir:v.isRtl?"rtl":void 0},v("AutodownloadPrivateChats")),n.a.createElement(Zt.a,{label:v("NotificationsForPrivateChats"),subLabel:v(s?"UserInfo.NotificationsEnabled":"UserInfo.NotificationsDisabled"),checked:s,onChange:e=>{g(e,"contact","silent")}}),n.a.createElement(Zt.a,{label:v("MessagePreview"),subLabel:v(c?"UserInfo.NotificationsEnabled":"UserInfo.NotificationsDisabled"),checked:c,onChange:e=>{g(e,"contact","showPreviews")}})),n.a.createElement("div",{className:"settings-item"},n.a.createElement("h4",{className:"settings-item-header",dir:v.isRtl?"rtl":void 0},v("FilterGroups")),n.a.createElement(Zt.a,{label:v("NotificationsForGroups"),subLabel:v(o?"UserInfo.NotificationsEnabled":"UserInfo.NotificationsDisabled"),checked:o,onChange:e=>{g(e,"group","silent")}}),n.a.createElement(Zt.a,{label:v("MessagePreview"),subLabel:v(l?"UserInfo.NotificationsEnabled":"UserInfo.NotificationsDisabled"),checked:l,onChange:e=>{g(e,"group","showPreviews")}})),n.a.createElement("div",{className:"settings-item"},n.a.createElement("h4",{className:"settings-item-header",dir:v.isRtl?"rtl":void 0},v("FilterChannels")),n.a.createElement(Zt.a,{label:v("NotificationsForChannels"),subLabel:v(i?"UserInfo.NotificationsEnabled":"UserInfo.NotificationsDisabled"),checked:i,onChange:e=>{g(e,"broadcast","silent")}}),n.a.createElement(Zt.a,{label:v("MessagePreview"),subLabel:v(d?"UserInfo.NotificationsEnabled":"UserInfo.NotificationsDisabled"),checked:d,onChange:e=>{g(e,"broadcast","showPreviews")}})),n.a.createElement("div",{className:"settings-item"},n.a.createElement("h4",{className:"settings-item-header",dir:v.isRtl?"rtl":void 0},v("PhoneOther")),n.a.createElement(Zt.a,{label:v("ContactJoined"),checked:m,onChange:p})))}));var Ma=Object(n.h)(Object(s.h)(e=>{const{settings:{byKey:{hasPassword:t,isSensitiveEnabled:a,canChangeSensitive:n},privacy:s},blocked:c,activeSessions:r}=e;return{hasPassword:t,blockedCount:c.totalCount,sessionsCount:r.length,isSensitiveEnabled:a,canChangeSensitive:n,visibilityPrivacyPhoneNumber:s.phoneNumber&&s.phoneNumber.visibility,visibilityPrivacyLastSeen:s.lastSeen&&s.lastSeen.visibility,visibilityPrivacyProfilePhoto:s.profilePhoto&&s.profilePhoto.visibility,visibilityPrivacyForwarding:s.forwards&&s.forwards.visibility,visibilityPrivacyGroupChats:s.chatInvite&&s.chatInvite.visibility}},(e,t)=>Object(h.l)(t,["loadBlockedContacts","loadAuthorizations","loadPrivacySettings","loadContentSettings","updateContentSettings"]))(({isActive:e,onScreenSelect:t,onReset:a,hasPassword:s,blockedCount:c,sessionsCount:o,isSensitiveEnabled:l,canChangeSensitive:i,visibilityPrivacyPhoneNumber:d,visibilityPrivacyLastSeen:m,visibilityPrivacyProfilePhoto:u,visibilityPrivacyForwarding:h,visibilityPrivacyGroupChats:b,loadPrivacySettings:g,loadBlockedContacts:p,loadAuthorizations:v,loadContentSettings:O,updateContentSettings:E})=>{Object(n.n)(()=>{p(),v(),g(),O()},[p,v,g,O]);const j=Object(M.a)();function f(e){switch(e){case"everybody":return j("P2PEverybody");case"contacts":return j("P2PContacts");case"nobody":return j("P2PNobody")}}return Object(L.a)(e,a,t,r.n.Privacy),n.a.createElement("div",{className:"settings-content custom-scroll"},n.a.createElement("div",{className:"settings-item pt-3"},n.a.createElement(Ee.a,{icon:"delete-user",narrow:!0,onClick:()=>t(r.n.PrivacyBlockedUsers)},n.a.createElement("div",{className:"multiline-menu-item"},n.a.createElement("span",{className:"title"},j("BlockedUsers")),c>0&&n.a.createElement("span",{className:"subtitle",dir:"auto"},j("Users",c)))),n.a.createElement(Ee.a,{icon:"lock",narrow:!0,onClick:()=>t(s?r.n.TwoFaEnabled:r.n.TwoFaDisabled)},n.a.createElement("div",{className:"multiline-menu-item"},n.a.createElement("span",{className:"title"},j("TwoStepVerification")),n.a.createElement("span",{className:"subtitle",dir:"auto"},j(s?"PasswordOn":"PasswordOff")))),n.a.createElement(Ee.a,{icon:"active-sessions",narrow:!0,onClick:()=>t(r.n.PrivacyActiveSessions)},n.a.createElement("div",{className:"multiline-menu-item"},n.a.createElement("span",{className:"title"},j("SessionsTitle")),o>0&&n.a.createElement("span",{className:"subtitle",dir:"auto"},1===o?"1 session":o+" sessions")))),n.a.createElement("div",{className:"settings-item"},n.a.createElement("h4",{className:"settings-item-header mb-4",dir:j.isRtl?"rtl":void 0},j("PrivacyTitle")),n.a.createElement(Ee.a,{narrow:!0,onClick:()=>t(r.n.PrivacyPhoneNumber)},n.a.createElement("div",{className:"multiline-menu-item"},n.a.createElement("span",{className:"title"},j("PrivacyPhoneTitle")),n.a.createElement("span",{className:"subtitle",dir:"auto"},f(d)))),n.a.createElement(Ee.a,{narrow:!0,onClick:()=>t(r.n.PrivacyLastSeen)},n.a.createElement("div",{className:"multiline-menu-item"},n.a.createElement("span",{className:"title"},j("LastSeenTitle")),n.a.createElement("span",{className:"subtitle",dir:"auto"},f(m)))),n.a.createElement(Ee.a,{narrow:!0,onClick:()=>t(r.n.PrivacyProfilePhoto)},n.a.createElement("div",{className:"multiline-menu-item"},n.a.createElement("span",{className:"title"},j("PrivacyProfilePhotoTitle")),n.a.createElement("span",{className:"subtitle",dir:"auto"},f(u)))),n.a.createElement(Ee.a,{narrow:!0,onClick:()=>t(r.n.PrivacyForwarding)},n.a.createElement("div",{className:"multiline-menu-item"},n.a.createElement("span",{className:"title"},j("PrivacyForwardsTitle")),n.a.createElement("span",{className:"subtitle",dir:"auto"},f(h)))),n.a.createElement(Ee.a,{narrow:!0,onClick:()=>t(r.n.PrivacyGroupChats)},n.a.createElement("div",{className:"multiline-menu-item"},n.a.createElement("span",{className:"title"},j("WhoCanAddMe")),n.a.createElement("span",{className:"subtitle",dir:"auto"},f(b))))),i&&n.a.createElement("div",{className:"settings-item"},n.a.createElement("h4",{className:"settings-item-header",dir:j.isRtl?"rtl":void 0},j("lng_settings_sensitive_title")),n.a.createElement(Zt.a,{label:j("lng_settings_sensitive_disable_filtering"),subLabel:j("lng_settings_sensitive_about"),checked:Boolean(l),disabled:!i,onCheck:E})))})),La=a(14);var Aa=Object(n.h)(Object(s.h)(e=>({languages:e.settings.byKey.languages,language:e.settings.byKey.language}),(e,t)=>Object(h.l)(t,["loadLanguages","setSettingOption"]))(({isActive:e,onScreenSelect:t,onReset:a,languages:s,language:c,loadLanguages:o,setSettingOption:l})=>{const[i,d]=Object(n.r)(c),[m,u,h]=Object(xe.a)();Object(n.n)(()=>{o()},[o]);const b=Object(n.m)(e=>{d(e),u(),Object(La.d)(e,()=>{h(),l({language:e})})},[u,h,l]),g=Object(n.p)(()=>s?function(e){const t=(window.navigator.language||"en").toLowerCase(),a=t.substr(0,2);return e.map(({langCode:e,nativeName:t,name:a})=>({value:e,label:t,subLabel:a})).sort(e=>!t||e.value!==t&&e.value!==a?0:-1)}(s):void 0,[s]);return Object(L.a)(e,a,t,r.n.Language),n.a.createElement("div",{className:"settings-content settings-item settings-language custom-scroll"},g?n.a.createElement(qe.a,{name:"keyboard-send-settings",options:g,selected:i,loadingOption:m?i:void 0,onChange:b}):n.a.createElement(ge.a,null))}));function Ra(e){switch(e){case r.n.PrivacyPhoneNumber:case r.n.PrivacyPhoneNumberAllowedContacts:case r.n.PrivacyPhoneNumberDeniedContacts:return"phoneNumber";case r.n.PrivacyLastSeen:case r.n.PrivacyLastSeenAllowedContacts:case r.n.PrivacyLastSeenDeniedContacts:return"lastSeen";case r.n.PrivacyProfilePhoto:case r.n.PrivacyProfilePhotoAllowedContacts:case r.n.PrivacyProfilePhotoDeniedContacts:return"profilePhoto";case r.n.PrivacyForwarding:case r.n.PrivacyForwardingAllowedContacts:case r.n.PrivacyForwardingDeniedContacts:return"forwards";case r.n.PrivacyGroupChats:case r.n.PrivacyGroupChatsAllowedContacts:case r.n.PrivacyGroupChatsDeniedContacts:return"chatInvite"}}var Ta=Object(n.h)(Object(s.h)((e,{screen:t})=>{let a;const{chats:{byId:n},settings:{privacy:s}}=e;switch(t){case r.n.PrivacyPhoneNumber:a=s.phoneNumber;break;case r.n.PrivacyLastSeen:a=s.lastSeen;break;case r.n.PrivacyProfilePhoto:a=s.profilePhoto;break;case r.n.PrivacyForwarding:a=s.forwards;break;case r.n.PrivacyGroupChats:a=s.chatInvite}return a?{...a,chatsById:n}:{}},(e,t)=>Object(h.l)(t,["setPrivacyVisibility"]))(({screen:e,isActive:t,onScreenSelect:a,onReset:s,visibility:c,allowUserIds:o,allowChatIds:l,blockUserIds:i,blockChatIds:d,chatsById:m,setPrivacyVisibility:u})=>{const h=Object(M.a)(),b=Object(n.p)(()=>{switch(e){case r.n.PrivacyProfilePhoto:case r.n.PrivacyGroupChats:return[{value:"everybody",label:h("P2PEverybody")},{value:"contacts",label:h("P2PContacts")}];default:return[{value:"everybody",label:h("P2PEverybody")},{value:"contacts",label:h("P2PContacts")},{value:"nobody",label:h("P2PNobody")}]}},[h,e]),g={shouldShowDenied:"nobody"!==c,shouldShowAllowed:"everybody"!==c},p=Ra(e),v=Object(n.p)(()=>{switch(e){case r.n.PrivacyPhoneNumber:return h("PrivacyPhoneTitle");case r.n.PrivacyLastSeen:return h("LastSeenTitle");case r.n.PrivacyProfilePhoto:return h("PrivacyProfilePhotoTitle");case r.n.PrivacyForwarding:return h("PrivacyForwardsTitle");case r.n.PrivacyGroupChats:return h("WhoCanAddMe");default:return}},[h,e]);Object(L.a)(t,s,a,e);const O=Object(n.p)(()=>{switch(e){case r.n.PrivacyLastSeen:return h("CustomHelp");default:return}},[h,e]),E=(()=>{switch(e){case r.n.PrivacyPhoneNumber:return r.n.PrivacyPhoneNumberAllowedContacts;case r.n.PrivacyLastSeen:return r.n.PrivacyLastSeenAllowedContacts;case r.n.PrivacyProfilePhoto:return r.n.PrivacyProfilePhotoAllowedContacts;case r.n.PrivacyForwarding:return r.n.PrivacyForwardingAllowedContacts;default:return r.n.PrivacyGroupChatsAllowedContacts}})(),j=(()=>{switch(e){case r.n.PrivacyPhoneNumber:return r.n.PrivacyPhoneNumberDeniedContacts;case r.n.PrivacyLastSeen:return r.n.PrivacyLastSeenDeniedContacts;case r.n.PrivacyProfilePhoto:return r.n.PrivacyProfilePhotoDeniedContacts;case r.n.PrivacyForwarding:return r.n.PrivacyForwardingDeniedContacts;default:return r.n.PrivacyGroupChatsDeniedContacts}})(),f=Object(n.p)(()=>o&&l&&m?l.reduce((e,t)=>e+(m[t]?m[t].membersCount:0),o.length):0,[l,o,m]),C=Object(n.p)(()=>i&&d&&m?d.reduce((e,t)=>e+(m[t]?m[t].membersCount:0),i.length):0,[d,i,m]),y=Object(n.m)(e=>{u({privacyKey:p,visibility:e})},[p,u]);return n.a.createElement("div",{className:"settings-content custom-scroll"},n.a.createElement("div",{className:"settings-item"},n.a.createElement("h4",{className:"settings-item-header",dir:h.isRtl?"rtl":void 0},v),n.a.createElement(qe.a,{name:"visibility-"+p,options:b,onChange:y,selected:c}),O&&n.a.createElement("p",{className:"settings-item-description-larger",dir:h.isRtl?"rtl":void 0},O)),n.a.createElement("div",{className:"settings-item"},n.a.createElement("h4",{className:"settings-item-header mb-4",dir:h.isRtl?"rtl":void 0},h("PrivacyExceptions")),g.shouldShowAllowed&&n.a.createElement(Ee.a,{narrow:!0,icon:"add-user",onClick:()=>{a(E)}},n.a.createElement("div",{className:"multiline-menu-item full-size"},f>0&&n.a.createElement("span",{className:"date",dir:"auto"},"+",f),n.a.createElement("span",{className:"title"},h("AlwaysShareWith")),n.a.createElement("span",{className:"subtitle"},h("EditAdminAddUsers")))),g.shouldShowDenied&&n.a.createElement(Ee.a,{narrow:!0,icon:"delete-user",onClick:()=>{a(j)}},n.a.createElement("div",{className:"multiline-menu-item full-size"},C>0&&n.a.createElement("span",{className:"date",dir:"auto"},"−",C),n.a.createElement("span",{className:"title"},h("NeverShareWith")),n.a.createElement("span",{className:"subtitle"},h("EditAdminAddUsers"))))))}));function Da(e){return[e.region,e.country].filter(Boolean).join(", ")}function Ba(e){return`${e.deviceModel}${e.deviceModel?", ":""} ${e.platform} ${e.systemVersion}`}var Ua=Object(n.h)(Object(s.h)(e=>({activeSessions:e.activeSessions}),(e,t)=>Object(h.l)(t,["loadAuthorizations","terminateAuthorization","terminateAllAuthorizations"]))(({isActive:e,onScreenSelect:t,onReset:a,activeSessions:s,loadAuthorizations:c,terminateAuthorization:o,terminateAllAuthorizations:l})=>{const[i,d,m]=Object(xe.a)();Object(n.n)(()=>{c()},[c]);const u=Object(n.m)(e=>{o({hash:e})},[o]),h=Object(n.m)(()=>{m(),l()},[m,l]),b=Object(n.p)(()=>s.find(e=>e.isCurrent),[s]),g=Object(n.p)(()=>s.filter(e=>!e.isCurrent),[s]),p=Object(M.a)();function v(e){return n.a.createElement(Ee.a,{key:e.hash,ripple:!0,narrow:!0,contextActions:[{title:"Terminate",icon:"stop",handler:()=>{u(e.hash)}}]},n.a.createElement("div",{className:"multiline-menu-item full-size",dir:"auto"},n.a.createElement("span",{className:"date"},Object(B.g)(p,1e3*e.dateActive)),n.a.createElement("span",{className:"title"},e.appName),n.a.createElement("span",{className:"subtitle black tight"},Ba(e)),n.a.createElement("span",{className:"subtitle"},e.ip," - ",Da(e))))}return Object(L.a)(e,a,t,r.n.PrivacyActiveSessions),n.a.createElement("div",{className:"settings-content custom-scroll"},b&&(E=b,n.a.createElement("div",{className:"settings-item"},n.a.createElement("h4",{className:"settings-item-header mb-4",dir:p.isRtl?"rtl":void 0},p("AuthSessions.CurrentSession")),n.a.createElement(Ee.a,{narrow:!0,inactive:!0},n.a.createElement("div",{className:"multiline-menu-item",dir:"auto"},n.a.createElement("span",{className:"title",dir:"auto"},E.appName),n.a.createElement("span",{className:"subtitle black tight"},Ba(E)),n.a.createElement("span",{className:"subtitle"},E.ip," - ",Da(E)))),n.a.createElement(Ee.a,{className:"destructive mb-0",icon:"stop",ripple:!0,narrow:!0,onClick:d},p("TerminateAllSessions")))),g&&(O=g,n.a.createElement("div",{className:"settings-item"},n.a.createElement("h4",{className:"settings-item-header mb-4",dir:p.isRtl?"rtl":void 0},p("OtherSessions")),O.map(v))),g&&n.a.createElement(Pe.a,{isOpen:i,onClose:m,text:"Are you sure you want to terminate all other sessions?",confirmLabel:"Terminate All Other Sessions",confirmHandler:h,confirmIsDestructive:!0}));var O,E}));var xa=Object(n.h)(Object(s.h)(e=>{const{chats:{byId:t},users:{byId:a},blocked:{ids:n}}=e;return{chatsByIds:t,usersByIds:a,blockedIds:n}},(e,t)=>Object(h.l)(t,["unblockContact"]))(({isActive:e,onScreenSelect:t,onReset:a,chatsByIds:s,usersByIds:c,blockedIds:l,unblockContact:i})=>{const d=Object(n.m)(e=>{i({contactId:e})},[i]),m=Object(M.a)();return Object(L.a)(e,a,t,r.n.PrivacyBlockedUsers),n.a.createElement("div",{className:"settings-fab-wrapper"},n.a.createElement("div",{className:"settings-content infinite-scroll"},n.a.createElement("div",{className:"settings-item"},n.a.createElement("p",{className:"settings-item-description-larger mt-0 mb-2",dir:m.isRtl?"rtl":void 0},m("BlockedUsersInfo"))),n.a.createElement("div",{className:"chat-list custom-scroll"},l&&l.length?n.a.createElement("div",{className:"scroll-container"},l.map((e,t)=>function(e,t,a){const r=Object(u.ob)(e),l=r?c[e]:void 0,i=r?void 0:s[e],h=Object(W.a)("Chat chat-item-clickable blocked-list-item",r?"private":"group");return n.a.createElement(Ee.a,{key:e,className:h,ripple:!0,narrow:!0,contextActions:[{title:"Unblock",icon:"unlock",handler:()=>{d(e)}}],style:`top: ${(a+t)*o.k}px;`},n.a.createElement(x.a,{size:"medium",user:l,chat:i}),n.a.createElement("div",{className:"contact-info",dir:"auto"},n.a.createElement("h3",{dir:"auto"},Object(U.a)((r?Object(u.bb)(l):Object(u.k)(m,i))||"")),l&&l.phoneNumber&&n.a.createElement("div",{className:"contact-phone",dir:"auto"},Object(At.c)(l.phoneNumber)),l&&!l.phoneNumber&&l.username&&n.a.createElement("div",{className:"contact-username",dir:"auto"},"@",l.username)))}(e,t,0))):l&&!l.length?n.a.createElement("div",{className:"no-results",dir:"auto"},"List is empty"):n.a.createElement(ge.a,{key:"loading"}))),n.a.createElement(Dt.a,{isShown:!0,onClick:()=>{},className:"not-implemented",ariaLabel:"Add a blocked user"},n.a.createElement("i",{className:"icon-add"})))})),Ga=a(129);var za=Object(n.h)(Object(s.h)(e=>({animatedEmoji:Object(m.c)(e,"🔐")}))(({isActive:e,onReset:t,animatedEmoji:a,onScreenSelect:s})=>{const c=Object(M.a)();return Object(L.a)(e,t,s,r.n.TwoFaEnabled),n.a.createElement("div",{className:"settings-content two-fa custom-scroll"},n.a.createElement("div",{className:"settings-content-header"},n.a.createElement(Ga.a,{sticker:a,size:"large"}),n.a.createElement("p",{className:"settings-item-description mb-3",dir:"auto"},Object(U.a)(c("EnabledPasswordText"),["br"]))),n.a.createElement("div",{className:"settings-item pt-0 no-border"},n.a.createElement(Ee.a,{icon:"edit",onClick:()=>s(r.n.TwoFaChangePasswordCurrent)},c("ChangePassword")),n.a.createElement(Ee.a,{icon:"password-off",onClick:()=>s(r.n.TwoFaTurnOff)},c("TurnPasswordOff")),n.a.createElement(Ee.a,{icon:"email",onClick:()=>s(r.n.TwoFaRecoveryEmailCurrentPassword)},c("SetRecoveryEmail"))))})),qa=a(153),_a=a(154);var Ha=Object(n.h)(({screen:e,isActive:t,onScreenSelect:a,onReset:s,error:c,isLoading:r,expectedPassword:o,placeholder:l="Current Password",hint:i,submitLabel:d,clearError:m,onSubmit:u})=>{const[h,b]=Object(n.r)(""),[g,p]=Object(n.r)(!1),v=Object(n.m)(e=>{o&&e!==o?b("Passwords Should Be Equal"):u(e)},[u,o]),O=Object(n.m)(()=>{m&&m(),b("")},[m]),E=Object(M.a)();return Object(L.a)(t,s,a,e),n.a.createElement("div",{className:"settings-content two-fa custom-scroll"},n.a.createElement("div",{className:"settings-content-header"},n.a.createElement(qa.a,{isBig:!0,isPasswordVisible:g})),n.a.createElement("div",{className:"settings-item pt-0 no-border"},n.a.createElement(_a.a,{error:h||c,hint:i,placeholder:l,submitLabel:d||E("Next"),clearError:O,isLoading:r,isPasswordVisible:g,onChangePasswordVisibility:p,onSubmit:v})))});var $a=Object(n.h)(Object(s.h)(e=>({animatedEmoji:Object(m.c)(e,"🔐")}))(({isActive:e,onScreenSelect:t,onReset:a,animatedEmoji:s,onStart:c})=>{const o=Object(M.a)();return Object(L.a)(e,a,t,r.n.TwoFaDisabled),n.a.createElement("div",{className:"settings-content two-fa custom-scroll"},n.a.createElement("div",{className:"settings-content-header"},n.a.createElement(Ga.a,{sticker:s,size:"large"}),n.a.createElement("p",{className:"settings-item-description mb-3",dir:"auto"},o("SetAdditionalPasswordInfo"))),n.a.createElement("div",{className:"settings-item pt-0 no-border"},n.a.createElement(D.a,{onClick:c},o("EditAdminTransferSetPassword"))))}));const Va=l.l?550:400;var Wa=Object(n.h)(Object(s.h)((e,{icon:t})=>({animatedEmoji:Object(m.c)(e,"email"===t?"💌":"💡")}))(({animatedEmoji:e,type:t="text",isLoading:a,error:s,placeholder:c,shouldConfirm:r,clearError:o,onSubmit:i,isActive:d,onScreenSelect:m,onReset:u,screen:h})=>{const b=Object(n.q)(null),[g,p]=Object(n.r)(""),[v,O,E]=Object(xe.a)(!1);Object(n.n)(()=>{l.n||setTimeout(()=>{b.current.focus()},Va)},[]);const j=Object(M.a)();return Object(L.a)(d,u,m,h),n.a.createElement("div",{className:"settings-content two-fa custom-scroll"},n.a.createElement("div",{className:"settings-content-header"},n.a.createElement(Ga.a,{sticker:e,size:"large"})),n.a.createElement("div",{className:"settings-item pt-0 no-border"},n.a.createElement("form",{action:"",onSubmit:e=>{e.preventDefault(),b.current&&i(g)}},n.a.createElement(ve.a,{ref:b,value:g,inputMode:t,label:c,error:s,onChange:e=>{s&&o&&o(),p(e.target.value)}}),g?n.a.createElement(D.a,{type:"submit",isLoading:a,ripple:!0},j("Continue")):n.a.createElement(D.a,{isText:!0,isLoading:a,ripple:!0,onClick:r?O:()=>{i()}},j("YourEmailSkip"))),r&&n.a.createElement(pe.a,{className:"narrow",isOpen:v,title:j("YourEmailSkipWarning"),onClose:E},Object(U.a)(j("YourEmailSkipWarningText"),["br","simple_markdown"]),n.a.createElement("div",{className:"dialog-buttons"},n.a.createElement(D.a,{color:"danger",ripple:!0,isText:!0,className:"confirm-dialog-button",onClick:()=>{E(),i()}},j("YourEmailSkip")),n.a.createElement(D.a,{color:"primary",ripple:!0,isText:!0,className:"confirm-dialog-button",onClick:E},j("Cancel"))))))}));var Ka=Object(n.h)(Object(s.h)(e=>({animatedEmoji:Object(m.c)(e,"🥳")}))(({isActive:e,onReset:t,animatedEmoji:a,onScreenSelect:s})=>{const c=Object(M.a)();return Object(L.a)(e,t,s,r.n.TwoFaCongratulations),n.a.createElement("div",{className:"settings-content two-fa custom-scroll"},n.a.createElement("div",{className:"settings-content-header"},n.a.createElement(Ga.a,{sticker:a,size:"large"}),n.a.createElement("p",{className:"settings-item-description mb-3",dir:"auto"},c("TwoStepVerificationPasswordSetInfo"))),n.a.createElement("div",{className:"settings-item pt-0 no-border"},n.a.createElement(D.a,{onClick:()=>{s(r.n.Privacy)}},c("TwoStepVerificationPasswordReturnSettings"))))}));const Ya=l.l?550:400;var Qa=Object(n.h)(Object(s.h)(e=>({animatedEmoji:Object(m.c)(e,"💌"),codeLength:e.twoFaSettings.waitingEmailCodeLength}))(({animatedEmoji:e,codeLength:t,isLoading:a,error:s,clearError:c,onSubmit:r,isActive:o,onScreenSelect:i,onReset:d,screen:m})=>{const u=Object(n.q)(null),[h,b]=Object(n.r)("");Object(n.n)(()=>{l.n||setTimeout(()=>{u.current.focus()},Ya)},[]);const g=Object(M.a)();Object(L.a)(o,d,i,m);return n.a.createElement("div",{className:"settings-content two-fa custom-scroll"},n.a.createElement("div",{className:"settings-content-header"},n.a.createElement(Ga.a,{sticker:e,size:"large"})),n.a.createElement("div",{className:"settings-item pt-0 no-border"},n.a.createElement(ve.a,{value:h,ref:u,inputMode:"decimal",label:g("YourEmailCode"),error:s,onChange:e=>{s&&c&&c();const a=e.target.value.slice(0,t);a.length===t&&r(a),b(a),e.target.value=a}}),a&&n.a.createElement(ge.a,null)))}));var Za=Object(n.h)(Object(s.h)(e=>({...e.twoFaSettings}),(e,t)=>Object(h.l)(t,["updatePassword","updateRecoveryEmail","clearPassword","provideTwoFaEmailCode","checkPassword","clearTwoFaError"]))(({currentScreen:e,shownScreen:t,state:a,hint:s,isLoading:c,error:o,waitingEmailCodeLength:l,dispatch:i,isActive:d,onScreenSelect:m,onReset:u,updatePassword:h,checkPassword:b,clearTwoFaError:g,updateRecoveryEmail:p,provideTwoFaEmailCode:v,clearPassword:O})=>{Object(n.n)(()=>{l&&(e===r.n.TwoFaNewPasswordEmail?m(r.n.TwoFaNewPasswordEmailCode):e===r.n.TwoFaRecoveryEmail&&m(r.n.TwoFaRecoveryEmailCode))},[e,m,l]);const E=Object(n.m)(()=>{i({type:"reset"}),m(r.n.TwoFaNewPassword)},[i,m]),j=Object(n.m)(e=>{i({type:"setPassword",payload:e}),m(r.n.TwoFaNewPasswordConfirm)},[i,m]),f=Object(n.m)(()=>{m(r.n.TwoFaNewPasswordHint)},[m]),C=Object(n.m)(e=>{i({type:"setHint",payload:e}),m(r.n.TwoFaNewPasswordEmail)},[i,m]),y=Object(n.m)(e=>{i({type:"setEmail",payload:e}),h({...a,email:e,onSuccess:()=>{m(r.n.TwoFaCongratulations)}})},[i,m,a,h]),k=Object(n.m)(e=>{i({type:"setCurrentPassword",payload:e}),b({currentPassword:e,onSuccess:()=>{m(r.n.TwoFaChangePasswordNew)}})},[b,i,m]),N=Object(n.m)(e=>{i({type:"setPassword",payload:e}),m(r.n.TwoFaChangePasswordConfirm)},[i,m]),w=Object(n.m)(()=>{m(r.n.TwoFaChangePasswordHint)},[m]),S=Object(n.m)(e=>{i({type:"setHint",payload:e}),h({...a,hint:e,onSuccess:()=>{m(r.n.TwoFaCongratulations)}})},[i,m,a,h]),I=Object(n.m)(e=>{O({currentPassword:e,onSuccess:()=>{m(r.n.Privacy)}})},[O,m]),P=Object(n.m)(e=>{i({type:"setCurrentPassword",payload:e}),b({currentPassword:e,onSuccess:()=>{m(r.n.TwoFaRecoveryEmail)}})},[b,i,m]),F=Object(n.m)(e=>{i({type:"setEmail",payload:e}),p({...a,email:e,onSuccess:()=>{m(r.n.TwoFaCongratulations)}})},[i,m,a,p]),L=Object(n.m)(e=>{v({code:e})},[v]),A=Object(M.a)();switch(e){case r.n.TwoFaDisabled:return n.a.createElement($a,{onStart:E,onScreenSelect:m,isActive:d||[r.n.TwoFaNewPassword,r.n.TwoFaNewPasswordConfirm,r.n.TwoFaNewPasswordHint,r.n.TwoFaNewPasswordEmail,r.n.TwoFaNewPasswordEmailCode,r.n.TwoFaCongratulations].includes(t),onReset:u});case r.n.TwoFaNewPassword:return n.a.createElement(Ha,{screen:e,placeholder:A("PleaseEnterPassword"),submitLabel:A("Continue"),onSubmit:j,onScreenSelect:m,isActive:d||[r.n.TwoFaNewPasswordConfirm,r.n.TwoFaNewPasswordHint,r.n.TwoFaNewPasswordEmail,r.n.TwoFaNewPasswordEmailCode,r.n.TwoFaCongratulations].includes(t),onReset:u});case r.n.TwoFaNewPasswordConfirm:return n.a.createElement(Ha,{screen:e,expectedPassword:a.password,placeholder:A("PleaseReEnterPassword"),submitLabel:A("Continue"),onSubmit:f,onScreenSelect:m,isActive:d||[r.n.TwoFaNewPasswordHint,r.n.TwoFaNewPasswordEmail,r.n.TwoFaNewPasswordEmailCode,r.n.TwoFaCongratulations].includes(t),onReset:u});case r.n.TwoFaNewPasswordHint:return n.a.createElement(Wa,{icon:"hint",placeholder:A("PasswordHintPlaceholder"),onSubmit:C,screen:e,onScreenSelect:m,isActive:d||[r.n.TwoFaNewPasswordEmail,r.n.TwoFaNewPasswordEmailCode,r.n.TwoFaCongratulations].includes(t),onReset:u});case r.n.TwoFaNewPasswordEmail:return n.a.createElement(Wa,{icon:"email",type:"email",isLoading:c,error:o,clearError:g,placeholder:A("RecoveryEmailTitle"),shouldConfirm:!0,onSubmit:y,screen:e,onScreenSelect:m,isActive:d||[r.n.TwoFaNewPasswordEmailCode,r.n.TwoFaCongratulations].includes(t),onReset:u});case r.n.TwoFaNewPasswordEmailCode:return n.a.createElement(Qa,{isLoading:c,error:o,clearError:g,onSubmit:L,screen:e,onScreenSelect:m,isActive:d||t===r.n.TwoFaCongratulations,onReset:u});case r.n.TwoFaCongratulations:return n.a.createElement(Ka,{onScreenSelect:m,isActive:d,onReset:u});case r.n.TwoFaEnabled:return n.a.createElement(za,{onScreenSelect:m,isActive:d||[r.n.TwoFaChangePasswordCurrent,r.n.TwoFaChangePasswordNew,r.n.TwoFaChangePasswordConfirm,r.n.TwoFaChangePasswordHint,r.n.TwoFaTurnOff,r.n.TwoFaRecoveryEmailCurrentPassword,r.n.TwoFaRecoveryEmail,r.n.TwoFaRecoveryEmailCode,r.n.TwoFaCongratulations].includes(t),onReset:u});case r.n.TwoFaChangePasswordCurrent:return n.a.createElement(Ha,{screen:e,isLoading:c,error:o,clearError:g,hint:s,onSubmit:k,onScreenSelect:m,isActive:d||[r.n.TwoFaChangePasswordNew,r.n.TwoFaChangePasswordConfirm,r.n.TwoFaChangePasswordHint,r.n.TwoFaCongratulations].includes(t),onReset:u});case r.n.TwoFaChangePasswordNew:return n.a.createElement(Ha,{screen:e,placeholder:A("PleaseEnterNewFirstPassword"),onSubmit:N,onScreenSelect:m,isActive:d||[r.n.TwoFaChangePasswordConfirm,r.n.TwoFaChangePasswordHint,r.n.TwoFaCongratulations].includes(t),onReset:u});case r.n.TwoFaChangePasswordConfirm:return n.a.createElement(Ha,{screen:e,expectedPassword:a.password,placeholder:A("PleaseReEnterPassword"),onSubmit:w,onScreenSelect:m,isActive:d||[r.n.TwoFaChangePasswordHint,r.n.TwoFaCongratulations].includes(t),onReset:u});case r.n.TwoFaChangePasswordHint:return n.a.createElement(Wa,{isLoading:c,error:o,clearError:g,icon:"hint",placeholder:A("PasswordHintPlaceholder"),onSubmit:S,onScreenSelect:m,isActive:d||t===r.n.TwoFaCongratulations,onReset:u,screen:e});case r.n.TwoFaTurnOff:return n.a.createElement(Ha,{isLoading:c,error:o,clearError:g,hint:s,onSubmit:I,onScreenSelect:m,isActive:d,onReset:u,screen:e});case r.n.TwoFaRecoveryEmailCurrentPassword:return n.a.createElement(Ha,{screen:e,isLoading:c,error:o,clearError:g,hint:s,onSubmit:P,onScreenSelect:m,isActive:d||[r.n.TwoFaRecoveryEmail,r.n.TwoFaRecoveryEmailCode,r.n.TwoFaCongratulations].includes(t),onReset:u});case r.n.TwoFaRecoveryEmail:return n.a.createElement(Wa,{screen:e,icon:"email",type:"email",placeholder:A("RecoveryEmailTitle"),onSubmit:F,onScreenSelect:m,isActive:d||[r.n.TwoFaRecoveryEmailCode,r.n.TwoFaCongratulations].includes(t),onReset:u});case r.n.TwoFaRecoveryEmailCode:return n.a.createElement(Qa,{screen:e,isLoading:c,error:o,clearError:g,onSubmit:L,onScreenSelect:m,isActive:d||t===r.n.TwoFaCongratulations,onReset:u});default:return}})),Ja=a(173);function Xa(e,t){const{privacy:a}=e.settings;switch(t){case r.n.PrivacyPhoneNumberAllowedContacts:case r.n.PrivacyPhoneNumberDeniedContacts:return a.phoneNumber;case r.n.PrivacyLastSeenAllowedContacts:case r.n.PrivacyLastSeenDeniedContacts:return a.lastSeen;case r.n.PrivacyProfilePhotoAllowedContacts:case r.n.PrivacyProfilePhotoDeniedContacts:return a.profilePhoto;case r.n.PrivacyForwardingAllowedContacts:case r.n.PrivacyForwardingDeniedContacts:return a.forwards;case r.n.PrivacyGroupChatsDeniedContacts:case r.n.PrivacyGroupChatsAllowedContacts:return a.chatInvite}}var en=Object(n.h)(Object(s.h)((e,{screen:t})=>{const{chats:{byId:a,listIds:n,orderedPinnedIds:s},currentUserId:c}=e;return{currentUserId:c,chatsById:a,listIds:n.active,orderedPinnedIds:s.active,archivedPinnedIds:s.archived,archivedListIds:n.archived,settings:Xa(e,t)}},(e,t)=>Object(h.l)(t,["setPrivacySettings"]))(({currentUserId:e,isAllowList:t,screen:a,settings:s,chatsById:c,listIds:o,orderedPinnedIds:l,archivedListIds:i,archivedPinnedIds:d,setPrivacySettings:m,isActive:h,onScreenSelect:b,onReset:g})=>{const p=Object(M.a)(),v=Object(n.p)(()=>s?t?[...s.allowUserIds,...s.allowChatIds]:[...s.blockUserIds,...s.blockChatIds]:[],[t,s]),[O,E]=Object(n.r)(""),[j,f]=Object(n.r)(!1),[C,y]=Object(n.r)(v),k=Object(n.p)(()=>{const e=o?Object(u.Fb)(c,o,l,"all"):void 0,t=i?Object(u.Fb)(c,i,d,"archived"):void 0;if(e||t)return[...e?[...e.pinnedChats,...e.otherChats]:[],...t?t.otherChats:[]]},[c,o,l,i,d]),N=Object(n.p)(()=>{if(k)return k.filter(t=>(Object(u.ob)(t.id)&&t.id!==e||Object(u.nb)(t))&&(!O||Object(ue.a)(Object(u.k)(p,t),O)||v.includes(t.id))).map(({id:e})=>e)},[k,e,p,O,v]),w=Object(n.m)(e=>{y(e),f(!0)},[]),S=Object(n.m)(()=>{m({privacyKey:Ra(a),isAllowList:Boolean(t),contactsIds:C}),b(r.n.Privacy)},[t,C,b,a,m]);return Object(L.a)(h,g,b,a),n.a.createElement("div",{className:"NewChat-inner step-1"},n.a.createElement(Ja.a,{itemIds:N||[],selectedIds:C,filterValue:O,filterPlaceholder:p(t?"AlwaysShareWithPlaceholder":"NeverShareWithPlaceholder"),searchInputId:"new-group-picker-search",onSelectedIdsChange:w,onFilterChange:E}),n.a.createElement(Dt.a,{isShown:j,onClick:S,ariaLabel:p(t?"AlwaysShareWithTitle":"NeverShareWithTitle")},n.a.createElement("i",{className:"icon-arrow-right"})))}));a(291);const tn=Object.keys(r.n).length/2,an=[r.n.TwoFaDisabled,r.n.TwoFaNewPassword,r.n.TwoFaNewPasswordConfirm,r.n.TwoFaNewPasswordHint,r.n.TwoFaNewPasswordEmail,r.n.TwoFaNewPasswordEmailCode,r.n.TwoFaCongratulations,r.n.TwoFaEnabled,r.n.TwoFaChangePasswordCurrent,r.n.TwoFaChangePasswordNew,r.n.TwoFaChangePasswordConfirm,r.n.TwoFaChangePasswordHint,r.n.TwoFaTurnOff,r.n.TwoFaRecoveryEmailCurrentPassword,r.n.TwoFaRecoveryEmail,r.n.TwoFaRecoveryEmailCode],nn=[r.n.Folders,r.n.FoldersCreateFolder,r.n.FoldersEditFolder,r.n.FoldersEditFolderFromChatList,r.n.FoldersIncludedChats,r.n.FoldersIncludedChatsFromChatList,r.n.FoldersExcludedChats,r.n.FoldersExcludedChatsFromChatList],sn=[r.n.PrivacyBlockedUsers,r.n.PrivacyActiveSessions],cn=[r.n.PrivacyPhoneNumberAllowedContacts,r.n.PrivacyPhoneNumberDeniedContacts],rn=[r.n.PrivacyLastSeenAllowedContacts,r.n.PrivacyLastSeenDeniedContacts],on=[r.n.PrivacyProfilePhotoAllowedContacts,r.n.PrivacyProfilePhotoDeniedContacts],ln=[r.n.PrivacyForwardingAllowedContacts,r.n.PrivacyForwardingDeniedContacts],dn=[r.n.PrivacyGroupChatsAllowedContacts,r.n.PrivacyGroupChatsDeniedContacts];var mn=Object(n.h)(({isActive:e,currentScreen:t,foldersState:a,foldersDispatch:s,onScreenSelect:c,onReset:o,shouldSkipTransition:i})=>{const[d,m]=Object(Pt.a)(Mt,Ft),u=Object(n.m)(()=>{t!==r.n.FoldersCreateFolder&&t!==r.n.FoldersEditFolder&&t!==r.n.FoldersEditFolderFromChatList||setTimeout(()=>{s({type:"reset"})},200),t!==r.n.FoldersIncludedChats&&t!==r.n.FoldersExcludedChats?o():"create"===a.mode?c(r.n.FoldersCreateFolder):c(r.n.FoldersEditFolder)},[a.mode,s,t,o,c]),h=Object(n.m)(()=>{s({type:"saveFilters"}),u()},[s,u]);function b(o,l,i){return n.a.createElement(n.a.Fragment,null,n.a.createElement(Lt,{currentScreen:t,onReset:u,onSaveFilter:h,editedFolderId:a.folderId}),function(o,l){const i={[r.n.PrivacyPhoneNumber]:cn.includes(l),[r.n.PrivacyLastSeen]:rn.includes(l),[r.n.PrivacyProfilePhoto]:on.includes(l),[r.n.PrivacyForwarding]:ln.includes(l),[r.n.PrivacyGroupChats]:dn.includes(l)},h=an.includes(l),b=nn.includes(l),g=sn.includes(l)||h||Object.keys(i).includes(l.toString())||Object.values(i).find(e=>!0===e);switch(t){case r.n.Main:return n.a.createElement(Rt,{onScreenSelect:c,isActive:e,onReset:u});case r.n.EditProfile:return n.a.createElement(qt,{onScreenSelect:c,isActive:e&&o,onReset:u});case r.n.General:return n.a.createElement(ma,{onScreenSelect:c,isActive:o||l===r.n.GeneralChatBackgroundColor||l===r.n.GeneralChatBackground||g||b,onReset:u});case r.n.Notifications:return n.a.createElement(Fa,{onScreenSelect:c,isActive:o,onReset:u});case r.n.Privacy:return n.a.createElement(Ma,{onScreenSelect:c,isActive:o||g||h,onReset:u});case r.n.Language:return n.a.createElement(Aa,{onScreenSelect:c,isActive:o,onReset:u});case r.n.GeneralChatBackground:return n.a.createElement(ka,{onScreenSelect:c,isActive:o||l===r.n.GeneralChatBackgroundColor,onReset:u});case r.n.GeneralChatBackgroundColor:return n.a.createElement(Pa,{onScreenSelect:c,isActive:o,onReset:u});case r.n.PrivacyActiveSessions:return n.a.createElement(Ua,{onScreenSelect:c,isActive:o,onReset:u});case r.n.PrivacyBlockedUsers:return n.a.createElement(xa,{onScreenSelect:c,isActive:o,onReset:u});case r.n.PrivacyPhoneNumber:case r.n.PrivacyLastSeen:case r.n.PrivacyProfilePhoto:case r.n.PrivacyForwarding:case r.n.PrivacyGroupChats:return n.a.createElement(Ta,{screen:t,onScreenSelect:c,isActive:o||i[t],onReset:u});case r.n.PrivacyPhoneNumberAllowedContacts:case r.n.PrivacyLastSeenAllowedContacts:case r.n.PrivacyProfilePhotoAllowedContacts:case r.n.PrivacyForwardingAllowedContacts:case r.n.PrivacyGroupChatsAllowedContacts:return n.a.createElement(en,{isAllowList:!0,screen:t,onScreenSelect:c,isActive:o||i[t],onReset:u});case r.n.PrivacyPhoneNumberDeniedContacts:case r.n.PrivacyLastSeenDeniedContacts:case r.n.PrivacyProfilePhotoDeniedContacts:case r.n.PrivacyForwardingDeniedContacts:case r.n.PrivacyGroupChatsDeniedContacts:return n.a.createElement(en,{screen:t,onScreenSelect:c,isActive:o,onReset:u});case r.n.Folders:case r.n.FoldersCreateFolder:case r.n.FoldersEditFolder:case r.n.FoldersEditFolderFromChatList:case r.n.FoldersIncludedChats:case r.n.FoldersIncludedChatsFromChatList:case r.n.FoldersExcludedChats:case r.n.FoldersExcludedChatsFromChatList:return n.a.createElement(ea,{currentScreen:t,shownScreen:l,state:a,dispatch:s,isActive:o,onScreenSelect:c,onReset:u});case r.n.TwoFaDisabled:case r.n.TwoFaNewPassword:case r.n.TwoFaNewPasswordConfirm:case r.n.TwoFaNewPasswordHint:case r.n.TwoFaNewPasswordEmail:case r.n.TwoFaNewPasswordEmailCode:case r.n.TwoFaCongratulations:case r.n.TwoFaEnabled:case r.n.TwoFaChangePasswordCurrent:case r.n.TwoFaChangePasswordNew:case r.n.TwoFaChangePasswordConfirm:case r.n.TwoFaChangePasswordHint:case r.n.TwoFaTurnOff:case r.n.TwoFaRecoveryEmailCurrentPassword:case r.n.TwoFaRecoveryEmail:case r.n.TwoFaRecoveryEmailCode:return n.a.createElement(Za,{currentScreen:t,state:d,dispatch:m,shownScreen:l,isActive:o,onScreenSelect:c,onReset:u});default:return}}(o,i))}return n.a.createElement(T.a,{id:"Settings",name:i?"none":l.p,activeKey:t,renderCount:tn},b)});const un=Object(V.h)(e=>e(),6e4,!0);var hn=Object(n.h)(Object(s.h)(e=>{const{userIds:t}=e.contactList||{},{byId:a}=e.users;return{usersById:a,contactIds:t,serverTimeOffset:e.serverTimeOffset}},(e,t)=>Object(h.l)(t,["loadContactList","openChat"]))(({isActive:e,onReset:t,filter:a,usersById:s,contactIds:c,loadContactList:r,openChat:o,serverTimeOffset:i})=>{Object(n.n)(()=>{un(()=>{r()})}),Object(L.a)(e,t);const d=Object(n.m)(e=>{o({id:e,shouldReplaceHistory:!0})},[o]),m=Object(n.p)(()=>{if(!c)return;const e=a?c.filter(e=>{const t=s[e];if(!t)return!1;const n=Object(u.bb)(t);return n&&Object(ue.a)(n,a)}):c;return Object(u.Jb)(e,s,void 0,i)},[c,a,s,i]),[h,b]=Object(he.a)(void 0,m,Boolean(a));return n.a.createElement(Oe.a,{items:h,onLoadMore:b,className:"chat-list custom-scroll"},h&&h.length?h.map(e=>n.a.createElement(Ee.a,{key:e,className:"chat-item-clickable",onClick:()=>d(e),ripple:!l.l},n.a.createElement(je.a,{userId:e,forceShowSelf:!0,avatarSize:"large"}))):h&&!h.length?n.a.createElement("p",{className:"no-results",key:"no-results",dir:"auto"},a.length?"No contacts matched your search.":"Contact list is empty."):n.a.createElement(ge.a,{key:"loading"}))}));const bn=Object(V.h)(e=>e(),6e4,!0);var gn=Object(n.h)(Object(s.h)(e=>{const{userIds:t}=e.contactList||{},{byId:a}=e.users,{byId:n}=e.chats,{currentUserId:s}=e,{query:c,fetchingStatus:r,globalResults:o,localResults:l}=e.globalSearch,{userIds:i}=o||{},{userIds:d}=l||{};return{currentUserId:s,usersById:a,chatsById:n,localContactIds:t,searchQuery:c,isSearching:r&&r.chats,globalUserIds:i,localUserIds:d}},(e,t)=>Object(h.l)(t,["loadContactList","setGlobalSearchQuery"]))(({isChannel:e,isActive:t,selectedMemberIds:a,onSelectedMemberIdsChange:s,onNextStep:c,onReset:r,currentUserId:o,usersById:l,chatsById:i,localContactIds:d,searchQuery:m,isSearching:b,localUserIds:g,globalUserIds:p,loadContactList:v,setGlobalSearchQuery:O})=>{Object(n.n)(()=>{bn(()=>{v()})});const E=Object(M.a)();Object(L.a)(t,r);const j=Object(n.m)(e=>{O({query:e})},[O]),f=Object(n.p)(()=>{const e=d?Object(u.Ib)(d.filter(e=>e!==o),i):[];if(!m)return e;const t=e.filter(e=>{const t=l[e];if(!t)return!1;const a=Object(u.bb)(t);return a&&Object(ue.a)(a,m)});return Object(u.Ib)(Object(h.o)([...t,...g||[],...p||[]]).filter(e=>{const t=l[e];return!t||!Object(u.Bb)(t)||t.canBeInvitedToGroup}),i,!1,a)},[d,i,m,g,p,a,o,l]),C=Object(n.m)(()=>{(a.length||e)&&(O({query:""}),c())},[a.length,e,O,c]);return n.a.createElement("div",{className:"NewChat step-1"},n.a.createElement("div",{className:"left-header"},n.a.createElement(D.a,{round:!0,size:"smaller",color:"translucent",onClick:r,ariaLabel:"Return to Chat List"},n.a.createElement("i",{className:"icon-arrow-left"})),n.a.createElement("h3",null,E("GroupAddMembers"))),n.a.createElement("div",{className:"NewChat-inner step-1"},n.a.createElement(Ja.a,{itemIds:f,selectedIds:a,filterValue:m,filterPlaceholder:E("SendMessageTo"),searchInputId:"new-group-picker-search",isLoading:b,onSelectedIdsChange:s,onFilterChange:j}),n.a.createElement(Dt.a,{isShown:Boolean(a.length||e),onClick:C,ariaLabel:e?"Continue To Channel Info":"Continue To Group Info"},n.a.createElement("i",{className:"icon-arrow-right"}))))}));var pn=Object(n.h)(Object(s.h)(e=>{const{progress:t,error:a}=e.chatCreation||{};return{creationProgress:t,creationError:a}},(e,t)=>Object(h.l)(t,["createGroupChat","createChannel"]))(({isChannel:e,isActive:t,memberIds:a,onReset:s,creationProgress:c,creationError:o,createGroupChat:l,createChannel:i})=>{const d=Object(M.a)();Object(L.a)(t,s);const[m,u]=Object(n.r)(""),[h,b]=Object(n.r)(""),[g,p]=Object(n.r)(),[v,O]=Object(n.r)(),E=c===r.a.InProgress,j=Object(n.m)(e=>{const{value:t}=e.currentTarget,a=t.replace(/^\s+/,"");u(a),a!==t&&(e.currentTarget.value=a)},[]),f=Object(n.m)(e=>{b(e.currentTarget.value)},[]),C=Object(n.m)(()=>{m.length?a.length>199?O("Sorry, creating supergroups is not yet supported"):l({title:m,photo:g,memberIds:a}):O("Chat title can't be empty")},[m,a,l,g,"Chat title can't be empty","Sorry, creating supergroups is not yet supported"]),y=Object(n.m)(()=>{m.length?i({title:m,about:h,photo:g,memberIds:a}):O("Channel title can't be empty")},[m,i,h,g,a,"Channel title can't be empty"]);Object(n.n)(()=>{c===r.a.Complete&&s(!0)},[c,s]);const k=o||("Chat title can't be empty"!==v&&"Channel title can't be empty"!==v?v:void 0);return n.a.createElement("div",{className:"NewChat"},n.a.createElement("div",{className:"left-header"},n.a.createElement(D.a,{round:!0,size:"smaller",color:"translucent",onClick:()=>s(),ariaLabel:"Return to member selection"},n.a.createElement("i",{className:"icon-arrow-left"})),n.a.createElement("h3",null,d(e?"NewChannel":"NewGroup"))),n.a.createElement("div",{className:"NewChat-inner step-2"},n.a.createElement(Tt.a,{onChange:p,title:d("AddPhoto")}),n.a.createElement(ve.a,{value:m,onChange:j,label:d(e?"EnterChannelName":"GroupName"),error:"Chat title can't be empty"===v||"Channel title can't be empty"===v?v:void 0}),e&&n.a.createElement(n.a.Fragment,null,n.a.createElement(ve.a,{value:h,onChange:f,label:d("DescriptionOptionalPlaceholder")}),n.a.createElement("p",{className:"note"},d("DescriptionInfo"))),k&&n.a.createElement("p",{className:"error"},k),a.length>0&&n.a.createElement(n.a.Fragment,null,n.a.createElement("h3",{className:"chat-members-heading"},d("GroupInfo.ParticipantCount",a.length,"i")),n.a.createElement("div",{className:"chat-members-list custom-scroll"},a.map(e=>n.a.createElement(Ee.a,{inactive:!0,className:"chat-item-clickable"},n.a.createElement(je.a,{userId:e})))))),n.a.createElement(Dt.a,{isShown:0!==m.length,onClick:e?y:C,disabled:E,ariaLabel:e?d("ChannelIntro.CreateChannel"):"Create Group"},E?n.a.createElement(A.a,{color:"white"}):n.a.createElement("i",{className:"icon-arrow-right"})))}));a(292);const vn=Object.keys(r.d).length/2;var On=Object(n.h)(({isActive:e,isChannel:t=!1,content:a,onContentChange:s,onReset:c})=>{const[o,i]=Object(n.r)([]),d=Object(n.m)(()=>{s(t?r.d.NewChannelStep2:r.d.NewGroupStep2)},[t,s]);return n.a.createElement(T.a,{id:"NewChat",name:l.p,renderCount:vn,activeKey:a},s=>{switch(a){case r.d.NewChannelStep1:case r.d.NewGroupStep1:return n.a.createElement(gn,{isChannel:t,isActive:e,selectedMemberIds:o,onSelectedMemberIdsChange:i,onNextStep:d,onReset:c});case r.d.NewChannelStep2:case r.d.NewGroupStep2:return n.a.createElement(pn,{isChannel:t,isActive:s&&e,memberIds:o,onReset:c});default:return}})}),En=a(198);a(293);var jn=Object(n.h)(({isActive:e,onReset:t,onContentChange:a})=>{const s=Object(M.a)();return Object(L.a)(e,t,a,r.d.Archived),n.a.createElement("div",{className:"ArchivedChats"},n.a.createElement("div",{className:"left-header"},n.a.createElement(D.a,{round:!0,size:"smaller",color:"translucent",onClick:t,ariaLabel:"Return to chat list"},n.a.createElement("i",{className:"icon-arrow-left"})),n.a.createElement("h3",null,s("ArchivedChats"))),n.a.createElement(En.a,{folderType:"archived",isActive:e}))});const fn={Down:!0,ArrowDown:!0,Up:!0,ArrowUp:!0,Left:!0,ArrowLeft:!0,Right:!0,ArrowRight:!0," ":!0,PageUp:!0,PageDown:!0,End:!0,Home:!0,Tab:!0};const Cn=e=>{e.preventDefault()};function yn(e){fn[e.key]&&!function(e){if(!(e&&e instanceof HTMLElement))return!1;const t=e,a=t.tagName.toLowerCase();if("textarea"===a)return!0;if("input"!==a)return!1;const n=t.getAttribute("type");return!!n&&["text","password","number","email","tel","url","search","date","datetime","datetime-local","time","month","week"].indexOf(n.toLowerCase())>-1}(e.target)&&Cn(e)}function kn(){document.addEventListener("wheel",Cn,{passive:!1}),window.ontouchmove=Cn,document.onkeydown=yn}function Nn(){document.removeEventListener("wheel",Cn),window.ontouchmove=null,document.onkeydown=null}var wn=a(57),Sn=a(171);function In(e){return e?"lng_context_copy_selected":"lng_context_copy_text"}var Pn=a(182),Fn=a(55);a(294);var Mn=({isOpen:e,message:t,anchor:a,canSendNow:s,canReschedule:r,canReply:o,canEdit:l,canPin:i,canUnpin:d,canDelete:m,canReport:h,canForward:b,canFaveSticker:g,canUnfaveSticker:p,canCopy:v,canCopyLink:O,canSelect:E,onReply:j,onEdit:f,onPin:C,onUnpin:y,onForward:k,onDelete:N,onReport:w,onFaveSticker:S,onUnfaveSticker:I,onSelect:P,onSend:F,onReschedule:L,onClose:A,onCloseAnimationEnd:R,onCopyLink:T})=>{const D=function(e,t,a){const n=[],s=Object(u.P)(e),r=Object(u.H)(e)||(Object(u.T)(e)?void 0:Object(u.S)(e)),o=Object(u.E)(e,"inline"),l=r&&(o||Object(u.eb)(e))&&Sn.a,i=window.getSelection();if(l&&n.push({label:"lng_context_copy_image",handler:()=>{Promise.resolve(o?wn.b(o,c.ApiMediaFormat.BlobUrl):r.blobUrl).then(Sn.b),t&&t()}}),s){const e=Boolean(i&&i.anchorNode&&i.anchorNode.parentNode&&i.anchorNode.parentNode.closest(".Message .content-inner")&&""!==i.toString().replace(/(?:\r\n|\r|\n)/g,""));n.push({label:In(e),handler:()=>{const a=e&&i?i.toString():s;Object(Sn.c)(a),t&&t()}})}return a&&n.push({label:"lng_context_copy_message_link",handler:()=>{a(),t&&t()}}),n}(t,A,O?T:void 0),B=Object(n.m)(()=>document.querySelector(`.active > .MessageList div[data-message-id="${t.id}"]`),[t.id]),U=Object(n.m)(()=>document.querySelector(".active > .MessageList"),[]),x=Object(n.m)(()=>document.querySelector(".MessageContextMenu .bubble"),[]),{positionX:G,positionY:z,style:q}=Object(Pn.a)(a,B,U,x,10,document.querySelector(".MiddleHeader").offsetHeight),H=Object(M.a)();return n.a.createElement(Fn.a,{isOpen:e,positionX:G,positionY:z,style:q,className:"MessageContextMenu fluid",onClose:A,onCloseAnimationEnd:R},s&&n.a.createElement(_.a,{icon:"send-outline",onClick:F},H("MessageScheduleSend")),r&&n.a.createElement(_.a,{icon:"schedule",onClick:L},H("MessageScheduleEditTime")),o&&n.a.createElement(_.a,{icon:"reply",onClick:j},H("Reply")),l&&n.a.createElement(_.a,{icon:"edit",onClick:f},H("Edit")),g&&n.a.createElement(_.a,{icon:"favorite",onClick:S},H("AddToFavorites")),p&&n.a.createElement(_.a,{icon:"favorite",onClick:I},H("Stickers.RemoveFromFavorites")),v&&D.map(e=>n.a.createElement(_.a,{key:e.label,icon:"copy",onClick:e.handler},H(e.label))),i&&n.a.createElement(_.a,{icon:"pin",onClick:C},H("DialogPin")),d&&n.a.createElement(_.a,{icon:"unpin",onClick:y},H("DialogUnpin")),b&&n.a.createElement(_.a,{icon:"forward",onClick:k},H("Forward")),E&&n.a.createElement(_.a,{icon:"select",onClick:P},H("Common.Select")),h&&n.a.createElement(_.a,{icon:"flag",onClick:w},H("lng_context_report_msg")),m&&n.a.createElement(_.a,{destructive:!0,icon:"delete",onClick:N},H("Delete")))};var Ln=Object(n.h)(Object(s.h)((e,{message:t,messageListType:a})=>{const{threadId:n}=Object(m.z)(e)||{},{noOptions:s,canReply:c,canPin:r,canUnpin:o,canDelete:l,canReport:i,canEdit:d,canForward:u,canFaveSticker:h,canUnfaveSticker:b,canCopy:g,canCopyLink:p,canSelect:v}=n&&Object(m.b)(e,t,n)||{},O="pinned"===a,E="scheduled"===a;return{noOptions:s,canSendNow:E,canReschedule:E,canReply:!O&&!E&&c,canPin:!E&&r,canUnpin:!E&&o,canDelete:l,canReport:i,canEdit:!O&&d,canForward:!E&&u,canFaveSticker:!E&&h,canUnfaveSticker:!E&&b,canCopy:g,canCopyLink:!E&&p,canSelect:v}},(e,t)=>Object(h.l)(t,["setReplyingToId","setEditingId","pinMessage","openForwardMenu","faveSticker","unfaveSticker","toggleMessageSelection","sendScheduledMessages","rescheduleMessage"]))(({isOpen:e,messageListType:t,chatUsername:a,message:s,album:c,anchor:r,onClose:o,onCloseAnimationEnd:l,noOptions:i,canSendNow:d,canReschedule:m,canReply:u,canPin:h,canUnpin:b,canDelete:g,canReport:p,canEdit:v,canForward:O,canFaveSticker:E,canUnfaveSticker:j,canCopy:f,canCopyLink:C,canSelect:y,setReplyingToId:k,setEditingId:N,pinMessage:w,openForwardMenu:S,faveSticker:I,unfaveSticker:P,toggleMessageSelection:F,sendScheduledMessages:M,rescheduleMessage:L})=>{const{transitionClassNames:A}=Object(Y.a)(e,l,void 0,!1),[R,T]=Object(n.r)(!0),[D,U]=Object(n.r)(!1),[x,G]=Object(n.r)(!1),[z,q]=Object(n.r)(!1),[_,H,$]=Object(xe.a)(),V=Object(n.m)(()=>{T(!1),U(!0)},[]),W=Object(n.m)(()=>{T(!1),G(!0)},[]),K=Object(n.m)(()=>{T(!1),o()},[o]),Q=Object(n.m)(()=>{U(!1),o()},[o]),Z=Object(n.m)(()=>{G(!1),o()},[o]),J=Object(n.m)(()=>{q(!1),o()},[o]),X=Object(n.m)(()=>{$(),o()},[$,o]),ee=Object(n.m)(()=>{k({messageId:s.id}),K()},[k,s.id,K]),te=Object(n.m)(()=>{N({messageId:s.id}),K()},[N,s.id,K]),ae=Object(n.m)(()=>{T(!1),q(!0)},[]),ne=Object(n.m)(()=>{w({messageId:s.id,isUnpin:!0}),K()},[w,s.id,K]),se=Object(n.m)(()=>{if(K(),c&&c.messages){const e=c.messages.map(({id:e})=>e);S({fromChatId:s.chatId,messageIds:e})}else S({fromChatId:s.chatId,messageIds:[s.id]})},[S,s,K,c]),ce=Object(n.m)(()=>{K(),I({sticker:s.content.sticker})},[K,s.content.sticker,I]),re=Object(n.m)(()=>{K(),P({sticker:s.content.sticker})},[K,s.content.sticker,P]),oe=Object(n.m)(()=>{const e=c&&c.messages?{messageId:s.id,childMessageIds:c.messages.map(({id:e})=>e),withShift:!1}:{messageId:s.id,withShift:!1};F(e),K()},[K,s.id,F,c]),le=Object(n.m)(()=>{M({chatId:s.chatId,id:s.id}),K()},[K,s.chatId,s.id,M]),ie=Object(n.m)(()=>{T(!1),H()},[H]),de=Object(n.m)(e=>{L({chatId:s.chatId,messageId:s.id,scheduledAt:Math.round(e.getTime()/1e3)})},[s.chatId,s.id,L]),me=Object(n.m)(()=>{Object(Sn.c)(`https://t.me/${a||"c/"+Math.abs(s.chatId)}/${s.id}`),K()},[a,K,s.chatId,s.id]);Object(n.n)(()=>(kn(),Nn),[]);const ue=Object(n.p)(()=>(c?c.messages:[s]).map(({id:e})=>e),[c,s]);if(i)return void K();const he=new Date;return he.setFullYear(he.getFullYear()+1),n.a.createElement("div",{className:["ContextMenuContainer",A].join(" ")},n.a.createElement(Mn,{message:s,isOpen:R,anchor:r,canSendNow:d,canReschedule:m,canReply:u,canDelete:g,canReport:p,canPin:h,canUnpin:b,canEdit:v,canForward:O,canFaveSticker:E,canUnfaveSticker:j,canCopy:f,canCopyLink:C,canSelect:y,onReply:ee,onEdit:te,onPin:ae,onUnpin:ne,onForward:se,onDelete:V,onReport:W,onFaveSticker:ce,onUnfaveSticker:re,onSelect:oe,onSend:le,onReschedule:ie,onClose:K,onCopyLink:me}),n.a.createElement(De,{isOpen:D,isSchedule:"scheduled"===t,onClose:Q,album:c,message:s}),n.a.createElement(_e,{isOpen:x,onClose:Z,messageIds:ue}),n.a.createElement(Be,{isOpen:z,messageId:s.id,chatId:s.chatId,onClose:J}),n.a.createElement(Re,{isOpen:_,withTimePicker:!0,selectedAt:1e3*s.date,maxAt:Object(B.k)(he),isFutureMode:!0,onClose:X,onSubmit:de}))}));a(295);var An=Object(n.h)(Object(s.h)((e,{fromSticker:t})=>({stickerSet:Object(m.zb)(e,t.stickerSetId)}),(e,t)=>Object(h.l)(t,["loadStickers","toggleStickerSet","sendMessage"]))(({isOpen:e,fromSticker:t,stickerSet:a,onClose:s,loadStickers:c,toggleStickerSet:r,sendMessage:l})=>{const i=Object(n.q)(null),d=Object(M.a)(),{observe:m}=Object(ta.a)({rootRef:i,throttleMs:200,isDisabled:!e});Object(n.n)(()=>{if(e){const{stickerSetId:e,stickerSetAccessHash:a}=t;c({stickerSetId:e,stickerSetAccessHash:a})}},[e,t,c]);const u=Object(n.m)(e=>{e={...e,isPreloadedGlobally:!0},l({sticker:e}),s()},[s,l]),h=Object(n.m)(()=>{r({stickerSetId:t.stickerSetId}),s()},[t.stickerSetId,s,r]);return n.a.createElement(pe.a,{className:"StickerSetModal",isOpen:e,onClose:s,hasCloseButton:!0,title:a?Object(U.a)(a.title,["emoji","links"]):d("AccDescrStickerSet")},a&&a.stickers?n.a.createElement(n.a.Fragment,null,n.a.createElement("div",{ref:i,className:"stickers custom-scroll"},a.stickers.map(e=>n.a.createElement(oa.a,{sticker:e,size:o.Kb,observeIntersection:m,onClick:u,clickArg:e}))),n.a.createElement("div",{className:"button-wrapper"},n.a.createElement(D.a,{size:"smaller",fluid:!0,color:a.installedDate?"danger":"primary",onClick:h},d(a.installedDate?"StickerPack.RemoveStickerCount":"StickerPack.AddStickerCount",a.count,"i")))):n.a.createElement(ge.a,null))})),Rn=a(128);a(296);var Tn=Object(n.h)(Object(s.h)((e,{chatId:t})=>{const a=Object(m.g)(e,t);return!a||a.isRestricted?{}:{chat:a,isMuted:Object(u.Hb)(a,Object(m.fb)(e),Object(m.eb)(e)),isPrivate:Object(u.ob)(a.id),canDeleteChat:Object(u.c)(a)}},(e,t)=>Object(h.l)(t,["updateChatMutedState","enterMessageSelectMode","sendBotCommand","restartBot"]))(({chatId:e,isOpen:t,anchor:a,isChannel:s,canStartBot:c,canRestartBot:r,canSubscribe:o,canSearch:i,canMute:d,canSelect:m,canLeave:u,chat:h,isPrivate:b,isMuted:g,canDeleteChat:p,onSubscribeChannel:v,onSearchClick:O,onClose:E,onCloseAnimationEnd:j,updateChatMutedState:f,enterMessageSelectMode:C,sendBotCommand:y,restartBot:k})=>{const[N,w]=Object(n.r)(!0),[S,I]=Object(n.r)(!1),{x:P,y:F}=a;Object(Y.a)(t,j,void 0,!1);const L=Object(n.m)(()=>{w(!1),I(!0)},[]),A=Object(n.m)(()=>{w(!1),E()},[E]),R=Object(n.m)(()=>{I(!1),E()},[E]),T=Object(n.m)(()=>{y({command:"/start"})},[y]),D=Object(n.m)(()=>{k({chatId:e})},[e,k]),B=Object(n.m)(()=>{f({chatId:e,isMuted:!g}),A()},[e,A,g,f]),U=Object(n.m)(()=>{v(),A()},[A,v]),x=Object(n.m)(()=>{O(),A()},[A,O]),G=Object(n.m)(()=>{C(),A()},[A,C]);Object(n.n)(()=>(kn(),Nn),[]);const z=Object(M.a)();return n.a.createElement(Rn.a,null,n.a.createElement("div",{className:"HeaderMenuContainer"},n.a.createElement(Fn.a,{isOpen:N,positionX:"right",style:`left: ${P}px;top: ${F}px;`,onClose:A},l.l&&c&&n.a.createElement(_.a,{icon:"bots",onClick:T},z("BotStart")),l.l&&r&&n.a.createElement(_.a,{icon:"bots",onClick:D},z("BotRestart")),l.l&&o&&n.a.createElement(_.a,{icon:s?"channel":"group",onClick:U},z(s?"Subscribe":"Join Group")),l.l&&i&&n.a.createElement(_.a,{icon:"search",onClick:x},z("Search")),d&&n.a.createElement(_.a,{icon:g?"unmute":"mute",onClick:B},z(g?"ChatsUnmute":"ChatsMute")),m&&n.a.createElement(_.a,{icon:"select",onClick:G},z("ReportSelectMessages")),u&&n.a.createElement(_.a,{destructive:!0,icon:"delete",onClick:L},z(b?"Delete":p?"GroupInfo.DeleteAndExit":s?"LeaveChannel":"Group.LeaveGroup"))),h&&n.a.createElement(Ye.a,{isOpen:S,onClose:R,chat:h})))})),Dn=a(159);a(297);const Bn=Object(V.a)(e=>e(),200,!1);var Un=Object(n.h)(Object(s.h)(e=>{const t=Object(m.s)(e);if(!t)return{};const{query:a,results:n}=Object(m.B)(e)||{},{totalCount:s,foundIds:c}=n||{};return{chat:t,query:a,totalCount:s,foundIds:c,isHistoryCalendarOpen:Boolean(e.historyCalendarSelectedAt)}},(e,t)=>Object(h.l)(t,["setLocalTextSearchQuery","searchTextMessagesLocal","focusMessage","closeLocalTextSearch","openHistoryCalendar"]))(({isActive:e,chat:t,query:a,totalCount:s,foundIds:c,isHistoryCalendarOpen:r,setLocalTextSearchQuery:o,searchTextMessagesLocal:l,focusMessage:i,closeLocalTextSearch:d,openHistoryCalendar:m})=>{const u=Object(n.q)(null),[h,b]=Object(n.r)(0);Object(n.n)(()=>{const{visualViewport:e}=window;if(!e)return;const t=document.getElementById("Main"),a=()=>{const{activeElement:a}=document;if(a&&a===u.current){const{pageTop:a,height:n}=e;t.style.transform=`translateY(${a}px)`,t.style.height=n+"px",document.documentElement.scrollTop=a}else t.style.transform="",t.style.height=""};return e.addEventListener("resize",a),()=>{e.removeEventListener("resize",a)}},[]),Object(n.n)(()=>{t&&c&&c.length?(i({chatId:t.id,messageId:c[c.length-1]}),b(0)):b(-1)},[t,i,c]),Object(n.n)(()=>{Array.from(document.querySelectorAll("input")).forEach(t=>{t.disabled=Boolean(e&&t!==u.current)}),Array.from(document.querySelectorAll("div[contenteditable]")).forEach(t=>{t.contentEditable=e?"false":"true"})},[e]),Object(n.n)(()=>{e||u.current.blur()},[e]),Object(n.o)(()=>{document.querySelector("#MobileSearch input").blur()},[r]);const g=Object(n.m)(e=>{o({query:e}),e.length&&Bn(l)},[l,o]),p=Object(n.m)(()=>{if(t&&c){const e=h+1;i({chatId:t.id,messageId:c[c.length-1-e]}),b(e)}},[t,h,i,c]),v=Object(n.m)(()=>{if(t&&c){const e=h-1;i({chatId:t.id,messageId:c[c.length-1-e]}),b(e)}},[t,h,i,c]);return n.a.createElement("div",{id:"MobileSearch",className:e?"active":""},n.a.createElement("div",{className:"header"},n.a.createElement(D.a,{size:"smaller",round:!0,color:"translucent",onClick:d},n.a.createElement("i",{className:"icon-arrow-left"})),n.a.createElement(Dn.a,{ref:u,value:a,onChange:g})),n.a.createElement("div",{className:"footer"},n.a.createElement("div",{className:"counter"},a?c&&c.length?`${h+1} of ${s}`:c&&!c.length?"No results":"":n.a.createElement(D.a,{round:!0,size:"smaller",color:"translucent",onClick:()=>m({selectedAt:Object(B.k)(Date.now())}),ariaLabel:"Search messages by date"},n.a.createElement("i",{className:"icon-calendar"}))),n.a.createElement(D.a,{round:!0,size:"smaller",color:"translucent",onClick:p,disabled:!c||!c.length||h===c.length-1},n.a.createElement("i",{className:"icon-up"})),n.a.createElement(D.a,{round:!0,size:"smaller",color:"translucent",onClick:v,disabled:!c||!c.length||0===h},n.a.createElement("i",{className:"icon-down"}))))})),xn=a(60),Gn=a(199),zn=a(191),qn=a(187),_n=a(193);function Hn(e,t,a=0,n=!1,s=!1,c=!1){const r=e[c?"scrollLeft":"scrollTop"],o=r+e[c?"offsetWidth":"offsetHeight"],l="string"==typeof t?e.querySelectorAll(t):t,{length:i}=l,d=[];let m=!1;for(let e=0;e=r-a&&u<=o+a:i<=o+a&&u>=r-a)d.push(e),m=!0;else if(m&&!n)break}return{allElements:l,visibleIndexes:d}}var $n=function(e,t,a=!1){const n=e[a?"scrollLeft":"scrollTop"],s=n+e[a?"offsetWidth":"offsetHeight"],c=t[a?"offsetLeft":"offsetTop"],r=c+t[a?"offsetWidth":"offsetHeight"];return c>n&&rs[s.length-1]?"start":"end";Object(Vn.a)(n,c[t],e,10)}}var Kn=a(134);a(298);var Yn=Object(n.h)(({isOpen:e,filter:t,onClose:a,onInsertUserName:s,usersById:c,filteredUsers:r})=>{const o=Object(n.q)(null),{shouldRender:l,transitionClassNames:i}=Object(Y.a)(e,void 0,void 0,!1),d=Object(n.m)(e=>{if(!r)return-1;const t=r.length;return Object(Kn.a)(t,e)},[r]),[m,u]=Object(n.r)(-1),h=Object(n.m)((e,t)=>{t.preventDefault(),u(t=>d(t+e))},[u,d]),b=Object(n.m)((e,t=!1)=>{const a=c&&c[e];a&&s(a,t)},[c,s]),g=Object(n.m)(e=>{if(r&&r.length&&m>-1){const t=r[m];t&&(e.preventDefault(),b(t.id,!0))}},[r,m,b]);Object(n.n)(()=>e?Object(Ge.a)({onEsc:a,onUp:e=>h(-1,e),onDown:e=>h(1,e),onEnter:g,onTab:g}):void 0,[e,a,h,g]),Object(n.n)(()=>{r&&!r.length&&a()},[r,a]),Object(n.n)(()=>{u(0)},[t]),Object(n.n)(()=>{Wn(".chat-item-clickable",m,o)},[m]);const p=Object(f.a)(r&&r.length?r:void 0,l),v=r&&!r.length?p:r;if(!l||v&&!v.length)return;const O=Object(W.a)("MentionTooltip composer-tooltip custom-scroll",i);return n.a.createElement("div",{className:O,ref:o},v&&v.map(({id:e},t)=>n.a.createElement(Ee.a,{key:e,className:"chat-item-clickable scroll-item",onClick:()=>b(e),focus:m===t},n.a.createElement(je.a,{userId:e,avatarSize:"small",withUsername:!0}))))}),Qn=a(192);a(299);var Zn=Object(n.h)(({attachments:e,caption:t,isReady:a,currentUserId:s,groupChatMembers:c,usersById:r,recentEmojis:l,baseEmojiKeywords:i,emojiKeywords:d,addRecentEmoji:m,onCaptionUpdate:u,onSend:h,onFileAppend:b,onClear:p})=>{const v=Object(n.q)(null),O=Object(f.a)(e),E=e.length?e:O,j=Boolean(e.length),[C,y,k]=Object(xe.a)(),N=Boolean(E&&E.every(e=>e.quick)),w=Object(M.a)(),{isMentionTooltipOpen:S,mentionFilter:I,closeMentionTooltip:P,insertMention:F,mentionFilteredUsers:L}=Object(Gn.a)(j,t,u,o.A,c,void 0,s,r),{isEmojiTooltipOpen:A,closeEmojiTooltip:R,filteredEmojis:T,insertEmoji:B}=Object(zn.a)(j,t,l,o.A,u,i,d,!a);Object(n.n)(()=>j?Object(g.a)(p):void 0,[j,p]);const U=Object(n.m)(()=>{j&&h()},[j,h]),x=Object(n.m)(e=>{e.preventDefault(),k();const{dataTransfer:{files:t}}=e;if(t&&t.length){const e=N?Array.from(t).filter(e=>e.type&&o.n.has(e.type)):Array.from(t);b(e,N)}},[N,b,k]);if(!E)return;const G=E.every(e=>e.mimeType.startsWith("image/")),z=E.every(e=>e.mimeType.startsWith("video/"));let q="";return q=w(G?"PreviewSender.SendPhoto":z?"PreviewSender.SendVideo":"PreviewSender.SendFile",E.length,"i"),n.a.createElement(pe.a,{isOpen:j,onClose:p,header:function(){if(E)return n.a.createElement("div",{className:"modal-header-condensed",dir:w.isRtl?"rtl":void 0},n.a.createElement(D.a,{round:!0,color:"translucent",size:"smaller",ariaLabel:"Cancel attachments",onClick:p},n.a.createElement("i",{className:"icon-close"})),n.a.createElement("div",{className:"modal-title"},q),n.a.createElement(D.a,{color:"primary",size:"smaller",className:"modal-action-button",onClick:U},w("Send")))}(),className:"AttachmentModal "+(C?"hovered":"")},n.a.createElement("div",{className:"drop-target",onDragEnter:y,onDrop:x,onDragOver:function(e){e.preventDefault(),e.stopPropagation(),v.current&&window.clearTimeout(v.current)},onDragLeave:e=>{const{relatedTarget:t,target:a}=e;a.matches(".drop-target")&&!t&&(v.current=window.setTimeout(k,150)),a&&a.closest(".AttachmentModal.hovered")||(t&&e.stopPropagation(),k())},"data-attach-description":w("Preview.Dragging.AddItems",10)},N?n.a.createElement("div",{className:"media-wrapper custom-scroll"},E.map(e=>e.mimeType.startsWith("image/")?n.a.createElement("img",{src:e.blobUrl,alt:""}):n.a.createElement("video",{src:e.blobUrl,autoPlay:!0,muted:!0,loop:!0}))):n.a.createElement("div",{className:"document-wrapper custom-scroll"},E.map(e=>n.a.createElement(qn.a,{name:e.filename,extension:Object(xn.d)(e.filename,e.mimeType),previewData:e.previewBlobUrl,size:e.size,smaller:!0}))),n.a.createElement("div",{className:"attachment-caption-wrapper"},n.a.createElement(Yn,{isOpen:S,onClose:P,filter:I,onInsertUserName:F,filteredUsers:L,usersById:r}),n.a.createElement(Qn.a,{isOpen:A,emojis:T,onClose:R,onEmojiSelect:B,addRecentEmoji:m}),n.a.createElement(_n.a,{id:"caption-input-text",isAttachmentModalInput:!0,html:t,editableInputId:o.A,placeholder:w("Caption"),onUpdate:u,onSend:h,shouldSetFocus:j}))))}),Jn=a(142);a(300);var Xn=Object(n.h)(({isOpen:e,onSend:t,onClear:a})=>{const s=Object(n.q)(null),c=Object(n.q)(null),r=Object(n.q)(null),[o,l]=Object(n.r)(""),[i,d]=Object(n.r)([""]),[m,u]=Object(n.r)(!0),[h,b]=Object(n.r)(!1),[p,v]=Object(n.r)(!1),[O,E]=Object(n.r)(),[j,f]=Object(n.r)(),[C,y]=Object(n.r)(!1),k=Object(M.a)(),N=Object(n.m)(t=>{e&&t.current&&t.current.focus()},[e]);Object(n.n)(()=>e?Object(g.a)(a):void 0,[e,a]),Object(n.n)(()=>{e||(l(""),d([""]),u(!0),b(!1),v(!1),E(""),f(""),y(!1))},[e]),Object(n.n)(()=>N(s),[N,e]),Object(n.o)(()=>{const e=r.current;e&&O!==e.innerHTML&&(e.innerHTML=O)},[O]);const w=Object(n.m)((e=[])=>{d([...e,""]),requestAnimationFrame(()=>{const e=c.current;e&&(e.classList.toggle("overflown",e.scrollHeight>320),e.scrollTo({top:e.scrollHeight,behavior:"smooth"}))})},[]),S=Object(n.m)(()=>{if(y(!1),!e)return;const a=o.trim().substring(0,255),n=i.map(e=>e.trim().substring(0,100)).filter(e=>e.length);if(!a||n.length<2)return l(a),n.length?n.length<2?w(n):d(n):w(),void y(!0);if(p&&(!j||!n[Number(j)]))return void y(!0);const s={summary:{question:a,answers:n.map((e,t)=>({text:e.trim(),option:String(t),...String(t)===j&&{correct:!0}})),...!m&&{isPublic:!0},...h&&{multipleChoice:!0},...p&&{quiz:!0}}};if(p){const{text:e,entities:t}=O&&Object(Jn.a)(O.substring(0,200))||{};s.quiz={correctAnswers:[j],...e&&{solution:e},...t&&{solutionEntities:t}}}t(s)},[e,o,i,p,j,m,h,t,w,O]),I=Object(n.m)((e,t)=>{const a=[...i];a[e]=t,a[a.length-1].trim().length&&a.length<10?w(a):d(a)},[i,w]),P=Object(n.m)(e=>{const t=[...i];t.splice(e,1),d(t),requestAnimationFrame(()=>{c.current&&c.current.classList.toggle("overflown",c.current.scrollHeight>320)})},[i]),F=Object(n.m)(e=>{f(e)},[f]),L=Object(n.m)(e=>{u(e.target.checked)},[]),A=Object(n.m)(e=>{b(e.target.checked)},[]),R=Object(n.m)(e=>{v(e.target.checked)},[]),T=Object(n.m)(e=>{13===e.keyCode&&S()},[S]),B=Object(n.m)(()=>{if(C&&!o.trim().length)return k("lng_polls_choose_question")},[C,k,o]),U=Object(n.m)(e=>{const t=i.map(e=>e.trim()).filter(e=>e.length);if(C&&t.length<2&&!i[e].trim().length)return k("lng_polls_choose_answers")},[C,k,i]);function x(){return i.map((e,t)=>n.a.createElement("div",{className:"option-wrapper"},n.a.createElement(ve.a,{label:t!==i.length-1||10===i.length?k("OptionHint"):k("CreatePoll.AddOption"),error:U(t),value:e,onChange:e=>I(t,e.currentTarget.value),onKeyPress:T}),t!==i.length-1&&n.a.createElement(D.a,{className:"option-remove-button",round:!0,color:"translucent",size:"smaller",ariaLabel:k("Delete"),onClick:()=>P(t)},n.a.createElement("i",{className:"icon-close"}))))}return n.a.createElement(pe.a,{isOpen:e,onClose:a,header:n.a.createElement("div",{className:"modal-header-condensed"},n.a.createElement(D.a,{round:!0,color:"translucent",size:"smaller",ariaLabel:"Cancel poll creation",onClick:a},n.a.createElement("i",{className:"icon-close"})),n.a.createElement("div",{className:"modal-title"},k("NewPoll")),n.a.createElement(D.a,{color:"primary",size:"smaller",className:"modal-action-button",onClick:S},k("Create"))),className:"PollModal"},n.a.createElement(ve.a,{ref:s,label:k("AskAQuestion"),value:o,error:B(),onChange:e=>l(e.currentTarget.value),onKeyPress:T}),n.a.createElement("div",{className:"options-divider"}),n.a.createElement("div",{className:"options-list custom-scroll",ref:c},n.a.createElement("h3",{className:"options-header"},k("PollOptions")),C&&function(){const e=i.map(e=>e.trim()).filter(e=>e.length);return p&&(!j||!e[Number(j)])&&n.a.createElement("p",{className:"error"},k("lng_polls_choose_correct"))}(),p?n.a.createElement(qe.a,{name:"correctOption",options:x().map((e,t)=>({value:String(t),label:e,hidden:t===i.length-1})),onChange:F}):x()),n.a.createElement("div",{className:"options-divider"}),n.a.createElement("div",{className:"quiz-mode"},n.a.createElement(Zt.a,{label:k("PollAnonymous"),checked:m,onChange:L}),n.a.createElement(Zt.a,{label:k("PollMultiple"),checked:h,disabled:p,onChange:A}),n.a.createElement(Zt.a,{label:k("PollQuiz"),checked:p,disabled:h,onChange:R}),p&&n.a.createElement(n.a.Fragment,null,n.a.createElement("h3",{className:"options-header"},k("lng_polls_solution_title")),n.a.createElement("div",{ref:r,className:"form-control",contentEditable:!0,dir:"auto",onChange:e=>E(e.currentTarget.innerHTML)}),n.a.createElement("div",{className:"note"},k("CreatePoll.ExplanationInfo")))))});let es;function ts(e,t,a=250,s=!1){const c=Object(n.q)(!1);Object(n.n)(()=>{es&&(clearTimeout(es),es=void 0),!e||l.n||s||(es=window.setTimeout(()=>{c.current||t()},2*a))},[s,e,a,t]);return[Object(n.m)(()=>{c.current=!0},[]),Object(n.m)(()=>{c.current=!1,es&&(clearTimeout(es),es=void 0),es=window.setTimeout(()=>{c.current||t()},a)},[a,t])]}var as=a(66),ns=a(147);a(301);var ss=Object(n.h)(({emoji:e,focus:t,onClick:a})=>{const s=Object(n.m)(t=>{t.preventDefault(),a(e.native,e.id)},[e,a]);return n.a.createElement("div",{className:"EmojiButton "+(t?"focus":""),onMouseDown:s,title:`:${e.names[0]}:`},l.d?e.native:n.a.createElement("img",{src:`./img-apple-64/${e.image}.png`,alt:"",loading:"lazy"}))});var cs=Object(n.h)(({category:e,index:t,allEmojis:a,observeIntersection:s,shouldRender:c,onEmojiSelect:r})=>{const o=Object(n.q)(null);Object(ta.c)(o,s);const{transitionClassNames:d}=Object(Y.a)(c,void 0,void 0,"slow"),m=Object(M.a)(),u=l.l?Math.floor((i.a.get().width-8)/44):9,h=44*Math.ceil(e.emojis.length/u);return n.a.createElement("div",{ref:o,key:e.id,id:"emoji-category-"+t,className:"symbol-set"},n.a.createElement("p",{className:"symbol-set-name",dir:"auto"},m("recent"===e.id?"RecentStickers":"Emoji"+t)),n.a.createElement("div",{className:Object(W.a)("symbol-set-container",d),style:`height: ${h}px;`,dir:m.isRtl?"rtl":void 0},c&&e.emojis.map(e=>{const t=a[e],s="id"in t?t:t[1];return n.a.createElement(ss,{key:s.id,emoji:s,onClick:r})})))});a(302);const rs={recent:"icon-recent",people:"icon-smile",nature:"icon-animals",foods:"icon-eats",activity:"icon-sport",places:"icon-car",objects:"icon-lamp",symbols:"icon-language",flags:"icon-flag"},os=[];let ls,is,ds;var ms=Object(n.h)(Object(s.h)(e=>Object(h.l)(e,["recentEmojis"]))(({className:e,onEmojiSelect:t,recentEmojis:s})=>{const c=Object(n.q)(null),r=Object(n.q)(null),[i,d]=Object(n.r)(),[m,u]=Object(n.r)(),[h,b]=Object(n.r)(0),{observe:g}=Object(ta.a)({rootRef:c,throttleMs:200},e=>{e.forEach(e=>{const{id:t}=e.target;if(!t||!t.startsWith("emoji-category-"))return;const a=Number(t.replace("emoji-category-",""));os[a]=e.isIntersecting});const t=os.map((e,t)=>({index:t,isIntersecting:e})).filter(({isIntersecting:e})=>e);t.length&&b(t[Math.floor(t.length/2)].index)});Object(Ze.a)(r.current,!l.l),Object(n.n)(()=>{if(!i)return;const e=r.current;if(!e)return;const t=42*h-e.offsetWidth/2+21;Object(ns.a)(e,t)},[i,h]);const p=Object(M.a)(),v=Object(n.p)(()=>{if(!i)return Ve.a;const e=[...i];return s&&s.length&&e.unshift({id:"recent",name:p("RecentStickers"),emojis:s}),e},[i,p,s]);Object(n.n)(()=>{setTimeout(()=>{const e=()=>{d(ds.categories),u(ds.emojis)};ds?e():async function(){ls||(ls=a.e(1).then(a.t.bind(null,331,3)),is=(await ls).default,ds=Object(as.b)(is));return ls}().then(e)},200)},[]);const O=Object(n.m)(e=>{b(e);const t=document.getElementById("emoji-category-"+e);Object(Vn.a)(c.current,t,"start",50,800)},[]),E=Object(n.m)((e,a)=>{t(e,a)},[t]),j=Object(mt.a)([],o.eb);const f=Object(W.a)("EmojiPicker",e);return m&&j?n.a.createElement("div",{className:f},n.a.createElement("div",{ref:r,className:"EmojiPicker-header",dir:p.isRtl?"rtl":""},v.map((function(e,t){const a=rs[e.id];return a&&n.a.createElement(D.a,{className:"symbol-set-button "+(t===h?"activated":""),round:!0,faded:!0,color:"translucent",onClick:()=>O(t),ariaLabel:e.name},n.a.createElement("i",{className:a}))}))),n.a.createElement("div",{ref:c,className:Object(W.a)("EmojiPicker-main no-selection",l.n?"no-scrollbar":"custom-scroll")},v.map((e,t)=>n.a.createElement(cs,{category:e,index:t,allEmojis:m,observeIntersection:g,shouldRender:h>=t-1&&h<=t+1,onEmojiSelect:E})))):n.a.createElement("div",{className:f},n.a.createElement(ge.a,null))}));const us=l.l?8:16;var hs=Object(n.h)(({stickerSet:e,loadAndPlay:t,index:a,observeIntersection:s,shouldRender:c,onStickerSelect:r,onStickerUnfave:d})=>{const m=Object(n.q)(null);Object(ta.c)(m,s);const{transitionClassNames:u}=Object(Y.a)(c,void 0,void 0,"slow"),h=l.l?Math.floor((i.a.get().width-8)/(o.Lb+us)):5,b=Math.ceil(e.count/h)*(o.Lb+us);return n.a.createElement("div",{ref:m,key:e.id,id:"sticker-set-"+a,className:"symbol-set"},n.a.createElement("p",{className:"symbol-set-name"},e.title),n.a.createElement("div",{className:Object(W.a)("symbol-set-container",u),style:`height: ${b}px;`},c&&e.stickers&&e.stickers.map(a=>n.a.createElement(oa.a,{key:a.id,sticker:a,size:o.Lb,observeIntersection:s,noAnimate:!t,onClick:r,clickArg:a,onUnfaveClick:"favorite"===e.id?d:void 0}))))});a(303);const bs=[];var gs=Object(n.h)(Object(s.h)(e=>{const{setsById:t,added:a,recent:n,favorite:s}=e.stickers;return{recentStickers:n.stickers,favoriteStickers:s.stickers,stickerSetsById:t,addedSetIds:a.setIds,shouldPlay:e.settings.byKey.shouldLoopStickers}},(e,t)=>Object(h.l)(t,["loadStickerSets","loadRecentStickers","loadFavoriteStickers","loadAddedStickers","addRecentSticker","unfaveSticker"]))(({className:e,loadAndPlay:t,canSendStickers:a,recentStickers:s,favoriteStickers:c,addedSetIds:r,stickerSetsById:i,shouldPlay:d,onStickerSelect:m,loadStickerSets:u,loadRecentStickers:h,loadFavoriteStickers:b,loadAddedStickers:g,addRecentSticker:p,unfaveSticker:v})=>{const O=Object(n.q)(null),E=Object(n.q)(null),[j,f]=Object(n.r)(0),{observe:C}=Object(ta.a)({rootRef:O,throttleMs:200},e=>{e.forEach(e=>{const{id:t}=e.target;if(!t||!t.startsWith("sticker-set-"))return;const a=Number(t.replace("sticker-set-",""));bs[a]=e.isIntersecting});const t=bs.map((e,t)=>({index:t,isIntersecting:e})).filter(({isIntersecting:e})=>e);t.length&&f(t[Math.floor(t.length/2)].index)}),{observe:y}=Object(ta.a)({rootRef:E}),k=Object(M.a)(),N=Boolean(r),w=Object(n.p)(()=>r?[{id:"recent",title:k("RecentStickers"),stickers:s,count:s.length},{id:"favorite",title:k("FavoriteStickers"),stickers:c,count:c.length},...r.map(e=>i[e]).filter(Boolean)]:Ve.a,[r,k,s,c,i]),S=Object(n.p)(()=>N&&0===w.filter(e=>e.stickers&&e.stickers.length).length,[w,N]);Object(n.n)(()=>{t&&(u(),h(),b())},[t,b,h,u]),Object(n.n)(()=>{r&&r.length&&g()},[r,g]),Object(Ze.a)(E.current),Object(n.n)(()=>{if(!N)return;const e=E.current;if(!e)return;const t=52*j-(e.offsetWidth/2-26);Object(ns.a)(e,t)},[N,j]);const I=Object(n.m)(e=>{f(e);const t=document.getElementById("sticker-set-"+e);Object(Vn.a)(O.current,t,"start",void 0,500)},[]),P=Object(n.m)(e=>{m(e),p({sticker:e})},[p,m]),F=Object(n.m)(e=>{v({sticker:e})},[v]),L=Object(mt.a)([],o.Bb);const A=Object(W.a)("StickerPicker",e);return N&&L&&!S&&a?n.a.createElement("div",{className:A},n.a.createElement("div",{ref:E,className:"StickerPicker-header no-selection no-scrollbar"},w.map((function(e,t){const a=e.stickers&&e.stickers[0],s=Object(W.a)("symbol-set-button sticker-set-button",t===j&&"activated");return"recent"===e.id||"favorite"===e.id||e.hasThumbnail||!a?n.a.createElement(D.a,{key:e.id,className:s,ariaLabel:e.title,round:!0,faded:"recent"===e.id||"favorite"===e.id,color:"translucent",onClick:()=>I(t)},"recent"===e.id?n.a.createElement("i",{className:"icon-recent"}):"favorite"===e.id?n.a.createElement("i",{className:"icon-favorite"}):e.isAnimated?n.a.createElement(ca,{stickerSet:e,observeIntersection:y}):n.a.createElement(ra,{stickerSet:e,observeIntersection:y})):n.a.createElement(oa.a,{key:e.id,sticker:a,size:o.Mb,title:e.title,className:s,observeIntersection:y,onClick:I,clickArg:t})}))),n.a.createElement("div",{ref:O,className:Object(W.a)("StickerPicker-main no-selection",l.n?"no-scrollbar":"custom-scroll")},w.map((e,a)=>n.a.createElement(hs,{key:e.id,stickerSet:e,loadAndPlay:Boolean(d&&t),index:a,observeIntersection:C,shouldRender:j>=a-1&&j<=a+1,onStickerSelect:P,onStickerUnfave:F})))):n.a.createElement("div",{className:A},a?S?n.a.createElement("div",{className:"picker-disabled"},"You have no saved Stickers."):n.a.createElement(ge.a,null):n.a.createElement("div",{className:"picker-disabled"},"Sending stickers is not allowed in this chat."))}));a(304);function ps(){return(ps=Object.assign||function(e){for(var t=1;t{const o=Object(n.q)(null),l=Object(n.q)(null),i=e.thumbnail&&!!e.thumbnail.dataUri,d="gif"+e.id,m=Object(ta.b)(o,t)&&!a,u=Object(O.a)(d+"?size=m",!m,c.ApiMediaFormat.BlobUrl),h=Object(fa.a)(e.thumbnail&&e.thumbnail.dataUri,Boolean(u)),b=Object(O.a)(d,!m,c.ApiMediaFormat.BlobUrl),g=Boolean(m&&b),{transitionClassNames:p}=Object(na.a)(i||u||b,"slow"),{isBuffered:v,bufferingHandlers:E}=Object(Q.a)(!0),j=m&&!v;Object(J.a)(l,[g]);const f=Object(n.m)(()=>r({...e,blobUrl:b}),[r,e,b]),C=Object(W.a)("GifButton",e.width&&e.height&&e.width({savedGifs:e.gifs.saved.gifs}),(e,t)=>Object(h.l)(t,["loadSavedGifs"]))(({className:e,loadAndPlay:t,canSendGifs:a,savedGifs:s,onGifSelect:c,loadSavedGifs:r})=>{const i=Object(n.q)(null),{observe:d}=Object(ta.a)({rootRef:i,debounceMs:300});Object(n.n)(()=>{t&&r()},[t,r]);const m=Object(mt.a)([],o.Bb);return n.a.createElement("div",{ref:i,className:Object(W.a)("GifPicker",e,l.n?"no-scrollbar":"custom-scroll")},a?m&&s&&s.length?s.map(e=>n.a.createElement(vs,{key:e.id,gif:e,observeIntersection:d,isDisabled:!t,onClick:c})):m&&s?n.a.createElement("div",{className:"picker-disabled"},"No saved GIFs."):n.a.createElement(ge.a,null):n.a.createElement("div",{className:"picker-disabled"},"Sending GIFs is not allowed in this chat."))}));let Es;!function(e){e[e.Emoji=0]="Emoji",e[e.Stickers=1]="Stickers",e[e.GIFs=2]="GIFs"}(Es||(Es={}));const js=Object.values(Es).filter(e=>"string"==typeof e),fs={[Es.Emoji]:"icon-smile",[Es.Stickers]:"icon-stickers",[Es.GIFs]:"icon-gifs"};var Cs=Object(n.h)(({activeTab:e,onSwitchTab:t,onRemoveSymbol:a,onSearchOpen:s})=>{const c=Object(M.a)();function r(a){return n.a.createElement(D.a,{className:"symbol-tab-button "+(e===a?"activated":""),onClick:()=>t(a),ariaLabel:js[a],round:!0,faded:!0,color:"translucent"},n.a.createElement("i",{className:fs[a]}))}const o=Object(n.m)(()=>{s(e===Es.Stickers?"stickers":"gifs")},[e,s]);return n.a.createElement("div",{className:"SymbolMenu-footer",onClick:function(e){e.stopPropagation()},dir:c.isRtl?"rtl":void 0},e!==Es.Emoji&&n.a.createElement(D.a,{className:"symbol-search-button",ariaLabel:e===Es.Stickers?"Search Stickers":"Search GIFs",round:!0,faded:!0,color:"translucent",onClick:o},n.a.createElement("i",{className:"icon-search"})),r(Es.Emoji),r(Es.Stickers),r(Es.GIFs),e===Es.Emoji&&n.a.createElement(D.a,{className:"symbol-delete-button",onClick:a,ariaLabel:"Remove Symbol",round:!0,faded:!0,color:"translucent"},n.a.createElement("i",{className:"icon-delete-left"})))});a(306);let ys=!1;var ks=Object(n.h)(Object(s.h)(e=>({isLeftColumnShown:e.isLeftColumnShown}))(({isOpen:e,allowedAttachmentOptions:t,isLeftColumnShown:a,onLoad:s,onClose:c,onEmojiSelect:r,onStickerSelect:o,onGifSelect:i,onRemoveSymbol:d,onSearchOpen:m,addRecentEmoji:u})=>{const[h,b]=Object(n.r)(0),[g,p]=Object(n.r)([]),[v,O]=ts(e,c,void 0,l.l),{shouldRender:E,transitionClassNames:j}=Object(Y.a)(e,c,!1,!1);!ys&&e&&(ys=!0),Object(n.n)(()=>{s()},[s]),Object(n.o)(()=>{if(l.l)return e&&(document.body.classList.add("enable-symbol-menu-transforms"),document.body.classList.add("is-symbol-menu-open")),()=>{e&&Object(V.b)(()=>{document.body.classList.remove("is-symbol-menu-open"),setTimeout(()=>{document.body.classList.remove("enable-symbol-menu-transforms")},350)})}},[e]);const f=Object(n.q)(g);f.current=g,Object(n.n)(()=>{f.current.length&&(f.current.forEach(e=>{u({emoji:e})}),p([]))},[e,h,u]);const C=Object(n.m)((e,t)=>{p(e=>[...e,t]),r(e)},[r]),y=Object(n.m)(e=>{c(),m(e)},[c,m]),k=Object(n.m)(e=>{o(e,!0)},[o]),N=Object(M.a)(),{canSendStickers:w,canSendGifs:S}=t;function I(t,a){switch(h){case Es.Emoji:return n.a.createElement(ms,{className:"picker-tab",onEmojiSelect:C});case Es.Stickers:return n.a.createElement(gs,{className:"picker-tab",loadAndPlay:!!w&&(e&&(t||a)),canSendStickers:w,onStickerSelect:k});case Es.GIFs:return n.a.createElement(Os,{className:"picker-tab",loadAndPlay:!!S&&(e&&(t||a)),canSendGifs:S,onGifSelect:i})}}const P=n.a.createElement(n.a.Fragment,null,n.a.createElement("div",{className:"SymbolMenu-main",onClick:function(e){e.stopPropagation()}},ys&&n.a.createElement(T.a,{name:"slide",activeKey:h,renderCount:js.length},I)),l.l&&n.a.createElement(D.a,{round:!0,faded:!0,color:"translucent",ariaLabel:N("Close"),className:"symbol-close-button",size:"tiny",onClick:c},n.a.createElement("i",{className:"icon-close"})),n.a.createElement(Cs,{activeTab:h,onSwitchTab:b,onRemoveSymbol:d,onSearchOpen:y}));if(l.l){if(!E)return;const e=Object(W.a)("SymbolMenu mobile-menu",j,!a&&"middle-column-open");return n.a.createElement(Rn.a,null,n.a.createElement("div",{className:e},P))}return n.a.createElement(Fn.a,{isOpen:e,positionX:"left",positionY:"bottom",onClose:c,className:"SymbolMenu",onCloseAnimationEnd:c,onMouseEnter:l.n?void 0:v,onMouseLeave:l.n?void 0:O,noCloseOnBackdrop:!l.n},P)}));a(307);var Ns=Object(n.h)(({isOpen:e,allowedAttachmentOptions:t,onFileSelect:a,onPollCreate:s,onClose:c})=>{const[r,i]=ts(e,c),d=Object(n.m)((e,t)=>{const{files:n}=e.target;n&&n.length>0&&a(Array.from(n),t)},[a]),m=Object(n.m)(()=>{ha(Array.from(o.n).join(","),e=>d(e,!0))},[d]),u=Object(n.m)(()=>{ha("*",e=>d(e,!1))},[d]),h=Object(M.a)(),{canAttachMedia:b,canAttachPolls:g}=t;return n.a.createElement(Fn.a,{isOpen:e,autoClose:!0,positionX:"right",positionY:"bottom",onClose:c,className:"AttachMenu fluid",onCloseAnimationEnd:c,onMouseEnter:l.n?void 0:r,onMouseLeave:l.n?void 0:i,noCloseOnBackdrop:!l.n},!b&&n.a.createElement(_.a,{className:"media-disabled",disabled:!0},"Posting media content is not allowed in this group."),b&&n.a.createElement(n.a.Fragment,null,n.a.createElement(_.a,{icon:"photo",onClick:m},h("AttachmentMenu.PhotoOrVideo")),n.a.createElement(_.a,{icon:"document",onClick:u},h("AttachDocument"))),g&&n.a.createElement(_.a,{icon:"poll",onClick:s},h("Poll")))});a(308);var ws=Object(n.h)(Object(s.h)(e=>{const{stickers:t}=e.stickers.forEmoji;return{stickers:t}},(e,t)=>Object(h.l)(t,["clearStickersForEmoji"]))(({isOpen:e,onStickerSelect:t,stickers:a,clearStickersForEmoji:s})=>{const c=Object(n.q)(null),{shouldRender:r,transitionClassNames:i}=Object(Y.a)(e,void 0,void 0,!1),d=Object(f.a)(a,!0),m=a||d,{observe:u}=Object(ta.a)({rootRef:c,throttleMs:200});Object(n.n)(()=>e?Object(g.a)(s):void 0,[e,s]);const h=Object(W.a)("StickerTooltip composer-tooltip custom-scroll",i,!(m&&m.length)&&"hidden");return n.a.createElement("div",{ref:c,className:h,onMouseEnter:l.n?void 0:()=>{document.body.classList.add("no-select")},onMouseLeave:l.n?void 0:()=>{document.body.classList.remove("no-select")}},r&&m?m.map(e=>n.a.createElement(oa.a,{key:e.id,sticker:e,size:o.Lb,observeIntersection:u,onClick:t,clickArg:e})):r?n.a.createElement(ge.a,null):void 0)}));a(309);var Ss=Object(n.h)(Object(s.h)((e,{messageId:t})=>{const{chatId:a}=Object(m.z)(e)||{};return a?{message:Object(m.l)(e,a,t)}:{}},(e,t)=>Object(h.l)(t,["clickInlineButton"]))(({isOpen:e,message:t,onClose:a,clickInlineButton:s})=>{const[c,r]=ts(e,a);if(t&&t.keyboardButtons)return n.a.createElement(Fn.a,{isOpen:e,autoClose:!0,positionX:"right",positionY:"bottom",onClose:a,className:"KeyboardMenu",onCloseAnimationEnd:a,onMouseEnter:l.n?void 0:c,onMouseLeave:l.n?void 0:r,noCloseOnBackdrop:!l.n},n.a.createElement("div",{className:"content"},t.keyboardButtons.map(e=>n.a.createElement("div",{className:"row"},e.map(e=>n.a.createElement(D.a,{ripple:!0,disabled:"NOT_SUPPORTED"===e.type,onClick:()=>s({button:e})},e.text))))))}));a(310);var Is=Object(n.h)(({isOpen:e,onSilentSend:t,onScheduleSend:a,onClose:s,onCloseAnimationEnd:c})=>{const[r,o]=ts(e,s),i=Object(M.a)();return n.a.createElement(Fn.a,{isOpen:e,autoClose:!0,positionX:"right",positionY:"bottom",className:"CustomSendMenu",onClose:s,onCloseAnimationEnd:c,onMouseEnter:l.n?void 0:r,onMouseLeave:l.n?void 0:o,noCloseOnBackdrop:!l.n},t&&n.a.createElement(_.a,{icon:"mute",onClick:t},i("SendWithoutSound")),a&&n.a.createElement(_.a,{icon:"schedule",onClick:a},i("ScheduleMessage")))}),Ps=a(143),Fs=a(170),Ms=a(183);a(311);var Ls=Object(n.h)(({isOpen:e,emojis:t,onClose:a,onEmojiSelect:s,addRecentEmoji:c})=>{const r=Object(n.q)(null),{shouldRender:o,transitionClassNames:i}=Object(Y.a)(e,void 0,void 0,!1),d=Object(Ms.a)(t.length?t:void 0,350)||[],[m,u]=Object(n.r)(-1);Object(n.n)(()=>{u(0)},[t]),Object(n.n)(()=>{!function(e,t){const a=t.current;if(!a)return;const{visibleIndexes:n,allElements:s}=Hn(a,".EmojiButton",8,!0,!0,!0);if(!s.length||!s[e])return;const c=n[0];if(!n.includes(e)||e===c&&!$n(a,s[c],!0)){const t="start"===(e>n[n.length-1]?"start":"end")?44*e:0;Object(ns.a)(a,t)}}(m,r)},[m]);const h=Object(n.m)(e=>{if(!t.length)return-1;const a=t.length;return Object(Kn.a)(a,e)},[t]),b=Object(n.m)((e,t)=>{t.preventDefault(),u(t=>h(t+e))},[u,h]),g=Object(n.m)(e=>{if(t.length&&m>-1){const a=t[m];a&&(e.preventDefault(),s(a.native),c({emoji:a.id}))}},[c,t,s,m]),p=Object(n.m)((e,t)=>{s(e),c({emoji:t})},[c,s]);Object(n.n)(()=>e?Object(Ge.a)({onEsc:a,onLeft:e=>b(-1,e),onRight:e=>b(1,e),onEnter:g}):void 0,[b,g,e,a]);const v=Object(W.a)("EmojiTooltip composer-tooltip custom-scroll-x",i);return n.a.createElement("div",{ref:r,className:v,onMouseEnter:l.n?void 0:()=>{document.body.classList.add("no-select")},onMouseLeave:l.n?void 0:()=>{document.body.classList.remove("no-select")}},o&&d?d.map((e,t)=>n.a.createElement(ss,{key:e.id,emoji:e,focus:m===t,onClick:p})):o?n.a.createElement(ge.a,null):void 0)});a(312);var As=Object(n.h)(({title:e,description:t,thumbnail:a,thumbUrl:s,focus:c,transitionClassNames:r="",onClick:o})=>{let l="";const i=Object(O.a)(a?"webDocument:"+a.url:void 0);return(s=s||i)?l=n.a.createElement("img",{src:s,className:r,alt:"",decoding:"async",draggable:"false"}):e&&(l=Object(sa.c)(e,1)),n.a.createElement(Ee.a,{focus:c,className:"BaseResult chat-item-clickable",onClick:o},n.a.createElement("span",{className:"thumb"},"string"==typeof l?Object(U.a)(l):l),n.a.createElement("div",{className:"content-inner"},e&&n.a.createElement("div",{className:"title"},e),t&&n.a.createElement("div",{className:"description"},t)))});a(313);var Rs=Object(n.h)(({focus:e,isForGallery:t,inlineResult:a,onClick:s})=>{let c,r,o;"photo"in a&&(c=a.photo),"thumbnail"in a&&(r=a.thumbnail),"webThumbnail"in a&&t&&(o=a.webThumbnail);const l=Object(O.a)(o?"webDocument:"+o.url:void 0),i=Object(O.a)(c&&`photo${c.id}?size=m`),{shouldRenderThumb:d,shouldRenderFullMedia:m,transitionClassNames:u}=Object(na.a)(i,"slow"),h=Object(n.m)(()=>{s(a)},[a,s]);if(t)return n.a.createElement("div",{className:"MediaResult chat-item-clickable",onClick:h},d&&n.a.createElement("img",{src:c&&c.thumbnail&&c.thumbnail.dataUri||l,alt:""}),m&&n.a.createElement("img",{src:i,className:u+" full-media",alt:""}));const{title:b,description:g}=a;return n.a.createElement(As,{focus:e,thumbUrl:m?i:r&&r.dataUri||l,transitionClassNames:m?u:void 0,title:b,description:g,onClick:h})});var Ts=Object(n.h)(({focus:e,inlineResult:t,onClick:a})=>{const{title:s,url:c,description:r,webThumbnail:o}=t,l=Object(n.m)(()=>{a(t)},[t,a]);return n.a.createElement(As,{focus:e,thumbnail:o,title:s||c,description:r,onClick:l})});var Ds=Object(n.h)(({inlineResult:e,observeIntersection:t,onClick:a})=>{const{gif:s}=e,c=Object(n.m)(()=>{a(e)},[e,a]);if(s)return n.a.createElement(vs,{gif:s,observeIntersection:t,className:"chat-item-clickable",onClick:c})});var Bs=Object(n.h)(({inlineResult:e,observeIntersection:t,onClick:a})=>{const{sticker:s}=e;if(s)return n.a.createElement(oa.a,{sticker:s,size:o.Hb,observeIntersection:t,title:s.emoji,className:"chat-item-clickable",onClick:a,clickArg:e})});a(314);const Us=Object(V.h)(e=>e(),500,!0);var xs=Object(n.h)(Object(s.h)(void 0,(e,t)=>Object(h.l)(t,["sendBotCommand","openChat","sendInlineBotResult"]))(({isOpen:e,botId:t,isGallery:a,inlineBotResults:s,switchPm:c,loadMore:o,onClose:i,openChat:d,sendBotCommand:m,onSelectResult:u})=>{const h=Object(n.q)(null),{shouldRender:b,transitionClassNames:g}=Object(Y.a)(e,void 0,void 0,!1),[p,v]=Object(n.r)(-1),{observe:O}=Object(ta.a)({rootRef:h,debounceMs:200,isDisabled:!e});Object(n.n)(()=>{v(a?-1:0)},[s,a]),Object(n.n)(()=>{Wn(".chat-item-clickable",p,h)},[p]);const E=Object(n.m)(e=>s&&s.length?Object(Kn.a)(s.length,e):-1,[s]),j=Object(n.m)((e,t)=>{a||(t.preventDefault(),v(t=>E(t+e)))},[a,E]),C=Object(n.m)(e=>{if(s&&s.length&&p>-1){const t=s[p];t&&(e.preventDefault(),u(t))}},[s,u,p]),y=Object(n.m)(({direction:e})=>{e===r.e.Backwards&&Us(o)},[o]);Object(n.n)(()=>e?Object(Ge.a)({onEsc:i,onUp:e=>j(-1,e),onDown:e=>j(1,e),onEnter:C}):void 0,[j,C,a,e,i]);const k=Object(n.m)(()=>{d({id:t}),m({chatId:t,command:"/start "+c.startParam})},[t,d,m,c]),N=Object(f.a)(s&&s.length?s:void 0,b),w=s&&!s.length?N:s;if(!b||!w||!w.length&&!c)return;const S=Object(W.a)("InlineBotTooltip composer-tooltip",l.n?"no-scrollbar":"custom-scroll",a&&"gallery",g);return n.a.createElement(Oe.a,{ref:h,className:S,items:w,itemSelector:".chat-item-clickable",noFastList:!0,onLoadMore:y,sensitiveArea:160},c&&n.a.createElement(Ee.a,{ripple:!0,className:"switch-pm scroll-item",onClick:k},n.a.createElement("span",{className:"title"},c.text)),w.map((e,t)=>{switch(e.type){case"gif":return n.a.createElement(Ds,{key:e.id,inlineResult:e,observeIntersection:O,onClick:u});case"photo":return n.a.createElement(Rs,{key:e.id,isForGallery:a,inlineResult:e,onClick:u});case"sticker":return n.a.createElement(Bs,{key:e.id,inlineResult:e,observeIntersection:O,onClick:u});case"video":case"game":return n.a.createElement(Rs,{key:e.id,focus:p===t,inlineResult:e,onClick:u});case"article":case"audio":return n.a.createElement(Ts,{key:e.id,focus:p===t,inlineResult:e,onClick:u});default:return}}))})),Gs=a(180);a(315);var zs=Object(n.h)(Object(s.h)((e,{chatId:t})=>{const a=Object(m.g)(e,t),n=a&&Object(m.n)(e,a.id);if(!a||!n)return{};const{query:s,results:c}=Object(m.B)(e)||{},{totalCount:r,foundIds:o}=c||{};return{chat:a,messagesById:n,query:s,totalCount:r,foundIds:o}},(e,t)=>Object(h.l)(t,["searchTextMessagesLocal","focusMessage"]))(({chatId:e,threadId:t,onClose:a,isActive:c,chat:r,messagesById:o,query:l,totalCount:i,foundIds:d,searchTextMessagesLocal:b,focusMessage:g})=>{const p=Object(M.a)(),v=Object(n.p)(()=>{if(!(l&&d&&d.length&&o))return Ve.a;const a=d.map(a=>{const n=o[a];if(!n)return;const c=n.senderId?Object(m.Jb)(Object(s.e)(),n.senderId):void 0;let l;if(r&&Object(u.mb)(r))l=r;else if(n.forwardInfo){const{isChannelPost:e,fromChatId:t}=n.forwardInfo;l=e&&t?Object(m.g)(Object(s.e)(),t):void 0}else l=n.senderId?Object(m.g)(Object(s.e)(),n.senderId):void 0;return{message:n,senderUser:c,senderChat:l,onClick:()=>g({chatId:e,threadId:t,messageId:a})}}).filter(Boolean);return Object(h.k)(a,({message:e})=>e.date,"desc")},[e,t,g,d,r,o,l]);Object(L.a)(c,a);const O=Object(n.q)(null),E=Object(be.a)(O,!0,e=>{const t=v&&v[-1===e?0:e];t&&t.onClick()},".ListItem-button",!0);return n.a.createElement(Oe.a,{className:"RightSearch custom-scroll",items:v,preloadBackwards:0,onLoadMore:b,noFastList:!0,onKeyDown:E,ref:O},n.a.createElement("p",{className:"helper-text",dir:"auto"},l?0!==i&&v.length?1===i?"1 message found":(v.length&&(i||v.length))+" messages found":p("lng_search_no_results"):p("lng_dlg_search_for_messages")),v.map(({message:e,senderUser:t,senderChat:a,onClick:s})=>{const c=a?Object(u.k)(p,a):Object(u.bb)(t),r=Object(u.O)(p,e);return n.a.createElement(Ee.a,{className:"chat-item-clickable search-result-message m-0",onClick:s},n.a.createElement(x.a,{chat:a,user:t}),n.a.createElement("div",{className:"info"},n.a.createElement("div",{className:"title"},n.a.createElement("h3",{dir:"auto"},c&&Object(U.a)(c)),n.a.createElement(Gs.a,{message:e})),n.a.createElement("div",{className:"subtitle",dir:"auto"},Object(U.a)(r,["emoji","highlight"],{highlight:l}))))}))})),qs=a(52);var _s=Object(n.h)(Object(s.h)((e,{stickerSetId:t})=>({set:Object(m.zb)(e,t),shouldPlay:Object(m.yb)(e)}),(e,t)=>Object(h.l)(t,["loadStickers","toggleStickerSet"]))(({stickerSetId:e,observeIntersection:t,set:a,shouldPlay:s,loadStickers:c,toggleStickerSet:r,isSomeModalOpen:l,onModalToggle:i})=>{const d=Object(M.a)(),m=a&&Boolean(a.installedDate),u=Boolean(a&&a.stickers),[h,b,g]=Object(xe.a)();Object(qs.a)(()=>{i(h)},[h,i]);const p=Object(n.p)(()=>{if(!a)return[];const e=(a.covers||[]).map(({id:e})=>e),t=a.stickers?a.stickers.filter(({id:t})=>!e.includes(t)):[];return[...a.covers||[],...t].slice(0,5)},[a]);Object(n.n)(()=>{!u&&p.length<5&&c({stickerSetId:e})},[u,p.length,c,e]);const v=Object(n.m)(()=>{r({stickerSetId:e})},[r,e]);if(!a)return;const O=p.length>0;return n.a.createElement("div",{key:a.id,className:"sticker-set",dir:d.isRtl?"rtl":void 0},n.a.createElement("div",{className:"sticker-set-header"},n.a.createElement("div",{className:"title-wrapper"},n.a.createElement("h3",{className:"title",dir:"auto"},a.title),n.a.createElement("p",{className:"count",dir:"auto"},d("Stickers",a.count,"i"))),n.a.createElement(D.a,{className:m?"is-added":void 0,color:"primary",size:"tiny",pill:!0,fluid:!0,onClick:v},d(m?"Stickers.Installed":"Stickers.Install"))),n.a.createElement("div",{className:"sticker-set-main"},!O&&n.a.createElement(A.a,null),O&&p.map(e=>n.a.createElement(oa.a,{sticker:e,size:o.Nb,observeIntersection:t,noAnimate:!s||h||l,onClick:b}))),O&&n.a.createElement(ia.a,{isOpen:h,fromSticker:p[0],onClose:g}))}));a(316);const Hs=Object(V.h)(e=>e(),6e4,!0);var $s=Object(n.h)(Object(s.h)(e=>{const t=Object(m.A)(e),{query:a,resultIds:n}=t||{},{featured:s}=e.stickers;return{query:a,featuredIds:s.setIds,resultIds:n}},(e,t)=>Object(h.l)(t,["loadFeaturedStickers"]))(({onClose:e,isActive:t,query:a,featuredIds:s,resultIds:c,loadFeaturedStickers:r})=>{const o=Object(n.q)(null),l=Object(M.a)(),[i,d]=Object(n.r)(!1),{observe:m}=Object(ta.a)({rootRef:o,throttleMs:200});return Object(n.n)(()=>{Hs(()=>{r()})}),Object(L.a)(t,e),n.a.createElement("div",{ref:o,className:"StickerSearch custom-scroll",dir:l.isRtl?"rtl":void 0},function(){if(void 0!==a)return!a&&s?s.map(e=>n.a.createElement(_s,{key:e,stickerSetId:e,observeIntersection:m,isSomeModalOpen:i,onModalToggle:d})):c?c.length?c.map(e=>n.a.createElement(_s,{key:e,stickerSetId:e,observeIntersection:m,isSomeModalOpen:i,onModalToggle:d})):n.a.createElement("p",{className:"helper-text",dir:"auto"},"Nothing found."):n.a.createElement(ge.a,null)}())}));a(317);var Vs=Object(n.h)(Object(s.h)(e=>{const t=Object(m.t)(e),{query:a,results:n}=t||{},{chatId:s}=Object(m.z)(e)||{},c=s?Object(m.g)(e,s):void 0;return{query:a,results:n,chat:c,isChatWithBot:c?Object(m.O)(e,c):void 0}},(e,t)=>Object(h.l)(t,["searchMoreGifs","sendMessage","setGifSearchQuery"]))(({onClose:e,isActive:t,query:a,results:s,chat:c,isChatWithBot:r,searchMoreGifs:o,sendMessage:i,setGifSearchQuery:d})=>{const m=Object(n.q)(null),{observe:h}=Object(ta.a)({rootRef:m,debounceMs:300}),{canSendGifs:b}=Object(u.b)(c,r),g=Object(n.m)(e=>{b&&i({gif:e}),l.n&&d({query:void 0})},[b,i,d]),p=Object(M.a)();Object(L.a)(t,e);const v=Boolean(void 0!==a&&s&&s.length);return n.a.createElement("div",{className:"GifSearch",dir:p.isRtl?"rtl":void 0},n.a.createElement(Oe.a,{ref:m,className:Object(W.a)("gif-container custom-scroll",v&&"grid"),items:s,itemSelector:".GifButton",preloadBackwards:96,noFastList:!0,onLoadMore:o},function(){if(void 0!==a)return s?s.length?s.map(e=>n.a.createElement(vs,{key:e.id,gif:e,observeIntersection:h,onClick:g})):n.a.createElement("p",{className:"helper-text",dir:"auto"},p("NoGIFsFound")):n.a.createElement(ge.a,null)}()))}));a(318);var Ws=Object(n.h)(Object(s.h)((e,{answer:t})=>{const{voters:a,offsets:n}=e.pollResults;return{voters:a&&a[t.option],offset:n&&n[t.option]||""}},(e,t)=>Object(h.l)(t,["loadPollOptionResults","openChat","closePollResults"]))(({chat:e,message:t,answer:a,answerVote:s,totalVoters:c,voters:r,offset:o,loadPollOptionResults:l,openChat:i,closePollResults:d})=>{const m=Object(f.a)(s.votersCount),[u,h]=Object(n.r)(!0),b=Boolean(r),{option:g,text:p}=a,v=Object(M.a)();Object(n.n)(()=>{b&&m===s.votersCount||l({chat:e,messageId:t.id,option:g,offset:o,limit:4,shouldResetVoters:!0})},[s.votersCount,b]);const O=Object(n.m)(()=>{h(!0),l({chat:e,messageId:t.id,option:g,offset:o,limit:50})},[e,l,t.id,o,g]);Object(n.n)(()=>{h(!1)},[r]);const E=Object(n.m)(e=>{i({id:e}),d()},[d,i]);return n.a.createElement("div",{className:"PollAnswerResults"},n.a.createElement("div",{className:"poll-voters"},r?r.map(e=>n.a.createElement(Ee.a,{key:e,className:"chat-item-clickable",onClick:()=>E(e)},n.a.createElement(je.a,{avatarSize:"tiny",userId:e,forceShowSelf:!0,noStatusOrTyping:!0}))):n.a.createElement(ge.a,null),r&&function(){const e=s.votersCount-r.length;return s.votersCount>4&&e>0&&n.a.createElement(Kt,{count:e,itemName:"voter",isLoading:u,onClick:O})}()),n.a.createElement("div",{className:"answer-head",dir:v.isRtl?"rtl":void 0},n.a.createElement("span",{className:"answer-title",dir:"auto"},p),n.a.createElement("span",{className:"answer-percent",dir:v.isRtl?"auto":void 0},(j=s.votersCount,(C=c)>0?(j/C*100).toFixed():0),"%")));var j,C}));a(319);var Ks=Object(n.h)(Object(s.h)(e=>{const{pollResults:{chatId:t,messageId:a},lastSyncTime:n}=e;if(!t||!a)return{};return{chat:Object(m.g)(e,t),message:Object(m.l)(e,t,a),lastSyncTime:n}})(({onClose:e,isActive:t,chat:a,message:s,lastSyncTime:c})=>{const r=Object(M.a)();if(Object(L.a)(t,e),!s||!a)return n.a.createElement(ge.a,null);const{summary:o,results:l}=Object(u.I)(s);if(!l.results)return;const i=Object(h.c)(l.results,"option");return n.a.createElement("div",{className:"PollResults",dir:r.isRtl?"rtl":void 0},n.a.createElement("h3",{className:"poll-question",dir:"auto"},o.question),n.a.createElement("div",{className:"poll-results-list custom-scroll"},c&&o.answers.map(e=>n.a.createElement(Ws,{key:`${s.id}-${e.option}`,chat:a,message:s,answer:e,answerVote:i[e.option],totalVoters:l.totalVoters})),!c&&n.a.createElement(ge.a,null)))}));a(174);var Ys=Object(n.h)(Object(s.h)((e,{userId:t})=>{const a=Object(m.Jb)(e,t),n=Object(m.g)(e,t),{progress:s}=e.management;return{user:a,chat:n,progress:s,isMuted:Object(u.Hb)(n,Object(m.fb)(e),Object(m.eb)(e))}},(e,t)=>Object(h.l)(t,["updateContact","deleteUser","closeManagement","openChat","deleteHistory"]))(({userId:e,user:t,chat:a,progress:s,isMuted:c,updateContact:o,deleteUser:l,deleteHistory:i,closeManagement:d,openChat:m,onClose:u,isActive:h})=>{const[b,g,p]=Object(xe.a)(),[v,O]=Object(n.r)(!1),[E,j]=Object(n.r)(),f=Object(M.a)();Object(L.a)(h,u);const C=t&&t.firstName||"",y=t&&t.lastName||"",[k,N]=Object(n.r)(C),[w,S]=Object(n.r)(y),[I,P]=Object(n.r)(!c);Object(n.n)(()=>{P(!c)},[c]),Object(n.n)(()=>{O(!1),p()},[p,e]),Object(n.n)(()=>{N(C),S(y)},[C,y,t]),Object(n.n)(()=>{s===r.f.Complete&&(O(!1),j(void 0),p())},[p,s]);const F=Object(n.m)(e=>{N(e.target.value),O(!0)},[]),R=Object(n.m)(e=>{S(e.target.value),O(!0)},[]),T=Object(n.m)(e=>{P(e.target.checked),O(!0)},[]),D=Object(n.m)(()=>{const t=k.trim(),a=w.trim();t.length||j("Please provide first name"),o({userId:e,isMuted:!I,firstName:t,lastName:a})},[k,w,o,e,I]),B=Object(n.m)(()=>{i({chatId:a.id,shouldDeleteForAll:!1}),l({userId:e}),p(),d(),m({id:void 0})},[a.id,p,d,i,l,m,e]);if(!t)return;const U=s===r.f.InProgress;return n.a.createElement("div",{className:"Management"},n.a.createElement("div",{className:"custom-scroll"},n.a.createElement("div",{className:"section"},n.a.createElement(je.a,{userId:t.id,avatarSize:"jumbo",status:"original name",withFullInfo:!0}),n.a.createElement(ve.a,{id:"user-first-name",label:f("UserInfo.FirstNamePlaceholder"),onChange:F,value:k,error:"Please provide first name"===E?E:void 0}),n.a.createElement(ve.a,{id:"user-last-name",label:f("UserInfo.LastNamePlaceholder"),onChange:R,value:w}),n.a.createElement("div",{className:"ListItem no-selection narrow"},n.a.createElement(Zt.a,{checked:I,label:f("Notifications"),subLabel:f(I?"UserInfo.NotificationsEnabled":"UserInfo.NotificationsDisabled"),onChange:T}))),n.a.createElement("div",{className:"section"},n.a.createElement(Ee.a,{icon:"delete",ripple:!0,destructive:!0,onClick:g},f("DeleteContact")))),n.a.createElement(Dt.a,{isShown:v,onClick:D,disabled:U,ariaLabel:f("Save")},U?n.a.createElement(A.a,{color:"white"}):n.a.createElement("i",{className:"icon-check"})),n.a.createElement(Pe.a,{isOpen:b,onClose:p,text:f("AreYouSureDeleteContact"),confirmLabel:f("DeleteContact"),confirmHandler:B,confirmIsDestructive:!0}))}));var Qs=Object(n.h)(Object(s.h)((e,{chatId:t})=>{const a=Object(m.g)(e,t),{progress:n}=e.management,s=Boolean(a.fullInfo&&a.fullInfo.linkedChatId),c=Object(u.lb)(a);return{chat:a,progress:n,isBasicGroup:c,hasLinkedChannel:s,canChangeInfo:c?a.isCreator:Object(u.p)(a,"changeInfo"),canBanUsers:c?a.isCreator:Object(u.p)(a,"banUsers")}},(e,t)=>Object(h.l)(t,["togglePreHistoryHidden","updateChat","closeManagement","leaveChannel","deleteChannel","deleteChat","openChat"]))(({chatId:e,chat:t,progress:a,isBasicGroup:s,hasLinkedChannel:o,canChangeInfo:l,canBanUsers:i,onScreenSelect:d,togglePreHistoryHidden:m,updateChat:h,deleteChat:b,leaveChannel:g,deleteChannel:p,closeManagement:v,openChat:E,onClose:j,isActive:f})=>{const[C,y,k]=Object(xe.a)(),N=t.title,w=t.fullInfo&&t.fullInfo.about||"",[S,I]=Object(n.r)(!1),[P,F]=Object(n.r)(N),[R,T]=Object(n.r)(w),[D,B]=Object(n.r)(),[x,G]=Object(n.r)(),z=Object(u.e)(t),q=Object(O.a)(z,!1,c.ApiMediaFormat.BlobUrl),_=Object(M.a)();Object(L.a)(f,j),Object(n.n)(()=>{a===r.f.Complete&&(I(!1),G(void 0))},[a]);const H=Object(n.m)(()=>{d(r.g.ChatPrivacyType)},[d]),$=Object(n.m)(()=>{d(r.g.Discussion)},[d]),V=Object(n.m)(()=>{d(r.g.GroupPermissions)},[d]),W=Object(n.m)(()=>{d(r.g.ChatAdministrators)},[d]),K=Object(n.m)(e=>{B(e),I(!0)},[]),Y=Object(n.m)(e=>{F(e.target.value),I(!0)},[]),Q=Object(n.m)(e=>{T(e.target.value),I(!0)},[]),Z=Object(n.m)(()=>{const t=P.trim(),a=R.trim();t.length?h({chatId:e,title:t,about:a,photo:D}):G("Group title can't be empty")},[R,e,D,P,h]),J=Object(n.m)(()=>{d(r.g.GroupMembers)},[d]),X=Object(n.m)(()=>{if(!t.fullInfo)return;const{isPreHistoryHidden:e}=t.fullInfo;m({chatId:t.id,isEnabled:!e})},[t,m]),ee=Object(n.p)(()=>{if(!t.defaultBannedRights)return 0;let e=["sendMessages","sendMedia","embedLinks","sendPolls","changeInfo","inviteUsers","pinMessages"].filter(e=>!t.defaultBannedRights[e]).length;const{sendStickers:a,sendGifs:n}=t.defaultBannedRights;return a||n||(e+=1),e},[t]),te=t.fullInfo&&t.fullInfo.adminMembers&&t.fullInfo.adminMembers.length||0,ae=Object(n.m)(()=>{s?b({chatId:t.id}):t.isCreator?p({chatId:t.id}):g({chatId:t.id}),k(),v(),E({id:void 0})},[s,t.isCreator,t.id,k,v,g,p,b,E]);if(t.isRestricted)return;const ne=a===r.f.InProgress;return n.a.createElement("div",{className:"Management"},n.a.createElement("div",{className:"custom-scroll"},n.a.createElement("div",{className:"section"},n.a.createElement(Tt.a,{currentAvatarBlobUrl:q,onChange:K,disabled:!l}),n.a.createElement(ve.a,{id:"group-title",label:_("GroupName"),onChange:Y,value:P,error:"Group title can't be empty"===x?x:void 0,disabled:!l}),n.a.createElement(ve.a,{id:"group-about",className:"mb-2",label:_("DescriptionPlaceholder"),onChange:Q,value:R,disabled:!l}),t.isCreator&&n.a.createElement(Ee.a,{icon:"lock",multiline:!0,onClick:H},n.a.createElement("span",{className:"title"},_("GroupType")),n.a.createElement("span",{className:"subtitle"},t.username?_("TypePublic"):_("TypePrivate"))),o&&n.a.createElement(Ee.a,{icon:"message",multiline:!0,onClick:$},n.a.createElement("span",{className:"title"},_("LinkedChannel")),n.a.createElement("span",{className:"subtitle"},_("DiscussionUnlink"))),n.a.createElement(Ee.a,{icon:"permissions",multiline:!0,onClick:V,disabled:!i},n.a.createElement("span",{className:"title"},_("ChannelPermissions")),n.a.createElement("span",{className:"subtitle",dir:"auto"},ee,"/",8)),n.a.createElement(Ee.a,{icon:"admin",multiline:!0,onClick:W},n.a.createElement("span",{className:"title"},_("ChannelAdministrators")),n.a.createElement("span",{className:"subtitle"},Object(sa.a)(te)))),n.a.createElement("div",{className:"section"},n.a.createElement(Ee.a,{icon:"group",multiline:!0,onClick:J},n.a.createElement("span",{className:"title"},_("GroupMembers")),n.a.createElement("span",{className:"subtitle"},Object(sa.a)(t.membersCount))),t.fullInfo&&n.a.createElement("div",{className:"ListItem narrow no-selection"},n.a.createElement(Zt.a,{checked:!t.fullInfo.isPreHistoryHidden,label:_("ChatHistory"),onChange:X,disabled:!i}))),n.a.createElement("div",{className:"section"},n.a.createElement(Ee.a,{icon:"delete",ripple:!0,destructive:!0,onClick:y},_("DeleteMega")))),n.a.createElement(Dt.a,{isShown:S,onClick:Z,disabled:ne,ariaLabel:_("Save")},ne?n.a.createElement(A.a,{color:"white"}):n.a.createElement("i",{className:"icon-check"})),n.a.createElement(Pe.a,{isOpen:C,onClose:k,textParts:Object(U.a)(s||!t.isCreator?_("AreYouSureDeleteAndExit"):_("AreYouSureDeleteThisChatWithGroup",t.title),["br","simple_markdown"]),confirmLabel:s||!t.isCreator?_("DeleteMega"):_("DeleteGroupForAll"),confirmHandler:ae,confirmIsDestructive:!0}))}));var Zs=Object(n.h)(Object(s.h)((e,{chatId:t})=>({chat:Object(m.g)(e,t),currentUserId:e.currentUserId}),(e,t)=>Object(h.l)(t,["updateChatDefaultBannedRights"]))(({onScreenSelect:e,onChatMemberSelect:t,chat:a,currentUserId:s,updateChatDefaultBannedRights:c,onClose:o,isActive:l})=>{const[i,d]=Object(n.r)({}),[m,u]=Object(n.r)(!1),[h,b]=Object(n.r)(!1),g=Object(M.a)();Object(L.a)(l,o);const p=Object(n.m)(()=>{e(r.g.GroupRemovedUsers)},[e]),v=Object(n.m)(()=>{e(r.g.GroupUserPermissionsCreate)},[e]),O=Object(n.m)(a=>{t(a.userId,a.promotedByUserId===s),e(r.g.GroupUserPermissions)},[s,t,e]);Object(n.n)(()=>{d(a&&a.defaultBannedRights||{}),u(!1),setTimeout(()=>{b(!1)},250)},[a]);const E=Object(n.m)(e=>{const{name:t}=e.target;function a(e){return!e||void 0}d(e=>({...e,[t]:a(e[t]),..."sendStickers"===t&&{sendGifs:a(e[t])}})),u(!0)},[]),j=Object(n.m)(()=>{a&&(b(!0),c({chatId:a.id,bannedRights:i}))},[a,i,c]),f=Object(n.p)(()=>a&&a.fullInfo&&a.fullInfo.kickedMembers?a.fullInfo.kickedMembers.length:0,[a]),C=Object(n.p)(()=>a&&a.fullInfo&&a.fullInfo.members?a.fullInfo.members.filter(({bannedRights:e})=>!!e):[],[a]),y=Object(n.m)(e=>{const{bannedRights:t}=e;if(!t||!a)return;const{defaultBannedRights:n}=a;return Object.keys(t).reduce((e,a)=>{if(!t[a]||n&&n[a]||"sendInline"===a||"viewMessages"===a||"sendGames"===a)return e;const s=function(e){switch(e){case"sendMessages":return"UserRestrictionsNoSend";case"sendMedia":return"UserRestrictionsNoSendMedia";case"sendStickers":return"UserRestrictionsNoSendStickers";case"embedLinks":return"UserRestrictionsNoEmbedLinks";case"sendPolls":return"UserRestrictionsNoSendPolls";case"changeInfo":return"UserRestrictionsNoChangeInfo";case"inviteUsers":return"UserRestrictionsInviteUsers";case"pinMessages":return"UserRestrictionsPinMessages";default:return}}(a);if(!s)return e;const c=g(s);return`${e}${e.length?", "+c:c}`},"")},[a,g]);return n.a.createElement("div",{className:"Management"},n.a.createElement("div",{className:"custom-scroll"},n.a.createElement("div",{className:"section"},n.a.createElement("h3",{className:"section-heading",dir:"auto"},g("ChannelPermissionsHeader")),n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(Zt.a,{name:"sendMessages",checked:!i.sendMessages,label:g("UserRestrictionsSend"),blocking:!0,onChange:E})),n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(Zt.a,{name:"sendMedia",checked:!i.sendMedia,label:g("UserRestrictionsSendMedia"),blocking:!0,onChange:E})),n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(Zt.a,{name:"sendStickers",checked:!i.sendStickers&&!i.sendGifs,label:g("UserRestrictionsSendStickers"),blocking:!0,onChange:E})),n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(Zt.a,{name:"sendPolls",checked:!i.sendPolls,label:g("UserRestrictionsSendPolls"),blocking:!0,onChange:E})),n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(Zt.a,{name:"embedLinks",checked:!i.embedLinks,label:g("UserRestrictionsEmbedLinks"),blocking:!0,onChange:E})),n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(Zt.a,{name:"inviteUsers",checked:!i.inviteUsers,label:g("UserRestrictionsInviteUsers"),blocking:!0,onChange:E})),n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(Zt.a,{name:"pinMessages",checked:!i.pinMessages,label:g("UserRestrictionsPinMessages"),blocking:!0,onChange:E})),n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(Zt.a,{name:"changeInfo",checked:!i.changeInfo,label:g("UserRestrictionsChangeInfo"),blocking:!0,onChange:E}))),n.a.createElement("div",{className:"section"},n.a.createElement(Ee.a,{icon:"delete-user",multiline:!0,narrow:!0,onClick:p},n.a.createElement("span",{className:"title"},g("ChannelBlockedUsers")),n.a.createElement("span",{className:"subtitle"},f))),n.a.createElement("div",{className:"section"},n.a.createElement("h3",{className:"section-heading",dir:"auto"},g("PrivacyExceptions")),n.a.createElement(Ee.a,{icon:"add-user",onClick:v},g("ChannelAddException")),C.map(e=>n.a.createElement(Ee.a,{key:e.userId,className:"chat-item-clickable exceptions-member",onClick:()=>O(e)},n.a.createElement(je.a,{userId:e.userId,status:y(e)}))))),n.a.createElement(Dt.a,{isShown:m,onClick:j,ariaLabel:g("Save"),disabled:h},h?n.a.createElement(A.a,{color:"white"}):n.a.createElement("i",{className:"icon-check"})))}));var Js=Object(n.h)(Object(s.h)((e,{chatId:t})=>{const a=Object(m.g)(e,t),{byId:n}=e.users;return{chat:a,usersById:n}},(e,t)=>Object(h.l)(t,["updateChatMemberBannedRights"]))(({chat:e,usersById:t,updateChatMemberBannedRights:a,onClose:s,isActive:c})=>{const r=Object(M.a)();Object(L.a)(c,s);const o=Object(n.p)(()=>e&&e.fullInfo&&e.fullInfo.kickedMembers?e.fullInfo.kickedMembers:[],[e]),l=Object(n.m)(e=>{if(!e.kickedByUserId)return;const a=t[e.kickedByUserId];return a?r("UserRemovedBy",Object(u.bb)(a)):void 0},[r,t]),i=Object(n.m)(t=>{if(e)return[{title:r("Unblock"),icon:"delete",destructive:!0,handler:()=>a({chatId:e.id,userId:t.userId,bannedRights:{}})}]},[r,e,a]);return n.a.createElement("div",{className:"Management"},n.a.createElement("div",{className:"custom-scroll"},n.a.createElement("div",{className:"section",dir:r.isRtl?"rtl":void 0},n.a.createElement("p",{className:"text-muted"},r("NoBlockedGroup2")),o.map(e=>n.a.createElement(Ee.a,{key:e.userId,className:"chat-item-clickable",ripple:!0,contextActions:i(e)},n.a.createElement(je.a,{userId:e.userId,status:l(e)}))))))}));var Xs=Object(n.h)(Object(s.h)((e,{chatId:t})=>{const a=Object(m.g)(e,t),{progress:n}=e.management;return{chat:a,progress:n,isSignaturesShown:Boolean(a&&a.isSignaturesShown),canChangeInfo:Object(u.p)(a,"changeInfo")}},(e,t)=>Object(h.l)(t,["toggleSignatures","updateChat","closeManagement","leaveChannel","deleteChannel","openChat"]))(({chatId:e,chat:t,progress:a,isSignaturesShown:s,canChangeInfo:o,onScreenSelect:l,updateChat:i,toggleSignatures:d,closeManagement:m,leaveChannel:h,deleteChannel:b,openChat:g,onClose:p,isActive:v})=>{const E=t&&t.title||"",j=t&&t.fullInfo&&t.fullInfo.about||"",f=t&&t.fullInfo&&t.fullInfo.linkedChatId,[C,y,k]=Object(xe.a)(),[N,w]=Object(n.r)(!1),[S,I]=Object(n.r)(E),[P,F]=Object(n.r)(j),[R,T]=Object(n.r)(),[D,B]=Object(n.r)(),U=t&&Object(u.e)(t),x=Object(O.a)(U,!1,c.ApiMediaFormat.BlobUrl),G=Object(M.a)();Object(L.a)(v,p),Object(n.n)(()=>{a===r.f.Complete&&(w(!1),B(void 0))},[a]);const z=t&&t.fullInfo&&t.fullInfo.adminMembers&&t.fullInfo.adminMembers.length||0,q=Object(n.m)(()=>{l(r.g.ChatPrivacyType)},[l]),_=Object(n.m)(()=>{l(r.g.Discussion)},[l]),H=Object(n.m)(()=>{l(r.g.ChatAdministrators)},[l]),$=Object(n.m)(e=>{T(e),w(!0)},[]),V=Object(n.m)(e=>{I(e.target.value),w(!0)},[]),W=Object(n.m)(e=>{F(e.target.value),w(!0)},[]),K=Object(n.m)(()=>{const t=S.trim(),a=P.trim();t.length?i({chatId:e,title:t,about:a,photo:R}):B("Channel title can't be empty")},[P,e,R,S,i]),Y=Object(n.m)(()=>{d({chatId:e,isEnabled:!s})},[e,s,d]),Q=Object(n.m)(()=>{l(r.g.ChannelSubscribers)},[l]),Z=Object(n.m)(()=>{t.isCreator?b({chatId:t.id}):h({chatId:t.id}),k(),m(),g({id:void 0})},[t.isCreator,t.id,k,m,h,b,g]);if(t.isRestricted)return;const J=a===r.f.InProgress;return n.a.createElement("div",{className:"Management"},n.a.createElement("div",{className:"custom-scroll"},n.a.createElement("div",{className:"section"},n.a.createElement(Tt.a,{currentAvatarBlobUrl:x,onChange:$,disabled:!o}),n.a.createElement(ve.a,{id:"channel-title",label:G("EnterChannelName"),onChange:V,value:S,error:"Channel title can't be empty"===D?D:void 0,disabled:!o}),n.a.createElement(ve.a,{id:"channel-about",className:"mb-2",label:G("DescriptionPlaceholder"),onChange:W,value:P,disabled:!o}),t.isCreator&&n.a.createElement(Ee.a,{icon:"lock",multiline:!0,onClick:q},n.a.createElement("span",{className:"title"},G("ChannelType")),n.a.createElement("span",{className:"subtitle"},t.username?G("TypePublic"):G("TypePrivate"))),n.a.createElement(Ee.a,{icon:"message",multiline:!0,onClick:_,disabled:!o},n.a.createElement("span",{className:"title"},G("Discussion")),n.a.createElement("span",{className:"subtitle"},G(f?"DiscussionUnlink":"Add"))),n.a.createElement(Ee.a,{icon:"admin",multiline:!0,onClick:H},n.a.createElement("span",{className:"title"},G("ChannelAdministrators")),n.a.createElement("span",{className:"subtitle"},z)),n.a.createElement("div",{className:"ListItem no-selection narrow"},n.a.createElement(Zt.a,{checked:s,label:G("ChannelSignMessages"),onChange:Y}))),n.a.createElement("div",{className:"section"},n.a.createElement(Ee.a,{icon:"group",multiline:!0,onClick:Q},n.a.createElement("span",{className:"title",dir:"auto"},G("ChannelSubscribers")),n.a.createElement("span",{className:"subtitle",dir:"auto"},G("Subscribers",t.membersCount,"i")))),n.a.createElement("div",{className:"section"},n.a.createElement(Ee.a,{icon:"delete",ripple:!0,destructive:!0,onClick:y},t.isCreator?G("ChannelDelete"):G("LeaveChannel")))),n.a.createElement(Dt.a,{isShown:N,onClick:K,disabled:J,ariaLabel:G("Save")},J?n.a.createElement(A.a,{color:"white"}):n.a.createElement("i",{className:"icon-check"})),n.a.createElement(Pe.a,{isOpen:C,onClose:k,text:t.isCreator?G("ChannelDeleteAlert"):G("ChannelLeaveAlert"),confirmLabel:t.isCreator?G("ChannelDelete"):G("LeaveChannel"),confirmHandler:Z,confirmIsDestructive:!0}))})),ec=a(59);var tc=Object(n.h)(Object(s.h)((e,{chatId:t})=>{const a=Object(m.g)(e,t),{isUsernameAvailable:n}=Object(m.ab)(e,t);return{chat:a,isChannel:Object(u.mb)(a),progress:e.management.progress,isUsernameAvailable:n}},(e,t)=>Object(h.l)(t,["checkPublicLink","updatePublicLink","updatePrivateLink"]))(({chat:e,onClose:t,isActive:a,isChannel:s,progress:c,isUsernameAvailable:o,checkPublicLink:l,updatePublicLink:i,updatePrivateLink:d})=>{const m=Boolean(e.username),u=e.fullInfo&&e.fullInfo.inviteLink,[h,b]=Object(n.r)(m?"public":"private"),[g,p]=Object(n.r)(),[v,O,E]=Object(xe.a)(),j="public"===h&&g&&o||"private"===h&&m;Object(L.a)(a,t),Object(n.n)(()=>{h&&!u&&d()},[h,u,d]);const f=Object(n.m)(e=>{b(e)},[]),C=Object(n.m)(()=>{i({username:"public"===h?g:""})},[h,i,g]),y=Object(n.m)(()=>{E(),d()},[E,d]),k=Object(M.a)(),N=s?"Channel":"Mega",w=s?"Channel":"Group",S=[{value:"private",label:k(N+"Private"),subLabel:k(N+"PrivateInfo")},{value:"public",label:k(N+"Public"),subLabel:k(N+"PublicInfo")}],I=c===r.f.InProgress;return n.a.createElement("div",{className:"Management"},n.a.createElement("div",{className:"custom-scroll"},n.a.createElement("div",{className:"section",dir:k.isRtl?"rtl":void 0},n.a.createElement("h3",{className:"section-heading"},k(w+"Type")),n.a.createElement(qe.a,{selected:h,name:"channel-type",options:S,onChange:f})),"private"===h?n.a.createElement("div",{className:"section",dir:k.isRtl?"rtl":void 0},u?n.a.createElement(n.a.Fragment,null,n.a.createElement(ec.a,{url:u,className:"group-link",text:u}),n.a.createElement("p",{className:"section-info",dir:k.isRtl?"rtl":void 0},k(N+"PrivateLinkHelp")),n.a.createElement(Ee.a,{icon:"delete",ripple:!0,destructive:!0,onClick:O},k("RevokeLink")),n.a.createElement(Pe.a,{isOpen:v,onClose:E,text:k("RevokeAlert"),confirmLabel:k("RevokeButton"),confirmHandler:y,confirmIsDestructive:!0})):n.a.createElement(ge.a,null)):n.a.createElement("div",{className:"section no-border"},n.a.createElement(Gt,{asLink:!0,currentUsername:e.username,isLoading:I,isUsernameAvailable:o,checkUsername:l,onChange:p}),n.a.createElement("p",{className:"section-info",dir:"auto"},k(w+".Username.CreatePublicLinkHelp")))),n.a.createElement(Dt.a,{isShown:j,disabled:I,ariaLabel:k("Save"),onClick:C},I?n.a.createElement(A.a,{color:"white"}):n.a.createElement("i",{className:"icon-check"})))}));var ac=Object(n.h)(Object(s.h)((e,{chatId:t})=>{const a=Object(m.g)(e,t),{forDiscussionIds:n,byId:s}=e.chats;return{chat:a,chatsByIds:s,forDiscussionIds:n,linkedChat:a&&a.fullInfo&&a.fullInfo.linkedChatId?Object(m.g)(e,a.fullInfo.linkedChatId):void 0,isChannel:a&&Object(u.mb)(a)}},(e,t)=>Object(h.l)(t,["loadGroupsForDiscussion","linkDiscussionGroup","unlinkDiscussionGroup"]))(({chat:e,onClose:t,isActive:a,chatId:s,chatsByIds:c,linkedChat:l,forDiscussionIds:i,isChannel:d,onScreenSelect:m,loadGroupsForDiscussion:u,linkDiscussionGroup:h,unlinkDiscussionGroup:b})=>{const[g,p]=Object(n.r)(),[v,O]=Object(n.r)(),[E,j]=Object(n.r)(!1),f=Object(n.m)(()=>j(!0),[]),[C,y,k]=Object(xe.a)(),[N,w,S]=Object(xe.a)(),I=Object(M.a)(),P=l&&l.id;Object(L.a)(a,t),Object(n.n)(()=>{u()},[u]),Object(n.n)(()=>{v||Object(_t.a)("DiscussionGroups").then(O)},[v]);const F=Object(n.m)(()=>{k(),b({channelId:d?s:P}),d||m(r.g.Initial)},[k,b,d,s,P,m]),A=Object(n.m)(()=>{S(),h({channelId:s,chatId:g})},[S,h,s,g]);function R(){const e=c[g];if(e)return n.a.createElement("div",{className:"modal-header"},n.a.createElement(x.a,{size:"tiny",chat:e}),n.a.createElement("div",{className:"modal-title"},I("Channel.DiscussionGroup.LinkGroup")))}function T(){const t=c[g];if(t)return t.hasPrivateLink?Object(U.a)(`Do you want to make **${t.title}** the discussion board for **${e.title}**?`,["br","simple_markdown"]):Object(U.a)(`Do you want to make **${t.title}** the discussion board for **${e.title}**?\n\nAnyone from the channel will be able to see messages in this group.`,["br","simple_markdown"])}return n.a.createElement("div",{className:"Management"},n.a.createElement("div",{className:"custom-scroll"},n.a.createElement("div",{className:"section"},n.a.createElement("div",{className:"section-icon"},v&&n.a.createElement(Ht.a,{id:"discussionGroupsDucks",size:o.Eb,animationData:v,play:E,noLoop:!0,onLoad:f})),l&&n.a.createElement("div",null,n.a.createElement(Ee.a,{className:"chat-item-clickable",inactive:!0},n.a.createElement(fe.a,{chatId:l.id})),n.a.createElement(Ee.a,{icon:"delete",ripple:!0,destructive:!0,onClick:y},I(d?"DiscussionUnlinkGroup":"DiscussionUnlinkChannel")),n.a.createElement(Pe.a,{isOpen:C,onClose:k,header:n.a.createElement("div",{className:"modal-header"},n.a.createElement(x.a,{size:"tiny",chat:l}),n.a.createElement("div",{className:"modal-title"},I(d?"DiscussionUnlinkGroup":"DiscussionUnlinkChannel"))),textParts:Object(U.a)(I(d?"DiscussionUnlinkChannelAlert":"DiscussionUnlinkGroupAlert",l.title),["br","simple_markdown"]),confirmLabel:I(d?"DiscussionUnlinkGroup":"DiscussionUnlinkChannel"),confirmHandler:F,confirmIsDestructive:!0})),!l&&n.a.createElement("div",null,n.a.createElement("p",{className:"section-help",dir:"auto"},I("DiscussionChannelHelp")),n.a.createElement("div",{teactFastList:!0},n.a.createElement(Ee.a,{key:"create-group",icon:"group",ripple:!0,teactOrderKey:0,className:"not-implemented"},I("DiscussionCreateGroup")),i?i.map((e,t)=>n.a.createElement(Ee.a,{key:e,teactOrderKey:t+1,className:"chat-item-clickable scroll-item",onClick:()=>{p(e),w()}},n.a.createElement(fe.a,{chatId:e}))):n.a.createElement(st.a,{key:"nothing-found",teactOrderKey:0,text:"No discussion groups found"})),n.a.createElement("p",{className:"mt-4 mb-0 section-help",dir:"auto"},I("DiscussionChannelHelp2")),n.a.createElement(Pe.a,{isOpen:N,onClose:S,header:R(),textParts:T(),confirmLabel:I("DiscussionLinkGroup"),confirmHandler:A,isButtonsInOneRow:!0})))))}));var nc=Object(n.h)(Object(s.h)((e,{chatId:t,isPromotedByCurrentUser:a})=>{const n=Object(m.g)(e,t);return{chat:n,isFormFullyDisabled:!(n.isCreator||a)}},(e,t)=>Object(h.l)(t,["updateChatMemberBannedRights"]))(({chat:e,selectedChatMemberId:t,onScreenSelect:a,updateChatMemberBannedRights:s,isFormFullyDisabled:c,onClose:o,isActive:l})=>{const[i,d]=Object(n.r)({}),[m,u]=Object(n.r)(!1),[h,b]=Object(n.r)(!1),[g,p,v]=Object(xe.a)(),O=Object(M.a)();Object(L.a)(l,o);const E=Object(n.p)(()=>{if(e&&e.fullInfo&&e.fullInfo.members)return e.fullInfo.members.find(({userId:e})=>e===t)},[e,t]);Object(n.n)(()=>{e&&e.fullInfo&&t&&!E&&a(r.g.GroupPermissions)},[e,a,E,t]),Object(n.n)(()=>{d(E&&E.bannedRights||e&&e.defaultBannedRights||{}),u(!1),b(!1)},[e,E]);const j=Object(n.m)(e=>{const{name:t}=e.target;function a(e){return!e||void 0}d(e=>({...e,[t]:a(e[t]),..."sendStickers"===t&&{sendGifs:a(e[t])}})),u(!0)},[]),f=Object(n.m)(()=>{e&&t&&(b(!0),s({chatId:e.id,userId:t,bannedRights:i}))},[e,t,i,s]),C=Object(n.m)(()=>{e&&t&&s({chatId:e.id,userId:t,bannedRights:{viewMessages:!0}})},[e,t,s]),y=Object(n.m)(t=>!!c||!(!e||!e.defaultBannedRights)&&e.defaultBannedRights[t],[e,c]);if(E)return n.a.createElement("div",{className:"Management"},n.a.createElement("div",{className:"custom-scroll"},n.a.createElement("div",{className:"section"},n.a.createElement(Ee.a,{inactive:!0,className:"chat-item-clickable"},n.a.createElement(je.a,{userId:E.userId})),n.a.createElement("h3",{className:"section-heading mt-4",dir:"auto"},O("UserRestrictionsCanDo")),n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(Zt.a,{name:"sendMessages",checked:!i.sendMessages,label:O("UserRestrictionsSend"),blocking:!0,disabled:y("sendMessages"),onChange:j})),n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(Zt.a,{name:"sendMedia",checked:!i.sendMedia,label:O("UserRestrictionsSendMedia"),blocking:!0,disabled:y("sendMedia"),onChange:j})),n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(Zt.a,{name:"sendStickers",checked:!i.sendStickers&&!i.sendGifs,label:O("UserRestrictionsSendStickers"),blocking:!0,disabled:y("sendStickers"),onChange:j})),n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(Zt.a,{name:"sendPolls",checked:!i.sendPolls,label:O("UserRestrictionsSendPolls"),blocking:!0,disabled:y("sendPolls"),onChange:j})),n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(Zt.a,{name:"embedLinks",checked:!i.embedLinks,label:O("UserRestrictionsEmbedLinks"),blocking:!0,disabled:y("embedLinks"),onChange:j})),n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(Zt.a,{name:"inviteUsers",checked:!i.inviteUsers,label:O("UserRestrictionsInviteUsers"),blocking:!0,disabled:y("inviteUsers"),onChange:j})),n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(Zt.a,{name:"pinMessages",checked:!i.pinMessages,label:O("UserRestrictionsPinMessages"),blocking:!0,disabled:y("pinMessages"),onChange:j})),n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(Zt.a,{name:"changeInfo",checked:!i.changeInfo,label:O("UserRestrictionsChangeInfo"),blocking:!0,disabled:y("changeInfo"),onChange:j}))),!c&&n.a.createElement("div",{className:"section"},n.a.createElement(Ee.a,{icon:"delete-user",ripple:!0,destructive:!0,onClick:p},O("UserRestrictionsBlock")))),n.a.createElement(Dt.a,{isShown:m,onClick:f,ariaLabel:O("Save"),disabled:h},h?n.a.createElement(A.a,{color:"white"}):n.a.createElement("i",{className:"icon-check"})),n.a.createElement(Pe.a,{isOpen:g,onClose:v,text:"Are you sure you want to ban and remove this user from the group?",confirmLabel:"Remove",confirmHandler:C,confirmIsDestructive:!0}))}));var sc=Object(n.h)(Object(s.h)((e,{chatId:t})=>{const a=Object(m.g)(e,t),{byId:n}=e.users;return{chat:a,currentUserId:e.currentUserId,isChannel:Object(u.mb)(a),usersById:n}})(({chat:e,isChannel:t,currentUserId:a,usersById:s,onScreenSelect:c,onChatMemberSelect:o,onClose:l,isActive:i})=>{const d=Object(M.a)();Object(L.a)(i,l);const m=Object(n.p)(()=>e.fullInfo&&e.fullInfo.adminMembers?e.fullInfo.adminMembers.sort((e,t)=>e.isOwner?-1:t.isOwner?1:0):[],[e]),h=Object(n.m)(e=>{o(e.userId,e.promotedByUserId===a),c(r.g.ChatAdminRights)},[a,o,c]),b=Object(n.m)(e=>{if(e.isOwner)return d("ChannelCreator");const t=e.promotedByUserId?s[e.promotedByUserId]:void 0;return t?d("EditAdminPromotedBy",Object(u.bb)(t)):d("ChannelAdmin")},[d,s]);return n.a.createElement("div",{className:"Management"},n.a.createElement("div",{className:"custom-scroll"},n.a.createElement("div",{className:"section"},n.a.createElement(Ee.a,{icon:"recent",multiline:!0,onClick:function(){c(r.g.GroupRecentActions)}},n.a.createElement("span",{className:"title"},d("EventLog")),n.a.createElement("span",{className:"subtitle"},d(t?"EventLogInfoDetailChannel":"EventLogInfoDetail")))),n.a.createElement("div",{className:"section",dir:d.isRtl?"rtl":void 0},n.a.createElement("p",{className:"text-muted",dir:"auto"},t?"You can add administrators to help you manage your channel.":"You can add administrators to help you manage your group."),m.map(e=>n.a.createElement(Ee.a,{key:e.userId,className:"chat-item-clickable",onClick:()=>h(e)},n.a.createElement(je.a,{userId:e.userId,status:b(e),forceShowSelf:!0}))))))}));var cc=Object(n.h)(Object(s.h)((e,{chatId:t})=>({chat:Object(m.g)(e,t)}))(({chat:e,onClose:t,isActive:a})=>{const s=Object(M.a)();Object(L.a)(a,t);const c=Object(n.p)(()=>e&&e.fullInfo&&e.fullInfo.adminMembers?e.fullInfo.adminMembers.sort((e,t)=>e.isOwner?-1:t.isOwner?1:0):[],[e]),r=Object(n.m)(e=>e.isOwner?s("ChannelCreator"):s("ChannelAdmin"),[s]);return n.a.createElement("div",{className:"Management"},n.a.createElement("div",{className:"custom-scroll"},n.a.createElement("div",{className:"section not-implemented",dir:s.isRtl?"rtl":void 0},n.a.createElement("h3",{className:"section-heading",dir:"auto"},"Actions"),n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(Zt.a,{name:"changeInfo",checked:!0,label:s("EventLogAllEvents"),onChange:void 0})),n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(Zt.a,{name:"changeInfo",checked:!0,label:s("EventLogFilterNewAdmins"),onChange:void 0})),n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(Zt.a,{name:"changeInfo",checked:!0,label:s("EventLogFilterNewMembers"),onChange:void 0})),n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(Zt.a,{name:"changeInfo",checked:!0,label:s("EventLogFilterChannelInfo"),onChange:void 0})),n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(Zt.a,{name:"changeInfo",checked:!0,label:s("EventLogFilterDeletedMessages"),onChange:void 0})),n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(Zt.a,{name:"changeInfo",checked:!0,label:s("EventLogFilterEditedMessages"),onChange:void 0})),n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(Zt.a,{name:"changeInfo",checked:!0,label:s("EventLogFilterLeavingMembers"),onChange:void 0}))),n.a.createElement("div",{className:"section not-implemented",dir:s.isRtl?"rtl":void 0},n.a.createElement("h3",{className:"section-heading",dir:"auto"},s("Channel.Management.Title")),n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(Zt.a,{name:"changeInfo",checked:!0,label:s("EventLogAllAdmins"),onChange:void 0})),c.map(e=>n.a.createElement(Ee.a,{key:e.userId,className:"chat-item-clickable picker-list-item",onClick:void 0,ripple:!0},n.a.createElement(Zt.a,{label:"",checked:!0}),n.a.createElement(je.a,{userId:e.userId,status:r(e),forceShowSelf:!0}))))))}));var rc=Object(n.h)(Object(s.h)((e,{chatId:t,isPromotedByCurrentUser:a})=>{const n=Object(m.g)(e,t),{byId:s}=e.users,{currentUserId:c}=e;return{chat:n,usersById:s,currentUserId:c,isChannel:Object(u.mb)(n),isFormFullyDisabled:!(n.isCreator||a)}},(e,t)=>Object(h.l)(t,["updateChatAdmin"]))(({selectedChatMemberId:e,onScreenSelect:t,chat:a,usersById:s,currentUserId:c,isChannel:o,isFormFullyDisabled:l,updateChatAdmin:i,onClose:d,isActive:m})=>{const[h,b]=Object(n.r)({}),[g,p]=Object(n.r)(!1),[v,O]=Object(n.r)(!1),[E,j,f]=Object(xe.a)(),[C,y]=Object(n.r)(""),k=Object(M.a)();Object(L.a)(m,d);const N=Object(n.p)(()=>{if(a.fullInfo&&a.fullInfo.adminMembers)return a.fullInfo.adminMembers.find(({userId:t})=>t===e)},[a,e]);Object(n.n)(()=>{a&&a.fullInfo&&e&&!N&&t(r.g.ChatAdministrators)},[a,t,N,e]),Object(n.n)(()=>{b(N&&N.adminRights||{}),y((N&&N.customTitle||"").substr(0,16)),p(!1),O(!1)},[N]);const w=Object(n.m)(e=>{const{name:t}=e.target;b(e=>{return{...e,[t]:(a=e[t],!a||void 0)};var a}),p(!0)},[]),S=Object(n.m)(()=>{e&&(O(!0),i({chatId:a.id,userId:e,adminRights:h,customTitle:C}))},[a,e,h,C,i]),I=Object(n.m)(()=>{e&&(i({chatId:a.id,userId:e,adminRights:{}}),f())},[a.id,f,e,i]),P=Object(n.m)(e=>!Object(u.lb)(a)&&(!(!l&&a.adminRights)||!a.adminRights[e]),[a,l]),F=Object(n.p)(()=>{if(!N)return;if(N.isOwner)return k("ChannelCreator");const e=N.promotedByUserId?s[N.promotedByUserId]:void 0;return e?k("EditAdminPromotedBy",Object(u.bb)(e)):k("ChannelAdmin")},[N,s,k]),R=Object(n.m)(e=>{const{value:t}=e.target;y(t),p(!0)},[]);if(N)return n.a.createElement("div",{className:"Management"},n.a.createElement("div",{className:"custom-scroll"},n.a.createElement("div",{className:"section"},n.a.createElement(Ee.a,{inactive:!0,className:"chat-item-clickable"},n.a.createElement(je.a,{userId:N.userId,status:F,forceShowSelf:!0})),n.a.createElement("h3",{className:"section-heading mt-4",dir:"auto"},k("EditAdminWhatCanDo")),n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(Zt.a,{name:"changeInfo",checked:!!h.changeInfo,label:k(o?"EditAdminChangeChannelInfo":"EditAdminChangeGroupInfo"),blocking:!0,disabled:P("changeInfo"),onChange:w})),o&&n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(Zt.a,{name:"postMessages",checked:!!h.postMessages,label:k("EditAdminPostMessages"),blocking:!0,disabled:P("postMessages"),onChange:w})),o&&n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(Zt.a,{name:"editMessages",checked:!!h.editMessages,label:k("EditAdminEditMessages"),blocking:!0,disabled:P("editMessages"),onChange:w})),n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(Zt.a,{name:"deleteMessages",checked:!!h.deleteMessages,label:k(o?"EditAdminDeleteMessages":"EditAdminGroupDeleteMessages"),blocking:!0,disabled:P("deleteMessages"),onChange:w})),!o&&n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(Zt.a,{name:"banUsers",checked:!!h.banUsers,label:k("EditAdminBanUsers"),blocking:!0,disabled:P("banUsers"),onChange:w})),n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(Zt.a,{name:"inviteUsers",checked:!!h.inviteUsers,label:k("EditAdminAddUsers"),blocking:!0,disabled:P("inviteUsers"),onChange:w})),!o&&n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(Zt.a,{name:"pinMessages",checked:!!h.pinMessages,label:k("EditAdminPinMessages"),blocking:!0,disabled:P("pinMessages"),onChange:w})),n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(Zt.a,{name:"addAdmins",checked:!!h.addAdmins,label:k("EditAdminAddAdmins"),blocking:!0,disabled:P("addAdmins"),onChange:w})),!o&&n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(Zt.a,{name:"anonymous",checked:!!h.anonymous,label:k("EditAdminSendAnonymously"),blocking:!0,disabled:P("anonymous"),onChange:w})),l&&n.a.createElement("p",{className:"section-info mb-4",dir:"auto"},k("Channel.EditAdmin.CannotEdit")),!o&&n.a.createElement(ve.a,{id:"admin-title",label:k("EditAdminRank"),onChange:R,value:C,disabled:l,maxLength:16}),c!==e&&!l&&n.a.createElement(Ee.a,{icon:"delete",ripple:!0,destructive:!0,onClick:j},k("EditAdminRemoveAdmin")))),n.a.createElement(Dt.a,{isShown:g,onClick:S,ariaLabel:k("Save"),disabled:v},v?n.a.createElement(A.a,{color:"white"}):n.a.createElement("i",{className:"icon-check"})),n.a.createElement(Pe.a,{isOpen:E,onClose:f,text:"Are you sure you want to dismiss this admin?",confirmLabel:"Dismiss",confirmHandler:I,confirmIsDestructive:!0}))}));var oc=Object(n.h)(Object(s.h)((e,{chatId:t})=>{const a=Object(m.g)(e,t),{byId:n}=e.users;return{members:a&&a.fullInfo&&a.fullInfo.members,usersById:n,isChannel:a&&Object(u.mb)(a),serverTimeOffset:e.serverTimeOffset}},(e,t)=>Object(h.l)(t,["openUserInfo"]))(({members:e,usersById:t,isChannel:a,openUserInfo:s,onClose:c,isActive:r,serverTimeOffset:o})=>{const l=Object(n.p)(()=>{if(e&&t)return Object(u.Jb)(e.map(({userId:e})=>e),t,void 0,o)},[e,o,t]),i=Object(n.m)(e=>{s({id:e})},[s]);return Object(L.a)(r,c),n.a.createElement("div",{className:"Management"},n.a.createElement("div",{className:"custom-scroll"},n.a.createElement("div",{className:"section",teactFastList:!0},l?l.map((e,t)=>n.a.createElement(Ee.a,{key:e,teactOrderKey:t,className:"chat-item-clickable scroll-item",onClick:()=>i(e)},n.a.createElement(je.a,{userId:e,forceShowSelf:!0}))):n.a.createElement(st.a,{teactOrderKey:0,key:"nothing-found",text:a?"No subscribers found":"No members found"}))))}));var lc=Object(n.h)(Object(s.h)((e,{chatId:t})=>{const a=Object(m.g)(e,t),{byId:n}=e.users;return{members:a&&a.fullInfo&&a.fullInfo.members,usersById:n,isChannel:a&&Object(u.mb)(a),serverTimeOffset:e.serverTimeOffset}})(({usersById:e,members:t,isChannel:a,onScreenSelect:s,onChatMemberSelect:c,onClose:o,isActive:l,serverTimeOffset:i})=>{Object(L.a)(l,o);const d=Object(n.p)(()=>{if(t&&e)return Object(u.Jb)(t.filter(e=>!e.isOwner).map(({userId:e})=>e),e,void 0,i)},[t,i,e]),m=Object(n.m)(e=>{c(e),s(r.g.GroupUserPermissions)},[c,s]);return n.a.createElement("div",{className:"Management"},n.a.createElement("div",{className:"custom-scroll"},n.a.createElement("div",{className:"section",teactFastList:!0},d?d.map((e,t)=>n.a.createElement(Ee.a,{key:e,teactOrderKey:t,className:"chat-item-clickable scroll-item",onClick:()=>m(e)},n.a.createElement(je.a,{userId:e,forceShowSelf:!0}))):n.a.createElement(st.a,{teactOrderKey:0,key:"nothing-found",text:a?"No subscribers found":"No members found"}))))}));var ic=Object(n.h)(Object(s.h)(e=>({managementType:Object(m.v)(e)}))(({chatId:e,currentScreen:t,selectedChatMemberId:a,isPromotedByCurrentUser:s,onScreenSelect:c,onChatMemberSelect:o,onClose:l,isActive:i,managementType:d})=>{switch(t){case r.g.Initial:switch(d){case"user":return n.a.createElement(Ys,{key:e,userId:e,onClose:l,isActive:i});case"group":return n.a.createElement(Qs,{key:e,chatId:e,onScreenSelect:c,onClose:l,isActive:i||[r.g.ChatPrivacyType,r.g.Discussion,r.g.GroupPermissions,r.g.ChatAdministrators,r.g.GroupRemovedUsers,r.g.GroupUserPermissionsCreate,r.g.GroupUserPermissions,r.g.ChatAdminRights,r.g.GroupRecentActions].includes(t)});case"channel":return n.a.createElement(Xs,{key:e,chatId:e,onScreenSelect:c,onClose:l,isActive:i||[r.g.ChannelSubscribers,r.g.ChatAdministrators,r.g.Discussion,r.g.ChatPrivacyType,r.g.ChatAdminRights,r.g.GroupRecentActions].includes(t)})}break;case r.g.ChatPrivacyType:return n.a.createElement(tc,{chatId:e,isActive:i,onClose:l});case r.g.Discussion:return n.a.createElement(ac,{chatId:e,onScreenSelect:c,isActive:i,onClose:l});case r.g.GroupPermissions:return n.a.createElement(Zs,{chatId:e,onScreenSelect:c,onChatMemberSelect:o,isActive:i||[r.g.GroupRemovedUsers,r.g.GroupUserPermissionsCreate,r.g.GroupUserPermissions].includes(t),onClose:l});case r.g.GroupRemovedUsers:return n.a.createElement(Js,{chatId:e,isActive:i,onClose:l});case r.g.GroupUserPermissionsCreate:return n.a.createElement(lc,{chatId:e,onChatMemberSelect:o,onScreenSelect:c,isActive:i||[r.g.GroupUserPermissions].includes(t),onClose:l});case r.g.GroupUserPermissions:return n.a.createElement(nc,{chatId:e,selectedChatMemberId:a,isPromotedByCurrentUser:s,onScreenSelect:c,isActive:i,onClose:l});case r.g.ChatAdministrators:return n.a.createElement(sc,{chatId:e,onScreenSelect:c,onChatMemberSelect:o,isActive:i||[r.g.ChatAdminRights,r.g.GroupRecentActions].includes(t),onClose:l});case r.g.GroupRecentActions:return n.a.createElement(cc,{chatId:e,isActive:i,onClose:l});case r.g.ChatAdminRights:return n.a.createElement(rc,{chatId:e,selectedChatMemberId:a,isPromotedByCurrentUser:s,onScreenSelect:c,isActive:i,onClose:l});case r.g.ChannelSubscribers:case r.g.GroupMembers:return n.a.createElement(oc,{chatId:e,isActive:i,onClose:l})}}));const dc={USD:"$",EUR:"€",GBP:"£",JPY:"¥",RUB:"₽",UAH:"₴",INR:"₹",AED:"د.إ"};function mc(e){return e&&dc[e]||""}const uc=/^4[0-9]{12}(?:[0-9]{1,3})?$/,hc=/^5[1-5][0-9]{11,14}$/,bc=/^2[2-7][0-9]{11,14}$/;let gc;!function(e){e[e.Default=0]="Default",e[e.Visa=1]="Visa",e[e.Mastercard=2]="Mastercard"}(gc||(gc={}));const pc={[gc.Default]:"",[gc.Visa]:"visa",[gc.Mastercard]:"mastercard"};function vc(e){return e=e.replace(/\s/g,""),uc.test(e)?gc.Visa:hc.test(e)||bc.test(e)?gc.Mastercard:gc.Default}var Oc=a(61);const Ec={streetLine1:"",streetLine2:"",city:"",state:"",countryIso2:"",postCode:"",fullName:"",email:"",phone:"",shipping:"",cardNumber:"",cardholder:"",expiry:"",cvv:"",billingCountry:"",billingZip:"",saveInfo:!0,saveCredentials:!1,formErrors:{}},jc=(e,t)=>{switch(t.type){case"changeAddress1":return{...e,streetLine1:t.payload,formErrors:{...e.formErrors,streetLine1:void 0}};case"changeAddress2":return{...e,streetLine2:t.payload,formErrors:{...e.formErrors,streetLine2:void 0}};case"changeCity":return{...e,city:t.payload,formErrors:{...e.formErrors,city:void 0}};case"changeState":return{...e,state:t.payload,formErrors:{...e.formErrors,state:void 0}};case"changeCountry":return{...e,countryIso2:t.payload,billingCountry:fc(t.payload),formErrors:{...e.formErrors,countryIso2:void 0}};case"changePostCode":return{...e,postCode:t.payload,formErrors:{...e.formErrors,postCode:void 0}};case"changeFullName":return{...e,fullName:t.payload,formErrors:{...e.formErrors,fullName:void 0}};case"changeEmail":return{...e,email:t.payload,formErrors:{...e.formErrors,email:void 0}};case"changePhone":return{...e,phone:t.payload,formErrors:{...e.formErrors,phone:void 0}};case"changeShipping":return{...e,shipping:t.payload};case"changeCardNumber":return{...e,cardNumber:t.payload,formErrors:{...e.formErrors,cardNumber:void 0}};case"changeCardholder":return{...e,cardholder:t.payload,formErrors:{...e.formErrors,cardholder:void 0}};case"changeExpiryDate":return{...e,expiry:t.payload,formErrors:{...e.formErrors,expiry:void 0}};case"changeCvvCode":return{...e,cvv:t.payload,formErrors:{...e.formErrors,cvv:void 0}};case"changeBillingCountry":return{...e,billingCountry:t.payload,formErrors:{...e.formErrors,billingCountry:void 0}};case"changeBillingZip":return{...e,billingZip:t.payload,formErrors:{...e.formErrors,billingZip:void 0}};case"changeSaveInfo":return{...e,saveInfo:t.payload};case"changeSaveCredentials":return{...e,saveCredentials:t.payload};case"updateUserInfo":return t.payload.countryIso2?{...e,...t.payload,billingCountry:fc(t.payload.countryIso2)}:{...e,...t.payload};case"setFormErrors":return{...e,formErrors:{...e.formErrors,...t.payload}};default:return e}};function fc(e){const t=At.a.find(({id:t})=>t===e);return t?t.name:""}function Cc(e,t=400){Object(n.n)(()=>{l.n||setTimeout(()=>{Object(V.b)(()=>{e.current&&e.current.focus()})},t)},[e,t])}var yc=Object(n.h)(e=>{const{id:t,value:a,label:s,hasArrow:c,error:r,ref:o,placeholder:l,onChange:i,children:d}=e,m=r||s,u=Object(W.a)("input-group",a&&"touched",r&&"error",m&&"with-label",c&&"with-arrow","input-group");return n.a.createElement("div",{className:u},n.a.createElement("select",{className:"form-control",id:t,value:a||"",onChange:i,placeholder:l||s,ref:o},d),m&&t&&n.a.createElement("label",{htmlFor:t},m))});a(320);var kc=Object(n.h)(({state:e,needEmail:t,needPhone:a,needName:s,needAddress:c,dispatch:r})=>{const o=Object(n.q)(null),l=Object(n.q)(null),i=Object(n.q)(null);Object(n.n)(()=>{i.current&&i.current.value!==e.countryIso2&&(i.current.value=e.countryIso2)},[e.countryIso2]);const d=Object(M.a)();Cc(o);const m=Object(n.m)(e=>{r({type:"changeAddress1",payload:e.target.value})},[r]),u=Object(n.m)(e=>{r({type:"changeAddress2",payload:e.target.value})},[r]),h=Object(n.m)(e=>{r({type:"changeCity",payload:e.target.value})},[r]),b=Object(n.m)(e=>{r({type:"changeState",payload:e.target.value})},[r]),g=Object(n.m)(e=>{r({type:"changeCountry",payload:e.target.value})},[r]),p=Object(n.m)(e=>{r({type:"changePostCode",payload:e.target.value})},[r]),v=Object(n.m)(e=>{r({type:"changeFullName",payload:e.target.value})},[r]),O=Object(n.m)(e=>{r({type:"changeEmail",payload:e.target.value})},[r]),E=Object(n.m)(e=>{let{value:t}=e.target;t="+"+t.replace(/\D/g,""),l.current&&(l.current.value=t),r({type:"changePhone",payload:t})},[r]),j=Object(n.m)(e=>{r({type:"changeSaveInfo",payload:e.target.value})},[r]),{formErrors:f}=e;return n.a.createElement("div",{className:"ShippingInfo"},n.a.createElement("form",null,c?n.a.createElement("div",null,n.a.createElement("h5",null,d("PaymentShippingAddress")),n.a.createElement(ve.a,{ref:o,label:"Address1 (Street)",onChange:m,value:e.streetLine1,inputMode:"text",error:f.streetLine1}),n.a.createElement(ve.a,{label:"Address2 (Street)",onChange:u,value:e.streetLine2,inputMode:"text",error:f.streetLine2}),n.a.createElement(ve.a,{label:"City",onChange:h,value:e.city,inputMode:"text",error:f.city}),n.a.createElement(ve.a,{label:"State",onChange:b,value:e.state,inputMode:"text",error:f.state}),n.a.createElement(yc,{label:"Country",placeholder:"Country",onChange:g,value:e.countryIso2,hasArrow:Boolean(!0),id:"shipping-country",error:f.countryIso2,ref:i},At.a.map(({name:e,id:t})=>n.a.createElement("option",{value:t,className:"county-item"},e))),n.a.createElement(ve.a,{label:"Post Code",onChange:p,value:e.postCode,inputMode:"text",error:f.postCode})):void 0,s||t||a?n.a.createElement("h5",null,d("PaymentShippingReceiver")):void 0,s&&n.a.createElement(ve.a,{label:"Full name",onChange:v,value:e.fullName,inputMode:"text",error:f.fullName}),t&&n.a.createElement(ve.a,{label:"Email",onChange:O,value:e.email,inputMode:"email",error:f.email}),a&&n.a.createElement(ve.a,{label:"Phone number",onChange:E,value:e.phone,inputMode:"tel",error:f.phone,ref:l}),n.a.createElement(Zt.a,{label:d("PaymentShippingSave"),subLabel:d("PaymentShippingSaveInfo"),checked:Boolean(e.saveInfo),onChange:j})))});a(321);var Nc=Object(n.h)(({state:e,shippingOptions:t,currency:a,dispatch:s})=>{Object(n.n)(()=>{t&&!e.shipping&&s({type:"changeShipping",payload:t[0].id})},[t,e.shipping,s]);const c=Object(n.m)(e=>{s({type:"changeShipping",payload:e})},[s]),r=Object(n.p)(()=>t.map(({id:e,title:t,amount:n})=>({label:t,subLabel:`${a} ${String(n/100)}`,value:e})),[t,a]);return n.a.createElement("div",{className:"Shipping"},n.a.createElement("form",null,n.a.createElement("p",null,"Select shipping method"),n.a.createElement(qe.a,{name:"shipping-options",options:r,onChange:c,selected:e.shipping})))});a(322);function wc(e,t,a,s=!1){return n.a.createElement("div",{className:"price-info-item "+(s?"price-info-item-main":"")},n.a.createElement("div",{className:"title"},e),n.a.createElement("div",{className:"value"},`${a||""} ${(t/100).toFixed(2)}`))}function Sc(e,t,a){return n.a.createElement("div",{className:"checkout-info-item"},n.a.createElement("i",{className:e}," "),n.a.createElement("div",{className:"info"},n.a.createElement("div",{className:"title"},t),n.a.createElement("p",{className:"data"},a)))}var Ic=Object(n.h)(({invoiceContent:e,prices:t,shippingPrices:a,checkoutInfo:s,currency:c,totalPrice:r})=>{const{photoUrl:o,title:l,text:i}=e||{},{paymentMethod:d,paymentProvider:m,shippingAddress:u,name:h,phone:b,shippingMethod:g}=s||{};return n.a.createElement("div",{className:"Checkout"},n.a.createElement("div",{className:"description has-image"},o&&n.a.createElement("img",{src:o,alt:""}),n.a.createElement("div",{className:"text"},n.a.createElement("h5",null,l),n.a.createElement("p",null,i))),n.a.createElement("div",{className:"price-info"},t&&t.map(e=>wc(e.label,e.amount,c,!1)),a&&a.map(e=>wc(e.label,e.amount,c,!1)),void 0!==r&&wc("Total",r,c,!0)),n.a.createElement("div",{className:"invoice-info"},d&&Sc("icon-card",d,"Payment method"),m&&Sc("stripe-provider",m,"Payment provider"),u&&Sc("icon-location",u,"Shipping address"),h&&Sc("icon-user",h,"Name"),b&&Sc("icon-phone",b,"Phone number"),g&&Sc("icon-truck",g,"Shipping method")))});var Pc=Object(n.h)(({value:e,error:t,onChange:a})=>{const s=Object(n.q)(null),c=Object(n.m)(t=>{if("Backspace"===t.key&&"/"===e.charAt(e.length-1)){const t=e.slice(0,e.length-1);s.current&&(s.current.value=t)}},[e]),r=Object(n.m)(e=>{a(function(e){const t=(e=e.replace(/[^\d]/g,"").slice(0,4)).match(/.{1,2}/g);return t&&t[0]&&Number(t[0])>12&&(t[0]="12"),t&&t[0]&&2===t[0].length&&!t[1]&&(t[1]=""),t?t.join("/"):""}(e.target.value))},[a]);return n.a.createElement(ve.a,{label:"Expiry date",ref:s,onChange:r,onKeyDown:c,value:e,error:t,inputMode:"numeric",maxLength:5})}),Fc=(a(323),a.p+"mastercard.4216118edafe23cc2dec7b8807ba4622.svg"),Mc=a.p+"visa.e5a7c336e1deb4b92a636e2e053878c4.svg";var Lc=Object(n.h)(({value:e,error:t,onChange:a})=>{const s=Object(n.q)(null);Cc(s);const[c,r]=Object(n.r)(gc.Default);Object(n.n)(()=>{const t=vc(e);r(t)},[]);const o=Object(n.m)(e=>{const t=function(e){const t=(e=e.replace(/[^\d]/g,"")).match(/.{1,4}/g);return t?t.join(" "):""}(e.target.value),n=vc(e.target.value);r(n),a(t),s.current&&(s.current.value=t)},[a,s]),l=function(e){switch(e){case gc.Mastercard:return n.a.createElement("img",{src:Fc,alt:""});case gc.Visa:return n.a.createElement("img",{src:Mc,alt:""});default:return}}(c);return n.a.createElement("div",{className:"CardInput"},n.a.createElement("span",{className:"left-addon"},l),n.a.createElement(ve.a,{ref:s,label:"Card number",onChange:o,value:e,inputMode:"numeric",className:c?"has-left-addon":"",error:t,maxLength:23}))});a(324);var Ac=Object(n.h)(({state:e,canSaveCredentials:t,needCardholderName:a,needCountry:s,needZip:c,dispatch:r})=>{const o=Object(n.q)(null);Object(n.n)(()=>{o.current&&o.current.value!==e.billingCountry&&(o.current.value=e.billingCountry)},[e.billingCountry]);const l=Object(n.m)(e=>{r({type:"changeCardNumber",payload:e})},[r]),i=Object(n.m)(e=>{r({type:"changeCardholder",payload:e.target.value.toUpperCase()})},[r]),d=Object(n.m)(e=>{r({type:"changeExpiryDate",payload:e})},[r]),m=Object(n.m)(e=>{r({type:"changeCvvCode",payload:e.target.value})},[r]),u=Object(n.m)(e=>{r({type:"changeBillingCountry",payload:e.target.value})},[r]),h=Object(n.m)(e=>{r({type:"changeBillingZip",payload:e.target.value})},[r]),b=Object(n.m)(e=>{r({type:"changeSaveCredentials",payload:e.target.value})},[r]),g=Object(M.a)(),{formErrors:p={}}=e;return n.a.createElement("div",{className:"PaymentInfo"},n.a.createElement("form",null,n.a.createElement("h5",null,g("PaymentCardTitle")),n.a.createElement(Lc,{onChange:l,value:e.cardNumber,error:p.cardNumber}),a&&n.a.createElement(ve.a,{label:"Name on card",onChange:i,value:e.cardholder,inputMode:"text",error:p.cardholder}),n.a.createElement("section",{className:"inline-inputs"},n.a.createElement(Pc,{value:e.expiry,onChange:d,error:p.expiry}),n.a.createElement(ve.a,{label:"CVV code",onChange:m,value:e.cvv,inputMode:"numeric",maxLength:3,error:p.cvv})),s||c?n.a.createElement("h5",null,g("PaymentBillingAddress")):void 0,s&&n.a.createElement(yc,{label:"Country",placeholder:"Country",onChange:u,value:e.billingCountry,hasArrow:Boolean(!0),id:"billing-country",error:p.billingCountry,ref:o},At.a.map(({name:e})=>n.a.createElement("option",{value:e,className:"county-item"},e))),c&&n.a.createElement(ve.a,{label:"Post Code",onChange:h,value:e.billingZip,inputMode:"text",error:p.billingZip}),t&&n.a.createElement(Zt.a,{label:g("PaymentCardSavePaymentInformation"),checked:e.saveCredentials,onChange:b})))});a(196);var Rc=Object(n.h)(Object(s.h)(e=>{const{step:t,shippingOptions:a,savedInfo:n,canSaveCredentials:s,invoice:c,invoiceContent:r,nativeProvider:o,nativeParams:l,passwordMissing:i,error:d}=e.payment,m=Boolean(c&&(!o||"stripe"!==o)),{needCardholderName:u,needCountry:h,needZip:b}=l||{},{nameRequested:g,phoneRequested:p,emailRequested:v,shippingAddressRequested:O,flexible:E,phoneToProvider:j,emailToProvider:f,currency:C,prices:y}=c||{};return{step:t,shippingOptions:a,savedInfo:n,canSaveCredentials:s,nativeProvider:o,passwordMissing:i,nameRequested:g,shippingAddressRequested:O,phoneRequested:p,emailRequested:v,flexible:E,phoneToProvider:j,emailToProvider:f,currency:C,prices:y,isProviderError:m,invoiceContent:r,needCardholderName:u,needCountry:h,needZip:b,error:d,globalDialogs:e.dialogs}},(e,t)=>Object(h.l)(t,["validateRequestedInfo","sendPaymentForm","setPaymentStep","sendCredentialsInfo","clearPaymentError"]))(({isOpen:e,onClose:t,step:a,shippingOptions:s,savedInfo:c,canSaveCredentials:o,nameRequested:l,shippingAddressRequested:i,phoneRequested:d,emailRequested:m,phoneToProvider:u,emailToProvider:h,currency:b,passwordMissing:g,isProviderError:p,invoiceContent:v,nativeProvider:O,prices:E,needCardholderName:j,needCountry:f,needZip:C,error:y,globalDialogs:k,validateRequestedInfo:N,sendPaymentForm:w,setPaymentStep:S,sendCredentialsInfo:I,clearPaymentError:P})=>{const[F,L]=Object(Pt.a)(jc,Ec),R=mc(b),[B,U]=Object(n.r)(!1),x=Object(M.a)();Object(n.n)(()=>{(a||y||k)&&U(!1)},[a,y,k]),Object(n.n)(()=>{if(y&&y.field)L({type:"setFormErrors",payload:{[y.field]:y.fieldError}});else if(k&&k.length){const e=Object(Oc.a)(k);L({type:"setFormErrors",payload:{...e}})}},[y,k,L]),Object(n.n)(()=>{if(c){const{name:e,phone:t,email:a,shippingAddress:n}=c;L({type:"updateUserInfo",payload:{fullName:e,phone:t&&"+"!==t.charAt(0)?"+"+t:t,email:a,...n||{}}})}},[c,L]);const G=Object(n.m)(()=>{P()},[P]),z=Object(n.p)(()=>a!==r.j.Checkout?0:function(e=[],t,a){const n=t?Dc(t,a):[];let s=0;const c=e.concat(n||[]);return s=c.reduce((e,t)=>e+t.amount,s),s}(E,s,F.shipping),[a,F.shipping,E,s]),q=Object(n.p)(()=>{if(a===r.j.Checkout)return function(e,t,a){const n=`${function(e){const t=vc(e);return pc[t]||""}(e.cardNumber)} *${e.cardNumber.slice(-4)}`,s=e.streetLine1?`${e.streetLine1}, ${e.city}, ${e.countryIso2}`:void 0,{phone:c,fullName:r}=e,o=t?Tc(t,e.shipping):void 0,l=o?o.title:void 0;return{paymentMethod:n,paymentProvider:a,shippingAddress:s,name:r,phone:c,shippingMethod:l}}(F,s,O||"")},[a,F,s,O]);const _=Object(n.m)(()=>{const{saveInfo:e}=F,t=function(e){const{streetLine1:t,streetLine2:a,city:n,state:s,countryIso2:c,postCode:r,fullName:o,phone:l,email:i}=e;return{name:o,phone:l,email:i,shippingAddress:{streetLine1:t,streetLine2:a,city:n,state:s,countryIso2:c,postCode:r}}}(F);N({requestInfo:t,saveInfo:e})},[N,F]),H=Object(n.m)(()=>{const e=function(e){const{cardNumber:t,cardholder:a,expiry:n,cvv:s,billingCountry:c,billingZip:r}=e,[o,l]=n.split("/");return{data:{cardNumber:t,cardholder:a,expiryMonth:o,expiryYear:l,cvv:s,country:c,zip:r}}}(F);I({credentials:e})},[I,F]),$=Object(n.m)(()=>{w({shippingOptionId:F.shipping,saveCredentials:F.saveCredentials})},[w,F]),V=Object(n.m)(e=>{S({step:e})},[S]),W=Object(n.m)(()=>{switch(U(!0),a){case r.j.ShippingInfo:return _();case r.j.Shipping:return V(r.j.PaymentInfo);case r.j.PaymentInfo:return H();case r.j.Checkout:return $();default:return()=>{}}},[a,_,V,H,$]),K=Object(n.p)(()=>{switch(a){case r.j.ShippingInfo:return x("PaymentShippingInfo");case r.j.Shipping:return x("PaymentShippingMethod");case r.j.PaymentInfo:return x("PaymentCardInfo");case r.j.Checkout:return x("PaymentCheckout");default:return""}},[a,x]),Y=Object(n.p)(()=>{switch(a){case r.j.Checkout:return x("Checkout.PayPrice",`${R}${(z/100).toFixed(2)}`);default:return x("Next")}},[a,x,R,z]);return p?n.a.createElement(pe.a,{className:"error",isOpen:e,onClose:t},n.a.createElement("p",null,"Sorry, Telegram WebZ doesn't support payments with this provider yet. ",n.a.createElement("br",null),"Please use one of our mobile apps to do this."),n.a.createElement(D.a,{isText:!0,onClick:t},x("OK"))):n.a.createElement(pe.a,{className:"PaymentModal",isOpen:e,onClose:t},n.a.createElement("div",{className:"header",dir:x.isRtl?"rtl":void 0},n.a.createElement(D.a,{className:"close-button",color:"translucent",round:!0,size:"smaller",onClick:t,ariaLabel:"Close"},n.a.createElement("i",{className:"icon-close"})),n.a.createElement("h3",null,K)),void 0!==a?n.a.createElement(T.a,{name:"slide",activeKey:a},()=>n.a.createElement("div",{className:"content custom-scroll"},function(e){switch(e){case r.j.ShippingInfo:return n.a.createElement(kc,{state:F,dispatch:L,needAddress:Boolean(i),needEmail:Boolean(m||h),needPhone:Boolean(d||u),needName:Boolean(l)});case r.j.Shipping:return n.a.createElement(Nc,{state:F,dispatch:L,shippingOptions:s||[],currency:R});case r.j.PaymentInfo:return n.a.createElement(Ac,{state:F,dispatch:L,canSaveCredentials:Boolean(!g&&o),needCardholderName:j,needCountry:f,needZip:C});case r.j.Checkout:return n.a.createElement(Ic,{prices:E,shippingPrices:F.shipping&&s?Dc(s,F.shipping):void 0,totalPrice:z,invoiceContent:v,checkoutInfo:q,currency:R});default:return}}(a))):n.a.createElement("div",{className:"empty-content"},n.a.createElement(A.a,{color:"gray"})),n.a.createElement("div",{className:"footer"},n.a.createElement(D.a,{type:"submit",onClick:W,disabled:B,isLoading:B},Y)),y&&!y.field&&function(){if(y)return n.a.createElement(pe.a,{className:"error",isOpen:Boolean(y),onClose:G},n.a.createElement("h4",null,y.description||"Error"),n.a.createElement("p",null,y.description||"Error"),n.a.createElement(D.a,{isText:!0,onClick:P},x("OK")))}())}));function Tc(e,t){return e.find(({id:e})=>e===t)}function Dc(e,t){const a=Tc(e,t);return a?a.prices:void 0}var Bc=Object(n.h)(Object(s.h)(e=>{const{receipt:t}=e.payment,{currency:a,prices:n,info:s,totalAmount:c,credentialsTitle:r,shippingPrices:o,shippingMethod:l,photoUrl:i,text:d,title:m}=t||{};return{currency:a,prices:n,info:s,totalAmount:c,credentialsTitle:r,shippingPrices:o,shippingMethod:l,photoUrl:i,text:d,title:m}})(({isOpen:e,onClose:t,prices:a,shippingPrices:s,totalAmount:c,currency:r,info:o,photoUrl:l,text:i,title:d,credentialsTitle:m,shippingMethod:u})=>{const h=Object(M.a)(),b=mc(r),g=Object(n.p)(()=>function(e,t,a){if(!t)return{paymentMethod:e};const{shippingAddress:n}=t,s=n&&n.streetLine1?`${n.streetLine1}, ${n.city}, ${n.countryIso2}`:void 0,{phone:c,name:r}=t;return{paymentMethod:e,paymentProvider:"Stripe",shippingAddress:s,name:r,phone:c,shippingMethod:a}}(m,o,u),[o,u,m]);return n.a.createElement(pe.a,{className:"PaymentModal PaymentModal-receipt",isOpen:e,onClose:t},n.a.createElement("div",null,n.a.createElement("div",{className:"header",dir:h.isRtl?"rtl":void 0},n.a.createElement(D.a,{className:"close-button",color:"translucent",round:!0,size:"smaller",onClick:t,ariaLabel:"Close"},n.a.createElement("i",{className:"icon-close"})),n.a.createElement("h3",null," ",h("PaymentReceipt")," ")),n.a.createElement("div",{className:"receipt-content custom-scroll"},n.a.createElement(Ic,{prices:a,shippingPrices:s,totalPrice:c,invoiceContent:{photoUrl:l,text:i,title:d},checkoutInfo:g,currency:b}))))}))},132:function(e,t,a){"use strict";a.d(t,"a",(function(){return r}));var n=a(8),s=a(57);const c={MonkeyIdle:a.p+"TwoFactorSetupMonkeyIdle.dea4a492c144df84ddab778dc8a3f0cd.tgs",MonkeyTracking:a.p+"TwoFactorSetupMonkeyTracking.eb5a7a6f166fb7589c12e6248561fb58.tgs",MonkeyClose:a.p+"TwoFactorSetupMonkeyClose.604c4c833d322b7e6c3ea19bef058241.tgs",MonkeyPeek:a.p+"TwoFactorSetupMonkeyPeek.1905436b042520363d7e59f5d7f903ab.tgs",FoldersAll:a.p+"FoldersAll.3f9f9e243d19f0fbf9aaaff11cbd4572.tgs",FoldersNew:a.p+"FoldersNew.9a40d71c0c8be70f5bd14ff2d7bc1593.tgs",DiscussionGroups:a.p+"DiscussionGroupsDucks.9ea453d1be9d1b0ee77a992f8e587485.tgs"};function r(e){const t=c[e].replace(window.location.origin,"");return s.b("file"+t,n.ApiMediaFormat.Lottie)}},136:function(e,t,a){"use strict";var n=a(0),s=a(9),c=a(2),r=a(17),o=a(16),l=a(21),i=a(112),d=a(20);a(156);const m={type:"blob",quality:.8,format:"jpeg",circle:!1};let u,h,b;var g=Object(n.h)(({file:e,onChange:t,onClose:s})=>{const[g,p]=Object(n.r)(!1);Object(n.n)(()=>{e&&(g?async function(e){try{const t=document.getElementById("avatar-crop");if(!t)return;const{offsetWidth:a,offsetHeight:n}=t;b=new u(t,{enableZoom:!0,boundary:{width:a,height:n},viewport:{width:a-16,height:n-16,type:"circle"}});const s=await Object(r.a)(e);await b.bind({url:s})}catch(e){c.r&&console.error(e)}}(e):async function(){return h||(h=Promise.all([a.e(6),a.e(8)]).then(a.bind(null,333)),u=(await h).default),h}().then(()=>p(!0)))},[e,g]);const v=Object(o.a)();return n.a.createElement(i.a,{isOpen:Boolean(e),onClose:s,title:"Drag to reposition",className:"CropModal",hasCloseButton:!0},g?n.a.createElement("div",{id:"avatar-crop"}):n.a.createElement(d.a,null),n.a.createElement(l.a,{className:"confirm-button",round:!0,color:"primary",onClick:async function(){if(!b)return;const e=await b.result(m),a="string"==typeof e?e:Object(r.b)(e,"avatar.jpg");t(a)},ariaLabel:v("CropImage")},n.a.createElement("i",{className:"icon-check"})))});a(157);t.a=Object(n.h)(({title:e="Change your profile picture",disabled:t,currentAvatarBlobUrl:a,onChange:c})=>{const[r,o]=Object(n.r)(),[l,i]=Object(n.r)(a);Object(n.n)(()=>{i(a)},[a]);const d=Object(s.a)(l&&"filled",t&&"disabled");return n.a.createElement("div",{className:"AvatarEditable"},n.a.createElement("label",{className:d,role:"button",tabIndex:0,title:e},n.a.createElement("input",{type:"file",onChange:function(e){const t=e.target;t&&t.files&&t.files[0]&&(o(t.files[0]),t.value="")},accept:"image/png, image/jpeg"}),n.a.createElement("i",{className:"icon-camera-add"}),l&&n.a.createElement("img",{src:l,alt:"Avatar"})),n.a.createElement(g,{file:r,onClose:function(){o(void 0)},onChange:function(e){o(void 0),c(e),l&&URL.revokeObjectURL(l),i(URL.createObjectURL(e))}}))})},144:function(e,t,a){},153:function(e,t,a){"use strict";var n=a(0),s=a(2),c=a(6),r=a(132),o=a(119);a(144);const l=[0,50],i=[0,20],d=[20,0],m=c.l?s.Db:s.Cb;t.a=Object(n.h)(({isPasswordVisible:e,isBig:t})=>{const[a,c]=Object(n.r)(),[u,h]=Object(n.r)(),[b,g]=Object(n.r)(!1),[p,v]=Object(n.r)(!1);Object(n.n)(()=>{a?setTimeout(()=>v(!0),2e3):Object(r.a)("MonkeyClose").then(c)},[a]),Object(n.n)(()=>{u||Object(r.a)("MonkeyPeek").then(h)},[u]);const O=Object(n.m)(()=>g(!0),[]);return n.a.createElement("div",{id:"monkey",className:t?"big":""},!b&&n.a.createElement("div",{className:"monkey-preview"}),a&&n.a.createElement(o.a,{id:"closeMonkey",size:t?s.Ob:m,className:p?"hidden":"shown",animationData:a,playSegment:l,noLoop:!0,onLoad:O}),u&&n.a.createElement(o.a,{id:"peekMonkey",size:t?s.Ob:m,className:p?"shown":"hidden",animationData:u,playSegment:e?i:d,noLoop:!0}))})},154:function(e,t,a){"use strict";var n=a(0),s=a(2),c=a(6),r=a(9),o=a(16),l=a(21);const i=c.l?550:400;t.a=Object(n.h)(({isLoading:e=!1,isPasswordVisible:t,error:a,hint:d,placeholder:m="Password",submitLabel:u="Next",clearError:h,onChangePasswordVisibility:b,onInputChange:g,onSubmit:p})=>{const v=Object(n.q)(null),O=Object(o.a)(),[E,j]=Object(n.r)(""),[f,C]=Object(n.r)(!1);return Object(n.n)(()=>{c.n||setTimeout(()=>{v.current.focus()},i)},[]),Object(n.n)(()=>{a&&requestAnimationFrame(()=>{v.current.focus(),v.current.select()})},[a]),n.a.createElement("form",{action:"",onSubmit:function(t){t.preventDefault(),e||f&&p(E)},autoComplete:"off"},n.a.createElement("div",{className:Object(r.a)("input-group password-input",E&&"touched",a&&"error"),dir:O.isRtl?"rtl":void 0},n.a.createElement("input",{ref:v,className:"form-control",type:t?"text":"password",id:"sign-in-password",value:E||"",autoComplete:"current-password",onChange:function(e){a&&h();const{target:t}=e;j(t.value),C(t.value.length>=s.jb),g&&g(t.value)},dir:"auto"}),n.a.createElement("label",null,a||d||m),n.a.createElement("div",{className:"toggle-password",onClick:function(){b(!t)},role:"button",tabIndex:0,title:"Toggle password visibility"},n.a.createElement("i",{className:t?"icon-eye":"icon-eye-closed"}))),f&&n.a.createElement(l.a,{type:"submit",ripple:!0,isLoading:e},u))})},156:function(e,t,a){},157:function(e,t,a){},174:function(e,t,a){},196:function(e,t,a){},267:function(e,t,a){},268:function(e,t,a){},269:function(e,t,a){},270:function(e,t,a){},271:function(e,t,a){},272:function(e,t,a){},273:function(e,t,a){},274:function(e,t,a){},275:function(e,t,a){},276:function(e,t,a){},277:function(e,t,a){},278:function(e,t,a){},279:function(e,t,a){},280:function(e,t,a){},281:function(e,t,a){},282:function(e,t,a){},283:function(e,t,a){},284:function(e,t,a){},285:function(e,t,a){},286:function(e,t,a){},287:function(e,t,a){},288:function(e,t,a){},289:function(e,t,a){},290:function(e,t,a){},291:function(e,t,a){},292:function(e,t,a){},293:function(e,t,a){},294:function(e,t,a){},295:function(e,t,a){},296:function(e,t,a){},297:function(e,t,a){},298:function(e,t,a){},299:function(e,t,a){},300:function(e,t,a){},301:function(e,t,a){},302:function(e,t,a){},303:function(e,t,a){},304:function(e,t,a){},305:function(e,t,a){},306:function(e,t,a){},307:function(e,t,a){},308:function(e,t,a){},309:function(e,t,a){},310:function(e,t,a){},311:function(e,t,a){},312:function(e,t,a){},313:function(e,t,a){},314:function(e,t,a){},315:function(e,t,a){},316:function(e,t,a){},317:function(e,t,a){},318:function(e,t,a){},319:function(e,t,a){},320:function(e,t,a){},321:function(e,t,a){},322:function(e,t,a){},323:function(e,t,a){},324:function(e,t,a){}}]); -//# sourceMappingURL=3.86fc6942f17ca54599b3.js.map \ No newline at end of file diff --git a/dist/3.86fc6942f17ca54599b3.js.map b/dist/3.86fc6942f17ca54599b3.js.map deleted file mode 100644 index 65669cf3..00000000 --- a/dist/3.86fc6942f17ca54599b3.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["webpack:///./src/components/mediaViewer/helpers/ghostAnimation.ts","webpack:///./src/components/mediaViewer/SenderInfo.tsx","webpack:///./src/components/mediaViewer/MediaViewerActions.tsx","webpack:///./src/components/mediaViewer/MediaViewerFooter.tsx","webpack:///./src/hooks/useFullscreen.ts","webpack:///./src/components/mediaViewer/helpers/formatFileSize.ts","webpack:///./src/components/mediaViewer/VideoPlayerControls.tsx","webpack:///./src/components/mediaViewer/VideoPlayer.tsx","webpack:///./src/components/mediaViewer/ZoomControls.tsx","webpack:///./src/components/mediaViewer/PanZoom.tsx","webpack:///./src/components/mediaViewer/MediaViewer.tsx","webpack:///./src/components/main/ForwardPicker.tsx","webpack:///./src/components/main/Dialogs.tsx","webpack:///./src/components/main/Notifications.tsx","webpack:///./src/components/main/SafeLinkModal.tsx","webpack:///./src/components/common/CalendarModal.tsx","webpack:///./src/components/main/HistoryCalendar.tsx","webpack:///./src/components/common/DeleteMessageModal.tsx","webpack:///./src/components/common/PinMessageModal.tsx","webpack:///./src/components/common/UnpinAllMessagesModal.tsx","webpack:///./src/components/middle/DeleteSelectedMessageModal.tsx","webpack:///./src/components/common/ReportMessageModal.tsx","webpack:///./src/components/middle/MessageSelectToolbar.tsx","webpack:///./src/hooks/useSelectWithEnter.ts","webpack:///./src/components/left/search/LeftSearchResultChat.tsx","webpack:///./src/components/left/search/RecentContacts.tsx","webpack:///./src/components/left/search/ChatMessage.tsx","webpack:///./src/components/left/search/DateSuggest.tsx","webpack:///./src/components/left/search/ChatResults.tsx","webpack:///./src/components/left/search/ChatMessageResults.tsx","webpack:///./src/components/left/search/helpers/createMapStateToProps.ts","webpack:///./src/components/left/search/MediaResults.tsx","webpack:///./src/components/left/search/helpers/getSenderName.ts","webpack:///./src/components/left/search/LinkResults.tsx","webpack:///./src/components/left/search/FileResults.tsx","webpack:///./src/components/left/search/AudioResults.tsx","webpack:///./src/components/left/search/LeftSearch.tsx","webpack:///./src/hooks/reducers/useTwoFaReducer.ts","webpack:///./src/components/left/settings/SettingsHeader.tsx","webpack:///./src/components/left/settings/SettingsMain.tsx","webpack:///./src/components/common/UsernameInput.tsx","webpack:///./src/components/left/settings/SettingsEditProfile.tsx","webpack:///./src/components/left/settings/folders/SettingsFoldersMain.tsx","webpack:///./src/components/ui/ShowMoreButton.tsx","webpack:///./src/components/left/settings/folders/SettingsFoldersEdit.tsx","webpack:///./src/components/left/settings/folders/SettingsFoldersChatsPicker.tsx","webpack:///./src/components/left/settings/folders/SettingsFoldersChatFilters.tsx","webpack:///./src/components/left/settings/folders/SettingsFolders.tsx","webpack:///./src/components/ui/RangeSlider.tsx","webpack:///./src/components/middle/composer/StickerSetCoverAnimated.tsx","webpack:///./src/components/middle/composer/StickerSetCover.tsx","webpack:///./src/components/left/settings/SettingsStickerSet.tsx","webpack:///./src/components/left/settings/SettingsGeneral.tsx","webpack:///./src/util/systemFilesDialog.ts","webpack:///./src/util/colors.ts","webpack:///./src/components/left/settings/WallpaperTile.tsx","webpack:///./src/components/left/settings/SettingsGeneralBackground.tsx","webpack:///./src/components/left/settings/SettingsGeneralBackgroundColor.tsx","webpack:///./src/components/left/settings/SettingsNotifications.tsx","webpack:///./src/components/left/settings/SettingsPrivacy.tsx","webpack:///./src/components/left/settings/SettingsLanguage.tsx","webpack:///./src/components/left/settings/helper/privacy.ts","webpack:///./src/components/left/settings/SettingsPrivacyVisibility.tsx","webpack:///./src/components/left/settings/SettingsPrivacyActiveSessions.tsx","webpack:///./src/components/left/settings/SettingsPrivacyBlockedUsers.tsx","webpack:///./src/components/left/settings/twoFa/SettingsTwoFaEnabled.tsx","webpack:///./src/components/left/settings/twoFa/SettingsTwoFaPassword.tsx","webpack:///./src/components/left/settings/twoFa/SettingsTwoFaStart.tsx","webpack:///./src/components/left/settings/twoFa/SettingsTwoFaSkippableForm.tsx","webpack:///./src/components/left/settings/twoFa/SettingsTwoFaCongratulations.tsx","webpack:///./src/components/left/settings/twoFa/SettingsTwoFaEmailCode.tsx","webpack:///./src/components/left/settings/twoFa/SettingsTwoFa.tsx","webpack:///./src/components/left/settings/SettingsPrivacyVisibilityExceptionList.tsx","webpack:///./src/components/left/settings/Settings.tsx","webpack:///./src/components/left/main/ContactList.tsx","webpack:///./src/components/left/newChat/NewChatStep1.tsx","webpack:///./src/components/left/newChat/NewChatStep2.tsx","webpack:///./src/components/left/newChat/NewChat.tsx","webpack:///./src/components/left/ArchivedChats.tsx","webpack:///./src/util/scrollLock.ts","webpack:///./src/components/middle/message/helpers/copyOptions.ts","webpack:///./src/components/middle/message/MessageContextMenu.tsx","webpack:///./src/components/middle/message/ContextMenuContainer.tsx","webpack:///./src/components/common/StickerSetModal.tsx","webpack:///./src/components/middle/HeaderMenuContainer.tsx","webpack:///./src/components/middle/MobileSearch.tsx","webpack:///./src/util/findInViewport.ts","webpack:///./src/util/isFullyVisible.ts","webpack:///./src/util/setTooltipItemVisible.ts","webpack:///./src/components/middle/composer/MentionTooltip.tsx","webpack:///./src/components/middle/composer/AttachmentModal.tsx","webpack:///./src/components/middle/composer/PollModal.tsx","webpack:///./src/hooks/useMouseInside.ts","webpack:///./src/components/middle/composer/EmojiButton.tsx","webpack:///./src/components/middle/composer/EmojiCategory.tsx","webpack:///./src/components/middle/composer/EmojiPicker.tsx","webpack:///./src/components/middle/composer/StickerSet.tsx","webpack:///./src/components/middle/composer/StickerPicker.tsx","webpack:///./src/components/common/GifButton.tsx","webpack:///./src/components/middle/composer/GifPicker.tsx","webpack:///./src/components/middle/composer/SymbolMenuFooter.tsx","webpack:///./src/components/middle/composer/SymbolMenu.tsx","webpack:///./src/components/middle/composer/AttachMenu.tsx","webpack:///./src/components/middle/composer/StickerTooltip.tsx","webpack:///./src/components/middle/composer/BotKeyboardMenu.tsx","webpack:///./src/components/middle/composer/CustomSendMenu.tsx","webpack:///./src/components/middle/composer/EmojiTooltip.tsx","webpack:///./src/components/middle/composer/inlineResults/BaseResult.tsx","webpack:///./src/components/middle/composer/inlineResults/MediaResult.tsx","webpack:///./src/components/middle/composer/inlineResults/ArticleResult.tsx","webpack:///./src/components/middle/composer/inlineResults/GifResult.tsx","webpack:///./src/components/middle/composer/inlineResults/StickerResult.tsx","webpack:///./src/components/middle/composer/InlineBotTooltip.tsx","webpack:///./src/components/right/RightSearch.tsx","webpack:///./src/components/right/StickerSetResult.tsx","webpack:///./src/components/right/StickerSearch.tsx","webpack:///./src/components/right/GifSearch.tsx","webpack:///./src/components/right/PollAnswerResults.tsx","webpack:///./src/components/right/PollResults.tsx","webpack:///./src/components/right/management/ManageUser.tsx","webpack:///./src/components/right/management/ManageGroup.tsx","webpack:///./src/components/right/management/ManageGroupPermissions.tsx","webpack:///./src/components/right/management/ManageGroupRemovedUsers.tsx","webpack:///./src/components/right/management/ManageChannel.tsx","webpack:///./src/components/right/management/ManageChatPrivacyType.tsx","webpack:///./src/components/right/management/ManageDiscussion.tsx","webpack:///./src/components/right/management/ManageGroupUserPermissions.tsx","webpack:///./src/components/right/management/ManageChatAdministrators.tsx","webpack:///./src/components/right/management/ManageGroupRecentActions.tsx","webpack:///./src/components/right/management/ManageGroupAdminRights.tsx","webpack:///./src/components/right/management/ManageGroupMembers.tsx","webpack:///./src/components/right/management/ManageGroupUserPermissionsCreate.tsx","webpack:///./src/components/right/management/Management.tsx","webpack:///./src/components/middle/helpers/getCurrencySign.ts","webpack:///./src/components/common/helpers/detectCardType.ts","webpack:///./src/hooks/reducers/usePaymentReducer.ts","webpack:///./src/hooks/useFocusAfterAnimation.tsx","webpack:///./src/components/ui/Select.tsx","webpack:///./src/components/payment/ShippingInfo.tsx","webpack:///./src/components/payment/Shipping.tsx","webpack:///./src/components/payment/Checkout.tsx","webpack:///./src/components/payment/ExpiryInput.tsx","webpack:///./src/components/middle/helpers/inputFormatters.ts","webpack:///./src/assets/mastercard.svg","webpack:///./src/assets/visa.svg","webpack:///./src/components/payment/CardInput.tsx","webpack:///./src/components/payment/PaymentInfo.tsx","webpack:///./src/components/payment/PaymentModal.tsx","webpack:///./src/components/payment/ReceiptModal.tsx","webpack:///./src/components/common/helpers/animatedAssets.ts","webpack:///./src/assets/TwoFactorSetupMonkeyIdle.tgs","webpack:///./src/assets/TwoFactorSetupMonkeyTracking.tgs","webpack:///./src/assets/TwoFactorSetupMonkeyClose.tgs","webpack:///./src/assets/TwoFactorSetupMonkeyPeek.tgs","webpack:///./src/assets/FoldersAll.tgs","webpack:///./src/assets/FoldersNew.tgs","webpack:///./src/assets/DiscussionGroupsDucks.tgs","webpack:///./src/components/ui/CropModal.tsx","webpack:///./src/components/ui/AvatarEditable.tsx","webpack:///./src/components/common/PasswordMonkey.tsx","webpack:///./src/components/common/PasswordForm.tsx"],"names":["animateOpening","hasFooter","origin","bestImageData","dimensions","isVideo","message","mediaEl","fromImage","getNodes","width","windowWidth","windowSize","get","availableWidth","height","availableHeight","getMediaViewerAvailableDimensions","toWidth","toHeight","calculateDimensions","toLeft","toTop","mql","window","matchMedia","MEDIA_VIEWER_MEDIA_QUERY","topOffsetRem","matches","REM","getTopOffset","top","fromTop","left","fromLeft","fromWidth","fromHeight","getBoundingClientRect","MediaViewerOrigin","SharedMedia","Album","ScheduledAlbum","SearchResult","includes","uncovered","realWidth","realHeight","size","Math","max","srcWidth","srcHeight","uncover","fromTranslateX","fromTranslateY","fromScaleX","fromScaleY","ghost","createGhost","applyStyles","transform","applyShape","document","body","classList","add","requestAnimationFrame","appendChild","style","firstChild","objectFit","remove","clearShape","setTimeout","contains","removeChild","ANIMATION_END_DELAY","animateClosing","container","toImage","getElementById","querySelector","targetTop","el","display","rect","windowHeight","isElementInViewport","shouldFadeOut","Inline","ScheduledInline","isMessageImageFullyVisible","existingGhost","getElementsByClassName","ProfileAvatar","transition","transformOrigin","opacity","source","shouldAppendProfileInfo","createElement","img","Image","src","HTMLVideoElement","poster","profileInfo","cloneNode","imageEl","messageListElement","imgOffsetTop","offsetTop","closest","id","parentElement","scrollTop","offsetHeight","element","styles","Object","assign","containerSelector","mediaSelector","MiddleHeaderAvatar","mediaEls","querySelectorAll","length","withGlobal","global","chatId","messageId","isAvatar","sender","isChatPrivate","selectUser","selectChat","selectChatMessage","selectSender","setGlobal","actions","pick","closeMediaViewer","focusMessage","handleFocusMessage","useCallback","lang","useLang","isFromChat","senderTitle","getSenderTitle","className","onClick","Avatar","key","chat","user","dir","renderText","formatMediaDateTime","date","MediaViewerActions","mediaData","isZoomed","fileName","onCloseMediaViewer","onForward","onZoomToggle","isDownloadStarted","downloadProgress","handleDownloadClick","useMediaDownload","getMessageMediaHash","undefined","MenuButton","useMemo","onTrigger","isOpen","Button","round","color","ariaLabel","IS_SINGLE_COLUMN_LAYOUT","DropdownMenu","trigger","positionX","MenuItem","icon","href","download","ProgressSpinner","progress","noCross","MediaViewerFooter","text","isHidden","isForVideo","isMultiline","setIsMultiline","useState","useEffect","footerContent","checkIsMultiline","clientHeight","handleResize","throttle","addEventListener","removeEventListener","classNames","buildClassName","e","stopPropagation","prop","fullscreenElement","mozFullScreenElement","webkitFullscreenElement","getBrowserFullscreenElementProp","units","bytes","number","floor","log","toFixed","stopEvent","VideoPlayerControls","bufferedProgress","currentTime","duration","fileSize","isForceVisible","isForceMobileVersion","isPlayed","isFullscreenSupported","isFullscreen","onChangeFullscreen","onPlayPause","onSeek","isVisible","setVisibility","timeout","clearTimeout","downloadedPercent","totalSize","percentagePlayed","percentageBuffered","min","step","type","onInput","value","renderSeekLine","ripple","formatMediaDuration","renderTime","formatFileSize","memo","url","isGif","posterData","posterSize","isMediaViewerOpen","noPlay","onClose","videoRef","useRef","setIsPlayed","IS_TOUCH_ENV","IS_IOS","setCurrentTime","isControlsVisible","setIsControlsVisible","setFullscreen","exitFullscreen","elRef","setIsFullscreen","Boolean","useLayoutEffect","listener","listenerEnter","listenerExit","video","current","PLATFORM_ENV","requestFullscreen","webkitRequestFullscreen","webkitEnterFullscreen","mozRequestFullScreen","mozCancelFullScreen","webkitCancelFullScreen","webkitExitFullscreen","useFullscreenStatus","isBuffered","bufferingHandlers","useBuffering","shouldRender","shouldRenderSpinner","transitionClassNames","spinnerClassNames","useShowTransition","shouldRenderPlayButton","playButtonClassNames","pause","safePlay","togglePlayState","play","useVideoCleanup","handleMouseOver","handleMouseOut","handleTimeUpdate","currentTarget","handleEnded","handleFullscreenChange","handleSeek","Number","target","toggleControls","togglePayingStateBySpace","preventDefault","wrapperStyle","videoStyle","onMouseOver","onMouseOut","ref","autoPlay","playsInline","loop","muted","onEnded","onDoubleClick","onTimeUpdate","join","square","isShown","onChangeZoom","prevIsShown","usePrevious","inputRef","zoomLevel","setZoomLevel","isSeeking","handleStartSeek","handleStopSeek","disabled","onChange","onMouseDown","onMouseUp","INITIAL_MATRIX","SCALE_VALUES","1","1.5","2","2.5","3","children","noWrap","canPan","panDeltaX","panDeltaY","onPan","tunedZoomLevel","isDragging","setIsDragging","dragData","setDragData","dx","dy","x","y","matrixData","setMatrixData","panWrapperRef","panContainerRef","newZoomLevel","newPandx","newPandy","newMatrixData","areSortedArraysEqual","oldScale","wrapper","image","wrapperRect","imageRect","newImgWidth","newImgHeight","newImgX","newImgY","calculateSafeZoneOnZoom","toString","newDragData","pageX","pageY","onMouseMove","deltaX","deltaY","getNewMatrixData","renderPhoto","blobUrl","imageSize","canDrag","alt","draggable","Spinner","threadId","avatarOwnerId","profilePhotoIndex","mediaViewer","animationLevel","settings","byKey","senderId","avatarOwner","chatMessages","collectionIds","selectScheduledMessage","selectScheduledMessages","selectChatMessages","selectOutlyingIds","selectListedIds","currentSearch","selectCurrentMediaSearch","foundIds","resultsByType","media","openMediaViewer","openForwardMenu","isFromSharedMedia","isFromSearch","photo","getMessagePhoto","getMessageVideo","webPagePhoto","getMessageWebPagePhoto","webPageVideo","getMessageWebPageVideo","isDocumentPhoto","isMessageDocumentPhoto","isDocumentVideo","isMessageDocumentVideo","isPhoto","isSingleSlide","messageIds","getChatMediaMessageIds","selectedMediaMessageIndex","indexOf","isFirst","isLast","animationKey","prevSenderId","slideAnimation","headerAnimation","isGhostAnimation","isFooterHidden","setIsFooterHidden","canPanZoomWrap","setCanPanZoomWrap","setIsZoomed","panDelta","setPanDelta","getMediaHash","isFull","photos","getChatAvatarHash","blobUrlPictogram","useMedia","ApiMediaFormat","BlobUrl","previewMediaHash","blobUrlPreview","startsWith","DataUri","fullMediaData","useMediaWithDownloadProgress","getMessageMediaFormat","localBlobUrl","thumbDataUri","useBlurSync","getMessageMediaThumbDataUri","videoSize","getMessageFileSize","getMessageFileName","getMessageDocument","mediaSize","getPhotoFullDimensions","getVideoDimensions","AVATAR_FULL_DIMENSIONS","toggle","forceUpdate","useForceUpdate","addListener","removeListener","prevMessage","prevOrigin","prevAvatarOwner","prevBestImageData","dispatchHeavyAnimationEvent","textParts","renderMessageText","timer","closeZoom","handleZoomToggle","handleZoomValue","level","canCloseZoom","close","handleFooterClick","handleForward","fromChatId","captureEscKeyListener","stopCurrentAudio","disableRefresh","enableRefresh","getMessageId","fromId","direction","index","selectPreviousMedia","selectNextMedia","handleKeyDown","shouldCloseOnVideo","captureEvents","excludedClosestSelector","onSwipe","SwipeDirection","Right","Left","handlePan","handleToggleFooterVisibility","renderSlide","isActive","calculateMediaViewerDimensions","renderSenderInfo","useHistoryBack","ShowTransition","isRtl","Transition","activeKey","name","aria-label","chats","byId","chatsById","listIds","orderedPinnedIds","currentUserId","pinnedIds","active","activeListIds","archivedListIds","archived","setForwardChatId","exitForwardMode","loadMoreChats","filter","setFilter","focus","blur","chatIds","priorityIds","unique","sortChatIds","getCanPostInChat","MAIN_THREAD_ID","searchWords","getChatTitle","viewportIds","getMore","useInfiniteScroll","handleFilterChange","containerRef","useKeyboardListNavigation","modalHeader","InputText","onKeyDown","placeholder","Modal","header","InfiniteScroll","items","onLoadMore","noScrollRestore","map","ListItem","PrivateChatInfo","status","userId","GroupChatInfo","Loading","getErrorHeader","error","isSlowMode","hasErrorKey","dialogs","dismissDialog","acceptInviteConfirmation","dialog","invite","hash","title","participantsCount","isChannel","participantsText","joinText","isText","renderInvite","getReadableErrorText","notifications","dismissNotification","Notification","onDismiss","toggleSafeLinkModal","handleOpen","open","handleDismiss","renderingUrl","useCurrentOrPrev","ConfirmDialog","confirmLabel","confirmHandler","WEEKDAY_LETTERS","isDisabledDay","year","month","day","minDate","maxDate","selectedDay","Date","fixedMinDate","getFullYear","getMonth","getDate","fixedMaxDate","formatInputTime","String","padStart","selectedAt","maxAt","isFutureMode","isPastMode","withTimePicker","submitButtonLabel","secondButtonLabel","onSubmit","onSecondButtonClick","now","defaultSelectedDate","prevIsOpen","selectedDate","setSelectedDate","selectedHours","setSelectedHours","getHours","selectedMinutes","setSelectedMinutes","getMinutes","currentYear","currentMonth","currentDate","shouldDisableNextMonth","shouldDisablePrevMonth","calendarGrid","grid","setFullYear","setMonth","setDate","monthStartDay","getDay","i","push","gridDate","buildCalendarGrid","handleChangeHours","replace","hours","getTime","setHours","hoursStr","handleChangeMinutes","minutes","setMinutes","minutesStr","d","dateCopy","role","tabIndex","handleDateSelect","inputMode","formatDateToString","code","today","formatTime","formatSubmitLabel","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","selectedMessagesCount","selectSelectedMessagesCount","canDeleteMessages","canReportMessages","canPost","openForwardMenuForSelectedMessages","isDeleteModalOpen","openDeleteModal","closeDeleteModal","useFlag","isReportModalOpen","openReportModal","closeReportModal","captureKeyboardListeners","onBackspace","onDelete","onEsc","prevSelectedMessagesCount","renderingSelectedMessagesCount","formattedMessagesCount","destructive","onSelect","buttonRef","activeElement","privateChatUserId","privateChatUser","isPinned","selectIsChatPinned","isMuted","selectIsChatMuted","selectNotifySettings","selectNotifyExceptions","withUsername","contextActions","useChatContextActions","handleDelete","handleClick","useSelectWithEnter","avatarSize","DeleteChatModal","runThrottled","cb","userIds","topUserIds","topPeers","usersById","users","recentlyFoundChatIds","globalSearch","onReset","loadTopUsers","loadContactList","openChat","addRecentlyFoundChatId","clearRecentlyFoundChats","topUsersRef","useHorizontalScroll","shouldReplaceHistory","lastSyncTime","searchQuery","mediaThumbnail","mediaBlobUrl","isRoundVideo","getMessageRoundVideo","withOnlineStatus","isSavedMessages","isSelf","isVerified","VerifiedIcon","Link","formatPastTimeShort","getMessageSummaryText","highlight","renderMessageSummary","searchDate","suggestions","match","suggestion","latestYear","getSuggestionsFromDate","localContactIds","contactList","fetchingStatus","globalResults","localResults","globalChatIds","globalUserIds","localChatIds","localUserIds","byChatId","globalMessagesByChatId","dateSearchQuery","onSearchDateSelect","searchMessagesGlobal","setGlobalSearchChatId","shouldShowMoreLocal","setShouldShowMoreLocal","shouldShowMoreGlobal","setShouldShowMoreGlobal","handleLoadMore","LoadMoreDirection","Backwards","query","handleChatClick","handlePickerItemClick","MEMO_EMPTY_ARRAY","foundContactIds","fullName","getUserFullName","username","foundMessages","split","sort","a","b","handleClickShowMoreLocal","handleClickShowMoreGlobal","nothingFound","noScrollRestoreOnTop","noFastList","NothingFound","PickerSelectedItem","chatOrUserId","clickArg","createMapStateToProps","props","currentType","isVoice","theme","selectTheme","isLoading","searchChatId","handleSelectMedia","canRenderContents","useAsyncRendering","SLIDE_TRANSITION_DURATION","isMediaGrid","isMessageList","itemSelector","Media","idPrefix","getSenderName","senderName","isChatGroup","handleMessageFocus","shouldDrawDateDivider","toYearMonth","formatMonthAndYear","WebLink","onMessageClick","Document","withDate","datetime","smaller","onDateClick","openAudioPlayer","handlePlayAudio","Audio","onPlay","TABS","GlobalSearchContent","ChatList","Links","Files","Music","Voice","CHAT_TABS","slice","TRANSITION_RENDER_COUNT","keys","currentContent","setGlobalSearchContent","setGlobalSearchDate","activeTab","setActiveTab","parseDateString","handleSwitchTab","tab","content","handleSearchDateSelect","TabList","tabs","onSwitchTab","renderCount","INITIAL_STATE","currentPassword","password","hint","email","twoFaReducer","state","action","payload","currentScreen","editedFolderId","onSaveFilter","signOut","deleteChatFolder","isSignOutDialogOpen","setIsSignOutDialogOpen","isDeleteFolderDialogOpen","setIsDeleteFolderDialogOpen","openSignOutConfirmation","closeSignOutConfirmation","openDeleteFolderConfirmation","closeDeleteFolderConfirmation","handleSignOutMessage","handleDeleteFolderMessage","SettingsMenuButton","SettingsScreens","EditProfile","General","Notifications","Privacy","Language","GeneralChatBackground","GeneralChatBackgroundColor","PrivacyPhoneNumber","PrivacyLastSeen","PrivacyProfilePhoto","PrivacyForwarding","PrivacyGroupChats","PrivacyPhoneNumberAllowedContacts","PrivacyLastSeenAllowedContacts","PrivacyProfilePhotoAllowedContacts","PrivacyForwardingAllowedContacts","PrivacyGroupChatsAllowedContacts","PrivacyPhoneNumberDeniedContacts","PrivacyLastSeenDeniedContacts","PrivacyProfilePhotoDeniedContacts","PrivacyForwardingDeniedContacts","PrivacyGroupChatsDeniedContacts","PrivacyActiveSessions","PrivacyBlockedUsers","TwoFaDisabled","TwoFaEnabled","TwoFaNewPassword","TwoFaChangePasswordNew","TwoFaChangePasswordConfirm","TwoFaNewPasswordConfirm","TwoFaNewPasswordHint","TwoFaChangePasswordHint","TwoFaNewPasswordEmail","TwoFaRecoveryEmail","TwoFaNewPasswordEmailCode","TwoFaRecoveryEmailCode","TwoFaCongratulations","TwoFaChangePasswordCurrent","TwoFaTurnOff","TwoFaRecoveryEmailCurrentPassword","Folders","FoldersCreateFolder","FoldersEditFolder","FoldersEditFolderFromChatList","FoldersIncludedChats","FoldersIncludedChatsFromChatList","FoldersExcludedChats","FoldersExcludedChatsFromChatList","renderHeaderContent","confirmIsDestructive","currentUser","onScreenSelect","Main","formatPhoneNumberWithCode","phoneNumber","LINK_PREFIX_REGEX","USERNAME_REGEX","runDebouncedForCheckUsername","debounce","currentUsername","asLink","isUsernameAvailable","checkUsername","setUsername","langPrefix","usernameSuccess","usernameError","test","handleUsernameChange","newUsername","trim","isValid","isUsernameValid","success","readOnly","profileEdit","firstName","currentFirstName","lastName","currentLastName","fullInfo","bio","currentBio","currentAvatarHash","loadCurrentUser","updateProfile","isUsernameTouched","setIsUsernameTouched","isProfileFieldsTouched","setIsProfileFieldsTouched","setError","setPhoto","setFirstName","setLastName","setBio","currentAvatarBlobUrl","ProfileEditProgress","InProgress","isUsernameError","isSaveButtonShown","Complete","handlePhotoChange","newPhoto","handleFirstNameChange","handleLastNameChange","handleBioChange","handleProfileSave","trimmedFirstName","trimmedLastName","trimmedBio","AvatarEditable","UsernameInput","FloatingActionButton","runThrottledForLoadRecommended","orderedIds","orderedFolderIds","foldersById","recommended","recommendedChatFolders","chatFolders","notifySettings","notifyExceptions","onCreateFolder","onEditFolder","loadRecommendedChatFolders","addChatFolder","showDialog","animationData","setAnimationData","isAnimationLoaded","setIsAnimationLoaded","handleAnimationLoad","getAnimationData","then","handleCreateFolder","data","userFolders","folder","subtitle","getFolderDescriptionText","handleCreateFolderFromRecommended","AnimatedSticker","STICKER_SIZE_FOLDER_SETTINGS","noLoop","onLoad","pill","fluid","narrow","multiline","ShowMoreButton","count","itemName","itemPluralName","ERROR_NO_TITLE","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","listType","renderChats","mode","visibleChatIds","isExpanded","leftChatsCount","clickHandler","chatType","INCLUDED_CHAT_TYPES","find","typeKey","EXCLUDED_CHAT_TYPES","inactive","renderChatType","event","isTouched","folderUpdate","selectedIds","filterValue","onSelectedIdsChange","onSelectedChatTypesChange","onFilterChange","chatTypes","shouldMinimize","hasMaxChats","handleItemClick","newSelectedIds","splice","handleChatTypeClick","newSelectedChatTypes","selectedType","isMinimized","canClose","Checkbox","checked","isSelected","withChatType","archivedPinnedIds","chatFilter","activeChatArrays","prepareChatList","archivedChatArrays","pinnedChats","otherChats","displayedIds","newFilter","handleSelectedIdsChange","ids","includeFilters","excludeFilters","handleSelectedChatTypesChange","newFilters","forEach","shownScreen","handleReset","handleEditFolder","handleAddIncludedChats","handleAddExcludedChats","range","handleChange","trackWidth","possibleValuesLength","option","STICKER_SIZE_PICKER_HEADER","stickerSet","observeIntersection","isIntersecting","useIsIntersecting","mediaHash","lottieData","Lottie","shouldRenderFullMedia","useTransitionForMedia","getFirstLetters","hasThumbnail","stickers","firstSticker","isAnimated","STICKER_SIZE_GENERAL_SETTINGS","StickerButton","sticker","ANIMATION_LEVEL_OPTIONS","stickerSetIds","added","setIds","stickerSetsById","setsById","messageTextSize","messageSendKeyCombo","shouldAutoDownloadMediaFromContacts","shouldAutoDownloadMediaInPrivateChats","shouldAutoDownloadMediaInGroups","shouldAutoDownloadMediaInChannels","shouldAutoPlayGifs","shouldAutoPlayVideos","shouldSuggestStickers","shouldLoopStickers","setSettingOption","loadStickerSets","loadAddedStickers","stickerSettingsRef","observe","observeIntersectionForCovers","useIntersectionObserver","rootRef","isModalOpen","openModal","closeModal","setSticker","KEYBOARD_SEND_OPTIONS","subLabel","IS_MAC_OS","handleAnimationLevelChange","newLevel","_","handleMessageTextSizeChange","newSize","documentElement","setProperty","setAttribute","handleStickerSetClick","stickerSets","installedDate","onCheck","isChecked","fromSticker","fileSelector","openSystemFilesDialog","accept","callback","noMultiple","removeAttribute","onchange","click","hex2rgb","param","parseInt","substring","rgb2hex","p0","p1","p2","rgb2hsb","r","g","h","s","v","hsb2rgb","f","p","q","t","getPatternColor","rgbColor","hue","saturation","wallpaper","slug","localMediaHash","previewBlobUrl","thumbRef","useCanvasBlur","thumbnail","dataUri","shouldRenderThumb","isDownloadAllowed","setIsDownloadAllowed","fullMedia","wasDownloadDisabled","UPLOADING_WALLPAPER_SLUG","cacheKeyRef","handleSelect","blob","fetchBlob","cacheApi","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","onCapture","onDrag","onRelease","withCursor","hex","hueHex","w","ctx","imgData","createImageData","pixels","col","perY","st","ed","perX","putImageData","drawColor","drawHue","handleRgbChange","rgbValue","channel","handleHexChange","hexValue","handlePredefinedColorClick","dataset","data-color","hasPrivateChatsNotifications","hasPrivateChatsMessagePreview","hasGroupNotifications","hasGroupMessagePreview","hasBroadcastNotifications","hasBroadcastMessagePreview","hasContactJoinedNotifications","loadNotificationSettings","updateContactSignUpNotification","updateNotificationSettings","handleSettingsChange","peerType","setting","currentIsSilent","currentShouldShowPreviews","shouldShowPreviews","handleContactNotificationChange","hasPassword","isSensitiveEnabled","canChangeSensitive","privacy","blocked","activeSessions","blockedCount","totalCount","sessionsCount","visibilityPrivacyPhoneNumber","visibility","visibilityPrivacyLastSeen","lastSeen","visibilityPrivacyProfilePhoto","profilePhoto","visibilityPrivacyForwarding","forwards","visibilityPrivacyGroupChats","chatInvite","loadPrivacySettings","loadBlockedContacts","loadAuthorizations","loadContentSettings","updateContentSettings","getVisibilityValue","languages","language","loadLanguages","selectedLanguage","setSelectedLanguage","markIsLoading","unmarkIsLoading","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","renderSession","handler","dateActive","appName","ip","sessions","chatsByIds","usersByIds","blockedIds","unblockContact","handleUnblockClick","contactId","viewportOffset","isPrivate","CHAT_HEIGHT_PX","renderContact","animatedEmoji","selectAnimatedEmoji","AnimatedEmoji","expectedPassword","submitLabel","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","handleSelectedContactIdsChange","contactsIds","itemIds","filterPlaceholder","searchInputId","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","renderCurrentSectionContent","LAYERS_ANIMATION_NAME","contactIds","serverTimeOffset","resultIds","sortUserIds","forceShowSelf","isSearching","selectedMemberIds","onSelectedMemberIdsChange","onNextStep","setGlobalSearchQuery","isUserBot","canBeInvitedToGroup","handleNextStep","creationProgress","creationError","chatCreation","memberIds","createGroupChat","createChannel","setTitle","about","setAbout","ChatCreationProgress","handleTitleChange","handleCreateGroup","handleCreateChannel","renderedError","RENDER_COUNT","LeftColumnContent","onContentChange","newChatMemberIds","setNewChatMemberIds","NewChannelStep2","NewGroupStep2","isStepActive","NewChannelStep1","NewGroupStep1","Archived","folderType","IGNORED_KEYS","Down","ArrowDown","Up","ArrowUp","ArrowLeft","ArrowRight","PageUp","PageDown","End","Home","Tab","preventDefaultForScrollKeys","HTMLElement","tagName","getAttribute","isTextBox","disableScrolling","passive","ontouchmove","onkeydown","enableScrolling","getCopyLabel","hasSelection","MessageContextMenu","anchor","canSendNow","canReschedule","canReply","canEdit","canPin","canUnpin","canForward","canFaveSticker","canUnfaveSticker","canCopy","canCopyLink","canSelect","onReply","onEdit","onPin","onReport","onFaveSticker","onUnfaveSticker","onSend","onReschedule","onCloseAnimationEnd","onCopyLink","copyOptions","afterEffect","getMessageText","canImageBeCopied","hasMessageLocalBlobUrl","CLIPBOARD_ITEM_SUPPORTED","selection","getSelection","Promise","resolve","mediaLoader","copyImageToClipboard","anchorNode","parentNode","clipboardText","copyTextToClipboard","getMessageCopyOptions","getTriggerElement","getRootElement","getMenuElement","positionY","useContextMenuPosition","Menu","noOptions","isScheduled","chatUsername","setReplyingToId","setEditingId","faveSticker","unfaveSticker","toggleMessageSelection","sendScheduledMessages","rescheduleMessage","isMenuOpen","setIsMenuOpen","setIsDeleteModalOpen","setIsReportModalOpen","isPinModalOpen","setIsPinModalOpen","isCalendarOpen","openCalendar","closeCalendar","closeMenu","closePinModal","handleCloseCalendar","handleReply","handleEdit","handlePin","handleUnpin","handleFaveSticker","handleUnfaveSticker","handleSelectMessage","params","childMessageIds","withShift","handleScheduledMessageSend","handleOpenCalendar","handleRescheduleMessage","scheduledAt","handleCopyLink","abs","reportMessageIds","scheduledMaxDate","getDayStartAt","selectStickerSet","stickerSetId","loadStickers","toggleStickerSet","sendMessage","throttleMs","isDisabled","stickerSetAccessHash","isPreloadedGlobally","handleButtonClick","hasCloseButton","STICKER_SIZE_MODAL","isRestricted","canDeleteChat","getCanDeleteChat","canStartBot","canRestartBot","canSubscribe","canSearch","canMute","canLeave","onSubscribeChannel","onSearchClick","updateChatMutedState","enterMessageSelectMode","sendBotCommand","restartBot","handleStartBot","command","handleRestartBot","handleToggleMuteClick","handleSubscribe","handleSearch","handleSelectMessages","Portal","runDebouncedForSearch","results","selectCurrentTextSearch","isHistoryCalendarOpen","setLocalTextSearchQuery","searchTextMessagesLocal","closeLocalTextSearch","openHistoryCalendar","focusedIndex","setFocusedIndex","visualViewport","mainEl","pageTop","Array","from","input","div","contentEditable","handleMessageSearchQueryChange","newQuery","handleUp","newFocusIndex","handleDown","SearchInput","findInViewport","selectorOrElements","margin","isDense","shouldContainBottom","isHorizontal","viewportY1","viewportY2","allElements","visibleIndexes","isFound","y1","y2","isFullyVisible","setTooltipItemVisible","selector","first","position","fastSmoothScroll","onInsertUserName","filteredUsers","getSelectedIndex","newIndex","cycleRestrict","selectedMentionIndex","setSelectedMentionIndex","handleArrowKey","handleUserSelect","forceFocus","handleSelectMention","member","onUp","onDown","onTab","prevChatMembers","renderedChatMembers","attachments","caption","isReady","groupChatMembers","recentEmojis","baseEmojiKeywords","emojiKeywords","addRecentEmoji","onCaptionUpdate","onFileAppend","onClear","hideTimeoutRef","prevAttachments","renderingAttachments","isHovered","markHovered","unmarkHovered","isQuick","every","quick","isMentionTooltipOpen","mentionFilter","closeMentionTooltip","insertMention","mentionFilteredUsers","useMentionTooltip","EDITABLE_INPUT_MODAL_ID","isEmojiTooltipOpen","closeEmojiTooltip","filteredEmojis","insertEmoji","useEmojiTooltip","sendAttachments","handleFilesDrop","dataTransfer","newFiles","file","CONTENT_TYPES_FOR_QUICK_UPLOAD","has","areAllPhotos","mimeType","areAllVideos","renderHeader","onDragEnter","onDrop","onDragOver","onDragLeave","relatedTarget","toTarget","fromTarget","data-attach-description","attachment","File","filename","extension","getFileExtension","previewData","emojis","onEmojiSelect","MessageInput","isAttachmentModalInput","html","editableInputId","onUpdate","shouldSetFocus","questionInputRef","optionsListRef","solutionRef","question","setQuestion","setOptions","isAnonymous","setIsAnonymous","isMultipleAnswers","setIsMultipleAnswers","isQuizMode","setIsQuizMode","solution","setSolution","correctOption","setCorrectOption","hasErrors","setHasErrors","focusInput","solutionEl","innerHTML","addNewOption","newOptions","list","scrollHeight","scrollTo","behavior","handleCreate","questionTrimmed","optionsTrimmed","o","summary","answers","correct","isPublic","multipleChoice","quiz","entities","parseMessageInput","correctAnswers","solutionEntities","updateOption","removeOption","handleCorrectOptionChange","handleIsAnonymousChange","handleMultipleAnswersChange","handleQuizModeChange","handleKeyPress","keyCode","getQuestionError","getOptionsError","renderOptions","onKeyPress","renderQuizNoOptionError","hidden","closeTimeout","useMouseInside","menuCloseTimeout","isMouseInside","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","canSendStickers","loadRecentStickers","loadFavoriteStickers","addRecentSticker","activeSetIndex","setActiveSetIndex","areAddedLoaded","allSets","noPopulatedSets","set","stickerSetEl","handleStickerSelect","handleStickerUnfave","fullClassName","buttonClassName","gif","videoData","shouldRenderVideo","preload","savedGifs","gifs","saved","canSendGifs","onGifSelect","loadSavedGifs","debounceMs","SymbolMenuTabs","SYMBOL_MENU_TAB_TITLES","SYMBOL_MENU_TAB_ICONS","Emoji","Stickers","GIFs","onRemoveSymbol","onSearchOpen","renderTabButton","handleSearchOpen","isActivated","isLeftColumnShown","allowedAttachmentOptions","setRecentEmojis","handleMouseEnter","handleMouseLeave","fastRaf","recentEmojisRef","renderContent","onMouseEnter","onMouseLeave","noCloseOnBackdrop","onFileSelect","onPollCreate","handleQuickSelect","handleDocumentSelect","canAttachMedia","canAttachPolls","autoClose","forEmoji","clearStickersForEmoji","prevStickers","displayedStickers","clickInlineButton","keyboardButtons","row","button","onSilentSend","onScheduleSend","listEmojis","usePrevDuringAnimation","selectedIndex","setSelectedIndex","setItemVisible","emojisCount","handleSelectEmoji","onLeft","onRight","thumbUrl","thumbnailDataUrl","decoding","isForGallery","inlineResult","webThumbnail","STICKER_SIZE_INLINE_BOT_RESULT","botId","isGallery","inlineBotResults","switchPm","loadMore","onSelectResult","handleSelectInlineBotResult","handleSendPm","startParam","prevInlineBotResults","renderedInlineBotResults","sensitiveArea","inlineBotResult","messagesById","foundResults","senderUser","getGlobal","senderChat","forwardInfo","isChannelPost","orderBy","foundResult","preloadBackwards","LastMessageMeta","selectShouldLoopStickers","isSomeModalOpen","onModalToggle","isAdded","areStickersLoaded","useOnChange","coverStickerIds","covers","otherStickers","handleAddClick","canRenderStickers","STICKER_SIZE_SEARCH","selectCurrentStickerSearch","featured","featuredIds","loadFeaturedStickers","setIsModalOpen","selectCurrentGifSearch","isChatWithBot","selectIsChatWithBot","searchMoreGifs","setGifSearchQuery","getAllowedAttachmentOptions","handleGifClick","hasResults","answer","voters","offsets","pollResults","offset","answerVote","totalVoters","loadPollOptionResults","closePollResults","prevVotersCount","votersCount","setIsLoading","areVotersLoaded","limit","shouldResetVoters","handleViewMoreClick","handleMemberClick","noStatusOrTyping","leftVotersCount","renderViewMoreButton","total","getMessagePoll","resultsByOption","buildCollectionByKey","management","updateContact","deleteUser","deleteHistory","closeManagement","isDeleteDialogOpen","openDeleteDialog","closeDeleteDialog","isNotificationsEnabled","setIsNotificationsEnabled","ManagementProgress","handleNotificationChange","handleDeleteContact","withFullInfo","hasLinkedChannel","linkedChatId","isBasicGroup","canChangeInfo","isCreator","getHasAdminRight","canBanUsers","togglePreHistoryHidden","updateChat","deleteChat","leaveChannel","deleteChannel","currentTitle","currentAbout","imageHash","handleClickEditType","ManagementScreens","ChatPrivacyType","handleClickDiscussion","Discussion","handleClickPermissions","GroupPermissions","handleClickAdministrators","ChatAdministrators","handleSetPhoto","handleAboutChange","handleUpdateGroup","trimmedTitle","trimmedAbout","handleClickMembers","GroupMembers","handleTogglePreHistory","isPreHistoryHidden","isEnabled","enabledPermissionsCount","defaultBannedRights","sendStickers","sendGifs","adminsCount","adminMembers","handleDeleteGroup","formatInteger","onChatMemberSelect","updateChatDefaultBannedRights","permissions","setPermissions","havePermissionChanged","setHavePermissionChanged","handleRemovedUsersClick","GroupRemovedUsers","handleAddExceptionClick","GroupUserPermissionsCreate","handleExceptionMemberClick","promotedByUserId","GroupUserPermissions","handlePermissionChange","getUpdatedPermissionValue","handleSavePermissions","bannedRights","removedUsersCount","kickedMembers","exceptionMembers","members","getMemberExceptions","langKey","getLangKeyForBannedRightKey","translatedString","sendMessages","blocking","sendMedia","sendPolls","embedLinks","inviteUsers","pinMessages","changeInfo","updateChatMemberBannedRights","removedMembers","getRemovedBy","kickedByUserId","kickedByUser","getContextActions","isSignaturesShown","toggleSignatures","hasLinkedChat","handleUpdateChannel","handleToggleSignatures","handleClickSubscribers","ChannelSubscribers","handleDeleteChannel","selectManagement","checkPublicLink","updatePublicLink","updatePrivateLink","privateLink","inviteLink","privacyType","setPrivacyType","isRevokeConfirmDialogOpen","openRevokeConfirmDialog","closeRevokeConfirmDialog","canUpdate","handleOptionChange","handleSave","handleRevokePrivateLink","langPrefix1","langPrefix2","SafeLink","forDiscussionIds","linkedChat","loadGroupsForDiscussion","linkDiscussionGroup","unlinkDiscussionGroup","linkedGroupId","setLinkedGroupId","isConfirmUnlinkGroupDialogOpen","openConfirmUnlinkGroupDialog","closeConfirmUnlinkGroupDialog","isConfirmLinkGroupDialogOpen","openConfirmLinkGroupDialog","closeConfirmLinkGroupDialog","handleUnlinkGroupSessions","channelId","Initial","handleLinkGroupSessions","renderLinkGroupHeader","linkedGroup","renderLinkGroupConfirmText","hasPrivateLink","STICKER_SIZE_DISCUSSION_GROUPS","teactFastList","teactOrderKey","isButtonsInOneRow","isPromotedByCurrentUser","isFormFullyDisabled","selectedChatMemberId","isBanConfirmationDialogOpen","openBanConfirmationDialog","closeBanConfirmationDialog","selectedChatMember","handleBanFromGroup","viewMessages","getControlIsDisabled","isOwner","handleAdminMemberClick","ChatAdminRights","getMemberStatus","promotedByUser","GroupRecentActions","updateChatAdmin","setIsTouched","isDismissConfirmationDialogOpen","openDismissConfirmationDialog","closeDismissConfirmationDialog","customTitle","setCustomTitle","adminRights","handleDismissAdmin","memberStatus","handleCustomTitleChange","postMessages","editMessages","banUsers","addAdmins","anonymous","maxLength","openUserInfo","memberId","managementType","selectCurrentManagementType","CURRENCIES","USD","EUR","GBP","JPY","RUB","UAH","INR","AED","getCurrencySign","currency","VISA","MASTERCARD1","MASTERCARD2","CardType","cards","Default","Visa","Mastercard","detectCardType","cardNumber","streetLine1","streetLine2","city","countryIso2","postCode","phone","shipping","cardholder","expiry","cvv","billingCountry","billingZip","saveInfo","saveCredentials","formErrors","reducer","getBillingCountry","countryCode","countryList","useFocusAfterAnimation","animationDuration","hasArrow","labelText","htmlFor","needEmail","needPhone","needName","needAddress","phoneRef","selectCountryRef","handleAddress1Change","handleAddress2Change","handleCityChange","handleStateChange","handleCountryChange","handlePostCodeChange","handleFullNameChange","handleEmailChange","handlePhoneChange","handleSaveInfoChange","shippingOptions","handleShippingSelect","amount","renderPaymentItem","main","renderCheckoutItem","invoiceContent","prices","shippingPrices","checkoutInfo","totalPrice","photoUrl","paymentMethod","paymentProvider","shippingAddress","shippingMethod","item","expiryInputRef","charAt","parts","formatCardExpiry","cardNumberRef","cardType","setCardType","newCardType","formatCardNumber","cardIcon","mastercardIconPath","visaIconPath","getCardIcon","canSaveCredentials","needCardholderName","needCountry","needZip","handleCardNumberChange","handleCardholderChange","toUpperCase","handleExpiryChange","handleCvvChange","handleBillingPostCodeChange","handleChangeSaveCredentials","savedInfo","invoice","nativeProvider","nativeParams","passwordMissing","payment","isProviderError","nameRequested","phoneRequested","emailRequested","shippingAddressRequested","flexible","phoneToProvider","emailToProvider","globalDialogs","validateRequestedInfo","sendPaymentForm","setPaymentStep","sendCredentialsInfo","clearPaymentError","paymentState","paymentDispatch","currencySign","field","fieldError","errors","getShippingErrors","handleErrorModalClose","PaymentStep","Checkout","shippingOption","getShippingPrices","totalPrices","concat","acc","cur","getTotalPrice","detectCardTypeText","findShippingOption","getCheckoutInfo","validateRequest","requestInfo","getRequestInfo","sendCredentials","credentials","expiryMonth","expiryYear","zip","getCredentials","sendForm","shippingOptionId","setStep","nextStep","ShippingInfo","Shipping","PaymentInfo","buttonText","cuurentStep","renderModalContent","renderError","optionId","receipt","mapedPrices","info","totalAmount","credentialsTitle","fullAddress","ANIMATED_STICKERS_PATHS","MonkeyIdle","MonkeyTracking","MonkeyClose","MonkeyPeek","FoldersAll","FoldersNew","DiscussionGroups","path","location","cropperResultOptions","quality","format","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","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","onInputChange","setPassword","canSubmit","setCanSubmit","select","autoComplete","MIN_PASSWORD_LENGTH"],"mappings":"gpEAeO,SAASA,EACdC,EACAC,EACAC,EACAC,EACAC,EACAC,GAEA,MAAQC,QAASC,GAAcC,EAASP,EAAQI,GAChD,IAAKE,EACH,OAGF,MAAQE,MAAOC,GAAgBC,IAAWC,OAExCH,MAAOI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ACHhM,WAAW,KACTsQ,EAASvD,QAASiR,SACjBi+B,IAEJ,IAEHn0C,YAAU,KACJoY,GACFzgB,sBAAsB,KACpB6Q,EAASvD,QAASiR,QAClB1N,EAASvD,QAASkyE,YAGrB,CAAC/+D,IAgCF,0BAAMsW,OAAO,GAAGhT,SAblB,SAAsBqgB,GACpBA,EAAM10B,iBAEFwjB,GAIAosD,GACFv7D,EAAS2S,IAK6B+oD,aAAa,OACnD,yBACEr6E,UAAW0D,YAAe,6BAA8B4tB,GAAY,UAAWjW,GAAS,SACxF/a,IAAKX,EAAKmY,MAAQ,WAAQxW,GAE1B,2BACEqJ,IAAKc,EACLzL,UAAU,eACVgG,KAAMgxC,EAAoB,OAAS,WACnCr5C,GAAG,mBACHuI,MAAOorB,GAAY,GACnB+oD,aAAa,mBACbruE,SA1CR,SAA0BrI,GACpB0X,GACFi7B,IAGF,MAAM,OAAEnsC,GAAWxG,EACnBs2E,EAAY9vE,EAAOjE,OACnBi0E,EAAahwE,EAAOjE,MAAM1H,QAAU87E,MAChCN,GACFA,EAAc7vE,EAAOjE,QAkCjB5F,IAAI,SAEN,+BAAQ+a,GAASkW,GAAQjX,GACzB,yBACEta,UAAU,kBACVC,QAnCR,WACEi3C,GAA4BF,IAmCtB51B,KAAK,SACLC,SAAU,EACVvF,MAAM,8BAEN,uBAAG9b,UAAWg3C,EAAoB,WAAa,sBAGlDkjC,GACC,kBAAC,IAAD,CAAQl0E,KAAK,SAASI,QAAM,EAAC0nB,UAAWA,GACrCuoB,O","file":"3.86fc6942f17ca54599b3.js","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';\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 '.active .media-viewer-content img, .active .media-viewer-content 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 === MediaViewerOrigin.ProfileAvatar);\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, shouldAppendProfileInfo = false) {\n const ghost = document.createElement('div');\n ghost.classList.add('ghost');\n\n const img = new Image();\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 (shouldAppendProfileInfo) {\n ghost.classList.add('ProfileInfo');\n const profileInfo = document.querySelector('#RightColumn .ProfileInfo .info');\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('.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) {\n topOffsetRem += mql.matches ? 0.875 : 3.375;\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 = `.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 .ChatInfo .Avatar';\n mediaSelector = 'img.avatar-media';\n break;\n\n case MediaViewerOrigin.ProfileAvatar:\n containerSelector = '#RightColumn .ProfileInfo .active .ProfilePhoto';\n mediaSelector = 'img.avatar-media';\n break;\n\n case MediaViewerOrigin.ScheduledInline:\n case MediaViewerOrigin.Inline:\n default:\n containerSelector = `.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[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.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, { FC, useCallback } from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\nimport { ApiChat, ApiMessage, ApiUser } from '../../api/types';\n\nimport { getSenderTitle, isChatPrivate } 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 { pick } from '../../util/iteratees';\nimport useLang from '../../hooks/useLang';\n\nimport Avatar from '../common/Avatar';\n\nimport './SenderInfo.scss';\n\ntype OwnProps = {\n chatId?: number;\n messageId?: number;\n isAvatar?: boolean;\n};\n\ntype StateProps = {\n sender?: ApiUser | ApiChat;\n message?: ApiMessage;\n};\n\ntype DispatchProps = Pick;\n\nconst SenderInfo: FC = ({\n chatId, messageId, sender, isAvatar, message, closeMediaViewer, focusMessage,\n}) => {\n const handleFocusMessage = useCallback(() => {\n closeMediaViewer();\n focusMessage({ chatId, messageId });\n }, [chatId, focusMessage, messageId, closeMediaViewer]);\n\n const lang = useLang();\n\n if (!sender || (!message && !isAvatar)) {\n return undefined;\n }\n\n const isFromChat = sender.id < 0;\n const senderTitle = getSenderTitle(lang, sender);\n\n return (\n
\n {isFromChat ? (\n \n ) : (\n \n )}\n
\n
\n {senderTitle && renderText(senderTitle)}\n
\n
\n {isAvatar ? lang('lng_mediaview_profile_photo') : formatMediaDateTime(lang, message!.date * 1000)}\n
\n
\n
\n );\n};\n\nexport default withGlobal(\n (global, { chatId, messageId, isAvatar }): StateProps => {\n if (isAvatar && chatId) {\n return {\n sender: isChatPrivate(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 (setGlobal, actions): DispatchProps => pick(actions, ['closeMediaViewer', 'focusMessage']),\n)(SenderInfo);\n","import React, { FC, useMemo } from '../../lib/teact/teact';\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 useMediaDownload from '../../hooks/useMediaDownload';\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 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 onCloseMediaViewer,\n onForward,\n onZoomToggle,\n}) => {\n const {\n isDownloadStarted,\n downloadProgress,\n handleDownloadClick,\n } = useMediaDownload(\n message && isVideo ? getMessageMediaHash(message, 'download') : undefined,\n fileName,\n );\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 if (IS_SINGLE_COLUMN_LAYOUT) {\n return (\n
\n \n {!isAvatar && (\n \n {lang('Forward')}\n \n )}\n {isVideo ? (\n \n {isDownloadStarted ? `${Math.round(downloadProgress * 100)}% Downloading...` : 'Download'}\n \n ) : (\n \n {lang('AccActionDownload')}\n \n )}\n \n {isDownloadStarted && }\n
\n );\n }\n\n return (\n
\n {!isAvatar && (\n <>\n \n \n \n \n )}\n {isVideo ? (\n \n {isDownloadStarted ? (\n \n ) : (\n \n )}\n \n ) : (\n \n \n \n )}\n \n \n \n \n \n \n
\n );\n};\n\nexport default MediaViewerActions;\n","import React, { FC, useEffect, useState } from '../../lib/teact/teact';\n\nimport { throttle } from '../../util/schedulers';\nimport { TextPart } from '../common/helpers/renderMessageText';\nimport buildClassName from '../../util/buildClassName';\nimport { REM } from '../common/helpers/mediaDimensions';\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../util/environment';\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\nexport default (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","import React, { FC, useState, useEffect } from '../../lib/teact/teact';\n\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../util/environment';\nimport { formatMediaDuration } from '../../util/dateFormat';\nimport formatFileSize from './helpers/formatFileSize';\nimport useLang from '../../hooks/useLang';\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 isForceVisible: boolean;\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 onSeek: OnChangeHandler;\n};\n\ntype OnChangeHandler = (e: React.ChangeEvent) => void;\n\nconst stopEvent = (e: React.MouseEvent) => {\n e.stopPropagation();\n};\n\nconst HIDE_CONTROLS_TIMEOUT_MS = 800;\n\nconst VideoPlayerControls: FC = ({\n bufferedProgress,\n currentTime,\n duration,\n fileSize,\n isForceVisible,\n isForceMobileVersion,\n isPlayed,\n isFullscreenSupported,\n isFullscreen,\n onChangeFullscreen,\n onPlayPause,\n onSeek,\n}) => {\n const [isVisible, setVisibility] = useState(true);\n\n useEffect(() => {\n if (isForceVisible) {\n setVisibility(isForceVisible);\n }\n }, [isForceVisible]);\n\n useEffect(() => {\n let timeout: number | undefined;\n\n if (!isForceVisible) {\n if (IS_SINGLE_COLUMN_LAYOUT) {\n setVisibility(false);\n } else {\n timeout = window.setTimeout(() => {\n setVisibility(false);\n }, HIDE_CONTROLS_TIMEOUT_MS);\n }\n }\n\n return () => {\n if (timeout) {\n window.clearTimeout(timeout);\n }\n };\n }, [isForceVisible]);\n\n useEffect(() => {\n if (isVisible || isForceVisible) {\n document.body.classList.add('video-controls-visible');\n }\n\n return () => {\n document.body.classList.remove('video-controls-visible');\n };\n }, [isForceVisible, isVisible]);\n\n const lang = useLang();\n\n if (!isVisible && !isForceVisible) {\n return undefined;\n }\n\n return (\n
\n {renderSeekLine(currentTime, duration, bufferedProgress, onSeek)}\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(downloadedPercent: number, totalSize: number) {\n return (\n
\n {`${formatFileSize(totalSize * downloadedPercent)} / ${formatFileSize(totalSize)}`}\n
\n );\n}\n\nfunction renderSeekLine(currentTime: number, duration: number, bufferedProgress: number, onSeek: OnChangeHandler) {\n const percentagePlayed = (currentTime / duration) * 100;\n const percentageBuffered = bufferedProgress * 100;\n\n return (\n
\n
\n \n \n \n
\n
\n );\n}\n\nexport default VideoPlayerControls;\n","import React, {\n FC, memo, useCallback, useEffect, useRef, useState,\n} from '../../lib/teact/teact';\n\nimport { ApiDimensions } from '../../api/types';\n\nimport { IS_IOS, IS_SINGLE_COLUMN_LAYOUT, IS_TOUCH_ENV } from '../../util/environment';\nimport useShowTransition from '../../hooks/useShowTransition';\nimport useBuffering from '../../hooks/useBuffering';\nimport useFullscreenStatus from '../../hooks/useFullscreen';\nimport useVideoCleanup from '../../hooks/useVideoCleanup';\nimport safePlay from '../../util/safePlay';\n\nimport VideoPlayerControls from './VideoPlayerControls';\nimport ProgressSpinner from '../ui/ProgressSpinner';\nimport Button from '../ui/Button';\n\nimport './VideoPlayer.scss';\n\ntype OwnProps = {\n url?: string;\n isGif?: boolean;\n posterData?: string;\n posterSize?: ApiDimensions;\n downloadProgress?: number;\n fileSize: number;\n isMediaViewerOpen?: boolean;\n noPlay?: boolean;\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 downloadProgress,\n fileSize,\n isMediaViewerOpen,\n noPlay,\n onClose,\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 const [isControlsVisible, setIsControlsVisible] = useState(true);\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 videoRef.current!.play();\n setIsPlayed(true);\n }\n }, [isPlayed]);\n\n useVideoCleanup(videoRef, []);\n\n const handleMouseOver = useCallback(() => {\n setIsControlsVisible(true);\n }, []);\n\n const handleMouseOut = useCallback(() => {\n setIsControlsVisible(false);\n }, []);\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 }, []);\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((e: React.ChangeEvent) => {\n e.stopPropagation();\n\n videoRef.current!.currentTime = (Number(e.target.value) * videoRef.current!.duration) / 100;\n }, []);\n\n const toggleControls = useCallback((e: React.MouseEvent) => {\n e.stopPropagation();\n setIsControlsVisible(!isControlsVisible);\n }, [isControlsVisible]);\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 \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, {\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","/*\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: any;\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('.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, {\n FC, memo, useCallback, useEffect, useMemo, useRef, useState,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\nimport {\n ApiChat, ApiMediaFormat, ApiMessage, ApiUser, ApiDimensions,\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 windowSize from '../../util/windowSize';\nimport {\n AVATAR_FULL_DIMENSIONS,\n MEDIA_VIEWER_MEDIA_QUERY,\n calculateMediaViewerDimensions,\n} from '../common/helpers/mediaDimensions';\nimport {\n selectChat,\n selectChatMessage,\n selectChatMessages,\n selectCurrentMediaSearch,\n selectListedIds,\n selectOutlyingIds,\n selectScheduledMessage,\n selectScheduledMessages,\n selectUser,\n} from '../../modules/selectors';\nimport {\n getChatAvatarHash,\n getChatMediaMessageIds,\n getMessageFileName,\n getMessageMediaFormat,\n getMessageMediaHash,\n getMessageMediaThumbDataUri,\n getMessagePhoto,\n getMessageVideo,\n getMessageDocument,\n isMessageDocumentPhoto,\n isMessageDocumentVideo,\n getMessageWebPagePhoto,\n getMessageWebPageVideo,\n getPhotoFullDimensions,\n getVideoDimensions, getMessageFileSize,\n} from '../../modules/helpers';\nimport { pick } from '../../util/iteratees';\nimport { captureEvents, SwipeDirection } from '../../util/captureEvents';\nimport captureEscKeyListener from '../../util/captureEscKeyListener';\nimport { stopCurrentAudio } from '../../util/audioPlayer';\nimport useForceUpdate from '../../hooks/useForceUpdate';\nimport useMedia from '../../hooks/useMedia';\nimport useMediaWithDownloadProgress from '../../hooks/useMediaWithDownloadProgress';\nimport useBlurSync from '../../hooks/useBlurSync';\nimport usePrevious from '../../hooks/usePrevious';\nimport { dispatchHeavyAnimationEvent } from '../../hooks/useHeavyAnimationCheck';\nimport { renderMessageText } from '../common/helpers/renderMessageText';\nimport { animateClosing, animateOpening } from './helpers/ghostAnimation';\nimport useLang from '../../hooks/useLang';\nimport useHistoryBack from '../../hooks/useHistoryBack';\n\nimport Spinner from '../ui/Spinner';\nimport ShowTransition from '../ui/ShowTransition';\nimport Transition from '../ui/Transition';\nimport Button from '../ui/Button';\nimport SenderInfo from './SenderInfo';\nimport MediaViewerActions from './MediaViewerActions';\nimport MediaViewerFooter from './MediaViewerFooter';\nimport VideoPlayer from './VideoPlayer';\nimport ZoomControls from './ZoomControls';\nimport PanZoom from './PanZoom';\n\nimport './MediaViewer.scss';\n\ntype StateProps = {\n chatId?: number;\n threadId?: number;\n messageId?: number;\n senderId?: number;\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\ntype DispatchProps = Pick;\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 openMediaViewer,\n closeMediaViewer,\n openForwardMenu,\n focusMessage,\n animationLevel,\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 isPhoto = Boolean(!isVideo && (photo || webPagePhoto || isDocumentPhoto));\n const { isGif } = video || webPageVideo || {};\n const isAvatar = Boolean(avatarOwner);\n\n /* Navigation */\n const isSingleSlide = Boolean(webPagePhoto || webPageVideo);\n const messageIds = useMemo(() => {\n return isSingleSlide && messageId\n ? [messageId]\n : getChatMediaMessageIds(chatMessages || {}, collectionIds || [], isFromSharedMedia);\n }, [isSingleSlide, messageId, 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 ? 'mv-slide' : 'none';\n const headerAnimation = animationLevel === 2 ? 'slide-fade' : 'none';\n const isGhostAnimation = animationLevel === 2;\n\n /* Controls */\n const [isFooterHidden, setIsFooterHidden] = useState(false);\n const [canPanZoomWrap, setCanPanZoomWrap] = useState(false);\n const [isZoomed, setIsZoomed] = useState(false);\n const [zoomLevel, setZoomLevel] = useState(1);\n const [panDelta, setPanDelta] = useState({ x: 0, y: 0 });\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 blobUrlPictogram = 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 blobUrlPreview = useMedia(\n previewMediaHash,\n undefined,\n isAvatar && previewMediaHash && previewMediaHash.startsWith('profilePhoto')\n ? ApiMediaFormat.DataUri\n : ApiMediaFormat.BlobUrl,\n undefined,\n isGhostAnimation && ANIMATION_DURATION,\n );\n const { mediaData: fullMediaData, downloadProgress } = useMediaWithDownloadProgress(\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 || fullMediaData)) || blobUrlPreview || blobUrlPictogram;\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 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 useEffect(() => {\n if (isGhostAnimation && isOpen && !prevMessage && !prevAvatarOwner) {\n dispatchHeavyAnimationEvent(ANIMATION_DURATION + ANIMATION_END_DELAY);\n const textParts = message ? renderMessageText(message) : undefined;\n const hasFooter = Boolean(textParts);\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,\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({ x: 0, y: 0 });\n };\n\n const handleZoomToggle = useCallback(() => {\n setIsZoomed(!isZoomed);\n setZoomLevel(!isZoomed ? 1.5 : 1);\n if (isZoomed) {\n setPanDelta({ x: 0, y: 0 });\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 focusMessage({ chatId, threadId, messageId });\n }, [close, chatId, threadId, focusMessage, messageId]);\n\n const handleForward = useCallback(() => {\n openForwardMenu({ fromChatId: chatId, messageIds: [messageId] });\n closeZoom();\n }, [openForwardMenu, chatId, messageId]);\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 => {\n let index = messageIds.indexOf(fromId);\n if ((direction === -1 && index > 0) || (direction === 1 && index < messageIds.length - 1)) {\n index += direction;\n }\n\n return messageIds[index];\n }, [messageIds]);\n\n const selectPreviousMedia = useCallback(() => {\n if (isFirst) {\n return;\n }\n\n openMediaViewer({\n chatId,\n threadId,\n messageId: messageId ? getMessageId(messageId, -1) : undefined,\n origin,\n });\n }, [chatId, threadId, getMessageId, isFirst, messageId, openMediaViewer, origin]);\n\n const selectNextMedia = useCallback(() => {\n if (isLast) {\n return;\n }\n\n openMediaViewer({\n chatId,\n threadId,\n messageId: messageId ? getMessageId(messageId, 1) : undefined,\n origin,\n });\n }, [chatId, threadId, getMessageId, isLast, messageId, openMediaViewer, origin]);\n\n useEffect(() => {\n const handleKeyDown = (e: KeyboardEvent) => {\n switch (e.key) {\n case 'Left': // IE/Edge specific value\n case 'ArrowLeft':\n selectPreviousMedia();\n break;\n\n case 'Right': // IE/Edge specific value\n case 'ArrowRight':\n selectNextMedia();\n break;\n }\n };\n\n document.addEventListener('keydown', handleKeyDown, false);\n\n return () => {\n document.removeEventListener('keydown', handleKeyDown, false);\n };\n });\n\n // Support for swipe gestures and closing on click\n useEffect(() => {\n const element = document.querySelector('.slide-container > .active, .slide-container > .to');\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, .media-viewer-footer${!shouldCloseOnVideo ? ', .VideoPlayer' : ''}`,\n onClick: () => {\n if (!isZoomed && !IS_TOUCH_ENV) {\n close();\n }\n },\n onSwipe: IS_TOUCH_ENV ? (e, direction) => {\n if (direction === SwipeDirection.Right) {\n selectPreviousMedia();\n } else if (direction === SwipeDirection.Left) {\n selectNextMedia();\n } else if (!(e.target && (e.target as HTMLElement).closest('.MediaViewerFooter'))) {\n close();\n }\n } : undefined,\n });\n }, [close, isFooterHidden, isGif, isPhoto, isZoomed, selectNextMedia, selectPreviousMedia]);\n\n const handlePan = useCallback((x: number, y: number) => {\n setPanDelta({ x, y });\n }, []);\n\n const handleToggleFooterVisibility = useCallback(() => {\n if (IS_TOUCH_ENV && (isPhoto || isGif)) {\n setIsFooterHidden(!isFooterHidden);\n }\n }, [isFooterHidden, isGif, isPhoto]);\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 function renderSlide(isActive: boolean) {\n if (isAvatar) {\n return (\n
\n {renderPhoto(\n fullMediaData || blobUrlPreview,\n calculateMediaViewerDimensions(AVATAR_FULL_DIMENSIONS, false),\n !IS_SINGLE_COLUMN_LAYOUT && !isZoomed,\n )}\n
\n );\n } else if (message) {\n const textParts = renderMessageText(message);\n const hasFooter = Boolean(textParts);\n\n return (\n \n {isPhoto && renderPhoto(\n localBlobUrl || fullMediaData || blobUrlPreview || blobUrlPictogram,\n message && calculateMediaViewerDimensions(dimensions!, hasFooter),\n !IS_SINGLE_COLUMN_LAYOUT && !isZoomed,\n )}\n {isVideo && (\n \n )}\n {textParts && (\n \n )}\n \n );\n }\n\n return undefined;\n }\n\n function renderSenderInfo() {\n return isAvatar ? (\n \n ) : (\n \n );\n }\n\n return (\n \n {() => (\n <>\n
\n {IS_SINGLE_COLUMN_LAYOUT && (\n \n \n \n )}\n \n {renderSenderInfo}\n \n \n
\n \n \n {renderSlide}\n \n \n {!isFirst && (\n \n )}\n {!isLast && (\n \n )}\n \n \n )}\n \n );\n};\n\nfunction renderPhoto(blobUrl?: string, imageSize?: ApiDimensions, canDrag?: boolean) {\n return blobUrl\n ? (\n \n )\n : (\n \n \n \n );\n}\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const {\n chatId, threadId, messageId, avatarOwnerId, profilePhotoIndex, 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 (setGlobal, actions): DispatchProps => pick(actions, [\n 'openMediaViewer', 'closeMediaViewer', 'openForwardMenu', 'focusMessage',\n ]),\n)(MediaViewer));\n","import React, {\n FC, useMemo, useState, memo, useRef, useEffect, useCallback,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\nimport { ApiChat, MAIN_THREAD_ID } from '../../api/types';\n\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../util/environment';\nimport {\n getCanPostInChat, getChatTitle, isChatPrivate, sortChatIds,\n} from '../../modules/helpers';\nimport searchWords from '../../util/searchWords';\nimport { pick, unique } from '../../util/iteratees';\nimport useInfiniteScroll from '../../hooks/useInfiniteScroll';\nimport useLang from '../../hooks/useLang';\nimport useKeyboardListNavigation from '../../hooks/useKeyboardListNavigation';\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 PrivateChatInfo from '../common/PrivateChatInfo';\nimport GroupChatInfo from '../common/GroupChatInfo';\n\nimport './ForwardPicker.scss';\n\nexport type OwnProps = {\n isOpen: boolean;\n};\n\ntype StateProps = {\n chatsById: Record;\n pinnedIds?: number[];\n activeListIds?: number[];\n archivedListIds?: number[];\n orderedPinnedIds?: number[];\n currentUserId?: number;\n};\n\ntype DispatchProps = Pick;\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\nconst ForwardPicker: FC = ({\n chatsById,\n pinnedIds,\n activeListIds,\n archivedListIds,\n currentUserId,\n isOpen,\n setForwardChatId,\n exitForwardMode,\n loadMoreChats,\n}) => {\n const [filter, setFilter] = useState('');\n // eslint-disable-next-line no-null/no-null\n const inputRef = useRef(null);\n\n const lang = useLang();\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 setTimeout(() => {\n setFilter('');\n }, MODAL_HIDE_DELAY_MS);\n }\n }, [isOpen]);\n\n const chatIds = useMemo(() => {\n const listIds = [\n ...activeListIds || [],\n ...archivedListIds || [],\n ];\n\n let priorityIds = pinnedIds || [];\n if (currentUserId) {\n priorityIds = unique([currentUserId, ...priorityIds]);\n }\n\n return sortChatIds([\n ...listIds.filter((id) => {\n const chat = chatsById[id];\n if (!chat) {\n return true;\n }\n\n if (!getCanPostInChat(chat, MAIN_THREAD_ID)) {\n return false;\n }\n\n if (!filter) {\n return true;\n }\n\n return searchWords(getChatTitle(lang, chatsById[id], undefined, id === currentUserId), filter);\n }),\n ], chatsById, undefined, priorityIds);\n }, [activeListIds, archivedListIds, chatsById, currentUserId, filter, lang, pinnedIds]);\n\n const [viewportIds, getMore] = useInfiniteScroll(loadMoreChats, chatIds, Boolean(filter));\n\n const handleFilterChange = useCallback((e: React.ChangeEvent) => {\n setFilter(e.currentTarget.value);\n }, []);\n\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n const handleKeyDown = useKeyboardListNavigation(containerRef, isOpen, (index) => {\n if (viewportIds && viewportIds.length > 0) {\n setForwardChatId({ id: viewportIds[index === -1 ? 0 : index] });\n }\n }, '.ListItem-button', true);\n\n const modalHeader = (\n
\n \n \n \n \n
\n );\n\n return (\n \n {viewportIds && viewportIds.length ? (\n \n {viewportIds.map((id) => (\n setForwardChatId({ id })}\n >\n {isChatPrivate(id) ? (\n \n ) : (\n \n )}\n \n ))}\n \n ) : viewportIds && !viewportIds.length ? (\n

Sorry, nothing found.

\n ) : (\n \n )}\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 pinnedIds: orderedPinnedIds.active,\n activeListIds: listIds.active,\n archivedListIds: listIds.archived,\n currentUserId,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['setForwardChatId', 'exitForwardMode', 'loadMoreChats']),\n)(ForwardPicker));\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\nimport { ApiError, ApiInviteInfo } from '../../api/types';\n\nimport getReadableErrorText from '../../util/getReadableErrorText';\nimport { pick } from '../../util/iteratees';\nimport useLang from '../../hooks/useLang';\nimport renderText from '../common/helpers/renderText';\n\nimport Modal from '../ui/Modal';\nimport Button from '../ui/Button';\n\nimport './Dialogs.scss';\n\ntype StateProps = {\n dialogs: (ApiError | ApiInviteInfo)[];\n};\n\ntype DispatchProps = Pick;\n\nconst Dialogs: FC = ({ dialogs, dismissDialog, acceptInviteConfirmation }) => {\n const lang = useLang();\n\n if (!dialogs.length) {\n return undefined;\n }\n\n const renderInvite = (invite: ApiInviteInfo) => {\n const {\n hash, title, participantsCount, isChannel,\n } = invite;\n\n const handleJoinClick = () => {\n acceptInviteConfirmation({\n hash,\n });\n dismissDialog();\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\n return (\n \n {participantsCount !== undefined &&

{participantsText}

}\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) => {\n if ('hash' in dialog) {\n return renderInvite(dialog);\n }\n\n return renderError(dialog);\n };\n\n return (\n
\n {dialogs.map(renderDialog)}\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 (setGlobal, actions): DispatchProps => pick(actions, ['dismissDialog', 'acceptInviteConfirmation']),\n)(Dialogs));\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\nimport { ApiNotification } from '../../api/types';\n\nimport { pick } from '../../util/iteratees';\n\nimport Notification from '../ui/Notification';\nimport renderText from '../common/helpers/renderText';\n\ntype StateProps = {\n notifications: ApiNotification[];\n};\n\ntype DispatchProps = Pick;\n\nconst Notifications: FC = ({ notifications, dismissNotification }) => {\n if (!notifications.length) {\n return undefined;\n }\n\n return (\n
\n {notifications.map(({ message }) => (\n \n ))}\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => pick(global, ['notifications']),\n (setGlobal, actions): DispatchProps => pick(actions, ['dismissNotification']),\n)(Notifications));\n","import React, { FC, memo, useCallback } from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\n\nimport { pick } from '../../util/iteratees';\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\ntype DispatchProps = Pick;\n\nconst SafeLinkModal: FC = ({ url, toggleSafeLinkModal }) => {\n const lang = useLang();\n\n const handleOpen = useCallback(() => {\n window.open(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(withGlobal(\n undefined,\n (setGlobal, actions): DispatchProps => pick(actions, ['toggleSafeLinkModal']),\n)(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 } from '../../util/dateFormat';\nimport useLang, { LangFn } from '../../hooks/useLang';\nimport usePrevious from '../../hooks/usePrevious';\n\nimport Modal from '../ui/Modal';\nimport Button from '../ui/Button';\n\nimport './CalendarModal.scss';\n\nexport type OwnProps = {\n selectedAt?: 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 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 const defaultSelectedDate = useMemo(() => (selectedAt ? new Date(selectedAt) : new Date()), [selectedAt]);\n const maxDate = maxAt ? new Date(maxAt) : undefined;\n const prevIsOpen = usePrevious(isOpen);\n\n const [selectedDate, setSelectedDate] = useState(defaultSelectedDate);\n const [selectedHours, setSelectedHours] = useState(\n formatInputTime(defaultSelectedDate.getHours()),\n );\n const [selectedMinutes, setSelectedMinutes] = useState(\n formatInputTime(defaultSelectedDate.getMinutes()),\n );\n\n const currentYear = selectedDate.getFullYear();\n const currentMonth = selectedDate.getMonth();\n const currentDate = selectedDate.getDate();\n\n useEffect(() => {\n if (!prevIsOpen && isOpen) {\n setSelectedDate(defaultSelectedDate);\n }\n }, [isOpen, defaultSelectedDate, prevIsOpen]);\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 calendarGrid = useMemo(() => (\n buildCalendarGrid(currentYear, currentMonth)\n ), [currentMonth, currentYear]);\n\n function handlePrevMonth() {\n setSelectedDate((d) => {\n const dateCopy = new Date(d);\n dateCopy.setMonth(dateCopy.getMonth() - 1);\n\n return dateCopy;\n });\n }\n\n function handleNextMonth() {\n setSelectedDate((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\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${selectedDate.getMonth() + 1}`)}\n {' '}\n {selectedDate.getFullYear()}\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 {calendarGrid.map((gridDate) => (\n handleDateSelect(gridDate)}\n className={buildClassName(\n 'day-button',\n isDisabledDay(\n currentYear, currentMonth, gridDate, isFutureMode ? now : undefined, isPastMode ? now : maxDate,\n )\n ? 'disabled'\n : `${gridDate ? 'clickable' : ''}`,\n gridDate === currentDate && 'selected',\n )}\n >\n {!!gridDate && (\n {gridDate}\n )}\n
\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 grid: number[] = [];\n\n const date = new Date();\n date.setFullYear(year);\n date.setMonth(month);\n date.setDate(1);\n\n const monthStartDay = date.getDay() || 7;\n // Fill empty cells\n for (let i = 1; i < monthStartDay; i++) {\n grid.push(0);\n }\n\n while (date.getMonth() === month) {\n const gridDate = date.getDate();\n grid.push(gridDate);\n date.setDate(gridDate + 1);\n }\n\n return grid;\n}\n\nfunction isDisabledDay(year: number, month: number, day: number, minDate?: Date, maxDate?: Date) {\n const selectedDay = new Date(year, month, day, 0, 0, 0, 0);\n const fixedMinDate = minDate && new Date(minDate.getFullYear(), minDate.getMonth(), minDate.getDate(), 0, 0, 0, 0);\n const fixedMaxDate = maxDate && new Date(maxDate.getFullYear(), maxDate.getMonth(), maxDate.getDate(), 0, 0, 0, 0);\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 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(date));\n }\n\n return lang('Conversation.ScheduleMessage.SendOn', [day, formatTime(date)]);\n}\n\nexport default memo(CalendarModal);\n","import React, { FC, memo, useCallback } from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\n\nimport { pick } from '../../util/iteratees';\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\ntype DispatchProps = Pick;\n\nconst HistoryCalendar: FC = ({\n isOpen, selectedAt, searchMessagesByDate, closeHistoryCalendar,\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 {\n selectedAt: global.historyCalendarSelectedAt,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'searchMessagesByDate', 'closeHistoryCalendar',\n ]),\n)(HistoryCalendar));\n","import React, { FC, useCallback, memo } from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiMessage } from '../../api/types';\nimport { IAlbum } from '../../types';\n\nimport { GlobalActions } from '../../global/types';\n\nimport {\n selectAllowedMessageActions,\n selectChat,\n selectCurrentMessageList,\n selectUser,\n} from '../../modules/selectors';\nimport {\n isChatPrivate,\n getUserFirstOrLastName,\n getPrivateChatUserId,\n isChatBasicGroup,\n isChatSuperGroup,\n} from '../../modules/helpers';\nimport renderText from './helpers/renderText';\nimport { pick } from '../../util/iteratees';\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\ntype DispatchProps = Pick;\n\nconst DeleteMessageModal: FC = ({\n isOpen,\n isSchedule,\n message,\n album,\n canDeleteForAll,\n contactName,\n willDeleteForCurrentUserOnly,\n willDeleteForAll,\n onClose,\n deleteMessages,\n deleteScheduledMessages,\n}) => {\n const handleDeleteMessageForAll = useCallback(() => {\n const messageIds = album && 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 && 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 && isChatPrivate(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 (setGlobal, actions): DispatchProps => pick(actions, [\n 'deleteMessages', 'deleteScheduledMessages',\n ]),\n)(DeleteMessageModal));\n","import React, { FC, useCallback, memo } from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\n\nimport { selectChat, selectIsChatWithSelf, selectUser } from '../../modules/selectors';\nimport {\n isChatPrivate,\n getUserFirstOrLastName,\n getPrivateChatUserId,\n isChatBasicGroup,\n isChatSuperGroup,\n isChatChannel,\n} from '../../modules/helpers';\nimport { pick } from '../../util/iteratees';\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: number;\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\ntype DispatchProps = Pick;\n\nconst PinMessageModal: FC = ({\n isOpen,\n messageId,\n chatId,\n isChannel,\n isGroup,\n isSuperGroup,\n canPinForAll,\n contactName,\n onClose,\n pinMessage,\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 = isChatPrivate(chatId);\n const isChatWithSelf = selectIsChatWithSelf(global, chatId);\n const chat = selectChat(global, chatId);\n const isChannel = !!chat && isChatChannel(chat);\n const isGroup = !!chat && isChatBasicGroup(chat);\n const isSuperGroup = !!chat && isChatSuperGroup(chat);\n const canPinForAll = (isPrivateChat && !isChatWithSelf) || isSuperGroup || isGroup;\n const contactName = chat && isChatPrivate(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 (setGlobal, actions): DispatchProps => pick(actions, ['pinMessage']),\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?: number;\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 React, {\n FC, useCallback, memo, useEffect,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\n\nimport { selectCanDeleteSelectedMessages, selectCurrentChat, selectUser } from '../../modules/selectors';\nimport {\n isChatPrivate,\n getUserFirstOrLastName,\n getPrivateChatUserId,\n isChatBasicGroup,\n isChatSuperGroup,\n} from '../../modules/helpers';\nimport renderText from '../common/helpers/renderText';\nimport { pick } from '../../util/iteratees';\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\ntype DispatchProps = Pick;\n\nconst DeleteSelectedMessageModal: FC = ({\n isOpen,\n isSchedule,\n selectedMessageIds,\n canDeleteForAll,\n contactName,\n willDeleteForCurrentUserOnly,\n willDeleteForAll,\n onClose,\n deleteMessages,\n deleteScheduledMessages,\n exitMessageSelectMode,\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 && isChatPrivate(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 (setGlobal, actions): DispatchProps => pick(actions, [\n 'deleteMessages',\n 'deleteScheduledMessages',\n 'exitMessageSelectMode',\n ]),\n)(DeleteSelectedMessageModal));\n","import { ChangeEvent } from 'react';\n\nimport React, {\n FC, memo, useCallback, useState,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiReportReason } from '../../api/types';\n\nimport { GlobalActions } from '../../global/types';\n\nimport { pick } from '../../util/iteratees';\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\ntype DispatchProps = Pick;\n\nconst ReportMessageModal: FC = ({\n isOpen,\n messageIds,\n reportMessages,\n exitMessageSelectMode,\n onClose,\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(withGlobal(\n undefined, (setGlobal, actions): DispatchProps => pick(actions, [\n 'reportMessages', 'exitMessageSelectMode',\n ]),\n)(ReportMessageModal));\n","import React, { FC, memo, useEffect } from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions, MessageListType } from '../../global/types';\n\nimport {\n selectCanDeleteSelectedMessages,\n selectCanReportSelectedMessages,\n selectCurrentMessageList,\n selectSelectedMessagesCount,\n} from '../../modules/selectors';\nimport { pick } from '../../util/iteratees';\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';\n\nimport Button from '../ui/Button';\nimport MenuItem from '../ui/MenuItem';\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 selectedMessageIds?: number[];\n};\n\ntype DispatchProps = Pick;\n\nconst MessageSelectToolbar: FC = ({\n canPost,\n isActive,\n messageListType,\n isSchedule,\n selectedMessagesCount,\n canDeleteMessages,\n canReportMessages,\n selectedMessageIds,\n exitMessageSelectMode,\n openForwardMenuForSelectedMessages,\n}) => {\n const [isDeleteModalOpen, openDeleteModal, closeDeleteModal] = useFlag();\n const [isReportModalOpen, openReportModal, closeReportModal] = useFlag();\n\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 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);\n\n const className = buildClassName(\n 'MessageSelectToolbar',\n canPost && 'with-composer',\n isActive && 'shown',\n );\n\n return (\n
\n
\n \n \n \n \n {formattedMessagesCount}\n \n\n {!!selectedMessagesCount && (\n
\n {messageListType !== 'scheduled' && (\n \n \n {lang('Forward')}\n \n \n )}\n {canReportMessages && (\n \n \n {lang('Report')}\n \n \n )}\n \n \n {lang('Delete')}\n \n \n
\n )}\n
\n \n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const { type: messageListType } = selectCurrentMessageList(global) || {};\n const { canDelete } = selectCanDeleteSelectedMessages(global);\n const canReport = selectCanReportSelectedMessages(global);\n const { messageIds: selectedMessageIds } = global.selectedMessages || {};\n\n return {\n isSchedule: messageListType === 'scheduled',\n selectedMessagesCount: selectSelectedMessagesCount(global),\n canDeleteMessages: canDelete,\n canReportMessages: canReport,\n selectedMessageIds,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['exitMessageSelectMode', 'openForwardMenuForSelectedMessages']),\n)(MessageSelectToolbar));\n","import { useCallback, useEffect, useRef } from '../lib/teact/teact';\n\nexport default (\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);\n }, [handleKeyDown]);\n\n return buttonRef;\n};\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 { isChatPrivate, 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';\n\ntype OwnProps = {\n chatId: number;\n withUsername?: boolean;\n onClick: (id: number) => void;\n};\n\ntype StateProps = {\n chat?: ApiChat;\n privateChatUser?: ApiUser;\n isPinned?: boolean;\n isMuted?: boolean;\n};\n\nconst LeftSearchResultChat: FC = ({\n chatId,\n chat,\n privateChatUser,\n isPinned,\n isMuted,\n withUsername,\n onClick,\n}) => {\n const [isDeleteModalOpen, openDeleteModal, closeDeleteModal] = useFlag();\n\n const contextActions = useChatContextActions({\n chat,\n privateChatUser,\n isPinned,\n isMuted,\n handleDelete: openDeleteModal,\n });\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 {isChatPrivate(chatId) ? (\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 privateChatUser = 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 privateChatUser,\n isPinned,\n isMuted,\n };\n },\n)(LeftSearchResultChat));\n","import React, {\n FC, useEffect, useCallback, useRef, memo,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { ApiUser } from '../../../api/types';\n\nimport { getUserFirstOrLastName } from '../../../modules/helpers';\nimport renderText from '../../common/helpers/renderText';\nimport { throttle } from '../../../util/schedulers';\nimport { pick } from '../../../util/iteratees';\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?: number[];\n usersById: Record;\n recentlyFoundChatIds?: number[];\n};\n\ntype DispatchProps = Pick;\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, loadTopUsers, loadContactList, openChat,\n addRecentlyFoundChatId, clearRecentlyFoundChats,\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(\n (id: number) => {\n openChat({ id, shouldReplaceHistory: true });\n onReset();\n setTimeout(() => {\n addRecentlyFoundChatId({ id });\n }, SEARCH_CLOSE_TIMEOUT_MS);\n },\n [openChat, addRecentlyFoundChatId, onReset],\n );\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 (setGlobal, actions): DispatchProps => pick(actions, [\n 'loadTopUsers',\n 'loadContactList',\n 'openChat',\n 'addRecentlyFoundChatId',\n 'clearRecentlyFoundChats',\n ]),\n)(RecentContacts));\n","import React, {\n FC, memo, useCallback,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\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 getMessageSummaryText,\n getMessageMediaThumbDataUri,\n getMessageVideo,\n getMessageRoundVideo,\n} from '../../../modules/helpers';\nimport { selectChat, selectUser } from '../../../modules/selectors';\nimport renderText from '../../common/helpers/renderText';\nimport { pick } from '../../../util/iteratees';\nimport useMedia from '../../../hooks/useMedia';\nimport { formatPastTimeShort } from '../../../util/dateFormat';\nimport useLang, { LangFn } from '../../../hooks/useLang';\nimport useSelectWithEnter from '../../../hooks/useSelectWithEnter';\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: number;\n};\n\ntype StateProps = {\n chat?: ApiChat;\n privateChatUser?: ApiUser;\n lastMessageOutgoingStatus?: ApiMessageOutgoingStatus;\n lastSyncTime?: number;\n};\n\ntype DispatchProps = Pick;\n\nconst ChatMessage: FC = ({\n message,\n searchQuery,\n chatId,\n chat,\n privateChatUser,\n focusMessage,\n lastSyncTime,\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 {renderMessageSummary(lang, message, mediaBlobUrl || mediaThumbnail, searchQuery, isRoundVideo)}\n
\n
\n
\n \n );\n};\n\nfunction renderMessageSummary(\n lang: LangFn, message: ApiMessage, blobUrl?: string, searchQuery?: string, isRoundVideo?: boolean,\n) {\n if (!blobUrl) {\n return renderText(getMessageSummaryText(lang, message));\n }\n\n return (\n \n \"\"\n {getMessageVideo(message) && }\n {renderText(getMessageSummaryText(lang, message, true), ['emoji', 'highlight'], { highlight: 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 (setGlobal, actions): DispatchProps => pick(actions, [\n 'focusMessage',\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 { withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiUser, ApiChat, ApiMessage } from '../../../api/types';\nimport { GlobalActions } from '../../../global/types';\nimport { LoadMoreDirection } from '../../../types';\n\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../../util/environment';\nimport searchWords from '../../../util/searchWords';\nimport { unique, pick } from '../../../util/iteratees';\nimport { getUserFullName, getMessageSummaryText, sortChatIds } from '../../../modules/helpers';\nimport { MEMO_EMPTY_ARRAY } from '../../../util/memo';\nimport { throttle } from '../../../util/schedulers';\nimport useLang from '../../../hooks/useLang';\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?: number;\n localContactIds?: number[];\n localChatIds?: number[];\n localUserIds?: number[];\n globalChatIds?: number[];\n globalUserIds?: number[];\n foundIds?: string[];\n globalMessagesByChatId?: Record }>;\n chatsById: Record;\n usersById: Record;\n fetchingStatus?: { chats?: boolean; messages?: boolean };\n lastSyncTime?: number;\n};\n\ntype DispatchProps = Pick;\n\nconst MIN_QUERY_LENGTH_FOR_GLOBAL_SEARCH = 4;\nconst LESS_LIST_ITEMS_AMOUNT = 3;\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, usersById, fetchingStatus, lastSyncTime,\n onReset, onSearchDateSelect, openChat, addRecentlyFoundChatId, searchMessagesGlobal, setGlobalSearchChatId,\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: number) => {\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: number) => {\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 foundContactIds = localContactIds\n ? localContactIds.filter((id) => {\n const user = usersById[id];\n if (!user) {\n return false;\n }\n\n const fullName = getUserFullName(user);\n return (fullName && searchWords(fullName, searchQuery)) || searchWords(user.username, searchQuery);\n })\n : [];\n\n return [\n ...(currentUserId && searchWords(lang('SavedMessages'), searchQuery) ? [currentUserId] : []),\n ...sortChatIds(unique([\n ...foundContactIds,\n ...(localChatIds || []),\n ...(localUserIds || []),\n ]), chatsById),\n ];\n }, [\n searchQuery, localContactIds, currentUserId, lang, localChatIds, localUserIds, chatsById, usersById,\n ]);\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(unique([...globalChatIds, ...globalUserIds]),\n chatsById, true);\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('_').map(Number);\n\n return (\n globalMessagesByChatId && globalMessagesByChatId[chatId] && globalMessagesByChatId[chatId].byId[messageId]\n );\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 = getMessageSummaryText(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 {!!localResults.length && (\n
\n {localResults.map((id) => (\n \n ))}\n
\n )}\n {!!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 {!!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 {!!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 const { byId: usersById } = global.users;\n\n const { userIds: localContactIds } = global.contactList || {};\n\n if (!localContactIds) {\n return {\n chatsById,\n usersById,\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 && resultsByType.text) || {};\n\n return {\n currentUserId,\n localContactIds,\n localChatIds,\n localUserIds,\n globalChatIds,\n globalUserIds,\n foundIds,\n globalMessagesByChatId,\n chatsById,\n usersById,\n fetchingStatus,\n lastSyncTime,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'openChat',\n 'addRecentlyFoundChatId',\n 'searchMessagesGlobal',\n 'setGlobalSearchChatId',\n ]),\n)(ChatResults));\n","import React, {\n FC, memo, useCallback, useMemo,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiChat, ApiMessage } from '../../../api/types';\nimport { GlobalActions } from '../../../global/types';\nimport { LoadMoreDirection } from '../../../types';\n\nimport { pick } from '../../../util/iteratees';\nimport { getMessageSummaryText } from '../../../modules/helpers';\nimport { MEMO_EMPTY_ARRAY } from '../../../util/memo';\nimport { throttle } from '../../../util/schedulers';\nimport useLang from '../../../hooks/useLang';\n\nimport InfiniteScroll from '../../ui/InfiniteScroll';\nimport ChatMessage from './ChatMessage';\nimport NothingFound from '../../common/NothingFound';\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?: number;\n foundIds?: string[];\n globalMessagesByChatId?: Record }>;\n chatsById: Record;\n fetchingStatus?: { chats?: boolean; messages?: boolean };\n lastSyncTime?: number;\n};\n\ntype DispatchProps = Pick;\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 searchMessagesGlobal,\n onSearchDateSelect,\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('_').map(Number);\n\n return (\n globalMessagesByChatId && globalMessagesByChatId[chatId] && globalMessagesByChatId[chatId].byId[messageId]\n );\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 = getMessageSummaryText(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.length && 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 && resultsByType.text) || {};\n\n return {\n currentUserId,\n foundIds,\n globalMessagesByChatId,\n chatsById,\n fetchingStatus,\n lastSyncTime,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['searchMessagesGlobal']),\n)(ChatMessageResults));\n","import { GlobalState } from '../../../../global/types';\nimport {\n ApiChat, ApiGlobalMessageSearchType, ApiMessage, ApiUser,\n} from '../../../../api/types';\nimport { ISettings } from '../../../../types';\n\nimport { 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?: number;\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 && props.isVoice ? 'voice' : 'audio');\n\n const { byChatId: globalMessagesByChatId } = global.messages;\n const { foundIds } = (resultsByType && resultsByType[currentType]) || {};\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 lastSyncTime: global.lastSyncTime,\n };\n };\n}\n","import React, {\n FC, memo, useCallback, useMemo,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\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 { pick } from '../../../util/iteratees';\nimport buildClassName from '../../../util/buildClassName';\nimport { throttle } from '../../../util/schedulers';\nimport useLang from '../../../hooks/useLang';\nimport useAsyncRendering from '../../right/hooks/useAsyncRendering';\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\ntype DispatchProps = Pick;\n\nconst CURRENT_TYPE = 'media';\nconst runThrottled = throttle((cb) => cb(), 500, true);\n\nconst MediaResults: FC = ({\n searchQuery,\n searchChatId,\n isLoading,\n globalMessagesByChatId,\n foundIds,\n lastSyncTime,\n searchMessagesGlobal,\n openMediaViewer,\n}) => {\n const lang = useLang();\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('_').map(Number);\n\n return globalMessagesByChatId[chatId] && globalMessagesByChatId[chatId].byId[messageId];\n }).filter(Boolean);\n }, [globalMessagesByChatId, foundIds]);\n\n const handleSelectMedia = useCallback((messageId: number, chatId: number) => {\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 (setGlobal, actions): DispatchProps => pick(actions, [\n 'searchMessagesGlobal',\n 'openMediaViewer',\n ]),\n)(MediaResults));\n","import { ApiChat, ApiMessage, ApiUser } from '../../../../api/types';\nimport {\n getChatTitle,\n getSenderTitle,\n isChatPrivate,\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 = isChatPrivate(senderId) ? usersById[senderId] : chatsById[senderId];\n\n let senderName = getSenderTitle(lang, sender);\n\n const chat = chatsById[message.chatId];\n if (chat) {\n if (isChatPrivate(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, {\n FC, memo, useCallback, useMemo,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/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 { pick } from '../../../util/iteratees';\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 WebLink from '../../common/WebLink';\nimport NothingFound from '../../common/NothingFound';\nimport Loading from '../../ui/Loading';\n\nexport type OwnProps = {\n searchQuery?: string;\n};\n\ntype DispatchProps = Pick;\n\nconst CURRENT_TYPE = 'links';\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 searchMessagesGlobal,\n focusMessage,\n}) => {\n const lang = useLang();\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('_').map(Number);\n\n return globalMessagesByChatId[chatId] && globalMessagesByChatId[chatId].byId[messageId];\n }).filter(Boolean);\n }, [globalMessagesByChatId, foundIds]);\n\n const handleMessageFocus = useCallback((messageId: number, chatId: number) => {\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 (setGlobal, actions): DispatchProps => pick(actions, [\n 'searchMessagesGlobal',\n 'focusMessage',\n ]),\n)(LinkResults));\n","import React, {\n FC, memo, useCallback, useMemo,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiMessage } from '../../../api/types';\nimport { GlobalActions } from '../../../global/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 { pick } from '../../../util/iteratees';\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';\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\ntype DispatchProps = Pick;\n\nconst CURRENT_TYPE = 'documents';\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 lastSyncTime,\n searchMessagesGlobal,\n focusMessage,\n}) => {\n const lang = useLang();\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('_').map(Number);\n const message = globalMessagesByChatId[chatId] && globalMessagesByChatId[chatId].byId[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: number) => {\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 (setGlobal, actions): DispatchProps => pick(actions, [\n 'searchMessagesGlobal',\n 'focusMessage',\n ]),\n)(FileResults));\n","import React, {\n FC, memo, useCallback, useMemo,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/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 { pick } from '../../../util/iteratees';\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\ntype DispatchProps = Pick;\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 searchMessagesGlobal,\n focusMessage,\n openAudioPlayer,\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('_').map(Number);\n\n return globalMessagesByChatId[chatId] && globalMessagesByChatId[chatId].byId[messageId];\n }).filter(Boolean);\n }, [globalMessagesByChatId, foundIds]);\n\n const handleMessageFocus = useCallback((messageId: number, chatId: number) => {\n focusMessage({ chatId, messageId });\n }, [focusMessage]);\n\n const handlePlayAudio = useCallback((messageId: number, chatId: number) => {\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 (setGlobal, actions): DispatchProps => pick(actions, [\n 'searchMessagesGlobal',\n 'focusMessage',\n 'openAudioPlayer',\n ]),\n)(AudioResults));\n","import React, {\n FC, memo, useCallback, useState, useMemo, useRef,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { GlobalSearchContent } from '../../../types';\n\nimport { pick } from '../../../util/iteratees';\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?: number;\n};\n\ntype DispatchProps = Pick;\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 setGlobalSearchContent,\n setGlobalSearchDate,\n onReset,\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 (setGlobal, actions): DispatchProps => pick(actions, ['setGlobalSearchContent', 'setGlobalSearchDate']),\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\nexport default () => {\n return useReducer(twoFaReducer, INITIAL_STATE);\n};\n","import React, {\n FC, memo, useCallback, useMemo, useState,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { SettingsScreens } from '../../../types';\n\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../../util/environment';\nimport { pick } from '../../../util/iteratees';\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};\n\ntype DispatchProps = Pick;\n\nconst SettingsHeader: FC = ({\n currentScreen,\n editedFolderId,\n onReset,\n onSaveFilter,\n signOut,\n deleteChatFolder,\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.Notifications:\n return

{lang('Notifications')}

;\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 \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(withGlobal(\n undefined,\n (setGlobal, actions): DispatchProps => pick(actions, ['signOut', 'deleteChatFolder']),\n)(SettingsHeader));\n","import React, { FC, memo } from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { SettingsScreens } from '../../../types';\nimport { ApiUser } from '../../../api/types';\n\nimport { selectUser } from '../../../modules/selectors';\nimport { getUserFullName } from '../../../modules/helpers';\nimport { formatPhoneNumberWithCode } from '../../../util/phoneNumber';\nimport renderText from '../../common/helpers/renderText';\nimport useLang from '../../../hooks/useLang';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport ListItem from '../../ui/ListItem';\nimport Avatar from '../../common/Avatar';\n\ntype OwnProps = {\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\ntype StateProps = {\n currentUser?: ApiUser;\n};\n\nconst SettingsMain: FC = ({\n isActive,\n onScreenSelect,\n onReset,\n currentUser,\n}) => {\n const lang = useLang();\n const fullName = getUserFullName(currentUser);\n\n useHistoryBack(isActive, onReset, onScreenSelect, SettingsScreens.Main);\n\n return (\n
\n
\n {currentUser && (\n
\n \n

{fullName && renderText(fullName)}

\n

{formatPhoneNumberWithCode(currentUser.phoneNumber)}

\n
\n )}\n onScreenSelect(SettingsScreens.EditProfile)}\n >\n {lang('lng_settings_information')}\n \n onScreenSelect(SettingsScreens.Folders)}\n >\n {lang('Filters')}\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.Language)}\n >\n {lang('Language')}\n \n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const { currentUserId } = global;\n\n return {\n currentUser: currentUserId ? selectUser(global, currentUserId) : undefined,\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 { withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiMediaFormat } from '../../../api/types';\nimport { GlobalActions } from '../../../global/types';\nimport { ProfileEditProgress, SettingsScreens } from '../../../types';\n\nimport { throttle } from '../../../util/schedulers';\nimport { pick } from '../../../util/iteratees';\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\ntype DispatchProps = Pick;\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 loadCurrentUser,\n updateProfile,\n checkUsername,\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 (setGlobal, actions): DispatchProps => pick(actions, [\n 'loadCurrentUser',\n 'updateProfile',\n 'checkUsername',\n ]),\n)(SettingsEditProfile));\n","import React, {\n FC, memo, useMemo, useCallback, useState, useEffect,\n} from '../../../../lib/teact/teact';\nimport { withGlobal } from '../../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../../global/types';\nimport { ApiChatFolder, ApiChat, ApiUser } from '../../../../api/types';\nimport { NotifyException, NotifySettings, SettingsScreens } from '../../../../types';\n\nimport { STICKER_SIZE_FOLDER_SETTINGS } from '../../../../config';\nimport { pick } from '../../../../util/iteratees';\nimport { selectNotifyExceptions, selectNotifySettings } from '../../../../modules/selectors';\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';\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 onCreateFolder: () => void;\n onEditFolder: (folder: ApiChatFolder) => void;\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\ntype StateProps = {\n chatsById: Record;\n usersById: Record;\n orderedFolderIds?: number[];\n foldersById: Record;\n recommendedChatFolders?: ApiChatFolder[];\n notifySettings: NotifySettings;\n notifyExceptions?: Record;\n};\n\ntype DispatchProps = Pick;\n\nconst runThrottledForLoadRecommended = throttle((cb) => cb(), 60000, true);\n\nconst MAX_ALLOWED_FOLDERS = 10;\n\nconst SettingsFoldersMain: FC = ({\n onCreateFolder,\n onEditFolder,\n isActive,\n onScreenSelect,\n onReset,\n chatsById,\n usersById,\n orderedFolderIds,\n foldersById,\n recommendedChatFolders,\n notifySettings,\n notifyExceptions,\n loadRecommendedChatFolders,\n addChatFolder,\n showDialog,\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 userFolders = useMemo(() => {\n if (!orderedFolderIds) {\n return undefined;\n }\n\n const chatIds = Object.keys(chatsById).map(Number);\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(\n lang, chatsById, usersById, folder, chatIds, notifySettings, notifyExceptions,\n ),\n };\n });\n }, [orderedFolderIds, chatsById, foldersById, usersById, notifySettings, notifyExceptions, lang]);\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 && 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 && !!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 chats: { byId: chatsById },\n users: { byId: usersById },\n } = global;\n\n const {\n orderedIds: orderedFolderIds,\n byId: foldersById,\n recommended: recommendedChatFolders,\n } = global.chatFolders;\n\n return {\n chatsById,\n usersById,\n orderedFolderIds,\n foldersById,\n recommendedChatFolders,\n notifySettings: selectNotifySettings(global),\n notifyExceptions: selectNotifyExceptions(global),\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['loadRecommendedChatFolders', 'addChatFolder', 'showDialog']),\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 { withGlobal } from '../../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../../global/types';\nimport { SettingsScreens } from '../../../../types';\n\nimport { STICKER_SIZE_FOLDER_SETTINGS } from '../../../../config';\nimport { findIntersectionWithSet, pick } from '../../../../util/iteratees';\nimport { isChatPrivate } 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?: number[];\n loadedArchivedChatIds?: number[];\n};\n\ntype DispatchProps = Pick;\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 editChatFolder,\n addChatFolder,\n loadMoreChats,\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 useEffect(() => {\n if (\n visibleIncludedChatIds.length < includedChatIds.length\n || visibleExcludedChatIds.length < excludedChatIds.length\n ) {\n loadMoreChats({ listType: 'active' });\n }\n }, [\n loadMoreChats,\n excludedChatIds.length,\n includedChatIds.length,\n visibleExcludedChatIds.length,\n visibleIncludedChatIds.length,\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 {isChatPrivate(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 (setGlobal, actions): DispatchProps => pick(actions, ['editChatFolder', 'addChatFolder', 'loadMoreChats']),\n)(SettingsFoldersEdit));\n","import React, {\n FC, useCallback, useRef, useEffect, memo,\n} from '../../../../lib/teact/teact';\n\nimport { isChatPrivate } 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: number[];\n selectedIds: number[];\n selectedChatTypes: string[];\n filterValue?: string;\n onSelectedIdsChange: (ids: number[]) => void;\n onSelectedChatTypesChange: (types: 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_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 onLoadMore,\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: number) => {\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: number) {\n const isSelected = selectedIds.includes(id);\n\n return (\n handleItemClick(id)}\n ripple\n disabled={!isSelected && hasMaxChats}\n >\n {isChatPrivate(id) ? (\n \n ) : (\n \n )}\n \n \n );\n }\n\n const [viewportIds, getMore] = useInfiniteScroll(onLoadMore, 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 && 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 { withGlobal } from '../../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../../global/types';\nimport { ApiChat } from '../../../../api/types';\nimport { SettingsScreens } from '../../../../types';\n\nimport useLang from '../../../../hooks/useLang';\nimport { pick } from '../../../../util/iteratees';\nimport searchWords from '../../../../util/searchWords';\nimport { prepareChatList, getChatTitle } from '../../../../modules/helpers';\nimport {\n FoldersState,\n FolderEditDispatch,\n selectChatFilters,\n} from '../../../../hooks/reducers/useFoldersReducer';\nimport useHistoryBack from '../../../../hooks/useHistoryBack';\n\nimport SettingsFoldersChatsPicker from './SettingsFoldersChatsPicker';\n\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\ntype StateProps = {\n chatsById: Record;\n listIds?: number[];\n orderedPinnedIds?: number[];\n archivedListIds?: number[];\n archivedPinnedIds?: number[];\n};\n\ntype DispatchProps = Pick;\n\nconst SettingsFoldersChatFilters: FC = ({\n isActive,\n onScreenSelect,\n onReset,\n mode,\n state,\n dispatch,\n chatsById,\n listIds,\n orderedPinnedIds,\n archivedListIds,\n archivedPinnedIds,\n loadMoreChats,\n}) => {\n const { chatFilter } = state;\n const { selectedChatIds, selectedChatTypes } = selectChatFilters(state, mode, true);\n\n const lang = useLang();\n const chats = useMemo(() => {\n const activeChatArrays = listIds\n ? prepareChatList(chatsById, listIds, orderedPinnedIds, 'all')\n : undefined;\n const archivedChatArrays = archivedListIds\n ? prepareChatList(chatsById, archivedListIds, archivedPinnedIds, 'archived')\n : undefined;\n\n if (!activeChatArrays && !archivedChatArrays) {\n return undefined;\n }\n\n return [\n ...(activeChatArrays\n ? [...activeChatArrays.pinnedChats, ...activeChatArrays.otherChats]\n : []\n ),\n ...(archivedChatArrays ? archivedChatArrays.otherChats : []),\n ];\n }, [chatsById, listIds, orderedPinnedIds, archivedListIds, archivedPinnedIds]);\n\n const displayedIds = useMemo(() => {\n if (!chats) {\n return undefined;\n }\n\n return chats\n .filter((chat) => (\n !chatFilter\n || searchWords(getChatTitle(lang, chat), chatFilter)\n || selectedChatIds.includes(chat.id)\n ))\n .map(({ id }) => id);\n }, [chats, chatFilter, lang, selectedChatIds]);\n\n const handleFilterChange = useCallback((newFilter: string) => {\n dispatch({\n type: 'setChatFilter',\n payload: newFilter,\n });\n }, [dispatch]);\n\n const handleSelectedIdsChange = useCallback((ids: number[]) => {\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(isActive, onReset, onScreenSelect,\n mode === 'included' ? SettingsScreens.FoldersIncludedChats : SettingsScreens.FoldersExcludedChats);\n\n if (!displayedIds) {\n return ;\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 } = global;\n\n return {\n chatsById,\n listIds: listIds.active,\n orderedPinnedIds: orderedPinnedIds.active,\n archivedPinnedIds: orderedPinnedIds.archived,\n archivedListIds: listIds.archived,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['loadMoreChats']),\n)(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 { 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 range?: { min: number; max: number; step?: number };\n label?: string;\n value: number;\n disabled?: boolean;\n onChange: (value: number) => void;\n};\n\nconst RangeSlider: FC = ({\n options,\n range,\n label,\n value,\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 if (range) {\n const possibleValuesLength = (range.max - range.min) / (range.step || 1);\n return ((value - range.min) / possibleValuesLength) * 100;\n }\n return 0;\n }, [value, options, range]);\n\n const [min, max, step] = useMemo(() => {\n if (options) {\n return [0, options.length - 1, 1];\n } else if (range) {\n return [range.min, range.max, range.step || 1];\n }\n\n return [0, 0, 0];\n }, [range, options]);\n\n return (\n
\n {label && (\n
\n {label}\n {range && (\n {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 React, { FC, memo, useRef } 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 useTransitionForMedia from '../../../hooks/useTransitionForMedia';\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 { shouldRenderFullMedia, transitionClassNames } = useTransitionForMedia(lottieData, 'slow');\n\n return (\n
\n {!shouldRenderFullMedia && getFirstLetters(stickerSet.title, 2)}\n {shouldRenderFullMedia && lottieData && (\n \n )}\n
\n );\n};\n\nexport default memo(StickerSetCoverAnimated);\n","import React, { FC, memo, useRef } from '../../../lib/teact/teact';\n\nimport { ApiStickerSet } from '../../../api/types';\n\nimport { ObserveFn, useIsIntersecting } from '../../../hooks/useIntersectionObserver';\nimport useMedia from '../../../hooks/useMedia';\nimport useTransitionForMedia from '../../../hooks/useTransitionForMedia';\nimport { getFirstLetters } from '../../../util/textFormat';\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 { shouldRenderFullMedia, transitionClassNames } = useTransitionForMedia(mediaData, 'slow');\n\n return (\n
\n {!shouldRenderFullMedia && getFirstLetters(stickerSet.title, 2)}\n {shouldRenderFullMedia && (\n \"\"\n )}\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 && stickerSet.stickers[0];\n\n if (stickerSet.hasThumbnail || !firstSticker) {\n return (\n firstSticker && onClick(firstSticker)}\n >\n \n {stickerSet.isAnimated ? (\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, useEffect, useRef, useState,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { SettingsScreens, ISettings } 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 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 from '../../ui/RadioGroup';\nimport SettingsStickerSet from './SettingsStickerSet';\nimport StickerSetModal from '../../common/StickerSetModal.async';\n\ntype OwnProps = {\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\ntype StateProps = Pick & {\n stickerSetIds?: string[];\n stickerSetsById?: Record;\n};\n\ntype DispatchProps = Pick;\n\nconst ANIMATION_LEVEL_OPTIONS = [\n 'Solid and Steady',\n 'Nice and Fast',\n 'Lots of Stuff',\n];\n\nconst SettingsGeneral: FC = ({\n isActive,\n onScreenSelect,\n onReset,\n stickerSetIds,\n stickerSetsById,\n messageTextSize,\n animationLevel,\n messageSendKeyCombo,\n shouldAutoDownloadMediaFromContacts,\n shouldAutoDownloadMediaInPrivateChats,\n shouldAutoDownloadMediaInGroups,\n shouldAutoDownloadMediaInChannels,\n shouldAutoPlayGifs,\n shouldAutoPlayVideos,\n shouldSuggestStickers,\n shouldLoopStickers,\n setSettingOption,\n loadStickerSets,\n loadAddedStickers,\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 useEffect(() => {\n loadStickerSets();\n }, [loadStickerSets]);\n\n useEffect(() => {\n if (stickerSetIds && stickerSetIds.length) {\n loadAddedStickers();\n }\n }, [stickerSetIds, loadAddedStickers]);\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 handleStickerSetClick = useCallback((value: ApiSticker) => {\n setSticker(value);\n openModal();\n }, [openModal]);\n\n const stickerSets = stickerSetIds && stickerSetIds.map((id: string) => {\n return stickerSetsById && stickerSetsById[id] && 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 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('AutoDownloadMedia')}

\n\n setSettingOption({ shouldAutoDownloadMediaFromContacts: isChecked })}\n />\n setSettingOption({ shouldAutoDownloadMediaInPrivateChats: isChecked })}\n />\n setSettingOption({ shouldAutoDownloadMediaInGroups: isChecked })}\n />\n setSettingOption({ shouldAutoDownloadMediaInChannels: isChecked })}\n />\n
\n\n
\n

{lang('AutoplayMedia')}

\n\n setSettingOption({ shouldAutoPlayGifs: isChecked })}\n />\n setSettingOption({ shouldAutoPlayVideos: isChecked })}\n />\n
\n\n
\n

{lang('AccDescrStickers')}

\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 'shouldAutoDownloadMediaFromContacts',\n 'shouldAutoDownloadMediaInPrivateChats',\n 'shouldAutoDownloadMediaInGroups',\n 'shouldAutoDownloadMediaInChannels',\n 'shouldAutoPlayGifs',\n 'shouldAutoPlayVideos',\n 'shouldSuggestStickers',\n 'shouldLoopStickers',\n 'isSensitiveEnabled',\n 'canChangeSensitive',\n ]),\n stickerSetIds: global.stickers.added.setIds,\n stickerSetsById: global.stickers.setsById,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'setSettingOption', 'loadStickerSets', 'loadAddedStickers',\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 useTransitionForMedia from '../../../hooks/useTransitionForMedia';\nimport buildClassName from '../../../util/buildClassName';\nimport useMedia from '../../../hooks/useMedia';\nimport useMediaWithDownloadProgress from '../../../hooks/useMediaWithDownloadProgress';\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(\n document.thumbnail && document.thumbnail.dataUri,\n Boolean(previewBlobUrl),\n true,\n );\n const {\n shouldRenderThumb, shouldRenderFullMedia, transitionClassNames,\n } = useTransitionForMedia(previewBlobUrl || localBlobUrl, 'slow');\n const [isDownloadAllowed, setIsDownloadAllowed] = useState(false);\n const {\n mediaData: fullMedia, downloadProgress,\n } = useMediaWithDownloadProgress(localMediaHash, !isDownloadAllowed);\n const wasDownloadDisabled = usePrevious(isDownloadAllowed) === false;\n const { shouldRender: shouldRenderSpinner, transitionClassNames: spinnerClassNames } = useShowTransition(\n (isDownloadAllowed && !fullMedia) || slug === UPLOADING_WALLPAPER_SLUG,\n undefined,\n wasDownloadDisabled,\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 setIsDownloadAllowed((isAllowed) => !isAllowed);\n }\n }, [fullMedia, handleSelect]);\n\n const className = buildClassName(\n 'WallpaperTile',\n isSelected && 'selected',\n );\n\n return (\n
\n
\n {shouldRenderThumb && (\n \n )}\n {shouldRenderFullMedia && (\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 { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\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 { pick } from '../../../util/iteratees';\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\ntype DispatchProps = Pick;\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 loadWallpapers,\n uploadWallpaper,\n setThemeSettings,\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 && 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 && 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 (setGlobal, actions): DispatchProps => pick(actions, [\n 'loadWallpapers', 'uploadWallpaper', 'setThemeSettings',\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 { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\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\ntype DispatchProps = Pick;\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 setThemeSettings,\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\n captureEvents(colorPickerRef.current!, {\n onCapture: handleColorDrag,\n onDrag: handleColorDrag,\n onRelease: unmarkIsDragging,\n onClick: unmarkIsDragging,\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\n captureEvents(huePickerRef.current!, {\n onCapture: handleHueDrag,\n onDrag: handleHueDrag,\n onRelease: unmarkIsDragging,\n onClick: unmarkIsDragging,\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 (setGlobal, actions): DispatchProps => pick(actions, ['setThemeSettings']),\n)(SettingsGeneralBackground));\n","import { ChangeEvent } from 'react';\nimport React, {\n FC, memo, useCallback, useEffect,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { SettingsScreens } from '../../../types';\n\nimport { pick } from '../../../util/iteratees';\nimport useLang from '../../../hooks/useLang';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport Checkbox from '../../ui/Checkbox';\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};\n\ntype DispatchProps = Pick;\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 loadNotificationSettings,\n updateContactSignUpNotification,\n updateNotificationSettings,\n}) => {\n useEffect(() => {\n loadNotificationSettings();\n }, [loadNotificationSettings]);\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 {lang('AutodownloadPrivateChats')}\n

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

{lang('FilterGroups')}

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

{lang('FilterChannels')}

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

{lang('PhoneOther')}

\n\n \n
\n
\n );\n};\n\nexport default memo(withGlobal((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 };\n},\n(setGlobal, actions): DispatchProps => pick(actions, [\n 'loadNotificationSettings',\n 'updateContactSignUpNotification',\n 'updateNotificationSettings',\n]))(SettingsNotifications));\n","import React, { FC, memo, useEffect } from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { PrivacyVisibility, SettingsScreens } from '../../../types';\n\nimport { pick } from '../../../util/iteratees';\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\ntype DispatchProps = Pick;\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 loadPrivacySettings,\n loadBlockedContacts,\n loadAuthorizations,\n loadContentSettings,\n updateContentSettings,\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 && privacy.phoneNumber.visibility,\n visibilityPrivacyLastSeen: privacy.lastSeen && privacy.lastSeen.visibility,\n visibilityPrivacyProfilePhoto: privacy.profilePhoto && privacy.profilePhoto.visibility,\n visibilityPrivacyForwarding: privacy.forwards && privacy.forwards.visibility,\n visibilityPrivacyGroupChats: privacy.chatInvite && privacy.chatInvite.visibility,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'loadBlockedContacts', 'loadAuthorizations', 'loadPrivacySettings', 'loadContentSettings', 'updateContentSettings',\n ]),\n)(SettingsPrivacy));\n","import React, {\n FC, memo, useCallback, useEffect, useMemo, useState,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { ISettings, SettingsScreens } from '../../../types';\nimport { ApiLanguage } from '../../../api/types';\n\nimport { setLanguage } from '../../../util/langProvider';\nimport { pick } from '../../../util/iteratees';\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\ntype DispatchProps = Pick;\n\nconst SettingsLanguage: FC = ({\n isActive,\n onScreenSelect,\n onReset,\n languages,\n language,\n loadLanguages,\n setSettingOption,\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 setLanguage(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 (setGlobal, actions): DispatchProps => pick(actions, [\n 'loadLanguages', 'setSettingOption',\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 { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { ApiChat, ApiUser } from '../../../api/types';\nimport { ApiPrivacySettings, SettingsScreens } from '../../../types';\n\nimport useLang from '../../../hooks/useLang';\nimport { pick } from '../../../util/iteratees';\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 = Partial & {\n chatsById?: Record;\n usersById?: Record;\n};\n\ntype DispatchProps = Pick;\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 setPrivacyVisibility,\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 { onScreenSelect(allowedContactsScreen); }}\n >\n
\n {allowedCount > 0 && +{allowedCount}}\n {lang('AlwaysShareWith')}\n {lang('EditAdminAddUsers')}\n
\n \n )}\n {exceptionLists.shouldShowDenied && (\n { onScreenSelect(deniedContactsScreen); }}\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 (setGlobal, actions): DispatchProps => pick(actions, ['setPrivacyVisibility']),\n)(SettingsPrivacyVisibility));\n","import React, {\n FC, memo, useCallback, useEffect, useMemo,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { ApiSession } from '../../../api/types';\nimport { SettingsScreens } from '../../../types';\n\nimport { pick } from '../../../util/iteratees';\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\ntype DispatchProps = Pick;\n\nconst SettingsPrivacyActiveSessions: FC = ({\n isActive,\n onScreenSelect,\n onReset,\n activeSessions,\n loadAuthorizations,\n terminateAuthorization,\n terminateAllAuthorizations,\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 >\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 (setGlobal, actions): DispatchProps => pick(actions, [\n 'loadAuthorizations', 'terminateAuthorization', 'terminateAllAuthorizations',\n ]),\n)(SettingsPrivacyActiveSessions));\n","import React, {\n FC, memo, useCallback,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { ApiChat, ApiUser } from '../../../api/types';\nimport { SettingsScreens } from '../../../types';\n\nimport { CHAT_HEIGHT_PX } from '../../../config';\nimport { formatPhoneNumberWithCode } from '../../../util/phoneNumber';\nimport { pick } from '../../../util/iteratees';\nimport {\n getChatTitle, getUserFullName, isChatPrivate,\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';\n\nimport ListItem from '../../ui/ListItem';\nimport FloatingActionButton from '../../ui/FloatingActionButton';\nimport Avatar from '../../common/Avatar';\nimport Loading from '../../ui/Loading';\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: number[];\n};\n\ntype DispatchProps = Pick;\n\nconst SettingsPrivacyBlockedUsers: FC = ({\n isActive,\n onScreenSelect,\n onReset,\n chatsByIds,\n usersByIds,\n blockedIds,\n unblockContact,\n}) => {\n const handleUnblockClick = useCallback((contactId: number) => {\n unblockContact({ contactId });\n }, [unblockContact]);\n\n const lang = useLang();\n\n useHistoryBack(isActive, onReset, onScreenSelect, SettingsScreens.PrivacyBlockedUsers);\n\n function renderContact(contactId: number, i: number, viewportOffset: number) {\n const isPrivate = isChatPrivate(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',\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 && user.phoneNumber && (\n
{formatPhoneNumberWithCode(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 && blockedIds.length ? (\n
\n {blockedIds!.map((contactId, i) => renderContact(contactId, i, 0))}\n
\n ) : blockedIds && !blockedIds.length ? (\n
\n List is empty\n
\n ) : (\n \n )}\n
\n
\n\n {\n }}\n className=\"not-implemented\"\n ariaLabel=\"Add a blocked user\"\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 } = global;\n\n return {\n chatsByIds,\n usersByIds,\n blockedIds: ids,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['unblockContact']),\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 { withGlobal } from '../../../../lib/teact/teactn';\n\nimport { GlobalActions, GlobalState } from '../../../../global/types';\nimport { SettingsScreens } from '../../../../types';\n\nimport { pick } from '../../../../util/iteratees';\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\ntype DispatchProps = Pick;\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 updatePassword,\n checkPassword,\n clearTwoFaError,\n updateRecoveryEmail,\n provideTwoFaEmailCode,\n clearPassword,\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 (setGlobal, actions): DispatchProps => pick(actions, [\n 'updatePassword', 'updateRecoveryEmail', 'clearPassword', 'provideTwoFaEmailCode',\n 'checkPassword', 'clearTwoFaError',\n ]),\n)(SettingsTwoFa));\n","import React, {\n FC, memo, useCallback, useMemo, useState,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions, GlobalState } from '../../../global/types';\nimport { ApiChat } from '../../../api/types';\nimport { ApiPrivacySettings, SettingsScreens } from '../../../types';\n\nimport useLang from '../../../hooks/useLang';\nimport { pick } from '../../../util/iteratees';\nimport searchWords from '../../../util/searchWords';\nimport { getPrivacyKey } from './helper/privacy';\nimport {\n getChatTitle, isChatGroup, isChatPrivate, prepareChatList,\n} from '../../../modules/helpers';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\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?: number;\n chatsById: Record;\n listIds?: number[];\n orderedPinnedIds?: number[];\n archivedListIds?: number[];\n archivedPinnedIds?: number[];\n settings?: ApiPrivacySettings;\n};\n\ntype DispatchProps = Pick;\n\nconst SettingsPrivacyVisibilityExceptionList: FC = ({\n currentUserId,\n isAllowList,\n screen,\n settings,\n chatsById,\n listIds,\n orderedPinnedIds,\n archivedListIds,\n archivedPinnedIds,\n setPrivacySettings,\n isActive,\n onScreenSelect,\n onReset,\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 chats = useMemo(() => {\n const activeChatArrays = listIds\n ? prepareChatList(chatsById, listIds, orderedPinnedIds, 'all')\n : undefined;\n const archivedChatArrays = archivedListIds\n ? prepareChatList(chatsById, archivedListIds, archivedPinnedIds, 'archived')\n : undefined;\n\n if (!activeChatArrays && !archivedChatArrays) {\n return undefined;\n }\n\n return [\n ...(activeChatArrays\n ? [\n ...activeChatArrays.pinnedChats,\n ...activeChatArrays.otherChats,\n ]\n : []\n ),\n ...(archivedChatArrays ? archivedChatArrays.otherChats : []),\n ];\n }, [chatsById, listIds, orderedPinnedIds, archivedListIds, archivedPinnedIds]);\n\n const displayedIds = useMemo(() => {\n if (!chats) {\n return undefined;\n }\n\n return chats\n .filter((chat) => (\n ((isChatPrivate(chat.id) && chat.id !== currentUserId) || isChatGroup(chat))\n && (\n !searchQuery\n || searchWords(getChatTitle(lang, chat), searchQuery)\n || selectedContactIds.includes(chat.id)\n )\n ))\n .map(({ id }) => id);\n }, [chats, currentUserId, lang, searchQuery, selectedContactIds]);\n\n const handleSelectedContactIdsChange = useCallback((value: number[]) => {\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\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 const {\n chats: {\n byId: chatsById,\n listIds,\n orderedPinnedIds,\n },\n currentUserId,\n } = global;\n\n return {\n currentUserId,\n chatsById,\n listIds: listIds.active,\n orderedPinnedIds: orderedPinnedIds.active,\n archivedPinnedIds: orderedPinnedIds.archived,\n archivedListIds: listIds.archived,\n settings: getCurrentPrivacySettings(global, screen),\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['setPrivacySettings']),\n)(SettingsPrivacyVisibilityExceptionList));\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 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';\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.Notifications:\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 { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { ApiUser } from '../../../api/types';\n\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../../util/environment';\nimport { throttle } from '../../../util/schedulers';\nimport searchWords from '../../../util/searchWords';\nimport { pick } from '../../../util/iteratees';\nimport { getUserFullName, 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 contactIds?: number[];\n serverTimeOffset: number;\n};\n\ntype DispatchProps = Pick;\n\nconst runThrottled = throttle((cb) => cb(), 60000, true);\n\nconst ContactList: FC = ({\n isActive, onReset,\n filter, usersById, contactIds, loadContactList, openChat, serverTimeOffset,\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(\n (id: number) => {\n openChat({ id, shouldReplaceHistory: true });\n },\n [openChat],\n );\n\n const listIds = useMemo(() => {\n if (!contactIds) {\n return undefined;\n }\n\n const resultIds = filter ? contactIds.filter((id) => {\n const user = usersById[id];\n if (!user) {\n return false;\n }\n const fullName = getUserFullName(user);\n return fullName && searchWords(fullName, filter);\n }) : contactIds;\n\n return sortUserIds(resultIds, usersById, undefined, serverTimeOffset);\n }, [contactIds, filter, usersById, serverTimeOffset]);\n\n const [viewportIds, getMore] = useInfiniteScroll(undefined, listIds, Boolean(filter));\n\n return (\n \n {viewportIds && 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 } = global.users;\n\n return {\n usersById,\n contactIds,\n serverTimeOffset: global.serverTimeOffset,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['loadContactList', 'openChat']),\n)(ContactList));\n","import React, {\n FC, useCallback, useEffect, useMemo, memo,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { ApiChat, ApiUser } from '../../../api/types';\n\nimport { pick, unique } from '../../../util/iteratees';\nimport { throttle } from '../../../util/schedulers';\nimport searchWords from '../../../util/searchWords';\nimport { getUserFullName, 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: number[];\n onSelectedMemberIdsChange: (ids: number[]) => void;\n onNextStep: () => void;\n onReset: () => void;\n};\n\ntype StateProps = {\n currentUserId?: number;\n usersById: Record;\n chatsById: Record;\n localContactIds?: number[];\n searchQuery?: string;\n isSearching?: boolean;\n localUserIds?: number[];\n globalUserIds?: number[];\n};\n\ntype DispatchProps = Pick;\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 currentUserId,\n usersById,\n chatsById,\n localContactIds,\n searchQuery,\n isSearching,\n localUserIds,\n globalUserIds,\n loadContactList,\n setGlobalSearchQuery,\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 const contactIds = localContactIds\n ? sortChatIds(localContactIds.filter((id) => id !== currentUserId), chatsById)\n : [];\n\n if (!searchQuery) {\n return contactIds;\n }\n\n const foundContactIds = contactIds.filter((id) => {\n const user = usersById[id];\n if (!user) {\n return false;\n }\n const fullName = getUserFullName(user);\n return fullName && searchWords(fullName, searchQuery);\n });\n\n return sortChatIds(\n unique([\n ...foundContactIds,\n ...(localUserIds || []),\n ...(globalUserIds || []),\n ]).filter((contactId) => {\n const user = usersById[contactId];\n\n return !user || !isUserBot(user) || user.canBeInvitedToGroup;\n }),\n chatsById,\n false,\n selectedMemberIds,\n );\n }, [\n localContactIds, chatsById, searchQuery, localUserIds, globalUserIds, selectedMemberIds,\n currentUserId, usersById,\n ]);\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: usersById } = global.users;\n const { byId: chatsById } = global.chats;\n const { currentUserId } = global;\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 currentUserId,\n usersById,\n chatsById,\n localContactIds,\n searchQuery,\n isSearching: fetchingStatus && fetchingStatus.chats,\n globalUserIds,\n localUserIds,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['loadContactList', 'setGlobalSearchQuery']),\n)(NewChatStep1));\n","import React, {\n FC, useState, useCallback, useEffect, memo,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { ChatCreationProgress } from '../../../types';\n\nimport { pick } from '../../../util/iteratees';\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: number[];\n onReset: (forceReturnToChatList?: boolean) => void;\n};\n\ntype StateProps = {\n creationProgress?: ChatCreationProgress;\n creationError?: string;\n};\n\ntype DispatchProps = Pick;\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 createGroupChat,\n createChannel,\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 || (\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 (setGlobal, actions): DispatchProps => pick(actions, [\n 'createGroupChat', 'createChannel',\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","const 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\nconst preventDefault = (e: Event) => {\n e.preventDefault();\n};\n\nfunction preventDefaultForScrollKeys(e: KeyboardEvent) {\n if (IGNORED_KEYS[e.key] && !isTextBox(e.target)) {\n preventDefault(e);\n }\n}\n\nexport function disableScrolling() {\n // Disable scrolling in Chrome\n document.addEventListener('wheel', preventDefault, { passive: false });\n window.ontouchmove = preventDefault; // mobile\n document.onkeydown = preventDefaultForScrollKeys;\n}\n\nexport function enableScrolling() {\n document.removeEventListener('wheel', preventDefault); // Enable scrolling in Chrome\n // eslint-disable-next-line no-null/no-null\n window.ontouchmove = null;\n // eslint-disable-next-line no-null/no-null\n document.onkeydown = null;\n}\n","import { ApiMediaFormat, ApiMessage } from '../../../../api/types';\n\nimport * as mediaLoader from '../../../../util/mediaLoader';\nimport {\n getMessageMediaHash,\n getMessagePhoto,\n getMessageText,\n getMessageWebPagePhoto,\n getMessageWebPageVideo,\n hasMessageLocalBlobUrl,\n} from '../../../../modules/helpers';\nimport { CLIPBOARD_ITEM_SUPPORTED, copyImageToClipboard, copyTextToClipboard } from '../../../../util/clipboard';\n\ntype ICopyOptions = {\n label: string;\n handler: () => void;\n}[];\n\nexport function getMessageCopyOptions(\n message: ApiMessage, afterEffect?: () => void, onCopyLink?: () => 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\n && selection.anchorNode\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 clipboardText = hasSelection && selection ? selection.toString() : text;\n copyTextToClipboard(clipboardText);\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","import React, { FC, useCallback } from '../../../lib/teact/teact';\n\nimport { ApiMessage } from '../../../api/types';\nimport { IAnchorPosition } from '../../../types';\n\nimport { getMessageCopyOptions } from './helpers/copyOptions';\nimport useContextMenuPosition from '../../../hooks/useContextMenuPosition';\nimport useLang from '../../../hooks/useLang';\n\nimport Menu from '../../ui/Menu';\nimport MenuItem from '../../ui/MenuItem';\n\nimport './MessageContextMenu.scss';\n\ntype OwnProps = {\n isOpen: boolean;\n anchor: IAnchorPosition;\n message: ApiMessage;\n canSendNow?: boolean;\n canReschedule?: boolean;\n canReply?: boolean;\n canPin?: 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 canCopyLink?: boolean;\n canSelect?: boolean;\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};\n\nconst SCROLLBAR_WIDTH = 10;\n\nconst MessageContextMenu: FC = ({\n isOpen,\n message,\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 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}) => {\n const copyOptions = getMessageCopyOptions(message, onClose, canCopyLink ? onCopyLink : undefined);\n\n const getTriggerElement = useCallback(() => {\n return document.querySelector(`.active > .MessageList div[data-message-id=\"${message.id}\"]`);\n }, [message.id]);\n\n const getRootElement = useCallback(\n () => document.querySelector('.active > .MessageList'),\n [],\n );\n\n const getMenuElement = useCallback(\n () => document.querySelector('.MessageContextMenu .bubble'),\n [],\n );\n\n const { positionX, positionY, style } = useContextMenuPosition(\n anchor,\n getTriggerElement,\n getRootElement,\n getMenuElement,\n SCROLLBAR_WIDTH,\n (document.querySelector('.MiddleHeader') as HTMLElement).offsetHeight,\n );\n\n const lang = useLang();\n\n return (\n \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 {canForward && {lang('Forward')}}\n {canSelect && {lang('Common.Select')}}\n {canReport && {lang('lng_context_report_msg')}}\n {canDelete && {lang('Delete')}}\n \n );\n};\n\nexport default MessageContextMenu;\n","import React, {\n FC, memo, useCallback, useEffect, useMemo, useState,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions, MessageListType } from '../../../global/types';\nimport { ApiMessage } from '../../../api/types';\nimport { IAlbum, IAnchorPosition } from '../../../types';\nimport { selectAllowedMessageActions, selectCurrentMessageList } from '../../../modules/selectors';\nimport { disableScrolling, enableScrolling } from '../../../util/scrollLock';\nimport { pick } from '../../../util/iteratees';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport useFlag from '../../../hooks/useFlag';\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 { getDayStartAt } from '../../../util/dateFormat';\nimport { copyTextToClipboard } from '../../../util/clipboard';\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 noOptions?: boolean;\n canSendNow?: boolean;\n canReschedule?: boolean;\n canReply?: boolean;\n canPin?: 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 canCopyLink?: boolean;\n canSelect?: boolean;\n};\n\ntype DispatchProps = Pick;\n\nconst ContextMenuContainer: FC = ({\n isOpen,\n messageListType,\n chatUsername,\n message,\n album,\n anchor,\n onClose,\n onCloseAnimationEnd,\n noOptions,\n canSendNow,\n canReschedule,\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 setReplyingToId,\n setEditingId,\n pinMessage,\n openForwardMenu,\n faveSticker,\n unfaveSticker,\n toggleMessageSelection,\n sendScheduledMessages,\n rescheduleMessage,\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 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 && 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 && 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 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 handleCopyLink = useCallback(() => {\n copyTextToClipboard(`https://t.me/${chatUsername || `c/${Math.abs(message.chatId)}`}/${message.id}`);\n closeMenu();\n }, [chatUsername, closeMenu, message.chatId, message.id]);\n\n useEffect(() => {\n disableScrolling();\n\n return enableScrolling;\n }, []);\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 \n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { message, messageListType }): StateProps => {\n const { threadId } = selectCurrentMessageList(global) || {};\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 } = (threadId && selectAllowedMessageActions(global, message, threadId)) || {};\n const isPinned = messageListType === 'pinned';\n const isScheduled = messageListType === 'scheduled';\n\n return {\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: !isScheduled && canForward,\n canFaveSticker: !isScheduled && canFaveSticker,\n canUnfaveSticker: !isScheduled && canUnfaveSticker,\n canCopy,\n canCopyLink: !isScheduled && canCopyLink,\n canSelect,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'setReplyingToId',\n 'setEditingId',\n 'pinMessage',\n 'openForwardMenu',\n 'faveSticker',\n 'unfaveSticker',\n 'toggleMessageSelection',\n 'sendScheduledMessages',\n 'rescheduleMessage',\n ]),\n)(ContextMenuContainer));\n","import React, {\n FC, memo, useCallback, useEffect, useRef,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiSticker, ApiStickerSet } from '../../api/types';\nimport { GlobalActions } from '../../global/types';\n\nimport { STICKER_SIZE_MODAL } from '../../config';\nimport { pick } from '../../util/iteratees';\nimport { selectStickerSet } from '../../modules/selectors';\nimport { useIntersectionObserver } from '../../hooks/useIntersectionObserver';\nimport useLang from '../../hooks/useLang';\nimport renderText from './helpers/renderText';\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 onClose: () => void;\n};\n\ntype StateProps = {\n stickerSet?: ApiStickerSet;\n};\n\ntype DispatchProps = Pick;\n\nconst INTERSECTION_THROTTLE = 200;\n\nconst StickerSetModal: FC = ({\n isOpen,\n fromSticker,\n stickerSet,\n onClose,\n loadStickers,\n toggleStickerSet,\n sendMessage,\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 const { stickerSetId, stickerSetAccessHash } = fromSticker;\n loadStickers({ stickerSetId, stickerSetAccessHash });\n }\n }, [isOpen, fromSticker, loadStickers]);\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 toggleStickerSet({ stickerSetId: fromSticker.stickerSetId });\n onClose();\n }, [fromSticker.stickerSetId, onClose, toggleStickerSet]);\n\n return (\n \n {stickerSet && 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 }: OwnProps) => {\n return { stickerSet: selectStickerSet(global, fromSticker.stickerSetId) };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'loadStickers',\n 'toggleStickerSet',\n 'sendMessage',\n ]),\n)(StickerSetModal));\n","import React, {\n FC, memo, useCallback, useEffect, useState,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\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 { selectChat, selectNotifySettings, selectNotifyExceptions } from '../../modules/selectors';\nimport { pick } from '../../util/iteratees';\nimport { isChatPrivate, getCanDeleteChat, selectIsChatMuted } 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\ntype DispatchProps = Pick;\n\nexport type OwnProps = {\n chatId: number;\n threadId: number;\n isOpen: boolean;\n anchor: IAnchorPosition;\n isChannel?: boolean;\n canStartBot?: boolean;\n canRestartBot?: boolean;\n canSubscribe?: boolean;\n canSearch?: boolean;\n canMute?: boolean;\n canSelect?: boolean;\n canLeave?: 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 canDeleteChat?: boolean;\n};\n\nconst HeaderMenuContainer: FC = ({\n chatId,\n isOpen,\n anchor,\n isChannel,\n canStartBot,\n canRestartBot,\n canSubscribe,\n canSearch,\n canMute,\n canSelect,\n canLeave,\n chat,\n isPrivate,\n isMuted,\n canDeleteChat,\n onSubscribeChannel,\n onSearchClick,\n onClose,\n onCloseAnimationEnd,\n updateChatMutedState,\n enterMessageSelectMode,\n sendBotCommand,\n restartBot,\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 handleSubscribe = useCallback(() => {\n onSubscribeChannel();\n closeMenu();\n }, [closeMenu, onSubscribeChannel]);\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 {IS_SINGLE_COLUMN_LAYOUT && canStartBot && (\n \n {lang('BotStart')}\n \n )}\n {IS_SINGLE_COLUMN_LAYOUT && canRestartBot && (\n \n {lang('BotRestart')}\n \n )}\n {IS_SINGLE_COLUMN_LAYOUT && canSubscribe && (\n \n {lang(isChannel ? 'Subscribe' : 'Join Group')}\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 {canSelect && (\n \n {lang('ReportSelectMessages')}\n \n )}\n {canLeave && (\n \n {lang(isPrivate\n ? 'Delete'\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\n return {\n chat,\n isMuted: selectIsChatMuted(chat, selectNotifySettings(global), selectNotifyExceptions(global)),\n isPrivate: isChatPrivate(chat.id),\n canDeleteChat: getCanDeleteChat(chat),\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'updateChatMutedState',\n 'enterMessageSelectMode',\n 'sendBotCommand',\n 'restartBot',\n ]),\n)(HeaderMenuContainer));\n","import React, {\n FC, memo, useCallback, useEffect, useRef, useState, useLayoutEffect,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiChat } from '../../api/types';\nimport { GlobalActions } from '../../global/types';\n\nimport { debounce } from '../../util/schedulers';\nimport { selectCurrentTextSearch, selectCurrentChat } from '../../modules/selectors';\nimport { pick } from '../../util/iteratees';\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\ntype DispatchProps = Pick;\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 setLocalTextSearchQuery,\n searchTextMessagesLocal,\n focusMessage,\n closeLocalTextSearch,\n openHistoryCalendar,\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 && foundIds && foundIds.length) {\n focusMessage({ chatId: chat.id, messageId: foundIds[foundIds.length - 1] });\n setFocusedIndex(0);\n } else {\n setFocusedIndex(-1);\n }\n }, [chat, 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[foundIds.length - 1 - 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[foundIds.length - 1 - 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 && 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 (setGlobal, actions): DispatchProps => pick(actions, [\n 'setLocalTextSearchQuery',\n 'searchTextMessagesLocal',\n 'focusMessage',\n 'closeLocalTextSearch',\n 'openHistoryCalendar',\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 React, {\n FC, useCallback, useEffect, useState, useRef, memo,\n} from '../../../lib/teact/teact';\nimport usePrevious from '../../../hooks/usePrevious';\n\nimport { ApiUser } from '../../../api/types';\n\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport buildClassName from '../../../util/buildClassName';\nimport captureKeyboardListeners from '../../../util/captureKeyboardListeners';\nimport setTooltipItemVisible from '../../../util/setTooltipItemVisible';\nimport cycleRestrict from '../../../util/cycleRestrict';\n\nimport ListItem from '../../ui/ListItem';\nimport PrivateChatInfo from '../../common/PrivateChatInfo';\n\nimport './MentionTooltip.scss';\n\nexport type OwnProps = {\n isOpen: boolean;\n filter: string;\n onClose: () => void;\n onInsertUserName: (user: ApiUser, forceFocus?: boolean) => void;\n filteredUsers?: ApiUser[];\n usersById?: Record;\n};\n\nconst MentionTooltip: FC = ({\n isOpen,\n filter,\n onClose,\n onInsertUserName,\n usersById,\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 getSelectedIndex = useCallback((newIndex: number) => {\n if (!filteredUsers) {\n return -1;\n }\n const membersCount = filteredUsers!.length;\n return cycleRestrict(membersCount, newIndex);\n }, [filteredUsers]);\n\n const [selectedMentionIndex, setSelectedMentionIndex] = useState(-1);\n\n const handleArrowKey = useCallback((value: number, e: KeyboardEvent) => {\n e.preventDefault();\n setSelectedMentionIndex((index) => (getSelectedIndex(index + value)));\n }, [setSelectedMentionIndex, getSelectedIndex]);\n\n const handleUserSelect = useCallback((userId: number, forceFocus = false) => {\n const user = usersById && usersById[userId];\n if (!user) {\n return;\n }\n\n onInsertUserName(user, forceFocus);\n }, [usersById, onInsertUserName]);\n\n const handleSelectMention = useCallback((e: KeyboardEvent) => {\n if (filteredUsers && filteredUsers.length && selectedMentionIndex > -1) {\n const member = filteredUsers[selectedMentionIndex];\n if (member) {\n e.preventDefault();\n handleUserSelect(member.id, true);\n }\n }\n }, [filteredUsers, selectedMentionIndex, handleUserSelect]);\n\n useEffect(() => (isOpen ? captureKeyboardListeners({\n onEsc: onClose,\n onUp: (e: KeyboardEvent) => handleArrowKey(-1, e),\n onDown: (e: KeyboardEvent) => handleArrowKey(1, e),\n onEnter: handleSelectMention,\n onTab: handleSelectMention,\n }) : undefined), [isOpen, onClose, handleArrowKey, handleSelectMention]);\n\n useEffect(() => {\n if (filteredUsers && !filteredUsers.length) {\n onClose();\n }\n }, [filteredUsers, onClose]);\n\n useEffect(() => {\n setSelectedMentionIndex(0);\n }, [filter]);\n\n useEffect(() => {\n setTooltipItemVisible('.chat-item-clickable', selectedMentionIndex, containerRef);\n }, [selectedMentionIndex]);\n\n const prevChatMembers = usePrevious(\n filteredUsers && 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 && 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, ApiUser } from '../../../api/types';\n\nimport { CONTENT_TYPES_FOR_QUICK_UPLOAD, EDITABLE_INPUT_MODAL_ID } 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';\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 attachments: ApiAttachment[];\n caption: string;\n isReady?: boolean;\n currentUserId?: number;\n groupChatMembers?: ApiChatMember[];\n usersById?: Record;\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 attachments,\n caption,\n isReady,\n currentUserId,\n groupChatMembers,\n usersById,\n recentEmojis,\n baseEmojiKeywords,\n emojiKeywords,\n addRecentEmoji,\n onCaptionUpdate,\n onSend,\n onFileAppend,\n onClear,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const hideTimeoutRef = useRef(null);\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, mentionFilter,\n closeMentionTooltip, insertMention,\n mentionFilteredUsers,\n } = useMentionTooltip(\n isOpen,\n caption,\n onCaptionUpdate,\n EDITABLE_INPUT_MODAL_ID,\n groupChatMembers,\n undefined,\n currentUserId,\n usersById,\n );\n const {\n isEmojiTooltipOpen, closeEmojiTooltip, filteredEmojis, insertEmoji,\n } = useEmojiTooltip(\n isOpen,\n caption,\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 && files.length) {\n const newFiles = isQuick\n ? Array.from(files).filter((file) => {\n return file.type && CONTENT_TYPES_FOR_QUICK_UPLOAD.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 }\n }\n\n if (!renderingAttachments) {\n return undefined;\n }\n\n const areAllPhotos = renderingAttachments.every((a) => a.mimeType.startsWith('image/'));\n const areAllVideos = renderingAttachments.every((a) => a.mimeType.startsWith('video/'));\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 {\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 './helpers/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 { 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 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];\n}\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 useShowTransition from '../../../hooks/useShowTransition';\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 } = useShowTransition(shouldRender, undefined, undefined, 'slow');\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 // 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 && 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 useShowTransition from '../../../hooks/useShowTransition';\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 } = useShowTransition(shouldRender, undefined, undefined, 'slow');\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 { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\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 { 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 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 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\ntype DispatchProps = Pick;\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 className,\n loadAndPlay,\n canSendStickers,\n recentStickers,\n favoriteStickers,\n addedSetIds,\n stickerSetsById,\n shouldPlay,\n onStickerSelect,\n loadStickerSets,\n loadRecentStickers,\n loadFavoriteStickers,\n loadAddedStickers,\n addRecentSticker,\n unfaveSticker,\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\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 && set.stickers.length).length === 0\n ), [allSets, areAddedLoaded]);\n\n useEffect(() => {\n if (loadAndPlay) {\n loadStickerSets();\n loadRecentStickers();\n loadFavoriteStickers();\n }\n }, [loadAndPlay, loadFavoriteStickers, loadRecentStickers, loadStickerSets]);\n\n useEffect(() => {\n if (addedSetIds && addedSetIds.length) {\n loadAddedStickers();\n }\n }, [addedSetIds, loadAddedStickers]);\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 canRenderContents = useAsyncRendering([], SLIDE_TRANSITION_DURATION);\n\n function renderCover(stickerSet: StickerSetOrRecent, index: number) {\n const firstSticker = stickerSet.stickers && 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.isAnimated ? (\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
Sending stickers is not allowed in this chat.
\n ) : noPopulatedSets ? (\n
You have no saved Stickers.
\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 (setGlobal, actions): DispatchProps => pick(actions, [\n 'loadStickerSets',\n 'loadRecentStickers',\n 'loadFavoriteStickers',\n 'loadAddedStickers',\n 'addRecentSticker',\n 'unfaveSticker',\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 useTransitionForMedia from '../../hooks/useTransitionForMedia';\nimport useVideoCleanup from '../../hooks/useVideoCleanup';\nimport useBuffering from '../../hooks/useBuffering';\nimport useCanvasBlur from '../../hooks/useCanvasBlur';\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 = gif.thumbnail && !!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 && gif.thumbnail.dataUri, Boolean(previewBlobUrl));\n const videoData = useMedia(localMediaHash, !loadAndPlay, ApiMediaFormat.BlobUrl);\n const shouldRenderVideo = Boolean(loadAndPlay && videoData);\n const { transitionClassNames } = useTransitionForMedia(hasThumbnail || previewBlobUrl || videoData, 'slow');\n const { isBuffered, bufferingHandlers } = useBuffering(true);\n const shouldRenderSpinner = 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 transitionClassNames,\n localMediaHash,\n className,\n );\n\n return (\n \n {hasThumbnail && (\n \n )}\n {!hasThumbnail && previewBlobUrl && (\n \n )}\n {(shouldRenderVideo || previewBlobUrl) && (\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 { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\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 { pick } from '../../../util/iteratees';\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\ntype DispatchProps = Pick;\n\nconst INTERSECTION_DEBOUNCE = 300;\n\nconst GifPicker: FC = ({\n className,\n loadAndPlay,\n canSendGifs,\n savedGifs,\n onGifSelect,\n loadSavedGifs,\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 (setGlobal, actions): DispatchProps => pick(actions, ['loadSavedGifs']),\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 { IAllowedAttachmentOptions } from '../../../modules/helpers';\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 isOpen: boolean;\n allowedAttachmentOptions: IAllowedAttachmentOptions;\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 isOpen, allowedAttachmentOptions, isLeftColumnShown,\n onLoad, onClose,\n onEmojiSelect, onStickerSelect, onGifSelect,\n onRemoveSymbol, onSearchOpen, 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 const { canSendStickers, canSendGifs } = allowedAttachmentOptions;\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_FOR_QUICK_UPLOAD } from '../../../config';\nimport { IS_TOUCH_ENV } from '../../../util/environment';\nimport { openSystemFilesDialog } from '../../../util/systemFilesDialog';\nimport { IAllowedAttachmentOptions } from '../../../modules/helpers';\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 allowedAttachmentOptions: IAllowedAttachmentOptions;\n onFileSelect: (files: File[], isQuick: boolean) => void;\n onPollCreate: () => void;\n onClose: () => void;\n};\n\nconst AttachMenu: FC = ({\n isOpen, allowedAttachmentOptions, 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_FOR_QUICK_UPLOAD).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 const { canAttachMedia, canAttachPolls } = allowedAttachmentOptions;\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, {\n FC, memo, useEffect, useRef,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiSticker } from '../../../api/types';\nimport { GlobalActions } from '../../../global/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 { pick } from '../../../util/iteratees';\nimport { useIntersectionObserver } from '../../../hooks/useIntersectionObserver';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport usePrevious from '../../../hooks/usePrevious';\n\nimport Loading from '../../ui/Loading';\nimport StickerButton from '../../common/StickerButton';\n\nimport './StickerTooltip.scss';\n\nexport type OwnProps = {\n isOpen: boolean;\n onStickerSelect: (sticker: ApiSticker) => void;\n};\n\ntype StateProps = {\n stickers?: ApiSticker[];\n};\n\ntype DispatchProps = Pick;\n\nconst INTERSECTION_THROTTLE = 200;\n\nconst StickerTooltip: FC = ({\n isOpen,\n onStickerSelect,\n stickers,\n clearStickersForEmoji,\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\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 handleMouseLeave = () => {\n document.body.classList.remove('no-select');\n };\n\n const className = buildClassName(\n 'StickerTooltip composer-tooltip custom-scroll',\n transitionClassNames,\n !(displayedStickers && 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 (setGlobal, actions): DispatchProps => pick(actions, ['clearStickersForEmoji']),\n)(StickerTooltip));\n","import React, { FC, memo } from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { ApiMessage } from '../../../api/types';\n\nimport { IS_TOUCH_ENV } from '../../../util/environment';\nimport { pick } from '../../../util/iteratees';\nimport { selectChatMessage, selectCurrentMessageList } from '../../../modules/selectors';\nimport useMouseInside from '../../../hooks/useMouseInside';\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\ntype DispatchProps = Pick;\n\nconst BotKeyboardMenu: FC = ({\n isOpen, message, onClose, clickInlineButton,\n}) => {\n const [handleMouseEnter, handleMouseLeave] = useMouseInside(isOpen, onClose);\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 (setGlobal, actions): DispatchProps => pick(actions, [\n 'clickInlineButton',\n ]),\n)(BotKeyboardMenu));\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, useState,\n} from '../../../lib/teact/teact';\n\nimport { IS_TOUCH_ENV } from '../../../util/environment';\nimport buildClassName from '../../../util/buildClassName';\nimport cycleRestrict from '../../../util/cycleRestrict';\nimport captureKeyboardListeners from '../../../util/captureKeyboardListeners';\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';\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;\nconst NO_EMOJI_SELECTED_INDEX = -1;\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 [selectedIndex, setSelectedIndex] = useState(NO_EMOJI_SELECTED_INDEX);\n\n useEffect(() => {\n setSelectedIndex(0);\n }, [emojis]);\n\n useEffect(() => {\n setItemVisible(selectedIndex, containerRef);\n }, [selectedIndex]);\n\n const getSelectedIndex = useCallback((newIndex: number) => {\n if (!emojis.length) {\n return NO_EMOJI_SELECTED_INDEX;\n }\n\n const emojisCount = emojis.length;\n return cycleRestrict(emojisCount, newIndex);\n }, [emojis]);\n\n const handleArrowKey = useCallback((value: number, e: KeyboardEvent) => {\n e.preventDefault();\n setSelectedIndex((index) => (getSelectedIndex(index + value)));\n }, [setSelectedIndex, getSelectedIndex]);\n\n const handleSelectEmoji = useCallback((e: KeyboardEvent) => {\n if (emojis.length && selectedIndex > NO_EMOJI_SELECTED_INDEX) {\n const emoji = emojis[selectedIndex];\n if (emoji) {\n e.preventDefault();\n onEmojiSelect(emoji.native);\n addRecentEmoji({ emoji: emoji.id });\n }\n }\n }, [addRecentEmoji, emojis, onEmojiSelect, selectedIndex]);\n\n const handleClick = useCallback((native: string, id: string) => {\n onEmojiSelect(native);\n addRecentEmoji({ emoji: id });\n }, [addRecentEmoji, onEmojiSelect]);\n\n useEffect(() => (isOpen ? captureKeyboardListeners({\n onEsc: onClose,\n onLeft: (e: KeyboardEvent) => handleArrowKey(-1, e),\n onRight: (e: KeyboardEvent) => handleArrowKey(1, e),\n onEnter: handleSelectEmoji,\n }) : undefined), [handleArrowKey, handleSelectEmoji, isOpen, onClose]);\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';\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 useMedia from '../../../../hooks/useMedia';\nimport useTransitionForMedia from '../../../../hooks/useTransitionForMedia';\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 {\n shouldRenderThumb, shouldRenderFullMedia, transitionClassNames,\n } = useTransitionForMedia(mediaBlobUrl, 'slow');\n\n const handleClick = useCallback(() => {\n onClick(inlineResult);\n }, [inlineResult, onClick]);\n\n if (isForGallery) {\n return (\n
\n {shouldRenderThumb && (\n \"\"\n )}\n {shouldRenderFullMedia && (\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, useState,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { ApiBotInlineMediaResult, ApiBotInlineResult, ApiBotInlineSwitchPm } from '../../../api/types';\nimport { IAllowedAttachmentOptions } from '../../../modules/helpers';\nimport { LoadMoreDirection } from '../../../types';\n\nimport { IS_TOUCH_ENV } from '../../../util/environment';\nimport setTooltipItemVisible from '../../../util/setTooltipItemVisible';\nimport buildClassName from '../../../util/buildClassName';\nimport captureKeyboardListeners from '../../../util/captureKeyboardListeners';\nimport cycleRestrict from '../../../util/cycleRestrict';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport { throttle } from '../../../util/schedulers';\nimport { pick } from '../../../util/iteratees';\nimport { useIntersectionObserver } from '../../../hooks/useIntersectionObserver';\nimport usePrevious from '../../../hooks/usePrevious';\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';\n\nconst INTERSECTION_DEBOUNCE_MS = 200;\nconst runThrottled = throttle((cb) => cb(), 500, true);\n\nexport type OwnProps = {\n isOpen: boolean;\n botId?: number;\n isGallery?: boolean;\n allowedAttachmentOptions: IAllowedAttachmentOptions;\n inlineBotResults?: (ApiBotInlineResult | ApiBotInlineMediaResult)[];\n switchPm?: ApiBotInlineSwitchPm;\n onSelectResult: (inlineResult: ApiBotInlineMediaResult | ApiBotInlineResult) => void;\n loadMore: NoneToVoidFunction;\n onClose: NoneToVoidFunction;\n};\n\ntype DispatchProps = Pick;\n\nconst InlineBotTooltip: FC = ({\n isOpen,\n botId,\n isGallery,\n inlineBotResults,\n switchPm,\n loadMore,\n onClose,\n openChat,\n sendBotCommand,\n onSelectResult,\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 [selectedIndex, setSelectedIndex] = useState(-1);\n const {\n observe: observeIntersection,\n } = useIntersectionObserver({\n rootRef: containerRef,\n debounceMs: INTERSECTION_DEBOUNCE_MS,\n isDisabled: !isOpen,\n });\n\n useEffect(() => {\n setSelectedIndex(isGallery ? -1 : 0);\n }, [inlineBotResults, isGallery]);\n\n useEffect(() => {\n setTooltipItemVisible('.chat-item-clickable', selectedIndex, containerRef);\n }, [selectedIndex]);\n\n const getSelectedIndex = useCallback((newIndex: number) => {\n if (!inlineBotResults || !inlineBotResults.length) {\n return -1;\n }\n\n return cycleRestrict(inlineBotResults.length, newIndex);\n }, [inlineBotResults]);\n\n const handleArrowKey = useCallback((value: number, e: KeyboardEvent) => {\n if (isGallery) {\n return;\n }\n\n e.preventDefault();\n setSelectedIndex((index) => (getSelectedIndex(index + value)));\n }, [isGallery, getSelectedIndex]);\n\n const handleSelectInlineBotResult = useCallback((e: KeyboardEvent) => {\n if (inlineBotResults && inlineBotResults.length && selectedIndex > -1) {\n const inlineResult = inlineBotResults[selectedIndex];\n if (inlineResult) {\n e.preventDefault();\n onSelectResult(inlineResult);\n }\n }\n }, [inlineBotResults, onSelectResult, selectedIndex]);\n\n const handleLoadMore = useCallback(({ direction }: { direction: LoadMoreDirection }) => {\n if (direction === LoadMoreDirection.Backwards) {\n runThrottled(loadMore);\n }\n }, [loadMore]);\n\n\n useEffect(() => (isOpen ? captureKeyboardListeners({\n onEsc: onClose,\n onUp: (e: KeyboardEvent) => handleArrowKey(-1, e),\n onDown: (e: KeyboardEvent) => handleArrowKey(1, e),\n onEnter: handleSelectInlineBotResult,\n }) : undefined), [handleArrowKey, handleSelectInlineBotResult, isGallery, isOpen, onClose]);\n\n const handleSendPm = useCallback(() => {\n openChat({ id: botId });\n sendBotCommand({ chatId: botId, command: `/start ${switchPm!.startParam}` });\n }, [botId, openChat, sendBotCommand, switchPm]);\n\n\n const prevInlineBotResults = usePrevious(\n inlineBotResults && inlineBotResults.length\n ? inlineBotResults\n : undefined,\n shouldRender,\n );\n const renderedInlineBotResults = inlineBotResults && !inlineBotResults.length\n ? prevInlineBotResults\n : inlineBotResults;\n\n if (!shouldRender || !renderedInlineBotResults || (!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 '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 {renderContent()}\n \n );\n};\n\nexport default memo(withGlobal(\n undefined,\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'sendBotCommand', 'openChat', 'sendInlineBotResult',\n ]),\n)(InlineBotTooltip));\n","import React, {\n FC, useMemo, memo, useRef,\n} from '../../lib/teact/teact';\nimport { getGlobal, withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiMessage, ApiUser, ApiChat } from '../../api/types';\nimport { GlobalActions } from '../../global/types';\n\nimport {\n selectUser,\n selectChatMessages,\n selectChat,\n selectCurrentTextSearch,\n} from '../../modules/selectors';\nimport {\n getMessageSummaryText,\n getChatTitle,\n getUserFullName,\n isChatChannel,\n} from '../../modules/helpers';\nimport renderText from '../common/helpers/renderText';\nimport useLang from '../../hooks/useLang';\nimport { orderBy, pick } from '../../util/iteratees';\nimport { MEMO_EMPTY_ARRAY } from '../../util/memo';\nimport useKeyboardListNavigation from '../../hooks/useKeyboardListNavigation';\nimport useHistoryBack from '../../hooks/useHistoryBack';\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: number;\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\ntype DispatchProps = Pick;\n\ninterface Result {\n message: ApiMessage;\n senderUser?: ApiUser;\n senderChat?: ApiChat;\n onClick: NoneToVoidFunction;\n}\n\nconst RightSearch: FC = ({\n chatId,\n threadId,\n onClose,\n isActive,\n chat,\n messagesById,\n query,\n totalCount,\n foundIds,\n searchTextMessagesLocal,\n focusMessage,\n}) => {\n const lang = useLang();\n\n const foundResults = useMemo(() => {\n if (!query || !foundIds || !foundIds.length || !messagesById) {\n return MEMO_EMPTY_ARRAY;\n }\n\n const results = foundIds.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) as Result[];\n\n return orderBy(results, ({ message }) => message.date, 'desc');\n }, [chatId, threadId, focusMessage, foundIds, chat, messagesById, query]);\n\n const renderSearchResult = ({\n message, senderUser, senderChat, onClick,\n }: Result) => {\n const title = senderChat ? getChatTitle(lang, senderChat) : getUserFullName(senderUser);\n const text = getMessageSummaryText(lang, message);\n\n return (\n \n \n
\n
\n

{title && renderText(title)}

\n \n
\n
\n {renderText(text, ['emoji', 'highlight'], { highlight: query })}\n
\n
\n \n );\n };\n\n useHistoryBack(isActive, onClose);\n\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n const handleKeyDown = useKeyboardListNavigation(containerRef, true, (index) => {\n const foundResult = foundResults && foundResults[index === -1 ? 0 : index];\n if (foundResult) {\n foundResult.onClick();\n }\n }, '.ListItem-button', true);\n\n return (\n \n

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

\n {foundResults.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 (global, actions): DispatchProps => pick(actions, ['searchTextMessagesLocal', 'focusMessage']),\n)(RightSearch));\n","import React, {\n FC, useEffect, memo, useMemo, useCallback,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiStickerSet } from '../../api/types';\nimport { GlobalActions } from '../../global/types';\nimport { ObserveFn } from '../../hooks/useIntersectionObserver';\n\nimport { STICKER_SIZE_SEARCH } from '../../config';\nimport { pick } from '../../util/iteratees';\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\ntype DispatchProps = Pick;\n\nconst STICKERS_TO_DISPLAY = 5;\n\nconst StickerSetResult: FC = ({\n stickerSetId, observeIntersection, set, shouldPlay,\n loadStickers, toggleStickerSet, isSomeModalOpen, onModalToggle,\n}) => {\n const lang = useLang();\n const isAdded = set && Boolean(set.installedDate);\n const areStickersLoaded = Boolean(set && 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 (setGlobal, actions): DispatchProps => pick(actions, ['loadStickers', 'toggleStickerSet']),\n)(StickerSetResult));\n","import React, {\n FC, memo, useEffect, useRef, useState,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\n\nimport { pick } from '../../util/iteratees';\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\ntype DispatchProps = Pick;\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 loadFeaturedStickers,\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 (setGlobal, actions): DispatchProps => pick(actions, ['loadFeaturedStickers']),\n)(StickerSearch));\n","import React, {\n FC, memo, useRef, useCallback,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\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 { pick } from '../../util/iteratees';\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\ntype DispatchProps = Pick;\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 searchMoreGifs,\n sendMessage,\n setGifSearchQuery,\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 (setGlobal, actions): DispatchProps => pick(actions, ['searchMoreGifs', 'sendMessage', 'setGifSearchQuery']),\n)(GifSearch));\n","import React, {\n FC, useCallback, useState, memo, useEffect,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport {\n ApiChat,\n ApiMessage,\n ApiPollAnswer,\n ApiPollResult,\n} from '../../api/types';\nimport { GlobalActions } from '../../global/types';\nimport { pick } from '../../util/iteratees';\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?: number[];\n offset: string;\n};\n\ntype DispatchProps = Pick;\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 loadPollOptionResults,\n openChat,\n closePollResults,\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: number) => {\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 && voters[answer.option],\n offset: (offsets && offsets[answer.option]) || '',\n };\n },\n (global, actions): DispatchProps => pick(actions, ['loadPollOptionResults', 'openChat', 'closePollResults']),\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 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

{summary.question}

\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 { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { ApiChat, ApiUser } from '../../../api/types';\nimport { ManagementProgress } from '../../../types';\n\nimport { pick } from '../../../util/iteratees';\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: number;\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n user?: ApiUser;\n chat: ApiChat;\n progress?: ManagementProgress;\n isMuted?: boolean;\n};\n\ntype DispatchProps = Pick;\n\nconst ERROR_FIRST_NAME_MISSING = 'Please provide first name';\n\nconst ManageUser: FC = ({\n userId,\n user,\n chat,\n progress,\n isMuted,\n updateContact,\n deleteUser,\n deleteHistory,\n closeManagement,\n openChat,\n onClose,\n isActive,\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 deleteHistory({\n chatId: chat.id,\n shouldDeleteForAll: false,\n });\n deleteUser({ userId });\n closeDeleteDialog();\n closeManagement();\n openChat({ id: undefined });\n }, [chat.id, closeDeleteDialog, closeManagement, deleteHistory, deleteUser, openChat, 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, chat, progress, isMuted,\n };\n },\n (global, actions): DispatchProps => pick(actions, [\n 'updateContact', 'deleteUser', 'closeManagement', 'openChat', 'deleteHistory',\n ]),\n)(ManageUser));\n","import { ChangeEvent } from 'react';\nimport React, {\n FC, memo, useCallback, useEffect, useMemo, useState,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { ManagementScreens, ManagementProgress } from '../../../types';\nimport { ApiChat, ApiChatBannedRights, ApiMediaFormat } from '../../../api/types';\nimport { GlobalActions } from '../../../global/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 { pick } from '../../../util/iteratees';\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: number;\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};\n\ntype DispatchProps = Pick;\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 onScreenSelect,\n togglePreHistoryHidden,\n updateChat,\n deleteChat,\n leaveChannel,\n deleteChannel,\n closeManagement,\n openChat,\n onClose,\n isActive,\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 lang = useLang();\n\n useHistoryBack(isActive, onClose);\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 handleClickPermissions = useCallback(() => {\n onScreenSelect(ManagementScreens.GroupPermissions);\n }, [onScreenSelect]);\n\n const handleClickAdministrators = useCallback(() => {\n onScreenSelect(ManagementScreens.ChatAdministrators);\n }, [onScreenSelect]);\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 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 && chat.fullInfo.adminMembers && 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 {lang('ChannelAdministrators')}\n {formatInteger(adminsCount)}\n \n
\n
\n \n {lang('GroupMembers')}\n {formatInteger(chat.membersCount!)}\n \n\n {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 && chat.fullInfo.linkedChatId);\n const isBasicGroup = isChatBasicGroup(chat);\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 };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'togglePreHistoryHidden', 'updateChat', 'closeManagement',\n 'leaveChannel', 'deleteChannel', 'deleteChat', 'openChat',\n ]),\n)(ManageGroup));\n","import React, {\n FC, memo, useCallback, useEffect, useMemo, useState,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { ManagementScreens } from '../../../types';\nimport { ApiChat, ApiChatBannedRights, ApiChatMember } from '../../../api/types';\nimport { GlobalActions } from '../../../global/types';\n\nimport useLang from '../../../hooks/useLang';\nimport { selectChat } from '../../../modules/selectors';\nimport { pick } from '../../../util/iteratees';\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: number;\n onScreenSelect: (screen: ManagementScreens) => void;\n onChatMemberSelect: (memberId: number, isPromotedByCurrentUser?: boolean) => void;\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n chat?: ApiChat;\n currentUserId?: number;\n};\n\ntype DispatchProps = Pick;\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 updateChatDefaultBannedRights,\n onClose,\n isActive,\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 && 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 }) => !!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 && 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 (setGlobal, actions): DispatchProps => pick(actions, ['updateChatDefaultBannedRights']),\n)(ManageGroupPermissions));\n","import React, {\n FC, memo, useCallback, useMemo,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiChat, ApiChatMember, ApiUser } from '../../../api/types';\nimport { GlobalActions } from '../../../global/types';\n\nimport { selectChat } from '../../../modules/selectors';\nimport { getUserFullName } from '../../../modules/helpers';\nimport { pick } from '../../../util/iteratees';\nimport useLang from '../../../hooks/useLang';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport PrivateChatInfo from '../../common/PrivateChatInfo';\nimport ListItem from '../../ui/ListItem';\n\ntype OwnProps = {\n chatId: number;\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n chat?: ApiChat;\n usersById: Record;\n};\n\ntype DispatchProps = Pick;\n\nconst ManageGroupRemovedUsers: FC = ({\n chat,\n usersById,\n updateChatMemberBannedRights,\n onClose,\n isActive,\n}) => {\n const lang = useLang();\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('NoBlockedGroup2')}

\n\n {removedMembers.map((member) => (\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 } = global.users;\n\n return { chat, usersById };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['updateChatMemberBannedRights']),\n)(ManageGroupRemovedUsers));\n","import { ChangeEvent } from 'react';\nimport React, {\n FC, memo, useCallback, useEffect, useState,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { ManagementScreens, ManagementProgress } from '../../../types';\nimport { ApiChat, ApiMediaFormat } from '../../../api/types';\n\nimport { pick } from '../../../util/iteratees';\nimport { getChatAvatarHash, getHasAdminRight } from '../../../modules/helpers';\nimport useMedia from '../../../hooks/useMedia';\nimport useLang from '../../../hooks/useLang';\nimport { selectChat } from '../../../modules/selectors';\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';\nimport useFlag from '../../../hooks/useFlag';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport './Management.scss';\n\ntype OwnProps = {\n chatId: number;\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};\n\ntype DispatchProps = Pick;\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 onScreenSelect,\n updateChat,\n toggleSignatures,\n closeManagement,\n leaveChannel,\n deleteChannel,\n openChat,\n onClose,\n isActive,\n}) => {\n const currentTitle = chat ? (chat.title || '') : '';\n const currentAbout = chat && chat.fullInfo ? (chat.fullInfo.about || '') : '';\n const hasLinkedChat = chat && chat.fullInfo && 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 (progress === ManagementProgress.Complete) {\n setIsProfileFieldsTouched(false);\n setError(undefined);\n }\n }, [progress]);\n\n const adminsCount = (chat && chat.fullInfo && chat.fullInfo.adminMembers && chat.fullInfo.adminMembers.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 handleClickAdministrators = useCallback(() => {\n onScreenSelect(ManagementScreens.ChatAdministrators);\n }, [onScreenSelect]);\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\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 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 \n {lang('ChannelAdministrators')}\n {adminsCount}\n \n
\n \n
\n
\n
\n \n {lang('ChannelSubscribers')}\n {lang('Subscribers', chat.membersCount!, 'i')}\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 && chat.isSignaturesShown);\n\n return {\n chat,\n progress,\n isSignaturesShown,\n canChangeInfo: getHasAdminRight(chat, 'changeInfo'),\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'toggleSignatures', 'updateChat', 'closeManagement', 'leaveChannel', 'deleteChannel', 'openChat',\n ]),\n)(ManageChannel));\n","import React, {\n FC, memo, useCallback, useEffect, useState,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { ApiChat } from '../../../api/types';\nimport { ManagementProgress } from '../../../types';\n\nimport { selectChat, selectManagement } from '../../../modules/selectors';\nimport { pick } from '../../../util/iteratees';\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: number;\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n chat: ApiChat;\n isChannel: boolean;\n progress?: ManagementProgress;\n isUsernameAvailable?: boolean;\n};\n\ntype DispatchProps = Pick;\n\nconst ManageChatPrivacyType: FC = ({\n chat,\n onClose,\n isActive,\n isChannel,\n progress,\n isUsernameAvailable,\n checkPublicLink,\n updatePublicLink,\n updatePrivateLink,\n}) => {\n const isPublic = Boolean(chat.username);\n const privateLink = chat.fullInfo && 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 = (\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 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 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 {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 };\n },\n (setGlobal, actions) => pick(actions, [\n 'checkPublicLink', 'updatePublicLink', 'updatePrivateLink',\n ]),\n)(ManageChatPrivacyType));\n","import React, {\n FC, memo, useCallback, useEffect, useState,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { ApiChat } from '../../../api/types';\nimport { ManagementScreens } from '../../../types';\n\nimport { STICKER_SIZE_DISCUSSION_GROUPS } from '../../../config';\nimport { selectChat } from '../../../modules/selectors';\nimport { pick } from '../../../util/iteratees';\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: number;\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?: number[];\n isChannel?: boolean;\n};\n\ntype DispatchProps = Pick;\n\nconst ManageDiscussion: FC = ({\n chat,\n onClose,\n isActive,\n chatId,\n chatsByIds,\n linkedChat,\n forDiscussionIds,\n isChannel,\n onScreenSelect,\n loadGroupsForDiscussion,\n linkDiscussionGroup,\n unlinkDiscussionGroup,\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 && 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: number) => {\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 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 { onDiscussionClick(id); }}\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 && chat.fullInfo && 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 (setGlobal, actions): DispatchProps => pick(actions, [\n 'loadGroupsForDiscussion', 'linkDiscussionGroup', 'unlinkDiscussionGroup',\n ]),\n)(ManageDiscussion));\n","import React, {\n FC, memo, useCallback, useEffect, useMemo, useState,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiChat, ApiChatBannedRights } from '../../../api/types';\nimport { ManagementScreens } from '../../../types';\nimport { GlobalActions } from '../../../global/types';\n\nimport { pick } from '../../../util/iteratees';\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: number;\n selectedChatMemberId?: number;\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\ntype DispatchProps = Pick;\n\nconst ManageGroupUserPermissions: FC = ({\n chat,\n selectedChatMemberId,\n onScreenSelect,\n updateChatMemberBannedRights,\n isFormFullyDisabled,\n onClose,\n isActive,\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 && chat.fullInfo && selectedChatMemberId && !selectedChatMember) {\n onScreenSelect(ManagementScreens.GroupPermissions);\n }\n }, [chat, onScreenSelect, selectedChatMember, selectedChatMemberId]);\n\n useEffect(() => {\n setPermissions((selectedChatMember && selectedChatMember.bannedRights) || (chat && 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\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 (setGlobal, actions): DispatchProps => pick(actions, ['updateChatMemberBannedRights']),\n)(ManageGroupUserPermissions));\n","import React, {\n FC, memo, useCallback, useMemo,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { ManagementScreens } from '../../../types';\nimport { ApiChat, ApiChatMember, ApiUser } 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';\n\ntype OwnProps = {\n chatId: number;\n onScreenSelect: (screen: ManagementScreens) => void;\n onChatMemberSelect: (memberId: number, isPromotedByCurrentUser?: boolean) => void;\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n chat: ApiChat;\n currentUserId?: number;\n isChannel: boolean;\n usersById: Record;\n};\n\nconst ManageChatAdministrators: FC = ({\n chat,\n isChannel,\n currentUserId,\n usersById,\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 getMemberStatus = useCallback((member: ApiChatMember) => {\n if (member.isOwner) {\n return lang('ChannelCreator');\n }\n\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, usersById]);\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\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const chat = selectChat(global, chatId)!;\n const { byId: usersById } = global.users;\n\n return {\n chat,\n currentUserId: global.currentUserId,\n isChannel: isChatChannel(chat),\n usersById,\n };\n },\n // (setGlobal, actions): DispatchProps => pick(actions, ['togglePreHistoryHidden', 'updateChat']),\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: number;\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 { withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiChat, ApiChatAdminRights, ApiUser } from '../../../api/types';\nimport { ManagementScreens } from '../../../types';\nimport { GlobalActions } from '../../../global/types';\n\nimport { pick } from '../../../util/iteratees';\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: number;\n selectedChatMemberId?: number;\n isPromotedByCurrentUser?: boolean;\n onScreenSelect: (screen: ManagementScreens) => void;\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n chat: ApiChat;\n usersById: Record;\n currentUserId?: number;\n isChannel: boolean;\n isFormFullyDisabled: boolean;\n};\n\ntype DispatchProps = Pick;\n\nconst CUSTOM_TITLE_MAX_LENGTH = 16;\n\nconst ManageGroupAdminRights: FC = ({\n selectedChatMemberId,\n onScreenSelect,\n chat,\n usersById,\n currentUserId,\n isChannel,\n isFormFullyDisabled,\n updateChatAdmin,\n onClose,\n isActive,\n}) => {\n const [permissions, setPermissions] = useState({});\n const [isTouched, setIsTouched] = useState(false);\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 if (!chat.fullInfo || !chat.fullInfo.adminMembers) {\n return undefined;\n }\n\n return chat.fullInfo.adminMembers.find(({ userId }) => userId === selectedChatMemberId);\n }, [chat, selectedChatMemberId]);\n\n useEffect(() => {\n if (chat && chat.fullInfo && selectedChatMemberId && !selectedChatMember) {\n onScreenSelect(ManagementScreens.ChatAdministrators);\n }\n }, [chat, onScreenSelect, selectedChatMember, selectedChatMemberId]);\n\n useEffect(() => {\n setPermissions((selectedChatMember && selectedChatMember.adminRights) || {});\n setCustomTitle(((selectedChatMember && selectedChatMember.customTitle) || '').substr(0, CUSTOM_TITLE_MAX_LENGTH));\n setIsTouched(false);\n setIsLoading(false);\n }, [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 (!selectedChatMemberId) {\n return;\n }\n\n setIsLoading(true);\n updateChatAdmin({\n chatId: chat.id,\n userId: selectedChatMemberId,\n adminRights: permissions,\n customTitle,\n });\n }, [chat, selectedChatMemberId, permissions, customTitle, updateChatAdmin]);\n\n const handleDismissAdmin = useCallback(() => {\n if (!selectedChatMemberId) {\n return;\n }\n\n updateChatAdmin({\n chatId: chat.id,\n userId: selectedChatMemberId,\n adminRights: {},\n });\n closeDismissConfirmationDialog();\n }, [chat.id, closeDismissConfirmationDialog, selectedChatMemberId, 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 (!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 }, [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 {!isChannel && (\n
\n \n
\n )}\n\n {isFormFullyDisabled && (\n

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

\n )}\n\n {!isChannel && (\n \n )}\n\n {currentUserId !== selectedChatMemberId && !isFormFullyDisabled && (\n \n {lang('EditAdminRemoveAdmin')}\n \n )}\n
\n
\n\n \n {isLoading ? (\n \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 { 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 };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['updateChatAdmin']),\n)(ManageGroupAdminRights));\n","import React, {\n FC, memo, useCallback, useMemo,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiChatMember, ApiUser } from '../../../api/types';\nimport { GlobalActions } from '../../../global/types';\nimport { selectChat } from '../../../modules/selectors';\nimport { sortUserIds, isChatChannel } from '../../../modules/helpers';\nimport { pick } from '../../../util/iteratees';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport PrivateChatInfo from '../../common/PrivateChatInfo';\nimport NothingFound from '../../common/NothingFound';\nimport ListItem from '../../ui/ListItem';\n\ntype OwnProps = {\n chatId: number;\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n usersById: Record;\n members?: ApiChatMember[];\n isChannel?: boolean;\n serverTimeOffset: number;\n};\n\ntype DispatchProps = Pick;\n\nconst ManageGroupMembers: FC = ({\n members,\n usersById,\n isChannel,\n openUserInfo,\n onClose,\n isActive,\n serverTimeOffset,\n}) => {\n const memberIds = useMemo(() => {\n if (!members || !usersById) {\n return undefined;\n }\n\n return sortUserIds(members.map(({ userId }) => userId), usersById, undefined, serverTimeOffset);\n }, [members, serverTimeOffset, usersById]);\n\n const handleMemberClick = useCallback((id: number) => {\n openUserInfo({ id });\n }, [openUserInfo]);\n\n useHistoryBack(isActive, onClose);\n\n return (\n
\n
\n
\n {memberIds ? (\n memberIds.map((id, i) => (\n handleMemberClick(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 } = global.users;\n const members = chat && chat.fullInfo && chat.fullInfo.members;\n const isChannel = chat && isChatChannel(chat);\n\n return {\n members,\n usersById,\n isChannel,\n serverTimeOffset: global.serverTimeOffset,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'openUserInfo',\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 } 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: number;\n onScreenSelect: (screen: ManagementScreens) => void;\n onChatMemberSelect: (memberId: number) => void;\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n usersById: Record;\n members?: ApiChatMember[];\n isChannel?: boolean;\n serverTimeOffset: number;\n};\n\nconst ManageGroupUserPermissionsCreate: FC = ({\n usersById,\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, undefined, serverTimeOffset,\n );\n }, [members, serverTimeOffset, usersById]);\n\n const handleExceptionMemberClick = useCallback((memberId: number) => {\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\n\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const chat = selectChat(global, chatId);\n const { byId: usersById } = global.users;\n const members = chat && chat.fullInfo && chat.fullInfo.members;\n const isChannel = chat && isChatChannel(chat);\n\n return {\n members,\n usersById,\n isChannel,\n serverTimeOffset: global.serverTimeOffset,\n };\n },\n)(ManageGroupUserPermissionsCreate));\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 ManageGroupRemovedUsers from './ManageGroupRemovedUsers';\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';\n\nexport type OwnProps = {\n chatId: number;\n currentScreen: ManagementScreens;\n selectedChatMemberId?: number;\n isPromotedByCurrentUser?: boolean;\n onScreenSelect: (screen: ManagementScreens) => void;\n onChatMemberSelect: (memberId: number, 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.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.ChatAdminRights:\n return (\n \n );\n\n case ManagementScreens.ChannelSubscribers:\n case ManagementScreens.GroupMembers:\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 CURRENCIES: Record = {\n USD: '$',\n EUR: '€',\n GBP: '£',\n JPY: '¥',\n RUB: '₽',\n UAH: '₴',\n INR: '₹',\n AED: 'د.إ',\n};\n\nexport function getCurrencySign(currency: string | undefined): string {\n if (!currency) {\n return '';\n }\n return CURRENCIES[currency] || '';\n}\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","import useReducer, { StateReducer, Dispatch } from '../useReducer';\nimport { countryList } from '../../util/phoneNumber';\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\nexport default () => {\n return useReducer(reducer, INITIAL_STATE);\n};\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\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: any;\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/phoneNumber';\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/index';\n\nimport { FormState, FormEditDispatch } from '../../hooks/reducers/usePaymentReducer';\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 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: `${currency} ${String(amount / 100)}`,\n value,\n }))), [shippingOptions, currency]);\n\n return (\n
\n
\n

Select shipping method

\n \n \n
\n );\n};\n\nexport default memo(Shipping);\n","import React, {\n FC, memo,\n} from '../../lib/teact/teact';\n\nimport { Price } from '../../types';\n\nimport './Checkout.scss';\n\nexport type OwnProps = {\n invoiceContent?: {\n title?: string;\n description?: 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 // eslint-disable-next-line no-null/no-null\n const { photoUrl, title, text } = (invoiceContent || {});\n const {\n paymentMethod,\n paymentProvider,\n shippingAddress,\n name,\n phone,\n shippingMethod,\n } = (checkoutInfo || {});\n return (\n
\n
\n { photoUrl && (\n \"\"\n )}\n
\n
{ title }
\n

{ text }

\n
\n
\n
\n { prices && prices.map((item) => (\n renderPaymentItem(item.label, item.amount, currency, false)\n )) }\n { shippingPrices && shippingPrices.map((item) => (\n renderPaymentItem(item.label, item.amount, currency, false)\n )) }\n { totalPrice !== undefined && (\n renderPaymentItem('Total', totalPrice, currency, true)\n ) }\n
\n
\n {paymentMethod && renderCheckoutItem('icon-card', paymentMethod, 'Payment method')}\n {paymentProvider && renderCheckoutItem('stripe-provider', paymentProvider, 'Payment provider')}\n {shippingAddress && renderCheckoutItem('icon-location', shippingAddress, 'Shipping address')}\n {name && renderCheckoutItem('icon-user', name, 'Name')}\n {phone && renderCheckoutItem('icon-phone', phone, 'Phone number')}\n {shippingMethod && renderCheckoutItem('icon-truck', shippingMethod, 'Shipping method')}\n
\n
\n );\n};\n\nfunction renderPaymentItem(title: string, value: number, currency?: string, main = false) {\n return (\n
\n
\n { title }\n
\n
\n { `${currency || ''} ${(value / 100).toFixed(2)}` }\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';\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 // 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 && parts[0] && Number(parts[0]) > 12) {\n parts[0] = '12';\n }\n if (parts && 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","export default __webpack_public_path__ + \"mastercard.4216118edafe23cc2dec7b8807ba4622.svg\";","export default __webpack_public_path__ + \"visa.e5a7c336e1deb4b92a636e2e053878c4.svg\";","import React, {\n FC, memo, useCallback, useState, useRef, useEffect,\n} from '../../lib/teact/teact';\n\nimport useFocusAfterAnimation from '../../hooks/useFocusAfterAnimation';\nimport { formatCardNumber } from '../middle/helpers/inputFormatters';\nimport { detectCardType, CardType } from '../common/helpers/detectCardType';\n\nimport InputText from '../ui/InputText';\n\nimport './CardInput.scss';\n\n// @ts-ignore\nimport mastercardIconPath from '../../assets/mastercard.svg';\n// @ts-ignore\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 // 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/phoneNumber';\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, {\n FC, memo, useCallback, useEffect, useMemo, useState,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions, GlobalState } from '../../global/types';\nimport { PaymentStep, ShippingOption, Price } from '../../types';\nimport { ApiError, ApiInviteInfo } from '../../api/types';\n\nimport { pick } from '../../util/iteratees';\nimport { getCurrencySign } from '../middle/helpers/getCurrencySign';\nimport { detectCardTypeText } from '../common/helpers/detectCardType';\nimport { getShippingErrors } from '../../modules/helpers/payments';\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';\n\nimport './PaymentModal.scss';\n\nconst DEFAULT_PROVIDER = 'stripe';\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 globalDialogs?: (ApiError | ApiInviteInfo)[];\n};\n\ntype GlobalStateProps = Pick;\n\ntype DispatchProps = 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 error,\n globalDialogs,\n validateRequestedInfo,\n sendPaymentForm,\n setPaymentStep,\n sendCredentialsInfo,\n clearPaymentError,\n}) => {\n const [paymentState, paymentDispatch] = usePaymentReducer();\n const currencySign = getCurrencySign(currency);\n const [isLoading, setIsLoading] = useState(false);\n const lang = useLang();\n\n useEffect(() => {\n if (step || error || globalDialogs) {\n setIsLoading(false);\n }\n }, [step, error, globalDialogs]);\n\n useEffect(() => {\n if (error && error.field) {\n paymentDispatch({\n type: 'setFormErrors',\n payload: {\n [error.field]: error.fieldError,\n },\n });\n return;\n }\n if (globalDialogs && globalDialogs.length) {\n const errors = getShippingErrors(globalDialogs);\n paymentDispatch({\n type: 'setFormErrors',\n payload: {\n ...errors,\n },\n });\n }\n }, [error, globalDialogs, 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(cuurentStep: PaymentStep) {\n switch (cuurentStep) {\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 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 }, [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 default:\n return '';\n }\n }, [step, lang]);\n\n const buttonText = useMemo(() => {\n switch (step) {\n case PaymentStep.Checkout:\n return lang('Checkout.PayPrice', `${currencySign}${(totalPrice / 100).toFixed(2)}`);\n default:\n return lang('Next');\n }\n }, [step, lang, currencySign, 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
\n {renderModalContent(step)}\n
\n )}\n
\n ) : (\n
\n \n
\n )}\n
\n \n {buttonText}\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 } = global.payment;\n\n const isProviderError = Boolean(invoice && (!nativeProvider || nativeProvider !== DEFAULT_PROVIDER));\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 globalDialogs: global.dialogs,\n };\n },\n (setGlobal, actions): DispatchProps => {\n return pick(actions, [\n 'validateRequestedInfo',\n 'sendPaymentForm',\n 'setPaymentStep',\n 'sendCredentialsInfo',\n 'clearPaymentError',\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 ? option.prices : undefined;\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 ? shippingOption.title : undefined;\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/payments';\n\nimport useLang from '../../hooks/useLang';\nimport { getCurrencySign } from '../middle/helpers/getCurrencySign';\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 currencySign = getCurrencySign(currency);\n const checkoutInfo = useMemo(() => {\n return getCheckoutInfo(credentialsTitle, info, shippingMethod);\n }, [info, shippingMethod, credentialsTitle]);\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: mapedPrices,\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: mapedPrices,\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 && 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 { ApiMediaFormat } from '../../../api/types';\n\nimport * as mediaLoader from '../../../util/mediaLoader';\n\n// @ts-ignore\nimport MonkeyIdle from '../../../assets/TwoFactorSetupMonkeyIdle.tgs';\n// @ts-ignore\nimport MonkeyTracking from '../../../assets/TwoFactorSetupMonkeyTracking.tgs';\n// @ts-ignore\nimport MonkeyClose from '../../../assets/TwoFactorSetupMonkeyClose.tgs';\n// @ts-ignore\nimport MonkeyPeek from '../../../assets/TwoFactorSetupMonkeyPeek.tgs';\n// @ts-ignore\nimport FoldersAll from '../../../assets/FoldersAll.tgs';\n// @ts-ignore\nimport FoldersNew from '../../../assets/FoldersNew.tgs';\n// @ts-ignore\nimport DiscussionGroups from '../../../assets/DiscussionGroupsDucks.tgs';\n\nexport const ANIMATED_STICKERS_PATHS = {\n MonkeyIdle,\n MonkeyTracking,\n MonkeyClose,\n MonkeyPeek,\n FoldersAll,\n FoldersNew,\n DiscussionGroups,\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","export default __webpack_public_path__ + \"TwoFactorSetupMonkeyIdle.dea4a492c144df84ddab778dc8a3f0cd.tgs\";","export default __webpack_public_path__ + \"TwoFactorSetupMonkeyTracking.eb5a7a6f166fb7589c12e6248561fb58.tgs\";","export default __webpack_public_path__ + \"TwoFactorSetupMonkeyClose.604c4c833d322b7e6c3ea19bef058241.tgs\";","export default __webpack_public_path__ + \"TwoFactorSetupMonkeyPeek.1905436b042520363d7e59f5d7f903ab.tgs\";","export default __webpack_public_path__ + \"FoldersAll.3f9f9e243d19f0fbf9aaaff11cbd4572.tgs\";","export default __webpack_public_path__ + \"FoldersNew.9a40d71c0c8be70f5bd14ff2d7bc1593.tgs\";","export default __webpack_public_path__ + \"DiscussionGroupsDucks.9ea453d1be9d1b0ee77a992f8e587485.tgs\";","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: 0.8,\n format: 'jpeg',\n circle: false,\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 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 { 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"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/4.7cbc0883ea4cc7908cba.css b/dist/4.2c2e12ad0cb73321f1fb.css similarity index 92% rename from dist/4.7cbc0883ea4cc7908cba.css rename to dist/4.2c2e12ad0cb73321f1fb.css index f49274ba..ace69107 100644 --- a/dist/4.7cbc0883ea4cc7908cba.css +++ b/dist/4.2c2e12ad0cb73321f1fb.css @@ -38,7 +38,7 @@ .CommentButton{--background-color: var(--color-background);--hover-color: var(--color-chat-hover);display:flex;width:100%;align-items:center;padding:.5625rem .25rem .5625rem .625rem;padding-inline-start:.625rem;padding-inline-end:.25rem;background:var(--background-color);border-bottom-right-radius:var(--border-bottom-right-radius);border-bottom-left-radius:var(--border-bottom-left-radius);font-size:.9375rem;font-weight:500;line-height:2rem;color:var(--accent-color);white-space:nowrap;cursor:pointer;transition:background-color .15s, color .15s}body.animation-level-0 .CommentButton{transition:none !important}.Message .has-appendix .CommentButton::before{content:'';display:block;position:absolute;bottom:-.1875rem;left:-.5625rem;width:.5625rem;height:1.25rem;background-position:bottom left;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');opacity:0;transition:opacity .15s, filter .15s}.theme-dark #root .Message .has-appendix .CommentButton::before{filter:invert(0.83)}body.animation-level-0 .Message .has-appendix .CommentButton::before{transition:none !important}.custom-shape .CommentButton{position:absolute;right:-3rem;width:2.25rem;bottom:3rem;height:3.375rem;border-radius:1.375rem;padding:0.375rem .3125rem .25rem;align-items:flex-start;color:white;background-color:rgba(0,0,0,0.2);opacity:0;transition:opacity .2s ease}@media (pointer: coarse){.custom-shape .CommentButton{opacity:1 !important}}.custom-shape .CommentButton:hover{background-color:rgba(0,0,0,0.28)}.Message:hover .custom-shape .CommentButton{opacity:1}.custom-shape .CommentButton::after{content:attr(data-cnt);position:absolute;bottom:-.0625rem;left:0;width:100%;text-align:center;font-size:12px;display:block}.custom-shape .CommentButton[data-cnt="0"]{height:2.25rem}.custom-shape .CommentButton[data-cnt="0"]::after{display:none}.custom-shape .CommentButton .icon-comments-sticker{display:block;font-size:1.5rem;margin:0 auto}.custom-shape .CommentButton .recent-repliers,.custom-shape .CommentButton .icon-comments,.custom-shape .CommentButton .label,.custom-shape .CommentButton .icon-next{display:none}.CommentButton:hover{background:var(--hover-color)}.Message .has-appendix .CommentButton:hover::before{opacity:1}.CommentButton:hover .Avatar{border-color:var(--hover-color) !important}.is-forwarded .CommentButton,.audio .CommentButton,.voice .CommentButton,.poll .CommentButton,.text .CommentButton{border-top:1px solid var(--color-borders)}.message-content.has-solid-background .CommentButton{margin:.375rem -.5rem -.375rem}.message-content.voice .CommentButton{margin-bottom:-.5rem}.message-content.audio .CommentButton{margin-bottom:-.8125rem}.message-content.audio .CommentButton,.message-content.voice .CommentButton,.message-content.poll .CommentButton,.message-content.has-solid-background.text .CommentButton,.message-content.has-solid-background.is-forwarded .CommentButton{width:calc(100% + 1rem)}.CommentButton .icon-comments-sticker{display:none}.CommentButton .icon-comments{font-size:1.5625rem;line-height:2rem;margin-inline-end:.875rem}.CommentButton .icon-next{margin-inline-start:auto;font-size:1.5rem}.CommentButton .recent-repliers{display:inline-flex;align-items:center;margin-inline-end:.5rem;margin-inline-start:-.125rem}.CommentButton .recent-repliers .Avatar{transition:border .15s;border:2px solid var(--color-background);margin-inline-end:0;z-index:3;overflow:hidden}.CommentButton .recent-repliers .Avatar .emoji{width:1rem;background-size:1rem}.CommentButton .recent-repliers .Avatar+.Avatar{z-index:2}.CommentButton .recent-repliers .Avatar+.Avatar+.Avatar{z-index:1}.CommentButton .recent-repliers .Avatar:not(:first-child){margin-inline-start:-.75rem}.CommentButton.has-unread .label{position:relative}.CommentButton.has-unread .label::after{content:'';display:inline-block;width:.5rem;height:.5rem;border-radius:50%;background:var(--accent-color);margin-inline-start:.75rem}.CommentButton.disabled{cursor:default;pointer-events:none} -.Message{display:flex;align-items:flex-end;margin-bottom:0.375rem;position:relative;--background-color: var(--color-background);--hover-color: var(--color-reply-hover);--active-color: var(--color-reply-active);--max-width: 29rem;--accent-color: var(--color-primary);--accent-shade-color: var(--color-primary-shade);--secondary-color: var(--color-text-secondary);--meta-safe-area-base: 2.25rem;--meta-safe-author-width: 0px;--meta-safe-area-extra-width: 0px;--meta-safe-area-size: calc(var(--meta-safe-area-base) + var(--meta-safe-author-width) + var(--meta-safe-area-extra-width));--deleting-translate-x: -50%;--select-message-scale: 0.9;--select-background-color: white}.Message>.Avatar,.Message>.message-content-wrapper{opacity:1;transform:scale(1) translateX(0);transition:transform var(--select-transition)}body.animation-level-0 .Message>.Avatar,body.animation-level-0 .Message>.message-content-wrapper{transition:none !important}.Message>.Avatar{position:absolute;bottom:0;left:0}@media (max-width: 600px){.Message>.Avatar{width:2.5rem;height:2.5rem}}.Message.last-in-group{margin-bottom:0.625rem}.Message.last-in-list{margin-bottom:0.375rem}.Message.is-in-selection-mode .Album{border:1px var(--select-background-color) solid;background-color:var(--select-background-color)}body.is-android .Message.is-in-selection-mode .can-select-text{z-index:var(--z-message-select-control)}body.is-android .Message.is-in-selection-mode .media-inner{pointer-events:none}.Message.has-inline-buttons .message-content{border-bottom-right-radius:var(--border-radius-messages-small)}.Message:not(.own){padding-left:2.5rem}.no-avatars .Message:not(.own),.Message:not(.own).is-thread-top{padding-left:0}@media (max-width: 600px){.Message:not(.own){padding-left:2.875rem}.no-avatars .Message:not(.own),.Message:not(.own).is-thread-top{padding-left:0.25rem}}.Message.own{flex-direction:row-reverse;--background-color: var(--color-background-own);--hover-color: var(--color-reply-own-hover);--active-color: var(--color-reply-own-active);--max-width: 30rem;--accent-color: var(--color-accent-own);--accent-shade-color: var(--color-green);--secondary-color: var(--color-accent-own);--color-code: var(--color-code-own);--color-code-bg: var(--color-code-own-bg);--color-links: var(--color-own-links);--color-links-hover: var(--color-own-links);--meta-safe-area-base: 3.5rem;--deleting-translate-x: 50%;--color-text-green: var(--color-accent-own)}body.is-ios .Message.own,body.is-macos .Message.own{--color-background-own: var(--color-background-own-apple);--color-reply-own-hover: var(--color-reply-own-hover-apple);--color-reply-own-active: var(--color-reply-own-active-apple)}@media (max-width: 600px){.Message.own{padding-right:0.25rem}}.Message.is-deleting>.Avatar,.Message.is-deleting>.message-content-wrapper{transition:opacity .2s ease, transform .2s ease-in;opacity:0;transform:scale(0.3) translateX(var(--deleting-translate-x));transform-origin:bottom}.Message.has-views{--meta-safe-area-extra-width: 4rem}.Message.was-edited{--meta-safe-area-extra-width: 2.5rem}.Message.was-edited.has-views{--meta-safe-area-extra-width: 7.5rem}html[lang=ru] .Message.was-edited{--meta-safe-area-extra-width: 3.5rem}html[lang=ru] .Message.was-edited.has-views{--meta-safe-area-extra-width: 8.5rem}.select-mode-active .Message{cursor:pointer}@media (min-width: 600px){.select-mode-active .Message{-webkit-user-select:none;user-select:none}}.select-mode-active .Message:not(.own)>.Avatar,.select-mode-active .Message:not(.own)>.message-content-wrapper{transform:translateX(2.5rem)}.select-mode-active .Message:not(.is-album)::after{content:"";position:absolute;top:-0.25rem;bottom:-0.25rem;left:-4rem;right:-4rem;z-index:var(--z-message-select-area)}.select-mode-active .Message.is-album .message-select-control,.select-mode-active .Message.is-in-document-group .message-select-control{pointer-events:unset}.select-mode-active .Message .message-select-control{opacity:1}.Message.is-selected .message-select-control{background:var(--color-green)}.Message.is-selected .message-select-control.group-select{background:transparent}.Message.is-selected .message-select-control.group-select.is-selected{background:var(--color-green)}.Message .File.file-is-selected .message-select-control{background:var(--color-green)}.Message.is-in-document-group .File.file-is-selected .file-icon,.Message.has-menu-open.is-in-document-group .File .file-icon{--background-color: var(--color-background-selected)}.Message.own.is-in-document-group .File.file-is-selected .file-icon,.Message.own.has-menu-open.is-in-document-group .File .file-icon{--background-color: var(--color-background-own-selected)}.Message .Audio .message-select-control{left:1.0625rem;top:1.375rem}html.theme-dark .Message.own .Audio .ProgressSpinner{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTUiIGhlaWdodD0iMTUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTguMjE4IDcuNWw1LjYzMy01LjYzM2EuNTA4LjUwOCAwIDEwLS43MTgtLjcxOEw3LjUgNi43ODIgMS44NjcgMS4xNDlhLjUwOC41MDggMCAxMC0uNzE4LjcxOEw2Ljc4MiA3LjVsLTUuNjMzIDUuNjMzYS41MDguNTA4IDAgMTAuNzE4LjcxOEw3LjUgOC4yMThsNS42MzMgNS42MzNhLjUwNi41MDYgMCAwMC43MTggMCAuNTA4LjUwOCAwIDAwMC0uNzE4TDguMjE4IDcuNXoiIGZpbGw9IiNGRkYiIGZpbGwtcnVsZT0ibm9uemVybyIgc3Ryb2tlPSIjODA3QkQ1IiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+PC9zdmc+);background-position:center;background-size:1rem}html.theme-dark .Message.own .Audio .ProgressSpinner circle{stroke:var(--background-color)}.Message .File{position:relative}.Message .File .message-select-control{position:absolute;top:2rem;left:2rem;z-index:2}.Message.own .Message .album-item-select-wrapper{background:var(--color-background-own)}.Message .album-item-select-wrapper .message-select-control{position:absolute;top:0.438rem;right:0.438rem;left:unset}.Message .album-item-select-wrapper .media-inner{border:0 var(--select-background-color) solid;transition:border-width var(--select-transition)}.Message .album-item-select-wrapper img,.Message .album-item-select-wrapper video{transition:transform var(--select-transition)}.Message .album-item-select-wrapper.is-selected .message-select-control{background:var(--color-green)}.Message .album-item-select-wrapper.is-selected img,.Message .album-item-select-wrapper.is-selected video{transform:scale(var(--select-message-scale))}.Message.is-selected .message-select-control,.Message.is-forwarding .message-select-control{background:var(--color-green)}.Message.is-selected .Menu .bubble,.Message.is-forwarding .Menu .bubble{transition:none !important}.Message.is-in-document-group:not(.first-in-document-group)::before{top:0 !important}.Message.is-in-document-group:not(.first-in-document-group) .message-content{box-shadow:none;border-top-left-radius:0 !important;border-top-right-radius:0 !important}.Message.is-in-document-group:not(.first-in-document-group) .forwarded-message::before{top:-1.5rem}.Message.is-in-document-group:not(.last-in-document-group){margin-bottom:0}.Message.is-in-document-group:not(.last-in-document-group)::before{bottom:0 !important}.Message.is-in-document-group:not(.last-in-document-group) .message-content{border-bottom-left-radius:0 !important;border-bottom-right-radius:0 !important}.Message.is-in-document-group.is-in-selection-mode .Audio:not(.audio-is-selected) .message-select-control:not(.group-select),.Message.is-in-document-group.is-in-selection-mode .File:not(.file-is-selected) .message-select-control:not(.group-select){background:white}.Message.is-in-document-group.is-in-selection-mode .Audio:not(.audio-is-selected) .message-select-control:not(.group-select)::after,.Message.is-in-document-group.is-in-selection-mode .File:not(.file-is-selected) .message-select-control:not(.group-select)::after{content:'';width:1.25rem;height:1.25rem;border-radius:0.688rem;background:white;border:0.125rem rgba(0,0,0,0.2) solid;position:absolute}.Message.is-in-document-group.is-in-selection-mode.own .message-content .Audio:not(.audio-is-selected) .message-select-control:not(.group-select),.Message.is-in-document-group.is-in-selection-mode.own .message-content .File:not(.file-is-selected) .message-select-control:not(.group-select){background:var(--background-color);border-color:var(--background-color)}.Message.is-in-document-group.is-in-selection-mode.own .message-content .Audio:not(.audio-is-selected) .message-select-control:not(.group-select)::after,.Message.is-in-document-group.is-in-selection-mode.own .message-content .File:not(.file-is-selected) .message-select-control:not(.group-select)::after{background:var(--background-color);border-color:var(--color-message-meta-own)}.Message.is-in-document-group.focused .message-content,.Message.is-in-document-group.has-menu-open .message-content,.Message.is-in-document-group.is-forwarding .message-content,.Message.is-in-document-group.is-selected .message-content{background:var(--color-background-selected)}.Message.is-in-document-group.focused.own .message-content,.Message.is-in-document-group.has-menu-open.own .message-content,.Message.is-in-document-group.is-forwarding.own .message-content,.Message.is-in-document-group.is-selected.own .message-content{--background-color: var(--color-background-own-selected);background:var(--color-background-own-selected)}.Message.is-in-document-group .message-content-wrapper{width:17.1875rem}.Message.is-in-document-group .message-content{transition:background-color var(--select-transition)}.Message.is-in-document-group.own .message-content-wrapper{display:flex;justify-content:flex-end}.Message.is-in-document-group.own .message-content-wrapper .message-content{width:100%}.Message .album-item-select-wrapper{position:absolute}.Message .album-item-select-wrapper .message-select-control{position:absolute;z-index:2}.Message .message-select-control{position:absolute;left:0;bottom:0.25rem;width:1.5rem;height:1.5rem;border:2px solid white;border-radius:50%;z-index:var(--z-message-select-control);display:flex;align-items:center;justify-content:center;color:white;font-size:1rem;opacity:0;pointer-events:none;transition:opacity var(--select-transition)}.Message .message-select-control .icon-select{position:absolute;left:-3px;top:-3px;font-size:1.625rem}.theme-dark .Message .message-select-control{border-color:#ffffff80}.Message .Avatar{margin-right:0.3rem}.Message.is-in-document-group .message-content.document{padding:.25rem .5rem !important}.Message.is-in-document-group.last-in-document-group .message-content.document{padding-bottom:.5rem !important}.Message.is-in-document-group.first-in-document-group .message-content.document{padding-top:.5rem !important}.message-content,.Album,.media-inner,.message-content.media .media-inner img,.message-content.media .media-inner video,.message-content.custom-shape .media-inner img{border-top-left-radius:var(--border-top-left-radius);border-top-right-radius:var(--border-top-right-radius);border-bottom-left-radius:var(--border-bottom-left-radius);border-bottom-right-radius:var(--border-bottom-right-radius)}.media-inner video.full-media{background:transparent !important}.media-inner{overflow:hidden}.media-inner.small-image img{border-radius:0 !important}.Message{--border-top-left-radius: var(--border-radius-messages);--border-top-right-radius: var(--border-radius-messages);--border-bottom-left-radius: var(--border-radius-messages);--border-bottom-right-radius: var(--border-radius-messages)}.Message:not(.own).first-in-group:not(.last-in-group){--border-bottom-left-radius: var(--border-radius-messages-small)}.Message:not(.own):not(.first-in-group):not(.last-in-group){--border-top-left-radius: var(--border-radius-messages-small);--border-bottom-left-radius: var(--border-radius-messages-small)}.Message:not(.own).last-in-group:not(.first-in-group){--border-top-left-radius: var(--border-radius-messages-small)}.Message:not(.own).last-in-group{--border-bottom-left-radius: var(--border-radius-messages-small)}.Message:not(.own).last-in-group .message-content.has-appendix{--border-bottom-left-radius: 0}.Message.own.first-in-group:not(.last-in-group){--border-bottom-right-radius: var(--border-radius-messages-small)}.Message.own:not(.first-in-group):not(.last-in-group){--border-top-right-radius: var(--border-radius-messages-small);--border-bottom-right-radius: var(--border-radius-messages-small)}.Message.own.last-in-group:not(.first-in-group){--border-top-right-radius: var(--border-radius-messages-small)}.Message.own.last-in-group{--border-bottom-right-radius: var(--border-radius-messages-small)}.Message.own.last-in-group .message-content.has-appendix{--border-bottom-right-radius: 0}.Message .message-content.has-replies:not(.custom-shape) .media-inner,.Message .message-content.has-replies:not(.custom-shape) .Album,.Message .message-content.text .media-inner,.Message .message-content.text .Album{--border-bottom-left-radius: 0;--border-bottom-right-radius: 0}.Message .message-content.is-reply .EmbeddedMessage+.Album,.Message .message-content.is-reply .EmbeddedMessage+.Audio,.Message .message-content.is-reply .EmbeddedMessage+.File{margin-top:.375rem}.Message .message-content:not(.custom-shape).is-reply .media-inner,.Message .message-content:not(.custom-shape).is-reply .Album,.Message .message-content:not(.custom-shape).force-sender-name .Album,.Message .message-content:not(.is-forwarded) .message-title ~ .media-inner{--border-top-left-radius: 0;--border-top-right-radius: 0}.Message .message-content.is-forwarded .content-inner .message-title{margin-bottom:0.25rem}.Message .message-action-button{position:absolute;bottom:0;color:white;background-color:rgba(0,0,0,0.2);opacity:0;transition:opacity .2s ease}@media (pointer: coarse){.Message .message-action-button{opacity:1 !important}}.Message .message-action-button:hover,.Message .message-action-button:active,.Message .message-action-button:focus{background-color:rgba(0,0,0,0.28) !important}.Message:hover .message-action-button,.Message[data-is-document-group-hover] .message-action-button{opacity:1}.Message.own .message-action-button{left:-3rem}.Message:not(.own) .message-action-button{right:-3rem}.Message .bottom-marker{height:1px;width:1px;visibility:hidden}.Message .custom-shape .message-action-button{bottom:.25rem}.message-content{position:relative;max-width:var(--max-width)}@media (max-width: 600px){.message-content{max-width:calc(100vw - 6.25rem)}.Message.own .message-content,.MessageList.no-avatars .message-content{max-width:calc(100vw - 3.75rem)}@supports (max-width: min(29rem, 100vw - 6.25rem)){.message-content{max-width:min(29rem, 100vw - 6.25rem)}.MessageList.no-avatars .message-content{max-width:min(29rem, 100vw - 3.75rem)}.Message.own .message-content{max-width:min(30rem, 100vw - 3.75rem)}}.message-content.has-action-button{max-width:calc(100vw - 7rem)}.Message.own .message-content.has-action-button,.MessageList.no-avatars .message-content.has-action-button{max-width:calc(100vw - 4.5rem)}@supports (max-width: min(29rem, 100vw - 5.5rem)){.message-content.has-action-button{max-width:min(29rem, 100vw - 7rem)}.MessageList.no-avatars .message-content.has-action-button{max-width:min(29rem, 100vw - 4.5rem)}.Message.own .message-content.has-action-button{max-width:min(30rem, 100vw - 4.5rem)}}}.message-content .text-content{margin:0;word-break:break-word;line-height:1.3125;text-align:initial;display:flow-root;unicode-bidi:plaintext}.message-content .text-entity-link{unicode-bidi:plaintext}.message-content:not(.custom-shape) .text-content>.MessageMeta,.message-content.document>.MessageMeta{position:relative;top:.375rem;bottom:auto !important;float:right;line-height:1;height:calc(var(--message-meta-height, 1rem));margin-left:.4375rem;margin-right:-.5rem}.message-content:not(.custom-shape) .text-content>.MessageMeta .MessageOutgoingStatus .Transition,.message-content.document>.MessageMeta .MessageOutgoingStatus .Transition{max-height:calc(var(--message-meta-height, 1rem));overflow:hidden}html[data-message-text-size="12"] .message-content:not(.custom-shape) .text-content>.MessageMeta,html[data-message-text-size="12"] .message-content.document>.MessageMeta{top:.25rem}html[data-message-text-size="17"] .message-content:not(.custom-shape) .text-content>.MessageMeta,html[data-message-text-size="17"] .message-content.document>.MessageMeta{top:.4375rem}html[data-message-text-size="18"] .message-content:not(.custom-shape) .text-content>.MessageMeta,html[data-message-text-size="19"] .message-content:not(.custom-shape) .text-content>.MessageMeta,html[data-message-text-size="18"] .message-content.document>.MessageMeta,html[data-message-text-size="19"] .message-content.document>.MessageMeta{top:.5rem}html[data-message-text-size="20"] .message-content:not(.custom-shape) .text-content>.MessageMeta,html[data-message-text-size="20"] .message-content.document>.MessageMeta{top:.5625rem}.message-content:not(.custom-shape) .text-content:dir(rtl)>.MessageMeta,.message-content.document:dir(rtl)>.MessageMeta{float:left;margin-left:-.25rem;margin-right:.4375rem}.message-content.document:not(.text)::after{content:"";display:block;clear:both}.message-content.document:not(.text)>.MessageMeta{top:auto !important;bottom:-.5rem !important;margin-top:-.25rem}.message-content.document:not(.text)>.MessageMeta:not([dir=rtl]){margin-top:-1.25rem}.theme-dark .Message.own .message-content .text-entity-link{text-decoration:underline}.theme-dark .Message.own .message-content .text-entity-link:hover{text-decoration:none}.message-content:not(.custom-shape){font-size:var(--message-text-size, 1rem)}body.is-ios .message-content:not(.custom-shape){font-size:var(--message-text-size, 1.0625rem)}.message-content:not(.custom-shape)>.content-inner{min-width:0}.message-content .matching-text-highlight{background:#CAE3F7;border-radius:0.25rem;padding:0 0.125rem}.message-content .message-title{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:calc(var(--message-text-size, 1rem) - .125rem);font-weight:500;line-height:1.25rem;color:var(--accent-color);unicode-bidi:plaintext;display:flex}.message-content .message-title>.interactive{overflow:hidden;text-overflow:ellipsis}.message-content .message-title.interactive,.message-content .message-title>.interactive{cursor:pointer}.message-content .message-title.interactive:hover,.message-content .message-title>.interactive:hover{opacity:0.85}.message-content .message-title>.color-1{color:var(--color-user-1)}.message-content .message-title>.color-2{color:var(--color-user-2)}.message-content .message-title>.color-4{color:var(--color-user-4)}.message-content .message-title>.color-5{color:var(--color-user-5)}.message-content .message-title>.color-6{color:var(--color-user-6)}.message-content .message-title>.color-7{color:var(--color-user-7)}.message-content .message-title>.color-8{color:var(--color-user-8)}.theme-dark .Message.own .message-content .message-title>.color-1{color:var(--accent-color)}.message-content .message-title+.File{margin-top:.25rem}.message-content .message-title .via{padding-right:.25rem;font-weight:400}.message-content .message-title span+.via{padding-left:.25rem}.message-content .message-title .admin-title{flex:1;margin-left:1rem;text-align:right;font-weight:400;font-size:0.75rem;margin-top:-0.1rem;color:rgba(var(--color-text-meta-rgb), 0.75)}.Message.own .message-content .message-title .admin-title{color:var(--accent-color)}.message-content.has-shadow{box-shadow:0 1px 2px var(--color-default-shadow)}.message-content.has-solid-background,.message-content.has-background,.is-album .message-content{background:var(--background-color)}.message-content.has-solid-background{padding:.3125rem .5rem .375rem}.message-content.has-solid-background .forwarded-message>.text-content:not(.with-meta):last-child::after{content:'';display:inline-block;width:var(--meta-safe-area-size);height:1rem}.message-content:not(.has-appendix) .svg-appendix{display:none}.message-content .svg-appendix{overflow:hidden;position:absolute;bottom:-.0875rem;width:.5625rem;height:1.125rem;font-size:1rem !important}.message-content .svg-appendix .corner{fill:var(--background-color)}.Message.own .message-content .svg-appendix{right:-.551rem}.Message:not(.own) .message-content .svg-appendix{left:-.562rem}.message-content[data-has-custom-appendix] .svg-appendix .corner{fill:var(--appendix-bg)}.Message .message-content.has-appendix-thumb .svg-appendix{--background-color: #ccc;opacity:1;transition:opacity 500ms ease}.message-content.document{padding:.5rem !important}.theme-dark .message-content.document .File{--color-primary: var(--color-selection-highlight)}.message-content.document .File+.text-content{margin-top:.3125rem}.message-content.voice .message-title,.message-content.voice .Embedded,.message-content.audio .message-title,.message-content.audio .Embedded{margin-top:-.1875rem;margin-bottom:.1875rem}.message-content.voice{padding:.5rem !important}.message-content.voice .Voice+.text-content{margin-top:.5rem}.message-content.audio{min-width:17.1875rem;padding:.5rem .5rem .8125rem !important}.message-content.audio .Audio+.text-content{margin-top:.25rem}.message-content.audio:not(.has-replies) .Audio+.text-content{margin-bottom:-0.4375rem}.message-content:not(.custom-shape) .emoji{display:inline-block;width:1.25rem;background-size:1.25rem;color:transparent;margin-inline-end:1px;vertical-align:text-bottom}.message-content:not(.custom-shape) .emoji::selection{background-color:var(--color-selection-highlight-emoji);color:transparent}.message-content:not(.custom-shape) .text-content .emoji{width:calc(1.25 * var(--message-text-size, 1rem));height:calc(1.25 * var(--message-text-size, 1rem));background-size:calc(1.25 * var(--message-text-size, 1rem))}.message-content .no-media-corners{--border-top-left-radius: 0;--border-top-right-radius: 0}.message-content.custom-shape.is-via-bot{font-size:inherit !important}.message-content.custom-shape.is-via-bot .message-title{display:inline-flex;position:relative;top:.125rem;max-width:calc(100% - 3rem);margin-left:calc(100% - 3rem);padding:0 .5rem;background-color:var(--background-color);border-radius:var(--border-radius-messages)}.Message.own .message-content.custom-shape.is-via-bot .message-title{margin-left:-3rem}.message-content.custom-shape.is-via-bot .media-inner{margin-top:0.375rem}.message-content.media .media-inner,.WebPage .media-inner{display:flex;justify-content:center;align-items:center}.message-content.media .media-inner.interactive,.WebPage .media-inner.interactive{cursor:pointer}.message-content.media .media-inner.interactive.dark video,.WebPage .media-inner.interactive.dark video{background-color:#232323}.message-content.media.round.is-reply,.WebPage.round.is-reply{width:auto !important}.message-content.media.force-sender-name .media-inner,.message-content.media.force-sender-name .Album,.message-content.media.text .media-inner,.message-content.media.is-via-bot .media-inner,.message-content.media.is-reply .media-inner,.message-content.media.is-reply .Album,.WebPage.force-sender-name .media-inner,.WebPage.force-sender-name .Album,.WebPage.text .media-inner,.WebPage.is-via-bot .media-inner,.WebPage.is-reply .media-inner,.WebPage.is-reply .Album{margin-left:-0.5rem;margin-right:-0.5rem}.message-content.media.text .media-inner,.WebPage.text .media-inner{margin-top:-0.3125rem}.message-content.media.is-reply .media-inner,.message-content.media.force-sender-name .Album,.message-content.media.is-reply .Album,.message-content.media .message-title ~ .media-inner,.WebPage.is-reply .media-inner,.WebPage.force-sender-name .Album,.WebPage.is-reply .Album,.WebPage .message-title ~ .media-inner{margin-top:0.375rem;margin-bottom:-0.375rem}.message-content.media.text .media-inner,.message-content.media.text .Album,.WebPage.text .media-inner,.WebPage.text .Album{margin-bottom:0.375rem}.message-content.media .media-loading,.WebPage .media-loading{display:flex;align-items:center;justify-content:center}.message-content.media .media-loading:not(.open),.WebPage .media-loading:not(.open){opacity:0.5;transform:scale(0);transition:opacity .3s ease, transform .3s ease}.message-content.media .icon-large-play,.message-content.media .icon-download,.WebPage .icon-large-play,.WebPage .icon-download{position:absolute;display:flex;align-items:center;justify-content:center;color:#fff;opacity:0.7;transition:opacity 150ms}.message-content.media .icon-large-play:hover,.message-content.media .icon-download:hover,.WebPage .icon-large-play:hover,.WebPage .icon-download:hover{opacity:1}.message-content.media .icon-large-play:before,.message-content.media .icon-download:before,.WebPage .icon-large-play:before,.WebPage .icon-download:before{display:flex;align-items:center;justify-content:center;width:3.375rem;height:3.375rem;border-radius:50%;background:rgba(0,0,0,0.25)}.message-content.media .icon-download,.WebPage .icon-download{font-size:1.5rem}.message-content.media .icon-large-play,.WebPage .icon-large-play{font-size:2.5rem}.message-content.media .message-media-duration,.message-content.media .message-upload-progress,.WebPage .message-media-duration,.WebPage .message-upload-progress{background:rgba(0,0,0,0.25);color:#fff;font-size:0.75rem;position:absolute;left:.1875rem;top:.1875rem;z-index:1;padding:0 .375rem;border-radius:.75rem;line-height:1.125rem}.message-content.media .message-media-duration .icon-muted-chat,.WebPage .message-media-duration .icon-muted-chat{vertical-align:-.1875rem;margin-left:.375rem;font-size:1.0625rem}.message-content.custom-shape{line-height:1.2;font-size:10rem;display:flex;flex-wrap:wrap;align-items:flex-end}.message-content.custom-shape.has-comments{min-height:5.25rem;margin-top:0 !important}.message-content.custom-shape.has-comments.has-replies{min-height:6.5rem}.message-content.custom-shape.is-reply{max-width:100%}.message-content.custom-shape .reply-message{display:flex;align-items:flex-start;flex-direction:row-reverse;direction:ltr}.message-content.custom-shape .reply-message>p{margin-bottom:0}.message-content.custom-shape .reply-message .EmbeddedMessage{margin-left:0.5rem;border-radius:var(--border-radius-messages)}@media (max-width: 600px){.message-content.custom-shape .reply-message .EmbeddedMessage{max-width:calc(90vw - 13rem)}}@media (max-width: 340px){.message-content.custom-shape .reply-message .EmbeddedMessage{margin-left:-1rem;z-index:1;max-width:calc(90vw - 12rem)}}.message-content.custom-shape .text-content{margin-bottom:1rem}.message-content.custom-shape .media-inner{line-height:1;font-size:1rem;flex-shrink:0}.message-content.custom-shape .media-inner .full-media{top:0;left:0;bottom:0;right:0}.message-content.custom-shape .emoji{display:inline-block;color:transparent}.message-content.custom-shape .emoji::selection{background-color:var(--color-selection-highlight-emoji);color:transparent}.message-content.custom-shape.emoji-only .text-content{margin-bottom:0}.message-content.custom-shape.emoji-only-1{min-width:8rem;font-size:4.5rem}.message-content.custom-shape.emoji-only-1 .content-inner{height:7rem}.message-content.custom-shape.emoji-only-1 .text-content{line-height:1.5;text-align:center}.Message.was-edited .message-content.custom-shape.emoji-only-1{min-width:10rem}.message-content.custom-shape.emoji-only-1 .emoji{width:5rem;height:5rem}.message-content.custom-shape.emoji-only-2{font-size:4rem;margin-top:.5rem;min-width:10rem}.message-content.custom-shape.emoji-only-2.has-comments{margin-top:1.25rem}.Message.was-edited .message-content.custom-shape.emoji-only-2{min-width:12rem}.message-content.custom-shape.emoji-only-2 .emoji{width:4rem;height:4rem}.message-content.custom-shape.emoji-only-3{font-size:3rem;margin-top:1.75rem;min-width:12rem}.message-content.custom-shape.emoji-only-3.has-comments{margin-top:2.5rem}.Message.was-edited .message-content.custom-shape.emoji-only-3{min-width:14rem}.message-content.custom-shape.emoji-only-3 .emoji{width:3rem;height:3rem}.Message:not(.own) .message-content.custom-shape{--hover-color: var(--color-reply-hover);--active-color: var(--color-reply-active)}.Message.own .message-content.custom-shape{--hover-color: var(--color-reply-own-hover);--active-color: var(--color-reply-own-active)}.Message.own .message-content.custom-shape .reply-message{flex-direction:row}.Message.own .message-content.custom-shape .reply-message .EmbeddedMessage{margin-right:0.5rem}@media (max-width: 340px){.Message.own .message-content.custom-shape .reply-message .EmbeddedMessage{margin-left:0;z-index:1;max-width:calc(90vw - 11.5rem)}}.forwarded-message{--border-top-left-radius: var(--border-radius-messages-small);--border-top-right-radius: var(--border-radius-messages-small);--border-bottom-left-radius: var(--border-radius-messages-small);--border-bottom-right-radius: var(--border-radius-messages-small)}.message-content.poll .forwarded-message{margin-bottom:0.5rem}.message-content:not(.custom-shape) .forwarded-message{position:relative;margin-top:0.25rem;padding-left:0.625rem}.message-content:not(.custom-shape) .forwarded-message::before{content:'';display:block;position:absolute;top:0;bottom:0;left:0.05rem;width:2px;background:var(--accent-color);border-radius:2px}.message-content:not(.custom-shape) .forwarded-message:dir(rtl){padding-inline-start:0.625rem}.message-content:not(.custom-shape) .forwarded-message:dir(rtl)::before{left:auto;right:0.05rem}.forwarded-message>.media-inner{margin:0 !important;margin-bottom:0.25rem !important}.long-word-break-all{word-break:break-all}.text-entity-link{color:var(--color-links) !important;text-decoration:none;word-break:break-word;cursor:pointer;unicode-bidi:initial}.text-entity-link:hover,.text-entity-link:active,.text-entity-link:visited{color:var(--color-links-hover) !important;text-decoration:underline}.text-entity-code,.text-entity-pre{color:var(--color-code);background:var(--color-code-bg);white-space:pre-wrap;margin:0;padding:1px 2px;border-radius:4px;font-size:calc(var(--message-text-size, 1rem) - 0.0625rem)} +.Message{display:flex;align-items:flex-end;margin-bottom:0.375rem;position:relative;--background-color: var(--color-background);--hover-color: var(--color-reply-hover);--active-color: var(--color-reply-active);--max-width: 29rem;--accent-color: var(--color-primary);--accent-shade-color: var(--color-primary-shade);--secondary-color: var(--color-text-secondary);--meta-safe-area-base: 2.25rem;--meta-safe-author-width: 0px;--meta-safe-area-extra-width: 0px;--meta-safe-area-size: calc(var(--meta-safe-area-base) + var(--meta-safe-author-width) + var(--meta-safe-area-extra-width));--deleting-translate-x: -50%;--select-message-scale: 0.9;--select-background-color: white}.Message>.Avatar,.Message>.message-content-wrapper{opacity:1;transform:scale(1) translateX(0);transition:transform var(--select-transition)}body.animation-level-0 .Message>.Avatar,body.animation-level-0 .Message>.message-content-wrapper{transition:none !important}.Message>.Avatar{position:absolute;bottom:0;left:0}@media (max-width: 600px){.Message>.Avatar{width:2.5rem;height:2.5rem}}.Message.last-in-group{margin-bottom:0.625rem}.Message.last-in-list{margin-bottom:0.375rem}.Message.is-in-selection-mode .Album{border:1px var(--select-background-color) solid;background-color:var(--select-background-color)}body.is-android .Message.is-in-selection-mode .can-select-text{z-index:var(--z-message-select-control)}body.is-android .Message.is-in-selection-mode .media-inner{pointer-events:none}.Message.has-inline-buttons .message-content{border-bottom-right-radius:var(--border-radius-messages-small)}.Message:not(.own){padding-left:2.5rem}.no-avatars .Message:not(.own),.Message:not(.own).is-thread-top{padding-left:0}@media (max-width: 600px){.Message:not(.own){padding-left:2.875rem}.no-avatars .Message:not(.own),.Message:not(.own).is-thread-top{padding-left:0.25rem}}.Message.own{flex-direction:row-reverse;--background-color: var(--color-background-own);--hover-color: var(--color-reply-own-hover);--active-color: var(--color-reply-own-active);--max-width: 30rem;--accent-color: var(--color-accent-own);--accent-shade-color: var(--color-green);--secondary-color: var(--color-accent-own);--color-code: var(--color-code-own);--color-code-bg: var(--color-code-own-bg);--color-links: var(--color-own-links);--color-links-hover: var(--color-own-links);--meta-safe-area-base: 3.5rem;--deleting-translate-x: 50%;--color-text-green: var(--color-accent-own)}body.is-ios .Message.own,body.is-macos .Message.own{--color-background-own: var(--color-background-own-apple);--color-reply-own-hover: var(--color-reply-own-hover-apple);--color-reply-own-active: var(--color-reply-own-active-apple)}@media (max-width: 600px){.Message.own{padding-right:0.25rem}}.Message.is-deleting>.Avatar,.Message.is-deleting>.message-content-wrapper{transition:opacity .2s ease, transform .2s ease-in;opacity:0;transform:scale(0.3) translateX(var(--deleting-translate-x));transform-origin:bottom}.Message.has-views{--meta-safe-area-extra-width: 4rem}.Message.was-edited{--meta-safe-area-extra-width: 2.5rem}.Message.was-edited.has-views{--meta-safe-area-extra-width: 7.5rem}html[lang=ru] .Message.was-edited{--meta-safe-area-extra-width: 3.5rem}html[lang=ru] .Message.was-edited.has-views{--meta-safe-area-extra-width: 8.5rem}.select-mode-active .Message{cursor:pointer}@media (min-width: 600px){.select-mode-active .Message{-webkit-user-select:none;user-select:none}}.select-mode-active .Message:not(.own)>.Avatar,.select-mode-active .Message:not(.own)>.message-content-wrapper{transform:translateX(2.5rem)}.select-mode-active .Message:not(.is-album)::after{content:"";position:absolute;top:-0.25rem;bottom:-0.25rem;left:-4rem;right:-4rem;z-index:var(--z-message-select-area)}.select-mode-active .Message.is-album .message-select-control,.select-mode-active .Message.is-in-document-group .message-select-control{pointer-events:unset}.select-mode-active .Message .message-select-control{opacity:1}.Message.is-selected .message-select-control{background:var(--color-green)}.Message.is-selected .message-select-control.group-select{background:transparent}.Message.is-selected .message-select-control.group-select.is-selected{background:var(--color-green)}.Message .File.file-is-selected .message-select-control{background:var(--color-green)}.Message.is-in-document-group .File.file-is-selected .file-icon,.Message.has-menu-open.is-in-document-group .File .file-icon{--background-color: var(--color-background-selected)}.Message.own.is-in-document-group .File.file-is-selected .file-icon,.Message.own.has-menu-open.is-in-document-group .File .file-icon{--background-color: var(--color-background-own-selected)}.Message .Audio .message-select-control{left:1.0625rem;top:1.375rem}html.theme-dark .Message.own .Audio .ProgressSpinner{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTUiIGhlaWdodD0iMTUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTguMjE4IDcuNWw1LjYzMy01LjYzM2EuNTA4LjUwOCAwIDEwLS43MTgtLjcxOEw3LjUgNi43ODIgMS44NjcgMS4xNDlhLjUwOC41MDggMCAxMC0uNzE4LjcxOEw2Ljc4MiA3LjVsLTUuNjMzIDUuNjMzYS41MDguNTA4IDAgMTAuNzE4LjcxOEw3LjUgOC4yMThsNS42MzMgNS42MzNhLjUwNi41MDYgMCAwMC43MTggMCAuNTA4LjUwOCAwIDAwMC0uNzE4TDguMjE4IDcuNXoiIGZpbGw9IiNGRkYiIGZpbGwtcnVsZT0ibm9uemVybyIgc3Ryb2tlPSIjODA3QkQ1IiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+PC9zdmc+);background-position:center;background-size:1rem}html.theme-dark .Message.own .Audio .ProgressSpinner circle{stroke:var(--background-color)}.Message .File{position:relative}.Message .File .message-select-control{position:absolute;top:2rem;left:2rem;z-index:2}.Message.own .Message .album-item-select-wrapper{background:var(--color-background-own)}.Message .album-item-select-wrapper .message-select-control{position:absolute;top:0.438rem;right:0.438rem;left:unset}.Message .album-item-select-wrapper .media-inner{border:0 var(--select-background-color) solid;transition:border-width var(--select-transition)}.Message .album-item-select-wrapper img,.Message .album-item-select-wrapper video{transition:transform var(--select-transition)}.Message .album-item-select-wrapper.is-selected .message-select-control{background:var(--color-green)}.Message .album-item-select-wrapper.is-selected img,.Message .album-item-select-wrapper.is-selected video{transform:scale(var(--select-message-scale))}.Message.is-selected .message-select-control,.Message.is-forwarding .message-select-control{background:var(--color-green)}.Message.is-selected .Menu .bubble,.Message.is-forwarding .Menu .bubble{transition:none !important}.Message.is-in-document-group:not(.first-in-document-group)::before{top:0 !important}.Message.is-in-document-group:not(.first-in-document-group) .message-content{box-shadow:none;border-top-left-radius:0 !important;border-top-right-radius:0 !important}.Message.is-in-document-group:not(.first-in-document-group) .forwarded-message::before{top:-1.5rem}.Message.is-in-document-group:not(.last-in-document-group){margin-bottom:0}.Message.is-in-document-group:not(.last-in-document-group)::before{bottom:0 !important}.Message.is-in-document-group:not(.last-in-document-group) .message-content{border-bottom-left-radius:0 !important;border-bottom-right-radius:0 !important}.Message.is-in-document-group.is-in-selection-mode .Audio:not(.audio-is-selected) .message-select-control:not(.group-select),.Message.is-in-document-group.is-in-selection-mode .File:not(.file-is-selected) .message-select-control:not(.group-select){background:white}.Message.is-in-document-group.is-in-selection-mode .Audio:not(.audio-is-selected) .message-select-control:not(.group-select)::after,.Message.is-in-document-group.is-in-selection-mode .File:not(.file-is-selected) .message-select-control:not(.group-select)::after{content:'';width:1.25rem;height:1.25rem;border-radius:0.688rem;background:white;border:0.125rem rgba(0,0,0,0.2) solid;position:absolute}.Message.is-in-document-group.is-in-selection-mode.own .message-content .Audio:not(.audio-is-selected) .message-select-control:not(.group-select),.Message.is-in-document-group.is-in-selection-mode.own .message-content .File:not(.file-is-selected) .message-select-control:not(.group-select){background:var(--background-color);border-color:var(--background-color)}.Message.is-in-document-group.is-in-selection-mode.own .message-content .Audio:not(.audio-is-selected) .message-select-control:not(.group-select)::after,.Message.is-in-document-group.is-in-selection-mode.own .message-content .File:not(.file-is-selected) .message-select-control:not(.group-select)::after{background:var(--background-color);border-color:var(--color-message-meta-own)}.Message.is-in-document-group.focused .message-content,.Message.is-in-document-group.has-menu-open .message-content,.Message.is-in-document-group.is-forwarding .message-content,.Message.is-in-document-group.is-selected .message-content{background:var(--color-background-selected)}.Message.is-in-document-group.focused.own .message-content,.Message.is-in-document-group.has-menu-open.own .message-content,.Message.is-in-document-group.is-forwarding.own .message-content,.Message.is-in-document-group.is-selected.own .message-content{--background-color: var(--color-background-own-selected);background:var(--color-background-own-selected)}.Message.is-in-document-group .message-content-wrapper{width:17.1875rem}.Message.is-in-document-group .message-content{transition:background-color var(--select-transition)}.Message.is-in-document-group.own .message-content-wrapper{display:flex;justify-content:flex-end}.Message.is-in-document-group.own .message-content-wrapper .message-content{width:100%}.Message .album-item-select-wrapper{position:absolute}.Message .album-item-select-wrapper .message-select-control{position:absolute;z-index:2}.Message .message-select-control{position:absolute;left:0;bottom:0.25rem;width:1.5rem;height:1.5rem;border:2px solid white;border-radius:50%;z-index:var(--z-message-select-control);display:flex;align-items:center;justify-content:center;color:white;font-size:1rem;opacity:0;pointer-events:none;transition:opacity var(--select-transition)}.Message .message-select-control .icon-select{position:absolute;left:-3px;top:-3px;font-size:1.625rem}.theme-dark .Message .message-select-control{border-color:#ffffff80}.Message .Avatar{margin-right:0.3rem}.Message.is-in-document-group .message-content.document{padding:.25rem .5rem !important}.Message.is-in-document-group.last-in-document-group .message-content.document{padding-bottom:.5rem !important}.Message.is-in-document-group.first-in-document-group .message-content.document{padding-top:.5rem !important}.message-content,.Album,.media-inner,.message-content.media .media-inner img,.message-content.media .media-inner video,.message-content.custom-shape .media-inner img{border-top-left-radius:var(--border-top-left-radius);border-top-right-radius:var(--border-top-right-radius);border-bottom-left-radius:var(--border-bottom-left-radius);border-bottom-right-radius:var(--border-bottom-right-radius)}.media-inner video.full-media{background:transparent !important}.media-inner{overflow:hidden}.media-inner.small-image img{border-radius:0 !important}.Message{--border-top-left-radius: var(--border-radius-messages);--border-top-right-radius: var(--border-radius-messages);--border-bottom-left-radius: var(--border-radius-messages);--border-bottom-right-radius: var(--border-radius-messages)}.Message:not(.own).first-in-group:not(.last-in-group){--border-bottom-left-radius: var(--border-radius-messages-small)}.Message:not(.own):not(.first-in-group):not(.last-in-group){--border-top-left-radius: var(--border-radius-messages-small);--border-bottom-left-radius: var(--border-radius-messages-small)}.Message:not(.own).last-in-group:not(.first-in-group){--border-top-left-radius: var(--border-radius-messages-small)}.Message:not(.own).last-in-group{--border-bottom-left-radius: var(--border-radius-messages-small)}.Message:not(.own).last-in-group .message-content.has-appendix{--border-bottom-left-radius: 0}.Message.own.first-in-group:not(.last-in-group){--border-bottom-right-radius: var(--border-radius-messages-small)}.Message.own:not(.first-in-group):not(.last-in-group){--border-top-right-radius: var(--border-radius-messages-small);--border-bottom-right-radius: var(--border-radius-messages-small)}.Message.own.last-in-group:not(.first-in-group){--border-top-right-radius: var(--border-radius-messages-small)}.Message.own.last-in-group{--border-bottom-right-radius: var(--border-radius-messages-small)}.Message.own.last-in-group .message-content.has-appendix{--border-bottom-right-radius: 0}.Message .message-content.has-replies:not(.custom-shape) .media-inner,.Message .message-content.has-replies:not(.custom-shape) .Album,.Message .message-content.text .media-inner,.Message .message-content.text .Album{--border-bottom-left-radius: 0;--border-bottom-right-radius: 0}.Message .message-content.is-reply .EmbeddedMessage+.Album,.Message .message-content.is-reply .EmbeddedMessage+.Audio,.Message .message-content.is-reply .EmbeddedMessage+.File{margin-top:.375rem}.Message .message-content:not(.custom-shape).is-reply .media-inner,.Message .message-content:not(.custom-shape).is-reply .Album,.Message .message-content:not(.custom-shape).force-sender-name .Album,.Message .message-content:not(.is-forwarded) .message-title ~ .media-inner{--border-top-left-radius: 0;--border-top-right-radius: 0}.Message .message-content.is-forwarded .content-inner .message-title{margin-bottom:0.25rem}.Message .message-action-button{position:absolute;bottom:0;color:white;background-color:rgba(0,0,0,0.2);opacity:0;transition:opacity .2s ease}@media (pointer: coarse){.Message .message-action-button{opacity:1 !important}}.Message .message-action-button:hover,.Message .message-action-button:active,.Message .message-action-button:focus{background-color:rgba(0,0,0,0.28) !important}.Message:hover .message-action-button,.Message[data-is-document-group-hover] .message-action-button{opacity:1}.Message.own .message-action-button{left:-3rem}.Message:not(.own) .message-action-button{right:-3rem}.Message .bottom-marker{height:1px;width:1px;visibility:hidden}.Message .custom-shape .message-action-button{bottom:.25rem}.message-content{position:relative;max-width:var(--max-width)}@media (max-width: 600px){.message-content{max-width:calc(100vw - 6.25rem)}.Message.own .message-content,.MessageList.no-avatars .message-content{max-width:calc(100vw - 3.75rem)}@supports (max-width: min(29rem, 100vw - 6.25rem)){.message-content{max-width:min(29rem, 100vw - 6.25rem)}.MessageList.no-avatars .message-content{max-width:min(29rem, 100vw - 3.75rem)}.Message.own .message-content{max-width:min(30rem, 100vw - 3.75rem)}}.message-content.has-action-button{max-width:calc(100vw - 7rem)}.Message.own .message-content.has-action-button,.MessageList.no-avatars .message-content.has-action-button{max-width:calc(100vw - 4.5rem)}@supports (max-width: min(29rem, 100vw - 5.5rem)){.message-content.has-action-button{max-width:min(29rem, 100vw - 7rem)}.MessageList.no-avatars .message-content.has-action-button{max-width:min(29rem, 100vw - 4.5rem)}.Message.own .message-content.has-action-button{max-width:min(30rem, 100vw - 4.5rem)}}}.message-content .text-content{margin:0;word-break:break-word;line-height:1.3125;text-align:initial;display:flow-root;unicode-bidi:plaintext}.message-content .text-entity-link{unicode-bidi:plaintext}.message-content:not(.custom-shape) .text-content>.MessageMeta,.message-content.document>.MessageMeta{position:relative;top:.375rem;bottom:auto !important;float:right;line-height:1;height:calc(var(--message-meta-height, 1rem));margin-left:.4375rem;margin-right:-.5rem}.message-content:not(.custom-shape) .text-content>.MessageMeta .MessageOutgoingStatus .Transition,.message-content.document>.MessageMeta .MessageOutgoingStatus .Transition{max-height:calc(var(--message-meta-height, 1rem));overflow:hidden}html[data-message-text-size="12"] .message-content:not(.custom-shape) .text-content>.MessageMeta,html[data-message-text-size="12"] .message-content.document>.MessageMeta{top:.25rem}html[data-message-text-size="17"] .message-content:not(.custom-shape) .text-content>.MessageMeta,html[data-message-text-size="17"] .message-content.document>.MessageMeta{top:.4375rem}html[data-message-text-size="18"] .message-content:not(.custom-shape) .text-content>.MessageMeta,html[data-message-text-size="19"] .message-content:not(.custom-shape) .text-content>.MessageMeta,html[data-message-text-size="18"] .message-content.document>.MessageMeta,html[data-message-text-size="19"] .message-content.document>.MessageMeta{top:.5rem}html[data-message-text-size="20"] .message-content:not(.custom-shape) .text-content>.MessageMeta,html[data-message-text-size="20"] .message-content.document>.MessageMeta{top:.5625rem}.message-content:not(.custom-shape) .text-content:dir(rtl)>.MessageMeta,.message-content.document:dir(rtl)>.MessageMeta{float:left;margin-left:-.25rem;margin-right:.4375rem}.message-content.document:not(.text)::after{content:"";display:block;clear:both}.message-content.document:not(.text)>.MessageMeta{top:auto !important;bottom:-.5rem !important;margin-top:-.25rem}.message-content.document:not(.text)>.MessageMeta:not([dir=rtl]){margin-top:-1.25rem}.theme-dark .Message.own .message-content .text-entity-link{text-decoration:underline}.theme-dark .Message.own .message-content .text-entity-link:hover{text-decoration:none}.message-content:not(.custom-shape){font-size:var(--message-text-size, 1rem)}body.is-ios .message-content:not(.custom-shape){font-size:var(--message-text-size, 1.0625rem)}.message-content:not(.custom-shape)>.content-inner{min-width:0}.message-content .matching-text-highlight{background:#CAE3F7;border-radius:0.25rem;padding:0 0.125rem}.message-content .message-title{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:calc(var(--message-text-size, 1rem) - .125rem);font-weight:500;line-height:1.25rem;color:var(--accent-color);unicode-bidi:plaintext;display:flex}.message-content .message-title>.interactive{overflow:hidden;text-overflow:ellipsis}.message-content .message-title.interactive,.message-content .message-title>.interactive{cursor:pointer}.message-content .message-title.interactive:hover,.message-content .message-title>.interactive:hover{opacity:0.85}.message-content .message-title>.color-1{color:var(--color-user-1)}.message-content .message-title>.color-2{color:var(--color-user-2)}.message-content .message-title>.color-4{color:var(--color-user-4)}.message-content .message-title>.color-5{color:var(--color-user-5)}.message-content .message-title>.color-6{color:var(--color-user-6)}.message-content .message-title>.color-7{color:var(--color-user-7)}.message-content .message-title>.color-8{color:var(--color-user-8)}.theme-dark .Message.own .message-content .message-title>.color-1{color:var(--accent-color)}.message-content .message-title+.File{margin-top:.25rem}.message-content .message-title .via{padding-right:.25rem;font-weight:400}.message-content .message-title span+.via{padding-left:.25rem}.message-content .message-title .admin-title{flex:1;margin-left:1rem;text-align:right;font-weight:400;font-size:0.75rem;margin-top:-0.1rem;color:rgba(var(--color-text-meta-rgb), 0.75)}.Message.own .message-content .message-title .admin-title{color:var(--accent-color)}.message-content.has-shadow{box-shadow:0 1px 2px var(--color-default-shadow)}.message-content.has-solid-background,.message-content.has-background,.is-album .message-content{background:var(--background-color)}.message-content.has-solid-background{padding:.3125rem .5rem .375rem}.message-content.has-solid-background .forwarded-message>.text-content:not(.with-meta):last-child::after{content:'';display:inline-block;width:var(--meta-safe-area-size);height:1rem}.message-content:not(.has-appendix) .svg-appendix{display:none}.message-content .svg-appendix{overflow:hidden;position:absolute;bottom:-.0875rem;width:.5625rem;height:1.125rem;font-size:1rem !important}.message-content .svg-appendix .corner{fill:var(--background-color)}.Message.own .message-content .svg-appendix{right:-.551rem}.Message:not(.own) .message-content .svg-appendix{left:-.562rem}.message-content[data-has-custom-appendix] .svg-appendix .corner{fill:var(--appendix-bg)}.Message .message-content.has-appendix-thumb .svg-appendix{--background-color: #ccc;opacity:1;transition:opacity 500ms ease}.message-content.document{padding:.5rem !important}.theme-dark .message-content.document .File{--color-primary: var(--color-selection-highlight)}.message-content.document .File+.text-content{margin-top:.3125rem}.message-content.voice .message-title,.message-content.voice .Embedded,.message-content.audio .message-title,.message-content.audio .Embedded{margin-top:-.1875rem;margin-bottom:.1875rem}.message-content.voice{padding:.5rem !important}.message-content.voice .Voice+.text-content{margin-top:.5rem}.message-content.audio{min-width:17.1875rem;padding:.5rem .5rem .8125rem !important}.message-content.audio .Audio+.text-content{margin-top:.25rem}.message-content.audio:not(.has-replies) .Audio+.text-content{margin-bottom:-0.4375rem}.message-content:not(.custom-shape) .emoji{display:inline-block;width:1.25rem;background-size:1.25rem;color:transparent;margin-inline-end:1px;vertical-align:text-bottom}.message-content:not(.custom-shape) .emoji::selection{background-color:var(--color-selection-highlight-emoji);color:transparent}.message-content:not(.custom-shape) .text-content .emoji{width:calc(1.25 * var(--message-text-size, 1rem));height:calc(1.25 * var(--message-text-size, 1rem));background-size:calc(1.25 * var(--message-text-size, 1rem))}.message-content .no-media-corners{--border-top-left-radius: 0;--border-top-right-radius: 0}.message-content.custom-shape.is-via-bot{font-size:inherit !important}.message-content.custom-shape.is-via-bot .content-inner>.message-title{display:inline-flex;position:relative;top:.125rem;max-width:calc(100% - 3rem);margin-left:calc(100% - 3rem);padding:0 .5rem;background-color:var(--background-color);border-radius:var(--border-radius-messages)}.Message.own .message-content.custom-shape.is-via-bot .content-inner>.message-title{margin-left:-3rem}.message-content.custom-shape.is-via-bot .media-inner{margin-top:0.375rem}.message-content.media .media-inner,.WebPage .media-inner{display:flex;justify-content:center;align-items:center}.message-content.media .media-inner.interactive,.WebPage .media-inner.interactive{cursor:pointer}.message-content.media .media-inner.interactive.dark video,.WebPage .media-inner.interactive.dark video{background-color:#232323}.message-content.media.round.is-reply,.WebPage.round.is-reply{width:auto !important}.message-content.media.force-sender-name .media-inner,.message-content.media.force-sender-name .Album,.message-content.media.text .media-inner,.message-content.media.is-via-bot .media-inner,.message-content.media.is-reply .media-inner,.message-content.media.is-reply .Album,.WebPage.force-sender-name .media-inner,.WebPage.force-sender-name .Album,.WebPage.text .media-inner,.WebPage.is-via-bot .media-inner,.WebPage.is-reply .media-inner,.WebPage.is-reply .Album{margin-left:-0.5rem;margin-right:-0.5rem}.message-content.media.text .media-inner,.WebPage.text .media-inner{margin-top:-0.3125rem}.message-content.media.is-reply .media-inner,.message-content.media.force-sender-name .Album,.message-content.media.is-reply .Album,.message-content.media .message-title ~ .media-inner,.WebPage.is-reply .media-inner,.WebPage.force-sender-name .Album,.WebPage.is-reply .Album,.WebPage .message-title ~ .media-inner{margin-top:0.375rem;margin-bottom:-0.375rem}.message-content.media.text .media-inner,.message-content.media.text .Album,.WebPage.text .media-inner,.WebPage.text .Album{margin-bottom:0.375rem}.message-content.media .media-loading,.WebPage .media-loading{display:flex;align-items:center;justify-content:center}.message-content.media .media-loading:not(.open),.WebPage .media-loading:not(.open){opacity:0.5;transform:scale(0);transition:opacity .3s ease, transform .3s ease}.message-content.media .icon-large-play,.message-content.media .icon-download,.WebPage .icon-large-play,.WebPage .icon-download{position:absolute;display:flex;align-items:center;justify-content:center;color:#fff;opacity:0.7;transition:opacity 150ms}.message-content.media .icon-large-play:hover,.message-content.media .icon-download:hover,.WebPage .icon-large-play:hover,.WebPage .icon-download:hover{opacity:1}.message-content.media .icon-large-play:before,.message-content.media .icon-download:before,.WebPage .icon-large-play:before,.WebPage .icon-download:before{display:flex;align-items:center;justify-content:center;width:3.375rem;height:3.375rem;border-radius:50%;background:rgba(0,0,0,0.25)}.message-content.media .icon-download,.WebPage .icon-download{font-size:1.5rem}.message-content.media .icon-large-play,.WebPage .icon-large-play{font-size:2.5rem}.message-content.media .message-media-duration,.message-content.media .message-upload-progress,.WebPage .message-media-duration,.WebPage .message-upload-progress{background:rgba(0,0,0,0.25);color:#fff;font-size:0.75rem;position:absolute;left:.1875rem;top:.1875rem;z-index:1;padding:0 .375rem;border-radius:.75rem;line-height:1.125rem}.message-content.media .message-media-duration .icon-muted-chat,.WebPage .message-media-duration .icon-muted-chat{vertical-align:-.1875rem;margin-left:.375rem;font-size:1.0625rem}.message-content.custom-shape{line-height:1.2;font-size:10rem;display:flex;flex-wrap:wrap;align-items:flex-end}.message-content.custom-shape.has-comments{min-height:5.25rem;margin-top:0 !important}.message-content.custom-shape.has-comments.has-replies{min-height:6.5rem}.message-content.custom-shape.is-reply{max-width:100%}.message-content.custom-shape .reply-message{display:flex;align-items:flex-start;flex-direction:row-reverse;direction:ltr}.message-content.custom-shape .reply-message>p{margin-bottom:0}.message-content.custom-shape .reply-message .EmbeddedMessage{margin-left:0.5rem;border-radius:var(--border-radius-messages)}@media (max-width: 600px){.message-content.custom-shape .reply-message .EmbeddedMessage{max-width:calc(90vw - 13rem)}}@media (max-width: 340px){.message-content.custom-shape .reply-message .EmbeddedMessage{margin-left:-1rem;z-index:1;max-width:calc(90vw - 12rem)}}.message-content.custom-shape .text-content{margin-bottom:1rem}.message-content.custom-shape .media-inner{line-height:1;font-size:1rem;flex-shrink:0}.message-content.custom-shape .media-inner .full-media{top:0;left:0;bottom:0;right:0}.message-content.custom-shape .emoji{display:inline-block;color:transparent}.message-content.custom-shape .emoji::selection{background-color:var(--color-selection-highlight-emoji);color:transparent}.message-content.custom-shape.emoji-only .text-content{margin-bottom:0}.message-content.custom-shape.emoji-only-1{min-width:8rem;font-size:4.5rem}.message-content.custom-shape.emoji-only-1 .content-inner{height:7rem}.message-content.custom-shape.emoji-only-1 .text-content{line-height:1.5;text-align:center}.Message.was-edited .message-content.custom-shape.emoji-only-1{min-width:10rem}.message-content.custom-shape.emoji-only-1 .emoji{width:5rem;height:5rem}.message-content.custom-shape.emoji-only-2{font-size:4rem;margin-top:.5rem;min-width:10rem}.message-content.custom-shape.emoji-only-2.has-comments{margin-top:1.25rem}.Message.was-edited .message-content.custom-shape.emoji-only-2{min-width:12rem}.message-content.custom-shape.emoji-only-2 .emoji{width:4rem;height:4rem}.message-content.custom-shape.emoji-only-3{font-size:3rem;margin-top:1.75rem;min-width:12rem}.message-content.custom-shape.emoji-only-3.has-comments{margin-top:2.5rem}.Message.was-edited .message-content.custom-shape.emoji-only-3{min-width:14rem}.message-content.custom-shape.emoji-only-3 .emoji{width:3rem;height:3rem}.Message:not(.own) .message-content.custom-shape{--hover-color: var(--color-reply-hover);--active-color: var(--color-reply-active)}.Message.own .message-content.custom-shape{--hover-color: var(--color-reply-own-hover);--active-color: var(--color-reply-own-active)}.Message.own .message-content.custom-shape .reply-message{flex-direction:row}.Message.own .message-content.custom-shape .reply-message .EmbeddedMessage{margin-right:0.5rem}@media (max-width: 340px){.Message.own .message-content.custom-shape .reply-message .EmbeddedMessage{margin-left:0;z-index:1;max-width:calc(90vw - 11.5rem)}}.forwarded-message{--border-top-left-radius: var(--border-radius-messages-small);--border-top-right-radius: var(--border-radius-messages-small);--border-bottom-left-radius: var(--border-radius-messages-small);--border-bottom-right-radius: var(--border-radius-messages-small)}.message-content.poll .forwarded-message{margin-bottom:0.5rem}.message-content:not(.custom-shape) .forwarded-message{position:relative;margin-top:0.25rem;padding-left:0.625rem}.message-content:not(.custom-shape) .forwarded-message::before{content:'';display:block;position:absolute;top:0;bottom:0;left:0.05rem;width:2px;background:var(--accent-color);border-radius:2px}.message-content:not(.custom-shape) .forwarded-message:dir(rtl){padding-inline-start:0.625rem}.message-content:not(.custom-shape) .forwarded-message:dir(rtl)::before{left:auto;right:0.05rem}.forwarded-message>.media-inner{margin:0 !important;margin-bottom:0.25rem !important}.long-word-break-all{word-break:break-all}.text-entity-link{color:var(--color-links) !important;text-decoration:none;word-break:break-word;cursor:pointer;unicode-bidi:initial}.text-entity-link:hover,.text-entity-link:active,.text-entity-link:visited{color:var(--color-links-hover) !important;text-decoration:underline}.text-entity-code,.text-entity-pre{color:var(--color-code);background:var(--color-code-bg);white-space:pre-wrap;margin:0;padding:1px 2px;border-radius:4px;font-size:calc(var(--message-text-size, 1rem) - 0.0625rem)} .ContactGreeting{width:100%;height:100%;display:flex;align-items:center;justify-content:center;text-align:center}.ContactGreeting .wrapper{display:inline-flex;flex-direction:column;align-items:center;background:var(--pattern-color);width:14.5rem;padding:.75rem 1rem;border-radius:1.5rem;color:#fff}.ContactGreeting .title{font-weight:500;margin-bottom:0}.ContactGreeting .description{font-size:.9375rem;margin-bottom:0}.ContactGreeting .sticker{margin:2rem 0 1rem;height:10rem;width:10rem;cursor:pointer}.ContactGreeting .sticker .thumbnail{height:10rem;width:10rem} @@ -48,6 +48,8 @@ .ScrollDownButton{--base-bottom-pos: 6rem;position:absolute;bottom:var(--base-bottom-pos);right:1rem;opacity:0;transform:translateY(4.5rem);transition:transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),opacity 0.2s ease;z-index:10;pointer-events:none}body.animation-level-0 .ScrollDownButton{transform:none !important;transition:opacity .15s}@media (max-width: 600px){.ScrollDownButton{right:0.5rem;bottom:4.5rem}}.ScrollDownButton-inner{display:flex;flex-direction:column;align-items:center}.ScrollDownButton-inner>.Button{box-shadow:0 1px 2px var(--color-default-shadow)}.ScrollDownButton-inner>.Button i{font-size:1.75rem}@media (min-width: 1276px){.ScrollDownButton-inner{transform:translateX(0);transition:transform var(--layer-transition)}body.animation-level-0 .ScrollDownButton-inner{transition:none !important}#Main.right-column-open .ScrollDownButton-inner{transform:translateX(calc(-1 * var(--right-column-width)))}}@media (max-width: 600px){.ScrollDownButton-inner>.Button{width:2.875rem;height:2.875rem}}.ScrollDownButton.revealed{transform:translateY(0);opacity:1;pointer-events:all}.ScrollDownButton.revealed.no-composer{transform:translateY(4rem)}.ScrollDownButton .unread-count{min-width:1.5rem;height:1.5rem;padding:0 .45rem;border-radius:0.75rem;font-size:0.875rem;line-height:1.5rem;font-weight:500;text-align:center;position:absolute;top:-0.3rem;right:-0.3rem;background:var(--color-green);color:white;pointer-events:none}@media (max-width: 600px){.ScrollDownButton .unread-count{top:-0.7rem;right:auto}}@media (max-width: 600px){body.is-symbol-menu-open .ScrollDownButton{bottom:calc(var(--base-bottom-pos) + var(--symbol-menu-height) + var(--symbol-menu-footer-height))}} +.BotKeyboardMenu .bubble{width:100% !important;max-width:27rem;border-radius:var(--border-radius-default-small)}.BotKeyboardMenu .content{display:flex;flex-direction:column;padding:.1875rem .625rem;max-height:80vh;overflow:auto}@media (max-width: 600px){.BotKeyboardMenu .content{max-height:75vh}}.BotKeyboardMenu .content .row{display:flex;flex-direction:row}.BotKeyboardMenu .content .row+.row{margin-top:.375rem}.BotKeyboardMenu .content .Button{flex:1;width:auto;height:auto;min-height:3.0625rem;border-radius:var(--border-radius-messages-small);border:2px solid var(--color-primary);background:var(--color-background);color:var(--color-primary);font-weight:500;text-transform:none}.BotKeyboardMenu .content .Button:hover{color:#fff;border-color:var(--color-primary-shade);background:var(--color-primary-shade)}.BotKeyboardMenu .content .Button+.Button{margin-left:.375rem} + .ComposerEmbeddedMessage{height:2.625rem;transition:height 150ms ease-out, opacity 150ms ease-out}.select-mode-active+.middle-column-footer .ComposerEmbeddedMessage{display:none}.ComposerEmbeddedMessage:not(.open){height:0 !important}body.animation-level-0 .ComposerEmbeddedMessage{transition:none !important}.ComposerEmbeddedMessage>div{display:flex;align-items:center;padding-right:0.625rem;padding-top:0.45rem}.ComposerEmbeddedMessage>div>.Button{flex-shrink:0;background:none !important;width:2.125rem;height:2.125rem;margin:0 0.625rem;padding:0;align-self:center} .WebPagePreview{height:2.625rem;transition:height 150ms ease-out, opacity 150ms ease-out;--accent-color: var(--color-primary)}body.animation-level-0 .WebPagePreview{transition:none !important}.select-mode-active+.middle-column-footer .WebPagePreview{display:none}.WebPagePreview:not(.open){height:0 !important}.WebPagePreview>div{display:flex;align-items:center;padding-right:0.625rem;padding-top:0.45rem}.ComposerEmbeddedMessage+.WebPagePreview{margin-top:0.75rem}.WebPagePreview>div>.Button{flex-shrink:0;background:none !important;width:2.125rem;height:2.125rem;margin:0 0.625rem;padding:0;align-self:center}.WebPagePreview .WebPage{flex-grow:1;margin:0.1875rem 0 0.1875rem 0.125rem;max-width:calc(100% - 3.375rem)}.WebPagePreview .WebPage::before{top:.1rem;bottom:.05rem}.WebPagePreview .WebPage.with-video .media-inner{display:none}.WebPagePreview .WebPage .site-title,.WebPagePreview .WebPage .site-description{flex:1;max-width:100%;max-height:1rem}.WebPagePreview .WebPage .site-title{margin-top:.125rem;margin-bottom:0.1875rem}.WebPagePreview .WebPage .site-description{overflow:hidden;white-space:nowrap;text-overflow:ellipsis} @@ -71,4 +73,4 @@ #Main{display:flex;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)}}#LeftColumn{flex:1;min-width:18rem;max-width:26.5rem;height:100%}@media (max-width: 600px){#LeftColumn{height:calc(var(--vh, 1vh) * 100)}}@media (min-width: 1680px){#LeftColumn{border-left:1px solid var(--color-borders)}}@media (max-width: 1275px){#LeftColumn{flex:2}}@media (max-width: 925px){#LeftColumn{position:fixed;left:0;top:0;height:calc(var(--vh, 1vh) * 100);width:26.5rem;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:black;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;width:100vw;transform:translate3d(-20vw, 0, 0)}}@media (min-width: 1680px){#RightColumn{border-right:1px solid var(--color-borders)}}@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{flex:3;border-left:1px solid var(--color-borders);max-width:75vw}@media (max-width: 1275px){#MiddleColumn{max-width:calc(100vw - 26.5rem)}}@media (max-width: 66.25rem){#MiddleColumn{max-width:60vw}}@media (min-width: 1680px){#MiddleColumn{border-right:1px solid var(--color-borders);max-width:calc(1680px - 26.5rem)}}@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=4.7cbc0883ea4cc7908cba.css.map*/ \ No newline at end of file +/*# sourceMappingURL=4.2c2e12ad0cb73321f1fb.css.map*/ \ No newline at end of file diff --git a/dist/4.2c2e12ad0cb73321f1fb.css.map b/dist/4.2c2e12ad0cb73321f1fb.css.map new file mode 100644 index 00000000..c6f3c0b7 --- /dev/null +++ b/dist/4.2c2e12ad0cb73321f1fb.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack:///./src/components/ui/Switcher.scss","webpack:///./src/components/left/main/LeftMainHeader.scss","webpack:///./src/components/left/ConnectionState.scss","webpack:///./src/components/left/NewChatButton.scss","webpack:///./src/components/left/main/LeftMain.scss","webpack:///./src/components/left/LeftColumn.scss","webpack:///./src/components/middle/AudioPlayer.scss","webpack:///./src/components/middle/MiddleHeader.scss","webpack:///./src/components/common/EmbeddedMessage.scss","webpack:///./src/components/middle/message/MessageMeta.scss","webpack:///./src/components/middle/message/Sticker.scss","webpack:///./src/components/middle/message/Contact.scss","webpack:///./src/components/middle/message/PollOption.scss","webpack:///./src/components/middle/message/Poll.scss","webpack:///./src/components/middle/message/WebPage.scss","webpack:///./src/components/middle/message/Invoice.scss","webpack:///./src/components/middle/message/Album.scss","webpack:///./src/components/middle/message/RoundVideo.scss","webpack:///./src/components/middle/message/InlineButtons.scss","webpack:///./src/components/middle/message/CommentButton.scss","webpack:///./src/components/middle/message/Message.scss","webpack:///./src/components/middle/ContactGreeting.scss","webpack:///./src/components/middle/NoMessages.scss","webpack:///./src/components/middle/MessageList.scss","webpack:///./src/components/middle/ScrollDownButton.scss","webpack:///./src/components/middle/composer/BotKeyboardMenu.scss","webpack:///./src/components/middle/composer/ComposerEmbeddedMessage.scss","webpack:///./src/components/middle/composer/WebPagePreview.scss","webpack:///./src/components/middle/composer/Composer.scss","webpack:///./src/components/middle/MiddleColumn.scss","webpack:///./src/components/right/RightHeader.scss","webpack:///./src/components/right/ProfilePhoto.scss","webpack:///./src/components/right/ProfileInfo.scss","webpack:///./src/components/right/Profile.scss","webpack:///./src/components/right/AddChatMemb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c,kBAAkB,OAAO,MAAM,QAAQ,SAAS,iBAAiB,sCAAsC,2CAA2C,UAAU,0CAA0C,gBAAgB,mCAAmC,aAAa,wDAAwD,cAAc,2CAA2C,+BAA+B,kDAAkD,UAAU,oBAAoB,6CAA6C,gBAAgB,mDAAmD,iBAAiB,0BAA0B,YAAY,eAAe,YAAY,oCAAoC,2BAA2B,aAAa,6CAA6C,0BAA0B,aAAa,yCAAyC,8CAA8C,gBAAgB,gEAAgE,gBAAgB,mDAAmD,gBAAgB,cAAc,OAAO,2CAA2C,eAAe,2BAA2B,cAAc,iCAAiC,6BAA6B,cAAc,gBAAgB,2BAA2B,cAAc,4CAA4C,kCAAkC,0BAA0B,cAAc,eAAe,eAAe,OAAO,MAAM,SAAS,QAAQ,+BAA+B,6CAA6C,qCAAqC,gBAAgB,6CAA6C,sCAAsC,0BAA0B,cAAc,iBAAiB,6CAA6C,mCAAmC,sCAAsC,oCAAoC,+CAA+C,gBAAgB,qDAAqD,gBAAgB,kCAAkC,sCAAsC,6IAA6I,6EAA6E,gFAAgF,aAAa,+EAA+E,kCAAkC,UAAU,uEAAuE,+BAA+B,UAAU,8EAA8E,aAAa,6EAA6E,kCAAkC,UAAU,wEAAwE,+BAA+B","file":"4.2c2e12ad0cb73321f1fb.css","sourcesContent":[".Switcher{display:inline-flex;align-items:center;position:relative;margin:0}.Switcher.disabled{pointer-events:none;opacity:0.5}.Switcher.inactive{pointer-events:none}body.animation-level-0 .Switcher .widget,body.animation-level-0 .Switcher .widget::after,.Switcher.no-animation .widget,.Switcher.no-animation .widget::after{transition:none !important}body.animation-level-0 .Switcher .widget:active:after,.Switcher.no-animation .widget:active:after{width:1.125rem}.Switcher input{height:0;width:0;visibility:hidden;position:absolute;z-index:var(--z-below);opacity:0}.Switcher .widget{cursor:pointer;text-indent:-999px;width:2.125rem;height:0.875rem;background:var(--color-gray);display:inline-block;border-radius:.5rem;position:relative;transition:background .2s ease-in}.Switcher .widget:after{content:'';position:absolute;top:-.125rem;left:0;width:1.125rem;height:1.125rem;background:var(--color-background);border-radius:.75rem;transition:0.2s ease-out;border:0.125rem solid var(--color-gray)}.Switcher input:checked+.widget{background:var(--color-primary)}.Switcher input:checked+.widget:after{left:calc(100% - 1.125rem);transform:translateX(calc(-100% + 1.125rem));border-color:var(--color-primary)}.Switcher .widget:active:after{width:1.25rem}\n","#LeftMainHeader{position:relative}#LeftMainHeader .animated-menu-icon{position:absolute}#LeftMainHeader .animated-menu-icon,#LeftMainHeader .animated-menu-icon::before,#LeftMainHeader .animated-menu-icon::after{width:1.125rem;height:0.125rem;border-radius:0.125rem;background-color:var(--color-text-secondary);transition:transform .25s;transform:rotate(0)}#LeftMainHeader .animated-menu-icon::before,#LeftMainHeader .animated-menu-icon::after{position:absolute;left:0;content:''}#LeftMainHeader .animated-menu-icon::before{top:-0.3125rem}#LeftMainHeader .animated-menu-icon::after{top:0.3125rem}#LeftMainHeader .animated-menu-icon.state-back{transform:rotate(180deg)}#LeftMainHeader .animated-menu-icon.state-back::before{transform:rotate(45deg) scaleX(0.75) translate(0.375rem, -0.1875rem)}#LeftMainHeader .animated-menu-icon.state-back::after{transform:rotate(-45deg) scaleX(0.75) translate(0.375rem, 0.1875rem)}#LeftMainHeader .animated-menu-icon.no-animation{transition:none}#LeftMainHeader .animated-menu-icon.no-animation::before,#LeftMainHeader .animated-menu-icon.no-animation::after{transition:none}#LeftMainHeader .archived-badge{min-width:1.5rem;height:1.5rem;margin-left:auto;background:var(--color-gray);border-radius:0.75rem;padding:0 .45rem;color:white;font-size:0.875rem;line-height:1.5rem;font-weight:500;text-align:center;flex-shrink:0}#LeftMainHeader [dir=rtl] .archived-badge{margin-left:0;margin-right:auto}#LeftMainHeader .Menu .bubble{min-width:17rem;max-height:calc(100 * var(--vh) - 3.75rem);overflow-y:auto;overflow-y:overlay}.Transition>div:not(.active) #LeftMainHeader .Menu .bubble,body.animating-right-column #LeftMainHeader .Menu .bubble{transition:none !important}\n","#ConnectionState{flex:0 0 auto;display:flex;align-items:center;margin:0 0.5rem 0.5rem;padding:0.75rem;background:var(--color-yellow);border-radius:var(--border-radius-default)}#ConnectionState>.Spinner{--spinner-size: 1.75rem}#ConnectionState>.state-text{color:var(--color-text-lighter);font-weight:500;line-height:2rem;margin-inline-start:1.875rem;white-space:nowrap}@media (max-width: 950px){#ConnectionState>.state-text{margin-inline-start:1.25rem}}\n",".NewChatButton{position:absolute;right:1rem;bottom:1rem;transform:translateY(5rem);transition:transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1)}body.animation-level-0 .NewChatButton{transform:none !important;opacity:0;transition:opacity .15s}body.animation-level-0 .NewChatButton.revealed{opacity:1}.NewChatButton.revealed{transform:translateY(0)}@media (max-width: 600px){.NewChatButton.revealed{transform:translate3d(0, 0, 10px);transform-style:preserve-3d}}.NewChatButton.menu-is-open::before{content:'';display:block;position:absolute;top:-13rem;left:-11rem;right:-1rem;bottom:-1rem;z-index:-1}.is-touch-env .NewChatButton .Menu>.backdrop{position:absolute;left:-100vw;right:-100vw;top:-100vh;bottom:-100vh}.NewChatButton>.Button .icon-new-chat-filled,.NewChatButton>.Button .icon-close{position:absolute}.NewChatButton>.Button:not(.active) .icon-new-chat-filled{animation:grow-icon .4s ease-out}.NewChatButton>.Button:not(.active) .icon-close{animation:hide-icon .4s forwards ease-out}.NewChatButton>.Button.active .icon-close{animation:grow-icon .4s ease-out}.NewChatButton>.Button.active .icon-new-chat-filled{animation:hide-icon .4s forwards ease-out}\n","#LeftColumn-main{height:100%;position:relative;display:flex;flex-direction:column;overflow:hidden;z-index:1}#LeftColumn-main .connection-state-wrapper{position:absolute;top:3.75rem;width:100%}#LeftColumn-main>.Transition{flex:1;overflow:hidden;transition:transform 300ms ease}#LeftColumn-main>.Transition.pull-down{transform:translateY(3.75rem)}#LeftColumn-main .ChatFolders{height:100%;display:flex;flex-direction:column;overflow:hidden}#LeftColumn-main .ChatFolders .tabs-placeholder{height:2.625rem;transition:height 150ms ease}#LeftColumn-main .ChatFolders .tabs-placeholder:not(.open){height:0}#LeftColumn-main .ChatFolders .TabList{justify-content:flex-start;padding-left:.5625rem;padding-bottom:1px;border-bottom:0;z-index:1}#LeftColumn-main .ChatFolders .Tab{flex:0 0 auto;padding-left:0.625rem;padding-right:0.625rem}#LeftColumn-main .ChatFolders .Tab>span{padding-left:0.5rem;padding-right:0.5rem}#LeftColumn-main .ChatFolders>.Transition{flex:1;overflow:hidden}#LeftColumn-main .chat-list,#LeftColumn-main .RecentContacts,#LeftColumn-main .LeftSearch,#LeftColumn-main .search-content{height:100%;overflow-y:auto}#LeftColumn-main .btn-update{position:absolute;bottom:1rem;left:1rem;right:1rem;margin:0 auto}\n","#LeftColumn{overflow:hidden}#NewChat{height:100%}.left-header{height:var(--header-height);padding:0.375rem 1.25rem .5rem 0.8125rem;display:flex;align-items:center;flex-shrink:0;background-color:var(--color-background)}.left-header h3{margin-bottom:0;font-size:1.25rem;font-weight:500;margin-left:1.375rem}.left-header .SearchInput{margin-left:0.875rem;max-width:calc(100% - 3.625rem)}@media (max-width: 600px){.left-header .SearchInput{max-width:calc(100% - 3.375rem)}}@media (max-width: 600px){.left-header{padding:0.5rem}}\n",".AudioPlayer{display:flex;margin-left:auto;margin-top:-.25rem;margin-bottom:-.25rem}body.animation-level-0 .AudioPlayer{transition:none !important}.AudioPlayer>.Button{flex-shrink:0;margin:.125rem}.AudioPlayer>.toggle-play{--color-text-secondary: var(--color-primary);--color-text-secondary-rgb: var(--color-primary-shade-rgb);--color-primary-shade: var(--color-green);--color-white: var(--color-background-own)}.MiddleHeader .AudioPlayer+.HeaderActions{margin-left:1.5rem}.AudioPlayer .toggle-play.smaller{width:3rem;height:3rem}.AudioPlayer .toggle-play.smaller i{font-size:1.625rem;margin-top:-.025rem}.AudioPlayer .toggle-play i{position:absolute;font-size:1.9375rem;margin-top:-.05rem}.AudioPlayer .toggle-play i.icon-play{margin-left:.1rem}.AudioPlayer .toggle-play .icon-play,.AudioPlayer .toggle-play .icon-pause{opacity:1;transform:scale(1);transition:opacity 0.4s,transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1)}.AudioPlayer .toggle-play.play .icon-pause,.AudioPlayer .toggle-play.pause .icon-play,.AudioPlayer .toggle-play.loading .icon-play,.AudioPlayer .toggle-play.loading .icon-pause{opacity:0;transform:scale(0.5)}.AudioPlayer-content{display:flex;justify-content:center;flex-direction:column;flex-shrink:1;padding:.25rem .5rem;position:relative;overflow:hidden;cursor:pointer;max-width:15rem;border-radius:var(--border-radius-messages-small)}.AudioPlayer-content:hover{background-color:var(--color-interactive-element-hover)}@media (min-width: 1440px) and (max-width: 1500px){.AudioPlayer-content{max-width:14rem}}.AudioPlayer .AudioPlayer-content .title{display:block;font-weight:500;font-size:0.875rem !important;line-height:1rem;height:1rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}body.is-ios .AudioPlayer .AudioPlayer-content .title{font-size:.9375rem !important;line-height:.8125rem}.AudioPlayer-content .subtitle{font-size:0.85rem !important;color:var(--color-text-secondary);line-height:1.125rem;height:1.125rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin:.125rem 0 0}body.is-ios .AudioPlayer-content .subtitle{font-size:.9375rem !important}\n",".MiddleHeader{display:flex;align-items:center;width:100%;box-shadow:0 2px 2px var(--color-light-shadow);background:var(--color-background);padding:.5rem .8125rem .5rem 1.5rem;position:relative;z-index:var(--z-middle-header)}@media (max-width: 600px){.MiddleHeader{padding:0.5rem;position:relative;transform:translate3d(0, 0, 10px);transform-style:preserve-3d}}.MiddleHeader .Transition{width:100%;min-width:0}.MiddleHeader .Transition>div{display:flex;align-items:center;width:100%}.MiddleHeader .back-button{margin-left:-0.5rem;margin-right:0.5rem;position:relative}@media (max-width: 600px){.MiddleHeader .back-button{margin-left:0}}.MiddleHeader .back-button .unread-count{min-width:1.25rem;height:1.25rem;padding:0 0.375rem;border-radius:0.625rem;font-size:0.75rem;line-height:1.25rem;font-weight:500;text-align:center;position:absolute;top:-0.25rem;right:-0.5rem;background:var(--color-gray);color:white;pointer-events:none}.MiddleHeader .back-button .unread-count.active{background:var(--color-primary)}.MiddleHeader .chat-info-wrapper{flex-grow:1;overflow:hidden}.MiddleHeader .header-tools{display:flex;align-items:center;justify-content:flex-end;margin-left:auto;flex-shrink:0}body.animation-level-0 .MiddleHeader .header-tools,body.animation-level-0 .MiddleHeader .header-tools .HeaderPinnedMessage-wrapper,body.animation-level-0 .MiddleHeader .header-tools .AudioPlayer,body.animation-level-0 .MiddleHeader .header-tools .HeaderActions{transition:none !important}@media (min-width: 1276px) and (max-width: 1439px){.MiddleHeader .header-tools .HeaderActions{transform:translate3d(0, 0, 0);transition:transform var(--layer-transition)}#Main.right-column-open .MiddleHeader .header-tools .HeaderActions{transform:translate3d(calc(var(--right-column-width) * -1), 0, 0)}}@media (min-width: 1440px){.MiddleHeader .header-tools{transform:translate3d(0, 0, 0);transition:transform var(--layer-transition)}#Main.right-column-open .MiddleHeader .header-tools{transform:translate3d(calc(var(--right-column-width) * -1), 0, 0)}}.Transition>div:not(.active) .MiddleHeader .header-tools,body.animating-right-column .MiddleHeader .header-tools{pointer-events:none}@media (min-width: 1276px) and (max-width: 1439px){.MiddleHeader:not(.tools-stacked) .header-tools .HeaderPinnedMessage-wrapper,.MiddleHeader:not(.tools-stacked) .header-tools .AudioPlayer{opacity:1}#Main.right-column-open .MiddleHeader:not(.tools-stacked) .header-tools .HeaderPinnedMessage-wrapper,#Main.right-column-open .MiddleHeader:not(.tools-stacked) .header-tools .AudioPlayer{opacity:0}}.MiddleHeader.tools-stacked .header-tools .HeaderPinnedMessage-wrapper,.MiddleHeader.tools-stacked .header-tools .AudioPlayer{position:absolute;top:100%;left:0;right:0;height:2.875rem;overflow:hidden;box-shadow:0 2px 2px var(--color-light-shadow);display:flex;flex-direction:row-reverse;padding:0.375rem 0.5rem;padding-left:0.75rem;background:var(--color-background)}.MiddleHeader.tools-stacked .header-tools .HeaderPinnedMessage-wrapper::before,.MiddleHeader.tools-stacked .header-tools .AudioPlayer::before{content:\"\";display:block;position:absolute;top:-.1875rem;left:0;right:0;height:.125rem;box-shadow:0 0.125rem 0.125rem var(--color-light-shadow)}.MiddleHeader.tools-stacked .header-tools .HeaderPinnedMessage-wrapper .HeaderPinnedMessage,.MiddleHeader.tools-stacked .header-tools .AudioPlayer .HeaderPinnedMessage{max-width:unset;margin-top:-0.1875rem}.MiddleHeader.tools-stacked .header-tools .AudioPlayer{height:3.25rem;flex-direction:row;padding:0.375rem 0.5rem}.MiddleHeader.tools-stacked .header-tools .AudioPlayer-content{padding:0 0.5rem;flex-grow:1}.MiddleHeader.tools-stacked .header-tools .AudioPlayer>.Button{margin:0}.MiddleHeader.tools-stacked .header-tools .AudioPlayer>.player-close{margin-left:auto}.MiddleHeader.tools-stacked .header-tools .HeaderPinnedMessage{flex-grow:1;padding-top:0;padding-bottom:0}.MiddleHeader.tools-stacked .header-tools .HeaderPinnedMessage::before{top:0.125rem;bottom:0.125rem}.MiddleHeader.tools-stacked .header-tools .HeaderPinnedMessage .message-text{max-width:none}@media (min-width: 1150px){#Main.right-column-open .MiddleHeader.tools-stacked .header-tools .HeaderPinnedMessage-wrapper,#Main.right-column-open .MiddleHeader.tools-stacked .header-tools .AudioPlayer{padding-right:calc(0.5rem + var(--right-column-width))}}.MiddleHeader.tools-stacked.animated .header-tools .HeaderPinnedMessage-wrapper,.MiddleHeader.tools-stacked.animated .header-tools .AudioPlayer{animation:fade-in var(--layer-transition) forwards}body.animation-level-0 .MiddleHeader.tools-stacked.animated .header-tools .HeaderPinnedMessage-wrapper,body.animation-level-0 .MiddleHeader.tools-stacked.animated .header-tools .AudioPlayer{animation:none}.MiddleHeader h3{font-weight:500;font-size:1.125rem;line-height:1.375rem;white-space:pre;margin:0;overflow:hidden;text-overflow:ellipsis;unicode-bidi:plaintext}body.is-ios .MiddleHeader h3,body.is-macos .MiddleHeader h3{font-size:1.0625rem;font-weight:600}@media (max-width: 600px){.MiddleHeader h3{display:block;overflow:hidden;text-overflow:ellipsis}}@media (min-width: 1275px){#Main.right-column-open .MiddleHeader h3{max-width:calc(100% - var(--right-column-width))}}.MiddleHeader .ChatInfo{cursor:pointer;display:flex;align-items:center}.MiddleHeader .ChatInfo .info{display:flex;flex-direction:column;justify-content:center;flex-grow:1;overflow:hidden}.MiddleHeader .ChatInfo .title{display:flex;align-items:center}.MiddleHeader .ChatInfo .title .VerifiedIcon{width:1.25rem;height:1.25rem;margin-left:0.25rem;margin-top:0.05rem}.MiddleHeader .ChatInfo .user-status,.MiddleHeader .ChatInfo .status{unicode-bidi:plaintext}.MiddleHeader .Avatar{margin-right:.625rem;width:2.5rem;height:2.5rem;font-size:1.0625rem}.MiddleHeader .status,.MiddleHeader .typing-status{font-size:0.875rem;line-height:1.125rem;margin:0;color:var(--color-text-secondary);overflow:hidden;white-space:nowrap;text-overflow:ellipsis;display:inline-block}.MiddleHeader .status .ellipsis,.MiddleHeader .typing-status .ellipsis{display:inline-flex}.MiddleHeader .status.online,.MiddleHeader .typing-status.online{color:var(--color-primary)}.MiddleHeader .status .font-emoji,.MiddleHeader .typing-status .font-emoji{line-height:1rem}.MiddleHeader .Button.smaller{width:2.5rem;height:2.5rem}.MiddleHeader .HeaderPinnedMessage-wrapper{display:flex;align-items:center;margin-left:auto;cursor:default;flex-direction:row-reverse}body.animation-level-1 .MiddleHeader .HeaderPinnedMessage-wrapper .ripple-container{display:none}.MiddleHeader .HeaderPinnedMessage-wrapper .HeaderPinnedMessage{min-width:16rem}.MiddleHeader .HeaderPinnedMessage-wrapper>.Button{flex-shrink:0}.MiddleHeader .HeaderPinnedMessage{display:flex;flex-shrink:1;margin-top:-0.25rem;margin-bottom:-0.25rem;padding:0.25rem;padding-left:0.375rem;border-radius:var(--border-radius-messages-small);position:relative;overflow:hidden;cursor:pointer}.MiddleHeader .HeaderPinnedMessage:hover{background-color:var(--color-interactive-element-hover)}.MiddleHeader .HeaderPinnedMessage .pinned-message-border{position:relative;height:2.25rem;margin:0.125rem 0;width:0.125rem;min-width:0.125rem;overflow:hidden}.MiddleHeader .HeaderPinnedMessage .pinned-message-border .pinned-message-border-wrapper-1{height:2.25rem;width:0.125rem;border-radius:0.0625rem;background:var(--color-primary)}.MiddleHeader .HeaderPinnedMessage .pinned-message-border .pinned-message-border-wrapper{background-color:var(--color-primary-opacity);position:relative;will-change:transform;transition:transform .25s ease-in-out}.MiddleHeader .HeaderPinnedMessage .pinned-message-border .pinned-message-border-mark{position:absolute;left:0;top:0;width:0.125rem;background:var(--color-primary);border-radius:0.0625rem;will-change:transform;transition:transform .25s ease-in-out}.MiddleHeader .HeaderPinnedMessage .message-text{overflow:hidden;margin-inline-start:0.375rem;margin-top:0.125rem;max-width:15rem}@media (min-width: 1440px) and (max-width: 1500px){.MiddleHeader .HeaderPinnedMessage .message-text{max-width:14rem}}.MiddleHeader .HeaderPinnedMessage .message-text .title{font-weight:500;font-size:0.875rem;line-height:1rem;height:1rem;color:var(--color-primary);margin-bottom:0.125rem;white-space:pre;text-align:initial}body.is-ios .MiddleHeader .HeaderPinnedMessage .message-text .title{font-size:.9375rem}.MiddleHeader .HeaderPinnedMessage .message-text p{font-size:0.875rem;line-height:1.125rem;height:1.125rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin:0}body.is-ios .MiddleHeader .HeaderPinnedMessage .message-text p{font-size:.9375rem}.MiddleHeader .HeaderPinnedMessage .emoji-small{width:1rem;height:1rem}.MiddleHeader .HeaderPinnedMessage>img{width:2.25rem;height:2.25rem;object-fit:cover;border-radius:0.25rem;margin-inline-start:0.375rem;margin-top:0.125rem;flex-shrink:0}.MiddleHeader .HeaderPinnedMessage>img+.message-text{max-width:12rem}.MiddleHeader .HeaderActions{flex-shrink:0;margin-left:auto;display:flex;align-items:center;justify-content:flex-end}.MiddleHeader .HeaderActions .toggle-right-pane-button.active{color:var(--color-primary);opacity:1}.MiddleHeader .HeaderPinnedMessage-wrapper .Button,.MiddleHeader .HeaderActions .Button{margin-left:0.25rem}.MiddleHeader .HeaderPinnedMessage-wrapper .Button.tiny,.MiddleHeader .HeaderActions .Button.tiny{margin-right:.625rem}@media (max-width: 600px){.MiddleHeader .HeaderPinnedMessage-wrapper,.MiddleHeader .AudioPlayer{position:absolute;top:100%;left:0;right:0;height:2.875rem;overflow:hidden;box-shadow:0 2px 2px var(--color-light-shadow);display:flex;flex-direction:row-reverse;padding:0.375rem 0.5rem;padding-left:0.75rem;background:var(--color-background)}.MiddleHeader .HeaderPinnedMessage-wrapper::before,.MiddleHeader .AudioPlayer::before{content:\"\";display:block;position:absolute;top:-.1875rem;left:0;right:0;height:.125rem;box-shadow:0 0.125rem 0.125rem var(--color-light-shadow)}.MiddleHeader .HeaderPinnedMessage-wrapper .HeaderPinnedMessage,.MiddleHeader .AudioPlayer .HeaderPinnedMessage{max-width:unset;margin-top:-0.1875rem}.MiddleHeader .AudioPlayer{height:3.25rem;flex-direction:row;padding:0.375rem 0.5rem}.MiddleHeader .AudioPlayer-content{padding:0 0.5rem;flex-grow:1}.MiddleHeader .AudioPlayer>.Button{margin:0}.MiddleHeader .AudioPlayer>.player-close{margin-left:auto}.MiddleHeader .HeaderPinnedMessage{flex-grow:1;padding-top:0;padding-bottom:0}.MiddleHeader .HeaderPinnedMessage::before{top:0.125rem;bottom:0.125rem}.MiddleHeader .HeaderPinnedMessage .message-text{max-width:none}.MiddleHeader .HeaderPinnedMessage-wrapper,.MiddleHeader .AudioPlayer{transform:translate3d(0, 0, 0)}}@media (min-width: 925px) and (max-width: 1149.9px){.MiddleHeader .HeaderPinnedMessage-wrapper,.MiddleHeader .AudioPlayer{position:absolute}}@keyframes fade-in{from{opacity:0}to{opacity:1}}\n",".EmbeddedMessage{display:flex;align-items:center;font-size:calc(var(--message-text-size, 1rem) - .125rem);line-height:1.125rem;margin:0 -0.25rem .0625rem;padding:.1875rem 0.25rem .1875rem .4375rem;border-radius:var(--border-radius-messages-small);position:relative;overflow:hidden;cursor:pointer;direction:ltr}body.animation-level-1 .EmbeddedMessage .ripple-container{display:none}.custom-shape .EmbeddedMessage{max-width:15rem;padding:0.5rem;margin:0;background-color:var(--background-color);box-shadow:0 1px 2px var(--color-default-shadow)}.custom-shape .EmbeddedMessage::before{left:.625rem;top:.625rem;bottom:.625rem}.custom-shape .EmbeddedMessage img:not(.emoji){margin-inline-start:.5rem}.custom-shape .EmbeddedMessage:dir(rtl){padding:0.5rem}.EmbeddedMessage::before{content:'';display:block;position:absolute;top:.3125rem;bottom:.3125rem;left:.3125rem;width:2px;background:var(--accent-color);border-radius:2px}.EmbeddedMessage:hover{background-color:var(--hover-color)}.EmbeddedMessage:active{background-color:var(--active-color)}.EmbeddedMessage .message-title{font-size:calc(var(--message-text-size, 1rem) - .125rem)}.EmbeddedMessage .message-text{overflow:hidden;margin-inline-start:0.5rem;display:flex;flex-direction:column-reverse}.EmbeddedMessage .message-text .message-title{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-bottom:0.125rem;flex:1;display:block}.EmbeddedMessage .message-text p{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;height:1.125rem;margin-bottom:0;flex:1}.EmbeddedMessage .message-text p::after{content:none;display:none}.EmbeddedMessage .message-text .emoji{width:calc(1.125 * var(--message-text-size, 1rem)) !important;height:calc(1.125 * var(--message-text-size, 1rem)) !important;vertical-align:text-bottom !important}.EmbeddedMessage .embedded-action-message{color:var(--accent-color);opacity:0.75}.EmbeddedMessage img:not(.emoji){width:2rem;height:2rem;object-fit:cover;border-radius:.25rem;margin-left:.25rem;flex-shrink:0}.EmbeddedMessage img:not(.emoji).round{border-radius:1rem}.EmbeddedMessage.inside-input{padding-inline-start:0.5625rem;margin:0 0 -.125rem -0.1875rem;display:grid;grid-template-columns:auto 1fr;grid-template-rows:1fr;width:100%;--accent-color: var(--color-primary);--hover-color: var(--color-interactive-element-hover)}.EmbeddedMessage.inside-input::before{bottom:.3125rem}.EmbeddedMessage.inside-input img:not(.emoji){margin-left:.125rem}.EmbeddedMessage.inside-input .message-text{margin-inline-start:.375rem}.EmbeddedMessage.inside-input .message-title{font-weight:500;color:var(--accent-color)}\n",".MessageMeta{position:absolute;height:1.25rem;bottom:0;right:0;display:flex;align-items:center;background:rgba(153,153,153,0.6);border-radius:.625rem;padding:0 .25rem;color:white;cursor:pointer;max-width:100%}.MessageMeta .message-time,.MessageMeta .message-signature,.MessageMeta .message-views{font-size:.75rem;white-space:nowrap}.MessageMeta .message-time{margin-right:.1875rem}.MessageMeta .message-views{margin-left:.1875rem}.MessageMeta .message-signature{overflow:hidden;text-overflow:ellipsis;margin-right:0.375rem}.MessageMeta .icon-channelviews{margin-left:0.125rem;margin-right:0.375rem;font-size:1.125rem;position:relative;top:-0.0625rem}.has-solid-background .MessageMeta{color:rgba(var(--color-text-meta-rgb), 0.75);background:none}.media:not(.text) .MessageMeta,.Message .custom-shape .MessageMeta{background:rgba(0,0,0,0.2);--color-accent-own: white;--color-accent: white;color:white !important;opacity:1;bottom:.25rem;right:.25rem;left:auto;height:1.125rem;padding:0 .3125rem 0 .375rem}.media:not(.text) .MessageMeta .MessageOutgoingStatus i,.Message .custom-shape .MessageMeta .MessageOutgoingStatus i{background:transparent}.media:not(.text):dir(rtl) .MessageMeta,.Message .custom-shape:dir(rtl) .MessageMeta{right:auto !important;left:.25rem;padding:0 .375rem 0 .3125rem}.is-forwarded.media:not(.text):dir(rtl) .MessageMeta,.Message .is-forwarded.custom-shape:dir(rtl) .MessageMeta{left:.8125rem}.is-forwarded.media:not(.text) .MessageMeta{bottom:0.935rem;right:0.8125rem}.emoji-only .MessageMeta{right:0}.Message.own .has-solid-background .MessageMeta{color:var(--color-message-meta-own)}.MessageMeta .MessageOutgoingStatus{margin-left:-.1875rem;font-size:1.1875rem;border-radius:.625rem}.Message.own .MessageMeta .MessageOutgoingStatus{color:var(--color-accent-own)}.message-content.has-replies:not(.custom-shape) .MessageMeta{bottom:3.375rem}.message-content.has-replies.text:not(.custom-shape) .MessageMeta{bottom:3.4375rem}.Message:not(.own) .custom-shape .reply-message+.MessageMeta{right:auto;left:13.2rem;bottom:0.25rem}.Message:not(.own) .emoji-only-1 .reply-message+.MessageMeta{left:2.5rem}.Message:not(.own) .emoji-only-2 .reply-message+.MessageMeta{left:5.5rem}.Message:not(.own) .emoji-only-3 .reply-message+.MessageMeta{left:6.5rem}\n",".Sticker:not(.inactive){cursor:pointer}.Sticker.inactive{pointer-events:none}\n",".Contact{display:flex;align-items:center;padding:0.25rem}.Contact.interactive{cursor:pointer}.Contact .Avatar{margin-right:0.8rem}.Contact .contact-info{padding:0.5rem;padding-left:0;white-space:nowrap;overflow:hidden}.Contact .contact-info .contact-name{font-size:1rem;line-height:1rem;margin-bottom:0.25rem;font-weight:500}.Contact .contact-info .contact-phone{line-height:1rem;color:var(--secondary-color)}\n",".PollOption{display:flex;flex-flow:row nowrap;margin-bottom:0.75rem}.PollOption:last-child{margin-bottom:0}.PollOption .poll-option-text{word-break:break-word}.PollOption .poll-option-share{position:relative;margin-top:.125rem;width:1.75rem;margin-inline-end:.5rem;flex-shrink:0;font-weight:500;font-size:.875rem;text-align:right}.PollOption .poll-option-share.limit-width{display:inline-flex;justify-content:center;font-size:.75rem}.PollOption .poll-option-chosen{position:absolute;right:0;bottom:-5px;width:1rem;height:1rem;background:var(--accent-color);color:var(--background-color);border-radius:.5rem;font-size:.75rem;text-align:center}.PollOption .poll-option-chosen.wrong{background:var(--color-error)}.is-forwarded .PollOption .poll-option-chosen>i{margin-left:1px}.PollOption .poll-option-chosen.animate{opacity:0;animation-name:PollOptionIconAnimate;animation-delay:.09s;animation-duration:.3s;animation-fill-mode:forwards}.PollOption .poll-option-right{flex-grow:1}.PollOption .poll-option-answer{position:relative}.PollOption .poll-option-line{position:relative;width:0;height:0.25rem;min-width:0.5rem;border-radius:0.125rem;margin-top:0.5rem;background:var(--accent-color);transform-origin:0 0;transition:transform .3s;transition-delay:.09s}.PollOption .poll-line{width:30px;height:35px;position:absolute;left:-27px;bottom:-5px;transition:stroke-dashoffset .3s, stroke-dasharray .3s;stroke-dashoffset:0;stroke-dasharray:0, 200%}.PollOption .poll-line path{stroke-width:4px;stroke-linecap:round;stroke:var(--accent-color);fill:none}.PollOption .wrong .poll-option-line{background:var(--color-error)}.PollOption .wrong .poll-line path{stroke:var(--color-error)}@keyframes PollOptionIconAnimate{0%{opacity:0}100%{opacity:1}}\n",".Poll{min-width:15rem;text-align:initial}@media (max-width: 600px){.Poll{min-width:50vw}}.Poll .poll-question{font-weight:500;line-height:1.25rem;margin:0.125rem 0;word-break:break-word}.Poll .poll-type,.Poll .poll-voters-count{color:var(--secondary-color);font-size:0.875rem}.Poll .poll-type{margin-bottom:0.5rem;display:flex;align-items:center;min-height:1.375rem}.Poll .poll-voters-count{margin:.4375rem 0 .3125rem;text-align:center}.Poll .poll-answers{padding-top:0.25rem;padding-bottom:1rem}.Poll .Checkbox,.Poll .Radio{padding-left:2.25rem}.Poll .Checkbox:last-child,.Poll .Radio:last-child{margin-bottom:.75rem}.Poll .Checkbox.disabled,.Poll .Radio.disabled{opacity:1 !important;cursor:not-allowed}.Poll .Checkbox .Checkbox-main::before,.Poll .Checkbox .Radio-main::before,.Poll .Radio .Checkbox-main::before,.Poll .Radio .Radio-main::before{left:0.125rem;background-color:var(--background-color)}.theme-dark .Poll .Checkbox .Checkbox-main::before,.theme-dark .Poll .Checkbox .Radio-main::before,.theme-dark .Poll .Radio .Checkbox-main::before,.theme-dark .Poll .Radio .Radio-main::before{--color-borders: var(--color-borders-input)}.Message.own .Poll .Checkbox .Checkbox-main::before,.Message.own .Poll .Checkbox .Radio-main::before,.Message.own .Poll .Radio .Checkbox-main::before,.Message.own .Poll .Radio .Radio-main::before{--color-borders: var(--accent-color)}.Poll .Checkbox .Checkbox-main::after,.Poll .Checkbox .Radio-main::after,.Poll .Radio .Checkbox-main::after,.Poll .Radio .Radio-main::after{left:0.4375rem;background-color:var(--accent-color)}.Poll .Checkbox input:checked ~ .Radio-main::before,.Poll .Checkbox input:checked ~ .Checkbox-main::before,.Poll .Radio input:checked ~ .Radio-main::before,.Poll .Radio input:checked ~ .Checkbox-main::before{border-color:var(--accent-color)}.Poll .Checkbox .Spinner,.Poll .Radio .Spinner{left:0.125rem}.Poll .Checkbox .Checkbox-main::after{left:0.125rem;background-color:var(--color-primary)}.Message.own .Poll .Checkbox .Checkbox-main::after{background-color:var(--accent-color)}.Poll .Spinner>div{background-image:var(--spinner-gray-data)}.theme-dark .Poll .Spinner>div{background-image:var(--spinner-white-data)}.Message.own .Poll .Spinner>div{background-image:var(--spinner-green-data)}.theme-dark .Message.own .Poll .Spinner>div{background-image:var(--spinner-white-data)}.Poll .poll-recent-voters{display:inline-flex;align-items:center;vertical-align:text-bottom;margin-left:.875rem;margin-right:.5rem;margin-top:-2px}.Poll .poll-recent-voters .Avatar{border:1px solid var(--color-white);margin-right:0;box-sizing:content-box}.Poll .poll-recent-voters .Avatar:not(:first-child){margin-left:-3px}.Poll .poll-countdown{margin-left:auto;font-size:.75rem;transition:color .2s}.Poll .poll-countdown.hurry-up{color:var(--color-error)}.Poll .poll-countdown.hurry-up .poll-countdown-progress{stroke:var(--color-error)}.Poll .poll-countdown svg{vertical-align:-3px}.Poll .poll-countdown-progress{stroke:var(--color-primary);fill:transparent;stroke-width:2;stroke-linecap:round;transition:stroke-dashoffset 2s, stroke .2s}.Poll .poll-quiz-help{margin:-.625rem 0 -.625rem auto}.Message:not(.own) .Poll .poll-quiz-help{color:var(--color-primary)}.Poll .poll-results,.Poll .poll-answers{padding-top:0.25rem;padding-bottom:0.5rem}.Poll .Button{text-transform:none;font-size:1rem}.Message.own .Poll .Button{color:var(--accent-color);--color-primary-shade-rgb: var(--color-accent-own)}.Poll>.Button{margin-top:-.125rem;margin-bottom:-.0625rem}\n",".WebPage{margin-top:0.25rem;margin-bottom:0.125rem;padding-left:.625rem;font-size:calc(var(--message-text-size, 1rem) - .125rem);line-height:1.125rem;max-width:29rem;position:relative}.WebPage::before{content:'';display:block;position:absolute;top:0;bottom:0;left:0;width:.125rem;background:var(--accent-color);border-radius:.125rem}.WebPage-text{display:flex;flex-direction:column;align-items:flex-start}.WebPage .media-inner{margin:0 !important;margin-bottom:0.375rem !important}.WebPage .media-inner,.WebPage .media-inner img,.WebPage .media-inner.small-image img{border-radius:var(--border-radius-messages-small) !important}.WebPage .media-inner.square-image{width:5rem;height:5rem;min-height:0;margin-bottom:0 !important}.WebPage .media-inner.square-image img{width:100%;height:100%}.WebPage.with-video .media-inner{margin-top:0.5rem !important;margin-bottom:1rem !important}.WebPage.with-square-photo{display:flex;margin-bottom:1rem}.WebPage.with-square-photo .WebPage-text{order:1;padding-right:1rem}.WebPage.with-square-photo .media-inner{order:2;flex-shrink:0}.WebPage.with-square-photo:dir(rtl) .WebPage-text{padding-inline-end:1rem}.WebPage:not(.with-square-photo) .site-name:last-child::after,.WebPage:not(.with-square-photo) .site-title:last-child::after,.WebPage:not(.with-square-photo) .site-description:last-child::after{content:'';display:inline-block;width:var(--meta-safe-area-size);height:0.75rem;float:right}.WebPage .site-name,.WebPage .site-description,.WebPage .site-title{word-break:break-word;max-width:100%}.WebPage .site-name{color:var(--accent-color);font-weight:500;margin-bottom:0.125rem}.WebPage .site-title{font-weight:500;margin-bottom:0.125rem}.WebPage .site-description{line-height:1.25;margin-bottom:0}body.is-ios .WebPage .site-description{line-height:1.125rem}.WebPage:dir(rtl){padding-inline-start:.625rem}.WebPage:dir(rtl)::before{left:auto;right:0}\n",".Invoice .title{color:var(--accent-color);font-weight:500}.Invoice .description{position:relative}.Invoice .description.has-image .invoice-image{max-width:100%;height:20rem}@media (max-width: 600px){.Invoice .description.has-image .invoice-image{height:10rem}}.Invoice .description.has-image .description-text{position:absolute;top:0;padding:.25rem .5rem;margin:.25rem;background-color:rgba(90,110,70,0.6);border-radius:var(--border-radius-messages-small);color:var(--color-text);font-weight:500}\n",".Album{position:relative;overflow:hidden}.message-content.media.text .Album{margin:-0.3125rem -0.5rem 0.3125rem}.forwarded-message .Album{margin-bottom:.125rem}.message-content.media.text .forwarded-message .Album{margin:0 0 0.3125rem;--border-bottom-left-radius: inherit;--border-bottom-right-radius: inherit}.Album>.album-item-select-wrapper .media-inner,.message-content.media.text .Album>.album-item-select-wrapper .media-inner{margin:0 !important}.Album>.album-item-select-wrapper .media-inner,.Album>.album-item-select-wrapper .media-inner img,.Album>.album-item-select-wrapper .media-inner video{border-radius:0 !important;object-fit:cover}\n",".RoundVideo{position:relative;width:200px;height:200px;cursor:pointer}.RoundVideo .thumbnail-wrapper{width:200px;height:200px;border-radius:50%;overflow:hidden}.RoundVideo .video-wrapper{position:absolute;left:0;top:0;border-radius:50%;overflow:hidden}.RoundVideo .progress{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}.RoundVideo .progress-circle{stroke:white;fill:transparent;stroke-width:4;stroke-opacity:.35;stroke-linecap:round}.RoundVideo video::-internal-media-controls-cast-button,.RoundVideo video::-webkit-media-controls,.RoundVideo video::-webkit-media-controls-start-playback-button{display:none}\n",".InlineButtons{display:flex;flex-direction:column}.InlineButtons .row{display:flex;flex-direction:row}.InlineButtons .Button{flex:1;width:auto;margin:0.125rem;background:var(--pattern-color);border-radius:var(--border-radius-messages-small);font-weight:500;text-transform:none}.InlineButtons .Button::before{content:'';background-color:var(--color-white);opacity:0;position:absolute;top:0;left:0;right:0;bottom:0;border-radius:var(--border-radius-messages-small);z-index:var(--z-below);transition:opacity 200ms}.InlineButtons .Button:hover{background:var(--pattern-color) !important}.InlineButtons .Button:hover::before{opacity:.4}.InlineButtons .Button:first-of-type{margin-left:0}.InlineButtons .Button:last-of-type{margin-right:0}.InlineButtons .Button i{font-size:0.75rem;position:absolute;right:0.125rem;top:0.125rem;display:block;transform:rotate(-45deg)}.InlineButtons .row:first-of-type .Button{margin-top:0.25rem !important}.InlineButtons .row:last-of-type .Button{margin-bottom:0}.InlineButtons .row:last-of-type .Button:first-of-type{border-bottom-left-radius:var(--border-radius-messages)}.InlineButtons .row:last-of-type .Button:last-of-type{border-bottom-right-radius:var(--border-radius-messages)}\n",".CommentButton{--background-color: var(--color-background);--hover-color: var(--color-chat-hover);display:flex;width:100%;align-items:center;padding:.5625rem .25rem .5625rem .625rem;padding-inline-start:.625rem;padding-inline-end:.25rem;background:var(--background-color);border-bottom-right-radius:var(--border-bottom-right-radius);border-bottom-left-radius:var(--border-bottom-left-radius);font-size:.9375rem;font-weight:500;line-height:2rem;color:var(--accent-color);white-space:nowrap;cursor:pointer;transition:background-color .15s, color .15s}body.animation-level-0 .CommentButton{transition:none !important}.Message .has-appendix .CommentButton::before{content:'';display:block;position:absolute;bottom:-.1875rem;left:-.5625rem;width:.5625rem;height:1.25rem;background-position:bottom left;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');opacity:0;transition:opacity .15s, filter .15s}.theme-dark #root .Message .has-appendix .CommentButton::before{filter:invert(0.83)}body.animation-level-0 .Message .has-appendix .CommentButton::before{transition:none !important}.custom-shape .CommentButton{position:absolute;right:-3rem;width:2.25rem;bottom:3rem;height:3.375rem;border-radius:1.375rem;padding:0.375rem .3125rem .25rem;align-items:flex-start;color:white;background-color:rgba(0,0,0,0.2);opacity:0;transition:opacity .2s ease}@media (pointer: coarse){.custom-shape .CommentButton{opacity:1 !important}}.custom-shape .CommentButton:hover{background-color:rgba(0,0,0,0.28)}.Message:hover .custom-shape .CommentButton{opacity:1}.custom-shape .CommentButton::after{content:attr(data-cnt);position:absolute;bottom:-.0625rem;left:0;width:100%;text-align:center;font-size:12px;display:block}.custom-shape .CommentButton[data-cnt=\"0\"]{height:2.25rem}.custom-shape .CommentButton[data-cnt=\"0\"]::after{display:none}.custom-shape .CommentButton .icon-comments-sticker{display:block;font-size:1.5rem;margin:0 auto}.custom-shape .CommentButton .recent-repliers,.custom-shape .CommentButton .icon-comments,.custom-shape .CommentButton .label,.custom-shape .CommentButton .icon-next{display:none}.CommentButton:hover{background:var(--hover-color)}.Message .has-appendix .CommentButton:hover::before{opacity:1}.CommentButton:hover .Avatar{border-color:var(--hover-color) !important}.is-forwarded .CommentButton,.audio .CommentButton,.voice .CommentButton,.poll .CommentButton,.text .CommentButton{border-top:1px solid var(--color-borders)}.message-content.has-solid-background .CommentButton{margin:.375rem -.5rem -.375rem}.message-content.voice .CommentButton{margin-bottom:-.5rem}.message-content.audio .CommentButton{margin-bottom:-.8125rem}.message-content.audio .CommentButton,.message-content.voice .CommentButton,.message-content.poll .CommentButton,.message-content.has-solid-background.text .CommentButton,.message-content.has-solid-background.is-forwarded .CommentButton{width:calc(100% + 1rem)}.CommentButton .icon-comments-sticker{display:none}.CommentButton .icon-comments{font-size:1.5625rem;line-height:2rem;margin-inline-end:.875rem}.CommentButton .icon-next{margin-inline-start:auto;font-size:1.5rem}.CommentButton .recent-repliers{display:inline-flex;align-items:center;margin-inline-end:.5rem;margin-inline-start:-.125rem}.CommentButton .recent-repliers .Avatar{transition:border .15s;border:2px solid var(--color-background);margin-inline-end:0;z-index:3;overflow:hidden}.CommentButton .recent-repliers .Avatar .emoji{width:1rem;background-size:1rem}.CommentButton .recent-repliers .Avatar+.Avatar{z-index:2}.CommentButton .recent-repliers .Avatar+.Avatar+.Avatar{z-index:1}.CommentButton .recent-repliers .Avatar:not(:first-child){margin-inline-start:-.75rem}.CommentButton.has-unread .label{position:relative}.CommentButton.has-unread .label::after{content:'';display:inline-block;width:.5rem;height:.5rem;border-radius:50%;background:var(--accent-color);margin-inline-start:.75rem}.CommentButton.disabled{cursor:default;pointer-events:none}\n",".Message{display:flex;align-items:flex-end;margin-bottom:0.375rem;position:relative;--background-color: var(--color-background);--hover-color: var(--color-reply-hover);--active-color: var(--color-reply-active);--max-width: 29rem;--accent-color: var(--color-primary);--accent-shade-color: var(--color-primary-shade);--secondary-color: var(--color-text-secondary);--meta-safe-area-base: 2.25rem;--meta-safe-author-width: 0px;--meta-safe-area-extra-width: 0px;--meta-safe-area-size: calc(var(--meta-safe-area-base) + var(--meta-safe-author-width) + var(--meta-safe-area-extra-width));--deleting-translate-x: -50%;--select-message-scale: 0.9;--select-background-color: white}.Message>.Avatar,.Message>.message-content-wrapper{opacity:1;transform:scale(1) translateX(0);transition:transform var(--select-transition)}body.animation-level-0 .Message>.Avatar,body.animation-level-0 .Message>.message-content-wrapper{transition:none !important}.Message>.Avatar{position:absolute;bottom:0;left:0}@media (max-width: 600px){.Message>.Avatar{width:2.5rem;height:2.5rem}}.Message.last-in-group{margin-bottom:0.625rem}.Message.last-in-list{margin-bottom:0.375rem}.Message.is-in-selection-mode .Album{border:1px var(--select-background-color) solid;background-color:var(--select-background-color)}body.is-android .Message.is-in-selection-mode .can-select-text{z-index:var(--z-message-select-control)}body.is-android .Message.is-in-selection-mode .media-inner{pointer-events:none}.Message.has-inline-buttons .message-content{border-bottom-right-radius:var(--border-radius-messages-small)}.Message:not(.own){padding-left:2.5rem}.no-avatars .Message:not(.own),.Message:not(.own).is-thread-top{padding-left:0}@media (max-width: 600px){.Message:not(.own){padding-left:2.875rem}.no-avatars .Message:not(.own),.Message:not(.own).is-thread-top{padding-left:0.25rem}}.Message.own{flex-direction:row-reverse;--background-color: var(--color-background-own);--hover-color: var(--color-reply-own-hover);--active-color: var(--color-reply-own-active);--max-width: 30rem;--accent-color: var(--color-accent-own);--accent-shade-color: var(--color-green);--secondary-color: var(--color-accent-own);--color-code: var(--color-code-own);--color-code-bg: var(--color-code-own-bg);--color-links: var(--color-own-links);--color-links-hover: var(--color-own-links);--meta-safe-area-base: 3.5rem;--deleting-translate-x: 50%;--color-text-green: var(--color-accent-own)}body.is-ios .Message.own,body.is-macos .Message.own{--color-background-own: var(--color-background-own-apple);--color-reply-own-hover: var(--color-reply-own-hover-apple);--color-reply-own-active: var(--color-reply-own-active-apple)}@media (max-width: 600px){.Message.own{padding-right:0.25rem}}.Message.is-deleting>.Avatar,.Message.is-deleting>.message-content-wrapper{transition:opacity .2s ease, transform .2s ease-in;opacity:0;transform:scale(0.3) translateX(var(--deleting-translate-x));transform-origin:bottom}.Message.has-views{--meta-safe-area-extra-width: 4rem}.Message.was-edited{--meta-safe-area-extra-width: 2.5rem}.Message.was-edited.has-views{--meta-safe-area-extra-width: 7.5rem}html[lang=ru] .Message.was-edited{--meta-safe-area-extra-width: 3.5rem}html[lang=ru] .Message.was-edited.has-views{--meta-safe-area-extra-width: 8.5rem}.select-mode-active .Message{cursor:pointer}@media (min-width: 600px){.select-mode-active .Message{-webkit-user-select:none;user-select:none}}.select-mode-active .Message:not(.own)>.Avatar,.select-mode-active .Message:not(.own)>.message-content-wrapper{transform:translateX(2.5rem)}.select-mode-active .Message:not(.is-album)::after{content:\"\";position:absolute;top:-0.25rem;bottom:-0.25rem;left:-4rem;right:-4rem;z-index:var(--z-message-select-area)}.select-mode-active .Message.is-album .message-select-control,.select-mode-active .Message.is-in-document-group .message-select-control{pointer-events:unset}.select-mode-active .Message .message-select-control{opacity:1}.Message.is-selected .message-select-control{background:var(--color-green)}.Message.is-selected .message-select-control.group-select{background:transparent}.Message.is-selected .message-select-control.group-select.is-selected{background:var(--color-green)}.Message .File.file-is-selected .message-select-control{background:var(--color-green)}.Message.is-in-document-group .File.file-is-selected .file-icon,.Message.has-menu-open.is-in-document-group .File .file-icon{--background-color: var(--color-background-selected)}.Message.own.is-in-document-group .File.file-is-selected .file-icon,.Message.own.has-menu-open.is-in-document-group .File .file-icon{--background-color: var(--color-background-own-selected)}.Message .Audio .message-select-control{left:1.0625rem;top:1.375rem}html.theme-dark .Message.own .Audio .ProgressSpinner{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTUiIGhlaWdodD0iMTUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTguMjE4IDcuNWw1LjYzMy01LjYzM2EuNTA4LjUwOCAwIDEwLS43MTgtLjcxOEw3LjUgNi43ODIgMS44NjcgMS4xNDlhLjUwOC41MDggMCAxMC0uNzE4LjcxOEw2Ljc4MiA3LjVsLTUuNjMzIDUuNjMzYS41MDguNTA4IDAgMTAuNzE4LjcxOEw3LjUgOC4yMThsNS42MzMgNS42MzNhLjUwNi41MDYgMCAwMC43MTggMCAuNTA4LjUwOCAwIDAwMC0uNzE4TDguMjE4IDcuNXoiIGZpbGw9IiNGRkYiIGZpbGwtcnVsZT0ibm9uemVybyIgc3Ryb2tlPSIjODA3QkQ1IiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+PC9zdmc+);background-position:center;background-size:1rem}html.theme-dark .Message.own .Audio .ProgressSpinner circle{stroke:var(--background-color)}.Message .File{position:relative}.Message .File .message-select-control{position:absolute;top:2rem;left:2rem;z-index:2}.Message.own .Message .album-item-select-wrapper{background:var(--color-background-own)}.Message .album-item-select-wrapper .message-select-control{position:absolute;top:0.438rem;right:0.438rem;left:unset}.Message .album-item-select-wrapper .media-inner{border:0 var(--select-background-color) solid;transition:border-width var(--select-transition)}.Message .album-item-select-wrapper img,.Message .album-item-select-wrapper video{transition:transform var(--select-transition)}.Message .album-item-select-wrapper.is-selected .message-select-control{background:var(--color-green)}.Message .album-item-select-wrapper.is-selected img,.Message .album-item-select-wrapper.is-selected video{transform:scale(var(--select-message-scale))}.Message.is-selected .message-select-control,.Message.is-forwarding .message-select-control{background:var(--color-green)}.Message.is-selected .Menu .bubble,.Message.is-forwarding .Menu .bubble{transition:none !important}.Message.is-in-document-group:not(.first-in-document-group)::before{top:0 !important}.Message.is-in-document-group:not(.first-in-document-group) .message-content{box-shadow:none;border-top-left-radius:0 !important;border-top-right-radius:0 !important}.Message.is-in-document-group:not(.first-in-document-group) .forwarded-message::before{top:-1.5rem}.Message.is-in-document-group:not(.last-in-document-group){margin-bottom:0}.Message.is-in-document-group:not(.last-in-document-group)::before{bottom:0 !important}.Message.is-in-document-group:not(.last-in-document-group) .message-content{border-bottom-left-radius:0 !important;border-bottom-right-radius:0 !important}.Message.is-in-document-group.is-in-selection-mode .Audio:not(.audio-is-selected) .message-select-control:not(.group-select),.Message.is-in-document-group.is-in-selection-mode .File:not(.file-is-selected) .message-select-control:not(.group-select){background:white}.Message.is-in-document-group.is-in-selection-mode .Audio:not(.audio-is-selected) .message-select-control:not(.group-select)::after,.Message.is-in-document-group.is-in-selection-mode .File:not(.file-is-selected) .message-select-control:not(.group-select)::after{content:'';width:1.25rem;height:1.25rem;border-radius:0.688rem;background:white;border:0.125rem rgba(0,0,0,0.2) solid;position:absolute}.Message.is-in-document-group.is-in-selection-mode.own .message-content .Audio:not(.audio-is-selected) .message-select-control:not(.group-select),.Message.is-in-document-group.is-in-selection-mode.own .message-content .File:not(.file-is-selected) .message-select-control:not(.group-select){background:var(--background-color);border-color:var(--background-color)}.Message.is-in-document-group.is-in-selection-mode.own .message-content .Audio:not(.audio-is-selected) .message-select-control:not(.group-select)::after,.Message.is-in-document-group.is-in-selection-mode.own .message-content .File:not(.file-is-selected) .message-select-control:not(.group-select)::after{background:var(--background-color);border-color:var(--color-message-meta-own)}.Message.is-in-document-group.focused .message-content,.Message.is-in-document-group.has-menu-open .message-content,.Message.is-in-document-group.is-forwarding .message-content,.Message.is-in-document-group.is-selected .message-content{background:var(--color-background-selected)}.Message.is-in-document-group.focused.own .message-content,.Message.is-in-document-group.has-menu-open.own .message-content,.Message.is-in-document-group.is-forwarding.own .message-content,.Message.is-in-document-group.is-selected.own .message-content{--background-color: var(--color-background-own-selected);background:var(--color-background-own-selected)}.Message.is-in-document-group .message-content-wrapper{width:17.1875rem}.Message.is-in-document-group .message-content{transition:background-color var(--select-transition)}.Message.is-in-document-group.own .message-content-wrapper{display:flex;justify-content:flex-end}.Message.is-in-document-group.own .message-content-wrapper .message-content{width:100%}.Message .album-item-select-wrapper{position:absolute}.Message .album-item-select-wrapper .message-select-control{position:absolute;z-index:2}.Message .message-select-control{position:absolute;left:0;bottom:0.25rem;width:1.5rem;height:1.5rem;border:2px solid white;border-radius:50%;z-index:var(--z-message-select-control);display:flex;align-items:center;justify-content:center;color:white;font-size:1rem;opacity:0;pointer-events:none;transition:opacity var(--select-transition)}.Message .message-select-control .icon-select{position:absolute;left:-3px;top:-3px;font-size:1.625rem}.theme-dark .Message .message-select-control{border-color:#ffffff80}.Message .Avatar{margin-right:0.3rem}.Message.is-in-document-group .message-content.document{padding:.25rem .5rem !important}.Message.is-in-document-group.last-in-document-group .message-content.document{padding-bottom:.5rem !important}.Message.is-in-document-group.first-in-document-group .message-content.document{padding-top:.5rem !important}.message-content,.Album,.media-inner,.message-content.media .media-inner img,.message-content.media .media-inner video,.message-content.custom-shape .media-inner img{border-top-left-radius:var(--border-top-left-radius);border-top-right-radius:var(--border-top-right-radius);border-bottom-left-radius:var(--border-bottom-left-radius);border-bottom-right-radius:var(--border-bottom-right-radius)}.media-inner video.full-media{background:transparent !important}.media-inner{overflow:hidden}.media-inner.small-image img{border-radius:0 !important}.Message{--border-top-left-radius: var(--border-radius-messages);--border-top-right-radius: var(--border-radius-messages);--border-bottom-left-radius: var(--border-radius-messages);--border-bottom-right-radius: var(--border-radius-messages)}.Message:not(.own).first-in-group:not(.last-in-group){--border-bottom-left-radius: var(--border-radius-messages-small)}.Message:not(.own):not(.first-in-group):not(.last-in-group){--border-top-left-radius: var(--border-radius-messages-small);--border-bottom-left-radius: var(--border-radius-messages-small)}.Message:not(.own).last-in-group:not(.first-in-group){--border-top-left-radius: var(--border-radius-messages-small)}.Message:not(.own).last-in-group{--border-bottom-left-radius: var(--border-radius-messages-small)}.Message:not(.own).last-in-group .message-content.has-appendix{--border-bottom-left-radius: 0}.Message.own.first-in-group:not(.last-in-group){--border-bottom-right-radius: var(--border-radius-messages-small)}.Message.own:not(.first-in-group):not(.last-in-group){--border-top-right-radius: var(--border-radius-messages-small);--border-bottom-right-radius: var(--border-radius-messages-small)}.Message.own.last-in-group:not(.first-in-group){--border-top-right-radius: var(--border-radius-messages-small)}.Message.own.last-in-group{--border-bottom-right-radius: var(--border-radius-messages-small)}.Message.own.last-in-group .message-content.has-appendix{--border-bottom-right-radius: 0}.Message .message-content.has-replies:not(.custom-shape) .media-inner,.Message .message-content.has-replies:not(.custom-shape) .Album,.Message .message-content.text .media-inner,.Message .message-content.text .Album{--border-bottom-left-radius: 0;--border-bottom-right-radius: 0}.Message .message-content.is-reply .EmbeddedMessage+.Album,.Message .message-content.is-reply .EmbeddedMessage+.Audio,.Message .message-content.is-reply .EmbeddedMessage+.File{margin-top:.375rem}.Message .message-content:not(.custom-shape).is-reply .media-inner,.Message .message-content:not(.custom-shape).is-reply .Album,.Message .message-content:not(.custom-shape).force-sender-name .Album,.Message .message-content:not(.is-forwarded) .message-title ~ .media-inner{--border-top-left-radius: 0;--border-top-right-radius: 0}.Message .message-content.is-forwarded .content-inner .message-title{margin-bottom:0.25rem}.Message .message-action-button{position:absolute;bottom:0;color:white;background-color:rgba(0,0,0,0.2);opacity:0;transition:opacity .2s ease}@media (pointer: coarse){.Message .message-action-button{opacity:1 !important}}.Message .message-action-button:hover,.Message .message-action-button:active,.Message .message-action-button:focus{background-color:rgba(0,0,0,0.28) !important}.Message:hover .message-action-button,.Message[data-is-document-group-hover] .message-action-button{opacity:1}.Message.own .message-action-button{left:-3rem}.Message:not(.own) .message-action-button{right:-3rem}.Message .bottom-marker{height:1px;width:1px;visibility:hidden}.Message .custom-shape .message-action-button{bottom:.25rem}.message-content{position:relative;max-width:var(--max-width)}@media (max-width: 600px){.message-content{max-width:calc(100vw - 6.25rem)}.Message.own .message-content,.MessageList.no-avatars .message-content{max-width:calc(100vw - 3.75rem)}@supports (max-width: min(29rem, 100vw - 6.25rem)){.message-content{max-width:min(29rem, 100vw - 6.25rem)}.MessageList.no-avatars .message-content{max-width:min(29rem, 100vw - 3.75rem)}.Message.own .message-content{max-width:min(30rem, 100vw - 3.75rem)}}.message-content.has-action-button{max-width:calc(100vw - 7rem)}.Message.own .message-content.has-action-button,.MessageList.no-avatars .message-content.has-action-button{max-width:calc(100vw - 4.5rem)}@supports (max-width: min(29rem, 100vw - 5.5rem)){.message-content.has-action-button{max-width:min(29rem, 100vw - 7rem)}.MessageList.no-avatars .message-content.has-action-button{max-width:min(29rem, 100vw - 4.5rem)}.Message.own .message-content.has-action-button{max-width:min(30rem, 100vw - 4.5rem)}}}.message-content .text-content{margin:0;word-break:break-word;line-height:1.3125;text-align:initial;display:flow-root;unicode-bidi:plaintext}.message-content .text-entity-link{unicode-bidi:plaintext}.message-content:not(.custom-shape) .text-content>.MessageMeta,.message-content.document>.MessageMeta{position:relative;top:.375rem;bottom:auto !important;float:right;line-height:1;height:calc(var(--message-meta-height, 1rem));margin-left:.4375rem;margin-right:-.5rem}.message-content:not(.custom-shape) .text-content>.MessageMeta .MessageOutgoingStatus .Transition,.message-content.document>.MessageMeta .MessageOutgoingStatus .Transition{max-height:calc(var(--message-meta-height, 1rem));overflow:hidden}html[data-message-text-size=\"12\"] .message-content:not(.custom-shape) .text-content>.MessageMeta,html[data-message-text-size=\"12\"] .message-content.document>.MessageMeta{top:.25rem}html[data-message-text-size=\"17\"] .message-content:not(.custom-shape) .text-content>.MessageMeta,html[data-message-text-size=\"17\"] .message-content.document>.MessageMeta{top:.4375rem}html[data-message-text-size=\"18\"] .message-content:not(.custom-shape) .text-content>.MessageMeta,html[data-message-text-size=\"19\"] .message-content:not(.custom-shape) .text-content>.MessageMeta,html[data-message-text-size=\"18\"] .message-content.document>.MessageMeta,html[data-message-text-size=\"19\"] .message-content.document>.MessageMeta{top:.5rem}html[data-message-text-size=\"20\"] .message-content:not(.custom-shape) .text-content>.MessageMeta,html[data-message-text-size=\"20\"] .message-content.document>.MessageMeta{top:.5625rem}.message-content:not(.custom-shape) .text-content:dir(rtl)>.MessageMeta,.message-content.document:dir(rtl)>.MessageMeta{float:left;margin-left:-.25rem;margin-right:.4375rem}.message-content.document:not(.text)::after{content:\"\";display:block;clear:both}.message-content.document:not(.text)>.MessageMeta{top:auto !important;bottom:-.5rem !important;margin-top:-.25rem}.message-content.document:not(.text)>.MessageMeta:not([dir=rtl]){margin-top:-1.25rem}.theme-dark .Message.own .message-content .text-entity-link{text-decoration:underline}.theme-dark .Message.own .message-content .text-entity-link:hover{text-decoration:none}.message-content:not(.custom-shape){font-size:var(--message-text-size, 1rem)}body.is-ios .message-content:not(.custom-shape){font-size:var(--message-text-size, 1.0625rem)}.message-content:not(.custom-shape)>.content-inner{min-width:0}.message-content .matching-text-highlight{background:#CAE3F7;border-radius:0.25rem;padding:0 0.125rem}.message-content .message-title{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:calc(var(--message-text-size, 1rem) - .125rem);font-weight:500;line-height:1.25rem;color:var(--accent-color);unicode-bidi:plaintext;display:flex}.message-content .message-title>.interactive{overflow:hidden;text-overflow:ellipsis}.message-content .message-title.interactive,.message-content .message-title>.interactive{cursor:pointer}.message-content .message-title.interactive:hover,.message-content .message-title>.interactive:hover{opacity:0.85}.message-content .message-title>.color-1{color:var(--color-user-1)}.message-content .message-title>.color-2{color:var(--color-user-2)}.message-content .message-title>.color-4{color:var(--color-user-4)}.message-content .message-title>.color-5{color:var(--color-user-5)}.message-content .message-title>.color-6{color:var(--color-user-6)}.message-content .message-title>.color-7{color:var(--color-user-7)}.message-content .message-title>.color-8{color:var(--color-user-8)}.theme-dark .Message.own .message-content .message-title>.color-1{color:var(--accent-color)}.message-content .message-title+.File{margin-top:.25rem}.message-content .message-title .via{padding-right:.25rem;font-weight:400}.message-content .message-title span+.via{padding-left:.25rem}.message-content .message-title .admin-title{flex:1;margin-left:1rem;text-align:right;font-weight:400;font-size:0.75rem;margin-top:-0.1rem;color:rgba(var(--color-text-meta-rgb), 0.75)}.Message.own .message-content .message-title .admin-title{color:var(--accent-color)}.message-content.has-shadow{box-shadow:0 1px 2px var(--color-default-shadow)}.message-content.has-solid-background,.message-content.has-background,.is-album .message-content{background:var(--background-color)}.message-content.has-solid-background{padding:.3125rem .5rem .375rem}.message-content.has-solid-background .forwarded-message>.text-content:not(.with-meta):last-child::after{content:'';display:inline-block;width:var(--meta-safe-area-size);height:1rem}.message-content:not(.has-appendix) .svg-appendix{display:none}.message-content .svg-appendix{overflow:hidden;position:absolute;bottom:-.0875rem;width:.5625rem;height:1.125rem;font-size:1rem !important}.message-content .svg-appendix .corner{fill:var(--background-color)}.Message.own .message-content .svg-appendix{right:-.551rem}.Message:not(.own) .message-content .svg-appendix{left:-.562rem}.message-content[data-has-custom-appendix] .svg-appendix .corner{fill:var(--appendix-bg)}.Message .message-content.has-appendix-thumb .svg-appendix{--background-color: #ccc;opacity:1;transition:opacity 500ms ease}.message-content.document{padding:.5rem !important}.theme-dark .message-content.document .File{--color-primary: var(--color-selection-highlight)}.message-content.document .File+.text-content{margin-top:.3125rem}.message-content.voice .message-title,.message-content.voice .Embedded,.message-content.audio .message-title,.message-content.audio .Embedded{margin-top:-.1875rem;margin-bottom:.1875rem}.message-content.voice{padding:.5rem !important}.message-content.voice .Voice+.text-content{margin-top:.5rem}.message-content.audio{min-width:17.1875rem;padding:.5rem .5rem .8125rem !important}.message-content.audio .Audio+.text-content{margin-top:.25rem}.message-content.audio:not(.has-replies) .Audio+.text-content{margin-bottom:-0.4375rem}.message-content:not(.custom-shape) .emoji{display:inline-block;width:1.25rem;background-size:1.25rem;color:transparent;margin-inline-end:1px;vertical-align:text-bottom}.message-content:not(.custom-shape) .emoji::selection{background-color:var(--color-selection-highlight-emoji);color:transparent}.message-content:not(.custom-shape) .text-content .emoji{width:calc(1.25 * var(--message-text-size, 1rem));height:calc(1.25 * var(--message-text-size, 1rem));background-size:calc(1.25 * var(--message-text-size, 1rem))}.message-content .no-media-corners{--border-top-left-radius: 0;--border-top-right-radius: 0}.message-content.custom-shape.is-via-bot{font-size:inherit !important}.message-content.custom-shape.is-via-bot .content-inner>.message-title{display:inline-flex;position:relative;top:.125rem;max-width:calc(100% - 3rem);margin-left:calc(100% - 3rem);padding:0 .5rem;background-color:var(--background-color);border-radius:var(--border-radius-messages)}.Message.own .message-content.custom-shape.is-via-bot .content-inner>.message-title{margin-left:-3rem}.message-content.custom-shape.is-via-bot .media-inner{margin-top:0.375rem}.message-content.media .media-inner,.WebPage .media-inner{display:flex;justify-content:center;align-items:center}.message-content.media .media-inner.interactive,.WebPage .media-inner.interactive{cursor:pointer}.message-content.media .media-inner.interactive.dark video,.WebPage .media-inner.interactive.dark video{background-color:#232323}.message-content.media.round.is-reply,.WebPage.round.is-reply{width:auto !important}.message-content.media.force-sender-name .media-inner,.message-content.media.force-sender-name .Album,.message-content.media.text .media-inner,.message-content.media.is-via-bot .media-inner,.message-content.media.is-reply .media-inner,.message-content.media.is-reply .Album,.WebPage.force-sender-name .media-inner,.WebPage.force-sender-name .Album,.WebPage.text .media-inner,.WebPage.is-via-bot .media-inner,.WebPage.is-reply .media-inner,.WebPage.is-reply .Album{margin-left:-0.5rem;margin-right:-0.5rem}.message-content.media.text .media-inner,.WebPage.text .media-inner{margin-top:-0.3125rem}.message-content.media.is-reply .media-inner,.message-content.media.force-sender-name .Album,.message-content.media.is-reply .Album,.message-content.media .message-title ~ .media-inner,.WebPage.is-reply .media-inner,.WebPage.force-sender-name .Album,.WebPage.is-reply .Album,.WebPage .message-title ~ .media-inner{margin-top:0.375rem;margin-bottom:-0.375rem}.message-content.media.text .media-inner,.message-content.media.text .Album,.WebPage.text .media-inner,.WebPage.text .Album{margin-bottom:0.375rem}.message-content.media .media-loading,.WebPage .media-loading{display:flex;align-items:center;justify-content:center}.message-content.media .media-loading:not(.open),.WebPage .media-loading:not(.open){opacity:0.5;transform:scale(0);transition:opacity .3s ease, transform .3s ease}.message-content.media .icon-large-play,.message-content.media .icon-download,.WebPage .icon-large-play,.WebPage .icon-download{position:absolute;display:flex;align-items:center;justify-content:center;color:#fff;opacity:0.7;transition:opacity 150ms}.message-content.media .icon-large-play:hover,.message-content.media .icon-download:hover,.WebPage .icon-large-play:hover,.WebPage .icon-download:hover{opacity:1}.message-content.media .icon-large-play:before,.message-content.media .icon-download:before,.WebPage .icon-large-play:before,.WebPage .icon-download:before{display:flex;align-items:center;justify-content:center;width:3.375rem;height:3.375rem;border-radius:50%;background:rgba(0,0,0,0.25)}.message-content.media .icon-download,.WebPage .icon-download{font-size:1.5rem}.message-content.media .icon-large-play,.WebPage .icon-large-play{font-size:2.5rem}.message-content.media .message-media-duration,.message-content.media .message-upload-progress,.WebPage .message-media-duration,.WebPage .message-upload-progress{background:rgba(0,0,0,0.25);color:#fff;font-size:0.75rem;position:absolute;left:.1875rem;top:.1875rem;z-index:1;padding:0 .375rem;border-radius:.75rem;line-height:1.125rem}.message-content.media .message-media-duration .icon-muted-chat,.WebPage .message-media-duration .icon-muted-chat{vertical-align:-.1875rem;margin-left:.375rem;font-size:1.0625rem}.message-content.custom-shape{line-height:1.2;font-size:10rem;display:flex;flex-wrap:wrap;align-items:flex-end}.message-content.custom-shape.has-comments{min-height:5.25rem;margin-top:0 !important}.message-content.custom-shape.has-comments.has-replies{min-height:6.5rem}.message-content.custom-shape.is-reply{max-width:100%}.message-content.custom-shape .reply-message{display:flex;align-items:flex-start;flex-direction:row-reverse;direction:ltr}.message-content.custom-shape .reply-message>p{margin-bottom:0}.message-content.custom-shape .reply-message .EmbeddedMessage{margin-left:0.5rem;border-radius:var(--border-radius-messages)}@media (max-width: 600px){.message-content.custom-shape .reply-message .EmbeddedMessage{max-width:calc(90vw - 13rem)}}@media (max-width: 340px){.message-content.custom-shape .reply-message .EmbeddedMessage{margin-left:-1rem;z-index:1;max-width:calc(90vw - 12rem)}}.message-content.custom-shape .text-content{margin-bottom:1rem}.message-content.custom-shape .media-inner{line-height:1;font-size:1rem;flex-shrink:0}.message-content.custom-shape .media-inner .full-media{top:0;left:0;bottom:0;right:0}.message-content.custom-shape .emoji{display:inline-block;color:transparent}.message-content.custom-shape .emoji::selection{background-color:var(--color-selection-highlight-emoji);color:transparent}.message-content.custom-shape.emoji-only .text-content{margin-bottom:0}.message-content.custom-shape.emoji-only-1{min-width:8rem;font-size:4.5rem}.message-content.custom-shape.emoji-only-1 .content-inner{height:7rem}.message-content.custom-shape.emoji-only-1 .text-content{line-height:1.5;text-align:center}.Message.was-edited .message-content.custom-shape.emoji-only-1{min-width:10rem}.message-content.custom-shape.emoji-only-1 .emoji{width:5rem;height:5rem}.message-content.custom-shape.emoji-only-2{font-size:4rem;margin-top:.5rem;min-width:10rem}.message-content.custom-shape.emoji-only-2.has-comments{margin-top:1.25rem}.Message.was-edited .message-content.custom-shape.emoji-only-2{min-width:12rem}.message-content.custom-shape.emoji-only-2 .emoji{width:4rem;height:4rem}.message-content.custom-shape.emoji-only-3{font-size:3rem;margin-top:1.75rem;min-width:12rem}.message-content.custom-shape.emoji-only-3.has-comments{margin-top:2.5rem}.Message.was-edited .message-content.custom-shape.emoji-only-3{min-width:14rem}.message-content.custom-shape.emoji-only-3 .emoji{width:3rem;height:3rem}.Message:not(.own) .message-content.custom-shape{--hover-color: var(--color-reply-hover);--active-color: var(--color-reply-active)}.Message.own .message-content.custom-shape{--hover-color: var(--color-reply-own-hover);--active-color: var(--color-reply-own-active)}.Message.own .message-content.custom-shape .reply-message{flex-direction:row}.Message.own .message-content.custom-shape .reply-message .EmbeddedMessage{margin-right:0.5rem}@media (max-width: 340px){.Message.own .message-content.custom-shape .reply-message .EmbeddedMessage{margin-left:0;z-index:1;max-width:calc(90vw - 11.5rem)}}.forwarded-message{--border-top-left-radius: var(--border-radius-messages-small);--border-top-right-radius: var(--border-radius-messages-small);--border-bottom-left-radius: var(--border-radius-messages-small);--border-bottom-right-radius: var(--border-radius-messages-small)}.message-content.poll .forwarded-message{margin-bottom:0.5rem}.message-content:not(.custom-shape) .forwarded-message{position:relative;margin-top:0.25rem;padding-left:0.625rem}.message-content:not(.custom-shape) .forwarded-message::before{content:'';display:block;position:absolute;top:0;bottom:0;left:0.05rem;width:2px;background:var(--accent-color);border-radius:2px}.message-content:not(.custom-shape) .forwarded-message:dir(rtl){padding-inline-start:0.625rem}.message-content:not(.custom-shape) .forwarded-message:dir(rtl)::before{left:auto;right:0.05rem}.forwarded-message>.media-inner{margin:0 !important;margin-bottom:0.25rem !important}.long-word-break-all{word-break:break-all}.text-entity-link{color:var(--color-links) !important;text-decoration:none;word-break:break-word;cursor:pointer;unicode-bidi:initial}.text-entity-link:hover,.text-entity-link:active,.text-entity-link:visited{color:var(--color-links-hover) !important;text-decoration:underline}.text-entity-code,.text-entity-pre{color:var(--color-code);background:var(--color-code-bg);white-space:pre-wrap;margin:0;padding:1px 2px;border-radius:4px;font-size:calc(var(--message-text-size, 1rem) - 0.0625rem)}\n",".ContactGreeting{width:100%;height:100%;display:flex;align-items:center;justify-content:center;text-align:center}.ContactGreeting .wrapper{display:inline-flex;flex-direction:column;align-items:center;background:var(--pattern-color);width:14.5rem;padding:.75rem 1rem;border-radius:1.5rem;color:#fff}.ContactGreeting .title{font-weight:500;margin-bottom:0}.ContactGreeting .description{font-size:.9375rem;margin-bottom:0}.ContactGreeting .sticker{margin:2rem 0 1rem;height:10rem;width:10rem;cursor:pointer}.ContactGreeting .sticker .thumbnail{height:10rem;width:10rem}\n",".NoMessages{width:100%;height:100%;display:flex;align-items:center;justify-content:center}.NoMessages .icon{font-size:5rem;margin:0 auto 1rem}.NoMessages .wrapper{display:inline-flex;flex-direction:column;background:var(--pattern-color);max-width:20rem;padding:.75rem 1rem;border-radius:1.5rem;color:#fff}.NoMessages .wrapper[dir=rtl]{text-align:right}.NoMessages .title{font-weight:500;font-size:1rem;margin-bottom:.25rem;text-align:center;unicode-bidi:plaintext}.NoMessages .description{font-size:.9375rem;margin:0;padding:0;list-style:none;unicode-bidi:plaintext}.NoMessages .list-checkmarks{font-size:.9375rem;margin:.25rem 0 0;padding:0;list-style:none;unicode-bidi:plaintext;line-height:1.8}.NoMessages .list-checkmarks li::before{content:'✓';margin-inline-end:.5rem}\n",".MessageList{flex:1;width:100%;overflow-anchor:none;overflow:scroll;overflow-x:hidden;overflow-y:overlay;margin-bottom:.5rem}.mask-image-enabled .MessageList{-webkit-mask-image:linear-gradient(to top, transparent 0, #000 0.5rem);mask-image:linear-gradient(to top, transparent 0, #000 0.5rem)}@media (pointer: coarse){.MessageList{-webkit-user-select:none;user-select:none;touch-callout:none}.MessageList.select-mode-active{-webkit-user-select:auto;user-select:auto;touch-callout:default}}.MessageList.no-avatars .Message>.Avatar{display:none}.MessageList .messages-container{width:100%;max-width:var(--messages-container-width);min-height:100%;margin:0 auto;display:flex;justify-content:flex-end;flex-direction:column;padding:1rem 1rem 0 1.125rem}.force-messages-scroll .MessageList .messages-container{margin-top:100vh !important}@media (max-width: 600px){.MessageList .messages-container{width:100vw;padding:2.75rem 0.5rem 0;margin:0}}.MessageList.no-composer{margin-bottom:0}.MessageList.no-composer .last-in-list{margin-bottom:1rem}.MessageList.select-mode-active,.MessageList.type-pinned{margin-bottom:0}.MessageList.select-mode-active .last-in-list,.MessageList.type-pinned .last-in-list{margin-bottom:5.625rem}@media (max-width: 600px){.MessageList.select-mode-active .last-in-list,.MessageList.type-pinned .last-in-list{margin-bottom:4.25rem}}.MessageList.select-mode-active .last-in-list.ActionMessage,.MessageList.type-pinned .last-in-list.ActionMessage{padding-bottom:0.125rem}.MessageList .Message,.MessageList .ActionMessage{position:relative;opacity:1;transform:scale(1);transition:opacity .2s ease, transform .2s ease}.MessageList .Message:not(.open),.MessageList .ActionMessage:not(.open){transform:scale(0.8);opacity:0}.MessageList .Message.open.shown,.MessageList .ActionMessage.open.shown{transform:none}.MessageList .Message::before,.MessageList .ActionMessage::before{content:\"\";position:absolute;top:-0.1875rem;bottom:-0.1875rem;left:-50vw;right:-50vw;background:black;z-index:-1;opacity:0;transition:opacity var(--select-transition)}body.animation-level-0 .MessageList .Message::before,body.animation-level-0 .MessageList .ActionMessage::before{transition:none !important}.MessageList .Message:not(.last-in-group)::before,.MessageList .ActionMessage:not(.last-in-group)::before{bottom:-0.1875rem}.MessageList .Message:not(.first-in-group)::before,.MessageList .ActionMessage:not(.first-in-group)::before{top:-0.1875rem}.MessageList .Message.focused::before,.MessageList .ActionMessage.focused::before{transition:none !important}.MessageList .Message.focused::before,.MessageList .Message.is-forwarding::before,.MessageList .Message.is-selected::before,.MessageList .Message.has-menu-open::before,.MessageList .ActionMessage.focused::before,.MessageList .ActionMessage.is-forwarding::before,.MessageList .ActionMessage.is-selected::before,.MessageList .ActionMessage.has-menu-open::before{opacity:0.1}.MessageList>.empty{width:100%;height:100%;display:flex;align-items:center;justify-content:center}.MessageList .sticky-date,.MessageList .local-action-message,.MessageList .ActionMessage,.MessageList .empty{text-align:center}.MessageList .sticky-date>span,.MessageList .local-action-message>span,.MessageList .ActionMessage>span,.MessageList .empty>span{display:inline-block;background:var(--pattern-color);color:white;font-size:calc(var(--message-text-size, 1rem) - .0625rem);font-weight:500;line-height:1.75;padding:0 .5rem;border-radius:2rem;word-break:break-word}body.is-ios .MessageList .sticky-date>span,body.is-macos .MessageList .sticky-date>span,body.is-ios .MessageList .local-action-message>span,body.is-macos .MessageList .local-action-message>span,body.is-ios .MessageList .ActionMessage>span,body.is-macos .MessageList .ActionMessage>span,body.is-ios .MessageList .empty>span,body.is-macos .MessageList .empty>span{font-size:calc(var(--message-text-size, 1rem) - .125rem)}.MessageList .sticky-date>span .emoji-small,.MessageList .local-action-message>span .emoji-small,.MessageList .ActionMessage>span .emoji-small,.MessageList .empty>span .emoji-small{vertical-align:text-bottom;width:calc(1.25 * var(--message-text-size, 1rem));height:calc(1.25 * var(--message-text-size, 1rem));background-size:calc(1.25 * var(--message-text-size, 1rem))}.MessageList .sticky-date.rich>span,.MessageList .local-action-message.rich>span,.MessageList .ActionMessage.rich>span,.MessageList .empty.rich>span{max-width:80%;text-align:left}.MessageList .sticky-date.rich a,.MessageList .sticky-date.rich a:visited,.MessageList .local-action-message.rich a,.MessageList .local-action-message.rich a:visited,.MessageList .ActionMessage.rich a,.MessageList .ActionMessage.rich a:visited,.MessageList .empty.rich a,.MessageList .empty.rich a:visited{color:var(--color-links-darker) !important}.MessageList .sticky-date.rich a:hover,.MessageList .sticky-date.rich a:active,.MessageList .local-action-message.rich a:hover,.MessageList .local-action-message.rich a:active,.MessageList .ActionMessage.rich a:hover,.MessageList .ActionMessage.rich a:active,.MessageList .empty.rich a:hover,.MessageList .empty.rich a:active{color:var(--color-links-darker-hover) !important}.MessageList .sticky-date{margin-top:1rem;margin-bottom:1rem;z-index:var(--z-sticky-date);pointer-events:none;opacity:1;transition:opacity .3s ease}body:not(.is-scrolling-messages) .MessageList .sticky-date.stuck{opacity:0}body:not(.is-scrolling-messages) .MessageList .sticky-date.stuck span{pointer-events:none}body.animation-level-0 .MessageList .sticky-date{transition:none}.MessageList .sticky-date.interactive{cursor:pointer}.MessageList .sticky-date span{pointer-events:auto}.MessageList.scrolled:not(.is-animating) .sticky-date{position:sticky;top:0.625rem}.MessageList.is-animating{overflow:hidden}.MessageList.is-animating .message-select-control{display:none !important}.has-header-tools .MessageList .sticky-date{top:3.75rem}.MessageList .local-action-message,.MessageList .ActionMessage{margin-top:0.5rem;margin-bottom:0.5rem}.MessageList .ActionMessage .action-link{cursor:pointer}.MessageList .ActionMessage .action-link:hover{text-decoration:underline}.MessageList .sticky-date+.ActionMessage{margin-top:-0.5rem}@media (min-width: 1276px){.MessageList{width:100%;transform:translate3d(0, 0, 0);transition:transform var(--layer-transition)}.MessageList .messages-container{width:calc(100% - var(--right-column-width))}body.animation-level-0 .MessageList{transition:none}#Main.right-column-open .MessageList{transform:translate3d(calc(var(--right-column-width) / -2), 0, 0)}body:not(.animating-right-column) #Main.right-column-open .MessageList.select-mode-active,#Main.right-column-open .MessageList:not(.select-mode-active),body.animating-right-column .MessageList:not(.select-mode-active){width:calc(100% - var(--right-column-width))}body:not(.animating-right-column) #Main.right-column-open .MessageList.select-mode-active .messages-container,#Main.right-column-open .MessageList:not(.select-mode-active) .messages-container,body.animating-right-column .MessageList:not(.select-mode-active) .messages-container{width:100%}}@media (max-width: 600px){.MessageList{transition:transform var(--layer-transition)}body.enable-symbol-menu-transforms .MessageList{transform:translate3d(0, 0, 0)}body.is-symbol-menu-open .MessageList{transform:translate3d(0, calc(-1 * (var(--symbol-menu-height) + var(--symbol-menu-footer-height))), 0)}}.MessageList.select-mode-active,.MessageList.has-focus-highlight,body.has-context-menu .MessageList,.animating>div>.MessageList{padding-right:0}.MessageList.select-mode-active::-webkit-scrollbar,.MessageList.has-focus-highlight::-webkit-scrollbar,body.has-context-menu .MessageList::-webkit-scrollbar,.animating>div>.MessageList::-webkit-scrollbar{width:0}@supports (scrollbar-width: none){.MessageList.select-mode-active,.MessageList.has-focus-highlight,body.has-context-menu .MessageList,.animating>div>.MessageList{padding-right:.6875rem;scrollbar-width:none}}.is-safari .MessageList.select-mode-active,.is-safari .MessageList.has-focus-highlight,.is-safari.has-context-menu .messages-layout .MessageList{padding-right:.375rem}\n",".ScrollDownButton{--base-bottom-pos: 6rem;position:absolute;bottom:var(--base-bottom-pos);right:1rem;opacity:0;transform:translateY(4.5rem);transition:transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),opacity 0.2s ease;z-index:10;pointer-events:none}body.animation-level-0 .ScrollDownButton{transform:none !important;transition:opacity .15s}@media (max-width: 600px){.ScrollDownButton{right:0.5rem;bottom:4.5rem}}.ScrollDownButton-inner{display:flex;flex-direction:column;align-items:center}.ScrollDownButton-inner>.Button{box-shadow:0 1px 2px var(--color-default-shadow)}.ScrollDownButton-inner>.Button i{font-size:1.75rem}@media (min-width: 1276px){.ScrollDownButton-inner{transform:translateX(0);transition:transform var(--layer-transition)}body.animation-level-0 .ScrollDownButton-inner{transition:none !important}#Main.right-column-open .ScrollDownButton-inner{transform:translateX(calc(-1 * var(--right-column-width)))}}@media (max-width: 600px){.ScrollDownButton-inner>.Button{width:2.875rem;height:2.875rem}}.ScrollDownButton.revealed{transform:translateY(0);opacity:1;pointer-events:all}.ScrollDownButton.revealed.no-composer{transform:translateY(4rem)}.ScrollDownButton .unread-count{min-width:1.5rem;height:1.5rem;padding:0 .45rem;border-radius:0.75rem;font-size:0.875rem;line-height:1.5rem;font-weight:500;text-align:center;position:absolute;top:-0.3rem;right:-0.3rem;background:var(--color-green);color:white;pointer-events:none}@media (max-width: 600px){.ScrollDownButton .unread-count{top:-0.7rem;right:auto}}@media (max-width: 600px){body.is-symbol-menu-open .ScrollDownButton{bottom:calc(var(--base-bottom-pos) + var(--symbol-menu-height) + var(--symbol-menu-footer-height))}}\n",".BotKeyboardMenu .bubble{width:100% !important;max-width:27rem;border-radius:var(--border-radius-default-small)}.BotKeyboardMenu .content{display:flex;flex-direction:column;padding:.1875rem .625rem;max-height:80vh;overflow:auto}@media (max-width: 600px){.BotKeyboardMenu .content{max-height:75vh}}.BotKeyboardMenu .content .row{display:flex;flex-direction:row}.BotKeyboardMenu .content .row+.row{margin-top:.375rem}.BotKeyboardMenu .content .Button{flex:1;width:auto;height:auto;min-height:3.0625rem;border-radius:var(--border-radius-messages-small);border:2px solid var(--color-primary);background:var(--color-background);color:var(--color-primary);font-weight:500;text-transform:none}.BotKeyboardMenu .content .Button:hover{color:#fff;border-color:var(--color-primary-shade);background:var(--color-primary-shade)}.BotKeyboardMenu .content .Button+.Button{margin-left:.375rem}\n",".ComposerEmbeddedMessage{height:2.625rem;transition:height 150ms ease-out, opacity 150ms ease-out}.select-mode-active+.middle-column-footer .ComposerEmbeddedMessage{display:none}.ComposerEmbeddedMessage:not(.open){height:0 !important}body.animation-level-0 .ComposerEmbeddedMessage{transition:none !important}.ComposerEmbeddedMessage>div{display:flex;align-items:center;padding-right:0.625rem;padding-top:0.45rem}.ComposerEmbeddedMessage>div>.Button{flex-shrink:0;background:none !important;width:2.125rem;height:2.125rem;margin:0 0.625rem;padding:0;align-self:center}\n",".WebPagePreview{height:2.625rem;transition:height 150ms ease-out, opacity 150ms ease-out;--accent-color: var(--color-primary)}body.animation-level-0 .WebPagePreview{transition:none !important}.select-mode-active+.middle-column-footer .WebPagePreview{display:none}.WebPagePreview:not(.open){height:0 !important}.WebPagePreview>div{display:flex;align-items:center;padding-right:0.625rem;padding-top:0.45rem}.ComposerEmbeddedMessage+.WebPagePreview{margin-top:0.75rem}.WebPagePreview>div>.Button{flex-shrink:0;background:none !important;width:2.125rem;height:2.125rem;margin:0 0.625rem;padding:0;align-self:center}.WebPagePreview .WebPage{flex-grow:1;margin:0.1875rem 0 0.1875rem 0.125rem;max-width:calc(100% - 3.375rem)}.WebPagePreview .WebPage::before{top:.1rem;bottom:.05rem}.WebPagePreview .WebPage.with-video .media-inner{display:none}.WebPagePreview .WebPage .site-title,.WebPagePreview .WebPage .site-description{flex:1;max-width:100%;max-height:1rem}.WebPagePreview .WebPage .site-title{margin-top:.125rem;margin-bottom:0.1875rem}.WebPagePreview .WebPage .site-description{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}\n",".Composer{align-items:flex-end}.select-mode-active+.middle-column-footer .Composer{position:absolute;padding-right:2rem;bottom:0}@media (max-width: 600px){.select-mode-active+.middle-column-footer .Composer{padding-right:1rem}}.select-mode-active+.middle-column-footer .Composer::before{right:2.125rem}@media (max-width: 600px){.select-mode-active+.middle-column-footer .Composer::before{right:1rem}}.select-mode-active+.middle-column-footer .Composer .svg-appendix{opacity:0}.Composer .form-control{--border-width: 0}.Composer>.Button{flex-shrink:0;margin-left:.5rem}@media (max-width: 600px){.Composer>.Button{width:2.875rem;height:2.875rem}}.Composer>.Button .icon-send,.Composer>.Button .icon-microphone-alt,.Composer>.Button .icon-check{position:absolute}.Composer>.Button:not(:active):not(:focus):not(:hover) .icon-send,.Composer>.Button:not(:active):not(:focus):not(:hover) .icon-check{color:var(--color-primary)}.Composer>.Button.cancel{position:relative;z-index:1}.Composer>.Button.cancel:hover,.Composer>.Button.cancel.active{background:var(--color-chat-hover)}.Composer>.Button.recording{position:relative;z-index:0;transition:box-shadow .1s}.Composer>.Button.send .icon-send{animation:grow-icon .4s ease-out}.Composer>.Button.send .icon-microphone-alt,.Composer>.Button.send .icon-check{animation:hide-icon .4s forwards ease-out}.Composer>.Button.record .icon-microphone-alt{animation:grow-icon .4s ease-out}.Composer>.Button.record .icon-send,.Composer>.Button.record .icon-check{animation:hide-icon .4s forwards ease-out}.Composer>.Button.edit .icon-send,.Composer>.Button.edit .icon-microphone-alt{animation:hide-icon .4s forwards ease-out}.Composer>.Button.edit .icon-check{animation:grow-icon .4s ease-out}.Composer>.Button.not-ready>i{animation-duration:0ms !important}body.animation-level-0 .Composer>.Button .icon-send,body.animation-level-0 .Composer>.Button .icon-microphone-alt,body.animation-level-0 .Composer>.Button .icon-check,body.animation-level-1 .Composer>.Button .icon-send,body.animation-level-1 .Composer>.Button .icon-microphone-alt,body.animation-level-1 .Composer>.Button .icon-check{animation-duration:0ms !important}.Composer .mobile-symbol-menu-button{width:2.875rem;height:2.875rem;position:relative}.Composer .mobile-symbol-menu-button .icon-smile,.Composer .mobile-symbol-menu-button .icon-keyboard,.Composer .mobile-symbol-menu-button .Spinner{position:absolute}.Composer .mobile-symbol-menu-button .Spinner{--spinner-size: 1.5rem}.Composer .mobile-symbol-menu-button .icon-smile{animation:grow-icon .4s ease-out}.Composer .mobile-symbol-menu-button .icon-keyboard,.Composer .mobile-symbol-menu-button .Spinner{animation:hide-icon .4s forwards ease-out}.Composer .mobile-symbol-menu-button.not-ready>i{animation-duration:0ms !important}.Composer .mobile-symbol-menu-button.is-loading .Spinner{animation:grow-icon .4s ease-out}.Composer .mobile-symbol-menu-button.is-loading .icon-keyboard,.Composer .mobile-symbol-menu-button.is-loading .icon-smile{animation:hide-icon .4s forwards ease-out}.Composer .mobile-symbol-menu-button.menu-opened .icon-keyboard{animation:grow-icon .4s ease-out}.Composer .mobile-symbol-menu-button.menu-opened .icon-smile,.Composer .mobile-symbol-menu-button.menu-opened .Spinner{animation:hide-icon .4s forwards ease-out}#message-compose{flex-grow:1;max-width:calc(100% - 4rem);background:var(--color-background);border-radius:var(--border-radius-messages);border-bottom-right-radius:0;box-shadow:0 1px 2px var(--color-default-shadow);position:relative;z-index:1}#message-compose .svg-appendix{position:absolute;bottom:-.1875rem;right:-.551rem;width:.5625rem;height:1.25rem;transition:opacity 200ms;font-size:1rem !important}#message-compose .svg-appendix .corner{fill:var(--color-background)}@media (max-width: 600px){#message-compose{max-width:calc(100% - 3rem)}}.message-input-wrapper{display:flex}.message-input-wrapper>.Spinner{align-self:center;--spinner-size: 1.5rem}.message-input-wrapper>.Button{flex-shrink:0;background:none !important;width:3.375rem;height:3.375rem;margin:0;padding:0.625rem;align-self:flex-end}@media (max-width: 600px){.message-input-wrapper>.Button{width:2.875rem;height:2.875rem;margin:0 0.25rem}}.message-input-wrapper>.Button+.Button{margin-left:-.25rem}.message-input-wrapper>.Button.scheduled-button i::after{content:'';position:absolute;top:.75rem;right:.75rem;border:0.1875rem solid var(--color-background);box-sizing:content-box;width:.5rem;height:.5rem;border-radius:50%;background:var(--color-green-darker);box-shadow:-0.375rem -0.25rem 0 -0.1875rem var(--color-background)}@media (max-width: 600px){.message-input-wrapper>.Button.scheduled-button i::after{top:.5rem;right:.5rem}}.message-input-wrapper>.input-group{flex-grow:1;margin-bottom:0}.message-input-wrapper .recording-state{display:inline-block;position:relative;line-height:3.5rem;height:3.5rem;padding:0 3.125rem 0 1rem}.message-input-wrapper .recording-state::after{content:'';width:10px;height:10px;background:var(--color-error);border-radius:5px;position:absolute;top:50%;margin-top:-5px;right:1.375rem}@media (max-width: 600px){.message-input-wrapper .recording-state{height:2.875rem;line-height:2.875rem}}#message-input-text,#caption-input-text{position:relative}#message-input-text .form-control,#caption-input-text .form-control{padding:calc((3.25rem - var(--composer-text-size, 1rem) * 1.375) / 2 - var(--border-width, 0) * 2) calc(.9rem - var(--border-width));overflow:hidden;line-height:1.375;font-family:Roboto, -apple-system, \"Apple Color Emoji\", \"Helvetica Neue\", sans-serif;unicode-bidi:plaintext;text-align:initial;font-size:var(--composer-text-size, 1rem)}body.is-ios #message-input-text .form-control,body.is-macos #message-input-text .form-control,body.is-ios #caption-input-text .form-control,body.is-macos #caption-input-text .form-control{font-family:system-ui, -apple-system, BlinkMacSystemFont, \"Roboto\", \"Apple Color Emoji\", \"Helvetica Neue\", sans-serif}#message-input-text .form-control.overflown,#caption-input-text .form-control.overflown{overflow-y:auto;overflow-x:hidden}#message-input-text .form-control.touched+.placeholder-text,#message-input-text .form-control:focus+.placeholder-text,#caption-input-text .form-control.touched+.placeholder-text,#caption-input-text .form-control:focus+.placeholder-text{display:none}#message-input-text .form-control.focus-disabled,#caption-input-text .form-control.focus-disabled{pointer-events:none}#message-input-text .forced-placeholder,#message-input-text .placeholder-text,#caption-input-text .forced-placeholder,#caption-input-text .placeholder-text{position:absolute;color:var(--color-placeholders);pointer-events:none;unicode-bidi:plaintext;text-align:initial;line-height:1.3125;font-size:var(--composer-text-size, 1rem);top:calc((3.25rem - var(--composer-text-size, 1rem) * 1.375) / 2);bottom:auto}#message-input-text .forced-placeholder,#caption-input-text .forced-placeholder{z-index:var(--z-below);left:0;white-space:nowrap;overflow:hidden;max-width:100%;text-overflow:ellipsis}#message-input-text[dir=rtl] .placeholder-text,#caption-input-text[dir=rtl] .placeholder-text{right:0}#message-input-text .text-entity-link,#caption-input-text .text-entity-link{color:var(--color-links) !important;cursor:default;text-decoration:none}#message-input-text .text-entity-link:hover,#message-input-text .text-entity-link:active,#message-input-text .text-entity-link:visited,#caption-input-text .text-entity-link:hover,#caption-input-text .text-entity-link:active,#caption-input-text .text-entity-link:visited{color:var(--color-links-hover) !important}#message-input-text .clone,#caption-input-text .clone{position:absolute;top:0;left:0;opacity:0;pointer-events:none;z-index:-10;unicode-bidi:plaintext;text-align:initial}#message-input-text{flex-grow:1}#message-input-text .form-control{margin-bottom:0;background:transparent !important;border:none !important;border-radius:0 !important;box-shadow:none !important;caret-color:var(--color-text);min-height:3.5rem;max-height:26rem;line-height:1.3125;padding:calc((3.5rem - var(--composer-text-size, 1rem) * 1.3125) / 2) 0;transition:height 100ms ease}@media (max-width: 600px){#message-input-text .form-control{height:2.875rem;min-height:2.875rem;max-height:16rem;padding:calc((2.875rem - var(--composer-text-size, 1rem) * 1.3125) / 2) 0;overflow:auto}}body.animation-level-0 #message-input-text .form-control{transition:none !important}#message-input-text .forced-placeholder,#message-input-text .placeholder-text{top:calc((3.5rem - var(--composer-text-size, 1rem) * 1.3125) / 2)}@media (max-width: 600px){#message-input-text .forced-placeholder,#message-input-text .placeholder-text{top:calc((2.875rem - var(--composer-text-size, 1rem) * 1.3125) / 2)}}#message-input-text:not(:only-child) .form-control{padding-left:0;padding-right:0}.ComposerEmbeddedMessage+.message-input-wrapper #message-input-text .form-control.overflown,.WebPagePreview+.message-input-wrapper #message-input-text .form-control.overflown{margin-top:0.75rem}#message-input-text .emoji{width:1.25rem;height:1.25rem;margin:0 1px -5px;vertical-align:0;pointer-events:none}#caption-input-text .form-control{height:3.25rem;min-height:3.25rem;max-height:15rem}#caption-input-text .placeholder-text{bottom:.8125rem;left:.90625rem}.composer-tooltip{position:absolute;bottom:calc(100% + .5rem);left:0;width:100%;background:var(--color-background);border-radius:var(--border-radius-messages);padding:0.5rem 0;max-height:15rem;overflow-x:hidden;overflow-y:auto;overflow-y:overlay;box-shadow:0 1px 2px var(--color-default-shadow);opacity:0;transform:translateY(1.5rem);transform-origin:bottom;transition:opacity var(--layer-transition),transform var(--layer-transition)}.composer-tooltip:not(.shown){display:none}.composer-tooltip.open{opacity:1;transform:translateY(0)}.composer-tooltip .Loading{margin:1rem 0}\n","#middle-column-bg{position:absolute;top:0;left:0;bottom:0;right:0;overflow:hidden;z-index:-1}#middle-column-bg::before,#middle-column-bg::after{content:\"\";display:block;position:absolute;top:0;left:0;bottom:0;right:0;background-color:var(--theme-background-color)}#middle-column-bg::after{background-position:center;background-repeat:no-repeat;background-size:cover}.theme-light #middle-column-bg::after{background-image:url(chat-bg.f607e788298d8a7de37a3b39b76c1efa.jpg)}@media (max-width: 600px){.theme-light #middle-column-bg::after{background-image:url(chat-bg-mobile.3ebe59c803c10092f2233e6e00ab2492.jpg)}}body:not(.animation-level-0) #root #middle-column-bg::after{transition:transform var(--layer-transition),opacity 0.2s !important}body.animation-level-0 #middle-column-bg::after{transition:none}.custom-bg-color:not(.custom-bg-image)>#middle-column-bg::after{opacity:0}.custom-bg-image>#middle-column-bg::after{background-image:var(--custom-background) !important;filter:none;transform:scale(1.1)}.custom-bg-image.blurred>#middle-column-bg::after{filter:blur(12px)}@media screen and (min-width: 1276px){body.animation-level-2 #middle-column-bg::after{margin:-16rem -5rem -20rem 0;overflow:hidden;transform:scale(1);transform-origin:left center;transition:transform var(--layer-transition)}body.animation-level-2 #Main.right-column-open #middle-column-bg::after{transform:scale(0.67) !important}}#MiddleColumn{display:flex;justify-content:center;height:100%;position:relative;z-index:1}@media (max-width: 600px){#MiddleColumn{overflow:hidden}}#MiddleColumn .messages-layout{--slide-transition: 450ms cubic-bezier(0.25, 1, 0.5, 1);display:flex;flex-direction:column;align-items:center;width:100%;height:100%;position:relative;overflow:hidden}#MiddleColumn .messages-layout>.Transition{width:100%;height:100%;overflow:hidden}#MiddleColumn .messages-layout>.Transition>div{display:flex;flex-direction:column;align-items:center}#MiddleColumn .messaging-disabled-inner{width:100%;padding:1rem;border-radius:var(--border-radius-messages);background:var(--color-background);color:var(--color-text-secondary);text-align:center;box-shadow:0 1px 2px var(--color-default-shadow)}#MiddleColumn .Composer #message-compose{transform:scaleX(1) translateX(0);transition:transform var(--select-transition),border-bottom-right-radius var(--select-transition)}#MiddleColumn .Composer #message-compose::before{transform:scaleX(-1) translateX(0);transition:transform var(--select-transition)}body.animation-level-0 #MiddleColumn .Composer #message-compose,body.animation-level-0 #MiddleColumn .Composer #message-compose::before{transition:none !important}#MiddleColumn .Composer .message-input-wrapper,#MiddleColumn .Composer::before{opacity:1;transition:opacity var(--select-transition)}body.animation-level-0 #MiddleColumn .Composer .message-input-wrapper,body.animation-level-0 #MiddleColumn .Composer::before{transition:none !important}#MiddleColumn .Composer>.Button{opacity:1;transform:scale(1);transition:opacity var(--select-transition),transform var(--select-transition)}body.animation-level-0 #MiddleColumn .Composer>.Button{transition:none !important}#MiddleColumn .Composer.hover-disabled,#MiddleColumn .Composer:not(.shown){pointer-events:none}#MiddleColumn .Composer:not(.shown) .ComposerEmbeddedMessage{height:0}#MiddleColumn .Composer:not(.shown) #message-compose{transform:scaleX(var(--composer-hidden-scale, 1)) translateX(var(--composer-translate-x, 0));border-bottom-right-radius:var(--border-radius-messages)}#MiddleColumn .Composer:not(.shown) #message-compose::before{transform:scaleX(-1) translateX(200%)}#MiddleColumn .Composer:not(.shown) #editable-message-text{height:3.5rem !important}@media (max-width: 600px){#MiddleColumn .Composer:not(.shown) #editable-message-text{height:2.5rem !important}}#MiddleColumn .Composer:not(.shown) .message-input-wrapper,#MiddleColumn .Composer:not(.shown)::before{opacity:0}#MiddleColumn .Composer:not(.shown)>.Button{opacity:0 !important;transform:scale(0.5)}#MiddleColumn .messaging-disabled{transform:scaleX(1);transition:transform var(--select-transition)}#MiddleColumn .messaging-disabled .messaging-disabled-inner span{opacity:1;transition:opacity var(--select-transition)}body.animation-level-0 #MiddleColumn .messaging-disabled .messaging-disabled-inner span{transition:none !important}body.animation-level-0 #MiddleColumn .messaging-disabled{transition:none !important}#MiddleColumn .messaging-disabled:not(.shown){transform:scaleX(var(--composer-hidden-scale, 1));pointer-events:none}#MiddleColumn .messaging-disabled:not(.shown) .messaging-disabled-inner span{opacity:0}#MiddleColumn .middle-column-footer{width:100%;max-width:var(--messages-container-width);padding:0 1rem;position:relative;display:flex;align-items:flex-end;z-index:var(--z-middle-footer);transform:translate3d(0, 0, 0);transition:transform var(--layer-transition)}body.animation-level-0 #MiddleColumn .middle-column-footer{transition:none !important}@media (min-width: 1276px){#MiddleColumn .middle-column-footer{width:calc(100% - var(--right-column-width))}#Main.right-column-open #MiddleColumn .middle-column-footer{transform:translate3d(calc(var(--right-column-width) / -2), 0, 0)}}@media (max-width: 600px){#MiddleColumn .middle-column-footer{padding:0 0.5rem}body.is-symbol-menu-open #MiddleColumn .middle-column-footer{transform:translate3d(0, calc(-1 * (var(--symbol-menu-height) + var(--symbol-menu-footer-height))), 0)}}#MiddleColumn .middle-column-footer::before{content:\"\";position:absolute;top:-.5625rem;left:0;right:0;height:1px;background:linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.4) 2%, rgba(255,255,255,0.4) 98%, rgba(255,255,255,0) 100%);opacity:0;transition:opacity 350ms ease}@media (max-width: 600px){#MiddleColumn .middle-column-footer::before{left:-2%;right:-2%}}#MiddleColumn .middle-column-footer.with-notch::before{opacity:1}html.theme-dark #MiddleColumn .middle-column-footer::before{background:linear-gradient(90deg, rgba(127,127,127,0) 0%, rgba(127,127,127,0.4) 2%, rgba(127,127,127,0.4) 98%, rgba(127,127,127,0) 100%)}.Composer,.MessageSelectToolbar,.messaging-disabled{margin-bottom:1.25rem}@media (max-width: 600px){.Composer,.MessageSelectToolbar,.messaging-disabled{margin-bottom:0.5rem}}.Composer,.MessageSelectToolbar,.unpin-all-button,.messaging-disabled{width:100%;display:flex;justify-content:center;position:relative}.mask-image-disabled .MessageSelectToolbar-inner,.mask-image-disabled .unpin-all-button,.mask-image-disabled .messaging-disabled{box-shadow:0 0.25rem 0.5rem 0.125rem var(--color-default-shadow)}.unpin-button-container{width:100%;display:flex;justify-content:center;position:absolute;padding-bottom:1.25rem}.unpin-button-container .unpin-all-button{text-transform:capitalize;color:var(--color-black);height:3.5rem;overflow:visible;transform:scaleX(1);transition:transform var(--select-transition),background-color 0.15s,color 0.15s}.unpin-button-container .unpin-all-button:hover .icon-unpin{color:var(--color-white)}.select-mode-active+.middle-column-footer .unpin-button-container .unpin-all-button{box-shadow:none;transform:scaleX(var(--unpin-hidden-scale))}@media (max-width: 600px){.unpin-button-container .unpin-all-button{height:2.5rem}}.unpin-button-container .unpin-all-button .icon-unpin{margin-inline-start:-0.4375rem;margin-inline-end:.75rem;color:var(--color-text-secondary);font-size:1.5rem;transition:color .15s}@media (max-width: 600px){.unpin-button-container{padding-bottom:0.75rem}}.mask-image-disabled .unpin-button-container::before{background:unset}\n",".RightHeader{display:flex;align-items:center;height:var(--header-height);padding:0.5rem .8125rem;pointer-events:auto}@media (max-width: 600px){.RightHeader{padding:0.5rem}}.RightHeader .close-button{flex-shrink:0}.RightHeader>.Transition{flex:1;height:100%}.RightHeader>.Transition>div{display:flex;align-items:center}.RightHeader h3{margin-bottom:0;font-size:1.25rem;font-weight:500;margin-left:1.375rem}.RightHeader .tools{display:flex;margin-left:auto}.RightHeader .SearchInput{margin-left:1rem}@media (min-width: 600px){.RightHeader .SearchInput{margin-right:1rem}}.RightHeader .DropdownMenu{margin-left:auto}\n",".ProfilePhoto{width:100%;height:100%;cursor:pointer;position:relative}.ProfilePhoto img{width:100%;object-fit:cover}.ProfilePhoto .prev-avatar-media{position:absolute;left:0;top:0;z-index:-1}.ProfilePhoto .spinner-wrapper{width:100%;height:100%}.ProfilePhoto .spinner-wrapper,.ProfilePhoto.deleted-account,.ProfilePhoto.no-photo,.ProfilePhoto.saved-messages{display:flex;align-items:center;justify-content:center;color:var(--color-white);background:linear-gradient(var(--color-white) -125%, var(--color-user));cursor:default}.ProfilePhoto.no-photo{font-size:14rem}.ProfilePhoto.deleted-account,.ProfilePhoto.saved-messages{font-size:20rem}\n",".ProfileInfo{aspect-ratio:1 / 1;position:relative}@supports not (aspect-ratio: 1/1){.ProfileInfo::before{float:left;padding-top:100%;content:\"\"}.ProfileInfo::after{display:block;content:\"\";clear:both}}.ProfileInfo .photo-wrapper{width:100%;position:absolute;left:0;top:0;bottom:0}.ProfileInfo .photo-wrapper>.Transition{width:100%;height:100%}.ProfileInfo .photo-dashes{position:absolute;width:100%;height:.125rem;padding:0 .375rem;z-index:1;display:flex;top:.5rem;left:0}.ProfileInfo .photo-dash{flex:1 1 auto;background-color:var(--color-white);opacity:.5;border-radius:.125rem;margin:0 .125rem}.ProfileInfo .photo-dash.current{opacity:1}.ProfileInfo .navigation{position:absolute;top:0;bottom:0;width:25%;border:none;padding:0;margin:0;-webkit-appearance:none;appearance:none;background:transparent no-repeat;background-size:1.25rem;opacity:.25;transition:opacity .15s;outline:none;cursor:pointer;z-index:1}.ProfileInfo .navigation:hover,.is-touch-env .ProfileInfo .navigation{opacity:1}.ProfileInfo .navigation.prev{left:0;background-image:url(media_navigation_previous.11f3cfece8fead5a78e6349db2545210.svg);background-position:1.25rem 50%}.ProfileInfo .navigation.next{right:0;background-image:url(media_navigation_next.3d6e264d21e73ad725738beb8e9dbbb8.svg);background-position:calc(100% - 1.25rem) 50%}.ProfileInfo .info{position:absolute;bottom:0;left:0;width:100%;min-height:100px;padding:0 1.5rem .5rem;background:linear-gradient(0deg, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0) 100%);color:var(--color-white);display:flex;flex-direction:column;justify-content:flex-end;pointer-events:none}.ProfileInfo .info:dir(rtl) .status{text-align:right;unicode-bidi:plaintext}.ProfileInfo .info[dir=rtl] .status{text-align:right;unicode-bidi:plaintext}.ProfileInfo .title{display:flex;align-items:center}.ProfileInfo .title h3{font-weight:500;font-size:1.25rem;line-height:1.375rem;white-space:pre-wrap;word-break:break-word;margin-bottom:.25rem}.ProfileInfo .title .VerifiedIcon{margin-left:0.25rem;margin-top:-0.125rem}.ProfileInfo .title .emoji{width:1.5rem;height:1.5rem;background-size:1.5rem}.ProfileInfo .status{font-size:0.875rem;opacity:.5}.ProfileInfo[dir=rtl] .navigation.prev{left:auto;right:0;transform:scaleX(-1)}.ProfileInfo[dir=rtl] .navigation.next{left:0;right:auto;transform:scaleX(-1)}\n",".Profile{height:100%;display:flex;flex-direction:column;overflow-y:scroll;overflow-x:hidden}@supports (overflow-y: overlay){.Profile{overflow-y:overlay !important}}.Profile>.profile-info>.ChatInfo{grid-area:chat_info}.Profile>.profile-info>.ChatInfo .status.online{color:var(--color-primary)}.Profile>.profile-info>.ChatExtra{padding:.875rem .5rem .5rem;box-shadow:inset 0 -0.0625rem 0 0 var(--color-background-secondary-accent);border-bottom:0.625rem solid var(--color-background-secondary)}.Profile>.profile-info>.ChatExtra .narrow{margin-bottom:0}.Profile>.profile-info>.ChatExtra .inactive.no-selection{user-select:auto;-webkit-user-select:auto !important}.Profile>.profile-info>.ChatExtra .Switcher{margin-left:auto}.Profile>.profile-info>.ChatExtra [dir=rtl] .Switcher{margin-left:0;margin-right:auto}.Profile .FloatingActionButton{z-index:1}.shared-media{display:flex;flex-direction:column-reverse}.shared-media .TabList{background:var(--color-background);top:-1px;z-index:1}.shared-media .TabList .Tab{padding:1rem .25rem}.shared-media .TabList .Tab i{bottom:-1rem}.shared-media .Transition{flex:1}.shared-media .content.empty-list{height:100%;padding-top:5rem;display:flex;align-items:flex-start;justify-content:center}.shared-media .content.empty-list .Spinner{--spinner-size: 2.75rem}.shared-media .content.media-list{display:grid;grid-template-columns:repeat(3, 1fr);grid-auto-rows:1fr;grid-gap:.0625rem}.shared-media .content.documents-list{padding:1.25rem}.shared-media .content.documents-list .File+.File{margin-top:1.25rem}.shared-media .content.links-list{padding:1.25rem}.shared-media .content.links-list .ProgressSpinner,.shared-media .content.links-list .message-upload-progress{display:none}.shared-media .content.audio-list{padding:1.25rem}.shared-media .content.audio-list .Audio .media-loading{top:0;left:0;display:flex;align-items:center;justify-content:center}.shared-media .content.audio-list .Audio+.Audio{margin-top:1.6875rem}.shared-media .content.members-list{padding:0.5rem 1rem}@media (max-width: 600px){.shared-media .content.members-list{padding:.5rem 0}.shared-media .content.members-list .ListItem.chat-item-clickable{margin:0}}\n",".AddChatMembers{height:100%;overflow:hidden;position:relative}.AddChatMembers-inner{height:100%;overflow:hidden}\n","#RightColumn{position:absolute;top:0;right:0;width:var(--right-column-width);height:100%;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}#RightColumn:not(:hover) .chat-item-clickable:not(.picker-list-item):nth-child(n+18){display:none !important}@media (max-width: 1275px){#RightColumn{box-shadow:0 0.25rem 0.5rem 0.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:0.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:0.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:black;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)}\n","#Main{display:flex;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)}}#LeftColumn{flex:1;min-width:18rem;max-width:26.5rem;height:100%}@media (max-width: 600px){#LeftColumn{height:calc(var(--vh, 1vh) * 100)}}@media (min-width: 1680px){#LeftColumn{border-left:1px solid var(--color-borders)}}@media (max-width: 1275px){#LeftColumn{flex:2}}@media (max-width: 925px){#LeftColumn{position:fixed;left:0;top:0;height:calc(var(--vh, 1vh) * 100);width:26.5rem;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:black;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;width:100vw;transform:translate3d(-20vw, 0, 0)}}@media (min-width: 1680px){#RightColumn{border-right:1px solid var(--color-borders)}}@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{flex:3;border-left:1px solid var(--color-borders);max-width:75vw}@media (max-width: 1275px){#MiddleColumn{max-width:calc(100vw - 26.5rem)}}@media (max-width: 66.25rem){#MiddleColumn{max-width:60vw}}@media (min-width: 1680px){#MiddleColumn{border-right:1px solid var(--color-borders);max-width:calc(1680px - 26.5rem)}}@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}\n"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/4.2c2e12ad0cb73321f1fb.js b/dist/4.2c2e12ad0cb73321f1fb.js new file mode 100644 index 00000000..56f88174 --- /dev/null +++ b/dist/4.2c2e12ad0cb73321f1fb.js @@ -0,0 +1,2 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[4],{105:function(e,t,a){"use strict";a.r(t),a.d(t,"Main",(function(){return rc}));var s=a(1),n=a(2),c=a(0),o=(a(85),a(11)),r=a(7),i=a(52),l=a(4);function d(e){const{chatId:t,threadId:a}=Object(r.z)(e)||{};return t&&a?(e=Object(o.Z)(e,t,a,!1),e=Object(o.u)(e,t,a,void 0)):e}Object(s.b)("openLocalTextSearch",e=>{const{chatId:t,threadId:a}=Object(r.z)(e)||{};if(t&&a)return Object(o.Z)(e,t,a,!0)}),Object(s.b)("closeLocalTextSearch",d),Object(s.b)("setLocalTextSearchQuery",(e,t,a)=>{const{chatId:s,threadId:n}=Object(r.z)(e)||{};if(!s||!n)return;const{query:c}=a,d=Object(l.a)(s,n),{query:b}=e.localTextSearch.byChatThreadKey[d]||{};return c!==b&&(e=Object(o.u)(e,s,n,i.a)),e=Object(o.Z)(e,s,n,!0,c)}),Object(s.b)("setLocalMediaSearchType",(e,t,a)=>{const{chatId:s}=Object(r.z)(e)||{};if(!s)return;const{mediaType:n}=a;return Object(o.Y)(e,s,n)}),Object(s.b)("openChat",(e,t,a)=>{const{id:n,threadId:c=-1,type:i="thread",shouldReplaceHistory:l=!1}=a,b=Object(r.z)(e);return b&&b.chatId===n&&b.threadId===c&&b.type===i||(e=Object(o.y)(e,n,c,"replyStack",[]),e=d(e=Object(o.o)(e)),e={...e,messages:{...e.messages,contentToBeScheduled:void 0},...n!==e.forwardMessages.toChatId&&{forwardMessages:{}}},Object(s.g)(e)),Object(o.O)(e,n,c,i,l)}),Object(s.b)("openPreviousChat",e=>Object(o.O)(e,void 0)),Object(s.b)("openChatWithInfo",(e,t,a)=>{Object(s.g)({...e,isChatInfoShown:!0}),t.openChat(a)}),Object(s.b)("resetChatCreation",e=>({...e,chatCreation:void 0})),Object(s.b)("setNewChatMembersDialogState",(e,t,a)=>({...e,newChatMembersProgress:a})),Object(s.b)("openNextChat",(e,t,a)=>{const{targetIndexDelta:s,orderedIds:n}=a,{chatId:c}=Object(r.z)(e)||{};if(!c)return void t.openChat({id:n[0]});const o=n.indexOf(c);if(-1===o)return;const i=n[o+s];t.openChat({id:i,shouldReplaceHistory:!0})});var b=a(8),u=a(13),m=a(6),h=a(3);const O=n.C+n.c;let j;Object(s.b)("setScrollOffset",(e,t,a)=>{const{chatId:s,threadId:n,scrollOffset:c}=a;return Object(o.y)(e,s,n,"scrollOffset",c)}),Object(s.b)("setReplyingToId",(e,t,a)=>{const{messageId:s}=a,n=Object(r.z)(e);if(!n)return;const{chatId:c,threadId:i}=n;return Object(o.y)(e,c,i,"replyingToId",s)}),Object(s.b)("setEditingId",(e,t,a)=>{const{messageId:s}=a,n=Object(r.z)(e);if(!n)return;const{chatId:c,threadId:i,type:l}=n,d="scheduled"===l?"editingScheduledId":"editingId";return Object(o.y)(e,c,i,d,s)}),Object(s.b)("editLastMessage",e=>{const{chatId:t,threadId:a}=Object(r.z)(e)||{};if(!t||!a)return;const s=Object(r.n)(e,t),n=Object(r.Kb)(e,t,a);if(!s||!n)return;const c=Object(h.g)(n,t=>Boolean(s[t]&&Object(r.b)(e,s[t],a).canEdit));return c?Object(o.y)(e,t,a,"editingId",c):void 0}),Object(s.b)("replyToNextMessage",(e,t,a)=>{const{targetIndexDelta:s}=a,{chatId:n,threadId:c}=Object(r.z)(e)||{};if(!n||!c)return;const o=Object(r.n)(e,n),i=Object(r.Kb)(e,n,c);if(!o||!i)return;const l=Object(r.ob)(e,n,c);let d;if(Object(r.Y)(e,n,c)&&l){const e=Object.keys(o),t=e.indexOf(l.toString())+s;d=t<=e.length+1&&t>=0?Number(e[t]):void 0}else if(c===b.MAIN_THREAD_ID){const t=Object(r.g)(e,n);d=t&&t.lastMessage?t.lastMessage.id:void 0}else{const t=Object(r.Fb)(e,n,c);d=t?t.lastMessageId:void 0}t.setReplyingToId({messageId:d}),t.focusMessage({chatId:n,threadId:c,messageId:d})}),Object(s.b)("openMediaViewer",(e,t,a)=>{const{chatId:s,threadId:n,messageId:c,avatarOwnerId:o,profilePhotoIndex:r,origin:i}=a;return{...e,mediaViewer:{chatId:s,threadId:n,messageId:c,avatarOwnerId:o,profilePhotoIndex:r,origin:i},forwardMessages:{}}}),Object(s.b)("closeMediaViewer",e=>({...e,mediaViewer:{}})),Object(s.b)("openAudioPlayer",(e,t,a)=>{const{chatId:s,threadId:n,messageId:c}=a;return{...e,audioPlayer:{chatId:s,threadId:n,messageId:c}}}),Object(s.b)("closeAudioPlayer",e=>({...e,audioPlayer:{}})),Object(s.b)("openPollResults",(e,t,a)=>{const{chatId:n,messageId:c}=a;Object(r.W)(e)?n===e.pollResults.chatId&&c===e.pollResults.messageId||Object(s.g)({...e,pollResults:{chatId:n,messageId:c,voters:{}}}):window.setTimeout(()=>{const e=Object(s.e)();Object(s.g)({...e,pollResults:{chatId:n,messageId:c,voters:{}}})},450)}),Object(s.b)("closePollResults",e=>{Object(s.g)({...e,pollResults:{}})}),Object(s.b)("focusLastMessage",(e,t)=>{const a=Object(r.z)(e);if(!a)return;const{chatId:s,threadId:n}=a;let c;if(n===b.MAIN_THREAD_ID){const t=Object(r.g)(e,s);c=t&&t.lastMessage?t.lastMessage.id:void 0}else{const t=Object(r.Fb)(e,s,n);c=t?t.lastMessageId:void 0}c&&t.focusMessage({chatId:s,threadId:n,messageId:c,noHighlight:!0})}),Object(s.b)("focusNextReply",(e,t)=>{const a=Object(r.z)(e);if(!a)return;const{chatId:n,threadId:c}=a,i=Object(r.nb)(e,n,c);if(i&&0!==i.length){const a=i.pop();e=Object(o.y)(e,n,c,"replyStack",[...i]),Object(s.g)(e),t.focusMessage({chatId:n,threadId:c,messageId:a})}else t.focusLastMessage()}),Object(s.b)("focusMessage",(e,t,a)=>{const{chatId:n,threadId:c=b.MAIN_THREAD_ID,messageListType:i="thread",noHighlight:l,groupedId:d,groupedChatId:m,replyMessageId:h}=a;let{messageId:g}=a;if(void 0!==d){const t=Object(r.J)(e,m,d);t&&t.length&&([g]=t)}const p=Object(r.z)(e),f=!p||n!==p.chatId||c!==p.threadId||i!==p.type;if(j&&(clearTimeout(j),j=void 0),j=window.setTimeout(()=>{let e=Object(s.e)();e=Object(o.Q)(e),e=Object(o.P)(e),Object(s.g)(e)},l?O:1500),e=Object(o.Q)(e,n,g,l),e=Object(o.P)(e,void 0),h){const t=Object(r.nb)(e,n,c)||[];e=Object(o.y)(e,n,c,"replyStack",[...t,h])}f&&(e=Object(o.P)(e,u.b.Static));const I=Object(r.Kb)(e,n,c);if(I&&I.includes(g))return Object(s.g)(e),void t.openChat({id:n,threadId:c});if(f&&(e=Object(o.y)(e,n,c,"viewportIds",void 0)),e=Object(o.y)(e,n,c,"outlyingIds",void 0),I&&!f){const t=g>I[0]?u.b.Down:u.b.Up;e=Object(o.P)(e,t)}Object(s.g)(e),t.openChat({id:n,threadId:c}),t.loadViewportMessages()}),Object(s.b)("openForwardMenu",(e,t,a)=>{const{fromChatId:s,messageIds:n,groupedId:c}=a;let o;return c&&(o=Object(r.bb)(e,s,c)),{...e,forwardMessages:{fromChatId:s,messageIds:o||n,isModalShown:!0}}}),Object(s.b)("exitForwardMode",e=>{Object(s.g)({...e,forwardMessages:{}})}),Object(s.b)("setForwardChatId",(e,t,a)=>{const{id:n}=a;Object(s.g)({...e,forwardMessages:{...e.forwardMessages,toChatId:n,isModalShown:!1}}),t.openChat({id:n}),t.closeMediaViewer(),t.exitMessageSelectMode()}),Object(s.b)("openForwardMenuForSelectedMessages",(e,t)=>{if(!e.selectedMessages)return;const{chatId:a,messageIds:s}=e.selectedMessages;t.openForwardMenu({fromChatId:a,messageIds:s})}),Object(s.b)("enterMessageSelectMode",(e,t,a)=>{const{messageId:s}=a||{},n=Object(r.s)(e);return n?Object(o.n)(e,n.id,s):e}),Object(s.b)("toggleMessageSelection",(e,t,a)=>{const{messageId:n,groupedId:c,childMessageIds:i,withShift:l}=a,d=Object(r.z)(e);if(!d)return;const{chatId:b,threadId:u,type:h}=d;e=Object(o.H)(e,b,u,h,n,c,i,l),Object(s.g)(e),e.shouldShowContextMenuHint&&(t.disableContextMenuHint(),t.showNotification({message:`To **edit** or **reply**, close this menu. Then ${m.n?"long tap":"right click"} on a message.`}))}),Object(s.b)("disableContextMenuHint",e=>{if(e.shouldShowContextMenuHint)return{...e,shouldShowContextMenuHint:!1}}),Object(s.b)("exitMessageSelectMode",o.o),Object(s.b)("openPollModal",e=>({...e,isPollModalOpen:!0})),Object(s.b)("closePollModal",e=>({...e,isPollModalOpen:!1}));Object(s.b)("setGlobalSearchQuery",(e,t,a)=>{const{query:s}=a,{chatId:n}=e.globalSearch;return Object(o.S)(e,{globalResults:{},localResults:{},resultsByType:void 0,...s?{fetchingStatus:{chats:!n,messages:!0}}:{fetchingStatus:void 0},query:s})}),Object(s.b)("addRecentlyFoundChatId",(e,t,a)=>{const{id:s}=a,{recentlyFoundChatIds:n}=e.globalSearch;if(!n)return Object(o.S)(e,{recentlyFoundChatIds:[s]});const c=n.filter(e=>e!==s);return c.unshift(s),c.length>10&&c.pop(),Object(o.S)(e,{recentlyFoundChatIds:c})}),Object(s.b)("clearRecentlyFoundChats",e=>Object(o.S)(e,{recentlyFoundChatIds:void 0})),Object(s.b)("setGlobalSearchContent",(e,t,a)=>{const{content:s}=a;return Object(o.T)(e,s)}),Object(s.b)("setGlobalSearchChatId",(e,t,a)=>{const{id:s}=a;return Object(o.S)(e,{chatId:s,query:void 0,resultsByType:void 0})}),Object(s.b)("setStickerSearchQuery",(e,t,a)=>{const{query:s}=a;return{...e,stickers:{...e.stickers,search:{query:s,resultIds:void 0}}}}),Object(s.b)("setGifSearchQuery",(e,t,a)=>{const{query:s}=a;return{...e,gifs:{...e.gifs,search:{query:s,offsetId:void 0,results:void 0}}}}),Object(s.b)("openUserInfo",(e,t,a)=>{const{id:s}=a;t.openChat({id:s})});Object(s.b)("openChat",e=>Object(o.gb)(e,void 0)),Object(s.b)("setUserSearchQuery",(e,t,a)=>{const{query:s}=a;return Object(o.pb)(e,{globalUserIds:void 0,localUserIds:void 0,fetchingStatus:Boolean(s),query:s})});a(86);var g=a(178);Object(s.b)("toggleChatInfo",e=>({...e,isChatInfoShown:!e.isChatInfoShown})),Object(s.b)("toggleManagement",e=>{const{chatId:t}=Object(r.z)(e)||{};if(t)return{...e,management:{byChatId:{...e.management.byChatId,[t]:{...e.management.byChatId[t],isActive:!(e.management.byChatId[t]||{}).isActive}}}}}),Object(s.b)("closeManagement",e=>{const{chatId:t}=Object(r.z)(e)||{};if(t)return{...e,management:{byChatId:{...e.management.byChatId,[t]:{...e.management.byChatId[t],isActive:!1}}}}}),Object(s.b)("openChat",e=>{if(m.l||m.m)return{...e,isLeftColumnShown:0===e.messages.messageLists.length}}),Object(s.b)("toggleLeftColumn",e=>({...e,isLeftColumnShown:!e.isLeftColumnShown})),Object(s.b)("addRecentEmoji",(e,t,a)=>{const{emoji:s}=a,{recentEmojis:n}=e;if(!n)return{...e,recentEmojis:[s]};const c=n.filter(e=>e!==s);return c.unshift(s),c.length>18&&c.pop(),{...e,recentEmojis:c}}),Object(s.b)("addRecentSticker",(e,t,a)=>{const{sticker:s}=a,{recent:n}=e.stickers;if(!n)return{...e,stickers:{...e.stickers,recent:{hash:0,stickers:[s]}}};const c=n.stickers.filter(e=>e.id!==s.id);return c.unshift(s),{...e,stickers:{...e.stickers,recent:{...n,stickers:c}}}}),Object(s.b)("showNotification",(e,t,a)=>{const s=a,n=[...e.notifications],c=n.findIndex(e=>e.message===s.message);return-1!==c&&n.splice(c,1),n.push(s),{...e,notifications:n}}),Object(s.b)("dismissNotification",e=>{const t=[...e.notifications];return t.pop(),{...e,notifications:t}}),Object(s.b)("showDialog",(e,t,a)=>{const{data:s}=a;if("message"in s&&s.hasErrorKey&&!Object(g.a)(s))return e;const n=[...e.dialogs];if("message"in s){const e=n.findIndex(e=>e.message===s.message);-1!==e&&n.splice(e,1)}return n.push(s),{...e,dialogs:n}}),Object(s.b)("dismissDialog",e=>{const t=[...e.dialogs];return t.pop(),{...e,dialogs:t}}),Object(s.b)("toggleSafeLinkModal",(e,t,a)=>{const{url:s}=a;return{...e,safeLinkModalUrl:s}}),Object(s.b)("openHistoryCalendar",(e,t,a)=>{const{selectedAt:s}=a;return{...e,historyCalendarSelectedAt:s}}),Object(s.b)("closeHistoryCalendar",e=>({...e,historyCalendarSelectedAt:void 0})),Object(s.b)("openPaymentModal",(e,t,a)=>{const{messageId:s}=a;return{...e,payment:{...e.payment,messageId:s,isPaymentModalOpen:!0}}}),Object(s.b)("closePaymentModal",e=>{const t=Object(o.i)(e);return Object(o.j)(t)});a(87);var p=a(5),f=a(10);const I=Object(f.h)(e=>e(),1e3,!0),v=Object(f.h)(e=>e(),3e3,!0),y=Object(f.a)(e=>e(),500,!1,!0);async function C(e,t,a){const c=await Object(p.a)("fetchChats",{limit:n.l,offsetDate:a,archived:"archived"===e,withPinned:void 0===Object(s.e)().chats.orderedPinnedIds[e],serverTimeOffset:Object(s.e)().serverTimeOffset});if(!c)return;const{chatIds:r}=c;r.length>0&&r[0]===t&&r.shift();let i=Object(s.e)();i=Object(o.g)(i,Object(h.c)(c.users,"id")),i=Object(o.N)(i,Object(h.c)(c.chats,"id")),i=Object(o.J)(i,e,r),i=Object(o.K)(i,e,c),Object.keys(c.draftsById).map(Number).forEach(e=>{i=Object(o.y)(i,e,b.MAIN_THREAD_ID,"draft",c.draftsById[e])}),Object.keys(c.replyingToById).map(Number).forEach(e=>{i=Object(o.y)(i,e,b.MAIN_THREAD_ID,"replyingToId",c.replyingToById[e])}),0!==r.length||i.chats.isFullyLoaded[e]||(i={...i,chats:{...i.chats,isFullyLoaded:{...i.chats.isFullyLoaded,[e]:!0}}}),Object(s.g)(i)}async function E(e){const t=await Object(p.a)("fetchFullChat",e);if(!t)return;const{users:a,fullInfo:n}=t;let c=Object(s.e)();a&&(c=Object(o.g)(c,Object(h.c)(a,"id"))),c=Object(o.I)(c,e.id,{fullInfo:n}),Object(s.g)(c)}async function w(e,t,a){const n=Object(s.e)(),c=Object(r.i)(n,t);if(c&&!c.isMin)return void(a?e.focusMessage({chatId:c.id,messageId:a}):e.openChat({id:c.id}));const i=Object(r.s)(n);e.openChat({id:-1});const l=await Object(p.a)("getChatByUsername",t);if(!l)return i&&e.openChat({id:i.id}),void e.showNotification({message:"User does not exist"});Object(s.g)(Object(o.I)(Object(s.e)(),l.id,l)),a?e.focusMessage({chatId:l.id,messageId:a}):e.openChat({id:l.id})}Object(s.b)("preloadTopChatMessages",(e,t)=>{(async()=>{const a=[];for(let c=0;ce!==i&&!a.includes(e));if(!m)return;a.push(m.id),t.loadViewportMessages({chatId:m.id,threadId:b.MAIN_THREAD_ID})}})()}),Object(s.b)("openChat",(e,t,a)=>{const{id:s,threadId:n}=a,{currentUserId:c}=e,o=Object(r.g)(e,s);if(o&&o.hasUnreadMark&&t.toggleChatUnread({id:s}),o)Object(l.pb)(o)&&!o.isMin&&t.requestChatUpdate({chatId:s});else if(s===c)Object(p.a)("fetchChat",{type:"self"});else{const t=Object(r.Jb)(e,s);t&&Object(p.a)("fetchChat",{type:"user",user:t})}if(n!==b.MAIN_THREAD_ID){Object(r.Hb)(e,s,n)||t.requestThreadInfoUpdate({chatId:s,threadId:n})}}),Object(s.b)("openSupportChat",(e,t)=>{const a=Object(r.Cb)(e);t.openChat({id:a?a.id:-1}),a||(async()=>{const e=await Object(p.a)("fetchChat",{type:"support"});e&&t.openChat({id:e.chatId})})()}),Object(s.b)("openTipsChat",(e,t,a)=>{const{langCode:s}=a,c="pt-br"===s?"BR":n.S.includes(s)?s.toUpperCase():"";t.openChatByUsername({username:`${n.Pb}${c}`})}),Object(s.b)("loadMoreChats",(e,t,a)=>{const{listType:s="active"}=a,n=e.chats.listIds[s];if(e.chats.isFullyLoaded[s])return;const c=n?n.map(t=>e.chats.byId[t]).filter(t=>Boolean(t&&t.lastMessage)&&!Object(r.N)(e,t.id)).sort((e,t)=>e.lastMessage.date-t.lastMessage.date)[0]:void 0;I(c?()=>C(s,c.id,c.lastMessage.date):()=>C(s))}),Object(s.b)("loadFullChat",(e,t,a)=>{const{chatId:s,force:n}=a,c=Object(r.g)(e,s);c&&(n?E(c):y(()=>E(c)))}),Object(s.b)("loadTopChats",()=>{v(()=>C("active"))}),Object(s.b)("requestChatUpdate",(e,t,a)=>{const{serverTimeOffset:s}=e,{chatId:n}=a,c=Object(r.g)(e,n);c&&Object(p.a)("requestChatUpdate",{chat:c,serverTimeOffset:s})}),Object(s.b)("updateChatMutedState",(e,t,a)=>{const{serverTimeOffset:n}=e,{chatId:c,isMuted:i}=a,l=Object(r.g)(e,c);l&&(Object(s.g)(Object(o.I)(e,c,{isMuted:i})),Object(p.a)("updateChatMutedState",{chat:l,isMuted:i,serverTimeOffset:n}))}),Object(s.b)("createChannel",(e,t,a)=>{const{title:n,about:c,photo:i,memberIds:l}=a;!async function(e,t,a,n){Object(s.g)({...Object(s.e)(),chatCreation:{progress:u.a.InProgress}});const c=await Object(p.a)("createChannel",{title:e,about:a,users:t});if(!c)return;const{id:r,accessHash:i}=c;let l=Object(s.e)();l=Object(o.I)(l,r,c),l={...l,chatCreation:{...l.chatCreation,progress:c?u.a.Complete:u.a.Error}},Object(s.g)(l),Object(s.d)().openChat({id:r}),r&&i&&n&&await Object(p.a)("editChatPhoto",{chatId:r,accessHash:i,photo:n})}(n,l.map(t=>Object(r.Jb)(e,t)).filter(Boolean),c,i)}),Object(s.b)("joinChannel",(e,t,a)=>{const{chatId:s}=a,n=Object(r.g)(e,s);if(!n)return;const{id:c,accessHash:o}=n;c&&o&&Object(p.a)("joinChannel",{channelId:c,accessHash:o})}),Object(s.b)("deleteChatUser",(e,t,a)=>{(async()=>{const{chatId:s,userId:n}=a,c=Object(r.g)(e,s),o=Object(r.Jb)(e,n);if(!c||!o)return;await Object(p.a)("deleteChatUser",{chat:c,user:o});const i=Object(r.z)(e);i&&i.chatId===s&&e.currentUserId===n&&t.openChat({id:void 0})})()}),Object(s.b)("deleteChat",(e,t,a)=>{(async()=>{const{chatId:s}=a,n=Object(r.g)(e,s);if(!n)return;await Object(p.a)("deleteChat",{chatId:n.id});const c=Object(r.z)(e);c&&c.chatId===s&&t.openChat({id:void 0})})()}),Object(s.b)("leaveChannel",(e,t,a)=>{(async()=>{const{chatId:s}=a,n=Object(r.g)(e,s);if(!n)return;const{id:c,accessHash:o}=n;c&&o&&await Object(p.a)("leaveChannel",{channelId:c,accessHash:o});const i=Object(r.z)(e);i&&i.chatId===s&&t.openChat({id:void 0})})()}),Object(s.b)("deleteChannel",(e,t,a)=>{(async()=>{const{chatId:s}=a,n=Object(r.g)(e,s);if(!n)return;const{id:c,accessHash:o}=n;c&&o&&await Object(p.a)("deleteChannel",{channelId:c,accessHash:o});const i=Object(r.z)(e);i&&i.chatId===s&&t.openChat({id:void 0})})()}),Object(s.b)("createGroupChat",(e,t,a)=>{const{title:n,memberIds:c,photo:i}=a;!async function(e,t,a){Object(s.g)({...Object(s.e)(),chatCreation:{progress:u.a.InProgress}});const n=await Object(p.a)("createGroupChat",{title:e,users:t});if(!n)return;const{id:c}=n;let r=Object(s.e)();r=Object(o.I)(r,c,n),r={...r,chatCreation:{...r.chatCreation,progress:n?u.a.Complete:u.a.Error}},Object(s.g)(r),Object(s.d)().openChat({id:c}),c&&a&&await Object(p.a)("editChatPhoto",{chatId:c,photo:a})}(n,c.map(t=>Object(r.Jb)(e,t)).filter(Boolean),i)}),Object(s.b)("toggleChatPinned",(e,t,a)=>{const{id:s,folderId:c}=a,o=Object(r.g)(e,s);if(o)if(c){const t=Object(r.j)(e,c);if(t){const a=!Object(r.N)(e,s,c),{pinnedChatIds:n,includedChatIds:o}=t,i=a?[s,...n||[]]:(n||[]).filter(e=>e!==s),l=[s,...o];Object(p.a)("editChatFolder",{id:c,folderUpdate:{...t,pinnedChatIds:i,includedChatIds:l}})}}else{const t=Object(r.k)(e,s),a=Object(r.N)(e,s,"archived"===t?n.i:void 0);Object(p.a)("toggleChatPinned",{chat:o,shouldBePinned:!a})}}),Object(s.b)("toggleChatArchived",(e,t,a)=>{const{id:s}=a,c=Object(r.g)(e,s);c&&Object(p.a)("toggleChatArchived",{chat:c,folderId:Object(l.kb)(c)?0:n.i})}),Object(s.b)("loadChatFolders",()=>{!async function(){const e=await Object(p.a)("fetchChatFolders");if(e){const t=Object(s.e)();Object(s.g)({...t,chatFolders:{...t.chatFolders,...e}})}}()}),Object(s.b)("loadRecommendedChatFolders",()=>{!async function(){const e=await Object(p.a)("fetchRecommendedChatFolders");if(e){const t=Object(s.e)();Object(s.g)({...t,chatFolders:{...t.chatFolders,recommended:e}})}}()}),Object(s.b)("editChatFolder",(e,t,a)=>{const{id:s,folderUpdate:n}=a,c=Object(r.j)(e,s);c&&Object(p.a)("editChatFolder",{id:s,folderUpdate:{id:s,emoticon:c.emoticon,pinnedChatIds:c.pinnedChatIds,...n}})}),Object(s.b)("addChatFolder",(e,t,a)=>{const{folder:c}=a,{orderedIds:o}=e.chatFolders;!async function(e,t){const{id:a,description:n,...c}=e;if(await Object(p.a)("editChatFolder",{id:t+1,folderUpdate:{id:t+1,...c}}),!n)return;const o=Object(s.e)(),{recommended:r}=o.chatFolders;r&&Object(s.g)({...o,chatFolders:{...o.chatFolders,recommended:r.filter(({id:e})=>e!==a)}})}(c,o&&o.length?Math.max.apply(Math.max,o):n.i)}),Object(s.b)("deleteChatFolder",(e,t,a)=>{const{id:s}=a;Object(r.j)(e,s)&&async function(e){await Object(p.a)("deleteChatFolder",e)}(s)}),Object(s.b)("toggleChatUnread",(e,t,a)=>{const{id:s}=a,{serverTimeOffset:n}=e,c=Object(r.g)(e,s);c&&(c.unreadCount?Object(p.a)("markMessageListRead",{serverTimeOffset:n,chat:c,threadId:b.MAIN_THREAD_ID}):Object(p.a)("toggleDialogUnread",{chat:c,hasUnreadMark:!c.hasUnreadMark}))}),Object(s.b)("openTelegramLink",(e,t,a)=>{const{url:s}=a;let c=n.tb.exec(s);if(c){const e=c[1];(async()=>{const a=await Object(p.a)("openChatByInvite",e);a&&t.openChat({id:a.chatId})})()}else{c=n.ub.exec(s);const e=c[1],a=c[2]?Number(c[2]):void 0,o=c[3]?Number(c[3]):void 0;"c"===e&&a&&o?t.focusMessage({chatId:-a,messageId:o}):w(t,e,a)}}),Object(s.b)("acceptInviteConfirmation",(e,t,a)=>{const{hash:s}=a;(async()=>{const e=await Object(p.a)("importChatInvite",{hash:s});e&&t.openChat({id:e.id})})()}),Object(s.b)("openChatByUsername",(e,t,a)=>{const{username:s}=a;w(t,s)}),Object(s.b)("togglePreHistoryHidden",(e,t,a)=>{const{chatId:s,isEnabled:n}=a;let c=Object(r.g)(e,s);c&&(async()=>{if(Object(l.lb)(c)){if(c=await Object(p.a)("migrateChat",c),!c)return;t.openChat({id:c.id})}Object(p.a)("togglePreHistoryHidden",{chat:c,isEnabled:n})})()}),Object(s.b)("updateChatDefaultBannedRights",(e,t,a)=>{const{chatId:s,bannedRights:n}=a,c=Object(r.g)(e,s);c&&Object(p.a)("updateChatDefaultBannedRights",{chat:c,bannedRights:n})}),Object(s.b)("updateChatMemberBannedRights",(e,t,a)=>{const{chatId:n,userId:c,bannedRights:i}=a;let d=Object(r.g)(e,n);const b=Object(r.Jb)(e,c);d&&b&&(async()=>{if(Object(l.lb)(d)){if(d=await Object(p.a)("migrateChat",d),!d)return;t.openChat({id:d.id})}await Object(p.a)("updateChatMemberBannedRights",{chat:d,user:b,bannedRights:i});const e=Object(s.e)(),a=Object(r.g)(e,n);if(!a||!a.fullInfo)return;const{members:u,kickedMembers:m}=a.fullInfo,h=!!i.viewMessages,O=!Object.keys(i).length;Object(s.g)(Object(o.I)(e,n,{fullInfo:{...a.fullInfo,...u&&h&&{members:u.filter(e=>e.userId!==c)},...u&&!h&&{members:u.map(e=>e.userId===c?{...e,bannedRights:i}:e)},...O&&m&&{kickedMembers:m.filter(e=>e.userId!==c)}}}))})()}),Object(s.b)("updateChatAdmin",(e,t,a)=>{const{chatId:n,userId:c,adminRights:i,customTitle:d}=a;let b=Object(r.g)(e,n);const u=Object(r.Jb)(e,c);b&&u&&(async()=>{if(Object(l.lb)(b)){if(b=await Object(p.a)("migrateChat",b),!b)return;t.openChat({id:b.id})}await Object(p.a)("updateChatAdmin",{chat:b,user:u,adminRights:i,customTitle:d});const e=Object(s.e)(),a=Object(r.g)(e,n);if(!a||!a.fullInfo)return;const{adminMembers:m}=a.fullInfo,h=!Object.keys(i).length;Object(s.g)(Object(o.I)(e,n,{fullInfo:{...a.fullInfo,...m&&h&&{adminMembers:m.filter(e=>e.userId!==c)},...m&&!h&&{adminMembers:m.map(e=>e.userId===c?{...e,adminRights:i,customTitle:d}:e)}}}))})()}),Object(s.b)("updateChat",(e,t,a)=>{const{chatId:n,title:c,about:i,photo:l}=a,d=Object(r.g)(e,n);d&&(async()=>{Object(s.g)(Object(o.cb)(Object(s.e)(),u.f.InProgress)),await Promise.all([d.title!==c?Object(p.a)("updateChatTitle",d,c):void 0,d.fullInfo&&d.fullInfo.about!==i?Object(p.a)("updateChatAbout",d,i):void 0,l?Object(p.a)("editChatPhoto",{chatId:n,accessHash:d.accessHash,photo:l}):void 0]),Object(s.g)(Object(o.cb)(Object(s.e)(),u.f.Complete))})()}),Object(s.b)("toggleSignatures",(e,t,a)=>{const{chatId:s,isEnabled:n}=a,c=Object(r.g)(e,s);c&&Object(p.a)("toggleSignatures",{chat:c,isEnabled:n})}),Object(s.b)("loadGroupsForDiscussion",()=>{(async()=>{const e=await Object(p.a)("fetchGroupsForDiscussion");if(!e)return;const t=e.reduce((e,t)=>(t&&(e[t.id]=t),e),{}),a=Object(o.c)(Object(s.e)(),t);Object(s.g)({...a,chats:{...a.chats,forDiscussionIds:Object.keys(t).map(Number)}})})()}),Object(s.b)("linkDiscussionGroup",(e,t,a)=>{const{channelId:s,chatId:n}=a,c=Object(r.g)(e,s);let o=Object(r.g)(e,n);c&&o&&(async()=>{if(Object(l.lb)(o)){if(o=await Object(p.a)("migrateChat",o),!o)return;t.openChat({id:o.id})}let{fullInfo:e}=o;if(!e){const t=await Object(p.a)("fetchFullChat",o);if(!t)return;e=t.fullInfo}e.isPreHistoryHidden&&await Object(p.a)("togglePreHistoryHidden",{chat:o,isEnabled:!1}),Object(p.a)("setDiscussionGroup",{channel:c,chat:o})})()}),Object(s.b)("unlinkDiscussionGroup",(e,t,a)=>{const{channelId:s}=a,n=Object(r.g)(e,s);if(!n)return;let c;n.fullInfo&&n.fullInfo.linkedChatId&&(c=Object(r.g)(e,n.fullInfo.linkedChatId)),(async()=>{await Object(p.a)("setDiscussionGroup",{channel:n}),c&&E(c)})()}),Object(s.b)("setActiveChatFolder",(e,t,a)=>({...e,chatFolders:{...e.chatFolders,activeChatFolder:a}})),Object(s.b)("loadMoreMembers",e=>{(async()=>{const{chatId:t}=Object(r.z)(e)||{},a=t?Object(r.g)(e,t):void 0;if(!a||Object(l.lb)(a))return;const n=a.fullInfo&&a.fullInfo.members&&a.fullInfo.members.length||void 0,c=await Object(p.a)("fetchMembers",a.id,a.accessHash,"recent",n);if(!c)return;const{members:i,users:d}=c;i&&i.length&&(e=Object(s.e)(),e=Object(o.g)(e,Object(h.c)(d,"id")),e=Object(o.I)(e,a.id,{fullInfo:{...a.fullInfo,members:[...(a.fullInfo||{}).members||[],...i||[]]}}),Object(s.g)(e))})()}),Object(s.b)("addChatMembers",(e,t,a)=>{const{chatId:s,memberIds:n}=a,c=Object(r.g)(e,s),o=n.map(t=>Object(r.Jb)(e,t)).filter(Boolean);c&&o.length&&(t.setNewChatMembersDialogState(u.i.Loading),(async()=>{await Object(p.a)("addChatMembers",c,o),t.setNewChatMembersDialogState(u.i.Closed),E(c)})())}),Object(s.b)("deleteChatMember",(e,t,a)=>{const{chatId:s,userId:n}=a,c=Object(r.g)(e,s),o=Object(r.Jb)(e,n);c&&o&&(async()=>{await Object(p.a)("deleteChatMember",c,o),E(c)})()});const M=new Map,S=Object(f.h)(e=>e(),1e3,!0);async function k(e,t,a,c,i=!1,l=!1){const d=e.id;let b;switch(c){case u.e.Backwards:b=void 0;break;case u.e.Around:b=-(Math.round(n.gb/2)+1);break;case u.e.Forwards:b=-(n.gb+1)}const m=await Object(p.a)("fetchMessages",{chat:Object(r.Gb)(Object(s.e)(),d,t),offsetId:a,addOffset:b,limit:n.gb,threadId:t});if(!m)return;const{messages:O,users:j,chats:g,threadInfos:f}=m,I=Object(h.c)(O,"id"),v=Object.keys(I).map(Number);let y=Object(s.e)();y=Object(o.b)(y,d,I),y=i?Object(o.eb)(y,d,t,v):Object(o.W)(y,d,t,v),y=Object(o.g)(y,Object(h.c)(j,"id")),y=Object(o.c)(y,Object(h.c)(g,"id")),y=Object(o.mb)(y,d,f);let C=Object(r.Z)(y,d,t);const E=Object(r.hb)(y,d,t);if(i&&C&&E&&Object(h.b)(C,E)&&(y=Object(o.W)(y,d,t,E),C=Object(r.Z)(y,d,t),y=Object(o.y)(y,d,t,"outlyingIds",void 0),i=!1),!l){const e=i?E:C,{newViewportIds:s}=N(e,a,c);y=Object(o.A)(y,d,t,s)}Object(s.g)(y)}function N(e,t,a){const{length:s}=e,c=t?function(e,t){return te[e.length-1]?e.length-1:e.findIndex((a,s)=>a===t||at)}(e,t):-1,o=a===u.e.Backwards?c:c+1||s,r=o-n.gb,i=o+n.gb-1,l=e.slice(Math.max(0,r),i+1);let d,b;switch(a){case u.e.Backwards:d=o>0,b=r>=0;break;case u.e.Forwards:d=o0,b=l.length===n.gb}return{newViewportIds:l,areSomeLocal:d,areAllLocal:b}}async function T(e){let t;const a=e.attachment?(e,n)=>{M.has(n)||(t=n,M.set(n,a));const c=Object(s.e)();Object(s.g)({...c,fileUploads:{byMessageLocalId:{...c.fileUploads.byMessageLocalId,[n]:{progress:e}}}})}:void 0;(e.replyingTo||m.e)&&await Object(f.g)();const n=Object(s.e)();e.serverTimeOffset=n.serverTimeOffset;const c=Object(r.z)(n);if(!c)return;const{threadId:o}=c;e.replyingTo||o===b.MAIN_THREAD_ID||(e.replyingTo=Object(r.Hb)(n,e.chat.id,o)),await Object(p.a)("sendMessage",e,a),a&&t&&M.delete(t)}Object(s.b)("loadViewportMessages",(e,t,a)=>{const{direction:s=u.e.Around,isBudgetPreload:c=!1}=a||{};let{chatId:i,threadId:l}=a||{};if(!i){const t=Object(r.z)(e);if(!t)return;i=t.chatId,l=t.threadId}const d=Object(r.g)(e,i);if(!d||d.isRestricted)return;const b=Object(r.Kb)(e,i,l),m=Object(r.Z)(e,i,l),h=Object(r.hb)(e,i,l);if(b&&b.length&&s!==u.e.Around){const a=s===u.e.Backwards?b[0]:b[b.length-1],n=Boolean(h),r=n?h:m,{newViewportIds:O,areSomeLocal:j,areAllLocal:g}=N(r,a,s);if(j&&(e=Object(o.A)(e,i,l,O)),async function(e,t,a,s,n,c,o,r){t||await k(n,c,r,o,a,s);s||(await Promise.resolve(),e.loadViewportMessages({chatId:n.id,threadId:c,direction:o,isBudgetPreload:!0}))}(t,g,n,c,d,l,s,a),c)return}else{const t=Object(r.I)(e,i)||Object(r.mb)(e,i,l),a=Boolean(t&&m&&!m.includes(t)),s=(a?h:m)||[],{newViewportIds:b,areSomeLocal:O,areAllLocal:j}=N(s,t,u.e.Around);O&&b.length>=n.gb&&(e=Object(o.A)(e,i,l,b)),j||k(d,l,t,u.e.Around,a,c)}return e}),Object(s.b)("loadMessage",(e,t,a)=>{const{chatId:n,messageId:c,replyOriginForId:i}=a,l=Object(r.g)(e,n);l&&async function(e,t,a){const n=await Object(p.a)("fetchMessage",{chat:e,messageId:t});if(!n)return;if(n===b.MESSAGE_DELETED){if(a){let t=Object(s.e)();const n=Object(r.l)(t,e.id,a);t=Object(o.M)(t,e.id,a,{...n,replyToMessageId:void 0}),Object(s.g)(t)}return}let c=Object(s.e)();c=Object(o.M)(c,e.id,t,n.message),c=Object(o.g)(c,Object(h.c)(n.users,"id")),Object(s.g)(c)}(l,c,i)}),Object(s.b)("sendMessage",(e,t,a)=>{const s=Object(r.z)(e);if(!s)return;const{chatId:c,threadId:o,type:i}=s;if("scheduled"===i&&!a.scheduledAt)return{...e,messages:{...e.messages,contentToBeScheduled:a}};const l=Object(r.g)(e,c);t.setReplyingToId({messageId:void 0}),t.clearWebPagePreview({chatId:c,threadId:o,value:!1});const d={...a,chat:l,replyingTo:Object(r.ob)(e,c,o),noWebPage:Object(r.db)(e,c,o)},b=!a.attachments||a.attachments.length<=1,u=!b&&a.attachments&&a.attachments.length>1;if(b){const{attachments:e,...t}=d;T({...t,attachment:e?e[0]:void 0})}else if(u){const{text:e,entities:t,attachments:a,...s}=d,c=Object(h.n)(a,n.W);for(let a=0;a0?r:void 0}),o.forEach(e=>{T({...s,attachment:e,groupedId:r})})}}else{const{text:e,entities:t,attachments:a,replyingTo:s,...n}=d;e&&T({...n,text:e,entities:t,replyingTo:s}),a.forEach(e=>{T({...n,attachment:e})})}}),Object(s.b)("editMessage",(e,t,a)=>{const{serverTimeOffset:s}=e,{text:n,entities:c}=a,o=Object(r.z)(e);if(!o)return;const{chatId:i,threadId:l,type:d}=o,b=Object(r.g)(e,i),u=Object(r.E)(e,i,l,d);b&&u&&(Object(p.a)("editMessage",{chat:b,message:u,text:n,entities:c,noWebPage:Object(r.db)(e,i,l),serverTimeOffset:s}),t.setEditingId({messageId:void 0}))}),Object(s.b)("cancelSendingMessage",(e,t,a)=>{const{chatId:s,messageId:n}=a,c=Object(r.l)(e,s,n),o=c&&M.get(c.previousLocalId||c.id);o&&Object(p.b)(o),t.apiUpdate({"@type":"deleteMessages",ids:[n],chatId:s})}),Object(s.b)("saveDraft",(e,t,a)=>{const{chatId:s,threadId:n,draft:c}=a;if(!c)return;const{text:i,entities:l}=c,d=Object(r.g)(e,s);return n===b.MAIN_THREAD_ID&&Object(p.a)("saveDraft",{chat:d,text:i,entities:l,replyToMsgId:Object(r.ob)(e,s,n)}),e=Object(o.y)(e,s,n,"draft",c),e=Object(o.I)(e,s,{draftDate:Math.round(Date.now()/1e3)})}),Object(s.b)("clearDraft",(e,t,a)=>{const{chatId:s,threadId:n,localOnly:c}=a;if(!Object(r.C)(e,s,n))return;const i=Object(r.g)(e,s);return c||n!==b.MAIN_THREAD_ID||Object(p.a)("clearDraft",i),e=Object(o.y)(e,s,n,"draft",void 0),e=Object(o.I)(e,s,{draftDate:void 0})}),Object(s.b)("toggleMessageWebPage",(e,t,a)=>{const{chatId:s,threadId:n,noWebPage:c}=a;return Object(o.y)(e,s,n,"noWebPage",c)}),Object(s.b)("pinMessage",(e,t,a)=>{const s=Object(r.s)(e);if(!s)return;const{messageId:n,isUnpin:c,isOneSide:o,isSilent:i}=a;Object(p.a)("pinMessage",{chat:s,messageId:n,isUnpin:c,isOneSide:o,isSilent:i})}),Object(s.b)("unpinAllMessages",(e,t,a)=>{const n=Object(r.g)(e,a.chatId);n&&async function(e){await Object(p.a)("unpinAllMessages",{chat:e});let t=Object(s.e)();t=Object(o.y)(t,e.id,b.MAIN_THREAD_ID,"pinnedIds",[]),Object(s.g)(t)}(n)}),Object(s.b)("deleteMessages",(e,t,a)=>{const{messageIds:s,shouldDeleteForAll:n}=a,c=Object(r.z)(e);if(!c)return;const{chatId:o,threadId:i}=c,l=Object(r.g)(e,o);Object(p.a)("deleteMessages",{chat:l,messageIds:s,shouldDeleteForAll:n});const d=Object(r.D)(e,o,i);s.includes(d)&&t.setEditingId({messageId:void 0})}),Object(s.b)("deleteScheduledMessages",(e,t,a)=>{const{messageIds:s}=a,n=Object(r.z)(e);if(!n)return;const{chatId:c}=n,o=Object(r.g)(e,c);Object(p.a)("deleteScheduledMessages",{chat:o,messageIds:s});const i=Object(r.F)(e,c);s.includes(i)&&t.setEditingId({messageId:void 0})}),Object(s.b)("deleteHistory",(e,t,a)=>{(async()=>{const{chatId:s,shouldDeleteForAll:n}=a,c=Object(r.g)(e,s);if(!c)return;const o=c.lastMessage&&c.lastMessage.id;await Object(p.a)("deleteHistory",{chat:c,shouldDeleteForAll:n,maxId:o});const i=Object(r.z)(e);i&&i.chatId===s&&t.openChat({id:void 0})})()}),Object(s.b)("reportMessages",(e,t,a)=>{(async()=>{const{messageIds:s,reason:n,description:c}=a,o=Object(r.z)(e);if(!o)return;const{chatId:i}=o,l=Object(r.g)(e,i),d=await Object(p.a)("reportMessages",{peer:l,messageIds:s,reason:n,description:c});t.showNotification({message:d?"Thank you! Your report will be reviewed by our team.":"Error occured while submiting report. Please, try again later."})})()}),Object(s.b)("markMessageListRead",(e,t,a)=>{const{serverTimeOffset:s}=e,n=Object(r.z)(e);if(!n)return;const{chatId:c,threadId:o}=n,i=Object(r.Gb)(e,c,o);if(!i)return;const{maxId:l}=a;S(()=>{Object(p.a)("markMessageListRead",{serverTimeOffset:s,chat:i,threadId:o,maxId:l})})}),Object(s.b)("markMessagesRead",(e,t,a)=>{const s=Object(r.s)(e);if(!s)return;const{messageIds:n}=a;Object(p.a)("markMessagesRead",{chat:s,messageIds:n})}),Object(s.b)("loadWebPagePreview",(e,t,a)=>{const{text:n}=a;!async function(e){const t=await Object(p.a)("fetchWebPagePreview",{message:e});Object(s.g)({...Object(s.e)(),webPagePreview:t})}(n)}),Object(s.b)("clearWebPagePreview",e=>{if(e.webPagePreview)return{...e,webPagePreview:void 0}}),Object(s.b)("sendPollVote",(e,t,a)=>{const{chatId:s,messageId:n,options:c}=a,o=Object(r.g)(e,s);o&&Object(p.a)("sendPollVote",{chat:o,messageId:n,options:c})}),Object(s.b)("loadPollOptionResults",(e,t,a)=>{const{chat:n,messageId:c,option:r,offset:i,limit:l,shouldResetVoters:d}=a;!async function(e,t,a,n,c,r){const i=await Object(p.a)("loadPollOptionResults",{chat:e,messageId:t,option:a,offset:n,limit:c});if(!i)return;let l=Object(s.e)();l=Object(o.g)(l,Object(h.c)(i.users,"id"));const{voters:d}=l.pollResults;Object(s.g)({...l,pollResults:{...l.pollResults,voters:{...d,[a]:[...!r&&d&&d[a]?d[a]:[],...i&&i.users.map(e=>e.id)].filter((e,t,a)=>a.indexOf(e)===t)},offsets:{...l.pollResults.offsets?l.pollResults.offsets:{},[a]:i.nextOffset||""}}})}(n,c,r,i,l,d)}),Object(s.b)("forwardMessages",e=>{const{fromChatId:t,messageIds:a,toChatId:n}=e.forwardMessages,c=t?Object(r.g)(e,t):void 0,o=n?Object(r.g)(e,n):void 0,i=t&&a?a.sort((e,t)=>e-t).map(a=>Object(r.l)(e,t,a)).filter(Boolean):void 0;c&&o&&i&&i.length&&function(e,t,a){Object(p.a)("forwardMessages",{fromChat:e,toChat:t,messages:a,serverTimeOffset:Object(s.e)().serverTimeOffset}),Object(s.g)({...Object(s.e)(),forwardMessages:{}})}(c,o,i)}),Object(s.b)("loadScheduledHistory",e=>{const t=Object(r.s)(e);if(!t)return;const{hash:a}=e.scheduledMessages.byChatId[t.id]||{};!async function(e,t){const a=await Object(p.a)("fetchScheduledHistory",{chat:e,hash:t});if(!a)return;const{hash:n,messages:c}=a,r=Object(h.c)(c,"id"),i=Object.keys(r).map(Number).sort((e,t)=>t-e);let l=Object(s.e)();l=Object(o.v)(l,e.id,r,n),l=Object(o.y)(l,e.id,b.MAIN_THREAD_ID,"scheduledIds",i),Object(s.g)(l)}(t,a)}),Object(s.b)("sendScheduledMessages",(e,t,a)=>{const{chatId:s,id:n}=a,c=Object(r.g)(e,s);c&&Object(p.a)("sendScheduledMessages",{chat:c,ids:[n]})}),Object(s.b)("rescheduleMessage",(e,t,a)=>{const{chatId:s,messageId:n,scheduledAt:c}=a,o=Object(r.g)(e,s),i=o&&Object(r.rb)(e,o.id,n);o&&i&&Object(p.a)("rescheduleMessage",{chat:o,message:i,scheduledAt:c})}),Object(s.b)("requestThreadInfoUpdate",(e,t,a)=>{const{chatId:s,threadId:n}=a,c=Object(r.Gb)(e,s,n);c&&Object(p.a)("requestThreadInfoUpdate",{chat:c,threadId:n})}),Object(s.b)("loadPinnedMessages",(e,t,a)=>{const{chatId:n}=a,c=Object(r.g)(e,n);c&&async function(e){const t=await Object(p.a)("fetchPinnedMessages",{chat:e});if(!t)return;const{messages:a,chats:n,users:c}=t,r=Object(h.c)(a,"id"),i=Object.keys(r).map(Number).sort((e,t)=>t-e);let l=Object(s.e)();l=Object(o.b)(l,e.id,r),l=Object(o.y)(l,e.id,b.MAIN_THREAD_ID,"pinnedIds",i),l=Object(o.g)(l,Object(h.c)(c,"id")),l=Object(o.c)(l,Object(h.c)(n,"id")),Object(s.g)(l)}(c)});var P=a(54);const A=Object(f.h)(e=>e(),500,!1);async function R(e,t){const a=await Object(p.a)("searchGifs",{query:e,offset:t});a&&Object(s.g)(Object(o.R)(Object(s.e)(),!t,a.gifs,a.nextOffset))}Object(s.b)("loadStickerSets",e=>{const{hash:t}=e.stickers.added||{};!async function(e=0){const t=await Object(p.a)("fetchStickerSets",{hash:e});if(!t)return;Object(s.g)(Object(o.jb)(Object(s.e)(),"added",t.hash,t.sets))}(t)}),Object(s.b)("loadAddedStickers",(e,t)=>{const{setIds:a}=e.stickers.added;a&&a.length&&(async()=>{for(let e=0;e0&&await Object(f.f)(500)})()}),Object(s.b)("loadRecentStickers",e=>{const{hash:t}=e.stickers.recent||{};!async function(e=0){const t=await Object(p.a)("fetchRecentStickers",{hash:e});if(!t)return;const a=Object(s.e)();Object(s.g)({...a,stickers:{...a.stickers,recent:t}})}(t)}),Object(s.b)("loadFavoriteStickers",e=>{const{hash:t}=e.stickers.favorite||{};!async function(e=0){const t=await Object(p.a)("fetchFavoriteStickers",{hash:e});if(!t)return;const a=Object(s.e)();Object(s.g)({...a,stickers:{...a.stickers,favorite:t}})}(t)}),Object(s.b)("loadGreetingStickers",e=>{const{hash:t}=e.stickers.greeting||{};(async()=>{const e=await Object(p.a)("fetchStickersForEmoji",{emoji:"👋⭐️",hash:t});if(!e)return;const a=Object(s.e)();Object(s.g)({...a,stickers:{...a.stickers,greeting:{hash:e.hash,stickers:e.stickers.filter(e=>"👋"===e.emoji)}}})})()}),Object(s.b)("loadFeaturedStickers",e=>{const{hash:t}=e.stickers.featured||{};!async function(e=0){const t=await Object(p.a)("fetchFeaturedStickers",{hash:e});if(!t)return;Object(s.g)(Object(o.jb)(Object(s.e)(),"featured",t.hash,t.sets))}(t)}),Object(s.b)("loadStickers",(e,t,a)=>{const{stickerSetId:n}=a;let{stickerSetAccessHash:c}=a;if(!c){const t=Object(r.zb)(e,n);if(!t)return;c=t.accessHash}!async function(e,t){const a=await Object(p.a)("fetchStickers",{stickerSetId:e,accessHash:t});if(!a)return;const{set:n,stickers:c,packs:r}=a;let i=Object(s.e)();i=Object(o.ib)(i,n.id,{...n,stickers:c,packs:r});const l=i.stickers.forEmoji.emoji;l&&r[l]&&(i=Object(o.p)(i));Object(s.g)(i)}(n,c)}),Object(s.b)("loadAnimatedEmojis",()=>{!async function(){const e=await Object(p.a)("fetchAnimatedEmojis");if(!e)return;const{set:t,stickers:a}=e;Object(s.g)(Object(o.r)(Object(s.e)(),{...t,stickers:a}))}()}),Object(s.b)("loadSavedGifs",e=>{const{hash:t}=e.gifs.saved;!async function(e=0){const t=await Object(p.a)("fetchSavedGifs",{hash:e});if(!t)return;const a=Object(s.e)();Object(s.g)({...a,gifs:{...a.gifs,saved:t}})}(t)}),Object(s.b)("faveSticker",(e,t,a)=>{const{sticker:s}=a;s&&Object(p.a)("faveSticker",{sticker:s})}),Object(s.b)("unfaveSticker",(e,t,a)=>{const{sticker:n}=a;n&&function(e){const t=Object(s.e)();Object(s.g)({...t,stickers:{...t.stickers,favorite:{...t.stickers.favorite,stickers:t.stickers.favorite.stickers.filter(({id:t})=>t!==e.id)}}}),Object(p.a)("faveSticker",{sticker:e,unfave:!0})}(n)}),Object(s.b)("toggleStickerSet",(e,t,a)=>{const{stickerSetId:s}=a,n=Object(r.zb)(e,s);if(!n)return;const{accessHash:c,installedDate:o}=n;Object(p.a)(o?"uninstallStickerSet":"installStickerSet",{stickerSetId:s,accessHash:c})}),Object(s.b)("loadEmojiKeywords",(e,t,a)=>{const{language:n}=a;let c=e.emojiKeywords[n];c&&c.isLoading||(Object(s.g)({...e,emojiKeywords:{...e.emojiKeywords,[n]:{...c,isLoading:!0}}}),(async()=>{const t=await Object(p.a)("fetchEmojiKeywords",{language:n,fromVersion:c?c.version:0});e=Object(s.e)(),c=e.emojiKeywords[n],t?Object(s.g)({...e,emojiKeywords:{...e.emojiKeywords,[n]:{isLoading:!1,version:t.version,keywords:{...c&&c.keywords,...t.keywords}}}}):Object(s.g)({...e,emojiKeywords:{...e.emojiKeywords,[n]:{...c,isLoading:!1}}})})())}),Object(s.b)("setStickerSearchQuery",(e,t,a)=>{const{query:n}=a;n&&A(()=>{!async function(e,t=0){const a=await Object(p.a)("searchStickers",{query:e,hash:t});if(!a)return;const n=Object(s.e)(),{setsById:c,added:r}=n.stickers,i=a.sets.map(({id:e})=>e);r.setIds&&r.setIds.forEach(t=>{if(!i.includes(t)){const{title:a}=c[t]||{};a&&Object(P.a)(a,e)&&i.unshift(t)}});Object(s.g)(Object(o.jb)(n,"search",a.hash,a.sets,i))}(n)})}),Object(s.b)("setGifSearchQuery",(e,t,a)=>{const{query:s}=a;"string"==typeof s&&A(()=>{R(s)})}),Object(s.b)("searchMoreGifs",e=>{const{query:t,offset:a}=e.gifs.search;"string"==typeof t&&A(()=>{R(t,a)})}),Object(s.b)("loadStickersForEmoji",(e,t,a)=>{const{emoji:n}=a,{hash:c}=e.stickers.forEmoji;A(()=>{!async function(e,t=0){let a=Object(s.e)();Object(s.g)({...a,stickers:{...a.stickers,forEmoji:{...a.stickers.forEmoji,emoji:e}}});const n=await Object(p.a)("fetchStickersForEmoji",{emoji:e,hash:t});if(a=Object(s.e)(),!n||a.stickers.forEmoji.emoji!==e)return;a=Object(o.kb)(a,e,n.stickers,n.hash),Object(s.g)(a)}(n,c)})}),Object(s.b)("clearStickersForEmoji",e=>({...e,stickers:{...e.stickers,forEmoji:{}}}));var x=a(31);const L=Object(f.h)(e=>e(),500,!1);async function B(e="",t,a,c,i,l){let d;if(c){const s=await Object(p.a)("searchMessagesLocal",{chatOrUser:c,query:e,type:t,limit:n.G,offsetId:a,minDate:l,maxDate:i});if(s){const{messages:e,users:t,totalCount:a,nextOffsetId:n}=s;d={messages:e,users:t,chats:[],totalCount:a,nextRate:n}}}else d=await Object(p.a)("searchMessagesGlobal",{query:e,offsetRate:a,limit:n.G,type:t,maxDate:i,minDate:l});let b=Object(s.e)();const u=Object(r.u)(b);if(!d||""!==e&&e!==u)return void Object(s.g)(Object(o.U)(b,{messages:!1}));const{messages:m,users:O,chats:j,totalCount:g,nextRate:f}=d;j.length&&(b=Object(o.c)(b,Object(h.c)(j,"id"))),O.length&&(b=Object(o.g)(b,Object(h.c)(O,"id"))),m.length&&(b=Object(o.d)(b,m)),b=Object(o.V)(b,m,g,t,f),Object(s.g)(b)}async function D(){const e=await Object(p.a)("fetchChats",{limit:n.l,archived:!0,withPinned:!0,serverTimeOffset:Object(s.e)().serverTimeOffset});if(!e)return;let t=Object(s.e)();t=Object(o.rb)(t,Object(h.c)(e.users,"id")),t=Object(o.N)(t,Object(h.c)(e.chats,"id")),t=Object(o.s)(t,"archived",e.chatIds),t=Object(o.K)(t,"archived",e),Object(s.g)(t)}async function F(){let e=Object(s.e)();const{recentlyFoundChatIds:t}=e.globalSearch,{userIds:a}=e.contactList||{};if(!(a&&a.length||t&&t.length))return;const n=[...t||[],...a||[]].map(t=>Object(r.Jb)(e,t)).filter(Boolean),c=await Object(p.a)("fetchUsers",{users:n});c&&(e=Object(s.e)(),e=Object(o.rb)(e,Object(h.c)(c,"id")),Object(s.g)(e))}function U(e){return Object(p.a)("fetchMessages",{chat:e,threadId:b.MAIN_THREAD_ID,offsetId:e.lastReadInboxMessageId,addOffset:-(Math.round(n.gb/2)+1),limit:n.gb})}Object(s.b)("setGlobalSearchQuery",(e,t,a)=>{const{chatId:n}=e.globalSearch,{query:c}=a;c&&!n&&L(()=>{!async function(e){const t=await Object(p.a)("searchChats",{query:e});let a=Object(s.e)();const n=Object(r.u)(a);if(!t||!n||e!==n)return void Object(s.g)(Object(o.U)(a,{chats:!1}));const{localChats:c,localUsers:i,globalChats:l,globalUsers:d}=t;(c.length||l.length)&&(a=Object(o.c)(a,Object(h.c)([...c,...l],"id")));(i.length||d.length)&&(a=Object(o.g)(a,Object(h.c)([...i,...d],"id")));a=Object(o.U)(a,{chats:!1}),a=Object(o.S)(a,{localResults:{chatIds:c.map(({id:e})=>e),userIds:i.map(({id:e})=>e)},globalResults:{...a.globalSearch.globalResults,chatIds:d.map(({id:e})=>e),userIds:l.map(({id:e})=>e)}}),Object(s.g)(a)}(c)})}),Object(s.b)("setGlobalSearchDate",(e,t,a)=>{const{date:n}=a,c=n?Object(x.m)(n):n,i=Object(o.S)(e,{date:n,query:"",resultsByType:{...e.globalSearch.resultsByType,text:{totalCount:void 0,foundIds:[],nextOffsetId:0}}});Object(s.g)(i);const{chatId:l}=e.globalSearch;B("","text",void 0,l?Object(r.g)(e,l):void 0,c,n)}),Object(s.b)("searchMessagesGlobal",(e,t,a)=>{const{query:s,resultsByType:n,chatId:c,date:o}=e.globalSearch,i=o?Object(x.m)(o):o,{type:l}=a,{nextOffsetId:d}=n&&n[l]||{};B(s,l,d,c?Object(r.g)(e,c):void 0,i,o)}),Object(s.b)("searchTextMessagesLocal",e=>{const{chatId:t,threadId:a}=Object(r.z)(e)||{},c=t?Object(r.g)(e,t):void 0,i=Object(r.B)(e);if(!c||!i||!a)return;const{query:l,results:d}=i,u=d?d.nextOffsetId:void 0;let m;if(a!==b.MAIN_THREAD_ID){const s=Object(r.Fb)(e,t,a);m=s?s.topMessageId:void 0}!async function(e,t,a,c,i){const l=await Object(p.a)("searchMessagesLocal",{chatOrUser:e,type:"text",query:c,topMessageId:a,limit:n.ib,offsetId:i});if(!l)return;const{messages:d,users:b,totalCount:u,nextOffsetId:m}=l,O=Object(h.c)(d,"id"),j=Object.keys(O).map(Number);let g=Object(s.e)();const f=Object(r.B)(g);if(!f||c&&c!==f.query)return;g=Object(o.b)(g,e.id,O),g=Object(o.g)(g,Object(h.c)(b,"id")),g=Object(o.ab)(g,e.id,t,j,u,m),Object(s.g)(g)}(c,a,m,l,u)}),Object(s.b)("searchMediaMessagesLocal",e=>{const t=Object(r.x)(e),a=t?e.users.byId[t]||e.chats.byId[t]:void 0,c=Object(r.w)(e);if(!a||!c)return;const{currentType:i,resultsByType:l}=c,d=i&&l&&l[i],b=d?d.nextOffsetId:void 0;i&&async function(e,t,a){const c=await Object(p.a)("searchMessagesLocal",{chatOrUser:e,type:t,limit:n.Ab,offsetId:a});if(!c)return;const{messages:i,users:l,totalCount:d,nextOffsetId:b}=c,u=Object(h.c)(i,"id"),m=Object.keys(u).map(Number);let O=Object(s.e)();if(!Object(r.w)(O))return;O=Object(o.b)(O,e.id,u),O=Object(o.g)(O,Object(h.c)(l,"id")),O=Object(o.X)(O,e.id,t,m,d,b),Object(s.g)(O)}(a,i,b)}),Object(s.b)("searchMessagesByDate",(e,t,a)=>{const{timestamp:n}=a,{chatId:c}=Object(r.z)(e)||{};if(!c)return;const o=Object(r.g)(e,c);o&&async function(e,t){const a=await Object(p.a)("findFirstMessageIdAfterDate",{chat:e,timestamp:t});if(!a)return;Object(s.d)().focusMessage({chatId:e.id,messageId:a})}(o,n)}),Object(s.b)("checkPublicLink",(e,t,a)=>{const{chatId:n}=Object(r.z)(e)||{};if(!n)return;if(e.management.progress===u.f.InProgress)return;const{username:c}=a;(async()=>{e=Object(o.cb)(e,u.f.InProgress),e=Object(o.bb)(e,n,{isUsernameAvailable:void 0}),Object(s.g)(e);const t=await Object(p.a)("checkChatUsername",{username:c});e=Object(s.e)(),e=Object(o.cb)(e,t?u.f.Complete:u.f.Error),e=Object(o.bb)(e,n,{isUsernameAvailable:t}),Object(s.g)(e)})()}),Object(s.b)("updatePublicLink",(e,t,a)=>{const{chatId:n}=Object(r.z)(e)||{};let c=n&&Object(r.g)(e,n);if(!n||!c)return;const{username:i}=a;(async()=>{if(e=Object(o.cb)(e,u.f.InProgress),Object(s.g)(e),Object(l.lb)(c)){if(c=await Object(p.a)("migrateChat",c),!c)return;t.openChat({id:c.id})}const a=await Object(p.a)("setChatUsername",{chat:c,username:i});e=Object(s.e)(),e=Object(o.cb)(e,a?u.f.Complete:u.f.Error),e=Object(o.bb)(e,n,{isUsernameAvailable:void 0}),Object(s.g)(e)})()}),Object(s.b)("updatePrivateLink",e=>{const{chatId:t}=Object(r.z)(e)||{},a=t&&Object(r.g)(e,t);t&&a&&Object(p.a)("updatePrivateLink",{chat:a})}),Object(s.b)("sync",(e,t)=>{!async function(e){n.r&&console.log(">>> START SYNC");await Object(p.a)("fetchCurrentUser");const t=await async function(){const e=await Object(p.a)("fetchChats",{limit:n.l,withPinned:!0,serverTimeOffset:Object(s.e)().serverTimeOffset});if(!e)return;let t=Object(s.e)();const{recentlyFoundChatIds:a}=t.globalSearch,{userIds:c}=t.contactList||{},{currentUserId:i}=t,d=[...a||[],...c||[],...i?[i]:[]],u=d.map(e=>Object(r.Jb)(t,e)).filter(Boolean),m=d.map(e=>Object(r.g)(t,e)).filter(Boolean),{chatId:O}=Object(r.z)(t)||{};if(O){const e=Object(r.g)(t,O);if(e&&!d.includes(O)&&m.push(e),Object(l.ob)(O)){const e=Object(r.Jb)(t,O);e&&!d.includes(O)&&u.push(e)}}u.push(...e.users),m.push(...e.chats),t=Object(o.t)(t,Object(h.c)(m,"id")),t=Object(o.s)(t,"active",e.chatIds),t={...t,chats:{...t.chats}},t=Object(o.K)(t,"active",e),Object.keys(e.draftsById).map(Number).forEach(a=>{t=Object(o.y)(t,a,b.MAIN_THREAD_ID,"draft",e.draftsById[a])}),Object.keys(e.replyingToById).map(Number).forEach(a=>{t=Object(o.y)(t,a,b.MAIN_THREAD_ID,"replyingToId",e.replyingToById[a])}),Object(s.g)(t),O&&!t.chats.byId[O]&&Object(s.d)().openChat({id:void 0});return u}();await async function(e){let t=!1,a=e||[],n=Object(s.e)();const{chatId:c,threadId:i}=Object(r.z)(n)||{},l=Object.keys(n.messages.byChatId).map(Number).reduce((e,t)=>{const a=Object(r.C)(n,t,b.MAIN_THREAD_ID);return a?{...e,[t]:a}:e},{});if(c){const e=await U(n.chats.byId[c]);n=Object(s.e)();const{chatId:l}=Object(r.z)(n)||{},d=i&&Object(r.Fb)(n,c,i);if(e&&l===c){const s=n.messages.byChatId[c],r=Object(h.c)(e.messages,"id"),l=Object.keys(r).map(Number);if(n={...n,messages:{...n.messages,byChatId:{[c]:{byId:r,threadsById:{[b.MAIN_THREAD_ID]:{...s&&s.threadsById[b.MAIN_THREAD_ID],listedIds:l,viewportIds:l,outlyingIds:void 0}}}}}},i&&d&&d.originChannelId){const{originChannelId:e}=d,t=n.messages.byChatId[e],a=await U(n.chats.byId[e]);if(a){const e=Object(h.c)(a.messages,"id"),o=Object.keys(e).map(Number);n={...n,messages:{...n.messages,byChatId:{...n.messages.byChatId,[d.originChannelId]:{byId:e,threadsById:{[b.MAIN_THREAD_ID]:{...t&&t.threadsById[b.MAIN_THREAD_ID],listedIds:o,viewportIds:o,outlyingIds:void 0}}},[c]:{...n.messages.byChatId[c],threadsById:{...n.messages.byChatId[c].threadsById,[i]:{...s&&s.threadsById[i],outlyingIds:void 0}}}}}}}}n=Object(o.N)(n,Object(h.c)(e.chats,"id")),n=Object(o.mb)(n,c,e.threadInfos),t=!0,a=Array.prototype.concat(a,e.users)}}t||(n={...n,messages:{...n.messages,byChatId:{}}});Object.keys(l).map(Number).forEach(e=>{n=Object(o.y)(n,e,b.MAIN_THREAD_ID,"draft",l[e])}),e?n=Object(o.z)(n,Object(h.c)(a,"id")):a&&(n=Object(o.rb)(n,Object(h.c)(a,"id")));Object(s.g)(n);const{chatId:d,messageId:u}=n.audioPlayer;d&&u&&!Object(r.l)(n,d,u)&&Object(s.d)().closeAudioPlayer()}(t),Object(s.g)({...Object(s.e)(),lastSyncTime:Date.now()}),n.r&&console.log(">>> FINISH SYNC");e()}(t.afterSync)}),Object(s.b)("afterSync",(e,t)=>{!async function(e){n.r&&console.log(">>> START AFTER-SYNC");e.loadFavoriteStickers(),await Promise.all([F(),D()]),await Object(p.a)("fetchCurrentUser"),n.r&&console.log(">>> FINISH AFTER-SYNC")}(t)});const H=Object(f.a)(e=>e(),500,!1,!0),q=Object(f.h)(e=>e(),500,!1);function G(e,t,a){return{...e,inlineBots:{...e.inlineBots,byUsername:{...e.inlineBots.byUsername,[t]:a}}}}function _(e,t){return{...e,inlineBots:{...e.inlineBots,isLoading:t}}}Object(s.b)("loadFullUser",(e,t,a)=>{const{userId:s}=a,n=Object(r.Jb)(e,s);if(!n)return;const{id:c,accessHash:o}=n;H(()=>Object(p.a)("fetchFullUser",{id:c,accessHash:o}))}),Object(s.b)("loadUser",(e,t,a)=>{const{userId:n}=a,c=Object(r.Jb)(e,n);c&&(async()=>{const t=await Object(p.a)("fetchUsers",{users:[c]});t&&(e=Object(s.e)(),e=Object(o.rb)(e,Object(h.c)(t,"id")),Object(s.g)(e))})()}),Object(s.b)("loadTopUsers",e=>{const{serverTimeOffset:t,topPeers:{hash:a,lastRequestedAt:n}}=e;(!n||Date.now()/1e3+t-n>60)&&async function(e){const t=await Object(p.a)("fetchTopUsers",{hash:e});if(!t)return;const{hash:a,ids:n,users:c}=t;let r=Object(s.e)();r=Object(o.g)(r,Object(h.c)(c,"id")),r={...r,topPeers:{...r.topPeers,hash:a,userIds:n,lastRequestedAt:Date.now()/1e3+r.serverTimeOffset}},Object(s.g)(r)}(a)}),Object(s.b)("loadContactList",e=>{const{hash:t}=e.contactList||{};!async function(e){const t=await Object(p.a)("fetchContactList",{hash:e});if(!t)return;let a=Object(o.g)(Object(s.e)(),Object(h.c)(t.users,"id"));a=Object(o.c)(a,Object(h.c)(t.chats,"id"));const n=e=>e.lastName||e.firstName||"",c=new Intl.Collator("en-US"),r=t.users.sort((e,t)=>c.compare(n(e),n(t))).filter(e=>!e.isSelf);Object(s.g)({...a,contactList:{hash:t.hash,userIds:r.map(e=>e.id)}})}(t)}),Object(s.b)("loadCurrentUser",()=>{Object(p.a)("fetchCurrentUser")}),Object(s.b)("updateContact",(e,t,a)=>{const{userId:n,isMuted:c,firstName:i,lastName:l}=a;!async function(e,t,a,n){const c=Object(s.e)(),i=Object(r.Jb)(c,e);if(!i)return;Object(s.d)().updateChatMutedState({chatId:e,isMuted:t}),Object(s.g)(Object(o.cb)(Object(s.e)(),u.f.InProgress));await Object(p.a)("updateContact",{phone:i.phoneNumber,firstName:a,lastName:n})&&Object(s.g)(Object(o.ob)(Object(s.e)(),i.id,{firstName:a,lastName:n}));Object(s.g)(Object(o.cb)(Object(s.e)(),u.f.Complete))}(n,c,i,l)}),Object(s.b)("deleteUser",(e,t,a)=>{const{userId:n}=a;!async function(e){const t=Object(s.e)(),a=Object(r.Jb)(t,e);if(!a)return;const{id:n,accessHash:c}=a;await Object(p.a)("deleteUser",{id:n,accessHash:c})}(n)}),Object(s.b)("loadProfilePhotos",(e,t,a)=>{const{profileId:n}=a,c=Object(l.ob)(n),i=c?Object(r.Jb)(e,n):void 0,d=c?void 0:Object(r.g)(e,n);(async()=>{const e=await Object(p.a)("fetchProfilePhotos",i,d);if(!e||!e.photos)return;let t=Object(s.e)();c?t=Object(o.ob)(t,n,{photos:e.photos}):(t=Object(o.g)(t,Object(h.c)(e.users,"id")),t=Object(o.I)(t,n,{photos:e.photos})),Object(s.g)(t)})()}),Object(s.b)("setUserSearchQuery",(e,t,a)=>{const{query:n}=a;n&&q(()=>{!async function(e){const t=await Object(p.a)("searchChats",{query:e});let a=Object(s.e)();const n=a.userSearch.query;if(!t||!n||e!==n)return void Object(s.g)(Object(o.qb)(a,!1));const{localUsers:c,globalUsers:r}=t;let i,l;c.length&&(a=Object(o.g)(a,Object(h.c)(c,"id")),i=c.map(({id:e})=>e));r.length&&(a=Object(o.g)(a,Object(h.c)(r,"id")),l=r.map(({id:e})=>e));a=Object(o.qb)(a,!1),a=Object(o.pb)(a,{localUserIds:i,globalUserIds:l}),Object(s.g)(a)}(n)})});const z=Object(f.a)(e=>e(),500,!1);async function $(e,t,a){await Object(p.a)("sendMessage",{chat:e,text:a})}Object(s.b)("clickInlineButton",(e,t,a)=>{const{button:c}=a;switch(c.type){case"command":t.sendBotCommand({command:c.value});break;case"url":c.value.match(n.tb)||c.value.match(n.ub)?t.openTelegramLink({url:c.value}):t.toggleSafeLinkModal({url:c.value});break;case"callback":{const t=Object(r.s)(e);if(!t)return;!async function(e,t,a){const n=await Object(p.a)("answerCallbackButton",{chatId:e.id,accessHash:e.accessHash,messageId:t,data:a});if(!n||!n.message)return;const{message:c,alert:o}=n;o?Object(s.d)().showDialog({data:{message:c}}):Object(s.d)().showNotification({message:c})}(t,c.messageId,c.value);break}case"requestPoll":t.openPollModal();break;case"buy":{const a=Object(r.s)(e),{messageId:s,value:n}=c;if(!a)return;n?t.getReceipt({receiptMessageId:n,chatId:a.id,messageId:s}):(t.getPaymentForm({messageId:s}),t.setInvoiceMessageInfo(Object(r.l)(e,a.id,s)),t.openPaymentModal({messageId:s}));break}}}),Object(s.b)("sendBotCommand",(e,t,a)=>{const{command:s,chatId:n}=a,{currentUserId:c}=e,o=n?Object(r.g)(e,n):Object(r.s)(e);c&&o&&$(o,c,s)}),Object(s.b)("restartBot",(e,t,a)=>{const{chatId:n}=a,{currentUserId:c}=e,i=Object(r.s)(e),l=c&&Object(r.h)(e,n);c&&i&&l&&(async()=>{await Object(p.a)("unblockContact",l.id,l.accessHash)&&(Object(s.g)(Object(o.q)(Object(s.e)(),l.id)),$(i,c,"/start"))})()}),Object(s.b)("loadTopInlineBots",e=>{const{serverTimeOffset:t}=e,{hash:a,lastRequestedAt:n}=e.topInlineBots;n&&Date.now()+t-n<6e4||(async()=>{const e=await Object(p.a)("fetchTopInlineBots",{hash:a});if(!e)return;const{hash:t,ids:n,users:c}=e;let r=Object(s.e)();r=Object(o.g)(r,Object(h.c)(c,"id")),r={...r,topInlineBots:{...r.topInlineBots,hash:t,userIds:n,lastRequestedAt:Date.now()}},Object(s.g)(r)})()}),Object(s.b)("queryInlineBot",(e,t,a)=>{const{chatId:n,username:c,query:i,offset:l}=a;(async()=>{let t=e.inlineBots.byUsername[c];if(!1!==t){if(void 0===t){const{user:a,chat:n}=await Object(p.a)("fetchInlineBot",{username:c})||{};if(e=Object(s.e)(),!a||!n)return void Object(s.g)(G(e,c,!1));e=Object(o.g)(e,{[a.id]:a}),e=Object(o.c)(e,{[n.id]:n}),t={id:a.id,query:"",offset:"",switchPm:void 0,canLoadMore:!0,results:[]},e=G(e,c,t),Object(s.g)(e)}(i!==t.query||t.canLoadMore)&&z(()=>{!async function({username:e,inlineBotData:t,chatId:a,query:n,offset:c}){let o=Object(s.e)();const i=Object(r.Jb)(o,t.id),l=Object(r.g)(o,a);if(!i||!l)return;const d=t.query!==n;o=_(o,!0),o=G(o,e,{...t,query:n,...d&&{offset:void 0,results:[]}}),Object(s.g)(o);const b=await Object(p.a)("fetchInlineBotResults",{bot:i,chat:l,query:n,offset:d?void 0:c}),u=o.inlineBots.byUsername[e];if(o=_(Object(s.e)(),!1),!b||!u||n!==u.query)return void Object(s.g)(o);const m=new Set((u.results||[]).map(e=>e.id)),h=b.results.filter(e=>!m.has(e.id));o=G(o,e,{...u,help:b.help,...h.length&&{isGallery:b.isGallery},...b.switchPm&&{switchPm:b.switchPm},canLoadMore:b.results.length>0&&Boolean(b.nextOffset),results:""===u.offset||u.offset===b.nextOffset?b.results:(u.results||[]).concat(h),offset:h.length?b.nextOffset:""}),Object(s.g)(o)}({username:c,inlineBotData:t,chatId:n,query:i,offset:l})})}})()}),Object(s.b)("sendInlineBotResult",(e,t,a)=>{const{id:s,queryId:n}=a,c=Object(r.z)(e);if(!c||!s)return;const{chatId:o,threadId:i}=c,l=Object(r.g)(e,o);t.setReplyingToId({messageId:void 0}),t.clearWebPagePreview({chatId:o,threadId:i,value:!1}),Object(p.a)("sendInlineBotResult",{chat:l,resultId:s,queryId:n,replyingTo:Object(r.ob)(e,o,i)})}),Object(s.b)("resetInlineBot",(e,t,a)=>{const{username:n}=a;let c=e.inlineBots.byUsername[n];c&&(c={id:c.id,query:"",offset:"",switchPm:void 0,canLoadMore:!0,results:[]},Object(s.g)(G(e,n,c)))});a(88);Object(s.b)("loadPasswordInfo",()=>{(async()=>{const e=await Object(p.a)("getPasswordInfo");if(!e)return;let t=Object(s.e)();t=Object(o.w)(t,{hasPassword:e.hasPassword}),t=Object(o.nb)(t,{hint:e.hint}),Object(s.g)(t)})()}),Object(s.b)("checkPassword",(e,t,a)=>{const{currentPassword:n,onSuccess:c}=a;Object(s.g)(Object(o.nb)(e,{isLoading:!0,error:void 0})),(async()=>{const e=await Object(p.a)("checkPassword",n);Object(s.g)(Object(o.nb)(Object(s.e)(),{isLoading:!1})),e&&c()})()}),Object(s.b)("clearPassword",(e,t,a)=>{const{currentPassword:n,onSuccess:c}=a;Object(s.g)(Object(o.nb)(e,{isLoading:!0,error:void 0})),(async()=>{const e=await Object(p.a)("clearPassword",n);Object(s.g)(Object(o.nb)(Object(s.e)(),{isLoading:!1})),e&&c()})()}),Object(s.b)("updatePassword",(e,t,a)=>{const{currentPassword:n,password:c,hint:r,email:i,onSuccess:l}=a;Object(s.g)(Object(o.nb)(e,{isLoading:!0,error:void 0})),(async()=>{const e=await Object(p.a)("updatePassword",n,c,r,i);Object(s.g)(Object(o.nb)(Object(s.e)(),{isLoading:!1})),e&&l()})()}),Object(s.b)("updateRecoveryEmail",(e,t,a)=>{const{currentPassword:n,email:c,onSuccess:r}=a;Object(s.g)(Object(o.nb)(e,{isLoading:!0,error:void 0})),(async()=>{const e=await Object(p.a)("updateRecoveryEmail",n,c);Object(s.g)(Object(o.nb)(Object(s.e)(),{isLoading:!1,waitingEmailCodeLength:void 0})),e&&r()})()}),Object(s.b)("provideTwoFaEmailCode",(e,t,a)=>{const{code:s}=a;Object(p.a)("provideRecoveryEmailCode",s)}),Object(s.b)("clearTwoFaError",e=>Object(o.nb)(e,{error:void 0}));var V=a(61);Object(s.b)("validateRequestedInfo",(e,t,a)=>{const{requestInfo:n,saveInfo:c}=a,i=Object(r.ib)(e);i&&async function(e,t,a){const n=await Object(p.a)("validateRequestedInfo",{messageId:e,requestInfo:t,shouldSave:a});if(!n)return;const{id:c,shippingOptions:r}=n;if(!c)return;let i=Object(o.F)(Object(s.e)(),c);r?(i=Object(o.hb)(i,r),i=Object(o.D)(i,u.j.Shipping)):i=Object(o.D)(i,u.j.PaymentInfo);Object(s.g)(i)}(i,n,c)}),Object(s.b)("getPaymentForm",(e,t,a)=>{const{messageId:n}=a;n&&async function(e){const t=await Object(p.a)("getPaymentForm",{messageId:e});if(!t)return;let a=Object(o.C)(Object(s.e)(),t),n=u.j.PaymentInfo;a.payment.invoice&&(a.payment.invoice.shippingAddressRequested||a.payment.invoice.nameRequested||a.payment.invoice.phoneRequested||a.payment.invoice.emailRequested)&&(n=u.j.ShippingInfo);a=Object(o.D)(a,n),Object(s.g)(a)}(n)}),Object(s.b)("getReceipt",(e,t,a)=>{const{receiptMessageId:n,chatId:c,messageId:i}=a;i&&n&&c&&async function(e,t,a){const n=await Object(p.a)("getReceipt",t);if(!n)return;let c=Object(s.e)();const i=Object(r.l)(c,a,e);c=Object(o.E)(c,n,i),Object(s.g)(c)}(i,n,c)}),Object(s.b)("clearPaymentError",e=>{Object(s.g)({...e,payment:{...e.payment,error:void 0}})}),Object(s.b)("clearReceipt",e=>{Object(s.g)({...e,payment:{...e.payment,receipt:void 0}})}),Object(s.b)("sendCredentialsInfo",(e,t,a)=>{const n=Object(r.lb)(e);if(!n)return;const{credentials:c}=a,{data:i}=c;!async function(e,t){const a=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}),n=await fetch("https://api.stripe.com/v1/tokens"+a,{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/x-www-form-urlencoded",Authorization:"Bearer "+t}}),c=await n.json();if(c.error){const e=Object(V.b)(c.error),t=Object(s.e)();return void Object(s.g)({...t,payment:{...t.payment,error:{...e}}})}let r=Object(o.G)(Object(s.e)(),{type:c.type,id:c.id});r=Object(o.D)(r,u.j.Checkout),Object(s.g)(r)}(i,n)}),Object(s.b)("sendPaymentForm",(e,t,a)=>{const{shippingOptionId:n,saveCredentials:c}=a,i=Object(r.ib)(e),l=Object(r.jb)(e),d=Object(r.lb)(e),b=Object(r.Bb)(e);i&&d&&async function(e,t,a,n){if(await Object(p.a)("sendPaymentForm",{messageId:e,credentials:t,requestedInfoId:a,shippingOptionId:n})){const e=Object(o.i)(Object(s.e)());Object(s.g)(Object(o.j)(e))}}(i,{save:c,data:b},l,n)}),Object(s.b)("setPaymentStep",(e,t,a={})=>Object(o.D)(e,a.step||u.j.ShippingInfo)),Object(s.b)("setInvoiceMessageInfo",(e,t,a)=>Object(o.B)(e,a));a(89);var W=a(21),K=a(79);const Q=Object(f.h)(e=>e(),1e3,!0);Object(s.b)("apiUpdate",(e,t,a)=>{switch(a["@type"]){case"updateChat":{a.noTopChatsRequest||Object(r.M)(e,a.id)||t.loadTopChats();const n=Object(o.I)(e,a.id,a.chat,a.newProfilePhoto);Object(s.g)(n);const c=Object(r.r)(n);Q(()=>Object(K.a)(c));break}case"updateChatJoin":{const n=Object(r.k)(e,a.id);if(!n)break;e=Object(o.J)(e,n,[a.id]),e=Object(o.I)(e,a.id,{isNotJoined:!1}),Object(s.g)(e);const c=Object(r.g)(e,a.id);c&&t.requestChatUpdate({chatId:c.id});break}case"updateChatLeave":{const t=Object(r.k)(e,a.id);if(!t)break;const{[t]:n}=e.chats.listIds;n&&(e=Object(o.s)(e,t,n.filter(e=>e!==a.id))),e=Object(o.I)(e,a.id,{isNotJoined:!0}),Object(s.g)(e);break}case"updateChatInbox":Object(s.g)(Object(o.I)(e,a.id,a.chat));break;case"updateChatTypingStatus":{const{id:t,typingStatus:n}=a;Object(s.g)(Object(o.I)(e,t,{typingStatus:n})),setTimeout(()=>{const e=Object(s.e)(),a=Object(r.g)(e,t);a&&n&&a.typingStatus&&a.typingStatus.timestamp===n.timestamp&&Object(s.g)(Object(o.I)(e,t,{typingStatus:void 0}))},6e3);break}case"newMessage":{const{message:n}=a,{chatId:c,threadId:i,type:l}=Object(r.z)(e)||{};if(n.senderId===e.currentUserId&&!n.isFromScheduled)return;const d=Object(r.g)(e,a.chatId);if(!d)return;const u="thread"===l&&i===b.MAIN_THREAD_ID&&a.chatId===c;u?setTimeout(()=>{t.requestChatUpdate({chatId:a.chatId})},1e3):Object(s.g)(Object(o.I)(e,a.chatId,{unreadCount:d.unreadCount?d.unreadCount+1:1,...a.message.hasUnreadMention&&{unreadMentionsCount:d.unreadMentionsCount?d.unreadMentionsCount+1:1}}));const m=Object(r.r)(Object(s.e)());Object(K.a)(m);const{hasWebNotifications:h}=Object(r.fb)(e);h&&Object(W.c)({chat:d,message:n,isActiveChat:u});break}case"updateCommonBoxMessages":case"updateChannelMessages":{const{ids:t,messageUpdate:n}=a;if(!1!==n.hasUnreadMention)return;t.forEach(t=>{const s="channelId"in a?a.channelId:Object(r.q)(e,t),n=Object(r.g)(e,s);n&&n.unreadMentionsCount&&(e=Object(o.I)(e,s,{unreadMentionsCount:n.unreadMentionsCount-1}))}),Object(s.g)(e);break}case"updateChatFullInfo":{const{fullInfo:t}=a,n=e.chats.byId[a.id];if(!n)return;Object(s.g)(Object(o.I)(e,a.id,{fullInfo:{...n.fullInfo,...t}}));break}case"updatePinnedChatIds":{const{ids:t,folderId:c}=a,o=c===n.i?"archived":"active";e={...e,chats:{...e.chats,orderedPinnedIds:{...e.chats.orderedPinnedIds,[o]:t.length?t:void 0}}},Object(s.g)(e);break}case"updateChatPinned":{const{id:t,isPinned:c}=a,o=Object(r.k)(e,t);if(o){const{[o]:a}=e.chats.orderedPinnedIds;let s=a||[];if(c){if(!s.includes(t)){if("active"===o&&s.length>=n.V){const t=e.chats.listIds.active;s=s.filter(e=>t&&t.includes(e))}s=[t,...s]}}else s=s.filter(e=>e!==t);e={...e,chats:{...e.chats,orderedPinnedIds:{...e.chats.orderedPinnedIds,[o]:s.length?s:void 0}}}}Object(s.g)(e);break}case"updateChatListType":{const{id:t,folderId:n}=a;Object(s.g)(Object(o.L)(e,t,n));break}case"updateChatFolder":{const{id:t,folder:n}=a,{byId:c,orderedIds:o}=e.chatFolders,r=n?{...c,[t]:n}:Object(h.l)(c,Object.keys(c).map(Number).filter(e=>e!==t)),i=n?o&&o.includes(t)?o:[...o||[],t]:o?o.filter(e=>e!==t):void 0;Object(s.g)({...e,chatFolders:{...e.chatFolders,byId:r,orderedIds:i}});break}case"updateChatFoldersOrder":{const{orderedIds:t}=a;Object(s.g)({...e,chatFolders:{...e.chatFolders,orderedIds:t}});break}case"updateRecommendedChatFolders":{const{folders:t}=a;Object(s.g)({...e,chatFolders:{...e.chatFolders,recommended:t}});break}case"updateChatMembers":{const t=e.chats.byId[a.id],{replacedMembers:n,addedMember:c,deletedMemberId:r}=a;if(!t)return;let i=!1,l=t.fullInfo&&t.fullInfo.members?[...t.fullInfo.members]:[];if(n)l=n,i=!0;else if(c)l.length&&l.some(e=>e.userId===c.userId)||(l.push(c),i=!0);else if(l.length&&r){const e=l.findIndex(e=>e.userId===r);e>-1&&(l.slice(e,1),i=!0)}if(i){const n=l.filter(({isOwner:e,isAdmin:t})=>e||t);Object(s.g)(Object(o.I)(e,a.id,{membersCount:l.length,fullInfo:{...t.fullInfo,members:l,adminMembers:n}}))}break}case"deleteProfilePhotos":{const{chatId:t,ids:n}=a,c=e.chats.byId[t];c&&c.photos&&Object(s.g)(Object(o.I)(e,t,{photos:c.photos.filter(e=>!n.includes(e.id))}));break}case"draftMessage":{const{chatId:t,formattedText:n,date:c,replyingToId:r}=a;e.chats.byId[t]&&(e=Object(o.y)(e,t,b.MAIN_THREAD_ID,"draft",n),e=Object(o.y)(e,t,b.MAIN_THREAD_ID,"replyingToId",r),e=Object(o.I)(e,t,{draftDate:c}),Object(s.g)(e));break}case"showInvite":{const{data:e}=a;t.showDialog({data:e});break}}});function J(e,t,a,s,n=!1){const c=n?Object(r.rb)(e,t,a):Object(r.l)(e,t,a);if(c&&s.content){const{photo:e,video:t,sticker:a,document:n}=Object(l.v)(c);e&&s.content.photo?(s.content.photo.blobUrl=e.blobUrl,s.content.photo.thumbnail=e.thumbnail):t&&s.content.video?s.content.video.blobUrl=t.blobUrl:a&&s.content.sticker?s.content.sticker.isPreloadedGlobally=a.isPreloadedGlobally:n&&s.content.document&&(s.content.document.previewBlobUrl=n.previewBlobUrl)}return n?Object(o.fb)(e,t,a,s):Object(o.M)(e,t,a,s)}function Y(e,t){const{id:a,chatId:s}=t,{threadInfo:n,firstMessageId:c}=Object(r.Eb)(e,s,t)||{},i=Object(r.g)(e,s),d=i&&i.unreadCount&&!Object(r.Z)(e,s,b.MAIN_THREAD_ID);if(n&&(!c&&Object(l.xb)(t)||(e=Object(o.W)(e,s,n.threadId,[a]),Object(r.Y)(e,s,n.threadId)&&(e=Object(o.h)(e,s,n.threadId,a),c||(e=Object(o.y)(e,s,n.threadId,"firstMessageId",t.id)))),e=Object(o.y)(e,s,n.threadId,"threadInfo",{...n,lastMessageId:t.id,messagesCount:n.messagesCount+1})),d)return e;if(e=Object(o.W)(e,s,b.MAIN_THREAD_ID,[a]),Object(r.Y)(e,s,b.MAIN_THREAD_ID)){const t=Object(r.H)(e,s,b.MAIN_THREAD_ID),n=Object(o.h)(e,s,b.MAIN_THREAD_ID,a),c=Object(r.Kb)(n,s,b.MAIN_THREAD_ID);t&&!c.includes(t)||(e=n)}return e}function X(e,t,a,s=!1){const{chats:n}=e,c=n.byId[t]&&n.byId[t].lastMessage;if(c&&!s){if(!(c.id===a.id||c.id===a.previousLocalId||a.id>c.id))return e}return Object(o.I)(e,t,{lastMessage:a})}function Z(e,t){const a=Object(r.n)(e,t),s=Object(r.Z)(e,t,b.MAIN_THREAD_ID);if(!a||!s)return;let n=s.length;for(;n--;){const e=a[s[n]];if(!e.isDeleting)return e}}function ee(e,t,a,n){if(e){t.forEach(t=>{const a=Z(n=Object(o.M)(n,e,t,{isDeleting:!0}),e);a&&(n=X(n,e,a,!0))}),Object(s.g)(n),a.requestChatUpdate({chatId:e});const c=[];return t.forEach(t=>{const a=Object(r.l)(n,e,t);if(!a)return;const{threadInfo:s}=Object(r.Eb)(n,e,a)||{};s&&c.push(s.threadId)}),void setTimeout(()=>{Object(s.g)(Object(o.k)(Object(s.e)(),e,t)),Object(h.o)(c).forEach(t=>{a.requestThreadInfoUpdate({chatId:e,threadId:t})})},350)}const c=[];t.forEach(e=>{const t=Object(r.q)(n,e);if(t){c.push(t);const a=Z(n=Object(o.M)(n,t,e,{isDeleting:!0}),t);a&&(n=X(n,t,a,!0)),setTimeout(()=>{Object(s.g)(Object(o.k)(Object(s.e)(),t,[e]))},350)}}),Object(s.g)(n),Object(h.o)(c).forEach(e=>{a.requestChatUpdate({chatId:e})})}Object(s.b)("apiUpdate",(e,t,a)=>{switch(a["@type"]){case"newMessage":{const{chatId:n,id:c,message:i}=a;e=Y(e=J(e,n,c,i),i),i.threadInfo&&(e=Object(o.lb)(e,i.threadInfo.chatId,i.threadInfo.threadId,i.threadInfo)),Object(s.g)(e);const d=Object(r.l)(e,n,c);if(Object(r.a)(e,n,i)){if(i.isOutgoing&&(!i.content||!i.content.action)){const a=Object(r.z)(e);a&&t.focusMessage({chatId:n,threadId:a.threadId,messageId:i.id,noHighlight:!0})}const{threadInfo:a}=Object(r.Eb)(e,n,i)||{};a&&t.requestThreadInfoUpdate({chatId:n,threadId:a.threadId}),Object(l.xb)(i)||setTimeout(()=>{Object(s.g)(X(Object(s.e)(),n,d))},350)}else Object(s.g)(X(Object(s.e)(),n,d));Object(r.M)(e,n)||t.loadTopChats();break}case"newScheduledMessage":{const{chatId:t,id:n,message:c}=a;e=J(e,t,n,c,!0);const i=Object(r.qb)(e,t)||[];e=Object(o.y)(e,t,b.MAIN_THREAD_ID,"scheduledIds",Object(h.o)([...i,n])),Object(s.g)(e);break}case"updateMessage":{const{chatId:t,id:n,message:c}=a;if(!Object(r.l)(e,t,n))return;e=J(e,t,n,c);const i=Object(r.l)(e,t,n);c.threadInfo&&(e=Object(o.lb)(e,c.threadInfo.chatId,c.threadInfo.threadId,c.threadInfo)),e=X(e,t,i),Object(s.g)(e);break}case"updateScheduledMessage":{const{chatId:t,id:n,message:c}=a;if(!Object(r.rb)(e,t,n))return;e=J(e,t,n,c,!0);const i=Object.keys(Object(r.sb)(e,t)||{}).map(Number).sort((e,t)=>t-e);e=Object(o.y)(e,t,b.MAIN_THREAD_ID,"scheduledIds",i),Object(s.g)(e);break}case"updateMessageSendSucceeded":{const{chatId:n,localId:c,message:i}=a;e=Y(e,i);const l=Object(r.l)(e,n,c);e=Object(o.k)(e,n,[c]),i.isScheduled&&(e=Object(o.l)(e,n,[c])),e=Object(o.M)(e,n,i.id,{...l,...i,previousLocalId:c});const d=Object(r.l)(e,n,i.id);e=X(e,n,d);const b=Object(r.Eb)(e,n,i);b&&b.threadInfo&&(t.markMessageListRead({maxId:i.id}),e=Object(o.y)(e,n,b.threadInfo.threadId,"threadInfo",{...b.threadInfo,lastMessageId:i.id,lastReadInboxMessageId:i.id})),Object(s.g)(e);break}case"updateScheduledMessageSendSucceeded":{const{chatId:t,localId:n,message:c}=a,i=Object(r.qb)(e,t)||[];e=Object(o.y)(e,t,b.MAIN_THREAD_ID,"scheduledIds",[...i,c.id]);const l=Object(r.rb)(e,t,n);e=Object(o.l)(e,t,[n]),e=Object(o.fb)(e,t,c.id,{...l,...c,previousLocalId:n}),Object(s.g)(e);break}case"updatePinnedIds":{const{chatId:t,isPinned:n,messageIds:c}=a,i=Object(r.kb)(e,t)||[],l=n?[...i,...c].sort((e,t)=>t-e):i.filter(e=>!c.includes(e));Object(s.g)(Object(o.y)(e,t,b.MAIN_THREAD_ID,"pinnedIds",l));break}case"updateThreadInfo":{const{chatId:t,threadId:n,threadInfo:c,firstMessageId:i}=a,l={...Object(r.Fb)(e,t,n),...c};if(!l.threadId)return;e=Object(o.lb)(e,t,n,l),i&&(e=Object(o.y)(e,t,n,"firstMessageId",i)),Object(s.g)(e);break}case"resetMessages":{const{id:n}=a,c=Object(r.n)(e,n);c&&!Object(l.ob)(n)&&(e=Object(o.k)(e,n,Object.keys(c).map(Number)),Object(s.g)(e),t.loadFullChat({chatId:n,force:!0}));break}case"deleteMessages":{const{ids:s,chatId:n}=a;ee(n,s,t,e);break}case"deleteScheduledMessages":{const{ids:t,chatId:n}=a;!function(e,t,a,n){if(!e)return;t.forEach(t=>{n=Object(o.fb)(n,e,t,{isDeleting:!0})}),Object(s.g)(n),setTimeout(()=>{n=Object(o.l)(Object(s.e)(),e,t);const a=Object(r.sb)(n,e);n=Object(o.y)(n,e,b.MAIN_THREAD_ID,"scheduledIds",Object.keys(a||{}).map(Number)),Object(s.g)(n)},350)}(n,t,0,e);break}case"deleteHistory":{const{chatId:s}=a,n=e.messages.byChatId[s];if(n){ee(s,Object.keys(n.byId).map(Number),t,e)}else t.requestChatUpdate({chatId:s});break}case"updateCommonBoxMessages":{const{ids:t,messageUpdate:n}=a;t.forEach(t=>{const a=Object(r.q)(e,t);a&&(e=Object(o.M)(e,a,t,n))}),Object(s.g)(e);break}case"updateChannelMessages":{const{channelId:t,ids:n,messageUpdate:c}=a;n.forEach(a=>{e=Object(o.M)(e,t,a,c)}),Object(s.g)(e);break}case"updateMessagePoll":{const{pollId:t,pollUpdate:n}=a,c=Object(r.m)(e,t);if(c&&c.content.poll){const t={...c.content.poll,...n},{results:a}=t.results||{};if(a&&!a.some(e=>e.isChosen)){const{results:e}=c.content.poll.results,s=e&&e.filter(e=>e.isChosen);s&&s.forEach(e=>{const s=a.findIndex(t=>t.option===e.option);s>=0&&(t.results.results[s].isChosen=!0)})}Object(s.g)(Object(o.M)(e,c.chatId,c.id,{content:{...c.content,poll:t}}))}break}case"updateMessagePollVote":{const{pollId:t,userId:n,options:c}=a,i=Object(r.m)(e,t);if(!i||!i.content.poll||!i.content.poll.results)break;const{poll:l}=i.content,{recentVoterIds:d,totalVoters:b,results:u}=l.results,m=d?[...d]:[],h=b?b+1:1,O=u?[...u]:[];m.push(n),c.forEach(t=>{const a=O.find(e=>e.option===t),s=O.findIndex(e=>e.option===t),c=a?{...a}:{option:t,votersCount:0};c.votersCount+=1,n===e.currentUserId&&(c.isChosen=!0),s?O[s]=c:O.push(c)}),Object(s.g)(Object(o.M)(e,i.chatId,i.id,{content:{...i.content,poll:{...l,results:{...l.results,recentVoterIds:m,totalVoters:h,results:O}}}}));break}}});const te=Object(f.h)((function(){let e=Object(s.e)();ae.forEach(([t,a])=>{e=Object(o.ob)(e,t,{status:a})}),Object(s.g)(e),ae=[]}),3e3,!0);let ae=[];Object(s.b)("apiUpdate",(e,t,a)=>{switch(a["@type"]){case"deleteUser":return Object(o.m)(e,a.id);case"updateUser":return Object(o.ob)(e,a.id,a.user);case"updateUserStatus":return s=a.userId,n=a.status,ae.push([s,n]),void te();case"updateUserFullInfo":{const{id:t,fullInfo:s}=a,n=e.users.byId[t];if(!n)return;return Object(o.ob)(e,t,{fullInfo:{...n.fullInfo,...s}})}}var s,n}),Object(s.b)("apiUpdate",(e,t,a)=>{switch(a["@type"]){case"updateStickerSet":return Object(o.ib)(e,a.id,a.stickerSet)}}),Object(s.b)("apiUpdate",(e,t,a)=>{switch(a["@type"]){case"updatePeerBlocked":return a.isBlocked?Object(o.a)(Object(s.e)(),a.id):Object(o.q)(Object(s.e)(),a.id);case"updateResetContactList":Object(s.g)({...Object(s.e)(),contactList:{hash:0,userIds:[]}});break;case"updateFavoriteStickers":t.loadFavoriteStickers();break;case"updatePrivacy":e.settings.privacy[a.key]=a.rules}}),Object(s.b)("apiUpdate",(e,t,a)=>{switch(a["@type"]){case"updateNotifySettings":return Object(o.db)(e,a.peerType,a.isSilent,a.shouldShowPreviews);case"updateNotifyExceptions":{const{chatId:t,isMuted:n,isSilent:c,shouldShowPreviews:r}=a;e.chats.byId[t]&&(e=Object(o.I)(e,t,{isMuted:n})),Object(s.g)(Object(o.e)(e,t,{isMuted:n,isSilent:c,shouldShowPreviews:r}));break}}}),Object(s.b)("apiUpdate",(e,t,a)=>{switch(a["@type"]){case"updateTwoFaStateWaitCode":return{...e,twoFaSettings:{...e.twoFaSettings,isLoading:!1,waitingEmailCodeLength:a.length}};case"updateTwoFaError":return{...e,twoFaSettings:{...e.twoFaSettings,error:a.message}}}});var se=a(38),ne=a(9),ce=a(179),oe=a(41),re=a(127);function ie(e){Object(c.n)(()=>Object(f.c)(e),[e])}var le=a(53),de=a(50),be=a(145),ue=a(113);var me=a(25),he=a(17),Oe=a(47),je=a(40),ge=a(63),pe=a(44),fe=a(22),Ie=a(160),ve=a(146);a(207);var ye=Object(c.h)(({id:e,name:t,value:a,label:s,checked:n=!1,disabled:o,inactive:r,noAnimation:i,onChange:l,onCheck:d})=>{const b=Object(c.m)(e=>{l&&l(e),d&&d(e.currentTarget.checked)},[l,d]),u=Object(ne.a)("Switcher",o&&"disabled",r&&"inactive",i&&"no-animation");return c.a.createElement("label",{className:u,title:s},c.a.createElement("input",{type:"checkbox",id:e,name:t,value:a,checked:n,disabled:o,onChange:b}),c.a.createElement("span",{className:"widget"}))});a(208);const Ce=[0,1,2];var Ee=Object(c.h)(Object(s.h)(e=>{const{query:t,fetchingStatus:a,chatId:s,date:n}=e.globalSearch,{currentUserId:c}=e,{byId:o}=e.chats,{animationLevel:i}=e.settings.byKey;return{searchQuery:t,isLoading:!!a&&Boolean(a.chats||a.messages),currentUserId:c,chatsById:o,globalSearchChatId:s,searchDate:n,theme:Object(r.Db)(e),animationLevel:i}},(e,t)=>Object(h.l)(t,["openChat","openTipsChat","setGlobalSearchDate","setGlobalSearchChatId","setSettingOption"]))(({content:e,contactsFilter:t,onSearchQuery:a,onSelectSettings:s,onSelectContacts:o,onSelectArchived:r,setGlobalSearchChatId:i,onReset:d,searchQuery:b,isLoading:h,shouldSkipTransition:O,currentUserId:j,globalSearchChatId:g,searchDate:p,theme:f,animationLevel:I,chatsById:v,openChat:y,openTipsChat:C,setGlobalSearchDate:E,setSettingOption:w})=>{const M=Object(he.a)(),S=e===u.d.ChatList,k={date:void 0},N={id:void 0},T=Object(c.p)(()=>p?Object(x.a)(new Date(1e3*p)):void 0,[p]),P=Object(c.p)(()=>S&&v?Object.values(v).reduce((e,t)=>Object(l.kb)(t)&&t.unreadCount?e+1:e,0):0,[S,v]),A="web.telegram.org"===window.location.hostname,R=Object(c.p)(()=>({onTrigger:e,isOpen:t})=>c.a.createElement(fe.a,{round:!0,ripple:S&&!m.l,size:"smaller",color:"translucent",className:t?"active":"",onClick:S?e:()=>d(),ariaLabel:S?M("AccDescrOpenMenu2"):"Return to chat list"},c.a.createElement("div",{className:Object(ne.a)("animated-menu-icon",!S&&"state-back",O&&"no-animation")})),[S,M,d,O]),L=Object(c.m)(()=>{b||a("")},[b,a]),B=Object(c.m)(()=>{y({id:j,shouldReplaceHistory:!0})},[j,y]),D=Object(c.m)(e=>{e.stopPropagation();const t="light"===f?"dark":"light";w({theme:t}),w({shouldUseSystemTheme:!1}),Object(Oe.a)(t,I===n.e)},[I,w,f]),F=Object(c.m)(e=>{e.stopPropagation();const t=0===I?2:0;Ce.forEach((e,a)=>{document.body.classList.toggle("animation-level-"+a,t===a)}),w({animationLevel:t})},[I,w]),U=Boolean(g)||e===u.d.GlobalSearch||e===u.d.Contacts,H=e===u.d.Contacts?M("SearchFriends"):M("Search");return c.a.createElement("div",{className:"LeftMainHeader"},c.a.createElement("div",{id:"LeftMainHeader",className:"left-header"},c.a.createElement(ge.a,{trigger:R,footer:`${n.g} alpha ${n.h}`},c.a.createElement(pe.a,{icon:"saved-messages",onClick:B},M("SavedMessages")),c.a.createElement(pe.a,{icon:"archive",onClick:r},c.a.createElement("span",{className:"menu-item-name"},M("ArchivedChats")),P>0&&c.a.createElement("div",{className:"archived-badge"},P)),c.a.createElement(pe.a,{icon:"user",onClick:o},M("Contacts")),c.a.createElement(pe.a,{icon:"settings",onClick:s},M("Settings")),c.a.createElement(pe.a,{icon:"darkmode",onClick:D},c.a.createElement("span",{className:"menu-item-name"},M("lng_menu_night_mode")),c.a.createElement(ye,{id:"darkmode",label:M("dark"===f?"lng_settings_disable_night_theme":"lng_settings_enable_night_theme"),checked:"dark"===f,noAnimation:!0})),c.a.createElement(pe.a,{icon:"animations",onClick:F},c.a.createElement("span",{className:"menu-item-name capitalize"},M("Appearance.Animations").toLowerCase()),c.a.createElement(ye,{id:"animations",label:"Toggle Animations",checked:I>0})),c.a.createElement(pe.a,{icon:"help",onClick:()=>{C({langCode:M.code})}},M("TelegramFeatures")),c.a.createElement(pe.a,{icon:"bug",href:n.F},"Report Bug"),A&&c.a.createElement(c.a.Fragment,null,c.a.createElement(pe.a,{icon:"char-K",href:"https://web.telegram.org/k/",onClick:()=>{localStorage.setItem("kz_version",JSON.stringify("K")),Object(je.b)()}},"Switch to K Version"),c.a.createElement(pe.a,{icon:"char-W",href:"https://web.telegram.org/?legacy=1",onClick:je.b},"Switch to Old Version"))),c.a.createElement(Ie.a,{inputId:"telegram-search-input",parentContainerClassName:"LeftSearch",className:g||p?"with-picker-item":"",value:t||b,focused:U,isLoading:h,placeholder:H,autoComplete:"off",canClose:Boolean(g||p),onChange:a,onReset:d,onFocus:L},T&&c.a.createElement(ve.a,{icon:"calendar",title:T,canClose:!0,isMinimized:Boolean(g),className:"search-date",onClick:E,clickArg:k}),g&&c.a.createElement(ve.a,{chatOrUserId:g,onClick:i,canClose:!0,clickArg:N}))))})),we=a(27);a(209);var Me=Object(c.h)(()=>{const e=Object(he.a)();return c.a.createElement("div",{id:"ConnectionState",dir:e.isRtl?"rtl":void 0},c.a.createElement(we.a,{color:"black"}),c.a.createElement("div",{className:"state-text"},e("WaitingForNetwork")))}),Se=a(137),ke=(e,t,a)=>{const s=((e,t=!1)=>Object(c.p)(()=>Object(f.h)(e=>e(),e,!t),[e,t]))(t,!0),[n,o]=Object(c.r)(),[r,i,l]=Object(me.a)();return Object(se.c)(i,l),Object(le.a)(()=>{r||s(()=>{o(e())})},a.concat([r])),n},Ne=a(177),Te=a(199);var Pe=Object(c.h)(Object(s.h)(e=>{const{chats:{byId:t},users:{byId:a},chatFolders:{byId:s,orderedIds:n,activeChatFolder:c},currentUserId:o,lastSyncTime:i}=e;return{chatsById:t,usersById:a,chatFoldersById:s,orderedFolderIds:n,lastSyncTime:i,notifySettings:Object(r.fb)(e),notifyExceptions:Object(r.eb)(e),activeChatFolder:c,currentUserId:o}},(e,t)=>Object(h.l)(t,["loadChatFolders","setActiveChatFolder","openChat"]))(({chatsById:e,usersById:t,chatFoldersById:a,notifySettings:s,notifyExceptions:n,orderedFolderIds:o,activeChatFolder:r,currentUserId:i,lastSyncTime:d,foldersDispatch:b,onScreenSelect:u,loadChatFolders:O,setActiveChatFolder:j,openChat:g})=>{const p=Object(c.q)(null),f=Object(he.a)();Object(c.n)(()=>{d&&O()},[d,O]);const I=Object(c.p)(()=>o?o.map(e=>a[e]||{}).filter(Boolean):void 0,[a,o]),v=ke(()=>{if(!I||!I.length)return;const a=Object.keys(e).map(Number),c=I.map(c=>{const{unreadDialogsCount:o,hasActiveDialogs:r}=Object(l.o)(e,t,c,a,s,n)||{};return{id:c.id,badgeCount:o,isBadgeActive:r}});return Object(h.c)(c,"id")},3e3,[I,e,t,s,n]),y=Object(c.p)(()=>{if(I&&I.length)return[{title:"en"===f.code?"All":f("FilterAllChats")},...I.map(e=>({title:e.title,...v&&v[e.id]}))]},[I,v,f]),C=Object(c.m)(e=>{j(e)},[j]);Object(c.n)(()=>{y&&y.length&&r>=y.length&&j(0)},[r,y,j]),Object(c.n)(()=>{if(p.current&&m.n&&y&&y.length)return Object(Se.b)(p.current,{onSwipe:(e,t)=>{t===Se.a.Left?j(Math.min(r+1,y.length-1)):t===Se.a.Right&&j(Math.max(0,r-1))}})},[r,y,j]);const E=Object(c.q)();E.current=0!==r,Object(c.n)(()=>E.current?Object(de.a)(()=>{E.current&&j(0)}):void 0,[r,j]),Object(je.a)(0!==r,()=>j(0)),Object(c.n)(()=>{const e=e=>{if(e.ctrlKey&&e.shiftKey&&e.code.startsWith("Digit")&&y){const[,t]=e.code.match(/Digit(\d)/)||[];if(!t)return;if("0"===t)return void g({id:i,shouldReplaceHistory:!0});const a=Number(t)-1;if(a>y.length-1)return;j(a),e.preventDefault()}};return document.addEventListener("keydown",e,!0),()=>{document.removeEventListener("keydown",e,!0)}});const{shouldRender:w,transitionClassNames:M}=Object(oe.a)(!o,void 0,!0);function S(e){const t=Object.values(a).find(({title:e})=>e===y[r].title);return t&&0!==r?c.a.createElement(Te.a,{folderType:"folder",folderId:t.id,isActive:e,onScreenSelect:u,foldersDispatch:b}):c.a.createElement(Te.a,{folderType:"all",isActive:e,foldersDispatch:b,onScreenSelect:u})}return c.a.createElement("div",{className:"ChatFolders"},y&&y.length?c.a.createElement(Ne.a,{tabs:y,activeTab:r,onSwitchTab:C}):w?c.a.createElement("div",{className:Object(ne.a)("tabs-placeholder",M)}):void 0,c.a.createElement(ue.a,{ref:p,name:f.isRtl?"slide-reversed":"slide",activeKey:r,renderCount:y?y.length:void 0},S))})),Ae=a(15),Re=a(26),xe=a(20);var Le=Object(c.h)(e=>{const t=Object(Re.a)(Ae.a.Extra,"LeftSearch");return t?c.a.createElement(t,e):c.a.createElement(xe.a,null)});var Be=Object(c.h)(e=>{const t=Object(Re.a)(Ae.a.Extra,"ContactList");return t?c.a.createElement(t,e):c.a.createElement(xe.a,null)}),De=a(56);a(222);let Fe;var Ue=Object(c.h)(({isShown:e,onNewPrivateChat:t,onNewChannel:a,onNewGroup:s})=>{const[n,o]=Object(c.r)(!1);Object(c.n)(()=>{e||o(!1)},[e]);const r=Object(he.a)(),i=Object(ne.a)("NewChatButton",e&&"revealed",n&&"menu-is-open"),l=Object(c.m)(()=>{Fe&&(clearTimeout(Fe),Fe=void 0)},[]),d=Object(c.m)(()=>{Fe&&(clearTimeout(Fe),Fe=void 0),Fe=window.setTimeout(()=>{o(!1)},750)},[]);return c.a.createElement("div",{className:i,onMouseEnter:l,onMouseLeave:d},c.a.createElement(fe.a,{round:!0,color:"primary",className:n?"active":"",onClick:()=>{o(!n)},ariaLabel:r(n?"Close":"NewMessageTitle"),tabIndex:-1},c.a.createElement("i",{className:"icon-new-chat-filled"}),c.a.createElement("i",{className:"icon-close"})),c.a.createElement(De.a,{isOpen:n,positionX:"right",positionY:"bottom",autoClose:!0,onClose:()=>{o(!1)}},c.a.createElement(pe.a,{icon:"channel",onClick:a},r("NewChannel")),c.a.createElement(pe.a,{icon:"group",onClick:s},r("NewGroup")),c.a.createElement(pe.a,{icon:"user",onClick:t},r("NewMessageTitle"))))}),He=a(164);a(223);const qe=Object.keys(u.d).length/2;let Ge;var _e=Object(s.h)(e=>Object(h.l)(e,["connectionState"]))(({content:e,searchQuery:t,searchDate:a,contactsFilter:s,shouldSkipTransition:n,foldersDispatch:o,onSearchQuery:r,onContentChange:i,onScreenSelect:l,onReset:d,connectionState:b})=>{const[h,O]=Object(c.r)(m.n),j=!function(){const[e,t]=Object(c.r)(window.navigator.onLine);return Object(c.n)(()=>{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"===b,g=Object(c.q)(!1),p=Object(c.m)(()=>{i(u.d.Settings)},[i]),f=Object(c.m)(()=>{i(u.d.Contacts)},[i]),I=Object(c.m)(()=>{i(u.d.NewChannelStep1)},[i]),v=Object(c.m)(()=>{i(u.d.NewGroupStep1)},[i]),y=Object(c.m)(()=>{i(u.d.Archived)},[i]),C=Object(c.m)(()=>{e===u.d.ChatList&&(g.current=!0,O(!0))},[e]),E=Object(c.m)(()=>{g.current=!1,Ge&&(clearTimeout(Ge),Ge=void 0),Ge=window.setTimeout(()=>{g.current||O(!1)},250)},[]);Object(c.n)(()=>{let t;return e!==u.d.ChatList?t=window.setTimeout(()=>{O(!1)},250):(g.current||m.n)&&O(!0),()=>{t&&(clearTimeout(t),t=void 0)}},[e]);const[w,M,S]=function(){const[e,t]=Object(me.a)(!1);Object(c.n)(()=>{const e=window.setTimeout(t,2592e5);return()=>{clearTimeout(e)}},[t]);const{shouldRender:a,transitionClassNames:s}=Object(oe.a)(e);return[a,s,()=>{window.location.reload()}]}(),k=Object(he.a)();return c.a.createElement("div",{id:"LeftColumn-main",onMouseEnter:m.n?void 0:C,onMouseLeave:m.n?void 0:E},c.a.createElement(Ee,{content:e,contactsFilter:s,onSearchQuery:r,onSelectSettings:p,onSelectContacts:f,onSelectArchived:y,onReset:d,shouldSkipTransition:n}),c.a.createElement(He.a,{isOpen:j,isCustom:!0,className:"connection-state-wrapper opacity-transition slow"},()=>c.a.createElement(Me,null)),c.a.createElement(ue.a,{name:n?"none":"zoom-fade",renderCount:qe,activeKey:e,shouldCleanup:!0,cleanupExceptionKey:u.d.ChatList,className:j?"pull-down":void 0},n=>{switch(e){case u.d.ChatList:return c.a.createElement(Pe,{onScreenSelect:l,foldersDispatch:o});case u.d.GlobalSearch:return c.a.createElement(Le,{searchQuery:t,searchDate:a,isActive:n,onReset:d});case u.d.Contacts:return c.a.createElement(Be,{filter:s,isActive:n,onReset:d});default:return}}),w&&c.a.createElement(fe.a,{fluid:!0,pill:!0,className:Object(ne.a)("btn-update",M),onClick:S},k("lng_update_telegram")),c.a.createElement(Ue,{isShown:h,onNewPrivateChat:f,onNewChannel:I,onNewGroup:v}))});var ze=Object(c.h)(e=>{const t=Object(Re.a)(Ae.a.Extra,"Settings");return t?c.a.createElement(t,e):c.a.createElement(xe.a,null)});var $e=Object(c.h)(e=>{const t=Object(Re.a)(Ae.a.Extra,"NewChat");return t?c.a.createElement(t,e):c.a.createElement(xe.a,null)});var Ve,We=Object(c.h)(e=>{const t=Object(Re.a)(Ae.a.Extra,"ArchivedChats");return t?c.a.createElement(t,e):c.a.createElement(xe.a,null)});a(224);!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"}(Ve||(Ve={}));const Ke=Object.keys(Ve).length/2;var Qe=Object(c.h)(Object(s.h)(e=>{const{globalSearch:{query:t,date:a},chatFolders:{activeChatFolder:s},shouldSkipHistoryAnimations:n}=e;return{searchQuery:t,searchDate:a,activeChatFolder:s,shouldSkipHistoryAnimations:n}},(e,t)=>Object(h.l)(t,["setGlobalSearchQuery","setGlobalSearchChatId","resetChatCreation","setGlobalSearchDate","loadPasswordInfo","clearTwoFaError"]))(({searchQuery:e,searchDate:t,activeChatFolder:a,shouldSkipHistoryAnimations:s,setGlobalSearchQuery:n,setGlobalSearchChatId:o,resetChatCreation:r,setGlobalSearchDate:i,loadPasswordInfo:l,clearTwoFaError:d})=>{const[b,h]=Object(c.r)(u.d.ChatList),[O,j]=Object(c.r)(u.n.Main),[g,p]=Object(c.r)(""),[f,I]=Object(be.c)(),[v,y]=Object(c.r)(0);let C=Ve.Main;switch(b){case u.d.Archived:C=Ve.Archived;break;case u.d.Settings:C=Ve.Settings;break;case u.d.NewChannelStep1:case u.d.NewChannelStep2:C=Ve.NewChannel;break;case u.d.NewGroupStep1:case u.d.NewGroupStep2:C=Ve.NewGroup}const E=Object(c.m)(e=>{if(b!==u.d.NewGroupStep2||e)if(b!==u.d.NewChannelStep2||e){if(b===u.d.NewGroupStep1){const e=document.getElementById("new-group-picker-search");e&&e.blur()}if(b===u.d.Settings)switch(O){case u.n.EditProfile:case u.n.Folders:case u.n.General:case u.n.Notifications:case u.n.Privacy:case u.n.Language:return void j(u.n.Main);case u.n.GeneralChatBackground:return void j(u.n.General);case u.n.GeneralChatBackgroundColor:return void j(u.n.GeneralChatBackground);case u.n.PrivacyPhoneNumber:case u.n.PrivacyLastSeen:case u.n.PrivacyProfilePhoto:case u.n.PrivacyForwarding:case u.n.PrivacyGroupChats:case u.n.PrivacyActiveSessions:case u.n.PrivacyBlockedUsers:case u.n.TwoFaDisabled:case u.n.TwoFaEnabled:case u.n.TwoFaCongratulations:return void j(u.n.Privacy);case u.n.PrivacyPhoneNumberAllowedContacts:case u.n.PrivacyPhoneNumberDeniedContacts:return void j(u.n.PrivacyPhoneNumber);case u.n.PrivacyLastSeenAllowedContacts:case u.n.PrivacyLastSeenDeniedContacts:return void j(u.n.PrivacyLastSeen);case u.n.PrivacyProfilePhotoAllowedContacts:case u.n.PrivacyProfilePhotoDeniedContacts:return void j(u.n.PrivacyProfilePhoto);case u.n.PrivacyForwardingAllowedContacts:case u.n.PrivacyForwardingDeniedContacts:return void j(u.n.PrivacyForwarding);case u.n.PrivacyGroupChatsAllowedContacts:case u.n.PrivacyGroupChatsDeniedContacts:return void j(u.n.PrivacyGroupChats);case u.n.TwoFaNewPassword:return void j(u.n.TwoFaDisabled);case u.n.TwoFaNewPasswordConfirm:return void j(u.n.TwoFaNewPassword);case u.n.TwoFaNewPasswordHint:return void j(u.n.TwoFaNewPasswordConfirm);case u.n.TwoFaNewPasswordEmail:return void j(u.n.TwoFaNewPasswordHint);case u.n.TwoFaNewPasswordEmailCode:return void j(u.n.TwoFaNewPasswordEmail);case u.n.TwoFaChangePasswordCurrent:case u.n.TwoFaTurnOff:case u.n.TwoFaRecoveryEmailCurrentPassword:return void j(u.n.TwoFaEnabled);case u.n.TwoFaChangePasswordNew:return void j(u.n.TwoFaChangePasswordCurrent);case u.n.TwoFaChangePasswordConfirm:return void j(u.n.TwoFaChangePasswordNew);case u.n.TwoFaChangePasswordHint:return void j(u.n.TwoFaChangePasswordConfirm);case u.n.TwoFaRecoveryEmail:return void j(u.n.TwoFaRecoveryEmailCurrentPassword);case u.n.TwoFaRecoveryEmailCode:return void j(u.n.TwoFaRecoveryEmail);case u.n.FoldersCreateFolder:case u.n.FoldersEditFolder:return void j(u.n.Folders);case u.n.FoldersIncludedChatsFromChatList:case u.n.FoldersExcludedChatsFromChatList:return void j(u.n.FoldersEditFolderFromChatList);case u.n.FoldersEditFolderFromChatList:return h(u.d.ChatList),void j(u.n.Main)}b!==u.d.ChatList||0!==a?(h(u.d.ChatList),p(""),n({query:""}),i({date:void 0}),o({id:void 0}),r(),setTimeout(()=>{y(Date.now())},250)):h(u.d.GlobalSearch)}else h(u.d.NewChannelStep1);else h(u.d.NewGroupStep1)},[b,a,O,n,i,o,r]),w=Object(c.m)(t=>{b!==u.d.Contacts?(h(u.d.GlobalSearch),t!==e&&n({query:t})):p(t)},[b,e,n]);Object(c.n)(()=>b!==u.d.ChatList||0===a?Object(de.a)(()=>E()):void 0,[a,b,E]),Object(c.n)(()=>{d(),O===u.n.Privacy&&l()},[d,l,O]);const M=e=>{h(u.d.Settings),j(e)};return c.a.createElement(ue.a,{id:"LeftColumn",name:s?"none":m.p,renderCount:Ke,activeKey:C,shouldCleanup:!0,cleanupExceptionKey:Ve.Main},a=>{switch(C){case Ve.Archived:return c.a.createElement(We,{isActive:a,onReset:E,onContentChange:h});case Ve.Settings:return c.a.createElement(ze,{isActive:a,currentScreen:O,foldersState:f,foldersDispatch:I,onScreenSelect:M,onReset:E,shouldSkipTransition:s});case Ve.NewChannel:return c.a.createElement($e,{key:v,isActive:a,isChannel:!0,content:b,onContentChange:h,onReset:E});case Ve.NewGroup:return c.a.createElement($e,{key:v,isActive:a,content:b,onContentChange:h,onReset:E});default:return c.a.createElement(_e,{content:b,searchQuery:e,searchDate:t,contactsFilter:g,foldersDispatch:I,onContentChange:h,onSearchQuery:w,onScreenSelect:M,onReset:E,shouldSkipTransition:s})}})})),Je=a(143),Ye=a(12),Xe=a(16),Ze=a(55);var et=()=>{const[e,t]=Object(c.r)(Ze.a.get());return Object(c.n)(()=>{const e=Object(f.h)(()=>{t(Ze.a.get())},250,!1);return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]),e},tt=a(184);function at(e,t){const a=e<=n.ob?16:32,s=function(e){if(e>n.lb){const t=Math.min(Math.max(.25*e,288),424),a=Math.min(.25*e,424);return Math.min(e-t-a,728)}if(e>n.kb){const t=Math.min(Math.max(.4*e,288),424);return Math.min(e-t,728)}if(e>728)return 728;return e}(e),c=e<=n.ob?54:64,o=t?s-a-c:s-a,r=e>n.ob?Math.min(s-a,512):s-a,i=r/o,l=o/r;return{composerHiddenScale:i,toolbarHiddenScale:l,composerTranslateX:t?c/2*l:0,toolbarTranslateX:t?c/2*-1*i:0,unpinHiddenScale:r/258,toolbarForUnpinHiddenScale:258/r}}const st=e=>e.chatId.toString()+("thread"!==e.type?"_"+e.type:-1!==e.threadId?"_"+e.threadId:"");var nt=a(134),ct=a(149),ot=a(139),rt=a(51),it=a(111),lt=a(130);var dt=Object(c.h)(e=>{const{isOpen:t}=e,a=Object(Re.a)(Ae.a.Extra,"HeaderMenuContainer",!t);return a?c.a.createElement(a,e):void 0});var bt=Object(c.h)(Object(s.h)((e,{chatId:t,threadId:a,messageListType:s})=>{const n=Object(r.g)(e,t),c=Boolean(n&&Object(l.mb)(n));if(n&&n.isRestricted)return{noMenu:!0};const o=Object(r.h)(e,t),i=Object(r.P)(e,t),d="thread"===s&&a===b.MAIN_THREAD_ID,u="thread"===s&&a!==b.MAIN_THREAD_ID,h=Object(r.W)(e),O=Boolean(o&&Object(r.X)(e,o.id)),j=!O&&Boolean(Object(r.L)(e,t)),g=Boolean(d&&n&&(c||Object(l.qb)(n))&&n.isNotJoined),p=d||u,f=d&&!i&&!g,I=!Object(r.S)(e),v=d&&!g;return{noMenu:!(m.l&&g||m.l&&p||f||I||v),isChannel:c,isRightColumnShown:h,canStartBot:j,canRestartBot:O,canSubscribe:g,canSearch:p,canMute:f,canSelect:I,canLeave:v}},(e,t)=>Object(h.l)(t,["joinChannel","sendBotCommand","openLocalTextSearch","restartBot"]))(({chatId:e,threadId:t,noMenu:a,isChannel:s,canStartBot:n,canRestartBot:o,canSubscribe:r,canSearch:i,canMute:l,canSelect:d,canLeave:b,isRightColumnShown:u,joinChannel:h,sendBotCommand:O,openLocalTextSearch:j,restartBot:g})=>{const p=Object(c.q)(null),[f,I]=Object(c.r)(!1),[v,y]=Object(c.r)(void 0),C=Object(c.m)(()=>{I(!0);const e=p.current.getBoundingClientRect();y({x:e.right,y:e.bottom})},[]),E=Object(c.m)(()=>{I(!1)},[]),w=Object(c.m)(()=>{y(void 0)},[]),M=Object(c.m)(()=>{h({chatId:e})},[h,e]),S=Object(c.m)(()=>{O({command:"/start"})},[O]),k=Object(c.m)(()=>{g({chatId:e})},[e,g]),N=Object(c.m)(()=>{if(j(),m.l){document.querySelector("#MobileSearch input").focus()}else setTimeout(()=>{const e=document.querySelector(".RightHeader .SearchInput input");e&&e.focus()},400)},[j]),T=Object(he.a)();return c.a.createElement("div",{className:"HeaderActions"},!m.l&&r&&c.a.createElement(fe.a,{size:"tiny",ripple:!0,fluid:!0,onClick:M},T(s?"Subscribe":"Join Group")),!m.l&&n&&c.a.createElement(fe.a,{size:"tiny",ripple:!0,fluid:!0,onClick:S},T("BotStart")),!m.l&&o&&c.a.createElement(fe.a,{size:"tiny",ripple:!0,fluid:!0,onClick:k},T("BotRestart")),!m.l&&i&&c.a.createElement(fe.a,{round:!0,ripple:u,color:"translucent",size:"smaller",onClick:N,ariaLabel:"Search in this chat"},c.a.createElement("i",{className:"icon-search"})),(m.l||!r)&&c.a.createElement(fe.a,{ref:p,className:f?"active":"",round:!0,ripple:!m.l,size:"smaller",color:"translucent",disabled:a,ariaLabel:"More actions",onClick:C},c.a.createElement("i",{className:"icon-more"})),v&&c.a.createElement(dt,{chatId:e,threadId:t,isOpen:f,anchor:v,isChannel:s,canStartBot:n,canRestartBot:o,canSubscribe:r,canSearch:i,canMute:l,canSelect:d,canLeave:b,onSubscribeChannel:M,onSearchClick:N,onClose:E,onCloseAnimationEnd:w}))})),ut=a(118),mt=a(23),ht=a(110),Ot=a(46);function jt(e){const t=e&&Object(l.F)(e),{sticker:a}=e&&e.content||{},s=t&&a&&!Object(m.t)()&&t.includes("image/webp"),[o,r]=Object(c.r)(Ot.a),i=e&&e.id;return Object(c.o)(()=>{s&&Object(Ot.c)("b64-"+i,t).then(r).catch(e=>{n.r&&console.error(e)})},[i,s,t]),s?o:t}var gt=a(120),pt=a(45);function ft(e,t,a,s,n){return`M${e},${t+n}a${n},${n},0,0,1,\n ${a},0v${s-2*n}a${n},${n},0,0,1,${-a},0Z`}var It=Object(c.h)(({count:e,index:t})=>{const a=Object(c.q)(null),s=Object(c.p)(()=>function(e,t){const a=e-t-1,s=function(e){let t=8;1===e?t=36:2===e?t=17:3===e?t=11:(4===e||e>3)&&(t=7.5);return t}(e),n=function(e,t){let a=36;1===e?a=36:2===e?a=17:3===e?a=1===t?12:11:(4===e||e>3)&&(a=7.5);return a}(e,a),c=function(e,t){return e<=3?36:t*e+2*(e-1)}(e,s),o="clipPath"+e,r=function(e,t,a){let s="";if(3===a)s=ft(0,0,2,t,1)+ft(0,12,2,t+1,1)+ft(0,25,2,t,1);else for(let e=0;e\n \n `}(o,s,e),i=function(e,t,a){if(1===a)return 0;if(2===a)return 0===e?0:t+2;return 3===a?0===e?0:1===e?12:25:(t+2)*e}(a,s,e),l=function(e,t,a,s){if(t<=4)return 0;if(e<=1)return 0;if(e>=t-2)return s-36;return(a+4)/2+(e-2)*(a+2)}(a,e,s,c);return{markHeight:n,clipPath:r,markTranslateY:i,trackTranslateY:l,trackHeight:c,clipPathId:o}}(e,t),[e,t]);if(Object(c.n)(()=>{if(!a.current)return;const{trackHeight:e,trackTranslateY:t,markHeight:n,markTranslateY:c,clipPathId:o,clipPath:r}=s,i=a.current.firstElementChild;if(a&&a.current){const s=a.current,{style:l}=s;l.height=e+"px",l.transform=`translateY(-${t}px)`,l.clipPath=`url("#${o}")`;const d=s.querySelector("svg"),b=s.querySelector("div"),u=s.querySelector("defs");d||i&&(i.innerHTML=` ${r} `),u&&(u.innerHTML=r),b&&(b.style.height=n+"px",b.style.transform=`translateY(${c}px)`)}},[s]),1===e)return c.a.createElement("div",{className:"pinned-message-border"},c.a.createElement("div",{className:"pinned-message-border-wrapper-1",ref:a}));const{trackHeight:n,trackTranslateY:o,markHeight:r,markTranslateY:i,clipPathId:l}=s;return c.a.createElement("div",{className:Object(ne.a)("pinned-message-border",e>4&&"pinned-message-border-mask")},c.a.createElement("div",{className:"pinned-message-border-wrapper",ref:a,style:`clip-path: url("#${l}"); width: 2px;\n height: ${n}px; transform: translateY(-${o}px);`},c.a.createElement("span",null),c.a.createElement("div",{className:"pinned-message-border-mark",style:`height: ${r}px; transform: translateY(${i}px);`})))});var vt=Object(c.h)(({message:e,count:t,index:a,customTitle:s,className:n,onUnpinMessage:o,onClick:r,onAllPinnedClick:i})=>{const d=Object(he.a)(),b=jt(e),u=Object(ht.a)(Object(l.E)(e,"pictogram")),m=Object(l.O)(d,e,Boolean(b)),[h,O,j]=Object(me.a)(),g=Object(c.m)(()=>{j(),o&&o(e.id)},[j,o,e.id]);return c.a.createElement("div",{className:Object(ne.a)("HeaderPinnedMessage-wrapper",n)},t>1&&c.a.createElement(fe.a,{round:!0,size:"smaller",color:"translucent",className:"pin-list-button",ariaLabel:d("EventLogFilterPinnedMessages"),onClick:i},c.a.createElement("i",{className:"icon-pin-list"})),o&&c.a.createElement(fe.a,{round:!0,size:"smaller",color:"translucent",ariaLabel:d("UnpinMessageAlertTitle"),className:"unpin-button",onClick:O},c.a.createElement("i",{className:"icon-close"})),c.a.createElement(gt.a,{isOpen:h,onClose:j,text:"Would you like to unpin this message?",confirmLabel:"Unpin",confirmHandler:g}),c.a.createElement("div",{className:"HeaderPinnedMessage",onClick:r,dir:d.isRtl?"rtl":void 0},c.a.createElement(It,{count:t,index:a}),b&&function(e,t){const{width:a,height:s}=Object(ut.m)();return c.a.createElement("img",{src:t||e,width:a,height:s,alt:""})}(b,u),c.a.createElement("div",{className:"message-text"},c.a.createElement("div",{className:"title",dir:"auto"},s||`${d("PinnedMessage")} ${a>0?"#"+(t-a):""}`),c.a.createElement("p",{dir:"auto"},Object(mt.a)(m))),c.a.createElement(pt.a,null)))}),yt=a(33),Ct=a(185);a(227);var Et=Object(s.h)((e,{message:t})=>({sender:Object(r.vb)(e,t)}),(e,t)=>Object(h.l)(t,["focusMessage","closeAudioPlayer"]))(({message:e,className:t,noUi:a,sender:s,focusMessage:n,closeAudioPlayer:o})=>{const r=Object(he.a)(),i=s?Object(l.X)(r,s):void 0,d=yt.c(Object(l.E)(e,"inline")),{playPause:b,isPlaying:u}=Object(Ct.a)(Object(l.C)(e),Object(l.q)(e),d,void 0,void 0,!0),h=Object(c.m)(()=>{n({chatId:e.chatId,messageId:e.id})},[n,e.chatId,e.id]),O=Object(c.m)(()=>{u&&b(),o()},[o,u,b]);if(a)return;const j=Object(l.t)(e);return c.a.createElement("div",{className:Object(ne.a)("AudioPlayer",t),dir:r.isRtl?"rtl":void 0},c.a.createElement(fe.a,{round:!0,ripple:!m.l,color:"translucent",size:"smaller",className:Object(ne.a)("toggle-play",u?"pause":"play"),onClick:b,ariaLabel:u?"Pause audio":"Play audio"},c.a.createElement("i",{className:"icon-play"}),c.a.createElement("i",{className:"icon-pause"})),c.a.createElement("div",{className:"AudioPlayer-content",onClick:h},j?function(e){const{title:t,performer:a,fileName:s}=e;return c.a.createElement(c.a.Fragment,null,c.a.createElement("div",{className:"title",dir:"auto"},Object(mt.a)(t||s)),a&&c.a.createElement("div",{className:"subtitle",dir:"auto"},Object(mt.a)(a)))}(j):function(e,t){return c.a.createElement(c.a.Fragment,null,c.a.createElement("div",{className:"title",dir:"auto"},t&&Object(mt.a)(t)),c.a.createElement("div",{className:"subtitle",dir:"auto"},e))}(r("AttachAudio"),i),c.a.createElement(pt.a,null)),c.a.createElement(fe.a,{round:!0,className:"player-close",color:"translucent",size:"smaller",onClick:O,ariaLabel:"Close player"},c.a.createElement("i",{className:"icon-close"})))});a(228);var wt=Object(c.h)(Object(s.h)((e,{chatId:t,threadId:a,messageListType:s})=>{const{isLeftColumnShown:n,lastSyncTime:c,shouldSkipHistoryAnimations:o}=e,{byId:i}=e.chats,l=Object(r.g)(e,t),{typingStatus:d}=l||{},{chatId:u,messageId:m}=e.audioPlayer,h=u&&m?Object(r.l)(e,u,m):void 0;let O;if("pinned"===s){const a=Object(r.kb)(e,t);O=a&&a.length}else if("scheduled"===s){const a=Object(r.qb)(e,t);O=a&&a.length}else if("thread"===s&&a!==b.MAIN_THREAD_ID){const s=Object(r.Fb)(e,t,a);s&&(O=s.messagesCount)}const j={typingStatus:d,isLeftColumnShown:n,isRightColumnShown:Object(r.W)(e),isSelectModeActive:Object(r.S)(e),audioMessage:h,chat:l,chatsById:i,messagesCount:O,isChatWithSelf:Object(r.P)(e,t),isChatWithBot:l&&Object(r.O)(e,l),lastSyncTime:c,notifySettings:Object(r.fb)(e),notifyExceptions:Object(r.eb)(e),shouldSkipHistoryAnimations:o,currentTransitionKey:Math.max(0,e.messages.messageLists.length-1)},g=Object(r.n)(e,t);if("thread"!==s||!g)return j;if(Object.assign(j,{messagesById:g}),a!==b.MAIN_THREAD_ID){const s=Object(r.Hb)(e,t,a),n=s?Object(r.l)(e,t,s):void 0,c=n?Object(r.K)(e,n):void 0;return{...j,pinnedMessageIds:s,canUnpin:!1,topMessageSender:c}}const p=Object(r.kb)(e,t);if(p&&p.length){const t=g[p[0]],{canUnpin:s}=t&&Object(r.b)(e,t,a)||{};return{...j,pinnedMessageIds:p,canUnpin:s}}return j},(e,t)=>Object(h.l)(t,["openChatWithInfo","pinMessage","focusMessage","openChat","openPreviousChat","loadPinnedMessages","toggleLeftColumn","exitMessageSelectMode"]))(({chatId:e,threadId:t,messageListType:a,isReady:s,pinnedMessageIds:o,messagesById:r,canUnpin:i,topMessageSender:d,typingStatus:u,isSelectModeActive:h,isLeftColumnShown:O,isRightColumnShown:j,audioMessage:g,chat:p,chatsById:f,messagesCount:I,isChatWithSelf:v,isChatWithBot:y,lastSyncTime:C,notifySettings:E,notifyExceptions:w,shouldSkipHistoryAnimations:M,currentTransitionKey:S,openChatWithInfo:k,pinMessage:N,focusMessage:T,openChat:P,openPreviousChat:A,loadPinnedMessages:R,toggleLeftColumn:x,exitMessageSelectMode:L})=>{const B=Object(he.a)(),[D,F]=Object(c.r)(0),U=Array.isArray(o)?o[D]:o,H=r&&U?r[U]:void 0,q=Array.isArray(o)?o.length:o?1:0,G=p&&Object(l.k)(B,p).length,_=d?Object(l.X)(B,d):void 0;Object(c.n)(()=>{t===b.MAIN_THREAD_ID&&C&&s&&R({chatId:e})},[e,R,C,t,s]),Object(c.n)(()=>{F(0)},[o]),Object(ct.a)(e,U,H);const{width:z}=et(),$=z<=n.kb,V=m.m&&O,W=Object(c.q)(null),K=Object(c.q)(!0),Q=Object(c.m)(()=>{k({id:e})},[k,e]),J=Object(c.m)(t=>{N({chatId:e,messageId:t,isUnpin:!0})},[N,e]),Y=Object(c.m)(()=>{if(H){T({chatId:H.chatId,threadId:t,messageId:H.id});const e=Object(nt.a)(q,D+1);F(e)}},[H,T,t,q,D]),X=Object(c.m)(()=>{P({id:e,threadId:b.MAIN_THREAD_ID,type:"pinned"})},[P,e]),Z=Object(c.m)(e=>{if(m.l){const e=document.getElementById(n.z);e&&e.blur()}t!==b.MAIN_THREAD_ID||"thread"!==a||0!==S?("scheduled"===a&&h&&L(),A()):m.l||V?(e.stopPropagation(),P({id:void 0})):x()},[t,a,S,h,A,V,P,x,L]),ee=Object(c.p)(()=>{if(!$||!f)return;let e=!1;const t=Object.values(f).reduce((t,a)=>{if(Object(l.kb)(a))return t;const s=a.unreadCount||0;return!s||Object(l.Hb)(a,E,w)&&!a.unreadMentionsCount||(e=!0),t+s},0);return t?{isActive:e,totalCount:t}:void 0},[$,f,E,w]),te=z>=n.kb&&zn.ob&&z30),ae=te||z>n.lb&&z0)&&je(V,ee),c.a.createElement("div",{className:"chat-info-wrapper",onClick:Q},Object(l.ob)(e)?c.a.createElement(it.a,{userId:e,typingStatus:u,withFullInfo:y,withMediaViewer:!0,withUpdatingStatus:!0,noRtl:!0}):c.a.createElement(lt.a,{chatId:e,typingStatus:u,noRtl:!0,withMediaViewer:!0,withFullInfo:!0,withUpdatingStatus:!0}))):"thread"===a?c.a.createElement(c.a.Fragment,null,je(),c.a.createElement("h3",null,B("CommentsCount",I))):"pinned"===a?c.a.createElement(c.a.Fragment,null,je(),c.a.createElement("h3",null,B("PinnedMessagesCount",I))):"scheduled"===a?c.a.createElement(c.a.Fragment,null,je(),c.a.createElement("h3",null,v?B("Reminders"):B("messages",I,"i"))):void 0}function je(e=!1,t){return c.a.createElement("div",{className:"back-button"},c.a.createElement(fe.a,{round:!0,size:"smaller",color:"translucent",onClick:Z,ariaLabel:e?"Close":"Back"},c.a.createElement("div",{className:Object(ne.a)("animated-close-icon",!e&&"state-back")})),t&&c.a.createElement("div",{className:"unread-count "+(t.isActive?"active":"")},Object(rt.b)(t.totalCount)))}return Object(c.n)(()=>{const e=W.current;if(e)return ae&&me?void(j||te?(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))},[ae,me,te,j]),c.a.createElement("div",{className:"MiddleHeader",ref:W},c.a.createElement(ue.a,{name:M?"none":"slide-fade",activeKey:S},Oe),c.a.createElement("div",{className:"header-tools"},ie&&de&&!se&&c.a.createElement(vt,{key:e,message:de,count:q,index:D,customTitle:be,className:le,onUnpinMessage:i?J:void 0,onClick:Y,onAllPinnedClick:X}),se&&re&&c.a.createElement(Et,{key:Object(l.C)(re),message:re,className:ce}),c.a.createElement(bt,{chatId:e,threadId:t,messageListType:a})))})),Mt=a(166),St=a(58);function kt(e){return"albumId"in e}function Nt(e,t){let a,s=[],n={originalDate:e[0].date,datetime:Number(Object(x.j)(1e3*e[0].date)),senderGroups:[s]};const c=[n];return e.forEach((o,r)=>{o.isInAlbum?a?(a.messages.push(o),o.content.text&&(a.mainMessage=o)):a={albumId:o.groupedId,messages:[o],mainMessage:o}:s.push(o);const i=e[r+1];if(!a||i&&i.groupedId&&i.groupedId===a.albumId||(s.push(a),a=void 0),i){const e=Number(Object(x.j)(1e3*i.date));n.datetime!==e?(n={originalDate:i.date,datetime:e,senderGroups:[]},c.push(n),s=[],n.senderGroups.push(s)):(i.id===t||o.senderId!==i.senderId||o.isOutgoing!==i.isOutgoing||Object(l.gb)(o)||Object(l.gb)(i)||o.forwardInfo&&i.forwardInfo&&(o.forwardInfo.senderUserId!==i.forwardInfo.senderUserId||o.forwardInfo.fromChatId!==i.forwardInfo.fromChatId||o.forwardInfo.hiddenUserName!==i.forwardInfo.hiddenUserName)||o.inlineButtons||i.inlineButtons||i.date-o.date>600)&&(s=[],n.senderGroups.push(s))}}),c}function Tt(e){!m.l&&document.activeElement&&document.activeElement.id===n.z&&e.target===e.currentTarget&&e.preventDefault()}function Pt(){const[e,t]=Object(me.a)(!1),a=(s=1e3,n=!1,Object(c.p)(()=>Object(f.a)(e=>e(),s,n,o),[s,n,o]));var s,n,o;return{isScrolled:e,updateStickyDates:Object(c.m)((e,s)=>{t(),document.body.classList.contains("is-scrolling-messages")||Object(f.b)(()=>{document.body.classList.add("is-scrolling-messages")}),a(()=>{Object(f.b)(()=>{const t=document.querySelector(".stuck");t&&t.classList.remove("stuck");const a=function(e,t){const a=e.querySelectorAll(".sticky-date"),s=e.scrollTop;return Array.from(a).find(e=>{const{offsetTop:a,offsetHeight:n}=e,c=a-s;return-n<=c&&c<=(t?60:10)})}(e,s);a&&a.classList.add("stuck"),document.body.classList.remove("is-scrolling-messages")})})},[t,a])}}var At=a(161),Rt=a(131),xt=a(109);const Lt=m.b?1e3:350,Bt=m.l?300:500;var Dt=a(150),Ft=a(151);function Ut(e){return"number"==typeof e}function Ht(e,t){return e?t?238:175:t?238:100}function qt(e,t){const a=Object(l.yb)(e),s=Object(l.tb)(e),n=Object(l.H)(e)||Object(l.S)(e),c=Object(l.Q)(e),o=Boolean(Object(l.S)(e)),{width:r,height:i}=n?Object(ut.g)(n,a,s,o,t):Object(ut.i)(c,a,s,t),d=Ht(Boolean(Object(l.P)(e)));let b=1;re+t,t)}function Kt(e,t,a){return ea?a:e}function Qt(e){const t={width:0,height:0};return e.forEach(({dimensions:e,sides:a})=>{a&zt&&(t.width=e.width+e.x),a&$t&&(t.height=e.height+e.y)}),t}function Jt(e,t,a,s){const n=s.messages.map(e=>{const t=qt(e);return t.width/t.height});const c=function(e){return e.map(e=>e>1.2?"w":e<.8?"n":"q").join("")}(n),o=function(e){return e.reduce((e,t)=>t+e,1)/e.length}(n),r=n.length,i=n.some(e=>e>2),l=Object(ut.j)(e,t,!1,a)-(t?2.5:0)*ut.d;let d;const b={ratios:n,proportions:c,averageRatio:o,maxWidth:l,minWidth:100,maxHeight:l,spacing:2};return d=r>=5||i?function({ratios:e,averageRatio:t,maxWidth:a,minWidth:s,spacing:n,maxHeight:c=4*a/3}){const o=function(e,t){return e.map(e=>t>1.1?Kt(e,1,2.75):Kt(e,.6667,1))}(e,t),r=e.length,i=new Array(r),l=[],d=e=>{const t=[];let s=0;e.forEach(e=>{t.push(((e,t)=>{const s=Wt(o.slice(e,e+t),0);return(a-(t-1)*n)/s})(s,e)),s+=e}),l.push({lineCounts:e,heights:t})};for(let e=1;e!==r;++e){const t=r-e;e<=3&&t<=3&&d([e,t])}for(let e=1;e!==r-1;++e)for(let a=1;a!==r-e;++a){const s=r-e-a;e<=3&&a<=(t<.85?4:3)&&s<=3&&d([e,a,s])}for(let e=1;e!==r-1;++e)for(let t=1;t!==r-e;++t)for(let a=1;a!==r-e-t;++a){const s=r-e-t-a;e<=3&&t<=3&&a<=3&&s<=4&&d([e,t,a,s])}let b,u=0;for(let e=0;e{for(let e=1;e!==o;++e)if(a[e-1]>a[e])return 1.5;return 1})(),m=Math.abs(r-c)*i*d;(!b||m1.4&&t[1]-t[0]<.2?function(e){const{ratios:t,maxWidth:a,spacing:s,maxHeight:n}=e,c=Math.round(Math.min(a/t[0],Math.min(a/t[1],(n-s)/2)));return[{dimensions:{x:0,y:0,width:a,height:c},sides:Vt|_t|zt},{dimensions:{x:0,y:c+s,width:a,height:c},sides:Vt|$t|zt}]}(e):"ww"===a||"qq"===a?function(e){const{ratios:t,maxWidth:a,spacing:s,maxHeight:n}=e,c=(a-s)/2,o=Math.round(Math.min(c/t[0],Math.min(c/t[1],n)));return[{dimensions:{x:0,y:0,width:c,height:o},sides:_t|Vt|$t},{dimensions:{x:c+s,y:0,width:c,height:o},sides:_t|zt|$t}]}(e):function(e){const{ratios:t,minWidth:a,maxWidth:s,spacing:n,maxHeight:c}=e,o=Math.round(1.5*a),r=Math.min(Math.round(Math.max(.4*(s-n),(s-n)/t[0]/(1/t[0]+1/t[1]))),s-n-o),i=s-r-n,l=Math.min(c,Math.round(Math.min(i/t[0],r/t[1])));return[{dimensions:{x:0,y:0,width:i,height:l},sides:_t|Vt|$t},{dimensions:{x:i+n,y:0,width:r,height:l},sides:_t|zt|$t}]}(e)}(b):3===r?function(e){const{proportions:t}=e;return"n"===t[0]?function(e){const{maxHeight:t,spacing:a,ratios:s,maxWidth:n,minWidth:c}=e,o=t,r=Math.round(Math.min((t-a)/2,s[1]*(n-a)/(s[2]+s[1]))),i=o-r-a,l=Math.max(c,Math.round(Math.min((n-a)/2,Math.min(r*s[2],i*s[1])))),d=Math.min(Math.round(o*s[0]),n-a-l);return[{dimensions:{x:0,y:0,width:d,height:o},sides:_t|Vt|$t},{dimensions:{x:d+a,y:0,width:l,height:i},sides:_t|zt},{dimensions:{x:d+a,y:i+a,width:l,height:r},sides:$t|zt}]}(e):function(e){const{maxWidth:t,ratios:a,maxHeight:s,spacing:n}=e,c=t,o=Math.round(Math.min(c/a[0],.66*(s-n))),r=(t-n)/2,i=Math.min(s-o-n,Math.round(Math.min(r/a[1],r/a[2])));return[{dimensions:{x:0,y:0,width:c,height:o},sides:Vt|_t|zt},{dimensions:{x:0,y:o+n,width:r,height:i},sides:$t|Vt},{dimensions:{x:r+n,y:o+n,width:c-r-n,height:i},sides:$t|zt}]}(e)}(b):function(e){const{proportions:t}=e;return"w"===t[0]?function({maxWidth:e,ratios:t,spacing:a,maxHeight:s,minWidth:n}){const c=e,o=Math.round(Math.min(c/t[0],.66*(s-a))),r=Math.round((e-2*a)/(t[1]+t[2]+t[3])),i=Math.max(n,Math.round(Math.min(.4*(e-2*a),r*t[1]))),l=Math.round(Math.max(Math.max(n,.33*(e-2*a)),r*t[3])),d=c-i-l-2*a,b=Math.min(s-o-a,r);return[{dimensions:{x:0,y:0,width:c,height:o},sides:Vt|_t|zt},{dimensions:{x:0,y:o+a,width:i,height:b},sides:$t|Vt},{dimensions:{x:i+a,y:o+a,width:d,height:b},sides:$t},{dimensions:{x:i+a+d+a,y:o+a,width:l,height:b},sides:zt|$t}]}(e):function({maxHeight:e,ratios:t,maxWidth:a,spacing:s,minWidth:n}){const c=e,o=Math.round(Math.min(c*t[0],.6*(a-s))),r=Math.round((e-2*s)/(1/t[1]+1/t[2]+1/t[3])),i=Math.round(r/t[1]),l=Math.round(r/t[2]),d=c-i-l-2*s,b=Math.max(n,Math.min(a-o-s,r));return[{dimensions:{x:0,y:0,width:o,height:c},sides:_t|Vt|$t},{dimensions:{x:o+s,y:0,width:b,height:i},sides:_t|zt},{dimensions:{x:o+s,y:i+s,width:b,height:l},sides:zt},{dimensions:{x:o+s,y:i+l+2*s,width:b,height:d},sides:$t|zt}]}(e)}(b),{layout:d,containerStyle:Qt(d)}}let Yt;function Xt(e){return Yt||(Yt=document.createElement("span"),Yt.style.font=m.e?'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',Yt.style.whiteSpace="nowrap",Yt.style.position="absolute",Yt.style.left="-999px",Yt.style.opacity=".01",document.body.appendChild(Yt)),Yt.innerHTML=e,Yt.offsetWidth}function Zt(e,t,a,s,n){Object(c.o)(()=>{if(a&&e.current){const t=e.current.closest(".MessageList");Object(Rt.a)(t,e.current,n?"end":"centerOrTop",20,void 0!==s?1e3:void 0,s)}},[e,t,a,s,n])}var ea=a(114),ta=a(68);var aa=Object(c.h)(e=>{const{isOpen:t}=e,a=Object(Re.a)(Ae.a.Extra,"ContextMenuContainer",!t);return a?c.a.createElement(a,e):void 0});var sa=Object(c.h)(Object(s.h)((e,{message:t})=>{const{byId:a}=e.users,s=t.senderId,{targetUserIds:n,targetChatId:c}=t.content.action||{},o=t.replyToMessageId,i=o?Object(r.l)(e,t.chatId,o):void 0,d=Object(r.U)(e,t),{direction:b,noHighlight:u}=d&&e.focusedMessage||{},m=Object(r.g)(e,t.chatId);return{usersById:a,sender:m&&(Object(l.mb)(m)||s===t.chatId)?m:s?Object(r.Jb)(e,s):void 0,targetChatId:c,targetUserIds:n,targetMessage:i,isFocused:d,...d&&{focusDirection:b,noFocusHighlight:u}}})(({message:e,observeIntersection:t,isEmbedded:a,appearanceOrder:s=0,isLastInList:n,usersById:o,sender:r,targetUserIds:i,targetMessage:l,targetChatId:d,isFocused:b,focusDirection:u,noFocusHighlight:m})=>{const h=Object(c.q)(null);Object(xt.c)(h,t),Object(ct.a)(e.chatId,e.replyToMessageId,l),Zt(h,e.chatId,b,u,m);const O=Object(he.a)(),j=s<=0,[g,p]=Object(me.a)(j);Object(c.n)(()=>{j||setTimeout(p,10*s)},[s,p,j]);const{transitionClassNames:f}=Object(oe.a)(g,void 0,j,!1),I=Object(c.p)(()=>i?i.map(e=>o&&o[e]).filter(Boolean):void 0,[i,o]),v=Object(ta.a)(O,e,r,I,l,d,a?{isEmbedded:!0,asPlain:!0}:void 0),{isContextMenuOpen:y,contextMenuPosition:C,handleBeforeContextMenu:E,handleContextMenu:w,handleContextMenuClose:M,handleContextMenuHide:S}=Object(Dt.a)(h),k=void 0!==C;if(a)return c.a.createElement("span",{className:"embedded-action-message"},Object(mt.a)(v));const N=Object(ne.a)("ActionMessage message-list-item",b&&!m&&"focused",k&&"has-menu-open",n&&"last-in-list",f);return c.a.createElement("div",{ref:h,id:"message"+e.id,className:N,"data-message-id":e.id,onMouseDown:e=>{Tt(e),E(e)},onContextMenu:w},c.a.createElement("span",null,v),C&&c.a.createElement(aa,{isOpen:y,anchor:C,message:e,messageListType:"thread",onClose:M,onCloseAnimationEnd:S}))}));a(229);var na=({className:e,message:t,sender:a,title:s,customText:n,observeIntersection:o,onClick:r})=>{const i=Object(c.q)(null),d=Object(xt.b)(i,o),b=Object(ht.a)(t&&Object(l.E)(t,"pictogram"),!d),u=t&&"sticker-reply-thumb"+t.id,m=jt(t),h=Boolean(t&&Object(l.J)(t)),O=Object(he.a)(),j=a&&Object(l.X)(O,a);return c.a.createElement("div",{ref:i,className:Object(ne.a)("EmbeddedMessage",e),onClick:t?r:void 0},m&&function(e,t,a,s){const{width:n,height:o}=Object(ut.m)();return c.a.createElement("img",{id:e,src:a||t,width:n,height:o,alt:"",className:s?"round":""})}(u,m,b,h),c.a.createElement("div",{className:"message-text"},c.a.createElement("p",{dir:"auto"},t?Object(l.gb)(t)?c.a.createElement(sa,{message:t,isEmbedded:!0}):Object(mt.a)(Object(l.O)(O,t,Boolean(m))):n||" "),c.a.createElement("div",{className:"message-title",dir:"auto"},Object(mt.a)(j||s||" "))))},ca=a(167),oa=a(176),ra=a(182);a(233);var ia=Object(c.h)(({message:e,outgoingStatus:t,signature:a,onClick:s})=>{const n=Object(he.a)();return c.a.createElement("span",{className:"MessageMeta",dir:n.isRtl?"rtl":"ltr",onClick:s},Boolean(e.views)&&c.a.createElement(c.a.Fragment,null,c.a.createElement("span",{className:"message-views"},Object(rt.b)(e.views)),c.a.createElement("i",{className:"icon-channelviews"})),a&&c.a.createElement("span",{className:"message-signature"},Object(mt.a)(a)),c.a.createElement("span",{className:"message-time"},e.isEdited&&n("EditedMessage")+" ",Object(x.h)(1e3*e.date)),t&&c.a.createElement(ra.a,{status:t}))}),la=a(117),da=a(119),ba=a(168);a(234);var ua=({message:e,observeIntersection:t,observeIntersectionForPlaying:a,shouldLoop:s,lastSyncTime:o})=>{const r=Object(c.q)(null),[i,d,b]=Object(me.a)(),u=e.content.sticker,{isAnimated:m,stickerSetId:h}=u,O=h===n.db,j=Object(xt.b)(r,t),g=Object(xt.b)(r,a),p=u.isPreloadedGlobally?"sticker"+u.id:Object(l.E)(e,"inline"),f=jt(e),I=Object(ht.a)(p,!j,Object(l.D)(e,"inline",!0),o),v=Boolean(I),[y,C]=Object(me.a)(v),E=m?y:v,{shouldRenderFullMedia:w,transitionClassNames:M}=Object(la.a)(E,"slow"),{width:S,height:k}=Object(ut.n)(u),N=Object(ne.a)("thumbnail",!f&&"empty"),T=Object(ne.a)("Sticker media-inner",O&&"inactive");return c.a.createElement("div",{ref:r,className:T,onClick:O?void 0:d},!E&&c.a.createElement("img",{id:"sticker-thumb-"+e.id,src:f,width:S,height:k,alt:"",className:N}),!m&&w&&c.a.createElement("img",{id:"sticker-"+e.id,src:I,width:S,height:k,alt:"",className:Object(ne.a)("full-media",M)}),m&&v&&c.a.createElement(da.a,{key:p,className:Object(ne.a)("full-media",M),id:p,animationData:I,size:S,play:g,noLoop:!s,onLoad:C}),c.a.createElement(ba.a,{isOpen:i,fromSticker:u,onClose:b}))},ma=a(129),ha=a(123),Oa=a(169);function ja(e,t){return Object(Oa.a)(Object(l.F)(e),Boolean(t),m.l&&!m.c)}var ga=a(30);const pa=Promise.resolve("rgba(255,255,255,1)");function fa(e,t,a,s){return s?pa:async function(e,t){const a=new Image;a.src=e,a.width||await new Promise(e=>{a.onload=e});const s=document.createElement("canvas"),n=s.getContext("2d");s.width=a.width,s.height=a.height,n.drawImage(a,0,0,a.width,a.height);const c=t?a.width-1:0,o=a.height-1;return`rgba(${Array.from(n.getImageData(c,o,1,1).data).join(",")})`}(e,t)}var Ia=a(124);var va=({id:e,message:t,observeIntersection:a,noAvatars:s,shouldAutoLoad:n,isInSelectMode:o,isSelected:r,uploadProgress:i,size:d="inline",dimensions:b,nonInteractive:u,shouldAffectAppendix:m,onClick:h,onCancelUpload:O})=>{const j=Object(c.q)(null),g=(Object(l.H)(t)||Object(l.S)(t)).blobUrl,p=Object(xt.b)(j,a),[f,I]=Object(c.r)(n),v=f&&p,{mediaData:y,downloadProgress:C}=Object(ha.a)(Object(l.E)(t,d),!v),E=g||y,w=ja(t,E),{isUploading:M,isTransferring:S,transferProgress:k}=Object(l.r)(t,i||C,v&&!E),N=!1===Object(ga.a)(f),{shouldRender:T,transitionClassNames:P}=Object(oe.a)(S,void 0,N,"slow"),{shouldRenderThumb:A,shouldRenderFullMedia:R,transitionClassNames:x}=Object(la.a)(E,"slow"),L=Object(c.m)(()=>{M?O&&O(t):E?h&&h(t.id):I(e=>!e)},[E,M,t,O,h]),B=Object(l.yb)(t);Object(c.o)(()=>{if(!m)return;const e=j.current.closest(".message-content");E?fa(E,B,0,r).then(t=>{e.style.setProperty("--appendix-bg",t),e.setAttribute("data-has-custom-appendix","")}):e.classList.add("has-appendix-thumb")},[E,B,m,o,r]);const{width:D,height:F,isSmall:U}=b||qt(t,s),H=Object(ne.a)("media-inner",!M&&!u&&"interactive",U&&"small-image",D===F&&"square-image"),q=b?`width: ${D}px; height: ${F}px; left: ${b.x}px; top: ${b.y}px;`:"";return c.a.createElement("div",{id:e,ref:j,className:H,style:q,onClick:M?void 0:L},A&&c.a.createElement("canvas",{ref:w,className:"thumbnail",style:`width: ${D}px; height: ${F}px`}),R&&c.a.createElement("img",{src:E,className:"full-media "+x,width:D,height:F,alt:""}),T&&c.a.createElement("div",{className:"media-loading "+P},c.a.createElement(Ia.a,{progress:k,onClick:M?L:void 0})),!E&&!f&&c.a.createElement("i",{className:"icon-download"}),S&&c.a.createElement("span",{className:"message-upload-progress"},Math.round(100*k),"%"))},ya=a(141),Ca=a(140);function Ea(e,t){const a=Object(c.q)();a.current=t;const s=Object(c.m)(()=>{e.current&&e.current.pause()},[e]),n=Object(c.m)(()=>{e.current&&a.current&&Object(Ca.a)(e.current)},[e]);Object(se.c)(s,n)}var wa=a(152),Ma=(e,t=!1)=>{const a=Object(c.q)(!1),s=Object(c.q)(!1),n=Object(c.m)(()=>{s.current=!0,t&&e.current&&(a.current||(a.current=!e.current.paused),e.current.pause())},[t,e]),o=Object(c.m)(()=>{t&&e.current&&a.current&&document.body.contains(e.current)&&Object(Ca.a)(e.current),a.current=!1,s.current=!1},[t,e]),r=Object(c.m)(()=>{Object(f.b)(o)},[o]);document.hasFocus()||n(),Object(re.a)(n,r)};function Sa(){return(Sa=Object.assign||function(e){for(var t=1;t{const m=Object(c.q)(null),h=Object(c.q)(null),O=Object(l.Q)(t)||Object(l.T)(t),j=O.blobUrl,g=Object(xt.b)(m,a),[p,f]=Object(c.r)(n),I=Boolean(p&&g&&i),[v,y]=Object(c.r)(o),C=Object(ht.a)(Object(l.E)(t,"pictogram"),!(g&&i),Object(l.D)(t,"pictogram"),i),{mediaData:E,downloadProgress:w}=Object(ha.a)(Object(l.E)(t,"inline"),!I,Object(l.D)(t,"inline"),i),M=j||E,S=Boolean(g&&M),k=ja(t,C),{isBuffered:N,bufferingHandlers:T}=Object(ya.a)(!n),{isUploading:P,isTransferring:A,transferProgress:R}=Object(l.r)(t,r||w,I&&!N),L=!1===Object(ga.a)(p),{shouldRender:B,transitionClassNames:D}=Object(oe.a)(A,void 0,L),{transitionClassNames:F}=Object(la.a)(M,"slow"),[U,H]=Object(c.r)(0),q=Object(c.m)(e=>{H(Math.max(0,e.currentTarget.currentTime-1))},[]),G=h.current&&h.current.duration||O.duration||0,_=Object(l.yb)(t),z=Object(l.tb)(t),{width:$,height:V}=d||Object(ut.i)(O,_,z,s);Ea(h,Boolean(S&&o)),Ma(h,v),Object(wa.a)(h,[S]);const W=Object(c.m)(()=>{P?u&&u(t):M?M&&!v?(y(!0),h.current.play()):b&&b(t.id):f(e=>!e)},[P,M,v,b,u,t]),K=Object(ne.a)("media-inner dark",!P&&"interactive"),Q=Object(ne.a)("full-media",F),J=d?`width: ${$}px; height: ${V}px; left: ${d.x}px; top: ${d.y}px;`:"";return c.a.createElement("div",{ref:m,id:e,className:K,style:J,onClick:P?void 0:W},!C&&c.a.createElement("canvas",{ref:k,className:"thumbnail",style:`width: ${$}px; height: ${V}px;`}),C&&c.a.createElement("img",{src:C,className:"thumbnail",style:`width: ${$}px; height: ${V}px;`,alt:""}),S&&c.a.createElement("video",Sa({ref:h,className:Q,width:$,height:V,autoPlay:v,muted:!0,loop:!0,playsInline:!0},T,{onTimeUpdate:q}),c.a.createElement("source",{src:M})),p&&!v&&!B&&c.a.createElement("i",{className:"icon-large-play"}),B&&c.a.createElement("div",{className:"media-loading "+D},c.a.createElement(Ia.a,{progress:R,onClick:P?W:void 0})),!p&&c.a.createElement("i",{className:"icon-download"}),A?c.a.createElement("span",{className:"message-upload-progress"},"..."):c.a.createElement("div",{className:"message-media-duration"},O.isGif?"GIF":Object(x.e)(Math.max(G-U,0))))},Na=a(24);a(235);var Ta=Object(s.h)((e,{contact:t})=>({user:Object(r.Jb)(e,t.userId)}),(e,t)=>Object(h.l)(t,["openUserInfo"]))(({contact:e,user:t,openUserInfo:a})=>{const{firstName:s,lastName:n,phoneNumber:o,userId:r}=e,i=Object(c.m)(()=>{a({id:r})},[a,r]);return c.a.createElement("div",{className:Object(ne.a)("Contact",Boolean(r)&&"interactive"),onClick:r?i:void 0},c.a.createElement(ea.a,{size:"large",user:t,text:s||n}),c.a.createElement("div",{className:"contact-info"},c.a.createElement("div",{className:"contact-name"},s," ",n),c.a.createElement("div",{className:"contact-phone"},Object(Na.c)(o))))}),Pa=a(49);var Aa=Object(c.h)(({id:e,options:t,selected:a=[],disabled:s,round:n,loadingOptions:o,onChange:r})=>{const[i,l]=Object(c.r)([]),d=Object(c.m)(e=>{const{value:t,checked:a}=e.currentTarget;let s;s=a?[...i,t]:i.filter(e=>e!==t),l(s),r(s)},[r,i]);return c.a.createElement("div",{id:e,className:"radio-group"},t.map(e=>c.a.createElement(Pa.a,{label:e.label,subLabel:e.subLabel,value:e.value,checked:-1!==a.indexOf(e.value),disabled:s,round:n,isLoading:o?-1!==o.indexOf(e.value):void 0,onChange:d})))}),Ra=a(126),xa=a(190);a(238);function La(e,t){return t>0?(e/t*100).toFixed():0}var Ba=({answer:e,voteResults:t,totalVoters:a,maxVotersCount:s,correctResults:n,shouldAnimate:o})=>{const r=t&&t.find(t=>t.option===e.option),i=0===n.length||-1!==n.indexOf(e.option),l=n.length>0&&i||r&&r.isChosen,d=r?La(r.votersCount,a||0):0,[b,u]=Object(c.r)(o?0:d),m=Object(c.q)(null),h=r?La(r.votersCount,s||0):0,O=b{o&&u(d)},[o,d]),Object(c.n)(()=>{const e=m.current;if(e&&o){const t=e.firstElementChild,a=O?"":"stroke-dasharray: 100% 200%; stroke-dashoffset: -44";t?t.setAttribute("style",a):e.innerHTML=`\n \n \n `}},[O,o]),!t||!r)return;const j=`width: ${h}%; transform:scaleX(${O?0:1})`;return c.a.createElement("div",{className:"PollOption",dir:"ltr"},c.a.createElement("div",{className:"poll-option-share "+("100"===d?"limit-width":"")},d,"%",l&&c.a.createElement("span",{className:Object(ne.a)("poll-option-chosen",!i&&"wrong",o&&"animate")},c.a.createElement("i",{className:i?"icon-check":"icon-close"}))),c.a.createElement("div",{className:"poll-option-right"},c.a.createElement("div",{className:"poll-option-text",dir:"auto"},Object(mt.a)(e.text)),c.a.createElement("div",{className:Object(ne.a)("poll-option-answer",l&&!i&&"wrong")},c.a.createElement("div",{className:"poll-option-corner",ref:m}),c.a.createElement("div",{className:"poll-option-line",style:j}))))};a(239);var Da=Object(c.h)(Object(s.h)((e,{poll:t})=>{const{recentVoterIds:a}=t.results,{serverTimeOffset:s,users:{byId:n}}=e;return a&&0!==a.length?{recentVoterIds:a,usersById:n,serverTimeOffset:s}:{}},(e,t)=>Object(h.l)(t,["loadMessage","openPollResults"]))(({message:e,poll:t,recentVoterIds:a,usersById:s,loadMessage:n,onSendVote:o,openPollResults:r,serverTimeOffset:i})=>{const{id:l,chatId:d}=e,{summary:b,results:u}=t,[m,h]=Object(c.r)(!1),[O,j]=Object(c.r)([]),[g,p]=Object(c.r)(!1),[f,I]=Object(c.r)(!1),[v,y]=Object(c.r)(!b.closed&&b.closeDate&&b.closeDate>0?Math.min(b.closeDate-Math.floor(Date.now()/1e3)+i,b.closePeriod):0),C=Object(c.q)(null),{results:E,totalVoters:w}=u,M=E&&E.some(e=>e.isChosen),S=!b.closed&&!M,k=!S&&b.isPublic&&Number(u.totalVoters)>0,N=S&&b.multipleChoice,T=E?Math.max(...E.map(e=>e.votersCount)):w,P=E?E.reduce((e,t)=>(t.isCorrect&&e.push(t.option),e),[]):[],A=b.answers.map(e=>({label:e.text,value:e.option,hidden:Boolean(b.quiz&&b.closePeriod&&v<=0)}));Object(c.n)(()=>{m&&t.results.results&&t.results.results.some(e=>e.isChosen)&&h(!1)},[m,t.results.results]),Object(c.n)(()=>{v>0&&setTimeout(()=>y(v-1),1e3);const e=C.current;if(e){const t=12*Math.PI,a=e.lastElementChild,s=e.firstElementChild;if(v<=5&&e.classList.add("hurry-up"),a&&s){const e=(b.closePeriod-v)/b.closePeriod*t;s.textContent=Object(x.e)(v),a.firstElementChild.setAttribute("stroke-dashoffset","-"+e)}else e.innerHTML=`\n ${Object(x.e)(v)}\n \n \n `}},[v,b.closePeriod]),Object(c.n)(()=>{b.quiz&&(v<=0||M&&!b.closed)&&n({chatId:d,messageId:l})},[d,v,M,n,l,b.closed,b.quiz]),Object(c.n)(()=>{let e;return b.quiz&&!b.closed&&b.closePeriod&&b.closePeriod>0&&(e=window.setTimeout(()=>{n({chatId:d,messageId:l})},1e3*b.closePeriod)),()=>{e&&window.clearTimeout(e)}},[S,d,n,l,b.closePeriod,b.closed,b.quiz]);const R=Object(c.p)(()=>a?a.reduce((e,t)=>{const a=s[t];return a&&e.push(a),e},[]):[],[s,a]),L=Object(c.m)(e=>{j([e]),h(!0),I(!0),o([e])},[o]),B=Object(c.m)(e=>{j(e)},[]),D=Object(c.m)(()=>{h(!0),I(!0),o(O)},[o,O]),F=Object(c.m)(()=>{r({chatId:d,messageId:l})},[d,l,r]),U=Object(c.m)(()=>{p(!0)},[]),H=Object(c.m)(()=>{p(!1),I(!1)},[]);Object(c.n)(()=>{if(f&&M&&b.quiz&&u.results&&t.results.solution){u.results.find(e=>e.isChosen&&e.isCorrect)||p(!0)}},[M,f,u.results,b.quiz,t.results.solution]);const q=Object(he.a)();return c.a.createElement("div",{className:"Poll",dir:q.isRtl?"auto":"ltr"},g&&t.results.solution&&c.a.createElement(xa.a,{message:Object(Ft.b)(t.results.solution,t.results.solutionEntities),duration:5e3,onDismiss:H,containerId:"#middle-column-portals"}),c.a.createElement("div",{className:"poll-question"},Object(mt.a)(b.question)),c.a.createElement("div",{className:"poll-type"},q(function(e){if(void 0===e.isPublic)return" ";if(e.quiz)return e.isPublic?"QuizPoll":"AnonymousQuizPoll";if(e.closed)return"FinalResults";return e.isPublic?"PublicPoll":"AnonymousPoll"}(b)),R.length>0&&c.a.createElement("div",{className:"poll-recent-voters"},R.map(e=>c.a.createElement(ea.a,{size:"micro",user:e}))),v>0&&S&&c.a.createElement("div",{ref:C,className:"poll-countdown"}),b.quiz&&t.results.solution&&!S&&c.a.createElement(fe.a,{round:!0,size:"tiny",color:"translucent",className:"poll-quiz-help",disabled:g,onClick:U,ariaLabel:"Show Solution"},c.a.createElement("i",{className:"icon-lamp"}))),S&&c.a.createElement("div",{className:"poll-answers"},N?c.a.createElement(Aa,{options:A,onChange:B,disabled:e.isScheduled||m,loadingOptions:m?O:void 0,round:!0}):c.a.createElement(Ra.a,{name:"poll-"+l,options:A,onChange:L,disabled:e.isScheduled||m,loadingOption:m?O[0]:void 0})),!S&&c.a.createElement("div",{className:"poll-results"},b.answers.map((function(e){return c.a.createElement(Ba,{key:e.option,shouldAnimate:f,answer:e,voteResults:E,totalVoters:w,maxVotersCount:T,correctResults:P})}))),!k&&!N&&c.a.createElement("div",{className:"poll-voters-count"},function(e,t,a){if(!a)return e(t?"Chat.Quiz.TotalVotesEmpty":"Chat.Poll.TotalVotesResultEmpty");return e(t?"Answer":"Vote",a,"i")}(q,b.quiz,u.totalVoters)),N&&c.a.createElement(fe.a,{isText:!0,disabled:0===O.length,size:"tiny",onClick:D},q("PollSubmitVotes")),k&&c.a.createElement(fe.a,{isText:!0,size:"tiny",onClick:F},q("PollViewResults")))})),Fa=a(42),Ua=a(59);a(240);var Ha=Object(c.h)(({message:e,observeIntersection:t,noAvatars:a,shouldAutoLoad:s,shouldAutoPlay:n,inPreview:o,lastSyncTime:r,onMediaClick:i,onCancelMediaTransfer:d})=>{const b=Object(l.R)(e);let u=!1;if(b&&b.photo&&!b.video){const{width:t,height:a}=qt(e);u=t===a}const m=Object(c.m)(()=>{i()},[i]);if(!b)return;const{siteName:h,url:O,displayUrl:j,title:g,description:p,photo:f,video:I}=b,v=(f||I)&&i&&!u,y=Object(Fa.a)(p,170),C=Object(ne.a)("WebPage",u&&"with-square-photo",!f&&!I&&!o&&"without-media",I&&"with-video");return c.a.createElement("div",{className:C,"data-initial":(h||j)[0],dir:"auto"},f&&!I&&c.a.createElement(va,{message:e,observeIntersection:t,noAvatars:a,shouldAutoLoad:s,size:u?"pictogram":"inline",nonInteractive:!v,onClick:v?m:void 0,onCancelUpload:d}),c.a.createElement("div",{className:"WebPage-text"},c.a.createElement(Ua.a,{className:"site-name",url:O,text:h||j}),!o&&g&&c.a.createElement("p",{className:"site-title"},Object(mt.a)(g)),y&&c.a.createElement("p",{className:"site-description"},Object(mt.a)(y,["emoji","br"]))),!o&&I&&c.a.createElement(ka,{message:e,observeIntersection:t,noAvatars:a,shouldAutoLoad:s,shouldAutoPlay:n,lastSyncTime:r,onClick:v?m:void 0,onCancelUpload:d}))});a(241);var qa=Object(c.h)(({message:e})=>{const t=Object(l.B)(e),{title:a,text:s,description:n,photoUrl:o}=t;return c.a.createElement("div",{className:"Invoice"},a&&c.a.createElement("p",{className:"title"},Object(mt.a)(a)),s&&c.a.createElement("p",null,Object(mt.a)(s,["emoji","br"])),c.a.createElement("div",{className:"description "+(o?"has-image":"")},o&&c.a.createElement("img",{className:"invoice-image",src:o,alt:""}),n&&c.a.createElement("p",{className:"description-text"},Object(mt.a)(n,["emoji","br"]))))});function Ga(e){return Object(c.h)(Object(s.h)((e,t)=>{const{message:a}=t;return{isInSelectMode:Object(r.S)(e),isSelected:Object(r.V)(e,a.id)}},(e,t)=>Object(h.l)(t,["toggleMessageSelection"]))(t=>{const{isInSelectMode:a,isSelected:s,message:n,toggleMessageSelection:o,dimensions:r}=t,i=Object(c.m)(e=>{e.stopPropagation(),o({messageId:n.id,withShift:e&&e.shiftKey})},[o,n]),l=Object(c.p)(()=>({...t,isInSelectMode:a,isSelected:s,dimensions:{...t.dimensions,x:0,y:0},onClick:a?void 0:t.onClick}),[t,a,s]);return c.a.createElement("div",{className:Object(ne.a)("album-item-select-wrapper",s&&"is-selected"),style:r?`left: ${r.x}px; top: ${r.y}px;`:"",onClick:a?i:void 0},a&&c.a.createElement("div",{className:"message-select-control"},s&&c.a.createElement("i",{className:"icon-select"})),c.a.createElement(e,l))}))}a(242);const _a=Ga(va),za=Ga(ka);var $a=Object(s.h)(e=>({uploadsById:e.fileUploads.byMessageLocalId}),(e,t)=>Object(h.l)(t,["cancelSendingMessage"]))(({album:e,observeIntersection:t,shouldAutoLoad:a,shouldAutoPlay:s,hasCustomAppendix:n,lastSyncTime:o,isOwn:r,albumLayout:i,onMediaClick:d,uploadsById:b,cancelSendingMessage:u})=>{const m=e.messages.length,h=Object(c.m)(e=>{u({chatId:e.chatId,messageId:e.id})},[u]);const{width:O,height:j}=i.containerStyle;return c.a.createElement("div",{className:"Album",style:`width: ${O}px; height: ${j}px;`},e.messages.map((function(e,u){const{photo:O,video:j}=Object(l.v)(e),g=b[e.previousLocalId||e.id],p=g?g.progress:void 0,{dimensions:f,sides:I}=i.layout[u];if(O){const s=n&&(r?u===m-1:Boolean(I&Vt&&I&$t));return c.a.createElement(_a,{id:"album-media-"+e.id,message:e,observeIntersection:t,shouldAutoLoad:a,shouldAffectAppendix:s,uploadProgress:p,dimensions:f,onClick:d,onCancelUpload:h})}if(j)return c.a.createElement(za,{id:"album-media-"+e.id,message:e,observeIntersection:t,shouldAutoLoad:a,shouldAutoPlay:s,uploadProgress:p,lastSyncTime:o,dimensions:f,onClick:d,onCancelUpload:h})})))});a(243);function Va(){return(Va=Object.assign||function(e){for(var t=1;t{const o=Object(c.q)(null),r=Object(c.q)(null),i=Object(c.q)(null),d=e.content.video,b=Object(xt.b)(o,t),[u,m]=Object(c.r)(a&&s),h=Boolean(u&&b&&n),{mediaData:O,downloadProgress:j}=Object(ha.a)(Object(l.E)(e,"inline"),!h,Object(l.D)(e,"inline"),n),g=ja(e,O),{isBuffered:p,bufferingHandlers:I}=Object(ya.a)(),v=u&&!p,y=!1===Object(ga.a)(u),{shouldRender:C,transitionClassNames:E}=Object(oe.a)(v||!p,void 0,y),{shouldRenderThumb:w,transitionClassNames:M}=Object(la.a)(O,"slow"),[S,k]=Object(c.r)(!1),[N,T]=Object(c.r)(0);Object(c.n)(()=>{if(!S)return;const e=188*Math.PI,t=e-N*e,a=i.current,s=r.current,n=s.firstElementChild;n?n.firstElementChild.setAttribute("stroke-dashoffset",t.toString()):s.innerHTML=`\n \n `,T(a.currentTime/a.duration)},[S,N]);const P=Boolean(O&&b),A=()=>{k(!1),T(0),Object(Ca.a)(i.current),Object(f.b)(()=>{r.current.innerHTML=""})},R=(L=A,()=>{Wa&&Wa(),Wa=L});var L;Object(c.n)(()=>{i.current&&(P?Object(Ca.a)(i.current):i.current.pause())},[P]),Ea(i,P),Ma(i,Boolean(O)),Object(wa.a)(i,[O]);const B=Object(c.m)(()=>{if(!O)return void m(e=>!e);const e=i.current;S?e.paused?Object(Ca.a)(e):e.pause():(R(),e.pause(),e.currentTime=0,Object(Ca.a)(e),k(!0))},[R,S,O]),D=Object(c.m)(e=>{const t=e.currentTarget;T(t.currentTime/t.duration)},[]),F=Object(ne.a)("full-media",M);return c.a.createElement("div",{ref:o,className:"RoundVideo media-inner",onClick:B},(w||O)&&c.a.createElement("div",{className:"thumbnail-wrapper"},c.a.createElement("canvas",{ref:g,className:"thumbnail",style:`width: ${ut.e}px; height: ${ut.e}px`})),O&&c.a.createElement("div",{className:"video-wrapper"},c.a.createElement("video",Va({ref:i,className:F,width:ut.e,height:ut.e,autoPlay:!0,muted:!S,loop:!S,playsInline:!0,onEnded:S?A:void 0},I,{onTimeUpdate:S?D:void 0}),c.a.createElement("source",{src:O}))),c.a.createElement("div",{className:"progress",ref:r}),C&&c.a.createElement("div",{className:"media-loading "+E},c.a.createElement(Ia.a,{progress:j})),!O&&!u&&c.a.createElement("i",{className:"icon-large-play"}),c.a.createElement("div",{className:"message-media-duration"},S?Object(x.e)(i.current.currentTime):Object(x.e)(d.duration),(!S||i.current.paused)&&c.a.createElement("i",{className:"icon-muted-chat"})))};a(244);var Qa=({message:e,onClick:t})=>c.a.createElement("div",{className:"InlineButtons"},e.inlineButtons.map(e=>c.a.createElement("div",{className:"row"},e.map(e=>c.a.createElement(fe.a,{size:"tiny",ripple:!0,disabled:"NOT_SUPPORTED"===e.type,onClick:()=>t({button:e})},Object(mt.a)(e.text),"url"===e.type&&!e.value.match(n.ub)&&c.a.createElement("i",{className:"icon-arrow-right"}))))));a(245);var Ja=Object(c.h)(Object(s.h)((e,{message:t})=>{const{threadId:a,chatId:s}=t.threadInfo,n=Object(r.Fb)(e,s,a)||t.threadInfo,c=Object(r.Gb)(e,s,a),{byId:o}=e.users,{byId:i}=e.chats;return{threadInfo:n,usersById:o,chatsById:i,shouldRequestThreadUpdate:!!c&&!n.topMessageId}},(e,t)=>Object(h.l)(t,["openChat","requestThreadInfoUpdate"]))(({disabled:e,threadInfo:t,usersById:a,chatsById:s,shouldRequestThreadUpdate:n,openChat:o,requestThreadInfoUpdate:r})=>{const i=Object(he.a)(),{threadId:d,chatId:b,messagesCount:u,lastMessageId:m,lastReadInboxMessageId:h,recentReplierIds:O}=t,j=Object(c.m)(()=>{o({id:b,threadId:d})},[o,b,d]);if(Object(c.n)(()=>{n&&r({chatId:b,threadId:d})},[b,r,n,d]),void 0===u)return;const g=O&&O.map(e=>Object(l.ob)(e)?a[e]:s[e]).filter(Boolean);const p=Boolean(h&&m&&h0&&c.a.createElement("div",{className:"recent-repliers",dir:i.isRtl?"rtl":"ltr"},g.map(e=>c.a.createElement(ea.a,{key:e.id,size:"small",user:Object(l.ob)(e.id)?e:void 0,chat:Object(l.ob)(e.id)?void 0:e}))),c.a.createElement("div",{className:"label",dir:"auto"},u?i("Comments",u,"i"):i("LeaveAComment")),c.a.createElement("i",{className:"icon-next"}))}));a(246);function Ya(e){const t=Za(e.currentTarget);t&&t.setAttribute("data-is-document-group-hover","")}function Xa(e){const t=Za(e.currentTarget);t&&t.removeAttribute("data-is-document-group-hover")}function Za(e){let t=e;do{t=t.nextElementSibling}while(t&&!t.classList.contains("last-in-document-group"));return t}var es=Object(c.h)(Object(s.h)((e,t)=>{const{focusedMessage:a,forwardMessages:s,lastSyncTime:n}=e,{message:c,album:o,withSenderName:i,withAvatar:d,threadId:b,messageListType:u}=t,{id:m,chatId:h,viaBotId:O,replyToMessageId:j,isOutgoing:g}=c,p=Object(r.g)(e,h),f=Object(r.P)(e,h),I=p&&Object(l.mb)(p),v=p&&p.username,y=!f&&Object(l.hb)(c),C=i||d||y?Object(r.vb)(e,c):void 0,E=Object(r.K)(e,c),w=O?Object(r.Jb)(e,O):void 0,M=b?Object(r.Hb)(e,h,b):void 0,S=c.id===M,k=j===M,N=j&&!k?Object(r.l)(e,h,j):void 0,T=N&&Object(r.vb)(e,N),P=Object(r.Ib)(e,c),A="thread"===u&&(o?o.messages.some(t=>Object(r.U)(e,t)):Object(r.U)(e,c)),{direction:R,noHighlight:x}=A&&a||{},L=s.messageIds&&s.messageIds.includes(m),{query:B}=Object(r.B)(e)||{},D=Object(l.M)(c);let F;return F=o&&o.messages?o.messages.every(({id:t})=>Object(r.V)(e,t)):Object(r.V)(e,m),{theme:Object(r.Db)(e),chatUsername:v,forceSenderName:y,sender:C,originSender:E,botSender:w,shouldHideReply:k,isThreadTop:S,replyMessage:N,replyMessageSender:T,isFocused:A,isForwarding:L,isChatWithSelf:f,isChannel:I,lastSyncTime:n,highlight:B,isSingleEmoji:Boolean(D),animatedEmoji:D?Object(r.c)(e,D):void 0,isInSelectMode:Object(r.S)(e),isSelected:F,isGroupSelected:!!c.groupedId&&!c.isInAlbum&&Object(r.Q)(e,h,c.groupedId),threadId:b,isPinnedList:"pinned"===u,shouldAutoLoadMedia:p?Object(r.wb)(e,c,p,C):void 0,shouldAutoPlayMedia:Object(r.xb)(e,c),shouldLoopStickers:Object(r.yb)(e),...g&&{outgoingStatus:Object(r.gb)(e,c,"scheduled"===u)},..."number"==typeof P&&{uploadProgress:P},...A&&{focusDirection:R,noFocusHighlight:x}}},(e,t)=>Object(h.l)(t,["focusMessage","openMediaViewer","openAudioPlayer","cancelSendingMessage","openUserInfo","openChat","markMessagesRead","sendPollVote","toggleMessageSelection","setReplyingToId","openForwardMenu","clickInlineButton","disableContextMenuHint","showNotification"]))(({message:e,chatUsername:t,observeIntersectionForBottom:a,observeIntersectionForMedia:s,observeIntersectionForAnimatedStickers:n,album:o,noAvatars:r,withAvatar:i,withSenderName:d,noComments:h,appearanceOrder:O,isFirstInGroup:j,isLastInGroup:g,isFirstInDocumentGroup:p,isLastInDocumentGroup:f,isLastInList:I,theme:v,forceSenderName:y,sender:C,originSender:E,botSender:w,isThreadTop:M,shouldHideReply:S,replyMessage:k,replyMessageSender:N,outgoingStatus:T,uploadProgress:P,isFocused:A,focusDirection:R,noFocusHighlight:x,isForwarding:L,isChatWithSelf:B,isChannel:D,lastSyncTime:F,highlight:U,animatedEmoji:H,isInSelectMode:q,isSelected:G,isGroupSelected:_,threadId:z,messageListType:$,isPinnedList:V,shouldAutoLoadMedia:W,shouldAutoPlayMedia:K,shouldLoopStickers:Q,focusMessage:J,openMediaViewer:Y,openAudioPlayer:X,openUserInfo:Z,openChat:ee,cancelSendingMessage:te,markMessagesRead:ae,sendPollVote:se,toggleMessageSelection:ce,setReplyingToId:re,openForwardMenu:ie,clickInlineButton:le,disableContextMenuHint:de,showNotification:be})=>{const ue=Object(c.q)(null),Oe=Object(c.q)(null),je=Object(c.q)(null),ge=Object(he.a)();Object(xt.c)(Oe,a);const{isContextMenuOpen:pe,contextMenuPosition:Ie,handleBeforeContextMenu:ve,handleContextMenu:ye,handleContextMenuClose:Ce,handleContextMenuHide:Ee}=Object(Dt.a)(ue,m.n&&q,!0,m.b);Object(c.n)(()=>{pe&&de()},[pe,de]);const we=O<=0,[Me,Se]=Object(me.a)(we);Object(c.n)(()=>{we||setTimeout(Se,10*O)},[O,Se,we]);const{transitionClassNames:ke}=Object(oe.a)(Me,void 0,we,!1),{chatId:Ne,id:Te,threadInfo:Pe}=e,Ae=Object(l.xb)(e),Re=Object(l.yb)(e),xe="scheduled"===$||e.isScheduled,Le=Object(l.zb)(e)&&!S,Be=Boolean(Pe)&&"thread"===$,{forwardInfo:De,viaBotId:Fe}=e,Ue=De&&!B&&!De.isLinkedChannelPost,He=!!e.groupedId&&!e.isInAlbum,qe=Boolean(o)&&o.messages.length>1,{text:Ge,photo:_e,video:ze,audio:$e,voice:Ve,document:We,sticker:Ke,contact:Qe,poll:Je,webPage:Ye,invoice:Xe}=Object(l.v)(e),et=Object(l.x)(e),tt=Object(Ft.a)(e,U,Ut(et)),at=void 0!==Ie,st=D&&e.adminTitle||De&&!Ue&&De.adminTitle||void 0,nt=Object(c.p)(()=>st?Xt(st):void 0,[st]),ot=!(at||q||L)&&(!He||f),rt=D&&!xe,it=Boolean(V||De&&(De.isChannelPost||B&&!Re)&&De.fromMessageId),lt=!De||!B&&C?C:E,dt=De?E:C,bt=Object(ne.a)("Message message-list-item",j&&"first-in-group",g&&"last-in-group",p&&"first-in-document-group",f&&"last-in-document-group",I&&"last-in-list",Re&&"own",Boolean(e.views)&&"has-views",e.isEdited&&"was-edited",Le&&"has-reply",at&&"has-menu-open",A&&!x&&"focused",L&&"is-forwarding",e.isDeleting&&"is-deleting",He&&"is-in-document-group",qe&&"is-album",e.hasUnreadMention&&"has-unread-mention",G&&"is-selected",q&&"is-in-selection-mode",M&&"is-thread-top",Boolean(e.inlineButtons)&&"has-inline-buttons",ke),ht=function(e,{hasReply:t,customShape:a,isLastInGroup:s,asForwarded:n,hasThread:c,forceSenderName:o,hasComments:r,hasActionButton:i}={}){const{text:d,photo:b,video:u,audio:m,voice:h,document:O,poll:j,webPage:g,contact:p}=Object(l.v)(e),f=["message-content"],I=b||u,v=I&&!d,y=Boolean(e.viaBotId);return Ut(a)?f.push("emoji-only emoji-only-"+a):d&&f.push("text"),i&&f.push("has-action-button"),a&&(f.push("custom-shape"),u&&u.isRound&&f.push("round"),r&&f.push("has-comments")),b||u?f.push("media"):m?f.push("audio"):h?f.push("voice"):O?f.push("document"):p?f.push("contact"):j?f.push("poll"):g&&(f.push("web-page"),(g.photo||g.video)&&f.push("media")),n&&!a&&f.push("is-forwarded"),t&&f.push("is-reply"),c&&f.push("has-replies"),y&&f.push("is-via-bot"),o&&f.push("force-sender-name"),a||(f.push("has-shadow"),I&&r&&f.push("has-background"),(t||n||!v||y||o)&&f.push("has-solid-background"),!s||!b&&v||f.push("has-appendix")),f.join(" ")}(e,{hasReply:Le,customShape:et,isLastInGroup:g,asForwarded:Ue,hasThread:Be,forceSenderName:y,hasComments:e.threadInfo&&e.threadInfo.messagesCount>0,hasActionButton:rt||it}),Ot=e.threadInfo&&(!He||f)&&"thread"===$&&!h,jt=ht.includes("has-appendix");Object(ct.a)(Ne,Le?e.replyToMessageId:void 0,k,e.id),Zt(ue,Ne,A,R,x),Object(c.o)(()=>{je.current&&(je.current.innerHTML=Re?'':'')},[Re,jt]);const gt=Object(c.m)(t=>{t.stopPropagation(),ce({messageId:Te,groupedId:e.groupedId})},[Te,e.groupedId,ce]),pt=Object(c.m)(e=>{if(Ae)return;const t=qe&&o&&o.messages?{messageId:Te,childMessageIds:o.messages.map(({id:e})=>e),withShift:e&&e.shiftKey}:{messageId:Te,withShift:e&&e.shiftKey};ce(t)},[Ae,qe,o,Te,ce]),ft=Object(c.m)(()=>{re({messageId:Te})},[re,Te]),It=Object(c.m)(e=>{e.stopPropagation()},[]),vt=Object(c.m)(()=>{lt&&(Object(l.ob)(lt.id)?Z({id:lt.id}):ee({id:lt.id}))},[lt,Z,ee]),yt=Object(c.m)(()=>{dt?Object(l.ob)(dt.id)?Z({id:dt.id}):ee({id:dt.id}):be({message:ge("HidAccount")})},[dt,be,ge,Z,ee]),Ct=Object(c.m)(()=>{w&&Z({id:w.id})},[w,Z]),Et=Object(c.m)(()=>{J({chatId:Ne,threadId:z,messageId:e.replyToMessageId,replyMessageId:Te})},[J,Ne,z,e.replyToMessageId,Te]),wt=Object(c.m)(()=>{Y({chatId:Ne,threadId:z,messageId:Te,origin:xe?u.h.ScheduledInline:u.h.Inline})},[Ne,z,Te,Y,xe]),Mt=Object(c.m)(()=>{X({chatId:Ne,messageId:Te})},[Ne,Te,X]),St=Object(c.m)(e=>{Y({chatId:Ne,threadId:z,messageId:e,origin:xe?u.h.ScheduledAlbum:u.h.Album})},[Ne,z,Y,xe]),kt=Object(c.m)(e=>{const t=e.target;(t.classList.contains("text-content")||t.classList.contains("Message"))&&(m.b&&Ze.a.getIsKeyboardVisible()?setTimeout(()=>{ye(e)},350):ye(e))},[ye]),Nt=Object(c.m)(e=>{m.b?pt(e):ye(e)},[ye,pt]),Pt=Object(c.m)(()=>{ae({messageIds:[Te]})},[Te,ae]),At=Object(c.m)(()=>{te({chatId:Ne,messageId:Te})},[te,Ne,Te]),Rt=Object(c.m)(e=>{se({chatId:Ne,messageId:Te,options:e})},[Ne,Te,se]),Lt=Object(c.m)(()=>{ie({fromChatId:Ne,groupedId:e.groupedId})},[ie,Ne,e.groupedId]),Bt=Object(c.m)(()=>{if(o&&o.messages){const e=o.messages.map(({id:e})=>e);ie({fromChatId:Ne,messageIds:e})}else ie({fromChatId:Ne,messageIds:[Te]})},[o,ie,Ne,Te]),Gt=Object(c.m)(()=>{J({chatId:Ne,threadId:b.MAIN_THREAD_ID,messageId:Te})},[J,Ne,Te]),_t=Object(c.m)(()=>{J(He?{chatId:De.fromChatId,groupedId:e.groupedId,groupedChatId:Ne}:{chatId:De.fromChatId,messageId:De.fromMessageId})},[J,De,e,Ne,He]);let zt,$t="",Vt=!1;const Wt=Object(c.p)(()=>qe?Jt(Re,Boolean(Ue),Boolean(r),o):void 0,[qe,Re,Ue,r,o]),Kt=Ue?28:0;if(qe||!_e&&!ze)Wt&&(zt=Math.max(Ht(Boolean(Ge),Ot),Wt.containerStyle.width),zt-Wt.containerStyle.width>18&&(Vt=!0));else{let t;_e?t=qt(e,r).width:ze&&(t=ze.isRound?ut.e:qt(e,r).width),t&&(zt=Math.max(Ht(Boolean(Ge),Ot),t),zt-t>18&&(Vt=!0))}return zt&&($t=`width: ${zt+Kt}px`),c.a.createElement("div",{ref:ue,id:"message"+Te,className:bt,style:nt?`--meta-safe-author-width: ${nt}px`:void 0,"data-message-id":Te,onClick:q?pt:m.b?kt:void 0,onDoubleClick:q?void 0:ft,onMouseDown:q?void 0:e=>{Tt(e),Ae||ve(e)},onContextMenu:q||Ae?void 0:Nt,onMouseEnter:He&&!f?Ya:void 0,onMouseLeave:He&&!f?Xa:void 0},c.a.createElement("div",{ref:Oe,className:"bottom-marker","data-message-id":Te,"data-last-message-id":o?o.messages[o.messages.length-1].id:void 0,"data-has-unread-mention":e.hasUnreadMention}),!Ae&&!He&&c.a.createElement("div",{className:"message-select-control"},G&&c.a.createElement("i",{className:"icon-select"})),!Ae&&f&&c.a.createElement("div",{className:Object(ne.a)("message-select-control group-select",_&&"is-selected"),onClick:gt},_&&c.a.createElement("i",{className:"icon-select"})),i&&function(){const e=lt&&Object(l.ob)(lt.id),t=lt&&e?lt:void 0,a=lt&&!e?lt:void 0,s=!lt&&De?De.hiddenUserName:void 0;return c.a.createElement(ea.a,{size:"small",user:t,chat:a,text:s,lastSyncTime:F,onClick:t||a?vt:void 0})}(),c.a.createElement("div",{className:Object(ne.a)("message-content-wrapper",ht.includes("text")&&"can-select-text"),onClick:q&&He?pt:void 0},c.a.createElement("div",{className:ht,style:$t,dir:"auto"},Ue&&!et&&(!He||p)&&c.a.createElement("div",{className:"message-title"},ge("ForwardedMessage")),function(){const t=Object(ne.a)("content-inner",Ue&&!et&&"forwarded-message",Le&&"reply-message",Vt&&"no-media-corners"),a=g&&!tt&&!Ue&&!Be,i=!Ye&&!H&&tt,b=Object(ne.a)("text-content",i&&"with-meta",T&&"with-outgoing-icon");return c.a.createElement("div",{className:t,onDoubleClick:It,dir:"auto"},function(){if(et&&!Fe||!(d&&!_e&&!ze||Ue||Fe||y)||He&&!p)return;let t,a;!dt||et&&Fe?De&&De.hiddenUserName&&(t=De.hiddenUserName):(t=Object(l.X)(ge,dt),Ue||(a="color-"+Object(l.Z)(dt)));return c.a.createElement("div",{className:"message-title",dir:"ltr"},t?c.a.createElement("span",{className:Object(ne.a)("interactive",a),onClick:yt,dir:"auto"},Object(mt.a)(t)):w?void 0:" ",w&&c.a.createElement(c.a.Fragment,null,c.a.createElement("span",{className:"via"},ge("ViaBot")),c.a.createElement("span",{className:"interactive",onClick:Ct},Object(mt.a)("@"+w.username))),De&&De.isLinkedChannelPost?c.a.createElement("span",{className:"admin-title",dir:"auto"},ge("DiscussChannel")):e.adminTitle&&!D?c.a.createElement("span",{className:"admin-title",dir:"auto"},e.adminTitle):void 0)}(),Le&&c.a.createElement(na,{message:k,sender:N,observeIntersection:s,onClick:Et}),Ke&&c.a.createElement(ua,{message:e,observeIntersection:s,observeIntersectionForPlaying:n,shouldLoop:Q,lastSyncTime:F}),H&&c.a.createElement(ma.a,{size:"small",sticker:H,observeIntersection:s,lastSyncTime:F,forceLoadPreview:Ae}),qe&&c.a.createElement($a,{album:o,albumLayout:Wt,observeIntersection:s,shouldAutoLoad:W,shouldAutoPlay:K,isOwn:Re,hasCustomAppendix:a,lastSyncTime:F,onMediaClick:St}),!qe&&_e&&c.a.createElement(va,{message:e,observeIntersection:s,noAvatars:r,shouldAutoLoad:W,uploadProgress:P,shouldAffectAppendix:a,onClick:wt,onCancelUpload:At}),!qe&&ze&&ze.isRound&&c.a.createElement(Ka,{message:e,observeIntersection:s,shouldAutoLoad:W,shouldAutoPlay:K,lastSyncTime:F}),!qe&&ze&&!ze.isRound&&c.a.createElement(ka,{message:e,observeIntersection:s,noAvatars:r,shouldAutoLoad:W,shouldAutoPlay:K,uploadProgress:P,lastSyncTime:F,onClick:wt,onCancelUpload:At}),($e||Ve)&&c.a.createElement(oa.a,{theme:v,message:e,uploadProgress:P,lastSyncTime:F,isSelectable:He,isSelected:G,onPlay:Mt,onReadMedia:!Ve||Re&&!B?void 0:Pt,onCancelUpload:At}),We&&c.a.createElement(ca.a,{message:e,observeIntersection:s,uploadProgress:P,isSelectable:He,isSelected:G,onMediaClick:wt,onCancelUpload:At}),Qe&&c.a.createElement(Ta,{contact:Qe}),Je&&c.a.createElement(Da,{message:e,poll:Je,onSendVote:Rt}),!H&&tt&&c.a.createElement("p",{className:b,dir:"auto"},tt,i&&c.a.createElement(ia,{message:e,outgoingStatus:T,signature:st,onClick:pt})),Ye&&c.a.createElement(Ha,{message:e,observeIntersection:s,noAvatars:r,shouldAutoLoad:W,shouldAutoPlay:K,lastSyncTime:F,onMediaClick:wt,onCancelMediaTransfer:At}),Xe&&c.a.createElement(qa,{message:e}))}(),(!He||f)&&!(!Ye&&!H&&tt)&&c.a.createElement(ia,{message:e,outgoingStatus:T,signature:st,onClick:pt}),ot&&rt?c.a.createElement(fe.a,{className:"message-action-button",color:"translucent-white",round:!0,size:"tiny",ariaLabel:ge("lng_context_forward_msg"),onClick:f?Lt:Bt},c.a.createElement("i",{className:"icon-share-filled"})):ot&&it?c.a.createElement(fe.a,{className:"message-action-button",color:"translucent-white",round:!0,size:"tiny",ariaLabel:"Focus message",onClick:V?Gt:_t},c.a.createElement("i",{className:"icon-arrow-right"})):void 0,Ot&&c.a.createElement(Ja,{message:e,disabled:h}),jt&&c.a.createElement("div",{className:"svg-appendix",ref:je})),e.inlineButtons&&c.a.createElement(Qa,{message:e,onClick:le})),Ie&&c.a.createElement(aa,{isOpen:pe,anchor:Ie,message:e,album:o,chatUsername:t,messageListType:$,onClose:Ce,onCloseAnimationEnd:Ee}))}));var ts=Object(c.h)(({messageIds:e,messageGroups:t,isViewportNewest:a,isUnread:o,withUsers:r,noAvatars:i,containerRef:d,anchorIdRef:b,memoFirstUnreadIdRef:m,threadId:O,type:j,threadTopMessageId:g,hasLinkedChat:p,isSchedule:I,noAppearanceAnimation:v,onFabToggle:y,onNotchToggle:C,openHistoryCalendar:E})=>{const{observeIntersectionForMedia:w,observeIntersectionForReading:M,observeIntersectionForAnimatedStickers:S}=function(e,t,a){const{markMessageListRead:n,markMessagesRead:c}=Object(s.d)(),{observe:o}=Object(xt.a)({rootRef:t,throttleMs:Lt,margin:Bt}),{observe:r,freeze:i,unfreeze:l}=Object(xt.a)({rootRef:t},t=>{if("thread"!==e)return;let s=0;const o=[];t.forEach(e=>{const{isIntersecting:t,target:a}=e;if(!t)return;const{dataset:n}=a,c=Number(n.lastMessageId||n.messageId);c>s&&(s=c),n.hasUnreadMention&&o.push(c)}),a.current&&s>=a.current&&n({maxId:s}),o.length&&c({messageIds:o})});Object(re.a)(i,l);const{observe:d}=Object(xt.a)({rootRef:t,throttleMs:Lt});return{observeIntersectionForMedia:o,observeIntersectionForReading:r,observeIntersectionForAnimatedStickers:d}}(j,d,m),{backwardsTriggerRef:k,forwardsTriggerRef:N,fabTriggerRef:T}=function(e,t,a,o,r,i,l){const{loadViewportMessages:d}=Object(s.d)(),[b,m]=Object(c.p)(()=>"thread"===e?[Object(f.a)(()=>d({direction:u.e.Backwards}),1e3,!0,!1),Object(f.a)(()=>d({direction:u.e.Forwards}),1e3,!0,!1)]:[],[d,a]),h=Object(c.q)(null),O=Object(c.q)(null),j=Object(c.q)(null),g=Object(c.m)(()=>{if(!a||!a.length)return i(!1),void l(!1);if(!o)return i(!0),void l(!0);const{offsetHeight:e,scrollHeight:s,scrollTop:n}=t.current,c=s-n-e,d=c<=0;i(r?!d:!(c<=50)),l(!d)},[a,o,t,i,r,l]),{observe:p}=Object(xt.a)({rootRef:t,margin:n.fb},e=>{if(!m||!b)return;const a=e.find(({isIntersecting:e})=>e);if(!a)return;const{target:s}=a;"backwards-trigger"===s.className?(Object(At.a)(t.current),b()):"forwards-trigger"===s.className&&(Object(At.a)(t.current),m())});Object(xt.c)(h,p),Object(xt.c)(O,p);const{observe:I,freeze:v,unfreeze:y}=Object(xt.a)({rootRef:t,margin:50},g);Object(xt.c)(j,I);const{observe:C,freeze:E,unfreeze:w}=Object(xt.a)({rootRef:t},g);return Object(xt.c)(j,C),Object(le.a)(()=>{v(),E(),setTimeout(()=>{w(),y()},100)},[a]),{backwardsTriggerRef:h,forwardsTriggerRef:O,fabTriggerRef:j}}(j,d,e,a,o,y,C),P=Object(he.a)(),A=c.a.createElement("div",{className:Object(ne.a)("unread-divider","local-action-message"),key:"unread-messages"},c.a.createElement("span",null,P("UnreadMessages"))),R=v?0:t.reduce((e,t)=>e+Object(h.h)(t.senderGroups).length,0);let L=0;const B=t.map((e,t,a)=>{const s=e.senderGroups.map((e,s,n)=>{if(1===e.length&&!kt(e[0])&&Object(l.gb)(e[0])){const o=e[0],r=s===n.length-1&&t===a.length-1;return Object(h.e)([o.id===m.current&&A,c.a.createElement(sa,{key:o.id,message:o,observeIntersection:M,appearanceOrder:R-++L,isLastInList:r})])}let o;return Object(h.h)(e.map((d,u)=>{const f=kt(d)?d.mainMessage:d,I=kt(d)?d:void 0,v=Object(l.yb)(f),y=kt(d),C=e[u+1];f.previousLocalId&&b.current==="message"+f.previousLocalId&&(b.current="message"+f.id);const E=!y&&f.groupedId?f.groupedId:void 0,k=C&&!kt(C)?C.groupedId:void 0,N={isFirstInGroup:0===u,isLastInGroup:u===e.length-1,isFirstInDocumentGroup:Boolean(E&&E!==o),isLastInDocumentGroup:Boolean(E&&E!==k),isLastInList:u===e.length-1&&s===n.length-1&&t===a.length-1};o=E;const T=Object(l.G)(f),x="scheduled"!==j?T:`${f.date}_${T}`;return Object(h.e)([f.id===m.current?A:void 0,c.a.createElement(es,{key:x,message:f,observeIntersectionForBottom:M,observeIntersectionForMedia:w,observeIntersectionForAnimatedStickers:S,album:I,noAvatars:i,withAvatar:N.isLastInGroup&&r&&!v&&!(f.id===g),withSenderName:N.isFirstInGroup&&r&&!v,threadId:O,messageListType:j,noComments:!1===p,appearanceOrder:R-++L,isFirstInGroup:N.isFirstInGroup,isLastInGroup:N.isLastInGroup,isFirstInDocumentGroup:N.isFirstInDocumentGroup,isLastInDocumentGroup:N.isLastInDocumentGroup,isLastInList:N.isLastInList}),f.id===g&&c.a.createElement("div",{className:"local-action-message",key:"discussion-started"},c.a.createElement("span",null,P("DiscussionStarted")))])}))});return c.a.createElement("div",{className:"message-date-group",key:e.datetime,onMouseDown:Tt,teactFastList:!0},c.a.createElement("div",{className:Object(ne.a)("sticky-date",!I&&"interactive"),key:"date-header",onMouseDown:Tt,onClick:I?void 0:()=>E({selectedAt:e.datetime})},c.a.createElement("span",{dir:"auto"},I&&e.originalDate===n.xb&&P("MessageScheduledUntilOnline"),I&&e.originalDate!==n.xb&&P("MessageScheduledOn",Object(x.c)(P,e.datetime,void 0,!0)),!I&&Object(x.c)(P,e.datetime))),Object(h.h)(s))});return c.a.createElement("div",{className:"messages-container",teactFastList:!0},c.a.createElement("div",{ref:k,key:"backwards-trigger",className:"backwards-trigger"}),Object(h.h)(B),c.a.createElement("div",{ref:N,key:"forwards-trigger",className:"forwards-trigger"}),c.a.createElement("div",{ref:T,key:"fab-trigger",className:"fab-trigger"}))}),as=a(125);a(248);var ss=Object(c.h)(Object(s.h)((e,{userId:t})=>{const{stickers:a}=e.stickers.greeting,s=a&&a.length?a[t%a.length]:void 0,n=Object(r.g)(e,t);return n?{sticker:s,lastUnreadMessageId:n.lastMessage&&n.lastMessage.id!==n.lastReadInboxMessageId?n.lastMessage.id:void 0,connectionState:e.connectionState}:{}},(e,t)=>Object(h.l)(t,["loadGreetingStickers","sendMessage","markMessageListRead"]))(({sticker:e,connectionState:t,lastUnreadMessageId:a,loadGreetingStickers:s,sendMessage:n,markMessageListRead:o})=>{const r=Object(he.a)(),i=Object(c.q)(null),{observe:l}=Object(xt.a)({rootRef:i,debounceMs:200});Object(c.n)(()=>{e||"connectionStateReady"!==t||s()},[t,s,e]),Object(c.n)(()=>{"connectionStateReady"===t&&a&&o({maxId:a})},[t,o,a]);const d=Object(c.m)(e=>{e={...e,isPreloadedGlobally:!0},n({sticker:e})},[n]);return c.a.createElement("div",{className:"ContactGreeting",ref:i},c.a.createElement("div",{className:"wrapper"},c.a.createElement("p",{className:"title",dir:"auto"},r("Conversation.EmptyPlaceholder")),c.a.createElement("p",{className:"description",dir:"auto"},r("Conversation.GreetingText")),c.a.createElement("div",{className:"sticker"},e&&c.a.createElement(as.a,{sticker:e,onClick:d,clickArg:e,observeIntersection:l,size:160,className:"large"}))))}));a(249);var ns=Object(c.h)(({isChatWithSelf:e,type:t,isGroupChatJustCreated:a})=>{const s=Object(he.a)();return"scheduled"===t?function(e){return c.a.createElement("div",{className:"empty"},c.a.createElement("span",null,e("ScheduledMessages.EmptyPlaceholder")))}(s):e?function(e){return c.a.createElement("div",{className:"NoMessages"},c.a.createElement("div",{className:"wrapper"},c.a.createElement("i",{className:"icon icon-cloud-download"}),c.a.createElement("h3",{className:"title"},e("Conversation.CloudStorageInfo.Title")),c.a.createElement("ul",{className:"description"},c.a.createElement("li",null,e("Conversation.ClousStorageInfo.Description1")),c.a.createElement("li",null,e("Conversation.ClousStorageInfo.Description2")),c.a.createElement("li",null,e("Conversation.ClousStorageInfo.Description3")),c.a.createElement("li",null,e("Conversation.ClousStorageInfo.Description4")))))}(s):a?function(e){return c.a.createElement("div",{className:"NoMessages"},c.a.createElement("div",{className:"wrapper",dir:e.isRtl?"rtl":void 0},c.a.createElement("h3",{className:"title"},e("EmptyGroupInfo.Title")),c.a.createElement("p",{className:"description"},e("EmptyGroupInfo.Subtitle")),c.a.createElement("ul",{className:"list-checkmarks"},c.a.createElement("li",null,e("EmptyGroupInfo.Line1")),c.a.createElement("li",null,e("EmptyGroupInfo.Line2")),c.a.createElement("li",null,e("EmptyGroupInfo.Line3")),c.a.createElement("li",null,e("EmptyGroupInfo.Line4")))))}(s):c.a.createElement("div",{className:"empty"},c.a.createElement("span",null,s("NoMessages")))});a(250);const cs=Object(f.a)(e=>e(),200,!1);function os(e,t){return t&&1===t.length&&1===t[0].senderGroups.length&&1===t[0].senderGroups[0].length&&"content"in t[0].senderGroups[0][0]&&t[0].senderGroups[0][0].content.action&&t[0].senderGroups[0][0].content.action.type===e}var rs=Object(c.h)(Object(s.h)((e,{chatId:t,threadId:a,type:s})=>{const n=Object(r.g)(e,t);if(!n)return{};const c=Object(r.y)(e,t,a,s),o="scheduled"===s?Object(r.sb)(e,t):Object(r.n)(e,t),i=Object(r.Hb)(e,t,a);if(a!==b.MAIN_THREAD_ID&&!(o&&i&&o[i]))return{};const{isRestricted:d,restrictionReason:u,lastMessage:m}=n,h=Object(r.I)(e,t),O=h?!e.focusedMessage.noHighlight:void 0,j=a===b.MAIN_THREAD_ID&&!c&&!n.unreadCount&&!h&&m&&!m.groupedId,g=Object(r.h)(e,t);let p;if(Object(r.L)(e,t)){const a=Object(r.h)(e,t);p=a.fullInfo?a.fullInfo.botDescription||"NoMessages":"Updating bot info..."}return{isChatLoaded:!0,isRestricted:d,restrictionReason:u,isChannelChat:Object(l.mb)(n),isGroupChat:Object(l.nb)(n),isCreator:n.isCreator,isChatWithSelf:Object(r.P)(e,t),isBot:Boolean(g),messageIds:c,messagesById:o,firstUnreadId:Object(r.H)(e,t,a),isViewportNewest:"thread"!==s||Object(r.Y)(e,t,a),threadFirstMessageId:Object(r.G)(e,t,a),focusingId:h,hasFocusHighlight:O,isSelectModeActive:Object(r.S)(e),botDescription:p,threadTopMessageId:i,hasLinkedChat:n.fullInfo&&"linkedChatId"in n.fullInfo?Boolean(n.fullInfo.linkedChatId):void 0,...j&&{lastMessage:m}}},(e,t)=>Object(h.l)(t,["loadViewportMessages","setScrollOffset","openHistoryCalendar"]))(({chatId:e,threadId:t,type:a,hasTools:o,onFabToggle:i,onNotchToggle:d,isChatLoaded:b,isChannelChat:m,isGroupChat:O,canPost:j,isReady:g,isChatWithSelf:p,isCreator:I,isBot:v,messageIds:y,messagesById:C,firstUnreadId:E,isViewportNewest:w,threadFirstMessageId:M,isRestricted:S,restrictionReason:k,focusingId:N,hasFocusHighlight:T,isSelectModeActive:P,loadViewportMessages:A,setScrollOffset:R,lastMessage:x,botDescription:L,threadTopMessageId:B,hasLinkedChat:D,openHistoryCalendar:F})=>{const U=Object(c.q)(null),H=Object(c.q)("thread"===a&&Object(r.tb)(Object(s.e)(),e,t)||0),q=Object(c.q)(),G=Object(c.q)(),_=Object(c.q)(),z=Object(c.q)(),$=Object(c.q)(),V=Object(c.q)(),W=Object(c.q)(!1),K=Object(c.q)(Boolean(x)),[Q,J]=Object(c.r)(),Y=Boolean(y);Object(le.a)(()=>{Y&&Object(f.e)(()=>{K.current=!1})},[Y]),Object(le.a)(()=>{$.current=E,z.current||(z.current=E)},[E]),Object(le.a)(()=>{V.current=N},[N]);const X=Object(c.p)(()=>{if(!y||!C)return;const e=!B||y[0]&&M!==y[0]?y:[B,...y];if(!e.length)return;const t=e.map(e=>C[e]).filter(Boolean);return Nt(Object(h.k)(t,["date","id"]),z.current)},[y,C,M,B]),Z=Object(c.p)(()=>{if("thread"===a)return Object(f.a)(()=>A({direction:u.e.Around}),1e3,!0,!1)},[A,y]),{isScrolled:ee,updateStickyDates:te}=Pt(),ae=Object(c.m)(()=>{if(W.current)return void(W.current=!1);const s=U.current;V.current||te(s,o),cs(()=>{Object(f.b)(()=>{s.parentElement&&(H.current=s.scrollHeight-s.scrollTop,"thread"===a&&R({chatId:e,threadId:t,scrollOffset:H.current}))})})},[te,o,a,R,e,t]);Object(c.n)(()=>{if(!("ResizeObserver"in window))return;const e=new ResizeObserver(([e])=>{e.target.offsetParent&&J(e.contentRect.height)});return e.observe(U.current),()=>{e.disconnect()}},[]);const{height:ce}=et();Object(c.n)(()=>{g&&(U.current.dataset.normalHeight=String(U.current.offsetHeight))},[ce,g]),Object(c.n)(()=>{if(!Z||!b||S||N)return;const e=U.current;(!y||y.length{if(!y||!_.current||!g)return;const e=_.current.filter(e=>y.includes(Number(e.dataset.messageId))),t=e[1]||e[0];t&&(q.current=t.id,G.current=t.getBoundingClientRect().top)},[y,w,Q,o,g]),Object(Mt.a)(([e,t,a])=>{const s=U.current;if(_.current=Array.from(s.querySelectorAll(".message-list-item")),!s.offsetParent)return;const c=w&&y&&y.length{s.parentElement&&s.parentElement.classList.remove("force-messages-scroll")},1e3));const{scrollTop:r,scrollHeight:i,offsetHeight:l}=s,d=H.current,b=_.current[_.current.length-1],u=b?b.offsetHeight:0,m=w&&t&&d-(a||l)-u<=100;let h;const O=y&&e&&y[0]!==e[0],j=y&&e&&y[y.length-1]!==e[e.length-1],g=y&&V.current===y[y.length-1];if(m&&j&&!O&&!g&&(b&&Object(f.b)(()=>{Object(Rt.a)(s,b,"end",20,void 0,void 0,void 0,!0)}),h=i-l,H.current=Math.max(i-h,l),!c))return;const p=void 0!==a&&a!==Q,I=q.current&&s.querySelector("#"+q.current),v=!I&&z.current&&s.querySelector(".unread-divider");if(m&&p){if(Object(Rt.b)())return;h=i-l}else if(I){h=r+(I.getBoundingClientRect().top-(G.current||0))}else h=v?Math.min(v.offsetTop-(o?60:10),i-d):i-d;Object(At.a)(s,h),V.current||(W.current=!0,Object(f.b)(()=>{W.current=!1})),H.current=Math.max(i-h,l)},[y,w,Q,o]),Object(St.a)(([e])=>{void 0!==e&&Object(se.d)(200+n.c)},[P]);const oe=Object(he.a)(),re=Boolean(e&&Object(l.ob)(e)),ie=Boolean(!re&&!m||p),de=Boolean(!ie||m),be=Object(l.ob)(e)&&!p&&!v&&(!X&&!x&&y&&(!_.current||0===_.current.length)||os("contactSignUp",X)||x&&x.content.action&&"contactSignUp"===x.content.action.type),ue=O&&I&&os("chatCreate",X),me=Object(ne.a)("MessageList custom-scroll",de&&"no-avatars",!j&&"no-composer","pinned"===a&&"type-pinned",T&&"has-focus-highlight",P&&"select-mode-active",ee&&"scrolled",!g&&"is-animating");return c.a.createElement("div",{ref:U,className:me,onScroll:ae,onMouseDown:Tt},S?c.a.createElement("div",{className:"empty"},c.a.createElement("span",null,k?k.text:"This is a private "+(m?"channel":"chat"))):L?c.a.createElement("div",{className:"empty rich"},c.a.createElement("span",null,Object(mt.a)(oe(L),["br","emoji","links"]))):be?c.a.createElement(ss,{userId:e}):!y||X&&!ue?y&&X||x?c.a.createElement(ts,{messageIds:y||[x.id],messageGroups:X||Nt([x]),isViewportNewest:Boolean(w),isUnread:Boolean(E),withUsers:ie,noAvatars:de,containerRef:U,anchorIdRef:q,memoFirstUnreadIdRef:z,threadId:t,type:a,threadTopMessageId:B,hasLinkedChat:D,isSchedule:!!X&&"scheduled"===a,noAppearanceAnimation:!X||!K.current,onFabToggle:i,onNotchToggle:d,openHistoryCalendar:F}):c.a.createElement(xe.a,{color:"white"}):c.a.createElement(ns,{chatId:e,type:a,isChatWithSelf:p,isGroupChatJustCreated:ue}))}));a(251);var is=Object(c.h)(Object(s.h)(e=>{const t=Object(r.z)(e);if(!t)return{};const{chatId:a,threadId:s,type:n}=t,c=Object(r.g)(e,a);return{messageListType:n,unreadCount:c&&s===b.MAIN_THREAD_ID&&"thread"===n?c.unreadCount:void 0}},(e,t)=>Object(h.l)(t,["focusNextReply"]))(({isShown:e,canPost:t,messageListType:a,unreadCount:s,focusNextReply:n})=>{const o=Object(he.a)(),r=Object(c.q)(null),i=Object(c.m)(()=>{if(e)if("thread"===a)n();else{const e=r.current.parentElement.querySelector(".MessageList"),t=e.querySelectorAll(".message-list-item"),a=t[t.length-1];if(!a)return;Object(Rt.a)(e,a,"end",20)}},[e,a,n]),l=Object(ne.a)("ScrollDownButton",e&&"revealed",!t&&"no-composer");return c.a.createElement("div",{ref:r,className:l},c.a.createElement("div",{className:"ScrollDownButton-inner"},c.a.createElement(fe.a,{color:"secondary",round:!0,onClick:i,ariaLabel:o("AccDescrPageDown")},c.a.createElement("i",{className:"icon-arrow-down"})),Boolean(s)&&c.a.createElement("div",{className:"unread-count"},Object(rt.b)(s))))})),ls=a(135),ds=a(142);async function bs(e,t,a,s){const n=URL.createObjectURL(t),{type:c,size:o}=t;let r,i;if(c.startsWith("image/"))if(a){const a=await Object(Xe.g)(n),{width:o,height:i}=a;if(o>1280||i>1280||"image/jpeg"!==c){const c=await function(e){return new Promise(t=>{const a=document.createElement("canvas"),s=a.getContext("2d");let{width:n,height:c}=e;(n>1280||c>1280)&&(n>=c?(c*=1280/n,n=1280):(n*=1280/c,c=1280)),a.width=n,a.height=c,s.drawImage(e,0,0,e.width,e.height,0,0,n,c),a.toBlob(t,"image/jpeg",100)})}(a);return c?(URL.revokeObjectURL(n),bs(e,c,!0,s)):bs(e,t,!1,s)}r={width:o,height:i}}else i=n;else if(c.startsWith("video/")){if(o<10485760){const{videoWidth:e,videoHeight:t,duration:a}=await Object(Xe.h)(n);r={width:e,height:t,duration:a}}i=await Object(Xe.c)(n)}return{blobUrl:n,filename:e,mimeType:c,size:o,quick:r,previewBlobUrl:i,...s}}var us=a(191);let ms;function hs(e){ms.focus(),e.focus()}m.e&&(ms=document.createElement("input"),ms.classList.add("for-ios-autocapitalization-fix"),document.body.appendChild(ms));var Os=a.p+"c0155344d336103c2b6a0b28cc510750.js";const js={encoderPath:Os,reuseWorker:!0},gs={type:"audio/ogg"};let ps,fs,Is;async function vs(){return ps||(ps=a.e(10).then(a.t.bind(null,335,7)),fs=(await ps).default,Is=new fs(js)),ps}async function ys(e){await async function(){await vs(),await Is.start()}();const t=Date.now();let a;const s=[],n=[];Is.ondataavailable=e=>{s.push(e)};const c=function(e,t){const a=e.sourceNode,s=a.context.createAnalyser();s.fftSize=64,a.connect(s);const n=s.frequencyBinCount,c=new Uint8Array(n);let o=!1;return function e(){if(o)return;s.getByteFrequencyData(c);const a=c.reduce((e,t)=>e+t,0),r=a/n/255;t(r<.1?0:r),requestAnimationFrame(e)}(),()=>{o=!0}}(Is,t=>{n.push(255*t),e(t)});return{stop:()=>new Promise((e,o)=>{Is.onstop=()=>{e({blob:new Blob(s,gs),duration:Math.round(((a||Date.now())-t)/1e3),waveform:n})},Is.onerror=o;const r=Math.max(0,t+1e3-Date.now());setTimeout(()=>{Is.stop(),c()},r)}),pause:()=>{const e=Math.max(0,t+1e3-Date.now());setTimeout(()=>{Is.pause(),a=Date.now(),c()},e)}}}const Cs=["image/png","image/jpeg","image/gif"];function Es(e){const{text:t,entities:a}=e||{};if(!t)return"";const s=Object(Ft.b)(t,a,void 0,void 0,!0);return Array.isArray(s)?s.join(""):s}let ws,Ms;var Ss=a(65);var ks=a(192),Ns=a(200);const Ts=document.createElement("div"),Ps=/^@([a-z0-9_]{1,32})[\u00A0\u0020]+(.*)/i,As=/^@([a-z0-9_]{1,32})[\u00A0\u0020]+\n{2,}/i;function Rs(e,t,a,n){const[o,r,i]=Object(me.a)(),l=function(e){return Ts.innerHTML=e.replace(/
/g,"\n"),Ts.innerText}(a),{queryInlineBot:d,resetInlineBot:b}=Object(s.d)(),{username:u,query:m,canShowHelp:h}=function(e){const t=e.match(Ps);if(!t)return{username:"",query:"",canShowHelp:!1};return{username:t[1],query:t[2],canShowHelp:""===t[2]&&!e.match(As)}}(l),O=u.toLowerCase(),j=Object(ga.a)(m),g=Object(ga.a)(u),p=n&&n[O],{id:f,switchPm:I,offset:v,results:y,isGallery:C,help:E}=p||{};Object(c.n)(()=>{j!==m&&i()},[j,m,i]),Object(c.n)(()=>{e&&O&&t&&d({chatId:t,username:O,query:m})},[m,e,d,t,O]);const w=Object(c.m)(()=>{d({chatId:t,username:O,query:m,offset:v})},[v,t,m,d,O]);return Object(c.n)(()=>{e&&f&&(I||y&&y.length)?r():i()},[f,e,r,y,I,i]),g!==u&&b({username:g}),{isOpen:o,closeTooltip:i,loadMore:w,username:u,id:f,isGallery:C,switchPm:I,results:y,help:h&&E?`@${u} ${E}`:void 0}}var xs=Object(c.h)(e=>{const{isOpen:t}=e,a=Object(Re.a)(Ae.a.Extra,"DeleteMessageModal",!t);return a?c.a.createElement(a,e):void 0});function Ls(){return(Ls=Object.assign||function(e){for(var t=1;t{const a=Object(c.q)(!1),s=Object(c.m)(()=>{if(a.current=!0,Ds)return Ds=!1,void e();Bs&&(clearTimeout(Bs),Bs=void 0),Bs=window.setTimeout(()=>{a.current&&e()},200)},[e]),n=Object(c.m)(()=>{a.current=!1},[]);return c.a.createElement(fe.a,Ls({},t,{onMouseEnter:m.n?void 0:s,onMouseLeave:m.n?void 0:n,onClick:m.n?e:void 0}))});var Us=Object(c.h)(e=>{const{isOpen:t}=e,a=Object(Re.a)(Ae.a.Extra,"AttachMenu",!t);return a?c.a.createElement(a,e):void 0});var Hs=Object(c.h)(e=>{const{isOpen:t}=e,a=Object(Re.a)(Ae.a.Extra,"SymbolMenu",!t);return a?c.a.createElement(a,e):void 0});var qs=Object(c.h)(e=>{const{isOpen:t}=e,a=Object(Re.a)(Ae.a.Extra,"InlineBotTooltip",!t);return a?c.a.createElement(a,e):void 0});var Gs=Object(c.h)(e=>{const{isOpen:t}=e,a=Object(Re.a)(Ae.a.Extra,"MentionTooltip",!t);return a?c.a.createElement(a,e):void 0});var _s=Object(c.h)(e=>{const{isOpen:t}=e,a=Object(Re.a)(Ae.a.Extra,"CustomSendMenu",!t);return a?c.a.createElement(a,e):void 0});var zs=e=>{const{isOpen:t}=e,a=Object(Re.a)(Ae.a.Extra,"StickerTooltip",!t);return a?c.a.createElement(a,e):void 0},$s=a(193),Vs=a(153);a(252);var Ws=Object(c.h)(Object(s.h)((e,{messageId:t})=>{const{chatId:a}=Object(r.z)(e)||{};return a?{message:Object(r.l)(e,a,t)}:{}},(e,t)=>Object(h.l)(t,["clickInlineButton"]))(({isOpen:e,message:t,onClose:a,clickInlineButton:s})=>{const[n,o]=Object(Vs.a)(e,a),{isKeyboardSingleUse:r}=t||{},[i,l,d]=Object(me.a)(!0),b=()=>{d(),a()};if(Object(c.n)(()=>{l()},[l,t]),t&&t.keyboardButtons)return c.a.createElement(De.a,{isOpen:e||i,autoClose:r,positionX:"right",positionY:"bottom",onClose:b,className:"BotKeyboardMenu",onCloseAnimationEnd:b,onMouseEnter:m.n?void 0:n,onMouseLeave:m.n?void 0:o},c.a.createElement("div",{className:"content"},t.keyboardButtons.map(e=>c.a.createElement("div",{className:"row"},e.map(e=>c.a.createElement(fe.a,{ripple:!0,disabled:"NOT_SUPPORTED"===e.type,onClick:()=>s({button:e})},e.text))))))})),Ks=a(194),Qs=a(122);a(254);var Js=Object(c.h)(Object(s.h)(e=>{const{chatId:t,threadId:a,type:s}=Object(r.z)(e)||{};if(!t||!a||!s)return{};const{currentUserId:n,forwardMessages:{fromChatId:c,toChatId:o,messageIds:i}}=e,d=Object(r.ob)(e,t,a),b="scheduled"===s?Object(r.F)(e,t):Object(r.D)(e,t,a),u=e.settings.byKey.animationLevel>=1,m=o===t;let h,O;if(d?h=Object(r.l)(e,t,d):b?h=Object(r.E)(e,t,a,s):m&&1===i.length&&(h=Object(r.l)(e,c,i[0])),d&&h){const{forwardInfo:a}=h,s=t===n;a&&(a.isChannelPost||s)&&(O=Object(r.K)(e,h)),O||(O=Object(r.vb)(e,h))}else m&&(O=Object(l.ob)(c)?Object(r.Jb)(e,c):Object(r.g)(e,c));return{replyingToId:d,editingId:b,message:h,sender:O,shouldAnimate:u,forwardedMessagesCount:m?i.length:void 0}},(e,t)=>Object(h.l)(t,["setReplyingToId","setEditingId","focusMessage","exitForwardMode"]))(({replyingToId:e,editingId:t,message:a,sender:s,shouldAnimate:n,forwardedMessagesCount:o,setReplyingToId:r,setEditingId:i,focusMessage:l,exitForwardMode:d})=>{const b=Boolean((e||t)&&a||s&&o),u=Object(Qs.a)([o],o?300:void 0),{shouldRender:m,transitionClassNames:h}=Object(oe.a)(u&&b,void 0,!n,void 0,!n),O=Object(c.m)(()=>{e?r({messageId:void 0}):t?i({messageId:void 0}):o&&d()},[e,t,o,r,i,d]);Object(c.n)(()=>b?Object(de.a)(O):void 0,[b,O]);const j=Object(c.m)(()=>{l({chatId:a.chatId,messageId:a.id})},[l,a]),g=Object(ne.a)("ComposerEmbeddedMessage",h),p=o&&o>1?o+" forwarded messages":void 0;if(m)return c.a.createElement("div",{className:g},c.a.createElement("div",null,c.a.createElement(fe.a,{round:!0,color:"translucent",ariaLabel:"Cancel replying",onClick:O},c.a.createElement("i",{className:"icon-close"})),c.a.createElement(na,{className:"inside-input",message:a,sender:s,customText:p,title:t?"Edit Message":void 0,onClick:j})))}));var Ys=Object(c.h)(e=>{const{attachments:t}=e,a=Object(Re.a)(Ae.a.Extra,"AttachmentModal",!t.length);return a?c.a.createElement(a,e):void 0});var Xs=Object(c.h)(e=>{const{isOpen:t}=e,a=Object(Re.a)(Ae.a.Extra,"PollModal",!t);return a?c.a.createElement(a,e):void 0});var Zs=Object(c.h)(e=>{const{isOpen:t}=e,a=Object(Re.a)(Ae.a.Extra,"DropArea",!t);return a?c.a.createElement(a,e):void 0});a(255);const en=new RegExp(n.rb,"i");var tn=Object(c.h)(Object(s.h)((e,{chatId:t,threadId:a})=>{const s=Object(r.db)(e,t,a);return{webPagePreview:e.webPagePreview,noWebPage:s}},(e,t)=>Object(h.l)(t,["loadWebPagePreview","clearWebPagePreview","toggleMessageWebPage"]))(({chatId:e,threadId:t,messageText:a,disabled:s,webPagePreview:n,noWebPage:o,loadWebPagePreview:r,clearWebPagePreview:i,toggleMessageWebPage:l})=>{const d=Object(c.p)(()=>{const{text:e,entities:t}=Object(ds.a)(a),s=t&&t.find(({type:e})=>e===b.ApiMessageEntityTypes.TextUrl);if(s)return s.url;const n=e.match(en);return n?n[0]:void 0},[a]);Object(c.n)(()=>{d?r({text:d}):(i(),l({chatId:e,threadId:t}))},[e,l,i,d,r,t]),Object(le.a)(()=>{i(),l({chatId:e,threadId:t})},[e]);const u=Boolean(n&&a.length&&!o&&!s),{shouldRender:m,transitionClassNames:h}=Object(oe.a)(u),O=Object(ot.a)(n);if(!m||!O)return;const{photo:j,...g}=O,p={content:{webPage:g}};return c.a.createElement("div",{className:Object(ne.a)("WebPagePreview",h)},c.a.createElement("div",null,c.a.createElement(fe.a,{round:!0,color:"translucent",ariaLabel:"Clear Webpage Preview",onClick:()=>{l({chatId:e,threadId:t,noWebPage:!0})}},c.a.createElement("i",{className:"icon-close"})),c.a.createElement(Ha,{message:p,inPreview:!0})))})),an=a(128);var sn=Object(c.h)(e=>{const{isOpen:t}=e,a=Object(Re.a)(Ae.a.Extra,"CalendarModal",!t);return a?c.a.createElement(a,e):void 0});var nn=Object(c.h)(e=>{const{isOpen:t}=e,a=Object(Re.a)(Ae.a.Extra,"PaymentModal",!t);return a?c.a.createElement(a,e):void 0});var cn,on=Object(c.h)(e=>{const{isOpen:t}=e,a=Object(Re.a)(Ae.a.Extra,"ReceiptModal",!t);return a?c.a.createElement(a,e):void 0});a(256);!function(e){e.Send="send",e.Record="record",e.Edit="edit"}(cn||(cn={}));var rn=Object(c.h)(Object(s.h)((e,{chatId:t,threadId:a,messageListType:s})=>{const c=Object(r.g)(e,t),o=c&&Object(r.p)(e,c),i=c?Object(r.O)(e,c):void 0,d=Object(r.P)(e,t),u=i&&Object(r.cb)(e,t),m=Object(r.qb)(e,t),{language:h}=e.settings.byKey,O=e.emojiKeywords[n.j],j=h!==n.j?e.emojiKeywords[h]:void 0,g=u?u.id:void 0,p=g?Object(r.l)(e,t,g):void 0;return{editingMessage:Object(r.E)(e,t,a,s),connectionState:e.connectionState,draft:Object(r.C)(e,t,a),chat:c,isChatWithBot:i,isChatWithSelf:d,canScheduleUntilOnline:!d&&!i&&c&&o&&Object(l.ob)(t)&&o.status&&Boolean(o.status.wasOnline),isRightColumnShown:Object(r.W)(e),isSelectModeActive:Object(r.S)(e),withScheduledButton:a===b.MAIN_THREAD_ID&&"thread"===s&&Boolean(m&&m.length),shouldSchedule:"scheduled"===s,botKeyboardMessageId:g,botKeyboardPlaceholder:p?p.keyboardPlaceholder:void 0,isForwarding:t===e.forwardMessages.toChatId,isPollModalOpen:e.isPollModalOpen,stickersForEmoji:e.stickers.forEmoji.stickers,groupChatMembers:c&&c.fullInfo&&c.fullInfo.members,topInlineBotIds:e.topInlineBots&&e.topInlineBots.userIds,currentUserId:e.currentUserId,usersById:e.users.byId,lastSyncTime:e.lastSyncTime,contentToBeScheduled:e.messages.contentToBeScheduled,isPaymentModalOpen:e.payment.isPaymentModalOpen,isReceiptModalOpen:Boolean(e.payment.receipt),shouldSuggestStickers:e.settings.byKey.shouldSuggestStickers,recentEmojis:e.recentEmojis,baseEmojiKeywords:O?O.keywords:void 0,emojiKeywords:j?j.keywords:void 0,serverTimeOffset:e.serverTimeOffset,inlineBots:e.inlineBots.byUsername,isInlineBotLoading:e.inlineBots.isLoading}},(e,t)=>Object(h.l)(t,["sendMessage","editMessage","saveDraft","clearDraft","showDialog","setStickerSearchQuery","setGifSearchQuery","forwardMessages","openPollModal","closePollModal","closePaymentModal","clearReceipt","loadScheduledHistory","openChat","addRecentEmoji","sendInlineBotResult"]))(({dropAreaState:e,shouldSchedule:t,canScheduleUntilOnline:a,isReady:o,onDropHide:r,editingMessage:i,chatId:d,threadId:u,messageListType:h,draft:O,chat:j,connectionState:g,isChatWithBot:p,isChatWithSelf:I,isRightColumnShown:v,isSelectModeActive:y,isForwarding:C,isPollModalOpen:E,isPaymentModalOpen:w,isReceiptModalOpen:M,botKeyboardMessageId:S,botKeyboardPlaceholder:k,withScheduledButton:N,stickersForEmoji:T,groupChatMembers:P,topInlineBotIds:A,currentUserId:R,usersById:L,lastSyncTime:B,contentToBeScheduled:D,shouldSuggestStickers:F,baseEmojiKeywords:U,emojiKeywords:H,serverTimeOffset:q,recentEmojis:G,inlineBots:_,isInlineBotLoading:z,sendMessage:$,editMessage:V,saveDraft:W,clearDraft:K,showDialog:Q,setStickerSearchQuery:J,setGifSearchQuery:Y,forwardMessages:X,openPollModal:Z,closePollModal:ee,loadScheduledHistory:te,closePaymentModal:ae,openChat:se,clearReceipt:ce,addRecentEmoji:oe,sendInlineBotResult:le})=>{const be=Object(he.a)(),ue=Object(c.q)(null),[Oe,je]=Object(c.r)(""),ge=Object(c.q)(),pe=Object(ga.a)(e),[Ie,ve,ye]=Object(me.a)(),[Ce,Ee]=Object(c.r)(),{width:Me}=Ze.a.get(),Se=Object(c.q)(Oe);Object(c.n)(()=>{Se.current=Oe},[Oe]),Object(c.n)(()=>{ge.current=void 0},[d]),Object(c.n)(()=>{d&&B&&u===b.MAIN_THREAD_ID&&o&&te()},[o,d,te,B,u]),Object(c.o)(()=>{ue.current&&(ue.current.innerHTML='')},[]),Object(c.n)(()=>{D&&(Ee(D),ve())},[D,ve]);const[ke,Ne]=Object(c.r)([]),[Te,Pe,Ae]=Object(me.a)(),[Re,xe,Le]=Object(me.a)(),[Be,De,Fe]=Object(me.a)(),[Ue,He,qe]=Object(me.a)(),[Ge,_e]=Object(me.a)(),[ze,$e,Ve]=Object(me.a)(),{startRecordingVoice:We,stopRecordingVoice:Ke,pauseRecordingVoice:Qe,activeVoiceRecording:Ye,currentRecordTime:Xe,recordButtonRef:et,startRecordTimeRef:tt}=(()=>{const e=Object(c.q)(null),[t,a]=Object(c.r)(),s=Object(c.q)(),[n,o]=Object(c.r)();Object(c.n)(()=>{m.e&&m.o&&vs()},[]);const r=Object(c.m)(async()=>{try{const{stop:t,pause:n}=await ys(t=>{e.current&&(s.current&&Date.now()%4==0&&(e.current.style.boxShadow=`0 0 0 ${50*(t||0)}px rgba(0,0,0,.15)`),o(Date.now()))});s.current=Date.now(),o(Date.now()),a({stop:t,pause:n})}catch(e){console.error(e)}},[]),i=Object(c.m)(()=>{if(t){e.current&&(e.current.style.boxShadow="none");try{return t.pause()}catch(e){return void console.error(e)}}},[t]),l=Object(c.m)(()=>{if(t){a(void 0),s.current=void 0,o(void 0),e.current&&(e.current.style.boxShadow="none");try{return t.stop()}catch(e){return void console.error(e)}}},[t]);return Object(c.n)(()=>t?Object(de.a)(l):void 0,[t,l]),{startRecordingVoice:r,pauseRecordingVoice:i,stopRecordingVoice:l,activeVoiceRecording:t,currentRecordTime:n,recordButtonRef:e,startRecordTimeRef:s}})(),at=i?cn.Edit:!m.o||Ye||Oe&&!ke.length||C?cn.Send:cn.Record,st=!t,{isMentionTooltipOpen:nt,mentionFilter:ct,closeMentionTooltip:ot,insertMention:rt,mentionFilteredUsers:it}=Object(Ns.a)(!ke.length,Oe,je,void 0,P,A,R,L),{isOpen:lt,id:dt,isGallery:bt,switchPm:ut,results:ht,closeTooltip:Ot,help:jt,loadMore:gt}=Rs(Boolean(!ke.length&&B),d,Oe,_),{isContextMenuOpen:pt,handleContextMenu:ft,handleContextMenuClose:It,handleContextMenuHide:vt}=Object(Dt.a)(et,!(at===cn.Send&&st)),yt=Object(c.p)(()=>Object(l.b)(j,p),[j,p]),Ct=j&&Object(l.jb)(j),Et=Object(l.j)(j),{isStickerTooltipOpen:wt,closeStickerTooltip:Mt}=function(e,t,a,n=!1){const{loadStickersForEmoji:o,clearStickersForEmoji:r}=Object(s.d)(),i=m.d&&1===Object(Ss.a)(t)||!m.d&&Boolean(t.match(/^]*?>$/g)),l=Boolean(a)&&i;return Object(c.n)(()=>{n||(e&&i?o({emoji:t}):!l&&i||r())},[t,i,r,o,e,n]),{isStickerTooltipOpen:l,closeStickerTooltip:r}}(Boolean(F&&yt.canSendStickers&&!ke.length),Oe,T,!o),{isEmojiTooltipOpen:St,closeEmojiTooltip:kt,filteredEmojis:Nt,insertEmoji:Tt}=Object(ks.a)(Boolean(F&&yt.canSendStickers&&!ke.length),Oe,G,void 0,je,U,H,!o),Pt=Object(c.m)((e,t=n.z)=>{const a=window.getSelection(),s=document.getElementById(t),c=Object(mt.a)(e,["escape_html","emoji_html","br_html"]).join("").replace(/\u200b+/g,"​");if(a.rangeCount){const e=a.getRangeAt(0);if(Object(us.a)(e,t))return function(e){const t=window.getSelection();if(t&&t.getRangeAt&&t.rangeCount){const a=t.getRangeAt(0);a.deleteContents();const s=a.createContextualFragment(e),n=s.lastChild;a.insertNode(s),n?(a.setStartAfter(n),a.setEndAfter(n)):a.collapse(!1),t.removeAllRanges(),t.addRange(a)}}(c),void s.dispatchEvent(new Event("input",{bubbles:!0}))}je(`${Se.current}${c}`),requestAnimationFrame(()=>{Object(ls.a)(s)})},[]),At=Object(c.m)(()=>{const e=window.getSelection();if(e.rangeCount){const t=e.getRangeAt(0);if(Object(us.a)(t,n.z))return void document.execCommand("delete",!1)}je(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 a=t.lastChild;if(a.lastChild)for(;a.lastChild;)a=a.lastChild;const s=a.textContent.length,n=document.createRange(),c=window.getSelection();n.setStart(a,s),n.setEnd(a,s),c.removeAllRanges(),c.addRange(n),document.execCommand("delete",!1);const o=t.innerHTML;return document.body.removeChild(t),o}(Se.current))},[]),Rt=Object(c.m)((e=!1)=>{e||je(""),Ne([]),Mt(),ye(),Ee(void 0),ot(),kt(),m.l?setTimeout(()=>Fe(),350):Fe()},[Mt,ye,ot,kt,Fe]),xt=Object(ga.a)(d);Object(c.n)(()=>{xt&&d!==xt&&(Ke(),Rt())},[d,xt,Rt,Ke]);const Lt=((e,t,a,s,o,r)=>{Object(c.n)(()=>{a?(t(Es(a.content.text)),requestAnimationFrame(()=>{const e=document.getElementById(n.z);Object(ls.a)(e,!0)})):t("")},[a,t]);return Object(c.m)(()=>{const{text:t,entities:n}=Object(ds.a)(e.current);a&&(t||Object(l.fb)(a)?(r({messageId:a.id,text:t,entities:n}),s()):o())},[r,a,e,o,s])})(Se,je,i,Rt,He,V);((e,t,a,s,o,r,i,l,d)=>{const b=Object(c.m)((e,t)=>{o.current.length&&!i?l({chatId:e,threadId:t,draft:Object(ds.a)(o.current)}):d({chatId:e,threadId:t})},[d,i,o,l]),u=Object(c.p)(()=>Object(f.a)(e=>e(),n.y,!1),[t]),h=Object(ga.a)(t),O=Object(ga.a)(a);Object(c.n)(()=>(ws=t,Ms=a,()=>{ws=void 0,Ms=void 0,b(t,a)}),[t,a,b]),Object(c.n)(()=>{t===h&&a===O||e&&(r(Es(e)),m.n||requestAnimationFrame(()=>{const e=document.getElementById(n.z);Object(ls.a)(e,!0)}))},[t,a,e,r,b,h,O]);const j=Object(ga.a)(s);Object(c.n)(()=>{t&&a&&h===t&&O===a&&j!==s&&(s.length?u(()=>{ws===t&&Ms===a&&b(t,a)}):b(t,a))},[t,s,h,j,O,u,a,b]);const g=Object(c.m)(()=>{t&&a&&b(t,a)},[t,a,b]);Object(re.a)(g),ie(g)})(O,d,u,Oe,Se,je,i,W,K),((e,t,a)=>{Object(c.n)(()=>{async function s(s){if(!s.clipboardData)return;const c=document.activeElement;if(c&&![n.z,n.A].includes(c.id))return;const{items:o}=s.clipboardData,r=Array.from(o).find(e=>Cs.includes(e.type)),i=r&&r.getAsFile(),l=s.clipboardData.getData("text").substring(0,4096);if(i||l){if(s.preventDefault(),i&&!a){const e=await bs(i.name,i,!0);t(t=>[...t,e])}l&&e(l,c?c.id:void 0)}}return document.addEventListener("paste",s,!1),()=>{document.removeEventListener("paste",s,!1)}},[e,a,t])})(Pt,Ne,i);const Bt=Object(c.m)(async(e,t)=>{Ne(await Promise.all(e.map(e=>bs(e.name,e,t))))},[]),Ft=Object(c.m)(async(e,t)=>{Ne([...ke,...await Promise.all(e.map(e=>bs(e.name,e,t)))])},[ke]),Ut=Object(c.m)(()=>{Ne([])},[]),Ht=Object(c.m)(async(e=!1,t)=>{if("connectionStateReady"!==g)return;let a=ke;if(Ye){const e=await Ke();if(e){const{blob:t,duration:s,waveform:n}=e;a=[await bs("wonderful-voice-message.ogg",t,!1,{voice:{duration:s,waveform:n}})]}}const{text:s,entities:c}=Object(ds.a)(Se.current);if(!a.length&&!s&&!C)return;if(a.length&&s&&s.length>1024){const e=s.length-1024;return void Q({data:{message:"CAPTION_TOO_LONG_PLEASE_REMOVE_CHARACTERS",textParams:{"{EXTRA_CHARS_COUNT}":e,"{PLURAL_S}":e>1?"s":""},hasErrorKey:!0}})}const o=document.getElementById(n.z);if(a.length||s){if(Et&&!Ct){const e=Math.floor(Date.now()/1e3)+q,t=ge.current&&Math.floor(e-ge.current),a=Et.nextSendDate&&Et.nextSendDate>e;if(t&&t{Rt()})},[g,ke,Ye,C,q,K,d,Rt,Ke,Q,Et,Ct,$,X,be]),qt=Object(c.m)((e,a=!1)=>{e={...e,isPreloadedGlobally:!0},t?(Ee({sticker:e}),ve()):($({sticker:e}),requestAnimationFrame(()=>{Rt(a)}))},[t,ve,$,Rt]),Gt=Object(c.m)(e=>{t?(Ee({gif:e}),ve()):($({gif:e}),requestAnimationFrame(()=>{Rt(!0)}))},[t,ve,$,Rt]),_t=Object(c.m)(e=>{if("connectionStateReady"!==g)return;le({id:e.id,queryId:e.queryId});const t=document.getElementById(n.z);m.e&&t===document.activeElement&&hs(t),K({chatId:d,localOnly:!0}),requestAnimationFrame(()=>{Rt()})},[d,K,g,Rt,le]),zt=Object(c.m)(e=>{t?(Ee({poll:e}),ee(),ve()):($({poll:e}),ee())},[ee,ve,$,t]),$t=Object(c.m)(()=>{t?(Ee({isSilent:!0}),ve()):Ht(!0)},[Ht,ve,t]),Vt=Object(c.m)((e,t=!1)=>{const{isSilent:a,...s}=Ce||{},n=Math.round(Math.max(e.getTime(),Date.now()+6e4)/1e3)+(t?0:q);Ce&&0!==Object.keys(s).length?($({...Ce,scheduledAt:n}),requestAnimationFrame(()=>{Rt()})):Ht(!!a,n),ye()},[ye,Ht,Rt,Ce,$,q]),Wt=Object(c.m)(()=>{Vt(new Date(1e3*n.xb),!0)},[Vt]),Kt=Object(c.m)(()=>{ye(),Ee(void 0)},[ye]),Qt=Object(c.m)(e=>{"stickers"===e?(J({query:""}),Y({query:void 0})):(Y({query:""}),J({query:void 0}))},[J,Y]),Jt=Object(c.m)(()=>{const e=document.getElementById(n.z);m.l&&e===document.activeElement?(e.blur(),setTimeout(()=>{De()},100)):De()},[De]),Yt=Object(c.m)(()=>{se({id:d,threadId:u,type:"scheduled"})},[se,d,u]);Object(c.n)(()=>{v&&m.l&&Fe()},[v,Fe]),Object(c.n)(()=>{o&&(y?$e():setTimeout(()=>{Ve()},200))},[y,Ve,$e,o]);const Xt=Object(c.m)(()=>{switch(at){case cn.Send:t?(Ye&&Qe(),ve()):(Ht(),requestAnimationFrame(()=>{Rt()}));break;case cn.Record:We();break;case cn.Edit:Lt()}},[at,Rt,t,We,Lt,Ye,ve,Qe,Ht]),Zt=at===cn.Record&&!yt.canAttachMedia,ea=Object(ga.a)(i,!0),ta=i||ea,aa=new Date;aa.setSeconds(0),aa.setMilliseconds(0);const sa=new Date;sa.setFullYear(sa.getFullYear()+1);let na="SendMessage";switch(at){case cn.Edit:na="Save edited message";break;case cn.Record:na=Zt?"Conversation.DefaultRestrictedMedia":"AccDescrVoiceMessage"}const ca=Object(ne.a)("Composer",!y&&"shown",ze&&"hover-disabled"),oa=Object(ne.a)("mobile-symbol-menu-button",!o&&"not-ready",Ge?Be&&"menu-opened":Be&&"is-loading"),ra=at===cn.Edit?Lt:t?ve:Ht;return c.a.createElement("div",{className:ca},yt.canAttachMedia&&o&&c.a.createElement(an.a,{containerId:"#middle-column-portals"},c.a.createElement(Zs,{isOpen:e!==Je.a.None,withQuick:[e,pe].includes(Je.a.QuickFile),onHide:r,onFileSelect:Bt})),c.a.createElement(Ys,{attachments:ke,caption:ke.length?Oe:"",groupChatMembers:P,currentUserId:R,usersById:L,recentEmojis:G,isReady:o,onCaptionUpdate:je,baseEmojiKeywords:U,emojiKeywords:H,addRecentEmoji:oe,onSend:t?ve:Ht,onFileAppend:Ft,onClear:Ut}),c.a.createElement(Xs,{isOpen:Boolean(E),onClear:ee,onSend:zt}),c.a.createElement(nn,{isOpen:Boolean(w),onClose:ae}),c.a.createElement(on,{isOpen:Boolean(M),onClose:ce}),ta&&c.a.createElement(xs,{isOpen:Ue,isSchedule:"scheduled"===h,onClose:qe,message:ta}),c.a.createElement(Gs,{isOpen:nt,filter:ct,onClose:ot,onInsertUserName:rt,filteredUsers:it,usersById:L}),c.a.createElement(qs,{isOpen:lt,botId:dt,allowedAttachmentOptions:yt,isGallery:bt,inlineBotResults:ht,switchPm:ut,onSelectResult:_t,loadMore:gt,onClose:Ot}),c.a.createElement("div",{id:"message-compose"},c.a.createElement("div",{className:"svg-appendix",ref:ue}),c.a.createElement(Js,null),c.a.createElement(tn,{chatId:d,threadId:u,messageText:ke.length?"":Oe,disabled:!yt.canAttachEmbedLinks}),c.a.createElement("div",{className:"message-input-wrapper"},m.l?c.a.createElement(fe.a,{className:oa,round:!0,faded:!0,color:"translucent",onClick:Be?Fe:Jt,ariaLabel:"Choose emoji, sticker or GIF"},c.a.createElement("i",{className:"icon-smile"}),c.a.createElement("i",{className:"icon-keyboard"}),Be&&!Ge&&c.a.createElement(we.a,{color:"gray"})):c.a.createElement(Fs,{className:""+(Be?"activated":""),round:!0,faded:!0,color:"translucent",onActivate:De,ariaLabel:"Choose emoji, sticker or GIF"},c.a.createElement("i",{className:"icon-smile"})),c.a.createElement(Ks.a,{id:"message-input-text",html:ke.length?"":Oe,placeholder:Ye&&Me<=600?"":k||be("Message"),forcedPlaceholder:jt,shouldSetFocus:Be,shouldSuppressFocus:m.l&&Be,shouldSuppressTextFormatter:St||nt||lt,onUpdate:je,onSend:ra,onSuppressedFocus:Fe}),z&&Boolean(dt)&&c.a.createElement(we.a,{color:"gray"}),N&&c.a.createElement(fe.a,{round:!0,faded:!0,className:"scheduled-button",color:"translucent",onClick:Yt,ariaLabel:"Open scheduled messages"},c.a.createElement("i",{className:"icon-schedule"})),S&&!Ye&&!i&&c.a.createElement(Fs,{className:""+(Te?"activated":""),round:!0,faded:!0,color:"translucent",onActivate:Pe,ariaLabel:"Open bot command keyboard"},c.a.createElement("i",{className:"icon-bot-command"})),!Ye&&!i&&c.a.createElement(Fs,{className:""+(Re?"activated":""),round:!0,faded:!0,color:"translucent",onActivate:xe,ariaLabel:"Add an attachment"},c.a.createElement("i",{className:"icon-attach"})),Ye&&Xe&&c.a.createElement("span",{className:"recording-state"},Object(x.i)(Xe-tt.current)),c.a.createElement(zs,{isOpen:wt,onStickerSelect:qt}),c.a.createElement($s.a,{isOpen:St,emojis:Nt,onClose:kt,onEmojiSelect:Tt,addRecentEmoji:oe}),c.a.createElement(Us,{isOpen:Re,allowedAttachmentOptions:yt,onFileSelect:Bt,onPollCreate:Z,onClose:Le}),S&&c.a.createElement(Ws,{messageId:S,isOpen:Te,onClose:Ae}),c.a.createElement(Hs,{isOpen:Be,allowedAttachmentOptions:yt,onLoad:_e,onClose:Fe,onEmojiSelect:Pt,onStickerSelect:qt,onGifSelect:Gt,onRemoveSymbol:At,onSearchOpen:Qt,addRecentEmoji:oe}))),Ye&&c.a.createElement(fe.a,{round:!0,color:"danger",className:"cancel",onClick:Ke,ariaLabel:"Cancel voice recording"},c.a.createElement("i",{className:"icon-delete"})),c.a.createElement(fe.a,{ref:et,round:!0,color:"secondary",className:Object(ne.a)(at,!o&&"not-ready",Ye&&"recording"),disabled:Zt,ariaLabel:be(na),onClick:Xt,onContextMenu:at===cn.Send&&st?ft:void 0},c.a.createElement("i",{className:"icon-send"}),c.a.createElement("i",{className:"icon-microphone-alt"}),c.a.createElement("i",{className:"icon-check"})),st&&c.a.createElement(_s,{isOpen:pt,onSilentSend:I?void 0:$t,onScheduleSend:t?void 0:ve,onClose:It,onCloseAnimationEnd:vt}),c.a.createElement(sn,{isOpen:Ie,withTimePicker:!0,selectedAt:aa.getTime(),maxAt:Object(x.k)(sa),isFutureMode:!0,secondButtonLabel:a?"Send When Online":void 0,onClose:Kt,onSubmit:Vt,onSecondButtonClick:a?Wt:void 0}))}));var ln=Object(c.h)(e=>{const{isActive:t}=e,a=Object(Re.a)(Ae.a.Extra,"MobileSearch",!t,!0);return a?c.a.createElement(a,e):void 0});var dn=Object(c.h)(e=>{const{isActive:t}=e,a=Object(Re.a)(Ae.a.Extra,"MessageSelectToolbar",!t);return a?c.a.createElement(a,e):void 0});var bn=Object(c.h)(e=>{const{isOpen:t}=e,a=Object(Re.a)(Ae.a.Extra,"UnpinAllMessagesModal",!t);return a?c.a.createElement(a,e):void 0});a(257);const un=m.l?450+n.c:void 0;function mn(e){return"file"===e.kind&&e.type&&n.n.has(e.type)}var hn=Object(c.h)(Object(s.h)(e=>{const t=Object(r.Db)(e),{isBlurred:a,background:s,backgroundColor:n,patternColor:c}=e.settings.themes[t]||{},{messageLists:o}=e.messages,i=Object(r.z)(e),{isLeftColumnShown:d,chats:{listIds:u}}=e,h={theme:t,customBackground:s,backgroundColor:n,patternColor:c,isLeftColumnShown:d,isRightColumnShown:Object(r.W)(e),isBackgroundBlurred:a,isMobileSearchActive:Boolean(m.l&&Object(r.B)(e)),isSelectModeActive:Object(r.S)(e),animationLevel:e.settings.byKey.animationLevel,currentTransitionKey:Math.max(0,e.messages.messageLists.length-1)};if(!i||!u.active)return h;const{chatId:O,threadId:j,type:g}=i,p=Object(r.g)(e,O),f=Object(r.kb)(e,O),{chatId:I,messageId:v}=e.audioPlayer,y=p&&Object(l.d)(p,j),C=Object(r.L)(e,O),E="pinned"===g,w="scheduled"===g;return{...h,chatId:O,threadId:j,messageListType:g,isPrivate:Object(l.ob)(O),canPost:!E&&(!p||y)&&!C,isPinnedMessageList:E,isScheduledMessageList:w,currentUserBannedRights:p&&p.currentUserBannedRights,defaultBannedRights:p&&p.defaultBannedRights,hasPinnedOrAudioMessage:j!==b.MAIN_THREAD_ID||Boolean(f&&f.length)||Boolean(I&&v),pinnedMessagesCount:f?f.length:0,shouldSkipHistoryAnimations:e.shouldSkipHistoryAnimations,messageLists:o}},(e,t)=>Object(h.l)(t,["openChat","unpinAllMessages","loadUser","closeLocalTextSearch","exitMessageSelectMode"]))(({chatId:e,threadId:t,messageListType:a,isPrivate:s,isPinnedMessageList:o,messageLists:r,canPost:i,currentUserBannedRights:d,defaultBannedRights:b,hasPinnedOrAudioMessage:u,pinnedMessagesCount:h,customBackground:O,theme:j,backgroundColor:g,patternColor:p,isLeftColumnShown:f,isRightColumnShown:I,isBackgroundBlurred:v,isMobileSearchActive:y,isSelectModeActive:C,animationLevel:E,shouldSkipHistoryAnimations:w,currentTransitionKey:M,openChat:S,unpinAllMessages:k,loadUser:N,closeLocalTextSearch:T,exitMessageSelectMode:P})=>{const{width:A}=et(),R=Object(he.a)(),[x,L]=Object(c.r)(Je.a.None),[B,D]=Object(c.r)(),[F,U]=Object(c.r)(),[H,q]=Object(c.r)(!1),[G,_]=Object(c.r)(!m.l||E===n.f),z=u&&(An.lb&&A=n.kb&&Ae?Object(de.a)(()=>{S({id:void 0})}):void 0,[e,S]),Object(c.n)(()=>{L(Je.a.None),D(void 0),U(void 0)},[e]),Object(c.n)(()=>{E===n.f&&_(!0)},[E]);Object(c.n)(()=>{s&&N({userId:e})},[e,s,N]);const Y=Object(c.m)(e=>{if(m.n)return;const{items:t}=e.dataTransfer||{},a=t&&Array.from(t).filter(e=>"text/uri-list"!==e.type).every(mn);L(a?Je.a.QuickFile:Je.a.Document)},[]),X=Object(c.m)(()=>{L(Je.a.None)},[]),Z=Object(c.m)(()=>{q(!0)},[]),ee=Object(c.m)(()=>{q(!1)},[]),te=Object(c.m)(()=>{k({chatId:e}),ee(),S({id:e})},[k,S,ee,e]),ae=Object(c.m)(()=>{S({id:e})},[S,e]),se=((e,t)=>{const[a,s]=Object(c.r)(t);return Object(c.n)(()=>{t&&(t.startsWith("#")?s(t):Ye.c(n.o,e,Ye.a.Blob).then(e=>{const t=URL.createObjectURL(e);Object(Xe.g)(t).then(()=>{s(`url(${t})`)})}))},[t,e]),t?a:void 0})(j,O),ce=Object(ne.a)(Q&&"has-header-tools",O&&"custom-bg-image",g&&"custom-bg-color",O&&v&&"blurred",m.q?"mask-image-disabled":"mask-image-enabled"),oe=Object(ne.a)("messaging-disabled",!C&&"shown"),re=Object(l.L)(R,d,b),{composerHiddenScale:ie,toolbarHiddenScale:le,composerTranslateX:be,toolbarTranslateX:me,unpinHiddenScale:Oe,toolbarForUnpinHiddenScale:ge}=Object(c.p)(()=>at(A,K),[K,A]),pe=Object(ne.a)("middle-column-footer",!K&&"no-composer",K&&F&&!C&&"with-notch");return Object(je.a)($&&V,()=>{S({id:void 0},!0)},void 0,void 0,void 0,r?r.map(st):[]),Object(je.a)(y,T),Object(je.a)(C,P),c.a.createElement("div",{id:"MiddleColumn",className:ce,onTransitionEnd:t=>{"transform"===t.propertyName&&t.target===t.currentTarget&&_(Boolean(e))},style:`\n --composer-hidden-scale: ${ie};\n --toolbar-hidden-scale: ${le};\n --unpin-hidden-scale: ${Oe};\n --toolbar-unpin-hidden-scale: ${ge};\n --composer-translate-x: ${be}px;\n --toolbar-translate-x: ${me}px;\n --pattern-color: ${p};\n --theme-background-color:\n ${g||("dark"===j?n.p:n.R)};\n `,onClick:m.m&&f?ae:void 0},c.a.createElement("div",{id:"middle-column-bg",style:se?"--custom-background: "+se:void 0}),c.a.createElement("div",{id:"middle-column-portals"}),$&&V&&c.a.createElement(c.a.Fragment,null,c.a.createElement("div",{className:"messages-layout",onDragEnter:K?Y:void 0},c.a.createElement(wt,{chatId:$,threadId:V,messageListType:W,isReady:G}),c.a.createElement(ue.a,{name:w?"none":E===n.e?"slide":"fade",activeKey:M,shouldCleanup:!0},()=>c.a.createElement(c.a.Fragment,null,c.a.createElement(rs,{key:`${$}-${V}-${W}`,chatId:$,threadId:V,type:W,canPost:K,hasTools:Q,onFabToggle:D,onNotchToggle:U,isReady:G}),c.a.createElement("div",{className:pe},K&&c.a.createElement(rn,{chatId:$,threadId:V,messageListType:W,dropAreaState:x,onDropHide:X,isReady:G}),o&&c.a.createElement("div",{className:"unpin-button-container",dir:R.isRtl?"rtl":void 0},c.a.createElement(fe.a,{size:"tiny",fluid:!0,color:"secondary",className:"unpin-all-button",onClick:Z},c.a.createElement("i",{className:"icon-unpin"}),c.a.createElement("span",null,R("Chat.Pinned.UnpinAll",h,"i")))),!o&&!K&&re&&c.a.createElement("div",{className:oe},c.a.createElement("div",{className:"messaging-disabled-inner"},c.a.createElement("span",null,re))),c.a.createElement(dn,{messageListType:W,isActive:C,canPost:K})))),c.a.createElement(is,{isShown:J,canPost:K})),m.l&&c.a.createElement(ln,{isActive:Boolean(y)})),e&&c.a.createElement(bn,{isOpen:H,chatId:e,pinnedMessagesCount:h,onClose:ee,onUnpin:te}))}));a(258);const On=Object(f.a)(e=>e(),200,!1);var jn;!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.ManageGroupUserPermissionsCreate=12]="ManageGroupUserPermissionsCreate",e[e.ManageGroupUserPermissions=13]="ManageGroupUserPermissions",e[e.ManageGroupRecentActions=14]="ManageGroupRecentActions",e[e.ManageGroupAdminRights=15]="ManageGroupAdminRights",e[e.ManageGroupMembers=16]="ManageGroupMembers",e[e.StickerSearch=17]="StickerSearch",e[e.GifSearch=18]="GifSearch",e[e.PollResults=19]="PollResults",e[e.AddingMembers=20]="AddingMembers"}(jn||(jn={}));var gn=Object(c.h)(Object(s.h)((e,{chatId:t,isProfile:a,isManagement:s})=>{const{query:n}=Object(r.B)(e)||{},{query:c}=Object(r.A)(e)||{},{query:o}=Object(r.t)(e)||{},i=t?Object(r.g)(e,t):void 0,d=i&&Object(l.mb)(i);return{canManage:Boolean(!s&&a&&i&&!Object(r.P)(e,i.id)&&(Object(l.ob)(i.id)||(Object(l.jb)(i)||i.isCreator)&&!i.isNotJoined)),isChannel:d,messageSearchQuery:n,stickerSearchQuery:c,gifSearchQuery:o}},(e,t)=>Object(h.l)(t,["setLocalTextSearchQuery","setStickerSearchQuery","setGifSearchQuery","searchTextMessagesLocal","toggleManagement","openHistoryCalendar"]))(({isColumnOpen:e,isProfile:t,isSearch:a,isManagement:s,isStickerSearch:n,isGifSearch:o,isPollResults:r,isAddingChatMembers:i,profileState:l,managementScreen:d,canManage:b,isChannel:h,onClose:O,messageSearchQuery:j,stickerSearchQuery:g,gifSearchQuery:p,setLocalTextSearchQuery:f,setStickerSearchQuery:I,setGifSearchQuery:v,searchTextMessagesLocal:y,toggleManagement:C,openHistoryCalendar:E,shouldSkipAnimation:w})=>{var M;const S=Object(c.q)(null),k=Object(c.m)(e=>{f({query:e}),e.length&&On(y)},[y,f]),N=Object(c.m)(e=>{I({query:e})},[I]),T=Object(c.m)(e=>{v({query:e})},[v]),[P,A]=Object(c.r)(!e);Object(c.n)(()=>{setTimeout(()=>{A(!e)},300)},[e]);const R=Object(he.a)(),L=t?l===u.l.Profile?jn.Profile:l===u.l.SharedMedia?jn.SharedMedia:l===u.l.MemberList?jn.MemberList:-1:a?jn.Search:r?jn.PollResults:n?jn.StickerSearch:o?jn.GifSearch:i?jn.AddingMembers:s?d===u.g.Initial?jn.ManageInitial:d===u.g.ChatPrivacyType?jn.ManageChatPrivacyType:d===u.g.Discussion?jn.ManageDiscussion:d===u.g.ChannelSubscribers?jn.ManageChannelSubscribers:d===u.g.GroupPermissions?jn.ManageGroupPermissions:d===u.g.ChatAdministrators?jn.ManageChatAdministrators:d===u.g.GroupRemovedUsers?jn.ManageGroupRemovedUsers:d===u.g.GroupUserPermissionsCreate?jn.ManageGroupUserPermissionsCreate:d===u.g.GroupUserPermissions?jn.ManageGroupUserPermissions:d===u.g.GroupRecentActions?jn.ManageGroupRecentActions:d===u.g.ChatAdminRights?jn.ManageGroupAdminRights:d===u.g.GroupMembers?jn.ManageGroupMembers:void 0:void 0,B=null!==(M=Object(ot.a)(L,!0))&&void 0!==M?M:-1;function D(){if(-1!==B)switch(B){case jn.PollResults:return c.a.createElement("h3",null,R("PollResults"));case jn.Search:return c.a.createElement(c.a.Fragment,null,c.a.createElement(Ie.a,{parentContainerClassName:"RightSearch",value:j,onChange:k}),c.a.createElement(fe.a,{round:!0,size:"smaller",color:"translucent",onClick:()=>E({selectedAt:Object(x.k)(Date.now())}),ariaLabel:"Search messages by date"},c.a.createElement("i",{className:"icon-calendar"})));case jn.AddingMembers:return c.a.createElement("h3",null,R("GroupAddMembers"));case jn.ManageInitial:return c.a.createElement("h3",null,R("Edit"));case jn.ManageChatPrivacyType:return c.a.createElement("h3",null,R(h?"ChannelTypeHeader":"GroupTypeHeader"));case jn.ManageDiscussion:return c.a.createElement("h3",null,R("Discussion"));case jn.ManageChatAdministrators:return c.a.createElement("h3",null,R("ChannelAdministrators"));case jn.ManageGroupRecentActions:return c.a.createElement("h3",null,R("Group.Info.AdminLog"));case jn.ManageGroupAdminRights:return c.a.createElement("h3",null,R("EditAdminRights"));case jn.ManageGroupPermissions:return c.a.createElement("h3",null,R("ChannelPermissions"));case jn.ManageGroupRemovedUsers:return c.a.createElement("h3",null,R("ChannelBlockedUsers"));case jn.ManageGroupUserPermissionsCreate:return c.a.createElement("h3",null,R("ChannelAddException"));case jn.ManageGroupUserPermissions:return c.a.createElement("h3",null,R("UserRestrictions"));case jn.StickerSearch:return c.a.createElement(Ie.a,{value:g,placeholder:R("SearchStickersHint"),onChange:N});case jn.GifSearch:return c.a.createElement(Ie.a,{value:p,placeholder:R("SearchGifsTitle"),onChange:T});case jn.SharedMedia:return c.a.createElement("h3",null,R("SharedMedia"));case jn.ManageChannelSubscribers:return c.a.createElement("h3",null,R("ChannelSubscribers"));case jn.MemberList:case jn.ManageGroupMembers:return c.a.createElement("h3",null,R("GroupMembers"));default:return c.a.createElement(c.a.Fragment,null,c.a.createElement("h3",null,"Profile"),c.a.createElement("section",{className:"tools"},b&&c.a.createElement(fe.a,{round:!0,color:"translucent",size:"smaller",ariaLabel:R("Edit"),onClick:C},c.a.createElement("i",{className:"icon-edit"}))))}}const F=m.l||L===jn.SharedMedia||L===jn.MemberList||L===jn.AddingMembers||s,U=Object(ne.a)("animated-close-icon",(P||w)&&"no-transition");return Object(c.n)(()=>{S.current.classList.toggle("state-back",F)},[F]),c.a.createElement("div",{className:"RightHeader"},c.a.createElement(fe.a,{className:"close-button",round:!0,color:"translucent",size:"smaller",onClick:O,ariaLabel:R(F?"Common.Back":"Common.Close")},c.a.createElement("div",{ref:S,className:U})),c.a.createElement(ue.a,{name:P||w?"none":"slide-fade",activeKey:B},D))})),pn=a(133);function fn(e,t,a,s,o,r,i,d,b,u,m,h=0){const O="members"!==s&&o?o:s,j=Object(c.p)(()=>{if(r&&i)return Object(l.Kb)(r.map(({userId:e})=>e),i,void 0,h)},[r,h,i]),[g,p,f]=function(e,t,a,s){const[c,o]=Object(pn.a)(a?t:void 0,s,void 0,n.cb),r=!c||!s||c[0]===s[0];return[c,o,!r]}(0,t,m,j),[I,v,y]=In("media",O,a,m,d,b),[C,E,w]=In("documents",O,a,m,d,b),[M,S,k]=In("links",O,a,m,d,b),[N,T,P]=In("audio",O,a,m,d,b);let A,R,x=!1;switch(O){case"members":A=g,R=p,x=f;break;case"media":A=I,R=v,x=y;break;case"documents":A=C,R=E,x=w;break;case"links":A=M,R=S,x=k;break;case"audio":A=N,R=T,x=P}return[O,A,R,x]}function In(e,t,a,s,o,r){const i=Object(c.q)();Object(le.a)(()=>{t===e&&o&&r&&(i.current=Object(l.w)(o,r,e).reverse())},[o,r,t,e]);const[d,b]=Object(pn.a)(s?a:void 0,i.current,void 0,"media"===e?n.Ab:n.ib);return[d,b,!(!d||!i.current||d[0]===i.current[0])]}const vn=Object(f.h)(e=>e(),250,!1);let yn=!1;var Cn=a(115),En=a(108);var wn=a(138),Mn=a(201);a(259);var Sn=Object(c.h)(({chat:e,user:t,photo:a,isFirstPhoto:s,isSavedMessages:n,lastSyncTime:o,onClick:r})=>{const i=Object(he.a)(),d=t&&Object(l.sb)(t);function u(s="big",c){if(a&&!c)return`photo${a.id}?size=c`;let o;return n||d||(t?o=Object(l.e)(t,s):e&&(o=Object(l.e)(e,s))),o}const m=u(),h=Object(ht.a)(m,!1,b.ApiMediaFormat.BlobUrl,o),O=Object(ht.a)(!h&&s?u("normal",!0):void 0,!1,b.ApiMediaFormat.BlobUrl,o),j=Object(Mn.a)(!h&&a&&a.thumbnail&&a.thumbnail.dataUri),g=h||O||j,p=Object(ga.a)(g);let f="";if(n)f=c.a.createElement("i",{className:"icon-avatar-saved-messages"});else if(d)f=c.a.createElement("i",{className:"icon-avatar-deleted-account"});else if(g)f=c.a.createElement("img",{src:g,className:"avatar-media",alt:"",decoding:"async"});else if(!g&&t){const e=Object(l.bb)(t);f=e?Object(rt.c)(e,2):void 0}else if(!g&&e){const t=Object(l.k)(i,e);f=t&&Object(rt.c)(t,Object(l.ob)(e.id)?2:1)}else f=c.a.createElement("div",{className:"spinner-wrapper"},c.a.createElement(we.a,{color:"white"}));const I=Object(ne.a)("ProfilePhoto","color-bg-"+Object(l.Z)(t||e),n&&"saved-messages",d&&"deleted-account",!n&&!g&&"no-photo");return c.a.createElement("div",{className:I,onClick:g?r:void 0},p&&g&&p!==g&&c.a.createElement("img",{src:p,className:"prev-avatar-media",alt:"",decoding:"async"}),"string"==typeof f?Object(mt.a)(f,["hq_emoji"]):f)});a(260);var kn=Object(c.h)(Object(s.h)((e,{userId:t,forceShowSelf:a})=>{const{lastSyncTime:s,serverTimeOffset:n}=e,c=Object(r.Jb)(e,t),o=Object(r.g)(e,t),i=!a&&c&&c.isSelf,{animationLevel:l}=e.settings.byKey;return{lastSyncTime:s,user:c,chat:o,isSavedMessages:i,animationLevel:l,serverTimeOffset:n}},(e,t)=>Object(h.l)(t,["loadFullUser","openMediaViewer"]))(({user:e,chat:t,isSavedMessages:a,lastSyncTime:s,animationLevel:n,loadFullUser:o,openMediaViewer:r,serverTimeOffset:i})=>{const{id:d}=e||{},{id:h}=t||{},O=e?Object(l.bb)(e):t?t.title:"",j=(e?e.photos:t?t.photos:void 0)||[],g=n>=1?"slide":"none",[p,f]=Object(c.r)(0),I=a||j.length<=1||0===p,v=a||j.length<=1||p===j.length-1;Object(c.n)(()=>{p>j.length&&f(Math.max(0,j.length-1))},[p,j.length]);const y=Object(he.a)();Object(c.n)(()=>{s&&d&&o({userId:d})},[d,o,s]),function(e,t,a){Object(c.n)(()=>{t.slice(a,a+4).forEach(e=>{yt.c(`photo${e.id}?size=c`)||yt.b(`photo${e.id}?size=c`,b.ApiMediaFormat.BlobUrl)})},[a,t])}(0,j,p);const C=Object(c.m)(()=>{r({avatarOwnerId:d||h,profilePhotoIndex:p,origin:u.h.ProfileAvatar})},[r,d,h,p]),E=Object(c.m)(()=>{I||f(p-1)},[p,I]),w=Object(c.m)(()=>{v||f(p+1)},[p,v]);if(Object(c.n)(()=>{const e=document.querySelector(".photo-wrapper");if(e)return Object(Se.b)(e,{onSwipe:m.n?(e,t)=>{t===Se.a.Right?E():t===Se.a.Left&&w()}:void 0})},[w,E]),!e&&!t)return;function M(){const s=!a&&j&&j.length>0?j[p]:void 0;return c.a.createElement(Sn,{key:p,user:e,chat:t,photo:s,isSavedMessages:a,isFirstPhoto:I,onClick:C})}const S=e&&e.isVerified||t&&t.isVerified;return c.a.createElement("div",{className:"ProfileInfo",dir:y.isRtl?"rtl":void 0},c.a.createElement("div",{className:"photo-wrapper"},function(){if(!(a||!j||j.length<=1))return c.a.createElement("div",{className:"photo-dashes"},j.map((e,t)=>c.a.createElement("span",{className:"photo-dash "+(t===p?"current":"")})))}(),c.a.createElement(ue.a,{activeKey:p,name:g,className:"profile-slide-container"},M),!I&&c.a.createElement("button",{type:"button",className:"navigation prev","aria-label":y("AccDescrPrevious"),onClick:E}),!v&&c.a.createElement("button",{type:"button",className:"navigation next","aria-label":y("Next"),onClick:w})),c.a.createElement("div",{className:"info",dir:y.isRtl?"rtl":"auto"},a?c.a.createElement("div",{className:"title"},c.a.createElement("h3",{dir:"auto"},y("SavedMessages"))):c.a.createElement("div",{className:"title"},c.a.createElement("h3",{dir:"auto"},O&&Object(mt.a)(O)),S&&c.a.createElement(wn.a,null)),!a&&(e?c.a.createElement("div",{className:"status "+(Object(l.Cb)(e)?"online":"")},c.a.createElement("span",{className:"user-status",dir:"auto"},Object(l.cb)(y,e,i))):c.a.createElement("span",{className:"status",dir:"auto"},Object(l.mb)(t)?y("Subscribers",t.membersCount,"i"):y("Members",t.membersCount,"i")))))})),Nn=a(172);var Tn=Object(c.h)(Object(s.h)((e,{chatOrUserId:t})=>{const{lastSyncTime:a}=e,s=t?Object(r.g)(e,t):void 0,n=Object(l.ob)(t)?Object(r.Jb)(e,t):void 0,c=s&&Object(l.Hb)(s,Object(r.fb)(e),Object(r.eb)(e));return{lastSyncTime:a,chat:s,user:n,canInviteUsers:s&&!n&&(!Object(l.mb)(s)&&!Object(l.Db)(s,"inviteUsers")||Object(l.p)(s,"inviteUsers")),isMuted:c}},(e,t)=>Object(h.l)(t,["loadFullUser","updateChatMutedState","showNotification"]))(({lastSyncTime:e,user:t,chat:a,forceShowSelf:s,canInviteUsers:n,isMuted:o,loadFullUser:r,showNotification:i,updateChatMutedState:d})=>{const{id:b,fullInfo:u,username:m,phoneNumber:h,isSelf:O}=t||{},{id:j}=a||{},g=Object(he.a)();Object(c.n)(()=>{e&&b&&r({userId:b})},[r,b,e]);const p=Object(c.m)(()=>{d({chatId:j,isMuted:!o})},[j,o,d]);if(!a||a.isRestricted||O&&!s)return;function f(e,t){Object(Nn.c)(e),i({message:t+" was copied"})}const I=h&&Object(Na.c)(h),v=Object(l.g)(a),y=u&&u.bio||Object(l.f)(a);return c.a.createElement("div",{className:"ChatExtra"},I&&!!I.length&&c.a.createElement(En.a,{icon:"phone",multiline:!0,narrow:!0,ripple:!0,onClick:()=>f(I,g("Phone"))},c.a.createElement("span",{className:"title",dir:"auto"},I),c.a.createElement("span",{className:"subtitle"},g("Phone"))),m&&c.a.createElement(En.a,{icon:"mention",multiline:!0,narrow:!0,ripple:!0,onClick:()=>f("@"+m,g("Username"))},c.a.createElement("span",{className:"title",dir:"auto"},Object(mt.a)(m)),c.a.createElement("span",{className:"subtitle"},g("Username"))),y&&!!y.length&&c.a.createElement(En.a,{icon:"info",multiline:!0,narrow:!0,isStatic:!0},c.a.createElement("span",{className:"title",dir:"auto"},Object(mt.a)(y,["br","links","emoji"])),c.a.createElement("span",{className:"subtitle"},g(b?"UserBio":"Info"))),(n||!m)&&v&&c.a.createElement(En.a,{icon:"mention",multiline:!0,narrow:!0,ripple:!0,onClick:()=>f(v,g("SetUrlPlaceholder"))},c.a.createElement("div",{className:"title"},v),c.a.createElement("span",{className:"subtitle"},g("SetUrlPlaceholder"))),c.a.createElement(En.a,{icon:"unmute",ripple:!0,onClick:p},c.a.createElement("span",null,g("Notifications")),c.a.createElement(ye,{id:"group-notifications",label:b?"Toggle User Notifications":"Toggle Chat Notifications",checked:!o,inactive:!0})))})),Pn=a(173),An=a(195),Rn=a(121),xn=a(116),Ln=a(112);var Bn=Object(c.h)(Object(s.h)((e,{userId:t})=>{const a=Object(r.s)(e),s=t&&Object(r.Jb)(e,t);return{chat:a,contactName:s?Object(l.ab)(s):void 0}},(e,t)=>Object(h.l)(t,["deleteChatMember"]))(({isOpen:e,chat:t,userId:a,contactName:s,onClose:n,deleteChatMember:o})=>{const r=Object(he.a)(),i=Object(c.m)(()=>{o({chatId:t.id,userId:a}),n()},[t,o,n,a]);if(t&&a)return c.a.createElement(Ln.a,{isOpen:e,onClose:n,onEnter:i,className:"delete",title:r("GroupRemoved.Remove")},c.a.createElement("p",null,Object(mt.a)(r("PeerInfo.Confirm.RemovePeer",s))),c.a.createElement(fe.a,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:i},r("lng_box_remove")),c.a.createElement(fe.a,{className:"confirm-dialog-button",isText:!0,onClick:n},r("Cancel")))}));a(265);const Dn=[{type:"media",title:"SharedMediaTab2"},{type:"documents",title:"SharedFilesTab2"},{type:"links",title:"SharedLinksTab2"},{type:"audio",title:"SharedMusicTab2"}];function Fn(e){return[`.shared-media-transition > div:only-child > .${e}-list > .scroll-item`,`.shared-media-transition > div.active > .${e}-list > .scroll-item`].join(", ")}var Un=Object(c.h)(Object(s.h)((e,{chatId:t,userId:a})=>{const s=Object(r.g)(e,t),n=Object(r.n)(e,a||t),{currentType:c,resultsByType:o}=Object(r.w)(e)||{},{foundIds:i}=o&&c&&o[c]||{},{byId:d}=e.users,b=s&&Object(l.nb)(s),u=s&&Object(l.mb)(s),m=b||u&&Object(l.jb)(s),h=s&&s.fullInfo&&s.fullInfo.members,O=m&&s&&s.fullInfo&&!s.fullInfo.canViewMembers,j=m&&s&&(Object(l.p)(s,"inviteUsers")||s.isCreator),g=m&&s&&(Object(l.p)(s,"banUsers")||s.isCreator);let p;return a?p=a:Object(l.ob)(t)&&(p=t),{theme:Object(r.Db)(e),isChannel:u,resolvedUserId:p,chatMessages:n,foundIds:i,mediaSearchType:c,hasMembersTab:m,areMembersHidden:O,canAddMembers:j,canDeleteMembers:g,currentUserId:e.currentUserId,isRightColumnShown:Object(r.W)(e),isRestricted:s&&s.isRestricted,lastSyncTime:e.lastSyncTime,serverTimeOffset:e.serverTimeOffset,...m&&h&&{members:h,usersById:d}}},(e,t)=>Object(h.l)(t,["setLocalMediaSearchType","loadMoreMembers","searchMediaMessagesLocal","openMediaViewer","openAudioPlayer","openUserInfo","focusMessage","loadProfilePhotos","setNewChatMembersDialogState"]))(({chatId:e,profileState:t,onProfileStateChange:a,theme:s,isChannel:o,resolvedUserId:r,currentUserId:i,chatMessages:l,foundIds:d,mediaSearchType:h,hasMembersTab:O,areMembersHidden:j,canAddMembers:g,canDeleteMembers:p,members:f,usersById:I,isRightColumnShown:v,isRestricted:y,lastSyncTime:C,setLocalMediaSearchType:E,loadMoreMembers:w,searchMediaMessagesLocal:M,openMediaViewer:S,openAudioPlayer:k,openUserInfo:N,focusMessage:T,loadProfilePhotos:P,setNewChatMembersDialogState:A,serverTimeOffset:R})=>{const x=Object(c.q)(null),L=Object(c.q)(null),B=Object(he.a)(),[D,F]=Object(c.r)(0),[U,H]=Object(c.r)(),q=Object(c.p)(()=>[...O?[{type:"members",title:o?"ChannelSubscribers":"GroupMembers"}]:[],...Dn],[O,o]),G=q[D].type,[_,z,$,V]=fn(0,w,M,G,h,f,I,l,d,0,C,R),W=q.findIndex(({type:e})=>e===_),{handleScroll:K}=function(e,t,a,s){Object(St.a)(([a])=>{if(a&&a!==t){const a=e.current,n=a.querySelector(".TabList");a.scrollTop{yn=!1},350))}},[t,s]),Object(St.a)(([t])=>{if(a!==u.l.Profile||a===t)return;const n=e.current;if(!n)return;const c=n.querySelector(".TabList");!c||c.offsetTop>n.scrollTop||(yn=!0,Object(Rt.a)(n,n.firstElementChild,"start",void 0,2*n.offsetHeight),setTimeout(()=>{yn=!1},350),s(a))},[a]);const n=Object(c.m)(()=>{const a=e.current;if(!a)return;const n=a.querySelector(".TabList");if(!n)return;let c=u.l.Profile;a.scrollTop>=n.offsetTop&&(c="members"===t?u.l.MemberList:u.l.SharedMedia),s(c)},[e,s,t]);return Object(c.n)(()=>{yn||n()},[n,t]),{handleScroll:Object(c.m)(()=>{yn||vn(n)},[n])}}(x,G,t,a),{applyTransitionFix:Q,releaseTransitionFix:J}=function(e,t=".Transition.shared-media-transition"){return Object(c.n)(()=>{function a(){const a=e.current,s=a.querySelector(t),n=a.querySelector(".TabList");s&&n&&(s.style.minHeight=a.offsetHeight-n.offsetHeight+"px")}return a(),window.addEventListener("resize",a,!1),()=>{window.removeEventListener("resize",a,!1)}},[e,t]),{applyTransitionFix:Object(c.m)(()=>{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]),releaseTransitionFix:Object(c.m)(()=>{const t=e.current;t.style.overflowY="scroll",t.style.marginRight="0"},[e])}}(x),[Y,X]=(()=>{const[e,t]=Object(c.r)(!1);return[e,Object(c.m)(()=>{t(e=>!e)},[])]})(),Z=Object(c.m)(()=>{J(),X()},[J,X]),ee=Object(c.m)(()=>{A(u.i.InProgress)},[A]);Object(c.n)(()=>{E({mediaType:G})},[E,G]);const te=r||e;Object(c.n)(()=>{C&&P({profileId:te})},[P,te,C]);const ae=Object(c.m)(e=>{S({chatId:te,threadId:b.MAIN_THREAD_ID,messageId:e,origin:u.h.SharedMedia})},[te,S]),se=Object(c.m)(e=>{k({chatId:te,messageId:e})},[te,k]),ne=Object(c.m)(e=>{N({id:e})},[N]),ce=Object(c.m)(e=>{T({chatId:te,messageId:e})},[te,T]),oe=Object(c.m)(()=>{H(void 0)},[]);let re;Object(c.n)(()=>{if(L.current&&m.n)return Object(Se.b)(L.current,{onSwipe:(e,t)=>{t===Se.a.Left?F(Math.min(D+1,q.length-1)):t===Se.a.Right&&F(Math.max(0,D-1))}})},[D,q.length]);const ie="members"===_||!O&&"media"===_;ie?re=v?0:1e3:z||(re=n.Bb);const le=Object(Qs.a)([e,_],re);function de(e){return e!==i&&p?[{title:B("lng_context_remove_from_group"),icon:"stop",handler:()=>{H(e)}}]:void 0}function be(){if(!z||!le||!l){const e=ie&&z&&!le;return c.a.createElement("div",{className:"content empty-list"},!e&&c.a.createElement(we.a,null))}if(!z.length){let e;switch(_){case"members":e=j?"You have no access to group members list.":"No members found";break;case"documents":e=B("lng_media_file_empty_search");break;case"links":e=B("lng_media_link_empty_search");break;case"audio":e=B("lng_media_song_empty_search");break;default:e=B("SharedMedia.EmptyTitle")}return c.a.createElement("div",{className:"content empty-list"},c.a.createElement(Rn.a,{text:e}))}return c.a.createElement("div",{className:`content ${_}-list`,dir:B.isRtl&&"media"===_?"rtl":void 0,teactFastList:!0},"media"===_?z.map(e=>l[e]&&c.a.createElement(Pn.a,{key:e,message:l[e],onClick:ae})):"documents"===_?z.map(e=>l[e]&&c.a.createElement(ca.a,{key:e,message:l[e],withDate:!0,smaller:!0,className:"scroll-item",onDateClick:ce})):"links"===_?z.map(e=>l[e]&&c.a.createElement(An.a,{key:e,message:l[e],onMessageClick:ce})):"audio"===_?z.map(e=>l[e]&&c.a.createElement(oa.a,{key:e,theme:s,message:l[e],target:"sharedMedia",date:l[e].date,lastSyncTime:C,className:"scroll-item",onPlay:se,onDateClick:ce})):"members"===_?z.map((e,t)=>c.a.createElement(En.a,{key:e,teactOrderKey:t,className:"chat-item-clickable scroll-item",onClick:()=>ne(e),contextActions:de(e)},c.a.createElement(it.a,{userId:e,forceShowSelf:!0}))):void 0)}return c.a.createElement(Cn.a,{ref:x,className:"Profile custom-scroll",itemSelector:Fn(_),items:le?z:void 0,cacheBuster:Y,sensitiveArea:n.qb,preloadBackwards:le?"members"===_?n.cb:n.Ab:0,noScrollRestoreOnTop:!0,noFastList:!0,onLoadMore:$,onScroll:K},!V&&function(e,t){return c.a.createElement("div",{className:"profile-info"},c.a.createElement(kn,{userId:t||e,forceShowSelf:t!==e}),c.a.createElement(Tn,{chatOrUserId:t||e,forceShowSelf:t!==e}))}(e,r),!y&&c.a.createElement("div",{className:"shared-media"},c.a.createElement(ue.a,{ref:L,name:B.isRtl?"slide-reversed":"slide",activeKey:W,renderCount:q.length,shouldRestoreHeight:!0,className:"shared-media-transition",onStart:Q,onStop:Z},be),c.a.createElement(Ne.a,{big:!0,activeTab:D,tabs:q,onSwitchTab:F})),g&&c.a.createElement(xn.a,{isShown:"members"===_,onClick:ee,ariaLabel:B("lng_channel_add_users")},c.a.createElement("i",{className:"icon-add-user-filled"})),p&&c.a.createElement(Bn,{isOpen:Boolean(U),userId:U,onClose:oe}))}));var Hn=Object(c.h)(e=>{const t=Object(Re.a)(Ae.a.Extra,"RightSearch");return t?c.a.createElement(t,e):c.a.createElement(xe.a,null)});var qn=Object(c.h)(e=>{const t=Object(Re.a)(Ae.a.Extra,"Management");return t?c.a.createElement(t,e):c.a.createElement(xe.a,null)});var Gn=Object(c.h)(()=>{const e=Object(Re.a)(Ae.a.Extra,"StickerSearch");return e?c.a.createElement(e,null):c.a.createElement(xe.a,null)});var _n=Object(c.h)(()=>{const e=Object(Re.a)(Ae.a.Extra,"GifSearch");return e?c.a.createElement(e,null):c.a.createElement(xe.a,null)});var zn=Object(c.h)(()=>{const e=Object(Re.a)(Ae.a.Extra,"PollResults");return e?c.a.createElement(e,null):c.a.createElement(xe.a,null)}),$n=a(174);a(266);var Vn=Object(c.h)(Object(s.h)((e,{chatId:t})=>{const a=Object(r.g)(e,t),{userIds:s}=e.contactList||{},{byId:n}=e.users,{byId:c}=e.chats,{currentUserId:o,newChatMembersProgress:i,connectionState:d}=e,b=a&&Object(l.mb)(a),{query:m,fetchingStatus:h,globalUserIds:O,localUserIds:j}=e.userSearch;return{isChannel:b,members:a&&a.fullInfo?a.fullInfo.members:void 0,currentUserId:o,usersById:n,chatsById:c,localContactIds:s,searchQuery:m,isSearching:h,isLoading:i===u.i.Loading,globalUserIds:O,localUserIds:j,connectionState:d}},(e,t)=>Object(h.l)(t,["loadContactList","setUserSearchQuery"]))(({isChannel:e,connectionState:t,members:a,onNextStep:s,currentUserId:n,usersById:o,chatsById:r,localContactIds:i,isLoading:d,searchQuery:b,isSearching:u,localUserIds:m,globalUserIds:O,setUserSearchQuery:j,onClose:g,isActive:p,loadContactList:f})=>{const I=Object(he.a)(),[v,y]=Object(c.r)([]),C=Object(ga.a)(v)===v;Object(c.n)(()=>{p&&"connectionStateReady"===t&&f()},[t,p,f]),Object(je.a)(p,g);const E=Object(c.p)(()=>a?a.map(e=>e.userId):[],[a]),w=Object(c.m)(e=>{j({query:e})},[j]),M=Object(c.p)(()=>{const t=i?Object(l.Jb)(i.filter(e=>e!==n),r):[];if(!b)return t.filter(e=>!E.includes(e));const a=t.filter(e=>{const t=o[e];if(!t)return!1;const a=Object(l.bb)(t);return a&&Object(P.a)(a,b)});return Object(l.Jb)(Object(h.o)([...a,...m||[],...O||[]]).filter(t=>{const a=o[t];return!E.includes(t)&&(!a||!Object(l.Bb)(a)||!e&&a.canBeInvitedToGroup)}),r)},[i,r,b,m,O,n,o,E,e]),S=Object(c.m)(()=>{v.length&&(j({query:""}),s(v))},[v,j,s]);return c.a.createElement("div",{className:"AddChatMembers"},c.a.createElement("div",{className:"AddChatMembers-inner"},c.a.createElement($n.a,{itemIds:M,selectedIds:v,filterValue:b,filterPlaceholder:I("lng_channel_add_users"),searchInputId:"new-members-picker-search",isLoading:u,onSelectedIdsChange:y,onFilterChange:w,noScrollRestore:C}),c.a.createElement(xn.a,{isShown:Boolean(v.length),disabled:d,ariaLabel:I("lng_channel_add_users"),onClick:S},d?c.a.createElement(we.a,{color:"white"}):c.a.createElement("i",{className:"icon-arrow-right"}))))}));a(267);const Wn=Object.keys(u.m).length/2,Kn=Object.keys(u.g).length/2;function Qn(){const e=document.querySelector(".RightHeader .SearchInput input");e&&e.blur()}var Jn=Object(c.h)(Object(s.h)(e=>{const{chatId:t,threadId:a}=Object(r.z)(e)||{},s=Object(r.d)(e);return{contentKey:Object(r.pb)(e),chatId:t,threadId:a,currentProfileUserId:e.users.selectedId,isChatSelected:Boolean(t&&s),shouldSkipHistoryAnimations:e.shouldSkipHistoryAnimations}},(e,t)=>Object(h.l)(t,["openUserInfo","toggleChatInfo","toggleManagement","closeLocalTextSearch","setStickerSearchQuery","setGifSearchQuery","closePollResults","addChatMembers","setNewChatMembersDialogState"]))(({contentKey:e,chatId:t,threadId:a,currentProfileUserId:s,isChatSelected:o,toggleChatInfo:r,toggleManagement:i,openUserInfo:l,closeLocalTextSearch:d,setStickerSearchQuery:b,setGifSearchQuery:m,closePollResults:h,addChatMembers:O,setNewChatMembersDialogState:j,shouldSkipHistoryAnimations:g})=>{var p;const{width:f}=et(),[I,v]=Object(c.r)(u.l.Profile),[y,C]=Object(c.r)(u.g.Initial),[E,w]=Object(c.r)(),[M,S]=Object(c.r)(),k=I!==u.l.Profile,N=void 0!==e,T=e===u.m.ChatInfo||e===u.m.UserInfo,P=e===u.m.Search,A=e===u.m.Management,R=e===u.m.StickerSearch,x=e===u.m.GifSearch,L=e===u.m.PollResults,B=e===u.m.AddingMembers,D=f<=n.lb,[F,U]=Object(c.r)(!N),H=null!==(p=Object(ot.a)(e,!0,!o))&&void 0!==p?p:-1,q=Object(c.m)((t=!0)=>{switch(e){case u.m.AddingMembers:j(u.i.Closed);break;case u.m.ChatInfo:if(k&&t){v(u.l.Profile);break}r(void 0,!0);break;case u.m.UserInfo:if(k&&t){v(u.l.Profile);break}l({id:void 0},!0);break;case u.m.Management:switch(y){case u.g.Initial:i();break;case u.g.ChatPrivacyType:case u.g.Discussion:case u.g.GroupPermissions:case u.g.GroupType:case u.g.ChatAdministrators:case u.g.ChannelSubscribers:case u.g.GroupMembers:C(u.g.Initial);break;case u.g.GroupUserPermissionsCreate:case u.g.GroupRemovedUsers:case u.g.GroupUserPermissions:C(u.g.GroupPermissions),w(void 0),S(void 0);break;case u.g.ChatAdminRights:case u.g.GroupRecentActions:C(u.g.ChatAdministrators)}break;case u.m.Search:Qn(),d();break;case u.m.StickerSearch:Qn(),b({query:void 0});break;case u.m.GifSearch:Qn(),m({query:void 0});break;case u.m.PollResults:h()}},[e,k,r,l,h,j,y,i,d,b,m]),G=Object(c.m)((e,t)=>{w(e),S(t)},[]),_=Object(c.m)(e=>{O({chatId:t,memberIds:e})},[O,t]);function z(e){if(-1!==H)switch(H){case u.m.AddingMembers:return c.a.createElement(Vn,{chatId:t,onNextStep:_,isActive:N&&e,onClose:q});case u.m.ChatInfo:case u.m.UserInfo:return c.a.createElement(Un,{key:s||t,chatId:t,userId:s,profileState:I,onProfileStateChange:v});case u.m.Search:return c.a.createElement(Hn,{chatId:t,threadId:a,onClose:q,isActive:N&&e});case u.m.Management:return c.a.createElement(qn,{chatId:t,currentScreen:y,isPromotedByCurrentUser:M,selectedChatMemberId:E,onScreenSelect:C,onChatMemberSelect:G,isActive:N&&e,onClose:q});case u.m.StickerSearch:return c.a.createElement(Gn,{onClose:q,isActive:N&&e});case u.m.GifSearch:return c.a.createElement(_n,{onClose:q,isActive:N&&e});case u.m.PollResults:return c.a.createElement(zn,{onClose:q,isActive:N&&e})}}return Object(c.n)(()=>N?Object(de.a)(q):void 0,[N,q]),Object(c.n)(()=>{setTimeout(()=>{U(!N)},300)},[N]),Object(c.n)(()=>{N&&D&&q()},[D]),Object(Mt.a)(([a,s])=>{(a===u.m.ChatInfo&&e===u.m.UserInfo||a===u.m.UserInfo&&e===u.m.ChatInfo||s!==t)&&(v(u.l.Profile),C(u.g.Initial))},[e,t]),Object(je.a)(o&&(e===u.m.ChatInfo||e===u.m.UserInfo||e===u.m.Management||e===u.m.AddingMembers),()=>q(!1),r),c.a.createElement("div",{id:"RightColumn-wrapper",className:o?void 0:"is-hidden"},D&&c.a.createElement("div",{className:"overlay-backdrop",onClick:q}),c.a.createElement("div",{id:"RightColumn"},c.a.createElement(gn,{chatId:t,isColumnOpen:N,isProfile:T,isSearch:P,isManagement:A,isStickerSearch:R,isGifSearch:x,isPollResults:L,isAddingChatMembers:B,profileState:I,managementScreen:y,onClose:q,shouldSkipAnimation:F||g}),c.a.createElement(ue.a,{name:F||g?"none":"zoom-fade",renderCount:Wn+Kn,activeKey:A?Wn+y:H,shouldCleanup:!0,cleanupExceptionKey:u.m.ChatInfo},z)))}));var Yn=Object(c.h)(({isOpen:e})=>{const t=Object(Re.a)(Ae.a.Extra,"MediaViewer",!e);return t?c.a.createElement(t,null):void 0});var Xn=Object(c.h)(({isOpen:e})=>{const t=Object(Re.a)(Ae.a.Extra,"Notifications",!e);return t?c.a.createElement(t,null):void 0});var Zn=Object(c.h)(({isOpen:e})=>{const t=Object(Re.a)(Ae.a.Extra,"Dialogs",!e);return t?c.a.createElement(t,null):void 0});var ec=Object(c.h)(e=>{const{isOpen:t}=e,a=Object(Re.a)(Ae.a.Extra,"ForwardPicker",!t);return a?c.a.createElement(a,e):void 0});var tc=Object(c.h)(e=>{const{url:t}=e,a=Object(Re.a)(Ae.a.Extra,"SafeLinkModal",!t);return a?c.a.createElement(a,e):void 0});var ac=Object(c.h)(e=>{const{isOpen:t}=e,a=Object(Re.a)(Ae.a.Extra,"HistoryCalendar",!t);return a?c.a.createElement(a,e):void 0});a(268);let sc,nc=!1;function cc(e){document.querySelectorAll('link[rel="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 oc(e){document.title!==e&&(document.title=e)}var rc=Object(c.h)(Object(s.h)(e=>{const{chatId:t,messageId:a}=e.audioPlayer,s=t&&a?Object(r.l)(e,t,a):void 0;return{animationLevel:e.settings.byKey.animationLevel,lastSyncTime:e.lastSyncTime,isLeftColumnShown:e.isLeftColumnShown,isRightColumnShown:Object(r.W)(e),isMediaViewerOpen:Object(r.T)(e),isForwardModalOpen:Object(r.R)(e),hasNotifications:Boolean(e.notifications.length),hasDialogs:Boolean(e.dialogs.length),audioMessage:s,safeLinkModalUrl:e.safeLinkModalUrl,isHistoryCalendarOpen:Boolean(e.historyCalendarSelectedAt),shouldSkipHistoryAnimations:e.shouldSkipHistoryAnimations,language:e.settings.byKey.language}},(e,t)=>Object(h.l)(t,["loadAnimatedEmojis","loadNotificationSettings","loadNotificationExceptions","updateIsOnline","loadTopInlineBots","loadEmojiKeywords"]))(({lastSyncTime:e,isLeftColumnShown:t,isRightColumnShown:a,isMediaViewerOpen:o,isForwardModalOpen:i,animationLevel:l,hasNotifications:d,hasDialogs:b,audioMessage:u,safeLinkModalUrl:m,isHistoryCalendarOpen:h,shouldSkipHistoryAnimations:O,language:j,loadAnimatedEmojis:g,loadNotificationSettings:p,loadNotificationExceptions:I,updateIsOnline:v,loadTopInlineBots:y,loadEmojiKeywords:C})=>{n.r&&!nc&&(nc=!0,console.log(">>> RENDER MAIN")),Object(c.n)(()=>{e&&(v(!0),g(),p(),I(),y(),C({language:n.j}),j!==n.j&&C({language:j}))},[e,g,I,p,v,y,C,j]);const{transitionClassNames:E}=Object(oe.a)(!t,void 0,!0,void 0,O),{transitionClassNames:w}=Object(oe.a)(a,void 0,!0,void 0,O),M=Object(ne.a)(E.replace(/([\w-]+)/g,"middle-column-$1"),w.replace(/([\w-]+)/g,"right-column-$1"),O&&"history-animation-disabled");Object(le.a)(([e])=>{if(void 0===e||0===l)return;const t=Object(se.d)();Object(ce.b)(document.getElementById("MiddleColumn"),t)},[t]),Object(le.a)(([e])=>{if(void 0===e||0===l)return;Object(f.b)(()=>{document.body.classList.add("animating-right-column")});const t=Object(se.d)();Object(ce.b)(document.getElementById("RightColumn"),()=>{t(),Object(f.b)(()=>{document.body.classList.remove("animating-right-column")})})},[a]);const S=Object(c.m)(()=>{v(!1);const e=Object(r.r)(Object(s.e)());let t=0;clearInterval(sc),sc=window.setInterval(()=>{if(document.title.includes(n.L))cc(!1);else{if(t%2==0){const t=Object(r.r)(Object(s.e)())-e;t>0&&(oc(`${t} notification${t>1?"s":""}`),cc(!0))}else oc(n.pb),cc(!1);t++}},1e3)},[v]),k=Object(c.m)(()=>{v(!0),clearInterval(sc),sc=void 0,document.title.includes(n.L)||oc(n.pb),cc(!1)},[v]);function N(e){e.preventDefault(),e.stopPropagation()}return Object(re.a)(S,k),ie(S),c.a.createElement("div",{id:"Main",className:M,onDrop:N,onDragOver:N},c.a.createElement(Qe,null),c.a.createElement(hn,null),c.a.createElement(Jn,null),c.a.createElement(Yn,{isOpen:o}),c.a.createElement(ec,{isOpen:i}),c.a.createElement(Xn,{isOpen:d}),c.a.createElement(Zn,{isOpen:b}),u&&c.a.createElement(Et,{key:u.id,message:u,noUi:!0}),c.a.createElement(tc,{url:m}),c.a.createElement(ac,{isOpen:h}))}));n.r&&console.log(">>> FINISH LOAD MAIN BUNDLE"),Object(s.e)().connectionState||Object(s.d)().initApi()},207:function(e,t,a){},208:function(e,t,a){},209:function(e,t,a){},222:function(e,t,a){},223:function(e,t,a){},224:function(e,t,a){},227:function(e,t,a){},228:function(e,t,a){},229:function(e,t,a){},233:function(e,t,a){},234:function(e,t,a){},235:function(e,t,a){},238:function(e,t,a){},239:function(e,t,a){},240:function(e,t,a){},241:function(e,t,a){},242:function(e,t,a){},243:function(e,t,a){},244:function(e,t,a){},245:function(e,t,a){},246:function(e,t,a){},248:function(e,t,a){},249:function(e,t,a){},250:function(e,t,a){},251:function(e,t,a){},252:function(e,t,a){},254:function(e,t,a){},255:function(e,t,a){},256:function(e,t,a){},257:function(e,t,a){},258:function(e,t,a){},259:function(e,t,a){},260:function(e,t,a){},265:function(e,t,a){},266:function(e,t,a){},267:function(e,t,a){},268:function(e,t,a){}}]); +//# sourceMappingURL=4.2c2e12ad0cb73321f1fb.js.map \ No newline at end of file diff --git a/dist/4.2c2e12ad0cb73321f1fb.js.map b/dist/4.2c2e12ad0cb73321f1fb.js.map new file mode 100644 index 00000000..3718f18b --- /dev/null +++ b/dist/4.2c2e12ad0cb73321f1fb.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack:///./src/modules/actions/ui/localSearch.ts","webpack:///./src/modules/actions/ui/chats.ts","webpack:///./src/modules/actions/ui/messages.ts","webpack:///./src/modules/actions/ui/globalSearch.ts","webpack:///./src/modules/actions/ui/stickerSearch.ts","webpack:///./src/modules/actions/ui/users.ts","webpack:///./src/modules/actions/ui/misc.ts","webpack:///./src/modules/actions/ui/payments.ts","webpack:///./src/modules/actions/api/chats.ts","webpack:///./src/modules/actions/api/messages.ts","webpack:///./src/modules/actions/api/symbols.ts","webpack:///./src/modules/actions/api/globalSearch.ts","webpack:///./src/modules/actions/api/sync.ts","webpack:///./src/modules/actions/api/localSearch.ts","webpack:///./src/modules/actions/api/management.ts","webpack:///./src/modules/actions/api/users.ts","webpack:///./src/modules/reducers/bots.ts","webpack:///./src/modules/actions/api/bots.ts","webpack:///./src/modules/actions/api/twoFaSettings.ts","webpack:///./src/modules/actions/api/payments.ts","webpack:///./src/util/requestQuery.ts","webpack:///./src/modules/actions/apiUpdaters/chats.ts","webpack:///./src/modules/actions/apiUpdaters/messages.ts","webpack:///./src/modules/actions/apiUpdaters/users.ts","webpack:///./src/modules/actions/apiUpdaters/symbols.ts","webpack:///./src/modules/actions/apiUpdaters/misc.ts","webpack:///./src/modules/actions/apiUpdaters/settings.ts","webpack:///./src/modules/actions/apiUpdaters/twoFaSettings.ts","webpack:///./src/hooks/useBeforeUnload.ts","webpack:///./src/components/ui/Switcher.tsx","webpack:///./src/components/left/main/LeftMainHeader.tsx","webpack:///./src/components/left/ConnectionState.tsx","webpack:///./src/hooks/useThrottledMemo.ts","webpack:///./src/hooks/useThrottle.ts","webpack:///./src/components/left/main/ChatFolders.tsx","webpack:///./src/components/left/search/LeftSearch.async.tsx","webpack:///./src/components/left/main/ContactList.async.tsx","webpack:///./src/components/left/NewChatButton.tsx","webpack:///./src/components/left/main/LeftMain.tsx","webpack:///./src/hooks/useBrowserOnline.ts","webpack:///./src/components/left/settings/Settings.async.tsx","webpack:///./src/components/left/newChat/NewChat.async.tsx","webpack:///./src/components/left/ArchivedChats.async.tsx","webpack:///./src/components/left/LeftColumn.tsx","webpack:///./src/hooks/useWindowSize.ts","webpack:///./src/components/middle/helpers/calculateMiddleFooterTransforms.ts","webpack:///./src/util/routing.ts","webpack:///./src/components/middle/HeaderMenuContainer.async.tsx","webpack:///./src/components/middle/HeaderActions.tsx","webpack:///./src/hooks/useWebpThumbnail.ts","webpack:///./src/components/middle/PinnedMessageNavigation.tsx","webpack:///./src/components/middle/HeaderPinnedMessage.tsx","webpack:///./src/components/middle/AudioPlayer.tsx","webpack:///./src/components/middle/MiddleHeader.tsx","webpack:///./src/components/middle/helpers/groupMessages.ts","webpack:///./src/components/middle/helpers/preventMessageInputBlur.ts","webpack:///./src/components/middle/hooks/useStickyDates.ts","webpack:///./src/hooks/useDebounce.ts","webpack:///./src/components/middle/hooks/useMessageObservers.ts","webpack:///./src/components/middle/message/helpers/buildContentClassName.ts","webpack:///./src/components/middle/message/helpers/mediaDimensions.ts","webpack:///./src/components/middle/message/helpers/calculateAlbumLayout.ts","webpack:///./src/components/middle/message/helpers/calculateAuthorWidth.ts","webpack:///./src/components/middle/message/hooks/useFocusMessage.ts","webpack:///./src/components/middle/message/ContextMenuContainer.async.tsx","webpack:///./src/components/middle/ActionMessage.tsx","webpack:///./src/components/common/EmbeddedMessage.tsx","webpack:///./src/components/middle/message/MessageMeta.tsx","webpack:///./src/components/middle/message/Sticker.tsx","webpack:///./src/components/middle/message/hooks/useBlurredMediaThumbRef.ts","webpack:///./src/components/middle/message/helpers/getCustomAppendixBg.ts","webpack:///./src/components/middle/message/Photo.tsx","webpack:///./src/hooks/useHeavyAnimationCheckForVideo.ts","webpack:///./src/components/middle/message/hooks/usePauseOnInactive.ts","webpack:///./src/components/middle/message/Video.tsx","webpack:///./src/components/middle/message/Contact.tsx","webpack:///./src/components/ui/CheckboxGroup.tsx","webpack:///./src/components/middle/message/PollOption.tsx","webpack:///./src/components/middle/message/Poll.tsx","webpack:///./src/components/middle/message/WebPage.tsx","webpack:///./src/components/middle/message/Invoice.tsx","webpack:///./src/components/middle/message/hocs/withSelectControl.tsx","webpack:///./src/components/middle/message/Album.tsx","webpack:///./src/components/middle/message/RoundVideo.tsx","webpack:///./src/components/middle/message/InlineButtons.tsx","webpack:///./src/components/middle/message/CommentButton.tsx","webpack:///./src/components/middle/message/Message.tsx","webpack:///./src/components/middle/MessageListContent.tsx","webpack:///./src/components/middle/hooks/useScrollHooks.ts","webpack:///./src/components/middle/ContactGreeting.tsx","webpack:///./src/components/middle/NoMessages.tsx","webpack:///./src/components/middle/MessageList.tsx","webpack:///./src/components/middle/ScrollDownButton.tsx","webpack:///./src/components/middle/composer/helpers/buildAttachment.ts","webpack:///./src/components/middle/composer/helpers/applyIosAutoCapitalizationFix.ts","webpack:///./node_modules/opus-recorder/dist/encoderWorker.min.js","webpack:///./src/util/voiceRecording.ts","webpack:///./src/components/middle/composer/hooks/useClipboardPaste.ts","webpack:///./src/components/middle/composer/helpers/getMessageTextAsHtml.ts","webpack:///./src/components/middle/composer/hooks/useDraft.ts","webpack:///./src/components/middle/composer/hooks/useInlineBotTooltip.ts","webpack:///./src/components/common/DeleteMessageModal.async.tsx","webpack:///./src/components/ui/ResponsiveHoverButton.tsx","webpack:///./src/components/middle/composer/AttachMenu.async.tsx","webpack:///./src/components/middle/composer/SymbolMenu.async.tsx","webpack:///./src/components/middle/composer/InlineBotTooltip.async.tsx","webpack:///./src/components/middle/composer/MentionTooltip.async.tsx","webpack:///./src/components/middle/composer/CustomSendMenu.async.tsx","webpack:///./src/components/middle/composer/StickerTooltip.async.tsx","webpack:///./src/components/middle/composer/BotKeyboardMenu.tsx","webpack:///./src/components/middle/composer/ComposerEmbeddedMessage.tsx","webpack:///./src/components/middle/composer/AttachmentModal.async.tsx","webpack:///./src/components/middle/composer/PollModal.async.tsx","webpack:///./src/components/middle/composer/DropArea.async.tsx","webpack:///./src/components/middle/composer/WebPagePreview.tsx","webpack:///./src/components/common/CalendarModal.async.tsx","webpack:///./src/components/payment/PaymentModal.async.tsx","webpack:///./src/components/payment/ReceiptModal.async.tsx","webpack:///./src/components/middle/composer/Composer.tsx","webpack:///./src/components/middle/composer/hooks/useVoiceRecording.ts","webpack:///./src/components/middle/composer/hooks/useStickerTooltip.ts","webpack:///./src/util/insertHtmlInSelection.ts","webpack:///./src/util/deleteLastCharacterOutsideSelection.ts","webpack:///./src/components/middle/composer/hooks/useEditing.ts","webpack:///./src/components/middle/MobileSearch.async.tsx","webpack:///./src/components/middle/MessageSelectToolbar.async.tsx","webpack:///./src/components/common/UnpinAllMessagesModal.async.tsx","webpack:///./src/components/middle/MiddleColumn.tsx","webpack:///./src/hooks/useCustomBackground.ts","webpack:///./src/components/right/RightHeader.tsx","webpack:///./src/components/right/hooks/useProfileViewportIds.ts","webpack:///./src/components/right/hooks/useProfileState.ts","webpack:///./src/components/right/ProfilePhoto.tsx","webpack:///./src/components/right/ProfileInfo.tsx","webpack:///./src/components/right/hooks/usePhotosPreload.ts","webpack:///./src/components/right/ChatExtra.tsx","webpack:///./src/components/right/DeleteMemberModal.tsx","webpack:///./src/components/right/Profile.tsx","webpack:///./src/components/right/hooks/useTransitionFixes.ts","webpack:///./src/hooks/useCacheBuster.ts","webpack:///./src/components/right/RightSearch.async.tsx","webpack:///./src/components/right/management/Management.async.tsx","webpack:///./src/components/right/StickerSearch.async.tsx","webpack:///./src/components/right/GifSearch.async.tsx","webpack:///./src/components/right/PollResults.async.tsx","webpack:///./src/components/right/AddChatMembers.tsx","webpack:///./src/components/right/RightColumn.tsx","webpack:///./src/components/mediaViewer/MediaViewer.async.tsx","webpack:///./src/components/main/Notifications.async.tsx","webpack:///./src/components/main/Dialogs.async.tsx","webpack:///./src/components/main/ForwardPicker.async.tsx","webpack:///./src/components/main/SafeLinkModal.async.tsx","webpack:///./src/components/main/HistoryCalendar.async.tsx","webpack:///./src/components/main/Main.tsx","webpack:///./src/bundles/main.ts"],"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","scrollOffset","messageId","paramName","chatMessages","selectChatMessages","viewportIds","selectViewportIds","lastOwnEditableMessageId","findLast","Boolean","selectAllowedMessageActions","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","audioPlayer","selectIsRightColumnShown","pollResults","voters","window","setTimeout","newGlobal","getGlobal","noHighlight","replyStack","selectReplyStack","pop","focusLastMessage","messageListType","groupedId","groupedChatId","replyMessageId","ids","selectForwardedMessageIdsByGroupId","shouldSwitchChat","clearTimeout","updateFocusedMessage","updateFocusDirection","FocusDirection","Static","includes","direction","Down","Up","loadViewportMessages","fromChatId","messageIds","groupedMessageIds","selectMessageIdsByGroupId","isModalShown","closeMediaViewer","selectedMessages","openForwardMenu","selectCurrentChat","enterMessageSelectMode","childMessageIds","withShift","toggleMessageSelection","shouldShowContextMenuHint","disableContextMenuHint","showNotification","message","IS_TOUCH_ENV","isPollModalOpen","globalSearch","updateGlobalSearch","globalResults","localResults","resultsByType","fetchingStatus","chats","recentlyFoundChatIds","newRecentIds","filter","unshift","content","updateGlobalSearchContent","stickers","search","resultIds","gifs","offsetId","results","updateSelectedUserId","updateUserSearch","globalUserIds","localUserIds","management","byChatId","isActive","IS_SINGLE_COLUMN_LAYOUT","IS_TABLET_COLUMN_LAYOUT","isLeftColumnShown","messageLists","action","emoji","recentEmojis","newEmojis","e","sticker","recent","hash","newStickers","s","notification","newNotifications","notifications","existingNotificationIndex","findIndex","n","splice","push","data","hasErrorKey","getReadableErrorText","newDialogs","dialogs","existingErrorIndex","err","url","safeLinkModalUrl","selectedAt","historyCalendarSelectedAt","payment","isPaymentModalOpen","clearPayment","closeInvoice","runThrottledForLoadChats","throttle","cb","runThrottledForLoadTopChats","runDebouncedForLoadFullChat","debounce","async","loadChats","listType","offsetDate","result","callApi","limit","CHAT_LIST_LOAD_SLICE","archived","withPinned","orderedPinnedIds","serverTimeOffset","chatIds","shift","addUsers","buildCollectionByKey","users","updateChats","updateChatListIds","updateChatListSecondaryInfo","draftsById","map","forEach","replyingToById","isFullyLoaded","loadFullChat","fullInfo","updateChat","openChatByUsername","username","channelPostId","localChat","selectChatByUsername","isMin","previousChat","preloadedChatIds","i","TOP_CHAT_MESSAGES_PRELOAD_LIMIT","pause","byId","listIds","active","currentChatId","pinnedChats","otherChats","prepareChatList","chatToPreload","find","currentUserId","hasUnreadMark","toggleChatUnread","isChatSummaryOnly","requestChatUpdate","user","selectUser","selectThreadTopMessageId","requestThreadInfoUpdate","selectSupportChat","langCode","usernamePostfix","LOCALIZED_TIPS","toUpperCase","TIPS_USERNAME","oldestChat","selectIsChatPinned","sort","chat1","chat2","date","force","isMuted","title","about","photo","memberIds","progress","ChatCreationProgress","InProgress","createdChannel","channelId","accessHash","Complete","Error","getDispatch","createChannel","userId","activeChat","activeChannel","createdChat","createGroupChat","folderId","folder","selectChatFolder","shouldBePinned","pinnedChatIds","includedChatIds","newPinnedIds","pinnedId","newIncludedChatIds","folderUpdate","selectChatListType","isPinned","ARCHIVED_FOLDER_ID","isChatArchived","chatFolders","loadChatFolders","recommendedChatFolders","recommended","loadRecommendedChatFolders","emoticon","maxId","recommendedId","description","newFolder","createChatFolder","Math","max","apply","deleteChatFolder","unreadCount","match","RE_TME_INVITE_LINK","exec","RE_TME_LINK","chatOrChannelPostId","isEnabled","isChatBasicGroup","bannedRights","chatAfterUpdate","members","kickedMembers","isBanned","viewMessages","isUnblocked","m","adminRights","customTitle","adminMembers","isDismissed","updateManagementProgress","ManagementProgress","Promise","all","groups","addedById","reduce","group","addChats","forDiscussionIds","channel","fullChat","isPreHistoryHidden","linkedChatId","activeChatFolder","offset","setNewChatMembersDialogState","NewChatMembersProgress","Loading","Closed","uploadProgressCallbacks","Map","runThrottledForMarkRead","isOutlying","isBudgetPreload","addOffset","LoadMoreDirection","Backwards","Around","round","MESSAGE_LIST_SLICE","Forwards","selectThreadOriginChat","threadInfos","addChatMessagesById","updateOutlyingIds","updateListedIds","updateThreadInfos","listedIds","selectListedIds","outlyingIds","selectOutlyingIds","areSortedArraysIntersecting","historyIds","newViewportIds","getViewportSlice","safeReplaceViewportIds","sourceIds","index","findClosestIndex","indexForDirection","from","to","slice","areSomeLocal","areAllLocal","sendMessage","params","localId","progressCallback","attachment","messageLocalId","has","set","fileUploads","byMessageLocalId","replyingTo","IS_IOS","rafPromise","delete","isRestricted","resolve","loadWithBudget","selectFocusedMessageId","selectRealLastReadId","replyOriginForId","MESSAGE_DELETED","replyMessage","selectChatMessage","updateChatMessage","replyToMessageId","loadMessage","scheduledAt","clearWebPagePreview","value","noWebPage","selectNoWebPage","isSingle","attachments","isGrouped","restParams","text","entities","commonParams","groupedAttachments","split","MAX_MEDIA_FILES_FOR_ALBUM","firstAttachment","restAttachments","Date","now","selectEditingMessage","setEditingId","get","previousLocalId","cancelApiProgress","apiUpdate","draft","replyToMsgId","draftDate","localOnly","selectDraft","isUnpin","isOneSide","isSilent","unpinAllMessages","shouldDeleteForAll","editingId","selectEditingId","selectEditingScheduledId","reason","peer","webPagePreview","loadWebPagePreview","options","option","shouldResetVoters","v","a","offsets","nextOffset","loadPollOptionResults","fromChat","toChat","b","scheduledMessages","historyHash","replaceScheduledMessages","loadScheduledHistory","selectScheduledMessage","loadPinnedMessages","searchThrottled","searchGifs","updateGifSearch","added","addedStickers","updateStickerSets","sets","loadStickerSets","setIds","addedSetIds","loadStickers","stickerSetId","recentStickers","loadRecentStickers","favorite","favoriteStickers","loadFavoriteStickers","greeting","featured","featuredStickers","loadFeaturedStickers","stickerSetAccessHash","stickerSet","selectStickerSet","packs","updateStickerSet","currentEmoji","forEmoji","rebuildStickersForEmoji","replaceAnimatedEmojis","loadAnimatedEmojis","saved","savedGifs","loadSavedGifs","unfave","unfaveSticker","installedDate","language","currentEmojiKeywords","emojiKeywords","isLoading","fromVersion","version","keywords","setsById","searchWords","searchStickers","updateStickersForEmoji","loadStickersForEmoji","searchMessagesGlobal","offsetRate","maxDate","minDate","localResult","chatOrUser","GLOBAL_SEARCH_SLICE","totalCount","nextOffsetId","nextRate","currentSearchQuery","selectCurrentGlobalSearchQuery","updateGlobalSearchFetchingStatus","addMessages","updateGlobalSearchResults","loadAndReplaceArchivedChats","updateUsers","replaceChatListIds","loadAndUpdateUsers","userIds","contactIds","contactList","updatedUsers","loadTopMessages","lastReadInboxMessageId","localChats","localUsers","globalChats","globalUsers","searchChats","timestampPlusDay","foundIds","currentSearch","selectCurrentTextSearch","topMessageId","MESSAGE_SEARCH_SLICE","newFoundIds","updateLocalTextSearchResults","searchTextMessages","peerId","selectCurrentMediaSearchPeerId","selectCurrentMediaSearch","currentType","currentResults","SHARED_MEDIA_SLICE","updateLocalMediaSearchResults","searchSharedMedia","timestamp","searchMessagesByDate","updateManagement","isUsernameAvailable","afterSyncCallback","DEBUG","console","log","savedUsers","savedPrivateChatIds","savedChats","selectedChat","isChatPrivate","selectedChatUser","replaceChats","loadAndReplaceChats","areMessagesLoaded","currentThreadId","draftsByChatId","acc","newCurrentChatId","currentMessageListInfo","threadsById","originChannelId","currentMessageListInfoOrigin","resultOrigin","byIdOrigin","listedIdsOrigin","Array","prototype","concat","replaceUsers","audioChatId","audioMessageId","closeAudioPlayer","loadAndReplaceMessages","lastSyncTime","sync","afterSync","runDebouncedForFetchFullUser","runThrottledForSearch","replaceInlineBotSettings","inlineBotSettings","inlineBots","byUsername","replaceInlineBotsIsLoading","topPeers","lastRequestedAt","usersHash","loadTopUsers","getCompareString","lastName","firstName","collator","Intl","Collator","sortedUsers","compare","isSelf","loadContactList","updateChatMutedState","phone","phoneNumber","updateUser","updateContact","deleteUser","profileId","isPrivate","photos","userSearch","updateUserSearchFetchingStatus","searchUsers","runDebouncedForSearch","sendBotCommand","command","button","openTelegramLink","toggleSafeLinkModal","alert","isError","showDialog","answerCallbackButton","openPollModal","getReceipt","receiptMessageId","getPaymentForm","setInvoiceMessageInfo","openPaymentModal","bot","selectChatBot","removeBlockedContact","topInlineBots","newHash","inlineBotData","inlineBot","switchPm","canLoadMore","shouldReplaceSettings","newInlineBotData","currentIds","Set","newResults","help","isGallery","searchInlineBot","queryId","resultId","replaceSettings","hasPassword","updateTwoFaSettings","hint","currentPassword","onSuccess","error","isSuccess","password","email","waitingEmailCodeLength","code","requestInfo","saveInfo","selectPaymentMessageId","shouldSave","shippingOptions","setRequestInfoId","updateShippingOptions","setPaymentStep","PaymentStep","Shipping","PaymentInfo","validateRequestedInfo","setPaymentForm","step","invoice","shippingAddressRequested","nameRequested","phoneRequested","emailRequested","ShippingInfo","setReceipt","receipt","publishableKey","selectProviderPublishableKey","credentials","k","join","buildQueryString","cardNumber","expiryMonth","expiryYear","cvv","zip","country","response","fetch","method","headers","Authorization","json","getStripeError","setStripeCardInfo","Checkout","sendStipeCredentials","shippingOptionId","saveCredentials","requestInfoId","selectPaymentRequestId","stripeCredentials","selectStripeCredentials","requestedInfoId","sendPaymentForm","save","runThrottledForUpdateAppBadge","update","noTopChatsRequest","selectIsChatListed","loadTopChats","newProfilePhoto","selectCountNotMutedUnread","updateAppBadge","isNotJoined","listId","typingStatus","senderId","isFromScheduled","isActiveChat","hasUnreadMention","unreadMentionsCount","hasWebNotifications","selectNotifySettings","showNewMessageNotification","messageUpdate","selectCommonBoxChatId","targetChat","newOrderedPinnedIds","MAX_ACTIVE_PINNED_CHATS","updateChatListType","chatFoldersById","newChatFoldersById","pick","newOrderedIds","orderedId","folders","replacedMembers","addedMember","deletedMemberId","shouldUpdate","some","deleteIndex","isOwner","isAdmin","membersCount","formattedText","updateWithLocalMedia","isScheduled","currentMessage","video","document","getMessageContent","blobUrl","thumbnail","isPreloadedGlobally","previewBlobUrl","updateScheduledMessage","updateListedAndViewportIds","firstMessageId","selectThreadByMessage","isUnreadChatNotLoaded","isMessageLocal","addViewportId","messagesCount","firstUnreadId","selectFirstUnreadId","updateChatLastMessage","currentLastMessage","findLastMessage","isDeleting","deleteMessages","newLastMessage","threadIdsToUpdate","deleteChatMessages","unique","chatsIdsToUpdate","commonBoxChatId","updateThreadInfo","newMessage","isMessageInCurrentMessageList","isOutgoing","scheduledIds","selectScheduledIds","selectScheduledMessages","deleteChatScheduledMessages","thread","markMessageListRead","currentPinnedIds","selectPinnedIds","newTheadInfo","messagesById","deleteScheduledMessages","pollId","pollUpdate","selectChatMessageByPollId","poll","updatedPoll","updatedResults","isChosen","chosenAnswers","chosenAnswer","chosenAnswerIndex","recentVoterIds","totalVoters","newRecentVoterIds","newTotalVoters","targetOption","targetOptionIndex","updatedOption","votersCount","flushStatusUpdatesThrottled","pendingStatusUpdates","statusUpdate","status","targetUser","isBlocked","addBlockedContact","settings","privacy","key","rules","updateNotifySettings","peerType","shouldShowPreviews","addNotifyException","twoFaSettings","useBeforeUnload","callback","useEffect","onBeforeUnload","memo","name","label","checked","disabled","inactive","noAnimation","onChange","onCheck","handleChange","useCallback","currentTarget","className","buildClassName","ANIMATION_LEVEL_OPTIONS","withGlobal","searchQuery","chatsById","animationLevel","byKey","globalSearchChatId","searchDate","theme","selectTheme","contactsFilter","onSearchQuery","onSelectSettings","onSelectContacts","onSelectArchived","setGlobalSearchChatId","onReset","shouldSkipTransition","openTipsChat","setGlobalSearchDate","setSettingOption","lang","useLang","hasMenu","LeftColumnContent","ChatList","clearedDateSearchParam","clearedChatSearchParam","selectedSearchDate","useMemo","formatDateToString","archivedUnreadChatsCount","values","total","withOtherVersions","location","hostname","MainButton","onTrigger","isOpen","Button","ripple","size","color","onClick","ariaLabel","handleSearchFocus","handleSelectSaved","handleDarkModeToggle","stopPropagation","newTheme","shouldUseSystemTheme","switchTheme","ANIMATION_LEVEL_MAX","handleAnimationLevelChange","newLevel","_","body","classList","toggle","isSearchFocused","GlobalSearch","Contacts","searchInputPlaceholder","DropdownMenu","trigger","footer","APP_NAME","APP_VERSION","MenuItem","icon","toLowerCase","href","FEEDBACK_URL","localStorage","setItem","JSON","stringify","disableHistoryBack","SearchInput","inputId","parentContainerClassName","focused","placeholder","autoComplete","canClose","onFocus","PickerSelectedItem","isMinimized","clickArg","chatOrUserId","dir","isRtl","Spinner","resolverFn","ms","dependencies","runThrottled","noFirst","useThrottle","setValue","useState","isFrozen","freeze","unfreeze","useFlag","useHeavyAnimationCheck","useOnChange","usersById","orderedFolderIds","notifySettings","notifyExceptions","selectNotifyExceptions","foldersDispatch","onScreenSelect","setActiveChatFolder","transitionRef","useRef","displayedFolders","folderCountersById","useThrottledMemo","counters","unreadDialogsCount","hasActiveDialogs","getFolderUnreadDialogs","badgeCount","isBadgeActive","folderTabs","handleSwitchTab","current","captureEvents","onSwipe","SwipeDirection","Left","min","Right","isNotInAllTabRef","captureEscKeyListener","useHistoryBack","handleKeyDown","ctrlKey","shiftKey","startsWith","digit","preventDefault","addEventListener","removeEventListener","shouldRender","shouldRenderPlaceholder","transitionClassNames","useShowTransition","renderCurrentTab","activeFolder","folderType","TabList","tabs","activeTab","onSwitchTab","Transition","ref","activeKey","renderCount","props","LeftSearch","useModuleLoader","Bundles","Extra","ContactList","closeTimeout","isShown","onNewPrivateChat","onNewChannel","onNewGroup","isMenuOpen","setIsMenuOpen","fabClassName","handleMouseEnter","handleMouseLeave","onMouseEnter","onMouseLeave","tabIndex","Menu","positionX","positionY","autoClose","onClose","TRANSITION_RENDER_COUNT","onContentChange","connectionState","isNewChatButtonShown","setIsNewChatButtonShown","isConnecting","isOnline","setIsOnline","navigator","onLine","useBrowserOnline","isMouseInside","handleSelectSettings","Settings","handleSelectContacts","handleSelectNewChannel","NewChannelStep1","handleSelectNewGroup","NewGroupStep1","handleSelectArchived","Archived","autoCloseTimeout","shouldRenderUpdateButton","updateButtonClassNames","handleUpdateClick","isAppOutdated","markIsAppOutdated","timeout","reload","useAppOutdatedCheck","ShowTransition","isCustom","shouldCleanup","cleanupExceptionKey","fluid","pill","NewChat","ContentType","ArchivedChats","RENDER_COUNT","shouldSkipHistoryAnimations","setGlobalSearchQuery","resetChatCreation","loadPasswordInfo","clearTwoFaError","setContent","settingsScreen","setSettingsScreen","SettingsScreens","Main","setContactsFilter","foldersState","useFoldersReducer","lastResetTime","setLastResetTime","contentType","NewChannelStep2","NewChannel","NewGroupStep2","NewGroup","handleReset","forceReturnToChatList","pickerSearchInput","getElementById","blur","EditProfile","Folders","General","Notifications","Privacy","Language","GeneralChatBackground","GeneralChatBackgroundColor","PrivacyPhoneNumber","PrivacyLastSeen","PrivacyProfilePhoto","PrivacyForwarding","PrivacyGroupChats","PrivacyActiveSessions","PrivacyBlockedUsers","TwoFaDisabled","TwoFaEnabled","TwoFaCongratulations","PrivacyPhoneNumberAllowedContacts","PrivacyPhoneNumberDeniedContacts","PrivacyLastSeenAllowedContacts","PrivacyLastSeenDeniedContacts","PrivacyProfilePhotoAllowedContacts","PrivacyProfilePhotoDeniedContacts","PrivacyForwardingAllowedContacts","PrivacyForwardingDeniedContacts","PrivacyGroupChatsAllowedContacts","PrivacyGroupChatsDeniedContacts","TwoFaNewPassword","TwoFaNewPasswordConfirm","TwoFaNewPasswordHint","TwoFaNewPasswordEmail","TwoFaNewPasswordEmailCode","TwoFaChangePasswordCurrent","TwoFaTurnOff","TwoFaRecoveryEmailCurrentPassword","TwoFaChangePasswordNew","TwoFaChangePasswordConfirm","TwoFaChangePasswordHint","TwoFaRecoveryEmail","TwoFaRecoveryEmailCode","FoldersCreateFolder","FoldersEditFolder","FoldersIncludedChatsFromChatList","FoldersExcludedChatsFromChatList","FoldersEditFolderFromChatList","handleSearchQuery","handleSettingsScreenSelect","screen","LAYERS_ANIMATION_NAME","currentScreen","isChannel","setSize","windowSize","handleResize","calculateMiddleFooterTransforms","windowWidth","canPost","sidePadding","MOBILE_SCREEN_MAX_WIDTH","messageListWidth","MIN_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN","leftColumnWidth","rightColumnWidth","MIN_SCREEN_WIDTH_FOR_STATIC_LEFT_COLUMN","getMessageListWidth","sendButtonWidth","composerWidth","toolbarWidth","composerHiddenScale","toolbarHiddenScale","composerTranslateX","toolbarTranslateX","unpinHiddenScale","toolbarForUnpinHiddenScale","createMessageHash","messageList","HeaderMenuContainer","isChatChannel","noMenu","isChatWithSelf","selectIsChatWithSelf","isMainThread","isDiscussionThread","isRightColumnShown","canRestartBot","selectIsUserBlocked","canStartBot","selectIsChatBotNotStarted","canSubscribe","isChatSuperGroup","canSearch","canMute","canSelect","selectIsInSelectMode","canLeave","joinChannel","openLocalTextSearch","restartBot","menuButtonRef","menuPosition","setMenuPosition","handleHeaderMenuOpen","rect","getBoundingClientRect","x","right","y","bottom","handleHeaderMenuClose","handleHeaderMenuHide","handleSubscribeClick","handleStartBot","handleRestartBot","handleSearchClick","querySelector","focus","searchInput","anchor","onSubscribeChannel","onSearchClick","onCloseAnimationEnd","useWebpThumbnail","getMessageMediaThumbDataUri","shouldDecodeThumbnail","isWebpSupported","thumbnailDecoded","setThumbnailDecoded","EMPTY_IMAGE_DATA_URI","useLayoutEffect","webpToPngBase64","then","catch","drawRect","width","height","radius","count","containerRef","markupParams","reverseIndex","barHeight","getBarHeight","markHeight","getMarkHeight","trackHeight","getTrackHeight","clipPathId","clipPath","d","getClipPath","markTranslateY","getMarkTranslateY","trackTranslateY","getTrackTranslateY","calculateMarkup","firstChild","firstElementChild","currentElement","style","transform","svg","div","defs","innerHTML","onUnpinMessage","onAllPinnedClick","mediaThumbnail","mediaBlobUrl","useMedia","getMessageMediaHash","getMessageSummaryText","isUnpinDialogOpen","openUnpinDialog","closeUnpinDialog","handleUnpinMessage","ConfirmDialog","confirmLabel","confirmHandler","thumbDataUri","getPictogramDimensions","src","alt","renderPictogram","renderText","RippleEffect","sender","selectSender","noUi","senderName","getSenderTitle","mediaData","mediaLoader","playPause","isPlaying","useAudioPlayer","getMessageKey","getMediaDuration","handleClick","handleClose","audio","getMessageAudio","performer","fileName","renderAudio","subtitle","renderVoice","audioMessage","pinnedIds","state","isSelectModeActive","isChatWithBot","selectIsChatWithBot","currentTransitionKey","assign","pinnedMessageId","topMessageSender","selectForwardedSender","pinnedMessageIds","canUnpin","firstPinnedMessage","isReady","openChatWithInfo","pinMessage","openPreviousChat","toggleLeftColumn","pinnedMessageIndex","setPinnedMessageIndex","isArray","pinnedMessage","pinnedMessagesCount","chatTitleLength","getChatTitle","topMessageTitle","useEnsureMessage","useWindowSize","isLeftColumnHideable","shouldShowCloseButton","componentRef","shouldAnimateTools","handleHeaderClick","handlePinnedMessageClick","cycleRestrict","handleAllPinnedClick","handleBackClick","messageInput","EDITABLE_INPUT_ID","currentChat","selectIsChatMuted","canToolsCollideWithChatInfo","SAFE_SCREEN_WIDTH_FOR_CHAT_INFO","shouldUseStackedToolsClass","SAFE_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN","shouldRenderAudioPlayer","audioPlayerClassNames","renderingAudioMessage","useCurrentOrPrev","shouldRenderPinnedMessage","pinnedMessageClassNames","renderingPinnedMessage","renderingPinnedMessageTitle","canRevealTools","renderInfo","renderBackButton","PrivateChatInfo","withFullInfo","withMediaViewer","withUpdatingStatus","noRtl","GroupChatInfo","asClose","unreadCountInfo","formatIntegerCompact","componentEl","add","remove","isAlbum","messageOrAlbum","groupMessages","currentAlbum","currentSenderGroup","currentDateGroup","originalDate","datetime","getDayStart","senderGroups","dateGroups","isInAlbum","mainMessage","albumId","nextMessage","nextMessageDayStartsAt","isActionMessage","forwardInfo","senderUserId","hiddenUserName","inlineButtons","preventMessageInputBlur","activeElement","target","useStickyDates","isScrolled","markIsScrolled","runDebounced","shouldRunFirst","shouldRunLast","updateStickyDates","container","hasTools","contains","fastRaf","currentStuck","stuckDateEl","allElements","querySelectorAll","containerTop","scrollTop","el","offsetTop","offsetHeight","top","findStuckDate","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","getMessageText","stretchFactor","finalWidth","finalHeight","isSmall","AlbumRectPart","accumulate","list","initValue","accumulator","item","clamp","num","low","high","calculateContainerSize","layout","styles","dimensions","sides","calculateAlbumLayout","album","ratios","proportions","ratio","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","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","createElement","font","whiteSpace","left","opacity","appendChild","offsetWidth","useFocusMessage","elementRef","isFocused","focusDirection","noFocusHighlight","messagesContainer","closest","fastSmoothScroll","ContextMenuContainer","targetUserIds","targetChatId","targetMessageId","targetMessage","selectIsMessageFocused","focusedMessage","observeIntersection","isEmbedded","appearanceOrder","isLastInList","useOnIntersect","noAppearanceAnimation","markShown","targetUsers","renderActionMessageText","asPlain","isContextMenuOpen","contextMenuPosition","handleBeforeContextMenu","handleContextMenu","handleContextMenuClose","handleContextMenuHide","useContextMenuHandlers","isContextMenuShown","data-message-id","onMouseDown","onContextMenu","EmbeddedMessage","customText","isIntersecting","useIsIntersecting","pictogramId","isRoundVideo","getMessageRoundVideo","senderTitle","outgoingStatus","signature","views","isEdited","formatTime","MessageOutgoingStatus","Sticker","observeIntersectionForPlaying","shouldLoop","isModalOpen","openModal","closeModal","isAnimated","isMemojiSticker","MEMOJI_STICKER_ID","shouldLoad","shouldPlay","mediaHash","getMessageMediaFormat","isMediaLoaded","isAnimationLoaded","markAnimationLoaded","isMediaReady","shouldRenderFullMedia","useTransitionForMedia","getStickerDimensions","thumbClassName","stickerClassName","AnimatedSticker","animationData","play","noLoop","onLoad","fromSticker","useBlurredMediaThumbRef","fullMediaData","useCanvasBlur","IS_CANVAS_FILTER_SUPPORTED","SELECTED_APPENDIX_BACKGROUND","getCustomAppendixBg","inSelectMode","isSelected","img","Image","onload","canvas","ctx","getContext","drawImage","getImageData","getAppendixColorFromImage","Photo","shouldAutoLoad","isInSelectMode","uploadProgress","nonInteractive","shouldAffectAppendix","onCancelUpload","localBlobUrl","isDownloadAllowed","setIsDownloadAllowed","shouldDownload","downloadProgress","useMediaWithDownloadProgress","thumbRef","isUploading","isTransferring","transferProgress","getMediaTransferState","wasDownloadDisabled","usePrevious","shouldRenderSpinner","spinnerClassNames","shouldRenderThumb","isAllowed","contentEl","appendixBg","setProperty","setAttribute","ProgressSpinner","useHeavyAnimationCheckForVideo","playerRef","shouldPlayRef","safePlay","isPlayAllowed","wasPlaying","freezePlaying","paused","unfreezePlaying","unfreezePlayingOnRaf","hasFocus","useBackgroundMode","Video","shouldAutoPlay","videoRef","getMessageWebPageVideo","setIsPlayAllowed","isInline","isBuffered","bufferingHandlers","useBuffering","playProgress","setPlayProgress","handleTimeUpdate","currentTime","duration","usePauseOnInactive","useVideoCleanup","videoClassName","autoPlay","muted","loop","playsInline","onTimeUpdate","isGif","formatMediaDuration","contact","openUserInfo","Avatar","formatPhoneNumberWithCode","selected","loadingOptions","setValues","event","newValues","Checkbox","subLabel","getPercentage","toFixed","PollOption","answer","voteResults","maxVotersCount","correctResults","shouldAnimate","r","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","floor","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","RadioGroup","loadingOption","isQuiz","getReadableVotersCount","isText","inPreview","onMediaClick","onCancelMediaTransfer","webPage","getMessageWebPage","isSquarePhoto","handleMediaClick","siteName","displayUrl","isMediaInteractive","truncatedDescription","trimText","data-initial","SafeLink","getMessageInvoice","photoUrl","withSelectControl","WrappedComponent","ownProps","selectIsMessageSelected","handleMessageSelect","newProps","PhotoWithSelect","VideoWithSelect","uploadsById","hasCustomAppendix","albumLayout","cancelSendingMessage","mediaCount","handleCancelUpload","containerWidth","containerHeight","fileUpload","currentOnRelease","RoundVideo","playingProgressRef","shouldSpinnerRender","isActivated","setIsActivated","setProgress","playerEl","playingProgressEl","stopPlaying","capturePlaying","onRelease","ROUND_VIDEO_DIMENSIONS","onEnded","InlineButtons","shouldRequestThreadUpdate","recentReplierIds","recentRepliers","hasUnread","data-cnt","handleDocumentGroupMouseEnter","lastGroupElement","getLastElementInDocumentGroup","handleDocumentGroupMouseLeave","removeAttribute","nextElementSibling","withSenderName","withAvatar","viaBotId","chatUsername","forceSenderName","isAnonymousOwnMessage","originSender","botSender","threadTopMessageId","isThreadTop","shouldHideReply","replyMessageSender","selectUploadProgress","isForwarding","highlight","singleEmoji","getMessageSingleEmoji","every","isSingleEmoji","animatedEmoji","selectAnimatedEmoji","isGroupSelected","selectIsDocumentGroupSelected","isPinnedList","shouldAutoLoadMedia","selectShouldAutoLoadMedia","shouldAutoPlayMedia","selectShouldAutoPlayMedia","shouldLoopStickers","selectShouldLoopStickers","selectOutgoingStatus","observeIntersectionForBottom","observeIntersectionForMedia","observeIntersectionForAnimatedStickers","noComments","isFirstInGroup","isLastInGroup","isFirstInDocumentGroup","isLastInDocumentGroup","openMediaViewer","openAudioPlayer","markMessagesRead","sendPollVote","clickInlineButton","bottomMarkerRef","appendixRef","isLocal","hasReply","isReplyMessage","hasThread","asForwarded","isLinkedChannelPost","isInDocumentGroup","voice","getMessageCustomShape","textParts","renderMessageText","adminTitle","metaSafeAuthorWidth","canShowActionButton","canForward","canFocus","isChannelPost","fromMessageId","avatarPeer","senderPeer","containerClassName","contentClassName","hasComments","hasActionButton","classNames","isMedia","isMediaWithNoText","isViaBot","isRound","buildContentClassName","withCommentButton","withAppendix","handleGroupDocumentMessagesSelect","handleContainerDoubleClick","handleContentDoubleClick","handleAvatarClick","handleSenderClick","handleViaBotClick","handleReplyClick","MediaViewerOrigin","ScheduledInline","Inline","handleAudioPlay","handleAlbumMediaClick","albumMessageId","ScheduledAlbum","Album","getIsKeyboardVisible","handleReadMedia","handleVoteSend","handleGroupForward","handleForward","handleFocus","handleFocusForwarded","calculatedWidth","noMediaCorners","extraPadding","onDoubleClick","data-last-message-id","data-has-unread-mention","isAvatarPeerUser","avatarUser","avatarChat","hiddenName","renderAvatar","shouldInlineMeta","textContentClass","senderColor","getUserColorKey","renderSenderName","AnimatedEmoji","forceLoadPreview","Audio","isSelectable","onPlay","onReadMedia","Document","renderContent","messageGroups","isViewportNewest","isUnread","withUsers","anchorIdRef","memoFirstUnreadIdRef","hasLinkedChat","isSchedule","onFabToggle","onNotchToggle","openHistoryCalendar","observeIntersectionForReading","observe","useIntersectionObserver","rootRef","throttleMs","margin","freezeForReading","unfreezeForReading","entries","mentionIds","entry","dataset","useMessageObservers","backwardsTriggerRef","forwardsTriggerRef","fabTriggerRef","loadMoreBackwards","loadMoreForwards","toggleScrollTools","scrollHeight","scrollBottom","isAtBottom","MESSAGE_LIST_SENSITIVE_AREA","triggerEntry","resetScroll","observeIntersectionForFab","freezeForFab","unfreezeForFab","observeIntersectionForNotch","freezeForNotch","unfreezeForNotch","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","lastUnreadMessageId","loadGreetingStickers","debounceMs","handleStickerSelect","selectedSticker","StickerButton","isGroupChatJustCreated","renderScheduled","renderSavedMessages","renderGroup","runDebouncedForScroll","checkSingleMessageActionByType","selectCurrentMessageIds","restrictionReason","focusingId","hasFocusHighlight","withLastMessageWhenPreloading","botDescription","chatBot","isChatLoaded","isChannelChat","isGroupChat","isChatGroup","isCreator","isBot","threadFirstMessageId","selectFirstMessageId","setScrollOffset","scrollOffsetRef","selectScrollOffset","anchorTopRef","listItemElementsRef","memoUnreadDividerBeforeIdRef","memoFocusingIdRef","isScrollTopJustUpdatedRef","shouldAnimateAppearanceRef","setContainerHeight","onTickEnd","listedMessages","orderBy","loadMoreAround","handleScroll","parentElement","observer","ResizeObserver","offsetParent","contentRect","disconnect","windowHeight","normalHeight","String","clientHeight","preservedItemElements","useLayoutEffectWithPrevDeps","prevMessageIds","prevIsViewportNewest","prevContainerHeight","shouldForceScroll","lastItemElement","lastItemHeight","newScrollTop","hasFirstMessageChanged","hasLastMessageChanged","isAlreadyFocusing","isResized","isAnimatingScroll","useEffectWithPrevDeps","prevIsSelectModeActive","dispatchHeavyAnimationEvent","shouldRenderGreeting","onScroll","focusNextReply","messageElements","lastMessageElement","buildAttachment","filename","blob","isQuick","URL","createObjectURL","mimeType","quick","preloadImage","newBlob","toBlob","squeezeImage","revokeObjectURL","videoWidth","videoHeight","preloadVideo","createPosterForVideo","resetInput","applyIosAutoCapitalizationFix","inputEl","POLYFILL_OPTIONS","encoderPath","reuseWorker","BLOB_PARAMS","opusRecorderPromise","OpusRecorder","mediaRecorder","init","default","start","analyzerCallback","startMediaRecorder","startedAt","pausedAt","chunks","waveform","ondataavailable","typedArray","releaseAnalyzer","recorder","source","sourceNode","analyser","context","createAnalyser","fftSize","connect","dataLength","frequencyBinCount","dataArray","Uint8Array","isDestroyed","tick","getByteFrequencyData","volume","requestAnimationFrame","subscribeToAnalyzer","stop","reject","onstop","Blob","onerror","delayStop","CLIPBOARD_ACCEPTED_TYPES","getMessageTextAsHtml","tempEl","INLINE_BOT_QUERY_REGEXP","HAS_NEW_LINE","useInlineBotTooltip","html","markIsOpen","unmarkIsOpen","replace","innerText","getPlainText","queryInlineBot","resetInlineBot","canShowHelp","parseStartWithUsernameString","usernameLowered","prevQuery","prevUsername","botId","loadMore","closeTooltip","DeleteMessageModal","openTimeout","isFirstTimeActivation","onActivate","buttonProps","AttachMenu","SymbolMenu","InlineBotTooltip","MentionTooltip","CustomSend","StickerTooltipAsync","StickerTooltip","useMouseInside","isKeyboardSingleUse","forceOpen","markForceOpen","unmarkForceOpen","keyboardButtons","forwardMessageIds","forwardedMessagesCount","exitForwardMode","canAnimate","useAsyncRendering","clearEmbedded","handleMessageClick","AttachmentModal","PollModal","DropArea","RE_LINK","RegExp","RE_LINK_TEMPLATE","messageText","toggleMessageWebPage","link","parseMessageInput","linkEntity","ApiMessageEntityTypes","TextUrl","textMatch","renderingWebPage","webPageWithoutPhoto","messageStub","CalendarModal","PaymentModal","MainButtonState","ReceiptModal","chatUser","selectChatUser","messageWithActualBotKeyboard","selectNewestMessageWithBotKeyboardButtons","baseEmojiKeywords","BASE_EMOJI_KEYWORD_LANG","botKeyboardMessageId","keyboardMessage","editingMessage","canScheduleUntilOnline","wasOnline","withScheduledButton","shouldSchedule","botKeyboardPlaceholder","keyboardPlaceholder","stickersForEmoji","groupChatMembers","topInlineBotIds","isReceiptModalOpen","shouldSuggestStickers","isInlineBotLoading","dropAreaState","onDropHide","editMessage","saveDraft","clearDraft","setStickerSearchQuery","setGifSearchQuery","closePollModal","closePaymentModal","clearReceipt","addRecentEmoji","sendInlineBotResult","setHtml","lastMessageSendTimeSeconds","prevDropAreaState","isCalendarOpen","openCalendar","closeCalendar","scheduledMessageArgs","setScheduledMessageArgs","htmlRef","setAttachments","isBotKeyboardOpen","openBotKeyboard","closeBotKeyboard","isAttachMenuOpen","openAttachMenu","closeAttachMenu","isSymbolMenuOpen","openSymbolMenu","closeSymbolMenu","isDeleteModalOpen","openDeleteModal","closeDeleteModal","isSymbolMenuLoaded","onSymbolMenuLoadingComplete","isHoverDisabled","disableHover","enableHover","startRecordingVoice","stopRecordingVoice","pauseRecordingVoice","activeVoiceRecording","currentRecordTime","recordButtonRef","mainButtonRef","startRecordTimeRef","setActiveVoiceRecording","setCurrentRecordTime","IS_VOICE_RECORDING_SUPPORTED","voiceRecording","tickVolume","boxShadow","useVoiceRecording","mainButtonState","Edit","Send","Record","canShowCustomSendMenu","isMentionTooltipOpen","mentionFilter","closeMentionTooltip","insertMention","mentionFilteredUsers","useMentionTooltip","isInlineBotTooltipOpen","inlineBotId","isInlineBotTooltipGallery","inlineBotSwitchPm","inlineBotResults","closeInlineBotTooltip","inlineBotHelp","loadMoreForInlineBot","isCustomSendMenuOpen","allowedAttachmentOptions","getAllowedAttachmentOptions","isChatAdmin","slowMode","getChatSlowModeOptions","isStickerTooltipOpen","closeStickerTooltip","isDisabled","clearStickersForEmoji","IS_EMOJI_SUPPORTED","parseEmojiOnlyString","hasStickers","useStickerTooltip","canSendStickers","isEmojiTooltipOpen","closeEmojiTooltip","filteredEmojis","insertEmoji","useEmojiTooltip","insertTextAndUpdateCursor","selection","getSelection","newHtml","rangeCount","selectionRange","getRangeAt","isSelectionInsideInput","range","deleteContents","fragment","createContextualFragment","lastInsertedNode","lastChild","insertNode","setStartAfter","setEndAfter","collapse","removeAllRanges","addRange","insertHtmlInSelection","dispatchEvent","Event","bubbles","focusEditableElement","removeSymbol","execCommand","tempInput","contentEditable","textLength","createRange","setStart","setEnd","removeChild","deleteLastCharacterOutsideSelection","resetComposer","shouldPreserveInput","prevChatId","handleEditComplete","editedMessage","hasMessageMedia","useEditing","updateDraft","draftChatId","draftThreadId","runDebouncedForSaveDraft","DRAFT_DEBOUNCE","prevThreadId","prevHtml","handleBlur","useDraft","handlePaste","clipboardData","input","EDITABLE_INPUT_MODAL_ID","items","media","file","getAsFile","pastedText","getData","substring","useClipboardPaste","handleFileSelect","files","handleAppendFiles","handleClearAttachment","handleSend","currentAttachments","record","extraLength","textParams","nowSeconds","secondsSinceLastMessage","nextSendDateNotReached","nextSendDate","seconds","secondsRemaining","isSlowMode","handleGifSelect","gif","handleInlineBotSelect","inlineResult","handlePollSend","handleSilentSend","handleMessageSchedule","isWhenOnline","restArgs","getTime","handleMessageScheduleUntilOnline","handleCloseCalendar","handleSearchOpen","handleSymbolMenuOpen","handleAllScheduledClick","mainButtonHandler","areVoiceMessagesNotAllowed","canAttachMedia","prevEditedMessage","renderedEditedMessage","scheduledDefaultDate","setSeconds","setMilliseconds","scheduledMaxDate","setFullYear","getFullYear","sendButtonAriaLabel","symbolMenuButtonClassName","onSend","Portal","DropAreaState","None","withQuick","QuickFile","onHide","onFileSelect","caption","onCaptionUpdate","onFileAppend","onClear","onInsertUserName","filteredUsers","onSelectResult","canAttachEmbedLinks","faded","MessageInput","forcedPlaceholder","shouldSetFocus","shouldSuppressFocus","shouldSuppressTextFormatter","onUpdate","onSuppressedFocus","formatVoiceRecordDuration","onStickerSelect","emojis","onEmojiSelect","onPollCreate","onGifSelect","onRemoveSymbol","onSearchOpen","onSilentSend","onScheduleSend","withTimePicker","maxAt","getDayStartAt","isFutureMode","secondButtonLabel","onSubmit","onSecondButtonClick","MobileSearch","MessageSelectToolbar","UnpinAllMessagesModal","CLOSE_ANIMATION_DURATION","canBeQuicklyUploaded","kind","CONTENT_TYPES_FOR_QUICK_UPLOAD","isBlurred","isBackgroundBlurred","background","customBackground","backgroundColor","patternColor","themes","isMobileSearchActive","getCanPostInChat","isBotNotStarted","isPinnedMessageList","isScheduledMessageList","currentUserBannedRights","defaultBannedRights","hasPinnedOrAudioMessage","loadUser","setDropAreaState","isFabShown","setIsFabShown","isNotchShown","setIsNotchShown","isUnpinModalOpen","setIsUnpinModalOpen","setIsReady","ANIMATION_LEVEL_MIN","renderingChatId","usePrevDuringAnimation","renderingThreadId","renderingMessageListType","renderingCanPost","renderingHasTools","renderingIsFabShown","handleDragEnter","dataTransfer","shouldDrawQuick","handleHideDropArea","handleOpenUnpinModal","closeUnpinModal","handleUnpinAllMessages","handleTabletFocus","customBackgroundValue","settingValue","cacheApi","CUSTOM_BG_CACHE_NAME","useCustomBackground","MASK_IMAGE_DISABLED","messagingDisabledClassName","messageSendingRestrictionReason","getMessageSendingRestrictionReason","footerClassName","onTransitionEnd","propertyName","DARK_THEME_BG_COLOR","LIGHT_THEME_BG_COLOR","onDragEnter","onUnpin","HeaderContent","isProfile","isManagement","messageSearchQuery","stickerSearchQuery","selectCurrentStickerSearch","gifSearchQuery","selectCurrentGifSearch","canManage","isColumnOpen","isSearch","isStickerSearch","isGifSearch","isPollResults","isAddingChatMembers","profileState","managementScreen","setLocalTextSearchQuery","searchTextMessagesLocal","toggleManagement","shouldSkipAnimation","backButtonRef","handleMessageSearchQueryChange","handleStickerSearchQueryChange","handleGifSearchQueryChange","setShouldSkipTransition","contentKey","ProfileState","Profile","SharedMedia","MemberList","Search","PollResults","StickerSearch","GifSearch","AddingMembers","ManagementScreens","Initial","ManageInitial","ChatPrivacyType","ManageChatPrivacyType","Discussion","ManageDiscussion","ChannelSubscribers","ManageChannelSubscribers","GroupPermissions","ManageGroupPermissions","ChatAdministrators","ManageChatAdministrators","GroupRemovedUsers","ManageGroupRemovedUsers","GroupUserPermissionsCreate","ManageGroupUserPermissionsCreate","GroupUserPermissions","ManageGroupUserPermissions","GroupRecentActions","ManageGroupRecentActions","ChatAdminRights","ManageGroupAdminRights","GroupMembers","ManageGroupMembers","renderingContentKey","renderHeaderContent","isBackButton","buttonClassName","useProfileViewportIds","loadMoreMembers","searchMessages","tabType","mediaSearchType","resultType","sortUserIds","memberViewportIds","getMoreMembers","noProfileInfoForMembers","currentResultType","handleLoadMore","getMore","useInfiniteScroll","MEMBERS_SLICE","isOnTop","useInfiniteScrollForMembers","mediaViewportIds","getMoreMedia","noProfileInfoForMedia","useInfiniteScrollForSharedMedia","documentViewportIds","getMoreDocuments","noProfileInfoForDocuments","linkViewportIds","getMoreLinks","noProfileInfoForLinks","audioViewportIds","getMoreAudio","noProfileInfoForAudio","noProfileInfo","forSharedMediaType","messageIdsRef","getMessageContentIds","reverse","runThrottledForScroll","isScrollingProgrammatically","isFirstPhoto","isSavedMessages","isDeleted","isDeletedUser","getMediaHash","forceAvatar","getChatAvatarHash","imageHash","ApiMediaFormat","BlobUrl","avatarThumbnailData","useBlurSync","dataUri","imageSrc","prevImageSrc","decoding","userFullName","getUserFullName","getFirstLetters","fullClassName","forceShowSelf","loadFullUser","fullName","slideAnimation","currentPhotoIndex","setCurrentPhotoIndex","isFirst","isLast","profile","currentIndex","usePhotosPreload","handleProfilePhotoClick","ProfileAvatar","selectPreviousMedia","selectNextMedia","renderPhoto","isVerifiedIconShown","isVerified","renderPhotoTabs","aria-label","VerifiedIcon","isUserOnline","getUserStatus","canInviteUsers","isUserRightBanned","getHasAdminRight","handleNotificationChange","copy","entity","copyTextToClipboard","formattedNumber","getChatLink","bio","getChatDescription","ListItem","multiline","narrow","isStatic","contactName","getUserFirstOrLastName","deleteChatMember","handleDeleteChatMember","Modal","onEnter","TABS","buildInfiniteScrollItemSelector","isGroup","hasMembersTab","areMembersHidden","canViewMembers","canAddMembers","canDeleteMembers","resolvedUserId","onProfileStateChange","setLocalMediaSearchType","searchMediaMessagesLocal","loadProfilePhotos","setActiveTab","deletingUserId","setDeletingUserId","prevTabType","tabsEl","prevProfileState","tabListEl","determineProfileState","useProfileState","applyTransitionFix","releaseTransitionFix","transitionElSelector","setMinHeight","transitionEl","minHeight","overflowY","scrollBarWidth","clientWidth","marginRight","useTransitionFixes","cacheBuster","resetCacheBuster","setCacheBuster","useCacheBuster","handleTransitionStop","handleNewMemberDialogOpen","handleSelectMedia","handlePlayAudio","handleMemberClick","handleMessageFocus","handleDeleteMembersModalClose","renderingDelay","isFirstTab","SLIDE_TRANSITION_DURATION","canRenderContents","getMemberContextAction","handler","renderSharedMedia","noSpinner","NothingFound","Media","withDate","smaller","onDateClick","WebLink","onMessageClick","teactOrderKey","contextActions","InfiniteScroll","itemSelector","sensitiveArea","PROFILE_SENSITIVE_AREA","preloadBackwards","noScrollRestoreOnTop","noFastList","onLoadMore","renderProfileInfo","shouldRestoreHeight","onStart","onStop","big","FloatingActionButton","RightSearch","Management","localContactIds","isSearching","onNextStep","setUserSearchQuery","selectedMemberIds","setSelectedMemberIds","noPickerScrollRestore","member","handleFilterChange","displayedIds","sortChatIds","foundContactIds","contactId","isUserBot","canBeInvitedToGroup","handleNextStep","Picker","itemIds","selectedIds","filterValue","filterPlaceholder","searchInputId","onSelectedIdsChange","onFilterChange","noScrollRestore","MAIN_SCREENS_COUNT","RightColumnContent","MANAGEMENT_SCREENS_COUNT","blurSearchInput","areActiveChatsLoaded","selectAreActiveChatsLoaded","selectRightColumnContentKey","currentProfileUserId","selectedId","isChatSelected","toggleChatInfo","closePollResults","addChatMembers","setProfileState","setManagementScreen","selectedChatMemberId","setSelectedChatMemberId","isPromotedByCurrentUser","setIsPromotedByCurrentUser","isScrolledDown","ChatInfo","UserInfo","isOverlaying","close","shouldScrollUp","GroupType","handleSelectChatMember","memberId","isPromoted","handleAppendingChatMembers","onChatMemberSelect","prevContentKey","MediaViewer","Dialogs","ForwardPicker","SafeLinkModal","HistoryCalendar","notificationInterval","DEBUG_isLogged","updateIcon","asUnread","updatePageTitle","nextTitle","isMediaViewerOpen","selectIsMediaViewerOpen","isForwardModalOpen","selectIsForwardModalOpen","hasNotifications","hasDialogs","isHistoryCalendarOpen","loadNotificationSettings","loadNotificationExceptions","updateIsOnline","loadTopInlineBots","loadEmojiKeywords","middleColumnTransitionClassNames","rightColumnTransitionClassNames","prevIsLeftColumnShown","dispatchHeavyAnimationEnd","waitForTransitionEnd","prevIsRightColumnShown","initialUnread","clearInterval","setInterval","INACTIVE_MARKER","newUnread","PAGE_TITLE","stopEvent","onDrop","onDragOver","initApi"],"mappings":"sMAoDO,SAASA,EAAqBC,GACnC,MAAM,OAAEC,EAAF,SAAUC,GAAaC,YAAyBH,IAAW,GACjE,OAAKC,GAAWC,GAIhBF,EAASI,YAAsBJ,EAAQC,EAAQC,GAAU,GACzDF,EAASK,YAA8BL,EAAQC,EAAQC,OAAUI,IAJxDN,EA3CXO,YAAW,sBAAwBP,IACjC,MAAM,OAAEC,EAAF,SAAUC,GAAaC,YAAyBH,IAAW,GACjE,GAAKC,GAAWC,EAIhB,OAAOE,YAAsBJ,EAAQC,EAAQC,GAAU,KAGzDK,YAAW,uBAAwBR,GAEnCQ,YAAW,0BAA2B,CAACP,EAAQQ,EAASC,KACtD,MAAM,OAAER,EAAF,SAAUC,GAAaC,YAAyBH,IAAW,GACjE,IAAKC,IAAWC,EACd,OAGF,MAAM,MAAEQ,GAAUD,EACZE,EAAgBC,YAAmBX,EAAQC,IACzCQ,MAAOG,GAAiBb,EAAOc,gBAAgBC,gBAAgBJ,IAAkB,GAQzF,OANID,IAAUG,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AAU1tF,GACjBA,EAAEk2B,iBACFl2B,EAAEmwB,kBAGJ,OARA+wB,aAAkButB,EAAY3c,GAC9B9lC,GAAgByiD,GAQd,yBAAKx3E,GAAG,OAAO+1B,UAAWA,EAAW2gE,OAAQD,EAAWE,WAAYF,GAClE,kBAAC,GAAD,MACA,kBAAC,GAAD,MACA,kBAAC,GAAD,MACA,kBAAC,GAAD,CAAaj+D,OAAQy8D,IACrB,kBAAC,GAAD,CAAez8D,OAAQ28D,IACvB,kBAAC,GAAD,CAAe38D,OAAQ68D,IACvB,kBAAC,GAAD,CAAS78D,OAAQ88D,IAChB3iD,GAAgB,kBAAC,GAAD,CAAane,IAAKme,EAAa3yC,GAAI0G,QAASisC,EAAcnB,MAAI,IAC/E,kBAAC,GAAD,CAAepnC,IAAKC,IACpB,kBAAC,GAAD,CAAiBmuB,OAAQ+8D,QC1N3BxyE,KAEFC,QAAQC,IAAI,+BAGT9e,cAAY09B,iBACfxxB,cAAcumF,W","file":"4.2c2e12ad0cb73321f1fb.js","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 { MAIN_THREAD_ID } from '../../../api/types';\nimport { FocusDirection } from '../../../types';\n\nimport { ANIMATION_END_DELAY, FAST_SMOOTH_MAX_DURATION } 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} from '../../selectors';\nimport { findLast } from '../../../util/iteratees';\n\nconst FOCUS_DURATION = 1500;\nconst FOCUS_NO_HIGHLIGHT_DURATION = FAST_SMOOTH_MAX_DURATION + ANIMATION_END_DELAY;\nconst POLL_RESULT_OPEN_DELAY_MS = 450;\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 && chat.lastMessage ? chat.lastMessage.id : undefined;\n } else {\n const threadInfo = selectThreadInfo(global, chatId, threadId);\n\n messageId = threadInfo ? threadInfo.lastMessageId : undefined;\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,\n } = payload!;\n\n return {\n ...global,\n audioPlayer: {\n chatId,\n threadId,\n messageId,\n },\n };\n});\n\naddReducer('closeAudioPlayer', (global) => {\n return {\n ...global,\n audioPlayer: {},\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 && chat.lastMessage ? chat.lastMessage.id : undefined;\n } else {\n const threadInfo = selectThreadInfo(global, chatId, threadId);\n\n lastMessageId = threadInfo ? threadInfo.lastMessageId : undefined;\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,\n } = payload!;\n\n let { messageId } = payload!;\n\n if (groupedId !== undefined) {\n const ids = selectForwardedMessageIdsByGroupId(global, groupedChatId, groupedId);\n if (ids && 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);\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('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","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 { GlobalState } from '../../../global/types';\n\nimport { updateSelectedUserId, updateUserSearch } from '../../reducers';\n\naddReducer('openUserInfo', (global, actions, payload) => {\n const { id } = payload!;\n\n actions.openChat({ id });\n});\n\nconst clearSelectedUserId = (global: GlobalState) => updateSelectedUserId(global, undefined);\n\naddReducer('openChat', clearSelectedUserId);\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';\n\nimport { IS_SINGLE_COLUMN_LAYOUT, IS_TABLET_COLUMN_LAYOUT } from '../../../util/environment';\nimport getReadableErrorText from '../../../util/getReadableErrorText';\nimport { selectCurrentMessageList } from '../../selectors';\nimport { ApiError } from '../../../api/types';\n\nconst MAX_STORED_EMOJIS = 18; // Represents two rows of recent emojis\n\naddReducer('toggleChatInfo', (global) => {\n return {\n ...global,\n isChatInfoShown: !global.isChatInfoShown,\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('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\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) => {\n const newNotifications = [...global.notifications];\n\n newNotifications.pop();\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';\nimport {\n clearPayment, closeInvoice,\n} from '../../reducers';\n\naddReducer('openPaymentModal', (global, actions, payload) => {\n const { messageId } = payload;\n return {\n ...global,\n payment: {\n ...global.payment,\n messageId,\n isPaymentModalOpen: true,\n },\n };\n});\n\naddReducer('closePaymentModal', (global) => {\n const newGlobal = clearPayment(global);\n return closeInvoice(newGlobal);\n});\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 RE_TME_INVITE_LINK,\n RE_TME_LINK,\n TIPS_USERNAME,\n LOCALIZED_TIPS,\n} from '../../../config';\nimport { callApi } from '../../../api/gramjs';\nimport {\n addChats,\n addUsers,\n replaceThreadParam,\n updateChatListIds,\n updateChats,\n updateChat,\n updateChatListSecondaryInfo,\n updateManagementProgress,\n} from '../../reducers';\nimport {\n selectChat,\n selectCurrentChat,\n selectUser,\n selectChatListType,\n selectIsChatPinned,\n selectChatFolder,\n selectSupportChat,\n selectChatByUsername,\n selectThreadTopMessageId,\n selectCurrentMessageList,\n} from '../../selectors';\nimport { buildCollectionByKey } from '../../../util/iteratees';\nimport { debounce, pause, throttle } from '../../../util/schedulers';\nimport {\n isChatSummaryOnly, isChatArchived, prepareChatList, isChatBasicGroup,\n} from '../../helpers';\n\nconst TOP_CHATS_PRELOAD_PAUSE = 100;\n// We expect this ID does not exist\nconst TMP_CHAT_ID = -1;\n\nconst runThrottledForLoadChats = throttle((cb) => cb(), 1000, true);\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: number[] = [];\n\n for (let i = 0; i < TOP_CHAT_MESSAGES_PRELOAD_LIMIT; i++) {\n await pause(TOP_CHATS_PRELOAD_PAUSE);\n\n const {\n byId,\n listIds: { active: listIds },\n orderedPinnedIds: { active: orderedPinnedIds },\n } = getGlobal().chats;\n if (!listIds) {\n return;\n }\n\n const { chatId: currentChatId } = selectCurrentMessageList(global) || {};\n const { pinnedChats, otherChats } = prepareChatList(byId, listIds, orderedPinnedIds);\n const topChats = [...pinnedChats, ...otherChats];\n const chatToPreload = topChats.find(({ id }) => id !== currentChatId && !preloadedChatIds.includes(id));\n if (!chatToPreload) {\n return;\n }\n\n preloadedChatIds.push(chatToPreload.id);\n\n actions.loadViewportMessages({ chatId: chatToPreload.id, 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 && chat.hasUnreadMark) {\n actions.toggleChatUnread({ id });\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('openSupportChat', (global, actions) => {\n const chat = selectSupportChat(global);\n\n actions.openChat({ id: chat ? chat.id : TMP_CHAT_ID });\n\n if (chat) {\n return;\n }\n\n (async () => {\n const result = await callApi('fetchChat', { type: 'support' });\n if (result) {\n actions.openChat({ id: result.chatId });\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('loadMoreChats', (global, actions, payload) => {\n const { listType = 'active' } = payload!;\n const listIds = global.chats.listIds[listType as ('active' | 'archived')];\n const isFullyLoaded = global.chats.isFullyLoaded[listType as ('active' | 'archived')];\n\n if (isFullyLoaded) {\n return;\n }\n\n const oldestChat = listIds\n ? listIds\n .map((id) => global.chats.byId[id])\n .filter((chat) => Boolean(chat && chat.lastMessage) && !selectIsChatPinned(global, chat.id))\n .sort((chat1, chat2) => (chat1.lastMessage!.date - chat2.lastMessage!.date))[0]\n : undefined;\n\n if (oldestChat) {\n runThrottledForLoadChats(() => loadChats(listType, oldestChat.id, oldestChat.lastMessage!.date));\n } else {\n runThrottledForLoadChats(() => loadChats(listType));\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 });\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 number[])\n .map((id: number) => 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 (async () => {\n const { chatId, userId } : {chatId: number; userId: number} = payload!;\n const chat = selectChat(global, chatId);\n const user = selectUser(global, userId);\n if (!chat || !user) {\n return;\n }\n await callApi('deleteChatUser', { chat, user });\n\n const activeChat = selectCurrentMessageList(global);\n if (activeChat && activeChat.chatId === chatId && global.currentUserId === userId) {\n actions.openChat({ id: undefined });\n }\n })();\n});\n\naddReducer('deleteChat', (global, actions, payload) => {\n (async () => {\n const { chatId } : {chatId: number } = payload!;\n const chat = selectChat(global, chatId);\n if (!chat) {\n return;\n }\n await callApi('deleteChat', { chatId: chat.id });\n\n const activeChat = selectCurrentMessageList(global);\n if (activeChat && activeChat.chatId === chatId) {\n actions.openChat({ id: undefined });\n }\n })();\n});\n\naddReducer('leaveChannel', (global, actions, payload) => {\n (async () => {\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 await callApi('leaveChannel', { channelId, accessHash });\n }\n\n const activeChannel = selectCurrentMessageList(global);\n if (activeChannel && activeChannel.chatId === chatId) {\n actions.openChat({ id: undefined });\n }\n })();\n});\n\naddReducer('deleteChannel', (global, actions, payload) => {\n (async () => {\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 await callApi('deleteChannel', { channelId, accessHash });\n }\n\n const activeChannel = selectCurrentMessageList(global);\n if (activeChannel && activeChannel.chatId === chatId) {\n actions.openChat({ id: undefined });\n }\n })();\n});\n\naddReducer('createGroupChat', (global, actions, payload) => {\n const { title, memberIds, photo } = payload!;\n const members = (memberIds as number[])\n .map((id: number) => 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('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 && 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('openTelegramLink', (global, actions, payload) => {\n const { url } = payload!;\n let match = RE_TME_INVITE_LINK.exec(url);\n\n if (match) {\n const hash = match[1];\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 } else {\n match = RE_TME_LINK.exec(url)!;\n\n const username = match[1];\n const chatOrChannelPostId = match[2] ? Number(match[2]) : undefined;\n const messageId = match[3] ? Number(match[3]) : undefined;\n\n // Open message in private chat\n if (username === 'c' && chatOrChannelPostId && messageId) {\n actions.focusMessage({ chatId: -chatOrChannelPostId, messageId });\n } else {\n void openChatByUsername(actions, username, chatOrChannelPostId);\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 { username } = payload!;\n\n void openChatByUsername(actions, username);\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 = !!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 newGlobal = getGlobal();\n const chatAfterUpdate = selectChat(newGlobal, chatId);\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).map(Number),\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 && 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\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 && chat.fullInfo.members && 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 number[]).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\nasync function loadChats(listType: 'active' | 'archived', offsetId?: number, offsetDate?: number) {\n const result = await callApi('fetchChats', {\n limit: CHAT_LIST_LOAD_SLICE,\n offsetDate,\n archived: listType === 'archived',\n withPinned: getGlobal().chats.orderedPinnedIds[listType] === undefined,\n serverTimeOffset: getGlobal().serverTimeOffset,\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 let global = getGlobal();\n\n global = addUsers(global, buildCollectionByKey(result.users, 'id'));\n global = updateChats(global, buildCollectionByKey(result.chats, 'id'));\n global = updateChatListIds(global, listType, chatIds);\n global = updateChatListSecondaryInfo(global, listType, result);\n\n Object.keys(result.draftsById).map(Number).forEach((chatId) => {\n global = replaceThreadParam(\n global, chatId, MAIN_THREAD_ID, 'draft', result.draftsById[chatId],\n );\n });\n\n Object.keys(result.replyingToById).map(Number).forEach((chatId) => {\n global = replaceThreadParam(\n global, chatId, MAIN_THREAD_ID, 'replyingToId', result.replyingToById[chatId],\n );\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\nasync function loadFullChat(chat: ApiChat) {\n const result = await callApi('fetchFullChat', chat);\n if (!result) {\n return;\n }\n\n const { users, fullInfo } = result;\n\n let global = getGlobal();\n if (users) {\n global = addUsers(global, buildCollectionByKey(users, 'id'));\n }\n global = updateChat(global, chat.id, { fullInfo });\n\n setGlobal(global);\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 });\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 const createdChat = await callApi('createGroupChat', { title, users });\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().openChat({ id: chatId });\n\n if (chatId && photo) {\n await callApi('editChatPhoto', { chatId, photo });\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\nasync function openChatByUsername(\n actions: GlobalActions,\n username: string,\n channelPostId?: number,\n) {\n const global = getGlobal();\n const localChat = selectChatByUsername(global, username);\n if (localChat && !localChat.isMin) {\n if (channelPostId) {\n actions.focusMessage({ chatId: localChat.id, messageId: channelPostId });\n } else {\n actions.openChat({ id: localChat.id });\n }\n return;\n }\n\n const previousChat = selectCurrentChat(global);\n // Open temporary empty chat to make the click response feel faster\n actions.openChat({ id: TMP_CHAT_ID });\n\n const chat = await callApi('getChatByUsername', username);\n if (!chat) {\n if (previousChat) {\n actions.openChat({ id: previousChat.id });\n }\n\n actions.showNotification({ message: 'User does not exist' });\n\n return;\n }\n\n setGlobal(updateChat(getGlobal(), chat.id, chat));\n\n if (channelPostId) {\n actions.focusMessage({ chatId: chat.id, messageId: channelPostId });\n } else {\n actions.openChat({ id: chat.id });\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 ApiVideo,\n MAIN_THREAD_ID,\n MESSAGE_DELETED,\n} from '../../../api/types';\nimport { LoadMoreDirection } from '../../../types';\n\nimport { MAX_MEDIA_FILES_FOR_ALBUM, MESSAGE_LIST_SLICE } from '../../../config';\nimport { callApi, cancelApiProgress } from '../../../api/gramjs';\nimport { areSortedArraysIntersecting, buildCollectionByKey, split } 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} 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} from '../../selectors';\nimport { rafPromise, throttle } from '../../../util/schedulers';\nimport { IS_IOS } from '../../../util/environment';\n\nconst uploadProgressCallbacks = new Map();\n\nconst runThrottledForMarkRead = throttle((cb) => cb(), 1000, true);\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 { chatId, messageId, replyOriginForId } = payload!;\n const chat = selectChat(global, chatId);\n\n if (!chat) {\n return;\n }\n\n void loadMessage(chat, messageId, replyOriginForId);\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 actions.setReplyingToId({ messageId: undefined });\n actions.clearWebPagePreview({ chatId, threadId, value: false });\n\n const params = {\n ...payload,\n chat,\n replyingTo: selectReplyingToId(global, chatId, threadId),\n noWebPage: selectNoWebPage(global, chatId, threadId),\n };\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 && 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('markMessageListRead', (global, actions, payload) => {\n const { serverTimeOffset } = global;\n const currentMessageList = selectCurrentMessageList(global);\n if (!currentMessageList) {\n return;\n }\n\n const { chatId, threadId } = currentMessageList;\n const chat = selectThreadOriginChat(global, chatId, threadId);\n if (!chat) {\n return;\n }\n\n const { maxId } = payload!;\n\n runThrottledForMarkRead(() => {\n void callApi('markMessageListRead', {\n serverTimeOffset, chat, threadId, maxId,\n });\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) => {\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 && messages.length) {\n void forwardMessages(fromChat, toChat, messages);\n }\n});\n\naddReducer('loadScheduledHistory', (global) => {\n const chat = selectCurrentChat(global);\n if (!chat) {\n return;\n }\n\n const { hash } = global.scheduledMessages.byChatId[chat.id] || {};\n\n void loadScheduledHistory(chat, hash);\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 const byId = buildCollectionByKey(messages, 'id');\n const ids = Object.keys(byId).map(Number);\n\n let global = getGlobal();\n\n global = addChatMessagesById(global, chatId, byId);\n global = isOutlying\n ? updateOutlyingIds(global, chatId, threadId, ids)\n : updateListedIds(global, chatId, threadId, ids);\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 (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;\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;\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\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}) {\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\nfunction forwardMessages(\n fromChat: ApiChat,\n toChat: ApiChat,\n messages: ApiMessage[],\n) {\n callApi('forwardMessages', {\n fromChat,\n toChat,\n messages,\n serverTimeOffset: getGlobal().serverTimeOffset,\n });\n\n setGlobal({\n ...getGlobal(),\n forwardMessages: {},\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 const isUnique = (v: number, i: number, a: number[]) => a.indexOf(v) === i;\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]: [\n ...(!shouldResetVoters && voters && voters[option] ? voters[option] : []),\n ...(result && result.users.map((user) => user.id)),\n ].filter(isUnique),\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\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, historyHash?: number) {\n const result = await callApi('fetchScheduledHistory', { chat, hash: historyHash });\n if (!result) {\n return;\n }\n\n const { hash, 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, hash);\n global = replaceThreadParam(global, chat.id, MAIN_THREAD_ID, 'scheduledIds', ids);\n setGlobal(global);\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 = 500;\nconst ADDED_SETS_THROTTLE_CHUNK = 50;\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 if (!addedSetIds || !addedSetIds.length) {\n return;\n }\n\n (async () => {\n for (let i = 0; i < addedSetIds.length; i++) {\n actions.loadStickers({ stickerSetId: addedSetIds[i] });\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 } = payload!;\n let { stickerSetAccessHash } = payload!;\n\n if (!stickerSetAccessHash) {\n const stickerSet = selectStickerSet(global, stickerSetId);\n if (!stickerSet) {\n return;\n }\n\n stickerSetAccessHash = stickerSet.accessHash;\n }\n\n void loadStickers(stickerSetId, stickerSetAccessHash);\n});\n\naddReducer('loadAnimatedEmojis', () => {\n void loadAnimatedEmojis();\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 && 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 && currentEmojiKeywords.keywords),\n ...emojiKeywords.keywords,\n },\n },\n },\n });\n })();\n});\n\nasync function loadStickerSets(hash = 0) {\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 = 0) {\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 = 0) {\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 = 0) {\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) {\n const stickerSet = await callApi('fetchStickers', { stickerSetId, accessHash });\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\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\nasync function searchStickers(query: string, hash = 0) {\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 = 0) {\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 = 0) {\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 && resultsByType[type as ApiGlobalMessageSearchType]) || {};\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: globalUsers.map(({ id }) => id),\n userIds: globalChats.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 chatOrUser: 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, getGlobal, setGlobal, getDispatch,\n} from '../../../lib/teact/teactn';\n\nimport {\n ApiChat, ApiFormattedText, ApiUser, MAIN_THREAD_ID,\n} from '../../../api/types';\nimport { GlobalActions } from '../../../global/types';\n\nimport {\n CHAT_LIST_LOAD_SLICE, DEBUG, MESSAGE_LIST_SLICE,\n} from '../../../config';\nimport { callApi } from '../../../api/gramjs';\nimport { buildCollectionByKey } from '../../../util/iteratees';\nimport {\n replaceChatListIds,\n replaceChats,\n replaceUsers,\n updateUsers,\n updateChats,\n updateChatListSecondaryInfo,\n updateThreadInfos,\n replaceThreadParam,\n} from '../../reducers';\nimport {\n selectUser, selectChat, selectCurrentMessageList, selectDraft, selectChatMessage, selectThreadInfo,\n} from '../../selectors';\nimport { isChatPrivate } from '../../helpers';\n\naddReducer('sync', (global, actions) => {\n void sync(actions.afterSync);\n});\n\naddReducer('afterSync', (global, actions) => {\n void afterSync(actions);\n});\n\nasync function sync(afterSyncCallback: () => void) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('>>> START SYNC');\n }\n\n await callApi('fetchCurrentUser');\n\n // This fetches only active chats and clears archived chats, which will be fetched in `afterSync`\n const savedUsers = await loadAndReplaceChats();\n await loadAndReplaceMessages(savedUsers);\n\n setGlobal({\n ...getGlobal(),\n lastSyncTime: Date.now(),\n });\n\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('>>> FINISH SYNC');\n }\n\n afterSyncCallback();\n}\n\nasync function afterSync(actions: GlobalActions) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('>>> START AFTER-SYNC');\n }\n\n actions.loadFavoriteStickers();\n\n await Promise.all([\n loadAndUpdateUsers(),\n loadAndReplaceArchivedChats(),\n ]);\n\n await callApi('fetchCurrentUser');\n\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('>>> FINISH AFTER-SYNC');\n }\n}\n\nasync function loadAndReplaceChats() {\n const result = await callApi('fetchChats', {\n limit: CHAT_LIST_LOAD_SLICE,\n withPinned: true,\n serverTimeOffset: getGlobal().serverTimeOffset,\n });\n if (!result) {\n return undefined;\n }\n\n let global = getGlobal();\n\n const { recentlyFoundChatIds } = global.globalSearch;\n const { userIds: contactIds } = global.contactList || {};\n const { currentUserId } = global;\n\n const savedPrivateChatIds = [\n ...(recentlyFoundChatIds || []),\n ...(contactIds || []),\n ...(currentUserId ? [currentUserId] : []),\n ];\n\n const savedUsers = savedPrivateChatIds\n .map((id) => selectUser(global, id))\n .filter(Boolean as any);\n\n const savedChats = savedPrivateChatIds\n .map((id) => selectChat(global, id))\n .filter(Boolean as any);\n\n const { chatId: currentChatId } = selectCurrentMessageList(global) || {};\n if (currentChatId) {\n const selectedChat = selectChat(global, currentChatId);\n if (selectedChat && !savedPrivateChatIds.includes(currentChatId)) {\n savedChats.push(selectedChat);\n }\n\n if (isChatPrivate(currentChatId)) {\n const selectedChatUser = selectUser(global, currentChatId);\n if (selectedChatUser && !savedPrivateChatIds.includes(currentChatId)) {\n savedUsers.push(selectedChatUser);\n }\n }\n }\n\n savedUsers.push(...result.users);\n savedChats.push(...result.chats);\n\n global = replaceChats(global, buildCollectionByKey(savedChats, 'id'));\n global = replaceChatListIds(global, 'active', result.chatIds);\n\n global = {\n ...global,\n chats: {\n ...global.chats,\n },\n };\n\n global = updateChatListSecondaryInfo(global, 'active', result);\n\n Object.keys(result.draftsById).map(Number).forEach((chatId) => {\n global = replaceThreadParam(global, chatId, MAIN_THREAD_ID, 'draft', result.draftsById[chatId]);\n });\n\n Object.keys(result.replyingToById).map(Number).forEach((chatId) => {\n global = replaceThreadParam(\n global, chatId, MAIN_THREAD_ID, 'replyingToId', result.replyingToById[chatId],\n );\n });\n\n setGlobal(global);\n\n if (currentChatId && !global.chats.byId[currentChatId]) {\n getDispatch().openChat({ id: undefined });\n }\n\n return savedUsers;\n}\n\nasync function loadAndReplaceArchivedChats() {\n const result = await callApi('fetchChats', {\n limit: CHAT_LIST_LOAD_SLICE,\n archived: true,\n withPinned: true,\n serverTimeOffset: getGlobal().serverTimeOffset,\n });\n\n if (!result) {\n return;\n }\n\n let global = getGlobal();\n global = updateUsers(global, buildCollectionByKey(result.users, 'id'));\n global = updateChats(global, buildCollectionByKey(result.chats, 'id'));\n global = replaceChatListIds(global, 'archived', result.chatIds);\n global = updateChatListSecondaryInfo(global, 'archived', result);\n setGlobal(global);\n}\n\nasync function loadAndReplaceMessages(savedUsers?: ApiUser[]) {\n let areMessagesLoaded = false;\n let users = savedUsers || [];\n\n let global = getGlobal();\n const { chatId: currentChatId, threadId: currentThreadId } = selectCurrentMessageList(global) || {};\n\n // Memoize drafts\n const draftChatIds = Object.keys(global.messages.byChatId).map(Number);\n const draftsByChatId = draftChatIds.reduce>((acc, chatId) => {\n const draft = selectDraft(global, chatId, MAIN_THREAD_ID);\n return draft ? { ...acc, [chatId]: draft } : acc;\n }, {});\n\n if (currentChatId) {\n const result = await loadTopMessages(global.chats.byId[currentChatId]);\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 byId = buildCollectionByKey(result.messages, 'id');\n const listedIds = Object.keys(byId).map(Number);\n\n global = {\n ...global,\n messages: {\n ...global.messages,\n byChatId: {\n [currentChatId]: {\n byId,\n threadsById: {\n [MAIN_THREAD_ID]: {\n ...(currentMessageListInfo && currentMessageListInfo.threadsById[MAIN_THREAD_ID]),\n listedIds,\n viewportIds: listedIds,\n outlyingIds: undefined,\n },\n },\n },\n },\n },\n };\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)\n .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 && 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 && currentMessageListInfo.threadsById[currentThreadId]),\n outlyingIds: undefined,\n },\n },\n },\n },\n },\n };\n }\n }\n global = updateChats(global, buildCollectionByKey(result.chats, 'id'));\n global = updateThreadInfos(global, currentChatId, result.threadInfos);\n\n areMessagesLoaded = true;\n users = Array.prototype.concat(users, result.users);\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).map(Number).forEach((chatId) => {\n global = replaceThreadParam(global, chatId, MAIN_THREAD_ID, 'draft', draftsByChatId[chatId]);\n });\n\n if (savedUsers) {\n global = replaceUsers(global, buildCollectionByKey(users, 'id'));\n } else if (users) {\n // If `fetchChats` has failed for some reason, we don't have saved chats, thus we can not replace\n global = updateUsers(global, buildCollectionByKey(users, 'id'));\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\nasync function loadAndUpdateUsers() {\n let global = getGlobal();\n const { recentlyFoundChatIds } = global.globalSearch;\n const { userIds: contactIds } = global.contactList || {};\n if (\n (!contactIds || !contactIds.length)\n && (!recentlyFoundChatIds || !recentlyFoundChatIds.length)\n ) {\n return;\n }\n\n const users = [\n ...(recentlyFoundChatIds || []),\n ...(contactIds || []),\n ].map((id) => selectUser(global, id)).filter(Boolean as any);\n\n const updatedUsers = await callApi('fetchUsers', { users });\n if (!updatedUsers) {\n return;\n }\n\n global = getGlobal();\n global = updateUsers(global, buildCollectionByKey(updatedUsers, 'id'));\n setGlobal(global);\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 { ApiChat, ApiUser, 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 selectCurrentMediaSearchPeerId,\n selectCurrentMediaSearch, selectCurrentMessageList, selectChat, selectThreadInfo,\n} from '../../selectors';\nimport { buildCollectionByKey } from '../../../util/iteratees';\nimport {\n addChatMessagesById,\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 ? results.nextOffsetId : undefined;\n\n let topMessageId: number | undefined;\n if (threadId !== MAIN_THREAD_ID) {\n const threadInfo = selectThreadInfo(global, chatId!, threadId);\n topMessageId = threadInfo ? threadInfo.topMessageId : undefined;\n }\n\n void searchTextMessages(chat, threadId, topMessageId, query, offsetId);\n});\n\naddReducer('searchMediaMessagesLocal', (global) => {\n const peerId = selectCurrentMediaSearchPeerId(global);\n const chatOrUser = peerId\n ? global.users.byId[peerId] || global.chats.byId[peerId]\n : undefined;\n const currentSearch = selectCurrentMediaSearch(global);\n\n if (!chatOrUser || !currentSearch) {\n return;\n }\n\n const { currentType: type, resultsByType } = currentSearch;\n const currentResults = type && resultsByType && resultsByType[type];\n const offsetId = currentResults ? currentResults.nextOffsetId : undefined;\n\n if (!type) {\n return;\n }\n\n void searchSharedMedia(chatOrUser, 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 chatOrUser: ApiChat,\n threadId: number,\n topMessageId?: number,\n query?: string,\n offsetId?: number,\n) {\n const result = await callApi('searchMessagesLocal', {\n chatOrUser,\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 messages, users, 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 && query !== currentSearch.query)) {\n return;\n }\n\n global = addChatMessagesById(global, chatOrUser.id, byId);\n global = addUsers(global, buildCollectionByKey(users, 'id'));\n global = updateLocalTextSearchResults(global, chatOrUser.id, threadId, newFoundIds, totalCount, nextOffsetId);\n setGlobal(global);\n}\n\nasync function searchSharedMedia(\n chatOrUser: ApiChat | ApiUser,\n type: SharedMediaType,\n offsetId?: number,\n) {\n const result = await callApi('searchMessagesLocal', {\n chatOrUser,\n type,\n limit: SHARED_MEDIA_SLICE,\n offsetId,\n });\n\n if (!result) {\n return;\n }\n\n const {\n messages, users, 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 = addChatMessagesById(global, chatOrUser.id, byId);\n global = addUsers(global, buildCollectionByKey(users, 'id'));\n global = updateLocalMediaSearchResults(global, chatOrUser.id, type, newFoundIds, totalCount, nextOffsetId);\n setGlobal(global);\n}\n\n/**\n * @param timestamp start of target date in seconds\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 { updateManagement, updateManagementProgress } from '../../reducers';\nimport { selectChat, selectCurrentMessageList } 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","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 } from '../../../util/iteratees';\nimport { isChatPrivate } from '../../helpers';\nimport { callApi } from '../../../api/gramjs';\nimport { selectChat, selectUser } from '../../selectors';\nimport {\n addChats, addUsers, updateChat, updateManagementProgress, updateUser, updateUsers,\n updateUserSearch, updateUserSearchFetchingStatus,\n} from '../../reducers';\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 updatedUsers = await callApi('fetchUsers', { users: [user] });\n if (!updatedUsers) {\n return;\n }\n\n global = getGlobal();\n global = updateUsers(global, buildCollectionByKey(updatedUsers, 'id'));\n setGlobal(global);\n })();\n});\n\naddReducer('loadTopUsers', (global) => {\n const {\n serverTimeOffset,\n topPeers: {\n hash, lastRequestedAt,\n },\n } = global;\n\n if (!lastRequestedAt || Date.now() / 1000 + serverTimeOffset - lastRequestedAt > TOP_PEERS_REQUEST_COOLDOWN) {\n void loadTopUsers(hash);\n }\n});\n\naddReducer('loadContactList', (global) => {\n const { hash } = global.contactList || {};\n void loadContactList(hash);\n});\n\naddReducer('loadCurrentUser', () => {\n void callApi('fetchCurrentUser');\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('deleteUser', (global, actions, payload) => {\n const { userId } = payload!;\n\n void deleteUser(userId);\n});\n\nasync function loadTopUsers(usersHash?: number) {\n const result = await callApi('fetchTopUsers', { hash: usersHash });\n if (!result) {\n return;\n }\n\n const { hash, 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 hash,\n userIds: ids,\n lastRequestedAt: Date.now() / 1000 + global.serverTimeOffset,\n },\n };\n setGlobal(global);\n}\n\nasync function loadContactList(hash?: number) {\n const contactList = await callApi('fetchContactList', { hash });\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 hash: contactList.hash,\n userIds: sortedUsers.map((user) => user.id),\n },\n });\n}\n\nasync function updateContact(\n userId: number,\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 const result = await callApi('updateContact', { phone: user.phoneNumber, firstName, lastName });\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 deleteUser(userId: number) {\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('deleteUser', { id, accessHash });\n}\n\naddReducer('loadProfilePhotos', (global, actions, payload) => {\n const { profileId } = payload!;\n const isPrivate = isChatPrivate(profileId);\n const user = isPrivate ? selectUser(global, profileId) : undefined;\n const chat = !isPrivate ? selectChat(global, profileId) : undefined;\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\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\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\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 } from '../../../api/types';\nimport { InlineBotSettings } from '../../../types';\n\nimport { RE_TME_INVITE_LINK, RE_TME_LINK } from '../../../config';\nimport { callApi } from '../../../api/gramjs';\nimport {\n selectChat, selectChatBot, selectChatMessage, selectCurrentChat, selectCurrentMessageList,\n selectReplyingToId, 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';\n\nconst TOP_PEERS_REQUEST_COOLDOWN = 60000; // 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_INVITE_LINK) || button.value.match(RE_TME_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 '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({ messageId });\n actions.setInvoiceMessageInfo(selectChatMessage(global, chat.id, messageId));\n actions.openPaymentModal({ 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 if (!currentUserId || !chat) {\n return;\n }\n\n void sendBotCommand(chat, currentUserId, command);\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');\n })();\n});\n\naddReducer('loadTopInlineBots', (global) => {\n const { serverTimeOffset } = global;\n const { hash, lastRequestedAt } = global.topInlineBots;\n\n if (lastRequestedAt && Date.now() + serverTimeOffset - lastRequestedAt < TOP_PEERS_REQUEST_COOLDOWN) {\n return;\n }\n\n (async () => {\n const result = await callApi('fetchTopInlineBots', { hash });\n if (!result) {\n return;\n }\n\n const { hash: newHash, 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 hash: newHash,\n userIds: ids,\n lastRequestedAt: Date.now(),\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 });\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\nasync function searchInlineBot({\n username,\n inlineBotData,\n chatId,\n query,\n offset,\n} : {\n username: string;\n inlineBotData: InlineBotSettings;\n chatId: number;\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(chat: ApiChat, currentUserId: number, command: string) {\n await callApi('sendMessage', {\n chat,\n text: command,\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 || !result.message) {\n return;\n }\n\n const { message, alert: isError } = result;\n\n if (isError) {\n getDispatch().showDialog({ data: { message } });\n } else {\n getDispatch().showNotification({ message });\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/index';\nimport { callApi } from '../../../api/gramjs';\nimport {\n selectPaymentMessageId,\n selectPaymentRequestId,\n selectProviderPublishableKey,\n selectStripeCredentials,\n selectChatMessage,\n} from '../../selectors';\n\nimport { getStripeError } from '../../helpers/payments';\nimport { buildQueryString } from '../../../util/requestQuery';\n\nimport {\n updateShippingOptions,\n setPaymentStep,\n setRequestInfoId,\n setPaymentForm,\n setStripeCardInfo,\n setInvoiceMessageInfo,\n setReceipt,\n clearPayment,\n closeInvoice,\n} from '../../reducers';\n\naddReducer('validateRequestedInfo', (global, actions, payload) => {\n const { requestInfo, saveInfo } = payload;\n const messageId = selectPaymentMessageId(global);\n if (!messageId) {\n return;\n }\n validateRequestedInfo(messageId, requestInfo, saveInfo);\n});\n\nasync function validateRequestedInfo(messageId: number, requestInfo: any, shouldSave?: true) {\n const result = await callApi('validateRequestedInfo', { messageId, requestInfo, shouldSave });\n if (!result) {\n return;\n }\n const { id, shippingOptions } = result;\n if (!id) {\n return;\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 { messageId } = payload;\n if (!messageId) {\n return;\n }\n getPaymentForm(messageId);\n});\n\n\nasync function getPaymentForm(messageId: number) {\n const result = await callApi('getPaymentForm', { 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 if (!messageId || !receiptMessageId || !chatId) {\n return;\n }\n getReceipt(messageId, receiptMessageId, chatId);\n});\n\nasync function getReceipt(messageId: number, receiptMessageId: number, chatId: number) {\n const result = await callApi('getReceipt', receiptMessageId);\n if (!result) {\n return;\n }\n let global = getGlobal();\n const message = selectChatMessage(global, chatId, 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 publishableKey = selectProviderPublishableKey(global);\n if (!publishableKey) {\n return;\n }\n const { credentials } = payload;\n const { data } = credentials;\n sendStipeCredentials(data, publishableKey);\n});\n\naddReducer('sendPaymentForm', (global, actions, payload) => {\n const { shippingOptionId, saveCredentials } = payload;\n const messageId = selectPaymentMessageId(global);\n const requestInfoId = selectPaymentRequestId(global);\n const publishableKey = selectProviderPublishableKey(global);\n const stripeCredentials = selectStripeCredentials(global);\n if (!messageId || !publishableKey) {\n return;\n }\n sendPaymentForm(messageId, {\n save: saveCredentials,\n data: stripeCredentials,\n }, requestInfoId, shippingOptionId);\n});\n\nasync function sendStipeCredentials(data: {\n cardNumber: string;\n cardholder?: string;\n expiryMonth: string;\n expiryYear: string;\n cvv: string;\n country: string;\n zip: string;\n},\npublishableKey: string) {\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 sendPaymentForm(\n messageId: number,\n credentials: any,\n requestedInfoId?: string,\n shippingOptionId?: string,\n) {\n const result = await callApi('sendPaymentForm', {\n messageId, credentials, requestedInfoId, shippingOptionId,\n });\n if (result) {\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 { 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 { showNewMessageNotification } from '../../../util/notifications';\nimport { updateAppBadge } from '../../../util/appBadge';\nimport {\n updateChat,\n replaceChatListIds,\n updateChatListIds,\n updateChatListType,\n replaceThreadParam,\n} from '../../reducers';\nimport {\n selectChat,\n selectCommonBoxChatId,\n selectIsChatListed,\n selectChatListType,\n selectCurrentMessageList,\n selectCountNotMutedUnread, selectNotifySettings,\n} from '../../selectors';\nimport { throttle } from '../../../util/schedulers';\n\nconst TYPING_STATUS_CLEAR_DELAY = 6000; // 6 seconds\n\n// Enough to animate and mark as read in Message List\nconst CURRENT_CHAT_UNREAD_DELAY = 1000;\nconst runThrottledForUpdateAppBadge = throttle((cb) => cb(), CURRENT_CHAT_UNREAD_DELAY, true);\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 const unreadCount = selectCountNotMutedUnread(newGlobal);\n runThrottledForUpdateAppBadge(() => updateAppBadge(unreadCount));\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 const listType = selectChatListType(global, update.id);\n if (!listType) {\n break;\n }\n\n const { [listType]: listIds } = global.chats.listIds;\n\n if (listIds) {\n global = replaceChatListIds(global, listType, listIds.filter((listId) => listId !== update.id));\n }\n\n global = updateChat(global, update.id, { isNotJoined: true });\n setGlobal(global);\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 const unreadCount = selectCountNotMutedUnread(getGlobal());\n updateAppBadge(unreadCount);\n\n const { hasWebNotifications } = selectNotifySettings(global);\n if (hasWebNotifications) {\n showNewMessageNotification({\n chat,\n message,\n isActiveChat,\n });\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 && 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 && 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 && 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});\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 {\n updateChat,\n deleteChatMessages,\n updateChatMessage,\n updateListedIds,\n addViewportId,\n updateThreadInfo,\n replaceThreadParam,\n updateScheduledMessage,\n deleteChatScheduledMessages,\n} from '../../reducers';\nimport { 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} from '../../selectors';\nimport { getMessageContent, isChatPrivate, isMessageLocal } from '../../helpers';\n\nconst ANIMATION_DELAY = 350;\n\naddReducer('apiUpdate', (global, actions, update: ApiUpdate) => {\n switch (update['@type']) {\n case 'newMessage': {\n const { chatId, id, message } = update;\n global = updateWithLocalMedia(global, chatId, id, message);\n global = updateListedAndViewportIds(global, 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 && 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 });\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 setGlobal(updateChatLastMessage(getGlobal(), 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 '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 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, 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 // For some reason Telegram requires to manually mark outgoing thread messages read\n if (thread && 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 && !isChatPrivate(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 && 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});\n\nfunction updateWithLocalMedia(\n global: GlobalState, chatId: number, 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 updateListedAndViewportIds(global: GlobalState, 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 && chat.unreadCount && !selectListedIds(global, chatId, MAIN_THREAD_ID);\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: number,\n message: ApiMessage,\n force = false,\n) {\n const { chats } = global;\n const currentLastMessage = chats.byId[chatId] && 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: number) {\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: number | 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 const { threadInfo } = selectThreadByMessage(global, chatId, message) || {};\n if (threadInfo) {\n threadIdsToUpdate.push(threadInfo.threadId);\n }\n });\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: number[] = [];\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: number | 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 { deleteUser, 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: [number, ApiUserStatus][] = [];\n\nfunction scheduleStatusUpdate(userId: number, statusUpdate: ApiUserStatus) {\n pendingStatusUpdates.push([userId, statusUpdate]);\n flushStatusUpdatesThrottled();\n}\n\nfunction flushStatusUpdates() {\n let global = getGlobal();\n pendingStatusUpdates.forEach(([userId, statusUpdate]) => {\n global = updateUser(global, userId, {\n status: statusUpdate,\n });\n });\n setGlobal(global);\n\n pendingStatusUpdates = [];\n}\n\naddReducer('apiUpdate', (global, actions, update: ApiUpdate) => {\n switch (update['@type']) {\n case 'deleteUser': {\n return deleteUser(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 {\n addReducer, getGlobal, setGlobal,\n} from '../../../lib/teact/teactn';\n\nimport { ApiUpdate } from '../../../api/types';\nimport { ApiPrivacyKey } from '../../../types';\n\nimport { addBlockedContact, removeBlockedContact } 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 hash: 0,\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\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 { 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 { 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, useCallback, useMemo, memo,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { LeftColumnContent, ISettings } from '../../../types';\nimport { ApiChat } from '../../../api/types';\n\nimport {\n ANIMATION_LEVEL_MAX, APP_NAME, APP_VERSION, FEEDBACK_URL,\n} from '../../../config';\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../../util/environment';\nimport buildClassName from '../../../util/buildClassName';\nimport { pick } from '../../../util/iteratees';\nimport { isChatArchived } from '../../../modules/helpers';\nimport { formatDateToString } from '../../../util/dateFormat';\nimport { selectTheme } from '../../../modules/selectors';\nimport switchTheme from '../../../util/switchTheme';\nimport useLang from '../../../hooks/useLang';\nimport { disableHistoryBack } from '../../../hooks/useHistoryBack';\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';\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 searchQuery?: string;\n isLoading: boolean;\n currentUserId?: number;\n globalSearchChatId?: number;\n searchDate?: number;\n theme: ISettings['theme'];\n animationLevel: 0 | 1 | 2;\n chatsById?: Record;\n};\n\ntype DispatchProps = 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/';\nconst PERMANENT_VERSION_KEY = 'kz_version';\n\nconst LeftMainHeader: FC = ({\n content,\n contactsFilter,\n onSearchQuery,\n onSelectSettings,\n onSelectContacts,\n onSelectArchived,\n setGlobalSearchChatId,\n onReset,\n searchQuery,\n isLoading,\n shouldSkipTransition,\n currentUserId,\n globalSearchChatId,\n searchDate,\n theme,\n animationLevel,\n chatsById,\n openChat,\n openTipsChat,\n setGlobalSearchDate,\n setSettingOption,\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 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 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 localStorage.setItem(PERMANENT_VERSION_KEY, JSON.stringify('K'));\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\nexport default memo(withGlobal(\n (global): StateProps => {\n const {\n query: searchQuery, fetchingStatus, chatId, date,\n } = global.globalSearch;\n const { currentUserId } = global;\n const { byId: chatsById } = global.chats;\n const { 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 };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'openChat',\n 'openTipsChat',\n 'setGlobalSearchDate',\n 'setGlobalSearchChatId',\n 'setSettingOption',\n ]),\n)(LeftMainHeader));\n","import React, { memo, FC } from '../../lib/teact/teact';\n\nimport { GlobalState } from '../../global/types';\n\nimport useLang from '../../hooks/useLang';\n\nimport Spinner from '../ui/Spinner';\n\nimport './ConnectionState.scss';\n\ntype StateProps = Pick;\n\nconst ConnectionState: FC = () => {\n const lang = useLang();\n\n return (\n
\n \n
{lang('WaitingForNetwork')}
\n
\n );\n};\n\nexport default memo(ConnectionState);\n","import { useState } from '../lib/teact/teact';\n\nimport useThrottle from './useThrottle';\nimport useOnChange from './useOnChange';\nimport useHeavyAnimationCheck from './useHeavyAnimationCheck';\nimport useFlag from './useFlag';\n\nexport default (resolverFn: () => R, ms: number, dependencies: D) => {\n const runThrottled = useThrottle(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 runThrottled(() => {\n setValue(resolverFn());\n });\n }, dependencies.concat([isFrozen]));\n\n return value;\n};\n","import { useMemo } from '../lib/teact/teact';\n\nimport { throttle } from '../util/schedulers';\n\nexport default (ms: number, noFirst = false) => {\n return useMemo(() => {\n return throttle((cb) => cb(), ms, !noFirst);\n }, [ms, noFirst]);\n};\n","import React, {\n FC, memo, useCallback, useEffect, useMemo, useRef,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiChat, ApiChatFolder, ApiUser } from '../../../api/types';\nimport { GlobalActions } from '../../../global/types';\nimport { NotifyException, NotifySettings, SettingsScreens } from '../../../types';\nimport { FolderEditDispatch } from '../../../hooks/reducers/useFoldersReducer';\n\nimport { IS_TOUCH_ENV } from '../../../util/environment';\nimport { buildCollectionByKey, pick } from '../../../util/iteratees';\nimport { captureEvents, SwipeDirection } from '../../../util/captureEvents';\nimport { getFolderUnreadDialogs } from '../../../modules/helpers';\nimport { selectNotifyExceptions, selectNotifySettings } from '../../../modules/selectors';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport buildClassName from '../../../util/buildClassName';\nimport useThrottledMemo from '../../../hooks/useThrottledMemo';\nimport useLang from '../../../hooks/useLang';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\nimport captureEscKeyListener from '../../../util/captureEscKeyListener';\n\nimport Transition from '../../ui/Transition';\nimport TabList from '../../ui/TabList';\nimport ChatList from './ChatList';\n\ntype OwnProps = {\n onScreenSelect: (screen: SettingsScreens) => void;\n foldersDispatch: FolderEditDispatch;\n};\n\ntype StateProps = {\n chatsById: Record;\n usersById: Record;\n chatFoldersById: Record;\n notifySettings: NotifySettings;\n notifyExceptions?: Record;\n orderedFolderIds?: number[];\n activeChatFolder: number;\n currentUserId?: number;\n lastSyncTime?: number;\n};\n\ntype DispatchProps = Pick;\n\nconst INFO_THROTTLE = 3000;\nconst SAVED_MESSAGES_HOTKEY = '0';\n\nconst ChatFolders: FC = ({\n chatsById,\n usersById,\n chatFoldersById,\n notifySettings,\n notifyExceptions,\n orderedFolderIds,\n activeChatFolder,\n currentUserId,\n lastSyncTime,\n foldersDispatch,\n onScreenSelect,\n loadChatFolders,\n setActiveChatFolder,\n openChat,\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 = useThrottledMemo(() => {\n if (!displayedFolders || !displayedFolders.length) {\n return undefined;\n }\n\n const chatIds = Object.keys(chatsById).map(Number);\n const counters = displayedFolders.map((folder) => {\n const {\n unreadDialogsCount, hasActiveDialogs,\n } = getFolderUnreadDialogs(chatsById, usersById, folder, chatIds, notifySettings, notifyExceptions) || {};\n\n return {\n id: folder.id,\n badgeCount: unreadDialogsCount,\n isBadgeActive: hasActiveDialogs,\n };\n });\n\n return buildCollectionByKey(counters, 'id');\n }, INFO_THROTTLE, [displayedFolders, chatsById, usersById, notifySettings, notifyExceptions]);\n\n const folderTabs = useMemo(() => {\n if (!displayedFolders || !displayedFolders.length) {\n return undefined;\n }\n\n return [\n { title: lang.code === 'en' ? 'All' : lang('FilterAllChats') },\n ...displayedFolders.map((folder) => ({\n title: folder.title,\n ...(folderCountersById && folderCountersById[folder.id]),\n })),\n ];\n }, [displayedFolders, folderCountersById, lang]);\n\n const handleSwitchTab = useCallback((index: number) => {\n setActiveChatFolder(index);\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 onSwipe: ((e, direction) => {\n if (direction === SwipeDirection.Left) {\n setActiveChatFolder(Math.min(activeChatFolder + 1, folderTabs.length - 1));\n } else if (direction === SwipeDirection.Right) {\n setActiveChatFolder(Math.max(0, activeChatFolder - 1));\n }\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));\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);\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(({ title }) => title === folderTabs![activeChatFolder].title);\n\n if (!activeFolder || activeChatFolder === 0) {\n return (\n \n );\n }\n\n return (\n \n );\n }\n\n return (\n
\n {folderTabs && 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 chats: { byId: chatsById },\n users: { byId: usersById },\n chatFolders: {\n byId: chatFoldersById,\n orderedIds: orderedFolderIds,\n activeChatFolder,\n },\n currentUserId,\n lastSyncTime,\n } = global;\n\n return {\n chatsById,\n usersById,\n chatFoldersById,\n orderedFolderIds,\n lastSyncTime,\n notifySettings: selectNotifySettings(global),\n notifyExceptions: selectNotifyExceptions(global),\n activeChatFolder,\n currentUserId,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'loadChatFolders',\n 'setActiveChatFolder',\n 'openChat',\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, useCallback, 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\nconst MENU_CLOSE_DELAY_MS = 750;\nlet closeTimeout: number | undefined;\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 const handleMouseEnter = useCallback(() => {\n if (closeTimeout) {\n clearTimeout(closeTimeout);\n closeTimeout = undefined;\n }\n }, []);\n\n const handleMouseLeave = useCallback(() => {\n if (closeTimeout) {\n clearTimeout(closeTimeout);\n closeTimeout = undefined;\n }\n\n closeTimeout = window.setTimeout(() => {\n setIsMenuOpen(false);\n }, MENU_CLOSE_DELAY_MS);\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, useState, useRef, useCallback, useEffect,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalState } from '../../../global/types';\nimport { LeftColumnContent, SettingsScreens } from '../../../types';\nimport { FolderEditDispatch } from '../../../hooks/reducers/useFoldersReducer';\n\nimport { IS_TOUCH_ENV } from '../../../util/environment';\nimport { pick } from '../../../util/iteratees';\nimport buildClassName from '../../../util/buildClassName';\nimport useBrowserOnline from '../../../hooks/useBrowserOnline';\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 ConnectionState from '../ConnectionState';\nimport ChatFolders from './ChatFolders';\nimport LeftSearch from '../search/LeftSearch.async';\nimport ContactList from './ContactList.async';\nimport NewChatButton from '../NewChatButton';\nimport ShowTransition from '../../ui/ShowTransition';\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\ntype StateProps = Pick;\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 connectionState,\n}) => {\n const [isNewChatButtonShown, setIsNewChatButtonShown] = useState(IS_TOUCH_ENV);\n\n const isBrowserOnline = useBrowserOnline();\n const isConnecting = !isBrowserOnline || connectionState === 'connectionStateConnecting';\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 {() => }\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 withGlobal(\n (global): StateProps => pick(global, ['connectionState']),\n)(LeftMain);\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';\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, useState,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\nimport { LeftColumnContent, SettingsScreens } from '../../types';\n\nimport { LAYERS_ANIMATION_NAME } from '../../util/environment';\nimport captureEscKeyListener from '../../util/captureEscKeyListener';\nimport { pick } from '../../util/iteratees';\nimport useFoldersReducer from '../../hooks/reducers/useFoldersReducer';\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};\n\ntype DispatchProps = Pick;\n\nenum ContentType {\n Main,\n // eslint-disable-next-line 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 setGlobalSearchQuery,\n setGlobalSearchChatId,\n resetChatCreation,\n setGlobalSearchDate,\n loadPasswordInfo,\n clearTwoFaError,\n}) => {\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.Privacy:\n case SettingsScreens.Language:\n setSettingsScreen(SettingsScreens.Main);\n return;\n\n case SettingsScreens.GeneralChatBackground:\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 clearTwoFaError();\n\n if (settingsScreen === SettingsScreens.Privacy) {\n loadPasswordInfo();\n }\n }, [clearTwoFaError, loadPasswordInfo, settingsScreen]);\n\n const handleSettingsScreenSelect = (screen: SettingsScreens) => {\n setContent(LeftColumnContent.Settings);\n setSettingsScreen(screen);\n };\n\n return (\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\nexport default memo(withGlobal(\n (global): StateProps => {\n const {\n globalSearch: {\n query,\n date,\n },\n chatFolders: {\n activeChatFolder,\n },\n shouldSkipHistoryAnimations,\n } = global;\n return {\n searchQuery: query, searchDate: date, activeChatFolder, shouldSkipHistoryAnimations,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'setGlobalSearchQuery', 'setGlobalSearchChatId', 'resetChatCreation', 'setGlobalSearchDate',\n 'loadPasswordInfo', 'clearTwoFaError',\n ]),\n)(LeftColumn));\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\nexport default () => {\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","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;\nconst SIDE_COLUMN_MAX_WIDTH = 26.5 * REM;\nconst 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 { MessageList, MessageListType } from '../global/types';\nimport { MAIN_THREAD_ID } from '../api/types';\n\nexport const createMessageHash = (messageList: MessageList): string => (\n messageList.chatId.toString()\n + (messageList.type !== 'thread' ? `_${messageList.type}`\n : (messageList.threadId !== -1 ? `_${messageList.threadId}` : ''))\n);\n\nexport const parseMessageHash = (value: string): MessageList => {\n const [chatId, typeOrThreadId] = value.split('_');\n const isType = ['thread', 'pinned', 'scheduled'].includes(typeOrThreadId);\n\n return {\n chatId: Number(chatId),\n type: !!typeOrThreadId && isType ? (typeOrThreadId as MessageListType) : 'thread',\n threadId: !!typeOrThreadId && !isType ? Number(typeOrThreadId) : MAIN_THREAD_ID,\n };\n};\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} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions, MessageListType } from '../../global/types';\nimport { MAIN_THREAD_ID } from '../../api/types';\nimport { IAnchorPosition } from '../../types';\n\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../util/environment';\nimport { pick } from '../../util/iteratees';\nimport { isChatChannel, isChatSuperGroup } 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: number;\n threadId: number;\n messageListType: MessageListType;\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 canMute?: boolean;\n canSelect?: boolean;\n canLeave?: boolean;\n}\n\ntype DispatchProps = Pick;\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 canMute,\n canSelect,\n canLeave,\n isRightColumnShown,\n joinChannel,\n sendBotCommand,\n openLocalTextSearch,\n restartBot,\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 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 const lang = useLang();\n\n return (\n
\n {!IS_SINGLE_COLUMN_LAYOUT && canSubscribe && (\n \n {lang(isChannel ? 'Subscribe' : 'Join Group')}\n \n )}\n {!IS_SINGLE_COLUMN_LAYOUT && canStartBot && (\n \n {lang('BotStart')}\n \n )}\n {!IS_SINGLE_COLUMN_LAYOUT && canRestartBot && (\n \n {lang('BotRestart')}\n \n )}\n {!IS_SINGLE_COLUMN_LAYOUT && canSearch && (\n \n \n \n )}\n {(IS_SINGLE_COLUMN_LAYOUT || !canSubscribe) && (\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) {\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 && chat && (isChannel || isChatSuperGroup(chat)) && chat.isNotJoined,\n );\n const canSearch = isMainThread || isDiscussionThread;\n const canMute = isMainThread && !isChatWithSelf && !canSubscribe;\n const canSelect = !selectIsInSelectMode(global);\n const canLeave = isMainThread && !canSubscribe;\n\n const noMenu = !(\n (IS_SINGLE_COLUMN_LAYOUT && canSubscribe)\n || (IS_SINGLE_COLUMN_LAYOUT && canSearch)\n || canMute\n || canSelect\n || canLeave\n );\n\n return {\n noMenu,\n isChannel,\n isRightColumnShown,\n canStartBot,\n canRestartBot,\n canSubscribe,\n canSearch,\n canMute,\n canSelect,\n canLeave,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'joinChannel', 'sendBotCommand', 'openLocalTextSearch', 'restartBot',\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 thumbnail = message && getMessageMediaThumbDataUri(message);\n const { sticker } = (message && message.content) || {};\n const shouldDecodeThumbnail = thumbnail && sticker && !isWebpSupported() && thumbnail.includes('image/webp');\n const [thumbnailDecoded, setThumbnailDecoded] = useState(EMPTY_IMAGE_DATA_URI);\n const messageId = message && message.id;\n\n useLayoutEffect(() => {\n if (!shouldDecodeThumbnail) {\n return;\n }\n\n webpToPngBase64(`b64-${messageId}`, thumbnail!)\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, thumbnail]);\n\n return shouldDecodeThumbnail ? thumbnailDecoded : thumbnail;\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 && 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, getMessageSummaryText } from '../../modules/helpers';\nimport renderText from '../common/helpers/renderText';\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';\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 = getMessageSummaryText(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

{renderText(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","import React, { FC, useCallback } from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\nimport {\n ApiAudio, ApiChat, ApiMessage, ApiUser,\n} from '../../api/types';\n\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../util/environment';\nimport * as mediaLoader from '../../util/mediaLoader';\nimport {\n getMediaDuration, getMessageAudio, getMessageKey, getMessageMediaHash, getSenderTitle,\n} from '../../modules/helpers';\nimport { selectSender } from '../../modules/selectors';\nimport { pick } from '../../util/iteratees';\nimport renderText from '../common/helpers/renderText';\nimport useAudioPlayer from '../../hooks/useAudioPlayer';\nimport buildClassName from '../../util/buildClassName';\nimport useLang from '../../hooks/useLang';\n\nimport RippleEffect from '../ui/RippleEffect';\nimport Button from '../ui/Button';\n\nimport './AudioPlayer.scss';\n\ntype OwnProps = {\n message: ApiMessage;\n className?: string;\n noUi?: boolean;\n};\n\ntype StateProps = {\n sender?: ApiChat | ApiUser;\n};\n\ntype DispatchProps = Pick;\n\nconst AudioPlayer: FC = ({\n message, className, noUi, sender, focusMessage, closeAudioPlayer,\n}) => {\n const lang = useLang();\n\n const senderName = sender ? getSenderTitle(lang, sender) : undefined;\n const mediaData = mediaLoader.getFromMemory(getMessageMediaHash(message, 'inline')!) as (string | undefined);\n const { playPause, isPlaying } = useAudioPlayer(\n getMessageKey(message), getMediaDuration(message)!, mediaData, undefined, undefined, true,\n );\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 }, [closeAudioPlayer, isPlaying, playPause]);\n\n if (noUi) {\n return undefined;\n }\n\n const audio = getMessageAudio(message);\n\n return (\n
\n \n \n \n \n\n
\n {audio ? renderAudio(audio) : renderVoice(lang('AttachAudio'), senderName)}\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\n return { sender };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['focusMessage', 'closeAudioPlayer']),\n)(AudioPlayer);\n","import React, {\n FC, useCallback, useMemo, memo, useEffect, useRef, useState,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\nimport cycleRestrict from '../../util/cycleRestrict';\n\nimport { GlobalActions, MessageListType } from '../../global/types';\nimport {\n ApiMessage,\n ApiChat,\n ApiTypingStatus,\n MAIN_THREAD_ID, ApiUser,\n} from '../../api/types';\nimport { NotifyException, NotifySettings } from '../../types';\n\nimport {\n MIN_SCREEN_WIDTH_FOR_STATIC_LEFT_COLUMN,\n MOBILE_SCREEN_MAX_WIDTH,\n EDITABLE_INPUT_ID,\n MIN_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN,\n SAFE_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN,\n SAFE_SCREEN_WIDTH_FOR_CHAT_INFO,\n} from '../../config';\nimport { IS_SINGLE_COLUMN_LAYOUT, IS_TABLET_COLUMN_LAYOUT } from '../../util/environment';\nimport {\n isChatPrivate,\n isChatArchived,\n getMessageKey,\n getChatTitle,\n getSenderTitle,\n selectIsChatMuted,\n} from '../../modules/helpers';\nimport {\n selectChat,\n selectChatMessage,\n selectAllowedMessageActions,\n selectIsRightColumnShown,\n selectThreadTopMessageId,\n selectThreadInfo,\n selectChatMessages,\n selectPinnedIds,\n selectIsChatWithSelf,\n selectForwardedSender,\n selectScheduledIds,\n selectIsInSelectMode,\n selectIsChatWithBot,\n selectNotifySettings,\n selectNotifyExceptions,\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 { pick } from '../../util/iteratees';\nimport { formatIntegerCompact } from '../../util/textFormat';\nimport buildClassName from '../../util/buildClassName';\nimport useLang from '../../hooks/useLang';\n\nimport PrivateChatInfo from '../common/PrivateChatInfo';\nimport GroupChatInfo from '../common/GroupChatInfo';\nimport Transition from '../ui/Transition';\nimport Button from '../ui/Button';\nimport HeaderActions from './HeaderActions';\nimport HeaderPinnedMessage from './HeaderPinnedMessage';\nimport AudioPlayer from './AudioPlayer';\n\nimport './MiddleHeader.scss';\n\nconst ANIMATION_DURATION = 350;\n\ntype OwnProps = {\n chatId: number;\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 chatsById?: Record;\n messagesCount?: number;\n isChatWithSelf?: boolean;\n isChatWithBot?: boolean;\n lastSyncTime?: number;\n notifySettings: NotifySettings;\n notifyExceptions?: Record;\n shouldSkipHistoryAnimations?: boolean;\n currentTransitionKey: number;\n};\n\ntype DispatchProps = Pick;\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 chatsById,\n messagesCount,\n isChatWithSelf,\n isChatWithBot,\n lastSyncTime,\n notifySettings,\n notifyExceptions,\n shouldSkipHistoryAnimations,\n currentTransitionKey,\n openChatWithInfo,\n pinMessage,\n focusMessage,\n openChat,\n openPreviousChat,\n loadPinnedMessages,\n toggleLeftColumn,\n exitMessageSelectMode,\n}) => {\n const lang = useLang();\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) ? pinnedMessageIds.length : (pinnedMessageIds ? 1 : 0);\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, 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 handleBackClick = useCallback((e: React.MouseEvent) => {\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 (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 return;\n }\n\n if (messageListType === 'scheduled' && isSelectModeActive) {\n exitMessageSelectMode();\n }\n\n openPreviousChat();\n }, [\n threadId, messageListType, currentTransitionKey, isSelectModeActive, openPreviousChat, shouldShowCloseButton,\n openChat, toggleLeftColumn, exitMessageSelectMode,\n ]);\n\n const unreadCount = useMemo(() => {\n if (!isLeftColumnHideable || !chatsById) {\n return undefined;\n }\n\n let isActive = false;\n\n const totalCount = Object.values(chatsById).reduce((total, currentChat) => {\n if (isChatArchived(currentChat)) {\n return total;\n }\n\n const count = currentChat.unreadCount || 0;\n if (\n count && (!selectIsChatMuted(currentChat, notifySettings, notifyExceptions) || currentChat.unreadMentionsCount)\n ) {\n isActive = true;\n }\n\n return total + count;\n }, 0);\n\n if (!totalCount) {\n return undefined;\n }\n\n return {\n isActive,\n totalCount,\n };\n }, [isLeftColumnHideable, chatsById, notifySettings, notifyExceptions]);\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);\n\n const {\n shouldRender: shouldRenderPinnedMessage,\n transitionClassNames: pinnedMessageClassNames,\n } = useShowTransition(pinnedMessage && !shouldRenderAudioPlayer);\n\n const renderingPinnedMessage = useCurrentOrPrev(pinnedMessage);\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 function renderInfo() {\n return (\n messageListType === 'thread' && threadId === MAIN_THREAD_ID ? (\n renderMainThreadInfo()\n ) : messageListType === 'thread' ? (\n <>\n {renderBackButton()}\n

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

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

\n {lang('PinnedMessagesCount', messagesCount)}\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, unreadCount)}\n
\n {isChatPrivate(chatId) ? (\n \n ) : (\n \n )}\n
\n \n );\n }\n\n function renderBackButton(asClose = false, unreadCountInfo?: typeof unreadCount) {\n return (\n
\n \n
\n \n {unreadCountInfo && (\n
\n {formatIntegerCompact(unreadCountInfo.totalCount)}\n
\n )}\n
\n );\n }\n\n return (\n
\n \n {renderInfo}\n \n\n
\n {shouldRenderPinnedMessage && renderingPinnedMessage && !shouldRenderAudioPlayer && (\n \n )}\n {shouldRenderAudioPlayer && renderingAudioMessage && (\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 { byId: chatsById } = global.chats;\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 && pinnedIds.length;\n } else if (messageListType === 'scheduled') {\n const scheduledIds = selectScheduledIds(global, chatId);\n messagesCount = scheduledIds && scheduledIds.length;\n } else if (messageListType === 'thread' && threadId !== MAIN_THREAD_ID) {\n const threadInfo = selectThreadInfo(global, chatId, threadId);\n if (threadInfo) {\n messagesCount = threadInfo.messagesCount;\n }\n }\n\n const state: StateProps = {\n typingStatus,\n isLeftColumnShown,\n isRightColumnShown: selectIsRightColumnShown(global),\n isSelectModeActive: selectIsInSelectMode(global),\n audioMessage,\n chat,\n chatsById,\n messagesCount,\n isChatWithSelf: selectIsChatWithSelf(global, chatId),\n isChatWithBot: chat && selectIsChatWithBot(global, chat),\n lastSyncTime,\n notifySettings: selectNotifySettings(global),\n notifyExceptions: selectNotifyExceptions(global),\n shouldSkipHistoryAnimations,\n currentTransitionKey: Math.max(0, global.messages.messageLists.length - 1),\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 && 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 (setGlobal, actions): DispatchProps => pick(actions, [\n 'openChatWithInfo',\n 'pinMessage',\n 'focusMessage',\n 'openChat',\n 'openPreviousChat',\n 'loadPinnedMessages',\n 'toggleLeftColumn',\n 'exitMessageSelectMode',\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 React from '../../../lib/teact/teact';\n\nimport { EDITABLE_INPUT_ID } from '../../../config';\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../../util/environment';\n\nexport function preventMessageInputBlur(e: React.MouseEvent) {\n if (\n IS_SINGLE_COLUMN_LAYOUT\n || !document.activeElement\n || document.activeElement.id !== EDITABLE_INPUT_ID\n || e.target !== e.currentTarget\n ) {\n return;\n }\n\n e.preventDefault();\n}\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, false);\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 { useMemo } from '../lib/teact/teact';\n\nimport { debounce } from '../util/schedulers';\n\nexport default function useDebounce(ms: number, shouldRunFirst?: boolean, shouldRunLast?: boolean) {\n return useMemo(() => {\n return debounce((cb) => cb(), ms, shouldRunFirst, shouldRunLast);\n }, [ms, shouldRunFirst, shouldRunLast]);\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;\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 }, (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 }: {\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 } = {},\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 && 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 && !customShape) {\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 (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\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: number,\n isFocused?: boolean,\n focusDirection?: FocusDirection,\n noFocusHighlight?: 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 );\n }\n }, [elementRef, chatId, isFocused, focusDirection, noFocusHighlight]);\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 renderText from '../common/helpers/renderText';\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 sender?: ApiUser | ApiChat;\n targetUserIds?: number[];\n targetMessage?: ApiMessage;\n targetChatId?: number;\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 sender,\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 && usersById[userId]).filter(Boolean as any)\n : undefined;\n }, [targetUserIds, usersById]);\n\n const content = renderActionMessageText(\n lang,\n message,\n sender,\n targetUsers,\n targetMessage,\n targetChatId,\n isEmbedded ? { isEmbedded: true, asPlain: true } : undefined,\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 {renderText(content as string)};\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 sender = chat && (isChatChannel(chat) || userId === message.chatId)\n ? chat\n : userId ? selectUser(global, userId) : undefined;\n\n return {\n usersById,\n sender,\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 getMessageSummaryText,\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';\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 onClick: NoneToVoidFunction;\n};\n\nconst NBSP = '\\u00A0';\n\nconst EmbeddedMessage: FC = ({\n className,\n message,\n sender,\n title,\n customText,\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)}\n
\n

\n {!message ? (\n customText || NBSP\n ) : isActionMessage(message) ? (\n \n ) : (\n renderText(getMessageSummaryText(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) {\n const { width, height } = getPictogramDimensions();\n\n return (\n \n );\n}\n\nexport default EmbeddedMessage;\n","import React, { FC, memo } from '../../../lib/teact/teact';\n\nimport { ApiMessage, ApiMessageOutgoingStatus } from '../../../api/types';\n\nimport { formatTime } from '../../../util/dateFormat';\nimport { formatIntegerCompact } from '../../../util/textFormat';\n\nimport MessageOutgoingStatus from '../../common/MessageOutgoingStatus';\nimport renderText from '../../common/helpers/renderText';\nimport useLang from '../../../hooks/useLang';\n\nimport './MessageMeta.scss';\n\ntype OwnProps = {\n message: ApiMessage;\n outgoingStatus?: ApiMessageOutgoingStatus;\n signature?: string;\n onClick: () => void;\n};\n\nconst MessageMeta: FC = ({\n message, outgoingStatus, signature, onClick,\n}) => {\n const lang = useLang();\n\n return (\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(message.date * 1000)}\n \n {outgoingStatus && (\n \n )}\n \n );\n};\n\nexport default memo(MessageMeta);\n","import React, { FC, useRef } from '../../../lib/teact/teact';\n\nimport { ApiMessage } from '../../../api/types';\n\nimport { MEMOJI_STICKER_ID } from '../../../config';\nimport { getStickerDimensions } from '../../common/helpers/mediaDimensions';\nimport { getMessageMediaFormat, getMessageMediaHash } from '../../../modules/helpers';\nimport useMedia from '../../../hooks/useMedia';\nimport useTransitionForMedia from '../../../hooks/useTransitionForMedia';\nimport buildClassName from '../../../util/buildClassName';\nimport { ObserveFn, useIsIntersecting } from '../../../hooks/useIntersectionObserver';\nimport useFlag from '../../../hooks/useFlag';\nimport useWebpThumbnail from '../../../hooks/useWebpThumbnail';\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 { isAnimated, stickerSetId } = sticker;\n const isMemojiSticker = stickerSetId === MEMOJI_STICKER_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 thumbDataUri = useWebpThumbnail(message);\n const mediaData = useMedia(\n mediaHash,\n !shouldLoad,\n getMessageMediaFormat(message, 'inline', true),\n lastSyncTime,\n );\n\n const isMediaLoaded = Boolean(mediaData);\n const [isAnimationLoaded, markAnimationLoaded] = useFlag(isMediaLoaded);\n const isMediaReady = isAnimated ? isAnimationLoaded : isMediaLoaded;\n const { shouldRenderFullMedia, transitionClassNames } = useTransitionForMedia(isMediaReady, 'slow');\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 return (\n
\n {!isMediaReady && (\n \n )}\n {!isAnimated && shouldRenderFullMedia && (\n \n )}\n {isAnimated && 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","const SELECTED_APPENDIX_BACKGROUND = Promise.resolve('rgba(255,255,255,1)');\n\nexport default function getCustomAppendixBg(src: string, isOwn: boolean, inSelectMode?: boolean, isSelected?: boolean) {\n return isSelected ? SELECTED_APPENDIX_BACKGROUND : 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 { 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 useMediaWithDownloadProgress from '../../../hooks/useMediaWithDownloadProgress';\nimport useTransitionForMedia from '../../../hooks/useTransitionForMedia';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport useBlurredMediaThumbRef from './hooks/useBlurredMediaThumbRef';\nimport usePrevious from '../../../hooks/usePrevious';\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 shouldAutoLoad?: 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 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 shouldAutoLoad,\n isInSelectMode,\n isSelected,\n uploadProgress,\n size = 'inline',\n dimensions,\n nonInteractive,\n shouldAffectAppendix,\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 [isDownloadAllowed, setIsDownloadAllowed] = useState(shouldAutoLoad);\n const shouldDownload = isDownloadAllowed && isIntersecting;\n const {\n mediaData, downloadProgress,\n } = useMediaWithDownloadProgress(getMessageMediaHash(message, size), !shouldDownload);\n const fullMediaData = localBlobUrl || mediaData;\n const thumbRef = useBlurredMediaThumbRef(message, fullMediaData);\n\n const {\n isUploading, isTransferring, transferProgress,\n } = getMediaTransferState(message, uploadProgress || downloadProgress, shouldDownload && !fullMediaData);\n const wasDownloadDisabled = usePrevious(isDownloadAllowed) === false;\n const {\n shouldRender: shouldRenderSpinner,\n transitionClassNames: spinnerClassNames,\n } = useShowTransition(isTransferring, undefined, wasDownloadDisabled, 'slow');\n const {\n shouldRenderThumb, shouldRenderFullMedia, transitionClassNames,\n } = useTransitionForMedia(fullMediaData, 'slow');\n\n const handleClick = useCallback(() => {\n if (isUploading) {\n if (onCancelUpload) {\n onCancelUpload(message);\n }\n } else if (!fullMediaData) {\n setIsDownloadAllowed((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).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]);\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 {shouldRenderThumb && (\n \n )}\n {shouldRenderFullMedia && (\n \n )}\n {shouldRenderSpinner && (\n
\n \n
\n )}\n {!fullMediaData && !isDownloadAllowed && (\n \n )}\n {isTransferring && (\n {Math.round(transferProgress * 100)}%\n )}\n \n );\n};\n\nexport default Photo;\n","import { RefObject } from 'react';\nimport { useCallback, useRef } from '../lib/teact/teact';\n\nimport useHeavyAnimationCheck from './useHeavyAnimationCheck';\nimport safePlay from '../util/safePlay';\n\nexport default function useHeavyAnimationCheckForVideo(playerRef: RefObject, shouldPlay: boolean) {\n const shouldPlayRef = useRef();\n shouldPlayRef.current = shouldPlay;\n\n const pause = useCallback(() => {\n if (playerRef.current) {\n playerRef.current.pause();\n }\n }, [playerRef]);\n\n const play = useCallback(() => {\n if (playerRef.current && shouldPlayRef.current) {\n safePlay(playerRef.current);\n }\n }, [playerRef]);\n\n useHeavyAnimationCheck(pause, play);\n}\n","import { useCallback, useRef } from '../../../../lib/teact/teact';\nimport { fastRaf } from '../../../../util/schedulers';\nimport useBackgroundMode from '../../../../hooks/useBackgroundMode';\nimport safePlay from '../../../../util/safePlay';\n\nexport default (playerRef: { current: HTMLVideoElement | null }, isPlayAllowed = false) => {\n const wasPlaying = useRef(false);\n const isFrozen = useRef(false);\n\n const freezePlaying = useCallback(() => {\n isFrozen.current = true;\n\n if (!isPlayAllowed || !playerRef.current) {\n return;\n }\n\n if (!wasPlaying.current) {\n wasPlaying.current = !playerRef.current.paused;\n }\n\n playerRef.current.pause();\n }, [isPlayAllowed, playerRef]);\n\n const unfreezePlaying = useCallback(() => {\n // At this point HTMLVideoElement can be unmounted from the DOM\n if (isPlayAllowed && playerRef.current && wasPlaying.current && document.body.contains(playerRef.current)) {\n safePlay(playerRef.current);\n }\n\n wasPlaying.current = false;\n isFrozen.current = false;\n }, [isPlayAllowed, playerRef]);\n\n const unfreezePlayingOnRaf = useCallback(() => {\n fastRaf(unfreezePlaying);\n }, [unfreezePlaying]);\n\n if (!document.hasFocus()) {\n freezePlaying();\n }\n\n useBackgroundMode(freezePlaying, unfreezePlayingOnRaf);\n};\n","import React, {\n FC, useCallback, useRef, useState,\n} from '../../../lib/teact/teact';\n\nimport { 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 useMediaWithDownloadProgress from '../../../hooks/useMediaWithDownloadProgress';\nimport useMedia from '../../../hooks/useMedia';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport useTransitionForMedia from '../../../hooks/useTransitionForMedia';\nimport usePrevious from '../../../hooks/usePrevious';\nimport useBuffering from '../../../hooks/useBuffering';\nimport useHeavyAnimationCheckForVideo from '../../../hooks/useHeavyAnimationCheckForVideo';\nimport useVideoCleanup from '../../../hooks/useVideoCleanup';\nimport usePauseOnInactive from './hooks/usePauseOnInactive';\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 shouldAutoLoad?: boolean;\n shouldAutoPlay?: boolean;\n uploadProgress?: number;\n dimensions?: IMediaDimensions;\n lastSyncTime?: number;\n onClick?: (id: number) => void;\n onCancelUpload?: (message: ApiMessage) => void;\n};\n\nconst Video: FC = ({\n id,\n message,\n observeIntersection,\n noAvatars,\n shouldAutoLoad,\n shouldAutoPlay,\n uploadProgress,\n lastSyncTime,\n dimensions,\n onClick,\n onCancelUpload,\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 [isDownloadAllowed, setIsDownloadAllowed] = useState(shouldAutoLoad);\n const shouldDownload = Boolean(isDownloadAllowed && isIntersecting && lastSyncTime);\n const [isPlayAllowed, setIsPlayAllowed] = useState(shouldAutoPlay);\n\n const previewBlobUrl = useMedia(\n getMessageMediaHash(message, 'pictogram'),\n !(isIntersecting && lastSyncTime),\n getMessageMediaFormat(message, 'pictogram'),\n lastSyncTime,\n );\n const { mediaData, downloadProgress } = useMediaWithDownloadProgress(\n getMessageMediaHash(message, 'inline'),\n !shouldDownload,\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 { isBuffered, bufferingHandlers } = useBuffering(!shouldAutoLoad);\n const { isUploading, isTransferring, transferProgress } = getMediaTransferState(\n message,\n uploadProgress || downloadProgress,\n shouldDownload && !isBuffered,\n );\n const wasDownloadDisabled = usePrevious(isDownloadAllowed) === false;\n const {\n shouldRender: shouldRenderSpinner,\n transitionClassNames: spinnerClassNames,\n } = useShowTransition(isTransferring, undefined, wasDownloadDisabled);\n const { transitionClassNames } = useTransitionForMedia(fullMediaData, 'slow');\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 && 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 useHeavyAnimationCheckForVideo(videoRef, Boolean(isInline && shouldAutoPlay));\n usePauseOnInactive(videoRef, isPlayAllowed);\n useVideoCleanup(videoRef, [isInline]);\n\n const handleClick = useCallback(() => {\n if (isUploading) {\n if (onCancelUpload) {\n onCancelUpload(message);\n }\n } else if (!fullMediaData) {\n setIsDownloadAllowed((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, fullMediaData, isPlayAllowed, onClick, onCancelUpload, message]);\n\n const className = buildClassName('media-inner dark', !isUploading && 'interactive');\n const videoClassName = buildClassName('full-media', transitionClassNames);\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 {!previewBlobUrl && (\n \n )}\n {previewBlobUrl && (\n \n )}\n {isInline && (\n \n \n \n )}\n {(isDownloadAllowed && !isPlayAllowed && !shouldRenderSpinner) && (\n \n )}\n {shouldRenderSpinner && (\n
\n \n
\n )}\n {!isDownloadAllowed && (\n \n )}\n {isTransferring ? (\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 { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { ApiUser, ApiContact } from '../../../api/types';\n\nimport { selectUser } from '../../../modules/selectors';\nimport { formatPhoneNumberWithCode } from '../../../util/phoneNumber';\n\nimport Avatar from '../../common/Avatar';\n\nimport './Contact.scss';\nimport { pick } from '../../../util/iteratees';\nimport buildClassName from '../../../util/buildClassName';\n\ntype OwnProps = {\n contact: ApiContact;\n};\n\ntype StateProps = {\n user?: ApiUser;\n};\n\ntype DispatchProps = Pick;\n\nconst Contact: FC = ({\n contact, user, openUserInfo,\n}) => {\n const {\n firstName,\n lastName,\n phoneNumber,\n userId,\n } = contact;\n\n const handleClick = useCallback(() => {\n openUserInfo({ id: userId });\n }, [openUserInfo, userId]);\n\n return (\n \n \n
\n
{firstName} {lastName}
\n
{formatPhoneNumberWithCode(phoneNumber)}
\n
\n \n );\n};\n\nexport default withGlobal(\n (global, { contact }): StateProps => {\n return {\n user: selectUser(global, contact.userId),\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'openUserInfo',\n ]),\n)(Contact);\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([]);\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, {\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 && 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 { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport {\n ApiMessage, ApiPoll, ApiUser, ApiPollAnswer,\n} from '../../../api/types';\n\nimport { pick } from '../../../util/iteratees';\nimport renderText from '../../common/helpers/renderText';\nimport { renderTextWithEntities } from '../../common/helpers/renderMessageText';\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\ntype DispatchProps = Pick;\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 loadMessage,\n onSendVote,\n openPollResults,\n serverTimeOffset,\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)}
\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 (setGlobal, actions): DispatchProps => pick(actions, ['loadMessage', 'openPollResults']),\n)(Poll));\n","import React, { FC, memo, useCallback } from '../../../lib/teact/teact';\n\nimport { ApiMessage } from '../../../api/types';\nimport { ObserveFn } from '../../../hooks/useIntersectionObserver';\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 shouldAutoLoad?: boolean;\n shouldAutoPlay?: boolean;\n inPreview?: boolean;\n lastSyncTime?: number;\n onMediaClick?: () => void;\n onCancelMediaTransfer?: () => void;\n};\n\nconst WebPage: FC = ({\n message,\n observeIntersection,\n noAvatars,\n shouldAutoLoad,\n shouldAutoPlay,\n inPreview,\n lastSyncTime,\n onMediaClick,\n onCancelMediaTransfer,\n}) => {\n const webPage = getMessageWebPage(message);\n\n let isSquarePhoto = false;\n if (webPage && 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 renderText from '../../common/helpers/renderText';\n\nimport './Invoice.scss';\n\ntype OwnProps = {\n message: ApiMessage;\n};\n\nconst Invoice: FC = ({\n message,\n}) => {\n const invoice = getMessageInvoice(message);\n\n const {\n title,\n text,\n description,\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 {description && (\n

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

\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 { 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 { GlobalActions } from '../../../../global/types';\nimport {\n selectIsInSelectMode,\n selectIsMessageSelected,\n} from '../../../../modules/selectors';\n\nimport { pick } from '../../../../util/iteratees';\n\ntype OwnProps = PhotoProps & VideoProps;\n\ntype StateProps = {\n isInSelectMode?: boolean;\n isSelected?: boolean;\n};\n\ntype DispatchProps = Pick;\n\nexport default function withSelectControl(WrappedComponent: FC) {\n const ComponentWithSelectControl: FC = (props) => {\n const {\n isInSelectMode,\n isSelected,\n message,\n toggleMessageSelection,\n dimensions,\n } = props;\n\n const handleMessageSelect = useCallback((e: ReactMouseEvent) => {\n e.stopPropagation();\n toggleMessageSelection({ messageId: message.id, withShift: e && 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 (setGlobal, actions) => pick(actions, [\n 'toggleMessageSelection',\n ]),\n )(ComponentWithSelectControl));\n}\n","import React, { FC, useCallback } from '../../../lib/teact/teact';\n\nimport { GlobalActions, GlobalState } from '../../../global/types';\nimport { ApiMessage } from '../../../api/types';\nimport { IAlbum } from '../../../types';\nimport { AlbumRectPart, IAlbumLayout } from './helpers/calculateAlbumLayout';\n\nimport { getMessageContent } from '../../../modules/helpers';\nimport { withGlobal } from '../../../lib/teact/teactn';\nimport { pick } from '../../../util/iteratees';\nimport withSelectControl from './hocs/withSelectControl';\nimport { ObserveFn } from '../../../hooks/useIntersectionObserver';\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 shouldAutoLoad?: boolean;\n shouldAutoPlay?: boolean;\n hasCustomAppendix?: boolean;\n lastSyncTime?: number;\n isOwn: boolean;\n albumLayout: IAlbumLayout;\n onMediaClick: (messageId: number) => void;\n};\n\ntype StateProps = {\n uploadsById: GlobalState['fileUploads']['byMessageLocalId'];\n};\n\ntype DispatchProps = Pick;\n\nconst Album: FC = ({\n album,\n observeIntersection,\n shouldAutoLoad,\n shouldAutoPlay,\n hasCustomAppendix,\n lastSyncTime,\n isOwn,\n albumLayout,\n onMediaClick,\n uploadsById,\n cancelSendingMessage,\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 ? fileUpload.progress : undefined;\n const { dimensions, sides } = albumLayout.layout[index];\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): StateProps => {\n return {\n uploadsById: global.fileUploads.byMessageLocalId,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'cancelSendingMessage',\n ]),\n)(Album);\n","import React, {\n FC,\n useCallback,\n useEffect,\n useRef,\n useState,\n} from '../../../lib/teact/teact';\n\nimport { ApiMessage } from '../../../api/types';\n\nimport { ROUND_VIDEO_DIMENSIONS } from '../../common/helpers/mediaDimensions';\nimport { formatMediaDuration } from '../../../util/dateFormat';\nimport { getMessageMediaFormat, getMessageMediaHash } from '../../../modules/helpers';\nimport { ObserveFn, useIsIntersecting } from '../../../hooks/useIntersectionObserver';\nimport useMediaWithDownloadProgress from '../../../hooks/useMediaWithDownloadProgress';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport useTransitionForMedia from '../../../hooks/useTransitionForMedia';\nimport usePrevious from '../../../hooks/usePrevious';\nimport useBuffering from '../../../hooks/useBuffering';\nimport buildClassName from '../../../util/buildClassName';\nimport useHeavyAnimationCheckForVideo from '../../../hooks/useHeavyAnimationCheckForVideo';\nimport useVideoCleanup from '../../../hooks/useVideoCleanup';\nimport usePauseOnInactive from './hooks/usePauseOnInactive';\nimport useBlurredMediaThumbRef from './hooks/useBlurredMediaThumbRef';\nimport safePlay from '../../../util/safePlay';\nimport { fastRaf } from '../../../util/schedulers';\n\nimport ProgressSpinner from '../../ui/ProgressSpinner';\n\nimport './RoundVideo.scss';\n\ntype OwnProps = {\n message: ApiMessage;\n observeIntersection: ObserveFn;\n shouldAutoLoad?: boolean;\n shouldAutoPlay?: boolean;\n lastSyncTime?: number;\n};\n\nlet currentOnRelease: NoneToVoidFunction;\n\nfunction createCapture(onRelease: NoneToVoidFunction) {\n return () => {\n if (currentOnRelease) {\n currentOnRelease();\n }\n\n currentOnRelease = onRelease;\n };\n}\n\nconst RoundVideo: FC = ({\n message,\n observeIntersection,\n shouldAutoLoad,\n shouldAutoPlay,\n lastSyncTime,\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 [isDownloadAllowed, setIsDownloadAllowed] = useState(shouldAutoLoad && shouldAutoPlay);\n const shouldDownload = Boolean(isDownloadAllowed && isIntersecting && lastSyncTime);\n const { mediaData, downloadProgress } = useMediaWithDownloadProgress(\n getMessageMediaHash(message, 'inline'),\n !shouldDownload,\n getMessageMediaFormat(message, 'inline'),\n lastSyncTime,\n );\n const thumbRef = useBlurredMediaThumbRef(message, mediaData);\n\n const { isBuffered, bufferingHandlers } = useBuffering();\n const isTransferring = isDownloadAllowed && !isBuffered;\n const wasDownloadDisabled = usePrevious(isDownloadAllowed) === false;\n const {\n shouldRender: shouldSpinnerRender,\n transitionClassNames: spinnerClassNames,\n } = useShowTransition(isTransferring || !isBuffered, undefined, wasDownloadDisabled);\n const { shouldRenderThumb, transitionClassNames } = useTransitionForMedia(mediaData, 'slow');\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 circumference = 94 * 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 } 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 = () => {\n setIsActivated(false);\n setProgress(0);\n safePlay(playerRef.current!);\n\n fastRaf(() => {\n playingProgressRef.current!.innerHTML = '';\n });\n };\n\n const capturePlaying = createCapture(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 useHeavyAnimationCheckForVideo(playerRef, shouldPlay);\n usePauseOnInactive(playerRef, Boolean(mediaData));\n useVideoCleanup(playerRef, [mediaData]);\n\n const handleClick = useCallback(() => {\n if (!mediaData) {\n setIsDownloadAllowed((isAllowed) => !isAllowed);\n\n return;\n }\n\n const playerEl = playerRef.current!;\n if (isActivated) {\n if (playerEl.paused) {\n safePlay(playerEl);\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\n setIsActivated(true);\n }\n }, [capturePlaying, isActivated, mediaData]);\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 {(shouldRenderThumb || mediaData) && (\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 && !isDownloadAllowed && (\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';\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 return (\n
\n {message.inlineButtons!.map((row) => (\n
\n {row.map((button) => (\n onClick({ button })}\n >\n {renderText(button.text)}\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, useEffect,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport {\n ApiChat, ApiMessage, ApiThreadInfo, ApiUser,\n} from '../../../api/types';\nimport { GlobalActions } from '../../../global/types';\n\nimport { pick } from '../../../util/iteratees';\nimport { isChatPrivate } from '../../../modules/helpers';\nimport { formatIntegerCompact } from '../../../util/textFormat';\nimport buildClassName from '../../../util/buildClassName';\nimport { selectThreadInfo, selectThreadOriginChat } from '../../../modules/selectors';\nimport useLang from '../../../hooks/useLang';\n\nimport Avatar from '../../common/Avatar';\n\nimport './CommentButton.scss';\n\ntype OwnProps = {\n message: ApiMessage;\n disabled?: boolean;\n};\n\ntype StateProps = {\n threadInfo: ApiThreadInfo;\n usersById?: Record;\n chatsById?: Record;\n shouldRequestThreadUpdate: boolean;\n};\n\ntype DispatchProps = Pick;\n\nconst CommentButton: FC = ({\n disabled,\n threadInfo,\n usersById,\n chatsById,\n shouldRequestThreadUpdate,\n openChat,\n requestThreadInfoUpdate,\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\n useEffect(() => {\n if (shouldRequestThreadUpdate) {\n requestThreadInfoUpdate({ chatId, threadId });\n }\n }, [chatId, requestThreadInfoUpdate, shouldRequestThreadUpdate, threadId]);\n\n if (messagesCount === undefined) {\n return undefined;\n }\n\n const recentRepliers = recentReplierIds && recentReplierIds.map((peerId) => {\n return isChatPrivate(peerId) ? usersById![peerId] : chatsById![peerId];\n }).filter(Boolean);\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(withGlobal(\n (global, { message }) => {\n const { threadId, chatId } = message.threadInfo!;\n\n const threadInfo = selectThreadInfo(global, chatId, threadId) || message.threadInfo!;\n const chat = selectThreadOriginChat(global, chatId, threadId);\n const { byId: usersById } = global.users;\n const { byId: chatsById } = global.chats;\n\n return {\n threadInfo,\n usersById,\n chatsById,\n shouldRequestThreadUpdate: !!chat && !threadInfo.topMessageId,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'openChat',\n 'requestThreadInfoUpdate',\n ]),\n)(CommentButton));\n","import React, {\n FC,\n memo,\n useCallback,\n useEffect,\n useLayoutEffect,\n useMemo,\n useRef,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions, MessageListType } from '../../../global/types';\nimport {\n ApiMessage,\n ApiMessageOutgoingStatus,\n ApiUser,\n ApiChat,\n ApiSticker,\n MAIN_THREAD_ID,\n} from '../../../api/types';\nimport {\n FocusDirection, IAlbum, ISettings, MediaViewerOrigin,\n} from '../../../types';\n\nimport { IS_ANDROID, IS_TOUCH_ENV } from '../../../util/environment';\nimport { pick } from '../../../util/iteratees';\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 selectShouldAutoLoadMedia,\n selectShouldAutoPlayMedia,\n selectShouldLoopStickers,\n selectTheme,\n} from '../../../modules/selectors';\nimport {\n getMessageContent,\n isOwnMessage,\n isReplyMessage,\n isAnonymousOwnMessage,\n isMessageLocal,\n isChatPrivate,\n getMessageCustomShape,\n isChatChannel,\n getMessageSingleEmoji,\n getSenderTitle,\n getUserColorKey,\n} from '../../../modules/helpers';\nimport buildClassName from '../../../util/buildClassName';\nimport windowSize from '../../../util/windowSize';\nimport useEnsureMessage from '../../../hooks/useEnsureMessage';\nimport useContextMenuHandlers from '../../../hooks/useContextMenuHandlers';\nimport { renderMessageText } from '../../common/helpers/renderMessageText';\nimport { ROUND_VIDEO_DIMENSIONS } from '../../common/helpers/mediaDimensions';\nimport { buildContentClassName, isEmojiOnlyMessage } from './helpers/buildContentClassName';\nimport { getMinMediaWidth, calculateMediaDimensions } from './helpers/mediaDimensions';\nimport { calculateAlbumLayout } from './helpers/calculateAlbumLayout';\nimport { preventMessageInputBlur } from '../helpers/preventMessageInputBlur';\nimport renderText from '../../common/helpers/renderText';\nimport calculateAuthorWidth from './helpers/calculateAuthorWidth';\nimport { ObserveFn, useOnIntersect } from '../../../hooks/useIntersectionObserver';\nimport useFocusMessage from './hooks/useFocusMessage';\nimport useLang from '../../../hooks/useLang';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport useFlag from '../../../hooks/useFlag';\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';\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 message: ApiMessage;\n observeIntersectionForBottom: ObserveFn;\n observeIntersectionForMedia: ObserveFn;\n observeIntersectionForAnimatedStickers: ObserveFn;\n album?: IAlbum;\n noAvatars?: boolean;\n withAvatar?: boolean;\n withSenderName?: boolean;\n threadId: number;\n messageListType: MessageListType;\n noComments: boolean;\n appearanceOrder: number;\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 isFocused?: boolean;\n focusDirection?: FocusDirection;\n noFocusHighlight?: boolean;\n isForwarding?: boolean;\n isChatWithSelf?: boolean;\n isChannel?: boolean;\n lastSyncTime?: number;\n highlight?: string;\n isSingleEmoji?: boolean;\n animatedEmoji?: ApiSticker;\n isInSelectMode?: boolean;\n isSelected?: boolean;\n isGroupSelected?: boolean;\n threadId?: number;\n isPinnedList?: boolean;\n shouldAutoLoadMedia?: boolean;\n shouldAutoPlayMedia?: boolean;\n shouldLoopStickers?: boolean;\n};\n\ntype DispatchProps = Pick;\n\nconst NBSP = '\\u00A0';\nconst GROUP_MESSAGE_HOVER_ATTRIBUTE = 'data-is-document-group-hover';\n// eslint-disable-next-line max-len\nconst APPENDIX_OWN = '';\n// eslint-disable-next-line max-len\nconst APPENDIX_NOT_OWN = '';\nconst APPEARANCE_DELAY = 10;\nconst NO_MEDIA_CORNERS_THRESHOLD = 18;\nconst ANDROID_KEYBOARD_HIDE_DELAY_MS = 350;\n\nconst Message: FC = ({\n message,\n chatUsername,\n observeIntersectionForBottom,\n observeIntersectionForMedia,\n observeIntersectionForAnimatedStickers,\n album,\n noAvatars,\n withAvatar,\n withSenderName,\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 isFocused,\n focusDirection,\n noFocusHighlight,\n isForwarding,\n isChatWithSelf,\n isChannel,\n lastSyncTime,\n highlight,\n animatedEmoji,\n isInSelectMode,\n isSelected,\n isGroupSelected,\n threadId,\n messageListType,\n isPinnedList,\n shouldAutoLoadMedia,\n shouldAutoPlayMedia,\n shouldLoopStickers,\n focusMessage,\n openMediaViewer,\n openAudioPlayer,\n openUserInfo,\n openChat,\n cancelSendingMessage,\n markMessagesRead,\n sendPollVote,\n toggleMessageSelection,\n setReplyingToId,\n openForwardMenu,\n clickInlineButton,\n disableContextMenuHint,\n showNotification,\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 appendixRef = useRef(null);\n const lang = useLang();\n\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 { chatId, id: messageId, threadInfo } = 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 { forwardInfo, viaBotId } = message;\n const asForwarded = forwardInfo && !isChatWithSelf && !forwardInfo.isLinkedChannelPost;\n const isInDocumentGroup = !!message.groupedId && !message.isInAlbum;\n const isAlbum = Boolean(album) && album!.messages.length > 1;\n const {\n text, photo, video, audio, voice, document, sticker, contact, poll, webPage, invoice,\n } = getMessageContent(message);\n const customShape = getMessageCustomShape(message);\n const textParts = renderMessageText(message, highlight, isEmojiOnlyMessage(customShape));\n const isContextMenuShown = contextMenuPosition !== undefined;\n const signature = (\n (isChannel && message.adminTitle) || (forwardInfo && !asForwarded && forwardInfo.adminTitle) || undefined\n );\n const metaSafeAuthorWidth = useMemo(() => {\n return signature ? calculateAuthorWidth(signature) : undefined;\n }, [signature]);\n const canShowActionButton = (\n !(isContextMenuShown || isInSelectMode || isForwarding)\n && (!isInDocumentGroup || isLastInDocumentGroup)\n );\n const canForward = isChannel && !isScheduled;\n const canFocus = Boolean(isPinnedList\n || (forwardInfo && (forwardInfo.isChannelPost || (isChatWithSelf && !isOwn)) && forwardInfo.fromMessageId));\n const avatarPeer = forwardInfo && (isChatWithSelf || !sender) ? originSender : sender;\n const senderPeer = forwardInfo ? originSender : sender;\n\n const containerClassName = buildClassName(\n 'Message message-list-item',\n isFirstInGroup && 'first-in-group',\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 transitionClassNames,\n );\n const contentClassName = buildContentClassName(message, {\n hasReply,\n customShape,\n isLastInGroup,\n asForwarded,\n hasThread,\n forceSenderName,\n hasComments: message.threadInfo && message.threadInfo.messagesCount > 0,\n hasActionButton: canForward || canFocus,\n });\n const withCommentButton = message.threadInfo && (!isInDocumentGroup || isLastInDocumentGroup)\n && messageListType === 'thread' && !noComments;\n const withAppendix = contentClassName.includes('has-appendix');\n\n useEnsureMessage(chatId, hasReply ? message.replyToMessageId : undefined, replyMessage, message.id);\n useFocusMessage(ref, chatId, isFocused, focusDirection, noFocusHighlight);\n useLayoutEffect(() => {\n if (!appendixRef.current) {\n return;\n }\n\n appendixRef.current.innerHTML = isOwn ? APPENDIX_OWN : APPENDIX_NOT_OWN;\n }, [isOwn, withAppendix]);\n\n const handleGroupDocumentMessagesSelect = useCallback((e: React.MouseEvent) => {\n e.stopPropagation();\n\n toggleMessageSelection({\n messageId,\n groupedId: message.groupedId,\n });\n }, [messageId, message.groupedId, toggleMessageSelection]);\n\n const handleMessageSelect = useCallback((e?: React.MouseEvent) => {\n if (isLocal) {\n return;\n }\n\n const params = isAlbum && album && album.messages\n ? {\n messageId,\n childMessageIds: album.messages.map(({ id }) => id),\n withShift: e && e.shiftKey,\n }\n : { messageId, withShift: e && e.shiftKey };\n toggleMessageSelection(params);\n }, [isLocal, isAlbum, album, messageId, toggleMessageSelection]);\n\n const handleContainerDoubleClick = useCallback(() => {\n setReplyingToId({ messageId });\n }, [setReplyingToId, messageId]);\n\n const handleContentDoubleClick = useCallback((e: React.MouseEvent) => {\n e.stopPropagation();\n }, []);\n\n const handleMouseDown = (e: React.MouseEvent) => {\n preventMessageInputBlur(e);\n\n if (!isLocal) {\n handleBeforeContextMenu(e);\n }\n };\n\n const handleAvatarClick = useCallback(() => {\n if (!avatarPeer) {\n return;\n }\n\n if (isChatPrivate(avatarPeer.id)) {\n openUserInfo({ id: avatarPeer.id });\n } else {\n openChat({ id: avatarPeer.id });\n }\n }, [avatarPeer, openUserInfo, openChat]);\n\n const handleSenderClick = useCallback(() => {\n if (!senderPeer) {\n showNotification({ message: lang('HidAccount') });\n\n return;\n }\n\n if (isChatPrivate(senderPeer.id)) {\n openUserInfo({ id: senderPeer.id });\n } else {\n openChat({ id: senderPeer.id });\n }\n }, [senderPeer, showNotification, lang, openUserInfo, openChat]);\n\n const handleViaBotClick = useCallback(() => {\n if (!botSender) {\n return;\n }\n\n openUserInfo({ id: botSender.id });\n }, [botSender, openUserInfo]);\n\n const handleReplyClick = useCallback((): void => {\n focusMessage({\n chatId, threadId, messageId: message.replyToMessageId, replyMessageId: messageId,\n });\n }, [focusMessage, chatId, threadId, message.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 handleClick = useCallback((e: React.MouseEvent) => {\n const target = e.target as HTMLDivElement;\n if (!target.classList.contains('text-content') && !target.classList.contains('Message')) {\n return;\n }\n\n if (IS_ANDROID) {\n if (windowSize.getIsKeyboardVisible()) {\n setTimeout(() => { onContextMenu(e); }, ANDROID_KEYBOARD_HIDE_DELAY_MS);\n } else {\n onContextMenu(e);\n }\n } else {\n onContextMenu(e);\n }\n }, [onContextMenu]);\n\n const handleContextMenu = useCallback((e: React.MouseEvent) => {\n if (IS_ANDROID) {\n handleMessageSelect(e);\n } else {\n onContextMenu(e);\n }\n }, [onContextMenu, handleMessageSelect]);\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: message.groupedId });\n }, [openForwardMenu, chatId, message.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: message.groupedId, groupedChatId: chatId,\n });\n return;\n }\n focusMessage({\n chatId: forwardInfo!.fromChatId, messageId: forwardInfo!.fromMessageId,\n });\n }, [focusMessage, forwardInfo, message, chatId, isInDocumentGroup]);\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;\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 function renderAvatar() {\n const isAvatarPeerUser = avatarPeer && isChatPrivate(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 renderContent() {\n const className = buildClassName(\n 'content-inner',\n asForwarded && !customShape && 'forwarded-message',\n hasReply && 'reply-message',\n noMediaCorners && 'no-media-corners',\n );\n const hasCustomAppendix = isLastInGroup && !textParts && !asForwarded && !hasThread;\n const shouldInlineMeta = !webPage && !animatedEmoji && textParts;\n const textContentClass = buildClassName(\n 'text-content',\n shouldInlineMeta && '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 {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 {!animatedEmoji && textParts && (\n

\n {textParts}\n {shouldInlineMeta && (\n \n )}\n

\n )}\n {webPage && (\n \n )}\n {invoice && (\n \n )}\n
\n );\n }\n\n function renderSenderName() {\n const shouldRender = !(customShape && !viaBotId) && (\n (withSenderName && !photo && !video) || asForwarded || viaBotId || forceSenderName\n ) && (!isInDocumentGroup || isFirstInDocumentGroup);\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 && 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 && forwardInfo.isLinkedChannelPost ? (\n {lang('DiscussChannel')}\n ) : message.adminTitle && !isChannel ? (\n {message.adminTitle}\n ) : undefined}\n
\n );\n }\n\n return (\n \n \n {!isLocal && !isInDocumentGroup && (\n
\n {isSelected && }\n
\n )}\n {!isLocal && isLastInDocumentGroup && (\n \n {isGroupSelected && (\n \n )}\n \n )}\n {withAvatar && renderAvatar()}\n \n \n {asForwarded && !customShape && (!isInDocumentGroup || isFirstInDocumentGroup) && (\n
{lang('ForwardedMessage')}
\n )}\n {renderContent()}\n {(!isInDocumentGroup || isLastInDocumentGroup) && !(!webPage && !animatedEmoji && textParts) && (\n \n )}\n {canShowActionButton && canForward ? (\n \n \n \n ) : canShowActionButton && canFocus ? (\n \n \n \n ) : undefined}\n {withCommentButton && }\n {withAppendix &&
}\n
\n {message.inlineButtons && (\n \n )}\n \n {contextMenuPosition && (\n \n )}\n \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\nexport default memo(withGlobal(\n (global, ownProps): StateProps => {\n const { focusedMessage, forwardMessages, lastSyncTime } = global;\n const {\n message, album, withSenderName, withAvatar, threadId, messageListType,\n } = ownProps;\n const {\n id, chatId, viaBotId, replyToMessageId, isOutgoing,\n } = message;\n\n const chat = selectChat(global, chatId);\n const isChatWithSelf = selectIsChatWithSelf(global, chatId);\n const isChannel = chat && isChatChannel(chat);\n const chatUsername = chat && chat.username;\n\n const forceSenderName = !isChatWithSelf && isAnonymousOwnMessage(message);\n const canShowSender = withSenderName || withAvatar || forceSenderName;\n const sender = canShowSender ? selectSender(global, message) : undefined;\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, 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 { direction: focusDirection, noHighlight: noFocusHighlight } = (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 && album.messages) {\n isSelected = album.messages.every(({ id: messageId }) => selectIsMessageSelected(global, messageId));\n } else {\n isSelected = selectIsMessageSelected(global, id);\n }\n\n return {\n theme: selectTheme(global),\n chatUsername,\n forceSenderName,\n sender,\n originSender,\n botSender,\n shouldHideReply,\n isThreadTop,\n replyMessage,\n replyMessageSender,\n isFocused,\n isForwarding,\n isChatWithSelf,\n isChannel,\n lastSyncTime,\n highlight,\n isSingleEmoji: Boolean(singleEmoji),\n animatedEmoji: singleEmoji ? selectAnimatedEmoji(global, singleEmoji) : undefined,\n isInSelectMode: selectIsInSelectMode(global),\n isSelected,\n isGroupSelected: (\n !!message.groupedId && !message.isInAlbum && selectIsDocumentGroupSelected(global, chatId, message.groupedId)\n ),\n threadId,\n isPinnedList: messageListType === 'pinned',\n shouldAutoLoadMedia: chat ? selectShouldAutoLoadMedia(global, message, chat, sender) : undefined,\n shouldAutoPlayMedia: selectShouldAutoPlayMedia(global, message),\n shouldLoopStickers: selectShouldLoopStickers(global),\n ...(isOutgoing && { outgoingStatus: selectOutgoingStatus(global, message, messageListType === 'scheduled') }),\n ...(typeof uploadProgress === 'number' && { uploadProgress }),\n ...(isFocused && { focusDirection, noFocusHighlight }),\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'focusMessage',\n 'openMediaViewer',\n 'openAudioPlayer',\n 'cancelSendingMessage',\n 'openUserInfo',\n 'openChat',\n 'markMessagesRead',\n 'sendPollVote',\n 'toggleMessageSelection',\n 'setReplyingToId',\n 'openForwardMenu',\n 'clickInlineButton',\n 'disableContextMenuHint',\n 'showNotification',\n ]),\n)(Message));\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 ActionMessage from './ActionMessage';\n\ninterface OwnProps {\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 memoFirstUnreadIdRef: { current: number | undefined };\n threadId: number;\n type: MessageListType;\n threadTopMessageId: number | undefined;\n hasLinkedChat: boolean | undefined;\n isSchedule: boolean;\n noAppearanceAnimation: boolean;\n onFabToggle: AnyToVoidFunction;\n onNotchToggle: AnyToVoidFunction;\n openHistoryCalendar: Function;\n}\n\nconst UNREAD_DIVIDER_CLASS = 'unread-divider';\n\nconst MessageListContent: FC = ({\n messageIds,\n messageGroups,\n isViewportNewest,\n isUnread,\n withUsers,\n noAvatars,\n containerRef,\n anchorIdRef,\n memoFirstUnreadIdRef,\n threadId,\n type,\n threadTopMessageId,\n hasLinkedChat,\n isSchedule,\n noAppearanceAnimation,\n onFabToggle,\n onNotchToggle,\n openHistoryCalendar,\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 );\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 === memoFirstUnreadIdRef.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 === memoFirstUnreadIdRef.current ? unreadDivider : undefined,\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 \n \n
\n );\n};\n\nexport default memo(MessageListContent);\n","import { RefObject } from 'react';\nimport { getDispatch } from '../../../lib/teact/teactn';\nimport { useCallback, useMemo, useRef } from '../../../lib/teact/teact';\n\nimport { LoadMoreDirection } from '../../../types';\nimport { MessageListType } from '../../../global/types';\n\nimport { debounce } from '../../../util/schedulers';\nimport { useIntersectionObserver, useOnIntersect } from '../../../hooks/useIntersectionObserver';\nimport { MESSAGE_LIST_SENSITIVE_AREA } from '../../../config';\nimport resetScroll from '../../../util/resetScroll';\nimport useOnChange from '../../../hooks/useOnChange';\n\nconst FAB_THRESHOLD = 50;\nconst TOOLS_FREEZE_TIMEOUT = 100;\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) {\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 const toggleScrollTools = useCallback(() => {\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 const { offsetHeight, scrollHeight, scrollTop } = containerRef.current!;\n const scrollBottom = scrollHeight - scrollTop - offsetHeight;\n const isNearBottom = scrollBottom <= FAB_THRESHOLD;\n const isAtBottom = scrollBottom <= 0;\n\n onFabToggle(isUnread ? !isAtBottom : !isNearBottom);\n onNotchToggle(!isAtBottom);\n }, [messageIds, isViewportNewest, containerRef, onFabToggle, isUnread, onNotchToggle]);\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 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 resetScroll(containerRef.current!);\n loadMoreBackwards();\n } else if (target.className === 'forwards-trigger') {\n resetScroll(containerRef.current!);\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,\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 }, toggleScrollTools);\n\n useOnIntersect(fabTriggerRef, observeIntersectionForNotch);\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 { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\nimport { ApiSticker, ApiUpdateConnectionStateType } from '../../api/types';\n\nimport { pick } from '../../util/iteratees';\nimport { selectChat } from '../../modules/selectors';\nimport { useIntersectionObserver } from '../../hooks/useIntersectionObserver';\nimport useLang from '../../hooks/useLang';\n\nimport StickerButton from '../common/StickerButton';\n\nimport './ContactGreeting.scss';\n\ntype OwnProps = {\n userId: number;\n};\n\ntype StateProps = {\n sticker?: ApiSticker;\n lastUnreadMessageId?: number;\n connectionState?: ApiUpdateConnectionStateType;\n};\n\ntype DispatchProps = Pick;\n\nconst INTERSECTION_DEBOUNCE_MS = 200;\n\nconst ContactGreeting: FC = ({\n sticker,\n connectionState,\n lastUnreadMessageId,\n loadGreetingStickers,\n sendMessage,\n markMessageListRead,\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\n\nexport default memo(withGlobal(\n (global, { userId }): StateProps => {\n const { stickers } = global.stickers.greeting;\n const sticker = stickers && stickers.length ? stickers[userId % 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 (setGlobal, actions): DispatchProps => pick(actions, [\n 'loadGreetingStickers', 'sendMessage', 'markMessageListRead',\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: number;\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\n\nexport default memo(NoMessages);\n","import React, {\n FC, memo, useCallback, useEffect, useMemo, useRef, useState,\n} from '../../lib/teact/teact';\nimport { getGlobal, withGlobal } from '../../lib/teact/teactn';\n\nimport {\n ApiAction, ApiMessage, ApiRestrictionReason, MAIN_THREAD_ID,\n} from '../../api/types';\nimport { GlobalActions, MessageListType } from '../../global/types';\nimport { LoadMoreDirection } from '../../types';\n\nimport { ANIMATION_END_DELAY, 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 { isChatChannel, isChatGroup, isChatPrivate } from '../../modules/helpers';\nimport { orderBy, pick } 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, MessageDateGroup } 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 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';\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: number;\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};\n\ntype StateProps = {\n isChatLoaded?: boolean;\n isChannelChat?: boolean;\n isGroupChat?: boolean;\n isChatWithSelf?: 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 hasFocusHighlight?: boolean;\n isSelectModeActive?: boolean;\n animationLevel?: number;\n lastMessage?: ApiMessage;\n botDescription?: string;\n threadTopMessageId?: number;\n threadFirstMessageId?: number;\n hasLinkedChat?: boolean;\n};\n\ntype DispatchProps = Pick;\n\nconst BOTTOM_THRESHOLD = 100;\nconst UNREAD_DIVIDER_TOP = 10;\nconst UNREAD_DIVIDER_TOP_WITH_TOOLS = 60;\nconst SCROLL_DEBOUNCE = 200;\nconst FOCUSING_DURATION = 1000;\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 isCreator,\n isBot,\n messageIds,\n messagesById,\n firstUnreadId,\n isViewportNewest,\n threadFirstMessageId,\n isRestricted,\n restrictionReason,\n focusingId,\n hasFocusHighlight,\n isSelectModeActive,\n loadViewportMessages,\n setScrollOffset,\n lastMessage,\n botDescription,\n threadTopMessageId,\n hasLinkedChat,\n openHistoryCalendar,\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 memoUnreadDividerBeforeIdRef = useRef();\n // Updated every time (to be used from intersection callback closure)\n const memoFirstUnreadIdRef = 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 useOnChange(() => {\n memoFirstUnreadIdRef.current = firstUnreadId;\n\n // Updated only once (to preserve divider even after messages are read)\n if (!memoUnreadDividerBeforeIdRef.current) {\n memoUnreadDividerBeforeIdRef.current = firstUnreadId;\n }\n }, [firstUnreadId]);\n\n useOnChange(() => {\n memoFocusingIdRef.current = focusingId;\n }, [focusingId]);\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 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 handleScroll = useCallback(() => {\n if (isScrollTopJustUpdatedRef.current) {\n isScrollTopJustUpdatedRef.current = false;\n return;\n }\n\n const container = containerRef.current!;\n\n if (!memoFocusingIdRef.current) {\n updateStickyDates(container, hasTools);\n }\n\n runDebouncedForScroll(() => {\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 if (isReady) {\n containerRef.current!.dataset.normalHeight = String(containerRef.current!.offsetHeight);\n }\n }, [windowHeight, isReady]);\n\n // Initial message loading\n useEffect(() => {\n if (!loadMoreAround || !isChatLoaded || isRestricted || focusingId) {\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 || !isReady) {\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, isReady]);\n\n // Handles updated message list, takes care of scroll repositioning\n useLayoutEffectWithPrevDeps(([\n prevMessageIds, prevIsViewportNewest, prevContainerHeight,\n ]: [\n typeof messageIds, typeof isViewportNewest, typeof containerHeight\n ]) => {\n const container = containerRef.current!;\n listItemElementsRef.current = Array.from(container.querySelectorAll('.message-list-item'));\n\n // During animation\n if (!container.offsetParent) {\n return;\n }\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 && (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 }, FOCUSING_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 // If two messages come at once (e.g. via Quiz Bot) then the first message will update `scrollOffset`\n // right away (before animation) which creates inconsistency until the animation completes.\n // To workaround that, we calculate `isAtBottom` with a \"buffer\" of the latest message height (this is approximate).\n const lastItemHeight = lastItemElement ? lastItemElement.offsetHeight : 0;\n const isAtBottom = isViewportNewest && prevIsViewportNewest && (\n scrollOffset - (prevContainerHeight || offsetHeight) - lastItemHeight <= BOTTOM_THRESHOLD\n );\n\n let newScrollTop!: number;\n\n const hasFirstMessageChanged = messageIds && prevMessageIds && messageIds[0] !== prevMessageIds[0];\n const hasLastMessageChanged = (\n messageIds && prevMessageIds && messageIds[messageIds.length - 1] !== prevMessageIds[prevMessageIds.length - 1]\n );\n const isAlreadyFocusing = messageIds && memoFocusingIdRef.current === messageIds[messageIds.length - 1];\n\n if (isAtBottom && hasLastMessageChanged && !hasFirstMessageChanged && !isAlreadyFocusing) {\n if (lastItemElement) {\n fastRaf(() => {\n fastSmoothScroll(\n container,\n lastItemElement,\n 'end',\n BOTTOM_FOCUS_MARGIN,\n undefined,\n undefined,\n undefined,\n true,\n );\n });\n }\n\n newScrollTop = scrollHeight - offsetHeight;\n scrollOffsetRef.current = Math.max(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 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, newScrollTop);\n\n if (!memoFocusingIdRef.current) {\n isScrollTopJustUpdatedRef.current = true;\n fastRaf(() => {\n isScrollTopJustUpdatedRef.current = false;\n });\n }\n\n scrollOffsetRef.current = Math.max(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]);\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 && isChatPrivate(chatId));\n const withUsers = Boolean((!isPrivate && !isChannelChat) || isChatWithSelf);\n const noAvatars = Boolean(!withUsers || isChannelChat);\n const shouldRenderGreeting = isChatPrivate(chatId) && !isChatWithSelf && !isBot\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 || checkSingleMessageActionByType('contactSignUp', messageGroups)\n || (lastMessage && lastMessage.content.action && lastMessage.content.action.type === 'contactSignUp')\n );\n const isGroupChatJustCreated = isGroupChat && isCreator\n && checkSingleMessageActionByType('chatCreate', messageGroups);\n\n const className = buildClassName(\n 'MessageList custom-scroll',\n noAvatars && 'no-avatars',\n !canPost && 'no-composer',\n type === 'pinned' && 'type-pinned',\n hasFocusHighlight && 'has-focus-highlight',\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\nfunction checkSingleMessageActionByType(type: ApiAction['type'], messageGroups?: MessageDateGroup[]) {\n return messageGroups\n && messageGroups.length === 1\n && messageGroups[0].senderGroups.length === 1\n && messageGroups[0].senderGroups[0].length === 1\n && 'content' in messageGroups[0].senderGroups[0][0]\n && messageGroups[0].senderGroups[0][0].content.action\n && messageGroups[0].senderGroups[0][0].content.action.type === type;\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 const hasFocusHighlight = focusingId ? !global.focusedMessage!.noHighlight : undefined;\n\n const withLastMessageWhenPreloading = (\n threadId === MAIN_THREAD_ID\n && !messageIds && !chat.unreadCount && !focusingId && lastMessage && !lastMessage.groupedId\n );\n\n const bot = selectChatBot(global, chatId);\n let botDescription: string | undefined;\n if (selectIsChatBotNotStarted(global, chatId)) {\n const chatBot = selectChatBot(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 isBot: Boolean(bot),\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 hasFocusHighlight,\n isSelectModeActive: selectIsInSelectMode(global),\n botDescription,\n threadTopMessageId,\n hasLinkedChat: chat.fullInfo && ('linkedChatId' in chat.fullInfo)\n ? Boolean(chat.fullInfo.linkedChatId)\n : undefined,\n ...(withLastMessageWhenPreloading && { lastMessage }),\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'loadViewportMessages',\n 'setScrollOffset',\n 'openHistoryCalendar',\n ]),\n)(MessageList));\n","import React, {\n FC, useCallback, memo, useRef,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions, 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 { pick } from '../../util/iteratees';\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};\n\ntype StateProps = {\n messageListType?: MessageListType;\n unreadCount?: number;\n};\n\ntype DispatchProps = Pick;\n\nconst FOCUS_MARGIN = 20;\n\nconst ScrollDownButton: FC = ({\n isShown,\n canPost,\n messageListType,\n unreadCount,\n focusNextReply,\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 );\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 (setGlobal, actions): DispatchProps => pick(actions, ['focusNextReply']),\n)(ScrollDownButton));\n","import { ApiAttachment } from '../../../../api/types';\nimport { preloadImage, preloadVideo, createPosterForVideo } from '../../../../util/files';\n\nconst MAX_QUICK_VIDEO_SIZE = 10 * 1024 ** 2; // 10 MB\nconst MAX_QUICK_IMG_SIZE = 1280; // px\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 (mimeType.startsWith('image/')) {\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 newBlob = await squeezeImage(img);\n if (newBlob) {\n URL.revokeObjectURL(blobUrl);\n return buildAttachment(filename, newBlob, true, options);\n } else {\n return buildAttachment(filename, blob, false, options);\n }\n }\n\n quick = { width, height };\n } else {\n previewBlobUrl = blobUrl;\n }\n } else if (mimeType.startsWith('video/')) {\n // Videos < 10 MB are always sent in quick mode (in other clients).\n // Quick mode for videos > 10 MB is not supported until client-side video squeezing is implemented.\n if (size < MAX_QUICK_VIDEO_SIZE) {\n const { videoWidth: width, videoHeight: height, duration } = await preloadVideo(blobUrl);\n quick = { width, height, duration };\n }\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\nfunction squeezeImage(img: HTMLImageElement): Promise {\n return new Promise((resolve) => {\n const canvas = document.createElement('canvas');\n const ctx = canvas.getContext('2d')!;\n\n let { width, height } = img;\n\n if (width > MAX_QUICK_IMG_SIZE || height > MAX_QUICK_IMG_SIZE) {\n if (width >= height) {\n height *= MAX_QUICK_IMG_SIZE / width;\n width = MAX_QUICK_IMG_SIZE;\n } else {\n width *= MAX_QUICK_IMG_SIZE / height;\n height = MAX_QUICK_IMG_SIZE;\n }\n }\n\n canvas.width = width;\n canvas.height = height;\n\n ctx.drawImage(img, 0, 0, img.width, img.height, 0, 0, width, height);\n canvas.toBlob(resolve, 'image/jpeg', 100);\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","export default __webpack_public_path__ + \"c0155344d336103c2b6a0b28cc510750.js\";","// @ts-ignore\nimport encoderPath from 'file-loader!opus-recorder/dist/encoderWorker.min';\n\nexport type Result = { blob: Blob; duration: number; waveform: number[] };\n\ninterface OpusRecorder extends Omit {\n new(options: AnyLiteral): OpusRecorder;\n\n start(stream?: MediaStreamAudioSourceNode): void;\n\n sourceNode: MediaStreamAudioSourceNode;\n\n ondataavailable: (typedArray: Uint8Array) => void;\n}\n\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: OpusRecorder }>;\nlet OpusRecorder: OpusRecorder;\nlet mediaRecorder: OpusRecorder;\n\nexport async function init() {\n if (!opusRecorderPromise) {\n // @ts-ignore\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: OpusRecorder, 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';\n\nconst CLIPBOARD_ACCEPTED_TYPES = ['image/png', 'image/jpeg', 'image/gif'];\nconst MAX_MESSAGE_LENGTH = 4096;\n\nexport default (\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 const { items } = e.clipboardData;\n const media = Array.from(items).find((item) => CLIPBOARD_ACCEPTED_TYPES.includes(item.type));\n const file = media && media.getAsFile();\n const pastedText = e.clipboardData.getData('text').substring(0, MAX_MESSAGE_LENGTH);\n\n if (!file && !pastedText) {\n return;\n }\n\n e.preventDefault();\n\n if (file && !editedMessage) {\n const attachment = await buildAttachment(file.name, file, true);\n setAttachments((attachments) => [\n ...attachments,\n attachment,\n ]);\n }\n\n if (pastedText) {\n insertTextAndUpdateCursor(pastedText, input ? input.id : undefined);\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","import { ApiFormattedText } from '../../../../api/types';\nimport { renderTextWithEntities } from '../../../common/helpers/renderMessageText';\n\nexport default function getMessageTextAsHtml(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","import { useCallback, useEffect, useMemo } from '../../../../lib/teact/teact';\n\nimport { ApiFormattedText, ApiMessage } from '../../../../api/types';\nimport { GlobalActions } from '../../../../global/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 '../helpers/parseMessageInput';\nimport getMessageTextAsHtml from '../helpers/getMessageTextAsHtml';\nimport useBackgroundMode from '../../../../hooks/useBackgroundMode';\nimport useBeforeUnload from '../../../../hooks/useBeforeUnload';\nimport { IS_TOUCH_ENV } from '../../../../util/environment';\n\n// Used to avoid running debounced callbacks when chat changes.\nlet currentChatId: number | undefined;\nlet currentThreadId: number | undefined;\n\nexport default (\n draft: ApiFormattedText | undefined,\n chatId: number,\n threadId: number,\n html: string,\n htmlRef: { current: string },\n setHtml: (html: string) => void,\n editedMessage: ApiMessage | undefined,\n saveDraft: GlobalActions['saveDraft'],\n clearDraft: GlobalActions['clearDraft'],\n) => {\n const updateDraft = useCallback((draftChatId: number, draftThreadId: number) => {\n if (htmlRef.current.length && !editedMessage) {\n saveDraft({ chatId: draftChatId, threadId: draftThreadId, draft: parseMessageInput(htmlRef.current!) });\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(getMessageTextAsHtml(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 // 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","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';\n\nconst tempEl = document.createElement('div');\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;\n\nexport default function useInlineBotTooltip(\n isAllowed: boolean,\n chatId: number,\n html: string,\n inlineBots?: Record,\n) {\n const [isOpen, markIsOpen, unmarkIsOpen] = useFlag();\n const text = getPlainText(html);\n const { queryInlineBot, resetInlineBot } = getDispatch();\n const { username, query, canShowHelp } = parseStartWithUsernameString(text);\n const usernameLowered = username.toLowerCase();\n const prevQuery = usePrevious(query);\n const prevUsername = usePrevious(username);\n const inlineBotData = inlineBots && inlineBots[usernameLowered];\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 && 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 closeTooltip: unmarkIsOpen,\n loadMore,\n username,\n id: botId,\n isGallery,\n switchPm,\n results,\n help: canShowHelp && help ? `@${username} ${help}` : undefined,\n };\n}\n\nfunction getPlainText(html: string) {\n tempEl.innerHTML = html.replace(/
/g, '\\n');\n\n return tempEl.innerText;\n}\n\nfunction parseStartWithUsernameString(text: string) {\n const result = text.match(INLINE_BOT_QUERY_REGEXP);\n if (!result) {\n return { username: '', query: '', canShowHelp: false };\n }\n\n return {\n username: result[1],\n query: result[2],\n canShowHelp: result[2] === '' && !text.match(HAS_NEW_LINE),\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 './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 } 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 StickerTooltipAsync;\n","import React, { FC, memo, useEffect } from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { ApiMessage } from '../../../api/types';\n\nimport { IS_TOUCH_ENV } from '../../../util/environment';\nimport { pick } from '../../../util/iteratees';\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\ntype DispatchProps = Pick;\n\nconst BotKeyboardMenu: FC = ({\n isOpen, message, onClose, clickInlineButton,\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]);\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 (setGlobal, actions): DispatchProps => pick(actions, [\n 'clickInlineButton',\n ]),\n)(BotKeyboardMenu));\n","import React, {\n FC, memo, useCallback, useEffect,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\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 { pick } from '../../../util/iteratees';\nimport useAsyncRendering from '../../right/hooks/useAsyncRendering';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport buildClassName from '../../../util/buildClassName';\nimport { isChatPrivate } 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\ntype DispatchProps = Pick;\n\nconst FORWARD_RENDERING_DELAY = 300;\n\nconst ComposerEmbeddedMessage: FC = ({\n replyingToId,\n editingId,\n message,\n sender,\n shouldAnimate,\n forwardedMessagesCount,\n setReplyingToId,\n setEditingId,\n focusMessage,\n exitForwardMode,\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 = isChatPrivate(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 (setGlobal, actions): DispatchProps => pick(actions, [\n 'setReplyingToId',\n 'setEditingId',\n 'focusMessage',\n 'exitForwardMode',\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 './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, {\n FC, memo, useEffect, useMemo,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { ApiMessage, ApiMessageEntityTypes, ApiWebPage } from '../../../api/types';\n\nimport { RE_LINK_TEMPLATE } from '../../../config';\nimport { selectNoWebPage } from '../../../modules/selectors';\nimport { pick } from '../../../util/iteratees';\nimport parseMessageInput from './helpers/parseMessageInput';\nimport useOnChange from '../../../hooks/useOnChange';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport useCurrentOrPrev from '../../../hooks/useCurrentOrPrev';\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: number;\n threadId: number;\n messageText: string;\n disabled?: boolean;\n};\n\ntype StateProps = {\n webPagePreview?: ApiWebPage;\n noWebPage?: boolean;\n};\ntype DispatchProps = Pick;\n\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 loadWebPagePreview,\n clearWebPagePreview,\n toggleMessageWebPage,\n}) => {\n const link = useMemo(() => {\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 }, [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);\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 webPagePreview: global.webPagePreview,\n noWebPage,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'loadWebPagePreview', 'clearWebPagePreview', 'toggleMessageWebPage',\n ]),\n)(WebPagePreview));\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 './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, {\n FC, memo, useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions, 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} from '../../../api/types';\nimport { InlineBotSettings } from '../../../types';\n\nimport { BASE_EMOJI_KEYWORD_LANG, EDITABLE_INPUT_ID, SCHEDULED_WHEN_ONLINE } from '../../../config';\nimport { IS_VOICE_RECORDING_SUPPORTED, IS_SINGLE_COLUMN_LAYOUT, IS_IOS } from '../../../util/environment';\nimport {\n selectChat,\n selectIsChatWithBot,\n selectIsRightColumnShown,\n selectIsInSelectMode,\n selectNewestMessageWithBotKeyboardButtons,\n selectDraft,\n selectScheduledIds,\n selectEditingMessage,\n selectIsChatWithSelf,\n selectChatUser,\n selectChatMessage,\n} from '../../../modules/selectors';\nimport {\n getAllowedAttachmentOptions,\n getChatSlowModeOptions,\n isChatPrivate,\n isChatAdmin,\n} from '../../../modules/helpers';\nimport { formatMediaDuration, formatVoiceRecordDuration, getDayStartAt } from '../../../util/dateFormat';\nimport focusEditableElement from '../../../util/focusEditableElement';\nimport parseMessageInput from './helpers/parseMessageInput';\nimport buildAttachment from './helpers/buildAttachment';\nimport renderText from '../../common/helpers/renderText';\nimport insertHtmlInSelection from '../../../util/insertHtmlInSelection';\nimport deleteLastCharacterOutsideSelection from '../../../util/deleteLastCharacterOutsideSelection';\nimport { pick } from '../../../util/iteratees';\nimport buildClassName from '../../../util/buildClassName';\nimport { isSelectionInsideInput } from './helpers/selection';\nimport applyIosAutoCapitalizationFix from './helpers/applyIosAutoCapitalizationFix';\n\nimport useFlag from '../../../hooks/useFlag';\nimport useVoiceRecording from './hooks/useVoiceRecording';\nimport useClipboardPaste from './hooks/useClipboardPaste';\nimport useDraft from './hooks/useDraft';\nimport useEditing from './hooks/useEditing';\nimport usePrevious from '../../../hooks/usePrevious';\nimport useStickerTooltip from './hooks/useStickerTooltip';\nimport useEmojiTooltip from './hooks/useEmojiTooltip';\nimport useMentionTooltip from './hooks/useMentionTooltip';\nimport useContextMenuHandlers from '../../../hooks/useContextMenuHandlers';\nimport useLang from '../../../hooks/useLang';\nimport useInlineBotTooltip from './hooks/useInlineBotTooltip';\nimport windowSize from '../../../util/windowSize';\n\nimport DeleteMessageModal from '../../common/DeleteMessageModal.async';\nimport Button from '../../ui/Button';\nimport ResponsiveHoverButton from '../../ui/ResponsiveHoverButton';\nimport Spinner from '../../ui/Spinner';\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 BotKeyboardMenu from './BotKeyboardMenu';\nimport MessageInput from './MessageInput';\nimport ComposerEmbeddedMessage from './ComposerEmbeddedMessage';\nimport AttachmentModal from './AttachmentModal.async';\nimport PollModal from './PollModal.async';\nimport DropArea, { DropAreaState } from './DropArea.async';\nimport WebPagePreview from './WebPagePreview';\nimport Portal from '../../ui/Portal';\nimport CalendarModal from '../../common/CalendarModal.async';\nimport PaymentModal from '../../payment/PaymentModal.async';\nimport ReceiptModal from '../../payment/ReceiptModal.async';\n\nimport './Composer.scss';\n\ntype OwnProps = {\n chatId: number;\n threadId: number;\n messageListType: MessageListType;\n dropAreaState: string;\n isReady: boolean;\n onDropHide: NoneToVoidFunction;\n};\n\ntype StateProps = {\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 isPaymentModalOpen?: boolean;\n isReceiptModalOpen?: boolean;\n botKeyboardMessageId?: number;\n botKeyboardPlaceholder?: string;\n withScheduledButton?: boolean;\n shouldSchedule?: boolean;\n canScheduleUntilOnline?: boolean;\n stickersForEmoji?: ApiSticker[];\n groupChatMembers?: ApiChatMember[];\n currentUserId?: number;\n usersById?: Record;\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?: number[];\n isInlineBotLoading: boolean;\n inlineBots?: Record;\n} & Pick;\n\ntype DispatchProps = Pick;\n\nenum MainButtonState {\n Send = 'send',\n Record = 'record',\n Edit = 'edit',\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 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 isPaymentModalOpen,\n isReceiptModalOpen,\n botKeyboardMessageId,\n botKeyboardPlaceholder,\n withScheduledButton,\n stickersForEmoji,\n groupChatMembers,\n topInlineBotIds,\n currentUserId,\n usersById,\n lastSyncTime,\n contentToBeScheduled,\n shouldSuggestStickers,\n baseEmojiKeywords,\n emojiKeywords,\n serverTimeOffset,\n recentEmojis,\n inlineBots,\n isInlineBotLoading,\n sendMessage,\n editMessage,\n saveDraft,\n clearDraft,\n showDialog,\n setStickerSearchQuery,\n setGifSearchQuery,\n forwardMessages,\n openPollModal,\n closePollModal,\n loadScheduledHistory,\n closePaymentModal,\n openChat,\n clearReceipt,\n addRecentEmoji,\n sendInlineBotResult,\n}) => {\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 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\n // Cache for frequently updated state\n const htmlRef = useRef(html);\n useEffect(() => {\n htmlRef.current = html;\n }, [html]);\n\n useEffect(() => {\n lastMessageSendTimeSeconds.current = undefined;\n }, [chatId]);\n\n useEffect(() => {\n if (chatId && lastSyncTime && threadId === MAIN_THREAD_ID && isReady) {\n loadScheduledHistory();\n }\n }, [isReady, chatId, loadScheduledHistory, lastSyncTime, threadId]);\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 [isAttachMenuOpen, openAttachMenu, closeAttachMenu] = useFlag();\n const [isSymbolMenuOpen, openSymbolMenu, closeSymbolMenu] = 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 const mainButtonState = editingMessage\n ? MainButtonState.Edit\n : !IS_VOICE_RECORDING_SUPPORTED || activeVoiceRecording || (html && !attachments.length) || isForwarding\n ? MainButtonState.Send\n : MainButtonState.Record;\n const canShowCustomSendMenu = !shouldSchedule;\n\n const {\n isMentionTooltipOpen, mentionFilter,\n closeMentionTooltip, insertMention,\n mentionFilteredUsers,\n } = useMentionTooltip(\n !attachments.length,\n html,\n setHtml,\n undefined,\n groupChatMembers,\n topInlineBotIds,\n currentUserId,\n usersById,\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 isContextMenuOpen: isCustomSendMenuOpen,\n handleContextMenu,\n handleContextMenuClose,\n handleContextMenuHide,\n } = useContextMenuHandlers(mainButtonRef, !(mainButtonState === MainButtonState.Send && canShowCustomSendMenu));\n\n const allowedAttachmentOptions = useMemo(() => {\n return getAllowedAttachmentOptions(chat, isChatWithBot);\n }, [chat, isChatWithBot]);\n\n const isAdmin = chat && isChatAdmin(chat);\n const slowMode = getChatSlowModeOptions(chat);\n\n const { isStickerTooltipOpen, closeStickerTooltip } = useStickerTooltip(\n Boolean(shouldSuggestStickers && allowedAttachmentOptions.canSendStickers && !attachments.length),\n html,\n stickersForEmoji,\n !isReady,\n );\n const {\n isEmojiTooltipOpen, closeEmojiTooltip, filteredEmojis, insertEmoji,\n } = useEmojiTooltip(\n Boolean(shouldSuggestStickers && allowedAttachmentOptions.canSendStickers && !attachments.length),\n html,\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 }, []);\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 }, []);\n\n const resetComposer = useCallback((shouldPreserveInput = false) => {\n if (!shouldPreserveInput) {\n setHtml('');\n }\n setAttachments([]);\n closeStickerTooltip();\n closeCalendar();\n setScheduledMessageArgs(undefined);\n closeMentionTooltip();\n closeEmojiTooltip();\n\n if (IS_SINGLE_COLUMN_LAYOUT) {\n // @perf\n setTimeout(() => closeSymbolMenu(), SENDING_ANIMATION_DURATION);\n } else {\n closeSymbolMenu();\n }\n }, [closeStickerTooltip, closeCalendar, closeMentionTooltip, closeEmojiTooltip, closeSymbolMenu]);\n\n // Handle chat change\n const prevChatId = usePrevious(chatId);\n useEffect(() => {\n if (!prevChatId || chatId === prevChatId) {\n return;\n }\n\n stopRecordingVoice();\n resetComposer();\n }, [chatId, prevChatId, resetComposer, stopRecordingVoice]);\n\n const handleEditComplete = useEditing(htmlRef, setHtml, editingMessage, resetComposer, openDeleteModal, editMessage);\n useDraft(draft, chatId, threadId, html, htmlRef, setHtml, editingMessage, saveDraft, clearDraft);\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([]);\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 if (!currentAttachments.length && !text && !isForwarding) {\n return;\n }\n\n if (currentAttachments.length && text && text.length > CAPTION_MAX_LENGTH) {\n const extraLength = text.length - CAPTION_MAX_LENGTH;\n showDialog({\n data: {\n message: 'CAPTION_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 return;\n }\n\n const messageInput = document.getElementById(EDITABLE_INPUT_ID)!;\n\n if (currentAttachments.length || text) {\n if (slowMode && !isAdmin) {\n const nowSeconds = Math.floor(Date.now() / 1000) + 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 if (isForwarding) {\n forwardMessages();\n }\n\n lastMessageSendTimeSeconds.current = Math.floor(Date.now() / 1000) + 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, serverTimeOffset, clearDraft, chatId,\n resetComposer, stopRecordingVoice, showDialog, slowMode, isAdmin, sendMessage, forwardMessages, lang,\n ]);\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 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 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 handleSend(!!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 openSymbolMenu();\n }, MOBILE_KEYBOARD_HIDE_DELAY_MS);\n }, [openSymbolMenu]);\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 if (shouldSchedule) {\n if (activeVoiceRecording) {\n pauseRecordingVoice();\n }\n openCalendar();\n } else {\n handleSend();\n requestAnimationFrame(() => {\n resetComposer();\n });\n }\n break;\n case MainButtonState.Record:\n startRecordingVoice();\n break;\n case MainButtonState.Edit:\n handleEditComplete();\n break;\n default:\n break;\n }\n }, [\n mainButtonState, resetComposer, shouldSchedule, startRecordingVoice, handleEditComplete,\n activeVoiceRecording, openCalendar, pauseRecordingVoice, handleSend,\n ]);\n\n const areVoiceMessagesNotAllowed = mainButtonState === MainButtonState.Record\n && !allowedAttachmentOptions.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 : (shouldSchedule ? openCalendar : handleSend);\n\n return (\n
\n {allowedAttachmentOptions.canAttachMedia && isReady && (\n \n \n \n )}\n \n \n \n \n {renderedEditedMessage && (\n \n )}\n \n \n
\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 \n
\n
\n {activeVoiceRecording && (\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 isChatWithBot = chat ? selectIsChatWithBot(global, chat) : undefined;\n const isChatWithSelf = selectIsChatWithSelf(global, chatId);\n const messageWithActualBotKeyboard = isChatWithBot && selectNewestMessageWithBotKeyboardButtons(global, chatId);\n const scheduledIds = selectScheduledIds(global, chatId);\n const { language } = 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\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: (\n !isChatWithSelf && !isChatWithBot\n && (chat && chatUser && isChatPrivate(chatId) && chatUser.status && Boolean(chatUser.status.wasOnline))\n ),\n isRightColumnShown: selectIsRightColumnShown(global),\n isSelectModeActive: selectIsInSelectMode(global),\n withScheduledButton: (\n threadId === MAIN_THREAD_ID\n && messageListType === 'thread'\n && Boolean(scheduledIds && scheduledIds.length)\n ),\n shouldSchedule: messageListType === 'scheduled',\n botKeyboardMessageId,\n botKeyboardPlaceholder: keyboardMessage ? keyboardMessage.keyboardPlaceholder : undefined,\n isForwarding: chatId === global.forwardMessages.toChatId,\n isPollModalOpen: global.isPollModalOpen,\n stickersForEmoji: global.stickers.forEmoji.stickers,\n groupChatMembers: chat && chat.fullInfo && chat.fullInfo.members,\n topInlineBotIds: global.topInlineBots && global.topInlineBots.userIds,\n currentUserId: global.currentUserId,\n usersById: global.users.byId,\n lastSyncTime: global.lastSyncTime,\n contentToBeScheduled: global.messages.contentToBeScheduled,\n isPaymentModalOpen: global.payment.isPaymentModalOpen,\n isReceiptModalOpen: Boolean(global.payment.receipt),\n shouldSuggestStickers: global.settings.byKey.shouldSuggestStickers,\n recentEmojis: global.recentEmojis,\n baseEmojiKeywords: baseEmojiKeywords ? baseEmojiKeywords.keywords : undefined,\n emojiKeywords: emojiKeywords ? emojiKeywords.keywords : undefined,\n serverTimeOffset: global.serverTimeOffset,\n inlineBots: global.inlineBots.byUsername,\n isInlineBotLoading: global.inlineBots.isLoading,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'sendMessage',\n 'editMessage',\n 'saveDraft',\n 'clearDraft',\n 'showDialog',\n 'setStickerSearchQuery',\n 'setGifSearchQuery',\n 'forwardMessages',\n 'openPollModal',\n 'closePollModal',\n 'closePaymentModal',\n 'clearReceipt',\n 'loadScheduledHistory',\n 'openChat',\n 'addRecentEmoji',\n 'sendInlineBotResult',\n ]),\n)(Composer));\n","import {\n useCallback, useEffect, useRef, useState,\n} from '../../../../lib/teact/teact';\n\nimport { IS_IOS, 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\nexport default () => {\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_IOS && 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\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","import { useEffect } 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';\n\nexport default function useStickerTooltip(\n isAllowed: boolean,\n html: string,\n stickers?: ApiSticker[],\n isDisabled = false,\n) {\n const { loadStickersForEmoji, clearStickersForEmoji } = getDispatch();\n const isSingleEmoji = (\n (IS_EMOJI_SUPPORTED && parseEmojiOnlyString(html) === 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({ emoji: html });\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 insertHtmlInSelection(html: string) {\n const selection = window.getSelection();\n\n if (selection && 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","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';\n\nimport { ApiMessage } from '../../../../api/types';\nimport { GlobalActions } from '../../../../global/types';\n\nimport { EDITABLE_INPUT_ID } from '../../../../config';\nimport parseMessageInput from '../helpers/parseMessageInput';\nimport getMessageTextAsHtml from '../helpers/getMessageTextAsHtml';\nimport focusEditableElement from '../../../../util/focusEditableElement';\nimport { hasMessageMedia } from '../../../../modules/helpers';\n\nexport default (\n htmlRef: { current: string },\n setHtml: (html: string) => void,\n editedMessage: ApiMessage | undefined,\n resetComposer: () => void,\n openDeleteModal: () => void,\n editMessage: GlobalActions['editMessage'],\n) => {\n // TODO useOnChange\n // Handle editing message\n useEffect(() => {\n if (!editedMessage) {\n setHtml('');\n return;\n }\n\n setHtml(getMessageTextAsHtml(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","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, {\n FC, useEffect, useState, memo, useMemo, useCallback,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiChatBannedRights, MAIN_THREAD_ID } from '../../api/types';\nimport { GlobalActions, MessageListType, MessageList as GlobalMessageList } 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 CONTENT_TYPES_FOR_QUICK_UPLOAD,\n ANIMATION_LEVEL_MAX,\n ANIMATION_END_DELAY,\n DARK_THEME_BG_COLOR,\n LIGHT_THEME_BG_COLOR,\n ANIMATION_LEVEL_MIN,\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 selectCurrentMessageList,\n selectCurrentTextSearch,\n selectIsChatBotNotStarted,\n selectIsInSelectMode,\n selectIsRightColumnShown,\n selectPinnedIds,\n selectTheme,\n} from '../../modules/selectors';\nimport { getCanPostInChat, getMessageSendingRestrictionReason, isChatPrivate } from '../../modules/helpers';\nimport captureEscKeyListener from '../../util/captureEscKeyListener';\nimport { pick } from '../../util/iteratees';\nimport buildClassName from '../../util/buildClassName';\nimport useCustomBackground from '../../hooks/useCustomBackground';\nimport useWindowSize from '../../hooks/useWindowSize';\nimport usePrevDuringAnimation from '../../hooks/usePrevDuringAnimation';\nimport calculateMiddleFooterTransforms from './helpers/calculateMiddleFooterTransforms';\nimport useLang from '../../hooks/useLang';\nimport useHistoryBack from '../../hooks/useHistoryBack';\nimport { createMessageHash } from '../../util/routing';\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';\n\nimport './MiddleColumn.scss';\n\ntype StateProps = {\n chatId?: number;\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 hasPinnedOrAudioMessage?: 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 animationLevel?: number;\n shouldSkipHistoryAnimations?: boolean;\n currentTransitionKey: number;\n messageLists?: GlobalMessageList[];\n};\n\ntype DispatchProps = Pick;\n\nconst CLOSE_ANIMATION_DURATION = IS_SINGLE_COLUMN_LAYOUT ? 450 + ANIMATION_END_DELAY : undefined;\n\nfunction canBeQuicklyUploaded(item: DataTransferItem) {\n return item.kind === 'file' && item.type && CONTENT_TYPES_FOR_QUICK_UPLOAD.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 hasPinnedOrAudioMessage,\n pinnedMessagesCount,\n customBackground,\n theme,\n backgroundColor,\n patternColor,\n isLeftColumnShown,\n isRightColumnShown,\n isBackgroundBlurred,\n isMobileSearchActive,\n isSelectModeActive,\n animationLevel,\n shouldSkipHistoryAnimations,\n currentTransitionKey,\n openChat,\n unpinAllMessages,\n loadUser,\n closeLocalTextSearch,\n exitMessageSelectMode,\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 const [isReady, setIsReady] = useState(!IS_SINGLE_COLUMN_LAYOUT || animationLevel === ANIMATION_LEVEL_MIN);\n\n const hasTools = hasPinnedOrAudioMessage && (\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 renderingCanPost = usePrevDuringAnimation(canPost, CLOSE_ANIMATION_DURATION);\n const renderingHasTools = usePrevDuringAnimation(hasTools, CLOSE_ANIMATION_DURATION);\n const renderingIsFabShown = usePrevDuringAnimation(isFabShown, CLOSE_ANIMATION_DURATION);\n\n useEffect(() => {\n return chatId\n ? captureEscKeyListener(() => {\n openChat({ id: undefined });\n })\n : undefined;\n }, [chatId, openChat]);\n\n useEffect(() => {\n setDropAreaState(DropAreaState.None);\n setIsFabShown(undefined);\n setIsNotchShown(undefined);\n }, [chatId]);\n\n useEffect(() => {\n if (animationLevel === ANIMATION_LEVEL_MIN) {\n setIsReady(true);\n }\n }, [animationLevel]);\n\n const handleTransitionEnd = (e: React.TransitionEvent) => {\n if (e.propertyName === 'transform' && e.target === e.currentTarget) {\n setIsReady(Boolean(chatId));\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 && 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 .every(canBeQuicklyUploaded);\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 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\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 }, true);\n };\n\n useHistoryBack(renderingChatId && renderingThreadId,\n closeChat, undefined, undefined, undefined,\n messageLists ? messageLists.map(createMessageHash) : []);\n\n useHistoryBack(isMobileSearchActive, closeLocalTextSearch);\n useHistoryBack(isSelectModeActive, exitMessageSelectMode);\n\n return (\n \n \n
\n {renderingChatId && renderingThreadId && (\n <>\n
\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 {!isPinnedMessageList && !renderingCanPost && messageSendingRestrictionReason && (\n
\n
\n \n {messageSendingRestrictionReason}\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 );\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 } } = 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 animationLevel: global.settings.byKey.animationLevel,\n currentTransitionKey: Math.max(0, global.messages.messageLists.length - 1),\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 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\n return {\n ...state,\n chatId,\n threadId,\n messageListType,\n isPrivate: isChatPrivate(chatId),\n canPost: !isPinnedMessageList && (!chat || canPost) && !isBotNotStarted,\n isPinnedMessageList,\n isScheduledMessageList,\n currentUserBannedRights: chat && chat.currentUserBannedRights,\n defaultBannedRights: chat && chat.defaultBannedRights,\n hasPinnedOrAudioMessage: (\n threadId !== MAIN_THREAD_ID\n || Boolean(pinnedIds && pinnedIds.length)\n || Boolean(audioChatId && audioMessageId)\n ),\n pinnedMessagesCount: pinnedIds ? pinnedIds.length : 0,\n shouldSkipHistoryAnimations: global.shouldSkipHistoryAnimations,\n messageLists,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'openChat', 'unpinAllMessages', 'loadUser', 'closeLocalTextSearch', 'exitMessageSelectMode',\n ]),\n)(MiddleColumn));\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\nexport default (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","import React, {\n FC, memo, useCallback, useEffect, useRef, useState,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\nimport { ManagementScreens, ProfileState } from '../../types';\n\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../util/environment';\nimport { debounce } from '../../util/schedulers';\nimport { pick } from '../../util/iteratees';\nimport buildClassName from '../../util/buildClassName';\nimport {\n selectChat,\n selectCurrentGifSearch,\n selectCurrentStickerSearch,\n selectCurrentTextSearch,\n selectIsChatWithSelf,\n} from '../../modules/selectors';\nimport { isChatAdmin, isChatChannel, isChatPrivate } from '../../modules/helpers';\nimport useCurrentOrPrev from '../../hooks/useCurrentOrPrev';\nimport useLang from '../../hooks/useLang';\n\nimport SearchInput from '../ui/SearchInput';\nimport Button from '../ui/Button';\nimport Transition from '../ui/Transition';\nimport './RightHeader.scss';\nimport { getDayStartAt } from '../../util/dateFormat';\n\ntype OwnProps = {\n chatId?: number;\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};\n\ntype StateProps = {\n canManage?: boolean;\n isChannel?: boolean;\n messageSearchQuery?: string;\n stickerSearchQuery?: string;\n gifSearchQuery?: string;\n};\n\ntype DispatchProps = Pick;\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 ManageGroupUserPermissionsCreate,\n ManageGroupUserPermissions,\n ManageGroupRecentActions,\n ManageGroupAdminRights,\n ManageGroupMembers,\n StickerSearch,\n GifSearch,\n PollResults,\n AddingMembers,\n}\n\nconst RightHeader: FC = ({\n isColumnOpen,\n isProfile,\n isSearch,\n isManagement,\n isStickerSearch,\n isGifSearch,\n isPollResults,\n isAddingChatMembers,\n profileState,\n managementScreen,\n canManage,\n isChannel,\n onClose,\n messageSearchQuery,\n stickerSearchQuery,\n gifSearchQuery,\n setLocalTextSearchQuery,\n setStickerSearchQuery,\n setGifSearchQuery,\n searchTextMessagesLocal,\n toggleManagement,\n openHistoryCalendar,\n shouldSkipAnimation,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const backButtonRef = useRef(null);\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 [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.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.GroupMembers ? (\n HeaderContent.ManageGroupMembers\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('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.ManageGroupPermissions:\n return

{lang('ChannelPermissions')}

;\n case HeaderContent.ManageGroupRemovedUsers:\n return

{lang('ChannelBlockedUsers')}

;\n case HeaderContent.ManageGroupUserPermissionsCreate:\n return

{lang('ChannelAddException')}

;\n case HeaderContent.ManageGroupUserPermissions:\n return

{lang('UserRestrictions')}

;\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 default:\n return (\n <>\n

Profile

\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 (shouldSkipTransition || shouldSkipAnimation) && 'no-transition',\n );\n\n // Add class in the next AF to synchronize with animation with Transition components\n useEffect(() => {\n backButtonRef.current!.classList.toggle('state-back', isBackButton);\n }, [isBackButton]);\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\n const canManage = Boolean(\n !isManagement\n && isProfile\n && chat\n && !selectIsChatWithSelf(global, chat.id)\n // chat.isCreator is for Basic Groups\n && (isChatPrivate(chat.id) || ((isChatAdmin(chat) || chat.isCreator) && !chat.isNotJoined)),\n );\n\n return {\n canManage,\n isChannel,\n messageSearchQuery,\n stickerSearchQuery,\n gifSearchQuery,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'setLocalTextSearchQuery',\n 'setStickerSearchQuery',\n 'setGifSearchQuery',\n 'searchTextMessagesLocal',\n 'toggleManagement',\n 'openHistoryCalendar',\n ]),\n)(RightHeader));\n","import { useMemo, useRef } from '../../../lib/teact/teact';\n\nimport { ApiChatMember, ApiMessage, ApiUser } from '../../../api/types';\nimport { ProfileTabType, SharedMediaType } from '../../../types';\n\nimport { MEMBERS_SLICE, MESSAGE_SEARCH_SLICE, SHARED_MEDIA_SLICE } from '../../../config';\nimport { getMessageContentIds, 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 searchMessages: AnyToVoidFunction,\n tabType: ProfileTabType,\n mediaSearchType?: SharedMediaType,\n groupChatMembers?: ApiChatMember[],\n usersById?: Record,\n chatMessages?: Record,\n foundIds?: number[],\n chatId?: number,\n lastSyncTime?: number,\n serverTimeOffset = 0,\n) {\n const resultType = tabType === 'members' || !mediaSearchType ? tabType : mediaSearchType;\n\n const memberIds = useMemo(() => {\n if (!groupChatMembers || !usersById) {\n return undefined;\n }\n\n return sortUserIds(groupChatMembers.map(({ userId }) => userId), usersById, undefined, serverTimeOffset);\n }, [groupChatMembers, serverTimeOffset, usersById]);\n\n const [memberViewportIds, getMoreMembers, noProfileInfoForMembers] = useInfiniteScrollForMembers(\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 let viewportIds: number[] | 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 '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 }\n\n return [resultType, viewportIds, getMore, noProfileInfo] as const;\n}\n\nfunction useInfiniteScrollForMembers(\n currentResultType?: ProfileTabType,\n handleLoadMore?: AnyToVoidFunction,\n lastSyncTime?: number,\n memberIds?: number[],\n) {\n const [viewportIds, getMore] = useInfiniteScroll(\n lastSyncTime ? handleLoadMore : undefined,\n memberIds,\n undefined,\n MEMBERS_SLICE,\n );\n\n const isOnTop = !viewportIds || !memberIds || viewportIds[0] === memberIds[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 ).reverse();\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, { FC, memo } from '../../lib/teact/teact';\n\nimport {\n ApiUser, ApiChat, ApiMediaFormat, ApiPhoto,\n} from '../../api/types';\n\nimport {\n getChatAvatarHash, isDeletedUser, getUserColorKey, getChatTitle, isChatPrivate, getUserFullName,\n} from '../../modules/helpers';\nimport renderText from '../common/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\n function getMediaHash(size: 'normal' | 'big' = '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) {\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 imageHash = getMediaHash();\n const fullMediaData = useMedia(imageHash, false, ApiMediaFormat.BlobUrl, lastSyncTime);\n const avatarThumbnailData = useMedia(\n !fullMediaData && isFirstPhoto ? getMediaHash('normal', true) : undefined,\n false,\n ApiMediaFormat.BlobUrl,\n lastSyncTime,\n );\n const thumbDataUri = useBlurSync(!fullMediaData && photo && photo.thumbnail && photo.thumbnail.dataUri);\n const imageSrc = fullMediaData || avatarThumbnailData || 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 (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, isChatPrivate(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 (!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 { withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiUser, ApiChat } from '../../api/types';\nimport { GlobalActions, GlobalState } from '../../global/types';\nimport { MediaViewerOrigin } from '../../types';\n\nimport { IS_TOUCH_ENV } from '../../util/environment';\nimport { selectChat, selectUser } from '../../modules/selectors';\nimport {\n getUserFullName, getUserStatus, isChatChannel, isUserOnline,\n} from '../../modules/helpers';\nimport renderText from '../common/helpers/renderText';\nimport { pick } from '../../util/iteratees';\nimport { captureEvents, SwipeDirection } from '../../util/captureEvents';\nimport usePhotosPreload from './hooks/usePhotosPreload';\nimport useLang from '../../hooks/useLang';\n\nimport VerifiedIcon from '../common/VerifiedIcon';\nimport ProfilePhoto from './ProfilePhoto';\nimport Transition from '../ui/Transition';\n\nimport './ProfileInfo.scss';\n\ntype OwnProps = {\n userId: number;\n forceShowSelf?: boolean;\n};\n\ntype StateProps = {\n user?: ApiUser;\n chat?: ApiChat;\n isSavedMessages?: boolean;\n animationLevel: 0 | 1 | 2;\n serverTimeOffset: number;\n} & Pick;\n\ntype DispatchProps = Pick;\n\nconst PrivateChatInfo: FC = ({\n user,\n chat,\n isSavedMessages,\n lastSyncTime,\n animationLevel,\n loadFullUser,\n openMediaViewer,\n serverTimeOffset,\n}) => {\n const { id: userId } = user || {};\n const { id: chatId } = chat || {};\n const fullName = user ? getUserFullName(user) : (chat ? chat.title : '');\n const photos = (user ? user.photos : (chat ? chat.photos : undefined)) || [];\n const slideAnimation = animationLevel >= 1 ? 'slide' : '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 const lang = useLang();\n\n useEffect(() => {\n if (lastSyncTime && userId) {\n loadFullUser({ userId });\n }\n }, [userId, loadFullUser, lastSyncTime]);\n\n usePhotosPreload(user || chat, photos, currentPhotoIndex);\n\n const handleProfilePhotoClick = useCallback(() => {\n openMediaViewer({\n avatarOwnerId: userId || chatId,\n profilePhotoIndex: currentPhotoIndex,\n origin: MediaViewerOrigin.ProfileAvatar,\n });\n }, [openMediaViewer, userId, chatId, currentPhotoIndex]);\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 onSwipe: IS_TOUCH_ENV ? (e, direction) => {\n if (direction === SwipeDirection.Right) {\n selectPreviousMedia();\n } else if (direction === SwipeDirection.Left) {\n selectNextMedia();\n }\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, serverTimeOffset)}\n
\n );\n }\n\n return (\n {\n isChatChannel(chat!)\n ? lang('Subscribers', chat!.membersCount, 'i')\n : lang('Members', chat!.membersCount, 'i')\n }\n \n );\n }\n\n const isVerifiedIconShown = (user && user.isVerified) || (chat && 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 { lastSyncTime, serverTimeOffset } = global;\n const user = selectUser(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 lastSyncTime, user, chat, isSavedMessages, animationLevel, serverTimeOffset,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['loadFullUser', 'openMediaViewer']),\n)(PrivateChatInfo));\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 React, {\n FC, memo, useCallback, useEffect,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions, GlobalState } from '../../global/types';\nimport { ApiChat, ApiUser } from '../../api/types';\n\nimport {\n selectChat, selectNotifyExceptions, selectNotifySettings, selectUser,\n} from '../../modules/selectors';\nimport {\n getChatDescription, getChatLink, getHasAdminRight, isChatChannel, isChatPrivate, isUserRightBanned, selectIsChatMuted,\n} from '../../modules/helpers';\nimport renderText from '../common/helpers/renderText';\nimport { pick } from '../../util/iteratees';\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: number;\n forceShowSelf?: boolean;\n};\n\ntype StateProps = {\n user?: ApiUser;\n chat?: ApiChat;\n canInviteUsers?: boolean;\n isMuted?: boolean;\n} & Pick;\n\ntype DispatchProps = Pick;\n\nconst ChatExtra: FC = ({\n lastSyncTime,\n user,\n chat,\n forceShowSelf,\n canInviteUsers,\n isMuted,\n loadFullUser,\n showNotification,\n updateChatMutedState,\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(phoneNumber);\n const link = getChatLink(chat);\n const description = (fullInfo && fullInfo.bio) || getChatDescription(chat);\n\n return (\n
\n {formattedNumber && !!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 && !!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
{link}
\n {lang('SetUrlPlaceholder')}\n
\n )}\n \n {lang('Notifications')}\n \n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatOrUserId }): StateProps => {\n const { lastSyncTime } = global;\n\n const chat = chatOrUserId ? selectChat(global, chatOrUserId) : undefined;\n const user = isChatPrivate(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, chat, user, canInviteUsers, isMuted,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'loadFullUser', 'updateChatMutedState', 'showNotification',\n ]),\n)(ChatExtra));\n","import React, { FC, useCallback, memo } from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\nimport { ApiChat } from '../../api/types';\n\nimport { pick } from '../../util/iteratees';\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?: number;\n onClose: () => void;\n};\n\ntype StateProps = {\n chat?: ApiChat;\n contactName?: string;\n};\n\ntype DispatchProps = Pick;\n\nconst DeleteMemberModal: FC = ({\n isOpen,\n chat,\n userId,\n contactName,\n onClose,\n deleteChatMember,\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 (setGlobal, actions): DispatchProps => pick(actions, ['deleteChatMember']),\n)(DeleteMemberModal));\n","import React, {\n FC, useCallback, useEffect, useMemo, useRef, useState, memo,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport {\n ApiMessage,\n ApiChatMember,\n ApiUser,\n MAIN_THREAD_ID,\n} from '../../api/types';\nimport { GlobalActions } from '../../global/types';\nimport {\n NewChatMembersProgress, ISettings, MediaViewerOrigin, ProfileState, ProfileTabType, SharedMediaType,\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, isChatPrivate,\n} from '../../modules/helpers';\nimport {\n selectChatMessages,\n selectChat,\n selectCurrentMediaSearch,\n selectIsRightColumnShown,\n selectTheme,\n} from '../../modules/selectors';\nimport { pick } from '../../util/iteratees';\nimport { captureEvents, SwipeDirection } from '../../util/captureEvents';\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 './ProfileInfo';\nimport Document from '../common/Document';\nimport Audio from '../common/Audio';\nimport ChatExtra from './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';\n\nimport './Profile.scss';\n\ntype OwnProps = {\n chatId: number;\n userId?: number;\n profileState: ProfileState;\n onProfileStateChange: (state: ProfileState) => void;\n};\n\ntype StateProps = {\n theme: ISettings['theme'];\n isChannel?: boolean;\n currentUserId?: number;\n resolvedUserId?: number;\n chatMessages?: Record;\n foundIds?: number[];\n mediaSearchType?: SharedMediaType;\n hasMembersTab?: boolean;\n areMembersHidden?: boolean;\n canAddMembers?: boolean;\n canDeleteMembers?: boolean;\n members?: ApiChatMember[];\n usersById?: Record;\n isRightColumnShown: boolean;\n isRestricted?: boolean;\n lastSyncTime?: number;\n serverTimeOffset: number;\n};\n\ntype DispatchProps = Pick;\n\nconst TABS = [\n { type: 'media', title: 'SharedMediaTab2' },\n { type: 'documents', title: 'SharedFilesTab2' },\n { type: 'links', title: 'SharedLinksTab2' },\n { type: 'audio', title: 'SharedMusicTab2' },\n];\n\nconst HIDDEN_RENDER_DELAY = 1000;\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 hasMembersTab,\n areMembersHidden,\n canAddMembers,\n canDeleteMembers,\n members,\n usersById,\n isRightColumnShown,\n isRestricted,\n lastSyncTime,\n setLocalMediaSearchType,\n loadMoreMembers,\n searchMediaMessagesLocal,\n openMediaViewer,\n openAudioPlayer,\n openUserInfo,\n focusMessage,\n loadProfilePhotos,\n setNewChatMembersDialogState,\n serverTimeOffset,\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 ]), [hasMembersTab, isChannel]);\n const tabType = tabs[activeTab].type as ProfileTabType;\n\n const [resultType, viewportIds, getMore, noProfileInfo] = useProfileViewportIds(\n isRightColumnShown, loadMoreMembers, searchMediaMessagesLocal, tabType, mediaSearchType, members,\n usersById, chatMessages, foundIds, chatId, lastSyncTime, 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 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: number) => {\n openUserInfo({ id });\n }, [openUserInfo]);\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 onSwipe: ((e, direction) => {\n if (direction === SwipeDirection.Left) {\n setActiveTab(Math.min(activeTab + 1, tabs.length - 1));\n } else if (direction === SwipeDirection.Right) {\n setActiveTab(Math.max(0, activeTab - 1));\n }\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 canRenderContents = useAsyncRendering([chatId, resultType], renderingDelay);\n\n function getMemberContextAction(id: number) {\n return id === currentUserId || !canDeleteMembers ? undefined : [{\n title: lang('lng_context_remove_from_group'),\n icon: 'stop',\n handler: () => {\n setDeletingUserId(id);\n },\n }];\n }\n\n function renderSharedMedia() {\n if (!viewportIds || !canRenderContents || !chatMessages) {\n // This is just a single-frame delay, so we do not show spinner\n const noSpinner = isFirstTab && viewportIds && !canRenderContents;\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 'documents':\n text = lang('lng_media_file_empty_search');\n break;\n case 'links':\n text = lang('lng_media_link_empty_search');\n break;\n case 'audio':\n text = lang('lng_media_song_empty_search');\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!.map((id) => chatMessages[id] && (\n \n ))\n ) : resultType === 'documents' ? (\n viewportIds!.map((id) => chatMessages[id] && (\n \n ))\n ) : resultType === 'links' ? (\n viewportIds!.map((id) => chatMessages[id] && (\n \n ))\n ) : resultType === 'audio' ? (\n viewportIds!.map((id) => chatMessages[id] && (\n \n ))\n ) : resultType === 'members' ? (\n viewportIds!.map((id, i) => (\n handleMemberClick(id)}\n contextActions={getMemberContextAction(id)}\n >\n \n \n ))\n ) : undefined}\n
\n );\n }\n\n return (\n \n {!noProfileInfo && renderProfileInfo(chatId, resolvedUserId)}\n {!isRestricted && (\n \n \n {renderSharedMedia}\n \n \n\n
\n )}\n\n {canAddMembers && (\n \n \n \n )}\n {canDeleteMembers && (\n \n )}\n \n );\n};\n\nfunction renderProfileInfo(chatId: number, resolvedUserId?: number) {\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 > div.active > .${resultType}-list > .scroll-item`,\n ].join(', ');\n}\n\nexport default memo(withGlobal(\n (global, { chatId, userId }): StateProps => {\n const chat = selectChat(global, chatId);\n\n const chatMessages = selectChatMessages(global, userId || chatId);\n const { currentType: mediaSearchType, resultsByType } = selectCurrentMediaSearch(global) || {};\n const { foundIds } = (resultsByType && mediaSearchType && resultsByType[mediaSearchType]) || {};\n\n const { byId: usersById } = global.users;\n\n const isGroup = chat && isChatGroup(chat);\n const isChannel = chat && isChatChannel(chat);\n const hasMembersTab = isGroup || (isChannel && isChatAdmin(chat!));\n const members = chat && chat.fullInfo && 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\n let resolvedUserId;\n if (userId) {\n resolvedUserId = userId;\n } else if (isChatPrivate(chatId)) {\n resolvedUserId = chatId;\n }\n\n return {\n theme: selectTheme(global),\n isChannel,\n resolvedUserId,\n chatMessages,\n foundIds,\n mediaSearchType,\n hasMembersTab,\n areMembersHidden,\n canAddMembers,\n canDeleteMembers,\n currentUserId: global.currentUserId,\n isRightColumnShown: selectIsRightColumnShown(global),\n isRestricted: chat && chat.isRestricted,\n lastSyncTime: global.lastSyncTime,\n serverTimeOffset: global.serverTimeOffset,\n ...(hasMembersTab && members && {\n members,\n usersById,\n }),\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'setLocalMediaSearchType',\n 'loadMoreMembers',\n 'searchMediaMessagesLocal',\n 'openMediaViewer',\n 'openAudioPlayer',\n 'openUserInfo',\n 'focusMessage',\n 'loadProfilePhotos',\n 'setNewChatMembersDialogState',\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\nexport default () => {\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","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 { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\nimport {\n ApiChat, ApiChatMember, ApiUpdateConnectionStateType, ApiUser,\n} from '../../api/types';\nimport { NewChatMembersProgress } from '../../types';\n\nimport { pick, unique } from '../../util/iteratees';\nimport { selectChat } from '../../modules/selectors';\nimport searchWords from '../../util/searchWords';\nimport {\n getUserFullName, 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: number;\n isActive: boolean;\n onNextStep: (memberIds: number[]) => void;\n onClose: NoneToVoidFunction;\n};\n\ntype StateProps = {\n connectionState?: ApiUpdateConnectionStateType;\n isChannel?: boolean;\n members?: ApiChatMember[];\n currentUserId?: number;\n usersById: Record;\n chatsById: Record;\n localContactIds?: number[];\n searchQuery?: string;\n isLoading: boolean;\n isSearching?: boolean;\n localUserIds?: number[];\n globalUserIds?: number[];\n};\n\ntype DispatchProps = Pick;\n\nconst AddChatMembers: FC = ({\n isChannel,\n connectionState,\n members,\n onNextStep,\n currentUserId,\n usersById,\n chatsById,\n localContactIds,\n isLoading,\n searchQuery,\n isSearching,\n localUserIds,\n globalUserIds,\n setUserSearchQuery,\n onClose,\n isActive,\n loadContactList,\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 const contactIds = localContactIds\n ? sortChatIds(localContactIds.filter((id) => id !== currentUserId), chatsById)\n : [];\n\n if (!searchQuery) {\n return contactIds.filter((id) => !memberIds.includes(id));\n }\n\n const foundContactIds = contactIds.filter((id) => {\n const user = usersById[id];\n if (!user) {\n return false;\n }\n const fullName = getUserFullName(user);\n return fullName && searchWords(fullName, searchQuery);\n });\n\n return sortChatIds(\n unique([\n ...foundContactIds,\n ...(localUserIds || []),\n ...(globalUserIds || []),\n ]).filter((contactId) => {\n const user = usersById[contactId];\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 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 !memberIds.includes(contactId)\n && (!user || !isUserBot(user) || (!isChannel && user.canBeInvitedToGroup));\n }),\n chatsById,\n );\n }, [\n localContactIds, chatsById, searchQuery, localUserIds, globalUserIds,\n currentUserId, usersById, 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: usersById } = global.users;\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 && chat.fullInfo ? chat.fullInfo.members : undefined,\n currentUserId,\n usersById,\n chatsById,\n localContactIds,\n searchQuery,\n isSearching: fetchingStatus,\n isLoading: newChatMembersProgress === NewChatMembersProgress.Loading,\n globalUserIds,\n localUserIds,\n connectionState,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['loadContactList', 'setUserSearchQuery']),\n)(AddChatMembers));\n","import React, {\n FC, memo, useCallback, useEffect, useState,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\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 { pick } from '../../util/iteratees';\nimport {\n selectAreActiveChatsLoaded,\n selectCurrentMessageList,\n selectRightColumnContentKey,\n} from '../../modules/selectors';\nimport useLayoutEffectWithPrevDeps from '../../hooks/useLayoutEffectWithPrevDeps';\nimport useWindowSize from '../../hooks/useWindowSize';\nimport useCurrentOrPrev from '../../hooks/useCurrentOrPrev';\nimport useHistoryBack from '../../hooks/useHistoryBack';\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?: number;\n threadId?: number;\n currentProfileUserId?: number;\n isChatSelected: boolean;\n shouldSkipHistoryAnimations?: boolean;\n};\n\ntype DispatchProps = Pick;\n\nconst COLUMN_CLOSE_DELAY_MS = 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 currentProfileUserId,\n isChatSelected,\n toggleChatInfo,\n toggleManagement,\n openUserInfo,\n closeLocalTextSearch,\n setStickerSearchQuery,\n setGifSearchQuery,\n closePollResults,\n addChatMembers,\n setNewChatMembersDialogState,\n shouldSkipHistoryAnimations,\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 || contentKey === RightColumnContent.UserInfo;\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, true);\n break;\n case RightColumnContent.UserInfo:\n if (isScrolledDown && shouldScrollUp) {\n setProfileState(ProfileState.Profile);\n break;\n }\n openUserInfo({ id: undefined }, 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 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.GroupRecentActions:\n setManagementScreen(ManagementScreens.ChatAdministrators);\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, openUserInfo, closePollResults, setNewChatMembersDialogState,\n managementScreen, toggleManagement, closeLocalTextSearch, setStickerSearchQuery, setGifSearchQuery,\n ]);\n\n const handleSelectChatMember = useCallback((memberId, isPromoted) => {\n setSelectedChatMemberId(memberId);\n setIsPromotedByCurrentUser(isPromoted);\n }, []);\n\n const handleAppendingChatMembers = useCallback((memberIds: number[]) => {\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 }, COLUMN_CLOSE_DELAY_MS);\n }, [isOpen]);\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(([prevContentKey, prevChatId]) => {\n if (\n (prevContentKey === RightColumnContent.ChatInfo && contentKey === RightColumnContent.UserInfo)\n || (prevContentKey === RightColumnContent.UserInfo && contentKey === RightColumnContent.ChatInfo)\n || (prevChatId !== chatId)\n ) {\n setProfileState(ProfileState.Profile);\n setManagementScreen(ManagementScreens.Initial);\n }\n }, [contentKey, chatId]);\n\n\n useHistoryBack(isChatSelected && (contentKey === RightColumnContent.ChatInfo\n || contentKey === RightColumnContent.UserInfo || 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 case RightColumnContent.UserInfo:\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\n return {\n contentKey: selectRightColumnContentKey(global),\n chatId,\n threadId,\n currentProfileUserId: global.users.selectedId,\n isChatSelected: Boolean(chatId && areActiveChatsLoaded),\n shouldSkipHistoryAnimations: global.shouldSkipHistoryAnimations,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'openUserInfo',\n 'toggleChatInfo',\n 'toggleManagement',\n 'closeLocalTextSearch',\n 'setStickerSearchQuery',\n 'setGifSearchQuery',\n 'closePollResults',\n 'addChatMembers',\n 'setNewChatMembersDialogState',\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","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, {\n FC, useEffect, memo, useCallback,\n} from '../../lib/teact/teact';\nimport { getGlobal, withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\nimport { ApiMessage } from '../../api/types';\nimport { LangCode } from '../../types';\n\nimport '../../modules/actions/all';\nimport {\n BASE_EMOJI_KEYWORD_LANG, DEBUG, INACTIVE_MARKER, PAGE_TITLE,\n} from '../../config';\nimport { pick } from '../../util/iteratees';\nimport {\n selectChatMessage,\n selectCountNotMutedUnread,\n selectIsForwardModalOpen,\n selectIsMediaViewerOpen,\n selectIsRightColumnShown,\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 useShowTransition from '../../hooks/useShowTransition';\nimport useBackgroundMode from '../../hooks/useBackgroundMode';\nimport useBeforeUnload from '../../hooks/useBeforeUnload';\nimport useOnChange from '../../hooks/useOnChange';\n\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 Notifications from './Notifications.async';\nimport Dialogs from './Dialogs.async';\nimport ForwardPicker from './ForwardPicker.async';\nimport SafeLinkModal from './SafeLinkModal.async';\nimport HistoryCalendar from './HistoryCalendar.async';\n\nimport './Main.scss';\n\ntype StateProps = {\n animationLevel: number;\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 language?: LangCode;\n};\n\ntype DispatchProps = Pick;\n\nconst NOTIFICATION_INTERVAL = 1000;\n\nlet notificationInterval: number | undefined;\n\nlet DEBUG_isLogged = false;\n\nconst Main: FC = ({\n lastSyncTime,\n isLeftColumnShown,\n isRightColumnShown,\n isMediaViewerOpen,\n isForwardModalOpen,\n animationLevel,\n hasNotifications,\n hasDialogs,\n audioMessage,\n safeLinkModalUrl,\n isHistoryCalendarOpen,\n shouldSkipHistoryAnimations,\n language,\n loadAnimatedEmojis,\n loadNotificationSettings,\n loadNotificationExceptions,\n updateIsOnline,\n loadTopInlineBots,\n loadEmojiKeywords,\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 // Initial API calls\n useEffect(() => {\n if (lastSyncTime) {\n updateIsOnline(true);\n loadAnimatedEmojis();\n loadNotificationSettings();\n loadNotificationExceptions();\n loadTopInlineBots();\n\n loadEmojiKeywords({ language: BASE_EMOJI_KEYWORD_LANG });\n if (language !== BASE_EMOJI_KEYWORD_LANG) {\n loadEmojiKeywords({ language });\n }\n }\n }, [\n lastSyncTime, loadAnimatedEmojis, loadNotificationExceptions, loadNotificationSettings, updateIsOnline,\n loadTopInlineBots, loadEmojiKeywords, language,\n ]);\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\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 = selectCountNotMutedUnread(getGlobal());\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 = selectCountNotMutedUnread(getGlobal()) - 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 // Online status and browser tab indicators\n useBackgroundMode(handleBlur, handleFocus);\n useBeforeUnload(handleBlur);\n\n function stopEvent(e: React.MouseEvent) {\n e.preventDefault();\n e.stopPropagation();\n }\n\n return (\n
\n \n \n \n \n \n \n \n {audioMessage && }\n \n \n
\n );\n};\n\nfunction updateIcon(asUnread: boolean) {\n document.querySelectorAll('link[rel=\"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 { chatId: audioChatId, messageId: audioMessageId } = global.audioPlayer;\n const audioMessage = audioChatId && audioMessageId\n ? selectChatMessage(global, audioChatId, audioMessageId)\n : undefined;\n\n return {\n animationLevel: global.settings.byKey.animationLevel,\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 language: global.settings.byKey.language,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'loadAnimatedEmojis', 'loadNotificationSettings', 'loadNotificationExceptions', 'updateIsOnline',\n 'loadTopInlineBots', 'loadEmojiKeywords',\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"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/4.7cbc0883ea4cc7908cba.css.map b/dist/4.7cbc0883ea4cc7908cba.css.map deleted file mode 100644 index 02530f57..00000000 --- a/dist/4.7cbc0883ea4cc7908cba.css.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["webpack:///./src/components/ui/Switcher.scss","webpack:///./src/components/left/main/LeftMainHeader.scss","webpack:///./src/components/left/ConnectionState.scss","webpack:///./src/components/left/NewChatButton.scss","webpack:///./src/components/left/main/LeftMain.scss","webpack:///./src/components/left/LeftColumn.scss","webpack:///./src/components/middle/AudioPlayer.scss","webpack:///./src/components/middle/MiddleHeader.scss","webpack:///./src/components/common/EmbeddedMessage.scss","webpack:///./src/components/middle/message/MessageMeta.scss","webpack:///./src/components/middle/message/Sticker.scss","webpack:///./src/components/middle/message/Contact.scss","webpack:///./src/components/middle/message/PollOption.scss","webpack:///./src/components/middle/message/Poll.scss","webpack:///./src/components/middle/message/WebPage.scss","webpack:///./src/components/middle/message/Invoice.scss","webpack:///./src/components/middle/message/Album.scss","webpack:///./src/components/middle/message/RoundVideo.scss","webpack:///./src/components/middle/message/InlineButtons.scss","webpack:///./src/components/middle/message/CommentButton.scss","webpack:///./src/components/middle/message/Message.scss","webpack:///./src/components/middle/ContactGreeting.scss","webpack:///./src/components/middle/NoMessages.scss","webpack:///./src/components/middle/MessageList.scss","webpack:///./src/components/middle/ScrollDownButton.scss","webpack:///./src/components/middle/composer/ComposerEmbeddedMessage.scss","webpack:///./src/components/middle/composer/WebPagePreview.scss","webpack:///./src/components/middle/composer/Composer.scss","webpack:///./src/components/middle/MiddleColumn.scss","webpack:///./src/components/right/RightHeader.scss","webpack:///./src/components/right/ProfilePhoto.scss","webpack:///./src/components/right/ProfileInfo.scss","webpack:///./src/components/right/Profile.scss","webpack:///./src/components/right/AddChatMembers.scss","webpack:///./src/components/right/RightColumn.scss","webpack:///./src/components/main/Main.scss"],"names":[],"mappings":"AAAA,UAAU,oBAAoB,mBAAmB,kBAAkB,SAAS,mBAAmB,oBAAoB,YAAY,mBAAmB,oBAAoB,8JAA8J,2BAA2B,kGAAkG,eAAe,gBAAgB,SAAS,QAAQ,kBAAkB,kBAAkB,uBAAuB,UAAU,kBAAkB,eAAe,mBAAmB,eAAe,gBAAgB,6BAA6B,qBAAqB,oBAAoB,kBAAkB,kCAAkC,wBAAwB,WAAW,kBAAkB,aAAa,OAAO,eAAe,gBAAgB,mCAAmC,qBAAqB,yBAAyB,wCAAwC,gCAAgC,gCAAgC,sCAAsC,2BAA2B,6CAA6C,kCAAkC,+BAA+B;;ACAntC,gBAAgB,kBAAkB,oCAAoC,kBAAkB,2HAA2H,eAAe,gBAAgB,uBAAuB,6CAA6C,0BAA0B,oBAAoB,uFAAuF,kBAAkB,OAAO,WAAW,4CAA4C,eAAe,2CAA2C,cAAc,+CAA+C,yBAAyB,uDAAuD,qEAAqE,sDAAsD,qEAAqE,iDAAiD,gBAAgB,iHAAiH,gBAAgB,gCAAgC,iBAAiB,cAAc,iBAAiB,6BAA6B,sBAA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AM,mCAAmC,YAAY,OAAO,gBAAgB,kBAAkB,YAAY,0BAA0B,YAAY,mCAAmC,2BAA2B,YAAY,4CAA4C,2BAA2B,YAAY,QAAQ,0BAA0B,YAAY,eAAe,OAAO,MAAM,kCAAkC,cAAc,mCAAmC,6CAA6C,mCAAmC,gBAAgB,mBAAmB,WAAW,cAAc,kBAAkB,OAAO,MAAM,QAAQ,SAAS,iBAAiB,sCAAsC,2CAA2C,UAAU,0CAA0C,gBAAgB,mCAAmC,aAAa,wDAAwD,cAAc,2CAA2C,+BAA+B,kDAAkD,UAAU,oBAAoB,6CAA6C,gBAAgB,mDAAmD,iBAAiB,0BAA0B,YAAY,eAAe,YAAY,oCAAoC,2BAA2B,aAAa,6CAA6C,0BAA0B,aAAa,yCAAyC,8CAA8C,gBAAgB,gEAAgE,gBAAgB,mDAAmD,gBAAgB,cAAc,OAAO,2CAA2C,eAAe,2BAA2B,cAAc,iCAAiC,6BAA6B,cAAc,gBAAgB,2BAA2B,cAAc,4CAA4C,kCAAkC,0BAA0B,cAAc,eAAe,eAAe,OAAO,MAAM,SAAS,QAAQ,+BAA+B,6CAA6C,qCAAqC,gBAAgB,6CAA6C,sCAAsC,0BAA0B,cAAc,iBAAiB,6CAA6C,mCAAmC,sCAAsC,oCAAoC,+CAA+C,gBAAgB,qDAAqD,gBAAgB,kCAAkC,sCAAsC,6IAA6I,6EAA6E,gFAAgF,aAAa,+EAA+E,kCAAkC,UAAU,uEAAuE,+BAA+B,UAAU,8EAA8E,aAAa,6EAA6E,kCAAkC,UAAU,wEAAwE,+BAA+B","file":"4.7cbc0883ea4cc7908cba.css","sourcesContent":[".Switcher{display:inline-flex;align-items:center;position:relative;margin:0}.Switcher.disabled{pointer-events:none;opacity:0.5}.Switcher.inactive{pointer-events:none}body.animation-level-0 .Switcher .widget,body.animation-level-0 .Switcher .widget::after,.Switcher.no-animation .widget,.Switcher.no-animation .widget::after{transition:none !important}body.animation-level-0 .Switcher .widget:active:after,.Switcher.no-animation .widget:active:after{width:1.125rem}.Switcher input{height:0;width:0;visibility:hidden;position:absolute;z-index:var(--z-below);opacity:0}.Switcher .widget{cursor:pointer;text-indent:-999px;width:2.125rem;height:0.875rem;background:var(--color-gray);display:inline-block;border-radius:.5rem;position:relative;transition:background .2s ease-in}.Switcher .widget:after{content:'';position:absolute;top:-.125rem;left:0;width:1.125rem;height:1.125rem;background:var(--color-background);border-radius:.75rem;transition:0.2s ease-out;border:0.125rem solid var(--color-gray)}.Switcher input:checked+.widget{background:var(--color-primary)}.Switcher input:checked+.widget:after{left:calc(100% - 1.125rem);transform:translateX(calc(-100% + 1.125rem));border-color:var(--color-primary)}.Switcher .widget:active:after{width:1.25rem}\n","#LeftMainHeader{position:relative}#LeftMainHeader .animated-menu-icon{position:absolute}#LeftMainHeader .animated-menu-icon,#LeftMainHeader .animated-menu-icon::before,#LeftMainHeader .animated-menu-icon::after{width:1.125rem;height:0.125rem;border-radius:0.125rem;background-color:var(--color-text-secondary);transition:transform .25s;transform:rotate(0)}#LeftMainHeader .animated-menu-icon::before,#LeftMainHeader .animated-menu-icon::after{position:absolute;left:0;content:''}#LeftMainHeader .animated-menu-icon::before{top:-0.3125rem}#LeftMainHeader .animated-menu-icon::after{top:0.3125rem}#LeftMainHeader .animated-menu-icon.state-back{transform:rotate(180deg)}#LeftMainHeader .animated-menu-icon.state-back::before{transform:rotate(45deg) scaleX(0.75) translate(0.375rem, -0.1875rem)}#LeftMainHeader .animated-menu-icon.state-back::after{transform:rotate(-45deg) scaleX(0.75) translate(0.375rem, 0.1875rem)}#LeftMainHeader .animated-menu-icon.no-animation{transition:none}#LeftMainHeader .animated-menu-icon.no-animation::before,#LeftMainHeader .animated-menu-icon.no-animation::after{transition:none}#LeftMainHeader .archived-badge{min-width:1.5rem;height:1.5rem;margin-left:auto;background:var(--color-gray);border-radius:0.75rem;padding:0 .45rem;color:white;font-size:0.875rem;line-height:1.5rem;font-weight:500;text-align:center;flex-shrink:0}#LeftMainHeader [dir=rtl] .archived-badge{margin-left:0;margin-right:auto}#LeftMainHeader .Menu .bubble{min-width:17rem;max-height:calc(100 * var(--vh) - 3.75rem);overflow-y:auto;overflow-y:overlay}.Transition>div:not(.active) #LeftMainHeader .Menu .bubble,body.animating-right-column #LeftMainHeader .Menu .bubble{transition:none !important}\n","#ConnectionState{flex:0 0 auto;display:flex;align-items:center;margin:0 0.5rem 0.5rem;padding:0.75rem;background:var(--color-yellow);border-radius:var(--border-radius-default)}#ConnectionState>.Spinner{--spinner-size: 1.75rem}#ConnectionState>.state-text{color:var(--color-text-lighter);font-weight:500;line-height:2rem;margin-inline-start:1.875rem;white-space:nowrap}@media (max-width: 950px){#ConnectionState>.state-text{margin-inline-start:1.25rem}}\n",".NewChatButton{position:absolute;right:1rem;bottom:1rem;transform:translateY(5rem);transition:transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1)}body.animation-level-0 .NewChatButton{transform:none !important;opacity:0;transition:opacity .15s}body.animation-level-0 .NewChatButton.revealed{opacity:1}.NewChatButton.revealed{transform:translateY(0)}@media (max-width: 600px){.NewChatButton.revealed{transform:translate3d(0, 0, 10px);transform-style:preserve-3d}}.NewChatButton.menu-is-open::before{content:'';display:block;position:absolute;top:-13rem;left:-11rem;right:-1rem;bottom:-1rem;z-index:-1}.is-touch-env .NewChatButton .Menu>.backdrop{position:absolute;left:-100vw;right:-100vw;top:-100vh;bottom:-100vh}.NewChatButton>.Button .icon-new-chat-filled,.NewChatButton>.Button .icon-close{position:absolute}.NewChatButton>.Button:not(.active) .icon-new-chat-filled{animation:grow-icon .4s ease-out}.NewChatButton>.Button:not(.active) .icon-close{animation:hide-icon .4s forwards ease-out}.NewChatButton>.Button.active .icon-close{animation:grow-icon .4s ease-out}.NewChatButton>.Button.active .icon-new-chat-filled{animation:hide-icon .4s forwards ease-out}\n","#LeftColumn-main{height:100%;position:relative;display:flex;flex-direction:column;overflow:hidden;z-index:1}#LeftColumn-main .connection-state-wrapper{position:absolute;top:3.75rem;width:100%}#LeftColumn-main>.Transition{flex:1;overflow:hidden;transition:transform 300ms ease}#LeftColumn-main>.Transition.pull-down{transform:translateY(3.75rem)}#LeftColumn-main .ChatFolders{height:100%;display:flex;flex-direction:column;overflow:hidden}#LeftColumn-main .ChatFolders .tabs-placeholder{height:2.625rem;transition:height 150ms ease}#LeftColumn-main .ChatFolders .tabs-placeholder:not(.open){height:0}#LeftColumn-main .ChatFolders .TabList{justify-content:flex-start;padding-left:.5625rem;padding-bottom:1px;border-bottom:0;z-index:1}#LeftColumn-main .ChatFolders .Tab{flex:0 0 auto;padding-left:0.625rem;padding-right:0.625rem}#LeftColumn-main .ChatFolders .Tab>span{padding-left:0.5rem;padding-right:0.5rem}#LeftColumn-main .ChatFolders>.Transition{flex:1;overflow:hidden}#LeftColumn-main .chat-list,#LeftColumn-main .RecentContacts,#LeftColumn-main .LeftSearch,#LeftColumn-main .search-content{height:100%;overflow-y:auto}#LeftColumn-main .btn-update{position:absolute;bottom:1rem;left:1rem;right:1rem;margin:0 auto}\n","#LeftColumn{overflow:hidden}#NewChat{height:100%}.left-header{height:var(--header-height);padding:0.375rem 1.25rem .5rem 0.8125rem;display:flex;align-items:center;flex-shrink:0;background-color:var(--color-background)}.left-header h3{margin-bottom:0;font-size:1.25rem;font-weight:500;margin-left:1.375rem}.left-header .SearchInput{margin-left:0.875rem;max-width:calc(100% - 3.625rem)}@media (max-width: 600px){.left-header .SearchInput{max-width:calc(100% - 3.375rem)}}@media (max-width: 600px){.left-header{padding:0.5rem}}\n",".AudioPlayer{display:flex;margin-left:auto;margin-top:-.25rem;margin-bottom:-.25rem}body.animation-level-0 .AudioPlayer{transition:none !important}.AudioPlayer>.Button{flex-shrink:0;margin:.125rem}.AudioPlayer>.toggle-play{--color-text-secondary: var(--color-primary);--color-text-secondary-rgb: var(--color-primary-shade-rgb);--color-primary-shade: var(--color-green);--color-white: var(--color-background-own)}.MiddleHeader .AudioPlayer+.HeaderActions{margin-left:1.5rem}.AudioPlayer .toggle-play.smaller{width:3rem;height:3rem}.AudioPlayer .toggle-play.smaller i{font-size:1.625rem;margin-top:-.025rem}.AudioPlayer .toggle-play i{position:absolute;font-size:1.9375rem;margin-top:-.05rem}.AudioPlayer .toggle-play i.icon-play{margin-left:.1rem}.AudioPlayer .toggle-play .icon-play,.AudioPlayer .toggle-play .icon-pause{opacity:1;transform:scale(1);transition:opacity 0.4s,transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1)}.AudioPlayer .toggle-play.play .icon-pause,.AudioPlayer .toggle-play.pause .icon-play,.AudioPlayer .toggle-play.loading .icon-play,.AudioPlayer .toggle-play.loading .icon-pause{opacity:0;transform:scale(0.5)}.AudioPlayer-content{display:flex;justify-content:center;flex-direction:column;flex-shrink:1;padding:.25rem .5rem;position:relative;overflow:hidden;cursor:pointer;max-width:15rem;border-radius:var(--border-radius-messages-small)}.AudioPlayer-content:hover{background-color:var(--color-interactive-element-hover)}@media (min-width: 1440px) and (max-width: 1500px){.AudioPlayer-content{max-width:14rem}}.AudioPlayer .AudioPlayer-content .title{display:block;font-weight:500;font-size:0.875rem !important;line-height:1rem;height:1rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}body.is-ios .AudioPlayer .AudioPlayer-content .title{font-size:.9375rem !important;line-height:.8125rem}.AudioPlayer-content .subtitle{font-size:0.85rem !important;color:var(--color-text-secondary);line-height:1.125rem;height:1.125rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin:.125rem 0 0}body.is-ios .AudioPlayer-content .subtitle{font-size:.9375rem !important}\n",".MiddleHeader{display:flex;align-items:center;width:100%;box-shadow:0 2px 2px var(--color-light-shadow);background:var(--color-background);padding:.5rem .8125rem .5rem 1.5rem;position:relative;z-index:var(--z-middle-header)}@media (max-width: 600px){.MiddleHeader{padding:0.5rem;position:relative;transform:translate3d(0, 0, 10px);transform-style:preserve-3d}}.MiddleHeader .Transition{width:100%;min-width:0}.MiddleHeader .Transition>div{display:flex;align-items:center;width:100%}.MiddleHeader .back-button{margin-left:-0.5rem;margin-right:0.5rem;position:relative}@media (max-width: 600px){.MiddleHeader .back-button{margin-left:0}}.MiddleHeader .back-button .unread-count{min-width:1.25rem;height:1.25rem;padding:0 0.375rem;border-radius:0.625rem;font-size:0.75rem;line-height:1.25rem;font-weight:500;text-align:center;position:absolute;top:-0.25rem;right:-0.5rem;background:var(--color-gray);color:white;pointer-events:none}.MiddleHeader .back-button .unread-count.active{background:var(--color-primary)}.MiddleHeader .chat-info-wrapper{flex-grow:1;overflow:hidden}.MiddleHeader .header-tools{display:flex;align-items:center;justify-content:flex-end;margin-left:auto;flex-shrink:0}body.animation-level-0 .MiddleHeader .header-tools,body.animation-level-0 .MiddleHeader .header-tools .HeaderPinnedMessage-wrapper,body.animation-level-0 .MiddleHeader .header-tools .AudioPlayer,body.animation-level-0 .MiddleHeader .header-tools .HeaderActions{transition:none !important}@media (min-width: 1276px) and (max-width: 1439px){.MiddleHeader .header-tools .HeaderActions{transform:translate3d(0, 0, 0);transition:transform var(--layer-transition)}#Main.right-column-open .MiddleHeader .header-tools .HeaderActions{transform:translate3d(calc(var(--right-column-width) * -1), 0, 0)}}@media (min-width: 1440px){.MiddleHeader .header-tools{transform:translate3d(0, 0, 0);transition:transform var(--layer-transition)}#Main.right-column-open .MiddleHeader .header-tools{transform:translate3d(calc(var(--right-column-width) * -1), 0, 0)}}.Transition>div:not(.active) .MiddleHeader .header-tools,body.animating-right-column .MiddleHeader .header-tools{pointer-events:none}@media (min-width: 1276px) and (max-width: 1439px){.MiddleHeader:not(.tools-stacked) .header-tools .HeaderPinnedMessage-wrapper,.MiddleHeader:not(.tools-stacked) .header-tools .AudioPlayer{opacity:1}#Main.right-column-open .MiddleHeader:not(.tools-stacked) .header-tools .HeaderPinnedMessage-wrapper,#Main.right-column-open .MiddleHeader:not(.tools-stacked) .header-tools .AudioPlayer{opacity:0}}.MiddleHeader.tools-stacked .header-tools .HeaderPinnedMessage-wrapper,.MiddleHeader.tools-stacked .header-tools .AudioPlayer{position:absolute;top:100%;left:0;right:0;height:2.875rem;overflow:hidden;box-shadow:0 2px 2px var(--color-light-shadow);display:flex;flex-direction:row-reverse;padding:0.375rem 0.5rem;padding-left:0.75rem;background:var(--color-background)}.MiddleHeader.tools-stacked .header-tools .HeaderPinnedMessage-wrapper::before,.MiddleHeader.tools-stacked .header-tools .AudioPlayer::before{content:\"\";display:block;position:absolute;top:-.1875rem;left:0;right:0;height:.125rem;box-shadow:0 0.125rem 0.125rem var(--color-light-shadow)}.MiddleHeader.tools-stacked .header-tools .HeaderPinnedMessage-wrapper .HeaderPinnedMessage,.MiddleHeader.tools-stacked .header-tools .AudioPlayer .HeaderPinnedMessage{max-width:unset;margin-top:-0.1875rem}.MiddleHeader.tools-stacked .header-tools .AudioPlayer{height:3.25rem;flex-direction:row;padding:0.375rem 0.5rem}.MiddleHeader.tools-stacked .header-tools .AudioPlayer-content{padding:0 0.5rem;flex-grow:1}.MiddleHeader.tools-stacked .header-tools .AudioPlayer>.Button{margin:0}.MiddleHeader.tools-stacked .header-tools .AudioPlayer>.player-close{margin-left:auto}.MiddleHeader.tools-stacked .header-tools .HeaderPinnedMessage{flex-grow:1;padding-top:0;padding-bottom:0}.MiddleHeader.tools-stacked .header-tools .HeaderPinnedMessage::before{top:0.125rem;bottom:0.125rem}.MiddleHeader.tools-stacked .header-tools .HeaderPinnedMessage .message-text{max-width:none}@media (min-width: 1150px){#Main.right-column-open .MiddleHeader.tools-stacked .header-tools .HeaderPinnedMessage-wrapper,#Main.right-column-open .MiddleHeader.tools-stacked .header-tools .AudioPlayer{padding-right:calc(0.5rem + var(--right-column-width))}}.MiddleHeader.tools-stacked.animated .header-tools .HeaderPinnedMessage-wrapper,.MiddleHeader.tools-stacked.animated .header-tools .AudioPlayer{animation:fade-in var(--layer-transition) forwards}body.animation-level-0 .MiddleHeader.tools-stacked.animated .header-tools .HeaderPinnedMessage-wrapper,body.animation-level-0 .MiddleHeader.tools-stacked.animated .header-tools .AudioPlayer{animation:none}.MiddleHeader h3{font-weight:500;font-size:1.125rem;line-height:1.375rem;white-space:pre;margin:0;overflow:hidden;text-overflow:ellipsis;unicode-bidi:plaintext}body.is-ios .MiddleHeader h3,body.is-macos .MiddleHeader h3{font-size:1.0625rem;font-weight:600}@media (max-width: 600px){.MiddleHeader h3{display:block;overflow:hidden;text-overflow:ellipsis}}@media (min-width: 1275px){#Main.right-column-open .MiddleHeader h3{max-width:calc(100% - var(--right-column-width))}}.MiddleHeader .ChatInfo{cursor:pointer;display:flex;align-items:center}.MiddleHeader .ChatInfo .info{display:flex;flex-direction:column;justify-content:center;flex-grow:1;overflow:hidden}.MiddleHeader .ChatInfo .title{display:flex;align-items:center}.MiddleHeader .ChatInfo .title .VerifiedIcon{width:1.25rem;height:1.25rem;margin-left:0.25rem;margin-top:0.05rem}.MiddleHeader .ChatInfo .user-status,.MiddleHeader .ChatInfo .status{unicode-bidi:plaintext}.MiddleHeader .Avatar{margin-right:.625rem;width:2.5rem;height:2.5rem;font-size:1.0625rem}.MiddleHeader .status,.MiddleHeader .typing-status{font-size:0.875rem;line-height:1.125rem;margin:0;color:var(--color-text-secondary);overflow:hidden;white-space:nowrap;text-overflow:ellipsis;display:inline-block}.MiddleHeader .status .ellipsis,.MiddleHeader .typing-status .ellipsis{display:inline-flex}.MiddleHeader .status.online,.MiddleHeader .typing-status.online{color:var(--color-primary)}.MiddleHeader .status .font-emoji,.MiddleHeader .typing-status .font-emoji{line-height:1rem}.MiddleHeader .Button.smaller{width:2.5rem;height:2.5rem}.MiddleHeader .HeaderPinnedMessage-wrapper{display:flex;align-items:center;margin-left:auto;cursor:default;flex-direction:row-reverse}body.animation-level-1 .MiddleHeader .HeaderPinnedMessage-wrapper .ripple-container{display:none}.MiddleHeader .HeaderPinnedMessage-wrapper .HeaderPinnedMessage{min-width:16rem}.MiddleHeader .HeaderPinnedMessage-wrapper>.Button{flex-shrink:0}.MiddleHeader .HeaderPinnedMessage{display:flex;flex-shrink:1;margin-top:-0.25rem;margin-bottom:-0.25rem;padding:0.25rem;padding-left:0.375rem;border-radius:var(--border-radius-messages-small);position:relative;overflow:hidden;cursor:pointer}.MiddleHeader .HeaderPinnedMessage:hover{background-color:var(--color-interactive-element-hover)}.MiddleHeader .HeaderPinnedMessage .pinned-message-border{position:relative;height:2.25rem;margin:0.125rem 0;width:0.125rem;min-width:0.125rem;overflow:hidden}.MiddleHeader .HeaderPinnedMessage .pinned-message-border .pinned-message-border-wrapper-1{height:2.25rem;width:0.125rem;border-radius:0.0625rem;background:var(--color-primary)}.MiddleHeader .HeaderPinnedMessage .pinned-message-border .pinned-message-border-wrapper{background-color:var(--color-primary-opacity);position:relative;will-change:transform;transition:transform .25s ease-in-out}.MiddleHeader .HeaderPinnedMessage .pinned-message-border .pinned-message-border-mark{position:absolute;left:0;top:0;width:0.125rem;background:var(--color-primary);border-radius:0.0625rem;will-change:transform;transition:transform .25s ease-in-out}.MiddleHeader .HeaderPinnedMessage .message-text{overflow:hidden;margin-inline-start:0.375rem;margin-top:0.125rem;max-width:15rem}@media (min-width: 1440px) and (max-width: 1500px){.MiddleHeader .HeaderPinnedMessage .message-text{max-width:14rem}}.MiddleHeader .HeaderPinnedMessage .message-text .title{font-weight:500;font-size:0.875rem;line-height:1rem;height:1rem;color:var(--color-primary);margin-bottom:0.125rem;white-space:pre;text-align:initial}body.is-ios .MiddleHeader .HeaderPinnedMessage .message-text .title{font-size:.9375rem}.MiddleHeader .HeaderPinnedMessage .message-text p{font-size:0.875rem;line-height:1.125rem;height:1.125rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin:0}body.is-ios .MiddleHeader .HeaderPinnedMessage .message-text p{font-size:.9375rem}.MiddleHeader .HeaderPinnedMessage .emoji-small{width:1rem;height:1rem}.MiddleHeader .HeaderPinnedMessage>img{width:2.25rem;height:2.25rem;object-fit:cover;border-radius:0.25rem;margin-inline-start:0.375rem;margin-top:0.125rem;flex-shrink:0}.MiddleHeader .HeaderPinnedMessage>img+.message-text{max-width:12rem}.MiddleHeader .HeaderActions{flex-shrink:0;margin-left:auto;display:flex;align-items:center;justify-content:flex-end}.MiddleHeader .HeaderActions .toggle-right-pane-button.active{color:var(--color-primary);opacity:1}.MiddleHeader .HeaderPinnedMessage-wrapper .Button,.MiddleHeader .HeaderActions .Button{margin-left:0.25rem}.MiddleHeader .HeaderPinnedMessage-wrapper .Button.tiny,.MiddleHeader .HeaderActions .Button.tiny{margin-right:.625rem}@media (max-width: 600px){.MiddleHeader .HeaderPinnedMessage-wrapper,.MiddleHeader .AudioPlayer{position:absolute;top:100%;left:0;right:0;height:2.875rem;overflow:hidden;box-shadow:0 2px 2px var(--color-light-shadow);display:flex;flex-direction:row-reverse;padding:0.375rem 0.5rem;padding-left:0.75rem;background:var(--color-background)}.MiddleHeader .HeaderPinnedMessage-wrapper::before,.MiddleHeader .AudioPlayer::before{content:\"\";display:block;position:absolute;top:-.1875rem;left:0;right:0;height:.125rem;box-shadow:0 0.125rem 0.125rem var(--color-light-shadow)}.MiddleHeader .HeaderPinnedMessage-wrapper .HeaderPinnedMessage,.MiddleHeader .AudioPlayer .HeaderPinnedMessage{max-width:unset;margin-top:-0.1875rem}.MiddleHeader .AudioPlayer{height:3.25rem;flex-direction:row;padding:0.375rem 0.5rem}.MiddleHeader .AudioPlayer-content{padding:0 0.5rem;flex-grow:1}.MiddleHeader .AudioPlayer>.Button{margin:0}.MiddleHeader .AudioPlayer>.player-close{margin-left:auto}.MiddleHeader .HeaderPinnedMessage{flex-grow:1;padding-top:0;padding-bottom:0}.MiddleHeader .HeaderPinnedMessage::before{top:0.125rem;bottom:0.125rem}.MiddleHeader .HeaderPinnedMessage .message-text{max-width:none}.MiddleHeader .HeaderPinnedMessage-wrapper,.MiddleHeader .AudioPlayer{transform:translate3d(0, 0, 0)}}@media (min-width: 925px) and (max-width: 1149.9px){.MiddleHeader .HeaderPinnedMessage-wrapper,.MiddleHeader .AudioPlayer{position:absolute}}@keyframes fade-in{from{opacity:0}to{opacity:1}}\n",".EmbeddedMessage{display:flex;align-items:center;font-size:calc(var(--message-text-size, 1rem) - .125rem);line-height:1.125rem;margin:0 -0.25rem .0625rem;padding:.1875rem 0.25rem .1875rem .4375rem;border-radius:var(--border-radius-messages-small);position:relative;overflow:hidden;cursor:pointer;direction:ltr}body.animation-level-1 .EmbeddedMessage .ripple-container{display:none}.custom-shape .EmbeddedMessage{max-width:15rem;padding:0.5rem;margin:0;background-color:var(--background-color);box-shadow:0 1px 2px var(--color-default-shadow)}.custom-shape .EmbeddedMessage::before{left:.625rem;top:.625rem;bottom:.625rem}.custom-shape .EmbeddedMessage img:not(.emoji){margin-inline-start:.5rem}.custom-shape .EmbeddedMessage:dir(rtl){padding:0.5rem}.EmbeddedMessage::before{content:'';display:block;position:absolute;top:.3125rem;bottom:.3125rem;left:.3125rem;width:2px;background:var(--accent-color);border-radius:2px}.EmbeddedMessage:hover{background-color:var(--hover-color)}.EmbeddedMessage:active{background-color:var(--active-color)}.EmbeddedMessage .message-title{font-size:calc(var(--message-text-size, 1rem) - .125rem)}.EmbeddedMessage .message-text{overflow:hidden;margin-inline-start:0.5rem;display:flex;flex-direction:column-reverse}.EmbeddedMessage .message-text .message-title{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-bottom:0.125rem;flex:1;display:block}.EmbeddedMessage .message-text p{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;height:1.125rem;margin-bottom:0;flex:1}.EmbeddedMessage .message-text p::after{content:none;display:none}.EmbeddedMessage .message-text .emoji{width:calc(1.125 * var(--message-text-size, 1rem)) !important;height:calc(1.125 * var(--message-text-size, 1rem)) !important;vertical-align:text-bottom !important}.EmbeddedMessage .embedded-action-message{color:var(--accent-color);opacity:0.75}.EmbeddedMessage img:not(.emoji){width:2rem;height:2rem;object-fit:cover;border-radius:.25rem;margin-left:.25rem;flex-shrink:0}.EmbeddedMessage img:not(.emoji).round{border-radius:1rem}.EmbeddedMessage.inside-input{padding-inline-start:0.5625rem;margin:0 0 -.125rem -0.1875rem;display:grid;grid-template-columns:auto 1fr;grid-template-rows:1fr;width:100%;--accent-color: var(--color-primary);--hover-color: var(--color-interactive-element-hover)}.EmbeddedMessage.inside-input::before{bottom:.3125rem}.EmbeddedMessage.inside-input img:not(.emoji){margin-left:.125rem}.EmbeddedMessage.inside-input .message-text{margin-inline-start:.375rem}.EmbeddedMessage.inside-input .message-title{font-weight:500;color:var(--accent-color)}\n",".MessageMeta{position:absolute;height:1.25rem;bottom:0;right:0;display:flex;align-items:center;background:rgba(153,153,153,0.6);border-radius:.625rem;padding:0 .25rem;color:white;cursor:pointer;max-width:100%}.MessageMeta .message-time,.MessageMeta .message-signature,.MessageMeta .message-views{font-size:.75rem;white-space:nowrap}.MessageMeta .message-time{margin-right:.1875rem}.MessageMeta .message-views{margin-left:.1875rem}.MessageMeta .message-signature{overflow:hidden;text-overflow:ellipsis;margin-right:0.375rem}.MessageMeta .icon-channelviews{margin-left:0.125rem;margin-right:0.375rem;font-size:1.125rem;position:relative;top:-0.0625rem}.has-solid-background .MessageMeta{color:rgba(var(--color-text-meta-rgb), 0.75);background:none}.media:not(.text) .MessageMeta,.Message .custom-shape .MessageMeta{background:rgba(0,0,0,0.2);--color-accent-own: white;--color-accent: white;color:white !important;opacity:1;bottom:.25rem;right:.25rem;left:auto;height:1.125rem;padding:0 .3125rem 0 .375rem}.media:not(.text) .MessageMeta .MessageOutgoingStatus i,.Message .custom-shape .MessageMeta .MessageOutgoingStatus i{background:transparent}.media:not(.text):dir(rtl) .MessageMeta,.Message .custom-shape:dir(rtl) .MessageMeta{right:auto !important;left:.25rem;padding:0 .375rem 0 .3125rem}.is-forwarded.media:not(.text):dir(rtl) .MessageMeta,.Message .is-forwarded.custom-shape:dir(rtl) .MessageMeta{left:.8125rem}.is-forwarded.media:not(.text) .MessageMeta{bottom:0.935rem;right:0.8125rem}.emoji-only .MessageMeta{right:0}.Message.own .has-solid-background .MessageMeta{color:var(--color-message-meta-own)}.MessageMeta .MessageOutgoingStatus{margin-left:-.1875rem;font-size:1.1875rem;border-radius:.625rem}.Message.own .MessageMeta .MessageOutgoingStatus{color:var(--color-accent-own)}.message-content.has-replies:not(.custom-shape) .MessageMeta{bottom:3.375rem}.message-content.has-replies.text:not(.custom-shape) .MessageMeta{bottom:3.4375rem}.Message:not(.own) .custom-shape .reply-message+.MessageMeta{right:auto;left:13.2rem;bottom:0.25rem}.Message:not(.own) .emoji-only-1 .reply-message+.MessageMeta{left:2.5rem}.Message:not(.own) .emoji-only-2 .reply-message+.MessageMeta{left:5.5rem}.Message:not(.own) .emoji-only-3 .reply-message+.MessageMeta{left:6.5rem}\n",".Sticker:not(.inactive){cursor:pointer}.Sticker.inactive{pointer-events:none}\n",".Contact{display:flex;align-items:center;padding:0.25rem}.Contact.interactive{cursor:pointer}.Contact .Avatar{margin-right:0.8rem}.Contact .contact-info{padding:0.5rem;padding-left:0;white-space:nowrap;overflow:hidden}.Contact .contact-info .contact-name{font-size:1rem;line-height:1rem;margin-bottom:0.25rem;font-weight:500}.Contact .contact-info .contact-phone{line-height:1rem;color:var(--secondary-color)}\n",".PollOption{display:flex;flex-flow:row nowrap;margin-bottom:0.75rem}.PollOption:last-child{margin-bottom:0}.PollOption .poll-option-text{word-break:break-word}.PollOption .poll-option-share{position:relative;margin-top:.125rem;width:1.75rem;margin-inline-end:.5rem;flex-shrink:0;font-weight:500;font-size:.875rem;text-align:right}.PollOption .poll-option-share.limit-width{display:inline-flex;justify-content:center;font-size:.75rem}.PollOption .poll-option-chosen{position:absolute;right:0;bottom:-5px;width:1rem;height:1rem;background:var(--accent-color);color:var(--background-color);border-radius:.5rem;font-size:.75rem;text-align:center}.PollOption .poll-option-chosen.wrong{background:var(--color-error)}.is-forwarded .PollOption .poll-option-chosen>i{margin-left:1px}.PollOption .poll-option-chosen.animate{opacity:0;animation-name:PollOptionIconAnimate;animation-delay:.09s;animation-duration:.3s;animation-fill-mode:forwards}.PollOption .poll-option-right{flex-grow:1}.PollOption .poll-option-answer{position:relative}.PollOption .poll-option-line{position:relative;width:0;height:0.25rem;min-width:0.5rem;border-radius:0.125rem;margin-top:0.5rem;background:var(--accent-color);transform-origin:0 0;transition:transform .3s;transition-delay:.09s}.PollOption .poll-line{width:30px;height:35px;position:absolute;left:-27px;bottom:-5px;transition:stroke-dashoffset .3s, stroke-dasharray .3s;stroke-dashoffset:0;stroke-dasharray:0, 200%}.PollOption .poll-line path{stroke-width:4px;stroke-linecap:round;stroke:var(--accent-color);fill:none}.PollOption .wrong .poll-option-line{background:var(--color-error)}.PollOption .wrong .poll-line path{stroke:var(--color-error)}@keyframes PollOptionIconAnimate{0%{opacity:0}100%{opacity:1}}\n",".Poll{min-width:15rem;text-align:initial}@media (max-width: 600px){.Poll{min-width:50vw}}.Poll .poll-question{font-weight:500;line-height:1.25rem;margin:0.125rem 0;word-break:break-word}.Poll .poll-type,.Poll .poll-voters-count{color:var(--secondary-color);font-size:0.875rem}.Poll .poll-type{margin-bottom:0.5rem;display:flex;align-items:center;min-height:1.375rem}.Poll .poll-voters-count{margin:.4375rem 0 .3125rem;text-align:center}.Poll .poll-answers{padding-top:0.25rem;padding-bottom:1rem}.Poll .Checkbox,.Poll .Radio{padding-left:2.25rem}.Poll .Checkbox:last-child,.Poll .Radio:last-child{margin-bottom:.75rem}.Poll .Checkbox.disabled,.Poll .Radio.disabled{opacity:1 !important;cursor:not-allowed}.Poll .Checkbox .Checkbox-main::before,.Poll .Checkbox .Radio-main::before,.Poll .Radio .Checkbox-main::before,.Poll .Radio .Radio-main::before{left:0.125rem;background-color:var(--background-color)}.theme-dark .Poll .Checkbox .Checkbox-main::before,.theme-dark .Poll .Checkbox .Radio-main::before,.theme-dark .Poll .Radio .Checkbox-main::before,.theme-dark .Poll .Radio .Radio-main::before{--color-borders: var(--color-borders-input)}.Message.own .Poll .Checkbox .Checkbox-main::before,.Message.own .Poll .Checkbox .Radio-main::before,.Message.own .Poll .Radio .Checkbox-main::before,.Message.own .Poll .Radio .Radio-main::before{--color-borders: var(--accent-color)}.Poll .Checkbox .Checkbox-main::after,.Poll .Checkbox .Radio-main::after,.Poll .Radio .Checkbox-main::after,.Poll .Radio .Radio-main::after{left:0.4375rem;background-color:var(--accent-color)}.Poll .Checkbox input:checked ~ .Radio-main::before,.Poll .Checkbox input:checked ~ .Checkbox-main::before,.Poll .Radio input:checked ~ .Radio-main::before,.Poll .Radio input:checked ~ .Checkbox-main::before{border-color:var(--accent-color)}.Poll .Checkbox .Spinner,.Poll .Radio .Spinner{left:0.125rem}.Poll .Checkbox .Checkbox-main::after{left:0.125rem;background-color:var(--color-primary)}.Message.own .Poll .Checkbox .Checkbox-main::after{background-color:var(--accent-color)}.Poll .Spinner>div{background-image:var(--spinner-gray-data)}.theme-dark .Poll .Spinner>div{background-image:var(--spinner-white-data)}.Message.own .Poll .Spinner>div{background-image:var(--spinner-green-data)}.theme-dark .Message.own .Poll .Spinner>div{background-image:var(--spinner-white-data)}.Poll .poll-recent-voters{display:inline-flex;align-items:center;vertical-align:text-bottom;margin-left:.875rem;margin-right:.5rem;margin-top:-2px}.Poll .poll-recent-voters .Avatar{border:1px solid var(--color-white);margin-right:0;box-sizing:content-box}.Poll .poll-recent-voters .Avatar:not(:first-child){margin-left:-3px}.Poll .poll-countdown{margin-left:auto;font-size:.75rem;transition:color .2s}.Poll .poll-countdown.hurry-up{color:var(--color-error)}.Poll .poll-countdown.hurry-up .poll-countdown-progress{stroke:var(--color-error)}.Poll .poll-countdown svg{vertical-align:-3px}.Poll .poll-countdown-progress{stroke:var(--color-primary);fill:transparent;stroke-width:2;stroke-linecap:round;transition:stroke-dashoffset 2s, stroke .2s}.Poll .poll-quiz-help{margin:-.625rem 0 -.625rem auto}.Message:not(.own) .Poll .poll-quiz-help{color:var(--color-primary)}.Poll .poll-results,.Poll .poll-answers{padding-top:0.25rem;padding-bottom:0.5rem}.Poll .Button{text-transform:none;font-size:1rem}.Message.own .Poll .Button{color:var(--accent-color);--color-primary-shade-rgb: var(--color-accent-own)}.Poll>.Button{margin-top:-.125rem;margin-bottom:-.0625rem}\n",".WebPage{margin-top:0.25rem;margin-bottom:0.125rem;padding-left:.625rem;font-size:calc(var(--message-text-size, 1rem) - .125rem);line-height:1.125rem;max-width:29rem;position:relative}.WebPage::before{content:'';display:block;position:absolute;top:0;bottom:0;left:0;width:.125rem;background:var(--accent-color);border-radius:.125rem}.WebPage-text{display:flex;flex-direction:column;align-items:flex-start}.WebPage .media-inner{margin:0 !important;margin-bottom:0.375rem !important}.WebPage .media-inner,.WebPage .media-inner img,.WebPage .media-inner.small-image img{border-radius:var(--border-radius-messages-small) !important}.WebPage .media-inner.square-image{width:5rem;height:5rem;min-height:0;margin-bottom:0 !important}.WebPage .media-inner.square-image img{width:100%;height:100%}.WebPage.with-video .media-inner{margin-top:0.5rem !important;margin-bottom:1rem !important}.WebPage.with-square-photo{display:flex;margin-bottom:1rem}.WebPage.with-square-photo .WebPage-text{order:1;padding-right:1rem}.WebPage.with-square-photo .media-inner{order:2;flex-shrink:0}.WebPage.with-square-photo:dir(rtl) .WebPage-text{padding-inline-end:1rem}.WebPage:not(.with-square-photo) .site-name:last-child::after,.WebPage:not(.with-square-photo) .site-title:last-child::after,.WebPage:not(.with-square-photo) .site-description:last-child::after{content:'';display:inline-block;width:var(--meta-safe-area-size);height:0.75rem;float:right}.WebPage .site-name,.WebPage .site-description,.WebPage .site-title{word-break:break-word;max-width:100%}.WebPage .site-name{color:var(--accent-color);font-weight:500;margin-bottom:0.125rem}.WebPage .site-title{font-weight:500;margin-bottom:0.125rem}.WebPage .site-description{line-height:1.25;margin-bottom:0}body.is-ios .WebPage .site-description{line-height:1.125rem}.WebPage:dir(rtl){padding-inline-start:.625rem}.WebPage:dir(rtl)::before{left:auto;right:0}\n",".Invoice .title{color:var(--accent-color);font-weight:500}.Invoice .description{position:relative}.Invoice .description.has-image .invoice-image{max-width:100%;height:20rem}@media (max-width: 600px){.Invoice .description.has-image .invoice-image{height:10rem}}.Invoice .description.has-image .description-text{position:absolute;top:0;padding:.25rem .5rem;margin:.25rem;background-color:rgba(90,110,70,0.6);border-radius:var(--border-radius-messages-small);color:var(--color-text);font-weight:500}\n",".Album{position:relative;overflow:hidden}.message-content.media.text .Album{margin:-0.3125rem -0.5rem 0.3125rem}.forwarded-message .Album{margin-bottom:.125rem}.message-content.media.text .forwarded-message .Album{margin:0 0 0.3125rem;--border-bottom-left-radius: inherit;--border-bottom-right-radius: inherit}.Album>.album-item-select-wrapper .media-inner,.message-content.media.text .Album>.album-item-select-wrapper .media-inner{margin:0 !important}.Album>.album-item-select-wrapper .media-inner,.Album>.album-item-select-wrapper .media-inner img,.Album>.album-item-select-wrapper .media-inner video{border-radius:0 !important;object-fit:cover}\n",".RoundVideo{position:relative;width:200px;height:200px;cursor:pointer}.RoundVideo .thumbnail-wrapper{width:200px;height:200px;border-radius:50%;overflow:hidden}.RoundVideo .video-wrapper{position:absolute;left:0;top:0;border-radius:50%;overflow:hidden}.RoundVideo .progress{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}.RoundVideo .progress-circle{stroke:white;fill:transparent;stroke-width:4;stroke-opacity:.35;stroke-linecap:round}.RoundVideo video::-internal-media-controls-cast-button,.RoundVideo video::-webkit-media-controls,.RoundVideo video::-webkit-media-controls-start-playback-button{display:none}\n",".InlineButtons{display:flex;flex-direction:column}.InlineButtons .row{display:flex;flex-direction:row}.InlineButtons .Button{flex:1;width:auto;margin:0.125rem;background:var(--pattern-color);border-radius:var(--border-radius-messages-small);font-weight:500;text-transform:none}.InlineButtons .Button::before{content:'';background-color:var(--color-white);opacity:0;position:absolute;top:0;left:0;right:0;bottom:0;border-radius:var(--border-radius-messages-small);z-index:var(--z-below);transition:opacity 200ms}.InlineButtons .Button:hover{background:var(--pattern-color) !important}.InlineButtons .Button:hover::before{opacity:.4}.InlineButtons .Button:first-of-type{margin-left:0}.InlineButtons .Button:last-of-type{margin-right:0}.InlineButtons .Button i{font-size:0.75rem;position:absolute;right:0.125rem;top:0.125rem;display:block;transform:rotate(-45deg)}.InlineButtons .row:first-of-type .Button{margin-top:0.25rem !important}.InlineButtons .row:last-of-type .Button{margin-bottom:0}.InlineButtons .row:last-of-type .Button:first-of-type{border-bottom-left-radius:var(--border-radius-messages)}.InlineButtons .row:last-of-type .Button:last-of-type{border-bottom-right-radius:var(--border-radius-messages)}\n",".CommentButton{--background-color: var(--color-background);--hover-color: var(--color-chat-hover);display:flex;width:100%;align-items:center;padding:.5625rem .25rem .5625rem .625rem;padding-inline-start:.625rem;padding-inline-end:.25rem;background:var(--background-color);border-bottom-right-radius:var(--border-bottom-right-radius);border-bottom-left-radius:var(--border-bottom-left-radius);font-size:.9375rem;font-weight:500;line-height:2rem;color:var(--accent-color);white-space:nowrap;cursor:pointer;transition:background-color .15s, color .15s}body.animation-level-0 .CommentButton{transition:none !important}.Message .has-appendix .CommentButton::before{content:'';display:block;position:absolute;bottom:-.1875rem;left:-.5625rem;width:.5625rem;height:1.25rem;background-position:bottom left;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');opacity:0;transition:opacity .15s, filter .15s}.theme-dark #root .Message .has-appendix .CommentButton::before{filter:invert(0.83)}body.animation-level-0 .Message .has-appendix .CommentButton::before{transition:none !important}.custom-shape .CommentButton{position:absolute;right:-3rem;width:2.25rem;bottom:3rem;height:3.375rem;border-radius:1.375rem;padding:0.375rem .3125rem .25rem;align-items:flex-start;color:white;background-color:rgba(0,0,0,0.2);opacity:0;transition:opacity .2s ease}@media (pointer: coarse){.custom-shape .CommentButton{opacity:1 !important}}.custom-shape .CommentButton:hover{background-color:rgba(0,0,0,0.28)}.Message:hover .custom-shape .CommentButton{opacity:1}.custom-shape .CommentButton::after{content:attr(data-cnt);position:absolute;bottom:-.0625rem;left:0;width:100%;text-align:center;font-size:12px;display:block}.custom-shape .CommentButton[data-cnt=\"0\"]{height:2.25rem}.custom-shape .CommentButton[data-cnt=\"0\"]::after{display:none}.custom-shape .CommentButton .icon-comments-sticker{display:block;font-size:1.5rem;margin:0 auto}.custom-shape .CommentButton .recent-repliers,.custom-shape .CommentButton .icon-comments,.custom-shape .CommentButton .label,.custom-shape .CommentButton .icon-next{display:none}.CommentButton:hover{background:var(--hover-color)}.Message .has-appendix .CommentButton:hover::before{opacity:1}.CommentButton:hover .Avatar{border-color:var(--hover-color) !important}.is-forwarded .CommentButton,.audio .CommentButton,.voice .CommentButton,.poll .CommentButton,.text .CommentButton{border-top:1px solid var(--color-borders)}.message-content.has-solid-background .CommentButton{margin:.375rem -.5rem -.375rem}.message-content.voice .CommentButton{margin-bottom:-.5rem}.message-content.audio .CommentButton{margin-bottom:-.8125rem}.message-content.audio .CommentButton,.message-content.voice .CommentButton,.message-content.poll .CommentButton,.message-content.has-solid-background.text .CommentButton,.message-content.has-solid-background.is-forwarded .CommentButton{width:calc(100% + 1rem)}.CommentButton .icon-comments-sticker{display:none}.CommentButton .icon-comments{font-size:1.5625rem;line-height:2rem;margin-inline-end:.875rem}.CommentButton .icon-next{margin-inline-start:auto;font-size:1.5rem}.CommentButton .recent-repliers{display:inline-flex;align-items:center;margin-inline-end:.5rem;margin-inline-start:-.125rem}.CommentButton .recent-repliers .Avatar{transition:border .15s;border:2px solid var(--color-background);margin-inline-end:0;z-index:3;overflow:hidden}.CommentButton .recent-repliers .Avatar .emoji{width:1rem;background-size:1rem}.CommentButton .recent-repliers .Avatar+.Avatar{z-index:2}.CommentButton .recent-repliers .Avatar+.Avatar+.Avatar{z-index:1}.CommentButton .recent-repliers .Avatar:not(:first-child){margin-inline-start:-.75rem}.CommentButton.has-unread .label{position:relative}.CommentButton.has-unread .label::after{content:'';display:inline-block;width:.5rem;height:.5rem;border-radius:50%;background:var(--accent-color);margin-inline-start:.75rem}.CommentButton.disabled{cursor:default;pointer-events:none}\n",".Message{display:flex;align-items:flex-end;margin-bottom:0.375rem;position:relative;--background-color: var(--color-background);--hover-color: var(--color-reply-hover);--active-color: var(--color-reply-active);--max-width: 29rem;--accent-color: var(--color-primary);--accent-shade-color: var(--color-primary-shade);--secondary-color: var(--color-text-secondary);--meta-safe-area-base: 2.25rem;--meta-safe-author-width: 0px;--meta-safe-area-extra-width: 0px;--meta-safe-area-size: calc(var(--meta-safe-area-base) + var(--meta-safe-author-width) + var(--meta-safe-area-extra-width));--deleting-translate-x: -50%;--select-message-scale: 0.9;--select-background-color: white}.Message>.Avatar,.Message>.message-content-wrapper{opacity:1;transform:scale(1) translateX(0);transition:transform var(--select-transition)}body.animation-level-0 .Message>.Avatar,body.animation-level-0 .Message>.message-content-wrapper{transition:none !important}.Message>.Avatar{position:absolute;bottom:0;left:0}@media (max-width: 600px){.Message>.Avatar{width:2.5rem;height:2.5rem}}.Message.last-in-group{margin-bottom:0.625rem}.Message.last-in-list{margin-bottom:0.375rem}.Message.is-in-selection-mode .Album{border:1px var(--select-background-color) solid;background-color:var(--select-background-color)}body.is-android .Message.is-in-selection-mode .can-select-text{z-index:var(--z-message-select-control)}body.is-android .Message.is-in-selection-mode .media-inner{pointer-events:none}.Message.has-inline-buttons .message-content{border-bottom-right-radius:var(--border-radius-messages-small)}.Message:not(.own){padding-left:2.5rem}.no-avatars .Message:not(.own),.Message:not(.own).is-thread-top{padding-left:0}@media (max-width: 600px){.Message:not(.own){padding-left:2.875rem}.no-avatars .Message:not(.own),.Message:not(.own).is-thread-top{padding-left:0.25rem}}.Message.own{flex-direction:row-reverse;--background-color: var(--color-background-own);--hover-color: var(--color-reply-own-hover);--active-color: var(--color-reply-own-active);--max-width: 30rem;--accent-color: var(--color-accent-own);--accent-shade-color: var(--color-green);--secondary-color: var(--color-accent-own);--color-code: var(--color-code-own);--color-code-bg: var(--color-code-own-bg);--color-links: var(--color-own-links);--color-links-hover: var(--color-own-links);--meta-safe-area-base: 3.5rem;--deleting-translate-x: 50%;--color-text-green: var(--color-accent-own)}body.is-ios .Message.own,body.is-macos .Message.own{--color-background-own: var(--color-background-own-apple);--color-reply-own-hover: var(--color-reply-own-hover-apple);--color-reply-own-active: var(--color-reply-own-active-apple)}@media (max-width: 600px){.Message.own{padding-right:0.25rem}}.Message.is-deleting>.Avatar,.Message.is-deleting>.message-content-wrapper{transition:opacity .2s ease, transform .2s ease-in;opacity:0;transform:scale(0.3) translateX(var(--deleting-translate-x));transform-origin:bottom}.Message.has-views{--meta-safe-area-extra-width: 4rem}.Message.was-edited{--meta-safe-area-extra-width: 2.5rem}.Message.was-edited.has-views{--meta-safe-area-extra-width: 7.5rem}html[lang=ru] .Message.was-edited{--meta-safe-area-extra-width: 3.5rem}html[lang=ru] .Message.was-edited.has-views{--meta-safe-area-extra-width: 8.5rem}.select-mode-active .Message{cursor:pointer}@media (min-width: 600px){.select-mode-active .Message{-webkit-user-select:none;user-select:none}}.select-mode-active .Message:not(.own)>.Avatar,.select-mode-active .Message:not(.own)>.message-content-wrapper{transform:translateX(2.5rem)}.select-mode-active .Message:not(.is-album)::after{content:\"\";position:absolute;top:-0.25rem;bottom:-0.25rem;left:-4rem;right:-4rem;z-index:var(--z-message-select-area)}.select-mode-active .Message.is-album .message-select-control,.select-mode-active .Message.is-in-document-group .message-select-control{pointer-events:unset}.select-mode-active .Message .message-select-control{opacity:1}.Message.is-selected .message-select-control{background:var(--color-green)}.Message.is-selected .message-select-control.group-select{background:transparent}.Message.is-selected .message-select-control.group-select.is-selected{background:var(--color-green)}.Message .File.file-is-selected .message-select-control{background:var(--color-green)}.Message.is-in-document-group .File.file-is-selected .file-icon,.Message.has-menu-open.is-in-document-group .File .file-icon{--background-color: var(--color-background-selected)}.Message.own.is-in-document-group .File.file-is-selected .file-icon,.Message.own.has-menu-open.is-in-document-group .File .file-icon{--background-color: var(--color-background-own-selected)}.Message .Audio .message-select-control{left:1.0625rem;top:1.375rem}html.theme-dark .Message.own .Audio .ProgressSpinner{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTUiIGhlaWdodD0iMTUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTguMjE4IDcuNWw1LjYzMy01LjYzM2EuNTA4LjUwOCAwIDEwLS43MTgtLjcxOEw3LjUgNi43ODIgMS44NjcgMS4xNDlhLjUwOC41MDggMCAxMC0uNzE4LjcxOEw2Ljc4MiA3LjVsLTUuNjMzIDUuNjMzYS41MDguNTA4IDAgMTAuNzE4LjcxOEw3LjUgOC4yMThsNS42MzMgNS42MzNhLjUwNi41MDYgMCAwMC43MTggMCAuNTA4LjUwOCAwIDAwMC0uNzE4TDguMjE4IDcuNXoiIGZpbGw9IiNGRkYiIGZpbGwtcnVsZT0ibm9uemVybyIgc3Ryb2tlPSIjODA3QkQ1IiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+PC9zdmc+);background-position:center;background-size:1rem}html.theme-dark .Message.own .Audio .ProgressSpinner circle{stroke:var(--background-color)}.Message .File{position:relative}.Message .File .message-select-control{position:absolute;top:2rem;left:2rem;z-index:2}.Message.own .Message .album-item-select-wrapper{background:var(--color-background-own)}.Message .album-item-select-wrapper .message-select-control{position:absolute;top:0.438rem;right:0.438rem;left:unset}.Message .album-item-select-wrapper .media-inner{border:0 var(--select-background-color) solid;transition:border-width var(--select-transition)}.Message .album-item-select-wrapper img,.Message .album-item-select-wrapper video{transition:transform var(--select-transition)}.Message .album-item-select-wrapper.is-selected .message-select-control{background:var(--color-green)}.Message .album-item-select-wrapper.is-selected img,.Message .album-item-select-wrapper.is-selected video{transform:scale(var(--select-message-scale))}.Message.is-selected .message-select-control,.Message.is-forwarding .message-select-control{background:var(--color-green)}.Message.is-selected .Menu .bubble,.Message.is-forwarding .Menu .bubble{transition:none !important}.Message.is-in-document-group:not(.first-in-document-group)::before{top:0 !important}.Message.is-in-document-group:not(.first-in-document-group) .message-content{box-shadow:none;border-top-left-radius:0 !important;border-top-right-radius:0 !important}.Message.is-in-document-group:not(.first-in-document-group) .forwarded-message::before{top:-1.5rem}.Message.is-in-document-group:not(.last-in-document-group){margin-bottom:0}.Message.is-in-document-group:not(.last-in-document-group)::before{bottom:0 !important}.Message.is-in-document-group:not(.last-in-document-group) .message-content{border-bottom-left-radius:0 !important;border-bottom-right-radius:0 !important}.Message.is-in-document-group.is-in-selection-mode .Audio:not(.audio-is-selected) .message-select-control:not(.group-select),.Message.is-in-document-group.is-in-selection-mode .File:not(.file-is-selected) .message-select-control:not(.group-select){background:white}.Message.is-in-document-group.is-in-selection-mode .Audio:not(.audio-is-selected) .message-select-control:not(.group-select)::after,.Message.is-in-document-group.is-in-selection-mode .File:not(.file-is-selected) .message-select-control:not(.group-select)::after{content:'';width:1.25rem;height:1.25rem;border-radius:0.688rem;background:white;border:0.125rem rgba(0,0,0,0.2) solid;position:absolute}.Message.is-in-document-group.is-in-selection-mode.own .message-content .Audio:not(.audio-is-selected) .message-select-control:not(.group-select),.Message.is-in-document-group.is-in-selection-mode.own .message-content .File:not(.file-is-selected) .message-select-control:not(.group-select){background:var(--background-color);border-color:var(--background-color)}.Message.is-in-document-group.is-in-selection-mode.own .message-content .Audio:not(.audio-is-selected) .message-select-control:not(.group-select)::after,.Message.is-in-document-group.is-in-selection-mode.own .message-content .File:not(.file-is-selected) .message-select-control:not(.group-select)::after{background:var(--background-color);border-color:var(--color-message-meta-own)}.Message.is-in-document-group.focused .message-content,.Message.is-in-document-group.has-menu-open .message-content,.Message.is-in-document-group.is-forwarding .message-content,.Message.is-in-document-group.is-selected .message-content{background:var(--color-background-selected)}.Message.is-in-document-group.focused.own .message-content,.Message.is-in-document-group.has-menu-open.own .message-content,.Message.is-in-document-group.is-forwarding.own .message-content,.Message.is-in-document-group.is-selected.own .message-content{--background-color: var(--color-background-own-selected);background:var(--color-background-own-selected)}.Message.is-in-document-group .message-content-wrapper{width:17.1875rem}.Message.is-in-document-group .message-content{transition:background-color var(--select-transition)}.Message.is-in-document-group.own .message-content-wrapper{display:flex;justify-content:flex-end}.Message.is-in-document-group.own .message-content-wrapper .message-content{width:100%}.Message .album-item-select-wrapper{position:absolute}.Message .album-item-select-wrapper .message-select-control{position:absolute;z-index:2}.Message .message-select-control{position:absolute;left:0;bottom:0.25rem;width:1.5rem;height:1.5rem;border:2px solid white;border-radius:50%;z-index:var(--z-message-select-control);display:flex;align-items:center;justify-content:center;color:white;font-size:1rem;opacity:0;pointer-events:none;transition:opacity var(--select-transition)}.Message .message-select-control .icon-select{position:absolute;left:-3px;top:-3px;font-size:1.625rem}.theme-dark .Message .message-select-control{border-color:#ffffff80}.Message .Avatar{margin-right:0.3rem}.Message.is-in-document-group .message-content.document{padding:.25rem .5rem !important}.Message.is-in-document-group.last-in-document-group .message-content.document{padding-bottom:.5rem !important}.Message.is-in-document-group.first-in-document-group .message-content.document{padding-top:.5rem !important}.message-content,.Album,.media-inner,.message-content.media .media-inner img,.message-content.media .media-inner video,.message-content.custom-shape .media-inner img{border-top-left-radius:var(--border-top-left-radius);border-top-right-radius:var(--border-top-right-radius);border-bottom-left-radius:var(--border-bottom-left-radius);border-bottom-right-radius:var(--border-bottom-right-radius)}.media-inner video.full-media{background:transparent !important}.media-inner{overflow:hidden}.media-inner.small-image img{border-radius:0 !important}.Message{--border-top-left-radius: var(--border-radius-messages);--border-top-right-radius: var(--border-radius-messages);--border-bottom-left-radius: var(--border-radius-messages);--border-bottom-right-radius: var(--border-radius-messages)}.Message:not(.own).first-in-group:not(.last-in-group){--border-bottom-left-radius: var(--border-radius-messages-small)}.Message:not(.own):not(.first-in-group):not(.last-in-group){--border-top-left-radius: var(--border-radius-messages-small);--border-bottom-left-radius: var(--border-radius-messages-small)}.Message:not(.own).last-in-group:not(.first-in-group){--border-top-left-radius: var(--border-radius-messages-small)}.Message:not(.own).last-in-group{--border-bottom-left-radius: var(--border-radius-messages-small)}.Message:not(.own).last-in-group .message-content.has-appendix{--border-bottom-left-radius: 0}.Message.own.first-in-group:not(.last-in-group){--border-bottom-right-radius: var(--border-radius-messages-small)}.Message.own:not(.first-in-group):not(.last-in-group){--border-top-right-radius: var(--border-radius-messages-small);--border-bottom-right-radius: var(--border-radius-messages-small)}.Message.own.last-in-group:not(.first-in-group){--border-top-right-radius: var(--border-radius-messages-small)}.Message.own.last-in-group{--border-bottom-right-radius: var(--border-radius-messages-small)}.Message.own.last-in-group .message-content.has-appendix{--border-bottom-right-radius: 0}.Message .message-content.has-replies:not(.custom-shape) .media-inner,.Message .message-content.has-replies:not(.custom-shape) .Album,.Message .message-content.text .media-inner,.Message .message-content.text .Album{--border-bottom-left-radius: 0;--border-bottom-right-radius: 0}.Message .message-content.is-reply .EmbeddedMessage+.Album,.Message .message-content.is-reply .EmbeddedMessage+.Audio,.Message .message-content.is-reply .EmbeddedMessage+.File{margin-top:.375rem}.Message .message-content:not(.custom-shape).is-reply .media-inner,.Message .message-content:not(.custom-shape).is-reply .Album,.Message .message-content:not(.custom-shape).force-sender-name .Album,.Message .message-content:not(.is-forwarded) .message-title ~ .media-inner{--border-top-left-radius: 0;--border-top-right-radius: 0}.Message .message-content.is-forwarded .content-inner .message-title{margin-bottom:0.25rem}.Message .message-action-button{position:absolute;bottom:0;color:white;background-color:rgba(0,0,0,0.2);opacity:0;transition:opacity .2s ease}@media (pointer: coarse){.Message .message-action-button{opacity:1 !important}}.Message .message-action-button:hover,.Message .message-action-button:active,.Message .message-action-button:focus{background-color:rgba(0,0,0,0.28) !important}.Message:hover .message-action-button,.Message[data-is-document-group-hover] .message-action-button{opacity:1}.Message.own .message-action-button{left:-3rem}.Message:not(.own) .message-action-button{right:-3rem}.Message .bottom-marker{height:1px;width:1px;visibility:hidden}.Message .custom-shape .message-action-button{bottom:.25rem}.message-content{position:relative;max-width:var(--max-width)}@media (max-width: 600px){.message-content{max-width:calc(100vw - 6.25rem)}.Message.own .message-content,.MessageList.no-avatars .message-content{max-width:calc(100vw - 3.75rem)}@supports (max-width: min(29rem, 100vw - 6.25rem)){.message-content{max-width:min(29rem, 100vw - 6.25rem)}.MessageList.no-avatars .message-content{max-width:min(29rem, 100vw - 3.75rem)}.Message.own .message-content{max-width:min(30rem, 100vw - 3.75rem)}}.message-content.has-action-button{max-width:calc(100vw - 7rem)}.Message.own .message-content.has-action-button,.MessageList.no-avatars .message-content.has-action-button{max-width:calc(100vw - 4.5rem)}@supports (max-width: min(29rem, 100vw - 5.5rem)){.message-content.has-action-button{max-width:min(29rem, 100vw - 7rem)}.MessageList.no-avatars .message-content.has-action-button{max-width:min(29rem, 100vw - 4.5rem)}.Message.own .message-content.has-action-button{max-width:min(30rem, 100vw - 4.5rem)}}}.message-content .text-content{margin:0;word-break:break-word;line-height:1.3125;text-align:initial;display:flow-root;unicode-bidi:plaintext}.message-content .text-entity-link{unicode-bidi:plaintext}.message-content:not(.custom-shape) .text-content>.MessageMeta,.message-content.document>.MessageMeta{position:relative;top:.375rem;bottom:auto !important;float:right;line-height:1;height:calc(var(--message-meta-height, 1rem));margin-left:.4375rem;margin-right:-.5rem}.message-content:not(.custom-shape) .text-content>.MessageMeta .MessageOutgoingStatus .Transition,.message-content.document>.MessageMeta .MessageOutgoingStatus .Transition{max-height:calc(var(--message-meta-height, 1rem));overflow:hidden}html[data-message-text-size=\"12\"] .message-content:not(.custom-shape) .text-content>.MessageMeta,html[data-message-text-size=\"12\"] .message-content.document>.MessageMeta{top:.25rem}html[data-message-text-size=\"17\"] .message-content:not(.custom-shape) .text-content>.MessageMeta,html[data-message-text-size=\"17\"] .message-content.document>.MessageMeta{top:.4375rem}html[data-message-text-size=\"18\"] .message-content:not(.custom-shape) .text-content>.MessageMeta,html[data-message-text-size=\"19\"] .message-content:not(.custom-shape) .text-content>.MessageMeta,html[data-message-text-size=\"18\"] .message-content.document>.MessageMeta,html[data-message-text-size=\"19\"] .message-content.document>.MessageMeta{top:.5rem}html[data-message-text-size=\"20\"] .message-content:not(.custom-shape) .text-content>.MessageMeta,html[data-message-text-size=\"20\"] .message-content.document>.MessageMeta{top:.5625rem}.message-content:not(.custom-shape) .text-content:dir(rtl)>.MessageMeta,.message-content.document:dir(rtl)>.MessageMeta{float:left;margin-left:-.25rem;margin-right:.4375rem}.message-content.document:not(.text)::after{content:\"\";display:block;clear:both}.message-content.document:not(.text)>.MessageMeta{top:auto !important;bottom:-.5rem !important;margin-top:-.25rem}.message-content.document:not(.text)>.MessageMeta:not([dir=rtl]){margin-top:-1.25rem}.theme-dark .Message.own .message-content .text-entity-link{text-decoration:underline}.theme-dark .Message.own .message-content .text-entity-link:hover{text-decoration:none}.message-content:not(.custom-shape){font-size:var(--message-text-size, 1rem)}body.is-ios .message-content:not(.custom-shape){font-size:var(--message-text-size, 1.0625rem)}.message-content:not(.custom-shape)>.content-inner{min-width:0}.message-content .matching-text-highlight{background:#CAE3F7;border-radius:0.25rem;padding:0 0.125rem}.message-content .message-title{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:calc(var(--message-text-size, 1rem) - .125rem);font-weight:500;line-height:1.25rem;color:var(--accent-color);unicode-bidi:plaintext;display:flex}.message-content .message-title>.interactive{overflow:hidden;text-overflow:ellipsis}.message-content .message-title.interactive,.message-content .message-title>.interactive{cursor:pointer}.message-content .message-title.interactive:hover,.message-content .message-title>.interactive:hover{opacity:0.85}.message-content .message-title>.color-1{color:var(--color-user-1)}.message-content .message-title>.color-2{color:var(--color-user-2)}.message-content .message-title>.color-4{color:var(--color-user-4)}.message-content .message-title>.color-5{color:var(--color-user-5)}.message-content .message-title>.color-6{color:var(--color-user-6)}.message-content .message-title>.color-7{color:var(--color-user-7)}.message-content .message-title>.color-8{color:var(--color-user-8)}.theme-dark .Message.own .message-content .message-title>.color-1{color:var(--accent-color)}.message-content .message-title+.File{margin-top:.25rem}.message-content .message-title .via{padding-right:.25rem;font-weight:400}.message-content .message-title span+.via{padding-left:.25rem}.message-content .message-title .admin-title{flex:1;margin-left:1rem;text-align:right;font-weight:400;font-size:0.75rem;margin-top:-0.1rem;color:rgba(var(--color-text-meta-rgb), 0.75)}.Message.own .message-content .message-title .admin-title{color:var(--accent-color)}.message-content.has-shadow{box-shadow:0 1px 2px var(--color-default-shadow)}.message-content.has-solid-background,.message-content.has-background,.is-album .message-content{background:var(--background-color)}.message-content.has-solid-background{padding:.3125rem .5rem .375rem}.message-content.has-solid-background .forwarded-message>.text-content:not(.with-meta):last-child::after{content:'';display:inline-block;width:var(--meta-safe-area-size);height:1rem}.message-content:not(.has-appendix) .svg-appendix{display:none}.message-content .svg-appendix{overflow:hidden;position:absolute;bottom:-.0875rem;width:.5625rem;height:1.125rem;font-size:1rem !important}.message-content .svg-appendix .corner{fill:var(--background-color)}.Message.own .message-content .svg-appendix{right:-.551rem}.Message:not(.own) .message-content .svg-appendix{left:-.562rem}.message-content[data-has-custom-appendix] .svg-appendix .corner{fill:var(--appendix-bg)}.Message .message-content.has-appendix-thumb .svg-appendix{--background-color: #ccc;opacity:1;transition:opacity 500ms ease}.message-content.document{padding:.5rem !important}.theme-dark .message-content.document .File{--color-primary: var(--color-selection-highlight)}.message-content.document .File+.text-content{margin-top:.3125rem}.message-content.voice .message-title,.message-content.voice .Embedded,.message-content.audio .message-title,.message-content.audio .Embedded{margin-top:-.1875rem;margin-bottom:.1875rem}.message-content.voice{padding:.5rem !important}.message-content.voice .Voice+.text-content{margin-top:.5rem}.message-content.audio{min-width:17.1875rem;padding:.5rem .5rem .8125rem !important}.message-content.audio .Audio+.text-content{margin-top:.25rem}.message-content.audio:not(.has-replies) .Audio+.text-content{margin-bottom:-0.4375rem}.message-content:not(.custom-shape) .emoji{display:inline-block;width:1.25rem;background-size:1.25rem;color:transparent;margin-inline-end:1px;vertical-align:text-bottom}.message-content:not(.custom-shape) .emoji::selection{background-color:var(--color-selection-highlight-emoji);color:transparent}.message-content:not(.custom-shape) .text-content .emoji{width:calc(1.25 * var(--message-text-size, 1rem));height:calc(1.25 * var(--message-text-size, 1rem));background-size:calc(1.25 * var(--message-text-size, 1rem))}.message-content .no-media-corners{--border-top-left-radius: 0;--border-top-right-radius: 0}.message-content.custom-shape.is-via-bot{font-size:inherit !important}.message-content.custom-shape.is-via-bot .message-title{display:inline-flex;position:relative;top:.125rem;max-width:calc(100% - 3rem);margin-left:calc(100% - 3rem);padding:0 .5rem;background-color:var(--background-color);border-radius:var(--border-radius-messages)}.Message.own .message-content.custom-shape.is-via-bot .message-title{margin-left:-3rem}.message-content.custom-shape.is-via-bot .media-inner{margin-top:0.375rem}.message-content.media .media-inner,.WebPage .media-inner{display:flex;justify-content:center;align-items:center}.message-content.media .media-inner.interactive,.WebPage .media-inner.interactive{cursor:pointer}.message-content.media .media-inner.interactive.dark video,.WebPage .media-inner.interactive.dark video{background-color:#232323}.message-content.media.round.is-reply,.WebPage.round.is-reply{width:auto !important}.message-content.media.force-sender-name .media-inner,.message-content.media.force-sender-name .Album,.message-content.media.text .media-inner,.message-content.media.is-via-bot .media-inner,.message-content.media.is-reply .media-inner,.message-content.media.is-reply .Album,.WebPage.force-sender-name .media-inner,.WebPage.force-sender-name .Album,.WebPage.text .media-inner,.WebPage.is-via-bot .media-inner,.WebPage.is-reply .media-inner,.WebPage.is-reply .Album{margin-left:-0.5rem;margin-right:-0.5rem}.message-content.media.text .media-inner,.WebPage.text .media-inner{margin-top:-0.3125rem}.message-content.media.is-reply .media-inner,.message-content.media.force-sender-name .Album,.message-content.media.is-reply .Album,.message-content.media .message-title ~ .media-inner,.WebPage.is-reply .media-inner,.WebPage.force-sender-name .Album,.WebPage.is-reply .Album,.WebPage .message-title ~ .media-inner{margin-top:0.375rem;margin-bottom:-0.375rem}.message-content.media.text .media-inner,.message-content.media.text .Album,.WebPage.text .media-inner,.WebPage.text .Album{margin-bottom:0.375rem}.message-content.media .media-loading,.WebPage .media-loading{display:flex;align-items:center;justify-content:center}.message-content.media .media-loading:not(.open),.WebPage .media-loading:not(.open){opacity:0.5;transform:scale(0);transition:opacity .3s ease, transform .3s ease}.message-content.media .icon-large-play,.message-content.media .icon-download,.WebPage .icon-large-play,.WebPage .icon-download{position:absolute;display:flex;align-items:center;justify-content:center;color:#fff;opacity:0.7;transition:opacity 150ms}.message-content.media .icon-large-play:hover,.message-content.media .icon-download:hover,.WebPage .icon-large-play:hover,.WebPage .icon-download:hover{opacity:1}.message-content.media .icon-large-play:before,.message-content.media .icon-download:before,.WebPage .icon-large-play:before,.WebPage .icon-download:before{display:flex;align-items:center;justify-content:center;width:3.375rem;height:3.375rem;border-radius:50%;background:rgba(0,0,0,0.25)}.message-content.media .icon-download,.WebPage .icon-download{font-size:1.5rem}.message-content.media .icon-large-play,.WebPage .icon-large-play{font-size:2.5rem}.message-content.media .message-media-duration,.message-content.media .message-upload-progress,.WebPage .message-media-duration,.WebPage .message-upload-progress{background:rgba(0,0,0,0.25);color:#fff;font-size:0.75rem;position:absolute;left:.1875rem;top:.1875rem;z-index:1;padding:0 .375rem;border-radius:.75rem;line-height:1.125rem}.message-content.media .message-media-duration .icon-muted-chat,.WebPage .message-media-duration .icon-muted-chat{vertical-align:-.1875rem;margin-left:.375rem;font-size:1.0625rem}.message-content.custom-shape{line-height:1.2;font-size:10rem;display:flex;flex-wrap:wrap;align-items:flex-end}.message-content.custom-shape.has-comments{min-height:5.25rem;margin-top:0 !important}.message-content.custom-shape.has-comments.has-replies{min-height:6.5rem}.message-content.custom-shape.is-reply{max-width:100%}.message-content.custom-shape .reply-message{display:flex;align-items:flex-start;flex-direction:row-reverse;direction:ltr}.message-content.custom-shape .reply-message>p{margin-bottom:0}.message-content.custom-shape .reply-message .EmbeddedMessage{margin-left:0.5rem;border-radius:var(--border-radius-messages)}@media (max-width: 600px){.message-content.custom-shape .reply-message .EmbeddedMessage{max-width:calc(90vw - 13rem)}}@media (max-width: 340px){.message-content.custom-shape .reply-message .EmbeddedMessage{margin-left:-1rem;z-index:1;max-width:calc(90vw - 12rem)}}.message-content.custom-shape .text-content{margin-bottom:1rem}.message-content.custom-shape .media-inner{line-height:1;font-size:1rem;flex-shrink:0}.message-content.custom-shape .media-inner .full-media{top:0;left:0;bottom:0;right:0}.message-content.custom-shape .emoji{display:inline-block;color:transparent}.message-content.custom-shape .emoji::selection{background-color:var(--color-selection-highlight-emoji);color:transparent}.message-content.custom-shape.emoji-only .text-content{margin-bottom:0}.message-content.custom-shape.emoji-only-1{min-width:8rem;font-size:4.5rem}.message-content.custom-shape.emoji-only-1 .content-inner{height:7rem}.message-content.custom-shape.emoji-only-1 .text-content{line-height:1.5;text-align:center}.Message.was-edited .message-content.custom-shape.emoji-only-1{min-width:10rem}.message-content.custom-shape.emoji-only-1 .emoji{width:5rem;height:5rem}.message-content.custom-shape.emoji-only-2{font-size:4rem;margin-top:.5rem;min-width:10rem}.message-content.custom-shape.emoji-only-2.has-comments{margin-top:1.25rem}.Message.was-edited .message-content.custom-shape.emoji-only-2{min-width:12rem}.message-content.custom-shape.emoji-only-2 .emoji{width:4rem;height:4rem}.message-content.custom-shape.emoji-only-3{font-size:3rem;margin-top:1.75rem;min-width:12rem}.message-content.custom-shape.emoji-only-3.has-comments{margin-top:2.5rem}.Message.was-edited .message-content.custom-shape.emoji-only-3{min-width:14rem}.message-content.custom-shape.emoji-only-3 .emoji{width:3rem;height:3rem}.Message:not(.own) .message-content.custom-shape{--hover-color: var(--color-reply-hover);--active-color: var(--color-reply-active)}.Message.own .message-content.custom-shape{--hover-color: var(--color-reply-own-hover);--active-color: var(--color-reply-own-active)}.Message.own .message-content.custom-shape .reply-message{flex-direction:row}.Message.own .message-content.custom-shape .reply-message .EmbeddedMessage{margin-right:0.5rem}@media (max-width: 340px){.Message.own .message-content.custom-shape .reply-message .EmbeddedMessage{margin-left:0;z-index:1;max-width:calc(90vw - 11.5rem)}}.forwarded-message{--border-top-left-radius: var(--border-radius-messages-small);--border-top-right-radius: var(--border-radius-messages-small);--border-bottom-left-radius: var(--border-radius-messages-small);--border-bottom-right-radius: var(--border-radius-messages-small)}.message-content.poll .forwarded-message{margin-bottom:0.5rem}.message-content:not(.custom-shape) .forwarded-message{position:relative;margin-top:0.25rem;padding-left:0.625rem}.message-content:not(.custom-shape) .forwarded-message::before{content:'';display:block;position:absolute;top:0;bottom:0;left:0.05rem;width:2px;background:var(--accent-color);border-radius:2px}.message-content:not(.custom-shape) .forwarded-message:dir(rtl){padding-inline-start:0.625rem}.message-content:not(.custom-shape) .forwarded-message:dir(rtl)::before{left:auto;right:0.05rem}.forwarded-message>.media-inner{margin:0 !important;margin-bottom:0.25rem !important}.long-word-break-all{word-break:break-all}.text-entity-link{color:var(--color-links) !important;text-decoration:none;word-break:break-word;cursor:pointer;unicode-bidi:initial}.text-entity-link:hover,.text-entity-link:active,.text-entity-link:visited{color:var(--color-links-hover) !important;text-decoration:underline}.text-entity-code,.text-entity-pre{color:var(--color-code);background:var(--color-code-bg);white-space:pre-wrap;margin:0;padding:1px 2px;border-radius:4px;font-size:calc(var(--message-text-size, 1rem) - 0.0625rem)}\n",".ContactGreeting{width:100%;height:100%;display:flex;align-items:center;justify-content:center;text-align:center}.ContactGreeting .wrapper{display:inline-flex;flex-direction:column;align-items:center;background:var(--pattern-color);width:14.5rem;padding:.75rem 1rem;border-radius:1.5rem;color:#fff}.ContactGreeting .title{font-weight:500;margin-bottom:0}.ContactGreeting .description{font-size:.9375rem;margin-bottom:0}.ContactGreeting .sticker{margin:2rem 0 1rem;height:10rem;width:10rem;cursor:pointer}.ContactGreeting .sticker .thumbnail{height:10rem;width:10rem}\n",".NoMessages{width:100%;height:100%;display:flex;align-items:center;justify-content:center}.NoMessages .icon{font-size:5rem;margin:0 auto 1rem}.NoMessages .wrapper{display:inline-flex;flex-direction:column;background:var(--pattern-color);max-width:20rem;padding:.75rem 1rem;border-radius:1.5rem;color:#fff}.NoMessages .wrapper[dir=rtl]{text-align:right}.NoMessages .title{font-weight:500;font-size:1rem;margin-bottom:.25rem;text-align:center;unicode-bidi:plaintext}.NoMessages .description{font-size:.9375rem;margin:0;padding:0;list-style:none;unicode-bidi:plaintext}.NoMessages .list-checkmarks{font-size:.9375rem;margin:.25rem 0 0;padding:0;list-style:none;unicode-bidi:plaintext;line-height:1.8}.NoMessages .list-checkmarks li::before{content:'✓';margin-inline-end:.5rem}\n",".MessageList{flex:1;width:100%;overflow-anchor:none;overflow:scroll;overflow-x:hidden;overflow-y:overlay;margin-bottom:.5rem}.mask-image-enabled .MessageList{-webkit-mask-image:linear-gradient(to top, transparent 0, #000 0.5rem);mask-image:linear-gradient(to top, transparent 0, #000 0.5rem)}@media (pointer: coarse){.MessageList{-webkit-user-select:none;user-select:none;touch-callout:none}.MessageList.select-mode-active{-webkit-user-select:auto;user-select:auto;touch-callout:default}}.MessageList.no-avatars .Message>.Avatar{display:none}.MessageList .messages-container{width:100%;max-width:var(--messages-container-width);min-height:100%;margin:0 auto;display:flex;justify-content:flex-end;flex-direction:column;padding:1rem 1rem 0 1.125rem}.force-messages-scroll .MessageList .messages-container{margin-top:100vh !important}@media (max-width: 600px){.MessageList .messages-container{width:100vw;padding:2.75rem 0.5rem 0;margin:0}}.MessageList.no-composer{margin-bottom:0}.MessageList.no-composer .last-in-list{margin-bottom:1rem}.MessageList.select-mode-active,.MessageList.type-pinned{margin-bottom:0}.MessageList.select-mode-active .last-in-list,.MessageList.type-pinned .last-in-list{margin-bottom:5.625rem}@media (max-width: 600px){.MessageList.select-mode-active .last-in-list,.MessageList.type-pinned .last-in-list{margin-bottom:4.25rem}}.MessageList.select-mode-active .last-in-list.ActionMessage,.MessageList.type-pinned .last-in-list.ActionMessage{padding-bottom:0.125rem}.MessageList .Message,.MessageList .ActionMessage{position:relative;opacity:1;transform:scale(1);transition:opacity .2s ease, transform .2s ease}.MessageList .Message:not(.open),.MessageList .ActionMessage:not(.open){transform:scale(0.8);opacity:0}.MessageList .Message.open.shown,.MessageList .ActionMessage.open.shown{transform:none}.MessageList .Message::before,.MessageList .ActionMessage::before{content:\"\";position:absolute;top:-0.1875rem;bottom:-0.1875rem;left:-50vw;right:-50vw;background:black;z-index:-1;opacity:0;transition:opacity var(--select-transition)}body.animation-level-0 .MessageList .Message::before,body.animation-level-0 .MessageList .ActionMessage::before{transition:none !important}.MessageList .Message:not(.last-in-group)::before,.MessageList .ActionMessage:not(.last-in-group)::before{bottom:-0.1875rem}.MessageList .Message:not(.first-in-group)::before,.MessageList .ActionMessage:not(.first-in-group)::before{top:-0.1875rem}.MessageList .Message.focused::before,.MessageList .ActionMessage.focused::before{transition:none !important}.MessageList .Message.focused::before,.MessageList .Message.is-forwarding::before,.MessageList .Message.is-selected::before,.MessageList .Message.has-menu-open::before,.MessageList .ActionMessage.focused::before,.MessageList .ActionMessage.is-forwarding::before,.MessageList .ActionMessage.is-selected::before,.MessageList .ActionMessage.has-menu-open::before{opacity:0.1}.MessageList>.empty{width:100%;height:100%;display:flex;align-items:center;justify-content:center}.MessageList .sticky-date,.MessageList .local-action-message,.MessageList .ActionMessage,.MessageList .empty{text-align:center}.MessageList .sticky-date>span,.MessageList .local-action-message>span,.MessageList .ActionMessage>span,.MessageList .empty>span{display:inline-block;background:var(--pattern-color);color:white;font-size:calc(var(--message-text-size, 1rem) - .0625rem);font-weight:500;line-height:1.75;padding:0 .5rem;border-radius:2rem;word-break:break-word}body.is-ios .MessageList .sticky-date>span,body.is-macos .MessageList .sticky-date>span,body.is-ios .MessageList .local-action-message>span,body.is-macos .MessageList .local-action-message>span,body.is-ios .MessageList .ActionMessage>span,body.is-macos .MessageList .ActionMessage>span,body.is-ios .MessageList .empty>span,body.is-macos .MessageList .empty>span{font-size:calc(var(--message-text-size, 1rem) - .125rem)}.MessageList .sticky-date>span .emoji-small,.MessageList .local-action-message>span .emoji-small,.MessageList .ActionMessage>span .emoji-small,.MessageList .empty>span .emoji-small{vertical-align:text-bottom;width:calc(1.25 * var(--message-text-size, 1rem));height:calc(1.25 * var(--message-text-size, 1rem));background-size:calc(1.25 * var(--message-text-size, 1rem))}.MessageList .sticky-date.rich>span,.MessageList .local-action-message.rich>span,.MessageList .ActionMessage.rich>span,.MessageList .empty.rich>span{max-width:80%;text-align:left}.MessageList .sticky-date.rich a,.MessageList .sticky-date.rich a:visited,.MessageList .local-action-message.rich a,.MessageList .local-action-message.rich a:visited,.MessageList .ActionMessage.rich a,.MessageList .ActionMessage.rich a:visited,.MessageList .empty.rich a,.MessageList .empty.rich a:visited{color:var(--color-links-darker) !important}.MessageList .sticky-date.rich a:hover,.MessageList .sticky-date.rich a:active,.MessageList .local-action-message.rich a:hover,.MessageList .local-action-message.rich a:active,.MessageList .ActionMessage.rich a:hover,.MessageList .ActionMessage.rich a:active,.MessageList .empty.rich a:hover,.MessageList .empty.rich a:active{color:var(--color-links-darker-hover) !important}.MessageList .sticky-date{margin-top:1rem;margin-bottom:1rem;z-index:var(--z-sticky-date);pointer-events:none;opacity:1;transition:opacity .3s ease}body:not(.is-scrolling-messages) .MessageList .sticky-date.stuck{opacity:0}body:not(.is-scrolling-messages) .MessageList .sticky-date.stuck span{pointer-events:none}body.animation-level-0 .MessageList .sticky-date{transition:none}.MessageList .sticky-date.interactive{cursor:pointer}.MessageList .sticky-date span{pointer-events:auto}.MessageList.scrolled:not(.is-animating) .sticky-date{position:sticky;top:0.625rem}.MessageList.is-animating{overflow:hidden}.MessageList.is-animating .message-select-control{display:none !important}.has-header-tools .MessageList .sticky-date{top:3.75rem}.MessageList .local-action-message,.MessageList .ActionMessage{margin-top:0.5rem;margin-bottom:0.5rem}.MessageList .ActionMessage .action-link{cursor:pointer}.MessageList .ActionMessage .action-link:hover{text-decoration:underline}.MessageList .sticky-date+.ActionMessage{margin-top:-0.5rem}@media (min-width: 1276px){.MessageList{width:100%;transform:translate3d(0, 0, 0);transition:transform var(--layer-transition)}.MessageList .messages-container{width:calc(100% - var(--right-column-width))}body.animation-level-0 .MessageList{transition:none}#Main.right-column-open .MessageList{transform:translate3d(calc(var(--right-column-width) / -2), 0, 0)}body:not(.animating-right-column) #Main.right-column-open .MessageList.select-mode-active,#Main.right-column-open .MessageList:not(.select-mode-active),body.animating-right-column .MessageList:not(.select-mode-active){width:calc(100% - var(--right-column-width))}body:not(.animating-right-column) #Main.right-column-open .MessageList.select-mode-active .messages-container,#Main.right-column-open .MessageList:not(.select-mode-active) .messages-container,body.animating-right-column .MessageList:not(.select-mode-active) .messages-container{width:100%}}@media (max-width: 600px){.MessageList{transition:transform var(--layer-transition)}body.enable-symbol-menu-transforms .MessageList{transform:translate3d(0, 0, 0)}body.is-symbol-menu-open .MessageList{transform:translate3d(0, calc(-1 * (var(--symbol-menu-height) + var(--symbol-menu-footer-height))), 0)}}.MessageList.select-mode-active,.MessageList.has-focus-highlight,body.has-context-menu .MessageList,.animating>div>.MessageList{padding-right:0}.MessageList.select-mode-active::-webkit-scrollbar,.MessageList.has-focus-highlight::-webkit-scrollbar,body.has-context-menu .MessageList::-webkit-scrollbar,.animating>div>.MessageList::-webkit-scrollbar{width:0}@supports (scrollbar-width: none){.MessageList.select-mode-active,.MessageList.has-focus-highlight,body.has-context-menu .MessageList,.animating>div>.MessageList{padding-right:.6875rem;scrollbar-width:none}}.is-safari .MessageList.select-mode-active,.is-safari .MessageList.has-focus-highlight,.is-safari.has-context-menu .messages-layout .MessageList{padding-right:.375rem}\n",".ScrollDownButton{--base-bottom-pos: 6rem;position:absolute;bottom:var(--base-bottom-pos);right:1rem;opacity:0;transform:translateY(4.5rem);transition:transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),opacity 0.2s ease;z-index:10;pointer-events:none}body.animation-level-0 .ScrollDownButton{transform:none !important;transition:opacity .15s}@media (max-width: 600px){.ScrollDownButton{right:0.5rem;bottom:4.5rem}}.ScrollDownButton-inner{display:flex;flex-direction:column;align-items:center}.ScrollDownButton-inner>.Button{box-shadow:0 1px 2px var(--color-default-shadow)}.ScrollDownButton-inner>.Button i{font-size:1.75rem}@media (min-width: 1276px){.ScrollDownButton-inner{transform:translateX(0);transition:transform var(--layer-transition)}body.animation-level-0 .ScrollDownButton-inner{transition:none !important}#Main.right-column-open .ScrollDownButton-inner{transform:translateX(calc(-1 * var(--right-column-width)))}}@media (max-width: 600px){.ScrollDownButton-inner>.Button{width:2.875rem;height:2.875rem}}.ScrollDownButton.revealed{transform:translateY(0);opacity:1;pointer-events:all}.ScrollDownButton.revealed.no-composer{transform:translateY(4rem)}.ScrollDownButton .unread-count{min-width:1.5rem;height:1.5rem;padding:0 .45rem;border-radius:0.75rem;font-size:0.875rem;line-height:1.5rem;font-weight:500;text-align:center;position:absolute;top:-0.3rem;right:-0.3rem;background:var(--color-green);color:white;pointer-events:none}@media (max-width: 600px){.ScrollDownButton .unread-count{top:-0.7rem;right:auto}}@media (max-width: 600px){body.is-symbol-menu-open .ScrollDownButton{bottom:calc(var(--base-bottom-pos) + var(--symbol-menu-height) + var(--symbol-menu-footer-height))}}\n",".ComposerEmbeddedMessage{height:2.625rem;transition:height 150ms ease-out, opacity 150ms ease-out}.select-mode-active+.middle-column-footer .ComposerEmbeddedMessage{display:none}.ComposerEmbeddedMessage:not(.open){height:0 !important}body.animation-level-0 .ComposerEmbeddedMessage{transition:none !important}.ComposerEmbeddedMessage>div{display:flex;align-items:center;padding-right:0.625rem;padding-top:0.45rem}.ComposerEmbeddedMessage>div>.Button{flex-shrink:0;background:none !important;width:2.125rem;height:2.125rem;margin:0 0.625rem;padding:0;align-self:center}\n",".WebPagePreview{height:2.625rem;transition:height 150ms ease-out, opacity 150ms ease-out;--accent-color: var(--color-primary)}body.animation-level-0 .WebPagePreview{transition:none !important}.select-mode-active+.middle-column-footer .WebPagePreview{display:none}.WebPagePreview:not(.open){height:0 !important}.WebPagePreview>div{display:flex;align-items:center;padding-right:0.625rem;padding-top:0.45rem}.ComposerEmbeddedMessage+.WebPagePreview{margin-top:0.75rem}.WebPagePreview>div>.Button{flex-shrink:0;background:none !important;width:2.125rem;height:2.125rem;margin:0 0.625rem;padding:0;align-self:center}.WebPagePreview .WebPage{flex-grow:1;margin:0.1875rem 0 0.1875rem 0.125rem;max-width:calc(100% - 3.375rem)}.WebPagePreview .WebPage::before{top:.1rem;bottom:.05rem}.WebPagePreview .WebPage.with-video .media-inner{display:none}.WebPagePreview .WebPage .site-title,.WebPagePreview .WebPage .site-description{flex:1;max-width:100%;max-height:1rem}.WebPagePreview .WebPage .site-title{margin-top:.125rem;margin-bottom:0.1875rem}.WebPagePreview .WebPage .site-description{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}\n",".Composer{align-items:flex-end}.select-mode-active+.middle-column-footer .Composer{position:absolute;padding-right:2rem;bottom:0}@media (max-width: 600px){.select-mode-active+.middle-column-footer .Composer{padding-right:1rem}}.select-mode-active+.middle-column-footer .Composer::before{right:2.125rem}@media (max-width: 600px){.select-mode-active+.middle-column-footer .Composer::before{right:1rem}}.select-mode-active+.middle-column-footer .Composer .svg-appendix{opacity:0}.Composer .form-control{--border-width: 0}.Composer>.Button{flex-shrink:0;margin-left:.5rem}@media (max-width: 600px){.Composer>.Button{width:2.875rem;height:2.875rem}}.Composer>.Button .icon-send,.Composer>.Button .icon-microphone-alt,.Composer>.Button .icon-check{position:absolute}.Composer>.Button:not(:active):not(:focus):not(:hover) .icon-send,.Composer>.Button:not(:active):not(:focus):not(:hover) .icon-check{color:var(--color-primary)}.Composer>.Button.cancel{position:relative;z-index:1}.Composer>.Button.cancel:hover,.Composer>.Button.cancel.active{background:var(--color-chat-hover)}.Composer>.Button.recording{position:relative;z-index:0;transition:box-shadow .1s}.Composer>.Button.send .icon-send{animation:grow-icon .4s ease-out}.Composer>.Button.send .icon-microphone-alt,.Composer>.Button.send .icon-check{animation:hide-icon .4s forwards ease-out}.Composer>.Button.record .icon-microphone-alt{animation:grow-icon .4s ease-out}.Composer>.Button.record .icon-send,.Composer>.Button.record .icon-check{animation:hide-icon .4s forwards ease-out}.Composer>.Button.edit .icon-send,.Composer>.Button.edit .icon-microphone-alt{animation:hide-icon .4s forwards ease-out}.Composer>.Button.edit .icon-check{animation:grow-icon .4s ease-out}.Composer>.Button.not-ready>i{animation-duration:0ms !important}body.animation-level-0 .Composer>.Button .icon-send,body.animation-level-0 .Composer>.Button .icon-microphone-alt,body.animation-level-0 .Composer>.Button .icon-check,body.animation-level-1 .Composer>.Button .icon-send,body.animation-level-1 .Composer>.Button .icon-microphone-alt,body.animation-level-1 .Composer>.Button .icon-check{animation-duration:0ms !important}.Composer .mobile-symbol-menu-button{width:2.875rem;height:2.875rem;position:relative}.Composer .mobile-symbol-menu-button .icon-smile,.Composer .mobile-symbol-menu-button .icon-keyboard,.Composer .mobile-symbol-menu-button .Spinner{position:absolute}.Composer .mobile-symbol-menu-button .Spinner{--spinner-size: 1.5rem}.Composer .mobile-symbol-menu-button .icon-smile{animation:grow-icon .4s ease-out}.Composer .mobile-symbol-menu-button .icon-keyboard,.Composer .mobile-symbol-menu-button .Spinner{animation:hide-icon .4s forwards ease-out}.Composer .mobile-symbol-menu-button.not-ready>i{animation-duration:0ms !important}.Composer .mobile-symbol-menu-button.is-loading .Spinner{animation:grow-icon .4s ease-out}.Composer .mobile-symbol-menu-button.is-loading .icon-keyboard,.Composer .mobile-symbol-menu-button.is-loading .icon-smile{animation:hide-icon .4s forwards ease-out}.Composer .mobile-symbol-menu-button.menu-opened .icon-keyboard{animation:grow-icon .4s ease-out}.Composer .mobile-symbol-menu-button.menu-opened .icon-smile,.Composer .mobile-symbol-menu-button.menu-opened .Spinner{animation:hide-icon .4s forwards ease-out}#message-compose{flex-grow:1;max-width:calc(100% - 4rem);background:var(--color-background);border-radius:var(--border-radius-messages);border-bottom-right-radius:0;box-shadow:0 1px 2px var(--color-default-shadow);position:relative;z-index:1}#message-compose .svg-appendix{position:absolute;bottom:-.1875rem;right:-.551rem;width:.5625rem;height:1.25rem;transition:opacity 200ms;font-size:1rem !important}#message-compose .svg-appendix .corner{fill:var(--color-background)}@media (max-width: 600px){#message-compose{max-width:calc(100% - 3rem)}}.message-input-wrapper{display:flex}.message-input-wrapper>.Spinner{align-self:center;--spinner-size: 1.5rem}.message-input-wrapper>.Button{flex-shrink:0;background:none !important;width:3.375rem;height:3.375rem;margin:0;padding:0.625rem;align-self:flex-end}@media (max-width: 600px){.message-input-wrapper>.Button{width:2.875rem;height:2.875rem;margin:0 0.25rem}}.message-input-wrapper>.Button+.Button{margin-left:-.25rem}.message-input-wrapper>.Button.scheduled-button i::after{content:'';position:absolute;top:.75rem;right:.75rem;border:0.1875rem solid var(--color-background);box-sizing:content-box;width:.5rem;height:.5rem;border-radius:50%;background:var(--color-green-darker);box-shadow:-0.375rem -0.25rem 0 -0.1875rem var(--color-background)}@media (max-width: 600px){.message-input-wrapper>.Button.scheduled-button i::after{top:.5rem;right:.5rem}}.message-input-wrapper>.input-group{flex-grow:1;margin-bottom:0}.message-input-wrapper .recording-state{display:inline-block;position:relative;line-height:3.5rem;height:3.5rem;padding:0 3.125rem 0 1rem}.message-input-wrapper .recording-state::after{content:'';width:10px;height:10px;background:var(--color-error);border-radius:5px;position:absolute;top:50%;margin-top:-5px;right:1.375rem}@media (max-width: 600px){.message-input-wrapper .recording-state{height:2.875rem;line-height:2.875rem}}#message-input-text,#caption-input-text{position:relative}#message-input-text .form-control,#caption-input-text .form-control{padding:calc((3.25rem - var(--composer-text-size, 1rem) * 1.375) / 2 - var(--border-width, 0) * 2) calc(.9rem - var(--border-width));overflow:hidden;line-height:1.375;font-family:Roboto, -apple-system, \"Apple Color Emoji\", \"Helvetica Neue\", sans-serif;unicode-bidi:plaintext;text-align:initial;font-size:var(--composer-text-size, 1rem)}body.is-ios #message-input-text .form-control,body.is-macos #message-input-text .form-control,body.is-ios #caption-input-text .form-control,body.is-macos #caption-input-text .form-control{font-family:system-ui, -apple-system, BlinkMacSystemFont, \"Roboto\", \"Apple Color Emoji\", \"Helvetica Neue\", sans-serif}#message-input-text .form-control.overflown,#caption-input-text .form-control.overflown{overflow-y:auto;overflow-x:hidden}#message-input-text .form-control.touched+.placeholder-text,#message-input-text .form-control:focus+.placeholder-text,#caption-input-text .form-control.touched+.placeholder-text,#caption-input-text .form-control:focus+.placeholder-text{display:none}#message-input-text .form-control.focus-disabled,#caption-input-text .form-control.focus-disabled{pointer-events:none}#message-input-text .forced-placeholder,#message-input-text .placeholder-text,#caption-input-text .forced-placeholder,#caption-input-text .placeholder-text{position:absolute;color:var(--color-placeholders);pointer-events:none;unicode-bidi:plaintext;text-align:initial;line-height:1.3125;font-size:var(--composer-text-size, 1rem);top:calc((3.25rem - var(--composer-text-size, 1rem) * 1.375) / 2);bottom:auto}#message-input-text .forced-placeholder,#caption-input-text .forced-placeholder{z-index:var(--z-below);left:0;white-space:nowrap;overflow:hidden;max-width:100%;text-overflow:ellipsis}#message-input-text[dir=rtl] .placeholder-text,#caption-input-text[dir=rtl] .placeholder-text{right:0}#message-input-text .text-entity-link,#caption-input-text .text-entity-link{color:var(--color-links) !important;cursor:default;text-decoration:none}#message-input-text .text-entity-link:hover,#message-input-text .text-entity-link:active,#message-input-text .text-entity-link:visited,#caption-input-text .text-entity-link:hover,#caption-input-text .text-entity-link:active,#caption-input-text .text-entity-link:visited{color:var(--color-links-hover) !important}#message-input-text .clone,#caption-input-text .clone{position:absolute;top:0;left:0;opacity:0;pointer-events:none;z-index:-10;unicode-bidi:plaintext;text-align:initial}#message-input-text{flex-grow:1}#message-input-text .form-control{margin-bottom:0;background:transparent !important;border:none !important;border-radius:0 !important;box-shadow:none !important;caret-color:var(--color-text);min-height:3.5rem;max-height:26rem;line-height:1.3125;padding:calc((3.5rem - var(--composer-text-size, 1rem) * 1.3125) / 2) 0;transition:height 100ms ease}@media (max-width: 600px){#message-input-text .form-control{height:2.875rem;min-height:2.875rem;max-height:16rem;padding:calc((2.875rem - var(--composer-text-size, 1rem) * 1.3125) / 2) 0;overflow:auto}}body.animation-level-0 #message-input-text .form-control{transition:none !important}#message-input-text .forced-placeholder,#message-input-text .placeholder-text{top:calc((3.5rem - var(--composer-text-size, 1rem) * 1.3125) / 2)}@media (max-width: 600px){#message-input-text .forced-placeholder,#message-input-text .placeholder-text{top:calc((2.875rem - var(--composer-text-size, 1rem) * 1.3125) / 2)}}#message-input-text:not(:only-child) .form-control{padding-left:0;padding-right:0}.ComposerEmbeddedMessage+.message-input-wrapper #message-input-text .form-control.overflown,.WebPagePreview+.message-input-wrapper #message-input-text .form-control.overflown{margin-top:0.75rem}#message-input-text .emoji{width:1.25rem;height:1.25rem;margin:0 1px -5px;vertical-align:0;pointer-events:none}#caption-input-text .form-control{height:3.25rem;min-height:3.25rem;max-height:15rem}#caption-input-text .placeholder-text{bottom:.8125rem;left:.90625rem}.composer-tooltip{position:absolute;bottom:calc(100% + .5rem);left:0;width:100%;background:var(--color-background);border-radius:var(--border-radius-messages);padding:0.5rem 0;max-height:15rem;overflow-x:hidden;overflow-y:auto;overflow-y:overlay;box-shadow:0 1px 2px var(--color-default-shadow);opacity:0;transform:translateY(1.5rem);transform-origin:bottom;transition:opacity var(--layer-transition),transform var(--layer-transition)}.composer-tooltip:not(.shown){display:none}.composer-tooltip.open{opacity:1;transform:translateY(0)}.composer-tooltip .Loading{margin:1rem 0}\n","#middle-column-bg{position:absolute;top:0;left:0;bottom:0;right:0;overflow:hidden;z-index:-1}#middle-column-bg::before,#middle-column-bg::after{content:\"\";display:block;position:absolute;top:0;left:0;bottom:0;right:0;background-color:var(--theme-background-color)}#middle-column-bg::after{background-position:center;background-repeat:no-repeat;background-size:cover}.theme-light #middle-column-bg::after{background-image:url(chat-bg.f607e788298d8a7de37a3b39b76c1efa.jpg)}@media (max-width: 600px){.theme-light #middle-column-bg::after{background-image:url(chat-bg-mobile.3ebe59c803c10092f2233e6e00ab2492.jpg)}}body:not(.animation-level-0) #root #middle-column-bg::after{transition:transform var(--layer-transition),opacity 0.2s !important}body.animation-level-0 #middle-column-bg::after{transition:none}.custom-bg-color:not(.custom-bg-image)>#middle-column-bg::after{opacity:0}.custom-bg-image>#middle-column-bg::after{background-image:var(--custom-background) !important;filter:none;transform:scale(1.1)}.custom-bg-image.blurred>#middle-column-bg::after{filter:blur(12px)}@media screen and (min-width: 1276px){body.animation-level-2 #middle-column-bg::after{margin:-16rem -5rem -20rem 0;overflow:hidden;transform:scale(1);transform-origin:left center;transition:transform var(--layer-transition)}body.animation-level-2 #Main.right-column-open #middle-column-bg::after{transform:scale(0.67) !important}}#MiddleColumn{display:flex;justify-content:center;height:100%;position:relative;z-index:1}@media (max-width: 600px){#MiddleColumn{overflow:hidden}}#MiddleColumn .messages-layout{--slide-transition: 450ms cubic-bezier(0.25, 1, 0.5, 1);display:flex;flex-direction:column;align-items:center;width:100%;height:100%;position:relative;overflow:hidden}#MiddleColumn .messages-layout>.Transition{width:100%;height:100%;overflow:hidden}#MiddleColumn .messages-layout>.Transition>div{display:flex;flex-direction:column;align-items:center}#MiddleColumn .messaging-disabled-inner{width:100%;padding:1rem;border-radius:var(--border-radius-messages);background:var(--color-background);color:var(--color-text-secondary);text-align:center;box-shadow:0 1px 2px var(--color-default-shadow)}#MiddleColumn .Composer #message-compose{transform:scaleX(1) translateX(0);transition:transform var(--select-transition),border-bottom-right-radius var(--select-transition)}#MiddleColumn .Composer #message-compose::before{transform:scaleX(-1) translateX(0);transition:transform var(--select-transition)}body.animation-level-0 #MiddleColumn .Composer #message-compose,body.animation-level-0 #MiddleColumn .Composer #message-compose::before{transition:none !important}#MiddleColumn .Composer .message-input-wrapper,#MiddleColumn .Composer::before{opacity:1;transition:opacity var(--select-transition)}body.animation-level-0 #MiddleColumn .Composer .message-input-wrapper,body.animation-level-0 #MiddleColumn .Composer::before{transition:none !important}#MiddleColumn .Composer>.Button{opacity:1;transform:scale(1);transition:opacity var(--select-transition),transform var(--select-transition)}body.animation-level-0 #MiddleColumn .Composer>.Button{transition:none !important}#MiddleColumn .Composer.hover-disabled,#MiddleColumn .Composer:not(.shown){pointer-events:none}#MiddleColumn .Composer:not(.shown) .ComposerEmbeddedMessage{height:0}#MiddleColumn .Composer:not(.shown) #message-compose{transform:scaleX(var(--composer-hidden-scale, 1)) translateX(var(--composer-translate-x, 0));border-bottom-right-radius:var(--border-radius-messages)}#MiddleColumn .Composer:not(.shown) #message-compose::before{transform:scaleX(-1) translateX(200%)}#MiddleColumn .Composer:not(.shown) #editable-message-text{height:3.5rem !important}@media (max-width: 600px){#MiddleColumn .Composer:not(.shown) #editable-message-text{height:2.5rem !important}}#MiddleColumn .Composer:not(.shown) .message-input-wrapper,#MiddleColumn .Composer:not(.shown)::before{opacity:0}#MiddleColumn .Composer:not(.shown)>.Button{opacity:0 !important;transform:scale(0.5)}#MiddleColumn .messaging-disabled{transform:scaleX(1);transition:transform var(--select-transition)}#MiddleColumn .messaging-disabled .messaging-disabled-inner span{opacity:1;transition:opacity var(--select-transition)}body.animation-level-0 #MiddleColumn .messaging-disabled .messaging-disabled-inner span{transition:none !important}body.animation-level-0 #MiddleColumn .messaging-disabled{transition:none !important}#MiddleColumn .messaging-disabled:not(.shown){transform:scaleX(var(--composer-hidden-scale, 1));pointer-events:none}#MiddleColumn .messaging-disabled:not(.shown) .messaging-disabled-inner span{opacity:0}#MiddleColumn .middle-column-footer{width:100%;max-width:var(--messages-container-width);padding:0 1rem;position:relative;display:flex;align-items:flex-end;z-index:var(--z-middle-footer);transform:translate3d(0, 0, 0);transition:transform var(--layer-transition)}body.animation-level-0 #MiddleColumn .middle-column-footer{transition:none !important}@media (min-width: 1276px){#MiddleColumn .middle-column-footer{width:calc(100% - var(--right-column-width))}#Main.right-column-open #MiddleColumn .middle-column-footer{transform:translate3d(calc(var(--right-column-width) / -2), 0, 0)}}@media (max-width: 600px){#MiddleColumn .middle-column-footer{padding:0 0.5rem}body.is-symbol-menu-open #MiddleColumn .middle-column-footer{transform:translate3d(0, calc(-1 * (var(--symbol-menu-height) + var(--symbol-menu-footer-height))), 0)}}#MiddleColumn .middle-column-footer::before{content:\"\";position:absolute;top:-.5625rem;left:0;right:0;height:1px;background:linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.4) 2%, rgba(255,255,255,0.4) 98%, rgba(255,255,255,0) 100%);opacity:0;transition:opacity 350ms ease}@media (max-width: 600px){#MiddleColumn .middle-column-footer::before{left:-2%;right:-2%}}#MiddleColumn .middle-column-footer.with-notch::before{opacity:1}html.theme-dark #MiddleColumn .middle-column-footer::before{background:linear-gradient(90deg, rgba(127,127,127,0) 0%, rgba(127,127,127,0.4) 2%, rgba(127,127,127,0.4) 98%, rgba(127,127,127,0) 100%)}.Composer,.MessageSelectToolbar,.messaging-disabled{margin-bottom:1.25rem}@media (max-width: 600px){.Composer,.MessageSelectToolbar,.messaging-disabled{margin-bottom:0.5rem}}.Composer,.MessageSelectToolbar,.unpin-all-button,.messaging-disabled{width:100%;display:flex;justify-content:center;position:relative}.mask-image-disabled .MessageSelectToolbar-inner,.mask-image-disabled .unpin-all-button,.mask-image-disabled .messaging-disabled{box-shadow:0 0.25rem 0.5rem 0.125rem var(--color-default-shadow)}.unpin-button-container{width:100%;display:flex;justify-content:center;position:absolute;padding-bottom:1.25rem}.unpin-button-container .unpin-all-button{text-transform:capitalize;color:var(--color-black);height:3.5rem;overflow:visible;transform:scaleX(1);transition:transform var(--select-transition),background-color 0.15s,color 0.15s}.unpin-button-container .unpin-all-button:hover .icon-unpin{color:var(--color-white)}.select-mode-active+.middle-column-footer .unpin-button-container .unpin-all-button{box-shadow:none;transform:scaleX(var(--unpin-hidden-scale))}@media (max-width: 600px){.unpin-button-container .unpin-all-button{height:2.5rem}}.unpin-button-container .unpin-all-button .icon-unpin{margin-inline-start:-0.4375rem;margin-inline-end:.75rem;color:var(--color-text-secondary);font-size:1.5rem;transition:color .15s}@media (max-width: 600px){.unpin-button-container{padding-bottom:0.75rem}}.mask-image-disabled .unpin-button-container::before{background:unset}\n",".RightHeader{display:flex;align-items:center;height:var(--header-height);padding:0.5rem .8125rem;pointer-events:auto}@media (max-width: 600px){.RightHeader{padding:0.5rem}}.RightHeader .close-button{flex-shrink:0}.RightHeader>.Transition{flex:1;height:100%}.RightHeader>.Transition>div{display:flex;align-items:center}.RightHeader h3{margin-bottom:0;font-size:1.25rem;font-weight:500;margin-left:1.375rem}.RightHeader .tools{display:flex;margin-left:auto}.RightHeader .SearchInput{margin-left:1rem}@media (min-width: 600px){.RightHeader .SearchInput{margin-right:1rem}}.RightHeader .DropdownMenu{margin-left:auto}\n",".ProfilePhoto{width:100%;height:100%;cursor:pointer;position:relative}.ProfilePhoto img{width:100%;object-fit:cover}.ProfilePhoto .prev-avatar-media{position:absolute;left:0;top:0;z-index:-1}.ProfilePhoto .spinner-wrapper{width:100%;height:100%}.ProfilePhoto .spinner-wrapper,.ProfilePhoto.deleted-account,.ProfilePhoto.no-photo,.ProfilePhoto.saved-messages{display:flex;align-items:center;justify-content:center;color:var(--color-white);background:linear-gradient(var(--color-white) -125%, var(--color-user));cursor:default}.ProfilePhoto.no-photo{font-size:14rem}.ProfilePhoto.deleted-account,.ProfilePhoto.saved-messages{font-size:20rem}\n",".ProfileInfo{aspect-ratio:1 / 1;position:relative}@supports not (aspect-ratio: 1/1){.ProfileInfo::before{float:left;padding-top:100%;content:\"\"}.ProfileInfo::after{display:block;content:\"\";clear:both}}.ProfileInfo .photo-wrapper{width:100%;position:absolute;left:0;top:0;bottom:0}.ProfileInfo .photo-wrapper>.Transition{width:100%;height:100%}.ProfileInfo .photo-dashes{position:absolute;width:100%;height:.125rem;padding:0 .375rem;z-index:1;display:flex;top:.5rem;left:0}.ProfileInfo .photo-dash{flex:1 1 auto;background-color:var(--color-white);opacity:.5;border-radius:.125rem;margin:0 .125rem}.ProfileInfo .photo-dash.current{opacity:1}.ProfileInfo .navigation{position:absolute;top:0;bottom:0;width:25%;border:none;padding:0;margin:0;-webkit-appearance:none;appearance:none;background:transparent no-repeat;background-size:1.25rem;opacity:.25;transition:opacity .15s;outline:none;cursor:pointer;z-index:1}.ProfileInfo .navigation:hover,.is-touch-env .ProfileInfo .navigation{opacity:1}.ProfileInfo .navigation.prev{left:0;background-image:url(media_navigation_previous.11f3cfece8fead5a78e6349db2545210.svg);background-position:1.25rem 50%}.ProfileInfo .navigation.next{right:0;background-image:url(media_navigation_next.3d6e264d21e73ad725738beb8e9dbbb8.svg);background-position:calc(100% - 1.25rem) 50%}.ProfileInfo .info{position:absolute;bottom:0;left:0;width:100%;min-height:100px;padding:0 1.5rem .5rem;background:linear-gradient(0deg, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0) 100%);color:var(--color-white);display:flex;flex-direction:column;justify-content:flex-end;pointer-events:none}.ProfileInfo .info:dir(rtl) .status{text-align:right;unicode-bidi:plaintext}.ProfileInfo .info[dir=rtl] .status{text-align:right;unicode-bidi:plaintext}.ProfileInfo .title{display:flex;align-items:center}.ProfileInfo .title h3{font-weight:500;font-size:1.25rem;line-height:1.375rem;white-space:pre-wrap;word-break:break-word;margin-bottom:.25rem}.ProfileInfo .title .VerifiedIcon{margin-left:0.25rem;margin-top:-0.125rem}.ProfileInfo .title .emoji{width:1.5rem;height:1.5rem;background-size:1.5rem}.ProfileInfo .status{font-size:0.875rem;opacity:.5}.ProfileInfo[dir=rtl] .navigation.prev{left:auto;right:0;transform:scaleX(-1)}.ProfileInfo[dir=rtl] .navigation.next{left:0;right:auto;transform:scaleX(-1)}\n",".Profile{height:100%;display:flex;flex-direction:column;overflow-y:scroll;overflow-x:hidden}@supports (overflow-y: overlay){.Profile{overflow-y:overlay !important}}.Profile>.profile-info>.ChatInfo{grid-area:chat_info}.Profile>.profile-info>.ChatInfo .status.online{color:var(--color-primary)}.Profile>.profile-info>.ChatExtra{padding:.875rem .5rem .5rem;box-shadow:inset 0 -0.0625rem 0 0 var(--color-background-secondary-accent);border-bottom:0.625rem solid var(--color-background-secondary)}.Profile>.profile-info>.ChatExtra .narrow{margin-bottom:0}.Profile>.profile-info>.ChatExtra .inactive.no-selection{user-select:auto;-webkit-user-select:auto !important}.Profile>.profile-info>.ChatExtra .Switcher{margin-left:auto}.Profile>.profile-info>.ChatExtra [dir=rtl] .Switcher{margin-left:0;margin-right:auto}.Profile .FloatingActionButton{z-index:1}.shared-media{display:flex;flex-direction:column-reverse}.shared-media .TabList{background:var(--color-background);top:-1px;z-index:1}.shared-media .TabList .Tab{padding:1rem .25rem}.shared-media .TabList .Tab i{bottom:-1rem}.shared-media .Transition{flex:1}.shared-media .content.empty-list{height:100%;padding-top:5rem;display:flex;align-items:flex-start;justify-content:center}.shared-media .content.empty-list .Spinner{--spinner-size: 2.75rem}.shared-media .content.media-list{display:grid;grid-template-columns:repeat(3, 1fr);grid-auto-rows:1fr;grid-gap:.0625rem}.shared-media .content.documents-list{padding:1.25rem}.shared-media .content.documents-list .File+.File{margin-top:1.25rem}.shared-media .content.links-list{padding:1.25rem}.shared-media .content.links-list .ProgressSpinner,.shared-media .content.links-list .message-upload-progress{display:none}.shared-media .content.audio-list{padding:1.25rem}.shared-media .content.audio-list .Audio .media-loading{top:0;left:0;display:flex;align-items:center;justify-content:center}.shared-media .content.audio-list .Audio+.Audio{margin-top:1.6875rem}.shared-media .content.members-list{padding:0.5rem 1rem}@media (max-width: 600px){.shared-media .content.members-list{padding:.5rem 0}.shared-media .content.members-list .ListItem.chat-item-clickable{margin:0}}\n",".AddChatMembers{height:100%;overflow:hidden;position:relative}.AddChatMembers-inner{height:100%;overflow:hidden}\n","#RightColumn{position:absolute;top:0;right:0;width:var(--right-column-width);height:100%;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}#RightColumn:not(:hover) .chat-item-clickable:not(.picker-list-item):nth-child(n+18){display:none !important}@media (max-width: 1275px){#RightColumn{box-shadow:0 0.25rem 0.5rem 0.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:0.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:0.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:black;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)}\n","#Main{display:flex;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)}}#LeftColumn{flex:1;min-width:18rem;max-width:26.5rem;height:100%}@media (max-width: 600px){#LeftColumn{height:calc(var(--vh, 1vh) * 100)}}@media (min-width: 1680px){#LeftColumn{border-left:1px solid var(--color-borders)}}@media (max-width: 1275px){#LeftColumn{flex:2}}@media (max-width: 925px){#LeftColumn{position:fixed;left:0;top:0;height:calc(var(--vh, 1vh) * 100);width:26.5rem;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:black;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;width:100vw;transform:translate3d(-20vw, 0, 0)}}@media (min-width: 1680px){#RightColumn{border-right:1px solid var(--color-borders)}}@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{flex:3;border-left:1px solid var(--color-borders);max-width:75vw}@media (max-width: 1275px){#MiddleColumn{max-width:calc(100vw - 26.5rem)}}@media (max-width: 66.25rem){#MiddleColumn{max-width:60vw}}@media (min-width: 1680px){#MiddleColumn{border-right:1px solid var(--color-borders);max-width:calc(1680px - 26.5rem)}}@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}\n"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/4.7cbc0883ea4cc7908cba.js b/dist/4.7cbc0883ea4cc7908cba.js deleted file mode 100644 index 48f0361f..00000000 --- a/dist/4.7cbc0883ea4cc7908cba.js +++ /dev/null @@ -1,2 +0,0 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[4],{105:function(e,t,a){"use strict";a.r(t),a.d(t,"Main",(function(){return rc}));var s=a(1),n=a(2),c=a(0),r=(a(85),a(11)),o=a(7),i=a(51),l=a(4);function d(e){const{chatId:t,threadId:a}=Object(o.z)(e)||{};return t&&a?(e=Object(r.Z)(e,t,a,!1),e=Object(r.u)(e,t,a,void 0)):e}Object(s.b)("openLocalTextSearch",e=>{const{chatId:t,threadId:a}=Object(o.z)(e)||{};if(t&&a)return Object(r.Z)(e,t,a,!0)}),Object(s.b)("closeLocalTextSearch",d),Object(s.b)("setLocalTextSearchQuery",(e,t,a)=>{const{chatId:s,threadId:n}=Object(o.z)(e)||{};if(!s||!n)return;const{query:c}=a,d=Object(l.a)(s,n),{query:b}=e.localTextSearch.byChatThreadKey[d]||{};return c!==b&&(e=Object(r.u)(e,s,n,i.a)),e=Object(r.Z)(e,s,n,!0,c)}),Object(s.b)("setLocalMediaSearchType",(e,t,a)=>{const{chatId:s}=Object(o.z)(e)||{};if(!s)return;const{mediaType:n}=a;return Object(r.Y)(e,s,n)}),Object(s.b)("openChat",(e,t,a)=>{const{id:n,threadId:c=-1,type:i="thread",shouldReplaceHistory:l=!1}=a,b=Object(o.z)(e);return b&&b.chatId===n&&b.threadId===c&&b.type===i||(e=Object(r.y)(e,n,c,"replyStack",[]),e=d(e=Object(r.o)(e)),e={...e,messages:{...e.messages,contentToBeScheduled:void 0},...n!==e.forwardMessages.toChatId&&{forwardMessages:{}}},Object(s.g)(e)),Object(r.O)(e,n,c,i,l)}),Object(s.b)("openPreviousChat",e=>Object(r.O)(e,void 0)),Object(s.b)("openChatWithInfo",(e,t,a)=>{Object(s.g)({...e,isChatInfoShown:!0}),t.openChat(a)}),Object(s.b)("resetChatCreation",e=>({...e,chatCreation:void 0})),Object(s.b)("setNewChatMembersDialogState",(e,t,a)=>({...e,newChatMembersProgress:a})),Object(s.b)("openNextChat",(e,t,a)=>{const{targetIndexDelta:s,orderedIds:n}=a,{chatId:c}=Object(o.z)(e)||{};if(!c)return void t.openChat({id:n[0]});const r=n.indexOf(c);if(-1===r)return;const i=n[r+s];t.openChat({id:i,shouldReplaceHistory:!0})});var b=a(8),u=a(13),m=a(6),h=a(3);const O=n.C+n.c;let j;Object(s.b)("setScrollOffset",(e,t,a)=>{const{chatId:s,threadId:n,scrollOffset:c}=a;return Object(r.y)(e,s,n,"scrollOffset",c)}),Object(s.b)("setReplyingToId",(e,t,a)=>{const{messageId:s}=a,n=Object(o.z)(e);if(!n)return;const{chatId:c,threadId:i}=n;return Object(r.y)(e,c,i,"replyingToId",s)}),Object(s.b)("setEditingId",(e,t,a)=>{const{messageId:s}=a,n=Object(o.z)(e);if(!n)return;const{chatId:c,threadId:i,type:l}=n,d="scheduled"===l?"editingScheduledId":"editingId";return Object(r.y)(e,c,i,d,s)}),Object(s.b)("editLastMessage",e=>{const{chatId:t,threadId:a}=Object(o.z)(e)||{};if(!t||!a)return;const s=Object(o.n)(e,t),n=Object(o.Kb)(e,t,a);if(!s||!n)return;const c=Object(h.g)(n,t=>Boolean(s[t]&&Object(o.b)(e,s[t],a).canEdit));return c?Object(r.y)(e,t,a,"editingId",c):void 0}),Object(s.b)("replyToNextMessage",(e,t,a)=>{const{targetIndexDelta:s}=a,{chatId:n,threadId:c}=Object(o.z)(e)||{};if(!n||!c)return;const r=Object(o.n)(e,n),i=Object(o.Kb)(e,n,c);if(!r||!i)return;const l=Object(o.ob)(e,n,c);let d;if(Object(o.Y)(e,n,c)&&l){const e=Object.keys(r),t=e.indexOf(l.toString())+s;d=t<=e.length+1&&t>=0?Number(e[t]):void 0}else if(c===b.MAIN_THREAD_ID){const t=Object(o.g)(e,n);d=t&&t.lastMessage?t.lastMessage.id:void 0}else{const t=Object(o.Fb)(e,n,c);d=t?t.lastMessageId:void 0}t.setReplyingToId({messageId:d}),t.focusMessage({chatId:n,threadId:c,messageId:d})}),Object(s.b)("openMediaViewer",(e,t,a)=>{const{chatId:s,threadId:n,messageId:c,avatarOwnerId:r,profilePhotoIndex:o,origin:i}=a;return{...e,mediaViewer:{chatId:s,threadId:n,messageId:c,avatarOwnerId:r,profilePhotoIndex:o,origin:i},forwardMessages:{}}}),Object(s.b)("closeMediaViewer",e=>({...e,mediaViewer:{}})),Object(s.b)("openAudioPlayer",(e,t,a)=>{const{chatId:s,threadId:n,messageId:c}=a;return{...e,audioPlayer:{chatId:s,threadId:n,messageId:c}}}),Object(s.b)("closeAudioPlayer",e=>({...e,audioPlayer:{}})),Object(s.b)("openPollResults",(e,t,a)=>{const{chatId:n,messageId:c}=a;Object(o.W)(e)?n===e.pollResults.chatId&&c===e.pollResults.messageId||Object(s.g)({...e,pollResults:{chatId:n,messageId:c,voters:{}}}):window.setTimeout(()=>{const e=Object(s.e)();Object(s.g)({...e,pollResults:{chatId:n,messageId:c,voters:{}}})},450)}),Object(s.b)("closePollResults",e=>{Object(s.g)({...e,pollResults:{}})}),Object(s.b)("focusLastMessage",(e,t)=>{const a=Object(o.z)(e);if(!a)return;const{chatId:s,threadId:n}=a;let c;if(n===b.MAIN_THREAD_ID){const t=Object(o.g)(e,s);c=t&&t.lastMessage?t.lastMessage.id:void 0}else{const t=Object(o.Fb)(e,s,n);c=t?t.lastMessageId:void 0}c&&t.focusMessage({chatId:s,threadId:n,messageId:c,noHighlight:!0})}),Object(s.b)("focusNextReply",(e,t)=>{const a=Object(o.z)(e);if(!a)return;const{chatId:n,threadId:c}=a,i=Object(o.nb)(e,n,c);if(i&&0!==i.length){const a=i.pop();e=Object(r.y)(e,n,c,"replyStack",[...i]),Object(s.g)(e),t.focusMessage({chatId:n,threadId:c,messageId:a})}else t.focusLastMessage()}),Object(s.b)("focusMessage",(e,t,a)=>{const{chatId:n,threadId:c=b.MAIN_THREAD_ID,messageListType:i="thread",noHighlight:l,groupedId:d,groupedChatId:m,replyMessageId:h}=a;let{messageId:g}=a;if(void 0!==d){const t=Object(o.J)(e,m,d);t&&t.length&&([g]=t)}const p=Object(o.z)(e),f=!p||n!==p.chatId||c!==p.threadId||i!==p.type;if(j&&(clearTimeout(j),j=void 0),j=window.setTimeout(()=>{let e=Object(s.e)();e=Object(r.Q)(e),e=Object(r.P)(e),Object(s.g)(e)},l?O:1500),e=Object(r.Q)(e,n,g,l),e=Object(r.P)(e,void 0),h){const t=Object(o.nb)(e,n,c)||[];e=Object(r.y)(e,n,c,"replyStack",[...t,h])}f&&(e=Object(r.P)(e,u.b.Static));const I=Object(o.Kb)(e,n,c);if(I&&I.includes(g))return Object(s.g)(e),void t.openChat({id:n,threadId:c});if(f&&(e=Object(r.y)(e,n,c,"viewportIds",void 0)),e=Object(r.y)(e,n,c,"outlyingIds",void 0),I&&!f){const t=g>I[0]?u.b.Down:u.b.Up;e=Object(r.P)(e,t)}Object(s.g)(e),t.openChat({id:n,threadId:c}),t.loadViewportMessages()}),Object(s.b)("openForwardMenu",(e,t,a)=>{const{fromChatId:s,messageIds:n,groupedId:c}=a;let r;return c&&(r=Object(o.bb)(e,s,c)),{...e,forwardMessages:{fromChatId:s,messageIds:r||n,isModalShown:!0}}}),Object(s.b)("exitForwardMode",e=>{Object(s.g)({...e,forwardMessages:{}})}),Object(s.b)("setForwardChatId",(e,t,a)=>{const{id:n}=a;Object(s.g)({...e,forwardMessages:{...e.forwardMessages,toChatId:n,isModalShown:!1}}),t.openChat({id:n}),t.closeMediaViewer(),t.exitMessageSelectMode()}),Object(s.b)("openForwardMenuForSelectedMessages",(e,t)=>{if(!e.selectedMessages)return;const{chatId:a,messageIds:s}=e.selectedMessages;t.openForwardMenu({fromChatId:a,messageIds:s})}),Object(s.b)("enterMessageSelectMode",(e,t,a)=>{const{messageId:s}=a||{},n=Object(o.s)(e);return n?Object(r.n)(e,n.id,s):e}),Object(s.b)("toggleMessageSelection",(e,t,a)=>{const{messageId:n,groupedId:c,childMessageIds:i,withShift:l}=a,d=Object(o.z)(e);if(!d)return;const{chatId:b,threadId:u,type:h}=d;e=Object(r.H)(e,b,u,h,n,c,i,l),Object(s.g)(e),e.shouldShowContextMenuHint&&(t.disableContextMenuHint(),t.showNotification({message:`To **edit** or **reply**, close this menu. Then ${m.n?"long tap":"right click"} on a message.`}))}),Object(s.b)("disableContextMenuHint",e=>{if(e.shouldShowContextMenuHint)return{...e,shouldShowContextMenuHint:!1}}),Object(s.b)("exitMessageSelectMode",r.o),Object(s.b)("openPollModal",e=>({...e,isPollModalOpen:!0})),Object(s.b)("closePollModal",e=>({...e,isPollModalOpen:!1}));Object(s.b)("setGlobalSearchQuery",(e,t,a)=>{const{query:s}=a,{chatId:n}=e.globalSearch;return Object(r.S)(e,{globalResults:{},localResults:{},resultsByType:void 0,...s?{fetchingStatus:{chats:!n,messages:!0}}:{fetchingStatus:void 0},query:s})}),Object(s.b)("addRecentlyFoundChatId",(e,t,a)=>{const{id:s}=a,{recentlyFoundChatIds:n}=e.globalSearch;if(!n)return Object(r.S)(e,{recentlyFoundChatIds:[s]});const c=n.filter(e=>e!==s);return c.unshift(s),c.length>10&&c.pop(),Object(r.S)(e,{recentlyFoundChatIds:c})}),Object(s.b)("clearRecentlyFoundChats",e=>Object(r.S)(e,{recentlyFoundChatIds:void 0})),Object(s.b)("setGlobalSearchContent",(e,t,a)=>{const{content:s}=a;return Object(r.T)(e,s)}),Object(s.b)("setGlobalSearchChatId",(e,t,a)=>{const{id:s}=a;return Object(r.S)(e,{chatId:s,query:void 0,resultsByType:void 0})}),Object(s.b)("setStickerSearchQuery",(e,t,a)=>{const{query:s}=a;return{...e,stickers:{...e.stickers,search:{query:s,resultIds:void 0}}}}),Object(s.b)("setGifSearchQuery",(e,t,a)=>{const{query:s}=a;return{...e,gifs:{...e.gifs,search:{query:s,offsetId:void 0,results:void 0}}}}),Object(s.b)("openUserInfo",(e,t,a)=>{const{id:s}=a;t.openChat({id:s})});Object(s.b)("openChat",e=>Object(r.gb)(e,void 0)),Object(s.b)("setUserSearchQuery",(e,t,a)=>{const{query:s}=a;return Object(r.pb)(e,{globalUserIds:void 0,localUserIds:void 0,fetchingStatus:Boolean(s),query:s})});a(86);var g=a(177);Object(s.b)("toggleChatInfo",e=>({...e,isChatInfoShown:!e.isChatInfoShown})),Object(s.b)("toggleManagement",e=>{const{chatId:t}=Object(o.z)(e)||{};if(t)return{...e,management:{byChatId:{...e.management.byChatId,[t]:{...e.management.byChatId[t],isActive:!(e.management.byChatId[t]||{}).isActive}}}}}),Object(s.b)("closeManagement",e=>{const{chatId:t}=Object(o.z)(e)||{};if(t)return{...e,management:{byChatId:{...e.management.byChatId,[t]:{...e.management.byChatId[t],isActive:!1}}}}}),Object(s.b)("openChat",e=>{if(m.l||m.m)return{...e,isLeftColumnShown:0===e.messages.messageLists.length}}),Object(s.b)("toggleLeftColumn",e=>({...e,isLeftColumnShown:!e.isLeftColumnShown})),Object(s.b)("addRecentEmoji",(e,t,a)=>{const{emoji:s}=a,{recentEmojis:n}=e;if(!n)return{...e,recentEmojis:[s]};const c=n.filter(e=>e!==s);return c.unshift(s),c.length>18&&c.pop(),{...e,recentEmojis:c}}),Object(s.b)("addRecentSticker",(e,t,a)=>{const{sticker:s}=a,{recent:n}=e.stickers;if(!n)return{...e,stickers:{...e.stickers,recent:{hash:0,stickers:[s]}}};const c=n.stickers.filter(e=>e.id!==s.id);return c.unshift(s),{...e,stickers:{...e.stickers,recent:{...n,stickers:c}}}}),Object(s.b)("showNotification",(e,t,a)=>{const s=a,n=[...e.notifications],c=n.findIndex(e=>e.message===s.message);return-1!==c&&n.splice(c,1),n.push(s),{...e,notifications:n}}),Object(s.b)("dismissNotification",e=>{const t=[...e.notifications];return t.pop(),{...e,notifications:t}}),Object(s.b)("showDialog",(e,t,a)=>{const{data:s}=a;if("message"in s&&s.hasErrorKey&&!Object(g.a)(s))return e;const n=[...e.dialogs];if("message"in s){const e=n.findIndex(e=>e.message===s.message);-1!==e&&n.splice(e,1)}return n.push(s),{...e,dialogs:n}}),Object(s.b)("dismissDialog",e=>{const t=[...e.dialogs];return t.pop(),{...e,dialogs:t}}),Object(s.b)("toggleSafeLinkModal",(e,t,a)=>{const{url:s}=a;return{...e,safeLinkModalUrl:s}}),Object(s.b)("openHistoryCalendar",(e,t,a)=>{const{selectedAt:s}=a;return{...e,historyCalendarSelectedAt:s}}),Object(s.b)("closeHistoryCalendar",e=>({...e,historyCalendarSelectedAt:void 0})),Object(s.b)("openPaymentModal",(e,t,a)=>{const{messageId:s}=a;return{...e,payment:{...e.payment,messageId:s,isPaymentModalOpen:!0}}}),Object(s.b)("closePaymentModal",e=>{const t=Object(r.i)(e);return Object(r.j)(t)});a(87);var p=a(5),f=a(10);const I=Object(f.h)(e=>e(),1e3,!0),v=Object(f.h)(e=>e(),3e3,!0),y=Object(f.a)(e=>e(),500,!1,!0);async function C(e,t,a){const c=await Object(p.a)("fetchChats",{limit:n.l,offsetDate:a,archived:"archived"===e,withPinned:void 0===Object(s.e)().chats.orderedPinnedIds[e],serverTimeOffset:Object(s.e)().serverTimeOffset});if(!c)return;const{chatIds:o}=c;o.length>0&&o[0]===t&&o.shift();let i=Object(s.e)();i=Object(r.g)(i,Object(h.c)(c.users,"id")),i=Object(r.N)(i,Object(h.c)(c.chats,"id")),i=Object(r.J)(i,e,o),i=Object(r.K)(i,e,c),Object.keys(c.draftsById).map(Number).forEach(e=>{i=Object(r.y)(i,e,b.MAIN_THREAD_ID,"draft",c.draftsById[e])}),Object.keys(c.replyingToById).map(Number).forEach(e=>{i=Object(r.y)(i,e,b.MAIN_THREAD_ID,"replyingToId",c.replyingToById[e])}),0!==o.length||i.chats.isFullyLoaded[e]||(i={...i,chats:{...i.chats,isFullyLoaded:{...i.chats.isFullyLoaded,[e]:!0}}}),Object(s.g)(i)}async function E(e){const t=await Object(p.a)("fetchFullChat",e);if(!t)return;const{users:a,fullInfo:n}=t;let c=Object(s.e)();a&&(c=Object(r.g)(c,Object(h.c)(a,"id"))),c=Object(r.I)(c,e.id,{fullInfo:n}),Object(s.g)(c)}async function w(e,t,a){const n=Object(s.e)(),c=Object(o.i)(n,t);if(c&&!c.isMin)return void(a?e.focusMessage({chatId:c.id,messageId:a}):e.openChat({id:c.id}));const i=Object(o.s)(n);e.openChat({id:-1});const l=await Object(p.a)("getChatByUsername",t);if(!l)return i&&e.openChat({id:i.id}),void e.showNotification({message:"User does not exist"});Object(s.g)(Object(r.I)(Object(s.e)(),l.id,l)),a?e.focusMessage({chatId:l.id,messageId:a}):e.openChat({id:l.id})}Object(s.b)("preloadTopChatMessages",(e,t)=>{(async()=>{const a=[];for(let c=0;ce!==i&&!a.includes(e));if(!m)return;a.push(m.id),t.loadViewportMessages({chatId:m.id,threadId:b.MAIN_THREAD_ID})}})()}),Object(s.b)("openChat",(e,t,a)=>{const{id:s,threadId:n}=a,{currentUserId:c}=e,r=Object(o.g)(e,s);if(r&&r.hasUnreadMark&&t.toggleChatUnread({id:s}),r)Object(l.pb)(r)&&!r.isMin&&t.requestChatUpdate({chatId:s});else if(s===c)Object(p.a)("fetchChat",{type:"self"});else{const t=Object(o.Jb)(e,s);t&&Object(p.a)("fetchChat",{type:"user",user:t})}if(n!==b.MAIN_THREAD_ID){Object(o.Hb)(e,s,n)||t.requestThreadInfoUpdate({chatId:s,threadId:n})}}),Object(s.b)("openSupportChat",(e,t)=>{const a=Object(o.Cb)(e);t.openChat({id:a?a.id:-1}),a||(async()=>{const e=await Object(p.a)("fetchChat",{type:"support"});e&&t.openChat({id:e.chatId})})()}),Object(s.b)("openTipsChat",(e,t,a)=>{const{langCode:s}=a,c="pt-br"===s?"BR":n.S.includes(s)?s.toUpperCase():"";t.openChatByUsername({username:`${n.Pb}${c}`})}),Object(s.b)("loadMoreChats",(e,t,a)=>{const{listType:s="active"}=a,n=e.chats.listIds[s];if(e.chats.isFullyLoaded[s])return;const c=n?n.map(t=>e.chats.byId[t]).filter(t=>Boolean(t&&t.lastMessage)&&!Object(o.N)(e,t.id)).sort((e,t)=>e.lastMessage.date-t.lastMessage.date)[0]:void 0;I(c?()=>C(s,c.id,c.lastMessage.date):()=>C(s))}),Object(s.b)("loadFullChat",(e,t,a)=>{const{chatId:s,force:n}=a,c=Object(o.g)(e,s);c&&(n?E(c):y(()=>E(c)))}),Object(s.b)("loadTopChats",()=>{v(()=>C("active"))}),Object(s.b)("requestChatUpdate",(e,t,a)=>{const{serverTimeOffset:s}=e,{chatId:n}=a,c=Object(o.g)(e,n);c&&Object(p.a)("requestChatUpdate",{chat:c,serverTimeOffset:s})}),Object(s.b)("updateChatMutedState",(e,t,a)=>{const{serverTimeOffset:n}=e,{chatId:c,isMuted:i}=a,l=Object(o.g)(e,c);l&&(Object(s.g)(Object(r.I)(e,c,{isMuted:i})),Object(p.a)("updateChatMutedState",{chat:l,isMuted:i,serverTimeOffset:n}))}),Object(s.b)("createChannel",(e,t,a)=>{const{title:n,about:c,photo:i,memberIds:l}=a;!async function(e,t,a,n){Object(s.g)({...Object(s.e)(),chatCreation:{progress:u.a.InProgress}});const c=await Object(p.a)("createChannel",{title:e,about:a,users:t});if(!c)return;const{id:o,accessHash:i}=c;let l=Object(s.e)();l=Object(r.I)(l,o,c),l={...l,chatCreation:{...l.chatCreation,progress:c?u.a.Complete:u.a.Error}},Object(s.g)(l),Object(s.d)().openChat({id:o}),o&&i&&n&&await Object(p.a)("editChatPhoto",{chatId:o,accessHash:i,photo:n})}(n,l.map(t=>Object(o.Jb)(e,t)).filter(Boolean),c,i)}),Object(s.b)("joinChannel",(e,t,a)=>{const{chatId:s}=a,n=Object(o.g)(e,s);if(!n)return;const{id:c,accessHash:r}=n;c&&r&&Object(p.a)("joinChannel",{channelId:c,accessHash:r})}),Object(s.b)("deleteChatUser",(e,t,a)=>{(async()=>{const{chatId:s,userId:n}=a,c=Object(o.g)(e,s),r=Object(o.Jb)(e,n);if(!c||!r)return;await Object(p.a)("deleteChatUser",{chat:c,user:r});const i=Object(o.z)(e);i&&i.chatId===s&&e.currentUserId===n&&t.openChat({id:void 0})})()}),Object(s.b)("deleteChat",(e,t,a)=>{(async()=>{const{chatId:s}=a,n=Object(o.g)(e,s);if(!n)return;await Object(p.a)("deleteChat",{chatId:n.id});const c=Object(o.z)(e);c&&c.chatId===s&&t.openChat({id:void 0})})()}),Object(s.b)("leaveChannel",(e,t,a)=>{(async()=>{const{chatId:s}=a,n=Object(o.g)(e,s);if(!n)return;const{id:c,accessHash:r}=n;c&&r&&await Object(p.a)("leaveChannel",{channelId:c,accessHash:r});const i=Object(o.z)(e);i&&i.chatId===s&&t.openChat({id:void 0})})()}),Object(s.b)("deleteChannel",(e,t,a)=>{(async()=>{const{chatId:s}=a,n=Object(o.g)(e,s);if(!n)return;const{id:c,accessHash:r}=n;c&&r&&await Object(p.a)("deleteChannel",{channelId:c,accessHash:r});const i=Object(o.z)(e);i&&i.chatId===s&&t.openChat({id:void 0})})()}),Object(s.b)("createGroupChat",(e,t,a)=>{const{title:n,memberIds:c,photo:i}=a;!async function(e,t,a){Object(s.g)({...Object(s.e)(),chatCreation:{progress:u.a.InProgress}});const n=await Object(p.a)("createGroupChat",{title:e,users:t});if(!n)return;const{id:c}=n;let o=Object(s.e)();o=Object(r.I)(o,c,n),o={...o,chatCreation:{...o.chatCreation,progress:n?u.a.Complete:u.a.Error}},Object(s.g)(o),Object(s.d)().openChat({id:c}),c&&a&&await Object(p.a)("editChatPhoto",{chatId:c,photo:a})}(n,c.map(t=>Object(o.Jb)(e,t)).filter(Boolean),i)}),Object(s.b)("toggleChatPinned",(e,t,a)=>{const{id:s,folderId:c}=a,r=Object(o.g)(e,s);if(r)if(c){const t=Object(o.j)(e,c);if(t){const a=!Object(o.N)(e,s,c),{pinnedChatIds:n,includedChatIds:r}=t,i=a?[s,...n||[]]:(n||[]).filter(e=>e!==s),l=[s,...r];Object(p.a)("editChatFolder",{id:c,folderUpdate:{...t,pinnedChatIds:i,includedChatIds:l}})}}else{const t=Object(o.k)(e,s),a=Object(o.N)(e,s,"archived"===t?n.i:void 0);Object(p.a)("toggleChatPinned",{chat:r,shouldBePinned:!a})}}),Object(s.b)("toggleChatArchived",(e,t,a)=>{const{id:s}=a,c=Object(o.g)(e,s);c&&Object(p.a)("toggleChatArchived",{chat:c,folderId:Object(l.kb)(c)?0:n.i})}),Object(s.b)("loadChatFolders",()=>{!async function(){const e=await Object(p.a)("fetchChatFolders");if(e){const t=Object(s.e)();Object(s.g)({...t,chatFolders:{...t.chatFolders,...e}})}}()}),Object(s.b)("loadRecommendedChatFolders",()=>{!async function(){const e=await Object(p.a)("fetchRecommendedChatFolders");if(e){const t=Object(s.e)();Object(s.g)({...t,chatFolders:{...t.chatFolders,recommended:e}})}}()}),Object(s.b)("editChatFolder",(e,t,a)=>{const{id:s,folderUpdate:n}=a,c=Object(o.j)(e,s);c&&Object(p.a)("editChatFolder",{id:s,folderUpdate:{id:s,emoticon:c.emoticon,pinnedChatIds:c.pinnedChatIds,...n}})}),Object(s.b)("addChatFolder",(e,t,a)=>{const{folder:c}=a,{orderedIds:r}=e.chatFolders;!async function(e,t){const{id:a,description:n,...c}=e;if(await Object(p.a)("editChatFolder",{id:t+1,folderUpdate:{id:t+1,...c}}),!n)return;const r=Object(s.e)(),{recommended:o}=r.chatFolders;o&&Object(s.g)({...r,chatFolders:{...r.chatFolders,recommended:o.filter(({id:e})=>e!==a)}})}(c,r&&r.length?Math.max.apply(Math.max,r):n.i)}),Object(s.b)("deleteChatFolder",(e,t,a)=>{const{id:s}=a;Object(o.j)(e,s)&&async function(e){await Object(p.a)("deleteChatFolder",e)}(s)}),Object(s.b)("toggleChatUnread",(e,t,a)=>{const{id:s}=a,{serverTimeOffset:n}=e,c=Object(o.g)(e,s);c&&(c.unreadCount?Object(p.a)("markMessageListRead",{serverTimeOffset:n,chat:c,threadId:b.MAIN_THREAD_ID}):Object(p.a)("toggleDialogUnread",{chat:c,hasUnreadMark:!c.hasUnreadMark}))}),Object(s.b)("openTelegramLink",(e,t,a)=>{const{url:s}=a;let c=n.tb.exec(s);if(c){const e=c[1];(async()=>{const a=await Object(p.a)("openChatByInvite",e);a&&t.openChat({id:a.chatId})})()}else{c=n.ub.exec(s);const e=c[1],a=c[2]?Number(c[2]):void 0,r=c[3]?Number(c[3]):void 0;"c"===e&&a&&r?t.focusMessage({chatId:-a,messageId:r}):w(t,e,a)}}),Object(s.b)("acceptInviteConfirmation",(e,t,a)=>{const{hash:s}=a;(async()=>{const e=await Object(p.a)("importChatInvite",{hash:s});e&&t.openChat({id:e.id})})()}),Object(s.b)("openChatByUsername",(e,t,a)=>{const{username:s}=a;w(t,s)}),Object(s.b)("togglePreHistoryHidden",(e,t,a)=>{const{chatId:s,isEnabled:n}=a;let c=Object(o.g)(e,s);c&&(async()=>{if(Object(l.lb)(c)){if(c=await Object(p.a)("migrateChat",c),!c)return;t.openChat({id:c.id})}Object(p.a)("togglePreHistoryHidden",{chat:c,isEnabled:n})})()}),Object(s.b)("updateChatDefaultBannedRights",(e,t,a)=>{const{chatId:s,bannedRights:n}=a,c=Object(o.g)(e,s);c&&Object(p.a)("updateChatDefaultBannedRights",{chat:c,bannedRights:n})}),Object(s.b)("updateChatMemberBannedRights",(e,t,a)=>{const{chatId:n,userId:c,bannedRights:i}=a;let d=Object(o.g)(e,n);const b=Object(o.Jb)(e,c);d&&b&&(async()=>{if(Object(l.lb)(d)){if(d=await Object(p.a)("migrateChat",d),!d)return;t.openChat({id:d.id})}await Object(p.a)("updateChatMemberBannedRights",{chat:d,user:b,bannedRights:i});const e=Object(s.e)(),a=Object(o.g)(e,n);if(!a||!a.fullInfo)return;const{members:u,kickedMembers:m}=a.fullInfo,h=!!i.viewMessages,O=!Object.keys(i).length;Object(s.g)(Object(r.I)(e,n,{fullInfo:{...a.fullInfo,...u&&h&&{members:u.filter(e=>e.userId!==c)},...u&&!h&&{members:u.map(e=>e.userId===c?{...e,bannedRights:i}:e)},...O&&m&&{kickedMembers:m.filter(e=>e.userId!==c)}}}))})()}),Object(s.b)("updateChatAdmin",(e,t,a)=>{const{chatId:n,userId:c,adminRights:i,customTitle:d}=a;let b=Object(o.g)(e,n);const u=Object(o.Jb)(e,c);b&&u&&(async()=>{if(Object(l.lb)(b)){if(b=await Object(p.a)("migrateChat",b),!b)return;t.openChat({id:b.id})}await Object(p.a)("updateChatAdmin",{chat:b,user:u,adminRights:i,customTitle:d});const e=Object(s.e)(),a=Object(o.g)(e,n);if(!a||!a.fullInfo)return;const{adminMembers:m}=a.fullInfo,h=!Object.keys(i).length;Object(s.g)(Object(r.I)(e,n,{fullInfo:{...a.fullInfo,...m&&h&&{adminMembers:m.filter(e=>e.userId!==c)},...m&&!h&&{adminMembers:m.map(e=>e.userId===c?{...e,adminRights:i,customTitle:d}:e)}}}))})()}),Object(s.b)("updateChat",(e,t,a)=>{const{chatId:n,title:c,about:i,photo:l}=a,d=Object(o.g)(e,n);d&&(async()=>{Object(s.g)(Object(r.cb)(Object(s.e)(),u.f.InProgress)),await Promise.all([d.title!==c?Object(p.a)("updateChatTitle",d,c):void 0,d.fullInfo&&d.fullInfo.about!==i?Object(p.a)("updateChatAbout",d,i):void 0,l?Object(p.a)("editChatPhoto",{chatId:n,accessHash:d.accessHash,photo:l}):void 0]),Object(s.g)(Object(r.cb)(Object(s.e)(),u.f.Complete))})()}),Object(s.b)("toggleSignatures",(e,t,a)=>{const{chatId:s,isEnabled:n}=a,c=Object(o.g)(e,s);c&&Object(p.a)("toggleSignatures",{chat:c,isEnabled:n})}),Object(s.b)("loadGroupsForDiscussion",()=>{(async()=>{const e=await Object(p.a)("fetchGroupsForDiscussion");if(!e)return;const t=e.reduce((e,t)=>(t&&(e[t.id]=t),e),{}),a=Object(r.c)(Object(s.e)(),t);Object(s.g)({...a,chats:{...a.chats,forDiscussionIds:Object.keys(t).map(Number)}})})()}),Object(s.b)("linkDiscussionGroup",(e,t,a)=>{const{channelId:s,chatId:n}=a,c=Object(o.g)(e,s);let r=Object(o.g)(e,n);c&&r&&(async()=>{if(Object(l.lb)(r)){if(r=await Object(p.a)("migrateChat",r),!r)return;t.openChat({id:r.id})}let{fullInfo:e}=r;if(!e){const t=await Object(p.a)("fetchFullChat",r);if(!t)return;e=t.fullInfo}e.isPreHistoryHidden&&await Object(p.a)("togglePreHistoryHidden",{chat:r,isEnabled:!1}),Object(p.a)("setDiscussionGroup",{channel:c,chat:r})})()}),Object(s.b)("unlinkDiscussionGroup",(e,t,a)=>{const{channelId:s}=a,n=Object(o.g)(e,s);if(!n)return;let c;n.fullInfo&&n.fullInfo.linkedChatId&&(c=Object(o.g)(e,n.fullInfo.linkedChatId)),(async()=>{await Object(p.a)("setDiscussionGroup",{channel:n}),c&&E(c)})()}),Object(s.b)("setActiveChatFolder",(e,t,a)=>({...e,chatFolders:{...e.chatFolders,activeChatFolder:a}})),Object(s.b)("loadMoreMembers",e=>{(async()=>{const{chatId:t}=Object(o.z)(e)||{},a=t?Object(o.g)(e,t):void 0;if(!a||Object(l.lb)(a))return;const n=a.fullInfo&&a.fullInfo.members&&a.fullInfo.members.length||void 0,c=await Object(p.a)("fetchMembers",a.id,a.accessHash,"recent",n);if(!c)return;const{members:i,users:d}=c;i&&i.length&&(e=Object(s.e)(),e=Object(r.g)(e,Object(h.c)(d,"id")),e=Object(r.I)(e,a.id,{fullInfo:{...a.fullInfo,members:[...(a.fullInfo||{}).members||[],...i||[]]}}),Object(s.g)(e))})()}),Object(s.b)("addChatMembers",(e,t,a)=>{const{chatId:s,memberIds:n}=a,c=Object(o.g)(e,s),r=n.map(t=>Object(o.Jb)(e,t)).filter(Boolean);c&&r.length&&(t.setNewChatMembersDialogState(u.i.Loading),(async()=>{await Object(p.a)("addChatMembers",c,r),t.setNewChatMembersDialogState(u.i.Closed),E(c)})())}),Object(s.b)("deleteChatMember",(e,t,a)=>{const{chatId:s,userId:n}=a,c=Object(o.g)(e,s),r=Object(o.Jb)(e,n);c&&r&&(async()=>{await Object(p.a)("deleteChatMember",c,r),E(c)})()});const M=new Map,S=Object(f.h)(e=>e(),1e3,!0);async function k(e,t,a,c,i=!1,l=!1){const d=e.id;let b;switch(c){case u.e.Backwards:b=void 0;break;case u.e.Around:b=-(Math.round(n.gb/2)+1);break;case u.e.Forwards:b=-(n.gb+1)}const m=await Object(p.a)("fetchMessages",{chat:Object(o.Gb)(Object(s.e)(),d,t),offsetId:a,addOffset:b,limit:n.gb,threadId:t});if(!m)return;const{messages:O,users:j,chats:g,threadInfos:f}=m,I=Object(h.c)(O,"id"),v=Object.keys(I).map(Number);let y=Object(s.e)();y=Object(r.b)(y,d,I),y=i?Object(r.eb)(y,d,t,v):Object(r.W)(y,d,t,v),y=Object(r.g)(y,Object(h.c)(j,"id")),y=Object(r.c)(y,Object(h.c)(g,"id")),y=Object(r.mb)(y,d,f);let C=Object(o.Z)(y,d,t);const E=Object(o.hb)(y,d,t);if(i&&C&&E&&Object(h.b)(C,E)&&(y=Object(r.W)(y,d,t,E),C=Object(o.Z)(y,d,t),y=Object(r.y)(y,d,t,"outlyingIds",void 0),i=!1),!l){const e=i?E:C,{newViewportIds:s}=N(e,a,c);y=Object(r.A)(y,d,t,s)}Object(s.g)(y)}function N(e,t,a){const{length:s}=e,c=t?function(e,t){return te[e.length-1]?e.length-1:e.findIndex((a,s)=>a===t||at)}(e,t):-1,r=a===u.e.Backwards?c:c+1||s,o=r-n.gb,i=r+n.gb-1,l=e.slice(Math.max(0,o),i+1);let d,b;switch(a){case u.e.Backwards:d=r>0,b=o>=0;break;case u.e.Forwards:d=r0,b=l.length===n.gb}return{newViewportIds:l,areSomeLocal:d,areAllLocal:b}}async function T(e){let t;const a=e.attachment?(e,n)=>{M.has(n)||(t=n,M.set(n,a));const c=Object(s.e)();Object(s.g)({...c,fileUploads:{byMessageLocalId:{...c.fileUploads.byMessageLocalId,[n]:{progress:e}}}})}:void 0;(e.replyingTo||m.e)&&await Object(f.g)();const n=Object(s.e)();e.serverTimeOffset=n.serverTimeOffset;const c=Object(o.z)(n);if(!c)return;const{threadId:r}=c;e.replyingTo||r===b.MAIN_THREAD_ID||(e.replyingTo=Object(o.Hb)(n,e.chat.id,r)),await Object(p.a)("sendMessage",e,a),a&&t&&M.delete(t)}Object(s.b)("loadViewportMessages",(e,t,a)=>{const{direction:s=u.e.Around,isBudgetPreload:c=!1}=a||{};let{chatId:i,threadId:l}=a||{};if(!i){const t=Object(o.z)(e);if(!t)return;i=t.chatId,l=t.threadId}const d=Object(o.g)(e,i);if(!d||d.isRestricted)return;const b=Object(o.Kb)(e,i,l),m=Object(o.Z)(e,i,l),h=Object(o.hb)(e,i,l);if(b&&b.length&&s!==u.e.Around){const a=s===u.e.Backwards?b[0]:b[b.length-1],n=Boolean(h),o=n?h:m,{newViewportIds:O,areSomeLocal:j,areAllLocal:g}=N(o,a,s);if(j&&(e=Object(r.A)(e,i,l,O)),async function(e,t,a,s,n,c,r,o){t||await k(n,c,o,r,a,s);s||(await Promise.resolve(),e.loadViewportMessages({chatId:n.id,threadId:c,direction:r,isBudgetPreload:!0}))}(t,g,n,c,d,l,s,a),c)return}else{const t=Object(o.I)(e,i)||Object(o.mb)(e,i,l),a=Boolean(t&&m&&!m.includes(t)),s=(a?h:m)||[],{newViewportIds:b,areSomeLocal:O,areAllLocal:j}=N(s,t,u.e.Around);O&&b.length>=n.gb&&(e=Object(r.A)(e,i,l,b)),j||k(d,l,t,u.e.Around,a,c)}return e}),Object(s.b)("loadMessage",(e,t,a)=>{const{chatId:n,messageId:c,replyOriginForId:i}=a,l=Object(o.g)(e,n);l&&async function(e,t,a){const n=await Object(p.a)("fetchMessage",{chat:e,messageId:t});if(!n)return;if(n===b.MESSAGE_DELETED){if(a){let t=Object(s.e)();const n=Object(o.l)(t,e.id,a);t=Object(r.M)(t,e.id,a,{...n,replyToMessageId:void 0}),Object(s.g)(t)}return}let c=Object(s.e)();c=Object(r.M)(c,e.id,t,n.message),c=Object(r.g)(c,Object(h.c)(n.users,"id")),Object(s.g)(c)}(l,c,i)}),Object(s.b)("sendMessage",(e,t,a)=>{const s=Object(o.z)(e);if(!s)return;const{chatId:c,threadId:r,type:i}=s;if("scheduled"===i&&!a.scheduledAt)return{...e,messages:{...e.messages,contentToBeScheduled:a}};const l=Object(o.g)(e,c);t.setReplyingToId({messageId:void 0}),t.clearWebPagePreview({chatId:c,threadId:r,value:!1});const d={...a,chat:l,replyingTo:Object(o.ob)(e,c,r),noWebPage:Object(o.db)(e,c,r)},b=!a.attachments||a.attachments.length<=1,u=!b&&a.attachments&&a.attachments.length>1;if(b){const{attachments:e,...t}=d;T({...t,attachment:e?e[0]:void 0})}else if(u){const{text:e,entities:t,attachments:a,...s}=d,c=Object(h.n)(a,n.W);for(let a=0;a0?o:void 0}),r.forEach(e=>{T({...s,attachment:e,groupedId:o})})}}else{const{text:e,entities:t,attachments:a,replyingTo:s,...n}=d;e&&T({...n,text:e,entities:t,replyingTo:s}),a.forEach(e=>{T({...n,attachment:e})})}}),Object(s.b)("editMessage",(e,t,a)=>{const{serverTimeOffset:s}=e,{text:n,entities:c}=a,r=Object(o.z)(e);if(!r)return;const{chatId:i,threadId:l,type:d}=r,b=Object(o.g)(e,i),u=Object(o.E)(e,i,l,d);b&&u&&(Object(p.a)("editMessage",{chat:b,message:u,text:n,entities:c,noWebPage:Object(o.db)(e,i,l),serverTimeOffset:s}),t.setEditingId({messageId:void 0}))}),Object(s.b)("cancelSendingMessage",(e,t,a)=>{const{chatId:s,messageId:n}=a,c=Object(o.l)(e,s,n),r=c&&M.get(c.previousLocalId||c.id);r&&Object(p.b)(r),t.apiUpdate({"@type":"deleteMessages",ids:[n],chatId:s})}),Object(s.b)("saveDraft",(e,t,a)=>{const{chatId:s,threadId:n,draft:c}=a;if(!c)return;const{text:i,entities:l}=c,d=Object(o.g)(e,s);return n===b.MAIN_THREAD_ID&&Object(p.a)("saveDraft",{chat:d,text:i,entities:l,replyToMsgId:Object(o.ob)(e,s,n)}),e=Object(r.y)(e,s,n,"draft",c),e=Object(r.I)(e,s,{draftDate:Math.round(Date.now()/1e3)})}),Object(s.b)("clearDraft",(e,t,a)=>{const{chatId:s,threadId:n,localOnly:c}=a;if(!Object(o.C)(e,s,n))return;const i=Object(o.g)(e,s);return c||n!==b.MAIN_THREAD_ID||Object(p.a)("clearDraft",i),e=Object(r.y)(e,s,n,"draft",void 0),e=Object(r.I)(e,s,{draftDate:void 0})}),Object(s.b)("toggleMessageWebPage",(e,t,a)=>{const{chatId:s,threadId:n,noWebPage:c}=a;return Object(r.y)(e,s,n,"noWebPage",c)}),Object(s.b)("pinMessage",(e,t,a)=>{const s=Object(o.s)(e);if(!s)return;const{messageId:n,isUnpin:c,isOneSide:r,isSilent:i}=a;Object(p.a)("pinMessage",{chat:s,messageId:n,isUnpin:c,isOneSide:r,isSilent:i})}),Object(s.b)("unpinAllMessages",(e,t,a)=>{const n=Object(o.g)(e,a.chatId);n&&async function(e){await Object(p.a)("unpinAllMessages",{chat:e});let t=Object(s.e)();t=Object(r.y)(t,e.id,b.MAIN_THREAD_ID,"pinnedIds",[]),Object(s.g)(t)}(n)}),Object(s.b)("deleteMessages",(e,t,a)=>{const{messageIds:s,shouldDeleteForAll:n}=a,c=Object(o.z)(e);if(!c)return;const{chatId:r,threadId:i}=c,l=Object(o.g)(e,r);Object(p.a)("deleteMessages",{chat:l,messageIds:s,shouldDeleteForAll:n});const d=Object(o.D)(e,r,i);s.includes(d)&&t.setEditingId({messageId:void 0})}),Object(s.b)("deleteScheduledMessages",(e,t,a)=>{const{messageIds:s}=a,n=Object(o.z)(e);if(!n)return;const{chatId:c}=n,r=Object(o.g)(e,c);Object(p.a)("deleteScheduledMessages",{chat:r,messageIds:s});const i=Object(o.F)(e,c);s.includes(i)&&t.setEditingId({messageId:void 0})}),Object(s.b)("deleteHistory",(e,t,a)=>{(async()=>{const{chatId:s,shouldDeleteForAll:n}=a,c=Object(o.g)(e,s);if(!c)return;const r=c.lastMessage&&c.lastMessage.id;await Object(p.a)("deleteHistory",{chat:c,shouldDeleteForAll:n,maxId:r});const i=Object(o.z)(e);i&&i.chatId===s&&t.openChat({id:void 0})})()}),Object(s.b)("reportMessages",(e,t,a)=>{(async()=>{const{messageIds:s,reason:n,description:c}=a,r=Object(o.z)(e);if(!r)return;const{chatId:i}=r,l=Object(o.g)(e,i),d=await Object(p.a)("reportMessages",{peer:l,messageIds:s,reason:n,description:c});t.showNotification({message:d?"Thank you! Your report will be reviewed by our team.":"Error occured while submiting report. Please, try again later."})})()}),Object(s.b)("markMessageListRead",(e,t,a)=>{const{serverTimeOffset:s}=e,n=Object(o.z)(e);if(!n)return;const{chatId:c,threadId:r}=n,i=Object(o.Gb)(e,c,r);if(!i)return;const{maxId:l}=a;S(()=>{Object(p.a)("markMessageListRead",{serverTimeOffset:s,chat:i,threadId:r,maxId:l})})}),Object(s.b)("markMessagesRead",(e,t,a)=>{const s=Object(o.s)(e);if(!s)return;const{messageIds:n}=a;Object(p.a)("markMessagesRead",{chat:s,messageIds:n})}),Object(s.b)("loadWebPagePreview",(e,t,a)=>{const{text:n}=a;!async function(e){const t=await Object(p.a)("fetchWebPagePreview",{message:e});Object(s.g)({...Object(s.e)(),webPagePreview:t})}(n)}),Object(s.b)("clearWebPagePreview",e=>{if(e.webPagePreview)return{...e,webPagePreview:void 0}}),Object(s.b)("sendPollVote",(e,t,a)=>{const{chatId:s,messageId:n,options:c}=a,r=Object(o.g)(e,s);r&&Object(p.a)("sendPollVote",{chat:r,messageId:n,options:c})}),Object(s.b)("loadPollOptionResults",(e,t,a)=>{const{chat:n,messageId:c,option:o,offset:i,limit:l,shouldResetVoters:d}=a;!async function(e,t,a,n,c,o){const i=await Object(p.a)("loadPollOptionResults",{chat:e,messageId:t,option:a,offset:n,limit:c});if(!i)return;let l=Object(s.e)();l=Object(r.g)(l,Object(h.c)(i.users,"id"));const{voters:d}=l.pollResults;Object(s.g)({...l,pollResults:{...l.pollResults,voters:{...d,[a]:[...!o&&d&&d[a]?d[a]:[],...i&&i.users.map(e=>e.id)].filter((e,t,a)=>a.indexOf(e)===t)},offsets:{...l.pollResults.offsets?l.pollResults.offsets:{},[a]:i.nextOffset||""}}})}(n,c,o,i,l,d)}),Object(s.b)("forwardMessages",e=>{const{fromChatId:t,messageIds:a,toChatId:n}=e.forwardMessages,c=t?Object(o.g)(e,t):void 0,r=n?Object(o.g)(e,n):void 0,i=t&&a?a.sort((e,t)=>e-t).map(a=>Object(o.l)(e,t,a)).filter(Boolean):void 0;c&&r&&i&&i.length&&function(e,t,a){Object(p.a)("forwardMessages",{fromChat:e,toChat:t,messages:a,serverTimeOffset:Object(s.e)().serverTimeOffset}),Object(s.g)({...Object(s.e)(),forwardMessages:{}})}(c,r,i)}),Object(s.b)("loadScheduledHistory",e=>{const t=Object(o.s)(e);if(!t)return;const{hash:a}=e.scheduledMessages.byChatId[t.id]||{};!async function(e,t){const a=await Object(p.a)("fetchScheduledHistory",{chat:e,hash:t});if(!a)return;const{hash:n,messages:c}=a,o=Object(h.c)(c,"id"),i=Object.keys(o).map(Number).sort((e,t)=>t-e);let l=Object(s.e)();l=Object(r.v)(l,e.id,o,n),l=Object(r.y)(l,e.id,b.MAIN_THREAD_ID,"scheduledIds",i),Object(s.g)(l)}(t,a)}),Object(s.b)("sendScheduledMessages",(e,t,a)=>{const{chatId:s,id:n}=a,c=Object(o.g)(e,s);c&&Object(p.a)("sendScheduledMessages",{chat:c,ids:[n]})}),Object(s.b)("rescheduleMessage",(e,t,a)=>{const{chatId:s,messageId:n,scheduledAt:c}=a,r=Object(o.g)(e,s),i=r&&Object(o.rb)(e,r.id,n);r&&i&&Object(p.a)("rescheduleMessage",{chat:r,message:i,scheduledAt:c})}),Object(s.b)("requestThreadInfoUpdate",(e,t,a)=>{const{chatId:s,threadId:n}=a,c=Object(o.Gb)(e,s,n);c&&Object(p.a)("requestThreadInfoUpdate",{chat:c,threadId:n})}),Object(s.b)("loadPinnedMessages",(e,t,a)=>{const{chatId:n}=a,c=Object(o.g)(e,n);c&&async function(e){const t=await Object(p.a)("fetchPinnedMessages",{chat:e});if(!t)return;const{messages:a,chats:n,users:c}=t,o=Object(h.c)(a,"id"),i=Object.keys(o).map(Number).sort((e,t)=>t-e);let l=Object(s.e)();l=Object(r.b)(l,e.id,o),l=Object(r.y)(l,e.id,b.MAIN_THREAD_ID,"pinnedIds",i),l=Object(r.g)(l,Object(h.c)(c,"id")),l=Object(r.c)(l,Object(h.c)(n,"id")),Object(s.g)(l)}(c)});var A=a(53);const P=Object(f.h)(e=>e(),500,!1);async function R(e,t){const a=await Object(p.a)("searchGifs",{query:e,offset:t});a&&Object(s.g)(Object(r.R)(Object(s.e)(),!t,a.gifs,a.nextOffset))}Object(s.b)("loadStickerSets",e=>{const{hash:t}=e.stickers.added||{};!async function(e=0){const t=await Object(p.a)("fetchStickerSets",{hash:e});if(!t)return;Object(s.g)(Object(r.jb)(Object(s.e)(),"added",t.hash,t.sets))}(t)}),Object(s.b)("loadAddedStickers",(e,t)=>{const{setIds:a}=e.stickers.added;a&&a.length&&(async()=>{for(let e=0;e0&&await Object(f.f)(500)})()}),Object(s.b)("loadRecentStickers",e=>{const{hash:t}=e.stickers.recent||{};!async function(e=0){const t=await Object(p.a)("fetchRecentStickers",{hash:e});if(!t)return;const a=Object(s.e)();Object(s.g)({...a,stickers:{...a.stickers,recent:t}})}(t)}),Object(s.b)("loadFavoriteStickers",e=>{const{hash:t}=e.stickers.favorite||{};!async function(e=0){const t=await Object(p.a)("fetchFavoriteStickers",{hash:e});if(!t)return;const a=Object(s.e)();Object(s.g)({...a,stickers:{...a.stickers,favorite:t}})}(t)}),Object(s.b)("loadGreetingStickers",e=>{const{hash:t}=e.stickers.greeting||{};(async()=>{const e=await Object(p.a)("fetchStickersForEmoji",{emoji:"👋⭐️",hash:t});if(!e)return;const a=Object(s.e)();Object(s.g)({...a,stickers:{...a.stickers,greeting:{hash:e.hash,stickers:e.stickers.filter(e=>"👋"===e.emoji)}}})})()}),Object(s.b)("loadFeaturedStickers",e=>{const{hash:t}=e.stickers.featured||{};!async function(e=0){const t=await Object(p.a)("fetchFeaturedStickers",{hash:e});if(!t)return;Object(s.g)(Object(r.jb)(Object(s.e)(),"featured",t.hash,t.sets))}(t)}),Object(s.b)("loadStickers",(e,t,a)=>{const{stickerSetId:n}=a;let{stickerSetAccessHash:c}=a;if(!c){const t=Object(o.zb)(e,n);if(!t)return;c=t.accessHash}!async function(e,t){const a=await Object(p.a)("fetchStickers",{stickerSetId:e,accessHash:t});if(!a)return;const{set:n,stickers:c,packs:o}=a;let i=Object(s.e)();i=Object(r.ib)(i,n.id,{...n,stickers:c,packs:o});const l=i.stickers.forEmoji.emoji;l&&o[l]&&(i=Object(r.p)(i));Object(s.g)(i)}(n,c)}),Object(s.b)("loadAnimatedEmojis",()=>{!async function(){const e=await Object(p.a)("fetchAnimatedEmojis");if(!e)return;const{set:t,stickers:a}=e;Object(s.g)(Object(r.r)(Object(s.e)(),{...t,stickers:a}))}()}),Object(s.b)("loadSavedGifs",e=>{const{hash:t}=e.gifs.saved;!async function(e=0){const t=await Object(p.a)("fetchSavedGifs",{hash:e});if(!t)return;const a=Object(s.e)();Object(s.g)({...a,gifs:{...a.gifs,saved:t}})}(t)}),Object(s.b)("faveSticker",(e,t,a)=>{const{sticker:s}=a;s&&Object(p.a)("faveSticker",{sticker:s})}),Object(s.b)("unfaveSticker",(e,t,a)=>{const{sticker:n}=a;n&&function(e){const t=Object(s.e)();Object(s.g)({...t,stickers:{...t.stickers,favorite:{...t.stickers.favorite,stickers:t.stickers.favorite.stickers.filter(({id:t})=>t!==e.id)}}}),Object(p.a)("faveSticker",{sticker:e,unfave:!0})}(n)}),Object(s.b)("toggleStickerSet",(e,t,a)=>{const{stickerSetId:s}=a,n=Object(o.zb)(e,s);if(!n)return;const{accessHash:c,installedDate:r}=n;Object(p.a)(r?"uninstallStickerSet":"installStickerSet",{stickerSetId:s,accessHash:c})}),Object(s.b)("loadEmojiKeywords",(e,t,a)=>{const{language:n}=a;let c=e.emojiKeywords[n];c&&c.isLoading||(Object(s.g)({...e,emojiKeywords:{...e.emojiKeywords,[n]:{...c,isLoading:!0}}}),(async()=>{const t=await Object(p.a)("fetchEmojiKeywords",{language:n,fromVersion:c?c.version:0});e=Object(s.e)(),c=e.emojiKeywords[n],t?Object(s.g)({...e,emojiKeywords:{...e.emojiKeywords,[n]:{isLoading:!1,version:t.version,keywords:{...c&&c.keywords,...t.keywords}}}}):Object(s.g)({...e,emojiKeywords:{...e.emojiKeywords,[n]:{...c,isLoading:!1}}})})())}),Object(s.b)("setStickerSearchQuery",(e,t,a)=>{const{query:n}=a;n&&P(()=>{!async function(e,t=0){const a=await Object(p.a)("searchStickers",{query:e,hash:t});if(!a)return;const n=Object(s.e)(),{setsById:c,added:o}=n.stickers,i=a.sets.map(({id:e})=>e);o.setIds&&o.setIds.forEach(t=>{if(!i.includes(t)){const{title:a}=c[t]||{};a&&Object(A.a)(a,e)&&i.unshift(t)}});Object(s.g)(Object(r.jb)(n,"search",a.hash,a.sets,i))}(n)})}),Object(s.b)("setGifSearchQuery",(e,t,a)=>{const{query:s}=a;"string"==typeof s&&P(()=>{R(s)})}),Object(s.b)("searchMoreGifs",e=>{const{query:t,offset:a}=e.gifs.search;"string"==typeof t&&P(()=>{R(t,a)})}),Object(s.b)("loadStickersForEmoji",(e,t,a)=>{const{emoji:n}=a,{hash:c}=e.stickers.forEmoji;P(()=>{!async function(e,t=0){let a=Object(s.e)();Object(s.g)({...a,stickers:{...a.stickers,forEmoji:{...a.stickers.forEmoji,emoji:e}}});const n=await Object(p.a)("fetchStickersForEmoji",{emoji:e,hash:t});if(a=Object(s.e)(),!n||a.stickers.forEmoji.emoji!==e)return;a=Object(r.kb)(a,e,n.stickers,n.hash),Object(s.g)(a)}(n,c)})}),Object(s.b)("clearStickersForEmoji",e=>({...e,stickers:{...e.stickers,forEmoji:{}}}));var x=a(30);const L=Object(f.h)(e=>e(),500,!1);async function B(e="",t,a,c,i,l){let d;if(c){const s=await Object(p.a)("searchMessagesLocal",{chatOrUser:c,query:e,type:t,limit:n.G,offsetId:a,minDate:l,maxDate:i});if(s){const{messages:e,users:t,totalCount:a,nextOffsetId:n}=s;d={messages:e,users:t,chats:[],totalCount:a,nextRate:n}}}else d=await Object(p.a)("searchMessagesGlobal",{query:e,offsetRate:a,limit:n.G,type:t,maxDate:i,minDate:l});let b=Object(s.e)();const u=Object(o.u)(b);if(!d||""!==e&&e!==u)return void Object(s.g)(Object(r.U)(b,{messages:!1}));const{messages:m,users:O,chats:j,totalCount:g,nextRate:f}=d;j.length&&(b=Object(r.c)(b,Object(h.c)(j,"id"))),O.length&&(b=Object(r.g)(b,Object(h.c)(O,"id"))),m.length&&(b=Object(r.d)(b,m)),b=Object(r.V)(b,m,g,t,f),Object(s.g)(b)}async function D(){const e=await Object(p.a)("fetchChats",{limit:n.l,archived:!0,withPinned:!0,serverTimeOffset:Object(s.e)().serverTimeOffset});if(!e)return;let t=Object(s.e)();t=Object(r.rb)(t,Object(h.c)(e.users,"id")),t=Object(r.N)(t,Object(h.c)(e.chats,"id")),t=Object(r.s)(t,"archived",e.chatIds),t=Object(r.K)(t,"archived",e),Object(s.g)(t)}async function F(){let e=Object(s.e)();const{recentlyFoundChatIds:t}=e.globalSearch,{userIds:a}=e.contactList||{};if(!(a&&a.length||t&&t.length))return;const n=[...t||[],...a||[]].map(t=>Object(o.Jb)(e,t)).filter(Boolean),c=await Object(p.a)("fetchUsers",{users:n});c&&(e=Object(s.e)(),e=Object(r.rb)(e,Object(h.c)(c,"id")),Object(s.g)(e))}function U(e){return Object(p.a)("fetchMessages",{chat:e,threadId:b.MAIN_THREAD_ID,offsetId:e.lastReadInboxMessageId,addOffset:-(Math.round(n.gb/2)+1),limit:n.gb})}Object(s.b)("setGlobalSearchQuery",(e,t,a)=>{const{chatId:n}=e.globalSearch,{query:c}=a;c&&!n&&L(()=>{!async function(e){const t=await Object(p.a)("searchChats",{query:e});let a=Object(s.e)();const n=Object(o.u)(a);if(!t||!n||e!==n)return void Object(s.g)(Object(r.U)(a,{chats:!1}));const{localChats:c,localUsers:i,globalChats:l,globalUsers:d}=t;(c.length||l.length)&&(a=Object(r.c)(a,Object(h.c)([...c,...l],"id")));(i.length||d.length)&&(a=Object(r.g)(a,Object(h.c)([...i,...d],"id")));a=Object(r.U)(a,{chats:!1}),a=Object(r.S)(a,{localResults:{chatIds:c.map(({id:e})=>e),userIds:i.map(({id:e})=>e)},globalResults:{...a.globalSearch.globalResults,chatIds:d.map(({id:e})=>e),userIds:l.map(({id:e})=>e)}}),Object(s.g)(a)}(c)})}),Object(s.b)("setGlobalSearchDate",(e,t,a)=>{const{date:n}=a,c=n?Object(x.m)(n):n,i=Object(r.S)(e,{date:n,query:"",resultsByType:{...e.globalSearch.resultsByType,text:{totalCount:void 0,foundIds:[],nextOffsetId:0}}});Object(s.g)(i);const{chatId:l}=e.globalSearch;B("","text",void 0,l?Object(o.g)(e,l):void 0,c,n)}),Object(s.b)("searchMessagesGlobal",(e,t,a)=>{const{query:s,resultsByType:n,chatId:c,date:r}=e.globalSearch,i=r?Object(x.m)(r):r,{type:l}=a,{nextOffsetId:d}=n&&n[l]||{};B(s,l,d,c?Object(o.g)(e,c):void 0,i,r)}),Object(s.b)("searchTextMessagesLocal",e=>{const{chatId:t,threadId:a}=Object(o.z)(e)||{},c=t?Object(o.g)(e,t):void 0,i=Object(o.B)(e);if(!c||!i||!a)return;const{query:l,results:d}=i,u=d?d.nextOffsetId:void 0;let m;if(a!==b.MAIN_THREAD_ID){const s=Object(o.Fb)(e,t,a);m=s?s.topMessageId:void 0}!async function(e,t,a,c,i){const l=await Object(p.a)("searchMessagesLocal",{chatOrUser:e,type:"text",query:c,topMessageId:a,limit:n.ib,offsetId:i});if(!l)return;const{messages:d,users:b,totalCount:u,nextOffsetId:m}=l,O=Object(h.c)(d,"id"),j=Object.keys(O).map(Number);let g=Object(s.e)();const f=Object(o.B)(g);if(!f||c&&c!==f.query)return;g=Object(r.b)(g,e.id,O),g=Object(r.g)(g,Object(h.c)(b,"id")),g=Object(r.ab)(g,e.id,t,j,u,m),Object(s.g)(g)}(c,a,m,l,u)}),Object(s.b)("searchMediaMessagesLocal",e=>{const t=Object(o.x)(e),a=t?e.users.byId[t]||e.chats.byId[t]:void 0,c=Object(o.w)(e);if(!a||!c)return;const{currentType:i,resultsByType:l}=c,d=i&&l&&l[i],b=d?d.nextOffsetId:void 0;i&&async function(e,t,a){const c=await Object(p.a)("searchMessagesLocal",{chatOrUser:e,type:t,limit:n.Ab,offsetId:a});if(!c)return;const{messages:i,users:l,totalCount:d,nextOffsetId:b}=c,u=Object(h.c)(i,"id"),m=Object.keys(u).map(Number);let O=Object(s.e)();if(!Object(o.w)(O))return;O=Object(r.b)(O,e.id,u),O=Object(r.g)(O,Object(h.c)(l,"id")),O=Object(r.X)(O,e.id,t,m,d,b),Object(s.g)(O)}(a,i,b)}),Object(s.b)("searchMessagesByDate",(e,t,a)=>{const{timestamp:n}=a,{chatId:c}=Object(o.z)(e)||{};if(!c)return;const r=Object(o.g)(e,c);r&&async function(e,t){const a=await Object(p.a)("findFirstMessageIdAfterDate",{chat:e,timestamp:t});if(!a)return;Object(s.d)().focusMessage({chatId:e.id,messageId:a})}(r,n)}),Object(s.b)("checkPublicLink",(e,t,a)=>{const{chatId:n}=Object(o.z)(e)||{};if(!n)return;if(e.management.progress===u.f.InProgress)return;const{username:c}=a;(async()=>{e=Object(r.cb)(e,u.f.InProgress),e=Object(r.bb)(e,n,{isUsernameAvailable:void 0}),Object(s.g)(e);const t=await Object(p.a)("checkChatUsername",{username:c});e=Object(s.e)(),e=Object(r.cb)(e,t?u.f.Complete:u.f.Error),e=Object(r.bb)(e,n,{isUsernameAvailable:t}),Object(s.g)(e)})()}),Object(s.b)("updatePublicLink",(e,t,a)=>{const{chatId:n}=Object(o.z)(e)||{};let c=n&&Object(o.g)(e,n);if(!n||!c)return;const{username:i}=a;(async()=>{if(e=Object(r.cb)(e,u.f.InProgress),Object(s.g)(e),Object(l.lb)(c)){if(c=await Object(p.a)("migrateChat",c),!c)return;t.openChat({id:c.id})}const a=await Object(p.a)("setChatUsername",{chat:c,username:i});e=Object(s.e)(),e=Object(r.cb)(e,a?u.f.Complete:u.f.Error),e=Object(r.bb)(e,n,{isUsernameAvailable:void 0}),Object(s.g)(e)})()}),Object(s.b)("updatePrivateLink",e=>{const{chatId:t}=Object(o.z)(e)||{},a=t&&Object(o.g)(e,t);t&&a&&Object(p.a)("updatePrivateLink",{chat:a})}),Object(s.b)("sync",(e,t)=>{!async function(e){n.r&&console.log(">>> START SYNC");await Object(p.a)("fetchCurrentUser");const t=await async function(){const e=await Object(p.a)("fetchChats",{limit:n.l,withPinned:!0,serverTimeOffset:Object(s.e)().serverTimeOffset});if(!e)return;let t=Object(s.e)();const{recentlyFoundChatIds:a}=t.globalSearch,{userIds:c}=t.contactList||{},{currentUserId:i}=t,d=[...a||[],...c||[],...i?[i]:[]],u=d.map(e=>Object(o.Jb)(t,e)).filter(Boolean),m=d.map(e=>Object(o.g)(t,e)).filter(Boolean),{chatId:O}=Object(o.z)(t)||{};if(O){const e=Object(o.g)(t,O);if(e&&!d.includes(O)&&m.push(e),Object(l.ob)(O)){const e=Object(o.Jb)(t,O);e&&!d.includes(O)&&u.push(e)}}u.push(...e.users),m.push(...e.chats),t=Object(r.t)(t,Object(h.c)(m,"id")),t=Object(r.s)(t,"active",e.chatIds),t={...t,chats:{...t.chats}},t=Object(r.K)(t,"active",e),Object.keys(e.draftsById).map(Number).forEach(a=>{t=Object(r.y)(t,a,b.MAIN_THREAD_ID,"draft",e.draftsById[a])}),Object.keys(e.replyingToById).map(Number).forEach(a=>{t=Object(r.y)(t,a,b.MAIN_THREAD_ID,"replyingToId",e.replyingToById[a])}),Object(s.g)(t),O&&!t.chats.byId[O]&&Object(s.d)().openChat({id:void 0});return u}();await async function(e){let t=!1,a=e||[],n=Object(s.e)();const{chatId:c,threadId:i}=Object(o.z)(n)||{},l=Object.keys(n.messages.byChatId).map(Number).reduce((e,t)=>{const a=Object(o.C)(n,t,b.MAIN_THREAD_ID);return a?{...e,[t]:a}:e},{});if(c){const e=await U(n.chats.byId[c]);n=Object(s.e)();const{chatId:l}=Object(o.z)(n)||{},d=i&&Object(o.Fb)(n,c,i);if(e&&l===c){const s=n.messages.byChatId[c],o=Object(h.c)(e.messages,"id"),l=Object.keys(o).map(Number);if(n={...n,messages:{...n.messages,byChatId:{[c]:{byId:o,threadsById:{[b.MAIN_THREAD_ID]:{...s&&s.threadsById[b.MAIN_THREAD_ID],listedIds:l,viewportIds:l,outlyingIds:void 0}}}}}},i&&d&&d.originChannelId){const{originChannelId:e}=d,t=n.messages.byChatId[e],a=await U(n.chats.byId[e]);if(a){const e=Object(h.c)(a.messages,"id"),r=Object.keys(e).map(Number);n={...n,messages:{...n.messages,byChatId:{...n.messages.byChatId,[d.originChannelId]:{byId:e,threadsById:{[b.MAIN_THREAD_ID]:{...t&&t.threadsById[b.MAIN_THREAD_ID],listedIds:r,viewportIds:r,outlyingIds:void 0}}},[c]:{...n.messages.byChatId[c],threadsById:{...n.messages.byChatId[c].threadsById,[i]:{...s&&s.threadsById[i],outlyingIds:void 0}}}}}}}}n=Object(r.N)(n,Object(h.c)(e.chats,"id")),n=Object(r.mb)(n,c,e.threadInfos),t=!0,a=Array.prototype.concat(a,e.users)}}t||(n={...n,messages:{...n.messages,byChatId:{}}});Object.keys(l).map(Number).forEach(e=>{n=Object(r.y)(n,e,b.MAIN_THREAD_ID,"draft",l[e])}),e?n=Object(r.z)(n,Object(h.c)(a,"id")):a&&(n=Object(r.rb)(n,Object(h.c)(a,"id")));Object(s.g)(n);const{chatId:d,messageId:u}=n.audioPlayer;d&&u&&!Object(o.l)(n,d,u)&&Object(s.d)().closeAudioPlayer()}(t),Object(s.g)({...Object(s.e)(),lastSyncTime:Date.now()}),n.r&&console.log(">>> FINISH SYNC");e()}(t.afterSync)}),Object(s.b)("afterSync",(e,t)=>{!async function(e){n.r&&console.log(">>> START AFTER-SYNC");e.loadFavoriteStickers(),await Promise.all([F(),D()]),await Object(p.a)("fetchCurrentUser"),n.r&&console.log(">>> FINISH AFTER-SYNC")}(t)});const H=Object(f.a)(e=>e(),500,!1,!0),q=Object(f.h)(e=>e(),500,!1);function G(e,t,a){return{...e,inlineBots:{...e.inlineBots,byUsername:{...e.inlineBots.byUsername,[t]:a}}}}function _(e,t){return{...e,inlineBots:{...e.inlineBots,isLoading:t}}}Object(s.b)("loadFullUser",(e,t,a)=>{const{userId:s}=a,n=Object(o.Jb)(e,s);if(!n)return;const{id:c,accessHash:r}=n;H(()=>Object(p.a)("fetchFullUser",{id:c,accessHash:r}))}),Object(s.b)("loadUser",(e,t,a)=>{const{userId:n}=a,c=Object(o.Jb)(e,n);c&&(async()=>{const t=await Object(p.a)("fetchUsers",{users:[c]});t&&(e=Object(s.e)(),e=Object(r.rb)(e,Object(h.c)(t,"id")),Object(s.g)(e))})()}),Object(s.b)("loadTopUsers",e=>{const{serverTimeOffset:t,topPeers:{hash:a,lastRequestedAt:n}}=e;(!n||Date.now()/1e3+t-n>60)&&async function(e){const t=await Object(p.a)("fetchTopUsers",{hash:e});if(!t)return;const{hash:a,ids:n,users:c}=t;let o=Object(s.e)();o=Object(r.g)(o,Object(h.c)(c,"id")),o={...o,topPeers:{...o.topPeers,hash:a,userIds:n,lastRequestedAt:Date.now()/1e3+o.serverTimeOffset}},Object(s.g)(o)}(a)}),Object(s.b)("loadContactList",e=>{const{hash:t}=e.contactList||{};!async function(e){const t=await Object(p.a)("fetchContactList",{hash:e});if(!t)return;let a=Object(r.g)(Object(s.e)(),Object(h.c)(t.users,"id"));a=Object(r.c)(a,Object(h.c)(t.chats,"id"));const n=e=>e.lastName||e.firstName||"",c=new Intl.Collator("en-US"),o=t.users.sort((e,t)=>c.compare(n(e),n(t))).filter(e=>!e.isSelf);Object(s.g)({...a,contactList:{hash:t.hash,userIds:o.map(e=>e.id)}})}(t)}),Object(s.b)("loadCurrentUser",()=>{Object(p.a)("fetchCurrentUser")}),Object(s.b)("updateContact",(e,t,a)=>{const{userId:n,isMuted:c,firstName:i,lastName:l}=a;!async function(e,t,a,n){const c=Object(s.e)(),i=Object(o.Jb)(c,e);if(!i)return;Object(s.d)().updateChatMutedState({chatId:e,isMuted:t}),Object(s.g)(Object(r.cb)(Object(s.e)(),u.f.InProgress));await Object(p.a)("updateContact",{phone:i.phoneNumber,firstName:a,lastName:n})&&Object(s.g)(Object(r.ob)(Object(s.e)(),i.id,{firstName:a,lastName:n}));Object(s.g)(Object(r.cb)(Object(s.e)(),u.f.Complete))}(n,c,i,l)}),Object(s.b)("deleteUser",(e,t,a)=>{const{userId:n}=a;!async function(e){const t=Object(s.e)(),a=Object(o.Jb)(t,e);if(!a)return;const{id:n,accessHash:c}=a;await Object(p.a)("deleteUser",{id:n,accessHash:c})}(n)}),Object(s.b)("loadProfilePhotos",(e,t,a)=>{const{profileId:n}=a,c=Object(l.ob)(n),i=c?Object(o.Jb)(e,n):void 0,d=c?void 0:Object(o.g)(e,n);(async()=>{const e=await Object(p.a)("fetchProfilePhotos",i,d);if(!e||!e.photos)return;let t=Object(s.e)();c?t=Object(r.ob)(t,n,{photos:e.photos}):(t=Object(r.g)(t,Object(h.c)(e.users,"id")),t=Object(r.I)(t,n,{photos:e.photos})),Object(s.g)(t)})()}),Object(s.b)("setUserSearchQuery",(e,t,a)=>{const{query:n}=a;n&&q(()=>{!async function(e){const t=await Object(p.a)("searchChats",{query:e});let a=Object(s.e)();const n=a.userSearch.query;if(!t||!n||e!==n)return void Object(s.g)(Object(r.qb)(a,!1));const{localUsers:c,globalUsers:o}=t;let i,l;c.length&&(a=Object(r.g)(a,Object(h.c)(c,"id")),i=c.map(({id:e})=>e));o.length&&(a=Object(r.g)(a,Object(h.c)(o,"id")),l=o.map(({id:e})=>e));a=Object(r.qb)(a,!1),a=Object(r.pb)(a,{localUserIds:i,globalUserIds:l}),Object(s.g)(a)}(n)})});const z=Object(f.a)(e=>e(),500,!1);async function $(e,t,a){await Object(p.a)("sendMessage",{chat:e,text:a})}Object(s.b)("clickInlineButton",(e,t,a)=>{const{button:c}=a;switch(c.type){case"command":t.sendBotCommand({command:c.value});break;case"url":c.value.match(n.tb)||c.value.match(n.ub)?t.openTelegramLink({url:c.value}):t.toggleSafeLinkModal({url:c.value});break;case"callback":{const t=Object(o.s)(e);if(!t)return;!async function(e,t,a){const n=await Object(p.a)("answerCallbackButton",{chatId:e.id,accessHash:e.accessHash,messageId:t,data:a});if(!n||!n.message)return;const{message:c,alert:r}=n;r?Object(s.d)().showDialog({data:{message:c}}):Object(s.d)().showNotification({message:c})}(t,c.messageId,c.value);break}case"requestPoll":t.openPollModal();break;case"buy":{const a=Object(o.s)(e),{messageId:s,value:n}=c;if(!a)return;n?t.getReceipt({receiptMessageId:n,chatId:a.id,messageId:s}):(t.getPaymentForm({messageId:s}),t.setInvoiceMessageInfo(Object(o.l)(e,a.id,s)),t.openPaymentModal({messageId:s}));break}}}),Object(s.b)("sendBotCommand",(e,t,a)=>{const{command:s,chatId:n}=a,{currentUserId:c}=e,r=n?Object(o.g)(e,n):Object(o.s)(e);c&&r&&$(r,c,s)}),Object(s.b)("restartBot",(e,t,a)=>{const{chatId:n}=a,{currentUserId:c}=e,i=Object(o.s)(e),l=c&&Object(o.h)(e,n);c&&i&&l&&(async()=>{await Object(p.a)("unblockContact",l.id,l.accessHash)&&(Object(s.g)(Object(r.q)(Object(s.e)(),l.id)),$(i,c,"/start"))})()}),Object(s.b)("loadTopInlineBots",e=>{const{serverTimeOffset:t}=e,{hash:a,lastRequestedAt:n}=e.topInlineBots;n&&Date.now()+t-n<6e4||(async()=>{const e=await Object(p.a)("fetchTopInlineBots",{hash:a});if(!e)return;const{hash:t,ids:n,users:c}=e;let o=Object(s.e)();o=Object(r.g)(o,Object(h.c)(c,"id")),o={...o,topInlineBots:{...o.topInlineBots,hash:t,userIds:n,lastRequestedAt:Date.now()}},Object(s.g)(o)})()}),Object(s.b)("queryInlineBot",(e,t,a)=>{const{chatId:n,username:c,query:i,offset:l}=a;(async()=>{let t=e.inlineBots.byUsername[c];if(!1!==t){if(void 0===t){const{user:a,chat:n}=await Object(p.a)("fetchInlineBot",{username:c})||{};if(e=Object(s.e)(),!a||!n)return void Object(s.g)(G(e,c,!1));e=Object(r.g)(e,{[a.id]:a}),e=Object(r.c)(e,{[n.id]:n}),t={id:a.id,query:"",offset:"",switchPm:void 0,canLoadMore:!0,results:[]},e=G(e,c,t),Object(s.g)(e)}(i!==t.query||t.canLoadMore)&&z(()=>{!async function({username:e,inlineBotData:t,chatId:a,query:n,offset:c}){let r=Object(s.e)();const i=Object(o.Jb)(r,t.id),l=Object(o.g)(r,a);if(!i||!l)return;const d=t.query!==n;r=_(r,!0),r=G(r,e,{...t,query:n,...d&&{offset:void 0,results:[]}}),Object(s.g)(r);const b=await Object(p.a)("fetchInlineBotResults",{bot:i,chat:l,query:n,offset:d?void 0:c}),u=r.inlineBots.byUsername[e];if(r=_(Object(s.e)(),!1),!b||!u||n!==u.query)return void Object(s.g)(r);const m=new Set((u.results||[]).map(e=>e.id)),h=b.results.filter(e=>!m.has(e.id));r=G(r,e,{...u,help:b.help,...h.length&&{isGallery:b.isGallery},...b.switchPm&&{switchPm:b.switchPm},canLoadMore:b.results.length>0&&Boolean(b.nextOffset),results:""===u.offset||u.offset===b.nextOffset?b.results:(u.results||[]).concat(h),offset:h.length?b.nextOffset:""}),Object(s.g)(r)}({username:c,inlineBotData:t,chatId:n,query:i,offset:l})})}})()}),Object(s.b)("sendInlineBotResult",(e,t,a)=>{const{id:s,queryId:n}=a,c=Object(o.z)(e);if(!c||!s)return;const{chatId:r,threadId:i}=c,l=Object(o.g)(e,r);t.setReplyingToId({messageId:void 0}),t.clearWebPagePreview({chatId:r,threadId:i,value:!1}),Object(p.a)("sendInlineBotResult",{chat:l,resultId:s,queryId:n,replyingTo:Object(o.ob)(e,r,i)})}),Object(s.b)("resetInlineBot",(e,t,a)=>{const{username:n}=a;let c=e.inlineBots.byUsername[n];c&&(c={id:c.id,query:"",offset:"",switchPm:void 0,canLoadMore:!0,results:[]},Object(s.g)(G(e,n,c)))});a(88);Object(s.b)("loadPasswordInfo",()=>{(async()=>{const e=await Object(p.a)("getPasswordInfo");if(!e)return;let t=Object(s.e)();t=Object(r.w)(t,{hasPassword:e.hasPassword}),t=Object(r.nb)(t,{hint:e.hint}),Object(s.g)(t)})()}),Object(s.b)("checkPassword",(e,t,a)=>{const{currentPassword:n,onSuccess:c}=a;Object(s.g)(Object(r.nb)(e,{isLoading:!0,error:void 0})),(async()=>{const e=await Object(p.a)("checkPassword",n);Object(s.g)(Object(r.nb)(Object(s.e)(),{isLoading:!1})),e&&c()})()}),Object(s.b)("clearPassword",(e,t,a)=>{const{currentPassword:n,onSuccess:c}=a;Object(s.g)(Object(r.nb)(e,{isLoading:!0,error:void 0})),(async()=>{const e=await Object(p.a)("clearPassword",n);Object(s.g)(Object(r.nb)(Object(s.e)(),{isLoading:!1})),e&&c()})()}),Object(s.b)("updatePassword",(e,t,a)=>{const{currentPassword:n,password:c,hint:o,email:i,onSuccess:l}=a;Object(s.g)(Object(r.nb)(e,{isLoading:!0,error:void 0})),(async()=>{const e=await Object(p.a)("updatePassword",n,c,o,i);Object(s.g)(Object(r.nb)(Object(s.e)(),{isLoading:!1})),e&&l()})()}),Object(s.b)("updateRecoveryEmail",(e,t,a)=>{const{currentPassword:n,email:c,onSuccess:o}=a;Object(s.g)(Object(r.nb)(e,{isLoading:!0,error:void 0})),(async()=>{const e=await Object(p.a)("updateRecoveryEmail",n,c);Object(s.g)(Object(r.nb)(Object(s.e)(),{isLoading:!1,waitingEmailCodeLength:void 0})),e&&o()})()}),Object(s.b)("provideTwoFaEmailCode",(e,t,a)=>{const{code:s}=a;Object(p.a)("provideRecoveryEmailCode",s)}),Object(s.b)("clearTwoFaError",e=>Object(r.nb)(e,{error:void 0}));var V=a(61);Object(s.b)("validateRequestedInfo",(e,t,a)=>{const{requestInfo:n,saveInfo:c}=a,i=Object(o.ib)(e);i&&async function(e,t,a){const n=await Object(p.a)("validateRequestedInfo",{messageId:e,requestInfo:t,shouldSave:a});if(!n)return;const{id:c,shippingOptions:o}=n;if(!c)return;let i=Object(r.F)(Object(s.e)(),c);o?(i=Object(r.hb)(i,o),i=Object(r.D)(i,u.j.Shipping)):i=Object(r.D)(i,u.j.PaymentInfo);Object(s.g)(i)}(i,n,c)}),Object(s.b)("getPaymentForm",(e,t,a)=>{const{messageId:n}=a;n&&async function(e){const t=await Object(p.a)("getPaymentForm",{messageId:e});if(!t)return;let a=Object(r.C)(Object(s.e)(),t),n=u.j.PaymentInfo;a.payment.invoice&&(a.payment.invoice.shippingAddressRequested||a.payment.invoice.nameRequested||a.payment.invoice.phoneRequested||a.payment.invoice.emailRequested)&&(n=u.j.ShippingInfo);a=Object(r.D)(a,n),Object(s.g)(a)}(n)}),Object(s.b)("getReceipt",(e,t,a)=>{const{receiptMessageId:n,chatId:c,messageId:i}=a;i&&n&&c&&async function(e,t,a){const n=await Object(p.a)("getReceipt",t);if(!n)return;let c=Object(s.e)();const i=Object(o.l)(c,a,e);c=Object(r.E)(c,n,i),Object(s.g)(c)}(i,n,c)}),Object(s.b)("clearPaymentError",e=>{Object(s.g)({...e,payment:{...e.payment,error:void 0}})}),Object(s.b)("clearReceipt",e=>{Object(s.g)({...e,payment:{...e.payment,receipt:void 0}})}),Object(s.b)("sendCredentialsInfo",(e,t,a)=>{const n=Object(o.lb)(e);if(!n)return;const{credentials:c}=a,{data:i}=c;!async function(e,t){const a=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}),n=await fetch("https://api.stripe.com/v1/tokens"+a,{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/x-www-form-urlencoded",Authorization:"Bearer "+t}}),c=await n.json();if(c.error){const e=Object(V.b)(c.error),t=Object(s.e)();return void Object(s.g)({...t,payment:{...t.payment,error:{...e}}})}let o=Object(r.G)(Object(s.e)(),{type:c.type,id:c.id});o=Object(r.D)(o,u.j.Checkout),Object(s.g)(o)}(i,n)}),Object(s.b)("sendPaymentForm",(e,t,a)=>{const{shippingOptionId:n,saveCredentials:c}=a,i=Object(o.ib)(e),l=Object(o.jb)(e),d=Object(o.lb)(e),b=Object(o.Bb)(e);i&&d&&async function(e,t,a,n){if(await Object(p.a)("sendPaymentForm",{messageId:e,credentials:t,requestedInfoId:a,shippingOptionId:n})){const e=Object(r.i)(Object(s.e)());Object(s.g)(Object(r.j)(e))}}(i,{save:c,data:b},l,n)}),Object(s.b)("setPaymentStep",(e,t,a={})=>Object(r.D)(e,a.step||u.j.ShippingInfo)),Object(s.b)("setInvoiceMessageInfo",(e,t,a)=>Object(r.B)(e,a));a(89);var W=a(34),K=a(79);const Q=Object(f.h)(e=>e(),1e3,!0);Object(s.b)("apiUpdate",(e,t,a)=>{switch(a["@type"]){case"updateChat":{a.noTopChatsRequest||Object(o.M)(e,a.id)||t.loadTopChats();const n=Object(r.I)(e,a.id,a.chat,a.newProfilePhoto);Object(s.g)(n);const c=Object(o.r)(n);Q(()=>Object(K.a)(c));break}case"updateChatJoin":{const n=Object(o.k)(e,a.id);if(!n)break;e=Object(r.J)(e,n,[a.id]),e=Object(r.I)(e,a.id,{isNotJoined:!1}),Object(s.g)(e);const c=Object(o.g)(e,a.id);c&&t.requestChatUpdate({chatId:c.id});break}case"updateChatLeave":{const t=Object(o.k)(e,a.id);if(!t)break;const{[t]:n}=e.chats.listIds;n&&(e=Object(r.s)(e,t,n.filter(e=>e!==a.id))),e=Object(r.I)(e,a.id,{isNotJoined:!0}),Object(s.g)(e);break}case"updateChatInbox":Object(s.g)(Object(r.I)(e,a.id,a.chat));break;case"updateChatTypingStatus":{const{id:t,typingStatus:n}=a;Object(s.g)(Object(r.I)(e,t,{typingStatus:n})),setTimeout(()=>{const e=Object(s.e)(),a=Object(o.g)(e,t);a&&n&&a.typingStatus&&a.typingStatus.timestamp===n.timestamp&&Object(s.g)(Object(r.I)(e,t,{typingStatus:void 0}))},6e3);break}case"newMessage":{const{message:n}=a,{chatId:c,threadId:i,type:l}=Object(o.z)(e)||{};if(n.senderId===e.currentUserId&&!n.isFromScheduled)return;const d=Object(o.g)(e,a.chatId);if(!d)return;const u="thread"===l&&i===b.MAIN_THREAD_ID&&a.chatId===c;u?setTimeout(()=>{t.requestChatUpdate({chatId:a.chatId})},1e3):Object(s.g)(Object(r.I)(e,a.chatId,{unreadCount:d.unreadCount?d.unreadCount+1:1,...a.message.hasUnreadMention&&{unreadMentionsCount:d.unreadMentionsCount?d.unreadMentionsCount+1:1}}));const m=Object(o.r)(Object(s.e)());Object(K.a)(m),Object(W.b)({chat:d,message:n,isActiveChat:u});break}case"updateCommonBoxMessages":case"updateChannelMessages":{const{ids:t,messageUpdate:n}=a;if(!1!==n.hasUnreadMention)return;t.forEach(t=>{const s="channelId"in a?a.channelId:Object(o.q)(e,t),n=Object(o.g)(e,s);n&&n.unreadMentionsCount&&(e=Object(r.I)(e,s,{unreadMentionsCount:n.unreadMentionsCount-1}))}),Object(s.g)(e);break}case"updateChatFullInfo":{const{fullInfo:t}=a,n=e.chats.byId[a.id];if(!n)return;Object(s.g)(Object(r.I)(e,a.id,{fullInfo:{...n.fullInfo,...t}}));break}case"updatePinnedChatIds":{const{ids:t,folderId:c}=a,r=c===n.i?"archived":"active";e={...e,chats:{...e.chats,orderedPinnedIds:{...e.chats.orderedPinnedIds,[r]:t.length?t:void 0}}},Object(s.g)(e);break}case"updateChatPinned":{const{id:t,isPinned:c}=a,r=Object(o.k)(e,t);if(r){const{[r]:a}=e.chats.orderedPinnedIds;let s=a||[];if(c){if(!s.includes(t)){if("active"===r&&s.length>=n.V){const t=e.chats.listIds.active;s=s.filter(e=>t&&t.includes(e))}s=[t,...s]}}else s=s.filter(e=>e!==t);e={...e,chats:{...e.chats,orderedPinnedIds:{...e.chats.orderedPinnedIds,[r]:s.length?s:void 0}}}}Object(s.g)(e);break}case"updateChatListType":{const{id:t,folderId:n}=a;Object(s.g)(Object(r.L)(e,t,n));break}case"updateChatFolder":{const{id:t,folder:n}=a,{byId:c,orderedIds:r}=e.chatFolders,o=n?{...c,[t]:n}:Object(h.l)(c,Object.keys(c).map(Number).filter(e=>e!==t)),i=n?r&&r.includes(t)?r:[...r||[],t]:r?r.filter(e=>e!==t):void 0;Object(s.g)({...e,chatFolders:{...e.chatFolders,byId:o,orderedIds:i}});break}case"updateChatFoldersOrder":{const{orderedIds:t}=a;Object(s.g)({...e,chatFolders:{...e.chatFolders,orderedIds:t}});break}case"updateRecommendedChatFolders":{const{folders:t}=a;Object(s.g)({...e,chatFolders:{...e.chatFolders,recommended:t}});break}case"updateChatMembers":{const t=e.chats.byId[a.id],{replacedMembers:n,addedMember:c,deletedMemberId:o}=a;if(!t)return;let i=!1,l=t.fullInfo&&t.fullInfo.members?[...t.fullInfo.members]:[];if(n)l=n,i=!0;else if(c)l.length&&l.some(e=>e.userId===c.userId)||(l.push(c),i=!0);else if(l.length&&o){const e=l.findIndex(e=>e.userId===o);e>-1&&(l.slice(e,1),i=!0)}if(i){const n=l.filter(({isOwner:e,isAdmin:t})=>e||t);Object(s.g)(Object(r.I)(e,a.id,{membersCount:l.length,fullInfo:{...t.fullInfo,members:l,adminMembers:n}}))}break}case"deleteProfilePhotos":{const{chatId:t,ids:n}=a,c=e.chats.byId[t];c&&c.photos&&Object(s.g)(Object(r.I)(e,t,{photos:c.photos.filter(e=>!n.includes(e.id))}));break}case"draftMessage":{const{chatId:t,formattedText:n,date:c,replyingToId:o}=a;e.chats.byId[t]&&(e=Object(r.y)(e,t,b.MAIN_THREAD_ID,"draft",n),e=Object(r.y)(e,t,b.MAIN_THREAD_ID,"replyingToId",o),e=Object(r.I)(e,t,{draftDate:c}),Object(s.g)(e));break}case"showInvite":{const{data:e}=a;t.showDialog({data:e});break}}});function J(e,t,a,s,n=!1){const c=n?Object(o.rb)(e,t,a):Object(o.l)(e,t,a);if(c&&s.content){const{photo:e,video:t,sticker:a,document:n}=Object(l.v)(c);e&&s.content.photo?(s.content.photo.blobUrl=e.blobUrl,s.content.photo.thumbnail=e.thumbnail):t&&s.content.video?s.content.video.blobUrl=t.blobUrl:a&&s.content.sticker?s.content.sticker.isPreloadedGlobally=a.isPreloadedGlobally:n&&s.content.document&&(s.content.document.previewBlobUrl=n.previewBlobUrl)}return n?Object(r.fb)(e,t,a,s):Object(r.M)(e,t,a,s)}function Y(e,t){const{id:a,chatId:s}=t,{threadInfo:n,firstMessageId:c}=Object(o.Eb)(e,s,t)||{},i=Object(o.g)(e,s),d=i&&i.unreadCount&&!Object(o.Z)(e,s,b.MAIN_THREAD_ID);if(n&&(!c&&Object(l.xb)(t)||(e=Object(r.W)(e,s,n.threadId,[a]),Object(o.Y)(e,s,n.threadId)&&(e=Object(r.h)(e,s,n.threadId,a),c||(e=Object(r.y)(e,s,n.threadId,"firstMessageId",t.id)))),e=Object(r.y)(e,s,n.threadId,"threadInfo",{...n,lastMessageId:t.id,messagesCount:n.messagesCount+1})),d)return e;if(e=Object(r.W)(e,s,b.MAIN_THREAD_ID,[a]),Object(o.Y)(e,s,b.MAIN_THREAD_ID)){const t=Object(o.H)(e,s,b.MAIN_THREAD_ID),n=Object(r.h)(e,s,b.MAIN_THREAD_ID,a),c=Object(o.Kb)(n,s,b.MAIN_THREAD_ID);t&&!c.includes(t)||(e=n)}return e}function X(e,t,a,s=!1){const{chats:n}=e,c=n.byId[t]&&n.byId[t].lastMessage;if(c&&!s){if(!(c.id===a.id||c.id===a.previousLocalId||a.id>c.id))return e}return Object(r.I)(e,t,{lastMessage:a})}function Z(e,t){const a=Object(o.n)(e,t),s=Object(o.Z)(e,t,b.MAIN_THREAD_ID);if(!a||!s)return;let n=s.length;for(;n--;){const e=a[s[n]];if(!e.isDeleting)return e}}function ee(e,t,a,n){if(e){t.forEach(t=>{const a=Z(n=Object(r.M)(n,e,t,{isDeleting:!0}),e);a&&(n=X(n,e,a,!0))}),Object(s.g)(n),a.requestChatUpdate({chatId:e});const c=[];return t.forEach(t=>{const a=Object(o.l)(n,e,t);if(!a)return;const{threadInfo:s}=Object(o.Eb)(n,e,a)||{};s&&c.push(s.threadId)}),void setTimeout(()=>{Object(s.g)(Object(r.k)(Object(s.e)(),e,t)),Object(h.o)(c).forEach(t=>{a.requestThreadInfoUpdate({chatId:e,threadId:t})})},350)}const c=[];t.forEach(e=>{const t=Object(o.q)(n,e);if(t){c.push(t);const a=Z(n=Object(r.M)(n,t,e,{isDeleting:!0}),t);a&&(n=X(n,t,a,!0)),setTimeout(()=>{Object(s.g)(Object(r.k)(Object(s.e)(),t,[e]))},350)}}),Object(s.g)(n),Object(h.o)(c).forEach(e=>{a.requestChatUpdate({chatId:e})})}Object(s.b)("apiUpdate",(e,t,a)=>{switch(a["@type"]){case"newMessage":{const{chatId:n,id:c,message:i}=a;e=Y(e=J(e,n,c,i),i),i.threadInfo&&(e=Object(r.lb)(e,i.threadInfo.chatId,i.threadInfo.threadId,i.threadInfo)),Object(s.g)(e);const d=Object(o.l)(e,n,c);if(Object(o.a)(e,n,i)){if(i.isOutgoing&&(!i.content||!i.content.action)){const a=Object(o.z)(e);a&&t.focusMessage({chatId:n,threadId:a.threadId,messageId:i.id,noHighlight:!0})}const{threadInfo:a}=Object(o.Eb)(e,n,i)||{};a&&t.requestThreadInfoUpdate({chatId:n,threadId:a.threadId}),Object(l.xb)(i)||setTimeout(()=>{Object(s.g)(X(Object(s.e)(),n,d))},350)}else Object(s.g)(X(Object(s.e)(),n,d));Object(o.M)(e,n)||t.loadTopChats();break}case"newScheduledMessage":{const{chatId:t,id:n,message:c}=a;e=J(e,t,n,c,!0);const i=Object(o.qb)(e,t)||[];e=Object(r.y)(e,t,b.MAIN_THREAD_ID,"scheduledIds",Object(h.o)([...i,n])),Object(s.g)(e);break}case"updateMessage":{const{chatId:t,id:n,message:c}=a;if(!Object(o.l)(e,t,n))return;e=J(e,t,n,c);const i=Object(o.l)(e,t,n);c.threadInfo&&(e=Object(r.lb)(e,c.threadInfo.chatId,c.threadInfo.threadId,c.threadInfo)),e=X(e,t,i),Object(s.g)(e);break}case"updateScheduledMessage":{const{chatId:t,id:n,message:c}=a;if(!Object(o.rb)(e,t,n))return;e=J(e,t,n,c,!0);const i=Object.keys(Object(o.sb)(e,t)||{}).map(Number).sort((e,t)=>t-e);e=Object(r.y)(e,t,b.MAIN_THREAD_ID,"scheduledIds",i),Object(s.g)(e);break}case"updateMessageSendSucceeded":{const{chatId:n,localId:c,message:i}=a;e=Y(e,i);const l=Object(o.l)(e,n,c);e=Object(r.k)(e,n,[c]),i.isScheduled&&(e=Object(r.l)(e,n,[c])),e=Object(r.M)(e,n,i.id,{...l,...i,previousLocalId:c});const d=Object(o.l)(e,n,i.id);e=X(e,n,d);const b=Object(o.Eb)(e,n,i);b&&b.threadInfo&&(t.markMessageListRead({maxId:i.id}),e=Object(r.y)(e,n,b.threadInfo.threadId,"threadInfo",{...b.threadInfo,lastMessageId:i.id,lastReadInboxMessageId:i.id})),Object(s.g)(e);break}case"updateScheduledMessageSendSucceeded":{const{chatId:t,localId:n,message:c}=a,i=Object(o.qb)(e,t)||[];e=Object(r.y)(e,t,b.MAIN_THREAD_ID,"scheduledIds",[...i,c.id]);const l=Object(o.rb)(e,t,n);e=Object(r.l)(e,t,[n]),e=Object(r.fb)(e,t,c.id,{...l,...c,previousLocalId:n}),Object(s.g)(e);break}case"updatePinnedIds":{const{chatId:t,isPinned:n,messageIds:c}=a,i=Object(o.kb)(e,t)||[],l=n?[...i,...c].sort((e,t)=>t-e):i.filter(e=>!c.includes(e));Object(s.g)(Object(r.y)(e,t,b.MAIN_THREAD_ID,"pinnedIds",l));break}case"updateThreadInfo":{const{chatId:t,threadId:n,threadInfo:c,firstMessageId:i}=a,l={...Object(o.Fb)(e,t,n),...c};if(!l.threadId)return;e=Object(r.lb)(e,t,n,l),i&&(e=Object(r.y)(e,t,n,"firstMessageId",i)),Object(s.g)(e);break}case"resetMessages":{const{id:n}=a,c=Object(o.n)(e,n);c&&!Object(l.ob)(n)&&(e=Object(r.k)(e,n,Object.keys(c).map(Number)),Object(s.g)(e),t.loadFullChat({chatId:n,force:!0}));break}case"deleteMessages":{const{ids:s,chatId:n}=a;ee(n,s,t,e);break}case"deleteScheduledMessages":{const{ids:t,chatId:n}=a;!function(e,t,a,n){if(!e)return;t.forEach(t=>{n=Object(r.fb)(n,e,t,{isDeleting:!0})}),Object(s.g)(n),setTimeout(()=>{n=Object(r.l)(Object(s.e)(),e,t);const a=Object(o.sb)(n,e);n=Object(r.y)(n,e,b.MAIN_THREAD_ID,"scheduledIds",Object.keys(a||{}).map(Number)),Object(s.g)(n)},350)}(n,t,0,e);break}case"deleteHistory":{const{chatId:s}=a,n=e.messages.byChatId[s];if(n){ee(s,Object.keys(n.byId).map(Number),t,e)}else t.requestChatUpdate({chatId:s});break}case"updateCommonBoxMessages":{const{ids:t,messageUpdate:n}=a;t.forEach(t=>{const a=Object(o.q)(e,t);a&&(e=Object(r.M)(e,a,t,n))}),Object(s.g)(e);break}case"updateChannelMessages":{const{channelId:t,ids:n,messageUpdate:c}=a;n.forEach(a=>{e=Object(r.M)(e,t,a,c)}),Object(s.g)(e);break}case"updateMessagePoll":{const{pollId:t,pollUpdate:n}=a,c=Object(o.m)(e,t);if(c&&c.content.poll){const t={...c.content.poll,...n},{results:a}=t.results||{};if(a&&!a.some(e=>e.isChosen)){const{results:e}=c.content.poll.results,s=e&&e.filter(e=>e.isChosen);s&&s.forEach(e=>{const s=a.findIndex(t=>t.option===e.option);s>=0&&(t.results.results[s].isChosen=!0)})}Object(s.g)(Object(r.M)(e,c.chatId,c.id,{content:{...c.content,poll:t}}))}break}case"updateMessagePollVote":{const{pollId:t,userId:n,options:c}=a,i=Object(o.m)(e,t);if(!i||!i.content.poll||!i.content.poll.results)break;const{poll:l}=i.content,{recentVoterIds:d,totalVoters:b,results:u}=l.results,m=d?[...d]:[],h=b?b+1:1,O=u?[...u]:[];m.push(n),c.forEach(t=>{const a=O.find(e=>e.option===t),s=O.findIndex(e=>e.option===t),c=a?{...a}:{option:t,votersCount:0};c.votersCount+=1,n===e.currentUserId&&(c.isChosen=!0),s?O[s]=c:O.push(c)}),Object(s.g)(Object(r.M)(e,i.chatId,i.id,{content:{...i.content,poll:{...l,results:{...l.results,recentVoterIds:m,totalVoters:h,results:O}}}}));break}}});const te=Object(f.h)((function(){let e=Object(s.e)();ae.forEach(([t,a])=>{e=Object(r.ob)(e,t,{status:a})}),Object(s.g)(e),ae=[]}),3e3,!0);let ae=[];Object(s.b)("apiUpdate",(e,t,a)=>{switch(a["@type"]){case"deleteUser":return Object(r.m)(e,a.id);case"updateUser":return Object(r.ob)(e,a.id,a.user);case"updateUserStatus":return s=a.userId,n=a.status,ae.push([s,n]),void te();case"updateUserFullInfo":{const{id:t,fullInfo:s}=a,n=e.users.byId[t];if(!n)return;return Object(r.ob)(e,t,{fullInfo:{...n.fullInfo,...s}})}}var s,n}),Object(s.b)("apiUpdate",(e,t,a)=>{switch(a["@type"]){case"updateStickerSet":return Object(r.ib)(e,a.id,a.stickerSet)}}),Object(s.b)("apiUpdate",(e,t,a)=>{switch(a["@type"]){case"updatePeerBlocked":return a.isBlocked?Object(r.a)(Object(s.e)(),a.id):Object(r.q)(Object(s.e)(),a.id);case"updateResetContactList":Object(s.g)({...Object(s.e)(),contactList:{hash:0,userIds:[]}});break;case"updateFavoriteStickers":t.loadFavoriteStickers();break;case"updatePrivacy":e.settings.privacy[a.key]=a.rules}}),Object(s.b)("apiUpdate",(e,t,a)=>{switch(a["@type"]){case"updateNotifySettings":return Object(r.db)(e,a.peerType,a.isSilent,a.shouldShowPreviews);case"updateNotifyExceptions":{const{chatId:t,isMuted:n,isSilent:c,shouldShowPreviews:o}=a;e.chats.byId[t]&&(e=Object(r.I)(e,t,{isMuted:n})),Object(s.g)(Object(r.e)(e,t,{isMuted:n,isSilent:c,shouldShowPreviews:o}));break}}}),Object(s.b)("apiUpdate",(e,t,a)=>{switch(a["@type"]){case"updateTwoFaStateWaitCode":return{...e,twoFaSettings:{...e.twoFaSettings,isLoading:!1,waitingEmailCodeLength:a.length}};case"updateTwoFaError":return{...e,twoFaSettings:{...e.twoFaSettings,error:a.message}}}});var se=a(37),ne=a(9),ce=a(178),re=a(40),oe=a(127);function ie(e){Object(c.n)(()=>Object(f.c)(e),[e])}var le=a(52),de=a(49),be=a(145),ue=a(113);var me=a(25),he=a(16),Oe=a(45),je=a(39),ge=a(63),pe=a(43),fe=a(21),Ie=a(159),ve=a(146);a(206);var ye=Object(c.h)(({id:e,name:t,value:a,label:s,checked:n=!1,disabled:r,inactive:o,noAnimation:i,onChange:l,onCheck:d})=>{const b=Object(c.m)(e=>{l&&l(e),d&&d(e.currentTarget.checked)},[l,d]),u=Object(ne.a)("Switcher",r&&"disabled",o&&"inactive",i&&"no-animation");return c.a.createElement("label",{className:u,title:s},c.a.createElement("input",{type:"checkbox",id:e,name:t,value:a,checked:n,disabled:r,onChange:b}),c.a.createElement("span",{className:"widget"}))});a(207);const Ce=[0,1,2];var Ee=Object(c.h)(Object(s.h)(e=>{const{query:t,fetchingStatus:a,chatId:s,date:n}=e.globalSearch,{currentUserId:c}=e,{byId:r}=e.chats,{animationLevel:i}=e.settings.byKey;return{searchQuery:t,isLoading:!!a&&Boolean(a.chats||a.messages),currentUserId:c,chatsById:r,globalSearchChatId:s,searchDate:n,theme:Object(o.Db)(e),animationLevel:i}},(e,t)=>Object(h.l)(t,["openChat","openTipsChat","setGlobalSearchDate","setGlobalSearchChatId","setSettingOption"]))(({content:e,contactsFilter:t,onSearchQuery:a,onSelectSettings:s,onSelectContacts:r,onSelectArchived:o,setGlobalSearchChatId:i,onReset:d,searchQuery:b,isLoading:h,shouldSkipTransition:O,currentUserId:j,globalSearchChatId:g,searchDate:p,theme:f,animationLevel:I,chatsById:v,openChat:y,openTipsChat:C,setGlobalSearchDate:E,setSettingOption:w})=>{const M=Object(he.a)(),S=e===u.d.ChatList,k={date:void 0},N={id:void 0},T=Object(c.p)(()=>p?Object(x.a)(new Date(1e3*p)):void 0,[p]),A=Object(c.p)(()=>S&&v?Object.values(v).reduce((e,t)=>Object(l.kb)(t)&&t.unreadCount?e+1:e,0):0,[S,v]),P="web.telegram.org"===window.location.hostname,R=Object(c.p)(()=>({onTrigger:e,isOpen:t})=>c.a.createElement(fe.a,{round:!0,ripple:S&&!m.l,size:"smaller",color:"translucent",className:t?"active":"",onClick:S?e:()=>d(),ariaLabel:S?M("AccDescrOpenMenu2"):"Return to chat list"},c.a.createElement("div",{className:Object(ne.a)("animated-menu-icon",!S&&"state-back",O&&"no-animation")})),[S,M,d,O]),L=Object(c.m)(()=>{b||a("")},[b,a]),B=Object(c.m)(()=>{y({id:j,shouldReplaceHistory:!0})},[j,y]),D=Object(c.m)(e=>{e.stopPropagation();const t="light"===f?"dark":"light";w({theme:t}),w({shouldUseSystemTheme:!1}),Object(Oe.a)(t,I===n.e)},[I,w,f]),F=Object(c.m)(e=>{e.stopPropagation();const t=0===I?2:0;Ce.forEach((e,a)=>{document.body.classList.toggle("animation-level-"+a,t===a)}),w({animationLevel:t})},[I,w]),U=Boolean(g)||e===u.d.GlobalSearch||e===u.d.Contacts,H=e===u.d.Contacts?M("SearchFriends"):M("Search");return c.a.createElement("div",{className:"LeftMainHeader"},c.a.createElement("div",{id:"LeftMainHeader",className:"left-header"},c.a.createElement(ge.a,{trigger:R,footer:`${n.g} alpha ${n.h}`},c.a.createElement(pe.a,{icon:"saved-messages",onClick:B},M("SavedMessages")),c.a.createElement(pe.a,{icon:"archive",onClick:o},c.a.createElement("span",{className:"menu-item-name"},M("ArchivedChats")),A>0&&c.a.createElement("div",{className:"archived-badge"},A)),c.a.createElement(pe.a,{icon:"user",onClick:r},M("Contacts")),c.a.createElement(pe.a,{icon:"settings",onClick:s},M("Settings")),c.a.createElement(pe.a,{icon:"darkmode",onClick:D},c.a.createElement("span",{className:"menu-item-name"},M("lng_menu_night_mode")),c.a.createElement(ye,{id:"darkmode",label:M("dark"===f?"lng_settings_disable_night_theme":"lng_settings_enable_night_theme"),checked:"dark"===f,noAnimation:!0})),c.a.createElement(pe.a,{icon:"animations",onClick:F},c.a.createElement("span",{className:"menu-item-name capitalize"},M("Appearance.Animations").toLowerCase()),c.a.createElement(ye,{id:"animations",label:"Toggle Animations",checked:I>0})),c.a.createElement(pe.a,{icon:"help",onClick:()=>{C({langCode:M.code})}},M("TelegramFeatures")),c.a.createElement(pe.a,{icon:"bug",href:n.F},"Report Bug"),P&&c.a.createElement(c.a.Fragment,null,c.a.createElement(pe.a,{icon:"char-K",href:"https://web.telegram.org/k/",onClick:()=>{localStorage.setItem("kz_version",JSON.stringify("K")),Object(je.b)()}},"Switch to K Version"),c.a.createElement(pe.a,{icon:"char-W",href:"https://web.telegram.org/?legacy=1",onClick:je.b},"Switch to Old Version"))),c.a.createElement(Ie.a,{inputId:"telegram-search-input",parentContainerClassName:"LeftSearch",className:g||p?"with-picker-item":"",value:t||b,focused:U,isLoading:h,placeholder:H,autoComplete:"off",canClose:Boolean(g||p),onChange:a,onReset:d,onFocus:L},T&&c.a.createElement(ve.a,{icon:"calendar",title:T,canClose:!0,isMinimized:Boolean(g),className:"search-date",onClick:E,clickArg:k}),g&&c.a.createElement(ve.a,{chatOrUserId:g,onClick:i,canClose:!0,clickArg:N}))))})),we=a(26);a(208);var Me=Object(c.h)(()=>{const e=Object(he.a)();return c.a.createElement("div",{id:"ConnectionState",dir:e.isRtl?"rtl":void 0},c.a.createElement(we.a,{color:"black"}),c.a.createElement("div",{className:"state-text"},e("WaitingForNetwork")))}),Se=a(137),ke=(e,t,a)=>{const s=((e,t=!1)=>Object(c.p)(()=>Object(f.h)(e=>e(),e,!t),[e,t]))(t,!0),[n,r]=Object(c.r)(),[o,i,l]=Object(me.a)();return Object(se.c)(i,l),Object(le.a)(()=>{o||s(()=>{r(e())})},a.concat([o])),n},Ne=a(176),Te=a(198);var Ae=Object(c.h)(Object(s.h)(e=>{const{chats:{byId:t},users:{byId:a},chatFolders:{byId:s,orderedIds:n,activeChatFolder:c},currentUserId:r,lastSyncTime:i}=e;return{chatsById:t,usersById:a,chatFoldersById:s,orderedFolderIds:n,lastSyncTime:i,notifySettings:Object(o.fb)(e),notifyExceptions:Object(o.eb)(e),activeChatFolder:c,currentUserId:r}},(e,t)=>Object(h.l)(t,["loadChatFolders","setActiveChatFolder","openChat"]))(({chatsById:e,usersById:t,chatFoldersById:a,notifySettings:s,notifyExceptions:n,orderedFolderIds:r,activeChatFolder:o,currentUserId:i,lastSyncTime:d,foldersDispatch:b,onScreenSelect:u,loadChatFolders:O,setActiveChatFolder:j,openChat:g})=>{const p=Object(c.q)(null),f=Object(he.a)();Object(c.n)(()=>{d&&O()},[d,O]);const I=Object(c.p)(()=>r?r.map(e=>a[e]||{}).filter(Boolean):void 0,[a,r]),v=ke(()=>{if(!I||!I.length)return;const a=Object.keys(e).map(Number),c=I.map(c=>{const{unreadDialogsCount:r,hasActiveDialogs:o}=Object(l.o)(e,t,c,a,s,n)||{};return{id:c.id,badgeCount:r,isBadgeActive:o}});return Object(h.c)(c,"id")},3e3,[I,e,t,s,n]),y=Object(c.p)(()=>{if(I&&I.length)return[{title:"en"===f.code?"All":f("FilterAllChats")},...I.map(e=>({title:e.title,...v&&v[e.id]}))]},[I,v,f]),C=Object(c.m)(e=>{j(e)},[j]);Object(c.n)(()=>{y&&y.length&&o>=y.length&&j(0)},[o,y,j]),Object(c.n)(()=>{if(p.current&&m.n&&y&&y.length)return Object(Se.b)(p.current,{onSwipe:(e,t)=>{t===Se.a.Left?j(Math.min(o+1,y.length-1)):t===Se.a.Right&&j(Math.max(0,o-1))}})},[o,y,j]);const E=Object(c.q)();E.current=0!==o,Object(c.n)(()=>E.current?Object(de.a)(()=>{E.current&&j(0)}):void 0,[o,j]),Object(je.a)(0!==o,()=>j(0)),Object(c.n)(()=>{const e=e=>{if(e.ctrlKey&&e.shiftKey&&e.code.startsWith("Digit")&&y){const[,t]=e.code.match(/Digit(\d)/)||[];if(!t)return;if("0"===t)return void g({id:i,shouldReplaceHistory:!0});const a=Number(t)-1;if(a>y.length-1)return;j(a),e.preventDefault()}};return document.addEventListener("keydown",e,!0),()=>{document.removeEventListener("keydown",e,!0)}});const{shouldRender:w,transitionClassNames:M}=Object(re.a)(!r,void 0,!0);function S(e){const t=Object.values(a).find(({title:e})=>e===y[o].title);return t&&0!==o?c.a.createElement(Te.a,{folderType:"folder",folderId:t.id,isActive:e,onScreenSelect:u,foldersDispatch:b}):c.a.createElement(Te.a,{folderType:"all",isActive:e,foldersDispatch:b,onScreenSelect:u})}return c.a.createElement("div",{className:"ChatFolders"},y&&y.length?c.a.createElement(Ne.a,{tabs:y,activeTab:o,onSwitchTab:C}):w?c.a.createElement("div",{className:Object(ne.a)("tabs-placeholder",M)}):void 0,c.a.createElement(ue.a,{ref:p,name:f.isRtl?"slide-reversed":"slide",activeKey:o,renderCount:y?y.length:void 0},S))})),Pe=a(15),Re=a(24),xe=a(20);var Le=Object(c.h)(e=>{const t=Object(Re.a)(Pe.a.Extra,"LeftSearch");return t?c.a.createElement(t,e):c.a.createElement(xe.a,null)});var Be=Object(c.h)(e=>{const t=Object(Re.a)(Pe.a.Extra,"ContactList");return t?c.a.createElement(t,e):c.a.createElement(xe.a,null)}),De=a(55);a(221);let Fe;var Ue=Object(c.h)(({isShown:e,onNewPrivateChat:t,onNewChannel:a,onNewGroup:s})=>{const[n,r]=Object(c.r)(!1);Object(c.n)(()=>{e||r(!1)},[e]);const o=Object(he.a)(),i=Object(ne.a)("NewChatButton",e&&"revealed",n&&"menu-is-open"),l=Object(c.m)(()=>{Fe&&(clearTimeout(Fe),Fe=void 0)},[]),d=Object(c.m)(()=>{Fe&&(clearTimeout(Fe),Fe=void 0),Fe=window.setTimeout(()=>{r(!1)},750)},[]);return c.a.createElement("div",{className:i,onMouseEnter:l,onMouseLeave:d},c.a.createElement(fe.a,{round:!0,color:"primary",className:n?"active":"",onClick:()=>{r(!n)},ariaLabel:o(n?"Close":"NewMessageTitle"),tabIndex:-1},c.a.createElement("i",{className:"icon-new-chat-filled"}),c.a.createElement("i",{className:"icon-close"})),c.a.createElement(De.a,{isOpen:n,positionX:"right",positionY:"bottom",autoClose:!0,onClose:()=>{r(!1)}},c.a.createElement(pe.a,{icon:"channel",onClick:a},o("NewChannel")),c.a.createElement(pe.a,{icon:"group",onClick:s},o("NewGroup")),c.a.createElement(pe.a,{icon:"user",onClick:t},o("NewMessageTitle"))))}),He=a(163);a(222);const qe=Object.keys(u.d).length/2;let Ge;var _e=Object(s.h)(e=>Object(h.l)(e,["connectionState"]))(({content:e,searchQuery:t,searchDate:a,contactsFilter:s,shouldSkipTransition:n,foldersDispatch:r,onSearchQuery:o,onContentChange:i,onScreenSelect:l,onReset:d,connectionState:b})=>{const[h,O]=Object(c.r)(m.n),j=!function(){const[e,t]=Object(c.r)(window.navigator.onLine);return Object(c.n)(()=>{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"===b,g=Object(c.q)(!1),p=Object(c.m)(()=>{i(u.d.Settings)},[i]),f=Object(c.m)(()=>{i(u.d.Contacts)},[i]),I=Object(c.m)(()=>{i(u.d.NewChannelStep1)},[i]),v=Object(c.m)(()=>{i(u.d.NewGroupStep1)},[i]),y=Object(c.m)(()=>{i(u.d.Archived)},[i]),C=Object(c.m)(()=>{e===u.d.ChatList&&(g.current=!0,O(!0))},[e]),E=Object(c.m)(()=>{g.current=!1,Ge&&(clearTimeout(Ge),Ge=void 0),Ge=window.setTimeout(()=>{g.current||O(!1)},250)},[]);Object(c.n)(()=>{let t;return e!==u.d.ChatList?t=window.setTimeout(()=>{O(!1)},250):(g.current||m.n)&&O(!0),()=>{t&&(clearTimeout(t),t=void 0)}},[e]);const[w,M,S]=function(){const[e,t]=Object(me.a)(!1);Object(c.n)(()=>{const e=window.setTimeout(t,2592e5);return()=>{clearTimeout(e)}},[t]);const{shouldRender:a,transitionClassNames:s}=Object(re.a)(e);return[a,s,()=>{window.location.reload()}]}(),k=Object(he.a)();return c.a.createElement("div",{id:"LeftColumn-main",onMouseEnter:m.n?void 0:C,onMouseLeave:m.n?void 0:E},c.a.createElement(Ee,{content:e,contactsFilter:s,onSearchQuery:o,onSelectSettings:p,onSelectContacts:f,onSelectArchived:y,onReset:d,shouldSkipTransition:n}),c.a.createElement(He.a,{isOpen:j,isCustom:!0,className:"connection-state-wrapper opacity-transition slow"},()=>c.a.createElement(Me,null)),c.a.createElement(ue.a,{name:n?"none":"zoom-fade",renderCount:qe,activeKey:e,shouldCleanup:!0,cleanupExceptionKey:u.d.ChatList,className:j?"pull-down":void 0},n=>{switch(e){case u.d.ChatList:return c.a.createElement(Ae,{onScreenSelect:l,foldersDispatch:r});case u.d.GlobalSearch:return c.a.createElement(Le,{searchQuery:t,searchDate:a,isActive:n,onReset:d});case u.d.Contacts:return c.a.createElement(Be,{filter:s,isActive:n,onReset:d});default:return}}),w&&c.a.createElement(fe.a,{fluid:!0,pill:!0,className:Object(ne.a)("btn-update",M),onClick:S},k("lng_update_telegram")),c.a.createElement(Ue,{isShown:h,onNewPrivateChat:f,onNewChannel:I,onNewGroup:v}))});var ze=Object(c.h)(e=>{const t=Object(Re.a)(Pe.a.Extra,"Settings");return t?c.a.createElement(t,e):c.a.createElement(xe.a,null)});var $e=Object(c.h)(e=>{const t=Object(Re.a)(Pe.a.Extra,"NewChat");return t?c.a.createElement(t,e):c.a.createElement(xe.a,null)});var Ve,We=Object(c.h)(e=>{const t=Object(Re.a)(Pe.a.Extra,"ArchivedChats");return t?c.a.createElement(t,e):c.a.createElement(xe.a,null)});a(223);!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"}(Ve||(Ve={}));const Ke=Object.keys(Ve).length/2;var Qe=Object(c.h)(Object(s.h)(e=>{const{globalSearch:{query:t,date:a},chatFolders:{activeChatFolder:s},shouldSkipHistoryAnimations:n}=e;return{searchQuery:t,searchDate:a,activeChatFolder:s,shouldSkipHistoryAnimations:n}},(e,t)=>Object(h.l)(t,["setGlobalSearchQuery","setGlobalSearchChatId","resetChatCreation","setGlobalSearchDate","loadPasswordInfo","clearTwoFaError"]))(({searchQuery:e,searchDate:t,activeChatFolder:a,shouldSkipHistoryAnimations:s,setGlobalSearchQuery:n,setGlobalSearchChatId:r,resetChatCreation:o,setGlobalSearchDate:i,loadPasswordInfo:l,clearTwoFaError:d})=>{const[b,h]=Object(c.r)(u.d.ChatList),[O,j]=Object(c.r)(u.n.Main),[g,p]=Object(c.r)(""),[f,I]=Object(be.c)(),[v,y]=Object(c.r)(0);let C=Ve.Main;switch(b){case u.d.Archived:C=Ve.Archived;break;case u.d.Settings:C=Ve.Settings;break;case u.d.NewChannelStep1:case u.d.NewChannelStep2:C=Ve.NewChannel;break;case u.d.NewGroupStep1:case u.d.NewGroupStep2:C=Ve.NewGroup}const E=Object(c.m)(e=>{if(b!==u.d.NewGroupStep2||e)if(b!==u.d.NewChannelStep2||e){if(b===u.d.NewGroupStep1){const e=document.getElementById("new-group-picker-search");e&&e.blur()}if(b===u.d.Settings)switch(O){case u.n.EditProfile:case u.n.Folders:case u.n.General:case u.n.Notifications:case u.n.Privacy:case u.n.Language:return void j(u.n.Main);case u.n.GeneralChatBackground:return void j(u.n.General);case u.n.GeneralChatBackgroundColor:return void j(u.n.GeneralChatBackground);case u.n.PrivacyPhoneNumber:case u.n.PrivacyLastSeen:case u.n.PrivacyProfilePhoto:case u.n.PrivacyForwarding:case u.n.PrivacyGroupChats:case u.n.PrivacyActiveSessions:case u.n.PrivacyBlockedUsers:case u.n.TwoFaDisabled:case u.n.TwoFaEnabled:case u.n.TwoFaCongratulations:return void j(u.n.Privacy);case u.n.PrivacyPhoneNumberAllowedContacts:case u.n.PrivacyPhoneNumberDeniedContacts:return void j(u.n.PrivacyPhoneNumber);case u.n.PrivacyLastSeenAllowedContacts:case u.n.PrivacyLastSeenDeniedContacts:return void j(u.n.PrivacyLastSeen);case u.n.PrivacyProfilePhotoAllowedContacts:case u.n.PrivacyProfilePhotoDeniedContacts:return void j(u.n.PrivacyProfilePhoto);case u.n.PrivacyForwardingAllowedContacts:case u.n.PrivacyForwardingDeniedContacts:return void j(u.n.PrivacyForwarding);case u.n.PrivacyGroupChatsAllowedContacts:case u.n.PrivacyGroupChatsDeniedContacts:return void j(u.n.PrivacyGroupChats);case u.n.TwoFaNewPassword:return void j(u.n.TwoFaDisabled);case u.n.TwoFaNewPasswordConfirm:return void j(u.n.TwoFaNewPassword);case u.n.TwoFaNewPasswordHint:return void j(u.n.TwoFaNewPasswordConfirm);case u.n.TwoFaNewPasswordEmail:return void j(u.n.TwoFaNewPasswordHint);case u.n.TwoFaNewPasswordEmailCode:return void j(u.n.TwoFaNewPasswordEmail);case u.n.TwoFaChangePasswordCurrent:case u.n.TwoFaTurnOff:case u.n.TwoFaRecoveryEmailCurrentPassword:return void j(u.n.TwoFaEnabled);case u.n.TwoFaChangePasswordNew:return void j(u.n.TwoFaChangePasswordCurrent);case u.n.TwoFaChangePasswordConfirm:return void j(u.n.TwoFaChangePasswordNew);case u.n.TwoFaChangePasswordHint:return void j(u.n.TwoFaChangePasswordConfirm);case u.n.TwoFaRecoveryEmail:return void j(u.n.TwoFaRecoveryEmailCurrentPassword);case u.n.TwoFaRecoveryEmailCode:return void j(u.n.TwoFaRecoveryEmail);case u.n.FoldersCreateFolder:case u.n.FoldersEditFolder:return void j(u.n.Folders);case u.n.FoldersIncludedChatsFromChatList:case u.n.FoldersExcludedChatsFromChatList:return void j(u.n.FoldersEditFolderFromChatList);case u.n.FoldersEditFolderFromChatList:return h(u.d.ChatList),void j(u.n.Main)}b!==u.d.ChatList||0!==a?(h(u.d.ChatList),p(""),n({query:""}),i({date:void 0}),r({id:void 0}),o(),setTimeout(()=>{y(Date.now())},250)):h(u.d.GlobalSearch)}else h(u.d.NewChannelStep1);else h(u.d.NewGroupStep1)},[b,a,O,n,i,r,o]),w=Object(c.m)(t=>{b!==u.d.Contacts?(h(u.d.GlobalSearch),t!==e&&n({query:t})):p(t)},[b,e,n]);Object(c.n)(()=>b!==u.d.ChatList||0===a?Object(de.a)(()=>E()):void 0,[a,b,E]),Object(c.n)(()=>{d(),O===u.n.Privacy&&l()},[d,l,O]);const M=e=>{h(u.d.Settings),j(e)};return c.a.createElement(ue.a,{id:"LeftColumn",name:s?"none":m.p,renderCount:Ke,activeKey:C,shouldCleanup:!0,cleanupExceptionKey:Ve.Main},a=>{switch(C){case Ve.Archived:return c.a.createElement(We,{isActive:a,onReset:E,onContentChange:h});case Ve.Settings:return c.a.createElement(ze,{isActive:a,currentScreen:O,foldersState:f,foldersDispatch:I,onScreenSelect:M,onReset:E,shouldSkipTransition:s});case Ve.NewChannel:return c.a.createElement($e,{key:v,isActive:a,isChannel:!0,content:b,onContentChange:h,onReset:E});case Ve.NewGroup:return c.a.createElement($e,{key:v,isActive:a,content:b,onContentChange:h,onReset:E});default:return c.a.createElement(_e,{content:b,searchQuery:e,searchDate:t,contactsFilter:g,foldersDispatch:I,onContentChange:h,onSearchQuery:w,onScreenSelect:M,onReset:E,shouldSkipTransition:s})}})})),Je=a(143),Ye=a(12),Xe=a(17),Ze=a(54);var et=()=>{const[e,t]=Object(c.r)(Ze.a.get());return Object(c.n)(()=>{const e=Object(f.h)(()=>{t(Ze.a.get())},250,!1);return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]),e},tt=a(183);function at(e,t){const a=e<=n.ob?16:32,s=function(e){if(e>n.lb){const t=Math.min(Math.max(.25*e,288),424),a=Math.min(.25*e,424);return Math.min(e-t-a,728)}if(e>n.kb){const t=Math.min(Math.max(.4*e,288),424);return Math.min(e-t,728)}if(e>728)return 728;return e}(e),c=e<=n.ob?54:64,r=t?s-a-c:s-a,o=e>n.ob?Math.min(s-a,512):s-a,i=o/r,l=r/o;return{composerHiddenScale:i,toolbarHiddenScale:l,composerTranslateX:t?c/2*l:0,toolbarTranslateX:t?c/2*-1*i:0,unpinHiddenScale:o/258,toolbarForUnpinHiddenScale:258/o}}const st=e=>e.chatId.toString()+("thread"!==e.type?"_"+e.type:-1!==e.threadId?"_"+e.threadId:"");var nt=a(134),ct=a(149),rt=a(139),ot=a(50),it=a(111),lt=a(130);var dt=Object(c.h)(e=>{const{isOpen:t}=e,a=Object(Re.a)(Pe.a.Extra,"HeaderMenuContainer",!t);return a?c.a.createElement(a,e):void 0});var bt=Object(c.h)(Object(s.h)((e,{chatId:t,threadId:a,messageListType:s})=>{const n=Object(o.g)(e,t),c=Boolean(n&&Object(l.mb)(n));if(n&&n.isRestricted)return{noMenu:!0};const r=Object(o.h)(e,t),i=Object(o.P)(e,t),d="thread"===s&&a===b.MAIN_THREAD_ID,u="thread"===s&&a!==b.MAIN_THREAD_ID,h=Object(o.W)(e),O=Boolean(r&&Object(o.X)(e,r.id)),j=!O&&Boolean(Object(o.L)(e,t)),g=Boolean(d&&n&&(c||Object(l.qb)(n))&&n.isNotJoined),p=d||u,f=d&&!i&&!g,I=!Object(o.S)(e),v=d&&!g;return{noMenu:!(m.l&&g||m.l&&p||f||I||v),isChannel:c,isRightColumnShown:h,canStartBot:j,canRestartBot:O,canSubscribe:g,canSearch:p,canMute:f,canSelect:I,canLeave:v}},(e,t)=>Object(h.l)(t,["joinChannel","sendBotCommand","openLocalTextSearch","restartBot"]))(({chatId:e,threadId:t,noMenu:a,isChannel:s,canStartBot:n,canRestartBot:r,canSubscribe:o,canSearch:i,canMute:l,canSelect:d,canLeave:b,isRightColumnShown:u,joinChannel:h,sendBotCommand:O,openLocalTextSearch:j,restartBot:g})=>{const p=Object(c.q)(null),[f,I]=Object(c.r)(!1),[v,y]=Object(c.r)(void 0),C=Object(c.m)(()=>{I(!0);const e=p.current.getBoundingClientRect();y({x:e.right,y:e.bottom})},[]),E=Object(c.m)(()=>{I(!1)},[]),w=Object(c.m)(()=>{y(void 0)},[]),M=Object(c.m)(()=>{h({chatId:e})},[h,e]),S=Object(c.m)(()=>{O({command:"/start"})},[O]),k=Object(c.m)(()=>{g({chatId:e})},[e,g]),N=Object(c.m)(()=>{if(j(),m.l){document.querySelector("#MobileSearch input").focus()}else setTimeout(()=>{const e=document.querySelector(".RightHeader .SearchInput input");e&&e.focus()},400)},[j]),T=Object(he.a)();return c.a.createElement("div",{className:"HeaderActions"},!m.l&&o&&c.a.createElement(fe.a,{size:"tiny",ripple:!0,fluid:!0,onClick:M},T(s?"Subscribe":"Join Group")),!m.l&&n&&c.a.createElement(fe.a,{size:"tiny",ripple:!0,fluid:!0,onClick:S},T("BotStart")),!m.l&&r&&c.a.createElement(fe.a,{size:"tiny",ripple:!0,fluid:!0,onClick:k},T("BotRestart")),!m.l&&i&&c.a.createElement(fe.a,{round:!0,ripple:u,color:"translucent",size:"smaller",onClick:N,ariaLabel:"Search in this chat"},c.a.createElement("i",{className:"icon-search"})),(m.l||!o)&&c.a.createElement(fe.a,{ref:p,className:f?"active":"",round:!0,ripple:!m.l,size:"smaller",color:"translucent",disabled:a,ariaLabel:"More actions",onClick:C},c.a.createElement("i",{className:"icon-more"})),v&&c.a.createElement(dt,{chatId:e,threadId:t,isOpen:f,anchor:v,isChannel:s,canStartBot:n,canRestartBot:r,canSubscribe:o,canSearch:i,canMute:l,canSelect:d,canLeave:b,onSubscribeChannel:M,onSearchClick:N,onClose:E,onCloseAnimationEnd:w}))})),ut=a(118),mt=a(22),ht=a(110),Ot=a(46);function jt(e){const t=e&&Object(l.F)(e),{sticker:a}=e&&e.content||{},s=t&&a&&!Object(m.t)()&&t.includes("image/webp"),[r,o]=Object(c.r)(Ot.a),i=e&&e.id;return Object(c.o)(()=>{s&&Object(Ot.c)("b64-"+i,t).then(o).catch(e=>{n.r&&console.error(e)})},[i,s,t]),s?r:t}var gt=a(120),pt=a(44);function ft(e,t,a,s,n){return`M${e},${t+n}a${n},${n},0,0,1,\n ${a},0v${s-2*n}a${n},${n},0,0,1,${-a},0Z`}var It=Object(c.h)(({count:e,index:t})=>{const a=Object(c.q)(null),s=Object(c.p)(()=>function(e,t){const a=e-t-1,s=function(e){let t=8;1===e?t=36:2===e?t=17:3===e?t=11:(4===e||e>3)&&(t=7.5);return t}(e),n=function(e,t){let a=36;1===e?a=36:2===e?a=17:3===e?a=1===t?12:11:(4===e||e>3)&&(a=7.5);return a}(e,a),c=function(e,t){return e<=3?36:t*e+2*(e-1)}(e,s),r="clipPath"+e,o=function(e,t,a){let s="";if(3===a)s=ft(0,0,2,t,1)+ft(0,12,2,t+1,1)+ft(0,25,2,t,1);else for(let e=0;e\n \n `}(r,s,e),i=function(e,t,a){if(1===a)return 0;if(2===a)return 0===e?0:t+2;return 3===a?0===e?0:1===e?12:25:(t+2)*e}(a,s,e),l=function(e,t,a,s){if(t<=4)return 0;if(e<=1)return 0;if(e>=t-2)return s-36;return(a+4)/2+(e-2)*(a+2)}(a,e,s,c);return{markHeight:n,clipPath:o,markTranslateY:i,trackTranslateY:l,trackHeight:c,clipPathId:r}}(e,t),[e,t]);if(Object(c.n)(()=>{if(!a.current)return;const{trackHeight:e,trackTranslateY:t,markHeight:n,markTranslateY:c,clipPathId:r,clipPath:o}=s,i=a.current.firstElementChild;if(a&&a.current){const s=a.current,{style:l}=s;l.height=e+"px",l.transform=`translateY(-${t}px)`,l.clipPath=`url("#${r}")`;const d=s.querySelector("svg"),b=s.querySelector("div"),u=s.querySelector("defs");d||i&&(i.innerHTML=` ${o} `),u&&(u.innerHTML=o),b&&(b.style.height=n+"px",b.style.transform=`translateY(${c}px)`)}},[s]),1===e)return c.a.createElement("div",{className:"pinned-message-border"},c.a.createElement("div",{className:"pinned-message-border-wrapper-1",ref:a}));const{trackHeight:n,trackTranslateY:r,markHeight:o,markTranslateY:i,clipPathId:l}=s;return c.a.createElement("div",{className:Object(ne.a)("pinned-message-border",e>4&&"pinned-message-border-mask")},c.a.createElement("div",{className:"pinned-message-border-wrapper",ref:a,style:`clip-path: url("#${l}"); width: 2px;\n height: ${n}px; transform: translateY(-${r}px);`},c.a.createElement("span",null),c.a.createElement("div",{className:"pinned-message-border-mark",style:`height: ${o}px; transform: translateY(${i}px);`})))});var vt=Object(c.h)(({message:e,count:t,index:a,customTitle:s,className:n,onUnpinMessage:r,onClick:o,onAllPinnedClick:i})=>{const d=Object(he.a)(),b=jt(e),u=Object(ht.a)(Object(l.E)(e,"pictogram")),m=Object(l.O)(d,e,Boolean(b)),[h,O,j]=Object(me.a)(),g=Object(c.m)(()=>{j(),r&&r(e.id)},[j,r,e.id]);return c.a.createElement("div",{className:Object(ne.a)("HeaderPinnedMessage-wrapper",n)},t>1&&c.a.createElement(fe.a,{round:!0,size:"smaller",color:"translucent",className:"pin-list-button",ariaLabel:d("EventLogFilterPinnedMessages"),onClick:i},c.a.createElement("i",{className:"icon-pin-list"})),r&&c.a.createElement(fe.a,{round:!0,size:"smaller",color:"translucent",ariaLabel:d("UnpinMessageAlertTitle"),className:"unpin-button",onClick:O},c.a.createElement("i",{className:"icon-close"})),c.a.createElement(gt.a,{isOpen:h,onClose:j,text:"Would you like to unpin this message?",confirmLabel:"Unpin",confirmHandler:g}),c.a.createElement("div",{className:"HeaderPinnedMessage",onClick:o,dir:d.isRtl?"rtl":void 0},c.a.createElement(It,{count:t,index:a}),b&&function(e,t){const{width:a,height:s}=Object(ut.m)();return c.a.createElement("img",{src:t||e,width:a,height:s,alt:""})}(b,u),c.a.createElement("div",{className:"message-text"},c.a.createElement("div",{className:"title",dir:"auto"},s||`${d("PinnedMessage")} ${a>0?"#"+(t-a):""}`),c.a.createElement("p",{dir:"auto"},Object(mt.a)(m))),c.a.createElement(pt.a,null)))}),yt=a(57),Ct=a(184);a(226);var Et=Object(s.h)((e,{message:t})=>({sender:Object(o.vb)(e,t)}),(e,t)=>Object(h.l)(t,["focusMessage","closeAudioPlayer"]))(({message:e,className:t,noUi:a,sender:s,focusMessage:n,closeAudioPlayer:r})=>{const o=Object(he.a)(),i=s?Object(l.X)(o,s):void 0,d=yt.c(Object(l.E)(e,"inline")),{playPause:b,isPlaying:u}=Object(Ct.a)(Object(l.C)(e),Object(l.q)(e),d,void 0,void 0,!0),h=Object(c.m)(()=>{n({chatId:e.chatId,messageId:e.id})},[n,e.chatId,e.id]),O=Object(c.m)(()=>{u&&b(),r()},[r,u,b]);if(a)return;const j=Object(l.t)(e);return c.a.createElement("div",{className:Object(ne.a)("AudioPlayer",t),dir:o.isRtl?"rtl":void 0},c.a.createElement(fe.a,{round:!0,ripple:!m.l,color:"translucent",size:"smaller",className:Object(ne.a)("toggle-play",u?"pause":"play"),onClick:b,ariaLabel:u?"Pause audio":"Play audio"},c.a.createElement("i",{className:"icon-play"}),c.a.createElement("i",{className:"icon-pause"})),c.a.createElement("div",{className:"AudioPlayer-content",onClick:h},j?function(e){const{title:t,performer:a,fileName:s}=e;return c.a.createElement(c.a.Fragment,null,c.a.createElement("div",{className:"title",dir:"auto"},Object(mt.a)(t||s)),a&&c.a.createElement("div",{className:"subtitle",dir:"auto"},Object(mt.a)(a)))}(j):function(e,t){return c.a.createElement(c.a.Fragment,null,c.a.createElement("div",{className:"title",dir:"auto"},t&&Object(mt.a)(t)),c.a.createElement("div",{className:"subtitle",dir:"auto"},e))}(o("AttachAudio"),i),c.a.createElement(pt.a,null)),c.a.createElement(fe.a,{round:!0,className:"player-close",color:"translucent",size:"smaller",onClick:O,ariaLabel:"Close player"},c.a.createElement("i",{className:"icon-close"})))});a(227);var wt=Object(c.h)(Object(s.h)((e,{chatId:t,threadId:a,messageListType:s})=>{const{isLeftColumnShown:n,lastSyncTime:c,shouldSkipHistoryAnimations:r}=e,{byId:i}=e.chats,l=Object(o.g)(e,t),{typingStatus:d}=l||{},{chatId:u,messageId:m}=e.audioPlayer,h=u&&m?Object(o.l)(e,u,m):void 0;let O;if("pinned"===s){const a=Object(o.kb)(e,t);O=a&&a.length}else if("scheduled"===s){const a=Object(o.qb)(e,t);O=a&&a.length}else if("thread"===s&&a!==b.MAIN_THREAD_ID){const s=Object(o.Fb)(e,t,a);s&&(O=s.messagesCount)}const j={typingStatus:d,isLeftColumnShown:n,isRightColumnShown:Object(o.W)(e),isSelectModeActive:Object(o.S)(e),audioMessage:h,chat:l,chatsById:i,messagesCount:O,isChatWithSelf:Object(o.P)(e,t),isChatWithBot:l&&Object(o.O)(e,l),lastSyncTime:c,notifySettings:Object(o.fb)(e),notifyExceptions:Object(o.eb)(e),shouldSkipHistoryAnimations:r,currentTransitionKey:Math.max(0,e.messages.messageLists.length-1)},g=Object(o.n)(e,t);if("thread"!==s||!g)return j;if(Object.assign(j,{messagesById:g}),a!==b.MAIN_THREAD_ID){const s=Object(o.Hb)(e,t,a),n=s?Object(o.l)(e,t,s):void 0,c=n?Object(o.K)(e,n):void 0;return{...j,pinnedMessageIds:s,canUnpin:!1,topMessageSender:c}}const p=Object(o.kb)(e,t);if(p&&p.length){const t=g[p[0]],{canUnpin:s}=t&&Object(o.b)(e,t,a)||{};return{...j,pinnedMessageIds:p,canUnpin:s}}return j},(e,t)=>Object(h.l)(t,["openChatWithInfo","pinMessage","focusMessage","openChat","openPreviousChat","loadPinnedMessages","toggleLeftColumn","exitMessageSelectMode"]))(({chatId:e,threadId:t,messageListType:a,isReady:s,pinnedMessageIds:r,messagesById:o,canUnpin:i,topMessageSender:d,typingStatus:u,isSelectModeActive:h,isLeftColumnShown:O,isRightColumnShown:j,audioMessage:g,chat:p,chatsById:f,messagesCount:I,isChatWithSelf:v,isChatWithBot:y,lastSyncTime:C,notifySettings:E,notifyExceptions:w,shouldSkipHistoryAnimations:M,currentTransitionKey:S,openChatWithInfo:k,pinMessage:N,focusMessage:T,openChat:A,openPreviousChat:P,loadPinnedMessages:R,toggleLeftColumn:x,exitMessageSelectMode:L})=>{const B=Object(he.a)(),[D,F]=Object(c.r)(0),U=Array.isArray(r)?r[D]:r,H=o&&U?o[U]:void 0,q=Array.isArray(r)?r.length:r?1:0,G=p&&Object(l.k)(B,p).length,_=d?Object(l.X)(B,d):void 0;Object(c.n)(()=>{t===b.MAIN_THREAD_ID&&C&&s&&R({chatId:e})},[e,R,C,t,s]),Object(c.n)(()=>{F(0)},[r]),Object(ct.a)(e,U,H);const{width:z}=et(),$=z<=n.kb,V=m.m&&O,W=Object(c.q)(null),K=Object(c.q)(!0),Q=Object(c.m)(()=>{k({id:e})},[k,e]),J=Object(c.m)(t=>{N({chatId:e,messageId:t,isUnpin:!0})},[N,e]),Y=Object(c.m)(()=>{if(H){T({chatId:H.chatId,threadId:t,messageId:H.id});const e=Object(nt.a)(q,D+1);F(e)}},[H,T,t,q,D]),X=Object(c.m)(()=>{A({id:e,threadId:b.MAIN_THREAD_ID,type:"pinned"})},[A,e]),Z=Object(c.m)(e=>{if(m.l){const e=document.getElementById(n.z);e&&e.blur()}t!==b.MAIN_THREAD_ID||"thread"!==a||0!==S?("scheduled"===a&&h&&L(),P()):m.l||V?(e.stopPropagation(),A({id:void 0})):x()},[t,a,S,h,P,V,A,x,L]),ee=Object(c.p)(()=>{if(!$||!f)return;let e=!1;const t=Object.values(f).reduce((t,a)=>{if(Object(l.kb)(a))return t;const s=a.unreadCount||0;return!s||Object(l.Hb)(a,E,w)&&!a.unreadMentionsCount||(e=!0),t+s},0);return t?{isActive:e,totalCount:t}:void 0},[$,f,E,w]),te=z>=n.kb&&zn.ob&&z30),ae=te||z>n.lb&&z0)&&je(V,ee),c.a.createElement("div",{className:"chat-info-wrapper",onClick:Q},Object(l.ob)(e)?c.a.createElement(it.a,{userId:e,typingStatus:u,withFullInfo:y,withMediaViewer:!0,withUpdatingStatus:!0,noRtl:!0}):c.a.createElement(lt.a,{chatId:e,typingStatus:u,noRtl:!0,withMediaViewer:!0,withFullInfo:!0,withUpdatingStatus:!0}))):"thread"===a?c.a.createElement(c.a.Fragment,null,je(),c.a.createElement("h3",null,B("CommentsCount",I))):"pinned"===a?c.a.createElement(c.a.Fragment,null,je(),c.a.createElement("h3",null,B("PinnedMessagesCount",I))):"scheduled"===a?c.a.createElement(c.a.Fragment,null,je(),c.a.createElement("h3",null,v?B("Reminders"):B("messages",I,"i"))):void 0}function je(e=!1,t){return c.a.createElement("div",{className:"back-button"},c.a.createElement(fe.a,{round:!0,size:"smaller",color:"translucent",onClick:Z,ariaLabel:e?"Close":"Back"},c.a.createElement("div",{className:Object(ne.a)("animated-close-icon",!e&&"state-back")})),t&&c.a.createElement("div",{className:"unread-count "+(t.isActive?"active":"")},Object(ot.b)(t.totalCount)))}return Object(c.n)(()=>{const e=W.current;if(e)return ae&&me?void(j||te?(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))},[ae,me,te,j]),c.a.createElement("div",{className:"MiddleHeader",ref:W},c.a.createElement(ue.a,{name:M?"none":"slide-fade",activeKey:S},Oe),c.a.createElement("div",{className:"header-tools"},ie&&de&&!se&&c.a.createElement(vt,{key:e,message:de,count:q,index:D,customTitle:be,className:le,onUnpinMessage:i?J:void 0,onClick:Y,onAllPinnedClick:X}),se&&oe&&c.a.createElement(Et,{key:Object(l.C)(oe),message:oe,className:ce}),c.a.createElement(bt,{chatId:e,threadId:t,messageListType:a})))})),Mt=a(165),St=a(58);function kt(e){return"albumId"in e}function Nt(e,t){let a,s=[],n={originalDate:e[0].date,datetime:Number(Object(x.j)(1e3*e[0].date)),senderGroups:[s]};const c=[n];return e.forEach((r,o)=>{r.isInAlbum?a?(a.messages.push(r),r.content.text&&(a.mainMessage=r)):a={albumId:r.groupedId,messages:[r],mainMessage:r}:s.push(r);const i=e[o+1];if(!a||i&&i.groupedId&&i.groupedId===a.albumId||(s.push(a),a=void 0),i){const e=Number(Object(x.j)(1e3*i.date));n.datetime!==e?(n={originalDate:i.date,datetime:e,senderGroups:[]},c.push(n),s=[],n.senderGroups.push(s)):(i.id===t||r.senderId!==i.senderId||r.isOutgoing!==i.isOutgoing||Object(l.gb)(r)||Object(l.gb)(i)||r.forwardInfo&&i.forwardInfo&&(r.forwardInfo.senderUserId!==i.forwardInfo.senderUserId||r.forwardInfo.fromChatId!==i.forwardInfo.fromChatId||r.forwardInfo.hiddenUserName!==i.forwardInfo.hiddenUserName)||r.inlineButtons||i.inlineButtons||i.date-r.date>600)&&(s=[],n.senderGroups.push(s))}}),c}function Tt(e){!m.l&&document.activeElement&&document.activeElement.id===n.z&&e.target===e.currentTarget&&e.preventDefault()}function At(){const[e,t]=Object(me.a)(!1),a=(s=1e3,n=!1,Object(c.p)(()=>Object(f.a)(e=>e(),s,n,r),[s,n,r]));var s,n,r;return{isScrolled:e,updateStickyDates:Object(c.m)((e,s)=>{t(),document.body.classList.contains("is-scrolling-messages")||Object(f.b)(()=>{document.body.classList.add("is-scrolling-messages")}),a(()=>{Object(f.b)(()=>{const t=document.querySelector(".stuck");t&&t.classList.remove("stuck");const a=function(e,t){const a=e.querySelectorAll(".sticky-date"),s=e.scrollTop;return Array.from(a).find(e=>{const{offsetTop:a,offsetHeight:n}=e,c=a-s;return-n<=c&&c<=(t?60:10)})}(e,s);a&&a.classList.add("stuck"),document.body.classList.remove("is-scrolling-messages")})})},[t,a])}}var Pt=a(160),Rt=a(131),xt=a(109);const Lt=m.b?1e3:350,Bt=m.l?300:500;var Dt=a(150),Ft=a(151);function Ut(e){return"number"==typeof e}function Ht(e,t){return e?t?238:175:t?238:100}function qt(e,t){const a=Object(l.yb)(e),s=Object(l.tb)(e),n=Object(l.H)(e)||Object(l.S)(e),c=Object(l.Q)(e),r=Boolean(Object(l.S)(e)),{width:o,height:i}=n?Object(ut.g)(n,a,s,r,t):Object(ut.i)(c,a,s,t),d=Ht(Boolean(Object(l.P)(e)));let b=1;oe+t,t)}function Kt(e,t,a){return ea?a:e}function Qt(e){const t={width:0,height:0};return e.forEach(({dimensions:e,sides:a})=>{a&zt&&(t.width=e.width+e.x),a&$t&&(t.height=e.height+e.y)}),t}function Jt(e,t,a,s){const n=s.messages.map(e=>{const t=qt(e);return t.width/t.height});const c=function(e){return e.map(e=>e>1.2?"w":e<.8?"n":"q").join("")}(n),r=function(e){return e.reduce((e,t)=>t+e,1)/e.length}(n),o=n.length,i=n.some(e=>e>2),l=Object(ut.j)(e,t,!1,a)-(t?2.5:0)*ut.d;let d;const b={ratios:n,proportions:c,averageRatio:r,maxWidth:l,minWidth:100,maxHeight:l,spacing:2};return d=o>=5||i?function({ratios:e,averageRatio:t,maxWidth:a,minWidth:s,spacing:n,maxHeight:c=4*a/3}){const r=function(e,t){return e.map(e=>t>1.1?Kt(e,1,2.75):Kt(e,.6667,1))}(e,t),o=e.length,i=new Array(o),l=[],d=e=>{const t=[];let s=0;e.forEach(e=>{t.push(((e,t)=>{const s=Wt(r.slice(e,e+t),0);return(a-(t-1)*n)/s})(s,e)),s+=e}),l.push({lineCounts:e,heights:t})};for(let e=1;e!==o;++e){const t=o-e;e<=3&&t<=3&&d([e,t])}for(let e=1;e!==o-1;++e)for(let a=1;a!==o-e;++a){const s=o-e-a;e<=3&&a<=(t<.85?4:3)&&s<=3&&d([e,a,s])}for(let e=1;e!==o-1;++e)for(let t=1;t!==o-e;++t)for(let a=1;a!==o-e-t;++a){const s=o-e-t-a;e<=3&&t<=3&&a<=3&&s<=4&&d([e,t,a,s])}let b,u=0;for(let e=0;e{for(let e=1;e!==r;++e)if(a[e-1]>a[e])return 1.5;return 1})(),m=Math.abs(o-c)*i*d;(!b||m1.4&&t[1]-t[0]<.2?function(e){const{ratios:t,maxWidth:a,spacing:s,maxHeight:n}=e,c=Math.round(Math.min(a/t[0],Math.min(a/t[1],(n-s)/2)));return[{dimensions:{x:0,y:0,width:a,height:c},sides:Vt|_t|zt},{dimensions:{x:0,y:c+s,width:a,height:c},sides:Vt|$t|zt}]}(e):"ww"===a||"qq"===a?function(e){const{ratios:t,maxWidth:a,spacing:s,maxHeight:n}=e,c=(a-s)/2,r=Math.round(Math.min(c/t[0],Math.min(c/t[1],n)));return[{dimensions:{x:0,y:0,width:c,height:r},sides:_t|Vt|$t},{dimensions:{x:c+s,y:0,width:c,height:r},sides:_t|zt|$t}]}(e):function(e){const{ratios:t,minWidth:a,maxWidth:s,spacing:n,maxHeight:c}=e,r=Math.round(1.5*a),o=Math.min(Math.round(Math.max(.4*(s-n),(s-n)/t[0]/(1/t[0]+1/t[1]))),s-n-r),i=s-o-n,l=Math.min(c,Math.round(Math.min(i/t[0],o/t[1])));return[{dimensions:{x:0,y:0,width:i,height:l},sides:_t|Vt|$t},{dimensions:{x:i+n,y:0,width:o,height:l},sides:_t|zt|$t}]}(e)}(b):3===o?function(e){const{proportions:t}=e;return"n"===t[0]?function(e){const{maxHeight:t,spacing:a,ratios:s,maxWidth:n,minWidth:c}=e,r=t,o=Math.round(Math.min((t-a)/2,s[1]*(n-a)/(s[2]+s[1]))),i=r-o-a,l=Math.max(c,Math.round(Math.min((n-a)/2,Math.min(o*s[2],i*s[1])))),d=Math.min(Math.round(r*s[0]),n-a-l);return[{dimensions:{x:0,y:0,width:d,height:r},sides:_t|Vt|$t},{dimensions:{x:d+a,y:0,width:l,height:i},sides:_t|zt},{dimensions:{x:d+a,y:i+a,width:l,height:o},sides:$t|zt}]}(e):function(e){const{maxWidth:t,ratios:a,maxHeight:s,spacing:n}=e,c=t,r=Math.round(Math.min(c/a[0],.66*(s-n))),o=(t-n)/2,i=Math.min(s-r-n,Math.round(Math.min(o/a[1],o/a[2])));return[{dimensions:{x:0,y:0,width:c,height:r},sides:Vt|_t|zt},{dimensions:{x:0,y:r+n,width:o,height:i},sides:$t|Vt},{dimensions:{x:o+n,y:r+n,width:c-o-n,height:i},sides:$t|zt}]}(e)}(b):function(e){const{proportions:t}=e;return"w"===t[0]?function({maxWidth:e,ratios:t,spacing:a,maxHeight:s,minWidth:n}){const c=e,r=Math.round(Math.min(c/t[0],.66*(s-a))),o=Math.round((e-2*a)/(t[1]+t[2]+t[3])),i=Math.max(n,Math.round(Math.min(.4*(e-2*a),o*t[1]))),l=Math.round(Math.max(Math.max(n,.33*(e-2*a)),o*t[3])),d=c-i-l-2*a,b=Math.min(s-r-a,o);return[{dimensions:{x:0,y:0,width:c,height:r},sides:Vt|_t|zt},{dimensions:{x:0,y:r+a,width:i,height:b},sides:$t|Vt},{dimensions:{x:i+a,y:r+a,width:d,height:b},sides:$t},{dimensions:{x:i+a+d+a,y:r+a,width:l,height:b},sides:zt|$t}]}(e):function({maxHeight:e,ratios:t,maxWidth:a,spacing:s,minWidth:n}){const c=e,r=Math.round(Math.min(c*t[0],.6*(a-s))),o=Math.round((e-2*s)/(1/t[1]+1/t[2]+1/t[3])),i=Math.round(o/t[1]),l=Math.round(o/t[2]),d=c-i-l-2*s,b=Math.max(n,Math.min(a-r-s,o));return[{dimensions:{x:0,y:0,width:r,height:c},sides:_t|Vt|$t},{dimensions:{x:r+s,y:0,width:b,height:i},sides:_t|zt},{dimensions:{x:r+s,y:i+s,width:b,height:l},sides:zt},{dimensions:{x:r+s,y:i+l+2*s,width:b,height:d},sides:$t|zt}]}(e)}(b),{layout:d,containerStyle:Qt(d)}}let Yt;function Xt(e){return Yt||(Yt=document.createElement("span"),Yt.style.font=m.e?'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',Yt.style.whiteSpace="nowrap",Yt.style.position="absolute",Yt.style.left="-999px",Yt.style.opacity=".01",document.body.appendChild(Yt)),Yt.innerHTML=e,Yt.offsetWidth}function Zt(e,t,a,s,n){Object(c.o)(()=>{if(a&&e.current){const t=e.current.closest(".MessageList");Object(Rt.a)(t,e.current,n?"end":"centerOrTop",20,void 0!==s?1e3:void 0,s)}},[e,t,a,s,n])}var ea=a(114),ta=a(68);var aa=Object(c.h)(e=>{const{isOpen:t}=e,a=Object(Re.a)(Pe.a.Extra,"ContextMenuContainer",!t);return a?c.a.createElement(a,e):void 0});var sa=Object(c.h)(Object(s.h)((e,{message:t})=>{const{byId:a}=e.users,s=t.senderId,{targetUserIds:n,targetChatId:c}=t.content.action||{},r=t.replyToMessageId,i=r?Object(o.l)(e,t.chatId,r):void 0,d=Object(o.U)(e,t),{direction:b,noHighlight:u}=d&&e.focusedMessage||{},m=Object(o.g)(e,t.chatId);return{usersById:a,sender:m&&(Object(l.mb)(m)||s===t.chatId)?m:s?Object(o.Jb)(e,s):void 0,targetChatId:c,targetUserIds:n,targetMessage:i,isFocused:d,...d&&{focusDirection:b,noFocusHighlight:u}}})(({message:e,observeIntersection:t,isEmbedded:a,appearanceOrder:s=0,isLastInList:n,usersById:r,sender:o,targetUserIds:i,targetMessage:l,targetChatId:d,isFocused:b,focusDirection:u,noFocusHighlight:m})=>{const h=Object(c.q)(null);Object(xt.c)(h,t),Object(ct.a)(e.chatId,e.replyToMessageId,l),Zt(h,e.chatId,b,u,m);const O=Object(he.a)(),j=s<=0,[g,p]=Object(me.a)(j);Object(c.n)(()=>{j||setTimeout(p,10*s)},[s,p,j]);const{transitionClassNames:f}=Object(re.a)(g,void 0,j,!1),I=Object(c.p)(()=>i?i.map(e=>r&&r[e]).filter(Boolean):void 0,[i,r]),v=Object(ta.a)(O,e,o,I,l,d,a?{isEmbedded:!0,asPlain:!0}:void 0),{isContextMenuOpen:y,contextMenuPosition:C,handleBeforeContextMenu:E,handleContextMenu:w,handleContextMenuClose:M,handleContextMenuHide:S}=Object(Dt.a)(h),k=void 0!==C;if(a)return c.a.createElement("span",{className:"embedded-action-message"},Object(mt.a)(v));const N=Object(ne.a)("ActionMessage message-list-item",b&&!m&&"focused",k&&"has-menu-open",n&&"last-in-list",f);return c.a.createElement("div",{ref:h,id:"message"+e.id,className:N,"data-message-id":e.id,onMouseDown:e=>{Tt(e),E(e)},onContextMenu:w},c.a.createElement("span",null,v),C&&c.a.createElement(aa,{isOpen:y,anchor:C,message:e,messageListType:"thread",onClose:M,onCloseAnimationEnd:S}))}));a(228);var na=({className:e,message:t,sender:a,title:s,customText:n,observeIntersection:r,onClick:o})=>{const i=Object(c.q)(null),d=Object(xt.b)(i,r),b=Object(ht.a)(t&&Object(l.E)(t,"pictogram"),!d),u=t&&"sticker-reply-thumb"+t.id,m=jt(t),h=Boolean(t&&Object(l.J)(t)),O=Object(he.a)(),j=a&&Object(l.X)(O,a);return c.a.createElement("div",{ref:i,className:Object(ne.a)("EmbeddedMessage",e),onClick:t?o:void 0},m&&function(e,t,a,s){const{width:n,height:r}=Object(ut.m)();return c.a.createElement("img",{id:e,src:a||t,width:n,height:r,alt:"",className:s?"round":""})}(u,m,b,h),c.a.createElement("div",{className:"message-text"},c.a.createElement("p",{dir:"auto"},t?Object(l.gb)(t)?c.a.createElement(sa,{message:t,isEmbedded:!0}):Object(mt.a)(Object(l.O)(O,t,Boolean(m))):n||" "),c.a.createElement("div",{className:"message-title",dir:"auto"},Object(mt.a)(j||s||" "))))},ca=a(166),ra=a(175),oa=a(181);a(232);var ia=Object(c.h)(({message:e,outgoingStatus:t,signature:a,onClick:s})=>{const n=Object(he.a)();return c.a.createElement("span",{className:"MessageMeta",dir:n.isRtl?"rtl":"ltr",onClick:s},Boolean(e.views)&&c.a.createElement(c.a.Fragment,null,c.a.createElement("span",{className:"message-views"},Object(ot.b)(e.views)),c.a.createElement("i",{className:"icon-channelviews"})),a&&c.a.createElement("span",{className:"message-signature"},Object(mt.a)(a)),c.a.createElement("span",{className:"message-time"},e.isEdited&&n("EditedMessage")+" ",Object(x.h)(1e3*e.date)),t&&c.a.createElement(oa.a,{status:t}))}),la=a(117),da=a(119),ba=a(167);a(233);var ua=({message:e,observeIntersection:t,observeIntersectionForPlaying:a,shouldLoop:s,lastSyncTime:r})=>{const o=Object(c.q)(null),[i,d,b]=Object(me.a)(),u=e.content.sticker,{isAnimated:m,stickerSetId:h}=u,O=h===n.db,j=Object(xt.b)(o,t),g=Object(xt.b)(o,a),p=u.isPreloadedGlobally?"sticker"+u.id:Object(l.E)(e,"inline"),f=jt(e),I=Object(ht.a)(p,!j,Object(l.D)(e,"inline",!0),r),v=Boolean(I),[y,C]=Object(me.a)(v),E=m?y:v,{shouldRenderFullMedia:w,transitionClassNames:M}=Object(la.a)(E,"slow"),{width:S,height:k}=Object(ut.n)(u),N=Object(ne.a)("thumbnail",!f&&"empty"),T=Object(ne.a)("Sticker media-inner",O&&"inactive");return c.a.createElement("div",{ref:o,className:T,onClick:O?void 0:d},!E&&c.a.createElement("img",{id:"sticker-thumb-"+e.id,src:f,width:S,height:k,alt:"",className:N}),!m&&w&&c.a.createElement("img",{id:"sticker-"+e.id,src:I,width:S,height:k,alt:"",className:Object(ne.a)("full-media",M)}),m&&v&&c.a.createElement(da.a,{key:p,className:Object(ne.a)("full-media",M),id:p,animationData:I,size:S,play:g,noLoop:!s,onLoad:C}),c.a.createElement(ba.a,{isOpen:i,fromSticker:u,onClose:b}))},ma=a(129),ha=a(123),Oa=a(168);function ja(e,t){return Object(Oa.a)(Object(l.F)(e),Boolean(t),m.l&&!m.c)}var ga=a(29);const pa=Promise.resolve("rgba(255,255,255,1)");function fa(e,t,a,s){return s?pa:async function(e,t){const a=new Image;a.src=e,a.width||await new Promise(e=>{a.onload=e});const s=document.createElement("canvas"),n=s.getContext("2d");s.width=a.width,s.height=a.height,n.drawImage(a,0,0,a.width,a.height);const c=t?a.width-1:0,r=a.height-1;return`rgba(${Array.from(n.getImageData(c,r,1,1).data).join(",")})`}(e,t)}var Ia=a(124);var va=({id:e,message:t,observeIntersection:a,noAvatars:s,shouldAutoLoad:n,isInSelectMode:r,isSelected:o,uploadProgress:i,size:d="inline",dimensions:b,nonInteractive:u,shouldAffectAppendix:m,onClick:h,onCancelUpload:O})=>{const j=Object(c.q)(null),g=(Object(l.H)(t)||Object(l.S)(t)).blobUrl,p=Object(xt.b)(j,a),[f,I]=Object(c.r)(n),v=f&&p,{mediaData:y,downloadProgress:C}=Object(ha.a)(Object(l.E)(t,d),!v),E=g||y,w=ja(t,E),{isUploading:M,isTransferring:S,transferProgress:k}=Object(l.r)(t,i||C,v&&!E),N=!1===Object(ga.a)(f),{shouldRender:T,transitionClassNames:A}=Object(re.a)(S,void 0,N,"slow"),{shouldRenderThumb:P,shouldRenderFullMedia:R,transitionClassNames:x}=Object(la.a)(E,"slow"),L=Object(c.m)(()=>{M?O&&O(t):E?h&&h(t.id):I(e=>!e)},[E,M,t,O,h]),B=Object(l.yb)(t);Object(c.o)(()=>{if(!m)return;const e=j.current.closest(".message-content");E?fa(E,B,0,o).then(t=>{e.style.setProperty("--appendix-bg",t),e.setAttribute("data-has-custom-appendix","")}):e.classList.add("has-appendix-thumb")},[E,B,m,r,o]);const{width:D,height:F,isSmall:U}=b||qt(t,s),H=Object(ne.a)("media-inner",!M&&!u&&"interactive",U&&"small-image",D===F&&"square-image"),q=b?`width: ${D}px; height: ${F}px; left: ${b.x}px; top: ${b.y}px;`:"";return c.a.createElement("div",{id:e,ref:j,className:H,style:q,onClick:M?void 0:L},P&&c.a.createElement("canvas",{ref:w,className:"thumbnail",style:`width: ${D}px; height: ${F}px`}),R&&c.a.createElement("img",{src:E,className:"full-media "+x,width:D,height:F,alt:""}),T&&c.a.createElement("div",{className:"media-loading "+A},c.a.createElement(Ia.a,{progress:k,onClick:M?L:void 0})),!E&&!f&&c.a.createElement("i",{className:"icon-download"}),S&&c.a.createElement("span",{className:"message-upload-progress"},Math.round(100*k),"%"))},ya=a(141),Ca=a(140);function Ea(e,t){const a=Object(c.q)();a.current=t;const s=Object(c.m)(()=>{e.current&&e.current.pause()},[e]),n=Object(c.m)(()=>{e.current&&a.current&&Object(Ca.a)(e.current)},[e]);Object(se.c)(s,n)}var wa=a(152),Ma=(e,t=!1)=>{const a=Object(c.q)(!1),s=Object(c.q)(!1),n=Object(c.m)(()=>{s.current=!0,t&&e.current&&(a.current||(a.current=!e.current.paused),e.current.pause())},[t,e]),r=Object(c.m)(()=>{t&&e.current&&a.current&&document.body.contains(e.current)&&Object(Ca.a)(e.current),a.current=!1,s.current=!1},[t,e]),o=Object(c.m)(()=>{Object(f.b)(r)},[r]);document.hasFocus()||n(),Object(oe.a)(n,o)};function Sa(){return(Sa=Object.assign||function(e){for(var t=1;t{const m=Object(c.q)(null),h=Object(c.q)(null),O=Object(l.Q)(t)||Object(l.T)(t),j=O.blobUrl,g=Object(xt.b)(m,a),[p,f]=Object(c.r)(n),I=Boolean(p&&g&&i),[v,y]=Object(c.r)(r),C=Object(ht.a)(Object(l.E)(t,"pictogram"),!(g&&i),Object(l.D)(t,"pictogram"),i),{mediaData:E,downloadProgress:w}=Object(ha.a)(Object(l.E)(t,"inline"),!I,Object(l.D)(t,"inline"),i),M=j||E,S=Boolean(g&&M),k=ja(t,C),{isBuffered:N,bufferingHandlers:T}=Object(ya.a)(!n),{isUploading:A,isTransferring:P,transferProgress:R}=Object(l.r)(t,o||w,I&&!N),L=!1===Object(ga.a)(p),{shouldRender:B,transitionClassNames:D}=Object(re.a)(P,void 0,L),{transitionClassNames:F}=Object(la.a)(M,"slow"),[U,H]=Object(c.r)(0),q=Object(c.m)(e=>{H(Math.max(0,e.currentTarget.currentTime-1))},[]),G=h.current&&h.current.duration||O.duration||0,_=Object(l.yb)(t),z=Object(l.tb)(t),{width:$,height:V}=d||Object(ut.i)(O,_,z,s);Ea(h,Boolean(S&&r)),Ma(h,v),Object(wa.a)(h,[S]);const W=Object(c.m)(()=>{A?u&&u(t):M?M&&!v?(y(!0),h.current.play()):b&&b(t.id):f(e=>!e)},[A,M,v,b,u,t]),K=Object(ne.a)("media-inner dark",!A&&"interactive"),Q=Object(ne.a)("full-media",F),J=d?`width: ${$}px; height: ${V}px; left: ${d.x}px; top: ${d.y}px;`:"";return c.a.createElement("div",{ref:m,id:e,className:K,style:J,onClick:A?void 0:W},!C&&c.a.createElement("canvas",{ref:k,className:"thumbnail",style:`width: ${$}px; height: ${V}px;`}),C&&c.a.createElement("img",{src:C,className:"thumbnail",style:`width: ${$}px; height: ${V}px;`,alt:""}),S&&c.a.createElement("video",Sa({ref:h,className:Q,width:$,height:V,autoPlay:v,muted:!0,loop:!0,playsInline:!0},T,{onTimeUpdate:q}),c.a.createElement("source",{src:M})),p&&!v&&!B&&c.a.createElement("i",{className:"icon-large-play"}),B&&c.a.createElement("div",{className:"media-loading "+D},c.a.createElement(Ia.a,{progress:R,onClick:A?W:void 0})),!p&&c.a.createElement("i",{className:"icon-download"}),P?c.a.createElement("span",{className:"message-upload-progress"},"..."):c.a.createElement("div",{className:"message-media-duration"},O.isGif?"GIF":Object(x.e)(Math.max(G-U,0))))},Na=a(23);a(234);var Ta=Object(s.h)((e,{contact:t})=>({user:Object(o.Jb)(e,t.userId)}),(e,t)=>Object(h.l)(t,["openUserInfo"]))(({contact:e,user:t,openUserInfo:a})=>{const{firstName:s,lastName:n,phoneNumber:r,userId:o}=e,i=Object(c.m)(()=>{a({id:o})},[a,o]);return c.a.createElement("div",{className:Object(ne.a)("Contact",Boolean(o)&&"interactive"),onClick:o?i:void 0},c.a.createElement(ea.a,{size:"large",user:t,text:s||n}),c.a.createElement("div",{className:"contact-info"},c.a.createElement("div",{className:"contact-name"},s," ",n),c.a.createElement("div",{className:"contact-phone"},Object(Na.c)(r))))}),Aa=a(48);var Pa=Object(c.h)(({id:e,options:t,selected:a=[],disabled:s,round:n,loadingOptions:r,onChange:o})=>{const[i,l]=Object(c.r)([]),d=Object(c.m)(e=>{const{value:t,checked:a}=e.currentTarget;let s;s=a?[...i,t]:i.filter(e=>e!==t),l(s),o(s)},[o,i]);return c.a.createElement("div",{id:e,className:"radio-group"},t.map(e=>c.a.createElement(Aa.a,{label:e.label,subLabel:e.subLabel,value:e.value,checked:-1!==a.indexOf(e.value),disabled:s,round:n,isLoading:r?-1!==r.indexOf(e.value):void 0,onChange:d})))}),Ra=a(126),xa=a(189);a(237);function La(e,t){return t>0?(e/t*100).toFixed():0}var Ba=({answer:e,voteResults:t,totalVoters:a,maxVotersCount:s,correctResults:n,shouldAnimate:r})=>{const o=t&&t.find(t=>t.option===e.option),i=0===n.length||-1!==n.indexOf(e.option),l=n.length>0&&i||o&&o.isChosen,d=o?La(o.votersCount,a||0):0,[b,u]=Object(c.r)(r?0:d),m=Object(c.q)(null),h=o?La(o.votersCount,s||0):0,O=b{r&&u(d)},[r,d]),Object(c.n)(()=>{const e=m.current;if(e&&r){const t=e.firstElementChild,a=O?"":"stroke-dasharray: 100% 200%; stroke-dashoffset: -44";t?t.setAttribute("style",a):e.innerHTML=`\n \n \n `}},[O,r]),!t||!o)return;const j=`width: ${h}%; transform:scaleX(${O?0:1})`;return c.a.createElement("div",{className:"PollOption",dir:"ltr"},c.a.createElement("div",{className:"poll-option-share "+("100"===d?"limit-width":"")},d,"%",l&&c.a.createElement("span",{className:Object(ne.a)("poll-option-chosen",!i&&"wrong",r&&"animate")},c.a.createElement("i",{className:i?"icon-check":"icon-close"}))),c.a.createElement("div",{className:"poll-option-right"},c.a.createElement("div",{className:"poll-option-text",dir:"auto"},Object(mt.a)(e.text)),c.a.createElement("div",{className:Object(ne.a)("poll-option-answer",l&&!i&&"wrong")},c.a.createElement("div",{className:"poll-option-corner",ref:m}),c.a.createElement("div",{className:"poll-option-line",style:j}))))};a(238);var Da=Object(c.h)(Object(s.h)((e,{poll:t})=>{const{recentVoterIds:a}=t.results,{serverTimeOffset:s,users:{byId:n}}=e;return a&&0!==a.length?{recentVoterIds:a,usersById:n,serverTimeOffset:s}:{}},(e,t)=>Object(h.l)(t,["loadMessage","openPollResults"]))(({message:e,poll:t,recentVoterIds:a,usersById:s,loadMessage:n,onSendVote:r,openPollResults:o,serverTimeOffset:i})=>{const{id:l,chatId:d}=e,{summary:b,results:u}=t,[m,h]=Object(c.r)(!1),[O,j]=Object(c.r)([]),[g,p]=Object(c.r)(!1),[f,I]=Object(c.r)(!1),[v,y]=Object(c.r)(!b.closed&&b.closeDate&&b.closeDate>0?Math.min(b.closeDate-Math.floor(Date.now()/1e3)+i,b.closePeriod):0),C=Object(c.q)(null),{results:E,totalVoters:w}=u,M=E&&E.some(e=>e.isChosen),S=!b.closed&&!M,k=!S&&b.isPublic&&Number(u.totalVoters)>0,N=S&&b.multipleChoice,T=E?Math.max(...E.map(e=>e.votersCount)):w,A=E?E.reduce((e,t)=>(t.isCorrect&&e.push(t.option),e),[]):[],P=b.answers.map(e=>({label:e.text,value:e.option,hidden:Boolean(b.quiz&&b.closePeriod&&v<=0)}));Object(c.n)(()=>{m&&t.results.results&&t.results.results.some(e=>e.isChosen)&&h(!1)},[m,t.results.results]),Object(c.n)(()=>{v>0&&setTimeout(()=>y(v-1),1e3);const e=C.current;if(e){const t=12*Math.PI,a=e.lastElementChild,s=e.firstElementChild;if(v<=5&&e.classList.add("hurry-up"),a&&s){const e=(b.closePeriod-v)/b.closePeriod*t;s.textContent=Object(x.e)(v),a.firstElementChild.setAttribute("stroke-dashoffset","-"+e)}else e.innerHTML=`\n ${Object(x.e)(v)}\n \n \n `}},[v,b.closePeriod]),Object(c.n)(()=>{b.quiz&&(v<=0||M&&!b.closed)&&n({chatId:d,messageId:l})},[d,v,M,n,l,b.closed,b.quiz]),Object(c.n)(()=>{let e;return b.quiz&&!b.closed&&b.closePeriod&&b.closePeriod>0&&(e=window.setTimeout(()=>{n({chatId:d,messageId:l})},1e3*b.closePeriod)),()=>{e&&window.clearTimeout(e)}},[S,d,n,l,b.closePeriod,b.closed,b.quiz]);const R=Object(c.p)(()=>a?a.reduce((e,t)=>{const a=s[t];return a&&e.push(a),e},[]):[],[s,a]),L=Object(c.m)(e=>{j([e]),h(!0),I(!0),r([e])},[r]),B=Object(c.m)(e=>{j(e)},[]),D=Object(c.m)(()=>{h(!0),I(!0),r(O)},[r,O]),F=Object(c.m)(()=>{o({chatId:d,messageId:l})},[d,l,o]),U=Object(c.m)(()=>{p(!0)},[]),H=Object(c.m)(()=>{p(!1),I(!1)},[]);Object(c.n)(()=>{if(f&&M&&b.quiz&&u.results&&t.results.solution){u.results.find(e=>e.isChosen&&e.isCorrect)||p(!0)}},[M,f,u.results,b.quiz,t.results.solution]);const q=Object(he.a)();return c.a.createElement("div",{className:"Poll",dir:q.isRtl?"auto":"ltr"},g&&t.results.solution&&c.a.createElement(xa.a,{message:Object(Ft.b)(t.results.solution,t.results.solutionEntities),duration:5e3,onDismiss:H,containerId:"#middle-column-portals"}),c.a.createElement("div",{className:"poll-question"},Object(mt.a)(b.question)),c.a.createElement("div",{className:"poll-type"},q(function(e){if(void 0===e.isPublic)return" ";if(e.quiz)return e.isPublic?"QuizPoll":"AnonymousQuizPoll";if(e.closed)return"FinalResults";return e.isPublic?"PublicPoll":"AnonymousPoll"}(b)),R.length>0&&c.a.createElement("div",{className:"poll-recent-voters"},R.map(e=>c.a.createElement(ea.a,{size:"micro",user:e}))),v>0&&S&&c.a.createElement("div",{ref:C,className:"poll-countdown"}),b.quiz&&t.results.solution&&!S&&c.a.createElement(fe.a,{round:!0,size:"tiny",color:"translucent",className:"poll-quiz-help",disabled:g,onClick:U,ariaLabel:"Show Solution"},c.a.createElement("i",{className:"icon-lamp"}))),S&&c.a.createElement("div",{className:"poll-answers"},N?c.a.createElement(Pa,{options:P,onChange:B,disabled:e.isScheduled||m,loadingOptions:m?O:void 0,round:!0}):c.a.createElement(Ra.a,{name:"poll-"+l,options:P,onChange:L,disabled:e.isScheduled||m,loadingOption:m?O[0]:void 0})),!S&&c.a.createElement("div",{className:"poll-results"},b.answers.map((function(e){return c.a.createElement(Ba,{key:e.option,shouldAnimate:f,answer:e,voteResults:E,totalVoters:w,maxVotersCount:T,correctResults:A})}))),!k&&!N&&c.a.createElement("div",{className:"poll-voters-count"},function(e,t,a){if(!a)return e(t?"Chat.Quiz.TotalVotesEmpty":"Chat.Poll.TotalVotesResultEmpty");return e(t?"Answer":"Vote",a,"i")}(q,b.quiz,u.totalVoters)),N&&c.a.createElement(fe.a,{isText:!0,disabled:0===O.length,size:"tiny",onClick:D},q("PollSubmitVotes")),k&&c.a.createElement(fe.a,{isText:!0,size:"tiny",onClick:F},q("PollViewResults")))})),Fa=a(41),Ua=a(59);a(239);var Ha=Object(c.h)(({message:e,observeIntersection:t,noAvatars:a,shouldAutoLoad:s,shouldAutoPlay:n,inPreview:r,lastSyncTime:o,onMediaClick:i,onCancelMediaTransfer:d})=>{const b=Object(l.R)(e);let u=!1;if(b&&b.photo&&!b.video){const{width:t,height:a}=qt(e);u=t===a}const m=Object(c.m)(()=>{i()},[i]);if(!b)return;const{siteName:h,url:O,displayUrl:j,title:g,description:p,photo:f,video:I}=b,v=(f||I)&&i&&!u,y=Object(Fa.a)(p,170),C=Object(ne.a)("WebPage",u&&"with-square-photo",!f&&!I&&!r&&"without-media",I&&"with-video");return c.a.createElement("div",{className:C,"data-initial":(h||j)[0],dir:"auto"},f&&!I&&c.a.createElement(va,{message:e,observeIntersection:t,noAvatars:a,shouldAutoLoad:s,size:u?"pictogram":"inline",nonInteractive:!v,onClick:v?m:void 0,onCancelUpload:d}),c.a.createElement("div",{className:"WebPage-text"},c.a.createElement(Ua.a,{className:"site-name",url:O,text:h||j}),!r&&g&&c.a.createElement("p",{className:"site-title"},Object(mt.a)(g)),y&&c.a.createElement("p",{className:"site-description"},Object(mt.a)(y,["emoji","br"]))),!r&&I&&c.a.createElement(ka,{message:e,observeIntersection:t,noAvatars:a,shouldAutoLoad:s,shouldAutoPlay:n,lastSyncTime:o,onClick:v?m:void 0,onCancelUpload:d}))});a(240);var qa=Object(c.h)(({message:e})=>{const t=Object(l.B)(e),{title:a,text:s,description:n,photoUrl:r}=t;return c.a.createElement("div",{className:"Invoice"},a&&c.a.createElement("p",{className:"title"},Object(mt.a)(a)),s&&c.a.createElement("p",null,Object(mt.a)(s,["emoji","br"])),c.a.createElement("div",{className:"description "+(r?"has-image":"")},r&&c.a.createElement("img",{className:"invoice-image",src:r,alt:""}),n&&c.a.createElement("p",{className:"description-text"},Object(mt.a)(n,["emoji","br"]))))});function Ga(e){return Object(c.h)(Object(s.h)((e,t)=>{const{message:a}=t;return{isInSelectMode:Object(o.S)(e),isSelected:Object(o.V)(e,a.id)}},(e,t)=>Object(h.l)(t,["toggleMessageSelection"]))(t=>{const{isInSelectMode:a,isSelected:s,message:n,toggleMessageSelection:r,dimensions:o}=t,i=Object(c.m)(e=>{e.stopPropagation(),r({messageId:n.id,withShift:e&&e.shiftKey})},[r,n]),l=Object(c.p)(()=>({...t,isInSelectMode:a,isSelected:s,dimensions:{...t.dimensions,x:0,y:0},onClick:a?void 0:t.onClick}),[t,a,s]);return c.a.createElement("div",{className:Object(ne.a)("album-item-select-wrapper",s&&"is-selected"),style:o?`left: ${o.x}px; top: ${o.y}px;`:"",onClick:a?i:void 0},a&&c.a.createElement("div",{className:"message-select-control"},s&&c.a.createElement("i",{className:"icon-select"})),c.a.createElement(e,l))}))}a(241);const _a=Ga(va),za=Ga(ka);var $a=Object(s.h)(e=>({uploadsById:e.fileUploads.byMessageLocalId}),(e,t)=>Object(h.l)(t,["cancelSendingMessage"]))(({album:e,observeIntersection:t,shouldAutoLoad:a,shouldAutoPlay:s,hasCustomAppendix:n,lastSyncTime:r,isOwn:o,albumLayout:i,onMediaClick:d,uploadsById:b,cancelSendingMessage:u})=>{const m=e.messages.length,h=Object(c.m)(e=>{u({chatId:e.chatId,messageId:e.id})},[u]);const{width:O,height:j}=i.containerStyle;return c.a.createElement("div",{className:"Album",style:`width: ${O}px; height: ${j}px;`},e.messages.map((function(e,u){const{photo:O,video:j}=Object(l.v)(e),g=b[e.previousLocalId||e.id],p=g?g.progress:void 0,{dimensions:f,sides:I}=i.layout[u];if(O){const s=n&&(o?u===m-1:Boolean(I&Vt&&I&$t));return c.a.createElement(_a,{id:"album-media-"+e.id,message:e,observeIntersection:t,shouldAutoLoad:a,shouldAffectAppendix:s,uploadProgress:p,dimensions:f,onClick:d,onCancelUpload:h})}if(j)return c.a.createElement(za,{id:"album-media-"+e.id,message:e,observeIntersection:t,shouldAutoLoad:a,shouldAutoPlay:s,uploadProgress:p,lastSyncTime:r,dimensions:f,onClick:d,onCancelUpload:h})})))});a(242);function Va(){return(Va=Object.assign||function(e){for(var t=1;t{const r=Object(c.q)(null),o=Object(c.q)(null),i=Object(c.q)(null),d=e.content.video,b=Object(xt.b)(r,t),[u,m]=Object(c.r)(a&&s),h=Boolean(u&&b&&n),{mediaData:O,downloadProgress:j}=Object(ha.a)(Object(l.E)(e,"inline"),!h,Object(l.D)(e,"inline"),n),g=ja(e,O),{isBuffered:p,bufferingHandlers:I}=Object(ya.a)(),v=u&&!p,y=!1===Object(ga.a)(u),{shouldRender:C,transitionClassNames:E}=Object(re.a)(v||!p,void 0,y),{shouldRenderThumb:w,transitionClassNames:M}=Object(la.a)(O,"slow"),[S,k]=Object(c.r)(!1),[N,T]=Object(c.r)(0);Object(c.n)(()=>{if(!S)return;const e=188*Math.PI,t=e-N*e,a=i.current,s=o.current,n=s.firstElementChild;n?n.firstElementChild.setAttribute("stroke-dashoffset",t.toString()):s.innerHTML=`\n \n `,T(a.currentTime/a.duration)},[S,N]);const A=Boolean(O&&b),P=()=>{k(!1),T(0),Object(Ca.a)(i.current),Object(f.b)(()=>{o.current.innerHTML=""})},R=(L=P,()=>{Wa&&Wa(),Wa=L});var L;Object(c.n)(()=>{i.current&&(A?Object(Ca.a)(i.current):i.current.pause())},[A]),Ea(i,A),Ma(i,Boolean(O)),Object(wa.a)(i,[O]);const B=Object(c.m)(()=>{if(!O)return void m(e=>!e);const e=i.current;S?e.paused?Object(Ca.a)(e):e.pause():(R(),e.pause(),e.currentTime=0,Object(Ca.a)(e),k(!0))},[R,S,O]),D=Object(c.m)(e=>{const t=e.currentTarget;T(t.currentTime/t.duration)},[]),F=Object(ne.a)("full-media",M);return c.a.createElement("div",{ref:r,className:"RoundVideo media-inner",onClick:B},(w||O)&&c.a.createElement("div",{className:"thumbnail-wrapper"},c.a.createElement("canvas",{ref:g,className:"thumbnail",style:`width: ${ut.e}px; height: ${ut.e}px`})),O&&c.a.createElement("div",{className:"video-wrapper"},c.a.createElement("video",Va({ref:i,className:F,width:ut.e,height:ut.e,autoPlay:!0,muted:!S,loop:!S,playsInline:!0,onEnded:S?P:void 0},I,{onTimeUpdate:S?D:void 0}),c.a.createElement("source",{src:O}))),c.a.createElement("div",{className:"progress",ref:o}),C&&c.a.createElement("div",{className:"media-loading "+E},c.a.createElement(Ia.a,{progress:j})),!O&&!u&&c.a.createElement("i",{className:"icon-large-play"}),c.a.createElement("div",{className:"message-media-duration"},S?Object(x.e)(i.current.currentTime):Object(x.e)(d.duration),(!S||i.current.paused)&&c.a.createElement("i",{className:"icon-muted-chat"})))};a(243);var Qa=({message:e,onClick:t})=>c.a.createElement("div",{className:"InlineButtons"},e.inlineButtons.map(e=>c.a.createElement("div",{className:"row"},e.map(e=>c.a.createElement(fe.a,{size:"tiny",ripple:!0,disabled:"NOT_SUPPORTED"===e.type,onClick:()=>t({button:e})},Object(mt.a)(e.text),"url"===e.type&&!e.value.match(n.ub)&&c.a.createElement("i",{className:"icon-arrow-right"}))))));a(244);var Ja=Object(c.h)(Object(s.h)((e,{message:t})=>{const{threadId:a,chatId:s}=t.threadInfo,n=Object(o.Fb)(e,s,a)||t.threadInfo,c=Object(o.Gb)(e,s,a),{byId:r}=e.users,{byId:i}=e.chats;return{threadInfo:n,usersById:r,chatsById:i,shouldRequestThreadUpdate:!!c&&!n.topMessageId}},(e,t)=>Object(h.l)(t,["openChat","requestThreadInfoUpdate"]))(({disabled:e,threadInfo:t,usersById:a,chatsById:s,shouldRequestThreadUpdate:n,openChat:r,requestThreadInfoUpdate:o})=>{const i=Object(he.a)(),{threadId:d,chatId:b,messagesCount:u,lastMessageId:m,lastReadInboxMessageId:h,recentReplierIds:O}=t,j=Object(c.m)(()=>{r({id:b,threadId:d})},[r,b,d]);if(Object(c.n)(()=>{n&&o({chatId:b,threadId:d})},[b,o,n,d]),void 0===u)return;const g=O&&O.map(e=>Object(l.ob)(e)?a[e]:s[e]).filter(Boolean);const p=Boolean(h&&m&&h0&&c.a.createElement("div",{className:"recent-repliers",dir:i.isRtl?"rtl":"ltr"},g.map(e=>c.a.createElement(ea.a,{key:e.id,size:"small",user:Object(l.ob)(e.id)?e:void 0,chat:Object(l.ob)(e.id)?void 0:e}))),c.a.createElement("div",{className:"label",dir:"auto"},u?i("Comments",u,"i"):i("LeaveAComment")),c.a.createElement("i",{className:"icon-next"}))}));a(245);function Ya(e){const t=Za(e.currentTarget);t&&t.setAttribute("data-is-document-group-hover","")}function Xa(e){const t=Za(e.currentTarget);t&&t.removeAttribute("data-is-document-group-hover")}function Za(e){let t=e;do{t=t.nextElementSibling}while(t&&!t.classList.contains("last-in-document-group"));return t}var es=Object(c.h)(Object(s.h)((e,t)=>{const{focusedMessage:a,forwardMessages:s,lastSyncTime:n}=e,{message:c,album:r,withSenderName:i,withAvatar:d,threadId:b,messageListType:u}=t,{id:m,chatId:h,viaBotId:O,replyToMessageId:j,isOutgoing:g}=c,p=Object(o.g)(e,h),f=Object(o.P)(e,h),I=p&&Object(l.mb)(p),v=p&&p.username,y=!f&&Object(l.hb)(c),C=i||d||y?Object(o.vb)(e,c):void 0,E=Object(o.K)(e,c),w=O?Object(o.Jb)(e,O):void 0,M=b?Object(o.Hb)(e,h,b):void 0,S=c.id===M,k=j===M,N=j&&!k?Object(o.l)(e,h,j):void 0,T=N&&Object(o.vb)(e,N),A=Object(o.Ib)(e,c),P="thread"===u&&(r?r.messages.some(t=>Object(o.U)(e,t)):Object(o.U)(e,c)),{direction:R,noHighlight:x}=P&&a||{},L=s.messageIds&&s.messageIds.includes(m),{query:B}=Object(o.B)(e)||{},D=Object(l.M)(c);let F;return F=r&&r.messages?r.messages.every(({id:t})=>Object(o.V)(e,t)):Object(o.V)(e,m),{theme:Object(o.Db)(e),chatUsername:v,forceSenderName:y,sender:C,originSender:E,botSender:w,shouldHideReply:k,isThreadTop:S,replyMessage:N,replyMessageSender:T,isFocused:P,isForwarding:L,isChatWithSelf:f,isChannel:I,lastSyncTime:n,highlight:B,isSingleEmoji:Boolean(D),animatedEmoji:D?Object(o.c)(e,D):void 0,isInSelectMode:Object(o.S)(e),isSelected:F,isGroupSelected:!!c.groupedId&&!c.isInAlbum&&Object(o.Q)(e,h,c.groupedId),threadId:b,isPinnedList:"pinned"===u,shouldAutoLoadMedia:p?Object(o.wb)(e,c,p,C):void 0,shouldAutoPlayMedia:Object(o.xb)(e,c),shouldLoopStickers:Object(o.yb)(e),...g&&{outgoingStatus:Object(o.gb)(e,c,"scheduled"===u)},..."number"==typeof A&&{uploadProgress:A},...P&&{focusDirection:R,noFocusHighlight:x}}},(e,t)=>Object(h.l)(t,["focusMessage","openMediaViewer","openAudioPlayer","cancelSendingMessage","openUserInfo","openChat","markMessagesRead","sendPollVote","toggleMessageSelection","setReplyingToId","openForwardMenu","clickInlineButton","disableContextMenuHint","showNotification"]))(({message:e,chatUsername:t,observeIntersectionForBottom:a,observeIntersectionForMedia:s,observeIntersectionForAnimatedStickers:n,album:r,noAvatars:o,withAvatar:i,withSenderName:d,noComments:h,appearanceOrder:O,isFirstInGroup:j,isLastInGroup:g,isFirstInDocumentGroup:p,isLastInDocumentGroup:f,isLastInList:I,theme:v,forceSenderName:y,sender:C,originSender:E,botSender:w,isThreadTop:M,shouldHideReply:S,replyMessage:k,replyMessageSender:N,outgoingStatus:T,uploadProgress:A,isFocused:P,focusDirection:R,noFocusHighlight:x,isForwarding:L,isChatWithSelf:B,isChannel:D,lastSyncTime:F,highlight:U,animatedEmoji:H,isInSelectMode:q,isSelected:G,isGroupSelected:_,threadId:z,messageListType:$,isPinnedList:V,shouldAutoLoadMedia:W,shouldAutoPlayMedia:K,shouldLoopStickers:Q,focusMessage:J,openMediaViewer:Y,openAudioPlayer:X,openUserInfo:Z,openChat:ee,cancelSendingMessage:te,markMessagesRead:ae,sendPollVote:se,toggleMessageSelection:ce,setReplyingToId:oe,openForwardMenu:ie,clickInlineButton:le,disableContextMenuHint:de,showNotification:be})=>{const ue=Object(c.q)(null),Oe=Object(c.q)(null),je=Object(c.q)(null),ge=Object(he.a)();Object(xt.c)(Oe,a);const{isContextMenuOpen:pe,contextMenuPosition:Ie,handleBeforeContextMenu:ve,handleContextMenu:ye,handleContextMenuClose:Ce,handleContextMenuHide:Ee}=Object(Dt.a)(ue,m.n&&q,!0,m.b);Object(c.n)(()=>{pe&&de()},[pe,de]);const we=O<=0,[Me,Se]=Object(me.a)(we);Object(c.n)(()=>{we||setTimeout(Se,10*O)},[O,Se,we]);const{transitionClassNames:ke}=Object(re.a)(Me,void 0,we,!1),{chatId:Ne,id:Te,threadInfo:Ae}=e,Pe=Object(l.xb)(e),Re=Object(l.yb)(e),xe="scheduled"===$||e.isScheduled,Le=Object(l.zb)(e)&&!S,Be=Boolean(Ae)&&"thread"===$,{forwardInfo:De,viaBotId:Fe}=e,Ue=De&&!B&&!De.isLinkedChannelPost,He=!!e.groupedId&&!e.isInAlbum,qe=Boolean(r)&&r.messages.length>1,{text:Ge,photo:_e,video:ze,audio:$e,voice:Ve,document:We,sticker:Ke,contact:Qe,poll:Je,webPage:Ye,invoice:Xe}=Object(l.v)(e),et=Object(l.x)(e),tt=Object(Ft.a)(e,U,Ut(et)),at=void 0!==Ie,st=D&&e.adminTitle||De&&!Ue&&De.adminTitle||void 0,nt=Object(c.p)(()=>st?Xt(st):void 0,[st]),rt=!(at||q||L)&&(!He||f),ot=D&&!xe,it=Boolean(V||De&&(De.isChannelPost||B&&!Re)&&De.fromMessageId),lt=!De||!B&&C?C:E,dt=De?E:C,bt=Object(ne.a)("Message message-list-item",j&&"first-in-group",g&&"last-in-group",p&&"first-in-document-group",f&&"last-in-document-group",I&&"last-in-list",Re&&"own",Boolean(e.views)&&"has-views",e.isEdited&&"was-edited",Le&&"has-reply",at&&"has-menu-open",P&&!x&&"focused",L&&"is-forwarding",e.isDeleting&&"is-deleting",He&&"is-in-document-group",qe&&"is-album",e.hasUnreadMention&&"has-unread-mention",G&&"is-selected",q&&"is-in-selection-mode",M&&"is-thread-top",Boolean(e.inlineButtons)&&"has-inline-buttons",ke),ht=function(e,{hasReply:t,customShape:a,isLastInGroup:s,asForwarded:n,hasThread:c,forceSenderName:r,hasComments:o,hasActionButton:i}={}){const{text:d,photo:b,video:u,audio:m,voice:h,document:O,poll:j,webPage:g,contact:p}=Object(l.v)(e),f=["message-content"],I=b||u,v=I&&!d,y=Boolean(e.viaBotId);return Ut(a)?f.push("emoji-only emoji-only-"+a):d&&f.push("text"),i&&f.push("has-action-button"),a&&(f.push("custom-shape"),u&&u.isRound&&f.push("round"),o&&f.push("has-comments")),b||u?f.push("media"):m?f.push("audio"):h?f.push("voice"):O?f.push("document"):p?f.push("contact"):j?f.push("poll"):g&&(f.push("web-page"),(g.photo||g.video)&&f.push("media")),n&&!a&&f.push("is-forwarded"),t&&f.push("is-reply"),c&&f.push("has-replies"),y&&f.push("is-via-bot"),r&&f.push("force-sender-name"),a||(f.push("has-shadow"),I&&o&&f.push("has-background"),(t||n||!v||y||r)&&f.push("has-solid-background"),!s||!b&&v||f.push("has-appendix")),f.join(" ")}(e,{hasReply:Le,customShape:et,isLastInGroup:g,asForwarded:Ue,hasThread:Be,forceSenderName:y,hasComments:e.threadInfo&&e.threadInfo.messagesCount>0,hasActionButton:ot||it}),Ot=e.threadInfo&&(!He||f)&&"thread"===$&&!h,jt=ht.includes("has-appendix");Object(ct.a)(Ne,Le?e.replyToMessageId:void 0,k,e.id),Zt(ue,Ne,P,R,x),Object(c.o)(()=>{je.current&&(je.current.innerHTML=Re?'':'')},[Re,jt]);const gt=Object(c.m)(t=>{t.stopPropagation(),ce({messageId:Te,groupedId:e.groupedId})},[Te,e.groupedId,ce]),pt=Object(c.m)(e=>{if(Pe)return;const t=qe&&r&&r.messages?{messageId:Te,childMessageIds:r.messages.map(({id:e})=>e),withShift:e&&e.shiftKey}:{messageId:Te,withShift:e&&e.shiftKey};ce(t)},[Pe,qe,r,Te,ce]),ft=Object(c.m)(()=>{oe({messageId:Te})},[oe,Te]),It=Object(c.m)(e=>{e.stopPropagation()},[]),vt=Object(c.m)(()=>{lt&&(Object(l.ob)(lt.id)?Z({id:lt.id}):ee({id:lt.id}))},[lt,Z,ee]),yt=Object(c.m)(()=>{dt?Object(l.ob)(dt.id)?Z({id:dt.id}):ee({id:dt.id}):be({message:ge("HidAccount")})},[dt,be,ge,Z,ee]),Ct=Object(c.m)(()=>{w&&Z({id:w.id})},[w,Z]),Et=Object(c.m)(()=>{J({chatId:Ne,threadId:z,messageId:e.replyToMessageId,replyMessageId:Te})},[J,Ne,z,e.replyToMessageId,Te]),wt=Object(c.m)(()=>{Y({chatId:Ne,threadId:z,messageId:Te,origin:xe?u.h.ScheduledInline:u.h.Inline})},[Ne,z,Te,Y,xe]),Mt=Object(c.m)(()=>{X({chatId:Ne,messageId:Te})},[Ne,Te,X]),St=Object(c.m)(e=>{Y({chatId:Ne,threadId:z,messageId:e,origin:xe?u.h.ScheduledAlbum:u.h.Album})},[Ne,z,Y,xe]),kt=Object(c.m)(e=>{const t=e.target;(t.classList.contains("text-content")||t.classList.contains("Message"))&&(m.b&&Ze.a.getIsKeyboardVisible()?setTimeout(()=>{ye(e)},350):ye(e))},[ye]),Nt=Object(c.m)(e=>{m.b?pt(e):ye(e)},[ye,pt]),At=Object(c.m)(()=>{ae({messageIds:[Te]})},[Te,ae]),Pt=Object(c.m)(()=>{te({chatId:Ne,messageId:Te})},[te,Ne,Te]),Rt=Object(c.m)(e=>{se({chatId:Ne,messageId:Te,options:e})},[Ne,Te,se]),Lt=Object(c.m)(()=>{ie({fromChatId:Ne,groupedId:e.groupedId})},[ie,Ne,e.groupedId]),Bt=Object(c.m)(()=>{if(r&&r.messages){const e=r.messages.map(({id:e})=>e);ie({fromChatId:Ne,messageIds:e})}else ie({fromChatId:Ne,messageIds:[Te]})},[r,ie,Ne,Te]),Gt=Object(c.m)(()=>{J({chatId:Ne,threadId:b.MAIN_THREAD_ID,messageId:Te})},[J,Ne,Te]),_t=Object(c.m)(()=>{J(He?{chatId:De.fromChatId,groupedId:e.groupedId,groupedChatId:Ne}:{chatId:De.fromChatId,messageId:De.fromMessageId})},[J,De,e,Ne,He]);let zt,$t="",Vt=!1;const Wt=Object(c.p)(()=>qe?Jt(Re,Boolean(Ue),Boolean(o),r):void 0,[qe,Re,Ue,o,r]),Kt=Ue?28:0;if(qe||!_e&&!ze)Wt&&(zt=Math.max(Ht(Boolean(Ge),Ot),Wt.containerStyle.width),zt-Wt.containerStyle.width>18&&(Vt=!0));else{let t;_e?t=qt(e,o).width:ze&&(t=ze.isRound?ut.e:qt(e,o).width),t&&(zt=Math.max(Ht(Boolean(Ge),Ot),t),zt-t>18&&(Vt=!0))}return zt&&($t=`width: ${zt+Kt}px`),c.a.createElement("div",{ref:ue,id:"message"+Te,className:bt,style:nt?`--meta-safe-author-width: ${nt}px`:void 0,"data-message-id":Te,onClick:q?pt:m.b?kt:void 0,onDoubleClick:q?void 0:ft,onMouseDown:q?void 0:e=>{Tt(e),Pe||ve(e)},onContextMenu:q||Pe?void 0:Nt,onMouseEnter:He&&!f?Ya:void 0,onMouseLeave:He&&!f?Xa:void 0},c.a.createElement("div",{ref:Oe,className:"bottom-marker","data-message-id":Te,"data-last-message-id":r?r.messages[r.messages.length-1].id:void 0,"data-has-unread-mention":e.hasUnreadMention}),!Pe&&!He&&c.a.createElement("div",{className:"message-select-control"},G&&c.a.createElement("i",{className:"icon-select"})),!Pe&&f&&c.a.createElement("div",{className:Object(ne.a)("message-select-control group-select",_&&"is-selected"),onClick:gt},_&&c.a.createElement("i",{className:"icon-select"})),i&&function(){const e=lt&&Object(l.ob)(lt.id),t=lt&&e?lt:void 0,a=lt&&!e?lt:void 0,s=!lt&&De?De.hiddenUserName:void 0;return c.a.createElement(ea.a,{size:"small",user:t,chat:a,text:s,lastSyncTime:F,onClick:t||a?vt:void 0})}(),c.a.createElement("div",{className:Object(ne.a)("message-content-wrapper",ht.includes("text")&&"can-select-text"),onClick:q&&He?pt:void 0},c.a.createElement("div",{className:ht,style:$t,dir:"auto"},Ue&&!et&&(!He||p)&&c.a.createElement("div",{className:"message-title"},ge("ForwardedMessage")),function(){const t=Object(ne.a)("content-inner",Ue&&!et&&"forwarded-message",Le&&"reply-message",Vt&&"no-media-corners"),a=g&&!tt&&!Ue&&!Be,i=!Ye&&!H&&tt,b=Object(ne.a)("text-content",i&&"with-meta",T&&"with-outgoing-icon");return c.a.createElement("div",{className:t,onDoubleClick:It,dir:"auto"},function(){if(et&&!Fe||!(d&&!_e&&!ze||Ue||Fe||y)||He&&!p)return;let t,a;!dt||et&&Fe?De&&De.hiddenUserName&&(t=De.hiddenUserName):(t=Object(l.X)(ge,dt),Ue||(a="color-"+Object(l.Z)(dt)));return c.a.createElement("div",{className:"message-title",dir:"ltr"},t?c.a.createElement("span",{className:Object(ne.a)("interactive",a),onClick:yt,dir:"auto"},Object(mt.a)(t)):w?void 0:" ",w&&c.a.createElement(c.a.Fragment,null,c.a.createElement("span",{className:"via"},ge("ViaBot")),c.a.createElement("span",{className:"interactive",onClick:Ct},Object(mt.a)("@"+w.username))),De&&De.isLinkedChannelPost?c.a.createElement("span",{className:"admin-title",dir:"auto"},ge("DiscussChannel")):e.adminTitle&&!D?c.a.createElement("span",{className:"admin-title",dir:"auto"},e.adminTitle):void 0)}(),Le&&c.a.createElement(na,{message:k,sender:N,observeIntersection:s,onClick:Et}),Ke&&c.a.createElement(ua,{message:e,observeIntersection:s,observeIntersectionForPlaying:n,shouldLoop:Q,lastSyncTime:F}),H&&c.a.createElement(ma.a,{size:"small",sticker:H,observeIntersection:s,lastSyncTime:F,forceLoadPreview:Pe}),qe&&c.a.createElement($a,{album:r,albumLayout:Wt,observeIntersection:s,shouldAutoLoad:W,shouldAutoPlay:K,isOwn:Re,hasCustomAppendix:a,lastSyncTime:F,onMediaClick:St}),!qe&&_e&&c.a.createElement(va,{message:e,observeIntersection:s,noAvatars:o,shouldAutoLoad:W,uploadProgress:A,shouldAffectAppendix:a,onClick:wt,onCancelUpload:Pt}),!qe&&ze&&ze.isRound&&c.a.createElement(Ka,{message:e,observeIntersection:s,shouldAutoLoad:W,shouldAutoPlay:K,lastSyncTime:F}),!qe&&ze&&!ze.isRound&&c.a.createElement(ka,{message:e,observeIntersection:s,noAvatars:o,shouldAutoLoad:W,shouldAutoPlay:K,uploadProgress:A,lastSyncTime:F,onClick:wt,onCancelUpload:Pt}),($e||Ve)&&c.a.createElement(ra.a,{theme:v,message:e,uploadProgress:A,lastSyncTime:F,isSelectable:He,isSelected:G,onPlay:Mt,onReadMedia:!Ve||Re&&!B?void 0:At,onCancelUpload:Pt}),We&&c.a.createElement(ca.a,{message:e,observeIntersection:s,uploadProgress:A,isSelectable:He,isSelected:G,onMediaClick:wt,onCancelUpload:Pt}),Qe&&c.a.createElement(Ta,{contact:Qe}),Je&&c.a.createElement(Da,{message:e,poll:Je,onSendVote:Rt}),!H&&tt&&c.a.createElement("p",{className:b,dir:"auto"},tt,i&&c.a.createElement(ia,{message:e,outgoingStatus:T,signature:st,onClick:pt})),Ye&&c.a.createElement(Ha,{message:e,observeIntersection:s,noAvatars:o,shouldAutoLoad:W,shouldAutoPlay:K,lastSyncTime:F,onMediaClick:wt,onCancelMediaTransfer:Pt}),Xe&&c.a.createElement(qa,{message:e}))}(),(!He||f)&&!(!Ye&&!H&&tt)&&c.a.createElement(ia,{message:e,outgoingStatus:T,signature:st,onClick:pt}),rt&&ot?c.a.createElement(fe.a,{className:"message-action-button",color:"translucent-white",round:!0,size:"tiny",ariaLabel:ge("lng_context_forward_msg"),onClick:f?Lt:Bt},c.a.createElement("i",{className:"icon-share-filled"})):rt&&it?c.a.createElement(fe.a,{className:"message-action-button",color:"translucent-white",round:!0,size:"tiny",ariaLabel:"Focus message",onClick:V?Gt:_t},c.a.createElement("i",{className:"icon-arrow-right"})):void 0,Ot&&c.a.createElement(Ja,{message:e,disabled:h}),jt&&c.a.createElement("div",{className:"svg-appendix",ref:je})),e.inlineButtons&&c.a.createElement(Qa,{message:e,onClick:le})),Ie&&c.a.createElement(aa,{isOpen:pe,anchor:Ie,message:e,album:r,chatUsername:t,messageListType:$,onClose:Ce,onCloseAnimationEnd:Ee}))}));var ts=Object(c.h)(({messageIds:e,messageGroups:t,isViewportNewest:a,isUnread:r,withUsers:o,noAvatars:i,containerRef:d,anchorIdRef:b,memoFirstUnreadIdRef:m,threadId:O,type:j,threadTopMessageId:g,hasLinkedChat:p,isSchedule:I,noAppearanceAnimation:v,onFabToggle:y,onNotchToggle:C,openHistoryCalendar:E})=>{const{observeIntersectionForMedia:w,observeIntersectionForReading:M,observeIntersectionForAnimatedStickers:S}=function(e,t,a){const{markMessageListRead:n,markMessagesRead:c}=Object(s.d)(),{observe:r}=Object(xt.a)({rootRef:t,throttleMs:Lt,margin:Bt}),{observe:o,freeze:i,unfreeze:l}=Object(xt.a)({rootRef:t},t=>{if("thread"!==e)return;let s=0;const r=[];t.forEach(e=>{const{isIntersecting:t,target:a}=e;if(!t)return;const{dataset:n}=a,c=Number(n.lastMessageId||n.messageId);c>s&&(s=c),n.hasUnreadMention&&r.push(c)}),a.current&&s>=a.current&&n({maxId:s}),r.length&&c({messageIds:r})});Object(oe.a)(i,l);const{observe:d}=Object(xt.a)({rootRef:t,throttleMs:Lt});return{observeIntersectionForMedia:r,observeIntersectionForReading:o,observeIntersectionForAnimatedStickers:d}}(j,d,m),{backwardsTriggerRef:k,forwardsTriggerRef:N,fabTriggerRef:T}=function(e,t,a,r,o,i,l){const{loadViewportMessages:d}=Object(s.d)(),[b,m]=Object(c.p)(()=>"thread"===e?[Object(f.a)(()=>d({direction:u.e.Backwards}),1e3,!0,!1),Object(f.a)(()=>d({direction:u.e.Forwards}),1e3,!0,!1)]:[],[d,a]),h=Object(c.q)(null),O=Object(c.q)(null),j=Object(c.q)(null),g=Object(c.m)(()=>{if(!a||!a.length)return i(!1),void l(!1);if(!r)return i(!0),void l(!0);const{offsetHeight:e,scrollHeight:s,scrollTop:n}=t.current,c=s-n-e,d=c<=0;i(o?!d:!(c<=50)),l(!d)},[a,r,t,i,o,l]),{observe:p}=Object(xt.a)({rootRef:t,margin:n.fb},e=>{if(!m||!b)return;const a=e.find(({isIntersecting:e})=>e);if(!a)return;const{target:s}=a;"backwards-trigger"===s.className?(Object(Pt.a)(t.current),b()):"forwards-trigger"===s.className&&(Object(Pt.a)(t.current),m())});Object(xt.c)(h,p),Object(xt.c)(O,p);const{observe:I,freeze:v,unfreeze:y}=Object(xt.a)({rootRef:t,margin:50},g);Object(xt.c)(j,I);const{observe:C,freeze:E,unfreeze:w}=Object(xt.a)({rootRef:t},g);return Object(xt.c)(j,C),Object(le.a)(()=>{v(),E(),setTimeout(()=>{w(),y()},100)},[a]),{backwardsTriggerRef:h,forwardsTriggerRef:O,fabTriggerRef:j}}(j,d,e,a,r,y,C),A=Object(he.a)(),P=c.a.createElement("div",{className:Object(ne.a)("unread-divider","local-action-message"),key:"unread-messages"},c.a.createElement("span",null,A("UnreadMessages"))),R=v?0:t.reduce((e,t)=>e+Object(h.h)(t.senderGroups).length,0);let L=0;const B=t.map((e,t,a)=>{const s=e.senderGroups.map((e,s,n)=>{if(1===e.length&&!kt(e[0])&&Object(l.gb)(e[0])){const r=e[0],o=s===n.length-1&&t===a.length-1;return Object(h.e)([r.id===m.current&&P,c.a.createElement(sa,{key:r.id,message:r,observeIntersection:M,appearanceOrder:R-++L,isLastInList:o})])}let r;return Object(h.h)(e.map((d,u)=>{const f=kt(d)?d.mainMessage:d,I=kt(d)?d:void 0,v=Object(l.yb)(f),y=kt(d),C=e[u+1];f.previousLocalId&&b.current==="message"+f.previousLocalId&&(b.current="message"+f.id);const E=!y&&f.groupedId?f.groupedId:void 0,k=C&&!kt(C)?C.groupedId:void 0,N={isFirstInGroup:0===u,isLastInGroup:u===e.length-1,isFirstInDocumentGroup:Boolean(E&&E!==r),isLastInDocumentGroup:Boolean(E&&E!==k),isLastInList:u===e.length-1&&s===n.length-1&&t===a.length-1};r=E;const T=Object(l.G)(f),x="scheduled"!==j?T:`${f.date}_${T}`;return Object(h.e)([f.id===m.current?P:void 0,c.a.createElement(es,{key:x,message:f,observeIntersectionForBottom:M,observeIntersectionForMedia:w,observeIntersectionForAnimatedStickers:S,album:I,noAvatars:i,withAvatar:N.isLastInGroup&&o&&!v&&!(f.id===g),withSenderName:N.isFirstInGroup&&o&&!v,threadId:O,messageListType:j,noComments:!1===p,appearanceOrder:R-++L,isFirstInGroup:N.isFirstInGroup,isLastInGroup:N.isLastInGroup,isFirstInDocumentGroup:N.isFirstInDocumentGroup,isLastInDocumentGroup:N.isLastInDocumentGroup,isLastInList:N.isLastInList}),f.id===g&&c.a.createElement("div",{className:"local-action-message",key:"discussion-started"},c.a.createElement("span",null,A("DiscussionStarted")))])}))});return c.a.createElement("div",{className:"message-date-group",key:e.datetime,onMouseDown:Tt,teactFastList:!0},c.a.createElement("div",{className:Object(ne.a)("sticky-date",!I&&"interactive"),key:"date-header",onMouseDown:Tt,onClick:I?void 0:()=>E({selectedAt:e.datetime})},c.a.createElement("span",{dir:"auto"},I&&e.originalDate===n.xb&&A("MessageScheduledUntilOnline"),I&&e.originalDate!==n.xb&&A("MessageScheduledOn",Object(x.c)(A,e.datetime,void 0,!0)),!I&&Object(x.c)(A,e.datetime))),Object(h.h)(s))});return c.a.createElement("div",{className:"messages-container",teactFastList:!0},c.a.createElement("div",{ref:k,key:"backwards-trigger",className:"backwards-trigger"}),Object(h.h)(B),c.a.createElement("div",{ref:N,key:"forwards-trigger",className:"forwards-trigger"}),c.a.createElement("div",{ref:T,key:"fab-trigger",className:"fab-trigger"}))}),as=a(125);a(247);var ss=Object(c.h)(Object(s.h)((e,{userId:t})=>{const{stickers:a}=e.stickers.greeting,s=a&&a.length?a[t%a.length]:void 0,n=Object(o.g)(e,t);return n?{sticker:s,lastUnreadMessageId:n.lastMessage&&n.lastMessage.id!==n.lastReadInboxMessageId?n.lastMessage.id:void 0,connectionState:e.connectionState}:{}},(e,t)=>Object(h.l)(t,["loadGreetingStickers","sendMessage","markMessageListRead"]))(({sticker:e,connectionState:t,lastUnreadMessageId:a,loadGreetingStickers:s,sendMessage:n,markMessageListRead:r})=>{const o=Object(he.a)(),i=Object(c.q)(null),{observe:l}=Object(xt.a)({rootRef:i,debounceMs:200});Object(c.n)(()=>{e||"connectionStateReady"!==t||s()},[t,s,e]),Object(c.n)(()=>{"connectionStateReady"===t&&a&&r({maxId:a})},[t,r,a]);const d=Object(c.m)(e=>{e={...e,isPreloadedGlobally:!0},n({sticker:e})},[n]);return c.a.createElement("div",{className:"ContactGreeting",ref:i},c.a.createElement("div",{className:"wrapper"},c.a.createElement("p",{className:"title",dir:"auto"},o("Conversation.EmptyPlaceholder")),c.a.createElement("p",{className:"description",dir:"auto"},o("Conversation.GreetingText")),c.a.createElement("div",{className:"sticker"},e&&c.a.createElement(as.a,{sticker:e,onClick:d,clickArg:e,observeIntersection:l,size:160,className:"large"}))))}));a(248);var ns=Object(c.h)(({isChatWithSelf:e,type:t,isGroupChatJustCreated:a})=>{const s=Object(he.a)();return"scheduled"===t?function(e){return c.a.createElement("div",{className:"empty"},c.a.createElement("span",null,e("ScheduledMessages.EmptyPlaceholder")))}(s):e?function(e){return c.a.createElement("div",{className:"NoMessages"},c.a.createElement("div",{className:"wrapper"},c.a.createElement("i",{className:"icon icon-cloud-download"}),c.a.createElement("h3",{className:"title"},e("Conversation.CloudStorageInfo.Title")),c.a.createElement("ul",{className:"description"},c.a.createElement("li",null,e("Conversation.ClousStorageInfo.Description1")),c.a.createElement("li",null,e("Conversation.ClousStorageInfo.Description2")),c.a.createElement("li",null,e("Conversation.ClousStorageInfo.Description3")),c.a.createElement("li",null,e("Conversation.ClousStorageInfo.Description4")))))}(s):a?function(e){return c.a.createElement("div",{className:"NoMessages"},c.a.createElement("div",{className:"wrapper",dir:e.isRtl?"rtl":void 0},c.a.createElement("h3",{className:"title"},e("EmptyGroupInfo.Title")),c.a.createElement("p",{className:"description"},e("EmptyGroupInfo.Subtitle")),c.a.createElement("ul",{className:"list-checkmarks"},c.a.createElement("li",null,e("EmptyGroupInfo.Line1")),c.a.createElement("li",null,e("EmptyGroupInfo.Line2")),c.a.createElement("li",null,e("EmptyGroupInfo.Line3")),c.a.createElement("li",null,e("EmptyGroupInfo.Line4")))))}(s):c.a.createElement("div",{className:"empty"},c.a.createElement("span",null,s("NoMessages")))});a(249);const cs=Object(f.a)(e=>e(),200,!1);function rs(e,t){return t&&1===t.length&&1===t[0].senderGroups.length&&1===t[0].senderGroups[0].length&&"content"in t[0].senderGroups[0][0]&&t[0].senderGroups[0][0].content.action&&t[0].senderGroups[0][0].content.action.type===e}var os=Object(c.h)(Object(s.h)((e,{chatId:t,threadId:a,type:s})=>{const n=Object(o.g)(e,t);if(!n)return{};const c=Object(o.y)(e,t,a,s),r="scheduled"===s?Object(o.sb)(e,t):Object(o.n)(e,t),i=Object(o.Hb)(e,t,a);if(a!==b.MAIN_THREAD_ID&&!(r&&i&&r[i]))return{};const{isRestricted:d,restrictionReason:u,lastMessage:m}=n,h=Object(o.I)(e,t),O=h?!e.focusedMessage.noHighlight:void 0,j=a===b.MAIN_THREAD_ID&&!c&&!n.unreadCount&&!h&&m&&!m.groupedId,g=Object(o.h)(e,t);let p;if(Object(o.L)(e,t)){const a=Object(o.h)(e,t);p=a.fullInfo?a.fullInfo.botDescription||"NoMessages":"Updating bot info..."}return{isChatLoaded:!0,isRestricted:d,restrictionReason:u,isChannelChat:Object(l.mb)(n),isGroupChat:Object(l.nb)(n),isCreator:n.isCreator,isChatWithSelf:Object(o.P)(e,t),isBot:Boolean(g),messageIds:c,messagesById:r,firstUnreadId:Object(o.H)(e,t,a),isViewportNewest:"thread"!==s||Object(o.Y)(e,t,a),threadFirstMessageId:Object(o.G)(e,t,a),focusingId:h,hasFocusHighlight:O,isSelectModeActive:Object(o.S)(e),botDescription:p,threadTopMessageId:i,hasLinkedChat:n.fullInfo&&"linkedChatId"in n.fullInfo?Boolean(n.fullInfo.linkedChatId):void 0,...j&&{lastMessage:m}}},(e,t)=>Object(h.l)(t,["loadViewportMessages","setScrollOffset","openHistoryCalendar"]))(({chatId:e,threadId:t,type:a,hasTools:r,onFabToggle:i,onNotchToggle:d,isChatLoaded:b,isChannelChat:m,isGroupChat:O,canPost:j,isReady:g,isChatWithSelf:p,isCreator:I,isBot:v,messageIds:y,messagesById:C,firstUnreadId:E,isViewportNewest:w,threadFirstMessageId:M,isRestricted:S,restrictionReason:k,focusingId:N,hasFocusHighlight:T,isSelectModeActive:A,loadViewportMessages:P,setScrollOffset:R,lastMessage:x,botDescription:L,threadTopMessageId:B,hasLinkedChat:D,openHistoryCalendar:F})=>{const U=Object(c.q)(null),H=Object(c.q)("thread"===a&&Object(o.tb)(Object(s.e)(),e,t)||0),q=Object(c.q)(),G=Object(c.q)(),_=Object(c.q)(),z=Object(c.q)(),$=Object(c.q)(),V=Object(c.q)(),W=Object(c.q)(!1),K=Object(c.q)(Boolean(x)),[Q,J]=Object(c.r)(),Y=Boolean(y);Object(le.a)(()=>{Y&&Object(f.e)(()=>{K.current=!1})},[Y]),Object(le.a)(()=>{$.current=E,z.current||(z.current=E)},[E]),Object(le.a)(()=>{V.current=N},[N]);const X=Object(c.p)(()=>{if(!y||!C)return;const e=!B||y[0]&&M!==y[0]?y:[B,...y];if(!e.length)return;const t=e.map(e=>C[e]).filter(Boolean);return Nt(Object(h.k)(t,["date","id"]),z.current)},[y,C,M,B]),Z=Object(c.p)(()=>{if("thread"===a)return Object(f.a)(()=>P({direction:u.e.Around}),1e3,!0,!1)},[P,y]),{isScrolled:ee,updateStickyDates:te}=At(),ae=Object(c.m)(()=>{if(W.current)return void(W.current=!1);const s=U.current;V.current||te(s,r),cs(()=>{Object(f.b)(()=>{s.parentElement&&(H.current=s.scrollHeight-s.scrollTop,"thread"===a&&R({chatId:e,threadId:t,scrollOffset:H.current}))})})},[te,r,a,R,e,t]);Object(c.n)(()=>{if(!("ResizeObserver"in window))return;const e=new ResizeObserver(([e])=>{e.target.offsetParent&&J(e.contentRect.height)});return e.observe(U.current),()=>{e.disconnect()}},[]);const{height:ce}=et();Object(c.n)(()=>{g&&(U.current.dataset.normalHeight=String(U.current.offsetHeight))},[ce,g]),Object(c.n)(()=>{if(!Z||!b||S||N)return;const e=U.current;(!y||y.length{if(!y||!_.current||!g)return;const e=_.current.filter(e=>y.includes(Number(e.dataset.messageId))),t=e[1]||e[0];t&&(q.current=t.id,G.current=t.getBoundingClientRect().top)},[y,w,Q,r,g]),Object(Mt.a)(([e,t,a])=>{const s=U.current;if(_.current=Array.from(s.querySelectorAll(".message-list-item")),!s.offsetParent)return;const c=w&&y&&y.length{s.parentElement&&s.parentElement.classList.remove("force-messages-scroll")},1e3));const{scrollTop:o,scrollHeight:i,offsetHeight:l}=s,d=H.current,b=_.current[_.current.length-1],u=b?b.offsetHeight:0,m=w&&t&&d-(a||l)-u<=100;let h;const O=y&&e&&y[0]!==e[0],j=y&&e&&y[y.length-1]!==e[e.length-1],g=y&&V.current===y[y.length-1];if(m&&j&&!O&&!g&&(b&&Object(f.b)(()=>{Object(Rt.a)(s,b,"end",20,void 0,void 0,void 0,!0)}),h=i-l,H.current=Math.max(i-h,l),!c))return;const p=void 0!==a&&a!==Q,I=q.current&&s.querySelector("#"+q.current),v=!I&&z.current&&s.querySelector(".unread-divider");if(m&&p){if(Object(Rt.b)())return;h=i-l}else if(I){h=o+(I.getBoundingClientRect().top-(G.current||0))}else h=v?Math.min(v.offsetTop-(r?60:10),i-d):i-d;Object(Pt.a)(s,h),V.current||(W.current=!0,Object(f.b)(()=>{W.current=!1})),H.current=Math.max(i-h,l)},[y,w,Q,r]),Object(St.a)(([e])=>{void 0!==e&&Object(se.d)(200+n.c)},[A]);const re=Object(he.a)(),oe=Boolean(e&&Object(l.ob)(e)),ie=Boolean(!oe&&!m||p),de=Boolean(!ie||m),be=Object(l.ob)(e)&&!p&&!v&&(!X&&!x&&y&&(!_.current||0===_.current.length)||rs("contactSignUp",X)||x&&x.content.action&&"contactSignUp"===x.content.action.type),ue=O&&I&&rs("chatCreate",X),me=Object(ne.a)("MessageList custom-scroll",de&&"no-avatars",!j&&"no-composer","pinned"===a&&"type-pinned",T&&"has-focus-highlight",A&&"select-mode-active",ee&&"scrolled",!g&&"is-animating");return c.a.createElement("div",{ref:U,className:me,onScroll:ae,onMouseDown:Tt},S?c.a.createElement("div",{className:"empty"},c.a.createElement("span",null,k?k.text:"This is a private "+(m?"channel":"chat"))):L?c.a.createElement("div",{className:"empty rich"},c.a.createElement("span",null,Object(mt.a)(re(L),["br","emoji","links"]))):be?c.a.createElement(ss,{userId:e}):!y||X&&!ue?y&&X||x?c.a.createElement(ts,{messageIds:y||[x.id],messageGroups:X||Nt([x]),isViewportNewest:Boolean(w),isUnread:Boolean(E),withUsers:ie,noAvatars:de,containerRef:U,anchorIdRef:q,memoFirstUnreadIdRef:z,threadId:t,type:a,threadTopMessageId:B,hasLinkedChat:D,isSchedule:!!X&&"scheduled"===a,noAppearanceAnimation:!X||!K.current,onFabToggle:i,onNotchToggle:d,openHistoryCalendar:F}):c.a.createElement(xe.a,{color:"white"}):c.a.createElement(ns,{chatId:e,type:a,isChatWithSelf:p,isGroupChatJustCreated:ue}))}));a(250);var is=Object(c.h)(Object(s.h)(e=>{const t=Object(o.z)(e);if(!t)return{};const{chatId:a,threadId:s,type:n}=t,c=Object(o.g)(e,a);return{messageListType:n,unreadCount:c&&s===b.MAIN_THREAD_ID&&"thread"===n?c.unreadCount:void 0}},(e,t)=>Object(h.l)(t,["focusNextReply"]))(({isShown:e,canPost:t,messageListType:a,unreadCount:s,focusNextReply:n})=>{const r=Object(he.a)(),o=Object(c.q)(null),i=Object(c.m)(()=>{if(e)if("thread"===a)n();else{const e=o.current.parentElement.querySelector(".MessageList"),t=e.querySelectorAll(".message-list-item"),a=t[t.length-1];if(!a)return;Object(Rt.a)(e,a,"end",20)}},[e,a,n]),l=Object(ne.a)("ScrollDownButton",e&&"revealed",!t&&"no-composer");return c.a.createElement("div",{ref:o,className:l},c.a.createElement("div",{className:"ScrollDownButton-inner"},c.a.createElement(fe.a,{color:"secondary",round:!0,onClick:i,ariaLabel:r("AccDescrPageDown")},c.a.createElement("i",{className:"icon-arrow-down"})),Boolean(s)&&c.a.createElement("div",{className:"unread-count"},Object(ot.b)(s))))})),ls=a(135),ds=a(142);async function bs(e,t,a,s){const n=URL.createObjectURL(t),{type:c,size:r}=t;let o,i;if(c.startsWith("image/"))if(a){const a=await Object(Xe.g)(n),{width:r,height:i}=a;if(r>1280||i>1280||"image/jpeg"!==c){const c=await function(e){return new Promise(t=>{const a=document.createElement("canvas"),s=a.getContext("2d");let{width:n,height:c}=e;(n>1280||c>1280)&&(n>=c?(c*=1280/n,n=1280):(n*=1280/c,c=1280)),a.width=n,a.height=c,s.drawImage(e,0,0,e.width,e.height,0,0,n,c),a.toBlob(t,"image/jpeg",100)})}(a);return c?(URL.revokeObjectURL(n),bs(e,c,!0,s)):bs(e,t,!1,s)}o={width:r,height:i}}else i=n;else if(c.startsWith("video/")){if(r<10485760){const{videoWidth:e,videoHeight:t,duration:a}=await Object(Xe.h)(n);o={width:e,height:t,duration:a}}i=await Object(Xe.c)(n)}return{blobUrl:n,filename:e,mimeType:c,size:r,quick:o,previewBlobUrl:i,...s}}var us=a(190);let ms;function hs(e){ms.focus(),e.focus()}m.e&&(ms=document.createElement("input"),ms.classList.add("for-ios-autocapitalization-fix"),document.body.appendChild(ms));var Os=a.p+"c0155344d336103c2b6a0b28cc510750.js";const js={encoderPath:Os,reuseWorker:!0},gs={type:"audio/ogg"};let ps,fs,Is;async function vs(){return ps||(ps=a.e(10).then(a.t.bind(null,334,7)),fs=(await ps).default,Is=new fs(js)),ps}async function ys(e){await async function(){await vs(),await Is.start()}();const t=Date.now();let a;const s=[],n=[];Is.ondataavailable=e=>{s.push(e)};const c=function(e,t){const a=e.sourceNode,s=a.context.createAnalyser();s.fftSize=64,a.connect(s);const n=s.frequencyBinCount,c=new Uint8Array(n);let r=!1;return function e(){if(r)return;s.getByteFrequencyData(c);const a=c.reduce((e,t)=>e+t,0),o=a/n/255;t(o<.1?0:o),requestAnimationFrame(e)}(),()=>{r=!0}}(Is,t=>{n.push(255*t),e(t)});return{stop:()=>new Promise((e,r)=>{Is.onstop=()=>{e({blob:new Blob(s,gs),duration:Math.round(((a||Date.now())-t)/1e3),waveform:n})},Is.onerror=r;const o=Math.max(0,t+1e3-Date.now());setTimeout(()=>{Is.stop(),c()},o)}),pause:()=>{const e=Math.max(0,t+1e3-Date.now());setTimeout(()=>{Is.pause(),a=Date.now(),c()},e)}}}const Cs=["image/png","image/jpeg","image/gif"];function Es(e){const{text:t,entities:a}=e||{};if(!t)return"";const s=Object(Ft.b)(t,a,void 0,void 0,!0);return Array.isArray(s)?s.join(""):s}let ws,Ms;var Ss=a(65);var ks=a(191),Ns=a(199);const Ts=document.createElement("div"),As=/^@([a-z0-9_]{1,32})[\u00A0\u0020]+(.*)/i,Ps=/^@([a-z0-9_]{1,32})[\u00A0\u0020]+\n{2,}/i;function Rs(e,t,a,n){const[r,o,i]=Object(me.a)(),l=function(e){return Ts.innerHTML=e.replace(/
/g,"\n"),Ts.innerText}(a),{queryInlineBot:d,resetInlineBot:b}=Object(s.d)(),{username:u,query:m,canShowHelp:h}=function(e){const t=e.match(As);if(!t)return{username:"",query:"",canShowHelp:!1};return{username:t[1],query:t[2],canShowHelp:""===t[2]&&!e.match(Ps)}}(l),O=u.toLowerCase(),j=Object(ga.a)(m),g=Object(ga.a)(u),p=n&&n[O],{id:f,switchPm:I,offset:v,results:y,isGallery:C,help:E}=p||{};Object(c.n)(()=>{j!==m&&i()},[j,m,i]),Object(c.n)(()=>{e&&O&&t&&d({chatId:t,username:O,query:m})},[m,e,d,t,O]);const w=Object(c.m)(()=>{d({chatId:t,username:O,query:m,offset:v})},[v,t,m,d,O]);return Object(c.n)(()=>{e&&f&&(I||y&&y.length)?o():i()},[f,e,o,y,I,i]),g!==u&&b({username:g}),{isOpen:r,closeTooltip:i,loadMore:w,username:u,id:f,isGallery:C,switchPm:I,results:y,help:h&&E?`@${u} ${E}`:void 0}}var xs=Object(c.h)(e=>{const{isOpen:t}=e,a=Object(Re.a)(Pe.a.Extra,"DeleteMessageModal",!t);return a?c.a.createElement(a,e):void 0});function Ls(){return(Ls=Object.assign||function(e){for(var t=1;t{const a=Object(c.q)(!1),s=Object(c.m)(()=>{if(a.current=!0,Ds)return Ds=!1,void e();Bs&&(clearTimeout(Bs),Bs=void 0),Bs=window.setTimeout(()=>{a.current&&e()},200)},[e]),n=Object(c.m)(()=>{a.current=!1},[]);return c.a.createElement(fe.a,Ls({},t,{onMouseEnter:m.n?void 0:s,onMouseLeave:m.n?void 0:n,onClick:m.n?e:void 0}))});var Us=Object(c.h)(e=>{const{isOpen:t}=e,a=Object(Re.a)(Pe.a.Extra,"AttachMenu",!t);return a?c.a.createElement(a,e):void 0});var Hs=Object(c.h)(e=>{const{isOpen:t}=e,a=Object(Re.a)(Pe.a.Extra,"SymbolMenu",!t);return a?c.a.createElement(a,e):void 0});var qs=Object(c.h)(e=>{const{isOpen:t}=e,a=Object(Re.a)(Pe.a.Extra,"InlineBotTooltip",!t);return a?c.a.createElement(a,e):void 0});var Gs=Object(c.h)(e=>{const{isOpen:t}=e,a=Object(Re.a)(Pe.a.Extra,"MentionTooltip",!t);return a?c.a.createElement(a,e):void 0});var _s=Object(c.h)(e=>{const{isOpen:t}=e,a=Object(Re.a)(Pe.a.Extra,"CustomSendMenu",!t);return a?c.a.createElement(a,e):void 0});var zs=e=>{const{isOpen:t}=e,a=Object(Re.a)(Pe.a.Extra,"StickerTooltip",!t);return a?c.a.createElement(a,e):void 0},$s=a(192);var Vs=Object(c.h)(e=>{const{isOpen:t}=e,a=Object(Re.a)(Pe.a.Extra,"BotKeyboardMenu",!t);return a?c.a.createElement(a,e):void 0}),Ws=a(193),Ks=a(122);a(252);var Qs=Object(c.h)(Object(s.h)(e=>{const{chatId:t,threadId:a,type:s}=Object(o.z)(e)||{};if(!t||!a||!s)return{};const{currentUserId:n,forwardMessages:{fromChatId:c,toChatId:r,messageIds:i}}=e,d=Object(o.ob)(e,t,a),b="scheduled"===s?Object(o.F)(e,t):Object(o.D)(e,t,a),u=e.settings.byKey.animationLevel>=1,m=r===t;let h,O;if(d?h=Object(o.l)(e,t,d):b?h=Object(o.E)(e,t,a,s):m&&1===i.length&&(h=Object(o.l)(e,c,i[0])),d&&h){const{forwardInfo:a}=h,s=t===n;a&&(a.isChannelPost||s)&&(O=Object(o.K)(e,h)),O||(O=Object(o.vb)(e,h))}else m&&(O=Object(l.ob)(c)?Object(o.Jb)(e,c):Object(o.g)(e,c));return{replyingToId:d,editingId:b,message:h,sender:O,shouldAnimate:u,forwardedMessagesCount:m?i.length:void 0}},(e,t)=>Object(h.l)(t,["setReplyingToId","setEditingId","focusMessage","exitForwardMode"]))(({replyingToId:e,editingId:t,message:a,sender:s,shouldAnimate:n,forwardedMessagesCount:r,setReplyingToId:o,setEditingId:i,focusMessage:l,exitForwardMode:d})=>{const b=Boolean((e||t)&&a||s&&r),u=Object(Ks.a)([r],r?300:void 0),{shouldRender:m,transitionClassNames:h}=Object(re.a)(u&&b,void 0,!n,void 0,!n),O=Object(c.m)(()=>{e?o({messageId:void 0}):t?i({messageId:void 0}):r&&d()},[e,t,r,o,i,d]);Object(c.n)(()=>b?Object(de.a)(O):void 0,[b,O]);const j=Object(c.m)(()=>{l({chatId:a.chatId,messageId:a.id})},[l,a]),g=Object(ne.a)("ComposerEmbeddedMessage",h),p=r&&r>1?r+" forwarded messages":void 0;if(m)return c.a.createElement("div",{className:g},c.a.createElement("div",null,c.a.createElement(fe.a,{round:!0,color:"translucent",ariaLabel:"Cancel replying",onClick:O},c.a.createElement("i",{className:"icon-close"})),c.a.createElement(na,{className:"inside-input",message:a,sender:s,customText:p,title:t?"Edit Message":void 0,onClick:j})))}));var Js=Object(c.h)(e=>{const{attachments:t}=e,a=Object(Re.a)(Pe.a.Extra,"AttachmentModal",!t.length);return a?c.a.createElement(a,e):void 0});var Ys=Object(c.h)(e=>{const{isOpen:t}=e,a=Object(Re.a)(Pe.a.Extra,"PollModal",!t);return a?c.a.createElement(a,e):void 0});var Xs=Object(c.h)(e=>{const{isOpen:t}=e,a=Object(Re.a)(Pe.a.Extra,"DropArea",!t);return a?c.a.createElement(a,e):void 0});a(253);const Zs=new RegExp(n.rb,"i");var en=Object(c.h)(Object(s.h)((e,{chatId:t,threadId:a})=>{const s=Object(o.db)(e,t,a);return{webPagePreview:e.webPagePreview,noWebPage:s}},(e,t)=>Object(h.l)(t,["loadWebPagePreview","clearWebPagePreview","toggleMessageWebPage"]))(({chatId:e,threadId:t,messageText:a,disabled:s,webPagePreview:n,noWebPage:r,loadWebPagePreview:o,clearWebPagePreview:i,toggleMessageWebPage:l})=>{const d=Object(c.p)(()=>{const{text:e,entities:t}=Object(ds.a)(a),s=t&&t.find(({type:e})=>e===b.ApiMessageEntityTypes.TextUrl);if(s)return s.url;const n=e.match(Zs);return n?n[0]:void 0},[a]);Object(c.n)(()=>{d?o({text:d}):(i(),l({chatId:e,threadId:t}))},[e,l,i,d,o,t]),Object(le.a)(()=>{i(),l({chatId:e,threadId:t})},[e]);const u=Boolean(n&&a.length&&!r&&!s),{shouldRender:m,transitionClassNames:h}=Object(re.a)(u),O=Object(rt.a)(n);if(!m||!O)return;const{photo:j,...g}=O,p={content:{webPage:g}};return c.a.createElement("div",{className:Object(ne.a)("WebPagePreview",h)},c.a.createElement("div",null,c.a.createElement(fe.a,{round:!0,color:"translucent",ariaLabel:"Clear Webpage Preview",onClick:()=>{l({chatId:e,threadId:t,noWebPage:!0})}},c.a.createElement("i",{className:"icon-close"})),c.a.createElement(Ha,{message:p,inPreview:!0})))})),tn=a(128);var an=Object(c.h)(e=>{const{isOpen:t}=e,a=Object(Re.a)(Pe.a.Extra,"CalendarModal",!t);return a?c.a.createElement(a,e):void 0});var sn=Object(c.h)(e=>{const{isOpen:t}=e,a=Object(Re.a)(Pe.a.Extra,"PaymentModal",!t);return a?c.a.createElement(a,e):void 0});var nn,cn=Object(c.h)(e=>{const{isOpen:t}=e,a=Object(Re.a)(Pe.a.Extra,"ReceiptModal",!t);return a?c.a.createElement(a,e):void 0});a(254);!function(e){e.Send="send",e.Record="record",e.Edit="edit"}(nn||(nn={}));var rn=Object(c.h)(Object(s.h)((e,{chatId:t,threadId:a,messageListType:s})=>{const c=Object(o.g)(e,t),r=c&&Object(o.p)(e,c),i=c?Object(o.O)(e,c):void 0,d=Object(o.P)(e,t),u=i&&Object(o.cb)(e,t),m=Object(o.qb)(e,t),{language:h}=e.settings.byKey,O=e.emojiKeywords[n.j],j=h!==n.j?e.emojiKeywords[h]:void 0;return{editingMessage:Object(o.E)(e,t,a,s),connectionState:e.connectionState,draft:Object(o.C)(e,t,a),chat:c,isChatWithBot:i,isChatWithSelf:d,canScheduleUntilOnline:!d&&!i&&c&&r&&Object(l.ob)(t)&&r.status&&Boolean(r.status.wasOnline),isRightColumnShown:Object(o.W)(e),isSelectModeActive:Object(o.S)(e),withScheduledButton:a===b.MAIN_THREAD_ID&&"thread"===s&&Boolean(m&&m.length),shouldSchedule:"scheduled"===s,botKeyboardMessageId:u?u.id:void 0,isForwarding:t===e.forwardMessages.toChatId,isPollModalOpen:e.isPollModalOpen,stickersForEmoji:e.stickers.forEmoji.stickers,groupChatMembers:c&&c.fullInfo&&c.fullInfo.members,topInlineBotIds:e.topInlineBots&&e.topInlineBots.userIds,currentUserId:e.currentUserId,usersById:e.users.byId,lastSyncTime:e.lastSyncTime,contentToBeScheduled:e.messages.contentToBeScheduled,isPaymentModalOpen:e.payment.isPaymentModalOpen,isReceiptModalOpen:Boolean(e.payment.receipt),shouldSuggestStickers:e.settings.byKey.shouldSuggestStickers,recentEmojis:e.recentEmojis,baseEmojiKeywords:O?O.keywords:void 0,emojiKeywords:j?j.keywords:void 0,serverTimeOffset:e.serverTimeOffset,inlineBots:e.inlineBots.byUsername,isInlineBotLoading:e.inlineBots.isLoading}},(e,t)=>Object(h.l)(t,["sendMessage","editMessage","saveDraft","clearDraft","showDialog","setStickerSearchQuery","setGifSearchQuery","forwardMessages","openPollModal","closePollModal","closePaymentModal","clearReceipt","loadScheduledHistory","openChat","addRecentEmoji","sendInlineBotResult"]))(({dropAreaState:e,shouldSchedule:t,canScheduleUntilOnline:a,isReady:r,onDropHide:o,editingMessage:i,chatId:d,threadId:u,messageListType:h,draft:O,chat:j,connectionState:g,isChatWithBot:p,isChatWithSelf:I,isRightColumnShown:v,isSelectModeActive:y,isForwarding:C,isPollModalOpen:E,isPaymentModalOpen:w,isReceiptModalOpen:M,botKeyboardMessageId:S,withScheduledButton:k,stickersForEmoji:N,groupChatMembers:T,topInlineBotIds:A,currentUserId:P,usersById:R,lastSyncTime:L,contentToBeScheduled:B,shouldSuggestStickers:D,baseEmojiKeywords:F,emojiKeywords:U,serverTimeOffset:H,recentEmojis:q,inlineBots:G,isInlineBotLoading:_,sendMessage:z,editMessage:$,saveDraft:V,clearDraft:W,showDialog:K,setStickerSearchQuery:Q,setGifSearchQuery:J,forwardMessages:Y,openPollModal:X,closePollModal:Z,loadScheduledHistory:ee,closePaymentModal:te,openChat:ae,clearReceipt:se,addRecentEmoji:ce,sendInlineBotResult:re})=>{const le=Object(he.a)(),be=Object(c.q)(null),[ue,Oe]=Object(c.r)(""),je=Object(c.q)(),ge=Object(ga.a)(e),[pe,Ie,ve]=Object(me.a)(),[ye,Ce]=Object(c.r)(),{width:Ee}=Ze.a.get(),Me=Object(c.q)(ue);Object(c.n)(()=>{Me.current=ue},[ue]),Object(c.n)(()=>{je.current=void 0},[d]),Object(c.n)(()=>{d&&L&&u===b.MAIN_THREAD_ID&&r&&ee()},[r,d,ee,L,u]),Object(c.o)(()=>{be.current&&(be.current.innerHTML='')},[]),Object(c.n)(()=>{B&&(Ce(B),Ie())},[B,Ie]);const[Se,ke]=Object(c.r)([]),[Ne,Te,Ae]=Object(me.a)(),[Pe,Re,xe]=Object(me.a)(),[Le,Be,De]=Object(me.a)(),[Fe,Ue,He]=Object(me.a)(),[qe,Ge]=Object(me.a)(),[_e,ze,$e]=Object(me.a)(),{startRecordingVoice:Ve,stopRecordingVoice:We,pauseRecordingVoice:Ke,activeVoiceRecording:Qe,currentRecordTime:Ye,recordButtonRef:Xe,startRecordTimeRef:et}=(()=>{const e=Object(c.q)(null),[t,a]=Object(c.r)(),s=Object(c.q)(),[n,r]=Object(c.r)();Object(c.n)(()=>{m.e&&m.o&&vs()},[]);const o=Object(c.m)(async()=>{try{const{stop:t,pause:n}=await ys(t=>{e.current&&(s.current&&Date.now()%4==0&&(e.current.style.boxShadow=`0 0 0 ${50*(t||0)}px rgba(0,0,0,.15)`),r(Date.now()))});s.current=Date.now(),r(Date.now()),a({stop:t,pause:n})}catch(e){console.error(e)}},[]),i=Object(c.m)(()=>{if(t){e.current&&(e.current.style.boxShadow="none");try{return t.pause()}catch(e){return void console.error(e)}}},[t]),l=Object(c.m)(()=>{if(t){a(void 0),s.current=void 0,r(void 0),e.current&&(e.current.style.boxShadow="none");try{return t.stop()}catch(e){return void console.error(e)}}},[t]);return Object(c.n)(()=>t?Object(de.a)(l):void 0,[t,l]),{startRecordingVoice:o,pauseRecordingVoice:i,stopRecordingVoice:l,activeVoiceRecording:t,currentRecordTime:n,recordButtonRef:e,startRecordTimeRef:s}})(),tt=i?nn.Edit:!m.o||Qe||ue&&!Se.length||C?nn.Send:nn.Record,at=!t,{isMentionTooltipOpen:st,mentionFilter:nt,closeMentionTooltip:ct,insertMention:rt,mentionFilteredUsers:ot}=Object(Ns.a)(!Se.length,ue,Oe,void 0,T,A,P,R),{isOpen:it,id:lt,isGallery:dt,switchPm:bt,results:ut,closeTooltip:ht,help:Ot,loadMore:jt}=Rs(Boolean(!Se.length&&L),d,ue,G),{isContextMenuOpen:gt,handleContextMenu:pt,handleContextMenuClose:ft,handleContextMenuHide:It}=Object(Dt.a)(Xe,!(tt===nn.Send&&at)),vt=Object(c.p)(()=>Object(l.b)(j,p),[j,p]),yt=j&&Object(l.jb)(j),Ct=Object(l.j)(j),{isStickerTooltipOpen:Et,closeStickerTooltip:wt}=function(e,t,a,n=!1){const{loadStickersForEmoji:r,clearStickersForEmoji:o}=Object(s.d)(),i=m.d&&1===Object(Ss.a)(t)||!m.d&&Boolean(t.match(/^]*?>$/g)),l=Boolean(a)&&i;return Object(c.n)(()=>{n||(e&&i?r({emoji:t}):!l&&i||o())},[t,i,o,r,e,n]),{isStickerTooltipOpen:l,closeStickerTooltip:o}}(Boolean(D&&vt.canSendStickers&&!Se.length),ue,N,!r),{isEmojiTooltipOpen:Mt,closeEmojiTooltip:St,filteredEmojis:kt,insertEmoji:Nt}=Object(ks.a)(Boolean(D&&vt.canSendStickers&&!Se.length),ue,q,void 0,Oe,F,U,!r),Tt=Object(c.m)((e,t=n.z)=>{const a=window.getSelection(),s=document.getElementById(t),c=Object(mt.a)(e,["escape_html","emoji_html","br_html"]).join("").replace(/\u200b+/g,"​");if(a.rangeCount){const e=a.getRangeAt(0);if(Object(us.a)(e,t))return function(e){const t=window.getSelection();if(t&&t.getRangeAt&&t.rangeCount){const a=t.getRangeAt(0);a.deleteContents();const s=a.createContextualFragment(e),n=s.lastChild;a.insertNode(s),n?(a.setStartAfter(n),a.setEndAfter(n)):a.collapse(!1),t.removeAllRanges(),t.addRange(a)}}(c),void s.dispatchEvent(new Event("input",{bubbles:!0}))}Oe(`${Me.current}${c}`),requestAnimationFrame(()=>{Object(ls.a)(s)})},[]),At=Object(c.m)(()=>{const e=window.getSelection();if(e.rangeCount){const t=e.getRangeAt(0);if(Object(us.a)(t,n.z))return void document.execCommand("delete",!1)}Oe(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 a=t.lastChild;if(a.lastChild)for(;a.lastChild;)a=a.lastChild;const s=a.textContent.length,n=document.createRange(),c=window.getSelection();n.setStart(a,s),n.setEnd(a,s),c.removeAllRanges(),c.addRange(n),document.execCommand("delete",!1);const r=t.innerHTML;return document.body.removeChild(t),r}(Me.current))},[]),Pt=Object(c.m)((e=!1)=>{e||Oe(""),ke([]),wt(),ve(),Ce(void 0),ct(),St(),m.l?setTimeout(()=>De(),350):De()},[wt,ve,ct,St,De]),Rt=Object(ga.a)(d);Object(c.n)(()=>{Rt&&d!==Rt&&(We(),Pt())},[d,Rt,Pt,We]);const xt=((e,t,a,s,r,o)=>{Object(c.n)(()=>{a?(t(Es(a.content.text)),requestAnimationFrame(()=>{const e=document.getElementById(n.z);Object(ls.a)(e,!0)})):t("")},[a,t]);return Object(c.m)(()=>{const{text:t,entities:n}=Object(ds.a)(e.current);a&&(t||Object(l.fb)(a)?(o({messageId:a.id,text:t,entities:n}),s()):r())},[o,a,e,r,s])})(Me,Oe,i,Pt,Ue,$);((e,t,a,s,r,o,i,l,d)=>{const b=Object(c.m)((e,t)=>{r.current.length&&!i?l({chatId:e,threadId:t,draft:Object(ds.a)(r.current)}):d({chatId:e,threadId:t})},[d,i,r,l]),u=Object(c.p)(()=>Object(f.a)(e=>e(),n.y,!1),[t]),h=Object(ga.a)(t),O=Object(ga.a)(a);Object(c.n)(()=>(ws=t,Ms=a,()=>{ws=void 0,Ms=void 0,b(t,a)}),[t,a,b]),Object(c.n)(()=>{t===h&&a===O||e&&(o(Es(e)),m.n||requestAnimationFrame(()=>{const e=document.getElementById(n.z);Object(ls.a)(e,!0)}))},[t,a,e,o,b,h,O]);const j=Object(ga.a)(s);Object(c.n)(()=>{t&&a&&h===t&&O===a&&j!==s&&(s.length?u(()=>{ws===t&&Ms===a&&b(t,a)}):b(t,a))},[t,s,h,j,O,u,a,b]);const g=Object(c.m)(()=>{t&&a&&b(t,a)},[t,a,b]);Object(oe.a)(g),ie(g)})(O,d,u,ue,Me,Oe,i,V,W),((e,t,a)=>{Object(c.n)(()=>{async function s(s){if(!s.clipboardData)return;const c=document.activeElement;if(c&&![n.z,n.A].includes(c.id))return;const{items:r}=s.clipboardData,o=Array.from(r).find(e=>Cs.includes(e.type)),i=o&&o.getAsFile(),l=s.clipboardData.getData("text").substring(0,4096);if(i||l){if(s.preventDefault(),i&&!a){const e=await bs(i.name,i,!0);t(t=>[...t,e])}l&&e(l,c?c.id:void 0)}}return document.addEventListener("paste",s,!1),()=>{document.removeEventListener("paste",s,!1)}},[e,a,t])})(Tt,ke,i);const Lt=Object(c.m)(async(e,t)=>{ke(await Promise.all(e.map(e=>bs(e.name,e,t))))},[]),Bt=Object(c.m)(async(e,t)=>{ke([...Se,...await Promise.all(e.map(e=>bs(e.name,e,t)))])},[Se]),Ft=Object(c.m)(()=>{ke([])},[]),Ut=Object(c.m)(async(e=!1,t)=>{if("connectionStateReady"!==g)return;let a=Se;if(Qe){const e=await We();if(e){const{blob:t,duration:s,waveform:n}=e;a=[await bs("wonderful-voice-message.ogg",t,!1,{voice:{duration:s,waveform:n}})]}}const{text:s,entities:c}=Object(ds.a)(Me.current);if(!a.length&&!s&&!C)return;if(a.length&&s&&s.length>1024){const e=s.length-1024;return void K({data:{message:"CAPTION_TOO_LONG_PLEASE_REMOVE_CHARACTERS",textParams:{"{EXTRA_CHARS_COUNT}":e,"{PLURAL_S}":e>1?"s":""},hasErrorKey:!0}})}const r=document.getElementById(n.z);if(a.length||s){if(Ct&&!yt){const e=Math.floor(Date.now()/1e3)+H,t=je.current&&Math.floor(e-je.current),a=Ct.nextSendDate&&Ct.nextSendDate>e;if(t&&t{Pt()})},[g,Se,Qe,C,H,W,d,Pt,We,K,Ct,yt,z,Y,le]),Ht=Object(c.m)((e,a=!1)=>{e={...e,isPreloadedGlobally:!0},t?(Ce({sticker:e}),Ie()):(z({sticker:e}),requestAnimationFrame(()=>{Pt(a)}))},[t,Ie,z,Pt]),qt=Object(c.m)(e=>{t?(Ce({gif:e}),Ie()):(z({gif:e}),requestAnimationFrame(()=>{Pt(!0)}))},[t,Ie,z,Pt]),Gt=Object(c.m)(e=>{if("connectionStateReady"!==g)return;re({id:e.id,queryId:e.queryId});const t=document.getElementById(n.z);m.e&&t===document.activeElement&&hs(t),W({chatId:d,localOnly:!0}),requestAnimationFrame(()=>{Pt()})},[d,W,g,Pt,re]),_t=Object(c.m)(e=>{t?(Ce({poll:e}),Z(),Ie()):(z({poll:e}),Z())},[Z,Ie,z,t]),zt=Object(c.m)(()=>{t?(Ce({isSilent:!0}),Ie()):Ut(!0)},[Ut,Ie,t]),$t=Object(c.m)((e,t=!1)=>{const{isSilent:a,...s}=ye||{},n=Math.round(Math.max(e.getTime(),Date.now()+6e4)/1e3)+(t?0:H);ye&&0!==Object.keys(s).length?(z({...ye,scheduledAt:n}),requestAnimationFrame(()=>{Pt()})):Ut(!!a,n),ve()},[ve,Ut,Pt,ye,z,H]),Vt=Object(c.m)(()=>{$t(new Date(1e3*n.xb),!0)},[$t]),Wt=Object(c.m)(()=>{ve(),Ce(void 0)},[ve]),Kt=Object(c.m)(e=>{"stickers"===e?(Q({query:""}),J({query:void 0})):(J({query:""}),Q({query:void 0}))},[Q,J]),Qt=Object(c.m)(()=>{const e=document.getElementById(n.z);m.l&&e===document.activeElement?(e.blur(),setTimeout(()=>{Be()},100)):Be()},[Be]),Jt=Object(c.m)(()=>{ae({id:d,threadId:u,type:"scheduled"})},[ae,d,u]);Object(c.n)(()=>{v&&m.l&&De()},[v,De]),Object(c.n)(()=>{r&&(y?ze():setTimeout(()=>{$e()},200))},[y,$e,ze,r]);const Yt=Object(c.m)(()=>{switch(tt){case nn.Send:t?(Qe&&Ke(),Ie()):(Ut(),requestAnimationFrame(()=>{Pt()}));break;case nn.Record:Ve();break;case nn.Edit:xt()}},[tt,Pt,t,Ve,xt,Qe,Ie,Ke,Ut]),Xt=tt===nn.Record&&!vt.canAttachMedia,Zt=Object(ga.a)(i,!0),ea=i||Zt,ta=new Date;ta.setSeconds(0),ta.setMilliseconds(0);const aa=new Date;aa.setFullYear(aa.getFullYear()+1);let sa="SendMessage";switch(tt){case nn.Edit:sa="Save edited message";break;case nn.Record:sa=Xt?"Conversation.DefaultRestrictedMedia":"AccDescrVoiceMessage"}const na=Object(ne.a)("Composer",!y&&"shown",_e&&"hover-disabled"),ca=Object(ne.a)("mobile-symbol-menu-button",!r&&"not-ready",qe?Le&&"menu-opened":Le&&"is-loading"),ra=tt===nn.Edit?xt:t?Ie:Ut;return c.a.createElement("div",{className:na},vt.canAttachMedia&&r&&c.a.createElement(tn.a,{containerId:"#middle-column-portals"},c.a.createElement(Xs,{isOpen:e!==Je.a.None,withQuick:[e,ge].includes(Je.a.QuickFile),onHide:o,onFileSelect:Lt})),c.a.createElement(Js,{attachments:Se,caption:Se.length?ue:"",groupChatMembers:T,currentUserId:P,usersById:R,recentEmojis:q,isReady:r,onCaptionUpdate:Oe,baseEmojiKeywords:F,emojiKeywords:U,addRecentEmoji:ce,onSend:t?Ie:Ut,onFileAppend:Bt,onClear:Ft}),c.a.createElement(Ys,{isOpen:Boolean(E),onClear:Z,onSend:_t}),c.a.createElement(sn,{isOpen:Boolean(w),onClose:te}),c.a.createElement(cn,{isOpen:Boolean(M),onClose:se}),ea&&c.a.createElement(xs,{isOpen:Fe,isSchedule:"scheduled"===h,onClose:He,message:ea}),c.a.createElement(Gs,{isOpen:st,filter:nt,onClose:ct,onInsertUserName:rt,filteredUsers:ot,usersById:R}),c.a.createElement(qs,{isOpen:it,botId:lt,allowedAttachmentOptions:vt,isGallery:dt,inlineBotResults:ut,switchPm:bt,onSelectResult:Gt,loadMore:jt,onClose:ht}),c.a.createElement("div",{id:"message-compose"},c.a.createElement("div",{className:"svg-appendix",ref:be}),c.a.createElement(Qs,null),c.a.createElement(en,{chatId:d,threadId:u,messageText:Se.length?"":ue,disabled:!vt.canAttachEmbedLinks}),c.a.createElement("div",{className:"message-input-wrapper"},m.l?c.a.createElement(fe.a,{className:ca,round:!0,color:"translucent",onClick:Le?De:Qt,ariaLabel:"Choose emoji, sticker or GIF"},c.a.createElement("i",{className:"icon-smile"}),c.a.createElement("i",{className:"icon-keyboard"}),Le&&!qe&&c.a.createElement(we.a,{color:"gray"})):c.a.createElement(Fs,{className:""+(Le?"activated":""),round:!0,faded:!0,color:"translucent",onActivate:Be,ariaLabel:"Choose emoji, sticker or GIF"},c.a.createElement("i",{className:"icon-smile"})),c.a.createElement(Ws.a,{id:"message-input-text",html:Se.length?"":ue,placeholder:Qe&&Ee<=600?"":le("Message"),forcedPlaceholder:Ot,shouldSetFocus:Le,shouldSuppressFocus:m.l&&Le,shouldSuppressTextFormatter:Mt||st||it,onUpdate:Oe,onSend:ra,onSuppressedFocus:De}),_&&Boolean(lt)&&c.a.createElement(we.a,{color:"gray"}),k&&c.a.createElement(fe.a,{round:!0,faded:!0,className:"scheduled-button",color:"translucent",onClick:Jt,ariaLabel:"Open scheduled messages"},c.a.createElement("i",{className:"icon-schedule"})),S&&!Qe&&!i&&c.a.createElement(Fs,{className:""+(Ne?"activated":""),round:!0,faded:!0,color:"translucent",onActivate:Te,ariaLabel:"Open bot command keyboard"},c.a.createElement("i",{className:"icon-bot-command"})),!Qe&&!i&&c.a.createElement(Fs,{className:""+(Pe?"activated":""),round:!0,faded:!0,color:"translucent",onActivate:Re,ariaLabel:"Add an attachment"},c.a.createElement("i",{className:"icon-attach"})),Qe&&Ye&&c.a.createElement("span",{className:"recording-state"},Object(x.i)(Ye-et.current)),c.a.createElement(zs,{isOpen:Et,onStickerSelect:Ht}),c.a.createElement($s.a,{isOpen:Mt,emojis:kt,onClose:St,onEmojiSelect:Nt,addRecentEmoji:ce}),c.a.createElement(Us,{isOpen:Pe,allowedAttachmentOptions:vt,onFileSelect:Lt,onPollCreate:X,onClose:xe}),S&&c.a.createElement(Vs,{messageId:S,isOpen:Ne,onClose:Ae}),c.a.createElement(Hs,{isOpen:Le,allowedAttachmentOptions:vt,onLoad:Ge,onClose:De,onEmojiSelect:Tt,onStickerSelect:Ht,onGifSelect:qt,onRemoveSymbol:At,onSearchOpen:Kt,addRecentEmoji:ce}))),Qe&&c.a.createElement(fe.a,{round:!0,color:"danger",className:"cancel",onClick:We,ariaLabel:"Cancel voice recording"},c.a.createElement("i",{className:"icon-delete"})),c.a.createElement(fe.a,{ref:Xe,round:!0,color:"secondary",className:Object(ne.a)(tt,!r&&"not-ready",Qe&&"recording"),disabled:Xt,ariaLabel:le(sa),onClick:Yt,onContextMenu:tt===nn.Send&&at?pt:void 0},c.a.createElement("i",{className:"icon-send"}),c.a.createElement("i",{className:"icon-microphone-alt"}),c.a.createElement("i",{className:"icon-check"})),at&&c.a.createElement(_s,{isOpen:gt,onSilentSend:I?void 0:zt,onScheduleSend:t?void 0:Ie,onClose:ft,onCloseAnimationEnd:It}),c.a.createElement(an,{isOpen:pe,withTimePicker:!0,selectedAt:ta.getTime(),maxAt:Object(x.k)(aa),isFutureMode:!0,secondButtonLabel:a?"Send When Online":void 0,onClose:Wt,onSubmit:$t,onSecondButtonClick:a?Vt:void 0}))}));var on=Object(c.h)(e=>{const{isActive:t}=e,a=Object(Re.a)(Pe.a.Extra,"MobileSearch",!t,!0);return a?c.a.createElement(a,e):void 0});var ln=Object(c.h)(e=>{const{isActive:t}=e,a=Object(Re.a)(Pe.a.Extra,"MessageSelectToolbar",!t);return a?c.a.createElement(a,e):void 0});var dn=Object(c.h)(e=>{const{isOpen:t}=e,a=Object(Re.a)(Pe.a.Extra,"UnpinAllMessagesModal",!t);return a?c.a.createElement(a,e):void 0});a(255);const bn=m.l?450+n.c:void 0;function un(e){return"file"===e.kind&&e.type&&n.n.has(e.type)}var mn=Object(c.h)(Object(s.h)(e=>{const t=Object(o.Db)(e),{isBlurred:a,background:s,backgroundColor:n,patternColor:c}=e.settings.themes[t]||{},{messageLists:r}=e.messages,i=Object(o.z)(e),{isLeftColumnShown:d,chats:{listIds:u}}=e,h={theme:t,customBackground:s,backgroundColor:n,patternColor:c,isLeftColumnShown:d,isRightColumnShown:Object(o.W)(e),isBackgroundBlurred:a,isMobileSearchActive:Boolean(m.l&&Object(o.B)(e)),isSelectModeActive:Object(o.S)(e),animationLevel:e.settings.byKey.animationLevel,currentTransitionKey:Math.max(0,e.messages.messageLists.length-1)};if(!i||!u.active)return h;const{chatId:O,threadId:j,type:g}=i,p=Object(o.g)(e,O),f=Object(o.kb)(e,O),{chatId:I,messageId:v}=e.audioPlayer,y=p&&Object(l.d)(p,j),C=Object(o.L)(e,O),E="pinned"===g,w="scheduled"===g;return{...h,chatId:O,threadId:j,messageListType:g,isPrivate:Object(l.ob)(O),canPost:!E&&(!p||y)&&!C,isPinnedMessageList:E,isScheduledMessageList:w,currentUserBannedRights:p&&p.currentUserBannedRights,defaultBannedRights:p&&p.defaultBannedRights,hasPinnedOrAudioMessage:j!==b.MAIN_THREAD_ID||Boolean(f&&f.length)||Boolean(I&&v),pinnedMessagesCount:f?f.length:0,shouldSkipHistoryAnimations:e.shouldSkipHistoryAnimations,messageLists:r}},(e,t)=>Object(h.l)(t,["openChat","unpinAllMessages","loadUser","closeLocalTextSearch","exitMessageSelectMode"]))(({chatId:e,threadId:t,messageListType:a,isPrivate:s,isPinnedMessageList:r,messageLists:o,canPost:i,currentUserBannedRights:d,defaultBannedRights:b,hasPinnedOrAudioMessage:u,pinnedMessagesCount:h,customBackground:O,theme:j,backgroundColor:g,patternColor:p,isLeftColumnShown:f,isRightColumnShown:I,isBackgroundBlurred:v,isMobileSearchActive:y,isSelectModeActive:C,animationLevel:E,shouldSkipHistoryAnimations:w,currentTransitionKey:M,openChat:S,unpinAllMessages:k,loadUser:N,closeLocalTextSearch:T,exitMessageSelectMode:A})=>{const{width:P}=et(),R=Object(he.a)(),[x,L]=Object(c.r)(Je.a.None),[B,D]=Object(c.r)(),[F,U]=Object(c.r)(),[H,q]=Object(c.r)(!1),[G,_]=Object(c.r)(!m.l||E===n.f),z=u&&(Pn.lb&&P=n.kb&&Pe?Object(de.a)(()=>{S({id:void 0})}):void 0,[e,S]),Object(c.n)(()=>{L(Je.a.None),D(void 0),U(void 0)},[e]),Object(c.n)(()=>{E===n.f&&_(!0)},[E]);Object(c.n)(()=>{s&&N({userId:e})},[e,s,N]);const Y=Object(c.m)(e=>{if(m.n)return;const{items:t}=e.dataTransfer||{},a=t&&Array.from(t).filter(e=>"text/uri-list"!==e.type).every(un);L(a?Je.a.QuickFile:Je.a.Document)},[]),X=Object(c.m)(()=>{L(Je.a.None)},[]),Z=Object(c.m)(()=>{q(!0)},[]),ee=Object(c.m)(()=>{q(!1)},[]),te=Object(c.m)(()=>{k({chatId:e}),ee(),S({id:e})},[k,S,ee,e]),ae=Object(c.m)(()=>{S({id:e})},[S,e]),se=((e,t)=>{const[a,s]=Object(c.r)(t);return Object(c.n)(()=>{t&&(t.startsWith("#")?s(t):Ye.c(n.o,e,Ye.a.Blob).then(e=>{const t=URL.createObjectURL(e);Object(Xe.g)(t).then(()=>{s(`url(${t})`)})}))},[t,e]),t?a:void 0})(j,O),ce=Object(ne.a)(Q&&"has-header-tools",O&&"custom-bg-image",g&&"custom-bg-color",O&&v&&"blurred",m.q?"mask-image-disabled":"mask-image-enabled"),re=Object(ne.a)("messaging-disabled",!C&&"shown"),oe=Object(l.L)(R,d,b),{composerHiddenScale:ie,toolbarHiddenScale:le,composerTranslateX:be,toolbarTranslateX:me,unpinHiddenScale:Oe,toolbarForUnpinHiddenScale:ge}=Object(c.p)(()=>at(P,K),[K,P]),pe=Object(ne.a)("middle-column-footer",!K&&"no-composer",K&&F&&!C&&"with-notch");return Object(je.a)($&&V,()=>{S({id:void 0},!0)},void 0,void 0,void 0,o?o.map(st):[]),Object(je.a)(y,T),Object(je.a)(C,A),c.a.createElement("div",{id:"MiddleColumn",className:ce,onTransitionEnd:t=>{"transform"===t.propertyName&&t.target===t.currentTarget&&_(Boolean(e))},style:`\n --composer-hidden-scale: ${ie};\n --toolbar-hidden-scale: ${le};\n --unpin-hidden-scale: ${Oe};\n --toolbar-unpin-hidden-scale: ${ge};\n --composer-translate-x: ${be}px;\n --toolbar-translate-x: ${me}px;\n --pattern-color: ${p};\n --theme-background-color:\n ${g||("dark"===j?n.p:n.R)};\n `,onClick:m.m&&f?ae:void 0},c.a.createElement("div",{id:"middle-column-bg",style:se?"--custom-background: "+se:void 0}),c.a.createElement("div",{id:"middle-column-portals"}),$&&V&&c.a.createElement(c.a.Fragment,null,c.a.createElement("div",{className:"messages-layout",onDragEnter:K?Y:void 0},c.a.createElement(wt,{chatId:$,threadId:V,messageListType:W,isReady:G}),c.a.createElement(ue.a,{name:w?"none":E===n.e?"slide":"fade",activeKey:M,shouldCleanup:!0},()=>c.a.createElement(c.a.Fragment,null,c.a.createElement(os,{key:`${$}-${V}-${W}`,chatId:$,threadId:V,type:W,canPost:K,hasTools:Q,onFabToggle:D,onNotchToggle:U,isReady:G}),c.a.createElement("div",{className:pe},K&&c.a.createElement(rn,{chatId:$,threadId:V,messageListType:W,dropAreaState:x,onDropHide:X,isReady:G}),r&&c.a.createElement("div",{className:"unpin-button-container",dir:R.isRtl?"rtl":void 0},c.a.createElement(fe.a,{size:"tiny",fluid:!0,color:"secondary",className:"unpin-all-button",onClick:Z},c.a.createElement("i",{className:"icon-unpin"}),c.a.createElement("span",null,R("Chat.Pinned.UnpinAll",h,"i")))),!r&&!K&&oe&&c.a.createElement("div",{className:re},c.a.createElement("div",{className:"messaging-disabled-inner"},c.a.createElement("span",null,oe))),c.a.createElement(ln,{messageListType:W,isActive:C,canPost:K})))),c.a.createElement(is,{isShown:J,canPost:K})),m.l&&c.a.createElement(on,{isActive:Boolean(y)})),e&&c.a.createElement(dn,{isOpen:H,chatId:e,pinnedMessagesCount:h,onClose:ee,onUnpin:te}))}));a(256);const hn=Object(f.a)(e=>e(),200,!1);var On;!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.ManageGroupUserPermissionsCreate=12]="ManageGroupUserPermissionsCreate",e[e.ManageGroupUserPermissions=13]="ManageGroupUserPermissions",e[e.ManageGroupRecentActions=14]="ManageGroupRecentActions",e[e.ManageGroupAdminRights=15]="ManageGroupAdminRights",e[e.ManageGroupMembers=16]="ManageGroupMembers",e[e.StickerSearch=17]="StickerSearch",e[e.GifSearch=18]="GifSearch",e[e.PollResults=19]="PollResults",e[e.AddingMembers=20]="AddingMembers"}(On||(On={}));var jn=Object(c.h)(Object(s.h)((e,{chatId:t,isProfile:a,isManagement:s})=>{const{query:n}=Object(o.B)(e)||{},{query:c}=Object(o.A)(e)||{},{query:r}=Object(o.t)(e)||{},i=t?Object(o.g)(e,t):void 0,d=i&&Object(l.mb)(i);return{canManage:Boolean(!s&&a&&i&&!Object(o.P)(e,i.id)&&(Object(l.ob)(i.id)||(Object(l.jb)(i)||i.isCreator)&&!i.isNotJoined)),isChannel:d,messageSearchQuery:n,stickerSearchQuery:c,gifSearchQuery:r}},(e,t)=>Object(h.l)(t,["setLocalTextSearchQuery","setStickerSearchQuery","setGifSearchQuery","searchTextMessagesLocal","toggleManagement","openHistoryCalendar"]))(({isColumnOpen:e,isProfile:t,isSearch:a,isManagement:s,isStickerSearch:n,isGifSearch:r,isPollResults:o,isAddingChatMembers:i,profileState:l,managementScreen:d,canManage:b,isChannel:h,onClose:O,messageSearchQuery:j,stickerSearchQuery:g,gifSearchQuery:p,setLocalTextSearchQuery:f,setStickerSearchQuery:I,setGifSearchQuery:v,searchTextMessagesLocal:y,toggleManagement:C,openHistoryCalendar:E,shouldSkipAnimation:w})=>{var M;const S=Object(c.q)(null),k=Object(c.m)(e=>{f({query:e}),e.length&&hn(y)},[y,f]),N=Object(c.m)(e=>{I({query:e})},[I]),T=Object(c.m)(e=>{v({query:e})},[v]),[A,P]=Object(c.r)(!e);Object(c.n)(()=>{setTimeout(()=>{P(!e)},300)},[e]);const R=Object(he.a)(),L=t?l===u.l.Profile?On.Profile:l===u.l.SharedMedia?On.SharedMedia:l===u.l.MemberList?On.MemberList:-1:a?On.Search:o?On.PollResults:n?On.StickerSearch:r?On.GifSearch:i?On.AddingMembers:s?d===u.g.Initial?On.ManageInitial:d===u.g.ChatPrivacyType?On.ManageChatPrivacyType:d===u.g.Discussion?On.ManageDiscussion:d===u.g.ChannelSubscribers?On.ManageChannelSubscribers:d===u.g.GroupPermissions?On.ManageGroupPermissions:d===u.g.ChatAdministrators?On.ManageChatAdministrators:d===u.g.GroupRemovedUsers?On.ManageGroupRemovedUsers:d===u.g.GroupUserPermissionsCreate?On.ManageGroupUserPermissionsCreate:d===u.g.GroupUserPermissions?On.ManageGroupUserPermissions:d===u.g.GroupRecentActions?On.ManageGroupRecentActions:d===u.g.ChatAdminRights?On.ManageGroupAdminRights:d===u.g.GroupMembers?On.ManageGroupMembers:void 0:void 0,B=null!==(M=Object(rt.a)(L,!0))&&void 0!==M?M:-1;function D(){if(-1!==B)switch(B){case On.PollResults:return c.a.createElement("h3",null,R("PollResults"));case On.Search:return c.a.createElement(c.a.Fragment,null,c.a.createElement(Ie.a,{parentContainerClassName:"RightSearch",value:j,onChange:k}),c.a.createElement(fe.a,{round:!0,size:"smaller",color:"translucent",onClick:()=>E({selectedAt:Object(x.k)(Date.now())}),ariaLabel:"Search messages by date"},c.a.createElement("i",{className:"icon-calendar"})));case On.AddingMembers:return c.a.createElement("h3",null,R("GroupAddMembers"));case On.ManageInitial:return c.a.createElement("h3",null,R("Edit"));case On.ManageChatPrivacyType:return c.a.createElement("h3",null,R(h?"ChannelTypeHeader":"GroupTypeHeader"));case On.ManageDiscussion:return c.a.createElement("h3",null,R("Discussion"));case On.ManageChatAdministrators:return c.a.createElement("h3",null,R("ChannelAdministrators"));case On.ManageGroupRecentActions:return c.a.createElement("h3",null,R("Group.Info.AdminLog"));case On.ManageGroupAdminRights:return c.a.createElement("h3",null,R("EditAdminRights"));case On.ManageGroupPermissions:return c.a.createElement("h3",null,R("ChannelPermissions"));case On.ManageGroupRemovedUsers:return c.a.createElement("h3",null,R("ChannelBlockedUsers"));case On.ManageGroupUserPermissionsCreate:return c.a.createElement("h3",null,R("ChannelAddException"));case On.ManageGroupUserPermissions:return c.a.createElement("h3",null,R("UserRestrictions"));case On.StickerSearch:return c.a.createElement(Ie.a,{value:g,placeholder:R("SearchStickersHint"),onChange:N});case On.GifSearch:return c.a.createElement(Ie.a,{value:p,placeholder:R("SearchGifsTitle"),onChange:T});case On.SharedMedia:return c.a.createElement("h3",null,R("SharedMedia"));case On.ManageChannelSubscribers:return c.a.createElement("h3",null,R("ChannelSubscribers"));case On.MemberList:case On.ManageGroupMembers:return c.a.createElement("h3",null,R("GroupMembers"));default:return c.a.createElement(c.a.Fragment,null,c.a.createElement("h3",null,"Profile"),c.a.createElement("section",{className:"tools"},b&&c.a.createElement(fe.a,{round:!0,color:"translucent",size:"smaller",ariaLabel:R("Edit"),onClick:C},c.a.createElement("i",{className:"icon-edit"}))))}}const F=m.l||L===On.SharedMedia||L===On.MemberList||L===On.AddingMembers||s,U=Object(ne.a)("animated-close-icon",(A||w)&&"no-transition");return Object(c.n)(()=>{S.current.classList.toggle("state-back",F)},[F]),c.a.createElement("div",{className:"RightHeader"},c.a.createElement(fe.a,{className:"close-button",round:!0,color:"translucent",size:"smaller",onClick:O,ariaLabel:R(F?"Common.Back":"Common.Close")},c.a.createElement("div",{ref:S,className:U})),c.a.createElement(ue.a,{name:A||w?"none":"slide-fade",activeKey:B},D))})),gn=a(133);function pn(e,t,a,s,r,o,i,d,b,u,m,h=0){const O="members"!==s&&r?r:s,j=Object(c.p)(()=>{if(o&&i)return Object(l.Jb)(o.map(({userId:e})=>e),i,void 0,h)},[o,h,i]),[g,p,f]=function(e,t,a,s){const[c,r]=Object(gn.a)(a?t:void 0,s,void 0,n.cb),o=!c||!s||c[0]===s[0];return[c,r,!o]}(0,t,m,j),[I,v,y]=fn("media",O,a,m,d,b),[C,E,w]=fn("documents",O,a,m,d,b),[M,S,k]=fn("links",O,a,m,d,b),[N,T,A]=fn("audio",O,a,m,d,b);let P,R,x=!1;switch(O){case"members":P=g,R=p,x=f;break;case"media":P=I,R=v,x=y;break;case"documents":P=C,R=E,x=w;break;case"links":P=M,R=S,x=k;break;case"audio":P=N,R=T,x=A}return[O,P,R,x]}function fn(e,t,a,s,r,o){const i=Object(c.q)();Object(le.a)(()=>{t===e&&r&&o&&(i.current=Object(l.w)(r,o,e).reverse())},[r,o,t,e]);const[d,b]=Object(gn.a)(s?a:void 0,i.current,void 0,"media"===e?n.Ab:n.ib);return[d,b,!(!d||!i.current||d[0]===i.current[0])]}const In=Object(f.h)(e=>e(),250,!1);let vn=!1;var yn=a(115),Cn=a(108);var En=a(138),wn=a(200);a(257);var Mn=Object(c.h)(({chat:e,user:t,photo:a,isFirstPhoto:s,isSavedMessages:n,lastSyncTime:r,onClick:o})=>{const i=Object(he.a)(),d=t&&Object(l.sb)(t);function u(s="big",c){if(a&&!c)return`photo${a.id}?size=c`;let r;return n||d||(t?r=Object(l.e)(t,s):e&&(r=Object(l.e)(e,s))),r}const m=u(),h=Object(ht.a)(m,!1,b.ApiMediaFormat.BlobUrl,r),O=Object(ht.a)(!h&&s?u("normal",!0):void 0,!1,b.ApiMediaFormat.BlobUrl,r),j=Object(wn.a)(!h&&a&&a.thumbnail&&a.thumbnail.dataUri),g=h||O||j,p=Object(ga.a)(g);let f="";if(n)f=c.a.createElement("i",{className:"icon-avatar-saved-messages"});else if(d)f=c.a.createElement("i",{className:"icon-avatar-deleted-account"});else if(g)f=c.a.createElement("img",{src:g,className:"avatar-media",alt:"",decoding:"async"});else if(!g&&t){const e=Object(l.bb)(t);f=e?Object(ot.c)(e,2):void 0}else if(!g&&e){const t=Object(l.k)(i,e);f=t&&Object(ot.c)(t,Object(l.ob)(e.id)?2:1)}else f=c.a.createElement("div",{className:"spinner-wrapper"},c.a.createElement(we.a,{color:"white"}));const I=Object(ne.a)("ProfilePhoto","color-bg-"+Object(l.Z)(t||e),n&&"saved-messages",d&&"deleted-account",!n&&!g&&"no-photo");return c.a.createElement("div",{className:I,onClick:g?o:void 0},p&&g&&p!==g&&c.a.createElement("img",{src:p,className:"prev-avatar-media",alt:"",decoding:"async"}),"string"==typeof f?Object(mt.a)(f,["hq_emoji"]):f)});a(258);var Sn=Object(c.h)(Object(s.h)((e,{userId:t,forceShowSelf:a})=>{const{lastSyncTime:s,serverTimeOffset:n}=e,c=Object(o.Jb)(e,t),r=Object(o.g)(e,t),i=!a&&c&&c.isSelf,{animationLevel:l}=e.settings.byKey;return{lastSyncTime:s,user:c,chat:r,isSavedMessages:i,animationLevel:l,serverTimeOffset:n}},(e,t)=>Object(h.l)(t,["loadFullUser","openMediaViewer"]))(({user:e,chat:t,isSavedMessages:a,lastSyncTime:s,animationLevel:n,loadFullUser:r,openMediaViewer:o,serverTimeOffset:i})=>{const{id:d}=e||{},{id:h}=t||{},O=e?Object(l.bb)(e):t?t.title:"",j=(e?e.photos:t?t.photos:void 0)||[],g=n>=1?"slide":"none",[p,f]=Object(c.r)(0),I=a||j.length<=1||0===p,v=a||j.length<=1||p===j.length-1;Object(c.n)(()=>{p>j.length&&f(Math.max(0,j.length-1))},[p,j.length]);const y=Object(he.a)();Object(c.n)(()=>{s&&d&&r({userId:d})},[d,r,s]),function(e,t,a){Object(c.n)(()=>{t.slice(a,a+4).forEach(e=>{yt.c(`photo${e.id}?size=c`)||yt.b(`photo${e.id}?size=c`,b.ApiMediaFormat.BlobUrl)})},[a,t])}(0,j,p);const C=Object(c.m)(()=>{o({avatarOwnerId:d||h,profilePhotoIndex:p,origin:u.h.ProfileAvatar})},[o,d,h,p]),E=Object(c.m)(()=>{I||f(p-1)},[p,I]),w=Object(c.m)(()=>{v||f(p+1)},[p,v]);if(Object(c.n)(()=>{const e=document.querySelector(".photo-wrapper");if(e)return Object(Se.b)(e,{onSwipe:m.n?(e,t)=>{t===Se.a.Right?E():t===Se.a.Left&&w()}:void 0})},[w,E]),!e&&!t)return;function M(){const s=!a&&j&&j.length>0?j[p]:void 0;return c.a.createElement(Mn,{key:p,user:e,chat:t,photo:s,isSavedMessages:a,isFirstPhoto:I,onClick:C})}const S=e&&e.isVerified||t&&t.isVerified;return c.a.createElement("div",{className:"ProfileInfo",dir:y.isRtl?"rtl":void 0},c.a.createElement("div",{className:"photo-wrapper"},function(){if(!(a||!j||j.length<=1))return c.a.createElement("div",{className:"photo-dashes"},j.map((e,t)=>c.a.createElement("span",{className:"photo-dash "+(t===p?"current":"")})))}(),c.a.createElement(ue.a,{activeKey:p,name:g,className:"profile-slide-container"},M),!I&&c.a.createElement("button",{type:"button",className:"navigation prev","aria-label":y("AccDescrPrevious"),onClick:E}),!v&&c.a.createElement("button",{type:"button",className:"navigation next","aria-label":y("Next"),onClick:w})),c.a.createElement("div",{className:"info",dir:y.isRtl?"rtl":"auto"},a?c.a.createElement("div",{className:"title"},c.a.createElement("h3",{dir:"auto"},y("SavedMessages"))):c.a.createElement("div",{className:"title"},c.a.createElement("h3",{dir:"auto"},O&&Object(mt.a)(O)),S&&c.a.createElement(En.a,null)),!a&&(e?c.a.createElement("div",{className:"status "+(Object(l.Cb)(e)?"online":"")},c.a.createElement("span",{className:"user-status",dir:"auto"},Object(l.cb)(y,e,i))):c.a.createElement("span",{className:"status",dir:"auto"},Object(l.mb)(t)?y("Subscribers",t.membersCount,"i"):y("Members",t.membersCount,"i")))))})),kn=a(171);var Nn=Object(c.h)(Object(s.h)((e,{chatOrUserId:t})=>{const{lastSyncTime:a}=e,s=t?Object(o.g)(e,t):void 0,n=Object(l.ob)(t)?Object(o.Jb)(e,t):void 0,c=s&&Object(l.Hb)(s,Object(o.fb)(e),Object(o.eb)(e));return{lastSyncTime:a,chat:s,user:n,canInviteUsers:s&&!n&&(!Object(l.mb)(s)&&!Object(l.Db)(s,"inviteUsers")||Object(l.p)(s,"inviteUsers")),isMuted:c}},(e,t)=>Object(h.l)(t,["loadFullUser","updateChatMutedState","showNotification"]))(({lastSyncTime:e,user:t,chat:a,forceShowSelf:s,canInviteUsers:n,isMuted:r,loadFullUser:o,showNotification:i,updateChatMutedState:d})=>{const{id:b,fullInfo:u,username:m,phoneNumber:h,isSelf:O}=t||{},{id:j}=a||{},g=Object(he.a)();Object(c.n)(()=>{e&&b&&o({userId:b})},[o,b,e]);const p=Object(c.m)(()=>{d({chatId:j,isMuted:!r})},[j,r,d]);if(!a||a.isRestricted||O&&!s)return;function f(e,t){Object(kn.c)(e),i({message:t+" was copied"})}const I=h&&Object(Na.c)(h),v=Object(l.g)(a),y=u&&u.bio||Object(l.f)(a);return c.a.createElement("div",{className:"ChatExtra"},I&&!!I.length&&c.a.createElement(Cn.a,{icon:"phone",multiline:!0,narrow:!0,ripple:!0,onClick:()=>f(I,g("Phone"))},c.a.createElement("span",{className:"title",dir:"auto"},I),c.a.createElement("span",{className:"subtitle"},g("Phone"))),m&&c.a.createElement(Cn.a,{icon:"mention",multiline:!0,narrow:!0,ripple:!0,onClick:()=>f("@"+m,g("Username"))},c.a.createElement("span",{className:"title",dir:"auto"},Object(mt.a)(m)),c.a.createElement("span",{className:"subtitle"},g("Username"))),y&&!!y.length&&c.a.createElement(Cn.a,{icon:"info",multiline:!0,narrow:!0,isStatic:!0},c.a.createElement("span",{className:"title",dir:"auto"},Object(mt.a)(y,["br","links","emoji"])),c.a.createElement("span",{className:"subtitle"},g(b?"UserBio":"Info"))),(n||!m)&&v&&c.a.createElement(Cn.a,{icon:"mention",multiline:!0,narrow:!0,ripple:!0,onClick:()=>f(v,g("SetUrlPlaceholder"))},c.a.createElement("div",{className:"title"},v),c.a.createElement("span",{className:"subtitle"},g("SetUrlPlaceholder"))),c.a.createElement(Cn.a,{icon:"unmute",ripple:!0,onClick:p},c.a.createElement("span",null,g("Notifications")),c.a.createElement(ye,{id:"group-notifications",label:b?"Toggle User Notifications":"Toggle Chat Notifications",checked:!r,inactive:!0})))})),Tn=a(172),An=a(194),Pn=a(121),Rn=a(116),xn=a(112);var Ln=Object(c.h)(Object(s.h)((e,{userId:t})=>{const a=Object(o.s)(e),s=t&&Object(o.Jb)(e,t);return{chat:a,contactName:s?Object(l.ab)(s):void 0}},(e,t)=>Object(h.l)(t,["deleteChatMember"]))(({isOpen:e,chat:t,userId:a,contactName:s,onClose:n,deleteChatMember:r})=>{const o=Object(he.a)(),i=Object(c.m)(()=>{r({chatId:t.id,userId:a}),n()},[t,r,n,a]);if(t&&a)return c.a.createElement(xn.a,{isOpen:e,onClose:n,onEnter:i,className:"delete",title:o("GroupRemoved.Remove")},c.a.createElement("p",null,Object(mt.a)(o("PeerInfo.Confirm.RemovePeer",s))),c.a.createElement(fe.a,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:i},o("lng_box_remove")),c.a.createElement(fe.a,{className:"confirm-dialog-button",isText:!0,onClick:n},o("Cancel")))}));a(263);const Bn=[{type:"media",title:"SharedMediaTab2"},{type:"documents",title:"SharedFilesTab2"},{type:"links",title:"SharedLinksTab2"},{type:"audio",title:"SharedMusicTab2"}];function Dn(e){return[`.shared-media-transition > div:only-child > .${e}-list > .scroll-item`,`.shared-media-transition > div.active > .${e}-list > .scroll-item`].join(", ")}var Fn=Object(c.h)(Object(s.h)((e,{chatId:t,userId:a})=>{const s=Object(o.g)(e,t),n=Object(o.n)(e,a||t),{currentType:c,resultsByType:r}=Object(o.w)(e)||{},{foundIds:i}=r&&c&&r[c]||{},{byId:d}=e.users,b=s&&Object(l.nb)(s),u=s&&Object(l.mb)(s),m=b||u&&Object(l.jb)(s),h=s&&s.fullInfo&&s.fullInfo.members,O=m&&s&&s.fullInfo&&!s.fullInfo.canViewMembers,j=m&&s&&(Object(l.p)(s,"inviteUsers")||s.isCreator),g=m&&s&&(Object(l.p)(s,"banUsers")||s.isCreator);let p;return a?p=a:Object(l.ob)(t)&&(p=t),{theme:Object(o.Db)(e),isChannel:u,resolvedUserId:p,chatMessages:n,foundIds:i,mediaSearchType:c,hasMembersTab:m,areMembersHidden:O,canAddMembers:j,canDeleteMembers:g,currentUserId:e.currentUserId,isRightColumnShown:Object(o.W)(e),isRestricted:s&&s.isRestricted,lastSyncTime:e.lastSyncTime,serverTimeOffset:e.serverTimeOffset,...m&&h&&{members:h,usersById:d}}},(e,t)=>Object(h.l)(t,["setLocalMediaSearchType","loadMoreMembers","searchMediaMessagesLocal","openMediaViewer","openAudioPlayer","openUserInfo","focusMessage","loadProfilePhotos","setNewChatMembersDialogState"]))(({chatId:e,profileState:t,onProfileStateChange:a,theme:s,isChannel:r,resolvedUserId:o,currentUserId:i,chatMessages:l,foundIds:d,mediaSearchType:h,hasMembersTab:O,areMembersHidden:j,canAddMembers:g,canDeleteMembers:p,members:f,usersById:I,isRightColumnShown:v,isRestricted:y,lastSyncTime:C,setLocalMediaSearchType:E,loadMoreMembers:w,searchMediaMessagesLocal:M,openMediaViewer:S,openAudioPlayer:k,openUserInfo:N,focusMessage:T,loadProfilePhotos:A,setNewChatMembersDialogState:P,serverTimeOffset:R})=>{const x=Object(c.q)(null),L=Object(c.q)(null),B=Object(he.a)(),[D,F]=Object(c.r)(0),[U,H]=Object(c.r)(),q=Object(c.p)(()=>[...O?[{type:"members",title:r?"ChannelSubscribers":"GroupMembers"}]:[],...Bn],[O,r]),G=q[D].type,[_,z,$,V]=pn(0,w,M,G,h,f,I,l,d,0,C,R),W=q.findIndex(({type:e})=>e===_),{handleScroll:K}=function(e,t,a,s){Object(St.a)(([a])=>{if(a&&a!==t){const a=e.current,n=a.querySelector(".TabList");a.scrollTop{vn=!1},350))}},[t,s]),Object(St.a)(([t])=>{if(a!==u.l.Profile||a===t)return;const n=e.current;if(!n)return;const c=n.querySelector(".TabList");!c||c.offsetTop>n.scrollTop||(vn=!0,Object(Rt.a)(n,n.firstElementChild,"start",void 0,2*n.offsetHeight),setTimeout(()=>{vn=!1},350),s(a))},[a]);const n=Object(c.m)(()=>{const a=e.current;if(!a)return;const n=a.querySelector(".TabList");if(!n)return;let c=u.l.Profile;a.scrollTop>=n.offsetTop&&(c="members"===t?u.l.MemberList:u.l.SharedMedia),s(c)},[e,s,t]);return Object(c.n)(()=>{vn||n()},[n,t]),{handleScroll:Object(c.m)(()=>{vn||In(n)},[n])}}(x,G,t,a),{applyTransitionFix:Q,releaseTransitionFix:J}=function(e,t=".Transition.shared-media-transition"){return Object(c.n)(()=>{function a(){const a=e.current,s=a.querySelector(t),n=a.querySelector(".TabList");s&&n&&(s.style.minHeight=a.offsetHeight-n.offsetHeight+"px")}return a(),window.addEventListener("resize",a,!1),()=>{window.removeEventListener("resize",a,!1)}},[e,t]),{applyTransitionFix:Object(c.m)(()=>{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]),releaseTransitionFix:Object(c.m)(()=>{const t=e.current;t.style.overflowY="scroll",t.style.marginRight="0"},[e])}}(x),[Y,X]=(()=>{const[e,t]=Object(c.r)(!1);return[e,Object(c.m)(()=>{t(e=>!e)},[])]})(),Z=Object(c.m)(()=>{J(),X()},[J,X]),ee=Object(c.m)(()=>{P(u.i.InProgress)},[P]);Object(c.n)(()=>{E({mediaType:G})},[E,G]);const te=o||e;Object(c.n)(()=>{C&&A({profileId:te})},[A,te,C]);const ae=Object(c.m)(e=>{S({chatId:te,threadId:b.MAIN_THREAD_ID,messageId:e,origin:u.h.SharedMedia})},[te,S]),se=Object(c.m)(e=>{k({chatId:te,messageId:e})},[te,k]),ne=Object(c.m)(e=>{N({id:e})},[N]),ce=Object(c.m)(e=>{T({chatId:te,messageId:e})},[te,T]),re=Object(c.m)(()=>{H(void 0)},[]);let oe;Object(c.n)(()=>{if(L.current&&m.n)return Object(Se.b)(L.current,{onSwipe:(e,t)=>{t===Se.a.Left?F(Math.min(D+1,q.length-1)):t===Se.a.Right&&F(Math.max(0,D-1))}})},[D,q.length]);const ie="members"===_||!O&&"media"===_;ie?oe=v?0:1e3:z||(oe=n.Bb);const le=Object(Ks.a)([e,_],oe);function de(e){return e!==i&&p?[{title:B("lng_context_remove_from_group"),icon:"stop",handler:()=>{H(e)}}]:void 0}function be(){if(!z||!le||!l){const e=ie&&z&&!le;return c.a.createElement("div",{className:"content empty-list"},!e&&c.a.createElement(we.a,null))}if(!z.length){let e;switch(_){case"members":e=j?"You have no access to group members list.":"No members found";break;case"documents":e=B("lng_media_file_empty_search");break;case"links":e=B("lng_media_link_empty_search");break;case"audio":e=B("lng_media_song_empty_search");break;default:e=B("SharedMedia.EmptyTitle")}return c.a.createElement("div",{className:"content empty-list"},c.a.createElement(Pn.a,{text:e}))}return c.a.createElement("div",{className:`content ${_}-list`,dir:B.isRtl&&"media"===_?"rtl":void 0,teactFastList:!0},"media"===_?z.map(e=>l[e]&&c.a.createElement(Tn.a,{key:e,message:l[e],onClick:ae})):"documents"===_?z.map(e=>l[e]&&c.a.createElement(ca.a,{key:e,message:l[e],withDate:!0,smaller:!0,className:"scroll-item",onDateClick:ce})):"links"===_?z.map(e=>l[e]&&c.a.createElement(An.a,{key:e,message:l[e],onMessageClick:ce})):"audio"===_?z.map(e=>l[e]&&c.a.createElement(ra.a,{key:e,theme:s,message:l[e],target:"sharedMedia",date:l[e].date,lastSyncTime:C,className:"scroll-item",onPlay:se,onDateClick:ce})):"members"===_?z.map((e,t)=>c.a.createElement(Cn.a,{key:e,teactOrderKey:t,className:"chat-item-clickable scroll-item",onClick:()=>ne(e),contextActions:de(e)},c.a.createElement(it.a,{userId:e,forceShowSelf:!0}))):void 0)}return c.a.createElement(yn.a,{ref:x,className:"Profile custom-scroll",itemSelector:Dn(_),items:le?z:void 0,cacheBuster:Y,sensitiveArea:n.qb,preloadBackwards:le?"members"===_?n.cb:n.Ab:0,noScrollRestoreOnTop:!0,noFastList:!0,onLoadMore:$,onScroll:K},!V&&function(e,t){return c.a.createElement("div",{className:"profile-info"},c.a.createElement(Sn,{userId:t||e,forceShowSelf:t!==e}),c.a.createElement(Nn,{chatOrUserId:t||e,forceShowSelf:t!==e}))}(e,o),!y&&c.a.createElement("div",{className:"shared-media"},c.a.createElement(ue.a,{ref:L,name:B.isRtl?"slide-reversed":"slide",activeKey:W,renderCount:q.length,shouldRestoreHeight:!0,className:"shared-media-transition",onStart:Q,onStop:Z},be),c.a.createElement(Ne.a,{big:!0,activeTab:D,tabs:q,onSwitchTab:F})),g&&c.a.createElement(Rn.a,{isShown:"members"===_,onClick:ee,ariaLabel:B("lng_channel_add_users")},c.a.createElement("i",{className:"icon-add-user-filled"})),p&&c.a.createElement(Ln,{isOpen:Boolean(U),userId:U,onClose:re}))}));var Un=Object(c.h)(e=>{const t=Object(Re.a)(Pe.a.Extra,"RightSearch");return t?c.a.createElement(t,e):c.a.createElement(xe.a,null)});var Hn=Object(c.h)(e=>{const t=Object(Re.a)(Pe.a.Extra,"Management");return t?c.a.createElement(t,e):c.a.createElement(xe.a,null)});var qn=Object(c.h)(()=>{const e=Object(Re.a)(Pe.a.Extra,"StickerSearch");return e?c.a.createElement(e,null):c.a.createElement(xe.a,null)});var Gn=Object(c.h)(()=>{const e=Object(Re.a)(Pe.a.Extra,"GifSearch");return e?c.a.createElement(e,null):c.a.createElement(xe.a,null)});var _n=Object(c.h)(()=>{const e=Object(Re.a)(Pe.a.Extra,"PollResults");return e?c.a.createElement(e,null):c.a.createElement(xe.a,null)}),zn=a(173);a(264);var $n=Object(c.h)(Object(s.h)((e,{chatId:t})=>{const a=Object(o.g)(e,t),{userIds:s}=e.contactList||{},{byId:n}=e.users,{byId:c}=e.chats,{currentUserId:r,newChatMembersProgress:i,connectionState:d}=e,b=a&&Object(l.mb)(a),{query:m,fetchingStatus:h,globalUserIds:O,localUserIds:j}=e.userSearch;return{isChannel:b,members:a&&a.fullInfo?a.fullInfo.members:void 0,currentUserId:r,usersById:n,chatsById:c,localContactIds:s,searchQuery:m,isSearching:h,isLoading:i===u.i.Loading,globalUserIds:O,localUserIds:j,connectionState:d}},(e,t)=>Object(h.l)(t,["loadContactList","setUserSearchQuery"]))(({isChannel:e,connectionState:t,members:a,onNextStep:s,currentUserId:n,usersById:r,chatsById:o,localContactIds:i,isLoading:d,searchQuery:b,isSearching:u,localUserIds:m,globalUserIds:O,setUserSearchQuery:j,onClose:g,isActive:p,loadContactList:f})=>{const I=Object(he.a)(),[v,y]=Object(c.r)([]),C=Object(ga.a)(v)===v;Object(c.n)(()=>{p&&"connectionStateReady"===t&&f()},[t,p,f]),Object(je.a)(p,g);const E=Object(c.p)(()=>a?a.map(e=>e.userId):[],[a]),w=Object(c.m)(e=>{j({query:e})},[j]),M=Object(c.p)(()=>{const t=i?Object(l.Ib)(i.filter(e=>e!==n),o):[];if(!b)return t.filter(e=>!E.includes(e));const a=t.filter(e=>{const t=r[e];if(!t)return!1;const a=Object(l.bb)(t);return a&&Object(A.a)(a,b)});return Object(l.Ib)(Object(h.o)([...a,...m||[],...O||[]]).filter(t=>{const a=r[t];return!E.includes(t)&&(!a||!Object(l.Bb)(a)||!e&&a.canBeInvitedToGroup)}),o)},[i,o,b,m,O,n,r,E,e]),S=Object(c.m)(()=>{v.length&&(j({query:""}),s(v))},[v,j,s]);return c.a.createElement("div",{className:"AddChatMembers"},c.a.createElement("div",{className:"AddChatMembers-inner"},c.a.createElement(zn.a,{itemIds:M,selectedIds:v,filterValue:b,filterPlaceholder:I("lng_channel_add_users"),searchInputId:"new-members-picker-search",isLoading:u,onSelectedIdsChange:y,onFilterChange:w,noScrollRestore:C}),c.a.createElement(Rn.a,{isShown:Boolean(v.length),disabled:d,ariaLabel:I("lng_channel_add_users"),onClick:S},d?c.a.createElement(we.a,{color:"white"}):c.a.createElement("i",{className:"icon-arrow-right"}))))}));a(265);const Vn=Object.keys(u.m).length/2,Wn=Object.keys(u.g).length/2;function Kn(){const e=document.querySelector(".RightHeader .SearchInput input");e&&e.blur()}var Qn=Object(c.h)(Object(s.h)(e=>{const{chatId:t,threadId:a}=Object(o.z)(e)||{},s=Object(o.d)(e);return{contentKey:Object(o.pb)(e),chatId:t,threadId:a,currentProfileUserId:e.users.selectedId,isChatSelected:Boolean(t&&s),shouldSkipHistoryAnimations:e.shouldSkipHistoryAnimations}},(e,t)=>Object(h.l)(t,["openUserInfo","toggleChatInfo","toggleManagement","closeLocalTextSearch","setStickerSearchQuery","setGifSearchQuery","closePollResults","addChatMembers","setNewChatMembersDialogState"]))(({contentKey:e,chatId:t,threadId:a,currentProfileUserId:s,isChatSelected:r,toggleChatInfo:o,toggleManagement:i,openUserInfo:l,closeLocalTextSearch:d,setStickerSearchQuery:b,setGifSearchQuery:m,closePollResults:h,addChatMembers:O,setNewChatMembersDialogState:j,shouldSkipHistoryAnimations:g})=>{var p;const{width:f}=et(),[I,v]=Object(c.r)(u.l.Profile),[y,C]=Object(c.r)(u.g.Initial),[E,w]=Object(c.r)(),[M,S]=Object(c.r)(),k=I!==u.l.Profile,N=void 0!==e,T=e===u.m.ChatInfo||e===u.m.UserInfo,A=e===u.m.Search,P=e===u.m.Management,R=e===u.m.StickerSearch,x=e===u.m.GifSearch,L=e===u.m.PollResults,B=e===u.m.AddingMembers,D=f<=n.lb,[F,U]=Object(c.r)(!N),H=null!==(p=Object(rt.a)(e,!0,!r))&&void 0!==p?p:-1,q=Object(c.m)((t=!0)=>{switch(e){case u.m.AddingMembers:j(u.i.Closed);break;case u.m.ChatInfo:if(k&&t){v(u.l.Profile);break}o(void 0,!0);break;case u.m.UserInfo:if(k&&t){v(u.l.Profile);break}l({id:void 0},!0);break;case u.m.Management:switch(y){case u.g.Initial:i();break;case u.g.ChatPrivacyType:case u.g.Discussion:case u.g.GroupPermissions:case u.g.GroupType:case u.g.ChatAdministrators:case u.g.ChannelSubscribers:case u.g.GroupMembers:C(u.g.Initial);break;case u.g.GroupUserPermissionsCreate:case u.g.GroupRemovedUsers:case u.g.GroupUserPermissions:C(u.g.GroupPermissions),w(void 0),S(void 0);break;case u.g.ChatAdminRights:case u.g.GroupRecentActions:C(u.g.ChatAdministrators)}break;case u.m.Search:Kn(),d();break;case u.m.StickerSearch:Kn(),b({query:void 0});break;case u.m.GifSearch:Kn(),m({query:void 0});break;case u.m.PollResults:h()}},[e,k,o,l,h,j,y,i,d,b,m]),G=Object(c.m)((e,t)=>{w(e),S(t)},[]),_=Object(c.m)(e=>{O({chatId:t,memberIds:e})},[O,t]);function z(e){if(-1!==H)switch(H){case u.m.AddingMembers:return c.a.createElement($n,{chatId:t,onNextStep:_,isActive:N&&e,onClose:q});case u.m.ChatInfo:case u.m.UserInfo:return c.a.createElement(Fn,{key:s||t,chatId:t,userId:s,profileState:I,onProfileStateChange:v});case u.m.Search:return c.a.createElement(Un,{chatId:t,threadId:a,onClose:q,isActive:N&&e});case u.m.Management:return c.a.createElement(Hn,{chatId:t,currentScreen:y,isPromotedByCurrentUser:M,selectedChatMemberId:E,onScreenSelect:C,onChatMemberSelect:G,isActive:N&&e,onClose:q});case u.m.StickerSearch:return c.a.createElement(qn,{onClose:q,isActive:N&&e});case u.m.GifSearch:return c.a.createElement(Gn,{onClose:q,isActive:N&&e});case u.m.PollResults:return c.a.createElement(_n,{onClose:q,isActive:N&&e})}}return Object(c.n)(()=>N?Object(de.a)(q):void 0,[N,q]),Object(c.n)(()=>{setTimeout(()=>{U(!N)},300)},[N]),Object(c.n)(()=>{N&&D&&q()},[D]),Object(Mt.a)(([a,s])=>{(a===u.m.ChatInfo&&e===u.m.UserInfo||a===u.m.UserInfo&&e===u.m.ChatInfo||s!==t)&&(v(u.l.Profile),C(u.g.Initial))},[e,t]),Object(je.a)(r&&(e===u.m.ChatInfo||e===u.m.UserInfo||e===u.m.Management||e===u.m.AddingMembers),()=>q(!1),o),c.a.createElement("div",{id:"RightColumn-wrapper",className:r?void 0:"is-hidden"},D&&c.a.createElement("div",{className:"overlay-backdrop",onClick:q}),c.a.createElement("div",{id:"RightColumn"},c.a.createElement(jn,{chatId:t,isColumnOpen:N,isProfile:T,isSearch:A,isManagement:P,isStickerSearch:R,isGifSearch:x,isPollResults:L,isAddingChatMembers:B,profileState:I,managementScreen:y,onClose:q,shouldSkipAnimation:F||g}),c.a.createElement(ue.a,{name:F||g?"none":"zoom-fade",renderCount:Vn+Wn,activeKey:P?Vn+y:H,shouldCleanup:!0,cleanupExceptionKey:u.m.ChatInfo},z)))}));var Jn=Object(c.h)(({isOpen:e})=>{const t=Object(Re.a)(Pe.a.Extra,"MediaViewer",!e);return t?c.a.createElement(t,null):void 0});var Yn=Object(c.h)(({isOpen:e})=>{const t=Object(Re.a)(Pe.a.Extra,"Notifications",!e);return t?c.a.createElement(t,null):void 0});var Xn=Object(c.h)(({isOpen:e})=>{const t=Object(Re.a)(Pe.a.Extra,"Dialogs",!e);return t?c.a.createElement(t,null):void 0});var Zn=Object(c.h)(e=>{const{isOpen:t}=e,a=Object(Re.a)(Pe.a.Extra,"ForwardPicker",!t);return a?c.a.createElement(a,e):void 0});var ec=Object(c.h)(e=>{const{url:t}=e,a=Object(Re.a)(Pe.a.Extra,"SafeLinkModal",!t);return a?c.a.createElement(a,e):void 0});var tc=Object(c.h)(e=>{const{isOpen:t}=e,a=Object(Re.a)(Pe.a.Extra,"HistoryCalendar",!t);return a?c.a.createElement(a,e):void 0});a(266);let ac,sc=!1;function nc(e){document.querySelectorAll('link[rel="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 cc(e){document.title!==e&&(document.title=e)}var rc=Object(c.h)(Object(s.h)(e=>{const{chatId:t,messageId:a}=e.audioPlayer,s=t&&a?Object(o.l)(e,t,a):void 0;return{animationLevel:e.settings.byKey.animationLevel,lastSyncTime:e.lastSyncTime,isLeftColumnShown:e.isLeftColumnShown,isRightColumnShown:Object(o.W)(e),isMediaViewerOpen:Object(o.T)(e),isForwardModalOpen:Object(o.R)(e),hasNotifications:Boolean(e.notifications.length),hasDialogs:Boolean(e.dialogs.length),audioMessage:s,safeLinkModalUrl:e.safeLinkModalUrl,isHistoryCalendarOpen:Boolean(e.historyCalendarSelectedAt),shouldSkipHistoryAnimations:e.shouldSkipHistoryAnimations,language:e.settings.byKey.language}},(e,t)=>Object(h.l)(t,["loadAnimatedEmojis","loadNotificationSettings","loadNotificationExceptions","updateIsOnline","loadTopInlineBots","loadEmojiKeywords"]))(({lastSyncTime:e,isLeftColumnShown:t,isRightColumnShown:a,isMediaViewerOpen:r,isForwardModalOpen:i,animationLevel:l,hasNotifications:d,hasDialogs:b,audioMessage:u,safeLinkModalUrl:m,isHistoryCalendarOpen:h,shouldSkipHistoryAnimations:O,language:j,loadAnimatedEmojis:g,loadNotificationSettings:p,loadNotificationExceptions:I,updateIsOnline:v,loadTopInlineBots:y,loadEmojiKeywords:C})=>{n.r&&!sc&&(sc=!0,console.log(">>> RENDER MAIN")),Object(c.n)(()=>{e&&(v(!0),g(),p(),I(),y(),C({language:n.j}),j!==n.j&&C({language:j}))},[e,g,I,p,v,y,C,j]);const{transitionClassNames:E}=Object(re.a)(!t,void 0,!0,void 0,O),{transitionClassNames:w}=Object(re.a)(a,void 0,!0,void 0,O),M=Object(ne.a)(E.replace(/([\w-]+)/g,"middle-column-$1"),w.replace(/([\w-]+)/g,"right-column-$1"),O&&"history-animation-disabled");Object(le.a)(([e])=>{if(void 0===e||0===l)return;const t=Object(se.d)();Object(ce.b)(document.getElementById("MiddleColumn"),t)},[t]),Object(le.a)(([e])=>{if(void 0===e||0===l)return;Object(f.b)(()=>{document.body.classList.add("animating-right-column")});const t=Object(se.d)();Object(ce.b)(document.getElementById("RightColumn"),()=>{t(),Object(f.b)(()=>{document.body.classList.remove("animating-right-column")})})},[a]);const S=Object(c.m)(()=>{v(!1);const e=Object(o.r)(Object(s.e)());let t=0;clearInterval(ac),ac=window.setInterval(()=>{if(document.title.includes(n.L))nc(!1);else{if(t%2==0){const t=Object(o.r)(Object(s.e)())-e;t>0&&(cc(`${t} notification${t>1?"s":""}`),nc(!0))}else cc(n.pb),nc(!1);t++}},1e3)},[v]),k=Object(c.m)(()=>{v(!0),clearInterval(ac),ac=void 0,document.title.includes(n.L)||cc(n.pb),nc(!1)},[v]);function N(e){e.preventDefault(),e.stopPropagation()}return Object(oe.a)(S,k),ie(S),c.a.createElement("div",{id:"Main",className:M,onDrop:N,onDragOver:N},c.a.createElement(Qe,null),c.a.createElement(mn,null),c.a.createElement(Qn,null),c.a.createElement(Jn,{isOpen:r}),c.a.createElement(Zn,{isOpen:i}),c.a.createElement(Yn,{isOpen:d}),c.a.createElement(Xn,{isOpen:b}),u&&c.a.createElement(Et,{key:u.id,message:u,noUi:!0}),c.a.createElement(ec,{url:m}),c.a.createElement(tc,{isOpen:h}))}));n.r&&console.log(">>> FINISH LOAD MAIN BUNDLE"),Object(s.e)().connectionState||Object(s.d)().initApi()},206:function(e,t,a){},207:function(e,t,a){},208:function(e,t,a){},221:function(e,t,a){},222:function(e,t,a){},223:function(e,t,a){},226:function(e,t,a){},227:function(e,t,a){},228:function(e,t,a){},232:function(e,t,a){},233:function(e,t,a){},234:function(e,t,a){},237:function(e,t,a){},238:function(e,t,a){},239:function(e,t,a){},240:function(e,t,a){},241:function(e,t,a){},242:function(e,t,a){},243:function(e,t,a){},244:function(e,t,a){},245:function(e,t,a){},247:function(e,t,a){},248:function(e,t,a){},249:function(e,t,a){},250:function(e,t,a){},252:function(e,t,a){},253:function(e,t,a){},254:function(e,t,a){},255:function(e,t,a){},256:function(e,t,a){},257:function(e,t,a){},258:function(e,t,a){},263:function(e,t,a){},264:function(e,t,a){},265:function(e,t,a){},266:function(e,t,a){}}]); -//# sourceMappingURL=4.7cbc0883ea4cc7908cba.js.map \ No newline at end of file diff --git a/dist/4.7cbc0883ea4cc7908cba.js.map b/dist/4.7cbc0883ea4cc7908cba.js.map deleted file mode 100644 index 0d908b54..00000000 --- a/dist/4.7cbc0883ea4cc7908cba.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["webpack:///./src/modules/actions/ui/localSearch.ts","webpack:///./src/modules/actions/ui/chats.ts","webpack:///./src/modules/actions/ui/messages.ts","webpack:///./src/modules/actions/ui/globalSearch.ts","webpack:///./src/modules/actions/ui/stickerSearch.ts","webpack:///./src/modules/actions/ui/users.ts","webpack:///./src/modules/actions/ui/misc.ts","webpack:///./src/modules/actions/ui/payments.ts","webpack:///./src/modules/actions/api/chats.ts","webpack:///./src/modules/actions/api/messages.ts","webpack:///./src/modules/actions/api/symbols.ts","webpack:///./src/modules/actions/api/globalSearch.ts","webpack:///./src/modules/actions/api/sync.ts","webpack:///./src/modules/actions/api/localSearch.ts","webpack:///./src/modules/actions/api/management.ts","webpack:///./src/modules/actions/api/users.ts","webpack:///./src/modules/reducers/bots.ts","webpack:///./src/modules/actions/api/bots.ts","webpack:///./src/modules/actions/api/twoFaSettings.ts","webpack:///./src/modules/actions/api/payments.ts","webpack:///./src/util/requestQuery.ts","webpack:///./src/modules/actions/apiUpdaters/chats.ts","webpack:///./src/modules/actions/apiUpdaters/messages.ts","webpack:///./src/modules/actions/apiUpdaters/users.ts","webpack:///./src/modules/actions/apiUpdaters/symbols.ts","webpack:///./src/modules/actions/apiUpdaters/misc.ts","webpack:///./src/modules/actions/apiUpdaters/settings.ts","webpack:///./src/modules/actions/apiUpdaters/twoFaSettings.ts","webpack:///./src/hooks/useBeforeUnload.ts","webpack:///./src/components/ui/Switcher.tsx","webpack:///./src/components/left/main/LeftMainHeader.tsx","webpack:///./src/components/left/ConnectionState.tsx","webpack:///./src/hooks/useThrottledMemo.ts","webpack:///./src/hooks/useThrottle.ts","webpack:///./src/components/left/main/ChatFolders.tsx","webpack:///./src/components/left/search/LeftSearch.async.tsx","webpack:///./src/components/left/main/ContactList.async.tsx","webpack:///./src/components/left/NewChatButton.tsx","webpack:///./src/components/left/main/LeftMain.tsx","webpack:///./src/hooks/useBrowserOnline.ts","webpack:///./src/components/left/settings/Settings.async.tsx","webpack:///./src/components/left/newChat/NewChat.async.tsx","webpack:///./src/components/left/ArchivedChats.async.tsx","webpack:///./src/components/left/LeftColumn.tsx","webpack:///./src/hooks/useWindowSize.ts","webpack:///./src/components/middle/helpers/calculateMiddleFooterTransforms.ts","webpack:///./src/util/routing.ts","webpack:///./src/components/middle/HeaderMenuContainer.async.tsx","webpack:///./src/components/middle/HeaderActions.tsx","webpack:///./src/hooks/useWebpThumbnail.ts","webpack:///./src/components/middle/PinnedMessageNavigation.tsx","webpack:///./src/components/middle/HeaderPinnedMessage.tsx","webpack:///./src/components/middle/AudioPlayer.tsx","webpack:///./src/components/middle/MiddleHeader.tsx","webpack:///./src/components/middle/helpers/groupMessages.ts","webpack:///./src/components/middle/helpers/preventMessageInputBlur.ts","webpack:///./src/components/middle/hooks/useStickyDates.ts","webpack:///./src/hooks/useDebounce.ts","webpack:///./src/components/middle/hooks/useMessageObservers.ts","webpack:///./src/components/middle/message/helpers/buildContentClassName.ts","webpack:///./src/components/middle/message/helpers/mediaDimensions.ts","webpack:///./src/components/middle/message/helpers/calculateAlbumLayout.ts","webpack:///./src/components/middle/message/helpers/calculateAuthorWidth.ts","webpack:///./src/components/middle/message/hooks/useFocusMessage.ts","webpack:///./src/components/middle/message/ContextMenuContainer.async.tsx","webpack:///./src/components/middle/ActionMessage.tsx","webpack:///./src/components/common/EmbeddedMessage.tsx","webpack:///./src/components/middle/message/MessageMeta.tsx","webpack:///./src/components/middle/message/Sticker.tsx","webpack:///./src/components/middle/message/hooks/useBlurredMediaThumbRef.ts","webpack:///./src/components/middle/message/helpers/getCustomAppendixBg.ts","webpack:///./src/components/middle/message/Photo.tsx","webpack:///./src/hooks/useHeavyAnimationCheckForVideo.ts","webpack:///./src/components/middle/message/hooks/usePauseOnInactive.ts","webpack:///./src/components/middle/message/Video.tsx","webpack:///./src/components/middle/message/Contact.tsx","webpack:///./src/components/ui/CheckboxGroup.tsx","webpack:///./src/components/middle/message/PollOption.tsx","webpack:///./src/components/middle/message/Poll.tsx","webpack:///./src/components/middle/message/WebPage.tsx","webpack:///./src/components/middle/message/Invoice.tsx","webpack:///./src/components/middle/message/hocs/withSelectControl.tsx","webpack:///./src/components/middle/message/Album.tsx","webpack:///./src/components/middle/message/RoundVideo.tsx","webpack:///./src/components/middle/message/InlineButtons.tsx","webpack:///./src/components/middle/message/CommentButton.tsx","webpack:///./src/components/middle/message/Message.tsx","webpack:///./src/components/middle/MessageListContent.tsx","webpack:///./src/components/middle/hooks/useScrollHooks.ts","webpack:///./src/components/middle/ContactGreeting.tsx","webpack:///./src/components/middle/NoMessages.tsx","webpack:///./src/components/middle/MessageList.tsx","webpack:///./src/components/middle/ScrollDownButton.tsx","webpack:///./src/components/middle/composer/helpers/buildAttachment.ts","webpack:///./src/components/middle/composer/helpers/applyIosAutoCapitalizationFix.ts","webpack:///./node_modules/opus-recorder/dist/encoderWorker.min.js","webpack:///./src/util/voiceRecording.ts","webpack:///./src/components/middle/composer/hooks/useClipboardPaste.ts","webpack:///./src/components/middle/composer/helpers/getMessageTextAsHtml.ts","webpack:///./src/components/middle/composer/hooks/useDraft.ts","webpack:///./src/components/middle/composer/hooks/useInlineBotTooltip.ts","webpack:///./src/components/common/DeleteMessageModal.async.tsx","webpack:///./src/components/ui/ResponsiveHoverButton.tsx","webpack:///./src/components/middle/composer/AttachMenu.async.tsx","webpack:///./src/components/middle/composer/SymbolMenu.async.tsx","webpack:///./src/components/middle/composer/InlineBotTooltip.async.tsx","webpack:///./src/components/middle/composer/MentionTooltip.async.tsx","webpack:///./src/components/middle/composer/CustomSendMenu.async.tsx","webpack:///./src/components/middle/composer/StickerTooltip.async.tsx","webpack:///./src/components/middle/composer/BotKeyboardMenu.async.tsx","webpack:///./src/components/middle/composer/ComposerEmbeddedMessage.tsx","webpack:///./src/components/middle/composer/AttachmentModal.async.tsx","webpack:///./src/components/middle/composer/PollModal.async.tsx","webpack:///./src/components/middle/composer/DropArea.async.tsx","webpack:///./src/components/middle/composer/WebPagePreview.tsx","webpack:///./src/components/common/CalendarModal.async.tsx","webpack:///./src/components/payment/PaymentModal.async.tsx","webpack:///./src/components/payment/ReceiptModal.async.tsx","webpack:///./src/components/middle/composer/Composer.tsx","webpack:///./src/components/middle/composer/hooks/useVoiceRecording.ts","webpack:///./src/components/middle/composer/hooks/useStickerTooltip.ts","webpack:///./src/util/insertHtmlInSelection.ts","webpack:///./src/util/deleteLastCharacterOutsideSelection.ts","webpack:///./src/components/middle/composer/hooks/useEditing.ts","webpack:///./src/components/middle/MobileSearch.async.tsx","webpack:///./src/components/middle/MessageSelectToolbar.async.tsx","webpack:///./src/components/common/UnpinAllMessagesModal.async.tsx","webpack:///./src/components/middle/MiddleColumn.tsx","webpack:///./src/hooks/useCustomBackground.ts","webpack:///./src/components/right/RightHeader.tsx","webpack:///./src/components/right/hooks/useProfileViewportIds.ts","webpack:///./src/components/right/hooks/useProfileState.ts","webpack:///./src/components/right/ProfilePhoto.tsx","webpack:///./src/components/right/ProfileInfo.tsx","webpack:///./src/components/right/hooks/usePhotosPreload.ts","webpack:///./src/components/right/ChatExtra.tsx","webpack:///./src/components/right/DeleteMemberModal.tsx","webpack:///./src/components/right/Profile.tsx","webpack:///./src/components/right/hooks/useTransitionFixes.ts","webpack:///./src/hooks/useCacheBuster.ts","webpack:///./src/components/right/RightSearch.async.tsx","webpack:///./src/components/right/management/Management.async.tsx","webpack:///./src/components/right/StickerSearch.async.tsx","webpack:///./src/components/right/GifSearch.async.tsx","webpack:///./src/components/right/PollResults.async.tsx","webpack:///./src/components/right/AddChatMembers.tsx","webpack:///./src/components/right/RightColumn.tsx","webpack:///./src/components/mediaViewer/MediaViewer.async.tsx","webpack:///./src/components/main/Notifications.async.tsx","webpack:///./src/components/main/Dialogs.async.tsx","webpack:///./src/components/main/ForwardPicker.async.tsx","webpack:///./src/components/main/SafeLinkModal.async.tsx","webpack:///./src/components/main/HistoryCalendar.async.tsx","webpack:///./src/components/main/Main.tsx","webpack:///./src/bundles/main.ts"],"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","scrollOffset","messageId","paramName","chatMessages","selectChatMessages","viewportIds","selectViewportIds","lastOwnEditableMessageId","findLast","Boolean","selectAllowedMessageActions","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","audioPlayer","selectIsRightColumnShown","pollResults","voters","window","setTimeout","newGlobal","getGlobal","noHighlight","replyStack","selectReplyStack","pop","focusLastMessage","messageListType","groupedId","groupedChatId","replyMessageId","ids","selectForwardedMessageIdsByGroupId","shouldSwitchChat","clearTimeout","updateFocusedMessage","updateFocusDirection","FocusDirection","Static","includes","direction","Down","Up","loadViewportMessages","fromChatId","messageIds","groupedMessageIds","selectMessageIdsByGroupId","isModalShown","closeMediaViewer","selectedMessages","openForwardMenu","selectCurrentChat","enterMessageSelectMode","childMessageIds","withShift","toggleMessageSelection","shouldShowContextMenuHint","disableContextMenuHint","showNotification","message","IS_TOUCH_ENV","isPollModalOpen","globalSearch","updateGlobalSearch","globalResults","localResults","resultsByType","fetchingStatus","chats","recentlyFoundChatIds","newRecentIds","filter","unshift","content","updateGlobalSearchContent","stickers","search","resultIds","gifs","offsetId","results","updateSelectedUserId","updateUserSearch","globalUserIds","localUserIds","management","byChatId","isActive","IS_SINGLE_COLUMN_LAYOUT","IS_TABLET_COLUMN_LAYOUT","isLeftColumnShown","messageLists","action","emoji","recentEmojis","newEmojis","e","sticker","recent","hash","newStickers","s","notification","newNotifications","notifications","existingNotificationIndex","findIndex","n","splice","push","data","hasErrorKey","getReadableErrorText","newDialogs","dialogs","existingErrorIndex","err","url","safeLinkModalUrl","selectedAt","historyCalendarSelectedAt","payment","isPaymentModalOpen","clearPayment","closeInvoice","runThrottledForLoadChats","throttle","cb","runThrottledForLoadTopChats","runDebouncedForLoadFullChat","debounce","async","loadChats","listType","offsetDate","result","callApi","limit","CHAT_LIST_LOAD_SLICE","archived","withPinned","orderedPinnedIds","serverTimeOffset","chatIds","shift","addUsers","buildCollectionByKey","users","updateChats","updateChatListIds","updateChatListSecondaryInfo","draftsById","map","forEach","replyingToById","isFullyLoaded","loadFullChat","fullInfo","updateChat","openChatByUsername","username","channelPostId","localChat","selectChatByUsername","isMin","previousChat","preloadedChatIds","i","TOP_CHAT_MESSAGES_PRELOAD_LIMIT","pause","byId","listIds","active","currentChatId","pinnedChats","otherChats","prepareChatList","chatToPreload","find","currentUserId","hasUnreadMark","toggleChatUnread","isChatSummaryOnly","requestChatUpdate","user","selectUser","selectThreadTopMessageId","requestThreadInfoUpdate","selectSupportChat","langCode","usernamePostfix","LOCALIZED_TIPS","toUpperCase","TIPS_USERNAME","oldestChat","selectIsChatPinned","sort","chat1","chat2","date","force","isMuted","title","about","photo","memberIds","progress","ChatCreationProgress","InProgress","createdChannel","channelId","accessHash","Complete","Error","getDispatch","createChannel","userId","activeChat","activeChannel","createdChat","createGroupChat","folderId","folder","selectChatFolder","shouldBePinned","pinnedChatIds","includedChatIds","newPinnedIds","pinnedId","newIncludedChatIds","folderUpdate","selectChatListType","isPinned","ARCHIVED_FOLDER_ID","isChatArchived","chatFolders","loadChatFolders","recommendedChatFolders","recommended","loadRecommendedChatFolders","emoticon","maxId","recommendedId","description","newFolder","createChatFolder","Math","max","apply","deleteChatFolder","unreadCount","match","RE_TME_INVITE_LINK","exec","RE_TME_LINK","chatOrChannelPostId","isEnabled","isChatBasicGroup","bannedRights","chatAfterUpdate","members","kickedMembers","isBanned","viewMessages","isUnblocked","m","adminRights","customTitle","adminMembers","isDismissed","updateManagementProgress","ManagementProgress","Promise","all","groups","addedById","reduce","group","addChats","forDiscussionIds","channel","fullChat","isPreHistoryHidden","linkedChatId","activeChatFolder","offset","setNewChatMembersDialogState","NewChatMembersProgress","Loading","Closed","uploadProgressCallbacks","Map","runThrottledForMarkRead","isOutlying","isBudgetPreload","addOffset","LoadMoreDirection","Backwards","Around","round","MESSAGE_LIST_SLICE","Forwards","selectThreadOriginChat","threadInfos","addChatMessagesById","updateOutlyingIds","updateListedIds","updateThreadInfos","listedIds","selectListedIds","outlyingIds","selectOutlyingIds","areSortedArraysIntersecting","historyIds","newViewportIds","getViewportSlice","safeReplaceViewportIds","sourceIds","index","findClosestIndex","indexForDirection","from","to","slice","areSomeLocal","areAllLocal","sendMessage","params","localId","progressCallback","attachment","messageLocalId","has","set","fileUploads","byMessageLocalId","replyingTo","IS_IOS","rafPromise","delete","isRestricted","resolve","loadWithBudget","selectFocusedMessageId","selectRealLastReadId","replyOriginForId","MESSAGE_DELETED","replyMessage","selectChatMessage","updateChatMessage","replyToMessageId","loadMessage","scheduledAt","clearWebPagePreview","value","noWebPage","selectNoWebPage","isSingle","attachments","isGrouped","restParams","text","entities","commonParams","groupedAttachments","split","MAX_MEDIA_FILES_FOR_ALBUM","firstAttachment","restAttachments","Date","now","selectEditingMessage","setEditingId","get","previousLocalId","cancelApiProgress","apiUpdate","draft","replyToMsgId","draftDate","localOnly","selectDraft","isUnpin","isOneSide","isSilent","unpinAllMessages","shouldDeleteForAll","editingId","selectEditingId","selectEditingScheduledId","reason","peer","webPagePreview","loadWebPagePreview","options","option","shouldResetVoters","v","a","offsets","nextOffset","loadPollOptionResults","fromChat","toChat","b","scheduledMessages","historyHash","replaceScheduledMessages","loadScheduledHistory","selectScheduledMessage","loadPinnedMessages","searchThrottled","searchGifs","updateGifSearch","added","addedStickers","updateStickerSets","sets","loadStickerSets","setIds","addedSetIds","loadStickers","stickerSetId","recentStickers","loadRecentStickers","favorite","favoriteStickers","loadFavoriteStickers","greeting","featured","featuredStickers","loadFeaturedStickers","stickerSetAccessHash","stickerSet","selectStickerSet","packs","updateStickerSet","currentEmoji","forEmoji","rebuildStickersForEmoji","replaceAnimatedEmojis","loadAnimatedEmojis","saved","savedGifs","loadSavedGifs","unfave","unfaveSticker","installedDate","language","currentEmojiKeywords","emojiKeywords","isLoading","fromVersion","version","keywords","setsById","searchWords","searchStickers","updateStickersForEmoji","loadStickersForEmoji","searchMessagesGlobal","offsetRate","maxDate","minDate","localResult","chatOrUser","GLOBAL_SEARCH_SLICE","totalCount","nextOffsetId","nextRate","currentSearchQuery","selectCurrentGlobalSearchQuery","updateGlobalSearchFetchingStatus","addMessages","updateGlobalSearchResults","loadAndReplaceArchivedChats","updateUsers","replaceChatListIds","loadAndUpdateUsers","userIds","contactIds","contactList","updatedUsers","loadTopMessages","lastReadInboxMessageId","localChats","localUsers","globalChats","globalUsers","searchChats","timestampPlusDay","foundIds","currentSearch","selectCurrentTextSearch","topMessageId","MESSAGE_SEARCH_SLICE","newFoundIds","updateLocalTextSearchResults","searchTextMessages","peerId","selectCurrentMediaSearchPeerId","selectCurrentMediaSearch","currentType","currentResults","SHARED_MEDIA_SLICE","updateLocalMediaSearchResults","searchSharedMedia","timestamp","searchMessagesByDate","updateManagement","isUsernameAvailable","afterSyncCallback","DEBUG","console","log","savedUsers","savedPrivateChatIds","savedChats","selectedChat","isChatPrivate","selectedChatUser","replaceChats","loadAndReplaceChats","areMessagesLoaded","currentThreadId","draftsByChatId","acc","newCurrentChatId","currentMessageListInfo","threadsById","originChannelId","currentMessageListInfoOrigin","resultOrigin","byIdOrigin","listedIdsOrigin","Array","prototype","concat","replaceUsers","audioChatId","audioMessageId","closeAudioPlayer","loadAndReplaceMessages","lastSyncTime","sync","afterSync","runDebouncedForFetchFullUser","runThrottledForSearch","replaceInlineBotSettings","inlineBotSettings","inlineBots","byUsername","replaceInlineBotsIsLoading","topPeers","lastRequestedAt","usersHash","loadTopUsers","getCompareString","lastName","firstName","collator","Intl","Collator","sortedUsers","compare","isSelf","loadContactList","updateChatMutedState","phone","phoneNumber","updateUser","updateContact","deleteUser","profileId","isPrivate","photos","userSearch","updateUserSearchFetchingStatus","searchUsers","runDebouncedForSearch","sendBotCommand","command","button","openTelegramLink","toggleSafeLinkModal","alert","isError","showDialog","answerCallbackButton","openPollModal","getReceipt","receiptMessageId","getPaymentForm","setInvoiceMessageInfo","openPaymentModal","bot","selectChatBot","removeBlockedContact","topInlineBots","newHash","inlineBotData","inlineBot","switchPm","canLoadMore","shouldReplaceSettings","newInlineBotData","currentIds","Set","newResults","help","isGallery","searchInlineBot","queryId","resultId","replaceSettings","hasPassword","updateTwoFaSettings","hint","currentPassword","onSuccess","error","isSuccess","password","email","waitingEmailCodeLength","code","requestInfo","saveInfo","selectPaymentMessageId","shouldSave","shippingOptions","setRequestInfoId","updateShippingOptions","setPaymentStep","PaymentStep","Shipping","PaymentInfo","validateRequestedInfo","setPaymentForm","step","invoice","shippingAddressRequested","nameRequested","phoneRequested","emailRequested","ShippingInfo","setReceipt","receipt","publishableKey","selectProviderPublishableKey","credentials","k","join","buildQueryString","cardNumber","expiryMonth","expiryYear","cvv","zip","country","response","fetch","method","headers","Authorization","json","getStripeError","setStripeCardInfo","Checkout","sendStipeCredentials","shippingOptionId","saveCredentials","requestInfoId","selectPaymentRequestId","stripeCredentials","selectStripeCredentials","requestedInfoId","sendPaymentForm","save","runThrottledForUpdateAppBadge","update","noTopChatsRequest","selectIsChatListed","loadTopChats","newProfilePhoto","selectCountNotMutedUnread","updateAppBadge","isNotJoined","listId","typingStatus","senderId","isFromScheduled","isActiveChat","hasUnreadMention","unreadMentionsCount","showNewMessageNotification","messageUpdate","selectCommonBoxChatId","targetChat","newOrderedPinnedIds","MAX_ACTIVE_PINNED_CHATS","updateChatListType","chatFoldersById","newChatFoldersById","pick","newOrderedIds","orderedId","folders","replacedMembers","addedMember","deletedMemberId","shouldUpdate","some","deleteIndex","isOwner","isAdmin","membersCount","formattedText","updateWithLocalMedia","isScheduled","currentMessage","video","document","getMessageContent","blobUrl","thumbnail","isPreloadedGlobally","previewBlobUrl","updateScheduledMessage","updateListedAndViewportIds","firstMessageId","selectThreadByMessage","isUnreadChatNotLoaded","isMessageLocal","addViewportId","messagesCount","firstUnreadId","selectFirstUnreadId","updateChatLastMessage","currentLastMessage","findLastMessage","isDeleting","deleteMessages","newLastMessage","threadIdsToUpdate","deleteChatMessages","unique","chatsIdsToUpdate","commonBoxChatId","updateThreadInfo","newMessage","isMessageInCurrentMessageList","isOutgoing","scheduledIds","selectScheduledIds","selectScheduledMessages","deleteChatScheduledMessages","thread","markMessageListRead","currentPinnedIds","selectPinnedIds","newTheadInfo","messagesById","deleteScheduledMessages","pollId","pollUpdate","selectChatMessageByPollId","poll","updatedPoll","updatedResults","isChosen","chosenAnswers","chosenAnswer","chosenAnswerIndex","recentVoterIds","totalVoters","newRecentVoterIds","newTotalVoters","targetOption","targetOptionIndex","updatedOption","votersCount","flushStatusUpdatesThrottled","pendingStatusUpdates","statusUpdate","status","targetUser","isBlocked","addBlockedContact","settings","privacy","key","rules","updateNotifySettings","peerType","shouldShowPreviews","addNotifyException","twoFaSettings","useBeforeUnload","callback","useEffect","onBeforeUnload","memo","name","label","checked","disabled","inactive","noAnimation","onChange","onCheck","handleChange","useCallback","currentTarget","className","buildClassName","ANIMATION_LEVEL_OPTIONS","withGlobal","searchQuery","chatsById","animationLevel","byKey","globalSearchChatId","searchDate","theme","selectTheme","contactsFilter","onSearchQuery","onSelectSettings","onSelectContacts","onSelectArchived","setGlobalSearchChatId","onReset","shouldSkipTransition","openTipsChat","setGlobalSearchDate","setSettingOption","lang","useLang","hasMenu","LeftColumnContent","ChatList","clearedDateSearchParam","clearedChatSearchParam","selectedSearchDate","useMemo","formatDateToString","archivedUnreadChatsCount","values","total","withOtherVersions","location","hostname","MainButton","onTrigger","isOpen","Button","ripple","size","color","onClick","ariaLabel","handleSearchFocus","handleSelectSaved","handleDarkModeToggle","stopPropagation","newTheme","shouldUseSystemTheme","switchTheme","ANIMATION_LEVEL_MAX","handleAnimationLevelChange","newLevel","_","body","classList","toggle","isSearchFocused","GlobalSearch","Contacts","searchInputPlaceholder","DropdownMenu","trigger","footer","APP_NAME","APP_VERSION","MenuItem","icon","toLowerCase","href","FEEDBACK_URL","localStorage","setItem","JSON","stringify","disableHistoryBack","SearchInput","inputId","parentContainerClassName","focused","placeholder","autoComplete","canClose","onFocus","PickerSelectedItem","isMinimized","clickArg","chatOrUserId","dir","isRtl","Spinner","resolverFn","ms","dependencies","runThrottled","noFirst","useThrottle","setValue","useState","isFrozen","freeze","unfreeze","useFlag","useHeavyAnimationCheck","useOnChange","usersById","orderedFolderIds","notifySettings","selectNotifySettings","notifyExceptions","selectNotifyExceptions","foldersDispatch","onScreenSelect","setActiveChatFolder","transitionRef","useRef","displayedFolders","folderCountersById","useThrottledMemo","counters","unreadDialogsCount","hasActiveDialogs","getFolderUnreadDialogs","badgeCount","isBadgeActive","folderTabs","handleSwitchTab","current","captureEvents","onSwipe","SwipeDirection","Left","min","Right","isNotInAllTabRef","captureEscKeyListener","useHistoryBack","handleKeyDown","ctrlKey","shiftKey","startsWith","digit","preventDefault","addEventListener","removeEventListener","shouldRender","shouldRenderPlaceholder","transitionClassNames","useShowTransition","renderCurrentTab","activeFolder","folderType","TabList","tabs","activeTab","onSwitchTab","Transition","ref","activeKey","renderCount","props","LeftSearch","useModuleLoader","Bundles","Extra","ContactList","closeTimeout","isShown","onNewPrivateChat","onNewChannel","onNewGroup","isMenuOpen","setIsMenuOpen","fabClassName","handleMouseEnter","handleMouseLeave","onMouseEnter","onMouseLeave","tabIndex","Menu","positionX","positionY","autoClose","onClose","TRANSITION_RENDER_COUNT","onContentChange","connectionState","isNewChatButtonShown","setIsNewChatButtonShown","isConnecting","isOnline","setIsOnline","navigator","onLine","useBrowserOnline","isMouseInside","handleSelectSettings","Settings","handleSelectContacts","handleSelectNewChannel","NewChannelStep1","handleSelectNewGroup","NewGroupStep1","handleSelectArchived","Archived","autoCloseTimeout","shouldRenderUpdateButton","updateButtonClassNames","handleUpdateClick","isAppOutdated","markIsAppOutdated","timeout","reload","useAppOutdatedCheck","ShowTransition","isCustom","shouldCleanup","cleanupExceptionKey","fluid","pill","NewChat","ContentType","ArchivedChats","RENDER_COUNT","shouldSkipHistoryAnimations","setGlobalSearchQuery","resetChatCreation","loadPasswordInfo","clearTwoFaError","setContent","settingsScreen","setSettingsScreen","SettingsScreens","Main","setContactsFilter","foldersState","useFoldersReducer","lastResetTime","setLastResetTime","contentType","NewChannelStep2","NewChannel","NewGroupStep2","NewGroup","handleReset","forceReturnToChatList","pickerSearchInput","getElementById","blur","EditProfile","Folders","General","Notifications","Privacy","Language","GeneralChatBackground","GeneralChatBackgroundColor","PrivacyPhoneNumber","PrivacyLastSeen","PrivacyProfilePhoto","PrivacyForwarding","PrivacyGroupChats","PrivacyActiveSessions","PrivacyBlockedUsers","TwoFaDisabled","TwoFaEnabled","TwoFaCongratulations","PrivacyPhoneNumberAllowedContacts","PrivacyPhoneNumberDeniedContacts","PrivacyLastSeenAllowedContacts","PrivacyLastSeenDeniedContacts","PrivacyProfilePhotoAllowedContacts","PrivacyProfilePhotoDeniedContacts","PrivacyForwardingAllowedContacts","PrivacyForwardingDeniedContacts","PrivacyGroupChatsAllowedContacts","PrivacyGroupChatsDeniedContacts","TwoFaNewPassword","TwoFaNewPasswordConfirm","TwoFaNewPasswordHint","TwoFaNewPasswordEmail","TwoFaNewPasswordEmailCode","TwoFaChangePasswordCurrent","TwoFaTurnOff","TwoFaRecoveryEmailCurrentPassword","TwoFaChangePasswordNew","TwoFaChangePasswordConfirm","TwoFaChangePasswordHint","TwoFaRecoveryEmail","TwoFaRecoveryEmailCode","FoldersCreateFolder","FoldersEditFolder","FoldersIncludedChatsFromChatList","FoldersExcludedChatsFromChatList","FoldersEditFolderFromChatList","handleSearchQuery","handleSettingsScreenSelect","screen","LAYERS_ANIMATION_NAME","currentScreen","isChannel","setSize","windowSize","handleResize","calculateMiddleFooterTransforms","windowWidth","canPost","sidePadding","MOBILE_SCREEN_MAX_WIDTH","messageListWidth","MIN_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN","leftColumnWidth","rightColumnWidth","MIN_SCREEN_WIDTH_FOR_STATIC_LEFT_COLUMN","getMessageListWidth","sendButtonWidth","composerWidth","toolbarWidth","composerHiddenScale","toolbarHiddenScale","composerTranslateX","toolbarTranslateX","unpinHiddenScale","toolbarForUnpinHiddenScale","createMessageHash","messageList","HeaderMenuContainer","isChatChannel","noMenu","isChatWithSelf","selectIsChatWithSelf","isMainThread","isDiscussionThread","isRightColumnShown","canRestartBot","selectIsUserBlocked","canStartBot","selectIsChatBotNotStarted","canSubscribe","isChatSuperGroup","canSearch","canMute","canSelect","selectIsInSelectMode","canLeave","joinChannel","openLocalTextSearch","restartBot","menuButtonRef","menuPosition","setMenuPosition","handleHeaderMenuOpen","rect","getBoundingClientRect","x","right","y","bottom","handleHeaderMenuClose","handleHeaderMenuHide","handleSubscribeClick","handleStartBot","handleRestartBot","handleSearchClick","querySelector","focus","searchInput","anchor","onSubscribeChannel","onSearchClick","onCloseAnimationEnd","useWebpThumbnail","getMessageMediaThumbDataUri","shouldDecodeThumbnail","isWebpSupported","thumbnailDecoded","setThumbnailDecoded","EMPTY_IMAGE_DATA_URI","useLayoutEffect","webpToPngBase64","then","catch","drawRect","width","height","radius","count","containerRef","markupParams","reverseIndex","barHeight","getBarHeight","markHeight","getMarkHeight","trackHeight","getTrackHeight","clipPathId","clipPath","d","getClipPath","markTranslateY","getMarkTranslateY","trackTranslateY","getTrackTranslateY","calculateMarkup","firstChild","firstElementChild","currentElement","style","transform","svg","div","defs","innerHTML","onUnpinMessage","onAllPinnedClick","mediaThumbnail","mediaBlobUrl","useMedia","getMessageMediaHash","getMessageSummaryText","isUnpinDialogOpen","openUnpinDialog","closeUnpinDialog","handleUnpinMessage","ConfirmDialog","confirmLabel","confirmHandler","thumbDataUri","getPictogramDimensions","src","alt","renderPictogram","renderText","RippleEffect","sender","selectSender","noUi","senderName","getSenderTitle","mediaData","mediaLoader","playPause","isPlaying","useAudioPlayer","getMessageKey","getMediaDuration","handleClick","handleClose","audio","getMessageAudio","performer","fileName","renderAudio","subtitle","renderVoice","audioMessage","pinnedIds","state","isSelectModeActive","isChatWithBot","selectIsChatWithBot","currentTransitionKey","assign","pinnedMessageId","topMessageSender","selectForwardedSender","pinnedMessageIds","canUnpin","firstPinnedMessage","isReady","openChatWithInfo","pinMessage","openPreviousChat","toggleLeftColumn","pinnedMessageIndex","setPinnedMessageIndex","isArray","pinnedMessage","pinnedMessagesCount","chatTitleLength","getChatTitle","topMessageTitle","useEnsureMessage","useWindowSize","isLeftColumnHideable","shouldShowCloseButton","componentRef","shouldAnimateTools","handleHeaderClick","handlePinnedMessageClick","cycleRestrict","handleAllPinnedClick","handleBackClick","messageInput","EDITABLE_INPUT_ID","currentChat","selectIsChatMuted","canToolsCollideWithChatInfo","SAFE_SCREEN_WIDTH_FOR_CHAT_INFO","shouldUseStackedToolsClass","SAFE_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN","shouldRenderAudioPlayer","audioPlayerClassNames","renderingAudioMessage","useCurrentOrPrev","shouldRenderPinnedMessage","pinnedMessageClassNames","renderingPinnedMessage","renderingPinnedMessageTitle","canRevealTools","renderInfo","renderBackButton","PrivateChatInfo","withFullInfo","withMediaViewer","withUpdatingStatus","noRtl","GroupChatInfo","asClose","unreadCountInfo","formatIntegerCompact","componentEl","add","remove","isAlbum","messageOrAlbum","groupMessages","currentAlbum","currentSenderGroup","currentDateGroup","originalDate","datetime","getDayStart","senderGroups","dateGroups","isInAlbum","mainMessage","albumId","nextMessage","nextMessageDayStartsAt","isActionMessage","forwardInfo","senderUserId","hiddenUserName","inlineButtons","preventMessageInputBlur","activeElement","target","useStickyDates","isScrolled","markIsScrolled","runDebounced","shouldRunFirst","shouldRunLast","updateStickyDates","container","hasTools","contains","fastRaf","currentStuck","stuckDateEl","allElements","querySelectorAll","containerTop","scrollTop","el","offsetTop","offsetHeight","top","findStuckDate","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","getMessageText","stretchFactor","finalWidth","finalHeight","isSmall","AlbumRectPart","accumulate","list","initValue","accumulator","item","clamp","num","low","high","calculateContainerSize","layout","styles","dimensions","sides","calculateAlbumLayout","album","ratios","proportions","ratio","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","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","createElement","font","whiteSpace","left","opacity","appendChild","offsetWidth","useFocusMessage","elementRef","isFocused","focusDirection","noFocusHighlight","messagesContainer","closest","fastSmoothScroll","ContextMenuContainer","targetUserIds","targetChatId","targetMessageId","targetMessage","selectIsMessageFocused","focusedMessage","observeIntersection","isEmbedded","appearanceOrder","isLastInList","useOnIntersect","noAppearanceAnimation","markShown","targetUsers","renderActionMessageText","asPlain","isContextMenuOpen","contextMenuPosition","handleBeforeContextMenu","handleContextMenu","handleContextMenuClose","handleContextMenuHide","useContextMenuHandlers","isContextMenuShown","data-message-id","onMouseDown","onContextMenu","EmbeddedMessage","customText","isIntersecting","useIsIntersecting","pictogramId","isRoundVideo","getMessageRoundVideo","senderTitle","outgoingStatus","signature","views","isEdited","formatTime","MessageOutgoingStatus","Sticker","observeIntersectionForPlaying","shouldLoop","isModalOpen","openModal","closeModal","isAnimated","isMemojiSticker","MEMOJI_STICKER_ID","shouldLoad","shouldPlay","mediaHash","getMessageMediaFormat","isMediaLoaded","isAnimationLoaded","markAnimationLoaded","isMediaReady","shouldRenderFullMedia","useTransitionForMedia","getStickerDimensions","thumbClassName","stickerClassName","AnimatedSticker","animationData","play","noLoop","onLoad","fromSticker","useBlurredMediaThumbRef","fullMediaData","useCanvasBlur","IS_CANVAS_FILTER_SUPPORTED","SELECTED_APPENDIX_BACKGROUND","getCustomAppendixBg","inSelectMode","isSelected","img","Image","onload","canvas","ctx","getContext","drawImage","getImageData","getAppendixColorFromImage","Photo","shouldAutoLoad","isInSelectMode","uploadProgress","nonInteractive","shouldAffectAppendix","onCancelUpload","localBlobUrl","isDownloadAllowed","setIsDownloadAllowed","shouldDownload","downloadProgress","useMediaWithDownloadProgress","thumbRef","isUploading","isTransferring","transferProgress","getMediaTransferState","wasDownloadDisabled","usePrevious","shouldRenderSpinner","spinnerClassNames","shouldRenderThumb","isAllowed","contentEl","appendixBg","setProperty","setAttribute","ProgressSpinner","useHeavyAnimationCheckForVideo","playerRef","shouldPlayRef","safePlay","isPlayAllowed","wasPlaying","freezePlaying","paused","unfreezePlaying","unfreezePlayingOnRaf","hasFocus","useBackgroundMode","Video","shouldAutoPlay","videoRef","getMessageWebPageVideo","setIsPlayAllowed","isInline","isBuffered","bufferingHandlers","useBuffering","playProgress","setPlayProgress","handleTimeUpdate","currentTime","duration","usePauseOnInactive","useVideoCleanup","videoClassName","autoPlay","muted","loop","playsInline","onTimeUpdate","isGif","formatMediaDuration","contact","openUserInfo","Avatar","formatPhoneNumberWithCode","selected","loadingOptions","setValues","event","newValues","Checkbox","subLabel","getPercentage","toFixed","PollOption","answer","voteResults","maxVotersCount","correctResults","shouldAnimate","r","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","floor","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","RadioGroup","loadingOption","isQuiz","getReadableVotersCount","isText","inPreview","onMediaClick","onCancelMediaTransfer","webPage","getMessageWebPage","isSquarePhoto","handleMediaClick","siteName","displayUrl","isMediaInteractive","truncatedDescription","trimText","data-initial","SafeLink","getMessageInvoice","photoUrl","withSelectControl","WrappedComponent","ownProps","selectIsMessageSelected","handleMessageSelect","newProps","PhotoWithSelect","VideoWithSelect","uploadsById","hasCustomAppendix","albumLayout","cancelSendingMessage","mediaCount","handleCancelUpload","containerWidth","containerHeight","fileUpload","currentOnRelease","RoundVideo","playingProgressRef","shouldSpinnerRender","isActivated","setIsActivated","setProgress","playerEl","playingProgressEl","stopPlaying","capturePlaying","onRelease","ROUND_VIDEO_DIMENSIONS","onEnded","InlineButtons","shouldRequestThreadUpdate","recentReplierIds","recentRepliers","hasUnread","data-cnt","handleDocumentGroupMouseEnter","lastGroupElement","getLastElementInDocumentGroup","handleDocumentGroupMouseLeave","removeAttribute","nextElementSibling","withSenderName","withAvatar","viaBotId","chatUsername","forceSenderName","isAnonymousOwnMessage","originSender","botSender","threadTopMessageId","isThreadTop","shouldHideReply","replyMessageSender","selectUploadProgress","isForwarding","highlight","singleEmoji","getMessageSingleEmoji","every","isSingleEmoji","animatedEmoji","selectAnimatedEmoji","isGroupSelected","selectIsDocumentGroupSelected","isPinnedList","shouldAutoLoadMedia","selectShouldAutoLoadMedia","shouldAutoPlayMedia","selectShouldAutoPlayMedia","shouldLoopStickers","selectShouldLoopStickers","selectOutgoingStatus","observeIntersectionForBottom","observeIntersectionForMedia","observeIntersectionForAnimatedStickers","noComments","isFirstInGroup","isLastInGroup","isFirstInDocumentGroup","isLastInDocumentGroup","openMediaViewer","openAudioPlayer","markMessagesRead","sendPollVote","clickInlineButton","bottomMarkerRef","appendixRef","isLocal","hasReply","isReplyMessage","hasThread","asForwarded","isLinkedChannelPost","isInDocumentGroup","voice","getMessageCustomShape","textParts","renderMessageText","adminTitle","metaSafeAuthorWidth","canShowActionButton","canForward","canFocus","isChannelPost","fromMessageId","avatarPeer","senderPeer","containerClassName","contentClassName","hasComments","hasActionButton","classNames","isMedia","isMediaWithNoText","isViaBot","isRound","buildContentClassName","withCommentButton","withAppendix","handleGroupDocumentMessagesSelect","handleContainerDoubleClick","handleContentDoubleClick","handleAvatarClick","handleSenderClick","handleViaBotClick","handleReplyClick","MediaViewerOrigin","ScheduledInline","Inline","handleAudioPlay","handleAlbumMediaClick","albumMessageId","ScheduledAlbum","Album","getIsKeyboardVisible","handleReadMedia","handleVoteSend","handleGroupForward","handleForward","handleFocus","handleFocusForwarded","calculatedWidth","noMediaCorners","extraPadding","onDoubleClick","data-last-message-id","data-has-unread-mention","isAvatarPeerUser","avatarUser","avatarChat","hiddenName","renderAvatar","shouldInlineMeta","textContentClass","senderColor","getUserColorKey","renderSenderName","AnimatedEmoji","forceLoadPreview","Audio","isSelectable","onPlay","onReadMedia","Document","renderContent","messageGroups","isViewportNewest","isUnread","withUsers","anchorIdRef","memoFirstUnreadIdRef","hasLinkedChat","isSchedule","onFabToggle","onNotchToggle","openHistoryCalendar","observeIntersectionForReading","observe","useIntersectionObserver","rootRef","throttleMs","margin","freezeForReading","unfreezeForReading","entries","mentionIds","entry","dataset","useMessageObservers","backwardsTriggerRef","forwardsTriggerRef","fabTriggerRef","loadMoreBackwards","loadMoreForwards","toggleScrollTools","scrollHeight","scrollBottom","isAtBottom","MESSAGE_LIST_SENSITIVE_AREA","triggerEntry","resetScroll","observeIntersectionForFab","freezeForFab","unfreezeForFab","observeIntersectionForNotch","freezeForNotch","unfreezeForNotch","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","lastUnreadMessageId","loadGreetingStickers","debounceMs","handleStickerSelect","selectedSticker","StickerButton","isGroupChatJustCreated","renderScheduled","renderSavedMessages","renderGroup","runDebouncedForScroll","checkSingleMessageActionByType","selectCurrentMessageIds","restrictionReason","focusingId","hasFocusHighlight","withLastMessageWhenPreloading","botDescription","chatBot","isChatLoaded","isChannelChat","isGroupChat","isChatGroup","isCreator","isBot","threadFirstMessageId","selectFirstMessageId","setScrollOffset","scrollOffsetRef","selectScrollOffset","anchorTopRef","listItemElementsRef","memoUnreadDividerBeforeIdRef","memoFocusingIdRef","isScrollTopJustUpdatedRef","shouldAnimateAppearanceRef","setContainerHeight","onTickEnd","listedMessages","orderBy","loadMoreAround","handleScroll","parentElement","observer","ResizeObserver","offsetParent","contentRect","disconnect","windowHeight","normalHeight","String","clientHeight","preservedItemElements","useLayoutEffectWithPrevDeps","prevMessageIds","prevIsViewportNewest","prevContainerHeight","shouldForceScroll","lastItemElement","lastItemHeight","newScrollTop","hasFirstMessageChanged","hasLastMessageChanged","isAlreadyFocusing","isResized","isAnimatingScroll","useEffectWithPrevDeps","prevIsSelectModeActive","dispatchHeavyAnimationEvent","shouldRenderGreeting","onScroll","focusNextReply","messageElements","lastMessageElement","buildAttachment","filename","blob","isQuick","URL","createObjectURL","mimeType","quick","preloadImage","newBlob","toBlob","squeezeImage","revokeObjectURL","videoWidth","videoHeight","preloadVideo","createPosterForVideo","resetInput","applyIosAutoCapitalizationFix","inputEl","POLYFILL_OPTIONS","encoderPath","reuseWorker","BLOB_PARAMS","opusRecorderPromise","OpusRecorder","mediaRecorder","init","default","start","analyzerCallback","startMediaRecorder","startedAt","pausedAt","chunks","waveform","ondataavailable","typedArray","releaseAnalyzer","recorder","source","sourceNode","analyser","context","createAnalyser","fftSize","connect","dataLength","frequencyBinCount","dataArray","Uint8Array","isDestroyed","tick","getByteFrequencyData","volume","requestAnimationFrame","subscribeToAnalyzer","stop","reject","onstop","Blob","onerror","delayStop","CLIPBOARD_ACCEPTED_TYPES","getMessageTextAsHtml","tempEl","INLINE_BOT_QUERY_REGEXP","HAS_NEW_LINE","useInlineBotTooltip","html","markIsOpen","unmarkIsOpen","replace","innerText","getPlainText","queryInlineBot","resetInlineBot","canShowHelp","parseStartWithUsernameString","usernameLowered","prevQuery","prevUsername","botId","loadMore","closeTooltip","DeleteMessageModal","openTimeout","isFirstTimeActivation","onActivate","buttonProps","AttachMenu","SymbolMenu","InlineBotTooltip","MentionTooltip","CustomSend","StickerTooltipAsync","StickerTooltip","BotKeyboardMenu","forwardMessageIds","forwardedMessagesCount","exitForwardMode","canAnimate","useAsyncRendering","clearEmbedded","handleMessageClick","AttachmentModal","PollModal","DropArea","RE_LINK","RegExp","RE_LINK_TEMPLATE","messageText","toggleMessageWebPage","link","parseMessageInput","linkEntity","ApiMessageEntityTypes","TextUrl","textMatch","renderingWebPage","webPageWithoutPhoto","messageStub","CalendarModal","PaymentModal","MainButtonState","ReceiptModal","chatUser","selectChatUser","messageWithActualBotKeyboard","selectNewestMessageWithBotKeyboardButtons","baseEmojiKeywords","BASE_EMOJI_KEYWORD_LANG","editingMessage","canScheduleUntilOnline","wasOnline","withScheduledButton","shouldSchedule","botKeyboardMessageId","stickersForEmoji","groupChatMembers","topInlineBotIds","isReceiptModalOpen","shouldSuggestStickers","isInlineBotLoading","dropAreaState","onDropHide","editMessage","saveDraft","clearDraft","setStickerSearchQuery","setGifSearchQuery","closePollModal","closePaymentModal","clearReceipt","addRecentEmoji","sendInlineBotResult","setHtml","lastMessageSendTimeSeconds","prevDropAreaState","isCalendarOpen","openCalendar","closeCalendar","scheduledMessageArgs","setScheduledMessageArgs","htmlRef","setAttachments","isBotKeyboardOpen","openBotKeyboard","closeBotKeyboard","isAttachMenuOpen","openAttachMenu","closeAttachMenu","isSymbolMenuOpen","openSymbolMenu","closeSymbolMenu","isDeleteModalOpen","openDeleteModal","closeDeleteModal","isSymbolMenuLoaded","onSymbolMenuLoadingComplete","isHoverDisabled","disableHover","enableHover","startRecordingVoice","stopRecordingVoice","pauseRecordingVoice","activeVoiceRecording","currentRecordTime","recordButtonRef","mainButtonRef","startRecordTimeRef","setActiveVoiceRecording","setCurrentRecordTime","IS_VOICE_RECORDING_SUPPORTED","voiceRecording","tickVolume","boxShadow","useVoiceRecording","mainButtonState","Edit","Send","Record","canShowCustomSendMenu","isMentionTooltipOpen","mentionFilter","closeMentionTooltip","insertMention","mentionFilteredUsers","useMentionTooltip","isInlineBotTooltipOpen","inlineBotId","isInlineBotTooltipGallery","inlineBotSwitchPm","inlineBotResults","closeInlineBotTooltip","inlineBotHelp","loadMoreForInlineBot","isCustomSendMenuOpen","allowedAttachmentOptions","getAllowedAttachmentOptions","isChatAdmin","slowMode","getChatSlowModeOptions","isStickerTooltipOpen","closeStickerTooltip","isDisabled","clearStickersForEmoji","IS_EMOJI_SUPPORTED","parseEmojiOnlyString","hasStickers","useStickerTooltip","canSendStickers","isEmojiTooltipOpen","closeEmojiTooltip","filteredEmojis","insertEmoji","useEmojiTooltip","insertTextAndUpdateCursor","selection","getSelection","newHtml","rangeCount","selectionRange","getRangeAt","isSelectionInsideInput","range","deleteContents","fragment","createContextualFragment","lastInsertedNode","lastChild","insertNode","setStartAfter","setEndAfter","collapse","removeAllRanges","addRange","insertHtmlInSelection","dispatchEvent","Event","bubbles","focusEditableElement","removeSymbol","execCommand","tempInput","contentEditable","textLength","createRange","setStart","setEnd","removeChild","deleteLastCharacterOutsideSelection","resetComposer","shouldPreserveInput","prevChatId","handleEditComplete","editedMessage","hasMessageMedia","useEditing","updateDraft","draftChatId","draftThreadId","runDebouncedForSaveDraft","DRAFT_DEBOUNCE","prevThreadId","prevHtml","handleBlur","useDraft","handlePaste","clipboardData","input","EDITABLE_INPUT_MODAL_ID","items","media","file","getAsFile","pastedText","getData","substring","useClipboardPaste","handleFileSelect","files","handleAppendFiles","handleClearAttachment","handleSend","currentAttachments","record","extraLength","textParams","nowSeconds","secondsSinceLastMessage","nextSendDateNotReached","nextSendDate","seconds","secondsRemaining","isSlowMode","handleGifSelect","gif","handleInlineBotSelect","inlineResult","handlePollSend","handleSilentSend","handleMessageSchedule","isWhenOnline","restArgs","getTime","handleMessageScheduleUntilOnline","handleCloseCalendar","handleSearchOpen","handleSymbolMenuOpen","handleAllScheduledClick","mainButtonHandler","areVoiceMessagesNotAllowed","canAttachMedia","prevEditedMessage","renderedEditedMessage","scheduledDefaultDate","setSeconds","setMilliseconds","scheduledMaxDate","setFullYear","getFullYear","sendButtonAriaLabel","symbolMenuButtonClassName","onSend","Portal","DropAreaState","None","withQuick","QuickFile","onHide","onFileSelect","caption","onCaptionUpdate","onFileAppend","onClear","onInsertUserName","filteredUsers","onSelectResult","canAttachEmbedLinks","faded","MessageInput","forcedPlaceholder","shouldSetFocus","shouldSuppressFocus","shouldSuppressTextFormatter","onUpdate","onSuppressedFocus","formatVoiceRecordDuration","onStickerSelect","emojis","onEmojiSelect","onPollCreate","onGifSelect","onRemoveSymbol","onSearchOpen","onSilentSend","onScheduleSend","withTimePicker","maxAt","getDayStartAt","isFutureMode","secondButtonLabel","onSubmit","onSecondButtonClick","MobileSearch","MessageSelectToolbar","UnpinAllMessagesModal","CLOSE_ANIMATION_DURATION","canBeQuicklyUploaded","kind","CONTENT_TYPES_FOR_QUICK_UPLOAD","isBlurred","isBackgroundBlurred","background","customBackground","backgroundColor","patternColor","themes","isMobileSearchActive","getCanPostInChat","isBotNotStarted","isPinnedMessageList","isScheduledMessageList","currentUserBannedRights","defaultBannedRights","hasPinnedOrAudioMessage","loadUser","setDropAreaState","isFabShown","setIsFabShown","isNotchShown","setIsNotchShown","isUnpinModalOpen","setIsUnpinModalOpen","setIsReady","ANIMATION_LEVEL_MIN","renderingChatId","usePrevDuringAnimation","renderingThreadId","renderingMessageListType","renderingCanPost","renderingHasTools","renderingIsFabShown","handleDragEnter","dataTransfer","shouldDrawQuick","handleHideDropArea","handleOpenUnpinModal","closeUnpinModal","handleUnpinAllMessages","handleTabletFocus","customBackgroundValue","settingValue","cacheApi","CUSTOM_BG_CACHE_NAME","useCustomBackground","MASK_IMAGE_DISABLED","messagingDisabledClassName","messageSendingRestrictionReason","getMessageSendingRestrictionReason","footerClassName","onTransitionEnd","propertyName","DARK_THEME_BG_COLOR","LIGHT_THEME_BG_COLOR","onDragEnter","onUnpin","HeaderContent","isProfile","isManagement","messageSearchQuery","stickerSearchQuery","selectCurrentStickerSearch","gifSearchQuery","selectCurrentGifSearch","canManage","isColumnOpen","isSearch","isStickerSearch","isGifSearch","isPollResults","isAddingChatMembers","profileState","managementScreen","setLocalTextSearchQuery","searchTextMessagesLocal","toggleManagement","shouldSkipAnimation","backButtonRef","handleMessageSearchQueryChange","handleStickerSearchQueryChange","handleGifSearchQueryChange","setShouldSkipTransition","contentKey","ProfileState","Profile","SharedMedia","MemberList","Search","PollResults","StickerSearch","GifSearch","AddingMembers","ManagementScreens","Initial","ManageInitial","ChatPrivacyType","ManageChatPrivacyType","Discussion","ManageDiscussion","ChannelSubscribers","ManageChannelSubscribers","GroupPermissions","ManageGroupPermissions","ChatAdministrators","ManageChatAdministrators","GroupRemovedUsers","ManageGroupRemovedUsers","GroupUserPermissionsCreate","ManageGroupUserPermissionsCreate","GroupUserPermissions","ManageGroupUserPermissions","GroupRecentActions","ManageGroupRecentActions","ChatAdminRights","ManageGroupAdminRights","GroupMembers","ManageGroupMembers","renderingContentKey","renderHeaderContent","isBackButton","buttonClassName","useProfileViewportIds","loadMoreMembers","searchMessages","tabType","mediaSearchType","resultType","sortUserIds","memberViewportIds","getMoreMembers","noProfileInfoForMembers","currentResultType","handleLoadMore","getMore","useInfiniteScroll","MEMBERS_SLICE","isOnTop","useInfiniteScrollForMembers","mediaViewportIds","getMoreMedia","noProfileInfoForMedia","useInfiniteScrollForSharedMedia","documentViewportIds","getMoreDocuments","noProfileInfoForDocuments","linkViewportIds","getMoreLinks","noProfileInfoForLinks","audioViewportIds","getMoreAudio","noProfileInfoForAudio","noProfileInfo","forSharedMediaType","messageIdsRef","getMessageContentIds","reverse","runThrottledForScroll","isScrollingProgrammatically","isFirstPhoto","isSavedMessages","isDeleted","isDeletedUser","getMediaHash","forceAvatar","getChatAvatarHash","imageHash","ApiMediaFormat","BlobUrl","avatarThumbnailData","useBlurSync","dataUri","imageSrc","prevImageSrc","decoding","userFullName","getUserFullName","getFirstLetters","fullClassName","forceShowSelf","loadFullUser","fullName","slideAnimation","currentPhotoIndex","setCurrentPhotoIndex","isFirst","isLast","profile","currentIndex","usePhotosPreload","handleProfilePhotoClick","ProfileAvatar","selectPreviousMedia","selectNextMedia","renderPhoto","isVerifiedIconShown","isVerified","renderPhotoTabs","aria-label","VerifiedIcon","isUserOnline","getUserStatus","canInviteUsers","isUserRightBanned","getHasAdminRight","handleNotificationChange","copy","entity","copyTextToClipboard","formattedNumber","getChatLink","bio","getChatDescription","ListItem","multiline","narrow","isStatic","contactName","getUserFirstOrLastName","deleteChatMember","handleDeleteChatMember","Modal","onEnter","TABS","buildInfiniteScrollItemSelector","isGroup","hasMembersTab","areMembersHidden","canViewMembers","canAddMembers","canDeleteMembers","resolvedUserId","onProfileStateChange","setLocalMediaSearchType","searchMediaMessagesLocal","loadProfilePhotos","setActiveTab","deletingUserId","setDeletingUserId","prevTabType","tabsEl","prevProfileState","tabListEl","determineProfileState","useProfileState","applyTransitionFix","releaseTransitionFix","transitionElSelector","setMinHeight","transitionEl","minHeight","overflowY","scrollBarWidth","clientWidth","marginRight","useTransitionFixes","cacheBuster","resetCacheBuster","setCacheBuster","useCacheBuster","handleTransitionStop","handleNewMemberDialogOpen","handleSelectMedia","handlePlayAudio","handleMemberClick","handleMessageFocus","handleDeleteMembersModalClose","renderingDelay","isFirstTab","SLIDE_TRANSITION_DURATION","canRenderContents","getMemberContextAction","handler","renderSharedMedia","noSpinner","NothingFound","Media","withDate","smaller","onDateClick","WebLink","onMessageClick","teactOrderKey","contextActions","InfiniteScroll","itemSelector","sensitiveArea","PROFILE_SENSITIVE_AREA","preloadBackwards","noScrollRestoreOnTop","noFastList","onLoadMore","renderProfileInfo","shouldRestoreHeight","onStart","onStop","big","FloatingActionButton","RightSearch","Management","localContactIds","isSearching","onNextStep","setUserSearchQuery","selectedMemberIds","setSelectedMemberIds","noPickerScrollRestore","member","handleFilterChange","displayedIds","sortChatIds","foundContactIds","contactId","isUserBot","canBeInvitedToGroup","handleNextStep","Picker","itemIds","selectedIds","filterValue","filterPlaceholder","searchInputId","onSelectedIdsChange","onFilterChange","noScrollRestore","MAIN_SCREENS_COUNT","RightColumnContent","MANAGEMENT_SCREENS_COUNT","blurSearchInput","areActiveChatsLoaded","selectAreActiveChatsLoaded","selectRightColumnContentKey","currentProfileUserId","selectedId","isChatSelected","toggleChatInfo","closePollResults","addChatMembers","setProfileState","setManagementScreen","selectedChatMemberId","setSelectedChatMemberId","isPromotedByCurrentUser","setIsPromotedByCurrentUser","isScrolledDown","ChatInfo","UserInfo","isOverlaying","close","shouldScrollUp","GroupType","handleSelectChatMember","memberId","isPromoted","handleAppendingChatMembers","onChatMemberSelect","prevContentKey","MediaViewer","Dialogs","ForwardPicker","SafeLinkModal","HistoryCalendar","notificationInterval","DEBUG_isLogged","updateIcon","asUnread","updatePageTitle","nextTitle","isMediaViewerOpen","selectIsMediaViewerOpen","isForwardModalOpen","selectIsForwardModalOpen","hasNotifications","hasDialogs","isHistoryCalendarOpen","loadNotificationSettings","loadNotificationExceptions","updateIsOnline","loadTopInlineBots","loadEmojiKeywords","middleColumnTransitionClassNames","rightColumnTransitionClassNames","prevIsLeftColumnShown","dispatchHeavyAnimationEnd","waitForTransitionEnd","prevIsRightColumnShown","initialUnread","clearInterval","setInterval","INACTIVE_MARKER","newUnread","PAGE_TITLE","stopEvent","onDrop","onDragOver","initApi"],"mappings":"sMAoDO,SAASA,EAAqBC,GACnC,MAAM,OAAEC,EAAF,SAAUC,GAAaC,YAAyBH,IAAW,GACjE,OAAKC,GAAWC,GAIhBF,EAASI,YAAsBJ,EAAQC,EAAQC,GAAU,GACzDF,EAASK,YAA8BL,EAAQC,EAAQC,OAAUI,IAJxDN,EA3CXO,YAAW,sBAAwBP,IACjC,MAAM,OAAEC,EAAF,SAAUC,GAAaC,YAAyBH,IAAW,GACjE,GAAKC,GAAWC,EAIhB,OAAOE,YAAsBJ,EAAQC,EAAQC,GAAU,KAGzDK,YAAW,uBAAwBR,GAEnCQ,YA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jB,SACA2jB,eACAC,YACAG,kBACAD,cACAz8C,eACA28C,qBACA1T,YACA4T,eACA5qB,iBACA7B,YACAhkB,eACA0wC,YACAI,cAAe1zD,QAAQuzD,GACvBI,cAAeJ,EAAcK,YAAoBj3D,EAAQ42D,QAAet2D,EACxEuoD,eAAgBjc,YAAqB5sC,GACrCioD,aACAiP,kBACIrvD,EAAQhC,YAAcgC,EAAQgxC,WAAase,YAA8Bn3D,EAAQC,EAAQ4H,EAAQhC,WAErG3F,WACAk3D,aAAkC,WAApBxxD,EACdyxD,oBAAqBlzD,EAAOmzD,aAA0Bt3D,EAAQ6H,EAAS1D,EAAMquC,QAAUlyC,EACvFi3D,oBAAqBC,aAA0Bx3D,EAAQ6H,GACvD4vD,mBAAoBC,aAAyB13D,MACzCkzB,GAAc,CAAEsyB,eAAgBmS,aAAqB33D,EAAQ6H,EAA6B,cAApBjC,OAC5C,iBAAnBkjD,GAA+B,CAAEA,qBACxChG,GAAa,CAAEC,iBAAgBC,sBAGvC,CAACnhD,EAAWrB,IAA2B0vB,YAAK1vB,EAAS,CACnD,eACA,kBACA,kBACA,uBACA,eACA,WACA,mBACA,eACA,yBACA,kBACA,kBACA,oBACA,yBACA,qBApGgB22B,CAjuBuC,EACzDtvB,UACAmuD,eACA4B,+BACAC,8BACAC,yCACApa,QACAjC,YACAqa,aACAD,iBACAkC,aACAlU,kBACAmU,iBACAC,gBACAC,yBACAC,wBACArU,eACApsB,QACAu+B,kBACAzjB,SACA2jB,eACAC,YACAE,cACAC,kBACA18C,eACA28C,qBACAhR,iBACAsD,iBACAhG,YACAC,iBACAC,mBACA0T,eACA5qB,iBACA7B,YACAhkB,eACA0wC,YACAK,gBACAnO,iBACAZ,aACAiP,kBACAh3D,WACA0F,kBACAwxD,eACAC,sBACAE,sBACAE,qBACA/yD,eACA0zD,kBACAC,kBACAxL,eACA7qD,YACA6xD,wBACAyE,oBACAC,gBACA9wD,0BACAhD,mBACA2C,mBACAoxD,qBACA7wD,0BACAC,w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pK,SAASwwF,KAC1BzB,IAAW,OADb,CAKA,GAAIv9E,EAAQ,GAAM,EAAG,CACnB,MAAMi/E,EAAYloE,YAA0BzpB,eAAeuxF,EACvDI,EAAY,IACdxB,GAAiB,GAAEwB,iBAAyBA,EAAY,EAAI,IAAM,MAClE1B,IAAW,SAGbE,GAAgByB,MAChB3B,IAAW,GAGbv9E,MA3HwB,MA6HzB,CAACo+E,IAEEr6B,EAAcjlC,YAAY,KAC9Bs/D,GAAe,GAEfU,cAAczB,IACdA,QAAuB/0F,EAElB8wB,SAASxgB,MAAMpK,SAASwwF,MAC3BvB,GAAgByB,MAGlB3B,IAAW,IACV,CAACa,IAMJ,SAASe,EAAUjtF,GACjBA,EAAEi2B,iBACFj2B,EAAEiwB,kBAGJ,OARAgxB,aAAkB+sB,EAAYnc,GAC9B/lC,GAAgBkiD,GAQd,yBAAK/2E,GAAG,OAAO61B,UAAWA,EAAWogE,OAAQD,EAAWE,WAAYF,GAClE,kBAAC,GAAD,MACA,kBAAC,GAAD,MACA,kBAAC,GAAD,MACA,kBAAC,GAAD,CAAa19D,OAAQk8D,IACrB,kBAAC,GAAD,CAAel8D,OAAQo8D,IACvB,kBAAC,GAAD,CAAep8D,OAAQs8D,IACvB,kBAAC,GAAD,CAASt8D,OAAQu8D,IAChBniD,GAAgB,kBAAC,GAAD,CAAape,IAAKoe,EAAa1yC,GAAI0G,QAASgsC,EAAcnB,MAAI,IAC/E,kBAAC,GAAD,CAAennC,IAAKC,IACpB,kBAAC,GAAD,CAAiBiuB,OAAQw8D,QC1N3B/xE,KAEFC,QAAQC,IAAI,+BAGT9e,cAAYy9B,iBACfvxB,cAAc8lF,W","file":"4.7cbc0883ea4cc7908cba.js","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 { MAIN_THREAD_ID } from '../../../api/types';\nimport { FocusDirection } from '../../../types';\n\nimport { ANIMATION_END_DELAY, FAST_SMOOTH_MAX_DURATION } 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} from '../../selectors';\nimport { findLast } from '../../../util/iteratees';\n\nconst FOCUS_DURATION = 1500;\nconst FOCUS_NO_HIGHLIGHT_DURATION = FAST_SMOOTH_MAX_DURATION + ANIMATION_END_DELAY;\nconst POLL_RESULT_OPEN_DELAY_MS = 450;\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 && chat.lastMessage ? chat.lastMessage.id : undefined;\n } else {\n const threadInfo = selectThreadInfo(global, chatId, threadId);\n\n messageId = threadInfo ? threadInfo.lastMessageId : undefined;\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,\n } = payload!;\n\n return {\n ...global,\n audioPlayer: {\n chatId,\n threadId,\n messageId,\n },\n };\n});\n\naddReducer('closeAudioPlayer', (global) => {\n return {\n ...global,\n audioPlayer: {},\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 && chat.lastMessage ? chat.lastMessage.id : undefined;\n } else {\n const threadInfo = selectThreadInfo(global, chatId, threadId);\n\n lastMessageId = threadInfo ? threadInfo.lastMessageId : undefined;\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,\n } = payload!;\n\n let { messageId } = payload!;\n\n if (groupedId !== undefined) {\n const ids = selectForwardedMessageIdsByGroupId(global, groupedChatId, groupedId);\n if (ids && 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);\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('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","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 { GlobalState } from '../../../global/types';\n\nimport { updateSelectedUserId, updateUserSearch } from '../../reducers';\n\naddReducer('openUserInfo', (global, actions, payload) => {\n const { id } = payload!;\n\n actions.openChat({ id });\n});\n\nconst clearSelectedUserId = (global: GlobalState) => updateSelectedUserId(global, undefined);\n\naddReducer('openChat', clearSelectedUserId);\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';\n\nimport { IS_SINGLE_COLUMN_LAYOUT, IS_TABLET_COLUMN_LAYOUT } from '../../../util/environment';\nimport getReadableErrorText from '../../../util/getReadableErrorText';\nimport { selectCurrentMessageList } from '../../selectors';\nimport { ApiError } from '../../../api/types';\n\nconst MAX_STORED_EMOJIS = 18; // Represents two rows of recent emojis\n\naddReducer('toggleChatInfo', (global) => {\n return {\n ...global,\n isChatInfoShown: !global.isChatInfoShown,\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('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\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) => {\n const newNotifications = [...global.notifications];\n\n newNotifications.pop();\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';\nimport {\n clearPayment, closeInvoice,\n} from '../../reducers';\n\naddReducer('openPaymentModal', (global, actions, payload) => {\n const { messageId } = payload;\n return {\n ...global,\n payment: {\n ...global.payment,\n messageId,\n isPaymentModalOpen: true,\n },\n };\n});\n\naddReducer('closePaymentModal', (global) => {\n const newGlobal = clearPayment(global);\n return closeInvoice(newGlobal);\n});\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 RE_TME_INVITE_LINK,\n RE_TME_LINK,\n TIPS_USERNAME,\n LOCALIZED_TIPS,\n} from '../../../config';\nimport { callApi } from '../../../api/gramjs';\nimport {\n addChats,\n addUsers,\n replaceThreadParam,\n updateChatListIds,\n updateChats,\n updateChat,\n updateChatListSecondaryInfo,\n updateManagementProgress,\n} from '../../reducers';\nimport {\n selectChat,\n selectCurrentChat,\n selectUser,\n selectChatListType,\n selectIsChatPinned,\n selectChatFolder,\n selectSupportChat,\n selectChatByUsername,\n selectThreadTopMessageId,\n selectCurrentMessageList,\n} from '../../selectors';\nimport { buildCollectionByKey } from '../../../util/iteratees';\nimport { debounce, pause, throttle } from '../../../util/schedulers';\nimport {\n isChatSummaryOnly, isChatArchived, prepareChatList, isChatBasicGroup,\n} from '../../helpers';\n\nconst TOP_CHATS_PRELOAD_PAUSE = 100;\n// We expect this ID does not exist\nconst TMP_CHAT_ID = -1;\n\nconst runThrottledForLoadChats = throttle((cb) => cb(), 1000, true);\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: number[] = [];\n\n for (let i = 0; i < TOP_CHAT_MESSAGES_PRELOAD_LIMIT; i++) {\n await pause(TOP_CHATS_PRELOAD_PAUSE);\n\n const {\n byId,\n listIds: { active: listIds },\n orderedPinnedIds: { active: orderedPinnedIds },\n } = getGlobal().chats;\n if (!listIds) {\n return;\n }\n\n const { chatId: currentChatId } = selectCurrentMessageList(global) || {};\n const { pinnedChats, otherChats } = prepareChatList(byId, listIds, orderedPinnedIds);\n const topChats = [...pinnedChats, ...otherChats];\n const chatToPreload = topChats.find(({ id }) => id !== currentChatId && !preloadedChatIds.includes(id));\n if (!chatToPreload) {\n return;\n }\n\n preloadedChatIds.push(chatToPreload.id);\n\n actions.loadViewportMessages({ chatId: chatToPreload.id, 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 && chat.hasUnreadMark) {\n actions.toggleChatUnread({ id });\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('openSupportChat', (global, actions) => {\n const chat = selectSupportChat(global);\n\n actions.openChat({ id: chat ? chat.id : TMP_CHAT_ID });\n\n if (chat) {\n return;\n }\n\n (async () => {\n const result = await callApi('fetchChat', { type: 'support' });\n if (result) {\n actions.openChat({ id: result.chatId });\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('loadMoreChats', (global, actions, payload) => {\n const { listType = 'active' } = payload!;\n const listIds = global.chats.listIds[listType as ('active' | 'archived')];\n const isFullyLoaded = global.chats.isFullyLoaded[listType as ('active' | 'archived')];\n\n if (isFullyLoaded) {\n return;\n }\n\n const oldestChat = listIds\n ? listIds\n .map((id) => global.chats.byId[id])\n .filter((chat) => Boolean(chat && chat.lastMessage) && !selectIsChatPinned(global, chat.id))\n .sort((chat1, chat2) => (chat1.lastMessage!.date - chat2.lastMessage!.date))[0]\n : undefined;\n\n if (oldestChat) {\n runThrottledForLoadChats(() => loadChats(listType, oldestChat.id, oldestChat.lastMessage!.date));\n } else {\n runThrottledForLoadChats(() => loadChats(listType));\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 });\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 number[])\n .map((id: number) => 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 (async () => {\n const { chatId, userId } : {chatId: number; userId: number} = payload!;\n const chat = selectChat(global, chatId);\n const user = selectUser(global, userId);\n if (!chat || !user) {\n return;\n }\n await callApi('deleteChatUser', { chat, user });\n\n const activeChat = selectCurrentMessageList(global);\n if (activeChat && activeChat.chatId === chatId && global.currentUserId === userId) {\n actions.openChat({ id: undefined });\n }\n })();\n});\n\naddReducer('deleteChat', (global, actions, payload) => {\n (async () => {\n const { chatId } : {chatId: number } = payload!;\n const chat = selectChat(global, chatId);\n if (!chat) {\n return;\n }\n await callApi('deleteChat', { chatId: chat.id });\n\n const activeChat = selectCurrentMessageList(global);\n if (activeChat && activeChat.chatId === chatId) {\n actions.openChat({ id: undefined });\n }\n })();\n});\n\naddReducer('leaveChannel', (global, actions, payload) => {\n (async () => {\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 await callApi('leaveChannel', { channelId, accessHash });\n }\n\n const activeChannel = selectCurrentMessageList(global);\n if (activeChannel && activeChannel.chatId === chatId) {\n actions.openChat({ id: undefined });\n }\n })();\n});\n\naddReducer('deleteChannel', (global, actions, payload) => {\n (async () => {\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 await callApi('deleteChannel', { channelId, accessHash });\n }\n\n const activeChannel = selectCurrentMessageList(global);\n if (activeChannel && activeChannel.chatId === chatId) {\n actions.openChat({ id: undefined });\n }\n })();\n});\n\naddReducer('createGroupChat', (global, actions, payload) => {\n const { title, memberIds, photo } = payload!;\n const members = (memberIds as number[])\n .map((id: number) => 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('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 && 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('openTelegramLink', (global, actions, payload) => {\n const { url } = payload!;\n let match = RE_TME_INVITE_LINK.exec(url);\n\n if (match) {\n const hash = match[1];\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 } else {\n match = RE_TME_LINK.exec(url)!;\n\n const username = match[1];\n const chatOrChannelPostId = match[2] ? Number(match[2]) : undefined;\n const messageId = match[3] ? Number(match[3]) : undefined;\n\n // Open message in private chat\n if (username === 'c' && chatOrChannelPostId && messageId) {\n actions.focusMessage({ chatId: -chatOrChannelPostId, messageId });\n } else {\n void openChatByUsername(actions, username, chatOrChannelPostId);\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 { username } = payload!;\n\n void openChatByUsername(actions, username);\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 = !!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 newGlobal = getGlobal();\n const chatAfterUpdate = selectChat(newGlobal, chatId);\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).map(Number),\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 && 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\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 && chat.fullInfo.members && 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 number[]).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\nasync function loadChats(listType: 'active' | 'archived', offsetId?: number, offsetDate?: number) {\n const result = await callApi('fetchChats', {\n limit: CHAT_LIST_LOAD_SLICE,\n offsetDate,\n archived: listType === 'archived',\n withPinned: getGlobal().chats.orderedPinnedIds[listType] === undefined,\n serverTimeOffset: getGlobal().serverTimeOffset,\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 let global = getGlobal();\n\n global = addUsers(global, buildCollectionByKey(result.users, 'id'));\n global = updateChats(global, buildCollectionByKey(result.chats, 'id'));\n global = updateChatListIds(global, listType, chatIds);\n global = updateChatListSecondaryInfo(global, listType, result);\n\n Object.keys(result.draftsById).map(Number).forEach((chatId) => {\n global = replaceThreadParam(\n global, chatId, MAIN_THREAD_ID, 'draft', result.draftsById[chatId],\n );\n });\n\n Object.keys(result.replyingToById).map(Number).forEach((chatId) => {\n global = replaceThreadParam(\n global, chatId, MAIN_THREAD_ID, 'replyingToId', result.replyingToById[chatId],\n );\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\nasync function loadFullChat(chat: ApiChat) {\n const result = await callApi('fetchFullChat', chat);\n if (!result) {\n return;\n }\n\n const { users, fullInfo } = result;\n\n let global = getGlobal();\n if (users) {\n global = addUsers(global, buildCollectionByKey(users, 'id'));\n }\n global = updateChat(global, chat.id, { fullInfo });\n\n setGlobal(global);\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 });\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 const createdChat = await callApi('createGroupChat', { title, users });\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().openChat({ id: chatId });\n\n if (chatId && photo) {\n await callApi('editChatPhoto', { chatId, photo });\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\nasync function openChatByUsername(\n actions: GlobalActions,\n username: string,\n channelPostId?: number,\n) {\n const global = getGlobal();\n const localChat = selectChatByUsername(global, username);\n if (localChat && !localChat.isMin) {\n if (channelPostId) {\n actions.focusMessage({ chatId: localChat.id, messageId: channelPostId });\n } else {\n actions.openChat({ id: localChat.id });\n }\n return;\n }\n\n const previousChat = selectCurrentChat(global);\n // Open temporary empty chat to make the click response feel faster\n actions.openChat({ id: TMP_CHAT_ID });\n\n const chat = await callApi('getChatByUsername', username);\n if (!chat) {\n if (previousChat) {\n actions.openChat({ id: previousChat.id });\n }\n\n actions.showNotification({ message: 'User does not exist' });\n\n return;\n }\n\n setGlobal(updateChat(getGlobal(), chat.id, chat));\n\n if (channelPostId) {\n actions.focusMessage({ chatId: chat.id, messageId: channelPostId });\n } else {\n actions.openChat({ id: chat.id });\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 ApiVideo,\n MAIN_THREAD_ID,\n MESSAGE_DELETED,\n} from '../../../api/types';\nimport { LoadMoreDirection } from '../../../types';\n\nimport { MAX_MEDIA_FILES_FOR_ALBUM, MESSAGE_LIST_SLICE } from '../../../config';\nimport { callApi, cancelApiProgress } from '../../../api/gramjs';\nimport { areSortedArraysIntersecting, buildCollectionByKey, split } 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} 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} from '../../selectors';\nimport { rafPromise, throttle } from '../../../util/schedulers';\nimport { IS_IOS } from '../../../util/environment';\n\nconst uploadProgressCallbacks = new Map();\n\nconst runThrottledForMarkRead = throttle((cb) => cb(), 1000, true);\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 { chatId, messageId, replyOriginForId } = payload!;\n const chat = selectChat(global, chatId);\n\n if (!chat) {\n return;\n }\n\n void loadMessage(chat, messageId, replyOriginForId);\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 actions.setReplyingToId({ messageId: undefined });\n actions.clearWebPagePreview({ chatId, threadId, value: false });\n\n const params = {\n ...payload,\n chat,\n replyingTo: selectReplyingToId(global, chatId, threadId),\n noWebPage: selectNoWebPage(global, chatId, threadId),\n };\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 && 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('markMessageListRead', (global, actions, payload) => {\n const { serverTimeOffset } = global;\n const currentMessageList = selectCurrentMessageList(global);\n if (!currentMessageList) {\n return;\n }\n\n const { chatId, threadId } = currentMessageList;\n const chat = selectThreadOriginChat(global, chatId, threadId);\n if (!chat) {\n return;\n }\n\n const { maxId } = payload!;\n\n runThrottledForMarkRead(() => {\n void callApi('markMessageListRead', {\n serverTimeOffset, chat, threadId, maxId,\n });\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) => {\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 && messages.length) {\n void forwardMessages(fromChat, toChat, messages);\n }\n});\n\naddReducer('loadScheduledHistory', (global) => {\n const chat = selectCurrentChat(global);\n if (!chat) {\n return;\n }\n\n const { hash } = global.scheduledMessages.byChatId[chat.id] || {};\n\n void loadScheduledHistory(chat, hash);\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 const byId = buildCollectionByKey(messages, 'id');\n const ids = Object.keys(byId).map(Number);\n\n let global = getGlobal();\n\n global = addChatMessagesById(global, chatId, byId);\n global = isOutlying\n ? updateOutlyingIds(global, chatId, threadId, ids)\n : updateListedIds(global, chatId, threadId, ids);\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 (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;\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;\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\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}) {\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\nfunction forwardMessages(\n fromChat: ApiChat,\n toChat: ApiChat,\n messages: ApiMessage[],\n) {\n callApi('forwardMessages', {\n fromChat,\n toChat,\n messages,\n serverTimeOffset: getGlobal().serverTimeOffset,\n });\n\n setGlobal({\n ...getGlobal(),\n forwardMessages: {},\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 const isUnique = (v: number, i: number, a: number[]) => a.indexOf(v) === i;\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]: [\n ...(!shouldResetVoters && voters && voters[option] ? voters[option] : []),\n ...(result && result.users.map((user) => user.id)),\n ].filter(isUnique),\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\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, historyHash?: number) {\n const result = await callApi('fetchScheduledHistory', { chat, hash: historyHash });\n if (!result) {\n return;\n }\n\n const { hash, 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, hash);\n global = replaceThreadParam(global, chat.id, MAIN_THREAD_ID, 'scheduledIds', ids);\n setGlobal(global);\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 = 500;\nconst ADDED_SETS_THROTTLE_CHUNK = 50;\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 if (!addedSetIds || !addedSetIds.length) {\n return;\n }\n\n (async () => {\n for (let i = 0; i < addedSetIds.length; i++) {\n actions.loadStickers({ stickerSetId: addedSetIds[i] });\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 } = payload!;\n let { stickerSetAccessHash } = payload!;\n\n if (!stickerSetAccessHash) {\n const stickerSet = selectStickerSet(global, stickerSetId);\n if (!stickerSet) {\n return;\n }\n\n stickerSetAccessHash = stickerSet.accessHash;\n }\n\n void loadStickers(stickerSetId, stickerSetAccessHash);\n});\n\naddReducer('loadAnimatedEmojis', () => {\n void loadAnimatedEmojis();\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 && 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 && currentEmojiKeywords.keywords),\n ...emojiKeywords.keywords,\n },\n },\n },\n });\n })();\n});\n\nasync function loadStickerSets(hash = 0) {\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 = 0) {\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 = 0) {\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 = 0) {\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) {\n const stickerSet = await callApi('fetchStickers', { stickerSetId, accessHash });\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\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\nasync function searchStickers(query: string, hash = 0) {\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 = 0) {\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 = 0) {\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 && resultsByType[type as ApiGlobalMessageSearchType]) || {};\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: globalUsers.map(({ id }) => id),\n userIds: globalChats.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 chatOrUser: 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, getGlobal, setGlobal, getDispatch,\n} from '../../../lib/teact/teactn';\n\nimport {\n ApiChat, ApiFormattedText, ApiUser, MAIN_THREAD_ID,\n} from '../../../api/types';\nimport { GlobalActions } from '../../../global/types';\n\nimport {\n CHAT_LIST_LOAD_SLICE, DEBUG, MESSAGE_LIST_SLICE,\n} from '../../../config';\nimport { callApi } from '../../../api/gramjs';\nimport { buildCollectionByKey } from '../../../util/iteratees';\nimport {\n replaceChatListIds,\n replaceChats,\n replaceUsers,\n updateUsers,\n updateChats,\n updateChatListSecondaryInfo,\n updateThreadInfos,\n replaceThreadParam,\n} from '../../reducers';\nimport {\n selectUser, selectChat, selectCurrentMessageList, selectDraft, selectChatMessage, selectThreadInfo,\n} from '../../selectors';\nimport { isChatPrivate } from '../../helpers';\n\naddReducer('sync', (global, actions) => {\n void sync(actions.afterSync);\n});\n\naddReducer('afterSync', (global, actions) => {\n void afterSync(actions);\n});\n\nasync function sync(afterSyncCallback: () => void) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('>>> START SYNC');\n }\n\n await callApi('fetchCurrentUser');\n\n // This fetches only active chats and clears archived chats, which will be fetched in `afterSync`\n const savedUsers = await loadAndReplaceChats();\n await loadAndReplaceMessages(savedUsers);\n\n setGlobal({\n ...getGlobal(),\n lastSyncTime: Date.now(),\n });\n\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('>>> FINISH SYNC');\n }\n\n afterSyncCallback();\n}\n\nasync function afterSync(actions: GlobalActions) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('>>> START AFTER-SYNC');\n }\n\n actions.loadFavoriteStickers();\n\n await Promise.all([\n loadAndUpdateUsers(),\n loadAndReplaceArchivedChats(),\n ]);\n\n await callApi('fetchCurrentUser');\n\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('>>> FINISH AFTER-SYNC');\n }\n}\n\nasync function loadAndReplaceChats() {\n const result = await callApi('fetchChats', {\n limit: CHAT_LIST_LOAD_SLICE,\n withPinned: true,\n serverTimeOffset: getGlobal().serverTimeOffset,\n });\n if (!result) {\n return undefined;\n }\n\n let global = getGlobal();\n\n const { recentlyFoundChatIds } = global.globalSearch;\n const { userIds: contactIds } = global.contactList || {};\n const { currentUserId } = global;\n\n const savedPrivateChatIds = [\n ...(recentlyFoundChatIds || []),\n ...(contactIds || []),\n ...(currentUserId ? [currentUserId] : []),\n ];\n\n const savedUsers = savedPrivateChatIds\n .map((id) => selectUser(global, id))\n .filter(Boolean as any);\n\n const savedChats = savedPrivateChatIds\n .map((id) => selectChat(global, id))\n .filter(Boolean as any);\n\n const { chatId: currentChatId } = selectCurrentMessageList(global) || {};\n if (currentChatId) {\n const selectedChat = selectChat(global, currentChatId);\n if (selectedChat && !savedPrivateChatIds.includes(currentChatId)) {\n savedChats.push(selectedChat);\n }\n\n if (isChatPrivate(currentChatId)) {\n const selectedChatUser = selectUser(global, currentChatId);\n if (selectedChatUser && !savedPrivateChatIds.includes(currentChatId)) {\n savedUsers.push(selectedChatUser);\n }\n }\n }\n\n savedUsers.push(...result.users);\n savedChats.push(...result.chats);\n\n global = replaceChats(global, buildCollectionByKey(savedChats, 'id'));\n global = replaceChatListIds(global, 'active', result.chatIds);\n\n global = {\n ...global,\n chats: {\n ...global.chats,\n },\n };\n\n global = updateChatListSecondaryInfo(global, 'active', result);\n\n Object.keys(result.draftsById).map(Number).forEach((chatId) => {\n global = replaceThreadParam(global, chatId, MAIN_THREAD_ID, 'draft', result.draftsById[chatId]);\n });\n\n Object.keys(result.replyingToById).map(Number).forEach((chatId) => {\n global = replaceThreadParam(\n global, chatId, MAIN_THREAD_ID, 'replyingToId', result.replyingToById[chatId],\n );\n });\n\n setGlobal(global);\n\n if (currentChatId && !global.chats.byId[currentChatId]) {\n getDispatch().openChat({ id: undefined });\n }\n\n return savedUsers;\n}\n\nasync function loadAndReplaceArchivedChats() {\n const result = await callApi('fetchChats', {\n limit: CHAT_LIST_LOAD_SLICE,\n archived: true,\n withPinned: true,\n serverTimeOffset: getGlobal().serverTimeOffset,\n });\n\n if (!result) {\n return;\n }\n\n let global = getGlobal();\n global = updateUsers(global, buildCollectionByKey(result.users, 'id'));\n global = updateChats(global, buildCollectionByKey(result.chats, 'id'));\n global = replaceChatListIds(global, 'archived', result.chatIds);\n global = updateChatListSecondaryInfo(global, 'archived', result);\n setGlobal(global);\n}\n\nasync function loadAndReplaceMessages(savedUsers?: ApiUser[]) {\n let areMessagesLoaded = false;\n let users = savedUsers || [];\n\n let global = getGlobal();\n const { chatId: currentChatId, threadId: currentThreadId } = selectCurrentMessageList(global) || {};\n\n // Memoize drafts\n const draftChatIds = Object.keys(global.messages.byChatId).map(Number);\n const draftsByChatId = draftChatIds.reduce>((acc, chatId) => {\n const draft = selectDraft(global, chatId, MAIN_THREAD_ID);\n return draft ? { ...acc, [chatId]: draft } : acc;\n }, {});\n\n if (currentChatId) {\n const result = await loadTopMessages(global.chats.byId[currentChatId]);\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 byId = buildCollectionByKey(result.messages, 'id');\n const listedIds = Object.keys(byId).map(Number);\n\n global = {\n ...global,\n messages: {\n ...global.messages,\n byChatId: {\n [currentChatId]: {\n byId,\n threadsById: {\n [MAIN_THREAD_ID]: {\n ...(currentMessageListInfo && currentMessageListInfo.threadsById[MAIN_THREAD_ID]),\n listedIds,\n viewportIds: listedIds,\n outlyingIds: undefined,\n },\n },\n },\n },\n },\n };\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)\n .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 && 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 && currentMessageListInfo.threadsById[currentThreadId]),\n outlyingIds: undefined,\n },\n },\n },\n },\n },\n };\n }\n }\n global = updateChats(global, buildCollectionByKey(result.chats, 'id'));\n global = updateThreadInfos(global, currentChatId, result.threadInfos);\n\n areMessagesLoaded = true;\n users = Array.prototype.concat(users, result.users);\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).map(Number).forEach((chatId) => {\n global = replaceThreadParam(global, chatId, MAIN_THREAD_ID, 'draft', draftsByChatId[chatId]);\n });\n\n if (savedUsers) {\n global = replaceUsers(global, buildCollectionByKey(users, 'id'));\n } else if (users) {\n // If `fetchChats` has failed for some reason, we don't have saved chats, thus we can not replace\n global = updateUsers(global, buildCollectionByKey(users, 'id'));\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\nasync function loadAndUpdateUsers() {\n let global = getGlobal();\n const { recentlyFoundChatIds } = global.globalSearch;\n const { userIds: contactIds } = global.contactList || {};\n if (\n (!contactIds || !contactIds.length)\n && (!recentlyFoundChatIds || !recentlyFoundChatIds.length)\n ) {\n return;\n }\n\n const users = [\n ...(recentlyFoundChatIds || []),\n ...(contactIds || []),\n ].map((id) => selectUser(global, id)).filter(Boolean as any);\n\n const updatedUsers = await callApi('fetchUsers', { users });\n if (!updatedUsers) {\n return;\n }\n\n global = getGlobal();\n global = updateUsers(global, buildCollectionByKey(updatedUsers, 'id'));\n setGlobal(global);\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 { ApiChat, ApiUser, 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 selectCurrentMediaSearchPeerId,\n selectCurrentMediaSearch, selectCurrentMessageList, selectChat, selectThreadInfo,\n} from '../../selectors';\nimport { buildCollectionByKey } from '../../../util/iteratees';\nimport {\n addChatMessagesById,\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 ? results.nextOffsetId : undefined;\n\n let topMessageId: number | undefined;\n if (threadId !== MAIN_THREAD_ID) {\n const threadInfo = selectThreadInfo(global, chatId!, threadId);\n topMessageId = threadInfo ? threadInfo.topMessageId : undefined;\n }\n\n void searchTextMessages(chat, threadId, topMessageId, query, offsetId);\n});\n\naddReducer('searchMediaMessagesLocal', (global) => {\n const peerId = selectCurrentMediaSearchPeerId(global);\n const chatOrUser = peerId\n ? global.users.byId[peerId] || global.chats.byId[peerId]\n : undefined;\n const currentSearch = selectCurrentMediaSearch(global);\n\n if (!chatOrUser || !currentSearch) {\n return;\n }\n\n const { currentType: type, resultsByType } = currentSearch;\n const currentResults = type && resultsByType && resultsByType[type];\n const offsetId = currentResults ? currentResults.nextOffsetId : undefined;\n\n if (!type) {\n return;\n }\n\n void searchSharedMedia(chatOrUser, 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 chatOrUser: ApiChat,\n threadId: number,\n topMessageId?: number,\n query?: string,\n offsetId?: number,\n) {\n const result = await callApi('searchMessagesLocal', {\n chatOrUser,\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 messages, users, 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 && query !== currentSearch.query)) {\n return;\n }\n\n global = addChatMessagesById(global, chatOrUser.id, byId);\n global = addUsers(global, buildCollectionByKey(users, 'id'));\n global = updateLocalTextSearchResults(global, chatOrUser.id, threadId, newFoundIds, totalCount, nextOffsetId);\n setGlobal(global);\n}\n\nasync function searchSharedMedia(\n chatOrUser: ApiChat | ApiUser,\n type: SharedMediaType,\n offsetId?: number,\n) {\n const result = await callApi('searchMessagesLocal', {\n chatOrUser,\n type,\n limit: SHARED_MEDIA_SLICE,\n offsetId,\n });\n\n if (!result) {\n return;\n }\n\n const {\n messages, users, 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 = addChatMessagesById(global, chatOrUser.id, byId);\n global = addUsers(global, buildCollectionByKey(users, 'id'));\n global = updateLocalMediaSearchResults(global, chatOrUser.id, type, newFoundIds, totalCount, nextOffsetId);\n setGlobal(global);\n}\n\n/**\n * @param timestamp start of target date in seconds\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 { updateManagement, updateManagementProgress } from '../../reducers';\nimport { selectChat, selectCurrentMessageList } 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","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 } from '../../../util/iteratees';\nimport { isChatPrivate } from '../../helpers';\nimport { callApi } from '../../../api/gramjs';\nimport { selectChat, selectUser } from '../../selectors';\nimport {\n addChats, addUsers, updateChat, updateManagementProgress, updateUser, updateUsers,\n updateUserSearch, updateUserSearchFetchingStatus,\n} from '../../reducers';\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 updatedUsers = await callApi('fetchUsers', { users: [user] });\n if (!updatedUsers) {\n return;\n }\n\n global = getGlobal();\n global = updateUsers(global, buildCollectionByKey(updatedUsers, 'id'));\n setGlobal(global);\n })();\n});\n\naddReducer('loadTopUsers', (global) => {\n const {\n serverTimeOffset,\n topPeers: {\n hash, lastRequestedAt,\n },\n } = global;\n\n if (!lastRequestedAt || Date.now() / 1000 + serverTimeOffset - lastRequestedAt > TOP_PEERS_REQUEST_COOLDOWN) {\n void loadTopUsers(hash);\n }\n});\n\naddReducer('loadContactList', (global) => {\n const { hash } = global.contactList || {};\n void loadContactList(hash);\n});\n\naddReducer('loadCurrentUser', () => {\n void callApi('fetchCurrentUser');\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('deleteUser', (global, actions, payload) => {\n const { userId } = payload!;\n\n void deleteUser(userId);\n});\n\nasync function loadTopUsers(usersHash?: number) {\n const result = await callApi('fetchTopUsers', { hash: usersHash });\n if (!result) {\n return;\n }\n\n const { hash, 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 hash,\n userIds: ids,\n lastRequestedAt: Date.now() / 1000 + global.serverTimeOffset,\n },\n };\n setGlobal(global);\n}\n\nasync function loadContactList(hash?: number) {\n const contactList = await callApi('fetchContactList', { hash });\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 hash: contactList.hash,\n userIds: sortedUsers.map((user) => user.id),\n },\n });\n}\n\nasync function updateContact(\n userId: number,\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 const result = await callApi('updateContact', { phone: user.phoneNumber, firstName, lastName });\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 deleteUser(userId: number) {\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('deleteUser', { id, accessHash });\n}\n\naddReducer('loadProfilePhotos', (global, actions, payload) => {\n const { profileId } = payload!;\n const isPrivate = isChatPrivate(profileId);\n const user = isPrivate ? selectUser(global, profileId) : undefined;\n const chat = !isPrivate ? selectChat(global, profileId) : undefined;\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\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\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\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 } from '../../../api/types';\nimport { InlineBotSettings } from '../../../types';\n\nimport { RE_TME_INVITE_LINK, RE_TME_LINK } from '../../../config';\nimport { callApi } from '../../../api/gramjs';\nimport {\n selectChat, selectChatBot, selectChatMessage, selectCurrentChat, selectCurrentMessageList,\n selectReplyingToId, 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';\n\nconst TOP_PEERS_REQUEST_COOLDOWN = 60000; // 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_INVITE_LINK) || button.value.match(RE_TME_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 '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({ messageId });\n actions.setInvoiceMessageInfo(selectChatMessage(global, chat.id, messageId));\n actions.openPaymentModal({ 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 if (!currentUserId || !chat) {\n return;\n }\n\n void sendBotCommand(chat, currentUserId, command);\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');\n })();\n});\n\naddReducer('loadTopInlineBots', (global) => {\n const { serverTimeOffset } = global;\n const { hash, lastRequestedAt } = global.topInlineBots;\n\n if (lastRequestedAt && Date.now() + serverTimeOffset - lastRequestedAt < TOP_PEERS_REQUEST_COOLDOWN) {\n return;\n }\n\n (async () => {\n const result = await callApi('fetchTopInlineBots', { hash });\n if (!result) {\n return;\n }\n\n const { hash: newHash, 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 hash: newHash,\n userIds: ids,\n lastRequestedAt: Date.now(),\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 });\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\nasync function searchInlineBot({\n username,\n inlineBotData,\n chatId,\n query,\n offset,\n} : {\n username: string;\n inlineBotData: InlineBotSettings;\n chatId: number;\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(chat: ApiChat, currentUserId: number, command: string) {\n await callApi('sendMessage', {\n chat,\n text: command,\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 || !result.message) {\n return;\n }\n\n const { message, alert: isError } = result;\n\n if (isError) {\n getDispatch().showDialog({ data: { message } });\n } else {\n getDispatch().showNotification({ message });\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/index';\nimport { callApi } from '../../../api/gramjs';\nimport {\n selectPaymentMessageId,\n selectPaymentRequestId,\n selectProviderPublishableKey,\n selectStripeCredentials,\n selectChatMessage,\n} from '../../selectors';\n\nimport { getStripeError } from '../../helpers/payments';\nimport { buildQueryString } from '../../../util/requestQuery';\n\nimport {\n updateShippingOptions,\n setPaymentStep,\n setRequestInfoId,\n setPaymentForm,\n setStripeCardInfo,\n setInvoiceMessageInfo,\n setReceipt,\n clearPayment,\n closeInvoice,\n} from '../../reducers';\n\naddReducer('validateRequestedInfo', (global, actions, payload) => {\n const { requestInfo, saveInfo } = payload;\n const messageId = selectPaymentMessageId(global);\n if (!messageId) {\n return;\n }\n validateRequestedInfo(messageId, requestInfo, saveInfo);\n});\n\nasync function validateRequestedInfo(messageId: number, requestInfo: any, shouldSave?: true) {\n const result = await callApi('validateRequestedInfo', { messageId, requestInfo, shouldSave });\n if (!result) {\n return;\n }\n const { id, shippingOptions } = result;\n if (!id) {\n return;\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 { messageId } = payload;\n if (!messageId) {\n return;\n }\n getPaymentForm(messageId);\n});\n\n\nasync function getPaymentForm(messageId: number) {\n const result = await callApi('getPaymentForm', { 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 if (!messageId || !receiptMessageId || !chatId) {\n return;\n }\n getReceipt(messageId, receiptMessageId, chatId);\n});\n\nasync function getReceipt(messageId: number, receiptMessageId: number, chatId: number) {\n const result = await callApi('getReceipt', receiptMessageId);\n if (!result) {\n return;\n }\n let global = getGlobal();\n const message = selectChatMessage(global, chatId, 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 publishableKey = selectProviderPublishableKey(global);\n if (!publishableKey) {\n return;\n }\n const { credentials } = payload;\n const { data } = credentials;\n sendStipeCredentials(data, publishableKey);\n});\n\naddReducer('sendPaymentForm', (global, actions, payload) => {\n const { shippingOptionId, saveCredentials } = payload;\n const messageId = selectPaymentMessageId(global);\n const requestInfoId = selectPaymentRequestId(global);\n const publishableKey = selectProviderPublishableKey(global);\n const stripeCredentials = selectStripeCredentials(global);\n if (!messageId || !publishableKey) {\n return;\n }\n sendPaymentForm(messageId, {\n save: saveCredentials,\n data: stripeCredentials,\n }, requestInfoId, shippingOptionId);\n});\n\nasync function sendStipeCredentials(data: {\n cardNumber: string;\n cardholder?: string;\n expiryMonth: string;\n expiryYear: string;\n cvv: string;\n country: string;\n zip: string;\n},\npublishableKey: string) {\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 sendPaymentForm(\n messageId: number,\n credentials: any,\n requestedInfoId?: string,\n shippingOptionId?: string,\n) {\n const result = await callApi('sendPaymentForm', {\n messageId, credentials, requestedInfoId, shippingOptionId,\n });\n if (result) {\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 { 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 { showNewMessageNotification } from '../../../util/notifications';\nimport { updateAppBadge } from '../../../util/appBadge';\nimport {\n updateChat,\n replaceChatListIds,\n updateChatListIds,\n updateChatListType,\n replaceThreadParam,\n} from '../../reducers';\nimport {\n selectChat,\n selectCommonBoxChatId,\n selectIsChatListed,\n selectChatListType,\n selectCurrentMessageList,\n selectCountNotMutedUnread,\n} from '../../selectors';\nimport { throttle } from '../../../util/schedulers';\n\nconst TYPING_STATUS_CLEAR_DELAY = 6000; // 6 seconds\n\n// Enough to animate and mark as read in Message List\nconst CURRENT_CHAT_UNREAD_DELAY = 1000;\nconst runThrottledForUpdateAppBadge = throttle((cb) => cb(), CURRENT_CHAT_UNREAD_DELAY, true);\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 const unreadCount = selectCountNotMutedUnread(newGlobal);\n runThrottledForUpdateAppBadge(() => updateAppBadge(unreadCount));\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 const listType = selectChatListType(global, update.id);\n if (!listType) {\n break;\n }\n\n const { [listType]: listIds } = global.chats.listIds;\n\n if (listIds) {\n global = replaceChatListIds(global, listType, listIds.filter((listId) => listId !== update.id));\n }\n\n global = updateChat(global, update.id, { isNotJoined: true });\n setGlobal(global);\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 const unreadCount = selectCountNotMutedUnread(getGlobal());\n updateAppBadge(unreadCount);\n showNewMessageNotification({ chat, message, isActiveChat });\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 && 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 && 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 && 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});\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 {\n updateChat,\n deleteChatMessages,\n updateChatMessage,\n updateListedIds,\n addViewportId,\n updateThreadInfo,\n replaceThreadParam,\n updateScheduledMessage,\n deleteChatScheduledMessages,\n} from '../../reducers';\nimport { 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} from '../../selectors';\nimport { getMessageContent, isChatPrivate, isMessageLocal } from '../../helpers';\n\nconst ANIMATION_DELAY = 350;\n\naddReducer('apiUpdate', (global, actions, update: ApiUpdate) => {\n switch (update['@type']) {\n case 'newMessage': {\n const { chatId, id, message } = update;\n global = updateWithLocalMedia(global, chatId, id, message);\n global = updateListedAndViewportIds(global, 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 && 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 });\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 setGlobal(updateChatLastMessage(getGlobal(), 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 '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 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, 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 // For some reason Telegram requires to manually mark outgoing thread messages read\n if (thread && 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 && !isChatPrivate(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 && 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});\n\nfunction updateWithLocalMedia(\n global: GlobalState, chatId: number, 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 updateListedAndViewportIds(global: GlobalState, 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 && chat.unreadCount && !selectListedIds(global, chatId, MAIN_THREAD_ID);\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: number,\n message: ApiMessage,\n force = false,\n) {\n const { chats } = global;\n const currentLastMessage = chats.byId[chatId] && 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: number) {\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: number | 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 const { threadInfo } = selectThreadByMessage(global, chatId, message) || {};\n if (threadInfo) {\n threadIdsToUpdate.push(threadInfo.threadId);\n }\n });\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: number[] = [];\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: number | 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 { deleteUser, 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: [number, ApiUserStatus][] = [];\n\nfunction scheduleStatusUpdate(userId: number, statusUpdate: ApiUserStatus) {\n pendingStatusUpdates.push([userId, statusUpdate]);\n flushStatusUpdatesThrottled();\n}\n\nfunction flushStatusUpdates() {\n let global = getGlobal();\n pendingStatusUpdates.forEach(([userId, statusUpdate]) => {\n global = updateUser(global, userId, {\n status: statusUpdate,\n });\n });\n setGlobal(global);\n\n pendingStatusUpdates = [];\n}\n\naddReducer('apiUpdate', (global, actions, update: ApiUpdate) => {\n switch (update['@type']) {\n case 'deleteUser': {\n return deleteUser(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 {\n addReducer, getGlobal, setGlobal,\n} from '../../../lib/teact/teactn';\n\nimport { ApiUpdate } from '../../../api/types';\nimport { ApiPrivacyKey } from '../../../types';\n\nimport { addBlockedContact, removeBlockedContact } 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 hash: 0,\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\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 { 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 { 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, useCallback, useMemo, memo,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { LeftColumnContent, ISettings } from '../../../types';\nimport { ApiChat } from '../../../api/types';\n\nimport {\n ANIMATION_LEVEL_MAX, APP_NAME, APP_VERSION, FEEDBACK_URL,\n} from '../../../config';\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../../util/environment';\nimport buildClassName from '../../../util/buildClassName';\nimport { pick } from '../../../util/iteratees';\nimport { isChatArchived } from '../../../modules/helpers';\nimport { formatDateToString } from '../../../util/dateFormat';\nimport { selectTheme } from '../../../modules/selectors';\nimport switchTheme from '../../../util/switchTheme';\nimport useLang from '../../../hooks/useLang';\nimport { disableHistoryBack } from '../../../hooks/useHistoryBack';\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';\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 searchQuery?: string;\n isLoading: boolean;\n currentUserId?: number;\n globalSearchChatId?: number;\n searchDate?: number;\n theme: ISettings['theme'];\n animationLevel: 0 | 1 | 2;\n chatsById?: Record;\n};\n\ntype DispatchProps = 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/';\nconst PERMANENT_VERSION_KEY = 'kz_version';\n\nconst LeftMainHeader: FC = ({\n content,\n contactsFilter,\n onSearchQuery,\n onSelectSettings,\n onSelectContacts,\n onSelectArchived,\n setGlobalSearchChatId,\n onReset,\n searchQuery,\n isLoading,\n shouldSkipTransition,\n currentUserId,\n globalSearchChatId,\n searchDate,\n theme,\n animationLevel,\n chatsById,\n openChat,\n openTipsChat,\n setGlobalSearchDate,\n setSettingOption,\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 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 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 localStorage.setItem(PERMANENT_VERSION_KEY, JSON.stringify('K'));\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\nexport default memo(withGlobal(\n (global): StateProps => {\n const {\n query: searchQuery, fetchingStatus, chatId, date,\n } = global.globalSearch;\n const { currentUserId } = global;\n const { byId: chatsById } = global.chats;\n const { 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 };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'openChat',\n 'openTipsChat',\n 'setGlobalSearchDate',\n 'setGlobalSearchChatId',\n 'setSettingOption',\n ]),\n)(LeftMainHeader));\n","import React, { memo, FC } from '../../lib/teact/teact';\n\nimport { GlobalState } from '../../global/types';\n\nimport useLang from '../../hooks/useLang';\n\nimport Spinner from '../ui/Spinner';\n\nimport './ConnectionState.scss';\n\ntype StateProps = Pick;\n\nconst ConnectionState: FC = () => {\n const lang = useLang();\n\n return (\n
\n \n
{lang('WaitingForNetwork')}
\n
\n );\n};\n\nexport default memo(ConnectionState);\n","import { useState } from '../lib/teact/teact';\n\nimport useThrottle from './useThrottle';\nimport useOnChange from './useOnChange';\nimport useHeavyAnimationCheck from './useHeavyAnimationCheck';\nimport useFlag from './useFlag';\n\nexport default (resolverFn: () => R, ms: number, dependencies: D) => {\n const runThrottled = useThrottle(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 runThrottled(() => {\n setValue(resolverFn());\n });\n }, dependencies.concat([isFrozen]));\n\n return value;\n};\n","import { useMemo } from '../lib/teact/teact';\n\nimport { throttle } from '../util/schedulers';\n\nexport default (ms: number, noFirst = false) => {\n return useMemo(() => {\n return throttle((cb) => cb(), ms, !noFirst);\n }, [ms, noFirst]);\n};\n","import React, {\n FC, memo, useCallback, useEffect, useMemo, useRef,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiChat, ApiChatFolder, ApiUser } from '../../../api/types';\nimport { GlobalActions } from '../../../global/types';\nimport { NotifyException, NotifySettings, SettingsScreens } from '../../../types';\nimport { FolderEditDispatch } from '../../../hooks/reducers/useFoldersReducer';\n\nimport { IS_TOUCH_ENV } from '../../../util/environment';\nimport { buildCollectionByKey, pick } from '../../../util/iteratees';\nimport { captureEvents, SwipeDirection } from '../../../util/captureEvents';\nimport { getFolderUnreadDialogs } from '../../../modules/helpers';\nimport { selectNotifyExceptions, selectNotifySettings } from '../../../modules/selectors';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport buildClassName from '../../../util/buildClassName';\nimport useThrottledMemo from '../../../hooks/useThrottledMemo';\nimport useLang from '../../../hooks/useLang';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\nimport captureEscKeyListener from '../../../util/captureEscKeyListener';\n\nimport Transition from '../../ui/Transition';\nimport TabList from '../../ui/TabList';\nimport ChatList from './ChatList';\n\ntype OwnProps = {\n onScreenSelect: (screen: SettingsScreens) => void;\n foldersDispatch: FolderEditDispatch;\n};\n\ntype StateProps = {\n chatsById: Record;\n usersById: Record;\n chatFoldersById: Record;\n notifySettings: NotifySettings;\n notifyExceptions?: Record;\n orderedFolderIds?: number[];\n activeChatFolder: number;\n currentUserId?: number;\n lastSyncTime?: number;\n};\n\ntype DispatchProps = Pick;\n\nconst INFO_THROTTLE = 3000;\nconst SAVED_MESSAGES_HOTKEY = '0';\n\nconst ChatFolders: FC = ({\n chatsById,\n usersById,\n chatFoldersById,\n notifySettings,\n notifyExceptions,\n orderedFolderIds,\n activeChatFolder,\n currentUserId,\n lastSyncTime,\n foldersDispatch,\n onScreenSelect,\n loadChatFolders,\n setActiveChatFolder,\n openChat,\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 = useThrottledMemo(() => {\n if (!displayedFolders || !displayedFolders.length) {\n return undefined;\n }\n\n const chatIds = Object.keys(chatsById).map(Number);\n const counters = displayedFolders.map((folder) => {\n const {\n unreadDialogsCount, hasActiveDialogs,\n } = getFolderUnreadDialogs(chatsById, usersById, folder, chatIds, notifySettings, notifyExceptions) || {};\n\n return {\n id: folder.id,\n badgeCount: unreadDialogsCount,\n isBadgeActive: hasActiveDialogs,\n };\n });\n\n return buildCollectionByKey(counters, 'id');\n }, INFO_THROTTLE, [displayedFolders, chatsById, usersById, notifySettings, notifyExceptions]);\n\n const folderTabs = useMemo(() => {\n if (!displayedFolders || !displayedFolders.length) {\n return undefined;\n }\n\n return [\n { title: lang.code === 'en' ? 'All' : lang('FilterAllChats') },\n ...displayedFolders.map((folder) => ({\n title: folder.title,\n ...(folderCountersById && folderCountersById[folder.id]),\n })),\n ];\n }, [displayedFolders, folderCountersById, lang]);\n\n const handleSwitchTab = useCallback((index: number) => {\n setActiveChatFolder(index);\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 onSwipe: ((e, direction) => {\n if (direction === SwipeDirection.Left) {\n setActiveChatFolder(Math.min(activeChatFolder + 1, folderTabs.length - 1));\n } else if (direction === SwipeDirection.Right) {\n setActiveChatFolder(Math.max(0, activeChatFolder - 1));\n }\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));\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);\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(({ title }) => title === folderTabs![activeChatFolder].title);\n\n if (!activeFolder || activeChatFolder === 0) {\n return (\n \n );\n }\n\n return (\n \n );\n }\n\n return (\n
\n {folderTabs && 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 chats: { byId: chatsById },\n users: { byId: usersById },\n chatFolders: {\n byId: chatFoldersById,\n orderedIds: orderedFolderIds,\n activeChatFolder,\n },\n currentUserId,\n lastSyncTime,\n } = global;\n\n return {\n chatsById,\n usersById,\n chatFoldersById,\n orderedFolderIds,\n lastSyncTime,\n notifySettings: selectNotifySettings(global),\n notifyExceptions: selectNotifyExceptions(global),\n activeChatFolder,\n currentUserId,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'loadChatFolders',\n 'setActiveChatFolder',\n 'openChat',\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, useCallback, 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\nconst MENU_CLOSE_DELAY_MS = 750;\nlet closeTimeout: number | undefined;\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 const handleMouseEnter = useCallback(() => {\n if (closeTimeout) {\n clearTimeout(closeTimeout);\n closeTimeout = undefined;\n }\n }, []);\n\n const handleMouseLeave = useCallback(() => {\n if (closeTimeout) {\n clearTimeout(closeTimeout);\n closeTimeout = undefined;\n }\n\n closeTimeout = window.setTimeout(() => {\n setIsMenuOpen(false);\n }, MENU_CLOSE_DELAY_MS);\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, useState, useRef, useCallback, useEffect,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalState } from '../../../global/types';\nimport { LeftColumnContent, SettingsScreens } from '../../../types';\nimport { FolderEditDispatch } from '../../../hooks/reducers/useFoldersReducer';\n\nimport { IS_TOUCH_ENV } from '../../../util/environment';\nimport { pick } from '../../../util/iteratees';\nimport buildClassName from '../../../util/buildClassName';\nimport useBrowserOnline from '../../../hooks/useBrowserOnline';\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 ConnectionState from '../ConnectionState';\nimport ChatFolders from './ChatFolders';\nimport LeftSearch from '../search/LeftSearch.async';\nimport ContactList from './ContactList.async';\nimport NewChatButton from '../NewChatButton';\nimport ShowTransition from '../../ui/ShowTransition';\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\ntype StateProps = Pick;\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 connectionState,\n}) => {\n const [isNewChatButtonShown, setIsNewChatButtonShown] = useState(IS_TOUCH_ENV);\n\n const isBrowserOnline = useBrowserOnline();\n const isConnecting = !isBrowserOnline || connectionState === 'connectionStateConnecting';\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 {() => }\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 withGlobal(\n (global): StateProps => pick(global, ['connectionState']),\n)(LeftMain);\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';\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, useState,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\nimport { LeftColumnContent, SettingsScreens } from '../../types';\n\nimport { LAYERS_ANIMATION_NAME } from '../../util/environment';\nimport captureEscKeyListener from '../../util/captureEscKeyListener';\nimport { pick } from '../../util/iteratees';\nimport useFoldersReducer from '../../hooks/reducers/useFoldersReducer';\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};\n\ntype DispatchProps = Pick;\n\nenum ContentType {\n Main,\n // eslint-disable-next-line 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 setGlobalSearchQuery,\n setGlobalSearchChatId,\n resetChatCreation,\n setGlobalSearchDate,\n loadPasswordInfo,\n clearTwoFaError,\n}) => {\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.Privacy:\n case SettingsScreens.Language:\n setSettingsScreen(SettingsScreens.Main);\n return;\n\n case SettingsScreens.GeneralChatBackground:\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 clearTwoFaError();\n\n if (settingsScreen === SettingsScreens.Privacy) {\n loadPasswordInfo();\n }\n }, [clearTwoFaError, loadPasswordInfo, settingsScreen]);\n\n const handleSettingsScreenSelect = (screen: SettingsScreens) => {\n setContent(LeftColumnContent.Settings);\n setSettingsScreen(screen);\n };\n\n return (\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\nexport default memo(withGlobal(\n (global): StateProps => {\n const {\n globalSearch: {\n query,\n date,\n },\n chatFolders: {\n activeChatFolder,\n },\n shouldSkipHistoryAnimations,\n } = global;\n return {\n searchQuery: query, searchDate: date, activeChatFolder, shouldSkipHistoryAnimations,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'setGlobalSearchQuery', 'setGlobalSearchChatId', 'resetChatCreation', 'setGlobalSearchDate',\n 'loadPasswordInfo', 'clearTwoFaError',\n ]),\n)(LeftColumn));\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\nexport default () => {\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","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;\nconst SIDE_COLUMN_MAX_WIDTH = 26.5 * REM;\nconst 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 { MessageList, MessageListType } from '../global/types';\nimport { MAIN_THREAD_ID } from '../api/types';\n\nexport const createMessageHash = (messageList: MessageList): string => (\n messageList.chatId.toString()\n + (messageList.type !== 'thread' ? `_${messageList.type}`\n : (messageList.threadId !== -1 ? `_${messageList.threadId}` : ''))\n);\n\nexport const parseMessageHash = (value: string): MessageList => {\n const [chatId, typeOrThreadId] = value.split('_');\n const isType = ['thread', 'pinned', 'scheduled'].includes(typeOrThreadId);\n\n return {\n chatId: Number(chatId),\n type: !!typeOrThreadId && isType ? (typeOrThreadId as MessageListType) : 'thread',\n threadId: !!typeOrThreadId && !isType ? Number(typeOrThreadId) : MAIN_THREAD_ID,\n };\n};\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} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions, MessageListType } from '../../global/types';\nimport { MAIN_THREAD_ID } from '../../api/types';\nimport { IAnchorPosition } from '../../types';\n\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../util/environment';\nimport { pick } from '../../util/iteratees';\nimport { isChatChannel, isChatSuperGroup } 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: number;\n threadId: number;\n messageListType: MessageListType;\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 canMute?: boolean;\n canSelect?: boolean;\n canLeave?: boolean;\n}\n\ntype DispatchProps = Pick;\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 canMute,\n canSelect,\n canLeave,\n isRightColumnShown,\n joinChannel,\n sendBotCommand,\n openLocalTextSearch,\n restartBot,\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 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 const lang = useLang();\n\n return (\n
\n {!IS_SINGLE_COLUMN_LAYOUT && canSubscribe && (\n \n {lang(isChannel ? 'Subscribe' : 'Join Group')}\n \n )}\n {!IS_SINGLE_COLUMN_LAYOUT && canStartBot && (\n \n {lang('BotStart')}\n \n )}\n {!IS_SINGLE_COLUMN_LAYOUT && canRestartBot && (\n \n {lang('BotRestart')}\n \n )}\n {!IS_SINGLE_COLUMN_LAYOUT && canSearch && (\n \n \n \n )}\n {(IS_SINGLE_COLUMN_LAYOUT || !canSubscribe) && (\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) {\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 && chat && (isChannel || isChatSuperGroup(chat)) && chat.isNotJoined,\n );\n const canSearch = isMainThread || isDiscussionThread;\n const canMute = isMainThread && !isChatWithSelf && !canSubscribe;\n const canSelect = !selectIsInSelectMode(global);\n const canLeave = isMainThread && !canSubscribe;\n\n const noMenu = !(\n (IS_SINGLE_COLUMN_LAYOUT && canSubscribe)\n || (IS_SINGLE_COLUMN_LAYOUT && canSearch)\n || canMute\n || canSelect\n || canLeave\n );\n\n return {\n noMenu,\n isChannel,\n isRightColumnShown,\n canStartBot,\n canRestartBot,\n canSubscribe,\n canSearch,\n canMute,\n canSelect,\n canLeave,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'joinChannel', 'sendBotCommand', 'openLocalTextSearch', 'restartBot',\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 thumbnail = message && getMessageMediaThumbDataUri(message);\n const { sticker } = (message && message.content) || {};\n const shouldDecodeThumbnail = thumbnail && sticker && !isWebpSupported() && thumbnail.includes('image/webp');\n const [thumbnailDecoded, setThumbnailDecoded] = useState(EMPTY_IMAGE_DATA_URI);\n const messageId = message && message.id;\n\n useLayoutEffect(() => {\n if (!shouldDecodeThumbnail) {\n return;\n }\n\n webpToPngBase64(`b64-${messageId}`, thumbnail!)\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, thumbnail]);\n\n return shouldDecodeThumbnail ? thumbnailDecoded : thumbnail;\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 && 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, getMessageSummaryText } from '../../modules/helpers';\nimport renderText from '../common/helpers/renderText';\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';\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 = getMessageSummaryText(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

{renderText(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","import React, { FC, useCallback } from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\nimport {\n ApiAudio, ApiChat, ApiMessage, ApiUser,\n} from '../../api/types';\n\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../util/environment';\nimport * as mediaLoader from '../../util/mediaLoader';\nimport {\n getMediaDuration, getMessageAudio, getMessageKey, getMessageMediaHash, getSenderTitle,\n} from '../../modules/helpers';\nimport { selectSender } from '../../modules/selectors';\nimport { pick } from '../../util/iteratees';\nimport renderText from '../common/helpers/renderText';\nimport useAudioPlayer from '../../hooks/useAudioPlayer';\nimport buildClassName from '../../util/buildClassName';\nimport useLang from '../../hooks/useLang';\n\nimport RippleEffect from '../ui/RippleEffect';\nimport Button from '../ui/Button';\n\nimport './AudioPlayer.scss';\n\ntype OwnProps = {\n message: ApiMessage;\n className?: string;\n noUi?: boolean;\n};\n\ntype StateProps = {\n sender?: ApiChat | ApiUser;\n};\n\ntype DispatchProps = Pick;\n\nconst AudioPlayer: FC = ({\n message, className, noUi, sender, focusMessage, closeAudioPlayer,\n}) => {\n const lang = useLang();\n\n const senderName = sender ? getSenderTitle(lang, sender) : undefined;\n const mediaData = mediaLoader.getFromMemory(getMessageMediaHash(message, 'inline')!) as (string | undefined);\n const { playPause, isPlaying } = useAudioPlayer(\n getMessageKey(message), getMediaDuration(message)!, mediaData, undefined, undefined, true,\n );\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 }, [closeAudioPlayer, isPlaying, playPause]);\n\n if (noUi) {\n return undefined;\n }\n\n const audio = getMessageAudio(message);\n\n return (\n
\n \n \n \n \n\n
\n {audio ? renderAudio(audio) : renderVoice(lang('AttachAudio'), senderName)}\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\n return { sender };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['focusMessage', 'closeAudioPlayer']),\n)(AudioPlayer);\n","import React, {\n FC, useCallback, useMemo, memo, useEffect, useRef, useState,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\nimport cycleRestrict from '../../util/cycleRestrict';\n\nimport { GlobalActions, MessageListType } from '../../global/types';\nimport {\n ApiMessage,\n ApiChat,\n ApiTypingStatus,\n MAIN_THREAD_ID, ApiUser,\n} from '../../api/types';\nimport { NotifyException, NotifySettings } from '../../types';\n\nimport {\n MIN_SCREEN_WIDTH_FOR_STATIC_LEFT_COLUMN,\n MOBILE_SCREEN_MAX_WIDTH,\n EDITABLE_INPUT_ID,\n MIN_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN,\n SAFE_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN,\n SAFE_SCREEN_WIDTH_FOR_CHAT_INFO,\n} from '../../config';\nimport { IS_SINGLE_COLUMN_LAYOUT, IS_TABLET_COLUMN_LAYOUT } from '../../util/environment';\nimport {\n isChatPrivate,\n isChatArchived,\n getMessageKey,\n getChatTitle,\n getSenderTitle,\n selectIsChatMuted,\n} from '../../modules/helpers';\nimport {\n selectChat,\n selectChatMessage,\n selectAllowedMessageActions,\n selectIsRightColumnShown,\n selectThreadTopMessageId,\n selectThreadInfo,\n selectChatMessages,\n selectPinnedIds,\n selectIsChatWithSelf,\n selectForwardedSender,\n selectScheduledIds,\n selectIsInSelectMode,\n selectIsChatWithBot,\n selectNotifySettings,\n selectNotifyExceptions,\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 { pick } from '../../util/iteratees';\nimport { formatIntegerCompact } from '../../util/textFormat';\nimport buildClassName from '../../util/buildClassName';\nimport useLang from '../../hooks/useLang';\n\nimport PrivateChatInfo from '../common/PrivateChatInfo';\nimport GroupChatInfo from '../common/GroupChatInfo';\nimport Transition from '../ui/Transition';\nimport Button from '../ui/Button';\nimport HeaderActions from './HeaderActions';\nimport HeaderPinnedMessage from './HeaderPinnedMessage';\nimport AudioPlayer from './AudioPlayer';\n\nimport './MiddleHeader.scss';\n\nconst ANIMATION_DURATION = 350;\n\ntype OwnProps = {\n chatId: number;\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 chatsById?: Record;\n messagesCount?: number;\n isChatWithSelf?: boolean;\n isChatWithBot?: boolean;\n lastSyncTime?: number;\n notifySettings: NotifySettings;\n notifyExceptions?: Record;\n shouldSkipHistoryAnimations?: boolean;\n currentTransitionKey: number;\n};\n\ntype DispatchProps = Pick;\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 chatsById,\n messagesCount,\n isChatWithSelf,\n isChatWithBot,\n lastSyncTime,\n notifySettings,\n notifyExceptions,\n shouldSkipHistoryAnimations,\n currentTransitionKey,\n openChatWithInfo,\n pinMessage,\n focusMessage,\n openChat,\n openPreviousChat,\n loadPinnedMessages,\n toggleLeftColumn,\n exitMessageSelectMode,\n}) => {\n const lang = useLang();\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) ? pinnedMessageIds.length : (pinnedMessageIds ? 1 : 0);\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, 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 handleBackClick = useCallback((e: React.MouseEvent) => {\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 (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 return;\n }\n\n if (messageListType === 'scheduled' && isSelectModeActive) {\n exitMessageSelectMode();\n }\n\n openPreviousChat();\n }, [\n threadId, messageListType, currentTransitionKey, isSelectModeActive, openPreviousChat, shouldShowCloseButton,\n openChat, toggleLeftColumn, exitMessageSelectMode,\n ]);\n\n const unreadCount = useMemo(() => {\n if (!isLeftColumnHideable || !chatsById) {\n return undefined;\n }\n\n let isActive = false;\n\n const totalCount = Object.values(chatsById).reduce((total, currentChat) => {\n if (isChatArchived(currentChat)) {\n return total;\n }\n\n const count = currentChat.unreadCount || 0;\n if (\n count && (!selectIsChatMuted(currentChat, notifySettings, notifyExceptions) || currentChat.unreadMentionsCount)\n ) {\n isActive = true;\n }\n\n return total + count;\n }, 0);\n\n if (!totalCount) {\n return undefined;\n }\n\n return {\n isActive,\n totalCount,\n };\n }, [isLeftColumnHideable, chatsById, notifySettings, notifyExceptions]);\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);\n\n const {\n shouldRender: shouldRenderPinnedMessage,\n transitionClassNames: pinnedMessageClassNames,\n } = useShowTransition(pinnedMessage && !shouldRenderAudioPlayer);\n\n const renderingPinnedMessage = useCurrentOrPrev(pinnedMessage);\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 function renderInfo() {\n return (\n messageListType === 'thread' && threadId === MAIN_THREAD_ID ? (\n renderMainThreadInfo()\n ) : messageListType === 'thread' ? (\n <>\n {renderBackButton()}\n

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

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

\n {lang('PinnedMessagesCount', messagesCount)}\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, unreadCount)}\n
\n {isChatPrivate(chatId) ? (\n \n ) : (\n \n )}\n
\n \n );\n }\n\n function renderBackButton(asClose = false, unreadCountInfo?: typeof unreadCount) {\n return (\n
\n \n
\n \n {unreadCountInfo && (\n
\n {formatIntegerCompact(unreadCountInfo.totalCount)}\n
\n )}\n
\n );\n }\n\n return (\n
\n \n {renderInfo}\n \n\n
\n {shouldRenderPinnedMessage && renderingPinnedMessage && !shouldRenderAudioPlayer && (\n \n )}\n {shouldRenderAudioPlayer && renderingAudioMessage && (\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 { byId: chatsById } = global.chats;\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 && pinnedIds.length;\n } else if (messageListType === 'scheduled') {\n const scheduledIds = selectScheduledIds(global, chatId);\n messagesCount = scheduledIds && scheduledIds.length;\n } else if (messageListType === 'thread' && threadId !== MAIN_THREAD_ID) {\n const threadInfo = selectThreadInfo(global, chatId, threadId);\n if (threadInfo) {\n messagesCount = threadInfo.messagesCount;\n }\n }\n\n const state: StateProps = {\n typingStatus,\n isLeftColumnShown,\n isRightColumnShown: selectIsRightColumnShown(global),\n isSelectModeActive: selectIsInSelectMode(global),\n audioMessage,\n chat,\n chatsById,\n messagesCount,\n isChatWithSelf: selectIsChatWithSelf(global, chatId),\n isChatWithBot: chat && selectIsChatWithBot(global, chat),\n lastSyncTime,\n notifySettings: selectNotifySettings(global),\n notifyExceptions: selectNotifyExceptions(global),\n shouldSkipHistoryAnimations,\n currentTransitionKey: Math.max(0, global.messages.messageLists.length - 1),\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 && 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 (setGlobal, actions): DispatchProps => pick(actions, [\n 'openChatWithInfo',\n 'pinMessage',\n 'focusMessage',\n 'openChat',\n 'openPreviousChat',\n 'loadPinnedMessages',\n 'toggleLeftColumn',\n 'exitMessageSelectMode',\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 React from '../../../lib/teact/teact';\n\nimport { EDITABLE_INPUT_ID } from '../../../config';\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../../util/environment';\n\nexport function preventMessageInputBlur(e: React.MouseEvent) {\n if (\n IS_SINGLE_COLUMN_LAYOUT\n || !document.activeElement\n || document.activeElement.id !== EDITABLE_INPUT_ID\n || e.target !== e.currentTarget\n ) {\n return;\n }\n\n e.preventDefault();\n}\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, false);\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 { useMemo } from '../lib/teact/teact';\n\nimport { debounce } from '../util/schedulers';\n\nexport default function useDebounce(ms: number, shouldRunFirst?: boolean, shouldRunLast?: boolean) {\n return useMemo(() => {\n return debounce((cb) => cb(), ms, shouldRunFirst, shouldRunLast);\n }, [ms, shouldRunFirst, shouldRunLast]);\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;\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 }, (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 }: {\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 } = {},\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 && 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 && !customShape) {\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 (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\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: number,\n isFocused?: boolean,\n focusDirection?: FocusDirection,\n noFocusHighlight?: 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 );\n }\n }, [elementRef, chatId, isFocused, focusDirection, noFocusHighlight]);\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 renderText from '../common/helpers/renderText';\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 sender?: ApiUser | ApiChat;\n targetUserIds?: number[];\n targetMessage?: ApiMessage;\n targetChatId?: number;\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 sender,\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 && usersById[userId]).filter(Boolean as any)\n : undefined;\n }, [targetUserIds, usersById]);\n\n const content = renderActionMessageText(\n lang,\n message,\n sender,\n targetUsers,\n targetMessage,\n targetChatId,\n isEmbedded ? { isEmbedded: true, asPlain: true } : undefined,\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 {renderText(content as string)};\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 sender = chat && (isChatChannel(chat) || userId === message.chatId)\n ? chat\n : userId ? selectUser(global, userId) : undefined;\n\n return {\n usersById,\n sender,\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 getMessageSummaryText,\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';\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 onClick: NoneToVoidFunction;\n};\n\nconst NBSP = '\\u00A0';\n\nconst EmbeddedMessage: FC = ({\n className,\n message,\n sender,\n title,\n customText,\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)}\n
\n

\n {!message ? (\n customText || NBSP\n ) : isActionMessage(message) ? (\n \n ) : (\n renderText(getMessageSummaryText(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) {\n const { width, height } = getPictogramDimensions();\n\n return (\n \n );\n}\n\nexport default EmbeddedMessage;\n","import React, { FC, memo } from '../../../lib/teact/teact';\n\nimport { ApiMessage, ApiMessageOutgoingStatus } from '../../../api/types';\n\nimport { formatTime } from '../../../util/dateFormat';\nimport { formatIntegerCompact } from '../../../util/textFormat';\n\nimport MessageOutgoingStatus from '../../common/MessageOutgoingStatus';\nimport renderText from '../../common/helpers/renderText';\nimport useLang from '../../../hooks/useLang';\n\nimport './MessageMeta.scss';\n\ntype OwnProps = {\n message: ApiMessage;\n outgoingStatus?: ApiMessageOutgoingStatus;\n signature?: string;\n onClick: () => void;\n};\n\nconst MessageMeta: FC = ({\n message, outgoingStatus, signature, onClick,\n}) => {\n const lang = useLang();\n\n return (\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(message.date * 1000)}\n \n {outgoingStatus && (\n \n )}\n \n );\n};\n\nexport default memo(MessageMeta);\n","import React, { FC, useRef } from '../../../lib/teact/teact';\n\nimport { ApiMessage } from '../../../api/types';\n\nimport { MEMOJI_STICKER_ID } from '../../../config';\nimport { getStickerDimensions } from '../../common/helpers/mediaDimensions';\nimport { getMessageMediaFormat, getMessageMediaHash } from '../../../modules/helpers';\nimport useMedia from '../../../hooks/useMedia';\nimport useTransitionForMedia from '../../../hooks/useTransitionForMedia';\nimport buildClassName from '../../../util/buildClassName';\nimport { ObserveFn, useIsIntersecting } from '../../../hooks/useIntersectionObserver';\nimport useFlag from '../../../hooks/useFlag';\nimport useWebpThumbnail from '../../../hooks/useWebpThumbnail';\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 { isAnimated, stickerSetId } = sticker;\n const isMemojiSticker = stickerSetId === MEMOJI_STICKER_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 thumbDataUri = useWebpThumbnail(message);\n const mediaData = useMedia(\n mediaHash,\n !shouldLoad,\n getMessageMediaFormat(message, 'inline', true),\n lastSyncTime,\n );\n\n const isMediaLoaded = Boolean(mediaData);\n const [isAnimationLoaded, markAnimationLoaded] = useFlag(isMediaLoaded);\n const isMediaReady = isAnimated ? isAnimationLoaded : isMediaLoaded;\n const { shouldRenderFullMedia, transitionClassNames } = useTransitionForMedia(isMediaReady, 'slow');\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 return (\n
\n {!isMediaReady && (\n \n )}\n {!isAnimated && shouldRenderFullMedia && (\n \n )}\n {isAnimated && 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","const SELECTED_APPENDIX_BACKGROUND = Promise.resolve('rgba(255,255,255,1)');\n\nexport default function getCustomAppendixBg(src: string, isOwn: boolean, inSelectMode?: boolean, isSelected?: boolean) {\n return isSelected ? SELECTED_APPENDIX_BACKGROUND : 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 { 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 useMediaWithDownloadProgress from '../../../hooks/useMediaWithDownloadProgress';\nimport useTransitionForMedia from '../../../hooks/useTransitionForMedia';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport useBlurredMediaThumbRef from './hooks/useBlurredMediaThumbRef';\nimport usePrevious from '../../../hooks/usePrevious';\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 shouldAutoLoad?: 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 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 shouldAutoLoad,\n isInSelectMode,\n isSelected,\n uploadProgress,\n size = 'inline',\n dimensions,\n nonInteractive,\n shouldAffectAppendix,\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 [isDownloadAllowed, setIsDownloadAllowed] = useState(shouldAutoLoad);\n const shouldDownload = isDownloadAllowed && isIntersecting;\n const {\n mediaData, downloadProgress,\n } = useMediaWithDownloadProgress(getMessageMediaHash(message, size), !shouldDownload);\n const fullMediaData = localBlobUrl || mediaData;\n const thumbRef = useBlurredMediaThumbRef(message, fullMediaData);\n\n const {\n isUploading, isTransferring, transferProgress,\n } = getMediaTransferState(message, uploadProgress || downloadProgress, shouldDownload && !fullMediaData);\n const wasDownloadDisabled = usePrevious(isDownloadAllowed) === false;\n const {\n shouldRender: shouldRenderSpinner,\n transitionClassNames: spinnerClassNames,\n } = useShowTransition(isTransferring, undefined, wasDownloadDisabled, 'slow');\n const {\n shouldRenderThumb, shouldRenderFullMedia, transitionClassNames,\n } = useTransitionForMedia(fullMediaData, 'slow');\n\n const handleClick = useCallback(() => {\n if (isUploading) {\n if (onCancelUpload) {\n onCancelUpload(message);\n }\n } else if (!fullMediaData) {\n setIsDownloadAllowed((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).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]);\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 {shouldRenderThumb && (\n \n )}\n {shouldRenderFullMedia && (\n \n )}\n {shouldRenderSpinner && (\n
\n \n
\n )}\n {!fullMediaData && !isDownloadAllowed && (\n \n )}\n {isTransferring && (\n {Math.round(transferProgress * 100)}%\n )}\n \n );\n};\n\nexport default Photo;\n","import { RefObject } from 'react';\nimport { useCallback, useRef } from '../lib/teact/teact';\n\nimport useHeavyAnimationCheck from './useHeavyAnimationCheck';\nimport safePlay from '../util/safePlay';\n\nexport default function useHeavyAnimationCheckForVideo(playerRef: RefObject, shouldPlay: boolean) {\n const shouldPlayRef = useRef();\n shouldPlayRef.current = shouldPlay;\n\n const pause = useCallback(() => {\n if (playerRef.current) {\n playerRef.current.pause();\n }\n }, [playerRef]);\n\n const play = useCallback(() => {\n if (playerRef.current && shouldPlayRef.current) {\n safePlay(playerRef.current);\n }\n }, [playerRef]);\n\n useHeavyAnimationCheck(pause, play);\n}\n","import { useCallback, useRef } from '../../../../lib/teact/teact';\nimport { fastRaf } from '../../../../util/schedulers';\nimport useBackgroundMode from '../../../../hooks/useBackgroundMode';\nimport safePlay from '../../../../util/safePlay';\n\nexport default (playerRef: { current: HTMLVideoElement | null }, isPlayAllowed = false) => {\n const wasPlaying = useRef(false);\n const isFrozen = useRef(false);\n\n const freezePlaying = useCallback(() => {\n isFrozen.current = true;\n\n if (!isPlayAllowed || !playerRef.current) {\n return;\n }\n\n if (!wasPlaying.current) {\n wasPlaying.current = !playerRef.current.paused;\n }\n\n playerRef.current.pause();\n }, [isPlayAllowed, playerRef]);\n\n const unfreezePlaying = useCallback(() => {\n // At this point HTMLVideoElement can be unmounted from the DOM\n if (isPlayAllowed && playerRef.current && wasPlaying.current && document.body.contains(playerRef.current)) {\n safePlay(playerRef.current);\n }\n\n wasPlaying.current = false;\n isFrozen.current = false;\n }, [isPlayAllowed, playerRef]);\n\n const unfreezePlayingOnRaf = useCallback(() => {\n fastRaf(unfreezePlaying);\n }, [unfreezePlaying]);\n\n if (!document.hasFocus()) {\n freezePlaying();\n }\n\n useBackgroundMode(freezePlaying, unfreezePlayingOnRaf);\n};\n","import React, {\n FC, useCallback, useRef, useState,\n} from '../../../lib/teact/teact';\n\nimport { 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 useMediaWithDownloadProgress from '../../../hooks/useMediaWithDownloadProgress';\nimport useMedia from '../../../hooks/useMedia';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport useTransitionForMedia from '../../../hooks/useTransitionForMedia';\nimport usePrevious from '../../../hooks/usePrevious';\nimport useBuffering from '../../../hooks/useBuffering';\nimport useHeavyAnimationCheckForVideo from '../../../hooks/useHeavyAnimationCheckForVideo';\nimport useVideoCleanup from '../../../hooks/useVideoCleanup';\nimport usePauseOnInactive from './hooks/usePauseOnInactive';\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 shouldAutoLoad?: boolean;\n shouldAutoPlay?: boolean;\n uploadProgress?: number;\n dimensions?: IMediaDimensions;\n lastSyncTime?: number;\n onClick?: (id: number) => void;\n onCancelUpload?: (message: ApiMessage) => void;\n};\n\nconst Video: FC = ({\n id,\n message,\n observeIntersection,\n noAvatars,\n shouldAutoLoad,\n shouldAutoPlay,\n uploadProgress,\n lastSyncTime,\n dimensions,\n onClick,\n onCancelUpload,\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 [isDownloadAllowed, setIsDownloadAllowed] = useState(shouldAutoLoad);\n const shouldDownload = Boolean(isDownloadAllowed && isIntersecting && lastSyncTime);\n const [isPlayAllowed, setIsPlayAllowed] = useState(shouldAutoPlay);\n\n const previewBlobUrl = useMedia(\n getMessageMediaHash(message, 'pictogram'),\n !(isIntersecting && lastSyncTime),\n getMessageMediaFormat(message, 'pictogram'),\n lastSyncTime,\n );\n const { mediaData, downloadProgress } = useMediaWithDownloadProgress(\n getMessageMediaHash(message, 'inline'),\n !shouldDownload,\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 { isBuffered, bufferingHandlers } = useBuffering(!shouldAutoLoad);\n const { isUploading, isTransferring, transferProgress } = getMediaTransferState(\n message,\n uploadProgress || downloadProgress,\n shouldDownload && !isBuffered,\n );\n const wasDownloadDisabled = usePrevious(isDownloadAllowed) === false;\n const {\n shouldRender: shouldRenderSpinner,\n transitionClassNames: spinnerClassNames,\n } = useShowTransition(isTransferring, undefined, wasDownloadDisabled);\n const { transitionClassNames } = useTransitionForMedia(fullMediaData, 'slow');\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 && 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 useHeavyAnimationCheckForVideo(videoRef, Boolean(isInline && shouldAutoPlay));\n usePauseOnInactive(videoRef, isPlayAllowed);\n useVideoCleanup(videoRef, [isInline]);\n\n const handleClick = useCallback(() => {\n if (isUploading) {\n if (onCancelUpload) {\n onCancelUpload(message);\n }\n } else if (!fullMediaData) {\n setIsDownloadAllowed((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, fullMediaData, isPlayAllowed, onClick, onCancelUpload, message]);\n\n const className = buildClassName('media-inner dark', !isUploading && 'interactive');\n const videoClassName = buildClassName('full-media', transitionClassNames);\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 {!previewBlobUrl && (\n \n )}\n {previewBlobUrl && (\n \n )}\n {isInline && (\n \n \n \n )}\n {(isDownloadAllowed && !isPlayAllowed && !shouldRenderSpinner) && (\n \n )}\n {shouldRenderSpinner && (\n
\n \n
\n )}\n {!isDownloadAllowed && (\n \n )}\n {isTransferring ? (\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 { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { ApiUser, ApiContact } from '../../../api/types';\n\nimport { selectUser } from '../../../modules/selectors';\nimport { formatPhoneNumberWithCode } from '../../../util/phoneNumber';\n\nimport Avatar from '../../common/Avatar';\n\nimport './Contact.scss';\nimport { pick } from '../../../util/iteratees';\nimport buildClassName from '../../../util/buildClassName';\n\ntype OwnProps = {\n contact: ApiContact;\n};\n\ntype StateProps = {\n user?: ApiUser;\n};\n\ntype DispatchProps = Pick;\n\nconst Contact: FC = ({\n contact, user, openUserInfo,\n}) => {\n const {\n firstName,\n lastName,\n phoneNumber,\n userId,\n } = contact;\n\n const handleClick = useCallback(() => {\n openUserInfo({ id: userId });\n }, [openUserInfo, userId]);\n\n return (\n \n \n
\n
{firstName} {lastName}
\n
{formatPhoneNumberWithCode(phoneNumber)}
\n
\n \n );\n};\n\nexport default withGlobal(\n (global, { contact }): StateProps => {\n return {\n user: selectUser(global, contact.userId),\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'openUserInfo',\n ]),\n)(Contact);\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([]);\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, {\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 && 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 { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport {\n ApiMessage, ApiPoll, ApiUser, ApiPollAnswer,\n} from '../../../api/types';\n\nimport { pick } from '../../../util/iteratees';\nimport renderText from '../../common/helpers/renderText';\nimport { renderTextWithEntities } from '../../common/helpers/renderMessageText';\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\ntype DispatchProps = Pick;\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 loadMessage,\n onSendVote,\n openPollResults,\n serverTimeOffset,\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)}
\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 (setGlobal, actions): DispatchProps => pick(actions, ['loadMessage', 'openPollResults']),\n)(Poll));\n","import React, { FC, memo, useCallback } from '../../../lib/teact/teact';\n\nimport { ApiMessage } from '../../../api/types';\nimport { ObserveFn } from '../../../hooks/useIntersectionObserver';\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 shouldAutoLoad?: boolean;\n shouldAutoPlay?: boolean;\n inPreview?: boolean;\n lastSyncTime?: number;\n onMediaClick?: () => void;\n onCancelMediaTransfer?: () => void;\n};\n\nconst WebPage: FC = ({\n message,\n observeIntersection,\n noAvatars,\n shouldAutoLoad,\n shouldAutoPlay,\n inPreview,\n lastSyncTime,\n onMediaClick,\n onCancelMediaTransfer,\n}) => {\n const webPage = getMessageWebPage(message);\n\n let isSquarePhoto = false;\n if (webPage && 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 renderText from '../../common/helpers/renderText';\n\nimport './Invoice.scss';\n\ntype OwnProps = {\n message: ApiMessage;\n};\n\nconst Invoice: FC = ({\n message,\n}) => {\n const invoice = getMessageInvoice(message);\n\n const {\n title,\n text,\n description,\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 {description && (\n

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

\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 { 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 { GlobalActions } from '../../../../global/types';\nimport {\n selectIsInSelectMode,\n selectIsMessageSelected,\n} from '../../../../modules/selectors';\n\nimport { pick } from '../../../../util/iteratees';\n\ntype OwnProps = PhotoProps & VideoProps;\n\ntype StateProps = {\n isInSelectMode?: boolean;\n isSelected?: boolean;\n};\n\ntype DispatchProps = Pick;\n\nexport default function withSelectControl(WrappedComponent: FC) {\n const ComponentWithSelectControl: FC = (props) => {\n const {\n isInSelectMode,\n isSelected,\n message,\n toggleMessageSelection,\n dimensions,\n } = props;\n\n const handleMessageSelect = useCallback((e: ReactMouseEvent) => {\n e.stopPropagation();\n toggleMessageSelection({ messageId: message.id, withShift: e && 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 (setGlobal, actions) => pick(actions, [\n 'toggleMessageSelection',\n ]),\n )(ComponentWithSelectControl));\n}\n","import React, { FC, useCallback } from '../../../lib/teact/teact';\n\nimport { GlobalActions, GlobalState } from '../../../global/types';\nimport { ApiMessage } from '../../../api/types';\nimport { IAlbum } from '../../../types';\nimport { AlbumRectPart, IAlbumLayout } from './helpers/calculateAlbumLayout';\n\nimport { getMessageContent } from '../../../modules/helpers';\nimport { withGlobal } from '../../../lib/teact/teactn';\nimport { pick } from '../../../util/iteratees';\nimport withSelectControl from './hocs/withSelectControl';\nimport { ObserveFn } from '../../../hooks/useIntersectionObserver';\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 shouldAutoLoad?: boolean;\n shouldAutoPlay?: boolean;\n hasCustomAppendix?: boolean;\n lastSyncTime?: number;\n isOwn: boolean;\n albumLayout: IAlbumLayout;\n onMediaClick: (messageId: number) => void;\n};\n\ntype StateProps = {\n uploadsById: GlobalState['fileUploads']['byMessageLocalId'];\n};\n\ntype DispatchProps = Pick;\n\nconst Album: FC = ({\n album,\n observeIntersection,\n shouldAutoLoad,\n shouldAutoPlay,\n hasCustomAppendix,\n lastSyncTime,\n isOwn,\n albumLayout,\n onMediaClick,\n uploadsById,\n cancelSendingMessage,\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 ? fileUpload.progress : undefined;\n const { dimensions, sides } = albumLayout.layout[index];\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): StateProps => {\n return {\n uploadsById: global.fileUploads.byMessageLocalId,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'cancelSendingMessage',\n ]),\n)(Album);\n","import React, {\n FC,\n useCallback,\n useEffect,\n useRef,\n useState,\n} from '../../../lib/teact/teact';\n\nimport { ApiMessage } from '../../../api/types';\n\nimport { ROUND_VIDEO_DIMENSIONS } from '../../common/helpers/mediaDimensions';\nimport { formatMediaDuration } from '../../../util/dateFormat';\nimport { getMessageMediaFormat, getMessageMediaHash } from '../../../modules/helpers';\nimport { ObserveFn, useIsIntersecting } from '../../../hooks/useIntersectionObserver';\nimport useMediaWithDownloadProgress from '../../../hooks/useMediaWithDownloadProgress';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport useTransitionForMedia from '../../../hooks/useTransitionForMedia';\nimport usePrevious from '../../../hooks/usePrevious';\nimport useBuffering from '../../../hooks/useBuffering';\nimport buildClassName from '../../../util/buildClassName';\nimport useHeavyAnimationCheckForVideo from '../../../hooks/useHeavyAnimationCheckForVideo';\nimport useVideoCleanup from '../../../hooks/useVideoCleanup';\nimport usePauseOnInactive from './hooks/usePauseOnInactive';\nimport useBlurredMediaThumbRef from './hooks/useBlurredMediaThumbRef';\nimport safePlay from '../../../util/safePlay';\nimport { fastRaf } from '../../../util/schedulers';\n\nimport ProgressSpinner from '../../ui/ProgressSpinner';\n\nimport './RoundVideo.scss';\n\ntype OwnProps = {\n message: ApiMessage;\n observeIntersection: ObserveFn;\n shouldAutoLoad?: boolean;\n shouldAutoPlay?: boolean;\n lastSyncTime?: number;\n};\n\nlet currentOnRelease: NoneToVoidFunction;\n\nfunction createCapture(onRelease: NoneToVoidFunction) {\n return () => {\n if (currentOnRelease) {\n currentOnRelease();\n }\n\n currentOnRelease = onRelease;\n };\n}\n\nconst RoundVideo: FC = ({\n message,\n observeIntersection,\n shouldAutoLoad,\n shouldAutoPlay,\n lastSyncTime,\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 [isDownloadAllowed, setIsDownloadAllowed] = useState(shouldAutoLoad && shouldAutoPlay);\n const shouldDownload = Boolean(isDownloadAllowed && isIntersecting && lastSyncTime);\n const { mediaData, downloadProgress } = useMediaWithDownloadProgress(\n getMessageMediaHash(message, 'inline'),\n !shouldDownload,\n getMessageMediaFormat(message, 'inline'),\n lastSyncTime,\n );\n const thumbRef = useBlurredMediaThumbRef(message, mediaData);\n\n const { isBuffered, bufferingHandlers } = useBuffering();\n const isTransferring = isDownloadAllowed && !isBuffered;\n const wasDownloadDisabled = usePrevious(isDownloadAllowed) === false;\n const {\n shouldRender: shouldSpinnerRender,\n transitionClassNames: spinnerClassNames,\n } = useShowTransition(isTransferring || !isBuffered, undefined, wasDownloadDisabled);\n const { shouldRenderThumb, transitionClassNames } = useTransitionForMedia(mediaData, 'slow');\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 circumference = 94 * 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 } 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 = () => {\n setIsActivated(false);\n setProgress(0);\n safePlay(playerRef.current!);\n\n fastRaf(() => {\n playingProgressRef.current!.innerHTML = '';\n });\n };\n\n const capturePlaying = createCapture(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 useHeavyAnimationCheckForVideo(playerRef, shouldPlay);\n usePauseOnInactive(playerRef, Boolean(mediaData));\n useVideoCleanup(playerRef, [mediaData]);\n\n const handleClick = useCallback(() => {\n if (!mediaData) {\n setIsDownloadAllowed((isAllowed) => !isAllowed);\n\n return;\n }\n\n const playerEl = playerRef.current!;\n if (isActivated) {\n if (playerEl.paused) {\n safePlay(playerEl);\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\n setIsActivated(true);\n }\n }, [capturePlaying, isActivated, mediaData]);\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 {(shouldRenderThumb || mediaData) && (\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 && !isDownloadAllowed && (\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';\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 return (\n
\n {message.inlineButtons!.map((row) => (\n
\n {row.map((button) => (\n onClick({ button })}\n >\n {renderText(button.text)}\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, useEffect,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport {\n ApiChat, ApiMessage, ApiThreadInfo, ApiUser,\n} from '../../../api/types';\nimport { GlobalActions } from '../../../global/types';\n\nimport { pick } from '../../../util/iteratees';\nimport { isChatPrivate } from '../../../modules/helpers';\nimport { formatIntegerCompact } from '../../../util/textFormat';\nimport buildClassName from '../../../util/buildClassName';\nimport { selectThreadInfo, selectThreadOriginChat } from '../../../modules/selectors';\nimport useLang from '../../../hooks/useLang';\n\nimport Avatar from '../../common/Avatar';\n\nimport './CommentButton.scss';\n\ntype OwnProps = {\n message: ApiMessage;\n disabled?: boolean;\n};\n\ntype StateProps = {\n threadInfo: ApiThreadInfo;\n usersById?: Record;\n chatsById?: Record;\n shouldRequestThreadUpdate: boolean;\n};\n\ntype DispatchProps = Pick;\n\nconst CommentButton: FC = ({\n disabled,\n threadInfo,\n usersById,\n chatsById,\n shouldRequestThreadUpdate,\n openChat,\n requestThreadInfoUpdate,\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\n useEffect(() => {\n if (shouldRequestThreadUpdate) {\n requestThreadInfoUpdate({ chatId, threadId });\n }\n }, [chatId, requestThreadInfoUpdate, shouldRequestThreadUpdate, threadId]);\n\n if (messagesCount === undefined) {\n return undefined;\n }\n\n const recentRepliers = recentReplierIds && recentReplierIds.map((peerId) => {\n return isChatPrivate(peerId) ? usersById![peerId] : chatsById![peerId];\n }).filter(Boolean);\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(withGlobal(\n (global, { message }) => {\n const { threadId, chatId } = message.threadInfo!;\n\n const threadInfo = selectThreadInfo(global, chatId, threadId) || message.threadInfo!;\n const chat = selectThreadOriginChat(global, chatId, threadId);\n const { byId: usersById } = global.users;\n const { byId: chatsById } = global.chats;\n\n return {\n threadInfo,\n usersById,\n chatsById,\n shouldRequestThreadUpdate: !!chat && !threadInfo.topMessageId,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'openChat',\n 'requestThreadInfoUpdate',\n ]),\n)(CommentButton));\n","import React, {\n FC,\n memo,\n useCallback,\n useEffect,\n useLayoutEffect,\n useMemo,\n useRef,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions, MessageListType } from '../../../global/types';\nimport {\n ApiMessage,\n ApiMessageOutgoingStatus,\n ApiUser,\n ApiChat,\n ApiSticker,\n MAIN_THREAD_ID,\n} from '../../../api/types';\nimport {\n FocusDirection, IAlbum, ISettings, MediaViewerOrigin,\n} from '../../../types';\n\nimport { IS_ANDROID, IS_TOUCH_ENV } from '../../../util/environment';\nimport { pick } from '../../../util/iteratees';\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 selectShouldAutoLoadMedia,\n selectShouldAutoPlayMedia,\n selectShouldLoopStickers,\n selectTheme,\n} from '../../../modules/selectors';\nimport {\n getMessageContent,\n isOwnMessage,\n isReplyMessage,\n isAnonymousOwnMessage,\n isMessageLocal,\n isChatPrivate,\n getMessageCustomShape,\n isChatChannel,\n getMessageSingleEmoji,\n getSenderTitle,\n getUserColorKey,\n} from '../../../modules/helpers';\nimport buildClassName from '../../../util/buildClassName';\nimport windowSize from '../../../util/windowSize';\nimport useEnsureMessage from '../../../hooks/useEnsureMessage';\nimport useContextMenuHandlers from '../../../hooks/useContextMenuHandlers';\nimport { renderMessageText } from '../../common/helpers/renderMessageText';\nimport { ROUND_VIDEO_DIMENSIONS } from '../../common/helpers/mediaDimensions';\nimport { buildContentClassName, isEmojiOnlyMessage } from './helpers/buildContentClassName';\nimport { getMinMediaWidth, calculateMediaDimensions } from './helpers/mediaDimensions';\nimport { calculateAlbumLayout } from './helpers/calculateAlbumLayout';\nimport { preventMessageInputBlur } from '../helpers/preventMessageInputBlur';\nimport renderText from '../../common/helpers/renderText';\nimport calculateAuthorWidth from './helpers/calculateAuthorWidth';\nimport { ObserveFn, useOnIntersect } from '../../../hooks/useIntersectionObserver';\nimport useFocusMessage from './hooks/useFocusMessage';\nimport useLang from '../../../hooks/useLang';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport useFlag from '../../../hooks/useFlag';\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';\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 message: ApiMessage;\n observeIntersectionForBottom: ObserveFn;\n observeIntersectionForMedia: ObserveFn;\n observeIntersectionForAnimatedStickers: ObserveFn;\n album?: IAlbum;\n noAvatars?: boolean;\n withAvatar?: boolean;\n withSenderName?: boolean;\n threadId: number;\n messageListType: MessageListType;\n noComments: boolean;\n appearanceOrder: number;\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 isFocused?: boolean;\n focusDirection?: FocusDirection;\n noFocusHighlight?: boolean;\n isForwarding?: boolean;\n isChatWithSelf?: boolean;\n isChannel?: boolean;\n lastSyncTime?: number;\n highlight?: string;\n isSingleEmoji?: boolean;\n animatedEmoji?: ApiSticker;\n isInSelectMode?: boolean;\n isSelected?: boolean;\n isGroupSelected?: boolean;\n threadId?: number;\n isPinnedList?: boolean;\n shouldAutoLoadMedia?: boolean;\n shouldAutoPlayMedia?: boolean;\n shouldLoopStickers?: boolean;\n};\n\ntype DispatchProps = Pick;\n\nconst NBSP = '\\u00A0';\nconst GROUP_MESSAGE_HOVER_ATTRIBUTE = 'data-is-document-group-hover';\n// eslint-disable-next-line max-len\nconst APPENDIX_OWN = '';\n// eslint-disable-next-line max-len\nconst APPENDIX_NOT_OWN = '';\nconst APPEARANCE_DELAY = 10;\nconst NO_MEDIA_CORNERS_THRESHOLD = 18;\nconst ANDROID_KEYBOARD_HIDE_DELAY_MS = 350;\n\nconst Message: FC = ({\n message,\n chatUsername,\n observeIntersectionForBottom,\n observeIntersectionForMedia,\n observeIntersectionForAnimatedStickers,\n album,\n noAvatars,\n withAvatar,\n withSenderName,\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 isFocused,\n focusDirection,\n noFocusHighlight,\n isForwarding,\n isChatWithSelf,\n isChannel,\n lastSyncTime,\n highlight,\n animatedEmoji,\n isInSelectMode,\n isSelected,\n isGroupSelected,\n threadId,\n messageListType,\n isPinnedList,\n shouldAutoLoadMedia,\n shouldAutoPlayMedia,\n shouldLoopStickers,\n focusMessage,\n openMediaViewer,\n openAudioPlayer,\n openUserInfo,\n openChat,\n cancelSendingMessage,\n markMessagesRead,\n sendPollVote,\n toggleMessageSelection,\n setReplyingToId,\n openForwardMenu,\n clickInlineButton,\n disableContextMenuHint,\n showNotification,\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 appendixRef = useRef(null);\n const lang = useLang();\n\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 { chatId, id: messageId, threadInfo } = 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 { forwardInfo, viaBotId } = message;\n const asForwarded = forwardInfo && !isChatWithSelf && !forwardInfo.isLinkedChannelPost;\n const isInDocumentGroup = !!message.groupedId && !message.isInAlbum;\n const isAlbum = Boolean(album) && album!.messages.length > 1;\n const {\n text, photo, video, audio, voice, document, sticker, contact, poll, webPage, invoice,\n } = getMessageContent(message);\n const customShape = getMessageCustomShape(message);\n const textParts = renderMessageText(message, highlight, isEmojiOnlyMessage(customShape));\n const isContextMenuShown = contextMenuPosition !== undefined;\n const signature = (\n (isChannel && message.adminTitle) || (forwardInfo && !asForwarded && forwardInfo.adminTitle) || undefined\n );\n const metaSafeAuthorWidth = useMemo(() => {\n return signature ? calculateAuthorWidth(signature) : undefined;\n }, [signature]);\n const canShowActionButton = (\n !(isContextMenuShown || isInSelectMode || isForwarding)\n && (!isInDocumentGroup || isLastInDocumentGroup)\n );\n const canForward = isChannel && !isScheduled;\n const canFocus = Boolean(isPinnedList\n || (forwardInfo && (forwardInfo.isChannelPost || (isChatWithSelf && !isOwn)) && forwardInfo.fromMessageId));\n const avatarPeer = forwardInfo && (isChatWithSelf || !sender) ? originSender : sender;\n const senderPeer = forwardInfo ? originSender : sender;\n\n const containerClassName = buildClassName(\n 'Message message-list-item',\n isFirstInGroup && 'first-in-group',\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 transitionClassNames,\n );\n const contentClassName = buildContentClassName(message, {\n hasReply,\n customShape,\n isLastInGroup,\n asForwarded,\n hasThread,\n forceSenderName,\n hasComments: message.threadInfo && message.threadInfo.messagesCount > 0,\n hasActionButton: canForward || canFocus,\n });\n const withCommentButton = message.threadInfo && (!isInDocumentGroup || isLastInDocumentGroup)\n && messageListType === 'thread' && !noComments;\n const withAppendix = contentClassName.includes('has-appendix');\n\n useEnsureMessage(chatId, hasReply ? message.replyToMessageId : undefined, replyMessage, message.id);\n useFocusMessage(ref, chatId, isFocused, focusDirection, noFocusHighlight);\n useLayoutEffect(() => {\n if (!appendixRef.current) {\n return;\n }\n\n appendixRef.current.innerHTML = isOwn ? APPENDIX_OWN : APPENDIX_NOT_OWN;\n }, [isOwn, withAppendix]);\n\n const handleGroupDocumentMessagesSelect = useCallback((e: React.MouseEvent) => {\n e.stopPropagation();\n\n toggleMessageSelection({\n messageId,\n groupedId: message.groupedId,\n });\n }, [messageId, message.groupedId, toggleMessageSelection]);\n\n const handleMessageSelect = useCallback((e?: React.MouseEvent) => {\n if (isLocal) {\n return;\n }\n\n const params = isAlbum && album && album.messages\n ? {\n messageId,\n childMessageIds: album.messages.map(({ id }) => id),\n withShift: e && e.shiftKey,\n }\n : { messageId, withShift: e && e.shiftKey };\n toggleMessageSelection(params);\n }, [isLocal, isAlbum, album, messageId, toggleMessageSelection]);\n\n const handleContainerDoubleClick = useCallback(() => {\n setReplyingToId({ messageId });\n }, [setReplyingToId, messageId]);\n\n const handleContentDoubleClick = useCallback((e: React.MouseEvent) => {\n e.stopPropagation();\n }, []);\n\n const handleMouseDown = (e: React.MouseEvent) => {\n preventMessageInputBlur(e);\n\n if (!isLocal) {\n handleBeforeContextMenu(e);\n }\n };\n\n const handleAvatarClick = useCallback(() => {\n if (!avatarPeer) {\n return;\n }\n\n if (isChatPrivate(avatarPeer.id)) {\n openUserInfo({ id: avatarPeer.id });\n } else {\n openChat({ id: avatarPeer.id });\n }\n }, [avatarPeer, openUserInfo, openChat]);\n\n const handleSenderClick = useCallback(() => {\n if (!senderPeer) {\n showNotification({ message: lang('HidAccount') });\n\n return;\n }\n\n if (isChatPrivate(senderPeer.id)) {\n openUserInfo({ id: senderPeer.id });\n } else {\n openChat({ id: senderPeer.id });\n }\n }, [senderPeer, showNotification, lang, openUserInfo, openChat]);\n\n const handleViaBotClick = useCallback(() => {\n if (!botSender) {\n return;\n }\n\n openUserInfo({ id: botSender.id });\n }, [botSender, openUserInfo]);\n\n const handleReplyClick = useCallback((): void => {\n focusMessage({\n chatId, threadId, messageId: message.replyToMessageId, replyMessageId: messageId,\n });\n }, [focusMessage, chatId, threadId, message.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 handleClick = useCallback((e: React.MouseEvent) => {\n const target = e.target as HTMLDivElement;\n if (!target.classList.contains('text-content') && !target.classList.contains('Message')) {\n return;\n }\n\n if (IS_ANDROID) {\n if (windowSize.getIsKeyboardVisible()) {\n setTimeout(() => { onContextMenu(e); }, ANDROID_KEYBOARD_HIDE_DELAY_MS);\n } else {\n onContextMenu(e);\n }\n } else {\n onContextMenu(e);\n }\n }, [onContextMenu]);\n\n const handleContextMenu = useCallback((e: React.MouseEvent) => {\n if (IS_ANDROID) {\n handleMessageSelect(e);\n } else {\n onContextMenu(e);\n }\n }, [onContextMenu, handleMessageSelect]);\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: message.groupedId });\n }, [openForwardMenu, chatId, message.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: message.groupedId, groupedChatId: chatId,\n });\n return;\n }\n focusMessage({\n chatId: forwardInfo!.fromChatId, messageId: forwardInfo!.fromMessageId,\n });\n }, [focusMessage, forwardInfo, message, chatId, isInDocumentGroup]);\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;\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 function renderAvatar() {\n const isAvatarPeerUser = avatarPeer && isChatPrivate(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 renderContent() {\n const className = buildClassName(\n 'content-inner',\n asForwarded && !customShape && 'forwarded-message',\n hasReply && 'reply-message',\n noMediaCorners && 'no-media-corners',\n );\n const hasCustomAppendix = isLastInGroup && !textParts && !asForwarded && !hasThread;\n const shouldInlineMeta = !webPage && !animatedEmoji && textParts;\n const textContentClass = buildClassName(\n 'text-content',\n shouldInlineMeta && '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 {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 {!animatedEmoji && textParts && (\n

\n {textParts}\n {shouldInlineMeta && (\n \n )}\n

\n )}\n {webPage && (\n \n )}\n {invoice && (\n \n )}\n
\n );\n }\n\n function renderSenderName() {\n const shouldRender = !(customShape && !viaBotId) && (\n (withSenderName && !photo && !video) || asForwarded || viaBotId || forceSenderName\n ) && (!isInDocumentGroup || isFirstInDocumentGroup);\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 && 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 && forwardInfo.isLinkedChannelPost ? (\n {lang('DiscussChannel')}\n ) : message.adminTitle && !isChannel ? (\n {message.adminTitle}\n ) : undefined}\n
\n );\n }\n\n return (\n \n \n {!isLocal && !isInDocumentGroup && (\n
\n {isSelected && }\n
\n )}\n {!isLocal && isLastInDocumentGroup && (\n \n {isGroupSelected && (\n \n )}\n \n )}\n {withAvatar && renderAvatar()}\n \n \n {asForwarded && !customShape && (!isInDocumentGroup || isFirstInDocumentGroup) && (\n
{lang('ForwardedMessage')}
\n )}\n {renderContent()}\n {(!isInDocumentGroup || isLastInDocumentGroup) && !(!webPage && !animatedEmoji && textParts) && (\n \n )}\n {canShowActionButton && canForward ? (\n \n \n \n ) : canShowActionButton && canFocus ? (\n \n \n \n ) : undefined}\n {withCommentButton && }\n {withAppendix &&
}\n
\n {message.inlineButtons && (\n \n )}\n \n {contextMenuPosition && (\n \n )}\n \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\nexport default memo(withGlobal(\n (global, ownProps): StateProps => {\n const { focusedMessage, forwardMessages, lastSyncTime } = global;\n const {\n message, album, withSenderName, withAvatar, threadId, messageListType,\n } = ownProps;\n const {\n id, chatId, viaBotId, replyToMessageId, isOutgoing,\n } = message;\n\n const chat = selectChat(global, chatId);\n const isChatWithSelf = selectIsChatWithSelf(global, chatId);\n const isChannel = chat && isChatChannel(chat);\n const chatUsername = chat && chat.username;\n\n const forceSenderName = !isChatWithSelf && isAnonymousOwnMessage(message);\n const canShowSender = withSenderName || withAvatar || forceSenderName;\n const sender = canShowSender ? selectSender(global, message) : undefined;\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, 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 { direction: focusDirection, noHighlight: noFocusHighlight } = (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 && album.messages) {\n isSelected = album.messages.every(({ id: messageId }) => selectIsMessageSelected(global, messageId));\n } else {\n isSelected = selectIsMessageSelected(global, id);\n }\n\n return {\n theme: selectTheme(global),\n chatUsername,\n forceSenderName,\n sender,\n originSender,\n botSender,\n shouldHideReply,\n isThreadTop,\n replyMessage,\n replyMessageSender,\n isFocused,\n isForwarding,\n isChatWithSelf,\n isChannel,\n lastSyncTime,\n highlight,\n isSingleEmoji: Boolean(singleEmoji),\n animatedEmoji: singleEmoji ? selectAnimatedEmoji(global, singleEmoji) : undefined,\n isInSelectMode: selectIsInSelectMode(global),\n isSelected,\n isGroupSelected: (\n !!message.groupedId && !message.isInAlbum && selectIsDocumentGroupSelected(global, chatId, message.groupedId)\n ),\n threadId,\n isPinnedList: messageListType === 'pinned',\n shouldAutoLoadMedia: chat ? selectShouldAutoLoadMedia(global, message, chat, sender) : undefined,\n shouldAutoPlayMedia: selectShouldAutoPlayMedia(global, message),\n shouldLoopStickers: selectShouldLoopStickers(global),\n ...(isOutgoing && { outgoingStatus: selectOutgoingStatus(global, message, messageListType === 'scheduled') }),\n ...(typeof uploadProgress === 'number' && { uploadProgress }),\n ...(isFocused && { focusDirection, noFocusHighlight }),\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'focusMessage',\n 'openMediaViewer',\n 'openAudioPlayer',\n 'cancelSendingMessage',\n 'openUserInfo',\n 'openChat',\n 'markMessagesRead',\n 'sendPollVote',\n 'toggleMessageSelection',\n 'setReplyingToId',\n 'openForwardMenu',\n 'clickInlineButton',\n 'disableContextMenuHint',\n 'showNotification',\n ]),\n)(Message));\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 ActionMessage from './ActionMessage';\n\ninterface OwnProps {\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 memoFirstUnreadIdRef: { current: number | undefined };\n threadId: number;\n type: MessageListType;\n threadTopMessageId: number | undefined;\n hasLinkedChat: boolean | undefined;\n isSchedule: boolean;\n noAppearanceAnimation: boolean;\n onFabToggle: AnyToVoidFunction;\n onNotchToggle: AnyToVoidFunction;\n openHistoryCalendar: Function;\n}\n\nconst UNREAD_DIVIDER_CLASS = 'unread-divider';\n\nconst MessageListContent: FC = ({\n messageIds,\n messageGroups,\n isViewportNewest,\n isUnread,\n withUsers,\n noAvatars,\n containerRef,\n anchorIdRef,\n memoFirstUnreadIdRef,\n threadId,\n type,\n threadTopMessageId,\n hasLinkedChat,\n isSchedule,\n noAppearanceAnimation,\n onFabToggle,\n onNotchToggle,\n openHistoryCalendar,\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 );\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 === memoFirstUnreadIdRef.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 === memoFirstUnreadIdRef.current ? unreadDivider : undefined,\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 \n \n
\n );\n};\n\nexport default memo(MessageListContent);\n","import { RefObject } from 'react';\nimport { getDispatch } from '../../../lib/teact/teactn';\nimport { useCallback, useMemo, useRef } from '../../../lib/teact/teact';\n\nimport { LoadMoreDirection } from '../../../types';\nimport { MessageListType } from '../../../global/types';\n\nimport { debounce } from '../../../util/schedulers';\nimport { useIntersectionObserver, useOnIntersect } from '../../../hooks/useIntersectionObserver';\nimport { MESSAGE_LIST_SENSITIVE_AREA } from '../../../config';\nimport resetScroll from '../../../util/resetScroll';\nimport useOnChange from '../../../hooks/useOnChange';\n\nconst FAB_THRESHOLD = 50;\nconst TOOLS_FREEZE_TIMEOUT = 100;\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) {\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 const toggleScrollTools = useCallback(() => {\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 const { offsetHeight, scrollHeight, scrollTop } = containerRef.current!;\n const scrollBottom = scrollHeight - scrollTop - offsetHeight;\n const isNearBottom = scrollBottom <= FAB_THRESHOLD;\n const isAtBottom = scrollBottom <= 0;\n\n onFabToggle(isUnread ? !isAtBottom : !isNearBottom);\n onNotchToggle(!isAtBottom);\n }, [messageIds, isViewportNewest, containerRef, onFabToggle, isUnread, onNotchToggle]);\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 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 resetScroll(containerRef.current!);\n loadMoreBackwards();\n } else if (target.className === 'forwards-trigger') {\n resetScroll(containerRef.current!);\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,\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 }, toggleScrollTools);\n\n useOnIntersect(fabTriggerRef, observeIntersectionForNotch);\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 { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\nimport { ApiSticker, ApiUpdateConnectionStateType } from '../../api/types';\n\nimport { pick } from '../../util/iteratees';\nimport { selectChat } from '../../modules/selectors';\nimport { useIntersectionObserver } from '../../hooks/useIntersectionObserver';\nimport useLang from '../../hooks/useLang';\n\nimport StickerButton from '../common/StickerButton';\n\nimport './ContactGreeting.scss';\n\ntype OwnProps = {\n userId: number;\n};\n\ntype StateProps = {\n sticker?: ApiSticker;\n lastUnreadMessageId?: number;\n connectionState?: ApiUpdateConnectionStateType;\n};\n\ntype DispatchProps = Pick;\n\nconst INTERSECTION_DEBOUNCE_MS = 200;\n\nconst ContactGreeting: FC = ({\n sticker,\n connectionState,\n lastUnreadMessageId,\n loadGreetingStickers,\n sendMessage,\n markMessageListRead,\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\n\nexport default memo(withGlobal(\n (global, { userId }): StateProps => {\n const { stickers } = global.stickers.greeting;\n const sticker = stickers && stickers.length ? stickers[userId % 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 (setGlobal, actions): DispatchProps => pick(actions, [\n 'loadGreetingStickers', 'sendMessage', 'markMessageListRead',\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: number;\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\n\nexport default memo(NoMessages);\n","import React, {\n FC, memo, useCallback, useEffect, useMemo, useRef, useState,\n} from '../../lib/teact/teact';\nimport { getGlobal, withGlobal } from '../../lib/teact/teactn';\n\nimport {\n ApiAction, ApiMessage, ApiRestrictionReason, MAIN_THREAD_ID,\n} from '../../api/types';\nimport { GlobalActions, MessageListType } from '../../global/types';\nimport { LoadMoreDirection } from '../../types';\n\nimport { ANIMATION_END_DELAY, 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 { isChatChannel, isChatGroup, isChatPrivate } from '../../modules/helpers';\nimport { orderBy, pick } 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, MessageDateGroup } 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 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';\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: number;\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};\n\ntype StateProps = {\n isChatLoaded?: boolean;\n isChannelChat?: boolean;\n isGroupChat?: boolean;\n isChatWithSelf?: 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 hasFocusHighlight?: boolean;\n isSelectModeActive?: boolean;\n animationLevel?: number;\n lastMessage?: ApiMessage;\n botDescription?: string;\n threadTopMessageId?: number;\n threadFirstMessageId?: number;\n hasLinkedChat?: boolean;\n};\n\ntype DispatchProps = Pick;\n\nconst BOTTOM_THRESHOLD = 100;\nconst UNREAD_DIVIDER_TOP = 10;\nconst UNREAD_DIVIDER_TOP_WITH_TOOLS = 60;\nconst SCROLL_DEBOUNCE = 200;\nconst FOCUSING_DURATION = 1000;\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 isCreator,\n isBot,\n messageIds,\n messagesById,\n firstUnreadId,\n isViewportNewest,\n threadFirstMessageId,\n isRestricted,\n restrictionReason,\n focusingId,\n hasFocusHighlight,\n isSelectModeActive,\n loadViewportMessages,\n setScrollOffset,\n lastMessage,\n botDescription,\n threadTopMessageId,\n hasLinkedChat,\n openHistoryCalendar,\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 memoUnreadDividerBeforeIdRef = useRef();\n // Updated every time (to be used from intersection callback closure)\n const memoFirstUnreadIdRef = 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 useOnChange(() => {\n memoFirstUnreadIdRef.current = firstUnreadId;\n\n // Updated only once (to preserve divider even after messages are read)\n if (!memoUnreadDividerBeforeIdRef.current) {\n memoUnreadDividerBeforeIdRef.current = firstUnreadId;\n }\n }, [firstUnreadId]);\n\n useOnChange(() => {\n memoFocusingIdRef.current = focusingId;\n }, [focusingId]);\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 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 handleScroll = useCallback(() => {\n if (isScrollTopJustUpdatedRef.current) {\n isScrollTopJustUpdatedRef.current = false;\n return;\n }\n\n const container = containerRef.current!;\n\n if (!memoFocusingIdRef.current) {\n updateStickyDates(container, hasTools);\n }\n\n runDebouncedForScroll(() => {\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 if (isReady) {\n containerRef.current!.dataset.normalHeight = String(containerRef.current!.offsetHeight);\n }\n }, [windowHeight, isReady]);\n\n // Initial message loading\n useEffect(() => {\n if (!loadMoreAround || !isChatLoaded || isRestricted || focusingId) {\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 || !isReady) {\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, isReady]);\n\n // Handles updated message list, takes care of scroll repositioning\n useLayoutEffectWithPrevDeps(([\n prevMessageIds, prevIsViewportNewest, prevContainerHeight,\n ]: [\n typeof messageIds, typeof isViewportNewest, typeof containerHeight\n ]) => {\n const container = containerRef.current!;\n listItemElementsRef.current = Array.from(container.querySelectorAll('.message-list-item'));\n\n // During animation\n if (!container.offsetParent) {\n return;\n }\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 && (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 }, FOCUSING_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 // If two messages come at once (e.g. via Quiz Bot) then the first message will update `scrollOffset`\n // right away (before animation) which creates inconsistency until the animation completes.\n // To workaround that, we calculate `isAtBottom` with a \"buffer\" of the latest message height (this is approximate).\n const lastItemHeight = lastItemElement ? lastItemElement.offsetHeight : 0;\n const isAtBottom = isViewportNewest && prevIsViewportNewest && (\n scrollOffset - (prevContainerHeight || offsetHeight) - lastItemHeight <= BOTTOM_THRESHOLD\n );\n\n let newScrollTop!: number;\n\n const hasFirstMessageChanged = messageIds && prevMessageIds && messageIds[0] !== prevMessageIds[0];\n const hasLastMessageChanged = (\n messageIds && prevMessageIds && messageIds[messageIds.length - 1] !== prevMessageIds[prevMessageIds.length - 1]\n );\n const isAlreadyFocusing = messageIds && memoFocusingIdRef.current === messageIds[messageIds.length - 1];\n\n if (isAtBottom && hasLastMessageChanged && !hasFirstMessageChanged && !isAlreadyFocusing) {\n if (lastItemElement) {\n fastRaf(() => {\n fastSmoothScroll(\n container,\n lastItemElement,\n 'end',\n BOTTOM_FOCUS_MARGIN,\n undefined,\n undefined,\n undefined,\n true,\n );\n });\n }\n\n newScrollTop = scrollHeight - offsetHeight;\n scrollOffsetRef.current = Math.max(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 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, newScrollTop);\n\n if (!memoFocusingIdRef.current) {\n isScrollTopJustUpdatedRef.current = true;\n fastRaf(() => {\n isScrollTopJustUpdatedRef.current = false;\n });\n }\n\n scrollOffsetRef.current = Math.max(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]);\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 && isChatPrivate(chatId));\n const withUsers = Boolean((!isPrivate && !isChannelChat) || isChatWithSelf);\n const noAvatars = Boolean(!withUsers || isChannelChat);\n const shouldRenderGreeting = isChatPrivate(chatId) && !isChatWithSelf && !isBot\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 || checkSingleMessageActionByType('contactSignUp', messageGroups)\n || (lastMessage && lastMessage.content.action && lastMessage.content.action.type === 'contactSignUp')\n );\n const isGroupChatJustCreated = isGroupChat && isCreator\n && checkSingleMessageActionByType('chatCreate', messageGroups);\n\n const className = buildClassName(\n 'MessageList custom-scroll',\n noAvatars && 'no-avatars',\n !canPost && 'no-composer',\n type === 'pinned' && 'type-pinned',\n hasFocusHighlight && 'has-focus-highlight',\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\nfunction checkSingleMessageActionByType(type: ApiAction['type'], messageGroups?: MessageDateGroup[]) {\n return messageGroups\n && messageGroups.length === 1\n && messageGroups[0].senderGroups.length === 1\n && messageGroups[0].senderGroups[0].length === 1\n && 'content' in messageGroups[0].senderGroups[0][0]\n && messageGroups[0].senderGroups[0][0].content.action\n && messageGroups[0].senderGroups[0][0].content.action.type === type;\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 const hasFocusHighlight = focusingId ? !global.focusedMessage!.noHighlight : undefined;\n\n const withLastMessageWhenPreloading = (\n threadId === MAIN_THREAD_ID\n && !messageIds && !chat.unreadCount && !focusingId && lastMessage && !lastMessage.groupedId\n );\n\n const bot = selectChatBot(global, chatId);\n let botDescription: string | undefined;\n if (selectIsChatBotNotStarted(global, chatId)) {\n const chatBot = selectChatBot(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 isBot: Boolean(bot),\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 hasFocusHighlight,\n isSelectModeActive: selectIsInSelectMode(global),\n botDescription,\n threadTopMessageId,\n hasLinkedChat: chat.fullInfo && ('linkedChatId' in chat.fullInfo)\n ? Boolean(chat.fullInfo.linkedChatId)\n : undefined,\n ...(withLastMessageWhenPreloading && { lastMessage }),\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'loadViewportMessages',\n 'setScrollOffset',\n 'openHistoryCalendar',\n ]),\n)(MessageList));\n","import React, {\n FC, useCallback, memo, useRef,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions, 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 { pick } from '../../util/iteratees';\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};\n\ntype StateProps = {\n messageListType?: MessageListType;\n unreadCount?: number;\n};\n\ntype DispatchProps = Pick;\n\nconst FOCUS_MARGIN = 20;\n\nconst ScrollDownButton: FC = ({\n isShown,\n canPost,\n messageListType,\n unreadCount,\n focusNextReply,\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 );\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 (setGlobal, actions): DispatchProps => pick(actions, ['focusNextReply']),\n)(ScrollDownButton));\n","import { ApiAttachment } from '../../../../api/types';\nimport { preloadImage, preloadVideo, createPosterForVideo } from '../../../../util/files';\n\nconst MAX_QUICK_VIDEO_SIZE = 10 * 1024 ** 2; // 10 MB\nconst MAX_QUICK_IMG_SIZE = 1280; // px\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 (mimeType.startsWith('image/')) {\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 newBlob = await squeezeImage(img);\n if (newBlob) {\n URL.revokeObjectURL(blobUrl);\n return buildAttachment(filename, newBlob, true, options);\n } else {\n return buildAttachment(filename, blob, false, options);\n }\n }\n\n quick = { width, height };\n } else {\n previewBlobUrl = blobUrl;\n }\n } else if (mimeType.startsWith('video/')) {\n // Videos < 10 MB are always sent in quick mode (in other clients).\n // Quick mode for videos > 10 MB is not supported until client-side video squeezing is implemented.\n if (size < MAX_QUICK_VIDEO_SIZE) {\n const { videoWidth: width, videoHeight: height, duration } = await preloadVideo(blobUrl);\n quick = { width, height, duration };\n }\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\nfunction squeezeImage(img: HTMLImageElement): Promise {\n return new Promise((resolve) => {\n const canvas = document.createElement('canvas');\n const ctx = canvas.getContext('2d')!;\n\n let { width, height } = img;\n\n if (width > MAX_QUICK_IMG_SIZE || height > MAX_QUICK_IMG_SIZE) {\n if (width >= height) {\n height *= MAX_QUICK_IMG_SIZE / width;\n width = MAX_QUICK_IMG_SIZE;\n } else {\n width *= MAX_QUICK_IMG_SIZE / height;\n height = MAX_QUICK_IMG_SIZE;\n }\n }\n\n canvas.width = width;\n canvas.height = height;\n\n ctx.drawImage(img, 0, 0, img.width, img.height, 0, 0, width, height);\n canvas.toBlob(resolve, 'image/jpeg', 100);\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","export default __webpack_public_path__ + \"c0155344d336103c2b6a0b28cc510750.js\";","// @ts-ignore\nimport encoderPath from 'file-loader!opus-recorder/dist/encoderWorker.min';\n\nexport type Result = { blob: Blob; duration: number; waveform: number[] };\n\ninterface OpusRecorder extends Omit {\n new(options: AnyLiteral): OpusRecorder;\n\n start(stream?: MediaStreamAudioSourceNode): void;\n\n sourceNode: MediaStreamAudioSourceNode;\n\n ondataavailable: (typedArray: Uint8Array) => void;\n}\n\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: OpusRecorder }>;\nlet OpusRecorder: OpusRecorder;\nlet mediaRecorder: OpusRecorder;\n\nexport async function init() {\n if (!opusRecorderPromise) {\n // @ts-ignore\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: OpusRecorder, 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';\n\nconst CLIPBOARD_ACCEPTED_TYPES = ['image/png', 'image/jpeg', 'image/gif'];\nconst MAX_MESSAGE_LENGTH = 4096;\n\nexport default (\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 const { items } = e.clipboardData;\n const media = Array.from(items).find((item) => CLIPBOARD_ACCEPTED_TYPES.includes(item.type));\n const file = media && media.getAsFile();\n const pastedText = e.clipboardData.getData('text').substring(0, MAX_MESSAGE_LENGTH);\n\n if (!file && !pastedText) {\n return;\n }\n\n e.preventDefault();\n\n if (file && !editedMessage) {\n const attachment = await buildAttachment(file.name, file, true);\n setAttachments((attachments) => [\n ...attachments,\n attachment,\n ]);\n }\n\n if (pastedText) {\n insertTextAndUpdateCursor(pastedText, input ? input.id : undefined);\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","import { ApiFormattedText } from '../../../../api/types';\nimport { renderTextWithEntities } from '../../../common/helpers/renderMessageText';\n\nexport default function getMessageTextAsHtml(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","import { useCallback, useEffect, useMemo } from '../../../../lib/teact/teact';\n\nimport { ApiFormattedText, ApiMessage } from '../../../../api/types';\nimport { GlobalActions } from '../../../../global/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 '../helpers/parseMessageInput';\nimport getMessageTextAsHtml from '../helpers/getMessageTextAsHtml';\nimport useBackgroundMode from '../../../../hooks/useBackgroundMode';\nimport useBeforeUnload from '../../../../hooks/useBeforeUnload';\nimport { IS_TOUCH_ENV } from '../../../../util/environment';\n\n// Used to avoid running debounced callbacks when chat changes.\nlet currentChatId: number | undefined;\nlet currentThreadId: number | undefined;\n\nexport default (\n draft: ApiFormattedText | undefined,\n chatId: number,\n threadId: number,\n html: string,\n htmlRef: { current: string },\n setHtml: (html: string) => void,\n editedMessage: ApiMessage | undefined,\n saveDraft: GlobalActions['saveDraft'],\n clearDraft: GlobalActions['clearDraft'],\n) => {\n const updateDraft = useCallback((draftChatId: number, draftThreadId: number) => {\n if (htmlRef.current.length && !editedMessage) {\n saveDraft({ chatId: draftChatId, threadId: draftThreadId, draft: parseMessageInput(htmlRef.current!) });\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(getMessageTextAsHtml(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 // 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","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';\n\nconst tempEl = document.createElement('div');\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;\n\nexport default function useInlineBotTooltip(\n isAllowed: boolean,\n chatId: number,\n html: string,\n inlineBots?: Record,\n) {\n const [isOpen, markIsOpen, unmarkIsOpen] = useFlag();\n const text = getPlainText(html);\n const { queryInlineBot, resetInlineBot } = getDispatch();\n const { username, query, canShowHelp } = parseStartWithUsernameString(text);\n const usernameLowered = username.toLowerCase();\n const prevQuery = usePrevious(query);\n const prevUsername = usePrevious(username);\n const inlineBotData = inlineBots && inlineBots[usernameLowered];\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 && 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 closeTooltip: unmarkIsOpen,\n loadMore,\n username,\n id: botId,\n isGallery,\n switchPm,\n results,\n help: canShowHelp && help ? `@${username} ${help}` : undefined,\n };\n}\n\nfunction getPlainText(html: string) {\n tempEl.innerHTML = html.replace(/
/g, '\\n');\n\n return tempEl.innerText;\n}\n\nfunction parseStartWithUsernameString(text: string) {\n const result = text.match(INLINE_BOT_QUERY_REGEXP);\n if (!result) {\n return { username: '', query: '', canShowHelp: false };\n }\n\n return {\n username: result[1],\n query: result[2],\n canShowHelp: result[2] === '' && !text.match(HAS_NEW_LINE),\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 './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 } 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 StickerTooltipAsync;\n","import React, { FC, memo } from '../../../lib/teact/teact';\nimport { OwnProps } from './BotKeyboardMenu';\nimport { Bundles } from '../../../util/moduleLoader';\n\nimport useModuleLoader from '../../../hooks/useModuleLoader';\n\nconst BotKeyboardMenuAsync: FC = (props) => {\n const { isOpen } = props;\n const BotKeyboardMenu = useModuleLoader(Bundles.Extra, 'BotKeyboardMenu', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return BotKeyboardMenu ? : undefined;\n};\n\nexport default memo(BotKeyboardMenuAsync);\n","import React, {\n FC, memo, useCallback, useEffect,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\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 { pick } from '../../../util/iteratees';\nimport useAsyncRendering from '../../right/hooks/useAsyncRendering';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport buildClassName from '../../../util/buildClassName';\nimport { isChatPrivate } 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\ntype DispatchProps = Pick;\n\nconst FORWARD_RENDERING_DELAY = 300;\n\nconst ComposerEmbeddedMessage: FC = ({\n replyingToId,\n editingId,\n message,\n sender,\n shouldAnimate,\n forwardedMessagesCount,\n setReplyingToId,\n setEditingId,\n focusMessage,\n exitForwardMode,\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 = isChatPrivate(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 (setGlobal, actions): DispatchProps => pick(actions, [\n 'setReplyingToId',\n 'setEditingId',\n 'focusMessage',\n 'exitForwardMode',\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 './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, {\n FC, memo, useEffect, useMemo,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { ApiMessage, ApiMessageEntityTypes, ApiWebPage } from '../../../api/types';\n\nimport { RE_LINK_TEMPLATE } from '../../../config';\nimport { selectNoWebPage } from '../../../modules/selectors';\nimport { pick } from '../../../util/iteratees';\nimport parseMessageInput from './helpers/parseMessageInput';\nimport useOnChange from '../../../hooks/useOnChange';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport useCurrentOrPrev from '../../../hooks/useCurrentOrPrev';\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: number;\n threadId: number;\n messageText: string;\n disabled?: boolean;\n};\n\ntype StateProps = {\n webPagePreview?: ApiWebPage;\n noWebPage?: boolean;\n};\ntype DispatchProps = Pick;\n\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 loadWebPagePreview,\n clearWebPagePreview,\n toggleMessageWebPage,\n}) => {\n const link = useMemo(() => {\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 }, [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);\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 webPagePreview: global.webPagePreview,\n noWebPage,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'loadWebPagePreview', 'clearWebPagePreview', 'toggleMessageWebPage',\n ]),\n)(WebPagePreview));\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 './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, {\n FC, memo, useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions, 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} from '../../../api/types';\nimport { InlineBotSettings } from '../../../types';\n\nimport { BASE_EMOJI_KEYWORD_LANG, EDITABLE_INPUT_ID, SCHEDULED_WHEN_ONLINE } from '../../../config';\nimport { IS_VOICE_RECORDING_SUPPORTED, IS_SINGLE_COLUMN_LAYOUT, IS_IOS } from '../../../util/environment';\nimport {\n selectChat,\n selectIsChatWithBot,\n selectIsRightColumnShown,\n selectIsInSelectMode,\n selectNewestMessageWithBotKeyboardButtons,\n selectDraft,\n selectScheduledIds,\n selectEditingMessage,\n selectIsChatWithSelf,\n selectChatUser,\n} from '../../../modules/selectors';\nimport {\n getAllowedAttachmentOptions,\n getChatSlowModeOptions,\n isChatPrivate,\n isChatAdmin,\n} from '../../../modules/helpers';\nimport { formatMediaDuration, formatVoiceRecordDuration, getDayStartAt } from '../../../util/dateFormat';\nimport focusEditableElement from '../../../util/focusEditableElement';\nimport parseMessageInput from './helpers/parseMessageInput';\nimport buildAttachment from './helpers/buildAttachment';\nimport renderText from '../../common/helpers/renderText';\nimport insertHtmlInSelection from '../../../util/insertHtmlInSelection';\nimport deleteLastCharacterOutsideSelection from '../../../util/deleteLastCharacterOutsideSelection';\nimport { pick } from '../../../util/iteratees';\nimport buildClassName from '../../../util/buildClassName';\nimport { isSelectionInsideInput } from './helpers/selection';\nimport applyIosAutoCapitalizationFix from './helpers/applyIosAutoCapitalizationFix';\n\nimport useFlag from '../../../hooks/useFlag';\nimport useVoiceRecording from './hooks/useVoiceRecording';\nimport useClipboardPaste from './hooks/useClipboardPaste';\nimport useDraft from './hooks/useDraft';\nimport useEditing from './hooks/useEditing';\nimport usePrevious from '../../../hooks/usePrevious';\nimport useStickerTooltip from './hooks/useStickerTooltip';\nimport useEmojiTooltip from './hooks/useEmojiTooltip';\nimport useMentionTooltip from './hooks/useMentionTooltip';\nimport useContextMenuHandlers from '../../../hooks/useContextMenuHandlers';\nimport useLang from '../../../hooks/useLang';\nimport useInlineBotTooltip from './hooks/useInlineBotTooltip';\nimport windowSize from '../../../util/windowSize';\n\nimport DeleteMessageModal from '../../common/DeleteMessageModal.async';\nimport Button from '../../ui/Button';\nimport ResponsiveHoverButton from '../../ui/ResponsiveHoverButton';\nimport Spinner from '../../ui/Spinner';\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 BotKeyboardMenu from './BotKeyboardMenu.async';\nimport MessageInput from './MessageInput';\nimport ComposerEmbeddedMessage from './ComposerEmbeddedMessage';\nimport AttachmentModal from './AttachmentModal.async';\nimport PollModal from './PollModal.async';\nimport DropArea, { DropAreaState } from './DropArea.async';\nimport WebPagePreview from './WebPagePreview';\nimport Portal from '../../ui/Portal';\nimport CalendarModal from '../../common/CalendarModal.async';\nimport PaymentModal from '../../payment/PaymentModal.async';\nimport ReceiptModal from '../../payment/ReceiptModal.async';\n\nimport './Composer.scss';\n\ntype OwnProps = {\n chatId: number;\n threadId: number;\n messageListType: MessageListType;\n dropAreaState: string;\n isReady: boolean;\n onDropHide: NoneToVoidFunction;\n};\n\ntype StateProps = {\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 isPaymentModalOpen?: boolean;\n isReceiptModalOpen?: boolean;\n botKeyboardMessageId?: number;\n withScheduledButton?: boolean;\n shouldSchedule?: boolean;\n canScheduleUntilOnline?: boolean;\n stickersForEmoji?: ApiSticker[];\n groupChatMembers?: ApiChatMember[];\n currentUserId?: number;\n usersById?: Record;\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?: number[];\n isInlineBotLoading: boolean;\n inlineBots?: Record;\n} & Pick;\n\ntype DispatchProps = Pick;\n\nenum MainButtonState {\n Send = 'send',\n Record = 'record',\n Edit = 'edit',\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 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 isPaymentModalOpen,\n isReceiptModalOpen,\n botKeyboardMessageId,\n withScheduledButton,\n stickersForEmoji,\n groupChatMembers,\n topInlineBotIds,\n currentUserId,\n usersById,\n lastSyncTime,\n contentToBeScheduled,\n shouldSuggestStickers,\n baseEmojiKeywords,\n emojiKeywords,\n serverTimeOffset,\n recentEmojis,\n inlineBots,\n isInlineBotLoading,\n sendMessage,\n editMessage,\n saveDraft,\n clearDraft,\n showDialog,\n setStickerSearchQuery,\n setGifSearchQuery,\n forwardMessages,\n openPollModal,\n closePollModal,\n loadScheduledHistory,\n closePaymentModal,\n openChat,\n clearReceipt,\n addRecentEmoji,\n sendInlineBotResult,\n}) => {\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 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\n // Cache for frequently updated state\n const htmlRef = useRef(html);\n useEffect(() => {\n htmlRef.current = html;\n }, [html]);\n\n useEffect(() => {\n lastMessageSendTimeSeconds.current = undefined;\n }, [chatId]);\n\n useEffect(() => {\n if (chatId && lastSyncTime && threadId === MAIN_THREAD_ID && isReady) {\n loadScheduledHistory();\n }\n }, [isReady, chatId, loadScheduledHistory, lastSyncTime, threadId]);\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 [isAttachMenuOpen, openAttachMenu, closeAttachMenu] = useFlag();\n const [isSymbolMenuOpen, openSymbolMenu, closeSymbolMenu] = 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 const mainButtonState = editingMessage\n ? MainButtonState.Edit\n : !IS_VOICE_RECORDING_SUPPORTED || activeVoiceRecording || (html && !attachments.length) || isForwarding\n ? MainButtonState.Send\n : MainButtonState.Record;\n const canShowCustomSendMenu = !shouldSchedule;\n\n const {\n isMentionTooltipOpen, mentionFilter,\n closeMentionTooltip, insertMention,\n mentionFilteredUsers,\n } = useMentionTooltip(\n !attachments.length,\n html,\n setHtml,\n undefined,\n groupChatMembers,\n topInlineBotIds,\n currentUserId,\n usersById,\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 isContextMenuOpen: isCustomSendMenuOpen,\n handleContextMenu,\n handleContextMenuClose,\n handleContextMenuHide,\n } = useContextMenuHandlers(mainButtonRef, !(mainButtonState === MainButtonState.Send && canShowCustomSendMenu));\n\n const allowedAttachmentOptions = useMemo(() => {\n return getAllowedAttachmentOptions(chat, isChatWithBot);\n }, [chat, isChatWithBot]);\n\n const isAdmin = chat && isChatAdmin(chat);\n const slowMode = getChatSlowModeOptions(chat);\n\n const { isStickerTooltipOpen, closeStickerTooltip } = useStickerTooltip(\n Boolean(shouldSuggestStickers && allowedAttachmentOptions.canSendStickers && !attachments.length),\n html,\n stickersForEmoji,\n !isReady,\n );\n const {\n isEmojiTooltipOpen, closeEmojiTooltip, filteredEmojis, insertEmoji,\n } = useEmojiTooltip(\n Boolean(shouldSuggestStickers && allowedAttachmentOptions.canSendStickers && !attachments.length),\n html,\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 }, []);\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 }, []);\n\n const resetComposer = useCallback((shouldPreserveInput = false) => {\n if (!shouldPreserveInput) {\n setHtml('');\n }\n setAttachments([]);\n closeStickerTooltip();\n closeCalendar();\n setScheduledMessageArgs(undefined);\n closeMentionTooltip();\n closeEmojiTooltip();\n\n if (IS_SINGLE_COLUMN_LAYOUT) {\n // @perf\n setTimeout(() => closeSymbolMenu(), SENDING_ANIMATION_DURATION);\n } else {\n closeSymbolMenu();\n }\n }, [closeStickerTooltip, closeCalendar, closeMentionTooltip, closeEmojiTooltip, closeSymbolMenu]);\n\n // Handle chat change\n const prevChatId = usePrevious(chatId);\n useEffect(() => {\n if (!prevChatId || chatId === prevChatId) {\n return;\n }\n\n stopRecordingVoice();\n resetComposer();\n }, [chatId, prevChatId, resetComposer, stopRecordingVoice]);\n\n const handleEditComplete = useEditing(htmlRef, setHtml, editingMessage, resetComposer, openDeleteModal, editMessage);\n useDraft(draft, chatId, threadId, html, htmlRef, setHtml, editingMessage, saveDraft, clearDraft);\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([]);\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 if (!currentAttachments.length && !text && !isForwarding) {\n return;\n }\n\n if (currentAttachments.length && text && text.length > CAPTION_MAX_LENGTH) {\n const extraLength = text.length - CAPTION_MAX_LENGTH;\n showDialog({\n data: {\n message: 'CAPTION_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 return;\n }\n\n const messageInput = document.getElementById(EDITABLE_INPUT_ID)!;\n\n if (currentAttachments.length || text) {\n if (slowMode && !isAdmin) {\n const nowSeconds = Math.floor(Date.now() / 1000) + 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 if (isForwarding) {\n forwardMessages();\n }\n\n lastMessageSendTimeSeconds.current = Math.floor(Date.now() / 1000) + 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, serverTimeOffset, clearDraft, chatId,\n resetComposer, stopRecordingVoice, showDialog, slowMode, isAdmin, sendMessage, forwardMessages, lang,\n ]);\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 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 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 handleSend(!!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 openSymbolMenu();\n }, MOBILE_KEYBOARD_HIDE_DELAY_MS);\n }, [openSymbolMenu]);\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 if (shouldSchedule) {\n if (activeVoiceRecording) {\n pauseRecordingVoice();\n }\n openCalendar();\n } else {\n handleSend();\n requestAnimationFrame(() => {\n resetComposer();\n });\n }\n break;\n case MainButtonState.Record:\n startRecordingVoice();\n break;\n case MainButtonState.Edit:\n handleEditComplete();\n break;\n default:\n break;\n }\n }, [\n mainButtonState, resetComposer, shouldSchedule, startRecordingVoice, handleEditComplete,\n activeVoiceRecording, openCalendar, pauseRecordingVoice, handleSend,\n ]);\n\n const areVoiceMessagesNotAllowed = mainButtonState === MainButtonState.Record\n && !allowedAttachmentOptions.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 : (shouldSchedule ? openCalendar : handleSend);\n\n return (\n
\n {allowedAttachmentOptions.canAttachMedia && isReady && (\n \n \n \n )}\n \n \n \n \n {renderedEditedMessage && (\n \n )}\n \n \n
\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 \n
\n
\n {activeVoiceRecording && (\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 isChatWithBot = chat ? selectIsChatWithBot(global, chat) : undefined;\n const isChatWithSelf = selectIsChatWithSelf(global, chatId);\n const messageWithActualBotKeyboard = isChatWithBot && selectNewestMessageWithBotKeyboardButtons(global, chatId);\n const scheduledIds = selectScheduledIds(global, chatId);\n const { language } = 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\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: (\n !isChatWithSelf && !isChatWithBot\n && (chat && chatUser && isChatPrivate(chatId) && chatUser.status && Boolean(chatUser.status.wasOnline))\n ),\n isRightColumnShown: selectIsRightColumnShown(global),\n isSelectModeActive: selectIsInSelectMode(global),\n withScheduledButton: (\n threadId === MAIN_THREAD_ID\n && messageListType === 'thread'\n && Boolean(scheduledIds && scheduledIds.length)\n ),\n shouldSchedule: messageListType === 'scheduled',\n botKeyboardMessageId: messageWithActualBotKeyboard ? messageWithActualBotKeyboard.id : undefined,\n isForwarding: chatId === global.forwardMessages.toChatId,\n isPollModalOpen: global.isPollModalOpen,\n stickersForEmoji: global.stickers.forEmoji.stickers,\n groupChatMembers: chat && chat.fullInfo && chat.fullInfo.members,\n topInlineBotIds: global.topInlineBots && global.topInlineBots.userIds,\n currentUserId: global.currentUserId,\n usersById: global.users.byId,\n lastSyncTime: global.lastSyncTime,\n contentToBeScheduled: global.messages.contentToBeScheduled,\n isPaymentModalOpen: global.payment.isPaymentModalOpen,\n isReceiptModalOpen: Boolean(global.payment.receipt),\n shouldSuggestStickers: global.settings.byKey.shouldSuggestStickers,\n recentEmojis: global.recentEmojis,\n baseEmojiKeywords: baseEmojiKeywords ? baseEmojiKeywords.keywords : undefined,\n emojiKeywords: emojiKeywords ? emojiKeywords.keywords : undefined,\n serverTimeOffset: global.serverTimeOffset,\n inlineBots: global.inlineBots.byUsername,\n isInlineBotLoading: global.inlineBots.isLoading,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'sendMessage',\n 'editMessage',\n 'saveDraft',\n 'clearDraft',\n 'showDialog',\n 'setStickerSearchQuery',\n 'setGifSearchQuery',\n 'forwardMessages',\n 'openPollModal',\n 'closePollModal',\n 'closePaymentModal',\n 'clearReceipt',\n 'loadScheduledHistory',\n 'openChat',\n 'addRecentEmoji',\n 'sendInlineBotResult',\n ]),\n)(Composer));\n","import {\n useCallback, useEffect, useRef, useState,\n} from '../../../../lib/teact/teact';\n\nimport { IS_IOS, 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\nexport default () => {\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_IOS && 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\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","import { useEffect } 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';\n\nexport default function useStickerTooltip(\n isAllowed: boolean,\n html: string,\n stickers?: ApiSticker[],\n isDisabled = false,\n) {\n const { loadStickersForEmoji, clearStickersForEmoji } = getDispatch();\n const isSingleEmoji = (\n (IS_EMOJI_SUPPORTED && parseEmojiOnlyString(html) === 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({ emoji: html });\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 insertHtmlInSelection(html: string) {\n const selection = window.getSelection();\n\n if (selection && 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","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';\n\nimport { ApiMessage } from '../../../../api/types';\nimport { GlobalActions } from '../../../../global/types';\n\nimport { EDITABLE_INPUT_ID } from '../../../../config';\nimport parseMessageInput from '../helpers/parseMessageInput';\nimport getMessageTextAsHtml from '../helpers/getMessageTextAsHtml';\nimport focusEditableElement from '../../../../util/focusEditableElement';\nimport { hasMessageMedia } from '../../../../modules/helpers';\n\nexport default (\n htmlRef: { current: string },\n setHtml: (html: string) => void,\n editedMessage: ApiMessage | undefined,\n resetComposer: () => void,\n openDeleteModal: () => void,\n editMessage: GlobalActions['editMessage'],\n) => {\n // TODO useOnChange\n // Handle editing message\n useEffect(() => {\n if (!editedMessage) {\n setHtml('');\n return;\n }\n\n setHtml(getMessageTextAsHtml(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","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, {\n FC, useEffect, useState, memo, useMemo, useCallback,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiChatBannedRights, MAIN_THREAD_ID } from '../../api/types';\nimport { GlobalActions, MessageListType, MessageList as GlobalMessageList } 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 CONTENT_TYPES_FOR_QUICK_UPLOAD,\n ANIMATION_LEVEL_MAX,\n ANIMATION_END_DELAY,\n DARK_THEME_BG_COLOR,\n LIGHT_THEME_BG_COLOR,\n ANIMATION_LEVEL_MIN,\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 selectCurrentMessageList,\n selectCurrentTextSearch,\n selectIsChatBotNotStarted,\n selectIsInSelectMode,\n selectIsRightColumnShown,\n selectPinnedIds,\n selectTheme,\n} from '../../modules/selectors';\nimport { getCanPostInChat, getMessageSendingRestrictionReason, isChatPrivate } from '../../modules/helpers';\nimport captureEscKeyListener from '../../util/captureEscKeyListener';\nimport { pick } from '../../util/iteratees';\nimport buildClassName from '../../util/buildClassName';\nimport useCustomBackground from '../../hooks/useCustomBackground';\nimport useWindowSize from '../../hooks/useWindowSize';\nimport usePrevDuringAnimation from '../../hooks/usePrevDuringAnimation';\nimport calculateMiddleFooterTransforms from './helpers/calculateMiddleFooterTransforms';\nimport useLang from '../../hooks/useLang';\nimport useHistoryBack from '../../hooks/useHistoryBack';\nimport { createMessageHash } from '../../util/routing';\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';\n\nimport './MiddleColumn.scss';\n\ntype StateProps = {\n chatId?: number;\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 hasPinnedOrAudioMessage?: 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 animationLevel?: number;\n shouldSkipHistoryAnimations?: boolean;\n currentTransitionKey: number;\n messageLists?: GlobalMessageList[];\n};\n\ntype DispatchProps = Pick;\n\nconst CLOSE_ANIMATION_DURATION = IS_SINGLE_COLUMN_LAYOUT ? 450 + ANIMATION_END_DELAY : undefined;\n\nfunction canBeQuicklyUploaded(item: DataTransferItem) {\n return item.kind === 'file' && item.type && CONTENT_TYPES_FOR_QUICK_UPLOAD.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 hasPinnedOrAudioMessage,\n pinnedMessagesCount,\n customBackground,\n theme,\n backgroundColor,\n patternColor,\n isLeftColumnShown,\n isRightColumnShown,\n isBackgroundBlurred,\n isMobileSearchActive,\n isSelectModeActive,\n animationLevel,\n shouldSkipHistoryAnimations,\n currentTransitionKey,\n openChat,\n unpinAllMessages,\n loadUser,\n closeLocalTextSearch,\n exitMessageSelectMode,\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 const [isReady, setIsReady] = useState(!IS_SINGLE_COLUMN_LAYOUT || animationLevel === ANIMATION_LEVEL_MIN);\n\n const hasTools = hasPinnedOrAudioMessage && (\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 renderingCanPost = usePrevDuringAnimation(canPost, CLOSE_ANIMATION_DURATION);\n const renderingHasTools = usePrevDuringAnimation(hasTools, CLOSE_ANIMATION_DURATION);\n const renderingIsFabShown = usePrevDuringAnimation(isFabShown, CLOSE_ANIMATION_DURATION);\n\n useEffect(() => {\n return chatId\n ? captureEscKeyListener(() => {\n openChat({ id: undefined });\n })\n : undefined;\n }, [chatId, openChat]);\n\n useEffect(() => {\n setDropAreaState(DropAreaState.None);\n setIsFabShown(undefined);\n setIsNotchShown(undefined);\n }, [chatId]);\n\n useEffect(() => {\n if (animationLevel === ANIMATION_LEVEL_MIN) {\n setIsReady(true);\n }\n }, [animationLevel]);\n\n const handleTransitionEnd = (e: React.TransitionEvent) => {\n if (e.propertyName === 'transform' && e.target === e.currentTarget) {\n setIsReady(Boolean(chatId));\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 && 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 .every(canBeQuicklyUploaded);\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 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\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 }, true);\n };\n\n useHistoryBack(renderingChatId && renderingThreadId,\n closeChat, undefined, undefined, undefined,\n messageLists ? messageLists.map(createMessageHash) : []);\n\n useHistoryBack(isMobileSearchActive, closeLocalTextSearch);\n useHistoryBack(isSelectModeActive, exitMessageSelectMode);\n\n return (\n \n \n
\n {renderingChatId && renderingThreadId && (\n <>\n
\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 {!isPinnedMessageList && !renderingCanPost && messageSendingRestrictionReason && (\n
\n
\n \n {messageSendingRestrictionReason}\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 );\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 } } = 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 animationLevel: global.settings.byKey.animationLevel,\n currentTransitionKey: Math.max(0, global.messages.messageLists.length - 1),\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 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\n return {\n ...state,\n chatId,\n threadId,\n messageListType,\n isPrivate: isChatPrivate(chatId),\n canPost: !isPinnedMessageList && (!chat || canPost) && !isBotNotStarted,\n isPinnedMessageList,\n isScheduledMessageList,\n currentUserBannedRights: chat && chat.currentUserBannedRights,\n defaultBannedRights: chat && chat.defaultBannedRights,\n hasPinnedOrAudioMessage: (\n threadId !== MAIN_THREAD_ID\n || Boolean(pinnedIds && pinnedIds.length)\n || Boolean(audioChatId && audioMessageId)\n ),\n pinnedMessagesCount: pinnedIds ? pinnedIds.length : 0,\n shouldSkipHistoryAnimations: global.shouldSkipHistoryAnimations,\n messageLists,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'openChat', 'unpinAllMessages', 'loadUser', 'closeLocalTextSearch', 'exitMessageSelectMode',\n ]),\n)(MiddleColumn));\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\nexport default (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","import React, {\n FC, memo, useCallback, useEffect, useRef, useState,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\nimport { ManagementScreens, ProfileState } from '../../types';\n\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../util/environment';\nimport { debounce } from '../../util/schedulers';\nimport { pick } from '../../util/iteratees';\nimport buildClassName from '../../util/buildClassName';\nimport {\n selectChat,\n selectCurrentGifSearch,\n selectCurrentStickerSearch,\n selectCurrentTextSearch,\n selectIsChatWithSelf,\n} from '../../modules/selectors';\nimport { isChatAdmin, isChatChannel, isChatPrivate } from '../../modules/helpers';\nimport useCurrentOrPrev from '../../hooks/useCurrentOrPrev';\nimport useLang from '../../hooks/useLang';\n\nimport SearchInput from '../ui/SearchInput';\nimport Button from '../ui/Button';\nimport Transition from '../ui/Transition';\nimport './RightHeader.scss';\nimport { getDayStartAt } from '../../util/dateFormat';\n\ntype OwnProps = {\n chatId?: number;\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};\n\ntype StateProps = {\n canManage?: boolean;\n isChannel?: boolean;\n messageSearchQuery?: string;\n stickerSearchQuery?: string;\n gifSearchQuery?: string;\n};\n\ntype DispatchProps = Pick;\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 ManageGroupUserPermissionsCreate,\n ManageGroupUserPermissions,\n ManageGroupRecentActions,\n ManageGroupAdminRights,\n ManageGroupMembers,\n StickerSearch,\n GifSearch,\n PollResults,\n AddingMembers,\n}\n\nconst RightHeader: FC = ({\n isColumnOpen,\n isProfile,\n isSearch,\n isManagement,\n isStickerSearch,\n isGifSearch,\n isPollResults,\n isAddingChatMembers,\n profileState,\n managementScreen,\n canManage,\n isChannel,\n onClose,\n messageSearchQuery,\n stickerSearchQuery,\n gifSearchQuery,\n setLocalTextSearchQuery,\n setStickerSearchQuery,\n setGifSearchQuery,\n searchTextMessagesLocal,\n toggleManagement,\n openHistoryCalendar,\n shouldSkipAnimation,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const backButtonRef = useRef(null);\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 [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.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.GroupMembers ? (\n HeaderContent.ManageGroupMembers\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('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.ManageGroupPermissions:\n return

{lang('ChannelPermissions')}

;\n case HeaderContent.ManageGroupRemovedUsers:\n return

{lang('ChannelBlockedUsers')}

;\n case HeaderContent.ManageGroupUserPermissionsCreate:\n return

{lang('ChannelAddException')}

;\n case HeaderContent.ManageGroupUserPermissions:\n return

{lang('UserRestrictions')}

;\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 default:\n return (\n <>\n

Profile

\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 (shouldSkipTransition || shouldSkipAnimation) && 'no-transition',\n );\n\n // Add class in the next AF to synchronize with animation with Transition components\n useEffect(() => {\n backButtonRef.current!.classList.toggle('state-back', isBackButton);\n }, [isBackButton]);\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\n const canManage = Boolean(\n !isManagement\n && isProfile\n && chat\n && !selectIsChatWithSelf(global, chat.id)\n // chat.isCreator is for Basic Groups\n && (isChatPrivate(chat.id) || ((isChatAdmin(chat) || chat.isCreator) && !chat.isNotJoined)),\n );\n\n return {\n canManage,\n isChannel,\n messageSearchQuery,\n stickerSearchQuery,\n gifSearchQuery,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'setLocalTextSearchQuery',\n 'setStickerSearchQuery',\n 'setGifSearchQuery',\n 'searchTextMessagesLocal',\n 'toggleManagement',\n 'openHistoryCalendar',\n ]),\n)(RightHeader));\n","import { useMemo, useRef } from '../../../lib/teact/teact';\n\nimport { ApiChatMember, ApiMessage, ApiUser } from '../../../api/types';\nimport { ProfileTabType, SharedMediaType } from '../../../types';\n\nimport { MEMBERS_SLICE, MESSAGE_SEARCH_SLICE, SHARED_MEDIA_SLICE } from '../../../config';\nimport { getMessageContentIds, 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 searchMessages: AnyToVoidFunction,\n tabType: ProfileTabType,\n mediaSearchType?: SharedMediaType,\n groupChatMembers?: ApiChatMember[],\n usersById?: Record,\n chatMessages?: Record,\n foundIds?: number[],\n chatId?: number,\n lastSyncTime?: number,\n serverTimeOffset = 0,\n) {\n const resultType = tabType === 'members' || !mediaSearchType ? tabType : mediaSearchType;\n\n const memberIds = useMemo(() => {\n if (!groupChatMembers || !usersById) {\n return undefined;\n }\n\n return sortUserIds(groupChatMembers.map(({ userId }) => userId), usersById, undefined, serverTimeOffset);\n }, [groupChatMembers, serverTimeOffset, usersById]);\n\n const [memberViewportIds, getMoreMembers, noProfileInfoForMembers] = useInfiniteScrollForMembers(\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 let viewportIds: number[] | 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 '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 }\n\n return [resultType, viewportIds, getMore, noProfileInfo] as const;\n}\n\nfunction useInfiniteScrollForMembers(\n currentResultType?: ProfileTabType,\n handleLoadMore?: AnyToVoidFunction,\n lastSyncTime?: number,\n memberIds?: number[],\n) {\n const [viewportIds, getMore] = useInfiniteScroll(\n lastSyncTime ? handleLoadMore : undefined,\n memberIds,\n undefined,\n MEMBERS_SLICE,\n );\n\n const isOnTop = !viewportIds || !memberIds || viewportIds[0] === memberIds[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 ).reverse();\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, { FC, memo } from '../../lib/teact/teact';\n\nimport {\n ApiUser, ApiChat, ApiMediaFormat, ApiPhoto,\n} from '../../api/types';\n\nimport {\n getChatAvatarHash, isDeletedUser, getUserColorKey, getChatTitle, isChatPrivate, getUserFullName,\n} from '../../modules/helpers';\nimport renderText from '../common/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\n function getMediaHash(size: 'normal' | 'big' = '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) {\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 imageHash = getMediaHash();\n const fullMediaData = useMedia(imageHash, false, ApiMediaFormat.BlobUrl, lastSyncTime);\n const avatarThumbnailData = useMedia(\n !fullMediaData && isFirstPhoto ? getMediaHash('normal', true) : undefined,\n false,\n ApiMediaFormat.BlobUrl,\n lastSyncTime,\n );\n const thumbDataUri = useBlurSync(!fullMediaData && photo && photo.thumbnail && photo.thumbnail.dataUri);\n const imageSrc = fullMediaData || avatarThumbnailData || 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 (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, isChatPrivate(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 (!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 { withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiUser, ApiChat } from '../../api/types';\nimport { GlobalActions, GlobalState } from '../../global/types';\nimport { MediaViewerOrigin } from '../../types';\n\nimport { IS_TOUCH_ENV } from '../../util/environment';\nimport { selectChat, selectUser } from '../../modules/selectors';\nimport {\n getUserFullName, getUserStatus, isChatChannel, isUserOnline,\n} from '../../modules/helpers';\nimport renderText from '../common/helpers/renderText';\nimport { pick } from '../../util/iteratees';\nimport { captureEvents, SwipeDirection } from '../../util/captureEvents';\nimport usePhotosPreload from './hooks/usePhotosPreload';\nimport useLang from '../../hooks/useLang';\n\nimport VerifiedIcon from '../common/VerifiedIcon';\nimport ProfilePhoto from './ProfilePhoto';\nimport Transition from '../ui/Transition';\n\nimport './ProfileInfo.scss';\n\ntype OwnProps = {\n userId: number;\n forceShowSelf?: boolean;\n};\n\ntype StateProps = {\n user?: ApiUser;\n chat?: ApiChat;\n isSavedMessages?: boolean;\n animationLevel: 0 | 1 | 2;\n serverTimeOffset: number;\n} & Pick;\n\ntype DispatchProps = Pick;\n\nconst PrivateChatInfo: FC = ({\n user,\n chat,\n isSavedMessages,\n lastSyncTime,\n animationLevel,\n loadFullUser,\n openMediaViewer,\n serverTimeOffset,\n}) => {\n const { id: userId } = user || {};\n const { id: chatId } = chat || {};\n const fullName = user ? getUserFullName(user) : (chat ? chat.title : '');\n const photos = (user ? user.photos : (chat ? chat.photos : undefined)) || [];\n const slideAnimation = animationLevel >= 1 ? 'slide' : '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 const lang = useLang();\n\n useEffect(() => {\n if (lastSyncTime && userId) {\n loadFullUser({ userId });\n }\n }, [userId, loadFullUser, lastSyncTime]);\n\n usePhotosPreload(user || chat, photos, currentPhotoIndex);\n\n const handleProfilePhotoClick = useCallback(() => {\n openMediaViewer({\n avatarOwnerId: userId || chatId,\n profilePhotoIndex: currentPhotoIndex,\n origin: MediaViewerOrigin.ProfileAvatar,\n });\n }, [openMediaViewer, userId, chatId, currentPhotoIndex]);\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 onSwipe: IS_TOUCH_ENV ? (e, direction) => {\n if (direction === SwipeDirection.Right) {\n selectPreviousMedia();\n } else if (direction === SwipeDirection.Left) {\n selectNextMedia();\n }\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, serverTimeOffset)}\n
\n );\n }\n\n return (\n {\n isChatChannel(chat!)\n ? lang('Subscribers', chat!.membersCount, 'i')\n : lang('Members', chat!.membersCount, 'i')\n }\n \n );\n }\n\n const isVerifiedIconShown = (user && user.isVerified) || (chat && 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 { lastSyncTime, serverTimeOffset } = global;\n const user = selectUser(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 lastSyncTime, user, chat, isSavedMessages, animationLevel, serverTimeOffset,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['loadFullUser', 'openMediaViewer']),\n)(PrivateChatInfo));\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 React, {\n FC, memo, useCallback, useEffect,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions, GlobalState } from '../../global/types';\nimport { ApiChat, ApiUser } from '../../api/types';\n\nimport {\n selectChat, selectNotifyExceptions, selectNotifySettings, selectUser,\n} from '../../modules/selectors';\nimport {\n getChatDescription, getChatLink, getHasAdminRight, isChatChannel, isChatPrivate, isUserRightBanned, selectIsChatMuted,\n} from '../../modules/helpers';\nimport renderText from '../common/helpers/renderText';\nimport { pick } from '../../util/iteratees';\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: number;\n forceShowSelf?: boolean;\n};\n\ntype StateProps = {\n user?: ApiUser;\n chat?: ApiChat;\n canInviteUsers?: boolean;\n isMuted?: boolean;\n} & Pick;\n\ntype DispatchProps = Pick;\n\nconst ChatExtra: FC = ({\n lastSyncTime,\n user,\n chat,\n forceShowSelf,\n canInviteUsers,\n isMuted,\n loadFullUser,\n showNotification,\n updateChatMutedState,\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(phoneNumber);\n const link = getChatLink(chat);\n const description = (fullInfo && fullInfo.bio) || getChatDescription(chat);\n\n return (\n
\n {formattedNumber && !!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 && !!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
{link}
\n {lang('SetUrlPlaceholder')}\n
\n )}\n \n {lang('Notifications')}\n \n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatOrUserId }): StateProps => {\n const { lastSyncTime } = global;\n\n const chat = chatOrUserId ? selectChat(global, chatOrUserId) : undefined;\n const user = isChatPrivate(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, chat, user, canInviteUsers, isMuted,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'loadFullUser', 'updateChatMutedState', 'showNotification',\n ]),\n)(ChatExtra));\n","import React, { FC, useCallback, memo } from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\nimport { ApiChat } from '../../api/types';\n\nimport { pick } from '../../util/iteratees';\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?: number;\n onClose: () => void;\n};\n\ntype StateProps = {\n chat?: ApiChat;\n contactName?: string;\n};\n\ntype DispatchProps = Pick;\n\nconst DeleteMemberModal: FC = ({\n isOpen,\n chat,\n userId,\n contactName,\n onClose,\n deleteChatMember,\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 (setGlobal, actions): DispatchProps => pick(actions, ['deleteChatMember']),\n)(DeleteMemberModal));\n","import React, {\n FC, useCallback, useEffect, useMemo, useRef, useState, memo,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport {\n ApiMessage,\n ApiChatMember,\n ApiUser,\n MAIN_THREAD_ID,\n} from '../../api/types';\nimport { GlobalActions } from '../../global/types';\nimport {\n NewChatMembersProgress, ISettings, MediaViewerOrigin, ProfileState, ProfileTabType, SharedMediaType,\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, isChatPrivate,\n} from '../../modules/helpers';\nimport {\n selectChatMessages,\n selectChat,\n selectCurrentMediaSearch,\n selectIsRightColumnShown,\n selectTheme,\n} from '../../modules/selectors';\nimport { pick } from '../../util/iteratees';\nimport { captureEvents, SwipeDirection } from '../../util/captureEvents';\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 './ProfileInfo';\nimport Document from '../common/Document';\nimport Audio from '../common/Audio';\nimport ChatExtra from './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';\n\nimport './Profile.scss';\n\ntype OwnProps = {\n chatId: number;\n userId?: number;\n profileState: ProfileState;\n onProfileStateChange: (state: ProfileState) => void;\n};\n\ntype StateProps = {\n theme: ISettings['theme'];\n isChannel?: boolean;\n currentUserId?: number;\n resolvedUserId?: number;\n chatMessages?: Record;\n foundIds?: number[];\n mediaSearchType?: SharedMediaType;\n hasMembersTab?: boolean;\n areMembersHidden?: boolean;\n canAddMembers?: boolean;\n canDeleteMembers?: boolean;\n members?: ApiChatMember[];\n usersById?: Record;\n isRightColumnShown: boolean;\n isRestricted?: boolean;\n lastSyncTime?: number;\n serverTimeOffset: number;\n};\n\ntype DispatchProps = Pick;\n\nconst TABS = [\n { type: 'media', title: 'SharedMediaTab2' },\n { type: 'documents', title: 'SharedFilesTab2' },\n { type: 'links', title: 'SharedLinksTab2' },\n { type: 'audio', title: 'SharedMusicTab2' },\n];\n\nconst HIDDEN_RENDER_DELAY = 1000;\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 hasMembersTab,\n areMembersHidden,\n canAddMembers,\n canDeleteMembers,\n members,\n usersById,\n isRightColumnShown,\n isRestricted,\n lastSyncTime,\n setLocalMediaSearchType,\n loadMoreMembers,\n searchMediaMessagesLocal,\n openMediaViewer,\n openAudioPlayer,\n openUserInfo,\n focusMessage,\n loadProfilePhotos,\n setNewChatMembersDialogState,\n serverTimeOffset,\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 ]), [hasMembersTab, isChannel]);\n const tabType = tabs[activeTab].type as ProfileTabType;\n\n const [resultType, viewportIds, getMore, noProfileInfo] = useProfileViewportIds(\n isRightColumnShown, loadMoreMembers, searchMediaMessagesLocal, tabType, mediaSearchType, members,\n usersById, chatMessages, foundIds, chatId, lastSyncTime, 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 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: number) => {\n openUserInfo({ id });\n }, [openUserInfo]);\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 onSwipe: ((e, direction) => {\n if (direction === SwipeDirection.Left) {\n setActiveTab(Math.min(activeTab + 1, tabs.length - 1));\n } else if (direction === SwipeDirection.Right) {\n setActiveTab(Math.max(0, activeTab - 1));\n }\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 canRenderContents = useAsyncRendering([chatId, resultType], renderingDelay);\n\n function getMemberContextAction(id: number) {\n return id === currentUserId || !canDeleteMembers ? undefined : [{\n title: lang('lng_context_remove_from_group'),\n icon: 'stop',\n handler: () => {\n setDeletingUserId(id);\n },\n }];\n }\n\n function renderSharedMedia() {\n if (!viewportIds || !canRenderContents || !chatMessages) {\n // This is just a single-frame delay, so we do not show spinner\n const noSpinner = isFirstTab && viewportIds && !canRenderContents;\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 'documents':\n text = lang('lng_media_file_empty_search');\n break;\n case 'links':\n text = lang('lng_media_link_empty_search');\n break;\n case 'audio':\n text = lang('lng_media_song_empty_search');\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!.map((id) => chatMessages[id] && (\n \n ))\n ) : resultType === 'documents' ? (\n viewportIds!.map((id) => chatMessages[id] && (\n \n ))\n ) : resultType === 'links' ? (\n viewportIds!.map((id) => chatMessages[id] && (\n \n ))\n ) : resultType === 'audio' ? (\n viewportIds!.map((id) => chatMessages[id] && (\n \n ))\n ) : resultType === 'members' ? (\n viewportIds!.map((id, i) => (\n handleMemberClick(id)}\n contextActions={getMemberContextAction(id)}\n >\n \n \n ))\n ) : undefined}\n
\n );\n }\n\n return (\n \n {!noProfileInfo && renderProfileInfo(chatId, resolvedUserId)}\n {!isRestricted && (\n \n \n {renderSharedMedia}\n \n \n\n
\n )}\n\n {canAddMembers && (\n \n \n \n )}\n {canDeleteMembers && (\n \n )}\n \n );\n};\n\nfunction renderProfileInfo(chatId: number, resolvedUserId?: number) {\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 > div.active > .${resultType}-list > .scroll-item`,\n ].join(', ');\n}\n\nexport default memo(withGlobal(\n (global, { chatId, userId }): StateProps => {\n const chat = selectChat(global, chatId);\n\n const chatMessages = selectChatMessages(global, userId || chatId);\n const { currentType: mediaSearchType, resultsByType } = selectCurrentMediaSearch(global) || {};\n const { foundIds } = (resultsByType && mediaSearchType && resultsByType[mediaSearchType]) || {};\n\n const { byId: usersById } = global.users;\n\n const isGroup = chat && isChatGroup(chat);\n const isChannel = chat && isChatChannel(chat);\n const hasMembersTab = isGroup || (isChannel && isChatAdmin(chat!));\n const members = chat && chat.fullInfo && 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\n let resolvedUserId;\n if (userId) {\n resolvedUserId = userId;\n } else if (isChatPrivate(chatId)) {\n resolvedUserId = chatId;\n }\n\n return {\n theme: selectTheme(global),\n isChannel,\n resolvedUserId,\n chatMessages,\n foundIds,\n mediaSearchType,\n hasMembersTab,\n areMembersHidden,\n canAddMembers,\n canDeleteMembers,\n currentUserId: global.currentUserId,\n isRightColumnShown: selectIsRightColumnShown(global),\n isRestricted: chat && chat.isRestricted,\n lastSyncTime: global.lastSyncTime,\n serverTimeOffset: global.serverTimeOffset,\n ...(hasMembersTab && members && {\n members,\n usersById,\n }),\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'setLocalMediaSearchType',\n 'loadMoreMembers',\n 'searchMediaMessagesLocal',\n 'openMediaViewer',\n 'openAudioPlayer',\n 'openUserInfo',\n 'focusMessage',\n 'loadProfilePhotos',\n 'setNewChatMembersDialogState',\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\nexport default () => {\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","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 { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\nimport {\n ApiChat, ApiChatMember, ApiUpdateConnectionStateType, ApiUser,\n} from '../../api/types';\nimport { NewChatMembersProgress } from '../../types';\n\nimport { pick, unique } from '../../util/iteratees';\nimport { selectChat } from '../../modules/selectors';\nimport searchWords from '../../util/searchWords';\nimport {\n getUserFullName, 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: number;\n isActive: boolean;\n onNextStep: (memberIds: number[]) => void;\n onClose: NoneToVoidFunction;\n};\n\ntype StateProps = {\n connectionState?: ApiUpdateConnectionStateType;\n isChannel?: boolean;\n members?: ApiChatMember[];\n currentUserId?: number;\n usersById: Record;\n chatsById: Record;\n localContactIds?: number[];\n searchQuery?: string;\n isLoading: boolean;\n isSearching?: boolean;\n localUserIds?: number[];\n globalUserIds?: number[];\n};\n\ntype DispatchProps = Pick;\n\nconst AddChatMembers: FC = ({\n isChannel,\n connectionState,\n members,\n onNextStep,\n currentUserId,\n usersById,\n chatsById,\n localContactIds,\n isLoading,\n searchQuery,\n isSearching,\n localUserIds,\n globalUserIds,\n setUserSearchQuery,\n onClose,\n isActive,\n loadContactList,\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 const contactIds = localContactIds\n ? sortChatIds(localContactIds.filter((id) => id !== currentUserId), chatsById)\n : [];\n\n if (!searchQuery) {\n return contactIds.filter((id) => !memberIds.includes(id));\n }\n\n const foundContactIds = contactIds.filter((id) => {\n const user = usersById[id];\n if (!user) {\n return false;\n }\n const fullName = getUserFullName(user);\n return fullName && searchWords(fullName, searchQuery);\n });\n\n return sortChatIds(\n unique([\n ...foundContactIds,\n ...(localUserIds || []),\n ...(globalUserIds || []),\n ]).filter((contactId) => {\n const user = usersById[contactId];\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 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 !memberIds.includes(contactId)\n && (!user || !isUserBot(user) || (!isChannel && user.canBeInvitedToGroup));\n }),\n chatsById,\n );\n }, [\n localContactIds, chatsById, searchQuery, localUserIds, globalUserIds,\n currentUserId, usersById, 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: usersById } = global.users;\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 && chat.fullInfo ? chat.fullInfo.members : undefined,\n currentUserId,\n usersById,\n chatsById,\n localContactIds,\n searchQuery,\n isSearching: fetchingStatus,\n isLoading: newChatMembersProgress === NewChatMembersProgress.Loading,\n globalUserIds,\n localUserIds,\n connectionState,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['loadContactList', 'setUserSearchQuery']),\n)(AddChatMembers));\n","import React, {\n FC, memo, useCallback, useEffect, useState,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\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 { pick } from '../../util/iteratees';\nimport {\n selectAreActiveChatsLoaded,\n selectCurrentMessageList,\n selectRightColumnContentKey,\n} from '../../modules/selectors';\nimport useLayoutEffectWithPrevDeps from '../../hooks/useLayoutEffectWithPrevDeps';\nimport useWindowSize from '../../hooks/useWindowSize';\nimport useCurrentOrPrev from '../../hooks/useCurrentOrPrev';\nimport useHistoryBack from '../../hooks/useHistoryBack';\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?: number;\n threadId?: number;\n currentProfileUserId?: number;\n isChatSelected: boolean;\n shouldSkipHistoryAnimations?: boolean;\n};\n\ntype DispatchProps = Pick;\n\nconst COLUMN_CLOSE_DELAY_MS = 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 currentProfileUserId,\n isChatSelected,\n toggleChatInfo,\n toggleManagement,\n openUserInfo,\n closeLocalTextSearch,\n setStickerSearchQuery,\n setGifSearchQuery,\n closePollResults,\n addChatMembers,\n setNewChatMembersDialogState,\n shouldSkipHistoryAnimations,\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 || contentKey === RightColumnContent.UserInfo;\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, true);\n break;\n case RightColumnContent.UserInfo:\n if (isScrolledDown && shouldScrollUp) {\n setProfileState(ProfileState.Profile);\n break;\n }\n openUserInfo({ id: undefined }, 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 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.GroupRecentActions:\n setManagementScreen(ManagementScreens.ChatAdministrators);\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, openUserInfo, closePollResults, setNewChatMembersDialogState,\n managementScreen, toggleManagement, closeLocalTextSearch, setStickerSearchQuery, setGifSearchQuery,\n ]);\n\n const handleSelectChatMember = useCallback((memberId, isPromoted) => {\n setSelectedChatMemberId(memberId);\n setIsPromotedByCurrentUser(isPromoted);\n }, []);\n\n const handleAppendingChatMembers = useCallback((memberIds: number[]) => {\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 }, COLUMN_CLOSE_DELAY_MS);\n }, [isOpen]);\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(([prevContentKey, prevChatId]) => {\n if (\n (prevContentKey === RightColumnContent.ChatInfo && contentKey === RightColumnContent.UserInfo)\n || (prevContentKey === RightColumnContent.UserInfo && contentKey === RightColumnContent.ChatInfo)\n || (prevChatId !== chatId)\n ) {\n setProfileState(ProfileState.Profile);\n setManagementScreen(ManagementScreens.Initial);\n }\n }, [contentKey, chatId]);\n\n\n useHistoryBack(isChatSelected && (contentKey === RightColumnContent.ChatInfo\n || contentKey === RightColumnContent.UserInfo || 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 case RightColumnContent.UserInfo:\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\n return {\n contentKey: selectRightColumnContentKey(global),\n chatId,\n threadId,\n currentProfileUserId: global.users.selectedId,\n isChatSelected: Boolean(chatId && areActiveChatsLoaded),\n shouldSkipHistoryAnimations: global.shouldSkipHistoryAnimations,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'openUserInfo',\n 'toggleChatInfo',\n 'toggleManagement',\n 'closeLocalTextSearch',\n 'setStickerSearchQuery',\n 'setGifSearchQuery',\n 'closePollResults',\n 'addChatMembers',\n 'setNewChatMembersDialogState',\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","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, {\n FC, useEffect, memo, useCallback,\n} from '../../lib/teact/teact';\nimport { getGlobal, withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\nimport { ApiMessage } from '../../api/types';\nimport { LangCode } from '../../types';\n\nimport '../../modules/actions/all';\nimport {\n BASE_EMOJI_KEYWORD_LANG, DEBUG, INACTIVE_MARKER, PAGE_TITLE,\n} from '../../config';\nimport { pick } from '../../util/iteratees';\nimport {\n selectChatMessage,\n selectCountNotMutedUnread,\n selectIsForwardModalOpen,\n selectIsMediaViewerOpen,\n selectIsRightColumnShown,\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 useShowTransition from '../../hooks/useShowTransition';\nimport useBackgroundMode from '../../hooks/useBackgroundMode';\nimport useBeforeUnload from '../../hooks/useBeforeUnload';\nimport useOnChange from '../../hooks/useOnChange';\n\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 Notifications from './Notifications.async';\nimport Dialogs from './Dialogs.async';\nimport ForwardPicker from './ForwardPicker.async';\nimport SafeLinkModal from './SafeLinkModal.async';\nimport HistoryCalendar from './HistoryCalendar.async';\n\nimport './Main.scss';\n\ntype StateProps = {\n animationLevel: number;\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 language?: LangCode;\n};\n\ntype DispatchProps = Pick;\n\nconst NOTIFICATION_INTERVAL = 1000;\n\nlet notificationInterval: number | undefined;\n\nlet DEBUG_isLogged = false;\n\nconst Main: FC = ({\n lastSyncTime,\n isLeftColumnShown,\n isRightColumnShown,\n isMediaViewerOpen,\n isForwardModalOpen,\n animationLevel,\n hasNotifications,\n hasDialogs,\n audioMessage,\n safeLinkModalUrl,\n isHistoryCalendarOpen,\n shouldSkipHistoryAnimations,\n language,\n loadAnimatedEmojis,\n loadNotificationSettings,\n loadNotificationExceptions,\n updateIsOnline,\n loadTopInlineBots,\n loadEmojiKeywords,\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 // Initial API calls\n useEffect(() => {\n if (lastSyncTime) {\n updateIsOnline(true);\n loadAnimatedEmojis();\n loadNotificationSettings();\n loadNotificationExceptions();\n loadTopInlineBots();\n\n loadEmojiKeywords({ language: BASE_EMOJI_KEYWORD_LANG });\n if (language !== BASE_EMOJI_KEYWORD_LANG) {\n loadEmojiKeywords({ language });\n }\n }\n }, [\n lastSyncTime, loadAnimatedEmojis, loadNotificationExceptions, loadNotificationSettings, updateIsOnline,\n loadTopInlineBots, loadEmojiKeywords, language,\n ]);\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\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 = selectCountNotMutedUnread(getGlobal());\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 = selectCountNotMutedUnread(getGlobal()) - 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 // Online status and browser tab indicators\n useBackgroundMode(handleBlur, handleFocus);\n useBeforeUnload(handleBlur);\n\n function stopEvent(e: React.MouseEvent) {\n e.preventDefault();\n e.stopPropagation();\n }\n\n return (\n
\n \n \n \n \n \n \n \n {audioMessage && }\n \n \n
\n );\n};\n\nfunction updateIcon(asUnread: boolean) {\n document.querySelectorAll('link[rel=\"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 { chatId: audioChatId, messageId: audioMessageId } = global.audioPlayer;\n const audioMessage = audioChatId && audioMessageId\n ? selectChatMessage(global, audioChatId, audioMessageId)\n : undefined;\n\n return {\n animationLevel: global.settings.byKey.animationLevel,\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 language: global.settings.byKey.language,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'loadAnimatedEmojis', 'loadNotificationSettings', 'loadNotificationExceptions', 'updateIsOnline',\n 'loadTopInlineBots', 'loadEmojiKeywords',\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"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/5.64e3757d90b4958d12d9.css b/dist/5.d0ce99af4355757862b4.css similarity index 99% rename from dist/5.64e3757d90b4958d12d9.css rename to dist/5.d0ce99af4355757862b4.css index f5b37752..2a73af25 100644 --- a/dist/5.64e3757d90b4958d12d9.css +++ b/dist/5.d0ce99af4355757862b4.css @@ -7,4 +7,4 @@ .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:white;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(.active) .AvatarEditable label input,.Transition>div:not(.active) .AvatarEditable label i,.Transition>div:not(.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(.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,0.4)}.AvatarEditable label.disabled{pointer-events:none}.AvatarEditable label.disabled i{display:none}.AvatarEditable label.disabled::after{display:none} -/*# sourceMappingURL=5.64e3757d90b4958d12d9.css.map*/ \ No newline at end of file +/*# sourceMappingURL=5.d0ce99af4355757862b4.css.map*/ \ No newline at end of file diff --git a/dist/5.64e3757d90b4958d12d9.css.map b/dist/5.d0ce99af4355757862b4.css.map similarity index 99% rename from dist/5.64e3757d90b4958d12d9.css.map rename to dist/5.d0ce99af4355757862b4.css.map index d90f9eee..1db52a67 100644 --- a/dist/5.64e3757d90b4958d12d9.css.map +++ b/dist/5.d0ce99af4355757862b4.css.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///./src/components/common/PasswordMonkey.scss","webpack:///./src/components/ui/Modal.scss","webpack:///./src/components/ui/CropModal.scss","webpack:///./src/components/ui/AvatarEditable.scss"],"names":[],"mappings":"AAAA,QAAQ,kBAAkB,cAAc,iBAAiB,kBAAkB,aAAa,cAAc,sBAAsB,kDAAkD,QAAQ,YAAY,aAAa,sBAAsB,YAAY,YAAY,aAAa,yBAAyB,kBAAkB,OAAO,MAAM,WAAW,YAAY,gCAAgC,aAAa,wBAAwB,WAAW,YAAY,qBAAqB;;ACA1c,OAAO,kBAAkB,uBAAuB,4IAA4I,gBAAgB,gCAAgC,gBAAgB,4BAA4B,gBAAgB,4BAA4B,gBAAgB,wBAAwB,eAAe,MAAM,SAAS,OAAO,QAAQ,aAAa,uBAAuB,mBAAmB,uBAAuB,eAAe,MAAM,QAAQ,SAAS,OAAO,WAAW,kCAAkC,4CAA4C,6BAA6B,qBAAqB,kBAAkB,oBAAoB,sBAAsB,WAAW,gBAAgB,kBAAkB,iBAAiB,yCAAyC,iEAAiE,2CAA2C,mCAAmC,gDAAgD,4CAA4C,gBAAgB,0BAA0B,0BAA0B,qBAAqB,yCAAyC,0BAA0B,+BAA+B,6BAA6B,kCAAkC,oDAAoD,oBAAoB,aAAa,mBAAmB,cAAc,oBAAoB,kBAAkB,gBAAgB,cAAc,gBAAgB,uBAAuB,qCAAqC,mBAAmB,+BAA+B,4CAA4C,oDAAoD,mBAAmB,eAAe,WAAW,qBAAqB,iBAAiB,qBAAqB,sBAAsB,eAAe,sBAAsB,WAAW,YAAY,aAAa,gBAAgB,qDAAqD,sBAAsB,kEAAkE,uBAAuB,mBAAmB,uBAAuB,aAAa,qBAAqB,qEAAqE,iBAAiB,8BAA8B,WAAW,YAAY,iBAAiB,iBAAiB,gBAAgB;;ACAn0E,yBAAyB,wBAAwB,gBAAgB,yBAAyB,iBAAiB,kBAAkB,kDAAkD,gBAAgB,2BAA2B,kBAAkB,YAAY,WAAW,iDAAiD,wBAAwB,gBAAgB,cAAc,kBAAkB,gCAAgC,WAAW,cAAc,iBAAiB,qCAAqC,kBAAkB,MAAM,OAAO,kDAAkD,qCAAqC,YAAY,mDAAmD,kEAAkE,gCAAgC,qDAAqD,gCAAgC,8CAA8C,gCAAgC,yDAAyD,gCAAgC,eAAe,mBAAmB,8CAA8C,sCAAsC,+DAA+D,qBAAqB,qDAAqD,gCAAgC,eAAe,mBAAmB,2CAA2C,sCAAsC,2DAA2D,qBAAqB,8CAA8C,gCAAgC,eAAe,mBAAmB,0CAA0C,sCAAsC,oDAAoD;;ACAptD,sBAAsB,iBAAiB,kBAAkB,aAAa,cAAc,mBAAmB,wBAAwB,mBAAmB,uBAAuB,sCAAsC,kBAAkB,YAAY,eAAe,eAAe,kBAAkB,gBAAgB,wBAAwB,4BAA4B,aAAa,0BAA0B,kBAAkB,MAAM,OAAO,WAAW,YAAY,wBAAwB,mBAAmB,iCAAiC,qCAAqC,6UAA6U,wBAAwB,6GAA6G,2BAA2B,8BAA8B,qBAAqB,6BAA6B,yCAAyC,oCAAoC,WAAW,cAAc,kBAAkB,OAAO,MAAM,WAAW,YAAY,iCAAiC,+BAA+B,oBAAoB,iCAAiC,aAAa,sCAAsC","file":"5.64e3757d90b4958d12d9.css","sourcesContent":["#monkey{position:relative;display:block;margin-left:auto;margin-right:auto;width:7.5rem;height:7.5rem;margin-bottom:1.75rem}@media (min-width: 600px) and (min-height: 450px){#monkey{width:10rem;height:10rem;margin-bottom:2.5rem}}#monkey.big{width:10rem;height:10rem}#monkey .AnimatedSticker{position:absolute;left:0;top:0;width:100%;height:100%}#monkey .AnimatedSticker.hidden{display:none}#monkey .monkey-preview{width:100%;height:100%;background-size:100%;background:url(monkey.a3d5fcdc50b18dc55695f7dd4101a8c9.svg) center}\n",".Modal{position:relative;z-index:var(--z-modal)}.Modal.delete .modal-dialog,.Modal.error .modal-dialog,.Modal.confirm .modal-dialog,.Modal.pin .modal-dialog,.Modal.unpin-all .modal-dialog{max-width:23rem}.Modal.error .modal-content>div{margin-top:1rem}.Modal.narrow .modal-dialog{max-width:20rem}.Modal.report .modal-dialog{max-width:15rem}.Modal .modal-container{position:fixed;top:0;bottom:0;left:0;right:0;display:flex;justify-content:center;align-items:center}.Modal .modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:-1;background-color:rgba(0,0,0,0.25)}.Modal.transparent-backdrop .modal-backdrop{background-color:transparent}.Modal .modal-dialog{position:relative;display:inline-flex;flex-direction:column;width:100%;max-width:35rem;min-width:17.5rem;margin:2rem auto;background-color:var(--color-background);box-shadow:0 0.25rem 0.5rem 0.125rem var(--color-default-shadow);border-radius:var(--border-radius-default);transform:translate3d(0, -1rem, 0);transition:transform .2s ease, opacity .2s ease}body.animation-level-0 .Modal .modal-dialog{transition:none;transform:none !important}@media (max-width: 450px){.Modal .modal-dialog{max-width:calc(100vw - 3rem) !important}}.Modal.open .modal-dialog{transform:translate3d(0, 0, 0)}.Modal.closing .modal-dialog{transform:translate3d(0, 1rem, 0)}.Modal .modal-header,.Modal .modal-header-condensed{padding:1rem 1rem 0;display:flex;align-items:center;flex-shrink:0}.Modal .modal-title{font-size:1.25rem;font-weight:500;flex:1 1 auto;overflow:hidden;text-overflow:ellipsis}.Modal .modal-title:not(:only-child){margin:0 1.3125rem}.Modal .modal-header-condensed{padding:.5rem 1.25rem 0 .9375rem !important}.Modal .modal-header-condensed .modal-action-button{font-size:0.875rem;height:2.25rem;width:auto;line-height:1.625rem;margin-left:auto;padding-left:1.25rem;padding-right:1.25rem;min-width:5rem}.Modal .modal-content{width:100%;flex-grow:1;padding:1rem;overflow-y:auto}.Modal .modal-content b,.Modal .modal-content strong{word-break:break-word}.Modal .modal-title,.Modal .modal-content,.Modal .modal-content>p{unicode-bidi:plaintext;text-align:initial}.Modal .dialog-buttons{display:flex;align-items:flex-end}.Modal .dialog-buttons .confirm-dialog-button+.confirm-dialog-button{margin-left:1rem}.Modal .confirm-dialog-button{width:auto;height:auto;margin-left:auto;text-align:right;font-weight:500;white-space:pre-wrap}\n",".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(255,255,255,0.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)}\n",".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:white;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(.active) .AvatarEditable label input,.Transition>div:not(.active) .AvatarEditable label i,.Transition>div:not(.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(.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,0.4)}.AvatarEditable label.disabled{pointer-events:none}.AvatarEditable label.disabled i{display:none}.AvatarEditable label.disabled::after{display:none}\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///./src/components/common/PasswordMonkey.scss","webpack:///./src/components/ui/Modal.scss","webpack:///./src/components/ui/CropModal.scss","webpack:///./src/components/ui/AvatarEditable.scss"],"names":[],"mappings":"AAAA,QAAQ,kBAAkB,cAAc,iBAAiB,kBAAkB,aAAa,cAAc,sBAAsB,kDAAkD,QAAQ,YAAY,aAAa,sBAAsB,YAAY,YAAY,aAAa,yBAAyB,kBAAkB,OAAO,MAAM,WAAW,YAAY,gCAAgC,aAAa,wBAAwB,WAAW,YAAY,qBAAqB;;ACA1c,OAAO,kBAAkB,uBAAuB,4IAA4I,gBAAgB,gCAAgC,gBAAgB,4BAA4B,gBAAgB,4BAA4B,gBAAgB,wBAAwB,eAAe,MAAM,SAAS,OAAO,QAAQ,aAAa,uBAAuB,mBAAmB,uBAAuB,eAAe,MAAM,QAAQ,SAAS,OAAO,WAAW,kCAAkC,4CAA4C,6BAA6B,qBAAqB,kBAAkB,oBAAoB,sBAAsB,WAAW,gBAAgB,kBAAkB,iBAAiB,yCAAyC,iEA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oCAAoC,WAAW,cAAc,kBAAkB,OAAO,MAAM,WAAW,YAAY,iCAAiC,+BAA+B,oBAAoB,iCAAiC,aAAa,sCAAsC","file":"5.d0ce99af4355757862b4.css","sourcesContent":["#monkey{position:relative;display:block;margin-left:auto;margin-right:auto;width:7.5rem;height:7.5rem;margin-bottom:1.75rem}@media (min-width: 600px) and (min-height: 450px){#monkey{width:10rem;height:10rem;margin-bottom:2.5rem}}#monkey.big{width:10rem;height:10rem}#monkey .AnimatedSticker{position:absolute;left:0;top:0;width:100%;height:100%}#monkey .AnimatedSticker.hidden{display:none}#monkey .monkey-preview{width:100%;height:100%;background-size:100%;background:url(monkey.a3d5fcdc50b18dc55695f7dd4101a8c9.svg) center}\n",".Modal{position:relative;z-index:var(--z-modal)}.Modal.delete .modal-dialog,.Modal.error .modal-dialog,.Modal.confirm .modal-dialog,.Modal.pin .modal-dialog,.Modal.unpin-all .modal-dialog{max-width:23rem}.Modal.error .modal-content>div{margin-top:1rem}.Modal.narrow .modal-dialog{max-width:20rem}.Modal.report .modal-dialog{max-width:15rem}.Modal .modal-container{position:fixed;top:0;bottom:0;left:0;right:0;display:flex;justify-content:center;align-items:center}.Modal .modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:-1;background-color:rgba(0,0,0,0.25)}.Modal.transparent-backdrop .modal-backdrop{background-color:transparent}.Modal .modal-dialog{position:relative;display:inline-flex;flex-direction:column;width:100%;max-width:35rem;min-width:17.5rem;margin:2rem auto;background-color:var(--color-background);box-shadow:0 0.25rem 0.5rem 0.125rem var(--color-default-shadow);border-radius:var(--border-radius-default);transform:translate3d(0, -1rem, 0);transition:transform .2s ease, opacity .2s ease}body.animation-level-0 .Modal .modal-dialog{transition:none;transform:none !important}@media (max-width: 450px){.Modal .modal-dialog{max-width:calc(100vw - 3rem) !important}}.Modal.open .modal-dialog{transform:translate3d(0, 0, 0)}.Modal.closing .modal-dialog{transform:translate3d(0, 1rem, 0)}.Modal .modal-header,.Modal .modal-header-condensed{padding:1rem 1rem 0;display:flex;align-items:center;flex-shrink:0}.Modal .modal-title{font-size:1.25rem;font-weight:500;flex:1 1 auto;overflow:hidden;text-overflow:ellipsis}.Modal .modal-title:not(:only-child){margin:0 1.3125rem}.Modal .modal-header-condensed{padding:.5rem 1.25rem 0 .9375rem !important}.Modal .modal-header-condensed .modal-action-button{font-size:0.875rem;height:2.25rem;width:auto;line-height:1.625rem;margin-left:auto;padding-left:1.25rem;padding-right:1.25rem;min-width:5rem}.Modal .modal-content{width:100%;flex-grow:1;padding:1rem;overflow-y:auto}.Modal .modal-content b,.Modal .modal-content strong{word-break:break-word}.Modal .modal-title,.Modal .modal-content,.Modal .modal-content>p{unicode-bidi:plaintext;text-align:initial}.Modal .dialog-buttons{display:flex;align-items:flex-end}.Modal .dialog-buttons .confirm-dialog-button+.confirm-dialog-button{margin-left:1rem}.Modal .confirm-dialog-button{width:auto;height:auto;margin-left:auto;text-align:right;font-weight:500;white-space:pre-wrap}\n",".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(255,255,255,0.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)}\n",".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:white;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(.active) .AvatarEditable label input,.Transition>div:not(.active) .AvatarEditable label i,.Transition>div:not(.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(.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,0.4)}.AvatarEditable label.disabled{pointer-events:none}.AvatarEditable label.disabled i{display:none}.AvatarEditable label.disabled::after{display:none}\n"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/5.64e3757d90b4958d12d9.js b/dist/5.d0ce99af4355757862b4.js similarity index 92% rename from dist/5.64e3757d90b4958d12d9.js rename to dist/5.d0ce99af4355757862b4.js index 098a2c9f..52e9bcca 100644 --- a/dist/5.64e3757d90b4958d12d9.js +++ b/dist/5.d0ce99af4355757862b4.js @@ -1,2 +1,2 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[5],{107:function(e,t,a){"use strict";a.r(t),a.d(t,"AuthCode",(function(){return g})),a.d(t,"AuthPassword",(function(){return v})),a.d(t,"AuthRegister",(function(){return w}));var n=a(0),r=a(1),o=a(6),c=a(3),i=a(22),s=a(39),l=a(16),u=a(47),d=a(20),m=a(2),b=a(132),h=a(119);a(144);const p=o.l?m.Db:m.Cb;var f=Object(n.h)(({code:e,codeLength:t,trackingDirection:a,isTracking:r,isBig:o})=>{const[c,i]=Object(n.r)(),[s,l]=Object(n.r)(),[u,d]=Object(n.r)(!1),f=165/t;Object(n.n)(()=>{c||Object(b.a)("MonkeyIdle").then(i)},[c]),Object(n.n)(()=>{s||Object(b.a)("MonkeyTracking").then(l)},[s]);const g=Object(n.m)(()=>d(!0),[]);return n.a.createElement("div",{id:"monkey",className:o?"big":""},!u&&n.a.createElement("div",{className:"monkey-preview"}),c&&n.a.createElement(h.a,{id:"idleMonkey",size:o?m.Ob:p,className:r?"hidden":void 0,animationData:c,play:!r,onLoad:g}),s&&n.a.createElement(h.a,{id:"trackingMonkey",size:o?m.Ob:p,className:r?"shown":"hidden",animationData:s,playSegment:r?function(){const n=e&&e.length>1||a<0?15+f*(e.length-1):0,r=e.length===t?180:15+f*e.length;return a<1?[r,n]:[n,r]}():void 0,speed:2,noLoop:!0}))});var g=Object(n.h)(Object(r.h)(e=>Object(c.l)(e,["authPhoneNumber","authIsCodeViaApp","authIsLoading","authError"]),(e,t)=>Object(c.l)(t,["setAuthCode","returnToAuthPhoneNumber","clearAuthError"]))(({authPhoneNumber:e,authIsCodeViaApp:t,authIsLoading:a,authError:r,setAuthCode:c,returnToAuthPhoneNumber:m,clearAuthError:b})=>{const h=Object(l.a)(),p=Object(n.q)(null),[g,O]=Object(n.r)(""),[j,v]=Object(n.r)(!1),[E,y]=Object(n.r)(1);Object(n.n)(()=>{o.n||p.current.focus()},[]),Object(s.a)(!0,m);const w=Object(n.m)(e=>{r&&b();const{currentTarget:t}=e;t.value=t.value.replace(/[^\d]+/,"").substr(0,5),t.value!==g&&(O(t.value),j?t.value.length||v(!1):v(!0),g&&g.length>t.value.length?y(-1):y(1),5===t.value.length&&c({code:t.value}))},[r,b,g,j,c]);return n.a.createElement("div",{id:"auth-code-form",className:"custom-scroll"},n.a.createElement("div",{className:"auth-form"},n.a.createElement(f,{code:g,codeLength:5,isTracking:j,trackingDirection:E}),n.a.createElement("h2",null,e,n.a.createElement("div",{className:"auth-number-edit",onClick:m,role:"button",tabIndex:0,title:h("WrongNumber")},n.a.createElement("i",{className:"icon-edit"}))),n.a.createElement("p",{className:"note"},Object(i.a)(h(t?"SentAppCode":"Login.JustSentSms"),["simple_markdown"])),n.a.createElement(u.a,{ref:p,id:"sign-in-code",label:h("Code"),onInput:w,value:g,error:r&&h(r),autoComplete:"one-time-code",inputMode:"numeric"}),a&&n.a.createElement(d.a,null)))})),O=a(153),j=a(154);var v=Object(n.h)(Object(r.h)(e=>Object(c.l)(e,["authIsLoading","authError","authHint"]),(e,t)=>Object(c.l)(t,["setAuthPassword","clearAuthError"]))(({authIsLoading:e,authError:t,authHint:a,setAuthPassword:r,clearAuthError:o})=>{const c=Object(l.a)(),[i,s]=Object(n.r)(!1),u=Object(n.m)(e=>{s(e)},[]),d=Object(n.m)(e=>{r({password:e})},[r]);return n.a.createElement("div",{id:"auth-password-form",className:"custom-scroll"},n.a.createElement("div",{className:"auth-form"},n.a.createElement(O.a,{isPasswordVisible:i}),n.a.createElement("h2",null,c("Login.Header.Password")),n.a.createElement("p",{className:"note"},c("Login.EnterPasswordDescription")),n.a.createElement(j.a,{clearError:o,error:t&&c(t),hint:a,isLoading:e,isPasswordVisible:i,onChangePasswordVisibility:u,onSubmit:d})))})),E=a(21),y=a(136);var w=Object(n.h)(Object(r.h)(e=>Object(c.l)(e,["authIsLoading","authError"]),(e,t)=>Object(c.l)(t,["signUp","clearAuthError","uploadProfilePhoto"]))(({authIsLoading:e,authError:t,signUp:a,clearAuthError:r,uploadProfilePhoto:o})=>{const c=Object(l.a)(),[i,s]=Object(n.r)(!1),[d,m]=Object(n.r)(),[b,h]=Object(n.r)(""),[p,f]=Object(n.r)("");return n.a.createElement("div",{id:"auth-registration-form",className:"custom-scroll"},n.a.createElement("div",{className:"auth-form"},n.a.createElement("form",{action:"",method:"post",onSubmit:function(e){e.preventDefault(),a({firstName:b,lastName:p}),d&&o({file:d})}},n.a.createElement(y.a,{onChange:m}),n.a.createElement("h2",null,c("YourName")),n.a.createElement("p",{className:"note"},c("Login.Register.Desc")),n.a.createElement(u.a,{id:"registration-first-name",label:c("Login.Register.FirstName.Placeholder"),onChange:function(e){t&&r();const{target:a}=e;h(a.value),s(a.value.length>0)},value:b,error:t&&c(t),autoComplete:"given-name"}),n.a.createElement(u.a,{id:"registration-last-name",label:c("Login.Register.LastName.Placeholder"),onChange:function(e){const{target:t}=e;f(t.value)},value:p,autoComplete:"family-name"}),i&&n.a.createElement(E.a,{type:"submit",ripple:!0,isLoading:e},c("Next")))))}))},112:function(e,t,a){"use strict";var n=a(0),r=a(56);var o=a(9),c=a(37),i=a(40),s=a(58),l=a(16),u=a(39),d=a(21),m=a(128);a(155);t.a=({title:e,className:t,isOpen:a,header:b,hasCloseButton:h,noBackdrop:p,children:f,onClose:g,onCloseAnimationEnd:O,onEnter:j,shouldSkipHistoryAnimations:v})=>{const{shouldRender:E,transitionClassNames:y}=Object(i.a)(a,O,v,void 0,v),w=Object(n.q)(null);Object(n.n)(()=>a?Object(r.a)({onEsc:g,onEnter:j}):void 0,[a,g,j]),Object(n.n)(()=>a&&w.current?function(e){function t(t){if("Tab"!==t.key)return;t.preventDefault(),t.stopPropagation();const a=Array.from(e.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'));if(!a.length)return;const n=a.findIndex(e=>e.isSameNode(document.activeElement));let r=0;n>=0&&(r=t.shiftKey?n>0?n-1:a.length-1:n{document.removeEventListener("keydown",t,!1)}}(w.current):void 0,[a]);const{forceClose:N}=Object(u.a)(a,g);Object(n.n)(()=>()=>{a&&N()},[]),Object(s.a)(([e])=>(document.body.classList.toggle("has-open-dialog",a),(a||!a&&void 0!==e)&&Object(c.d)(200),()=>{document.body.classList.remove("has-open-dialog")}),[a]);const k=Object(l.a)();if(!E)return;const C=Object(o.a)("Modal",t,y,p&&"transparent-backdrop");return n.a.createElement(m.a,null,n.a.createElement("div",{ref:w,className:C,tabIndex:-1,role:"dialog"},n.a.createElement("div",{className:"modal-container"},n.a.createElement("div",{className:"modal-backdrop",onClick:g}),n.a.createElement("div",{className:"modal-dialog"},b||(e?n.a.createElement("div",{className:"modal-header"},h&&n.a.createElement(d.a,{round:!0,color:"translucent",size:"smaller",ariaLabel:k("Close"),onClick:g},n.a.createElement("i",{className:"icon-close"})),n.a.createElement("div",{className:"modal-title"},e)):void 0),n.a.createElement("div",{className:"modal-content custom-scroll"},f)))))}},119:function(e,t,a){"use strict";var n=a(0),r=a(10),o=a(9),c=a(37),i=a(127);let s,l;async function u(){return s||(s=a.e(7).then(a.bind(null,201)),l=(await s).default),s}setTimeout(u,5e3);t.a=Object(n.h)(({className:e,id:t,animationData:a,play:s,playSegment:d,speed:m,noLoop:b,size:h,quality:p,isLowPriority:f,onLoad:g})=>{const[O,j]=Object(n.r)(),v=Object(n.q)(null),E=Object(n.q)(!1),y=Object(n.q)(!1),w=Object(n.q)();w.current=s;const N=Object(n.q)();N.current=d,Object(n.n)(()=>{if(O||!a)return;const e=()=>{if(!v.current)return;const e=new l(t,v.current,a,{noLoop:b,size:h,quality:p,isLowPriority:f},g);m&&e.setSpeed(m),j(e)};l?e():u().then(()=>{Object(r.b)(()=>{v.current&&e()})})},[O,a,t,f,b,g,p,h,m]),Object(n.n)(()=>()=>{O&&O.destroy()},[O]);const k=Object(n.m)((e=!1)=>{O&&(w.current||N.current)&&(N.current?O.playSegment(N.current):e?O.goToAndPlay(0):O.play())},[O]),C=Object(n.m)(()=>{O&&O.pause()},[O]),L=Object(n.m)(()=>{y.current=!0,O&&(E.current||(E.current=O.isPlaying()),C())},[O,C]),A=Object(n.m)(()=>{E.current&&k(),E.current=!1,y.current=!1},[k]),P=Object(n.m)(()=>{Object(r.b)(A)},[A]);Object(n.n)(()=>{O&&(s||d?y.current?E.current=!0:k(b):y.current?E.current=!1:C())},[O,s,d,b,k,C]),Object(c.c)(L,A),Object(i.a)(L,P);const S=Object(o.a)("AnimatedSticker",e),I=h?`width: ${h}px; height: ${h}px;`:void 0;return n.a.createElement("div",{ref:v,className:S,style:I})})},127:function(e,t,a){"use strict";a.d(t,"a",(function(){return r}));var n=a(0);function r(e,t){Object(n.n)(()=>(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])}},128:function(e,t,a){"use strict";var n=a(0),r=a(67);t.a=({containerId:e,className:t,children:a})=>{const o=Object(n.q)(document.createElement("div"));return Object(n.o)(()=>{const a=document.querySelector(e||"#portals");if(!a)return;const n=o.current;return t&&n.classList.add(t),a.appendChild(n),()=>{r.a.render(void 0,n),a.removeChild(n)}},[t,e]),r.a.render(a,o.current)}},132:function(e,t,a){"use strict";a.d(t,"a",(function(){return c}));var n=a(8),r=a(57);const o={MonkeyIdle:a.p+"TwoFactorSetupMonkeyIdle.dea4a492c144df84ddab778dc8a3f0cd.tgs",MonkeyTracking:a.p+"TwoFactorSetupMonkeyTracking.eb5a7a6f166fb7589c12e6248561fb58.tgs",MonkeyClose:a.p+"TwoFactorSetupMonkeyClose.604c4c833d322b7e6c3ea19bef058241.tgs",MonkeyPeek:a.p+"TwoFactorSetupMonkeyPeek.1905436b042520363d7e59f5d7f903ab.tgs",FoldersAll:a.p+"FoldersAll.3f9f9e243d19f0fbf9aaaff11cbd4572.tgs",FoldersNew:a.p+"FoldersNew.9a40d71c0c8be70f5bd14ff2d7bc1593.tgs",DiscussionGroups:a.p+"DiscussionGroupsDucks.9ea453d1be9d1b0ee77a992f8e587485.tgs"};function c(e){const t=o[e].replace(window.location.origin,"");return r.b("file"+t,n.ApiMediaFormat.Lottie)}},136:function(e,t,a){"use strict";var n=a(0),r=a(9),o=a(2),c=a(17),i=a(16),s=a(21),l=a(112),u=a(20);a(156);const d={type:"blob",quality:.8,format:"jpeg",circle:!1};let m,b,h;var p=Object(n.h)(({file:e,onChange:t,onClose:r})=>{const[p,f]=Object(n.r)(!1);Object(n.n)(()=>{e&&(p?async function(e){try{const t=document.getElementById("avatar-crop");if(!t)return;const{offsetWidth:a,offsetHeight:n}=t;h=new m(t,{enableZoom:!0,boundary:{width:a,height:n},viewport:{width:a-16,height:n-16,type:"circle"}});const r=await Object(c.a)(e);await h.bind({url:r})}catch(e){o.r&&console.error(e)}}(e):async function(){return b||(b=Promise.all([a.e(6),a.e(8)]).then(a.bind(null,333)),m=(await b).default),b}().then(()=>f(!0)))},[e,p]);const g=Object(i.a)();return n.a.createElement(l.a,{isOpen:Boolean(e),onClose:r,title:"Drag to reposition",className:"CropModal",hasCloseButton:!0},p?n.a.createElement("div",{id:"avatar-crop"}):n.a.createElement(u.a,null),n.a.createElement(s.a,{className:"confirm-button",round:!0,color:"primary",onClick:async function(){if(!h)return;const e=await h.result(d),a="string"==typeof e?e:Object(c.b)(e,"avatar.jpg");t(a)},ariaLabel:g("CropImage")},n.a.createElement("i",{className:"icon-check"})))});a(157);t.a=Object(n.h)(({title:e="Change your profile picture",disabled:t,currentAvatarBlobUrl:a,onChange:o})=>{const[c,i]=Object(n.r)(),[s,l]=Object(n.r)(a);Object(n.n)(()=>{l(a)},[a]);const u=Object(r.a)(s&&"filled",t&&"disabled");return n.a.createElement("div",{className:"AvatarEditable"},n.a.createElement("label",{className:u,role:"button",tabIndex:0,title:e},n.a.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"}),n.a.createElement("i",{className:"icon-camera-add"}),s&&n.a.createElement("img",{src:s,alt:"Avatar"})),n.a.createElement(p,{file:c,onClose:function(){i(void 0)},onChange:function(e){i(void 0),o(e),s&&URL.revokeObjectURL(s),l(URL.createObjectURL(e))}}))})},144:function(e,t,a){},153:function(e,t,a){"use strict";var n=a(0),r=a(2),o=a(6),c=a(132),i=a(119);a(144);const s=[0,50],l=[0,20],u=[20,0],d=o.l?r.Db:r.Cb;t.a=Object(n.h)(({isPasswordVisible:e,isBig:t})=>{const[a,o]=Object(n.r)(),[m,b]=Object(n.r)(),[h,p]=Object(n.r)(!1),[f,g]=Object(n.r)(!1);Object(n.n)(()=>{a?setTimeout(()=>g(!0),2e3):Object(c.a)("MonkeyClose").then(o)},[a]),Object(n.n)(()=>{m||Object(c.a)("MonkeyPeek").then(b)},[m]);const O=Object(n.m)(()=>p(!0),[]);return n.a.createElement("div",{id:"monkey",className:t?"big":""},!h&&n.a.createElement("div",{className:"monkey-preview"}),a&&n.a.createElement(i.a,{id:"closeMonkey",size:t?r.Ob:d,className:f?"hidden":"shown",animationData:a,playSegment:s,noLoop:!0,onLoad:O}),m&&n.a.createElement(i.a,{id:"peekMonkey",size:t?r.Ob:d,className:f?"shown":"hidden",animationData:m,playSegment:e?l:u,noLoop:!0}))})},154:function(e,t,a){"use strict";var n=a(0),r=a(2),o=a(6),c=a(9),i=a(16),s=a(21);const l=o.l?550:400;t.a=Object(n.h)(({isLoading:e=!1,isPasswordVisible:t,error:a,hint:u,placeholder:d="Password",submitLabel:m="Next",clearError:b,onChangePasswordVisibility:h,onInputChange:p,onSubmit:f})=>{const g=Object(n.q)(null),O=Object(i.a)(),[j,v]=Object(n.r)(""),[E,y]=Object(n.r)(!1);return Object(n.n)(()=>{o.n||setTimeout(()=>{g.current.focus()},l)},[]),Object(n.n)(()=>{a&&requestAnimationFrame(()=>{g.current.focus(),g.current.select()})},[a]),n.a.createElement("form",{action:"",onSubmit:function(t){t.preventDefault(),e||E&&f(j)},autoComplete:"off"},n.a.createElement("div",{className:Object(c.a)("input-group password-input",j&&"touched",a&&"error"),dir:O.isRtl?"rtl":void 0},n.a.createElement("input",{ref:g,className:"form-control",type:t?"text":"password",id:"sign-in-password",value:j||"",autoComplete:"current-password",onChange:function(e){a&&b();const{target:t}=e;v(t.value),y(t.value.length>=r.jb),p&&p(t.value)},dir:"auto"}),n.a.createElement("label",null,a||u||d),n.a.createElement("div",{className:"toggle-password",onClick:function(){h(!t)},role:"button",tabIndex:0,title:"Toggle password visibility"},n.a.createElement("i",{className:t?"icon-eye":"icon-eye-closed"}))),E&&n.a.createElement(s.a,{type:"submit",ripple:!0,isLoading:e},m))})},155:function(e,t,a){},156:function(e,t,a){},157:function(e,t,a){}}]); -//# sourceMappingURL=5.64e3757d90b4958d12d9.js.map \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[5],{107:function(e,t,a){"use strict";a.r(t),a.d(t,"AuthCode",(function(){return g})),a.d(t,"AuthPassword",(function(){return v})),a.d(t,"AuthRegister",(function(){return w}));var n=a(0),r=a(1),o=a(6),c=a(3),i=a(23),s=a(40),l=a(17),u=a(48),d=a(20),m=a(2),b=a(132),h=a(119);a(144);const p=o.l?m.Db:m.Cb;var f=Object(n.h)(({code:e,codeLength:t,trackingDirection:a,isTracking:r,isBig:o})=>{const[c,i]=Object(n.r)(),[s,l]=Object(n.r)(),[u,d]=Object(n.r)(!1),f=165/t;Object(n.n)(()=>{c||Object(b.a)("MonkeyIdle").then(i)},[c]),Object(n.n)(()=>{s||Object(b.a)("MonkeyTracking").then(l)},[s]);const g=Object(n.m)(()=>d(!0),[]);return n.a.createElement("div",{id:"monkey",className:o?"big":""},!u&&n.a.createElement("div",{className:"monkey-preview"}),c&&n.a.createElement(h.a,{id:"idleMonkey",size:o?m.Ob:p,className:r?"hidden":void 0,animationData:c,play:!r,onLoad:g}),s&&n.a.createElement(h.a,{id:"trackingMonkey",size:o?m.Ob:p,className:r?"shown":"hidden",animationData:s,playSegment:r?function(){const n=e&&e.length>1||a<0?15+f*(e.length-1):0,r=e.length===t?180:15+f*e.length;return a<1?[r,n]:[n,r]}():void 0,speed:2,noLoop:!0}))});var g=Object(n.h)(Object(r.h)(e=>Object(c.l)(e,["authPhoneNumber","authIsCodeViaApp","authIsLoading","authError"]),(e,t)=>Object(c.l)(t,["setAuthCode","returnToAuthPhoneNumber","clearAuthError"]))(({authPhoneNumber:e,authIsCodeViaApp:t,authIsLoading:a,authError:r,setAuthCode:c,returnToAuthPhoneNumber:m,clearAuthError:b})=>{const h=Object(l.a)(),p=Object(n.q)(null),[g,O]=Object(n.r)(""),[j,v]=Object(n.r)(!1),[E,y]=Object(n.r)(1);Object(n.n)(()=>{o.n||p.current.focus()},[]),Object(s.a)(!0,m);const w=Object(n.m)(e=>{r&&b();const{currentTarget:t}=e;t.value=t.value.replace(/[^\d]+/,"").substr(0,5),t.value!==g&&(O(t.value),j?t.value.length||v(!1):v(!0),g&&g.length>t.value.length?y(-1):y(1),5===t.value.length&&c({code:t.value}))},[r,b,g,j,c]);return n.a.createElement("div",{id:"auth-code-form",className:"custom-scroll"},n.a.createElement("div",{className:"auth-form"},n.a.createElement(f,{code:g,codeLength:5,isTracking:j,trackingDirection:E}),n.a.createElement("h2",null,e,n.a.createElement("div",{className:"auth-number-edit",onClick:m,role:"button",tabIndex:0,title:h("WrongNumber")},n.a.createElement("i",{className:"icon-edit"}))),n.a.createElement("p",{className:"note"},Object(i.a)(h(t?"SentAppCode":"Login.JustSentSms"),["simple_markdown"])),n.a.createElement(u.a,{ref:p,id:"sign-in-code",label:h("Code"),onInput:w,value:g,error:r&&h(r),autoComplete:"one-time-code",inputMode:"numeric"}),a&&n.a.createElement(d.a,null)))})),O=a(154),j=a(155);var v=Object(n.h)(Object(r.h)(e=>Object(c.l)(e,["authIsLoading","authError","authHint"]),(e,t)=>Object(c.l)(t,["setAuthPassword","clearAuthError"]))(({authIsLoading:e,authError:t,authHint:a,setAuthPassword:r,clearAuthError:o})=>{const c=Object(l.a)(),[i,s]=Object(n.r)(!1),u=Object(n.m)(e=>{s(e)},[]),d=Object(n.m)(e=>{r({password:e})},[r]);return n.a.createElement("div",{id:"auth-password-form",className:"custom-scroll"},n.a.createElement("div",{className:"auth-form"},n.a.createElement(O.a,{isPasswordVisible:i}),n.a.createElement("h2",null,c("Login.Header.Password")),n.a.createElement("p",{className:"note"},c("Login.EnterPasswordDescription")),n.a.createElement(j.a,{clearError:o,error:t&&c(t),hint:a,isLoading:e,isPasswordVisible:i,onChangePasswordVisibility:u,onSubmit:d})))})),E=a(22),y=a(136);var w=Object(n.h)(Object(r.h)(e=>Object(c.l)(e,["authIsLoading","authError"]),(e,t)=>Object(c.l)(t,["signUp","clearAuthError","uploadProfilePhoto"]))(({authIsLoading:e,authError:t,signUp:a,clearAuthError:r,uploadProfilePhoto:o})=>{const c=Object(l.a)(),[i,s]=Object(n.r)(!1),[d,m]=Object(n.r)(),[b,h]=Object(n.r)(""),[p,f]=Object(n.r)("");return n.a.createElement("div",{id:"auth-registration-form",className:"custom-scroll"},n.a.createElement("div",{className:"auth-form"},n.a.createElement("form",{action:"",method:"post",onSubmit:function(e){e.preventDefault(),a({firstName:b,lastName:p}),d&&o({file:d})}},n.a.createElement(y.a,{onChange:m}),n.a.createElement("h2",null,c("YourName")),n.a.createElement("p",{className:"note"},c("Login.Register.Desc")),n.a.createElement(u.a,{id:"registration-first-name",label:c("Login.Register.FirstName.Placeholder"),onChange:function(e){t&&r();const{target:a}=e;h(a.value),s(a.value.length>0)},value:b,error:t&&c(t),autoComplete:"given-name"}),n.a.createElement(u.a,{id:"registration-last-name",label:c("Login.Register.LastName.Placeholder"),onChange:function(e){const{target:t}=e;f(t.value)},value:p,autoComplete:"family-name"}),i&&n.a.createElement(E.a,{type:"submit",ripple:!0,isLoading:e},c("Next")))))}))},112:function(e,t,a){"use strict";var n=a(0),r=a(57);var o=a(9),c=a(38),i=a(41),s=a(58),l=a(17),u=a(40),d=a(22),m=a(128);a(156);t.a=({title:e,className:t,isOpen:a,header:b,hasCloseButton:h,noBackdrop:p,children:f,onClose:g,onCloseAnimationEnd:O,onEnter:j,shouldSkipHistoryAnimations:v})=>{const{shouldRender:E,transitionClassNames:y}=Object(i.a)(a,O,v,void 0,v),w=Object(n.q)(null);Object(n.n)(()=>a?Object(r.a)({onEsc:g,onEnter:j}):void 0,[a,g,j]),Object(n.n)(()=>a&&w.current?function(e){function t(t){if("Tab"!==t.key)return;t.preventDefault(),t.stopPropagation();const a=Array.from(e.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'));if(!a.length)return;const n=a.findIndex(e=>e.isSameNode(document.activeElement));let r=0;n>=0&&(r=t.shiftKey?n>0?n-1:a.length-1:n{document.removeEventListener("keydown",t,!1)}}(w.current):void 0,[a]);const{forceClose:N}=Object(u.a)(a,g);Object(n.n)(()=>()=>{a&&N()},[]),Object(s.a)(([e])=>(document.body.classList.toggle("has-open-dialog",a),(a||!a&&void 0!==e)&&Object(c.d)(200),()=>{document.body.classList.remove("has-open-dialog")}),[a]);const k=Object(l.a)();if(!E)return;const C=Object(o.a)("Modal",t,y,p&&"transparent-backdrop");return n.a.createElement(m.a,null,n.a.createElement("div",{ref:w,className:C,tabIndex:-1,role:"dialog"},n.a.createElement("div",{className:"modal-container"},n.a.createElement("div",{className:"modal-backdrop",onClick:g}),n.a.createElement("div",{className:"modal-dialog"},b||(e?n.a.createElement("div",{className:"modal-header"},h&&n.a.createElement(d.a,{round:!0,color:"translucent",size:"smaller",ariaLabel:k("Close"),onClick:g},n.a.createElement("i",{className:"icon-close"})),n.a.createElement("div",{className:"modal-title"},e)):void 0),n.a.createElement("div",{className:"modal-content custom-scroll"},f)))))}},119:function(e,t,a){"use strict";var n=a(0),r=a(10),o=a(9),c=a(38),i=a(127);let s,l;async function u(){return s||(s=a.e(7).then(a.bind(null,202)),l=(await s).default),s}setTimeout(u,5e3);t.a=Object(n.h)(({className:e,id:t,animationData:a,play:s,playSegment:d,speed:m,noLoop:b,size:h,quality:p,isLowPriority:f,onLoad:g})=>{const[O,j]=Object(n.r)(),v=Object(n.q)(null),E=Object(n.q)(!1),y=Object(n.q)(!1),w=Object(n.q)();w.current=s;const N=Object(n.q)();N.current=d,Object(n.n)(()=>{if(O||!a)return;const e=()=>{if(!v.current)return;const e=new l(t,v.current,a,{noLoop:b,size:h,quality:p,isLowPriority:f},g);m&&e.setSpeed(m),j(e)};l?e():u().then(()=>{Object(r.b)(()=>{v.current&&e()})})},[O,a,t,f,b,g,p,h,m]),Object(n.n)(()=>()=>{O&&O.destroy()},[O]);const k=Object(n.m)((e=!1)=>{O&&(w.current||N.current)&&(N.current?O.playSegment(N.current):e?O.goToAndPlay(0):O.play())},[O]),C=Object(n.m)(()=>{O&&O.pause()},[O]),L=Object(n.m)(()=>{y.current=!0,O&&(E.current||(E.current=O.isPlaying()),C())},[O,C]),A=Object(n.m)(()=>{E.current&&k(),E.current=!1,y.current=!1},[k]),P=Object(n.m)(()=>{Object(r.b)(A)},[A]);Object(n.n)(()=>{O&&(s||d?y.current?E.current=!0:k(b):y.current?E.current=!1:C())},[O,s,d,b,k,C]),Object(c.c)(L,A),Object(i.a)(L,P);const S=Object(o.a)("AnimatedSticker",e),I=h?`width: ${h}px; height: ${h}px;`:void 0;return n.a.createElement("div",{ref:v,className:S,style:I})})},127:function(e,t,a){"use strict";a.d(t,"a",(function(){return r}));var n=a(0);function r(e,t){Object(n.n)(()=>(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])}},128:function(e,t,a){"use strict";var n=a(0),r=a(67);t.a=({containerId:e,className:t,children:a})=>{const o=Object(n.q)(document.createElement("div"));return Object(n.o)(()=>{const a=document.querySelector(e||"#portals");if(!a)return;const n=o.current;return t&&n.classList.add(t),a.appendChild(n),()=>{r.a.render(void 0,n),a.removeChild(n)}},[t,e]),r.a.render(a,o.current)}},132:function(e,t,a){"use strict";a.d(t,"a",(function(){return c}));var n=a(8),r=a(33);const o={MonkeyIdle:a.p+"TwoFactorSetupMonkeyIdle.dea4a492c144df84ddab778dc8a3f0cd.tgs",MonkeyTracking:a.p+"TwoFactorSetupMonkeyTracking.eb5a7a6f166fb7589c12e6248561fb58.tgs",MonkeyClose:a.p+"TwoFactorSetupMonkeyClose.604c4c833d322b7e6c3ea19bef058241.tgs",MonkeyPeek:a.p+"TwoFactorSetupMonkeyPeek.1905436b042520363d7e59f5d7f903ab.tgs",FoldersAll:a.p+"FoldersAll.3f9f9e243d19f0fbf9aaaff11cbd4572.tgs",FoldersNew:a.p+"FoldersNew.9a40d71c0c8be70f5bd14ff2d7bc1593.tgs",DiscussionGroups:a.p+"DiscussionGroupsDucks.9ea453d1be9d1b0ee77a992f8e587485.tgs"};function c(e){const t=o[e].replace(window.location.origin,"");return r.b("file"+t,n.ApiMediaFormat.Lottie)}},136:function(e,t,a){"use strict";var n=a(0),r=a(9),o=a(2),c=a(16),i=a(17),s=a(22),l=a(112),u=a(20);a(157);const d={type:"blob",quality:.8,format:"jpeg",circle:!1};let m,b,h;var p=Object(n.h)(({file:e,onChange:t,onClose:r})=>{const[p,f]=Object(n.r)(!1);Object(n.n)(()=>{e&&(p?async function(e){try{const t=document.getElementById("avatar-crop");if(!t)return;const{offsetWidth:a,offsetHeight:n}=t;h=new m(t,{enableZoom:!0,boundary:{width:a,height:n},viewport:{width:a-16,height:n-16,type:"circle"}});const r=await Object(c.a)(e);await h.bind({url:r})}catch(e){o.r&&console.error(e)}}(e):async function(){return b||(b=Promise.all([a.e(6),a.e(8)]).then(a.bind(null,334)),m=(await b).default),b}().then(()=>f(!0)))},[e,p]);const g=Object(i.a)();return n.a.createElement(l.a,{isOpen:Boolean(e),onClose:r,title:"Drag to reposition",className:"CropModal",hasCloseButton:!0},p?n.a.createElement("div",{id:"avatar-crop"}):n.a.createElement(u.a,null),n.a.createElement(s.a,{className:"confirm-button",round:!0,color:"primary",onClick:async function(){if(!h)return;const e=await h.result(d),a="string"==typeof e?e:Object(c.b)(e,"avatar.jpg");t(a)},ariaLabel:g("CropImage")},n.a.createElement("i",{className:"icon-check"})))});a(158);t.a=Object(n.h)(({title:e="Change your profile picture",disabled:t,currentAvatarBlobUrl:a,onChange:o})=>{const[c,i]=Object(n.r)(),[s,l]=Object(n.r)(a);Object(n.n)(()=>{l(a)},[a]);const u=Object(r.a)(s&&"filled",t&&"disabled");return n.a.createElement("div",{className:"AvatarEditable"},n.a.createElement("label",{className:u,role:"button",tabIndex:0,title:e},n.a.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"}),n.a.createElement("i",{className:"icon-camera-add"}),s&&n.a.createElement("img",{src:s,alt:"Avatar"})),n.a.createElement(p,{file:c,onClose:function(){i(void 0)},onChange:function(e){i(void 0),o(e),s&&URL.revokeObjectURL(s),l(URL.createObjectURL(e))}}))})},144:function(e,t,a){},154:function(e,t,a){"use strict";var n=a(0),r=a(2),o=a(6),c=a(132),i=a(119);a(144);const s=[0,50],l=[0,20],u=[20,0],d=o.l?r.Db:r.Cb;t.a=Object(n.h)(({isPasswordVisible:e,isBig:t})=>{const[a,o]=Object(n.r)(),[m,b]=Object(n.r)(),[h,p]=Object(n.r)(!1),[f,g]=Object(n.r)(!1);Object(n.n)(()=>{a?setTimeout(()=>g(!0),2e3):Object(c.a)("MonkeyClose").then(o)},[a]),Object(n.n)(()=>{m||Object(c.a)("MonkeyPeek").then(b)},[m]);const O=Object(n.m)(()=>p(!0),[]);return n.a.createElement("div",{id:"monkey",className:t?"big":""},!h&&n.a.createElement("div",{className:"monkey-preview"}),a&&n.a.createElement(i.a,{id:"closeMonkey",size:t?r.Ob:d,className:f?"hidden":"shown",animationData:a,playSegment:s,noLoop:!0,onLoad:O}),m&&n.a.createElement(i.a,{id:"peekMonkey",size:t?r.Ob:d,className:f?"shown":"hidden",animationData:m,playSegment:e?l:u,noLoop:!0}))})},155:function(e,t,a){"use strict";var n=a(0),r=a(2),o=a(6),c=a(9),i=a(17),s=a(22);const l=o.l?550:400;t.a=Object(n.h)(({isLoading:e=!1,isPasswordVisible:t,error:a,hint:u,placeholder:d="Password",submitLabel:m="Next",clearError:b,onChangePasswordVisibility:h,onInputChange:p,onSubmit:f})=>{const g=Object(n.q)(null),O=Object(i.a)(),[j,v]=Object(n.r)(""),[E,y]=Object(n.r)(!1);return Object(n.n)(()=>{o.n||setTimeout(()=>{g.current.focus()},l)},[]),Object(n.n)(()=>{a&&requestAnimationFrame(()=>{g.current.focus(),g.current.select()})},[a]),n.a.createElement("form",{action:"",onSubmit:function(t){t.preventDefault(),e||E&&f(j)},autoComplete:"off"},n.a.createElement("div",{className:Object(c.a)("input-group password-input",j&&"touched",a&&"error"),dir:O.isRtl?"rtl":void 0},n.a.createElement("input",{ref:g,className:"form-control",type:t?"text":"password",id:"sign-in-password",value:j||"",autoComplete:"current-password",onChange:function(e){a&&b();const{target:t}=e;v(t.value),y(t.value.length>=r.jb),p&&p(t.value)},dir:"auto"}),n.a.createElement("label",null,a||u||d),n.a.createElement("div",{className:"toggle-password",onClick:function(){h(!t)},role:"button",tabIndex:0,title:"Toggle password visibility"},n.a.createElement("i",{className:t?"icon-eye":"icon-eye-closed"}))),E&&n.a.createElement(s.a,{type:"submit",ripple:!0,isLoading:e},m))})},156:function(e,t,a){},157:function(e,t,a){},158:function(e,t,a){}}]); +//# sourceMappingURL=5.d0ce99af4355757862b4.js.map \ No newline at end of file diff --git a/dist/5.64e3757d90b4958d12d9.js.map b/dist/5.d0ce99af4355757862b4.js.map similarity index 99% rename from dist/5.64e3757d90b4958d12d9.js.map rename to dist/5.d0ce99af4355757862b4.js.map index 8065d93f..39e5271b 100644 --- a/dist/5.64e3757d90b4958d12d9.js.map +++ b/dist/5.d0ce99af4355757862b4.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///./src/components/common/TrackingMonkey.tsx","webpack:///./src/components/auth/AuthCode.tsx","webpack:///./src/components/auth/AuthPassword.tsx","webpack:///./src/components/auth/AuthRegister.tsx","webpack:///./src/components/ui/Modal.tsx","webpack:///./src/util/trapFocus.ts","webpack:///./src/components/common/AnimatedSticker.tsx","webpack:///./src/hooks/useBackgroundMode.ts","webpack:///./src/components/ui/Portal.ts","webpack:///./src/components/common/helpers/animatedAssets.ts","webpack:///./src/assets/TwoFactorSetupMonkeyIdle.tgs","webpack:///./src/assets/TwoFactorSetupMonkeyTracking.tgs","webpack:///./src/assets/TwoFactorSetupMonkeyClose.tgs","webpack:///./src/assets/TwoFactorSetupMonkeyPeek.tgs","webpack:///./src/assets/FoldersAll.tgs","webpack:///./src/assets/FoldersNew.tgs","webpack:///./src/assets/DiscussionGroupsDucks.tgs","webpack:///./src/components/ui/CropModal.tsx","webpack:///./src/components/ui/AvatarEditable.tsx","webpack:///./src/components/common/PasswordMonkey.tsx","webpack:///./src/components/common/PasswordForm.tsx"],"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","setGlobal","actions","authPhoneNumber","authIsCodeViaApp","authIsLoading","authError","setAuthCode","returnToAuthPhoneNumber","clearAuthError","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","Modal","isOpen","header","hasCloseButton","noBackdrop","children","onClose","onCloseAnimationEnd","onEnter","shouldSkipHistoryAnimations","shouldRender","transitionClassNames","useShowTransition","modalRef","captureKeyboardListeners","onEsc","element","handleKeyDown","key","stopPropagation","focusableElements","Array","from","querySelectorAll","currentFocusedIndex","findIndex","em","isSameNode","document","activeElement","newFocusedIndex","shiftKey","addEventListener","removeEventListener","trapFocus","forceClose","useEffectWithPrevDeps","prevIsOpen","body","classList","toggle","dispatchHeavyAnimationEvent","remove","fullClassName","buildClassName","Portal","round","color","ariaLabel","lottiePromise","RLottie","async","ensureLottie","default","setTimeout","quality","isLowPriority","animation","setAnimation","container","wasPlaying","isFrozen","playRef","playSegmentRef","exec","newAnimation","setSpeed","fastRaf","destroy","playAnimation","shouldRestart","goToAndPlay","pauseAnimation","pause","freezeAnimation","isPlaying","unfreezeAnimation","unfreezeAnimationOnRaf","useHeavyAnimationCheck","useBackgroundMode","style","onBlur","onFocus","hasFocus","window","containerId","elementRef","createElement","useLayoutEffect","querySelector","add","appendChild","TeactDOM","render","removeChild","ANIMATED_STICKERS_PATHS","MonkeyIdle","MonkeyTracking","MonkeyClose","MonkeyPeek","FoldersAll","FoldersNew","DiscussionGroups","name","path","location","origin","mediaLoader","ApiMediaFormat","Lottie","cropperResultOptions","format","circle","Croppie","croppiePromise","cropper","isCroppieReady","setIsCroppieReady","imgFile","cropContainer","getElementById","offsetWidth","offsetHeight","enableZoom","boundary","width","height","viewport","dataUri","blobToDataUri","bind","url","err","DEBUG","console","initCropper","ensureCroppie","Boolean","result","croppedImg","blobToFile","disabled","currentAvatarBlobUrl","selectedFile","setSelectedFile","croppedBlobUrl","setCroppedBlobUrl","labelClassName","files","accept","src","alt","URL","revokeObjectURL","createObjectURL","SEGMENT_COVER_EYES","SEGMENT_UNCOVER_EYE","SEGMENT_COVER_EYE","closeMonkeyData","setCloseMonkeyData","peekMonkeyData","setPeekMonkeyData","isPeekShown","setIsPeekShown","FOCUS_DELAY_TIMEOUT_MS","placeholder","submitLabel","onInputChange","setPassword","canSubmit","setCanSubmit","requestAnimationFrame","select","dir","isRtl","MIN_PASSWORD_LENGTH"],"mappings":"4UAoBA,MAEMA,EAAeC,IAA0BC,KAA2BC,KA+E3DC,kBA7EsB,EACnCC,OACAC,aACAC,oBACAC,aACAC,YAEA,MAAOC,EAAgBC,GAAqBC,eACrCC,EAAoBC,GAAyBF,eAC7CG,EAAqBC,GAA0BJ,aAAS,GACzDK,EAA6B,IAA8CX,EAEjFY,YAAU,KACHR,GACHS,YAAiB,cAAcC,KAAKT,IAErC,CAACD,IAEJQ,YAAU,KACHL,GACHM,YAAiB,kBAAkBC,KAAKN,IAEzC,CAACD,IAEJ,MAAMQ,EAAwBC,YAAY,IAAMN,GAAuB,GAAO,IAuB9E,OACE,yBAAKO,GAAG,SAASC,UAAWf,EAAQ,MAAQ,KACxCM,GACA,yBAAKS,UAAU,mBAEhBd,GACC,kBAACe,EAAA,EAAD,CACEF,GAAG,aACHG,KAAMjB,EAAQkB,KAAsB3B,EACpCwB,UAAWhB,EAAa,cAAWoB,EACnCC,cAAenB,EACfoB,MAAOtB,EACPuB,OAAQV,IAGXR,GACC,kBAACY,EAAA,EAAD,CACEF,GAAG,iBACHG,KAAMjB,EAAQkB,KAAsB3B,EACpCwB,UAAYhB,EAAwB,QAAX,SACzBqB,cAAehB,EACfmB,YAAaxB,EA1CrB,WACE,MAAMyB,EAAc5B,GAAQA,EAAK6B,OAAS,GAAM3B,EAAoB,EA/B3C,GAgCEU,GAA8BZ,EAAK6B,OAAS,GACnE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nR,aAAS,GAgD3C,OA9CAM,YAAU,KACHwC,KACHiH,WAAW,KACTtH,EAASM,QAASC,SACjB6N,IAEJ,IAEHvQ,YAAU,KACJ4D,GACFkN,sBAAsB,KACpB3O,EAASM,QAASC,QAClBP,EAASM,QAASsO,YAGrB,CAACnN,IAgCF,0BAAM6B,OAAO,GAAGX,SAblB,SAAsBa,GACpBA,EAAMC,iBAEFhB,GAIAgM,GACF9L,EAASP,IAK6BV,aAAa,OACnD,yBACEvD,UAAWyI,YAAe,6BAA8BxE,GAAY,UAAWX,GAAS,SACxFoN,IAAK/O,EAAKgP,MAAQ,WAAQvQ,GAE1B,2BACE+C,IAAKtB,EACL7B,UAAU,eACV2F,KAAMzB,EAAoB,OAAS,WACnCnE,GAAG,mBACH2C,MAAOuB,GAAY,GACnBV,aAAa,mBACbkC,SA1CR,SAA0BlD,GACpBe,GACFc,IAGF,MAAM,OAAE3B,GAAWF,EACnB8N,EAAY5N,EAAOC,OACnB6N,EAAa9N,EAAOC,MAAMhC,QAAUkQ,MAChCR,GACFA,EAAc3N,EAAOC,QAkCjBgO,IAAI,SAEN,+BAAQpN,GAASe,GAAQ6L,GACzB,yBACElQ,UAAU,kBACV6C,QAnCR,WACE0B,GAA4BL,IAmCtBpB,KAAK,SACLC,SAAU,EACVC,MAAM,8BAEN,uBAAGhD,UAAWkE,EAAoB,WAAa,sBAGlDoM,GACC,kBAAC,IAAD,CAAQ3K,KAAK,SAASC,QAAM,EAACtB,UAAWA,GACrC6L,O","file":"5.64e3757d90b4958d12d9.js","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 { withGlobal } from '../../lib/teact/teactn';\nimport { GlobalState, GlobalActions } 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;\ntype DispatchProps = Pick;\n\nconst CODE_LENGTH = 5;\n\nconst AuthCode: FC = ({\n authPhoneNumber,\n authIsCodeViaApp,\n authIsLoading,\n authError,\n setAuthCode,\n returnToAuthPhoneNumber,\n clearAuthError,\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 (setGlobal, actions): DispatchProps => pick(actions, [\n 'setAuthCode',\n 'returnToAuthPhoneNumber',\n 'clearAuthError',\n ]),\n)(AuthCode));\n","import React, {\n FC, memo, useCallback, useState,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalState, GlobalActions } 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;\ntype DispatchProps = Pick;\n\nconst AuthPassword: FC = ({\n authIsLoading, authError, authHint, setAuthPassword, clearAuthError,\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 (setGlobal, actions): DispatchProps => pick(actions, ['setAuthPassword', 'clearAuthError']),\n)(AuthPassword));\n","import { ChangeEvent } from 'react';\nimport React, { FC, useState, memo } from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalState, GlobalActions } 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;\ntype DispatchProps = Pick;\n\nconst AuthRegister: FC = ({\n authIsLoading, authError, signUp, clearAuthError, uploadProfilePhoto,\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 (setGlobal, actions): DispatchProps => pick(actions, ['signUp', 'clearAuthError', 'uploadProfilePhoto']),\n)(AuthRegister));\n","import 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: any;\n onClose: () => void;\n onCloseAnimationEnd?: () => void;\n onEnter?: () => void;\n};\n\ntype StateProps = {\n shouldSkipHistoryAnimations?: boolean;\n};\n\nconst Modal: FC = ({\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\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 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: AnyLiteral;\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};\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 supposed for judges to measure \"Transferred Size\" in Dev Tools\nconst LOTTIE_LOAD_DELAY = 5000;\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 onLoad,\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\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 );\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 }, [animation, animationData, id, isLowPriority, noLoop, onLoad, quality, size, speed]);\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 useHeavyAnimationCheck(freezeAnimation, unfreezeAnimation);\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 { 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 { FC, useRef, useLayoutEffect } from '../../lib/teact/teact';\nimport TeactDOM from '../../lib/teact/teact-dom';\n\ntype OwnProps = {\n containerId?: string;\n className?: string;\n children: any;\n};\n\nconst Portal: FC = ({ containerId, className, children }) => {\n const elementRef = useRef(document.createElement('div'));\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, elementRef.current);\n};\n\nexport default Portal;\n","import { ApiMediaFormat } from '../../../api/types';\n\nimport * as mediaLoader from '../../../util/mediaLoader';\n\n// @ts-ignore\nimport MonkeyIdle from '../../../assets/TwoFactorSetupMonkeyIdle.tgs';\n// @ts-ignore\nimport MonkeyTracking from '../../../assets/TwoFactorSetupMonkeyTracking.tgs';\n// @ts-ignore\nimport MonkeyClose from '../../../assets/TwoFactorSetupMonkeyClose.tgs';\n// @ts-ignore\nimport MonkeyPeek from '../../../assets/TwoFactorSetupMonkeyPeek.tgs';\n// @ts-ignore\nimport FoldersAll from '../../../assets/FoldersAll.tgs';\n// @ts-ignore\nimport FoldersNew from '../../../assets/FoldersNew.tgs';\n// @ts-ignore\nimport DiscussionGroups from '../../../assets/DiscussionGroupsDucks.tgs';\n\nexport const ANIMATED_STICKERS_PATHS = {\n MonkeyIdle,\n MonkeyTracking,\n MonkeyClose,\n MonkeyPeek,\n FoldersAll,\n FoldersNew,\n DiscussionGroups,\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","export default __webpack_public_path__ + \"TwoFactorSetupMonkeyIdle.dea4a492c144df84ddab778dc8a3f0cd.tgs\";","export default __webpack_public_path__ + \"TwoFactorSetupMonkeyTracking.eb5a7a6f166fb7589c12e6248561fb58.tgs\";","export default __webpack_public_path__ + \"TwoFactorSetupMonkeyClose.604c4c833d322b7e6c3ea19bef058241.tgs\";","export default __webpack_public_path__ + \"TwoFactorSetupMonkeyPeek.1905436b042520363d7e59f5d7f903ab.tgs\";","export default __webpack_public_path__ + \"FoldersAll.3f9f9e243d19f0fbf9aaaff11cbd4572.tgs\";","export default __webpack_public_path__ + \"FoldersNew.9a40d71c0c8be70f5bd14ff2d7bc1593.tgs\";","export default __webpack_public_path__ + \"DiscussionGroupsDucks.9ea453d1be9d1b0ee77a992f8e587485.tgs\";","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: 0.8,\n format: 'jpeg',\n circle: false,\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 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 { 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"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///./src/components/common/TrackingMonkey.tsx","webpack:///./src/components/auth/AuthCode.tsx","webpack:///./src/components/auth/AuthPassword.tsx","webpack:///./src/components/auth/AuthRegister.tsx","webpack:///./src/components/ui/Modal.tsx","webpack:///./src/util/trapFocus.ts","webpack:///./src/components/common/AnimatedSticker.tsx","webpack:///./src/hooks/useBackgroundMode.ts","webpack:///./src/components/ui/Portal.ts","webpack:///./src/components/common/helpers/animatedAssets.ts","webpack:///./src/assets/TwoFactorSetupMonkeyIdle.tgs","webpack:///./src/assets/TwoFactorSetupMonkeyTracking.tgs","webpack:///./src/assets/TwoFactorSetupMonkeyClose.tgs","webpack:///./src/assets/TwoFactorSetupMonkeyPeek.tgs","webpack:///./src/assets/FoldersAll.tgs","webpack:///./src/assets/FoldersNew.tgs","webpack:///./src/assets/DiscussionGroupsDucks.tgs","webpack:///./src/components/ui/CropModal.tsx","webpack:///./src/components/ui/AvatarEditable.tsx","webpack:///./src/components/common/PasswordMonkey.tsx","webpack:///./src/components/common/PasswordForm.tsx"],"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","setGlobal","actions","authPhoneNumber","authIsCodeViaApp","authIsLoading","authError","setAuthCode","returnToAuthPhoneNumber","clearAuthError","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","Modal","isOpen","header","hasCloseButton","noBackdrop","children","onClose","onCloseAnimationEnd","onEnter","shouldSkipHistoryAnimations","shouldRender","transitionClassNames","useShowTransition","modalRef","captureKeyboardListeners","onEsc","element","handleKeyDown","key","stopPropagation","focusableElements","Array","from","querySelectorAll","currentFocusedIndex","findIndex","em","isSameNode","document","activeElement","newFocusedIndex","shiftKey","addEventListener","removeEventListener","trapFocus","forceClose","useEffectWithPrevDeps","prevIsOpen","body","classList","toggle","dispatchHeavyAnimationEvent","remove","fullClassName","buildClassName","Portal","round","color","ariaLabel","lottiePromise","RLottie","async","ensureLottie","default","setTimeout","quality","isLowPriority","animation","setAnimation","container","wasPlaying","isFrozen","playRef","playSegmentRef","exec","newAnimation","setSpeed","fastRaf","destroy","playAnimation","shouldRestart","goToAndPlay","pauseAnimation","pause","freezeAnimation","isPlaying","unfreezeAnimation","unfreezeAnimationOnRaf","useHeavyAnimationCheck","useBackgroundMode","style","onBlur","onFocus","hasFocus","window","containerId","elementRef","createElement","useLayoutEffect","querySelector","add","appendChild","TeactDOM","render","removeChild","ANIMATED_STICKERS_PATHS","MonkeyIdle","MonkeyTracking","MonkeyClose","MonkeyPeek","FoldersAll","FoldersNew","DiscussionGroups","name","path","location","origin","mediaLoader","ApiMediaFormat","Lottie","cropperResultOptions","format","circle","Croppie","croppiePromise","cropper","isCroppieReady","setIsCroppieReady","imgFile","cropContainer","getElementById","offsetWidth","offsetHeight","enableZoom","boundary","width","height","viewport","dataUri","blobToDataUri","bind","url","err","DEBUG","console","initCropper","ensureCroppie","Boolean","result","croppedImg","blobToFile","disabled","currentAvatarBlobUrl","selectedFile","setSelectedFile","croppedBlobUrl","setCroppedBlobUrl","labelClassName","files","accept","src","alt","URL","revokeObjectURL","createObjectURL","SEGMENT_COVER_EYES","SEGMENT_UNCOVER_EYE","SEGMENT_COVER_EYE","closeMonkeyData","setCloseMonkeyData","peekMonkeyData","setPeekMonkeyData","isPeekShown","setIsPeekShown","FOCUS_DELAY_TIMEOUT_MS","placeholder","submitLabel","onInputChange","setPassword","canSubmit","setCanSubmit","requestAnimationFrame","select","dir","isRtl","MIN_PASSWORD_LENGTH"],"mappings":"4UAoBA,MAEMA,EAAeC,IAA0BC,KAA2BC,KA+E3DC,kBA7EsB,EACnCC,OACAC,aACAC,oBACAC,aACAC,YAEA,MAAOC,EAAgBC,GAAqBC,eACrCC,EAAoBC,GAAyBF,eAC7CG,EAAqBC,GAA0BJ,aAAS,GACzDK,EAA6B,IAA8CX,EAEjFY,YAAU,KACHR,GACHS,YAAiB,cAAcC,KAAKT,IAErC,CAACD,IAEJQ,YAAU,KACHL,GACHM,YAAiB,kBAAkBC,KAAKN,IAEzC,CAACD,IAEJ,MAAMQ,EAAwBC,YAAY,IAAMN,GAAuB,GAAO,IAuB9E,OACE,yBAAKO,GAAG,SAASC,UAAWf,EAAQ,MAAQ,KACxCM,GACA,yBAAKS,UAAU,mBAEhBd,GACC,kBAACe,EAAA,EAAD,CACEF,GAAG,aACHG,KAAMjB,EAAQkB,KAAsB3B,EACpCwB,UAAWhB,EAAa,cAAWoB,EACnCC,cAAenB,EACfoB,MAAOtB,EACPuB,OAAQV,IAGXR,GACC,kBAACY,EAAA,EAAD,CACEF,GAAG,iBACHG,KAAMjB,EAAQkB,KAAsB3B,EACpCwB,UAAYhB,EAAwB,QAAX,SACzBqB,cAAehB,EACfmB,YAAaxB,EA1CrB,WACE,MAAMyB,EAAc5B,GAAQA,EAAK6B,OAAS,GAAM3B,EAAoB,EA/B3C,GAgCEU,GAA8BZ,EAAK6B,OAAS,GACnE,EACEC,EAAW9B,EAAK6B,SAAW5B,EAjCV,IADE,GAoCEW,EAA6BZ,EAAK6B,OAE7D,OAAI3B,EAAoB,EACf,CACL4B,EACAF,GAIG,CACLA,EACAE,GAyB8BC,QAAsBR,EAChDS,MAAO,EACPC,QAAM,OC0BDlC,kBAAKmC,YACjBC,GAAuBC,YAAKD,EAAQ,CAAC,kBAAmB,mBAAoB,gBAAiB,cAC9F,CAACE,EAAWC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IAK6BV,aAAa,OACnD,yBACEvD,UAAWyI,YAAe,6BAA8BxE,GAAY,UAAWX,GAAS,SACxFoN,IAAK/O,EAAKgP,MAAQ,WAAQvQ,GAE1B,2BACE+C,IAAKtB,EACL7B,UAAU,eACV2F,KAAMzB,EAAoB,OAAS,WACnCnE,GAAG,mBACH2C,MAAOuB,GAAY,GACnBV,aAAa,mBACbkC,SA1CR,SAA0BlD,GACpBe,GACFc,IAGF,MAAM,OAAE3B,GAAWF,EACnB8N,EAAY5N,EAAOC,OACnB6N,EAAa9N,EAAOC,MAAMhC,QAAUkQ,MAChCR,GACFA,EAAc3N,EAAOC,QAkCjBgO,IAAI,SAEN,+BAAQpN,GAASe,GAAQ6L,GACzB,yBACElQ,UAAU,kBACV6C,QAnCR,WACE0B,GAA4BL,IAmCtBpB,KAAK,SACLC,SAAU,EACVC,MAAM,8BAEN,uBAAGhD,UAAWkE,EAAoB,WAAa,sBAGlDoM,GACC,kBAAC,IAAD,CAAQ3K,KAAK,SAASC,QAAM,EAACtB,UAAWA,GACrC6L,O","file":"5.d0ce99af4355757862b4.js","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 { withGlobal } from '../../lib/teact/teactn';\nimport { GlobalState, GlobalActions } 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;\ntype DispatchProps = Pick;\n\nconst CODE_LENGTH = 5;\n\nconst AuthCode: FC = ({\n authPhoneNumber,\n authIsCodeViaApp,\n authIsLoading,\n authError,\n setAuthCode,\n returnToAuthPhoneNumber,\n clearAuthError,\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 (setGlobal, actions): DispatchProps => pick(actions, [\n 'setAuthCode',\n 'returnToAuthPhoneNumber',\n 'clearAuthError',\n ]),\n)(AuthCode));\n","import React, {\n FC, memo, useCallback, useState,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalState, GlobalActions } 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;\ntype DispatchProps = Pick;\n\nconst AuthPassword: FC = ({\n authIsLoading, authError, authHint, setAuthPassword, clearAuthError,\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 (setGlobal, actions): DispatchProps => pick(actions, ['setAuthPassword', 'clearAuthError']),\n)(AuthPassword));\n","import { ChangeEvent } from 'react';\nimport React, { FC, useState, memo } from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalState, GlobalActions } 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;\ntype DispatchProps = Pick;\n\nconst AuthRegister: FC = ({\n authIsLoading, authError, signUp, clearAuthError, uploadProfilePhoto,\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 (setGlobal, actions): DispatchProps => pick(actions, ['signUp', 'clearAuthError', 'uploadProfilePhoto']),\n)(AuthRegister));\n","import 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: any;\n onClose: () => void;\n onCloseAnimationEnd?: () => void;\n onEnter?: () => void;\n};\n\ntype StateProps = {\n shouldSkipHistoryAnimations?: boolean;\n};\n\nconst Modal: FC = ({\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\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 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: AnyLiteral;\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};\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 supposed for judges to measure \"Transferred Size\" in Dev Tools\nconst LOTTIE_LOAD_DELAY = 5000;\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 onLoad,\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\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 );\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 }, [animation, animationData, id, isLowPriority, noLoop, onLoad, quality, size, speed]);\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 useHeavyAnimationCheck(freezeAnimation, unfreezeAnimation);\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 { 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 { FC, useRef, useLayoutEffect } from '../../lib/teact/teact';\nimport TeactDOM from '../../lib/teact/teact-dom';\n\ntype OwnProps = {\n containerId?: string;\n className?: string;\n children: any;\n};\n\nconst Portal: FC = ({ containerId, className, children }) => {\n const elementRef = useRef(document.createElement('div'));\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, elementRef.current);\n};\n\nexport default Portal;\n","import { ApiMediaFormat } from '../../../api/types';\n\nimport * as mediaLoader from '../../../util/mediaLoader';\n\n// @ts-ignore\nimport MonkeyIdle from '../../../assets/TwoFactorSetupMonkeyIdle.tgs';\n// @ts-ignore\nimport MonkeyTracking from '../../../assets/TwoFactorSetupMonkeyTracking.tgs';\n// @ts-ignore\nimport MonkeyClose from '../../../assets/TwoFactorSetupMonkeyClose.tgs';\n// @ts-ignore\nimport MonkeyPeek from '../../../assets/TwoFactorSetupMonkeyPeek.tgs';\n// @ts-ignore\nimport FoldersAll from '../../../assets/FoldersAll.tgs';\n// @ts-ignore\nimport FoldersNew from '../../../assets/FoldersNew.tgs';\n// @ts-ignore\nimport DiscussionGroups from '../../../assets/DiscussionGroupsDucks.tgs';\n\nexport const ANIMATED_STICKERS_PATHS = {\n MonkeyIdle,\n MonkeyTracking,\n MonkeyClose,\n MonkeyPeek,\n FoldersAll,\n FoldersNew,\n DiscussionGroups,\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","export default __webpack_public_path__ + \"TwoFactorSetupMonkeyIdle.dea4a492c144df84ddab778dc8a3f0cd.tgs\";","export default __webpack_public_path__ + \"TwoFactorSetupMonkeyTracking.eb5a7a6f166fb7589c12e6248561fb58.tgs\";","export default __webpack_public_path__ + \"TwoFactorSetupMonkeyClose.604c4c833d322b7e6c3ea19bef058241.tgs\";","export default __webpack_public_path__ + \"TwoFactorSetupMonkeyPeek.1905436b042520363d7e59f5d7f903ab.tgs\";","export default __webpack_public_path__ + \"FoldersAll.3f9f9e243d19f0fbf9aaaff11cbd4572.tgs\";","export default __webpack_public_path__ + \"FoldersNew.9a40d71c0c8be70f5bd14ff2d7bc1593.tgs\";","export default __webpack_public_path__ + \"DiscussionGroupsDucks.9ea453d1be9d1b0ee77a992f8e587485.tgs\";","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: 0.8,\n format: 'jpeg',\n circle: false,\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 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 { 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"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/56e8755feac92cbac7ab.worker.js.map b/dist/56e8755feac92cbac7ab.worker.js.map deleted file mode 100644 index e63ee031..00000000 --- a/dist/56e8755feac92cbac7ab.worker.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/config.ts","webpack:///./src/util/createWorkerInterface.ts","webpack:///./src/lib/rlottie/rlottie.worker.ts"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","window","innerHeight","Math","round","Set","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","api","async","animationData","imgSize","isLowPriority","reduceFactor","onInit","json","JSON","stringify","stringOnWasmHeap","allocate","intArrayFromString","handle","framesCount","set","ceil","renderFrames","fromIndex","toIndex","onProgress","realIndex","bufferPointer","HEAPU8","subarray","Uint8ClampedArray","renderer","delete","onmessage","messageId","args","callback","callbackArgs","lastArg","length","ArrayBuffer","undefined","push","response","isCanceled"],"mappings":"aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QAKfF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAAoBkB,EAAI,SAAShB,GACX,oBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAeb,EAAS,aAAc,CAAEmB,OAAO,KAQvDrB,EAAoBsB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAUF,EAAQrB,EAAoBqB,IAC/B,EAAPE,EAAU,OAAOF,EACpB,GAAW,EAAPE,GAA8B,iBAAVF,GAAsBA,GAASA,EAAMG,WAAY,OAAOH,EAChF,IAAII,EAAKX,OAAOY,OAAO,MAGvB,GAFA1B,EAAoBkB,EAAEO,GACtBX,OAAOC,eAAeU,EAAI,UAAW,CAAET,YAAY,EAAMK,MAAOA,IACtD,EAAPE,GAA4B,iBAATF,EAAmB,IAAI,IAA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E,GAAI+C,EAAW,CACb,MAAME,EAAW,IAAIC,KACnB,MAAMC,EAAUD,EAAaA,EAAaE,OAAS,GAEnD3D,EAAa,CACXC,KAAM,iBACNqD,YACAG,gBACCC,aAAmBE,YAAc,CAACF,QAAWG,IAGlDxD,EAAcmC,IAAIc,EAAWE,GAE7BD,EAAKO,KAAKN,GAGZ,MAAOO,EAAUvD,SAAuBiB,EAAI5D,MAAS0F,IAAU,GAE3DD,GACFtD,EACE,CACEC,KAAM,iBACNqD,YACAS,YAEFvD,GAGJ,MAAOT,GAMHuD,GACFtD,EAAa,CACXC,KAAM,iBACNqD,YACAvD,MAAO,CAAEG,QAASH,EAAMG,WAK1BoD,GACFjD,EAAc+C,OAAOE,GAGvB,MAEF,IAAK,iBAAkB,CACrB,MAAME,EAAWnD,EAAclC,IAAIoC,EAAK+C,WACpCE,IACFA,EAASQ,YAAa,GAGxB","file":"56e8755feac92cbac7ab.worker.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n","export const PAGE_TITLE = 'Telegram';\nexport const INACTIVE_MARKER = ' [Inactive]';\n\nexport const APP_NAME = process.env.APP_NAME || 'Telegram WebZ';\nexport const APP_VERSION = process.env.APP_VERSION || 'dev';\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 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_CHAT_LIST_LIMIT = 30;\nexport const GLOBAL_STATE_CACHE_USER_LIST_LIMIT = 5000;\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-v5';\nexport const ASSET_CACHE_NAME = 'tt-assets';\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_SENSITIVE_AREA = 750;\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;\n\nexport const TOP_CHAT_MESSAGES_PRELOAD_LIMIT = 20;\nexport const ALL_CHATS_PRELOAD_DISABLED = false;\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\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;\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 = 80;\nexport const STICKER_SIZE_INLINE_BOT_RESULT = 100;\nexport const RECENT_STICKERS_LIMIT = 20;\nexport const MEMOJI_STICKER_ID = 'MEMOJI_STICKER';\n\nexport const BASE_EMOJI_KEYWORD_LANG = 'en';\n\nexport const MENU_TRANSITION_DURATION = 200;\nexport const SLIDE_TRANSITION_DURATION = 450;\n\nexport const CONTENT_TYPES_FOR_QUICK_UPLOAD = new Set([\n 'image/png', 'image/gif', 'image/jpeg', 'video/mp4', 'video/avi', 'video/quicktime',\n]);\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_TME_LINK = /^(?:https?:\\/\\/)?(?:t\\.me\\/)([\\d\\w_]+)(?:\\/([\\d]+))?(?:\\/([\\d]+))?$/gm;\nexport const RE_TME_INVITE_LINK = /^(?:https?:\\/\\/)?(?:t\\.me\\/joinchat\\/)([\\d\\w_-]+)?$/gm;\n\n// MTProto constants\nexport const SERVICE_NOTIFICATIONS_USER_ID = 777000;\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","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) {\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 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 renderers = new Map();\n\nasync function init(\n key: string,\n animationData: AnyLiteral,\n imgSize: number,\n isLowPriority: boolean,\n reduceFactor: number,\n onInit: CancellableCallback,\n) {\n if (!rLottieApi) {\n await rLottieApiPromise;\n }\n\n const json = JSON.stringify(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 renderers.set(key, { imgSize, reduceFactor, handle });\n\n onInit(Math.ceil(framesCount / reduceFactor));\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 renderFrames,\n destroy,\n});\n"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/6.f9e82031a240faaf8916.css b/dist/6.e8fcdb09b85352a9a211.css similarity index 98% rename from dist/6.f9e82031a240faaf8916.css rename to dist/6.e8fcdb09b85352a9a211.css index af6b9f13..31f6acf1 100644 --- a/dist/6.f9e82031a240faaf8916.css +++ b/dist/6.e8fcdb09b85352a9a211.css @@ -247,4 +247,4 @@ background: #ccc; } -/*# sourceMappingURL=6.f9e82031a240faaf8916.css.map*/ \ No newline at end of file +/*# sourceMappingURL=6.e8fcdb09b85352a9a211.css.map*/ \ No newline at end of file diff --git a/dist/6.f9e82031a240faaf8916.css.map b/dist/6.e8fcdb09b85352a9a211.css.map similarity index 99% rename from dist/6.f9e82031a240faaf8916.css.map rename to dist/6.e8fcdb09b85352a9a211.css.map index 2ef9fcf6..42cf61f8 100644 --- a/dist/6.f9e82031a240faaf8916.css.map +++ b/dist/6.e8fcdb09b85352a9a211.css.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///./node_modules/croppie/croppie.css"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,2BAA2B;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"6.f9e82031a240faaf8916.css","sourcesContent":[".croppie-container {\r\n width: 100%;\r\n height: 100%;\r\n}\r\n\r\n.croppie-container .cr-image {\r\n z-index: -1;\r\n position: absolute;\r\n top: 0;\r\n left: 0;\r\n transform-origin: 0 0;\r\n max-height: none;\r\n max-width: none;\r\n}\r\n\r\n.croppie-container .cr-boundary {\r\n position: relative;\r\n overflow: hidden;\r\n margin: 0 auto;\r\n z-index: 1;\r\n width: 100%;\r\n height: 100%;\r\n}\r\n\r\n.croppie-container .cr-viewport,\r\n.croppie-container .cr-resizer {\r\n position: absolute;\r\n border: 2px solid #fff;\r\n margin: auto;\r\n top: 0;\r\n bottom: 0;\r\n right: 0;\r\n left: 0;\r\n box-shadow: 0 0 2000px 2000px rgba(0, 0, 0, 0.5);\r\n z-index: 0;\r\n}\r\n\r\n.croppie-container .cr-resizer {\r\n z-index: 2;\r\n box-shadow: none;\r\n pointer-events: none;\r\n}\r\n\r\n.croppie-container .cr-resizer-vertical,\r\n.croppie-container .cr-resizer-horisontal {\r\n position: absolute;\r\n pointer-events: all;\r\n}\r\n\r\n.croppie-container .cr-resizer-vertical::after,\r\n.croppie-container .cr-resizer-horisontal::after {\r\n display: block;\r\n position: absolute;\r\n box-sizing: border-box;\r\n border: 1px solid black;\r\n background: #fff;\r\n width: 10px;\r\n height: 10px;\r\n content: '';\r\n}\r\n\r\n.croppie-container .cr-resizer-vertical {\r\n bottom: -5px;\r\n cursor: row-resize;\r\n width: 100%;\r\n height: 10px;\r\n}\r\n\r\n.croppie-container .cr-resizer-vertical::after {\r\n left: 50%;\r\n margin-left: -5px;\r\n}\r\n\r\n.croppie-container .cr-resizer-horisontal {\r\n right: -5px;\r\n cursor: col-resize;\r\n width: 10px;\r\n height: 100%;\r\n}\r\n\r\n.croppie-container .cr-resizer-horisontal::after {\r\n top: 50%;\r\n margin-top: -5px;\r\n}\r\n\r\n.croppie-container .cr-original-image {\r\n display: none;\r\n}\r\n\r\n.croppie-container .cr-vp-circle {\r\n border-radius: 50%;\r\n}\r\n\r\n.croppie-container .cr-overlay {\r\n z-index: 1;\r\n position: absolute;\r\n cursor: move;\r\n touch-action: none;\r\n}\r\n\r\n.croppie-container .cr-slider-wrap {\r\n width: 75%;\r\n margin: 15px auto;\r\n text-align: center;\r\n}\r\n\r\n.croppie-result {\r\n position: relative;\r\n overflow: hidden;\r\n}\r\n\r\n.croppie-result img {\r\n position: absolute;\r\n}\r\n\r\n.croppie-container .cr-image,\r\n.croppie-container .cr-overlay,\r\n.croppie-container .cr-viewport {\r\n transform: translateZ(0);\r\n}\r\n\r\n/*************************************/\r\n/***** STYLING RANGE INPUT ***********/\r\n/*************************************/\r\n/*http://brennaobrien.com/blog/2014/05/style-input-type-range-in-every-browser.html */\r\n/*************************************/\r\n\r\n.cr-slider {\r\n -webkit-appearance: none;\r\n/*removes default webkit styles*/\r\n\t/*border: 1px solid white; *//*fix for FF unable to apply focus style bug */\r\n width: 300px;\r\n/*required for proper track sizing in FF*/\r\n max-width: 100%;\r\n padding-top: 8px;\r\n padding-bottom: 8px;\r\n background-color: transparent;\r\n}\r\n\r\n.cr-slider::-webkit-slider-runnable-track {\r\n width: 100%;\r\n height: 3px;\r\n background: rgba(0, 0, 0, 0.5);\r\n border: 0;\r\n border-radius: 3px;\r\n}\r\n\r\n.cr-slider::-webkit-slider-thumb {\r\n -webkit-appearance: none;\r\n border: none;\r\n height: 16px;\r\n width: 16px;\r\n border-radius: 50%;\r\n background: #ddd;\r\n margin-top: -6px;\r\n}\r\n\r\n.cr-slider:focus {\r\n outline: none;\r\n}\r\n/*\r\n.cr-slider:focus::-webkit-slider-runnable-track {\r\nbackground: #ccc;\r\n}\r\n*/\r\n\r\n.cr-slider::-moz-range-track {\r\n width: 100%;\r\n height: 3px;\r\n background: rgba(0, 0, 0, 0.5);\r\n border: 0;\r\n border-radius: 3px;\r\n}\r\n\r\n.cr-slider::-moz-range-thumb {\r\n border: none;\r\n height: 16px;\r\n width: 16px;\r\n border-radius: 50%;\r\n background: #ddd;\r\n margin-top: -6px;\r\n}\r\n\r\n/*hide the outline behind the border*/\r\n.cr-slider:-moz-focusring {\r\n outline: 1px solid white;\r\n outline-offset: -1px;\r\n}\r\n\r\n.cr-slider::-ms-track {\r\n width: 100%;\r\n height: 5px;\r\n background: transparent;\r\n/*remove bg colour from the track, we'll use ms-fill-lower and ms-fill-upper instead */\r\n\tborder-color: transparent;/*leave room for the larger thumb to overflow with a transparent border */\r\n\tborder-width: 6px 0;\r\n\tcolor: transparent;/*remove default tick marks*/\r\n}\r\n.cr-slider::-ms-fill-lower {\r\n\tbackground: rgba(0, 0, 0, 0.5);\r\n\tborder-radius: 10px;\r\n}\r\n.cr-slider::-ms-fill-upper {\r\n\tbackground: rgba(0, 0, 0, 0.5);\r\n\tborder-radius: 10px;\r\n}\r\n.cr-slider::-ms-thumb {\r\n\tborder: none;\r\n\theight: 16px;\r\n\twidth: 16px;\r\n\tborder-radius: 50%;\r\n\tbackground: #ddd;\r\n\tmargin-top:1px;\r\n}\r\n.cr-slider:focus::-ms-fill-lower {\r\n\tbackground: rgba(0, 0, 0, 0.5);\r\n}\r\n.cr-slider:focus::-ms-fill-upper {\r\n\tbackground: rgba(0, 0, 0, 0.5);\r\n}\r\n/*******************************************/\r\n\r\n/***********************************/\r\n/* Rotation Tools */\r\n/***********************************/\r\n.cr-rotate-controls {\r\n\tposition: absolute;\r\n\tbottom: 5px;\r\n\tleft: 5px;\r\n\tz-index: 1;\r\n}\r\n.cr-rotate-controls button {\r\n\tborder: 0;\r\n\tbackground: none;\r\n}\r\n.cr-rotate-controls i:before {\r\n\tdisplay: inline-block;\r\n\tfont-style: normal;\r\n\tfont-weight: 900;\r\n\tfont-size: 22px;\r\n}\r\n.cr-rotate-l i:before {\r\n\tcontent: '↺';\r\n}\r\n.cr-rotate-r i:before {\r\n\tcontent: '↻';\r\n}\r\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///./node_modules/croppie/croppie.css"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,2BAA2B;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"6.e8fcdb09b85352a9a211.css","sourcesContent":[".croppie-container {\r\n width: 100%;\r\n height: 100%;\r\n}\r\n\r\n.croppie-container .cr-image {\r\n z-index: -1;\r\n position: absolute;\r\n top: 0;\r\n left: 0;\r\n transform-origin: 0 0;\r\n max-height: none;\r\n max-width: none;\r\n}\r\n\r\n.croppie-container .cr-boundary {\r\n position: relative;\r\n overflow: hidden;\r\n margin: 0 auto;\r\n z-index: 1;\r\n width: 100%;\r\n height: 100%;\r\n}\r\n\r\n.croppie-container .cr-viewport,\r\n.croppie-container .cr-resizer {\r\n position: absolute;\r\n border: 2px solid #fff;\r\n margin: auto;\r\n top: 0;\r\n bottom: 0;\r\n right: 0;\r\n left: 0;\r\n box-shadow: 0 0 2000px 2000px rgba(0, 0, 0, 0.5);\r\n z-index: 0;\r\n}\r\n\r\n.croppie-container .cr-resizer {\r\n z-index: 2;\r\n box-shadow: none;\r\n pointer-events: none;\r\n}\r\n\r\n.croppie-container .cr-resizer-vertical,\r\n.croppie-container .cr-resizer-horisontal {\r\n position: absolute;\r\n pointer-events: all;\r\n}\r\n\r\n.croppie-container .cr-resizer-vertical::after,\r\n.croppie-container .cr-resizer-horisontal::after {\r\n display: block;\r\n position: absolute;\r\n box-sizing: border-box;\r\n border: 1px solid black;\r\n background: #fff;\r\n width: 10px;\r\n height: 10px;\r\n content: '';\r\n}\r\n\r\n.croppie-container .cr-resizer-vertical {\r\n bottom: -5px;\r\n cursor: row-resize;\r\n width: 100%;\r\n height: 10px;\r\n}\r\n\r\n.croppie-container .cr-resizer-vertical::after {\r\n left: 50%;\r\n margin-left: -5px;\r\n}\r\n\r\n.croppie-container .cr-resizer-horisontal {\r\n right: -5px;\r\n cursor: col-resize;\r\n width: 10px;\r\n height: 100%;\r\n}\r\n\r\n.croppie-container .cr-resizer-horisontal::after {\r\n top: 50%;\r\n margin-top: -5px;\r\n}\r\n\r\n.croppie-container .cr-original-image {\r\n display: none;\r\n}\r\n\r\n.croppie-container .cr-vp-circle {\r\n border-radius: 50%;\r\n}\r\n\r\n.croppie-container .cr-overlay {\r\n z-index: 1;\r\n position: absolute;\r\n cursor: move;\r\n touch-action: none;\r\n}\r\n\r\n.croppie-container .cr-slider-wrap {\r\n width: 75%;\r\n margin: 15px auto;\r\n text-align: center;\r\n}\r\n\r\n.croppie-result {\r\n position: relative;\r\n overflow: hidden;\r\n}\r\n\r\n.croppie-result img {\r\n position: absolute;\r\n}\r\n\r\n.croppie-container .cr-image,\r\n.croppie-container .cr-overlay,\r\n.croppie-container .cr-viewport {\r\n transform: translateZ(0);\r\n}\r\n\r\n/*************************************/\r\n/***** STYLING RANGE INPUT ***********/\r\n/*************************************/\r\n/*http://brennaobrien.com/blog/2014/05/style-input-type-range-in-every-browser.html */\r\n/*************************************/\r\n\r\n.cr-slider {\r\n -webkit-appearance: none;\r\n/*removes default webkit styles*/\r\n\t/*border: 1px solid white; *//*fix for FF unable to apply focus style bug */\r\n width: 300px;\r\n/*required for proper track sizing in FF*/\r\n max-width: 100%;\r\n padding-top: 8px;\r\n padding-bottom: 8px;\r\n background-color: transparent;\r\n}\r\n\r\n.cr-slider::-webkit-slider-runnable-track {\r\n width: 100%;\r\n height: 3px;\r\n background: rgba(0, 0, 0, 0.5);\r\n border: 0;\r\n border-radius: 3px;\r\n}\r\n\r\n.cr-slider::-webkit-slider-thumb {\r\n -webkit-appearance: none;\r\n border: none;\r\n height: 16px;\r\n width: 16px;\r\n border-radius: 50%;\r\n background: #ddd;\r\n margin-top: -6px;\r\n}\r\n\r\n.cr-slider:focus {\r\n outline: none;\r\n}\r\n/*\r\n.cr-slider:focus::-webkit-slider-runnable-track {\r\nbackground: #ccc;\r\n}\r\n*/\r\n\r\n.cr-slider::-moz-range-track {\r\n width: 100%;\r\n height: 3px;\r\n background: rgba(0, 0, 0, 0.5);\r\n border: 0;\r\n border-radius: 3px;\r\n}\r\n\r\n.cr-slider::-moz-range-thumb {\r\n border: none;\r\n height: 16px;\r\n width: 16px;\r\n border-radius: 50%;\r\n background: #ddd;\r\n margin-top: -6px;\r\n}\r\n\r\n/*hide the outline behind the border*/\r\n.cr-slider:-moz-focusring {\r\n outline: 1px solid white;\r\n outline-offset: -1px;\r\n}\r\n\r\n.cr-slider::-ms-track {\r\n width: 100%;\r\n height: 5px;\r\n background: transparent;\r\n/*remove bg colour from the track, we'll use ms-fill-lower and ms-fill-upper instead */\r\n\tborder-color: transparent;/*leave room for the larger thumb to overflow with a transparent border */\r\n\tborder-width: 6px 0;\r\n\tcolor: transparent;/*remove default tick marks*/\r\n}\r\n.cr-slider::-ms-fill-lower {\r\n\tbackground: rgba(0, 0, 0, 0.5);\r\n\tborder-radius: 10px;\r\n}\r\n.cr-slider::-ms-fill-upper {\r\n\tbackground: rgba(0, 0, 0, 0.5);\r\n\tborder-radius: 10px;\r\n}\r\n.cr-slider::-ms-thumb {\r\n\tborder: none;\r\n\theight: 16px;\r\n\twidth: 16px;\r\n\tborder-radius: 50%;\r\n\tbackground: #ddd;\r\n\tmargin-top:1px;\r\n}\r\n.cr-slider:focus::-ms-fill-lower {\r\n\tbackground: rgba(0, 0, 0, 0.5);\r\n}\r\n.cr-slider:focus::-ms-fill-upper {\r\n\tbackground: rgba(0, 0, 0, 0.5);\r\n}\r\n/*******************************************/\r\n\r\n/***********************************/\r\n/* Rotation Tools */\r\n/***********************************/\r\n.cr-rotate-controls {\r\n\tposition: absolute;\r\n\tbottom: 5px;\r\n\tleft: 5px;\r\n\tz-index: 1;\r\n}\r\n.cr-rotate-controls button {\r\n\tborder: 0;\r\n\tbackground: none;\r\n}\r\n.cr-rotate-controls i:before {\r\n\tdisplay: inline-block;\r\n\tfont-style: normal;\r\n\tfont-weight: 900;\r\n\tfont-size: 22px;\r\n}\r\n.cr-rotate-l i:before {\r\n\tcontent: '↺';\r\n}\r\n.cr-rotate-r i:before {\r\n\tcontent: '↻';\r\n}\r\n"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/6.f9e82031a240faaf8916.js b/dist/6.e8fcdb09b85352a9a211.js similarity index 98% rename from dist/6.f9e82031a240faaf8916.js rename to dist/6.e8fcdb09b85352a9a211.js index 6be64b29..0386e94e 100644 --- a/dist/6.f9e82031a240faaf8916.js +++ b/dist/6.e8fcdb09b85352a9a211.js @@ -1,2 +1,2 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[6],{197:function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},326:function(e,t,n){(function(i){var o,r;"undefined"!=typeof self&&self,void 0===(r="function"==typeof(o=function(){"function"!=typeof Promise&&function(t){function n(e,t){return function(){e.apply(t,arguments)}}function o(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],h(e,n(a,this),n(s,this))}function r(e){var t=this;return null===this._state?void this._deferreds.push(e):void p((function(){var n=t._state?e.onFulfilled:e.onRejected;if(null!==n){var i;try{i=n(t._value)}catch(t){return void e.reject(t)}e.resolve(i)}else(t._state?e.resolve:e.reject)(t._value)}))}function a(e){try{if(e===this)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var t=e.then;if("function"==typeof t)return void h(n(t,e),n(a,this),n(s,this))}this._state=!0,this._value=e,l.call(this)}catch(e){s.call(this,e)}}function s(e){this._state=!1,this._value=e,l.call(this)}function l(){for(var e=0,t=this._deferreds.length;t>e;e++)r.call(this,this._deferreds[e]);this._deferreds=null}function c(e,t,n,i){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=n,this.reject=i}function h(e,t,n){var i=!1;try{e((function(e){i||(i=!0,t(e))}),(function(e){i||(i=!0,n(e))}))}catch(e){if(i)return;i=!0,n(e)}}var u=setTimeout,p="function"==typeof i&&i||function(e){u(e,1)},d=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};o.prototype.catch=function(e){return this.then(null,e)},o.prototype.then=function(e,t){var n=this;return new o((function(i,o){r.call(n,new c(e,t,i,o))}))},o.all=function(){var e=Array.prototype.slice.call(1===arguments.length&&d(arguments[0])?arguments[0]:arguments);return new o((function(t,n){function i(r,a){try{if(a&&("object"==typeof a||"function"==typeof a)){var s=a.then;if("function"==typeof s)return void s.call(a,(function(e){i(r,e)}),n)}e[r]=a,0==--o&&t(e)}catch(e){n(e)}}if(0===e.length)return t([]);for(var o=e.length,r=0;ri;i++)e[i].then(t,n)}))},o._setImmediateFn=function(e){p=e},e.exports?e.exports=o:t.Promise||(t.Promise=o)}(this),"function"!=typeof window.CustomEvent&&function(){function e(e,t){t=t||{bubbles:!1,cancelable:!1,detail:void 0};var n=document.createEvent("CustomEvent");return n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),n}e.prototype=window.Event.prototype,window.CustomEvent=e}(),HTMLCanvasElement.prototype.toBlob||Object.defineProperty(HTMLCanvasElement.prototype,"toBlob",{value:function(e,t,n){for(var i=atob(this.toDataURL(t,n).split(",")[1]),o=i.length,r=new Uint8Array(o),a=0;a=5){var r=n;n=i,i=r}return{width:n,height:i}}n=c("transform"),t=c("transformOrigin"),o=c("userSelect");var w={translate3d:{suffix:", 0px"},translate:{suffix:""}},y=function(e,t,n){this.x=parseFloat(e),this.y=parseFloat(t),this.scale=parseFloat(n)};y.parse=function(e){return e.style?y.parse(e.style[n]):e.indexOf("matrix")>-1||e.indexOf("none")>-1?y.fromMatrix(e):y.fromString(e)},y.fromMatrix=function(e){var t=e.substring(7).split(",");return t.length&&"none"!==e||(t=[1,0,0,1,0,0]),new y(v(t[4]),v(t[5]),parseFloat(t[0]))},y.fromString=function(e){var t=e.split(") "),n=t[0].substring(ae.globals.translate.length+1).split(","),i=t.length>1?t[1].substring(6):1,o=n.length>1?n[0]:0,r=n.length>1?n[1]:0;return new y(o,r,i)},y.prototype.toString=function(){var e=w[ae.globals.translate].suffix||"";return ae.globals.translate+"("+this.x+"px, "+this.y+"px"+e+") scale("+this.scale+")"};var b=function(e){if(!e||!e.style[t])return this.x=0,void(this.y=0);var n=e.style[t].split(" ");this.x=parseFloat(n[0]),this.y=parseFloat(n[1])};function x(e){return e.exifdata&&e.exifdata.Orientation?v(e.exifdata.Orientation):1}function C(e,t,n){var i=t.width,o=t.height,r=e.getContext("2d");switch(e.width=t.width,e.height=t.height,r.save(),n){case 2:r.translate(i,0),r.scale(-1,1);break;case 3:r.translate(i,o),r.rotate(180*Math.PI/180);break;case 4:r.translate(0,o),r.scale(1,-1);break;case 5:e.width=o,e.height=i,r.rotate(90*Math.PI/180),r.scale(1,-1);break;case 6:e.width=o,e.height=i,r.rotate(90*Math.PI/180),r.translate(0,-o);break;case 7:e.width=o,e.height=i,r.rotate(-90*Math.PI/180),r.translate(-i,o),r.scale(1,-1);break;case 8:e.width=o,e.height=i,r.translate(0,i),r.rotate(-90*Math.PI/180)}r.drawImage(t,0,0,i,o),r.restore()}function E(){var e,t,n,i,o,r,a=this.options.viewport.type?"cr-vp-"+this.options.viewport.type:null;this.options.useCanvas=this.options.enableOrientation||_.call(this),this.data={},this.elements={},e=this.elements.boundary=document.createElement("div"),n=this.elements.viewport=document.createElement("div"),t=this.elements.img=document.createElement("img"),i=this.elements.overlay=document.createElement("div"),this.options.useCanvas?(this.elements.canvas=document.createElement("canvas"),this.elements.preview=this.elements.canvas):this.elements.preview=t,m(e,"cr-boundary"),e.setAttribute("aria-dropeffect","none"),o=this.options.boundary.width,r=this.options.boundary.height,d(e,{width:o+(isNaN(o)?"":"px"),height:r+(isNaN(r)?"":"px")}),m(n,"cr-viewport"),a&&m(n,a),d(n,{width:this.options.viewport.width+"px",height:this.options.viewport.height+"px"}),n.setAttribute("tabindex",0),m(this.elements.preview,"cr-image"),f(this.elements.preview,{alt:"preview","aria-grabbed":"false"}),m(i,"cr-overlay"),this.element.appendChild(e),e.appendChild(this.elements.preview),e.appendChild(n),e.appendChild(i),m(this.element,"croppie-container"),this.options.customClass&&m(this.element,this.options.customClass),B.call(this),this.options.enableZoom&&I.call(this),this.options.enableResize&&T.call(this)}function _(){return this.options.enableExif&&window.EXIF}function T(){var e,t,n,i,r,a,s,l=this,c=document.createElement("div"),h=!1;function u(a){if((void 0===a.button||0===a.button)&&(a.preventDefault(),!h)){var s=l.elements.overlay.getBoundingClientRect();if(h=!0,t=a.pageX,n=a.pageY,e=-1!==a.currentTarget.className.indexOf("vertical")?"v":"h",i=s.width,r=s.height,a.touches){var c=a.touches[0];t=c.pageX,n=c.pageY}window.addEventListener("mousemove",p),window.addEventListener("touchmove",p),window.addEventListener("mouseup",f),window.addEventListener("touchend",f),document.body.style[o]="none"}}function p(o){var a=o.pageX,s=o.pageY;if(o.preventDefault(),o.touches){var h=o.touches[0];a=h.pageX,s=h.pageY}var u=a-t,p=s-n,m=l.options.viewport.height+p,f=l.options.viewport.width+u;"v"===e&&m>=50&&m<=r?(d(c,{height:m+"px"}),l.options.boundary.height+=p,d(l.elements.boundary,{height:l.options.boundary.height+"px"}),l.options.viewport.height+=p,d(l.elements.viewport,{height:l.options.viewport.height+"px"})):"h"===e&&f>=50&&f<=i&&(d(c,{width:f+"px"}),l.options.boundary.width+=u,d(l.elements.boundary,{width:l.options.boundary.width+"px"}),l.options.viewport.width+=u,d(l.elements.viewport,{width:l.options.viewport.width+"px"})),Z.call(l),S.call(l),k.call(l),Y.call(l),n=s,t=a}function f(){h=!1,window.removeEventListener("mousemove",p),window.removeEventListener("touchmove",p),window.removeEventListener("mouseup",f),window.removeEventListener("touchend",f),document.body.style[o]=""}m(c,"cr-resizer"),d(c,{width:this.options.viewport.width+"px",height:this.options.viewport.height+"px"}),this.options.resizeControls.height&&(m(a=document.createElement("div"),"cr-resizer-vertical"),c.appendChild(a)),this.options.resizeControls.width&&(m(s=document.createElement("div"),"cr-resizer-horisontal"),c.appendChild(s)),a&&(a.addEventListener("mousedown",u),a.addEventListener("touchstart",u)),s&&(s.addEventListener("mousedown",u),s.addEventListener("touchstart",u)),this.elements.boundary.appendChild(c)}function L(e){if(this.options.enableZoom){var t=this.elements.zoomer,n=Q(e,4);t.value=Math.max(parseFloat(t.min),Math.min(parseFloat(t.max),n)).toString()}}function I(){var e=this,t=e.elements.zoomerWrap=document.createElement("div"),n=e.elements.zoomer=document.createElement("input");function i(){M.call(e,{value:parseFloat(n.value),origin:new b(e.elements.preview),viewportRect:e.elements.viewport.getBoundingClientRect(),transform:y.parse(e.elements.preview)})}function o(t){var n,o;if("ctrl"===e.options.mouseWheelZoom&&!0!==t.ctrlKey)return 0;n=t.wheelDelta?t.wheelDelta/1200:t.deltaY?t.deltaY/1060:t.detail?t.detail/-60:0,o=e._currentZoom+n*e._currentZoom,t.preventDefault(),L.call(e,o),i.call(e)}m(t,"cr-slider-wrap"),m(n,"cr-slider"),n.type="range",n.step="0.0001",n.value="1",n.style.display=e.options.showZoomer?"":"none",n.setAttribute("aria-label","zoom"),e.element.appendChild(t),t.appendChild(n),e._currentZoom=1,e.elements.zoomer.addEventListener("input",i),e.elements.zoomer.addEventListener("change",i),e.options.mouseWheelZoom&&(e.elements.boundary.addEventListener("mousewheel",o),e.elements.boundary.addEventListener("DOMMouseScroll",o))}function M(e){var i=this,o=e?e.transform:y.parse(i.elements.preview),r=e?e.viewportRect:i.elements.viewport.getBoundingClientRect(),a=e?e.origin:new b(i.elements.preview);function s(){var e={};e[n]=o.toString(),e[t]=a.toString(),d(i.elements.preview,e)}if(i._currentZoom=e?e.value:i._currentZoom,o.scale=i._currentZoom,i.elements.zoomer.setAttribute("aria-valuenow",i._currentZoom),s(),i.options.enforceBoundary){var l=R.call(i,r),c=l.translate,h=l.origin;o.x>=c.maxX&&(a.x=h.minX,o.x=c.maxX),o.x<=c.minX&&(a.x=h.maxX,o.x=c.minX),o.y>=c.maxY&&(a.y=h.minY,o.y=c.maxY),o.y<=c.minY&&(a.y=h.maxY,o.y=c.minY)}s(),X.call(i),Y.call(i)}function R(e){var t=this._currentZoom,n=e.width,i=e.height,o=this.elements.boundary.clientWidth/2,r=this.elements.boundary.clientHeight/2,a=this.elements.preview.getBoundingClientRect(),s=a.width,l=a.height,c=n/2,h=i/2,u=-1*(c/t-o),p=-1*(h/t-r),d=1/t*c,m=1/t*h;return{translate:{maxX:u,minX:u-(s*(1/t)-n*(1/t)),maxY:p,minY:p-(l*(1/t)-i*(1/t))},origin:{maxX:s*(1/t)-d,minX:d,maxY:l*(1/t)-m,minY:m}}}function k(e){var i=this._currentZoom,o=this.elements.preview.getBoundingClientRect(),r=this.elements.viewport.getBoundingClientRect(),a=y.parse(this.elements.preview.style[n]),s=new b(this.elements.preview),l=r.top-o.top+r.height/2,c=r.left-o.left+r.width/2,h={},u={};if(e){var p=s.x,m=s.y,f=a.x,v=a.y;h.y=p,h.x=m,a.y=f,a.x=v}else h.y=l/i,h.x=c/i,u.y=(h.y-s.y)*(1-i),u.x=(h.x-s.x)*(1-i),a.x-=u.x,a.y-=u.y;var g={};g[t]=h.x+"px "+h.y+"px",g[n]=a.toString(),d(this.elements.preview,g)}function B(){var e,t,i,r,a,s=this,l=!1;function c(e,t){var n=s.elements.preview.getBoundingClientRect(),i=a.y+t,o=a.x+e;s.options.enforceBoundary?(r.top>n.top+t&&r.bottomn.left+e&&r.right1){var v=o.touches[0],g=o.touches[1],w=Math.sqrt((v.pageX-g.pageX)*(v.pageX-g.pageX)+(v.pageY-g.pageY)*(v.pageY-g.pageY));i||(i=w/s._currentZoom);var y=w/i;return L.call(s,y),void p(s.elements.zoomer)}c(u,m),f[n]=a.toString(),d(s.elements.preview,f),Z.call(s),t=l,e=r}function f(){h(l=!1),window.removeEventListener("mousemove",m),window.removeEventListener("touchmove",m),window.removeEventListener("mouseup",f),window.removeEventListener("touchend",f),document.body.style[o]="",k.call(s),Y.call(s),i=0}s.elements.overlay.addEventListener("mousedown",u),s.elements.viewport.addEventListener("keydown",(function(e){var t;if(!e.shiftKey||38!==e.keyCode&&40!==e.keyCode){if(s.options.enableKeyMovement&&e.keyCode>=37&&e.keyCode<=40){e.preventDefault();var l=function(e){switch(e){case 37:return[1,0];case 38:return[0,1];case 39:return[-1,0];case 40:return[0,-1]}}(e.keyCode);a=y.parse(s.elements.preview),document.body.style[o]="none",r=s.elements.viewport.getBoundingClientRect(),function(e){var t=e[0],r=e[1],l={};c(t,r),l[n]=a.toString(),d(s.elements.preview,l),Z.call(s),document.body.style[o]="",k.call(s),Y.call(s),i=0}(l)}}else t=38===e.keyCode?parseFloat(s.elements.zoomer.value)+parseFloat(s.elements.zoomer.step):parseFloat(s.elements.zoomer.value)-parseFloat(s.elements.zoomer.step),s.setZoom(t)})),s.elements.overlay.addEventListener("touchstart",u)}function Z(){if(this.elements){var e=this.elements.boundary.getBoundingClientRect(),t=this.elements.preview.getBoundingClientRect();d(this.elements.overlay,{width:t.width+"px",height:t.height+"px",top:t.top-e.top+"px",left:t.left-e.left+"px"})}}b.prototype.toString=function(){return this.x+"px "+this.y+"px"};var F,z,O,A,X=(F=Z,z=500,function(){var e=this,t=arguments,n=function(){A=null,O||F.apply(e,t)},i=O&&!A;clearTimeout(A),A=setTimeout(n,z),i&&F.apply(e,t)});function Y(){var e,t=this.get();j.call(this)&&(this.options.update.call(this,t),this.$&&"undefined"==typeof Prototype?this.$(this.element).trigger("update.croppie",t):(window.CustomEvent?e=new CustomEvent("update",{detail:t}):(e=document.createEvent("CustomEvent")).initCustomEvent("update",!0,!0,t),this.element.dispatchEvent(e)))}function j(){return this.elements.preview.offsetHeight>0&&this.elements.preview.offsetWidth>0}function W(){var e,i={},o=this.elements.preview,r=new y(0,0,1),a=new b;j.call(this)&&!this.data.bound&&(this.data.bound=!0,i[n]=r.toString(),i[t]=a.toString(),i.opacity=1,d(o,i),e=this.elements.preview.getBoundingClientRect(),this._originalImageWidth=e.width,this._originalImageHeight=e.height,this.data.orientation=x(this.elements.img),this.options.enableZoom?S.call(this,!0):this._currentZoom=1,r.scale=this._currentZoom,i[n]=r.toString(),d(o,i),this.data.points.length?H.call(this,this.data.points):N.call(this),k.call(this),Z.call(this))}function S(e){var t,n,i,o,r=Math.max(this.options.minZoom,0)||0,a=this.options.maxZoom||1.5,s=this.elements.zoomer,l=parseFloat(s.value),c=this.elements.boundary.getBoundingClientRect(),h=g(this.elements.img,this.data.orientation),u=this.elements.viewport.getBoundingClientRect();this.options.enforceBoundary&&(i=u.width/h.width,o=u.height/h.height,r=Math.max(i,o)),r>=a&&(a=r+1),s.min=Q(r,4),s.max=Q(a,4),!e&&(ls.max)?L.call(this,lthis._originalImageWidth&&(w=(d=this._originalImageWidth-u)/o*c),i<0&&(p=0,g=Math.abs(i)/r*h),m+p>this._originalImageHeight&&(y=(m=this._originalImageHeight-p)/r*h),l.drawImage(this.elements.preview,u,p,d,m,f,g,w,y),a&&(l.fillStyle="#fff",l.globalCompositeOperation="destination-in",l.beginPath(),l.arc(s.width/2,s.height/2,s.width/2,0,2*Math.PI,!0),l.closePath(),l.fill()),s}function q(e){var t=e.points,n=document.createElement("div"),i=document.createElement("img"),o=t[2]-t[0],r=t[3]-t[1];return m(n,"croppie-result"),n.appendChild(i),d(i,{left:-1*t[0]+"px",top:-1*t[1]+"px"}),i.src=e.url,d(n,{width:o+"px",height:r+"px"}),n}function $(e){return D.call(this,e).toDataURL(e.format,e.quality)}function K(e){var t=this;return new Promise((function(n){D.call(t,e).toBlob((function(e){n(e)}),e.format,e.quality)}))}function U(e){this.elements.img.parentNode&&(Array.prototype.forEach.call(this.elements.img.classList,(function(t){e.classList.add(t)})),this.elements.img.parentNode.replaceChild(e,this.elements.img),this.elements.preview=e),this.elements.img=e}function J(e,t){var n,i,o,r,a=this,s=[],l=null,c=_.call(a);if("string"==typeof e)n=e,e={};else if(Array.isArray(e))s=e.slice();else{if(void 0===e&&a.data.url)return W.call(a),Y.call(a),null;n=e.url,s=e.points||[],l=void 0===e.zoom?null:e.zoom}return a.data.bound=!1,a.data.url=n||a.data.url,a.data.boundZoom=l,(i=n,o=c,r=new Image,r.style.opacity="0",new Promise((function(e,t){function n(){r.style.opacity="1",setTimeout((function(){e(r)}),1)}r.removeAttribute("crossOrigin"),i.match(/^https?:\/\/|^\/\//)&&r.setAttribute("crossOrigin","anonymous"),r.onload=function(){o?EXIF.getData(r,(function(){n()})):n()},r.onerror=function(e){r.style.opacity=1,setTimeout((function(){t(e)}),1)},r.src=i}))).then((function(n){if(U.call(a,n),s.length)a.options.relative&&(s=[s[0]*n.naturalWidth/100,s[1]*n.naturalHeight/100,s[2]*n.naturalWidth/100,s[3]*n.naturalHeight/100]);else{var i,o,r=g(n),l=a.elements.viewport.getBoundingClientRect(),c=l.width/l.height;r.width/r.height>c?i=(o=r.height)*c:(i=r.width,o=r.height/c);var h=(r.width-i)/2,u=(r.height-o)/2,p=h+i,d=u+o;a.data.points=[h,u,p,d]}a.data.points=s.map((function(e){return parseFloat(e)})),a.options.useCanvas&&P.call(a,e.orientation),W.call(a),Y.call(a),t&&t()}))}function Q(e,t){return parseFloat(e).toFixed(t||0)}function G(){var e=this.elements.preview.getBoundingClientRect(),t=this.elements.viewport.getBoundingClientRect(),n=t.left-e.left,i=t.top-e.top,o=(t.width-this.elements.viewport.offsetWidth)/2,r=(t.height-this.elements.viewport.offsetHeight)/2,a=n+this.elements.viewport.offsetWidth+o,s=i+this.elements.viewport.offsetHeight+r,l=this._currentZoom;(l===1/0||isNaN(l))&&(l=1);var c=this.options.enforceBoundary?0:Number.NEGATIVE_INFINITY;return n=Math.max(c,n/l),i=Math.max(c,i/l),a=Math.max(c,a/l),s=Math.max(c,s/l),{points:[Q(n),Q(i),Q(a),Q(s)],zoom:l,orientation:this.data.orientation}}var V={type:"canvas",format:"png",quality:1},ee=["jpeg","webp","png"];function te(e){var t=this,n=G.call(t),i=h(u(V),u(e)),o="string"==typeof e?e:i.type||"base64",r=i.size||"viewport",a=i.format,s=i.quality,l=i.backgroundColor,c="boolean"==typeof i.circle?i.circle:"circle"===t.options.viewport.type,p=t.elements.viewport.getBoundingClientRect(),d=p.width/p.height;return"viewport"===r?(n.outputWidth=p.width,n.outputHeight=p.height):"object"==typeof r&&(r.width&&r.height?(n.outputWidth=r.width,n.outputHeight=r.height):r.width?(n.outputWidth=r.width,n.outputHeight=r.width/d):r.height&&(n.outputWidth=r.height*d,n.outputHeight=r.height)),ee.indexOf(a)>-1&&(n.format="image/"+a,n.quality=s),n.circle=c,n.url=t.data.url,n.backgroundColor=l,new Promise((function(e){switch(o.toLowerCase()){case"rawcanvas":e(D.call(t,n));break;case"canvas":case"base64":e($.call(t,n));break;case"blob":K.call(t,n).then(e);break;default:e(q.call(t,n))}}))}function ne(){W.call(this)}function ie(e){if(!this.options.useCanvas||!this.options.enableOrientation)throw"Croppie: Cannot rotate without enableOrientation && EXIF.js included";var t,n,i,o,r,a=this.elements.canvas;this.data.orientation=(t=this.data.orientation,n=e,i=s.indexOf(t)>-1?s:l,o=i.indexOf(t),r=n/90%i.length,i[(i.length+o+r%i.length)%i.length]),C(a,this.elements.img,this.data.orientation),k.call(this,!0),S.call(this)}function oe(){var e,t;this.element.removeChild(this.elements.boundary),e=this.element,t="croppie-container",e.classList?e.classList.remove(t):e.className=e.className.replace(t,""),this.options.enableZoom&&this.element.removeChild(this.elements.zoomerWrap),delete this.elements}if(window.jQuery){var re=window.jQuery;re.fn.croppie=function(e){var t=typeof e;if("string"===t){var n=Array.prototype.slice.call(arguments,1),i=re(this).data("croppie");return"get"===e?i.get():"result"===e?i.result.apply(i,n):"bind"===e?i.bind.apply(i,n):this.each((function(){var t=re(this).data("croppie");if(t){var i=t[e];if(!re.isFunction(i))throw"Croppie "+e+" method not found";i.apply(t,n),"destroy"===e&&re(this).removeData("croppie")}}))}return this.each((function(){var t=new ae(this,e);t.$=re,re(this).data("croppie",t)}))}}function ae(e,t){if(e.className.indexOf("croppie-container")>-1)throw new Error("Croppie: Can't initialize croppie more than once");if(this.element=e,this.options=h(u(ae.defaults),t),"img"===this.element.tagName.toLowerCase()){var n=this.element;m(n,"cr-original-image"),f(n,{"aria-hidden":"true",alt:""});var i=document.createElement("div");this.element.parentNode.appendChild(i),i.appendChild(n),this.element=i,this.options.url=this.options.url||n.src}if(E.call(this),this.options.url){var o={url:this.options.url,points:this.options.points};delete this.options.url,delete this.options.points,J.call(this,o)}}return ae.defaults={viewport:{width:100,height:100,type:"square"},boundary:{},orientationControls:{enabled:!0,leftClass:"",rightClass:""},resizeControls:{width:!0,height:!0},customClass:"",showZoomer:!0,enableZoom:!0,enableResize:!1,mouseWheelZoom:!0,enableExif:!1,enforceBoundary:!0,enableOrientation:!1,enableKeyMovement:!0,update:function(){}},ae.globals={translate:"translate3d"},h(ae.prototype,{bind:function(e,t){return J.call(this,e,t)},get:function(){var e=G.call(this),t=e.points;return this.options.relative&&(t[0]/=this.elements.img.naturalWidth/100,t[1]/=this.elements.img.naturalHeight/100,t[2]/=this.elements.img.naturalWidth/100,t[3]/=this.elements.img.naturalHeight/100),e},result:function(e){return te.call(this,e)},refresh:function(){return ne.call(this)},setZoom:function(e){L.call(this,e),p(this.elements.zoomer)},rotate:function(e){ie.call(this,e)},destroy:function(){return oe.call(this)}}),ae})?o.call(t,n,t,e):o)||(e.exports=r)}).call(this,n(327).setImmediate)},327:function(e,t,n){(function(e){var i=void 0!==e&&e||"undefined"!=typeof self&&self||window,o=Function.prototype.apply;function r(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new r(o.call(setTimeout,i,arguments),clearTimeout)},t.setInterval=function(){return new r(o.call(setInterval,i,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},r.prototype.unref=r.prototype.ref=function(){},r.prototype.close=function(){this._clearFn.call(i,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},n(328),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,n(197))},328:function(e,t,n){(function(e,t){!function(e,n){"use strict";if(!e.setImmediate){var i,o,r,a,s,l=1,c={},h=!1,u=e.document,p=Object.getPrototypeOf&&Object.getPrototypeOf(e);p=p&&p.setTimeout?p:e,"[object process]"==={}.toString.call(e.process)?i=function(e){t.nextTick((function(){m(e)}))}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?e.MessageChannel?((r=new MessageChannel).port1.onmessage=function(e){m(e.data)},i=function(e){r.port2.postMessage(e)}):u&&"onreadystatechange"in u.createElement("script")?(o=u.documentElement,i=function(e){var t=u.createElement("script");t.onreadystatechange=function(){m(e),t.onreadystatechange=null,o.removeChild(t),t=null},o.appendChild(t)}):i=function(e){setTimeout(m,0,e)}:(a="setImmediate$"+Math.random()+"$",s=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(a)&&m(+t.data.slice(a.length))},e.addEventListener?e.addEventListener("message",s,!1):e.attachEvent("onmessage",s),i=function(t){e.postMessage(a+t,"*")}),p.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n1)for(var n=1;ne;e++)r.call(this,this._deferreds[e]);this._deferreds=null}function c(e,t,n,i){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=n,this.reject=i}function h(e,t,n){var i=!1;try{e((function(e){i||(i=!0,t(e))}),(function(e){i||(i=!0,n(e))}))}catch(e){if(i)return;i=!0,n(e)}}var u=setTimeout,p="function"==typeof i&&i||function(e){u(e,1)},d=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};o.prototype.catch=function(e){return this.then(null,e)},o.prototype.then=function(e,t){var n=this;return new o((function(i,o){r.call(n,new c(e,t,i,o))}))},o.all=function(){var e=Array.prototype.slice.call(1===arguments.length&&d(arguments[0])?arguments[0]:arguments);return new o((function(t,n){function i(r,a){try{if(a&&("object"==typeof a||"function"==typeof a)){var s=a.then;if("function"==typeof s)return void s.call(a,(function(e){i(r,e)}),n)}e[r]=a,0==--o&&t(e)}catch(e){n(e)}}if(0===e.length)return t([]);for(var o=e.length,r=0;ri;i++)e[i].then(t,n)}))},o._setImmediateFn=function(e){p=e},e.exports?e.exports=o:t.Promise||(t.Promise=o)}(this),"function"!=typeof window.CustomEvent&&function(){function e(e,t){t=t||{bubbles:!1,cancelable:!1,detail:void 0};var n=document.createEvent("CustomEvent");return n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),n}e.prototype=window.Event.prototype,window.CustomEvent=e}(),HTMLCanvasElement.prototype.toBlob||Object.defineProperty(HTMLCanvasElement.prototype,"toBlob",{value:function(e,t,n){for(var i=atob(this.toDataURL(t,n).split(",")[1]),o=i.length,r=new Uint8Array(o),a=0;a=5){var r=n;n=i,i=r}return{width:n,height:i}}n=c("transform"),t=c("transformOrigin"),o=c("userSelect");var w={translate3d:{suffix:", 0px"},translate:{suffix:""}},y=function(e,t,n){this.x=parseFloat(e),this.y=parseFloat(t),this.scale=parseFloat(n)};y.parse=function(e){return e.style?y.parse(e.style[n]):e.indexOf("matrix")>-1||e.indexOf("none")>-1?y.fromMatrix(e):y.fromString(e)},y.fromMatrix=function(e){var t=e.substring(7).split(",");return t.length&&"none"!==e||(t=[1,0,0,1,0,0]),new y(v(t[4]),v(t[5]),parseFloat(t[0]))},y.fromString=function(e){var t=e.split(") "),n=t[0].substring(ae.globals.translate.length+1).split(","),i=t.length>1?t[1].substring(6):1,o=n.length>1?n[0]:0,r=n.length>1?n[1]:0;return new y(o,r,i)},y.prototype.toString=function(){var e=w[ae.globals.translate].suffix||"";return ae.globals.translate+"("+this.x+"px, "+this.y+"px"+e+") scale("+this.scale+")"};var b=function(e){if(!e||!e.style[t])return this.x=0,void(this.y=0);var n=e.style[t].split(" ");this.x=parseFloat(n[0]),this.y=parseFloat(n[1])};function x(e){return e.exifdata&&e.exifdata.Orientation?v(e.exifdata.Orientation):1}function C(e,t,n){var i=t.width,o=t.height,r=e.getContext("2d");switch(e.width=t.width,e.height=t.height,r.save(),n){case 2:r.translate(i,0),r.scale(-1,1);break;case 3:r.translate(i,o),r.rotate(180*Math.PI/180);break;case 4:r.translate(0,o),r.scale(1,-1);break;case 5:e.width=o,e.height=i,r.rotate(90*Math.PI/180),r.scale(1,-1);break;case 6:e.width=o,e.height=i,r.rotate(90*Math.PI/180),r.translate(0,-o);break;case 7:e.width=o,e.height=i,r.rotate(-90*Math.PI/180),r.translate(-i,o),r.scale(1,-1);break;case 8:e.width=o,e.height=i,r.translate(0,i),r.rotate(-90*Math.PI/180)}r.drawImage(t,0,0,i,o),r.restore()}function E(){var e,t,n,i,o,r,a=this.options.viewport.type?"cr-vp-"+this.options.viewport.type:null;this.options.useCanvas=this.options.enableOrientation||_.call(this),this.data={},this.elements={},e=this.elements.boundary=document.createElement("div"),n=this.elements.viewport=document.createElement("div"),t=this.elements.img=document.createElement("img"),i=this.elements.overlay=document.createElement("div"),this.options.useCanvas?(this.elements.canvas=document.createElement("canvas"),this.elements.preview=this.elements.canvas):this.elements.preview=t,m(e,"cr-boundary"),e.setAttribute("aria-dropeffect","none"),o=this.options.boundary.width,r=this.options.boundary.height,d(e,{width:o+(isNaN(o)?"":"px"),height:r+(isNaN(r)?"":"px")}),m(n,"cr-viewport"),a&&m(n,a),d(n,{width:this.options.viewport.width+"px",height:this.options.viewport.height+"px"}),n.setAttribute("tabindex",0),m(this.elements.preview,"cr-image"),f(this.elements.preview,{alt:"preview","aria-grabbed":"false"}),m(i,"cr-overlay"),this.element.appendChild(e),e.appendChild(this.elements.preview),e.appendChild(n),e.appendChild(i),m(this.element,"croppie-container"),this.options.customClass&&m(this.element,this.options.customClass),B.call(this),this.options.enableZoom&&I.call(this),this.options.enableResize&&T.call(this)}function _(){return this.options.enableExif&&window.EXIF}function T(){var e,t,n,i,r,a,s,l=this,c=document.createElement("div"),h=!1;function u(a){if((void 0===a.button||0===a.button)&&(a.preventDefault(),!h)){var s=l.elements.overlay.getBoundingClientRect();if(h=!0,t=a.pageX,n=a.pageY,e=-1!==a.currentTarget.className.indexOf("vertical")?"v":"h",i=s.width,r=s.height,a.touches){var c=a.touches[0];t=c.pageX,n=c.pageY}window.addEventListener("mousemove",p),window.addEventListener("touchmove",p),window.addEventListener("mouseup",f),window.addEventListener("touchend",f),document.body.style[o]="none"}}function p(o){var a=o.pageX,s=o.pageY;if(o.preventDefault(),o.touches){var h=o.touches[0];a=h.pageX,s=h.pageY}var u=a-t,p=s-n,m=l.options.viewport.height+p,f=l.options.viewport.width+u;"v"===e&&m>=50&&m<=r?(d(c,{height:m+"px"}),l.options.boundary.height+=p,d(l.elements.boundary,{height:l.options.boundary.height+"px"}),l.options.viewport.height+=p,d(l.elements.viewport,{height:l.options.viewport.height+"px"})):"h"===e&&f>=50&&f<=i&&(d(c,{width:f+"px"}),l.options.boundary.width+=u,d(l.elements.boundary,{width:l.options.boundary.width+"px"}),l.options.viewport.width+=u,d(l.elements.viewport,{width:l.options.viewport.width+"px"})),Z.call(l),S.call(l),k.call(l),Y.call(l),n=s,t=a}function f(){h=!1,window.removeEventListener("mousemove",p),window.removeEventListener("touchmove",p),window.removeEventListener("mouseup",f),window.removeEventListener("touchend",f),document.body.style[o]=""}m(c,"cr-resizer"),d(c,{width:this.options.viewport.width+"px",height:this.options.viewport.height+"px"}),this.options.resizeControls.height&&(m(a=document.createElement("div"),"cr-resizer-vertical"),c.appendChild(a)),this.options.resizeControls.width&&(m(s=document.createElement("div"),"cr-resizer-horisontal"),c.appendChild(s)),a&&(a.addEventListener("mousedown",u),a.addEventListener("touchstart",u)),s&&(s.addEventListener("mousedown",u),s.addEventListener("touchstart",u)),this.elements.boundary.appendChild(c)}function L(e){if(this.options.enableZoom){var t=this.elements.zoomer,n=Q(e,4);t.value=Math.max(parseFloat(t.min),Math.min(parseFloat(t.max),n)).toString()}}function I(){var e=this,t=e.elements.zoomerWrap=document.createElement("div"),n=e.elements.zoomer=document.createElement("input");function i(){M.call(e,{value:parseFloat(n.value),origin:new b(e.elements.preview),viewportRect:e.elements.viewport.getBoundingClientRect(),transform:y.parse(e.elements.preview)})}function o(t){var n,o;if("ctrl"===e.options.mouseWheelZoom&&!0!==t.ctrlKey)return 0;n=t.wheelDelta?t.wheelDelta/1200:t.deltaY?t.deltaY/1060:t.detail?t.detail/-60:0,o=e._currentZoom+n*e._currentZoom,t.preventDefault(),L.call(e,o),i.call(e)}m(t,"cr-slider-wrap"),m(n,"cr-slider"),n.type="range",n.step="0.0001",n.value="1",n.style.display=e.options.showZoomer?"":"none",n.setAttribute("aria-label","zoom"),e.element.appendChild(t),t.appendChild(n),e._currentZoom=1,e.elements.zoomer.addEventListener("input",i),e.elements.zoomer.addEventListener("change",i),e.options.mouseWheelZoom&&(e.elements.boundary.addEventListener("mousewheel",o),e.elements.boundary.addEventListener("DOMMouseScroll",o))}function M(e){var i=this,o=e?e.transform:y.parse(i.elements.preview),r=e?e.viewportRect:i.elements.viewport.getBoundingClientRect(),a=e?e.origin:new b(i.elements.preview);function s(){var e={};e[n]=o.toString(),e[t]=a.toString(),d(i.elements.preview,e)}if(i._currentZoom=e?e.value:i._currentZoom,o.scale=i._currentZoom,i.elements.zoomer.setAttribute("aria-valuenow",i._currentZoom),s(),i.options.enforceBoundary){var l=R.call(i,r),c=l.translate,h=l.origin;o.x>=c.maxX&&(a.x=h.minX,o.x=c.maxX),o.x<=c.minX&&(a.x=h.maxX,o.x=c.minX),o.y>=c.maxY&&(a.y=h.minY,o.y=c.maxY),o.y<=c.minY&&(a.y=h.maxY,o.y=c.minY)}s(),X.call(i),Y.call(i)}function R(e){var t=this._currentZoom,n=e.width,i=e.height,o=this.elements.boundary.clientWidth/2,r=this.elements.boundary.clientHeight/2,a=this.elements.preview.getBoundingClientRect(),s=a.width,l=a.height,c=n/2,h=i/2,u=-1*(c/t-o),p=-1*(h/t-r),d=1/t*c,m=1/t*h;return{translate:{maxX:u,minX:u-(s*(1/t)-n*(1/t)),maxY:p,minY:p-(l*(1/t)-i*(1/t))},origin:{maxX:s*(1/t)-d,minX:d,maxY:l*(1/t)-m,minY:m}}}function k(e){var i=this._currentZoom,o=this.elements.preview.getBoundingClientRect(),r=this.elements.viewport.getBoundingClientRect(),a=y.parse(this.elements.preview.style[n]),s=new b(this.elements.preview),l=r.top-o.top+r.height/2,c=r.left-o.left+r.width/2,h={},u={};if(e){var p=s.x,m=s.y,f=a.x,v=a.y;h.y=p,h.x=m,a.y=f,a.x=v}else h.y=l/i,h.x=c/i,u.y=(h.y-s.y)*(1-i),u.x=(h.x-s.x)*(1-i),a.x-=u.x,a.y-=u.y;var g={};g[t]=h.x+"px "+h.y+"px",g[n]=a.toString(),d(this.elements.preview,g)}function B(){var e,t,i,r,a,s=this,l=!1;function c(e,t){var n=s.elements.preview.getBoundingClientRect(),i=a.y+t,o=a.x+e;s.options.enforceBoundary?(r.top>n.top+t&&r.bottomn.left+e&&r.right1){var v=o.touches[0],g=o.touches[1],w=Math.sqrt((v.pageX-g.pageX)*(v.pageX-g.pageX)+(v.pageY-g.pageY)*(v.pageY-g.pageY));i||(i=w/s._currentZoom);var y=w/i;return L.call(s,y),void p(s.elements.zoomer)}c(u,m),f[n]=a.toString(),d(s.elements.preview,f),Z.call(s),t=l,e=r}function f(){h(l=!1),window.removeEventListener("mousemove",m),window.removeEventListener("touchmove",m),window.removeEventListener("mouseup",f),window.removeEventListener("touchend",f),document.body.style[o]="",k.call(s),Y.call(s),i=0}s.elements.overlay.addEventListener("mousedown",u),s.elements.viewport.addEventListener("keydown",(function(e){var t;if(!e.shiftKey||38!==e.keyCode&&40!==e.keyCode){if(s.options.enableKeyMovement&&e.keyCode>=37&&e.keyCode<=40){e.preventDefault();var l=function(e){switch(e){case 37:return[1,0];case 38:return[0,1];case 39:return[-1,0];case 40:return[0,-1]}}(e.keyCode);a=y.parse(s.elements.preview),document.body.style[o]="none",r=s.elements.viewport.getBoundingClientRect(),function(e){var t=e[0],r=e[1],l={};c(t,r),l[n]=a.toString(),d(s.elements.preview,l),Z.call(s),document.body.style[o]="",k.call(s),Y.call(s),i=0}(l)}}else t=38===e.keyCode?parseFloat(s.elements.zoomer.value)+parseFloat(s.elements.zoomer.step):parseFloat(s.elements.zoomer.value)-parseFloat(s.elements.zoomer.step),s.setZoom(t)})),s.elements.overlay.addEventListener("touchstart",u)}function Z(){if(this.elements){var e=this.elements.boundary.getBoundingClientRect(),t=this.elements.preview.getBoundingClientRect();d(this.elements.overlay,{width:t.width+"px",height:t.height+"px",top:t.top-e.top+"px",left:t.left-e.left+"px"})}}b.prototype.toString=function(){return this.x+"px "+this.y+"px"};var F,z,O,A,X=(F=Z,z=500,function(){var e=this,t=arguments,n=function(){A=null,O||F.apply(e,t)},i=O&&!A;clearTimeout(A),A=setTimeout(n,z),i&&F.apply(e,t)});function Y(){var e,t=this.get();j.call(this)&&(this.options.update.call(this,t),this.$&&"undefined"==typeof Prototype?this.$(this.element).trigger("update.croppie",t):(window.CustomEvent?e=new CustomEvent("update",{detail:t}):(e=document.createEvent("CustomEvent")).initCustomEvent("update",!0,!0,t),this.element.dispatchEvent(e)))}function j(){return this.elements.preview.offsetHeight>0&&this.elements.preview.offsetWidth>0}function W(){var e,i={},o=this.elements.preview,r=new y(0,0,1),a=new b;j.call(this)&&!this.data.bound&&(this.data.bound=!0,i[n]=r.toString(),i[t]=a.toString(),i.opacity=1,d(o,i),e=this.elements.preview.getBoundingClientRect(),this._originalImageWidth=e.width,this._originalImageHeight=e.height,this.data.orientation=x(this.elements.img),this.options.enableZoom?S.call(this,!0):this._currentZoom=1,r.scale=this._currentZoom,i[n]=r.toString(),d(o,i),this.data.points.length?H.call(this,this.data.points):N.call(this),k.call(this),Z.call(this))}function S(e){var t,n,i,o,r=Math.max(this.options.minZoom,0)||0,a=this.options.maxZoom||1.5,s=this.elements.zoomer,l=parseFloat(s.value),c=this.elements.boundary.getBoundingClientRect(),h=g(this.elements.img,this.data.orientation),u=this.elements.viewport.getBoundingClientRect();this.options.enforceBoundary&&(i=u.width/h.width,o=u.height/h.height,r=Math.max(i,o)),r>=a&&(a=r+1),s.min=Q(r,4),s.max=Q(a,4),!e&&(ls.max)?L.call(this,lthis._originalImageWidth&&(w=(d=this._originalImageWidth-u)/o*c),i<0&&(p=0,g=Math.abs(i)/r*h),m+p>this._originalImageHeight&&(y=(m=this._originalImageHeight-p)/r*h),l.drawImage(this.elements.preview,u,p,d,m,f,g,w,y),a&&(l.fillStyle="#fff",l.globalCompositeOperation="destination-in",l.beginPath(),l.arc(s.width/2,s.height/2,s.width/2,0,2*Math.PI,!0),l.closePath(),l.fill()),s}function q(e){var t=e.points,n=document.createElement("div"),i=document.createElement("img"),o=t[2]-t[0],r=t[3]-t[1];return m(n,"croppie-result"),n.appendChild(i),d(i,{left:-1*t[0]+"px",top:-1*t[1]+"px"}),i.src=e.url,d(n,{width:o+"px",height:r+"px"}),n}function $(e){return D.call(this,e).toDataURL(e.format,e.quality)}function K(e){var t=this;return new Promise((function(n){D.call(t,e).toBlob((function(e){n(e)}),e.format,e.quality)}))}function U(e){this.elements.img.parentNode&&(Array.prototype.forEach.call(this.elements.img.classList,(function(t){e.classList.add(t)})),this.elements.img.parentNode.replaceChild(e,this.elements.img),this.elements.preview=e),this.elements.img=e}function J(e,t){var n,i,o,r,a=this,s=[],l=null,c=_.call(a);if("string"==typeof e)n=e,e={};else if(Array.isArray(e))s=e.slice();else{if(void 0===e&&a.data.url)return W.call(a),Y.call(a),null;n=e.url,s=e.points||[],l=void 0===e.zoom?null:e.zoom}return a.data.bound=!1,a.data.url=n||a.data.url,a.data.boundZoom=l,(i=n,o=c,r=new Image,r.style.opacity="0",new Promise((function(e,t){function n(){r.style.opacity="1",setTimeout((function(){e(r)}),1)}r.removeAttribute("crossOrigin"),i.match(/^https?:\/\/|^\/\//)&&r.setAttribute("crossOrigin","anonymous"),r.onload=function(){o?EXIF.getData(r,(function(){n()})):n()},r.onerror=function(e){r.style.opacity=1,setTimeout((function(){t(e)}),1)},r.src=i}))).then((function(n){if(U.call(a,n),s.length)a.options.relative&&(s=[s[0]*n.naturalWidth/100,s[1]*n.naturalHeight/100,s[2]*n.naturalWidth/100,s[3]*n.naturalHeight/100]);else{var i,o,r=g(n),l=a.elements.viewport.getBoundingClientRect(),c=l.width/l.height;r.width/r.height>c?i=(o=r.height)*c:(i=r.width,o=r.height/c);var h=(r.width-i)/2,u=(r.height-o)/2,p=h+i,d=u+o;a.data.points=[h,u,p,d]}a.data.points=s.map((function(e){return parseFloat(e)})),a.options.useCanvas&&P.call(a,e.orientation),W.call(a),Y.call(a),t&&t()}))}function Q(e,t){return parseFloat(e).toFixed(t||0)}function G(){var e=this.elements.preview.getBoundingClientRect(),t=this.elements.viewport.getBoundingClientRect(),n=t.left-e.left,i=t.top-e.top,o=(t.width-this.elements.viewport.offsetWidth)/2,r=(t.height-this.elements.viewport.offsetHeight)/2,a=n+this.elements.viewport.offsetWidth+o,s=i+this.elements.viewport.offsetHeight+r,l=this._currentZoom;(l===1/0||isNaN(l))&&(l=1);var c=this.options.enforceBoundary?0:Number.NEGATIVE_INFINITY;return n=Math.max(c,n/l),i=Math.max(c,i/l),a=Math.max(c,a/l),s=Math.max(c,s/l),{points:[Q(n),Q(i),Q(a),Q(s)],zoom:l,orientation:this.data.orientation}}var V={type:"canvas",format:"png",quality:1},ee=["jpeg","webp","png"];function te(e){var t=this,n=G.call(t),i=h(u(V),u(e)),o="string"==typeof e?e:i.type||"base64",r=i.size||"viewport",a=i.format,s=i.quality,l=i.backgroundColor,c="boolean"==typeof i.circle?i.circle:"circle"===t.options.viewport.type,p=t.elements.viewport.getBoundingClientRect(),d=p.width/p.height;return"viewport"===r?(n.outputWidth=p.width,n.outputHeight=p.height):"object"==typeof r&&(r.width&&r.height?(n.outputWidth=r.width,n.outputHeight=r.height):r.width?(n.outputWidth=r.width,n.outputHeight=r.width/d):r.height&&(n.outputWidth=r.height*d,n.outputHeight=r.height)),ee.indexOf(a)>-1&&(n.format="image/"+a,n.quality=s),n.circle=c,n.url=t.data.url,n.backgroundColor=l,new Promise((function(e){switch(o.toLowerCase()){case"rawcanvas":e(D.call(t,n));break;case"canvas":case"base64":e($.call(t,n));break;case"blob":K.call(t,n).then(e);break;default:e(q.call(t,n))}}))}function ne(){W.call(this)}function ie(e){if(!this.options.useCanvas||!this.options.enableOrientation)throw"Croppie: Cannot rotate without enableOrientation && EXIF.js included";var t,n,i,o,r,a=this.elements.canvas;this.data.orientation=(t=this.data.orientation,n=e,i=s.indexOf(t)>-1?s:l,o=i.indexOf(t),r=n/90%i.length,i[(i.length+o+r%i.length)%i.length]),C(a,this.elements.img,this.data.orientation),k.call(this,!0),S.call(this)}function oe(){var e,t;this.element.removeChild(this.elements.boundary),e=this.element,t="croppie-container",e.classList?e.classList.remove(t):e.className=e.className.replace(t,""),this.options.enableZoom&&this.element.removeChild(this.elements.zoomerWrap),delete this.elements}if(window.jQuery){var re=window.jQuery;re.fn.croppie=function(e){var t=typeof e;if("string"===t){var n=Array.prototype.slice.call(arguments,1),i=re(this).data("croppie");return"get"===e?i.get():"result"===e?i.result.apply(i,n):"bind"===e?i.bind.apply(i,n):this.each((function(){var t=re(this).data("croppie");if(t){var i=t[e];if(!re.isFunction(i))throw"Croppie "+e+" method not found";i.apply(t,n),"destroy"===e&&re(this).removeData("croppie")}}))}return this.each((function(){var t=new ae(this,e);t.$=re,re(this).data("croppie",t)}))}}function ae(e,t){if(e.className.indexOf("croppie-container")>-1)throw new Error("Croppie: Can't initialize croppie more than once");if(this.element=e,this.options=h(u(ae.defaults),t),"img"===this.element.tagName.toLowerCase()){var n=this.element;m(n,"cr-original-image"),f(n,{"aria-hidden":"true",alt:""});var i=document.createElement("div");this.element.parentNode.appendChild(i),i.appendChild(n),this.element=i,this.options.url=this.options.url||n.src}if(E.call(this),this.options.url){var o={url:this.options.url,points:this.options.points};delete this.options.url,delete this.options.points,J.call(this,o)}}return ae.defaults={viewport:{width:100,height:100,type:"square"},boundary:{},orientationControls:{enabled:!0,leftClass:"",rightClass:""},resizeControls:{width:!0,height:!0},customClass:"",showZoomer:!0,enableZoom:!0,enableResize:!1,mouseWheelZoom:!0,enableExif:!1,enforceBoundary:!0,enableOrientation:!1,enableKeyMovement:!0,update:function(){}},ae.globals={translate:"translate3d"},h(ae.prototype,{bind:function(e,t){return J.call(this,e,t)},get:function(){var e=G.call(this),t=e.points;return this.options.relative&&(t[0]/=this.elements.img.naturalWidth/100,t[1]/=this.elements.img.naturalHeight/100,t[2]/=this.elements.img.naturalWidth/100,t[3]/=this.elements.img.naturalHeight/100),e},result:function(e){return te.call(this,e)},refresh:function(){return ne.call(this)},setZoom:function(e){L.call(this,e),p(this.elements.zoomer)},rotate:function(e){ie.call(this,e)},destroy:function(){return oe.call(this)}}),ae})?o.call(t,n,t,e):o)||(e.exports=r)}).call(this,n(328).setImmediate)},328:function(e,t,n){(function(e){var i=void 0!==e&&e||"undefined"!=typeof self&&self||window,o=Function.prototype.apply;function r(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new r(o.call(setTimeout,i,arguments),clearTimeout)},t.setInterval=function(){return new r(o.call(setInterval,i,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},r.prototype.unref=r.prototype.ref=function(){},r.prototype.close=function(){this._clearFn.call(i,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},n(329),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,n(198))},329:function(e,t,n){(function(e,t){!function(e,n){"use strict";if(!e.setImmediate){var i,o,r,a,s,l=1,c={},h=!1,u=e.document,p=Object.getPrototypeOf&&Object.getPrototypeOf(e);p=p&&p.setTimeout?p:e,"[object process]"==={}.toString.call(e.process)?i=function(e){t.nextTick((function(){m(e)}))}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?e.MessageChannel?((r=new MessageChannel).port1.onmessage=function(e){m(e.data)},i=function(e){r.port2.postMessage(e)}):u&&"onreadystatechange"in u.createElement("script")?(o=u.documentElement,i=function(e){var t=u.createElement("script");t.onreadystatechange=function(){m(e),t.onreadystatechange=null,o.removeChild(t),t=null},o.appendChild(t)}):i=function(e){setTimeout(m,0,e)}:(a="setImmediate$"+Math.random()+"$",s=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(a)&&m(+t.data.slice(a.length))},e.addEventListener?e.addEventListener("message",s,!1):e.attachEvent("onmessage",s),i=function(t){e.postMessage(a+t,"*")}),p.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n1)for(var n=1;na;a++)d.call(this,this._deferreds[a]);this._deferreds=null}function h(a,b,c,d){this.onFulfilled=\"function\"===typeof a?a:null,this.onRejected=\"function\"===typeof b?b:null,this.resolve=c,this.reject=d}function i(a,b,c){var d=!1;try{a(function(a){d||(d=!0,b(a))},function(a){d||(d=!0,c(a))})}catch(e){if(d)return;d=!0,c(e)}}var j=setTimeout,k=\"function\"===typeof setImmediate&&setImmediate||function(a){j(a,1)},l=Array.isArray||function(a){return\"[object Array]\"===Object.prototype.toString.call(a)};c.prototype[\"catch\"]=function(a){return this.then(null,a)},c.prototype.then=function(a,b){var e=this;return new c(function(c,f){d.call(e,new h(a,b,c,f))})},c.all=function(){var a=Array.prototype.slice.call(1===arguments.length&&l(arguments[0])?arguments[0]:arguments);return new c(function(b,c){function d(f,g){try{if(g&&(\"object\"===typeof g||\"function\"===typeof g)){var h=g.then;if(\"function\"===typeof h)return void h.call(g,function(a){d(f,a)},c)}a[f]=g,0===--e&&b(a)}catch(i){c(i)}}if(0===a.length)return b([]);for(var e=a.length,f=0;fd;d++)a[d].then(b,c)})},c._setImmediateFn=function(a){k=a},\"undefined\"!==typeof module&&module.exports?module.exports=c:a.Promise||(a.Promise=c)}(this);\r\n }\r\n\r\n if ( typeof window.CustomEvent !== \"function\" ) {\r\n (function(){\r\n function CustomEvent ( event, params ) {\r\n params = params || { bubbles: false, cancelable: false, detail: undefined };\r\n var evt = document.createEvent( 'CustomEvent' );\r\n evt.initCustomEvent( event, params.bubbles, params.cancelable, params.detail );\r\n return evt;\r\n }\r\n CustomEvent.prototype = window.Event.prototype;\r\n window.CustomEvent = CustomEvent;\r\n }());\r\n }\r\n\r\n if (!HTMLCanvasElement.prototype.toBlob) {\r\n Object.defineProperty(HTMLCanvasElement.prototype, 'toBlob', {\r\n value: function (callback, type, quality) {\r\n var binStr = atob( this.toDataURL(type, quality).split(',')[1] ),\r\n len = binStr.length,\r\n arr = new Uint8Array(len);\r\n\r\n for (var i=0; i -1 ? EXIF_NORM : EXIF_FLIP,\r\n index = arr.indexOf(ornt),\r\n offset = (rotate / 90) % arr.length;// 180 = 2%4 = 2 shift exif by 2 indexes\r\n\r\n return arr[(arr.length + index + (offset % arr.length)) % arr.length];\r\n }\r\n\r\n // Credits to : Andrew Dupont - http://andrewdupont.net/2009/08/28/deep-extending-objects-in-javascript/\r\n function deepExtend(destination, source) {\r\n destination = destination || {};\r\n for (var property in source) {\r\n if (source[property] && source[property].constructor && source[property].constructor === Object) {\r\n destination[property] = destination[property] || {};\r\n deepExtend(destination[property], source[property]);\r\n } else {\r\n destination[property] = source[property];\r\n }\r\n }\r\n return destination;\r\n }\r\n\r\n function clone(object) {\r\n return deepExtend({}, object);\r\n }\r\n\r\n function debounce(func, wait, immediate) {\r\n var timeout;\r\n return function () {\r\n var context = this, args = arguments;\r\n var later = function () {\r\n timeout = null;\r\n if (!immediate) func.apply(context, args);\r\n };\r\n var callNow = immediate && !timeout;\r\n clearTimeout(timeout);\r\n timeout = setTimeout(later, wait);\r\n if (callNow) func.apply(context, args);\r\n };\r\n }\r\n\r\n function dispatchChange(element) {\r\n if (\"createEvent\" in document) {\r\n var evt = document.createEvent(\"HTMLEvents\");\r\n evt.initEvent(\"change\", false, true);\r\n element.dispatchEvent(evt);\r\n }\r\n else {\r\n element.fireEvent(\"onchange\");\r\n }\r\n }\r\n\r\n //http://jsperf.com/vanilla-css\r\n function css(el, styles, val) {\r\n if (typeof (styles) === 'string') {\r\n var tmp = styles;\r\n styles = {};\r\n styles[tmp] = val;\r\n }\r\n\r\n for (var prop in styles) {\r\n el.style[prop] = styles[prop];\r\n }\r\n }\r\n\r\n function addClass(el, c) {\r\n if (el.classList) {\r\n el.classList.add(c);\r\n }\r\n else {\r\n el.className += ' ' + c;\r\n }\r\n }\r\n\r\n function removeClass(el, c) {\r\n if (el.classList) {\r\n el.classList.remove(c);\r\n }\r\n else {\r\n el.className = el.className.replace(c, '');\r\n }\r\n }\r\n\r\n function setAttributes(el, attrs) {\r\n for (var key in attrs) {\r\n el.setAttribute(key, attrs[key]);\r\n }\r\n }\r\n\r\n function num(v) {\r\n return parseInt(v, 10);\r\n }\r\n\r\n /* Utilities */\r\n function loadImage(src, doExif) {\r\n var img = new Image();\r\n img.style.opacity = '0';\r\n return new Promise(function (resolve, reject) {\r\n function _resolve() {\r\n img.style.opacity = '1';\r\n setTimeout(function () {\r\n resolve(img);\r\n }, 1);\r\n }\r\n\r\n img.removeAttribute('crossOrigin');\r\n if (src.match(/^https?:\\/\\/|^\\/\\//)) {\r\n img.setAttribute('crossOrigin', 'anonymous');\r\n }\r\n\r\n img.onload = function () {\r\n if (doExif) {\r\n EXIF.getData(img, function () {\r\n _resolve();\r\n });\r\n }\r\n else {\r\n _resolve();\r\n }\r\n };\r\n img.onerror = function (ev) {\r\n img.style.opacity = 1;\r\n setTimeout(function () {\r\n reject(ev);\r\n }, 1);\r\n };\r\n img.src = src;\r\n });\r\n }\r\n\r\n function naturalImageDimensions(img, ornt) {\r\n var w = img.naturalWidth;\r\n var h = img.naturalHeight;\r\n var orient = ornt || getExifOrientation(img);\r\n if (orient && orient >= 5) {\r\n var x= w;\r\n w = h;\r\n h = x;\r\n }\r\n return { width: w, height: h };\r\n }\r\n\r\n /* CSS Transform Prototype */\r\n var TRANSLATE_OPTS = {\r\n 'translate3d': {\r\n suffix: ', 0px'\r\n },\r\n 'translate': {\r\n suffix: ''\r\n }\r\n };\r\n var Transform = function (x, y, scale) {\r\n this.x = parseFloat(x);\r\n this.y = parseFloat(y);\r\n this.scale = parseFloat(scale);\r\n };\r\n\r\n Transform.parse = function (v) {\r\n if (v.style) {\r\n return Transform.parse(v.style[CSS_TRANSFORM]);\r\n }\r\n else if (v.indexOf('matrix') > -1 || v.indexOf('none') > -1) {\r\n return Transform.fromMatrix(v);\r\n }\r\n else {\r\n return Transform.fromString(v);\r\n }\r\n };\r\n\r\n Transform.fromMatrix = function (v) {\r\n var vals = v.substring(7).split(',');\r\n if (!vals.length || v === 'none') {\r\n vals = [1, 0, 0, 1, 0, 0];\r\n }\r\n\r\n return new Transform(num(vals[4]), num(vals[5]), parseFloat(vals[0]));\r\n };\r\n\r\n Transform.fromString = function (v) {\r\n var values = v.split(') '),\r\n translate = values[0].substring(Croppie.globals.translate.length + 1).split(','),\r\n scale = values.length > 1 ? values[1].substring(6) : 1,\r\n x = translate.length > 1 ? translate[0] : 0,\r\n y = translate.length > 1 ? translate[1] : 0;\r\n\r\n return new Transform(x, y, scale);\r\n };\r\n\r\n Transform.prototype.toString = function () {\r\n var suffix = TRANSLATE_OPTS[Croppie.globals.translate].suffix || '';\r\n return Croppie.globals.translate + '(' + this.x + 'px, ' + this.y + 'px' + suffix + ') scale(' + this.scale + ')';\r\n };\r\n\r\n var TransformOrigin = function (el) {\r\n if (!el || !el.style[CSS_TRANS_ORG]) {\r\n this.x = 0;\r\n this.y = 0;\r\n return;\r\n }\r\n var css = el.style[CSS_TRANS_ORG].split(' ');\r\n this.x = parseFloat(css[0]);\r\n this.y = parseFloat(css[1]);\r\n };\r\n\r\n TransformOrigin.prototype.toString = function () {\r\n return this.x + 'px ' + this.y + 'px';\r\n };\r\n\r\n function getExifOrientation (img) {\r\n return img.exifdata && img.exifdata.Orientation ? num(img.exifdata.Orientation) : 1;\r\n }\r\n\r\n function drawCanvas(canvas, img, orientation) {\r\n var width = img.width,\r\n height = img.height,\r\n ctx = canvas.getContext('2d');\r\n\r\n canvas.width = img.width;\r\n canvas.height = img.height;\r\n\r\n ctx.save();\r\n switch (orientation) {\r\n case 2:\r\n ctx.translate(width, 0);\r\n ctx.scale(-1, 1);\r\n break;\r\n\r\n case 3:\r\n ctx.translate(width, height);\r\n ctx.rotate(180*Math.PI/180);\r\n break;\r\n\r\n case 4:\r\n ctx.translate(0, height);\r\n ctx.scale(1, -1);\r\n break;\r\n\r\n case 5:\r\n canvas.width = height;\r\n canvas.height = width;\r\n ctx.rotate(90*Math.PI/180);\r\n ctx.scale(1, -1);\r\n break;\r\n\r\n case 6:\r\n canvas.width = height;\r\n canvas.height = width;\r\n ctx.rotate(90*Math.PI/180);\r\n ctx.translate(0, -height);\r\n break;\r\n\r\n case 7:\r\n canvas.width = height;\r\n canvas.height = width;\r\n ctx.rotate(-90*Math.PI/180);\r\n ctx.translate(-width, height);\r\n ctx.scale(1, -1);\r\n break;\r\n\r\n case 8:\r\n canvas.width = height;\r\n canvas.height = width;\r\n ctx.translate(0, width);\r\n ctx.rotate(-90*Math.PI/180);\r\n break;\r\n }\r\n ctx.drawImage(img, 0,0, width, height);\r\n ctx.restore();\r\n }\r\n\r\n /* Private Methods */\r\n function _create() {\r\n var self = this,\r\n contClass = 'croppie-container',\r\n customViewportClass = self.options.viewport.type ? 'cr-vp-' + self.options.viewport.type : null,\r\n boundary, img, viewport, overlay, bw, bh;\r\n\r\n self.options.useCanvas = self.options.enableOrientation || _hasExif.call(self);\r\n // Properties on class\r\n self.data = {};\r\n self.elements = {};\r\n\r\n boundary = self.elements.boundary = document.createElement('div');\r\n viewport = self.elements.viewport = document.createElement('div');\r\n img = self.elements.img = document.createElement('img');\r\n overlay = self.elements.overlay = document.createElement('div');\r\n\r\n if (self.options.useCanvas) {\r\n self.elements.canvas = document.createElement('canvas');\r\n self.elements.preview = self.elements.canvas;\r\n }\r\n else {\r\n self.elements.preview = img;\r\n }\r\n\r\n addClass(boundary, 'cr-boundary');\r\n boundary.setAttribute('aria-dropeffect', 'none');\r\n bw = self.options.boundary.width;\r\n bh = self.options.boundary.height;\r\n css(boundary, {\r\n width: (bw + (isNaN(bw) ? '' : 'px')),\r\n height: (bh + (isNaN(bh) ? '' : 'px'))\r\n });\r\n\r\n addClass(viewport, 'cr-viewport');\r\n if (customViewportClass) {\r\n addClass(viewport, customViewportClass);\r\n }\r\n css(viewport, {\r\n width: self.options.viewport.width + 'px',\r\n height: self.options.viewport.height + 'px'\r\n });\r\n viewport.setAttribute('tabindex', 0);\r\n\r\n addClass(self.elements.preview, 'cr-image');\r\n setAttributes(self.elements.preview, { 'alt': 'preview', 'aria-grabbed': 'false' });\r\n addClass(overlay, 'cr-overlay');\r\n\r\n self.element.appendChild(boundary);\r\n boundary.appendChild(self.elements.preview);\r\n boundary.appendChild(viewport);\r\n boundary.appendChild(overlay);\r\n\r\n addClass(self.element, contClass);\r\n if (self.options.customClass) {\r\n addClass(self.element, self.options.customClass);\r\n }\r\n\r\n _initDraggable.call(this);\r\n\r\n if (self.options.enableZoom) {\r\n _initializeZoom.call(self);\r\n }\r\n\r\n // if (self.options.enableOrientation) {\r\n // _initRotationControls.call(self);\r\n // }\r\n\r\n if (self.options.enableResize) {\r\n _initializeResize.call(self);\r\n }\r\n }\r\n\r\n // function _initRotationControls () {\r\n // var self = this,\r\n // wrap, btnLeft, btnRight, iLeft, iRight;\r\n\r\n // wrap = document.createElement('div');\r\n // self.elements.orientationBtnLeft = btnLeft = document.createElement('button');\r\n // self.elements.orientationBtnRight = btnRight = document.createElement('button');\r\n\r\n // wrap.appendChild(btnLeft);\r\n // wrap.appendChild(btnRight);\r\n\r\n // iLeft = document.createElement('i');\r\n // iRight = document.createElement('i');\r\n // btnLeft.appendChild(iLeft);\r\n // btnRight.appendChild(iRight);\r\n\r\n // addClass(wrap, 'cr-rotate-controls');\r\n // addClass(btnLeft, 'cr-rotate-l');\r\n // addClass(btnRight, 'cr-rotate-r');\r\n\r\n // self.elements.boundary.appendChild(wrap);\r\n\r\n // btnLeft.addEventListener('click', function () {\r\n // self.rotate(-90);\r\n // });\r\n // btnRight.addEventListener('click', function () {\r\n // self.rotate(90);\r\n // });\r\n // }\r\n\r\n function _hasExif() {\r\n return this.options.enableExif && window.EXIF;\r\n }\r\n\r\n function _initializeResize () {\r\n var self = this;\r\n var wrap = document.createElement('div');\r\n var isDragging = false;\r\n var direction;\r\n var originalX;\r\n var originalY;\r\n var minSize = 50;\r\n var maxWidth;\r\n var maxHeight;\r\n var vr;\r\n var hr;\r\n\r\n addClass(wrap, 'cr-resizer');\r\n css(wrap, {\r\n width: this.options.viewport.width + 'px',\r\n height: this.options.viewport.height + 'px'\r\n });\r\n\r\n if (this.options.resizeControls.height) {\r\n vr = document.createElement('div');\r\n addClass(vr, 'cr-resizer-vertical');\r\n wrap.appendChild(vr);\r\n }\r\n\r\n if (this.options.resizeControls.width) {\r\n hr = document.createElement('div');\r\n addClass(hr, 'cr-resizer-horisontal');\r\n wrap.appendChild(hr);\r\n }\r\n\r\n function mouseDown(ev) {\r\n if (ev.button !== undefined && ev.button !== 0) return;\r\n\r\n ev.preventDefault();\r\n if (isDragging) {\r\n return;\r\n }\r\n\r\n var overlayRect = self.elements.overlay.getBoundingClientRect();\r\n\r\n isDragging = true;\r\n originalX = ev.pageX;\r\n originalY = ev.pageY;\r\n direction = ev.currentTarget.className.indexOf('vertical') !== -1 ? 'v' : 'h';\r\n maxWidth = overlayRect.width;\r\n maxHeight = overlayRect.height;\r\n\r\n if (ev.touches) {\r\n var touches = ev.touches[0];\r\n originalX = touches.pageX;\r\n originalY = touches.pageY;\r\n }\r\n\r\n window.addEventListener('mousemove', mouseMove);\r\n window.addEventListener('touchmove', mouseMove);\r\n window.addEventListener('mouseup', mouseUp);\r\n window.addEventListener('touchend', mouseUp);\r\n document.body.style[CSS_USERSELECT] = 'none';\r\n }\r\n\r\n function mouseMove(ev) {\r\n var pageX = ev.pageX;\r\n var pageY = ev.pageY;\r\n\r\n ev.preventDefault();\r\n\r\n if (ev.touches) {\r\n var touches = ev.touches[0];\r\n pageX = touches.pageX;\r\n pageY = touches.pageY;\r\n }\r\n\r\n var deltaX = pageX - originalX;\r\n var deltaY = pageY - originalY;\r\n var newHeight = self.options.viewport.height + deltaY;\r\n var newWidth = self.options.viewport.width + deltaX;\r\n\r\n if (direction === 'v' && newHeight >= minSize && newHeight <= maxHeight) {\r\n css(wrap, {\r\n height: newHeight + 'px'\r\n });\r\n\r\n self.options.boundary.height += deltaY;\r\n css(self.elements.boundary, {\r\n height: self.options.boundary.height + 'px'\r\n });\r\n\r\n self.options.viewport.height += deltaY;\r\n css(self.elements.viewport, {\r\n height: self.options.viewport.height + 'px'\r\n });\r\n }\r\n else if (direction === 'h' && newWidth >= minSize && newWidth <= maxWidth) {\r\n css(wrap, {\r\n width: newWidth + 'px'\r\n });\r\n\r\n self.options.boundary.width += deltaX;\r\n css(self.elements.boundary, {\r\n width: self.options.boundary.width + 'px'\r\n });\r\n\r\n self.options.viewport.width += deltaX;\r\n css(self.elements.viewport, {\r\n width: self.options.viewport.width + 'px'\r\n });\r\n }\r\n\r\n _updateOverlay.call(self);\r\n _updateZoomLimits.call(self);\r\n _updateCenterPoint.call(self);\r\n _triggerUpdate.call(self);\r\n originalY = pageY;\r\n originalX = pageX;\r\n }\r\n\r\n function mouseUp() {\r\n isDragging = false;\r\n window.removeEventListener('mousemove', mouseMove);\r\n window.removeEventListener('touchmove', mouseMove);\r\n window.removeEventListener('mouseup', mouseUp);\r\n window.removeEventListener('touchend', mouseUp);\r\n document.body.style[CSS_USERSELECT] = '';\r\n }\r\n\r\n if (vr) {\r\n vr.addEventListener('mousedown', mouseDown);\r\n vr.addEventListener('touchstart', mouseDown);\r\n }\r\n\r\n if (hr) {\r\n hr.addEventListener('mousedown', mouseDown);\r\n hr.addEventListener('touchstart', mouseDown);\r\n }\r\n\r\n this.elements.boundary.appendChild(wrap);\r\n }\r\n\r\n function _setZoomerVal(v) {\r\n if (this.options.enableZoom) {\r\n var z = this.elements.zoomer,\r\n val = fix(v, 4);\r\n\r\n z.value = Math.max(parseFloat(z.min), Math.min(parseFloat(z.max), val)).toString();\r\n }\r\n }\r\n\r\n function _initializeZoom() {\r\n var self = this,\r\n wrap = self.elements.zoomerWrap = document.createElement('div'),\r\n zoomer = self.elements.zoomer = document.createElement('input');\r\n\r\n addClass(wrap, 'cr-slider-wrap');\r\n addClass(zoomer, 'cr-slider');\r\n zoomer.type = 'range';\r\n zoomer.step = '0.0001';\r\n zoomer.value = '1';\r\n zoomer.style.display = self.options.showZoomer ? '' : 'none';\r\n zoomer.setAttribute('aria-label', 'zoom');\r\n\r\n self.element.appendChild(wrap);\r\n wrap.appendChild(zoomer);\r\n\r\n self._currentZoom = 1;\r\n\r\n function change() {\r\n _onZoom.call(self, {\r\n value: parseFloat(zoomer.value),\r\n origin: new TransformOrigin(self.elements.preview),\r\n viewportRect: self.elements.viewport.getBoundingClientRect(),\r\n transform: Transform.parse(self.elements.preview)\r\n });\r\n }\r\n\r\n function scroll(ev) {\r\n var delta, targetZoom;\r\n\r\n if(self.options.mouseWheelZoom === 'ctrl' && ev.ctrlKey !== true){\r\n return 0; \r\n } else if (ev.wheelDelta) {\r\n delta = ev.wheelDelta / 1200; //wheelDelta min: -120 max: 120 // max x 10 x 2\r\n } else if (ev.deltaY) {\r\n delta = ev.deltaY / 1060; //deltaY min: -53 max: 53 // max x 10 x 2\r\n } else if (ev.detail) {\r\n delta = ev.detail / -60; //delta min: -3 max: 3 // max x 10 x 2\r\n } else {\r\n delta = 0;\r\n }\r\n\r\n targetZoom = self._currentZoom + (delta * self._currentZoom);\r\n\r\n ev.preventDefault();\r\n _setZoomerVal.call(self, targetZoom);\r\n change.call(self);\r\n }\r\n\r\n self.elements.zoomer.addEventListener('input', change);// this is being fired twice on keypress\r\n self.elements.zoomer.addEventListener('change', change);\r\n\r\n if (self.options.mouseWheelZoom) {\r\n self.elements.boundary.addEventListener('mousewheel', scroll);\r\n self.elements.boundary.addEventListener('DOMMouseScroll', scroll);\r\n }\r\n }\r\n\r\n function _onZoom(ui) {\r\n var self = this,\r\n transform = ui ? ui.transform : Transform.parse(self.elements.preview),\r\n vpRect = ui ? ui.viewportRect : self.elements.viewport.getBoundingClientRect(),\r\n origin = ui ? ui.origin : new TransformOrigin(self.elements.preview);\r\n\r\n function applyCss() {\r\n var transCss = {};\r\n transCss[CSS_TRANSFORM] = transform.toString();\r\n transCss[CSS_TRANS_ORG] = origin.toString();\r\n css(self.elements.preview, transCss);\r\n }\r\n\r\n self._currentZoom = ui ? ui.value : self._currentZoom;\r\n transform.scale = self._currentZoom;\r\n self.elements.zoomer.setAttribute('aria-valuenow', self._currentZoom);\r\n applyCss();\r\n\r\n if (self.options.enforceBoundary) {\r\n var boundaries = _getVirtualBoundaries.call(self, vpRect),\r\n transBoundaries = boundaries.translate,\r\n oBoundaries = boundaries.origin;\r\n\r\n if (transform.x >= transBoundaries.maxX) {\r\n origin.x = oBoundaries.minX;\r\n transform.x = transBoundaries.maxX;\r\n }\r\n\r\n if (transform.x <= transBoundaries.minX) {\r\n origin.x = oBoundaries.maxX;\r\n transform.x = transBoundaries.minX;\r\n }\r\n\r\n if (transform.y >= transBoundaries.maxY) {\r\n origin.y = oBoundaries.minY;\r\n transform.y = transBoundaries.maxY;\r\n }\r\n\r\n if (transform.y <= transBoundaries.minY) {\r\n origin.y = oBoundaries.maxY;\r\n transform.y = transBoundaries.minY;\r\n }\r\n }\r\n applyCss();\r\n _debouncedOverlay.call(self);\r\n _triggerUpdate.call(self);\r\n }\r\n\r\n function _getVirtualBoundaries(viewport) {\r\n var self = this,\r\n scale = self._currentZoom,\r\n vpWidth = viewport.width,\r\n vpHeight = viewport.height,\r\n centerFromBoundaryX = self.elements.boundary.clientWidth / 2,\r\n centerFromBoundaryY = self.elements.boundary.clientHeight / 2,\r\n imgRect = self.elements.preview.getBoundingClientRect(),\r\n curImgWidth = imgRect.width,\r\n curImgHeight = imgRect.height,\r\n halfWidth = vpWidth / 2,\r\n halfHeight = vpHeight / 2;\r\n\r\n var maxX = ((halfWidth / scale) - centerFromBoundaryX) * -1;\r\n var minX = maxX - ((curImgWidth * (1 / scale)) - (vpWidth * (1 / scale)));\r\n\r\n var maxY = ((halfHeight / scale) - centerFromBoundaryY) * -1;\r\n var minY = maxY - ((curImgHeight * (1 / scale)) - (vpHeight * (1 / scale)));\r\n\r\n var originMinX = (1 / scale) * halfWidth;\r\n var originMaxX = (curImgWidth * (1 / scale)) - originMinX;\r\n\r\n var originMinY = (1 / scale) * halfHeight;\r\n var originMaxY = (curImgHeight * (1 / scale)) - originMinY;\r\n\r\n return {\r\n translate: {\r\n maxX: maxX,\r\n minX: minX,\r\n maxY: maxY,\r\n minY: minY\r\n },\r\n origin: {\r\n maxX: originMaxX,\r\n minX: originMinX,\r\n maxY: originMaxY,\r\n minY: originMinY\r\n }\r\n };\r\n }\r\n\r\n function _updateCenterPoint(rotate) {\r\n var self = this,\r\n scale = self._currentZoom,\r\n data = self.elements.preview.getBoundingClientRect(),\r\n vpData = self.elements.viewport.getBoundingClientRect(),\r\n transform = Transform.parse(self.elements.preview.style[CSS_TRANSFORM]),\r\n pc = new TransformOrigin(self.elements.preview),\r\n top = (vpData.top - data.top) + (vpData.height / 2),\r\n left = (vpData.left - data.left) + (vpData.width / 2),\r\n center = {},\r\n adj = {};\r\n\r\n if (rotate) {\r\n var cx = pc.x;\r\n var cy = pc.y;\r\n var tx = transform.x;\r\n var ty = transform.y;\r\n\r\n center.y = cx;\r\n center.x = cy;\r\n transform.y = tx;\r\n transform.x = ty;\r\n }\r\n else {\r\n center.y = top / scale;\r\n center.x = left / scale;\r\n\r\n adj.y = (center.y - pc.y) * (1 - scale);\r\n adj.x = (center.x - pc.x) * (1 - scale);\r\n\r\n transform.x -= adj.x;\r\n transform.y -= adj.y;\r\n }\r\n\r\n var newCss = {};\r\n newCss[CSS_TRANS_ORG] = center.x + 'px ' + center.y + 'px';\r\n newCss[CSS_TRANSFORM] = transform.toString();\r\n css(self.elements.preview, newCss);\r\n }\r\n\r\n function _initDraggable() {\r\n var self = this,\r\n isDragging = false,\r\n originalX,\r\n originalY,\r\n originalDistance,\r\n vpRect,\r\n transform;\r\n\r\n function assignTransformCoordinates(deltaX, deltaY) {\r\n var imgRect = self.elements.preview.getBoundingClientRect(),\r\n top = transform.y + deltaY,\r\n left = transform.x + deltaX;\r\n\r\n if (self.options.enforceBoundary) {\r\n if (vpRect.top > imgRect.top + deltaY && vpRect.bottom < imgRect.bottom + deltaY) {\r\n transform.y = top;\r\n }\r\n\r\n if (vpRect.left > imgRect.left + deltaX && vpRect.right < imgRect.right + deltaX) {\r\n transform.x = left;\r\n }\r\n }\r\n else {\r\n transform.y = top;\r\n transform.x = left;\r\n }\r\n }\r\n\r\n function toggleGrabState(isDragging) {\r\n self.elements.preview.setAttribute('aria-grabbed', isDragging);\r\n self.elements.boundary.setAttribute('aria-dropeffect', isDragging? 'move': 'none');\r\n }\r\n\r\n function keyDown(ev) {\r\n var LEFT_ARROW = 37,\r\n UP_ARROW = 38,\r\n RIGHT_ARROW = 39,\r\n DOWN_ARROW = 40;\r\n\r\n if (ev.shiftKey && (ev.keyCode === UP_ARROW || ev.keyCode === DOWN_ARROW)) {\r\n var zoom;\r\n if (ev.keyCode === UP_ARROW) {\r\n zoom = parseFloat(self.elements.zoomer.value) + parseFloat(self.elements.zoomer.step)\r\n }\r\n else {\r\n zoom = parseFloat(self.elements.zoomer.value) - parseFloat(self.elements.zoomer.step)\r\n }\r\n self.setZoom(zoom);\r\n }\r\n else if (self.options.enableKeyMovement && (ev.keyCode >= 37 && ev.keyCode <= 40)) {\r\n ev.preventDefault();\r\n var movement = parseKeyDown(ev.keyCode);\r\n\r\n transform = Transform.parse(self.elements.preview);\r\n document.body.style[CSS_USERSELECT] = 'none';\r\n vpRect = self.elements.viewport.getBoundingClientRect();\r\n keyMove(movement);\r\n }\r\n\r\n function parseKeyDown(key) {\r\n switch (key) {\r\n case LEFT_ARROW:\r\n return [1, 0];\r\n case UP_ARROW:\r\n return [0, 1];\r\n case RIGHT_ARROW:\r\n return [-1, 0];\r\n case DOWN_ARROW:\r\n return [0, -1];\r\n }\r\n }\r\n }\r\n\r\n function keyMove(movement) {\r\n var deltaX = movement[0],\r\n deltaY = movement[1],\r\n newCss = {};\r\n\r\n assignTransformCoordinates(deltaX, deltaY);\r\n\r\n newCss[CSS_TRANSFORM] = transform.toString();\r\n css(self.elements.preview, newCss);\r\n _updateOverlay.call(self);\r\n document.body.style[CSS_USERSELECT] = '';\r\n _updateCenterPoint.call(self);\r\n _triggerUpdate.call(self);\r\n originalDistance = 0;\r\n }\r\n\r\n function mouseDown(ev) {\r\n if (ev.button !== undefined && ev.button !== 0) return;\r\n\r\n ev.preventDefault();\r\n if (isDragging) return;\r\n isDragging = true;\r\n originalX = ev.pageX;\r\n originalY = ev.pageY;\r\n\r\n if (ev.touches) {\r\n var touches = ev.touches[0];\r\n originalX = touches.pageX;\r\n originalY = touches.pageY;\r\n }\r\n toggleGrabState(isDragging);\r\n transform = Transform.parse(self.elements.preview);\r\n window.addEventListener('mousemove', mouseMove);\r\n window.addEventListener('touchmove', mouseMove);\r\n window.addEventListener('mouseup', mouseUp);\r\n window.addEventListener('touchend', mouseUp);\r\n document.body.style[CSS_USERSELECT] = 'none';\r\n vpRect = self.elements.viewport.getBoundingClientRect();\r\n }\r\n\r\n function mouseMove(ev) {\r\n ev.preventDefault();\r\n var pageX = ev.pageX,\r\n pageY = ev.pageY;\r\n\r\n if (ev.touches) {\r\n var touches = ev.touches[0];\r\n pageX = touches.pageX;\r\n pageY = touches.pageY;\r\n }\r\n\r\n var deltaX = pageX - originalX,\r\n deltaY = pageY - originalY,\r\n newCss = {};\r\n\r\n if (ev.type === 'touchmove') {\r\n if (ev.touches.length > 1) {\r\n var touch1 = ev.touches[0];\r\n var touch2 = ev.touches[1];\r\n var dist = Math.sqrt((touch1.pageX - touch2.pageX) * (touch1.pageX - touch2.pageX) + (touch1.pageY - touch2.pageY) * (touch1.pageY - touch2.pageY));\r\n\r\n if (!originalDistance) {\r\n originalDistance = dist / self._currentZoom;\r\n }\r\n\r\n var scale = dist / originalDistance;\r\n\r\n _setZoomerVal.call(self, scale);\r\n dispatchChange(self.elements.zoomer);\r\n return;\r\n }\r\n }\r\n\r\n assignTransformCoordinates(deltaX, deltaY);\r\n\r\n newCss[CSS_TRANSFORM] = transform.toString();\r\n css(self.elements.preview, newCss);\r\n _updateOverlay.call(self);\r\n originalY = pageY;\r\n originalX = pageX;\r\n }\r\n\r\n function mouseUp() {\r\n isDragging = false;\r\n toggleGrabState(isDragging);\r\n window.removeEventListener('mousemove', mouseMove);\r\n window.removeEventListener('touchmove', mouseMove);\r\n window.removeEventListener('mouseup', mouseUp);\r\n window.removeEventListener('touchend', mouseUp);\r\n document.body.style[CSS_USERSELECT] = '';\r\n _updateCenterPoint.call(self);\r\n _triggerUpdate.call(self);\r\n originalDistance = 0;\r\n }\r\n\r\n self.elements.overlay.addEventListener('mousedown', mouseDown);\r\n self.elements.viewport.addEventListener('keydown', keyDown);\r\n self.elements.overlay.addEventListener('touchstart', mouseDown);\r\n }\r\n\r\n function _updateOverlay() {\r\n if (!this.elements) return; // since this is debounced, it can be fired after destroy\r\n var self = this,\r\n boundRect = self.elements.boundary.getBoundingClientRect(),\r\n imgData = self.elements.preview.getBoundingClientRect();\r\n\r\n css(self.elements.overlay, {\r\n width: imgData.width + 'px',\r\n height: imgData.height + 'px',\r\n top: (imgData.top - boundRect.top) + 'px',\r\n left: (imgData.left - boundRect.left) + 'px'\r\n });\r\n }\r\n var _debouncedOverlay = debounce(_updateOverlay, 500);\r\n\r\n function _triggerUpdate() {\r\n var self = this,\r\n data = self.get();\r\n\r\n if (!_isVisible.call(self)) {\r\n return;\r\n }\r\n\r\n self.options.update.call(self, data);\r\n if (self.$ && typeof Prototype === 'undefined') {\r\n self.$(self.element).trigger('update.croppie', data);\r\n }\r\n else {\r\n var ev;\r\n if (window.CustomEvent) {\r\n ev = new CustomEvent('update', { detail: data });\r\n } else {\r\n ev = document.createEvent('CustomEvent');\r\n ev.initCustomEvent('update', true, true, data);\r\n }\r\n\r\n self.element.dispatchEvent(ev);\r\n }\r\n }\r\n\r\n function _isVisible() {\r\n return this.elements.preview.offsetHeight > 0 && this.elements.preview.offsetWidth > 0;\r\n }\r\n\r\n function _updatePropertiesFromImage() {\r\n var self = this,\r\n initialZoom = 1,\r\n cssReset = {},\r\n img = self.elements.preview,\r\n imgData,\r\n transformReset = new Transform(0, 0, initialZoom),\r\n originReset = new TransformOrigin(),\r\n isVisible = _isVisible.call(self);\r\n\r\n if (!isVisible || self.data.bound) {// if the croppie isn't visible or it doesn't need binding\r\n return;\r\n }\r\n\r\n self.data.bound = true;\r\n cssReset[CSS_TRANSFORM] = transformReset.toString();\r\n cssReset[CSS_TRANS_ORG] = originReset.toString();\r\n cssReset['opacity'] = 1;\r\n css(img, cssReset);\r\n\r\n imgData = self.elements.preview.getBoundingClientRect();\r\n\r\n self._originalImageWidth = imgData.width;\r\n self._originalImageHeight = imgData.height;\r\n self.data.orientation = getExifOrientation(self.elements.img);\r\n\r\n if (self.options.enableZoom) {\r\n _updateZoomLimits.call(self, true);\r\n }\r\n else {\r\n self._currentZoom = initialZoom;\r\n }\r\n\r\n transformReset.scale = self._currentZoom;\r\n cssReset[CSS_TRANSFORM] = transformReset.toString();\r\n css(img, cssReset);\r\n\r\n if (self.data.points.length) {\r\n _bindPoints.call(self, self.data.points);\r\n }\r\n else {\r\n _centerImage.call(self);\r\n }\r\n\r\n _updateCenterPoint.call(self);\r\n _updateOverlay.call(self);\r\n }\r\n\r\n function _updateZoomLimits (initial) {\r\n var self = this,\r\n minZoom = Math.max(self.options.minZoom, 0) || 0,\r\n maxZoom = self.options.maxZoom || 1.5,\r\n initialZoom,\r\n defaultInitialZoom,\r\n zoomer = self.elements.zoomer,\r\n scale = parseFloat(zoomer.value),\r\n boundaryData = self.elements.boundary.getBoundingClientRect(),\r\n imgData = naturalImageDimensions(self.elements.img, self.data.orientation),\r\n vpData = self.elements.viewport.getBoundingClientRect(),\r\n minW,\r\n minH;\r\n if (self.options.enforceBoundary) {\r\n minW = vpData.width / imgData.width;\r\n minH = vpData.height / imgData.height;\r\n minZoom = Math.max(minW, minH);\r\n }\r\n\r\n if (minZoom >= maxZoom) {\r\n maxZoom = minZoom + 1;\r\n }\r\n\r\n zoomer.min = fix(minZoom, 4);\r\n zoomer.max = fix(maxZoom, 4);\r\n \r\n if (!initial && (scale < zoomer.min || scale > zoomer.max)) {\r\n _setZoomerVal.call(self, scale < zoomer.min ? zoomer.min : zoomer.max);\r\n }\r\n else if (initial) {\r\n defaultInitialZoom = Math.max((boundaryData.width / imgData.width), (boundaryData.height / imgData.height));\r\n initialZoom = self.data.boundZoom !== null ? self.data.boundZoom : defaultInitialZoom;\r\n _setZoomerVal.call(self, initialZoom);\r\n }\r\n\r\n dispatchChange(zoomer);\r\n }\r\n\r\n function _bindPoints(points) {\r\n if (points.length !== 4) {\r\n throw \"Croppie - Invalid number of points supplied: \" + points;\r\n }\r\n var self = this,\r\n pointsWidth = points[2] - points[0],\r\n // pointsHeight = points[3] - points[1],\r\n vpData = self.elements.viewport.getBoundingClientRect(),\r\n boundRect = self.elements.boundary.getBoundingClientRect(),\r\n vpOffset = {\r\n left: vpData.left - boundRect.left,\r\n top: vpData.top - boundRect.top\r\n },\r\n scale = vpData.width / pointsWidth,\r\n originTop = points[1],\r\n originLeft = points[0],\r\n transformTop = (-1 * points[1]) + vpOffset.top,\r\n transformLeft = (-1 * points[0]) + vpOffset.left,\r\n newCss = {};\r\n\r\n newCss[CSS_TRANS_ORG] = originLeft + 'px ' + originTop + 'px';\r\n newCss[CSS_TRANSFORM] = new Transform(transformLeft, transformTop, scale).toString();\r\n css(self.elements.preview, newCss);\r\n\r\n _setZoomerVal.call(self, scale);\r\n self._currentZoom = scale;\r\n }\r\n\r\n function _centerImage() {\r\n var self = this,\r\n imgDim = self.elements.preview.getBoundingClientRect(),\r\n vpDim = self.elements.viewport.getBoundingClientRect(),\r\n boundDim = self.elements.boundary.getBoundingClientRect(),\r\n vpLeft = vpDim.left - boundDim.left,\r\n vpTop = vpDim.top - boundDim.top,\r\n w = vpLeft - ((imgDim.width - vpDim.width) / 2),\r\n h = vpTop - ((imgDim.height - vpDim.height) / 2),\r\n transform = new Transform(w, h, self._currentZoom);\r\n\r\n css(self.elements.preview, CSS_TRANSFORM, transform.toString());\r\n }\r\n\r\n function _transferImageToCanvas(customOrientation) {\r\n var self = this,\r\n canvas = self.elements.canvas,\r\n img = self.elements.img,\r\n ctx = canvas.getContext('2d');\r\n\r\n ctx.clearRect(0, 0, canvas.width, canvas.height);\r\n canvas.width = img.width;\r\n canvas.height = img.height;\r\n\r\n var orientation = self.options.enableOrientation && customOrientation || getExifOrientation(img);\r\n drawCanvas(canvas, img, orientation);\r\n }\r\n\r\n function _getCanvas(data) {\r\n var self = this,\r\n points = data.points,\r\n left = num(points[0]),\r\n top = num(points[1]),\r\n right = num(points[2]),\r\n bottom = num(points[3]),\r\n width = right-left,\r\n height = bottom-top,\r\n circle = data.circle,\r\n canvas = document.createElement('canvas'),\r\n ctx = canvas.getContext('2d'),\r\n startX = 0,\r\n startY = 0,\r\n canvasWidth = data.outputWidth || width,\r\n canvasHeight = data.outputHeight || height;\r\n\r\n canvas.width = canvasWidth;\r\n canvas.height = canvasHeight;\r\n\r\n if (data.backgroundColor) {\r\n ctx.fillStyle = data.backgroundColor;\r\n ctx.fillRect(0, 0, canvasWidth, canvasHeight);\r\n }\r\n\r\n // By default assume we're going to draw the entire\r\n // source image onto the destination canvas.\r\n var sx = left,\r\n sy = top,\r\n sWidth = width,\r\n sHeight = height,\r\n dx = 0,\r\n dy = 0,\r\n dWidth = canvasWidth,\r\n dHeight = canvasHeight;\r\n\r\n //\r\n // Do not go outside of the original image's bounds along the x-axis.\r\n // Handle translations when projecting onto the destination canvas.\r\n //\r\n\r\n // The smallest possible source x-position is 0.\r\n if (left < 0) {\r\n sx = 0;\r\n dx = (Math.abs(left) / width) * canvasWidth;\r\n }\r\n\r\n // The largest possible source width is the original image's width.\r\n if (sWidth + sx > self._originalImageWidth) {\r\n sWidth = self._originalImageWidth - sx;\r\n dWidth = (sWidth / width) * canvasWidth;\r\n }\r\n\r\n //\r\n // Do not go outside of the original image's bounds along the y-axis.\r\n //\r\n\r\n // The smallest possible source y-position is 0.\r\n if (top < 0) {\r\n sy = 0;\r\n dy = (Math.abs(top) / height) * canvasHeight;\r\n }\r\n\r\n // The largest possible source height is the original image's height.\r\n if (sHeight + sy > self._originalImageHeight) {\r\n sHeight = self._originalImageHeight - sy;\r\n dHeight = (sHeight / height) * canvasHeight;\r\n }\r\n\r\n // console.table({ left, right, top, bottom, canvasWidth, canvasHeight, width, height, startX, startY, circle, sx, sy, dx, dy, sWidth, sHeight, dWidth, dHeight });\r\n\r\n ctx.drawImage(this.elements.preview, sx, sy, sWidth, sHeight, dx, dy, dWidth, dHeight);\r\n if (circle) {\r\n ctx.fillStyle = '#fff';\r\n ctx.globalCompositeOperation = 'destination-in';\r\n ctx.beginPath();\r\n ctx.arc(canvas.width / 2, canvas.height / 2, canvas.width / 2, 0, Math.PI * 2, true);\r\n ctx.closePath();\r\n ctx.fill();\r\n }\r\n return canvas;\r\n }\r\n\r\n function _getHtmlResult(data) {\r\n var points = data.points,\r\n div = document.createElement('div'),\r\n img = document.createElement('img'),\r\n width = points[2] - points[0],\r\n height = points[3] - points[1];\r\n\r\n addClass(div, 'croppie-result');\r\n div.appendChild(img);\r\n css(img, {\r\n left: (-1 * points[0]) + 'px',\r\n top: (-1 * points[1]) + 'px'\r\n });\r\n img.src = data.url;\r\n css(div, {\r\n width: width + 'px',\r\n height: height + 'px'\r\n });\r\n\r\n return div;\r\n }\r\n\r\n function _getBase64Result(data) {\r\n return _getCanvas.call(this, data).toDataURL(data.format, data.quality);\r\n }\r\n\r\n function _getBlobResult(data) {\r\n var self = this;\r\n return new Promise(function (resolve) {\r\n _getCanvas.call(self, data).toBlob(function (blob) {\r\n resolve(blob);\r\n }, data.format, data.quality);\r\n });\r\n }\r\n\r\n function _replaceImage(img) {\r\n if (this.elements.img.parentNode) {\r\n Array.prototype.forEach.call(this.elements.img.classList, function(c) { img.classList.add(c); });\r\n this.elements.img.parentNode.replaceChild(img, this.elements.img);\r\n this.elements.preview = img; // if the img is attached to the DOM, they're not using the canvas\r\n }\r\n this.elements.img = img;\r\n }\r\n\r\n function _bind(options, cb) {\r\n var self = this,\r\n url,\r\n points = [],\r\n zoom = null,\r\n hasExif = _hasExif.call(self);\r\n\r\n if (typeof (options) === 'string') {\r\n url = options;\r\n options = {};\r\n }\r\n else if (Array.isArray(options)) {\r\n points = options.slice();\r\n }\r\n else if (typeof (options) === 'undefined' && self.data.url) { //refreshing\r\n _updatePropertiesFromImage.call(self);\r\n _triggerUpdate.call(self);\r\n return null;\r\n }\r\n else {\r\n url = options.url;\r\n points = options.points || [];\r\n zoom = typeof(options.zoom) === 'undefined' ? null : options.zoom;\r\n }\r\n\r\n self.data.bound = false;\r\n self.data.url = url || self.data.url;\r\n self.data.boundZoom = zoom;\r\n\r\n return loadImage(url, hasExif).then(function (img) {\r\n _replaceImage.call(self, img);\r\n if (!points.length) {\r\n var natDim = naturalImageDimensions(img);\r\n var rect = self.elements.viewport.getBoundingClientRect();\r\n var aspectRatio = rect.width / rect.height;\r\n var imgAspectRatio = natDim.width / natDim.height;\r\n var width, height;\r\n\r\n if (imgAspectRatio > aspectRatio) {\r\n height = natDim.height;\r\n width = height * aspectRatio;\r\n }\r\n else {\r\n width = natDim.width;\r\n height = natDim.height / aspectRatio;\r\n }\r\n\r\n var x0 = (natDim.width - width) / 2;\r\n var y0 = (natDim.height - height) / 2;\r\n var x1 = x0 + width;\r\n var y1 = y0 + height;\r\n self.data.points = [x0, y0, x1, y1];\r\n }\r\n else if (self.options.relative) {\r\n points = [\r\n points[0] * img.naturalWidth / 100,\r\n points[1] * img.naturalHeight / 100,\r\n points[2] * img.naturalWidth / 100,\r\n points[3] * img.naturalHeight / 100\r\n ];\r\n }\r\n\r\n self.data.points = points.map(function (p) {\r\n return parseFloat(p);\r\n });\r\n if (self.options.useCanvas) {\r\n _transferImageToCanvas.call(self, options.orientation);\r\n }\r\n _updatePropertiesFromImage.call(self);\r\n _triggerUpdate.call(self);\r\n cb && cb();\r\n });\r\n }\r\n\r\n function fix(v, decimalPoints) {\r\n return parseFloat(v).toFixed(decimalPoints || 0);\r\n }\r\n\r\n function _get() {\r\n var self = this,\r\n imgData = self.elements.preview.getBoundingClientRect(),\r\n vpData = self.elements.viewport.getBoundingClientRect(),\r\n x1 = vpData.left - imgData.left,\r\n y1 = vpData.top - imgData.top,\r\n widthDiff = (vpData.width - self.elements.viewport.offsetWidth) / 2, //border\r\n heightDiff = (vpData.height - self.elements.viewport.offsetHeight) / 2,\r\n x2 = x1 + self.elements.viewport.offsetWidth + widthDiff,\r\n y2 = y1 + self.elements.viewport.offsetHeight + heightDiff,\r\n scale = self._currentZoom;\r\n\r\n if (scale === Infinity || isNaN(scale)) {\r\n scale = 1;\r\n }\r\n\r\n var max = self.options.enforceBoundary ? 0 : Number.NEGATIVE_INFINITY;\r\n x1 = Math.max(max, x1 / scale);\r\n y1 = Math.max(max, y1 / scale);\r\n x2 = Math.max(max, x2 / scale);\r\n y2 = Math.max(max, y2 / scale);\r\n\r\n return {\r\n points: [fix(x1), fix(y1), fix(x2), fix(y2)],\r\n zoom: scale,\r\n orientation: self.data.orientation\r\n };\r\n }\r\n\r\n var RESULT_DEFAULTS = {\r\n type: 'canvas',\r\n format: 'png',\r\n quality: 1\r\n },\r\n RESULT_FORMATS = ['jpeg', 'webp', 'png'];\r\n\r\n function _result(options) {\r\n var self = this,\r\n data = _get.call(self),\r\n opts = deepExtend(clone(RESULT_DEFAULTS), clone(options)),\r\n resultType = (typeof (options) === 'string' ? options : (opts.type || 'base64')),\r\n size = opts.size || 'viewport',\r\n format = opts.format,\r\n quality = opts.quality,\r\n backgroundColor = opts.backgroundColor,\r\n circle = typeof opts.circle === 'boolean' ? opts.circle : (self.options.viewport.type === 'circle'),\r\n vpRect = self.elements.viewport.getBoundingClientRect(),\r\n ratio = vpRect.width / vpRect.height,\r\n prom;\r\n\r\n if (size === 'viewport') {\r\n data.outputWidth = vpRect.width;\r\n data.outputHeight = vpRect.height;\r\n } else if (typeof size === 'object') {\r\n if (size.width && size.height) {\r\n data.outputWidth = size.width;\r\n data.outputHeight = size.height;\r\n } else if (size.width) {\r\n data.outputWidth = size.width;\r\n data.outputHeight = size.width / ratio;\r\n } else if (size.height) {\r\n data.outputWidth = size.height * ratio;\r\n data.outputHeight = size.height;\r\n }\r\n }\r\n\r\n if (RESULT_FORMATS.indexOf(format) > -1) {\r\n data.format = 'image/' + format;\r\n data.quality = quality;\r\n }\r\n\r\n data.circle = circle;\r\n data.url = self.data.url;\r\n data.backgroundColor = backgroundColor;\r\n\r\n prom = new Promise(function (resolve) {\r\n switch(resultType.toLowerCase())\r\n {\r\n case 'rawcanvas':\r\n resolve(_getCanvas.call(self, data));\r\n break;\r\n case 'canvas':\r\n case 'base64':\r\n resolve(_getBase64Result.call(self, data));\r\n break;\r\n case 'blob':\r\n _getBlobResult.call(self, data).then(resolve);\r\n break;\r\n default:\r\n resolve(_getHtmlResult.call(self, data));\r\n break;\r\n }\r\n });\r\n return prom;\r\n }\r\n\r\n function _refresh() {\r\n _updatePropertiesFromImage.call(this);\r\n }\r\n\r\n function _rotate(deg) {\r\n if (!this.options.useCanvas || !this.options.enableOrientation) {\r\n throw 'Croppie: Cannot rotate without enableOrientation && EXIF.js included';\r\n }\r\n\r\n var self = this,\r\n canvas = self.elements.canvas;\r\n\r\n self.data.orientation = getExifOffset(self.data.orientation, deg);\r\n drawCanvas(canvas, self.elements.img, self.data.orientation);\r\n _updateCenterPoint.call(self, true);\r\n _updateZoomLimits.call(self);\r\n }\r\n\r\n function _destroy() {\r\n var self = this;\r\n self.element.removeChild(self.elements.boundary);\r\n removeClass(self.element, 'croppie-container');\r\n if (self.options.enableZoom) {\r\n self.element.removeChild(self.elements.zoomerWrap);\r\n }\r\n delete self.elements;\r\n }\r\n\r\n if (window.jQuery) {\r\n var $ = window.jQuery;\r\n $.fn.croppie = function (opts) {\r\n var ot = typeof opts;\r\n\r\n if (ot === 'string') {\r\n var args = Array.prototype.slice.call(arguments, 1);\r\n var singleInst = $(this).data('croppie');\r\n\r\n if (opts === 'get') {\r\n return singleInst.get();\r\n }\r\n else if (opts === 'result') {\r\n return singleInst.result.apply(singleInst, args);\r\n }\r\n else if (opts === 'bind') {\r\n return singleInst.bind.apply(singleInst, args);\r\n }\r\n\r\n return this.each(function () {\r\n var i = $(this).data('croppie');\r\n if (!i) return;\r\n\r\n var method = i[opts];\r\n if ($.isFunction(method)) {\r\n method.apply(i, args);\r\n if (opts === 'destroy') {\r\n $(this).removeData('croppie');\r\n }\r\n }\r\n else {\r\n throw 'Croppie ' + opts + ' method not found';\r\n }\r\n });\r\n }\r\n else {\r\n return this.each(function () {\r\n var i = new Croppie(this, opts);\r\n i.$ = $;\r\n $(this).data('croppie', i);\r\n });\r\n }\r\n };\r\n }\r\n\r\n function Croppie(element, opts) {\r\n if (element.className.indexOf('croppie-container') > -1) {\r\n throw new Error(\"Croppie: Can't initialize croppie more than once\");\r\n }\r\n this.element = element;\r\n this.options = deepExtend(clone(Croppie.defaults), opts);\r\n\r\n if (this.element.tagName.toLowerCase() === 'img') {\r\n var origImage = this.element;\r\n addClass(origImage, 'cr-original-image');\r\n setAttributes(origImage, {'aria-hidden' : 'true', 'alt' : '' });\r\n var replacementDiv = document.createElement('div');\r\n this.element.parentNode.appendChild(replacementDiv);\r\n replacementDiv.appendChild(origImage);\r\n this.element = replacementDiv;\r\n this.options.url = this.options.url || origImage.src;\r\n }\r\n\r\n _create.call(this);\r\n if (this.options.url) {\r\n var bindOpts = {\r\n url: this.options.url,\r\n points: this.options.points\r\n };\r\n delete this.options['url'];\r\n delete this.options['points'];\r\n _bind.call(this, bindOpts);\r\n }\r\n }\r\n\r\n Croppie.defaults = {\r\n viewport: {\r\n width: 100,\r\n height: 100,\r\n type: 'square'\r\n },\r\n boundary: { },\r\n orientationControls: {\r\n enabled: true,\r\n leftClass: '',\r\n rightClass: ''\r\n },\r\n resizeControls: {\r\n width: true,\r\n height: true\r\n },\r\n customClass: '',\r\n showZoomer: true,\r\n enableZoom: true,\r\n enableResize: false,\r\n mouseWheelZoom: true,\r\n enableExif: false,\r\n enforceBoundary: true,\r\n enableOrientation: false,\r\n enableKeyMovement: true,\r\n update: function () { }\r\n };\r\n\r\n Croppie.globals = {\r\n translate: 'translate3d'\r\n };\r\n\r\n deepExtend(Croppie.prototype, {\r\n bind: function (options, cb) {\r\n return _bind.call(this, options, cb);\r\n },\r\n get: function () {\r\n var data = _get.call(this);\r\n var points = data.points;\r\n if (this.options.relative) {\r\n points[0] /= this.elements.img.naturalWidth / 100;\r\n points[1] /= this.elements.img.naturalHeight / 100;\r\n points[2] /= this.elements.img.naturalWidth / 100;\r\n points[3] /= this.elements.img.naturalHeight / 100;\r\n }\r\n return data;\r\n },\r\n result: function (type) {\r\n return _result.call(this, type);\r\n },\r\n refresh: function () {\r\n return _refresh.call(this);\r\n },\r\n setZoom: function (v) {\r\n _setZoomerVal.call(this, v);\r\n dispatchChange(this.elements.zoomer);\r\n },\r\n rotate: function (deg) {\r\n _rotate.call(this, deg);\r\n },\r\n destroy: function () {\r\n return _destroy.call(this);\r\n }\r\n });\r\n return Croppie;\r\n}));\r\n","var scope = (typeof global !== \"undefined\" && global) ||\n (typeof self !== \"undefined\" && self) ||\n window;\nvar apply = Function.prototype.apply;\n\n// DOM APIs, for completeness\n\nexports.setTimeout = function() {\n return new Timeout(apply.call(setTimeout, scope, arguments), clearTimeout);\n};\nexports.setInterval = function() {\n return new Timeout(apply.call(setInterval, scope, arguments), clearInterval);\n};\nexports.clearTimeout =\nexports.clearInterval = function(timeout) {\n if (timeout) {\n timeout.close();\n }\n};\n\nfunction Timeout(id, clearFn) {\n this._id = id;\n this._clearFn = clearFn;\n}\nTimeout.prototype.unref = Timeout.prototype.ref = function() {};\nTimeout.prototype.close = function() {\n this._clearFn.call(scope, this._id);\n};\n\n// Does not start the time, just sets up the members needed.\nexports.enroll = function(item, msecs) {\n clearTimeout(item._idleTimeoutId);\n item._idleTimeout = msecs;\n};\n\nexports.unenroll = function(item) {\n clearTimeout(item._idleTimeoutId);\n item._idleTimeout = -1;\n};\n\nexports._unrefActive = exports.active = function(item) {\n clearTimeout(item._idleTimeoutId);\n\n var msecs = item._idleTimeout;\n if (msecs >= 0) {\n item._idleTimeoutId = setTimeout(function onTimeout() {\n if (item._onTimeout)\n item._onTimeout();\n }, msecs);\n }\n};\n\n// setimmediate attaches itself to the global object\nrequire(\"setimmediate\");\n// On some exotic environments, it's not clear which object `setimmediate` was\n// able to install onto. Search each possibility in the same order as the\n// `setimmediate` library.\nexports.setImmediate = (typeof self !== \"undefined\" && self.setImmediate) ||\n (typeof global !== \"undefined\" && global.setImmediate) ||\n (this && this.setImmediate);\nexports.clearImmediate = (typeof self !== \"undefined\" && self.clearImmediate) ||\n (typeof global !== \"undefined\" && global.clearImmediate) ||\n (this && this.clearImmediate);\n","(function (global, undefined) {\n \"use strict\";\n\n if (global.setImmediate) {\n return;\n }\n\n var nextHandle = 1; // Spec says greater than zero\n var tasksByHandle = {};\n var currentlyRunningATask = false;\n var doc = global.document;\n var registerImmediate;\n\n function setImmediate(callback) {\n // Callback can either be a function or a string\n if (typeof callback !== \"function\") {\n callback = new Function(\"\" + callback);\n }\n // Copy function arguments\n var args = new Array(arguments.length - 1);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i + 1];\n }\n // Store and register the task\n var task = { callback: callback, args: args };\n tasksByHandle[nextHandle] = task;\n registerImmediate(nextHandle);\n return nextHandle++;\n }\n\n function clearImmediate(handle) {\n delete tasksByHandle[handle];\n }\n\n function run(task) {\n var callback = task.callback;\n var args = task.args;\n switch (args.length) {\n case 0:\n callback();\n break;\n case 1:\n callback(args[0]);\n break;\n case 2:\n callback(args[0], args[1]);\n break;\n case 3:\n callback(args[0], args[1], args[2]);\n break;\n default:\n callback.apply(undefined, args);\n break;\n }\n }\n\n function runIfPresent(handle) {\n // From the spec: \"Wait until any invocations of this algorithm started before this one have completed.\"\n // So if we're currently running a task, we'll need to delay this invocation.\n if (currentlyRunningATask) {\n // Delay by doing a setTimeout. setImmediate was tried instead, but in Firefox 7 it generated a\n // \"too much recursion\" error.\n setTimeout(runIfPresent, 0, handle);\n } else {\n var task = tasksByHandle[handle];\n if (task) {\n currentlyRunningATask = true;\n try {\n run(task);\n } finally {\n clearImmediate(handle);\n currentlyRunningATask = false;\n }\n }\n }\n }\n\n function installNextTickImplementation() {\n registerImmediate = function(handle) {\n process.nextTick(function () { runIfPresent(handle); });\n };\n }\n\n function canUsePostMessage() {\n // The test against `importScripts` prevents this implementation from being installed inside a web worker,\n // where `global.postMessage` means something completely different and can't be used for this purpose.\n if (global.postMessage && !global.importScripts) {\n var postMessageIsAsynchronous = true;\n var oldOnMessage = global.onmessage;\n global.onmessage = function() {\n postMessageIsAsynchronous = false;\n };\n global.postMessage(\"\", \"*\");\n global.onmessage = oldOnMessage;\n return postMessageIsAsynchronous;\n }\n }\n\n function installPostMessageImplementation() {\n // Installs an event handler on `global` for the `message` event: see\n // * https://developer.mozilla.org/en/DOM/window.postMessage\n // * http://www.whatwg.org/specs/web-apps/current-work/multipage/comms.html#crossDocumentMessages\n\n var messagePrefix = \"setImmediate$\" + Math.random() + \"$\";\n var onGlobalMessage = function(event) {\n if (event.source === global &&\n typeof event.data === \"string\" &&\n event.data.indexOf(messagePrefix) === 0) {\n runIfPresent(+event.data.slice(messagePrefix.length));\n }\n };\n\n if (global.addEventListener) {\n global.addEventListener(\"message\", onGlobalMessage, false);\n } else {\n global.attachEvent(\"onmessage\", onGlobalMessage);\n }\n\n registerImmediate = function(handle) {\n global.postMessage(messagePrefix + handle, \"*\");\n };\n }\n\n function installMessageChannelImplementation() {\n var channel = new MessageChannel();\n channel.port1.onmessage = function(event) {\n var handle = event.data;\n runIfPresent(handle);\n };\n\n registerImmediate = function(handle) {\n channel.port2.postMessage(handle);\n };\n }\n\n function installReadyStateChangeImplementation() {\n var html = doc.documentElement;\n registerImmediate = function(handle) {\n // Create a \ No newline at end of file +Telegram
\ No newline at end of file diff --git a/dist/main.4bb9f6f0899a58512452.js b/dist/main.4bb9f6f0899a58512452.js new file mode 100644 index 00000000..6c14973d --- /dev/null +++ b/dist/main.4bb9f6f0899a58512452.js @@ -0,0 +1,2 @@ +!function(e){function t(t){for(var n,r,o=t[0],c=t[1],d=0,a=[];d=0&&O(e[t]);t--);return t+17&&console.warn(`[Teact] Slow component render: ${n}, ${Math.round(t)} ms`),w[n].renderTimes.push(t),w[n].renderCount++}}catch(t){Object(d.a)(t),u=e.renderedValue}if(e.isMounted&&u===e.renderedValue)return e.$element;e.renderedValue=u;const o=j(u);return e.$element=y(e,[o]),e.$element}function C(e,t){return typeof e!=typeof t||(e.type!==t.type||(b(e)&&b(t)?e.value!==t.value:h(e)&&h(t)?e.tag!==t.tag||e.props.key!==t.props.key:!(!m(e)||!m(t))&&(e.componentInstance.Component!==t.componentInstance.Component||e.props.key!==t.props.key)))}function E(e){p(e)&&(m(e)?function(e){if(!e.isMounted)return;e.hooks.memos.byCursor.forEach(e=>{e.current=null}),e.hooks.effects.byCursor.forEach(({cleanup:e})=>{if("function"==typeof e)try{e()}catch(e){Object(d.a)(e)}}),e.isMounted=!1,function(e){e.hooks.effects.byCursor.forEach(e=>{e.cleanup=null,e.effect=null,e.dependencies=null}),e.hooks.state.byCursor.forEach(e=>{e.value=null,e.nextValue=null,e.setter=null}),e.hooks.memos.byCursor.forEach(e=>{e.dependencies=null}),e.hooks=null,e.$element=null,e.renderedValue=null,e.Component=null,e.props=null,e.forceUpdate=null,e.onUpdate=null}(e)}(e.componentInstance):e.target&&(Object(a.b)(e.target),e.target=null),e.children.forEach(E))}function S(e){return I(e),e.isMounted=!0,e.$element}function A(e){if(!e.isMounted||!e.onUpdate)return;const t=e.$element;I(e),e.$element!==t&&e.onUpdate()}function M(e){return m(e)?M(e.children[0]):e.target}function k(e,t){m(e)?k(e.children[0],t):e.target=t}function T(e){const{cursor:t,byCursor:n}=f.hooks.state;var o;return void 0===n[t]&&(n[t]={value:e,nextValue:e,setter:(o=f,e=>{n[t].nextValue!==e&&(n[t].nextValue="function"==typeof e?e(n[t].value):e,o.prepareForFrame&&o.forceUpdate||(o.prepareForFrame=Object(u.i)(()=>function e(t){t.isMounted&&(t.hooks.state.byCursor.forEach(e=>{e.value=e.nextValue}),t.prepareForFrame=Object(u.i)(()=>e(t)),t.forceUpdate=Object(u.j)(()=>A(t)))}(o)),o.forceUpdate=Object(u.j)(()=>A(o))),o.prepareForFrame(),o.forceUpdate(),r.t&&"TeactNContainer"!==o.name&&console.log("[Teact.useState]",o.name,o.Component&&o.Component.DEBUG_contentComponentName?"> "+o.Component.DEBUG_contentComponentName:"",`Forced update at cursor #${t}, next value: `,n[t].nextValue))})}),f.hooks.state.cursor++,[n[t].value,n[t].setter]}function N(e,t,n,r){const{cursor:u,byCursor:o}=f.hooks.effects,c=f,a=()=>{if(!c.isMounted)return;const{cleanup:e}=o[u];if("function"==typeof e)try{e()}catch(e){Object(d.a)(e)}o[u].cleanup=t()};if(void 0!==o[u]&&n&&o[u].dependencies){if(n.some((e,t)=>e!==o[u].dependencies[t])){if(r){const e=n.reduce((e,t,n)=>{const r=o[u].dependencies[n];return t!==r&&e.push(`${n}: ${r} => ${t}`),e},[]);console.log("[Teact]",r,"Effect caused by dependencies.",e.join(", "))}e(a)}}else e(a);o[u]={effect:t,dependencies:n,cleanup:o[u]?o[u].cleanup:void 0},f.hooks.effects.cursor++}function P(e,t,n){return N(u.b,e,t,n)}function D(e,t,n){return N(u.e,e,t,n)}function L(e,t,n){const{cursor:u,byCursor:o}=f.hooks.memos;let{current:d}=o[u]||{};return(void 0===o[u]||t.some((e,t)=>e!==o[u].dependencies[t]))&&(r.r&&n&&console.log(`[Teact.useMemo] ${f.name} (${n}): Update is caused by:`,o[u]?Object(c.b)(t,o[u].dependencies).join(", "):"[first render]"),d=e()),o[u]={current:d,dependencies:t},f.hooks.memos.cursor++,d}function x(e,t){return L(()=>e,t)}function F(e){return L(()=>({current:e}),[])}function B(e,t=c.a,n){return function(u){const o=F(u),d=F();return(!d.current||o.current&&!t(o.current,u))&&(r.r&&n&&console.log(`[Teact.memo] ${e.name} (${n}): Update is caused by:`,Object(c.b)(o.current,u).join(", ")),o.current=u,d.current=g(e,u)),d.current}}document.addEventListener("dblclick",()=>{console.log("COMPONENTS",Object(o.k)(Object.values(w),"renderCount","desc"))}),t.a={createElement:g,Fragment:s}},function(e,t,n){"use strict";n.d(t,"g",(function(){return v})),n.d(t,"e",(function(){return O})),n.d(t,"d",(function(){return j})),n.d(t,"b",(function(){return w})),n.d(t,"a",(function(){return I})),n.d(t,"f",(function(){return C})),n.d(t,"h",(function(){return E}));var r=n(0),u=n(2),o=n(32),c=n(35),d=n(10),a=n(29),i=n(3),s=n(28);function f(){return(f=Object.assign||function(e){for(var t=1;t7&&console.warn(`[TeactN] Slow containers update: ${Math.round(t)} ms`)}}],m={},p=new Map;function g(){h.forEach(e=>e(l))}const y=Object(d.j)(g);function v(e,t=!1){"object"==typeof e&&e!==l&&(l=e,t?g():y())}function O(){return l}function j(){return m}function w(e,t){b[e]||(b[e]=[],m[e]=(t,n=!1)=>{!function(e,t,n){b[e]&&b[e].forEach(e=>{const r=e(l,m,t);r&&v(r,n)})}(e,t,n)}),b[e].push(t)}function I(e){h.push(e)}function C(e){const t=h.indexOf(e);-1!==t&&h.splice(t,1)}function E(e=(()=>({})),t=(()=>({}))){return n=>function u(d){u.DEBUG_contentComponentName=n.name;const[i]=Object(r.r)(Object(c.a)(p)),b=Object(o.a)();Object(r.n)(()=>()=>{p.delete(i)},[i]);let h=p.get(i);if(h||(h={mapStateToProps:e,mapReducersToProps:t,ownProps:d,areMappedPropsChanged:!1,forceUpdate:b,DEBUG_updates:0,DEBUG_componentName:n.name},p.set(i,h)),h.areMappedPropsChanged&&(h.areMappedPropsChanged=!1),!h.mappedProps||!Object(a.a)(h.ownProps,d)){h.ownProps=d;try{h.mappedProps={...e(l,d),...t(v,m)}}catch(e){Object(s.a)(e)}}return r.a.createElement(n,f({},h.mappedProps,d))}}u.r&&(window.getGlobal=O,document.addEventListener("dblclick",()=>{console.log("GLOBAL CONTAINERS",Object(i.k)(Array.from(p.values()).map(({DEBUG_componentName:e,DEBUG_updates:t})=>({DEBUG_componentName:e,DEBUG_updates:t})),"DEBUG_updates","desc"))}))},function(e,t,n){"use strict";n.d(t,"pb",(function(){return r})),n.d(t,"L",(function(){return u})),n.d(t,"g",(function(){return o})),n.d(t,"h",(function(){return c})),n.d(t,"r",(function(){return d})),n.d(t,"t",(function(){return a})),n.d(t,"N",(function(){return i})),n.d(t,"s",(function(){return s})),n.d(t,"zb",(function(){return f})),n.d(t,"Q",(function(){return l})),n.d(t,"I",(function(){return b})),n.d(t,"J",(function(){return h})),n.d(t,"H",(function(){return m})),n.d(t,"K",(function(){return p})),n.d(t,"X",(function(){return g})),n.d(t,"Y",(function(){return y})),n.d(t,"Z",(function(){return v})),n.d(t,"ab",(function(){return O})),n.d(t,"o",(function(){return j})),n.d(t,"O",(function(){return w})),n.d(t,"Rb",(function(){return I})),n.d(t,"jb",(function(){return E})),n.d(t,"fb",(function(){return S})),n.d(t,"gb",(function(){return A})),n.d(t,"hb",(function(){return M})),n.d(t,"k",(function(){return k})),n.d(t,"m",(function(){return T})),n.d(t,"l",(function(){return N})),n.d(t,"Ab",(function(){return P})),n.d(t,"ib",(function(){return D})),n.d(t,"G",(function(){return L})),n.d(t,"cb",(function(){return x})),n.d(t,"bb",(function(){return F})),n.d(t,"qb",(function(){return B})),n.d(t,"Qb",(function(){return R})),n.d(t,"a",(function(){return U})),n.d(t,"f",(function(){return _})),n.d(t,"e",(function(){return $})),n.d(t,"d",(function(){return G})),n.d(t,"w",(function(){return W})),n.d(t,"M",(function(){return H})),n.d(t,"U",(function(){return z})),n.d(t,"y",(function(){return K})),n.d(t,"z",(function(){return V})),n.d(t,"A",(function(){return q})),n.d(t,"wb",(function(){return J})),n.d(t,"vb",(function(){return Q})),n.d(t,"lb",(function(){return Y})),n.d(t,"kb",(function(){return Z})),n.d(t,"ob",(function(){return X})),n.d(t,"nb",(function(){return ee})),n.d(t,"mb",(function(){return te})),n.d(t,"T",(function(){return ne})),n.d(t,"c",(function(){return re})),n.d(t,"B",(function(){return ue})),n.d(t,"D",(function(){return oe})),n.d(t,"C",(function(){return ce})),n.d(t,"E",(function(){return de})),n.d(t,"Ib",(function(){return ae})),n.d(t,"Jb",(function(){return ie})),n.d(t,"Cb",(function(){return se})),n.d(t,"Db",(function(){return fe})),n.d(t,"Lb",(function(){return le})),n.d(t,"Gb",(function(){return be})),n.d(t,"Mb",(function(){return he})),n.d(t,"Nb",(function(){return me})),n.d(t,"Kb",(function(){return pe})),n.d(t,"Ob",(function(){return ge})),n.d(t,"Eb",(function(){return ye})),n.d(t,"Fb",(function(){return ve})),n.d(t,"Hb",(function(){return Oe})),n.d(t,"db",(function(){return je})),n.d(t,"j",(function(){return we})),n.d(t,"eb",(function(){return Ie})),n.d(t,"Bb",(function(){return Ce})),n.d(t,"n",(function(){return Ee})),n.d(t,"rb",(function(){return Se})),n.d(t,"sb",(function(){return Ae})),n.d(t,"ub",(function(){return Me})),n.d(t,"tb",(function(){return ke})),n.d(t,"yb",(function(){return Te})),n.d(t,"b",(function(){return Ne})),n.d(t,"i",(function(){return Pe})),n.d(t,"W",(function(){return De})),n.d(t,"V",(function(){return Le})),n.d(t,"xb",(function(){return xe})),n.d(t,"u",(function(){return Fe})),n.d(t,"v",(function(){return Be})),n.d(t,"P",(function(){return Re})),n.d(t,"Pb",(function(){return Ue})),n.d(t,"S",(function(){return _e})),n.d(t,"F",(function(){return $e})),n.d(t,"R",(function(){return Ge})),n.d(t,"p",(function(){return We})),n.d(t,"q",(function(){return He})),n.d(t,"x",(function(){return ze}));const r="Telegram",u=" [Inactive]",o="Telegram WebZ",c="1.9.3",d=!1,a=!1,i=!1,s="Shoot!\nSomething went wrong, please see the error details in Dev Tools Console.",f="user_auth",l="GramJs:sessionId",b=!1,h="tt-global-state",m=30,p=5e3,g=!1,y="tt-media",v="tt-media-avatars",O="tt-media-progressive",j="tt-custom-bg",w="tt-lang-packs-v5",I="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==",C="undefined"!=typeof window&&window.innerHeight>=900,E=1,S=750,A=C?60:40,M=2*A,k=72,T=C?30:25,N=100,P=42,D=42,L=20,x=30,F=200,B=500,R=20,U=!1,_=0,$=2,G=$,W=16,H=17,z=15,K=1e4,V="editable-message-text",q="editable-message-text-modal",J=1440,Q=1150,Y=1275,Z=925,X=600,ee=950,te=450,ne=1e9,re=100,ue=1500,oe=250,ce=600,de=500,ae=(Math.round((oe+ce)/2),new Set(["newMessage","newScheduledMessage","deleteMessages","deleteScheduledMessages","deleteHistory"]),13),ie=11,se=160,fe=120,le=64,be=48,he=32,me=64,pe=64,ge=160,ye=140,ve=80,Oe=100,je="MEMOJI_STICKER",we="en",Ie=200,Ce=450,Ee=new Set(["image/png","image/gif","image/jpeg","video/mp4","video/avi","video/quicktime"]),Se="((ftp|https?):\\/\\/)?((www\\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\\.[a-zA-Z0-9()]{1,63})\\b([-a-zA-Z0-9()@:%_+.~#?&/=]*)",Ae="(@[\\w\\d_-]+)",Me=/^(?:https?:\/\/)?(?:t\.me\/)([\d\w_]+)(?:\/([\d]+))?(?:\/([\d]+))?$/gm,ke=/^(?:https?:\/\/)?(?:t\.me\/joinchat\/)([\d\w_-]+)?$/gm,Te=777e3,Ne=0,Pe=1,De=10,Le=5,xe=2147483646,Fe="en",Be="android",Re=["android","ios","tdesktop","macos"],Ue="TelegramTips",_e=["ar","pt-br","id","it","ko","ms","pl","es","tr"],$e="https://bugs.telegram.org/?tag_ids=41&sort=time",Ge="#A2AF8E",We="#0F0F0F",He="#0a0a0a8c",ze="rgba(90, 110, 70, 0.6)"},function(e,t,n){"use strict";function r(e,t){return e.reduce((e,n)=>(e[n[t]]=n,e),{})}function u(e,t){return Object.keys(e).reduce((n,r,u)=>(n[r]=t(e[r],r,u,e),n),{})}function o(e,t){return t.reduce((t,n)=>(t[n]=e[n],t),{})}function c(e,t){return t.reduce((t,n)=>(e[n]&&(t[n]=e[n]),t),{})}function d(e,t){const n=new Set(t.map(String));return o(e,Object.keys(e).filter(e=>!n.has(e)))}function a(e,t,n="asc"){return e.sort((e,r)=>{if(Array.isArray(t)){const[u,o]=Array.isArray(n)?n:[n,n],[c,d]=t;let a,i;if("function"==typeof c?(a=c(e)||0,i=c(r)||0):"string"==typeof c&&(a=e[c]||0,i=r[c]||0),a!==i)return"asc"===u?a-i:i-a;{let t,n;return"function"==typeof d?(t=d(e)||0,n=d(r)||0):"string"==typeof d&&(t=e[d]||0,n=r[d]||0),"asc"===o?t-n:n-t}}let u,o;return"function"==typeof t?(u=t(e)||0,o=t(r)||0):"string"==typeof t&&(u=e[t]||0,o=r[t]||0),"asc"===n?u-o:o-u})}function i(e){return e.reduce((e,t)=>Array.isArray(t)?e.concat(t):(e.push(t),e),[])}function s(e){return Array.from(new Set(e))}function f(e){return e.filter(Boolean)}function l(e,t){return e.length===t.length&&e.every((e,n)=>e===t[n])}function b(e,t){return e[0]<=t[t.length-1]&&e[e.length-1]>=t[0]}function h(e,t){return e.filter(e=>t.has(e))}function m(e,t){const n=[];for(let r=0;r(t[n]=p(e[n]),t),{})}function g(e,t){let n=e.length;for(;n--;)if(t(e[n],n,e))return e[n]}n.d(t,"c",(function(){return r})),n.d(t,"i",(function(){return u})),n.d(t,"l",(function(){return o})),n.d(t,"m",(function(){return c})),n.d(t,"j",(function(){return d})),n.d(t,"k",(function(){return a})),n.d(t,"h",(function(){return i})),n.d(t,"o",(function(){return s})),n.d(t,"e",(function(){return f})),n.d(t,"a",(function(){return l})),n.d(t,"b",(function(){return b})),n.d(t,"f",(function(){return h})),n.d(t,"n",(function(){return m})),n.d(t,"d",(function(){return p})),n.d(t,"g",(function(){return g}))},function(e,t,n){"use strict";n.d(t,"ab",(function(){return r.b})),n.d(t,"bb",(function(){return r.c})),n.d(t,"cb",(function(){return r.d})),n.d(t,"Cb",(function(){return r.g})),n.d(t,"sb",(function(){return r.e})),n.d(t,"Bb",(function(){return r.f})),n.d(t,"Kb",(function(){return r.h})),n.d(t,"Z",(function(){return r.a})),n.d(t,"ob",(function(){return u.w})),n.d(t,"nb",(function(){return u.v})),n.d(t,"lb",(function(){return u.t})),n.d(t,"qb",(function(){return u.y})),n.d(t,"mb",(function(){return u.u})),n.d(t,"rb",(function(){return u.z})),n.d(t,"l",(function(){return u.j})),n.d(t,"W",(function(){return u.p})),n.d(t,"k",(function(){return u.i})),n.d(t,"f",(function(){return u.e})),n.d(t,"g",(function(){return u.f})),n.d(t,"e",(function(){return u.d})),n.d(t,"pb",(function(){return u.x})),n.d(t,"jb",(function(){return u.r})),n.d(t,"p",(function(){return u.m})),n.d(t,"Db",(function(){return u.A})),n.d(t,"d",(function(){return u.c})),n.d(t,"b",(function(){return u.a})),n.d(t,"L",(function(){return u.o})),n.d(t,"j",(function(){return u.h})),n.d(t,"i",(function(){return u.g})),n.d(t,"kb",(function(){return u.s})),n.d(t,"Hb",(function(){return u.D})),n.d(t,"Ib",(function(){return u.E})),n.d(t,"c",(function(){return u.b})),n.d(t,"Gb",(function(){return u.C})),n.d(t,"Fb",(function(){return u.B})),n.d(t,"o",(function(){return u.l})),n.d(t,"n",(function(){return u.k})),n.d(t,"ib",(function(){return u.q})),n.d(t,"K",(function(){return u.n})),n.d(t,"Jb",(function(){return u.F})),n.d(t,"C",(function(){return i})),n.d(t,"Eb",(function(){return s})),n.d(t,"G",(function(){return f})),n.d(t,"O",(function(){return l})),n.d(t,"P",(function(){return b})),n.d(t,"x",(function(){return h})),n.d(t,"M",(function(){return m})),n.d(t,"m",(function(){return p})),n.d(t,"yb",(function(){return g})),n.d(t,"zb",(function(){return y})),n.d(t,"tb",(function(){return v})),n.d(t,"gb",(function(){return O})),n.d(t,"Ab",(function(){return j})),n.d(t,"hb",(function(){return w})),n.d(t,"X",(function(){return I})),n.d(t,"Y",(function(){return C})),n.d(t,"xb",(function(){return E})),n.d(t,"ub",(function(){return S})),n.d(t,"u",(function(){return A})),n.d(t,"v",(function(){return T})),n.d(t,"fb",(function(){return N})),n.d(t,"H",(function(){return P})),n.d(t,"Q",(function(){return D})),n.d(t,"J",(function(){return L})),n.d(t,"s",(function(){return x})),n.d(t,"t",(function(){return F})),n.d(t,"N",(function(){return B})),n.d(t,"y",(function(){return R})),n.d(t,"vb",(function(){return U})),n.d(t,"wb",(function(){return _})),n.d(t,"I",(function(){return $})),n.d(t,"B",(function(){return G})),n.d(t,"R",(function(){return W})),n.d(t,"S",(function(){return H})),n.d(t,"T",(function(){return z})),n.d(t,"F",(function(){return K})),n.d(t,"E",(function(){return V})),n.d(t,"D",(function(){return J})),n.d(t,"z",(function(){return Q})),n.d(t,"A",(function(){return Y})),n.d(t,"eb",(function(){return Z})),n.d(t,"h",(function(){return X})),n.d(t,"U",(function(){return ee})),n.d(t,"V",(function(){return te})),n.d(t,"db",(function(){return ne})),n.d(t,"r",(function(){return re})),n.d(t,"w",(function(){return ue})),n.d(t,"q",(function(){return oe})),n.d(t,"a",(function(){return ce}));var r=n(36),u=n(37),o=n(8),c=n(2),d=n(65);const a=new RegExp(c.rb,"i");function i(e){const{chatId:t,id:n}=e;return`msg${t}-${n}`}function s(e){const t=e.match(/^msg(-?\d+)-(\d+)/);return{chatId:Number(t[1]),messageId:Number(t[2])}}function f(e){return e.previousLocalId||e.id}function l(e,t,n=!1){const{text:r,photo:u,video:o,audio:c,voice:d,document:a,sticker:i,contact:s,poll:f,invoice:l}=t.content,b=r&&r.text.substr(0,80);return t.groupedId?`${n?"":"🖼 "}${b||e("lng_in_dlg_album")}`:u?`${n?"":"🖼 "}${b||e("AttachPhoto")}`:o?`${n?"":"📹 "}${b||e(o.isGif?"AttachGif":"AttachVideo")}`:i?`${i.emoji||""} ${e("AttachSticker")}`.trim():c?`${n?"":"🎧 "}${A(t)||e("AttachMusic")}`:d?`${n?"":"🎤 "}${b||e("AttachAudio")}`:a?`${n?"":"📎 "}${b||a.fileName}`:s?e("AttachContact"):f?`${n?"":"📊 "}${f.summary.question}`:l?"Invoice":r?b:"The message is not supported on this version of Telegram"}function b(e){const{text:t,sticker:n,photo:r,video:u,audio:o,voice:c,document:d,poll:a,webPage:i,contact:s,invoice:f}=e.content;return t?t.text:n||r||u||o||c||d||s||a||i||f?void 0:"The message is not supported on this version of Telegram"}function h(e){const{text:t,sticker:n,photo:r,video:u,audio:o,voice:c,document:a,poll:i,webPage:s,contact:f}=e.content;return!!(n||u&&u.isRound)||!(!t||r||u||o||c||a||i||s||f)&&(Object(d.a)(t.text)||!1)}function m(e){const{text:t}=e.content;if(t&&t.text.length<=6&&1===h(e))return t.text}function p(e){const{text:t}=e.content;let n;if(t&&t.entities){let e=t.entities.find(e=>e.type===o.ApiMessageEntityTypes.TextUrl);if(e&&(n=e.url.match(a)),!n&&(e=t.entities.find(e=>e.type===o.ApiMessageEntityTypes.Url),e)){const{offset:r,length:u}=e;n=t.text.substring(r,r+u).match(a)}}if(!n&&t&&(n=t.text.match(a)),n)return{url:n[0],domain:n[3]}}function g(e){return e.isOutgoing}function y(e){return Boolean(e.replyToMessageId)}function v(e){return Boolean(e.forwardInfo)}function O(e){return!!e.content.action}function j(e){return e.chatId===c.yb&&E(e)}function w(e){return Boolean(e.senderId)&&e.senderId<0&&g(e)}function I(e,t){return t.id>0?Object(r.c)(t):Object(u.i)(e,t)}function C(e){return e.sendingState?"messageSendingStateFailed"===e.sendingState?"failed":"pending":"succeeded"}function E(e){return e.id>=c.T}function S(e){return e.content.action&&"historyClear"===e.content.action.type}function A(e){const{audio:t,text:n}=e.content;return t&&[t.title,t.performer].filter(Boolean).join(" — ")||n&&n.text}var M=n(6),k=n(60);function T(e){return e.content}function N(e){return Boolean(P(e)||D(e)||R(e)||B(e)||function(e){return e.content.contact}(e)||$(e)||x(e)||F(e)||function(e){return e.content.voice}(e))}function P(e){return e.content.photo}function D(e){return e.content.video}function L(e){const{video:t}=e.content;return t&&t.isRound?t:void 0}function x(e){return e.content.action}function F(e){return e.content.audio}function B(e){return e.content.sticker}function R(e){return e.content.document}function U(e){const t=R(e);return t?"photo"===t.mediaType:void 0}function _(e){const t=R(e);return t?"video"===t.mediaType:void 0}function $(e){return e.content.poll}function G(e){return e.content.invoice}function W(e){return e.content.webPage}function H(e){const t=W(e);return t?t.photo:void 0}function z(e){const t=W(e);if(t)return t.video}function K(e){const t=function(e){const t=P(e)||D(e)||R(e)||B(e)||H(e)||z(e);if(t)return t.thumbnail}(e);return t?t.dataUri:void 0}function V(e,t){const{photo:n,video:r,sticker:u,audio:o,voice:c,document:d}=e.content,a=H(e),s=z(e),f=r||s,l=n||a;if(!(l||f||u||o||c||d))return;const b=i(e);if(f)switch(t){case"micro":case"pictogram":return b+"?size=m";case"inline":return Z(e)?void 0:q(f,b);case"viewerPreview":return b+"?size=m";case"viewerFull":return q(f,b);case"download":return b+"?download"}if(l)switch(t){case"micro":case"pictogram":return b+"?size=m";case"inline":return Z(e)?void 0:b+"?size=x";case"viewerPreview":return b+"?size=x";case"viewerFull":return b+"?size=z"}if(d)switch(t){case"micro":case"pictogram":case"inline":case"viewerPreview":if(!Object(k.c)(d)||Z(e))return;return b+"?size=m";default:return b}if(u)switch(t){case"micro":return;case"pictogram":return b+"?size=m";default:return b}if(o)switch(t){case"micro":case"pictogram":return;case"download":return b+"?download";default:return q(o,b)}if(c)switch(t){case"micro":case"pictogram":return;default:return b}}function q(e,t){return M.h&&M.j?`${t}?fileSize=${e.size}&mimeType=${e.mimeType}`:t}function J(e,t){const{sticker:n,video:r,audio:u,voice:c}=e.content,d=r||z(e);return n&&"inline"===t&&n.isAnimated?o.ApiMediaFormat.Lottie:d&&M.h&&("viewerFull"===t||"inline"===t)?o.ApiMediaFormat.Progressive:u||c?c&&!M.g?o.ApiMediaFormat.BlobUrl:o.ApiMediaFormat.Progressive:o.ApiMediaFormat.BlobUrl}function Q(e){const{photo:t,video:n,document:r}=e.content,u=H(e),o=z(e);if(t||u)return`photo${e.date}.jpeg`;const{fileName:c}=n||o||r||{};return c}function Y(e){const{video:t,document:n}=e.content,r=z(e),{size:u}=t||r||n||{};return u}function Z(e){const{photo:t,video:n,document:r}=e.content;return t&&t.blobUrl||n&&n.blobUrl||r&&r.previewBlobUrl}function X(e,t,n=!1){const r=ue(e,t,n?"media":"inlineMedia");return n?r.reverse():r}function ee(e){return e.sizes.find(e=>"z"===e.type)||e.sizes.find(e=>"y"===e.type)||te(e)}function te(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 ne(e){if(e.width&&e.height)return e}function re(e,t,n=!1){const r=E(e);return{isUploading:r,isTransferring:r||n,transferProgress:Number(t)}}function ue(e,t,n){let r;switch(n){case"media":r=e=>{const t=D(e);return P(e)||t&&!t.isRound&&!t.isGif};break;case"documents":r=R;break;case"links":r=e=>W(e)||function(e){const{text:t}=e.content,n=t&&t.text.match(a);if(n)return{url:n[0],domain:n[3]}}(e);break;case"audio":r=F;break;case"inlineMedia":r=e=>{const t=D(e);return P(e)||t&&!t.isRound&&!t.isGif||U(e)||_(e)};break;default:return[]}return t.reduce((t,n)=>(e[n]&&r(e[n])&&t.push(n),t),[])}function oe(e){const{audio:t,voice:n,video:r}=T(e),u=t||n||r||z(e);if(u)return u.duration}function ce(e,t){return`${e}_${t}`}n(61)},function(e,t,n){"use strict";n.d(t,"c",(function(){return s})),n.d(t,"a",(function(){return f})),n.d(t,"b",(function(){return l}));var r=n(81),u=n.n(r),o=n(2),c=n(35);let d;const a=new Map,i=new Map;function s(e,t){return d||(o.r&&console.log(">>> START LOAD WORKER"),d=new u.a,function(e){d.addEventListener("message",({data:t})=>{if("update"===t.type)e(t.update);else if("methodResponse"===t.type){const e=a.get(t.messageId);e&&(t.error?e.reject(t.error):e.resolve(t.response))}else if("methodCallback"===t.type){const e=a.get(t.messageId);e&&e.callback&&e.callback(...t.callbackArgs)}else if("unhandledError"===t.type)throw t.error})}(e)),b({type:"initApi",args:[t]})}function f(e,...t){if(d)return b({type:"callMethod",name:e,args:t});o.r&&console.warn("API is not initialized")}function l(e){e.isCanceled=!0;const{messageId:t}=i.get(e)||{};t&&d.postMessage({type:"cancelProgress",messageId:t})}function b(e){const t=Object(c.a)(a),n={messageId:t,...e},r={messageId:t},u=new Promise((e,t)=>{Object.assign(r,{resolve:e,reject:t})});if("function"==typeof n.args[1]){const e=n.args.pop();r.callback=e,i.set(e,r)}return a.set(t,r),u.catch(()=>{}).finally(()=>{a.delete(t),r.callback&&i.delete(r.callback)}),d.postMessage(n),u}},function(e,t,n){"use strict";n.d(t,"t",(function(){return o})),n.d(t,"s",(function(){return d})),n.d(t,"r",(function(){return s})),n.d(t,"f",(function(){return f})),n.d(t,"e",(function(){return l})),n.d(t,"b",(function(){return b})),n.d(t,"j",(function(){return h})),n.d(t,"i",(function(){return m})),n.d(t,"n",(function(){return p})),n.d(t,"l",(function(){return g})),n.d(t,"m",(function(){return y})),n.d(t,"o",(function(){return v})),n.d(t,"d",(function(){return O})),n.d(t,"k",(function(){return j})),n.d(t,"h",(function(){return w})),n.d(t,"g",(function(){return I})),n.d(t,"c",(function(){return C})),n.d(t,"p",(function(){return E})),n.d(t,"a",(function(){return S})),n.d(t,"q",(function(){return A}));var r=n(2);let u;function o(){return Boolean(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=>{u=e});let c=window&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";function d(){return c}function a(e){c=e.matches?"dark":"light"}const i=window.matchMedia("(prefers-color-scheme: dark)");"function"==typeof i.addEventListener?i.addEventListener("change",a):"function"==typeof i.addListener&&i.addListener(a);const s=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}(),f="macOS"===s,l="iOS"===s,b="Android"===s,h=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),m=window.matchMedia("(display-mode: standalone)").matches||window.navigator.standalone||document.referrer.includes("android-app://"),p=window.matchMedia("(pointer: coarse)").matches,g=window.innerWidth<=r.ob||window.innerWidth<=r.nb&&window.innerHeight<=r.mb,y=!g&&window.innerWidth<=r.kb,v=navigator.mediaDevices&&"getUserMedia"in navigator.mediaDevices&&(window.AudioContext||window.webkitAudioContext),O=(document.documentElement.style,s&&(f||l)),j="serviceWorker"in navigator,w=j,I=(window,Boolean((new Audio).canPlayType("audio/ogg; codecs=opus"))),C=!r.N&&"filter"in(document.createElement("canvas").getContext("2d")||{}),E=b?"slide-fade":l?"slide-layers":"push-slide",S=window.devicePixelRatio||1,A=!0},function(e,t,n){"use strict";n.d(t,"T",(function(){return Fe})),n.d(t,"pb",(function(){return Be})),n.d(t,"W",(function(){return Re})),n.d(t,"Db",(function(){return Ue})),n.d(t,"Jb",(function(){return a})),n.d(t,"X",(function(){return i})),n.d(t,"g",(function(){return l})),n.d(t,"p",(function(){return b})),n.d(t,"P",(function(){return h})),n.d(t,"O",(function(){return m})),n.d(t,"Cb",(function(){return p})),n.d(t,"o",(function(){return g})),n.d(t,"h",(function(){return y})),n.d(t,"L",(function(){return v})),n.d(t,"d",(function(){return O})),n.d(t,"M",(function(){return j})),n.d(t,"k",(function(){return w})),n.d(t,"j",(function(){return I})),n.d(t,"N",(function(){return C})),n.d(t,"i",(function(){return E})),n.d(t,"r",(function(){return S})),n.d(t,"z",(function(){return D})),n.d(t,"s",(function(){return L})),n.d(t,"n",(function(){return x})),n.d(t,"sb",(function(){return F})),n.d(t,"Z",(function(){return R})),n.d(t,"hb",(function(){return U})),n.d(t,"y",(function(){return _})),n.d(t,"Kb",(function(){return $})),n.d(t,"kb",(function(){return G})),n.d(t,"qb",(function(){return W})),n.d(t,"tb",(function(){return H})),n.d(t,"ob",(function(){return z})),n.d(t,"D",(function(){return K})),n.d(t,"F",(function(){return V})),n.d(t,"C",(function(){return q})),n.d(t,"db",(function(){return J})),n.d(t,"Fb",(function(){return Q})),n.d(t,"G",(function(){return Y})),n.d(t,"nb",(function(){return Z})),n.d(t,"Gb",(function(){return X})),n.d(t,"Hb",(function(){return ee})),n.d(t,"Eb",(function(){return te})),n.d(t,"a",(function(){return ne})),n.d(t,"Y",(function(){return re})),n.d(t,"l",(function(){return ue})),n.d(t,"rb",(function(){return oe})),n.d(t,"E",(function(){return ce})),n.d(t,"m",(function(){return de})),n.d(t,"I",(function(){return ae})),n.d(t,"U",(function(){return ie})),n.d(t,"gb",(function(){return se})),n.d(t,"vb",(function(){return fe})),n.d(t,"K",(function(){return le})),n.d(t,"b",(function(){return be})),n.d(t,"e",(function(){return he})),n.d(t,"f",(function(){return me})),n.d(t,"Ib",(function(){return pe})),n.d(t,"mb",(function(){return ge})),n.d(t,"H",(function(){return ye})),n.d(t,"R",(function(){return ve})),n.d(t,"q",(function(){return Oe})),n.d(t,"S",(function(){return je})),n.d(t,"V",(function(){return we})),n.d(t,"J",(function(){return Ie})),n.d(t,"bb",(function(){return Ce})),n.d(t,"Q",(function(){return Ee})),n.d(t,"ub",(function(){return Se})),n.d(t,"cb",(function(){return Ae})),n.d(t,"wb",(function(){return Me})),n.d(t,"xb",(function(){return ke})),n.d(t,"yb",(function(){return Te})),n.d(t,"u",(function(){return _e})),n.d(t,"B",(function(){return Ne})),n.d(t,"x",(function(){return Pe})),n.d(t,"w",(function(){return De})),n.d(t,"ab",(function(){return Le})),n.d(t,"v",(function(){return xe})),n.d(t,"A",(function(){return M})),n.d(t,"t",(function(){return k})),n.d(t,"zb",(function(){return T})),n.d(t,"Ab",(function(){return N})),n.d(t,"c",(function(){return P})),n.d(t,"ib",(function(){return $e})),n.d(t,"jb",(function(){return Ge})),n.d(t,"lb",(function(){return We})),n.d(t,"Bb",(function(){return He})),n.d(t,"fb",(function(){return s})),n.d(t,"eb",(function(){return f}));var r=n(13),u=n(6),o=n(8),c=n(2),d=n(4);function a(e,t){return e.users.byId[t]}function i(e,t){const n=a(e,t);return n&&n.fullInfo&&n.fullInfo.isBlocked}function s(e){return e.settings.byKey}function f(e){return e.settings.notifyExceptions}function l(e,t){return e.chats.byId[t]}function b(e,t){const n=Object(d.W)(t);return!!n&&a(e,n)}function h(e,t){return t===e.currentUserId}function m(e,t){const n=b(e,t);return n&&Object(d.Bb)(n)}function p(e){return Object.values(e.chats.byId).find(({isSupport:e})=>e)}function g(e,t){if(!Object(d.ob)(t.id)&&!Object(d.mb)(t)&&t.fullInfo)return t.fullInfo.members&&t.fullInfo.members.length!==c.bb?t.fullInfo.members.reduce((t,{userId:n})=>e.users.byId[n]&&Object(d.Cb)(e.users.byId[n])&&n!==e.currentUserId?t+1:t,0):t.fullInfo.onlineCount}function y(e,t){const n=l(e,t),r=n&&Object(d.W)(n),u=r&&a(e,r);if(u&&Object(d.Bb)(u))return u}function v(e,t){const n=l(e,t),r=y(e,t);if(!n||!r)return!1;if(n.lastMessage&&Object(d.ub)(n.lastMessage))return!0;const u=e.messages.byChatId[t];if(!u)return!1;const{listedIds:c}=u.threadsById[o.MAIN_THREAD_ID]||{};return c&&!c.length}function O(e){return Boolean(e.chats.listIds.active)}function j(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 w(e,t){const n=l(e,t);if(n&&j(e,t))return n.folderId===c.i?"archived":"active"}function I(e,t){return e.chatFolders.byId[t]}function C(e,t,n=c.b){const{active:r,archived:u}=e.chats.orderedPinnedIds;if(n===c.b)return!!r&&r.includes(t);if(n===c.i)return!!u&&u.includes(t);const{byId:o}=e.chatFolders,{pinnedChatIds:d}=o[n]||{};return!!d&&d.includes(t)}function E(e,t){const n=t.toLowerCase();return Object.values(e.chats.byId).find(e=>e.username&&e.username.toLowerCase()===n)}function S(e){const t=e.chats.listIds.active;if(!t)return 0;const n=e.chats.byId;return t.reduce((t,r)=>{const u=n[r];return u&&u.unreadCount&&!Object(d.Hb)(u,s(e),f(e))?t+u.unreadCount:t},0)}var A=n(3);function M(e){return e.stickers.search}function k(e){return e.gifs.search}function T(e,t){return e.stickers.setsById[t]}function N(e,t){const n=Object.values(e.stickers.setsById);let r=[];return n.forEach(({packs:e})=>{if(!e)return;const n=e[t];n&&(r=r.concat(n))}),r}function P(e,t){const{animatedEmojis:n}=e;if(!n||!n.stickers)return;const r=t.replace("️","");return n.stickers.find(e=>e.emoji===t||e.emoji===r)}function D(e){const{messageLists:t}=e.messages;if(t.length)return t[t.length-1]}function L(e){const{chatId:t}=D(e)||{};return t?l(e,t):void 0}function x(e,t){const n=e.messages.byChatId[t];return n?n.byId:void 0}function F(e,t){const n=e.scheduledMessages.byChatId[t];return n?n.byId:void 0}function B(e,t,n,r){const u=e.messages.byChatId[t];if(!u)return;const o=u.threadsById[n];return o?o[r]:void 0}function R(e,t,n){return B(e,t,n,"listedIds")}function U(e,t,n){return B(e,t,n,"outlyingIds")}function _(e,t,n,r){switch(r){case"thread":return $(e,t,n);case"pinned":return G(e,t);case"scheduled":return W(e,t)}}function $(e,t,n){return B(e,t,n,"viewportIds")}function G(e,t){return B(e,t,o.MAIN_THREAD_ID,"pinnedIds")}function W(e,t){return B(e,t,o.MAIN_THREAD_ID,"scheduledIds")}function H(e,t,n){return B(e,t,n,"scrollOffset")}function z(e,t,n){return B(e,t,n,"replyingToId")}function K(e,t,n){return B(e,t,n,"editingId")}function V(e,t){return B(e,t,o.MAIN_THREAD_ID,"editingScheduledId")}function q(e,t,n){return B(e,t,n,"draft")}function J(e,t,n){return B(e,t,n,"noWebPage")}function Q(e,t,n){return B(e,t,n,"threadInfo")}function Y(e,t,n){return B(e,t,n,"firstMessageId")}function Z(e,t,n){return B(e,t,n,"replyStack")}function X(e,t,n){if(n===o.MAIN_THREAD_ID)return l(e,t);const r=Q(e,t,n);return r?l(e,r.originChannelId||t):void 0}function ee(e,t,n){if(n===o.MAIN_THREAD_ID)return;const r=Q(e,t,n);return r?r.topMessageId:void 0}function te(e,t,n){const r=e.messages.byChatId[t];if(!r)return;const{replyToMessageId:u,replyToTopMessageId:o}=n;return u||o?Object.values(r.threadsById).find(e=>e.threadInfo&&(u&&u===e.threadInfo.topMessageId||o&&o===e.threadInfo.topMessageId)):void 0}function ne(e,t,n){const r=D(e);if(!r)return!1;const{threadInfo:u}=te(e,t,n)||{};return t===r.chatId&&(r.threadId===o.MAIN_THREAD_ID||u&&r.threadId===u.threadId)}function re(e,t,n){const r=$(e,t,n);if(!r||!r.length)return!0;let u;if(n===o.MAIN_THREAD_ID){const n=l(e,t);if(!n||!n.lastMessage)return!0;u=n.lastMessage.id}else{const r=Q(e,t,n);if(!r||!r.lastMessageId)return;u=r.lastMessageId}return u>=c.T&&!ue(e,t,u)||r[r.length-1]>=u}function ue(e,t,n){const r=x(e,t);return r?r[n]:void 0}function oe(e,t,n){const r=F(e,t);return r?r[n]:void 0}function ce(e,t,n,r){if("scheduled"===r){const n=V(e,t);return n?oe(e,t,n):void 0}{const r=K(e,t,n);return r?ue(e,t,r):void 0}}function de(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 ae(e,t){const{chatId:n,messageId:r}=e.focusedMessage||{};return n===t?r:void 0}function ie(e,t){const n=ae(e,t.chatId);return!!n&&(n===t.id||n===t.previousLocalId)}function se(e,t,n=!1){return function(e,t){const{lastReadOutboxMessageId:n}=l(e,t.chatId)||{};return Object(d.xb)(t)||!n||n0?a(e,n):l(e,n)}function le(e,t){const{forwardInfo:n}=t;if(n)return n.isChannelPost&&n.fromChatId?l(e,n.fromChatId):n.senderUserId?a(e,n.senderUserId):void 0}function be(e,t,n){const{serverTimeOffset:r}=e,u=l(e,t.chatId);if(!u||u.isRestricted)return{};const o=Object(d.ob)(u.id),c=h(e,t.chatId),a=Object(d.lb)(u),i=Object(d.qb)(u),s=Object(d.mb)(u),f=Object(d.Ab)(t),b=Object(d.yb)(t),m=Object(d.gb)(t),{content:p}=t,g=(c||i&&Object(d.p)(u,"pinMessages")||s&&Object(d.p)(u,"editMessages")||Date.now()+1e3*r-1e3*t.date<1728e5)&&!(p.sticker||p.contact||p.poll||p.action||p.audio||p.video&&p.video.isRound)&&!Object(d.tb)(t)&&!t.viaBotId,y=Object(d.d)(u,n)&&!f,v=o||u.isCreator||!s&&!Object(d.Db)(u,"pinMessages")||Object(d.p)(u,"pinMessages");let O=!m&&v,j=!1;const w=G(e,u.id);O&&(j=Boolean(w&&w.includes(t.id)),O=!j);const I=o||b||a||u.isCreator||Object(d.p)(u,"deleteMessages"),C=!o&&!b,E=I&&!f&&(o&&!c||a&&(b||Object(d.p)(u,"deleteMessages")||u.isCreator)),S=!m&&g&&(b||s&&(u.isCreator||Object(d.p)(u,"editMessages"))),A=!m&&!f,M=Boolean(t.content.sticker),k=M&&function(e,t){const{stickers:n}=e.stickers.favorite;return n&&n.some(({id:e})=>e===t.id)}(e,t.content.sticker),T=!m&&M&&!k,N=!m&&k,P=!m,D=!m&&(s||i),L=!m;return{noOptions:[y,S,O,j,I,E,A,T,N,P,D,L].every(e=>!e),canReply:y,canEdit:S,canPin:O,canUnpin:j,canDelete:I,canReport:C,canDeleteForAll:E,canForward:A,canFaveSticker:T,canUnfaveSticker:N,canCopy:P,canCopyLink:D,canSelect:L}}function he(e){const{messageIds:t}=e.selectedMessages||{},{chatId:n,threadId:r}=D(e)||{},u=n&&x(e,n);if(!u||!t||!r)return{};const o=t.map(t=>u[t]&&be(e,u[t],r)).filter(Boolean);return{canDelete:o.every(e=>e.canDelete),canDeleteForAll:o.every(e=>e.canDeleteForAll)}}function me(e){const{messageIds:t}=e.selectedMessages||{},{chatId:n,threadId:r}=D(e)||{},u=n&&x(e,n);if(!u||!t||!r)return!1;return t.map(t=>u[t]&&be(e,u[t],r)).filter(Boolean).every(e=>e.canReport)}function pe(e,t){const n=e.fileUploads.byMessageLocalId[t.previousLocalId||t.id];return n?n.progress:void 0}function ge(e,t,n){if(n===o.MAIN_THREAD_ID){const n=l(e,t);if(!n)return;if(!n.lastReadInboxMessageId)return;return n.lastMessage?Object(d.xb)(n.lastMessage)?n.lastMessage.id:Math.min(n.lastMessage.id,n.lastReadInboxMessageId):n.lastReadInboxMessageId}{const r=Q(e,t,n);if(!r)return;return r.lastReadInboxMessageId?Math.min(r.lastReadInboxMessageId,r.lastMessageId||1/0):r.topMessageId}}function ye(e,t,n){const r=l(e,t);if(n===o.MAIN_THREAD_ID){if(!r)return}else{const r=Q(e,t,n);if(!r||r.lastMessageId===r.lastReadInboxMessageId)return}const u=U(e,t,n),c=R(e,t,n),d=x(e,t);if(!d||!u&&!c)return;const a=ge(e,t,n);if(a||!r||!r.isNotJoined){if(u){const e=a?u.find(e=>e>a&&d[e]&&(!d[e].isOutgoing||d[e].isFromScheduled)):u[0];if(e)return e}if(c){const e=a?c.find(e=>e>a&&d[e]&&(!d[e].isOutgoing||d[e].isFromScheduled)):c[0];if(e)return e}}}function ve(e){const{forwardMessages:t}=e;return Boolean(t.isModalShown)}function Oe(e,t){const n=Object.values(e.chats.byId).find(e=>Object(d.rb)(e)&&e.lastMessage&&e.lastMessage.id===t);if(n)return n.id;const{byChatId:r}=e.messages;return Number(Object.keys(r).find(n=>{const u=l(e,Number(n));return u&&Object(d.rb)(u)&&r[u.id].byId[t]}))}function je(e){const{selectedMessages:t}=e;return Boolean(t)}function we(e,t){const{messageIds:n}=e.selectedMessages||{};return!!n&&n.includes(t)}function Ie(e,t,n){const r=x(e,t);if(r)return Object.values(r).filter(e=>e.groupedId===n&&e.forwardInfo).map(({forwardInfo:e})=>e.fromMessageId)}function Ce(e,t,n){const r=x(e,t);if(r)return Object.keys(r).map(Number).filter(e=>r[e].groupedId===n)}function Ee(e,t,n){const{messageIds:r}=e.selectedMessages||{};if(!r)return!1;const u=Ce(e,t,n);return u&&u.every(e=>r.includes(e))}function Se(e){const{messageIds:t}=e.selectedMessages||{};return t?t.length:0}function Ae(e,t){const n=l(e,t);if(!n)return;if(!m(e,n))return;const r=x(e,t),u=$(e,t,o.MAIN_THREAD_ID);if(!r||!u)return;const c=Object(A.g)(u,e=>!r[e].isOutgoing&&Boolean(r[e].keyboardButtons)),d=Object(A.g)(u,e=>Boolean(r[e].shouldHideKeyboardButtons));return c&&d&&d>c?void 0:c?r[c]:void 0}function Me(e,t,n,r){const{shouldAutoDownloadMediaFromContacts:u,shouldAutoDownloadMediaInPrivateChats:o,shouldAutoDownloadMediaInGroups:c,shouldAutoDownloadMediaInChannels:a}=e.settings.byKey;return Boolean(o&&Object(d.ob)(n.id)||c&&Object(d.nb)(n)||a&&Object(d.mb)(n)||u&&r&&(r.id===e.currentUserId||function(e,t){return e.contactList&&e.contactList.userIds.includes(t.id)}(e,r)))}function ke(e,t){const n=Object(d.Q)(t)||Object(d.T)(t);if(!n)return;const{shouldAutoPlayVideos:r,shouldAutoPlayGifs:u}=e.settings.byKey,o=n.isGif||n.isRound;return r&&!o||u&&o}function Te(e){return e.settings.byKey.shouldLoopStickers}function Ne(e){const{chatId:t,threadId:n}=D(e)||{};if(!t||!n)return;const r=Object(d.a)(t,n),u=e.localTextSearch.byChatThreadKey[r];return u&&u.isActive?u:void 0}function Pe(e){const{byChatId:t}=e.localMediaSearch,{chatId:n}=D(e)||{},r=e.users.selectedId;return r&&t[r]?r:n}function De(e){const t=Pe(e);if(t)return e.localMediaSearch.byChatId[t]}function Le(e,t){return e.management.byChatId[t]}function xe(e){const{chatId:t,threadId:n}=D(e)||{};if(!t||!n)return;if(Object(d.ob)(t))return"user";const r=l(e,t);return r?Object(d.nb)(r)?"group":"channel":void 0}function Fe(e){const{mediaViewer:t}=e;return Boolean(t.messageId||t.avatarOwnerId)}function Be(e){const{users:t,isChatInfoShown:n,newChatMembersProgress:o}=e,c=o!==r.i.Closed,d=function(e){const{pollResults:t}=e;return Boolean(t.messageId)}(e),a=Boolean(!u.l&&Ne(e)),i=function(e){const{chatId:t,threadId:n}=D(e)||{};if(!t||!n)return;const r=e.management.byChatId[t];return r&&r.isActive?r:void 0}(e),s=void 0!==M(e).query,f=void 0!==k(e).query,{chatId:l}=D(e)||{},b=t.selectedId,h=O(e),m=Boolean(b&&h),p=Boolean(l&&h)&&n;return d?r.m.PollResults:a?r.m.Search:i?r.m.Management:s?r.m.StickerSearch:f?r.m.GifSearch:c?r.m.AddingMembers:m?r.m.UserInfo:p?r.m.ChatInfo:void 0}function Re(e){return void 0!==Be(e)}function Ue(e){const{theme:t,shouldUseSystemTheme:n}=e.settings.byKey;return n?Object(u.s)():t}function _e(e){return e.globalSearch.query}function $e(e){return e.payment.messageId}function Ge(e){return e.payment.formId}function We(e){return e.payment.nativeParams?e.payment.nativeParams.publishableKey:void 0}function He(e){return e.payment.stripeCredentials}},function(e,t,n){"use strict";var r=n(69);n.o(r,"ApiMediaFormat")&&n.d(t,"ApiMediaFormat",(function(){return r.ApiMediaFormat})),n.o(r,"ApiMessageEntityTypes")&&n.d(t,"ApiMessageEntityTypes",(function(){return r.ApiMessageEntityTypes})),n.o(r,"MAIN_THREAD_ID")&&n.d(t,"MAIN_THREAD_ID",(function(){return r.MAIN_THREAD_ID})),n.o(r,"MESSAGE_DELETED")&&n.d(t,"MESSAGE_DELETED",(function(){return r.MESSAGE_DELETED}));var u=n(70);n.o(u,"ApiMediaFormat")&&n.d(t,"ApiMediaFormat",(function(){return u.ApiMediaFormat})),n.o(u,"ApiMessageEntityTypes")&&n.d(t,"ApiMessageEntityTypes",(function(){return u.ApiMessageEntityTypes})),n.o(u,"MAIN_THREAD_ID")&&n.d(t,"MAIN_THREAD_ID",(function(){return u.MAIN_THREAD_ID})),n.o(u,"MESSAGE_DELETED")&&n.d(t,"MESSAGE_DELETED",(function(){return u.MESSAGE_DELETED}));var o=n(71);n.d(t,"ApiMessageEntityTypes",(function(){return o.a})),n.d(t,"MAIN_THREAD_ID",(function(){return o.b})),n.d(t,"MESSAGE_DELETED",(function(){return o.c}));var c=n(72);n.o(c,"ApiMediaFormat")&&n.d(t,"ApiMediaFormat",(function(){return c.ApiMediaFormat}));var d=n(73);n.d(t,"ApiMediaFormat",(function(){return d.a}));n(74),n(75),n(76),n(77)},function(e,t,n){"use strict";t.a=(...e)=>e.filter(Boolean).join(" ")},function(e,t,n){"use strict";function r(e,t,n=!0,r=!0){let u;return(...o)=>{u?(clearTimeout(u),u=void 0):n&&e(...o),u=self.setTimeout(()=>{r&&e(...o),u=void 0},t)}}function u(e,t,n=!0){let r,u,o;return(...c)=>{u=!0,o=c,r||(n&&(u=!1,e(...o)),r=self.setInterval(()=>{if(!u)return self.clearInterval(r),void(r=void 0);u=!1,e(...o)},t))}}function o(e){return d(m,e)}function c(e){return d(p,e)}function d(e,t){let n,r=!1;return(...u)=>{n=u,r||(r=!0,e(()=>{r=!1,t(...n)}))}}function a(e){Promise.resolve().then(e)}function i(e){self.requestIdleCallback?self.requestIdleCallback(e):a(e)}n.d(t,"a",(function(){return r})),n.d(t,"h",(function(){return u})),n.d(t,"j",(function(){return o})),n.d(t,"i",(function(){return c})),n.d(t,"e",(function(){return a})),n.d(t,"d",(function(){return i})),n.d(t,"f",(function(){return s})),n.d(t,"g",(function(){return f})),n.d(t,"b",(function(){return m})),n.d(t,"c",(function(){return g}));const s=e=>new Promise(t=>{setTimeout(()=>t(),e)});function f(){return new Promise(e=>{m(e)})}let l,b,h;function m(e,t=!1){l?t?b.push(e):l.push(e):(l=t?[]:[e],b=t?[e]:[],requestAnimationFrame(()=>{const e=l,t=b;l=void 0,b=void 0,t.forEach(e=>e()),e.forEach(e=>e())}))}function p(e){m(e,!0)}function g(e,t=!1){return h||(h=[],self.addEventListener("beforeunload",()=>{h.forEach(e=>e())})),t?h.push(e):h.unshift(e),()=>{h=h.filter(t=>t!==e)}}},function(e,t,n){"use strict";n.d(t,"s",(function(){return o})),n.d(t,"J",(function(){return c})),n.d(t,"t",(function(){return d})),n.d(t,"I",(function(){return i})),n.d(t,"N",(function(){return s})),n.d(t,"c",(function(){return f})),n.d(t,"L",(function(){return l})),n.d(t,"K",(function(){return b})),n.d(t,"O",(function(){return p})),n.d(t,"y",(function(){return v})),n.d(t,"d",(function(){return O})),n.d(t,"b",(function(){return j})),n.d(t,"M",(function(){return w})),n.d(t,"fb",(function(){return I})),n.d(t,"k",(function(){return C})),n.d(t,"l",(function(){return E})),n.d(t,"W",(function(){return S})),n.d(t,"eb",(function(){return A})),n.d(t,"h",(function(){return k})),n.d(t,"A",(function(){return T})),n.d(t,"lb",(function(){return N})),n.d(t,"mb",(function(){return P})),n.d(t,"v",(function(){return D})),n.d(t,"Q",(function(){return L})),n.d(t,"P",(function(){return x})),n.d(t,"n",(function(){return F})),n.d(t,"H",(function(){return B})),n.d(t,"o",(function(){return R})),n.d(t,"jb",(function(){return U})),n.d(t,"ib",(function(){return _})),n.d(t,"R",(function(){return $})),n.d(t,"r",(function(){return G})),n.d(t,"kb",(function(){return W})),n.d(t,"p",(function(){return H})),n.d(t,"z",(function(){return K})),n.d(t,"ob",(function(){return J})),n.d(t,"rb",(function(){return Q})),n.d(t,"g",(function(){return Y})),n.d(t,"gb",(function(){return Z})),n.d(t,"m",(function(){return X})),n.d(t,"pb",(function(){return ee})),n.d(t,"qb",(function(){return te})),n.d(t,"S",(function(){return ue})),n.d(t,"T",(function(){return oe})),n.d(t,"V",(function(){return ce})),n.d(t,"U",(function(){return de})),n.d(t,"Z",(function(){return se})),n.d(t,"u",(function(){return fe})),n.d(t,"ab",(function(){return le})),n.d(t,"Y",(function(){return he})),n.d(t,"X",(function(){return me})),n.d(t,"cb",(function(){return ge})),n.d(t,"bb",(function(){return ye})),n.d(t,"w",(function(){return ve})),n.d(t,"x",(function(){return Oe})),n.d(t,"f",(function(){return je})),n.d(t,"e",(function(){return we})),n.d(t,"db",(function(){return Ie})),n.d(t,"a",(function(){return Ce})),n.d(t,"q",(function(){return Ee})),n.d(t,"nb",(function(){return Se})),n.d(t,"hb",(function(){return Ae})),n.d(t,"F",(function(){return Me})),n.d(t,"D",(function(){return ke})),n.d(t,"B",(function(){return Te})),n.d(t,"G",(function(){return Ne})),n.d(t,"C",(function(){return Pe})),n.d(t,"E",(function(){return De})),n.d(t,"i",(function(){return Le})),n.d(t,"j",(function(){return xe}));var r=n(2),u=n(3);function o(e,t,n){return{...e,chats:{...e.chats,listIds:{...e.chats.listIds,[t]:n}}}}function c(e,t,n){const{[t]:r}=e.chats.listIds,u=r&&r.length?n.filter(e=>!r.includes(e)):n;return r&&!u.length?e:o(e,t,[...r||[],...u])}function d(e,t){return{...e,chats:{...e.chats,byId:t}}}function a(e,t,n,r){const{byId:o}=e.chats,c=o[t],d=n.isMin&&c&&!c.isMin,a={...c,...d?Object(u.j)(n,["isMin","accessHash"]):n,...r&&{photos:[r,...c.photos||[]]}};return a.id&&a.type,a}function i(e,t,n,r){const{byId:u}=e.chats;return d(e,{...u,[t]:a(e,t,n,r)})}function s(e,t){const n=Object.keys(t).map(Number).reduce((n,r)=>{const u=a(e,r,t[r]);return u&&(n[r]=u),n},{});return e=d(e,{...e.chats.byId,...n})}function f(e,t){const{byId:n}=e.chats;let r=!1;const u=Object.keys(t).map(Number).reduce((u,o)=>{if(!n[o]||n[o].isMin&&!t[o].isMin){const n=a(e,o,t[o]);n&&(u[o]=n,r||(r=!0))}return u},{});return r&&(e=d(e,{...e.chats.byId,...u})),e}function l(e,t,n){const u=n===r.i?"archived":"active";let o=e.chats.listIds;return Object.keys(o).forEach(e=>{const n=o[e]||[];e!==u||n.includes(t)?e!==u&&n.includes(t)&&(o={...o,[e]:n.filter(e=>e!==t)}):o={...o,[e]:[...n,t]}}),e=i(e={...e,chats:{...e.chats,listIds:o}},t,{folderId:n||void 0})}function b(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}}}}var h=n(8),m=n(7);function p(e,t,n=h.MAIN_THREAD_ID,u="thread",o){const{messageLists:c}=e.messages;let d=c;if(o||r.N)d=t?[{chatId:t,threadId:n,type:u}]:[];else if(t){const e=c[c.length-1];e&&e.chatId===t&&e.threadId===n&&e.type===u||(d=e&&-1===e.chatId?[...c.slice(0,-1),{chatId:t,threadId:n,type:u}]:[...c,{chatId:t,threadId:n,type:u}])}else d=c.slice(0,-1);return{...e,messages:{...e.messages,messageLists:d}}}function g(e,t,n){return y(e,t,{byId:n})}function y(e,t,n){const r=e.messages.byChatId[t]||{byId:{},threadsById:{}};return{...e,messages:{...e.messages,byChatId:{...e.messages.byChatId,[t]:{...r,...n}}}}}function v(e,t,n,r,u){return function(e,t,n,r){const u=e.messages.byChatId[t];return y(e,t,{threadsById:{...u&&u.threadsById,[n]:{...u&&u.threadsById[n],...r}}})}(e,t,n,{[r]:u})}function O(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).map(Number).forEach(t=>{e=j(e,t,n[t])}),e}function j(e,t,n){const r=Object(m.n)(e,t);return r&&Object.keys(n).every(e=>Boolean(r[Number(e)]))?e:g(e,t,{...n,...r})}function w(e,t,n,r){const u=Object(m.n)(e,t)||{},o={...u[n],...r};return o.id?g(e,t,{...u,[n]:o}):e}function I(e,t,n,r){const u=Object(m.sb)(e,t)||{},o={...u[n],...r};return o.id?D(e,t,{...u,[n]:o},void 0):e}function C(e,t,n){const r=Object(m.n)(e,t);if(!r)return e;const o=Object(u.j)(r,n),c=Object.values(Object(u.m)(r,n)).filter(({forwardInfo:e})=>e&&e.isLinkedChannelPost);if(Object.keys(e.messages.byChatId[t].threadsById).map(Number).forEach(r=>{const u=Object(m.Fb)(e,t,r);let o=Object(m.Z)(e,t,r),c=Object(m.hb)(e,t,r),d=Object(m.Kb)(e,t,r),a=Object(m.kb)(e,t),i=u?u.messagesCount:void 0;n.forEach(e=>{o&&o.includes(e)&&(o=o.filter(t=>t!==e),void 0!==i&&(i-=1)),c&&c.includes(e)&&(c=c.filter(t=>t!==e)),d&&d.includes(e)&&(d=d.filter(t=>t!==e)),a&&a.includes(e)&&(a=a.filter(t=>t!==e))}),e=v(e,t,r,"listedIds",o),e=v(e,t,r,"outlyingIds",c),e=v(e,t,r,"viewportIds",d),e=v(e,t,r,"pinnedIds",a),u&&void 0!==i&&(e=v(e,t,r,"threadInfo",{...u,messagesCount:i}))}),c.length){const n=Object(m.z)(e),r=n&&n.chatId===t&&"thread"===n.type,u=n&&n.threadId;c.forEach(n=>{const{fromChatId:o,fromMessageId:c}=n.forwardInfo,d=Object(m.l)(e,o,c);r&&u===c&&(e=p(e,t)),d&&(e=w(e,o,c,{threadInfo:void 0}))})}return e=g(e,t,o)}function E(e,t,n){const r=Object(m.sb)(e,t);if(!r)return e;const o=Object(u.j)(r,n);let c=Object(m.qb)(e,t);return c&&(n.forEach(e=>{c.includes(e)&&(c=c.filter(t=>t!==e))}),e=v(e,t,h.MAIN_THREAD_ID,"scheduledIds",c)),e=D(e,t,o,void 0)}function S(e,t,n,r){const u=Object(m.Z)(e,t,n),o=u&&u.length?r.filter(e=>!u.includes(e)):r;return u&&!o.length?e:v(e,t,n,"listedIds",M([...u||[],...o]))}function A(e,t,n,r){const u=Object(m.hb)(e,t,n),o=u&&u.length?r.filter(e=>!u.includes(e)):r;return u&&!o.length?e:v(e,t,n,"outlyingIds",M([...u||[],...o]))}function M(e){return e.sort((e,t)=>e-t)}function k(e,t,n,u){const o=Object(m.Kb)(e,t,n)||[];if(o.includes(u))return e;return v(e,t,n,"viewportIds",M([...o.length{e=N(e,t.chatId,t.threadId,t)}),e}function D(e,t,n,r){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,hash:r})}function L(e,t,n,r=!1){return{...e,focusedMessage:{...e.focusedMessage,chatId:t,messageId:n,noHighlight:r}}}function x(e,t){return{...e,focusedMessage:{...e.focusedMessage,direction:t}}}function F(e,t,n){return{...e,selectedMessages:{chatId:t,messageIds:n?Array.prototype.concat([],n):[]}}}function B(e,t,n,r,o,c,d,a=!1){const{selectedMessages:i}=e;c&&(d=Object(m.bb)(e,t,c));const s=d||[o];if(!i)return F(e,t,s);const{messageIds:f}=i;let l;const b=s.filter(e=>!f.includes(e));if(b&&!b.length)l=f.filter(e=>!s.includes(e));else if(a&&f.length){const c=Object(m.y)(e,t,n,r),d=c.indexOf(f[f.length-1]),a=c.indexOf(o),i=Math.min(d,a),s=Math.max(d,a),b=c.slice(i,s+1);l=Object(u.o)([...f,...b])}else l=[...f,...b];return l.length?{...e,selectedMessages:{...i,messageIds:l}}:R(e)}function R(e){return{...e,selectedMessages:void 0}}function U(e,t,n,r,o){const c=r.map(t=>{const n=e.stickers.setsById[t.id];return n?{...n,...t}:t});return{...e,stickers:{...e.stickers,setsById:{...e.stickers.setsById,...Object(u.c)(c,"id")},[t]:{...e.stickers[t],hash:n,..."search"===t?{resultIds:o}:{setIds:r.map(({id:e})=>e)}}}}}function _(e,t,n){const r=e.stickers.setsById[t]||{};return{...e,stickers:{...e.stickers,setsById:{...e.stickers.setsById,[t]:{...r,...n}}}}}function $(e,t,n,r){const{results:u}=e.gifs.search;let o;if(t||!u)o=n;else{const e=new Set(u.map(e=>e.id));o=[...u,...n.filter(t=>!e.has(t.id))]}return{...e,gifs:{...e.gifs,search:{...e.gifs.search,offset:r,results:o}}}}function G(e,t){return{...e,animatedEmojis:t}}function W(e,t,n,r){const o=[...Object(m.Ab)(e,t),...n||[]],c=Object(u.o)(o.map(({id:e})=>e)),d=Object(u.c)(o,"id"),a=c.map(e=>d[e]);return{...e,stickers:{...e.stickers,forEmoji:{emoji:t,stickers:a,hash:r}}}}function H(e){const{emoji:t,stickers:n,hash:r}=e.stickers.forEmoji||{};return t?W(e,t,n,r):e}var z=n(52);function K(e,t){return{...e,users:{...e.users,byId:t}}}function V(e,t,n){const{byId:r}=e.users,o=r[t],c=n.isMin&&o&&!o.isMin,d={...o,...c?Object(u.j)(n,["isMin","accessHash"]):n};return d.id&&d.type?d:o}function q(e,t){const{hash:n,userIds:r}=e.contactList||{};if(!r)return e;const u=t.filter(e=>e&&e.isContact&&!r.includes(e.id)).map(e=>e.id);return 0===u.length?e:{...e,contactList:{hash:n||0,userIds:[...u,...r]}}}function J(e,t,n){const{byId:r}=e.users,u=V(e,t,n);return K(e=q(e,[u]),{...r,[t]:u})}function Q(e,t){const n=Object.keys(t).map(Number).reduce((n,r)=>{const u=V(e,r,t[r]);return u&&(n[r]=u),n},{});return e=K(e=q(e,Object.values(n)),{...e.users.byId,...n})}function Y(e,t){const{byId:n}=e.users;let r=!1;const u=Object.keys(t).map(Number).reduce((u,o)=>{if(!n[o]||n[o].isMin&&!t[o].isMin){const n=V(e,o,t[o]);n&&(u[o]=n,r||(r=!0))}return u},{});return r&&(e=q(e=K(e,{...e.users.byId,...u}),Object.values(u))),e}function Z(e,t){return e.users.selectedId===t?e:{...e,users:{...e.users,selectedId:t}}}function X(e,t){const{byId:n}=e.users,{hash:r,userIds:u}=e.contactList||{};return delete n[t],K(e={...e,contactList:{hash:r||0,userIds:u?u.filter(e=>e!==t):z.a}},n)}function ee(e,t){return{...e,userSearch:{...e.userSearch,...t}}}function te(e,t){return ee(e,{fetchingStatus:t})}function ne(e,t,n){const{byId:r}=e.users,u=r[t];return u&&u.fullInfo?J(e,t,{...u,fullInfo:{...u.fullInfo,isBlocked:n}}):e}const re=e=>`${e.chatId}_${e.id}`;function ue(e,t){return{...e,globalSearch:{...e.globalSearch,...t}}}function oe(e,t){return ue(e,{currentContent:t})}function ce(e,t,n,r,o){const{resultsByType:c}=e.globalSearch||{},d=t.reduce((e,t)=>(e[re(t)]=t,e),{}),a=c&&c[r]?c[r].foundIds:void 0;if(void 0!==a&&Object.keys(d).every(e=>a.includes(re(d[e]))))return de(e,{messages:!1});const i=a||[],s=t.map(e=>re(e)),f=Array.prototype.concat(i,s),l=Object(u.a)(i,f)?i:f;return ue(e=de(e,{messages:!1}),{resultsByType:{...(e.globalSearch||{}).resultsByType,[r]:{totalCount:n,nextOffsetId:o,foundIds:l}}})}function de(e,t){return ue(e,{fetchingStatus:{...e.globalSearch.fetchingStatus,...t}})}var ae=n(4);function ie(e,t,n){return{...e,localTextSearch:{byChatThreadKey:{...e.localTextSearch.byChatThreadKey,[t]:n}}}}function se(e,t,n,r,u){const o=Object(ae.a)(t,n);return ie(e,o,{...e.localTextSearch.byChatThreadKey[o],isActive:r,query:u})}function fe(e,t,n,r,u,o){const c=Object(ae.a)(t,n);return ie(e,c,{...e.localTextSearch.byChatThreadKey[c],results:{foundIds:r,totalCount:u,nextOffsetId:o}})}function le(e,t,n,r,o,c){const d=Object(ae.a)(t,n),{results:a}=e.localTextSearch.byChatThreadKey[d]||{},i=a&&a.foundIds||[],s=pe(Object(u.o)(Array.prototype.concat(i,r)));return fe(e,t,n,Object(u.a)(i,s)?i:s,o,c)}function be(e,t,n){return{...e,localMediaSearch:{byChatId:{...e.localMediaSearch.byChatId,[t]:n}}}}function he(e,t,n){return be(e,t,{...e.localMediaSearch.byChatId[t],currentType:n})}function me(e,t,n,r,o,c){const{resultsByType:d}=e.localMediaSearch.byChatId[t]||{},a=d&&d[n]?d[n].foundIds:[],i=pe(Object(u.o)(Array.prototype.concat(a,r)));return function(e,t,n,r,u,o){return be(e,t,{...e.localMediaSearch.byChatId[t],resultsByType:{...(e.localMediaSearch.byChatId[t]||{}).resultsByType,[n]:{foundIds:r,totalCount:u,nextOffsetId:o}}})}(e,t,n,Object(u.a)(a,i)?a:i,o,c)}function pe(e){return e.sort((e,t)=>e-t)}function ge(e,t){return{...e,management:{...e.management,progress:t}}}function ye(e,t,n){return{...e,management:{...e.management,byChatId:{...e.management.byChatId,[t]:{...e.management.byChatId[t]||{},...n}}}}}function ve(e,t){return{...e,settings:{...e.settings,byKey:{...e.settings.byKey,...t}}}}function Oe(e,t,n){return{...e,settings:{...e.settings,themes:{...e.settings.themes,[t]:{...e.settings.themes[t]||{},...n}}}}}function je(e,t){return t.forEach(t=>{const{chatId:n,...r}=t;e=we(e,n,r)}),e}function we(e,t,n){return{...e,settings:{...e.settings,notifyExceptions:{...e.settings.notifyExceptions,[t]:n}}}}function Ie(e,t,n,r){switch(t){case"contact":return ve(e,{...void 0!==n&&{hasPrivateChatsNotifications:!n},...void 0!==r&&{hasPrivateChatsMessagePreview:r}});case"group":return ve(e,{...void 0!==n&&{hasGroupNotifications:!n},...void 0!==r&&{hasGroupMessagePreview:r}});case"broadcast":return ve(e,{...void 0!==n&&{hasBroadcastNotifications:!n},...void 0!==r&&{hasBroadcastMessagePreview:r}});default:return}}function Ce(e,t){return e=ne(e,t,!0),{...e,blocked:{...e.blocked,ids:[t,...e.blocked.ids],totalCount:e.blocked.totalCount+1}}}function Ee(e,t){return e=ne(e,t,!1),{...e,blocked:{...e.blocked,ids:e.blocked.ids.filter(e=>e!==t),totalCount:e.blocked.totalCount-1}}}function Se(e,t){return{...e,twoFaSettings:{...e.twoFaSettings,...t}}}function Ae(e,t){return{...e,payment:{...e.payment,shippingOptions:t}}}function Me(e,t){return{...e,payment:{...e.payment,formId:t}}}function ke(e,t){return{...e,payment:{...e.payment,step:t}}}function Te(e,t){if(!t.content||!t.content.invoice)return e;const{title:n,text:r,description:u,photoUrl:o}=t.content.invoice;return{...e,payment:{...e.payment,invoiceContent:{title:n,text:r,description:u,photoUrl:o}}}}function Ne(e,t){return{...e,payment:{...e.payment,stripeCredentials:{...t}}}}function Pe(e,t){return{...e,payment:{...e.payment,...t}}}function De(e,t,n){if(!t||!n)return{...e,payment:{...e.payment,receipt:void 0}};const{invoice:r}=n.content,{photoUrl:u,text:o,title:c}=r||{};return{...e,payment:{...e.payment,receipt:{...t,photoUrl:u,text:o,title:c}}}}function Le(e){return{...e,payment:{}}}function xe(e){return{...e,payment:{...e.payment,isPaymentModalOpen:!1}}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return u})),n.d(t,"c",(function(){return o})),n.d(t,"d",(function(){return c})),n.d(t,"b",(function(){return d}));const r=self.caches;let u;async function o(e,t,n){if(r)try{const o=new Request(t.replace(/:/g,"_")),c=await r.open(e),d=await c.match(o);if(!d)return;switch(n){case u.Text:return await d.text();case u.Blob:{const e=await d.blob();if("sticker"===t.substr(0,7))return new Blob([e],{type:"image/webp"});if(!e.type){const t=d.headers.get("Content-Type");if(t)return new Blob([e],{type:t})}return e}case u.Json:return await d.json();default:return}}catch(e){return void console.warn(e)}}async function c(e,t,n){if(r)try{const u="string"==typeof n||n instanceof Blob?n:JSON.stringify(n),o=new Request(t.replace(/:/g,"_")),c=new Response(u),d=await r.open(e);return await d.put(o,c)}catch(e){return void console.warn(e)}}async function d(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"}(u||(u={}))},function(e,t,n){"use strict";let r,u,o,c,d,a,i,s,f,l,b,h,m;n.d(t,"e",(function(){return r})),n.d(t,"b",(function(){return u})),n.d(t,"n",(function(){return o})),n.d(t,"d",(function(){return c})),n.d(t,"c",(function(){return d})),n.d(t,"m",(function(){return a})),n.d(t,"h",(function(){return i})),n.d(t,"a",(function(){return s})),n.d(t,"k",(function(){return f})),n.d(t,"f",(function(){return l})),n.d(t,"i",(function(){return b})),n.d(t,"l",(function(){return h})),n.d(t,"j",(function(){return m})),n.d(t,"o",(function(){return p})),n.d(t,"g",(function(){return g})),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"}(u||(u={})),function(e){e[e.Main=0]="Main",e[e.EditProfile=1]="EditProfile",e[e.Notifications=2]="Notifications",e[e.Language=3]="Language",e[e.General=4]="General",e[e.GeneralChatBackground=5]="GeneralChatBackground",e[e.GeneralChatBackgroundColor=6]="GeneralChatBackgroundColor",e[e.Privacy=7]="Privacy",e[e.PrivacyPhoneNumber=8]="PrivacyPhoneNumber",e[e.PrivacyLastSeen=9]="PrivacyLastSeen",e[e.PrivacyProfilePhoto=10]="PrivacyProfilePhoto",e[e.PrivacyForwarding=11]="PrivacyForwarding",e[e.PrivacyGroupChats=12]="PrivacyGroupChats",e[e.PrivacyPhoneNumberAllowedContacts=13]="PrivacyPhoneNumberAllowedContacts",e[e.PrivacyPhoneNumberDeniedContacts=14]="PrivacyPhoneNumberDeniedContacts",e[e.PrivacyLastSeenAllowedContacts=15]="PrivacyLastSeenAllowedContacts",e[e.PrivacyLastSeenDeniedContacts=16]="PrivacyLastSeenDeniedContacts",e[e.PrivacyProfilePhotoAllowedContacts=17]="PrivacyProfilePhotoAllowedContacts",e[e.PrivacyProfilePhotoDeniedContacts=18]="PrivacyProfilePhotoDeniedContacts",e[e.PrivacyForwardingAllowedContacts=19]="PrivacyForwardingAllowedContacts",e[e.PrivacyForwardingDeniedContacts=20]="PrivacyForwardingDeniedContacts",e[e.PrivacyGroupChatsAllowedContacts=21]="PrivacyGroupChatsAllowedContacts",e[e.PrivacyGroupChatsDeniedContacts=22]="PrivacyGroupChatsDeniedContacts",e[e.PrivacyActiveSessions=23]="PrivacyActiveSessions",e[e.PrivacyBlockedUsers=24]="PrivacyBlockedUsers",e[e.Folders=25]="Folders",e[e.FoldersCreateFolder=26]="FoldersCreateFolder",e[e.FoldersEditFolder=27]="FoldersEditFolder",e[e.FoldersEditFolderFromChatList=28]="FoldersEditFolderFromChatList",e[e.FoldersIncludedChats=29]="FoldersIncludedChats",e[e.FoldersIncludedChatsFromChatList=30]="FoldersIncludedChatsFromChatList",e[e.FoldersExcludedChats=31]="FoldersExcludedChats",e[e.FoldersExcludedChatsFromChatList=32]="FoldersExcludedChatsFromChatList",e[e.TwoFaDisabled=33]="TwoFaDisabled",e[e.TwoFaNewPassword=34]="TwoFaNewPassword",e[e.TwoFaNewPasswordConfirm=35]="TwoFaNewPasswordConfirm",e[e.TwoFaNewPasswordHint=36]="TwoFaNewPasswordHint",e[e.TwoFaNewPasswordEmail=37]="TwoFaNewPasswordEmail",e[e.TwoFaNewPasswordEmailCode=38]="TwoFaNewPasswordEmailCode",e[e.TwoFaEnabled=39]="TwoFaEnabled",e[e.TwoFaChangePasswordCurrent=40]="TwoFaChangePasswordCurrent",e[e.TwoFaChangePasswordNew=41]="TwoFaChangePasswordNew",e[e.TwoFaChangePasswordConfirm=42]="TwoFaChangePasswordConfirm",e[e.TwoFaChangePasswordHint=43]="TwoFaChangePasswordHint",e[e.TwoFaTurnOff=44]="TwoFaTurnOff",e[e.TwoFaRecoveryEmailCurrentPassword=45]="TwoFaRecoveryEmailCurrentPassword",e[e.TwoFaRecoveryEmail=46]="TwoFaRecoveryEmail",e[e.TwoFaRecoveryEmailCode=47]="TwoFaRecoveryEmailCode",e[e.TwoFaCongratulations=48]="TwoFaCongratulations"}(o||(o={})),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"}(c||(c={})),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"}(d||(d={})),function(e){e[e.ChatInfo=0]="ChatInfo",e[e.UserInfo=1]="UserInfo",e[e.Search=2]="Search",e[e.Management=3]="Management",e[e.StickerSearch=4]="StickerSearch",e[e.GifSearch=5]="GifSearch",e[e.PollResults=6]="PollResults",e[e.AddingMembers=7]="AddingMembers"}(a||(a={})),function(e){e[e.Inline=0]="Inline",e[e.ScheduledInline=1]="ScheduledInline",e[e.SharedMedia=2]="SharedMedia",e[e.ProfileAvatar=3]="ProfileAvatar",e[e.MiddleHeaderAvatar=4]="MiddleHeaderAvatar",e[e.Album=5]="Album",e[e.ScheduledAlbum=6]="ScheduledAlbum",e[e.SearchResult=7]="SearchResult"}(i||(i={})),function(e){e[e.Idle=0]="Idle",e[e.InProgress=1]="InProgress",e[e.Complete=2]="Complete",e[e.Error=3]="Error"}(s||(s={})),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"}(l||(l={})),function(e){e[e.Closed=0]="Closed",e[e.InProgress=1]="InProgress",e[e.Loading=2]="Loading"}(b||(b={})),function(e){e[e.Profile=0]="Profile",e[e.SharedMedia=1]="SharedMedia",e[e.MemberList=2]="MemberList"}(h||(h={})),function(e){e[e.ShippingInfo=0]="ShippingInfo",e[e.Shipping=1]="Shipping",e[e.PaymentInfo=2]="PaymentInfo",e[e.Checkout=3]="Checkout"}(m||(m={}));const p="UPLOADING_WALLPAPER_SLUG";let g;!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.GroupUserPermissionsCreate=7]="GroupUserPermissionsCreate",e[e.GroupUserPermissions=8]="GroupUserPermissions",e[e.ChatAdministrators=9]="ChatAdministrators",e[e.GroupRecentActions=10]="GroupRecentActions",e[e.ChatAdminRights=11]="ChatAdminRights",e[e.GroupMembers=12]="GroupMembers"}(g||(g={}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return h})),n.d(t,"b",(function(){return y})),n.d(t,"c",(function(){return v})),n.d(t,"d",(function(){return O}));var r=n(2),u=n(12),o=n(5);var c=n(51),d=n(1);const a=/%\d?\$?[sdf@]/g,i=["value","zeroValue","oneValue","twoValue","fewValue","manyValue","otherValue"],s={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 l,b;const{addCallback:h,removeCallback:m,runCallbacks:p}=function(){const e=[];function t(t){const n=e.indexOf(t);-1!==n&&e.splice(n,1)}return{runCallbacks:function(...t){e.forEach(e=>{e(...t)})},addCallback:function(n){return e.push(n),()=>{t(n)}},removeCallback:t}}();let g;const y=(e,t,n)=>{if(void 0!==t){const r=Array.isArray(t)?JSON.stringify(t):t,u=f.get(`${e}_${r}_${n}`);if(u)return u}if(!l&&!b)return e;const r=l&&l[e]||b&&b[e];return r?w(r,e,t,n):(b||j(),e)};async function v(e,t){let n=await u.c(r.O,`${r.v}_${e}_${t}`,u.a.Json);return n||(n=await async function(e,t,n){const c=await Object(o.a)("fetchLangStrings",{langPack:e,langCode:t,keys:[n]});if(c&&c.length)return await u.d(r.O,`${e}_${t}_${n}`,c[0]),c[0];return}(r.v,e,t)),w(n,t)}async function O(e,t,n=!1){if(l&&e===g)return void(t&&t());let c=await u.c(r.O,e,u.a.Json);if(!c&&(n&&await j(),c=await async function(e){const t=await Object(o.a)("fetchLangPack",{sourceLangPacks:r.P,langCode:e});if(t)return await u.d(r.O,e,t.langPack),t.langPack;return}(e),!c))return;f.clear(),g=e,l=c,document.documentElement.lang=e;const{languages:a}=Object(d.e)().settings.byKey,i=a?a.find(t=>t.langCode===e):void 0;y.isRtl=Boolean(i&&i.rtl),y.code=e,t&&t(),p()}async function j(){b||(b=(await n.e(9).then(n.bind(null,333))).default,p())}function w(e,t,n,u){const o=e?e["number"==typeof n?function(e){const t=g||r.u,n=s[t]?s[t](e):0;return i[n]}(n):"value"]:void 0;if(!o||!o.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(a),r=n.shift();return n.reduce((e,n,r)=>`${e}${String(t[r]||"")}${n}`,r||"")}(o,"i"===u?Object(c.a)(n):n),r=Array.isArray(n)?JSON.stringify(n):n;return f.set(`${t}_${r}_${u}`,e),e}return o}},function(e,t,n){"use strict";n.d(t,"a",(function(){return u})),n.d(t,"d",(function(){return d})),n.d(t,"c",(function(){return a})),n.d(t,"b",(function(){return s}));var r=n(2);let u;!function(e){e[e.Auth=0]="Auth",e[e.Main=1]="Main",e[e.Extra=2]="Extra"}(u||(u={}));const o={},c={};async function d(e,t){if(!o[e]){switch(e){case u.Auth:o[u.Auth]=n.e(5).then(n.bind(null,107));break;case u.Main:r.r&&console.log(">>> START LOAD MAIN BUNDLE"),o[u.Main]=Promise.all([n.e(0),n.e(4)]).then(n.bind(null,105));break;case u.Extra:o[u.Extra]=Promise.all([n.e(0),n.e(3)]).then(n.bind(null,106))}o[e].then(f)}const d=await o[e];return c[e]||(c[e]=d),a(e,t)}function a(e,t){const n=c[e];if(n)return n[t]}const i=[];function s(e){i.includes(e)||i.push(e)}function f(){i.forEach(e=>{e()})}},function(e,t,n){"use strict";n.d(t,"d",(function(){return o})),n.d(t,"a",(function(){return c})),n.d(t,"b",(function(){return d})),n.d(t,"g",(function(){return a})),n.d(t,"h",(function(){return i})),n.d(t,"c",(function(){return s})),n.d(t,"e",(function(){return f})),n.d(t,"f",(function(){return l}));var r=n(10);function u(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}"undefined"==typeof File&&(self.File=class extends Blob{constructor(e,t,n){if(n){const{type:t,...r}=n;super(e,{type:t}),u(this,"name",void 0),Object.assign(this,r)}else super(e),u(this,"name",void 0);this.name=t}});function o(e){const t=e.split(","),n=t[0].match(/:(.*?);/)[1],r=atob(t[1]);let u=r.length;const o=new Uint8Array(u);for(;u--;)o[u]=r.charCodeAt(u);return new Blob([o],{type:n})}function c(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 d(e,t){return new File([e],t,{lastModified:Date.now(),type:e.type})}function a(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 s(e){const t=await i(e);return Promise.race([Object(r.f)(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 f(e){return(await fetch(e)).blob()}function l(e){const t=document.createElement("canvas");t.width=e.width,t.height=e.height;return t.getContext("2d").drawImage(e,0,0),t}},function(e,t,n){"use strict";var r=n(14),u=n(32),o=n(53);t.a=()=>{const e=Object(u.a)();return Object(o.a)(()=>r.a(e),[e]),r.b}},function(e,t,n){"use strict";function r(e){return new Promise((t,n)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>n(e.error)})}let u;function o(){return u||(u=function(e,t){const n=indexedDB.open(e);n.onupgradeneeded=()=>n.result.createObjectStore(t);const u=r(n);return(e,n)=>u.then(r=>n(r.transaction(t,e).objectStore(t)))}("keyval-store","keyval")),u}function c(e,t){return e("readonly",e=>(e.openCursor().onsuccess=function(){this.result&&(t(this.result),this.result.continue())},r(e.transaction)))}n.d(t,"c",(function(){return s})),n.d(t,"f",(function(){return f})),n.d(t,"b",(function(){return l})),n.d(t,"e",(function(){return b})),n.d(t,"d",(function(){return h})),n.d(t,"a",(function(){return m}));var d=n(2),a=n(12);const i=[1,2,3,4,5];function s(e=!1){if(e&&localStorage.getItem(d.Q))return!0;const t=localStorage.getItem(d.zb);if(!t)return!1;try{const e=JSON.parse(t);return Boolean(e&&e.id&&e.dcID)}catch(e){return!1}}function f(e,t){const{mainDcId:n,keys:r,hashes:u}=e;localStorage.setItem(d.zb,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]))}),Object.keys(u).map(Number).forEach(e=>{localStorage.setItem(`dc${e}_hash`,JSON.stringify(u[e]))})}function l(){[d.zb,"dc",...i.map(e=>`dc${e}_auth_key`),...i.map(e=>`dc${e}_hash`)].forEach(e=>{localStorage.removeItem(e)})}function b(){if(!s())return;const e=JSON.parse(localStorage.getItem(d.zb)),t=Number(e.dcID),n={},r={};return i.forEach(e=>{try{const t=localStorage.getItem(`dc${e}_auth_key`);t&&(n[e]=JSON.parse(t));const u=localStorage.getItem(`dc${e}_hash`);u&&(r[e]=JSON.parse(u))}catch(e){d.r&&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(d.Q);if(!e)return;const t=await function(e,t=o()){return t("readonly",t=>r(t.get(e)))}("GramJs:"+e);try{f(JSON.parse(t))}catch(e){d.r&&console.warn("Failed to load legacy session",e)}}async function m(){localStorage.removeItem(d.Q);const e=await function(e=o()){const t=[];return c(e,e=>t.push(e.key)).then(()=>t)}();await Promise.all([a.b("GramJs"),...e.filter(e=>"string"==typeof e&&e.startsWith("GramJs:GramJs-session-")).map(e=>function(e,t=o()){return t("readwrite",t=>(t.delete(e),r(t.transaction)))}(e))])}},function(e,t,n){"use strict";n.d(t,"b",(function(){return o}));const r=/\uFE0F/g,u=String.fromCharCode(8205);function o(e){return e.indexOf(u)<0?e.replace(r,""):e}t.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},function(e,t,n){"use strict";var r=n(0),u=n(27);n(96);t.a=Object(r.h)(({color:e="blue"})=>r.a.createElement("div",{className:"Loading"},r.a.createElement(u.a,{color:e,withBackground:"white"===e})))},function(e,t,n){"use strict";n.d(t,"b",(function(){return y})),n.d(t,"e",(function(){return j})),n.d(t,"d",(function(){return I})),n.d(t,"c",(function(){return C})),n.d(t,"a",(function(){return E}));var r=n(5),u=n(8),o=n(68),c=n(2),d=n(1),a=n(4),i=n(14),s=n(11),f=n(7),l=n(6),b=n(33),h=n(10);function m(e){const t=e.toJSON();return JSON.stringify({endpoint:t.endpoint,keys:t.keys})}function p(){return!!l.k&&("showNotification"in ServiceWorkerRegistration.prototype?"denied"===Notification.permission?(c.r&&console.warn("[PUSH] The user has blocked push notifications."),!1):"PushManager"in window||(c.r&&console.warn("[PUSH] Push messaging isn't supported."),!1):(c.r&&console.warn("[PUSH] Push notifications aren't supported."),!1))}const g=new Set;const y=Object(h.a)((async function(e){if(g.has(e))return;const{notificationSoundVolume:t}=Object(f.fb)(Object(d.e)()),n=t/10;if(0===n)return;const r=new Audio("/notification.mp3");r.volume=n,r.setAttribute("mozaudiochannel","notification"),r.addEventListener("ended",()=>{g.add(e)},{once:!0}),setTimeout(()=>{g.delete(e)},3e3);try{await r.play()}catch(e){c.r&&console.warn("[PUSH] Unable to play notification sound")}}),1e3,!0,!1);async function v(){"Notification"in window&&(["granted","denied"].includes(Notification.permission)||await Notification.requestPermission())}async function O(e){const t=Object(d.e)(),n=Object(d.d)();if(e)try{const t=m(e);return await Object(r.a)("unregisterDevice",t),await e.unsubscribe(),void n.deleteDeviceToken()}catch(e){c.r&&console.log("[PUSH] Unable to unsubscribe from push.",e)}t.push&&(await Object(r.a)("unregisterDevice",t.push.deviceToken),n.deleteDeviceToken())}async function j(){if(!p())return;const e=await navigator.serviceWorker.ready,t=await e.pushManager.getSubscription();await O(t)}let w=!1;async function I(){if(!p())return void await v();const e=await navigator.serviceWorker.ready;let t=await e.pushManager.getSubscription();if(function(e){const t=Object(d.e)();return!t.push||!e||(m(e)!==t.push.deviceToken||Date.now()-t.push.subscribedAt>432e5)}(t)){await O(t);try{t=await e.pushManager.subscribe({userVisibleOnly:!0});const n=m(t);c.r&&console.log("[PUSH] Received push subscription: ",n),await Object(r.a)("registerDevice",n),Object(d.d)().setDeviceToken(n)}catch(e){"denied"===Notification.permission?c.r&&console.warn("[PUSH] The user has blocked push notifications."):c.r&&(console.log("[PUSH] Unable to subscribe to push.",e),e.code===DOMException.ABORT_ERR&&await v())}}}async function C({chat:e,message:t,isActiveChat:n}){if(!("Notification"in window?"denied"!==Notification.permission||(c.r&&console.warn("[PUSH] The user has blocked push notifications."),0):(c.r&&console.warn("[PUSH] This browser does not support desktop notification"),0)))return;if(!t.id)return;if(await async function(){if(w)return;const[e,t]=await Promise.all([Object(r.a)("fetchNotificationSettings",{serverTimeOffset:Object(d.e)().serverTimeOffset}),Object(r.a)("fetchNotificationExceptions",{serverTimeOffset:Object(d.e)().serverTimeOffset})]);if(!e)return;let n=Object(s.w)(Object(d.e)(),e);t&&(n=Object(s.f)(n,t)),Object(d.g)(n),w=!0}(),!function(e,t){if(!w)return!1;const n=Object(d.e)();return!(Object(a.Hb)(e,Object(f.fb)(n),Object(f.eb)(n))||e.isNotJoined||!e.isListed)&&!(t&&document.hasFocus())}(e,n))return;const{title:l,body:h}=function(e,t){const n=Object(d.e)(),{senderId:r,replyToMessageId:u}=t,c=r?Object(f.Jb)(n,r):void 0,s=Object(a.s)(t),l=s&&u?Object(f.l)(n,e.id,u):void 0,{targetUserIds:b,targetChatId:h}=s||{},m=b?b.map(e=>Object(f.Jb)(n,e)).filter(Boolean):void 0,p=Object(a.W)(e),g=p?Object(f.Jb)(n,p):void 0;let y;if(Object(a.Ib)(e,Object(f.fb)(n),Object(f.eb)(n)))if(Object(a.gb)(t)){const n=e&&(Object(a.mb)(e)||t.senderId===t.chatId)?e:c;y=Object(o.a)(i.b,t,n,m,l,h,{asPlain:!0})}else{const n=Object(a.K)(i.b,e.id,c),r=Object(a.O)(i.b,t);y=n?`${n}: ${r}`:r}else y="New message";return{title:Object(a.k)(i.b,e,g),body:y}}(e,t),m=await async function(e){const t=Object(a.e)(e);if(!t)return;let n=b.c(t);return n||(await b.b(t,u.ApiMediaFormat.BlobUrl),n=b.c(t)),n}(e);if(p())navigator.serviceWorker.controller&&navigator.serviceWorker.controller.postMessage({type:"newMessageNotification",payload:{title:l,body:h,icon:m,chatId:e.id,messageId:t.id}});else{const n=Object(d.d)(),r={body:h,icon:m,badge:m,tag:t.id.toString()};"vibrate"in navigator&&(r.vibrate=[200,100,200]);const u=new Notification(l,r);u.onclick=()=>{u.close(),n.focusMessage({chatId:e.id,messageId:t.id}),window.focus&&window.focus()},u.onshow=()=>{y(t.id||e.id)}}}function E(){navigator.serviceWorker.controller&&navigator.serviceWorker.controller.postMessage({type:"clientReady"})}},function(e,t,n){"use strict";var r=n(0),u=n(9),o=n(27),c=n(45);n(94);t.a=({ref:e,type:t="button",onClick:n,onContextMenu:d,onMouseDown:a,onMouseEnter:i,onMouseLeave:s,onFocus:f,children:l,size:b="default",color:h="primary",className:m,round:p,pill:g,fluid:y,isText:v,isLoading:O,ariaLabel:j,href:w,download:I,disabled:C,ripple:E,faded:S,tabIndex:A,isRtl:M})=>{let k=Object(r.q)(null);e&&(k=e);const[T,N]=Object(r.r)(!1),P=Object(u.a)("Button",m,b,h,p&&"round",g&&"pill",y&&"fluid",C&&"disabled",v&&"text",O&&"loading",E&&"has-ripple",S&&"faded",T&&"clicked"),D=Object(r.m)(e=>{!C&&n&&n(e),N(!0),setTimeout(()=>{N(!1)},400)},[C,n]),L=Object(r.m)(e=>{e.preventDefault(),!C&&a&&a(e)},[a,C]);return w?r.a.createElement("a",{ref:k,className:P,href:w,title:j,download:I,tabIndex:A,dir:M?"rtl":void 0},l,!C&&E&&r.a.createElement(c.a,null)):r.a.createElement("button",{ref:k,type:t,className:P,onClick:D,onContextMenu:d,onMouseDown:L,onMouseEnter:i&&!C?i:void 0,onMouseLeave:s&&!C?s:void 0,onFocus:f&&!C?f:void 0,"aria-label":j,title:j,tabIndex:A,dir:M?"rtl":void 0},O?r.a.createElement("div",null,r.a.createElement("span",{dir:M?"auto":void 0},"Please wait.."),r.a.createElement(o.a,{color:v?"blue":"white"})):l,!C&&E&&r.a.createElement(c.a,null))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return b}));var r=n(0),u=n(19),o=n(2),c=n(6),d=n(66),a=n(9),i=n(78),s=n(59);const f=/^[\d\wа-яё]$/i,l=/(\*\*|__).+?\1/g;function b(e,t=["emoji"],n){return"string"!=typeof e?[e]:t.reduce((e,t)=>{switch(t){case"escape_html":return function(e){const t=document.createElement("div");return e.reduce((e,n)=>"string"!=typeof n?[...e,n]:(t.innerText=n,[...e,t.innerHTML]),[])}(e);case"hq_emoji":return u.a.lastIndex=0,h(e,"big","jsx");case"emoji":return u.a.lastIndex=0,h(e,"small","jsx");case"emoji_html":return u.a.lastIndex=0,h(e,"small","html");case"br":return m(e,"jsx");case"br_html":return m(e,"html");case"highlight":return o=e,c=n.highlight,o.reduce((e,t)=>{if("string"!=typeof t||!c)return[...e,t];const n=t.toLowerCase(),u=n.indexOf(c.toLowerCase()),o=n[u+c.length];if(u<0||o&&o.match(f))return[...e,t];const d=[];return d.push(t.substring(0,u)),d.push(r.a.createElement("span",{className:"matching-text-highlight"},t.substring(u,u+c.length))),d.push(t.substring(u+c.length)),[...e,...d]},[]);case"links":return function(e){return e.reduce((e,t)=>{if("string"!=typeof t)return[...e,t];const n=t.match(p);if(!n||!n.length)return[...e,t];const u=[];let o=n.shift(),c=0;for(;o;){const e=t.indexOf(o,c);u.push(t.substring(c,e)),o.startsWith("@")?u.push(r.a.createElement(i.a,{username:o},o)):(o.endsWith("?")&&(o=o.slice(0,o.length-1)),u.push(r.a.createElement(s.a,{text:o,url:o}))),c=e+o.length,o=n.shift()}return u.push(t.substring(c)),[...e,...u]},[])}(e);case"simple_markdown":return g(e,"jsx");case"simple_markdown_html":return g(e,"html")}var o,c;return e},[e])}function h(e,t,n){return c.d?e:e.reduce((e,o)=>{if("string"!=typeof o)return[...e,o];const c=o.split(u.a),i=o.match(u.a)||[];return e.push(c[0]),i.reduce((e,o,i)=>{const s=Object(d.a)(Object(u.b)(o)),f=Object(a.a)("emoji","small"===t&&"emoji-small");"jsx"===n&&e.push(r.a.createElement("img",{className:f,src:`./img-apple-${"big"===t?"160":"64"}/${s}.png`,alt:o})),"html"===n&&e.push(`${o}`);const l=2*i+2;return c[l]&&e.push(c[l]),e},e)},[])}function m(e,t){return e.reduce((e,n)=>"string"!=typeof n?[...e,n]:[...e,...n.split(/\r\n|\r|\n/g).reduce((e,n,u,o)=>{const c=n.trimLeft(),d=n.length-c.length;return e.push(String.fromCharCode(160).repeat(d)+c),u!==o.length-1&&e.push("jsx"===t?r.a.createElement("br",null):"
"),e},[])],[])}const p=new RegExp(`${o.rb}|${o.sb}`,"ig");function g(e,t){return e.reduce((e,n)=>{if("string"!=typeof n)return[...e,n];const u=n.split(l),o=n.match(l)||[];return e.push(u[0]),o.reduce((e,n,o)=>{"jsx"===t?e.push(n.startsWith("**")?r.a.createElement("b",null,n.replace(/\*\*/g,"")):r.a.createElement("i",null,n.replace(/__/g,""))):e.push(n.startsWith("**")?`${n.replace(/\*\*/g,"")}`:`${n.replace(/__/g,"")}`);const c=2*o+2;return u[c]&&e.push(u[c]),e},e)},[])}},function(e,t,n){"use strict";n.d(t,"d",(function(){return c})),n.d(t,"e",(function(){return d})),n.d(t,"b",(function(){return a})),n.d(t,"c",(function(){return i})),n.d(t,"a",(function(){return o}));const r={},u=/(\d{1,3})(\d{1,3})?(\d{1,3})?(\d{1,3})?(\d{1,3})?/;var o="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".split("\n").map(e=>({id:e.substr(0,2),flag:e.substr(2,4),code:"+"+e.match(/\d+/)[0],name:e.split(/\d+/)[1],phoneFormat:function(e){if(!e)return u;const t=e[0];let n;if(!r[t]){const e=t.split("").map(Number);n=e.reduce((e,t,n)=>`${e}(\\d{1,${t}})${n>0?"?":""}`,""),r[t]=new RegExp(`${n}${"()?".repeat(5-e.length)}`)}return r[t]}(e.match(/\d+$/))}));function c(e){return o.find(t=>t.id===e)}function d(e){let t=e.replace(/[^\d+]+/g,"");t.startsWith("+")||(t="+"+t);const n=o.filter(e=>t.startsWith(e.code)).sort((e,t)=>e.code.length-t.code.length);return n[n.length-1]}function a(e,t){let n=e.replace(/[^\d]+/g,"");if(t)n=n.substr(t.code.length-1);else if(e.startsWith("+"))return e;return n=n.replace(function(e){return e?e.phoneFormat:u}(t),(e,n,r,u,o,c)=>{const d=t&&"GB"===t.id?" ":"-";let a="";return n&&(a=""+n),r&&(a+=" "+r),u&&(a+=`${d}${u}`),o&&(a+=`${d}${o}`),c&&(a+=`${d}${c}`),a}),n}function i(e){const t=e.startsWith("+")?e:"+"+e,n=d(t);return n?`${n.code} ${a(t,n)}`:t}},function(e,t,n){"use strict";var r=n(0);t.a=(e=!1)=>{const[t,n]=Object(r.r)(e);return[t,Object(r.m)(()=>{n(!0)},[]),Object(r.m)(()=>{n(!1)},[])]}},function(e,t,n){"use strict";var r=n(0),u=n(15),o=n(32);t.a=(e,t,n=!1,c=!1)=>{const d=Object(u.c)(e,t),a=Object(o.a)();return c&&Object(u.b)(a),Object(r.n)(()=>{n||d||Object(u.d)(e,t).then(a)},[e,a,d,t,n]),d}},function(e,t,n){"use strict";var r=n(0),u=n(9);n(92);t.a=({color:e="blue",withBackground:t})=>r.a.createElement("div",{className:Object(u.a)("Spinner",e,t&&"with-background")},r.a.createElement("div",null))},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));n(2);var r=n(10);window.addEventListener("error",u),window.addEventListener("unhandledrejection",u);function u(e){e.preventDefault(),o(e instanceof ErrorEvent?e.error:e.reason)}Object(r.h)(window.alert,1e3);function o(e){console.error(e)}},function(e,t,n){"use strict";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 u=0;u(e[r]!==t[r]&&n.push(`${r}: ${e[r]} => ${t[r]}`),n),[])}n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return u}))},function(e,t,n){"use strict";var r=n(0);t.a=function(e,t){const n=Object(r.q)(),{current:u}=n;return t&&void 0===e||(n.current=e),u}},function(e,t,n){"use strict";n.d(t,"j",(function(){return c})),n.d(t,"k",(function(){return d})),n.d(t,"n",(function(){return a})),n.d(t,"h",(function(){return s})),n.d(t,"g",(function(){return f})),n.d(t,"b",(function(){return l})),n.d(t,"f",(function(){return b})),n.d(t,"c",(function(){return h})),n.d(t,"d",(function(){return p})),n.d(t,"e",(function(){return g})),n.d(t,"i",(function(){return y})),n.d(t,"a",(function(){return v})),n.d(t,"l",(function(){return j})),n.d(t,"m",(function(){return w}));const r=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],u=["January","February","March","April","May","June","July","August","September","October","November","December"],o=u.map(e=>e.toLowerCase());function c(e){const t=new Date(e);return t.setHours(0,0,0,0),t}function d(e){return c(e).getTime()}function a(e){const t=new Date(1e3*e);return`${t.getFullYear()}-${t.getMonth()}`}function i(e){return`${e.getFullYear()}-${e.getMonth()+1}-${e.getDate()}`}function s(e){const t="number"==typeof e?new Date(e):e;return`${String(t.getHours()).padStart(2,"0")}:${String(t.getMinutes()).padStart(2,"0")}`}function f(e,t){const n="number"==typeof t?new Date(t):t,u=c(new Date);if(n>=u)return s(n);const o=new Date(u);if(o.setDate(u.getDate()-7),n>=o)return e("Weekday.Short"+r[n.getDay()]);const d=n.getFullYear()!==u.getFullYear(),a=e(d?"formatDateScheduleYear":"formatDateSchedule")||(d?"d MMM yyyy":"d MMM");return m(e,n,a)}function l(e,t){const n="number"==typeof t?new Date(t):t,r=e("formatterYearMax")||"dd.MM.yyyy";return m(e,n,r)}function b(e,t,n=!1){const r=e(n?"formatterMonthYear2":"formatterMonthYear")||"MMM yyyy";return m(e,t,r)}function h(e,t,n=!1,u=!1){const o="number"==typeof t?new Date(t):t,d=c(new Date);if(!u){if(i(o)===i(d))return(n?I:C)(e("Weekday.Today"));const t=new Date(d);if(t.setDate(d.getDate()-1),i(o)===i(t))return(n?I:C)(e("Weekday.Yesterday"));const u=new Date(d),c=new Date(d);if(u.setDate(d.getDate()-7),c.setDate(d.getDate()+7),o>=u&&o<=c){const t=r[o.getDay()];return n?I(e("Weekday.Short"+t)):C(e("Weekday."+t))}}const a=o.getFullYear()!==d.getFullYear(),s=e(n?a?"formatDateScheduleYear":"formatDateSchedule":a?"chatFullDate":"chatDate")||"d MMMM yyyy";return(n?I:C)(m(e,o,s))}function m(e,t,n){const r=t.getDate(),o=t.getMonth();return n.replace("LLLL",e(u[o])).replace("MMMM",e("Month.Gen"+u[o])).replace("MMM",e("Month.Short"+u[o])).replace("MM",String(o+1).padStart(2,"0")).replace("dd",String(r).padStart(2,"0")).replace("d",String(r)).replace("yyyy",String(t.getFullYear()))}function p(e,t){const n="number"==typeof t?new Date(t):t;return`${h(e,n,!0)}, ${s(n)}`}function g(e){const t=Math.floor(e/3600),n=Math.floor(e%3600/60),r=Math.floor(e%3600%60);let u="";return t>0?(u+=String(t).padStart(2,"0")+":",u+=String(n).padStart(2,"0")+":"):u+=String(n)+":",u+=String(r).padStart(2,"0"),u}function y(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 u=(e=Math.floor(e/60))%60;e-=u;const o=(e=Math.floor(e/60))%60;return o>0&&t.push(String(o).padStart(2,"0")),t.push(String(u).padStart(o>0?2:1,"0")),t.push(String(r).padStart(2,"0")),`${t.join(":")},${String(n).padStart(2,"0")}`}function v(e,t="en-US"){return e.toLocaleString(t,{year:"numeric",month:"short",day:"numeric"})}function O(e,t,n=2021){if(t>11||e>31)return!1;const r=new Date(n,t,e);return!Number.isNaN(r.getTime())&&r.getDate()===e}function j(e=""){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||!O(t,n-1,r||void 0)?void 0:`${r?r+"-":""}${String(n).padStart(2,"0")}-${String(t).padStart(2,"0")}`}const u=e.split(" "),c=t?u[0]:u[1],d=(t?u[1]:u[0]).toLowerCase(),a=o.findIndex(e=>e.startsWith(d));return-1!==a&&O(Number(c),a)?`${String(a+1).padStart(2,"0")}-${String(c).padStart(2,"0")}`:void 0}function w(e){return e+86400}function I(e){return`${e[0].toLowerCase()}${e.slice(1)}`}function C(e){return`${e[0].toUpperCase()}${e.slice(1)}`}},function(e,t,n){"use strict";var r=n(0);t.a=()=>{const[,e]=Object(r.r)(!1);return Object(r.m)(()=>{e(e=>!e)},[])}},function(e,t,n){"use strict";n.d(t,"b",(function(){return y})),n.d(t,"c",(function(){return v})),n.d(t,"a",(function(){return O}));var r=n(8),u=n(2),o=n(5),c=n(12),d=n(16),a=n(6),i=n(82),s=n.n(i),f=n(83),l=n.n(f);async function b(e){const t=await new Response(e).arrayBuffer();return new Promise(e=>{const n=new Uint8Array(t);let r=new s.a,u=new l.a;r.onmessage=e=>{null===e.data?u.postMessage({command:"done"}):u.postMessage({command:"encode",buffers:e.data},e.data.map(({buffer:e})=>e))},u.onmessage=t=>{"page"===t.data.message&&(e(new Blob([t.data.page],{type:"audio/wav"})),r.terminate(),r=void 0,u.terminate(),u=void 0)},u.postMessage({command:"init",wavBitDepth:16,wavSampleRate:48e3}),r.postMessage({command:"init",decoderSampleRate:48e3,outputBufferSampleRate:48e3}),r.postMessage({command:"decode",pages:n},[n.buffer])})}var h=n(46);const m={[r.ApiMediaFormat.DataUri]:c.a.Text,[r.ApiMediaFormat.BlobUrl]:c.a.Blob,[r.ApiMediaFormat.Lottie]:c.a.Json,[r.ApiMediaFormat.Progressive]:void 0,[r.ApiMediaFormat.Stream]:void 0},p=new Map,g=new Map;function y(e,t,n){if(t===r.ApiMediaFormat.Progressive)return a.h?function(e){const t="./progressive/"+e;return p.set(e,t),Promise.resolve(t)}(e):y(e,r.ApiMediaFormat.BlobUrl,n);if(!g.has(e)){const i=async function(e,t,n){if(!u.X){const n=e.startsWith("avatar")?u.Z:u.Y,r=await c.c(n,e,m[t]);if(r){let t=r;if("audio/ogg"!==r.type||a.g||(t=await b(t)),"image/webp"===r.type&&!Object(a.t)()&&t){const n=await Object(h.b)(e,t);n&&(t=n)}const n=j(t);return p.set(e,n),n}}if(t===r.ApiMediaFormat.Stream){const r=new MediaSource,u=URL.createObjectURL(r);let c=!1;return r.addEventListener("sourceopen",()=>{if(c)return;c=!0;const u=r.addSourceBuffer("audio/mpeg");Object(o.a)("downloadMedia",{url:e,mediaFormat:t},(e,t)=>{n&&n(e),1===e&&r.endOfStream(),t&&u.appendBuffer(t)})}),p.set(e,u),u}const i=await Object(o.a)("downloadMedia",{url:e,mediaFormat:t},n);if(!i)throw new Error("Failed to fetch media");let{prepared:s,mimeType:f}=i;if("audio/ogg"===f&&!a.g){const e=await Object(d.e)(s);URL.revokeObjectURL(s);const t=await b(e);s=j(t),f=e.type}if("image/webp"===f&&!Object(a.t)()){const t=await Object(d.e)(s);URL.revokeObjectURL(s);const n=await Object(h.b)(e,t);n&&(s=j(n))}return p.set(e,s),s}(e,t,n).catch(e=>{u.r&&console.warn(e)}).finally(()=>{g.delete(e)});g.set(e,i)}return g.get(e)}function v(e){return p.get(e)}function O(e){Object(o.b)(e)}function j(e){return e instanceof Blob?e.type.includes("text/html")?URL.createObjectURL(Object(d.d)(u.Rb)):URL.createObjectURL(e):e}a.h&&navigator.serviceWorker.addEventListener("message",async e=>{const{type:t,messageId:n,params:u}=e.data;if("requestPart"!==t)return;const c=await Object(o.a)("downloadMedia",{mediaFormat:r.ApiMediaFormat.Progressive,...u});if(!c)return;const{arrayBuffer:d,mimeType:a,fullSize:i}=c;navigator.serviceWorker.controller.postMessage({type:"partResponse",messageId:n,result:{arrayBuffer:d,mimeType:a,fullSize:i}},[d])})},function(e,t,n){"use strict";var r=n(0),u=n(9);n(90);t.a=({children:e,className:t,isRtl:n,onClick:o})=>{const c=Object(r.m)(e=>{e.preventDefault(),o(e)},[o]);return r.a.createElement("a",{href:"#",className:Object(u.a)("Link",t),dir:n?"rtl":"auto",onClick:o?c:void 0},e)}},function(e,t,n){"use strict";t.a=e=>{let t;do{t=String(Math.random()).replace("0.","id")}while(e.hasOwnProperty(t));return t}},function(e,t,n){"use strict";n.d(t,"b",(function(){return d})),n.d(t,"c",(function(){return a})),n.d(t,"d",(function(){return i})),n.d(t,"g",(function(){return s})),n.d(t,"e",(function(){return f})),n.d(t,"f",(function(){return l})),n.d(t,"h",(function(){return b})),n.d(t,"a",(function(){return h}));var r=n(2),u=n(31),o=n(3);const c=[1,8,5,2,7,4,6];function d(e){if(e)switch(e.type){case"userTypeBot":case"userTypeRegular":return e.firstName||e.lastName;case"userTypeDeleted":case"userTypeUnknown":return"Deleted";default:return}}function a(e){if(e){if(f(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 i(e,t,n){if(t.id===r.yb)return e("ServiceNotifications").toLowerCase();if(t.type&&"userTypeBot"===t.type)return e("Bot");if(!t.status)return"";switch(t.status.type){case"userStatusEmpty":return e("ALongTimeAgo");case"userStatusLastMonth":return e("WithinAMonth");case"userStatusLastWeek":return e("WithinAWeek");case"userStatusOffline":{const{wasOnline:r}=t.status;if(!r)return e("LastSeen.Offline");const o=new Date((new Date).getTime()+1e3*n),c=new Date(1e3*r);if(c>=o)return e("LastSeen.JustNow");const d=new Date(o.getTime()-c.getTime());if(d.getTime()/1e3<60)return e("LastSeen.JustNow");if(d.getTime()/1e3<3600){return e("LastSeen.MinutesAgo",Math.floor(d.getTime()/1e3/60))}const a=new Date;a.setHours(0,0,0,0);if(c>new Date(a.getTime()+1e3*n)){if(d.getTime()/1e3<21600){return e("LastSeen.HoursAgo",Math.floor(d.getTime()/1e3/60/60))}return e("LastSeen.TodayAt",Object(u.h)(c))}const i=new Date;i.setDate(o.getDate()-1),i.setHours(0,0,0,0);return c>new Date(i.getTime()+1e3*n)?e("LastSeen.YesterdayAt",Object(u.h)(c)):e("LastSeen.AtDate",Object(u.b)(e,c))}case"userStatusOnline":return e("Online");case"userStatusRecently":return e("Lately");default:return}}function s(e){const{id:t,status:n,type:u}=e;return!!n&&(t!==r.yb&&("userStatusOnline"===n.type&&"userTypeBot"!==u))}function f(e){return!(!e.status||"userTypeBot"===e.type||e.id===r.yb)&&("userTypeDeleted"===e.type||"userTypeUnknown"===e.type)}function l(e){return"userTypeBot"===e.type}function b(e,t,n,r=0){return Object(o.k)(e,e=>{const u=Date.now()/1e3+r;if(n&&n.includes(e))return u+172800-(n.length-n.indexOf(e));const o=t[e];if(!o||!o.status)return 0;if("userStatusOnline"===o.status.type)return o.status.expires;if("userStatusOffline"===o.status.type&&o.status.wasOnline)return o.status.wasOnline;switch(o.status.type){case"userStatusRecently":return u-86400;case"userStatusLastWeek":return u-604800;case"userStatusLastMonth":return u-18144e3;default:return 0}},"desc")}function h(e){const t=e?Math.abs(e.id)%7:0;return c[t]}},function(e,t,n){"use strict";n.d(t,"w",(function(){return i})),n.d(t,"v",(function(){return s})),n.d(t,"t",(function(){return f})),n.d(t,"y",(function(){return l})),n.d(t,"u",(function(){return b})),n.d(t,"z",(function(){return h})),n.d(t,"j",(function(){return m})),n.d(t,"p",(function(){return p})),n.d(t,"i",(function(){return g})),n.d(t,"e",(function(){return y})),n.d(t,"f",(function(){return v})),n.d(t,"d",(function(){return O})),n.d(t,"x",(function(){return j})),n.d(t,"r",(function(){return w})),n.d(t,"m",(function(){return I})),n.d(t,"A",(function(){return C})),n.d(t,"c",(function(){return E})),n.d(t,"a",(function(){return S})),n.d(t,"o",(function(){return A})),n.d(t,"h",(function(){return M})),n.d(t,"g",(function(){return k})),n.d(t,"s",(function(){return T})),n.d(t,"D",(function(){return N})),n.d(t,"E",(function(){return P})),n.d(t,"b",(function(){return D})),n.d(t,"C",(function(){return L})),n.d(t,"B",(function(){return x})),n.d(t,"l",(function(){return F})),n.d(t,"k",(function(){return B})),n.d(t,"q",(function(){return R})),n.d(t,"n",(function(){return U})),n.d(t,"F",(function(){return _}));var r=n(8),u=n(2),o=n(3),c=n(36),d=n(31);const a=Date.now()/1e3+31622400;function i(e){return e>0}function s(e){return f(e)||l(e)}function f(e){return"chatTypeBasicGroup"===e.type}function l(e){return"chatTypeSuperGroup"===e.type}function b(e){return"chatTypeChannel"===e.type}function h(e){return"chatTypePrivate"===e.type||"chatTypeBasicGroup"===e.type}function m(e){switch(e.type){case"chatTypePrivate":return"PrivateChat";case"chatTypeBasicGroup":case"chatTypeSuperGroup":return"AccDescrGroup";case"chatTypeChannel":return"AccDescrChannel";default:return"Chat"}}function p(e){if("chatTypePrivate"===e.type||"chatTypeSecret"===e.type)return e.id}function g(e,t,n,r=!1){return r||n&&t.id===n.id&&n.isSelf?e("SavedMessages"):t.title||e("HiddenName")}function y(e){if(e.fullInfo)return e.fullInfo.about}function v(e){const{username:t}=e;if(t)return"https://t.me/"+t;const{inviteLink:n}=e.fullInfo||{};return n}function O(e,t="normal"){if(e.avatarHash)switch(t){case"big":return`profile${e.id}?${e.avatarHash}`;default:return`avatar${e.id}?${e.avatarHash}`}}function j(e){return!e.lastMessage}function w(e){return Boolean(e.adminRights)}function I(e,t){return!!e.adminRights&&e.adminRights[t]}function C(e,t){return Boolean(e.currentUserBannedRights&&e.currentUserBannedRights[t]||e.defaultBannedRights&&e.defaultBannedRights[t])}function E(e,t){return t!==r.MAIN_THREAD_ID||!(e.isRestricted||e.migratedTo||e.isNotJoined)&&(!!e.isCreator||(!!i(e.id)||(b(e)?I(e,"postMessages"):w(e)||!C(e,"sendMessages"))))}function S(e,t=!1){if(!e)return{canAttachMedia:!1,canAttachPolls:!1,canSendStickers:!1,canSendGifs:!1,canAttachEmbedLinks:!1};const n=w(e);return{canAttachMedia:n||!C(e,"sendMedia"),canAttachPolls:(n||!C(e,"sendPolls"))&&(!i(e.id)||t),canSendStickers:n||!C(e,"sendStickers"),canSendGifs:n||!C(e,"sendGifs"),canAttachEmbedLinks:n||!C(e,"embedLinks")}}function A(e,t,n){if(t&&t.sendMessages){const{untilDate:n}=t;return n&&nfunction(e,t,n,r,u,o,c,d){if(!e.isListed)return!1;if(o&&o.has(e.id))return!1;if(c&&c.has(e.id))return!0;if(d&&d.has(e.id))return!0;if(T(e)&&t.excludeArchived)return!1;if(t.excludeMuted&&!e.unreadMentionsCount&&N(e,r,u))return!1;if(!e.unreadCount&&!e.unreadMentionsCount&&!e.hasUnreadMark&&t.excludeRead)return!1;if(i(e.id)){const r=n[e.id];if(r&&"userTypeBot"===r.type){if(t.bots)return!0}else{if(t.contacts&&r&&r.isContact)return!0;if(t.nonContacts&&r&&!r.isContact)return!0}}else{if(s(e))return!!t.groups;if(b(e))return!!t.channels}return!1}(e[o],n,t,r,u,c,d,a)),n.pinnedChatIds]}function x(e,t,n,r="all"){function u(e){if(!e||!e.lastMessage||e.migratedTo)return!1;switch(r){case"all":if(T(e))return!1;break;case"archived":if(!T(e))return!1}return!e.isRestricted&&!e.isNotJoined}const c=t.map(t=>e[t]).filter(u),d=new Set(t);return{pinnedChats:n?n.map(t=>e[t]).filter(u).filter(e=>d.has(e.id)):[],otherChats:Object(o.k)(n?c.filter(e=>!n.includes(e.id)):c,k,"desc")}}function F(e,t,n,r,u,o){const[c]=L(e,t,n,u,o,r),d=c.map(t=>e[t]).filter(e=>e&&e.lastMessage&&!e.isRestricted&&!e.isNotJoined);return{unreadDialogsCount:d.reduce((e,t)=>t.unreadCount||t.hasUnreadMark?e+1:e,0),hasActiveDialogs:d.some(e=>e.unreadMentionsCount||!N(e,u,o)&&(e.unreadCount||e.hasUnreadMark))}}function B(e,t,n,r,u,o,c){const{id:d,title:a,emoticon:i,description:s,pinnedChatIds:f,excludedChatIds:l,includedChatIds:b,excludeArchived:h,excludeMuted:m,excludeRead:p,...g}=r;if(Object.values(g).filter(Boolean).length>1||l&&l.length||b&&b.length){return e("Chats",function(e,t,n,r,u,o){const[c,d]=L(e,t,n,u,o,r),{pinnedChats:a,otherChats:i}=x(e,c,d,"folder");return a.length+i.length}(t,n,r,u,o,c))}return g.bots?e("FilterBots"):g.groups?e("FilterGroups"):g.channels?e("FilterChannels"):g.contacts?e("FilterContacts"):g.nonContacts?e("FilterNonContacts"):void 0}function R(e){return!!e&&e.id<0}function U(e,t,n){if(n&&!i(t))return n.isSelf?e("FromYou"):Object(c.b)(n)}function _(e,t,n=!1,r){return Object(o.k)(e,e=>{const u=t[e];if(!u)return 0;let o=0;return u.lastMessage&&(o+=u.lastMessage.date),n&&u.isVerified&&(o+=3e9),r&&r.includes(e)&&(o=Date.now()+3e8+(r.length-r.indexOf(e))),o},"desc")}},function(e,t,n){"use strict";n.d(t,"b",(function(){return u})),n.d(t,"a",(function(){return o})),n.d(t,"d",(function(){return a}));var r=n(0);const u="tt-event-heavy-animation-start",o="tt-event-heavy-animation-end";let c,d=!1;const a=e=>(d||(d=!0,document.dispatchEvent(new Event(u))),c&&(clearTimeout(c),c=void 0),e&&(c=window.setTimeout(()=>{d=!1,document.dispatchEvent(new Event(o)),c=void 0},e)),()=>{d=!1,document.dispatchEvent(new Event(o))});t.c=(e,t)=>{Object(r.n)(()=>(d&&e(),document.addEventListener(u,e),document.addEventListener(o,t),()=>{document.removeEventListener(o,t),document.removeEventListener(u,e)}),[t,e])}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a})),n.d(t,"c",(function(){return i})),n.d(t,"b",(function(){return b}));var r=n(2);const u=new Set(["scroll","mouseenter","mouseleave"]),o={},c=new Map,d={};function a(e,t,n,r=!1){const u=s(t,e);f(u,e,r)?function(e,t,n){d[e]||(d[e]=0,document.addEventListener(e,h));(function(e){o[e]||(o[e]=new Map);return o[e]})(e).set(t,n),function(e){const t=c.get(e);if(t)return t;const n=new Set;return c.set(e,n),n}(t).add(e),d[e]++}(u,e,n):e.addEventListener(u,n,r)}function i(e,t,n,r=!1){const u=s(t,e);f(u,e,r)?l(u,e):e.removeEventListener(u,n,r)}function s(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 f(e,t,n){return!n&&!u.has(e)&&"VIDEO"!==t.tagName&&"IFRAME"!==t.tagName}function l(e,t){d[e]--,d[e]||document.removeEventListener(e,h),o[e].delete(t),c.get(t).delete(e)}function b(e){const t=c.get(e);t&&(t.forEach(t=>l(t,e)),c.delete(e))}function h(e){const t=o[e.type];if(t){let n=!1,r=e.target;const u=()=>{n=!0},o=()=>{e.preventDefault()},c=new Proxy(e,{get:(e,t)=>"currentTarget"===t?r:"stopPropagation"===t||"stopImmediatePropagation"===t?u:"preventDefault"===t?o:Reflect.get(e,t)});for(;r&&r!==document.body;){const e=t.get(r);if(e&&(e(c),n))return;r=r.parentNode}}}r.r&&document.addEventListener("dblclick",()=>{console.log("DELEGATED EVENTS",{delegationRegistry:o,delegatedEventsByElement:c,documentEventCounters:d})})},function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"a",(function(){return l}));var r=n(0),u=n(6),o=n(30),c=n(1),d=n(3);const a={currentIndex:0,nextStateIndexToReplace:-1,isHistoryAltered:!1,isDisabled:!1,isEdge:!1,currentIndexes:[]},i=()=>{a.isDisabled=!0},s=e=>{const t=e.touches[0].pageX;(t<=300||t>=window.innerWidth-300)&&(a.isEdge=!0)},f=()=>{a.isEdge&&setTimeout(()=>{a.isEdge=!1},350)};function l(e,t,n,u,i=!1,s){const f=Object(r.q)(-1),l=Object(r.q)(!1),b=Object(o.a)(e),h=Object(r.q)(!0),m=Object(r.q)([]),p=Object(o.a)(s),g=Object(r.q)(!1),y=Object(r.m)((t=!1)=>{if(s){const e=p||[];if(e.length0){const e=m.current[m.current.length-t-1];let n=t;if(e){const t=a.currentIndexes.findIndex(t=>t===e.index);n=a.currentIndexes.length-t-1}a.isHistoryAltered=!0,window.history.go(-n);m.current.splice(m.current.length-t-1,t).forEach(({index:e})=>{a.currentIndexes.splice(a.currentIndexes.indexOf(e),1)})}s.length>0&&setTimeout(()=>{const e=++a.currentIndex;a.currentIndexes[a.currentIndexes.length-1]=e,window.history.replaceState({index:e,state:u},"","#"+s[s.length-1]),m.current[m.current.length-1]={index:e,hash:s[s.length-1]}},0)}}}else e&&!t&&(h.current=!1,l.current?(l.current=!1,a.currentIndexes.push(f.current)):setTimeout(()=>{const e=++a.currentIndex;a.currentIndexes.push(e),window.history[a.currentIndexes.includes(a.nextStateIndexToReplace-1)&&0!==window.history.state.index&&a.nextStateIndexToReplace===e&&!i?"replaceState":"pushState"]({index:e,state:u},""),f.current=e,i&&(a.nextStateIndexToReplace=a.currentIndex+1)},0)),!t&&e||h.current||(f.current!==a.currentIndex&&i||(a.isHistoryAltered=!0,window.history.back(),setTimeout(()=>{a.nextStateIndexToReplace=-1},400)),a.currentIndexes.splice(a.currentIndexes.indexOf(f.current),1),h.current=!0)},[u,s,e,p,i]);return Object(r.n)(()=>{const r=e=>{if(a.isHistoryAltered)return void setTimeout(()=>{a.isHistoryAltered=!1},0);const{index:r}=e.state,u=r||0;try{const r=s?m.current[m.current.length-1].index:f.current,o=a.currentIndexes[a.currentIndexes.indexOf(r)-1];if(a.isDisabled)return;!h.current&&(0===u||u===o)||s&&(0===u||u===o)?(s&&(g.current=!0,m.current.pop()),a.currentIndexes.splice(a.currentIndexes.indexOf(r),1),t&&(a.isEdge&&Object(c.d)().disableHistoryAnimations(),t(!a.isEdge),h.current=!0)):u===r&&h.current&&n&&!s&&(l.current=!0,a.isEdge&&Object(c.d)().disableHistoryAnimations(),n(e.state.state))}catch(e){}},u=s?!p||!Object(d.a)(p,s):b!==e;return!a.isDisabled&&u&&y(),window.addEventListener("popstate",r),()=>window.removeEventListener("popstate",r)},[u,y,s,e,t,n,p,b,i]),{forceClose:()=>y(!0)}}u.e&&(window.addEventListener("touchstart",s),window.addEventListener("touchend",f),window.addEventListener("popstate",f)),window.history.replaceState({index:a.currentIndex},"")},function(e,t,n){"use strict";var r=n(0),u=n(9);t.a=(e=!1,t,n=!1,o="fast",c=!1)=>{const[d,a]=Object(r.r)(!e),i=Object(r.q)(),[s,f]=Object(r.r)(e&&n);e?(a(!1),f(!0),i.current&&(window.clearTimeout(i.current),i.current=void 0)):(f(!1),d||i.current||(i.current=window.setTimeout(()=>{a(!0),t&&t(),i.current=void 0},c?0:350)));const l=s&&!(c&&!e),b=Boolean(i.current),h=e||b;return{shouldRender:h,transitionClassNames:Object(u.a)(o&&"opacity-transition",o,l&&"open",h&&"shown",b&&"closing")}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));function r(e,t=30){return!e||e.length<=t?e:e.substr(0,t)+"..."}},function(e){e.exports=JSON.parse('{"--color-primary":["#50A2E9","#8378DB"],"--color-primary-opacity":["#50A2E980","#8378DB80"],"--color-primary-shade":["#4a95d6","#7b71c6"],"--color-background":["#FFFFFF","#212121"],"--color-background-secondary":["#f4f4f5","#121212"],"--color-background-secondary-accent":["#E4E4E5","#100f10"],"--color-background-own":["#EEFEDF","#8378DB"],"--color-background-own-apple":["#E7FDCC","#8378DB"],"--color-background-selected":["#F4F4F5","#2C2C2C"],"--color-background-own-selected":["#d4fcae","#7b71c6"],"--color-chat-hover":["#F4F4F5","#2C2C2C"],"--color-chat-active":["#4C90E6","#8378DB"],"--color-item-active":["#ededed","#292929"],"--color-text":["#000000","#FFFFFF"],"--color-text-secondary":["#707579","#AAAAAA"],"--color-text-secondary-apple":["#8E8E92","#AAAAAA"],"--color-borders":["#DADCE0","#100F10"],"--color-borders-input":["#DADCE0","#5B5B5A"],"--color-links":["#52A1EF","#868DF6"],"--color-links-hover":["#2d8dec","#6b5fcc"],"--color-gray":["#C4C9CC","#717579"],"--color-pinned":["#C4C9CC","#707579"],"--color-default-shadow":["#72727240","#1010109c"],"--color-light-shadow":["#7272722B","#00000040"],"--color-green":["#4DCD5E","#8378DB"],"--color-text-meta-colored":["#4DCD5E","#8378DB"],"--color-reply-hover":["#F4F4F4","#272727"],"--color-reply-active":["#E8E9E9","#2E2F2F"],"--color-reply-own-hover":["#DBF4CE","#6458bc"],"--color-reply-own-hover-apple":["#d9f9c1","#6458bc"],"--color-reply-own-active":["#C8EBBC","#4F4A9F"],"--color-reply-own-active-apple":["#d5edc2","#4F4A9F"],"--color-accent-own":["#4FAE4E","#FFFFFF"],"--color-message-meta-own":["#4FAE4EFF","#FFFFFF88"],"--color-own-links":["#52A1EF","#FFFFFF"],"--color-code":["#4a729a","#93c4ef"],"--color-code-own":["#3c7940","#FFFFFF"],"--color-code-bg":["#70757914","#ffffff26"],"--color-code-own-bg":["#70757914","#ffffff26"]}')},function(e,t,n){"use strict";var r=n(0),u=n(9),o=n(17);n(99);t.a=e=>{const{icon:t,className:n,children:c,onClick:d,href:a,download:i,disabled:s,destructive:f,ariaLabel:l}=e,b=Object(o.a)(),h=Object(r.m)(e=>{if(s||!d)return e.stopPropagation(),void e.preventDefault();d(e)},[s,d]),m=Object(r.m)(e=>{if(13===e.keyCode||32===e.keyCode)return s||!d?(e.stopPropagation(),void e.preventDefault()):void d(e)},[s,d]),p=Object(u.a)("MenuItem",n,s&&"disabled",f&&"destructive"),g=r.a.createElement(r.a.Fragment,null,t&&r.a.createElement("i",{className:"icon-"+t,"data-char":t.startsWith("char-")?t.replace("char-",""):void 0}),c);return a?r.a.createElement("a",{tabIndex:0,className:p,href:a,download:i,"aria-label":l,title:l,target:a.startsWith(window.location.origin)?"_self":"_blank",rel:"noopener noreferrer",dir:b.isRtl?"rtl":void 0,onClick:d},g):r.a.createElement("div",{role:"button",tabIndex:0,className:p,onClick:h,onKeyDown:m,"aria-label":l,title:l,dir:b.isRtl?"rtl":void 0},g)}},function(e,t,n){"use strict";var r=n(0),u=n(10);n(93);t.a=Object(r.h)(()=>{const[e,t]=Object(r.r)([]),n=Object(r.p)(()=>Object(u.a)(()=>{t([])},700,!1),[]),o=Object(r.m)(r=>{if(0!==r.button)return;const u=r.currentTarget,o=u.getBoundingClientRect(),c=u.offsetWidth/2;t([...e,{x:r.clientX-o.x-c/2,y:r.clientY-o.y-c/2,size:c}]),requestAnimationFrame(()=>{n()})},[e,n]);return r.a.createElement("div",{className:"ripple-container",onMouseDown:o},e.map(({x:e,y:t,size:n})=>r.a.createElement("span",{style:`left: ${e}px; top: ${t}px; width: ${n}px; height: ${n}px;`})))})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return f})),n.d(t,"c",(function(){return l}));var r=n(84),u=n.n(r),o=n(6),c=n(16),d=n(10);let a,i;const s="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=";async function f(e,t){for(b();!i.wasmReady;)await Object(d.f)(2e3);const{result:n,width:r,height:u}=await function(e,t){return new Promise(n=>{i.requests=i.requests||new Map,i.requests.set(e,n),i.postMessage({id:e,blob:t})})}(e,t);if(r&&u)return function({result:e,width:t,height:n}){a||(a=document.createElement("canvas"));return new Promise(r=>{const u=new ImageData(e,t,n);a.width=t,a.height=n;a.getContext("2d").putImageData(u,0,0),a.toBlob(e=>{r(null!=e?e:void 0)},"image/png",1)})}({result:n,width:r,height:u})}async function l(e,t){if(Object(o.t)()||"data:image/webp"!==t.substr(0,15))return t;b();const n=await f(e,Object(c.d)(t));if(!n)throw new Error("Can't convert webp to png. Url: "+t);return Object(c.a)(n)}function b(){i||(i=new u.a,i.wasmReady=!1,i.onmessage=h)}function h(e){const{id:t}=e.data;switch(e.data.type){case"initialized":i.wasmReady=!0;break;case"result":if(i.requests.has(t)){const n=i.requests.get(t);i.requests.delete(t),n(e.data)}}}},function(e,t,n){"use strict";var r=n(62),u=n(43);let o=!1;const c=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i,d=(e,t,n)=>(1-n)*e+n*t,a=Object.keys(u).map(e=>({property:e,colors:[i(u[e][0]),i(u[e][1])]}));function i(e){const t=c.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 s(e,t,n=1){a.forEach(({property:r,colors:u})=>{const o=Math.round(d(u[e].r,u[t].r,n)),c=Math.round(d(u[e].g,u[t].g,n)),a=Math.round(d(u[e].b,u[t].b,n)),i=void 0!==u[e].a?Math.round(d(u[e].a,u[t].a,n)):void 0;document.documentElement.style.setProperty(r,void 0!==i?`rgba(${o},${c},${a},${i/255})`:`rgb(${o},${c},${a})`)})}t.a=(e,t)=>{const n="dark"===e,u=o&&t,c=n?0:1,d=n?1:0,a=Date.now(),i=document.querySelector('meta[name="theme-color"]');document.documentElement.classList.remove("theme-"+(n?"light":"dark")),o&&document.documentElement.classList.add("no-animations"),document.documentElement.classList.add("theme-"+e),i&&i.setAttribute("content",n?"#212121":"#fff"),setTimeout(()=>{document.documentElement.classList.remove("no-animations")},500),o=!0,u?Object(r.b)(()=>{const e=Math.min((Date.now()-a)/200,1);return s(c,d,function(e){return 1-(1-e)**3.5}(e)),e<1}):s(c,d)}},function(e,t,n){"use strict";var r=n(0),u=n(9),o=n(17);t.a=Object(r.h)(({ref:e,id:t,className:n,value:c,label:d,error:a,success:i,disabled:s,readOnly:f,placeholder:l,autoComplete:b,inputMode:h,maxLength:m,onChange:p,onInput:g,onKeyPress:y,onKeyDown:v,onBlur:O,onPaste:j})=>{const w=Object(o.a)(),I=a||i||d,C=Object(u.a)("input-group",c&&"touched",a?"error":i&&"success",s&&"disabled",f&&"disabled",I&&"with-label",n);return r.a.createElement("div",{className:C,dir:w.isRtl?"rtl":void 0},r.a.createElement("input",{ref:e,className:"form-control",type:"text",id:t,dir:"auto",value:c||"",placeholder:l,maxLength:m,autoComplete:b,inputMode:h,disabled:s,readOnly:f,onChange:p,onInput:g,onKeyPress:y,onKeyDown:v,onBlur:O,onPaste:j}),I&&r.a.createElement("label",{htmlFor:t},I))})},function(e,t,n){"use strict";var r=n(0),u=n(9),o=n(17),c=n(27);n(95);t.a=Object(r.h)(({id:e,name:t,value:n,label:d,subLabel:a,checked:i,disabled:s,round:f,blocking:l,isLoading:b,onChange:h,onCheck:m})=>{const p=Object(o.a)(),g=Object(r.m)(e=>{h&&h(e),m&&m(e.currentTarget.checked)},[h,m]),y=Object(u.a)("Checkbox",s&&"disabled",f&&"round",b&&"loading",l&&"blocking");return r.a.createElement("label",{className:y,dir:p.isRtl?"rtl":void 0},r.a.createElement("input",{type:"checkbox",id:e,name:t,value:n,checked:i,disabled:s,onChange:g}),r.a.createElement("div",{className:"Checkbox-main"},r.a.createElement("span",{className:"label",dir:"auto"},d),a&&r.a.createElement("span",{className:"subLabel",dir:"auto"},a)),b&&r.a.createElement(c.a,null))})},function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(57);function u(e){return Object(r.a)({onEsc:e})}},function(e,t,n){"use strict";function r(e){return String(e).replace(/\d(?=(\d{3})+$)/g,"$& ")}function u(e){return".0"===String(e.toFixed(1)).substr(-2)?Math.round(e):e.toFixed(1).replace(".",",")}function o(e){return e<1e3?e:e<1e6?u(e/1e3)+"K":u(e/1e6)+"M"}function c(e,t=2){return e.replace(/[.,!@#$%^&*()_+=\-`~[\]/\\{}:"|<>?]+/gi,"").trim().split(/\s+/).slice(0,t).map(e=>e.length&&e.match(/./u)[0].toUpperCase()).join("")}n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return o})),n.d(t,"c",(function(){return c}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));const r=[]},function(e,t,n){"use strict";var r=n(30);t.a=(e,t)=>{const n=Object(r.a)(t);n&&!t.some((e,t)=>e!==n[t])||e(n||[])}},function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));const r=/[^\wа-яё]+/;function u(e,t){if(!e||!t)return!1;const n=e.toLowerCase().split(r);return t.toLowerCase().split(r).every(e=>n.some(t=>t.startsWith(e)))}},function(e,t,n){"use strict";n.d(t,"b",(function(){return f}));var r=n(10),u=n(2),o=n(6);const c=o.l&&l(),d=window.innerHeight;let a=f(),i=!1;const s=Object(r.h)(()=>{a=f(),!i&&((a.width<=u.ob||a.width<=u.nb&&a.height<=u.mb)!==o.l||o.l&&c!==l())&&window.location.reload()},250,!0);function f(){const e=.01*window.innerHeight;return document.documentElement.style.setProperty("--vh",e+"px"),{width:window.innerWidth,height:window.innerHeight}}function l(){return o.e?window.matchMedia("(orientation: landscape)").matches:window.matchMedia("screen and (min-device-aspect-ratio: 1/1) and (orientation: landscape)").matches}window.addEventListener("resize",s),window.addEventListener("orientationchange",s),t.a={get:()=>a,getIsKeyboardVisible:()=>d>a.height,disableRefresh:function(){i=!0},enableRefresh:function(){i=!1}}},function(e,t,n){"use strict";var r=n(0),u=n(41),o=n(64),c=n(80),d=n(58),a=n(50),i=n(9),s=n(38),f=n(40);n(97);t.a=({ref:e,containerRef:t,isOpen:n,className:l,style:b,children:h,positionX:m="left",positionY:p="top",autoClose:g=!1,footer:y,noCloseOnBackdrop:v=!1,onCloseAnimationEnd:O,onClose:j,onMouseEnter:w,onMouseLeave:I,shouldSkipTransition:C})=>{let E=Object(r.q)(null);e&&(E=e);const S=t||E,{transitionClassNames:A}=Object(u.a)(n,O,C,void 0,C);Object(r.n)(()=>n&&j?Object(a.a)(j):void 0,[n,j]),Object(f.a)(n,j,void 0,void 0,g),Object(d.a)(([e])=>{void 0!==e&&Object(s.d)(200)},[n]);const M=Object(o.a)(E,n,g?j:void 0,void 0,!0);Object(c.a)(n,S,v?void 0:j);const k=Object(i.a)("bubble menu-container custom-scroll",p,m,y&&"with-footer",A);return r.a.createElement("div",{className:Object(i.a)("Menu no-selection",l),onKeyDown:n?M:void 0,onMouseEnter:w,onMouseLeave:n?I:void 0,style:b},n&&r.a.createElement("div",{className:"backdrop"}),r.a.createElement("div",{ref:E,className:k,style:`transform-origin: ${p} ${m}`,onClick:g?j:void 0},h,y&&r.a.createElement("div",{className:"footer"},y)))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));const r={Enter:"onEnter",Backspace:"onBackspace",Delete:"onDelete",Esc:"onEsc",Escape:"onEsc",ArrowUp:"onUp",ArrowDown:"onDown",ArrowLeft:"onLeft",ArrowRight:"onRight",Tab:"onTab"},u={onEnter:[],onDelete:[],onBackspace:[],onEsc:[],onUp:[],onDown:[],onLeft:[],onRight:[],onTab:[]};function o(e){return c()||document.addEventListener("keydown",d,!0),Object.keys(e).forEach(t=>{const n=e[t];if(!n)return;const r=u[t];r&&r.push(n)}),()=>{!function(e){Object.keys(e).forEach(t=>{const n=e[t],r=u[t];if(r){const e=r.findIndex(e=>e===n);-1!==e&&r.splice(e,1)}}),c()||document.removeEventListener("keydown",d,!1)}(e)}}function c(){return Object.values(u).some(e=>Boolean(e.length))}function d(e){const t=r[e.key];if(!t)return;const{length:n}=u[t];if(!n)return;e.stopPropagation();(0,u[t][n-1])(e)}},function(e,t,n){"use strict";var r=n(0),u=n(30);t.a=(e,t,n)=>{const o=Object(u.a)(t);return Object(r.n)(()=>e(o||[]),t,n)}},function(e,t,n){"use strict";var r=n(0),u=n(1);const o=e=>{const t=[];let n=0;const r=e.length;let u;for(;n65535&&(u-=65536,t.push(String.fromCharCode(u>>>10&1023|55296)),u=56320|1023&u),t.push(String.fromCharCode(u))}return t.join("")};function c(e,t,n){let r;for(e=n?Math.floor(e/700):e>>1,e+=Math.floor(e/t),r=0;e>455;r+=36)e=Math.floor(e/35);return Math.floor(r+36*e/(e+38))}function d(e,t){const n=[],r=[],u=e.length;let d,a,i,s,f,l,b,h,m,p,g,y,v;for(d=128,i=0,s=72,f=e.lastIndexOf("-"),f<0&&(f=0),l=0;l=128)throw new RangeError("Illegal input >= 0x80");n.push(e.charCodeAt(l))}for(b=f>0?f+1:0;b=u)throw RangeError("punycode_bad_input(1)");if(g=(O=e.charCodeAt(b++))-48<10?O-22:O-65<26?O-65:O-97<26?O-97:36,g>=36)throw RangeError("punycode_bad_input(2)");if(g>Math.floor((2147483647-i)/m))throw RangeError("punycode_overflow(1)");if(i+=g*m,y=p<=s?1:p>=s+26?26:p-s,gMath.floor(2147483647/(36-y)))throw RangeError("punycode_overflow(2)");m*=36-y}if(a=n.length+1,s=c(i-h,a,0===h),Math.floor(i/a)>2147483647-d)throw RangeError("punycode_overflow(3)");d+=Math.floor(i/a),i%=a,t&&r.splice(i,0,e.charCodeAt(b-1)-65<26),n.splice(i,0,d),i++}var O;if(t)for(i=0,v=n.length;i{const{toggleSafeLinkModal:d,openTelegramLink:a}=Object(u.d)(),b=o||t,h=e!==b,m=Object(r.m)(t=>t.ctrlKey||t.altKey||t.shiftKey||t.metaKey||!e||!e.match(i.ub)&&!e.match(i.tb)?!h||(d({url:e}),t.preventDefault(),!1):(t.preventDefault(),a({url:e}),!1),[h,a,d,e]);if(!e)return;const p=Object(s.a)(n||"text-entity-link",t.length>50&&"long-word-break-all");return r.a.createElement("a",{href:f(e),title:l(e),target:"_blank",rel:"noopener noreferrer",className:p,onClick:m,dir:c?"rtl":"auto"},b)})},function(e,t,n){"use strict";n.d(t,"e",(function(){return r})),n.d(t,"b",(function(){return u})),n.d(t,"d",(function(){return o})),n.d(t,"a",(function(){return c})),n.d(t,"c",(function(){return d}));function r(e){return e>536870912?(e/1073741824).toFixed(1)+" GB":e>524288?(e/1048576).toFixed(1)+" MB":(e/1024).toFixed(1)+" KB"}function u(e){const{fileName:t,mimeType:n}=e;return o(t,n)}function o(e,t){return e&&-1!==e.indexOf(".")?e.split(".").pop():t.split("/").pop()}function c(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 d(e){return Boolean(e.previewBlobUrl||e.thumbnail)}},function(e,t,n){"use strict";n.d(t,"b",(function(){return u})),n.d(t,"a",(function(){return c}));const r={missing_payment_information:{field:"cardNumber",fieldError:"Incorrect card number"},invalid_number:{field:"cardNumber",fieldError:"Incorrect card number"},number:{field:"cardNumber",fieldError:"Incorrect card number"},exp_year:{field:"expiry",fieldError:"Incorrect year"},exp_month:{field:"expiry",fieldError:"Incorrect month"},invalid_expiry_year:{field:"expiry",fieldError:"Incorrect year"},invalid_expiry_month:{field:"expiry",fieldError:"Incorrect month"},cvc:{field:"cvv",fieldError:"Incorrect CVV"},invalid_cvc:{field:"cvv",fieldError:"Incorrect CVV"}};function u(e){const{message:t,code:n,param:u}=e,{field:o,fieldError:c,description:d}=u?r[u]:r[n];return{field:o,fieldError:c,description:d||t}}const o={ADDRESS_STREET_LINE1_INVALID:{field:"streetLine1",fieldError:"Incorrect street address"},ADDRESS_STREET_LINE2_INVALID:{field:"streetLine2",fieldError:"Incorrect street address"},ADDRESS_CITY_INVALID:{field:"city",fieldError:"Incorrect city"},ADDRESS_COUNTRY_INVALID:{field:"countryIso2",fieldError:"Incorrect country"},ADDRESS_POSTCODE_INVALID:{field:"postCode",fieldError:"Incorrect post code"},ADDRESS_STATE_INVALID:{field:"state",fieldError:"Incorrect state"},REQ_INFO_NAME_INVALID:{field:"fullName",fieldError:"Incorrect name"},REQ_INFO_PHONE_INVALID:{field:"phone",fieldError:"Incorrect phone"},REQ_INFO_EMAIL_INVALID:{field:"email",fieldError:"Incorrect email"}};function c(e){return Object.values(e).reduce((e,t)=>{if(!("hasErrorKey"in t)||!t.hasErrorKey)return e;const n=o[t.message];return n&&(e={...e,[n.field]:n.fieldError}),e},{})}},function(e,t,n){"use strict";n.d(t,"b",(function(){return o})),n.d(t,"a",(function(){return c}));var r=n(10);let u;function o(e,t){t||(u&&!u.isCancelled&&(u.isCancelled=!0),u=t={isCancelled:!1}),Object(r.b)(()=>{!t.isCancelled&&e()&&o(e,t)})}function c(e){Object(r.b)(()=>{e()&&c(e)})}},function(e,t,n){"use strict";var r=n(0),u=n(56);n(98);t.a=({trigger:e,className:t,children:n,positionX:o="left",positionY:c="top",footer:d,forceOpen:a,onOpen:i,onClose:s})=>{const f=Object(r.q)(null),l=Object(r.q)(null),[b,h]=Object(r.r)(!1);return r.a.createElement("div",{ref:l,className:"DropdownMenu "+(t||""),onKeyDown:e=>{const t=f.current;if(!b||40!==e.keyCode||!t)return;const n=document.activeElement,r=Array.from(t.children);n&&-1!==r.indexOf(n)||r[0].focus()}},e({onTrigger:()=>{h(!b),b?s&&s():i&&i()},isOpen:b}),r.a.createElement(u.a,{ref:f,containerRef:l,isOpen:b||!!a,className:t||"",positionX:o,positionY:c,footer:d,autoClose:!0,onClose:()=>{h(!1),s&&s()},shouldSkipTransition:a},n))}},function(e,t,n){"use strict";var r=n(0);t.a=(e,t,n,u,o)=>{const[c,d]=Object(r.r)(-1);Object(r.n)(()=>{d(-1);const n=e.current;t&&n&&!o&&(n.tabIndex=-1,n.focus())},[e,t,o]);return Object(r.m)(t=>{const r=e.current;if(!r)return;if(13===t.keyCode&&n)return void n(c);if(38!==t.keyCode&&40!==t.keyCode)return;const o=document.activeElement,a=Array.from(u?r.querySelectorAll(u):r.children);let i=o&&a.indexOf(o)||c;if(38===t.keyCode&&i>0)i--;else if(40===t.keyCode&&i{if(e.length>24)return!1;if(!Boolean(e.match(u)))return!1;let t=0;for(;r.a.exec(e);)if(t++,t>3)return r.a.lastIndex=0,!1;return t}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return c}));const r=["female_sign","male_sign","medical_symbol"];function u(e){const t=e.split("-").map(e=>parseInt(e,16));return String.fromCodePoint(...t)}function o(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 c(e){const t={categories:[],emojis:{}};for(let n=0;n{void 0!==e.props[r]&&void 0===t.props[r]&&g(n,r,e.props[r])}),u.forEach(r=>{void 0!==t.props[r]&&e.props[r]!==t.props[r]&&(void 0===e.props[r]?p(n,r,t.props[r]):function(e,t,n,r){"value"===t?e.value=void 0!==r?r:"":(g(e,t,n),p(e,t,r))}(n,r,e.props[r],t.props[r]))})}(t,n,Object(r.b)(t)),n.children=function(e,t,n){if(t.props.teactFastList)return function(e,t,n){const u=new Set(t.children.map(e=>{const t="props"in e&&e.props.key;return o.r&&Object(r.f)(e)&&!t&&console.warn("Missing `key` in `teactFastList`"),t}));let c=0;const d=e.children.reduce((e,r,o)=>{let d="props"in r?r.props.key:void 0;if(d&&!u.has(d))return f(n,r,void 0,t,-1),e;if(!d){const u=t.children[o],c=u&&"props"in u?u.props.key:void 0;if(!u||c)return f(n,r,void 0,t,-1),e;d="__indexKey#"+o}return e[d]={$element:r,index:c++,order:"props"in r?r.props.teactOrderKey:void 0},e},{});let a,i,s=[],l=0;t.children.forEach((e,r)=>{const u="props"in e?e.props.key:"__indexKey#"+r,o=d[u];if(!o)return a||(a=[],i=r),void a.push(e);a&&(s=s.concat(m(a,i,n,t)),i=void 0,a=void 0);const c="props"in e?e.props.teactOrderKey:void 0,b=o.index!==l&&o.order!==c,h=b&&l>o.index;b&&!h||l++,s.push(f(n,o.$element,e,t,r,{forceIndex:!0,...b&&{moveDirection:h?"down":"up"}}))}),a&&(s=s.concat(m(a,i,n,t)));return s}(e,t,n);const u=Math.max(e.children.length,t.children.length),c=[],d=t.children.length>e.children.length+1?document.createDocumentFragment():void 0;for(let r=0;r=e.children.length?{fragment:d}:void 0);u&&c.push(u)}d&&n.appendChild(d);return c}(t,n,u?e:Object(r.b)(t))}}return n}function l(e,t,n,u){if(!Object(r.d)(e))return e;const{componentInstance:o}=e;if(!o.isMounted){b(e=Object(r.i)(o),t,n,u);const c=e.children[0];Object(r.d)(c)&&(e.children=[l(c,e,0,u)]),o.isMounted=!0}return e}function b(e,t,n,r){const{componentInstance:u}=e;u.onUpdate=()=>{t.children[n]=f(r,t.children[n],u.$element,t,n,{skipComponentUpdate:!0})}}function h(e){if(Object(r.e)(e))return document.createTextNode("");if(Object(r.g)(e))return document.createTextNode(e.value);if(Object(r.d)(e))return h(e.children[0]);const{tag:t,props:n,children:u=[]}=e,o=document.createElement(t);return"object"==typeof n.ref&&(n.ref.current=o),Object.keys(n).forEach(e=>{p(o,e,n[e])}),e.children=u.map((t,n)=>f(o,void 0,t,e,n)),o}function m(e,t,n,r){if(1===e.length)return[f(n,void 0,e[0],r,t,{forceIndex:!0})];if(e.length>1){const u=document.createDocumentFragment(),o=e.map(e=>f(n,void 0,e,r,t,{fragment:u}));return n.childNodes[t]?n.insertBefore(u,n.childNodes[t]):n.appendChild(u),o}throw new Error("Unexpected input")}function p(e,t,n){void 0!==n&&("className"===t?e.className=n:"value"===t?e.value=n:"style"===t?e.style.cssText=n:t.startsWith("on")?Object(c.a)(e,t,n,t.endsWith("Capture")):t.startsWith("data-")||a.has(t)?e.setAttribute(t,n):d.has(t)||(e[i[t]||t]=n))}function g(e,t,n){"className"===t?e.className="":"value"===t?e.value="":"style"===t?e.style.cssText="":t.startsWith("on")?Object(c.c)(e,t,n,t.endsWith("Capture")):t.startsWith("data-")||a.has(t)?e.removeAttribute(t):d.has(t)||delete e[i[t]||t]}t.a={render:function(e,t){if(!t)return;let n=t.getAttribute("data-teact-head-id");n||(n=Object(u.a)(s),s[n]={children:[]},t.setAttribute("data-teact-head-id",n));const r=s[n];r.children=[f(t,r.children[0],e,r,0)]}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return h}));var r=n(0),u=n(4),o=n(42),c=n(23),d=n(1),a=n(3),i=n(9),s=n(34);var f=Object(d.h)(void 0,(e,t)=>Object(a.l)(t,["openUserInfo"]))(({className:e,sender:t,openUserInfo:n,children:u})=>{const o=Object(r.m)(()=>{t&&n({id:t.id})},[t,n]);return t?r.a.createElement(s.a,{className:Object(i.a)("UserLink",e),onClick:o},u):u});var l=Object(d.h)(void 0,(e,t)=>Object(a.l)(t,["focusMessage"]))(({className:e,message:t,children:n,focusMessage:u})=>{const o=Object(r.m)(()=>{t&&u({chatId:t.chatId,messageId:t.id})},[u,t]);return t?r.a.createElement(s.a,{className:Object(i.a)("MessageLink",e),onClick:o},n):n});var b=Object(d.h)(void 0,(e,t)=>Object(a.l)(t,["openChat"]))(({className:e,chatId:t,openChat:n,children:u})=>{const o=Object(r.m)(()=>{t&&n({id:t})},[t,n]);return t?r.a.createElement(s.a,{className:Object(i.a)("ChatLink",e),onClick:o},u):u});function h(e,t,n,d,a,i,s={}){if(!t.content.action)return[];const{text:f,translationValues:h}=t.content.action,g=[],y={...s,maxTextLength:32};let v,O=p(e("Chat.Service.Group.UpdatedPinnedMessage1"!==f||a?f:"Message.PinnedGenericMessage",h&&h.length?h:void 0),"%action_origin%",n?!s.isEmbedded&&function(e,t,n){return Object(u.ib)(t)?function(e,t,n){const d=Object(o.a)(Object(u.k)(e,t));if(n)return d;return r.a.createElement(b,{className:"action-link",chatId:t.id},t&&Object(c.a)(d))}(e,t,n):m(t,n)}(e,n,s.asPlain)||" ":"User");return v=O.pop(),g.push(...O),O=p(v,"%target_user%",d?d.map(e=>m(e,s.asPlain)).filter(Boolean):"User"),v=O.pop(),g.push(...O),O=p(v,"%message%",a?function(e,t,n={}){const d=Object(u.O)(e,t),{photo:a,video:i,document:s,sticker:f}=Object(u.v)(t),{maxTextLength:b,isEmbedded:h,asPlain:m}=n,p=h&&d&&!a&&!i&&!s&&!f;let g=Object(o.a)(d,b);h&&(a?g="a photo":i?g=i.isGif?"a GIF":"a video":s?g="a document":f&&(g=d));if(m)return p?`«${g}»`:g;if(p)return r.a.createElement("span",null,"«",r.a.createElement(l,{className:"action-link",message:t},Object(c.a)(g)),"»");return r.a.createElement(l,{className:"action-link",message:t},Object(c.a)(g))}(e,a,y):"a message"),v=O.pop(),g.push(...O),O=p(v,"%product%",a?function(e){return e.content&&e.content.invoice?e.content.invoice.title:"a product"}(a):"a product"),v=O.pop(),g.push(...O),O=p(v,"%target_chat%",i?function(e,t){if(t)return"another chat";return r.a.createElement(b,{className:"action-link",chatId:e},"another chat")}(i,s.asPlain):"another chat"),g.push(...O),s.asPlain?g.join("").trim():g}function m(e,t){const n=Object(o.a)(Object(u.bb)(e));return t?n:r.a.createElement(f,{className:"action-link",sender:e},e&&Object(c.a)(n))}function p(e,t,n){const r=e.indexOf(t);if(r<0||!n)return[e];const u=[];return u.push(e.substring(0,r)),Array.isArray(n)?n.forEach((e,t)=>{u.push(e),t+1({userOrChat:t?Object(c.Jb)(e,t):void 0}),(e,t)=>Object(o.l)(t,["openChat","openChatByUsername"]))(({username:e,userOrChat:t,children:n,openChat:u,openChatByUsername:o})=>r.a.createElement("a",{onClick:()=>{t?u({id:t.id}):e&&o({username:e.substring(1)})},className:"text-entity-link",dir:"auto"},n))},function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(2);function u(e){"function"==typeof window.navigator.setAppBadge&&window.navigator.setAppBadge(e).catch(e=>{r.r&&console.error(e)})}},function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(0);function u(e,t,n){Object(r.n)(()=>{const r=e=>{const r=t.current,u=e.target;r&&u&&(r.contains(e.target)&&!u.classList.contains("backdrop")||(e.preventDefault(),e.stopPropagation(),n&&n()))};return e&&n&&document.addEventListener("mousedown",r),()=>{document.removeEventListener("mousedown",r)}},[e,t,n])}},function(e,t,n){e.exports=function(){return new Worker(n.p+"f67db59294ba126247d6.worker.js")}},function(e,t,n){e.exports=function(){return new Worker(n.p+"5054ce745024de60a724.worker.js")}},function(e,t,n){e.exports=function(){return new Worker(n.p+"695e66b225ec96107343.worker.js")}},function(e,t,n){e.exports=function(){return new Worker(n.p+"4c9029ba18603b924ede.worker.js")}},function(e,t,n){"use strict";var r=n(1),u=n(2),o=n(6),c=n(14),d=n(47),a=n(7);!function(){function e(){const e=document.documentElement.className.match(/theme-(\w+)/),t=e?e[1]:"light",n=Object(r.e)(),o=Object(a.Db)(n),{animationLevel:c}=n.settings.byKey;o!==t&&(Object(d.a)(o,c===u.e),Object(r.g)({...n}))}const t=window.matchMedia("(prefers-color-scheme: dark)");"function"==typeof t.addEventListener?t.addEventListener("change",e):"function"==typeof t.addListener&&t.addListener(e)}(),Object(r.b)("init",e=>{const{animationLevel:t,messageTextSize:n,language:r}=e.settings.byKey,i=Object(a.Db)(e);Object(c.d)(r,void 0,!0),document.documentElement.style.setProperty("--composer-text-size",Math.max(n,o.e?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(o.n?"is-touch-env":"is-pointer-env"),Object(d.a)(i,t===u.e),o.j&&document.body.classList.add("is-safari"),o.e?document.body.classList.add("is-ios"):o.b?document.body.classList.add("is-android"):o.f&&document.body.classList.add("is-macos")}),Object(r.b)("setIsUiReady",(e,t,n)=>{const{uiReadyState:r}=n;return 2===r&&document.body.classList.remove("initial"),{...e,uiReadyState:r}}),Object(r.b)("setAuthPhoneNumber",(e,t,n)=>{const{phoneNumber:r}=n;return{...e,authPhoneNumber:r}}),Object(r.b)("setAuthRememberMe",(e,t,n)=>({...e,authRememberMe:Boolean(n)})),Object(r.b)("clearAuthError",e=>({...e,authError:void 0})),Object(r.b)("disableHistoryAnimations",()=>{setTimeout(()=>{Object(r.g)({...Object(r.e)(),shouldSkipHistoryAnimations:!1}),document.body.classList.remove("no-animate")},450),Object(r.g)({...Object(r.e)(),shouldSkipHistoryAnimations:!0},!0)})},function(e,t,n){"use strict";var r=n(1),u=n(11);Object(r.b)("setSettingOption",(e,t,n)=>Object(u.w)(e,n)),Object(r.b)("setThemeSettings",(e,t,n)=>{const{theme:r,...o}=n;return Object(u.x)(e,r,o)})},function(e,t,n){"use strict";var r=n(1),u=n(5),o=n(2),c=n(6),d=n(21),a=n(12),i=n(79),s=n(18);Object(r.b)("initApi",(e,t)=>{(async()=>{o.N||(await Object(s.d)(),Object(s.a)()),Object(u.c)(t.apiUpdate,{userAgent:navigator.userAgent,platform:c.r,sessionData:Object(s.e)()})})()}),Object(r.b)("setAuthPhoneNumber",(e,t,n)=>{const{phoneNumber:r}=n;return Object(u.a)("provideAuthPhoneNumber",r.replace(/[^\d]/g,"")),{...e,authIsLoading:!0,authError:void 0}}),Object(r.b)("setAuthCode",(e,t,n)=>{const{code:r}=n;return Object(u.a)("provideAuthCode",r),{...e,authIsLoading:!0,authError:void 0}}),Object(r.b)("setAuthPassword",(e,t,n)=>{const{password:r}=n;return Object(u.a)("provideAuthPassword",r),{...e,authIsLoading:!0,authError:void 0}}),Object(r.b)("uploadProfilePhoto",(e,t,n)=>{const{file:r}=n;Object(u.a)("uploadProfilePhoto",r)}),Object(r.b)("signUp",(e,t,n)=>{const{firstName:r,lastName:o}=n;return Object(u.a)("provideAuthRegistration",{firstName:r,lastName:o}),{...e,authIsLoading:!0,authError:void 0}}),Object(r.b)("returnToAuthPhoneNumber",e=>(Object(u.a)("restartAuth"),{...e,authError:void 0})),Object(r.b)("goToAuthQrCode",e=>(Object(u.a)("restartAuthWithQr"),{...e,authIsLoadingQrCode:!0,authError:void 0})),Object(r.b)("saveSession",(e,t,n)=>{const{sessionData:r}=n;r?Object(s.f)(n.sessionData,e.currentUserId):Object(s.b)()}),Object(r.b)("signOut",()=>{(async()=>{try{await Object(d.e)(),await Object(u.a)("destroy")}catch(e){}Object(r.d)().reset()})()}),Object(r.b)("reset",()=>{Object(s.b)(),a.b(o.Y),a.b(o.Z),a.b(o.ab),a.b(o.o);const e=o.O.replace(/\d+$/,""),t=(o.O.match(/\d+$/)||[0])[0];for(let n=0;n{(async()=>{await Object(u.a)("disconnect")})()}),Object(r.b)("loadNearestCountry",e=>{"connectionStateReady"===e.connectionState&&(async()=>{const e=await Object(u.a)("fetchNearestCountry");Object(r.g)({...Object(r.e)(),authNearestCountry:e})})()}),Object(r.b)("setDeviceToken",(e,t,n)=>{Object(r.g)({...e,push:{deviceToken:n,subscribedAt:Date.now()}})}),Object(r.b)("deleteDeviceToken",e=>{const t={...e};delete t.push,Object(r.g)(t)})},function(e,t,n){"use strict";var r=n(1),u=n(13),o=n(5),c=n(3),d=n(21),a=n(7),i=n(11),s=n(4);function f(e,{visibility:t,allowedIds:n,deniedIds:r}){const{users:{byId:u},chats:{byId:o}}=e,c={visibility:t};let d,a;const i=e=>{if(!Object(s.ob)(e))return;const{id:t,accessHash:n}=u[e]||{};return t?{id:t,accessHash:n}:void 0},f=e=>{if(Object(s.ob)(e))return;const t=o[e];return t?{id:t.id}:void 0};return"contacts"!==t&&"nobody"!==t||(d=n.map(i).filter(Boolean),a=n.map(f).filter(Boolean),d.length>0&&(c.allowedUsers=d),a.length>0&&(c.allowedChats=a)),"everybody"!==t&&"contacts"!==t||(d=r.map(i).filter(Boolean),a=r.map(f).filter(Boolean),d.length>0&&(c.blockedUsers=d),a.length>0&&(c.blockedChats=a)),c}Object(r.b)("updateProfile",(e,t,n)=>{const{photo:c,firstName:d,lastName:s,bio:f,username:l}=n;(async()=>{const{currentUserId:t}=e;if(t){if(Object(r.g)({...Object(r.e)(),profileEdit:{progress:u.k.InProgress}}),c&&await Object(o.a)("updateProfilePhoto",c),d||s||f){if(await Object(o.a)("updateProfile",{firstName:d,lastName:s,about:f})){e=Object(r.e)();const n=t&&Object(a.Jb)(e,t);n&&Object(r.g)(Object(i.ob)(e,n.id,{firstName:d,lastName:s,fullInfo:{...n.fullInfo,bio:f}}))}}if(l){await Object(o.a)("updateUsername",l)&&t&&Object(r.g)(Object(i.ob)(Object(r.e)(),t,{username:l}))}Object(r.g)({...Object(r.e)(),profileEdit:{progress:u.k.Complete}})}})()}),Object(r.b)("checkUsername",(e,t,n)=>{const{username:c}=n;(async()=>{if(e.profileEdit&&e.profileEdit.progress===u.k.InProgress)return;Object(r.g)({...e,profileEdit:{progress:e.profileEdit?e.profileEdit.progress:u.k.Idle,isUsernameAvailable:void 0}});const t=await Object(o.a)("checkUsername",c);e=Object(r.e)(),Object(r.g)({...e,profileEdit:{...e.profileEdit,isUsernameAvailable:t}})})()}),Object(r.b)("loadWallpapers",()=>{(async()=>{const e=await Object(o.a)("fetchWallpapers",0);if(!e)return;const t=Object(r.e)();Object(r.g)({...t,settings:{...t.settings,loadedWallpapers:e.wallpapers}})})()}),Object(r.b)("uploadWallpaper",(e,t,n)=>{const c=n,d=URL.createObjectURL(c);Object(r.g)({...e,settings:{...e.settings,loadedWallpapers:[{slug:u.o,document:{fileName:"",size:c.size,mimeType:c.type,previewBlobUrl:d}},...e.settings.loadedWallpapers||[]]}}),(async()=>{const t=await Object(o.a)("uploadWallpaper",c);if(!t)return;const{wallpaper:n}=t;if(!(e=Object(r.e)()).settings.loadedWallpapers)return;const a=e.settings.loadedWallpapers[0];if(!a||a.slug!==u.o)return;const i={...n,document:{...n.document,previewBlobUrl:d}};Object(r.g)({...e,settings:{...e.settings,loadedWallpapers:[i,...e.settings.loadedWallpapers.slice(1)]}})})()}),Object(r.b)("loadBlockedContacts",()=>{(async()=>{const e=await Object(o.a)("fetchBlockedContacts");if(!e)return;let t=Object(r.e)();e.users&&e.users.length&&(t=Object(i.g)(t,Object(c.c)(e.users,"id"))),e.chats&&e.chats.length&&(t=Object(i.N)(t,Object(c.c)(e.chats,"id"))),t={...t,blocked:{...t.blocked,ids:[...t.blocked.ids||[],...e.blockedIds],totalCount:e.totalCount}},Object(r.g)(t)})()}),Object(r.b)("blockContact",(e,t,n)=>{const{contactId:u,accessHash:c}=n;(async()=>{if(!await Object(o.a)("blockContact",u,c))return;const e=Object(r.e)();Object(r.g)(Object(i.a)(e,u))})()}),Object(r.b)("unblockContact",(e,t,n)=>{const{contactId:u}=n;let c;if(Object(s.ob)(u)){const t=Object(a.Jb)(e,u);if(!t)return;c=t.accessHash}(async()=>{if(!await Object(o.a)("unblockContact",u,c))return;const e=Object(r.e)();Object(r.g)(Object(i.q)(e,u))})()}),Object(r.b)("loadAuthorizations",()=>{(async()=>{const e=await Object(o.a)("fetchAuthorizations");e&&Object(r.g)({...Object(r.e)(),activeSessions:e})})()}),Object(r.b)("terminateAuthorization",(e,t,n)=>{const{hash:u}=n;(async()=>{if(!await Object(o.a)("terminateAuthorization",u))return;const e=Object(r.e)();Object(r.g)({...e,activeSessions:e.activeSessions.filter(e=>e.hash!==u)})})()}),Object(r.b)("terminateAllAuthorizations",()=>{(async()=>{if(!await Object(o.a)("terminateAllAuthorizations"))return;const e=Object(r.e)();Object(r.g)({...e,activeSessions:e.activeSessions.filter(e=>e.isCurrent)})})()}),Object(r.b)("loadNotificationExceptions",e=>{const{serverTimeOffset:t}=e;(async()=>{const e=await Object(o.a)("fetchNotificationExceptions",{serverTimeOffset:t});e&&Object(r.g)(Object(i.f)(Object(r.e)(),e))})()}),Object(r.b)("loadNotificationSettings",e=>{const{serverTimeOffset:t}=e;(async()=>{const e=await Object(o.a)("fetchNotificationSettings",{serverTimeOffset:t});e&&Object(r.g)(Object(i.w)(Object(r.e)(),e))})()}),Object(r.b)("updateNotificationSettings",(e,t,n)=>{const{peerType:u,isSilent:c,shouldShowPreviews:d}=n;(async()=>{await Object(o.a)("updateNotificationSettings",u,{isSilent:c,shouldShowPreviews:d})&&Object(r.g)(Object(i.db)(Object(r.e)(),u,c,d))})()}),Object(r.b)("updateWebNotificationSettings",(e,t,n)=>{(async()=>{Object(r.g)(Object(i.w)(Object(r.e)(),n));const e=Object(r.e)(),{hasPushNotifications:t,hasWebNotifications:u}=e.settings.byKey;u&&t?await Object(d.d)():await Object(d.e)()})()}),Object(r.b)("updateContactSignUpNotification",(e,t,n)=>{const{isSilent:u}=n;(async()=>{await Object(o.a)("updateContactSignUpNotification",u)&&Object(r.g)(Object(i.w)(Object(r.e)(),{hasContactJoinedNotifications:!u}))})()}),Object(r.b)("loadLanguages",()=>{(async()=>{const e=await Object(o.a)("fetchLanguages");e&&Object(r.g)(Object(i.w)(Object(r.e)(),{languages:e}))})()}),Object(r.b)("loadPrivacySettings",()=>{(async()=>{const[e,t,n,u,c]=await Promise.all([Object(o.a)("fetchPrivacySettings","phoneNumber"),Object(o.a)("fetchPrivacySettings","lastSeen"),Object(o.a)("fetchPrivacySettings","profilePhoto"),Object(o.a)("fetchPrivacySettings","forwards"),Object(o.a)("fetchPrivacySettings","chatInvite")]);if(!(e&&t&&n&&u&&c))return;const d=Object(r.e)();d.settings.privacy.phoneNumber=e,d.settings.privacy.lastSeen=t,d.settings.privacy.profilePhoto=n,d.settings.privacy.forwards=u,d.settings.privacy.chatInvite=c,Object(r.g)(d)})()}),Object(r.b)("setPrivacyVisibility",(e,t,n)=>{const{privacyKey:u,visibility:c}=n,{privacy:{[u]:d}}=e.settings;if(!d)return;const a=f(e,{visibility:c,allowedIds:[...d.allowUserIds,...d.allowChatIds],deniedIds:[...d.blockUserIds,...d.blockChatIds]});(async()=>{const e=await Object(o.a)("setPrivacySettings",u,a);if(e){const t=Object(r.e)();t.settings.privacy[u]=e,Object(r.g)(t)}})()}),Object(r.b)("setPrivacySettings",(e,t,n)=>{const{privacyKey:u,isAllowList:c,contactsIds:d}=n,{privacy:{[u]:a}}=e.settings;if(!a)return;const i=f(e,{visibility:a.visibility,allowedIds:c?d:[...a.allowUserIds,...a.allowChatIds],deniedIds:c?[...a.blockUserIds,...a.blockChatIds]:d});(async()=>{const e=await Object(o.a)("setPrivacySettings",u,i);if(e){const t=Object(r.e)();t.settings.privacy[u]=e,Object(r.g)(t)}})()}),Object(r.b)("updateIsOnline",(e,t,n)=>{Object(o.a)("updateIsOnline",n)}),Object(r.b)("loadContentSettings",()=>{(async()=>{const e=await Object(o.a)("fetchContentSettings");e&&Object(r.g)(Object(i.w)(Object(r.e)(),e))})()}),Object(r.b)("updateContentSettings",(e,t,n)=>{(async()=>{Object(r.g)(Object(i.w)(Object(r.e)(),{isSensitiveEnabled:n}));await Object(o.a)("updateContentSettings",n)||Object(r.g)(Object(i.w)(Object(r.e)(),{isSensitiveEnabled:!n}))})()})},function(e,t,n){"use strict";var r=n(1),u=n(2),o=n(21),c=n(11),d=n(14),a=n(7);Object(r.b)("apiUpdate",(e,t,n)=>{switch(u.r&&"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}=Object(a.fb)(e);t&&n&&Object(o.d)();Object(d.d)(e.settings.byKey.language)}(e);break;case"updateAuthorizationState":!function(e){let t=Object(r.e)();const n="authorizationStateReady"===t.authState,u=e.authorizationState;switch(Object(r.g)({...t,authState:u,authIsLoading:!1}),t=Object(r.e)(),u){case"authorizationStateLoggingOut":Object(r.g)({...t,isLoggingOut:!0});break;case"authorizationStateWaitCode":Object(r.g)({...t,authIsCodeViaApp:e.isCodeViaApp});break;case"authorizationStateWaitPassword":Object(r.g)({...t,authHint:e.hint});break;case"authorizationStateWaitQrCode":Object(r.g)({...t,authIsLoadingQrCode:!1,authQrCode:e.qrCode});break;case"authorizationStateReady":if(n)break;Object(r.g)({...t,isLoggingOut:!1,lastSyncTime:Date.now()})}}(n);break;case"updateAuthorizationError":!function(e){Object(r.g)({...Object(r.e)(),authError:e.message})}(n);break;case"updateConnectionState":!function(e){const{connectionState:t}=e,n=Object(r.e)();Object(r.g)({...n,connectionState:t}),"connectionStateReady"===t&&"authorizationStateReady"===n.authState?Object(r.d)().sync():"connectionStateBroken"===t&&Object(r.d)().signOut()}(n);break;case"updateSession":!function(e){const{sessionData:t}=e,{authRememberMe:n,authState:u}=Object(r.e)(),o=!t||!t.mainDcId;if(!n||"authorizationStateReady"!==u||o)return;Object(r.d)().saveSession({sessionData:t})}(n);break;case"updateServerTimeOffset":!function(e){const t=Object(r.e)();if(t.serverTimeOffset===e.serverTimeOffset)return;Object(r.g)({...t,serverTimeOffset:e.serverTimeOffset})}(n);break;case"updateCurrentUser":!function(e){const{currentUser:t}=e;Object(r.g)({...Object(c.ob)(Object(r.e)(),t.id,t),currentUserId:t.id}),function(e){const t=localStorage.getItem(u.zb);if(!t)return;const n=JSON.parse(t);n.id=e,localStorage.setItem(u.zb,JSON.stringify(n))}(t.id)}(n);break;case"error":"SESSION_REVOKED"===n.error.message&&t.signOut(),t.showDialog&&t.showDialog({data:{...n.error,hasErrorKey:!0}})}})},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){"use strict";n.r(t);n(28),function(){function e(){var t=Error.call(this,"ServiceWorker is not supported.");return Object.setPrototypeOf(t,e.prototype),t}e.prototype=Object.create(Error.prototype)}();var r=n.p+"serviceWorker.js";var u=n(2),o=n(1),c=n(6),d=n(21);function a(e){const t=e.data;if(!t.type)return;const n=Object(o.d)();switch(t.type){case"focusMessage":n.focusMessage&&n.focusMessage(t.payload);break;case"playNotificationSound":Object(d.b)(t.payload.id)}}function i(){navigator.serviceWorker.removeEventListener("message",a),navigator.serviceWorker.addEventListener("message",a),Object(d.a)()}c.k&&(window.addEventListener("load",async()=>{try{await navigator.serviceWorker.register(r),u.r&&console.log("[SW] ServiceWorker registered"),await navigator.serviceWorker.ready,navigator.serviceWorker.controller?(u.r&&console.log("[SW] ServiceWorker ready"),i()):(u.r&&console.error("[SW] ServiceWorker not available"),c.e||c.b||Object(o.d)().showDialog({data:{message:"SERVICE_WORKER_DISABLED",hasErrorKey:!0}}))}catch(e){u.r&&console.error("[SW] ServiceWorker registration failed: ",e)}}),window.addEventListener("focus",async()=>{await navigator.serviceWorker.ready,i()}));var s=n(67);const f={isLeftColumnShown:!0,isChatInfoShown:!1,newChatMembersProgress:n(13).i.Closed,uiReadyState:0,serverTimeOffset:0,authRememberMe:!0,blocked:{ids:[],totalCount:0},users:{byId:{}},chats:{listIds:{},isFullyLoaded:{},orderedPinnedIds:{},totalCount:{},byId:{}},messages:{byChatId:{},messageLists:[]},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:{},forwardMessages:{},pollResults:{},payment:{},notifications:[],dialogs:[],activeSessions:[],settings:{byKey:{theme:"light",shouldUseSystemTheme:!0,messageTextSize:c.e?u.M:c.f?u.U:u.w,animationLevel:u.d,messageSendKeyCombo:"enter",shouldAutoDownloadMediaFromContacts:!0,shouldAutoDownloadMediaInPrivateChats:!0,shouldAutoDownloadMediaInGroups:!0,shouldAutoDownloadMediaInChannels:!0,hasWebNotifications:!0,hasPushNotifications:!0,notificationSoundVolume:5,shouldAutoPlayGifs:!0,shouldAutoPlayVideos:!0,shouldSuggestStickers:!0,shouldLoopStickers:!0,language:"en"},themes:{light:{isBlurred:!0,patternColor:u.x},dark:{isBlurred:!0,patternColor:u.q}},privacy:{},notifyExceptions:{}},twoFaSettings:{},shouldShowContextMenuHint:!0};var l=n(8),b=n(10),h=n(38),m=n(3),p=n(7),g=n(18);const y=Object(b.h)(()=>Object(b.d)(E),5e3,!1);let v,O=!1,j=!1;function w(e){if(!u.I)return Object(g.c)(!0)?(I(),function(e){u.r&&console.time("global-state-cache-read");const t=localStorage.getItem(u.J),n=t?JSON.parse(t):void 0;u.r&&console.timeEnd("global-state-cache-read");n&&(n.settings.byKey={...e.settings.byKey,...n.settings.byKey},n.settings.themes={...e.settings.themes,...n.settings.themes},n.chatFolders={...e.chatFolders,...n.chatFolders},n.messages.messageLists||(n.messages.messageLists=e.messages.messageLists),n.stickers.greeting||(n.stickers.greeting=e.stickers.greeting));return{...e,...n}}(e)):void C()}function I(){O=!0,v=Object(b.c)(E,!0),window.addEventListener("blur",E),Object(o.a)(y)}function C(){O=!1,Object(o.f)(y),window.removeEventListener("blur",E),v&&v()}function E(){if(!O||j)return;const e=Object(o.e)();if(e.isLoggingOut)return;const t={...f,...Object(m.l)(e,["authState","authPhoneNumber","authRememberMe","authNearestCountry","currentUserId","contactList","topPeers","topInlineBots","recentEmojis","push","shouldShowContextMenuHint"]),isChatInfoShown:S(e),users:A(e),chats:M(e),messages:k(e),globalSearch:{recentlyFoundChatIds:e.globalSearch.recentlyFoundChatIds},settings:T(e),chatFolders:N(e)},n=JSON.stringify(t);localStorage.setItem(u.J,n)}function S(e){return window.innerWidth>u.lb&&e.isChatInfoShown}function A(e){const{users:{byId:t,selectedId:n}}=e,r=[...(e.chats.listIds.active||[]).slice(0,u.H).filter(e=>e>0),...Object.keys(t)].slice(0,u.K);return{byId:Object(m.l)(t,r),selectedId:window.innerWidth>u.lb?n:void 0}}function M(e){const t=[...(e.chats.listIds.active||[]).slice(0,u.H)],{chatId:n}=Object(p.z)(e)||{};return{...e.chats,byId:Object(m.l)(e.chats.byId,n?[...t,n]:t),listIds:{active:t},isFullyLoaded:{},orderedPinnedIds:{active:e.chats.orderedPinnedIds.active}}}function k(e){const t={},{chatId:n}=Object(p.z)(e)||{};[...(e.chats.listIds.active||[]).slice(0,u.H),...n?[n]:[]].forEach(n=>{const r=e.messages.byChatId[n];if(!r)return;const u=r.threadsById[l.MAIN_THREAD_ID];u&&u.viewportIds&&(t[n]={byId:Object(m.l)(r.byId,u.viewportIds),threadsById:{[l.MAIN_THREAD_ID]:u}})});const r=Object(p.z)(e);return{byChatId:t,messageLists:!r||c.l?[]:[{...r,threadId:l.MAIN_THREAD_ID,type:"thread"}]}}function T(e){const{byKey:t,themes:n}=e.settings;return{byKey:t,themes:n,privacy:{},notifyExceptions:{}}}function N(e){return{...e.chatFolders,activeChatFolder:0}}document.addEventListener(h.b,()=>{j=!0}),document.addEventListener(h.a,()=>{j=!1}),u.I||(Object(o.b)("saveSession",()=>{O||I()}),Object(o.b)("reset",()=>{localStorage.removeItem(u.J),O&&C()})),Object(o.b)("init",()=>{const e=Object(m.d)(f);return w(e)||e});var P=n(0),D=n(55);const L=String(Date.now()+Math.random());let x;localStorage.setItem("tt-active-tab",L);const F=window.setInterval(()=>{x&&localStorage.getItem("tt-active-tab")!==L&&(x(),clearInterval(F))},2e3);var B=n(25),R=(n(85),n(86),n(87),n(88),n(89),n(40)),U=n(37),_=n(41),$=n(16);const G=["400 1em Roboto","500 1em Roboto"];function W(){if("fonts"in document)return Promise.all(G.map(e=>document.fonts.load(e)))}var H=n(33),z=n(15),K=n(9),V=(n(91),n.p+"telegram-logo.df3a91becaa9678c529b4c4cadd45204.svg"),q=n.p+"monkey.a3d5fcdc50b18dc55695f7dd4101a8c9.svg";function J(){const{listIds:e,byId:t}=Object(o.e)().chats;if(e.active)return Promise.all(e.active.slice(0,10).map(e=>{const n=t[e];if(!n)return;const r=Object(U.d)(n);return r?H.b(r,l.ApiMediaFormat.DataUri):void 0}))}const Q={main:()=>Promise.all([Object(z.d)(z.a.Main,"Main").then(W),J()]),authPhoneNumber:()=>Promise.all([W(),Object($.g)(V)]),authCode:()=>Object($.g)(q),authPassword:()=>Object($.g)(q),authQrCode:W};var Y=Object(o.h)(e=>{const t=Object(p.Db)(e),{background:n,backgroundColor:r}=e.settings.themes[t]||{};return{shouldSkipHistoryAnimations:e.shouldSkipHistoryAnimations,uiReadyState:e.uiReadyState,hasCustomBackground:Boolean(n),hasCustomBackgroundColor:Boolean(r),isRightColumnShown:Object(p.W)(e)}},(e,t)=>Object(m.l)(t,["setIsUiReady"]))(({page:e,children:t,hasCustomBackground:n,hasCustomBackgroundColor:r,isRightColumnShown:u,shouldSkipHistoryAnimations:o,setIsUiReady:c})=>{const[d,a]=Object(B.a)(),{shouldRender:i,transitionClassNames:s}=Object(_.a)(!d,void 0,!0);return Object(P.n)(()=>{let t;return Promise.race([Object(b.f)(700),(async()=>{try{await Q[e]()}catch(e){}})()]).then(()=>{a(),c({uiReadyState:1}),t=window.setTimeout(()=>{c({uiReadyState:2})},1e3)}),()=>{t&&(clearTimeout(t),t=void 0),c({uiReadyState:0})}},[]),P.a.createElement("div",{id:"UiLoader"},t,i&&!o&&P.a.createElement("div",{className:Object(K.a)("mask",s)},"main"===e?P.a.createElement(P.a.Fragment,null,P.a.createElement("div",{className:"left"}),P.a.createElement("div",{className:Object(K.a)("middle",n&&"custom-bg-image",r&&"custom-bg-color",u&&"with-right-column")}),u&&P.a.createElement("div",{className:"right"})):P.a.createElement("div",{className:"blank"})))}),Z=n(24),X=n(14),ee=n(17),te=(e,t)=>{const[n,r]=Object(P.r)();return e&&X.c(e,t).then(r),n};function ne(){let e=navigator.language;return e&&"pt-br"!==e&&(e=e.substr(0,2)),e}var re=n(22),ue=n(49),oe=n(48),ce=n(20),de=n(54),ae=n(23),ie=n(63),se=n(44),fe=n(27);n(100);const le=200+u.c;var be=Object(P.h)(({id:e,value:t,isLoading:n,onChange:r})=>{const u=Object(ee.a)(),o=Object(P.q)(null),[c,d]=Object(P.r)(),[a,i]=Object(P.r)(Z.a);function s(e){d(e),i(function(e=""){return e.length?Z.a.filter(t=>Object(de.a)(t.name,e)):Z.a}(e))}const f=Object(P.m)(e=>{const{countryId:t}=e.currentTarget.firstElementChild.dataset,n=Z.a.find(e=>e.id===t);n&&r(n),setTimeout(()=>s(void 0),le)},[r]),l=Object(P.m)(e=>{s(e.currentTarget.value)},[]),b=Object(P.m)(e=>{if(8!==e.keyCode)return;const n=e.currentTarget;t&&void 0===c&&(n.value=""),s(n.value)},[c,t]);return P.a.createElement(ie.a,{className:"CountryCodeInput",trigger:({onTrigger:r,isOpen:d})=>{const a=()=>{if(d)return;setTimeout(()=>{o.current.select()},50),r();const e=document.getElementById("auth-phone-number-form");e.scrollTo({top:e.scrollHeight,behavior:"smooth"})},i=void 0!==c?c:t&&t.name||"";return P.a.createElement("div",{className:Object(K.a)("input-group",t&&"touched")},P.a.createElement("input",{ref:o,className:Object(K.a)("form-control",d&&"focus"),type:"text",id:e,value:i,autoComplete:"off",onClick:a,onFocus:a,onInput:l,onKeyDown:b}),P.a.createElement("label",null,u("Login.SelectCountry.Title")),n?P.a.createElement(fe.a,{color:"black"}):P.a.createElement("i",{onClick:a,className:Object(K.a)("css-icon-down",d&&"open")}))}},a.map(e=>P.a.createElement(se.a,{key:e.id,className:t&&e.id===t.id?"selected":"",onClick:f},P.a.createElement("span",{"data-country-id":e.id}),P.a.createElement("span",{className:"country-flag"},Object(ae.a)(e.flag,["hq_emoji"])),P.a.createElement("span",{className:"country-name"},e.name),P.a.createElement("span",{className:"country-code"},e.code))),!a.length&&P.a.createElement(se.a,{key:"no-results",className:"no-results",disabled:!0},P.a.createElement("span",null,u("lng_country_none"))))});let he=!1;var me=Object(P.h)(Object(o.h)(e=>{const{settings:{byKey:{language:t}}}=e;return{...Object(m.l)(e,["connectionState","authState","authPhoneNumber","authIsLoading","authIsLoadingQrCode","authError","authRememberMe","authNearestCountry"]),language:t}},(e,t)=>Object(m.l)(t,["setAuthPhoneNumber","setAuthRememberMe","clearAuthError","loadNearestCountry","goToAuthQrCode","setSettingOption"]))(({connectionState:e,authState:t,authPhoneNumber:n,authIsLoading:r,authIsLoadingQrCode:u,authError:o,authRememberMe:d,authNearestCountry:a,language:i,setAuthPhoneNumber:s,setAuthRememberMe:f,loadNearestCountry:l,clearAuthError:b,goToAuthQrCode:h,setSettingOption:m})=>{const p=Object(ee.a)(),g=Object(P.q)(null),y=ne(),v=te(y,"ContinueOnThisLanguage"),[O,j]=Object(P.r)(),[w,I]=Object(P.r)(),[C,E]=Object(P.r)(!1),[S,A]=Object(P.r)(),[M,k,T]=Object(B.a)(),N=O?`${O.code} ${w||""}`:w,D=N&&N.replace(/[^\d]+/g,"").length>=7;Object(P.n)(()=>{c.n||g.current.focus()},[O]),Object(P.n)(()=>{"connectionStateReady"!==e||a||l()},[e,a,l]),Object(P.n)(()=>{!a||O||C||j(Object(Z.d)(a))},[O,a,C]);const L=Object(P.m)(e=>{e.length||I("");const t=Object(Z.e)(e),n=!O||t&&t.id!==O.id||!t&&e.length?t:O;(!O||!n||n&&n.code!==O.code)&&j(n),I(Object(Z.b)(e,n))},[O]),x=Object(P.m)(()=>{k(),Object(X.d)(y,()=>{T(),m({language:y})})},[k,m,y,T]);Object(P.n)(()=>{void 0===w&&n&&L(n)},[n,w,L]),Object(P.o)(()=>{g.current&&S&&g.current.setSelectionRange(...S)},[S]);const F=Object(P.q)(!1),R=Object(P.m)(()=>{F.current=!0,requestAnimationFrame(()=>{F.current=!1})},[]),U=Object(P.m)(e=>{o&&b(),he||(he=!0,W(),Object($.g)(q));const{value:t,selectionStart:n,selectionEnd:r}=e.target;A(n&&r&&r1&&!F.current;L(u?`${O.code} ${t}`:t)},[o,b,O,N,L]),_=Object(P.m)(e=>{f(e.target.checked)},[f]);const G="authorizationStateWaitPhoneNumber"===t;return P.a.createElement("div",{id:"auth-phone-number-form",className:"custom-scroll"},P.a.createElement("div",{className:"auth-form"},P.a.createElement("div",{id:"logo"}),P.a.createElement("h2",null,"Telegram"),P.a.createElement("p",{className:"note"},p("StartText")),P.a.createElement("form",{action:"",onSubmit:function(e){e.preventDefault(),r||D&&s({phoneNumber:N})}},P.a.createElement(be,{id:"sign-in-phone-code",value:O,isLoading:!a&&!O,onChange:j}),P.a.createElement(oe.a,{ref:g,id:"sign-in-phone-number",label:p("Login.PhonePlaceholder"),value:N,error:o&&p(o),inputMode:"tel",onChange:U,onPaste:c.j?R:void 0}),P.a.createElement(ue.a,{id:"sign-in-keep-session",label:"Keep me signed in",checked:Boolean(d),onChange:_}),D&&(G?P.a.createElement(re.a,{type:"submit",ripple:!0,isLoading:r},p("Login.Next")):P.a.createElement(ce.a,null)),G&&P.a.createElement(re.a,{isText:!0,ripple:!0,isLoading:u,onClick:h},p("Login.QR.Login")),y&&y!==i&&v&&P.a.createElement(re.a,{isText:!0,isLoading:M,onClick:x},v))))})),pe=n(26);var ge=Object(P.h)(()=>{const e=Object(pe.a)(z.a.Auth,"AuthCode");return e?P.a.createElement(e,null):P.a.createElement(ce.a,null)});var ye=Object(P.h)(()=>{const e=Object(pe.a)(z.a.Auth,"AuthPassword");return e?P.a.createElement(e,null):P.a.createElement(ce.a,null)});var ve=Object(P.h)(()=>{const e=Object(pe.a)(z.a.Auth,"AuthRegister");return e?P.a.createElement(e,null):P.a.createElement(ce.a,null)});let Oe=null;class je{}je.render=function(e,t){Oe(e,t)},self.QrCreator=je,function(e){function t(t,n,r,u){var o={},c=e(r,n);c.u(t),c.J(),u=u||0;var d=c.h(),a=c.h()+2*u;return o.text=t,o.level=n,o.version=r,o.O=a,o.a=function(e,t){return t-=u,!(0>(e-=u)||e>=d||0>t||t>=d)&&c.a(e,t)},o}function n(e,t,n,r,u,o,c,d,a,i){function s(t,n,r,u,c,d,a){t?(e.lineTo(n+d,r+a),e.arcTo(n,r,u,c,o)):e.lineTo(n,r)}c?e.moveTo(t+o,n):e.moveTo(t,n),s(d,r,n,r,u,-o,0),s(a,r,u,t,u,0,-o),s(i,t,u,t,n,o,0),s(c,t,n,r,n,0,o)}function r(e,t,n,r,u,o,c,d,a,i){function s(t,n,r,u){e.moveTo(t+r,n),e.lineTo(t,n),e.lineTo(t,n+u),e.arcTo(t,n,t+r,n,o)}c&&s(t,n,o,o),d&&s(r,n,-o,o),a&&s(r,u,-o,-o),i&&s(t,u,o,-o)}function u(e,u){e:{var o=u.text,c=u.v,d=u.N,a=u.K,i=u.P;for(d=Math.max(1,d||1),a=Math.min(40,a||40);d<=a;d+=1)try{var s=t(o,c,d,i);break e}catch(e){}s=void 0}if(!s)return null;for(o=e.getContext("2d"),u.background&&(o.fillStyle=u.background,o.fillRect(u.left,u.top,u.size,u.size)),c=s.O,a=u.size/c,o.beginPath(),i=0;iMath.round(e*t.size)),"linear-gradient"===r)var o=e.createLinearGradient.apply(e,n);else{if("radial-gradient"!==r)throw Error("Unsupported fill");o=e.createRadialGradient.apply(e,n)}u.forEach(([e,t])=>{o.addColorStop(e,t)}),e.fillStyle=o}}(o,u),o.fill(),e}var o={minVersion:1,maxVersion:40,ecLevel:"L",left:0,top:0,size:200,fill:"#000",background:null,text:"no text",radius:.5,quiet:0};Oe=function(e,t){var n={};Object.assign(n,o,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),u(t,n)):((e=document.createElement("canvas")).width=n.size,e.height=n.size,n=u(e,n),t.appendChild(n))}}(function(){function e(u,c){function d(e,t){for(var n=-1;7>=n;n+=1)if(!(-1>=e+n||f<=e+n))for(var r=-1;7>=r;r+=1)-1>=t+r||f<=t+r||(s[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 a(e,n){for(var c=f=4*u+17,a=Array(c),h=0;h=g;g+=1)for(var y=-2;2>=y;y+=1)s[m+g][p+y]=-2==g||2==g||-2==y||2==y||0==g&&0==y}for(c=8;ca;a+=1)h=!e&&1==(c>>a&1),s[6>a?a:8>a?a+1:f-15+a][8]=h,s[8][8>a?f-a-1:9>a?15-a:14-a]=h;if(s[f-8][8]=!e,7<=u){for(c=r.A(u),a=0;18>a;a+=1)h=!e&&1==(c>>a&1),s[Math.floor(a/3)][a%3+f-8-3]=h;for(a=0;18>a;a+=1)h=!e&&1==(c>>a&1),s[a%3+f-8-3][Math.floor(a/3)]=h}if(null==l){for(e=o.I(u,i),c=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}(),a=0;a8*h)throw Error("code length overflow. ("+c.f()+">"+8*h+")");for(c.f()+4<=8*h&&c.put(0,4);0!=c.f()%8;)c.m(!1);for(;!(c.f()>=8*h)&&(c.put(236,8),!(c.f()>=8*h));)c.put(17,8);var v=0;for(h=a=0,m=Array(e.length),p=Array(e.length),g=0;gg;g+=1)null==s[a][p-g]&&(y=!1,m>>h&1)),n(a,p-g)&&(y=!y),s[a][p-g]=y,-1==--h&&(m+=1,h=7));if(0>(a+=c)||f<=a){a-=c,c=-c;break}}}var i=n[c],s=null,f=0,l=null,b=[],h={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||f<=e||0>t||f<=t)throw Error(e+","+t);return s[e][t]},h:function(){return f},J:function(){for(var e=0,t=0,n=0;8>n;n+=1){a(!0,n);var u=r.D(h);(0==n||e>u)&&(e=u,t=n)}a(!1,t)}};return h}function t(e,n){if(void 0===e.length)throw Error(e.length+"/"+n);var r=function(){for(var t=0;to.b()-e.b())return o;for(var n=u.g(o.c(0))-u.g(e.c(0)),r=Array(o.b()),c=0;cr?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]];return{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=d;d+=1)if(!(0>r+d||t<=r+d))for(var a=-1;1>=a;a+=1)0>u+a||t<=u+a||(0!=d||0!=a)&&c==e.a(r+d,u+a)&&(o+=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]}}}(),o=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]];return{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 u=0;u{const{connectionState:t,authState:n,authQrCode:r,settings:{byKey:{language:u}}}=e;return{connectionState:t,authState:n,authQrCode:r,language:u}},(e,t)=>Object(m.l)(t,["returnToAuthPhoneNumber","setSettingOption"]))(({connectionState:e,authState:t,authQrCode:n,language:r,returnToAuthPhoneNumber:u,setSettingOption:o})=>{const c=ne(),d=Object(ee.a)(),a=Object(P.q)(null),i=te(c,"ContinueOnThisLanguage"),[s,f,l]=Object(B.a)();Object(P.n)(()=>{if(!n||"connectionStateReady"!==e)return;const t=a.current;t.innerHTML="",t.classList.remove("pre-animate"),we.render({text:"tg://login?token="+n.token,radius:.5,ecLevel:"M",fill:"#4E96D4",size:280},t)},[e,n]);const b=Object(P.m)(()=>{f(),Object(X.d)(c,()=>{l(),o({language:c})})},[f,o,c,l]),h="authorizationStateWaitQrCode"===t;return P.a.createElement("div",{id:"auth-qr-form",className:"custom-scroll"},P.a.createElement("div",{className:"auth-form qr"},n?P.a.createElement("div",{key:"qr-container",className:"qr-container pre-animate",ref:a}):P.a.createElement("div",{key:"qr-loading",className:"qr-loading"},P.a.createElement(ce.a,null)),P.a.createElement("h3",null,d("Login.QR.Title")),P.a.createElement("ol",null,P.a.createElement("li",null,P.a.createElement("span",null,d("Login.QR.Help1"))),P.a.createElement("li",null,P.a.createElement("span",null,Object(ae.a)(d("Login.QR.Help2"),["simple_markdown"]))),P.a.createElement("li",null,P.a.createElement("span",null,d("Login.QR.Help3")))),h&&P.a.createElement(re.a,{isText:!0,onClick:u},d("Login.QR.Cancel")),c&&c!==r&&i&&P.a.createElement(re.a,{isText:!0,isLoading:s,onClick:b},i)))}));n(101);var Ce=Object(P.h)(Object(o.h)(e=>Object(m.l)(e,["authState"]),(e,t)=>Object(m.l)(t,["reset","initApi","returnToAuthPhoneNumber","goToAuthQrCode"]))(({authState:e,reset:t,initApi:n,returnToAuthPhoneNumber:r,goToAuthQrCode:u})=>{Object(P.n)(()=>{t(),n()},[t,n]);const o="iOS"===c.r||"Android"===c.r;switch(Object(R.a)(!o&&"authorizationStateWaitPhoneNumber"===e||o&&"authorizationStateWaitQrCode"===e,()=>{o?r():u()}),e){case"authorizationStateWaitCode":return P.a.createElement(Y,{page:"authCode",key:"authCode"},P.a.createElement(ge,null));case"authorizationStateWaitPassword":return P.a.createElement(Y,{page:"authPassword",key:"authPassword"},P.a.createElement(ye,null));case"authorizationStateWaitRegistration":return P.a.createElement(ve,null);case"authorizationStateWaitPhoneNumber":return P.a.createElement(Y,{page:"authPhoneNumber",key:"authPhoneNumber"},P.a.createElement(me,null));case"authorizationStateWaitQrCode":return P.a.createElement(Y,{page:"authQrCode",key:"authQrCode"},P.a.createElement(Ie,null));default:return o?P.a.createElement(Y,{page:"authPhoneNumber",key:"authPhoneNumber"},P.a.createElement(me,null)):P.a.createElement(Y,{page:"authQrCode",key:"authQrCode"},P.a.createElement(Ie,null))}}));var Ee=Object(P.h)(()=>{const e=Object(pe.a)(z.a.Main,"Main");return e?P.a.createElement(e,null):void 0}),Se=n.p+"app-inactive.bc7953c2dfebcabce2c43ca7dc778a89.png";n(102);var Ae=()=>P.a.createElement("div",{id:"AppInactive"},P.a.createElement("div",{className:"content"},P.a.createElement("img",{src:Se,alt:""}),P.a.createElement("h3",{className:"title"},"Such error, many tabs"),P.a.createElement("div",{className:"description"},"Telegram supports only one active tab with the app.",P.a.createElement("br",null),"Please reload this page to continue using this tab or close it."),P.a.createElement("div",{className:"actions"},P.a.createElement(re.a,{isText:!0,ripple:!0,onClick:()=>{window.location.reload()}},"Reload app"))));function Me(){return o.c.createElement(Y,{page:"main",key:"main"},o.c.createElement(Ee,null))}var ke=Object(o.h)(e=>Object(m.l)(e,["authState"]),(e,t)=>Object(m.l)(t,["disconnect"]))(({authState:e,disconnect:t})=>{const[n,r]=Object(B.a)(!1);if(Object(P.n)(()=>{Object(D.b)(),x=()=>{t(),document.title=`${u.pb}${u.L}`,r()}},[t,r]),n)return o.c.createElement(Ae,null);if(e)switch(e){case"authorizationStateWaitPhoneNumber":case"authorizationStateWaitCode":case"authorizationStateWaitPassword":case"authorizationStateWaitRegistration":case"authorizationStateWaitQrCode":return o.c.createElement(Ce,null);case"authorizationStateClosed":case"authorizationStateClosing":case"authorizationStateLoggingOut":case"authorizationStateReady":return Me()}return Object(g.c)(!0)?Me():o.c.createElement(Ce,null)});n(103);u.r&&console.log(">>> INIT"),Object(o.d)().init(),u.r&&console.log(">>> START INITIAL RENDER"),s.a.render(o.c.createElement(ke,null),document.getElementById("root")),u.r&&console.log(">>> FINISH INITIAL RENDER"),document.addEventListener("dblclick",()=>{console.log("GLOBAL STATE",Object(o.e)())})}]); +//# sourceMappingURL=main.4bb9f6f0899a58512452.js.map \ No newline at end of file diff --git a/dist/main.4bb9f6f0899a58512452.js.map b/dist/main.4bb9f6f0899a58512452.js.map new file mode 100644 index 00000000..a2d41227 --- /dev/null +++ b/dist/main.4bb9f6f0899a58512452.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/lib/teact/teact.ts","webpack:///./src/lib/teact/teactn.tsx","webpack:///./src/config.ts","webpack:///./src/util/iteratees.ts","webpack:///./src/modules/helpers/messages.ts","webpack:///./src/modules/helpers/messageMedia.ts","webpack:///./src/modules/helpers/localSearch.ts","webpack:///./src/api/gramjs/worker/provider.ts","webpack:///./src/util/environmentWebp.ts","webpack:///./src/util/environmentSystemTheme.ts","webpack:///./src/util/environment.ts","webpack:///./src/modules/selectors/users.ts","webpack:///./src/modules/selectors/settings.ts","webpack:///./src/modules/selectors/chats.ts","webpack:///./src/modules/selectors/symbols.ts","webpack:///./src/modules/selectors/messages.ts","webpack:///./src/modules/selectors/localSearch.ts","webpack:///./src/modules/selectors/management.ts","webpack:///./src/modules/selectors/ui.ts","webpack:///./src/modules/selectors/globalSearch.ts","webpack:///./src/modules/selectors/payments.ts","webpack:///./src/api/types/index.ts","webpack:///./src/util/buildClassName.ts","webpack:///./src/util/schedulers.ts","webpack:///./src/modules/reducers/chats.ts","webpack:///./src/modules/reducers/messages.ts","webpack:///./src/modules/reducers/symbols.ts","webpack:///./src/modules/reducers/users.ts","webpack:///./src/modules/reducers/globalSearch.ts","webpack:///./src/modules/reducers/localSearch.ts","webpack:///./src/modules/reducers/management.ts","webpack:///./src/modules/reducers/settings.ts","webpack:///./src/modules/reducers/twoFaSettings.ts","webpack:///./src/modules/reducers/payments.ts","webpack:///./src/util/cacheApi.ts","webpack:///./src/types/index.ts","webpack:///./src/util/langProvider.ts","webpack:///./src/util/callbacks.ts","webpack:///./src/util/moduleLoader.ts","webpack:///./src/util/files.ts","webpack:///./src/hooks/useLang.ts","webpack:///./node_modules/idb-keyval/dist/esm/index.js","webpack:///./src/util/sessions.ts","webpack:///./src/lib/twemojiRegex.js","webpack:///./src/components/ui/Loading.tsx","webpack:///./src/util/notifications.ts","webpack:///./src/components/ui/Button.tsx","webpack:///./src/components/common/helpers/renderText.tsx","webpack:///./src/util/countries.ts","webpack:///./src/util/phoneNumber.ts","webpack:///./src/hooks/useFlag.ts","webpack:///./src/hooks/useModuleLoader.ts","webpack:///./src/components/ui/Spinner.tsx","webpack:///./src/util/handleError.ts","webpack:///./src/util/arePropsShallowEqual.ts","webpack:///./src/hooks/usePrevious.ts","webpack:///./src/util/dateFormat.ts","webpack:///./src/hooks/useForceUpdate.ts","webpack:///./src/util/oggToWav.ts","webpack:///./src/util/mediaLoader.ts","webpack:///./src/components/ui/Link.tsx","webpack:///./src/util/generateIdFor.ts","webpack:///./src/modules/helpers/users.ts","webpack:///./src/modules/helpers/chats.ts","webpack:///./src/hooks/useHeavyAnimationCheck.ts","webpack:///./src/lib/teact/dom-events.ts","webpack:///./src/hooks/useHistoryBack.ts","webpack:///./src/hooks/useShowTransition.ts","webpack:///./src/util/trimText.ts","webpack:///./src/components/ui/MenuItem.tsx","webpack:///./src/components/ui/RippleEffect.tsx","webpack:///./src/util/webpToPng.ts","webpack:///./src/util/switchTheme.ts","webpack:///./src/components/ui/InputText.tsx","webpack:///./src/components/ui/Checkbox.tsx","webpack:///./src/util/captureEscKeyListener.ts","webpack:///./src/util/textFormat.ts","webpack:///./src/util/memo.ts","webpack:///./src/hooks/useOnChange.ts","webpack:///./src/util/searchWords.ts","webpack:///./src/util/windowSize.ts","webpack:///./src/components/ui/Menu.tsx","webpack:///./src/util/captureKeyboardListeners.ts","webpack:///./src/hooks/useEffectWithPrevDeps.ts","webpack:///./src/lib/punycode.js","webpack:///./src/components/common/SafeLink.tsx","webpack:///./src/components/common/helpers/documentInfo.ts","webpack:///./src/modules/helpers/payments.ts","webpack:///./src/util/animation.ts","webpack:///./src/components/ui/DropdownMenu.tsx","webpack:///./src/hooks/useKeyboardListNavigation.ts","webpack:///./src/components/common/helpers/parseEmojiOnlyString.ts","webpack:///./src/util/emoji.ts","webpack:///./src/lib/teact/teact-dom.ts","webpack:///./src/components/common/UserLink.tsx","webpack:///./src/components/common/MessageLink.tsx","webpack:///./src/components/common/ChatLink.tsx","webpack:///./src/components/common/helpers/renderActionMessageText.tsx","webpack:///./src/api/types/messages.ts","webpack:///./src/api/types/media.ts","webpack:///./src/components/middle/message/MentionLink.tsx","webpack:///./src/util/appBadge.ts","webpack:///./src/hooks/useVirtualBackdrop.ts","webpack:///./src/api/gramjs/worker/worker.ts","webpack:///./node_modules/opus-recorder/dist/decoderWorker.min.js","webpack:///./node_modules/opus-recorder/dist/waveWorker.min.js","webpack:///./src/lib/webp/webp_wasm.worker.js","webpack:///./src/modules/actions/ui/initial.ts","webpack:///./src/modules/actions/ui/settings.ts","webpack:///./src/modules/actions/api/initial.ts","webpack:///./src/modules/actions/api/settings.ts","webpack:///./src/modules/actions/apiUpdaters/initial.ts","webpack:///./src/serviceWorker.ts","webpack:///./src/util/setupServiceWorker.ts","webpack:///./src/global/initial.ts","webpack:///./src/global/cache.ts","webpack:///./src/global/index.ts","webpack:///./src/util/activeTabMonitor.ts","webpack:///./src/util/fonts.ts","webpack:///./src/assets/telegram-logo.svg","webpack:///./src/assets/monkey.svg","webpack:///./src/components/common/UiLoader.tsx","webpack:///./src/hooks/useLangString.ts","webpack:///./src/components/auth/helpers/getSuggestedLanguage.ts","webpack:///./src/components/auth/CountryCodeInput.tsx","webpack:///./src/components/auth/AuthPhoneNumber.tsx","webpack:///./src/components/auth/AuthCode.async.tsx","webpack:///./src/components/auth/AuthPassword.async.tsx","webpack:///./src/components/auth/AuthRegister.async.tsx","webpack:///./node_modules/qr-creator/dist/qr-creator.es6.min.js","webpack:///./src/components/auth/AuthQrCode.tsx","webpack:///./src/components/auth/Auth.tsx","webpack:///./src/components/main/Main.async.tsx","webpack:///./src/assets/app-inactive.png","webpack:///./src/components/main/AppInactive.tsx","webpack:///./src/App.tsx","webpack:///./src/index.tsx"],"names":["webpackJsonpCallback","data","moduleId","chunkId","chunkIds","moreModules","i","resolves","length","Object","prototype","hasOwnProperty","call","installedChunks","push","modules","parentJsonpFunction","shift","installedModules","installedCssChunks","2","__webpack_require__","exports","module","l","e","promises","Promise","resolve","reject","href","fullhref","p","existingLinkTags","document","getElementsByTagName","dataHref","tag","getAttribute","rel","existingStyleTags","linkTag","createElement","type","onload","onerror","event","request","target","src","err","Error","code","parentNode","removeChild","appendChild","then","installedChunkData","promise","onScriptComplete","script","charset","timeout","nc","setAttribute","jsonpScriptSrc","error","clearTimeout","chunk","errorType","realSrc","message","name","undefined","setTimeout","head","all","m","c","d","getter","o","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","oe","console","jsonpArray","window","oldJsonpFunction","slice","s","VirtualElementTypesEnum","Fragment","renderingInstance","isEmptyElement","$element","Empty","isTextElement","Text","isTagElement","Tag","isComponentElement","Component","isRealElement","source","props","children","flatten","parsedChildren","componentInstance","isMounted","hooks","state","cursor","byCursor","effects","memos","buildComponentElement","createComponentInstance","dropEmptyTail","map","buildChildElement","buildTagElement","isEmptyPlaceholder","child","String","DEBUG_components","renderComponent","newRenderedValue","DEBUG_startAt","DEBUG","componentName","renderCount","renderTimes","DEBUG_MORE","log","performance","now","renderTime","warn","Math","round","handleError","renderedValue","newChild","hasElementChanged","$old","$new","unmountTree","forEach","hook","current","cleanup","effect","dependencies","nextValue","setter","forceUpdate","onUpdate","helpGc","unmountComponent","removeAllDelegatedListeners","mountComponent","forceUpdateComponent","currentElement","getTarget","setTarget","useState","initial","newValue","prepareForFrame","throttleWithPrimaryRaf","prepareComponentForFrame","throttleWithRaf","DEBUG_contentComponentName","useLayoutEffectBase","schedulerFn","debugKey","exec","some","dependency","causedBy","reduce","res","prevValue","join","useEffect","fastRaf","useLayoutEffect","onTickEnd","useMemo","resolver","getUnequalProps","useCallback","newCallback","useRef","memo","areEqual","arePropsShallowEqual","propsRef","renderedRef","addEventListener","orderBy","values","React","currentGlobal","reducers","callbacks","container","containers","mapStateToProps","mapReducersToProps","ownProps","mappedProps","newMappedProps","setGlobal","actions","Number","isNaN","DEBUG_componentName","keys","areMappedPropsChanged","DEBUG_updates","updateTime","Map","runCallbacks","cb","runCallbacksThrottled","newGlobal","noThrottle","getGlobal","getDispatch","addReducer","reducer","payload","onDispatch","addCallback","removeCallback","index","indexOf","splice","withGlobal","TeactNContainer","id","generateIdFor","useForceUpdate","delete","set","Array","from","PAGE_TITLE","INACTIVE_MARKER","APP_NAME","process","APP_VERSION","IS_TEST","DEBUG_ALERT_MSG","SESSION_USER_KEY","LEGACY_SESSION_KEY","GLOBAL_STATE_CACHE_DISABLED","GLOBAL_STATE_CACHE_KEY","GLOBAL_STATE_CACHE_CHAT_LIST_LIMIT","GLOBAL_STATE_CACHE_USER_LIST_LIMIT","MEDIA_CACHE_DISABLED","MEDIA_CACHE_NAME","MEDIA_CACHE_NAME_AVATARS","MEDIA_PROGRESSIVE_CACHE_NAME","CUSTOM_BG_CACHE_NAME","LANG_CACHE_NAME","TRANSPARENT_PIXEL","isBigScreen","innerHeight","MIN_PASSWORD_LENGTH","MESSAGE_LIST_SENSITIVE_AREA","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","ALL_CHATS_PRELOAD_DISABLED","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","EDITABLE_INPUT_ID","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","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","Set","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","MEMOJI_STICKER_ID","BASE_EMOJI_KEYWORD_LANG","MENU_TRANSITION_DURATION","SLIDE_TRANSITION_DURATION","CONTENT_TYPES_FOR_QUICK_UPLOAD","RE_LINK_TEMPLATE","RE_MENTION_TEMPLATE","RE_TME_LINK","RE_TME_INVITE_LINK","SERVICE_NOTIFICATIONS_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","buildCollectionByKey","collection","byKey","member","mapValues","callback","newByKey","pick","result","pickTruthy","omit","stringKeys","filter","has","orderKey","sort","a","b","isArray","mode1","mode2","orderKey1","orderKey2","aValue1","bValue1","aValue2","bValue2","aValue","bValue","array","concat","unique","compact","Boolean","areSortedArraysEqual","array1","array2","every","item","areSortedArraysIntersecting","findIntersectionWithSet","split","chunkSize","cloneDeep","acc","findLast","predicate","RE_LINK","RegExp","getMessageKey","chatId","parseMessageKey","match","messageId","getMessageOriginalId","previousLocalId","getMessageSummaryText","lang","noEmoji","text","photo","video","audio","voice","sticker","contact","poll","invoice","content","truncatedText","substr","groupedId","isGif","emoji","trim","getMessageAudioCaption","fileName","summary","question","getMessageText","webPage","getMessageCustomShape","isRound","parseEmojiOnlyString","getMessageSingleEmoji","getFirstLinkInMessage","entities","link","find","entity","ApiMessageEntityTypes","TextUrl","url","Url","offset","substring","domain","isOwnMessage","isOutgoing","isReplyMessage","replyToMessageId","isForwardedMessage","forwardInfo","isActionMessage","action","isServiceNotificationMessage","isMessageLocal","isAnonymousOwnMessage","senderId","getSenderTitle","sender","getUserFullName","getChatTitle","getSendingState","sendingState","isHistoryClearMessage","title","performer","getMessageContent","hasMessageMedia","getMessagePhoto","getMessageVideo","getMessageDocument","getMessageSticker","getMessageContact","getMessagePoll","getMessageAction","getMessageAudio","getMessageVoice","getMessageRoundVideo","isMessageDocumentPhoto","mediaType","isMessageDocumentVideo","getMessageInvoice","getMessageWebPage","getMessageWebPagePhoto","getMessageWebPageVideo","getMessageMediaThumbDataUri","thumbnail","media","getMessageMediaThumbnail","dataUri","getMessageMediaHash","webPagePhoto","webPageVideo","messageVideo","messagePhoto","base","hasMessageLocalBlobUrl","getVideoOrAudioBaseHash","getDocumentHasPreview","IS_PROGRESSIVE_SUPPORTED","IS_SAFARI","size","mimeType","getMessageMediaFormat","fullVideo","isAnimated","ApiMediaFormat","Lottie","Progressive","IS_OPUS_SUPPORTED","BlobUrl","getMessageFileName","date","getMessageFileSize","blobUrl","previewBlobUrl","getChatMediaMessageIds","messages","listedIds","isFromSharedMedia","ids","getMessageContentIds","reverse","getPhotoFullDimensions","sizes","getPhotoInlineDimensions","getVideoDimensions","width","height","getMediaTransferState","progress","isDownloadNeeded","isUploading","isTransferring","transferProgress","messageIds","contentType","validator","matchLinkInMessageText","getMediaDuration","duration","buildChatThreadKey","threadId","worker","requestStates","requestStatesByCallback","initApi","initialArgs","Worker","update","requestState","response","callbackArgs","subscribeToWorker","makeRequest","args","callApi","fnName","cancelApiProgress","progressCallback","isCanceled","postMessage","assign","pop","catch","finally","isWebpSupportedCache","isWebpSupported","webp","Image","handleLoadOrError","hasWebp","systemThemeCache","matchMedia","matches","getSystemTheme","handleSystemThemeChange","mql","addListener","PLATFORM_ENV","userAgent","platform","navigator","os","test","getPlatform","IS_MAC_OS","IS_IOS","IS_ANDROID","IS_PWA","standalone","referrer","includes","IS_TOUCH_ENV","IS_SINGLE_COLUMN_LAYOUT","innerWidth","IS_TABLET_COLUMN_LAYOUT","IS_VOICE_RECORDING_SUPPORTED","mediaDevices","AudioContext","webkitAudioContext","IS_EMOJI_SUPPORTED","documentElement","style","IS_SERVICE_WORKER_SUPPORTED","Audio","canPlayType","IS_CANVAS_FILTER_SUPPORTED","getContext","LAYERS_ANIMATION_NAME","DPR","devicePixelRatio","MASK_IMAGE_DISABLED","selectUser","global","userId","users","byId","selectIsUserBlocked","user","fullInfo","isBlocked","selectNotifySettings","settings","selectNotifyExceptions","notifyExceptions","selectChat","chats","selectChatUser","chat","getPrivateChatUserId","selectIsChatWithSelf","currentUserId","selectIsChatWithBot","isUserBot","selectSupportChat","isSupport","selectChatOnlineCount","isChatPrivate","isChatChannel","members","onlineCount","isUserOnline","selectChatBot","selectIsChatBotNotStarted","bot","lastMessage","messageInfo","byChatId","threadsById","MAIN_THREAD_ID","selectAreActiveChatsLoaded","listIds","active","selectIsChatListed","targetList","list","selectChatListType","folderId","selectChatFolder","chatFolders","selectIsChatPinned","archived","orderedPinnedIds","chatFoldersById","pinnedChatIds","selectChatByUsername","username","usernameLowered","toLowerCase","selectCountNotMutedUnread","activeChatIds","unreadCount","selectIsChatMuted","selectCurrentStickerSearch","stickers","search","selectCurrentGifSearch","gifs","selectStickerSet","setsById","selectStickersForEmoji","stickerSets","stickersForEmoji","packs","selectAnimatedEmoji","animatedEmojis","cleanedEmoji","replace","selectCurrentMessageList","messageLists","selectCurrentChat","selectChatMessages","selectScheduledMessages","scheduledMessages","selectThreadParam","thread","selectListedIds","selectOutlyingIds","selectCurrentMessageIds","messageListType","selectViewportIds","selectPinnedIds","selectScheduledIds","selectScrollOffset","selectReplyingToId","selectEditingId","selectEditingScheduledId","selectDraft","selectNoWebPage","selectThreadInfo","selectFirstMessageId","selectReplyStack","selectThreadOriginChat","threadInfo","originChannelId","selectThreadTopMessageId","topMessageId","selectThreadByMessage","replyToTopMessageId","isMessageInCurrentMessageList","currentMessageList","selectIsViewportNewest","viewportIds","lastMessageId","selectChatMessage","chatMessages","selectScheduledMessage","selectEditingMessage","selectChatMessageByPollId","pollId","messageWithPoll","selectFocusedMessageId","focusedChatId","focusedMessage","selectIsMessageFocused","focusedId","selectOutgoingStatus","isScheduledList","lastReadOutboxMessageId","selectIsMessageUnread","selectSender","selectForwardedSender","isChannelPost","fromChatId","senderUserId","selectAllowedMessageActions","serverTimeOffset","isRestricted","isPrivate","isChatWithSelf","isBasicGroup","isChatBasicGroup","isSuperGroup","isChatSuperGroup","isChannel","isServiceNotification","isOwn","isAction","isMessageEditable","getHasAdminRight","Date","viaBotId","canReply","getCanPostInChat","hasPinPermission","isCreator","isUserRightBanned","canPin","canUnpin","pinnedMessageIds","canDelete","canReport","canDeleteForAll","canEdit","canForward","hasSticker","hasFavoriteSticker","favorite","selectIsStickerFavorite","canFaveSticker","canUnfaveSticker","canCopy","canCopyLink","canSelect","noOptions","ability","selectCanDeleteSelectedMessages","selectedMessageIds","selectedMessages","messageActions","selectCanReportSelectedMessages","selectUploadProgress","fileTransfer","fileUploads","byMessageLocalId","selectRealLastReadId","lastReadInboxMessageId","min","Infinity","selectFirstUnreadId","outlyingIds","lastReadId","isNotJoined","found","isFromScheduled","selectIsForwardModalOpen","forwardMessages","isModalShown","selectCommonBoxChatId","fromLastMessage","isCommonBoxChat","selectIsInSelectMode","selectIsMessageSelected","selectForwardedMessageIdsByGroupId","fromMessageId","selectMessageIdsByGroupId","selectIsDocumentGroupSelected","selectedIds","groupIds","selectSelectedMessagesCount","selectNewestMessageWithBotKeyboardButtons","keyboardButtons","replyHideMessageId","shouldHideKeyboardButtons","selectShouldAutoLoadMedia","shouldAutoDownloadMediaFromContacts","shouldAutoDownloadMediaInPrivateChats","shouldAutoDownloadMediaInGroups","shouldAutoDownloadMediaInChannels","isChatGroup","userOrChat","contactList","userIds","selectIsUserOrChatContact","selectShouldAutoPlayMedia","shouldAutoPlayVideos","shouldAutoPlayGifs","asGif","selectShouldLoopStickers","shouldLoopStickers","selectCurrentTextSearch","chatThreadKey","currentSearch","localTextSearch","byChatThreadKey","isActive","selectCurrentMediaSearchPeerId","localMediaSearch","currentProfileUserId","selectedId","selectCurrentMediaSearch","peerId","selectManagement","management","selectCurrentManagementType","selectIsMediaViewerOpen","mediaViewer","avatarOwnerId","selectRightColumnContentKey","isChatInfoShown","newChatMembersProgress","isAddingChatMembersShown","NewChatMembersProgress","Closed","isPollResults","pollResults","selectIsPollResultsOpen","isSearch","isManagement","currentManagement","selectCurrentManagement","isStickerSearch","query","isGifSearch","currentChatId","areActiveChatsLoaded","isUserInfo","isChatInfo","RightColumnContent","PollResults","Search","Management","StickerSearch","GifSearch","AddingMembers","UserInfo","ChatInfo","selectIsRightColumnShown","selectTheme","theme","shouldUseSystemTheme","selectCurrentGlobalSearchQuery","globalSearch","selectPaymentMessageId","payment","selectPaymentRequestId","formId","selectProviderPublishableKey","nativeParams","publishableKey","selectStripeCredentials","stripeCredentials","parts","debounce","fn","ms","shouldRunFirst","shouldRunLast","waitingTimeout","self","throttle","interval","isPending","_args","setInterval","clearInterval","throttleWith","fastPrimaryRaf","waiting","onIdle","requestIdleCallback","pause","rafPromise","fastRafCallbacks","fastRafPrimaryCallbacks","beforeUnloadCallbacks","isPrimary","requestAnimationFrame","currentCallbacks","currentPrimaryCallbacks","onBeforeUnload","isLast","unshift","replaceChatListIds","newIds","updateChatListIds","idsUpdate","replaceChats","newById","getUpdatedChat","chatUpdate","shouldOmitMinInfo","isMin","updatedChat","photos","updateChat","updateChats","updatedById","updatedChats","addChats","addedById","isAdded","addedChats","updateChatListType","listType","currentListIds","listTypeKey","currentFolderList","updateChatListSecondaryInfo","info","totalCountKey","totalCount","totalChatCount","isFullyLoaded","updateCurrentMessageList","shouldReplaceHistory","newMessageLists","last","replaceChatMessages","updateMessageStore","replaceThreadParam","paramName","threadUpdate","updateThread","addMessages","addedByChatId","messagesByChatId","addChatMessagesById","newId","updateChatMessage","messageUpdate","updatedMessage","updateScheduledMessage","replaceScheduledMessages","deleteChatMessages","deletedForwardedPosts","isLinkedChannelPost","pinnedIds","newMessageCount","messagesCount","canDeleteCurrentThread","currentThreadId","originalPost","deleteChatScheduledMessages","scheduledIds","updateListedIds","orderHistoryIds","updateOutlyingIds","addViewportId","safeReplaceViewportIds","newViewportIds","updateThreadInfo","newThreadInfo","updateThreadInfos","updates","hash","updateScheduledMessages","updateFocusedMessage","noHighlight","updateFocusDirection","direction","enterMessageSelectMode","toggleMessageSelection","childMessageIds","withShift","oldSelectedMessages","newMessageIds","newSelectedMessageIds","prevIndex","currentIndex","to","max","exitMessageSelectMode","updateStickerSets","category","sets","resultIds","updatedSets","stickerSet","existing","setIds","updateStickerSet","stickerSetId","currentStickerSet","updateGifSearch","isNew","results","nextOffset","currentResults","newResults","currentIds","gif","replaceAnimatedEmojis","updateStickersForEmoji","remoteStickers","allStickers","uniqueIds","forEmoji","rebuildStickersForEmoji","replaceUsers","getUpdatedUser","userUpdate","updatedUser","updateContactList","updatedUsers","contactUserIds","newContactUserIds","isContact","updateUser","updateUsers","addUsers","addedUsers","updateSelectedUserId","deleteUser","MEMO_EMPTY_ARRAY","updateUserSearch","searchStatePartial","userSearch","updateUserSearchFetchingStatus","newState","fetchingStatus","updateUserBlockedState","getComplexKey","updateGlobalSearch","updateGlobalSearchContent","currentContent","updateGlobalSearchResults","newFoundMessages","nextRate","resultsByType","newFoundMessagesById","foundIdsForType","foundIds","updateGlobalSearchFetchingStatus","prevFoundIds","newFoundIds","foundOrPrevFoundIds","nextOffsetId","replaceLocalTextSearch","searchParams","updateLocalTextSearch","replaceLocalTextSearchResults","updateLocalTextSearchResults","orderFoundIds","replaceLocalMediaSearch","updateLocalMediaSearchType","currentType","updateLocalMediaSearchResults","replaceLocalMediaSearchResults","updateManagementProgress","updateManagement","replaceSettings","newSettings","replaceThemeSettings","themes","addNotifyExceptions","notifyException","exceptionData","addNotifyException","updateNotifySettings","peerType","isSilent","shouldShowPreviews","hasPrivateChatsNotifications","hasPrivateChatsMessagePreview","hasGroupNotifications","hasGroupMessagePreview","hasBroadcastNotifications","hasBroadcastMessagePreview","addBlockedContact","contactId","blocked","removeBlockedContact","updateTwoFaSettings","twoFaSettings","updateShippingOptions","shippingOptions","setRequestInfoId","setPaymentStep","step","setInvoiceMessageInfo","description","photoUrl","invoiceContent","setStripeCardInfo","cardInfo","setPaymentForm","form","setReceipt","receipt","messageInvoice","clearPayment","closeInvoice","isPaymentModalOpen","cacheApi","caches","Type","async","fetch","cacheName","Request","cache","open","Blob","blob","headers","Json","json","save","cacheData","JSON","stringify","Response","put","clear","LoadMoreDirection","FocusDirection","SettingsScreens","LeftColumnContent","GlobalSearchContent","MediaViewerOrigin","ChatCreationProgress","ProfileEditProgress","ManagementProgress","ProfileState","PaymentStep","UPLOADING_WALLPAPER_SLUG","ManagementScreens","SUBSTITUTION_REGEX","PLURAL_OPTIONS","PLURAL_RULES","en","ar","ca","de","es","fa","fr","it","ko","nl","pl","pt_BR","ru","tr","uk","uz","langPack","fallbackLangPack","createCallbackManager","currentLangCode","getTranslation","format","cacheValue","cached","langString","processTranslation","importFallbackLangPack","getTranslationForLangString","langCode","translateString","remoteLangPack","remote","fetchRemoteString","setLanguage","withFallback","newLangPack","sourceLangPacks","fetchRemote","languages","langInfo","isRtl","rtl","default","template","amount","optionIndex","getPluralOption","translationSlices","initialValue","str","processTemplate","formatInteger","Bundles","LOAD_PROMISES","MEMORY_CACHE","loadModule","bundleName","moduleName","Auth","Main","Extra","handleBundleLoad","bundle","getModuleFromMemory","listeners","addLoadListener","listener","File","constructor","fileBits","options","rest","super","this","dataUriToBlob","arr","mime","bstr","atob","u8arr","Uint8Array","charCodeAt","blobToDataUri","reader","FileReader","readAsDataURL","blobToFile","lastModified","preloadImage","img","preloadVideo","volume","onloadedmetadata","createPosterForVideo","race","onseeked","videoWidth","videoHeight","canvas","drawImage","toDataURL","currentTime","fetchBlob","imgToCanvas","useOnChange","langProvider","promisifyRequest","oncomplete","onsuccess","onabort","defaultGetStoreFunc","defaultGetStore","dbName","storeName","indexedDB","onupgradeneeded","createObjectStore","dbp","txMode","db","transaction","objectStore","createStore","eachCursor","customStore","store","openCursor","continue","DC_IDS","hasStoredSession","withLegacy","localStorage","getItem","userAuthJson","userAuth","parse","dcID","storeSession","sessionData","mainDcId","hashes","setItem","dcId","clearStoredSession","removeItem","loadStoredSession","importLegacySession","sessionId","sessionJson","idb","clearLegacySessions","idbKeys","items","k","startsWith","vs16RegExp","zeroWidthJoiner","fromCharCode","removeVS16s","rawEmoji","color","className","withBackground","getDeviceToken","subscription","toJSON","endpoint","checkIfPushSupported","ServiceWorkerRegistration","Notification","permission","soundPlayed","playNotificationSound","notificationSoundVolume","add","once","play","requestPermission","unsubscribeFromPush","dispatch","deviceToken","unsubscribe","deleteDeviceToken","serviceWorkerRegistration","serviceWorker","ready","pushManager","getSubscription","areSettingsLoaded","subscribe","subscribedAt","checkIfShouldResubscribe","userVisibleOnly","setDeviceToken","DOMException","ABORT_ERR","showNewMessageNotification","isActiveChat","resultSettings","resultExceptions","loadNotificationSettings","isListed","hasFocus","checkIfShouldNotify","body","messageSender","messageAction","actionTargetMessage","targetUserIds","actionTargetUserIds","targetChatId","actionTargetChatId","actionTargetUsers","privateChatUserId","privateChatUser","selectShouldShowMessagePreview","actionOrigin","renderActionMessageText","asPlain","senderName","getMessageSenderName","getNotificationContent","icon","imageHash","getChatAvatarHash","mediaData","mediaLoader","getAvatar","controller","badge","toString","vibrate","notification","onclick","close","focusMessage","focus","onshow","notifyClientReady","Button","ref","onClick","onContextMenu","onMouseDown","onMouseEnter","onMouseLeave","onFocus","pill","fluid","isText","isLoading","ariaLabel","download","disabled","ripple","faded","tabIndex","elementRef","isClicked","setIsClicked","fullClassName","buildClassName","handleClick","handleMouseDown","preventDefault","dir","aria-label","RE_LETTER_OR_DIGIT","SIMPLE_MARKDOWN_REGEX","renderText","part","filters","params","textParts","divEl","innerText","innerHTML","escapeHtml","EMOJI_REGEX","lastIndex","replaceEmojis","addLineBreaks","highlight","lowerCaseText","queryPosition","nextSymbol","newParts","links","nextLink","endsWith","addLinks","replaceSimpleMarkdown","emojis","emojiResult","nativeToUnfified","alt","line","trimmedLine","trimLeft","indentLength","repeat","entityResult","formatsCache","defaultPhoneNumberFormat","parsed","flag","phoneFormat","formatValue","phoneNumberFormat","phoneNumberGroups","count","getPhoneNumberFormat","getCountryById","countryList","getCountryFromPhoneNumber","input","phoneNumber","possibleCountries","country","formatPhoneNumber","_","p1","p2","p3","p4","p5","separator","output","formatPhoneNumberWithCode","numberWithPlus","setValue","noLoad","autoUpdate","Spinner","handleErrorEvent","ErrorEvent","reason","alert","currentProps","newProps","currentKeys","currentKeysLength","prop","usePrevious","next","shouldSkipUndefined","WEEKDAYS_FULL","MONTHS_FULL","MONTHS_FULL_LOWERCASE","month","getDayStart","datetime","setHours","getDayStartAt","getTime","toYearMonth","timestamp","getFullYear","getMonth","toIsoString","getDate","formatTime","getHours","padStart","getMinutes","formatPastTimeShort","today","weekAgo","setDate","getDay","withYear","formatDate","formatFullDate","formatMonthAndYear","isShort","formatHumanDate","noWeekdays","lowerFirst","upperFirst","yesterday","weekAhead","weekDay","day","monthIndex","formatMediaDateTime","formatMediaDuration","hours","floor","minutes","seconds","string","formatVoiceRecordDuration","durationInMs","milliseconds","formatDateToString","locale","toLocaleString","year","isValidDate","MAX_MONTH_IN_YEAR","parseDateString","matchStringDate","matchEuropeStringDate","matchNumberDate","dateParts","findIndex","timestampPlusDay","MILISECONDS_IN_DAY","toUpperCase","setTrigger","trigger","oggToWav","opusData","arrayBuffer","typedArray","decoderWorker","DecoderWorker","wavWorker","WavWorker","onmessage","command","buffers","buffer","page","terminate","wavBitDepth","wavSampleRate","decoderSampleRate","outputBufferSampleRate","pages","asCacheApiType","DataUri","Stream","memoryCache","fetchPromises","mediaFormat","onProgress","progressiveUrl","getProgressive","mediaPng","webpToPng","prepared","prepareMedia","mediaSource","MediaSource","streamUrl","URL","createObjectURL","isOpen","sourceBuffer","addSourceBuffer","endOfStream","appendBuffer","revokeObjectURL","fetchFromCacheOrRemote","getFromMemory","cancelProgress","fullSize","Link","random","USER_COLOR_KEYS","getUserFirstOrLastName","firstName","lastName","isDeletedUser","getUserStatus","status","wasOnline","wasOnlineDate","diff","sortUserIds","usersById","priorityIds","expires","getUserColorKey","peer","abs","FOREVER_BANNED_DATE","getChatTypeString","isSelf","getChatDescription","about","getChatLink","inviteLink","owner","avatarHash","isChatSummaryOnly","isChatAdmin","adminRights","currentUserBannedRights","defaultBannedRights","migratedTo","getAllowedAttachmentOptions","isChatWithBot","canAttachMedia","canAttachPolls","canSendStickers","canSendGifs","canAttachEmbedLinks","isAdmin","getMessageSendingRestrictionReason","sendMessages","untilDate","getChatSlowModeOptions","slowMode","getChatOrder","joinDate","draftDate","isChatArchived","notifySettings","isMuted","getCanDeleteChat","prepareFolderListIds","chatsById","folder","chatIdsCache","excludedChatIds","includedChatIds","excludeArchived","excludeMuted","unreadMentionsCount","hasUnreadMark","excludeRead","bots","contacts","nonContacts","groups","channels","filterChatFolder","prepareChatList","folderType","chatFilter","listedChats","listIdsSet","pinnedChats","otherChats","getFolderUnreadDialogs","unreadDialogsCount","total","hasActiveDialogs","getFolderDescriptionText","emoticon","getFolderChatsCount","isChat","chatOrUser","sortChatIds","chatIds","shouldPrioritizeVerified","priority","isVerified","ANIMATION_START_EVENT","ANIMATION_END_EVENT","isAnimating","dispatchHeavyAnimationEvent","dispatchEvent","Event","handleAnimationStart","handleAnimationEnd","removeEventListener","NON_BUBBLEABLE_EVENTS","delegationRegistry","delegatedEventsByElement","documentEventCounters","element","propName","handler","asCapture","eventName","resolveEventName","canUseEventDelegation","handleEvent","resolveDelegationRegistryForName","newSet","resolveDelegatedEventsForElement","addDelegatedListener","removeDelegatedListener","tagName","realEventName","eventNames","realEvent","events","furtherCallsPrevented","stopPropagation","Proxy","Reflect","historyState","nextStateIndexToReplace","isHistoryAltered","isDisabled","isEdge","currentIndexes","disableHistoryBack","handleTouchStart","x","touches","pageX","handleTouchEnd","useHistoryBack","onBack","onForward","currentState","shouldReplaceNext","indexRef","isForward","prevIsActive","isClosed","indexHashRef","prevHashes","isHashChangedFromEvent","handleChange","isForceClose","prev","history","pushState","delta","realDelta","indexLast","go","replaceState","back","handlePopState","currIndex","disableHistoryAnimations","hasChanged","forceClose","onCloseTransitionEnd","noOpenTransition","noCloseTransition","setIsClosed","closeTimeoutRef","hasOpenClassName","setHasOpenClassName","shouldHaveOpenClassName","isClosing","shouldRender","transitionClassNames","trimText","MenuItem","destructive","useLang","handleKeyDown","keyCode","data-char","location","origin","role","onKeyDown","ripples","setRipples","cleanUpDebounced","button","currentTarget","position","getBoundingClientRect","rippleSize","offsetWidth","clientX","y","clientY","EMPTY_IMAGE_DATA_URI","initWebpWorker","wasmReady","requests","getDecodePromise","ImageData","putImageData","toBlob","createPng","webpToPngBase64","pngBlob","WebpWorker","handleLibWebpMessage","isInitialized","HEX_COLOR_REGEX","lerp","start","end","interpolationRatio","colors","themeColors","hexToRgb","hex","parseInt","g","applyColorAnimationStep","startIndex","endIndex","propertyColors","setProperty","withAnimation","isDarkTheme","shouldAnimate","startAt","themeColorTag","querySelector","classList","remove","animateSingle","transition","label","success","readOnly","placeholder","autoComplete","inputMode","maxLength","onChange","onInput","onKeyPress","onBlur","onPaste","labelText","htmlFor","subLabel","checked","blocking","onCheck","captureEscKeyListener","captureKeyboardListener","onEsc","formatFixedNumber","number","toFixed","formatIntegerCompact","views","getFirstLetters","phrase","word","prevDeps","RE_NOT_LETTER","searchWords","haystack","needle","haystackWords","needleWord","haystackWord","IS_LANDSCAPE","isLandscape","initialHeight","windowSize","updateSizes","isRefreshDisabled","handleResize","reload","vh","getIsKeyboardVisible","disableRefresh","enableRefresh","Menu","containerRef","positionX","positionY","autoClose","footer","noCloseOnBackdrop","onCloseAnimationEnd","onClose","shouldSkipTransition","menuRef","backdropContainerRef","useShowTransition","useEffectWithPrevDeps","prevIsOpen","useKeyboardListNavigation","useVirtualBackdrop","bubbleClassName","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","utf16","len","RangeError","adapt","numpoints","firsttime","decode","preserveCase","case_flags","input_length","out","bias","basic","j","ic","oldi","w","digit","lastIndexOf","cp","toUnicode","domain_array","ensureProtocol","getDomain","decodedHref","decodeURI","convertPunycode","toggleSafeLinkModal","openTelegramLink","isNotSafe","ctrlKey","altKey","shiftKey","metaKey","classNames","getFileSizeString","bytes","ONE_GIGABYTE","ONE_MEGABYTE","getDocumentExtension","getFileExtension","getColorFromExtension","extension","STRIPE_ERRORS","missing_payment_information","field","fieldError","invalid_number","exp_year","exp_month","invalid_expiry_year","invalid_expiry_month","cvc","invalid_cvc","getStripeError","param","SHIPPING_ERRORS","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","getShippingErrors","dialogs","cur","hasErrorKey","currentInstance","tick","instance","isCancelled","animate","DropdownMenu","forceOpen","onOpen","dropdownRef","setIsOpen","menu","focusedElement","activeElement","elementChildren","onTrigger","onSelectWithEnter","itemSelector","noCaptureFocus","focusedIndex","setFocusedIndex","querySelectorAll","newIndex","RE_EMOJI_ONLY","twemojiRegex","DETECT_UP_TO","emojiCount","EXCLUDE_EMOJIS","unifiedToNative","unified","codePoints","fromCodePoint","pairs","uncompressEmoji","emojiData","categories","emojiRaw","names","native","image","FILTERED_ATTRIBUTES","HTML_ATTRIBUTES","MAPPED_ATTRIBUTES","autoPlay","headsByElement","renderWithVirtual","parentEl","$current","$parent","skipComponentUpdate","forceIndex","fragment","moveDirection","updateComponent","setupComponentUpdateListener","initComponent","node","createNode","childNodes","insertBefore","replaceChild","areComponents","nextSibling","newKeys","removeAttribute","addAttribute","oldValue","updateAttribute","updateAttributes","currentEl","teactFastList","$newChild","currentRemainingIndex","remainingByKey","$currentChild","newChildKey","order","teactOrderKey","fragmentQueue","fragmentIndex","newChildren","currentPreservedIndex","currentChildInfo","flushFragmentQueue","shouldMoveNode","isMovingDown","renderFastListChildren","createDocumentFragment","renderChildren","$firstChild","createTextNode","$child","$fragmentChild","cssText","render","headId","$head","openUserInfo","handleMessageClick","openChat","targetUsers","targetMessage","translationValues","textOptions","maxTextLength","unprocessed","processed","processPlaceholder","isEmbedded","renderChatContent","renderUserContent","renderOriginContent","showQuotes","messageText","renderMessageContent","renderProductContent","renderMigratedContent","replaceValue","placeholderPosition","MESSAGE_DELETED","openChatByUsername","updateAppBadge","setAppBadge","contains","currentThemeMatch","currentTheme","nextTheme","animationLevel","switchTheme","subscribeToSystemThemeChange","messageTextSize","language","uiReadyState","authPhoneNumber","authRememberMe","authError","shouldSkipHistoryAnimations","apiUpdate","authIsLoading","password","file","authIsLoadingQrCode","reset","langCachePrefix","langCacheVersion","init","connectionState","authNearestCountry","buildInputPrivacyRules","visibility","allowedIds","deniedIds","rules","collectUsers","accessHash","collectChats","allowedUsers","allowedChats","blockedUsers","blockedChats","bio","profileEdit","InProgress","currentUser","Complete","Idle","isUsernameAvailable","loadedWallpapers","wallpapers","slug","wallpaper","firstWallpaper","withLocalMedia","blockedIds","activeSessions","session","isCurrent","hasPushNotifications","hasWebNotifications","hasContactJoinedNotifications","phoneNumberSettings","lastSeenSettings","profilePhotoSettings","forwardsSettings","chatInviteSettings","privacy","lastSeen","profilePhoto","forwards","chatInvite","privacyKey","allowUserIds","allowChatIds","blockUserIds","blockChatIds","isAllowList","contactsIds","isSensitiveEnabled","onUpdateApiReady","wasAuthReady","authState","authorizationState","isLoggingOut","authIsCodeViaApp","isCodeViaApp","authHint","hint","authQrCode","qrCode","lastSyncTime","onUpdateAuthorizationState","onUpdateAuthorizationError","sync","signOut","onUpdateConnectionState","isEmpty","saveSession","onUpdateSession","onUpdateServerTimeOffset","sessionUserAuth","updateSessionUserId","onUpdateCurrentUser","showDialog","ServiceWorkerNoSupportError","setPrototypeOf","scriptUrl","handleWorkerMessage","register","INITIAL_STATE","isLeftColumnShown","activeChatFolder","recentEmojis","added","recent","greeting","featured","emojiKeywords","saved","inlineBots","byUsername","topPeers","topInlineBots","audioPlayer","notifications","messageSendKeyCombo","shouldSuggestStickers","light","isBlurred","patternColor","dark","shouldShowContextMenuHint","updateCacheThrottled","updateCache","unsubscribeFromBeforeUnload","isCaching","isHeavyAnimating","loadCache","initialState","setupCaching","time","timeEnd","readCache","clearCaching","reducedGlobal","reduceShowChatInfo","reduceUsers","reduceChats","reduceMessages","recentlyFoundChatIds","reduceSettings","reduceChatFolders","idsToSave","cid","chatIdsToSave","mainThread","tabKey","SITE_FONTS","preloadFonts","font","fonts","load","preloadAvatars","preloadTasks","main","telegramLogoPath","authCode","monkeyPath","authPassword","background","backgroundColor","hasCustomBackground","hasCustomBackgroundColor","isRightColumnShown","setIsUiReady","isReady","markReady","useFlag","shouldRenderMask","safePreload","translation","setTranslation","getSuggestedLanguage","suggestedLanguage","MENU_HIDING_DURATION","inputRef","setFilter","filteredList","setFilteredList","updateFilter","filterValue","getFilteredList","countryId","firstElementChild","dataset","handleInput","handleInputKeyDown","handleTrigger","select","formEl","getElementById","scrollTo","top","scrollHeight","behavior","inputValue","data-country-id","isPreloadInitiated","setAuthPhoneNumber","setAuthRememberMe","loadNearestCountry","clearAuthError","goToAuthQrCode","setSettingOption","continueText","useLangString","setCountry","setPhoneNumber","isTouched","setIsTouched","lastSelection","setLastSelection","markIsLoading","unmarkIsLoading","fullNumber","canSubmit","parseFullNumber","newFullNumber","suggestedCountry","selectedCountry","handleLangChange","setSelectionRange","isJustPastedRef","handlePaste","handlePhoneNumberChange","selectionStart","selectionEnd","shouldFixSafariAutoComplete","handleKeepSessionChange","isAuthReady","onSubmit","InputText","Checkbox","Loading","AuthCode","useModuleLoader","AuthPassword","AuthRegister","G","H","B","QrCreator","h","u","J","level","version","O","C","f","lineTo","arcTo","moveTo","z","v","N","K","P","fillStyle","fillRect","left","beginPath","q","D","E","R","I","F","fill","colorStops","createLinearGradient","apply","createRadialGradient","addColorStop","A","minVersion","maxVersion","ecLevel","radius","quiet","HTMLCanvasElement","clearRect","write","S","multiply","L","M","Q","returnToAuthPhoneNumber","qrCodeRef","token","isMobile","AuthQrCode","AppInactive","appInactivePath","renderMain","disconnect","isInactive","markInactive","TeactDOM"],"mappings":"aACE,SAASA,EAAqBC,GAQ7B,IAPA,IAMIC,EAAUC,EANVC,EAAWH,EAAK,GAChBI,EAAcJ,EAAK,GAKAK,EAAI,EAAGC,EAAW,GACpCD,EAAIF,EAASI,OAAQF,IACzBH,EAAUC,EAASE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AZAzmE,YAAU,KACRwsD,clBRFjiD,EkBS6B,KACzBmkE,IACAj5E,SAAS6b,MAAS,GAAEtN,OAAaC,MAEjC2qE,MAED,CAACF,EAAYE,IAIZD,EACF,OAAO,kBAAC,GAAD,MAGT,GAAIlO,EACF,OAAQA,GACN,IAAK,oCACL,IAAK,6BACL,IAAK,iCACL,IAAK,qCACL,IAAK,+BACH,OAAO,kBAAC,GAAD,MACT,IAAK,2BACL,IAAK,4BACL,IAAK,+BACL,IAAK,0BACH,OAAOgO,KAIb,OAAOpoC,aAAiB,GAAQooC,KAAe,kBAAC,GAAD,Q,OC1C7CjyE,KAEF7C,QAAQkD,IAAI,YAGdgG,cAAcq6D,OAEV1gE,KAEF7C,QAAQkD,IAAI,4BAGdgyE,IAAS9U,OACP,kBAAC,GAAD,MACAtkE,SAASuyE,eAAe,SAGtBxrE,KAEF7C,QAAQkD,IAAI,6BAGdpH,SAASsL,iBAAiB,WAAY,KAEpCpH,QAAQkD,IAAI,eAAgB+F","file":"main.4bb9f6f0899a58512452.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tfunction webpackJsonpCallback(data) {\n \t\tvar chunkIds = data[0];\n \t\tvar moreModules = data[1];\n\n\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [];\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n\n \t};\n\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// object to store loaded CSS chunks\n \tvar installedCssChunks = {\n \t\t2: 0\n \t}\n\n \t// object to store loaded and loading chunks\n \t// undefined = chunk not loaded, null = chunk preloaded/prefetched\n \t// Promise = chunk loading, 0 = chunk loaded\n \tvar installedChunks = {\n \t\t2: 0\n \t};\n\n\n\n \t// script path function\n \tfunction jsonpScriptSrc(chunkId) {\n \t\treturn __webpack_require__.p + \"\" + chunkId + \".\" + {\"0\":\"1ebe794c83bdc1b89fad\",\"1\":\"f0613d67642ddda53eb4\",\"3\":\"33a9836ed01b17d89349\",\"4\":\"2c2e12ad0cb73321f1fb\",\"5\":\"d0ce99af4355757862b4\",\"6\":\"e8fcdb09b85352a9a211\",\"7\":\"ecaa83b230dae24ab898\",\"8\":\"01887ffd7dd613984e15\",\"9\":\"9c6978c373870fd3320a\",\"10\":\"081974f38a996f9d205f\"}[chunkId] + \".js\"\n \t}\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n \t// This file contains only the entry chunk.\n \t// The chunk loading function for additional chunks\n \t__webpack_require__.e = function requireEnsure(chunkId) {\n \t\tvar promises = [];\n\n\n \t\t// mini-css-extract-plugin CSS loading\n \t\tvar cssChunks = {\"0\":1,\"3\":1,\"4\":1,\"5\":1,\"6\":1};\n \t\tif(installedCssChunks[chunkId]) promises.push(installedCssChunks[chunkId]);\n \t\telse if(installedCssChunks[chunkId] !== 0 && cssChunks[chunkId]) {\n \t\t\tpromises.push(installedCssChunks[chunkId] = new Promise(function(resolve, reject) {\n \t\t\t\tvar href = \"\" + ({}[chunkId]||chunkId) + \".\" + {\"0\":\"1ebe794c83bdc1b89fad\",\"1\":\"f0613d67642ddda53eb4\",\"3\":\"33a9836ed01b17d89349\",\"4\":\"2c2e12ad0cb73321f1fb\",\"5\":\"d0ce99af4355757862b4\",\"6\":\"e8fcdb09b85352a9a211\",\"7\":\"ecaa83b230dae24ab898\",\"8\":\"01887ffd7dd613984e15\",\"9\":\"9c6978c373870fd3320a\",\"10\":\"081974f38a996f9d205f\"}[chunkId] + \".css\";\n \t\t\t\tvar fullhref = __webpack_require__.p + href;\n \t\t\t\tvar existingLinkTags = document.getElementsByTagName(\"link\");\n \t\t\t\tfor(var i = 0; i < existingLinkTags.length; i++) {\n \t\t\t\t\tvar tag = existingLinkTags[i];\n \t\t\t\t\tvar dataHref = tag.getAttribute(\"data-href\") || tag.getAttribute(\"href\");\n \t\t\t\t\tif(tag.rel === \"stylesheet\" && (dataHref === href || dataHref === fullhref)) return resolve();\n \t\t\t\t}\n \t\t\t\tvar existingStyleTags = document.getElementsByTagName(\"style\");\n \t\t\t\tfor(var i = 0; i < existingStyleTags.length; i++) {\n \t\t\t\t\tvar tag = existingStyleTags[i];\n \t\t\t\t\tvar dataHref = tag.getAttribute(\"data-href\");\n \t\t\t\t\tif(dataHref === href || dataHref === fullhref) return resolve();\n \t\t\t\t}\n \t\t\t\tvar linkTag = document.createElement(\"link\");\n \t\t\t\tlinkTag.rel = \"stylesheet\";\n \t\t\t\tlinkTag.type = \"text/css\";\n \t\t\t\tlinkTag.onload = resolve;\n \t\t\t\tlinkTag.onerror = function(event) {\n \t\t\t\t\tvar request = event && event.target && event.target.src || fullhref;\n \t\t\t\t\tvar err = new Error(\"Loading CSS chunk \" + chunkId + \" failed.\\n(\" + request + \")\");\n \t\t\t\t\terr.code = \"CSS_CHUNK_LOAD_FAILED\";\n \t\t\t\t\terr.request = request;\n \t\t\t\t\tdelete installedCssChunks[chunkId]\n \t\t\t\t\tlinkTag.parentNode.removeChild(linkTag)\n \t\t\t\t\treject(err);\n \t\t\t\t};\n \t\t\t\tlinkTag.href = fullhref;\n\n \t\t\t\tvar head = document.getElementsByTagName(\"head\")[0];\n \t\t\t\thead.appendChild(linkTag);\n \t\t\t}).then(function() {\n \t\t\t\tinstalledCssChunks[chunkId] = 0;\n \t\t\t}));\n \t\t}\n\n \t\t// JSONP chunk loading for javascript\n\n \t\tvar installedChunkData = installedChunks[chunkId];\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\t// setup Promise in chunk cache\n \t\t\t\tvar promise = new Promise(function(resolve, reject) {\n \t\t\t\t\tinstalledChunkData = installedChunks[chunkId] = [resolve, reject];\n \t\t\t\t});\n \t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n \t\t\t\t// start chunk loading\n \t\t\t\tvar script = document.createElement('script');\n \t\t\t\tvar onScriptComplete;\n\n \t\t\t\tscript.charset = 'utf-8';\n \t\t\t\tscript.timeout = 120;\n \t\t\t\tif (__webpack_require__.nc) {\n \t\t\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n \t\t\t\t}\n \t\t\t\tscript.src = jsonpScriptSrc(chunkId);\n\n \t\t\t\t// create error before stack unwound to get useful stacktrace later\n \t\t\t\tvar error = new Error();\n \t\t\t\tonScriptComplete = function (event) {\n \t\t\t\t\t// avoid mem leaks in IE.\n \t\t\t\t\tscript.onerror = script.onload = null;\n \t\t\t\t\tclearTimeout(timeout);\n \t\t\t\t\tvar chunk = installedChunks[chunkId];\n \t\t\t\t\tif(chunk !== 0) {\n \t\t\t\t\t\tif(chunk) {\n \t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n \t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n \t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n \t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n \t\t\t\t\t\t\terror.type = errorType;\n \t\t\t\t\t\t\terror.request = realSrc;\n \t\t\t\t\t\t\tchunk[1](error);\n \t\t\t\t\t\t}\n \t\t\t\t\t\tinstalledChunks[chunkId] = undefined;\n \t\t\t\t\t}\n \t\t\t\t};\n \t\t\t\tvar timeout = setTimeout(function(){\n \t\t\t\t\tonScriptComplete({ type: 'timeout', target: script });\n \t\t\t\t}, 120000);\n \t\t\t\tscript.onerror = script.onload = onScriptComplete;\n \t\t\t\tdocument.head.appendChild(script);\n \t\t\t}\n \t\t}\n \t\treturn Promise.all(promises);\n \t};\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// on error function for async loading\n \t__webpack_require__.oe = function(err) { console.error(err); throw err; };\n\n \tvar jsonpArray = window[\"webpackJsonp\"] = window[\"webpackJsonp\"] || [];\n \tvar oldJsonpFunction = jsonpArray.push.bind(jsonpArray);\n \tjsonpArray.push = webpackJsonpCallback;\n \tjsonpArray = jsonpArray.slice();\n \tfor(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]);\n \tvar parentJsonpFunction = oldJsonpFunction;\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 104);\n","import { DEBUG, DEBUG_MORE } from '../../config';\nimport {\n fastRaf, onTickEnd, throttleWithPrimaryRaf, throttleWithRaf,\n} from '../../util/schedulers';\nimport { flatten, orderBy } from '../../util/iteratees';\nimport arePropsShallowEqual, { 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;\nexport type FC_withDebug =\n FC\n & {\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?: 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\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\nconst DEBUG_components: AnyLiteral = {};\n\ndocument.addEventListener('dblclick', () => {\n // eslint-disable-next-line no-console\n console.log('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 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 (componentName !== 'TeactMemoWrapper' && componentName !== 'TeactNContainer') {\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 renderTime = performance.now() - DEBUG_startAt!;\n const componentName = componentInstance.name;\n if (renderTime > 7) {\n // eslint-disable-next-line no-console\n console.warn(`[Teact] Slow component render: ${componentName}, ${Math.round(renderTime)} ms`);\n }\n DEBUG_components[componentName].renderTimes.push(renderTime);\n DEBUG_components[componentName].renderCount++;\n }\n } catch (err) {\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 (!isRealElement($element)) {\n return;\n }\n\n if (isComponentElement($element)) {\n unmountComponent($element.componentInstance);\n } else if ($element.target) {\n removeAllDelegatedListeners($element.target as HTMLElement);\n // Trying to help GC\n // eslint-disable-next-line no-null/no-null\n $element.target = null as any;\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 componentInstance.hooks.memos.byCursor.forEach((hook) => {\n // eslint-disable-next-line no-null/no-null\n hook.current = null;\n });\n\n componentInstance.hooks.effects.byCursor.forEach(({ cleanup }) => {\n if (typeof cleanup === 'function') {\n try {\n cleanup();\n } catch (err) {\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 /* eslint-disable no-null/no-null */\n\n componentInstance.hooks.effects.byCursor.forEach((hook) => {\n hook.cleanup = null as any;\n hook.effect = null as any;\n hook.dependencies = null as any;\n });\n\n componentInstance.hooks.state.byCursor.forEach((hook) => {\n hook.value = null as any;\n hook.nextValue = null as any;\n hook.setter = null as any;\n });\n\n componentInstance.hooks.memos.byCursor.forEach((hook) => {\n hook.dependencies = null as any;\n });\n\n componentInstance.hooks = null as any;\n componentInstance.$element = null as any;\n componentInstance.renderedValue = null as any;\n componentInstance.Component = null as any;\n componentInstance.props = null as any;\n componentInstance.forceUpdate = null as any;\n componentInstance.onUpdate = null as any;\n\n /* eslint-enable no-null/no-null */\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(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 effect: () => Function | void,\n dependencies?: any[],\n debugKey?: string,\n) {\n const { cursor, byCursor } = renderingInstance.hooks.effects;\n const componentInstance = renderingInstance;\n\n const exec = () => {\n if (!componentInstance.isMounted) {\n return;\n }\n\n const { cleanup } = byCursor[cursor];\n if (typeof cleanup === 'function') {\n try {\n cleanup();\n } catch (err) {\n handleError(err);\n }\n }\n\n byCursor[cursor].cleanup = effect() as Function;\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(\n '[Teact]',\n debugKey,\n 'Effect caused by dependencies.',\n causedBy.join(', '),\n );\n }\n\n schedulerFn(exec);\n }\n } else {\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?: any[], debugKey?: string) {\n return useLayoutEffectBase(fastRaf, effect, dependencies, debugKey);\n}\n\nexport function useLayoutEffect(effect: () => Function | void, dependencies?: any[], debugKey?: string) {\n return useLayoutEffectBase(onTickEnd, 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[]): F {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n return useMemo(() => newCallback, dependencies);\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, areEqual = arePropsShallowEqual, debugKey?: string) {\n return function TeactMemoWrapper(props: Props) {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const propsRef = useRef(props);\n const renderedRef = useRef();\n\n if (!renderedRef.current || (propsRef.current && !areEqual(propsRef.current, props))) {\n if (DEBUG && debugKey) {\n // eslint-disable-next-line no-console\n console.log(\n `[Teact.memo] ${Component.name} (${debugKey}): Update is caused by:`,\n getUnequalProps(propsRef.current!, props).join(', '),\n );\n }\n\n propsRef.current = props;\n renderedRef.current = createElement(Component, props) as VirtualElementComponent;\n }\n\n return renderedRef.current;\n } as T;\n}\n\n// We need to keep it here for JSX.\nexport default {\n createElement,\n Fragment,\n};\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 { throttleWithRaf } from '../../util/schedulers';\nimport arePropsShallowEqual, { getUnequalProps } from '../../util/arePropsShallowEqual';\nimport { orderBy } from '../../util/iteratees';\nimport { GlobalState, GlobalActions, ActionTypes } from '../../global/types';\nimport { handleError } from '../../util/handleError';\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 | null);\ntype MapActionsToProps = ((setGlobal: Function, actions: GlobalActions) => Partial | null);\n\nlet currentGlobal = {} as GlobalState;\n\nconst reducers: Record = {};\nconst callbacks: Function[] = [updateContainers];\nconst actions = {} as GlobalActions;\nconst containers = new Map;\n mapReducersToProps: MapActionsToProps;\n ownProps: Props;\n mappedProps?: Props;\n forceUpdate: Function;\n areMappedPropsChanged: boolean;\n DEBUG_updates: number;\n DEBUG_componentName: string;\n}>();\n\nfunction runCallbacks() {\n callbacks.forEach((cb) => cb(currentGlobal));\n}\n\nconst runCallbacksThrottled = throttleWithRaf(runCallbacks);\n\n// `noThrottle = true` is used as a workaround for iOS gesture history navigation\nexport function setGlobal(newGlobal?: GlobalState, noThrottle = false) {\n if (typeof newGlobal === 'object' && newGlobal !== currentGlobal) {\n currentGlobal = newGlobal;\n if (!noThrottle) {\n runCallbacksThrottled();\n } else {\n runCallbacks();\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, noThrottle?: boolean) {\n if (reducers[name]) {\n reducers[name].forEach((reducer) => {\n const newGlobal = reducer(currentGlobal, actions, payload);\n if (newGlobal) {\n setGlobal(newGlobal, noThrottle);\n }\n });\n }\n}\n\nfunction updateContainers() {\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, mapReducersToProps, ownProps, mappedProps, forceUpdate,\n } = container;\n\n let newMappedProps;\n\n try {\n newMappedProps = {\n ...mapStateToProps(currentGlobal, ownProps),\n ...mapReducersToProps(setGlobal, actions),\n };\n } catch (err) {\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, noThrottle = false) => {\n onDispatch(name, payload, noThrottle);\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 mapReducersToProps: MapActionsToProps = () => ({}),\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 mapReducersToProps,\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 = {\n ...mapStateToProps(currentGlobal, props),\n ...mapReducersToProps(setGlobal, actions),\n };\n } catch (err) {\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.log(\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","export const PAGE_TITLE = 'Telegram';\nexport const INACTIVE_MARKER = ' [Inactive]';\n\nexport const APP_NAME = process.env.APP_NAME || 'Telegram WebZ';\nexport const APP_VERSION = process.env.APP_VERSION || 'dev';\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 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_CHAT_LIST_LIMIT = 30;\nexport const GLOBAL_STATE_CACHE_USER_LIST_LIMIT = 5000;\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-v5';\nexport const ASSET_CACHE_NAME = 'tt-assets';\nexport const TRANSPARENT_PIXEL = 'data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==';\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_SENSITIVE_AREA = 750;\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;\n\nexport const TOP_CHAT_MESSAGES_PRELOAD_LIMIT = 20;\nexport const ALL_CHATS_PRELOAD_DISABLED = false;\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\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;\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 = 80;\nexport const STICKER_SIZE_INLINE_BOT_RESULT = 100;\nexport const RECENT_STICKERS_LIMIT = 20;\nexport const MEMOJI_STICKER_ID = 'MEMOJI_STICKER';\n\nexport const BASE_EMOJI_KEYWORD_LANG = 'en';\n\nexport const MENU_TRANSITION_DURATION = 200;\nexport const SLIDE_TRANSITION_DURATION = 450;\n\nexport const CONTENT_TYPES_FOR_QUICK_UPLOAD = new Set([\n 'image/png', 'image/gif', 'image/jpeg', 'video/mp4', 'video/avi', 'video/quicktime',\n]);\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_TME_LINK = /^(?:https?:\\/\\/)?(?:t\\.me\\/)([\\d\\w_]+)(?:\\/([\\d]+))?(?:\\/([\\d]+))?$/gm;\nexport const RE_TME_INVITE_LINK = /^(?:https?:\\/\\/)?(?:t\\.me\\/joinchat\\/)([\\d\\w_-]+)?$/gm;\n\n// MTProto constants\nexport const SERVICE_NOTIFICATIONS_USER_ID = 777000;\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","type CollectionByKey = Record;\n\ntype OrderDirection = 'asc' | '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 orderKey: (keyof T) | OrderCallback | ((keyof T) | OrderCallback)[],\n mode: OrderDirection | [OrderDirection, OrderDirection] = 'asc',\n): T[] {\n return collection.sort((a, b) => {\n if (Array.isArray(orderKey)) {\n const [mode1, mode2] = Array.isArray(mode) ? mode : [mode, mode];\n const [orderKey1, orderKey2] = orderKey;\n\n let aValue1;\n let bValue1;\n\n if (typeof orderKey1 === 'function') {\n aValue1 = orderKey1(a) || 0;\n bValue1 = orderKey1(b) || 0;\n } else if (typeof orderKey1 === 'string') {\n aValue1 = a[orderKey1] || 0;\n bValue1 = b[orderKey1] || 0;\n }\n\n if (aValue1 !== bValue1) {\n return mode1 === 'asc' ? aValue1 - bValue1 : bValue1 - aValue1;\n } else {\n let aValue2;\n let bValue2;\n\n if (typeof orderKey2 === 'function') {\n aValue2 = orderKey2(a) || 0;\n bValue2 = orderKey2(b) || 0;\n } else if (typeof orderKey2 === 'string') {\n aValue2 = a[orderKey2] || 0;\n bValue2 = b[orderKey2] || 0;\n }\n\n return mode2 === 'asc' ? aValue2 - bValue2 : bValue2 - aValue2;\n }\n }\n\n let aValue;\n let bValue;\n\n if (typeof orderKey === 'function') {\n aValue = orderKey(a) || 0;\n bValue = orderKey(b) || 0;\n } else if (typeof orderKey === 'string') {\n aValue = a[orderKey] || 0;\n bValue = b[orderKey] || 0;\n }\n\n return mode === 'asc' ? aValue - bValue : bValue - aValue;\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: any[]) {\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\n/**\n * Returns the index of the last element in the array where predicate is true, and -1 otherwise.\n *\n * @param array The source array to search in\n * @param predicate find calls predicate once for each element of the array, in descending\n * order, until it finds one where predicate returns true. If such an element is found,\n * findLastIndex immediately returns that element index. Otherwise, findLastIndex returns -1.\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 {\n ApiChat, ApiMessage, ApiMessageEntityTypes, ApiUser,\n} from '../../api/types';\nimport { LangFn } from '../../hooks/useLang';\n\nimport { LOCAL_MESSAGE_ID_BASE, SERVICE_NOTIFICATIONS_USER_ID, RE_LINK_TEMPLATE } from '../../config';\nimport parseEmojiOnlyString from '../../components/common/helpers/parseEmojiOnlyString';\nimport { getUserFullName } from './users';\nimport { getChatTitle } from './chats';\n\nconst CONTENT_NOT_SUPPORTED = 'The message is not supported on this version of Telegram';\nconst RE_LINK = new RegExp(RE_LINK_TEMPLATE, 'i');\nconst TRUNCATED_SUMMARY_LENGTH = 80;\n\nexport function getMessageKey(message: ApiMessage) {\n const { chatId, id } = message;\n\n return `msg${chatId}-${id}`;\n}\n\nexport function parseMessageKey(key: string) {\n const match = key.match(/^msg(-?\\d+)-(\\d+)/)!;\n\n return { chatId: Number(match[1]), messageId: Number(match[2]) };\n}\n\nexport function getMessageOriginalId(message: ApiMessage) {\n return message.previousLocalId || message.id;\n}\n\nexport function getMessageSummaryText(lang: LangFn, message: ApiMessage, noEmoji = false) {\n const {\n text, photo, video, audio, voice, document, sticker, contact, poll, invoice,\n } = message.content;\n\n const truncatedText = text && text.text.substr(0, TRUNCATED_SUMMARY_LENGTH);\n\n if (message.groupedId) {\n return `${noEmoji ? '' : '🖼 '}${truncatedText || lang('lng_in_dlg_album')}`;\n }\n\n if (photo) {\n return `${noEmoji ? '' : '🖼 '}${truncatedText || lang('AttachPhoto')}`;\n }\n\n if (video) {\n return `${noEmoji ? '' : '📹 '}${truncatedText || lang(video.isGif ? 'AttachGif' : 'AttachVideo')}`;\n }\n\n if (sticker) {\n return `${sticker.emoji || ''} ${lang('AttachSticker')}`.trim();\n }\n\n if (audio) {\n return `${noEmoji ? '' : '🎧 '}${getMessageAudioCaption(message) || lang('AttachMusic')}`;\n }\n\n if (voice) {\n return `${noEmoji ? '' : '🎤 '}${truncatedText || lang('AttachAudio')}`;\n }\n\n if (document) {\n return `${noEmoji ? '' : '📎 '}${truncatedText || document.fileName}`;\n }\n\n if (contact) {\n return lang('AttachContact');\n }\n\n if (poll) {\n return `${noEmoji ? '' : '📊 '}${poll.summary.question}`;\n }\n\n if (invoice) {\n return 'Invoice';\n }\n\n if (text) {\n return truncatedText;\n }\n\n return CONTENT_NOT_SUPPORTED;\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 && 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 && 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 !!message.content.action;\n}\n\nexport function isServiceNotificationMessage(message: ApiMessage) {\n return message.chatId === SERVICE_NOTIFICATIONS_USER_ID && isMessageLocal(message);\n}\n\nexport function isAnonymousOwnMessage(message: ApiMessage) {\n return Boolean(message.senderId) && message.senderId! < 0 && isOwnMessage(message);\n}\n\nexport function getSenderTitle(lang: LangFn, sender: ApiUser | ApiChat) {\n return sender.id > 0 ? 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 getMessageAudioCaption(message: ApiMessage) {\n const { audio, text } = message.content;\n\n return (audio && [audio.title, audio.performer].filter(Boolean).join(' — ')) || (text && 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\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 && 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 const webPage = getMessageWebPage(message);\n return webPage ? webPage.photo : undefined;\n}\n\nexport function getMessageWebPageDocument(message: ApiMessage) {\n const webPage = getMessageWebPage(message);\n return webPage ? webPage.document : undefined;\n}\n\nexport function getMessageWebPageVideo(message: ApiMessage): ApiVideo | undefined {\n const webPage = getMessageWebPage(message);\n if (!webPage) return undefined;\n return webPage.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 const thumbnail = getMessageMediaThumbnail(message);\n\n return thumbnail ? thumbnail.dataUri : undefined;\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 base = getMessageKey(message);\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 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 default:\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 default:\n return base;\n }\n }\n\n if (audio) {\n switch (target) {\n case 'micro':\n case 'pictogram':\n return undefined;\n case 'download':\n return `${base}?download`;\n default:\n return getVideoOrAudioBaseHash(audio, base);\n }\n }\n\n if (voice) {\n switch (target) {\n case 'micro':\n case 'pictogram':\n return undefined;\n default:\n return base;\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 getMessageMediaFormat(\n message: ApiMessage, target: Target,\n): Exclude;\nexport function getMessageMediaFormat(message: ApiMessage, target: Target, canBeLottie: true): ApiMediaFormat;\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.isAnimated) {\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 && photo.blobUrl) || (video && video.blobUrl) || (document && document.previewBlobUrl);\n}\n\nexport function getChatMediaMessageIds(\n messages: Record, listedIds: number[], isFromSharedMedia = false,\n) {\n const ids = getMessageContentIds(messages, listedIds, isFromSharedMedia ? 'media' : 'inlineMedia');\n\n return isFromSharedMedia ? ids.reverse() : ids;\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, isDownloadNeeded = false) {\n const isUploading = isMessageLocal(message);\n const isTransferring = isUploading || isDownloadNeeded;\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 '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: number, threadId: number) {\n return `${chatId}_${threadId}`;\n}\n","import Worker from 'worker-loader!./worker';\n\nimport { ApiInitialArgs, ApiOnProgress, OnApiUpdate } from '../../types';\nimport { Methods, MethodArgs, MethodResponse } from '../methods/types';\nimport { WorkerMessageEvent, ThenArg, OriginRequest } from './types';\n\nimport { DEBUG } from '../../../config';\nimport generateIdFor from '../../../util/generateIdFor';\n\ntype RequestStates = {\n messageId: string;\n resolve: Function;\n reject: Function;\n callback?: AnyToVoidFunction;\n};\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();\n subscribeToWorker(onUpdate);\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 return makeRequest({\n type: 'callMethod',\n name: fnName,\n args,\n }) 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 const requestState = requestStates.get(data.messageId);\n if (requestState && requestState.callback) {\n requestState.callback(...data.callbackArgs);\n }\n } else if (data.type === 'unhandledError') {\n throw data.error;\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 (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 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","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 && window.matchMedia && 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} 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 = window.matchMedia('(display-mode: standalone)').matches\n|| (window.navigator as any).standalone\n|| document.referrer.includes('android-app://');\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 = (navigator.mediaDevices && 'getUserMedia' in navigator.mediaDevices && (\n window.AudioContext || (window as any).webkitAudioContext\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 LAYERS_ANIMATION_NAME = IS_ANDROID ? 'slide-fade' : IS_IOS ? 'slide-layers' : 'push-slide';\n\nexport const DPR = window.devicePixelRatio || 1;\n\nexport const MASK_IMAGE_DISABLED = true;\n","import { GlobalState } from '../../global/types';\nimport { ApiChat, ApiUser } from '../../api/types';\n\nexport function selectUser(global: GlobalState, userId: number): ApiUser | undefined {\n return global.users.byId[userId];\n}\n\nexport function selectIsUserBlocked(global: GlobalState, userId: number) {\n const user = selectUser(global, userId);\n\n return user && user.fullInfo && 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 { 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 { ApiChat, MAIN_THREAD_ID } from '../../api/types';\nimport { GlobalState } from '../../global/types';\n\nimport {\n getPrivateChatUserId, isChatChannel, isChatPrivate, isHistoryClearMessage, isUserBot, isUserOnline, selectIsChatMuted,\n} from '../helpers';\nimport { selectUser } from './users';\nimport { ALL_FOLDER_ID, ARCHIVED_FOLDER_ID, MEMBERS_LOAD_SLICE } from '../../config';\nimport { selectNotifyExceptions, selectNotifySettings } from './settings';\n\nexport function selectChat(global: GlobalState, chatId: number): 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: number) {\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 (isChatPrivate(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 (global.users.byId[userId] && isUserOnline(global.users.byId[userId]) && userId !== global.currentUserId) {\n return onlineCount + 1;\n }\n\n return onlineCount;\n }, 0);\n}\n\nexport function selectChatBot(global: GlobalState, chatId: number) {\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: number) {\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: number, 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: number): '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: number, folderId = ALL_FOLDER_ID): boolean {\n const { active, archived } = global.chats.orderedPinnedIds;\n\n if (folderId === ALL_FOLDER_ID) {\n return !!active && active.includes(chatId);\n }\n\n if (folderId === ARCHIVED_FOLDER_ID) {\n return !!archived && archived.includes(chatId);\n }\n\n const { byId: chatFoldersById } = global.chatFolders;\n\n const { pinnedChatIds } = chatFoldersById[folderId] || {};\n return !!pinnedChatIds && 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 selectCountNotMutedUnread(global: GlobalState) {\n const activeChatIds = global.chats.listIds.active;\n if (!activeChatIds) {\n return 0;\n }\n\n const chats = global.chats.byId;\n\n return activeChatIds.reduce((acc, chatId) => {\n const chat = chats[chatId];\n\n if (\n chat\n && chat.unreadCount\n && !selectIsChatMuted(chat, selectNotifySettings(global), selectNotifyExceptions(global))\n ) {\n return acc + chat.unreadCount;\n }\n\n return acc;\n }, 0);\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 selectStickersForEmoji(global: GlobalState, emoji: string) {\n const stickerSets = Object.values(global.stickers.setsById);\n let stickersForEmoji: ApiSticker[] = [];\n stickerSets.forEach(({ packs }) => {\n if (!packs) {\n return;\n }\n const stickers = packs[emoji];\n if (stickers) {\n stickersForEmoji = stickersForEmoji.concat(stickers);\n }\n });\n return stickersForEmoji;\n}\n\nexport function selectAnimatedEmoji(global: GlobalState, emoji: string) {\n const { animatedEmojis } = global;\n if (!animatedEmojis || !animatedEmojis.stickers) {\n return undefined;\n }\n\n // Some emojis (❤️ for example) with a service symbol 'VARIATION SELECTOR-16' are not recognized as animated\n const cleanedEmoji = emoji.replace('\\ufe0f', '');\n\n return animatedEmojis.stickers.find((sticker) => sticker.emoji === emoji || sticker.emoji === cleanedEmoji);\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 } from '../../config';\nimport {\n selectChat, selectIsChatWithBot, selectIsChatWithSelf,\n} from './chats';\nimport { selectIsUserOrChatContact, selectUser } from './users';\nimport {\n getSendingState,\n isChatChannel,\n isMessageLocal,\n isChatPrivate,\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} from '../helpers';\nimport { findLast } from '../../util/iteratees';\nimport { selectIsStickerFavorite } from './symbols';\n\nconst MESSAGE_EDIT_ALLOWED_TIME_MS = 172800000; // 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: number) {\n const messages = global.messages.byChatId[chatId];\n\n return messages ? messages.byId : undefined;\n}\n\nexport function selectScheduledMessages(global: GlobalState, chatId: number) {\n const messages = global.scheduledMessages.byChatId[chatId];\n\n return messages ? messages.byId : undefined;\n}\n\nexport function selectThreadParam(\n global: GlobalState,\n chatId: number,\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: number, threadId: number) {\n return selectThreadParam(global, chatId, threadId, 'listedIds');\n}\n\nexport function selectOutlyingIds(global: GlobalState, chatId: number, threadId: number) {\n return selectThreadParam(global, chatId, threadId, 'outlyingIds');\n}\n\nexport function selectCurrentMessageIds(\n global: GlobalState, chatId: number, 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: number, threadId: number) {\n return selectThreadParam(global, chatId, threadId, 'viewportIds');\n}\n\nexport function selectPinnedIds(global: GlobalState, chatId: number) {\n return selectThreadParam(global, chatId, MAIN_THREAD_ID, 'pinnedIds');\n}\n\nexport function selectScheduledIds(global: GlobalState, chatId: number) {\n return selectThreadParam(global, chatId, MAIN_THREAD_ID, 'scheduledIds');\n}\n\nexport function selectScrollOffset(global: GlobalState, chatId: number, threadId: number) {\n return selectThreadParam(global, chatId, threadId, 'scrollOffset');\n}\n\nexport function selectReplyingToId(global: GlobalState, chatId: number, threadId: number) {\n return selectThreadParam(global, chatId, threadId, 'replyingToId');\n}\n\nexport function selectEditingId(global: GlobalState, chatId: number, threadId: number) {\n return selectThreadParam(global, chatId, threadId, 'editingId');\n}\n\nexport function selectEditingScheduledId(global: GlobalState, chatId: number) {\n return selectThreadParam(global, chatId, MAIN_THREAD_ID, 'editingScheduledId');\n}\n\nexport function selectDraft(global: GlobalState, chatId: number, threadId: number) {\n return selectThreadParam(global, chatId, threadId, 'draft');\n}\n\nexport function selectNoWebPage(global: GlobalState, chatId: number, threadId: number) {\n return selectThreadParam(global, chatId, threadId, 'noWebPage');\n}\n\nexport function selectThreadInfo(global: GlobalState, chatId: number, threadId: number) {\n return selectThreadParam(global, chatId, threadId, 'threadInfo');\n}\n\nexport function selectFirstMessageId(global: GlobalState, chatId: number, threadId: number) {\n return selectThreadParam(global, chatId, threadId, 'firstMessageId');\n}\n\nexport function selectReplyStack(global: GlobalState, chatId: number, threadId: number) {\n return selectThreadParam(global, chatId, threadId, 'replyStack');\n}\n\nexport function selectThreadOriginChat(global: GlobalState, chatId: number, 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: number, 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: number, 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: number, 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: number, 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: number, messageId: number) {\n const chatMessages = selectChatMessages(global, chatId);\n\n return chatMessages ? chatMessages[messageId] : undefined;\n}\n\nexport function selectScheduledMessage(global: GlobalState, chatId: number, messageId: number) {\n const chatMessages = selectScheduledMessages(global, chatId);\n\n return chatMessages ? chatMessages[messageId] : undefined;\n}\n\nexport function selectEditingMessage(\n global: GlobalState, chatId: number, 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: number) {\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 senderId > 0 ? 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);\n }\n\n return undefined;\n}\n\nexport function selectAllowedMessageActions(global: GlobalState, message: ApiMessage, threadId: number) {\n const { serverTimeOffset } = global;\n const chat = selectChat(global, message.chatId);\n if (!chat || chat.isRestricted) {\n return {};\n }\n\n const isPrivate = isChatPrivate(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 isServiceNotification = isServiceNotificationMessage(message);\n\n const isOwn = isOwnMessage(message);\n const isAction = isActionMessage(message);\n const { content } = message;\n const canEditMessagesIndefinitely = isChatWithSelf\n || (isSuperGroup && getHasAdminRight(chat, 'pinMessages'))\n || (isChannel && getHasAdminRight(chat, 'editMessages'));\n const isMessageEditable = (\n (canEditMessagesIndefinitely\n || Date.now() + serverTimeOffset * 1000 - message.date * 1000 < MESSAGE_EDIT_ALLOWED_TIME_MS)\n && !(\n content.sticker || content.contact || content.poll || content.action || content.audio\n || (content.video && content.video.isRound)\n )\n && !isForwardedMessage(message)\n && !message.viaBotId\n );\n\n const canReply = getCanPostInChat(chat, threadId) && !isServiceNotification;\n\n const hasPinPermission = isPrivate || (\n chat.isCreator\n || (!isChannel && !isUserRightBanned(chat, 'pinMessages'))\n || getHasAdminRight(chat, 'pinMessages')\n );\n\n let canPin = !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 = isPrivate\n || isOwn\n || isBasicGroup\n || chat.isCreator\n || getHasAdminRight(chat, 'deleteMessages');\n\n const canReport = !isPrivate && !isOwn;\n\n const canDeleteForAll = canDelete && !isServiceNotification && (\n (isPrivate && !isChatWithSelf)\n || (isBasicGroup && (\n isOwn || getHasAdminRight(chat, 'deleteMessages') || chat.isCreator\n ))\n );\n\n const canEdit = !isAction && isMessageEditable && (\n isOwn\n || (isChannel && (chat.isCreator || getHasAdminRight(chat, 'editMessages')))\n );\n\n const canForward = !isAction && !isServiceNotification;\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 const noOptions = [\n canReply,\n canEdit,\n canPin,\n canUnpin,\n canDelete,\n canDeleteForAll,\n canForward,\n canFaveSticker,\n canUnfaveSticker,\n canCopy,\n canCopyLink,\n canSelect,\n ].every((ability) => !ability);\n\n return {\n noOptions,\n canReply,\n canEdit,\n canPin,\n canUnpin,\n canDelete,\n canReport,\n canDeleteForAll,\n canForward,\n canFaveSticker,\n canUnfaveSticker,\n canCopy,\n canCopyLink,\n canSelect,\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 selectUploadProgress(global: GlobalState, message: ApiMessage) {\n const fileTransfer = global.fileUploads.byMessageLocalId[message.previousLocalId || message.id];\n\n return fileTransfer ? fileTransfer.progress : undefined;\n}\n\nexport function selectRealLastReadId(global: GlobalState, chatId: number, 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: number, 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 || 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 if (outlyingIds) {\n const found = !lastReadId ? outlyingIds[0] : outlyingIds.find((id) => {\n return id > lastReadId && byId[id] && (!byId[id].isOutgoing || byId[id].isFromScheduled);\n });\n if (found) {\n return found;\n }\n }\n\n if (listedIds) {\n const found = !lastReadId ? listedIds[0] : listedIds.find((id) => {\n return id > lastReadId && byId[id] && (!byId[id].isOutgoing || byId[id].isFromScheduled);\n });\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 Number(Object.keys(byChatId).find((chatId) => {\n const chat = selectChat(global, Number(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: number, 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: number, 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: number, 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: number,\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 selectShouldAutoLoadMedia(\n global: GlobalState, message: ApiMessage, chat: ApiChat, sender?: ApiChat | ApiUser,\n) {\n const {\n shouldAutoDownloadMediaFromContacts,\n shouldAutoDownloadMediaInPrivateChats,\n shouldAutoDownloadMediaInGroups,\n shouldAutoDownloadMediaInChannels,\n } = global.settings.byKey;\n\n return Boolean(\n (shouldAutoDownloadMediaInPrivateChats && isChatPrivate(chat.id))\n || (shouldAutoDownloadMediaInGroups && isChatGroup(chat))\n || (shouldAutoDownloadMediaInChannels && isChatChannel(chat))\n || (shouldAutoDownloadMediaFromContacts && sender && (\n sender.id === global.currentUserId\n || selectIsUserOrChatContact(global, sender)\n )),\n );\n}\n\nexport function selectShouldAutoPlayMedia(global: GlobalState, message: ApiMessage) {\n const video = getMessageVideo(message) || getMessageWebPageVideo(message);\n if (!video) {\n return undefined;\n }\n\n const {\n shouldAutoPlayVideos,\n shouldAutoPlayGifs,\n } = global.settings.byKey;\n\n const asGif = video.isGif || video.isRound;\n\n return (shouldAutoPlayVideos && !asGif) || (shouldAutoPlayGifs && asGif);\n}\n\nexport function selectShouldLoopStickers(global: GlobalState) {\n return global.settings.byKey.shouldLoopStickers;\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 selectCurrentMediaSearchPeerId(global: GlobalState) {\n const { byChatId } = global.localMediaSearch;\n const { chatId } = selectCurrentMessageList(global) || {};\n const currentProfileUserId = global.users.selectedId;\n\n return currentProfileUserId && byChatId[currentProfileUserId] ? currentProfileUserId : chatId;\n}\n\nexport function selectCurrentMediaSearch(global: GlobalState) {\n const peerId = selectCurrentMediaSearchPeerId(global);\n if (!peerId) {\n return undefined;\n }\n\n return global.localMediaSearch.byChatId[peerId];\n}\n","import { GlobalState } from '../../global/types';\n\nimport { selectCurrentMessageList } from './messages';\nimport { selectChat } from './chats';\nimport { isChatGroup, isChatPrivate } from '../helpers';\n\nexport function selectManagement(global: GlobalState, chatId: number) {\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 (isChatPrivate(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 { selectCurrentStickerSearch, selectCurrentGifSearch } from './symbols';\nimport { selectAreActiveChatsLoaded } from './chats';\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 const {\n users,\n isChatInfoShown,\n newChatMembersProgress,\n } = global;\n\n const isAddingChatMembersShown = newChatMembersProgress !== NewChatMembersProgress.Closed;\n const isPollResults = selectIsPollResultsOpen(global);\n const isSearch = Boolean(!IS_SINGLE_COLUMN_LAYOUT && selectCurrentTextSearch(global));\n const isManagement = selectCurrentManagement(global);\n const stickerSearch = selectCurrentStickerSearch(global);\n const isStickerSearch = stickerSearch.query !== undefined;\n const gifSearch = selectCurrentGifSearch(global);\n const isGifSearch = gifSearch.query !== undefined;\n const { chatId: currentChatId } = selectCurrentMessageList(global) || {};\n const currentProfileUserId = users.selectedId;\n const areActiveChatsLoaded = selectAreActiveChatsLoaded(global);\n const isUserInfo = Boolean(currentProfileUserId && areActiveChatsLoaded);\n const isChatShown = Boolean(currentChatId && areActiveChatsLoaded);\n const isChatInfo = isChatShown && isChatInfoShown;\n\n return isPollResults ? (\n RightColumnContent.PollResults\n ) : isSearch ? (\n RightColumnContent.Search\n ) : isManagement ? (\n RightColumnContent.Management\n ) : isStickerSearch ? (\n RightColumnContent.StickerSearch\n ) : isGifSearch ? (\n RightColumnContent.GifSearch\n ) : isAddingChatMembersShown ? (\n RightColumnContent.AddingMembers\n ) : isUserInfo ? (\n RightColumnContent.UserInfo\n ) : isChatInfo ? (\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","\nimport { GlobalState } from '../../global/types';\n\nexport function selectPaymentMessageId(global: GlobalState) {\n return global.payment.messageId;\n}\n\nexport function selectPaymentRequestId(global: GlobalState) {\n return global.payment.formId;\n}\n\nexport function selectProviderPublishableKey(global: GlobalState) {\n return global.payment.nativeParams ? global.payment.nativeParams.publishableKey : undefined;\n}\n\nexport function selectStripeCredentials(global: GlobalState) {\n return global.payment.stripeCredentials;\n}\n","export * from './users';\nexport * from './chats';\nexport * from './messages';\nexport * from './updates';\nexport * from './media';\nexport * from './payments';\nexport * from './settings';\nexport * from './bots';\nexport * from './misc';\n","type Parts = (string | false | undefined)[];\n\nexport default (...parts: Parts) => {\n return parts.filter(Boolean).join(' ');\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 // @ts-ignore\n fn(...args);\n }\n\n // eslint-disable-next-line no-restricted-globals\n waitingTimeout = self.setTimeout(() => {\n if (shouldRunLast) {\n // @ts-ignore\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 // @ts-ignore\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 // @ts-ignore\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(fastPrimaryRaf, 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 // @ts-ignore\n fn(...args);\n });\n }\n };\n}\n\nexport function onTickEnd(cb: NoneToVoidFunction) {\n Promise.resolve().then(cb);\n}\n\nexport function onIdle(cb: NoneToVoidFunction) {\n // eslint-disable-next-line no-restricted-globals\n if (self.requestIdleCallback) {\n // eslint-disable-next-line no-restricted-globals\n self.requestIdleCallback(cb);\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 fastPrimaryRaf(callback: NoneToVoidFunction) {\n fastRaf(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","import { GlobalState } from '../../global/types';\nimport { ApiChat, ApiPhoto } from '../../api/types';\n\nimport { ARCHIVED_FOLDER_ID } from '../../config';\nimport { omit } from '../../util/iteratees';\n\nexport function replaceChatListIds(\n global: GlobalState,\n type: 'active' | 'archived',\n newIds: number[] | 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: number[]): GlobalState {\n const { [type]: listIds } = global.chats.listIds;\n const newIds = listIds && 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\n// @optimization Don't spread/unspread global for each element, do it in a batch\nfunction getUpdatedChat(\n global: GlobalState, chatId: number, chatUpdate: Partial, photo?: ApiPhoto,\n): ApiChat {\n const { byId } = global.chats;\n const chat = byId[chatId];\n const shouldOmitMinInfo = chatUpdate.isMin && chat && !chat.isMin;\n const updatedChat = {\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 updatedChat;\n }\n\n return updatedChat;\n}\n\nexport function updateChat(\n global: GlobalState, chatId: number, chatUpdate: Partial, photo?: ApiPhoto,\n): GlobalState {\n const { byId } = global.chats;\n\n const updatedChat = getUpdatedChat(global, chatId, chatUpdate, photo);\n\n return replaceChats(global, {\n ...byId,\n [chatId]: updatedChat,\n });\n}\n\nexport function updateChats(global: GlobalState, updatedById: Record): GlobalState {\n const updatedChats = Object.keys(updatedById).map(Number).reduce>((acc, id) => {\n const updatedChat = getUpdatedChat(global, id, updatedById[id]);\n if (updatedChat) {\n acc[id] = updatedChat;\n }\n return acc;\n }, {});\n\n global = replaceChats(global, {\n ...global.chats.byId,\n ...updatedChats,\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, addedById: Record): GlobalState {\n const { byId } = global.chats;\n let isAdded = false;\n\n const addedChats = Object.keys(addedById).map(Number).reduce>((acc, id) => {\n if (!byId[id] || (byId[id].isMin && !addedById[id].isMin)) {\n const updatedChat = getUpdatedChat(global, id, addedById[id]);\n if (updatedChat) {\n acc[id] = updatedChat;\n\n if (!isAdded) {\n isAdded = true;\n }\n }\n }\n return acc;\n }, {});\n\n if (isAdded) {\n global = replaceChats(global, {\n ...global.chats.byId,\n ...addedChats,\n });\n }\n\n return global;\n}\n\nexport function updateChatListType(\n global: GlobalState,\n chatId: number,\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?: number[];\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","import {\n GlobalState, MessageList, MessageListType, Thread,\n} from '../../global/types';\nimport { ApiMessage, ApiThreadInfo, MAIN_THREAD_ID } from '../../api/types';\nimport { FocusDirection } from '../../types';\n\nimport { IS_TEST, MESSAGE_LIST_SLICE, MESSAGE_LIST_VIEWPORT_LIMIT } 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\nconst TMP_CHAT_ID = -1;\n\ntype MessageStoreSections = {\n byId: Record;\n threadsById: Record;\n};\n\nexport function updateCurrentMessageList(\n global: GlobalState,\n chatId: number | 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: number, newById: Record): GlobalState {\n return updateMessageStore(global, chatId, {\n byId: newById,\n });\n}\n\nfunction updateThread(\n global: GlobalState, chatId: number, threadId: number, threadUpdate: Partial,\n): GlobalState {\n const current = global.messages.byChatId[chatId];\n\n return updateMessageStore(global, chatId, {\n threadsById: {\n ...(current && current.threadsById),\n [threadId]: {\n ...(current && current.threadsById[threadId]),\n ...threadUpdate,\n },\n },\n });\n}\n\nfunction updateMessageStore(\n global: GlobalState, chatId: number, 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: number, 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).map(Number).forEach((chatId) => {\n global = addChatMessagesById(global, chatId, addedByChatId[chatId]);\n });\n\n return global;\n}\n\nexport function addChatMessagesById(\n global: GlobalState, chatId: number, 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: number, 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: number, 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 }, undefined);\n}\n\nexport function deleteChatMessages(\n global: GlobalState,\n chatId: number,\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 && 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 ? threadInfo.messagesCount : undefined;\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\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 && 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: number,\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, undefined);\n\n return global;\n}\n\nexport function updateListedIds(\n global: GlobalState,\n chatId: number,\n threadId: number,\n idsUpdate: number[],\n): GlobalState {\n const listedIds = selectListedIds(global, chatId, threadId);\n const newIds = listedIds && 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: number,\n threadId: number,\n idsUpdate: number[],\n): GlobalState {\n const outlyingIds = selectOutlyingIds(global, chatId, threadId);\n const newIds = outlyingIds && 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: number,\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: number,\n threadId: number,\n newViewportIds: number[],\n): GlobalState {\n const viewportIds = selectViewportIds(global, chatId, threadId) || [];\n\n return replaceThreadParam(\n global,\n chatId,\n threadId,\n 'viewportIds',\n areSortedArraysEqual(viewportIds, newViewportIds) ? viewportIds : newViewportIds,\n );\n}\n\nexport function updateThreadInfo(\n global: GlobalState, chatId: number, 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: number, 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: number, newById: Record, hash: number | undefined,\n): GlobalState {\n return updateScheduledMessages(global, chatId, {\n byId: newById,\n hash,\n });\n}\n\nfunction updateScheduledMessages(\n global: GlobalState, chatId: number, update: Partial<{ byId: Record; hash: number }>,\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?: number, messageId?: number, noHighlight = false,\n): GlobalState {\n return {\n ...global,\n focusedMessage: {\n ...global.focusedMessage,\n chatId,\n messageId,\n noHighlight,\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: number,\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: number,\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","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: number,\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\n return {\n ...global,\n stickers: {\n ...global.stickers,\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?: number,\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 } from '../../api/types';\n\nimport { omit } 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\n// @optimization Don't spread/unspread global for each element, do it in a batch\nfunction getUpdatedUser(global: GlobalState, userId: number, userUpdate: Partial): ApiUser {\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 user;\n }\n\n return updatedUser;\n}\n\nfunction updateContactList(global: GlobalState, updatedUsers: ApiUser[]): GlobalState {\n const { hash, userIds: contactUserIds } = global.contactList || {};\n\n if (!contactUserIds) return global;\n\n const newContactUserIds = updatedUsers\n .filter((user) => 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 hash: hash || 0,\n userIds: [\n ...newContactUserIds,\n ...contactUserIds,\n ],\n },\n };\n}\n\nexport function updateUser(global: GlobalState, userId: number, userUpdate: Partial): GlobalState {\n const { byId } = global.users;\n\n const updatedUser = getUpdatedUser(global, userId, userUpdate);\n\n global = updateContactList(global, [updatedUser]);\n\n return replaceUsers(global, {\n ...byId,\n [userId]: updatedUser,\n });\n}\n\n\nexport function updateUsers(global: GlobalState, updatedById: Record): GlobalState {\n const updatedUsers = Object.keys(updatedById).map(Number).reduce>((acc, id) => {\n const updatedUser = getUpdatedUser(global, id, updatedById[id]);\n if (updatedUser) {\n acc[id] = updatedUser;\n }\n return acc;\n }, {});\n\n global = updateContactList(global, Object.values(updatedUsers));\n\n global = replaceUsers(global, {\n ...global.users.byId,\n ...updatedUsers,\n });\n\n return global;\n}\n\n// @optimization Allows to avoid redundant updates which cause a lot of renders\nexport function addUsers(global: GlobalState, addedById: Record): GlobalState {\n const { byId } = global.users;\n let isAdded = false;\n\n const addedUsers = Object.keys(addedById).map(Number).reduce>((acc, id) => {\n if (!byId[id] || (byId[id].isMin && !addedById[id].isMin)) {\n const updatedUser = getUpdatedUser(global, id, addedById[id]);\n if (updatedUser) {\n acc[id] = updatedUser;\n\n if (!isAdded) {\n isAdded = true;\n }\n }\n }\n return acc;\n }, {});\n\n if (isAdded) {\n global = replaceUsers(global, {\n ...global.users.byId,\n ...addedUsers,\n });\n\n global = updateContactList(global, Object.values(addedUsers));\n }\n\n return global;\n}\n\nexport function updateSelectedUserId(global: GlobalState, selectedId?: number): GlobalState {\n if (global.users.selectedId === selectedId) {\n return global;\n }\n\n return {\n ...global,\n users: {\n ...global.users,\n selectedId,\n },\n };\n}\n\nexport function deleteUser(global: GlobalState, userId: number): GlobalState {\n const { byId } = global.users;\n const { hash, userIds } = global.contactList || {};\n delete byId[userId];\n\n global = {\n ...global,\n contactList: {\n hash: hash || 0,\n userIds: userIds ? userIds.filter((id) => id !== userId) : MEMO_EMPTY_ARRAY,\n },\n };\n\n return replaceUsers(global, byId);\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: number, 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","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 && resultsByType[type] ? resultsByType[type]!.foundIds : undefined;\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: number,\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: number,\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: number,\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 && 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: number,\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: number,\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: number,\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: number,\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 && 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) => a - b);\n}\n","import { GlobalState } from '../../global/types';\nimport { ManagementProgress } from '../../types';\n\ninterface ManagementState {\n isActive: boolean;\n isUsernameAvailable?: boolean;\n error?: string;\n}\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: number, 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: number, 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: number): 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: number): 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 formId: 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 description,\n photoUrl,\n } = message.content.invoice;\n return {\n ...global,\n payment: {\n ...global.payment,\n invoiceContent: {\n title,\n text,\n description,\n photoUrl,\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 setPaymentForm(global: GlobalState, form: ApiPaymentForm): GlobalState {\n return {\n ...global,\n payment: {\n ...global.payment,\n ...form,\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","// 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(cacheName: string, key: string, type: Type) {\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 switch (type) {\n case Type.Text:\n return await response.text();\n case Type.Blob: {\n const blob = await response.blob();\n\n // Safari does not return correct Content-Type header for webp images.\n if (key.substr(0, 7) === 'sticker') {\n return new Blob([blob], { type: 'image/webp' });\n }\n\n // iOS Safari fails to preserve `type` in cache\n if (!blob.type) {\n const contentType = response.headers.get('Content-Type');\n if (contentType) {\n return new Blob([blob], { type: contentType });\n }\n }\n\n return blob;\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","import {\n ApiBotInlineMediaResult, ApiBotInlineResult, ApiBotInlineSwitchPm,\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 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 shouldAutoDownloadMediaFromContacts: boolean;\n shouldAutoDownloadMediaInPrivateChats: boolean;\n shouldAutoDownloadMediaInGroups: boolean;\n shouldAutoDownloadMediaInChannels: boolean;\n shouldAutoPlayGifs: boolean;\n shouldAutoPlayVideos: boolean;\n shouldSuggestStickers: boolean;\n shouldLoopStickers: boolean;\n hasPassword?: boolean;\n languages?: ApiLanguage[];\n language: LangCode;\n isSensitiveEnabled?: boolean;\n canChangeSensitive?: boolean;\n}\n\nexport interface ApiPrivacySettings {\n visibility: PrivacyVisibility;\n allowUserIds: number[];\n allowChatIds: number[];\n blockUserIds: number[];\n blockChatIds: number[];\n}\n\nexport interface IInputPrivacyContact {\n id: number;\n accessHash?: string;\n}\n\nexport interface IInputPrivacyRules {\n visibility: PrivacyVisibility;\n allowedUsers?: IInputPrivacyContact[];\n allowedChats?: IInputPrivacyContact[];\n blockedUsers?: IInputPrivacyContact[];\n blockedChats?: IInputPrivacyContact[];\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 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}\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 UserInfo,\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 MiddleHeaderAvatar,\n Album,\n ScheduledAlbum,\n SearchResult,\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 enum NewChatMembersProgress {\n Closed,\n InProgress,\n Loading,\n}\n\nexport type ProfileTabType = 'members' | 'media' | 'documents' | 'links' | 'audio';\nexport type SharedMediaType = 'media' | 'documents' | 'links' | 'audio';\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}\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 GroupUserPermissionsCreate,\n GroupUserPermissions,\n ChatAdministrators,\n GroupRecentActions,\n ChatAdminRights,\n GroupMembers,\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: number;\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 { ApiLangPack, ApiLangString } from '../api/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';\nimport { getGlobal } from '../lib/teact/teactn';\n\ninterface LangFn {\n (key: string, value?: any, format?: 'i'): any;\n\n isRtl?: boolean;\n code?: string;\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;\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 && langPack[key]) || (fallbackLangPack && 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 = 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: string, 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 } = getGlobal().settings.byKey;\n const langInfo = languages ? languages.find((l) => l.langCode === langCode) : undefined;\n getTranslation.isRtl = Boolean(langInfo && langInfo.rtl);\n getTranslation.code = langCode;\n\n if (callback) {\n callback();\n }\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 && 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","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 return {\n runCallbacks,\n addCallback,\n removeCallback,\n };\n}\n","import { DEBUG } from '../config';\n\nexport enum Bundles {\n Auth,\n Main,\n Extra\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}\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\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 }\n\n (LOAD_PROMISES[bundleName] as Promise).then(handleBundleLoad);\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\nconst listeners: NoneToVoidFunction[] = [];\n\nexport function addLoadListener(listener: NoneToVoidFunction) {\n if (!listeners.includes(listener)) {\n listeners.push(listener);\n }\n}\n\nfunction handleBundleLoad() {\n listeners.forEach((listener) => {\n listener();\n });\n}\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 { ApiMediaFormat } from '../api/types';\n\nimport * as langProvider from '../util/langProvider';\nimport useForceUpdate from './useForceUpdate';\nimport useOnChange from './useOnChange';\n\nexport type LangFn = typeof langProvider.getTranslation;\n\nexport default (): LangFn => {\n const forceUpdate = useForceUpdate();\n\n useOnChange(() => {\n return langProvider.addCallback(forceUpdate);\n }, [forceUpdate]);\n\n return langProvider.getTranslation;\n};\n","function 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 request = indexedDB.open(dbName);\n request.onupgradeneeded = () => request.result.createObjectStore(storeName);\n const dbp = promisifyRequest(request);\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 * 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(customStore, callback) {\n return customStore('readonly', (store) => {\n // This would be store.getAllKeys(), but it isn't supported by Edge or Safari.\n // And openKeyCursor isn't supported by Safari.\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/**\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 const items = [];\n return eachCursor(customStore, (cursor) => items.push(cursor.key)).then(() => items);\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 const items = [];\n return eachCursor(customStore, (cursor) => items.push(cursor.value)).then(() => items);\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 const items = [];\n return eachCursor(customStore, (cursor) => items.push([cursor.key, cursor.value])).then(() => items);\n}\n\nexport { clear, createStore, del, entries, get, getMany, keys, promisifyRequest, set, setMany, update, values };\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?: number) {\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 Object.keys(hashes).map(Number).forEach((dcId) => {\n localStorage.setItem(`dc${dcId}_hash`, JSON.stringify(hashes[dcId]));\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: number };\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","// 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 React, { FC, memo } from '../../lib/teact/teact';\n\nimport Spinner from './Spinner';\n\nimport './Loading.scss';\n\ntype OwnProps = {\n color?: 'blue' | 'white' | 'black';\n};\n\nconst Loading: FC = ({ color = 'blue' }) => {\n return (\n

\n \n
\n );\n};\n\nexport default memo(Loading);\n","import { callApi } from '../api/gramjs';\nimport {\n ApiChat, ApiMediaFormat, ApiMessage, ApiUser,\n} from '../api/types';\nimport { renderActionMessageText } from '../components/common/helpers/renderActionMessageText';\nimport { DEBUG } from '../config';\nimport { getDispatch, getGlobal, setGlobal } from '../lib/teact/teactn';\nimport {\n getChatAvatarHash,\n getChatTitle,\n getMessageAction,\n getMessageSenderName,\n getMessageSummaryText,\n getPrivateChatUserId,\n isActionMessage,\n isChatChannel,\n selectIsChatMuted, selectShouldShowMessagePreview,\n} from '../modules/helpers';\nimport { getTranslation } from './langProvider';\nimport { addNotifyExceptions, replaceSettings } from '../modules/reducers';\nimport {\n selectChatMessage, selectNotifyExceptions, selectNotifySettings, selectUser,\n} from '../modules/selectors';\nimport { IS_SERVICE_WORKER_SUPPORTED } from './environment';\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 soundPlayed = new Set();\n\nasync function playSound(id: number) {\n if (soundPlayed.has(id)) return;\n const { notificationSoundVolume } = selectNotifySettings(getGlobal());\n const volume = notificationSoundVolume / 10;\n if (volume === 0) return;\n\n const audio = new Audio('/notification.mp3');\n audio.volume = volume;\n audio.setAttribute('mozaudiochannel', 'notification');\n audio.addEventListener('ended', () => {\n soundPlayed.add(id);\n }, { once: true });\n\n setTimeout(() => {\n soundPlayed.delete(id);\n }, soundPlayedDelay);\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 playNotificationSound = debounce(playSound, 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;\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;\n\n let global = replaceSettings(getGlobal(), resultSettings);\n if (resultExceptions) {\n global = addNotifyExceptions(global, resultExceptions);\n }\n setGlobal(global);\n areSettingsLoaded = true;\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) {\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, isActive: boolean) {\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 // Dont show notification for active chat if client has focus\n return !(isActive && document.hasFocus());\n}\n\nfunction getNotificationContent(chat: ApiChat, message: ApiMessage) {\n const global = getGlobal();\n const {\n senderId,\n replyToMessageId,\n } = message;\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 actionOrigin = chat && (isChatChannel(chat) || message.senderId === message.chatId)\n ? chat\n : messageSender;\n body = renderActionMessageText(\n getTranslation,\n message,\n actionOrigin,\n actionTargetUsers,\n actionTargetMessage,\n actionTargetChatId,\n { asPlain: true },\n ) as string;\n } else {\n const senderName = getMessageSenderName(getTranslation, chat.id, messageSender);\n const summary = getMessageSummaryText(getTranslation, message);\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 showNewMessageNotification({\n chat,\n message,\n isActiveChat,\n}: { chat: ApiChat; message: Partial; isActiveChat: boolean }) {\n if (!checkIfNotificationsSupported()) return;\n if (!message.id) return;\n\n await loadNotificationSettings();\n if (!checkIfShouldNotify(chat, isActiveChat)) return;\n\n const {\n title,\n body,\n } = getNotificationContent(chat, message as ApiMessage);\n\n const icon = await getAvatar(chat);\n\n if (checkIfPushSupported()) {\n if (navigator.serviceWorker.controller) {\n // notify service worker about new message notification\n navigator.serviceWorker.controller.postMessage({\n type: 'newMessageNotification',\n payload: {\n title,\n body,\n icon,\n chatId: chat.id,\n messageId: message.id,\n },\n });\n }\n } else {\n const dispatch = getDispatch();\n const options: NotificationOptions = {\n body,\n icon,\n badge: icon,\n tag: message.id.toString(),\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 (window.focus) {\n window.focus();\n }\n };\n\n // Play sound when notification is displayed\n notification.onshow = () => {\n playNotificationSound(message.id || chat.id);\n };\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","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: any;\n size?: 'default' | 'smaller' | 'tiny';\n color?: 'primary' | 'secondary' | 'gray' | 'danger' | 'translucent' | 'translucent-white' | 'dark';\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 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 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}) => {\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 );\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 e.preventDefault();\n if (!disabled && onMouseDown) {\n onMouseDown(e);\n }\n }, [onMouseDown, disabled]);\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 >\n {isLoading ? (\n
\n Please wait..\n \n
\n ) : children}\n {!disabled && ripple && (\n \n )}\n \n );\n};\n\nexport default Button;\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 { nativeToUnfified } from '../../../util/emoji';\nimport buildClassName from '../../../util/buildClassName';\n\nimport MentionLink from '../../middle/message/MentionLink';\nimport SafeLink from '../SafeLink';\n\ntype TextPart = string | Element;\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<(\n 'escape_html' | 'hq_emoji' | 'emoji' | 'emoji_html' | 'br' | 'br_html' | 'highlight' | 'links' |\n 'simple_markdown' | 'simple_markdown_html'\n )> = ['emoji'],\n params?: { highlight: string | undefined },\n): TextPart[] {\n if (typeof part !== 'string') {\n return [part];\n }\n\n return 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 return [...result, part];\n }\n\n divEl.innerText = part;\n\n return [...result, divEl.innerHTML];\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 return [...result, part];\n }\n\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 = nativeToUnfified(removeVS16s(emoji));\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, part) => {\n if (typeof part !== 'string') {\n return [...result, part];\n }\n\n return [...result, ...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 }, [] as TextPart[]);\n}\n\nfunction addHighlight(textParts: TextPart[], highlight: string | undefined): TextPart[] {\n return textParts.reduce((result, part) => {\n if (typeof part !== 'string' || !highlight) {\n return [...result, part];\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 return [...result, part];\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 return [...result, part];\n }\n\n const links = part.match(RE_LINK);\n if (!links || !links.length) {\n return [...result, part];\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 return [...result, part];\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","// 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 countryList, { defaultPhoneNumberFormat } from './countries';\n\nexport function getCountryById(id: string) {\n return countryList.find((c) => c.id === id) as Country;\n}\n\n// Empty groups are used to preserve 5 callback arguments for `replace` method\nfunction getPhoneNumberFormat(country?: Country) {\n return country ? country.phoneFormat : defaultPhoneNumberFormat;\n}\n\nexport function getCountryFromPhoneNumber(input: string) {\n let phoneNumber = input.replace(/[^\\d+]+/g, '');\n if (!phoneNumber.startsWith('+')) {\n phoneNumber = `+${phoneNumber}`;\n }\n\n const possibleCountries = countryList\n .filter((country: Country) => phoneNumber.startsWith(country.code))\n .sort((a, b) => a.code.length - b.code.length);\n\n return possibleCountries[possibleCountries.length - 1];\n}\n\nexport function formatPhoneNumber(input: string, country?: Country) {\n let phoneNumber = input.replace(/[^\\d]+/g, '');\n if (country) {\n phoneNumber = phoneNumber.substr(country.code.length - 1);\n } else if (input.startsWith('+')) {\n return input;\n }\n\n phoneNumber = phoneNumber.replace(getPhoneNumberFormat(country), (_, p1, p2, p3, p4, p5) => {\n const separator = country && country.id === 'GB' ? ' ' : '-';\n\n let output = '';\n if (p1) output = `${p1}`;\n if (p2) output += ` ${p2}`;\n if (p3) output += `${separator}${p3}`;\n if (p4) output += `${separator}${p4}`;\n if (p5) output += `${separator}${p5}`;\n return output;\n });\n\n return phoneNumber;\n}\n\nexport function formatPhoneNumberWithCode(phoneNumber: string) {\n const numberWithPlus = phoneNumber.startsWith('+') ? phoneNumber : `+${phoneNumber}`;\n const country = getCountryFromPhoneNumber(numberWithPlus);\n if (!country) {\n return numberWithPlus;\n }\n return `${country.code} ${formatPhoneNumber(numberWithPlus, country)}`;\n}\n\nexport { countryList };\n","import { useCallback, useState } from '../lib/teact/teact';\n\nexport default (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","import { useEffect } from '../lib/teact/teact';\n\nimport {\n BundleModules, Bundles, getModuleFromMemory, loadModule, addLoadListener,\n} from '../util/moduleLoader';\n\nimport useForceUpdate from './useForceUpdate';\n\nexport default >(\n bundleName: B, moduleName: M, noLoad = false, autoUpdate = false,\n) => {\n const module = getModuleFromMemory(bundleName, moduleName);\n const forceUpdate = useForceUpdate();\n\n if (autoUpdate) {\n // Use effect and cleanup for listener removal\n addLoadListener(forceUpdate);\n }\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","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';\n withBackground?: boolean;\n}> = ({\n color = 'blue',\n withBackground,\n}) => {\n return (\n
\n
\n
\n );\n};\n\nexport default Spinner;\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 e.preventDefault();\n\n handleError(e instanceof ErrorEvent ? e.error : 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 && err.message) || err}\\n${err && err.stack}`);\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","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 { 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 MILISECONDS_IN_DAY = 24 * 60 * 60 * 1000;\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\nexport function formatTime(datetime: number | Date) {\n const date = typeof datetime === 'number' ? new Date(datetime) : datetime;\n const hours = String(date.getHours()).padStart(2, '0');\n const minutes = String(date.getMinutes()).padStart(2, '0');\n\n return `${hours}:${minutes}`;\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(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 formatHumanDate(lang: LangFn, datetime: number | Date, isShort = false, noWeekdays = false) {\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 (isShort ? lowerFirst : upperFirst)(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 (isShort ? lowerFirst : upperFirst)(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 return isShort\n ? lowerFirst(lang(`Weekday.Short${weekDay}`))\n : upperFirst(lang(`Weekday.${weekDay}`));\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 (isShort ? lowerFirst : upperFirst)(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}\n\nexport function formatMediaDateTime(lang: LangFn, datetime: number | Date) {\n const date = typeof datetime === 'number' ? new Date(datetime) : datetime;\n\n return `${formatHumanDate(lang, date, true)}, ${formatTime(date)}`;\n}\n\nexport function formatMediaDuration(duration: 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 let string = '';\n if (hours > 0) {\n string += `${String(hours).padStart(2, '0')}:`;\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(date: Date, locale = 'en-US') {\n return date.toLocaleString(\n locale,\n {\n year: 'numeric',\n month: 'short',\n day: '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 + MILISECONDS_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 { useCallback, useState } from '../lib/teact/teact';\n\nexport default () => {\n const [, setTrigger] = useState(false);\n\n return useCallback(() => {\n setTrigger((trigger) => !trigger);\n }, []);\n};\n","import DecoderWorker from 'worker-loader!opus-recorder/dist/decoderWorker.min';\nimport WavWorker from 'worker-loader!opus-recorder/dist/waveWorker.min';\n\nconst 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: DecoderWorker | undefined = new DecoderWorker();\n let wavWorker: WavWorker | undefined = new WavWorker();\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 ApiMediaFormatToPrepared,\n ApiOnProgress,\n ApiParsedMedia,\n ApiPreparedMedia,\n} from '../api/types';\n\nimport {\n DEBUG, MEDIA_CACHE_DISABLED, MEDIA_CACHE_NAME, MEDIA_CACHE_NAME_AVATARS, TRANSPARENT_PIXEL,\n} from '../config';\nimport { callApi, cancelApiProgress } from '../api/gramjs';\nimport * as cacheApi from './cacheApi';\nimport { dataUriToBlob, 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.DataUri]: cacheApi.Type.Text,\n [ApiMediaFormat.BlobUrl]: cacheApi.Type.Blob,\n [ApiMediaFormat.Lottie]: cacheApi.Type.Json,\n [ApiMediaFormat.Progressive]: undefined,\n [ApiMediaFormat.Stream]: undefined,\n};\n\nconst PROGRESSIVE_URL_PREFIX = './progressive/';\n\nconst memoryCache = new Map();\nconst fetchPromises = new Map>();\n\nexport function fetch(\n url: string, mediaFormat: T, onProgress?: ApiOnProgress,\n): Promise> {\n if (mediaFormat === ApiMediaFormat.Progressive) {\n return (\n IS_PROGRESSIVE_SUPPORTED\n ? getProgressive(url)\n : fetch(url, ApiMediaFormat.BlobUrl, onProgress)\n ) as Promise>;\n }\n\n if (!fetchPromises.has(url)) {\n const promise = fetchFromCacheOrRemote(url, mediaFormat, onProgress)\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 });\n\n fetchPromises.set(url, promise);\n }\n\n return fetchPromises.get(url) as Promise>;\n}\n\nexport function getFromMemory(url: string) {\n return memoryCache.get(url) as ApiMediaFormatToPrepared;\n}\n\nexport function cancelProgress(progressCallback: ApiOnProgress) {\n cancelApiProgress(progressCallback);\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(url: string, mediaFormat: ApiMediaFormat, onProgress?: ApiOnProgress) {\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]!);\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 void callApi('downloadMedia', { url, mediaFormat }, (progress: number, arrayBuffer: ArrayBuffer) => {\n if (onProgress) {\n onProgress(progress);\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\n memoryCache.set(url, streamUrl);\n return streamUrl;\n }\n\n const remote = await callApi('downloadMedia', { url, mediaFormat }, onProgress);\n if (!remote) {\n throw new Error('Failed to fetch media');\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 = blob.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 prepareMedia(mediaData: ApiParsedMedia): ApiPreparedMedia {\n if (mediaData instanceof Blob) {\n // Prevent HTML-in-video attacks\n if (mediaData.type.includes('text/html')) {\n return URL.createObjectURL(dataUriToBlob(TRANSPARENT_PIXEL));\n }\n\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","import React, { FC, useCallback } from '../../lib/teact/teact';\n\nimport buildClassName from '../../util/buildClassName';\n\nimport './Link.scss';\n\ntype OwnProps = {\n children: any;\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","export default (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","import { ApiChat, ApiUser } 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';\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(lang: LangFn, user: ApiUser, serverTimeOffset: number) {\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 (!user.status) {\n return '';\n }\n\n switch (user.status.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 } = user.status;\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(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(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) {\n const { id, status, type } = user;\n\n if (!status) {\n return false;\n }\n\n if (id === SERVICE_NOTIFICATIONS_USER_ID) {\n return false;\n }\n\n return status.type === 'userStatusOnline' && type !== 'userTypeBot';\n}\n\nexport function isDeletedUser(user: ApiUser) {\n if (!user.status || 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 sortUserIds(\n userIds: number[],\n usersById: Record,\n priorityIds?: number[],\n serverTimeOffset = 0,\n) {\n return orderBy(userIds, (id) => {\n const now = Date.now() / 1000 + 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 if (!user || !user.status) {\n return 0;\n }\n\n if (user.status.type === 'userStatusOnline') {\n return user.status.expires;\n } else if (user.status.type === 'userStatusOffline' && user.status.wasOnline) {\n return user.status.wasOnline;\n }\n\n switch (user.status.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\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 ? Math.abs(peer.id) % 7 : 0;\n\n return USER_COLOR_KEYS[index];\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 } from '../../config';\nimport { orderBy } from '../../util/iteratees';\nimport { getUserFirstOrLastName } from './users';\nimport { formatDateToString, formatTime } from '../../util/dateFormat';\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 isChatPrivate(chatId: number) {\n return chatId > 0;\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 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 && chat.currentUserBannedRights[key])\n || (chat.defaultBannedRights && 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) {\n return false;\n }\n\n if (chat.isCreator) {\n return true;\n }\n\n if (isChatPrivate(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')) && (!isChatPrivate(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, currentUserBannedRights?: ApiChatBannedRights, defaultBannedRights?: ApiChatBannedRights,\n) {\n if (currentUserBannedRights && 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(untilDate * 1000)],\n ),\n )\n : lang('Channel.Persmission.Denied.SendMessages.Forever');\n }\n\n if (defaultBannedRights && 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\n\nexport function getChatOrder(chat: ApiChat) {\n return Math.max(\n chat.joinDate || 0,\n chat.draftDate || 0,\n chat.lastMessage ? chat.lastMessage.date : 0,\n );\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 || (isChatPrivate(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 (isChatPrivate(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 prepareFolderListIds(\n chatsById: Record,\n usersById: Record,\n folder: ApiChatFolder,\n notifySettings: NotifySettings,\n notifyExceptions?: Record,\n chatIdsCache?: number[],\n) {\n const excludedChatIds = folder.excludedChatIds ? new Set(folder.excludedChatIds) : undefined;\n const includedChatIds = folder.excludedChatIds ? new Set(folder.includedChatIds) : undefined;\n const pinnedChatIds = folder.excludedChatIds ? new Set(folder.pinnedChatIds) : undefined;\n const listIds = (chatIdsCache || Object.keys(chatsById).map(Number))\n .filter((id) => {\n return filterChatFolder(\n chatsById[id],\n folder,\n usersById,\n notifySettings,\n notifyExceptions,\n excludedChatIds,\n includedChatIds,\n pinnedChatIds,\n );\n });\n\n return [listIds, folder.pinnedChatIds] as const;\n}\n\nfunction filterChatFolder(\n chat: ApiChat,\n folder: ApiChatFolder,\n usersById: Record,\n notifySettings: NotifySettings,\n notifyExceptions?: Record,\n excludedChatIds?: Set,\n includedChatIds?: Set,\n pinnedChatIds?: Set,\n) {\n if (!chat.isListed) {\n return false;\n }\n\n if (excludedChatIds && excludedChatIds.has(chat.id)) {\n return false;\n }\n\n if (includedChatIds && includedChatIds.has(chat.id)) {\n return true;\n }\n\n if (pinnedChatIds && pinnedChatIds.has(chat.id)) {\n return true;\n }\n\n if (isChatArchived(chat) && folder.excludeArchived) {\n return false;\n }\n\n if (folder.excludeMuted && !chat.unreadMentionsCount && selectIsChatMuted(chat, notifySettings, notifyExceptions)) {\n return false;\n }\n\n if (!chat.unreadCount && !chat.unreadMentionsCount && !chat.hasUnreadMark && folder.excludeRead) {\n return false;\n }\n\n if (isChatPrivate(chat.id)) {\n const privateChatUser = usersById[chat.id];\n\n const isChatWithBot = privateChatUser && privateChatUser.type === 'userTypeBot';\n if (isChatWithBot) {\n if (folder.bots) {\n return true;\n }\n } else {\n if (folder.contacts && privateChatUser && privateChatUser.isContact) {\n return true;\n }\n\n if (folder.nonContacts && privateChatUser && !privateChatUser.isContact) {\n return true;\n }\n }\n } else if (isChatGroup(chat)) {\n return !!folder.groups;\n } else if (isChatChannel(chat)) {\n return !!folder.channels;\n }\n\n return false;\n}\n\nexport function prepareChatList(\n chatsById: Record,\n listIds: number[],\n orderedPinnedIds?: number[],\n folderType: 'all' | 'archived' | 'folder' = 'all',\n) {\n function chatFilter(chat?: ApiChat) {\n if (!chat || !chat.lastMessage || chat.migratedTo) {\n return false;\n }\n\n switch (folderType) {\n case 'all':\n if (isChatArchived(chat)) {\n return false;\n }\n break;\n case 'archived':\n if (!isChatArchived(chat)) {\n return false;\n }\n break;\n }\n\n return !chat.isRestricted && !chat.isNotJoined;\n }\n\n const listedChats = listIds\n .map((id) => chatsById[id])\n .filter(chatFilter);\n\n const listIdsSet = new Set(listIds);\n const pinnedChats = orderedPinnedIds\n ? (\n orderedPinnedIds\n .map((id) => chatsById[id])\n .filter(chatFilter)\n .filter((chat) => listIdsSet.has(chat.id))\n )\n : [];\n\n const otherChats = orderBy(\n orderedPinnedIds\n ? listedChats.filter((chat) => !orderedPinnedIds.includes(chat.id))\n : listedChats,\n getChatOrder,\n 'desc',\n );\n\n return {\n pinnedChats,\n otherChats,\n };\n}\n\nexport function getFolderUnreadDialogs(\n chatsById: Record,\n usersById: Record,\n folder: ApiChatFolder,\n chatIdsCache: number[],\n notifySettings: NotifySettings,\n notifyExceptions?: Record,\n) {\n const [listIds] = prepareFolderListIds(chatsById, usersById, folder, notifySettings, notifyExceptions, chatIdsCache);\n\n const listedChats = listIds\n .map((id) => chatsById[id])\n .filter((chat) => (chat && chat.lastMessage && !chat.isRestricted && !chat.isNotJoined));\n\n const unreadDialogsCount = listedChats\n .reduce((total, chat) => (chat.unreadCount || chat.hasUnreadMark ? total + 1 : total), 0);\n\n const hasActiveDialogs = listedChats.some((chat) => (\n chat.unreadMentionsCount\n || (!selectIsChatMuted(chat, notifySettings, notifyExceptions) && (chat.unreadCount || chat.hasUnreadMark))\n ));\n\n return {\n unreadDialogsCount,\n hasActiveDialogs,\n };\n}\n\nexport function getFolderDescriptionText(\n lang: LangFn,\n chatsById: Record,\n usersById: Record,\n folder: ApiChatFolder,\n chatIdsCache: number[],\n notifySettings: NotifySettings,\n notifyExceptions?: Record,\n) {\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 Object.values(filters).filter(Boolean).length > 1\n || (excludedChatIds && excludedChatIds.length)\n || (includedChatIds && includedChatIds.length)\n ) {\n const length = getFolderChatsCount(chatsById, usersById, folder, chatIdsCache, notifySettings, notifyExceptions);\n return lang('Chats', length);\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\nfunction getFolderChatsCount(\n chatsById: Record,\n usersById: Record,\n folder: ApiChatFolder,\n chatIdsCache: number[],\n notifySettings: NotifySettings,\n notifyExceptions?: Record,\n) {\n const [listIds, pinnedIds] = prepareFolderListIds(\n chatsById, usersById, folder, notifySettings, notifyExceptions, chatIdsCache,\n );\n const { pinnedChats, otherChats } = prepareChatList(chatsById, listIds, pinnedIds, 'folder');\n return pinnedChats.length + otherChats.length;\n}\n\nexport function isChat(chatOrUser?: ApiUser | ApiChat): chatOrUser is ApiChat {\n if (!chatOrUser) {\n return false;\n }\n\n return chatOrUser.id < 0;\n}\n\nexport function getMessageSenderName(lang: LangFn, chatId: number, sender?: ApiUser) {\n if (!sender || isChatPrivate(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: number[],\n chatsById: Record,\n shouldPrioritizeVerified = false,\n priorityIds?: number[],\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","import { useEffect } from '../lib/teact/teact';\n\nexport const ANIMATION_START_EVENT = 'tt-event-heavy-animation-start';\nexport const ANIMATION_END_EVENT = 'tt-event-heavy-animation-end';\n\nlet timeout: number | undefined;\nlet isAnimating = false;\n\nexport const dispatchHeavyAnimationEvent = (duration?: number) => {\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 if (duration) {\n timeout = window.setTimeout(() => {\n isAnimating = false;\n document.dispatchEvent(new Event(ANIMATION_END_EVENT));\n timeout = undefined;\n }, duration);\n }\n\n return () => {\n isAnimating = false;\n document.dispatchEvent(new Event(ANIMATION_END_EVENT));\n };\n};\n\nexport default (\n handleAnimationStart: AnyToVoidFunction,\n handleAnimationEnd: AnyToVoidFunction,\n) => {\n useEffect(() => {\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 }, [handleAnimationEnd, handleAnimationStart]);\n};\n","import { DEBUG } from '../../config';\n\ntype Handler = (e: Event) => void;\n\nconst NON_BUBBLEABLE_EVENTS = new Set(['scroll', 'mouseenter', 'mouseleave']);\n\nconst delegationRegistry: Record> = {};\nconst delegatedEventsByElement = new Map>();\nconst documentEventCounters: Record = {};\n\nexport function addEventListener(element: HTMLElement, propName: string, handler: Handler, asCapture = false) {\n const eventName = resolveEventName(propName, element);\n if (canUseEventDelegation(eventName, element, asCapture)) {\n addDelegatedListener(eventName, element, handler);\n } else {\n element.addEventListener(eventName, handler, asCapture);\n }\n}\n\nexport function removeEventListener(element: HTMLElement, propName: string, handler: Handler, asCapture = false) {\n const eventName = resolveEventName(propName, element);\n if (canUseEventDelegation(eventName, element, asCapture)) {\n removeDelegatedListener(eventName, element);\n } else {\n element.removeEventListener(eventName, handler, asCapture);\n }\n}\n\nfunction resolveEventName(propName: string, element: HTMLElement) {\n const eventName = propName\n .replace(/^on/, '')\n .replace(/Capture$/, '').toLowerCase();\n\n if (eventName === '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 (eventName === 'doubleclick') {\n return 'dblclick';\n }\n\n // Replace focus/blur by their \"bubbleable\" versions\n if (eventName === 'focus') {\n return 'focusin';\n }\n\n if (eventName === 'blur') {\n return 'focusout';\n }\n\n return eventName;\n}\n\nfunction canUseEventDelegation(realEventName: string, element: HTMLElement, asCapture: boolean) {\n return (\n !asCapture\n && !NON_BUBBLEABLE_EVENTS.has(realEventName)\n && element.tagName !== 'VIDEO'\n && element.tagName !== 'IFRAME'\n );\n}\n\nfunction addDelegatedListener(eventName: string, element: HTMLElement, handler: Handler) {\n if (!documentEventCounters[eventName]) {\n documentEventCounters[eventName] = 0;\n document.addEventListener(eventName, handleEvent);\n }\n\n resolveDelegationRegistryForName(eventName).set(element, handler);\n resolveDelegatedEventsForElement(element).add(eventName);\n documentEventCounters[eventName]++;\n}\n\nfunction removeDelegatedListener(eventName: string, element: HTMLElement) {\n documentEventCounters[eventName]--;\n if (!documentEventCounters[eventName]) {\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(eventName, handleEvent);\n }\n\n delegationRegistry[eventName].delete(element);\n delegatedEventsByElement.get(element)!.delete(eventName);\n}\n\nexport function removeAllDelegatedListeners(element: HTMLElement) {\n const eventNames = delegatedEventsByElement.get(element);\n if (!eventNames) {\n return;\n }\n\n eventNames.forEach((eventName) => removeDelegatedListener(eventName, element));\n delegatedEventsByElement.delete(element);\n}\n\nfunction handleEvent(realEvent: Event) {\n const events = delegationRegistry[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 resolveDelegationRegistryForName(eventName: string) {\n if (!delegationRegistry[eventName]) {\n delegationRegistry[eventName] = new Map();\n }\n\n return delegationRegistry[eventName];\n}\n\nfunction resolveDelegatedEventsForElement(element: HTMLElement) {\n const existing = delegatedEventsByElement.get(element);\n if (existing) {\n return existing;\n }\n\n const newSet = new Set();\n delegatedEventsByElement.set(element, newSet);\n\n return newSet;\n}\n\nif (DEBUG) {\n document.addEventListener('dblclick', () => {\n // eslint-disable-next-line no-console\n console.log('DELEGATED EVENTS', { delegationRegistry, delegatedEventsByElement, documentEventCounters });\n });\n}\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\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;\n\ntype HistoryState = {\n currentIndex: number;\n nextStateIndexToReplace: number;\n isHistoryAltered: boolean;\n isDisabled: boolean;\n isEdge: boolean;\n currentIndexes: number[];\n};\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 }, '');\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 (historyState.currentIndexes.includes(historyState.nextStateIndexToReplace - 1)\n && window.history.state.index !== 0\n && historyState.nextStateIndexToReplace === index\n && !shouldReplaceNext)\n ? 'replaceState'\n : 'pushState'\n ]({\n index,\n state: currentState,\n }, '');\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 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 } 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 }, '', `#${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 { useRef, useState } from '../lib/teact/teact';\nimport buildClassName from '../util/buildClassName';\n\nconst CLOSE_DURATION = 350;\n\nexport default (\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\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 closeTimeoutRef.current = window.setTimeout(() => {\n setIsClosed(true);\n\n if (onCloseTransitionEnd) {\n onCloseTransitionEnd();\n }\n\n closeTimeoutRef.current = undefined;\n }, noCloseTransition ? 0 : CLOSE_DURATION);\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","const DEFAULT_MAX_TEXT_LENGTH = 30;\n\nexport default function trimText(text: string | undefined, length = DEFAULT_MAX_TEXT_LENGTH) {\n if (!text || text.length <= length) {\n return text;\n }\n\n return `${text.substr(0, length)}...`;\n}\n","import React, { FC, useCallback } from '../../lib/teact/teact';\n\nimport buildClassName from '../../util/buildClassName';\nimport useLang from '../../hooks/useLang';\n\nimport './MenuItem.scss';\n\ntype OnClickHandler = (e: React.SyntheticEvent) => void;\n\ntype OwnProps = {\n icon?: string;\n className?: string;\n children: any;\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 );\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 }: Ripple) => (\n \n ))}\n
\n );\n};\n\nexport default memo(RippleEffect);\n","import WebpWorker from 'worker-loader!../lib/webp/webp_wasm.worker';\nimport { isWebpSupported } from './environment';\nimport { dataUriToBlob, blobToDataUri } from './files';\nimport { pause } from './schedulers';\n\ntype TEncodedImage = {\n result: Uint8ClampedArray;\n width: number;\n height: number;\n};\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, url: string): Promise {\n if (isWebpSupported() || url.substr(0, 15) !== 'data:image/webp') {\n return url;\n }\n\n initWebpWorker();\n\n const pngBlob = await webpToPng(key, dataUriToBlob(url));\n\n if (!pngBlob) {\n throw new Error(`Can't convert webp to png. Url: ${url}`);\n }\n\n return blobToDataUri(pngBlob);\n}\n\nfunction initWebpWorker() {\n if (!worker) {\n worker = new WebpWorker() 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 worker.requests = worker.requests || new Map();\n worker.requests.set(url, resolve);\n worker.postMessage({ id: url, blob });\n });\n}\n","import { ISettings } from '../types';\n\nimport { animateSingle } from './animation';\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;\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\nexport default (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 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 } 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}\n","import { ChangeEvent, FormEvent, RefObject } 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 { ChangeEvent } from 'react';\nimport React, { FC, memo, useCallback } from '../../lib/teact/teact';\n\nimport buildClassName from '../../util/buildClassName';\nimport useLang from '../../hooks/useLang';\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 captureKeyboardListener from './captureKeyboardListeners';\n\ntype IHandlerFunction = () => void;\n\nexport default function captureEscKeyListener(handler: IHandlerFunction) {\n return captureKeyboardListener({ onEsc: handler });\n}\n","export 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) => word.length && word.match(/./u)![0].toUpperCase())\n .join('');\n}\n","export const MEMO_EMPTY_ARRAY = [];\n","import usePrevious from './usePrevious';\n\nexport default (cb: (args: PT) => void, dependencies: T) => {\n const prevDeps = usePrevious(dependencies);\n if (!prevDeps || dependencies.some((d, i) => d !== prevDeps[i])) {\n // @ts-ignore (workaround for \"could be instantiated with a different subtype\" issue)\n cb(prevDeps || []);\n }\n};\n","const RE_NOT_LETTER = /[^\\wа-яё]+/;\n\nexport default function searchWords(haystack: string, needle: string) {\n if (!haystack || !needle) {\n return false;\n }\n\n const haystackWords = haystack.toLowerCase().split(RE_NOT_LETTER);\n const needleWords = needle.toLowerCase().split(RE_NOT_LETTER);\n\n return needleWords.every((needleWord) => (\n haystackWords.some((haystackWord) => haystackWord.startsWith(needleWord))\n ));\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 windowSize = updateSizes();\nlet isRefreshDisabled = false;\n\nfunction disableRefresh() {\n isRefreshDisabled = true;\n}\n\nfunction enableRefresh() {\n isRefreshDisabled = false;\n}\n\nconst handleResize = throttle(() => {\n windowSize = 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('resize', handleResize);\nwindow.addEventListener('orientationchange', handleResize);\n\nexport function updateSizes(): IDimensions {\n const vh = window.innerHeight * 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 windowSize.width <= MOBILE_SCREEN_MAX_WIDTH || (\n windowSize.width <= MOBILE_SCREEN_LANDSCAPE_MAX_WIDTH && windowSize.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\nexport default {\n get: () => windowSize,\n getIsKeyboardVisible: () => initialHeight > windowSize.height,\n disableRefresh,\n enableRefresh,\n};\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';\n\nimport './Menu.scss';\n\ntype OwnProps = {\n ref?: RefObject;\n containerRef?: RefObject;\n isOpen: boolean;\n className?: string;\n style?: string;\n positionX?: 'left' | 'right';\n positionY?: 'top' | 'bottom';\n autoClose?: boolean;\n shouldSkipTransition?: boolean;\n footer?: string;\n noCloseOnBackdrop?: 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: any;\n};\n\nconst ANIMATION_DURATION = 200;\n\nconst Menu: FC = ({\n ref,\n containerRef,\n isOpen,\n className,\n style,\n children,\n positionX = 'left',\n positionY = 'top',\n autoClose = false,\n footer,\n noCloseOnBackdrop = false,\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 (prevIsOpen !== undefined) {\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 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","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 { useEffect } from '../lib/teact/teact';\nimport usePrevious from './usePrevious';\n\nexport default (cb: (args: PT) => void, dependencies: T, debugKey?: string) => {\n const prevDeps = usePrevious(dependencies);\n return useEffect(() => {\n // @ts-ignore (workaround for \"could be instantiated with a different subtype\" issue)\n return cb(prevDeps || []);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, dependencies, debugKey);\n};\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 { DEBUG, RE_TME_INVITE_LINK, RE_TME_LINK } from '../../config';\nimport buildClassName from '../../util/buildClassName';\n\ntype OwnProps = {\n url?: string;\n text: string;\n className?: string;\n children?: any;\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_TME_INVITE_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 ensureProtocol(url?: string) {\n if (!url) {\n return undefined;\n }\n\n return url.includes('://') ? url : `https://${url}`;\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 { ApiError, ApiInviteInfo } from '../../api/types';\n\nconst STRIPE_ERRORS: Record> = {\n missing_payment_information: {\n field: 'cardNumber',\n fieldError: 'Incorrect card number',\n },\n invalid_number: {\n field: 'cardNumber',\n fieldError: 'Incorrect card number',\n },\n number: {\n field: 'cardNumber',\n fieldError: 'Incorrect card number',\n },\n exp_year: {\n field: 'expiry',\n fieldError: 'Incorrect year',\n },\n exp_month: {\n field: 'expiry',\n fieldError: 'Incorrect month',\n },\n invalid_expiry_year: {\n field: 'expiry',\n fieldError: 'Incorrect year',\n },\n invalid_expiry_month: {\n field: 'expiry',\n fieldError: 'Incorrect month',\n },\n cvc: {\n field: 'cvv',\n fieldError: 'Incorrect CVV',\n },\n invalid_cvc: {\n field: 'cvv',\n fieldError: 'Incorrect CVV',\n },\n};\n\nexport function getStripeError(error: {\n code: string;\n message: string;\n param?: string;\n}) {\n const { message, code, param } = error;\n const { field, fieldError, description } = param ? STRIPE_ERRORS[param] : STRIPE_ERRORS[code];\n return {\n field,\n fieldError,\n description: description || message,\n };\n}\n\nconst SHIPPING_ERRORS: Record> = {\n ADDRESS_STREET_LINE1_INVALID: {\n field: 'streetLine1',\n fieldError: 'Incorrect street address',\n },\n ADDRESS_STREET_LINE2_INVALID: {\n field: 'streetLine2',\n fieldError: 'Incorrect street address',\n },\n ADDRESS_CITY_INVALID: {\n field: 'city',\n fieldError: 'Incorrect city',\n },\n ADDRESS_COUNTRY_INVALID: {\n field: 'countryIso2',\n fieldError: 'Incorrect country',\n },\n ADDRESS_POSTCODE_INVALID: {\n field: 'postCode',\n fieldError: 'Incorrect post code',\n },\n ADDRESS_STATE_INVALID: {\n field: 'state',\n fieldError: 'Incorrect state',\n },\n REQ_INFO_NAME_INVALID: {\n field: 'fullName',\n fieldError: 'Incorrect name',\n },\n REQ_INFO_PHONE_INVALID: {\n field: 'phone',\n fieldError: 'Incorrect phone',\n },\n REQ_INFO_EMAIL_INVALID: {\n field: 'email',\n fieldError: 'Incorrect email',\n },\n};\n\n\nexport function getShippingErrors(dialogs: (ApiError | ApiInviteInfo)[]) {\n return Object.values(dialogs).reduce((acc, cur) => {\n if (!('hasErrorKey' in cur) || !cur.hasErrorKey) return acc;\n const error = SHIPPING_ERRORS[cur.message];\n if (error) {\n acc = {\n ...acc,\n [error.field]: error.fieldError,\n };\n }\n return acc;\n }, {});\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 fastRaf(() => {\n if (!instance!.isCancelled && tick()) {\n animateSingle(tick, instance);\n }\n });\n}\n\nexport function animate(tick: Function) {\n fastRaf(() => {\n if (tick()) {\n animate(tick);\n }\n });\n}\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: any;\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 { RefObject } from 'react';\nimport { useState, useCallback, useEffect } from '../lib/teact/teact';\n\nexport default (\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","// @ts-ignore\nimport 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\nexport default (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","// 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\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\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 nativeToUnfified(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","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']);\nconst MAPPED_ATTRIBUTES: { [k: string]: string } = {\n autoPlay: 'autoplay',\n autoComplete: 'autocomplete',\n};\nconst INDEX_KEY_PREFIX = '__indexKey#';\n\nconst headsByElement: Record = {};\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 if (\n !skipComponentUpdate\n && $current && $new\n && isComponentElement($current) && isComponentElement($new)\n && !hasElementChanged($current, $new)\n ) {\n $new = updateComponent($current, $new);\n }\n\n // Parent element may have changed, so we need to update the listener closure.\n if (!skipComponentUpdate && $new && isComponentElement($new) && $new.componentInstance.isMounted) {\n setupComponentUpdateListener($new, $parent, index, parentEl);\n }\n\n if ($current === $new) {\n return $new;\n }\n\n if (!$current && $new) {\n if (isComponentElement($new)) {\n $new = initComponent($new, $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 (isComponentElement($new)) {\n $new = initComponent($new, $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 = isComponentElement($current) && isComponentElement($new);\n\n if (!areComponents) {\n setTarget($new, getTarget($current)!);\n }\n\n if (isRealElement($current) && isRealElement($new)) {\n if (moveDirection) {\n const node = getTarget($current)!;\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, $new, getTarget($current) as HTMLElement);\n }\n\n $new.children = renderChildren(\n $current,\n $new,\n areComponents ? parentEl : getTarget($current) 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.keys(props).forEach((key) => {\n addAttribute(element, key, props[key]);\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 maxLength = Math.max($current.children.length, $new.children.length);\n const newChildren = [];\n const fragment = $new.children.length > $current.children.length + 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 >= $current.children.length ? { 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 if (DEBUG && isRealElement($newChild) && !key) {\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\n // First we handle removed children\n if (key && !newKeys.has(key)) {\n renderWithVirtual(currentEl, $currentChild, undefined, $new, -1);\n\n return acc;\n } else if (!key) {\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 ...(shouldMoveNode && {\n moveDirection: isMovingDown ? 'down' : 'up',\n }),\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 currentKeys = Object.keys($current.props);\n const newKeys = Object.keys($new.props);\n\n currentKeys.forEach((key) => {\n if ($current.props[key] !== undefined && $new.props[key] === undefined) {\n removeAttribute(element, key, $current.props[key]);\n }\n });\n\n newKeys.forEach((key) => {\n if ($new.props[key] === undefined) {\n return;\n }\n\n if ($current.props[key] !== $new.props[key]) {\n if ($current.props[key] === undefined) {\n addAttribute(element, key, $new.props[key]);\n } else {\n updateAttribute(element, key, $current.props[key], $new.props[key]);\n }\n }\n });\n}\n\nfunction addAttribute(element: HTMLElement, key: string, value: any) {\n if (value === undefined) {\n return;\n }\n\n // An optimization attempt\n if (key === 'className') {\n element.className = value;\n // An optimization attempt\n } else if (key === 'value') {\n (element as HTMLInputElement).value = value;\n } else if (key === 'style') {\n element.style.cssText = value;\n } else if (key.startsWith('on')) {\n addEventListener(element, key, value, key.endsWith('Capture'));\n } else if (key.startsWith('data-') || 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.startsWith('on')) {\n removeEventListener(element, key, value, key.endsWith('Capture'));\n } else if (key.startsWith('data-') || 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\nfunction updateAttribute(element: HTMLElement, key: string, oldValue: any, newValue: any) {\n if (key === 'value') {\n // Removing and adding value causes a cursor jump\n (element as HTMLInputElement).value = newValue !== undefined ? newValue : '';\n } else {\n removeAttribute(element, key, oldValue);\n addAttribute(element, key, newValue);\n }\n}\n\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\nexport default { render };\n","import React, { FC, useCallback } from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\nimport { ApiChat, ApiUser } from '../../api/types';\n\nimport { pick } from '../../util/iteratees';\nimport buildClassName from '../../util/buildClassName';\n\nimport Link from '../ui/Link';\n\ntype OwnProps = {\n className?: string;\n sender?: ApiUser | ApiChat;\n children: any;\n};\n\ntype DispatchProps = Pick;\n\nconst UserLink: FC = ({\n className, sender, openUserInfo, children,\n}) => {\n const handleClick = useCallback(() => {\n if (sender) {\n openUserInfo({ id: sender.id });\n }\n }, [sender, openUserInfo]);\n\n if (!sender) {\n return children;\n }\n\n return (\n {children}\n );\n};\n\nexport default withGlobal(\n undefined,\n (setGlobal, actions): DispatchProps => pick(actions, ['openUserInfo']),\n)(UserLink);\n","import React, { FC, useCallback } from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\nimport { ApiMessage } from '../../api/types';\n\nimport { pick } from '../../util/iteratees';\nimport buildClassName from '../../util/buildClassName';\n\nimport Link from '../ui/Link';\n\ntype OwnProps = {\n className?: string;\n message?: ApiMessage;\n children: any;\n};\n\ntype DispatchProps = Pick;\n\nconst MessageLink: FC = ({\n className, message, children, focusMessage,\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 withGlobal(\n undefined,\n (setGlobal, actions): DispatchProps => pick(actions, ['focusMessage']),\n)(MessageLink);\n","import React, { FC, useCallback } from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\n\nimport { pick } from '../../util/iteratees';\nimport buildClassName from '../../util/buildClassName';\n\nimport Link from '../ui/Link';\n\ntype OwnProps = {\n className?: string;\n chatId?: number;\n children: any;\n};\n\ntype DispatchProps = Pick;\n\nconst ChatLink: FC = ({\n className, chatId, openChat, children,\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 withGlobal(\n undefined,\n (setGlobal, actions): DispatchProps => pick(actions, ['openChat']),\n)(ChatLink);\n","import React from '../../../lib/teact/teact';\n\nimport { ApiChat, ApiMessage, ApiUser } from '../../../api/types';\nimport { LangFn } from '../../../hooks/useLang';\nimport {\n getChatTitle,\n getMessageContent,\n getMessageSummaryText,\n getUserFullName,\n isChat,\n} from '../../../modules/helpers';\nimport trimText from '../../../util/trimText';\nimport { TextPart } from './renderMessageText';\nimport renderText from './renderText';\n\nimport UserLink from '../UserLink';\nimport MessageLink from '../MessageLink';\nimport ChatLink from '../ChatLink';\n\ninterface ActionMessageTextOptions {\n maxTextLength?: number;\n asPlain?: boolean;\n isEmbedded?: boolean;\n}\n\nconst NBSP = '\\u00A0';\n\nexport function renderActionMessageText(\n lang: LangFn,\n message: ApiMessage,\n actionOrigin?: ApiUser | ApiChat,\n targetUsers?: ApiUser[],\n targetMessage?: ApiMessage,\n targetChatId?: number,\n options: ActionMessageTextOptions = {},\n) {\n if (!message.content.action) {\n return [];\n }\n const { text, translationValues } = message.content.action;\n const content: TextPart[] = [];\n const textOptions: ActionMessageTextOptions = { ...options, maxTextLength: 32 };\n const translationKey = text === 'Chat.Service.Group.UpdatedPinnedMessage1' && !targetMessage\n ? 'Message.PinnedGenericMessage'\n : text;\n\n let unprocessed: string;\n let processed = processPlaceholder(\n lang(translationKey, translationValues && translationValues.length ? translationValues : undefined),\n '%action_origin%',\n actionOrigin\n ? (!options.isEmbedded && renderOriginContent(lang, actionOrigin, options.asPlain)) || 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, options.asPlain)).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, textOptions)\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, options.asPlain)\n : 'another chat',\n );\n content.push(...processed);\n\n if (options.asPlain) {\n return content.join('').trim();\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: ActionMessageTextOptions = {}) {\n const text = getMessageSummaryText(lang, message);\n const {\n photo, video, document, sticker,\n } = getMessageContent(message);\n\n const { maxTextLength, isEmbedded, asPlain } = options;\n\n const showQuotes = isEmbedded && text && !photo && !video && !document && !sticker;\n let messageText = trimText(text as string, maxTextLength)!;\n\n if (isEmbedded) {\n if (photo) {\n messageText = 'a photo';\n } else if (video) {\n messageText = video.isGif ? 'a GIF' : 'a video';\n } else if (document) {\n messageText = 'a document';\n } else if (sticker) {\n messageText = text;\n }\n }\n\n if (asPlain) {\n return showQuotes ? `«${messageText}»` : messageText;\n }\n\n if (showQuotes) {\n return (\n \n «\n {renderText(messageText)}\n »\n \n );\n }\n\n return (\n {renderText(messageText)}\n );\n}\n\nfunction renderOriginContent(lang: LangFn, origin: ApiUser | ApiChat, asPlain?: boolean) {\n return isChat(origin)\n ? renderChatContent(lang, origin, asPlain)\n : renderUserContent(origin, asPlain);\n}\n\nfunction renderUserContent(sender: ApiUser, asPlain?: boolean): string | TextPart | undefined {\n const text = trimText(getUserFullName(sender));\n\n if (asPlain) {\n return text;\n }\n\n return {sender && renderText(text!)};\n}\n\nfunction renderChatContent(lang: LangFn, chat: ApiChat, asPlain?: boolean): string | TextPart | undefined {\n const text = trimText(getChatTitle(lang, chat));\n\n if (asPlain) {\n return text;\n }\n\n return {chat && renderText(text!)};\n}\n\nfunction renderMigratedContent(chatId: number, asPlain?: boolean): string | TextPart | undefined {\n const text = 'another chat';\n\n if (asPlain) {\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","export 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 isAnimated: boolean;\n width?: number;\n height?: number;\n thumbnail?: ApiThumbnail;\n isPreloadedGlobally?: boolean;\n}\n\nexport interface ApiStickerSet {\n archived?: true;\n isAnimated?: true;\n installedDate?: number;\n id: string;\n accessHash: string;\n title: string;\n hasThumbnail?: boolean;\n count: number;\n hash: number;\n stickers?: ApiSticker[];\n packs?: Record;\n covers?: ApiSticker[];\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 size: number;\n mimeType: string;\n fileName: string;\n duration: number;\n performer?: string;\n title?: string;\n}\n\nexport interface ApiVoice {\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: number;\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?: number[];\n solution?: string;\n solutionEntities?: ApiMessageEntity[];\n };\n}\n\nexport interface ApiInvoice {\n text: string;\n title: string;\n photoUrl?: string;\n description?: string;\n receiptMsgId?: number;\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?: number[];\n targetChatId?: number;\n type: 'historyClear' | 'contactSignUp' | 'chatCreate' | 'other';\n photo?: ApiPhoto;\n translationValues: string[];\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 isChannelPost: boolean;\n isLinkedChannelPost?: boolean;\n fromChatId?: number;\n senderUserId?: number;\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?: number;\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 Unknown = 'MessageEntityUnknown',\n}\n\nexport interface ApiFormattedText {\n text: string;\n entities?: ApiMessageEntity[];\n}\n\nexport interface ApiMessage {\n id: number;\n chatId: number;\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?: number;\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 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?: number;\n threadInfo?: ApiThreadInfo;\n adminTitle?: string;\n isScheduled?: boolean;\n shouldHideKeyboardButtons?: boolean;\n isFromScheduled?: boolean;\n}\n\nexport interface ApiThreadInfo {\n threadId: number;\n chatId: number;\n topMessageId?: number;\n originChannelId?: number;\n messagesCount: number;\n lastMessageId?: number;\n lastReadInboxMessageId?: number;\n recentReplierIds?: number[];\n}\n\nexport type ApiMessageOutgoingStatus = 'read' | 'succeeded' | 'pending' | 'failed';\n\nexport interface ApiKeyboardButton {\n type: 'command' | 'url' | 'callback' | 'requestPoll' | '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' | '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 const MAIN_THREAD_ID = -1;\n\n// `Symbol` can not be transferred from worker\nexport const MESSAGE_DELETED = 'MESSAGE_DELETED';\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 DataUri,\n BlobUrl,\n Lottie,\n Progressive,\n Stream,\n}\n\nexport type ApiParsedMedia = string | Blob | AnyLiteral | ArrayBuffer;\nexport type ApiPreparedMedia = string | AnyLiteral;\nexport type ApiMediaFormatToPrepared = T extends ApiMediaFormat.Lottie ? AnyLiteral : string;\n","import React, { FC } from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { ApiChat, ApiUser } from '../../../api/types';\n\nimport { pick } from '../../../util/iteratees';\nimport { selectUser } from '../../../modules/selectors';\n\ntype OwnProps = {\n userId?: number;\n username?: string;\n children: any;\n};\n\ntype StateProps = {\n userOrChat?: ApiUser | ApiChat;\n};\n\ntype DispatchProps = Pick;\n\nconst MentionLink: FC = ({\n username,\n userOrChat,\n children,\n openChat,\n openChatByUsername,\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 (setGlobal, actions): DispatchProps => pick(actions, ['openChat', 'openChatByUsername']),\n)(MentionLink);\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","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","module.exports = function() {\n return new Worker(__webpack_public_path__ + \"f67db59294ba126247d6.worker.js\");\n};","module.exports = function() {\n return new Worker(__webpack_public_path__ + \"5054ce745024de60a724.worker.js\");\n};","module.exports = function() {\n return new Worker(__webpack_public_path__ + \"695e66b225ec96107343.worker.js\");\n};","module.exports = function() {\n return new Worker(__webpack_public_path__ + \"4c9029ba18603b924ede.worker.js\");\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';\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 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 switchTheme(theme, animationLevel === ANIMATION_LEVEL_MAX);\n\n if (IS_SAFARI) {\n document.body.classList.add('is-safari');\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});\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 }, 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 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 { 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';\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 });\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 } 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, IInputPrivacyRules, IInputPrivacyContact,\n UPLOADING_WALLPAPER_SLUG,\n} from '../../../types';\n\nimport { callApi } from '../../../api/gramjs';\nimport { buildCollectionByKey } from '../../../util/iteratees';\nimport { subscribe, unsubscribe } from '../../../util/notifications';\nimport { selectUser } from '../../selectors';\nimport {\n addUsers, addBlockedContact, updateChats, updateUser, removeBlockedContact, replaceSettings, updateNotifySettings,\n addNotifyExceptions,\n} from '../../reducers';\nimport { isChatPrivate } 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', 0);\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 && result.users.length) {\n newGlobal = addUsers(newGlobal, buildCollectionByKey(result.users, 'id'));\n }\n if (result.chats && 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 = isChatPrivate(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: number[];\n deniedIds: number[];\n}): IInputPrivacyRules {\n const {\n users: { byId: usersById },\n chats: { byId: chatsById },\n } = global;\n\n const rules: IInputPrivacyRules = {\n visibility,\n };\n let users: IInputPrivacyContact[];\n let chats: IInputPrivacyContact[];\n\n const collectUsers = (userId: number) => {\n if (!isChatPrivate(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: number) => {\n if (isChatPrivate(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 IInputPrivacyContact[];\n chats = allowedIds.map(collectChats).filter(Boolean) as IInputPrivacyContact[];\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 IInputPrivacyContact[];\n chats = deniedIds.map(collectChats).filter(Boolean) as IInputPrivacyContact[];\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","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';\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 if (actions.showDialog) {\n actions.showDialog({ data: { ...update.error, hasErrorKey: true } });\n }\n\n break;\n }\n});\n\nfunction onUpdateApiReady(global: GlobalState) {\n const { hasWebNotifications, hasPushNotifications } = selectNotifySettings(global);\n if (hasWebNotifications && hasPushNotifications) subscribe();\n 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 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 setGlobal({\n ...global,\n isLoggingOut: false,\n lastSyncTime: Date.now(),\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 setGlobal({\n ...global,\n connectionState,\n });\n\n if (connectionState === 'connectionStateReady' && global.authState === 'authorizationStateReady') {\n getDispatch().sync();\n } else 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: number) {\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","export var ServiceWorkerNoSupportError = (function() {\n\n\tfunction ServiceWorkerNoSupportError() {\n\t\tvar err = Error.call(this, 'ServiceWorker is not supported.');\n\t\tObject.setPrototypeOf(err, ServiceWorkerNoSupportError.prototype);\n\t\treturn err;\n\t}\n\n\tServiceWorkerNoSupportError.prototype = Object.create(Error.prototype);\n\n\treturn ServiceWorkerNoSupportError;\n})();\n\nexport var scriptUrl = __webpack_public_path__ + \"serviceWorker.js\";\n\nexport default function registerServiceWorkerIfSupported(mapScriptUrlOrOptions, maybeOptions) {\n\n\tvar targetScriptUrl = scriptUrl;\n\tvar options = maybeOptions;\n\n\tif (typeof mapScriptUrlOrOptions === 'function') {\n\t\ttargetScriptUrl = mapScriptUrlOrOptions(targetScriptUrl);\n\t} else {\n\t\toptions = mapScriptUrlOrOptions;\n\t}\n\n\tif ('serviceWorker' in navigator) {\n\t\treturn navigator.serviceWorker.register(targetScriptUrl, options);\n\t}\n\n\treturn Promise.reject(new ServiceWorkerNoSupportError());\n}\n","import { scriptUrl } from 'service-worker-loader!../serviceWorker';\n\nimport { DEBUG } from '../config';\nimport { getDispatch } from '../lib/teact/teactn';\nimport { IS_ANDROID, IS_IOS, IS_SERVICE_WORKER_SUPPORTED } from './environment';\nimport { notifyClientReady, playNotificationSound } 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 (!action.type) return;\n const dispatch = getDispatch();\n switch (action.type) {\n case 'focusMessage':\n if (dispatch.focusMessage) {\n dispatch.focusMessage(action.payload);\n }\n break;\n case 'playNotificationSound':\n playNotificationSound(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 await navigator.serviceWorker.register(scriptUrl);\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 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\n blocked: {\n ids: [],\n totalCount: 0,\n },\n\n users: {\n byId: {},\n },\n\n chats: {\n listIds: {},\n isFullyLoaded: {},\n orderedPinnedIds: {},\n totalCount: {},\n byId: {},\n },\n\n messages: {\n byChatId: {},\n messageLists: [],\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\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 shouldAutoDownloadMediaFromContacts: true,\n shouldAutoDownloadMediaInPrivateChats: true,\n shouldAutoDownloadMediaInGroups: true,\n shouldAutoDownloadMediaInChannels: true,\n hasWebNotifications: true,\n hasPushNotifications: true,\n notificationSoundVolume: 5,\n shouldAutoPlayGifs: true,\n shouldAutoPlayVideos: true,\n shouldSuggestStickers: true,\n shouldLoopStickers: true,\n language: 'en',\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\n shouldShowContextMenuHint: true,\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_CHAT_LIST_LIMIT,\n MIN_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN,\n GLOBAL_STATE_CACHE_USER_LIST_LIMIT,\n} from '../config';\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../util/environment';\nimport { ANIMATION_END_EVENT, ANIMATION_START_EVENT } from '../hooks/useHeavyAnimationCheck';\nimport { pick } from '../util/iteratees';\nimport { selectCurrentMessageList } from '../modules/selectors';\nimport { hasStoredSession } from '../util/sessions';\nimport { INITIAL_STATE } from './initial';\n\nconst UPDATE_THROTTLE = 5000;\n\nconst updateCacheThrottled = throttle(() => onIdle(updateCache), UPDATE_THROTTLE, false);\n\nlet isCaching = false;\nlet isHeavyAnimating = false;\nlet unsubscribeFromBeforeUnload: NoneToVoidFunction | undefined;\n\nsetupHeavyAnimationListeners();\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) {\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) {\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 // Pre-fill defaults in nested objects which may be missing in older cache\n cached.settings.byKey = {\n ...initialState.settings.byKey,\n ...cached.settings.byKey,\n };\n cached.settings.themes = {\n ...initialState.settings.themes,\n ...cached.settings.themes,\n };\n cached.chatFolders = {\n ...initialState.chatFolders,\n ...cached.chatFolders,\n };\n\n if (!cached.messages.messageLists) {\n cached.messages.messageLists = initialState.messages.messageLists;\n }\n\n if (!cached.stickers.greeting) {\n cached.stickers.greeting = initialState.stickers.greeting;\n }\n }\n\n return {\n ...initialState,\n ...cached,\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 ]),\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 };\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, selectedId } } = global;\n const idsToSave = [\n ...(global.chats.listIds.active || []).slice(0, GLOBAL_STATE_CACHE_CHAT_LIST_LIMIT).filter((cid) => cid > 0),\n ...Object.keys(byId),\n ].slice(0, GLOBAL_STATE_CACHE_USER_LIST_LIMIT);\n\n return {\n byId: pick(byId, idsToSave as number[]),\n selectedId: window.innerWidth > MIN_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN ? selectedId : undefined,\n };\n}\n\nfunction reduceChats(global: GlobalState): GlobalState['chats'] {\n const chatIdsToSave = [\n ...(global.chats.listIds.active || []).slice(0, GLOBAL_STATE_CACHE_CHAT_LIST_LIMIT),\n ];\n const { chatId: currentChatId } = selectCurrentMessageList(global) || {};\n\n return {\n ...global.chats,\n byId: pick(global.chats.byId, currentChatId ? [...chatIdsToSave, currentChatId] : chatIdsToSave),\n listIds: {\n active: chatIdsToSave,\n },\n isFullyLoaded: {},\n orderedPinnedIds: {\n active: global.chats.orderedPinnedIds.active,\n },\n };\n}\n\nfunction reduceMessages(global: GlobalState): GlobalState['messages'] {\n const byChatId: GlobalState['messages']['byChatId'] = {};\n const { chatId: currentChatId } = selectCurrentMessageList(global) || {};\n\n const chatIdsToSave = [\n ...(global.chats.listIds.active || []).slice(0, GLOBAL_STATE_CACHE_CHAT_LIST_LIMIT),\n ...(currentChatId ? [currentChatId] : []),\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 const currentMessageList = selectCurrentMessageList(global);\n\n return {\n byChatId,\n messageLists: !currentMessageList || IS_SINGLE_COLUMN_LAYOUT ? [] : [{\n ...currentMessageList,\n threadId: MAIN_THREAD_ID,\n type: 'thread',\n }],\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 setupHeavyAnimationListeners() {\n document.addEventListener(ANIMATION_START_EVENT, () => {\n isHeavyAnimating = true;\n });\n document.addEventListener(ANIMATION_END_EVENT, () => {\n isHeavyAnimating = false;\n });\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","export default __webpack_public_path__ + \"telegram-logo.df3a91becaa9678c529b4c4cadd45204.svg\";","export default __webpack_public_path__ + \"monkey.a3d5fcdc50b18dc55695f7dd4101a8c9.svg\";","import React, { FC, useEffect } from '../../lib/teact/teact';\nimport { getGlobal, withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiMediaFormat } from '../../api/types';\nimport { GlobalActions, 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 { pick } from '../../util/iteratees';\nimport buildClassName from '../../util/buildClassName';\n\nimport './UiLoader.scss';\n\n// @ts-ignore\nimport telegramLogoPath from '../../assets/telegram-logo.svg';\n// @ts-ignore\nimport monkeyPath from '../../assets/monkey.svg';\nimport { selectIsRightColumnShown, selectTheme } from '../../modules/selectors';\n\ntype OwnProps = {\n page: 'main' | 'authCode' | 'authPassword' | 'authPhoneNumber' | 'authQrCode';\n children: any;\n};\n\ntype StateProps = Pick & {\n hasCustomBackground?: boolean;\n hasCustomBackgroundColor: boolean;\n isRightColumnShown?: boolean;\n};\n\ntype DispatchProps = Pick;\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.DataUri);\n }));\n}\n\nconst preloadTasks = {\n main: () => Promise.all([\n loadModule(Bundles.Main, 'Main')\n .then(preloadFonts),\n preloadAvatars(),\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 setIsUiReady,\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 };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['setIsUiReady']),\n)(UiLoader);\n","import * as langProvider from '../util/langProvider';\nimport { useState } from '../lib/teact/teact';\n\nexport default (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","export 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;\n}\n","import React, {\n FC, useState, memo, useCallback, useRef,\n} from '../../lib/teact/teact';\n\nimport { ANIMATION_END_DELAY } from '../../config';\nimport { countryList } from '../../util/phoneNumber';\nimport searchWords from '../../util/searchWords';\nimport buildClassName from '../../util/buildClassName';\nimport renderText from '../common/helpers/renderText';\nimport useLang from '../../hooks/useLang';\n\nimport DropdownMenu from '../ui/DropdownMenu';\nimport MenuItem from '../ui/MenuItem';\nimport Spinner from '../ui/Spinner';\n\nimport './CountryCodeInput.scss';\n\ntype OwnProps = {\n id: string;\n value?: Country;\n isLoading?: boolean;\n onChange: (value: Country) => 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}) => {\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(countryList);\n\n function updateFilter(filterValue?: string) {\n setFilter(filterValue);\n setFilteredList(getFilteredList(filterValue));\n }\n\n const handleChange = useCallback((e: React.SyntheticEvent) => {\n const { countryId } = (e.currentTarget.firstElementChild as HTMLDivElement).dataset;\n const country = countryList.find((c) => c.id === countryId);\n\n if (country) {\n onChange(country);\n }\n\n setTimeout(() => updateFilter(undefined), MENU_HIDING_DURATION);\n }, [onChange]);\n\n const handleInput = useCallback((e: React.FormEvent) => {\n updateFilter(e.currentTarget.value);\n }, []);\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, 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 inputValue = filter !== undefined\n ? filter\n : (value && value.name) || '';\n\n return (\n
\n \n \n {isLoading ? (\n \n ) : (\n \n )}\n
\n );\n };\n\n return (\n \n {filteredList.map((country: Country) => (\n \n \n {renderText(country.flag, ['hq_emoji'])}\n {country.name}\n {country.code}\n \n ))}\n {!filteredList.length && (\n \n {lang('lng_country_none')}\n \n )}\n \n );\n};\n\nfunction getFilteredList(filter = ''): Country[] {\n return filter.length\n ? countryList.filter((country) => searchWords(country.name, filter))\n : countryList;\n}\n\nexport default memo(CountryCodeInput);\n","import { ChangeEvent } from 'react';\n\n// @ts-ignore\nimport monkeyPath from '../../assets/monkey.svg';\n\nimport React, {\n FC, memo, useCallback, useEffect, useLayoutEffect, useRef, useState,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions, GlobalState } from '../../global/types';\nimport { LangCode } from '../../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, getCountryById, 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};\ntype DispatchProps = Pick;\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 language,\n setAuthPhoneNumber,\n setAuthRememberMe,\n loadNearestCountry,\n clearAuthError,\n goToAuthQrCode,\n setSettingOption,\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.code} ${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 (authNearestCountry && !country && !isTouched) {\n setCountry(getCountryById(authNearestCountry));\n }\n }, [country, authNearestCountry, isTouched]);\n\n const parseFullNumber = useCallback((newFullNumber: string) => {\n if (!newFullNumber.length) {\n setPhoneNumber('');\n }\n\n const suggestedCountry = getCountryFromPhoneNumber(newFullNumber);\n\n // Any phone numbers should be allowed, in some cases ignoring formatting\n const selectedCountry = !country\n || (suggestedCountry && suggestedCountry.id !== country.id)\n || (!suggestedCountry && newFullNumber.length)\n ? suggestedCountry\n : country;\n\n if (!country || !selectedCountry || (selectedCountry && selectedCountry.code !== country.code)) {\n setCountry(selectedCountry);\n }\n\n setPhoneNumber(formatPhoneNumber(newFullNumber, selectedCountry));\n }, [country]);\n\n const handleLangChange = useCallback(() => {\n markIsLoading();\n\n 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 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 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!.code} ${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 } = 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 };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'setAuthPhoneNumber',\n 'setAuthRememberMe',\n 'clearAuthError',\n 'loadNearestCountry',\n 'goToAuthQrCode',\n 'setSettingOption',\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 language?: LangCode;\n};\ntype DispatchProps = Pick;\n\nconst DATA_PREFIX = 'tg://login?token=';\n\nconst AuthCode: FC = ({\n connectionState,\n authState,\n authQrCode,\n language,\n returnToAuthPhoneNumber,\n setSettingOption,\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 const handleLangChange = useCallback(() => {\n markIsLoading();\n\n 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 (setGlobal, actions): DispatchProps => pick(actions, [\n 'returnToAuthPhoneNumber', 'setSettingOption',\n ]),\n)(AuthCode));\n","import React, { FC, useEffect, memo } from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions, GlobalState } from '../../global/types';\n\nimport '../../modules/actions/initial';\nimport { pick } from '../../util/iteratees';\nimport { PLATFORM_ENV } from '../../util/environment';\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;\ntype DispatchProps = Pick;\n\nconst Auth: FC = ({\n authState, reset, initApi, returnToAuthPhoneNumber, goToAuthQrCode,\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 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 (global, actions): DispatchProps => pick(actions, ['reset', 'initApi', 'returnToAuthPhoneNumber', 'goToAuthQrCode']),\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","export default __webpack_public_path__ + \"app-inactive.bc7953c2dfebcabce2c43ca7dc778a89.png\";","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, { withGlobal } from './lib/teact/teactn';\n\nimport { GlobalActions, 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;\ntype DispatchProps = Pick;\n\nconst App: FC = ({ authState, disconnect }) => {\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 (setGlobal, actions): DispatchProps => pick(actions, ['disconnect']),\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.log('GLOBAL STATE', getGlobal());\n});\n"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/main.af5bd185d96d3f084d63.js b/dist/main.af5bd185d96d3f084d63.js deleted file mode 100644 index b9029fd3..00000000 --- a/dist/main.af5bd185d96d3f084d63.js +++ /dev/null @@ -1,2 +0,0 @@ -!function(e){function t(t){for(var n,r,o=t[0],c=t[1],d=0,a=[];d=0&&O(e[t]);t--);return t+17&&console.warn(`[Teact] Slow component render: ${n}, ${Math.round(t)} ms`),w[n].renderTimes.push(t),w[n].renderCount++}}catch(t){Object(d.a)(t),u=e.renderedValue}if(e.isMounted&&u===e.renderedValue)return e.$element;e.renderedValue=u;const o=j(u);return e.$element=y(e,[o]),e.$element}function C(e,t){return typeof e!=typeof t||(e.type!==t.type||(b(e)&&b(t)?e.value!==t.value:h(e)&&h(t)?e.tag!==t.tag||e.props.key!==t.props.key:!(!m(e)||!m(t))&&(e.componentInstance.Component!==t.componentInstance.Component||e.props.key!==t.props.key)))}function E(e){p(e)&&(m(e)?function(e){if(!e.isMounted)return;e.hooks.memos.byCursor.forEach(e=>{e.current=null}),e.hooks.effects.byCursor.forEach(({cleanup:e})=>{if("function"==typeof e)try{e()}catch(e){Object(d.a)(e)}}),e.isMounted=!1,function(e){e.hooks.effects.byCursor.forEach(e=>{e.cleanup=null,e.effect=null,e.dependencies=null}),e.hooks.state.byCursor.forEach(e=>{e.value=null,e.nextValue=null,e.setter=null}),e.hooks.memos.byCursor.forEach(e=>{e.dependencies=null}),e.hooks=null,e.$element=null,e.renderedValue=null,e.Component=null,e.props=null,e.forceUpdate=null,e.onUpdate=null}(e)}(e.componentInstance):e.target&&(Object(a.b)(e.target),e.target=null),e.children.forEach(E))}function S(e){return I(e),e.isMounted=!0,e.$element}function M(e){if(!e.isMounted||!e.onUpdate)return;const t=e.$element;I(e),e.$element!==t&&e.onUpdate()}function A(e){return m(e)?A(e.children[0]):e.target}function k(e,t){m(e)?k(e.children[0],t):e.target=t}function T(e){const{cursor:t,byCursor:n}=f.hooks.state;var o;return void 0===n[t]&&(n[t]={value:e,nextValue:e,setter:(o=f,e=>{n[t].nextValue!==e&&(n[t].nextValue="function"==typeof e?e(n[t].value):e,o.prepareForFrame&&o.forceUpdate||(o.prepareForFrame=Object(u.i)(()=>function e(t){t.isMounted&&(t.hooks.state.byCursor.forEach(e=>{e.value=e.nextValue}),t.prepareForFrame=Object(u.i)(()=>e(t)),t.forceUpdate=Object(u.j)(()=>M(t)))}(o)),o.forceUpdate=Object(u.j)(()=>M(o))),o.prepareForFrame(),o.forceUpdate(),r.t&&"TeactNContainer"!==o.name&&console.log("[Teact.useState]",o.name,o.Component&&o.Component.DEBUG_contentComponentName?"> "+o.Component.DEBUG_contentComponentName:"",`Forced update at cursor #${t}, next value: `,n[t].nextValue))})}),f.hooks.state.cursor++,[n[t].value,n[t].setter]}function N(e,t,n,r){const{cursor:u,byCursor:o}=f.hooks.effects,c=f,a=()=>{if(!c.isMounted)return;const{cleanup:e}=o[u];if("function"==typeof e)try{e()}catch(e){Object(d.a)(e)}o[u].cleanup=t()};if(void 0!==o[u]&&n&&o[u].dependencies){if(n.some((e,t)=>e!==o[u].dependencies[t])){if(r){const e=n.reduce((e,t,n)=>{const r=o[u].dependencies[n];return t!==r&&e.push(`${n}: ${r} => ${t}`),e},[]);console.log("[Teact]",r,"Effect caused by dependencies.",e.join(", "))}e(a)}}else e(a);o[u]={effect:t,dependencies:n,cleanup:o[u]?o[u].cleanup:void 0},f.hooks.effects.cursor++}function P(e,t,n){return N(u.b,e,t,n)}function D(e,t,n){return N(u.e,e,t,n)}function L(e,t,n){const{cursor:u,byCursor:o}=f.hooks.memos;let{current:d}=o[u]||{};return(void 0===o[u]||t.some((e,t)=>e!==o[u].dependencies[t]))&&(r.r&&n&&console.log(`[Teact.useMemo] ${f.name} (${n}): Update is caused by:`,o[u]?Object(c.b)(t,o[u].dependencies).join(", "):"[first render]"),d=e()),o[u]={current:d,dependencies:t},f.hooks.memos.cursor++,d}function x(e,t){return L(()=>e,t)}function F(e){return L(()=>({current:e}),[])}function B(e,t=c.a,n){return function(u){const o=F(u),d=F();return(!d.current||o.current&&!t(o.current,u))&&(r.r&&n&&console.log(`[Teact.memo] ${e.name} (${n}): Update is caused by:`,Object(c.b)(o.current,u).join(", ")),o.current=u,d.current=g(e,u)),d.current}}document.addEventListener("dblclick",()=>{console.log("COMPONENTS",Object(o.k)(Object.values(w),"renderCount","desc"))}),t.a={createElement:g,Fragment:s}},function(e,t,n){"use strict";n.d(t,"g",(function(){return v})),n.d(t,"e",(function(){return O})),n.d(t,"d",(function(){return j})),n.d(t,"b",(function(){return w})),n.d(t,"a",(function(){return I})),n.d(t,"f",(function(){return C})),n.d(t,"h",(function(){return E}));var r=n(0),u=n(2),o=n(31),c=n(33),d=n(10),a=n(28),i=n(3),s=n(27);function f(){return(f=Object.assign||function(e){for(var t=1;t7&&console.warn(`[TeactN] Slow containers update: ${Math.round(t)} ms`)}}],m={},p=new Map;function g(){h.forEach(e=>e(l))}const y=Object(d.j)(g);function v(e,t=!1){"object"==typeof e&&e!==l&&(l=e,t?g():y())}function O(){return l}function j(){return m}function w(e,t){b[e]||(b[e]=[],m[e]=(t,n=!1)=>{!function(e,t,n){b[e]&&b[e].forEach(e=>{const r=e(l,m,t);r&&v(r,n)})}(e,t,n)}),b[e].push(t)}function I(e){h.push(e)}function C(e){const t=h.indexOf(e);-1!==t&&h.splice(t,1)}function E(e=(()=>({})),t=(()=>({}))){return n=>function u(d){u.DEBUG_contentComponentName=n.name;const[i]=Object(r.r)(Object(c.a)(p)),b=Object(o.a)();Object(r.n)(()=>()=>{p.delete(i)},[i]);let h=p.get(i);if(h||(h={mapStateToProps:e,mapReducersToProps:t,ownProps:d,areMappedPropsChanged:!1,forceUpdate:b,DEBUG_updates:0,DEBUG_componentName:n.name},p.set(i,h)),h.areMappedPropsChanged&&(h.areMappedPropsChanged=!1),!h.mappedProps||!Object(a.a)(h.ownProps,d)){h.ownProps=d;try{h.mappedProps={...e(l,d),...t(v,m)}}catch(e){Object(s.a)(e)}}return r.a.createElement(n,f({},h.mappedProps,d))}}u.r&&(window.getGlobal=O,document.addEventListener("dblclick",()=>{console.log("GLOBAL CONTAINERS",Object(i.k)(Array.from(p.values()).map(({DEBUG_componentName:e,DEBUG_updates:t})=>({DEBUG_componentName:e,DEBUG_updates:t})),"DEBUG_updates","desc"))}))},function(e,t,n){"use strict";n.d(t,"pb",(function(){return r})),n.d(t,"L",(function(){return u})),n.d(t,"g",(function(){return o})),n.d(t,"h",(function(){return c})),n.d(t,"r",(function(){return d})),n.d(t,"t",(function(){return a})),n.d(t,"N",(function(){return i})),n.d(t,"s",(function(){return s})),n.d(t,"zb",(function(){return f})),n.d(t,"Q",(function(){return l})),n.d(t,"I",(function(){return b})),n.d(t,"J",(function(){return h})),n.d(t,"H",(function(){return m})),n.d(t,"K",(function(){return p})),n.d(t,"X",(function(){return g})),n.d(t,"Y",(function(){return y})),n.d(t,"Z",(function(){return v})),n.d(t,"ab",(function(){return O})),n.d(t,"o",(function(){return j})),n.d(t,"O",(function(){return w})),n.d(t,"jb",(function(){return C})),n.d(t,"fb",(function(){return E})),n.d(t,"gb",(function(){return S})),n.d(t,"hb",(function(){return M})),n.d(t,"k",(function(){return A})),n.d(t,"m",(function(){return k})),n.d(t,"l",(function(){return T})),n.d(t,"Ab",(function(){return N})),n.d(t,"ib",(function(){return P})),n.d(t,"G",(function(){return D})),n.d(t,"cb",(function(){return L})),n.d(t,"bb",(function(){return x})),n.d(t,"qb",(function(){return F})),n.d(t,"Qb",(function(){return B})),n.d(t,"a",(function(){return R})),n.d(t,"f",(function(){return U})),n.d(t,"e",(function(){return _})),n.d(t,"d",(function(){return $})),n.d(t,"w",(function(){return G})),n.d(t,"M",(function(){return W})),n.d(t,"U",(function(){return H})),n.d(t,"y",(function(){return z})),n.d(t,"z",(function(){return K})),n.d(t,"A",(function(){return V})),n.d(t,"wb",(function(){return q})),n.d(t,"vb",(function(){return J})),n.d(t,"lb",(function(){return Q})),n.d(t,"kb",(function(){return Y})),n.d(t,"ob",(function(){return Z})),n.d(t,"nb",(function(){return X})),n.d(t,"mb",(function(){return ee})),n.d(t,"T",(function(){return te})),n.d(t,"c",(function(){return ne})),n.d(t,"B",(function(){return re})),n.d(t,"D",(function(){return ue})),n.d(t,"C",(function(){return oe})),n.d(t,"E",(function(){return ce})),n.d(t,"Ib",(function(){return de})),n.d(t,"Jb",(function(){return ae})),n.d(t,"Cb",(function(){return ie})),n.d(t,"Db",(function(){return se})),n.d(t,"Lb",(function(){return fe})),n.d(t,"Gb",(function(){return le})),n.d(t,"Mb",(function(){return be})),n.d(t,"Nb",(function(){return he})),n.d(t,"Kb",(function(){return me})),n.d(t,"Ob",(function(){return pe})),n.d(t,"Eb",(function(){return ge})),n.d(t,"Fb",(function(){return ye})),n.d(t,"Hb",(function(){return ve})),n.d(t,"db",(function(){return Oe})),n.d(t,"j",(function(){return je})),n.d(t,"eb",(function(){return we})),n.d(t,"Bb",(function(){return Ie})),n.d(t,"n",(function(){return Ce})),n.d(t,"rb",(function(){return Ee})),n.d(t,"sb",(function(){return Se})),n.d(t,"ub",(function(){return Me})),n.d(t,"tb",(function(){return Ae})),n.d(t,"yb",(function(){return ke})),n.d(t,"b",(function(){return Te})),n.d(t,"i",(function(){return Ne})),n.d(t,"W",(function(){return Pe})),n.d(t,"V",(function(){return De})),n.d(t,"xb",(function(){return Le})),n.d(t,"u",(function(){return xe})),n.d(t,"v",(function(){return Fe})),n.d(t,"P",(function(){return Be})),n.d(t,"Pb",(function(){return Re})),n.d(t,"S",(function(){return Ue})),n.d(t,"F",(function(){return _e})),n.d(t,"R",(function(){return $e})),n.d(t,"p",(function(){return Ge})),n.d(t,"q",(function(){return We})),n.d(t,"x",(function(){return He}));const r="Telegram",u=" [Inactive]",o="Telegram WebZ",c="1.9.2",d=!1,a=!1,i=!1,s="Shoot!\nSomething went wrong, please see the error details in Dev Tools Console.",f="user_auth",l="GramJs:sessionId",b=!1,h="tt-global-state",m=30,p=5e3,g=!1,y="tt-media",v="tt-media-avatars",O="tt-media-progressive",j="tt-custom-bg",w="tt-lang-packs-v5",I="undefined"!=typeof window&&window.innerHeight>=900,C=1,E=750,S=I?60:40,M=2*S,A=72,k=I?30:25,T=100,N=42,P=42,D=20,L=30,x=200,F=500,B=20,R=!1,U=0,_=2,$=_,G=16,W=17,H=15,z=1e4,K="editable-message-text",V="editable-message-text-modal",q=1440,J=1150,Q=1275,Y=925,Z=600,X=950,ee=450,te=1e9,ne=100,re=1500,ue=250,oe=600,ce=500,de=(Math.round((ue+oe)/2),new Set(["newMessage","newScheduledMessage","deleteMessages","deleteScheduledMessages","deleteHistory"]),13),ae=11,ie=160,se=120,fe=64,le=48,be=32,he=64,me=64,pe=160,ge=140,ye=80,ve=100,Oe="MEMOJI_STICKER",je="en",we=200,Ie=450,Ce=new Set(["image/png","image/gif","image/jpeg","video/mp4","video/avi","video/quicktime"]),Ee="((ftp|https?):\\/\\/)?((www\\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\\.[a-zA-Z0-9()]{1,63})\\b([-a-zA-Z0-9()@:%_+.~#?&/=]*)",Se="(@[\\w\\d_-]+)",Me=/^(?:https?:\/\/)?(?:t\.me\/)([\d\w_]+)(?:\/([\d]+))?(?:\/([\d]+))?$/gm,Ae=/^(?:https?:\/\/)?(?:t\.me\/joinchat\/)([\d\w_-]+)?$/gm,ke=777e3,Te=0,Ne=1,Pe=10,De=5,Le=2147483646,xe="en",Fe="android",Be=["android","ios","tdesktop","macos"],Re="TelegramTips",Ue=["ar","pt-br","id","it","ko","ms","pl","es","tr"],_e="https://bugs.telegram.org/?tag_ids=41&sort=time",$e="#A2AF8E",Ge="#0F0F0F",We="#0a0a0a8c",He="rgba(90, 110, 70, 0.6)"},function(e,t,n){"use strict";function r(e,t){return e.reduce((e,n)=>(e[n[t]]=n,e),{})}function u(e,t){return Object.keys(e).reduce((n,r,u)=>(n[r]=t(e[r],r,u,e),n),{})}function o(e,t){return t.reduce((t,n)=>(t[n]=e[n],t),{})}function c(e,t){return t.reduce((t,n)=>(e[n]&&(t[n]=e[n]),t),{})}function d(e,t){const n=new Set(t.map(String));return o(e,Object.keys(e).filter(e=>!n.has(e)))}function a(e,t,n="asc"){return e.sort((e,r)=>{if(Array.isArray(t)){const[u,o]=Array.isArray(n)?n:[n,n],[c,d]=t;let a,i;if("function"==typeof c?(a=c(e)||0,i=c(r)||0):"string"==typeof c&&(a=e[c]||0,i=r[c]||0),a!==i)return"asc"===u?a-i:i-a;{let t,n;return"function"==typeof d?(t=d(e)||0,n=d(r)||0):"string"==typeof d&&(t=e[d]||0,n=r[d]||0),"asc"===o?t-n:n-t}}let u,o;return"function"==typeof t?(u=t(e)||0,o=t(r)||0):"string"==typeof t&&(u=e[t]||0,o=r[t]||0),"asc"===n?u-o:o-u})}function i(e){return e.reduce((e,t)=>Array.isArray(t)?e.concat(t):(e.push(t),e),[])}function s(e){return Array.from(new Set(e))}function f(e){return e.filter(Boolean)}function l(e,t){return e.length===t.length&&e.every((e,n)=>e===t[n])}function b(e,t){return e[0]<=t[t.length-1]&&e[e.length-1]>=t[0]}function h(e,t){return e.filter(e=>t.has(e))}function m(e,t){const n=[];for(let r=0;r(t[n]=p(e[n]),t),{})}function g(e,t){let n=e.length;for(;n--;)if(t(e[n],n,e))return e[n]}n.d(t,"c",(function(){return r})),n.d(t,"i",(function(){return u})),n.d(t,"l",(function(){return o})),n.d(t,"m",(function(){return c})),n.d(t,"j",(function(){return d})),n.d(t,"k",(function(){return a})),n.d(t,"h",(function(){return i})),n.d(t,"o",(function(){return s})),n.d(t,"e",(function(){return f})),n.d(t,"a",(function(){return l})),n.d(t,"b",(function(){return b})),n.d(t,"f",(function(){return h})),n.d(t,"n",(function(){return m})),n.d(t,"d",(function(){return p})),n.d(t,"g",(function(){return g}))},function(e,t,n){"use strict";n.d(t,"ab",(function(){return r.b})),n.d(t,"bb",(function(){return r.c})),n.d(t,"cb",(function(){return r.d})),n.d(t,"Cb",(function(){return r.g})),n.d(t,"sb",(function(){return r.e})),n.d(t,"Bb",(function(){return r.f})),n.d(t,"Jb",(function(){return r.h})),n.d(t,"Z",(function(){return r.a})),n.d(t,"ob",(function(){return u.w})),n.d(t,"nb",(function(){return u.v})),n.d(t,"lb",(function(){return u.t})),n.d(t,"qb",(function(){return u.y})),n.d(t,"mb",(function(){return u.u})),n.d(t,"rb",(function(){return u.z})),n.d(t,"l",(function(){return u.j})),n.d(t,"W",(function(){return u.p})),n.d(t,"k",(function(){return u.i})),n.d(t,"f",(function(){return u.e})),n.d(t,"g",(function(){return u.f})),n.d(t,"e",(function(){return u.d})),n.d(t,"pb",(function(){return u.x})),n.d(t,"jb",(function(){return u.r})),n.d(t,"p",(function(){return u.m})),n.d(t,"Db",(function(){return u.A})),n.d(t,"d",(function(){return u.c})),n.d(t,"b",(function(){return u.a})),n.d(t,"L",(function(){return u.o})),n.d(t,"j",(function(){return u.h})),n.d(t,"i",(function(){return u.g})),n.d(t,"kb",(function(){return u.s})),n.d(t,"Hb",(function(){return u.D})),n.d(t,"c",(function(){return u.b})),n.d(t,"Gb",(function(){return u.C})),n.d(t,"Fb",(function(){return u.B})),n.d(t,"o",(function(){return u.l})),n.d(t,"n",(function(){return u.k})),n.d(t,"ib",(function(){return u.q})),n.d(t,"K",(function(){return u.n})),n.d(t,"Ib",(function(){return u.E})),n.d(t,"C",(function(){return i})),n.d(t,"Eb",(function(){return s})),n.d(t,"G",(function(){return f})),n.d(t,"O",(function(){return l})),n.d(t,"P",(function(){return b})),n.d(t,"x",(function(){return h})),n.d(t,"M",(function(){return m})),n.d(t,"m",(function(){return p})),n.d(t,"yb",(function(){return g})),n.d(t,"zb",(function(){return y})),n.d(t,"tb",(function(){return v})),n.d(t,"gb",(function(){return O})),n.d(t,"Ab",(function(){return j})),n.d(t,"hb",(function(){return w})),n.d(t,"X",(function(){return I})),n.d(t,"Y",(function(){return C})),n.d(t,"xb",(function(){return E})),n.d(t,"ub",(function(){return S})),n.d(t,"u",(function(){return M})),n.d(t,"v",(function(){return T})),n.d(t,"fb",(function(){return N})),n.d(t,"H",(function(){return P})),n.d(t,"Q",(function(){return D})),n.d(t,"J",(function(){return L})),n.d(t,"s",(function(){return x})),n.d(t,"t",(function(){return F})),n.d(t,"N",(function(){return B})),n.d(t,"y",(function(){return R})),n.d(t,"vb",(function(){return U})),n.d(t,"wb",(function(){return _})),n.d(t,"I",(function(){return $})),n.d(t,"B",(function(){return G})),n.d(t,"R",(function(){return W})),n.d(t,"S",(function(){return H})),n.d(t,"T",(function(){return z})),n.d(t,"F",(function(){return K})),n.d(t,"E",(function(){return V})),n.d(t,"D",(function(){return J})),n.d(t,"z",(function(){return Q})),n.d(t,"A",(function(){return Y})),n.d(t,"eb",(function(){return Z})),n.d(t,"h",(function(){return X})),n.d(t,"U",(function(){return ee})),n.d(t,"V",(function(){return te})),n.d(t,"db",(function(){return ne})),n.d(t,"r",(function(){return re})),n.d(t,"w",(function(){return ue})),n.d(t,"q",(function(){return oe})),n.d(t,"a",(function(){return ce}));var r=n(35),u=n(36),o=n(8),c=n(2),d=n(65);const a=new RegExp(c.rb,"i");function i(e){const{chatId:t,id:n}=e;return`msg${t}-${n}`}function s(e){const t=e.match(/^msg(-?\d+)-(\d+)/);return{chatId:Number(t[1]),messageId:Number(t[2])}}function f(e){return e.previousLocalId||e.id}function l(e,t,n=!1){const{text:r,photo:u,video:o,audio:c,voice:d,document:a,sticker:i,contact:s,poll:f,invoice:l}=t.content,b=r&&r.text.substr(0,80);return t.groupedId?`${n?"":"🖼 "}${b||e("lng_in_dlg_album")}`:u?`${n?"":"🖼 "}${b||e("AttachPhoto")}`:o?`${n?"":"📹 "}${b||e(o.isGif?"AttachGif":"AttachVideo")}`:i?`${i.emoji||""} ${e("AttachSticker")}`.trim():c?`${n?"":"🎧 "}${M(t)||e("AttachMusic")}`:d?`${n?"":"🎤 "}${b||e("AttachAudio")}`:a?`${n?"":"📎 "}${b||a.fileName}`:s?e("AttachContact"):f?`${n?"":"📊 "}${f.summary.question}`:l?"Invoice":r?b:"The message is not supported on this version of Telegram"}function b(e){const{text:t,sticker:n,photo:r,video:u,audio:o,voice:c,document:d,poll:a,webPage:i,contact:s,invoice:f}=e.content;return t?t.text:n||r||u||o||c||d||s||a||i||f?void 0:"The message is not supported on this version of Telegram"}function h(e){const{text:t,sticker:n,photo:r,video:u,audio:o,voice:c,document:a,poll:i,webPage:s,contact:f}=e.content;return!!(n||u&&u.isRound)||!(!t||r||u||o||c||a||i||s||f)&&(Object(d.a)(t.text)||!1)}function m(e){const{text:t}=e.content;if(t&&t.text.length<=6&&1===h(e))return t.text}function p(e){const{text:t}=e.content;let n;if(t&&t.entities){let e=t.entities.find(e=>e.type===o.ApiMessageEntityTypes.TextUrl);if(e&&(n=e.url.match(a)),!n&&(e=t.entities.find(e=>e.type===o.ApiMessageEntityTypes.Url),e)){const{offset:r,length:u}=e;n=t.text.substring(r,r+u).match(a)}}if(!n&&t&&(n=t.text.match(a)),n)return{url:n[0],domain:n[3]}}function g(e){return e.isOutgoing}function y(e){return Boolean(e.replyToMessageId)}function v(e){return Boolean(e.forwardInfo)}function O(e){return!!e.content.action}function j(e){return e.chatId===c.yb&&E(e)}function w(e){return Boolean(e.senderId)&&e.senderId<0&&g(e)}function I(e,t){return t.id>0?Object(r.c)(t):Object(u.i)(e,t)}function C(e){return e.sendingState?"messageSendingStateFailed"===e.sendingState?"failed":"pending":"succeeded"}function E(e){return e.id>=c.T}function S(e){return e.content.action&&"historyClear"===e.content.action.type}function M(e){const{audio:t,text:n}=e.content;return t&&[t.title,t.performer].filter(Boolean).join(" — ")||n&&n.text}var A=n(6),k=n(60);function T(e){return e.content}function N(e){return Boolean(P(e)||D(e)||R(e)||B(e)||function(e){return e.content.contact}(e)||$(e)||x(e)||F(e)||function(e){return e.content.voice}(e))}function P(e){return e.content.photo}function D(e){return e.content.video}function L(e){const{video:t}=e.content;return t&&t.isRound?t:void 0}function x(e){return e.content.action}function F(e){return e.content.audio}function B(e){return e.content.sticker}function R(e){return e.content.document}function U(e){const t=R(e);return t?"photo"===t.mediaType:void 0}function _(e){const t=R(e);return t?"video"===t.mediaType:void 0}function $(e){return e.content.poll}function G(e){return e.content.invoice}function W(e){return e.content.webPage}function H(e){const t=W(e);return t?t.photo:void 0}function z(e){const t=W(e);if(t)return t.video}function K(e){const t=function(e){const t=P(e)||D(e)||R(e)||B(e)||H(e)||z(e);if(t)return t.thumbnail}(e);return t?t.dataUri:void 0}function V(e,t){const{photo:n,video:r,sticker:u,audio:o,voice:c,document:d}=e.content,a=H(e),s=z(e),f=r||s,l=n||a;if(!(l||f||u||o||c||d))return;const b=i(e);if(f)switch(t){case"micro":case"pictogram":return b+"?size=m";case"inline":return Z(e)?void 0:q(f,b);case"viewerPreview":return b+"?size=m";case"viewerFull":return q(f,b);case"download":return b+"?download"}if(l)switch(t){case"micro":case"pictogram":return b+"?size=m";case"inline":return Z(e)?void 0:b+"?size=x";case"viewerPreview":return b+"?size=x";case"viewerFull":return b+"?size=z"}if(d)switch(t){case"micro":case"pictogram":case"inline":case"viewerPreview":if(!Object(k.c)(d)||Z(e))return;return b+"?size=m";default:return b}if(u)switch(t){case"micro":return;case"pictogram":return b+"?size=m";default:return b}if(o)switch(t){case"micro":case"pictogram":return;case"download":return b+"?download";default:return q(o,b)}if(c)switch(t){case"micro":case"pictogram":return;default:return b}}function q(e,t){return A.h&&A.j?`${t}?fileSize=${e.size}&mimeType=${e.mimeType}`:t}function J(e,t){const{sticker:n,video:r,audio:u,voice:c}=e.content,d=r||z(e);return n&&"inline"===t&&n.isAnimated?o.ApiMediaFormat.Lottie:d&&A.h&&("viewerFull"===t||"inline"===t)?o.ApiMediaFormat.Progressive:u||c?c&&!A.g?o.ApiMediaFormat.BlobUrl:o.ApiMediaFormat.Progressive:o.ApiMediaFormat.BlobUrl}function Q(e){const{photo:t,video:n,document:r}=e.content,u=H(e),o=z(e);if(t||u)return`photo${e.date}.jpeg`;const{fileName:c}=n||o||r||{};return c}function Y(e){const{video:t,document:n}=e.content,r=z(e),{size:u}=t||r||n||{};return u}function Z(e){const{photo:t,video:n,document:r}=e.content;return t&&t.blobUrl||n&&n.blobUrl||r&&r.previewBlobUrl}function X(e,t,n=!1){const r=ue(e,t,n?"media":"inlineMedia");return n?r.reverse():r}function ee(e){return e.sizes.find(e=>"z"===e.type)||e.sizes.find(e=>"y"===e.type)||te(e)}function te(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 ne(e){if(e.width&&e.height)return e}function re(e,t,n=!1){const r=E(e);return{isUploading:r,isTransferring:r||n,transferProgress:Number(t)}}function ue(e,t,n){let r;switch(n){case"media":r=e=>{const t=D(e);return P(e)||t&&!t.isRound&&!t.isGif};break;case"documents":r=R;break;case"links":r=e=>W(e)||function(e){const{text:t}=e.content,n=t&&t.text.match(a);if(n)return{url:n[0],domain:n[3]}}(e);break;case"audio":r=F;break;case"inlineMedia":r=e=>{const t=D(e);return P(e)||t&&!t.isRound&&!t.isGif||U(e)||_(e)};break;default:return[]}return t.reduce((t,n)=>(e[n]&&r(e[n])&&t.push(n),t),[])}function oe(e){const{audio:t,voice:n,video:r}=T(e),u=t||n||r||z(e);if(u)return u.duration}function ce(e,t){return`${e}_${t}`}n(61)},function(e,t,n){"use strict";n.d(t,"c",(function(){return s})),n.d(t,"a",(function(){return f})),n.d(t,"b",(function(){return l}));var r=n(81),u=n.n(r),o=n(2),c=n(33);let d;const a=new Map,i=new Map;function s(e,t){return d||(o.r&&console.log(">>> START LOAD WORKER"),d=new u.a,function(e){d.addEventListener("message",({data:t})=>{if("update"===t.type)e(t.update);else if("methodResponse"===t.type){const e=a.get(t.messageId);e&&(t.error?e.reject(t.error):e.resolve(t.response))}else if("methodCallback"===t.type){const e=a.get(t.messageId);e&&e.callback&&e.callback(...t.callbackArgs)}else if("unhandledError"===t.type)throw t.error})}(e)),b({type:"initApi",args:[t]})}function f(e,...t){if(d)return b({type:"callMethod",name:e,args:t});o.r&&console.warn("API is not initialized")}function l(e){e.isCanceled=!0;const{messageId:t}=i.get(e)||{};t&&d.postMessage({type:"cancelProgress",messageId:t})}function b(e){const t=Object(c.a)(a),n={messageId:t,...e},r={messageId:t},u=new Promise((e,t)=>{Object.assign(r,{resolve:e,reject:t})});if("function"==typeof n.args[1]){const e=n.args.pop();r.callback=e,i.set(e,r)}return a.set(t,r),u.catch(()=>{}).finally(()=>{a.delete(t),r.callback&&i.delete(r.callback)}),d.postMessage(n),u}},function(e,t,n){"use strict";n.d(t,"t",(function(){return o})),n.d(t,"s",(function(){return d})),n.d(t,"r",(function(){return s})),n.d(t,"f",(function(){return f})),n.d(t,"e",(function(){return l})),n.d(t,"b",(function(){return b})),n.d(t,"j",(function(){return h})),n.d(t,"i",(function(){return m})),n.d(t,"n",(function(){return p})),n.d(t,"l",(function(){return g})),n.d(t,"m",(function(){return y})),n.d(t,"o",(function(){return v})),n.d(t,"d",(function(){return O})),n.d(t,"k",(function(){return j})),n.d(t,"h",(function(){return w})),n.d(t,"g",(function(){return I})),n.d(t,"c",(function(){return C})),n.d(t,"p",(function(){return E})),n.d(t,"a",(function(){return S})),n.d(t,"q",(function(){return M}));var r=n(2);let u;function o(){return Boolean(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=>{u=e});let c=window&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";function d(){return c}function a(e){c=e.matches?"dark":"light"}const i=window.matchMedia("(prefers-color-scheme: dark)");"function"==typeof i.addEventListener?i.addEventListener("change",a):"function"==typeof i.addListener&&i.addListener(a);const s=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}(),f="macOS"===s,l="iOS"===s,b="Android"===s,h=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),m=window.matchMedia("(display-mode: standalone)").matches||window.navigator.standalone||document.referrer.includes("android-app://"),p=window.matchMedia("(pointer: coarse)").matches,g=window.innerWidth<=r.ob||window.innerWidth<=r.nb&&window.innerHeight<=r.mb,y=!g&&window.innerWidth<=r.kb,v=navigator.mediaDevices&&"getUserMedia"in navigator.mediaDevices&&(window.AudioContext||window.webkitAudioContext),O=(document.documentElement.style,s&&(f||l)),j="serviceWorker"in navigator,w=j,I=(window,Boolean((new Audio).canPlayType("audio/ogg; codecs=opus"))),C=!r.N&&"filter"in(document.createElement("canvas").getContext("2d")||{}),E=b?"slide-fade":l?"slide-layers":"push-slide",S=window.devicePixelRatio||1,M=!0},function(e,t,n){"use strict";n.d(t,"T",(function(){return Fe})),n.d(t,"pb",(function(){return Be})),n.d(t,"W",(function(){return Re})),n.d(t,"Db",(function(){return Ue})),n.d(t,"Jb",(function(){return a})),n.d(t,"X",(function(){return i})),n.d(t,"g",(function(){return l})),n.d(t,"p",(function(){return b})),n.d(t,"P",(function(){return h})),n.d(t,"O",(function(){return m})),n.d(t,"Cb",(function(){return p})),n.d(t,"o",(function(){return g})),n.d(t,"h",(function(){return y})),n.d(t,"L",(function(){return v})),n.d(t,"d",(function(){return O})),n.d(t,"M",(function(){return j})),n.d(t,"k",(function(){return w})),n.d(t,"j",(function(){return I})),n.d(t,"N",(function(){return C})),n.d(t,"i",(function(){return E})),n.d(t,"r",(function(){return S})),n.d(t,"z",(function(){return D})),n.d(t,"s",(function(){return L})),n.d(t,"n",(function(){return x})),n.d(t,"sb",(function(){return F})),n.d(t,"Z",(function(){return R})),n.d(t,"hb",(function(){return U})),n.d(t,"y",(function(){return _})),n.d(t,"Kb",(function(){return $})),n.d(t,"kb",(function(){return G})),n.d(t,"qb",(function(){return W})),n.d(t,"tb",(function(){return H})),n.d(t,"ob",(function(){return z})),n.d(t,"D",(function(){return K})),n.d(t,"F",(function(){return V})),n.d(t,"C",(function(){return q})),n.d(t,"db",(function(){return J})),n.d(t,"Fb",(function(){return Q})),n.d(t,"G",(function(){return Y})),n.d(t,"nb",(function(){return Z})),n.d(t,"Gb",(function(){return X})),n.d(t,"Hb",(function(){return ee})),n.d(t,"Eb",(function(){return te})),n.d(t,"a",(function(){return ne})),n.d(t,"Y",(function(){return re})),n.d(t,"l",(function(){return ue})),n.d(t,"rb",(function(){return oe})),n.d(t,"E",(function(){return ce})),n.d(t,"m",(function(){return de})),n.d(t,"I",(function(){return ae})),n.d(t,"U",(function(){return ie})),n.d(t,"gb",(function(){return se})),n.d(t,"vb",(function(){return fe})),n.d(t,"K",(function(){return le})),n.d(t,"b",(function(){return be})),n.d(t,"e",(function(){return he})),n.d(t,"f",(function(){return me})),n.d(t,"Ib",(function(){return pe})),n.d(t,"mb",(function(){return ge})),n.d(t,"H",(function(){return ye})),n.d(t,"R",(function(){return ve})),n.d(t,"q",(function(){return Oe})),n.d(t,"S",(function(){return je})),n.d(t,"V",(function(){return we})),n.d(t,"J",(function(){return Ie})),n.d(t,"bb",(function(){return Ce})),n.d(t,"Q",(function(){return Ee})),n.d(t,"ub",(function(){return Se})),n.d(t,"cb",(function(){return Me})),n.d(t,"wb",(function(){return Ae})),n.d(t,"xb",(function(){return ke})),n.d(t,"yb",(function(){return Te})),n.d(t,"u",(function(){return _e})),n.d(t,"B",(function(){return Ne})),n.d(t,"x",(function(){return Pe})),n.d(t,"w",(function(){return De})),n.d(t,"ab",(function(){return Le})),n.d(t,"v",(function(){return xe})),n.d(t,"A",(function(){return A})),n.d(t,"t",(function(){return k})),n.d(t,"zb",(function(){return T})),n.d(t,"Ab",(function(){return N})),n.d(t,"c",(function(){return P})),n.d(t,"ib",(function(){return $e})),n.d(t,"jb",(function(){return Ge})),n.d(t,"lb",(function(){return We})),n.d(t,"Bb",(function(){return He})),n.d(t,"fb",(function(){return s})),n.d(t,"eb",(function(){return f}));var r=n(13),u=n(6),o=n(8),c=n(2),d=n(4);function a(e,t){return e.users.byId[t]}function i(e,t){const n=a(e,t);return n&&n.fullInfo&&n.fullInfo.isBlocked}function s(e){return e.settings.byKey}function f(e){return e.settings.notifyExceptions}function l(e,t){return e.chats.byId[t]}function b(e,t){const n=Object(d.W)(t);return!!n&&a(e,n)}function h(e,t){return t===e.currentUserId}function m(e,t){const n=b(e,t);return n&&Object(d.Bb)(n)}function p(e){return Object.values(e.chats.byId).find(({isSupport:e})=>e)}function g(e,t){if(!Object(d.ob)(t.id)&&!Object(d.mb)(t)&&t.fullInfo)return t.fullInfo.members&&t.fullInfo.members.length!==c.bb?t.fullInfo.members.reduce((t,{userId:n})=>e.users.byId[n]&&Object(d.Cb)(e.users.byId[n])&&n!==e.currentUserId?t+1:t,0):t.fullInfo.onlineCount}function y(e,t){const n=l(e,t),r=n&&Object(d.W)(n),u=r&&a(e,r);if(u&&Object(d.Bb)(u))return u}function v(e,t){const n=l(e,t),r=y(e,t);if(!n||!r)return!1;if(n.lastMessage&&Object(d.ub)(n.lastMessage))return!0;const u=e.messages.byChatId[t];if(!u)return!1;const{listedIds:c}=u.threadsById[o.MAIN_THREAD_ID]||{};return c&&!c.length}function O(e){return Boolean(e.chats.listIds.active)}function j(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 w(e,t){const n=l(e,t);if(n&&j(e,t))return n.folderId===c.i?"archived":"active"}function I(e,t){return e.chatFolders.byId[t]}function C(e,t,n=c.b){const{active:r,archived:u}=e.chats.orderedPinnedIds;if(n===c.b)return!!r&&r.includes(t);if(n===c.i)return!!u&&u.includes(t);const{byId:o}=e.chatFolders,{pinnedChatIds:d}=o[n]||{};return!!d&&d.includes(t)}function E(e,t){const n=t.toLowerCase();return Object.values(e.chats.byId).find(e=>e.username&&e.username.toLowerCase()===n)}function S(e){const t=e.chats.listIds.active;if(!t)return 0;const n=e.chats.byId;return t.reduce((t,r)=>{const u=n[r];return u&&u.unreadCount&&!Object(d.Hb)(u,s(e),f(e))?t+u.unreadCount:t},0)}var M=n(3);function A(e){return e.stickers.search}function k(e){return e.gifs.search}function T(e,t){return e.stickers.setsById[t]}function N(e,t){const n=Object.values(e.stickers.setsById);let r=[];return n.forEach(({packs:e})=>{if(!e)return;const n=e[t];n&&(r=r.concat(n))}),r}function P(e,t){const{animatedEmojis:n}=e;if(!n||!n.stickers)return;const r=t.replace("️","");return n.stickers.find(e=>e.emoji===t||e.emoji===r)}function D(e){const{messageLists:t}=e.messages;if(t.length)return t[t.length-1]}function L(e){const{chatId:t}=D(e)||{};return t?l(e,t):void 0}function x(e,t){const n=e.messages.byChatId[t];return n?n.byId:void 0}function F(e,t){const n=e.scheduledMessages.byChatId[t];return n?n.byId:void 0}function B(e,t,n,r){const u=e.messages.byChatId[t];if(!u)return;const o=u.threadsById[n];return o?o[r]:void 0}function R(e,t,n){return B(e,t,n,"listedIds")}function U(e,t,n){return B(e,t,n,"outlyingIds")}function _(e,t,n,r){switch(r){case"thread":return $(e,t,n);case"pinned":return G(e,t);case"scheduled":return W(e,t)}}function $(e,t,n){return B(e,t,n,"viewportIds")}function G(e,t){return B(e,t,o.MAIN_THREAD_ID,"pinnedIds")}function W(e,t){return B(e,t,o.MAIN_THREAD_ID,"scheduledIds")}function H(e,t,n){return B(e,t,n,"scrollOffset")}function z(e,t,n){return B(e,t,n,"replyingToId")}function K(e,t,n){return B(e,t,n,"editingId")}function V(e,t){return B(e,t,o.MAIN_THREAD_ID,"editingScheduledId")}function q(e,t,n){return B(e,t,n,"draft")}function J(e,t,n){return B(e,t,n,"noWebPage")}function Q(e,t,n){return B(e,t,n,"threadInfo")}function Y(e,t,n){return B(e,t,n,"firstMessageId")}function Z(e,t,n){return B(e,t,n,"replyStack")}function X(e,t,n){if(n===o.MAIN_THREAD_ID)return l(e,t);const r=Q(e,t,n);return r?l(e,r.originChannelId||t):void 0}function ee(e,t,n){if(n===o.MAIN_THREAD_ID)return;const r=Q(e,t,n);return r?r.topMessageId:void 0}function te(e,t,n){const r=e.messages.byChatId[t];if(!r)return;const{replyToMessageId:u,replyToTopMessageId:o}=n;return u||o?Object.values(r.threadsById).find(e=>e.threadInfo&&(u&&u===e.threadInfo.topMessageId||o&&o===e.threadInfo.topMessageId)):void 0}function ne(e,t,n){const r=D(e);if(!r)return!1;const{threadInfo:u}=te(e,t,n)||{};return t===r.chatId&&(r.threadId===o.MAIN_THREAD_ID||u&&r.threadId===u.threadId)}function re(e,t,n){const r=$(e,t,n);if(!r||!r.length)return!0;let u;if(n===o.MAIN_THREAD_ID){const n=l(e,t);if(!n||!n.lastMessage)return!0;u=n.lastMessage.id}else{const r=Q(e,t,n);if(!r||!r.lastMessageId)return;u=r.lastMessageId}return u>=c.T&&!ue(e,t,u)||r[r.length-1]>=u}function ue(e,t,n){const r=x(e,t);return r?r[n]:void 0}function oe(e,t,n){const r=F(e,t);return r?r[n]:void 0}function ce(e,t,n,r){if("scheduled"===r){const n=V(e,t);return n?oe(e,t,n):void 0}{const r=K(e,t,n);return r?ue(e,t,r):void 0}}function de(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 ae(e,t){const{chatId:n,messageId:r}=e.focusedMessage||{};return n===t?r:void 0}function ie(e,t){const n=ae(e,t.chatId);return!!n&&(n===t.id||n===t.previousLocalId)}function se(e,t,n=!1){return function(e,t){const{lastReadOutboxMessageId:n}=l(e,t.chatId)||{};return Object(d.xb)(t)||!n||n0?a(e,n):l(e,n)}function le(e,t){const{forwardInfo:n}=t;if(n)return n.isChannelPost&&n.fromChatId?l(e,n.fromChatId):n.senderUserId?a(e,n.senderUserId):void 0}function be(e,t,n){const{serverTimeOffset:r}=e,u=l(e,t.chatId);if(!u||u.isRestricted)return{};const o=Object(d.ob)(u.id),c=h(e,t.chatId),a=Object(d.lb)(u),i=Object(d.qb)(u),s=Object(d.mb)(u),f=Object(d.Ab)(t),b=Object(d.yb)(t),m=Object(d.gb)(t),{content:p}=t,g=(c||i&&Object(d.p)(u,"pinMessages")||s&&Object(d.p)(u,"editMessages")||Date.now()+1e3*r-1e3*t.date<1728e5)&&!(p.sticker||p.contact||p.poll||p.action||p.audio||p.video&&p.video.isRound)&&!Object(d.tb)(t)&&!t.viaBotId,y=Object(d.d)(u,n)&&!f,v=o||u.isCreator||!s&&!Object(d.Db)(u,"pinMessages")||Object(d.p)(u,"pinMessages");let O=!m&&v,j=!1;const w=G(e,u.id);O&&(j=Boolean(w&&w.includes(t.id)),O=!j);const I=o||b||a||u.isCreator||Object(d.p)(u,"deleteMessages"),C=!o&&!b,E=I&&!f&&(o&&!c||a&&(b||Object(d.p)(u,"deleteMessages")||u.isCreator)),S=!m&&g&&(b||s&&(u.isCreator||Object(d.p)(u,"editMessages"))),M=!m&&!f,A=Boolean(t.content.sticker),k=A&&function(e,t){const{stickers:n}=e.stickers.favorite;return n&&n.some(({id:e})=>e===t.id)}(e,t.content.sticker),T=!m&&A&&!k,N=!m&&k,P=!m,D=!m&&(s||i),L=!m;return{noOptions:[y,S,O,j,I,E,M,T,N,P,D,L].every(e=>!e),canReply:y,canEdit:S,canPin:O,canUnpin:j,canDelete:I,canReport:C,canDeleteForAll:E,canForward:M,canFaveSticker:T,canUnfaveSticker:N,canCopy:P,canCopyLink:D,canSelect:L}}function he(e){const{messageIds:t}=e.selectedMessages||{},{chatId:n,threadId:r}=D(e)||{},u=n&&x(e,n);if(!u||!t||!r)return{};const o=t.map(t=>u[t]&&be(e,u[t],r)).filter(Boolean);return{canDelete:o.every(e=>e.canDelete),canDeleteForAll:o.every(e=>e.canDeleteForAll)}}function me(e){const{messageIds:t}=e.selectedMessages||{},{chatId:n,threadId:r}=D(e)||{},u=n&&x(e,n);if(!u||!t||!r)return!1;return t.map(t=>u[t]&&be(e,u[t],r)).filter(Boolean).every(e=>e.canReport)}function pe(e,t){const n=e.fileUploads.byMessageLocalId[t.previousLocalId||t.id];return n?n.progress:void 0}function ge(e,t,n){if(n===o.MAIN_THREAD_ID){const n=l(e,t);if(!n)return;if(!n.lastReadInboxMessageId)return;return n.lastMessage?Object(d.xb)(n.lastMessage)?n.lastMessage.id:Math.min(n.lastMessage.id,n.lastReadInboxMessageId):n.lastReadInboxMessageId}{const r=Q(e,t,n);if(!r)return;return r.lastReadInboxMessageId?Math.min(r.lastReadInboxMessageId,r.lastMessageId||1/0):r.topMessageId}}function ye(e,t,n){const r=l(e,t);if(n===o.MAIN_THREAD_ID){if(!r)return}else{const r=Q(e,t,n);if(!r||r.lastMessageId===r.lastReadInboxMessageId)return}const u=U(e,t,n),c=R(e,t,n),d=x(e,t);if(!d||!u&&!c)return;const a=ge(e,t,n);if(a||!r||!r.isNotJoined){if(u){const e=a?u.find(e=>e>a&&d[e]&&(!d[e].isOutgoing||d[e].isFromScheduled)):u[0];if(e)return e}if(c){const e=a?c.find(e=>e>a&&d[e]&&(!d[e].isOutgoing||d[e].isFromScheduled)):c[0];if(e)return e}}}function ve(e){const{forwardMessages:t}=e;return Boolean(t.isModalShown)}function Oe(e,t){const n=Object.values(e.chats.byId).find(e=>Object(d.rb)(e)&&e.lastMessage&&e.lastMessage.id===t);if(n)return n.id;const{byChatId:r}=e.messages;return Number(Object.keys(r).find(n=>{const u=l(e,Number(n));return u&&Object(d.rb)(u)&&r[u.id].byId[t]}))}function je(e){const{selectedMessages:t}=e;return Boolean(t)}function we(e,t){const{messageIds:n}=e.selectedMessages||{};return!!n&&n.includes(t)}function Ie(e,t,n){const r=x(e,t);if(r)return Object.values(r).filter(e=>e.groupedId===n&&e.forwardInfo).map(({forwardInfo:e})=>e.fromMessageId)}function Ce(e,t,n){const r=x(e,t);if(r)return Object.keys(r).map(Number).filter(e=>r[e].groupedId===n)}function Ee(e,t,n){const{messageIds:r}=e.selectedMessages||{};if(!r)return!1;const u=Ce(e,t,n);return u&&u.every(e=>r.includes(e))}function Se(e){const{messageIds:t}=e.selectedMessages||{};return t?t.length:0}function Me(e,t){const n=l(e,t);if(!n)return;if(!m(e,n))return;const r=x(e,t),u=$(e,t,o.MAIN_THREAD_ID);if(!r||!u)return;const c=Object(M.g)(u,e=>!r[e].isOutgoing&&Boolean(r[e].keyboardButtons)),d=Object(M.g)(u,e=>Boolean(r[e].shouldHideKeyboardButtons));return c&&d&&d>c?void 0:c?r[c]:void 0}function Ae(e,t,n,r){const{shouldAutoDownloadMediaFromContacts:u,shouldAutoDownloadMediaInPrivateChats:o,shouldAutoDownloadMediaInGroups:c,shouldAutoDownloadMediaInChannels:a}=e.settings.byKey;return Boolean(o&&Object(d.ob)(n.id)||c&&Object(d.nb)(n)||a&&Object(d.mb)(n)||u&&r&&(r.id===e.currentUserId||function(e,t){return e.contactList&&e.contactList.userIds.includes(t.id)}(e,r)))}function ke(e,t){const n=Object(d.Q)(t)||Object(d.T)(t);if(!n)return;const{shouldAutoPlayVideos:r,shouldAutoPlayGifs:u}=e.settings.byKey,o=n.isGif||n.isRound;return r&&!o||u&&o}function Te(e){return e.settings.byKey.shouldLoopStickers}function Ne(e){const{chatId:t,threadId:n}=D(e)||{};if(!t||!n)return;const r=Object(d.a)(t,n),u=e.localTextSearch.byChatThreadKey[r];return u&&u.isActive?u:void 0}function Pe(e){const{byChatId:t}=e.localMediaSearch,{chatId:n}=D(e)||{},r=e.users.selectedId;return r&&t[r]?r:n}function De(e){const t=Pe(e);if(t)return e.localMediaSearch.byChatId[t]}function Le(e,t){return e.management.byChatId[t]}function xe(e){const{chatId:t,threadId:n}=D(e)||{};if(!t||!n)return;if(Object(d.ob)(t))return"user";const r=l(e,t);return r?Object(d.nb)(r)?"group":"channel":void 0}function Fe(e){const{mediaViewer:t}=e;return Boolean(t.messageId||t.avatarOwnerId)}function Be(e){const{users:t,isChatInfoShown:n,newChatMembersProgress:o}=e,c=o!==r.i.Closed,d=function(e){const{pollResults:t}=e;return Boolean(t.messageId)}(e),a=Boolean(!u.l&&Ne(e)),i=function(e){const{chatId:t,threadId:n}=D(e)||{};if(!t||!n)return;const r=e.management.byChatId[t];return r&&r.isActive?r:void 0}(e),s=void 0!==A(e).query,f=void 0!==k(e).query,{chatId:l}=D(e)||{},b=t.selectedId,h=O(e),m=Boolean(b&&h),p=Boolean(l&&h)&&n;return d?r.m.PollResults:a?r.m.Search:i?r.m.Management:s?r.m.StickerSearch:f?r.m.GifSearch:c?r.m.AddingMembers:m?r.m.UserInfo:p?r.m.ChatInfo:void 0}function Re(e){return void 0!==Be(e)}function Ue(e){const{theme:t,shouldUseSystemTheme:n}=e.settings.byKey;return n?Object(u.s)():t}function _e(e){return e.globalSearch.query}function $e(e){return e.payment.messageId}function Ge(e){return e.payment.formId}function We(e){return e.payment.nativeParams?e.payment.nativeParams.publishableKey:void 0}function He(e){return e.payment.stripeCredentials}},function(e,t,n){"use strict";var r=n(69);n.o(r,"ApiMediaFormat")&&n.d(t,"ApiMediaFormat",(function(){return r.ApiMediaFormat})),n.o(r,"ApiMessageEntityTypes")&&n.d(t,"ApiMessageEntityTypes",(function(){return r.ApiMessageEntityTypes})),n.o(r,"MAIN_THREAD_ID")&&n.d(t,"MAIN_THREAD_ID",(function(){return r.MAIN_THREAD_ID})),n.o(r,"MESSAGE_DELETED")&&n.d(t,"MESSAGE_DELETED",(function(){return r.MESSAGE_DELETED}));var u=n(70);n.o(u,"ApiMediaFormat")&&n.d(t,"ApiMediaFormat",(function(){return u.ApiMediaFormat})),n.o(u,"ApiMessageEntityTypes")&&n.d(t,"ApiMessageEntityTypes",(function(){return u.ApiMessageEntityTypes})),n.o(u,"MAIN_THREAD_ID")&&n.d(t,"MAIN_THREAD_ID",(function(){return u.MAIN_THREAD_ID})),n.o(u,"MESSAGE_DELETED")&&n.d(t,"MESSAGE_DELETED",(function(){return u.MESSAGE_DELETED}));var o=n(71);n.d(t,"ApiMessageEntityTypes",(function(){return o.a})),n.d(t,"MAIN_THREAD_ID",(function(){return o.b})),n.d(t,"MESSAGE_DELETED",(function(){return o.c}));var c=n(72);n.o(c,"ApiMediaFormat")&&n.d(t,"ApiMediaFormat",(function(){return c.ApiMediaFormat}));var d=n(73);n.d(t,"ApiMediaFormat",(function(){return d.a}));n(74),n(75),n(76),n(77)},function(e,t,n){"use strict";t.a=(...e)=>e.filter(Boolean).join(" ")},function(e,t,n){"use strict";function r(e,t,n=!0,r=!0){let u;return(...o)=>{u?(clearTimeout(u),u=void 0):n&&e(...o),u=self.setTimeout(()=>{r&&e(...o),u=void 0},t)}}function u(e,t,n=!0){let r,u,o;return(...c)=>{u=!0,o=c,r||(n&&(u=!1,e(...o)),r=self.setInterval(()=>{if(!u)return self.clearInterval(r),void(r=void 0);u=!1,e(...o)},t))}}function o(e){return d(m,e)}function c(e){return d(p,e)}function d(e,t){let n,r=!1;return(...u)=>{n=u,r||(r=!0,e(()=>{r=!1,t(...n)}))}}function a(e){Promise.resolve().then(e)}function i(e){self.requestIdleCallback?self.requestIdleCallback(e):a(e)}n.d(t,"a",(function(){return r})),n.d(t,"h",(function(){return u})),n.d(t,"j",(function(){return o})),n.d(t,"i",(function(){return c})),n.d(t,"e",(function(){return a})),n.d(t,"d",(function(){return i})),n.d(t,"f",(function(){return s})),n.d(t,"g",(function(){return f})),n.d(t,"b",(function(){return m})),n.d(t,"c",(function(){return g}));const s=e=>new Promise(t=>{setTimeout(()=>t(),e)});function f(){return new Promise(e=>{m(e)})}let l,b,h;function m(e,t=!1){l?t?b.push(e):l.push(e):(l=t?[]:[e],b=t?[e]:[],requestAnimationFrame(()=>{const e=l,t=b;l=void 0,b=void 0,t.forEach(e=>e()),e.forEach(e=>e())}))}function p(e){m(e,!0)}function g(e,t=!1){return h||(h=[],self.addEventListener("beforeunload",()=>{h.forEach(e=>e())})),t?h.push(e):h.unshift(e),()=>{h=h.filter(t=>t!==e)}}},function(e,t,n){"use strict";n.d(t,"s",(function(){return o})),n.d(t,"J",(function(){return c})),n.d(t,"t",(function(){return d})),n.d(t,"I",(function(){return i})),n.d(t,"N",(function(){return s})),n.d(t,"c",(function(){return f})),n.d(t,"L",(function(){return l})),n.d(t,"K",(function(){return b})),n.d(t,"O",(function(){return p})),n.d(t,"y",(function(){return v})),n.d(t,"d",(function(){return O})),n.d(t,"b",(function(){return j})),n.d(t,"M",(function(){return w})),n.d(t,"fb",(function(){return I})),n.d(t,"k",(function(){return C})),n.d(t,"l",(function(){return E})),n.d(t,"W",(function(){return S})),n.d(t,"eb",(function(){return M})),n.d(t,"h",(function(){return k})),n.d(t,"A",(function(){return T})),n.d(t,"lb",(function(){return N})),n.d(t,"mb",(function(){return P})),n.d(t,"v",(function(){return D})),n.d(t,"Q",(function(){return L})),n.d(t,"P",(function(){return x})),n.d(t,"n",(function(){return F})),n.d(t,"H",(function(){return B})),n.d(t,"o",(function(){return R})),n.d(t,"jb",(function(){return U})),n.d(t,"ib",(function(){return _})),n.d(t,"R",(function(){return $})),n.d(t,"r",(function(){return G})),n.d(t,"kb",(function(){return W})),n.d(t,"p",(function(){return H})),n.d(t,"z",(function(){return K})),n.d(t,"ob",(function(){return J})),n.d(t,"rb",(function(){return Q})),n.d(t,"g",(function(){return Y})),n.d(t,"gb",(function(){return Z})),n.d(t,"m",(function(){return X})),n.d(t,"pb",(function(){return ee})),n.d(t,"qb",(function(){return te})),n.d(t,"S",(function(){return ue})),n.d(t,"T",(function(){return oe})),n.d(t,"V",(function(){return ce})),n.d(t,"U",(function(){return de})),n.d(t,"Z",(function(){return se})),n.d(t,"u",(function(){return fe})),n.d(t,"ab",(function(){return le})),n.d(t,"Y",(function(){return he})),n.d(t,"X",(function(){return me})),n.d(t,"cb",(function(){return ge})),n.d(t,"bb",(function(){return ye})),n.d(t,"w",(function(){return ve})),n.d(t,"x",(function(){return Oe})),n.d(t,"f",(function(){return je})),n.d(t,"e",(function(){return we})),n.d(t,"db",(function(){return Ie})),n.d(t,"a",(function(){return Ce})),n.d(t,"q",(function(){return Ee})),n.d(t,"nb",(function(){return Se})),n.d(t,"hb",(function(){return Me})),n.d(t,"F",(function(){return Ae})),n.d(t,"D",(function(){return ke})),n.d(t,"B",(function(){return Te})),n.d(t,"G",(function(){return Ne})),n.d(t,"C",(function(){return Pe})),n.d(t,"E",(function(){return De})),n.d(t,"i",(function(){return Le})),n.d(t,"j",(function(){return xe}));var r=n(2),u=n(3);function o(e,t,n){return{...e,chats:{...e.chats,listIds:{...e.chats.listIds,[t]:n}}}}function c(e,t,n){const{[t]:r}=e.chats.listIds,u=r&&r.length?n.filter(e=>!r.includes(e)):n;return r&&!u.length?e:o(e,t,[...r||[],...u])}function d(e,t){return{...e,chats:{...e.chats,byId:t}}}function a(e,t,n,r){const{byId:o}=e.chats,c=o[t],d=n.isMin&&c&&!c.isMin,a={...c,...d?Object(u.j)(n,["isMin","accessHash"]):n,...r&&{photos:[r,...c.photos||[]]}};return a.id&&a.type,a}function i(e,t,n,r){const{byId:u}=e.chats;return d(e,{...u,[t]:a(e,t,n,r)})}function s(e,t){const n=Object.keys(t).map(Number).reduce((n,r)=>{const u=a(e,r,t[r]);return u&&(n[r]=u),n},{});return e=d(e,{...e.chats.byId,...n})}function f(e,t){const{byId:n}=e.chats;let r=!1;const u=Object.keys(t).map(Number).reduce((u,o)=>{if(!n[o]||n[o].isMin&&!t[o].isMin){const n=a(e,o,t[o]);n&&(u[o]=n,r||(r=!0))}return u},{});return r&&(e=d(e,{...e.chats.byId,...u})),e}function l(e,t,n){const u=n===r.i?"archived":"active";let o=e.chats.listIds;return Object.keys(o).forEach(e=>{const n=o[e]||[];e!==u||n.includes(t)?e!==u&&n.includes(t)&&(o={...o,[e]:n.filter(e=>e!==t)}):o={...o,[e]:[...n,t]}}),e=i(e={...e,chats:{...e.chats,listIds:o}},t,{folderId:n||void 0})}function b(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}}}}var h=n(8),m=n(7);function p(e,t,n=h.MAIN_THREAD_ID,u="thread",o){const{messageLists:c}=e.messages;let d=c;if(o||r.N)d=t?[{chatId:t,threadId:n,type:u}]:[];else if(t){const e=c[c.length-1];e&&e.chatId===t&&e.threadId===n&&e.type===u||(d=e&&-1===e.chatId?[...c.slice(0,-1),{chatId:t,threadId:n,type:u}]:[...c,{chatId:t,threadId:n,type:u}])}else d=c.slice(0,-1);return{...e,messages:{...e.messages,messageLists:d}}}function g(e,t,n){return y(e,t,{byId:n})}function y(e,t,n){const r=e.messages.byChatId[t]||{byId:{},threadsById:{}};return{...e,messages:{...e.messages,byChatId:{...e.messages.byChatId,[t]:{...r,...n}}}}}function v(e,t,n,r,u){return function(e,t,n,r){const u=e.messages.byChatId[t];return y(e,t,{threadsById:{...u&&u.threadsById,[n]:{...u&&u.threadsById[n],...r}}})}(e,t,n,{[r]:u})}function O(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).map(Number).forEach(t=>{e=j(e,t,n[t])}),e}function j(e,t,n){const r=Object(m.n)(e,t);return r&&Object.keys(n).every(e=>Boolean(r[Number(e)]))?e:g(e,t,{...n,...r})}function w(e,t,n,r){const u=Object(m.n)(e,t)||{},o={...u[n],...r};return o.id?g(e,t,{...u,[n]:o}):e}function I(e,t,n,r){const u=Object(m.sb)(e,t)||{},o={...u[n],...r};return o.id?D(e,t,{...u,[n]:o},void 0):e}function C(e,t,n){const r=Object(m.n)(e,t);if(!r)return e;const o=Object(u.j)(r,n),c=Object.values(Object(u.m)(r,n)).filter(({forwardInfo:e})=>e&&e.isLinkedChannelPost);if(Object.keys(e.messages.byChatId[t].threadsById).map(Number).forEach(r=>{const u=Object(m.Fb)(e,t,r);let o=Object(m.Z)(e,t,r),c=Object(m.hb)(e,t,r),d=Object(m.Kb)(e,t,r),a=Object(m.kb)(e,t),i=u?u.messagesCount:void 0;n.forEach(e=>{o&&o.includes(e)&&(o=o.filter(t=>t!==e),void 0!==i&&(i-=1)),c&&c.includes(e)&&(c=c.filter(t=>t!==e)),d&&d.includes(e)&&(d=d.filter(t=>t!==e)),a&&a.includes(e)&&(a=a.filter(t=>t!==e))}),e=v(e,t,r,"listedIds",o),e=v(e,t,r,"outlyingIds",c),e=v(e,t,r,"viewportIds",d),e=v(e,t,r,"pinnedIds",a),u&&void 0!==i&&(e=v(e,t,r,"threadInfo",{...u,messagesCount:i}))}),c.length){const n=Object(m.z)(e),r=n&&n.chatId===t&&"thread"===n.type,u=n&&n.threadId;c.forEach(n=>{const{fromChatId:o,fromMessageId:c}=n.forwardInfo,d=Object(m.l)(e,o,c);r&&u===c&&(e=p(e,t)),d&&(e=w(e,o,c,{threadInfo:void 0}))})}return e=g(e,t,o)}function E(e,t,n){const r=Object(m.sb)(e,t);if(!r)return e;const o=Object(u.j)(r,n);let c=Object(m.qb)(e,t);return c&&(n.forEach(e=>{c.includes(e)&&(c=c.filter(t=>t!==e))}),e=v(e,t,h.MAIN_THREAD_ID,"scheduledIds",c)),e=D(e,t,o,void 0)}function S(e,t,n,r){const u=Object(m.Z)(e,t,n),o=u&&u.length?r.filter(e=>!u.includes(e)):r;return u&&!o.length?e:v(e,t,n,"listedIds",A([...u||[],...o]))}function M(e,t,n,r){const u=Object(m.hb)(e,t,n),o=u&&u.length?r.filter(e=>!u.includes(e)):r;return u&&!o.length?e:v(e,t,n,"outlyingIds",A([...u||[],...o]))}function A(e){return e.sort((e,t)=>e-t)}function k(e,t,n,u){const o=Object(m.Kb)(e,t,n)||[];if(o.includes(u))return e;return v(e,t,n,"viewportIds",A([...o.length{e=N(e,t.chatId,t.threadId,t)}),e}function D(e,t,n,r){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,hash:r})}function L(e,t,n,r=!1){return{...e,focusedMessage:{...e.focusedMessage,chatId:t,messageId:n,noHighlight:r}}}function x(e,t){return{...e,focusedMessage:{...e.focusedMessage,direction:t}}}function F(e,t,n){return{...e,selectedMessages:{chatId:t,messageIds:n?Array.prototype.concat([],n):[]}}}function B(e,t,n,r,o,c,d,a=!1){const{selectedMessages:i}=e;c&&(d=Object(m.bb)(e,t,c));const s=d||[o];if(!i)return F(e,t,s);const{messageIds:f}=i;let l;const b=s.filter(e=>!f.includes(e));if(b&&!b.length)l=f.filter(e=>!s.includes(e));else if(a&&f.length){const c=Object(m.y)(e,t,n,r),d=c.indexOf(f[f.length-1]),a=c.indexOf(o),i=Math.min(d,a),s=Math.max(d,a),b=c.slice(i,s+1);l=Object(u.o)([...f,...b])}else l=[...f,...b];return l.length?{...e,selectedMessages:{...i,messageIds:l}}:R(e)}function R(e){return{...e,selectedMessages:void 0}}function U(e,t,n,r,o){const c=r.map(t=>{const n=e.stickers.setsById[t.id];return n?{...n,...t}:t});return{...e,stickers:{...e.stickers,setsById:{...e.stickers.setsById,...Object(u.c)(c,"id")},[t]:{...e.stickers[t],hash:n,..."search"===t?{resultIds:o}:{setIds:r.map(({id:e})=>e)}}}}}function _(e,t,n){const r=e.stickers.setsById[t]||{};return{...e,stickers:{...e.stickers,setsById:{...e.stickers.setsById,[t]:{...r,...n}}}}}function $(e,t,n,r){const{results:u}=e.gifs.search;let o;if(t||!u)o=n;else{const e=new Set(u.map(e=>e.id));o=[...u,...n.filter(t=>!e.has(t.id))]}return{...e,gifs:{...e.gifs,search:{...e.gifs.search,offset:r,results:o}}}}function G(e,t){return{...e,animatedEmojis:t}}function W(e,t,n,r){const o=[...Object(m.Ab)(e,t),...n||[]],c=Object(u.o)(o.map(({id:e})=>e)),d=Object(u.c)(o,"id"),a=c.map(e=>d[e]);return{...e,stickers:{...e.stickers,forEmoji:{emoji:t,stickers:a,hash:r}}}}function H(e){const{emoji:t,stickers:n,hash:r}=e.stickers.forEmoji||{};return t?W(e,t,n,r):e}var z=n(51);function K(e,t){return{...e,users:{...e.users,byId:t}}}function V(e,t,n){const{byId:r}=e.users,o=r[t],c=n.isMin&&o&&!o.isMin,d={...o,...c?Object(u.j)(n,["isMin","accessHash"]):n};return d.id&&d.type?d:o}function q(e,t){const{hash:n,userIds:r}=e.contactList||{};if(!r)return e;const u=t.filter(e=>e&&e.isContact&&!r.includes(e.id)).map(e=>e.id);return 0===u.length?e:{...e,contactList:{hash:n||0,userIds:[...u,...r]}}}function J(e,t,n){const{byId:r}=e.users,u=V(e,t,n);return K(e=q(e,[u]),{...r,[t]:u})}function Q(e,t){const n=Object.keys(t).map(Number).reduce((n,r)=>{const u=V(e,r,t[r]);return u&&(n[r]=u),n},{});return e=K(e=q(e,Object.values(n)),{...e.users.byId,...n})}function Y(e,t){const{byId:n}=e.users;let r=!1;const u=Object.keys(t).map(Number).reduce((u,o)=>{if(!n[o]||n[o].isMin&&!t[o].isMin){const n=V(e,o,t[o]);n&&(u[o]=n,r||(r=!0))}return u},{});return r&&(e=q(e=K(e,{...e.users.byId,...u}),Object.values(u))),e}function Z(e,t){return e.users.selectedId===t?e:{...e,users:{...e.users,selectedId:t}}}function X(e,t){const{byId:n}=e.users,{hash:r,userIds:u}=e.contactList||{};return delete n[t],K(e={...e,contactList:{hash:r||0,userIds:u?u.filter(e=>e!==t):z.a}},n)}function ee(e,t){return{...e,userSearch:{...e.userSearch,...t}}}function te(e,t){return ee(e,{fetchingStatus:t})}function ne(e,t,n){const{byId:r}=e.users,u=r[t];return u&&u.fullInfo?J(e,t,{...u,fullInfo:{...u.fullInfo,isBlocked:n}}):e}const re=e=>`${e.chatId}_${e.id}`;function ue(e,t){return{...e,globalSearch:{...e.globalSearch,...t}}}function oe(e,t){return ue(e,{currentContent:t})}function ce(e,t,n,r,o){const{resultsByType:c}=e.globalSearch||{},d=t.reduce((e,t)=>(e[re(t)]=t,e),{}),a=c&&c[r]?c[r].foundIds:void 0;if(void 0!==a&&Object.keys(d).every(e=>a.includes(re(d[e]))))return de(e,{messages:!1});const i=a||[],s=t.map(e=>re(e)),f=Array.prototype.concat(i,s),l=Object(u.a)(i,f)?i:f;return ue(e=de(e,{messages:!1}),{resultsByType:{...(e.globalSearch||{}).resultsByType,[r]:{totalCount:n,nextOffsetId:o,foundIds:l}}})}function de(e,t){return ue(e,{fetchingStatus:{...e.globalSearch.fetchingStatus,...t}})}var ae=n(4);function ie(e,t,n){return{...e,localTextSearch:{byChatThreadKey:{...e.localTextSearch.byChatThreadKey,[t]:n}}}}function se(e,t,n,r,u){const o=Object(ae.a)(t,n);return ie(e,o,{...e.localTextSearch.byChatThreadKey[o],isActive:r,query:u})}function fe(e,t,n,r,u,o){const c=Object(ae.a)(t,n);return ie(e,c,{...e.localTextSearch.byChatThreadKey[c],results:{foundIds:r,totalCount:u,nextOffsetId:o}})}function le(e,t,n,r,o,c){const d=Object(ae.a)(t,n),{results:a}=e.localTextSearch.byChatThreadKey[d]||{},i=a&&a.foundIds||[],s=pe(Object(u.o)(Array.prototype.concat(i,r)));return fe(e,t,n,Object(u.a)(i,s)?i:s,o,c)}function be(e,t,n){return{...e,localMediaSearch:{byChatId:{...e.localMediaSearch.byChatId,[t]:n}}}}function he(e,t,n){return be(e,t,{...e.localMediaSearch.byChatId[t],currentType:n})}function me(e,t,n,r,o,c){const{resultsByType:d}=e.localMediaSearch.byChatId[t]||{},a=d&&d[n]?d[n].foundIds:[],i=pe(Object(u.o)(Array.prototype.concat(a,r)));return function(e,t,n,r,u,o){return be(e,t,{...e.localMediaSearch.byChatId[t],resultsByType:{...(e.localMediaSearch.byChatId[t]||{}).resultsByType,[n]:{foundIds:r,totalCount:u,nextOffsetId:o}}})}(e,t,n,Object(u.a)(a,i)?a:i,o,c)}function pe(e){return e.sort((e,t)=>e-t)}function ge(e,t){return{...e,management:{...e.management,progress:t}}}function ye(e,t,n){return{...e,management:{...e.management,byChatId:{...e.management.byChatId,[t]:{...e.management.byChatId[t]||{},...n}}}}}function ve(e,t){return{...e,settings:{...e.settings,byKey:{...e.settings.byKey,...t}}}}function Oe(e,t,n){return{...e,settings:{...e.settings,themes:{...e.settings.themes,[t]:{...e.settings.themes[t]||{},...n}}}}}function je(e,t){return t.forEach(t=>{const{chatId:n,...r}=t;e=we(e,n,r)}),e}function we(e,t,n){return{...e,settings:{...e.settings,notifyExceptions:{...e.settings.notifyExceptions,[t]:n}}}}function Ie(e,t,n,r){switch(t){case"contact":return ve(e,{...void 0!==n&&{hasPrivateChatsNotifications:!n},...void 0!==r&&{hasPrivateChatsMessagePreview:r}});case"group":return ve(e,{...void 0!==n&&{hasGroupNotifications:!n},...void 0!==r&&{hasGroupMessagePreview:r}});case"broadcast":return ve(e,{...void 0!==n&&{hasBroadcastNotifications:!n},...void 0!==r&&{hasBroadcastMessagePreview:r}});default:return}}function Ce(e,t){return e=ne(e,t,!0),{...e,blocked:{...e.blocked,ids:[t,...e.blocked.ids],totalCount:e.blocked.totalCount+1}}}function Ee(e,t){return e=ne(e,t,!1),{...e,blocked:{...e.blocked,ids:e.blocked.ids.filter(e=>e!==t),totalCount:e.blocked.totalCount-1}}}function Se(e,t){return{...e,twoFaSettings:{...e.twoFaSettings,...t}}}function Me(e,t){return{...e,payment:{...e.payment,shippingOptions:t}}}function Ae(e,t){return{...e,payment:{...e.payment,formId:t}}}function ke(e,t){return{...e,payment:{...e.payment,step:t}}}function Te(e,t){if(!t.content||!t.content.invoice)return e;const{title:n,text:r,description:u,photoUrl:o}=t.content.invoice;return{...e,payment:{...e.payment,invoiceContent:{title:n,text:r,description:u,photoUrl:o}}}}function Ne(e,t){return{...e,payment:{...e.payment,stripeCredentials:{...t}}}}function Pe(e,t){return{...e,payment:{...e.payment,...t}}}function De(e,t,n){if(!t||!n)return{...e,payment:{...e.payment,receipt:void 0}};const{invoice:r}=n.content,{photoUrl:u,text:o,title:c}=r||{};return{...e,payment:{...e.payment,receipt:{...t,photoUrl:u,text:o,title:c}}}}function Le(e){return{...e,payment:{}}}function xe(e){return{...e,payment:{...e.payment,isPaymentModalOpen:!1}}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return u})),n.d(t,"c",(function(){return o})),n.d(t,"d",(function(){return c})),n.d(t,"b",(function(){return d}));const r=self.caches;let u;async function o(e,t,n){if(r)try{const o=new Request(t.replace(/:/g,"_")),c=await r.open(e),d=await c.match(o);if(!d)return;switch(n){case u.Text:return await d.text();case u.Blob:{const e=await d.blob();if("sticker"===t.substr(0,7))return new Blob([e],{type:"image/webp"});if(!e.type){const t=d.headers.get("Content-Type");if(t)return new Blob([e],{type:t})}return e}case u.Json:return await d.json();default:return}}catch(e){return void console.warn(e)}}async function c(e,t,n){if(r)try{const u="string"==typeof n||n instanceof Blob?n:JSON.stringify(n),o=new Request(t.replace(/:/g,"_")),c=new Response(u),d=await r.open(e);return await d.put(o,c)}catch(e){return void console.warn(e)}}async function d(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"}(u||(u={}))},function(e,t,n){"use strict";let r,u,o,c,d,a,i,s,f,l,b,h,m;n.d(t,"e",(function(){return r})),n.d(t,"b",(function(){return u})),n.d(t,"n",(function(){return o})),n.d(t,"d",(function(){return c})),n.d(t,"c",(function(){return d})),n.d(t,"m",(function(){return a})),n.d(t,"h",(function(){return i})),n.d(t,"a",(function(){return s})),n.d(t,"k",(function(){return f})),n.d(t,"f",(function(){return l})),n.d(t,"i",(function(){return b})),n.d(t,"l",(function(){return h})),n.d(t,"j",(function(){return m})),n.d(t,"o",(function(){return p})),n.d(t,"g",(function(){return g})),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"}(u||(u={})),function(e){e[e.Main=0]="Main",e[e.EditProfile=1]="EditProfile",e[e.Notifications=2]="Notifications",e[e.Language=3]="Language",e[e.General=4]="General",e[e.GeneralChatBackground=5]="GeneralChatBackground",e[e.GeneralChatBackgroundColor=6]="GeneralChatBackgroundColor",e[e.Privacy=7]="Privacy",e[e.PrivacyPhoneNumber=8]="PrivacyPhoneNumber",e[e.PrivacyLastSeen=9]="PrivacyLastSeen",e[e.PrivacyProfilePhoto=10]="PrivacyProfilePhoto",e[e.PrivacyForwarding=11]="PrivacyForwarding",e[e.PrivacyGroupChats=12]="PrivacyGroupChats",e[e.PrivacyPhoneNumberAllowedContacts=13]="PrivacyPhoneNumberAllowedContacts",e[e.PrivacyPhoneNumberDeniedContacts=14]="PrivacyPhoneNumberDeniedContacts",e[e.PrivacyLastSeenAllowedContacts=15]="PrivacyLastSeenAllowedContacts",e[e.PrivacyLastSeenDeniedContacts=16]="PrivacyLastSeenDeniedContacts",e[e.PrivacyProfilePhotoAllowedContacts=17]="PrivacyProfilePhotoAllowedContacts",e[e.PrivacyProfilePhotoDeniedContacts=18]="PrivacyProfilePhotoDeniedContacts",e[e.PrivacyForwardingAllowedContacts=19]="PrivacyForwardingAllowedContacts",e[e.PrivacyForwardingDeniedContacts=20]="PrivacyForwardingDeniedContacts",e[e.PrivacyGroupChatsAllowedContacts=21]="PrivacyGroupChatsAllowedContacts",e[e.PrivacyGroupChatsDeniedContacts=22]="PrivacyGroupChatsDeniedContacts",e[e.PrivacyActiveSessions=23]="PrivacyActiveSessions",e[e.PrivacyBlockedUsers=24]="PrivacyBlockedUsers",e[e.Folders=25]="Folders",e[e.FoldersCreateFolder=26]="FoldersCreateFolder",e[e.FoldersEditFolder=27]="FoldersEditFolder",e[e.FoldersEditFolderFromChatList=28]="FoldersEditFolderFromChatList",e[e.FoldersIncludedChats=29]="FoldersIncludedChats",e[e.FoldersIncludedChatsFromChatList=30]="FoldersIncludedChatsFromChatList",e[e.FoldersExcludedChats=31]="FoldersExcludedChats",e[e.FoldersExcludedChatsFromChatList=32]="FoldersExcludedChatsFromChatList",e[e.TwoFaDisabled=33]="TwoFaDisabled",e[e.TwoFaNewPassword=34]="TwoFaNewPassword",e[e.TwoFaNewPasswordConfirm=35]="TwoFaNewPasswordConfirm",e[e.TwoFaNewPasswordHint=36]="TwoFaNewPasswordHint",e[e.TwoFaNewPasswordEmail=37]="TwoFaNewPasswordEmail",e[e.TwoFaNewPasswordEmailCode=38]="TwoFaNewPasswordEmailCode",e[e.TwoFaEnabled=39]="TwoFaEnabled",e[e.TwoFaChangePasswordCurrent=40]="TwoFaChangePasswordCurrent",e[e.TwoFaChangePasswordNew=41]="TwoFaChangePasswordNew",e[e.TwoFaChangePasswordConfirm=42]="TwoFaChangePasswordConfirm",e[e.TwoFaChangePasswordHint=43]="TwoFaChangePasswordHint",e[e.TwoFaTurnOff=44]="TwoFaTurnOff",e[e.TwoFaRecoveryEmailCurrentPassword=45]="TwoFaRecoveryEmailCurrentPassword",e[e.TwoFaRecoveryEmail=46]="TwoFaRecoveryEmail",e[e.TwoFaRecoveryEmailCode=47]="TwoFaRecoveryEmailCode",e[e.TwoFaCongratulations=48]="TwoFaCongratulations"}(o||(o={})),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"}(c||(c={})),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"}(d||(d={})),function(e){e[e.ChatInfo=0]="ChatInfo",e[e.UserInfo=1]="UserInfo",e[e.Search=2]="Search",e[e.Management=3]="Management",e[e.StickerSearch=4]="StickerSearch",e[e.GifSearch=5]="GifSearch",e[e.PollResults=6]="PollResults",e[e.AddingMembers=7]="AddingMembers"}(a||(a={})),function(e){e[e.Inline=0]="Inline",e[e.ScheduledInline=1]="ScheduledInline",e[e.SharedMedia=2]="SharedMedia",e[e.ProfileAvatar=3]="ProfileAvatar",e[e.MiddleHeaderAvatar=4]="MiddleHeaderAvatar",e[e.Album=5]="Album",e[e.ScheduledAlbum=6]="ScheduledAlbum",e[e.SearchResult=7]="SearchResult"}(i||(i={})),function(e){e[e.Idle=0]="Idle",e[e.InProgress=1]="InProgress",e[e.Complete=2]="Complete",e[e.Error=3]="Error"}(s||(s={})),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"}(l||(l={})),function(e){e[e.Closed=0]="Closed",e[e.InProgress=1]="InProgress",e[e.Loading=2]="Loading"}(b||(b={})),function(e){e[e.Profile=0]="Profile",e[e.SharedMedia=1]="SharedMedia",e[e.MemberList=2]="MemberList"}(h||(h={})),function(e){e[e.ShippingInfo=0]="ShippingInfo",e[e.Shipping=1]="Shipping",e[e.PaymentInfo=2]="PaymentInfo",e[e.Checkout=3]="Checkout"}(m||(m={}));const p="UPLOADING_WALLPAPER_SLUG";let g;!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.GroupUserPermissionsCreate=7]="GroupUserPermissionsCreate",e[e.GroupUserPermissions=8]="GroupUserPermissions",e[e.ChatAdministrators=9]="ChatAdministrators",e[e.GroupRecentActions=10]="GroupRecentActions",e[e.ChatAdminRights=11]="ChatAdminRights",e[e.GroupMembers=12]="GroupMembers"}(g||(g={}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return h})),n.d(t,"b",(function(){return y})),n.d(t,"c",(function(){return v})),n.d(t,"d",(function(){return O}));var r=n(2),u=n(12),o=n(5);var c=n(50),d=n(1);const a=/%\d?\$?[sdf@]/g,i=["value","zeroValue","oneValue","twoValue","fewValue","manyValue","otherValue"],s={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 l,b;const{addCallback:h,removeCallback:m,runCallbacks:p}=function(){const e=[];function t(t){const n=e.indexOf(t);-1!==n&&e.splice(n,1)}return{runCallbacks:function(...t){e.forEach(e=>{e(...t)})},addCallback:function(n){return e.push(n),()=>{t(n)}},removeCallback:t}}();let g;const y=(e,t,n)=>{if(void 0!==t){const r=Array.isArray(t)?JSON.stringify(t):t,u=f.get(`${e}_${r}_${n}`);if(u)return u}if(!l&&!b)return e;const r=l&&l[e]||b&&b[e];return r?w(r,e,t,n):(b||j(),e)};async function v(e,t){let n=await u.c(r.O,`${r.v}_${e}_${t}`,u.a.Json);return n||(n=await async function(e,t,n){const c=await Object(o.a)("fetchLangStrings",{langPack:e,langCode:t,keys:[n]});if(c&&c.length)return await u.d(r.O,`${e}_${t}_${n}`,c[0]),c[0];return}(r.v,e,t)),w(n,t)}async function O(e,t,n=!1){if(l&&e===g)return void(t&&t());let c=await u.c(r.O,e,u.a.Json);if(!c&&(n&&await j(),c=await async function(e){const t=await Object(o.a)("fetchLangPack",{sourceLangPacks:r.P,langCode:e});if(t)return await u.d(r.O,e,t.langPack),t.langPack;return}(e),!c))return;f.clear(),g=e,l=c,document.documentElement.lang=e;const{languages:a}=Object(d.e)().settings.byKey,i=a?a.find(t=>t.langCode===e):void 0;y.isRtl=Boolean(i&&i.rtl),y.code=e,t&&t(),p()}async function j(){b||(b=(await n.e(9).then(n.bind(null,332))).default,p())}function w(e,t,n,u){const o=e?e["number"==typeof n?function(e){const t=g||r.u,n=s[t]?s[t](e):0;return i[n]}(n):"value"]:void 0;if(!o||!o.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(a),r=n.shift();return n.reduce((e,n,r)=>`${e}${String(t[r]||"")}${n}`,r||"")}(o,"i"===u?Object(c.a)(n):n),r=Array.isArray(n)?JSON.stringify(n):n;return f.set(`${t}_${r}_${u}`,e),e}return o}},function(e,t,n){"use strict";n.d(t,"a",(function(){return u})),n.d(t,"d",(function(){return d})),n.d(t,"c",(function(){return a})),n.d(t,"b",(function(){return s}));var r=n(2);let u;!function(e){e[e.Auth=0]="Auth",e[e.Main=1]="Main",e[e.Extra=2]="Extra"}(u||(u={}));const o={},c={};async function d(e,t){if(!o[e]){switch(e){case u.Auth:o[u.Auth]=n.e(5).then(n.bind(null,107));break;case u.Main:r.r&&console.log(">>> START LOAD MAIN BUNDLE"),o[u.Main]=Promise.all([n.e(0),n.e(4)]).then(n.bind(null,105));break;case u.Extra:o[u.Extra]=Promise.all([n.e(0),n.e(3)]).then(n.bind(null,106))}o[e].then(f)}const d=await o[e];return c[e]||(c[e]=d),a(e,t)}function a(e,t){const n=c[e];if(n)return n[t]}const i=[];function s(e){i.includes(e)||i.push(e)}function f(){i.forEach(e=>{e()})}},function(e,t,n){"use strict";var r=n(14),u=n(31),o=n(52);t.a=()=>{const e=Object(u.a)();return Object(o.a)(()=>r.a(e),[e]),r.b}},function(e,t,n){"use strict";n.d(t,"d",(function(){return o})),n.d(t,"a",(function(){return c})),n.d(t,"b",(function(){return d})),n.d(t,"g",(function(){return a})),n.d(t,"h",(function(){return i})),n.d(t,"c",(function(){return s})),n.d(t,"e",(function(){return f})),n.d(t,"f",(function(){return l}));var r=n(10);function u(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}"undefined"==typeof File&&(self.File=class extends Blob{constructor(e,t,n){if(n){const{type:t,...r}=n;super(e,{type:t}),u(this,"name",void 0),Object.assign(this,r)}else super(e),u(this,"name",void 0);this.name=t}});function o(e){const t=e.split(","),n=t[0].match(/:(.*?);/)[1],r=atob(t[1]);let u=r.length;const o=new Uint8Array(u);for(;u--;)o[u]=r.charCodeAt(u);return new Blob([o],{type:n})}function c(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 d(e,t){return new File([e],t,{lastModified:Date.now(),type:e.type})}function a(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 s(e){const t=await i(e);return Promise.race([Object(r.f)(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 f(e){return(await fetch(e)).blob()}function l(e){const t=document.createElement("canvas");t.width=e.width,t.height=e.height;return t.getContext("2d").drawImage(e,0,0),t}},function(e,t,n){"use strict";function r(e){return new Promise((t,n)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>n(e.error)})}let u;function o(){return u||(u=function(e,t){const n=indexedDB.open(e);n.onupgradeneeded=()=>n.result.createObjectStore(t);const u=r(n);return(e,n)=>u.then(r=>n(r.transaction(t,e).objectStore(t)))}("keyval-store","keyval")),u}function c(e,t){return e("readonly",e=>(e.openCursor().onsuccess=function(){this.result&&(t(this.result),this.result.continue())},r(e.transaction)))}n.d(t,"c",(function(){return s})),n.d(t,"f",(function(){return f})),n.d(t,"b",(function(){return l})),n.d(t,"e",(function(){return b})),n.d(t,"d",(function(){return h})),n.d(t,"a",(function(){return m}));var d=n(2),a=n(12);const i=[1,2,3,4,5];function s(e=!1){if(e&&localStorage.getItem(d.Q))return!0;const t=localStorage.getItem(d.zb);if(!t)return!1;try{const e=JSON.parse(t);return Boolean(e&&e.id&&e.dcID)}catch(e){return!1}}function f(e,t){const{mainDcId:n,keys:r,hashes:u}=e;localStorage.setItem(d.zb,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]))}),Object.keys(u).map(Number).forEach(e=>{localStorage.setItem(`dc${e}_hash`,JSON.stringify(u[e]))})}function l(){[d.zb,"dc",...i.map(e=>`dc${e}_auth_key`),...i.map(e=>`dc${e}_hash`)].forEach(e=>{localStorage.removeItem(e)})}function b(){if(!s())return;const e=JSON.parse(localStorage.getItem(d.zb)),t=Number(e.dcID),n={},r={};return i.forEach(e=>{try{const t=localStorage.getItem(`dc${e}_auth_key`);t&&(n[e]=JSON.parse(t));const u=localStorage.getItem(`dc${e}_hash`);u&&(r[e]=JSON.parse(u))}catch(e){d.r&&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(d.Q);if(!e)return;const t=await function(e,t=o()){return t("readonly",t=>r(t.get(e)))}("GramJs:"+e);try{f(JSON.parse(t))}catch(e){d.r&&console.warn("Failed to load legacy session",e)}}async function m(){localStorage.removeItem(d.Q);const e=await function(e=o()){const t=[];return c(e,e=>t.push(e.key)).then(()=>t)}();await Promise.all([a.b("GramJs"),...e.filter(e=>"string"==typeof e&&e.startsWith("GramJs:GramJs-session-")).map(e=>function(e,t=o()){return t("readwrite",t=>(t.delete(e),r(t.transaction)))}(e))])}},function(e,t,n){"use strict";n.d(t,"b",(function(){return o}));const r=/\uFE0F/g,u=String.fromCharCode(8205);function o(e){return e.indexOf(u)<0?e.replace(r,""):e}t.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},function(e,t,n){"use strict";var r=n(0),u=n(26);n(96);t.a=Object(r.h)(({color:e="blue"})=>r.a.createElement("div",{className:"Loading"},r.a.createElement(u.a,{color:e,withBackground:"white"===e})))},function(e,t,n){"use strict";var r=n(0),u=n(9),o=n(26),c=n(44);n(94);t.a=({ref:e,type:t="button",onClick:n,onContextMenu:d,onMouseDown:a,onMouseEnter:i,onMouseLeave:s,onFocus:f,children:l,size:b="default",color:h="primary",className:m,round:p,pill:g,fluid:y,isText:v,isLoading:O,ariaLabel:j,href:w,download:I,disabled:C,ripple:E,faded:S,tabIndex:M,isRtl:A})=>{let k=Object(r.q)(null);e&&(k=e);const[T,N]=Object(r.r)(!1),P=Object(u.a)("Button",m,b,h,p&&"round",g&&"pill",y&&"fluid",C&&"disabled",v&&"text",O&&"loading",E&&"has-ripple",S&&"faded",T&&"clicked"),D=Object(r.m)(e=>{!C&&n&&n(e),N(!0),setTimeout(()=>{N(!1)},400)},[C,n]),L=Object(r.m)(e=>{e.preventDefault(),!C&&a&&a(e)},[a,C]);return w?r.a.createElement("a",{ref:k,className:P,href:w,title:j,download:I,tabIndex:M,dir:A?"rtl":void 0},l,!C&&E&&r.a.createElement(c.a,null)):r.a.createElement("button",{ref:k,type:t,className:P,onClick:D,onContextMenu:d,onMouseDown:L,onMouseEnter:i&&!C?i:void 0,onMouseLeave:s&&!C?s:void 0,onFocus:f&&!C?f:void 0,"aria-label":j,title:j,tabIndex:M,dir:A?"rtl":void 0},O?r.a.createElement("div",null,r.a.createElement("span",{dir:A?"auto":void 0},"Please wait.."),r.a.createElement(o.a,{color:v?"blue":"white"})):l,!C&&E&&r.a.createElement(c.a,null))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return b}));var r=n(0),u=n(19),o=n(2),c=n(6),d=n(66),a=n(9),i=n(78),s=n(59);const f=/^[\d\wа-яё]$/i,l=/(\*\*|__).+?\1/g;function b(e,t=["emoji"],n){return"string"!=typeof e?[e]:t.reduce((e,t)=>{switch(t){case"escape_html":return function(e){const t=document.createElement("div");return e.reduce((e,n)=>"string"!=typeof n?[...e,n]:(t.innerText=n,[...e,t.innerHTML]),[])}(e);case"hq_emoji":return u.a.lastIndex=0,h(e,"big","jsx");case"emoji":return u.a.lastIndex=0,h(e,"small","jsx");case"emoji_html":return u.a.lastIndex=0,h(e,"small","html");case"br":return m(e,"jsx");case"br_html":return m(e,"html");case"highlight":return o=e,c=n.highlight,o.reduce((e,t)=>{if("string"!=typeof t||!c)return[...e,t];const n=t.toLowerCase(),u=n.indexOf(c.toLowerCase()),o=n[u+c.length];if(u<0||o&&o.match(f))return[...e,t];const d=[];return d.push(t.substring(0,u)),d.push(r.a.createElement("span",{className:"matching-text-highlight"},t.substring(u,u+c.length))),d.push(t.substring(u+c.length)),[...e,...d]},[]);case"links":return function(e){return e.reduce((e,t)=>{if("string"!=typeof t)return[...e,t];const n=t.match(p);if(!n||!n.length)return[...e,t];const u=[];let o=n.shift(),c=0;for(;o;){const e=t.indexOf(o,c);u.push(t.substring(c,e)),o.startsWith("@")?u.push(r.a.createElement(i.a,{username:o},o)):(o.endsWith("?")&&(o=o.slice(0,o.length-1)),u.push(r.a.createElement(s.a,{text:o,url:o}))),c=e+o.length,o=n.shift()}return u.push(t.substring(c)),[...e,...u]},[])}(e);case"simple_markdown":return g(e,"jsx");case"simple_markdown_html":return g(e,"html")}var o,c;return e},[e])}function h(e,t,n){return c.d?e:e.reduce((e,o)=>{if("string"!=typeof o)return[...e,o];const c=o.split(u.a),i=o.match(u.a)||[];return e.push(c[0]),i.reduce((e,o,i)=>{const s=Object(d.a)(Object(u.b)(o)),f=Object(a.a)("emoji","small"===t&&"emoji-small");"jsx"===n&&e.push(r.a.createElement("img",{className:f,src:`./img-apple-${"big"===t?"160":"64"}/${s}.png`,alt:o})),"html"===n&&e.push(`${o}`);const l=2*i+2;return c[l]&&e.push(c[l]),e},e)},[])}function m(e,t){return e.reduce((e,n)=>"string"!=typeof n?[...e,n]:[...e,...n.split(/\r\n|\r|\n/g).reduce((e,n,u,o)=>{const c=n.trimLeft(),d=n.length-c.length;return e.push(String.fromCharCode(160).repeat(d)+c),u!==o.length-1&&e.push("jsx"===t?r.a.createElement("br",null):"
"),e},[])],[])}const p=new RegExp(`${o.rb}|${o.sb}`,"ig");function g(e,t){return e.reduce((e,n)=>{if("string"!=typeof n)return[...e,n];const u=n.split(l),o=n.match(l)||[];return e.push(u[0]),o.reduce((e,n,o)=>{"jsx"===t?e.push(n.startsWith("**")?r.a.createElement("b",null,n.replace(/\*\*/g,"")):r.a.createElement("i",null,n.replace(/__/g,""))):e.push(n.startsWith("**")?`${n.replace(/\*\*/g,"")}`:`${n.replace(/__/g,"")}`);const c=2*o+2;return u[c]&&e.push(u[c]),e},e)},[])}},function(e,t,n){"use strict";n.d(t,"d",(function(){return c})),n.d(t,"e",(function(){return d})),n.d(t,"b",(function(){return a})),n.d(t,"c",(function(){return i})),n.d(t,"a",(function(){return o}));const r={},u=/(\d{1,3})(\d{1,3})?(\d{1,3})?(\d{1,3})?(\d{1,3})?/;var o="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".split("\n").map(e=>({id:e.substr(0,2),flag:e.substr(2,4),code:"+"+e.match(/\d+/)[0],name:e.split(/\d+/)[1],phoneFormat:function(e){if(!e)return u;const t=e[0];let n;if(!r[t]){const e=t.split("").map(Number);n=e.reduce((e,t,n)=>`${e}(\\d{1,${t}})${n>0?"?":""}`,""),r[t]=new RegExp(`${n}${"()?".repeat(5-e.length)}`)}return r[t]}(e.match(/\d+$/))}));function c(e){return o.find(t=>t.id===e)}function d(e){let t=e.replace(/[^\d+]+/g,"");t.startsWith("+")||(t="+"+t);const n=o.filter(e=>t.startsWith(e.code)).sort((e,t)=>e.code.length-t.code.length);return n[n.length-1]}function a(e,t){let n=e.replace(/[^\d]+/g,"");if(t)n=n.substr(t.code.length-1);else if(e.startsWith("+"))return e;return n=n.replace(function(e){return e?e.phoneFormat:u}(t),(e,n,r,u,o,c)=>{const d=t&&"GB"===t.id?" ":"-";let a="";return n&&(a=""+n),r&&(a+=" "+r),u&&(a+=`${d}${u}`),o&&(a+=`${d}${o}`),c&&(a+=`${d}${c}`),a}),n}function i(e){const t=e.startsWith("+")?e:"+"+e,n=d(t);return n?`${n.code} ${a(t,n)}`:t}},function(e,t,n){"use strict";var r=n(0),u=n(15),o=n(31);t.a=(e,t,n=!1,c=!1)=>{const d=Object(u.c)(e,t),a=Object(o.a)();return c&&Object(u.b)(a),Object(r.n)(()=>{n||d||Object(u.d)(e,t).then(a)},[e,a,d,t,n]),d}},function(e,t,n){"use strict";var r=n(0);t.a=(e=!1)=>{const[t,n]=Object(r.r)(e);return[t,Object(r.m)(()=>{n(!0)},[]),Object(r.m)(()=>{n(!1)},[])]}},function(e,t,n){"use strict";var r=n(0),u=n(9);n(92);t.a=({color:e="blue",withBackground:t})=>r.a.createElement("div",{className:Object(u.a)("Spinner",e,t&&"with-background")},r.a.createElement("div",null))},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));n(2);var r=n(10);window.addEventListener("error",u),window.addEventListener("unhandledrejection",u);function u(e){e.preventDefault(),o(e instanceof ErrorEvent?e.error:e.reason)}Object(r.h)(window.alert,1e3);function o(e){console.error(e)}},function(e,t,n){"use strict";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 u=0;u(e[r]!==t[r]&&n.push(`${r}: ${e[r]} => ${t[r]}`),n),[])}n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return u}))},function(e,t,n){"use strict";var r=n(0);t.a=function(e,t){const n=Object(r.q)(),{current:u}=n;return t&&void 0===e||(n.current=e),u}},function(e,t,n){"use strict";n.d(t,"j",(function(){return c})),n.d(t,"k",(function(){return d})),n.d(t,"n",(function(){return a})),n.d(t,"h",(function(){return s})),n.d(t,"g",(function(){return f})),n.d(t,"b",(function(){return l})),n.d(t,"f",(function(){return b})),n.d(t,"c",(function(){return h})),n.d(t,"d",(function(){return p})),n.d(t,"e",(function(){return g})),n.d(t,"i",(function(){return y})),n.d(t,"a",(function(){return v})),n.d(t,"l",(function(){return j})),n.d(t,"m",(function(){return w}));const r=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],u=["January","February","March","April","May","June","July","August","September","October","November","December"],o=u.map(e=>e.toLowerCase());function c(e){const t=new Date(e);return t.setHours(0,0,0,0),t}function d(e){return c(e).getTime()}function a(e){const t=new Date(1e3*e);return`${t.getFullYear()}-${t.getMonth()}`}function i(e){return`${e.getFullYear()}-${e.getMonth()+1}-${e.getDate()}`}function s(e){const t="number"==typeof e?new Date(e):e;return`${String(t.getHours()).padStart(2,"0")}:${String(t.getMinutes()).padStart(2,"0")}`}function f(e,t){const n="number"==typeof t?new Date(t):t,u=c(new Date);if(n>=u)return s(n);const o=new Date(u);if(o.setDate(u.getDate()-7),n>=o)return e("Weekday.Short"+r[n.getDay()]);const d=n.getFullYear()!==u.getFullYear(),a=e(d?"formatDateScheduleYear":"formatDateSchedule")||(d?"d MMM yyyy":"d MMM");return m(e,n,a)}function l(e,t){const n="number"==typeof t?new Date(t):t,r=e("formatterYearMax")||"dd.MM.yyyy";return m(e,n,r)}function b(e,t,n=!1){const r=e(n?"formatterMonthYear2":"formatterMonthYear")||"MMM yyyy";return m(e,t,r)}function h(e,t,n=!1,u=!1){const o="number"==typeof t?new Date(t):t,d=c(new Date);if(!u){if(i(o)===i(d))return(n?I:C)(e("Weekday.Today"));const t=new Date(d);if(t.setDate(d.getDate()-1),i(o)===i(t))return(n?I:C)(e("Weekday.Yesterday"));const u=new Date(d),c=new Date(d);if(u.setDate(d.getDate()-7),c.setDate(d.getDate()+7),o>=u&&o<=c){const t=r[o.getDay()];return n?I(e("Weekday.Short"+t)):C(e("Weekday."+t))}}const a=o.getFullYear()!==d.getFullYear(),s=e(n?a?"formatDateScheduleYear":"formatDateSchedule":a?"chatFullDate":"chatDate")||"d MMMM yyyy";return(n?I:C)(m(e,o,s))}function m(e,t,n){const r=t.getDate(),o=t.getMonth();return n.replace("LLLL",e(u[o])).replace("MMMM",e("Month.Gen"+u[o])).replace("MMM",e("Month.Short"+u[o])).replace("MM",String(o+1).padStart(2,"0")).replace("dd",String(r).padStart(2,"0")).replace("d",String(r)).replace("yyyy",String(t.getFullYear()))}function p(e,t){const n="number"==typeof t?new Date(t):t;return`${h(e,n,!0)}, ${s(n)}`}function g(e){const t=Math.floor(e/3600),n=Math.floor(e%3600/60),r=Math.floor(e%3600%60);let u="";return t>0?(u+=String(t).padStart(2,"0")+":",u+=String(n).padStart(2,"0")+":"):u+=String(n)+":",u+=String(r).padStart(2,"0"),u}function y(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 u=(e=Math.floor(e/60))%60;e-=u;const o=(e=Math.floor(e/60))%60;return o>0&&t.push(String(o).padStart(2,"0")),t.push(String(u).padStart(o>0?2:1,"0")),t.push(String(r).padStart(2,"0")),`${t.join(":")},${String(n).padStart(2,"0")}`}function v(e,t="en-US"){return e.toLocaleString(t,{year:"numeric",month:"short",day:"numeric"})}function O(e,t,n=2021){if(t>11||e>31)return!1;const r=new Date(n,t,e);return!Number.isNaN(r.getTime())&&r.getDate()===e}function j(e=""){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||!O(t,n-1,r||void 0)?void 0:`${r?r+"-":""}${String(n).padStart(2,"0")}-${String(t).padStart(2,"0")}`}const u=e.split(" "),c=t?u[0]:u[1],d=(t?u[1]:u[0]).toLowerCase(),a=o.findIndex(e=>e.startsWith(d));return-1!==a&&O(Number(c),a)?`${String(a+1).padStart(2,"0")}-${String(c).padStart(2,"0")}`:void 0}function w(e){return e+86400}function I(e){return`${e[0].toLowerCase()}${e.slice(1)}`}function C(e){return`${e[0].toUpperCase()}${e.slice(1)}`}},function(e,t,n){"use strict";var r=n(0);t.a=()=>{const[,e]=Object(r.r)(!1);return Object(r.m)(()=>{e(e=>!e)},[])}},function(e,t,n){"use strict";var r=n(0),u=n(9);n(90);t.a=({children:e,className:t,isRtl:n,onClick:o})=>{const c=Object(r.m)(e=>{e.preventDefault(),o(e)},[o]);return r.a.createElement("a",{href:"#",className:Object(u.a)("Link",t),dir:n?"rtl":"auto",onClick:o?c:void 0},e)}},function(e,t,n){"use strict";t.a=e=>{let t;do{t=String(Math.random()).replace("0.","id")}while(e.hasOwnProperty(t));return t}},function(e,t,n){"use strict";n.d(t,"d",(function(){return p})),n.d(t,"c",(function(){return y})),n.d(t,"b",(function(){return v})),n.d(t,"a",(function(){return O}));var r=n(5),u=n(68),o=n(2),c=n(1),d=n(4),a=n(14),i=n(11),s=n(7),f=n(6);function l(e){const t=e.toJSON();return JSON.stringify({endpoint:t.endpoint,keys:t.keys})}function b(){return!!f.k&&("showNotification"in ServiceWorkerRegistration.prototype?"denied"===Notification.permission?(o.r&&console.warn("[PUSH] The user has blocked push notifications."),!1):"PushManager"in window||(o.r&&console.warn("[PUSH] Push messaging isn't supported."),!1):(o.r&&console.warn("[PUSH] Push notifications aren't supported."),!1))}async function h(){"Notification"in window&&(["granted","denied"].includes(Notification.permission)||await Notification.requestPermission())}async function m(e){const t=Object(c.e)(),n=Object(c.d)();if(e)try{const t=l(e);return await Object(r.a)("unregisterDevice",t),await e.unsubscribe(),void n.deleteDeviceToken()}catch(e){o.r&&console.log("[PUSH] Unable to unsubscribe from push.",e)}t.push&&(await Object(r.a)("unregisterDevice",t.push.deviceToken),n.deleteDeviceToken())}async function p(){if(!b())return;const e=await navigator.serviceWorker.ready,t=await e.pushManager.getSubscription();await m(t)}let g=!1;async function y(){if(!b())return void await h();const e=await navigator.serviceWorker.ready;let t=await e.pushManager.getSubscription();if(function(e){const t=Object(c.e)();return!t.push||!e||(l(e)!==t.push.deviceToken||Date.now()-t.push.subscribedAt>432e5)}(t)){await m(t);try{t=await e.pushManager.subscribe({userVisibleOnly:!0});const n=l(t);o.r&&console.log("[PUSH] Received push subscription: ",n),await Object(r.a)("registerDevice",n),Object(c.d)().setDeviceToken(n)}catch(e){"denied"===Notification.permission?o.r&&console.warn("[PUSH] The user has blocked push notifications."):o.r&&(console.log("[PUSH] Unable to subscribe to push.",e),e.code===DOMException.ABORT_ERR&&await h())}}}async function v({chat:e,message:t,isActiveChat:n}){if(!("Notification"in window?"denied"!==Notification.permission||(o.r&&console.warn("[PUSH] The user has blocked push notifications."),0):(o.r&&console.warn("[PUSH] This browser does not support desktop notification"),0)))return;if(!t.id)return;if(await async function(){if(g)return;const[e,t]=await Promise.all([Object(r.a)("fetchNotificationSettings",{serverTimeOffset:Object(c.e)().serverTimeOffset}),Object(r.a)("fetchNotificationExceptions",{serverTimeOffset:Object(c.e)().serverTimeOffset})]);if(!e)return;let n=Object(i.w)(Object(c.e)(),e);t&&(n=Object(i.f)(n,t)),Object(c.g)(n),g=!0}(),!function(e,t){if(!g)return!1;const n=Object(c.e)();return!(Object(d.Hb)(e,Object(s.fb)(n),Object(s.eb)(n))||e.isNotJoined||!e.isListed)&&!(t&&document.hasFocus())}(e,n))return;const{title:f,body:l}=function(e,t){const n=Object(c.e)(),{senderId:r,replyToMessageId:o}=t,i=r?Object(s.Jb)(n,r):void 0,f=Object(d.s)(t),l=f&&o?Object(s.l)(n,e.id,o):void 0,{targetUserIds:b,targetChatId:h}=f||{},m=b?b.map(e=>Object(s.Jb)(n,e)).filter(Boolean):void 0,p=Object(d.W)(e),g=p?Object(s.Jb)(n,p):void 0;let y;if(Object(d.gb)(t)){const n=e&&(Object(d.mb)(e)||t.senderId===t.chatId)?e:i;y=Object(u.a)(a.b,t,n,m,l,h,{asPlain:!0})}else{const n=Object(d.K)(a.b,e.id,i),r=Object(d.O)(a.b,t);y=n?`${n}: ${r}`:r}return{title:Object(d.k)(a.b,e,g),body:y}}(e,t);if(b())navigator.serviceWorker.controller&&navigator.serviceWorker.controller.postMessage({type:"newMessageNotification",payload:{title:f,body:l,chatId:e.id,messageId:t.id}});else{const n=Object(c.d)(),r={body:l,icon:"icon-192x192.png",badge:"icon-192x192.png",tag:t.id.toString()};"vibrate"in navigator&&(r.vibrate=[200,100,200]);const u=new Notification(f,r);u.onclick=()=>{u.close(),n.focusMessage({chatId:e.id,messageId:t.id}),window.focus&&window.focus()}}}function O(){navigator.serviceWorker.controller&&navigator.serviceWorker.controller.postMessage({type:"clientReady"})}},function(e,t,n){"use strict";n.d(t,"b",(function(){return d})),n.d(t,"c",(function(){return a})),n.d(t,"d",(function(){return i})),n.d(t,"g",(function(){return s})),n.d(t,"e",(function(){return f})),n.d(t,"f",(function(){return l})),n.d(t,"h",(function(){return b})),n.d(t,"a",(function(){return h}));var r=n(2),u=n(30),o=n(3);const c=[1,8,5,2,7,4,6];function d(e){if(e)switch(e.type){case"userTypeBot":case"userTypeRegular":return e.firstName||e.lastName;case"userTypeDeleted":case"userTypeUnknown":return"Deleted";default:return}}function a(e){if(e){if(f(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 i(e,t,n){if(t.id===r.yb)return e("ServiceNotifications").toLowerCase();if(t.type&&"userTypeBot"===t.type)return e("Bot");if(!t.status)return"";switch(t.status.type){case"userStatusEmpty":return e("ALongTimeAgo");case"userStatusLastMonth":return e("WithinAMonth");case"userStatusLastWeek":return e("WithinAWeek");case"userStatusOffline":{const{wasOnline:r}=t.status;if(!r)return e("LastSeen.Offline");const o=new Date((new Date).getTime()+1e3*n),c=new Date(1e3*r);if(c>=o)return e("LastSeen.JustNow");const d=new Date(o.getTime()-c.getTime());if(d.getTime()/1e3<60)return e("LastSeen.JustNow");if(d.getTime()/1e3<3600){return e("LastSeen.MinutesAgo",Math.floor(d.getTime()/1e3/60))}const a=new Date;a.setHours(0,0,0,0);if(c>new Date(a.getTime()+1e3*n)){if(d.getTime()/1e3<21600){return e("LastSeen.HoursAgo",Math.floor(d.getTime()/1e3/60/60))}return e("LastSeen.TodayAt",Object(u.h)(c))}const i=new Date;i.setDate(o.getDate()-1),i.setHours(0,0,0,0);return c>new Date(i.getTime()+1e3*n)?e("LastSeen.YesterdayAt",Object(u.h)(c)):e("LastSeen.AtDate",Object(u.b)(e,c))}case"userStatusOnline":return e("Online");case"userStatusRecently":return e("Lately");default:return}}function s(e){const{id:t,status:n,type:u}=e;return!!n&&(t!==r.yb&&("userStatusOnline"===n.type&&"userTypeBot"!==u))}function f(e){return!(!e.status||"userTypeBot"===e.type||e.id===r.yb)&&("userTypeDeleted"===e.type||"userTypeUnknown"===e.type)}function l(e){return"userTypeBot"===e.type}function b(e,t,n,r=0){return Object(o.k)(e,e=>{const u=Date.now()/1e3+r;if(n&&n.includes(e))return u+172800-(n.length-n.indexOf(e));const o=t[e];if(!o||!o.status)return 0;if("userStatusOnline"===o.status.type)return o.status.expires;if("userStatusOffline"===o.status.type&&o.status.wasOnline)return o.status.wasOnline;switch(o.status.type){case"userStatusRecently":return u-86400;case"userStatusLastWeek":return u-604800;case"userStatusLastMonth":return u-18144e3;default:return 0}},"desc")}function h(e){const t=e?Math.abs(e.id)%7:0;return c[t]}},function(e,t,n){"use strict";n.d(t,"w",(function(){return i})),n.d(t,"v",(function(){return s})),n.d(t,"t",(function(){return f})),n.d(t,"y",(function(){return l})),n.d(t,"u",(function(){return b})),n.d(t,"z",(function(){return h})),n.d(t,"j",(function(){return m})),n.d(t,"p",(function(){return p})),n.d(t,"i",(function(){return g})),n.d(t,"e",(function(){return y})),n.d(t,"f",(function(){return v})),n.d(t,"d",(function(){return O})),n.d(t,"x",(function(){return j})),n.d(t,"r",(function(){return w})),n.d(t,"m",(function(){return I})),n.d(t,"A",(function(){return C})),n.d(t,"c",(function(){return E})),n.d(t,"a",(function(){return S})),n.d(t,"o",(function(){return M})),n.d(t,"h",(function(){return A})),n.d(t,"g",(function(){return k})),n.d(t,"s",(function(){return T})),n.d(t,"D",(function(){return N})),n.d(t,"b",(function(){return P})),n.d(t,"C",(function(){return D})),n.d(t,"B",(function(){return L})),n.d(t,"l",(function(){return x})),n.d(t,"k",(function(){return F})),n.d(t,"q",(function(){return B})),n.d(t,"n",(function(){return R})),n.d(t,"E",(function(){return U}));var r=n(8),u=n(2),o=n(3),c=n(35),d=n(30);const a=Date.now()/1e3+31622400;function i(e){return e>0}function s(e){return f(e)||l(e)}function f(e){return"chatTypeBasicGroup"===e.type}function l(e){return"chatTypeSuperGroup"===e.type}function b(e){return"chatTypeChannel"===e.type}function h(e){return"chatTypePrivate"===e.type||"chatTypeBasicGroup"===e.type}function m(e){switch(e.type){case"chatTypePrivate":return"PrivateChat";case"chatTypeBasicGroup":case"chatTypeSuperGroup":return"AccDescrGroup";case"chatTypeChannel":return"AccDescrChannel";default:return"Chat"}}function p(e){if("chatTypePrivate"===e.type||"chatTypeSecret"===e.type)return e.id}function g(e,t,n,r=!1){return r||n&&t.id===n.id&&n.isSelf?e("SavedMessages"):t.title||e("HiddenName")}function y(e){if(e.fullInfo)return e.fullInfo.about}function v(e){const{username:t}=e;if(t)return"https://t.me/"+t;const{inviteLink:n}=e.fullInfo||{};return n}function O(e,t="normal"){if(e.avatarHash)switch(t){case"big":return`profile${e.id}?${e.avatarHash}`;default:return`avatar${e.id}?${e.avatarHash}`}}function j(e){return!e.lastMessage}function w(e){return Boolean(e.adminRights)}function I(e,t){return!!e.adminRights&&e.adminRights[t]}function C(e,t){return Boolean(e.currentUserBannedRights&&e.currentUserBannedRights[t]||e.defaultBannedRights&&e.defaultBannedRights[t])}function E(e,t){return t!==r.MAIN_THREAD_ID||!(e.isRestricted||e.migratedTo||e.isNotJoined)&&(!!e.isCreator||(!!i(e.id)||(b(e)?I(e,"postMessages"):w(e)||!C(e,"sendMessages"))))}function S(e,t=!1){if(!e)return{canAttachMedia:!1,canAttachPolls:!1,canSendStickers:!1,canSendGifs:!1,canAttachEmbedLinks:!1};const n=w(e);return{canAttachMedia:n||!C(e,"sendMedia"),canAttachPolls:(n||!C(e,"sendPolls"))&&(!i(e.id)||t),canSendStickers:n||!C(e,"sendStickers"),canSendGifs:n||!C(e,"sendGifs"),canAttachEmbedLinks:n||!C(e,"embedLinks")}}function M(e,t,n){if(t&&t.sendMessages){const{untilDate:n}=t;return n&&nfunction(e,t,n,r,u,o,c,d){if(!e.isListed)return!1;if(o&&o.has(e.id))return!1;if(c&&c.has(e.id))return!0;if(d&&d.has(e.id))return!0;if(T(e)&&t.excludeArchived)return!1;if(t.excludeMuted&&!e.unreadMentionsCount&&N(e,r,u))return!1;if(!e.unreadCount&&!e.unreadMentionsCount&&!e.hasUnreadMark&&t.excludeRead)return!1;if(i(e.id)){const r=n[e.id];if(r&&"userTypeBot"===r.type){if(t.bots)return!0}else{if(t.contacts&&r&&r.isContact)return!0;if(t.nonContacts&&r&&!r.isContact)return!0}}else{if(s(e))return!!t.groups;if(b(e))return!!t.channels}return!1}(e[o],n,t,r,u,c,d,a)),n.pinnedChatIds]}function L(e,t,n,r="all"){function u(e){if(!e||!e.lastMessage||e.migratedTo)return!1;switch(r){case"all":if(T(e))return!1;break;case"archived":if(!T(e))return!1}return!e.isRestricted&&!e.isNotJoined}const c=t.map(t=>e[t]).filter(u),d=new Set(t);return{pinnedChats:n?n.map(t=>e[t]).filter(u).filter(e=>d.has(e.id)):[],otherChats:Object(o.k)(n?c.filter(e=>!n.includes(e.id)):c,k,"desc")}}function x(e,t,n,r,u,o){const[c]=D(e,t,n,u,o,r),d=c.map(t=>e[t]).filter(e=>e&&e.lastMessage&&!e.isRestricted&&!e.isNotJoined);return{unreadDialogsCount:d.reduce((e,t)=>t.unreadCount||t.hasUnreadMark?e+1:e,0),hasActiveDialogs:d.some(e=>e.unreadMentionsCount||!N(e,u,o)&&(e.unreadCount||e.hasUnreadMark))}}function F(e,t,n,r,u,o,c){const{id:d,title:a,emoticon:i,description:s,pinnedChatIds:f,excludedChatIds:l,includedChatIds:b,excludeArchived:h,excludeMuted:m,excludeRead:p,...g}=r;if(Object.values(g).filter(Boolean).length>1||l&&l.length||b&&b.length){return e("Chats",function(e,t,n,r,u,o){const[c,d]=D(e,t,n,u,o,r),{pinnedChats:a,otherChats:i}=L(e,c,d,"folder");return a.length+i.length}(t,n,r,u,o,c))}return g.bots?e("FilterBots"):g.groups?e("FilterGroups"):g.channels?e("FilterChannels"):g.contacts?e("FilterContacts"):g.nonContacts?e("FilterNonContacts"):void 0}function B(e){return!!e&&e.id<0}function R(e,t,n){if(n&&!i(t))return n.isSelf?e("FromYou"):Object(c.b)(n)}function U(e,t,n=!1,r){return Object(o.k)(e,e=>{const u=t[e];if(!u)return 0;let o=0;return u.lastMessage&&(o+=u.lastMessage.date),n&&u.isVerified&&(o+=3e9),r&&r.includes(e)&&(o=Date.now()+3e8+(r.length-r.indexOf(e))),o},"desc")}},function(e,t,n){"use strict";n.d(t,"b",(function(){return u})),n.d(t,"a",(function(){return o})),n.d(t,"d",(function(){return a}));var r=n(0);const u="tt-event-heavy-animation-start",o="tt-event-heavy-animation-end";let c,d=!1;const a=e=>(d||(d=!0,document.dispatchEvent(new Event(u))),c&&(clearTimeout(c),c=void 0),e&&(c=window.setTimeout(()=>{d=!1,document.dispatchEvent(new Event(o)),c=void 0},e)),()=>{d=!1,document.dispatchEvent(new Event(o))});t.c=(e,t)=>{Object(r.n)(()=>(d&&e(),document.addEventListener(u,e),document.addEventListener(o,t),()=>{document.removeEventListener(o,t),document.removeEventListener(u,e)}),[t,e])}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a})),n.d(t,"c",(function(){return i})),n.d(t,"b",(function(){return b}));var r=n(2);const u=new Set(["scroll","mouseenter","mouseleave"]),o={},c=new Map,d={};function a(e,t,n,r=!1){const u=s(t,e);f(u,e,r)?function(e,t,n){d[e]||(d[e]=0,document.addEventListener(e,h));(function(e){o[e]||(o[e]=new Map);return o[e]})(e).set(t,n),function(e){const t=c.get(e);if(t)return t;const n=new Set;return c.set(e,n),n}(t).add(e),d[e]++}(u,e,n):e.addEventListener(u,n,r)}function i(e,t,n,r=!1){const u=s(t,e);f(u,e,r)?l(u,e):e.removeEventListener(u,n,r)}function s(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 f(e,t,n){return!n&&!u.has(e)&&"VIDEO"!==t.tagName&&"IFRAME"!==t.tagName}function l(e,t){d[e]--,d[e]||document.removeEventListener(e,h),o[e].delete(t),c.get(t).delete(e)}function b(e){const t=c.get(e);t&&(t.forEach(t=>l(t,e)),c.delete(e))}function h(e){const t=o[e.type];if(t){let n=!1,r=e.target;const u=()=>{n=!0},o=()=>{e.preventDefault()},c=new Proxy(e,{get:(e,t)=>"currentTarget"===t?r:"stopPropagation"===t||"stopImmediatePropagation"===t?u:"preventDefault"===t?o:Reflect.get(e,t)});for(;r&&r!==document.body;){const e=t.get(r);if(e&&(e(c),n))return;r=r.parentNode}}}r.r&&document.addEventListener("dblclick",()=>{console.log("DELEGATED EVENTS",{delegationRegistry:o,delegatedEventsByElement:c,documentEventCounters:d})})},function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"a",(function(){return l}));var r=n(0),u=n(6),o=n(29),c=n(1),d=n(3);const a={currentIndex:0,nextStateIndexToReplace:-1,isHistoryAltered:!1,isDisabled:!1,isEdge:!1,currentIndexes:[]},i=()=>{a.isDisabled=!0},s=e=>{const t=e.touches[0].pageX;(t<=300||t>=window.innerWidth-300)&&(a.isEdge=!0)},f=()=>{a.isEdge&&setTimeout(()=>{a.isEdge=!1},350)};function l(e,t,n,u,i=!1,s){const f=Object(r.q)(-1),l=Object(r.q)(!1),b=Object(o.a)(e),h=Object(r.q)(!0),m=Object(r.q)([]),p=Object(o.a)(s),g=Object(r.q)(!1),y=Object(r.m)((t=!1)=>{if(s){const e=p||[];if(e.length0){const e=m.current[m.current.length-t-1];let n=t;if(e){const t=a.currentIndexes.findIndex(t=>t===e.index);n=a.currentIndexes.length-t-1}a.isHistoryAltered=!0,window.history.go(-n);m.current.splice(m.current.length-t-1,t).forEach(({index:e})=>{a.currentIndexes.splice(a.currentIndexes.indexOf(e),1)})}s.length>0&&setTimeout(()=>{const e=++a.currentIndex;a.currentIndexes[a.currentIndexes.length-1]=e,window.history.replaceState({index:e,state:u},"","#"+s[s.length-1]),m.current[m.current.length-1]={index:e,hash:s[s.length-1]}},0)}}}else e&&!t&&(h.current=!1,l.current?(l.current=!1,a.currentIndexes.push(f.current)):setTimeout(()=>{const e=++a.currentIndex;a.currentIndexes.push(e),window.history[a.currentIndexes.includes(a.nextStateIndexToReplace-1)&&0!==window.history.state.index&&a.nextStateIndexToReplace===e&&!i?"replaceState":"pushState"]({index:e,state:u},""),f.current=e,i&&(a.nextStateIndexToReplace=a.currentIndex+1)},0)),!t&&e||h.current||(f.current!==a.currentIndex&&i||(a.isHistoryAltered=!0,window.history.back(),setTimeout(()=>{a.nextStateIndexToReplace=-1},400)),a.currentIndexes.splice(a.currentIndexes.indexOf(f.current),1),h.current=!0)},[u,s,e,p,i]);return Object(r.n)(()=>{const r=e=>{if(a.isHistoryAltered)return void setTimeout(()=>{a.isHistoryAltered=!1},0);const{index:r}=e.state,u=r||0;try{const r=s?m.current[m.current.length-1].index:f.current,o=a.currentIndexes[a.currentIndexes.indexOf(r)-1];if(a.isDisabled)return;!h.current&&(0===u||u===o)||s&&(0===u||u===o)?(s&&(g.current=!0,m.current.pop()),a.currentIndexes.splice(a.currentIndexes.indexOf(r),1),t&&(a.isEdge&&Object(c.d)().disableHistoryAnimations(),t(!a.isEdge),h.current=!0)):u===r&&h.current&&n&&!s&&(l.current=!0,a.isEdge&&Object(c.d)().disableHistoryAnimations(),n(e.state.state))}catch(e){}},u=s?!p||!Object(d.a)(p,s):b!==e;return!a.isDisabled&&u&&y(),window.addEventListener("popstate",r),()=>window.removeEventListener("popstate",r)},[u,y,s,e,t,n,p,b,i]),{forceClose:()=>y(!0)}}u.e&&(window.addEventListener("touchstart",s),window.addEventListener("touchend",f),window.addEventListener("popstate",f)),window.history.replaceState({index:a.currentIndex},"")},function(e,t,n){"use strict";var r=n(0),u=n(9);t.a=(e=!1,t,n=!1,o="fast",c=!1)=>{const[d,a]=Object(r.r)(!e),i=Object(r.q)(),[s,f]=Object(r.r)(e&&n);e?(a(!1),f(!0),i.current&&(window.clearTimeout(i.current),i.current=void 0)):(f(!1),d||i.current||(i.current=window.setTimeout(()=>{a(!0),t&&t(),i.current=void 0},c?0:350)));const l=s&&!(c&&!e),b=Boolean(i.current),h=e||b;return{shouldRender:h,transitionClassNames:Object(u.a)(o&&"opacity-transition",o,l&&"open",h&&"shown",b&&"closing")}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));function r(e,t=30){return!e||e.length<=t?e:e.substr(0,t)+"..."}},function(e){e.exports=JSON.parse('{"--color-primary":["#50A2E9","#8378DB"],"--color-primary-opacity":["#50A2E980","#8378DB80"],"--color-primary-shade":["#4a95d6","#7b71c6"],"--color-background":["#FFFFFF","#212121"],"--color-background-secondary":["#f4f4f5","#121212"],"--color-background-secondary-accent":["#E4E4E5","#100f10"],"--color-background-own":["#EEFEDF","#8378DB"],"--color-background-own-apple":["#E7FDCC","#8378DB"],"--color-background-selected":["#F4F4F5","#2C2C2C"],"--color-background-own-selected":["#d4fcae","#7b71c6"],"--color-chat-hover":["#F4F4F5","#2C2C2C"],"--color-chat-active":["#4C90E6","#8378DB"],"--color-item-active":["#ededed","#292929"],"--color-text":["#000000","#FFFFFF"],"--color-text-secondary":["#707579","#AAAAAA"],"--color-text-secondary-apple":["#8E8E92","#AAAAAA"],"--color-borders":["#DADCE0","#100F10"],"--color-borders-input":["#DADCE0","#5B5B5A"],"--color-links":["#52A1EF","#868DF6"],"--color-links-hover":["#2d8dec","#6b5fcc"],"--color-gray":["#C4C9CC","#717579"],"--color-pinned":["#C4C9CC","#707579"],"--color-default-shadow":["#72727240","#1010109c"],"--color-light-shadow":["#7272722B","#00000040"],"--color-green":["#4DCD5E","#8378DB"],"--color-text-meta-colored":["#4DCD5E","#8378DB"],"--color-reply-hover":["#F4F4F4","#272727"],"--color-reply-active":["#E8E9E9","#2E2F2F"],"--color-reply-own-hover":["#DBF4CE","#6458bc"],"--color-reply-own-hover-apple":["#d9f9c1","#6458bc"],"--color-reply-own-active":["#C8EBBC","#4F4A9F"],"--color-reply-own-active-apple":["#d5edc2","#4F4A9F"],"--color-accent-own":["#4FAE4E","#FFFFFF"],"--color-message-meta-own":["#4FAE4EFF","#FFFFFF88"],"--color-own-links":["#52A1EF","#FFFFFF"],"--color-code":["#4a729a","#93c4ef"],"--color-code-own":["#3c7940","#FFFFFF"],"--color-code-bg":["#70757914","#ffffff26"],"--color-code-own-bg":["#70757914","#ffffff26"]}')},function(e,t,n){"use strict";var r=n(0),u=n(9),o=n(16);n(99);t.a=e=>{const{icon:t,className:n,children:c,onClick:d,href:a,download:i,disabled:s,destructive:f,ariaLabel:l}=e,b=Object(o.a)(),h=Object(r.m)(e=>{if(s||!d)return e.stopPropagation(),void e.preventDefault();d(e)},[s,d]),m=Object(r.m)(e=>{if(13===e.keyCode||32===e.keyCode)return s||!d?(e.stopPropagation(),void e.preventDefault()):void d(e)},[s,d]),p=Object(u.a)("MenuItem",n,s&&"disabled",f&&"destructive"),g=r.a.createElement(r.a.Fragment,null,t&&r.a.createElement("i",{className:"icon-"+t,"data-char":t.startsWith("char-")?t.replace("char-",""):void 0}),c);return a?r.a.createElement("a",{tabIndex:0,className:p,href:a,download:i,"aria-label":l,title:l,target:a.startsWith(window.location.origin)?"_self":"_blank",rel:"noopener noreferrer",dir:b.isRtl?"rtl":void 0,onClick:d},g):r.a.createElement("div",{role:"button",tabIndex:0,className:p,onClick:h,onKeyDown:m,"aria-label":l,title:l,dir:b.isRtl?"rtl":void 0},g)}},function(e,t,n){"use strict";var r=n(0),u=n(10);n(93);t.a=Object(r.h)(()=>{const[e,t]=Object(r.r)([]),n=Object(r.p)(()=>Object(u.a)(()=>{t([])},700,!1),[]),o=Object(r.m)(r=>{if(0!==r.button)return;const u=r.currentTarget,o=u.getBoundingClientRect(),c=u.offsetWidth/2;t([...e,{x:r.clientX-o.x-c/2,y:r.clientY-o.y-c/2,size:c}]),requestAnimationFrame(()=>{n()})},[e,n]);return r.a.createElement("div",{className:"ripple-container",onMouseDown:o},e.map(({x:e,y:t,size:n})=>r.a.createElement("span",{style:`left: ${e}px; top: ${t}px; width: ${n}px; height: ${n}px;`})))})},function(e,t,n){"use strict";var r=n(62),u=n(42);let o=!1;const c=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i,d=(e,t,n)=>(1-n)*e+n*t,a=Object.keys(u).map(e=>({property:e,colors:[i(u[e][0]),i(u[e][1])]}));function i(e){const t=c.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 s(e,t,n=1){a.forEach(({property:r,colors:u})=>{const o=Math.round(d(u[e].r,u[t].r,n)),c=Math.round(d(u[e].g,u[t].g,n)),a=Math.round(d(u[e].b,u[t].b,n)),i=void 0!==u[e].a?Math.round(d(u[e].a,u[t].a,n)):void 0;document.documentElement.style.setProperty(r,void 0!==i?`rgba(${o},${c},${a},${i/255})`:`rgb(${o},${c},${a})`)})}t.a=(e,t)=>{const n="dark"===e,u=o&&t,c=n?0:1,d=n?1:0,a=Date.now(),i=document.querySelector('meta[name="theme-color"]');document.documentElement.classList.remove("theme-"+(n?"light":"dark")),o&&document.documentElement.classList.add("no-animations"),document.documentElement.classList.add("theme-"+e),i&&i.setAttribute("content",n?"#212121":"#fff"),setTimeout(()=>{document.documentElement.classList.remove("no-animations")},500),o=!0,u?Object(r.b)(()=>{const e=Math.min((Date.now()-a)/200,1);return s(c,d,function(e){return 1-(1-e)**3.5}(e)),e<1}):s(c,d)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return f})),n.d(t,"c",(function(){return l}));var r=n(84),u=n.n(r),o=n(6),c=n(17),d=n(10);let a,i;const s="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=";async function f(e,t){for(b();!i.wasmReady;)await Object(d.f)(2e3);const{result:n,width:r,height:u}=await function(e,t){return new Promise(n=>{i.requests=i.requests||new Map,i.requests.set(e,n),i.postMessage({id:e,blob:t})})}(e,t);if(r&&u)return function({result:e,width:t,height:n}){a||(a=document.createElement("canvas"));return new Promise(r=>{const u=new ImageData(e,t,n);a.width=t,a.height=n;a.getContext("2d").putImageData(u,0,0),a.toBlob(e=>{r(null!=e?e:void 0)},"image/png",1)})}({result:n,width:r,height:u})}async function l(e,t){if(Object(o.t)()||"data:image/webp"!==t.substr(0,15))return t;b();const n=await f(e,Object(c.d)(t));if(!n)throw new Error("Can't convert webp to png. Url: "+t);return Object(c.a)(n)}function b(){i||(i=new u.a,i.wasmReady=!1,i.onmessage=h)}function h(e){const{id:t}=e.data;switch(e.data.type){case"initialized":i.wasmReady=!0;break;case"result":if(i.requests.has(t)){const n=i.requests.get(t);i.requests.delete(t),n(e.data)}}}},function(e,t,n){"use strict";var r=n(0),u=n(9),o=n(16);t.a=Object(r.h)(({ref:e,id:t,className:n,value:c,label:d,error:a,success:i,disabled:s,readOnly:f,placeholder:l,autoComplete:b,inputMode:h,maxLength:m,onChange:p,onInput:g,onKeyPress:y,onKeyDown:v,onBlur:O,onPaste:j})=>{const w=Object(o.a)(),I=a||i||d,C=Object(u.a)("input-group",c&&"touched",a?"error":i&&"success",s&&"disabled",f&&"disabled",I&&"with-label",n);return r.a.createElement("div",{className:C,dir:w.isRtl?"rtl":void 0},r.a.createElement("input",{ref:e,className:"form-control",type:"text",id:t,dir:"auto",value:c||"",placeholder:l,maxLength:m,autoComplete:b,inputMode:h,disabled:s,readOnly:f,onChange:p,onInput:g,onKeyPress:y,onKeyDown:v,onBlur:O,onPaste:j}),I&&r.a.createElement("label",{htmlFor:t},I))})},function(e,t,n){"use strict";var r=n(0),u=n(9),o=n(16),c=n(26);n(95);t.a=Object(r.h)(({id:e,name:t,value:n,label:d,subLabel:a,checked:i,disabled:s,round:f,blocking:l,isLoading:b,onChange:h,onCheck:m})=>{const p=Object(o.a)(),g=Object(r.m)(e=>{h&&h(e),m&&m(e.currentTarget.checked)},[h,m]),y=Object(u.a)("Checkbox",s&&"disabled",f&&"round",b&&"loading",l&&"blocking");return r.a.createElement("label",{className:y,dir:p.isRtl?"rtl":void 0},r.a.createElement("input",{type:"checkbox",id:e,name:t,value:n,checked:i,disabled:s,onChange:g}),r.a.createElement("div",{className:"Checkbox-main"},r.a.createElement("span",{className:"label",dir:"auto"},d),a&&r.a.createElement("span",{className:"subLabel",dir:"auto"},a)),b&&r.a.createElement(c.a,null))})},function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(56);function u(e){return Object(r.a)({onEsc:e})}},function(e,t,n){"use strict";function r(e){return String(e).replace(/\d(?=(\d{3})+$)/g,"$& ")}function u(e){return".0"===String(e.toFixed(1)).substr(-2)?Math.round(e):e.toFixed(1).replace(".",",")}function o(e){return e<1e3?e:e<1e6?u(e/1e3)+"K":u(e/1e6)+"M"}function c(e,t=2){return e.replace(/[.,!@#$%^&*()_+=\-`~[\]/\\{}:"|<>?]+/gi,"").trim().split(/\s+/).slice(0,t).map(e=>e.length&&e.match(/./u)[0].toUpperCase()).join("")}n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return o})),n.d(t,"c",(function(){return c}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));const r=[]},function(e,t,n){"use strict";var r=n(29);t.a=(e,t)=>{const n=Object(r.a)(t);n&&!t.some((e,t)=>e!==n[t])||e(n||[])}},function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));const r=/[^\wа-яё]+/;function u(e,t){if(!e||!t)return!1;const n=e.toLowerCase().split(r);return t.toLowerCase().split(r).every(e=>n.some(t=>t.startsWith(e)))}},function(e,t,n){"use strict";n.d(t,"b",(function(){return f}));var r=n(10),u=n(2),o=n(6);const c=o.l&&l(),d=window.innerHeight;let a=f(),i=!1;const s=Object(r.h)(()=>{a=f(),!i&&((a.width<=u.ob||a.width<=u.nb&&a.height<=u.mb)!==o.l||o.l&&c!==l())&&window.location.reload()},250,!0);function f(){const e=.01*window.innerHeight;return document.documentElement.style.setProperty("--vh",e+"px"),{width:window.innerWidth,height:window.innerHeight}}function l(){return o.e?window.matchMedia("(orientation: landscape)").matches:window.matchMedia("screen and (min-device-aspect-ratio: 1/1) and (orientation: landscape)").matches}window.addEventListener("resize",s),window.addEventListener("orientationchange",s),t.a={get:()=>a,getIsKeyboardVisible:()=>d>a.height,disableRefresh:function(){i=!0},enableRefresh:function(){i=!1}}},function(e,t,n){"use strict";var r=n(0),u=n(40),o=n(64),c=n(80),d=n(58),a=n(49),i=n(9),s=n(37),f=n(39);n(97);t.a=({ref:e,containerRef:t,isOpen:n,className:l,style:b,children:h,positionX:m="left",positionY:p="top",autoClose:g=!1,footer:y,noCloseOnBackdrop:v=!1,onCloseAnimationEnd:O,onClose:j,onMouseEnter:w,onMouseLeave:I,shouldSkipTransition:C})=>{let E=Object(r.q)(null);e&&(E=e);const S=t||E,{transitionClassNames:M}=Object(u.a)(n,O,C,void 0,C);Object(r.n)(()=>n&&j?Object(a.a)(j):void 0,[n,j]),Object(f.a)(n,j,void 0,void 0,g),Object(d.a)(([e])=>{void 0!==e&&Object(s.d)(200)},[n]);const A=Object(o.a)(E,n,g?j:void 0,void 0,!0);Object(c.a)(n,S,v?void 0:j);const k=Object(i.a)("bubble menu-container custom-scroll",p,m,y&&"with-footer",M);return r.a.createElement("div",{className:Object(i.a)("Menu no-selection",l),onKeyDown:n?A:void 0,onMouseEnter:w,onMouseLeave:n?I:void 0,style:b},n&&r.a.createElement("div",{className:"backdrop"}),r.a.createElement("div",{ref:E,className:k,style:`transform-origin: ${p} ${m}`,onClick:g?j:void 0},h,y&&r.a.createElement("div",{className:"footer"},y)))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));const r={Enter:"onEnter",Backspace:"onBackspace",Delete:"onDelete",Esc:"onEsc",Escape:"onEsc",ArrowUp:"onUp",ArrowDown:"onDown",ArrowLeft:"onLeft",ArrowRight:"onRight",Tab:"onTab"},u={onEnter:[],onDelete:[],onBackspace:[],onEsc:[],onUp:[],onDown:[],onLeft:[],onRight:[],onTab:[]};function o(e){return c()||document.addEventListener("keydown",d,!0),Object.keys(e).forEach(t=>{const n=e[t];if(!n)return;const r=u[t];r&&r.push(n)}),()=>{!function(e){Object.keys(e).forEach(t=>{const n=e[t],r=u[t];if(r){const e=r.findIndex(e=>e===n);-1!==e&&r.splice(e,1)}}),c()||document.removeEventListener("keydown",d,!1)}(e)}}function c(){return Object.values(u).some(e=>Boolean(e.length))}function d(e){const t=r[e.key];if(!t)return;const{length:n}=u[t];if(!n)return;e.stopPropagation();(0,u[t][n-1])(e)}},function(e,t,n){"use strict";n.d(t,"b",(function(){return y})),n.d(t,"c",(function(){return v})),n.d(t,"a",(function(){return O}));var r=n(8),u=n(2),o=n(5),c=n(12),d=n(17),a=n(6),i=n(82),s=n.n(i),f=n(83),l=n.n(f);async function b(e){const t=await new Response(e).arrayBuffer();return new Promise(e=>{const n=new Uint8Array(t);let r=new s.a,u=new l.a;r.onmessage=e=>{null===e.data?u.postMessage({command:"done"}):u.postMessage({command:"encode",buffers:e.data},e.data.map(({buffer:e})=>e))},u.onmessage=t=>{"page"===t.data.message&&(e(new Blob([t.data.page],{type:"audio/wav"})),r.terminate(),r=void 0,u.terminate(),u=void 0)},u.postMessage({command:"init",wavBitDepth:16,wavSampleRate:48e3}),r.postMessage({command:"init",decoderSampleRate:48e3,outputBufferSampleRate:48e3}),r.postMessage({command:"decode",pages:n},[n.buffer])})}var h=n(46);const m={[r.ApiMediaFormat.DataUri]:c.a.Text,[r.ApiMediaFormat.BlobUrl]:c.a.Blob,[r.ApiMediaFormat.Lottie]:c.a.Json,[r.ApiMediaFormat.Progressive]:void 0,[r.ApiMediaFormat.Stream]:void 0},p=new Map,g=new Map;function y(e,t,n){if(t===r.ApiMediaFormat.Progressive)return a.h?function(e){const t="./progressive/"+e;return p.set(e,t),Promise.resolve(t)}(e):y(e,r.ApiMediaFormat.BlobUrl,n);if(!g.has(e)){const i=async function(e,t,n){if(!u.X){const n=e.startsWith("avatar")?u.Z:u.Y,r=await c.c(n,e,m[t]);if(r){let t=r;if("audio/ogg"!==r.type||a.g||(t=await b(t)),"image/webp"===r.type&&!Object(a.t)()&&t){const n=await Object(h.b)(e,t);n&&(t=n)}const n=j(t);return p.set(e,n),n}}if(t===r.ApiMediaFormat.Stream){const r=new MediaSource,u=URL.createObjectURL(r);let c=!1;return r.addEventListener("sourceopen",()=>{if(c)return;c=!0;const u=r.addSourceBuffer("audio/mpeg");Object(o.a)("downloadMedia",{url:e,mediaFormat:t},(e,t)=>{n&&n(e),1===e&&r.endOfStream(),t&&u.appendBuffer(t)})}),p.set(e,u),u}const i=await Object(o.a)("downloadMedia",{url:e,mediaFormat:t},n);if(!i)throw new Error("Failed to fetch media");let{prepared:s,mimeType:f}=i;if("audio/ogg"===f&&!a.g){const e=await Object(d.e)(s);URL.revokeObjectURL(s);const t=await b(e);s=j(t),f=e.type}if("image/webp"===f&&!Object(a.t)()){const t=await Object(d.e)(s);URL.revokeObjectURL(s);const n=await Object(h.b)(e,t);n&&(s=j(n))}return p.set(e,s),s}(e,t,n).catch(e=>{u.r&&console.warn(e)}).finally(()=>{g.delete(e)});g.set(e,i)}return g.get(e)}function v(e){return p.get(e)}function O(e){Object(o.b)(e)}function j(e){return e instanceof Blob?URL.createObjectURL(e):e}a.h&&navigator.serviceWorker.addEventListener("message",async e=>{const{type:t,messageId:n,params:u}=e.data;if("requestPart"!==t)return;const c=await Object(o.a)("downloadMedia",{mediaFormat:r.ApiMediaFormat.Progressive,...u});if(!c)return;const{arrayBuffer:d,mimeType:a,fullSize:i}=c;navigator.serviceWorker.controller.postMessage({type:"partResponse",messageId:n,result:{arrayBuffer:d,mimeType:a,fullSize:i}},[d])})},function(e,t,n){"use strict";var r=n(0),u=n(29);t.a=(e,t,n)=>{const o=Object(u.a)(t);return Object(r.n)(()=>e(o||[]),t,n)}},function(e,t,n){"use strict";var r=n(0),u=n(1);const o=e=>{const t=[];let n=0;const r=e.length;let u;for(;n65535&&(u-=65536,t.push(String.fromCharCode(u>>>10&1023|55296)),u=56320|1023&u),t.push(String.fromCharCode(u))}return t.join("")};function c(e,t,n){let r;for(e=n?Math.floor(e/700):e>>1,e+=Math.floor(e/t),r=0;e>455;r+=36)e=Math.floor(e/35);return Math.floor(r+36*e/(e+38))}function d(e,t){const n=[],r=[],u=e.length;let d,a,i,s,f,l,b,h,m,p,g,y,v;for(d=128,i=0,s=72,f=e.lastIndexOf("-"),f<0&&(f=0),l=0;l=128)throw new RangeError("Illegal input >= 0x80");n.push(e.charCodeAt(l))}for(b=f>0?f+1:0;b=u)throw RangeError("punycode_bad_input(1)");if(g=(O=e.charCodeAt(b++))-48<10?O-22:O-65<26?O-65:O-97<26?O-97:36,g>=36)throw RangeError("punycode_bad_input(2)");if(g>Math.floor((2147483647-i)/m))throw RangeError("punycode_overflow(1)");if(i+=g*m,y=p<=s?1:p>=s+26?26:p-s,gMath.floor(2147483647/(36-y)))throw RangeError("punycode_overflow(2)");m*=36-y}if(a=n.length+1,s=c(i-h,a,0===h),Math.floor(i/a)>2147483647-d)throw RangeError("punycode_overflow(3)");d+=Math.floor(i/a),i%=a,t&&r.splice(i,0,e.charCodeAt(b-1)-65<26),n.splice(i,0,d),i++}var O;if(t)for(i=0,v=n.length;i{const{toggleSafeLinkModal:d,openTelegramLink:a}=Object(u.d)(),b=o||t,h=e!==b,m=Object(r.m)(t=>t.ctrlKey||t.altKey||t.shiftKey||t.metaKey||!e||!e.match(i.ub)&&!e.match(i.tb)?!h||(d({url:e}),t.preventDefault(),!1):(t.preventDefault(),a({url:e}),!1),[h,a,d,e]);if(!e)return;const p=Object(s.a)(n||"text-entity-link",t.length>50&&"long-word-break-all");return r.a.createElement("a",{href:f(e),title:l(e),target:"_blank",rel:"noopener noreferrer",className:p,onClick:m,dir:c?"rtl":"auto"},b)})},function(e,t,n){"use strict";n.d(t,"e",(function(){return r})),n.d(t,"b",(function(){return u})),n.d(t,"d",(function(){return o})),n.d(t,"a",(function(){return c})),n.d(t,"c",(function(){return d}));function r(e){return e>536870912?(e/1073741824).toFixed(1)+" GB":e>524288?(e/1048576).toFixed(1)+" MB":(e/1024).toFixed(1)+" KB"}function u(e){const{fileName:t,mimeType:n}=e;return o(t,n)}function o(e,t){return e&&-1!==e.indexOf(".")?e.split(".").pop():t.split("/").pop()}function c(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 d(e){return Boolean(e.previewBlobUrl||e.thumbnail)}},function(e,t,n){"use strict";n.d(t,"b",(function(){return u})),n.d(t,"a",(function(){return c}));const r={missing_payment_information:{field:"cardNumber",fieldError:"Incorrect card number"},invalid_number:{field:"cardNumber",fieldError:"Incorrect card number"},number:{field:"cardNumber",fieldError:"Incorrect card number"},exp_year:{field:"expiry",fieldError:"Incorrect year"},exp_month:{field:"expiry",fieldError:"Incorrect month"},invalid_expiry_year:{field:"expiry",fieldError:"Incorrect year"},invalid_expiry_month:{field:"expiry",fieldError:"Incorrect month"},cvc:{field:"cvv",fieldError:"Incorrect CVV"},invalid_cvc:{field:"cvv",fieldError:"Incorrect CVV"}};function u(e){const{message:t,code:n,param:u}=e,{field:o,fieldError:c,description:d}=u?r[u]:r[n];return{field:o,fieldError:c,description:d||t}}const o={ADDRESS_STREET_LINE1_INVALID:{field:"streetLine1",fieldError:"Incorrect street address"},ADDRESS_STREET_LINE2_INVALID:{field:"streetLine2",fieldError:"Incorrect street address"},ADDRESS_CITY_INVALID:{field:"city",fieldError:"Incorrect city"},ADDRESS_COUNTRY_INVALID:{field:"countryIso2",fieldError:"Incorrect country"},ADDRESS_POSTCODE_INVALID:{field:"postCode",fieldError:"Incorrect post code"},ADDRESS_STATE_INVALID:{field:"state",fieldError:"Incorrect state"},REQ_INFO_NAME_INVALID:{field:"fullName",fieldError:"Incorrect name"},REQ_INFO_PHONE_INVALID:{field:"phone",fieldError:"Incorrect phone"},REQ_INFO_EMAIL_INVALID:{field:"email",fieldError:"Incorrect email"}};function c(e){return Object.values(e).reduce((e,t)=>{if(!("hasErrorKey"in t)||!t.hasErrorKey)return e;const n=o[t.message];return n&&(e={...e,[n.field]:n.fieldError}),e},{})}},function(e,t,n){"use strict";n.d(t,"b",(function(){return o})),n.d(t,"a",(function(){return c}));var r=n(10);let u;function o(e,t){t||(u&&!u.isCancelled&&(u.isCancelled=!0),u=t={isCancelled:!1}),Object(r.b)(()=>{!t.isCancelled&&e()&&o(e,t)})}function c(e){Object(r.b)(()=>{e()&&c(e)})}},function(e,t,n){"use strict";var r=n(0),u=n(55);n(98);t.a=({trigger:e,className:t,children:n,positionX:o="left",positionY:c="top",footer:d,forceOpen:a,onOpen:i,onClose:s})=>{const f=Object(r.q)(null),l=Object(r.q)(null),[b,h]=Object(r.r)(!1);return r.a.createElement("div",{ref:l,className:"DropdownMenu "+(t||""),onKeyDown:e=>{const t=f.current;if(!b||40!==e.keyCode||!t)return;const n=document.activeElement,r=Array.from(t.children);n&&-1!==r.indexOf(n)||r[0].focus()}},e({onTrigger:()=>{h(!b),b?s&&s():i&&i()},isOpen:b}),r.a.createElement(u.a,{ref:f,containerRef:l,isOpen:b||!!a,className:t||"",positionX:o,positionY:c,footer:d,autoClose:!0,onClose:()=>{h(!1),s&&s()},shouldSkipTransition:a},n))}},function(e,t,n){"use strict";var r=n(0);t.a=(e,t,n,u,o)=>{const[c,d]=Object(r.r)(-1);Object(r.n)(()=>{d(-1);const n=e.current;t&&n&&!o&&(n.tabIndex=-1,n.focus())},[e,t,o]);return Object(r.m)(t=>{const r=e.current;if(!r)return;if(13===t.keyCode&&n)return void n(c);if(38!==t.keyCode&&40!==t.keyCode)return;const o=document.activeElement,a=Array.from(u?r.querySelectorAll(u):r.children);let i=o&&a.indexOf(o)||c;if(38===t.keyCode&&i>0)i--;else if(40===t.keyCode&&i{if(e.length>24)return!1;if(!Boolean(e.match(u)))return!1;let t=0;for(;r.a.exec(e);)if(t++,t>3)return r.a.lastIndex=0,!1;return t}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return c}));const r=["female_sign","male_sign","medical_symbol"];function u(e){const t=e.split("-").map(e=>parseInt(e,16));return String.fromCodePoint(...t)}function o(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 c(e){const t={categories:[],emojis:{}};for(let n=0;n{void 0!==e.props[r]&&void 0===t.props[r]&&g(n,r,e.props[r])}),u.forEach(r=>{void 0!==t.props[r]&&e.props[r]!==t.props[r]&&(void 0===e.props[r]?p(n,r,t.props[r]):function(e,t,n,r){"value"===t?e.value=void 0!==r?r:"":(g(e,t,n),p(e,t,r))}(n,r,e.props[r],t.props[r]))})}(t,n,Object(r.b)(t)),n.children=function(e,t,n){if(t.props.teactFastList)return function(e,t,n){const u=new Set(t.children.map(e=>{const t="props"in e&&e.props.key;return o.r&&Object(r.f)(e)&&!t&&console.warn("Missing `key` in `teactFastList`"),t}));let c=0;const d=e.children.reduce((e,r,o)=>{let d="props"in r?r.props.key:void 0;if(d&&!u.has(d))return f(n,r,void 0,t,-1),e;if(!d){const u=t.children[o],c=u&&"props"in u?u.props.key:void 0;if(!u||c)return f(n,r,void 0,t,-1),e;d="__indexKey#"+o}return e[d]={$element:r,index:c++,order:"props"in r?r.props.teactOrderKey:void 0},e},{});let a,i,s=[],l=0;t.children.forEach((e,r)=>{const u="props"in e?e.props.key:"__indexKey#"+r,o=d[u];if(!o)return a||(a=[],i=r),void a.push(e);a&&(s=s.concat(m(a,i,n,t)),i=void 0,a=void 0);const c="props"in e?e.props.teactOrderKey:void 0,b=o.index!==l&&o.order!==c,h=b&&l>o.index;b&&!h||l++,s.push(f(n,o.$element,e,t,r,{forceIndex:!0,...b&&{moveDirection:h?"down":"up"}}))}),a&&(s=s.concat(m(a,i,n,t)));return s}(e,t,n);const u=Math.max(e.children.length,t.children.length),c=[],d=t.children.length>e.children.length+1?document.createDocumentFragment():void 0;for(let r=0;r=e.children.length?{fragment:d}:void 0);u&&c.push(u)}d&&n.appendChild(d);return c}(t,n,u?e:Object(r.b)(t))}}return n}function l(e,t,n,u){if(!Object(r.d)(e))return e;const{componentInstance:o}=e;if(!o.isMounted){b(e=Object(r.i)(o),t,n,u);const c=e.children[0];Object(r.d)(c)&&(e.children=[l(c,e,0,u)]),o.isMounted=!0}return e}function b(e,t,n,r){const{componentInstance:u}=e;u.onUpdate=()=>{t.children[n]=f(r,t.children[n],u.$element,t,n,{skipComponentUpdate:!0})}}function h(e){if(Object(r.e)(e))return document.createTextNode("");if(Object(r.g)(e))return document.createTextNode(e.value);if(Object(r.d)(e))return h(e.children[0]);const{tag:t,props:n,children:u=[]}=e,o=document.createElement(t);return"object"==typeof n.ref&&(n.ref.current=o),Object.keys(n).forEach(e=>{p(o,e,n[e])}),e.children=u.map((t,n)=>f(o,void 0,t,e,n)),o}function m(e,t,n,r){if(1===e.length)return[f(n,void 0,e[0],r,t,{forceIndex:!0})];if(e.length>1){const u=document.createDocumentFragment(),o=e.map(e=>f(n,void 0,e,r,t,{fragment:u}));return n.childNodes[t]?n.insertBefore(u,n.childNodes[t]):n.appendChild(u),o}throw new Error("Unexpected input")}function p(e,t,n){void 0!==n&&("className"===t?e.className=n:"value"===t?e.value=n:"style"===t?e.style.cssText=n:t.startsWith("on")?Object(c.a)(e,t,n,t.endsWith("Capture")):t.startsWith("data-")||a.has(t)?e.setAttribute(t,n):d.has(t)||(e[i[t]||t]=n))}function g(e,t,n){"className"===t?e.className="":"value"===t?e.value="":"style"===t?e.style.cssText="":t.startsWith("on")?Object(c.c)(e,t,n,t.endsWith("Capture")):t.startsWith("data-")||a.has(t)?e.removeAttribute(t):d.has(t)||delete e[i[t]||t]}t.a={render:function(e,t){if(!t)return;let n=t.getAttribute("data-teact-head-id");n||(n=Object(u.a)(s),s[n]={children:[]},t.setAttribute("data-teact-head-id",n));const r=s[n];r.children=[f(t,r.children[0],e,r,0)]}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return h}));var r=n(0),u=n(4),o=n(41),c=n(22),d=n(1),a=n(3),i=n(9),s=n(32);var f=Object(d.h)(void 0,(e,t)=>Object(a.l)(t,["openUserInfo"]))(({className:e,sender:t,openUserInfo:n,children:u})=>{const o=Object(r.m)(()=>{t&&n({id:t.id})},[t,n]);return t?r.a.createElement(s.a,{className:Object(i.a)("UserLink",e),onClick:o},u):u});var l=Object(d.h)(void 0,(e,t)=>Object(a.l)(t,["focusMessage"]))(({className:e,message:t,children:n,focusMessage:u})=>{const o=Object(r.m)(()=>{t&&u({chatId:t.chatId,messageId:t.id})},[u,t]);return t?r.a.createElement(s.a,{className:Object(i.a)("MessageLink",e),onClick:o},n):n});var b=Object(d.h)(void 0,(e,t)=>Object(a.l)(t,["openChat"]))(({className:e,chatId:t,openChat:n,children:u})=>{const o=Object(r.m)(()=>{t&&n({id:t})},[t,n]);return t?r.a.createElement(s.a,{className:Object(i.a)("ChatLink",e),onClick:o},u):u});function h(e,t,n,d,a,i,s={}){if(!t.content.action)return[];const{text:f,translationValues:h}=t.content.action,g=[],y={...s,maxTextLength:32};let v,O=p(e("Chat.Service.Group.UpdatedPinnedMessage1"!==f||a?f:"Message.PinnedGenericMessage",h&&h.length?h:void 0),"%action_origin%",n?!s.isEmbedded&&function(e,t,n){return Object(u.ib)(t)?function(e,t,n){const d=Object(o.a)(Object(u.k)(e,t));if(n)return d;return r.a.createElement(b,{className:"action-link",chatId:t.id},t&&Object(c.a)(d))}(e,t,n):m(t,n)}(e,n,s.asPlain)||" ":"User");return v=O.pop(),g.push(...O),O=p(v,"%target_user%",d?d.map(e=>m(e,s.asPlain)).filter(Boolean):"User"),v=O.pop(),g.push(...O),O=p(v,"%message%",a?function(e,t,n={}){const d=Object(u.O)(e,t),{photo:a,video:i,document:s,sticker:f}=Object(u.v)(t),{maxTextLength:b,isEmbedded:h,asPlain:m}=n,p=h&&d&&!a&&!i&&!s&&!f;let g=Object(o.a)(d,b);h&&(a?g="a photo":i?g=i.isGif?"a GIF":"a video":s?g="a document":f&&(g=d));if(m)return p?`«${g}»`:g;if(p)return r.a.createElement("span",null,"«",r.a.createElement(l,{className:"action-link",message:t},Object(c.a)(g)),"»");return r.a.createElement(l,{className:"action-link",message:t},Object(c.a)(g))}(e,a,y):"a message"),v=O.pop(),g.push(...O),O=p(v,"%product%",a?function(e){return e.content&&e.content.invoice?e.content.invoice.title:"a product"}(a):"a product"),v=O.pop(),g.push(...O),O=p(v,"%target_chat%",i?function(e,t){if(t)return"another chat";return r.a.createElement(b,{className:"action-link",chatId:e},"another chat")}(i,s.asPlain):"another chat"),g.push(...O),s.asPlain?g.join("").trim():g}function m(e,t){const n=Object(o.a)(Object(u.bb)(e));return t?n:r.a.createElement(f,{className:"action-link",sender:e},e&&Object(c.a)(n))}function p(e,t,n){const r=e.indexOf(t);if(r<0||!n)return[e];const u=[];return u.push(e.substring(0,r)),Array.isArray(n)?n.forEach((e,t)=>{u.push(e),t+1({userOrChat:t?Object(c.Jb)(e,t):void 0}),(e,t)=>Object(o.l)(t,["openChat","openChatByUsername"]))(({username:e,userOrChat:t,children:n,openChat:u,openChatByUsername:o})=>r.a.createElement("a",{onClick:()=>{t?u({id:t.id}):e&&o({username:e.substring(1)})},className:"text-entity-link",dir:"auto"},n))},function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(2);function u(e){"function"==typeof window.navigator.setAppBadge&&window.navigator.setAppBadge(e).catch(e=>{r.r&&console.error(e)})}},function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(0);function u(e,t,n){Object(r.n)(()=>{const r=e=>{const r=t.current,u=e.target;r&&u&&(r.contains(e.target)&&!u.classList.contains("backdrop")||(e.preventDefault(),e.stopPropagation(),n&&n()))};return e&&n&&document.addEventListener("mousedown",r),()=>{document.removeEventListener("mousedown",r)}},[e,t,n])}},function(e,t,n){e.exports=function(){return new Worker(n.p+"d8ff794b74bf32a92230.worker.js")}},function(e,t,n){e.exports=function(){return new Worker(n.p+"5054ce745024de60a724.worker.js")}},function(e,t,n){e.exports=function(){return new Worker(n.p+"695e66b225ec96107343.worker.js")}},function(e,t,n){e.exports=function(){return new Worker(n.p+"4c9029ba18603b924ede.worker.js")}},function(e,t,n){"use strict";var r=n(1),u=n(2),o=n(6),c=n(14),d=n(45),a=n(7);!function(){function e(){const e=document.documentElement.className.match(/theme-(\w+)/),t=e?e[1]:"light",n=Object(r.e)(),o=Object(a.Db)(n),{animationLevel:c}=n.settings.byKey;o!==t&&(Object(d.a)(o,c===u.e),Object(r.g)({...n}))}const t=window.matchMedia("(prefers-color-scheme: dark)");"function"==typeof t.addEventListener?t.addEventListener("change",e):"function"==typeof t.addListener&&t.addListener(e)}(),Object(r.b)("init",e=>{const{animationLevel:t,messageTextSize:n,language:r}=e.settings.byKey,i=Object(a.Db)(e);Object(c.d)(r,void 0,!0),document.documentElement.style.setProperty("--composer-text-size",Math.max(n,o.e?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(o.n?"is-touch-env":"is-pointer-env"),Object(d.a)(i,t===u.e),o.j&&document.body.classList.add("is-safari"),o.e?document.body.classList.add("is-ios"):o.b?document.body.classList.add("is-android"):o.f&&document.body.classList.add("is-macos")}),Object(r.b)("setIsUiReady",(e,t,n)=>{const{uiReadyState:r}=n;return 2===r&&document.body.classList.remove("initial"),{...e,uiReadyState:r}}),Object(r.b)("setAuthPhoneNumber",(e,t,n)=>{const{phoneNumber:r}=n;return{...e,authPhoneNumber:r}}),Object(r.b)("setAuthRememberMe",(e,t,n)=>({...e,authRememberMe:Boolean(n)})),Object(r.b)("clearAuthError",e=>({...e,authError:void 0})),Object(r.b)("disableHistoryAnimations",()=>{setTimeout(()=>{Object(r.g)({...Object(r.e)(),shouldSkipHistoryAnimations:!1}),document.body.classList.remove("no-animate")},450),Object(r.g)({...Object(r.e)(),shouldSkipHistoryAnimations:!0},!0)})},function(e,t,n){"use strict";var r=n(1),u=n(11);Object(r.b)("setSettingOption",(e,t,n)=>Object(u.w)(e,n)),Object(r.b)("setThemeSettings",(e,t,n)=>{const{theme:r,...o}=n;return Object(u.x)(e,r,o)})},function(e,t,n){"use strict";var r=n(1),u=n(5),o=n(2),c=n(6),d=n(34),a=n(12),i=n(79),s=n(18);Object(r.b)("initApi",(e,t)=>{(async()=>{o.N||(await Object(s.d)(),Object(s.a)()),Object(u.c)(t.apiUpdate,{userAgent:navigator.userAgent,platform:c.r,sessionData:Object(s.e)()})})()}),Object(r.b)("setAuthPhoneNumber",(e,t,n)=>{const{phoneNumber:r}=n;return Object(u.a)("provideAuthPhoneNumber",r.replace(/[^\d]/g,"")),{...e,authIsLoading:!0,authError:void 0}}),Object(r.b)("setAuthCode",(e,t,n)=>{const{code:r}=n;return Object(u.a)("provideAuthCode",r),{...e,authIsLoading:!0,authError:void 0}}),Object(r.b)("setAuthPassword",(e,t,n)=>{const{password:r}=n;return Object(u.a)("provideAuthPassword",r),{...e,authIsLoading:!0,authError:void 0}}),Object(r.b)("uploadProfilePhoto",(e,t,n)=>{const{file:r}=n;Object(u.a)("uploadProfilePhoto",r)}),Object(r.b)("signUp",(e,t,n)=>{const{firstName:r,lastName:o}=n;return Object(u.a)("provideAuthRegistration",{firstName:r,lastName:o}),{...e,authIsLoading:!0,authError:void 0}}),Object(r.b)("returnToAuthPhoneNumber",e=>(Object(u.a)("restartAuth"),{...e,authError:void 0})),Object(r.b)("goToAuthQrCode",e=>(Object(u.a)("restartAuthWithQr"),{...e,authIsLoadingQrCode:!0,authError:void 0})),Object(r.b)("saveSession",(e,t,n)=>{const{sessionData:r}=n;r?Object(s.f)(n.sessionData,e.currentUserId):Object(s.b)()}),Object(r.b)("signOut",()=>{(async()=>{try{await Object(d.d)(),await Object(u.a)("destroy")}catch(e){}Object(r.d)().reset()})()}),Object(r.b)("reset",()=>{Object(s.b)(),a.b(o.Y),a.b(o.Z),a.b(o.ab),a.b(o.o);const e=o.O.replace(/\d+$/,""),t=(o.O.match(/\d+$/)||[0])[0];for(let n=0;n{(async()=>{await Object(u.a)("disconnect")})()}),Object(r.b)("loadNearestCountry",e=>{"connectionStateReady"===e.connectionState&&(async()=>{const e=await Object(u.a)("fetchNearestCountry");Object(r.g)({...Object(r.e)(),authNearestCountry:e})})()}),Object(r.b)("setDeviceToken",(e,t,n)=>{Object(r.g)({...e,push:{deviceToken:n,subscribedAt:Date.now()}})}),Object(r.b)("deleteDeviceToken",e=>{const t={...e};delete t.push,Object(r.g)(t)})},function(e,t,n){"use strict";var r=n(1),u=n(13),o=n(5),c=n(3),d=n(7),a=n(11),i=n(4);function s(e,{visibility:t,allowedIds:n,deniedIds:r}){const{users:{byId:u},chats:{byId:o}}=e,c={visibility:t};let d,a;const s=e=>{if(!Object(i.ob)(e))return;const{id:t,accessHash:n}=u[e]||{};return t?{id:t,accessHash:n}:void 0},f=e=>{if(Object(i.ob)(e))return;const t=o[e];return t?{id:t.id}:void 0};return"contacts"!==t&&"nobody"!==t||(d=n.map(s).filter(Boolean),a=n.map(f).filter(Boolean),d.length>0&&(c.allowedUsers=d),a.length>0&&(c.allowedChats=a)),"everybody"!==t&&"contacts"!==t||(d=r.map(s).filter(Boolean),a=r.map(f).filter(Boolean),d.length>0&&(c.blockedUsers=d),a.length>0&&(c.blockedChats=a)),c}Object(r.b)("updateProfile",(e,t,n)=>{const{photo:c,firstName:i,lastName:s,bio:f,username:l}=n;(async()=>{const{currentUserId:t}=e;if(t){if(Object(r.g)({...Object(r.e)(),profileEdit:{progress:u.k.InProgress}}),c&&await Object(o.a)("updateProfilePhoto",c),i||s||f){if(await Object(o.a)("updateProfile",{firstName:i,lastName:s,about:f})){e=Object(r.e)();const n=t&&Object(d.Jb)(e,t);n&&Object(r.g)(Object(a.ob)(e,n.id,{firstName:i,lastName:s,fullInfo:{...n.fullInfo,bio:f}}))}}if(l){await Object(o.a)("updateUsername",l)&&t&&Object(r.g)(Object(a.ob)(Object(r.e)(),t,{username:l}))}Object(r.g)({...Object(r.e)(),profileEdit:{progress:u.k.Complete}})}})()}),Object(r.b)("checkUsername",(e,t,n)=>{const{username:c}=n;(async()=>{if(e.profileEdit&&e.profileEdit.progress===u.k.InProgress)return;Object(r.g)({...e,profileEdit:{progress:e.profileEdit?e.profileEdit.progress:u.k.Idle,isUsernameAvailable:void 0}});const t=await Object(o.a)("checkUsername",c);e=Object(r.e)(),Object(r.g)({...e,profileEdit:{...e.profileEdit,isUsernameAvailable:t}})})()}),Object(r.b)("loadWallpapers",()=>{(async()=>{const e=await Object(o.a)("fetchWallpapers",0);if(!e)return;const t=Object(r.e)();Object(r.g)({...t,settings:{...t.settings,loadedWallpapers:e.wallpapers}})})()}),Object(r.b)("uploadWallpaper",(e,t,n)=>{const c=n,d=URL.createObjectURL(c);Object(r.g)({...e,settings:{...e.settings,loadedWallpapers:[{slug:u.o,document:{fileName:"",size:c.size,mimeType:c.type,previewBlobUrl:d}},...e.settings.loadedWallpapers||[]]}}),(async()=>{const t=await Object(o.a)("uploadWallpaper",c);if(!t)return;const{wallpaper:n}=t;if(!(e=Object(r.e)()).settings.loadedWallpapers)return;const a=e.settings.loadedWallpapers[0];if(!a||a.slug!==u.o)return;const i={...n,document:{...n.document,previewBlobUrl:d}};Object(r.g)({...e,settings:{...e.settings,loadedWallpapers:[i,...e.settings.loadedWallpapers.slice(1)]}})})()}),Object(r.b)("loadBlockedContacts",()=>{(async()=>{const e=await Object(o.a)("fetchBlockedContacts");if(!e)return;let t=Object(r.e)();e.users&&e.users.length&&(t=Object(a.g)(t,Object(c.c)(e.users,"id"))),e.chats&&e.chats.length&&(t=Object(a.N)(t,Object(c.c)(e.chats,"id"))),t={...t,blocked:{...t.blocked,ids:[...t.blocked.ids||[],...e.blockedIds],totalCount:e.totalCount}},Object(r.g)(t)})()}),Object(r.b)("blockContact",(e,t,n)=>{const{contactId:u,accessHash:c}=n;(async()=>{if(!await Object(o.a)("blockContact",u,c))return;const e=Object(r.e)();Object(r.g)(Object(a.a)(e,u))})()}),Object(r.b)("unblockContact",(e,t,n)=>{const{contactId:u}=n;let c;if(Object(i.ob)(u)){const t=Object(d.Jb)(e,u);if(!t)return;c=t.accessHash}(async()=>{if(!await Object(o.a)("unblockContact",u,c))return;const e=Object(r.e)();Object(r.g)(Object(a.q)(e,u))})()}),Object(r.b)("loadAuthorizations",()=>{(async()=>{const e=await Object(o.a)("fetchAuthorizations");e&&Object(r.g)({...Object(r.e)(),activeSessions:e})})()}),Object(r.b)("terminateAuthorization",(e,t,n)=>{const{hash:u}=n;(async()=>{if(!await Object(o.a)("terminateAuthorization",u))return;const e=Object(r.e)();Object(r.g)({...e,activeSessions:e.activeSessions.filter(e=>e.hash!==u)})})()}),Object(r.b)("terminateAllAuthorizations",()=>{(async()=>{if(!await Object(o.a)("terminateAllAuthorizations"))return;const e=Object(r.e)();Object(r.g)({...e,activeSessions:e.activeSessions.filter(e=>e.isCurrent)})})()}),Object(r.b)("loadNotificationExceptions",e=>{const{serverTimeOffset:t}=e;(async()=>{const e=await Object(o.a)("fetchNotificationExceptions",{serverTimeOffset:t});e&&Object(r.g)(Object(a.f)(Object(r.e)(),e))})()}),Object(r.b)("loadNotificationSettings",e=>{const{serverTimeOffset:t}=e;(async()=>{const e=await Object(o.a)("fetchNotificationSettings",{serverTimeOffset:t});e&&Object(r.g)(Object(a.w)(Object(r.e)(),e))})()}),Object(r.b)("updateNotificationSettings",(e,t,n)=>{const{peerType:u,isSilent:c,shouldShowPreviews:d}=n;(async()=>{await Object(o.a)("updateNotificationSettings",u,{isSilent:c,shouldShowPreviews:d})&&Object(r.g)(Object(a.db)(Object(r.e)(),u,c,d))})()}),Object(r.b)("updateContactSignUpNotification",(e,t,n)=>{const{isSilent:u}=n;(async()=>{await Object(o.a)("updateContactSignUpNotification",u)&&Object(r.g)(Object(a.w)(Object(r.e)(),{hasContactJoinedNotifications:!u}))})()}),Object(r.b)("loadLanguages",()=>{(async()=>{const e=await Object(o.a)("fetchLanguages");e&&Object(r.g)(Object(a.w)(Object(r.e)(),{languages:e}))})()}),Object(r.b)("loadPrivacySettings",()=>{(async()=>{const[e,t,n,u,c]=await Promise.all([Object(o.a)("fetchPrivacySettings","phoneNumber"),Object(o.a)("fetchPrivacySettings","lastSeen"),Object(o.a)("fetchPrivacySettings","profilePhoto"),Object(o.a)("fetchPrivacySettings","forwards"),Object(o.a)("fetchPrivacySettings","chatInvite")]);if(!(e&&t&&n&&u&&c))return;const d=Object(r.e)();d.settings.privacy.phoneNumber=e,d.settings.privacy.lastSeen=t,d.settings.privacy.profilePhoto=n,d.settings.privacy.forwards=u,d.settings.privacy.chatInvite=c,Object(r.g)(d)})()}),Object(r.b)("setPrivacyVisibility",(e,t,n)=>{const{privacyKey:u,visibility:c}=n,{privacy:{[u]:d}}=e.settings;if(!d)return;const a=s(e,{visibility:c,allowedIds:[...d.allowUserIds,...d.allowChatIds],deniedIds:[...d.blockUserIds,...d.blockChatIds]});(async()=>{const e=await Object(o.a)("setPrivacySettings",u,a);if(e){const t=Object(r.e)();t.settings.privacy[u]=e,Object(r.g)(t)}})()}),Object(r.b)("setPrivacySettings",(e,t,n)=>{const{privacyKey:u,isAllowList:c,contactsIds:d}=n,{privacy:{[u]:a}}=e.settings;if(!a)return;const i=s(e,{visibility:a.visibility,allowedIds:c?d:[...a.allowUserIds,...a.allowChatIds],deniedIds:c?[...a.blockUserIds,...a.blockChatIds]:d});(async()=>{const e=await Object(o.a)("setPrivacySettings",u,i);if(e){const t=Object(r.e)();t.settings.privacy[u]=e,Object(r.g)(t)}})()}),Object(r.b)("updateIsOnline",(e,t,n)=>{Object(o.a)("updateIsOnline",n)}),Object(r.b)("loadContentSettings",()=>{(async()=>{const e=await Object(o.a)("fetchContentSettings");e&&Object(r.g)(Object(a.w)(Object(r.e)(),e))})()}),Object(r.b)("updateContentSettings",(e,t,n)=>{(async()=>{Object(r.g)(Object(a.w)(Object(r.e)(),{isSensitiveEnabled:n}));await Object(o.a)("updateContentSettings",n)||Object(r.g)(Object(a.w)(Object(r.e)(),{isSensitiveEnabled:!n}))})()})},function(e,t,n){"use strict";var r=n(1),u=n(2),o=n(34),c=n(11),d=n(14);Object(r.b)("apiUpdate",(e,t,n)=>{switch(u.r&&"updateUserStatus"!==n["@type"]&&"updateServerTimeOffset"!==n["@type"]&&console.log("[GramJs] UPDATE",n["@type"],{update:n}),n["@type"]){case"updateApiReady":!function(e){Object(o.c)(),Object(d.d)(e.settings.byKey.language)}(e);break;case"updateAuthorizationState":!function(e){let t=Object(r.e)();const n="authorizationStateReady"===t.authState,u=e.authorizationState;switch(Object(r.g)({...t,authState:u,authIsLoading:!1}),t=Object(r.e)(),u){case"authorizationStateLoggingOut":Object(r.g)({...t,isLoggingOut:!0});break;case"authorizationStateWaitCode":Object(r.g)({...t,authIsCodeViaApp:e.isCodeViaApp});break;case"authorizationStateWaitPassword":Object(r.g)({...t,authHint:e.hint});break;case"authorizationStateWaitQrCode":Object(r.g)({...t,authIsLoadingQrCode:!1,authQrCode:e.qrCode});break;case"authorizationStateReady":if(n)break;Object(r.g)({...t,isLoggingOut:!1,lastSyncTime:Date.now()})}}(n);break;case"updateAuthorizationError":!function(e){Object(r.g)({...Object(r.e)(),authError:e.message})}(n);break;case"updateConnectionState":!function(e){const{connectionState:t}=e,n=Object(r.e)();Object(r.g)({...n,connectionState:t}),"connectionStateReady"===t&&"authorizationStateReady"===n.authState?Object(r.d)().sync():"connectionStateBroken"===t&&Object(r.d)().signOut()}(n);break;case"updateSession":!function(e){const{sessionData:t}=e,{authRememberMe:n,authState:u}=Object(r.e)(),o=!t||!t.mainDcId;if(!n||"authorizationStateReady"!==u||o)return;Object(r.d)().saveSession({sessionData:t})}(n);break;case"updateServerTimeOffset":!function(e){const t=Object(r.e)();if(t.serverTimeOffset===e.serverTimeOffset)return;Object(r.g)({...t,serverTimeOffset:e.serverTimeOffset})}(n);break;case"updateCurrentUser":!function(e){const{currentUser:t}=e;Object(r.g)({...Object(c.ob)(Object(r.e)(),t.id,t),currentUserId:t.id}),function(e){const t=localStorage.getItem(u.zb);if(!t)return;const n=JSON.parse(t);n.id=e,localStorage.setItem(u.zb,JSON.stringify(n))}(t.id)}(n);break;case"error":"SESSION_REVOKED"===n.error.message&&t.signOut(),t.showDialog&&t.showDialog({data:{...n.error,hasErrorKey:!0}})}})},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){"use strict";n.r(t);n(27),function(){function e(){var t=Error.call(this,"ServiceWorker is not supported.");return Object.setPrototypeOf(t,e.prototype),t}e.prototype=Object.create(Error.prototype)}();var r=n.p+"serviceWorker.js";var u=n(2),o=n(1),c=n(6),d=n(34);function a(e){const t=e.data;if(!t.type)return;const n=Object(o.d)();switch(t.type){case"focusMessage":n.focusMessage(t.payload)}}function i(){navigator.serviceWorker.removeEventListener("message",a),navigator.serviceWorker.addEventListener("message",a),Object(d.a)()}c.k&&(window.addEventListener("load",async()=>{try{await navigator.serviceWorker.register(r),u.r&&console.log("[SW] ServiceWorker registered"),await navigator.serviceWorker.ready,navigator.serviceWorker.controller?(u.r&&console.log("[SW] ServiceWorker ready"),i()):(u.r&&console.error("[SW] ServiceWorker not available"),c.e||c.b||Object(o.d)().showDialog({data:{message:"SERVICE_WORKER_DISABLED",hasErrorKey:!0}}))}catch(e){u.r&&console.error("[SW] ServiceWorker registration failed: ",e)}}),window.addEventListener("focus",async()=>{await navigator.serviceWorker.ready,i()}));var s=n(67);const f={isLeftColumnShown:!0,isChatInfoShown:!1,newChatMembersProgress:n(13).i.Closed,uiReadyState:0,serverTimeOffset:0,authRememberMe:!0,blocked:{ids:[],totalCount:0},users:{byId:{}},chats:{listIds:{},isFullyLoaded:{},orderedPinnedIds:{},totalCount:{},byId:{}},messages:{byChatId:{},messageLists:[]},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:{},forwardMessages:{},pollResults:{},payment:{},notifications:[],dialogs:[],activeSessions:[],settings:{byKey:{theme:"light",shouldUseSystemTheme:!0,messageTextSize:c.e?u.M:c.f?u.U:u.w,animationLevel:u.d,messageSendKeyCombo:"enter",shouldAutoDownloadMediaFromContacts:!0,shouldAutoDownloadMediaInPrivateChats:!0,shouldAutoDownloadMediaInGroups:!0,shouldAutoDownloadMediaInChannels:!0,shouldAutoPlayGifs:!0,shouldAutoPlayVideos:!0,shouldSuggestStickers:!0,shouldLoopStickers:!0,language:"en"},themes:{light:{isBlurred:!0,patternColor:u.x},dark:{isBlurred:!0,patternColor:u.q}},privacy:{},notifyExceptions:{}},twoFaSettings:{},shouldShowContextMenuHint:!0};var l=n(8),b=n(10),h=n(37),m=n(3),p=n(7),g=n(18);const y=Object(b.h)(()=>Object(b.d)(E),5e3,!1);let v,O=!1,j=!1;function w(e){if(!u.I)return Object(g.c)(!0)?(I(),function(e){u.r&&console.time("global-state-cache-read");const t=localStorage.getItem(u.J),n=t?JSON.parse(t):void 0;u.r&&console.timeEnd("global-state-cache-read");n&&(n.settings.byKey={...e.settings.byKey,...n.settings.byKey},n.settings.themes={...e.settings.themes,...n.settings.themes},n.chatFolders={...e.chatFolders,...n.chatFolders},n.messages.messageLists||(n.messages.messageLists=e.messages.messageLists),n.stickers.greeting||(n.stickers.greeting=e.stickers.greeting));return{...e,...n}}(e)):void C()}function I(){O=!0,v=Object(b.c)(E,!0),window.addEventListener("blur",E),Object(o.a)(y)}function C(){O=!1,Object(o.f)(y),window.removeEventListener("blur",E),v&&v()}function E(){if(!O||j)return;const e=Object(o.e)();if(e.isLoggingOut)return;const t={...f,...Object(m.l)(e,["authState","authPhoneNumber","authRememberMe","authNearestCountry","currentUserId","contactList","topPeers","topInlineBots","recentEmojis","push","shouldShowContextMenuHint"]),isChatInfoShown:S(e),users:M(e),chats:A(e),messages:k(e),globalSearch:{recentlyFoundChatIds:e.globalSearch.recentlyFoundChatIds},settings:T(e),chatFolders:N(e)},n=JSON.stringify(t);localStorage.setItem(u.J,n)}function S(e){return window.innerWidth>u.lb&&e.isChatInfoShown}function M(e){const{users:{byId:t,selectedId:n}}=e,r=[...(e.chats.listIds.active||[]).slice(0,u.H).filter(e=>e>0),...Object.keys(t)].slice(0,u.K);return{byId:Object(m.l)(t,r),selectedId:window.innerWidth>u.lb?n:void 0}}function A(e){const t=[...(e.chats.listIds.active||[]).slice(0,u.H)],{chatId:n}=Object(p.z)(e)||{};return{...e.chats,byId:Object(m.l)(e.chats.byId,n?[...t,n]:t),listIds:{active:t},isFullyLoaded:{},orderedPinnedIds:{active:e.chats.orderedPinnedIds.active}}}function k(e){const t={},{chatId:n}=Object(p.z)(e)||{};[...(e.chats.listIds.active||[]).slice(0,u.H),...n?[n]:[]].forEach(n=>{const r=e.messages.byChatId[n];if(!r)return;const u=r.threadsById[l.MAIN_THREAD_ID];u&&u.viewportIds&&(t[n]={byId:Object(m.l)(r.byId,u.viewportIds),threadsById:{[l.MAIN_THREAD_ID]:u}})});const r=Object(p.z)(e);return{byChatId:t,messageLists:!r||c.l?[]:[{...r,threadId:l.MAIN_THREAD_ID,type:"thread"}]}}function T(e){const{byKey:t,themes:n}=e.settings;return{byKey:t,themes:n,privacy:{},notifyExceptions:{}}}function N(e){return{...e.chatFolders,activeChatFolder:0}}document.addEventListener(h.b,()=>{j=!0}),document.addEventListener(h.a,()=>{j=!1}),u.I||(Object(o.b)("saveSession",()=>{O||I()}),Object(o.b)("reset",()=>{localStorage.removeItem(u.J),O&&C()})),Object(o.b)("init",()=>{const e=Object(m.d)(f);return w(e)||e});var P=n(0),D=n(54);const L=String(Date.now()+Math.random());let x;localStorage.setItem("tt-active-tab",L);const F=window.setInterval(()=>{x&&localStorage.getItem("tt-active-tab")!==L&&(x(),clearInterval(F))},2e3);var B=n(25),R=(n(85),n(86),n(87),n(88),n(89),n(39)),U=n(36),_=n(40),$=n(17);const G=["400 1em Roboto","500 1em Roboto"];function W(){if("fonts"in document)return Promise.all(G.map(e=>document.fonts.load(e)))}var H=n(57),z=n(15),K=n(9),V=(n(91),n.p+"telegram-logo.df3a91becaa9678c529b4c4cadd45204.svg"),q=n.p+"monkey.a3d5fcdc50b18dc55695f7dd4101a8c9.svg";function J(){const{listIds:e,byId:t}=Object(o.e)().chats;if(e.active)return Promise.all(e.active.slice(0,10).map(e=>{const n=t[e];if(!n)return;const r=Object(U.d)(n);return r?H.b(r,l.ApiMediaFormat.DataUri):void 0}))}const Q={main:()=>Promise.all([Object(z.d)(z.a.Main,"Main").then(W),J()]),authPhoneNumber:()=>Promise.all([W(),Object($.g)(V)]),authCode:()=>Object($.g)(q),authPassword:()=>Object($.g)(q),authQrCode:W};var Y=Object(o.h)(e=>{const t=Object(p.Db)(e),{background:n,backgroundColor:r}=e.settings.themes[t]||{};return{shouldSkipHistoryAnimations:e.shouldSkipHistoryAnimations,uiReadyState:e.uiReadyState,hasCustomBackground:Boolean(n),hasCustomBackgroundColor:Boolean(r),isRightColumnShown:Object(p.W)(e)}},(e,t)=>Object(m.l)(t,["setIsUiReady"]))(({page:e,children:t,hasCustomBackground:n,hasCustomBackgroundColor:r,isRightColumnShown:u,shouldSkipHistoryAnimations:o,setIsUiReady:c})=>{const[d,a]=Object(B.a)(),{shouldRender:i,transitionClassNames:s}=Object(_.a)(!d,void 0,!0);return Object(P.n)(()=>{let t;return Promise.race([Object(b.f)(700),(async()=>{try{await Q[e]()}catch(e){}})()]).then(()=>{a(),c({uiReadyState:1}),t=window.setTimeout(()=>{c({uiReadyState:2})},1e3)}),()=>{t&&(clearTimeout(t),t=void 0),c({uiReadyState:0})}},[]),P.a.createElement("div",{id:"UiLoader"},t,i&&!o&&P.a.createElement("div",{className:Object(K.a)("mask",s)},"main"===e?P.a.createElement(P.a.Fragment,null,P.a.createElement("div",{className:"left"}),P.a.createElement("div",{className:Object(K.a)("middle",n&&"custom-bg-image",r&&"custom-bg-color",u&&"with-right-column")}),u&&P.a.createElement("div",{className:"right"})):P.a.createElement("div",{className:"blank"})))}),Z=n(23),X=n(14),ee=n(16),te=(e,t)=>{const[n,r]=Object(P.r)();return e&&X.c(e,t).then(r),n};function ne(){let e=navigator.language;return e&&"pt-br"!==e&&(e=e.substr(0,2)),e}var re=n(21),ue=n(48),oe=n(47),ce=n(20),de=n(53),ae=n(22),ie=n(63),se=n(43),fe=n(26);n(100);const le=200+u.c;var be=Object(P.h)(({id:e,value:t,isLoading:n,onChange:r})=>{const u=Object(ee.a)(),o=Object(P.q)(null),[c,d]=Object(P.r)(),[a,i]=Object(P.r)(Z.a);function s(e){d(e),i(function(e=""){return e.length?Z.a.filter(t=>Object(de.a)(t.name,e)):Z.a}(e))}const f=Object(P.m)(e=>{const{countryId:t}=e.currentTarget.firstElementChild.dataset,n=Z.a.find(e=>e.id===t);n&&r(n),setTimeout(()=>s(void 0),le)},[r]),l=Object(P.m)(e=>{s(e.currentTarget.value)},[]),b=Object(P.m)(e=>{if(8!==e.keyCode)return;const n=e.currentTarget;t&&void 0===c&&(n.value=""),s(n.value)},[c,t]);return P.a.createElement(ie.a,{className:"CountryCodeInput",trigger:({onTrigger:r,isOpen:d})=>{const a=()=>{if(d)return;setTimeout(()=>{o.current.select()},50),r();const e=document.getElementById("auth-phone-number-form");e.scrollTo({top:e.scrollHeight,behavior:"smooth"})},i=void 0!==c?c:t&&t.name||"";return P.a.createElement("div",{className:Object(K.a)("input-group",t&&"touched")},P.a.createElement("input",{ref:o,className:Object(K.a)("form-control",d&&"focus"),type:"text",id:e,value:i,autoComplete:"off",onClick:a,onFocus:a,onInput:l,onKeyDown:b}),P.a.createElement("label",null,u("Login.SelectCountry.Title")),n?P.a.createElement(fe.a,{color:"black"}):P.a.createElement("i",{onClick:a,className:Object(K.a)("css-icon-down",d&&"open")}))}},a.map(e=>P.a.createElement(se.a,{key:e.id,className:t&&e.id===t.id?"selected":"",onClick:f},P.a.createElement("span",{"data-country-id":e.id}),P.a.createElement("span",{className:"country-flag"},Object(ae.a)(e.flag,["hq_emoji"])),P.a.createElement("span",{className:"country-name"},e.name),P.a.createElement("span",{className:"country-code"},e.code))),!a.length&&P.a.createElement(se.a,{key:"no-results",className:"no-results",disabled:!0},P.a.createElement("span",null,u("lng_country_none"))))});let he=!1;var me=Object(P.h)(Object(o.h)(e=>{const{settings:{byKey:{language:t}}}=e;return{...Object(m.l)(e,["connectionState","authState","authPhoneNumber","authIsLoading","authIsLoadingQrCode","authError","authRememberMe","authNearestCountry"]),language:t}},(e,t)=>Object(m.l)(t,["setAuthPhoneNumber","setAuthRememberMe","clearAuthError","loadNearestCountry","goToAuthQrCode","setSettingOption"]))(({connectionState:e,authState:t,authPhoneNumber:n,authIsLoading:r,authIsLoadingQrCode:u,authError:o,authRememberMe:d,authNearestCountry:a,language:i,setAuthPhoneNumber:s,setAuthRememberMe:f,loadNearestCountry:l,clearAuthError:b,goToAuthQrCode:h,setSettingOption:m})=>{const p=Object(ee.a)(),g=Object(P.q)(null),y=ne(),v=te(y,"ContinueOnThisLanguage"),[O,j]=Object(P.r)(),[w,I]=Object(P.r)(),[C,E]=Object(P.r)(!1),[S,M]=Object(P.r)(),[A,k,T]=Object(B.a)(),N=O?`${O.code} ${w||""}`:w,D=N&&N.replace(/[^\d]+/g,"").length>=7;Object(P.n)(()=>{c.n||g.current.focus()},[O]),Object(P.n)(()=>{"connectionStateReady"!==e||a||l()},[e,a,l]),Object(P.n)(()=>{!a||O||C||j(Object(Z.d)(a))},[O,a,C]);const L=Object(P.m)(e=>{e.length||I("");const t=Object(Z.e)(e),n=!O||t&&t.id!==O.id||!t&&e.length?t:O;(!O||!n||n&&n.code!==O.code)&&j(n),I(Object(Z.b)(e,n))},[O]),x=Object(P.m)(()=>{k(),Object(X.d)(y,()=>{T(),m({language:y})})},[k,m,y,T]);Object(P.n)(()=>{void 0===w&&n&&L(n)},[n,w,L]),Object(P.o)(()=>{g.current&&S&&g.current.setSelectionRange(...S)},[S]);const F=Object(P.q)(!1),R=Object(P.m)(()=>{F.current=!0,requestAnimationFrame(()=>{F.current=!1})},[]),U=Object(P.m)(e=>{o&&b(),he||(he=!0,W(),Object($.g)(q));const{value:t,selectionStart:n,selectionEnd:r}=e.target;M(n&&r&&r1&&!F.current;L(u?`${O.code} ${t}`:t)},[o,b,O,N,L]),_=Object(P.m)(e=>{f(e.target.checked)},[f]);const G="authorizationStateWaitPhoneNumber"===t;return P.a.createElement("div",{id:"auth-phone-number-form",className:"custom-scroll"},P.a.createElement("div",{className:"auth-form"},P.a.createElement("div",{id:"logo"}),P.a.createElement("h2",null,"Telegram"),P.a.createElement("p",{className:"note"},p("StartText")),P.a.createElement("form",{action:"",onSubmit:function(e){e.preventDefault(),r||D&&s({phoneNumber:N})}},P.a.createElement(be,{id:"sign-in-phone-code",value:O,isLoading:!a&&!O,onChange:j}),P.a.createElement(oe.a,{ref:g,id:"sign-in-phone-number",label:p("Login.PhonePlaceholder"),value:N,error:o&&p(o),inputMode:"tel",onChange:U,onPaste:c.j?R:void 0}),P.a.createElement(ue.a,{id:"sign-in-keep-session",label:"Keep me signed in",checked:Boolean(d),onChange:_}),D&&(G?P.a.createElement(re.a,{type:"submit",ripple:!0,isLoading:r},p("Login.Next")):P.a.createElement(ce.a,null)),G&&P.a.createElement(re.a,{isText:!0,ripple:!0,isLoading:u,onClick:h},p("Login.QR.Login")),y&&y!==i&&v&&P.a.createElement(re.a,{isText:!0,isLoading:A,onClick:x},v))))})),pe=n(24);var ge=Object(P.h)(()=>{const e=Object(pe.a)(z.a.Auth,"AuthCode");return e?P.a.createElement(e,null):P.a.createElement(ce.a,null)});var ye=Object(P.h)(()=>{const e=Object(pe.a)(z.a.Auth,"AuthPassword");return e?P.a.createElement(e,null):P.a.createElement(ce.a,null)});var ve=Object(P.h)(()=>{const e=Object(pe.a)(z.a.Auth,"AuthRegister");return e?P.a.createElement(e,null):P.a.createElement(ce.a,null)});let Oe=null;class je{}je.render=function(e,t){Oe(e,t)},self.QrCreator=je,function(e){function t(t,n,r,u){var o={},c=e(r,n);c.u(t),c.J(),u=u||0;var d=c.h(),a=c.h()+2*u;return o.text=t,o.level=n,o.version=r,o.O=a,o.a=function(e,t){return t-=u,!(0>(e-=u)||e>=d||0>t||t>=d)&&c.a(e,t)},o}function n(e,t,n,r,u,o,c,d,a,i){function s(t,n,r,u,c,d,a){t?(e.lineTo(n+d,r+a),e.arcTo(n,r,u,c,o)):e.lineTo(n,r)}c?e.moveTo(t+o,n):e.moveTo(t,n),s(d,r,n,r,u,-o,0),s(a,r,u,t,u,0,-o),s(i,t,u,t,n,o,0),s(c,t,n,r,n,0,o)}function r(e,t,n,r,u,o,c,d,a,i){function s(t,n,r,u){e.moveTo(t+r,n),e.lineTo(t,n),e.lineTo(t,n+u),e.arcTo(t,n,t+r,n,o)}c&&s(t,n,o,o),d&&s(r,n,-o,o),a&&s(r,u,-o,-o),i&&s(t,u,o,-o)}function u(e,u){e:{var o=u.text,c=u.v,d=u.N,a=u.K,i=u.P;for(d=Math.max(1,d||1),a=Math.min(40,a||40);d<=a;d+=1)try{var s=t(o,c,d,i);break e}catch(e){}s=void 0}if(!s)return null;for(o=e.getContext("2d"),u.background&&(o.fillStyle=u.background,o.fillRect(u.left,u.top,u.size,u.size)),c=s.O,a=u.size/c,o.beginPath(),i=0;iMath.round(e*t.size)),"linear-gradient"===r)var o=e.createLinearGradient.apply(e,n);else{if("radial-gradient"!==r)throw Error("Unsupported fill");o=e.createRadialGradient.apply(e,n)}u.forEach(([e,t])=>{o.addColorStop(e,t)}),e.fillStyle=o}}(o,u),o.fill(),e}var o={minVersion:1,maxVersion:40,ecLevel:"L",left:0,top:0,size:200,fill:"#000",background:null,text:"no text",radius:.5,quiet:0};Oe=function(e,t){var n={};Object.assign(n,o,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),u(t,n)):((e=document.createElement("canvas")).width=n.size,e.height=n.size,n=u(e,n),t.appendChild(n))}}(function(){function e(u,c){function d(e,t){for(var n=-1;7>=n;n+=1)if(!(-1>=e+n||f<=e+n))for(var r=-1;7>=r;r+=1)-1>=t+r||f<=t+r||(s[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 a(e,n){for(var c=f=4*u+17,a=Array(c),h=0;h=g;g+=1)for(var y=-2;2>=y;y+=1)s[m+g][p+y]=-2==g||2==g||-2==y||2==y||0==g&&0==y}for(c=8;ca;a+=1)h=!e&&1==(c>>a&1),s[6>a?a:8>a?a+1:f-15+a][8]=h,s[8][8>a?f-a-1:9>a?15-a:14-a]=h;if(s[f-8][8]=!e,7<=u){for(c=r.A(u),a=0;18>a;a+=1)h=!e&&1==(c>>a&1),s[Math.floor(a/3)][a%3+f-8-3]=h;for(a=0;18>a;a+=1)h=!e&&1==(c>>a&1),s[a%3+f-8-3][Math.floor(a/3)]=h}if(null==l){for(e=o.I(u,i),c=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}(),a=0;a8*h)throw Error("code length overflow. ("+c.f()+">"+8*h+")");for(c.f()+4<=8*h&&c.put(0,4);0!=c.f()%8;)c.m(!1);for(;!(c.f()>=8*h)&&(c.put(236,8),!(c.f()>=8*h));)c.put(17,8);var v=0;for(h=a=0,m=Array(e.length),p=Array(e.length),g=0;gg;g+=1)null==s[a][p-g]&&(y=!1,m>>h&1)),n(a,p-g)&&(y=!y),s[a][p-g]=y,-1==--h&&(m+=1,h=7));if(0>(a+=c)||f<=a){a-=c,c=-c;break}}}var i=n[c],s=null,f=0,l=null,b=[],h={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||f<=e||0>t||f<=t)throw Error(e+","+t);return s[e][t]},h:function(){return f},J:function(){for(var e=0,t=0,n=0;8>n;n+=1){a(!0,n);var u=r.D(h);(0==n||e>u)&&(e=u,t=n)}a(!1,t)}};return h}function t(e,n){if(void 0===e.length)throw Error(e.length+"/"+n);var r=function(){for(var t=0;to.b()-e.b())return o;for(var n=u.g(o.c(0))-u.g(e.c(0)),r=Array(o.b()),c=0;cr?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]];return{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=d;d+=1)if(!(0>r+d||t<=r+d))for(var a=-1;1>=a;a+=1)0>u+a||t<=u+a||(0!=d||0!=a)&&c==e.a(r+d,u+a)&&(o+=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]}}}(),o=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]];return{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 u=0;u{const{connectionState:t,authState:n,authQrCode:r,settings:{byKey:{language:u}}}=e;return{connectionState:t,authState:n,authQrCode:r,language:u}},(e,t)=>Object(m.l)(t,["returnToAuthPhoneNumber","setSettingOption"]))(({connectionState:e,authState:t,authQrCode:n,language:r,returnToAuthPhoneNumber:u,setSettingOption:o})=>{const c=ne(),d=Object(ee.a)(),a=Object(P.q)(null),i=te(c,"ContinueOnThisLanguage"),[s,f,l]=Object(B.a)();Object(P.n)(()=>{if(!n||"connectionStateReady"!==e)return;const t=a.current;t.innerHTML="",t.classList.remove("pre-animate"),we.render({text:"tg://login?token="+n.token,radius:.5,ecLevel:"M",fill:"#4E96D4",size:280},t)},[e,n]);const b=Object(P.m)(()=>{f(),Object(X.d)(c,()=>{l(),o({language:c})})},[f,o,c,l]),h="authorizationStateWaitQrCode"===t;return P.a.createElement("div",{id:"auth-qr-form",className:"custom-scroll"},P.a.createElement("div",{className:"auth-form qr"},n?P.a.createElement("div",{key:"qr-container",className:"qr-container pre-animate",ref:a}):P.a.createElement("div",{key:"qr-loading",className:"qr-loading"},P.a.createElement(ce.a,null)),P.a.createElement("h3",null,d("Login.QR.Title")),P.a.createElement("ol",null,P.a.createElement("li",null,P.a.createElement("span",null,d("Login.QR.Help1"))),P.a.createElement("li",null,P.a.createElement("span",null,Object(ae.a)(d("Login.QR.Help2"),["simple_markdown"]))),P.a.createElement("li",null,P.a.createElement("span",null,d("Login.QR.Help3")))),h&&P.a.createElement(re.a,{isText:!0,onClick:u},d("Login.QR.Cancel")),c&&c!==r&&i&&P.a.createElement(re.a,{isText:!0,isLoading:s,onClick:b},i)))}));n(101);var Ce=Object(P.h)(Object(o.h)(e=>Object(m.l)(e,["authState"]),(e,t)=>Object(m.l)(t,["reset","initApi","returnToAuthPhoneNumber","goToAuthQrCode"]))(({authState:e,reset:t,initApi:n,returnToAuthPhoneNumber:r,goToAuthQrCode:u})=>{Object(P.n)(()=>{t(),n()},[t,n]);const o="iOS"===c.r||"Android"===c.r;switch(Object(R.a)(!o&&"authorizationStateWaitPhoneNumber"===e||o&&"authorizationStateWaitQrCode"===e,()=>{o?r():u()}),e){case"authorizationStateWaitCode":return P.a.createElement(Y,{page:"authCode",key:"authCode"},P.a.createElement(ge,null));case"authorizationStateWaitPassword":return P.a.createElement(Y,{page:"authPassword",key:"authPassword"},P.a.createElement(ye,null));case"authorizationStateWaitRegistration":return P.a.createElement(ve,null);case"authorizationStateWaitPhoneNumber":return P.a.createElement(Y,{page:"authPhoneNumber",key:"authPhoneNumber"},P.a.createElement(me,null));case"authorizationStateWaitQrCode":return P.a.createElement(Y,{page:"authQrCode",key:"authQrCode"},P.a.createElement(Ie,null));default:return o?P.a.createElement(Y,{page:"authPhoneNumber",key:"authPhoneNumber"},P.a.createElement(me,null)):P.a.createElement(Y,{page:"authQrCode",key:"authQrCode"},P.a.createElement(Ie,null))}}));var Ee=Object(P.h)(()=>{const e=Object(pe.a)(z.a.Main,"Main");return e?P.a.createElement(e,null):void 0}),Se=n.p+"app-inactive.bc7953c2dfebcabce2c43ca7dc778a89.png";n(102);var Me=()=>P.a.createElement("div",{id:"AppInactive"},P.a.createElement("div",{className:"content"},P.a.createElement("img",{src:Se,alt:""}),P.a.createElement("h3",{className:"title"},"Such error, many tabs"),P.a.createElement("div",{className:"description"},"Telegram supports only one active tab with the app.",P.a.createElement("br",null),"Please reload this page to continue using this tab or close it."),P.a.createElement("div",{className:"actions"},P.a.createElement(re.a,{isText:!0,ripple:!0,onClick:()=>{window.location.reload()}},"Reload app"))));function Ae(){return o.c.createElement(Y,{page:"main",key:"main"},o.c.createElement(Ee,null))}var ke=Object(o.h)(e=>Object(m.l)(e,["authState"]),(e,t)=>Object(m.l)(t,["disconnect"]))(({authState:e,disconnect:t})=>{const[n,r]=Object(B.a)(!1);if(Object(P.n)(()=>{Object(D.b)(),x=()=>{t(),document.title=`${u.pb}${u.L}`,r()}},[t,r]),n)return o.c.createElement(Me,null);if(e)switch(e){case"authorizationStateWaitPhoneNumber":case"authorizationStateWaitCode":case"authorizationStateWaitPassword":case"authorizationStateWaitRegistration":case"authorizationStateWaitQrCode":return o.c.createElement(Ce,null);case"authorizationStateClosed":case"authorizationStateClosing":case"authorizationStateLoggingOut":case"authorizationStateReady":return Ae()}return Object(g.c)(!0)?Ae():o.c.createElement(Ce,null)});n(103);u.r&&console.log(">>> INIT"),Object(o.d)().init(),u.r&&console.log(">>> START INITIAL RENDER"),s.a.render(o.c.createElement(ke,null),document.getElementById("root")),u.r&&console.log(">>> FINISH INITIAL RENDER"),document.addEventListener("dblclick",()=>{console.log("GLOBAL STATE",Object(o.e)())})}]); -//# sourceMappingURL=main.af5bd185d96d3f084d63.js.map \ No newline at end of file diff --git a/dist/main.af5bd185d96d3f084d63.js.map b/dist/main.af5bd185d96d3f084d63.js.map deleted file mode 100644 index 70ea6087..00000000 --- a/dist/main.af5bd185d96d3f084d63.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/lib/teact/teact.ts","webpack:///./src/lib/teact/teactn.tsx","webpack:///./src/config.ts","webpack:///./src/util/iteratees.ts","webpack:///./src/modules/helpers/messages.ts","webpack:///./src/modules/helpers/messageMedia.ts","webpack:///./src/modules/helpers/localSearch.ts","webpack:///./src/api/gramjs/worker/provider.ts","webpack:///./src/util/environmentWebp.ts","webpack:///./src/util/environmentSystemTheme.ts","webpack:///./src/util/environment.ts","webpack:///./src/modules/selectors/users.ts","webpack:///./src/modules/selectors/settings.ts","webpack:///./src/modules/selectors/chats.ts","webpack:///./src/modules/selectors/symbols.ts","webpack:///./src/modules/selectors/messages.ts","webpack:///./src/modules/selectors/localSearch.ts","webpack:///./src/modules/selectors/management.ts","webpack:///./src/modules/selectors/ui.ts","webpack:///./src/modules/selectors/globalSearch.ts","webpack:///./src/modules/selectors/payments.ts","webpack:///./src/api/types/index.ts","webpack:///./src/util/buildClassName.ts","webpack:///./src/util/schedulers.ts","webpack:///./src/modules/reducers/chats.ts","webpack:///./src/modules/reducers/messages.ts","webpack:///./src/modules/reducers/symbols.ts","webpack:///./src/modules/reducers/users.ts","webpack:///./src/modules/reducers/globalSearch.ts","webpack:///./src/modules/reducers/localSearch.ts","webpack:///./src/modules/reducers/management.ts","webpack:///./src/modules/reducers/settings.ts","webpack:///./src/modules/reducers/twoFaSettings.ts","webpack:///./src/modules/reducers/payments.ts","webpack:///./src/util/cacheApi.ts","webpack:///./src/types/index.ts","webpack:///./src/util/langProvider.ts","webpack:///./src/util/callbacks.ts","webpack:///./src/util/moduleLoader.ts","webpack:///./src/hooks/useLang.ts","webpack:///./src/util/files.ts","webpack:///./node_modules/idb-keyval/dist/esm/index.js","webpack:///./src/util/sessions.ts","webpack:///./src/lib/twemojiRegex.js","webpack:///./src/components/ui/Loading.tsx","webpack:///./src/components/ui/Button.tsx","webpack:///./src/components/common/helpers/renderText.tsx","webpack:///./src/util/countries.ts","webpack:///./src/util/phoneNumber.ts","webpack:///./src/hooks/useModuleLoader.ts","webpack:///./src/hooks/useFlag.ts","webpack:///./src/components/ui/Spinner.tsx","webpack:///./src/util/handleError.ts","webpack:///./src/util/arePropsShallowEqual.ts","webpack:///./src/hooks/usePrevious.ts","webpack:///./src/util/dateFormat.ts","webpack:///./src/hooks/useForceUpdate.ts","webpack:///./src/components/ui/Link.tsx","webpack:///./src/util/generateIdFor.ts","webpack:///./src/util/notifications.ts","webpack:///./src/modules/helpers/users.ts","webpack:///./src/modules/helpers/chats.ts","webpack:///./src/hooks/useHeavyAnimationCheck.ts","webpack:///./src/lib/teact/dom-events.ts","webpack:///./src/hooks/useHistoryBack.ts","webpack:///./src/hooks/useShowTransition.ts","webpack:///./src/util/trimText.ts","webpack:///./src/components/ui/MenuItem.tsx","webpack:///./src/components/ui/RippleEffect.tsx","webpack:///./src/util/switchTheme.ts","webpack:///./src/util/webpToPng.ts","webpack:///./src/components/ui/InputText.tsx","webpack:///./src/components/ui/Checkbox.tsx","webpack:///./src/util/captureEscKeyListener.ts","webpack:///./src/util/textFormat.ts","webpack:///./src/util/memo.ts","webpack:///./src/hooks/useOnChange.ts","webpack:///./src/util/searchWords.ts","webpack:///./src/util/windowSize.ts","webpack:///./src/components/ui/Menu.tsx","webpack:///./src/util/captureKeyboardListeners.ts","webpack:///./src/util/oggToWav.ts","webpack:///./src/util/mediaLoader.ts","webpack:///./src/hooks/useEffectWithPrevDeps.ts","webpack:///./src/lib/punycode.js","webpack:///./src/components/common/SafeLink.tsx","webpack:///./src/components/common/helpers/documentInfo.ts","webpack:///./src/modules/helpers/payments.ts","webpack:///./src/util/animation.ts","webpack:///./src/components/ui/DropdownMenu.tsx","webpack:///./src/hooks/useKeyboardListNavigation.ts","webpack:///./src/components/common/helpers/parseEmojiOnlyString.ts","webpack:///./src/util/emoji.ts","webpack:///./src/lib/teact/teact-dom.ts","webpack:///./src/components/common/UserLink.tsx","webpack:///./src/components/common/MessageLink.tsx","webpack:///./src/components/common/ChatLink.tsx","webpack:///./src/components/common/helpers/renderActionMessageText.tsx","webpack:///./src/api/types/messages.ts","webpack:///./src/api/types/media.ts","webpack:///./src/components/middle/message/MentionLink.tsx","webpack:///./src/util/appBadge.ts","webpack:///./src/hooks/useVirtualBackdrop.ts","webpack:///./src/api/gramjs/worker/worker.ts","webpack:///./node_modules/opus-recorder/dist/decoderWorker.min.js","webpack:///./node_modules/opus-recorder/dist/waveWorker.min.js","webpack:///./src/lib/webp/webp_wasm.worker.js","webpack:///./src/modules/actions/ui/initial.ts","webpack:///./src/modules/actions/ui/settings.ts","webpack:///./src/modules/actions/api/initial.ts","webpack:///./src/modules/actions/api/settings.ts","webpack:///./src/modules/actions/apiUpdaters/initial.ts","webpack:///./src/serviceWorker.ts","webpack:///./src/util/setupServiceWorker.ts","webpack:///./src/global/initial.ts","webpack:///./src/global/cache.ts","webpack:///./src/global/index.ts","webpack:///./src/util/activeTabMonitor.ts","webpack:///./src/util/fonts.ts","webpack:///./src/assets/telegram-logo.svg","webpack:///./src/assets/monkey.svg","webpack:///./src/components/common/UiLoader.tsx","webpack:///./src/hooks/useLangString.ts","webpack:///./src/components/auth/helpers/getSuggestedLanguage.ts","webpack:///./src/components/auth/CountryCodeInput.tsx","webpack:///./src/components/auth/AuthPhoneNumber.tsx","webpack:///./src/components/auth/AuthCode.async.tsx","webpack:///./src/components/auth/AuthPassword.async.tsx","webpack:///./src/components/auth/AuthRegister.async.tsx","webpack:///./node_modules/qr-creator/dist/qr-creator.es6.min.js","webpack:///./src/components/auth/AuthQrCode.tsx","webpack:///./src/components/auth/Auth.tsx","webpack:///./src/components/main/Main.async.tsx","webpack:///./src/assets/app-inactive.png","webpack:///./src/components/main/AppInactive.tsx","webpack:///./src/App.tsx","webpack:///./src/index.tsx"],"names":["webpackJsonpCallback","data","moduleId","chunkId","chunkIds","moreModules","i","resolves","length","Object","prototype","hasOwnProperty","call","installedChunks","push","modules","parentJsonpFunction","shift","installedModules","installedCssChunks","2","__webpack_require__","exports","module","l","e","promises","Promise","resolve","reject","href","fullhref","p","existingLinkTags","document","getElementsByTagName","dataHref","tag","getAttribute","rel","existingStyleTags","linkTag","createElement","type","onload","onerror","event","request","target","src","err","Error","code","parentNode","removeChild","appendChild","then","installedChunkData","promise","onScriptComplete","script","charset","timeout","nc","setAttribute","jsonpScriptSrc","error","clearTimeout","chunk","errorType","realSrc","message","name","undefined","setTimeout","head","all","m","c","d","getter","o","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","oe","console","jsonpArray","window","oldJsonpFunction","slice","s","VirtualElementTypesEnum","Fragment","renderingInstance","isEmptyElement","$element","Empty","isTextElement","Text","isTagElement","Tag","isComponentElement","Component","isRealElement","source","props","children","flatten","parsedChildren","componentInstance","isMounted","hooks","state","cursor","byCursor","effects","memos","buildComponentElement","createComponentInstance","dropEmptyTail","map","buildChildElement","buildTagElement","isEmptyPlaceholder","child","String","DEBUG_components","renderComponent","newRenderedValue","DEBUG_startAt","DEBUG","componentName","renderCount","renderTimes","DEBUG_MORE","log","performance","now","renderTime","warn","Math","round","handleError","renderedValue","newChild","hasElementChanged","$old","$new","unmountTree","forEach","hook","current","cleanup","effect","dependencies","nextValue","setter","forceUpdate","onUpdate","helpGc","unmountComponent","removeAllDelegatedListeners","mountComponent","forceUpdateComponent","currentElement","getTarget","setTarget","useState","initial","newValue","prepareForFrame","throttleWithPrimaryRaf","prepareComponentForFrame","throttleWithRaf","DEBUG_contentComponentName","useLayoutEffectBase","schedulerFn","debugKey","exec","some","dependency","causedBy","reduce","res","prevValue","join","useEffect","fastRaf","useLayoutEffect","onTickEnd","useMemo","resolver","getUnequalProps","useCallback","newCallback","useRef","memo","areEqual","arePropsShallowEqual","propsRef","renderedRef","addEventListener","orderBy","values","React","currentGlobal","reducers","callbacks","container","containers","mapStateToProps","mapReducersToProps","ownProps","mappedProps","newMappedProps","setGlobal","actions","Number","isNaN","DEBUG_componentName","keys","areMappedPropsChanged","DEBUG_updates","updateTime","Map","runCallbacks","cb","runCallbacksThrottled","newGlobal","noThrottle","getGlobal","getDispatch","addReducer","reducer","payload","onDispatch","addCallback","removeCallback","index","indexOf","splice","withGlobal","TeactNContainer","id","generateIdFor","useForceUpdate","delete","set","Array","from","PAGE_TITLE","INACTIVE_MARKER","APP_NAME","process","APP_VERSION","IS_TEST","DEBUG_ALERT_MSG","SESSION_USER_KEY","LEGACY_SESSION_KEY","GLOBAL_STATE_CACHE_DISABLED","GLOBAL_STATE_CACHE_KEY","GLOBAL_STATE_CACHE_CHAT_LIST_LIMIT","GLOBAL_STATE_CACHE_USER_LIST_LIMIT","MEDIA_CACHE_DISABLED","MEDIA_CACHE_NAME","MEDIA_CACHE_NAME_AVATARS","MEDIA_PROGRESSIVE_CACHE_NAME","CUSTOM_BG_CACHE_NAME","LANG_CACHE_NAME","isBigScreen","innerHeight","MIN_PASSWORD_LENGTH","MESSAGE_LIST_SENSITIVE_AREA","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","ALL_CHATS_PRELOAD_DISABLED","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","EDITABLE_INPUT_ID","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","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","Set","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","MEMOJI_STICKER_ID","BASE_EMOJI_KEYWORD_LANG","MENU_TRANSITION_DURATION","SLIDE_TRANSITION_DURATION","CONTENT_TYPES_FOR_QUICK_UPLOAD","RE_LINK_TEMPLATE","RE_MENTION_TEMPLATE","RE_TME_LINK","RE_TME_INVITE_LINK","SERVICE_NOTIFICATIONS_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","buildCollectionByKey","collection","byKey","member","mapValues","callback","newByKey","pick","result","pickTruthy","omit","stringKeys","filter","has","orderKey","sort","a","b","isArray","mode1","mode2","orderKey1","orderKey2","aValue1","bValue1","aValue2","bValue2","aValue","bValue","array","concat","unique","compact","Boolean","areSortedArraysEqual","array1","array2","every","item","areSortedArraysIntersecting","findIntersectionWithSet","split","chunkSize","cloneDeep","acc","findLast","predicate","RE_LINK","RegExp","getMessageKey","chatId","parseMessageKey","match","messageId","getMessageOriginalId","previousLocalId","getMessageSummaryText","lang","noEmoji","text","photo","video","audio","voice","sticker","contact","poll","invoice","content","truncatedText","substr","groupedId","isGif","emoji","trim","getMessageAudioCaption","fileName","summary","question","getMessageText","webPage","getMessageCustomShape","isRound","parseEmojiOnlyString","getMessageSingleEmoji","getFirstLinkInMessage","entities","link","find","entity","ApiMessageEntityTypes","TextUrl","url","Url","offset","substring","domain","isOwnMessage","isOutgoing","isReplyMessage","replyToMessageId","isForwardedMessage","forwardInfo","isActionMessage","action","isServiceNotificationMessage","isMessageLocal","isAnonymousOwnMessage","senderId","getSenderTitle","sender","getUserFullName","getChatTitle","getSendingState","sendingState","isHistoryClearMessage","title","performer","getMessageContent","hasMessageMedia","getMessagePhoto","getMessageVideo","getMessageDocument","getMessageSticker","getMessageContact","getMessagePoll","getMessageAction","getMessageAudio","getMessageVoice","getMessageRoundVideo","isMessageDocumentPhoto","mediaType","isMessageDocumentVideo","getMessageInvoice","getMessageWebPage","getMessageWebPagePhoto","getMessageWebPageVideo","getMessageMediaThumbDataUri","thumbnail","media","getMessageMediaThumbnail","dataUri","getMessageMediaHash","webPagePhoto","webPageVideo","messageVideo","messagePhoto","base","hasMessageLocalBlobUrl","getVideoOrAudioBaseHash","getDocumentHasPreview","IS_PROGRESSIVE_SUPPORTED","IS_SAFARI","size","mimeType","getMessageMediaFormat","fullVideo","isAnimated","ApiMediaFormat","Lottie","Progressive","IS_OPUS_SUPPORTED","BlobUrl","getMessageFileName","date","getMessageFileSize","blobUrl","previewBlobUrl","getChatMediaMessageIds","messages","listedIds","isFromSharedMedia","ids","getMessageContentIds","reverse","getPhotoFullDimensions","sizes","getPhotoInlineDimensions","getVideoDimensions","width","height","getMediaTransferState","progress","isDownloadNeeded","isUploading","isTransferring","transferProgress","messageIds","contentType","validator","matchLinkInMessageText","getMediaDuration","duration","buildChatThreadKey","threadId","worker","requestStates","requestStatesByCallback","initApi","initialArgs","Worker","update","requestState","response","callbackArgs","subscribeToWorker","makeRequest","args","callApi","fnName","cancelApiProgress","progressCallback","isCanceled","postMessage","assign","pop","catch","finally","isWebpSupportedCache","isWebpSupported","webp","Image","handleLoadOrError","hasWebp","systemThemeCache","matchMedia","matches","getSystemTheme","handleSystemThemeChange","mql","addListener","PLATFORM_ENV","userAgent","platform","navigator","os","test","getPlatform","IS_MAC_OS","IS_IOS","IS_ANDROID","IS_PWA","standalone","referrer","includes","IS_TOUCH_ENV","IS_SINGLE_COLUMN_LAYOUT","innerWidth","IS_TABLET_COLUMN_LAYOUT","IS_VOICE_RECORDING_SUPPORTED","mediaDevices","AudioContext","webkitAudioContext","IS_EMOJI_SUPPORTED","documentElement","style","IS_SERVICE_WORKER_SUPPORTED","Audio","canPlayType","IS_CANVAS_FILTER_SUPPORTED","getContext","LAYERS_ANIMATION_NAME","DPR","devicePixelRatio","MASK_IMAGE_DISABLED","selectUser","global","userId","users","byId","selectIsUserBlocked","user","fullInfo","isBlocked","selectNotifySettings","settings","selectNotifyExceptions","notifyExceptions","selectChat","chats","selectChatUser","chat","getPrivateChatUserId","selectIsChatWithSelf","currentUserId","selectIsChatWithBot","isUserBot","selectSupportChat","isSupport","selectChatOnlineCount","isChatPrivate","isChatChannel","members","onlineCount","isUserOnline","selectChatBot","selectIsChatBotNotStarted","bot","lastMessage","messageInfo","byChatId","threadsById","MAIN_THREAD_ID","selectAreActiveChatsLoaded","listIds","active","selectIsChatListed","targetList","list","selectChatListType","folderId","selectChatFolder","chatFolders","selectIsChatPinned","archived","orderedPinnedIds","chatFoldersById","pinnedChatIds","selectChatByUsername","username","usernameLowered","toLowerCase","selectCountNotMutedUnread","activeChatIds","unreadCount","selectIsChatMuted","selectCurrentStickerSearch","stickers","search","selectCurrentGifSearch","gifs","selectStickerSet","setsById","selectStickersForEmoji","stickerSets","stickersForEmoji","packs","selectAnimatedEmoji","animatedEmojis","cleanedEmoji","replace","selectCurrentMessageList","messageLists","selectCurrentChat","selectChatMessages","selectScheduledMessages","scheduledMessages","selectThreadParam","thread","selectListedIds","selectOutlyingIds","selectCurrentMessageIds","messageListType","selectViewportIds","selectPinnedIds","selectScheduledIds","selectScrollOffset","selectReplyingToId","selectEditingId","selectEditingScheduledId","selectDraft","selectNoWebPage","selectThreadInfo","selectFirstMessageId","selectReplyStack","selectThreadOriginChat","threadInfo","originChannelId","selectThreadTopMessageId","topMessageId","selectThreadByMessage","replyToTopMessageId","isMessageInCurrentMessageList","currentMessageList","selectIsViewportNewest","viewportIds","lastMessageId","selectChatMessage","chatMessages","selectScheduledMessage","selectEditingMessage","selectChatMessageByPollId","pollId","messageWithPoll","selectFocusedMessageId","focusedChatId","focusedMessage","selectIsMessageFocused","focusedId","selectOutgoingStatus","isScheduledList","lastReadOutboxMessageId","selectIsMessageUnread","selectSender","selectForwardedSender","isChannelPost","fromChatId","senderUserId","selectAllowedMessageActions","serverTimeOffset","isRestricted","isPrivate","isChatWithSelf","isBasicGroup","isChatBasicGroup","isSuperGroup","isChatSuperGroup","isChannel","isServiceNotification","isOwn","isAction","isMessageEditable","getHasAdminRight","Date","viaBotId","canReply","getCanPostInChat","hasPinPermission","isCreator","isUserRightBanned","canPin","canUnpin","pinnedMessageIds","canDelete","canReport","canDeleteForAll","canEdit","canForward","hasSticker","hasFavoriteSticker","favorite","selectIsStickerFavorite","canFaveSticker","canUnfaveSticker","canCopy","canCopyLink","canSelect","noOptions","ability","selectCanDeleteSelectedMessages","selectedMessageIds","selectedMessages","messageActions","selectCanReportSelectedMessages","selectUploadProgress","fileTransfer","fileUploads","byMessageLocalId","selectRealLastReadId","lastReadInboxMessageId","min","Infinity","selectFirstUnreadId","outlyingIds","lastReadId","isNotJoined","found","isFromScheduled","selectIsForwardModalOpen","forwardMessages","isModalShown","selectCommonBoxChatId","fromLastMessage","isCommonBoxChat","selectIsInSelectMode","selectIsMessageSelected","selectForwardedMessageIdsByGroupId","fromMessageId","selectMessageIdsByGroupId","selectIsDocumentGroupSelected","selectedIds","groupIds","selectSelectedMessagesCount","selectNewestMessageWithBotKeyboardButtons","keyboardButtons","replyHideMessageId","shouldHideKeyboardButtons","selectShouldAutoLoadMedia","shouldAutoDownloadMediaFromContacts","shouldAutoDownloadMediaInPrivateChats","shouldAutoDownloadMediaInGroups","shouldAutoDownloadMediaInChannels","isChatGroup","userOrChat","contactList","userIds","selectIsUserOrChatContact","selectShouldAutoPlayMedia","shouldAutoPlayVideos","shouldAutoPlayGifs","asGif","selectShouldLoopStickers","shouldLoopStickers","selectCurrentTextSearch","chatThreadKey","currentSearch","localTextSearch","byChatThreadKey","isActive","selectCurrentMediaSearchPeerId","localMediaSearch","currentProfileUserId","selectedId","selectCurrentMediaSearch","peerId","selectManagement","management","selectCurrentManagementType","selectIsMediaViewerOpen","mediaViewer","avatarOwnerId","selectRightColumnContentKey","isChatInfoShown","newChatMembersProgress","isAddingChatMembersShown","NewChatMembersProgress","Closed","isPollResults","pollResults","selectIsPollResultsOpen","isSearch","isManagement","currentManagement","selectCurrentManagement","isStickerSearch","query","isGifSearch","currentChatId","areActiveChatsLoaded","isUserInfo","isChatInfo","RightColumnContent","PollResults","Search","Management","StickerSearch","GifSearch","AddingMembers","UserInfo","ChatInfo","selectIsRightColumnShown","selectTheme","theme","shouldUseSystemTheme","selectCurrentGlobalSearchQuery","globalSearch","selectPaymentMessageId","payment","selectPaymentRequestId","formId","selectProviderPublishableKey","nativeParams","publishableKey","selectStripeCredentials","stripeCredentials","parts","debounce","fn","ms","shouldRunFirst","shouldRunLast","waitingTimeout","self","throttle","interval","isPending","_args","setInterval","clearInterval","throttleWith","fastPrimaryRaf","waiting","onIdle","requestIdleCallback","pause","rafPromise","fastRafCallbacks","fastRafPrimaryCallbacks","beforeUnloadCallbacks","isPrimary","requestAnimationFrame","currentCallbacks","currentPrimaryCallbacks","onBeforeUnload","isLast","unshift","replaceChatListIds","newIds","updateChatListIds","idsUpdate","replaceChats","newById","getUpdatedChat","chatUpdate","shouldOmitMinInfo","isMin","updatedChat","photos","updateChat","updateChats","updatedById","updatedChats","addChats","addedById","isAdded","addedChats","updateChatListType","listType","currentListIds","listTypeKey","currentFolderList","updateChatListSecondaryInfo","info","totalCountKey","totalCount","totalChatCount","isFullyLoaded","updateCurrentMessageList","shouldReplaceHistory","newMessageLists","last","replaceChatMessages","updateMessageStore","replaceThreadParam","paramName","threadUpdate","updateThread","addMessages","addedByChatId","messagesByChatId","addChatMessagesById","newId","updateChatMessage","messageUpdate","updatedMessage","updateScheduledMessage","replaceScheduledMessages","deleteChatMessages","deletedForwardedPosts","isLinkedChannelPost","pinnedIds","newMessageCount","messagesCount","canDeleteCurrentThread","currentThreadId","originalPost","deleteChatScheduledMessages","scheduledIds","updateListedIds","orderHistoryIds","updateOutlyingIds","addViewportId","safeReplaceViewportIds","newViewportIds","updateThreadInfo","newThreadInfo","updateThreadInfos","updates","hash","updateScheduledMessages","updateFocusedMessage","noHighlight","updateFocusDirection","direction","enterMessageSelectMode","toggleMessageSelection","childMessageIds","withShift","oldSelectedMessages","newMessageIds","newSelectedMessageIds","prevIndex","currentIndex","to","max","exitMessageSelectMode","updateStickerSets","category","sets","resultIds","updatedSets","stickerSet","existing","setIds","updateStickerSet","stickerSetId","currentStickerSet","updateGifSearch","isNew","results","nextOffset","currentResults","newResults","currentIds","gif","replaceAnimatedEmojis","updateStickersForEmoji","remoteStickers","allStickers","uniqueIds","forEmoji","rebuildStickersForEmoji","replaceUsers","getUpdatedUser","userUpdate","updatedUser","updateContactList","updatedUsers","contactUserIds","newContactUserIds","isContact","updateUser","updateUsers","addUsers","addedUsers","updateSelectedUserId","deleteUser","MEMO_EMPTY_ARRAY","updateUserSearch","searchStatePartial","userSearch","updateUserSearchFetchingStatus","newState","fetchingStatus","updateUserBlockedState","getComplexKey","updateGlobalSearch","updateGlobalSearchContent","currentContent","updateGlobalSearchResults","newFoundMessages","nextRate","resultsByType","newFoundMessagesById","foundIdsForType","foundIds","updateGlobalSearchFetchingStatus","prevFoundIds","newFoundIds","foundOrPrevFoundIds","nextOffsetId","replaceLocalTextSearch","searchParams","updateLocalTextSearch","replaceLocalTextSearchResults","updateLocalTextSearchResults","orderFoundIds","replaceLocalMediaSearch","updateLocalMediaSearchType","currentType","updateLocalMediaSearchResults","replaceLocalMediaSearchResults","updateManagementProgress","updateManagement","replaceSettings","newSettings","replaceThemeSettings","themes","addNotifyExceptions","notifyException","exceptionData","addNotifyException","updateNotifySettings","peerType","isSilent","shouldShowPreviews","hasPrivateChatsNotifications","hasPrivateChatsMessagePreview","hasGroupNotifications","hasGroupMessagePreview","hasBroadcastNotifications","hasBroadcastMessagePreview","addBlockedContact","contactId","blocked","removeBlockedContact","updateTwoFaSettings","twoFaSettings","updateShippingOptions","shippingOptions","setRequestInfoId","setPaymentStep","step","setInvoiceMessageInfo","description","photoUrl","invoiceContent","setStripeCardInfo","cardInfo","setPaymentForm","form","setReceipt","receipt","messageInvoice","clearPayment","closeInvoice","isPaymentModalOpen","cacheApi","caches","Type","async","fetch","cacheName","Request","cache","open","Blob","blob","headers","Json","json","save","cacheData","JSON","stringify","Response","put","clear","LoadMoreDirection","FocusDirection","SettingsScreens","LeftColumnContent","GlobalSearchContent","MediaViewerOrigin","ChatCreationProgress","ProfileEditProgress","ManagementProgress","ProfileState","PaymentStep","UPLOADING_WALLPAPER_SLUG","ManagementScreens","SUBSTITUTION_REGEX","PLURAL_OPTIONS","PLURAL_RULES","en","ar","ca","de","es","fa","fr","it","ko","nl","pl","pt_BR","ru","tr","uk","uz","langPack","fallbackLangPack","createCallbackManager","currentLangCode","getTranslation","format","cacheValue","cached","langString","processTranslation","importFallbackLangPack","getTranslationForLangString","langCode","translateString","remoteLangPack","remote","fetchRemoteString","setLanguage","withFallback","newLangPack","sourceLangPacks","fetchRemote","languages","langInfo","isRtl","rtl","default","template","amount","optionIndex","getPluralOption","translationSlices","initialValue","str","processTemplate","formatInteger","Bundles","LOAD_PROMISES","MEMORY_CACHE","loadModule","bundleName","moduleName","Auth","Main","Extra","handleBundleLoad","bundle","getModuleFromMemory","listeners","addLoadListener","listener","useOnChange","langProvider","File","constructor","fileBits","options","rest","super","this","dataUriToBlob","arr","mime","bstr","atob","u8arr","Uint8Array","charCodeAt","blobToDataUri","reader","FileReader","readAsDataURL","blobToFile","lastModified","preloadImage","img","preloadVideo","volume","onloadedmetadata","createPosterForVideo","race","onseeked","videoWidth","videoHeight","canvas","drawImage","toDataURL","currentTime","fetchBlob","imgToCanvas","promisifyRequest","oncomplete","onsuccess","onabort","defaultGetStoreFunc","defaultGetStore","dbName","storeName","indexedDB","onupgradeneeded","createObjectStore","dbp","txMode","db","transaction","objectStore","createStore","eachCursor","customStore","store","openCursor","continue","DC_IDS","hasStoredSession","withLegacy","localStorage","getItem","userAuthJson","userAuth","parse","dcID","storeSession","sessionData","mainDcId","hashes","setItem","dcId","clearStoredSession","removeItem","loadStoredSession","importLegacySession","sessionId","sessionJson","idb","clearLegacySessions","idbKeys","items","k","startsWith","vs16RegExp","zeroWidthJoiner","fromCharCode","removeVS16s","rawEmoji","color","className","withBackground","Button","ref","onClick","onContextMenu","onMouseDown","onMouseEnter","onMouseLeave","onFocus","pill","fluid","isText","isLoading","ariaLabel","download","disabled","ripple","faded","tabIndex","elementRef","isClicked","setIsClicked","fullClassName","buildClassName","handleClick","handleMouseDown","preventDefault","dir","aria-label","RE_LETTER_OR_DIGIT","SIMPLE_MARKDOWN_REGEX","renderText","part","filters","params","textParts","divEl","innerText","innerHTML","escapeHtml","EMOJI_REGEX","lastIndex","replaceEmojis","addLineBreaks","highlight","lowerCaseText","queryPosition","nextSymbol","newParts","links","nextLink","endsWith","addLinks","replaceSimpleMarkdown","emojis","emojiResult","nativeToUnfified","alt","line","trimmedLine","trimLeft","indentLength","repeat","entityResult","formatsCache","defaultPhoneNumberFormat","parsed","flag","phoneFormat","formatValue","phoneNumberFormat","phoneNumberGroups","count","getPhoneNumberFormat","getCountryById","countryList","getCountryFromPhoneNumber","input","phoneNumber","possibleCountries","country","formatPhoneNumber","_","p1","p2","p3","p4","p5","separator","output","formatPhoneNumberWithCode","numberWithPlus","noLoad","autoUpdate","setValue","Spinner","handleErrorEvent","ErrorEvent","reason","alert","currentProps","newProps","currentKeys","currentKeysLength","prop","usePrevious","next","shouldSkipUndefined","WEEKDAYS_FULL","MONTHS_FULL","MONTHS_FULL_LOWERCASE","month","getDayStart","datetime","setHours","getDayStartAt","getTime","toYearMonth","timestamp","getFullYear","getMonth","toIsoString","getDate","formatTime","getHours","padStart","getMinutes","formatPastTimeShort","today","weekAgo","setDate","getDay","withYear","formatDate","formatFullDate","formatMonthAndYear","isShort","formatHumanDate","noWeekdays","lowerFirst","upperFirst","yesterday","weekAhead","weekDay","day","monthIndex","formatMediaDateTime","formatMediaDuration","hours","floor","minutes","seconds","string","formatVoiceRecordDuration","durationInMs","milliseconds","formatDateToString","locale","toLocaleString","year","isValidDate","MAX_MONTH_IN_YEAR","parseDateString","matchStringDate","matchEuropeStringDate","matchNumberDate","dateParts","findIndex","timestampPlusDay","MILISECONDS_IN_DAY","toUpperCase","setTrigger","trigger","Link","random","getDeviceToken","subscription","toJSON","endpoint","checkIfPushSupported","ServiceWorkerRegistration","Notification","permission","requestPermission","unsubscribeFromPush","dispatch","deviceToken","unsubscribe","deleteDeviceToken","serviceWorkerRegistration","serviceWorker","ready","pushManager","getSubscription","areSettingsLoaded","subscribe","subscribedAt","checkIfShouldResubscribe","userVisibleOnly","setDeviceToken","DOMException","ABORT_ERR","showNewMessageNotification","isActiveChat","resultSettings","resultExceptions","loadNotificationSettings","isListed","hasFocus","checkIfShouldNotify","body","messageSender","messageAction","actionTargetMessage","targetUserIds","actionTargetUserIds","targetChatId","actionTargetChatId","actionTargetUsers","privateChatUserId","privateChatUser","actionOrigin","renderActionMessageText","asPlain","senderName","getMessageSenderName","getNotificationContent","controller","icon","badge","toString","vibrate","notification","onclick","close","focusMessage","focus","notifyClientReady","USER_COLOR_KEYS","getUserFirstOrLastName","firstName","lastName","isDeletedUser","getUserStatus","status","wasOnline","wasOnlineDate","diff","sortUserIds","usersById","priorityIds","expires","getUserColorKey","peer","abs","FOREVER_BANNED_DATE","getChatTypeString","isSelf","getChatDescription","about","getChatLink","inviteLink","getChatAvatarHash","owner","avatarHash","isChatSummaryOnly","isChatAdmin","adminRights","currentUserBannedRights","defaultBannedRights","migratedTo","getAllowedAttachmentOptions","isChatWithBot","canAttachMedia","canAttachPolls","canSendStickers","canSendGifs","canAttachEmbedLinks","isAdmin","getMessageSendingRestrictionReason","sendMessages","untilDate","getChatSlowModeOptions","slowMode","getChatOrder","joinDate","draftDate","isChatArchived","notifySettings","isMuted","getCanDeleteChat","prepareFolderListIds","chatsById","folder","chatIdsCache","excludedChatIds","includedChatIds","excludeArchived","excludeMuted","unreadMentionsCount","hasUnreadMark","excludeRead","bots","contacts","nonContacts","groups","channels","filterChatFolder","prepareChatList","folderType","chatFilter","listedChats","listIdsSet","pinnedChats","otherChats","getFolderUnreadDialogs","unreadDialogsCount","total","hasActiveDialogs","getFolderDescriptionText","emoticon","getFolderChatsCount","isChat","chatOrUser","sortChatIds","chatIds","shouldPrioritizeVerified","priority","isVerified","ANIMATION_START_EVENT","ANIMATION_END_EVENT","isAnimating","dispatchHeavyAnimationEvent","dispatchEvent","Event","handleAnimationStart","handleAnimationEnd","removeEventListener","NON_BUBBLEABLE_EVENTS","delegationRegistry","delegatedEventsByElement","documentEventCounters","element","propName","handler","asCapture","eventName","resolveEventName","canUseEventDelegation","handleEvent","resolveDelegationRegistryForName","newSet","resolveDelegatedEventsForElement","add","addDelegatedListener","removeDelegatedListener","tagName","realEventName","eventNames","realEvent","events","furtherCallsPrevented","stopPropagation","Proxy","Reflect","historyState","nextStateIndexToReplace","isHistoryAltered","isDisabled","isEdge","currentIndexes","disableHistoryBack","handleTouchStart","x","touches","pageX","handleTouchEnd","useHistoryBack","onBack","onForward","currentState","shouldReplaceNext","indexRef","isForward","prevIsActive","isClosed","indexHashRef","prevHashes","isHashChangedFromEvent","handleChange","isForceClose","prev","history","pushState","delta","realDelta","indexLast","go","replaceState","back","handlePopState","currIndex","disableHistoryAnimations","hasChanged","forceClose","isOpen","onCloseTransitionEnd","noOpenTransition","noCloseTransition","setIsClosed","closeTimeoutRef","hasOpenClassName","setHasOpenClassName","shouldHaveOpenClassName","isClosing","shouldRender","transitionClassNames","trimText","MenuItem","destructive","useLang","handleKeyDown","keyCode","data-char","location","origin","role","onKeyDown","ripples","setRipples","cleanUpDebounced","button","currentTarget","position","getBoundingClientRect","rippleSize","offsetWidth","clientX","y","clientY","isInitialized","HEX_COLOR_REGEX","lerp","start","end","interpolationRatio","colors","themeColors","hexToRgb","hex","parseInt","g","applyColorAnimationStep","startIndex","endIndex","propertyColors","setProperty","withAnimation","isDarkTheme","shouldAnimate","startAt","themeColorTag","querySelector","classList","remove","animateSingle","transition","EMPTY_IMAGE_DATA_URI","webpToPng","initWebpWorker","wasmReady","requests","getDecodePromise","ImageData","putImageData","toBlob","createPng","webpToPngBase64","pngBlob","WebpWorker","onmessage","handleLibWebpMessage","label","success","readOnly","placeholder","autoComplete","inputMode","maxLength","onChange","onInput","onKeyPress","onBlur","onPaste","labelText","htmlFor","subLabel","checked","blocking","onCheck","captureEscKeyListener","captureKeyboardListener","onEsc","formatFixedNumber","number","toFixed","formatIntegerCompact","views","getFirstLetters","phrase","word","prevDeps","RE_NOT_LETTER","searchWords","haystack","needle","haystackWords","needleWord","haystackWord","IS_LANDSCAPE","isLandscape","initialHeight","windowSize","updateSizes","isRefreshDisabled","handleResize","reload","vh","getIsKeyboardVisible","disableRefresh","enableRefresh","Menu","containerRef","positionX","positionY","autoClose","footer","noCloseOnBackdrop","onCloseAnimationEnd","onClose","shouldSkipTransition","menuRef","backdropContainerRef","useShowTransition","useEffectWithPrevDeps","prevIsOpen","useKeyboardListNavigation","useVirtualBackdrop","bubbleClassName","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","oggToWav","opusData","arrayBuffer","typedArray","decoderWorker","DecoderWorker","wavWorker","WavWorker","command","buffers","buffer","page","terminate","wavBitDepth","wavSampleRate","decoderSampleRate","outputBufferSampleRate","pages","asCacheApiType","DataUri","Stream","memoryCache","fetchPromises","mediaFormat","onProgress","progressiveUrl","getProgressive","mediaPng","prepared","prepareMedia","mediaSource","MediaSource","streamUrl","URL","createObjectURL","sourceBuffer","addSourceBuffer","endOfStream","appendBuffer","revokeObjectURL","fetchFromCacheOrRemote","getFromMemory","cancelProgress","mediaData","fullSize","utf16","len","RangeError","adapt","numpoints","firsttime","decode","preserveCase","case_flags","input_length","out","bias","basic","j","ic","oldi","w","digit","lastIndexOf","cp","toUnicode","domain_array","ensureProtocol","getDomain","decodedHref","decodeURI","convertPunycode","toggleSafeLinkModal","openTelegramLink","isNotSafe","ctrlKey","altKey","shiftKey","metaKey","classNames","getFileSizeString","bytes","ONE_GIGABYTE","ONE_MEGABYTE","getDocumentExtension","getFileExtension","getColorFromExtension","extension","STRIPE_ERRORS","missing_payment_information","field","fieldError","invalid_number","exp_year","exp_month","invalid_expiry_year","invalid_expiry_month","cvc","invalid_cvc","getStripeError","param","SHIPPING_ERRORS","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","getShippingErrors","dialogs","cur","hasErrorKey","currentInstance","tick","instance","isCancelled","animate","DropdownMenu","forceOpen","onOpen","dropdownRef","setIsOpen","menu","focusedElement","activeElement","elementChildren","onTrigger","onSelectWithEnter","itemSelector","noCaptureFocus","focusedIndex","setFocusedIndex","querySelectorAll","newIndex","RE_EMOJI_ONLY","twemojiRegex","DETECT_UP_TO","emojiCount","EXCLUDE_EMOJIS","unifiedToNative","unified","codePoints","fromCodePoint","pairs","uncompressEmoji","emojiData","categories","emojiRaw","names","native","image","FILTERED_ATTRIBUTES","HTML_ATTRIBUTES","MAPPED_ATTRIBUTES","autoPlay","headsByElement","renderWithVirtual","parentEl","$current","$parent","skipComponentUpdate","forceIndex","fragment","moveDirection","updateComponent","setupComponentUpdateListener","initComponent","node","createNode","childNodes","insertBefore","replaceChild","areComponents","nextSibling","newKeys","removeAttribute","addAttribute","oldValue","updateAttribute","updateAttributes","currentEl","teactFastList","$newChild","currentRemainingIndex","remainingByKey","$currentChild","newChildKey","order","teactOrderKey","fragmentQueue","fragmentIndex","newChildren","currentPreservedIndex","currentChildInfo","flushFragmentQueue","shouldMoveNode","isMovingDown","renderFastListChildren","createDocumentFragment","renderChildren","$firstChild","createTextNode","$child","$fragmentChild","cssText","render","headId","$head","openUserInfo","handleMessageClick","openChat","targetUsers","targetMessage","translationValues","textOptions","maxTextLength","unprocessed","processed","processPlaceholder","isEmbedded","renderChatContent","renderUserContent","renderOriginContent","showQuotes","messageText","renderMessageContent","renderProductContent","renderMigratedContent","replaceValue","placeholderPosition","MESSAGE_DELETED","openChatByUsername","updateAppBadge","setAppBadge","contains","currentThemeMatch","currentTheme","nextTheme","animationLevel","switchTheme","subscribeToSystemThemeChange","messageTextSize","language","uiReadyState","authPhoneNumber","authRememberMe","authError","shouldSkipHistoryAnimations","apiUpdate","authIsLoading","password","file","authIsLoadingQrCode","reset","langCachePrefix","langCacheVersion","init","connectionState","authNearestCountry","buildInputPrivacyRules","visibility","allowedIds","deniedIds","rules","collectUsers","accessHash","collectChats","allowedUsers","allowedChats","blockedUsers","blockedChats","bio","profileEdit","InProgress","currentUser","Complete","Idle","isUsernameAvailable","loadedWallpapers","wallpapers","slug","wallpaper","firstWallpaper","withLocalMedia","blockedIds","activeSessions","session","isCurrent","hasContactJoinedNotifications","phoneNumberSettings","lastSeenSettings","profilePhotoSettings","forwardsSettings","chatInviteSettings","privacy","lastSeen","profilePhoto","forwards","chatInvite","privacyKey","allowUserIds","allowChatIds","blockUserIds","blockChatIds","isAllowList","contactsIds","isSensitiveEnabled","onUpdateApiReady","wasAuthReady","authState","authorizationState","isLoggingOut","authIsCodeViaApp","isCodeViaApp","authHint","hint","authQrCode","qrCode","lastSyncTime","onUpdateAuthorizationState","onUpdateAuthorizationError","sync","signOut","onUpdateConnectionState","isEmpty","saveSession","onUpdateSession","onUpdateServerTimeOffset","sessionUserAuth","updateSessionUserId","onUpdateCurrentUser","showDialog","ServiceWorkerNoSupportError","setPrototypeOf","scriptUrl","handleWorkerMessage","register","INITIAL_STATE","isLeftColumnShown","activeChatFolder","recentEmojis","added","recent","greeting","featured","emojiKeywords","saved","inlineBots","byUsername","topPeers","topInlineBots","audioPlayer","notifications","messageSendKeyCombo","shouldSuggestStickers","light","isBlurred","patternColor","dark","shouldShowContextMenuHint","updateCacheThrottled","updateCache","unsubscribeFromBeforeUnload","isCaching","isHeavyAnimating","loadCache","initialState","setupCaching","time","timeEnd","readCache","clearCaching","reducedGlobal","reduceShowChatInfo","reduceUsers","reduceChats","reduceMessages","recentlyFoundChatIds","reduceSettings","reduceChatFolders","idsToSave","cid","chatIdsToSave","mainThread","tabKey","SITE_FONTS","preloadFonts","font","fonts","load","preloadAvatars","mediaLoader","preloadTasks","main","telegramLogoPath","authCode","monkeyPath","authPassword","background","backgroundColor","hasCustomBackground","hasCustomBackgroundColor","isRightColumnShown","setIsUiReady","isReady","markReady","useFlag","shouldRenderMask","safePreload","translation","setTranslation","getSuggestedLanguage","suggestedLanguage","MENU_HIDING_DURATION","inputRef","setFilter","filteredList","setFilteredList","updateFilter","filterValue","getFilteredList","countryId","firstElementChild","dataset","handleInput","handleInputKeyDown","handleTrigger","select","formEl","getElementById","scrollTo","top","scrollHeight","behavior","inputValue","data-country-id","isPreloadInitiated","setAuthPhoneNumber","setAuthRememberMe","loadNearestCountry","clearAuthError","goToAuthQrCode","setSettingOption","continueText","useLangString","setCountry","setPhoneNumber","isTouched","setIsTouched","lastSelection","setLastSelection","markIsLoading","unmarkIsLoading","fullNumber","canSubmit","parseFullNumber","newFullNumber","suggestedCountry","selectedCountry","handleLangChange","setSelectionRange","isJustPastedRef","handlePaste","handlePhoneNumberChange","selectionStart","selectionEnd","shouldFixSafariAutoComplete","handleKeepSessionChange","isAuthReady","onSubmit","InputText","Checkbox","Loading","AuthCode","useModuleLoader","AuthPassword","AuthRegister","G","H","B","QrCreator","h","u","J","level","version","O","C","f","lineTo","arcTo","moveTo","z","v","N","K","P","fillStyle","fillRect","left","beginPath","q","D","E","R","I","F","fill","colorStops","createLinearGradient","apply","createRadialGradient","addColorStop","A","minVersion","maxVersion","ecLevel","radius","quiet","HTMLCanvasElement","clearRect","write","S","multiply","L","M","Q","returnToAuthPhoneNumber","qrCodeRef","token","isMobile","AuthQrCode","AppInactive","appInactivePath","renderMain","disconnect","isInactive","markInactive","TeactDOM"],"mappings":"aACE,SAASA,EAAqBC,GAQ7B,IAPA,IAMIC,EAAUC,EANVC,EAAWH,EAAK,GAChBI,EAAcJ,EAAK,GAKAK,EAAI,EAAGC,EAAW,GACpCD,EAAIF,EAASI,OAAQF,IACzBH,EAAUC,EAASE,GAChBG,OAAOC,UAAUC,eAAeC,KAAKC,EAAiBV,IAAYU,EAAgBV,IACpFI,EAASO,KAAKD,EAAgBV,GAAS,IAExCU,EAAgBV,GAAW,EAE5B,IAAID,KAAYG,EACZI,OAAOC,UAAUC,eAAeC,KAAKP,EAAaH,KACpDa,EAAQb,GAAYG,EAAYH,IAKlC,IAFGc,GAAqBA,EAAoBf,GAEtCM,EAASC,QACdD,EAASU,OAATV,GAOF,IAAIW,EAAmB,GAGnBC,EAAqB,CACxBC,EAAG,GAMAP,EAAkB,CACrBO,EAAG,GAWJ,SAASC,EAAoBnB,GAG5B,GAAGgB,EAAiBhB,GACnB,OAAOgB,EAAiBhB,GAAUoB,QAGnC,IAAIC,EAASL,EAAiBhB,GAAY,CACzCI,EAAGJ,EACHsB,GAAG,EACHF,QAAS,IAUV,OANAP,EAAQb,GAAUU,KAAKW,EAAOD,QAASC,EAAQA,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mBACZoX,GAAuBnQ,YAAKmQ,EAAQ,CAAC,cACtC,CAAC9Y,EAAWC,IAA2B0I,YAAK1I,EAAS,CAAC,eAFzCyB,CA9C6B,EAAGq8D,YAAWkO,iBACxD,MAAOC,EAAYC,GAAgBnI,aAAQ,GAc3C,GAZA7lE,YAAU,KACRgpD,clBRF1+C,EkBS6B,KACzBwjE,IACAr4E,SAAS4b,MAAS,GAAErN,OAAaC,MAEjC+pE,MAED,CAACF,EAAYE,IAIZD,EACF,OAAO,kBAAC,GAAD,MAGT,GAAInO,EACF,OAAQA,GACN,IAAK,oCACL,IAAK,6BACL,IAAK,iCACL,IAAK,qCACL,IAAK,+BACH,OAAO,kBAAC,GAAD,MACT,IAAK,2BACL,IAAK,4BACL,IAAK,+BACL,IAAK,0BACH,OAAOiO,KAIb,OAAOznC,aAAiB,GAAQynC,KAAe,kBAAC,GAAD,Q,OC1C7CrxE,KAEF7C,QAAQkD,IAAI,YAGdgG,cAAc05D,OAEV//D,KAEF7C,QAAQkD,IAAI,4BAGdoxE,IAAS7U,OACP,kBAAC,GAAD,MACA3jE,SAAS2xE,eAAe,SAGtB5qE,KAEF7C,QAAQkD,IAAI,6BAGdpH,SAASsL,iBAAiB,WAAY,KAEpCpH,QAAQkD,IAAI,eAAgB+F","file":"main.af5bd185d96d3f084d63.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tfunction webpackJsonpCallback(data) {\n \t\tvar chunkIds = data[0];\n \t\tvar moreModules = data[1];\n\n\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [];\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n\n \t};\n\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// object to store loaded CSS chunks\n \tvar installedCssChunks = {\n \t\t2: 0\n \t}\n\n \t// object to store loaded and loading chunks\n \t// undefined = chunk not loaded, null = chunk preloaded/prefetched\n \t// Promise = chunk loading, 0 = chunk loaded\n \tvar installedChunks = {\n \t\t2: 0\n \t};\n\n\n\n \t// script path function\n \tfunction jsonpScriptSrc(chunkId) {\n \t\treturn __webpack_require__.p + \"\" + chunkId + \".\" + {\"0\":\"e84aae32c1142e0538ad\",\"1\":\"6110220c0cd22a07afe2\",\"3\":\"86fc6942f17ca54599b3\",\"4\":\"7cbc0883ea4cc7908cba\",\"5\":\"64e3757d90b4958d12d9\",\"6\":\"f9e82031a240faaf8916\",\"7\":\"f986b85fa2f7f58a12de\",\"8\":\"b1c64eac1a0833d4fa35\",\"9\":\"8ce2b842c50b69d2f741\",\"10\":\"0f031682109823f02d37\"}[chunkId] + \".js\"\n \t}\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n \t// This file contains only the entry chunk.\n \t// The chunk loading function for additional chunks\n \t__webpack_require__.e = function requireEnsure(chunkId) {\n \t\tvar promises = [];\n\n\n \t\t// mini-css-extract-plugin CSS loading\n \t\tvar cssChunks = {\"0\":1,\"3\":1,\"4\":1,\"5\":1,\"6\":1};\n \t\tif(installedCssChunks[chunkId]) promises.push(installedCssChunks[chunkId]);\n \t\telse if(installedCssChunks[chunkId] !== 0 && cssChunks[chunkId]) {\n \t\t\tpromises.push(installedCssChunks[chunkId] = new Promise(function(resolve, reject) {\n \t\t\t\tvar href = \"\" + ({}[chunkId]||chunkId) + \".\" + {\"0\":\"e84aae32c1142e0538ad\",\"1\":\"6110220c0cd22a07afe2\",\"3\":\"86fc6942f17ca54599b3\",\"4\":\"7cbc0883ea4cc7908cba\",\"5\":\"64e3757d90b4958d12d9\",\"6\":\"f9e82031a240faaf8916\",\"7\":\"f986b85fa2f7f58a12de\",\"8\":\"b1c64eac1a0833d4fa35\",\"9\":\"8ce2b842c50b69d2f741\",\"10\":\"0f031682109823f02d37\"}[chunkId] + \".css\";\n \t\t\t\tvar fullhref = __webpack_require__.p + href;\n \t\t\t\tvar existingLinkTags = document.getElementsByTagName(\"link\");\n \t\t\t\tfor(var i = 0; i < existingLinkTags.length; i++) {\n \t\t\t\t\tvar tag = existingLinkTags[i];\n \t\t\t\t\tvar dataHref = tag.getAttribute(\"data-href\") || tag.getAttribute(\"href\");\n \t\t\t\t\tif(tag.rel === \"stylesheet\" && (dataHref === href || dataHref === fullhref)) return resolve();\n \t\t\t\t}\n \t\t\t\tvar existingStyleTags = document.getElementsByTagName(\"style\");\n \t\t\t\tfor(var i = 0; i < existingStyleTags.length; i++) {\n \t\t\t\t\tvar tag = existingStyleTags[i];\n \t\t\t\t\tvar dataHref = tag.getAttribute(\"data-href\");\n \t\t\t\t\tif(dataHref === href || dataHref === fullhref) return resolve();\n \t\t\t\t}\n \t\t\t\tvar linkTag = document.createElement(\"link\");\n \t\t\t\tlinkTag.rel = \"stylesheet\";\n \t\t\t\tlinkTag.type = \"text/css\";\n \t\t\t\tlinkTag.onload = resolve;\n \t\t\t\tlinkTag.onerror = function(event) {\n \t\t\t\t\tvar request = event && event.target && event.target.src || fullhref;\n \t\t\t\t\tvar err = new Error(\"Loading CSS chunk \" + chunkId + \" failed.\\n(\" + request + \")\");\n \t\t\t\t\terr.code = \"CSS_CHUNK_LOAD_FAILED\";\n \t\t\t\t\terr.request = request;\n \t\t\t\t\tdelete installedCssChunks[chunkId]\n \t\t\t\t\tlinkTag.parentNode.removeChild(linkTag)\n \t\t\t\t\treject(err);\n \t\t\t\t};\n \t\t\t\tlinkTag.href = fullhref;\n\n \t\t\t\tvar head = document.getElementsByTagName(\"head\")[0];\n \t\t\t\thead.appendChild(linkTag);\n \t\t\t}).then(function() {\n \t\t\t\tinstalledCssChunks[chunkId] = 0;\n \t\t\t}));\n \t\t}\n\n \t\t// JSONP chunk loading for javascript\n\n \t\tvar installedChunkData = installedChunks[chunkId];\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\t// setup Promise in chunk cache\n \t\t\t\tvar promise = new Promise(function(resolve, reject) {\n \t\t\t\t\tinstalledChunkData = installedChunks[chunkId] = [resolve, reject];\n \t\t\t\t});\n \t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n \t\t\t\t// start chunk loading\n \t\t\t\tvar script = document.createElement('script');\n \t\t\t\tvar onScriptComplete;\n\n \t\t\t\tscript.charset = 'utf-8';\n \t\t\t\tscript.timeout = 120;\n \t\t\t\tif (__webpack_require__.nc) {\n \t\t\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n \t\t\t\t}\n \t\t\t\tscript.src = jsonpScriptSrc(chunkId);\n\n \t\t\t\t// create error before stack unwound to get useful stacktrace later\n \t\t\t\tvar error = new Error();\n \t\t\t\tonScriptComplete = function (event) {\n \t\t\t\t\t// avoid mem leaks in IE.\n \t\t\t\t\tscript.onerror = script.onload = null;\n \t\t\t\t\tclearTimeout(timeout);\n \t\t\t\t\tvar chunk = installedChunks[chunkId];\n \t\t\t\t\tif(chunk !== 0) {\n \t\t\t\t\t\tif(chunk) {\n \t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n \t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n \t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n \t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n \t\t\t\t\t\t\terror.type = errorType;\n \t\t\t\t\t\t\terror.request = realSrc;\n \t\t\t\t\t\t\tchunk[1](error);\n \t\t\t\t\t\t}\n \t\t\t\t\t\tinstalledChunks[chunkId] = undefined;\n \t\t\t\t\t}\n \t\t\t\t};\n \t\t\t\tvar timeout = setTimeout(function(){\n \t\t\t\t\tonScriptComplete({ type: 'timeout', target: script });\n \t\t\t\t}, 120000);\n \t\t\t\tscript.onerror = script.onload = onScriptComplete;\n \t\t\t\tdocument.head.appendChild(script);\n \t\t\t}\n \t\t}\n \t\treturn Promise.all(promises);\n \t};\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// on error function for async loading\n \t__webpack_require__.oe = function(err) { console.error(err); throw err; };\n\n \tvar jsonpArray = window[\"webpackJsonp\"] = window[\"webpackJsonp\"] || [];\n \tvar oldJsonpFunction = jsonpArray.push.bind(jsonpArray);\n \tjsonpArray.push = webpackJsonpCallback;\n \tjsonpArray = jsonpArray.slice();\n \tfor(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]);\n \tvar parentJsonpFunction = oldJsonpFunction;\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 104);\n","import { DEBUG, DEBUG_MORE } from '../../config';\nimport {\n fastRaf, onTickEnd, throttleWithPrimaryRaf, throttleWithRaf,\n} from '../../util/schedulers';\nimport { flatten, orderBy } from '../../util/iteratees';\nimport arePropsShallowEqual, { 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;\nexport type FC_withDebug =\n FC\n & {\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?: 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\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\nconst DEBUG_components: AnyLiteral = {};\n\ndocument.addEventListener('dblclick', () => {\n // eslint-disable-next-line no-console\n console.log('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 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 (componentName !== 'TeactMemoWrapper' && componentName !== 'TeactNContainer') {\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 renderTime = performance.now() - DEBUG_startAt!;\n const componentName = componentInstance.name;\n if (renderTime > 7) {\n // eslint-disable-next-line no-console\n console.warn(`[Teact] Slow component render: ${componentName}, ${Math.round(renderTime)} ms`);\n }\n DEBUG_components[componentName].renderTimes.push(renderTime);\n DEBUG_components[componentName].renderCount++;\n }\n } catch (err) {\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 (!isRealElement($element)) {\n return;\n }\n\n if (isComponentElement($element)) {\n unmountComponent($element.componentInstance);\n } else if ($element.target) {\n removeAllDelegatedListeners($element.target as HTMLElement);\n // Trying to help GC\n // eslint-disable-next-line no-null/no-null\n $element.target = null as any;\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 componentInstance.hooks.memos.byCursor.forEach((hook) => {\n // eslint-disable-next-line no-null/no-null\n hook.current = null;\n });\n\n componentInstance.hooks.effects.byCursor.forEach(({ cleanup }) => {\n if (typeof cleanup === 'function') {\n try {\n cleanup();\n } catch (err) {\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 /* eslint-disable no-null/no-null */\n\n componentInstance.hooks.effects.byCursor.forEach((hook) => {\n hook.cleanup = null as any;\n hook.effect = null as any;\n hook.dependencies = null as any;\n });\n\n componentInstance.hooks.state.byCursor.forEach((hook) => {\n hook.value = null as any;\n hook.nextValue = null as any;\n hook.setter = null as any;\n });\n\n componentInstance.hooks.memos.byCursor.forEach((hook) => {\n hook.dependencies = null as any;\n });\n\n componentInstance.hooks = null as any;\n componentInstance.$element = null as any;\n componentInstance.renderedValue = null as any;\n componentInstance.Component = null as any;\n componentInstance.props = null as any;\n componentInstance.forceUpdate = null as any;\n componentInstance.onUpdate = null as any;\n\n /* eslint-enable no-null/no-null */\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(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 effect: () => Function | void,\n dependencies?: any[],\n debugKey?: string,\n) {\n const { cursor, byCursor } = renderingInstance.hooks.effects;\n const componentInstance = renderingInstance;\n\n const exec = () => {\n if (!componentInstance.isMounted) {\n return;\n }\n\n const { cleanup } = byCursor[cursor];\n if (typeof cleanup === 'function') {\n try {\n cleanup();\n } catch (err) {\n handleError(err);\n }\n }\n\n byCursor[cursor].cleanup = effect() as Function;\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(\n '[Teact]',\n debugKey,\n 'Effect caused by dependencies.',\n causedBy.join(', '),\n );\n }\n\n schedulerFn(exec);\n }\n } else {\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?: any[], debugKey?: string) {\n return useLayoutEffectBase(fastRaf, effect, dependencies, debugKey);\n}\n\nexport function useLayoutEffect(effect: () => Function | void, dependencies?: any[], debugKey?: string) {\n return useLayoutEffectBase(onTickEnd, 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[]): F {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n return useMemo(() => newCallback, dependencies);\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, areEqual = arePropsShallowEqual, debugKey?: string) {\n return function TeactMemoWrapper(props: Props) {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const propsRef = useRef(props);\n const renderedRef = useRef();\n\n if (!renderedRef.current || (propsRef.current && !areEqual(propsRef.current, props))) {\n if (DEBUG && debugKey) {\n // eslint-disable-next-line no-console\n console.log(\n `[Teact.memo] ${Component.name} (${debugKey}): Update is caused by:`,\n getUnequalProps(propsRef.current!, props).join(', '),\n );\n }\n\n propsRef.current = props;\n renderedRef.current = createElement(Component, props) as VirtualElementComponent;\n }\n\n return renderedRef.current;\n } as T;\n}\n\n// We need to keep it here for JSX.\nexport default {\n createElement,\n Fragment,\n};\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 { throttleWithRaf } from '../../util/schedulers';\nimport arePropsShallowEqual, { getUnequalProps } from '../../util/arePropsShallowEqual';\nimport { orderBy } from '../../util/iteratees';\nimport { GlobalState, GlobalActions, ActionTypes } from '../../global/types';\nimport { handleError } from '../../util/handleError';\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 | null);\ntype MapActionsToProps = ((setGlobal: Function, actions: GlobalActions) => Partial | null);\n\nlet currentGlobal = {} as GlobalState;\n\nconst reducers: Record = {};\nconst callbacks: Function[] = [updateContainers];\nconst actions = {} as GlobalActions;\nconst containers = new Map;\n mapReducersToProps: MapActionsToProps;\n ownProps: Props;\n mappedProps?: Props;\n forceUpdate: Function;\n areMappedPropsChanged: boolean;\n DEBUG_updates: number;\n DEBUG_componentName: string;\n}>();\n\nfunction runCallbacks() {\n callbacks.forEach((cb) => cb(currentGlobal));\n}\n\nconst runCallbacksThrottled = throttleWithRaf(runCallbacks);\n\n// `noThrottle = true` is used as a workaround for iOS gesture history navigation\nexport function setGlobal(newGlobal?: GlobalState, noThrottle = false) {\n if (typeof newGlobal === 'object' && newGlobal !== currentGlobal) {\n currentGlobal = newGlobal;\n if (!noThrottle) {\n runCallbacksThrottled();\n } else {\n runCallbacks();\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, noThrottle?: boolean) {\n if (reducers[name]) {\n reducers[name].forEach((reducer) => {\n const newGlobal = reducer(currentGlobal, actions, payload);\n if (newGlobal) {\n setGlobal(newGlobal, noThrottle);\n }\n });\n }\n}\n\nfunction updateContainers() {\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, mapReducersToProps, ownProps, mappedProps, forceUpdate,\n } = container;\n\n let newMappedProps;\n\n try {\n newMappedProps = {\n ...mapStateToProps(currentGlobal, ownProps),\n ...mapReducersToProps(setGlobal, actions),\n };\n } catch (err) {\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, noThrottle = false) => {\n onDispatch(name, payload, noThrottle);\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 mapReducersToProps: MapActionsToProps = () => ({}),\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 mapReducersToProps,\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 = {\n ...mapStateToProps(currentGlobal, props),\n ...mapReducersToProps(setGlobal, actions),\n };\n } catch (err) {\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.log(\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","export const PAGE_TITLE = 'Telegram';\nexport const INACTIVE_MARKER = ' [Inactive]';\n\nexport const APP_NAME = process.env.APP_NAME || 'Telegram WebZ';\nexport const APP_VERSION = process.env.APP_VERSION || 'dev';\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 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_CHAT_LIST_LIMIT = 30;\nexport const GLOBAL_STATE_CACHE_USER_LIST_LIMIT = 5000;\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-v5';\nexport const ASSET_CACHE_NAME = 'tt-assets';\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_SENSITIVE_AREA = 750;\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;\n\nexport const TOP_CHAT_MESSAGES_PRELOAD_LIMIT = 20;\nexport const ALL_CHATS_PRELOAD_DISABLED = false;\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\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;\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 = 80;\nexport const STICKER_SIZE_INLINE_BOT_RESULT = 100;\nexport const RECENT_STICKERS_LIMIT = 20;\nexport const MEMOJI_STICKER_ID = 'MEMOJI_STICKER';\n\nexport const BASE_EMOJI_KEYWORD_LANG = 'en';\n\nexport const MENU_TRANSITION_DURATION = 200;\nexport const SLIDE_TRANSITION_DURATION = 450;\n\nexport const CONTENT_TYPES_FOR_QUICK_UPLOAD = new Set([\n 'image/png', 'image/gif', 'image/jpeg', 'video/mp4', 'video/avi', 'video/quicktime',\n]);\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_TME_LINK = /^(?:https?:\\/\\/)?(?:t\\.me\\/)([\\d\\w_]+)(?:\\/([\\d]+))?(?:\\/([\\d]+))?$/gm;\nexport const RE_TME_INVITE_LINK = /^(?:https?:\\/\\/)?(?:t\\.me\\/joinchat\\/)([\\d\\w_-]+)?$/gm;\n\n// MTProto constants\nexport const SERVICE_NOTIFICATIONS_USER_ID = 777000;\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","type CollectionByKey = Record;\n\ntype OrderDirection = 'asc' | '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 orderKey: (keyof T) | OrderCallback | ((keyof T) | OrderCallback)[],\n mode: OrderDirection | [OrderDirection, OrderDirection] = 'asc',\n): T[] {\n return collection.sort((a, b) => {\n if (Array.isArray(orderKey)) {\n const [mode1, mode2] = Array.isArray(mode) ? mode : [mode, mode];\n const [orderKey1, orderKey2] = orderKey;\n\n let aValue1;\n let bValue1;\n\n if (typeof orderKey1 === 'function') {\n aValue1 = orderKey1(a) || 0;\n bValue1 = orderKey1(b) || 0;\n } else if (typeof orderKey1 === 'string') {\n aValue1 = a[orderKey1] || 0;\n bValue1 = b[orderKey1] || 0;\n }\n\n if (aValue1 !== bValue1) {\n return mode1 === 'asc' ? aValue1 - bValue1 : bValue1 - aValue1;\n } else {\n let aValue2;\n let bValue2;\n\n if (typeof orderKey2 === 'function') {\n aValue2 = orderKey2(a) || 0;\n bValue2 = orderKey2(b) || 0;\n } else if (typeof orderKey2 === 'string') {\n aValue2 = a[orderKey2] || 0;\n bValue2 = b[orderKey2] || 0;\n }\n\n return mode2 === 'asc' ? aValue2 - bValue2 : bValue2 - aValue2;\n }\n }\n\n let aValue;\n let bValue;\n\n if (typeof orderKey === 'function') {\n aValue = orderKey(a) || 0;\n bValue = orderKey(b) || 0;\n } else if (typeof orderKey === 'string') {\n aValue = a[orderKey] || 0;\n bValue = b[orderKey] || 0;\n }\n\n return mode === 'asc' ? aValue - bValue : bValue - aValue;\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: any[]) {\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\n/**\n * Returns the index of the last element in the array where predicate is true, and -1 otherwise.\n *\n * @param array The source array to search in\n * @param predicate find calls predicate once for each element of the array, in descending\n * order, until it finds one where predicate returns true. If such an element is found,\n * findLastIndex immediately returns that element index. Otherwise, findLastIndex returns -1.\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 {\n ApiChat, ApiMessage, ApiMessageEntityTypes, ApiUser,\n} from '../../api/types';\nimport { LangFn } from '../../hooks/useLang';\n\nimport { LOCAL_MESSAGE_ID_BASE, SERVICE_NOTIFICATIONS_USER_ID, RE_LINK_TEMPLATE } from '../../config';\nimport parseEmojiOnlyString from '../../components/common/helpers/parseEmojiOnlyString';\nimport { getUserFullName } from './users';\nimport { getChatTitle } from './chats';\n\nconst CONTENT_NOT_SUPPORTED = 'The message is not supported on this version of Telegram';\nconst RE_LINK = new RegExp(RE_LINK_TEMPLATE, 'i');\nconst TRUNCATED_SUMMARY_LENGTH = 80;\n\nexport function getMessageKey(message: ApiMessage) {\n const { chatId, id } = message;\n\n return `msg${chatId}-${id}`;\n}\n\nexport function parseMessageKey(key: string) {\n const match = key.match(/^msg(-?\\d+)-(\\d+)/)!;\n\n return { chatId: Number(match[1]), messageId: Number(match[2]) };\n}\n\nexport function getMessageOriginalId(message: ApiMessage) {\n return message.previousLocalId || message.id;\n}\n\nexport function getMessageSummaryText(lang: LangFn, message: ApiMessage, noEmoji = false) {\n const {\n text, photo, video, audio, voice, document, sticker, contact, poll, invoice,\n } = message.content;\n\n const truncatedText = text && text.text.substr(0, TRUNCATED_SUMMARY_LENGTH);\n\n if (message.groupedId) {\n return `${noEmoji ? '' : '🖼 '}${truncatedText || lang('lng_in_dlg_album')}`;\n }\n\n if (photo) {\n return `${noEmoji ? '' : '🖼 '}${truncatedText || lang('AttachPhoto')}`;\n }\n\n if (video) {\n return `${noEmoji ? '' : '📹 '}${truncatedText || lang(video.isGif ? 'AttachGif' : 'AttachVideo')}`;\n }\n\n if (sticker) {\n return `${sticker.emoji || ''} ${lang('AttachSticker')}`.trim();\n }\n\n if (audio) {\n return `${noEmoji ? '' : '🎧 '}${getMessageAudioCaption(message) || lang('AttachMusic')}`;\n }\n\n if (voice) {\n return `${noEmoji ? '' : '🎤 '}${truncatedText || lang('AttachAudio')}`;\n }\n\n if (document) {\n return `${noEmoji ? '' : '📎 '}${truncatedText || document.fileName}`;\n }\n\n if (contact) {\n return lang('AttachContact');\n }\n\n if (poll) {\n return `${noEmoji ? '' : '📊 '}${poll.summary.question}`;\n }\n\n if (invoice) {\n return 'Invoice';\n }\n\n if (text) {\n return truncatedText;\n }\n\n return CONTENT_NOT_SUPPORTED;\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 && 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 && 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 !!message.content.action;\n}\n\nexport function isServiceNotificationMessage(message: ApiMessage) {\n return message.chatId === SERVICE_NOTIFICATIONS_USER_ID && isMessageLocal(message);\n}\n\nexport function isAnonymousOwnMessage(message: ApiMessage) {\n return Boolean(message.senderId) && message.senderId! < 0 && isOwnMessage(message);\n}\n\nexport function getSenderTitle(lang: LangFn, sender: ApiUser | ApiChat) {\n return sender.id > 0 ? 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 getMessageAudioCaption(message: ApiMessage) {\n const { audio, text } = message.content;\n\n return (audio && [audio.title, audio.performer].filter(Boolean).join(' — ')) || (text && 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\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 && 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 const webPage = getMessageWebPage(message);\n return webPage ? webPage.photo : undefined;\n}\n\nexport function getMessageWebPageDocument(message: ApiMessage) {\n const webPage = getMessageWebPage(message);\n return webPage ? webPage.document : undefined;\n}\n\nexport function getMessageWebPageVideo(message: ApiMessage): ApiVideo | undefined {\n const webPage = getMessageWebPage(message);\n if (!webPage) return undefined;\n return webPage.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 const thumbnail = getMessageMediaThumbnail(message);\n\n return thumbnail ? thumbnail.dataUri : undefined;\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 base = getMessageKey(message);\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 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 default:\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 default:\n return base;\n }\n }\n\n if (audio) {\n switch (target) {\n case 'micro':\n case 'pictogram':\n return undefined;\n case 'download':\n return `${base}?download`;\n default:\n return getVideoOrAudioBaseHash(audio, base);\n }\n }\n\n if (voice) {\n switch (target) {\n case 'micro':\n case 'pictogram':\n return undefined;\n default:\n return base;\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 getMessageMediaFormat(\n message: ApiMessage, target: Target,\n): Exclude;\nexport function getMessageMediaFormat(message: ApiMessage, target: Target, canBeLottie: true): ApiMediaFormat;\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.isAnimated) {\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 && photo.blobUrl) || (video && video.blobUrl) || (document && document.previewBlobUrl);\n}\n\nexport function getChatMediaMessageIds(\n messages: Record, listedIds: number[], isFromSharedMedia = false,\n) {\n const ids = getMessageContentIds(messages, listedIds, isFromSharedMedia ? 'media' : 'inlineMedia');\n\n return isFromSharedMedia ? ids.reverse() : ids;\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, isDownloadNeeded = false) {\n const isUploading = isMessageLocal(message);\n const isTransferring = isUploading || isDownloadNeeded;\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 '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: number, threadId: number) {\n return `${chatId}_${threadId}`;\n}\n","import Worker from 'worker-loader!./worker';\n\nimport { ApiInitialArgs, ApiOnProgress, OnApiUpdate } from '../../types';\nimport { Methods, MethodArgs, MethodResponse } from '../methods/types';\nimport { WorkerMessageEvent, ThenArg, OriginRequest } from './types';\n\nimport { DEBUG } from '../../../config';\nimport generateIdFor from '../../../util/generateIdFor';\n\ntype RequestStates = {\n messageId: string;\n resolve: Function;\n reject: Function;\n callback?: AnyToVoidFunction;\n};\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();\n subscribeToWorker(onUpdate);\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 return makeRequest({\n type: 'callMethod',\n name: fnName,\n args,\n }) 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 const requestState = requestStates.get(data.messageId);\n if (requestState && requestState.callback) {\n requestState.callback(...data.callbackArgs);\n }\n } else if (data.type === 'unhandledError') {\n throw data.error;\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 (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 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","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 && window.matchMedia && 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} 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 = window.matchMedia('(display-mode: standalone)').matches\n|| (window.navigator as any).standalone\n|| document.referrer.includes('android-app://');\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 = (navigator.mediaDevices && 'getUserMedia' in navigator.mediaDevices && (\n window.AudioContext || (window as any).webkitAudioContext\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 LAYERS_ANIMATION_NAME = IS_ANDROID ? 'slide-fade' : IS_IOS ? 'slide-layers' : 'push-slide';\n\nexport const DPR = window.devicePixelRatio || 1;\n\nexport const MASK_IMAGE_DISABLED = true;\n","import { GlobalState } from '../../global/types';\nimport { ApiChat, ApiUser } from '../../api/types';\n\nexport function selectUser(global: GlobalState, userId: number): ApiUser | undefined {\n return global.users.byId[userId];\n}\n\nexport function selectIsUserBlocked(global: GlobalState, userId: number) {\n const user = selectUser(global, userId);\n\n return user && user.fullInfo && 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 { 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 { ApiChat, MAIN_THREAD_ID } from '../../api/types';\nimport { GlobalState } from '../../global/types';\n\nimport {\n getPrivateChatUserId, isChatChannel, isChatPrivate, isHistoryClearMessage, isUserBot, isUserOnline, selectIsChatMuted,\n} from '../helpers';\nimport { selectUser } from './users';\nimport { ALL_FOLDER_ID, ARCHIVED_FOLDER_ID, MEMBERS_LOAD_SLICE } from '../../config';\nimport { selectNotifyExceptions, selectNotifySettings } from './settings';\n\nexport function selectChat(global: GlobalState, chatId: number): 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: number) {\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 (isChatPrivate(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 (global.users.byId[userId] && isUserOnline(global.users.byId[userId]) && userId !== global.currentUserId) {\n return onlineCount + 1;\n }\n\n return onlineCount;\n }, 0);\n}\n\nexport function selectChatBot(global: GlobalState, chatId: number) {\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: number) {\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: number, 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: number): '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: number, folderId = ALL_FOLDER_ID): boolean {\n const { active, archived } = global.chats.orderedPinnedIds;\n\n if (folderId === ALL_FOLDER_ID) {\n return !!active && active.includes(chatId);\n }\n\n if (folderId === ARCHIVED_FOLDER_ID) {\n return !!archived && archived.includes(chatId);\n }\n\n const { byId: chatFoldersById } = global.chatFolders;\n\n const { pinnedChatIds } = chatFoldersById[folderId] || {};\n return !!pinnedChatIds && 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 selectCountNotMutedUnread(global: GlobalState) {\n const activeChatIds = global.chats.listIds.active;\n if (!activeChatIds) {\n return 0;\n }\n\n const chats = global.chats.byId;\n\n return activeChatIds.reduce((acc, chatId) => {\n const chat = chats[chatId];\n\n if (\n chat\n && chat.unreadCount\n && !selectIsChatMuted(chat, selectNotifySettings(global), selectNotifyExceptions(global))\n ) {\n return acc + chat.unreadCount;\n }\n\n return acc;\n }, 0);\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 selectStickersForEmoji(global: GlobalState, emoji: string) {\n const stickerSets = Object.values(global.stickers.setsById);\n let stickersForEmoji: ApiSticker[] = [];\n stickerSets.forEach(({ packs }) => {\n if (!packs) {\n return;\n }\n const stickers = packs[emoji];\n if (stickers) {\n stickersForEmoji = stickersForEmoji.concat(stickers);\n }\n });\n return stickersForEmoji;\n}\n\nexport function selectAnimatedEmoji(global: GlobalState, emoji: string) {\n const { animatedEmojis } = global;\n if (!animatedEmojis || !animatedEmojis.stickers) {\n return undefined;\n }\n\n // Some emojis (❤️ for example) with a service symbol 'VARIATION SELECTOR-16' are not recognized as animated\n const cleanedEmoji = emoji.replace('\\ufe0f', '');\n\n return animatedEmojis.stickers.find((sticker) => sticker.emoji === emoji || sticker.emoji === cleanedEmoji);\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 } from '../../config';\nimport {\n selectChat, selectIsChatWithBot, selectIsChatWithSelf,\n} from './chats';\nimport { selectIsUserOrChatContact, selectUser } from './users';\nimport {\n getSendingState,\n isChatChannel,\n isMessageLocal,\n isChatPrivate,\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} from '../helpers';\nimport { findLast } from '../../util/iteratees';\nimport { selectIsStickerFavorite } from './symbols';\n\nconst MESSAGE_EDIT_ALLOWED_TIME_MS = 172800000; // 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: number) {\n const messages = global.messages.byChatId[chatId];\n\n return messages ? messages.byId : undefined;\n}\n\nexport function selectScheduledMessages(global: GlobalState, chatId: number) {\n const messages = global.scheduledMessages.byChatId[chatId];\n\n return messages ? messages.byId : undefined;\n}\n\nexport function selectThreadParam(\n global: GlobalState,\n chatId: number,\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: number, threadId: number) {\n return selectThreadParam(global, chatId, threadId, 'listedIds');\n}\n\nexport function selectOutlyingIds(global: GlobalState, chatId: number, threadId: number) {\n return selectThreadParam(global, chatId, threadId, 'outlyingIds');\n}\n\nexport function selectCurrentMessageIds(\n global: GlobalState, chatId: number, 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: number, threadId: number) {\n return selectThreadParam(global, chatId, threadId, 'viewportIds');\n}\n\nexport function selectPinnedIds(global: GlobalState, chatId: number) {\n return selectThreadParam(global, chatId, MAIN_THREAD_ID, 'pinnedIds');\n}\n\nexport function selectScheduledIds(global: GlobalState, chatId: number) {\n return selectThreadParam(global, chatId, MAIN_THREAD_ID, 'scheduledIds');\n}\n\nexport function selectScrollOffset(global: GlobalState, chatId: number, threadId: number) {\n return selectThreadParam(global, chatId, threadId, 'scrollOffset');\n}\n\nexport function selectReplyingToId(global: GlobalState, chatId: number, threadId: number) {\n return selectThreadParam(global, chatId, threadId, 'replyingToId');\n}\n\nexport function selectEditingId(global: GlobalState, chatId: number, threadId: number) {\n return selectThreadParam(global, chatId, threadId, 'editingId');\n}\n\nexport function selectEditingScheduledId(global: GlobalState, chatId: number) {\n return selectThreadParam(global, chatId, MAIN_THREAD_ID, 'editingScheduledId');\n}\n\nexport function selectDraft(global: GlobalState, chatId: number, threadId: number) {\n return selectThreadParam(global, chatId, threadId, 'draft');\n}\n\nexport function selectNoWebPage(global: GlobalState, chatId: number, threadId: number) {\n return selectThreadParam(global, chatId, threadId, 'noWebPage');\n}\n\nexport function selectThreadInfo(global: GlobalState, chatId: number, threadId: number) {\n return selectThreadParam(global, chatId, threadId, 'threadInfo');\n}\n\nexport function selectFirstMessageId(global: GlobalState, chatId: number, threadId: number) {\n return selectThreadParam(global, chatId, threadId, 'firstMessageId');\n}\n\nexport function selectReplyStack(global: GlobalState, chatId: number, threadId: number) {\n return selectThreadParam(global, chatId, threadId, 'replyStack');\n}\n\nexport function selectThreadOriginChat(global: GlobalState, chatId: number, 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: number, 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: number, 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: number, 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: number, 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: number, messageId: number) {\n const chatMessages = selectChatMessages(global, chatId);\n\n return chatMessages ? chatMessages[messageId] : undefined;\n}\n\nexport function selectScheduledMessage(global: GlobalState, chatId: number, messageId: number) {\n const chatMessages = selectScheduledMessages(global, chatId);\n\n return chatMessages ? chatMessages[messageId] : undefined;\n}\n\nexport function selectEditingMessage(\n global: GlobalState, chatId: number, 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: number) {\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 senderId > 0 ? 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);\n }\n\n return undefined;\n}\n\nexport function selectAllowedMessageActions(global: GlobalState, message: ApiMessage, threadId: number) {\n const { serverTimeOffset } = global;\n const chat = selectChat(global, message.chatId);\n if (!chat || chat.isRestricted) {\n return {};\n }\n\n const isPrivate = isChatPrivate(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 isServiceNotification = isServiceNotificationMessage(message);\n\n const isOwn = isOwnMessage(message);\n const isAction = isActionMessage(message);\n const { content } = message;\n const canEditMessagesIndefinitely = isChatWithSelf\n || (isSuperGroup && getHasAdminRight(chat, 'pinMessages'))\n || (isChannel && getHasAdminRight(chat, 'editMessages'));\n const isMessageEditable = (\n (canEditMessagesIndefinitely\n || Date.now() + serverTimeOffset * 1000 - message.date * 1000 < MESSAGE_EDIT_ALLOWED_TIME_MS)\n && !(\n content.sticker || content.contact || content.poll || content.action || content.audio\n || (content.video && content.video.isRound)\n )\n && !isForwardedMessage(message)\n && !message.viaBotId\n );\n\n const canReply = getCanPostInChat(chat, threadId) && !isServiceNotification;\n\n const hasPinPermission = isPrivate || (\n chat.isCreator\n || (!isChannel && !isUserRightBanned(chat, 'pinMessages'))\n || getHasAdminRight(chat, 'pinMessages')\n );\n\n let canPin = !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 = isPrivate\n || isOwn\n || isBasicGroup\n || chat.isCreator\n || getHasAdminRight(chat, 'deleteMessages');\n\n const canReport = !isPrivate && !isOwn;\n\n const canDeleteForAll = canDelete && !isServiceNotification && (\n (isPrivate && !isChatWithSelf)\n || (isBasicGroup && (\n isOwn || getHasAdminRight(chat, 'deleteMessages') || chat.isCreator\n ))\n );\n\n const canEdit = !isAction && isMessageEditable && (\n isOwn\n || (isChannel && (chat.isCreator || getHasAdminRight(chat, 'editMessages')))\n );\n\n const canForward = !isAction && !isServiceNotification;\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 const noOptions = [\n canReply,\n canEdit,\n canPin,\n canUnpin,\n canDelete,\n canDeleteForAll,\n canForward,\n canFaveSticker,\n canUnfaveSticker,\n canCopy,\n canCopyLink,\n canSelect,\n ].every((ability) => !ability);\n\n return {\n noOptions,\n canReply,\n canEdit,\n canPin,\n canUnpin,\n canDelete,\n canReport,\n canDeleteForAll,\n canForward,\n canFaveSticker,\n canUnfaveSticker,\n canCopy,\n canCopyLink,\n canSelect,\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 selectUploadProgress(global: GlobalState, message: ApiMessage) {\n const fileTransfer = global.fileUploads.byMessageLocalId[message.previousLocalId || message.id];\n\n return fileTransfer ? fileTransfer.progress : undefined;\n}\n\nexport function selectRealLastReadId(global: GlobalState, chatId: number, 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: number, 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 || 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 if (outlyingIds) {\n const found = !lastReadId ? outlyingIds[0] : outlyingIds.find((id) => {\n return id > lastReadId && byId[id] && (!byId[id].isOutgoing || byId[id].isFromScheduled);\n });\n if (found) {\n return found;\n }\n }\n\n if (listedIds) {\n const found = !lastReadId ? listedIds[0] : listedIds.find((id) => {\n return id > lastReadId && byId[id] && (!byId[id].isOutgoing || byId[id].isFromScheduled);\n });\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 Number(Object.keys(byChatId).find((chatId) => {\n const chat = selectChat(global, Number(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: number, 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: number, 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: number, 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: number,\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 selectShouldAutoLoadMedia(\n global: GlobalState, message: ApiMessage, chat: ApiChat, sender?: ApiChat | ApiUser,\n) {\n const {\n shouldAutoDownloadMediaFromContacts,\n shouldAutoDownloadMediaInPrivateChats,\n shouldAutoDownloadMediaInGroups,\n shouldAutoDownloadMediaInChannels,\n } = global.settings.byKey;\n\n return Boolean(\n (shouldAutoDownloadMediaInPrivateChats && isChatPrivate(chat.id))\n || (shouldAutoDownloadMediaInGroups && isChatGroup(chat))\n || (shouldAutoDownloadMediaInChannels && isChatChannel(chat))\n || (shouldAutoDownloadMediaFromContacts && sender && (\n sender.id === global.currentUserId\n || selectIsUserOrChatContact(global, sender)\n )),\n );\n}\n\nexport function selectShouldAutoPlayMedia(global: GlobalState, message: ApiMessage) {\n const video = getMessageVideo(message) || getMessageWebPageVideo(message);\n if (!video) {\n return undefined;\n }\n\n const {\n shouldAutoPlayVideos,\n shouldAutoPlayGifs,\n } = global.settings.byKey;\n\n const asGif = video.isGif || video.isRound;\n\n return (shouldAutoPlayVideos && !asGif) || (shouldAutoPlayGifs && asGif);\n}\n\nexport function selectShouldLoopStickers(global: GlobalState) {\n return global.settings.byKey.shouldLoopStickers;\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 selectCurrentMediaSearchPeerId(global: GlobalState) {\n const { byChatId } = global.localMediaSearch;\n const { chatId } = selectCurrentMessageList(global) || {};\n const currentProfileUserId = global.users.selectedId;\n\n return currentProfileUserId && byChatId[currentProfileUserId] ? currentProfileUserId : chatId;\n}\n\nexport function selectCurrentMediaSearch(global: GlobalState) {\n const peerId = selectCurrentMediaSearchPeerId(global);\n if (!peerId) {\n return undefined;\n }\n\n return global.localMediaSearch.byChatId[peerId];\n}\n","import { GlobalState } from '../../global/types';\n\nimport { selectCurrentMessageList } from './messages';\nimport { selectChat } from './chats';\nimport { isChatGroup, isChatPrivate } from '../helpers';\n\nexport function selectManagement(global: GlobalState, chatId: number) {\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 (isChatPrivate(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 { selectCurrentStickerSearch, selectCurrentGifSearch } from './symbols';\nimport { selectAreActiveChatsLoaded } from './chats';\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 const {\n users,\n isChatInfoShown,\n newChatMembersProgress,\n } = global;\n\n const isAddingChatMembersShown = newChatMembersProgress !== NewChatMembersProgress.Closed;\n const isPollResults = selectIsPollResultsOpen(global);\n const isSearch = Boolean(!IS_SINGLE_COLUMN_LAYOUT && selectCurrentTextSearch(global));\n const isManagement = selectCurrentManagement(global);\n const stickerSearch = selectCurrentStickerSearch(global);\n const isStickerSearch = stickerSearch.query !== undefined;\n const gifSearch = selectCurrentGifSearch(global);\n const isGifSearch = gifSearch.query !== undefined;\n const { chatId: currentChatId } = selectCurrentMessageList(global) || {};\n const currentProfileUserId = users.selectedId;\n const areActiveChatsLoaded = selectAreActiveChatsLoaded(global);\n const isUserInfo = Boolean(currentProfileUserId && areActiveChatsLoaded);\n const isChatShown = Boolean(currentChatId && areActiveChatsLoaded);\n const isChatInfo = isChatShown && isChatInfoShown;\n\n return isPollResults ? (\n RightColumnContent.PollResults\n ) : isSearch ? (\n RightColumnContent.Search\n ) : isManagement ? (\n RightColumnContent.Management\n ) : isStickerSearch ? (\n RightColumnContent.StickerSearch\n ) : isGifSearch ? (\n RightColumnContent.GifSearch\n ) : isAddingChatMembersShown ? (\n RightColumnContent.AddingMembers\n ) : isUserInfo ? (\n RightColumnContent.UserInfo\n ) : isChatInfo ? (\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","\nimport { GlobalState } from '../../global/types';\n\nexport function selectPaymentMessageId(global: GlobalState) {\n return global.payment.messageId;\n}\n\nexport function selectPaymentRequestId(global: GlobalState) {\n return global.payment.formId;\n}\n\nexport function selectProviderPublishableKey(global: GlobalState) {\n return global.payment.nativeParams ? global.payment.nativeParams.publishableKey : undefined;\n}\n\nexport function selectStripeCredentials(global: GlobalState) {\n return global.payment.stripeCredentials;\n}\n","export * from './users';\nexport * from './chats';\nexport * from './messages';\nexport * from './updates';\nexport * from './media';\nexport * from './payments';\nexport * from './settings';\nexport * from './bots';\nexport * from './misc';\n","type Parts = (string | false | undefined)[];\n\nexport default (...parts: Parts) => {\n return parts.filter(Boolean).join(' ');\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 // @ts-ignore\n fn(...args);\n }\n\n // eslint-disable-next-line no-restricted-globals\n waitingTimeout = self.setTimeout(() => {\n if (shouldRunLast) {\n // @ts-ignore\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 // @ts-ignore\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 // @ts-ignore\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(fastPrimaryRaf, 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 // @ts-ignore\n fn(...args);\n });\n }\n };\n}\n\nexport function onTickEnd(cb: NoneToVoidFunction) {\n Promise.resolve().then(cb);\n}\n\nexport function onIdle(cb: NoneToVoidFunction) {\n // eslint-disable-next-line no-restricted-globals\n if (self.requestIdleCallback) {\n // eslint-disable-next-line no-restricted-globals\n self.requestIdleCallback(cb);\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 fastPrimaryRaf(callback: NoneToVoidFunction) {\n fastRaf(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","import { GlobalState } from '../../global/types';\nimport { ApiChat, ApiPhoto } from '../../api/types';\n\nimport { ARCHIVED_FOLDER_ID } from '../../config';\nimport { omit } from '../../util/iteratees';\n\nexport function replaceChatListIds(\n global: GlobalState,\n type: 'active' | 'archived',\n newIds: number[] | 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: number[]): GlobalState {\n const { [type]: listIds } = global.chats.listIds;\n const newIds = listIds && 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\n// @optimization Don't spread/unspread global for each element, do it in a batch\nfunction getUpdatedChat(\n global: GlobalState, chatId: number, chatUpdate: Partial, photo?: ApiPhoto,\n): ApiChat {\n const { byId } = global.chats;\n const chat = byId[chatId];\n const shouldOmitMinInfo = chatUpdate.isMin && chat && !chat.isMin;\n const updatedChat = {\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 updatedChat;\n }\n\n return updatedChat;\n}\n\nexport function updateChat(\n global: GlobalState, chatId: number, chatUpdate: Partial, photo?: ApiPhoto,\n): GlobalState {\n const { byId } = global.chats;\n\n const updatedChat = getUpdatedChat(global, chatId, chatUpdate, photo);\n\n return replaceChats(global, {\n ...byId,\n [chatId]: updatedChat,\n });\n}\n\nexport function updateChats(global: GlobalState, updatedById: Record): GlobalState {\n const updatedChats = Object.keys(updatedById).map(Number).reduce>((acc, id) => {\n const updatedChat = getUpdatedChat(global, id, updatedById[id]);\n if (updatedChat) {\n acc[id] = updatedChat;\n }\n return acc;\n }, {});\n\n global = replaceChats(global, {\n ...global.chats.byId,\n ...updatedChats,\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, addedById: Record): GlobalState {\n const { byId } = global.chats;\n let isAdded = false;\n\n const addedChats = Object.keys(addedById).map(Number).reduce>((acc, id) => {\n if (!byId[id] || (byId[id].isMin && !addedById[id].isMin)) {\n const updatedChat = getUpdatedChat(global, id, addedById[id]);\n if (updatedChat) {\n acc[id] = updatedChat;\n\n if (!isAdded) {\n isAdded = true;\n }\n }\n }\n return acc;\n }, {});\n\n if (isAdded) {\n global = replaceChats(global, {\n ...global.chats.byId,\n ...addedChats,\n });\n }\n\n return global;\n}\n\nexport function updateChatListType(\n global: GlobalState,\n chatId: number,\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?: number[];\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","import {\n GlobalState, MessageList, MessageListType, Thread,\n} from '../../global/types';\nimport { ApiMessage, ApiThreadInfo, MAIN_THREAD_ID } from '../../api/types';\nimport { FocusDirection } from '../../types';\n\nimport { IS_TEST, MESSAGE_LIST_SLICE, MESSAGE_LIST_VIEWPORT_LIMIT } 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\nconst TMP_CHAT_ID = -1;\n\ntype MessageStoreSections = {\n byId: Record;\n threadsById: Record;\n};\n\nexport function updateCurrentMessageList(\n global: GlobalState,\n chatId: number | 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: number, newById: Record): GlobalState {\n return updateMessageStore(global, chatId, {\n byId: newById,\n });\n}\n\nfunction updateThread(\n global: GlobalState, chatId: number, threadId: number, threadUpdate: Partial,\n): GlobalState {\n const current = global.messages.byChatId[chatId];\n\n return updateMessageStore(global, chatId, {\n threadsById: {\n ...(current && current.threadsById),\n [threadId]: {\n ...(current && current.threadsById[threadId]),\n ...threadUpdate,\n },\n },\n });\n}\n\nfunction updateMessageStore(\n global: GlobalState, chatId: number, 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: number, 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).map(Number).forEach((chatId) => {\n global = addChatMessagesById(global, chatId, addedByChatId[chatId]);\n });\n\n return global;\n}\n\nexport function addChatMessagesById(\n global: GlobalState, chatId: number, 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: number, 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: number, 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 }, undefined);\n}\n\nexport function deleteChatMessages(\n global: GlobalState,\n chatId: number,\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 && 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 ? threadInfo.messagesCount : undefined;\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\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 && 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: number,\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, undefined);\n\n return global;\n}\n\nexport function updateListedIds(\n global: GlobalState,\n chatId: number,\n threadId: number,\n idsUpdate: number[],\n): GlobalState {\n const listedIds = selectListedIds(global, chatId, threadId);\n const newIds = listedIds && 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: number,\n threadId: number,\n idsUpdate: number[],\n): GlobalState {\n const outlyingIds = selectOutlyingIds(global, chatId, threadId);\n const newIds = outlyingIds && 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: number,\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: number,\n threadId: number,\n newViewportIds: number[],\n): GlobalState {\n const viewportIds = selectViewportIds(global, chatId, threadId) || [];\n\n return replaceThreadParam(\n global,\n chatId,\n threadId,\n 'viewportIds',\n areSortedArraysEqual(viewportIds, newViewportIds) ? viewportIds : newViewportIds,\n );\n}\n\nexport function updateThreadInfo(\n global: GlobalState, chatId: number, 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: number, 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: number, newById: Record, hash: number | undefined,\n): GlobalState {\n return updateScheduledMessages(global, chatId, {\n byId: newById,\n hash,\n });\n}\n\nfunction updateScheduledMessages(\n global: GlobalState, chatId: number, update: Partial<{ byId: Record; hash: number }>,\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?: number, messageId?: number, noHighlight = false,\n): GlobalState {\n return {\n ...global,\n focusedMessage: {\n ...global.focusedMessage,\n chatId,\n messageId,\n noHighlight,\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: number,\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: number,\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","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: number,\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\n return {\n ...global,\n stickers: {\n ...global.stickers,\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?: number,\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 } from '../../api/types';\n\nimport { omit } 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\n// @optimization Don't spread/unspread global for each element, do it in a batch\nfunction getUpdatedUser(global: GlobalState, userId: number, userUpdate: Partial): ApiUser {\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 user;\n }\n\n return updatedUser;\n}\n\nfunction updateContactList(global: GlobalState, updatedUsers: ApiUser[]): GlobalState {\n const { hash, userIds: contactUserIds } = global.contactList || {};\n\n if (!contactUserIds) return global;\n\n const newContactUserIds = updatedUsers\n .filter((user) => 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 hash: hash || 0,\n userIds: [\n ...newContactUserIds,\n ...contactUserIds,\n ],\n },\n };\n}\n\nexport function updateUser(global: GlobalState, userId: number, userUpdate: Partial): GlobalState {\n const { byId } = global.users;\n\n const updatedUser = getUpdatedUser(global, userId, userUpdate);\n\n global = updateContactList(global, [updatedUser]);\n\n return replaceUsers(global, {\n ...byId,\n [userId]: updatedUser,\n });\n}\n\n\nexport function updateUsers(global: GlobalState, updatedById: Record): GlobalState {\n const updatedUsers = Object.keys(updatedById).map(Number).reduce>((acc, id) => {\n const updatedUser = getUpdatedUser(global, id, updatedById[id]);\n if (updatedUser) {\n acc[id] = updatedUser;\n }\n return acc;\n }, {});\n\n global = updateContactList(global, Object.values(updatedUsers));\n\n global = replaceUsers(global, {\n ...global.users.byId,\n ...updatedUsers,\n });\n\n return global;\n}\n\n// @optimization Allows to avoid redundant updates which cause a lot of renders\nexport function addUsers(global: GlobalState, addedById: Record): GlobalState {\n const { byId } = global.users;\n let isAdded = false;\n\n const addedUsers = Object.keys(addedById).map(Number).reduce>((acc, id) => {\n if (!byId[id] || (byId[id].isMin && !addedById[id].isMin)) {\n const updatedUser = getUpdatedUser(global, id, addedById[id]);\n if (updatedUser) {\n acc[id] = updatedUser;\n\n if (!isAdded) {\n isAdded = true;\n }\n }\n }\n return acc;\n }, {});\n\n if (isAdded) {\n global = replaceUsers(global, {\n ...global.users.byId,\n ...addedUsers,\n });\n\n global = updateContactList(global, Object.values(addedUsers));\n }\n\n return global;\n}\n\nexport function updateSelectedUserId(global: GlobalState, selectedId?: number): GlobalState {\n if (global.users.selectedId === selectedId) {\n return global;\n }\n\n return {\n ...global,\n users: {\n ...global.users,\n selectedId,\n },\n };\n}\n\nexport function deleteUser(global: GlobalState, userId: number): GlobalState {\n const { byId } = global.users;\n const { hash, userIds } = global.contactList || {};\n delete byId[userId];\n\n global = {\n ...global,\n contactList: {\n hash: hash || 0,\n userIds: userIds ? userIds.filter((id) => id !== userId) : MEMO_EMPTY_ARRAY,\n },\n };\n\n return replaceUsers(global, byId);\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: number, 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","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 && resultsByType[type] ? resultsByType[type]!.foundIds : undefined;\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: number,\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: number,\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: number,\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 && 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: number,\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: number,\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: number,\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: number,\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 && 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) => a - b);\n}\n","import { GlobalState } from '../../global/types';\nimport { ManagementProgress } from '../../types';\n\ninterface ManagementState {\n isActive: boolean;\n isUsernameAvailable?: boolean;\n error?: string;\n}\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: number, 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: number, 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: number): 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: number): 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 formId: 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 description,\n photoUrl,\n } = message.content.invoice;\n return {\n ...global,\n payment: {\n ...global.payment,\n invoiceContent: {\n title,\n text,\n description,\n photoUrl,\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 setPaymentForm(global: GlobalState, form: ApiPaymentForm): GlobalState {\n return {\n ...global,\n payment: {\n ...global.payment,\n ...form,\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","// 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(cacheName: string, key: string, type: Type) {\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 switch (type) {\n case Type.Text:\n return await response.text();\n case Type.Blob: {\n const blob = await response.blob();\n\n // Safari does not return correct Content-Type header for webp images.\n if (key.substr(0, 7) === 'sticker') {\n return new Blob([blob], { type: 'image/webp' });\n }\n\n // iOS Safari fails to preserve `type` in cache\n if (!blob.type) {\n const contentType = response.headers.get('Content-Type');\n if (contentType) {\n return new Blob([blob], { type: contentType });\n }\n }\n\n return blob;\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","import {\n ApiBotInlineMediaResult, ApiBotInlineResult, ApiBotInlineSwitchPm,\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};\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 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 shouldAutoDownloadMediaFromContacts: boolean;\n shouldAutoDownloadMediaInPrivateChats: boolean;\n shouldAutoDownloadMediaInGroups: boolean;\n shouldAutoDownloadMediaInChannels: boolean;\n shouldAutoPlayGifs: boolean;\n shouldAutoPlayVideos: boolean;\n shouldSuggestStickers: boolean;\n shouldLoopStickers: boolean;\n hasPassword?: boolean;\n languages?: ApiLanguage[];\n language: LangCode;\n isSensitiveEnabled?: boolean;\n canChangeSensitive?: boolean;\n}\n\nexport interface ApiPrivacySettings {\n visibility: PrivacyVisibility;\n allowUserIds: number[];\n allowChatIds: number[];\n blockUserIds: number[];\n blockChatIds: number[];\n}\n\nexport interface IInputPrivacyContact {\n id: number;\n accessHash?: string;\n}\n\nexport interface IInputPrivacyRules {\n visibility: PrivacyVisibility;\n allowedUsers?: IInputPrivacyContact[];\n allowedChats?: IInputPrivacyContact[];\n blockedUsers?: IInputPrivacyContact[];\n blockedChats?: IInputPrivacyContact[];\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 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}\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 UserInfo,\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 MiddleHeaderAvatar,\n Album,\n ScheduledAlbum,\n SearchResult,\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 enum NewChatMembersProgress {\n Closed,\n InProgress,\n Loading,\n}\n\nexport type ProfileTabType = 'members' | 'media' | 'documents' | 'links' | 'audio';\nexport type SharedMediaType = 'media' | 'documents' | 'links' | 'audio';\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}\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 GroupUserPermissionsCreate,\n GroupUserPermissions,\n ChatAdministrators,\n GroupRecentActions,\n ChatAdminRights,\n GroupMembers,\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: number;\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 { ApiLangPack, ApiLangString } from '../api/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';\nimport { getGlobal } from '../lib/teact/teactn';\n\ninterface LangFn {\n (key: string, value?: any, format?: 'i'): any;\n\n isRtl?: boolean;\n code?: string;\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;\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 && langPack[key]) || (fallbackLangPack && 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 = 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: string, 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 } = getGlobal().settings.byKey;\n const langInfo = languages ? languages.find((l) => l.langCode === langCode) : undefined;\n getTranslation.isRtl = Boolean(langInfo && langInfo.rtl);\n getTranslation.code = langCode;\n\n if (callback) {\n callback();\n }\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 && 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","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 return {\n runCallbacks,\n addCallback,\n removeCallback,\n };\n}\n","import { DEBUG } from '../config';\n\nexport enum Bundles {\n Auth,\n Main,\n Extra\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}\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\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 }\n\n (LOAD_PROMISES[bundleName] as Promise).then(handleBundleLoad);\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\nconst listeners: NoneToVoidFunction[] = [];\n\nexport function addLoadListener(listener: NoneToVoidFunction) {\n if (!listeners.includes(listener)) {\n listeners.push(listener);\n }\n}\n\nfunction handleBundleLoad() {\n listeners.forEach((listener) => {\n listener();\n });\n}\n","import { ApiMediaFormat } from '../api/types';\n\nimport * as langProvider from '../util/langProvider';\nimport useForceUpdate from './useForceUpdate';\nimport useOnChange from './useOnChange';\n\nexport type LangFn = typeof langProvider.getTranslation;\n\nexport default (): LangFn => {\n const forceUpdate = useForceUpdate();\n\n useOnChange(() => {\n return langProvider.addCallback(forceUpdate);\n }, [forceUpdate]);\n\n return langProvider.getTranslation;\n};\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","function 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 request = indexedDB.open(dbName);\n request.onupgradeneeded = () => request.result.createObjectStore(storeName);\n const dbp = promisifyRequest(request);\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 * 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(customStore, callback) {\n return customStore('readonly', (store) => {\n // This would be store.getAllKeys(), but it isn't supported by Edge or Safari.\n // And openKeyCursor isn't supported by Safari.\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/**\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 const items = [];\n return eachCursor(customStore, (cursor) => items.push(cursor.key)).then(() => items);\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 const items = [];\n return eachCursor(customStore, (cursor) => items.push(cursor.value)).then(() => items);\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 const items = [];\n return eachCursor(customStore, (cursor) => items.push([cursor.key, cursor.value])).then(() => items);\n}\n\nexport { clear, createStore, del, entries, get, getMany, keys, promisifyRequest, set, setMany, update, values };\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?: number) {\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 Object.keys(hashes).map(Number).forEach((dcId) => {\n localStorage.setItem(`dc${dcId}_hash`, JSON.stringify(hashes[dcId]));\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: number };\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","// 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 React, { FC, memo } from '../../lib/teact/teact';\n\nimport Spinner from './Spinner';\n\nimport './Loading.scss';\n\ntype OwnProps = {\n color?: 'blue' | 'white' | 'black';\n};\n\nconst Loading: FC = ({ color = 'blue' }) => {\n return (\n

\n \n
\n );\n};\n\nexport default memo(Loading);\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: any;\n size?: 'default' | 'smaller' | 'tiny';\n color?: 'primary' | 'secondary' | 'gray' | 'danger' | 'translucent' | 'translucent-white' | 'dark';\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 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 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}) => {\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 );\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 e.preventDefault();\n if (!disabled && onMouseDown) {\n onMouseDown(e);\n }\n }, [onMouseDown, disabled]);\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 >\n {isLoading ? (\n
\n Please wait..\n \n
\n ) : children}\n {!disabled && ripple && (\n \n )}\n \n );\n};\n\nexport default Button;\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 { nativeToUnfified } from '../../../util/emoji';\nimport buildClassName from '../../../util/buildClassName';\n\nimport MentionLink from '../../middle/message/MentionLink';\nimport SafeLink from '../SafeLink';\n\ntype TextPart = string | Element;\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<(\n 'escape_html' | 'hq_emoji' | 'emoji' | 'emoji_html' | 'br' | 'br_html' | 'highlight' | 'links' |\n 'simple_markdown' | 'simple_markdown_html'\n )> = ['emoji'],\n params?: { highlight: string | undefined },\n): TextPart[] {\n if (typeof part !== 'string') {\n return [part];\n }\n\n return 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 return [...result, part];\n }\n\n divEl.innerText = part;\n\n return [...result, divEl.innerHTML];\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 return [...result, part];\n }\n\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 = nativeToUnfified(removeVS16s(emoji));\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, part) => {\n if (typeof part !== 'string') {\n return [...result, part];\n }\n\n return [...result, ...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 }, [] as TextPart[]);\n}\n\nfunction addHighlight(textParts: TextPart[], highlight: string | undefined): TextPart[] {\n return textParts.reduce((result, part) => {\n if (typeof part !== 'string' || !highlight) {\n return [...result, part];\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 return [...result, part];\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 return [...result, part];\n }\n\n const links = part.match(RE_LINK);\n if (!links || !links.length) {\n return [...result, part];\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 return [...result, part];\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","// 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 countryList, { defaultPhoneNumberFormat } from './countries';\n\nexport function getCountryById(id: string) {\n return countryList.find((c) => c.id === id) as Country;\n}\n\n// Empty groups are used to preserve 5 callback arguments for `replace` method\nfunction getPhoneNumberFormat(country?: Country) {\n return country ? country.phoneFormat : defaultPhoneNumberFormat;\n}\n\nexport function getCountryFromPhoneNumber(input: string) {\n let phoneNumber = input.replace(/[^\\d+]+/g, '');\n if (!phoneNumber.startsWith('+')) {\n phoneNumber = `+${phoneNumber}`;\n }\n\n const possibleCountries = countryList\n .filter((country: Country) => phoneNumber.startsWith(country.code))\n .sort((a, b) => a.code.length - b.code.length);\n\n return possibleCountries[possibleCountries.length - 1];\n}\n\nexport function formatPhoneNumber(input: string, country?: Country) {\n let phoneNumber = input.replace(/[^\\d]+/g, '');\n if (country) {\n phoneNumber = phoneNumber.substr(country.code.length - 1);\n } else if (input.startsWith('+')) {\n return input;\n }\n\n phoneNumber = phoneNumber.replace(getPhoneNumberFormat(country), (_, p1, p2, p3, p4, p5) => {\n const separator = country && country.id === 'GB' ? ' ' : '-';\n\n let output = '';\n if (p1) output = `${p1}`;\n if (p2) output += ` ${p2}`;\n if (p3) output += `${separator}${p3}`;\n if (p4) output += `${separator}${p4}`;\n if (p5) output += `${separator}${p5}`;\n return output;\n });\n\n return phoneNumber;\n}\n\nexport function formatPhoneNumberWithCode(phoneNumber: string) {\n const numberWithPlus = phoneNumber.startsWith('+') ? phoneNumber : `+${phoneNumber}`;\n const country = getCountryFromPhoneNumber(numberWithPlus);\n if (!country) {\n return numberWithPlus;\n }\n return `${country.code} ${formatPhoneNumber(numberWithPlus, country)}`;\n}\n\nexport { countryList };\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\nexport default >(\n bundleName: B, moduleName: M, noLoad = false, autoUpdate = false,\n) => {\n const module = getModuleFromMemory(bundleName, moduleName);\n const forceUpdate = useForceUpdate();\n\n if (autoUpdate) {\n // Use effect and cleanup for listener removal\n addLoadListener(forceUpdate);\n }\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","import { useCallback, useState } from '../lib/teact/teact';\n\nexport default (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","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';\n withBackground?: boolean;\n}> = ({\n color = 'blue',\n withBackground,\n}) => {\n return (\n
\n
\n
\n );\n};\n\nexport default Spinner;\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 e.preventDefault();\n\n handleError(e instanceof ErrorEvent ? e.error : 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 && err.message) || err}\\n${err && err.stack}`);\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","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 { 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 MILISECONDS_IN_DAY = 24 * 60 * 60 * 1000;\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\nexport function formatTime(datetime: number | Date) {\n const date = typeof datetime === 'number' ? new Date(datetime) : datetime;\n const hours = String(date.getHours()).padStart(2, '0');\n const minutes = String(date.getMinutes()).padStart(2, '0');\n\n return `${hours}:${minutes}`;\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(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 formatHumanDate(lang: LangFn, datetime: number | Date, isShort = false, noWeekdays = false) {\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 (isShort ? lowerFirst : upperFirst)(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 (isShort ? lowerFirst : upperFirst)(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 return isShort\n ? lowerFirst(lang(`Weekday.Short${weekDay}`))\n : upperFirst(lang(`Weekday.${weekDay}`));\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 (isShort ? lowerFirst : upperFirst)(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}\n\nexport function formatMediaDateTime(lang: LangFn, datetime: number | Date) {\n const date = typeof datetime === 'number' ? new Date(datetime) : datetime;\n\n return `${formatHumanDate(lang, date, true)}, ${formatTime(date)}`;\n}\n\nexport function formatMediaDuration(duration: 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 let string = '';\n if (hours > 0) {\n string += `${String(hours).padStart(2, '0')}:`;\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(date: Date, locale = 'en-US') {\n return date.toLocaleString(\n locale,\n {\n year: 'numeric',\n month: 'short',\n day: '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 + MILISECONDS_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 { useCallback, useState } from '../lib/teact/teact';\n\nexport default () => {\n const [, setTrigger] = useState(false);\n\n return useCallback(() => {\n setTrigger((trigger) => !trigger);\n }, []);\n};\n","import React, { FC, useCallback } from '../../lib/teact/teact';\n\nimport buildClassName from '../../util/buildClassName';\n\nimport './Link.scss';\n\ntype OwnProps = {\n children: any;\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","export default (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","import { callApi } from '../api/gramjs';\nimport { ApiChat, ApiMessage, ApiUser } from '../api/types';\nimport { renderActionMessageText } from '../components/common/helpers/renderActionMessageText';\nimport { DEBUG } from '../config';\nimport { getDispatch, getGlobal, setGlobal } from '../lib/teact/teactn';\nimport {\n getChatTitle,\n getMessageAction,\n getMessageSenderName,\n getMessageSummaryText,\n getPrivateChatUserId,\n isActionMessage,\n isChatChannel,\n selectIsChatMuted,\n} from '../modules/helpers';\nimport { getTranslation } from './langProvider';\nimport { addNotifyExceptions, replaceSettings } from '../modules/reducers';\nimport {\n selectChatMessage, selectNotifyExceptions, selectNotifySettings, selectUser,\n} from '../modules/selectors';\nimport { IS_SERVICE_WORKER_SUPPORTED } from './environment';\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\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;\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;\n\n let global = replaceSettings(getGlobal(), resultSettings);\n if (resultExceptions) {\n global = addNotifyExceptions(global, resultExceptions);\n }\n setGlobal(global);\n areSettingsLoaded = true;\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) {\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, isActive: boolean) {\n if (!areSettingsLoaded) return false;\n const global = getGlobal();\n if (selectIsChatMuted(chat, selectNotifySettings(global), selectNotifyExceptions(global)) || chat.isNotJoined\n || !chat.isListed) {\n return false;\n }\n // Dont show notification for active chat if client has focus\n return !(isActive && document.hasFocus());\n}\n\nfunction getNotificationContent(chat: ApiChat, message: ApiMessage) {\n const global = getGlobal();\n const {\n senderId,\n replyToMessageId,\n } = message;\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)).filter(Boolean as any)\n : undefined;\n const privateChatUserId = getPrivateChatUserId(chat);\n const privateChatUser = privateChatUserId ? selectUser(global, privateChatUserId) : undefined;\n let body: string;\n if (isActionMessage(message)) {\n const actionOrigin = chat && (isChatChannel(chat) || message.senderId === message.chatId)\n ? chat\n : messageSender;\n body = renderActionMessageText(\n getTranslation,\n message,\n actionOrigin,\n actionTargetUsers,\n actionTargetMessage,\n actionTargetChatId,\n { asPlain: true },\n ) as string;\n } else {\n const senderName = getMessageSenderName(getTranslation, chat.id, messageSender);\n const summary = getMessageSummaryText(getTranslation, message);\n\n body = senderName ? `${senderName}: ${summary}` : summary;\n }\n\n return {\n title: getChatTitle(getTranslation, chat, privateChatUser),\n body,\n };\n}\n\nexport async function showNewMessageNotification({\n chat,\n message,\n isActiveChat,\n}: { chat: ApiChat; message: Partial; isActiveChat: boolean}) {\n if (!checkIfNotificationsSupported()) return;\n if (!message.id) return;\n\n await loadNotificationSettings();\n if (!checkIfShouldNotify(chat, isActiveChat)) return;\n\n const {\n title,\n body,\n } = getNotificationContent(chat, message as ApiMessage);\n\n if (checkIfPushSupported()) {\n if (navigator.serviceWorker.controller) {\n // notify service worker about new message notification\n navigator.serviceWorker.controller.postMessage({\n type: 'newMessageNotification',\n payload: {\n title,\n body,\n chatId: chat.id,\n messageId: message.id,\n },\n });\n }\n } else {\n const dispatch = getDispatch();\n const options: NotificationOptions = {\n body,\n icon: 'icon-192x192.png',\n badge: 'icon-192x192.png',\n tag: message.id.toString(),\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 (window.focus) {\n window.focus();\n }\n };\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","import { ApiChat, ApiUser } 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';\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(lang: LangFn, user: ApiUser, serverTimeOffset: number) {\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 (!user.status) {\n return '';\n }\n\n switch (user.status.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 } = user.status;\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(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(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) {\n const { id, status, type } = user;\n\n if (!status) {\n return false;\n }\n\n if (id === SERVICE_NOTIFICATIONS_USER_ID) {\n return false;\n }\n\n return status.type === 'userStatusOnline' && type !== 'userTypeBot';\n}\n\nexport function isDeletedUser(user: ApiUser) {\n if (!user.status || 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 sortUserIds(\n userIds: number[],\n usersById: Record,\n priorityIds?: number[],\n serverTimeOffset = 0,\n) {\n return orderBy(userIds, (id) => {\n const now = Date.now() / 1000 + 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 if (!user || !user.status) {\n return 0;\n }\n\n if (user.status.type === 'userStatusOnline') {\n return user.status.expires;\n } else if (user.status.type === 'userStatusOffline' && user.status.wasOnline) {\n return user.status.wasOnline;\n }\n\n switch (user.status.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\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 ? Math.abs(peer.id) % 7 : 0;\n\n return USER_COLOR_KEYS[index];\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 } from '../../config';\nimport { orderBy } from '../../util/iteratees';\nimport { getUserFirstOrLastName } from './users';\nimport { formatDateToString, formatTime } from '../../util/dateFormat';\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 isChatPrivate(chatId: number) {\n return chatId > 0;\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 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 && chat.currentUserBannedRights[key])\n || (chat.defaultBannedRights && 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) {\n return false;\n }\n\n if (chat.isCreator) {\n return true;\n }\n\n if (isChatPrivate(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')) && (!isChatPrivate(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, currentUserBannedRights?: ApiChatBannedRights, defaultBannedRights?: ApiChatBannedRights,\n) {\n if (currentUserBannedRights && 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(untilDate * 1000)],\n ),\n )\n : lang('Channel.Persmission.Denied.SendMessages.Forever');\n }\n\n if (defaultBannedRights && 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\n\nexport function getChatOrder(chat: ApiChat) {\n return Math.max(\n chat.joinDate || 0,\n chat.draftDate || 0,\n chat.lastMessage ? chat.lastMessage.date : 0,\n );\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 return !(notifyExceptions && notifyExceptions[chat.id] && !notifyExceptions[chat.id].isMuted) && (\n chat.isMuted\n || (isChatPrivate(chat.id) && !notifySettings.hasPrivateChatsNotifications)\n || (isChatChannel(chat) && !notifySettings.hasBroadcastNotifications)\n || (isChatGroup(chat) && !notifySettings.hasGroupNotifications)\n );\n}\n\nexport function getCanDeleteChat(chat: ApiChat) {\n return isChatBasicGroup(chat) || ((isChatSuperGroup(chat) || isChatChannel(chat)) && chat.isCreator);\n}\n\nexport function prepareFolderListIds(\n chatsById: Record,\n usersById: Record,\n folder: ApiChatFolder,\n notifySettings: NotifySettings,\n notifyExceptions?: Record,\n chatIdsCache?: number[],\n) {\n const excludedChatIds = folder.excludedChatIds ? new Set(folder.excludedChatIds) : undefined;\n const includedChatIds = folder.excludedChatIds ? new Set(folder.includedChatIds) : undefined;\n const pinnedChatIds = folder.excludedChatIds ? new Set(folder.pinnedChatIds) : undefined;\n const listIds = (chatIdsCache || Object.keys(chatsById).map(Number))\n .filter((id) => {\n return filterChatFolder(\n chatsById[id],\n folder,\n usersById,\n notifySettings,\n notifyExceptions,\n excludedChatIds,\n includedChatIds,\n pinnedChatIds,\n );\n });\n\n return [listIds, folder.pinnedChatIds] as const;\n}\n\nfunction filterChatFolder(\n chat: ApiChat,\n folder: ApiChatFolder,\n usersById: Record,\n notifySettings: NotifySettings,\n notifyExceptions?: Record,\n excludedChatIds?: Set,\n includedChatIds?: Set,\n pinnedChatIds?: Set,\n) {\n if (!chat.isListed) {\n return false;\n }\n\n if (excludedChatIds && excludedChatIds.has(chat.id)) {\n return false;\n }\n\n if (includedChatIds && includedChatIds.has(chat.id)) {\n return true;\n }\n\n if (pinnedChatIds && pinnedChatIds.has(chat.id)) {\n return true;\n }\n\n if (isChatArchived(chat) && folder.excludeArchived) {\n return false;\n }\n\n if (folder.excludeMuted && !chat.unreadMentionsCount && selectIsChatMuted(chat, notifySettings, notifyExceptions)) {\n return false;\n }\n\n if (!chat.unreadCount && !chat.unreadMentionsCount && !chat.hasUnreadMark && folder.excludeRead) {\n return false;\n }\n\n if (isChatPrivate(chat.id)) {\n const privateChatUser = usersById[chat.id];\n\n const isChatWithBot = privateChatUser && privateChatUser.type === 'userTypeBot';\n if (isChatWithBot) {\n if (folder.bots) {\n return true;\n }\n } else {\n if (folder.contacts && privateChatUser && privateChatUser.isContact) {\n return true;\n }\n\n if (folder.nonContacts && privateChatUser && !privateChatUser.isContact) {\n return true;\n }\n }\n } else if (isChatGroup(chat)) {\n return !!folder.groups;\n } else if (isChatChannel(chat)) {\n return !!folder.channels;\n }\n\n return false;\n}\n\nexport function prepareChatList(\n chatsById: Record,\n listIds: number[],\n orderedPinnedIds?: number[],\n folderType: 'all' | 'archived' | 'folder' = 'all',\n) {\n function chatFilter(chat?: ApiChat) {\n if (!chat || !chat.lastMessage || chat.migratedTo) {\n return false;\n }\n\n switch (folderType) {\n case 'all':\n if (isChatArchived(chat)) {\n return false;\n }\n break;\n case 'archived':\n if (!isChatArchived(chat)) {\n return false;\n }\n break;\n }\n\n return !chat.isRestricted && !chat.isNotJoined;\n }\n\n const listedChats = listIds\n .map((id) => chatsById[id])\n .filter(chatFilter);\n\n const listIdsSet = new Set(listIds);\n const pinnedChats = orderedPinnedIds\n ? (\n orderedPinnedIds\n .map((id) => chatsById[id])\n .filter(chatFilter)\n .filter((chat) => listIdsSet.has(chat.id))\n )\n : [];\n\n const otherChats = orderBy(\n orderedPinnedIds\n ? listedChats.filter((chat) => !orderedPinnedIds.includes(chat.id))\n : listedChats,\n getChatOrder,\n 'desc',\n );\n\n return {\n pinnedChats,\n otherChats,\n };\n}\n\nexport function getFolderUnreadDialogs(\n chatsById: Record,\n usersById: Record,\n folder: ApiChatFolder,\n chatIdsCache: number[],\n notifySettings: NotifySettings,\n notifyExceptions?: Record,\n) {\n const [listIds] = prepareFolderListIds(chatsById, usersById, folder, notifySettings, notifyExceptions, chatIdsCache);\n\n const listedChats = listIds\n .map((id) => chatsById[id])\n .filter((chat) => (chat && chat.lastMessage && !chat.isRestricted && !chat.isNotJoined));\n\n const unreadDialogsCount = listedChats\n .reduce((total, chat) => (chat.unreadCount || chat.hasUnreadMark ? total + 1 : total), 0);\n\n const hasActiveDialogs = listedChats.some((chat) => (\n chat.unreadMentionsCount\n || (!selectIsChatMuted(chat, notifySettings, notifyExceptions) && (chat.unreadCount || chat.hasUnreadMark))\n ));\n\n return {\n unreadDialogsCount,\n hasActiveDialogs,\n };\n}\n\nexport function getFolderDescriptionText(\n lang: LangFn,\n chatsById: Record,\n usersById: Record,\n folder: ApiChatFolder,\n chatIdsCache: number[],\n notifySettings: NotifySettings,\n notifyExceptions?: Record,\n) {\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 Object.values(filters).filter(Boolean).length > 1\n || (excludedChatIds && excludedChatIds.length)\n || (includedChatIds && includedChatIds.length)\n ) {\n const length = getFolderChatsCount(chatsById, usersById, folder, chatIdsCache, notifySettings, notifyExceptions);\n return lang('Chats', length);\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\nfunction getFolderChatsCount(\n chatsById: Record,\n usersById: Record,\n folder: ApiChatFolder,\n chatIdsCache: number[],\n notifySettings: NotifySettings,\n notifyExceptions?: Record,\n) {\n const [listIds, pinnedIds] = prepareFolderListIds(\n chatsById, usersById, folder, notifySettings, notifyExceptions, chatIdsCache,\n );\n const { pinnedChats, otherChats } = prepareChatList(chatsById, listIds, pinnedIds, 'folder');\n return pinnedChats.length + otherChats.length;\n}\n\nexport function isChat(chatOrUser?: ApiUser | ApiChat): chatOrUser is ApiChat {\n if (!chatOrUser) {\n return false;\n }\n\n return chatOrUser.id < 0;\n}\n\nexport function getMessageSenderName(lang: LangFn, chatId: number, sender?: ApiUser) {\n if (!sender || isChatPrivate(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: number[],\n chatsById: Record,\n shouldPrioritizeVerified = false,\n priorityIds?: number[],\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","import { useEffect } from '../lib/teact/teact';\n\nexport const ANIMATION_START_EVENT = 'tt-event-heavy-animation-start';\nexport const ANIMATION_END_EVENT = 'tt-event-heavy-animation-end';\n\nlet timeout: number | undefined;\nlet isAnimating = false;\n\nexport const dispatchHeavyAnimationEvent = (duration?: number) => {\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 if (duration) {\n timeout = window.setTimeout(() => {\n isAnimating = false;\n document.dispatchEvent(new Event(ANIMATION_END_EVENT));\n timeout = undefined;\n }, duration);\n }\n\n return () => {\n isAnimating = false;\n document.dispatchEvent(new Event(ANIMATION_END_EVENT));\n };\n};\n\nexport default (\n handleAnimationStart: AnyToVoidFunction,\n handleAnimationEnd: AnyToVoidFunction,\n) => {\n useEffect(() => {\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 }, [handleAnimationEnd, handleAnimationStart]);\n};\n","import { DEBUG } from '../../config';\n\ntype Handler = (e: Event) => void;\n\nconst NON_BUBBLEABLE_EVENTS = new Set(['scroll', 'mouseenter', 'mouseleave']);\n\nconst delegationRegistry: Record> = {};\nconst delegatedEventsByElement = new Map>();\nconst documentEventCounters: Record = {};\n\nexport function addEventListener(element: HTMLElement, propName: string, handler: Handler, asCapture = false) {\n const eventName = resolveEventName(propName, element);\n if (canUseEventDelegation(eventName, element, asCapture)) {\n addDelegatedListener(eventName, element, handler);\n } else {\n element.addEventListener(eventName, handler, asCapture);\n }\n}\n\nexport function removeEventListener(element: HTMLElement, propName: string, handler: Handler, asCapture = false) {\n const eventName = resolveEventName(propName, element);\n if (canUseEventDelegation(eventName, element, asCapture)) {\n removeDelegatedListener(eventName, element);\n } else {\n element.removeEventListener(eventName, handler, asCapture);\n }\n}\n\nfunction resolveEventName(propName: string, element: HTMLElement) {\n const eventName = propName\n .replace(/^on/, '')\n .replace(/Capture$/, '').toLowerCase();\n\n if (eventName === '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 (eventName === 'doubleclick') {\n return 'dblclick';\n }\n\n // Replace focus/blur by their \"bubbleable\" versions\n if (eventName === 'focus') {\n return 'focusin';\n }\n\n if (eventName === 'blur') {\n return 'focusout';\n }\n\n return eventName;\n}\n\nfunction canUseEventDelegation(realEventName: string, element: HTMLElement, asCapture: boolean) {\n return (\n !asCapture\n && !NON_BUBBLEABLE_EVENTS.has(realEventName)\n && element.tagName !== 'VIDEO'\n && element.tagName !== 'IFRAME'\n );\n}\n\nfunction addDelegatedListener(eventName: string, element: HTMLElement, handler: Handler) {\n if (!documentEventCounters[eventName]) {\n documentEventCounters[eventName] = 0;\n document.addEventListener(eventName, handleEvent);\n }\n\n resolveDelegationRegistryForName(eventName).set(element, handler);\n resolveDelegatedEventsForElement(element).add(eventName);\n documentEventCounters[eventName]++;\n}\n\nfunction removeDelegatedListener(eventName: string, element: HTMLElement) {\n documentEventCounters[eventName]--;\n if (!documentEventCounters[eventName]) {\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(eventName, handleEvent);\n }\n\n delegationRegistry[eventName].delete(element);\n delegatedEventsByElement.get(element)!.delete(eventName);\n}\n\nexport function removeAllDelegatedListeners(element: HTMLElement) {\n const eventNames = delegatedEventsByElement.get(element);\n if (!eventNames) {\n return;\n }\n\n eventNames.forEach((eventName) => removeDelegatedListener(eventName, element));\n delegatedEventsByElement.delete(element);\n}\n\nfunction handleEvent(realEvent: Event) {\n const events = delegationRegistry[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 resolveDelegationRegistryForName(eventName: string) {\n if (!delegationRegistry[eventName]) {\n delegationRegistry[eventName] = new Map();\n }\n\n return delegationRegistry[eventName];\n}\n\nfunction resolveDelegatedEventsForElement(element: HTMLElement) {\n const existing = delegatedEventsByElement.get(element);\n if (existing) {\n return existing;\n }\n\n const newSet = new Set();\n delegatedEventsByElement.set(element, newSet);\n\n return newSet;\n}\n\nif (DEBUG) {\n document.addEventListener('dblclick', () => {\n // eslint-disable-next-line no-console\n console.log('DELEGATED EVENTS', { delegationRegistry, delegatedEventsByElement, documentEventCounters });\n });\n}\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\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;\n\ntype HistoryState = {\n currentIndex: number;\n nextStateIndexToReplace: number;\n isHistoryAltered: boolean;\n isDisabled: boolean;\n isEdge: boolean;\n currentIndexes: number[];\n};\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 }, '');\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 (historyState.currentIndexes.includes(historyState.nextStateIndexToReplace - 1)\n && window.history.state.index !== 0\n && historyState.nextStateIndexToReplace === index\n && !shouldReplaceNext)\n ? 'replaceState'\n : 'pushState'\n ]({\n index,\n state: currentState,\n }, '');\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 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 } 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 }, '', `#${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 { useRef, useState } from '../lib/teact/teact';\nimport buildClassName from '../util/buildClassName';\n\nconst CLOSE_DURATION = 350;\n\nexport default (\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\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 closeTimeoutRef.current = window.setTimeout(() => {\n setIsClosed(true);\n\n if (onCloseTransitionEnd) {\n onCloseTransitionEnd();\n }\n\n closeTimeoutRef.current = undefined;\n }, noCloseTransition ? 0 : CLOSE_DURATION);\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","const DEFAULT_MAX_TEXT_LENGTH = 30;\n\nexport default function trimText(text: string | undefined, length = DEFAULT_MAX_TEXT_LENGTH) {\n if (!text || text.length <= length) {\n return text;\n }\n\n return `${text.substr(0, length)}...`;\n}\n","import React, { FC, useCallback } from '../../lib/teact/teact';\n\nimport buildClassName from '../../util/buildClassName';\nimport useLang from '../../hooks/useLang';\n\nimport './MenuItem.scss';\n\ntype OnClickHandler = (e: React.SyntheticEvent) => void;\n\ntype OwnProps = {\n icon?: string;\n className?: string;\n children: any;\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 );\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 }: Ripple) => (\n \n ))}\n
\n );\n};\n\nexport default memo(RippleEffect);\n","import { ISettings } from '../types';\n\nimport { animateSingle } from './animation';\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;\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\nexport default (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 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 } 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}\n","import WebpWorker from 'worker-loader!../lib/webp/webp_wasm.worker';\nimport { isWebpSupported } from './environment';\nimport { dataUriToBlob, blobToDataUri } from './files';\nimport { pause } from './schedulers';\n\ntype TEncodedImage = {\n result: Uint8ClampedArray;\n width: number;\n height: number;\n};\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, url: string): Promise {\n if (isWebpSupported() || url.substr(0, 15) !== 'data:image/webp') {\n return url;\n }\n\n initWebpWorker();\n\n const pngBlob = await webpToPng(key, dataUriToBlob(url));\n\n if (!pngBlob) {\n throw new Error(`Can't convert webp to png. Url: ${url}`);\n }\n\n return blobToDataUri(pngBlob);\n}\n\nfunction initWebpWorker() {\n if (!worker) {\n worker = new WebpWorker() 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 worker.requests = worker.requests || new Map();\n worker.requests.set(url, resolve);\n worker.postMessage({ id: url, blob });\n });\n}\n","import { ChangeEvent, FormEvent, RefObject } 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 { ChangeEvent } from 'react';\nimport React, { FC, memo, useCallback } from '../../lib/teact/teact';\n\nimport buildClassName from '../../util/buildClassName';\nimport useLang from '../../hooks/useLang';\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 captureKeyboardListener from './captureKeyboardListeners';\n\ntype IHandlerFunction = () => void;\n\nexport default function captureEscKeyListener(handler: IHandlerFunction) {\n return captureKeyboardListener({ onEsc: handler });\n}\n","export 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) => word.length && word.match(/./u)![0].toUpperCase())\n .join('');\n}\n","export const MEMO_EMPTY_ARRAY = [];\n","import usePrevious from './usePrevious';\n\nexport default (cb: (args: PT) => void, dependencies: T) => {\n const prevDeps = usePrevious(dependencies);\n if (!prevDeps || dependencies.some((d, i) => d !== prevDeps[i])) {\n // @ts-ignore (workaround for \"could be instantiated with a different subtype\" issue)\n cb(prevDeps || []);\n }\n};\n","const RE_NOT_LETTER = /[^\\wа-яё]+/;\n\nexport default function searchWords(haystack: string, needle: string) {\n if (!haystack || !needle) {\n return false;\n }\n\n const haystackWords = haystack.toLowerCase().split(RE_NOT_LETTER);\n const needleWords = needle.toLowerCase().split(RE_NOT_LETTER);\n\n return needleWords.every((needleWord) => (\n haystackWords.some((haystackWord) => haystackWord.startsWith(needleWord))\n ));\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 windowSize = updateSizes();\nlet isRefreshDisabled = false;\n\nfunction disableRefresh() {\n isRefreshDisabled = true;\n}\n\nfunction enableRefresh() {\n isRefreshDisabled = false;\n}\n\nconst handleResize = throttle(() => {\n windowSize = 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('resize', handleResize);\nwindow.addEventListener('orientationchange', handleResize);\n\nexport function updateSizes(): IDimensions {\n const vh = window.innerHeight * 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 windowSize.width <= MOBILE_SCREEN_MAX_WIDTH || (\n windowSize.width <= MOBILE_SCREEN_LANDSCAPE_MAX_WIDTH && windowSize.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\nexport default {\n get: () => windowSize,\n getIsKeyboardVisible: () => initialHeight > windowSize.height,\n disableRefresh,\n enableRefresh,\n};\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';\n\nimport './Menu.scss';\n\ntype OwnProps = {\n ref?: RefObject;\n containerRef?: RefObject;\n isOpen: boolean;\n className?: string;\n style?: string;\n positionX?: 'left' | 'right';\n positionY?: 'top' | 'bottom';\n autoClose?: boolean;\n shouldSkipTransition?: boolean;\n footer?: string;\n noCloseOnBackdrop?: 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: any;\n};\n\nconst ANIMATION_DURATION = 200;\n\nconst Menu: FC = ({\n ref,\n containerRef,\n isOpen,\n className,\n style,\n children,\n positionX = 'left',\n positionY = 'top',\n autoClose = false,\n footer,\n noCloseOnBackdrop = false,\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 (prevIsOpen !== undefined) {\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 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","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 DecoderWorker from 'worker-loader!opus-recorder/dist/decoderWorker.min';\nimport WavWorker from 'worker-loader!opus-recorder/dist/waveWorker.min';\n\nconst 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: DecoderWorker | undefined = new DecoderWorker();\n let wavWorker: WavWorker | undefined = new WavWorker();\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 ApiMediaFormatToPrepared,\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.DataUri]: cacheApi.Type.Text,\n [ApiMediaFormat.BlobUrl]: cacheApi.Type.Blob,\n [ApiMediaFormat.Lottie]: cacheApi.Type.Json,\n [ApiMediaFormat.Progressive]: undefined,\n [ApiMediaFormat.Stream]: undefined,\n};\n\nconst PROGRESSIVE_URL_PREFIX = './progressive/';\n\nconst memoryCache = new Map();\nconst fetchPromises = new Map>();\n\nexport function fetch(\n url: string, mediaFormat: T, onProgress?: ApiOnProgress,\n): Promise> {\n if (mediaFormat === ApiMediaFormat.Progressive) {\n return (\n IS_PROGRESSIVE_SUPPORTED\n ? getProgressive(url)\n : fetch(url, ApiMediaFormat.BlobUrl, onProgress)\n ) as Promise>;\n }\n\n if (!fetchPromises.has(url)) {\n const promise = fetchFromCacheOrRemote(url, mediaFormat, onProgress)\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 });\n\n fetchPromises.set(url, promise);\n }\n\n return fetchPromises.get(url) as Promise>;\n}\n\nexport function getFromMemory(url: string) {\n return memoryCache.get(url) as ApiMediaFormatToPrepared;\n}\n\nexport function cancelProgress(progressCallback: ApiOnProgress) {\n cancelApiProgress(progressCallback);\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(url: string, mediaFormat: ApiMediaFormat, onProgress?: ApiOnProgress) {\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]!);\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 void callApi('downloadMedia', { url, mediaFormat }, (progress: number, arrayBuffer: ArrayBuffer) => {\n if (onProgress) {\n onProgress(progress);\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\n memoryCache.set(url, streamUrl);\n return streamUrl;\n }\n\n const remote = await callApi('downloadMedia', { url, mediaFormat }, onProgress);\n if (!remote) {\n throw new Error('Failed to fetch media');\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 = blob.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 prepareMedia(mediaData: ApiParsedMedia): 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","import { useEffect } from '../lib/teact/teact';\nimport usePrevious from './usePrevious';\n\nexport default (cb: (args: PT) => void, dependencies: T, debugKey?: string) => {\n const prevDeps = usePrevious(dependencies);\n return useEffect(() => {\n // @ts-ignore (workaround for \"could be instantiated with a different subtype\" issue)\n return cb(prevDeps || []);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, dependencies, debugKey);\n};\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 { DEBUG, RE_TME_INVITE_LINK, RE_TME_LINK } from '../../config';\nimport buildClassName from '../../util/buildClassName';\n\ntype OwnProps = {\n url?: string;\n text: string;\n className?: string;\n children?: any;\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_TME_INVITE_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 ensureProtocol(url?: string) {\n if (!url) {\n return undefined;\n }\n\n return url.includes('://') ? url : `https://${url}`;\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 { ApiError, ApiInviteInfo } from '../../api/types';\n\nconst STRIPE_ERRORS: Record> = {\n missing_payment_information: {\n field: 'cardNumber',\n fieldError: 'Incorrect card number',\n },\n invalid_number: {\n field: 'cardNumber',\n fieldError: 'Incorrect card number',\n },\n number: {\n field: 'cardNumber',\n fieldError: 'Incorrect card number',\n },\n exp_year: {\n field: 'expiry',\n fieldError: 'Incorrect year',\n },\n exp_month: {\n field: 'expiry',\n fieldError: 'Incorrect month',\n },\n invalid_expiry_year: {\n field: 'expiry',\n fieldError: 'Incorrect year',\n },\n invalid_expiry_month: {\n field: 'expiry',\n fieldError: 'Incorrect month',\n },\n cvc: {\n field: 'cvv',\n fieldError: 'Incorrect CVV',\n },\n invalid_cvc: {\n field: 'cvv',\n fieldError: 'Incorrect CVV',\n },\n};\n\nexport function getStripeError(error: {\n code: string;\n message: string;\n param?: string;\n}) {\n const { message, code, param } = error;\n const { field, fieldError, description } = param ? STRIPE_ERRORS[param] : STRIPE_ERRORS[code];\n return {\n field,\n fieldError,\n description: description || message,\n };\n}\n\nconst SHIPPING_ERRORS: Record> = {\n ADDRESS_STREET_LINE1_INVALID: {\n field: 'streetLine1',\n fieldError: 'Incorrect street address',\n },\n ADDRESS_STREET_LINE2_INVALID: {\n field: 'streetLine2',\n fieldError: 'Incorrect street address',\n },\n ADDRESS_CITY_INVALID: {\n field: 'city',\n fieldError: 'Incorrect city',\n },\n ADDRESS_COUNTRY_INVALID: {\n field: 'countryIso2',\n fieldError: 'Incorrect country',\n },\n ADDRESS_POSTCODE_INVALID: {\n field: 'postCode',\n fieldError: 'Incorrect post code',\n },\n ADDRESS_STATE_INVALID: {\n field: 'state',\n fieldError: 'Incorrect state',\n },\n REQ_INFO_NAME_INVALID: {\n field: 'fullName',\n fieldError: 'Incorrect name',\n },\n REQ_INFO_PHONE_INVALID: {\n field: 'phone',\n fieldError: 'Incorrect phone',\n },\n REQ_INFO_EMAIL_INVALID: {\n field: 'email',\n fieldError: 'Incorrect email',\n },\n};\n\n\nexport function getShippingErrors(dialogs: (ApiError | ApiInviteInfo)[]) {\n return Object.values(dialogs).reduce((acc, cur) => {\n if (!('hasErrorKey' in cur) || !cur.hasErrorKey) return acc;\n const error = SHIPPING_ERRORS[cur.message];\n if (error) {\n acc = {\n ...acc,\n [error.field]: error.fieldError,\n };\n }\n return acc;\n }, {});\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 fastRaf(() => {\n if (!instance!.isCancelled && tick()) {\n animateSingle(tick, instance);\n }\n });\n}\n\nexport function animate(tick: Function) {\n fastRaf(() => {\n if (tick()) {\n animate(tick);\n }\n });\n}\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: any;\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 { RefObject } from 'react';\nimport { useState, useCallback, useEffect } from '../lib/teact/teact';\n\nexport default (\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","// @ts-ignore\nimport 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\nexport default (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","// 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\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\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 nativeToUnfified(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","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']);\nconst MAPPED_ATTRIBUTES: { [k: string]: string } = {\n autoPlay: 'autoplay',\n autoComplete: 'autocomplete',\n};\nconst INDEX_KEY_PREFIX = '__indexKey#';\n\nconst headsByElement: Record = {};\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 if (\n !skipComponentUpdate\n && $current && $new\n && isComponentElement($current) && isComponentElement($new)\n && !hasElementChanged($current, $new)\n ) {\n $new = updateComponent($current, $new);\n }\n\n // Parent element may have changed, so we need to update the listener closure.\n if (!skipComponentUpdate && $new && isComponentElement($new) && $new.componentInstance.isMounted) {\n setupComponentUpdateListener($new, $parent, index, parentEl);\n }\n\n if ($current === $new) {\n return $new;\n }\n\n if (!$current && $new) {\n if (isComponentElement($new)) {\n $new = initComponent($new, $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 (isComponentElement($new)) {\n $new = initComponent($new, $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 = isComponentElement($current) && isComponentElement($new);\n\n if (!areComponents) {\n setTarget($new, getTarget($current)!);\n }\n\n if (isRealElement($current) && isRealElement($new)) {\n if (moveDirection) {\n const node = getTarget($current)!;\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, $new, getTarget($current) as HTMLElement);\n }\n\n $new.children = renderChildren(\n $current,\n $new,\n areComponents ? parentEl : getTarget($current) 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.keys(props).forEach((key) => {\n addAttribute(element, key, props[key]);\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 maxLength = Math.max($current.children.length, $new.children.length);\n const newChildren = [];\n const fragment = $new.children.length > $current.children.length + 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 >= $current.children.length ? { 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 if (DEBUG && isRealElement($newChild) && !key) {\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\n // First we handle removed children\n if (key && !newKeys.has(key)) {\n renderWithVirtual(currentEl, $currentChild, undefined, $new, -1);\n\n return acc;\n } else if (!key) {\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 ...(shouldMoveNode && {\n moveDirection: isMovingDown ? 'down' : 'up',\n }),\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 currentKeys = Object.keys($current.props);\n const newKeys = Object.keys($new.props);\n\n currentKeys.forEach((key) => {\n if ($current.props[key] !== undefined && $new.props[key] === undefined) {\n removeAttribute(element, key, $current.props[key]);\n }\n });\n\n newKeys.forEach((key) => {\n if ($new.props[key] === undefined) {\n return;\n }\n\n if ($current.props[key] !== $new.props[key]) {\n if ($current.props[key] === undefined) {\n addAttribute(element, key, $new.props[key]);\n } else {\n updateAttribute(element, key, $current.props[key], $new.props[key]);\n }\n }\n });\n}\n\nfunction addAttribute(element: HTMLElement, key: string, value: any) {\n if (value === undefined) {\n return;\n }\n\n // An optimization attempt\n if (key === 'className') {\n element.className = value;\n // An optimization attempt\n } else if (key === 'value') {\n (element as HTMLInputElement).value = value;\n } else if (key === 'style') {\n element.style.cssText = value;\n } else if (key.startsWith('on')) {\n addEventListener(element, key, value, key.endsWith('Capture'));\n } else if (key.startsWith('data-') || 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.startsWith('on')) {\n removeEventListener(element, key, value, key.endsWith('Capture'));\n } else if (key.startsWith('data-') || 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\nfunction updateAttribute(element: HTMLElement, key: string, oldValue: any, newValue: any) {\n if (key === 'value') {\n // Removing and adding value causes a cursor jump\n (element as HTMLInputElement).value = newValue !== undefined ? newValue : '';\n } else {\n removeAttribute(element, key, oldValue);\n addAttribute(element, key, newValue);\n }\n}\n\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\nexport default { render };\n","import React, { FC, useCallback } from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\nimport { ApiChat, ApiUser } from '../../api/types';\n\nimport { pick } from '../../util/iteratees';\nimport buildClassName from '../../util/buildClassName';\n\nimport Link from '../ui/Link';\n\ntype OwnProps = {\n className?: string;\n sender?: ApiUser | ApiChat;\n children: any;\n};\n\ntype DispatchProps = Pick;\n\nconst UserLink: FC = ({\n className, sender, openUserInfo, children,\n}) => {\n const handleClick = useCallback(() => {\n if (sender) {\n openUserInfo({ id: sender.id });\n }\n }, [sender, openUserInfo]);\n\n if (!sender) {\n return children;\n }\n\n return (\n {children}\n );\n};\n\nexport default withGlobal(\n undefined,\n (setGlobal, actions): DispatchProps => pick(actions, ['openUserInfo']),\n)(UserLink);\n","import React, { FC, useCallback } from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\nimport { ApiMessage } from '../../api/types';\n\nimport { pick } from '../../util/iteratees';\nimport buildClassName from '../../util/buildClassName';\n\nimport Link from '../ui/Link';\n\ntype OwnProps = {\n className?: string;\n message?: ApiMessage;\n children: any;\n};\n\ntype DispatchProps = Pick;\n\nconst MessageLink: FC = ({\n className, message, children, focusMessage,\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 withGlobal(\n undefined,\n (setGlobal, actions): DispatchProps => pick(actions, ['focusMessage']),\n)(MessageLink);\n","import React, { FC, useCallback } from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\n\nimport { pick } from '../../util/iteratees';\nimport buildClassName from '../../util/buildClassName';\n\nimport Link from '../ui/Link';\n\ntype OwnProps = {\n className?: string;\n chatId?: number;\n children: any;\n};\n\ntype DispatchProps = Pick;\n\nconst ChatLink: FC = ({\n className, chatId, openChat, children,\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 withGlobal(\n undefined,\n (setGlobal, actions): DispatchProps => pick(actions, ['openChat']),\n)(ChatLink);\n","import React from '../../../lib/teact/teact';\n\nimport { ApiChat, ApiMessage, ApiUser } from '../../../api/types';\nimport { LangFn } from '../../../hooks/useLang';\nimport {\n getChatTitle,\n getMessageContent,\n getMessageSummaryText,\n getUserFullName,\n isChat,\n} from '../../../modules/helpers';\nimport trimText from '../../../util/trimText';\nimport { TextPart } from './renderMessageText';\nimport renderText from './renderText';\n\nimport UserLink from '../UserLink';\nimport MessageLink from '../MessageLink';\nimport ChatLink from '../ChatLink';\n\ninterface ActionMessageTextOptions {\n maxTextLength?: number;\n asPlain?: boolean;\n isEmbedded?: boolean;\n}\n\nconst NBSP = '\\u00A0';\n\nexport function renderActionMessageText(\n lang: LangFn,\n message: ApiMessage,\n actionOrigin?: ApiUser | ApiChat,\n targetUsers?: ApiUser[],\n targetMessage?: ApiMessage,\n targetChatId?: number,\n options: ActionMessageTextOptions = {},\n) {\n if (!message.content.action) {\n return [];\n }\n const { text, translationValues } = message.content.action;\n const content: TextPart[] = [];\n const textOptions: ActionMessageTextOptions = { ...options, maxTextLength: 32 };\n const translationKey = text === 'Chat.Service.Group.UpdatedPinnedMessage1' && !targetMessage\n ? 'Message.PinnedGenericMessage'\n : text;\n\n let unprocessed: string;\n let processed = processPlaceholder(\n lang(translationKey, translationValues && translationValues.length ? translationValues : undefined),\n '%action_origin%',\n actionOrigin\n ? (!options.isEmbedded && renderOriginContent(lang, actionOrigin, options.asPlain)) || 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, options.asPlain)).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, textOptions)\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, options.asPlain)\n : 'another chat',\n );\n content.push(...processed);\n\n if (options.asPlain) {\n return content.join('').trim();\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: ActionMessageTextOptions = {}) {\n const text = getMessageSummaryText(lang, message);\n const {\n photo, video, document, sticker,\n } = getMessageContent(message);\n\n const { maxTextLength, isEmbedded, asPlain } = options;\n\n const showQuotes = isEmbedded && text && !photo && !video && !document && !sticker;\n let messageText = trimText(text as string, maxTextLength)!;\n\n if (isEmbedded) {\n if (photo) {\n messageText = 'a photo';\n } else if (video) {\n messageText = video.isGif ? 'a GIF' : 'a video';\n } else if (document) {\n messageText = 'a document';\n } else if (sticker) {\n messageText = text;\n }\n }\n\n if (asPlain) {\n return showQuotes ? `«${messageText}»` : messageText;\n }\n\n if (showQuotes) {\n return (\n \n «\n {renderText(messageText)}\n »\n \n );\n }\n\n return (\n {renderText(messageText)}\n );\n}\n\nfunction renderOriginContent(lang: LangFn, origin: ApiUser | ApiChat, asPlain?: boolean) {\n return isChat(origin)\n ? renderChatContent(lang, origin, asPlain)\n : renderUserContent(origin, asPlain);\n}\n\nfunction renderUserContent(sender: ApiUser, asPlain?: boolean): string | TextPart | undefined {\n const text = trimText(getUserFullName(sender));\n\n if (asPlain) {\n return text;\n }\n\n return {sender && renderText(text!)};\n}\n\nfunction renderChatContent(lang: LangFn, chat: ApiChat, asPlain?: boolean): string | TextPart | undefined {\n const text = trimText(getChatTitle(lang, chat));\n\n if (asPlain) {\n return text;\n }\n\n return {chat && renderText(text!)};\n}\n\nfunction renderMigratedContent(chatId: number, asPlain?: boolean): string | TextPart | undefined {\n const text = 'another chat';\n\n if (asPlain) {\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","export 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 isAnimated: boolean;\n width?: number;\n height?: number;\n thumbnail?: ApiThumbnail;\n isPreloadedGlobally?: boolean;\n}\n\nexport interface ApiStickerSet {\n archived?: true;\n isAnimated?: true;\n installedDate?: number;\n id: string;\n accessHash: string;\n title: string;\n hasThumbnail?: boolean;\n count: number;\n hash: number;\n stickers?: ApiSticker[];\n packs?: Record;\n covers?: ApiSticker[];\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 size: number;\n mimeType: string;\n fileName: string;\n duration: number;\n performer?: string;\n title?: string;\n}\n\nexport interface ApiVoice {\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: number;\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?: number[];\n solution?: string;\n solutionEntities?: ApiMessageEntity[];\n };\n}\n\nexport interface ApiInvoice {\n text: string;\n title: string;\n photoUrl?: string;\n description?: string;\n receiptMsgId?: number;\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?: number[];\n targetChatId?: number;\n type: 'historyClear' | 'contactSignUp' | 'chatCreate' | 'other';\n photo?: ApiPhoto;\n translationValues: string[];\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 isChannelPost: boolean;\n isLinkedChannelPost?: boolean;\n fromChatId?: number;\n senderUserId?: number;\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?: number;\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 Unknown = 'MessageEntityUnknown',\n}\n\nexport interface ApiFormattedText {\n text: string;\n entities?: ApiMessageEntity[];\n}\n\nexport interface ApiMessage {\n id: number;\n chatId: number;\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?: number;\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 isMediaUnread?: boolean;\n groupedId?: string;\n isInAlbum?: boolean;\n hasUnreadMention?: boolean;\n inlineButtons?: ApiKeyboardButtons;\n keyboardButtons?: ApiKeyboardButtons;\n viaBotId?: number;\n threadInfo?: ApiThreadInfo;\n adminTitle?: string;\n isScheduled?: boolean;\n shouldHideKeyboardButtons?: boolean;\n isFromScheduled?: boolean;\n}\n\nexport interface ApiThreadInfo {\n threadId: number;\n chatId: number;\n topMessageId?: number;\n originChannelId?: number;\n messagesCount: number;\n lastMessageId?: number;\n lastReadInboxMessageId?: number;\n recentReplierIds?: number[];\n}\n\nexport type ApiMessageOutgoingStatus = 'read' | 'succeeded' | 'pending' | 'failed';\n\nexport interface ApiKeyboardButton {\n type: 'command' | 'url' | 'callback' | 'requestPoll' | 'buy' | 'NOT_SUPPORTED';\n text: string;\n messageId: number;\n value?: string;\n}\n\nexport type ApiKeyboardButtons = ApiKeyboardButton[][];\n\nexport type ApiMessageSearchType = 'text' | 'media' | 'documents' | 'links' | 'audio' | '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 const MAIN_THREAD_ID = -1;\n\n// `Symbol` can not be transferred from worker\nexport const MESSAGE_DELETED = 'MESSAGE_DELETED';\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 DataUri,\n BlobUrl,\n Lottie,\n Progressive,\n Stream,\n}\n\nexport type ApiParsedMedia = string | Blob | AnyLiteral | ArrayBuffer;\nexport type ApiPreparedMedia = string | AnyLiteral;\nexport type ApiMediaFormatToPrepared = T extends ApiMediaFormat.Lottie ? AnyLiteral : string;\n","import React, { FC } from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { ApiChat, ApiUser } from '../../../api/types';\n\nimport { pick } from '../../../util/iteratees';\nimport { selectUser } from '../../../modules/selectors';\n\ntype OwnProps = {\n userId?: number;\n username?: string;\n children: any;\n};\n\ntype StateProps = {\n userOrChat?: ApiUser | ApiChat;\n};\n\ntype DispatchProps = Pick;\n\nconst MentionLink: FC = ({\n username,\n userOrChat,\n children,\n openChat,\n openChatByUsername,\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 (setGlobal, actions): DispatchProps => pick(actions, ['openChat', 'openChatByUsername']),\n)(MentionLink);\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","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","module.exports = function() {\n return new Worker(__webpack_public_path__ + \"d8ff794b74bf32a92230.worker.js\");\n};","module.exports = function() {\n return new Worker(__webpack_public_path__ + \"5054ce745024de60a724.worker.js\");\n};","module.exports = function() {\n return new Worker(__webpack_public_path__ + \"695e66b225ec96107343.worker.js\");\n};","module.exports = function() {\n return new Worker(__webpack_public_path__ + \"4c9029ba18603b924ede.worker.js\");\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';\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 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 switchTheme(theme, animationLevel === ANIMATION_LEVEL_MAX);\n\n if (IS_SAFARI) {\n document.body.classList.add('is-safari');\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});\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 }, 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 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 { 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';\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 });\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 } 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, IInputPrivacyRules, IInputPrivacyContact,\n UPLOADING_WALLPAPER_SLUG,\n} from '../../../types';\n\nimport { callApi } from '../../../api/gramjs';\nimport { buildCollectionByKey } from '../../../util/iteratees';\nimport { selectUser } from '../../selectors';\nimport {\n addUsers, addBlockedContact, updateChats, updateUser, removeBlockedContact, replaceSettings, updateNotifySettings,\n addNotifyExceptions,\n} from '../../reducers';\nimport { isChatPrivate } 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', 0);\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 && result.users.length) {\n newGlobal = addUsers(newGlobal, buildCollectionByKey(result.users, 'id'));\n }\n if (result.chats && 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 = isChatPrivate(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('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: number[];\n deniedIds: number[];\n}): IInputPrivacyRules {\n const {\n users: { byId: usersById },\n chats: { byId: chatsById },\n } = global;\n\n const rules: IInputPrivacyRules = {\n visibility,\n };\n let users: IInputPrivacyContact[];\n let chats: IInputPrivacyContact[];\n\n const collectUsers = (userId: number) => {\n if (!isChatPrivate(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: number) => {\n if (isChatPrivate(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 IInputPrivacyContact[];\n chats = allowedIds.map(collectChats).filter(Boolean) as IInputPrivacyContact[];\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 IInputPrivacyContact[];\n chats = deniedIds.map(collectChats).filter(Boolean) as IInputPrivacyContact[];\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","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';\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 if (actions.showDialog) {\n actions.showDialog({ data: { ...update.error, hasErrorKey: true } });\n }\n\n break;\n }\n});\n\nfunction onUpdateApiReady(global: GlobalState) {\n subscribe();\n 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 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 setGlobal({\n ...global,\n isLoggingOut: false,\n lastSyncTime: Date.now(),\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 setGlobal({\n ...global,\n connectionState,\n });\n\n if (connectionState === 'connectionStateReady' && global.authState === 'authorizationStateReady') {\n getDispatch().sync();\n } else 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: number) {\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","export var ServiceWorkerNoSupportError = (function() {\n\n\tfunction ServiceWorkerNoSupportError() {\n\t\tvar err = Error.call(this, 'ServiceWorker is not supported.');\n\t\tObject.setPrototypeOf(err, ServiceWorkerNoSupportError.prototype);\n\t\treturn err;\n\t}\n\n\tServiceWorkerNoSupportError.prototype = Object.create(Error.prototype);\n\n\treturn ServiceWorkerNoSupportError;\n})();\n\nexport var scriptUrl = __webpack_public_path__ + \"serviceWorker.js\";\n\nexport default function registerServiceWorkerIfSupported(mapScriptUrlOrOptions, maybeOptions) {\n\n\tvar targetScriptUrl = scriptUrl;\n\tvar options = maybeOptions;\n\n\tif (typeof mapScriptUrlOrOptions === 'function') {\n\t\ttargetScriptUrl = mapScriptUrlOrOptions(targetScriptUrl);\n\t} else {\n\t\toptions = mapScriptUrlOrOptions;\n\t}\n\n\tif ('serviceWorker' in navigator) {\n\t\treturn navigator.serviceWorker.register(targetScriptUrl, options);\n\t}\n\n\treturn Promise.reject(new ServiceWorkerNoSupportError());\n}\n","import { scriptUrl } from 'service-worker-loader!../serviceWorker';\n\nimport { DEBUG } from '../config';\nimport { getDispatch } from '../lib/teact/teactn';\nimport { IS_ANDROID, IS_IOS, IS_SERVICE_WORKER_SUPPORTED } from './environment';\nimport { notifyClientReady } 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 (!action.type) return;\n const dispatch = getDispatch();\n switch (action.type) {\n case 'focusMessage':\n dispatch.focusMessage(action.payload);\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 await navigator.serviceWorker.register(scriptUrl);\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 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\n blocked: {\n ids: [],\n totalCount: 0,\n },\n\n users: {\n byId: {},\n },\n\n chats: {\n listIds: {},\n isFullyLoaded: {},\n orderedPinnedIds: {},\n totalCount: {},\n byId: {},\n },\n\n messages: {\n byChatId: {},\n messageLists: [],\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\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 shouldAutoDownloadMediaFromContacts: true,\n shouldAutoDownloadMediaInPrivateChats: true,\n shouldAutoDownloadMediaInGroups: true,\n shouldAutoDownloadMediaInChannels: true,\n shouldAutoPlayGifs: true,\n shouldAutoPlayVideos: true,\n shouldSuggestStickers: true,\n shouldLoopStickers: true,\n language: 'en',\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\n shouldShowContextMenuHint: true,\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_CHAT_LIST_LIMIT,\n MIN_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN,\n GLOBAL_STATE_CACHE_USER_LIST_LIMIT,\n} from '../config';\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../util/environment';\nimport { ANIMATION_END_EVENT, ANIMATION_START_EVENT } from '../hooks/useHeavyAnimationCheck';\nimport { pick } from '../util/iteratees';\nimport { selectCurrentMessageList } from '../modules/selectors';\nimport { hasStoredSession } from '../util/sessions';\nimport { INITIAL_STATE } from './initial';\n\nconst UPDATE_THROTTLE = 5000;\n\nconst updateCacheThrottled = throttle(() => onIdle(updateCache), UPDATE_THROTTLE, false);\n\nlet isCaching = false;\nlet isHeavyAnimating = false;\nlet unsubscribeFromBeforeUnload: NoneToVoidFunction | undefined;\n\nsetupHeavyAnimationListeners();\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) {\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) {\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 // Pre-fill defaults in nested objects which may be missing in older cache\n cached.settings.byKey = {\n ...initialState.settings.byKey,\n ...cached.settings.byKey,\n };\n cached.settings.themes = {\n ...initialState.settings.themes,\n ...cached.settings.themes,\n };\n cached.chatFolders = {\n ...initialState.chatFolders,\n ...cached.chatFolders,\n };\n\n if (!cached.messages.messageLists) {\n cached.messages.messageLists = initialState.messages.messageLists;\n }\n\n if (!cached.stickers.greeting) {\n cached.stickers.greeting = initialState.stickers.greeting;\n }\n }\n\n return {\n ...initialState,\n ...cached,\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 ]),\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 };\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, selectedId } } = global;\n const idsToSave = [\n ...(global.chats.listIds.active || []).slice(0, GLOBAL_STATE_CACHE_CHAT_LIST_LIMIT).filter((cid) => cid > 0),\n ...Object.keys(byId),\n ].slice(0, GLOBAL_STATE_CACHE_USER_LIST_LIMIT);\n\n return {\n byId: pick(byId, idsToSave as number[]),\n selectedId: window.innerWidth > MIN_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN ? selectedId : undefined,\n };\n}\n\nfunction reduceChats(global: GlobalState): GlobalState['chats'] {\n const chatIdsToSave = [\n ...(global.chats.listIds.active || []).slice(0, GLOBAL_STATE_CACHE_CHAT_LIST_LIMIT),\n ];\n const { chatId: currentChatId } = selectCurrentMessageList(global) || {};\n\n return {\n ...global.chats,\n byId: pick(global.chats.byId, currentChatId ? [...chatIdsToSave, currentChatId] : chatIdsToSave),\n listIds: {\n active: chatIdsToSave,\n },\n isFullyLoaded: {},\n orderedPinnedIds: {\n active: global.chats.orderedPinnedIds.active,\n },\n };\n}\n\nfunction reduceMessages(global: GlobalState): GlobalState['messages'] {\n const byChatId: GlobalState['messages']['byChatId'] = {};\n const { chatId: currentChatId } = selectCurrentMessageList(global) || {};\n\n const chatIdsToSave = [\n ...(global.chats.listIds.active || []).slice(0, GLOBAL_STATE_CACHE_CHAT_LIST_LIMIT),\n ...(currentChatId ? [currentChatId] : []),\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 const currentMessageList = selectCurrentMessageList(global);\n\n return {\n byChatId,\n messageLists: !currentMessageList || IS_SINGLE_COLUMN_LAYOUT ? [] : [{\n ...currentMessageList,\n threadId: MAIN_THREAD_ID,\n type: 'thread',\n }],\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 setupHeavyAnimationListeners() {\n document.addEventListener(ANIMATION_START_EVENT, () => {\n isHeavyAnimating = true;\n });\n document.addEventListener(ANIMATION_END_EVENT, () => {\n isHeavyAnimating = false;\n });\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","export default __webpack_public_path__ + \"telegram-logo.df3a91becaa9678c529b4c4cadd45204.svg\";","export default __webpack_public_path__ + \"monkey.a3d5fcdc50b18dc55695f7dd4101a8c9.svg\";","import React, { FC, useEffect } from '../../lib/teact/teact';\nimport { getGlobal, withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiMediaFormat } from '../../api/types';\nimport { GlobalActions, 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 { pick } from '../../util/iteratees';\nimport buildClassName from '../../util/buildClassName';\n\nimport './UiLoader.scss';\n\n// @ts-ignore\nimport telegramLogoPath from '../../assets/telegram-logo.svg';\n// @ts-ignore\nimport monkeyPath from '../../assets/monkey.svg';\nimport { selectIsRightColumnShown, selectTheme } from '../../modules/selectors';\n\ntype OwnProps = {\n page: 'main' | 'authCode' | 'authPassword' | 'authPhoneNumber' | 'authQrCode';\n children: any;\n};\n\ntype StateProps = Pick & {\n hasCustomBackground?: boolean;\n hasCustomBackgroundColor: boolean;\n isRightColumnShown?: boolean;\n};\n\ntype DispatchProps = Pick;\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.DataUri);\n }));\n}\n\nconst preloadTasks = {\n main: () => Promise.all([\n loadModule(Bundles.Main, 'Main')\n .then(preloadFonts),\n preloadAvatars(),\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 setIsUiReady,\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 };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['setIsUiReady']),\n)(UiLoader);\n","import * as langProvider from '../util/langProvider';\nimport { useState } from '../lib/teact/teact';\n\nexport default (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","export 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;\n}\n","import React, {\n FC, useState, memo, useCallback, useRef,\n} from '../../lib/teact/teact';\n\nimport { ANIMATION_END_DELAY } from '../../config';\nimport { countryList } from '../../util/phoneNumber';\nimport searchWords from '../../util/searchWords';\nimport buildClassName from '../../util/buildClassName';\nimport renderText from '../common/helpers/renderText';\nimport useLang from '../../hooks/useLang';\n\nimport DropdownMenu from '../ui/DropdownMenu';\nimport MenuItem from '../ui/MenuItem';\nimport Spinner from '../ui/Spinner';\n\nimport './CountryCodeInput.scss';\n\ntype OwnProps = {\n id: string;\n value?: Country;\n isLoading?: boolean;\n onChange: (value: Country) => 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}) => {\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(countryList);\n\n function updateFilter(filterValue?: string) {\n setFilter(filterValue);\n setFilteredList(getFilteredList(filterValue));\n }\n\n const handleChange = useCallback((e: React.SyntheticEvent) => {\n const { countryId } = (e.currentTarget.firstElementChild as HTMLDivElement).dataset;\n const country = countryList.find((c) => c.id === countryId);\n\n if (country) {\n onChange(country);\n }\n\n setTimeout(() => updateFilter(undefined), MENU_HIDING_DURATION);\n }, [onChange]);\n\n const handleInput = useCallback((e: React.FormEvent) => {\n updateFilter(e.currentTarget.value);\n }, []);\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, 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 inputValue = filter !== undefined\n ? filter\n : (value && value.name) || '';\n\n return (\n
\n \n \n {isLoading ? (\n \n ) : (\n \n )}\n
\n );\n };\n\n return (\n \n {filteredList.map((country: Country) => (\n \n \n {renderText(country.flag, ['hq_emoji'])}\n {country.name}\n {country.code}\n \n ))}\n {!filteredList.length && (\n \n {lang('lng_country_none')}\n \n )}\n \n );\n};\n\nfunction getFilteredList(filter = ''): Country[] {\n return filter.length\n ? countryList.filter((country) => searchWords(country.name, filter))\n : countryList;\n}\n\nexport default memo(CountryCodeInput);\n","import { ChangeEvent } from 'react';\n\n// @ts-ignore\nimport monkeyPath from '../../assets/monkey.svg';\n\nimport React, {\n FC, memo, useCallback, useEffect, useLayoutEffect, useRef, useState,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions, GlobalState } from '../../global/types';\nimport { LangCode } from '../../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, getCountryById, 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};\ntype DispatchProps = Pick;\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 language,\n setAuthPhoneNumber,\n setAuthRememberMe,\n loadNearestCountry,\n clearAuthError,\n goToAuthQrCode,\n setSettingOption,\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.code} ${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 (authNearestCountry && !country && !isTouched) {\n setCountry(getCountryById(authNearestCountry));\n }\n }, [country, authNearestCountry, isTouched]);\n\n const parseFullNumber = useCallback((newFullNumber: string) => {\n if (!newFullNumber.length) {\n setPhoneNumber('');\n }\n\n const suggestedCountry = getCountryFromPhoneNumber(newFullNumber);\n\n // Any phone numbers should be allowed, in some cases ignoring formatting\n const selectedCountry = !country\n || (suggestedCountry && suggestedCountry.id !== country.id)\n || (!suggestedCountry && newFullNumber.length)\n ? suggestedCountry\n : country;\n\n if (!country || !selectedCountry || (selectedCountry && selectedCountry.code !== country.code)) {\n setCountry(selectedCountry);\n }\n\n setPhoneNumber(formatPhoneNumber(newFullNumber, selectedCountry));\n }, [country]);\n\n const handleLangChange = useCallback(() => {\n markIsLoading();\n\n 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 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 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!.code} ${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 } = 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 };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'setAuthPhoneNumber',\n 'setAuthRememberMe',\n 'clearAuthError',\n 'loadNearestCountry',\n 'goToAuthQrCode',\n 'setSettingOption',\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 language?: LangCode;\n};\ntype DispatchProps = Pick;\n\nconst DATA_PREFIX = 'tg://login?token=';\n\nconst AuthCode: FC = ({\n connectionState,\n authState,\n authQrCode,\n language,\n returnToAuthPhoneNumber,\n setSettingOption,\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 const handleLangChange = useCallback(() => {\n markIsLoading();\n\n 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 (setGlobal, actions): DispatchProps => pick(actions, [\n 'returnToAuthPhoneNumber', 'setSettingOption',\n ]),\n)(AuthCode));\n","import React, { FC, useEffect, memo } from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions, GlobalState } from '../../global/types';\n\nimport '../../modules/actions/initial';\nimport { pick } from '../../util/iteratees';\nimport { PLATFORM_ENV } from '../../util/environment';\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;\ntype DispatchProps = Pick;\n\nconst Auth: FC = ({\n authState, reset, initApi, returnToAuthPhoneNumber, goToAuthQrCode,\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 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 (global, actions): DispatchProps => pick(actions, ['reset', 'initApi', 'returnToAuthPhoneNumber', 'goToAuthQrCode']),\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","export default __webpack_public_path__ + \"app-inactive.bc7953c2dfebcabce2c43ca7dc778a89.png\";","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, { withGlobal } from './lib/teact/teactn';\n\nimport { GlobalActions, 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;\ntype DispatchProps = Pick;\n\nconst App: FC = ({ authState, disconnect }) => {\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 (setGlobal, actions): DispatchProps => pick(actions, ['disconnect']),\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.log('GLOBAL STATE', getGlobal());\n});\n"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/notification.mp3 b/dist/notification.mp3 new file mode 100644 index 00000000..0a9f875f Binary files /dev/null and b/dist/notification.mp3 differ diff --git a/dist/report.html b/dist/report.html index fa16a727..1ff61c4f 100644 --- a/dist/report.html +++ b/dist/report.html @@ -3,7 +3,7 @@ - telegram-t [7 Aug 2021 at 17:05] + telegram-t [11 Aug 2021 at 01:41] diff --git a/dist/serviceWorker.js b/dist/serviceWorker.js index 1848ae25..fb66cc71 100644 --- a/dist/serviceWorker.js +++ b/dist/serviceWorker.js @@ -1,2 +1,2 @@ -!function(e){var t={};function n(s){if(t[s])return t[s].exports;var a=t[s]={i:s,l:!1,exports:{}};return e[s].call(a.exports,a,a.exports,n),a.l=!0,a.exports}n.m=e,n.c=t,n.d=function(e,t,s){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:s})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var s=Object.create(null);if(n.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(s,a,function(t){return e[t]}.bind(null,a));return s},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){"use strict";n.r(t);"undefined"!=typeof window&&window.innerHeight,Math.round(425),new Set(["newMessage","newScheduledMessage","deleteMessages","deleteScheduledMessages","deleteHistory"]),new Set(["image/png","image/gif","image/jpeg","video/mp4","video/avi","video/quicktime"]);const s=new Map;async function a(e){const{url:t}=e.request,n=e.request.headers.get("range"),a=/^bytes=(\d+)-(\d+)?$/g.exec(n||""),r=Number(a[1]),i=Number(a[2]);let o=i;if((!o||o-r+1>524288)&&(o=r+524288-1),0===r&&1===o){const t=e.request.url.match(/fileSize=(\d+)&mimeType=([\w/]+)/),n=t&&Number(t[1]),s=t&&t[2];if(n&&s)return new Response(new Uint8Array(2).buffer,{status:206,statusText:"Partial Content",headers:[["Content-Range","bytes 0-1/"+n],["Accept-Ranges","bytes"],["Content-Length","2"],["Content-Type",s]]})}const c=`${t}?start=${r}&end=${o}`,[u,l]=await async function(e){const t=await self.caches.open("tt-media-progressive");return Promise.all([t.match(e+"&type=arrayBuffer").then(e=>e?e.arrayBuffer():void 0),t.match(e+"&type=headers").then(e=>e?e.json():void 0)])}(c);if(u)return new Response(u,{status:206,statusText:"Partial Content",headers:l});let d;try{d=await async function(e,t){if(!e.clientId)return;const n=await self.clients.get(e.clientId);if(!n)return;const a=(e=>{let t;do{t=String(Math.random()).replace("0.","id")}while(e.hasOwnProperty(t));return t})(s),r={},i=Promise.race([(o=3e4,new Promise(e=>{setTimeout(()=>e(),o)})).then(()=>Promise.reject(new Error("ERROR_PART_TIMEOUT"))),new Promise((e,t)=>{Object.assign(r,{resolve:e,reject:t})})]);var o;return s.set(a,r),i.catch(()=>{}).finally(()=>{s.delete(a)}),n.postMessage({type:"requestPart",messageId:a,params:t}),i}(e,{url:t,start:r,end:o})}catch(e){0}if(!d)return new Response("",{status:500,statusText:"Failed to fetch progressive part"});const{arrayBuffer:f,fullSize:p,mimeType:g}=d,m=Math.min(o-r+1,f.byteLength);o=r+m-1;const y=f.slice(0,m),h=[["Content-Range",`bytes ${r}-${o}/${p}`],["Accept-Ranges","bytes"],["Content-Length",String(m)],["Content-Type",g]];return m<=524288&&o<2097151&&async function(e,t,n){const s=await self.caches.open("tt-media-progressive");Promise.all([s.put(new Request(e+"&type=arrayBuffer"),new Response(t)),s.put(new Request(e+"&type=headers"),new Response(JSON.stringify(n)))])}(c,y,h),new Response(y,{status:206,statusText:"Partial Content",headers:h})}var r;self.addEventListener("message",e=>{const{type:t,messageId:n,result:a}=e.data;if("partResponse"===t){const e=s.get(n);e&&e.resolve(a)}}),function(e){e.True="1",e.False="0"}(r||(r={}));let i=(new Date).valueOf();const o={},c=new Set;function u(e){return e.custom.from_id?parseInt(e.custom.from_id,10):e.custom.chat_id?-1*parseInt(e.custom.chat_id,10):e.custom.channel_id?-1*parseInt(e.custom.channel_id,10):void 0}function l(e){if(e.custom.msg_id)return parseInt(e.custom.msg_id,10)}function d({chatId:e,messageId:t,body:n,title:s}){return self.registration.showNotification(s,{body:n,data:{chatId:e,messageId:t},icon:"icon-192x192.png",badge:"icon-192x192.png",vibrate:[200,100,200]})}async function f(e,t){const{chatId:n,messageId:s}=t;if(n){e.postMessage({type:"focusMessage",payload:{chatId:n,messageId:s}});try{await e.focus()}catch(e){0}}}self.onsync=()=>{i=(new Date).valueOf()};const p=/[0-9a-f]{20}.*\.(js|css|woff2?|svg|png|jpg|jpeg|json|wasm)$/;self.addEventListener("install",e=>{e.waitUntil(self.skipWaiting())}),self.addEventListener("activate",e=>{e.waitUntil(self.caches.delete("tt-assets")),e.waitUntil(self.clients.claim())}),self.addEventListener("fetch",e=>{e.respondWith((()=>{const{url:t}=e.request;return t.includes("/progressive/")?a(e):t.startsWith("http")&&t.match(p)?async function(e){const t=await self.caches.open("tt-assets"),n=await t.match(e.request);if(n)return n;const s=await fetch(e.request);return t.put(e.request,s.clone()),s}(e):fetch(e.request)})())}),self.addEventListener("push",(function(e){if((new Date).valueOf()-i<3e3)return;const t=function(e){try{return e.data.json()}catch(e){return void 0}}(e);if(!t||t.mute===r.True)return;const n=function(e){return{chatId:u(e),messageId:l(e),title:e.title||"Telegram WebZ",body:e.description}}(t);c.has(n.messageId)?c.delete(n.messageId):e.waitUntil(d(n))})),self.addEventListener("notificationclick",(function(e){const t=self.location.href.replace("serviceWorker.js","");e.notification.close();const{data:n}=e.notification;e.waitUntil((async()=>{const s=(await self.clients.matchAll({type:"window"})).filter(e=>e.url===self.registration.scope);if(e.waitUntil(Promise.all(s.map(e=>(o[e.id]=n,f(e,n))))),!self.clients.openWindow||s.length>0)return;const a=await self.clients.openWindow(t);a&&(o[a.id]=n)})())})),self.addEventListener("message",(function(e){if(!e.data)return;const t=e.source;if("clientReady"===e.data.type&&o[t.id]&&(e.waitUntil(f(t,o[t.id])),delete o[t.id]),"newMessageNotification"===e.data.type){const t=e.data.payload;e.waitUntil(d(t)),c.add(t.messageId)}}))}]); +!function(e){var t={};function n(s){if(t[s])return t[s].exports;var a=t[s]={i:s,l:!1,exports:{}};return e[s].call(a.exports,a,a.exports,n),a.l=!0,a.exports}n.m=e,n.c=t,n.d=function(e,t,s){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:s})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var s=Object.create(null);if(n.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(s,a,function(t){return e[t]}.bind(null,a));return s},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){"use strict";n.r(t);"undefined"!=typeof window&&window.innerHeight,Math.round(425),new Set(["newMessage","newScheduledMessage","deleteMessages","deleteScheduledMessages","deleteHistory"]),new Set(["image/png","image/gif","image/jpeg","video/mp4","video/avi","video/quicktime"]);const s=new Map;async function a(e){const{url:t}=e.request,n=e.request.headers.get("range"),a=/^bytes=(\d+)-(\d+)?$/g.exec(n||""),i=Number(a[1]),r=Number(a[2]);let o=r;if((!o||o-i+1>524288)&&(o=i+524288-1),0===i&&1===o){const t=e.request.url.match(/fileSize=(\d+)&mimeType=([\w/]+)/),n=t&&Number(t[1]),s=t&&t[2];if(n&&s)return new Response(new Uint8Array(2).buffer,{status:206,statusText:"Partial Content",headers:[["Content-Range","bytes 0-1/"+n],["Accept-Ranges","bytes"],["Content-Length","2"],["Content-Type",s]]})}const c=`${t}?start=${i}&end=${o}`,[u,l]=await async function(e){const t=await self.caches.open("tt-media-progressive");return Promise.all([t.match(e+"&type=arrayBuffer").then(e=>e?e.arrayBuffer():void 0),t.match(e+"&type=headers").then(e=>e?e.json():void 0)])}(c);if(u)return new Response(u,{status:206,statusText:"Partial Content",headers:l});let d;try{d=await async function(e,t){if(!e.clientId)return;const n=await self.clients.get(e.clientId);if(!n)return;const a=(e=>{let t;do{t=String(Math.random()).replace("0.","id")}while(e.hasOwnProperty(t));return t})(s),i={},r=Promise.race([(o=3e4,new Promise(e=>{setTimeout(()=>e(),o)})).then(()=>Promise.reject(new Error("ERROR_PART_TIMEOUT"))),new Promise((e,t)=>{Object.assign(i,{resolve:e,reject:t})})]);var o;return s.set(a,i),r.catch(()=>{}).finally(()=>{s.delete(a)}),n.postMessage({type:"requestPart",messageId:a,params:t}),r}(e,{url:t,start:i,end:o})}catch(e){0}if(!d)return new Response("",{status:500,statusText:"Failed to fetch progressive part"});const{arrayBuffer:f,fullSize:p,mimeType:g}=d,m=Math.min(o-i+1,f.byteLength);o=i+m-1;const y=f.slice(0,m),w=[["Content-Range",`bytes ${i}-${o}/${p}`],["Accept-Ranges","bytes"],["Content-Length",String(m)],["Content-Type",g]];return m<=524288&&o<2097151&&async function(e,t,n){const s=await self.caches.open("tt-media-progressive");Promise.all([s.put(new Request(e+"&type=arrayBuffer"),new Response(t)),s.put(new Request(e+"&type=headers"),new Response(JSON.stringify(n)))])}(c,y,w),new Response(y,{status:206,statusText:"Partial Content",headers:w})}var i;self.addEventListener("message",e=>{const{type:t,messageId:n,result:a}=e.data;if("partResponse"===t){const e=s.get(n);e&&e.resolve(a)}}),function(e){e.True="1",e.False="0"}(i||(i={}));let r=(new Date).valueOf();const o={},c=new Set;function u(e){return e.custom.from_id?parseInt(e.custom.from_id,10):e.custom.chat_id?-1*parseInt(e.custom.chat_id,10):e.custom.channel_id?-1*parseInt(e.custom.channel_id,10):void 0}function l(e){if(e.custom.msg_id)return parseInt(e.custom.msg_id,10)}async function d({chatId:e,messageId:t,body:n,title:s,icon:a}){await self.registration.showNotification(s,{body:n,data:{chatId:e,messageId:t},icon:a||"icon-192x192.png",badge:a||"icon-192x192.png",vibrate:[200,100,200]}),await async function(e){const t=(await self.clients.matchAll({type:"window"})).filter(e=>e.url===self.registration.scope),n=t[0];n&&0!==t.length&&n.postMessage({type:"playNotificationSound",payload:{id:e}})}(t||e||0)}async function f(e,t){const{chatId:n,messageId:s}=t;if(n){e.postMessage({type:"focusMessage",payload:{chatId:n,messageId:s}});try{await e.focus()}catch(e){0}}}self.onsync=()=>{r=(new Date).valueOf()};const p=/[0-9a-f]{20}.*\.(js|css|woff2?|svg|png|jpg|jpeg|json|wasm)$/;self.addEventListener("install",e=>{e.waitUntil(self.skipWaiting())}),self.addEventListener("activate",e=>{e.waitUntil(self.caches.delete("tt-assets")),e.waitUntil(self.clients.claim())}),self.addEventListener("fetch",e=>{e.respondWith((()=>{const{url:t}=e.request;return t.includes("/progressive/")?a(e):t.startsWith("http")&&t.match(p)?async function(e){const t=await self.caches.open("tt-assets"),n=await t.match(e.request);if(n)return n;const s=await fetch(e.request);return t.put(e.request,s.clone()),s}(e):fetch(e.request)})())}),self.addEventListener("push",(function(e){if((new Date).valueOf()-r<3e3)return;const t=function(e){try{return e.data.json()}catch(e){return void 0}}(e);if(!t||t.mute===i.True)return;const n=function(e){return{chatId:u(e),messageId:l(e),title:e.title||"Telegram WebZ",body:e.description}}(t);c.has(n.messageId)?c.delete(n.messageId):e.waitUntil(d(n))})),self.addEventListener("notificationclick",(function(e){const t=self.location.href.replace("serviceWorker.js","");e.notification.close();const{data:n}=e.notification;e.waitUntil((async()=>{const s=(await self.clients.matchAll({type:"window"})).filter(e=>e.url===self.registration.scope);if(e.waitUntil(Promise.all(s.map(e=>(o[e.id]=n,f(e,n))))),!self.clients.openWindow||s.length>0)return;const a=await self.clients.openWindow(t);a&&(o[a.id]=n)})())})),self.addEventListener("message",(function(e){if(!e.data)return;const t=e.source;if("clientReady"===e.data.type&&o[t.id]&&(e.waitUntil(f(t,o[t.id])),delete o[t.id]),"newMessageNotification"===e.data.type){const t=e.data.payload;e.waitUntil(d(t)),c.add(t.messageId)}}))}]); //# sourceMappingURL=serviceWorker.js.map \ No newline at end of file diff --git a/dist/serviceWorker.js.map b/dist/serviceWorker.js.map index d2d92015..ebfd09e8 100644 --- a/dist/serviceWorker.js.map +++ b/dist/serviceWorker.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/config.ts","webpack:///./src/serviceWorker/progressive.ts","webpack:///./src/util/generateIdFor.ts","webpack:///./src/util/schedulers.ts","webpack:///./src/serviceWorker/pushNotification.ts","webpack:///./src/serviceWorker.ts","webpack:///./src/serviceWorker/assetCache.ts"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","window","innerHeight","Math","round","Set","requestStates","Map","async","respondForProgressive","e","url","request","range","headers","bytes","exec","start","Number","originalEnd","end","match","fileSize","mimeType","Response","Uint8Array","buffer","status","statusText","cacheKey","cachedArrayBuffer","cachedHeaders","cache","self","caches","open","Promise","all","then","arrayBuffer","undefined","json","fetchFromCache","partInfo","params","clientId","client","clients","messageId","store","id","String","random","replace","generateIdFor","requestState","promise","race","ms","resolve","setTimeout","reject","Error","assign","set","catch","finally","delete","postMessage","type","requestPart","err","process","fullSize","partSize","min","byteLength","arrayBufferPart","slice","put","Request","JSON","stringify","saveToCache","Boolean","addEventListener","result","data","lastSyncAt","Date","valueOf","clickBuffer","shownNotifications","getChatId","custom","from_id","parseInt","chat_id","channel_id","getMessageId","msg_id","showNotification","chatId","body","title","registration","icon","badge","vibrate","focusChatMessage","payload","focus","error","onsync","ASSET_CACHE_PATTERN","waitUntil","skipWaiting","claim","respondWith","includes","startsWith","cached","remote","fetch","clone","respondWithCache","getPushData","mute","True","notification","description","getNotificationData","has","appUrl","location","href","close","clientsInScope","matchAll","filter","scope","map","openWindow","length","newClient","notifyClients","source","add"],"mappings":"aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QAKfF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAAoBkB,EAAI,SAAShB,GACX,oBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAeb,EAAS,aAAc,CAAEmB,OAAO,KAQvDrB,EAAoBsB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAUF,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,UAAU/E,QAAQC,IAAIoG,EAAeI,IAAK/F,IAC1C6C,EAAY7C,EAAOI,IAAMqC,EAClBsB,EAAiB/D,EAAQyC,QAE7BtD,KAAKc,QAAQ+F,YAAcL,EAAeM,OAAS,EAAG,OAG3D,MAAMC,QAAkB/G,KAAKc,QAAQ+F,WAAWT,GAC5CW,IAEFrD,EAAYqD,EAAU9F,IAAMqC,IAIpB0D,OCzHdhH,KAAKoD,iBAAiB,WD4Hf,SAA6B3E,GAKlC,IAAKA,EAAE6E,KAAM,OACb,MAAM2D,EAASxI,EAAEwI,OAQjB,GAPoB,gBAAhBxI,EAAE6E,KAAKlB,MAELsB,EAAYuD,EAAOhG,MACrBxC,EAAEyG,UAAUN,EAAiBqC,EAAQvD,EAAYuD,EAAOhG,aACjDyC,EAAYuD,EAAOhG,KAGV,2BAAhBxC,EAAE6E,KAAKlB,KAAmC,CAE5C,MAAM4D,EAAiCvH,EAAE6E,KAAKuB,QAC9CpG,EAAEyG,UAAUd,EAAiB4B,IAC7BrC,EAAmBuD,IAAIlB,EAAajF","file":"serviceWorker.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n","export const PAGE_TITLE = 'Telegram';\nexport const INACTIVE_MARKER = ' [Inactive]';\n\nexport const APP_NAME = process.env.APP_NAME || 'Telegram WebZ';\nexport const APP_VERSION = process.env.APP_VERSION || 'dev';\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 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_CHAT_LIST_LIMIT = 30;\nexport const GLOBAL_STATE_CACHE_USER_LIST_LIMIT = 5000;\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-v5';\nexport const ASSET_CACHE_NAME = 'tt-assets';\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_SENSITIVE_AREA = 750;\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;\n\nexport const TOP_CHAT_MESSAGES_PRELOAD_LIMIT = 20;\nexport const ALL_CHATS_PRELOAD_DISABLED = false;\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\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;\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 = 80;\nexport const STICKER_SIZE_INLINE_BOT_RESULT = 100;\nexport const RECENT_STICKERS_LIMIT = 20;\nexport const MEMOJI_STICKER_ID = 'MEMOJI_STICKER';\n\nexport const BASE_EMOJI_KEYWORD_LANG = 'en';\n\nexport const MENU_TRANSITION_DURATION = 200;\nexport const SLIDE_TRANSITION_DURATION = 450;\n\nexport const CONTENT_TYPES_FOR_QUICK_UPLOAD = new Set([\n 'image/png', 'image/gif', 'image/jpeg', 'video/mp4', 'video/avi', 'video/quicktime',\n]);\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_TME_LINK = /^(?:https?:\\/\\/)?(?:t\\.me\\/)([\\d\\w_]+)(?:\\/([\\d]+))?(?:\\/([\\d]+))?$/gm;\nexport const RE_TME_INVITE_LINK = /^(?:https?:\\/\\/)?(?:t\\.me\\/joinchat\\/)([\\d\\w_-]+)?$/gm;\n\n// MTProto constants\nexport const SERVICE_NOTIFICATIONS_USER_ID = 777000;\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","import { pause } from '../util/schedulers';\nimport generateIdFor from '../util/generateIdFor';\nimport {\n DEBUG,\n MEDIA_CACHE_MAX_BYTES,\n MEDIA_PROGRESSIVE_CACHE_DISABLED,\n MEDIA_PROGRESSIVE_CACHE_NAME,\n} from '../config';\n\ndeclare const self: ServiceWorkerGlobalScope;\n\ntype PartInfo = {\n type: 'PartInfo';\n arrayBuffer: ArrayBuffer;\n mimeType: 'string';\n fullSize: number;\n};\n\ntype RequestStates = {\n resolve: (response: PartInfo) => void;\n reject: () => void;\n};\n\nconst MB = 1024 * 1024;\nconst DEFAULT_PART_SIZE = 0.5 * MB;\nconst MAX_END_TO_CACHE = 2 * MB - 1; // We only cache the first 2 MB of each file\nconst PART_TIMEOUT = 30000;\n\nconst requestStates = new Map();\n\nexport async function respondForProgressive(e: FetchEvent) {\n const { url } = e.request;\n const range = e.request.headers.get('range');\n const bytes = /^bytes=(\\d+)-(\\d+)?$/g.exec(range || '')!;\n const start = Number(bytes[1]);\n const originalEnd = Number(bytes[2]);\n\n let end = originalEnd;\n if (!end || (end - start + 1) > DEFAULT_PART_SIZE) {\n end = start + DEFAULT_PART_SIZE - 1;\n }\n\n // Optimization for Safari\n if (start === 0 && end === 1) {\n const match = e.request.url.match(/fileSize=(\\d+)&mimeType=([\\w/]+)/);\n const fileSize = match && Number(match[1]);\n const mimeType = match && match[2];\n\n if (fileSize && mimeType) {\n return new Response(new Uint8Array(2).buffer, {\n status: 206,\n statusText: 'Partial Content',\n headers: [\n ['Content-Range', `bytes 0-1/${fileSize}`],\n ['Accept-Ranges', 'bytes'],\n ['Content-Length', '2'],\n ['Content-Type', mimeType],\n ],\n });\n }\n }\n\n const cacheKey = `${url}?start=${start}&end=${end}`;\n const [cachedArrayBuffer, cachedHeaders] = !MEDIA_PROGRESSIVE_CACHE_DISABLED ? await fetchFromCache(cacheKey) : [];\n\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.log(\n `FETCH PROGRESSIVE ${cacheKey} (request: ${start}-${originalEnd}) CACHED: ${Boolean(cachedArrayBuffer)}`,\n );\n }\n\n if (cachedArrayBuffer) {\n return new Response(cachedArrayBuffer, {\n status: 206,\n statusText: 'Partial Content',\n headers: cachedHeaders,\n });\n }\n\n let partInfo;\n try {\n partInfo = await requestPart(e, { url, start, end });\n } catch (err) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.error('FETCH PROGRESSIVE', err);\n }\n }\n\n if (!partInfo) {\n return new Response('', {\n status: 500,\n statusText: 'Failed to fetch progressive part',\n });\n }\n\n const { arrayBuffer, fullSize, mimeType } = partInfo;\n\n const partSize = Math.min(end - start + 1, arrayBuffer.byteLength);\n end = start + partSize - 1;\n const arrayBufferPart = arrayBuffer.slice(0, partSize);\n const headers = [\n ['Content-Range', `bytes ${start}-${end}/${fullSize}`],\n ['Accept-Ranges', 'bytes'],\n ['Content-Length', String(partSize)],\n ['Content-Type', mimeType],\n ];\n\n if (!MEDIA_PROGRESSIVE_CACHE_DISABLED && partSize <= MEDIA_CACHE_MAX_BYTES && end < MAX_END_TO_CACHE) {\n saveToCache(cacheKey, arrayBufferPart, headers);\n }\n\n return new Response(arrayBufferPart, {\n status: 206,\n statusText: 'Partial Content',\n headers,\n });\n}\n\n// We can not cache 206 responses: https://github.com/GoogleChrome/workbox/issues/1644#issuecomment-638741359\nasync function fetchFromCache(cacheKey: string) {\n const cache = await self.caches.open(MEDIA_PROGRESSIVE_CACHE_NAME);\n\n return Promise.all([\n cache.match(`${cacheKey}&type=arrayBuffer`).then((r) => (r ? r.arrayBuffer() : undefined)),\n cache.match(`${cacheKey}&type=headers`).then((r) => (r ? r.json() : undefined)),\n ]);\n}\n\nasync function saveToCache(cacheKey: string, arrayBuffer: ArrayBuffer, headers: HeadersInit) {\n const cache = await self.caches.open(MEDIA_PROGRESSIVE_CACHE_NAME);\n\n return Promise.all([\n cache.put(new Request(`${cacheKey}&type=arrayBuffer`), new Response(arrayBuffer)),\n cache.put(new Request(`${cacheKey}&type=headers`), new Response(JSON.stringify(headers))),\n ]);\n}\n\nasync function requestPart(\n e: FetchEvent,\n params: { url: string; start: number; end: number },\n): Promise {\n if (!e.clientId) {\n return undefined;\n }\n\n // eslint-disable-next-line no-restricted-globals\n const client = await self.clients.get(e.clientId);\n if (!client) {\n return undefined;\n }\n\n const messageId = generateIdFor(requestStates);\n const requestState = {} as RequestStates;\n\n const promise = Promise.race([\n pause(PART_TIMEOUT).then(() => Promise.reject(new Error('ERROR_PART_TIMEOUT'))),\n new Promise((resolve, reject) => {\n Object.assign(requestState, { resolve, reject });\n }),\n ]);\n\n requestStates.set(messageId, requestState);\n promise\n .catch(() => undefined)\n .finally(() => {\n requestStates.delete(messageId);\n });\n\n client.postMessage({\n type: 'requestPart',\n messageId,\n params,\n });\n\n return promise;\n}\n\nself.addEventListener('message', (e) => {\n const { type, messageId, result } = e.data as {\n type: string;\n messageId: string;\n result: PartInfo;\n };\n\n if (type === 'partResponse') {\n const requestState = requestStates.get(messageId);\n if (requestState) {\n requestState.resolve(result);\n }\n }\n});\n","export default (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","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 // @ts-ignore\n fn(...args);\n }\n\n // eslint-disable-next-line no-restricted-globals\n waitingTimeout = self.setTimeout(() => {\n if (shouldRunLast) {\n // @ts-ignore\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 // @ts-ignore\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 // @ts-ignore\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(fastPrimaryRaf, 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 // @ts-ignore\n fn(...args);\n });\n }\n };\n}\n\nexport function onTickEnd(cb: NoneToVoidFunction) {\n Promise.resolve().then(cb);\n}\n\nexport function onIdle(cb: NoneToVoidFunction) {\n // eslint-disable-next-line no-restricted-globals\n if (self.requestIdleCallback) {\n // eslint-disable-next-line no-restricted-globals\n self.requestIdleCallback(cb);\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 fastPrimaryRaf(callback: NoneToVoidFunction) {\n fastRaf(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","import { APP_NAME, DEBUG } from '../config';\n\ndeclare const self: ServiceWorkerGlobalScope;\n\nenum Boolean {\n True = '1',\n False = '0'\n}\n\ntype PushData = {\n custom: {\n msg_id?: string;\n channel_id?: string;\n chat_id?: string;\n from_id?: string;\n };\n mute: Boolean;\n badge: Boolean;\n loc_key: string;\n loc_args: string[];\n random_id: number;\n title: string;\n description: string;\n};\n\ntype NotificationData = {\n messageId?: number;\n chatId?: number;\n title: string;\n body: string;\n};\n\nlet lastSyncAt = new Date().valueOf();\n\nconst clickBuffer: Record = {};\nconst shownNotifications = new Set();\n\nfunction getPushData(e: PushEvent | Notification): PushData | undefined {\n try {\n return e.data.json();\n } catch (error) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('[SW] Unable to parse push notification data', e.data);\n }\n return undefined;\n }\n}\n\nfunction getChatId(data: PushData) {\n if (data.custom.from_id) {\n return parseInt(data.custom.from_id, 10);\n }\n // Chats and channels have negative IDs\n if (data.custom.chat_id) {\n return parseInt(data.custom.chat_id, 10) * -1;\n }\n if (data.custom.channel_id) {\n return parseInt(data.custom.channel_id, 10) * -1;\n }\n return undefined;\n}\n\nfunction getMessageId(data: PushData) {\n if (!data.custom.msg_id) return undefined;\n return parseInt(data.custom.msg_id, 10);\n}\n\nfunction getNotificationData(data: PushData): NotificationData {\n return {\n chatId: getChatId(data),\n messageId: getMessageId(data),\n title: data.title || APP_NAME,\n body: data.description,\n };\n}\n\nfunction showNotification({\n chatId,\n messageId,\n body,\n title,\n}: NotificationData) {\n return self.registration.showNotification(title, {\n body,\n data: {\n chatId,\n messageId,\n },\n icon: 'icon-192x192.png',\n badge: 'icon-192x192.png',\n vibrate: [200, 100, 200],\n });\n}\n\nexport function handlePush(e: PushEvent) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('[SW] Push received event', e);\n if (e.data) {\n // eslint-disable-next-line no-console\n console.log('[SW] Push received with data', e.data.json());\n }\n }\n\n // Do not show notifications right after sync (when browser is opened)\n // To avoid stale notifications\n if (new Date().valueOf() - lastSyncAt < 3000) return;\n\n const data = getPushData(e);\n\n // Do not show muted notifications\n if (!data || data.mute === Boolean.True) return;\n\n const notification = getNotificationData(data);\n\n // Dont show already triggered notification\n if (shownNotifications.has(notification.messageId)) {\n shownNotifications.delete(notification.messageId);\n return;\n }\n\n e.waitUntil(showNotification(notification));\n}\n\nasync function focusChatMessage(client: WindowClient, data: { chatId?: number; messageId?: number }) {\n const {\n chatId,\n messageId,\n } = data;\n if (!chatId) return;\n client.postMessage({\n type: 'focusMessage',\n payload: {\n chatId,\n messageId,\n },\n });\n // Catch \"focus not allowed\" DOM Exceptions\n try {\n await client.focus();\n } catch (error) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.warn('[SW] ', error);\n }\n }\n}\n\nexport function handleNotificationClick(e: NotificationEvent) {\n const appUrl = self.location.href.replace('serviceWorker.js', '');\n e.notification.close(); // Android needs explicit close.\n const { data } = e.notification;\n const notifyClients = async () => {\n const clients = await self.clients.matchAll({ type: 'window' }) as WindowClient[];\n const clientsInScope = clients.filter((client) => client.url === self.registration.scope);\n e.waitUntil(Promise.all(clientsInScope.map((client) => {\n clickBuffer[client.id] = data;\n return focusChatMessage(client, data);\n })));\n if (!self.clients.openWindow || clientsInScope.length > 0) return undefined;\n\n // If there is no opened client we need to open one and wait until it is fully loaded\n const newClient = await self.clients.openWindow(appUrl);\n if (newClient) {\n // Store notification data until client is fully loaded\n clickBuffer[newClient.id] = data;\n }\n return undefined;\n };\n e.waitUntil(notifyClients());\n}\n\nexport function handleClientMessage(e: ExtendableMessageEvent) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('[SW] New message from client', e);\n }\n if (!e.data) return;\n const source = e.source as WindowClient;\n if (e.data.type === 'clientReady') {\n // focus on chat message when client is fully ready\n if (clickBuffer[source.id]) {\n e.waitUntil(focusChatMessage(source, clickBuffer[source.id]));\n delete clickBuffer[source.id];\n }\n }\n if (e.data.type === 'newMessageNotification') {\n // store messageId for already shown notification\n const notification: NotificationData = e.data.payload;\n e.waitUntil(showNotification(notification));\n shownNotifications.add(notification.messageId);\n }\n}\n\nself.onsync = () => {\n lastSyncAt = new Date().valueOf();\n};\n","import { DEBUG } from './config';\nimport { respondForProgressive } from './serviceWorker/progressive';\nimport { respondWithCache, clearAssetCache } from './serviceWorker/assetCache';\nimport { handlePush, handleNotificationClick, handleClientMessage } from './serviceWorker/pushNotification';\n\ndeclare const self: ServiceWorkerGlobalScope;\n\nconst ASSET_CACHE_PATTERN = /[0-9a-f]{20}.*\\.(js|css|woff2?|svg|png|jpg|jpeg|json|wasm)$/;\n\nself.addEventListener('install', (e) => {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('ServiceWorker installed');\n }\n\n // Activate worker immediately\n e.waitUntil(self.skipWaiting());\n});\n\nself.addEventListener('activate', (e) => {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('ServiceWorker activated');\n }\n\n // Become available to all pages\n e.waitUntil(clearAssetCache());\n e.waitUntil(self.clients.claim());\n});\n\n// eslint-disable-next-line no-restricted-globals\nself.addEventListener('fetch', (e: FetchEvent) => {\n e.respondWith((() => {\n const { url } = e.request;\n\n if (url.includes('/progressive/')) {\n return respondForProgressive(e);\n }\n\n if (url.startsWith('http') && url.match(ASSET_CACHE_PATTERN)) {\n return respondWithCache(e);\n }\n\n return fetch(e.request);\n })());\n});\n\nself.addEventListener('push', handlePush);\nself.addEventListener('notificationclick', handleNotificationClick);\nself.addEventListener('message', handleClientMessage);\n","import { ASSET_CACHE_NAME } from '../config';\n\ndeclare const self: ServiceWorkerGlobalScope;\n\nexport async function respondWithCache(e: FetchEvent) {\n const cache = await self.caches.open(ASSET_CACHE_NAME);\n const cached = await cache.match(e.request);\n\n if (cached) {\n return cached;\n }\n\n const remote = await fetch(e.request);\n cache.put(e.request, remote.clone());\n\n return remote;\n}\n\nexport function clearAssetCache() {\n return self.caches.delete(ASSET_CACHE_NAME);\n}\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/config.ts","webpack:///./src/serviceWorker/progressive.ts","webpack:///./src/util/generateIdFor.ts","webpack:///./src/util/schedulers.ts","webpack:///./src/serviceWorker/pushNotification.ts","webpack:///./src/serviceWorker.ts","webpack:///./src/serviceWorker/assetCache.ts"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","window","innerHeight","Math","round","Set","requestStates","Map","async","respondForProgressive","e","url","request","range","headers","bytes","exec","start","Number","originalEnd","end","match","fileSize","mimeType","Response","Uint8Array","buffer","status","statusText","cacheKey","cachedArrayBuffer","cachedHeaders","cache","self","caches","open","Promise","all","then","arrayBuffer","undefined","json","fetchFromCache","partInfo","params","clientId","client","clients","messageId","store","id","String","random","replace","generateIdFor","requestState","promise","race","ms","resolve","setTimeout","reject","Error","assign","set","catch","finally","delete","postMessage","type","requestPart","err","process","fullSize","partSize","min","byteLength","arrayBufferPart","slice","put","Request","JSON","stringify","saveToCache","Boolean","addEventListener","result","data","lastSyncAt","Date","valueOf","clickBuffer","shownNotifications","getChatId","custom","from_id","parseInt","chat_id","channel_id","getMessageId","msg_id","showNotification","chatId","body","title","icon","registration","badge","vibrate","clientsInScope","matchAll","filter","scope","length","payload","playNotificationSound","focusChatMessage","focus","error","onsync","ASSET_CACHE_PATTERN","waitUntil","skipWaiting","claim","respondWith","includes","startsWith","cached","remote","fetch","clone","respondWithCache","getPushData","mute","True","notification","description","getNotificationData","has","appUrl","location","href","close","map","openWindow","newClient","notifyClients","source","add"],"mappings":"aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QAKfF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAAoBkB,EAAI,SAAShB,GACX,oBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAeb,EAAS,aAAc,CAAEmB,OAAO,KAQvDrB,EAAoBsB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAUF,EAAQrB,EAAoBqB,IAC/B,EAAPE,EAAU,OAAOF,EACpB,GAAW,EAAPE,GAA8B,iBAAVF,GAAsBA,GAASA,EAAMG,WAAY,OAAOH,EAChF,IAAII,EAAKX,OAAOY,OAAO,MAGvB,GAFA1B,EAAoBkB,EAAEO,GACtBX,OAAOC,eAAeU,EAAI,UAAW,CAAET,YAAY,EAAMK,MAAOA,IACtD,EAAPE,GAA4B,i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WA,EAAOnC,MAAQsB,KAAKyE,aAAaM,OAKnF,GAJAtG,EAAE+G,UAAUrF,QAAQC,IAAIwE,EAAekC,IAAKjG,IAC1C6C,EAAY7C,EAAOI,IAAMqC,EAClB6B,EAAiBtE,EAAQyC,QAE7BtD,KAAKc,QAAQiG,YAAcnC,EAAeI,OAAS,EAAG,OAG3D,MAAMgC,QAAkBhH,KAAKc,QAAQiG,WAAWL,GAC5CM,IAEFtD,EAAYsD,EAAU/F,IAAMqC,IAIpB2D,OCxIdjH,KAAKoD,iBAAiB,WD2If,SAA6B3E,GAKlC,IAAKA,EAAE6E,KAAM,OACb,MAAM4D,EAASzI,EAAEyI,OAQjB,GAPoB,gBAAhBzI,EAAE6E,KAAKlB,MAELsB,EAAYwD,EAAOjG,MACrBxC,EAAE+G,UAAUL,EAAiB+B,EAAQxD,EAAYwD,EAAOjG,aACjDyC,EAAYwD,EAAOjG,KAGV,2BAAhBxC,EAAE6E,KAAKlB,KAAmC,CAE5C,MAAMkE,EAAiC7H,EAAE6E,KAAK2B,QAC9CxG,EAAE+G,UAAUpB,EAAiBkC,IAC7B3C,EAAmBwD,IAAIb,EAAavF","file":"serviceWorker.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n","export const PAGE_TITLE = 'Telegram';\nexport const INACTIVE_MARKER = ' [Inactive]';\n\nexport const APP_NAME = process.env.APP_NAME || 'Telegram WebZ';\nexport const APP_VERSION = process.env.APP_VERSION || 'dev';\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 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_CHAT_LIST_LIMIT = 30;\nexport const GLOBAL_STATE_CACHE_USER_LIST_LIMIT = 5000;\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-v5';\nexport const ASSET_CACHE_NAME = 'tt-assets';\nexport const TRANSPARENT_PIXEL = 'data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==';\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_SENSITIVE_AREA = 750;\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;\n\nexport const TOP_CHAT_MESSAGES_PRELOAD_LIMIT = 20;\nexport const ALL_CHATS_PRELOAD_DISABLED = false;\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\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;\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 = 80;\nexport const STICKER_SIZE_INLINE_BOT_RESULT = 100;\nexport const RECENT_STICKERS_LIMIT = 20;\nexport const MEMOJI_STICKER_ID = 'MEMOJI_STICKER';\n\nexport const BASE_EMOJI_KEYWORD_LANG = 'en';\n\nexport const MENU_TRANSITION_DURATION = 200;\nexport const SLIDE_TRANSITION_DURATION = 450;\n\nexport const CONTENT_TYPES_FOR_QUICK_UPLOAD = new Set([\n 'image/png', 'image/gif', 'image/jpeg', 'video/mp4', 'video/avi', 'video/quicktime',\n]);\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_TME_LINK = /^(?:https?:\\/\\/)?(?:t\\.me\\/)([\\d\\w_]+)(?:\\/([\\d]+))?(?:\\/([\\d]+))?$/gm;\nexport const RE_TME_INVITE_LINK = /^(?:https?:\\/\\/)?(?:t\\.me\\/joinchat\\/)([\\d\\w_-]+)?$/gm;\n\n// MTProto constants\nexport const SERVICE_NOTIFICATIONS_USER_ID = 777000;\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","import { pause } from '../util/schedulers';\nimport generateIdFor from '../util/generateIdFor';\nimport {\n DEBUG,\n MEDIA_CACHE_MAX_BYTES,\n MEDIA_PROGRESSIVE_CACHE_DISABLED,\n MEDIA_PROGRESSIVE_CACHE_NAME,\n} from '../config';\n\ndeclare const self: ServiceWorkerGlobalScope;\n\ntype PartInfo = {\n type: 'PartInfo';\n arrayBuffer: ArrayBuffer;\n mimeType: 'string';\n fullSize: number;\n};\n\ntype RequestStates = {\n resolve: (response: PartInfo) => void;\n reject: () => void;\n};\n\nconst MB = 1024 * 1024;\nconst DEFAULT_PART_SIZE = 0.5 * MB;\nconst MAX_END_TO_CACHE = 2 * MB - 1; // We only cache the first 2 MB of each file\nconst PART_TIMEOUT = 30000;\n\nconst requestStates = new Map();\n\nexport async function respondForProgressive(e: FetchEvent) {\n const { url } = e.request;\n const range = e.request.headers.get('range');\n const bytes = /^bytes=(\\d+)-(\\d+)?$/g.exec(range || '')!;\n const start = Number(bytes[1]);\n const originalEnd = Number(bytes[2]);\n\n let end = originalEnd;\n if (!end || (end - start + 1) > DEFAULT_PART_SIZE) {\n end = start + DEFAULT_PART_SIZE - 1;\n }\n\n // Optimization for Safari\n if (start === 0 && end === 1) {\n const match = e.request.url.match(/fileSize=(\\d+)&mimeType=([\\w/]+)/);\n const fileSize = match && Number(match[1]);\n const mimeType = match && match[2];\n\n if (fileSize && mimeType) {\n return new Response(new Uint8Array(2).buffer, {\n status: 206,\n statusText: 'Partial Content',\n headers: [\n ['Content-Range', `bytes 0-1/${fileSize}`],\n ['Accept-Ranges', 'bytes'],\n ['Content-Length', '2'],\n ['Content-Type', mimeType],\n ],\n });\n }\n }\n\n const cacheKey = `${url}?start=${start}&end=${end}`;\n const [cachedArrayBuffer, cachedHeaders] = !MEDIA_PROGRESSIVE_CACHE_DISABLED ? await fetchFromCache(cacheKey) : [];\n\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.log(\n `FETCH PROGRESSIVE ${cacheKey} (request: ${start}-${originalEnd}) CACHED: ${Boolean(cachedArrayBuffer)}`,\n );\n }\n\n if (cachedArrayBuffer) {\n return new Response(cachedArrayBuffer, {\n status: 206,\n statusText: 'Partial Content',\n headers: cachedHeaders,\n });\n }\n\n let partInfo;\n try {\n partInfo = await requestPart(e, { url, start, end });\n } catch (err) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.error('FETCH PROGRESSIVE', err);\n }\n }\n\n if (!partInfo) {\n return new Response('', {\n status: 500,\n statusText: 'Failed to fetch progressive part',\n });\n }\n\n const { arrayBuffer, fullSize, mimeType } = partInfo;\n\n const partSize = Math.min(end - start + 1, arrayBuffer.byteLength);\n end = start + partSize - 1;\n const arrayBufferPart = arrayBuffer.slice(0, partSize);\n const headers = [\n ['Content-Range', `bytes ${start}-${end}/${fullSize}`],\n ['Accept-Ranges', 'bytes'],\n ['Content-Length', String(partSize)],\n ['Content-Type', mimeType],\n ];\n\n if (!MEDIA_PROGRESSIVE_CACHE_DISABLED && partSize <= MEDIA_CACHE_MAX_BYTES && end < MAX_END_TO_CACHE) {\n saveToCache(cacheKey, arrayBufferPart, headers);\n }\n\n return new Response(arrayBufferPart, {\n status: 206,\n statusText: 'Partial Content',\n headers,\n });\n}\n\n// We can not cache 206 responses: https://github.com/GoogleChrome/workbox/issues/1644#issuecomment-638741359\nasync function fetchFromCache(cacheKey: string) {\n const cache = await self.caches.open(MEDIA_PROGRESSIVE_CACHE_NAME);\n\n return Promise.all([\n cache.match(`${cacheKey}&type=arrayBuffer`).then((r) => (r ? r.arrayBuffer() : undefined)),\n cache.match(`${cacheKey}&type=headers`).then((r) => (r ? r.json() : undefined)),\n ]);\n}\n\nasync function saveToCache(cacheKey: string, arrayBuffer: ArrayBuffer, headers: HeadersInit) {\n const cache = await self.caches.open(MEDIA_PROGRESSIVE_CACHE_NAME);\n\n return Promise.all([\n cache.put(new Request(`${cacheKey}&type=arrayBuffer`), new Response(arrayBuffer)),\n cache.put(new Request(`${cacheKey}&type=headers`), new Response(JSON.stringify(headers))),\n ]);\n}\n\nasync function requestPart(\n e: FetchEvent,\n params: { url: string; start: number; end: number },\n): Promise {\n if (!e.clientId) {\n return undefined;\n }\n\n // eslint-disable-next-line no-restricted-globals\n const client = await self.clients.get(e.clientId);\n if (!client) {\n return undefined;\n }\n\n const messageId = generateIdFor(requestStates);\n const requestState = {} as RequestStates;\n\n const promise = Promise.race([\n pause(PART_TIMEOUT).then(() => Promise.reject(new Error('ERROR_PART_TIMEOUT'))),\n new Promise((resolve, reject) => {\n Object.assign(requestState, { resolve, reject });\n }),\n ]);\n\n requestStates.set(messageId, requestState);\n promise\n .catch(() => undefined)\n .finally(() => {\n requestStates.delete(messageId);\n });\n\n client.postMessage({\n type: 'requestPart',\n messageId,\n params,\n });\n\n return promise;\n}\n\nself.addEventListener('message', (e) => {\n const { type, messageId, result } = e.data as {\n type: string;\n messageId: string;\n result: PartInfo;\n };\n\n if (type === 'partResponse') {\n const requestState = requestStates.get(messageId);\n if (requestState) {\n requestState.resolve(result);\n }\n }\n});\n","export default (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","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 // @ts-ignore\n fn(...args);\n }\n\n // eslint-disable-next-line no-restricted-globals\n waitingTimeout = self.setTimeout(() => {\n if (shouldRunLast) {\n // @ts-ignore\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 // @ts-ignore\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 // @ts-ignore\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(fastPrimaryRaf, 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 // @ts-ignore\n fn(...args);\n });\n }\n };\n}\n\nexport function onTickEnd(cb: NoneToVoidFunction) {\n Promise.resolve().then(cb);\n}\n\nexport function onIdle(cb: NoneToVoidFunction) {\n // eslint-disable-next-line no-restricted-globals\n if (self.requestIdleCallback) {\n // eslint-disable-next-line no-restricted-globals\n self.requestIdleCallback(cb);\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 fastPrimaryRaf(callback: NoneToVoidFunction) {\n fastRaf(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","import { APP_NAME, DEBUG } from '../config';\n\ndeclare const self: ServiceWorkerGlobalScope;\n\nenum Boolean {\n True = '1',\n False = '0'\n}\n\ntype PushData = {\n custom: {\n msg_id?: string;\n channel_id?: string;\n chat_id?: string;\n from_id?: string;\n };\n mute: Boolean;\n badge: Boolean;\n loc_key: string;\n loc_args: string[];\n random_id: number;\n title: string;\n description: string;\n};\n\ntype NotificationData = {\n messageId?: number;\n chatId?: number;\n title: string;\n body: string;\n icon?: string;\n};\n\nlet lastSyncAt = new Date().valueOf();\n\nconst clickBuffer: Record = {};\nconst shownNotifications = new Set();\n\nfunction getPushData(e: PushEvent | Notification): PushData | undefined {\n try {\n return e.data.json();\n } catch (error) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('[SW] Unable to parse push notification data', e.data);\n }\n return undefined;\n }\n}\n\nfunction getChatId(data: PushData) {\n if (data.custom.from_id) {\n return parseInt(data.custom.from_id, 10);\n }\n // Chats and channels have negative IDs\n if (data.custom.chat_id) {\n return parseInt(data.custom.chat_id, 10) * -1;\n }\n if (data.custom.channel_id) {\n return parseInt(data.custom.channel_id, 10) * -1;\n }\n return undefined;\n}\n\nfunction getMessageId(data: PushData) {\n if (!data.custom.msg_id) return undefined;\n return parseInt(data.custom.msg_id, 10);\n}\n\nfunction getNotificationData(data: PushData): NotificationData {\n return {\n chatId: getChatId(data),\n messageId: getMessageId(data),\n title: data.title || APP_NAME,\n body: data.description,\n };\n}\n\nasync function playNotificationSound(id: number) {\n const clients = await self.clients.matchAll({ type: 'window' }) as WindowClient[];\n const clientsInScope = clients.filter((client) => client.url === self.registration.scope);\n const client = clientsInScope[0];\n if (!client) return;\n if (clientsInScope.length === 0) return;\n client.postMessage({\n type: 'playNotificationSound',\n payload: { id },\n });\n}\n\nasync function showNotification({\n chatId,\n messageId,\n body,\n title,\n icon,\n}: NotificationData) {\n await self.registration.showNotification(title, {\n body,\n data: {\n chatId,\n messageId,\n },\n icon: icon || 'icon-192x192.png',\n badge: icon || 'icon-192x192.png',\n vibrate: [200, 100, 200],\n });\n await playNotificationSound(messageId || chatId || 0);\n}\n\nexport function handlePush(e: PushEvent) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('[SW] Push received event', e);\n if (e.data) {\n // eslint-disable-next-line no-console\n console.log('[SW] Push received with data', e.data.json());\n }\n }\n\n // Do not show notifications right after sync (when browser is opened)\n // To avoid stale notifications\n if (new Date().valueOf() - lastSyncAt < 3000) return;\n\n const data = getPushData(e);\n\n // Do not show muted notifications\n if (!data || data.mute === Boolean.True) return;\n\n const notification = getNotificationData(data);\n\n // Dont show already triggered notification\n if (shownNotifications.has(notification.messageId)) {\n shownNotifications.delete(notification.messageId);\n return;\n }\n\n e.waitUntil(showNotification(notification));\n}\n\nasync function focusChatMessage(client: WindowClient, data: { chatId?: number; messageId?: number }) {\n const {\n chatId,\n messageId,\n } = data;\n if (!chatId) return;\n client.postMessage({\n type: 'focusMessage',\n payload: {\n chatId,\n messageId,\n },\n });\n // Catch \"focus not allowed\" DOM Exceptions\n try {\n await client.focus();\n } catch (error) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.warn('[SW] ', error);\n }\n }\n}\n\nexport function handleNotificationClick(e: NotificationEvent) {\n const appUrl = self.location.href.replace('serviceWorker.js', '');\n e.notification.close(); // Android needs explicit close.\n const { data } = e.notification;\n const notifyClients = async () => {\n const clients = await self.clients.matchAll({ type: 'window' }) as WindowClient[];\n const clientsInScope = clients.filter((client) => client.url === self.registration.scope);\n e.waitUntil(Promise.all(clientsInScope.map((client) => {\n clickBuffer[client.id] = data;\n return focusChatMessage(client, data);\n })));\n if (!self.clients.openWindow || clientsInScope.length > 0) return undefined;\n\n // If there is no opened client we need to open one and wait until it is fully loaded\n const newClient = await self.clients.openWindow(appUrl);\n if (newClient) {\n // Store notification data until client is fully loaded\n clickBuffer[newClient.id] = data;\n }\n return undefined;\n };\n e.waitUntil(notifyClients());\n}\n\nexport function handleClientMessage(e: ExtendableMessageEvent) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('[SW] New message from client', e);\n }\n if (!e.data) return;\n const source = e.source as WindowClient;\n if (e.data.type === 'clientReady') {\n // focus on chat message when client is fully ready\n if (clickBuffer[source.id]) {\n e.waitUntil(focusChatMessage(source, clickBuffer[source.id]));\n delete clickBuffer[source.id];\n }\n }\n if (e.data.type === 'newMessageNotification') {\n // store messageId for already shown notification\n const notification: NotificationData = e.data.payload;\n e.waitUntil(showNotification(notification));\n shownNotifications.add(notification.messageId);\n }\n}\n\nself.onsync = () => {\n lastSyncAt = new Date().valueOf();\n};\n","import { DEBUG } from './config';\nimport { respondForProgressive } from './serviceWorker/progressive';\nimport { respondWithCache, clearAssetCache } from './serviceWorker/assetCache';\nimport { handlePush, handleNotificationClick, handleClientMessage } from './serviceWorker/pushNotification';\n\ndeclare const self: ServiceWorkerGlobalScope;\n\nconst ASSET_CACHE_PATTERN = /[0-9a-f]{20}.*\\.(js|css|woff2?|svg|png|jpg|jpeg|json|wasm)$/;\n\nself.addEventListener('install', (e) => {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('ServiceWorker installed');\n }\n\n // Activate worker immediately\n e.waitUntil(self.skipWaiting());\n});\n\nself.addEventListener('activate', (e) => {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('ServiceWorker activated');\n }\n\n // Become available to all pages\n e.waitUntil(clearAssetCache());\n e.waitUntil(self.clients.claim());\n});\n\n// eslint-disable-next-line no-restricted-globals\nself.addEventListener('fetch', (e: FetchEvent) => {\n e.respondWith((() => {\n const { url } = e.request;\n\n if (url.includes('/progressive/')) {\n return respondForProgressive(e);\n }\n\n if (url.startsWith('http') && url.match(ASSET_CACHE_PATTERN)) {\n return respondWithCache(e);\n }\n\n return fetch(e.request);\n })());\n});\n\nself.addEventListener('push', handlePush);\nself.addEventListener('notificationclick', handleNotificationClick);\nself.addEventListener('message', handleClientMessage);\n","import { ASSET_CACHE_NAME } from '../config';\n\ndeclare const self: ServiceWorkerGlobalScope;\n\nexport async function respondWithCache(e: FetchEvent) {\n const cache = await self.caches.open(ASSET_CACHE_NAME);\n const cached = await cache.match(e.request);\n\n if (cached) {\n return cached;\n }\n\n const remote = await fetch(e.request);\n cache.put(e.request, remote.clone());\n\n return remote;\n}\n\nexport function clearAssetCache() {\n return self.caches.delete(ASSET_CACHE_NAME);\n}\n"],"sourceRoot":""} \ No newline at end of file