diff --git a/css/base.css b/css/base.css
index ab73544b..998b748a 100644
--- a/css/base.css
+++ b/css/base.css
@@ -19,7 +19,7 @@ html, body {
}
tt {
- font-family: Roboto Mono, monospace;
+ font-family: 'Roboto Mono', Courier, monospace;
}
a {
@@ -1422,7 +1422,7 @@ ul.tabbar li.active > a:after {
/* Badge with a label, like [you], [muted], etc */
.badge {
- font-family: monospace;
+ font-family: 'Roboto Mono', Courier, monospace, sans-serif;
font-size: 0.75rem;
border: 1px solid #666;
background-color: #eee;
diff --git a/css/base.min.css b/css/base.min.css
index 98075a3e..5f9906b1 100644
--- a/css/base.min.css
+++ b/css/base.min.css
@@ -1 +1 @@
-*{box-sizing:border-box;font-family:Roboto,Arial,sans-serif;margin:0;padding:0;text-rendering:optimizeLegibility}body,html{background-color:silver;box-shadow:inset 0 10rem #3949ab;color:#666;font-size:10pt;height:100%;overflow:hidden;width:100%}tt{font-family:Roboto Mono,monospace}a{color:#2196f3;text-decoration:none}a:focus,a:hover{color:#0a6ebd;text-decoration:underline}a.red:focus,a.red:hover{color:#f44336}a.flat-button{align-items:center;display:flex;font-weight:400;height:2em;line-height:2em;margin:.15rem .35rem;text-align:center;text-transform:uppercase;touch-action:manipulation;vertical-align:middle;white-space:nowrap}a.flat-button:focus,a.flat-button:hover{text-decoration:none}form{line-height:1.5;padding:.5rem .75rem}form,label{font-size:1.1rem}label{margin-right:auto}label.small{color:#1e88e5;font-size:.95rem}img.avatar{border-radius:50%;height:100%;width:100%}button{border:1px solid transparent;border-radius:2px;box-shadow:0 2px 5px 0 rgba(0,0,0,.25);cursor:pointer;display:inline-block;font-family:inherit;font-size:1.1rem;font-weight:400;height:2.2em;line-height:2.2em;padding-left:2rem;padding-right:2rem;text-align:center;text-transform:uppercase;touch-action:manipulation;vertical-align:middle;white-space:nowrap}button[disabled],html input[disabled]{box-shadow:none;cursor:default;opacity:.65}button.round{border-radius:50%;box-shadow:0 2px .5rem 0 rgba(0,0,0,.25);height:3rem;line-height:3.5rem;margin:0;outline:none;padding:0;width:3rem;z-index:2}button.round.small{box-shadow:0 2px .35rem 0 rgba(0,0,0,.25);height:2rem;line-height:2rem;width:2rem}button:active,button:focus,button:hover{color:#fff}button:active{box-shadow:inset 0 3px .5rem rgba(0,0,0,.125)}button:active.round.small{box-shadow:inset 0 2px .35rem rgba(0,0,0,.125)}button.blue{background-color:#1e88e5;color:#fff}button.blue:active,button.blue:focus,button.blue:hover{background-color:#1976d2}button.white{background-color:#fff;color:#2196f3}button.blue:active,button.white:focus,button.white:hover{background-color:#e3f2fd}input,textarea{background:transparent;border:none;color:#666;font-family:inherit;font-size:1.1rem;margin:.25rem 0;outline:none;padding:0 .125rem}textarea{resize:none}input[type=email],input[type=password],input[type=search],input[type=text],textarea{border-bottom:1px solid #ccc;box-shadow:0 1px 0 rgba(0,0,0,.1);height:2.5rem;transition:all .1s ease-in-out}input[type=email],input[type=password],input[type=text],textarea{width:100%}input[type=email]:focus,input[type=password]:focus,input[type=search]:focus,input[type=text]:focus,textarea:focus{border-bottom:1px solid #2196f3;box-shadow:0 1px 0 rgba(33,150,243,.25)}input[type=email]::placeholder,input[type=password]::placeholder,input[type=search]::placeholder,input[type=text]::placeholder,textarea::placeholder{color:#bbb}input[type=password].with-visibility,input[type=text].with-visibility{margin-right:-2rem;padding-right:2rem}::-webkit-scrollbar{width:.6rem}::-webkit-scrollbar-track{-webkit-box-shadow:inset 0 0 6px rgba(0,0,0,.2);background-color:hsla(0,0%,100%,.1)}::-webkit-scrollbar-thumb{background-color:rgba(0,0,0,.3)}ul.menu{background-color:#fff;border-radius:.2rem;box-shadow:0 1px 6px rgba(0,0,0,.45);list-style:none;padding-bottom:.35rem;padding-top:.35rem;position:absolute;width:12rem;z-index:4}ul.menu>li{padding:.75rem .75rem .75rem 1.25rem}ul.menu>li:hover{background-color:#f5f5f5}ul.menu>li.separator{height:1px;margin:2px;padding:0}ul.menu>li.separator,ul.menu>li.separator:hover{background-color:#ccc}li .menuTrigger{border-radius:.6rem;height:1.2rem;line-height:1.2rem;opacity:0;position:absolute;right:.25rem;text-align:center;top:.25rem;width:1.5rem}li:hover .menuTrigger{opacity:1}li:hover .menuTrigger a{color:#757575}li.left:hover .menuTrigger{-text-shadow:#c5e1a5 0 0 15px,#c5e1a5 0 0 5px;background-image:radial-gradient(#c5e1a5 40%,transparent 75%)}li.right:hover .menuTrigger{-text-shadow:#fafafa 0 0 15px,#fafafa 0 0 5px;background-image:radial-gradient(#fafafa 40%,transparent 75%)}.blue{color:#2196f3}.red{color:#d32f2f}.gray{color:#757575}.light-gray{color:#bbb}.small{font-size:90%}.hr{background-color:#f0f0f0;box-shadow:inset 0 .25rem .25rem -.25rem rgba(0,0,0,.15),inset 0 -.25rem .25rem -.25rem rgba(0,0,0,.15);display:block;height:.6rem;min-height:.3rem;width:100%}.group-focus{outline:none}#mountPoint{height:100%;padding-bottom:3rem;padding-top:1rem}#app-container{background-color:#fff;border-radius:.25rem;box-shadow:1px 2px .3rem grey;margin-left:auto;margin-right:auto;max-width:80rem;overflow:hidden}#app-container,#sidepanel{display:flex;height:100%;position:relative}#sidepanel{flex-direction:column;flex-grow:0;flex-shrink:0.3;min-width:18rem;width:24rem}#topic-view{width:100%}#info-view,#topic-view{display:flex;flex-direction:column;height:100%}#info-view{flex-grow:0;flex-shrink:0.3;min-width:18rem;width:24rem}@media (max-width:960px){#mountPoint{padding:0}}@media (max-width:640px){#app-container{border-radius:0;box-shadow:none;width:100%}#info-view,#sidepanel{width:100%}}.center-medium-text{align-items:center;display:flex;font-size:1.4rem;height:100%;justify-content:center;text-align:center;width:100%}.nodisplay{display:none!important}.quoted{margin-left:1.5rem}.in-place-edit{border-bottom:1px dashed #ddd;cursor:pointer;display:inline-block;font-family:inherit;font-size:1.1rem;height:2.5rem;line-height:2.25;margin:.25rem .125rem;vertical-align:baseline;width:100%}.in-place-edit.disabled{border-bottom:none;cursor:default}.in-place-edit.placeholder{color:#bbb}.in-place-edit .content{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}table.permission-editor{width:100%}table.permission-editor td{font-size:1.1rem;margin:.35rem 0;vertical-align:middle}table.permission-editor td.checkbox{color:#999;text-align:center}.permission-editor .material-icons{font-size:1.1rem;line-height:1.1rem}.material-icons.clickable{border-bottom:none;cursor:pointer}.clickable{border-bottom:1px dashed #ddd;cursor:pointer}.panel-title{font-size:1.4rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.caption-panel{align-items:center;box-shadow:0 1px 2px grey;display:flex;flex:none;height:4rem;padding:.5rem;white-space:nowrap;z-index:1}.dialog-buttons{display:flex;justify-content:flex-end;padding:.5rem}.dialog-buttons button{margin:0 .5rem}.avatar-box{flex-grow:0;flex-shrink:0;position:relative}#side-caption-panel{background-color:#2196f3;color:#bbdefb}#side-caption-panel a{color:#bbdefb;line-height:1;padding-left:.5rem}#side-caption-panel :hover{color:#fff}#sidepanel-title{margin-left:.5rem;margin-right:auto}#self-avatar{border-radius:50%;flex:none;height:3rem;min-width:3rem;width:3rem}#self-avatar.avatar-box{font-size:1.8rem}#settings-form ul{list-style:none}#settings-form li{vertical-align:middle}#settings-form label{display:inline-block;padding-left:.5rem}input.search{text-indent:1.4rem}i.search{left:.6rem;position:absolute}.alert-box{display:none;overflow:hidden;padding:1rem 1.5rem 1rem .5rem;position:relative}.alert-box .cancel{position:absolute;right:.25rem;top:.5rem}.alert-box.error{background-color:#ffcdd2;border-bottom:1px solid #ffbfc8;color:#b71c1c;display:flex}.alert-box.warning{background-color:#fff9c4;border-bottom:1px solid #fff59d;color:#607d8b;display:flex}.alert-box .cancel .material-icons{font-size:1rem}.alert-box.error .cancel .material-icons{color:#b71c1c}.alert-box.warning .cancel .material-icons{color:#757575}.alert-box .icon{display:block;margin-right:.5rem}.alert-box .icon .material-icons{font-size:1.5rem}.alert-box.warning .icon .material-icons{color:#fbc02d}.alert-box.error .icon .material-icons{color:#ef5350}.flex-column{display:flex;flex-direction:column;height:100%;overflow:hidden}.scrollable-panel{height:100%;margin-bottom:auto;margin-top:.25rem;overflow-y:auto}.contact-box{list-style:none;overflow-x:hidden}.contact-box>li{border-bottom:1px solid #eee;border-collapse:collapse;display:flex;flex-grow:0;flex-shrink:0;min-height:3.5rem;overflow-x:hidden;padding:.35rem .25rem .5rem .35rem;position:relative}.contact-box>li:hover{background-color:#eceff1}.contact-box>li.selected{background-color:#cfd8dc}.contact-box .text-box{overflow-x:hidden}.contact-box .contact-title{font-size:1.05rem;overflow:hidden;text-overflow:ellipsis}.contact-box .contact-comment{font-weight:lighter;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.contact-box .avatar-box{font-size:1.8rem;height:3rem;margin-right:.35rem;min-height:3rem;min-width:3rem;overflow:hidden;padding:0;position:relative;width:3rem}.contact-box .avatar{border-radius:50%;height:3rem;width:3rem}.contact-box .avatar-box>.material-icons{height:3rem;width:3rem}.contact-box .avatar-box>.material-icons,.contact-box .text-box{display:flex;flex-direction:column;justify-content:space-around}.avatar-box .online,.offline{border-radius:50%;bottom:.1rem;display:inline-block;flex-shrink:0;height:.75rem;min-height:.75rem;min-width:.75rem;position:absolute;right:0;width:.75rem}.avatar-box .online{background-color:#4caf50}.avatar-box .offline{background-color:silver}.online.typing{animation:typing .5s infinite}@keyframes typing{0%,to{transform:translateX(0)}50%{transform:translateX(-.3rem)}}.contact-box .checkmark.material-icons{background-color:#fff;border:0 solid transparent;bottom:.05rem;color:#0097a7;display:inline-block;font-size:1.5rem;height:1.5rem;line-height:1.5rem;overflow:visible;position:absolute;right:.05rem;width:1.5rem}#add-topic{bottom:1rem;position:absolute;right:1rem}.panel-form{display:flex;flex-direction:column;padding:0}.panel-form-row{align-items:center;justify-content:flex-start}.panel-form-column,.panel-form-row{display:flex;flex-grow:0;flex-shrink:0;line-height:1.5;padding:.5rem .75rem}.panel-form-column{flex-direction:column}.panel-form-column>.panel-form-column,.panel-form-row>.panel-form-column{flex-grow:1;padding:0!important}.panel-form-column>.panel-form-row,.panel-form-row>.panel-form-row{padding:0!important}.avatar-upload{display:flex;flex-direction:column;flex-shrink:0;font-size:4.5rem;height:9rem;margin-left:.5rem;padding:0;width:7rem}.avatar-upload .avatar-box{height:7rem;position:relative;width:7rem}.avatar-upload .avatar-box>.material-icons{font-size:4rem;height:7rem;line-height:7rem;position:relative;vertical-align:middle;width:7rem}.avatar-upload:after{clear:both;content:".";display:block;height:0;visibility:hidden}.avatar-upload .blank{border:1px dashed #999;border-radius:50%;color:#999;flex-shrink:0;font-size:1rem;height:7rem;line-height:7rem;overflow:hidden;text-align:center;vertical-align:middle;width:7rem}.avatar-upload .preview{border-radius:50%;height:7rem;overflow:hidden;width:7rem}.avatar-upload .inputfile.hidden{height:.1px;opacity:0;overflow:hidden;position:absolute;width:.1px}.avatar-upload .inputfile+label.round{align-items:center;background-color:#fafafa;border-radius:50%;bottom:0;box-shadow:0 1px 4px rgba(0,0,0,.4);cursor:pointer;display:flex;height:3rem;justify-content:center;line-height:3rem;margin-left:auto;margin-right:auto;margin-top:-1rem;width:3rem}.avatar-upload .inputfile:focus+label.round{outline:none}.avatar-upload .inputfile+label:hover,.avatar-upload .inputfile:focus+label{background-color:#e3f2fd;color:#42a5f5}#topic-view{position:relative}#topic-caption-panel{background-color:#b0bec5}#topic-caption-panel a{color:#757575;text-decoration:none}#topic-caption-panel :hover{color:#000}#topic-caption-panel .avatar-box{font-size:1.8rem;height:3rem;margin-right:.35rem;min-width:3rem;position:relative;width:3rem}#hide-message-view{display:block;margin-right:.35rem}#topic-users{margin-left:auto;margin-right:1rem}#topic-users .avatar-box{display:inline-block;font-size:1rem;height:1.8rem;margin-right:.2rem;min-height:1.8rem;min-width:1.8rem;width:1.8rem}#messages-panel{background-color:#eceff1;background-image:url(../img/ignasi_pattern_s.png);height:100%;overflow-y:scroll;padding:.75rem;position:relative}#messages-container{height:100%;overflow-y:hidden;position:relative}#write-only-background{background-image:repeating-linear-gradient(45deg,hsla(0,0%,100%,.5),hsla(0,0%,100%,.5) .5rem,hsla(0,0%,100%,.8) 0,hsla(0,0%,100%,.8) 1rem);height:100%;left:0;position:absolute;top:0;width:100%}#write-only-note{background-color:#fff;box-shadow:.1rem .1rem .1rem rgba(0,0,0,.2);color:#666;height:auto;left:50%;line-height:2rem;padding:.25rem 1.5rem;position:absolute;text-align:center;top:50%;transform:translate(-50%,-50%);width:auto}#send-message-panel{align-items:center;background-color:#eceff1;box-shadow:0 -1px rgba(0,0,0,.1);display:flex;flex:none;height:4rem;padding:.4rem .4rem .4rem .6rem;z-index:2}#sendMessage{overflow:hidden;overflow-wrap:break-word}#send-message-panel .material-icons{min-width:1.75rem}#send-message-panel .material-icons.secondary,.material-icons.disabled{color:#999!important}#send-message-panel .material-icons.secondary:hover{color:#2196f3!important}#dummy-view{align-items:center;background-color:#e0f7fa;display:flex;height:100%;justify-content:center;width:100%}#dummy-view a{display:block;text-align:center;text-decoration:none;vertical-align:middle}#image-preview{background-color:hsla(0,0%,100%,.9);display:flex;flex-direction:column;height:100%;left:0;position:absolute;top:0;width:100%;z-index:2}#image-preview-caption-panel{background-color:transparent;display:flex;height:3.5rem;justify-content:space-between;line-height:2.5rem;padding:1rem .75rem 0}#image-preview-caption-panel a{color:#757575;text-decoration:none}#image-preview-caption-panel a:hover{color:#000}#image-preview-container{margin:auto;overflow:hidden}#image-preview-footer{background-color:transparent;display:flex;height:3.2rem;justify-content:space-around;line-height:1.5rem}.chat-box{list-style:none;margin:0 .5rem;padding:0 0 3.5rem}.chat-box.group{margin-left:-.4rem}.chat-box li{align-items:flex-end;display:flex;margin:0;overflow:hidden;padding:0}.chat-box .right{justify-content:flex-end}.chat-box .bubble{border-radius:.5rem;display:flex;height:auto;margin:0;max-width:40rem;min-width:12rem;padding:.75rem .5rem .75rem 1.25rem;position:relative;text-align:left}.chat-box li.single{margin-bottom:.75rem;margin-top:.25rem}.chat-box li.first{margin-bottom:.15rem;margin-top:.25rem}.chat-box li.middle{margin-bottom:.15rem;margin-top:.15rem}.chat-box li.last{margin-bottom:.75rem;margin-top:.15rem}.chat-box .left .bubble{background-color:#c5e1a5}.chat-box .right .bubble{background-color:#fafafa}.chat-box .left .tip:before{color:#c5e1a5;left:-10px;right:auto}.chat-box .left .tip:before,.chat-box .right .tip:before{border:10px solid transparent;border-bottom-color:currentColor;bottom:0;content:"";height:0;position:absolute;top:auto;width:0}.chat-box .right .tip:before{color:#fafafa;display:flex;justify-content:space-between;left:auto;right:-10px}.chat-box .avatar-box{font-size:.8rem;height:1.4rem;margin-bottom:.8rem;margin-right:.8rem;min-height:1.4rem;min-width:1.4rem;position:relative;width:1.4rem}.chat-box .bubble div.message-content{color:#212121;margin:0;max-width:36rem;overflow-wrap:break-word}.chat-box .bubble div.message-content:after{clear:both;content:".";display:block;height:0;visibility:hidden}.chat-box .timestamp{color:#777;display:inline-block;float:right;font-size:80%;padding-left:1rem;position:relative;top:.5rem;white-space:nowrap}.chat-box .typing{border-radius:.5rem;color:#aaa;display:inline-block;margin-top:.75rem;padding:.25rem .35rem;text-align:center;vertical-align:middle;width:2rem}.chat-box .author{color:#777;font-size:80%}.inline-image{border-radius:.1rem;cursor:pointer;display:block;max-height:24rem;max-width:36rem;overflow:hidden}.attachment{display:flex}.attachment:last-of-type{margin-bottom:-.45rem}#info-caption-panel{background-color:#b0bec5}#info-caption-panel a{color:#757575;line-height:1;text-decoration:none}#info-caption-panel :hover{color:#000}#info-title{margin-right:auto}#group-manager{display:flex;flex-direction:column;height:100%;position:relative}#group-manager-buttons{background-color:#eceff1;border-left:1px solid #ccc;box-shadow:0 -1px rgba(0,0,0,.1);display:flex;height:4rem;justify-content:space-around;padding:.4rem;z-index:2}.dialog-overlay{background-color:hsla(0,0%,100%,.9);height:100%;left:0;position:absolute;top:0;width:100%;z-index:10}.dialog-overlay,.modal-dialog{display:flex;flex-direction:column}.modal-dialog{background-color:#fff;border-radius:.3rem;box-shadow:0 .5rem 1rem 0 rgba(0,0,0,.25);justify-content:space-between;margin:auto;min-height:16rem;min-width:24rem}.modal-dialog .title-panel{display:flex;font-size:1.4rem;justify-content:space-between;padding:1rem}.modal-dialog .body-panel{margin:auto .5rem}.modal-dialog .dialog-buttons{background-color:#fafafa;border-top:1px solid #f5f5f5}.modal-dialog .dialog-buttons a{display:inline-block;font-size:1.1rem;padding:.35rem 1.5rem;text-decoration:none;text-transform:uppercase}ul.tabbar{background:#eee;flex-grow:0;flex-shrink:0;list-style:none;margin:0;overflow:hidden;padding:0 0 0 1rem;width:100%}ul.tabbar>li{float:left}ul.tabbar>li>a{box-shadow:inset 0 -2px 2.5px -1px rgba(0,0,0,.25);color:rgba(33,150,243,.6);display:block;font-size:1.3rem;font-variant:small-caps;font-weight:400;line-height:2rem;overflow:hidden;padding-left:1rem;padding-right:1rem;padding-top:.75rem;position:relative;text-align:center;text-decoration:none}ul.tabbar li.active>a{color:#2196f3}ul.tabbar li.active>a:after{animation:tabbar-border-expand .2s cubic-bezier(.4,0,.4,1) 0s alternate forwards;background:#2196f3;bottom:0;content:"";display:block;height:.15rem;left:0;position:absolute}@keyframes tabbar-border-expand{0%{opacity:0;width:0}to{opacity:1;width:100%}}.unread{background-color:#0097a7;border-radius:50%;color:#fff;font-weight:bolder;height:1.35rem;line-height:1.35rem;margin-left:.5rem;text-align:center;vertical-align:middle;width:1.35rem}.badge,.unread{display:inline-block;font-size:.75rem}.badge{align-self:flex-start;background-color:#eee;border:1px solid #666;border-radius:.15rem;color:#666;font-family:monospace;margin-bottom:.1rem;margin-left:.1rem;margin-right:.1rem;padding:0 .15rem}.badge.green{background-color:#efe;border-color:#383;color:#383}.badge.yellow{background-color:#ffe;border-color:#660;color:#660}.badge.blue{background-color:#eef;border-color:#339;color:#339}.badge.red{background-color:#fee;border-color:#933;color:#933}.badge.magenta{background-color:#fef;border-color:#939;color:#939}.lettertile{border-radius:50%;padding-bottom:100%;width:100%}.lettertile>div{align-items:center;border-radius:50%;bottom:0;color:hsla(0,0%,98%,.8);display:flex;flex-grow:0;flex-shrink:0;justify-content:center;left:0;line-height:1;position:absolute;right:0;text-align:center;text-transform:uppercase;top:0}.lettertile:hover{color:#fff}.lettertile.color0{background-color:#ef9a9a}.lettertile.color1{background-color:#90caf9}.lettertile.color2{background-color:#b0bec5}.lettertile.color3{background-color:#b39ddb}.lettertile.color4{background-color:#ffab91}.lettertile.color5{background-color:#a5d6a7}.lettertile.color6{background-color:#eee}.lettertile.color7{background-color:#e6ee9c}.lettertile.color8{background-color:#c5e1a5}.lettertile.color9{background-color:#f0e57d}.lettertile.color10{background-color:#f48fb1}.lettertile.color11{background-color:#9fa8da}.lettertile.color12{background-color:#ffe082}.lettertile.color13{background-color:#bcaaa4}.lettertile.color14{background-color:#80deea}.lettertile.color15{background-color:#ce93d8}.lettertile.dark-color0{background-color:#c62828}.lettertile.dark-color1{background-color:#ad1457}.lettertile.dark-color2{background-color:#6a1b9a}.lettertile.dark-color3{background-color:#4527a0}.lettertile.dark-color4{background-color:#283593}.lettertile.dark-color5{background-color:#1565c0}.lettertile.dark-color6{background-color:#0277bd}.lettertile.dark-color7{background-color:#00838f}.lettertile.dark-color8{background-color:#00695c}.lettertile.dark-color9{background-color:#2e7d32}.lettertile.dark-color10{background-color:#558b2f}.lettertile.dark-color11{background-color:#9e9d24}.lettertile.dark-color12{background-color:#f9a825}.lettertile.dark-color13{background-color:#ff8f00}.lettertile.dark-color14{background-color:#ef6c00}.lettertile.dark-color15{background-color:#d84315}.material-icons{font-size:1.4rem;line-height:1;text-align:center;vertical-align:middle}.material-icons.small{font-size:1rem}.material-icons.big{font-size:2.4rem}#self-avatar.material-icons,.avatar-box .material-icons{font-size:2.4rem;height:3rem;line-height:3rem;width:3rem}.avatar-box .material-icons{background-color:silver;border-radius:50%;color:hsla(0,0%,98%,.8)}.chip-input{align-items:center;background:transparent;border-bottom:1px solid #ccc;box-shadow:0 1px 0 rgba(0,0,0,.1);color:#666;cursor:text;display:flex;flex-grow:1;flex-wrap:wrap;font-size:1.1rem;font-weight:400;justify-content:flex-start;margin:.25rem 0;max-height:10rem;min-height:4rem;outline:none;overflow-y:scroll;text-align:center;transition:all .1s ease-in-out}.chip-input.focused{border-bottom:1px solid #2196f3;box-shadow:0 1px 0 rgba(33,150,243,.25)}.chip-input>input[type=text]{border:none;box-shadow:none;display:inline-block;flex:1 0 auto;min-width:4rem;width:auto}.chip,.chip-input>input[type=text]{height:1.8rem;line-height:1.8;margin:.125rem}.chip{align-items:center;background-color:#eee;border-radius:.9rem;display:flex;flex:0 0 auto;font-size:90%;white-space:nowrap}.chip>a{background-color:#aaa;border-radius:50%;color:#ccc;display:inline-block;height:1.175rem;line-height:1.15;margin:.3rem;text-decoration:none;width:1.175rem}.chip>a:focus,.chip>a:hover{background-color:#bbb;color:#ddd;text-decoration:none}.chip .avatar-box{font-size:1rem;height:1.8rem;margin-right:.2rem;min-height:1.8rem;min-width:1.8rem;position:relative;width:1.8rem}.chip .avatar-box .material-icons{font-size:1.8rem}.chip .spacer{display:inline-block;height:1.175rem;margin:.3rem;width:.25rem}.load-spinner-box{background-color:#fff;border-radius:50%;box-shadow:.1rem .1rem .15rem 1px rgba(0,0,0,.25);height:2.5rem;left:0;margin-left:auto;margin-right:auto;padding:.25rem;position:absolute;right:0;top:5rem;width:2.5rem;z-index:2}.loader-spinner{animation:spin 1.5s linear infinite;border:.35rem solid #f3f3f3;border-radius:50%;border-top-color:#1e88e5;height:2rem;width:2rem}@keyframes spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.uploader{display:flex}.uploader>div{background-color:#cfd8dc;border-radius:.1rem;height:.6rem;line-height:0;margin:.35rem;padding:.15rem;position:relative;width:6rem}.uploader>div>span{background-color:#1e88e5;border-radius:.08rem;display:inline-block;height:.3rem}
\ No newline at end of file
+*{box-sizing:border-box;font-family:Roboto,Arial,sans-serif;margin:0;padding:0;text-rendering:optimizeLegibility}body,html{background-color:silver;box-shadow:inset 0 10rem #3949ab;color:#666;font-size:10pt;height:100%;overflow:hidden;width:100%}tt{font-family:Roboto Mono,Courier,monospace}a{color:#2196f3;text-decoration:none}a:focus,a:hover{color:#0a6ebd;text-decoration:underline}a.red:focus,a.red:hover{color:#f44336}a.flat-button{align-items:center;display:flex;font-weight:400;height:2em;line-height:2em;margin:.15rem .35rem;text-align:center;text-transform:uppercase;touch-action:manipulation;vertical-align:middle;white-space:nowrap}a.flat-button:focus,a.flat-button:hover{text-decoration:none}form{line-height:1.5;padding:.5rem .75rem}form,label{font-size:1.1rem}label{margin-right:auto}label.small{color:#1e88e5;font-size:.95rem}img.avatar{border-radius:50%;height:100%;width:100%}button{border:1px solid transparent;border-radius:2px;box-shadow:0 2px 5px 0 rgba(0,0,0,.25);cursor:pointer;display:inline-block;font-family:inherit;font-size:1.1rem;font-weight:400;height:2.2em;line-height:2.2em;padding-left:2rem;padding-right:2rem;text-align:center;text-transform:uppercase;touch-action:manipulation;vertical-align:middle;white-space:nowrap}button[disabled],html input[disabled]{box-shadow:none;cursor:default;opacity:.65}button.round{border-radius:50%;box-shadow:0 2px .5rem 0 rgba(0,0,0,.25);height:3rem;line-height:3.5rem;margin:0;outline:none;padding:0;width:3rem;z-index:2}button.round.small{box-shadow:0 2px .35rem 0 rgba(0,0,0,.25);height:2rem;line-height:2rem;width:2rem}button:active,button:focus,button:hover{color:#fff}button:active{box-shadow:inset 0 3px .5rem rgba(0,0,0,.125)}button:active.round.small{box-shadow:inset 0 2px .35rem rgba(0,0,0,.125)}button.blue{background-color:#1e88e5;color:#fff}button.blue:active,button.blue:focus,button.blue:hover{background-color:#1976d2}button.white{background-color:#fff;color:#2196f3}button.blue:active,button.white:focus,button.white:hover{background-color:#e3f2fd}input,textarea{background:transparent;border:none;color:#666;font-family:inherit;font-size:1.1rem;margin:.25rem 0;outline:none;padding:0 .125rem}textarea{resize:none}input[type=email],input[type=password],input[type=search],input[type=text],textarea{border-bottom:1px solid #ccc;box-shadow:0 1px 0 rgba(0,0,0,.1);height:2.5rem;transition:all .1s ease-in-out}input[type=email],input[type=password],input[type=text],textarea{width:100%}input[type=email]:focus,input[type=password]:focus,input[type=search]:focus,input[type=text]:focus,textarea:focus{border-bottom:1px solid #2196f3;box-shadow:0 1px 0 rgba(33,150,243,.25)}input[type=email]::placeholder,input[type=password]::placeholder,input[type=search]::placeholder,input[type=text]::placeholder,textarea::placeholder{color:#bbb}input[type=password].with-visibility,input[type=text].with-visibility{margin-right:-2rem;padding-right:2rem}::-webkit-scrollbar{width:.6rem}::-webkit-scrollbar-track{-webkit-box-shadow:inset 0 0 6px rgba(0,0,0,.2);background-color:hsla(0,0%,100%,.1)}::-webkit-scrollbar-thumb{background-color:rgba(0,0,0,.3)}ul.menu{background-color:#fff;border-radius:.2rem;box-shadow:0 1px 6px rgba(0,0,0,.45);list-style:none;padding-bottom:.35rem;padding-top:.35rem;position:absolute;width:12rem;z-index:4}ul.menu>li{padding:.75rem .75rem .75rem 1.25rem}ul.menu>li:hover{background-color:#f5f5f5}ul.menu>li.separator{height:1px;margin:2px;padding:0}ul.menu>li.separator,ul.menu>li.separator:hover{background-color:#ccc}li .menuTrigger{border-radius:.6rem;height:1.2rem;line-height:1.2rem;opacity:0;position:absolute;right:.25rem;text-align:center;top:.25rem;width:1.5rem}li:hover .menuTrigger{opacity:1}li:hover .menuTrigger a{color:#757575}li.left:hover .menuTrigger{-text-shadow:#c5e1a5 0 0 15px,#c5e1a5 0 0 5px;background-image:radial-gradient(#c5e1a5 40%,transparent 75%)}li.right:hover .menuTrigger{-text-shadow:#fafafa 0 0 15px,#fafafa 0 0 5px;background-image:radial-gradient(#fafafa 40%,transparent 75%)}.blue{color:#2196f3}.red{color:#d32f2f}.gray{color:#757575}.light-gray{color:#bbb}.small{font-size:90%}.hr{background-color:#f0f0f0;box-shadow:inset 0 .25rem .25rem -.25rem rgba(0,0,0,.15),inset 0 -.25rem .25rem -.25rem rgba(0,0,0,.15);display:block;height:.6rem;min-height:.3rem;width:100%}.group-focus{outline:none}#mountPoint{height:100%;padding-bottom:3rem;padding-top:1rem}#app-container{background-color:#fff;border-radius:.25rem;box-shadow:1px 2px .3rem grey;margin-left:auto;margin-right:auto;max-width:80rem;overflow:hidden}#app-container,#sidepanel{display:flex;height:100%;position:relative}#sidepanel{flex-direction:column;flex-grow:0;flex-shrink:0.3;min-width:18rem;width:24rem}#topic-view{width:100%}#info-view,#topic-view{display:flex;flex-direction:column;height:100%}#info-view{flex-grow:0;flex-shrink:0.3;min-width:18rem;width:24rem}@media (max-width:960px){#mountPoint{padding:0}}@media (max-width:640px){#app-container{border-radius:0;box-shadow:none;width:100%}#info-view,#sidepanel{width:100%}}.center-medium-text{align-items:center;display:flex;font-size:1.4rem;height:100%;justify-content:center;text-align:center;width:100%}.nodisplay{display:none!important}.quoted{margin-left:1.5rem}.in-place-edit{border-bottom:1px dashed #ddd;cursor:pointer;display:inline-block;font-family:inherit;font-size:1.1rem;height:2.5rem;line-height:2.25;margin:.25rem .125rem;vertical-align:baseline;width:100%}.in-place-edit.disabled{border-bottom:none;cursor:default}.in-place-edit.placeholder{color:#bbb}.in-place-edit .content{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}table.permission-editor{width:100%}table.permission-editor td{font-size:1.1rem;margin:.35rem 0;vertical-align:middle}table.permission-editor td.checkbox{color:#999;text-align:center}.permission-editor .material-icons{font-size:1.1rem;line-height:1.1rem}.material-icons.clickable{border-bottom:none;cursor:pointer}.clickable{border-bottom:1px dashed #ddd;cursor:pointer}.panel-title{font-size:1.4rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.caption-panel{align-items:center;box-shadow:0 1px 2px grey;display:flex;flex:none;height:4rem;padding:.5rem;white-space:nowrap;z-index:1}.dialog-buttons{display:flex;justify-content:flex-end;padding:.5rem}.dialog-buttons button{margin:0 .5rem}.avatar-box{flex-grow:0;flex-shrink:0;position:relative}#side-caption-panel{background-color:#2196f3;color:#bbdefb}#side-caption-panel a{color:#bbdefb;line-height:1;padding-left:.5rem}#side-caption-panel :hover{color:#fff}#sidepanel-title{margin-left:.5rem;margin-right:auto}#self-avatar{border-radius:50%;flex:none;height:3rem;min-width:3rem;width:3rem}#self-avatar.avatar-box{font-size:1.8rem}#settings-form ul{list-style:none}#settings-form li{vertical-align:middle}#settings-form label{display:inline-block;padding-left:.5rem}input.search{text-indent:1.4rem}i.search{left:.6rem;position:absolute}.alert-box{display:none;overflow:hidden;padding:1rem 1.5rem 1rem .5rem;position:relative}.alert-box .cancel{position:absolute;right:.25rem;top:.5rem}.alert-box.error{background-color:#ffcdd2;border-bottom:1px solid #ffbfc8;color:#b71c1c;display:flex}.alert-box.warning{background-color:#fff9c4;border-bottom:1px solid #fff59d;color:#607d8b;display:flex}.alert-box .cancel .material-icons{font-size:1rem}.alert-box.error .cancel .material-icons{color:#b71c1c}.alert-box.warning .cancel .material-icons{color:#757575}.alert-box .icon{display:block;margin-right:.5rem}.alert-box .icon .material-icons{font-size:1.5rem}.alert-box.warning .icon .material-icons{color:#fbc02d}.alert-box.error .icon .material-icons{color:#ef5350}.flex-column{display:flex;flex-direction:column;height:100%;overflow:hidden}.scrollable-panel{height:100%;margin-bottom:auto;margin-top:.25rem;overflow-y:auto}.contact-box{list-style:none;overflow-x:hidden}.contact-box>li{border-bottom:1px solid #eee;border-collapse:collapse;display:flex;flex-grow:0;flex-shrink:0;min-height:3.5rem;overflow-x:hidden;padding:.35rem .25rem .5rem .35rem;position:relative}.contact-box>li:hover{background-color:#eceff1}.contact-box>li.selected{background-color:#cfd8dc}.contact-box .text-box{overflow-x:hidden}.contact-box .contact-title{font-size:1.05rem;overflow:hidden;text-overflow:ellipsis}.contact-box .contact-comment{font-weight:lighter;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.contact-box .avatar-box{font-size:1.8rem;height:3rem;margin-right:.35rem;min-height:3rem;min-width:3rem;overflow:hidden;padding:0;position:relative;width:3rem}.contact-box .avatar{border-radius:50%;height:3rem;width:3rem}.contact-box .avatar-box>.material-icons{height:3rem;width:3rem}.contact-box .avatar-box>.material-icons,.contact-box .text-box{display:flex;flex-direction:column;justify-content:space-around}.avatar-box .online,.offline{border-radius:50%;bottom:.1rem;display:inline-block;flex-shrink:0;height:.75rem;min-height:.75rem;min-width:.75rem;position:absolute;right:0;width:.75rem}.avatar-box .online{background-color:#4caf50}.avatar-box .offline{background-color:silver}.online.typing{animation:typing .5s infinite}@keyframes typing{0%,to{transform:translateX(0)}50%{transform:translateX(-.3rem)}}.contact-box .checkmark.material-icons{background-color:#fff;border:0 solid transparent;bottom:.05rem;color:#0097a7;display:inline-block;font-size:1.5rem;height:1.5rem;line-height:1.5rem;overflow:visible;position:absolute;right:.05rem;width:1.5rem}#add-topic{bottom:1rem;position:absolute;right:1rem}.panel-form{display:flex;flex-direction:column;padding:0}.panel-form-row{align-items:center;justify-content:flex-start}.panel-form-column,.panel-form-row{display:flex;flex-grow:0;flex-shrink:0;line-height:1.5;padding:.5rem .75rem}.panel-form-column{flex-direction:column}.panel-form-column>.panel-form-column,.panel-form-row>.panel-form-column{flex-grow:1;padding:0!important}.panel-form-column>.panel-form-row,.panel-form-row>.panel-form-row{padding:0!important}.avatar-upload{display:flex;flex-direction:column;flex-shrink:0;font-size:4.5rem;height:9rem;margin-left:.5rem;padding:0;width:7rem}.avatar-upload .avatar-box{height:7rem;position:relative;width:7rem}.avatar-upload .avatar-box>.material-icons{font-size:4rem;height:7rem;line-height:7rem;position:relative;vertical-align:middle;width:7rem}.avatar-upload:after{clear:both;content:".";display:block;height:0;visibility:hidden}.avatar-upload .blank{border:1px dashed #999;border-radius:50%;color:#999;flex-shrink:0;font-size:1rem;height:7rem;line-height:7rem;overflow:hidden;text-align:center;vertical-align:middle;width:7rem}.avatar-upload .preview{border-radius:50%;height:7rem;overflow:hidden;width:7rem}.avatar-upload .inputfile.hidden{height:.1px;opacity:0;overflow:hidden;position:absolute;width:.1px}.avatar-upload .inputfile+label.round{align-items:center;background-color:#fafafa;border-radius:50%;bottom:0;box-shadow:0 1px 4px rgba(0,0,0,.4);cursor:pointer;display:flex;height:3rem;justify-content:center;line-height:3rem;margin-left:auto;margin-right:auto;margin-top:-1rem;width:3rem}.avatar-upload .inputfile:focus+label.round{outline:none}.avatar-upload .inputfile+label:hover,.avatar-upload .inputfile:focus+label{background-color:#e3f2fd;color:#42a5f5}#topic-view{position:relative}#topic-caption-panel{background-color:#b0bec5}#topic-caption-panel a{color:#757575;text-decoration:none}#topic-caption-panel :hover{color:#000}#topic-caption-panel .avatar-box{font-size:1.8rem;height:3rem;margin-right:.35rem;min-width:3rem;position:relative;width:3rem}#hide-message-view{display:block;margin-right:.35rem}#topic-users{margin-left:auto;margin-right:1rem}#topic-users .avatar-box{display:inline-block;font-size:1rem;height:1.8rem;margin-right:.2rem;min-height:1.8rem;min-width:1.8rem;width:1.8rem}#messages-panel{background-color:#eceff1;background-image:url(../img/ignasi_pattern_s.png);height:100%;overflow-y:scroll;padding:.75rem;position:relative}#messages-container{height:100%;overflow-y:hidden;position:relative}#write-only-background{background-image:repeating-linear-gradient(45deg,hsla(0,0%,100%,.5),hsla(0,0%,100%,.5) .5rem,hsla(0,0%,100%,.8) 0,hsla(0,0%,100%,.8) 1rem);height:100%;left:0;position:absolute;top:0;width:100%}#write-only-note{background-color:#fff;box-shadow:.1rem .1rem .1rem rgba(0,0,0,.2);color:#666;height:auto;left:50%;line-height:2rem;padding:.25rem 1.5rem;position:absolute;text-align:center;top:50%;transform:translate(-50%,-50%);width:auto}#send-message-panel{align-items:center;background-color:#eceff1;box-shadow:0 -1px rgba(0,0,0,.1);display:flex;flex:none;height:4rem;padding:.4rem .4rem .4rem .6rem;z-index:2}#sendMessage{overflow:hidden;overflow-wrap:break-word}#send-message-panel .material-icons{min-width:1.75rem}#send-message-panel .material-icons.secondary,.material-icons.disabled{color:#999!important}#send-message-panel .material-icons.secondary:hover{color:#2196f3!important}#dummy-view{align-items:center;background-color:#e0f7fa;display:flex;height:100%;justify-content:center;width:100%}#dummy-view a{display:block;text-align:center;text-decoration:none;vertical-align:middle}#image-preview{background-color:hsla(0,0%,100%,.9);display:flex;flex-direction:column;height:100%;left:0;position:absolute;top:0;width:100%;z-index:2}#image-preview-caption-panel{background-color:transparent;display:flex;height:3.5rem;justify-content:space-between;line-height:2.5rem;padding:1rem .75rem 0}#image-preview-caption-panel a{color:#757575;text-decoration:none}#image-preview-caption-panel a:hover{color:#000}#image-preview-container{margin:auto;overflow:hidden}#image-preview-footer{background-color:transparent;display:flex;height:3.2rem;justify-content:space-around;line-height:1.5rem}.chat-box{list-style:none;margin:0 .5rem;padding:0 0 3.5rem}.chat-box.group{margin-left:-.4rem}.chat-box li{align-items:flex-end;display:flex;margin:0;overflow:hidden;padding:0}.chat-box .right{justify-content:flex-end}.chat-box .bubble{border-radius:.5rem;display:flex;height:auto;margin:0;max-width:40rem;min-width:12rem;padding:.75rem .5rem .75rem 1.25rem;position:relative;text-align:left}.chat-box li.single{margin-bottom:.75rem;margin-top:.25rem}.chat-box li.first{margin-bottom:.15rem;margin-top:.25rem}.chat-box li.middle{margin-bottom:.15rem;margin-top:.15rem}.chat-box li.last{margin-bottom:.75rem;margin-top:.15rem}.chat-box .left .bubble{background-color:#c5e1a5}.chat-box .right .bubble{background-color:#fafafa}.chat-box .left .tip:before{color:#c5e1a5;left:-10px;right:auto}.chat-box .left .tip:before,.chat-box .right .tip:before{border:10px solid transparent;border-bottom-color:currentColor;bottom:0;content:"";height:0;position:absolute;top:auto;width:0}.chat-box .right .tip:before{color:#fafafa;display:flex;justify-content:space-between;left:auto;right:-10px}.chat-box .avatar-box{font-size:.8rem;height:1.4rem;margin-bottom:.8rem;margin-right:.8rem;min-height:1.4rem;min-width:1.4rem;position:relative;width:1.4rem}.chat-box .bubble div.message-content{color:#212121;margin:0;max-width:36rem;overflow-wrap:break-word}.chat-box .bubble div.message-content:after{clear:both;content:".";display:block;height:0;visibility:hidden}.chat-box .timestamp{color:#777;display:inline-block;float:right;font-size:80%;padding-left:1rem;position:relative;top:.5rem;white-space:nowrap}.chat-box .typing{border-radius:.5rem;color:#aaa;display:inline-block;margin-top:.75rem;padding:.25rem .35rem;text-align:center;vertical-align:middle;width:2rem}.chat-box .author{color:#777;font-size:80%}.inline-image{border-radius:.1rem;cursor:pointer;display:block;max-height:24rem;max-width:36rem;overflow:hidden}.attachment{display:flex}.attachment:last-of-type{margin-bottom:-.45rem}#info-caption-panel{background-color:#b0bec5}#info-caption-panel a{color:#757575;line-height:1;text-decoration:none}#info-caption-panel :hover{color:#000}#info-title{margin-right:auto}#group-manager{display:flex;flex-direction:column;height:100%;position:relative}#group-manager-buttons{background-color:#eceff1;border-left:1px solid #ccc;box-shadow:0 -1px rgba(0,0,0,.1);display:flex;height:4rem;justify-content:space-around;padding:.4rem;z-index:2}.dialog-overlay{background-color:hsla(0,0%,100%,.9);height:100%;left:0;position:absolute;top:0;width:100%;z-index:10}.dialog-overlay,.modal-dialog{display:flex;flex-direction:column}.modal-dialog{background-color:#fff;border-radius:.3rem;box-shadow:0 .5rem 1rem 0 rgba(0,0,0,.25);justify-content:space-between;margin:auto;min-height:16rem;min-width:24rem}.modal-dialog .title-panel{display:flex;font-size:1.4rem;justify-content:space-between;padding:1rem}.modal-dialog .body-panel{margin:auto .5rem}.modal-dialog .dialog-buttons{background-color:#fafafa;border-top:1px solid #f5f5f5}.modal-dialog .dialog-buttons a{display:inline-block;font-size:1.1rem;padding:.35rem 1.5rem;text-decoration:none;text-transform:uppercase}ul.tabbar{background:#eee;flex-grow:0;flex-shrink:0;list-style:none;margin:0;overflow:hidden;padding:0 0 0 1rem;width:100%}ul.tabbar>li{float:left}ul.tabbar>li>a{box-shadow:inset 0 -2px 2.5px -1px rgba(0,0,0,.25);color:rgba(33,150,243,.6);display:block;font-size:1.3rem;font-variant:small-caps;font-weight:400;line-height:2rem;overflow:hidden;padding-left:1rem;padding-right:1rem;padding-top:.75rem;position:relative;text-align:center;text-decoration:none}ul.tabbar li.active>a{color:#2196f3}ul.tabbar li.active>a:after{animation:tabbar-border-expand .2s cubic-bezier(.4,0,.4,1) 0s alternate forwards;background:#2196f3;bottom:0;content:"";display:block;height:.15rem;left:0;position:absolute}@keyframes tabbar-border-expand{0%{opacity:0;width:0}to{opacity:1;width:100%}}.unread{background-color:#0097a7;border-radius:50%;color:#fff;font-weight:bolder;height:1.35rem;line-height:1.35rem;margin-left:.5rem;text-align:center;vertical-align:middle;width:1.35rem}.badge,.unread{display:inline-block;font-size:.75rem}.badge{align-self:flex-start;background-color:#eee;border:1px solid #666;border-radius:.15rem;color:#666;font-family:Roboto Mono,Courier,monospace,sans-serif;margin-bottom:.1rem;margin-left:.1rem;margin-right:.1rem;padding:0 .15rem}.badge.green{background-color:#efe;border-color:#383;color:#383}.badge.yellow{background-color:#ffe;border-color:#660;color:#660}.badge.blue{background-color:#eef;border-color:#339;color:#339}.badge.red{background-color:#fee;border-color:#933;color:#933}.badge.magenta{background-color:#fef;border-color:#939;color:#939}.lettertile{border-radius:50%;padding-bottom:100%;width:100%}.lettertile>div{align-items:center;border-radius:50%;bottom:0;color:hsla(0,0%,98%,.8);display:flex;flex-grow:0;flex-shrink:0;justify-content:center;left:0;line-height:1;position:absolute;right:0;text-align:center;text-transform:uppercase;top:0}.lettertile:hover{color:#fff}.lettertile.color0{background-color:#ef9a9a}.lettertile.color1{background-color:#90caf9}.lettertile.color2{background-color:#b0bec5}.lettertile.color3{background-color:#b39ddb}.lettertile.color4{background-color:#ffab91}.lettertile.color5{background-color:#a5d6a7}.lettertile.color6{background-color:#eee}.lettertile.color7{background-color:#e6ee9c}.lettertile.color8{background-color:#c5e1a5}.lettertile.color9{background-color:#f0e57d}.lettertile.color10{background-color:#f48fb1}.lettertile.color11{background-color:#9fa8da}.lettertile.color12{background-color:#ffe082}.lettertile.color13{background-color:#bcaaa4}.lettertile.color14{background-color:#80deea}.lettertile.color15{background-color:#ce93d8}.lettertile.dark-color0{background-color:#c62828}.lettertile.dark-color1{background-color:#ad1457}.lettertile.dark-color2{background-color:#6a1b9a}.lettertile.dark-color3{background-color:#4527a0}.lettertile.dark-color4{background-color:#283593}.lettertile.dark-color5{background-color:#1565c0}.lettertile.dark-color6{background-color:#0277bd}.lettertile.dark-color7{background-color:#00838f}.lettertile.dark-color8{background-color:#00695c}.lettertile.dark-color9{background-color:#2e7d32}.lettertile.dark-color10{background-color:#558b2f}.lettertile.dark-color11{background-color:#9e9d24}.lettertile.dark-color12{background-color:#f9a825}.lettertile.dark-color13{background-color:#ff8f00}.lettertile.dark-color14{background-color:#ef6c00}.lettertile.dark-color15{background-color:#d84315}.material-icons{font-size:1.4rem;line-height:1;text-align:center;vertical-align:middle}.material-icons.small{font-size:1rem}.material-icons.big{font-size:2.4rem}#self-avatar.material-icons,.avatar-box .material-icons{font-size:2.4rem;height:3rem;line-height:3rem;width:3rem}.avatar-box .material-icons{background-color:silver;border-radius:50%;color:hsla(0,0%,98%,.8)}.chip-input{align-items:center;background:transparent;border-bottom:1px solid #ccc;box-shadow:0 1px 0 rgba(0,0,0,.1);color:#666;cursor:text;display:flex;flex-grow:1;flex-wrap:wrap;font-size:1.1rem;font-weight:400;justify-content:flex-start;margin:.25rem 0;max-height:10rem;min-height:4rem;outline:none;overflow-y:scroll;text-align:center;transition:all .1s ease-in-out}.chip-input.focused{border-bottom:1px solid #2196f3;box-shadow:0 1px 0 rgba(33,150,243,.25)}.chip-input>input[type=text]{border:none;box-shadow:none;display:inline-block;flex:1 0 auto;min-width:4rem;width:auto}.chip,.chip-input>input[type=text]{height:1.8rem;line-height:1.8;margin:.125rem}.chip{align-items:center;background-color:#eee;border-radius:.9rem;display:flex;flex:0 0 auto;font-size:90%;white-space:nowrap}.chip>a{background-color:#aaa;border-radius:50%;color:#ccc;display:inline-block;height:1.175rem;line-height:1.15;margin:.3rem;text-decoration:none;width:1.175rem}.chip>a:focus,.chip>a:hover{background-color:#bbb;color:#ddd;text-decoration:none}.chip .avatar-box{font-size:1rem;height:1.8rem;margin-right:.2rem;min-height:1.8rem;min-width:1.8rem;position:relative;width:1.8rem}.chip .avatar-box .material-icons{font-size:1.8rem}.chip .spacer{display:inline-block;height:1.175rem;margin:.3rem;width:.25rem}.load-spinner-box{background-color:#fff;border-radius:50%;box-shadow:.1rem .1rem .15rem 1px rgba(0,0,0,.25);height:2.5rem;left:0;margin-left:auto;margin-right:auto;padding:.25rem;position:absolute;right:0;top:5rem;width:2.5rem;z-index:2}.loader-spinner{animation:spin 1.5s linear infinite;border:.35rem solid #f3f3f3;border-radius:50%;border-top-color:#1e88e5;height:2rem;width:2rem}@keyframes spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.uploader{display:flex}.uploader>div{background-color:#cfd8dc;border-radius:.1rem;height:.6rem;line-height:0;margin:.35rem;padding:.15rem;position:relative;width:6rem}.uploader>div>span{background-color:#1e88e5;border-radius:.08rem;display:inline-block;height:.3rem}
\ No newline at end of file
diff --git a/src/i18n/ru.json b/src/i18n/ru.json
index 1a27cfaa..4dc60fc2 100644
--- a/src/i18n/ru.json
+++ b/src/i18n/ru.json
@@ -96,7 +96,7 @@
"menu_item_delete_for_all": "Удалить для всех",
"menu_item_mute": "Не уведомлять",
"menu_item_unmute": "Уведомлять",
- "menu_item_delete_topic": "Удалить",
+ "menu_item_delete_topic": "Удалить чат",
"menu_item_unblock": "Разблокировать",
"menu_item_block": "Заблокировать",
"menu_item_member_delete": "Отписать",
diff --git a/src/messages.json b/src/messages.json
index 6ed1029c..acdb87b9 100644
--- a/src/messages.json
+++ b/src/messages.json
@@ -218,7 +218,7 @@
"menu_item_delete_for_all": "Удалить для всех",
"menu_item_mute": "Не уведомлять",
"menu_item_unmute": "Уведомлять",
- "menu_item_delete_topic": "Удалить",
+ "menu_item_delete_topic": "Удалить чат",
"menu_item_unblock": "Разблокировать",
"menu_item_block": "Заблокировать",
"menu_item_member_delete": "Отписать",
diff --git a/src/widgets/contact-list.jsx b/src/widgets/contact-list.jsx
index a4b9695f..2cbfd46a 100644
--- a/src/widgets/contact-list.jsx
+++ b/src/widgets/contact-list.jsx
@@ -22,8 +22,9 @@ const messages = defineMessages({
class ContactList extends React.Component {
render() {
- var contactNodes = [];
- var showCheckmark = Array.isArray(this.props.topicSelected);
+ const {formatMessage} = this.props.intl;
+ const showCheckmark = Array.isArray(this.props.topicSelected);
+ const contactNodes = [];
if (this.props.contacts && this.props.contacts.length > 0) {
this.props.contacts.map((c) => {
var key = c.topic ? c.topic : c.user;
diff --git a/umd/index.dev.js b/umd/index.dev.js
index 2c61925b..8cced3ad 100644
--- a/umd/index.dev.js
+++ b/umd/index.dev.js
@@ -767,7 +767,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) *
/*! exports provided: en, ru, default */
/***/ (function(module) {
-eval("module.exports = {\"en\":{\"contacts_not_found\":\"You have no chats
¯\\\\\\\\_(ツ)_/¯\",\"full_name_prompt\":\"Full name, e.g. John Doe\",\"email_prompt\":\"Email, e.g. jdoe@example.com\",\"button_sign_up\":\"Sign up\",\"label_your_name\":\"Your name\",\"label_password\":\"Password\",\"password_unchanged_prompt\":\"Unchanged\",\"label_user_id\":\"Address:\",\"label_default_access_mode\":\"Default access mode:\",\"label_message_sound\":\"Message sound:\",\"label_push_notifications\":\"Notification alerts:\",\"label_push_notifications_disabled\":\"Notification alerts (requires HTTPS):\",\"title_tag_manager\":\"Tags (user discovery)\",\"button_logout\":\"Logout\",\"requested_permissions\":\"Requested\",\"granted_permissions\":\"Granted\",\"menu_item_edit_permissions\":\"Edit permissions\",\"label_other_user\":\"Other\",\"title_info\":\"Info\",\"label_topic_name\":\"Name\",\"label_private\":\"Private comment\",\"private_editing_placeholder\":\"Visible to you only\",\"label_muting_topic\":\"Muted:\",\"action_more\":\"More\",\"label_your_permissions\":\"Your permissions:\",\"label_permissions\":\"Permissions:\",\"label_you\":\"You:\",\"label_default_access\":\"Default access mode:\",\"label_group_members\":\"Group members:\",\"button_add_members\":\"Add members\",\"button_leave\":\"Leave\",\"group_has_no_members\":\"No members\",\"action_leave_chat\":\"Leave\",\"login_prompt\":\"Login\",\"password_prompt\":\"Password\",\"stay_logged_in\":\"Stay logged in\",\"forgot_password_link\":\"Forgot password?\",\"button_sign_in\":\"Sign in\",\"label_client\":\"Client:\",\"label_server\":\"Server:\",\"online_now\":\"online now\",\"last_seen_timestamp\":\"Last seen\",\"title_not_found\":\"Not found\",\"unnamed_topic\":\"Unnamed\",\"messages_not_readable\":\"no access to messages\",\"tabtitle_find_user\":\"find\",\"tabtitle_new_group\":\"new group\",\"tabtitle_group_by_id\":\"by id\",\"search_for_contacts\":\"Use search to find contacts\",\"new_password_placeholder\":\"Enter new password\",\"label_reset_password\":\"Send a password reset email:\",\"credential_email_prompt\":\"Your registration email\",\"button_reset\":\"Reset\",\"button_send_request\":\"Send request\",\"label_server_to_use\":\"Server to use:\",\"label_wire_transport\":\"Wire transport:\",\"button_update\":\"Update\",\"sidepanel_title_login\":\"Sign In\",\"sidepanel_title_register\":\"Create Account\",\"sidepanel_title_settings\":\"Settings\",\"sidepanel_title_edit_account\":\"Edit Account\",\"sidepanel_title_newtpk\":\"Start New Chat\",\"sidepanel_title_cred\":\"Confirm Credentials\",\"sidepanel_title_reset\":\"Reset Password\",\"phone_dative\":\"phone\",\"email_dative\":\"email\",\"enter_confirmation_code_prompt\":\"Enter confirmation code sent to you by {method}:\",\"numeric_confirmation_code_prompt\":\"Numbers only\",\"button_confirm\":\"Confirm\",\"invalid_content\":\"invalid content\",\"badge_you\":\"you\",\"badge_owner\":\"owner\",\"menu_item_info\":\"Info\",\"menu_item_clear_messages\":\"Clear messages\",\"menu_item_clear_messages_for_all\":\"Clear for All\",\"menu_item_delete\":\"Delete\",\"menu_item_delete_for_all\":\"Delete for All\",\"menu_item_mute\":\"Mute\",\"menu_item_unmute\":\"Unmute\",\"menu_item_delete_topic\":\"Delete\",\"menu_item_unblock\":\"Unblock\",\"menu_item_block\":\"Block\",\"menu_item_member_delete\":\"Remove\",\"action_cancel\":\"cancel\",\"upload_finishing\":\"finishing...\",\"no_contacts\":\"You have no contacts :-(\",\"contacts_not_found_short\":\"No contacts match '{query}'\",\"title_group_members\":\"Group Members\",\"title_all_contacts\":\"All Contacts\",\"button_ok\":\"OK\",\"button_cancel\":\"Cancel\",\"download_action\":\"download\",\"label_file_name\":\"File name:\",\"label_content_type\":\"Content type:\",\"label_size\":\"Size:\",\"error_invalid_id\":\"Invalid ID\",\"group_user_id_prompt\":\"Group or User ID\",\"button_subscribe\":\"Subscribe\",\"topic_name_editing_placeholder\":\"Freeform name of the group\",\"button_create\":\"Create\",\"permission_join\":\"Join ({val})\",\"permission_read\":\"Read ({val})\",\"permission_write\":\"Write ({val})\",\"permission_pres\":\"Get notified ({val})\",\"permission_admin\":\"Approve ({val})\",\"permission_share\":\"Share ({val})\",\"permission_delete\":\"Delete ({val})\",\"permission_owner\":\"Owner ({val})\",\"title_permissions\":\"Permissions\",\"message_sending\":\"sending...\",\"message_sending_failed\":\"failed\",\"search_placeholder\":\"List like email:alice@example.com, tel:17025550003...\",\"messaging_disabled_prompt\":\"Messaging disabled\",\"new_message_prompt\":\"New message\",\"file_attachment_too_large\":\"The file size {size} exceeds the {limit} limit.\",\"cannot_initiate_file_upload\":\"Cannot initiate file upload.\",\"tags_not_found\":\"No tags defined. Add some.\",\"tags_editor_no_tags\":\"Add some tags\",\"title_manage_tags\":\"Manage tags\"},\"ru\":{\"contacts_not_found\":\"Чатов нет
¯\\\\\\\\_(ツ)_/¯\",\"full_name_prompt\":\"Полное имя, напр. Иван Петров\",\"email_prompt\":\"Email, напр. ivan@example.com\",\"button_sign_up\":\"Создать счет\",\"label_your_name\":\"Ваше имя\",\"label_password\":\"Пароль\",\"password_unchanged_prompt\":\"Не изменен\",\"label_user_id\":\"Адрес:\",\"label_default_access_mode\":\"Доступ по умолчанию:\",\"label_message_sound\":\"Звук нового сообщения:\",\"label_push_notifications\":\"Уведомления:\",\"label_push_notifications_disabled\":\"Уведомления (требуют HTTPS):\",\"title_tag_manager\":\"Таги для поиска\",\"button_logout\":\"Выйти\",\"login_prompt\":\"Логин\",\"password_prompt\":\"Пароль\",\"stay_logged_in\":\"Запомнить\",\"forgot_password_link\":\"Напомнить пароль\",\"button_sign_in\":\"Войти\",\"label_client\":\"Клиент:\",\"label_server\":\"Сервер:\",\"online_now\":\"онлайн\",\"last_seen_timestamp\":\"Был активен\",\"title_not_found\":\"Не найден\",\"unnamed_topic\":\"Без названия\",\"messages_not_readable\":\"нет доступа к сообщениям\",\"tabtitle_find_user\":\"найти\",\"tabtitle_new_group\":\"создать\",\"tabtitle_group_by_id\":\"по id\",\"label_server_to_use\":\"Использовать сервер:\",\"label_wire_transport\":\"Соединение:\",\"button_update\":\"Применить\",\"sidepanel_title_login\":\"Авторизация\",\"sidepanel_title_register\":\"Зарегистрироваться\",\"sidepanel_title_settings\":\"Настройки\",\"sidepanel_title_edit_account\":\"Редактировать счет\",\"sidepanel_title_newtpk\":\"Новый чат\",\"sidepanel_title_cred\":\"Подтвердить\",\"sidepanel_title_reset\":\"Сменить пароль\",\"tags_not_found\":\"Тагов нет. Добавьте\",\"tags_editor_no_tags\":\"Добавьте таги\",\"title_manage_tags\":\"Редактор тагов\",\"message_sending\":\"в пути...\",\"message_sending_failed\":\"ошибка\",\"search_placeholder\":\"Список, напр. email:alice@example.com, tel:17025550003...\",\"messaging_disabled_prompt\":\"Отправка недоступна\",\"new_message_prompt\":\"Новое сообщение\",\"file_attachment_too_large\":\"Размер файла {size} превышает {limit} лимит.\",\"cannot_initiate_file_upload\":\"Ошибка загрузки файла.\",\"search_for_contacts\":\"Поиск контактов\",\"enter_confirmation_code_prompt\":\"Код подтверждения, полученный по {method}:\",\"numeric_confirmation_code_prompt\":\"Только цифры\",\"button_confirm\":\"Подтвердить\",\"button_ok\":\"OK\",\"button_cancel\":\"Отменить\",\"invalid_content\":\"сообщение не читается\",\"label_file_name\":\"Имя файла:\",\"label_content_type\":\"Тип:\",\"label_size\":\"Размер:\",\"phone_dative\":\"телефону\",\"email_dative\":\"емейлу\",\"title_group_members\":\"Участники\",\"download_action\":\"скачать\",\"permission_join\":\"Подписываться ({val})\",\"permission_read\":\"Читать ({val})\",\"permission_write\":\"Писать ({val})\",\"permission_pres\":\"Уведомлять ({val})\",\"permission_admin\":\"Подтверждать ({val})\",\"permission_share\":\"Приглашать ({val})\",\"permission_delete\":\"Удалять ({val})\",\"permission_owner\":\"Владелец ({val})\",\"title_permissions\":\"Права доступа\",\"requested_permissions\":\"Требуются\",\"granted_permissions\":\"Получены\",\"menu_item_edit_permissions\":\"Права доступа\",\"label_other_user\":\"Второй\",\"label_topic_name\":\"Название\",\"label_private\":\"Комментарий\",\"private_editing_placeholder\":\"Виден только вам\",\"label_muting_topic\":\"Без уведомлений\",\"action_more\":\"Ещё\",\"label_your_permissions\":\"Ваши права доступа:\",\"label_permissions\":\"Права доступа:\",\"label_you\":\"Вы:\",\"label_default_access\":\"Права по умолчанию:\",\"label_group_members\":\"Участники чата:\",\"button_add_members\":\"Добавить\",\"button_leave\":\"Отписаться\",\"group_has_no_members\":\"Нет участников\",\"action_leave_chat\":\"Уйти из чата\",\"menu_item_info\":\"Информация\",\"menu_item_clear_messages\":\"Удалить сообщения\",\"menu_item_clear_messages_for_all\":\"Удалить для всех\",\"menu_item_delete\":\"Удалить\",\"menu_item_delete_for_all\":\"Удалить для всех\",\"menu_item_mute\":\"Не уведомлять\",\"menu_item_unmute\":\"Уведомлять\",\"menu_item_delete_topic\":\"Удалить\",\"menu_item_unblock\":\"Разблокировать\",\"menu_item_block\":\"Заблокировать\",\"menu_item_member_delete\":\"Отписать\",\"title_info\":\"Подробности\",\"new_password_placeholder\":\"Введите новый пароль\",\"label_reset_password\":\"Отправить емейл для смены пароля:\",\"credential_email_prompt\":\"Регистрационный емейл\",\"button_reset\":\"Изменить\",\"button_send_request\":\"Отправить\",\"action_cancel\":\"отменить\",\"upload_finishing\":\"завершение...\",\"no_contacts\":\"Ничего нет :-(\",\"contacts_not_found_short\":\"Нет контактов для запроса '{query}'\",\"title_all_contacts\":\"Все контакты\",\"error_invalid_id\":\"Неверный ID\",\"group_user_id_prompt\":\"ID чата или пользователя\",\"button_subscribe\":\"Подписаться\",\"topic_name_editing_placeholder\":\"Название чата\",\"button_create\":\"Создать\"}};\n\n//# sourceURL=webpack:///./src/messages.json?");
+eval("module.exports = {\"en\":{\"contacts_not_found\":\"You have no chats
¯\\\\\\\\_(ツ)_/¯\",\"full_name_prompt\":\"Full name, e.g. John Doe\",\"email_prompt\":\"Email, e.g. jdoe@example.com\",\"button_sign_up\":\"Sign up\",\"label_your_name\":\"Your name\",\"label_password\":\"Password\",\"password_unchanged_prompt\":\"Unchanged\",\"label_user_id\":\"Address:\",\"label_default_access_mode\":\"Default access mode:\",\"label_message_sound\":\"Message sound:\",\"label_push_notifications\":\"Notification alerts:\",\"label_push_notifications_disabled\":\"Notification alerts (requires HTTPS):\",\"title_tag_manager\":\"Tags (user discovery)\",\"button_logout\":\"Logout\",\"requested_permissions\":\"Requested\",\"granted_permissions\":\"Granted\",\"menu_item_edit_permissions\":\"Edit permissions\",\"label_other_user\":\"Other\",\"title_info\":\"Info\",\"label_topic_name\":\"Name\",\"label_private\":\"Private comment\",\"private_editing_placeholder\":\"Visible to you only\",\"label_muting_topic\":\"Muted:\",\"action_more\":\"More\",\"label_your_permissions\":\"Your permissions:\",\"label_permissions\":\"Permissions:\",\"label_you\":\"You:\",\"label_default_access\":\"Default access mode:\",\"label_group_members\":\"Group members:\",\"button_add_members\":\"Add members\",\"button_leave\":\"Leave\",\"group_has_no_members\":\"No members\",\"action_leave_chat\":\"Leave\",\"login_prompt\":\"Login\",\"password_prompt\":\"Password\",\"stay_logged_in\":\"Stay logged in\",\"forgot_password_link\":\"Forgot password?\",\"button_sign_in\":\"Sign in\",\"label_client\":\"Client:\",\"label_server\":\"Server:\",\"online_now\":\"online now\",\"last_seen_timestamp\":\"Last seen\",\"title_not_found\":\"Not found\",\"unnamed_topic\":\"Unnamed\",\"messages_not_readable\":\"no access to messages\",\"tabtitle_find_user\":\"find\",\"tabtitle_new_group\":\"new group\",\"tabtitle_group_by_id\":\"by id\",\"search_for_contacts\":\"Use search to find contacts\",\"new_password_placeholder\":\"Enter new password\",\"label_reset_password\":\"Send a password reset email:\",\"credential_email_prompt\":\"Your registration email\",\"button_reset\":\"Reset\",\"button_send_request\":\"Send request\",\"label_server_to_use\":\"Server to use:\",\"label_wire_transport\":\"Wire transport:\",\"button_update\":\"Update\",\"sidepanel_title_login\":\"Sign In\",\"sidepanel_title_register\":\"Create Account\",\"sidepanel_title_settings\":\"Settings\",\"sidepanel_title_edit_account\":\"Edit Account\",\"sidepanel_title_newtpk\":\"Start New Chat\",\"sidepanel_title_cred\":\"Confirm Credentials\",\"sidepanel_title_reset\":\"Reset Password\",\"phone_dative\":\"phone\",\"email_dative\":\"email\",\"enter_confirmation_code_prompt\":\"Enter confirmation code sent to you by {method}:\",\"numeric_confirmation_code_prompt\":\"Numbers only\",\"button_confirm\":\"Confirm\",\"invalid_content\":\"invalid content\",\"badge_you\":\"you\",\"badge_owner\":\"owner\",\"menu_item_info\":\"Info\",\"menu_item_clear_messages\":\"Clear messages\",\"menu_item_clear_messages_for_all\":\"Clear for All\",\"menu_item_delete\":\"Delete\",\"menu_item_delete_for_all\":\"Delete for All\",\"menu_item_mute\":\"Mute\",\"menu_item_unmute\":\"Unmute\",\"menu_item_delete_topic\":\"Delete\",\"menu_item_unblock\":\"Unblock\",\"menu_item_block\":\"Block\",\"menu_item_member_delete\":\"Remove\",\"action_cancel\":\"cancel\",\"upload_finishing\":\"finishing...\",\"no_contacts\":\"You have no contacts :-(\",\"contacts_not_found_short\":\"No contacts match '{query}'\",\"title_group_members\":\"Group Members\",\"title_all_contacts\":\"All Contacts\",\"button_ok\":\"OK\",\"button_cancel\":\"Cancel\",\"download_action\":\"download\",\"label_file_name\":\"File name:\",\"label_content_type\":\"Content type:\",\"label_size\":\"Size:\",\"error_invalid_id\":\"Invalid ID\",\"group_user_id_prompt\":\"Group or User ID\",\"button_subscribe\":\"Subscribe\",\"topic_name_editing_placeholder\":\"Freeform name of the group\",\"button_create\":\"Create\",\"permission_join\":\"Join ({val})\",\"permission_read\":\"Read ({val})\",\"permission_write\":\"Write ({val})\",\"permission_pres\":\"Get notified ({val})\",\"permission_admin\":\"Approve ({val})\",\"permission_share\":\"Share ({val})\",\"permission_delete\":\"Delete ({val})\",\"permission_owner\":\"Owner ({val})\",\"title_permissions\":\"Permissions\",\"message_sending\":\"sending...\",\"message_sending_failed\":\"failed\",\"search_placeholder\":\"List like email:alice@example.com, tel:17025550003...\",\"messaging_disabled_prompt\":\"Messaging disabled\",\"new_message_prompt\":\"New message\",\"file_attachment_too_large\":\"The file size {size} exceeds the {limit} limit.\",\"cannot_initiate_file_upload\":\"Cannot initiate file upload.\",\"tags_not_found\":\"No tags defined. Add some.\",\"tags_editor_no_tags\":\"Add some tags\",\"title_manage_tags\":\"Manage tags\"},\"ru\":{\"contacts_not_found\":\"Чатов нет
¯\\\\\\\\_(ツ)_/¯\",\"full_name_prompt\":\"Полное имя, напр. Иван Петров\",\"email_prompt\":\"Email, напр. ivan@example.com\",\"button_sign_up\":\"Создать счет\",\"label_your_name\":\"Ваше имя\",\"label_password\":\"Пароль\",\"password_unchanged_prompt\":\"Не изменен\",\"label_user_id\":\"Адрес:\",\"label_default_access_mode\":\"Доступ по умолчанию:\",\"label_message_sound\":\"Звук нового сообщения:\",\"label_push_notifications\":\"Уведомления:\",\"label_push_notifications_disabled\":\"Уведомления (требуют HTTPS):\",\"title_tag_manager\":\"Таги для поиска\",\"button_logout\":\"Выйти\",\"login_prompt\":\"Логин\",\"password_prompt\":\"Пароль\",\"stay_logged_in\":\"Запомнить\",\"forgot_password_link\":\"Напомнить пароль\",\"button_sign_in\":\"Войти\",\"label_client\":\"Клиент:\",\"label_server\":\"Сервер:\",\"online_now\":\"онлайн\",\"last_seen_timestamp\":\"Был активен\",\"title_not_found\":\"Не найден\",\"unnamed_topic\":\"Без названия\",\"messages_not_readable\":\"нет доступа к сообщениям\",\"tabtitle_find_user\":\"найти\",\"tabtitle_new_group\":\"создать\",\"tabtitle_group_by_id\":\"по id\",\"label_server_to_use\":\"Использовать сервер:\",\"label_wire_transport\":\"Соединение:\",\"button_update\":\"Применить\",\"sidepanel_title_login\":\"Авторизация\",\"sidepanel_title_register\":\"Зарегистрироваться\",\"sidepanel_title_settings\":\"Настройки\",\"sidepanel_title_edit_account\":\"Редактировать счет\",\"sidepanel_title_newtpk\":\"Новый чат\",\"sidepanel_title_cred\":\"Подтвердить\",\"sidepanel_title_reset\":\"Сменить пароль\",\"tags_not_found\":\"Тагов нет. Добавьте\",\"tags_editor_no_tags\":\"Добавьте таги\",\"title_manage_tags\":\"Редактор тагов\",\"message_sending\":\"в пути...\",\"message_sending_failed\":\"ошибка\",\"search_placeholder\":\"Список, напр. email:alice@example.com, tel:17025550003...\",\"messaging_disabled_prompt\":\"Отправка недоступна\",\"new_message_prompt\":\"Новое сообщение\",\"file_attachment_too_large\":\"Размер файла {size} превышает {limit} лимит.\",\"cannot_initiate_file_upload\":\"Ошибка загрузки файла.\",\"search_for_contacts\":\"Поиск контактов\",\"enter_confirmation_code_prompt\":\"Код подтверждения, полученный по {method}:\",\"numeric_confirmation_code_prompt\":\"Только цифры\",\"button_confirm\":\"Подтвердить\",\"button_ok\":\"OK\",\"button_cancel\":\"Отменить\",\"invalid_content\":\"сообщение не читается\",\"label_file_name\":\"Имя файла:\",\"label_content_type\":\"Тип:\",\"label_size\":\"Размер:\",\"phone_dative\":\"телефону\",\"email_dative\":\"емейлу\",\"title_group_members\":\"Участники\",\"download_action\":\"скачать\",\"permission_join\":\"Подписываться ({val})\",\"permission_read\":\"Читать ({val})\",\"permission_write\":\"Писать ({val})\",\"permission_pres\":\"Уведомлять ({val})\",\"permission_admin\":\"Подтверждать ({val})\",\"permission_share\":\"Приглашать ({val})\",\"permission_delete\":\"Удалять ({val})\",\"permission_owner\":\"Владелец ({val})\",\"title_permissions\":\"Права доступа\",\"requested_permissions\":\"Требуются\",\"granted_permissions\":\"Получены\",\"menu_item_edit_permissions\":\"Права доступа\",\"label_other_user\":\"Второй\",\"label_topic_name\":\"Название\",\"label_private\":\"Комментарий\",\"private_editing_placeholder\":\"Виден только вам\",\"label_muting_topic\":\"Без уведомлений\",\"action_more\":\"Ещё\",\"label_your_permissions\":\"Ваши права доступа:\",\"label_permissions\":\"Права доступа:\",\"label_you\":\"Вы:\",\"label_default_access\":\"Права по умолчанию:\",\"label_group_members\":\"Участники чата:\",\"button_add_members\":\"Добавить\",\"button_leave\":\"Отписаться\",\"group_has_no_members\":\"Нет участников\",\"action_leave_chat\":\"Уйти из чата\",\"menu_item_info\":\"Информация\",\"menu_item_clear_messages\":\"Удалить сообщения\",\"menu_item_clear_messages_for_all\":\"Удалить для всех\",\"menu_item_delete\":\"Удалить\",\"menu_item_delete_for_all\":\"Удалить для всех\",\"menu_item_mute\":\"Не уведомлять\",\"menu_item_unmute\":\"Уведомлять\",\"menu_item_delete_topic\":\"Удалить\",\"menu_item_unblock\":\"Разблокировать\",\"menu_item_block\":\"Заблокировать\",\"menu_item_member_delete\":\"Отписать\",\"title_info\":\"Подробности\",\"new_password_placeholder\":\"Введите новый пароль\",\"label_reset_password\":\"Отправить емейл для смены пароля:\",\"credential_email_prompt\":\"Регистрационный емейл\",\"button_reset\":\"Изменить\",\"button_send_request\":\"Отправить\",\"action_cancel\":\"отменить\",\"upload_finishing\":\"завершение...\",\"no_contacts\":\"Ничего нет :-(\",\"contacts_not_found_short\":\"Нет контактов для запроса '{query}'\",\"title_all_contacts\":\"Все контакты\",\"error_invalid_id\":\"Неверный ID\",\"group_user_id_prompt\":\"ID чата или пользователя\",\"button_subscribe\":\"Подписаться\",\"topic_name_editing_placeholder\":\"Название чата\",\"button_create\":\"Создать\",\"badge_you\":\"вы\",\"badge_owner\":\"влад.\"}};\n\n//# sourceURL=webpack:///./src/messages.json?");
/***/ }),
@@ -1031,7 +1031,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) *
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
-eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-intl */ \"./node_modules/react-intl/lib/index.es.js\");\n/* harmony import */ var _contact_jsx__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./contact.jsx */ \"./src/widgets/contact.jsx\");\n/* harmony import */ var _lib_blob_helpers_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../lib/blob-helpers.js */ \"./src/lib/blob-helpers.js\");\nfunction _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\n\n\n\n\nvar messages = Object(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"defineMessages\"])({\n badge_you: {\n \"id\": \"badge_you\",\n \"defaultMessage\": \"you\"\n },\n badge_owner: {\n \"id\": \"badge_owner\",\n \"defaultMessage\": \"owner\"\n }\n});\n\nvar ContactList = function (_React$Component) {\n _inherits(ContactList, _React$Component);\n\n function ContactList() {\n _classCallCheck(this, ContactList);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(ContactList).apply(this, arguments));\n }\n\n _createClass(ContactList, [{\n key: \"render\",\n value: function render() {\n var _this = this;\n\n var contactNodes = [];\n var showCheckmark = Array.isArray(this.props.topicSelected);\n\n if (this.props.contacts && this.props.contacts.length > 0) {\n this.props.contacts.map(function (c) {\n var key = c.topic ? c.topic : c.user;\n\n if (_this.props.filterFunc && _this.props.filter) {\n var content = [key];\n\n if (c.private && c.private.comment) {\n content.push(('' + c.private.comment).toLowerCase());\n }\n\n if (c.public && c.public.fn) {\n content.push(('' + c.public.fn).toLowerCase());\n }\n\n if (!_this.props.filterFunc(_this.props.filter, content)) {\n return;\n }\n }\n\n var selected = showCheckmark ? _this.props.topicSelected.indexOf(key) > -1 : _this.props.topicSelected === key;\n var badges = [];\n\n if (_this.props.showMode) {\n if (key === _this.props.myUserId) {\n badges.push({\n name: formatMessage(messages.badge_you),\n color: 'green'\n });\n }\n\n if (c.acs && c.acs.isOwner()) {\n badges.push({\n name: formatMessage(messages.badge_owner),\n color: 'blue'\n });\n }\n }\n\n var comment = Array.isArray(c.private) ? c.private.join(',') : c.private ? c.private.comment : null;\n contactNodes.push(react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_contact_jsx__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n title: c.public ? c.public.fn : null,\n avatar: Object(_lib_blob_helpers_js__WEBPACK_IMPORTED_MODULE_3__[\"makeImageUrl\"])(c.public ? c.public.photo : null),\n comment: comment,\n unread: _this.props.showUnread ? c.unread : 0,\n now: c.online && _this.props.connected,\n acs: c.acs,\n showMode: _this.props.showMode,\n badges: badges,\n showCheckmark: showCheckmark,\n selected: selected,\n showOnline: _this.props.showOnline,\n onSelected: _this.props.onTopicSelected,\n showContextMenu: _this.props.showContextMenu,\n item: key,\n index: contactNodes.length,\n key: key\n }));\n }, this);\n }\n\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: this.props.noScroll ? null : \"scrollable-panel\"\n }, contactNodes.length > 0 ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"ul\", {\n className: \"contact-box\"\n }, contactNodes) : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"center-medium-text\"\n }, this.props.emptyListMessage));\n }\n }]);\n\n return ContactList;\n}(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component);\n\n;\n/* harmony default export */ __webpack_exports__[\"default\"] = (Object(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"injectIntl\"])(ContactList));\n\n//# sourceURL=webpack:///./src/widgets/contact-list.jsx?");
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-intl */ \"./node_modules/react-intl/lib/index.es.js\");\n/* harmony import */ var _contact_jsx__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./contact.jsx */ \"./src/widgets/contact.jsx\");\n/* harmony import */ var _lib_blob_helpers_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../lib/blob-helpers.js */ \"./src/lib/blob-helpers.js\");\nfunction _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\n\n\n\n\nvar messages = Object(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"defineMessages\"])({\n badge_you: {\n \"id\": \"badge_you\",\n \"defaultMessage\": \"you\"\n },\n badge_owner: {\n \"id\": \"badge_owner\",\n \"defaultMessage\": \"owner\"\n }\n});\n\nvar ContactList = function (_React$Component) {\n _inherits(ContactList, _React$Component);\n\n function ContactList() {\n _classCallCheck(this, ContactList);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(ContactList).apply(this, arguments));\n }\n\n _createClass(ContactList, [{\n key: \"render\",\n value: function render() {\n var _this = this;\n\n var formatMessage = this.props.intl.formatMessage;\n var showCheckmark = Array.isArray(this.props.topicSelected);\n var contactNodes = [];\n\n if (this.props.contacts && this.props.contacts.length > 0) {\n this.props.contacts.map(function (c) {\n var key = c.topic ? c.topic : c.user;\n\n if (_this.props.filterFunc && _this.props.filter) {\n var content = [key];\n\n if (c.private && c.private.comment) {\n content.push(('' + c.private.comment).toLowerCase());\n }\n\n if (c.public && c.public.fn) {\n content.push(('' + c.public.fn).toLowerCase());\n }\n\n if (!_this.props.filterFunc(_this.props.filter, content)) {\n return;\n }\n }\n\n var selected = showCheckmark ? _this.props.topicSelected.indexOf(key) > -1 : _this.props.topicSelected === key;\n var badges = [];\n\n if (_this.props.showMode) {\n if (key === _this.props.myUserId) {\n badges.push({\n name: formatMessage(messages.badge_you),\n color: 'green'\n });\n }\n\n if (c.acs && c.acs.isOwner()) {\n badges.push({\n name: formatMessage(messages.badge_owner),\n color: 'blue'\n });\n }\n }\n\n var comment = Array.isArray(c.private) ? c.private.join(',') : c.private ? c.private.comment : null;\n contactNodes.push(react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_contact_jsx__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n title: c.public ? c.public.fn : null,\n avatar: Object(_lib_blob_helpers_js__WEBPACK_IMPORTED_MODULE_3__[\"makeImageUrl\"])(c.public ? c.public.photo : null),\n comment: comment,\n unread: _this.props.showUnread ? c.unread : 0,\n now: c.online && _this.props.connected,\n acs: c.acs,\n showMode: _this.props.showMode,\n badges: badges,\n showCheckmark: showCheckmark,\n selected: selected,\n showOnline: _this.props.showOnline,\n onSelected: _this.props.onTopicSelected,\n showContextMenu: _this.props.showContextMenu,\n item: key,\n index: contactNodes.length,\n key: key\n }));\n }, this);\n }\n\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: this.props.noScroll ? null : \"scrollable-panel\"\n }, contactNodes.length > 0 ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"ul\", {\n className: \"contact-box\"\n }, contactNodes) : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"center-medium-text\"\n }, this.props.emptyListMessage));\n }\n }]);\n\n return ContactList;\n}(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component);\n\n;\n/* harmony default export */ __webpack_exports__[\"default\"] = (Object(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"injectIntl\"])(ContactList));\n\n//# sourceURL=webpack:///./src/widgets/contact-list.jsx?");
/***/ }),
diff --git a/umd/index.prod.js b/umd/index.prod.js
index 7d8a5d99..9995ad72 100644
--- a/umd/index.prod.js
+++ b/umd/index.prod.js
@@ -13,7 +13,7 @@ MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
-var r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};function o(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}function l(e,t){return function(n,r){t(n,r,e)}}function u(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function c(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{l(r.next(e))}catch(e){i(e)}}function s(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(a,s)}l((r=r.apply(e,t||[])).next())})}function d(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=r[2&i[0]?"return":i[0]?"throw":"next"])&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[0,o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}function h(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function m(){for(var e=[],t=0;t1||s(e,t)})})}function s(e,t){try{!function(e){e.value instanceof y?Promise.resolve(e.value.v).then(l,u):c(i[0][2],e)}(o[e](t))}catch(e){c(i[0][3],e)}}function l(e){s("next",e)}function u(e){s("throw",e)}function c(e,t){e(t),i.shift(),i.length&&s(i[0][0],i[0][1])}}function g(e){var t,n;return t={},r("next"),r("throw",function(e){throw e}),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,o){e[r]&&(t[r]=function(t){return(n=!n)?{value:y(e[r](t)),done:"return"===r}:o?o(t):t})}}function b(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator];return t?t.call(e):f(e)}function _(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function w(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function E(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){(function(t){e.exports=function(){var e={},n=[{name:"ST",start:/(?:^|\W)(\*)[^\s*]/,end:/[^\s*](\*)(?=$|\W)/},{name:"EM",start:/(?:^|[\W_])(_)[^\s_]/,end:/[^\s_](_)(?=$|[\W_])/},{name:"DL",start:/(?:^|\W)(~)[^\s~]/,end:/[^\s~](~)(?=$|\W)/},{name:"CO",start:/(?:^|\W)(`)[^`]/,end:/[^`](`)(?=$|\W)/}],r=[{name:"LN",dataName:"url",pack:function(e){return/^[a-z]+:\/\//i.test(e)||(e="http://"+e),{url:e}},re:/(?:(?:https?|ftp):\/\/|www\.|ftp\.)[-A-Z0-9+&@#\/%=~_|$?!:,.]*[A-Z0-9+&@#\/%=~_|$]/gi},{name:"MN",dataName:"val",pack:function(e){return{val:e.slice(1)}},re:/\B@(\w\w+)/g},{name:"HT",dataName:"val",pack:function(e){return{val:e.slice(1)}},re:/\B#(\w\w+)/g}],o={ST:{name:"b",isVoid:!1},EM:{name:"i",isVoid:!1},DL:{name:"del",isVoid:!1},CO:{name:"tt",isVoid:!1},BR:{name:"br",isVoid:!0},LN:{name:"a",isVoid:!1},MN:{name:"a",isVoid:!1},HT:{name:"a",isVoid:!1},IM:{name:"img",isVoid:!0}};function i(e,t){var n;try{n=atob(e)}catch(e){console.log("Drafty: failed to decode base64-encoded object",e.message),n=atob("")}for(var r=n.length,o=new ArrayBuffer(r),i=new Uint8Array(o),a=0;a"},close:function(){return""}},EM:{open:function(){return""},close:function(){return""}},DL:{open:function(){return""},close:function(){return""}},CO:{open:function(){return""},close:function(){return""}},BR:{open:function(){return""},close:function(){return"
"}},LN:{open:function(e){return''},close:function(e){return""},props:function(e){return{href:e.url,target:"_blank"}}},MN:{open:function(e){return''},close:function(e){return""},props:function(e){return{name:e.val}}},HT:{open:function(e){return''},close:function(e){return""},props:function(e){return{name:e.val}}},IM:{open:function(e){var t=i(e.val,e.mime),n=e.ref?e.ref:t,r=(e.name?'':"")+'
';return console.log("open: "+r),r},close:function(e){return e.name?"":""},props:function(e){return{src:i(e.val,e.mime),title:e.name,"data-width":e.width,"data-height":e.height,"data-name":e.name,"data-size":.75*e.val.length|0,"data-mime":e.mime}}}},s=function(){};s.parse=function(e){if("string"!=typeof e)return null;var t=e.split(/\r?\n/),o=[],i={},a=[];t.map(function(e){var t,s,l=[];if(n.map(function(t){l=l.concat(function(e,t,n,r){for(var o=[],i=0,a=e.slice(0);a.length>0;){var s=t.exec(a);if(null==s)break;var l=s.index+s[0].lastIndexOf(s[1]);a=a.slice(l+1),i=(l+=i)+1;var u=n?n.exec(a):null;if(null==u)break;var c=u.index+u[0].indexOf(u[1]);a=a.slice(c+1),i=(c+=i)+1,o.push({text:e.slice(l+1,c),children:[],start:l,end:c,type:r})}return o}(e,t.start,t.end,t.name))}),0==l.length)s={txt:e};else{l.sort(function(e,t){return e.start-t.start}),l=function e(t){if(0==t.length)return[];for(var n=[t[0]],r=t[0],o=1;or.end?(n.push(t[o]),r=t[o]):t[o].endn&&i.push({text:t.slice(n,s.start)});var l={type:s.type},u=e(t,s.start+1,s.end-1,s.children);u.length>0?l.children=u:l.text=s.text,i.push(l),n=s.end+1}return no;return o=e.offset+e.len,t})}(s.txt)).length>0){var c=[];for(var d in t){var p=t[d],f=i[p.unique];f||(f=o.length,i[p.unique]=f,o.push({tp:p.type,data:p.data})),c.push({at:p.offset,len:p.len,key:f})}s.ent=c}a.push(s)});var s={txt:""};if(a.length>0){s.txt=a[0].txt,s.fmt=(a[0].fmt||[]).concat(a[0].ent||[]);for(var l=1;l0&&(s.ent=o)}return s},s.insertImage=function(e,t,n,r,o,i,a,s,l){return(e=e||{txt:" "}).ent=e.ent||[],e.fmt=e.fmt||[],e.fmt.push({at:t,len:1,key:e.ent.length}),e.ent.push({tp:"IM",data:{mime:n,val:r,width:o,height:i,name:a,ref:l,size:0|s}}),e},s.attachFile=function(e,t,n,r,o,i){(e=e||{txt:""}).ent=e.ent||[],e.fmt=e.fmt||[],e.fmt.push({at:-1,len:0,key:e.ent.length});var a={tp:"EX",data:{mime:t,val:n,name:r,ref:i,size:0|o}};return i instanceof Promise&&(a.data.ref=i.then(function(e){a.data.ref=e},function(e){})),e.ent.push(a),e},s.UNSAFE_toHTML=function(e){var t,n,r,o=e.txt,i=e.fmt,s=e.ent,l=[];if(i)for(var u in i){var c,d=i[u],p=d.tp;if(!p){var f=s[d.key];f&&(p=f.tp,c=f.data)}a[p]&&(l.push({idx:d.at+d.len,what:a[p].close(c)}),l.push({idx:d.at,what:a[p].open(c)}))}for(var u in l.sort(function(e,t){return t.idx-e.idx}),l)l[u].what&&(t=o,n=l[u].idx,r=l[u].what,o=t.slice(0,n)+r+t.slice(n));return o},s.format=function(e,t,n){var r=e.txt,i=e.fmt,a=e.ent;if(r=r||"",!i)return[r];var s=[].concat(i);return s.map(function(e){e.at=e.at||0,e.len=e.len||0}),s.sort(function(e,t){return e.at-t.at==0?t.len-e.len:e.at-t.at}),s=s.map(function(e){var t,n=e.tp;return n||(e.key=e.key||0,t=a[e.key].data,n=a[e.key].tp),{tp:n,data:t,at:e.at,len:e.len}}),function e(t,n,r,i,a,s){for(var l=[],u=0;u0)for(var t in e.ent)if("EX"==e.ent[t].tp)return!0;return!1},s.attachments=function(e,t,n){if(e.ent&&e.ent.length>0)for(var r in e.ent)"EX"==e.ent[r].tp&&t.call(n,e.ent[r].data,r)},s.getDownloadUrl=function(e){var t=null;return e.val?t=i(e.val,e.mime):"string"==typeof e.ref&&(t=e.ref),t},s.isUploading=function(e){return e.ref instanceof Promise},s.getPreviewUrl=function(e){return e.val?i(e.val,e.mime):null},s.getEntitySize=function(e){return e.size?e.size:e.val?.75*e.val.length|0:0},s.getEntityMimeType=function(e){return e.mime||"text/plain"},s.tagName=function(e){return o[e]?o[e].name:void 0},s.attrValue=function(e,t){if(t&&a[e])return a[e].props(t)},s.getContentType=function(){return"text/x-drafty"},e=s;var l={};return function(t){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var r,o="0.15.8-rc1";"undefined"!=typeof WebSocket&&(r=WebSocket),"undefined"==typeof btoa&&(t.btoa=function(){for(var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n="",r=0,o=0,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";t.charAt(0|o)||(i="=",o%1);n+=i.charAt(63&r>>8-o%1*8)){if((e=t.charCodeAt(o+=.75))>255)throw new Error("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");r=r<<8|e}return n}),"undefined"==typeof atob&&(t.atob=function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").replace(/=+$/,""),t="";if(e.length%4==1)throw new Error("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,r=0,o=0,i=0;n=e.charAt(i++);~n&&(o=r%4?64*o+n:n,r++%4)?t+=String.fromCharCode(255&o>>(-2*r&6)):0)n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(n);return t}),"undefined"==typeof window&&(t.window={WebSocket:r,URL:{createObjectURL:function(){throw new Error("Unable to use window.URL in a non browser application")}}});var i="0",a=o||"0.15",s="tinodejs/"+a,u=503,c="Connection failed";function d(e){return btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,function(e,t){return String.fromCharCode("0x"+t)}))}function p(e,t,r){if(null==t)return e;if("object"!==n(t))return t||e;if(t instanceof Date)return t;if(t instanceof w)return new w(t);if(t instanceof Array)return t.length>0?t:e;for(var o in e||(e=t.constructor()),t)!t.hasOwnProperty(o)||!t[o]&&!1!==t[o]||r&&r[o]||"_generated"==o||(e[o]=p(e[o],t[o]));return e}function f(e,t,n,r){return e[t]=p(e[t],n,r),e[t]}function h(){var e=null;if("withCredentials"in new XMLHttpRequest)e=new XMLHttpRequest;else{if("undefined"==typeof XDomainRequest)throw new Error("browser not supported");e=new XDomainRequest}return e}function m(e,t){if("ts"===e&&"string"==typeof t&&t.length>=20&&t.length<=24){var r=new Date(t);if(r)return r}else if("acs"===e&&"object"===n(t))return new w(t);return t}function y(e,t){return"string"==typeof t&&t.length>128?"<"+t.length+", bytes: "+t.substring(0,12)+"..."+t.substring(t.length-12)+">":function(e,t){if(t instanceof Date)t=function(e){if(e&&0!=e.getTime()){var t=e.getUTCMilliseconds();return e.getUTCFullYear()+"-"+n(e.getUTCMonth()+1)+"-"+n(e.getUTCDate())+"T"+n(e.getUTCHours())+":"+n(e.getUTCMinutes())+":"+n(e.getUTCSeconds())+(t?"."+n(t,3):"")+"Z"}function n(e,t){return"0".repeat((t=t||2)-(""+e).length)+e}}(t);else if(null==t||!1===t||Array.isArray(t)&&0==t.length||"object"===n(t)&&0===Object.keys(t).length)return;return t}(0,t)}function v(e,t,n){var r=null;return"http"!==t&&"https"!==t&&"ws"!==t&&"wss"!==t||(r=t+"://","/"!==(r+=e).charAt(r.length-1)&&(r+="/"),r+="v"+i+"/channels","http"!==t&&"https"!==t||(r+="/lp"),r+="?apikey="+n),r}var g=function(e,t,o,i,a){var s=this,l=e,d=i,p=t,f=a,y=2e3,g=10,b=.3,_=null,w=0,E=!1,S=function(e){s.logger&&s.logger(e)};function T(e){var t=null;e.connect=function(n){return t&&1===t.readyState?Promise.resolve():(n&&(l=n),new Promise(function(n,o){var i=v(l,d?"wss":"ws",p);S("Connecting to: "+i);var a=new r(i);a.onopen=function(t){E=!1,e.onOpen&&e.onOpen(),n(),f&&(clearTimeout(_),_=null,w=0)},a.onclose=function(n){t=null,e.onDisconnect&&e.onDisconnect(null),!E&&f&&function(){var e=this;clearTimeout(_);var t=y*(Math.pow(2,w)*(1+b*Math.random()));w=w>=g?w:w+1,_=setTimeout(function(){S("Reconnecting, iter="+w+", timeout="+t),E||e.connect().catch(function(){})},t)}.call(e)},a.onerror=function(e){o(e)},a.onmessage=function(t){e.onMessage&&e.onMessage(t.data)},t=a}))},e.disconnect=function(){t&&(E=!0,t.close()),t=null},e.sendText=function(e){if(!t||t.readyState!=t.OPEN)throw new Error("Websocket is not connected");t.send(e)},e.isConnected=function(){return t&&1===t.readyState},e.transport=function(){return"ws"}}function k(e){var t=null,n=null,r=null;e.connect=function(r){return n?Promise.resolve():(r&&(l=r),new Promise(function(r,o){var i=v(l,d?"https":"http",p);S("Connecting to: "+i),(n=function n(r,o,i){var a=h();return a.onreadystatechange=function(s){if(4==a.readyState)if(201==a.status){var l=JSON.parse(a.responseText,m);a.responseText,t=r+"&sid="+l.ctrl.params.sid,(a=n(t)).send(null),e.onOpen&&e.onOpen(),o&&o()}else if(200==a.status)e.onMessage&&e.onMessage(a.responseText),(a=n(t)).send(null);else if(i&&i(a.responseText),e.onMessage&&a.responseText&&e.onMessage(a.responseText),e.onDisconnect){var d=a.status||u,p=a.responseText||c;e.onDisconnect(new Error(p+"("+d+")"))}},a.open("GET",r,!0),a}(i,r,o)).send(null)}).catch(function(){}))},e.disconnect=function(){r&&(r.onreadystatechange=void 0,r.abort(),r=null),n&&(n.onreadystatechange=void 0,n.abort(),n=null),e.onDisconnect&&e.onDisconnect(null),t=null},e.sendText=function(e){var n,o;if(n=t,(o=h()).onreadystatechange=function(e){if(4==o.readyState&&o.status>=400)throw new Error("LP sender failed, "+o.status)},o.open("POST",n,!0),!(r=o)||1!=r.readyState)throw new Error("Long poller failed to connect");r.send(e)},e.isConnected=function(){return n&&!0},e.transport=function(){return"lp"}}"lp"===o?k(this):"ws"===o?T(this):"object"==("undefined"==typeof window?"undefined":n(window))&&window.WebSocket?T(this):k(this),this.onMessage=void 0,this.onDisconnect=void 0,this.onOpen=void 0,this.logger=void 0},b=function(e,t,r,o,i){var l=this;this._appName=e||"Undefined",this._apiKey=r,this._browser="",this._platform="undefined",this._humanLanguage="xx","undefined"!=typeof navigator&&(this._browser=function(e){var t,n=(e=(e||"").replace(" (KHTML, like Gecko)","")).match(/(AppleWebKit\/[.\d]+)/i);if(n){for(var r=["chrome","safari","mobile","version"],o=e.substr(n.index+n[0].length).split(" "),i=[],a=0;a0?i[0][0]+"/"+i[0][1]:n[1]}else t=/trident/i.test(e)?(n=/(?:\brv[ :]+([.\d]+))|(?:\bMSIE ([.\d]+))/g.exec(e))?"MSIE/"+(n[1]||n[2]):"MSIE/?":/firefox/i.test(e)?(n=/Firefox\/([.\d]+)/g.exec(e))?"Firefox/"+n[1]:"Firefox/?":/presto/i.test(e)?(n=/Opera\/([.\d]+)/g.exec(e))?"Opera/"+n[1]:"Opera/?":(n=/([\w.]+)\/([.\d]+)/.exec(e))?n[1]+"/"+n[2]:(n=e.split(" "))[0];if((n=t.split("/")).length>1){var l=n[1].split(".");t=n[0]+"/"+l[0]+(l[1]?"."+l[1]:"")}return t}(navigator.userAgent),this._platform=navigator.platform,this._humanLanguage=navigator.language||"en-US"),this._loggingEnabled=!1,this._trimLongStrings=!1,this._myUID=null,this._authenticated=!1,this._login=null,this._authToken=null,this._inPacketCount=0,this._messageId=Math.floor(65535*Math.random()+65535),this._serverInfo=null,this._deviceToken=null,this._pendingPromises={},this._connection=new g(t,r,o,i,!0),this.logger=function(e){if(l._loggingEnabled){var t=new Date,n=("0"+t.getUTCHours()).slice(-2)+":"+("0"+t.getUTCMinutes()).slice(-2)+":"+("0"+t.getUTCSeconds()).slice(-2)+":"+("0"+t.getUTCMilliseconds()).slice(-3);console.log("["+n+"] "+e)}},this._connection.logger=this.logger,this._cache={};var d=this.cachePut=function(e,t,n){l._cache[e+":"+t]=n},f=this.cacheGet=function(e,t){return l._cache[e+":"+t]},h=this.cacheDel=function(e,t){delete l._cache[e+":"+t]},v=this.cacheMap=function(e,t){for(var n in l._cache)if(e(l._cache[n],n,t))break};this.attachCacheToTopic=function(e){e._tinode=l,e._cacheGetUser=function(e){var t=f("user",e);if(t)return{user:e,public:p({},t)}},e._cachePutUser=function(e,t){return d("user",e,p({},t.public))},e._cacheDelUser=function(e){return h("user",e)},e._cachePutSelf=function(){return d("topic",e.name,e)},e._cacheDelSelf=function(){return h("topic",e.name)}};var b=function(e,t,n,r){var o=l._pendingPromises[e];o&&(delete l._pendingPromises[e],t>=200&&t<400?o.resolve&&o.resolve(n):o.reject&&o.reject(new Error("Error: "+r+" ("+t+")")))},_=this.getNextUniqueId=function(){return 0!=l._messageId?""+l._messageId++:void 0};this.initPacket=function(e,t){switch(e){case"hi":return{hi:{id:_(),ver:a,ua:l._appName+" ("+(l._browser?l._browser+"; ":"")+l._platform+"); "+s,dev:l._deviceToken,lang:l._humanLanguage}};case"acc":return{acc:{id:_(),user:null,scheme:null,secret:null,login:!1,tags:null,desc:{},cred:{}}};case"login":return{login:{id:_(),scheme:null,secret:null}};case"sub":return{sub:{id:_(),topic:t,set:{},get:{}}};case"leave":return{leave:{id:_(),topic:t,unsub:!1}};case"pub":return{pub:{id:_(),topic:t,noecho:!1,head:null,content:{}}};case"get":return{get:{id:_(),topic:t,what:null,desc:{},sub:{},data:{}}};case"set":return{set:{id:_(),topic:t,desc:{},sub:{},tags:[]}};case"del":return{del:{id:_(),topic:t,what:null,delseq:null,user:null,hard:!1}};case"note":return{note:{topic:t,what:null,seq:void 0}};default:throw new Error("Unknown packet type requested: "+e)}},this.send=function(e,t){var r;t&&(r=function(e){var t=null;return e&&(t=new Promise(function(t,n){l._pendingPromises[e]={resolve:t,reject:n}})),t}(t)),e=function e(t){return Object.keys(t).forEach(function(r){"_"==r[0]?delete t[r]:t[r]?Array.isArray(t[r])&&0==t[r].length?delete t[r]:t[r]?"object"!=n(t[r])||t[r]instanceof Date||(e(t[r]),0==Object.getOwnPropertyNames(t[r]).length&&delete t[r]):delete t[r]:delete t[r]}),t}(e);var o=JSON.stringify(e);l.logger("out: "+(l._trimLongStrings?JSON.stringify(e,y):o));try{l._connection.sendText(o)}catch(e){if(!t)throw e;b(t,u,null,e.message)}return r},this.loginSuccessful=function(e){e.params&&e.params.user&&(l._myUID=e.params.user,l._authenticated=e&&e.code>=200&&e.code<300,e.params&&e.params.token&&e.params.expires?l._authToken={token:e.params.token,expires:new Date(e.params.expires)}:l._authToken=null,l.onLogin&&l.onLogin(e.code,e.text))},this._connection.onMessage=function(e){if(e){l._inPacketCount++,l.onRawMessage&&l.onRawMessage(e);var t=JSON.parse(e,m);if(t)if(l.logger("in: "+(l._trimLongStrings?JSON.stringify(t,y):e)),l.onMessage&&l.onMessage(t),t.ctrl)l.onCtrlMessage&&l.onCtrlMessage(t.ctrl),t.ctrl.id&&b(t.ctrl.id,t.ctrl.code,t.ctrl,t.ctrl.text),t.ctrl.params&&"data"==t.ctrl.params.what&&(n=f("topic",t.ctrl.topic))&&n._allMessagesReceived(t.ctrl.params.count);else if(t.meta)(n=f("topic",t.meta.topic))&&n._routeMeta(t.meta),l.onMetaMessage&&l.onMetaMessage(t.meta);else if(t.data)(n=f("topic",t.data.topic))&&n._routeData(t.data),l.onDataMessage&&l.onDataMessage(t.data);else if(t.pres)(n=f("topic",t.pres.topic))&&n._routePres(t.pres),l.onPresMessage&&l.onPresMessage(t.pres);else if(t.info){var n;(n=f("topic",t.info.topic))&&n._routeInfo(t.info),l.onInfoMessage&&l.onInfoMessage(t.info)}else l.logger("ERROR: Unknown packet received.");else l.logger("in: "+e),l.logger("ERROR: failed to parse data")}},this._connection.onOpen=function(){l.hello()},this._connection.onDisconnect=function(e){for(var t in l._inPacketCount=0,l._serverInfo=null,l._authenticated=!1,l._pendingPromises){var n=l._pendingPromises[t];n&&n.reject&&n.reject(new Error(c+" ("+u+")"))}l._pendingPromises={},v(function(e,t){0===t.lastIndexOf("topic:",0)&&e._resetSub()}),l.onDisconnect&&l.onDisconnect(e)}};b.credential=function(e,t,r,o){if("object"==n(e)){var i=e;t=i.val,r=i.params,o=i.resp,e=i.meth}return e&&(t||o)?[{meth:e,val:t,resp:o,params:r}]:null},b.topicType=function(e){return{me:"me",fnd:"fnd",grp:"grp",new:"grp",usr:"p2p"}["string"==typeof e?e.substring(0,3):"xxx"]},b.isNewGroupTopicName=function(e){return"string"==typeof e&&"new"==e.substring(0,3)},b.getVersion=function(){return a},b.setWebSocketProvider=function(e){r=e},b.getLibrary=function(){return s},b.MESSAGE_STATUS_NONE=0,b.MESSAGE_STATUS_QUEUED=1,b.MESSAGE_STATUS_SENDING=2,b.MESSAGE_STATUS_FAILED=3,b.MESSAGE_STATUS_SENT=4,b.MESSAGE_STATUS_RECEIVED=5,b.MESSAGE_STATUS_READ=6,b.MESSAGE_STATUS_TO_ME=7,b.DEL_CHAR="␡",b.prototype={connect:function(e){return this._connection.connect(e)},disconnect:function(){this._connection&&this._connection.disconnect()},isConnected:function(){return this._connection&&this._connection.isConnected()},isAuthenticated:function(){return this._authenticated},account:function(e,t,n,r,o){var i=this.initPacket("acc");return i.acc.user=e,i.acc.scheme=t,i.acc.secret=n,i.acc.login=r,o&&(i.acc.desc.defacs=o.defacs,i.acc.desc.public=o.public,i.acc.desc.private=o.private,i.acc.tags=o.tags,i.acc.cred=o.cred,i.acc.token=o.token),this.send(i,i.acc.id)},createAccount:function(e,t,n,r){var o=this,i=this.account("new",e,t,n,r);return n&&(i=i.then(function(e){return o.loginSuccessful(e),e})),i},createAccountBasic:function(e,t,n){return e=e||"",t=t||"",this.createAccount("basic",d(e+":"+t),!0,n)},updateAccountBasic:function(e,t,n,r){return t=t||"",n=n||"",this.account(e,"basic",d(t+":"+n),!1,r)},hello:function(){var e=this,t=this.initPacket("hi");return this.send(t,t.hi.id).then(function(t){return t.params&&(e._serverInfo=t.params),e.onConnect&&e.onConnect(),t}).catch(function(t){e.onDisconnect&&e.onDisconnect(t)})},setDeviceToken:function(e,t){var n=!1;return e&&e!=this._deviceToken&&(this._deviceToken=e,t&&this.isConnected()&&this.isAuthenticated()&&(this.send({hi:{dev:e}}),n=!0)),n},login:function(e,t,n){var r=this,o=this.initPacket("login");return o.login.scheme=e,o.login.secret=t,o.login.cred=n,this.send(o,o.login.id).then(function(e){return r.loginSuccessful(e),e})},loginBasic:function(e,t,n){var r=this;return this.login("basic",d(e+":"+t),n).then(function(t){return r._login=e,t})},loginToken:function(e,t){return this.login("token",e,t)},requestResetAuthSecret:function(e,t,n){return this.login("reset",d(e+":"+t+":"+n))},getAuthToken:function(){return this._authToken&&this._authToken.expires.getTime()>Date.now()?this._authToken:(this._authToken=null,null)},setAuthToken:function(e){this._authToken=e},subscribe:function(e,t,n){var r=this.initPacket("sub",e);return e||(e="new"),r.sub.get=t,n&&(n.sub&&(r.sub.set.sub=n.sub),b.isNewGroupTopicName(e)&&n.desc&&(r.sub.set.desc=n.desc),n.tags&&(r.sub.set.tags=n.tags)),this.send(r,r.sub.id)},leave:function(e,t){var n=this.initPacket("leave",e);return n.leave.unsub=t,this.send(n,n.leave.id)},createMessage:function(t,n,r){var o=this.initPacket("pub",t),i="string"==typeof n?e.parse(n):n;return i&&!e.isPlainText(i)&&(o.pub.head={mime:e.getContentType()},n=i),o.pub.noecho=r,o.pub.content=n,o.pub},publish:function(e,t,n){return this.publishMessage(this.createMessage(e,t,n))},publishMessage:function(e){return(e=Object.assign({},e)).seq=void 0,e.from=void 0,e.ts=void 0,this.send({pub:e},e.id)},getMeta:function(e,t){var n=this.initPacket("get",e);return n.get=p(n.get,t),this.send(n,n.get.id)},setMeta:function(e,t){var n=this.initPacket("set",e),r=[];return t&&["desc","sub","tags"].map(function(e){t.hasOwnProperty(e)&&(r.push(e),n.set[e]=t[e])}),0==r.length?Promise.reject(new Error("Invalid {set} parameters")):this.send(n,n.set.id)},delMessages:function(e,t,n){var r=this.initPacket("del",e);return r.del.what="msg",r.del.delseq=t,r.del.hard=n,this.send(r,r.del.id)},delTopic:function(e){var t=this,n=this.initPacket("del",e);return n.del.what="topic",this.send(n,n.del.id).then(function(n){return t.cacheDel("topic",e),t.ctrl})},delSubscription:function(e,t){var n=this.initPacket("del",e);return n.del.what="sub",n.del.user=t,this.send(n,n.del.id)},note:function(e,t,n){if(n<=0||n>=268435455)throw new Error("Invalid message id "+n);var r=this.initPacket("note",e);r.note.what=t,r.note.seq=n,this.send(r)},noteKeyPress:function(e){var t=this.initPacket("note",e);t.note.what="kp",this.send(t)},getTopic:function(e){var t=this.cacheGet("topic",e);return!t&&e&&(t="me"==e?new S:"fnd"==e?new T:new E(e),this.cachePut("topic",e,t),this.attachCacheToTopic(t)),t},newTopic:function(e){var t=new E("new",e);return this.attachCacheToTopic(t),t},newGroupTopicName:function(){return"new"+this.getNextUniqueId()},newTopicWith:function(e,t){var n=new E(e,t);return this.attachCacheToTopic(n),n},getMeTopic:function(){return this.getTopic("me")},getFndTopic:function(){return this.getTopic("fnd")},getLargeFileHelper:function(){return new k(this)},getCurrentUserID:function(){return this._myUID},getCurrentLogin:function(){return this._login},getServerInfo:function(){return this._serverInfo},enableLogging:function(e,t){this._loggingEnabled=e,this._trimLongStrings=e&&t},isTopicOnline:function(e){var t=this.getMeTopic(),n=t&&t.getContact(e);return n&&n.online},wantAkn:function(e){this._messageId=e?Math.floor(16777215*Math.random()+16777215):0},onWebsocketOpen:void 0,onConnect:void 0,onDisconnect:void 0,onLogin:void 0,onCtrlMessage:void 0,onDataMessage:void 0,onPresMessage:void 0,onMessage:void 0,onRawMessage:void 0};var _=function(e){this.topic=e;var t=e._tinode.getMeTopic();this.contact=t&&t.getContact(e.name),this.what={}};_.prototype={_get_ims:function(){var e=this.contact&&this.contact.updated,t=this.topic._lastDescUpdate||0;return e>t?e:t},withData:function(e,t,n){return this.what.data={since:e,before:t,limit:n},this},withLaterData:function(e){return this.withData(this.topic._maxSeq>0?this.topic._maxSeq+1:void 0,void 0,e)},withEarlierData:function(e){return this.withData(void 0,this.topic._minSeq>0?this.topic._minSeq:void 0,e)},withDesc:function(e){return this.what.desc={ims:e},this},withLaterDesc:function(){return this.withDesc(this._get_ims())},withSub:function(e,t,n){var r={ims:e,limit:t};return"me"==this.topic.getType()?r.topic=n:r.user=n,this.what.sub=r,this},withOneSub:function(e,t){return this.withSub(e,void 0,t)},withLaterOneSub:function(e){return this.withOneSub(this.topic._lastSubsUpdate,e)},withLaterSub:function(e){return this.withSub("p2p"==this.topic.getType()?this._get_ims():this.topic._lastSubsUpdate,e)},withTags:function(){return this.what.tags=!0,this},withDel:function(e,t){return(e||t)&&(this.what.del={since:e,limit:t}),this},withLaterDel:function(e){return this.withDel(this.topic._maxSeq>0?this.topic._maxDel+1:void 0,e)},build:function(){var e={},t=[],n=this;return["data","sub","desc","tags","del"].map(function(r){n.what.hasOwnProperty(r)&&(t.push(r),Object.getOwnPropertyNames(n.what[r]).length>0&&(e[r]=n.what[r]))}),t.length>0?e.what=t.join(" "):e=void 0,e}};var w=function e(t){t&&(this.given="number"==typeof t.given?t.given:e.decode(t.given),this.want="number"==typeof t.want?t.want:e.decode(t.want),this.mode=t.mode?"number"==typeof t.mode?t.mode:e.decode(t.mode):this.given&this.want)};w._NONE=0,w._JOIN=1,w._READ=2,w._WRITE=4,w._PRES=8,w._APPROVE=16,w._SHARE=32,w._DELETE=64,w._OWNER=128,w._BITMASK=w._JOIN|w._READ|w._WRITE|w._PRES|w._APPROVE|w._SHARE|w._DELETE|w._OWNER,w._INVALID=1048576,w.decode=function(e){if(!e)return null;if("number"==typeof e)return e&w._BITMASK;if("N"===e||"n"===e)return w._NONE;for(var t={J:w._JOIN,R:w._READ,W:w._WRITE,P:w._PRES,A:w._APPROVE,S:w._SHARE,D:w._DELETE,O:w._OWNER},n=w._NONE,r=0;r0)){l=!0;break}i=a-1}return l?a:r?-1:s<0?a+1:a}function r(e,t){var r=n(e,t,!1);return t.splice(r,0,e),t}return e=e||function(e,t){return e===t?0:e0)return n[0]},delRange:function(e,n){return t.splice(e,n-e)},size:function(){return t.length},reset:function(e){t=[]},forEach:function(e,n,r,o){n|=0,r=r||t.length;for(var i=n;i=300)return e;if(n._subscribed=!0,n.acs=e.params&&e.params.acs?e.params.acs:n.acs,n._new){n._new=!1,n.name=e.topic,n.created=e.ts,n.updated=e.ts,n.touched=e.ts,n._cachePutSelf();var r=n._tinode.getMeTopic();r&&r._processMetaSub([{_generated:!0,topic:n.name,created:e.ts,updated:e.ts,touched:e.ts,acs:n.acs}]),t&&t.desc&&(t.desc._generated=!0,n._processMetaDesc(t.desc))}return e})},createMessage:function(e,t){return this._tinode.createMessage(this.name,e,t)},publish:function(e,t){return this.publishMessage(this.createMessage(e,t))},publishMessage:function(t){var n=this;if(!this._subscribed)return Promise.reject(new Error("Cannot publish on inactive topic"));if(e.hasAttachments(t.content)&&!t.head.attachments){var r=[];e.attachments(t.content,function(e){r.push(e.ref)}),t.head.attachments=r}return t._sending=!0,this._tinode.publishMessage(t).then(function(e){return t._sending=!1,t.seq=e.params.seq,t.ts=e.ts,n._routeData(t),e}).catch(function(e){t._sending=!1,t._failed=!0})},publishDraft:function(e,t){var n=this;if(!t&&!this._subscribed)return Promise.reject(new Error("Cannot publish on inactive topic"));var r=e.seq||this._getQueuedSeqId();return e._generated||(e._generated=!0,e.seq=r,e.ts=new Date,e.from=this._tinode.getCurrentUserID(),e.noecho=!0,this._messages.put(e),this.onData&&this.onData(e)),(t||Promise.resolve()).then(function(){return e._cancelled?{code:300,text:"cancelled"}:n.publishMessage(e)},function(t){e._sending=!1,n._messages.delAt(n._messages.find(e)),n.onData&&n.onData()})},leave:function(e){var t=this;return this._subscribed||e?this._tinode.leave(this.name,e).then(function(n){return t._resetSub(),e&&t._gone(),n}):Promise.reject(new Error("Cannot leave inactive topic"))},getMeta:function(e){return this._subscribed?this._tinode.getMeta(this.name,e):Promise.reject(new Error("Cannot query inactive topic"))},getMessagesPage:function(e,t){var n=this,r=this.startMetaQuery();t?r.withLaterData(e):r.withEarlierData(e);var o=this.getMeta(r.build());return t||(o=o.then(function(e){e&&e.params&&!e.params.count&&(n._noEarlierMsgs=!0)})),o},setMeta:function(e){var t=this;return this._subscribed?(e.tags&&(e.tags=function(e){var t=[];if(Array.isArray(e)){for(var n=0,r=e.length;n1&&t.push(o)}t.sort().filter(function(e,t,n){return!t||e!=n[t-1]})}return 0==t.length&&t.push(b.DEL_CHAR),t}(e.tags)),this._tinode.setMeta(this.name,e).then(function(n){return n&&n.code>=300?n:(e.sub&&(n.params&&n.params.acs&&(e.sub.acs=n.params.acs,e.sub.updated=n.ts),e.sub.user||(e.sub.user=t._tinode.getCurrentUserID(),e.desc||(e.desc={})),e.sub._generated=!0,t._processMetaSub([e.sub])),e.desc&&(n.params&&n.params.acs&&(e.desc.acs=n.params.acs,e.desc.updated=n.ts),t._processMetaDesc(e.desc)),e.tags&&t._processMetaTags(e.tags),n)})):Promise.reject(new Error("Cannot update inactive topic"))},invite:function(e,t){return this.setMeta({sub:{user:e,mode:t}})},delMessages:function(e,t){var n=this;if(!this._subscribed)return Promise.reject(new Error("Cannot delete messages in inactive topic"));e.sort(function(e,t){return e.low=t.hi)});var r=e.reduce(function(e,t){return t.low<268435455&&(!t.hi||t.hi<268435455?e.push(t):e.push({low:t.low,hi:n._maxSeq+1})),e},[]);return(e.length>0?this._tinode.delMessages(this.name,r,t):Promise.resolve({params:{del:0}})).then(function(t){return t.params.del>n._maxDel&&(n._maxDel=t.params.del),e.map(function(e){e.hi?n.flushMessageRange(e.low,e.hi):n.flushMessage(e.low)}),n.onData&&n.onData(),t})},delMessagesAll:function(e){return this.delMessages([{low:1,hi:this._maxSeq+1,_all:!0}],e)},delMessagesList:function(e,t){e.sort(function(e,t){return e-t});var n=e.reduce(function(e,t){if(0==e.length)e.push({low:t});else{var n=e[e.length-1];!n.hi&&t!=n.low+1||t>n.hi?e.push({low:t}):n.hi=n.hi?Math.max(n.hi,t+1):t+1}return e},[]);return this.delMessages(n,t)},delTopic:function(){var e=this;return this._tinode.delTopic(this.name).then(function(t){return e._resetSub(),e._gone(),t})},delSubscription:function(e){var t=this;return this._subscribed?this._tinode.delSubscription(this.name,e).then(function(n){return delete t._users[e],t.onSubsUpdated&&t.onSubsUpdated(Object.keys(t._users)),n}):Promise.reject(new Error("Cannot delete subscription in inactive topic"))},note:function(e,t){var n=this._users[this._tinode.getCurrentUserID()];n?((!n[e]||n[e]0)for(var o in this._users){var i=this._users[o];i.user!==r&&i[e]>=t&&n++}return n},msgReadCount:function(e){return this.msgReceiptCount("read",e)},msgRecvCount:function(e){return this.msgReceiptCount("recv",e)},msgHasMoreMessages:function(e){return e?this.seq>this._maxSeq:this._minSeq>1&&!this._noEarlierMsgs},isNewMessage:function(e){return this._maxSeq<=e},flushMessage:function(e){var t=this._messages.find({seq:e});return t>=0?this._messages.delAt(t):void 0},flushMessageRange:function(e,t){var n=this._messages.find({seq:e});return n>=0?this._messages.delRange(n,this._messages.find({seq:t},!0)):[]},cancelSend:function(e){var t=this._messages.find({seq:e});if(t>=0){var n=this._messages.getAt(t);if(1==this.msgStatus(n))return n._cancelled=!0,this._messages.delAt(t),!0}return!1},getType:function(){return b.topicType(this.name)},getAccessMode:function(){return this.acs},getDefaultAccess:function(){return this.defacs},startMetaQuery:function(){return new _(this)},msgStatus:function(e){var t=0;return e.from==this._tinode.getCurrentUserID()?e._sending?t=2:e._failed?t=3:e.seq>=268435455?t=1:this.msgReadCount(e.seq)>0?t=6:this.msgRecvCount(e.seq)>0?t=5:e.seq>0&&(t=4):t=7,t},_routeData:function(e){e.content&&((!this.touched||this.touchedthis._maxSeq&&(this._maxSeq=e.seq),(e.seq0&&(this._lastSubsUpdate=e.ts,this._processMetaSub(e.sub)),e.del&&this._processDelMessages(e.del.clear,e.del.delseq),e.tags&&this._processMetaTags(e.tags),this.onMeta&&this.onMeta(e)},_routePres:function(e){var t;switch(e.what){case"del":this._processDelMessages(e.clear,e.delseq);break;case"on":case"off":(t=this._users[e.src])?t.online="on"==e.what:this._tinode.logger("Presence update for an unknown user",this.name,e.src);break;case"acs":var n="me"==e.src?this._tinode.getCurrentUserID():e.src;if(t=this._users[n])t.acs.updateAll(e.dacs),n==this._tinode.getCurrentUserID()&&this.acs.updateAll(e.dacs),t.acs&&t.acs.mode!=w._NONE||("p2p"==this.getType()&&this.leave(),this._processMetaSub([{user:n,deleted:new Date,_generated:!0}]));else{var r=(new w).updateAll(e.dacs);r&&r.mode!=w._NONE&&((t=this._cacheGetUser(n))?t.acs=r:(t={user:n,acs:r},this.getMeta(this.startMetaQuery().withOneSub(void 0,n).build())),t._generated=!0,t.updated=new Date,this._processMetaSub([t]))}break;default:this._tinode.logger("Ignored presence update",e.what)}this.onPres&&this.onPres(e)},_routeInfo:function(e){if("kp"!==e.what){var t=this._users[e.from];t&&(t[e.what]=e.seq)}this.onInfo&&this.onInfo(e)},_processMetaDesc:function(e,t){if(p(this,e),"string"==typeof this.created&&(this.created=new Date(this.created)),"string"==typeof this.updated&&(this.updated=new Date(this.updated)),"string"==typeof this.touched&&(this.touched=new Date(this.touched)),"me"!==this.name&&!t&&!e._generated){var n=this._tinode.getMeTopic();n&&n._processMetaSub([{_generated:!0,topic:this.name,updated:this.updated,touched:this.touched,acs:this.acs,public:this.public,private:this.private}])}this.onMetaDesc&&this.onMetaDesc(this)},_processMetaSub:function(e){var t=void 0;for(var n in e){var r=e[n];if(r.user){r.updated=new Date(r.updated),r.deleted=r.deleted?new Date(r.deleted):null;var o=null;r.deleted?(delete this._users[r.user],o=r):((o=this._users[r.user])||(o=this._cacheGetUser(r.user)),o=this._updateCachedUser(r.user,r,r._generated)),this.onMetaSub&&this.onMetaSub(o)}else r._generated||(t=r)}t&&this.onMetaDesc&&this.onMetaDesc(t),this.onSubsUpdated&&this.onSubsUpdated(Object.keys(this._users))},_processMetaTags:function(e){1==e.length&&e[0]==b.DEL_CHAR&&(e=[]),this._tags=e,this.onTagsUpdated&&this.onTagsUpdated(e)},_processDelMessages:function(e,t){this._maxDel=Math.max(e,this._maxDel),this.clear=Math.max(e,this.clear);var n=this,r=0;Array.isArray(t)&&t.map(function(e){if(e.hi)for(var t=e.low;t0&&this.onData&&this.onData()},_allMessagesReceived:function(e){this.onAllMessagesReceived&&this.onAllMessagesReceived(e)},_resetSub:function(){this._subscribed=!1},_gone:function(){this._messages.reset(),this._users={},this.acs=new w(null),this.private=null,this.public=null,this._maxSeq=0,this._minSeq=0,this._subscribed=!1;var e=this._tinode.getMeTopic();e&&e._routePres({_generated:!0,what:"gone",topic:"me",src:this.name}),this.onDeleteTopic&&this.onDeleteTopic()},_updateCachedUser:function(e,t,n){var r=this._cacheGetUser(e);return r?r=p(r,t):(n&&this.getMeta(this.startMetaQuery().withLaterOneSub(e).build()),r=p({},t)),this._cachePutUser(e,r),f(this._users,e,r)},_getQueuedSeqId:function(){return this._queuedSeqId++}};var S=function(e){E.call(this,"me",e),this._contacts={},e&&(this.onContactUpdate=e.onContactUpdate)};S.prototype=Object.create(E.prototype,{_processMetaSub:{value:function(e){var t=0;for(var n in e){var r=e[n],o=r.topic;if("fnd"!=o&&"me"!=o){r.updated=new Date(r.updated),r.touched=r.touched?new Date(r.touched):null,r.deleted=r.deleted?new Date(r.deleted):null,r.seq=0|r.seq,r.recv=0|r.recv,r.read=0|r.read,r.unread=r.seq-r.read;var i=null;if(r.deleted)i=r,delete this._contacts[o];else if(r.seen&&r.seen.when&&(r.seen.when=new Date(r.seen.when)),i=f(this._contacts,o,r),"p2p"==b.topicType(o)&&this._cachePutUser(o,i),!r._generated){var a=this._tinode.getTopic(o);a&&a._processMetaDesc(r,!0)}t++,this.onMetaSub&&this.onMetaSub(i)}}t>0&&this.onSubsUpdated&&this.onSubsUpdated(Object.keys(this._contacts))},enumerable:!0,configurable:!0,writable:!1},_routePres:{value:function(e){var t=this._contacts[e.src];if(t){switch(e.what){case"on":t.online=!0;break;case"off":t.online&&(t.online=!1,t.seen?t.seen.when=new Date:t.seen={when:new Date});break;case"msg":t.touched=new Date,t.seq=0|e.seq,t.unread=t.seq-t.read;break;case"upd":this.getMeta(this.startMetaQuery().withLaterOneSub(e.src).build());break;case"acs":t.acs?t.acs.updateAll(e.dacs):t.acs=(new w).updateAll(e.dacs);break;case"ua":t.seen={when:new Date,ua:e.ua};break;case"recv":t.recv=t.recv?Math.max(t.recv,e.seq):0|e.seq;break;case"read":t.read=t.read?Math.max(t.read,e.seq):0|e.seq,t.unread=t.seq-t.read;break;case"gone":delete this._contacts[e.src]}this.onContactUpdate&&this.onContactUpdate(e.what,t)}else if("acs"==e.what){var n=new w(e.dacs);if(!n||n.mode==w._INVALID)return void this._tinode.logger("Invalid access mode update",e.src,e.dacs);if(n.mode==w._NONE)return void this._tinode.logger("Removing non-existent subscription",e.src,e.dacs);this.getMeta(this.startMetaQuery().withOneSub(void 0,e.src).build()),this._contacts[e.src]={topic:e.src,online:!1,acs:n}}this.onPres&&this.onPres(e)},enumerable:!0,configurable:!0,writable:!1},publish:{value:function(){return Promise.reject(new Error("Publishing to 'me' is not supported"))},enumerable:!0,configurable:!0,writable:!1},contacts:{value:function(e,t){var n=e||this.onMetaSub;if(n)for(var r in this._contacts)n.call(t,this._contacts[r],r,this._contacts)},enumerable:!0,configurable:!0,writable:!0},setMsgReadRecv:{value:function(e,t,n,r){var o,i=this._contacts[e],a=!1;i&&(n|=0,"recv"===t?(o=i.recv,i.recv=i.recv?Math.max(i.recv,n):n,a=o!=i.recv):"read"===t?(o=i.read,i.read=i.read?Math.max(i.read,n):n,i.unread=i.seq-i.read,a=o!=i.read,i.recv0&&this.onSubsUpdated&&this.onSubsUpdated(Object.keys(this._contacts))},enumerable:!0,configurable:!0,writable:!1},publish:{value:function(){return Promise.reject(new Error("Publishing to 'fnd' is not supported"))},enumerable:!0,configurable:!0,writable:!1},setMeta:{value:function(e){var t=this;return Object.getPrototypeOf(T.prototype).setMeta.call(this,e).then(function(){Object.keys(t._contacts).length>0&&(t._contacts={},t.onSubsUpdated&&t.onSubsUpdated([]))})},enumerable:!0,configurable:!0,writable:!1},contacts:{value:function(e,t){var n=e||this.onMetaSub;if(n)for(var r in this._contacts)n.call(t,this._contacts[r],r,this._contacts)},enumerable:!0,configurable:!0,writable:!0}}),T.prototype.constructor=T;var k=function(e){this._tinode=e,this._apiKey=e._apiKey,this._authToken=e.getAuthToken(),this._msgId=e.getNextUniqueId(),this.xhr=h(),this.toResolve=null,this.toReject=null,this.onProgress=null,this.onSuccess=null,this.onFailure=null};k.prototype={upload:function(e,t,n,r){var o=this;if(!this._authToken)throw new Error("Must authenticate first");var a=this;this.xhr.open("POST","/v"+i+"/file/u/",!0),this.xhr.setRequestHeader("X-Tinode-APIKey",this._apiKey),this.xhr.setRequestHeader("X-Tinode-Auth","Token "+this._authToken.token);var s=new Promise(function(e,t){o.toResolve=e,o.toReject=t});this.onProgress=t,this.onSuccess=n,this.onFailure=r,this.xhr.upload.onprogress=function(e){e.lengthComputable&&a.onProgress&&a.onProgress(e.loaded/e.total)},this.xhr.onload=function(){var e;try{e=JSON.parse(this.response,m)}catch(e){a._tinode.logger("Invalid server response in LargeFileHelper",this.response)}this.status>=200&&this.status<300?(a.toResolve&&a.toResolve(e.ctrl.params.url),a.onSuccess&&a.onSuccess(e.ctrl)):this.status>=400?(a.toReject&&a.toReject(new Error(e.ctrl.text+" ("+e.ctrl.code+")")),a.onFailure&&a.onFailure(e.ctrl)):a._tinode.logger("Unexpected server response status",this.status,this.response)},this.xhr.onerror=function(e){a.toReject&&a.toReject(new Error("failed")),a.onFailure&&a.onFailure(null)},this.xhr.onabort=function(e){a.toReject&&a.toReject(new Error("upload cancelled by user")),a.onFailure&&a.onFailure(null)};try{var l=new FormData;l.append("file",e),l.set("id",this._msgId),this.xhr.send(l)}catch(e){this.toReject&&this.toReject(e),this.onFailure&&this.onFailure(null)}return s},download:function(e,t,n,r){var o=this;if(/^(?:(?:[a-z]+:)?\/\/)/i.test(e))throw new Error("The URL '"+e+"' must be relative, not absolute");if(!this._authToken)throw new Error("Must authenticate first");var i=this;this.xhr.open("GET",e,!0),this.xhr.setRequestHeader("X-Tinode-APIKey",this._apiKey),this.xhr.setRequestHeader("X-Tinode-Auth","Token "+this._authToken.token),this.xhr.responseType="blob",this.onProgress=r,this.xhr.onprogress=function(e){i.onProgress&&i.onProgress(e.loaded)};var a=new Promise(function(e,t){o.toResolve=e,o.toReject=t});this.xhr.onload=function(){if(200==this.status){var e=document.createElement("a");e.href=window.URL.createObjectURL(new Blob([this.response],{type:n})),e.style.display="none",e.setAttribute("download",t),document.body.appendChild(e),e.click(),document.body.removeChild(e),window.URL.revokeObjectURL(e.href),i.toResolve&&i.toResolve()}else if(this.status>=400&&i.toReject){var r=new FileReader;r.onload=function(){try{var e=JSON.parse(this.result,m);i.toReject(new Error(e.ctrl.text+" ("+e.ctrl.code+")"))}catch(e){i._tinode.logger("Invalid server response in LargeFileHelper",this.result),i.toReject(e)}},r.readAsText(this.response)}},this.xhr.onerror=function(e){i.toReject&&i.toReject(new Error("failed"))},this.xhr.onabort=function(){i.toReject&&i.toReject(null)};try{this.xhr.send()}catch(e){this.toReject&&this.toReject(e)}return a},cancel:function(){this.xhr&&this.xhr.readyState<4&&this.xhr.abort()},getId:function(){return this._msgId}};var C=function e(t,n){this.status=e.STATUS_NONE,this.topic=t,this.content=n};C.STATUS_NONE=0,C.STATUS_QUEUED=1,C.STATUS_SENDING=2,C.STATUS_FAILED=3,C.STATUS_SENT=4,C.STATUS_RECEIVED=5,C.STATUS_READ=6,C.STATUS_TO_ME=7,(C.prototype={toJSON:function(){},fromJSON:function(e){}}).constructor=C,(l=b).Drafty=e}.call(this,void 0!==t?t:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{}),l}()}).call(this,n(10))},function(e,t,n){e.exports=n(38)()},function(e,t,n){"use strict";!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}(),e.exports=n(21)},function(e,t,n){"use strict";var r=n(24).default;n(31),(t=e.exports=r).default=t},function(e,t,n){"use strict";(t=e.exports=n(40).default).default=t},function(e,t,n){"use strict";var r=n(32).default;n(37),(t=e.exports=r).default=t},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),o={NODE_CLIENT:!1,NODE_ADMIN:!1,SDK_VERSION:"${JSCORE_VERSION}"},i=function(e,t){if(!e)throw a(t)},a=function(e){return new Error("Firebase Database ("+o.SDK_VERSION+") INTERNAL ASSERT FAILED: "+e)},s=function(e){for(var t=[],n=0,r=0;r>6|192,t[n++]=63&o|128):55296==(64512&o)&&r+1>18|240,t[n++]=o>>12&63|128,t[n++]=o>>6&63|128,t[n++]=63&o|128):(t[n++]=o>>12|224,t[n++]=o>>6&63|128,t[n++]=63&o|128)}return t},l={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:"function"==typeof atob,encodeByteArray:function(e,t){if(!Array.isArray(e))throw Error("encodeByteArray takes an array as a parameter");this.init_();for(var n=t?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[],o=0;o>2,d=(3&i)<<4|s>>4,p=(15&s)<<2|u>>6,f=63&u;l||(f=64,a||(p=64)),r.push(n[c],n[d],n[p],n[f])}return r.join("")},encodeString:function(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(s(e),t)},decodeString:function(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):function(e){for(var t=[],n=0,r=0;n191&&o<224){var i=e[n++];t[r++]=String.fromCharCode((31&o)<<6|63&i)}else if(o>239&&o<365){var a=((7&o)<<18|(63&(i=e[n++]))<<12|(63&(s=e[n++]))<<6|63&e[n++])-65536;t[r++]=String.fromCharCode(55296+(a>>10)),t[r++]=String.fromCharCode(56320+(1023&a))}else{i=e[n++];var s=e[n++];t[r++]=String.fromCharCode((15&o)<<12|(63&i)<<6|63&s)}}return t.join("")}(this.decodeStringToByteArray(e,t))},decodeStringToByteArray:function(e,t){this.init_();for(var n=t?this.charToByteMapWebSafe_:this.charToByteMap_,r=[],o=0;o>4;if(r.push(u),64!=s){var c=a<<4&240|s>>2;if(r.push(c),64!=l){var d=s<<6&192|l;r.push(d)}}}return r},init_:function(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(var e=0;e=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(e)]=e,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(e)]=e)}}},u=function(e){try{return l.decodeString(e,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};function c(e,t){if(!(t instanceof Object))return t;switch(t.constructor){case Date:return new Date(t.getTime());case Object:void 0===e&&(e={});break;case Array:e=[];break;default:return t}for(var n in t)t.hasOwnProperty(n)&&(e[n]=c(e[n],t[n]));return e}var d=function(){function e(){var e=this;this.promise=new Promise(function(t,n){e.resolve=t,e.reject=n})}return e.prototype.wrapCallback=function(e){var t=this;return function(n,r){n?t.reject(n):t.resolve(r),"function"==typeof e&&(t.promise.catch(function(){}),1===e.length?e(n):e(n,r))}},e}(),p=function(){return"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:""},f="FirebaseError",h=Error.captureStackTrace;var m=function(){return function(e,t){if(this.code=e,this.message=t,h)h(this,y.prototype.create);else try{throw Error.apply(this,arguments)}catch(e){this.name=f,Object.defineProperty(this,"stack",{get:function(){return e.stack}})}}}();m.prototype=Object.create(Error.prototype),m.prototype.constructor=m,m.prototype.name=f;var y=function(){function e(e,t,n){this.service=e,this.serviceName=t,this.errors=n,this.pattern=/\{\$([^}]+)}/g}return e.prototype.create=function(e,t){void 0===t&&(t={});var n,r=this.errors[e],o=this.service+"/"+e;n=void 0===r?"Error":r.replace(this.pattern,function(e,n){var r=t[n];return void 0!==r?r.toString():"<"+n+"?>"}),n=this.serviceName+": "+n+" ("+o+").";var i=new m(o,n);for(var a in t)t.hasOwnProperty(a)&&"_"!==a.slice(-1)&&(i[a]=t[a]);return i},e}();function v(e){return JSON.parse(e)}var g=function(e){var t={},n={},r={},o="";try{var i=e.split(".");t=v(u(i[0])||""),n=v(u(i[1])||""),o=i[2],r=n.d||{},delete n.d}catch(e){}return{header:t,claims:n,data:r,signature:o}},b=function(e,t){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t(n,e[n])},_=function(e,t){return b(t,function(t,n){e[t]=n}),e},w=function(e,t,n){for(var r in e)if(t.call(n,e[r],r,e))return r},E=function(e){function t(){var t=e.call(this)||this;t.chain_=[],t.buf_=[],t.W_=[],t.pad_=[],t.inbuf_=0,t.total_=0,t.blockSize=64,t.pad_[0]=128;for(var n=1;n>>31)}var i,a,s=this.chain_[0],l=this.chain_[1],u=this.chain_[2],c=this.chain_[3],d=this.chain_[4];for(r=0;r<80;r++){r<40?r<20?(i=c^l&(u^c),a=1518500249):(i=l^u^c,a=1859775393):r<60?(i=l&u|c&(l|u),a=2400959708):(i=l^u^c,a=3395469782);o=(s<<5|s>>>27)+i+d+a+n[r]&4294967295;d=c,c=u,u=4294967295&(l<<30|l>>>2),l=s,s=o}this.chain_[0]=this.chain_[0]+s&4294967295,this.chain_[1]=this.chain_[1]+l&4294967295,this.chain_[2]=this.chain_[2]+u&4294967295,this.chain_[3]=this.chain_[3]+c&4294967295,this.chain_[4]=this.chain_[4]+d&4294967295},t.prototype.update=function(e,t){if(null!=e){void 0===t&&(t=e.length);for(var n=t-this.blockSize,r=0,o=this.buf_,i=this.inbuf_;r=56;n--)this.buf_[n]=255&t,t/=256;this.compress_(this.buf_);var r=0;for(n=0;n<5;n++)for(var o=24;o>=0;o-=8)e[r]=this.chain_[n]>>o&255,++r;return e},t}(function(){return function(){this.blockSize=-1}}());var S=function(){function e(e,t){var n=this;this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=t,this.task.then(function(){e(n)}).catch(function(e){n.error(e)})}return e.prototype.next=function(e){this.forEachObserver(function(t){t.next(e)})},e.prototype.error=function(e){this.forEachObserver(function(t){t.error(e)}),this.close(e)},e.prototype.complete=function(){this.forEachObserver(function(e){e.complete()}),this.close()},e.prototype.subscribe=function(e,t,n){var r,o=this;if(void 0===e&&void 0===t&&void 0===n)throw new Error("Missing Observer.");void 0===(r=function(e,t){if("object"!=typeof e||null===e)return!1;for(var n=0,r=t;n 4. Need to update it?")}var o=e+" failed: ";return o+=r+" argument "}t.assert=i,t.assertionError=a,t.base64=l,t.base64Decode=u,t.base64Encode=function(e){var t=s(e);return l.encodeByteArray(t,!0)},t.CONSTANTS=o,t.deepCopy=function(e){return c(void 0,e)},t.deepExtend=c,t.patchProperty=function(e,t,n){e[t]=n},t.Deferred=d,t.getUA=p,t.isMobileCordova=function(){return"undefined"!=typeof window&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(p())},t.isNodeSdk=function(){return!0===o.NODE_CLIENT||!0===o.NODE_ADMIN},t.isReactNative=function(){return"object"==typeof navigator&&"ReactNative"===navigator.product},t.ErrorFactory=y,t.FirebaseError=m,t.patchCapture=function(e){var t=h;return h=e,t},t.jsonEval=v,t.stringify=function(e){return JSON.stringify(e)},t.decode=g,t.isAdmin=function(e){var t=g(e).claims;return"object"==typeof t&&!0===t.admin},t.issuedAtTime=function(e){var t=g(e).claims;return"object"==typeof t&&t.hasOwnProperty("iat")?t.iat:null},t.isValidFormat=function(e){var t=g(e).claims;return!!t&&"object"==typeof t&&t.hasOwnProperty("iat")},t.isValidTimestamp=function(e){var t,n,r=g(e).claims,o=Math.floor((new Date).getTime()/1e3);return"object"==typeof r&&(r.hasOwnProperty("nbf")?t=r.nbf:r.hasOwnProperty("iat")&&(t=r.iat),n=r.hasOwnProperty("exp")?r.exp:t+86400),o&&t&&n&&o>=t&&o<=n},t.clone=function(e){return _({},e)},t.contains=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.every=function(e,t){for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&!t(n,e[n]))return!1;return!0},t.extend=_,t.findKey=w,t.findValue=function(e,t,n){var r=w(e,t,n);return r&&e[r]},t.forEach=b,t.getAnyKey=function(e){for(var t in e)return t},t.getCount=function(e){var t=0;for(var n in e)t++;return t},t.getValues=function(e){var t=[],n=0;for(var r in e)t[n++]=e[r];return t},t.isEmpty=function(e){for(var t in e)return!1;return!0},t.isNonNullObject=function(e){return"object"==typeof e&&null!==e},t.map=function(e,t,n){var r={};for(var o in e)r[o]=t.call(n,e[o],o,e);return r},t.safeGet=function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]},t.querystring=function(e){var t=[];return b(e,function(e,n){Array.isArray(n)?n.forEach(function(n){t.push(encodeURIComponent(e)+"="+encodeURIComponent(n))}):t.push(encodeURIComponent(e)+"="+encodeURIComponent(n))}),t.length?"&"+t.join("&"):""},t.querystringDecode=function(e){var t={};return e.replace(/^\?/,"").split("&").forEach(function(e){if(e){var n=e.split("=");t[n[0]]=n[1]}}),t},t.Sha1=E,t.async=function(e,t){return function(){for(var n=[],r=0;rn&&(o=0===n?"none":"no more than "+n),o)throw new Error(e+" failed: Was called with "+r+(1===r?" argument.":" arguments.")+" Expects "+o+".")},t.validateCallback=function(e,t,n,r){if((!r||n)&&"function"!=typeof n)throw new Error(k(e,t,r)+"must be a valid function.")},t.validateContextObject=function(e,t,n,r){if((!r||n)&&("object"!=typeof n||null===n))throw new Error(k(e,t,r)+"must be a valid context object.")},t.validateNamespace=function(e,t,n,r){if((!r||n)&&"string"!=typeof n)throw new Error(k(e,t,r)+"must be a valid firebase namespace.")},t.stringLength=function(e){for(var t=0,n=0;n=55296&&r<=56319?(t+=4,n++):t+=3}return t},t.stringToByteArray=function(e){for(var t=[],n=0,r=0;r=55296&&o<=56319){var a=o-55296;i(++r>6|192,t[n++]=63&o|128):o<65536?(t[n++]=o>>12|224,t[n++]=o>>6&63|128,t[n++]=63&o|128):(t[n++]=o>>18|240,t[n++]=o>>12&63|128,t[n++]=o>>6&63|128,t[n++]=63&o|128)}return t}},function(e,t,n){"use strict";e.exports=function(e,t,n,r,o,i,a,s){if(!e){var l;if(void 0===t)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[n,r,o,i,a,s],c=0;(l=new Error(t.replace(/%s/g,function(){return u[c++]}))).name="Invariant Violation"}throw l.framesToPop=1,l}}},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e){e.exports={en:{contacts_not_found:"You have no chats
¯\\\\_(ツ)_/¯",full_name_prompt:"Full name, e.g. John Doe",email_prompt:"Email, e.g. jdoe@example.com",button_sign_up:"Sign up",label_your_name:"Your name",label_password:"Password",password_unchanged_prompt:"Unchanged",label_user_id:"Address:",label_default_access_mode:"Default access mode:",label_message_sound:"Message sound:",label_push_notifications:"Notification alerts:",label_push_notifications_disabled:"Notification alerts (requires HTTPS):",title_tag_manager:"Tags (user discovery)",button_logout:"Logout",requested_permissions:"Requested",granted_permissions:"Granted",menu_item_edit_permissions:"Edit permissions",label_other_user:"Other",title_info:"Info",label_topic_name:"Name",label_private:"Private comment",private_editing_placeholder:"Visible to you only",label_muting_topic:"Muted:",action_more:"More",label_your_permissions:"Your permissions:",label_permissions:"Permissions:",label_you:"You:",label_default_access:"Default access mode:",label_group_members:"Group members:",button_add_members:"Add members",button_leave:"Leave",group_has_no_members:"No members",action_leave_chat:"Leave",login_prompt:"Login",password_prompt:"Password",stay_logged_in:"Stay logged in",forgot_password_link:"Forgot password?",button_sign_in:"Sign in",label_client:"Client:",label_server:"Server:",online_now:"online now",last_seen_timestamp:"Last seen",title_not_found:"Not found",unnamed_topic:"Unnamed",messages_not_readable:"no access to messages",tabtitle_find_user:"find",tabtitle_new_group:"new group",tabtitle_group_by_id:"by id",search_for_contacts:"Use search to find contacts",new_password_placeholder:"Enter new password",label_reset_password:"Send a password reset email:",credential_email_prompt:"Your registration email",button_reset:"Reset",button_send_request:"Send request",label_server_to_use:"Server to use:",label_wire_transport:"Wire transport:",button_update:"Update",sidepanel_title_login:"Sign In",sidepanel_title_register:"Create Account",sidepanel_title_settings:"Settings",sidepanel_title_edit_account:"Edit Account",sidepanel_title_newtpk:"Start New Chat",sidepanel_title_cred:"Confirm Credentials",sidepanel_title_reset:"Reset Password",phone_dative:"phone",email_dative:"email",enter_confirmation_code_prompt:"Enter confirmation code sent to you by {method}:",numeric_confirmation_code_prompt:"Numbers only",button_confirm:"Confirm",invalid_content:"invalid content",badge_you:"you",badge_owner:"owner",menu_item_info:"Info",menu_item_clear_messages:"Clear messages",menu_item_clear_messages_for_all:"Clear for All",menu_item_delete:"Delete",menu_item_delete_for_all:"Delete for All",menu_item_mute:"Mute",menu_item_unmute:"Unmute",menu_item_delete_topic:"Delete",menu_item_unblock:"Unblock",menu_item_block:"Block",menu_item_member_delete:"Remove",action_cancel:"cancel",upload_finishing:"finishing...",no_contacts:"You have no contacts :-(",contacts_not_found_short:"No contacts match '{query}'",title_group_members:"Group Members",title_all_contacts:"All Contacts",button_ok:"OK",button_cancel:"Cancel",download_action:"download",label_file_name:"File name:",label_content_type:"Content type:",label_size:"Size:",error_invalid_id:"Invalid ID",group_user_id_prompt:"Group or User ID",button_subscribe:"Subscribe",topic_name_editing_placeholder:"Freeform name of the group",button_create:"Create",permission_join:"Join ({val})",permission_read:"Read ({val})",permission_write:"Write ({val})",permission_pres:"Get notified ({val})",permission_admin:"Approve ({val})",permission_share:"Share ({val})",permission_delete:"Delete ({val})",permission_owner:"Owner ({val})",title_permissions:"Permissions",message_sending:"sending...",message_sending_failed:"failed",search_placeholder:"List like email:alice@example.com, tel:17025550003...",messaging_disabled_prompt:"Messaging disabled",new_message_prompt:"New message",file_attachment_too_large:"The file size {size} exceeds the {limit} limit.",cannot_initiate_file_upload:"Cannot initiate file upload.",tags_not_found:"No tags defined. Add some.",tags_editor_no_tags:"Add some tags",title_manage_tags:"Manage tags"},ru:{contacts_not_found:"Чатов нет
¯\\\\_(ツ)_/¯",full_name_prompt:"Полное имя, напр. Иван Петров",email_prompt:"Email, напр. ivan@example.com",button_sign_up:"Создать счет",label_your_name:"Ваше имя",label_password:"Пароль",password_unchanged_prompt:"Не изменен",label_user_id:"Адрес:",label_default_access_mode:"Доступ по умолчанию:",label_message_sound:"Звук нового сообщения:",label_push_notifications:"Уведомления:",label_push_notifications_disabled:"Уведомления (требуют HTTPS):",title_tag_manager:"Таги для поиска",button_logout:"Выйти",login_prompt:"Логин",password_prompt:"Пароль",stay_logged_in:"Запомнить",forgot_password_link:"Напомнить пароль",button_sign_in:"Войти",label_client:"Клиент:",label_server:"Сервер:",online_now:"онлайн",last_seen_timestamp:"Был активен",title_not_found:"Не найден",unnamed_topic:"Без названия",messages_not_readable:"нет доступа к сообщениям",tabtitle_find_user:"найти",tabtitle_new_group:"создать",tabtitle_group_by_id:"по id",label_server_to_use:"Использовать сервер:",label_wire_transport:"Соединение:",button_update:"Применить",sidepanel_title_login:"Авторизация",sidepanel_title_register:"Зарегистрироваться",sidepanel_title_settings:"Настройки",sidepanel_title_edit_account:"Редактировать счет",sidepanel_title_newtpk:"Новый чат",sidepanel_title_cred:"Подтвердить",sidepanel_title_reset:"Сменить пароль",tags_not_found:"Тагов нет. Добавьте",tags_editor_no_tags:"Добавьте таги",title_manage_tags:"Редактор тагов",message_sending:"в пути...",message_sending_failed:"ошибка",search_placeholder:"Список, напр. email:alice@example.com, tel:17025550003...",messaging_disabled_prompt:"Отправка недоступна",new_message_prompt:"Новое сообщение",file_attachment_too_large:"Размер файла {size} превышает {limit} лимит.",cannot_initiate_file_upload:"Ошибка загрузки файла.",search_for_contacts:"Поиск контактов",enter_confirmation_code_prompt:"Код подтверждения, полученный по {method}:",numeric_confirmation_code_prompt:"Только цифры",button_confirm:"Подтвердить",button_ok:"OK",button_cancel:"Отменить",invalid_content:"сообщение не читается",label_file_name:"Имя файла:",label_content_type:"Тип:",label_size:"Размер:",phone_dative:"телефону",email_dative:"емейлу",title_group_members:"Участники",download_action:"скачать",permission_join:"Подписываться ({val})",permission_read:"Читать ({val})",permission_write:"Писать ({val})",permission_pres:"Уведомлять ({val})",permission_admin:"Подтверждать ({val})",permission_share:"Приглашать ({val})",permission_delete:"Удалять ({val})",permission_owner:"Владелец ({val})",title_permissions:"Права доступа",requested_permissions:"Требуются",granted_permissions:"Получены",menu_item_edit_permissions:"Права доступа",label_other_user:"Второй",label_topic_name:"Название",label_private:"Комментарий",private_editing_placeholder:"Виден только вам",label_muting_topic:"Без уведомлений",action_more:"Ещё",label_your_permissions:"Ваши права доступа:",label_permissions:"Права доступа:",label_you:"Вы:",label_default_access:"Права по умолчанию:",label_group_members:"Участники чата:",button_add_members:"Добавить",button_leave:"Отписаться",group_has_no_members:"Нет участников",action_leave_chat:"Уйти из чата",menu_item_info:"Информация",menu_item_clear_messages:"Удалить сообщения",menu_item_clear_messages_for_all:"Удалить для всех",menu_item_delete:"Удалить",menu_item_delete_for_all:"Удалить для всех",menu_item_mute:"Не уведомлять",menu_item_unmute:"Уведомлять",menu_item_delete_topic:"Удалить",menu_item_unblock:"Разблокировать",menu_item_block:"Заблокировать",menu_item_member_delete:"Отписать",title_info:"Подробности",new_password_placeholder:"Введите новый пароль",label_reset_password:"Отправить емейл для смены пароля:",credential_email_prompt:"Регистрационный емейл",button_reset:"Изменить",button_send_request:"Отправить",action_cancel:"отменить",upload_finishing:"завершение...",no_contacts:"Ничего нет :-(",contacts_not_found_short:"Нет контактов для запроса '{query}'",title_all_contacts:"Все контакты",error_invalid_id:"Неверный ID",group_user_id_prompt:"ID чата или пользователя",button_subscribe:"Подписаться",topic_name_editing_placeholder:"Название чата",button_create:"Создать"}}},function(e,t,n){"use strict";n(42);var r=function(e){return e&&"object"==typeof e&&"default"in e?e.default:e}(n(13));e.exports=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(8),o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i="[DEFAULT]",a=[],s=function(){function e(e,t,n){this.firebase_=n,this.isDeleted_=!1,this.services_={},this.name_=t.name,this._automaticDataCollectionEnabled=t.automaticDataCollectionEnabled||!1,this.options_=r.deepCopy(e),this.INTERNAL={getUid:function(){return null},getToken:function(){return Promise.resolve(null)},addAuthTokenListener:function(e){a.push(e),setTimeout(function(){return e(null)},0)},removeAuthTokenListener:function(e){a=a.filter(function(t){return t!==e})}}}return Object.defineProperty(e.prototype,"automaticDataCollectionEnabled",{get:function(){return this.checkDestroyed_(),this._automaticDataCollectionEnabled},set:function(e){this.checkDestroyed_(),this._automaticDataCollectionEnabled=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"name",{get:function(){return this.checkDestroyed_(),this.name_},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"options",{get:function(){return this.checkDestroyed_(),this.options_},enumerable:!0,configurable:!0}),e.prototype.delete=function(){var e=this;return new Promise(function(t){e.checkDestroyed_(),t()}).then(function(){e.firebase_.INTERNAL.removeApp(e.name_);var t=[];return Object.keys(e.services_).forEach(function(n){Object.keys(e.services_[n]).forEach(function(r){t.push(e.services_[n][r])})}),Promise.all(t.map(function(e){return e.INTERNAL.delete()}))}).then(function(){e.isDeleted_=!0,e.services_={}})},e.prototype._getService=function(e,t){if(void 0===t&&(t=i),this.checkDestroyed_(),this.services_[e]||(this.services_[e]={}),!this.services_[e][t]){var n=t!==i?t:void 0,r=this.firebase_.INTERNAL.factories[e](this,this.extendApp.bind(this),n);this.services_[e][t]=r}return this.services_[e][t]},e.prototype.extendApp=function(e){var t=this;r.deepExtend(this,e),e.INTERNAL&&e.INTERNAL.addAuthTokenListener&&(a.forEach(function(e){t.INTERNAL.addAuthTokenListener(e)}),a=[])},e.prototype.checkDestroyed_=function(){this.isDeleted_&&l("app-deleted",{name:this.name_})},e}();function l(e,t){throw u.create(e,t)}s.prototype.name&&s.prototype.options||s.prototype.delete||console.log("dc");var u=new r.ErrorFactory("app","Firebase",{"no-app":"No Firebase App '{$name}' has been created - call Firebase App.initializeApp()","bad-app-name":"Illegal App name: '{$name}","duplicate-app":"Firebase App named '{$name}' already exists","app-deleted":"Firebase App named '{$name}' already deleted","duplicate-service":"Firebase service named '{$name}' already registered","sa-not-supported":"Initializing the Firebase SDK with a service account is only allowed in a Node.js environment. On client devices, you should instead initialize the SDK with an api key and auth domain","invalid-app-argument":"firebase.{$name}() takes either no argument or a Firebase App instance."}),c=function e(){var t={},n={},a={},u={__esModule:!0,initializeApp:function(e,n){if(void 0===n&&(n={}),"object"!=typeof n||null===n){var r=n;n={name:r}}var a=n;void 0===a.name&&(a.name=i);var c=a.name;"string"==typeof c&&c||l("bad-app-name",{name:c+""}),o(t,c)&&l("duplicate-app",{name:c});var d=new s(e,a,u);return t[c]=d,p(d,"create"),d},app:c,apps:null,Promise:Promise,SDK_VERSION:"5.5.0",INTERNAL:{registerService:function(e,t,o,i,p){n[e]&&l("duplicate-service",{name:e}),n[e]=t,i&&(a[e]=i,d().forEach(function(e){i("create",e)}));var f=function(t){return void 0===t&&(t=c()),"function"!=typeof t[e]&&l("invalid-app-argument",{name:e}),t[e]()};return void 0!==o&&r.deepExtend(f,o),u[e]=f,s.prototype[e]=function(){for(var t=[],n=0;n=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}function l(e,t){return function(n,r){t(n,r,e)}}function u(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function c(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{l(r.next(e))}catch(e){i(e)}}function s(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(a,s)}l((r=r.apply(e,t||[])).next())})}function d(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=r[2&i[0]?"return":i[0]?"throw":"next"])&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[0,o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}function h(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function m(){for(var e=[],t=0;t1||s(e,t)})})}function s(e,t){try{!function(e){e.value instanceof y?Promise.resolve(e.value.v).then(l,u):c(i[0][2],e)}(o[e](t))}catch(e){c(i[0][3],e)}}function l(e){s("next",e)}function u(e){s("throw",e)}function c(e,t){e(t),i.shift(),i.length&&s(i[0][0],i[0][1])}}function g(e){var t,n;return t={},r("next"),r("throw",function(e){throw e}),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,o){e[r]&&(t[r]=function(t){return(n=!n)?{value:y(e[r](t)),done:"return"===r}:o?o(t):t})}}function b(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator];return t?t.call(e):f(e)}function _(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function w(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function E(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){(function(t){e.exports=function(){var e={},n=[{name:"ST",start:/(?:^|\W)(\*)[^\s*]/,end:/[^\s*](\*)(?=$|\W)/},{name:"EM",start:/(?:^|[\W_])(_)[^\s_]/,end:/[^\s_](_)(?=$|[\W_])/},{name:"DL",start:/(?:^|\W)(~)[^\s~]/,end:/[^\s~](~)(?=$|\W)/},{name:"CO",start:/(?:^|\W)(`)[^`]/,end:/[^`](`)(?=$|\W)/}],r=[{name:"LN",dataName:"url",pack:function(e){return/^[a-z]+:\/\//i.test(e)||(e="http://"+e),{url:e}},re:/(?:(?:https?|ftp):\/\/|www\.|ftp\.)[-A-Z0-9+&@#\/%=~_|$?!:,.]*[A-Z0-9+&@#\/%=~_|$]/gi},{name:"MN",dataName:"val",pack:function(e){return{val:e.slice(1)}},re:/\B@(\w\w+)/g},{name:"HT",dataName:"val",pack:function(e){return{val:e.slice(1)}},re:/\B#(\w\w+)/g}],o={ST:{name:"b",isVoid:!1},EM:{name:"i",isVoid:!1},DL:{name:"del",isVoid:!1},CO:{name:"tt",isVoid:!1},BR:{name:"br",isVoid:!0},LN:{name:"a",isVoid:!1},MN:{name:"a",isVoid:!1},HT:{name:"a",isVoid:!1},IM:{name:"img",isVoid:!0}};function i(e,t){var n;try{n=atob(e)}catch(e){console.log("Drafty: failed to decode base64-encoded object",e.message),n=atob("")}for(var r=n.length,o=new ArrayBuffer(r),i=new Uint8Array(o),a=0;a"},close:function(){return""}},EM:{open:function(){return""},close:function(){return""}},DL:{open:function(){return""},close:function(){return""}},CO:{open:function(){return""},close:function(){return""}},BR:{open:function(){return""},close:function(){return"
"}},LN:{open:function(e){return''},close:function(e){return""},props:function(e){return{href:e.url,target:"_blank"}}},MN:{open:function(e){return''},close:function(e){return""},props:function(e){return{name:e.val}}},HT:{open:function(e){return''},close:function(e){return""},props:function(e){return{name:e.val}}},IM:{open:function(e){var t=i(e.val,e.mime),n=e.ref?e.ref:t,r=(e.name?'':"")+'
';return console.log("open: "+r),r},close:function(e){return e.name?"":""},props:function(e){return{src:i(e.val,e.mime),title:e.name,"data-width":e.width,"data-height":e.height,"data-name":e.name,"data-size":.75*e.val.length|0,"data-mime":e.mime}}}},s=function(){};s.parse=function(e){if("string"!=typeof e)return null;var t=e.split(/\r?\n/),o=[],i={},a=[];t.map(function(e){var t,s,l=[];if(n.map(function(t){l=l.concat(function(e,t,n,r){for(var o=[],i=0,a=e.slice(0);a.length>0;){var s=t.exec(a);if(null==s)break;var l=s.index+s[0].lastIndexOf(s[1]);a=a.slice(l+1),i=(l+=i)+1;var u=n?n.exec(a):null;if(null==u)break;var c=u.index+u[0].indexOf(u[1]);a=a.slice(c+1),i=(c+=i)+1,o.push({text:e.slice(l+1,c),children:[],start:l,end:c,type:r})}return o}(e,t.start,t.end,t.name))}),0==l.length)s={txt:e};else{l.sort(function(e,t){return e.start-t.start}),l=function e(t){if(0==t.length)return[];for(var n=[t[0]],r=t[0],o=1;or.end?(n.push(t[o]),r=t[o]):t[o].endn&&i.push({text:t.slice(n,s.start)});var l={type:s.type},u=e(t,s.start+1,s.end-1,s.children);u.length>0?l.children=u:l.text=s.text,i.push(l),n=s.end+1}return no;return o=e.offset+e.len,t})}(s.txt)).length>0){var c=[];for(var d in t){var p=t[d],f=i[p.unique];f||(f=o.length,i[p.unique]=f,o.push({tp:p.type,data:p.data})),c.push({at:p.offset,len:p.len,key:f})}s.ent=c}a.push(s)});var s={txt:""};if(a.length>0){s.txt=a[0].txt,s.fmt=(a[0].fmt||[]).concat(a[0].ent||[]);for(var l=1;l0&&(s.ent=o)}return s},s.insertImage=function(e,t,n,r,o,i,a,s,l){return(e=e||{txt:" "}).ent=e.ent||[],e.fmt=e.fmt||[],e.fmt.push({at:t,len:1,key:e.ent.length}),e.ent.push({tp:"IM",data:{mime:n,val:r,width:o,height:i,name:a,ref:l,size:0|s}}),e},s.attachFile=function(e,t,n,r,o,i){(e=e||{txt:""}).ent=e.ent||[],e.fmt=e.fmt||[],e.fmt.push({at:-1,len:0,key:e.ent.length});var a={tp:"EX",data:{mime:t,val:n,name:r,ref:i,size:0|o}};return i instanceof Promise&&(a.data.ref=i.then(function(e){a.data.ref=e},function(e){})),e.ent.push(a),e},s.UNSAFE_toHTML=function(e){var t,n,r,o=e.txt,i=e.fmt,s=e.ent,l=[];if(i)for(var u in i){var c,d=i[u],p=d.tp;if(!p){var f=s[d.key];f&&(p=f.tp,c=f.data)}a[p]&&(l.push({idx:d.at+d.len,what:a[p].close(c)}),l.push({idx:d.at,what:a[p].open(c)}))}for(var u in l.sort(function(e,t){return t.idx-e.idx}),l)l[u].what&&(t=o,n=l[u].idx,r=l[u].what,o=t.slice(0,n)+r+t.slice(n));return o},s.format=function(e,t,n){var r=e.txt,i=e.fmt,a=e.ent;if(r=r||"",!i)return[r];var s=[].concat(i);return s.map(function(e){e.at=e.at||0,e.len=e.len||0}),s.sort(function(e,t){return e.at-t.at==0?t.len-e.len:e.at-t.at}),s=s.map(function(e){var t,n=e.tp;return n||(e.key=e.key||0,t=a[e.key].data,n=a[e.key].tp),{tp:n,data:t,at:e.at,len:e.len}}),function e(t,n,r,i,a,s){for(var l=[],u=0;u0)for(var t in e.ent)if("EX"==e.ent[t].tp)return!0;return!1},s.attachments=function(e,t,n){if(e.ent&&e.ent.length>0)for(var r in e.ent)"EX"==e.ent[r].tp&&t.call(n,e.ent[r].data,r)},s.getDownloadUrl=function(e){var t=null;return e.val?t=i(e.val,e.mime):"string"==typeof e.ref&&(t=e.ref),t},s.isUploading=function(e){return e.ref instanceof Promise},s.getPreviewUrl=function(e){return e.val?i(e.val,e.mime):null},s.getEntitySize=function(e){return e.size?e.size:e.val?.75*e.val.length|0:0},s.getEntityMimeType=function(e){return e.mime||"text/plain"},s.tagName=function(e){return o[e]?o[e].name:void 0},s.attrValue=function(e,t){if(t&&a[e])return a[e].props(t)},s.getContentType=function(){return"text/x-drafty"},e=s;var l={};return function(t){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var r,o="0.15.8-rc1";"undefined"!=typeof WebSocket&&(r=WebSocket),"undefined"==typeof btoa&&(t.btoa=function(){for(var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n="",r=0,o=0,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";t.charAt(0|o)||(i="=",o%1);n+=i.charAt(63&r>>8-o%1*8)){if((e=t.charCodeAt(o+=.75))>255)throw new Error("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");r=r<<8|e}return n}),"undefined"==typeof atob&&(t.atob=function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").replace(/=+$/,""),t="";if(e.length%4==1)throw new Error("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,r=0,o=0,i=0;n=e.charAt(i++);~n&&(o=r%4?64*o+n:n,r++%4)?t+=String.fromCharCode(255&o>>(-2*r&6)):0)n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(n);return t}),"undefined"==typeof window&&(t.window={WebSocket:r,URL:{createObjectURL:function(){throw new Error("Unable to use window.URL in a non browser application")}}});var i="0",a=o||"0.15",s="tinodejs/"+a,u=503,c="Connection failed";function d(e){return btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,function(e,t){return String.fromCharCode("0x"+t)}))}function p(e,t,r){if(null==t)return e;if("object"!==n(t))return t||e;if(t instanceof Date)return t;if(t instanceof w)return new w(t);if(t instanceof Array)return t.length>0?t:e;for(var o in e||(e=t.constructor()),t)!t.hasOwnProperty(o)||!t[o]&&!1!==t[o]||r&&r[o]||"_generated"==o||(e[o]=p(e[o],t[o]));return e}function f(e,t,n,r){return e[t]=p(e[t],n,r),e[t]}function h(){var e=null;if("withCredentials"in new XMLHttpRequest)e=new XMLHttpRequest;else{if("undefined"==typeof XDomainRequest)throw new Error("browser not supported");e=new XDomainRequest}return e}function m(e,t){if("ts"===e&&"string"==typeof t&&t.length>=20&&t.length<=24){var r=new Date(t);if(r)return r}else if("acs"===e&&"object"===n(t))return new w(t);return t}function y(e,t){return"string"==typeof t&&t.length>128?"<"+t.length+", bytes: "+t.substring(0,12)+"..."+t.substring(t.length-12)+">":function(e,t){if(t instanceof Date)t=function(e){if(e&&0!=e.getTime()){var t=e.getUTCMilliseconds();return e.getUTCFullYear()+"-"+n(e.getUTCMonth()+1)+"-"+n(e.getUTCDate())+"T"+n(e.getUTCHours())+":"+n(e.getUTCMinutes())+":"+n(e.getUTCSeconds())+(t?"."+n(t,3):"")+"Z"}function n(e,t){return"0".repeat((t=t||2)-(""+e).length)+e}}(t);else if(null==t||!1===t||Array.isArray(t)&&0==t.length||"object"===n(t)&&0===Object.keys(t).length)return;return t}(0,t)}function v(e,t,n){var r=null;return"http"!==t&&"https"!==t&&"ws"!==t&&"wss"!==t||(r=t+"://","/"!==(r+=e).charAt(r.length-1)&&(r+="/"),r+="v"+i+"/channels","http"!==t&&"https"!==t||(r+="/lp"),r+="?apikey="+n),r}var g=function(e,t,o,i,a){var s=this,l=e,d=i,p=t,f=a,y=2e3,g=10,b=.3,_=null,w=0,E=!1,S=function(e){s.logger&&s.logger(e)};function T(e){var t=null;e.connect=function(n){return t&&1===t.readyState?Promise.resolve():(n&&(l=n),new Promise(function(n,o){var i=v(l,d?"wss":"ws",p);S("Connecting to: "+i);var a=new r(i);a.onopen=function(t){E=!1,e.onOpen&&e.onOpen(),n(),f&&(clearTimeout(_),_=null,w=0)},a.onclose=function(n){t=null,e.onDisconnect&&e.onDisconnect(null),!E&&f&&function(){var e=this;clearTimeout(_);var t=y*(Math.pow(2,w)*(1+b*Math.random()));w=w>=g?w:w+1,_=setTimeout(function(){S("Reconnecting, iter="+w+", timeout="+t),E||e.connect().catch(function(){})},t)}.call(e)},a.onerror=function(e){o(e)},a.onmessage=function(t){e.onMessage&&e.onMessage(t.data)},t=a}))},e.disconnect=function(){t&&(E=!0,t.close()),t=null},e.sendText=function(e){if(!t||t.readyState!=t.OPEN)throw new Error("Websocket is not connected");t.send(e)},e.isConnected=function(){return t&&1===t.readyState},e.transport=function(){return"ws"}}function k(e){var t=null,n=null,r=null;e.connect=function(r){return n?Promise.resolve():(r&&(l=r),new Promise(function(r,o){var i=v(l,d?"https":"http",p);S("Connecting to: "+i),(n=function n(r,o,i){var a=h();return a.onreadystatechange=function(s){if(4==a.readyState)if(201==a.status){var l=JSON.parse(a.responseText,m);a.responseText,t=r+"&sid="+l.ctrl.params.sid,(a=n(t)).send(null),e.onOpen&&e.onOpen(),o&&o()}else if(200==a.status)e.onMessage&&e.onMessage(a.responseText),(a=n(t)).send(null);else if(i&&i(a.responseText),e.onMessage&&a.responseText&&e.onMessage(a.responseText),e.onDisconnect){var d=a.status||u,p=a.responseText||c;e.onDisconnect(new Error(p+"("+d+")"))}},a.open("GET",r,!0),a}(i,r,o)).send(null)}).catch(function(){}))},e.disconnect=function(){r&&(r.onreadystatechange=void 0,r.abort(),r=null),n&&(n.onreadystatechange=void 0,n.abort(),n=null),e.onDisconnect&&e.onDisconnect(null),t=null},e.sendText=function(e){var n,o;if(n=t,(o=h()).onreadystatechange=function(e){if(4==o.readyState&&o.status>=400)throw new Error("LP sender failed, "+o.status)},o.open("POST",n,!0),!(r=o)||1!=r.readyState)throw new Error("Long poller failed to connect");r.send(e)},e.isConnected=function(){return n&&!0},e.transport=function(){return"lp"}}"lp"===o?k(this):"ws"===o?T(this):"object"==("undefined"==typeof window?"undefined":n(window))&&window.WebSocket?T(this):k(this),this.onMessage=void 0,this.onDisconnect=void 0,this.onOpen=void 0,this.logger=void 0},b=function(e,t,r,o,i){var l=this;this._appName=e||"Undefined",this._apiKey=r,this._browser="",this._platform="undefined",this._humanLanguage="xx","undefined"!=typeof navigator&&(this._browser=function(e){var t,n=(e=(e||"").replace(" (KHTML, like Gecko)","")).match(/(AppleWebKit\/[.\d]+)/i);if(n){for(var r=["chrome","safari","mobile","version"],o=e.substr(n.index+n[0].length).split(" "),i=[],a=0;a0?i[0][0]+"/"+i[0][1]:n[1]}else t=/trident/i.test(e)?(n=/(?:\brv[ :]+([.\d]+))|(?:\bMSIE ([.\d]+))/g.exec(e))?"MSIE/"+(n[1]||n[2]):"MSIE/?":/firefox/i.test(e)?(n=/Firefox\/([.\d]+)/g.exec(e))?"Firefox/"+n[1]:"Firefox/?":/presto/i.test(e)?(n=/Opera\/([.\d]+)/g.exec(e))?"Opera/"+n[1]:"Opera/?":(n=/([\w.]+)\/([.\d]+)/.exec(e))?n[1]+"/"+n[2]:(n=e.split(" "))[0];if((n=t.split("/")).length>1){var l=n[1].split(".");t=n[0]+"/"+l[0]+(l[1]?"."+l[1]:"")}return t}(navigator.userAgent),this._platform=navigator.platform,this._humanLanguage=navigator.language||"en-US"),this._loggingEnabled=!1,this._trimLongStrings=!1,this._myUID=null,this._authenticated=!1,this._login=null,this._authToken=null,this._inPacketCount=0,this._messageId=Math.floor(65535*Math.random()+65535),this._serverInfo=null,this._deviceToken=null,this._pendingPromises={},this._connection=new g(t,r,o,i,!0),this.logger=function(e){if(l._loggingEnabled){var t=new Date,n=("0"+t.getUTCHours()).slice(-2)+":"+("0"+t.getUTCMinutes()).slice(-2)+":"+("0"+t.getUTCSeconds()).slice(-2)+":"+("0"+t.getUTCMilliseconds()).slice(-3);console.log("["+n+"] "+e)}},this._connection.logger=this.logger,this._cache={};var d=this.cachePut=function(e,t,n){l._cache[e+":"+t]=n},f=this.cacheGet=function(e,t){return l._cache[e+":"+t]},h=this.cacheDel=function(e,t){delete l._cache[e+":"+t]},v=this.cacheMap=function(e,t){for(var n in l._cache)if(e(l._cache[n],n,t))break};this.attachCacheToTopic=function(e){e._tinode=l,e._cacheGetUser=function(e){var t=f("user",e);if(t)return{user:e,public:p({},t)}},e._cachePutUser=function(e,t){return d("user",e,p({},t.public))},e._cacheDelUser=function(e){return h("user",e)},e._cachePutSelf=function(){return d("topic",e.name,e)},e._cacheDelSelf=function(){return h("topic",e.name)}};var b=function(e,t,n,r){var o=l._pendingPromises[e];o&&(delete l._pendingPromises[e],t>=200&&t<400?o.resolve&&o.resolve(n):o.reject&&o.reject(new Error("Error: "+r+" ("+t+")")))},_=this.getNextUniqueId=function(){return 0!=l._messageId?""+l._messageId++:void 0};this.initPacket=function(e,t){switch(e){case"hi":return{hi:{id:_(),ver:a,ua:l._appName+" ("+(l._browser?l._browser+"; ":"")+l._platform+"); "+s,dev:l._deviceToken,lang:l._humanLanguage}};case"acc":return{acc:{id:_(),user:null,scheme:null,secret:null,login:!1,tags:null,desc:{},cred:{}}};case"login":return{login:{id:_(),scheme:null,secret:null}};case"sub":return{sub:{id:_(),topic:t,set:{},get:{}}};case"leave":return{leave:{id:_(),topic:t,unsub:!1}};case"pub":return{pub:{id:_(),topic:t,noecho:!1,head:null,content:{}}};case"get":return{get:{id:_(),topic:t,what:null,desc:{},sub:{},data:{}}};case"set":return{set:{id:_(),topic:t,desc:{},sub:{},tags:[]}};case"del":return{del:{id:_(),topic:t,what:null,delseq:null,user:null,hard:!1}};case"note":return{note:{topic:t,what:null,seq:void 0}};default:throw new Error("Unknown packet type requested: "+e)}},this.send=function(e,t){var r;t&&(r=function(e){var t=null;return e&&(t=new Promise(function(t,n){l._pendingPromises[e]={resolve:t,reject:n}})),t}(t)),e=function e(t){return Object.keys(t).forEach(function(r){"_"==r[0]?delete t[r]:t[r]?Array.isArray(t[r])&&0==t[r].length?delete t[r]:t[r]?"object"!=n(t[r])||t[r]instanceof Date||(e(t[r]),0==Object.getOwnPropertyNames(t[r]).length&&delete t[r]):delete t[r]:delete t[r]}),t}(e);var o=JSON.stringify(e);l.logger("out: "+(l._trimLongStrings?JSON.stringify(e,y):o));try{l._connection.sendText(o)}catch(e){if(!t)throw e;b(t,u,null,e.message)}return r},this.loginSuccessful=function(e){e.params&&e.params.user&&(l._myUID=e.params.user,l._authenticated=e&&e.code>=200&&e.code<300,e.params&&e.params.token&&e.params.expires?l._authToken={token:e.params.token,expires:new Date(e.params.expires)}:l._authToken=null,l.onLogin&&l.onLogin(e.code,e.text))},this._connection.onMessage=function(e){if(e){l._inPacketCount++,l.onRawMessage&&l.onRawMessage(e);var t=JSON.parse(e,m);if(t)if(l.logger("in: "+(l._trimLongStrings?JSON.stringify(t,y):e)),l.onMessage&&l.onMessage(t),t.ctrl)l.onCtrlMessage&&l.onCtrlMessage(t.ctrl),t.ctrl.id&&b(t.ctrl.id,t.ctrl.code,t.ctrl,t.ctrl.text),t.ctrl.params&&"data"==t.ctrl.params.what&&(n=f("topic",t.ctrl.topic))&&n._allMessagesReceived(t.ctrl.params.count);else if(t.meta)(n=f("topic",t.meta.topic))&&n._routeMeta(t.meta),l.onMetaMessage&&l.onMetaMessage(t.meta);else if(t.data)(n=f("topic",t.data.topic))&&n._routeData(t.data),l.onDataMessage&&l.onDataMessage(t.data);else if(t.pres)(n=f("topic",t.pres.topic))&&n._routePres(t.pres),l.onPresMessage&&l.onPresMessage(t.pres);else if(t.info){var n;(n=f("topic",t.info.topic))&&n._routeInfo(t.info),l.onInfoMessage&&l.onInfoMessage(t.info)}else l.logger("ERROR: Unknown packet received.");else l.logger("in: "+e),l.logger("ERROR: failed to parse data")}},this._connection.onOpen=function(){l.hello()},this._connection.onDisconnect=function(e){for(var t in l._inPacketCount=0,l._serverInfo=null,l._authenticated=!1,l._pendingPromises){var n=l._pendingPromises[t];n&&n.reject&&n.reject(new Error(c+" ("+u+")"))}l._pendingPromises={},v(function(e,t){0===t.lastIndexOf("topic:",0)&&e._resetSub()}),l.onDisconnect&&l.onDisconnect(e)}};b.credential=function(e,t,r,o){if("object"==n(e)){var i=e;t=i.val,r=i.params,o=i.resp,e=i.meth}return e&&(t||o)?[{meth:e,val:t,resp:o,params:r}]:null},b.topicType=function(e){return{me:"me",fnd:"fnd",grp:"grp",new:"grp",usr:"p2p"}["string"==typeof e?e.substring(0,3):"xxx"]},b.isNewGroupTopicName=function(e){return"string"==typeof e&&"new"==e.substring(0,3)},b.getVersion=function(){return a},b.setWebSocketProvider=function(e){r=e},b.getLibrary=function(){return s},b.MESSAGE_STATUS_NONE=0,b.MESSAGE_STATUS_QUEUED=1,b.MESSAGE_STATUS_SENDING=2,b.MESSAGE_STATUS_FAILED=3,b.MESSAGE_STATUS_SENT=4,b.MESSAGE_STATUS_RECEIVED=5,b.MESSAGE_STATUS_READ=6,b.MESSAGE_STATUS_TO_ME=7,b.DEL_CHAR="␡",b.prototype={connect:function(e){return this._connection.connect(e)},disconnect:function(){this._connection&&this._connection.disconnect()},isConnected:function(){return this._connection&&this._connection.isConnected()},isAuthenticated:function(){return this._authenticated},account:function(e,t,n,r,o){var i=this.initPacket("acc");return i.acc.user=e,i.acc.scheme=t,i.acc.secret=n,i.acc.login=r,o&&(i.acc.desc.defacs=o.defacs,i.acc.desc.public=o.public,i.acc.desc.private=o.private,i.acc.tags=o.tags,i.acc.cred=o.cred,i.acc.token=o.token),this.send(i,i.acc.id)},createAccount:function(e,t,n,r){var o=this,i=this.account("new",e,t,n,r);return n&&(i=i.then(function(e){return o.loginSuccessful(e),e})),i},createAccountBasic:function(e,t,n){return e=e||"",t=t||"",this.createAccount("basic",d(e+":"+t),!0,n)},updateAccountBasic:function(e,t,n,r){return t=t||"",n=n||"",this.account(e,"basic",d(t+":"+n),!1,r)},hello:function(){var e=this,t=this.initPacket("hi");return this.send(t,t.hi.id).then(function(t){return t.params&&(e._serverInfo=t.params),e.onConnect&&e.onConnect(),t}).catch(function(t){e.onDisconnect&&e.onDisconnect(t)})},setDeviceToken:function(e,t){var n=!1;return e&&e!=this._deviceToken&&(this._deviceToken=e,t&&this.isConnected()&&this.isAuthenticated()&&(this.send({hi:{dev:e}}),n=!0)),n},login:function(e,t,n){var r=this,o=this.initPacket("login");return o.login.scheme=e,o.login.secret=t,o.login.cred=n,this.send(o,o.login.id).then(function(e){return r.loginSuccessful(e),e})},loginBasic:function(e,t,n){var r=this;return this.login("basic",d(e+":"+t),n).then(function(t){return r._login=e,t})},loginToken:function(e,t){return this.login("token",e,t)},requestResetAuthSecret:function(e,t,n){return this.login("reset",d(e+":"+t+":"+n))},getAuthToken:function(){return this._authToken&&this._authToken.expires.getTime()>Date.now()?this._authToken:(this._authToken=null,null)},setAuthToken:function(e){this._authToken=e},subscribe:function(e,t,n){var r=this.initPacket("sub",e);return e||(e="new"),r.sub.get=t,n&&(n.sub&&(r.sub.set.sub=n.sub),b.isNewGroupTopicName(e)&&n.desc&&(r.sub.set.desc=n.desc),n.tags&&(r.sub.set.tags=n.tags)),this.send(r,r.sub.id)},leave:function(e,t){var n=this.initPacket("leave",e);return n.leave.unsub=t,this.send(n,n.leave.id)},createMessage:function(t,n,r){var o=this.initPacket("pub",t),i="string"==typeof n?e.parse(n):n;return i&&!e.isPlainText(i)&&(o.pub.head={mime:e.getContentType()},n=i),o.pub.noecho=r,o.pub.content=n,o.pub},publish:function(e,t,n){return this.publishMessage(this.createMessage(e,t,n))},publishMessage:function(e){return(e=Object.assign({},e)).seq=void 0,e.from=void 0,e.ts=void 0,this.send({pub:e},e.id)},getMeta:function(e,t){var n=this.initPacket("get",e);return n.get=p(n.get,t),this.send(n,n.get.id)},setMeta:function(e,t){var n=this.initPacket("set",e),r=[];return t&&["desc","sub","tags"].map(function(e){t.hasOwnProperty(e)&&(r.push(e),n.set[e]=t[e])}),0==r.length?Promise.reject(new Error("Invalid {set} parameters")):this.send(n,n.set.id)},delMessages:function(e,t,n){var r=this.initPacket("del",e);return r.del.what="msg",r.del.delseq=t,r.del.hard=n,this.send(r,r.del.id)},delTopic:function(e){var t=this,n=this.initPacket("del",e);return n.del.what="topic",this.send(n,n.del.id).then(function(n){return t.cacheDel("topic",e),t.ctrl})},delSubscription:function(e,t){var n=this.initPacket("del",e);return n.del.what="sub",n.del.user=t,this.send(n,n.del.id)},note:function(e,t,n){if(n<=0||n>=268435455)throw new Error("Invalid message id "+n);var r=this.initPacket("note",e);r.note.what=t,r.note.seq=n,this.send(r)},noteKeyPress:function(e){var t=this.initPacket("note",e);t.note.what="kp",this.send(t)},getTopic:function(e){var t=this.cacheGet("topic",e);return!t&&e&&(t="me"==e?new S:"fnd"==e?new T:new E(e),this.cachePut("topic",e,t),this.attachCacheToTopic(t)),t},newTopic:function(e){var t=new E("new",e);return this.attachCacheToTopic(t),t},newGroupTopicName:function(){return"new"+this.getNextUniqueId()},newTopicWith:function(e,t){var n=new E(e,t);return this.attachCacheToTopic(n),n},getMeTopic:function(){return this.getTopic("me")},getFndTopic:function(){return this.getTopic("fnd")},getLargeFileHelper:function(){return new k(this)},getCurrentUserID:function(){return this._myUID},getCurrentLogin:function(){return this._login},getServerInfo:function(){return this._serverInfo},enableLogging:function(e,t){this._loggingEnabled=e,this._trimLongStrings=e&&t},isTopicOnline:function(e){var t=this.getMeTopic(),n=t&&t.getContact(e);return n&&n.online},wantAkn:function(e){this._messageId=e?Math.floor(16777215*Math.random()+16777215):0},onWebsocketOpen:void 0,onConnect:void 0,onDisconnect:void 0,onLogin:void 0,onCtrlMessage:void 0,onDataMessage:void 0,onPresMessage:void 0,onMessage:void 0,onRawMessage:void 0};var _=function(e){this.topic=e;var t=e._tinode.getMeTopic();this.contact=t&&t.getContact(e.name),this.what={}};_.prototype={_get_ims:function(){var e=this.contact&&this.contact.updated,t=this.topic._lastDescUpdate||0;return e>t?e:t},withData:function(e,t,n){return this.what.data={since:e,before:t,limit:n},this},withLaterData:function(e){return this.withData(this.topic._maxSeq>0?this.topic._maxSeq+1:void 0,void 0,e)},withEarlierData:function(e){return this.withData(void 0,this.topic._minSeq>0?this.topic._minSeq:void 0,e)},withDesc:function(e){return this.what.desc={ims:e},this},withLaterDesc:function(){return this.withDesc(this._get_ims())},withSub:function(e,t,n){var r={ims:e,limit:t};return"me"==this.topic.getType()?r.topic=n:r.user=n,this.what.sub=r,this},withOneSub:function(e,t){return this.withSub(e,void 0,t)},withLaterOneSub:function(e){return this.withOneSub(this.topic._lastSubsUpdate,e)},withLaterSub:function(e){return this.withSub("p2p"==this.topic.getType()?this._get_ims():this.topic._lastSubsUpdate,e)},withTags:function(){return this.what.tags=!0,this},withDel:function(e,t){return(e||t)&&(this.what.del={since:e,limit:t}),this},withLaterDel:function(e){return this.withDel(this.topic._maxSeq>0?this.topic._maxDel+1:void 0,e)},build:function(){var e={},t=[],n=this;return["data","sub","desc","tags","del"].map(function(r){n.what.hasOwnProperty(r)&&(t.push(r),Object.getOwnPropertyNames(n.what[r]).length>0&&(e[r]=n.what[r]))}),t.length>0?e.what=t.join(" "):e=void 0,e}};var w=function e(t){t&&(this.given="number"==typeof t.given?t.given:e.decode(t.given),this.want="number"==typeof t.want?t.want:e.decode(t.want),this.mode=t.mode?"number"==typeof t.mode?t.mode:e.decode(t.mode):this.given&this.want)};w._NONE=0,w._JOIN=1,w._READ=2,w._WRITE=4,w._PRES=8,w._APPROVE=16,w._SHARE=32,w._DELETE=64,w._OWNER=128,w._BITMASK=w._JOIN|w._READ|w._WRITE|w._PRES|w._APPROVE|w._SHARE|w._DELETE|w._OWNER,w._INVALID=1048576,w.decode=function(e){if(!e)return null;if("number"==typeof e)return e&w._BITMASK;if("N"===e||"n"===e)return w._NONE;for(var t={J:w._JOIN,R:w._READ,W:w._WRITE,P:w._PRES,A:w._APPROVE,S:w._SHARE,D:w._DELETE,O:w._OWNER},n=w._NONE,r=0;r0)){l=!0;break}i=a-1}return l?a:r?-1:s<0?a+1:a}function r(e,t){var r=n(e,t,!1);return t.splice(r,0,e),t}return e=e||function(e,t){return e===t?0:e0)return n[0]},delRange:function(e,n){return t.splice(e,n-e)},size:function(){return t.length},reset:function(e){t=[]},forEach:function(e,n,r,o){n|=0,r=r||t.length;for(var i=n;i=300)return e;if(n._subscribed=!0,n.acs=e.params&&e.params.acs?e.params.acs:n.acs,n._new){n._new=!1,n.name=e.topic,n.created=e.ts,n.updated=e.ts,n.touched=e.ts,n._cachePutSelf();var r=n._tinode.getMeTopic();r&&r._processMetaSub([{_generated:!0,topic:n.name,created:e.ts,updated:e.ts,touched:e.ts,acs:n.acs}]),t&&t.desc&&(t.desc._generated=!0,n._processMetaDesc(t.desc))}return e})},createMessage:function(e,t){return this._tinode.createMessage(this.name,e,t)},publish:function(e,t){return this.publishMessage(this.createMessage(e,t))},publishMessage:function(t){var n=this;if(!this._subscribed)return Promise.reject(new Error("Cannot publish on inactive topic"));if(e.hasAttachments(t.content)&&!t.head.attachments){var r=[];e.attachments(t.content,function(e){r.push(e.ref)}),t.head.attachments=r}return t._sending=!0,this._tinode.publishMessage(t).then(function(e){return t._sending=!1,t.seq=e.params.seq,t.ts=e.ts,n._routeData(t),e}).catch(function(e){t._sending=!1,t._failed=!0})},publishDraft:function(e,t){var n=this;if(!t&&!this._subscribed)return Promise.reject(new Error("Cannot publish on inactive topic"));var r=e.seq||this._getQueuedSeqId();return e._generated||(e._generated=!0,e.seq=r,e.ts=new Date,e.from=this._tinode.getCurrentUserID(),e.noecho=!0,this._messages.put(e),this.onData&&this.onData(e)),(t||Promise.resolve()).then(function(){return e._cancelled?{code:300,text:"cancelled"}:n.publishMessage(e)},function(t){e._sending=!1,n._messages.delAt(n._messages.find(e)),n.onData&&n.onData()})},leave:function(e){var t=this;return this._subscribed||e?this._tinode.leave(this.name,e).then(function(n){return t._resetSub(),e&&t._gone(),n}):Promise.reject(new Error("Cannot leave inactive topic"))},getMeta:function(e){return this._subscribed?this._tinode.getMeta(this.name,e):Promise.reject(new Error("Cannot query inactive topic"))},getMessagesPage:function(e,t){var n=this,r=this.startMetaQuery();t?r.withLaterData(e):r.withEarlierData(e);var o=this.getMeta(r.build());return t||(o=o.then(function(e){e&&e.params&&!e.params.count&&(n._noEarlierMsgs=!0)})),o},setMeta:function(e){var t=this;return this._subscribed?(e.tags&&(e.tags=function(e){var t=[];if(Array.isArray(e)){for(var n=0,r=e.length;n1&&t.push(o)}t.sort().filter(function(e,t,n){return!t||e!=n[t-1]})}return 0==t.length&&t.push(b.DEL_CHAR),t}(e.tags)),this._tinode.setMeta(this.name,e).then(function(n){return n&&n.code>=300?n:(e.sub&&(n.params&&n.params.acs&&(e.sub.acs=n.params.acs,e.sub.updated=n.ts),e.sub.user||(e.sub.user=t._tinode.getCurrentUserID(),e.desc||(e.desc={})),e.sub._generated=!0,t._processMetaSub([e.sub])),e.desc&&(n.params&&n.params.acs&&(e.desc.acs=n.params.acs,e.desc.updated=n.ts),t._processMetaDesc(e.desc)),e.tags&&t._processMetaTags(e.tags),n)})):Promise.reject(new Error("Cannot update inactive topic"))},invite:function(e,t){return this.setMeta({sub:{user:e,mode:t}})},delMessages:function(e,t){var n=this;if(!this._subscribed)return Promise.reject(new Error("Cannot delete messages in inactive topic"));e.sort(function(e,t){return e.low=t.hi)});var r=e.reduce(function(e,t){return t.low<268435455&&(!t.hi||t.hi<268435455?e.push(t):e.push({low:t.low,hi:n._maxSeq+1})),e},[]);return(e.length>0?this._tinode.delMessages(this.name,r,t):Promise.resolve({params:{del:0}})).then(function(t){return t.params.del>n._maxDel&&(n._maxDel=t.params.del),e.map(function(e){e.hi?n.flushMessageRange(e.low,e.hi):n.flushMessage(e.low)}),n.onData&&n.onData(),t})},delMessagesAll:function(e){return this.delMessages([{low:1,hi:this._maxSeq+1,_all:!0}],e)},delMessagesList:function(e,t){e.sort(function(e,t){return e-t});var n=e.reduce(function(e,t){if(0==e.length)e.push({low:t});else{var n=e[e.length-1];!n.hi&&t!=n.low+1||t>n.hi?e.push({low:t}):n.hi=n.hi?Math.max(n.hi,t+1):t+1}return e},[]);return this.delMessages(n,t)},delTopic:function(){var e=this;return this._tinode.delTopic(this.name).then(function(t){return e._resetSub(),e._gone(),t})},delSubscription:function(e){var t=this;return this._subscribed?this._tinode.delSubscription(this.name,e).then(function(n){return delete t._users[e],t.onSubsUpdated&&t.onSubsUpdated(Object.keys(t._users)),n}):Promise.reject(new Error("Cannot delete subscription in inactive topic"))},note:function(e,t){var n=this._users[this._tinode.getCurrentUserID()];n?((!n[e]||n[e]0)for(var o in this._users){var i=this._users[o];i.user!==r&&i[e]>=t&&n++}return n},msgReadCount:function(e){return this.msgReceiptCount("read",e)},msgRecvCount:function(e){return this.msgReceiptCount("recv",e)},msgHasMoreMessages:function(e){return e?this.seq>this._maxSeq:this._minSeq>1&&!this._noEarlierMsgs},isNewMessage:function(e){return this._maxSeq<=e},flushMessage:function(e){var t=this._messages.find({seq:e});return t>=0?this._messages.delAt(t):void 0},flushMessageRange:function(e,t){var n=this._messages.find({seq:e});return n>=0?this._messages.delRange(n,this._messages.find({seq:t},!0)):[]},cancelSend:function(e){var t=this._messages.find({seq:e});if(t>=0){var n=this._messages.getAt(t);if(1==this.msgStatus(n))return n._cancelled=!0,this._messages.delAt(t),!0}return!1},getType:function(){return b.topicType(this.name)},getAccessMode:function(){return this.acs},getDefaultAccess:function(){return this.defacs},startMetaQuery:function(){return new _(this)},msgStatus:function(e){var t=0;return e.from==this._tinode.getCurrentUserID()?e._sending?t=2:e._failed?t=3:e.seq>=268435455?t=1:this.msgReadCount(e.seq)>0?t=6:this.msgRecvCount(e.seq)>0?t=5:e.seq>0&&(t=4):t=7,t},_routeData:function(e){e.content&&((!this.touched||this.touchedthis._maxSeq&&(this._maxSeq=e.seq),(e.seq0&&(this._lastSubsUpdate=e.ts,this._processMetaSub(e.sub)),e.del&&this._processDelMessages(e.del.clear,e.del.delseq),e.tags&&this._processMetaTags(e.tags),this.onMeta&&this.onMeta(e)},_routePres:function(e){var t;switch(e.what){case"del":this._processDelMessages(e.clear,e.delseq);break;case"on":case"off":(t=this._users[e.src])?t.online="on"==e.what:this._tinode.logger("Presence update for an unknown user",this.name,e.src);break;case"acs":var n="me"==e.src?this._tinode.getCurrentUserID():e.src;if(t=this._users[n])t.acs.updateAll(e.dacs),n==this._tinode.getCurrentUserID()&&this.acs.updateAll(e.dacs),t.acs&&t.acs.mode!=w._NONE||("p2p"==this.getType()&&this.leave(),this._processMetaSub([{user:n,deleted:new Date,_generated:!0}]));else{var r=(new w).updateAll(e.dacs);r&&r.mode!=w._NONE&&((t=this._cacheGetUser(n))?t.acs=r:(t={user:n,acs:r},this.getMeta(this.startMetaQuery().withOneSub(void 0,n).build())),t._generated=!0,t.updated=new Date,this._processMetaSub([t]))}break;default:this._tinode.logger("Ignored presence update",e.what)}this.onPres&&this.onPres(e)},_routeInfo:function(e){if("kp"!==e.what){var t=this._users[e.from];t&&(t[e.what]=e.seq)}this.onInfo&&this.onInfo(e)},_processMetaDesc:function(e,t){if(p(this,e),"string"==typeof this.created&&(this.created=new Date(this.created)),"string"==typeof this.updated&&(this.updated=new Date(this.updated)),"string"==typeof this.touched&&(this.touched=new Date(this.touched)),"me"!==this.name&&!t&&!e._generated){var n=this._tinode.getMeTopic();n&&n._processMetaSub([{_generated:!0,topic:this.name,updated:this.updated,touched:this.touched,acs:this.acs,public:this.public,private:this.private}])}this.onMetaDesc&&this.onMetaDesc(this)},_processMetaSub:function(e){var t=void 0;for(var n in e){var r=e[n];if(r.user){r.updated=new Date(r.updated),r.deleted=r.deleted?new Date(r.deleted):null;var o=null;r.deleted?(delete this._users[r.user],o=r):((o=this._users[r.user])||(o=this._cacheGetUser(r.user)),o=this._updateCachedUser(r.user,r,r._generated)),this.onMetaSub&&this.onMetaSub(o)}else r._generated||(t=r)}t&&this.onMetaDesc&&this.onMetaDesc(t),this.onSubsUpdated&&this.onSubsUpdated(Object.keys(this._users))},_processMetaTags:function(e){1==e.length&&e[0]==b.DEL_CHAR&&(e=[]),this._tags=e,this.onTagsUpdated&&this.onTagsUpdated(e)},_processDelMessages:function(e,t){this._maxDel=Math.max(e,this._maxDel),this.clear=Math.max(e,this.clear);var n=this,r=0;Array.isArray(t)&&t.map(function(e){if(e.hi)for(var t=e.low;t0&&this.onData&&this.onData()},_allMessagesReceived:function(e){this.onAllMessagesReceived&&this.onAllMessagesReceived(e)},_resetSub:function(){this._subscribed=!1},_gone:function(){this._messages.reset(),this._users={},this.acs=new w(null),this.private=null,this.public=null,this._maxSeq=0,this._minSeq=0,this._subscribed=!1;var e=this._tinode.getMeTopic();e&&e._routePres({_generated:!0,what:"gone",topic:"me",src:this.name}),this.onDeleteTopic&&this.onDeleteTopic()},_updateCachedUser:function(e,t,n){var r=this._cacheGetUser(e);return r?r=p(r,t):(n&&this.getMeta(this.startMetaQuery().withLaterOneSub(e).build()),r=p({},t)),this._cachePutUser(e,r),f(this._users,e,r)},_getQueuedSeqId:function(){return this._queuedSeqId++}};var S=function(e){E.call(this,"me",e),this._contacts={},e&&(this.onContactUpdate=e.onContactUpdate)};S.prototype=Object.create(E.prototype,{_processMetaSub:{value:function(e){var t=0;for(var n in e){var r=e[n],o=r.topic;if("fnd"!=o&&"me"!=o){r.updated=new Date(r.updated),r.touched=r.touched?new Date(r.touched):null,r.deleted=r.deleted?new Date(r.deleted):null,r.seq=0|r.seq,r.recv=0|r.recv,r.read=0|r.read,r.unread=r.seq-r.read;var i=null;if(r.deleted)i=r,delete this._contacts[o];else if(r.seen&&r.seen.when&&(r.seen.when=new Date(r.seen.when)),i=f(this._contacts,o,r),"p2p"==b.topicType(o)&&this._cachePutUser(o,i),!r._generated){var a=this._tinode.getTopic(o);a&&a._processMetaDesc(r,!0)}t++,this.onMetaSub&&this.onMetaSub(i)}}t>0&&this.onSubsUpdated&&this.onSubsUpdated(Object.keys(this._contacts))},enumerable:!0,configurable:!0,writable:!1},_routePres:{value:function(e){var t=this._contacts[e.src];if(t){switch(e.what){case"on":t.online=!0;break;case"off":t.online&&(t.online=!1,t.seen?t.seen.when=new Date:t.seen={when:new Date});break;case"msg":t.touched=new Date,t.seq=0|e.seq,t.unread=t.seq-t.read;break;case"upd":this.getMeta(this.startMetaQuery().withLaterOneSub(e.src).build());break;case"acs":t.acs?t.acs.updateAll(e.dacs):t.acs=(new w).updateAll(e.dacs);break;case"ua":t.seen={when:new Date,ua:e.ua};break;case"recv":t.recv=t.recv?Math.max(t.recv,e.seq):0|e.seq;break;case"read":t.read=t.read?Math.max(t.read,e.seq):0|e.seq,t.unread=t.seq-t.read;break;case"gone":delete this._contacts[e.src]}this.onContactUpdate&&this.onContactUpdate(e.what,t)}else if("acs"==e.what){var n=new w(e.dacs);if(!n||n.mode==w._INVALID)return void this._tinode.logger("Invalid access mode update",e.src,e.dacs);if(n.mode==w._NONE)return void this._tinode.logger("Removing non-existent subscription",e.src,e.dacs);this.getMeta(this.startMetaQuery().withOneSub(void 0,e.src).build()),this._contacts[e.src]={topic:e.src,online:!1,acs:n}}this.onPres&&this.onPres(e)},enumerable:!0,configurable:!0,writable:!1},publish:{value:function(){return Promise.reject(new Error("Publishing to 'me' is not supported"))},enumerable:!0,configurable:!0,writable:!1},contacts:{value:function(e,t){var n=e||this.onMetaSub;if(n)for(var r in this._contacts)n.call(t,this._contacts[r],r,this._contacts)},enumerable:!0,configurable:!0,writable:!0},setMsgReadRecv:{value:function(e,t,n,r){var o,i=this._contacts[e],a=!1;i&&(n|=0,"recv"===t?(o=i.recv,i.recv=i.recv?Math.max(i.recv,n):n,a=o!=i.recv):"read"===t?(o=i.read,i.read=i.read?Math.max(i.read,n):n,i.unread=i.seq-i.read,a=o!=i.read,i.recv0&&this.onSubsUpdated&&this.onSubsUpdated(Object.keys(this._contacts))},enumerable:!0,configurable:!0,writable:!1},publish:{value:function(){return Promise.reject(new Error("Publishing to 'fnd' is not supported"))},enumerable:!0,configurable:!0,writable:!1},setMeta:{value:function(e){var t=this;return Object.getPrototypeOf(T.prototype).setMeta.call(this,e).then(function(){Object.keys(t._contacts).length>0&&(t._contacts={},t.onSubsUpdated&&t.onSubsUpdated([]))})},enumerable:!0,configurable:!0,writable:!1},contacts:{value:function(e,t){var n=e||this.onMetaSub;if(n)for(var r in this._contacts)n.call(t,this._contacts[r],r,this._contacts)},enumerable:!0,configurable:!0,writable:!0}}),T.prototype.constructor=T;var k=function(e){this._tinode=e,this._apiKey=e._apiKey,this._authToken=e.getAuthToken(),this._msgId=e.getNextUniqueId(),this.xhr=h(),this.toResolve=null,this.toReject=null,this.onProgress=null,this.onSuccess=null,this.onFailure=null};k.prototype={upload:function(e,t,n,r){var o=this;if(!this._authToken)throw new Error("Must authenticate first");var a=this;this.xhr.open("POST","/v"+i+"/file/u/",!0),this.xhr.setRequestHeader("X-Tinode-APIKey",this._apiKey),this.xhr.setRequestHeader("X-Tinode-Auth","Token "+this._authToken.token);var s=new Promise(function(e,t){o.toResolve=e,o.toReject=t});this.onProgress=t,this.onSuccess=n,this.onFailure=r,this.xhr.upload.onprogress=function(e){e.lengthComputable&&a.onProgress&&a.onProgress(e.loaded/e.total)},this.xhr.onload=function(){var e;try{e=JSON.parse(this.response,m)}catch(e){a._tinode.logger("Invalid server response in LargeFileHelper",this.response)}this.status>=200&&this.status<300?(a.toResolve&&a.toResolve(e.ctrl.params.url),a.onSuccess&&a.onSuccess(e.ctrl)):this.status>=400?(a.toReject&&a.toReject(new Error(e.ctrl.text+" ("+e.ctrl.code+")")),a.onFailure&&a.onFailure(e.ctrl)):a._tinode.logger("Unexpected server response status",this.status,this.response)},this.xhr.onerror=function(e){a.toReject&&a.toReject(new Error("failed")),a.onFailure&&a.onFailure(null)},this.xhr.onabort=function(e){a.toReject&&a.toReject(new Error("upload cancelled by user")),a.onFailure&&a.onFailure(null)};try{var l=new FormData;l.append("file",e),l.set("id",this._msgId),this.xhr.send(l)}catch(e){this.toReject&&this.toReject(e),this.onFailure&&this.onFailure(null)}return s},download:function(e,t,n,r){var o=this;if(/^(?:(?:[a-z]+:)?\/\/)/i.test(e))throw new Error("The URL '"+e+"' must be relative, not absolute");if(!this._authToken)throw new Error("Must authenticate first");var i=this;this.xhr.open("GET",e,!0),this.xhr.setRequestHeader("X-Tinode-APIKey",this._apiKey),this.xhr.setRequestHeader("X-Tinode-Auth","Token "+this._authToken.token),this.xhr.responseType="blob",this.onProgress=r,this.xhr.onprogress=function(e){i.onProgress&&i.onProgress(e.loaded)};var a=new Promise(function(e,t){o.toResolve=e,o.toReject=t});this.xhr.onload=function(){if(200==this.status){var e=document.createElement("a");e.href=window.URL.createObjectURL(new Blob([this.response],{type:n})),e.style.display="none",e.setAttribute("download",t),document.body.appendChild(e),e.click(),document.body.removeChild(e),window.URL.revokeObjectURL(e.href),i.toResolve&&i.toResolve()}else if(this.status>=400&&i.toReject){var r=new FileReader;r.onload=function(){try{var e=JSON.parse(this.result,m);i.toReject(new Error(e.ctrl.text+" ("+e.ctrl.code+")"))}catch(e){i._tinode.logger("Invalid server response in LargeFileHelper",this.result),i.toReject(e)}},r.readAsText(this.response)}},this.xhr.onerror=function(e){i.toReject&&i.toReject(new Error("failed"))},this.xhr.onabort=function(){i.toReject&&i.toReject(null)};try{this.xhr.send()}catch(e){this.toReject&&this.toReject(e)}return a},cancel:function(){this.xhr&&this.xhr.readyState<4&&this.xhr.abort()},getId:function(){return this._msgId}};var C=function e(t,n){this.status=e.STATUS_NONE,this.topic=t,this.content=n};C.STATUS_NONE=0,C.STATUS_QUEUED=1,C.STATUS_SENDING=2,C.STATUS_FAILED=3,C.STATUS_SENT=4,C.STATUS_RECEIVED=5,C.STATUS_READ=6,C.STATUS_TO_ME=7,(C.prototype={toJSON:function(){},fromJSON:function(e){}}).constructor=C,(l=b).Drafty=e}.call(this,void 0!==t?t:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{}),l}()}).call(this,n(10))},function(e,t,n){e.exports=n(38)()},function(e,t,n){"use strict";!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}(),e.exports=n(21)},function(e,t,n){"use strict";var r=n(24).default;n(31),(t=e.exports=r).default=t},function(e,t,n){"use strict";(t=e.exports=n(40).default).default=t},function(e,t,n){"use strict";var r=n(32).default;n(37),(t=e.exports=r).default=t},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),o={NODE_CLIENT:!1,NODE_ADMIN:!1,SDK_VERSION:"${JSCORE_VERSION}"},i=function(e,t){if(!e)throw a(t)},a=function(e){return new Error("Firebase Database ("+o.SDK_VERSION+") INTERNAL ASSERT FAILED: "+e)},s=function(e){for(var t=[],n=0,r=0;r>6|192,t[n++]=63&o|128):55296==(64512&o)&&r+1>18|240,t[n++]=o>>12&63|128,t[n++]=o>>6&63|128,t[n++]=63&o|128):(t[n++]=o>>12|224,t[n++]=o>>6&63|128,t[n++]=63&o|128)}return t},l={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:"function"==typeof atob,encodeByteArray:function(e,t){if(!Array.isArray(e))throw Error("encodeByteArray takes an array as a parameter");this.init_();for(var n=t?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[],o=0;o>2,d=(3&i)<<4|s>>4,p=(15&s)<<2|u>>6,f=63&u;l||(f=64,a||(p=64)),r.push(n[c],n[d],n[p],n[f])}return r.join("")},encodeString:function(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(s(e),t)},decodeString:function(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):function(e){for(var t=[],n=0,r=0;n191&&o<224){var i=e[n++];t[r++]=String.fromCharCode((31&o)<<6|63&i)}else if(o>239&&o<365){var a=((7&o)<<18|(63&(i=e[n++]))<<12|(63&(s=e[n++]))<<6|63&e[n++])-65536;t[r++]=String.fromCharCode(55296+(a>>10)),t[r++]=String.fromCharCode(56320+(1023&a))}else{i=e[n++];var s=e[n++];t[r++]=String.fromCharCode((15&o)<<12|(63&i)<<6|63&s)}}return t.join("")}(this.decodeStringToByteArray(e,t))},decodeStringToByteArray:function(e,t){this.init_();for(var n=t?this.charToByteMapWebSafe_:this.charToByteMap_,r=[],o=0;o>4;if(r.push(u),64!=s){var c=a<<4&240|s>>2;if(r.push(c),64!=l){var d=s<<6&192|l;r.push(d)}}}return r},init_:function(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(var e=0;e=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(e)]=e,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(e)]=e)}}},u=function(e){try{return l.decodeString(e,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};function c(e,t){if(!(t instanceof Object))return t;switch(t.constructor){case Date:return new Date(t.getTime());case Object:void 0===e&&(e={});break;case Array:e=[];break;default:return t}for(var n in t)t.hasOwnProperty(n)&&(e[n]=c(e[n],t[n]));return e}var d=function(){function e(){var e=this;this.promise=new Promise(function(t,n){e.resolve=t,e.reject=n})}return e.prototype.wrapCallback=function(e){var t=this;return function(n,r){n?t.reject(n):t.resolve(r),"function"==typeof e&&(t.promise.catch(function(){}),1===e.length?e(n):e(n,r))}},e}(),p=function(){return"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:""},f="FirebaseError",h=Error.captureStackTrace;var m=function(){return function(e,t){if(this.code=e,this.message=t,h)h(this,y.prototype.create);else try{throw Error.apply(this,arguments)}catch(e){this.name=f,Object.defineProperty(this,"stack",{get:function(){return e.stack}})}}}();m.prototype=Object.create(Error.prototype),m.prototype.constructor=m,m.prototype.name=f;var y=function(){function e(e,t,n){this.service=e,this.serviceName=t,this.errors=n,this.pattern=/\{\$([^}]+)}/g}return e.prototype.create=function(e,t){void 0===t&&(t={});var n,r=this.errors[e],o=this.service+"/"+e;n=void 0===r?"Error":r.replace(this.pattern,function(e,n){var r=t[n];return void 0!==r?r.toString():"<"+n+"?>"}),n=this.serviceName+": "+n+" ("+o+").";var i=new m(o,n);for(var a in t)t.hasOwnProperty(a)&&"_"!==a.slice(-1)&&(i[a]=t[a]);return i},e}();function v(e){return JSON.parse(e)}var g=function(e){var t={},n={},r={},o="";try{var i=e.split(".");t=v(u(i[0])||""),n=v(u(i[1])||""),o=i[2],r=n.d||{},delete n.d}catch(e){}return{header:t,claims:n,data:r,signature:o}},b=function(e,t){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t(n,e[n])},_=function(e,t){return b(t,function(t,n){e[t]=n}),e},w=function(e,t,n){for(var r in e)if(t.call(n,e[r],r,e))return r},E=function(e){function t(){var t=e.call(this)||this;t.chain_=[],t.buf_=[],t.W_=[],t.pad_=[],t.inbuf_=0,t.total_=0,t.blockSize=64,t.pad_[0]=128;for(var n=1;n>>31)}var i,a,s=this.chain_[0],l=this.chain_[1],u=this.chain_[2],c=this.chain_[3],d=this.chain_[4];for(r=0;r<80;r++){r<40?r<20?(i=c^l&(u^c),a=1518500249):(i=l^u^c,a=1859775393):r<60?(i=l&u|c&(l|u),a=2400959708):(i=l^u^c,a=3395469782);o=(s<<5|s>>>27)+i+d+a+n[r]&4294967295;d=c,c=u,u=4294967295&(l<<30|l>>>2),l=s,s=o}this.chain_[0]=this.chain_[0]+s&4294967295,this.chain_[1]=this.chain_[1]+l&4294967295,this.chain_[2]=this.chain_[2]+u&4294967295,this.chain_[3]=this.chain_[3]+c&4294967295,this.chain_[4]=this.chain_[4]+d&4294967295},t.prototype.update=function(e,t){if(null!=e){void 0===t&&(t=e.length);for(var n=t-this.blockSize,r=0,o=this.buf_,i=this.inbuf_;r=56;n--)this.buf_[n]=255&t,t/=256;this.compress_(this.buf_);var r=0;for(n=0;n<5;n++)for(var o=24;o>=0;o-=8)e[r]=this.chain_[n]>>o&255,++r;return e},t}(function(){return function(){this.blockSize=-1}}());var S=function(){function e(e,t){var n=this;this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=t,this.task.then(function(){e(n)}).catch(function(e){n.error(e)})}return e.prototype.next=function(e){this.forEachObserver(function(t){t.next(e)})},e.prototype.error=function(e){this.forEachObserver(function(t){t.error(e)}),this.close(e)},e.prototype.complete=function(){this.forEachObserver(function(e){e.complete()}),this.close()},e.prototype.subscribe=function(e,t,n){var r,o=this;if(void 0===e&&void 0===t&&void 0===n)throw new Error("Missing Observer.");void 0===(r=function(e,t){if("object"!=typeof e||null===e)return!1;for(var n=0,r=t;n 4. Need to update it?")}var o=e+" failed: ";return o+=r+" argument "}t.assert=i,t.assertionError=a,t.base64=l,t.base64Decode=u,t.base64Encode=function(e){var t=s(e);return l.encodeByteArray(t,!0)},t.CONSTANTS=o,t.deepCopy=function(e){return c(void 0,e)},t.deepExtend=c,t.patchProperty=function(e,t,n){e[t]=n},t.Deferred=d,t.getUA=p,t.isMobileCordova=function(){return"undefined"!=typeof window&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(p())},t.isNodeSdk=function(){return!0===o.NODE_CLIENT||!0===o.NODE_ADMIN},t.isReactNative=function(){return"object"==typeof navigator&&"ReactNative"===navigator.product},t.ErrorFactory=y,t.FirebaseError=m,t.patchCapture=function(e){var t=h;return h=e,t},t.jsonEval=v,t.stringify=function(e){return JSON.stringify(e)},t.decode=g,t.isAdmin=function(e){var t=g(e).claims;return"object"==typeof t&&!0===t.admin},t.issuedAtTime=function(e){var t=g(e).claims;return"object"==typeof t&&t.hasOwnProperty("iat")?t.iat:null},t.isValidFormat=function(e){var t=g(e).claims;return!!t&&"object"==typeof t&&t.hasOwnProperty("iat")},t.isValidTimestamp=function(e){var t,n,r=g(e).claims,o=Math.floor((new Date).getTime()/1e3);return"object"==typeof r&&(r.hasOwnProperty("nbf")?t=r.nbf:r.hasOwnProperty("iat")&&(t=r.iat),n=r.hasOwnProperty("exp")?r.exp:t+86400),o&&t&&n&&o>=t&&o<=n},t.clone=function(e){return _({},e)},t.contains=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.every=function(e,t){for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&!t(n,e[n]))return!1;return!0},t.extend=_,t.findKey=w,t.findValue=function(e,t,n){var r=w(e,t,n);return r&&e[r]},t.forEach=b,t.getAnyKey=function(e){for(var t in e)return t},t.getCount=function(e){var t=0;for(var n in e)t++;return t},t.getValues=function(e){var t=[],n=0;for(var r in e)t[n++]=e[r];return t},t.isEmpty=function(e){for(var t in e)return!1;return!0},t.isNonNullObject=function(e){return"object"==typeof e&&null!==e},t.map=function(e,t,n){var r={};for(var o in e)r[o]=t.call(n,e[o],o,e);return r},t.safeGet=function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]},t.querystring=function(e){var t=[];return b(e,function(e,n){Array.isArray(n)?n.forEach(function(n){t.push(encodeURIComponent(e)+"="+encodeURIComponent(n))}):t.push(encodeURIComponent(e)+"="+encodeURIComponent(n))}),t.length?"&"+t.join("&"):""},t.querystringDecode=function(e){var t={};return e.replace(/^\?/,"").split("&").forEach(function(e){if(e){var n=e.split("=");t[n[0]]=n[1]}}),t},t.Sha1=E,t.async=function(e,t){return function(){for(var n=[],r=0;rn&&(o=0===n?"none":"no more than "+n),o)throw new Error(e+" failed: Was called with "+r+(1===r?" argument.":" arguments.")+" Expects "+o+".")},t.validateCallback=function(e,t,n,r){if((!r||n)&&"function"!=typeof n)throw new Error(k(e,t,r)+"must be a valid function.")},t.validateContextObject=function(e,t,n,r){if((!r||n)&&("object"!=typeof n||null===n))throw new Error(k(e,t,r)+"must be a valid context object.")},t.validateNamespace=function(e,t,n,r){if((!r||n)&&"string"!=typeof n)throw new Error(k(e,t,r)+"must be a valid firebase namespace.")},t.stringLength=function(e){for(var t=0,n=0;n=55296&&r<=56319?(t+=4,n++):t+=3}return t},t.stringToByteArray=function(e){for(var t=[],n=0,r=0;r=55296&&o<=56319){var a=o-55296;i(++r>6|192,t[n++]=63&o|128):o<65536?(t[n++]=o>>12|224,t[n++]=o>>6&63|128,t[n++]=63&o|128):(t[n++]=o>>18|240,t[n++]=o>>12&63|128,t[n++]=o>>6&63|128,t[n++]=63&o|128)}return t}},function(e,t,n){"use strict";e.exports=function(e,t,n,r,o,i,a,s){if(!e){var l;if(void 0===t)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[n,r,o,i,a,s],c=0;(l=new Error(t.replace(/%s/g,function(){return u[c++]}))).name="Invariant Violation"}throw l.framesToPop=1,l}}},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e){e.exports={en:{contacts_not_found:"You have no chats
¯\\\\_(ツ)_/¯",full_name_prompt:"Full name, e.g. John Doe",email_prompt:"Email, e.g. jdoe@example.com",button_sign_up:"Sign up",label_your_name:"Your name",label_password:"Password",password_unchanged_prompt:"Unchanged",label_user_id:"Address:",label_default_access_mode:"Default access mode:",label_message_sound:"Message sound:",label_push_notifications:"Notification alerts:",label_push_notifications_disabled:"Notification alerts (requires HTTPS):",title_tag_manager:"Tags (user discovery)",button_logout:"Logout",requested_permissions:"Requested",granted_permissions:"Granted",menu_item_edit_permissions:"Edit permissions",label_other_user:"Other",title_info:"Info",label_topic_name:"Name",label_private:"Private comment",private_editing_placeholder:"Visible to you only",label_muting_topic:"Muted:",action_more:"More",label_your_permissions:"Your permissions:",label_permissions:"Permissions:",label_you:"You:",label_default_access:"Default access mode:",label_group_members:"Group members:",button_add_members:"Add members",button_leave:"Leave",group_has_no_members:"No members",action_leave_chat:"Leave",login_prompt:"Login",password_prompt:"Password",stay_logged_in:"Stay logged in",forgot_password_link:"Forgot password?",button_sign_in:"Sign in",label_client:"Client:",label_server:"Server:",online_now:"online now",last_seen_timestamp:"Last seen",title_not_found:"Not found",unnamed_topic:"Unnamed",messages_not_readable:"no access to messages",tabtitle_find_user:"find",tabtitle_new_group:"new group",tabtitle_group_by_id:"by id",search_for_contacts:"Use search to find contacts",new_password_placeholder:"Enter new password",label_reset_password:"Send a password reset email:",credential_email_prompt:"Your registration email",button_reset:"Reset",button_send_request:"Send request",label_server_to_use:"Server to use:",label_wire_transport:"Wire transport:",button_update:"Update",sidepanel_title_login:"Sign In",sidepanel_title_register:"Create Account",sidepanel_title_settings:"Settings",sidepanel_title_edit_account:"Edit Account",sidepanel_title_newtpk:"Start New Chat",sidepanel_title_cred:"Confirm Credentials",sidepanel_title_reset:"Reset Password",phone_dative:"phone",email_dative:"email",enter_confirmation_code_prompt:"Enter confirmation code sent to you by {method}:",numeric_confirmation_code_prompt:"Numbers only",button_confirm:"Confirm",invalid_content:"invalid content",badge_you:"you",badge_owner:"owner",menu_item_info:"Info",menu_item_clear_messages:"Clear messages",menu_item_clear_messages_for_all:"Clear for All",menu_item_delete:"Delete",menu_item_delete_for_all:"Delete for All",menu_item_mute:"Mute",menu_item_unmute:"Unmute",menu_item_delete_topic:"Delete",menu_item_unblock:"Unblock",menu_item_block:"Block",menu_item_member_delete:"Remove",action_cancel:"cancel",upload_finishing:"finishing...",no_contacts:"You have no contacts :-(",contacts_not_found_short:"No contacts match '{query}'",title_group_members:"Group Members",title_all_contacts:"All Contacts",button_ok:"OK",button_cancel:"Cancel",download_action:"download",label_file_name:"File name:",label_content_type:"Content type:",label_size:"Size:",error_invalid_id:"Invalid ID",group_user_id_prompt:"Group or User ID",button_subscribe:"Subscribe",topic_name_editing_placeholder:"Freeform name of the group",button_create:"Create",permission_join:"Join ({val})",permission_read:"Read ({val})",permission_write:"Write ({val})",permission_pres:"Get notified ({val})",permission_admin:"Approve ({val})",permission_share:"Share ({val})",permission_delete:"Delete ({val})",permission_owner:"Owner ({val})",title_permissions:"Permissions",message_sending:"sending...",message_sending_failed:"failed",search_placeholder:"List like email:alice@example.com, tel:17025550003...",messaging_disabled_prompt:"Messaging disabled",new_message_prompt:"New message",file_attachment_too_large:"The file size {size} exceeds the {limit} limit.",cannot_initiate_file_upload:"Cannot initiate file upload.",tags_not_found:"No tags defined. Add some.",tags_editor_no_tags:"Add some tags",title_manage_tags:"Manage tags"},ru:{contacts_not_found:"Чатов нет
¯\\\\_(ツ)_/¯",full_name_prompt:"Полное имя, напр. Иван Петров",email_prompt:"Email, напр. ivan@example.com",button_sign_up:"Создать счет",label_your_name:"Ваше имя",label_password:"Пароль",password_unchanged_prompt:"Не изменен",label_user_id:"Адрес:",label_default_access_mode:"Доступ по умолчанию:",label_message_sound:"Звук нового сообщения:",label_push_notifications:"Уведомления:",label_push_notifications_disabled:"Уведомления (требуют HTTPS):",title_tag_manager:"Таги для поиска",button_logout:"Выйти",login_prompt:"Логин",password_prompt:"Пароль",stay_logged_in:"Запомнить",forgot_password_link:"Напомнить пароль",button_sign_in:"Войти",label_client:"Клиент:",label_server:"Сервер:",online_now:"онлайн",last_seen_timestamp:"Был активен",title_not_found:"Не найден",unnamed_topic:"Без названия",messages_not_readable:"нет доступа к сообщениям",tabtitle_find_user:"найти",tabtitle_new_group:"создать",tabtitle_group_by_id:"по id",label_server_to_use:"Использовать сервер:",label_wire_transport:"Соединение:",button_update:"Применить",sidepanel_title_login:"Авторизация",sidepanel_title_register:"Зарегистрироваться",sidepanel_title_settings:"Настройки",sidepanel_title_edit_account:"Редактировать счет",sidepanel_title_newtpk:"Новый чат",sidepanel_title_cred:"Подтвердить",sidepanel_title_reset:"Сменить пароль",tags_not_found:"Тагов нет. Добавьте",tags_editor_no_tags:"Добавьте таги",title_manage_tags:"Редактор тагов",message_sending:"в пути...",message_sending_failed:"ошибка",search_placeholder:"Список, напр. email:alice@example.com, tel:17025550003...",messaging_disabled_prompt:"Отправка недоступна",new_message_prompt:"Новое сообщение",file_attachment_too_large:"Размер файла {size} превышает {limit} лимит.",cannot_initiate_file_upload:"Ошибка загрузки файла.",search_for_contacts:"Поиск контактов",enter_confirmation_code_prompt:"Код подтверждения, полученный по {method}:",numeric_confirmation_code_prompt:"Только цифры",button_confirm:"Подтвердить",button_ok:"OK",button_cancel:"Отменить",invalid_content:"сообщение не читается",label_file_name:"Имя файла:",label_content_type:"Тип:",label_size:"Размер:",phone_dative:"телефону",email_dative:"емейлу",title_group_members:"Участники",download_action:"скачать",permission_join:"Подписываться ({val})",permission_read:"Читать ({val})",permission_write:"Писать ({val})",permission_pres:"Уведомлять ({val})",permission_admin:"Подтверждать ({val})",permission_share:"Приглашать ({val})",permission_delete:"Удалять ({val})",permission_owner:"Владелец ({val})",title_permissions:"Права доступа",requested_permissions:"Требуются",granted_permissions:"Получены",menu_item_edit_permissions:"Права доступа",label_other_user:"Второй",label_topic_name:"Название",label_private:"Комментарий",private_editing_placeholder:"Виден только вам",label_muting_topic:"Без уведомлений",action_more:"Ещё",label_your_permissions:"Ваши права доступа:",label_permissions:"Права доступа:",label_you:"Вы:",label_default_access:"Права по умолчанию:",label_group_members:"Участники чата:",button_add_members:"Добавить",button_leave:"Отписаться",group_has_no_members:"Нет участников",action_leave_chat:"Уйти из чата",menu_item_info:"Информация",menu_item_clear_messages:"Удалить сообщения",menu_item_clear_messages_for_all:"Удалить для всех",menu_item_delete:"Удалить",menu_item_delete_for_all:"Удалить для всех",menu_item_mute:"Не уведомлять",menu_item_unmute:"Уведомлять",menu_item_delete_topic:"Удалить",menu_item_unblock:"Разблокировать",menu_item_block:"Заблокировать",menu_item_member_delete:"Отписать",title_info:"Подробности",new_password_placeholder:"Введите новый пароль",label_reset_password:"Отправить емейл для смены пароля:",credential_email_prompt:"Регистрационный емейл",button_reset:"Изменить",button_send_request:"Отправить",action_cancel:"отменить",upload_finishing:"завершение...",no_contacts:"Ничего нет :-(",contacts_not_found_short:"Нет контактов для запроса '{query}'",title_all_contacts:"Все контакты",error_invalid_id:"Неверный ID",group_user_id_prompt:"ID чата или пользователя",button_subscribe:"Подписаться",topic_name_editing_placeholder:"Название чата",button_create:"Создать",badge_you:"вы",badge_owner:"влад."}}},function(e,t,n){"use strict";n(42);var r=function(e){return e&&"object"==typeof e&&"default"in e?e.default:e}(n(13));e.exports=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(8),o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i="[DEFAULT]",a=[],s=function(){function e(e,t,n){this.firebase_=n,this.isDeleted_=!1,this.services_={},this.name_=t.name,this._automaticDataCollectionEnabled=t.automaticDataCollectionEnabled||!1,this.options_=r.deepCopy(e),this.INTERNAL={getUid:function(){return null},getToken:function(){return Promise.resolve(null)},addAuthTokenListener:function(e){a.push(e),setTimeout(function(){return e(null)},0)},removeAuthTokenListener:function(e){a=a.filter(function(t){return t!==e})}}}return Object.defineProperty(e.prototype,"automaticDataCollectionEnabled",{get:function(){return this.checkDestroyed_(),this._automaticDataCollectionEnabled},set:function(e){this.checkDestroyed_(),this._automaticDataCollectionEnabled=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"name",{get:function(){return this.checkDestroyed_(),this.name_},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"options",{get:function(){return this.checkDestroyed_(),this.options_},enumerable:!0,configurable:!0}),e.prototype.delete=function(){var e=this;return new Promise(function(t){e.checkDestroyed_(),t()}).then(function(){e.firebase_.INTERNAL.removeApp(e.name_);var t=[];return Object.keys(e.services_).forEach(function(n){Object.keys(e.services_[n]).forEach(function(r){t.push(e.services_[n][r])})}),Promise.all(t.map(function(e){return e.INTERNAL.delete()}))}).then(function(){e.isDeleted_=!0,e.services_={}})},e.prototype._getService=function(e,t){if(void 0===t&&(t=i),this.checkDestroyed_(),this.services_[e]||(this.services_[e]={}),!this.services_[e][t]){var n=t!==i?t:void 0,r=this.firebase_.INTERNAL.factories[e](this,this.extendApp.bind(this),n);this.services_[e][t]=r}return this.services_[e][t]},e.prototype.extendApp=function(e){var t=this;r.deepExtend(this,e),e.INTERNAL&&e.INTERNAL.addAuthTokenListener&&(a.forEach(function(e){t.INTERNAL.addAuthTokenListener(e)}),a=[])},e.prototype.checkDestroyed_=function(){this.isDeleted_&&l("app-deleted",{name:this.name_})},e}();function l(e,t){throw u.create(e,t)}s.prototype.name&&s.prototype.options||s.prototype.delete||console.log("dc");var u=new r.ErrorFactory("app","Firebase",{"no-app":"No Firebase App '{$name}' has been created - call Firebase App.initializeApp()","bad-app-name":"Illegal App name: '{$name}","duplicate-app":"Firebase App named '{$name}' already exists","app-deleted":"Firebase App named '{$name}' already deleted","duplicate-service":"Firebase service named '{$name}' already registered","sa-not-supported":"Initializing the Firebase SDK with a service account is only allowed in a Node.js environment. On client devices, you should instead initialize the SDK with an api key and auth domain","invalid-app-argument":"firebase.{$name}() takes either no argument or a Firebase App instance."}),c=function e(){var t={},n={},a={},u={__esModule:!0,initializeApp:function(e,n){if(void 0===n&&(n={}),"object"!=typeof n||null===n){var r=n;n={name:r}}var a=n;void 0===a.name&&(a.name=i);var c=a.name;"string"==typeof c&&c||l("bad-app-name",{name:c+""}),o(t,c)&&l("duplicate-app",{name:c});var d=new s(e,a,u);return t[c]=d,p(d,"create"),d},app:c,apps:null,Promise:Promise,SDK_VERSION:"5.5.0",INTERNAL:{registerService:function(e,t,o,i,p){n[e]&&l("duplicate-service",{name:e}),n[e]=t,i&&(a[e]=i,d().forEach(function(e){i("create",e)}));var f=function(t){return void 0===t&&(t=c()),"function"!=typeof t[e]&&l("invalid-app-argument",{name:e}),t[e]()};return void 0!==o&&r.deepExtend(f,o),u[e]=f,s.prototype[e]=function(){for(var t=[],n=0;n=N-n){if(!(-1!==O&&O<=n))return void(P||(P=!0,w(j)));e=!0}if(O=-1,n=k,k=null,null!==n){x=!0;try{n(e)}finally{x=!1}}}},!1);var j=function(e){P=!1;var t=e-N+A;tt&&(t=8),A=tn){o=i;break}i=i.next}while(i!==r);null===o?o=r:o===r&&(r=e,l()),(n=o.previous).next=o.previous=e,e.next=o,e.previous=n}return e},t.unstable_cancelScheduledWork=function(e){var t=e.next;if(null!==t){if(t===e)r=null;else{e===r&&(r=t);var n=e.previous;n.next=t,t.previous=n}e.next=e.previous=null}}},function(e,t,n){"use strict";var r=n(25),o=n(30);r.default.__addLocaleData(o.default),r.default.defaultLocale="en",t.default=r.default},function(e,t,n){"use strict";var r=n(15),o=n(26),i=n(27),a=n(28);function s(e,t,n){var r="string"==typeof e?s.__parse(e):e;if(!r||"messageFormatPattern"!==r.type)throw new TypeError("A message must be provided as a String or AST.");n=this._mergeFormats(s.formats,n),o.defineProperty(this,"_locale",{value:this._resolveLocale(t)});var i=this._findPluralRuleFunction(this._locale),a=this._compilePattern(r,t,n,i),l=this;this.format=function(t){try{return l._format(a,t)}catch(t){throw t.variableId?new Error("The intl string context variable '"+t.variableId+"' was not provided to the string '"+e+"'"):t}}}t.default=s,o.defineProperty(s,"formats",{enumerable:!0,value:{number:{currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}}}),o.defineProperty(s,"__localeData__",{value:o.objCreate(null)}),o.defineProperty(s,"__addLocaleData",{value:function(e){if(!e||!e.locale)throw new Error("Locale data provided to IntlMessageFormat is missing a `locale` property");s.__localeData__[e.locale.toLowerCase()]=e}}),o.defineProperty(s,"__parse",{value:a.default.parse}),o.defineProperty(s,"defaultLocale",{enumerable:!0,writable:!0,value:void 0}),s.prototype.resolvedOptions=function(){return{locale:this._locale}},s.prototype._compilePattern=function(e,t,n,r){return new i.default(t,n,r).compile(e)},s.prototype._findPluralRuleFunction=function(e){for(var t=s.__localeData__,n=t[e.toLowerCase()];n;){if(n.pluralRuleFunction)return n.pluralRuleFunction;n=n.parentLocale&&t[n.parentLocale.toLowerCase()]}throw new Error("Locale data added to IntlMessageFormat is missing a `pluralRuleFunction` for :"+e)},s.prototype._format=function(e,t){var n,o,i,a,s,l,u="";for(n=0,o=e.length;n1?arguments[1]:{},o={},i={start:Ne},a=Ne,s=function(e){return{type:"messageFormatPattern",elements:e,location:ke()}},l=function(e){var t,n,r,o,i,a="";for(t=0,r=e.length;tEe&&(Ee=be,Se=[]),Se.push(e))}function xe(t,n,r,o){return null!==n&&function(e){var t=1;for(e.sort(function(e,t){return e.descriptiont.description?1:0});t1?r.slice(0,-1).join(", ")+" or "+r[e.length-1]:r[0])+" but "+(t?'"'+function(e){function t(e){return e.charCodeAt(0).toString(16).toUpperCase()}return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x07\x0B\x0E\x0F]/g,function(e){return"\\x0"+t(e)}).replace(/[\x10-\x1F\x80-\xFF]/g,function(e){return"\\x"+t(e)}).replace(/[\u0100-\u0FFF]/g,function(e){return"\\u0"+t(e)}).replace(/[\u1000-\uFFFF]/g,function(e){return"\\u"+t(e)})}(t)+'"':"end of input")+" found."}(n,r),n,r,o)}function Ne(){return Me()}function Me(){var e,t,n;for(e=be,t=[],n=Ae();n!==o;)t.push(n),n=Ae();return t!==o&&(_e=e,t=s(t)),e=t}function Ae(){var e;return(e=function(){var e,n;return e=be,(n=function(){var e,n,r,i,a,s;if(e=be,n=[],r=be,(i=Re())!==o&&(a=qe())!==o&&(s=Re())!==o?r=i=[i,a,s]:(be=r,r=o),r!==o)for(;r!==o;)n.push(r),r=be,(i=Re())!==o&&(a=qe())!==o&&(s=Re())!==o?r=i=[i,a,s]:(be=r,r=o);else n=o;return n!==o&&(_e=e,n=l(n)),(e=n)===o&&(e=be,n=Ie(),e=n!==o?t.substring(e,be):n),e}())!==o&&(_e=e,n=u(n)),e=n}())===o&&(e=function(){var e,n,r,i,a,s,l;return e=be,123===t.charCodeAt(be)?(n=p,be++):(n=o,0===Te&&Pe(f)),n!==o&&Re()!==o&&(r=function(){var e,n,r;if((e=Le())===o){if(e=be,n=[],c.test(t.charAt(be))?(r=t.charAt(be),be++):(r=o,0===Te&&Pe(d)),r!==o)for(;r!==o;)n.push(r),c.test(t.charAt(be))?(r=t.charAt(be),be++):(r=o,0===Te&&Pe(d));else n=o;e=n!==o?t.substring(e,be):n}return e}())!==o&&Re()!==o?(i=be,44===t.charCodeAt(be)?(a=h,be++):(a=o,0===Te&&Pe(m)),a!==o&&(s=Re())!==o&&(l=function(){var e;return(e=function(){var e,n,r,i,a,s;return e=be,t.substr(be,6)===b?(n=b,be+=6):(n=o,0===Te&&Pe(_)),n===o&&(t.substr(be,4)===w?(n=w,be+=4):(n=o,0===Te&&Pe(E)),n===o&&(t.substr(be,4)===S?(n=S,be+=4):(n=o,0===Te&&Pe(T)))),n!==o&&Re()!==o?(r=be,44===t.charCodeAt(be)?(i=h,be++):(i=o,0===Te&&Pe(m)),i!==o&&(a=Re())!==o&&(s=qe())!==o?r=i=[i,a,s]:(be=r,r=o),r===o&&(r=null),r!==o?(_e=e,n=k(n,r),e=n):(be=e,e=o)):(be=e,e=o),e}())===o&&(e=function(){var e,n,r,i;return e=be,t.substr(be,6)===C?(n=C,be+=6):(n=o,0===Te&&Pe(O)),n!==o&&Re()!==o?(44===t.charCodeAt(be)?(r=h,be++):(r=o,0===Te&&Pe(m)),r!==o&&Re()!==o&&(i=je())!==o?(_e=e,n=P(i),e=n):(be=e,e=o)):(be=e,e=o),e}())===o&&(e=function(){var e,n,r,i;return e=be,t.substr(be,13)===x?(n=x,be+=13):(n=o,0===Te&&Pe(N)),n!==o&&Re()!==o?(44===t.charCodeAt(be)?(r=h,be++):(r=o,0===Te&&Pe(m)),r!==o&&Re()!==o&&(i=je())!==o?(_e=e,n=M(i),e=n):(be=e,e=o)):(be=e,e=o),e}())===o&&(e=function(){var e,n,r,i,a;if(e=be,t.substr(be,6)===A?(n=A,be+=6):(n=o,0===Te&&Pe(D)),n!==o)if(Re()!==o)if(44===t.charCodeAt(be)?(r=h,be++):(r=o,0===Te&&Pe(m)),r!==o)if(Re()!==o){if(i=[],(a=De())!==o)for(;a!==o;)i.push(a),a=De();else i=o;i!==o?(_e=e,n=j(i),e=n):(be=e,e=o)}else be=e,e=o;else be=e,e=o;else be=e,e=o;else be=e,e=o;return e}()),e}())!==o?i=a=[a,s,l]:(be=i,i=o),i===o&&(i=null),i!==o&&(a=Re())!==o?(125===t.charCodeAt(be)?(s=y,be++):(s=o,0===Te&&Pe(v)),s!==o?(_e=e,n=g(r,i),e=n):(be=e,e=o)):(be=e,e=o)):(be=e,e=o),e}()),e}function De(){var e,n,r,i,a;return e=be,Re()!==o&&(n=function(){var e,n,r,i;return e=be,n=be,61===t.charCodeAt(be)?(r=I,be++):(r=o,0===Te&&Pe(R)),r!==o&&(i=Le())!==o?n=r=[r,i]:(be=n,n=o),(e=n!==o?t.substring(e,be):n)===o&&(e=qe()),e}())!==o&&Re()!==o?(123===t.charCodeAt(be)?(r=p,be++):(r=o,0===Te&&Pe(f)),r!==o&&Re()!==o&&(i=Me())!==o&&Re()!==o?(125===t.charCodeAt(be)?(a=y,be++):(a=o,0===Te&&Pe(v)),a!==o?(_e=e,e=U(n,i)):(be=e,e=o)):(be=e,e=o)):(be=e,e=o),e}function je(){var e,n,r,i;if(e=be,(n=function(){var e,n,r;return e=be,t.substr(be,7)===F?(n=F,be+=7):(n=o,0===Te&&Pe(L)),n!==o&&Re()!==o&&(r=Le())!==o?(_e=e,e=n=B(r)):(be=e,e=o),e}())===o&&(n=null),n!==o)if(Re()!==o){if(r=[],(i=De())!==o)for(;i!==o;)r.push(i),i=De();else r=o;r!==o?(_e=e,e=n=q(n,r)):(be=e,e=o)}else be=e,e=o;else be=e,e=o;return e}function Ie(){var e,n;if(Te++,e=[],V.test(t.charAt(be))?(n=t.charAt(be),be++):(n=o,0===Te&&Pe(K)),n!==o)for(;n!==o;)e.push(n),V.test(t.charAt(be))?(n=t.charAt(be),be++):(n=o,0===Te&&Pe(K));else e=o;return Te--,e===o&&(n=o,0===Te&&Pe(W)),e}function Re(){var e,n,r;for(Te++,e=be,n=[],r=Ie();r!==o;)n.push(r),r=Ie();return e=n!==o?t.substring(e,be):n,Te--,e===o&&(n=o,0===Te&&Pe(H)),e}function Ue(){var e;return z.test(t.charAt(be))?(e=t.charAt(be),be++):(e=o,0===Te&&Pe(G)),e}function Fe(){var e;return $.test(t.charAt(be))?(e=t.charAt(be),be++):(e=o,0===Te&&Pe(Y)),e}function Le(){var e,n,r,i,a,s;if(e=be,48===t.charCodeAt(be)?(n=Q,be++):(n=o,0===Te&&Pe(J)),n===o){if(n=be,r=be,X.test(t.charAt(be))?(i=t.charAt(be),be++):(i=o,0===Te&&Pe(Z)),i!==o){for(a=[],s=Ue();s!==o;)a.push(s),s=Ue();a!==o?r=i=[i,a]:(be=r,r=o)}else be=r,r=o;n=r!==o?t.substring(n,be):r}return n!==o&&(_e=e,n=ee(n)),e=n}function Be(){var e,n,r,i,a,s,l,u;return te.test(t.charAt(be))?(e=t.charAt(be),be++):(e=o,0===Te&&Pe(ne)),e===o&&(e=be,t.substr(be,2)===re?(n=re,be+=2):(n=o,0===Te&&Pe(oe)),n!==o&&(_e=e,n=ie()),(e=n)===o&&(e=be,t.substr(be,2)===ae?(n=ae,be+=2):(n=o,0===Te&&Pe(se)),n!==o&&(_e=e,n=le()),(e=n)===o&&(e=be,t.substr(be,2)===ue?(n=ue,be+=2):(n=o,0===Te&&Pe(ce)),n!==o&&(_e=e,n=de()),(e=n)===o&&(e=be,t.substr(be,2)===pe?(n=pe,be+=2):(n=o,0===Te&&Pe(fe)),n!==o&&(_e=e,n=he()),(e=n)===o&&(e=be,t.substr(be,2)===me?(n=me,be+=2):(n=o,0===Te&&Pe(ye)),n!==o?(r=be,i=be,(a=Fe())!==o&&(s=Fe())!==o&&(l=Fe())!==o&&(u=Fe())!==o?i=a=[a,s,l,u]:(be=i,i=o),(r=i!==o?t.substring(r,be):i)!==o?(_e=e,e=n=ve(r)):(be=e,e=o)):(be=e,e=o)))))),e}function qe(){var e,t,n;if(e=be,t=[],(n=Be())!==o)for(;n!==o;)t.push(n),n=Be();else t=o;return t!==o&&(_e=e,t=ge(t)),e=t}if((n=a())!==o&&be===t.length)return n;throw n!==o&&be=0)return!0;if("string"==typeof e){var t=/s$/.test(e)&&e.substr(0,e.length-1);if(t&&i.arrIndexOf.call(a,t)>=0)throw new Error('"'+e+'" is not a valid IntlRelativeFormat `units` value, did you mean: '+t)}throw new Error('"'+e+'" is not a valid IntlRelativeFormat `units` value, it must be one of: "'+a.join('", "')+'"')},l.prototype._resolveLocale=function(e){"string"==typeof e&&(e=[e]),e=(e||[]).concat(l.defaultLocale);var t,n,r,o,i=l.__localeData__;for(t=0,n=e.length;t=0)return e;throw new Error('"'+e+'" is not a valid IntlRelativeFormat `style` value, it must be one of: "'+s.join('", "')+'"')},l.prototype._selectUnits=function(e){var t,n,r,o=a.filter(function(e){return e.indexOf("-short")<1});for(t=0,n=o.length;t0?V:W)(e)},H=Math.min,z=function(e){return e>0?H(K(e),9007199254740991):0},G=Array.isArray||function(e){return"Array"==F(e)},$=f["__core-js_shared__"]||(f["__core-js_shared__"]={}),Y=function(e){return $[e]||($[e]={})},Q=p(function(e){var t=Y("wks"),n=f.Symbol,r="function"==typeof n;(e.exports=function(e){return t[e]||(t[e]=r&&n[e]||(r?n:A)("Symbol."+e))}).store=t}),J=Q("species"),X=function(e,t){return new(function(e){var t;return G(e)&&("function"!=typeof(t=e.constructor)||t!==Array&&!G(t.prototype)||(t=void 0),m(t)&&null===(t=t[J])&&(t=void 0)),void 0===t?Array:t}(e))(t)},Z=function(e,t){var n=1==e,r=2==e,o=3==e,i=4==e,a=6==e,s=5==e||a,l=t||X;return function(t,u,c){for(var d,p,f=q(t),h=L(f),m=j(u,c,3),y=z(h.length),v=0,g=n?l(t,y):r?l(t,0):void 0;y>v;v++)if((s||v in h)&&(p=m(d=h[v],v,f),e))if(n)g[v]=p;else if(p)switch(e){case 3:return!0;case 5:return d;case 6:return v;case 2:g.push(d)}else if(i)return!1;return a?-1:o||i?i:g}},ee=Q("unscopables"),te=Array.prototype;void 0==te[ee]&&O(te,ee,{});var ne=function(e){te[ee][e]=!0},re=Z(5),oe=!0;"find"in[]&&Array(1).find(function(){oe=!1}),R(R.P+R.F*oe,"Array",{find:function(e){return re(this,e,arguments.length>1?arguments[1]:void 0)}}),ne("find");h.Array.find;var ie=Z(6),ae=!0;"findIndex"in[]&&Array(1).findIndex(function(){ae=!1}),R(R.P+R.F*ae,"Array",{findIndex:function(e){return ie(this,e,arguments.length>1?arguments[1]:void 0)}}),ne("findIndex");h.Array.findIndex;var se=function(e){return L(B(e))},le=Math.max,ue=Math.min,ce=Y("keys"),de=function(e){return ce[e]||(ce[e]=A(e))},pe=function(e){return function(t,n,r){var o,i=se(t),a=z(i.length),s=function(e,t){return(e=K(e))<0?le(e+t,0):ue(e,t)}(r,a);if(e&&n!=n){for(;a>s;)if((o=i[s++])!=o)return!0}else for(;a>s;s++)if((e||s in i)&&i[s]===n)return e||s||0;return!e&&-1}}(!1),fe=de("IE_PROTO"),he=function(e,t){var n,r=se(e),o=0,i=[];for(n in r)n!=fe&&x(r,n)&&i.push(n);for(;t.length>o;)x(r,n=t[o++])&&(~pe(i,n)||i.push(n));return i},me="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","),ye=Object.keys||function(e){return he(e,me)},ve={f:Object.getOwnPropertySymbols},ge={f:{}.propertyIsEnumerable},be=Object.assign,_e=!be||v(function(){var e={},t={},n=Symbol(),r="abcdefghijklmnopqrst";return e[n]=7,r.split("").forEach(function(e){t[e]=e}),7!=be({},e)[n]||Object.keys(be({},t)).join("")!=r})?function(e,t){for(var n=q(e),r=arguments.length,o=1,i=ve.f,a=ge.f;r>o;)for(var s,l=L(arguments[o++]),u=i?ye(l).concat(i(l)):ye(l),c=u.length,d=0;c>d;)a.call(l,s=u[d++])&&(n[s]=l[s]);return n}:be;R(R.S+R.F,"Object",{assign:_e});h.Object.assign;var we=Q("match"),Ee=function(e,t,n){if(function(e){var t;return m(e)&&(void 0!==(t=e[we])?!!t:"RegExp"==F(e))}(t))throw TypeError("String#"+n+" doesn't accept regex!");return String(B(e))},Se=Q("match"),Te="".startsWith;R(R.P+R.F*function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[Se]=!1,!"/./"[e](t)}catch(e){}}return!0}("startsWith"),"String",{startsWith:function(e){var t=Ee(this,e,"startsWith"),n=z(Math.min(arguments.length>1?arguments[1]:void 0,t.length)),r=String(e);return Te?Te.call(t,r,n):t.slice(n,n+r.length)===r}});h.String.startsWith;R(R.P,"String",{repeat:function(e){var t=String(B(this)),n="",r=K(e);if(r<0||r==1/0)throw RangeError("Count can't be negative");for(;r>0;(r>>>=1)&&(t+=t))1&r&&(n+=t);return n}});h.String.repeat;var ke=p(function(e){var t=A("meta"),n=k.f,r=0,o=Object.isExtensible||function(){return!0},i=!v(function(){return o(Object.preventExtensions({}))}),a=function(e){n(e,t,{value:{i:"O"+ ++r,w:{}}})},s=e.exports={KEY:t,NEED:!1,fastKey:function(e,n){if(!m(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!x(e,t)){if(!o(e))return"F";if(!n)return"E";a(e)}return e[t].i},getWeak:function(e,n){if(!x(e,t)){if(!o(e))return!0;if(!n)return!1;a(e)}return e[t].w},onFreeze:function(e){return i&&s.NEED&&o(e)&&!x(e,t)&&a(e),e}}}),Ce=(ke.KEY,ke.NEED,ke.fastKey,ke.getWeak,ke.onFreeze,k.f),Oe=Q("toStringTag"),Pe=function(e,t,n){e&&!x(e=n?e:e.prototype,Oe)&&Ce(e,Oe,{configurable:!0,value:t})},xe={f:Q},Ne=k.f,Me=function(e){var t=h.Symbol||(h.Symbol=f.Symbol||{});"_"==e.charAt(0)||e in t||Ne(t,e,{value:xe.f(e)})},Ae=g?Object.defineProperties:function(e,t){y(e);for(var n,r=ye(t),o=r.length,i=0;o>i;)k.f(e,n=r[i++],t[n]);return e},De=f.document,je=De&&De.documentElement,Ie=de("IE_PROTO"),Re=function(){},Ue=function(){var e,t=w("iframe"),n=me.length;for(t.style.display="none",je.appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("