diff --git a/.babelrc b/.babelrc
new file mode 100644
index 00000000..ac9f2a0b
--- /dev/null
+++ b/.babelrc
@@ -0,0 +1,9 @@
+{
+ "presets": ["@babel/preset-react", "@babel/preset-env"],
+ "comments": false,
+ "plugins": [
+ ["react-intl", {
+ "messagesDir": "./src/i18n/"
+ }]
+ ]
+}
diff --git a/README.md b/README.md
index 15ab5196..67579e26 100644
--- a/README.md
+++ b/README.md
@@ -9,7 +9,7 @@ The app is about 200KB minified and gzipped. That includes all dependencies (Rea
Although the app is generally usable, keep in mind that this is work in progress. Some bugs probably exist. The app was tested in the latest Chrome & Firefox only. NPM package is available at https://www.npmjs.com/package/tinode-webapp.
-Try possibly newer or older version live at https://api.tinode.co/. For login and other instructions [see here](https://github.com/tinode/chat/#demo).
+Try possibly newer or older version live at https://api.tinode.co/. For passwords for demo accounts and other instructions [see here](https://github.com/tinode/chat/#demo).
Demo avatar photos are from https://www.pexels.com/ under [CC0 license](https://www.pexels.com/photo-license/).
@@ -21,11 +21,17 @@ Background pattern from http://subtlepatterns.com/, commercial and non-commercia
* For support, general questions, discussions post to [https://groups.google.com/d/forum/tinode](https://groups.google.com/d/forum/tinode).
* For bugs and feature requests [open an issue](https://github.com/tinode/webchat/issues/new).
+## Internationalization
+
+The app is fully internationalized using [React-Intl](https://github.com/yahoo/react-intl). The UI language is selected automatically from the language specified by the browser. A specific language can be forced by adding `hl=XX` parameter to the URL, i.e. https://api.tinode.co/#?hl=ru.
+
+As of the time of this writing there are only two translations. More translations are welcome. Send a pull request with a json file with translated strings. Take a look at [English](/src/i18n/en.json) and [Russian](/src/i18n/ru.json) translations for guidance.
+
+
## Missing functionality
* Previews not generated for videos, audio, links or docs.
* No end-to-end encryption.
-* Editing chat permissions is incomplete.
* Emoji support is weak.
## Responsive design
diff --git a/css/base.css b/css/base.css
index a3239c4e..03e31055 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 {
@@ -340,6 +340,32 @@ li.right:hover .menuTrigger {
}
/* Top-level application layout style: sidepanel + main view */
+#noscript-alertbox {
+ position: relative;
+ display: flex;
+ flex-direction: column;
+ max-width: 30rem;
+ overflow: hidden;
+ margin-top: 5rem;
+ margin-left: auto;
+ margin-right: auto;
+ border-radius: 0.25rem;
+ box-shadow: 1px 2px 0.3rem gray;
+ background-color: white;
+}
+
+#noscript-title {
+ padding: 1rem;
+ font-size: 120%;
+ font-weight: bolder;
+ background-color: #2196f3; /* blue 500 */
+ color: #bbdefb; /* light-blue 100 */
+}
+
+#noscript-content {
+ padding: 1rem;
+}
+
#app-container {
position: relative;
display: flex;
@@ -1422,7 +1448,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;
@@ -1448,12 +1474,24 @@ ul.tabbar li.active > a:after {
color: #660;
}
+.badge.blue {
+ border-color: #339;
+ background-color: #eef;
+ color: #339;
+}
+
.badge.red {
border-color: #933;
background-color: #fee;
color: #933;
}
+.badge.magenta {
+ border-color: #939;
+ background-color: #fef;
+ color: #939;
+}
+
/* Letter tile base style, responsive square box */
.lettertile {
width: 100%;
diff --git a/css/base.min.css b/css/base.min.css
index 0d34a9c9..a706725c 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.red{background-color:#fee;border-color:#933;color:#933}.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}#noscript-alertbox{background-color:#fff;border-radius:.25rem;box-shadow:1px 2px .3rem grey;display:flex;flex-direction:column;margin-left:auto;margin-right:auto;margin-top:5rem;max-width:30rem;overflow:hidden;position:relative}#noscript-title{background-color:#2196f3;color:#bbdefb;font-size:120%;font-weight:bolder;padding:1rem}#noscript-content{padding: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/index-dev.html b/index-dev.html
index 1d0bad3e..25e94351 100644
--- a/index-dev.html
+++ b/index-dev.html
@@ -1,8 +1,4 @@
-
-
+
@@ -17,39 +13,36 @@
-
-
+
+
-
+
-
+
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+ Javascript support is required.
+
It appears JavaScript is turned off or is not supported by your browser.
+ TinodeWeb does not work without JavaScript. Please enable JavaScript by changing your browser options,
+ then
try again .
+
+
-
-
-
-
-
-
-
+
+
diff --git a/index.html b/index.html
index b122f711..90514fdb 100644
--- a/index.html
+++ b/index.html
@@ -1,32 +1,35 @@
-
-
- Tinode
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+Tinode
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Javascript support is required.
+
It appears JavaScript is turned off or is not supported by your browser.
+TinodeWeb does not work without JavaScript. Please enable JavaScript by changing your browser options,
+then
try again .
+
+
+
+
diff --git a/package-lock.json b/package-lock.json
index 584b0c64..d6bf6fc6 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,9 +1,1046 @@
{
"name": "tinode-webapp",
- "version": "0.15.8",
+ "version": "0.15.9-rc1",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
+ "@babel/code-frame": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0.tgz",
+ "integrity": "sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA==",
+ "dev": true,
+ "requires": {
+ "@babel/highlight": "^7.0.0"
+ }
+ },
+ "@babel/core": {
+ "version": "7.1.2",
+ "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.1.2.tgz",
+ "integrity": "sha512-IFeSSnjXdhDaoysIlev//UzHZbdEmm7D0EIH2qtse9xK7mXEZQpYjs2P00XlP1qYsYvid79p+Zgg6tz1mp6iVw==",
+ "dev": true,
+ "requires": {
+ "@babel/code-frame": "^7.0.0",
+ "@babel/generator": "^7.1.2",
+ "@babel/helpers": "^7.1.2",
+ "@babel/parser": "^7.1.2",
+ "@babel/template": "^7.1.2",
+ "@babel/traverse": "^7.1.0",
+ "@babel/types": "^7.1.2",
+ "convert-source-map": "^1.1.0",
+ "debug": "^3.1.0",
+ "json5": "^0.5.0",
+ "lodash": "^4.17.10",
+ "resolve": "^1.3.2",
+ "semver": "^5.4.1",
+ "source-map": "^0.5.0"
+ },
+ "dependencies": {
+ "debug": {
+ "version": "3.2.6",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz",
+ "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==",
+ "dev": true,
+ "requires": {
+ "ms": "^2.1.1"
+ }
+ },
+ "ms": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz",
+ "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==",
+ "dev": true
+ }
+ }
+ },
+ "@babel/generator": {
+ "version": "7.1.3",
+ "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.1.3.tgz",
+ "integrity": "sha512-ZoCZGcfIJFJuZBqxcY9OjC1KW2lWK64qrX1o4UYL3yshVhwKFYgzpWZ0vvtGMNJdTlvkw0W+HR1VnYN8q3QPFQ==",
+ "dev": true,
+ "requires": {
+ "@babel/types": "^7.1.3",
+ "jsesc": "^2.5.1",
+ "lodash": "^4.17.10",
+ "source-map": "^0.5.0",
+ "trim-right": "^1.0.1"
+ },
+ "dependencies": {
+ "jsesc": {
+ "version": "2.5.1",
+ "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.1.tgz",
+ "integrity": "sha1-5CGiqOINawgZ3yiQj3glJrlt0f4=",
+ "dev": true
+ }
+ }
+ },
+ "@babel/helper-annotate-as-pure": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.0.0.tgz",
+ "integrity": "sha512-3UYcJUj9kvSLbLbUIfQTqzcy5VX7GRZ/CCDrnOaZorFFM01aXp1+GJwuFGV4NDDoAS+mOUyHcO6UD/RfqOks3Q==",
+ "dev": true,
+ "requires": {
+ "@babel/types": "^7.0.0"
+ }
+ },
+ "@babel/helper-builder-binary-assignment-operator-visitor": {
+ "version": "7.1.0",
+ "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.1.0.tgz",
+ "integrity": "sha512-qNSR4jrmJ8M1VMM9tibvyRAHXQs2PmaksQF7c1CGJNipfe3D8p+wgNwgso/P2A2r2mdgBWAXljNWR0QRZAMW8w==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-explode-assignable-expression": "^7.1.0",
+ "@babel/types": "^7.0.0"
+ }
+ },
+ "@babel/helper-builder-react-jsx": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/@babel/helper-builder-react-jsx/-/helper-builder-react-jsx-7.0.0.tgz",
+ "integrity": "sha512-ebJ2JM6NAKW0fQEqN8hOLxK84RbRz9OkUhGS/Xd5u56ejMfVbayJ4+LykERZCOUM6faa6Fp3SZNX3fcT16MKHw==",
+ "dev": true,
+ "requires": {
+ "@babel/types": "^7.0.0",
+ "esutils": "^2.0.0"
+ }
+ },
+ "@babel/helper-call-delegate": {
+ "version": "7.1.0",
+ "resolved": "https://registry.npmjs.org/@babel/helper-call-delegate/-/helper-call-delegate-7.1.0.tgz",
+ "integrity": "sha512-YEtYZrw3GUK6emQHKthltKNZwszBcHK58Ygcis+gVUrF4/FmTVr5CCqQNSfmvg2y+YDEANyYoaLz/SHsnusCwQ==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-hoist-variables": "^7.0.0",
+ "@babel/traverse": "^7.1.0",
+ "@babel/types": "^7.0.0"
+ }
+ },
+ "@babel/helper-define-map": {
+ "version": "7.1.0",
+ "resolved": "https://registry.npmjs.org/@babel/helper-define-map/-/helper-define-map-7.1.0.tgz",
+ "integrity": "sha512-yPPcW8dc3gZLN+U1mhYV91QU3n5uTbx7DUdf8NnPbjS0RMwBuHi9Xt2MUgppmNz7CJxTBWsGczTiEp1CSOTPRg==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-function-name": "^7.1.0",
+ "@babel/types": "^7.0.0",
+ "lodash": "^4.17.10"
+ }
+ },
+ "@babel/helper-explode-assignable-expression": {
+ "version": "7.1.0",
+ "resolved": "https://registry.npmjs.org/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.1.0.tgz",
+ "integrity": "sha512-NRQpfHrJ1msCHtKjbzs9YcMmJZOg6mQMmGRB+hbamEdG5PNpaSm95275VD92DvJKuyl0s2sFiDmMZ+EnnvufqA==",
+ "dev": true,
+ "requires": {
+ "@babel/traverse": "^7.1.0",
+ "@babel/types": "^7.0.0"
+ }
+ },
+ "@babel/helper-function-name": {
+ "version": "7.1.0",
+ "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.1.0.tgz",
+ "integrity": "sha512-A95XEoCpb3TO+KZzJ4S/5uW5fNe26DjBGqf1o9ucyLyCmi1dXq/B3c8iaWTfBk3VvetUxl16e8tIrd5teOCfGw==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-get-function-arity": "^7.0.0",
+ "@babel/template": "^7.1.0",
+ "@babel/types": "^7.0.0"
+ }
+ },
+ "@babel/helper-get-function-arity": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0.tgz",
+ "integrity": "sha512-r2DbJeg4svYvt3HOS74U4eWKsUAMRH01Z1ds1zx8KNTPtpTL5JAsdFv8BNyOpVqdFhHkkRDIg5B4AsxmkjAlmQ==",
+ "dev": true,
+ "requires": {
+ "@babel/types": "^7.0.0"
+ }
+ },
+ "@babel/helper-hoist-variables": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.0.0.tgz",
+ "integrity": "sha512-Ggv5sldXUeSKsuzLkddtyhyHe2YantsxWKNi7A+7LeD12ExRDWTRk29JCXpaHPAbMaIPZSil7n+lq78WY2VY7w==",
+ "dev": true,
+ "requires": {
+ "@babel/types": "^7.0.0"
+ }
+ },
+ "@babel/helper-member-expression-to-functions": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.0.0.tgz",
+ "integrity": "sha512-avo+lm/QmZlv27Zsi0xEor2fKcqWG56D5ae9dzklpIaY7cQMK5N8VSpaNVPPagiqmy7LrEjK1IWdGMOqPu5csg==",
+ "dev": true,
+ "requires": {
+ "@babel/types": "^7.0.0"
+ }
+ },
+ "@babel/helper-module-imports": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.0.0.tgz",
+ "integrity": "sha512-aP/hlLq01DWNEiDg4Jn23i+CXxW/owM4WpDLFUbpjxe4NS3BhLVZQ5i7E0ZrxuQ/vwekIeciyamgB1UIYxxM6A==",
+ "dev": true,
+ "requires": {
+ "@babel/types": "^7.0.0"
+ }
+ },
+ "@babel/helper-module-transforms": {
+ "version": "7.1.0",
+ "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.1.0.tgz",
+ "integrity": "sha512-0JZRd2yhawo79Rcm4w0LwSMILFmFXjugG3yqf+P/UsKsRS1mJCmMwwlHDlMg7Avr9LrvSpp4ZSULO9r8jpCzcw==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-module-imports": "^7.0.0",
+ "@babel/helper-simple-access": "^7.1.0",
+ "@babel/helper-split-export-declaration": "^7.0.0",
+ "@babel/template": "^7.1.0",
+ "@babel/types": "^7.0.0",
+ "lodash": "^4.17.10"
+ }
+ },
+ "@babel/helper-optimise-call-expression": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.0.0.tgz",
+ "integrity": "sha512-u8nd9NQePYNQV8iPWu/pLLYBqZBa4ZaY1YWRFMuxrid94wKI1QNt67NEZ7GAe5Kc/0LLScbim05xZFWkAdrj9g==",
+ "dev": true,
+ "requires": {
+ "@babel/types": "^7.0.0"
+ }
+ },
+ "@babel/helper-plugin-utils": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.0.0.tgz",
+ "integrity": "sha512-CYAOUCARwExnEixLdB6sDm2dIJ/YgEAKDM1MOeMeZu9Ld/bDgVo8aiWrXwcY7OBh+1Ea2uUcVRcxKk0GJvW7QA==",
+ "dev": true
+ },
+ "@babel/helper-regex": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/@babel/helper-regex/-/helper-regex-7.0.0.tgz",
+ "integrity": "sha512-TR0/N0NDCcUIUEbqV6dCO+LptmmSQFQ7q70lfcEB4URsjD0E1HzicrwUH+ap6BAQ2jhCX9Q4UqZy4wilujWlkg==",
+ "dev": true,
+ "requires": {
+ "lodash": "^4.17.10"
+ }
+ },
+ "@babel/helper-remap-async-to-generator": {
+ "version": "7.1.0",
+ "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.1.0.tgz",
+ "integrity": "sha512-3fOK0L+Fdlg8S5al8u/hWE6vhufGSn0bN09xm2LXMy//REAF8kDCrYoOBKYmA8m5Nom+sV9LyLCwrFynA8/slg==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-annotate-as-pure": "^7.0.0",
+ "@babel/helper-wrap-function": "^7.1.0",
+ "@babel/template": "^7.1.0",
+ "@babel/traverse": "^7.1.0",
+ "@babel/types": "^7.0.0"
+ }
+ },
+ "@babel/helper-replace-supers": {
+ "version": "7.1.0",
+ "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.1.0.tgz",
+ "integrity": "sha512-BvcDWYZRWVuDeXTYZWxekQNO5D4kO55aArwZOTFXw6rlLQA8ZaDicJR1sO47h+HrnCiDFiww0fSPV0d713KBGQ==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-member-expression-to-functions": "^7.0.0",
+ "@babel/helper-optimise-call-expression": "^7.0.0",
+ "@babel/traverse": "^7.1.0",
+ "@babel/types": "^7.0.0"
+ }
+ },
+ "@babel/helper-simple-access": {
+ "version": "7.1.0",
+ "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.1.0.tgz",
+ "integrity": "sha512-Vk+78hNjRbsiu49zAPALxTb+JUQCz1aolpd8osOF16BGnLtseD21nbHgLPGUwrXEurZgiCOUmvs3ExTu4F5x6w==",
+ "dev": true,
+ "requires": {
+ "@babel/template": "^7.1.0",
+ "@babel/types": "^7.0.0"
+ }
+ },
+ "@babel/helper-split-export-declaration": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.0.0.tgz",
+ "integrity": "sha512-MXkOJqva62dfC0w85mEf/LucPPS/1+04nmmRMPEBUB++hiiThQ2zPtX/mEWQ3mtzCEjIJvPY8nuwxXtQeQwUag==",
+ "dev": true,
+ "requires": {
+ "@babel/types": "^7.0.0"
+ }
+ },
+ "@babel/helper-wrap-function": {
+ "version": "7.1.0",
+ "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.1.0.tgz",
+ "integrity": "sha512-R6HU3dete+rwsdAfrOzTlE9Mcpk4RjU3aX3gi9grtmugQY0u79X7eogUvfXA5sI81Mfq1cn6AgxihfN33STjJA==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-function-name": "^7.1.0",
+ "@babel/template": "^7.1.0",
+ "@babel/traverse": "^7.1.0",
+ "@babel/types": "^7.0.0"
+ }
+ },
+ "@babel/helpers": {
+ "version": "7.1.2",
+ "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.1.2.tgz",
+ "integrity": "sha512-Myc3pUE8eswD73aWcartxB16K6CGmHDv9KxOmD2CeOs/FaEAQodr3VYGmlvOmog60vNQ2w8QbatuahepZwrHiA==",
+ "dev": true,
+ "requires": {
+ "@babel/template": "^7.1.2",
+ "@babel/traverse": "^7.1.0",
+ "@babel/types": "^7.1.2"
+ }
+ },
+ "@babel/highlight": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0.tgz",
+ "integrity": "sha512-UFMC4ZeFC48Tpvj7C8UgLvtkaUuovQX+5xNWrsIoMG8o2z+XFKjKaN9iVmS84dPwVN00W4wPmqvYoZF3EGAsfw==",
+ "dev": true,
+ "requires": {
+ "chalk": "^2.0.0",
+ "esutils": "^2.0.2",
+ "js-tokens": "^4.0.0"
+ },
+ "dependencies": {
+ "ansi-styles": {
+ "version": "3.2.1",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
+ "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
+ "dev": true,
+ "requires": {
+ "color-convert": "^1.9.0"
+ }
+ },
+ "chalk": {
+ "version": "2.4.1",
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz",
+ "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==",
+ "dev": true,
+ "requires": {
+ "ansi-styles": "^3.2.1",
+ "escape-string-regexp": "^1.0.5",
+ "supports-color": "^5.3.0"
+ }
+ },
+ "js-tokens": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
+ "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==",
+ "dev": true
+ },
+ "supports-color": {
+ "version": "5.5.0",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
+ "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
+ "dev": true,
+ "requires": {
+ "has-flag": "^3.0.0"
+ }
+ }
+ }
+ },
+ "@babel/parser": {
+ "version": "7.1.3",
+ "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.1.3.tgz",
+ "integrity": "sha512-gqmspPZOMW3MIRb9HlrnbZHXI1/KHTOroBwN1NcLL6pWxzqzEKGvRTq0W/PxS45OtQGbaFikSQpkS5zbnsQm2w==",
+ "dev": true
+ },
+ "@babel/plugin-proposal-async-generator-functions": {
+ "version": "7.1.0",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.1.0.tgz",
+ "integrity": "sha512-Fq803F3Jcxo20MXUSDdmZZXrPe6BWyGcWBPPNB/M7WaUYESKDeKMOGIxEzQOjGSmW/NWb6UaPZrtTB2ekhB/ew==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-plugin-utils": "^7.0.0",
+ "@babel/helper-remap-async-to-generator": "^7.1.0",
+ "@babel/plugin-syntax-async-generators": "^7.0.0"
+ }
+ },
+ "@babel/plugin-proposal-json-strings": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.0.0.tgz",
+ "integrity": "sha512-kfVdUkIAGJIVmHmtS/40i/fg/AGnw/rsZBCaapY5yjeO5RA9m165Xbw9KMOu2nqXP5dTFjEjHdfNdoVcHv133Q==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-plugin-utils": "^7.0.0",
+ "@babel/plugin-syntax-json-strings": "^7.0.0"
+ }
+ },
+ "@babel/plugin-proposal-object-rest-spread": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.0.0.tgz",
+ "integrity": "sha512-14fhfoPcNu7itSen7Py1iGN0gEm87hX/B+8nZPqkdmANyyYWYMY2pjA3r8WXbWVKMzfnSNS0xY8GVS0IjXi/iw==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-plugin-utils": "^7.0.0",
+ "@babel/plugin-syntax-object-rest-spread": "^7.0.0"
+ }
+ },
+ "@babel/plugin-proposal-optional-catch-binding": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.0.0.tgz",
+ "integrity": "sha512-JPqAvLG1s13B/AuoBjdBYvn38RqW6n1TzrQO839/sIpqLpbnXKacsAgpZHzLD83Sm8SDXMkkrAvEnJ25+0yIpw==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-plugin-utils": "^7.0.0",
+ "@babel/plugin-syntax-optional-catch-binding": "^7.0.0"
+ }
+ },
+ "@babel/plugin-proposal-unicode-property-regex": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.0.0.tgz",
+ "integrity": "sha512-tM3icA6GhC3ch2SkmSxv7J/hCWKISzwycub6eGsDrFDgukD4dZ/I+x81XgW0YslS6mzNuQ1Cbzh5osjIMgepPQ==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-plugin-utils": "^7.0.0",
+ "@babel/helper-regex": "^7.0.0",
+ "regexpu-core": "^4.2.0"
+ },
+ "dependencies": {
+ "regexpu-core": {
+ "version": "4.2.0",
+ "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.2.0.tgz",
+ "integrity": "sha512-Z835VSnJJ46CNBttalHD/dB+Sj2ezmY6Xp38npwU87peK6mqOzOpV8eYktdkLTEkzzD+JsTcxd84ozd8I14+rw==",
+ "dev": true,
+ "requires": {
+ "regenerate": "^1.4.0",
+ "regenerate-unicode-properties": "^7.0.0",
+ "regjsgen": "^0.4.0",
+ "regjsparser": "^0.3.0",
+ "unicode-match-property-ecmascript": "^1.0.4",
+ "unicode-match-property-value-ecmascript": "^1.0.2"
+ }
+ },
+ "regjsgen": {
+ "version": "0.4.0",
+ "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.4.0.tgz",
+ "integrity": "sha512-X51Lte1gCYUdlwhF28+2YMO0U6WeN0GLpgpA7LK7mbdDnkQYiwvEpmpe0F/cv5L14EbxgrdayAG3JETBv0dbXA==",
+ "dev": true
+ },
+ "regjsparser": {
+ "version": "0.3.0",
+ "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.3.0.tgz",
+ "integrity": "sha512-zza72oZBBHzt64G7DxdqrOo/30bhHkwMUoT0WqfGu98XLd7N+1tsy5MJ96Bk4MD0y74n629RhmrGW6XlnLLwCA==",
+ "dev": true,
+ "requires": {
+ "jsesc": "~0.5.0"
+ }
+ }
+ }
+ },
+ "@babel/plugin-syntax-async-generators": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.0.0.tgz",
+ "integrity": "sha512-im7ged00ddGKAjcZgewXmp1vxSZQQywuQXe2B1A7kajjZmDeY/ekMPmWr9zJgveSaQH0k7BcGrojQhcK06l0zA==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-plugin-utils": "^7.0.0"
+ }
+ },
+ "@babel/plugin-syntax-json-strings": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.0.0.tgz",
+ "integrity": "sha512-UlSfNydC+XLj4bw7ijpldc1uZ/HB84vw+U6BTuqMdIEmz/LDe63w/GHtpQMdXWdqQZFeAI9PjnHe/vDhwirhKA==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-plugin-utils": "^7.0.0"
+ }
+ },
+ "@babel/plugin-syntax-jsx": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.0.0.tgz",
+ "integrity": "sha512-PdmL2AoPsCLWxhIr3kG2+F9v4WH06Q3z+NoGVpQgnUNGcagXHq5sB3OXxkSahKq9TLdNMN/AJzFYSOo8UKDMHg==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-plugin-utils": "^7.0.0"
+ }
+ },
+ "@babel/plugin-syntax-object-rest-spread": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.0.0.tgz",
+ "integrity": "sha512-5A0n4p6bIiVe5OvQPxBnesezsgFJdHhSs3uFSvaPdMqtsovajLZ+G2vZyvNe10EzJBWWo3AcHGKhAFUxqwp2dw==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-plugin-utils": "^7.0.0"
+ }
+ },
+ "@babel/plugin-syntax-optional-catch-binding": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.0.0.tgz",
+ "integrity": "sha512-Wc+HVvwjcq5qBg1w5RG9o9RVzmCaAg/Vp0erHCKpAYV8La6I94o4GQAmFYNmkzoMO6gzoOSulpKeSSz6mPEoZw==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-plugin-utils": "^7.0.0"
+ }
+ },
+ "@babel/plugin-transform-arrow-functions": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.0.0.tgz",
+ "integrity": "sha512-2EZDBl1WIO/q4DIkIp4s86sdp4ZifL51MoIviLY/gG/mLSuOIEg7J8o6mhbxOTvUJkaN50n+8u41FVsr5KLy/w==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-plugin-utils": "^7.0.0"
+ }
+ },
+ "@babel/plugin-transform-async-to-generator": {
+ "version": "7.1.0",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.1.0.tgz",
+ "integrity": "sha512-rNmcmoQ78IrvNCIt/R9U+cixUHeYAzgusTFgIAv+wQb9HJU4szhpDD6e5GCACmj/JP5KxuCwM96bX3L9v4ZN/g==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-module-imports": "^7.0.0",
+ "@babel/helper-plugin-utils": "^7.0.0",
+ "@babel/helper-remap-async-to-generator": "^7.1.0"
+ }
+ },
+ "@babel/plugin-transform-block-scoped-functions": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.0.0.tgz",
+ "integrity": "sha512-AOBiyUp7vYTqz2Jibe1UaAWL0Hl9JUXEgjFvvvcSc9MVDItv46ViXFw2F7SVt1B5k+KWjl44eeXOAk3UDEaJjQ==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-plugin-utils": "^7.0.0"
+ }
+ },
+ "@babel/plugin-transform-block-scoping": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.0.0.tgz",
+ "integrity": "sha512-GWEMCrmHQcYWISilUrk9GDqH4enf3UmhOEbNbNrlNAX1ssH3MsS1xLOS6rdjRVPgA7XXVPn87tRkdTEoA/dxEg==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-plugin-utils": "^7.0.0",
+ "lodash": "^4.17.10"
+ }
+ },
+ "@babel/plugin-transform-classes": {
+ "version": "7.1.0",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.1.0.tgz",
+ "integrity": "sha512-rNaqoD+4OCBZjM7VaskladgqnZ1LO6o2UxuWSDzljzW21pN1KXkB7BstAVweZdxQkHAujps5QMNOTWesBciKFg==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-annotate-as-pure": "^7.0.0",
+ "@babel/helper-define-map": "^7.1.0",
+ "@babel/helper-function-name": "^7.1.0",
+ "@babel/helper-optimise-call-expression": "^7.0.0",
+ "@babel/helper-plugin-utils": "^7.0.0",
+ "@babel/helper-replace-supers": "^7.1.0",
+ "@babel/helper-split-export-declaration": "^7.0.0",
+ "globals": "^11.1.0"
+ },
+ "dependencies": {
+ "globals": {
+ "version": "11.8.0",
+ "resolved": "https://registry.npmjs.org/globals/-/globals-11.8.0.tgz",
+ "integrity": "sha512-io6LkyPVuzCHBSQV9fmOwxZkUk6nIaGmxheLDgmuFv89j0fm2aqDbIXKAGfzCMHqz3HLF2Zf8WSG6VqMh2qFmA==",
+ "dev": true
+ }
+ }
+ },
+ "@babel/plugin-transform-computed-properties": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.0.0.tgz",
+ "integrity": "sha512-ubouZdChNAv4AAWAgU7QKbB93NU5sHwInEWfp+/OzJKA02E6Woh9RVoX4sZrbRwtybky/d7baTUqwFx+HgbvMA==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-plugin-utils": "^7.0.0"
+ }
+ },
+ "@babel/plugin-transform-destructuring": {
+ "version": "7.1.3",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.1.3.tgz",
+ "integrity": "sha512-Mb9M4DGIOspH1ExHOUnn2UUXFOyVTiX84fXCd+6B5iWrQg/QMeeRmSwpZ9lnjYLSXtZwiw80ytVMr3zue0ucYw==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-plugin-utils": "^7.0.0"
+ }
+ },
+ "@babel/plugin-transform-dotall-regex": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.0.0.tgz",
+ "integrity": "sha512-00THs8eJxOJUFVx1w8i1MBF4XH4PsAjKjQ1eqN/uCH3YKwP21GCKfrn6YZFZswbOk9+0cw1zGQPHVc1KBlSxig==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-plugin-utils": "^7.0.0",
+ "@babel/helper-regex": "^7.0.0",
+ "regexpu-core": "^4.1.3"
+ },
+ "dependencies": {
+ "regexpu-core": {
+ "version": "4.2.0",
+ "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.2.0.tgz",
+ "integrity": "sha512-Z835VSnJJ46CNBttalHD/dB+Sj2ezmY6Xp38npwU87peK6mqOzOpV8eYktdkLTEkzzD+JsTcxd84ozd8I14+rw==",
+ "dev": true,
+ "requires": {
+ "regenerate": "^1.4.0",
+ "regenerate-unicode-properties": "^7.0.0",
+ "regjsgen": "^0.4.0",
+ "regjsparser": "^0.3.0",
+ "unicode-match-property-ecmascript": "^1.0.4",
+ "unicode-match-property-value-ecmascript": "^1.0.2"
+ }
+ },
+ "regjsgen": {
+ "version": "0.4.0",
+ "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.4.0.tgz",
+ "integrity": "sha512-X51Lte1gCYUdlwhF28+2YMO0U6WeN0GLpgpA7LK7mbdDnkQYiwvEpmpe0F/cv5L14EbxgrdayAG3JETBv0dbXA==",
+ "dev": true
+ },
+ "regjsparser": {
+ "version": "0.3.0",
+ "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.3.0.tgz",
+ "integrity": "sha512-zza72oZBBHzt64G7DxdqrOo/30bhHkwMUoT0WqfGu98XLd7N+1tsy5MJ96Bk4MD0y74n629RhmrGW6XlnLLwCA==",
+ "dev": true,
+ "requires": {
+ "jsesc": "~0.5.0"
+ }
+ }
+ }
+ },
+ "@babel/plugin-transform-duplicate-keys": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.0.0.tgz",
+ "integrity": "sha512-w2vfPkMqRkdxx+C71ATLJG30PpwtTpW7DDdLqYt2acXU7YjztzeWW2Jk1T6hKqCLYCcEA5UQM/+xTAm+QCSnuQ==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-plugin-utils": "^7.0.0"
+ }
+ },
+ "@babel/plugin-transform-exponentiation-operator": {
+ "version": "7.1.0",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.1.0.tgz",
+ "integrity": "sha512-uZt9kD1Pp/JubkukOGQml9tqAeI8NkE98oZnHZ2qHRElmeKCodbTZgOEUtujSCSLhHSBWbzNiFSDIMC4/RBTLQ==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-builder-binary-assignment-operator-visitor": "^7.1.0",
+ "@babel/helper-plugin-utils": "^7.0.0"
+ }
+ },
+ "@babel/plugin-transform-for-of": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.0.0.tgz",
+ "integrity": "sha512-TlxKecN20X2tt2UEr2LNE6aqA0oPeMT1Y3cgz8k4Dn1j5ObT8M3nl9aA37LLklx0PBZKETC9ZAf9n/6SujTuXA==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-plugin-utils": "^7.0.0"
+ }
+ },
+ "@babel/plugin-transform-function-name": {
+ "version": "7.1.0",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.1.0.tgz",
+ "integrity": "sha512-VxOa1TMlFMtqPW2IDYZQaHsFrq/dDoIjgN098NowhexhZcz3UGlvPgZXuE1jEvNygyWyxRacqDpCZt+par1FNg==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-function-name": "^7.1.0",
+ "@babel/helper-plugin-utils": "^7.0.0"
+ }
+ },
+ "@babel/plugin-transform-literals": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.0.0.tgz",
+ "integrity": "sha512-1NTDBWkeNXgpUcyoVFxbr9hS57EpZYXpje92zv0SUzjdu3enaRwF/l3cmyRnXLtIdyJASyiS6PtybK+CgKf7jA==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-plugin-utils": "^7.0.0"
+ }
+ },
+ "@babel/plugin-transform-modules-amd": {
+ "version": "7.1.0",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.1.0.tgz",
+ "integrity": "sha512-wt8P+xQ85rrnGNr2x1iV3DW32W8zrB6ctuBkYBbf5/ZzJY99Ob4MFgsZDFgczNU76iy9PWsy4EuxOliDjdKw6A==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-module-transforms": "^7.1.0",
+ "@babel/helper-plugin-utils": "^7.0.0"
+ }
+ },
+ "@babel/plugin-transform-modules-commonjs": {
+ "version": "7.1.0",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.1.0.tgz",
+ "integrity": "sha512-wtNwtMjn1XGwM0AXPspQgvmE6msSJP15CX2RVfpTSTNPLhKhaOjaIfBaVfj4iUZ/VrFSodcFedwtPg/NxwQlPA==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-module-transforms": "^7.1.0",
+ "@babel/helper-plugin-utils": "^7.0.0",
+ "@babel/helper-simple-access": "^7.1.0"
+ }
+ },
+ "@babel/plugin-transform-modules-systemjs": {
+ "version": "7.1.3",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.1.3.tgz",
+ "integrity": "sha512-PvTxgjxQAq4pvVUZF3mD5gEtVDuId8NtWkJsZLEJZMZAW3TvgQl1pmydLLN1bM8huHFVVU43lf0uvjQj9FRkKw==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-hoist-variables": "^7.0.0",
+ "@babel/helper-plugin-utils": "^7.0.0"
+ }
+ },
+ "@babel/plugin-transform-modules-umd": {
+ "version": "7.1.0",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.1.0.tgz",
+ "integrity": "sha512-enrRtn5TfRhMmbRwm7F8qOj0qEYByqUvTttPEGimcBH4CJHphjyK1Vg7sdU7JjeEmgSpM890IT/efS2nMHwYig==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-module-transforms": "^7.1.0",
+ "@babel/helper-plugin-utils": "^7.0.0"
+ }
+ },
+ "@babel/plugin-transform-new-target": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.0.0.tgz",
+ "integrity": "sha512-yin069FYjah+LbqfGeTfzIBODex/e++Yfa0rH0fpfam9uTbuEeEOx5GLGr210ggOV77mVRNoeqSYqeuaqSzVSw==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-plugin-utils": "^7.0.0"
+ }
+ },
+ "@babel/plugin-transform-object-super": {
+ "version": "7.1.0",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.1.0.tgz",
+ "integrity": "sha512-/O02Je1CRTSk2SSJaq0xjwQ8hG4zhZGNjE8psTsSNPXyLRCODv7/PBozqT5AmQMzp7MI3ndvMhGdqp9c96tTEw==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-plugin-utils": "^7.0.0",
+ "@babel/helper-replace-supers": "^7.1.0"
+ }
+ },
+ "@babel/plugin-transform-parameters": {
+ "version": "7.1.0",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.1.0.tgz",
+ "integrity": "sha512-vHV7oxkEJ8IHxTfRr3hNGzV446GAb+0hgbA7o/0Jd76s+YzccdWuTU296FOCOl/xweU4t/Ya4g41yWz80RFCRw==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-call-delegate": "^7.1.0",
+ "@babel/helper-get-function-arity": "^7.0.0",
+ "@babel/helper-plugin-utils": "^7.0.0"
+ }
+ },
+ "@babel/plugin-transform-react-display-name": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-display-name/-/plugin-transform-react-display-name-7.0.0.tgz",
+ "integrity": "sha512-BX8xKuQTO0HzINxT6j/GiCwoJB0AOMs0HmLbEnAvcte8U8rSkNa/eSCAY+l1OA4JnCVq2jw2p6U8QQryy2fTPg==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-plugin-utils": "^7.0.0"
+ }
+ },
+ "@babel/plugin-transform-react-jsx": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.0.0.tgz",
+ "integrity": "sha512-0TMP21hXsSUjIQJmu/r7RiVxeFrXRcMUigbKu0BLegJK9PkYodHstaszcig7zxXfaBji2LYUdtqIkHs+hgYkJQ==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-builder-react-jsx": "^7.0.0",
+ "@babel/helper-plugin-utils": "^7.0.0",
+ "@babel/plugin-syntax-jsx": "^7.0.0"
+ }
+ },
+ "@babel/plugin-transform-react-jsx-self": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.0.0.tgz",
+ "integrity": "sha512-pymy+AK12WO4safW1HmBpwagUQRl9cevNX+82AIAtU1pIdugqcH+nuYP03Ja6B+N4gliAaKWAegIBL/ymALPHA==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-plugin-utils": "^7.0.0",
+ "@babel/plugin-syntax-jsx": "^7.0.0"
+ }
+ },
+ "@babel/plugin-transform-react-jsx-source": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.0.0.tgz",
+ "integrity": "sha512-OSeEpFJEH5dw/TtxTg4nijl4nHBbhqbKL94Xo/Y17WKIf2qJWeIk/QeXACF19lG1vMezkxqruwnTjVizaW7u7w==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-plugin-utils": "^7.0.0",
+ "@babel/plugin-syntax-jsx": "^7.0.0"
+ }
+ },
+ "@babel/plugin-transform-regenerator": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.0.0.tgz",
+ "integrity": "sha512-sj2qzsEx8KDVv1QuJc/dEfilkg3RRPvPYx/VnKLtItVQRWt1Wqf5eVCOLZm29CiGFfYYsA3VPjfizTCV0S0Dlw==",
+ "dev": true,
+ "requires": {
+ "regenerator-transform": "^0.13.3"
+ },
+ "dependencies": {
+ "regenerator-transform": {
+ "version": "0.13.3",
+ "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.13.3.tgz",
+ "integrity": "sha512-5ipTrZFSq5vU2YoGoww4uaRVAK4wyYC4TSICibbfEPOruUu8FFP7ErV0BjmbIOEpn3O/k9na9UEdYR/3m7N6uA==",
+ "dev": true,
+ "requires": {
+ "private": "^0.1.6"
+ }
+ }
+ }
+ },
+ "@babel/plugin-transform-shorthand-properties": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.0.0.tgz",
+ "integrity": "sha512-g/99LI4vm5iOf5r1Gdxq5Xmu91zvjhEG5+yZDJW268AZELAu4J1EiFLnkSG3yuUsZyOipVOVUKoGPYwfsTymhw==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-plugin-utils": "^7.0.0"
+ }
+ },
+ "@babel/plugin-transform-spread": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.0.0.tgz",
+ "integrity": "sha512-L702YFy2EvirrR4shTj0g2xQp7aNwZoWNCkNu2mcoU0uyzMl0XRwDSwzB/xp6DSUFiBmEXuyAyEN16LsgVqGGQ==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-plugin-utils": "^7.0.0"
+ }
+ },
+ "@babel/plugin-transform-sticky-regex": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.0.0.tgz",
+ "integrity": "sha512-LFUToxiyS/WD+XEWpkx/XJBrUXKewSZpzX68s+yEOtIbdnsRjpryDw9U06gYc6klYEij/+KQVRnD3nz3AoKmjw==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-plugin-utils": "^7.0.0",
+ "@babel/helper-regex": "^7.0.0"
+ }
+ },
+ "@babel/plugin-transform-template-literals": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.0.0.tgz",
+ "integrity": "sha512-vA6rkTCabRZu7Nbl9DfLZE1imj4tzdWcg5vtdQGvj+OH9itNNB6hxuRMHuIY8SGnEt1T9g5foqs9LnrHzsqEFg==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-annotate-as-pure": "^7.0.0",
+ "@babel/helper-plugin-utils": "^7.0.0"
+ }
+ },
+ "@babel/plugin-transform-typeof-symbol": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.0.0.tgz",
+ "integrity": "sha512-1r1X5DO78WnaAIvs5uC48t41LLckxsYklJrZjNKcevyz83sF2l4RHbw29qrCPr/6ksFsdfRpT/ZgxNWHXRnffg==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-plugin-utils": "^7.0.0"
+ }
+ },
+ "@babel/plugin-transform-unicode-regex": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.0.0.tgz",
+ "integrity": "sha512-uJBrJhBOEa3D033P95nPHu3nbFwFE9ZgXsfEitzoIXIwqAZWk7uXcg06yFKXz9FSxBH5ucgU/cYdX0IV8ldHKw==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-plugin-utils": "^7.0.0",
+ "@babel/helper-regex": "^7.0.0",
+ "regexpu-core": "^4.1.3"
+ },
+ "dependencies": {
+ "regexpu-core": {
+ "version": "4.2.0",
+ "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.2.0.tgz",
+ "integrity": "sha512-Z835VSnJJ46CNBttalHD/dB+Sj2ezmY6Xp38npwU87peK6mqOzOpV8eYktdkLTEkzzD+JsTcxd84ozd8I14+rw==",
+ "dev": true,
+ "requires": {
+ "regenerate": "^1.4.0",
+ "regenerate-unicode-properties": "^7.0.0",
+ "regjsgen": "^0.4.0",
+ "regjsparser": "^0.3.0",
+ "unicode-match-property-ecmascript": "^1.0.4",
+ "unicode-match-property-value-ecmascript": "^1.0.2"
+ }
+ },
+ "regjsgen": {
+ "version": "0.4.0",
+ "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.4.0.tgz",
+ "integrity": "sha512-X51Lte1gCYUdlwhF28+2YMO0U6WeN0GLpgpA7LK7mbdDnkQYiwvEpmpe0F/cv5L14EbxgrdayAG3JETBv0dbXA==",
+ "dev": true
+ },
+ "regjsparser": {
+ "version": "0.3.0",
+ "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.3.0.tgz",
+ "integrity": "sha512-zza72oZBBHzt64G7DxdqrOo/30bhHkwMUoT0WqfGu98XLd7N+1tsy5MJ96Bk4MD0y74n629RhmrGW6XlnLLwCA==",
+ "dev": true,
+ "requires": {
+ "jsesc": "~0.5.0"
+ }
+ }
+ }
+ },
+ "@babel/preset-env": {
+ "version": "7.1.0",
+ "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.1.0.tgz",
+ "integrity": "sha512-ZLVSynfAoDHB/34A17/JCZbyrzbQj59QC1Anyueb4Bwjh373nVPq5/HMph0z+tCmcDjXDe+DlKQq9ywQuvWrQg==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-module-imports": "^7.0.0",
+ "@babel/helper-plugin-utils": "^7.0.0",
+ "@babel/plugin-proposal-async-generator-functions": "^7.1.0",
+ "@babel/plugin-proposal-json-strings": "^7.0.0",
+ "@babel/plugin-proposal-object-rest-spread": "^7.0.0",
+ "@babel/plugin-proposal-optional-catch-binding": "^7.0.0",
+ "@babel/plugin-proposal-unicode-property-regex": "^7.0.0",
+ "@babel/plugin-syntax-async-generators": "^7.0.0",
+ "@babel/plugin-syntax-object-rest-spread": "^7.0.0",
+ "@babel/plugin-syntax-optional-catch-binding": "^7.0.0",
+ "@babel/plugin-transform-arrow-functions": "^7.0.0",
+ "@babel/plugin-transform-async-to-generator": "^7.1.0",
+ "@babel/plugin-transform-block-scoped-functions": "^7.0.0",
+ "@babel/plugin-transform-block-scoping": "^7.0.0",
+ "@babel/plugin-transform-classes": "^7.1.0",
+ "@babel/plugin-transform-computed-properties": "^7.0.0",
+ "@babel/plugin-transform-destructuring": "^7.0.0",
+ "@babel/plugin-transform-dotall-regex": "^7.0.0",
+ "@babel/plugin-transform-duplicate-keys": "^7.0.0",
+ "@babel/plugin-transform-exponentiation-operator": "^7.1.0",
+ "@babel/plugin-transform-for-of": "^7.0.0",
+ "@babel/plugin-transform-function-name": "^7.1.0",
+ "@babel/plugin-transform-literals": "^7.0.0",
+ "@babel/plugin-transform-modules-amd": "^7.1.0",
+ "@babel/plugin-transform-modules-commonjs": "^7.1.0",
+ "@babel/plugin-transform-modules-systemjs": "^7.0.0",
+ "@babel/plugin-transform-modules-umd": "^7.1.0",
+ "@babel/plugin-transform-new-target": "^7.0.0",
+ "@babel/plugin-transform-object-super": "^7.1.0",
+ "@babel/plugin-transform-parameters": "^7.1.0",
+ "@babel/plugin-transform-regenerator": "^7.0.0",
+ "@babel/plugin-transform-shorthand-properties": "^7.0.0",
+ "@babel/plugin-transform-spread": "^7.0.0",
+ "@babel/plugin-transform-sticky-regex": "^7.0.0",
+ "@babel/plugin-transform-template-literals": "^7.0.0",
+ "@babel/plugin-transform-typeof-symbol": "^7.0.0",
+ "@babel/plugin-transform-unicode-regex": "^7.0.0",
+ "browserslist": "^4.1.0",
+ "invariant": "^2.2.2",
+ "js-levenshtein": "^1.1.3",
+ "semver": "^5.3.0"
+ },
+ "dependencies": {
+ "browserslist": {
+ "version": "4.3.3",
+ "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.3.3.tgz",
+ "integrity": "sha512-6h84UD1mmHeuQ9IucX6yzBc+KBYcBBTLYt2CXtY7GYCra6iE5kOm7oM+zuGw/0tjGtbJxjm58OvxSBmogEMCRQ==",
+ "dev": true,
+ "requires": {
+ "caniuse-lite": "^1.0.30000898",
+ "electron-to-chromium": "^1.3.81",
+ "node-releases": "^1.0.0-alpha.15"
+ }
+ },
+ "caniuse-lite": {
+ "version": "1.0.30000898",
+ "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000898.tgz",
+ "integrity": "sha512-ytlTZqO4hYe4rNAJhMynUAIUI33jsP2Bb1two/9OVC39wZjPZ8exIO0eCLw5mqAtegOGiGF0kkTWTn3B02L+mw==",
+ "dev": true
+ },
+ "electron-to-chromium": {
+ "version": "1.3.81",
+ "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.81.tgz",
+ "integrity": "sha512-+rym2xtzwPWmoi8AYRrCdW65QOT0vfUHjZb5mjgh0VLyj31pGM3CpP3znKhQNBzQaWujR/KEl/mfC2lnKYgADA==",
+ "dev": true
+ },
+ "node-releases": {
+ "version": "1.0.0-alpha.15",
+ "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.0.0-alpha.15.tgz",
+ "integrity": "sha512-hKG6hd/g6a9OV/ARt2qrxbRhe/4WEMFohTLOB9PNyTYvvI59gICZFzt9/mMgpYUTts06qXlN8H6UjfbIRdnW8A==",
+ "dev": true,
+ "requires": {
+ "semver": "^5.3.0"
+ }
+ }
+ }
+ },
+ "@babel/preset-react": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/@babel/preset-react/-/preset-react-7.0.0.tgz",
+ "integrity": "sha512-oayxyPS4Zj+hF6Et11BwuBkmpgT/zMxyuZgFrMeZID6Hdh3dGlk4sHCAhdBCpuCKW2ppBfl2uCCetlrUIJRY3w==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-plugin-utils": "^7.0.0",
+ "@babel/plugin-transform-react-display-name": "^7.0.0",
+ "@babel/plugin-transform-react-jsx": "^7.0.0",
+ "@babel/plugin-transform-react-jsx-self": "^7.0.0",
+ "@babel/plugin-transform-react-jsx-source": "^7.0.0"
+ }
+ },
+ "@babel/runtime": {
+ "version": "7.1.2",
+ "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.1.2.tgz",
+ "integrity": "sha512-Y3SCjmhSupzFB6wcv1KmmFucH6gDVnI30WjOcicV10ju0cZjak3Jcs67YLIXBrmZYw1xCrVeJPbycFwrqNyxpg==",
+ "dev": true,
+ "requires": {
+ "regenerator-runtime": "^0.12.0"
+ },
+ "dependencies": {
+ "regenerator-runtime": {
+ "version": "0.12.1",
+ "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.12.1.tgz",
+ "integrity": "sha512-odxIc1/vDlo4iZcfXqRYFj0vpXFNoGdKMAUieAlFYO6m/nl5e9KR/beGf41z4a1FI+aQgtjhuaSlDxQ0hmkrHg==",
+ "dev": true
+ }
+ }
+ },
+ "@babel/template": {
+ "version": "7.1.2",
+ "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.1.2.tgz",
+ "integrity": "sha512-SY1MmplssORfFiLDcOETrW7fCLl+PavlwMh92rrGcikQaRq4iWPVH0MpwPpY3etVMx6RnDjXtr6VZYr/IbP/Ag==",
+ "dev": true,
+ "requires": {
+ "@babel/code-frame": "^7.0.0",
+ "@babel/parser": "^7.1.2",
+ "@babel/types": "^7.1.2"
+ }
+ },
+ "@babel/traverse": {
+ "version": "7.1.4",
+ "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.1.4.tgz",
+ "integrity": "sha512-my9mdrAIGdDiSVBuMjpn/oXYpva0/EZwWL3sm3Wcy/AVWO2eXnsoZruOT9jOGNRXU8KbCIu5zsKnXcAJ6PcV6Q==",
+ "dev": true,
+ "requires": {
+ "@babel/code-frame": "^7.0.0",
+ "@babel/generator": "^7.1.3",
+ "@babel/helper-function-name": "^7.1.0",
+ "@babel/helper-split-export-declaration": "^7.0.0",
+ "@babel/parser": "^7.1.3",
+ "@babel/types": "^7.1.3",
+ "debug": "^3.1.0",
+ "globals": "^11.1.0",
+ "lodash": "^4.17.10"
+ },
+ "dependencies": {
+ "debug": {
+ "version": "3.2.6",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz",
+ "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==",
+ "dev": true,
+ "requires": {
+ "ms": "^2.1.1"
+ }
+ },
+ "globals": {
+ "version": "11.8.0",
+ "resolved": "https://registry.npmjs.org/globals/-/globals-11.8.0.tgz",
+ "integrity": "sha512-io6LkyPVuzCHBSQV9fmOwxZkUk6nIaGmxheLDgmuFv89j0fm2aqDbIXKAGfzCMHqz3HLF2Zf8WSG6VqMh2qFmA==",
+ "dev": true
+ },
+ "ms": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz",
+ "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==",
+ "dev": true
+ }
+ }
+ },
+ "@babel/types": {
+ "version": "7.1.3",
+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.1.3.tgz",
+ "integrity": "sha512-RpPOVfK+yatXyn8n4PB1NW6k9qjinrXrRR8ugBN8fD6hCy5RXI6PSbVqpOJBO9oSaY7Nom4ohj35feb0UR9hSA==",
+ "dev": true,
+ "requires": {
+ "esutils": "^2.0.2",
+ "lodash": "^4.17.10",
+ "to-fast-properties": "^2.0.0"
+ },
+ "dependencies": {
+ "to-fast-properties": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz",
+ "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=",
+ "dev": true
+ }
+ }
+ },
"@firebase/app": {
"version": "0.3.4",
"resolved": "https://registry.npmjs.org/@firebase/app/-/app-0.3.4.tgz",
@@ -153,6 +1190,223 @@
"resolved": "https://registry.npmjs.org/@firebase/webchannel-wrapper/-/webchannel-wrapper-0.2.11.tgz",
"integrity": "sha512-WyMXDxk/WZ+f2lOCeEvDWUce2f5Kk2sNfvArK8f+PlUnzFdy/MBzLXrmbMgyZXP7GP4ooUxYV8Sdmoh1hGk1Uw=="
},
+ "@webassemblyjs/ast": {
+ "version": "1.7.10",
+ "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.7.10.tgz",
+ "integrity": "sha512-wTUeaByYN2EA6qVqhbgavtGc7fLTOx0glG2IBsFlrFG51uXIGlYBTyIZMf4SPLo3v1bgV/7lBN3l7Z0R6Hswew==",
+ "dev": true,
+ "requires": {
+ "@webassemblyjs/helper-module-context": "1.7.10",
+ "@webassemblyjs/helper-wasm-bytecode": "1.7.10",
+ "@webassemblyjs/wast-parser": "1.7.10"
+ }
+ },
+ "@webassemblyjs/floating-point-hex-parser": {
+ "version": "1.7.10",
+ "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.7.10.tgz",
+ "integrity": "sha512-gMsGbI6I3p/P1xL2UxqhNh1ga2HCsx5VBB2i5VvJFAaqAjd2PBTRULc3BpTydabUQEGlaZCzEUQhLoLG7TvEYQ==",
+ "dev": true
+ },
+ "@webassemblyjs/helper-api-error": {
+ "version": "1.7.10",
+ "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.7.10.tgz",
+ "integrity": "sha512-DoYRlPWtuw3yd5BOr9XhtrmB6X1enYF0/54yNvQWGXZEPDF5PJVNI7zQ7gkcKfTESzp8bIBWailaFXEK/jjCsw==",
+ "dev": true
+ },
+ "@webassemblyjs/helper-buffer": {
+ "version": "1.7.10",
+ "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.7.10.tgz",
+ "integrity": "sha512-+RMU3dt/dPh4EpVX4u5jxsOlw22tp3zjqE0m3ftU2tsYxnPULb4cyHlgaNd2KoWuwasCQqn8Mhr+TTdbtj3LlA==",
+ "dev": true
+ },
+ "@webassemblyjs/helper-code-frame": {
+ "version": "1.7.10",
+ "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-code-frame/-/helper-code-frame-1.7.10.tgz",
+ "integrity": "sha512-UiytbpKAULOEab2hUZK2ywXen4gWJVrgxtwY3Kn+eZaaSWaRM8z/7dAXRSoamhKFiBh1uaqxzE/XD9BLlug3gw==",
+ "dev": true,
+ "requires": {
+ "@webassemblyjs/wast-printer": "1.7.10"
+ }
+ },
+ "@webassemblyjs/helper-fsm": {
+ "version": "1.7.10",
+ "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-fsm/-/helper-fsm-1.7.10.tgz",
+ "integrity": "sha512-w2vDtUK9xeSRtt5+RnnlRCI7wHEvLjF0XdnxJpgx+LJOvklTZPqWkuy/NhwHSLP19sm9H8dWxKeReMR7sCkGZA==",
+ "dev": true
+ },
+ "@webassemblyjs/helper-module-context": {
+ "version": "1.7.10",
+ "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-module-context/-/helper-module-context-1.7.10.tgz",
+ "integrity": "sha512-yE5x/LzZ3XdPdREmJijxzfrf+BDRewvO0zl8kvORgSWmxpRrkqY39KZSq6TSgIWBxkK4SrzlS3BsMCv2s1FpsQ==",
+ "dev": true
+ },
+ "@webassemblyjs/helper-wasm-bytecode": {
+ "version": "1.7.10",
+ "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.7.10.tgz",
+ "integrity": "sha512-u5qy4SJ/OrxKxZqJ9N3qH4ZQgHaAzsopsYwLvoWJY6Q33r8PhT3VPyNMaJ7ZFoqzBnZlCcS/0f4Sp8WBxylXfg==",
+ "dev": true
+ },
+ "@webassemblyjs/helper-wasm-section": {
+ "version": "1.7.10",
+ "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.7.10.tgz",
+ "integrity": "sha512-Ecvww6sCkcjatcyctUrn22neSJHLN/TTzolMGG/N7S9rpbsTZ8c6Bl98GpSpV77EvzNijiNRHBG0+JO99qKz6g==",
+ "dev": true,
+ "requires": {
+ "@webassemblyjs/ast": "1.7.10",
+ "@webassemblyjs/helper-buffer": "1.7.10",
+ "@webassemblyjs/helper-wasm-bytecode": "1.7.10",
+ "@webassemblyjs/wasm-gen": "1.7.10"
+ }
+ },
+ "@webassemblyjs/ieee754": {
+ "version": "1.7.10",
+ "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.7.10.tgz",
+ "integrity": "sha512-HRcWcY+YWt4+s/CvQn+vnSPfRaD4KkuzQFt5MNaELXXHSjelHlSEA8ZcqT69q0GTIuLWZ6JaoKar4yWHVpZHsQ==",
+ "dev": true,
+ "requires": {
+ "@xtuc/ieee754": "^1.2.0"
+ }
+ },
+ "@webassemblyjs/leb128": {
+ "version": "1.7.10",
+ "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.7.10.tgz",
+ "integrity": "sha512-og8MciYlA8hvzCLR71hCuZKPbVBfLQeHv7ImKZ4nlyxrYbG7uJHYtHiHu6OV9SqrGuD03H/HtXC4Bgdjfm9FHw==",
+ "dev": true,
+ "requires": {
+ "@xtuc/long": "4.2.1"
+ }
+ },
+ "@webassemblyjs/utf8": {
+ "version": "1.7.10",
+ "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.7.10.tgz",
+ "integrity": "sha512-Ng6Pxv6siyZp635xCSnH3mKmIFgqWPCcGdoo0GBYgyGdxu7cUj4agV7Uu1a8REP66UYUFXJLudeGgd4RvuJAnQ==",
+ "dev": true
+ },
+ "@webassemblyjs/wasm-edit": {
+ "version": "1.7.10",
+ "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.7.10.tgz",
+ "integrity": "sha512-e9RZFQlb+ZuYcKRcW9yl+mqX/Ycj9+3/+ppDI8nEE/NCY6FoK8f3dKBcfubYV/HZn44b+ND4hjh+4BYBt+sDnA==",
+ "dev": true,
+ "requires": {
+ "@webassemblyjs/ast": "1.7.10",
+ "@webassemblyjs/helper-buffer": "1.7.10",
+ "@webassemblyjs/helper-wasm-bytecode": "1.7.10",
+ "@webassemblyjs/helper-wasm-section": "1.7.10",
+ "@webassemblyjs/wasm-gen": "1.7.10",
+ "@webassemblyjs/wasm-opt": "1.7.10",
+ "@webassemblyjs/wasm-parser": "1.7.10",
+ "@webassemblyjs/wast-printer": "1.7.10"
+ }
+ },
+ "@webassemblyjs/wasm-gen": {
+ "version": "1.7.10",
+ "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.7.10.tgz",
+ "integrity": "sha512-M0lb6cO2Y0PzDye/L39PqwV+jvO+2YxEG5ax+7dgq7EwXdAlpOMx1jxyXJTScQoeTpzOPIb+fLgX/IkLF8h2yw==",
+ "dev": true,
+ "requires": {
+ "@webassemblyjs/ast": "1.7.10",
+ "@webassemblyjs/helper-wasm-bytecode": "1.7.10",
+ "@webassemblyjs/ieee754": "1.7.10",
+ "@webassemblyjs/leb128": "1.7.10",
+ "@webassemblyjs/utf8": "1.7.10"
+ }
+ },
+ "@webassemblyjs/wasm-opt": {
+ "version": "1.7.10",
+ "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.7.10.tgz",
+ "integrity": "sha512-R66IHGCdicgF5ZliN10yn5HaC7vwYAqrSVJGjtJJQp5+QNPBye6heWdVH/at40uh0uoaDN/UVUfXK0gvuUqtVg==",
+ "dev": true,
+ "requires": {
+ "@webassemblyjs/ast": "1.7.10",
+ "@webassemblyjs/helper-buffer": "1.7.10",
+ "@webassemblyjs/wasm-gen": "1.7.10",
+ "@webassemblyjs/wasm-parser": "1.7.10"
+ }
+ },
+ "@webassemblyjs/wasm-parser": {
+ "version": "1.7.10",
+ "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.7.10.tgz",
+ "integrity": "sha512-AEv8mkXVK63n/iDR3T693EzoGPnNAwKwT3iHmKJNBrrALAhhEjuPzo/lTE4U7LquEwyvg5nneSNdTdgrBaGJcA==",
+ "dev": true,
+ "requires": {
+ "@webassemblyjs/ast": "1.7.10",
+ "@webassemblyjs/helper-api-error": "1.7.10",
+ "@webassemblyjs/helper-wasm-bytecode": "1.7.10",
+ "@webassemblyjs/ieee754": "1.7.10",
+ "@webassemblyjs/leb128": "1.7.10",
+ "@webassemblyjs/utf8": "1.7.10"
+ }
+ },
+ "@webassemblyjs/wast-parser": {
+ "version": "1.7.10",
+ "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-parser/-/wast-parser-1.7.10.tgz",
+ "integrity": "sha512-YTPEtOBljkCL0VjDp4sHe22dAYSm3ZwdJ9+2NTGdtC7ayNvuip1wAhaAS8Zt9Q6SW9E5Jf5PX7YE3XWlrzR9cw==",
+ "dev": true,
+ "requires": {
+ "@webassemblyjs/ast": "1.7.10",
+ "@webassemblyjs/floating-point-hex-parser": "1.7.10",
+ "@webassemblyjs/helper-api-error": "1.7.10",
+ "@webassemblyjs/helper-code-frame": "1.7.10",
+ "@webassemblyjs/helper-fsm": "1.7.10",
+ "@xtuc/long": "4.2.1"
+ }
+ },
+ "@webassemblyjs/wast-printer": {
+ "version": "1.7.10",
+ "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.7.10.tgz",
+ "integrity": "sha512-mJ3QKWtCchL1vhU/kZlJnLPuQZnlDOdZsyP0bbLWPGdYsQDnSBvyTLhzwBA3QAMlzEL9V4JHygEmK6/OTEyytA==",
+ "dev": true,
+ "requires": {
+ "@webassemblyjs/ast": "1.7.10",
+ "@webassemblyjs/wast-parser": "1.7.10",
+ "@xtuc/long": "4.2.1"
+ }
+ },
+ "@xtuc/ieee754": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz",
+ "integrity": "sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==",
+ "dev": true
+ },
+ "@xtuc/long": {
+ "version": "4.2.1",
+ "resolved": "https://registry.npmjs.org/@xtuc/long/-/long-4.2.1.tgz",
+ "integrity": "sha512-FZdkNBDqBRHKQ2MEbSC17xnPFOhZxeJ2YGSfr2BKf3sujG49Qe3bB+rGCwQfIaA7WHnGeGkSijX4FuBCdrzW/g==",
+ "dev": true
+ },
+ "acorn": {
+ "version": "5.7.3",
+ "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.3.tgz",
+ "integrity": "sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw==",
+ "dev": true
+ },
+ "acorn-dynamic-import": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/acorn-dynamic-import/-/acorn-dynamic-import-3.0.0.tgz",
+ "integrity": "sha512-zVWV8Z8lislJoOKKqdNMOB+s6+XV5WERty8MnKBeFgwA+19XJjJHs2RP5dzM57FftIs+jQnRToLiWazKr6sSWg==",
+ "dev": true,
+ "requires": {
+ "acorn": "^5.0.0"
+ }
+ },
+ "ajv": {
+ "version": "6.5.4",
+ "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.5.4.tgz",
+ "integrity": "sha512-4Wyjt8+t6YszqaXnLDfMmG/8AlO5Zbcsy3ATHncCzjW/NoPzAId8AK6749Ybjmdt+kUY1gP60fCu46oDxPv/mg==",
+ "dev": true,
+ "requires": {
+ "fast-deep-equal": "^2.0.1",
+ "fast-json-stable-stringify": "^2.0.0",
+ "json-schema-traverse": "^0.4.1",
+ "uri-js": "^4.2.2"
+ }
+ },
+ "ajv-keywords": {
+ "version": "3.2.0",
+ "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.2.0.tgz",
+ "integrity": "sha1-6GuBnGAs+IIa1jdBNpjx3sAhhHo=",
+ "dev": true
+ },
"alphanum-sort": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/alphanum-sort/-/alphanum-sort-1.0.2.tgz",
@@ -165,22 +1419,30 @@
"integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8="
},
"ansi-styles": {
- "version": "2.2.1",
- "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz",
- "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=",
- "dev": true
+ "version": "3.2.1",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
+ "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
+ "dev": true,
+ "requires": {
+ "color-convert": "^1.9.0"
+ }
},
"anymatch": {
- "version": "1.3.2",
- "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-1.3.2.tgz",
- "integrity": "sha512-0XNayC8lTHQ2OI8aljNCN3sSx6hsr/1+rlcDAotXJR7C1oZZHCNsfpbKwMjRA3Uqb5tF1Rae2oloTr4xpq+WjA==",
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz",
+ "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==",
"dev": true,
- "optional": true,
"requires": {
- "micromatch": "^2.1.5",
- "normalize-path": "^2.0.0"
+ "micromatch": "^3.1.4",
+ "normalize-path": "^2.1.1"
}
},
+ "aproba": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz",
+ "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==",
+ "dev": true
+ },
"argparse": {
"version": "1.0.10",
"resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz",
@@ -191,14 +1453,10 @@
}
},
"arr-diff": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz",
- "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=",
- "dev": true,
- "optional": true,
- "requires": {
- "arr-flatten": "^1.0.1"
- }
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz",
+ "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=",
+ "dev": true
},
"arr-flatten": {
"version": "1.1.0",
@@ -213,11 +1471,10 @@
"dev": true
},
"array-unique": {
- "version": "0.2.1",
- "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz",
- "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=",
- "dev": true,
- "optional": true
+ "version": "0.3.2",
+ "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz",
+ "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=",
+ "dev": true
},
"ascli": {
"version": "1.0.1",
@@ -228,6 +1485,43 @@
"optjs": "~3.2.2"
}
},
+ "asn1.js": {
+ "version": "4.10.1",
+ "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.10.1.tgz",
+ "integrity": "sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw==",
+ "dev": true,
+ "requires": {
+ "bn.js": "^4.0.0",
+ "inherits": "^2.0.1",
+ "minimalistic-assert": "^1.0.0"
+ }
+ },
+ "assert": {
+ "version": "1.4.1",
+ "resolved": "https://registry.npmjs.org/assert/-/assert-1.4.1.tgz",
+ "integrity": "sha1-mZEtWRg2tab1s0XA8H7vwI/GXZE=",
+ "dev": true,
+ "requires": {
+ "util": "0.10.3"
+ },
+ "dependencies": {
+ "inherits": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz",
+ "integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE=",
+ "dev": true
+ },
+ "util": {
+ "version": "0.10.3",
+ "resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz",
+ "integrity": "sha1-evsa/lCAUkZInj23/g7TeTNqwPk=",
+ "dev": true,
+ "requires": {
+ "inherits": "2.0.1"
+ }
+ }
+ }
+ },
"assign-symbols": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz",
@@ -238,8 +1532,7 @@
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.1.tgz",
"integrity": "sha1-GdOGodntxufByF04iu28xW0zYC0=",
- "dev": true,
- "optional": true
+ "dev": true
},
"atob": {
"version": "2.1.2",
@@ -247,661 +1540,29 @@
"integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==",
"dev": true
},
- "babel-cli": {
- "version": "6.26.0",
- "resolved": "https://registry.npmjs.org/babel-cli/-/babel-cli-6.26.0.tgz",
- "integrity": "sha1-UCq1SHTX24itALiHoGODzgPQAvE=",
+ "babel-loader": {
+ "version": "8.0.4",
+ "resolved": "https://registry.npmjs.org/babel-loader/-/babel-loader-8.0.4.tgz",
+ "integrity": "sha512-fhBhNkUToJcW9nV46v8w87AJOwAJDz84c1CL57n3Stj73FANM/b9TbCUK4YhdOwEyZ+OxhYpdeZDNzSI29Firw==",
"dev": true,
"requires": {
- "babel-core": "^6.26.0",
- "babel-polyfill": "^6.26.0",
- "babel-register": "^6.26.0",
- "babel-runtime": "^6.26.0",
- "chokidar": "^1.6.1",
- "commander": "^2.11.0",
- "convert-source-map": "^1.5.0",
- "fs-readdir-recursive": "^1.0.0",
- "glob": "^7.1.2",
- "lodash": "^4.17.4",
- "output-file-sync": "^1.1.2",
- "path-is-absolute": "^1.0.1",
- "slash": "^1.0.0",
- "source-map": "^0.5.6",
- "v8flags": "^2.1.1"
- }
- },
- "babel-code-frame": {
- "version": "6.26.0",
- "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz",
- "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=",
- "dev": true,
- "requires": {
- "chalk": "^1.1.3",
- "esutils": "^2.0.2",
- "js-tokens": "^3.0.2"
- }
- },
- "babel-core": {
- "version": "6.26.3",
- "resolved": "https://registry.npmjs.org/babel-core/-/babel-core-6.26.3.tgz",
- "integrity": "sha512-6jyFLuDmeidKmUEb3NM+/yawG0M2bDZ9Z1qbZP59cyHLz8kYGKYwpJP0UwUKKUiTRNvxfLesJnTedqczP7cTDA==",
- "dev": true,
- "requires": {
- "babel-code-frame": "^6.26.0",
- "babel-generator": "^6.26.0",
- "babel-helpers": "^6.24.1",
- "babel-messages": "^6.23.0",
- "babel-register": "^6.26.0",
- "babel-runtime": "^6.26.0",
- "babel-template": "^6.26.0",
- "babel-traverse": "^6.26.0",
- "babel-types": "^6.26.0",
- "babylon": "^6.18.0",
- "convert-source-map": "^1.5.1",
- "debug": "^2.6.9",
- "json5": "^0.5.1",
- "lodash": "^4.17.4",
- "minimatch": "^3.0.4",
- "path-is-absolute": "^1.0.1",
- "private": "^0.1.8",
- "slash": "^1.0.0",
- "source-map": "^0.5.7"
- }
- },
- "babel-generator": {
- "version": "6.26.1",
- "resolved": "https://registry.npmjs.org/babel-generator/-/babel-generator-6.26.1.tgz",
- "integrity": "sha512-HyfwY6ApZj7BYTcJURpM5tznulaBvyio7/0d4zFOeMPUmfxkCjHocCuoLa2SAGzBI8AREcH3eP3758F672DppA==",
- "dev": true,
- "requires": {
- "babel-messages": "^6.23.0",
- "babel-runtime": "^6.26.0",
- "babel-types": "^6.26.0",
- "detect-indent": "^4.0.0",
- "jsesc": "^1.3.0",
- "lodash": "^4.17.4",
- "source-map": "^0.5.7",
- "trim-right": "^1.0.1"
- }
- },
- "babel-helper-builder-binary-assignment-operator-visitor": {
- "version": "6.24.1",
- "resolved": "https://registry.npmjs.org/babel-helper-builder-binary-assignment-operator-visitor/-/babel-helper-builder-binary-assignment-operator-visitor-6.24.1.tgz",
- "integrity": "sha1-zORReto1b0IgvK6KAsKzRvmlZmQ=",
- "dev": true,
- "requires": {
- "babel-helper-explode-assignable-expression": "^6.24.1",
- "babel-runtime": "^6.22.0",
- "babel-types": "^6.24.1"
- }
- },
- "babel-helper-call-delegate": {
- "version": "6.24.1",
- "resolved": "https://registry.npmjs.org/babel-helper-call-delegate/-/babel-helper-call-delegate-6.24.1.tgz",
- "integrity": "sha1-7Oaqzdx25Bw0YfiL/Fdb0Nqi340=",
- "dev": true,
- "requires": {
- "babel-helper-hoist-variables": "^6.24.1",
- "babel-runtime": "^6.22.0",
- "babel-traverse": "^6.24.1",
- "babel-types": "^6.24.1"
- }
- },
- "babel-helper-define-map": {
- "version": "6.26.0",
- "resolved": "https://registry.npmjs.org/babel-helper-define-map/-/babel-helper-define-map-6.26.0.tgz",
- "integrity": "sha1-pfVtq0GiX5fstJjH66ypgZ+Vvl8=",
- "dev": true,
- "requires": {
- "babel-helper-function-name": "^6.24.1",
- "babel-runtime": "^6.26.0",
- "babel-types": "^6.26.0",
- "lodash": "^4.17.4"
- }
- },
- "babel-helper-explode-assignable-expression": {
- "version": "6.24.1",
- "resolved": "https://registry.npmjs.org/babel-helper-explode-assignable-expression/-/babel-helper-explode-assignable-expression-6.24.1.tgz",
- "integrity": "sha1-8luCz33BBDPFX3BZLVdGQArCLKo=",
- "dev": true,
- "requires": {
- "babel-runtime": "^6.22.0",
- "babel-traverse": "^6.24.1",
- "babel-types": "^6.24.1"
- }
- },
- "babel-helper-function-name": {
- "version": "6.24.1",
- "resolved": "https://registry.npmjs.org/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz",
- "integrity": "sha1-00dbjAPtmCQqJbSDUasYOZ01gKk=",
- "dev": true,
- "requires": {
- "babel-helper-get-function-arity": "^6.24.1",
- "babel-runtime": "^6.22.0",
- "babel-template": "^6.24.1",
- "babel-traverse": "^6.24.1",
- "babel-types": "^6.24.1"
- }
- },
- "babel-helper-get-function-arity": {
- "version": "6.24.1",
- "resolved": "https://registry.npmjs.org/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.24.1.tgz",
- "integrity": "sha1-j3eCqpNAfEHTqlCQj4mwMbG2hT0=",
- "dev": true,
- "requires": {
- "babel-runtime": "^6.22.0",
- "babel-types": "^6.24.1"
- }
- },
- "babel-helper-hoist-variables": {
- "version": "6.24.1",
- "resolved": "https://registry.npmjs.org/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.24.1.tgz",
- "integrity": "sha1-HssnaJydJVE+rbyZFKc/VAi+enY=",
- "dev": true,
- "requires": {
- "babel-runtime": "^6.22.0",
- "babel-types": "^6.24.1"
- }
- },
- "babel-helper-optimise-call-expression": {
- "version": "6.24.1",
- "resolved": "https://registry.npmjs.org/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.24.1.tgz",
- "integrity": "sha1-96E0J7qfc/j0+pk8VKl4gtEkQlc=",
- "dev": true,
- "requires": {
- "babel-runtime": "^6.22.0",
- "babel-types": "^6.24.1"
- }
- },
- "babel-helper-regex": {
- "version": "6.26.0",
- "resolved": "https://registry.npmjs.org/babel-helper-regex/-/babel-helper-regex-6.26.0.tgz",
- "integrity": "sha1-MlxZ+QL4LyS3T6zu0DY5VPZJXnI=",
- "dev": true,
- "requires": {
- "babel-runtime": "^6.26.0",
- "babel-types": "^6.26.0",
- "lodash": "^4.17.4"
- }
- },
- "babel-helper-remap-async-to-generator": {
- "version": "6.24.1",
- "resolved": "https://registry.npmjs.org/babel-helper-remap-async-to-generator/-/babel-helper-remap-async-to-generator-6.24.1.tgz",
- "integrity": "sha1-XsWBgnrXI/7N04HxySg5BnbkVRs=",
- "dev": true,
- "requires": {
- "babel-helper-function-name": "^6.24.1",
- "babel-runtime": "^6.22.0",
- "babel-template": "^6.24.1",
- "babel-traverse": "^6.24.1",
- "babel-types": "^6.24.1"
- }
- },
- "babel-helper-replace-supers": {
- "version": "6.24.1",
- "resolved": "https://registry.npmjs.org/babel-helper-replace-supers/-/babel-helper-replace-supers-6.24.1.tgz",
- "integrity": "sha1-v22/5Dk40XNpohPKiov3S2qQqxo=",
- "dev": true,
- "requires": {
- "babel-helper-optimise-call-expression": "^6.24.1",
- "babel-messages": "^6.23.0",
- "babel-runtime": "^6.22.0",
- "babel-template": "^6.24.1",
- "babel-traverse": "^6.24.1",
- "babel-types": "^6.24.1"
- }
- },
- "babel-helpers": {
- "version": "6.24.1",
- "resolved": "https://registry.npmjs.org/babel-helpers/-/babel-helpers-6.24.1.tgz",
- "integrity": "sha1-NHHenK7DiOXIUOWX5Yom3fN2ArI=",
- "dev": true,
- "requires": {
- "babel-runtime": "^6.22.0",
- "babel-template": "^6.24.1"
- }
- },
- "babel-messages": {
- "version": "6.23.0",
- "resolved": "https://registry.npmjs.org/babel-messages/-/babel-messages-6.23.0.tgz",
- "integrity": "sha1-8830cDhYA1sqKVHG7F7fbGLyYw4=",
- "dev": true,
- "requires": {
- "babel-runtime": "^6.22.0"
- }
- },
- "babel-plugin-check-es2015-constants": {
- "version": "6.22.0",
- "resolved": "https://registry.npmjs.org/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz",
- "integrity": "sha1-NRV7EBQm/S/9PaP3XH0ekYNbv4o=",
- "dev": true,
- "requires": {
- "babel-runtime": "^6.22.0"
- }
- },
- "babel-plugin-syntax-async-functions": {
- "version": "6.13.0",
- "resolved": "http://registry.npmjs.org/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz",
- "integrity": "sha1-ytnK0RkbWtY0vzCuCHI5HgZHvpU=",
- "dev": true
- },
- "babel-plugin-syntax-exponentiation-operator": {
- "version": "6.13.0",
- "resolved": "http://registry.npmjs.org/babel-plugin-syntax-exponentiation-operator/-/babel-plugin-syntax-exponentiation-operator-6.13.0.tgz",
- "integrity": "sha1-nufoM3KQ2pUoggGmpX9BcDF4MN4=",
- "dev": true
- },
- "babel-plugin-syntax-trailing-function-commas": {
- "version": "6.22.0",
- "resolved": "https://registry.npmjs.org/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.22.0.tgz",
- "integrity": "sha1-ugNgk3+NBuQBgKQ/4NVhb/9TLPM=",
- "dev": true
- },
- "babel-plugin-transform-async-to-generator": {
- "version": "6.24.1",
- "resolved": "https://registry.npmjs.org/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.24.1.tgz",
- "integrity": "sha1-ZTbjeK/2yx1VF6wOQOs+n8jQh2E=",
- "dev": true,
- "requires": {
- "babel-helper-remap-async-to-generator": "^6.24.1",
- "babel-plugin-syntax-async-functions": "^6.8.0",
- "babel-runtime": "^6.22.0"
- }
- },
- "babel-plugin-transform-es2015-arrow-functions": {
- "version": "6.22.0",
- "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz",
- "integrity": "sha1-RSaSy3EdX3ncf4XkQM5BufJE0iE=",
- "dev": true,
- "requires": {
- "babel-runtime": "^6.22.0"
- }
- },
- "babel-plugin-transform-es2015-block-scoped-functions": {
- "version": "6.22.0",
- "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-block-scoped-functions/-/babel-plugin-transform-es2015-block-scoped-functions-6.22.0.tgz",
- "integrity": "sha1-u8UbSflk1wy42OC5ToICRs46YUE=",
- "dev": true,
- "requires": {
- "babel-runtime": "^6.22.0"
- }
- },
- "babel-plugin-transform-es2015-block-scoping": {
- "version": "6.26.0",
- "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.26.0.tgz",
- "integrity": "sha1-1w9SmcEwjQXBL0Y4E7CgnnOxiV8=",
- "dev": true,
- "requires": {
- "babel-runtime": "^6.26.0",
- "babel-template": "^6.26.0",
- "babel-traverse": "^6.26.0",
- "babel-types": "^6.26.0",
- "lodash": "^4.17.4"
- }
- },
- "babel-plugin-transform-es2015-classes": {
- "version": "6.24.1",
- "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.24.1.tgz",
- "integrity": "sha1-WkxYpQyclGHlZLSyo7+ryXolhNs=",
- "dev": true,
- "requires": {
- "babel-helper-define-map": "^6.24.1",
- "babel-helper-function-name": "^6.24.1",
- "babel-helper-optimise-call-expression": "^6.24.1",
- "babel-helper-replace-supers": "^6.24.1",
- "babel-messages": "^6.23.0",
- "babel-runtime": "^6.22.0",
- "babel-template": "^6.24.1",
- "babel-traverse": "^6.24.1",
- "babel-types": "^6.24.1"
- }
- },
- "babel-plugin-transform-es2015-computed-properties": {
- "version": "6.24.1",
- "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.24.1.tgz",
- "integrity": "sha1-b+Ko0WiV1WNPTNmZttNICjCBWbM=",
- "dev": true,
- "requires": {
- "babel-runtime": "^6.22.0",
- "babel-template": "^6.24.1"
- }
- },
- "babel-plugin-transform-es2015-destructuring": {
- "version": "6.23.0",
- "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz",
- "integrity": "sha1-mXux8auWf2gtKwh2/jWNYOdlxW0=",
- "dev": true,
- "requires": {
- "babel-runtime": "^6.22.0"
- }
- },
- "babel-plugin-transform-es2015-duplicate-keys": {
- "version": "6.24.1",
- "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.24.1.tgz",
- "integrity": "sha1-c+s9MQypaePvnskcU3QabxV2Qj4=",
- "dev": true,
- "requires": {
- "babel-runtime": "^6.22.0",
- "babel-types": "^6.24.1"
- }
- },
- "babel-plugin-transform-es2015-for-of": {
- "version": "6.23.0",
- "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.23.0.tgz",
- "integrity": "sha1-9HyVsrYT3x0+zC/bdXNiPHUkhpE=",
- "dev": true,
- "requires": {
- "babel-runtime": "^6.22.0"
- }
- },
- "babel-plugin-transform-es2015-function-name": {
- "version": "6.24.1",
- "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.24.1.tgz",
- "integrity": "sha1-g0yJhTvDaxrw86TF26qU/Y6sqos=",
- "dev": true,
- "requires": {
- "babel-helper-function-name": "^6.24.1",
- "babel-runtime": "^6.22.0",
- "babel-types": "^6.24.1"
- }
- },
- "babel-plugin-transform-es2015-literals": {
- "version": "6.22.0",
- "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-literals/-/babel-plugin-transform-es2015-literals-6.22.0.tgz",
- "integrity": "sha1-T1SgLWzWbPkVKAAZox0xklN3yi4=",
- "dev": true,
- "requires": {
- "babel-runtime": "^6.22.0"
- }
- },
- "babel-plugin-transform-es2015-modules-amd": {
- "version": "6.24.1",
- "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.24.1.tgz",
- "integrity": "sha1-Oz5UAXI5hC1tGcMBHEvS8AoA0VQ=",
- "dev": true,
- "requires": {
- "babel-plugin-transform-es2015-modules-commonjs": "^6.24.1",
- "babel-runtime": "^6.22.0",
- "babel-template": "^6.24.1"
- }
- },
- "babel-plugin-transform-es2015-modules-commonjs": {
- "version": "6.26.2",
- "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.26.2.tgz",
- "integrity": "sha512-CV9ROOHEdrjcwhIaJNBGMBCodN+1cfkwtM1SbUHmvyy35KGT7fohbpOxkE2uLz1o6odKK2Ck/tz47z+VqQfi9Q==",
- "dev": true,
- "requires": {
- "babel-plugin-transform-strict-mode": "^6.24.1",
- "babel-runtime": "^6.26.0",
- "babel-template": "^6.26.0",
- "babel-types": "^6.26.0"
- }
- },
- "babel-plugin-transform-es2015-modules-systemjs": {
- "version": "6.24.1",
- "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.24.1.tgz",
- "integrity": "sha1-/4mhQrkRmpBhlfXxBuzzBdlAfSM=",
- "dev": true,
- "requires": {
- "babel-helper-hoist-variables": "^6.24.1",
- "babel-runtime": "^6.22.0",
- "babel-template": "^6.24.1"
- }
- },
- "babel-plugin-transform-es2015-modules-umd": {
- "version": "6.24.1",
- "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.24.1.tgz",
- "integrity": "sha1-rJl+YoXNGO1hdq22B9YCNErThGg=",
- "dev": true,
- "requires": {
- "babel-plugin-transform-es2015-modules-amd": "^6.24.1",
- "babel-runtime": "^6.22.0",
- "babel-template": "^6.24.1"
- }
- },
- "babel-plugin-transform-es2015-object-super": {
- "version": "6.24.1",
- "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.24.1.tgz",
- "integrity": "sha1-JM72muIcuDp/hgPa0CH1cusnj40=",
- "dev": true,
- "requires": {
- "babel-helper-replace-supers": "^6.24.1",
- "babel-runtime": "^6.22.0"
- }
- },
- "babel-plugin-transform-es2015-parameters": {
- "version": "6.24.1",
- "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.24.1.tgz",
- "integrity": "sha1-V6w1GrScrxSpfNE7CfZv3wpiXys=",
- "dev": true,
- "requires": {
- "babel-helper-call-delegate": "^6.24.1",
- "babel-helper-get-function-arity": "^6.24.1",
- "babel-runtime": "^6.22.0",
- "babel-template": "^6.24.1",
- "babel-traverse": "^6.24.1",
- "babel-types": "^6.24.1"
- }
- },
- "babel-plugin-transform-es2015-shorthand-properties": {
- "version": "6.24.1",
- "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.24.1.tgz",
- "integrity": "sha1-JPh11nIch2YbvZmkYi5R8U3jiqA=",
- "dev": true,
- "requires": {
- "babel-runtime": "^6.22.0",
- "babel-types": "^6.24.1"
- }
- },
- "babel-plugin-transform-es2015-spread": {
- "version": "6.22.0",
- "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.22.0.tgz",
- "integrity": "sha1-1taKmfia7cRTbIGlQujdnxdG+NE=",
- "dev": true,
- "requires": {
- "babel-runtime": "^6.22.0"
- }
- },
- "babel-plugin-transform-es2015-sticky-regex": {
- "version": "6.24.1",
- "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.24.1.tgz",
- "integrity": "sha1-AMHNsaynERLN8M9hJsLta0V8zbw=",
- "dev": true,
- "requires": {
- "babel-helper-regex": "^6.24.1",
- "babel-runtime": "^6.22.0",
- "babel-types": "^6.24.1"
- }
- },
- "babel-plugin-transform-es2015-template-literals": {
- "version": "6.22.0",
- "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-6.22.0.tgz",
- "integrity": "sha1-qEs0UPfp+PH2g51taH2oS7EjbY0=",
- "dev": true,
- "requires": {
- "babel-runtime": "^6.22.0"
- }
- },
- "babel-plugin-transform-es2015-typeof-symbol": {
- "version": "6.23.0",
- "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.23.0.tgz",
- "integrity": "sha1-3sCfHN3/lLUqxz1QXITfWdzOs3I=",
- "dev": true,
- "requires": {
- "babel-runtime": "^6.22.0"
- }
- },
- "babel-plugin-transform-es2015-unicode-regex": {
- "version": "6.24.1",
- "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.24.1.tgz",
- "integrity": "sha1-04sS9C6nMj9yk4fxinxa4frrNek=",
- "dev": true,
- "requires": {
- "babel-helper-regex": "^6.24.1",
- "babel-runtime": "^6.22.0",
- "regexpu-core": "^2.0.0"
- }
- },
- "babel-plugin-transform-exponentiation-operator": {
- "version": "6.24.1",
- "resolved": "https://registry.npmjs.org/babel-plugin-transform-exponentiation-operator/-/babel-plugin-transform-exponentiation-operator-6.24.1.tgz",
- "integrity": "sha1-KrDJx/MJj6SJB3cruBP+QejeOg4=",
- "dev": true,
- "requires": {
- "babel-helper-builder-binary-assignment-operator-visitor": "^6.24.1",
- "babel-plugin-syntax-exponentiation-operator": "^6.8.0",
- "babel-runtime": "^6.22.0"
- }
- },
- "babel-plugin-transform-regenerator": {
- "version": "6.26.0",
- "resolved": "https://registry.npmjs.org/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.26.0.tgz",
- "integrity": "sha1-4HA2lvveJ/Cj78rPi03KL3s6jy8=",
- "dev": true,
- "requires": {
- "regenerator-transform": "^0.10.0"
- }
- },
- "babel-plugin-transform-strict-mode": {
- "version": "6.24.1",
- "resolved": "https://registry.npmjs.org/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.24.1.tgz",
- "integrity": "sha1-1fr3qleKZbvlkc9e2uBKDGcCB1g=",
- "dev": true,
- "requires": {
- "babel-runtime": "^6.22.0",
- "babel-types": "^6.24.1"
- }
- },
- "babel-polyfill": {
- "version": "6.26.0",
- "resolved": "https://registry.npmjs.org/babel-polyfill/-/babel-polyfill-6.26.0.tgz",
- "integrity": "sha1-N5k3q8Z9eJWXCtxiHyhM2WbPIVM=",
- "dev": true,
- "requires": {
- "babel-runtime": "^6.26.0",
- "core-js": "^2.5.0",
- "regenerator-runtime": "^0.10.5"
- },
- "dependencies": {
- "regenerator-runtime": {
- "version": "0.10.5",
- "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz",
- "integrity": "sha1-M2w+/BIgrc7dosn6tntaeVWjNlg=",
- "dev": true
- }
- }
- },
- "babel-preset-env": {
- "version": "1.7.0",
- "resolved": "https://registry.npmjs.org/babel-preset-env/-/babel-preset-env-1.7.0.tgz",
- "integrity": "sha512-9OR2afuKDneX2/q2EurSftUYM0xGu4O2D9adAhVfADDhrYDaxXV0rBbevVYoY9n6nyX1PmQW/0jtpJvUNr9CHg==",
- "dev": true,
- "requires": {
- "babel-plugin-check-es2015-constants": "^6.22.0",
- "babel-plugin-syntax-trailing-function-commas": "^6.22.0",
- "babel-plugin-transform-async-to-generator": "^6.22.0",
- "babel-plugin-transform-es2015-arrow-functions": "^6.22.0",
- "babel-plugin-transform-es2015-block-scoped-functions": "^6.22.0",
- "babel-plugin-transform-es2015-block-scoping": "^6.23.0",
- "babel-plugin-transform-es2015-classes": "^6.23.0",
- "babel-plugin-transform-es2015-computed-properties": "^6.22.0",
- "babel-plugin-transform-es2015-destructuring": "^6.23.0",
- "babel-plugin-transform-es2015-duplicate-keys": "^6.22.0",
- "babel-plugin-transform-es2015-for-of": "^6.23.0",
- "babel-plugin-transform-es2015-function-name": "^6.22.0",
- "babel-plugin-transform-es2015-literals": "^6.22.0",
- "babel-plugin-transform-es2015-modules-amd": "^6.22.0",
- "babel-plugin-transform-es2015-modules-commonjs": "^6.23.0",
- "babel-plugin-transform-es2015-modules-systemjs": "^6.23.0",
- "babel-plugin-transform-es2015-modules-umd": "^6.23.0",
- "babel-plugin-transform-es2015-object-super": "^6.22.0",
- "babel-plugin-transform-es2015-parameters": "^6.23.0",
- "babel-plugin-transform-es2015-shorthand-properties": "^6.22.0",
- "babel-plugin-transform-es2015-spread": "^6.22.0",
- "babel-plugin-transform-es2015-sticky-regex": "^6.22.0",
- "babel-plugin-transform-es2015-template-literals": "^6.22.0",
- "babel-plugin-transform-es2015-typeof-symbol": "^6.23.0",
- "babel-plugin-transform-es2015-unicode-regex": "^6.22.0",
- "babel-plugin-transform-exponentiation-operator": "^6.22.0",
- "babel-plugin-transform-regenerator": "^6.22.0",
- "browserslist": "^3.2.6",
- "invariant": "^2.2.2",
- "semver": "^5.3.0"
- }
- },
- "babel-register": {
- "version": "6.26.0",
- "resolved": "https://registry.npmjs.org/babel-register/-/babel-register-6.26.0.tgz",
- "integrity": "sha1-btAhFz4vy0htestFxgCahW9kcHE=",
- "dev": true,
- "requires": {
- "babel-core": "^6.26.0",
- "babel-runtime": "^6.26.0",
- "core-js": "^2.5.0",
- "home-or-tmp": "^2.0.0",
- "lodash": "^4.17.4",
+ "find-cache-dir": "^1.0.0",
+ "loader-utils": "^1.0.2",
"mkdirp": "^0.5.1",
- "source-map-support": "^0.4.15"
+ "util.promisify": "^1.0.0"
}
},
- "babel-runtime": {
- "version": "6.26.0",
- "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz",
- "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=",
+ "babel-plugin-react-intl": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/babel-plugin-react-intl/-/babel-plugin-react-intl-3.0.1.tgz",
+ "integrity": "sha512-FqnEO+Tq7kJVUPKsSG3s5jaHi3pAC4RUR11IrscvjsfkOApLP2DtzNo6dtQ+tX+OzEzJx7cUms8aCw5BFyW5xg==",
"dev": true,
"requires": {
- "core-js": "^2.4.0",
- "regenerator-runtime": "^0.11.0"
+ "@babel/runtime": "^7.0.0",
+ "intl-messageformat-parser": "^1.2.0",
+ "mkdirp": "^0.5.1"
}
},
- "babel-template": {
- "version": "6.26.0",
- "resolved": "https://registry.npmjs.org/babel-template/-/babel-template-6.26.0.tgz",
- "integrity": "sha1-3gPi0WOWsGn0bdn/+FIfsaDjXgI=",
- "dev": true,
- "requires": {
- "babel-runtime": "^6.26.0",
- "babel-traverse": "^6.26.0",
- "babel-types": "^6.26.0",
- "babylon": "^6.18.0",
- "lodash": "^4.17.4"
- }
- },
- "babel-traverse": {
- "version": "6.26.0",
- "resolved": "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.26.0.tgz",
- "integrity": "sha1-RqnL1+3MYsjlwGTi0tjQ9ANXZu4=",
- "dev": true,
- "requires": {
- "babel-code-frame": "^6.26.0",
- "babel-messages": "^6.23.0",
- "babel-runtime": "^6.26.0",
- "babel-types": "^6.26.0",
- "babylon": "^6.18.0",
- "debug": "^2.6.8",
- "globals": "^9.18.0",
- "invariant": "^2.2.2",
- "lodash": "^4.17.4"
- }
- },
- "babel-types": {
- "version": "6.26.0",
- "resolved": "https://registry.npmjs.org/babel-types/-/babel-types-6.26.0.tgz",
- "integrity": "sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc=",
- "dev": true,
- "requires": {
- "babel-runtime": "^6.26.0",
- "esutils": "^2.0.2",
- "lodash": "^4.17.4",
- "to-fast-properties": "^1.0.3"
- }
- },
- "babylon": {
- "version": "6.18.0",
- "resolved": "https://registry.npmjs.org/babylon/-/babylon-6.18.0.tgz",
- "integrity": "sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ==",
- "dev": true
- },
"balanced-match": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
@@ -959,27 +1620,38 @@
"is-data-descriptor": "^1.0.0",
"kind-of": "^6.0.2"
}
- },
- "isobject": {
- "version": "3.0.1",
- "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz",
- "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=",
- "dev": true
- },
- "kind-of": {
- "version": "6.0.2",
- "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz",
- "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==",
- "dev": true
}
}
},
+ "base64-js": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.0.tgz",
+ "integrity": "sha512-ccav/yGvoa80BQDljCxsmmQ3Xvx60/UpBIij5QN21W3wBi/hhIC9OoO+KLpu9IJTS9j4DRVJ3aDDF9cMSoa2lw==",
+ "dev": true
+ },
+ "big.js": {
+ "version": "3.2.0",
+ "resolved": "https://registry.npmjs.org/big.js/-/big.js-3.2.0.tgz",
+ "integrity": "sha512-+hN/Zh2D08Mx65pZ/4g5bsmNiZUuChDiQfTUQ7qJr4/kuopCr88xZsAXv6mBoZEsUI4OuGHlX59qE94K2mMW8Q==",
+ "dev": true
+ },
"binary-extensions": {
"version": "1.12.0",
"resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.12.0.tgz",
"integrity": "sha512-DYWGk01lDcxeS/K9IHPGWfT8PsJmbXRtRd2Sx72Tnb8pcYZQFF1oSDb8hJtS1vhp212q1Rzi5dUf9+nq0o9UIg==",
- "dev": true,
- "optional": true
+ "dev": true
+ },
+ "bluebird": {
+ "version": "3.5.2",
+ "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.2.tgz",
+ "integrity": "sha512-dhHTWMI7kMx5whMQntl7Vr9C6BvV10lFXDAasnqnrMYhXVCzzk6IO9Fo2L75jXHT07WrOngL1WDXOp+yYS91Yg==",
+ "dev": true
+ },
+ "bn.js": {
+ "version": "4.11.8",
+ "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz",
+ "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==",
+ "dev": true
},
"boolbase": {
"version": "1.0.0",
@@ -997,27 +1669,168 @@
}
},
"braces": {
- "version": "1.8.5",
- "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz",
- "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=",
+ "version": "2.3.2",
+ "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz",
+ "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==",
"dev": true,
- "optional": true,
"requires": {
- "expand-range": "^1.8.1",
- "preserve": "^0.2.0",
- "repeat-element": "^1.1.2"
+ "arr-flatten": "^1.1.0",
+ "array-unique": "^0.3.2",
+ "extend-shallow": "^2.0.1",
+ "fill-range": "^4.0.0",
+ "isobject": "^3.0.1",
+ "repeat-element": "^1.1.2",
+ "snapdragon": "^0.8.1",
+ "snapdragon-node": "^2.0.1",
+ "split-string": "^3.0.2",
+ "to-regex": "^3.0.1"
+ },
+ "dependencies": {
+ "extend-shallow": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
+ "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=",
+ "dev": true,
+ "requires": {
+ "is-extendable": "^0.1.0"
+ }
+ }
+ }
+ },
+ "brorand": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz",
+ "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=",
+ "dev": true
+ },
+ "browserify-aes": {
+ "version": "1.2.0",
+ "resolved": "http://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz",
+ "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==",
+ "dev": true,
+ "requires": {
+ "buffer-xor": "^1.0.3",
+ "cipher-base": "^1.0.0",
+ "create-hash": "^1.1.0",
+ "evp_bytestokey": "^1.0.3",
+ "inherits": "^2.0.1",
+ "safe-buffer": "^5.0.1"
+ }
+ },
+ "browserify-cipher": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.1.tgz",
+ "integrity": "sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==",
+ "dev": true,
+ "requires": {
+ "browserify-aes": "^1.0.4",
+ "browserify-des": "^1.0.0",
+ "evp_bytestokey": "^1.0.0"
+ }
+ },
+ "browserify-des": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.2.tgz",
+ "integrity": "sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A==",
+ "dev": true,
+ "requires": {
+ "cipher-base": "^1.0.1",
+ "des.js": "^1.0.0",
+ "inherits": "^2.0.1",
+ "safe-buffer": "^5.1.2"
+ }
+ },
+ "browserify-rsa": {
+ "version": "4.0.1",
+ "resolved": "http://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz",
+ "integrity": "sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ=",
+ "dev": true,
+ "requires": {
+ "bn.js": "^4.1.0",
+ "randombytes": "^2.0.1"
+ }
+ },
+ "browserify-sign": {
+ "version": "4.0.4",
+ "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.0.4.tgz",
+ "integrity": "sha1-qk62jl17ZYuqa/alfmMMvXqT0pg=",
+ "dev": true,
+ "requires": {
+ "bn.js": "^4.1.1",
+ "browserify-rsa": "^4.0.0",
+ "create-hash": "^1.1.0",
+ "create-hmac": "^1.1.2",
+ "elliptic": "^6.0.0",
+ "inherits": "^2.0.1",
+ "parse-asn1": "^5.0.0"
+ }
+ },
+ "browserify-zlib": {
+ "version": "0.2.0",
+ "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.2.0.tgz",
+ "integrity": "sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==",
+ "dev": true,
+ "requires": {
+ "pako": "~1.0.5"
}
},
"browserslist": {
- "version": "3.2.8",
- "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-3.2.8.tgz",
- "integrity": "sha512-WHVocJYavUwVgVViC0ORikPHQquXwVh939TaelZ4WDqpWgTX/FsGhl/+P4qBUAGcRvtOgDgC+xftNWWp2RUTAQ==",
+ "version": "4.3.3",
+ "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.3.3.tgz",
+ "integrity": "sha512-6h84UD1mmHeuQ9IucX6yzBc+KBYcBBTLYt2CXtY7GYCra6iE5kOm7oM+zuGw/0tjGtbJxjm58OvxSBmogEMCRQ==",
"dev": true,
"requires": {
- "caniuse-lite": "^1.0.30000844",
- "electron-to-chromium": "^1.3.47"
+ "caniuse-lite": "^1.0.30000898",
+ "electron-to-chromium": "^1.3.81",
+ "node-releases": "^1.0.0-alpha.15"
+ },
+ "dependencies": {
+ "caniuse-lite": {
+ "version": "1.0.30000899",
+ "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000899.tgz",
+ "integrity": "sha512-enC3zKfUCJxxwvUIsBkbHd54CtJw1KtIWvrK0JZxWD/fEN2knHaai45lndJ4xXAkyRAPyk60J3yagkKDWhfeMA==",
+ "dev": true
+ },
+ "node-releases": {
+ "version": "1.0.0-alpha.15",
+ "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.0.0-alpha.15.tgz",
+ "integrity": "sha512-hKG6hd/g6a9OV/ARt2qrxbRhe/4WEMFohTLOB9PNyTYvvI59gICZFzt9/mMgpYUTts06qXlN8H6UjfbIRdnW8A==",
+ "dev": true,
+ "requires": {
+ "semver": "^5.3.0"
+ }
+ }
}
},
+ "buffer": {
+ "version": "4.9.1",
+ "resolved": "http://registry.npmjs.org/buffer/-/buffer-4.9.1.tgz",
+ "integrity": "sha1-bRu2AbB6TvztlwlBMgkwJ8lbwpg=",
+ "dev": true,
+ "requires": {
+ "base64-js": "^1.0.2",
+ "ieee754": "^1.1.4",
+ "isarray": "^1.0.0"
+ }
+ },
+ "buffer-from": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz",
+ "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==",
+ "dev": true
+ },
+ "buffer-xor": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz",
+ "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=",
+ "dev": true
+ },
+ "builtin-status-codes": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz",
+ "integrity": "sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug=",
+ "dev": true
+ },
"bytebuffer": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/bytebuffer/-/bytebuffer-5.0.1.tgz",
@@ -1026,6 +1839,35 @@
"long": "~3"
}
},
+ "cacache": {
+ "version": "10.0.4",
+ "resolved": "https://registry.npmjs.org/cacache/-/cacache-10.0.4.tgz",
+ "integrity": "sha512-Dph0MzuH+rTQzGPNT9fAnrPmMmjKfST6trxJeK7NQuHRaVw24VzPRWTmg9MpcwOVQZO0E1FBICUlFeNaKPIfHA==",
+ "dev": true,
+ "requires": {
+ "bluebird": "^3.5.1",
+ "chownr": "^1.0.1",
+ "glob": "^7.1.2",
+ "graceful-fs": "^4.1.11",
+ "lru-cache": "^4.1.1",
+ "mississippi": "^2.0.0",
+ "mkdirp": "^0.5.1",
+ "move-concurrently": "^1.0.1",
+ "promise-inflight": "^1.0.1",
+ "rimraf": "^2.6.2",
+ "ssri": "^5.2.4",
+ "unique-filename": "^1.1.0",
+ "y18n": "^4.0.0"
+ },
+ "dependencies": {
+ "y18n": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz",
+ "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==",
+ "dev": true
+ }
+ }
+ },
"cache-base": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz",
@@ -1041,14 +1883,6 @@
"to-object-path": "^0.3.0",
"union-value": "^1.0.0",
"unset-value": "^1.0.0"
- },
- "dependencies": {
- "isobject": {
- "version": "3.0.1",
- "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz",
- "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=",
- "dev": true
- }
}
},
"camelcase": {
@@ -1102,34 +1936,60 @@
"dev": true
},
"chalk": {
- "version": "1.1.3",
- "resolved": "http://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
- "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=",
+ "version": "2.4.1",
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz",
+ "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==",
"dev": true,
"requires": {
- "ansi-styles": "^2.2.1",
- "escape-string-regexp": "^1.0.2",
- "has-ansi": "^2.0.0",
- "strip-ansi": "^3.0.0",
- "supports-color": "^2.0.0"
+ "ansi-styles": "^3.2.1",
+ "escape-string-regexp": "^1.0.5",
+ "supports-color": "^5.3.0"
}
},
"chokidar": {
- "version": "1.7.0",
- "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-1.7.0.tgz",
- "integrity": "sha1-eY5ol3gVHIB2tLNg5e3SjNortGg=",
+ "version": "2.0.4",
+ "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.0.4.tgz",
+ "integrity": "sha512-z9n7yt9rOvIJrMhvDtDictKrkFHeihkNl6uWMmZlmL6tJtX9Cs+87oK+teBx+JIgzvbX3yZHT3eF8vpbDxHJXQ==",
"dev": true,
- "optional": true,
"requires": {
- "anymatch": "^1.3.0",
+ "anymatch": "^2.0.0",
"async-each": "^1.0.0",
- "fsevents": "^1.0.0",
- "glob-parent": "^2.0.0",
+ "braces": "^2.3.0",
+ "fsevents": "^1.2.2",
+ "glob-parent": "^3.1.0",
"inherits": "^2.0.1",
"is-binary-path": "^1.0.0",
- "is-glob": "^2.0.0",
+ "is-glob": "^4.0.0",
+ "lodash.debounce": "^4.0.8",
+ "normalize-path": "^2.1.1",
"path-is-absolute": "^1.0.0",
- "readdirp": "^2.0.0"
+ "readdirp": "^2.0.0",
+ "upath": "^1.0.5"
+ }
+ },
+ "chownr": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.1.tgz",
+ "integrity": "sha512-j38EvO5+LHX84jlo6h4UzmOwi0UgW61WRyPtJz4qaadK5eY3BTS5TY/S1Stc3Uk2lIM6TPevAlULiEJwie860g==",
+ "dev": true
+ },
+ "chrome-trace-event": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.0.tgz",
+ "integrity": "sha512-xDbVgyfDTT2piup/h8dK/y4QZfJRSa73bw1WZ8b4XM1o7fsFubUVGYcE+1ANtOzJJELGpYoG2961z0Z6OAld9A==",
+ "dev": true,
+ "requires": {
+ "tslib": "^1.9.0"
+ }
+ },
+ "cipher-base": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz",
+ "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==",
+ "dev": true,
+ "requires": {
+ "inherits": "^2.0.1",
+ "safe-buffer": "^5.0.1"
}
},
"class-utils": {
@@ -1152,12 +2012,6 @@
"requires": {
"is-descriptor": "^0.1.0"
}
- },
- "isobject": {
- "version": "3.0.1",
- "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz",
- "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=",
- "dev": true
}
}
},
@@ -1242,9 +2096,15 @@
"integrity": "sha1-nLFpkX7F0SwHNtPoaFdG3xyt93g="
},
"commander": {
- "version": "2.19.0",
- "resolved": "https://registry.npmjs.org/commander/-/commander-2.19.0.tgz",
- "integrity": "sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg==",
+ "version": "2.13.0",
+ "resolved": "https://registry.npmjs.org/commander/-/commander-2.13.0.tgz",
+ "integrity": "sha512-MVuS359B+YzaWqjCL/c+22gfryv+mCBPHAv3zyVI2GN8EY6IRP8VwtasXn8jyyhvvq84R4ImN1OKRtcbIasjYA==",
+ "dev": true
+ },
+ "commondir": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz",
+ "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=",
"dev": true
},
"component-emitter": {
@@ -1258,13 +2118,51 @@
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s="
},
- "convert-source-map": {
- "version": "1.6.0",
- "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.6.0.tgz",
- "integrity": "sha512-eFu7XigvxdZ1ETfbgPBohgyQ/Z++C0eEhTor0qRwBw9unw+L0/6V8wkSuGgzdThkiS5lSpdptOQPD8Ak40a+7A==",
+ "concat-stream": {
+ "version": "1.6.2",
+ "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz",
+ "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==",
"dev": true,
"requires": {
- "safe-buffer": "~5.1.1"
+ "buffer-from": "^1.0.0",
+ "inherits": "^2.0.3",
+ "readable-stream": "^2.2.2",
+ "typedarray": "^0.0.6"
+ }
+ },
+ "console-browserify": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.1.0.tgz",
+ "integrity": "sha1-8CQcRXMKn8YyOyBtvzjtx0HQuxA=",
+ "dev": true,
+ "requires": {
+ "date-now": "^0.1.4"
+ }
+ },
+ "constants-browserify": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz",
+ "integrity": "sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U=",
+ "dev": true
+ },
+ "convert-source-map": {
+ "version": "1.5.1",
+ "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.5.1.tgz",
+ "integrity": "sha1-uCeAl7m8IpNl3lxiz1/K7YtVmeU=",
+ "dev": true
+ },
+ "copy-concurrently": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/copy-concurrently/-/copy-concurrently-1.0.5.tgz",
+ "integrity": "sha512-f2domd9fsVDFtaFcbaRZuYXwtdmnzqbADSwhSWYxYB/Q8zsdUUFMXVRwXGDMWmbEzAn1kdRrtI1T/KTFOL4X2A==",
+ "dev": true,
+ "requires": {
+ "aproba": "^1.1.1",
+ "fs-write-stream-atomic": "^1.0.8",
+ "iferr": "^0.1.5",
+ "mkdirp": "^0.5.1",
+ "rimraf": "^2.5.4",
+ "run-queue": "^1.0.0"
}
},
"copy-descriptor": {
@@ -1273,18 +2171,80 @@
"integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=",
"dev": true
},
- "core-js": {
- "version": "2.5.7",
- "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.7.tgz",
- "integrity": "sha512-RszJCAxg/PP6uzXVXL6BsxSXx/B05oJAQ2vkJRjyjrEcNVycaqOmNb5OTxZPE3xa5gwZduqza6L9JOCenh/Ecw==",
- "dev": true
- },
"core-util-is": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
"integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=",
+ "dev": true
+ },
+ "create-ecdh": {
+ "version": "4.0.3",
+ "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.3.tgz",
+ "integrity": "sha512-GbEHQPMOswGpKXM9kCWVrremUcBmjteUaQ01T9rkKCPDXfUHX0IoP9LpHYo2NPFampa4e+/pFDc3jQdxrxQLaw==",
"dev": true,
- "optional": true
+ "requires": {
+ "bn.js": "^4.1.0",
+ "elliptic": "^6.0.0"
+ }
+ },
+ "create-hash": {
+ "version": "1.2.0",
+ "resolved": "http://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz",
+ "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==",
+ "dev": true,
+ "requires": {
+ "cipher-base": "^1.0.1",
+ "inherits": "^2.0.1",
+ "md5.js": "^1.3.4",
+ "ripemd160": "^2.0.1",
+ "sha.js": "^2.4.0"
+ }
+ },
+ "create-hmac": {
+ "version": "1.1.7",
+ "resolved": "http://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz",
+ "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==",
+ "dev": true,
+ "requires": {
+ "cipher-base": "^1.0.3",
+ "create-hash": "^1.1.0",
+ "inherits": "^2.0.1",
+ "ripemd160": "^2.0.0",
+ "safe-buffer": "^5.0.1",
+ "sha.js": "^2.4.8"
+ }
+ },
+ "cross-spawn": {
+ "version": "6.0.5",
+ "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz",
+ "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==",
+ "dev": true,
+ "requires": {
+ "nice-try": "^1.0.4",
+ "path-key": "^2.0.1",
+ "semver": "^5.5.0",
+ "shebang-command": "^1.2.0",
+ "which": "^1.2.9"
+ }
+ },
+ "crypto-browserify": {
+ "version": "3.12.0",
+ "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz",
+ "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==",
+ "dev": true,
+ "requires": {
+ "browserify-cipher": "^1.0.0",
+ "browserify-sign": "^4.0.0",
+ "create-ecdh": "^4.0.0",
+ "create-hash": "^1.1.0",
+ "create-hmac": "^1.1.0",
+ "diffie-hellman": "^5.0.0",
+ "inherits": "^2.0.1",
+ "pbkdf2": "^3.0.3",
+ "public-encrypt": "^4.0.0",
+ "randombytes": "^2.0.0",
+ "randomfill": "^1.0.3"
+ }
},
"css-color-names": {
"version": "0.0.4",
@@ -1649,6 +2609,18 @@
}
}
},
+ "cyclist": {
+ "version": "0.2.2",
+ "resolved": "https://registry.npmjs.org/cyclist/-/cyclist-0.2.2.tgz",
+ "integrity": "sha1-GzN5LhHpFKL9bW7WRHRkRE5fpkA=",
+ "dev": true
+ },
+ "date-now": {
+ "version": "0.1.4",
+ "resolved": "https://registry.npmjs.org/date-now/-/date-now-0.1.4.tgz",
+ "integrity": "sha1-6vQ5/U1ISK105cx9vvIAZyueNFs=",
+ "dev": true
+ },
"debug": {
"version": "2.6.9",
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
@@ -1717,28 +2689,28 @@
"is-data-descriptor": "^1.0.0",
"kind-of": "^6.0.2"
}
- },
- "isobject": {
- "version": "3.0.1",
- "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz",
- "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=",
- "dev": true
- },
- "kind-of": {
- "version": "6.0.2",
- "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz",
- "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==",
- "dev": true
}
}
},
- "detect-indent": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-4.0.0.tgz",
- "integrity": "sha1-920GQ1LN9Docts5hnE7jqUdd4gg=",
+ "des.js": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.0.tgz",
+ "integrity": "sha1-wHTS4qpqipoH29YfmhXCzYPsjsw=",
"dev": true,
"requires": {
- "repeating": "^2.0.0"
+ "inherits": "^2.0.1",
+ "minimalistic-assert": "^1.0.0"
+ }
+ },
+ "diffie-hellman": {
+ "version": "5.0.3",
+ "resolved": "http://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz",
+ "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==",
+ "dev": true,
+ "requires": {
+ "bn.js": "^4.1.0",
+ "miller-rabin": "^4.0.0",
+ "randombytes": "^2.0.0"
}
},
"dom-serializer": {
@@ -1764,6 +2736,12 @@
"resolved": "https://registry.npmjs.org/dom-storage/-/dom-storage-2.1.0.tgz",
"integrity": "sha512-g6RpyWXzl0RR6OTElHKBl7nwnK87GUyZMYC7JWsB/IA73vpqK2K6LT39x4VepLxlSsWBFrPVLnsSR5Jyty0+2Q=="
},
+ "domain-browser": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz",
+ "integrity": "sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA==",
+ "dev": true
+ },
"domelementtype": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.0.tgz",
@@ -1789,12 +2767,45 @@
"is-obj": "^1.0.0"
}
},
+ "duplexify": {
+ "version": "3.6.1",
+ "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.6.1.tgz",
+ "integrity": "sha512-vM58DwdnKmty+FSPzT14K9JXb90H+j5emaR4KYbr2KTIz00WHGbWOe5ghQTx233ZCLZtrGDALzKwcjEtSt35mA==",
+ "dev": true,
+ "requires": {
+ "end-of-stream": "^1.0.0",
+ "inherits": "^2.0.1",
+ "readable-stream": "^2.0.0",
+ "stream-shift": "^1.0.0"
+ }
+ },
"electron-to-chromium": {
"version": "1.3.82",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.82.tgz",
"integrity": "sha512-NI4nB2IWGcU4JVT1AE8kBb/dFor4zjLHMLsOROPahppeHrR0FG5uslxMmkp/thO1MvPjM2xhlKoY29/I60s0ew==",
"dev": true
},
+ "elliptic": {
+ "version": "6.4.1",
+ "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.4.1.tgz",
+ "integrity": "sha512-BsXLz5sqX8OHcsh7CqBMztyXARmGQ3LWPtGjJi6DiJHq5C/qvi9P3OqgswKSDftbu8+IoI/QDTAm2fFnQ9SZSQ==",
+ "dev": true,
+ "requires": {
+ "bn.js": "^4.4.0",
+ "brorand": "^1.0.1",
+ "hash.js": "^1.0.0",
+ "hmac-drbg": "^1.0.0",
+ "inherits": "^2.0.1",
+ "minimalistic-assert": "^1.0.0",
+ "minimalistic-crypto-utils": "^1.0.0"
+ }
+ },
+ "emojis-list": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-2.1.0.tgz",
+ "integrity": "sha1-TapNnbAPmBmIDHn6RXrlsJof04k=",
+ "dev": true
+ },
"encoding": {
"version": "0.1.12",
"resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.12.tgz",
@@ -1803,12 +2814,41 @@
"iconv-lite": "~0.4.13"
}
},
+ "end-of-stream": {
+ "version": "1.4.1",
+ "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz",
+ "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==",
+ "dev": true,
+ "requires": {
+ "once": "^1.4.0"
+ }
+ },
+ "enhanced-resolve": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-4.1.0.tgz",
+ "integrity": "sha512-F/7vkyTtyc/llOIn8oWclcB25KdRaiPBpZYDgJHgh/UHtpgT2p2eldQgtQnLtUvfMKPKxbRaQM/hHkvLHt1Vng==",
+ "dev": true,
+ "requires": {
+ "graceful-fs": "^4.1.2",
+ "memory-fs": "^0.4.0",
+ "tapable": "^1.0.0"
+ }
+ },
"entities": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/entities/-/entities-1.1.1.tgz",
"integrity": "sha1-blwtClYhtdra7O+AuQ7ftc13cvA=",
"dev": true
},
+ "errno": {
+ "version": "0.1.7",
+ "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.7.tgz",
+ "integrity": "sha512-MfrRBDWzIWifgq6tJj60gkAwtLNb6sQPlcFrSOflcP1aFmmruKQ2wRnze/8V6kgyz7H3FF8Npzv78mZ7XLLflg==",
+ "dev": true,
+ "requires": {
+ "prr": "~1.0.1"
+ }
+ },
"error-ex": {
"version": "1.3.2",
"resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz",
@@ -1848,36 +2888,107 @@
"integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=",
"dev": true
},
+ "eslint-scope": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.0.tgz",
+ "integrity": "sha512-1G6UTDi7Jc1ELFwnR58HV4fK9OQK4S6N985f166xqXxpjU6plxFISJa2Ba9KCQuFa8RCnj/lSFJbHo7UFDBnUA==",
+ "dev": true,
+ "requires": {
+ "esrecurse": "^4.1.0",
+ "estraverse": "^4.1.1"
+ }
+ },
"esprima": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz",
"integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==",
"dev": true
},
+ "esrecurse": {
+ "version": "4.2.1",
+ "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz",
+ "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==",
+ "dev": true,
+ "requires": {
+ "estraverse": "^4.1.0"
+ }
+ },
+ "estraverse": {
+ "version": "4.2.0",
+ "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz",
+ "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=",
+ "dev": true
+ },
"esutils": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz",
"integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=",
"dev": true
},
- "expand-brackets": {
- "version": "0.1.5",
- "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz",
- "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=",
+ "events": {
+ "version": "1.1.1",
+ "resolved": "http://registry.npmjs.org/events/-/events-1.1.1.tgz",
+ "integrity": "sha1-nr23Y1rQmccNzEwqH1AEKI6L2SQ=",
+ "dev": true
+ },
+ "evp_bytestokey": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz",
+ "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==",
"dev": true,
- "optional": true,
"requires": {
- "is-posix-bracket": "^0.1.0"
+ "md5.js": "^1.3.4",
+ "safe-buffer": "^5.1.1"
}
},
- "expand-range": {
- "version": "1.8.2",
- "resolved": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz",
- "integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=",
+ "execa": {
+ "version": "0.10.0",
+ "resolved": "https://registry.npmjs.org/execa/-/execa-0.10.0.tgz",
+ "integrity": "sha512-7XOMnz8Ynx1gGo/3hyV9loYNPWM94jG3+3T3Y8tsfSstFmETmENCMU/A/zj8Lyaj1lkgEepKepvd6240tBRvlw==",
"dev": true,
- "optional": true,
"requires": {
- "fill-range": "^2.1.0"
+ "cross-spawn": "^6.0.0",
+ "get-stream": "^3.0.0",
+ "is-stream": "^1.1.0",
+ "npm-run-path": "^2.0.0",
+ "p-finally": "^1.0.0",
+ "signal-exit": "^3.0.0",
+ "strip-eof": "^1.0.0"
+ }
+ },
+ "expand-brackets": {
+ "version": "2.1.4",
+ "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz",
+ "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=",
+ "dev": true,
+ "requires": {
+ "debug": "^2.3.3",
+ "define-property": "^0.2.5",
+ "extend-shallow": "^2.0.1",
+ "posix-character-classes": "^0.1.0",
+ "regex-not": "^1.0.0",
+ "snapdragon": "^0.8.1",
+ "to-regex": "^3.0.1"
+ },
+ "dependencies": {
+ "define-property": {
+ "version": "0.2.5",
+ "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz",
+ "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=",
+ "dev": true,
+ "requires": {
+ "is-descriptor": "^0.1.0"
+ }
+ },
+ "extend-shallow": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
+ "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=",
+ "dev": true,
+ "requires": {
+ "is-extendable": "^0.1.0"
+ }
+ }
}
},
"extend-shallow": {
@@ -1902,15 +3013,82 @@
}
},
"extglob": {
- "version": "0.3.2",
- "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz",
- "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=",
+ "version": "2.0.4",
+ "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz",
+ "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==",
"dev": true,
- "optional": true,
"requires": {
- "is-extglob": "^1.0.0"
+ "array-unique": "^0.3.2",
+ "define-property": "^1.0.0",
+ "expand-brackets": "^2.1.4",
+ "extend-shallow": "^2.0.1",
+ "fragment-cache": "^0.2.1",
+ "regex-not": "^1.0.0",
+ "snapdragon": "^0.8.1",
+ "to-regex": "^3.0.1"
+ },
+ "dependencies": {
+ "define-property": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz",
+ "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=",
+ "dev": true,
+ "requires": {
+ "is-descriptor": "^1.0.0"
+ }
+ },
+ "extend-shallow": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
+ "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=",
+ "dev": true,
+ "requires": {
+ "is-extendable": "^0.1.0"
+ }
+ },
+ "is-accessor-descriptor": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz",
+ "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==",
+ "dev": true,
+ "requires": {
+ "kind-of": "^6.0.0"
+ }
+ },
+ "is-data-descriptor": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz",
+ "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==",
+ "dev": true,
+ "requires": {
+ "kind-of": "^6.0.0"
+ }
+ },
+ "is-descriptor": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz",
+ "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==",
+ "dev": true,
+ "requires": {
+ "is-accessor-descriptor": "^1.0.0",
+ "is-data-descriptor": "^1.0.0",
+ "kind-of": "^6.0.2"
+ }
+ }
}
},
+ "fast-deep-equal": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz",
+ "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=",
+ "dev": true
+ },
+ "fast-json-stable-stringify": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz",
+ "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=",
+ "dev": true
+ },
"faye-websocket": {
"version": "0.11.1",
"resolved": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.11.1.tgz",
@@ -1919,25 +3097,47 @@
"websocket-driver": ">=0.5.1"
}
},
- "filename-regex": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.1.tgz",
- "integrity": "sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY=",
- "dev": true,
- "optional": true
- },
"fill-range": {
- "version": "2.2.4",
- "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.4.tgz",
- "integrity": "sha512-cnrcCbj01+j2gTG921VZPnHbjmdAf8oQV/iGeV2kZxGSyfYjjTyY79ErsK1WJWMpw6DaApEX72binqJE+/d+5Q==",
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz",
+ "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=",
"dev": true,
- "optional": true,
"requires": {
- "is-number": "^2.1.0",
- "isobject": "^2.0.0",
- "randomatic": "^3.0.0",
- "repeat-element": "^1.1.2",
- "repeat-string": "^1.5.2"
+ "extend-shallow": "^2.0.1",
+ "is-number": "^3.0.0",
+ "repeat-string": "^1.6.1",
+ "to-regex-range": "^2.1.0"
+ },
+ "dependencies": {
+ "extend-shallow": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
+ "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=",
+ "dev": true,
+ "requires": {
+ "is-extendable": "^0.1.0"
+ }
+ }
+ }
+ },
+ "find-cache-dir": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-1.0.0.tgz",
+ "integrity": "sha1-kojj6ePMN0hxfTnq3hfPcfww7m8=",
+ "dev": true,
+ "requires": {
+ "commondir": "^1.0.1",
+ "make-dir": "^1.0.0",
+ "pkg-dir": "^2.0.0"
+ }
+ },
+ "find-up": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz",
+ "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=",
+ "dev": true,
+ "requires": {
+ "locate-path": "^2.0.0"
}
},
"firebase": {
@@ -1961,22 +3161,22 @@
"integrity": "sha1-2uRqnXj74lKSJYzB54CkHZXAN4I=",
"dev": true
},
+ "flush-write-stream": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.0.3.tgz",
+ "integrity": "sha512-calZMC10u0FMUqoiunI2AiGIIUtUIvifNwkHhNupZH4cbNnW1Itkoh/Nf5HFYmDrwWPjrUxpkZT0KhuCq0jmGw==",
+ "dev": true,
+ "requires": {
+ "inherits": "^2.0.1",
+ "readable-stream": "^2.0.4"
+ }
+ },
"for-in": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz",
"integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=",
"dev": true
},
- "for-own": {
- "version": "0.1.5",
- "resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz",
- "integrity": "sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4=",
- "dev": true,
- "optional": true,
- "requires": {
- "for-in": "^1.0.1"
- }
- },
"foreach": {
"version": "2.0.5",
"resolved": "https://registry.npmjs.org/foreach/-/foreach-2.0.5.tgz",
@@ -1992,11 +3192,27 @@
"map-cache": "^0.2.2"
}
},
- "fs-readdir-recursive": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/fs-readdir-recursive/-/fs-readdir-recursive-1.1.0.tgz",
- "integrity": "sha512-GNanXlVr2pf02+sPN40XN8HG+ePaNcvM0q5mZBd668Obwb0yD5GiUbZOFgwn8kGMY6I3mdyDJzieUy3PTYyTRA==",
- "dev": true
+ "from2": {
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz",
+ "integrity": "sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8=",
+ "dev": true,
+ "requires": {
+ "inherits": "^2.0.1",
+ "readable-stream": "^2.0.0"
+ }
+ },
+ "fs-write-stream-atomic": {
+ "version": "1.0.10",
+ "resolved": "https://registry.npmjs.org/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.10.tgz",
+ "integrity": "sha1-tH31NJPvkR33VzHnCp3tAYnbQMk=",
+ "dev": true,
+ "requires": {
+ "graceful-fs": "^4.1.2",
+ "iferr": "^0.1.5",
+ "imurmurhash": "^0.1.4",
+ "readable-stream": "1 || 2"
+ }
},
"fs.realpath": {
"version": "1.0.0",
@@ -2538,6 +3754,18 @@
"integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==",
"dev": true
},
+ "get-caller-file": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz",
+ "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==",
+ "dev": true
+ },
+ "get-stream": {
+ "version": "3.0.0",
+ "resolved": "http://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz",
+ "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=",
+ "dev": true
+ },
"get-value": {
"version": "2.0.6",
"resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz",
@@ -2557,30 +3785,31 @@
"path-is-absolute": "^1.0.0"
}
},
- "glob-base": {
- "version": "0.3.0",
- "resolved": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz",
- "integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=",
- "dev": true,
- "optional": true,
- "requires": {
- "glob-parent": "^2.0.0",
- "is-glob": "^2.0.0"
- }
- },
"glob-parent": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz",
- "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=",
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz",
+ "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=",
"dev": true,
"requires": {
- "is-glob": "^2.0.0"
+ "is-glob": "^3.1.0",
+ "path-dirname": "^1.0.0"
+ },
+ "dependencies": {
+ "is-glob": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz",
+ "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=",
+ "dev": true,
+ "requires": {
+ "is-extglob": "^2.1.0"
+ }
+ }
}
},
- "globals": {
- "version": "9.18.0",
- "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz",
- "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==",
+ "global-modules-path": {
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/global-modules-path/-/global-modules-path-2.3.0.tgz",
+ "integrity": "sha512-HchvMJNYh9dGSCy8pOQ2O8u/hoXaL+0XhnrwH0RyLiSXMMTl9W3N6KUU73+JFOg5PGjtzl6VZzUQsnrpm7Szag==",
"dev": true
},
"graceful-fs": {
@@ -2602,23 +3831,19 @@
"dependencies": {
"abbrev": {
"version": "1.1.1",
- "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz",
- "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q=="
+ "bundled": true
},
"ansi-regex": {
"version": "2.1.1",
- "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
- "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8="
+ "bundled": true
},
"aproba": {
"version": "1.2.0",
- "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz",
- "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw=="
+ "bundled": true
},
"are-we-there-yet": {
"version": "1.1.5",
- "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz",
- "integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==",
+ "bundled": true,
"requires": {
"delegates": "^1.0.0",
"readable-stream": "^2.0.6"
@@ -2626,13 +3851,11 @@
},
"balanced-match": {
"version": "1.0.0",
- "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
- "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c="
+ "bundled": true
},
"brace-expansion": {
"version": "1.1.11",
- "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
- "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
+ "bundled": true,
"requires": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
@@ -2640,69 +3863,57 @@
},
"chownr": {
"version": "1.0.1",
- "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.0.1.tgz",
- "integrity": "sha1-4qdQQqlVGQi+vSW4Uj1fl2nXkYE="
+ "bundled": true
},
"code-point-at": {
"version": "1.1.0",
- "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz",
- "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c="
+ "bundled": true
},
"concat-map": {
"version": "0.0.1",
- "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
- "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s="
+ "bundled": true
},
"console-control-strings": {
"version": "1.1.0",
- "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz",
- "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4="
+ "bundled": true
},
"core-util-is": {
"version": "1.0.2",
- "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
- "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac="
+ "bundled": true
},
"debug": {
"version": "2.6.9",
- "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
- "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
+ "bundled": true,
"requires": {
"ms": "2.0.0"
}
},
"deep-extend": {
"version": "0.6.0",
- "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz",
- "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA=="
+ "bundled": true
},
"delegates": {
"version": "1.0.0",
- "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz",
- "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o="
+ "bundled": true
},
"detect-libc": {
"version": "1.0.3",
- "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz",
- "integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups="
+ "bundled": true
},
"fs-minipass": {
"version": "1.2.5",
- "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.5.tgz",
- "integrity": "sha512-JhBl0skXjUPCFH7x6x61gQxrKyXsxB5gcgePLZCwfyCGGsTISMoIeObbrvVeP6Xmyaudw4TT43qV2Gz+iyd2oQ==",
+ "bundled": true,
"requires": {
"minipass": "^2.2.1"
}
},
"fs.realpath": {
"version": "1.0.0",
- "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
- "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8="
+ "bundled": true
},
"gauge": {
"version": "2.7.4",
- "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz",
- "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=",
+ "bundled": true,
"requires": {
"aproba": "^1.0.3",
"console-control-strings": "^1.0.0",
@@ -2716,8 +3927,7 @@
},
"glob": {
"version": "7.1.2",
- "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz",
- "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==",
+ "bundled": true,
"requires": {
"fs.realpath": "^1.0.0",
"inflight": "^1.0.4",
@@ -2729,29 +3939,25 @@
},
"has-unicode": {
"version": "2.0.1",
- "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz",
- "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk="
+ "bundled": true
},
"iconv-lite": {
"version": "0.4.23",
- "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.23.tgz",
- "integrity": "sha512-neyTUVFtahjf0mB3dZT77u+8O0QB89jFdnBkd5P1JgYPbPaia3gXXOVL2fq8VyU2gMMD7SaN7QukTB/pmXYvDA==",
+ "bundled": true,
"requires": {
"safer-buffer": ">= 2.1.2 < 3"
}
},
"ignore-walk": {
"version": "3.0.1",
- "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.1.tgz",
- "integrity": "sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ==",
+ "bundled": true,
"requires": {
"minimatch": "^3.0.4"
}
},
"inflight": {
"version": "1.0.6",
- "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
- "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
+ "bundled": true,
"requires": {
"once": "^1.3.0",
"wrappy": "1"
@@ -2759,44 +3965,37 @@
},
"inherits": {
"version": "2.0.3",
- "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
- "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4="
+ "bundled": true
},
"ini": {
"version": "1.3.5",
- "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz",
- "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw=="
+ "bundled": true
},
"is-fullwidth-code-point": {
"version": "1.0.0",
- "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz",
- "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=",
+ "bundled": true,
"requires": {
"number-is-nan": "^1.0.0"
}
},
"isarray": {
"version": "1.0.0",
- "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
- "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE="
+ "bundled": true
},
"minimatch": {
"version": "3.0.4",
- "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
- "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
+ "bundled": true,
"requires": {
"brace-expansion": "^1.1.7"
}
},
"minimist": {
"version": "1.2.0",
- "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
- "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ="
+ "bundled": true
},
"minipass": {
"version": "2.3.3",
- "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.3.3.tgz",
- "integrity": "sha512-/jAn9/tEX4gnpyRATxgHEOV6xbcyxgT7iUnxo9Y3+OB0zX00TgKIv/2FZCf5brBbICcwbLqVv2ImjvWWrQMSYw==",
+ "bundled": true,
"requires": {
"safe-buffer": "^5.1.2",
"yallist": "^3.0.0"
@@ -2804,36 +4003,31 @@
},
"minizlib": {
"version": "1.1.0",
- "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.1.0.tgz",
- "integrity": "sha512-4T6Ur/GctZ27nHfpt9THOdRZNgyJ9FZchYO1ceg5S8Q3DNLCKYy44nCZzgCJgcvx2UM8czmqak5BCxJMrq37lA==",
+ "bundled": true,
"requires": {
"minipass": "^2.2.1"
}
},
"mkdirp": {
"version": "0.5.1",
- "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz",
- "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=",
+ "bundled": true,
"requires": {
"minimist": "0.0.8"
},
"dependencies": {
"minimist": {
"version": "0.0.8",
- "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz",
- "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0="
+ "bundled": true
}
}
},
"ms": {
"version": "2.0.0",
- "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
- "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
+ "bundled": true
},
"needle": {
"version": "2.2.1",
- "resolved": "https://registry.npmjs.org/needle/-/needle-2.2.1.tgz",
- "integrity": "sha512-t/ZswCM9JTWjAdXS9VpvqhI2Ct2sL2MdY4fUXqGJaGBk13ge99ObqRksRTbBE56K+wxUXwwfZYOuZHifFW9q+Q==",
+ "bundled": true,
"requires": {
"debug": "^2.1.2",
"iconv-lite": "^0.4.4",
@@ -2842,8 +4036,7 @@
},
"node-pre-gyp": {
"version": "0.10.3",
- "resolved": "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.10.3.tgz",
- "integrity": "sha512-d1xFs+C/IPS8Id0qPTZ4bUT8wWryfR/OzzAFxweG+uLN85oPzyo2Iw6bVlLQ/JOdgNonXLCoRyqDzDWq4iw72A==",
+ "bundled": true,
"requires": {
"detect-libc": "^1.0.2",
"mkdirp": "^0.5.1",
@@ -2859,8 +4052,7 @@
},
"nopt": {
"version": "4.0.1",
- "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.1.tgz",
- "integrity": "sha1-0NRoWv1UFRk8jHUFYC0NF81kR00=",
+ "bundled": true,
"requires": {
"abbrev": "1",
"osenv": "^0.1.4"
@@ -2868,13 +4060,11 @@
},
"npm-bundled": {
"version": "1.0.3",
- "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.0.3.tgz",
- "integrity": "sha512-ByQ3oJ/5ETLyglU2+8dBObvhfWXX8dtPZDMePCahptliFX2iIuhyEszyFk401PZUNQH20vvdW5MLjJxkwU80Ow=="
+ "bundled": true
},
"npm-packlist": {
"version": "1.1.11",
- "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.1.11.tgz",
- "integrity": "sha512-CxKlZ24urLkJk+9kCm48RTQ7L4hsmgSVzEk0TLGPzzyuFxD7VNgy5Sl24tOLMzQv773a/NeJ1ce1DKeacqffEA==",
+ "bundled": true,
"requires": {
"ignore-walk": "^3.0.1",
"npm-bundled": "^1.0.1"
@@ -2882,8 +4072,7 @@
},
"npmlog": {
"version": "4.1.2",
- "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz",
- "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==",
+ "bundled": true,
"requires": {
"are-we-there-yet": "~1.1.2",
"console-control-strings": "~1.1.0",
@@ -2893,36 +4082,30 @@
},
"number-is-nan": {
"version": "1.0.1",
- "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz",
- "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0="
+ "bundled": true
},
"object-assign": {
"version": "4.1.1",
- "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
- "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM="
+ "bundled": true
},
"once": {
"version": "1.4.0",
- "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
- "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
+ "bundled": true,
"requires": {
"wrappy": "1"
}
},
"os-homedir": {
"version": "1.0.2",
- "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz",
- "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M="
+ "bundled": true
},
"os-tmpdir": {
"version": "1.0.2",
- "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz",
- "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ="
+ "bundled": true
},
"osenv": {
"version": "0.1.5",
- "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz",
- "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==",
+ "bundled": true,
"requires": {
"os-homedir": "^1.0.0",
"os-tmpdir": "^1.0.0"
@@ -2930,18 +4113,15 @@
},
"path-is-absolute": {
"version": "1.0.1",
- "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
- "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18="
+ "bundled": true
},
"process-nextick-args": {
"version": "2.0.0",
- "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz",
- "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw=="
+ "bundled": true
},
"rc": {
"version": "1.2.8",
- "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz",
- "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==",
+ "bundled": true,
"requires": {
"deep-extend": "^0.6.0",
"ini": "~1.3.0",
@@ -2951,8 +4131,7 @@
},
"readable-stream": {
"version": "2.3.6",
- "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",
- "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==",
+ "bundled": true,
"requires": {
"core-util-is": "~1.0.0",
"inherits": "~2.0.3",
@@ -2965,46 +4144,38 @@
},
"rimraf": {
"version": "2.6.2",
- "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz",
- "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==",
+ "bundled": true,
"requires": {
"glob": "^7.0.5"
}
},
"safe-buffer": {
"version": "5.1.2",
- "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
- "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
+ "bundled": true
},
"safer-buffer": {
"version": "2.1.2",
- "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
- "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
+ "bundled": true
},
"sax": {
"version": "1.2.4",
- "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz",
- "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw=="
+ "bundled": true
},
"semver": {
"version": "5.5.0",
- "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz",
- "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA=="
+ "bundled": true
},
"set-blocking": {
"version": "2.0.0",
- "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz",
- "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc="
+ "bundled": true
},
"signal-exit": {
"version": "3.0.2",
- "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz",
- "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0="
+ "bundled": true
},
"string-width": {
"version": "1.0.2",
- "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
- "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=",
+ "bundled": true,
"requires": {
"code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0",
@@ -3013,29 +4184,25 @@
},
"string_decoder": {
"version": "1.1.1",
- "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
- "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
+ "bundled": true,
"requires": {
"safe-buffer": "~5.1.0"
}
},
"strip-ansi": {
"version": "3.0.1",
- "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
- "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
+ "bundled": true,
"requires": {
"ansi-regex": "^2.0.0"
}
},
"strip-json-comments": {
"version": "2.0.1",
- "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz",
- "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo="
+ "bundled": true
},
"tar": {
"version": "4.4.4",
- "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.4.tgz",
- "integrity": "sha512-mq9ixIYfNF9SK0IS/h2HKMu8Q2iaCuhDDsZhdEag/FHv8fOaYld4vN7ouMgcSSt5WKZzPs8atclTcJm36OTh4w==",
+ "bundled": true,
"requires": {
"chownr": "^1.0.1",
"fs-minipass": "^1.2.5",
@@ -3048,26 +4215,22 @@
},
"util-deprecate": {
"version": "1.0.2",
- "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
- "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8="
+ "bundled": true
},
"wide-align": {
"version": "1.1.3",
- "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz",
- "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==",
+ "bundled": true,
"requires": {
"string-width": "^1.0.2 || 2"
}
},
"wrappy": {
"version": "1.0.2",
- "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
- "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="
+ "bundled": true
},
"yallist": {
"version": "3.0.2",
- "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.2.tgz",
- "integrity": "sha1-hFK0u36Dx8GI2AQcGoN8dz1ti7k="
+ "bundled": true
}
}
},
@@ -3080,15 +4243,6 @@
"function-bind": "^1.1.1"
}
},
- "has-ansi": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz",
- "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=",
- "dev": true,
- "requires": {
- "ansi-regex": "^2.0.0"
- }
- },
"has-flag": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
@@ -3104,14 +4258,6 @@
"get-value": "^2.0.6",
"has-values": "^1.0.0",
"isobject": "^3.0.0"
- },
- "dependencies": {
- "isobject": {
- "version": "3.0.1",
- "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz",
- "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=",
- "dev": true
- }
}
},
"has-values": {
@@ -3124,26 +4270,6 @@
"kind-of": "^4.0.0"
},
"dependencies": {
- "is-number": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz",
- "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=",
- "dev": true,
- "requires": {
- "kind-of": "^3.0.2"
- },
- "dependencies": {
- "kind-of": {
- "version": "3.2.2",
- "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
- "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
- "dev": true,
- "requires": {
- "is-buffer": "^1.1.5"
- }
- }
- }
- },
"kind-of": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz",
@@ -3155,22 +4281,48 @@
}
}
},
+ "hash-base": {
+ "version": "3.0.4",
+ "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.0.4.tgz",
+ "integrity": "sha1-X8hoaEfs1zSZQDMZprCj8/auSRg=",
+ "dev": true,
+ "requires": {
+ "inherits": "^2.0.1",
+ "safe-buffer": "^5.0.1"
+ }
+ },
+ "hash.js": {
+ "version": "1.1.5",
+ "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.5.tgz",
+ "integrity": "sha512-eWI5HG9Np+eHV1KQhisXWwM+4EPPYe5dFX1UZZH7k/E3JzDEazVH+VGlZi6R94ZqImq+A3D1mCEtrFIfg/E7sA==",
+ "dev": true,
+ "requires": {
+ "inherits": "^2.0.3",
+ "minimalistic-assert": "^1.0.1"
+ }
+ },
"hex-color-regex": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/hex-color-regex/-/hex-color-regex-1.1.0.tgz",
"integrity": "sha512-l9sfDFsuqtOqKDsQdqrMRk0U85RZc0RtOR9yPI7mRVOa4FsR/BVnZ0shmQRM96Ji99kYZP/7hn1cedc1+ApsTQ==",
"dev": true
},
- "home-or-tmp": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/home-or-tmp/-/home-or-tmp-2.0.0.tgz",
- "integrity": "sha1-42w/LSyufXRqhX440Y1fMqeILbg=",
+ "hmac-drbg": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz",
+ "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=",
"dev": true,
"requires": {
- "os-homedir": "^1.0.0",
- "os-tmpdir": "^1.0.1"
+ "hash.js": "^1.0.3",
+ "minimalistic-assert": "^1.0.0",
+ "minimalistic-crypto-utils": "^1.0.1"
}
},
+ "hoist-non-react-statics": {
+ "version": "2.5.5",
+ "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-2.5.5.tgz",
+ "integrity": "sha512-rqcy4pJo55FTTLWt+bU8ukscqHeE/e9KWvsOW2b/a3afxQZhwkQdT1rPPCJ0rYXdj4vNcasY8zHTH+jF/qStxw=="
+ },
"hsl-regex": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/hsl-regex/-/hsl-regex-1.0.0.tgz",
@@ -3194,6 +4346,12 @@
"resolved": "https://registry.npmjs.org/http-parser-js/-/http-parser-js-0.4.13.tgz",
"integrity": "sha1-O9bW/ebjFyyTNMOzO2wZPYD+ETc="
},
+ "https-browserify": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz",
+ "integrity": "sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=",
+ "dev": true
+ },
"iconv-lite": {
"version": "0.4.24",
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
@@ -3202,12 +4360,100 @@
"safer-buffer": ">= 2.1.2 < 3"
}
},
+ "ieee754": {
+ "version": "1.1.12",
+ "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.12.tgz",
+ "integrity": "sha512-GguP+DRY+pJ3soyIiGPTvdiVXjZ+DbXOxGpXn3eMvNW4x4irjqXm4wHKscC+TfxSJ0yw/S1F24tqdMNsMZTiLA==",
+ "dev": true
+ },
+ "iferr": {
+ "version": "0.1.5",
+ "resolved": "https://registry.npmjs.org/iferr/-/iferr-0.1.5.tgz",
+ "integrity": "sha1-xg7taebY/bazEEofy8ocGS3FtQE=",
+ "dev": true
+ },
+ "import-local": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/import-local/-/import-local-2.0.0.tgz",
+ "integrity": "sha512-b6s04m3O+s3CGSbqDIyP4R6aAwAeYlVq9+WUWep6iHa8ETRf9yei1U48C5MmfJmV9AiLYYBKPMq/W+/WRpQmCQ==",
+ "dev": true,
+ "requires": {
+ "pkg-dir": "^3.0.0",
+ "resolve-cwd": "^2.0.0"
+ },
+ "dependencies": {
+ "find-up": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz",
+ "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==",
+ "dev": true,
+ "requires": {
+ "locate-path": "^3.0.0"
+ }
+ },
+ "locate-path": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz",
+ "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==",
+ "dev": true,
+ "requires": {
+ "p-locate": "^3.0.0",
+ "path-exists": "^3.0.0"
+ }
+ },
+ "p-limit": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.0.0.tgz",
+ "integrity": "sha512-fl5s52lI5ahKCernzzIyAP0QAZbGIovtVHGwpcu1Jr/EpzLVDI2myISHwGqK7m8uQFugVWSrbxH7XnhGtvEc+A==",
+ "dev": true,
+ "requires": {
+ "p-try": "^2.0.0"
+ }
+ },
+ "p-locate": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz",
+ "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==",
+ "dev": true,
+ "requires": {
+ "p-limit": "^2.0.0"
+ }
+ },
+ "p-try": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.0.0.tgz",
+ "integrity": "sha512-hMp0onDKIajHfIkdRk3P4CdCmErkYAxxDtP3Wx/4nZ3aGlau2VKh3mZpcuFkH27WQkL/3WBCPOktzA9ZOAnMQQ==",
+ "dev": true
+ },
+ "pkg-dir": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz",
+ "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==",
+ "dev": true,
+ "requires": {
+ "find-up": "^3.0.0"
+ }
+ }
+ }
+ },
+ "imurmurhash": {
+ "version": "0.1.4",
+ "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz",
+ "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=",
+ "dev": true
+ },
"indexes-of": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/indexes-of/-/indexes-of-1.0.1.tgz",
"integrity": "sha1-8w9xbI4r00bHtn0985FVZqfAVgc=",
"dev": true
},
+ "indexof": {
+ "version": "0.0.1",
+ "resolved": "https://registry.npmjs.org/indexof/-/indexof-0.0.1.tgz",
+ "integrity": "sha1-gtwzbSMrkGIXnQWrMpOmYFn9Q10=",
+ "dev": true
+ },
"inflight": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
@@ -3222,11 +4468,42 @@
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
"integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4="
},
+ "interpret": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.1.0.tgz",
+ "integrity": "sha1-ftGxQQxqDg94z5XTuEQMY/eLhhQ=",
+ "dev": true
+ },
+ "intl-format-cache": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/intl-format-cache/-/intl-format-cache-2.1.0.tgz",
+ "integrity": "sha1-BKNp/sv61tpgBbrh8UMzMy3PkxY="
+ },
+ "intl-messageformat": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/intl-messageformat/-/intl-messageformat-2.2.0.tgz",
+ "integrity": "sha1-NFvNRt5jC3aDMwwuUhd/9eq0hPw=",
+ "requires": {
+ "intl-messageformat-parser": "1.4.0"
+ }
+ },
+ "intl-messageformat-parser": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/intl-messageformat-parser/-/intl-messageformat-parser-1.4.0.tgz",
+ "integrity": "sha1-tD1FqXRoytvkQzHXS7Ho3qRPwHU="
+ },
+ "intl-relativeformat": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/intl-relativeformat/-/intl-relativeformat-2.1.0.tgz",
+ "integrity": "sha1-AQ8RBYAiUfQKxH0OPhogE0iiVd8=",
+ "requires": {
+ "intl-messageformat": "^2.0.0"
+ }
+ },
"invariant": {
"version": "2.2.4",
"resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz",
"integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==",
- "dev": true,
"requires": {
"loose-envify": "^1.0.0"
}
@@ -3249,6 +4526,17 @@
"dev": true,
"requires": {
"kind-of": "^3.0.2"
+ },
+ "dependencies": {
+ "kind-of": {
+ "version": "3.2.2",
+ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
+ "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
+ "dev": true,
+ "requires": {
+ "is-buffer": "^1.1.5"
+ }
+ }
}
},
"is-arrayish": {
@@ -3262,7 +4550,6 @@
"resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz",
"integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=",
"dev": true,
- "optional": true,
"requires": {
"binary-extensions": "^1.0.0"
}
@@ -3300,6 +4587,17 @@
"dev": true,
"requires": {
"kind-of": "^3.0.2"
+ },
+ "dependencies": {
+ "kind-of": {
+ "version": "3.2.2",
+ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
+ "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
+ "dev": true,
+ "requires": {
+ "is-buffer": "^1.1.5"
+ }
+ }
}
},
"is-date-object": {
@@ -3333,23 +4631,6 @@
"integrity": "sha1-YTObbyR1/Hcv2cnYP1yFddwVSuE=",
"dev": true
},
- "is-dotfile": {
- "version": "1.0.3",
- "resolved": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.3.tgz",
- "integrity": "sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE=",
- "dev": true,
- "optional": true
- },
- "is-equal-shallow": {
- "version": "0.1.3",
- "resolved": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz",
- "integrity": "sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ=",
- "dev": true,
- "optional": true,
- "requires": {
- "is-primitive": "^2.0.0"
- }
- },
"is-extendable": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz",
@@ -3357,20 +4638,11 @@
"dev": true
},
"is-extglob": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz",
- "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=",
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
+ "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=",
"dev": true
},
- "is-finite": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz",
- "integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=",
- "dev": true,
- "requires": {
- "number-is-nan": "^1.0.0"
- }
- },
"is-fullwidth-code-point": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz",
@@ -3380,22 +4652,32 @@
}
},
"is-glob": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz",
- "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=",
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.0.tgz",
+ "integrity": "sha1-lSHHaEXMJhCoUgPd8ICpWML/q8A=",
"dev": true,
"requires": {
- "is-extglob": "^1.0.0"
+ "is-extglob": "^2.1.1"
}
},
"is-number": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz",
- "integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=",
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz",
+ "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=",
"dev": true,
- "optional": true,
"requires": {
"kind-of": "^3.0.2"
+ },
+ "dependencies": {
+ "kind-of": {
+ "version": "3.2.2",
+ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
+ "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
+ "dev": true,
+ "requires": {
+ "is-buffer": "^1.1.5"
+ }
+ }
}
},
"is-obj": {
@@ -3411,30 +4693,8 @@
"dev": true,
"requires": {
"isobject": "^3.0.1"
- },
- "dependencies": {
- "isobject": {
- "version": "3.0.1",
- "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz",
- "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=",
- "dev": true
- }
}
},
- "is-posix-bracket": {
- "version": "0.1.1",
- "resolved": "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz",
- "integrity": "sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q=",
- "dev": true,
- "optional": true
- },
- "is-primitive": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz",
- "integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU=",
- "dev": true,
- "optional": true
- },
"is-regex": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz",
@@ -3474,8 +4734,7 @@
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz",
"integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==",
- "dev": true,
- "optional": true
+ "dev": true
},
"isarray": {
"version": "1.0.0",
@@ -3483,15 +4742,17 @@
"integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=",
"dev": true
},
+ "isexe": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
+ "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=",
+ "dev": true
+ },
"isobject": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz",
- "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=",
- "dev": true,
- "optional": true,
- "requires": {
- "isarray": "1.0.0"
- }
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz",
+ "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=",
+ "dev": true
},
"isomorphic-fetch": {
"version": "2.2.1",
@@ -3502,6 +4763,12 @@
"whatwg-fetch": ">=0.10.0"
}
},
+ "js-levenshtein": {
+ "version": "1.1.4",
+ "resolved": "https://registry.npmjs.org/js-levenshtein/-/js-levenshtein-1.1.4.tgz",
+ "integrity": "sha512-PxfGzSs0ztShKrUYPIn5r0MtyAhYcCwmndozzpz8YObbPnD1jFxzlBGbRnX2mIu6Z13xN6+PTu05TQFnZFlzow==",
+ "dev": true
+ },
"js-tokens": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz",
@@ -3518,9 +4785,9 @@
}
},
"jsesc": {
- "version": "1.3.0",
- "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz",
- "integrity": "sha1-RsP+yMGJKxKwgz25vHYiF226s0s=",
+ "version": "0.5.0",
+ "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz",
+ "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=",
"dev": true
},
"json-parse-better-errors": {
@@ -3529,6 +4796,12 @@
"integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==",
"dev": true
},
+ "json-schema-traverse": {
+ "version": "0.4.1",
+ "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz",
+ "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==",
+ "dev": true
+ },
"json5": {
"version": "0.5.1",
"resolved": "http://registry.npmjs.org/json5/-/json5-0.5.1.tgz",
@@ -3536,13 +4809,10 @@
"dev": true
},
"kind-of": {
- "version": "3.2.2",
- "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
- "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
- "dev": true,
- "requires": {
- "is-buffer": "^1.1.5"
- }
+ "version": "6.0.2",
+ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz",
+ "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==",
+ "dev": true
},
"lcid": {
"version": "1.0.0",
@@ -3552,11 +4822,44 @@
"invert-kv": "^1.0.0"
}
},
+ "loader-runner": {
+ "version": "2.3.1",
+ "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-2.3.1.tgz",
+ "integrity": "sha512-By6ZFY7ETWOc9RFaAIb23IjJVcM4dvJC/N57nmdz9RSkMXvAXGI7SyVlAw3v8vjtDRlqThgVDVmTnr9fqMlxkw==",
+ "dev": true
+ },
+ "loader-utils": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.1.0.tgz",
+ "integrity": "sha1-yYrvSIvM7aL/teLeZG1qdUQp9c0=",
+ "dev": true,
+ "requires": {
+ "big.js": "^3.1.3",
+ "emojis-list": "^2.0.0",
+ "json5": "^0.5.0"
+ }
+ },
+ "locate-path": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz",
+ "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=",
+ "dev": true,
+ "requires": {
+ "p-locate": "^2.0.0",
+ "path-exists": "^3.0.0"
+ }
+ },
"lodash": {
"version": "4.17.10",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz",
"integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg=="
},
+ "lodash.debounce": {
+ "version": "4.0.8",
+ "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz",
+ "integrity": "sha1-gteb/zCmfEAF/9XiUVMArZyk168=",
+ "dev": true
+ },
"lodash.memoize": {
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz",
@@ -3582,6 +4885,34 @@
"js-tokens": "^3.0.0 || ^4.0.0"
}
},
+ "lru-cache": {
+ "version": "4.1.3",
+ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.3.tgz",
+ "integrity": "sha512-fFEhvcgzuIoJVUF8fYr5KR0YqxD238zgObTps31YdADwPPAp82a4M8TrckkWyx7ekNlf9aBcVn81cFwwXngrJA==",
+ "dev": true,
+ "requires": {
+ "pseudomap": "^1.0.2",
+ "yallist": "^2.1.2"
+ }
+ },
+ "make-dir": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz",
+ "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==",
+ "dev": true,
+ "requires": {
+ "pify": "^3.0.0"
+ }
+ },
+ "map-age-cleaner": {
+ "version": "0.1.2",
+ "resolved": "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.2.tgz",
+ "integrity": "sha512-UN1dNocxQq44IhJyMI4TU8phc2m9BddacHRPRjKGLYaF0jqd3xLz0jS0skpAU9WgYyoR4gHtUpzytNBS385FWQ==",
+ "dev": true,
+ "requires": {
+ "p-defer": "^1.0.0"
+ }
+ },
"map-cache": {
"version": "0.2.2",
"resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz",
@@ -3597,12 +4928,16 @@
"object-visit": "^1.0.0"
}
},
- "math-random": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/math-random/-/math-random-1.0.1.tgz",
- "integrity": "sha1-izqsWIuKZuSXXjzepn97sylgH6w=",
+ "md5.js": {
+ "version": "1.3.5",
+ "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz",
+ "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==",
"dev": true,
- "optional": true
+ "requires": {
+ "hash-base": "^3.0.0",
+ "inherits": "^2.0.1",
+ "safe-buffer": "^5.1.2"
+ }
},
"mdn-data": {
"version": "1.1.4",
@@ -3610,28 +4945,76 @@
"integrity": "sha512-FSYbp3lyKjyj3E7fMl6rYvUdX0FBXaluGqlFoYESWQlyUTq8R+wp0rkFxoYFqZlHCvsUXGjyJmLQSnXToYhOSA==",
"dev": true
},
- "micromatch": {
- "version": "2.3.11",
- "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz",
- "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=",
+ "mem": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/mem/-/mem-4.0.0.tgz",
+ "integrity": "sha512-WQxG/5xYc3tMbYLXoXPm81ET2WDULiU5FxbuIoNbJqLOOI8zehXFdZuiUEgfdrU2mVB1pxBZUGlYORSrpuJreA==",
"dev": true,
- "optional": true,
"requires": {
- "arr-diff": "^2.0.0",
- "array-unique": "^0.2.1",
- "braces": "^1.8.2",
- "expand-brackets": "^0.1.4",
- "extglob": "^0.3.1",
- "filename-regex": "^2.0.0",
- "is-extglob": "^1.0.0",
- "is-glob": "^2.0.1",
- "kind-of": "^3.0.2",
- "normalize-path": "^2.0.1",
- "object.omit": "^2.0.0",
- "parse-glob": "^3.0.4",
- "regex-cache": "^0.4.2"
+ "map-age-cleaner": "^0.1.1",
+ "mimic-fn": "^1.0.0",
+ "p-is-promise": "^1.1.0"
}
},
+ "memory-fs": {
+ "version": "0.4.1",
+ "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.4.1.tgz",
+ "integrity": "sha1-OpoguEYlI+RHz7x+i7gO1me/xVI=",
+ "dev": true,
+ "requires": {
+ "errno": "^0.1.3",
+ "readable-stream": "^2.0.1"
+ }
+ },
+ "micromatch": {
+ "version": "3.1.10",
+ "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz",
+ "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==",
+ "dev": true,
+ "requires": {
+ "arr-diff": "^4.0.0",
+ "array-unique": "^0.3.2",
+ "braces": "^2.3.1",
+ "define-property": "^2.0.2",
+ "extend-shallow": "^3.0.2",
+ "extglob": "^2.0.4",
+ "fragment-cache": "^0.2.1",
+ "kind-of": "^6.0.2",
+ "nanomatch": "^1.2.9",
+ "object.pick": "^1.3.0",
+ "regex-not": "^1.0.0",
+ "snapdragon": "^0.8.1",
+ "to-regex": "^3.0.2"
+ }
+ },
+ "miller-rabin": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz",
+ "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==",
+ "dev": true,
+ "requires": {
+ "bn.js": "^4.0.0",
+ "brorand": "^1.0.1"
+ }
+ },
+ "mimic-fn": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz",
+ "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==",
+ "dev": true
+ },
+ "minimalistic-assert": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz",
+ "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==",
+ "dev": true
+ },
+ "minimalistic-crypto-utils": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz",
+ "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=",
+ "dev": true
+ },
"minimatch": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
@@ -3646,6 +5029,24 @@
"integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=",
"dev": true
},
+ "mississippi": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/mississippi/-/mississippi-2.0.0.tgz",
+ "integrity": "sha512-zHo8v+otD1J10j/tC+VNoGK9keCuByhKovAvdn74dmxJl9+mWHnx6EMsDN4lgRoMI/eYo2nchAxniIbUPb5onw==",
+ "dev": true,
+ "requires": {
+ "concat-stream": "^1.5.0",
+ "duplexify": "^3.4.2",
+ "end-of-stream": "^1.1.0",
+ "flush-write-stream": "^1.0.0",
+ "from2": "^2.1.0",
+ "parallel-transform": "^1.1.0",
+ "pump": "^2.0.1",
+ "pumpify": "^1.3.3",
+ "stream-each": "^1.1.0",
+ "through2": "^2.0.0"
+ }
+ },
"mixin-deep": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.1.tgz",
@@ -3676,6 +5077,20 @@
"minimist": "0.0.8"
}
},
+ "move-concurrently": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz",
+ "integrity": "sha1-viwAX9oy4LKa8fBdfEszIUxwH5I=",
+ "dev": true,
+ "requires": {
+ "aproba": "^1.1.1",
+ "copy-concurrently": "^1.0.0",
+ "fs-write-stream-atomic": "^1.0.8",
+ "mkdirp": "^0.5.1",
+ "rimraf": "^2.5.4",
+ "run-queue": "^1.0.3"
+ }
+ },
"ms": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
@@ -3692,7 +5107,6 @@
"resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz",
"integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==",
"dev": true,
- "optional": true,
"requires": {
"arr-diff": "^4.0.0",
"array-unique": "^0.3.2",
@@ -3705,31 +5119,20 @@
"regex-not": "^1.0.0",
"snapdragon": "^0.8.1",
"to-regex": "^3.0.1"
- },
- "dependencies": {
- "arr-diff": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz",
- "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=",
- "dev": true,
- "optional": true
- },
- "array-unique": {
- "version": "0.3.2",
- "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz",
- "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=",
- "dev": true,
- "optional": true
- },
- "kind-of": {
- "version": "6.0.2",
- "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz",
- "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==",
- "dev": true,
- "optional": true
- }
}
},
+ "neo-async": {
+ "version": "2.6.0",
+ "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.0.tgz",
+ "integrity": "sha512-MFh0d/Wa7vkKO3Y3LlacqAEeHK0mckVqzDieUKTT+KGxi+zIpeVsFxymkIiRpbpDziHc290Xr9A1O4Om7otoRA==",
+ "dev": true
+ },
+ "nice-try": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz",
+ "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==",
+ "dev": true
+ },
"node-fetch": {
"version": "1.7.3",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-1.7.3.tgz",
@@ -3739,6 +5142,45 @@
"is-stream": "^1.0.1"
}
},
+ "node-libs-browser": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/node-libs-browser/-/node-libs-browser-2.1.0.tgz",
+ "integrity": "sha512-5AzFzdoIMb89hBGMZglEegffzgRg+ZFoUmisQ8HI4j1KDdpx13J0taNp2y9xPbur6W61gepGDDotGBVQ7mfUCg==",
+ "dev": true,
+ "requires": {
+ "assert": "^1.1.1",
+ "browserify-zlib": "^0.2.0",
+ "buffer": "^4.3.0",
+ "console-browserify": "^1.1.0",
+ "constants-browserify": "^1.0.0",
+ "crypto-browserify": "^3.11.0",
+ "domain-browser": "^1.1.1",
+ "events": "^1.0.0",
+ "https-browserify": "^1.0.0",
+ "os-browserify": "^0.3.0",
+ "path-browserify": "0.0.0",
+ "process": "^0.11.10",
+ "punycode": "^1.2.4",
+ "querystring-es3": "^0.2.0",
+ "readable-stream": "^2.3.3",
+ "stream-browserify": "^2.0.1",
+ "stream-http": "^2.7.2",
+ "string_decoder": "^1.0.0",
+ "timers-browserify": "^2.0.4",
+ "tty-browserify": "0.0.0",
+ "url": "^0.11.0",
+ "util": "^0.10.3",
+ "vm-browserify": "0.0.4"
+ },
+ "dependencies": {
+ "punycode": {
+ "version": "1.4.1",
+ "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz",
+ "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=",
+ "dev": true
+ }
+ }
+ },
"node-releases": {
"version": "1.0.0-alpha.11",
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.0.0-alpha.11.tgz",
@@ -3763,6 +5205,15 @@
"integrity": "sha512-WvF3Myk0NhXkG8S9bygFM4IC1KOvnVJGq0QoGeoqOYOBeinBZp5ybW3QuYbTc89lkWBMM9ZBO4QGRoc0353kKA==",
"dev": true
},
+ "npm-run-path": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz",
+ "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=",
+ "dev": true,
+ "requires": {
+ "path-key": "^2.0.0"
+ }
+ },
"nth-check": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/nth-check/-/nth-check-1.0.1.tgz",
@@ -3801,6 +5252,15 @@
"requires": {
"is-descriptor": "^0.1.0"
}
+ },
+ "kind-of": {
+ "version": "3.2.2",
+ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
+ "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
+ "dev": true,
+ "requires": {
+ "is-buffer": "^1.1.5"
+ }
}
}
},
@@ -3817,14 +5277,6 @@
"dev": true,
"requires": {
"isobject": "^3.0.0"
- },
- "dependencies": {
- "isobject": {
- "version": "3.0.1",
- "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz",
- "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=",
- "dev": true
- }
}
},
"object.getownpropertydescriptors": {
@@ -3837,17 +5289,6 @@
"es-abstract": "^1.5.1"
}
},
- "object.omit": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz",
- "integrity": "sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo=",
- "dev": true,
- "optional": true,
- "requires": {
- "for-own": "^0.1.4",
- "is-extendable": "^0.1.1"
- }
- },
"object.pick": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz",
@@ -3855,14 +5296,6 @@
"dev": true,
"requires": {
"isobject": "^3.0.1"
- },
- "dependencies": {
- "isobject": {
- "version": "3.0.1",
- "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz",
- "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=",
- "dev": true
- }
}
},
"object.values": {
@@ -3890,10 +5323,10 @@
"resolved": "https://registry.npmjs.org/optjs/-/optjs-3.2.2.tgz",
"integrity": "sha1-aabOicRCpEQDFBrS+bNwvVu29O4="
},
- "os-homedir": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz",
- "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=",
+ "os-browserify": {
+ "version": "0.3.0",
+ "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz",
+ "integrity": "sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc=",
"dev": true
},
"os-locale": {
@@ -3904,34 +5337,76 @@
"lcid": "^1.0.0"
}
},
- "os-tmpdir": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz",
- "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=",
+ "p-defer": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz",
+ "integrity": "sha1-n26xgvbJqozXQwBKfU+WsZaw+ww=",
"dev": true
},
- "output-file-sync": {
- "version": "1.1.2",
- "resolved": "https://registry.npmjs.org/output-file-sync/-/output-file-sync-1.1.2.tgz",
- "integrity": "sha1-0KM+7+YaIF+suQCS6CZZjVJFznY=",
+ "p-finally": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz",
+ "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=",
+ "dev": true
+ },
+ "p-is-promise": {
+ "version": "1.1.0",
+ "resolved": "http://registry.npmjs.org/p-is-promise/-/p-is-promise-1.1.0.tgz",
+ "integrity": "sha1-nJRWmJ6fZYgBewQ01WCXZ1w9oF4=",
+ "dev": true
+ },
+ "p-limit": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz",
+ "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==",
"dev": true,
"requires": {
- "graceful-fs": "^4.1.4",
- "mkdirp": "^0.5.1",
- "object-assign": "^4.1.0"
+ "p-try": "^1.0.0"
}
},
- "parse-glob": {
- "version": "3.0.4",
- "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz",
- "integrity": "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=",
+ "p-locate": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz",
+ "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=",
"dev": true,
- "optional": true,
"requires": {
- "glob-base": "^0.3.0",
- "is-dotfile": "^1.0.0",
- "is-extglob": "^1.0.0",
- "is-glob": "^2.0.0"
+ "p-limit": "^1.1.0"
+ }
+ },
+ "p-try": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz",
+ "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=",
+ "dev": true
+ },
+ "pako": {
+ "version": "1.0.6",
+ "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.6.tgz",
+ "integrity": "sha512-lQe48YPsMJAig+yngZ87Lus+NF+3mtu7DVOBu6b/gHO1YpKwIj5AWjZ/TOS7i46HD/UixzWb1zeWDZfGZ3iYcg==",
+ "dev": true
+ },
+ "parallel-transform": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/parallel-transform/-/parallel-transform-1.1.0.tgz",
+ "integrity": "sha1-1BDwZbBdojCB/NEPKIVMKb2jOwY=",
+ "dev": true,
+ "requires": {
+ "cyclist": "~0.2.2",
+ "inherits": "^2.0.3",
+ "readable-stream": "^2.1.5"
+ }
+ },
+ "parse-asn1": {
+ "version": "5.1.1",
+ "resolved": "http://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.1.tgz",
+ "integrity": "sha512-KPx7flKXg775zZpnp9SxJlz00gTd4BmJ2yJufSc44gMCRrRQ7NSzAcSJQfifuOLgW6bEi+ftrALtsgALeB2Adw==",
+ "dev": true,
+ "requires": {
+ "asn1.js": "^4.0.0",
+ "browserify-aes": "^1.0.0",
+ "create-hash": "^1.1.0",
+ "evp_bytestokey": "^1.0.0",
+ "pbkdf2": "^3.0.3"
}
},
"parse-json": {
@@ -3950,17 +5425,74 @@
"integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=",
"dev": true
},
+ "path-browserify": {
+ "version": "0.0.0",
+ "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.0.tgz",
+ "integrity": "sha1-oLhwcpquIUAFt9UDLsLLuw+0RRo=",
+ "dev": true
+ },
+ "path-dirname": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz",
+ "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=",
+ "dev": true
+ },
+ "path-exists": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz",
+ "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=",
+ "dev": true
+ },
"path-is-absolute": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
"integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18="
},
+ "path-key": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz",
+ "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=",
+ "dev": true
+ },
+ "path-parse": {
+ "version": "1.0.6",
+ "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz",
+ "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==",
+ "dev": true
+ },
+ "pbkdf2": {
+ "version": "3.0.17",
+ "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.17.tgz",
+ "integrity": "sha512-U/il5MsrZp7mGg3mSQfn742na2T+1/vHDCG5/iTI3X9MKUuYUZVLQhyRsg06mCgDBTd57TxzgZt7P+fYfjRLtA==",
+ "dev": true,
+ "requires": {
+ "create-hash": "^1.1.2",
+ "create-hmac": "^1.1.4",
+ "ripemd160": "^2.0.1",
+ "safe-buffer": "^5.0.1",
+ "sha.js": "^2.4.8"
+ }
+ },
+ "pify": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz",
+ "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=",
+ "dev": true
+ },
+ "pkg-dir": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz",
+ "integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=",
+ "dev": true,
+ "requires": {
+ "find-up": "^2.1.0"
+ }
+ },
"posix-character-classes": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz",
"integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=",
- "dev": true,
- "optional": true
+ "dev": true
},
"postcss-calc": {
"version": "6.0.1",
@@ -5666,25 +7198,29 @@
"integrity": "sha1-h/OPnxj3dKSrTIojL1xc6IcqnRU=",
"dev": true
},
- "preserve": {
- "version": "0.2.0",
- "resolved": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz",
- "integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=",
- "dev": true,
- "optional": true
- },
"private": {
"version": "0.1.8",
"resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz",
"integrity": "sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==",
"dev": true
},
+ "process": {
+ "version": "0.11.10",
+ "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz",
+ "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=",
+ "dev": true
+ },
"process-nextick-args": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz",
"integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==",
- "dev": true,
- "optional": true
+ "dev": true
+ },
+ "promise-inflight": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz",
+ "integrity": "sha1-mEcocL8igTL8vdhoEputEsPAKeM=",
+ "dev": true
},
"promise-polyfill": {
"version": "7.1.2",
@@ -5711,38 +7247,94 @@
"yargs": "^3.10.0"
}
},
+ "prr": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz",
+ "integrity": "sha1-0/wRS6BplaRexok/SEzrHXj19HY=",
+ "dev": true
+ },
+ "pseudomap": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz",
+ "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=",
+ "dev": true
+ },
+ "public-encrypt": {
+ "version": "4.0.3",
+ "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz",
+ "integrity": "sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q==",
+ "dev": true,
+ "requires": {
+ "bn.js": "^4.1.0",
+ "browserify-rsa": "^4.0.0",
+ "create-hash": "^1.1.0",
+ "parse-asn1": "^5.0.0",
+ "randombytes": "^2.0.1",
+ "safe-buffer": "^5.1.2"
+ }
+ },
+ "pump": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz",
+ "integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==",
+ "dev": true,
+ "requires": {
+ "end-of-stream": "^1.1.0",
+ "once": "^1.3.1"
+ }
+ },
+ "pumpify": {
+ "version": "1.5.1",
+ "resolved": "https://registry.npmjs.org/pumpify/-/pumpify-1.5.1.tgz",
+ "integrity": "sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ==",
+ "dev": true,
+ "requires": {
+ "duplexify": "^3.6.0",
+ "inherits": "^2.0.3",
+ "pump": "^2.0.0"
+ }
+ },
+ "punycode": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz",
+ "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==",
+ "dev": true
+ },
"q": {
"version": "1.5.1",
"resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz",
"integrity": "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=",
"dev": true
},
- "randomatic": {
- "version": "3.1.1",
- "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-3.1.1.tgz",
- "integrity": "sha512-TuDE5KxZ0J461RVjrJZCJc+J+zCkTb1MbH9AQUq68sMhOMcy9jLcb3BrZKgp9q9Ncltdg4QVqWrH02W2EFFVYw==",
+ "querystring": {
+ "version": "0.2.0",
+ "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz",
+ "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=",
+ "dev": true
+ },
+ "querystring-es3": {
+ "version": "0.2.1",
+ "resolved": "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz",
+ "integrity": "sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM=",
+ "dev": true
+ },
+ "randombytes": {
+ "version": "2.0.6",
+ "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.0.6.tgz",
+ "integrity": "sha512-CIQ5OFxf4Jou6uOKe9t1AOgqpeU5fd70A8NPdHSGeYXqXsPe6peOwI0cUl88RWZ6sP1vPMV3avd/R6cZ5/sP1A==",
"dev": true,
- "optional": true,
"requires": {
- "is-number": "^4.0.0",
- "kind-of": "^6.0.0",
- "math-random": "^1.0.1"
- },
- "dependencies": {
- "is-number": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz",
- "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==",
- "dev": true,
- "optional": true
- },
- "kind-of": {
- "version": "6.0.2",
- "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz",
- "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==",
- "dev": true,
- "optional": true
- }
+ "safe-buffer": "^5.1.0"
+ }
+ },
+ "randomfill": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz",
+ "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==",
+ "dev": true,
+ "requires": {
+ "randombytes": "^2.0.5",
+ "safe-buffer": "^5.1.0"
}
},
"react": {
@@ -5767,12 +7359,23 @@
"schedule": "^0.5.0"
}
},
+ "react-intl": {
+ "version": "2.7.1",
+ "resolved": "https://registry.npmjs.org/react-intl/-/react-intl-2.7.1.tgz",
+ "integrity": "sha512-Ndk0i04dSplBivA0/fELd8lMvIPuRizKC+F6s1EZ6jELvRKNcx9shWa8A1UIlTQfYSbys5huWCRgmylbW0e57A==",
+ "requires": {
+ "hoist-non-react-statics": "^2.5.5",
+ "intl-format-cache": "^2.0.5",
+ "intl-messageformat": "^2.1.0",
+ "intl-relativeformat": "^2.1.0",
+ "invariant": "^2.1.1"
+ }
+ },
"readable-stream": {
"version": "2.3.6",
"resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",
"integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==",
"dev": true,
- "optional": true,
"requires": {
"core-util-is": "~1.0.0",
"inherits": "~2.0.3",
@@ -5788,311 +7391,10 @@
"resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz",
"integrity": "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==",
"dev": true,
- "optional": true,
"requires": {
"graceful-fs": "^4.1.11",
"micromatch": "^3.1.10",
"readable-stream": "^2.0.2"
- },
- "dependencies": {
- "arr-diff": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz",
- "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=",
- "dev": true,
- "optional": true
- },
- "array-unique": {
- "version": "0.3.2",
- "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz",
- "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=",
- "dev": true
- },
- "braces": {
- "version": "2.3.2",
- "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz",
- "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==",
- "dev": true,
- "optional": true,
- "requires": {
- "arr-flatten": "^1.1.0",
- "array-unique": "^0.3.2",
- "extend-shallow": "^2.0.1",
- "fill-range": "^4.0.0",
- "isobject": "^3.0.1",
- "repeat-element": "^1.1.2",
- "snapdragon": "^0.8.1",
- "snapdragon-node": "^2.0.1",
- "split-string": "^3.0.2",
- "to-regex": "^3.0.1"
- },
- "dependencies": {
- "extend-shallow": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
- "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=",
- "dev": true,
- "optional": true,
- "requires": {
- "is-extendable": "^0.1.0"
- }
- }
- }
- },
- "expand-brackets": {
- "version": "2.1.4",
- "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz",
- "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=",
- "dev": true,
- "optional": true,
- "requires": {
- "debug": "^2.3.3",
- "define-property": "^0.2.5",
- "extend-shallow": "^2.0.1",
- "posix-character-classes": "^0.1.0",
- "regex-not": "^1.0.0",
- "snapdragon": "^0.8.1",
- "to-regex": "^3.0.1"
- },
- "dependencies": {
- "define-property": {
- "version": "0.2.5",
- "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz",
- "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=",
- "dev": true,
- "optional": true,
- "requires": {
- "is-descriptor": "^0.1.0"
- }
- },
- "extend-shallow": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
- "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=",
- "dev": true,
- "optional": true,
- "requires": {
- "is-extendable": "^0.1.0"
- }
- },
- "is-accessor-descriptor": {
- "version": "0.1.6",
- "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz",
- "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=",
- "dev": true,
- "optional": true,
- "requires": {
- "kind-of": "^3.0.2"
- },
- "dependencies": {
- "kind-of": {
- "version": "3.2.2",
- "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
- "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
- "dev": true,
- "optional": true,
- "requires": {
- "is-buffer": "^1.1.5"
- }
- }
- }
- },
- "is-data-descriptor": {
- "version": "0.1.4",
- "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz",
- "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=",
- "dev": true,
- "optional": true,
- "requires": {
- "kind-of": "^3.0.2"
- },
- "dependencies": {
- "kind-of": {
- "version": "3.2.2",
- "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
- "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
- "dev": true,
- "optional": true,
- "requires": {
- "is-buffer": "^1.1.5"
- }
- }
- }
- },
- "is-descriptor": {
- "version": "0.1.6",
- "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz",
- "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==",
- "dev": true,
- "optional": true,
- "requires": {
- "is-accessor-descriptor": "^0.1.6",
- "is-data-descriptor": "^0.1.4",
- "kind-of": "^5.0.0"
- }
- },
- "kind-of": {
- "version": "5.1.0",
- "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz",
- "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==",
- "dev": true,
- "optional": true
- }
- }
- },
- "extglob": {
- "version": "2.0.4",
- "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz",
- "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==",
- "dev": true,
- "optional": true,
- "requires": {
- "array-unique": "^0.3.2",
- "define-property": "^1.0.0",
- "expand-brackets": "^2.1.4",
- "extend-shallow": "^2.0.1",
- "fragment-cache": "^0.2.1",
- "regex-not": "^1.0.0",
- "snapdragon": "^0.8.1",
- "to-regex": "^3.0.1"
- },
- "dependencies": {
- "define-property": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz",
- "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=",
- "dev": true,
- "optional": true,
- "requires": {
- "is-descriptor": "^1.0.0"
- }
- },
- "extend-shallow": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
- "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=",
- "dev": true,
- "optional": true,
- "requires": {
- "is-extendable": "^0.1.0"
- }
- }
- }
- },
- "fill-range": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz",
- "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=",
- "dev": true,
- "optional": true,
- "requires": {
- "extend-shallow": "^2.0.1",
- "is-number": "^3.0.0",
- "repeat-string": "^1.6.1",
- "to-regex-range": "^2.1.0"
- },
- "dependencies": {
- "extend-shallow": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
- "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=",
- "dev": true,
- "optional": true,
- "requires": {
- "is-extendable": "^0.1.0"
- }
- }
- }
- },
- "is-accessor-descriptor": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz",
- "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==",
- "dev": true,
- "optional": true,
- "requires": {
- "kind-of": "^6.0.0"
- }
- },
- "is-data-descriptor": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz",
- "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==",
- "dev": true,
- "optional": true,
- "requires": {
- "kind-of": "^6.0.0"
- }
- },
- "is-descriptor": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz",
- "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==",
- "dev": true,
- "optional": true,
- "requires": {
- "is-accessor-descriptor": "^1.0.0",
- "is-data-descriptor": "^1.0.0",
- "kind-of": "^6.0.2"
- }
- },
- "is-number": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz",
- "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=",
- "dev": true,
- "optional": true,
- "requires": {
- "kind-of": "^3.0.2"
- },
- "dependencies": {
- "kind-of": {
- "version": "3.2.2",
- "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
- "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
- "dev": true,
- "optional": true,
- "requires": {
- "is-buffer": "^1.1.5"
- }
- }
- }
- },
- "isobject": {
- "version": "3.0.1",
- "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz",
- "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=",
- "dev": true,
- "optional": true
- },
- "kind-of": {
- "version": "6.0.2",
- "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz",
- "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==",
- "dev": true
- },
- "micromatch": {
- "version": "3.1.10",
- "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz",
- "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==",
- "dev": true,
- "optional": true,
- "requires": {
- "arr-diff": "^4.0.0",
- "array-unique": "^0.3.2",
- "braces": "^2.3.1",
- "define-property": "^2.0.2",
- "extend-shallow": "^3.0.2",
- "extglob": "^2.0.4",
- "fragment-cache": "^0.2.1",
- "kind-of": "^6.0.2",
- "nanomatch": "^1.2.9",
- "object.pick": "^1.3.0",
- "regex-not": "^1.0.0",
- "snapdragon": "^0.8.1",
- "to-regex": "^3.0.2"
- }
- }
}
},
"reduce-css-calc": {
@@ -6111,31 +7413,13 @@
"integrity": "sha512-1G6jJVDWrt0rK99kBjvEtziZNCICAuvIPkSiUFIQxVP06RCVpq3dmDo2oi6ABpYaDYaTRr67BEhL8r1wgEZZKg==",
"dev": true
},
- "regenerator-runtime": {
- "version": "0.11.1",
- "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz",
- "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==",
- "dev": true
- },
- "regenerator-transform": {
- "version": "0.10.1",
- "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.10.1.tgz",
- "integrity": "sha512-PJepbvDbuK1xgIgnau7Y90cwaAmO/LCLMI2mPvaXq2heGMR3aWW5/BQvYrhJ8jgmQjXewXvBjzfqKcVOmhjZ6Q==",
+ "regenerate-unicode-properties": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-7.0.0.tgz",
+ "integrity": "sha512-s5NGghCE4itSlUS+0WUj88G6cfMVMmH8boTPNvABf8od+2dhT9WDlWu8n01raQAJZMOK8Ch6jSexaRO7swd6aw==",
"dev": true,
"requires": {
- "babel-runtime": "^6.18.0",
- "babel-types": "^6.19.0",
- "private": "^0.1.6"
- }
- },
- "regex-cache": {
- "version": "0.4.4",
- "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz",
- "integrity": "sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ==",
- "dev": true,
- "optional": true,
- "requires": {
- "is-equal-shallow": "^0.1.3"
+ "regenerate": "^1.4.0"
}
},
"regex-not": {
@@ -6148,40 +7432,6 @@
"safe-regex": "^1.1.0"
}
},
- "regexpu-core": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-2.0.0.tgz",
- "integrity": "sha1-SdA4g3uNz4v6W5pCE5k45uoq4kA=",
- "dev": true,
- "requires": {
- "regenerate": "^1.2.1",
- "regjsgen": "^0.2.0",
- "regjsparser": "^0.1.4"
- }
- },
- "regjsgen": {
- "version": "0.2.0",
- "resolved": "http://registry.npmjs.org/regjsgen/-/regjsgen-0.2.0.tgz",
- "integrity": "sha1-bAFq3qxVT3WCP+N6wFuS1aTtsfc=",
- "dev": true
- },
- "regjsparser": {
- "version": "0.1.5",
- "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.1.5.tgz",
- "integrity": "sha1-fuj4Tcb6eS0/0K4ijSS9lJ6tIFw=",
- "dev": true,
- "requires": {
- "jsesc": "~0.5.0"
- },
- "dependencies": {
- "jsesc": {
- "version": "0.5.0",
- "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz",
- "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=",
- "dev": true
- }
- }
- },
"remove-trailing-separator": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz",
@@ -6200,15 +7450,42 @@
"integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=",
"dev": true
},
- "repeating": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz",
- "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=",
+ "require-directory": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz",
+ "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=",
+ "dev": true
+ },
+ "require-main-filename": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz",
+ "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=",
+ "dev": true
+ },
+ "resolve": {
+ "version": "1.8.1",
+ "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.8.1.tgz",
+ "integrity": "sha512-AicPrAC7Qu1JxPCZ9ZgCZlY35QgFnNqc+0LtbRNxnVw4TXvjQ72wnuL9JQcEBgXkI9JM8MsT9kaQoHcpCRJOYA==",
"dev": true,
"requires": {
- "is-finite": "^1.0.0"
+ "path-parse": "^1.0.5"
}
},
+ "resolve-cwd": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-2.0.0.tgz",
+ "integrity": "sha1-AKn3OHVW4nA46uIyyqNypqWbZlo=",
+ "dev": true,
+ "requires": {
+ "resolve-from": "^3.0.0"
+ }
+ },
+ "resolve-from": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz",
+ "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=",
+ "dev": true
+ },
"resolve-url": {
"version": "0.2.1",
"resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz",
@@ -6233,6 +7510,34 @@
"integrity": "sha1-QzdOLiyglosO8VI0YLfXMP8i7rM=",
"dev": true
},
+ "rimraf": {
+ "version": "2.6.2",
+ "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz",
+ "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==",
+ "dev": true,
+ "requires": {
+ "glob": "^7.0.5"
+ }
+ },
+ "ripemd160": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz",
+ "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==",
+ "dev": true,
+ "requires": {
+ "hash-base": "^3.0.0",
+ "inherits": "^2.0.1"
+ }
+ },
+ "run-queue": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/run-queue/-/run-queue-1.0.3.tgz",
+ "integrity": "sha1-6Eg5bwV9Ij8kOGkkYY4laUFh7Ec=",
+ "dev": true,
+ "requires": {
+ "aproba": "^1.1.1"
+ }
+ },
"safe-buffer": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
@@ -6267,12 +7572,34 @@
"object-assign": "^4.1.1"
}
},
+ "schema-utils": {
+ "version": "0.4.7",
+ "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-0.4.7.tgz",
+ "integrity": "sha512-v/iwU6wvwGK8HbU9yi3/nhGzP0yGSuhQMzL6ySiec1FSrZZDkhm4noOSWzrNFo/jEc+SJY6jRTwuwbSXJPDUnQ==",
+ "dev": true,
+ "requires": {
+ "ajv": "^6.1.0",
+ "ajv-keywords": "^3.1.0"
+ }
+ },
"semver": {
"version": "5.5.0",
"resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz",
"integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==",
"dev": true
},
+ "serialize-javascript": {
+ "version": "1.5.0",
+ "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-1.5.0.tgz",
+ "integrity": "sha512-Ga8c8NjAAp46Br4+0oZ2WxJCwIzwP60Gq1YPgU+39PiTVxyed/iKE/zyZI6+UlVYH5Q4PaQdHhcegIFPZTUfoQ==",
+ "dev": true
+ },
+ "set-blocking": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz",
+ "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=",
+ "dev": true
+ },
"set-value": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz",
@@ -6296,6 +7623,43 @@
}
}
},
+ "setimmediate": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz",
+ "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=",
+ "dev": true
+ },
+ "sha.js": {
+ "version": "2.4.11",
+ "resolved": "http://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz",
+ "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==",
+ "dev": true,
+ "requires": {
+ "inherits": "^2.0.1",
+ "safe-buffer": "^5.0.1"
+ }
+ },
+ "shebang-command": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz",
+ "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=",
+ "dev": true,
+ "requires": {
+ "shebang-regex": "^1.0.0"
+ }
+ },
+ "shebang-regex": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz",
+ "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=",
+ "dev": true
+ },
+ "signal-exit": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz",
+ "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=",
+ "dev": true
+ },
"simple-swizzle": {
"version": "0.2.2",
"resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz",
@@ -6313,12 +7677,6 @@
}
}
},
- "slash": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/slash/-/slash-1.0.0.tgz",
- "integrity": "sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU=",
- "dev": true
- },
"snapdragon": {
"version": "0.8.2",
"resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz",
@@ -6360,7 +7718,6 @@
"resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz",
"integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==",
"dev": true,
- "optional": true,
"requires": {
"define-property": "^1.0.0",
"isobject": "^3.0.0",
@@ -6372,7 +7729,6 @@
"resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz",
"integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=",
"dev": true,
- "optional": true,
"requires": {
"is-descriptor": "^1.0.0"
}
@@ -6382,7 +7738,6 @@
"resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz",
"integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==",
"dev": true,
- "optional": true,
"requires": {
"kind-of": "^6.0.0"
}
@@ -6392,7 +7747,6 @@
"resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz",
"integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==",
"dev": true,
- "optional": true,
"requires": {
"kind-of": "^6.0.0"
}
@@ -6402,25 +7756,11 @@
"resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz",
"integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==",
"dev": true,
- "optional": true,
"requires": {
"is-accessor-descriptor": "^1.0.0",
"is-data-descriptor": "^1.0.0",
"kind-of": "^6.0.2"
}
- },
- "isobject": {
- "version": "3.0.1",
- "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz",
- "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=",
- "dev": true,
- "optional": true
- },
- "kind-of": {
- "version": "6.0.2",
- "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz",
- "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==",
- "dev": true
}
}
},
@@ -6429,11 +7769,27 @@
"resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz",
"integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==",
"dev": true,
- "optional": true,
"requires": {
"kind-of": "^3.2.0"
+ },
+ "dependencies": {
+ "kind-of": {
+ "version": "3.2.2",
+ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
+ "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
+ "dev": true,
+ "requires": {
+ "is-buffer": "^1.1.5"
+ }
+ }
}
},
+ "source-list-map": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-2.0.1.tgz",
+ "integrity": "sha512-qnQ7gVMxGNxsiL4lEuJwe/To8UnK7fAnmbGEEH8RpLouuKbeEm0lhbQVFIrNSuB+G7tVrAlVsZgETT5nljf+Iw==",
+ "dev": true
+ },
"source-map": {
"version": "0.5.7",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz",
@@ -6453,15 +7809,6 @@
"urix": "^0.1.0"
}
},
- "source-map-support": {
- "version": "0.4.18",
- "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.18.tgz",
- "integrity": "sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA==",
- "dev": true,
- "requires": {
- "source-map": "^0.5.6"
- }
- },
"source-map-url": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz",
@@ -6483,6 +7830,15 @@
"integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=",
"dev": true
},
+ "ssri": {
+ "version": "5.3.0",
+ "resolved": "https://registry.npmjs.org/ssri/-/ssri-5.3.0.tgz",
+ "integrity": "sha512-XRSIPqLij52MtgoQavH/x/dU1qVKtWUAAZeOHsR9c2Ddi4XerFy3mc1alf+dLJKl9EUIm/Ht+EowFkTUOA6GAQ==",
+ "dev": true,
+ "requires": {
+ "safe-buffer": "^5.1.1"
+ }
+ },
"stable": {
"version": "0.1.8",
"resolved": "https://registry.npmjs.org/stable/-/stable-0.1.8.tgz",
@@ -6510,6 +7866,45 @@
}
}
},
+ "stream-browserify": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.1.tgz",
+ "integrity": "sha1-ZiZu5fm9uZQKTkUUyvtDu3Hlyds=",
+ "dev": true,
+ "requires": {
+ "inherits": "~2.0.1",
+ "readable-stream": "^2.0.2"
+ }
+ },
+ "stream-each": {
+ "version": "1.2.3",
+ "resolved": "https://registry.npmjs.org/stream-each/-/stream-each-1.2.3.tgz",
+ "integrity": "sha512-vlMC2f8I2u/bZGqkdfLQW/13Zihpej/7PmSiMQsbYddxuTsJp8vRe2x2FvVExZg7FaOds43ROAuFJwPR4MTZLw==",
+ "dev": true,
+ "requires": {
+ "end-of-stream": "^1.1.0",
+ "stream-shift": "^1.0.0"
+ }
+ },
+ "stream-http": {
+ "version": "2.8.3",
+ "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-2.8.3.tgz",
+ "integrity": "sha512-+TSkfINHDo4J+ZobQLWiMouQYB+UVYFttRA94FpEzzJ7ZdqcL4uUUQ7WkdkI4DSozGmgBUE/a47L+38PenXhUw==",
+ "dev": true,
+ "requires": {
+ "builtin-status-codes": "^3.0.0",
+ "inherits": "^2.0.1",
+ "readable-stream": "^2.3.6",
+ "to-arraybuffer": "^1.0.0",
+ "xtend": "^4.0.0"
+ }
+ },
+ "stream-shift": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.0.tgz",
+ "integrity": "sha1-1cdSgl5TZ+eG944Y5EXqIjoVWVI=",
+ "dev": true
+ },
"string-width": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
@@ -6525,7 +7920,6 @@
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
"integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
"dev": true,
- "optional": true,
"requires": {
"safe-buffer": "~5.1.0"
}
@@ -6538,6 +7932,12 @@
"ansi-regex": "^2.0.0"
}
},
+ "strip-eof": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz",
+ "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=",
+ "dev": true
+ },
"stylehacks": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/stylehacks/-/stylehacks-4.0.0.tgz",
@@ -6632,10 +8032,13 @@
}
},
"supports-color": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz",
- "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=",
- "dev": true
+ "version": "5.5.0",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
+ "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
+ "dev": true,
+ "requires": {
+ "has-flag": "^3.0.0"
+ }
},
"svgo": {
"version": "1.0.5",
@@ -6671,6 +8074,31 @@
}
}
},
+ "tapable": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/tapable/-/tapable-1.1.0.tgz",
+ "integrity": "sha512-IlqtmLVaZA2qab8epUXbVWRn3aB1imbDMJtjB3nu4X0NqPkcY/JH9ZtCBWKHWPxs8Svi9tyo8w2dBoi07qZbBA==",
+ "dev": true
+ },
+ "through2": {
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz",
+ "integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4=",
+ "dev": true,
+ "requires": {
+ "readable-stream": "^2.1.5",
+ "xtend": "~4.0.1"
+ }
+ },
+ "timers-browserify": {
+ "version": "2.0.10",
+ "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-2.0.10.tgz",
+ "integrity": "sha512-YvC1SV1XdOUaL6gx5CoGroT3Gu49pK9+TZ38ErPldOWW4j49GI1HKs9DV+KGq/w6y+LZ72W1c8cKz2vzY+qpzg==",
+ "dev": true,
+ "requires": {
+ "setimmediate": "^1.0.4"
+ }
+ },
"timsort": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/timsort/-/timsort-0.3.0.tgz",
@@ -6678,14 +8106,14 @@
"dev": true
},
"tinode-sdk": {
- "version": "0.15.8",
- "resolved": "https://registry.npmjs.org/tinode-sdk/-/tinode-sdk-0.15.8.tgz",
- "integrity": "sha512-itF8ej4Ffe8y3vnd1Kj13ULq9dxJdYmnqw6B7TGJgQANFmqB3fl3qUymteECegUA8uBAb/lmI5NaawAFuTL+Sg=="
+ "version": "0.15.8-rc1",
+ "resolved": "https://registry.npmjs.org/tinode-sdk/-/tinode-sdk-0.15.8-rc1.tgz",
+ "integrity": "sha512-139xdnrkBb6mPU4NiLuvMCZ2Ji/1WmP5WhHI7utdMirewq3l5jnQ0cF86iYBbOMaYhhnLLLsbbm4KjleP+1zHA=="
},
- "to-fast-properties": {
- "version": "1.0.3",
- "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz",
- "integrity": "sha1-uDVx+k2MJbguIxsG46MFXeTKGkc=",
+ "to-arraybuffer": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz",
+ "integrity": "sha1-fSKbH8xjfkZsoIEYCDanqr/4P0M=",
"dev": true
},
"to-object-path": {
@@ -6695,6 +8123,17 @@
"dev": true,
"requires": {
"kind-of": "^3.0.2"
+ },
+ "dependencies": {
+ "kind-of": {
+ "version": "3.2.2",
+ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
+ "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
+ "dev": true,
+ "requires": {
+ "is-buffer": "^1.1.5"
+ }
+ }
}
},
"to-regex": {
@@ -6714,22 +8153,9 @@
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz",
"integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=",
"dev": true,
- "optional": true,
"requires": {
"is-number": "^3.0.0",
"repeat-string": "^1.6.1"
- },
- "dependencies": {
- "is-number": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz",
- "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=",
- "dev": true,
- "optional": true,
- "requires": {
- "kind-of": "^3.0.2"
- }
- }
}
},
"trim-right": {
@@ -6743,6 +8169,18 @@
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.0.tgz",
"integrity": "sha512-f/qGG2tUkrISBlQZEjEqoZ3B2+npJjIf04H1wuAv9iA8i04Icp+61KRXxFdha22670NJopsZCIjhC3SnjPRKrQ=="
},
+ "tty-browserify": {
+ "version": "0.0.0",
+ "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz",
+ "integrity": "sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY=",
+ "dev": true
+ },
+ "typedarray": {
+ "version": "0.0.6",
+ "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz",
+ "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=",
+ "dev": true
+ },
"uglify-es": {
"version": "3.3.9",
"resolved": "https://registry.npmjs.org/uglify-es/-/uglify-es-3.3.9.tgz",
@@ -6753,12 +8191,6 @@
"source-map": "~0.6.1"
},
"dependencies": {
- "commander": {
- "version": "2.13.0",
- "resolved": "https://registry.npmjs.org/commander/-/commander-2.13.0.tgz",
- "integrity": "sha512-MVuS359B+YzaWqjCL/c+22gfryv+mCBPHAv3zyVI2GN8EY6IRP8VwtasXn8jyyhvvq84R4ImN1OKRtcbIasjYA==",
- "dev": true
- },
"source-map": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
@@ -6767,6 +8199,58 @@
}
}
},
+ "uglifyjs-webpack-plugin": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/uglifyjs-webpack-plugin/-/uglifyjs-webpack-plugin-1.3.0.tgz",
+ "integrity": "sha512-ovHIch0AMlxjD/97j9AYovZxG5wnHOPkL7T1GKochBADp/Zwc44pEWNqpKl1Loupp1WhFg7SlYmHZRUfdAacgw==",
+ "dev": true,
+ "requires": {
+ "cacache": "^10.0.4",
+ "find-cache-dir": "^1.0.0",
+ "schema-utils": "^0.4.5",
+ "serialize-javascript": "^1.4.0",
+ "source-map": "^0.6.1",
+ "uglify-es": "^3.3.4",
+ "webpack-sources": "^1.1.0",
+ "worker-farm": "^1.5.2"
+ },
+ "dependencies": {
+ "source-map": {
+ "version": "0.6.1",
+ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
+ "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
+ "dev": true
+ }
+ }
+ },
+ "unicode-canonical-property-names-ecmascript": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz",
+ "integrity": "sha512-jDrNnXWHd4oHiTZnx/ZG7gtUTVp+gCcTTKr8L0HjlwphROEW3+Him+IpvC+xcJEFegapiMZyZe02CyuOnRmbnQ==",
+ "dev": true
+ },
+ "unicode-match-property-ecmascript": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-1.0.4.tgz",
+ "integrity": "sha512-L4Qoh15vTfntsn4P1zqnHulG0LdXgjSO035fEpdtp6YxXhMT51Q6vgM5lYdG/5X3MjS+k/Y9Xw4SFCY9IkR0rg==",
+ "dev": true,
+ "requires": {
+ "unicode-canonical-property-names-ecmascript": "^1.0.4",
+ "unicode-property-aliases-ecmascript": "^1.0.4"
+ }
+ },
+ "unicode-match-property-value-ecmascript": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-1.0.2.tgz",
+ "integrity": "sha512-Rx7yODZC1L/T8XKo/2kNzVAQaRE88AaMvI1EF/Xnj3GW2wzN6fop9DDWuFAKUVFH7vozkz26DzP0qyWLKLIVPQ==",
+ "dev": true
+ },
+ "unicode-property-aliases-ecmascript": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.0.4.tgz",
+ "integrity": "sha512-2WSLa6OdYd2ng8oqiGIWnJqyFArvhn+5vgx5GTxMbUYjCYKUcuKS62YLFF0R/BDGlB1yzXjQOLtPAfHsgirEpg==",
+ "dev": true
+ },
"union-value": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.0.tgz",
@@ -6814,6 +8298,24 @@
"integrity": "sha1-/+3ks2slKQaW5uFl1KWe25mOawI=",
"dev": true
},
+ "unique-filename": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz",
+ "integrity": "sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ==",
+ "dev": true,
+ "requires": {
+ "unique-slug": "^2.0.0"
+ }
+ },
+ "unique-slug": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.1.tgz",
+ "integrity": "sha512-n9cU6+gITaVu7VGj1Z8feKMmfAjEAQGhwD9fE3zvpRRa0wEIx8ODYkVGfSc94M2OX00tUFV8wH3zYbm1I8mxFg==",
+ "dev": true,
+ "requires": {
+ "imurmurhash": "^0.1.4"
+ }
+ },
"unquote": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/unquote/-/unquote-1.1.1.tgz",
@@ -6857,39 +8359,68 @@
"resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz",
"integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=",
"dev": true
- },
- "isobject": {
- "version": "3.0.1",
- "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz",
- "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=",
- "dev": true
}
}
},
+ "upath": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/upath/-/upath-1.1.0.tgz",
+ "integrity": "sha512-bzpH/oBhoS/QI/YtbkqCg6VEiPYjSZtrHQM6/QnJS6OL9pKUFLqb3aFh4Scvwm45+7iAgiMkLhSbaZxUqmrprw==",
+ "dev": true
+ },
+ "uri-js": {
+ "version": "4.2.2",
+ "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz",
+ "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==",
+ "dev": true,
+ "requires": {
+ "punycode": "^2.1.0"
+ }
+ },
"urix": {
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz",
"integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=",
"dev": true
},
+ "url": {
+ "version": "0.11.0",
+ "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz",
+ "integrity": "sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE=",
+ "dev": true,
+ "requires": {
+ "punycode": "1.3.2",
+ "querystring": "0.2.0"
+ },
+ "dependencies": {
+ "punycode": {
+ "version": "1.3.2",
+ "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz",
+ "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=",
+ "dev": true
+ }
+ }
+ },
"use": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz",
"integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==",
"dev": true
},
- "user-home": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/user-home/-/user-home-1.1.1.tgz",
- "integrity": "sha1-K1viOjK2Onyd640PKNSFcko98ZA=",
- "dev": true
+ "util": {
+ "version": "0.10.4",
+ "resolved": "https://registry.npmjs.org/util/-/util-0.10.4.tgz",
+ "integrity": "sha512-0Pm9hTQ3se5ll1XihRic3FDIku70C+iHUdT/W926rSgHV5QgXsYbKZN8MSC3tJtSkhuROzvsQjAaFENRXr+19A==",
+ "dev": true,
+ "requires": {
+ "inherits": "2.0.3"
+ }
},
"util-deprecate": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
"integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=",
- "dev": true,
- "optional": true
+ "dev": true
},
"util.promisify": {
"version": "1.0.0",
@@ -6901,14 +8432,11 @@
"object.getownpropertydescriptors": "^2.0.3"
}
},
- "v8flags": {
- "version": "2.1.1",
- "resolved": "https://registry.npmjs.org/v8flags/-/v8flags-2.1.1.tgz",
- "integrity": "sha1-qrGh+jDUX4jdMhFIh1rALAtV5bQ=",
- "dev": true,
- "requires": {
- "user-home": "^1.1.1"
- }
+ "v8-compile-cache": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.0.2.tgz",
+ "integrity": "sha512-1wFuMUIM16MDJRCrpbpuEPTUGmM5QMUg0cr3KFwra2XgOgFcPGDQHDh3CszSCD2Zewc/dh/pamNEW8CbfDebUw==",
+ "dev": true
},
"vendors": {
"version": "1.0.2",
@@ -6916,6 +8444,236 @@
"integrity": "sha512-w/hry/368nO21AN9QljsaIhb9ZiZtZARoVH5f3CsFbawdLdayCgKRPup7CggujvySMxx0I91NOyxdVENohprLQ==",
"dev": true
},
+ "vm-browserify": {
+ "version": "0.0.4",
+ "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-0.0.4.tgz",
+ "integrity": "sha1-XX6kW7755Kb/ZflUOOCofDV9WnM=",
+ "dev": true,
+ "requires": {
+ "indexof": "0.0.1"
+ }
+ },
+ "watchpack": {
+ "version": "1.6.0",
+ "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.6.0.tgz",
+ "integrity": "sha512-i6dHe3EyLjMmDlU1/bGQpEw25XSjkJULPuAVKCbNRefQVq48yXKUpwg538F7AZTf9kyr57zj++pQFltUa5H7yA==",
+ "dev": true,
+ "requires": {
+ "chokidar": "^2.0.2",
+ "graceful-fs": "^4.1.2",
+ "neo-async": "^2.5.0"
+ }
+ },
+ "webpack": {
+ "version": "4.23.1",
+ "resolved": "https://registry.npmjs.org/webpack/-/webpack-4.23.1.tgz",
+ "integrity": "sha512-iE5Cu4rGEDk7ONRjisTOjVHv3dDtcFfwitSxT7evtYj/rANJpt1OuC/Kozh1pBa99AUBr1L/LsaNB+D9Xz3CEg==",
+ "dev": true,
+ "requires": {
+ "@webassemblyjs/ast": "1.7.10",
+ "@webassemblyjs/helper-module-context": "1.7.10",
+ "@webassemblyjs/wasm-edit": "1.7.10",
+ "@webassemblyjs/wasm-parser": "1.7.10",
+ "acorn": "^5.6.2",
+ "acorn-dynamic-import": "^3.0.0",
+ "ajv": "^6.1.0",
+ "ajv-keywords": "^3.1.0",
+ "chrome-trace-event": "^1.0.0",
+ "enhanced-resolve": "^4.1.0",
+ "eslint-scope": "^4.0.0",
+ "json-parse-better-errors": "^1.0.2",
+ "loader-runner": "^2.3.0",
+ "loader-utils": "^1.1.0",
+ "memory-fs": "~0.4.1",
+ "micromatch": "^3.1.8",
+ "mkdirp": "~0.5.0",
+ "neo-async": "^2.5.0",
+ "node-libs-browser": "^2.0.0",
+ "schema-utils": "^0.4.4",
+ "tapable": "^1.1.0",
+ "uglifyjs-webpack-plugin": "^1.2.4",
+ "watchpack": "^1.5.0",
+ "webpack-sources": "^1.3.0"
+ }
+ },
+ "webpack-cli": {
+ "version": "3.1.2",
+ "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-3.1.2.tgz",
+ "integrity": "sha512-Cnqo7CeqeSvC6PTdts+dywNi5CRlIPbLx1AoUPK2T6vC1YAugMG3IOoO9DmEscd+Dghw7uRlnzV1KwOe5IrtgQ==",
+ "dev": true,
+ "requires": {
+ "chalk": "^2.4.1",
+ "cross-spawn": "^6.0.5",
+ "enhanced-resolve": "^4.1.0",
+ "global-modules-path": "^2.3.0",
+ "import-local": "^2.0.0",
+ "interpret": "^1.1.0",
+ "loader-utils": "^1.1.0",
+ "supports-color": "^5.5.0",
+ "v8-compile-cache": "^2.0.2",
+ "yargs": "^12.0.2"
+ },
+ "dependencies": {
+ "ansi-regex": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz",
+ "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=",
+ "dev": true
+ },
+ "cliui": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz",
+ "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==",
+ "dev": true,
+ "requires": {
+ "string-width": "^2.1.1",
+ "strip-ansi": "^4.0.0",
+ "wrap-ansi": "^2.0.0"
+ }
+ },
+ "decamelize": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-2.0.0.tgz",
+ "integrity": "sha512-Ikpp5scV3MSYxY39ymh45ZLEecsTdv/Xj2CaQfI8RLMuwi7XvjX9H/fhraiSuU+C5w5NTDu4ZU72xNiZnurBPg==",
+ "dev": true,
+ "requires": {
+ "xregexp": "4.0.0"
+ }
+ },
+ "find-up": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz",
+ "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==",
+ "dev": true,
+ "requires": {
+ "locate-path": "^3.0.0"
+ }
+ },
+ "invert-kv": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz",
+ "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==",
+ "dev": true
+ },
+ "is-fullwidth-code-point": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz",
+ "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=",
+ "dev": true
+ },
+ "lcid": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz",
+ "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==",
+ "dev": true,
+ "requires": {
+ "invert-kv": "^2.0.0"
+ }
+ },
+ "locate-path": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz",
+ "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==",
+ "dev": true,
+ "requires": {
+ "p-locate": "^3.0.0",
+ "path-exists": "^3.0.0"
+ }
+ },
+ "os-locale": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.0.1.tgz",
+ "integrity": "sha512-7g5e7dmXPtzcP4bgsZ8ixDVqA7oWYuEz4lOSujeWyliPai4gfVDiFIcwBg3aGCPnmSGfzOKTK3ccPn0CKv3DBw==",
+ "dev": true,
+ "requires": {
+ "execa": "^0.10.0",
+ "lcid": "^2.0.0",
+ "mem": "^4.0.0"
+ }
+ },
+ "p-limit": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.0.0.tgz",
+ "integrity": "sha512-fl5s52lI5ahKCernzzIyAP0QAZbGIovtVHGwpcu1Jr/EpzLVDI2myISHwGqK7m8uQFugVWSrbxH7XnhGtvEc+A==",
+ "dev": true,
+ "requires": {
+ "p-try": "^2.0.0"
+ }
+ },
+ "p-locate": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz",
+ "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==",
+ "dev": true,
+ "requires": {
+ "p-limit": "^2.0.0"
+ }
+ },
+ "p-try": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.0.0.tgz",
+ "integrity": "sha512-hMp0onDKIajHfIkdRk3P4CdCmErkYAxxDtP3Wx/4nZ3aGlau2VKh3mZpcuFkH27WQkL/3WBCPOktzA9ZOAnMQQ==",
+ "dev": true
+ },
+ "string-width": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz",
+ "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==",
+ "dev": true,
+ "requires": {
+ "is-fullwidth-code-point": "^2.0.0",
+ "strip-ansi": "^4.0.0"
+ }
+ },
+ "strip-ansi": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz",
+ "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=",
+ "dev": true,
+ "requires": {
+ "ansi-regex": "^3.0.0"
+ }
+ },
+ "yargs": {
+ "version": "12.0.2",
+ "resolved": "https://registry.npmjs.org/yargs/-/yargs-12.0.2.tgz",
+ "integrity": "sha512-e7SkEx6N6SIZ5c5H22RTZae61qtn3PYUE8JYbBFlK9sYmh3DMQ6E5ygtaG/2BW0JZi4WGgTR2IV5ChqlqrDGVQ==",
+ "dev": true,
+ "requires": {
+ "cliui": "^4.0.0",
+ "decamelize": "^2.0.0",
+ "find-up": "^3.0.0",
+ "get-caller-file": "^1.0.1",
+ "os-locale": "^3.0.0",
+ "require-directory": "^2.1.1",
+ "require-main-filename": "^1.0.1",
+ "set-blocking": "^2.0.0",
+ "string-width": "^2.0.0",
+ "which-module": "^2.0.0",
+ "y18n": "^3.2.1 || ^4.0.0",
+ "yargs-parser": "^10.1.0"
+ }
+ }
+ }
+ },
+ "webpack-sources": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-1.3.0.tgz",
+ "integrity": "sha512-OiVgSrbGu7NEnEvQJJgdSFPl2qWKkWq5lHMhgiToIiN9w34EBnjYzSYs+VbL5KoYiLNtFFa7BZIKxRED3I32pA==",
+ "dev": true,
+ "requires": {
+ "source-list-map": "^2.0.0",
+ "source-map": "~0.6.1"
+ },
+ "dependencies": {
+ "source-map": {
+ "version": "0.6.1",
+ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
+ "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
+ "dev": true
+ }
+ }
+ },
"websocket-driver": {
"version": "0.7.0",
"resolved": "https://registry.npmjs.org/websocket-driver/-/websocket-driver-0.7.0.tgz",
@@ -6935,11 +8693,35 @@
"resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-3.0.0.tgz",
"integrity": "sha512-9GSJUgz1D4MfyKU7KRqwOjXCXTqWdFNvEr7eUBYchQiVc744mqK/MzXPNR2WsPkmkOa4ywfg8C2n8h+13Bey1Q=="
},
+ "which": {
+ "version": "1.3.1",
+ "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz",
+ "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==",
+ "dev": true,
+ "requires": {
+ "isexe": "^2.0.0"
+ }
+ },
+ "which-module": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz",
+ "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=",
+ "dev": true
+ },
"window-size": {
"version": "0.1.4",
"resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.4.tgz",
"integrity": "sha1-+OGqHuWlPsW/FR/6CXQqatdpeHY="
},
+ "worker-farm": {
+ "version": "1.6.0",
+ "resolved": "https://registry.npmjs.org/worker-farm/-/worker-farm-1.6.0.tgz",
+ "integrity": "sha512-6w+3tHbM87WnSWnENBUvA2pxJPLhQUg5LKwUQHq3r+XPhIM+Gh2R5ycbwPCyuGbNg+lPgdcnQUhuC02kJCvffQ==",
+ "dev": true,
+ "requires": {
+ "errno": "~0.1.7"
+ }
+ },
"wrap-ansi": {
"version": "2.1.0",
"resolved": "http://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz",
@@ -6959,11 +8741,29 @@
"resolved": "https://registry.npmjs.org/xmlhttprequest/-/xmlhttprequest-1.8.0.tgz",
"integrity": "sha1-Z/4HXFwk/vOfnWX197f+dRcZaPw="
},
+ "xregexp": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/xregexp/-/xregexp-4.0.0.tgz",
+ "integrity": "sha512-PHyM+sQouu7xspQQwELlGwwd05mXUFqwFYfqPO0cC7x4fxyHnnuetmQr6CjJiafIDoH4MogHb9dOoJzR/Y4rFg==",
+ "dev": true
+ },
+ "xtend": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz",
+ "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=",
+ "dev": true
+ },
"y18n": {
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz",
"integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE="
},
+ "yallist": {
+ "version": "2.1.2",
+ "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz",
+ "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=",
+ "dev": true
+ },
"yargs": {
"version": "3.32.0",
"resolved": "http://registry.npmjs.org/yargs/-/yargs-3.32.0.tgz",
@@ -6977,6 +8777,23 @@
"window-size": "^0.1.4",
"y18n": "^3.2.0"
}
+ },
+ "yargs-parser": {
+ "version": "10.1.0",
+ "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-10.1.0.tgz",
+ "integrity": "sha512-VCIyR1wJoEBZUqk5PA+oOBF6ypbwh5aNB3I50guxAL/quggdfs4TtNHQrSazFA3fYZ+tEqfs0zIGlv0c/rgjbQ==",
+ "dev": true,
+ "requires": {
+ "camelcase": "^4.1.0"
+ },
+ "dependencies": {
+ "camelcase": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz",
+ "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=",
+ "dev": true
+ }
+ }
}
}
}
diff --git a/package.json b/package.json
index 13ee88bd..2aeada26 100644
--- a/package.json
+++ b/package.json
@@ -1,29 +1,37 @@
{
"name": "tinode-webapp",
"description": "Tinode messenger for the web",
- "version": "0.15.8",
+ "version": "0.15.9-rc1",
"devDependencies": {
- "babel-cli": "^6.26.0",
- "babel-preset-env": "^1.7.0",
- "babel-preset-react": "^6.24.1",
+ "@babel/core": "^7.1.2",
+ "@babel/preset-env": "^7.1.0",
+ "@babel/preset-react": "^7.0.0",
+ "babel-loader": "^8.0.4",
+ "babel-plugin-react-intl": "^3.0.1",
+ "browserslist": "^4.3.3",
"cssnano": "^4.0.5",
- "uglify-es": "^3.3.9"
+ "webpack": "^4.23.1",
+ "webpack-cli": "^3.1.2"
},
"repository": {
"type": "git",
"url": "https://github.com/tinode/example-react-js.git"
},
"scripts": {
- "build": "npm run vers && npm run build:babel && npm run build:prod && npm run build:dev && npm run build:css",
- "build:prod": "browserify ./src/index.js --standalone Webapp | uglifyjs --compress --mangle > ./umd/index.prod.js",
- "build:dev": "browserify ./src/index.js --standalone Webapp > ./umd/index.dev.js",
- "build:babel": "babel ./src/webapp.jsx --presets react,env --out-file ./src/webapp.es5.js",
+ "build": "npm run vers && npm run build:prod && npm run build:dev && npm run build:css && npm run build:i18n",
"build:css": "postcss css/base.css > css/base.min.css",
- "vers": "echo \"{\\\"version\\\": \\\"`node -p -e \"require('./package.json').version\"`\\\"}\" > version.json"
+ "build:dev": "webpack --mode development --output ./umd/index.dev.js",
+ "build:prod": "webpack --mode production --output ./umd/index.prod.js",
+ "build:i18n": "node scripts/flatten-messages.js",
+ "vers": "node scripts/gen-version.js"
},
"files": [
"src/index.js",
- "src/webapp.jsx",
+ "src/config.js",
+ "src/views/*.jsx",
+ "src/widgets/*.jsx",
+ "src/lib/*.js",
+ "src/i18n/*.json",
"umd/index.prod.js",
"umd/index.dev.js",
"audio/msg.mp3",
@@ -38,8 +46,6 @@
"img/badge96.png",
"index-dev.html",
"index.html",
- "index.js",
- "index.min.js",
"manifest.json",
"service-worker.js",
"firebase-init.js",
@@ -69,6 +75,7 @@
"firebase": "^5.5.5",
"react": "^16.5.2",
"react-dom": "^16.5.2",
- "tinode-sdk": "^0.15.8"
+ "react-intl": "^2.7.1",
+ "tinode-sdk": "^0.15.8-rc1"
}
}
diff --git a/scripts/flatten-messages.js b/scripts/flatten-messages.js
new file mode 100644
index 00000000..8c3933f5
--- /dev/null
+++ b/scripts/flatten-messages.js
@@ -0,0 +1,97 @@
+// 1.Flattens messages extracted via the React Intl Babel plugin. An error will be
+// thrown if there are messages with the same `id`. The result is a file containing
+// `id: message` pairs in "en" locale.
+//
+// 2. Takes all translations and groups them into a single file.
+var fs = require('fs');
+var path = require('path');
+var globSync = require('glob').sync;
+var mkdirpSync = require('mkdirp').sync;
+
+const DEFAULT_TRANSLATION = 'en.json';
+const MESSAGES_PATTERN = './src/i18n/src/**/*.json';
+const LANG_DIR = './src/i18n/';
+const LANG_PATTERN = './src/i18n/*.json';
+const FINAL_FILE = './src/messages.json';
+
+const MISSING_MARKER = ':!![MISSING]!!:';
+const OBSOLETE_MARKER = ':!![OBSOLETE]!!:';
+
+// The react-intl-babel-plugin saves extracted messages
+// into files, one fine per component. Rewrite them into
+// a single file en.json.
+let messages = globSync(MESSAGES_PATTERN)
+ .map((filename) => fs.readFileSync(filename, 'utf8'))
+ .map((file) => JSON.parse(file))
+ .reduce((collection, descriptors) => {
+ descriptors.forEach(({id, defaultMessage}) => {
+ if (collection.hasOwnProperty(id)) {
+ throw new Error(`Duplicate message id: ${id}`);
+ }
+ collection[id] = defaultMessage;
+ });
+
+ return collection;
+ }, {});
+
+let filename = path.join(LANG_DIR, DEFAULT_TRANSLATION);
+mkdirpSync(path.dirname(filename));
+fs.writeFileSync(filename, JSON.stringify(messages, null, 2)+"\n");
+
+// Find messages present in en.json but missing in translations and vice versa.
+// Mark missing or obsolete messages as such in translation files.
+globSync(LANG_PATTERN)
+ .map((filename) => {
+ const parts = filename.split('/');
+ if (parts[parts.length-1] != DEFAULT_TRANSLATION) {
+ const translated = JSON.parse(fs.readFileSync(filename, 'utf8'));
+ // Find missing messages.
+ Object.entries(messages).forEach((ent) => {
+ if (!translated.hasOwnProperty(ent[0])) {
+ translated[ent[0]] = MISSING_MARKER + ent[1];
+ }
+ });
+ // Find no longer needed messages.
+ Object.entries(translated).forEach((ent) => {
+ if (!messages.hasOwnProperty(ent[0])) {
+ let val = translated[ent[0]];
+ if (val.indexOf(MISSING_MARKER) == 0) {
+ val = val.substring(0, MISSING_MARKER.length);
+ }
+ if (val.indexOf(OBSOLETE_MARKER) != 0) {
+ val = OBSOLETE_MARKER + val;
+ }
+ translated[ent[0]] = val;
+ }
+ });
+ fs.writeFileSync(filename, JSON.stringify(translated, null, 2)+"\n");
+ }
+ });
+
+// Combine all translations into a single json {"lang_1": {...}, "lang_2: {...}"}
+// while removing messages marked as missing or obsolete.
+
+// Read all translations.
+messages = globSync(LANG_PATTERN)
+ .map((filename) => {
+ const parts = filename.split('/');
+ const locale = parts[parts.length - 1].split('.json')[0];
+ const translated = JSON.parse(fs.readFileSync(filename, 'utf8'));
+
+ // Strip messages prefixed with MISSING or OBSOLETE markers.
+ for (let id in translated) {
+ if (translated[id].indexOf(OBSOLETE_MARKER) == 0 ||
+ translated[id].indexOf(MISSING_MARKER) == 0) {
+ delete translated[id];
+ }
+ }
+
+ return { [locale]: translated };
+ })
+ .reduce((collection, descriptors) => {
+ return { ...collection, ...descriptors };
+ }, {});
+
+// Write file with all translations combined.
+mkdirpSync(path.dirname(FINAL_FILE));
+fs.writeFileSync(FINAL_FILE, JSON.stringify(messages, null, 2)+"\n");
diff --git a/scripts/gen-version.js b/scripts/gen-version.js
new file mode 100644
index 00000000..b5fdcf91
--- /dev/null
+++ b/scripts/gen-version.js
@@ -0,0 +1,13 @@
+var fs = require('fs');
+var version = require('../package.json').version;
+
+fs.writeFile('./src/version.js',
+ '// This is a generated file. Don\'t edit.\n\n'+
+ 'export const PACKAGE_VERSION = "'+version+'";\n',
+ { flag: 'w' },
+ function(err) {
+ if (err) {
+ return console.log(err);
+ }
+ }
+);
diff --git a/service-worker.js b/service-worker.js
index 561c84e4..7a736a02 100644
--- a/service-worker.js
+++ b/service-worker.js
@@ -1,7 +1,7 @@
// Must be located at the root.
-importScripts("https://unpkg.com/firebase@5.5.5/firebase-app.js");
-importScripts("https://unpkg.com/firebase@5.5.5/firebase-messaging.js");
-importScripts("/firebase-init.js")
+importScripts('https://unpkg.com/firebase@5.5.6/firebase-app.js');
+importScripts('https://unpkg.com/firebase@5.5.6/firebase-messaging.js');
+importScripts('firebase-init.js');
firebase.initializeApp(FIREBASE_INIT);
@@ -67,3 +67,19 @@ self.addEventListener('notificationclick', function(event) {
event.waitUntil(promises);
});
+
+// This is needed for 'Add to Home Screen'.
+self.addEventListener('fetch', function(event) {
+ event.respondWith(
+ // Try to find response in cache.
+ caches.match(event.request)
+ .then((resp) => {
+ // If response is found in cache, return it. Otherwise fetch.
+ return resp || fetch(event.request);
+ })
+ .catch((err) => {
+ // Something went wrong.
+ console.log("Service worker Fetch: ", err);
+ })
+ );
+});
diff --git a/src/config.js b/src/config.js
new file mode 100644
index 00000000..be09bc00
--- /dev/null
+++ b/src/config.js
@@ -0,0 +1,52 @@
+import { PACKAGE_VERSION } from './version.js';
+
+// Name of this application, used in the User-Agent.
+export const APP_NAME = 'TinodeWeb/' + (PACKAGE_VERSION || '0.15');
+
+// API key. Use https://github.com/tinode/chat/tree/master/keygen to generate your own
+export const API_KEY = 'AQEAAAABAAD_rAp4DJh05a1HAwFT3A6K';
+
+// The array of possible hosts to connect to.
+export const KNOWN_HOSTS = {hosted: 'api.tinode.co', local: 'localhost:6060'};
+
+// Default host name and port to connect to.
+export const DEFAULT_HOST = KNOWN_HOSTS.hosted;
+
+// Minimum time between two keypress notifications, milliseconds.
+export const KEYPRESS_DELAY = 3*1000;
+// Delay before sending a {note} for reciving a message, milliseconds.
+export const RECEIVED_DELAY = 500;
+// Delay before sending a read notification, milliseconds.
+export const READ_DELAY = 1000;
+
+// The shortest allowed tag length. Matches the value on the server.
+export const MIN_TAG_LENGTH = 4;
+
+// Mediaquery breakpoint between desktop and mobile, in px. Should match the value
+// in @media (max-size: 640px) in base.css
+export const MEDIA_BREAKPOINT = 640;
+// Size of css 'rem' unit in pixels. Default 1rem = 10pt = 13px.
+export const REM_SIZE = 13;
+
+// Size of the avatar image: When an avatar image is uploaded, it's resized to
+// a square of this size.
+export const AVATAR_SIZE = 128;
+
+// Number of chat messages to fetch in one call.
+export const MESSAGES_PAGE = 24;
+
+// Maximum in-band (included directly into the message) attachment size which fits into
+// a message of 256K in size, assuming base64 encoding and 1024 bytes of overhead.
+// This is size of an object *before* base64 encoding is applied.
+// Increase this limit to a greater value in production, if desired. Also increase
+// max_message_size in server config.
+// MAX_INBAND_ATTACHMENT_SIZE = base64DecodedLen(max_message_size - overhead);
+export const MAX_INBAND_ATTACHMENT_SIZE = 195840;
+
+// Absolute maximum attachment size to be used with the server = 8MB. Increase to
+// something like 100MB in production.
+export const MAX_EXTERN_ATTACHMENT_SIZE = 1 << 23;
+
+// Maximum allowed linear dimension of an inline image in pixels. You may want
+// to adjust it to 1600 or 2400 for production.
+export const MAX_IMAGE_DIM = 768;
diff --git a/src/i18n/en.json b/src/i18n/en.json
new file mode 100644
index 00000000..20478240
--- /dev/null
+++ b/src/i18n/en.json
@@ -0,0 +1,121 @@
+{
+ "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"
+}
diff --git a/src/i18n/ru.json b/src/i18n/ru.json
new file mode 100644
index 00000000..4dc60fc2
--- /dev/null
+++ b/src/i18n/ru.json
@@ -0,0 +1,121 @@
+{
+ "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": "влад."
+}
diff --git a/src/index.js b/src/index.js
index db5416dd..53e3b870 100644
--- a/src/index.js
+++ b/src/index.js
@@ -1,11 +1,34 @@
// Put all packages together.
// Used to generate umd/index.prod.js
-var React = require('react');
-var ReactDOM = require('react-dom');
-var TinodeWeb = require('./webapp.es5.js');
+import React from 'react';
+import ReactDOM from 'react-dom';
+import { IntlProvider, addLocaleData } from 'react-intl';
+import ruData from 'react-intl/locale-data/ru';
+addLocaleData(ruData);
+import allMessages from './messages.json';
+
+import TinodeWeb from './views/tinode-web.jsx';
+
+import HashNavigation from './lib/navigation.js';
+
+const {params} = HashNavigation.parseUrlHash(window.location.hash);
+const language = (params && params.hl) ||
+ (navigator.languages && navigator.languages[0]) ||
+ navigator.language ||
+ navigator.userLanguage;
+
+const baseLanguage = language.toLowerCase().split(/[-_]+/)[0];
+
+// Try full locale, try locale without region code, fallback to 'en'
+const messages =
+ allMessages[language] ||
+ allMessages[baseLanguage] ||
+ allMessages.en;
ReactDOM.render(
- React.createElement(TinodeWeb, null),
+
+
+ ,
document.getElementById('mountPoint')
);
diff --git a/src/lib/blob-helpers.js b/src/lib/blob-helpers.js
new file mode 100644
index 00000000..545f8a6b
--- /dev/null
+++ b/src/lib/blob-helpers.js
@@ -0,0 +1,213 @@
+// File and image helper functions.
+import { MAX_INBAND_ATTACHMENT_SIZE, MAX_IMAGE_DIM } from '../config.js';
+
+// Supported image MIME types and corresponding file extensions.
+export const SUPPORTED_IMAGE_FORMATS = ['image/jpeg', 'image/gif', 'image/png', 'image/svg', 'image/svg+xml'];
+export const MIME_EXTENSIONS = ['jpg', 'gif', 'png', 'svg', 'svg'];
+
+// Make a data URL from public.photo
+export function makeImageUrl(photo) {
+ return (photo && photo.type && photo.data) ?
+ 'data:image/' + photo.type + ';base64,' + photo.data : null;
+}
+
+// Calculate linear dimensions for scaling image down to fit under a certain size.
+// Returns an object which contains destination sizes, source sizes, and offsets
+// into source (when making square images).
+export function fitImageSize(width, height, maxWidth, maxHeight, forceSquare) {
+ if (!width || !height || !maxWidth || !maxHeight) {
+ return null;
+ }
+
+ if (forceSquare) {
+ maxWidth = maxHeight = Math.min(maxWidth, maxHeight);
+ }
+
+ let scale = Math.min(
+ Math.min(width, maxWidth) / width,
+ Math.min(height, maxHeight) / height
+ );
+
+ let size = {
+ dstWidth: (width * scale) | 0,
+ dstHeight: (height * scale) | 0,
+ };
+
+ if (forceSquare) {
+ // Also calculate parameters for making the image square.
+ size.dstWidth = size.dstHeight = Math.min(size.dstWidth, size.dstHeight);
+ size.srcWidth = size.srcHeight = Math.min(width, height);
+ size.xoffset = ((width - size.srcWidth) / 2) | 0;
+ size.yoffset = ((height - size.srcWidth) / 2) | 0;
+ } else {
+ size.xoffset = size.yoffset = 0;
+ size.srcWidth = width;
+ size.srcHeight = height;
+ }
+ return size;
+}
+
+// Ensure file's extension matches mime content type
+export function fileNameForMime(fname, mime) {
+ var idx = SUPPORTED_IMAGE_FORMATS.indexOf(mime);
+ var ext = MIME_EXTENSIONS[idx];
+
+ var at = fname.lastIndexOf('.');
+ if (at >= 0) {
+ fname = fname.substring(0, at);
+ }
+ return fname + '.' + ext;
+}
+
+// Convert uploaded image into a base64-encoded string possibly scaling
+// linear dimensions or constraining to a square.
+export function imageFileScaledToBase64(file, width, height, forceSquare, onSuccess, onError) {
+ var img = new Image();
+ img.crossOrigin = 'Anonymous';
+ img.onerror = function(err) {
+ onError("Image format unrecognized");
+ }
+ img.onload = function() {
+ var dim = fitImageSize(this.width, this.height, width, height, forceSquare);
+ if (!dim) {
+ onError("Invalid image");
+ return;
+ }
+ var canvas = document.createElement('canvas');
+ canvas.width = dim.dstWidth;
+ canvas.height = dim.dstHeight;
+ var ctx = canvas.getContext('2d');
+ ctx.imageSmoothingEnabled = true;
+ ctx.drawImage(this, dim.xoffset, dim.yoffset, dim.srcWidth, dim.srcHeight,
+ 0, 0, dim.dstWidth, dim.dstHeight);
+
+ var mime = (this.width != dim.dstWidth ||
+ this.height != dim.dstHeight ||
+ SUPPORTED_IMAGE_FORMATS.indexOf(file.type) < 0) ? 'image/jpeg' : file.type;
+ var imageBits = canvas.toDataURL(mime);
+ var parts = imageBits.split(',');
+ // Get actual image type: 'data:image/png;base64,'
+ mime = getMimeType(parts[0]);
+ if (!mime) {
+ onError("Unsupported image format");
+ return;
+ }
+ // Ensure the image is not too large
+ var quality = 0.78;
+ if (base64DecodedLen(imageBits.length) > MAX_INBAND_ATTACHMENT_SIZE) {
+ mime = 'image/jpeg';
+ }
+ if (mime == 'image/jpeg') {
+ // Reduce size of the jpeg by reducing image quality
+ while (base64DecodedLen(imageBits.length) > MAX_INBAND_ATTACHMENT_SIZE && quality > 0.45) {
+ imageBits = canvas.toDataURL(mime, quality);
+ quality *= 0.84;
+ }
+ }
+ if (base64DecodedLen(imageBits.length) > MAX_INBAND_ATTACHMENT_SIZE) {
+ onError("The image size " + bytesToHumanSize(base64DecodedLen(imageBits.length)) +
+ " exceeds the " + bytesToHumanSize(MAX_INBAND_ATTACHMENT_SIZE) + " limit.", "err");
+ return;
+ }
+ canvas = null;
+ onSuccess(imageBits.split(',')[1], mime, dim.dstWidth, dim.dstHeight, fileNameForMime(file.name, mime));
+ };
+ img.src = URL.createObjectURL(file);
+}
+
+// Convert uploaded image file to base64-encoded string without scaling/converting the image
+export function imageFileToBase64(file, onSuccess, onError) {
+ var reader = new FileReader();
+ reader.addEventListener('load', function() {
+ var parts = reader.result.split(',');
+ var mime = getMimeType(parts[0]);
+ if (!mime) {
+ onError("Failed to process image file");
+ return;
+ }
+
+ // Get image size.
+ var img = new Image();
+ img.crossOrigin = 'Anonymous';
+ img.onload = function() {
+ onSuccess(parts[1], mime, this.width, this.height, fileNameForMime(file.name, mime));
+ }
+ img.onerror = function(err) {
+ onError("Image format not recognized");
+ }
+ img.src = URL.createObjectURL(file);
+ }, false);
+ reader.readAsDataURL(file);
+}
+
+export function fileToBase64(file, onSuccess, onError) {
+ var reader = new FileReader();
+ reader.addEventListener('load', function() {
+ onSuccess(file.type, reader.result.split(',')[1], file.name);
+ });
+ reader.readAsDataURL(file);
+}
+
+// File pasted from the clipboard. It's either an inline image or a file attachment.
+// FIXME: handle large files out of band.
+export function filePasted(event, onImageSuccess, onAttachmentSuccess, onError) {
+ var items = (event.clipboardData || event.originalEvent.clipboardData || {}).items;
+ for (var i in items) {
+ var item = items[i];
+ if (item.kind === 'file') {
+ var file = item.getAsFile();
+ if (!file) {
+ console.log("Failed to get file object from pasted file item", item.kind, item.type);
+ continue;
+ }
+ if (file.type && file.type.split('/')[0] == 'image') {
+ // Handle inline image
+ if (file.size > MAX_INBAND_ATTACHMENT_SIZE || SUPPORTED_IMAGE_FORMATS.indexOf(file.type) < 0) {
+ imageFileScaledToBase64(file, MAX_IMAGE_DIM, MAX_IMAGE_DIM, false, onImageSuccess, onError);
+ } else {
+ imageFileToBase64(file, onImageSuccess, onError);
+ }
+ } else {
+ // Handle file attachment
+ fileToBase64(file, onAttachmentSuccess, onError)
+ }
+ // Indicate that the pasted data contains a file.
+ return true;
+ }
+ }
+ // No file found.
+ return false;
+}
+
+// Get mime type from data URL header.
+export function getMimeType(header) {
+ var mime = /^data:(image\/[-+a-z0-9.]+);base64/.exec(header);
+ return (mime && mime.length > 1) ? mime[1] : null;
+}
+
+// Given length of a binary object in bytes, calculate the length after
+// base64 encoding.
+export function base64EncodedLen(n) {
+ return Math.floor((n + 2) / 3) * 4;
+}
+
+// Given length of a base64-encoded object, calculate decoded size of the
+// pbject in bytes.
+export function base64DecodedLen(n) {
+ return Math.floor(n / 4) * 3;
+}
+
+// Re-encode string to standard base64 encoding with padding.
+// The string may be base64-URL encoded without the padding.
+export function base64ReEncode(str) {
+ if (str) {
+ str = str.replace('-', '+').replace('_', '/');
+ try {
+ str = btoa(atob(str));
+ } catch(err) {
+ console.log("Failed to base64 re-encode string");
+ str = null;
+ }
+ }
+ return str;
+}
diff --git a/src/lib/host-name.js b/src/lib/host-name.js
new file mode 100644
index 00000000..294887fc
--- /dev/null
+++ b/src/lib/host-name.js
@@ -0,0 +1,29 @@
+import { KNOWN_HOSTS, DEFAULT_HOST } from '../config.js';
+
+// Detect server address from the URL
+export function detectServerAddress() {
+ let host = DEFAULT_HOST;
+ if (typeof window.location == 'object') {
+ if (window.location.protocol == 'file:' || window.location.hostname == 'localhost') {
+ host = KNOWN_HOSTS.local;
+ } else if (window.location.hostname) {
+ host = window.location.hostname + (window.location.port ? ':' + window.location.port : '');
+ }
+ }
+ return host;
+}
+
+// Detect if the page is served over HTTPS.
+export function isSecureConnection() {
+ if (typeof window.location == 'object') {
+ return window.location.protocol == 'https:';
+ }
+ return false;
+}
+
+export function isLocalHost() {
+ if (typeof window.location == 'object') {
+ return window.location.hostname == 'localhost';
+ }
+ return false;
+}
diff --git a/src/lib/local-storage.js b/src/lib/local-storage.js
new file mode 100644
index 00000000..3c32aa94
--- /dev/null
+++ b/src/lib/local-storage.js
@@ -0,0 +1,26 @@
+// Helper functions for storing values in localStorage.
+// By default localStorage can store only strings, not objects or other types.
+
+export default class LocalStorageUtil {
+ // Replace old object with the new one.
+ static setObject(key, value) {
+ localStorage.setItem(key, JSON.stringify(value));
+ }
+
+ // Get stored object.
+ static getObject(key) {
+ let value = localStorage.getItem(key);
+ return value && JSON.parse(value);
+ }
+
+ // Partially or wholly update stored object.
+ static updateObject(key, value) {
+ let oldVal = this.getObject(key);
+ this.setObject(key, Object.assign(oldVal || {}, value));
+ }
+
+ // Just a wrapper.
+ static removeItem(key) {
+ localStorage.removeItem(key);
+ }
+}
diff --git a/src/lib/navigation.js b/src/lib/navigation.js
new file mode 100644
index 00000000..4411763a
--- /dev/null
+++ b/src/lib/navigation.js
@@ -0,0 +1,68 @@
+// Utility class for hash navigation.
+
+// Parse hash as in http://www.example.com/path#hash as if it were
+// path and arguments.
+export default class HashNavigation {
+ static parseUrlHash(hash) {
+ // Split path from args, path -> parts[0], args->path[1]
+ let parts = hash.split('?', 2);
+ let params = {};
+ let path = [];
+ if (parts[0]) {
+ path = parts[0].substr(1).split('/');
+ }
+ if (parts[1]) {
+ parts[1].split('&').forEach(function(part) {
+ let item = part.split('=');
+ if (item[0]) {
+ params[decodeURIComponent(item[0])] = decodeURIComponent(item[1]);
+ }
+ });
+ }
+ return {path: path, params: params};
+ }
+
+ static navigateTo(url) {
+ window.location.hash = url;
+ }
+
+ static composeUrlHash(path, params) {
+ var url = path.join('/');
+ var args = [];
+ for (var key in params) {
+ if (params.hasOwnProperty(key)) {
+ args.push(key + '=' + params[key]);
+ }
+ }
+ if (args.length > 0) {
+ url += '?' + args.join('&');
+ }
+ return url;
+ }
+
+ static addUrlParam(hash, key, value) {
+ var parsed = this.parseUrlHash(hash);
+ parsed.params[key] = value;
+ return this.composeUrlHash(parsed.path, parsed.params);
+ }
+
+ static removeUrlParam(hash, key) {
+ var parsed = this.parseUrlHash(hash);
+ delete parsed.params[key];
+ return this.composeUrlHash(parsed.path, parsed.params);
+ }
+
+ static setUrlSidePanel(hash, sidepanel) {
+ var parsed = this.parseUrlHash(hash);
+ parsed.path[0] = sidepanel;
+ return this.composeUrlHash(parsed.path, parsed.params);
+ }
+
+ static setUrlTopic(hash, topic) {
+ var parsed = this.parseUrlHash(hash);
+ parsed.path[1] = topic;
+ // Close InfoView on topic change.
+ delete parsed.params.info;
+ return this.composeUrlHash(parsed.path, parsed.params);
+ }
+}
diff --git a/src/lib/strformat.js b/src/lib/strformat.js
new file mode 100644
index 00000000..933ff18c
--- /dev/null
+++ b/src/lib/strformat.js
@@ -0,0 +1,40 @@
+// Short representation of time in the past.
+export function shortDateFormat(then) {
+ var locale = window.navigator.userLanguage || window.navigator.language;
+ var now = new Date();
+ if (then.getFullYear() == now.getFullYear()) {
+ if (then.getMonth() == now.getMonth() && then.getDate() == now.getDate()) {
+ return then.toLocaleTimeString(locale, {hour12: false, hour: '2-digit', minute: '2-digit'});
+ } else {
+ return then.toLocaleDateString(locale,
+ {hour12: false, month: 'short', day: 'numeric', hour: '2-digit', minute: '2-digit'});
+ }
+ }
+ return then.toLocaleDateString(locale,
+ {hour12: false, year: 'numeric', month: 'short', day: 'numeric', hour: '2-digit', minute: '2-digit'});
+}
+
+// Convert a number of bytes to human-readable format.
+export function bytesToHumanSize(bytes) {
+ if (!bytes || bytes == 0) {
+ return '0 Bytes';
+ }
+
+ var sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB'];
+ var bucket = Math.min(Math.floor(Math.log2(bytes) / 10) | 0, sizes.length-1);
+ var count = bytes / Math.pow(1024, bucket);
+ var round = bucket > 0 ? (count < 3 ? 2 : (count < 30 ? 1 : 0)) : 0;
+ return count.toFixed(round) + ' ' + sizes[bucket];
+}
+
+// Get 32 bit integer hash value for a string. Ideally it should produce the same value
+// as Java's String#hash().
+export function stringHash(value) {
+ var hash = 0;
+ value = '' + value;
+ for (var i = 0; i < value.length; i++) {
+ hash = ((hash << 5) - hash) + value.charCodeAt(i);
+ hash = hash & hash; // Convert to 32bit integer
+ }
+ return hash;
+}
diff --git a/src/lib/utils.js b/src/lib/utils.js
new file mode 100644
index 00000000..f513ced6
--- /dev/null
+++ b/src/lib/utils.js
@@ -0,0 +1,54 @@
+// Odds and ends
+
+// Make shortcut icon appear with a green dot + show unread count in title.
+export function updateFavicon(count) {
+ var oldIcon = document.getElementById('shortcut-icon');
+ if (oldIcon) {
+ var head = document.head || document.getElementsByTagName('head')[0];
+ var newIcon = document.createElement('link');
+ newIcon.type = 'image/png';
+ newIcon.id = 'shortcut-icon';
+ newIcon.rel = 'shortcut icon';
+ newIcon.href = 'img/logo32x32' + (count > 0 ? 'a' : '') + '.png';
+ head.removeChild(oldIcon);
+ head.appendChild(newIcon);
+ }
+ document.title = (count > 0 ? '('+count+') ' : '') + 'Tinode';
+}
+
+// Create VCard which represents topic 'public' info
+export function vcard(fn, imageDataUrl) {
+ var card = null;
+
+ if ((fn && fn.trim()) || imageDataUrl) {
+ card = {};
+ if (fn) {
+ card.fn = fn.trim();
+ }
+ if (imageDataUrl) {
+ var dataStart = imageDataUrl.indexOf(',');
+ card.photo = {
+ data: imageDataUrl.substring(dataStart+1),
+ type: 'jpg'
+ };
+ }
+ }
+ return card;
+}
+
+// Deep-shallow compare two arrays: shallow compare each element.
+export function arrayEqual(a, b) {
+ // Compare lengths first.
+ if (a.length != b.length) {
+ return false;
+ }
+ // Order of elements is ignored.
+ a.sort();
+ b.sort();
+ for (var i = 0, l = a.length; i < l; i++) {
+ if (a[i] !== b[i]) {
+ return false;
+ }
+ }
+ return true;
+}
diff --git a/src/messages.json b/src/messages.json
new file mode 100644
index 00000000..acdb87b9
--- /dev/null
+++ b/src/messages.json
@@ -0,0 +1,244 @@
+{
+ "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": "влад."
+ }
+}
diff --git a/src/version.js b/src/version.js
new file mode 100644
index 00000000..4d97f3da
--- /dev/null
+++ b/src/version.js
@@ -0,0 +1,3 @@
+// This is a generated file. Don't edit.
+
+export const PACKAGE_VERSION = "0.15.9-rc1";
diff --git a/src/views/contacts-view.jsx b/src/views/contacts-view.jsx
new file mode 100644
index 00000000..92e92191
--- /dev/null
+++ b/src/views/contacts-view.jsx
@@ -0,0 +1,58 @@
+/* ContactsView holds all contacts-related stuff */
+import React from 'react';
+import { defineMessages, injectIntl } from 'react-intl';
+
+import ContactList from '../widgets/contact-list.jsx';
+
+import { updateFavicon } from '../lib/utils.js';
+
+// Panel titles for translation.
+const messages = defineMessages({
+ 'contacts_not_found': {
+ id: 'contacts_not_found',
+ description: 'HTML message shown in ContactList when no contacts are found',
+ defaultMessage: 'You have no chats ¯\\\\_(ツ)_/¯'
+ }
+});
+
+class ContactsView extends React.Component {
+ constructor(props) {
+ super(props);
+
+ this.state = ContactsView.getDerivedStateFromProps(props, {});
+ }
+
+ static getDerivedStateFromProps(nextProps, prevState) {
+ let contacts = [];
+ let unreadThreads = 0;
+ nextProps.chatList.map((c) => {
+ unreadThreads += c.unread > 0 ? 1 : 0;
+ contacts.push(c);
+ });
+ contacts.sort(function(a, b){
+ return (b.touched || 0) - (a.touched || 0);
+ });
+
+ updateFavicon(unreadThreads);
+
+ return {contactList: contacts};
+ }
+
+ render() {
+ const {formatHTMLMessage} = this.props.intl;
+ return (
+ {formatHTMLMessage(messages.contacts_not_found)}}
+ topicSelected={this.props.topicSelected}
+ myUserId={this.props.myUserId}
+ showOnline={true}
+ showUnread={true}
+ onTopicSelected={this.props.onTopicSelected}
+ showContextMenu={this.props.showContextMenu} />
+ );
+ }
+};
+
+export default injectIntl(ContactsView);
diff --git a/src/views/create-account-view.jsx b/src/views/create-account-view.jsx
new file mode 100644
index 00000000..c226db4b
--- /dev/null
+++ b/src/views/create-account-view.jsx
@@ -0,0 +1,125 @@
+// Account registration.
+import React from 'react';
+import { FormattedMessage } from 'react-intl';
+
+import AvatarUpload from '../widgets/avatar-upload.jsx';
+import CheckBox from '../widgets/checkbox.jsx';
+import VisiblePassword from '../widgets/visible-password.jsx';
+
+import LocalStorageUtil from '../lib/local-storage.js';
+import { vcard } from '../lib/utils.js';
+
+export default class CreateAccountView extends React.PureComponent {
+ constructor(props) {
+ super(props);
+
+ this.state = {
+ login: '',
+ password: '',
+ email: '',
+ fn: '', // full/formatted name
+ imageDataUrl: null,
+ errorCleared: false,
+ saveToken: LocalStorageUtil.getObject('keep-logged-in')
+ };
+
+ this.handleLoginChange = this.handleLoginChange.bind(this);
+ this.handlePasswordChange = this.handlePasswordChange.bind(this);
+ this.handleEmailChange = this.handleEmailChange.bind(this);
+ this.handleFnChange = this.handleFnChange.bind(this);
+ this.handleImageChanged = this.handleImageChanged.bind(this);
+ this.handleToggleSaveToken = this.handleToggleSaveToken.bind(this);
+ this.handleSubmit = this.handleSubmit.bind(this);
+ }
+
+ handleLoginChange(e) {
+ this.setState({login: e.target.value});
+ }
+
+ handlePasswordChange(password) {
+ this.setState({password: password});
+ }
+
+ handleEmailChange(e) {
+ this.setState({email: e.target.value})
+ }
+
+ handleFnChange(e) {
+ this.setState({fn: e.target.value});
+ }
+
+ handleImageChanged(img) {
+ this.setState({imageDataUrl: img});
+ }
+
+ handleToggleSaveToken() {
+ LocalStorageUtil.setObject('keep-logged-in', !this.state.saveToken);
+ this.setState({saveToken: !this.state.saveToken});
+ }
+
+ handleSubmit(e) {
+ e.preventDefault();
+ // TODO: check email for validity
+ this.setState({errorCleared: false});
+ this.props.onCreateAccount(
+ this.state.login.trim(),
+ this.state.password.trim(),
+ vcard(this.state.fn, this.state.imageDataUrl),
+ {'meth': 'email', 'val': this.state.email});
+ }
+
+ render() {
+ let submitClasses = 'blue';
+ if (this.props.disabled) {
+ submitClasses += ' disabled';
+ }
+
+ return (
+
+ );
+ }
+};
diff --git a/src/views/edit-account-view.jsx b/src/views/edit-account-view.jsx
new file mode 100644
index 00000000..94156e2d
--- /dev/null
+++ b/src/views/edit-account-view.jsx
@@ -0,0 +1,227 @@
+// Edit account parameters.
+import React from 'react';
+import { FormattedMessage } from 'react-intl';
+
+import AvatarUpload from '../widgets/avatar-upload.jsx';
+import CheckBox from '../widgets/checkbox.jsx';
+import InPlaceEdit from '../widgets/in-place-edit.jsx';
+import PermissionsEditor from '../widgets/permissions-editor.jsx';
+import TagManager from '../widgets/tag-manager.jsx';
+
+import { makeImageUrl } from '../lib/blob-helpers.js';
+
+export default class EditAccountView extends React.Component {
+ constructor(props) {
+ super(props);
+
+ let me = this.props.tinode.getMeTopic();
+ let defacs = me.getDefaultAccess();
+ let fnd = this.props.tinode.getFndTopic();
+ this.state = {
+ fullName: me.public ? me.public.fn : undefined,
+ avatar: makeImageUrl(me.public ? me.public.photo : null),
+ auth: defacs ? defacs.auth : null,
+ anon: defacs ? defacs.anon : null,
+ tags: fnd.tags(),
+ showPermissionEditorFor: undefined,
+ previousOnTags: fnd.onTagsUpdated
+ };
+
+ this.tnNewTags = this.tnNewTags.bind(this);
+ this.handleFullNameUpdate = this.handleFullNameUpdate.bind(this);
+ this.handlePasswordUpdate = this.handlePasswordUpdate.bind(this);
+ this.handleImageChanged = this.handleImageChanged.bind(this);
+ this.handleCheckboxClick = this.handleCheckboxClick.bind(this);
+ this.handleLaunchPermissionsEditor = this.handleLaunchPermissionsEditor.bind(this);
+ this.handleHidePermissionsEditor = this.handleHidePermissionsEditor.bind(this);
+ this.handlePermissionsChanged = this.handlePermissionsChanged.bind(this);
+ this.handleTagsUpdated = this.handleTagsUpdated.bind(this);
+ }
+
+ componentDidMount() {
+ let fnd = this.props.tinode.getFndTopic();
+ fnd.onTagsUpdated = this.tnNewTags;
+ if (!fnd.isSubscribed()) {
+ fnd.subscribe(fnd.startMetaQuery().withLaterDesc().withTags().build()).catch((err) => {
+ this.props.onError(err.message, 'err');
+ });
+ }
+ }
+
+ componentWillUnmount() {
+ var fnd = this.props.tinode.getFndTopic();
+ fnd.onTagsUpdated = this.state.previousOnTags;
+ }
+
+ tnNewTags(tags) {
+ this.setState({tags: tags});
+ }
+
+ handleFullNameUpdate(fn) {
+ this.setState({fullName: fn});
+ this.props.onUpdateAccount(undefined, vcard(fn, this.state.avatar));
+ }
+
+ handlePasswordUpdate(pwd) {
+ this.setState({password: pwd});
+ this.props.onUpdateAccount(pwd);
+ }
+
+ handleImageChanged(img) {
+ this.setState({avatar: img});
+ this.props.onUpdateAccount(undefined, vcard(this.state.fullName, img));
+ }
+
+ handleCheckboxClick(what, checked) {
+ if (what == 'sound') {
+ this.props.onToggleMessageSounds(checked);
+ } else if (what == 'alert') {
+ this.props.onTogglePushNotifications(checked);
+ }
+ }
+
+ handleLaunchPermissionsEditor(which) {
+ this.setState({
+ showPermissionEditorFor: which,
+ editedPermissions: this.state[which]
+ });
+ }
+
+ handleHidePermissionsEditor() {
+ this.setState({showPermissionEditorFor: undefined});
+ }
+
+ handlePermissionsChanged(perm) {
+ let defacs = {};
+ defacs[this.state.showPermissionEditorFor] = perm;
+ this.props.onUpdateAccount(undefined, undefined, defacs);
+
+ let newState = {showPermissionEditorFor: undefined};
+ newState[this.state.showPermissionEditorFor] = perm;
+ this.setState(newState);
+ }
+
+ handleTagsUpdated(tags) {
+ // Check if tags have actually changed.
+ if (arrayEqual(this.state.tags.slice(0), tags.slice(0))) {
+ return;
+ }
+ this.props.onUpdateTags(tags);
+ }
+
+ render() {
+ var tags = [];
+ this.state.tags.map(function(tag) {
+ tags.push({tag} );
+ });
+ if (tags.length == 0) {
+ tags = ;
+ }
+ return (
+ {this.state.showPermissionEditorFor ?
+
+ :
+
+
+
+
+
+
+
{
+ (full_name_placeholder) =>
+ }
+
+
+
+
+ {
+ (password_unchanged) =>
+ }
+
+
+
+
+
+
+
+
+ {this.props.myUserId}
+
+
+
+
+
+
+
+
Auth: {this.state.auth}
+
Anon: {this.state.anon}
+
+
+
+
+
+
+
+
+
+
+
+ {this.props.desktopAlertsEnabled ?
+
+ :
+
+ }
+
+
+
+
+
{
+ (title_tag_manager) =>
+ }
+
+
+
+ }
+ );
+ }
+};
diff --git a/src/views/info-view.jsx b/src/views/info-view.jsx
new file mode 100644
index 00000000..74854d03
--- /dev/null
+++ b/src/views/info-view.jsx
@@ -0,0 +1,636 @@
+// InfoView: panel with topic/user info.
+import React from 'react';
+import { FormattedMessage, defineMessages, injectIntl } from 'react-intl';
+
+import Tinode from 'tinode-sdk';
+
+import AvatarUpload from '../widgets/avatar-upload.jsx';
+import CheckBox from '../widgets/checkbox.jsx';
+import ContactList from '../widgets/contact-list.jsx';
+import GroupManager from '../widgets/group-manager.jsx';
+import InPlaceEdit from '../widgets/in-place-edit.jsx';
+import MenuCancel from '../widgets/menu-cancel.jsx';
+import MoreButton from '../widgets/more-button.jsx';
+import PermissionsEditor from '../widgets/permissions-editor.jsx';
+import TagManager from '../widgets/tag-manager.jsx';
+
+import { makeImageUrl } from '../lib/blob-helpers.js';
+
+const messages = defineMessages({
+ requested: {
+ id: 'requested_permissions',
+ defaultMessage: 'Requested',
+ description: 'Title for permissions'
+ },
+ granted: {
+ id: 'granted_permissions',
+ defaultMessage: 'Granted',
+ description: 'Title for permissions'
+ },
+ edit_permissions: {
+ id: 'menu_item_edit_permissions',
+ defaultMessage: 'Edit permissions',
+ description: 'Menu item [Edit permissions]'
+ },
+ other_user: {
+ id: 'label_other_user',
+ defaultMessage: 'Other',
+ description: 'Label for the other user when the user is unnamed'
+ }
+});
+
+class InfoView extends React.Component {
+ constructor(props) {
+ super(props);
+
+ this.state = {
+ topic: null,
+ owner: false,
+ admin: false,
+ sharer: false,
+ muted: false,
+ address: null,
+ groupTopic: undefined,
+ fullName: undefined,
+ avatar: null,
+ private: null,
+ selectedContact: null,
+ access: null,
+ modeGiven: null,
+ modeWant: null,
+ modeGiven2: null, // P2P topic, the other user mode given
+ modeWant2: null, // P2P topic, the other user mode want
+ auth: null,
+ anon: null,
+ contactList: [],
+ tags: [],
+ showMemberPanel: false,
+ showPermissionEditorFor: undefined,
+ moreInfoExpanded: false,
+ previousMetaDesc: undefined,
+ previousSubsUpdated: undefined,
+ previousTagsUpdated: undefined
+ };
+
+ this.resetSubs = this.resetSubs.bind(this);
+ this.resetDesc = this.resetDesc.bind(this);
+ this.onMetaDesc = this.onMetaDesc.bind(this);
+ this.onSubsUpdated = this.onSubsUpdated.bind(this);
+ this.onTagsUpdated = this.onTagsUpdated.bind(this);
+ this.handleFullNameUpdate = this.handleFullNameUpdate.bind(this);
+ this.handlePrivateUpdate = this.handlePrivateUpdate.bind(this);
+ this.handleImageChanged = this.handleImageChanged.bind(this);
+ this.handleMuted = this.handleMuted.bind(this);
+ this.handlePermissionsChanged = this.handlePermissionsChanged.bind(this);
+ this.handleLaunchPermissionsEditor = this.handleLaunchPermissionsEditor.bind(this);
+ this.handleHidePermissionsEditor = this.handleHidePermissionsEditor.bind(this);
+ this.handleShowAddMembers = this.handleShowAddMembers.bind(this);
+ this.handleHideAddMembers = this.handleHideAddMembers.bind(this);
+ this.handleMemberUpdateRequest = this.handleMemberUpdateRequest.bind(this);
+ this.handleLeave = this.handleLeave.bind(this);
+ this.handleMemberSelected = this.handleMemberSelected.bind(this);
+ this.handleMoreInfo = this.handleMoreInfo.bind(this);
+ this.handleTagsUpdated = this.handleTagsUpdated.bind(this);
+ this.handleContextMenu = this.handleContextMenu.bind(this);
+ }
+
+ // No need to separately handle component mount.
+ UNSAFE_componentWillReceiveProps(props) {
+ var topic = this.props.tinode.getTopic(props.topic);
+ if (!topic) {
+ return;
+ }
+
+ if (this.onMetaDesc != topic.onMetaDesc) {
+ this.previousMetaDesc = topic.onMetaDesc;
+ topic.onMetaDesc = this.onMetaDesc;
+
+ this.previousSubsUpdated = topic.onSubsUpdated;
+ topic.onSubsUpdated = this.onSubsUpdated;
+
+ if (topic.getType() == 'grp') {
+ this.previousTagsUpdated = topic.onTagsUpdated;
+ topic.onTagsUpdated = this.onTagsUpdated;
+ } else {
+ this.previousTagsUpdated = undefined;
+ }
+ }
+
+ if (this.state.topic != props.topic) {
+ this.setState({topic: props.topic});
+ this.resetDesc(topic, props);
+ this.resetSubs(topic, props);
+ }
+ }
+
+ componentWillUnmount() {
+ var topic = this.props.tinode.getTopic(this.props.topic);
+ if (!topic) {
+ return;
+ }
+ this.setState({topic: null});
+ topic.onMetaDesc = this.previousMetaDesc;
+ topic.onSubsUpdated = this.previousSubsUpdated;
+ topic.onTagsUpdated = this.previousTagsUpdated;
+ }
+
+ resetSubs(topic, props) {
+ var newState = {contactList: []};
+ if (topic.getType() == 'p2p') {
+ // Fetch the other party in the p2p conversation.
+ // Topic may not be ready yet, so check if user is found.
+ var user2 = topic.subscriber(props.topic);
+ if (user2) {
+ newState.modeGiven2 = user2.acs.getGiven();
+ newState.modeWant2 = user2.acs.getWant();
+ }
+ } else {
+ topic.subscribers(function(sub) {
+ newState.contactList.push(sub);
+ }, this);
+ }
+
+ this.setState(newState);
+ }
+
+ resetDesc(topic, props) {
+ var defacs = topic.getDefaultAccess() || {};
+ var acs = topic.getAccessMode();
+ this.setState({
+ owner: acs && acs.isOwner(),
+ admin: acs && acs.isAdmin(),
+ sharer: acs && (acs.isAdmin() || acs.isSharer()),
+ muted: acs && acs.isMuted(),
+
+ fullName: topic.public ? topic.public.fn : undefined,
+ avatar: makeImageUrl(topic.public ? topic.public.photo : null),
+ private: topic.private ? topic.private.comment : null,
+ address: topic.name,
+ groupTopic: (topic.getType() == 'grp'),
+ showMemberPanel: false,
+ access: acs ? acs.getMode() : undefined,
+ modeGiven: acs ? acs.getGiven() : undefined,
+ modeWant: acs ? acs.getWant() : undefined,
+ auth: defacs.auth,
+ anon: defacs.anon
+ });
+
+ if (topic.getType() == 'grp' && acs && acs.isOwner()) {
+ // Requesting tags: owner is editing the topic.
+ topic.getMeta(topic.startMetaQuery().withTags().build());
+ }
+ }
+
+ onMetaDesc(desc) {
+ var topic = this.props.tinode.getTopic(this.props.topic);
+ if (!topic) {
+ return;
+ }
+ this.resetDesc(topic, this.props);
+
+ if (this.previousMetaDesc && this.previousMetaDesc != this.onMetaDesc) {
+ this.previousMetaDesc(desc);
+ }
+ }
+
+ onSubsUpdated() {
+ var topic = this.props.tinode.getTopic(this.props.topic);
+ if (!topic) {
+ return;
+ }
+ this.resetSubs(topic, this.props);
+
+ if (this.previousSubsUpdated && this.previousSubsUpdated != this.onSubsUpdated) {
+ this.previousSubsUpdated();
+ }
+ }
+
+ onTagsUpdated(tags) {
+ this.setState({tags: tags});
+
+ if (this.previousTagsUpdated && this.previousTagsUpdated != this.onTagsUpdated) {
+ this.previousTagsUpdated();
+ }
+ }
+
+ handleFullNameUpdate(fn) {
+ if (this.state.fullName !== fn) {
+ this.setState({fullName: fn});
+ this.props.onTopicDescUpdate(this.props.topic,
+ vcard(fn, this.state.avatar),
+ null);
+ }
+ }
+
+ handlePrivateUpdate(priv) {
+ if (this.state.priv !== priv) {
+ this.setState({private: priv});
+ this.props.onTopicDescUpdate(this.props.topic,
+ null,
+ priv || Tinode.DEL_CHAR);
+ }
+ }
+
+ handleImageChanged(img) {
+ this.setState({avatar: img});
+ this.props.onTopicDescUpdate(this.props.topic,
+ vcard(this.state.fullName, img),
+ null);
+ }
+
+ handleMuted(ignored, checked) {
+ this.setState({muted: checked});
+ this.props.onChangePermissions(this.props.topic, checked ? '-P' : '+P');
+ }
+
+ handlePermissionsChanged(perm) {
+ switch (this.state.showPermissionEditorFor) {
+ case 'auth':
+ this.props.onTopicDescUpdate(this.props.topic, null, null, {auth: perm});
+ break;
+ case 'anon':
+ this.props.onTopicDescUpdate(this.props.topic, null, null, {anon: perm});
+ break;
+ case 'mode':
+ case 'want':
+ this.props.onChangePermissions(this.props.topic, perm);
+ break;
+ case 'given':
+ this.props.onChangePermissions(this.props.topic, perm, this.props.topic);
+ break;
+ case 'user':
+ this.props.onChangePermissions(this.props.topic, perm, this.state.userPermissionsEdited);
+ break;
+ }
+
+ this.setState({showPermissionEditorFor: undefined});
+ }
+
+ handleLaunchPermissionsEditor(which, uid) {
+ const {formatMessage} = this.props.intl;
+ let toEdit, toCompare, toSkip, titleEdit, titleCompare, userTitle, userAvatar;
+ switch (which) {
+ case 'mode':
+ toEdit = this.state.access;
+ break;
+ case 'want':
+ toEdit = this.state.modeWant;
+ toCompare = this.state.modeGiven;
+ toSkip = this.state.groupTopic ? 'O' : 'ASDO';
+ titleEdit = formatMessage(messages.requested);
+ titleCompare = formatMessage(messages.granted);
+ break;
+ case 'given':
+ toEdit = this.state.modeGiven2;
+ toCompare = this.state.modeWant2;
+ toSkip = this.state.groupTopic ? (this.state.owner ? '' : 'O') : 'ASDO';
+ titleEdit = formatMessage(messages.granted);
+ titleCompare = formatMessage(messages.requested);
+ break;
+ case 'auth':
+ toEdit = this.state.auth;
+ toSkip = 'O';
+ break;
+ case 'anon':
+ toEdit = this.state.anon;
+ toSkip = 'O';
+ break;
+ case 'user': {
+ let topic = this.props.tinode.getTopic(this.props.topic);
+ if (!topic) {
+ return;
+ }
+ var user = topic.subscriber(uid);
+ if (!user || !user.acs) {
+ return;
+ }
+ toEdit = user.acs.getGiven();
+ toCompare = user.acs.getWant();
+ toSkip = this.state.owner ? '' : 'O';
+ titleEdit = formatMessage(messages.granted);
+ titleCompare = formatMessage(messages.requested);
+ if (user.public) {
+ userTitle = user.public.fn;
+ userAvatar = user.public.photo;
+ }
+ break;
+ }
+ default:
+ console.log("Unknown permission editing mode '" + which + "'");
+ break;
+ }
+ this.setState({
+ showPermissionEditorFor: which,
+ userPermissionsEdited: uid,
+ userPermissionsTitle: userTitle,
+ userPermissionsAvatar: userAvatar,
+ editedPermissions: toEdit,
+ immutablePermissions: toCompare,
+ editedPermissionsTitle: titleEdit,
+ immutablePermissionsTitle: titleCompare,
+ editedPermissionsSkipped: toSkip,
+ });
+ }
+
+ handleHidePermissionsEditor() {
+ this.setState({showPermissionEditorFor: undefined});
+ }
+
+ handleShowAddMembers() {
+ this.props.onInitFind();
+ this.setState({showMemberPanel: true});
+ }
+
+ handleHideAddMembers() {
+ this.setState({showMemberPanel: false});
+ }
+
+ handleMemberUpdateRequest(members, added, removed) {
+ this.props.onMemberUpdateRequest(this.props.topic, added, removed);
+ this.setState({showMemberPanel: false});
+ }
+
+ handleLeave() {
+ this.props.onLeaveTopic(this.props.topic);
+ }
+
+ handleMemberSelected(uid) {
+ this.setState({selectedContact: uid});
+ }
+
+ handleMoreInfo(open) {
+ this.setState({moreInfoExpanded: open});
+ }
+
+ handleTagsUpdated(tags) {
+ if (!arrayEqual(this.state.tags.slice(0), tags.slice(0))) {
+ this.props.onTopicTagsUpdate(this.props.topic, tags);
+ }
+ }
+
+ handleContextMenu(params) {
+ const {formatMessage} = this.props.intl;
+ const instance = this;
+ const topic = this.props.tinode.getTopic(this.props.topic);
+ if (!topic) {
+ return;
+ }
+ const user = topic.subscriber(params.topicName);
+ if (!user || !user.acs) {
+ return;
+ }
+
+ const menuItems = [
+ {title: formatMessage(messages.edit_permissions), handler: function() {
+ instance.handleLaunchPermissionsEditor('user', params.topicName);
+ }},
+ 'member_delete',
+ user.acs.isMuted() ? 'member_unmute' : 'member_mute',
+ user.acs.isJoiner() ? 'member_block' : 'member_unblock'
+ ];
+ this.props.showContextMenu({
+ topicName: this.props.topic,
+ x: params.x,
+ y: params.y,
+ user: params.topicName}, menuItems);
+ }
+
+ render() {
+ const {formatMessage} = this.props.intl;
+
+ return (
+
+
+ {this.props.displayMobile ?
+
: null}
+ {this.state.showMemberPanel ?
+
+ :
+ this.state.showPermissionEditorFor ?
+
+ :
+
+
+
+
+
+
+
Unknown}
+ readOnly={!this.state.owner}
+ value={this.state.fullName}
+ onFinished={this.handleFullNameUpdate} />
+
+
+
+
+
+
+ {
+ (private_placeholder) =>
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
{
+ (more) =>
+ }
+ {this.state.moreInfoExpanded ?
+
+
+
+ {this.state.address}
+
+ {this.state.groupTopic ?
+
+
+
+
+
+ {this.state.access}
+
+
+ :
+
+
+
+
+
+
+
+
+
+ {this.state.access}
+
+
{this.state.fullName ? this.state.fullName : formatMessage(messages.other_user)}:
+
+ {this.state.modeGiven2}
+
+
+
+
+ }
+ {this.state.sharer && (this.state.auth || this.state.anon) ?
+
+
+
+
+
+
+
+
Auth: {this.state.admin ?
+
+ {this.state.auth}
+
+ :
+ {this.state.auth}
+ }
+
+
Anon: {this.state.admin ?
+
+ {this.state.anon}
+
+ :
+ {this.state.anon}
+ }
+
+
+
+ :
+ null
+ }
+
+ :
+ null
+ }
+
+
+ {this.state.owner ?
+
{
+ (tags) =>
+ }
+ :
+ null
+ }
+ {this.state.owner ?
: null }
+ {this.state.groupTopic ?
+
+
+
+
+
+
+
+
{
+ (no_members) =>
+ }
+
+ :
+
+ }
+
+ }
+
+ );
+ }
+};
+
+export default injectIntl(InfoView);
diff --git a/src/views/login-view.jsx b/src/views/login-view.jsx
new file mode 100644
index 00000000..32fb39f3
--- /dev/null
+++ b/src/views/login-view.jsx
@@ -0,0 +1,96 @@
+// Login form.
+import React from 'react';
+import { FormattedMessage } from 'react-intl';
+
+import CheckBox from '../widgets/checkbox.jsx';
+import VisiblePassword from '../widgets/visible-password.jsx';
+
+import LocalStorageUtil from '../lib/local-storage.js';
+
+export default class LoginView extends React.Component {
+ constructor(props) {
+ super(props);
+
+ this.state = {
+ login: props.login,
+ password: '',
+ hostName: props.serverAddress,
+ saveToken: LocalStorageUtil.getObject('keep-logged-in')
+ };
+ this.handleLoginChange = this.handleLoginChange.bind(this);
+ this.handlePasswordChange = this.handlePasswordChange.bind(this);
+ this.handleToggleSaveToken = this.handleToggleSaveToken.bind(this);
+ this.handleSubmit = this.handleSubmit.bind(this);
+ }
+
+ handleLoginChange(e) {
+ this.setState({login: e.target.value});
+ }
+
+ handlePasswordChange(e) {
+ this.setState({password: e.target.value});
+ }
+
+ handleToggleSaveToken() {
+ LocalStorageUtil.setObject('keep-logged-in', !this.state.saveToken);
+ this.setState({saveToken: !this.state.saveToken});
+ }
+
+ handleSubmit(e) {
+ e.preventDefault();
+ this.props.onLogin(this.state.login.trim(), this.state.password.trim());
+ }
+
+ render() {
+ var submitClasses = 'blue';
+ if (this.props.disabled) {
+ submitClasses += ' disabled';
+ }
+
+ return (
+
+ );
+ }
+};
+/* END Login */
diff --git a/src/views/logo-view.jsx b/src/views/logo-view.jsx
new file mode 100644
index 00000000..ca8b4904
--- /dev/null
+++ b/src/views/logo-view.jsx
@@ -0,0 +1,26 @@
+/* This is just a static page to display when no conversation is selected. */
+import React from 'react';
+import { FormattedMessage } from 'react-intl';
+
+import Tinode from 'tinode-sdk';
+
+import { APP_NAME } from '../config.js';
+
+export default class LogoView extends React.PureComponent {
+ render() {
+ var version = APP_NAME + ' (' + Tinode.getLibrary() + ')';
+ return (
+
+
+
+
+ Tinode Web
+
+
{version}
+
{this.props.serverVersion}
+ ({this.props.serverAddress})
+
+
+ );
+ }
+};
diff --git a/src/views/messages-view.jsx b/src/views/messages-view.jsx
new file mode 100644
index 00000000..f7260b85
--- /dev/null
+++ b/src/views/messages-view.jsx
@@ -0,0 +1,532 @@
+import React from 'react';
+import { FormattedMessage, defineMessages, injectIntl } from 'react-intl';
+
+import Tinode from 'tinode-sdk';
+
+import ChatMessage from '../widgets/chat-message.jsx';
+import ErrorPanel from '../widgets/error-panel.jsx';
+import GroupSubs from '../widgets/group-subs.jsx';
+import ImagePreview from '../widgets/image-preview.jsx';
+import LetterTile from '../widgets/letter-tile.jsx';
+import LoadSpinner from '../widgets/load-spinner.jsx';
+import LogoView from './logo-view.jsx';
+import SendMessage from '../widgets/send-message.jsx';
+
+import { KEYPRESS_DELAY, MESSAGES_PAGE } from '../config.js';
+import { makeImageUrl } from '../lib/blob-helpers.js';
+import { shortDateFormat } from '../lib/strformat.js';
+
+const messages = defineMessages({
+ online_now: {
+ id: 'online_now',
+ defaultMessage: 'online now',
+ description: 'Indicator that the user or topic is currently online',
+ },
+ last_seen: {
+ id: 'last_seen_timestamp',
+ defaultMessage: 'Last seen',
+ description: 'Label for the timestamp of when the user or topic was last online'
+ },
+ 'not_found': {
+ id: 'title_not_found',
+ defaultMessage: 'Not found',
+ description: 'Title shown when topic is not found'
+ }
+});
+
+class MessagesView extends React.Component {
+ constructor(props) {
+ super(props);
+
+ this.state = {
+ messages: [],
+ onlineSubs: [],
+ topic: '',
+ title: '',
+ avatar: null,
+ scrollPosition: 0,
+ readOnly: props.acs ? !props.acs.isWriter() : true,
+ writeOnly: props.acs ? !props.acs.isReader() : true,
+ typingIndicator: false,
+ imagePreview: null
+ };
+
+ this.propsChange = this.propsChange.bind(this);
+ this.leave = this.leave.bind(this);
+ this.handleScrollReference = this.handleScrollReference.bind(this);
+ this.fetchMoreMessages = this.fetchMoreMessages.bind(this);
+ this.handleDescChange = this.handleDescChange.bind(this);
+ this.handleSubsUpdated = this.handleSubsUpdated.bind(this);
+ this.handleNewMessage = this.handleNewMessage.bind(this);
+ this.handleAllMessagesReceived = this.handleAllMessagesReceived.bind(this);
+ this.handleInfoReceipt = this.handleInfoReceipt.bind(this);
+ this.handleImagePreview = this.handleImagePreview.bind(this);
+ this.handleCloseImagePreview = this.handleCloseImagePreview.bind(this);
+ this.handleContextClick = this.handleContextClick.bind(this);
+ this.handleShowContextMenuMessage = this.handleShowContextMenuMessage.bind(this);
+ this.handleBackNavigation = this.handleBackNavigation.bind(this);
+ }
+
+ // Scroll last message into view on component update e.g. on message received.
+ componentDidUpdate(prevProps, prevState) {
+ if (this.messagesScroller &&
+ (prevState.title != this.state.title ||
+ prevState.messages.length != this.state.messages.length)) {
+ this.messagesScroller.scrollTop = this.messagesScroller.scrollHeight - this.state.scrollPosition;
+ }
+ }
+
+ componentDidMount() {
+ this.propsChange(this.props);
+ if (this.messagesScroller) {
+ this.messagesScroller.addEventListener('scroll', this.fetchMoreMessages);
+ }
+ }
+
+ componentWillUnmount() {
+ this.leave(this.state.topic);
+ if (this.messagesScroller) {
+ this.messagesScroller.removeEventListener('scroll', this.fetchMoreMessages);
+ }
+ }
+
+ UNSAFE_componentWillReceiveProps(nextProps) {
+ this.propsChange(nextProps);
+ }
+
+ propsChange(props) {
+ if (!props || !props.topic) {
+ let oldTopic = this.state.topic;
+ this.setState({messages: [], onlineSubs: [], topic: null}, this.leave(oldTopic));
+ return;
+ }
+
+ if (!props.connected) {
+ // connection lost, clear online subs
+ this.setState({onlineSubs: []});
+ return;
+ }
+
+ let topic = this.props.tinode.getTopic(props.topic);
+ if (!topic) {
+ return;
+ }
+
+ let newGroupTopic = Tinode.isNewGroupTopicName(props.topic);
+ let tryToResubscribe = !this.props.connected && props.connected;
+
+ if (props.topic != this.state.topic) {
+ let msgs = [];
+ let subs = [];
+
+ // Bind the new topic to component.
+ topic.onData = this.handleNewMessage;
+ topic.onAllMessagesReceived = this.handleAllMessagesReceived;
+ topic.onInfo = this.handleInfoReceipt;
+ topic.onMetaDesc = this.handleDescChange;
+ topic.onSubsUpdated = this.handleSubsUpdated;
+ topic.onPres = this.handleSubsUpdated;
+ // Unbind the previous topic from this component.
+ this.leave(this.state.topic);
+
+ this.handleDescChange(topic);
+ topic.subscribers((sub) => {
+ if (sub.online && sub.user != this.props.myUserId) {
+ subs.push(sub);
+ }
+ });
+
+ topic.messages(function(msg) {
+ if (!msg.deleted) {
+ msgs = msgs.concat(msg);
+ }
+ });
+
+ this.setState({
+ messages: msgs,
+ onlineSubs: subs,
+ topic: props.topic,
+ imagePreview: null,
+ scrollPosition: 0
+ });
+ tryToResubscribe = true;
+
+ // The user switched to the new topic before the timer for
+ // the previous topic has triggered, kill it.
+ this.props.readTimerHandler(null);
+ }
+
+ this.setState({
+ readOnly: props.acs ? !props.acs.isWriter() : true,
+ writeOnly: props.acs ? !props.acs.isReader() : true
+ });
+
+ if (!topic.isSubscribed() && tryToResubscribe) {
+ // Don't request the tags. They are useless unless the user
+ // is the owner and is editing the topic.
+ let getQuery = topic.startMetaQuery()
+ .withLaterDesc()
+ .withLaterSub()
+ .withLaterData(MESSAGES_PAGE)
+ .withLaterDel();
+ let setQuery = newGroupTopic ? props.newGroupTopicParams : undefined;
+ // Show "loading" spinner.
+ this.setState({ fetchingMessages: true });
+ topic.subscribe(getQuery.build(), setQuery)
+ .then((ctrl) => {
+ this.setState({topic: ctrl.topic});
+ this.props.onNewTopicCreated(props.topic, ctrl.topic);
+ // If there are unsent messages, try sending them now.
+ topic.queuedMessages((pub) => {
+ if (!pub._sending && topic.isSubscribed()) {
+ topic.publishMessage(pub);
+ }
+ });
+ })
+ .catch((err) => {
+ this.props.onError(err.message, 'err');
+ const {formatMessage} = this.props.intl;
+ this.setState({
+ title: formatMessage(messages.not_found),
+ avatar: null,
+ readOnly: true,
+ writeOnly: true,
+ fetchingMessages: false,
+ messages: [],
+ onlineSubs: [],
+ typingIndicator: false,
+ imagePreview: null
+ });
+ });
+ }
+ }
+
+ leave(oldTopicName) {
+ if (!oldTopicName) {
+ return;
+ }
+ let oldTopic = this.props.tinode.getTopic(oldTopicName);
+ if (oldTopic && oldTopic.isSubscribed()) {
+ oldTopic.leave(false)
+ .catch(() => { /* do nothing here */ })
+ .finally(() => {
+ // We don't care if the request succeeded or failed.
+ // The topic is dead regardless.
+ this.setState({fetchingMessages: false});
+ oldTopic.onData = undefined;
+ oldTopic.onAllMessagesReceived = undefined;
+ oldTopic.onInfo = undefined;
+ oldTopic.onMetaDesc = undefined;
+ oldTopic.onSubsUpdated = undefined;
+ oldTopic.onPres = undefined;
+ });
+ }
+ }
+
+ handleScrollReference(node) {
+ if (node) {
+ node.addEventListener('scroll', this.fetchMoreMessages);
+ this.messagesScroller = node;
+ }
+ }
+
+ // Get older messages
+ fetchMoreMessages(event) {
+ if (event.target.scrollTop <= 0) {
+ let newState = {scrollPosition: event.target.scrollHeight - event.target.scrollTop};
+ this.setState((prevState, props) => {
+ if (!prevState.fetchingMessages) {
+ var topic = this.props.tinode.getTopic(this.state.topic);
+ if (topic && topic.isSubscribed() && topic.msgHasMoreMessages()) {
+ newState.fetchingMessages = true;
+ topic.getMessagesPage(MESSAGES_PAGE).catch((err) => {
+ this.setState({fetchingMessages: false});
+ this.props.onError(err.message, 'err');
+ });
+ }
+ }
+ return newState;
+ });
+ }
+ }
+
+ handleDescChange(desc) {
+ if (desc.public) {
+ this.setState({
+ title: desc.public.fn,
+ avatar: makeImageUrl(desc.public.photo)
+ });
+ } else {
+ this.setState({
+ title: '',
+ avatar: null
+ });
+ }
+ if (desc.acs) {
+ this.setState({
+ readOnly: !desc.acs.isWriter(),
+ writeOnly: !desc.acs.isReader()
+ });
+ }
+ }
+
+ handleSubsUpdated() {
+ if (this.state.topic) {
+ var subs = [];
+ var topic = this.props.tinode.getTopic(this.state.topic);
+ topic.subscribers((sub) => {
+ if (sub.online && sub.user != this.props.myUserId) {
+ subs.push(sub);
+ }
+ });
+ this.setState({onlineSubs: subs});
+ }
+ }
+
+ handleNewMessage(msg) {
+ // Regenerate messages list
+ var topic = this.props.tinode.getTopic(this.state.topic);
+ var newState = {messages: []};
+ topic.messages(function(m) {
+ if (!m.deleted) {
+ newState.messages = newState.messages.concat(m);
+ }
+ });
+
+ // msg could be null if one or more messages were deleted.
+ if (msg && !msg.deleted) {
+ // If the message is added to the end of the message list,
+ // scroll to the bottom.
+ if (topic.isNewMessage(msg.seq)) {
+ newState.scrollPosition = 0;
+ }
+
+ // Aknowledge all messages, including own messages.
+ let status = topic.msgStatus(msg);
+ if (status >= Tinode.MESSAGE_STATUS_SENT) {
+ this.props.readTimerHandler(() => {
+ topic.noteRead(msg.seq);
+ });
+ }
+ this.props.onData(msg);
+ }
+
+ this.setState(newState);
+ }
+
+ handleAllMessagesReceived(count) {
+ this.setState({fetchingMessages: false});
+ }
+
+ handleInfoReceipt(info) {
+ switch (info.what) {
+ case 'kp': {
+ clearTimeout(this.keyPressTimer);
+ var instance = this;
+ this.keyPressTimer = setTimeout(function() {
+ instance.setState({typingIndicator: false});
+ }, KEYPRESS_DELAY + 1000);
+ if (!this.state.typingIndicator) {
+ this.setState({typingIndicator: true});
+ }
+ break;
+ }
+ case 'read':
+ case 'recv':
+ // Redraw due to changed recv/read status.
+ this.forceUpdate();
+ break;
+ default:
+ console.log("Other change in topic: ", info.what);
+ }
+ }
+
+ handleImagePreview(content) {
+ this.setState({ imagePreview: content });
+ }
+
+ handleCloseImagePreview() {
+ this.setState({ imagePreview: null });
+ }
+
+ handleContextClick(e) {
+ e.preventDefault();
+ e.stopPropagation();
+ this.props.showContextMenu({ topicName: this.state.topic, y: e.pageY, x: e.pageX });
+ }
+
+ handleShowContextMenuMessage(params) {
+ params.topicName = this.state.topic;
+ var menuItems = ['message_delete'];
+ var topic = this.props.tinode.getTopic(params.topicName);
+ if (topic) {
+ var acs = topic.getAccessMode();
+ if (acs && acs.isDeleter()) {
+ menuItems.push('message_delete_hard');
+ }
+ }
+ this.props.showContextMenu(params, menuItems);
+ }
+
+ handleBackNavigation() {
+ this.props.onHideMessagesView();
+ }
+
+ render() {
+ const {formatMessage} = this.props.intl;
+
+ let component;
+
+ if (this.state.topic) {
+ let messageNodes = [];
+ let topic = this.props.tinode.getTopic(this.state.topic);
+ let groupTopic = topic.getType() == 'grp';
+ let previousFrom = null;
+ let chatBoxClass = null;
+ for (let i=0; i
+ );
+ }
+
+ let lastSeen = null;
+ let cont = this.props.tinode.getMeTopic().getContact(this.state.topic);
+ if (cont && Tinode.topicType(cont.topic) == 'p2p') {
+ if (cont.online) {
+ lastSeen = formatMessage(messages.online_now);
+ } else if (cont.seen) {
+ lastSeen = formatMessage(messages.last_seen) + ": " + shortDateFormat(cont.seen.when);
+ // TODO: also handle user agent in c.seen.ua
+ }
+ }
+ let avatar = this.state.avatar || true;
+ let online = this.props.online ? 'online' + (this.state.typingIndicator ? ' typing' : '') : 'offline';
+
+ component = (
+
+
+ {this.props.displayMobile ?
+
+ arrow_back
+
+ :
+ null}
+
+
+
+
+
+
{
+ this.state.title ||
+
+ }
+
{lastSeen}
+
+ {groupTopic ?
+
:
+
+ }
+
+
+ {this.props.displayMobile ?
+
+ : null}
+
+
+
+ {this.state.writeOnly ?
+
+ :
+ null
+ }
+
+
+ {this.state.imagePreview ?
+
: null}
+
+ );
+ } else {
+ component = (
+
+ );
+ }
+ return component;
+ }
+};
+
+export default injectIntl(MessagesView);
diff --git a/src/views/new-topic-view.jsx b/src/views/new-topic-view.jsx
new file mode 100644
index 00000000..47e521d9
--- /dev/null
+++ b/src/views/new-topic-view.jsx
@@ -0,0 +1,108 @@
+// Create new topic and invite users or send an invite.
+import React from 'react';
+import { FormattedMessage } from 'react-intl';
+
+import ContactList from '../widgets/contact-list.jsx';
+import NewTopicById from '../widgets/new-topic-by-id.jsx';
+import NewTopicGroup from '../widgets/new-topic-group.jsx';
+import SearchContacts from '../widgets/search-contacts.jsx';
+
+import HashNavigation from '../lib/navigation.js';
+
+export default class NewTopicView extends React.Component {
+ constructor(props) {
+ super(props);
+
+ this.state = {
+ tabSelected: 'p2p',
+ contactList: props.searchResults
+ };
+
+ this.handleTabClick = this.handleTabClick.bind(this);
+ this.handleContactSelected = this.handleContactSelected.bind(this);
+ this.handleNewGroupSubmit = this.handleNewGroupSubmit.bind(this);
+ this.handleGroupByID = this.handleGroupByID.bind(this);
+ }
+
+ componentDidMount() {
+ this.props.onInitFind();
+ }
+
+ static getDerivedStateFromProps(nextProps, prevState) {
+ return {
+ contactList: nextProps.searchResults
+ };
+ }
+
+ handleTabClick(e) {
+ e.preventDefault();
+ HashNavigation.navigateTo(HashNavigation.addUrlParam(window.location.hash, 'tab', e.currentTarget.dataset.id));
+ this.setState({tabSelected: e.currentTarget.dataset.id});
+ }
+
+ handleContactSelected(sel) {
+ if (this.state.tabSelected === 'p2p') {
+ HashNavigation.navigateTo(HashNavigation.removeUrlParam(window.location.hash, 'tab'));
+ this.props.onCreateTopic(sel, undefined);
+ }
+ }
+
+ handleNewGroupSubmit(name, dataUrl, priv, tags) {
+ HashNavigation.navigateTo(HashNavigation.removeUrlParam(window.location.hash, 'tab'));
+ this.props.onCreateTopic(undefined, vcard(name, dataUrl), priv, tags);
+ }
+
+ handleGroupByID(topicName) {
+ HashNavigation.navigateTo(HashNavigation.removeUrlParam(window.location.hash, 'tab'));
+ this.props.onCreateTopic(topicName);
+ }
+
+ render() {
+ return (
+
+
+ {this.state.tabSelected === 'grp' ?
+
:
+ this.state.tabSelected === 'byid' ?
+
:
+
+
+ {
+ (search_for_contacts) =>
+ }
+
}
+
+ );
+ }
+};
diff --git a/src/views/password-reset-view.jsx b/src/views/password-reset-view.jsx
new file mode 100644
index 00000000..ddbaefab
--- /dev/null
+++ b/src/views/password-reset-view.jsx
@@ -0,0 +1,87 @@
+// A password reset form.
+import React from 'react';
+import { FormattedMessage } from 'react-intl';
+
+import VisiblePassword from '../widgets/visible-password.jsx';
+
+import HashNavigation from '../lib/navigation.js';
+
+export default class PasswordResetView extends React.PureComponent {
+ constructor(props) {
+ super(props);
+
+ this.state = {
+ email: '',
+ password: ''
+ };
+
+ this.handleSubmit = this.handleSubmit.bind(this);
+ this.handleEmailChange = this.handleEmailChange.bind(this);
+ this.handlePasswordChange = this.handlePasswordChange.bind(this);
+ }
+
+ componentDidMount() {
+ let parsed = HashNavigation.parseUrlHash(window.location.hash);
+ this.setState({token: parsed.params.token, scheme: parsed.params.scheme});
+ }
+
+ handleSubmit(e) {
+ e.preventDefault();
+ if (this.state.token) {
+ this.props.onReset(this.state.scheme, this.state.password.trim(), this.state.token);
+ } else {
+ this.props.onRequest('email', this.state.email.trim());
+ }
+ }
+
+ handleEmailChange(e) {
+ this.setState({email: e.target.value});
+ }
+
+ handlePasswordChange(e) {
+ this.setState({password: e.target.value});
+ }
+
+ render() {
+ let reset = (this.state.token && this.state.scheme);
+ return (
+
+ );
+ }
+}
diff --git a/src/views/settings-view.jsx b/src/views/settings-view.jsx
new file mode 100644
index 00000000..8d1802ed
--- /dev/null
+++ b/src/views/settings-view.jsx
@@ -0,0 +1,85 @@
+// Tinode config panel.
+import React from 'react';
+import { FormattedMessage } from 'react-intl';
+
+import HostSelector from '../widgets/host-selector.jsx';
+
+export default class SettingsView extends React.PureComponent {
+ constructor(props) {
+ super(props);
+
+ this.state = {
+ transport: props.transport || 'def',
+ serverAddress: props.serverAddress,
+ };
+
+ this.handleSubmit = this.handleSubmit.bind(this);
+ this.handleTransportSelected = this.handleTransportSelected.bind(this);
+ this.handleServerAddressChange = this.handleServerAddressChange.bind(this);
+ }
+
+ handleSubmit(e) {
+ e.preventDefault();
+ this.props.onUpdate({
+ transport: this.state.transport,
+ serverAddress: this.state.serverAddress
+ });
+ }
+
+ handleTransportSelected(e) {
+ this.setState({transport: e.currentTarget.value});
+ }
+
+ handleServerAddressChange(name) {
+ this.setState({serverAddress: name});
+ this.props.onServerAddressChange(name);
+ }
+
+ render() {
+ const names = {def: "default", ws: "websocket", lp: "long polling"};
+ var transportOptions = [];
+ var instance = this;
+ ['def', 'ws', 'lp'].map(function(item) {
+ var id = 'transport-' + item;
+ var name = names[item];
+ transportOptions.push(
+
+
+ {name}
+
+ );
+ });
+
+ return (
+
+ );
+ }
+};
diff --git a/src/views/sidepanel-view.jsx b/src/views/sidepanel-view.jsx
new file mode 100644
index 00000000..c213cde0
--- /dev/null
+++ b/src/views/sidepanel-view.jsx
@@ -0,0 +1,172 @@
+import React from 'react';
+import { defineMessages, injectIntl } from 'react-intl';
+
+import SideNavbar from '../widgets/side-navbar.jsx';
+import ErrorPanel from '../widgets/error-panel.jsx';
+
+import ContactsView from './contacts-view.jsx';
+import CreateAccountView from './create-account-view.jsx';
+import EditAccountView from './edit-account-view.jsx';
+import LoginView from './login-view.jsx';
+import NewTopicView from './new-topic-view.jsx';
+import PasswordResetView from './password-reset-view.jsx';
+import SettingsView from './settings-view.jsx';
+import ValidationView from './validation-view.jsx';
+
+// Panel titles for translation.
+const messages = defineMessages({
+ 'login': {
+ id: 'sidepanel_title_login',
+ description: 'Sidepanel title for LoginView.',
+ defaultMessage: 'Sign In'
+ },
+ 'register': {
+ id: 'sidepanel_title_register',
+ description: 'Sidepanel title for CreateAccountView.',
+ defaultMessage: 'Create Account'
+ },
+ 'settings': {
+ id: 'sidepanel_title_settings',
+ description: 'Sidepanel title for SettingsView.',
+ defaultMessage: 'Settings'
+ },
+ 'edit': {
+ id: 'sidepanel_title_edit_account',
+ description: 'Sidepanel title for EditAccountView.',
+ defaultMessage: 'Edit Account'
+ },
+ 'newtpk': {
+ id: 'sidepanel_title_newtpk',
+ description: 'Sidepanel title for NewTopicView.',
+ defaultMessage: 'Start New Chat'
+ },
+ 'cred': {
+ id: 'sidepanel_title_cred',
+ description: 'Sidepanel title for ValidationView.',
+ defaultMessage: 'Confirm Credentials'
+ },
+ 'reset': {
+ id: 'sidepanel_title_reset',
+ description: 'Sidepanel title for PasswordResetView.',
+ defaultMessage: 'Reset Password'
+ }
+});
+
+class SidepanelView extends React.Component {
+ constructor(props) {
+ super(props);
+
+ this.handleLoginRequested = this.handleLoginRequested.bind(this);
+ }
+
+ handleLoginRequested(login, password) {
+ this.props.onLoginRequest(login, password);
+ }
+
+ render() {
+ const {formatMessage} = this.props.intl;
+ const view = this.props.state || (this.props.myUserId ? 'contacts' : 'login');
+
+ let title, avatar;
+ if (view == 'contacts') {
+ title = this.props.title;
+ avatar = this.props.avatar ? this.props.avatar : true;
+ } else {
+ title = formatMessage(messages[view]);
+ avatar = false;
+ }
+
+ let onCancel;
+ if (view != 'login') {
+ onCancel = this.props.onCancel;
+ }
+
+ return (
+
+
+
+
+
+ {view === 'login' ?
+
:
+
+ view === 'register' ?
+
:
+
+ view === 'settings' ?
+
:
+
+ view === 'edit' ?
+
:
+
+ view === 'contacts' ?
+
:
+
+ view === 'newtpk' ?
+
:
+
+ view === 'cred' ?
+
:
+
+ view === 'reset' ?
+
:
+ null}
+
+ );
+ }
+};
+
+export default injectIntl(SidepanelView);
diff --git a/src/views/tinode-web.jsx b/src/views/tinode-web.jsx
new file mode 100644
index 00000000..ae3edf90
--- /dev/null
+++ b/src/views/tinode-web.jsx
@@ -0,0 +1,1137 @@
+// The top-level class to hold all functionality together.
+import React from 'react';
+import ReactDOM from 'react-dom';
+import { injectIntl } from 'react-intl';
+
+import * as firebase from 'firebase/app';
+import 'firebase/messaging';
+
+import Tinode from 'tinode-sdk';
+
+import ContextMenu from '../widgets/context-menu.jsx';
+
+import InfoView from './info-view.jsx';
+import MessagesView from './messages-view.jsx';
+import SidepanelView from './sidepanel-view.jsx';
+
+import { API_KEY, APP_NAME, MEDIA_BREAKPOINT, READ_DELAY, RECEIVED_DELAY } from '../config.js';
+import { makeImageUrl } from '../lib/blob-helpers.js';
+import { detectServerAddress, isLocalHost, isSecureConnection } from '../lib/host-name.js';
+import LocalStorageUtil from '../lib/local-storage.js';
+import HashNavigation from '../lib/navigation.js';
+import { updateFavicon } from '../lib/utils.js';
+
+// Sound to play on message received.
+const POP_SOUND = new Audio('audio/msg.mp3');
+
+class TinodeWeb extends React.Component {
+ constructor(props) {
+ super(props);
+
+ this.state = this.getBlankState();
+
+ this.handleResize = this.handleResize.bind(this);
+ this.handleHashRoute = this.handleHashRoute.bind(this);
+ this.handleOnline = this.handleOnline.bind(this);
+ this.handleAppVisibility = this.handleAppVisibility.bind(this);
+ this.handleReadTimer = this.handleReadTimer.bind(this);
+ this.handleVisibilityEvent = this.handleVisibilityEvent.bind(this);
+ this.handleError = this.handleError.bind(this);
+ this.handleLoginRequest = this.handleLoginRequest.bind(this);
+ this.handleConnected = this.handleConnected.bind(this);
+ this.doLogin = this.doLogin.bind(this);
+ this.handleCredentialsRequest = this.handleCredentialsRequest.bind(this);
+ this.handleLoginSuccessful = this.handleLoginSuccessful.bind(this);
+ this.handleDisconnect = this.handleDisconnect.bind(this);
+ this.tnMeMetaDesc = this.tnMeMetaDesc.bind(this);
+ this.tnMeContactUpdate = this.tnMeContactUpdate.bind(this);
+ this.tnMeSubsUpdated = this.tnMeSubsUpdated.bind(this);
+ this.resetContactList = this.resetContactList.bind(this);
+ this.tnData = this.tnData.bind(this);
+ this.tnInitFind = this.tnInitFind.bind(this);
+ this.tnFndSubsUpdated = this.tnFndSubsUpdated.bind(this);
+ this.handleSearchContacts = this.handleSearchContacts.bind(this);
+ this.handleTopicSelected = this.handleTopicSelected.bind(this);
+ this.handleHideMessagesView = this.handleHideMessagesView.bind(this);
+ this.handleSendMessage = this.handleSendMessage.bind(this);
+ this.handleNewAccount = this.handleNewAccount.bind(this);
+ this.handleNewAccountRequest = this.handleNewAccountRequest.bind(this);
+ this.handleUpdateAccountRequest = this.handleUpdateAccountRequest.bind(this);
+ this.handleUpdateAccountTagsRequest = this.handleUpdateAccountTagsRequest.bind(this);
+ this.handleSettings = this.handleSettings.bind(this);
+ this.handleGlobalSettings = this.handleGlobalSettings.bind(this);
+ this.handleToggleMessageSounds = this.handleToggleMessageSounds.bind(this);
+ this.initDesktopAlerts = this.initDesktopAlerts.bind(this);
+ this.togglePushToken = this.togglePushToken.bind(this);
+ this.requestPushToken = this.requestPushToken.bind(this);
+ this.handleSidepanelCancel = this.handleSidepanelCancel.bind(this);
+ this.handleNewTopic = this.handleNewTopic.bind(this);
+ this.handleNewTopicRequest = this.handleNewTopicRequest.bind(this);
+ this.handleNewTopicCreated = this.handleNewTopicCreated.bind(this);
+ this.handleTopicUpdateRequest = this.handleTopicUpdateRequest.bind(this);
+ this.handleChangePermissions = this.handleChangePermissions.bind(this);
+ this.handleTagsUpdated = this.handleTagsUpdated.bind(this);
+ this.handleLogout = this.handleLogout.bind(this);
+ this.handleLeaveUnsubRequest = this.handleLeaveUnsubRequest.bind(this);
+ this.handleDialogCancel = this.handleDialogCancel.bind(this);
+ this.handleShowContextMenu = this.handleShowContextMenu.bind(this);
+ this.defaultTopicContextMenu = this.defaultTopicContextMenu.bind(this);
+ this.handleHideContextMenu = this.handleHideContextMenu.bind(this);
+ this.handleShowInfoView = this.handleShowInfoView.bind(this);
+ this.handleHideInfoView = this.handleHideInfoView.bind(this);
+ this.handleMemberUpdateRequest = this.handleMemberUpdateRequest.bind(this);
+ this.handleValidateCredentialsRequest = this.handleValidateCredentialsRequest.bind(this);
+ this.handlePasswordResetRequest = this.handlePasswordResetRequest.bind(this);
+ this.handleResetPassword = this.handleResetPassword.bind(this);
+ }
+
+ getBlankState() {
+ let settings = LocalStorageUtil.getObject("settings") || {};
+
+ return {
+ connected: false,
+ transport: settings.transport || null,
+ serverAddress: settings.serverAddress || detectServerAddress(),
+ serverVersion: "no connection",
+ // "On" is the default, so saving the "off" state.
+ messageSounds: !settings.messageSoundsOff,
+ desktopAlerts: settings.desktopAlerts,
+ desktopAlertsEnabled: (isSecureConnection() || isLocalHost()) &&
+ (typeof firebase != 'undefined') && (typeof navigator != 'undefined') &&
+ (typeof FIREBASE_INIT != 'undefined'),
+ firebaseToken: LocalStorageUtil.getObject("firebase-token"),
+
+ errorText: '',
+ errorLevel: null,
+
+ sidePanelSelected: 'login',
+ sidePanelTitle: null,
+ sidePanelAvatar: null,
+ dialogSelected: null,
+ contextMenuVisible: false,
+ login: '',
+ password: '',
+ myUserId: null,
+ liveConnection: navigator.onLine,
+ topicSelected: '',
+ topicSelectedOnline: false,
+ topicSelectedAcs: null,
+ newGroupTopicParams: null,
+ loginDisabled: false,
+ displayMobile: (window.innerWidth <= MEDIA_BREAKPOINT),
+ showInfoPanel: false,
+ mobilePanel: 'sidepanel',
+
+ contextMenuVisible: false,
+ contextMenuBounds: null,
+ contextMenuClickAt: null,
+ contextMenuParams: null,
+ contextMenuItems: [],
+
+ // Chats as shown in the ContactsView
+ chatList: [],
+ // Contacts returned by a search query.
+ searchResults: [],
+ // Merged results of a search query and p2p chats.
+ searchableContacts: [],
+ credMethod: undefined,
+ credCode: undefined
+ };
+ }
+
+ componentDidMount() {
+ window.addEventListener('resize', this.handleResize);
+ window.addEventListener('online', (e) => { this.handleOnline(true); });
+ window.addEventListener('offline', (e) => { this.handleOnline(false); });
+ window.addEventListener('hashchange', this.handleHashRoute);
+ // Window/tab visible or invisible for pausing timers.
+ document.addEventListener('visibilitychange', this.handleVisibilityEvent);
+
+ this.setState({viewportWidth: document.documentElement.clientWidth});
+
+ this.tinode = TinodeWeb.tnSetup(this.state.serverAddress, this.state.transport);
+ this.tinode.onConnect = this.handleConnected;
+ this.tinode.onDisconnect = this.handleDisconnect;
+
+ // Initialize desktop alerts.
+ if (this.state.desktopAlertsEnabled) {
+ try {
+ this.fbPush = firebase.initializeApp(FIREBASE_INIT, APP_NAME).messaging();
+ this.fbPush.usePublicVapidKey(FIREBASE_INIT.messagingVapidKey);
+ navigator.serviceWorker.register('/service-worker.js').then((reg) => {
+ this.fbPush.useServiceWorker(reg);
+ this.initDesktopAlerts();
+ if (this.state.desktopAlerts) {
+ if (!this.state.firebaseToken) {
+ this.togglePushToken(true);
+ } else {
+ this.tinode.setDeviceToken(this.state.firebaseToken);
+ }
+ }
+ }).catch((err) => {
+ // registration failed :(
+ console.log("Failed to register service worker:", err);
+ });
+ } catch (err) {
+ this.handleError("Failed to initialize push notifications", 'err');
+ console.log("Failed to initialize push notifications", err);
+ this.setState({desktopAlertsEnabled: false});
+ }
+ }
+
+ let token = LocalStorageUtil.getObject('keep-logged-in') ?
+ LocalStorageUtil.getObject('auth-token') : undefined;
+
+ let parsedNav = HashNavigation.parseUrlHash(window.location.hash);
+ if (token) {
+ // When reading from storage, date is returned as string.
+ token.expires = new Date(token.expires);
+ this.tinode.setAuthToken(token);
+ this.tinode.connect().catch((err) => {
+ // Socket error
+ this.handleError(err.message, 'err');
+ });
+ delete parsedNav.params.info;
+ delete parsedNav.params.tab;
+ parsedNav.path[0] = '';
+ HashNavigation.navigateTo(HashNavigation.composeUrlHash(parsedNav.path, parsedNav.params));
+ } else if (!parsedNav.params.token) {
+ HashNavigation.navigateTo('');
+ }
+
+ this.readTimer = null;
+ this.readTimerCallback = null;
+
+ this.handleHashRoute();
+ }
+
+ componentWillUnmount() {
+ window.removeEventListener('resize', this.handleResize);
+ window.removeEventListener('hashchange', this.handleHashRoute);
+ document.removeEventListener('visibilitychange', this.handleVisibilityEvent);
+ }
+
+ // Setup transport (usually websocket) and server address. This will terminate connection with the server.
+ static tnSetup(serverAddress, transport) {
+ let tinode = new Tinode(APP_NAME, serverAddress, API_KEY, transport, isSecureConnection());
+ tinode.enableLogging(true, true);
+ return tinode;
+ }
+
+ handleResize() {
+ var mobile = document.documentElement.clientWidth <= MEDIA_BREAKPOINT;
+ this.setState({viewportWidth: document.documentElement.clientWidth});
+ if (this.state.displayMobile != mobile) {
+ this.setState({displayMobile: mobile});
+ }
+ }
+
+ // Handle for hashchange event: display appropriate panels.
+ handleHashRoute() {
+ var hash = HashNavigation.parseUrlHash(window.location.hash);
+ if (hash.path && hash.path.length > 0) {
+ // Left-side panel selector.
+ if (['register','settings','edit','cred','reset','newtpk','contacts',''].includes(hash.path[0])) {
+ this.setState({sidePanelSelected: hash.path[0]});
+ } else {
+ console.log("Unknown sidepanel view", hash.path[0]);
+ }
+
+ // Topic for MessagesView selector.
+ if (hash.path.length > 1 && hash.path[1] != this.state.topicSelected) {
+ this.setState({
+ topicSelected: Tinode.topicType(hash.path[1]) ? hash.path[1] : null
+ });
+ }
+ } else {
+ // Empty hashpath
+ this.setState({sidePanelSelected: ''});
+ }
+
+ // Save validation credentials, if available.
+ if (hash.params.method) {
+ this.setState({ credMethod: hash.params.method });
+ }
+ if (hash.params.code) {
+ this.setState({ credCode: hash.params.code });
+ }
+
+ // Additional parameters of panels.
+ this.setState({
+ showInfoPanel: hash.params.info,
+ newTopicTabSelected: hash.params.tab
+ });
+ }
+
+ handleOnline(online) {
+ var newState = {liveConnection: online};
+ if (online) {
+ this.handleError('', null);
+ } else {
+ this.handleError("No connection", 'warn');
+ }
+ this.setState({liveConnection: online});
+ }
+
+ // Handling read notifications here to be able to pause
+ // them then the window/tab is not visible.
+ handleAppVisibility(visible, callback) {
+ clearTimeout(this.readTimer);
+ this.readTimerCallback = callback;
+ if (visible && callback) {
+ this.readTimer = setTimeout(callback, READ_DELAY);
+ } else {
+ this.readTimer = null;
+ }
+ }
+
+ handleReadTimer(callback) {
+ this.handleAppVisibility(!document.hidden, callback);
+ }
+
+ handleVisibilityEvent() {
+ this.handleAppVisibility(!document.hidden, this.readTimerCallback);
+ }
+
+ handleError(err, level) {
+ this.setState({errorText: err, errorLevel: level});
+ }
+
+ // User clicked Login button in the side panel.
+ handleLoginRequest(login, password) {
+ this.setState({loginDisabled: true, login: login, password: password});
+ this.handleError('', null);
+
+ if (this.tinode.isConnected()) {
+ this.doLogin(login, password, {meth: this.state.credMethod, resp: this.state.credCode});
+ } else {
+ this.tinode.connect().catch((err) => {
+ // Socket error
+ this.setState({loginDisabled: false});
+ this.handleError(err.message, 'err');
+ });
+ }
+ }
+
+ // Connection succeeded.
+ handleConnected() {
+ var params = this.tinode.getServerInfo();
+ this.setState({
+ serverVersion: params.ver + ' ' + (params.build ? params.build : 'none') + '; '
+ });
+ this.doLogin(this.state.login, this.state.password, {meth: this.state.credMethod, resp: this.state.credCode});
+ }
+
+ doLogin(login, password, cred) {
+ if (this.tinode.isAuthenticated()) {
+ // Already logged in. Go to default screen.
+ HashNavigation.navigateTo('');
+ return;
+ }
+ // Sanitize and package credentail.
+ cred = Tinode.credential(cred);
+ // Try to login with login/password. If they are not available, try token. If no token, ask for login/password.
+ let promise = null;
+ let token = this.tinode.getAuthToken();
+ if (login && password) {
+ this.setState({password: null});
+ promise = this.tinode.loginBasic(login, password, cred);
+ } else if (token) {
+ promise = this.tinode.loginToken(token.token, cred);
+ }
+
+ if (promise) {
+ promise.then((ctrl) => {
+ if (ctrl.code >= 300 && ctrl.text === 'validate credentials') {
+ if (cred) {
+ this.handleError("Code does not match", 'warn');
+ }
+ this.handleCredentialsRequest(ctrl.params);
+ } else {
+ this.handleLoginSuccessful();
+ }
+ }).catch((err) => {
+ // Login failed, report error.
+ this.setState({loginDisabled: false, credMethod: undefined, credCode: undefined});
+ this.handleError(err.message, 'err');
+ localStorage.removeItem('auth-token');
+ HashNavigation.navigateTo('');
+ });
+ } else {
+ // No login credentials provided.
+ // Make sure we are on the login page.
+ HashNavigation.navigateTo('');
+ this.setState({loginDisabled: false});
+ }
+ }
+
+ handleCredentialsRequest(params) {
+ var parsed = HashNavigation.parseUrlHash(window.location.hash);
+ parsed.path[0] = 'cred';
+ parsed.params['method'] = params.cred[0];
+ HashNavigation.navigateTo(HashNavigation.composeUrlHash(parsed.path, parsed.params));
+ }
+
+ handleLoginSuccessful() {
+ this.handleError('', null);
+
+ // Refresh authentication token.
+ if (LocalStorageUtil.getObject('keep-logged-in')) {
+ LocalStorageUtil.setObject('auth-token', this.tinode.getAuthToken());
+ }
+ // Logged in fine, subscribe to 'me' attaching callbacks from the contacts view.
+ var me = this.tinode.getMeTopic();
+ me.onMetaDesc = this.tnMeMetaDesc;
+ me.onContactUpdate = this.tnMeContactUpdate;
+ me.onSubsUpdated = this.tnMeSubsUpdated;
+ this.setState({
+ connected: true,
+ credMethod: undefined,
+ credCode: undefined,
+ myUserId: this.tinode.getCurrentUserID()
+ });
+ // Subscribe, fetch topic desc, the list of subscriptions. Messages are not fetched.
+ me.subscribe(
+ me.startMetaQuery().
+ withLaterSub().
+ withDesc().
+ build()
+ ).catch((err) => {
+ localStorage.removeItem('auth-token');
+ this.handleError(err.message, 'err');
+ HashNavigation.navigateTo('');
+ });
+ HashNavigation.navigateTo(HashNavigation.setUrlSidePanel(window.location.hash, 'contacts'));
+ }
+
+ handleDisconnect(err) {
+ this.setState({
+ connected: false,
+ topicSelectedOnline: false,
+ dialogSelected: null,
+ errorText: err && err.message ? err.message : "Disconnected",
+ errorLevel: err && err.message ? 'err' : 'warn',
+ loginDisabled: false,
+ contextMenuVisible: false,
+ serverVersion: "no connection"
+ });
+ }
+
+ tnMeMetaDesc(desc) {
+ if (desc && desc.public) {
+ this.setState({
+ sidePanelTitle: desc.public.fn,
+ sidePanelAvatar: makeImageUrl(desc.public.photo)
+ });
+ }
+ }
+
+ // Reactions to updates to the contact list.
+ tnMeContactUpdate(what, cont) {
+ if (what == 'on' || what == 'off') {
+ this.resetContactList();
+ if (this.state.topicSelected == cont.topic) {
+ this.setState({topicSelectedOnline: (what == 'on')});
+ }
+ } else if (what == 'read') {
+ this.resetContactList();
+ } else if (what == 'msg') {
+ // New message received
+ // Skip update if the topic is currently open, otherwise the badge will annoyingly flash.
+ if (this.state.topicSelected != cont.topic) {
+ if (this.state.messageSounds) {
+ POP_SOUND.play();
+ }
+ this.resetContactList();
+ } else if (document.hidden && this.state.messageSounds) {
+ POP_SOUND.play();
+ }
+ } else if (what == 'recv') {
+ // Explicitly ignoring "recv" -- it causes no visible updates to contact list.
+ } else if (what == 'gone' || what == 'unsub') {
+ // Topic deleted or user unsubscribed. Remove topic from view.
+ // If the currently selected topic is gone, clear the selection.
+ if (this.state.topicSelected == cont.topic) {
+ this.handleTopicSelected(null);
+ }
+ // Redraw without the deleted topic.
+ this.resetContactList();
+ } else if (what == 'acs') {
+ // Permissions changed. If it's for the currently selected topic,
+ // update the views.
+ if (this.state.topicSelected == cont.topic) {
+ this.setState({topicSelectedAcs: cont.acs});
+ }
+ } else if (what == 'del') {
+ // messages deleted (hard or soft) -- update pill counter.
+ } else {
+ // TODO(gene): handle other types of notifications:
+ // * ua -- user agent changes (maybe display a pictogram for mobile/desktop).
+ // * upd -- topic 'public' updated, issue getMeta().
+ console.log("Unsupported (yet) presence update:" + what + " in: " + cont.topic);
+ }
+ }
+
+ tnMeSubsUpdated(unused) {
+ this.resetContactList();
+ }
+
+ // Merge search results and contact list to create a single flat
+ // list of kown contacts for GroupManager to use.
+ static prepareSearchableContacts(chatList, foundContacts) {
+ let merged = {};
+
+ // For chatList topics merge only p2p topics and convert them to the
+ // same format as foundContacts.
+ for (const c of chatList) {
+ if (Tinode.topicType(c.topic) == 'p2p') {
+ merged[c.topic] = {
+ user: c.topic,
+ updated: c.updated,
+ public: c.public,
+ private: c.private,
+ acs: c.acs
+ };
+ }
+ }
+
+ // Add all foundCountacts if they have not been added already.
+ for (const c of foundContacts) {
+ if (!merged[c.user]) {
+ merged[c.user] = c;
+ }
+ }
+
+ return Object.values(merged);
+ }
+
+ resetContactList() {
+ let newState = {
+ chatList: []
+ };
+ this.tinode.getMeTopic().contacts((c) => {
+ newState.chatList.push(c);
+ if (this.state.topicSelected == c.topic) {
+ newState.topicSelectedOnline = c.online;
+ newState.topicSelectedAcs = c.acs;
+ }
+ });
+ // Merge search results and chat list.
+ newState.searchableContacts = TinodeWeb.prepareSearchableContacts(newState.chatList, this.state.searchResults);
+ this.setState(newState);
+ }
+
+ // Sending "received" notifications
+ tnData(data) {
+ let topic = this.tinode.getTopic(data.topic);
+ if (topic.msgStatus(data) >= Tinode.MESSAGE_STATUS_SENT) {
+ clearTimeout(this.receivedTimer);
+ this.receivedTimer = setTimeout(() => {
+ this.receivedTimer = undefined;
+ topic.noteRecv(data.seq);
+ }, RECEIVED_DELAY);
+ }
+ }
+
+ /* Fnd topic: find contacts by tokens */
+ tnInitFind() {
+ let fnd = this.tinode.getFndTopic();
+ if (fnd.isSubscribed()) {
+ this.tnFndSubsUpdated();
+ } else {
+ fnd.onSubsUpdated = this.tnFndSubsUpdated;
+ fnd.subscribe(fnd.startMetaQuery().withSub().withTags().build()).catch((err) => {
+ this.handleError(err.message, 'err');
+ });
+ }
+ }
+
+ tnFndSubsUpdated() {
+ let foundContacts = [];
+ // Don't attempt to create P2P topics which already exist. Server will reject the duplicates.
+ this.tinode.getFndTopic().contacts((s) => {
+ foundContacts.push(s);
+ });
+ this.setState({
+ searchResults: foundContacts,
+ searchableContacts: TinodeWeb.prepareSearchableContacts(this.state.chatList, foundContacts)
+ });
+ }
+
+ /** Called when the user enters a contact into the contact search field in the NewAccount panel
+ @param query {Array} is an array of contacts to search for
+ */
+ handleSearchContacts(query) {
+ var fnd = this.tinode.getFndTopic();
+ fnd.setMeta({desc: {public: query}}).then((ctrl) => {
+ return fnd.getMeta(fnd.startMetaQuery().withSub().build());
+ }).catch((err) => {
+ this.handleError(err.message, 'err');
+ });
+ }
+
+ // User clicked on a contact in the side panel or deleted a contact.
+ handleTopicSelected(topicName, unused_index, online, acs) {
+ if (topicName) {
+ this.setState({
+ errorText: '',
+ errorLevel: null,
+ mobilePanel: 'topic-view',
+ showInfoPanel: false
+ });
+ // Different contact selected.
+ if (this.state.topicSelected != topicName) {
+ this.setState({
+ topicSelectedOnline: online,
+ topicSelectedAcs: acs
+ });
+ HashNavigation.navigateTo(HashNavigation.setUrlTopic('', topicName));
+ }
+ } else {
+ // Currently selected contact deleted
+ this.setState({
+ errorText: '',
+ errorLevel: null,
+ mobilePanel: 'sidepanel',
+ topicSelectedOnline: false,
+ topicSelectedAcs: null,
+ showInfoPanel: false
+ });
+ if (this.state.topicSelected) {
+ HashNavigation.navigateTo(HashNavigation.setUrlTopic('', null));
+ }
+ }
+ }
+
+ // In mobile view user requested to show sidepanel
+ handleHideMessagesView() {
+ this.setState({
+ mobilePanel: 'sidepanel'
+ });
+ HashNavigation.navigateTo(HashNavigation.setUrlTopic(window.location.hash, null));
+ }
+
+ // User is sending a message, either plain text or a drafty object, possibly
+ // with attachments.
+ handleSendMessage(msg, promise, uploader) {
+ let topic = this.tinode.getTopic(this.state.topicSelected);
+
+ msg = topic.createMessage(msg, false);
+ // The uploader is used to show progress.
+ msg._uploader = uploader;
+
+ if (!topic.isSubscribed()) {
+ if (!promise) {
+ promise = Promise.resolve();
+ }
+ promise = promise.then(() => { return topic.subscribe(); });
+ }
+
+ if (promise) {
+ promise = promise.catch((err) => {
+ this.handleError(err.message, 'err');
+ });
+ }
+
+ topic.publishDraft(msg, promise)
+ .catch((err) => {
+ this.handleError(err.message, 'err');
+ });
+ }
+
+ // User chose a Sign Up menu item.
+ handleNewAccount() {
+ HashNavigation.navigateTo(HashNavigation.setUrlSidePanel(window.location.hash, 'register'));
+ }
+
+ // Actual registration of a new account.
+ handleNewAccountRequest(login_, password_, public_, cred_, tags_) {
+ this.tinode.connect(this.state.serverAddress)
+ .then(() => {
+ return this.tinode.createAccountBasic(login_, password_,
+ {public: public_, tags: tags_, cred: Tinode.credential(cred_)});
+ }).then((ctrl) => {
+ if (ctrl.code >= 300 && ctrl.text == 'validate credentials') {
+ this.handleCredentialsRequest(ctrl.params);
+ } else {
+ this.handleLoginSuccessful(this);
+ }
+ }).catch((err) => {
+ this.handleError(err.message, 'err');
+ });
+ }
+
+ handleUpdateAccountRequest(password, pub, defacs) {
+ if (pub || defacs) {
+ this.tinode.getMeTopic().setMeta({desc: {public: pub, defacs: defacs}}).catch((err) => {
+ this.handleError(err.message, 'err');
+ });
+ }
+ if (password) {
+ this.tinode.updateAccountBasic(null, this.tinode.getCurrentLogin(), password).catch((err) => {
+ this.handleError(err.message, 'err');
+ });
+ }
+ }
+
+ handleUpdateAccountTagsRequest(tags) {
+ this.tinode.getFndTopic().setMeta({tags: tags})
+ .catch((err) => {
+ this.handleError(err.message, 'err');
+ });
+ }
+
+ // User chose Settings menu item.
+ handleSettings() {
+ HashNavigation.navigateTo(HashNavigation.setUrlSidePanel(window.location.hash,
+ this.state.myUserId ? 'edit' : 'settings'));
+ }
+
+ // User updated global parameters.
+ handleGlobalSettings(settings) {
+ let serverAddress = settings.serverAddress || this.state.serverAddress;
+ let transport = settings.transport || this.state.transport;
+ if (this.tinode) {
+ this.tinode.onDisconnect = undefined;
+ this.tinode.disconnect();
+ }
+ this.tinode = TinodeWeb.tnSetup(serverAddress, transport);
+ this.tinode.onConnect = this.handleConnected;
+ this.tinode.onDisconnect = this.handleDisconnect;
+
+ this.setState({
+ serverAddress: serverAddress,
+ transport: transport
+ });
+ LocalStorageUtil.setObject('settings', {
+ serverAddress: serverAddress,
+ transport: transport
+ });
+
+ HashNavigation.navigateTo(HashNavigation.setUrlSidePanel(window.location.hash, ''));
+ }
+
+ // Initialize desktop alerts = push notifications.
+ initDesktopAlerts() {
+ // Google could not be bothered to mention that
+ // onTokenRefresh is never called.
+ this.fbPush.onTokenRefresh(() => {
+ this.requestPushToken(true);
+ });
+
+ this.fbPush.onMessage((payload) => {
+ // No need to do anything about it.
+ // All the magic happends in the service worker.
+ });
+ }
+
+ togglePushToken(enabled) {
+ if (enabled) {
+ if (!this.state.firebaseToken) {
+ this.fbPush.requestPermission().then(() => {
+ this.requestPushToken(true);
+ }).catch((err) => {
+ this.handleError(err.message, 'err');
+ this.setState({desktopAlerts: false, firebaseToken: null});
+ LocalStorageUtil.updateObject('settings', {desktopAlerts: false});
+ console.log("Failed to get permission to notify.", err);
+ });
+ } else {
+ this.setState({desktopAlerts: true});
+ LocalStorageUtil.updateObject('settings', {desktopAlerts: true});
+ }
+ } else if (this.state.firebaseToken) {
+ this.fbPush.deleteToken(this.state.firebaseToken).catch((err) => {
+ console.log("Unable to delete token.", err);
+ }).finally(() => {
+ LocalStorageUtil.updateObject('settings', {desktopAlerts: false});
+ localStorage.removeItem('firebase-token');
+ this.setState({desktopAlerts: false, firebaseToken: null});
+ });
+ } else {
+ this.setState({desktopAlerts: false, firebaseToken: null});
+ LocalStorageUtil.updateObject('settings', {desktopAlerts: false});
+ }
+ }
+
+ requestPushToken(sendToServer) {
+ this.fbPush.getToken().then((refreshedToken) => {
+ if (refreshedToken != this.state.firebaseToken) {
+ this.tinode.setDeviceToken(refreshedToken, sendToServer);
+ LocalStorageUtil.setObject('firebase-token', refreshedToken);
+ }
+ this.setState({firebaseToken: refreshedToken, desktopAlerts: true});
+ LocalStorageUtil.updateObject('settings', {desktopAlerts: true});
+ }).catch((err) => {
+ this.handleError(err.message, 'err');
+ console.log("Failed to retrieve firebase token", err);
+ });
+ }
+
+ handleToggleMessageSounds(enabled) {
+ this.setState({messageSounds: enabled});
+ LocalStorageUtil.updateObject('settings', {
+ messageSoundsOff: !enabled
+ });
+ }
+
+ // User clicked Cancel button in Setting or Sign Up panel.
+ handleSidepanelCancel() {
+ var parsed = HashNavigation.parseUrlHash(window.location.hash);
+ parsed.path[0] = this.state.myUserId ? 'contacts' : '';
+ if (parsed.params) {
+ delete parsed.params.code;
+ delete parsed.params.method;
+ delete parsed.params.tab;
+ }
+ HashNavigation.navigateTo(HashNavigation.composeUrlHash(parsed.path, parsed.params));
+ this.setState({errorText: '', errorLevel: null});
+ }
+
+ // User clicked a (+) menu item.
+ handleNewTopic() {
+ HashNavigation.navigateTo(HashNavigation.setUrlSidePanel(window.location.hash, 'newtpk'));
+ }
+
+ // Request to start a new topic. New P2P topic requires peer's name.
+ handleNewTopicRequest(peerName, pub, priv, tags) {
+ var topicName = peerName || this.tinode.newGroupTopicName();
+ if (!peerName) {
+ this.setState(
+ {newGroupTopicParams: {desc: {public: pub, private: {comment: priv}}, tags: tags}},
+ () => {this.handleTopicSelected(topicName)}
+ );
+ } else {
+ this.handleTopicSelected(topicName);
+ }
+ }
+
+ // New topic was creted, here is the new topic name.
+ handleNewTopicCreated(oldName, newName) {
+ if (this.state.topicSelected == oldName && oldName != newName) {
+ // If the current URl contains the old topic name, replace it with new.
+ // Update the name of the selected topic first so the navigator doen't clear
+ // the state.
+ this.setState({topicSelected: newName}, () => {
+ HashNavigation.navigateTo(HashNavigation.setUrlTopic('', newName));
+ });
+ }
+ }
+
+ handleTopicUpdateRequest(topicName, pub, priv, permissions) {
+ var topic = this.tinode.getTopic(topicName);
+ if (topic) {
+ var params = {};
+ if (pub) {
+ params.public = pub;
+ }
+ if (priv) {
+ params.private = (priv === Tinode.DEL_CHAR) ?
+ Tinode.DEL_CHAR : {comment: priv};
+ }
+ if (permissions) {
+ params.defacs = permissions;
+ }
+ topic.setMeta({desc: params}).catch((err) => {
+ this.handleError(err.message, 'err');
+ });
+ }
+ }
+
+ handleChangePermissions(topicName, mode, uid) {
+ var topic = this.tinode.getTopic(topicName);
+ if (topic) {
+ var am = topic.getAccessMode();
+ if (uid) {
+ am.updateGiven(mode);
+ mode = am.getGiven();
+ } else {
+ am.updateWant(mode);
+ mode = am.getWant();
+ }
+ topic.setMeta({sub: {user: uid, mode: mode}}).catch((err) => {
+ this.handleError(err.message, 'err');
+ });
+ }
+ }
+
+ handleTagsUpdated(topicName, tags) {
+ var topic = this.tinode.getTopic(topicName);
+ if (topic) {
+ var instance = this;
+ topic.setMeta({tags: tags}).catch((err) => {
+ this.handleError(err.message, 'err');
+ });
+ }
+ }
+
+ handleLogout() {
+ updateFavicon(0);
+ localStorage.removeItem('auth-token');
+ if (this.tinode) {
+ this.tinode.onDisconnect = undefined;
+ this.tinode.disconnect();
+ }
+ this.setState(this.getBlankState());
+ this.tinode = TinodeWeb.tnSetup(this.state.serverAddress, this.state.transport);
+ this.tinode.onConnect = this.handleConnected;
+ this.tinode.onDisconnect = this.handleDisconnect;
+ HashNavigation.navigateTo('');
+ }
+
+ handleLeaveUnsubRequest(topicName) {
+ var topic = this.tinode.getTopic(topicName);
+ if (!topic) {
+ return;
+ }
+
+ topic.leave(true).then((ctrl) => {
+ // Hide MessagesView and InfoView panels.
+ HashNavigation.navigateTo(HashNavigation.setUrlTopic(window.location.hash, ''));
+ }).catch((err) => {
+ this.handleError(err.message, 'err');
+ });
+ }
+
+ handleDialogCancel() {
+ this.setState({dialogSelected: null});
+ }
+
+ handleShowContextMenu(params, menuItems) {
+ this.setState({
+ contextMenuVisible: true,
+ contextMenuClickAt: {x: params.x, y: params.y},
+ contextMenuParams: params,
+ contextMenuItems: menuItems || this.defaultTopicContextMenu(params.topicName),
+ contextMenuBounds: ReactDOM.findDOMNode(this).getBoundingClientRect()
+ });
+ }
+
+ defaultTopicContextMenu(topicName) {
+ const topic = this.tinode.getTopic(topicName);
+ const {formatMessage} = this.props.intl;
+
+ let muted = false, blocked = false, subscribed = false, deleter = false;
+ if (topic) {
+ if (topic.isSubscribed()) {
+ subscribed = true;
+
+ let acs = topic.getAccessMode();
+ muted = acs && acs.isMuted();
+ blocked = acs && !acs.isJoiner();
+ deleter = acs && acs.isDeleter();
+ }
+ }
+
+ return [
+ subscribed ? {title: formatMessage({id: 'menu_item_info'}), handler: this.handleShowInfoView} : null,
+ subscribed ? 'messages_clear' : null,
+ subscribed && deleter ? 'messages_clear_hard' : null,
+ subscribed ? (muted ? 'topic_unmute' : 'topic_mute') : null,
+ subscribed ? (blocked ? 'topic_unblock' : 'topic_block') : null,
+ 'topic_delete'
+ ];
+ }
+
+ handleHideContextMenu() {
+ this.setState({
+ contextMenuVisible: false,
+ contextMenuClickAt: null,
+ contextMenuParams: null,
+ contextMenuBounds: null
+ });
+ }
+
+ handleShowInfoView() {
+ HashNavigation.navigateTo(HashNavigation.addUrlParam(window.location.hash, 'info', true));
+ this.setState({showInfoPanel: true});
+ }
+
+ handleHideInfoView() {
+ HashNavigation.navigateTo(HashNavigation.removeUrlParam(window.location.hash, 'info'));
+ this.setState({showInfoPanel: false});
+ }
+
+ handleMemberUpdateRequest(topicName, added, removed) {
+ if (!topicName) {
+ return;
+ }
+
+ var topic = this.tinode.getTopic(topicName);
+ if (!topic) {
+ return;
+ }
+
+ if (added && added.length > 0) {
+ added.map((uid) => {
+ topic.invite(uid, null).catch((err) => {
+ this.handleError(err.message, 'err');
+ });
+ });
+ }
+
+ if (removed && removed.length > 0) {
+ removed.map((uid) => {
+ topic.delSubscription(uid).catch((err) => {
+ this.handleError(err.message, 'err');
+ });
+ });
+ }
+ }
+
+ handleValidateCredentialsRequest(cred, code) {
+ this.setState({credMethod: cred, credCode: code});
+ this.doLogin(null, null, {meth: cred, resp: code});
+ }
+
+ handlePasswordResetRequest(method, value) {
+ // If already connected, connnect() will return a resolved promise.
+ this.tinode.connect()
+ .then(() => {
+ return this.tinode.requestResetAuthSecret('basic', method, value)
+ })
+ .catch((err) => {
+ // Socket error
+ this.handleError(err.message, 'err');
+ });
+ }
+
+ handleResetPassword(scheme, newPassword, token) {
+ token = base64ReEncode(token);
+ if (!token) {
+ this.handleError("Invalid security token", 'err');
+ } else {
+ this.tinode.connect()
+ .then(() => {
+ return this.tinode.updateAccountBasic(null, null, newPassword, {token: token});
+ })
+ .catch((err) => {
+ // Socket error
+ this.handleError(err.message, 'err');
+ });
+ }
+ }
+
+ render() {
+ return (
+
+ {this.state.contextMenuVisible ?
+
+ :
+ null
+ }
+
+
+
+
+
+ {this.state.showInfoPanel ?
+
+ :
+ null
+ }
+
+ );
+ }
+};
+
+export default injectIntl(TinodeWeb);
diff --git a/src/views/validation-view.jsx b/src/views/validation-view.jsx
new file mode 100644
index 00000000..6e839987
--- /dev/null
+++ b/src/views/validation-view.jsx
@@ -0,0 +1,81 @@
+// ValidationView: panel for confirming credentials, like email or phone.
+import React from 'react';
+import { FormattedMessage, defineMessages, injectIntl } from 'react-intl';
+
+const messages = defineMessages({
+ phone: {
+ id: 'phone_dative',
+ defaultMessage: 'phone',
+ description: "Dative case of 'phone', i.e. 'phone' in 'by phone'",
+ },
+ email: {
+ id: 'email_dative',
+ defaultMessage: 'email',
+ description: "Dative case of 'email', i.e. 'email' in 'by email'",
+ }
+});
+
+class ValidationView extends React.PureComponent {
+ constructor(props) {
+ super(props);
+
+ this.state = {
+ code: props.credCode || ''
+ };
+
+ this.handleChange = this.handleChange.bind(this);
+ this.handleKeyPress = this.handleKeyPress.bind(this);
+ this.handleSubmit = this.handleSubmit.bind(this);
+ }
+
+ handleChange(e) {
+ this.setState({code: e.target.value});
+ }
+
+ handleKeyPress(e) {
+ if (e.key === 'Enter') {
+ this.handleSubmit(e);
+ }
+ }
+
+ handleSubmit(e) {
+ e.preventDefault();
+ if (this.state.code && this.state.code.trim()) {
+ this.props.onSubmit(this.props.credMethod, this.state.code.trim());
+ }
+ }
+
+ render() {
+ const { formatMessage } = this.props.intl;
+ const methods = {'email': formatMessage(messages.email), 'tel': formatMessage(messages.phone)};
+ let method = methods[this.props.credMethod] || this.props.credMethod;
+ return (
+
+
+
+
+
+
+
+ {
+ (numbers_only) =>
+ }
+
+
+
+
+
+
+
+ );
+ }
+};
+
+export default injectIntl(ValidationView);
diff --git a/src/webapp.jsx b/src/webapp.jsx
deleted file mode 100644
index c3810ddd..00000000
--- a/src/webapp.jsx
+++ /dev/null
@@ -1,5631 +0,0 @@
-// Babel JSX
-
-'use strict';
-
-if (typeof require == 'function') {
- if (typeof React == 'undefined') {
- var React = require('react');
- var ReactDOM = require('react-dom');
- }
- if (typeof Tinode == 'undefined') {
- var Tinode = require('tinode-sdk');
- var Drafty = Tinode.Drafty;
- }
- if (typeof firebase == 'undefined') {
- var firebase = require('firebase/app');
- require('firebase/messaging');
- }
- var package_version = require('../version.json').version;
-}
-
-// Name of this application, used in the User-Agent.
-const APP_NAME = 'TinodeWeb/' + (package_version || '0.15');
-
-const KNOWN_HOSTS = {hosted: 'api.tinode.co', local: 'localhost:6060'};
-// Default host name and port to connect to.
-const DEFAULT_HOST = KNOWN_HOSTS.hosted;
-// var DEFAULT_HOST = KNOWN_HOSTS.local;
-
-// Sound to play on message received.
-const POP_SOUND = new Audio('audio/msg.mp3');
-
-// API key. Use https://github.com/tinode/chat/tree/master/keygen to generate your own
-const API_KEY = 'AQEAAAABAAD_rAp4DJh05a1HAwFT3A6K';
-
-// Minimum time between two keypress notifications, milliseconds.
-const KEYPRESS_DELAY = 3*1000;
-// Delay before sending a {note} for reciving a message, milliseconds.
-const RECEIVED_DELAY = 500;
-// Delay before sending a read notification, milliseconds.
-const READ_DELAY = 1000;
-
-// The shortest allowed tag length. Matches one on the server.
-const MIN_TAG_LENGTH = 4;
-
-// Mediaquery breakpoint between desktop and mobile, in px. Should match the value
-// in @meadia (max-size: 640px) in base.css
-const MEDIA_BREAKPOINT = 640;
-// Size of css 'rem' unit in pixels. Default 1rem = 10pt = 13px.
-const REM_SIZE = 13;
-
-// Size of the avatar image
-const AVATAR_SIZE = 128;
-
-// Number of chat messages to fetch in one call.
-const MESSAGES_PAGE = 24;
-
-// Maximum in-band (included directly into the message) attachment size which fits into
-// a message of 256K in size, assuming base64 encoding and 1024 bytes of overhead.
-// This is size of an object *before* base64 encoding is applied.
-// Increase this limit to a greater value in production, if desired. Also increase
-// max_message_size in server config.
-// MAX_INBAND_ATTACHMENT_SIZE = base64DecodedLen(max_message_size - overhead);
-const MAX_INBAND_ATTACHMENT_SIZE = 195840;
-
-// Absolute maximum attachment size to be used with the server = 8MB. Increase to
-// something like 100MB in production.
-const MAX_EXTERN_ATTACHMENT_SIZE = 1 << 23;
-
-// Maximum allowed linear dimension of an inline image in pixels. You may want
-// to adjust it to 1600 or 2400 for production.
-const MAX_IMAGE_DIM = 768;
-
-// Supported image MIME types and corresponding file extensions.
-const SUPPORTED_IMAGE_FORMATS = ['image/jpeg', 'image/gif', 'image/png', 'image/svg', 'image/svg+xml'];
-const MIME_EXTENSIONS = ['jpg', 'gif', 'png', 'svg', 'svg'];
-
-// Helper functions for storing values in localStorage.
-// By default localStorage can store only strings, not objects or other types.
-
-// Replace old object with the new one.
-Storage.prototype.setObject = function(key, value) {
- this.setItem(key, JSON.stringify(value));
-}
-// Get stored object.
-Storage.prototype.getObject = function(key) {
- let value = this.getItem(key);
- return value && JSON.parse(value);
-}
-// Partially or wholly update stored object.
-Storage.prototype.updateObject = function(key, value) {
- let oldVal = this.getObject(key);
- this.setObject(key, Object.assign(oldVal || {}, value));
-}
-
-// Short representation of time in the past.
-function shortDateFormat(then) {
- var locale = window.navigator.userLanguage || window.navigator.language;
- var now = new Date();
- if (then.getFullYear() == now.getFullYear()) {
- if (then.getMonth() == now.getMonth() && then.getDate() == now.getDate()) {
- return then.toLocaleTimeString(locale, {hour12: false, hour: '2-digit', minute: '2-digit'});
- } else {
- return then.toLocaleDateString(locale,
- {hour12: false, month: 'short', day: 'numeric', hour: '2-digit', minute: '2-digit'});
- }
- }
- return then.toLocaleDateString(locale,
- {hour12: false, year: 'numeric', month: 'short', day: 'numeric', hour: '2-digit', minute: '2-digit'});
-}
-
-// Convert a number of bytes to human-readable format.
-function bytesToHumanSize(bytes) {
- if (!bytes || bytes == 0) {
- return '0 Bytes';
- }
-
- var sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB'];
- var bucket = Math.min(Math.floor(Math.log2(bytes) / 10) | 0, sizes.length-1);
- var count = bytes / Math.pow(1024, bucket);
- var round = bucket > 0 ? (count < 3 ? 2 : (count < 30 ? 1 : 0)) : 0;
- return count.toFixed(round) + ' ' + sizes[bucket];
-}
-
-// Make a data URL from public.photo
-function makeImageUrl(photo) {
- return (photo && photo.type && photo.data) ?
- 'data:image/' + photo.type + ';base64,' + photo.data : null;
-}
-
-// Calculate linear dimensions for scaling image down to fit under a certain size.
-// Returns an object which contains destination sizes, source sizes, and offsets
-// into source (when making square images).
-function fitImageSize(width, height, maxWidth, maxHeight, forceSquare) {
- if (!width || !height || !maxWidth || !maxHeight) {
- return null;
- }
-
- if (forceSquare) {
- maxWidth = maxHeight = Math.min(maxWidth, maxHeight);
- }
-
- let scale = Math.min(
- Math.min(width, maxWidth) / width,
- Math.min(height, maxHeight) / height
- );
-
- let size = {
- dstWidth: (width * scale) | 0,
- dstHeight: (height * scale) | 0,
- };
-
- if (forceSquare) {
- // Also calculate parameters for making the image square.
- size.dstWidth = size.dstHeight = Math.min(size.dstWidth, size.dstHeight);
- size.srcWidth = size.srcHeight = Math.min(width, height);
- size.xoffset = ((width - size.srcWidth) / 2) | 0;
- size.yoffset = ((height - size.srcWidth) / 2) | 0;
- } else {
- size.xoffset = size.yoffset = 0;
- size.srcWidth = width;
- size.srcHeight = height;
- }
- return size;
-}
-
-// Ensure file's extension matches mime content type
-function fileNameForMime(fname, mime) {
- var idx = SUPPORTED_IMAGE_FORMATS.indexOf(mime);
- var ext = MIME_EXTENSIONS[idx];
-
- var at = fname.lastIndexOf('.');
- if (at >= 0) {
- fname = fname.substring(0, at);
- }
- return fname + '.' + ext;
-}
-
-// Get mime type from data URL header.
-function getMimeType(header) {
- var mime = /^data:(image\/[-+a-z0-9.]+);base64/.exec(header);
- return (mime && mime.length > 1) ? mime[1] : null;
-}
-
-// Given length of a binary object in bytes, calculate the length after
-// base64 encoding.
-function base64EncodedLen(n) {
- return Math.floor((n + 2) / 3) * 4;
-}
-
-// Given length of a base64-encoded object, calculate decoded size of the
-// pbject in bytes.
-function base64DecodedLen(n) {
- return Math.floor(n / 4) * 3;
-}
-
-// Re-encode string to standard base64 encoding with padding.
-// The string may be base64-URL encoded without the padding.
-function base64ReEncode(str) {
- if (str) {
- str = str.replace('-', '+').replace('_', '/');
- try {
- str = btoa(atob(str));
- } catch(err) {
- console.log("Failed to base64 re-decode string");
- str = null;
- }
- }
- return str;
-}
-
-// Convert uploaded image into a base64-encoded string possibly scaling
-// linear dimensions or constraining to a square.
-function imageFileScaledToBase64(file, width, height, forceSquare, onSuccess, onError) {
- var img = new Image();
- img.crossOrigin = 'Anonymous';
- img.onerror = function(err) {
- onError("Image format unrecognized");
- }
- img.onload = function() {
- var dim = fitImageSize(this.width, this.height, width, height, forceSquare);
- if (!dim) {
- onError("Invalid image");
- return;
- }
- var canvas = document.createElement('canvas');
- canvas.width = dim.dstWidth;
- canvas.height = dim.dstHeight;
- var ctx = canvas.getContext('2d');
- ctx.imageSmoothingEnabled = true;
- ctx.drawImage(this, dim.xoffset, dim.yoffset, dim.srcWidth, dim.srcHeight,
- 0, 0, dim.dstWidth, dim.dstHeight);
-
- var mime = (this.width != dim.dstWidth ||
- this.height != dim.dstHeight ||
- SUPPORTED_IMAGE_FORMATS.indexOf(file.type) < 0) ? 'image/jpeg' : file.type;
- var imageBits = canvas.toDataURL(mime);
- var parts = imageBits.split(',');
- // Get actual image type: 'data:image/png;base64,'
- mime = getMimeType(parts[0]);
- if (!mime) {
- onError("Unsupported image format");
- return;
- }
- // Ensure the image is not too large
- var quality = 0.78;
- if (base64DecodedLen(imageBits.length) > MAX_INBAND_ATTACHMENT_SIZE) {
- mime = 'image/jpeg';
- }
- if (mime == 'image/jpeg') {
- // Reduce size of the jpeg by reducing image quality
- while (base64DecodedLen(imageBits.length) > MAX_INBAND_ATTACHMENT_SIZE && quality > 0.45) {
- imageBits = canvas.toDataURL(mime, quality);
- quality *= 0.84;
- }
- }
- if (base64DecodedLen(imageBits.length) > MAX_INBAND_ATTACHMENT_SIZE) {
- onError("The image size " + bytesToHumanSize(base64DecodedLen(imageBits.length)) +
- " exceeds the " + bytesToHumanSize(MAX_INBAND_ATTACHMENT_SIZE) + " limit.", "err");
- return;
- }
- canvas = null;
- onSuccess(imageBits.split(',')[1], mime, dim.dstWidth, dim.dstHeight, fileNameForMime(file.name, mime));
- };
- img.src = URL.createObjectURL(file);
-}
-
-// Convert uploaded image file to base64-encoded string without scaling/converting the image
-function imageFileToBase64(file, onSuccess, onError) {
- var reader = new FileReader();
- reader.addEventListener('load', function() {
- var parts = reader.result.split(',');
- var mime = getMimeType(parts[0]);
- if (!mime) {
- onError("Failed to process image file");
- return;
- }
-
- // Get image size.
- var img = new Image();
- img.crossOrigin = 'Anonymous';
- img.onload = function() {
- onSuccess(parts[1], mime, this.width, this.height, fileNameForMime(file.name, mime));
- }
- img.onerror = function(err) {
- onError("Image format not recognized");
- }
- img.src = URL.createObjectURL(file);
- }, false);
- reader.readAsDataURL(file);
-}
-
-function fileToBase64(file, onSuccess, onError) {
- var reader = new FileReader();
- reader.addEventListener('load', function() {
- onSuccess(file.type, reader.result.split(',')[1], file.name);
- });
- reader.readAsDataURL(file);
-}
-
-// File pasted from the clipboard. It's either an inline image or a file attachment.
-// FIXME: handle large files out of band.
-function filePasted(event, onImageSuccess, onAttachmentSuccess, onError) {
- var items = (event.clipboardData || event.originalEvent.clipboardData || {}).items;
- for (var i in items) {
- var item = items[i];
- if (item.kind === 'file') {
- var file = item.getAsFile();
- if (!file) {
- console.log("Failed to get file object from pasted file item", item.kind, item.type);
- continue;
- }
- if (file.type && file.type.split('/')[0] == 'image') {
- // Handle inline image
- if (file.size > MAX_INBAND_ATTACHMENT_SIZE || SUPPORTED_IMAGE_FORMATS.indexOf(file.type) < 0) {
- imageFileScaledToBase64(file, MAX_IMAGE_DIM, MAX_IMAGE_DIM, false, onImageSuccess, onError);
- } else {
- imageFileToBase64(file, onImageSuccess, onError);
- }
- } else {
- // Handle file attachment
- fileToBase64(file, onAttachmentSuccess, onError)
- }
- // Indicate that the pasted data contains a file.
- return true;
- }
- }
- // No file found.
- return false;
-}
-
-// Make shortcut icon appear with a green dot + show unread count in title.
-function updateFavicon(count) {
- var oldIcon = document.getElementById('shortcut-icon');
- if (oldIcon) {
- var head = document.head || document.getElementsByTagName('head')[0];
- var newIcon = document.createElement('link');
- newIcon.type = 'image/png';
- newIcon.id = 'shortcut-icon';
- newIcon.rel = 'shortcut icon';
- newIcon.href = 'img/logo32x32' + (count > 0 ? 'a' : '') + '.png';
- head.removeChild(oldIcon);
- head.appendChild(newIcon);
- }
- document.title = (count > 0 ? '('+count+') ' : '') + 'Tinode';
-}
-
-// Get 32 bit integer hash value for a string. Ideally it should produce the same value
-// as Java's String#hash().
-function stringHash(value) {
- var hash = 0;
- value = '' + value;
- for (var i = 0; i < value.length; i++) {
- hash = ((hash << 5) - hash) + value.charCodeAt(i);
- hash = hash & hash; // Convert to 32bit integer
- }
- return hash;
-}
-
-// Helper functions for hash navigation.
-
-// Parse hash as in http://www.example.com/path#hash as if it were
-// path and arguments.
-function parseUrlHash(hash) {
- // Split path from args, path -> parts[0], args->path[1]
- let parts = hash.split('?', 2);
- let params = {};
- let path = [];
- if (parts[0]) {
- path = parts[0].substr(1).split('/');
- }
- if (parts[1]) {
- parts[1].split('&').forEach(function(part) {
- let item = part.split('=');
- if (item[0]) {
- params[decodeURIComponent(item[0])] = decodeURIComponent(item[1]);
- }
- });
- }
- return {path: path, params: params};
-}
-
-function navigateTo(url) {
- window.location.hash = url;
-}
-
-function composeUrlHash(path, params) {
- var url = path.join('/');
- var args = [];
- for (var key in params) {
- if (params.hasOwnProperty(key)) {
- args.push(key + '=' + params[key]);
- }
- }
- if (args.length > 0) {
- url += '?' + args.join('&');
- }
- return url;
-}
-
-function addUrlParam(hash, key, value) {
- var parsed = parseUrlHash(hash);
- parsed.params[key] = value;
- return composeUrlHash(parsed.path, parsed.params);
-}
-
-function removeUrlParam(hash, key) {
- var parsed = parseUrlHash(hash);
- delete parsed.params[key];
- return composeUrlHash(parsed.path, parsed.params);
-}
-function setUrlSidePanel(hash, sidepanel) {
- var parsed = parseUrlHash(hash);
- parsed.path[0] = sidepanel;
- return composeUrlHash(parsed.path, parsed.params);
-}
-function setUrlTopic(hash, topic) {
- var parsed = parseUrlHash(hash);
- parsed.path[1] = topic;
- // Close InfoView on topic change.
- delete parsed.params.info;
- return composeUrlHash(parsed.path, parsed.params);
-}
-// END of hash navigation helper functions
-
-
-// Detect server address from the URL
-function detectServerAddress() {
- let host = DEFAULT_HOST;
- if (typeof window.location == 'object') {
- if (window.location.protocol == 'file:' || window.location.hostname == 'localhost') {
- host = KNOWN_HOSTS.local;
- } else if (window.location.hostname) {
- host = window.location.hostname + (window.location.port ? ':' + window.location.port : '');
- }
- }
- return host;
-}
-
-// Detect if the page is served over HTTPS.
-function isSecureConnection() {
- if (typeof window.location == 'object') {
- return window.location.protocol == 'https:';
- }
- return false;
-}
-
-function isLocalHost() {
- if (typeof window.location == 'object') {
- return window.location.hostname == 'localhost';
- }
- return false;
-}
-
-// Create VCard which represents topic 'public' info
-function vcard(fn, imageDataUrl) {
- var card = null;
-
- if ((fn && fn.trim()) || imageDataUrl) {
- card = {};
- if (fn) {
- card.fn = fn.trim();
- }
- if (imageDataUrl) {
- var dataStart = imageDataUrl.indexOf(',');
- card.photo = {
- data: imageDataUrl.substring(dataStart+1),
- type: 'jpg'
- };
- }
- }
- return card;
-}
-
-// Deep-shallow compare two arrays: shallow compare each element.
-function arrayEqual(a, b) {
- // Compare lengths first.
- if (a.length != b.length) {
- return false;
- }
- // Order of elements is ignored.
- a.sort();
- b.sort();
- for (var i = 0, l = a.length; i < l; i++) {
- if (a[i] !== b[i]) {
- return false;
- }
- }
- return true;
-}
-
-/* BEGIN Context Menu: popup/dropdown menu */
-
-class ContextMenu extends React.Component {
- constructor(props) {
- super(props);
-
- this.handlePageClick = this.handlePageClick.bind(this);
- this.handleEscapeKey = this.handleEscapeKey.bind(this);
- this.handleClick = this.handleClick.bind(this);
-
- // Preconfigured menu items.
- this.MenuItems = {
- 'topic_info': {title: "Info", handler: null},
-
- 'messages_clear': {title: "Clear messages", handler: (params, errorHandler) => {
- this.deleteMessages(true, false, params, errorHandler);
- }},
- 'messages_clear_hard': {title: "Clear for All", handler: (params, errorHandler) => {
- this.deleteMessages(true, true, params, errorHandler);
- }},
- 'message_delete': {title: "Delete", handler: (params, errorHandler) => {
- this.deleteMessages(false, false, params, errorHandler);
- }},
- 'message_delete_hard': {title: "Delete for All", handler: (params, errorHandler) => {
- this.deleteMessages(false, true, params, errorHandler);
- }},
- 'topic_unmute': {title: "Unmute", handler: this.topicPermissionSetter.bind(this, '+P')},
- 'topic_mute': {title: "Mute", handler: this.topicPermissionSetter.bind(this, '-P')},
- 'topic_unblock': {title: "Unblock", handler: this.topicPermissionSetter.bind(this, '+J')},
- 'topic_block': {title: "Block", handler: this.topicPermissionSetter.bind(this, '-J')},
- 'topic_delete': {title: "Delete", handler: (params, errorHandler) => {
- let topic = this.props.tinode.getTopic(params.topicName);
- if (!topic) {
- console.log("Topic not found: ", params.topicName);
- return;
- }
- topic.delTopic().catch((err) => {
- if (errorHandler) {
- errorHandler(err.message, 'err');
- }
- });
- }},
-
- 'permissions': {title: "Edit permissions", handler: null},
- 'member_delete': {title: "Remove", handler: (params, errorHandler) => {
- let topic = this.props.tinode.getTopic(params.topicName);
- if (!topic || !params.user) {
- console.log("Topic or user not found: '" + params.topicName + "', '" + params.user + "'");
- return;
- }
- topic.delSubscription(params.user).catch((err) => {
- if (errorHandler) {
- errorHandler(err.message, 'err');
- }
- });
- }},
- 'member_mute': {title: "Mute", handler: this.topicPermissionSetter.bind(this, '-P')},
- 'member_unmute': {title: "Unmute", handler: this.topicPermissionSetter.bind(this, '+P')},
- 'member_block': {title: "Block", handler: this.topicPermissionSetter.bind(this, '-J')},
- 'member_unblock': {title: "Unblock", handler: this.topicPermissionSetter.bind(this, '+J')},
- };
- }
-
- componentDidMount() {
- document.addEventListener('mousedown', this.handlePageClick, false);
- document.addEventListener('keyup', this.handleEscapeKey, false);
- }
-
- componentWillUnmount() {
- document.removeEventListener('mousedown', this.handlePageClick, false);
- document.removeEventListener('keyup', this.handleEscapeKey, false);
- }
-
- handlePageClick(e) {
- if (ReactDOM.findDOMNode(this).contains(e.target)) {
- return;
- }
- e.preventDefault();
- e.stopPropagation();
- this.props.hide();
- }
-
- handleEscapeKey(e) {
- if (e.keyCode === 27) {
- this.props.hide();
- }
- }
-
- handleClick(e) {
- e.preventDefault();
- e.stopPropagation();
- this.props.hide();
- let item = this.props.items[e.currentTarget.dataset.id];
- if (typeof item == 'string') {
- item = this.MenuItems[item];
- }
- item.handler(this.props.params, this.props.onError);
- }
-
- // Menu Actions
-
- deleteMessages(all, hard, params, errorHandler) {
- var topic = this.props.tinode.getTopic(params.topicName);
- if (!topic) {
- console.log("Topic not found: ", params.topicName);
- return;
- }
- // We don't know if the message is still pending (e.g. attachment is being uploaded),
- // so try cancelling first. No harm if we can't cancel.
- if (topic.cancelSend(params.seq)) {
- return Promise.resolve();
- }
- // Can't cancel. Delete instead.
- var promise = all ?
- topic.delMessagesAll(hard) :
- topic.delMessagesList([params.seq], hard);
- promise.catch((err) => {
- if (errorHandler) {
- errorHandler(err.message, 'err');
- }
- });
- }
-
- // Function is used by context menu to set permissions.
- topicPermissionSetter(mode, params, errorHandler) {
- var topic = this.props.tinode.getTopic(params.topicName);
- if (!topic) {
- console.log("Topic not found", params.topicName);
- return;
- }
-
- var am, user;
- if (params.user) {
- user = topic.subscriber(params.user);
- if (!user) {
- console.log("Subscriber not found", params.topicName + "[" + params.user + "]");
- return;
- }
- am = user.acs.updateGiven(mode).getGiven();
- } else {
- am = topic.getAccessMode().updateWant(mode).getWant();
- }
-
- topic.setMeta({sub: {user: params.user, mode: am}}).catch((err) => {
- if (errorHandler) {
- errorHandler(err.message, 'err');
- }
- });
- }
-
- render() {
- let count = 0;
- let menu = [];
- this.props.items.map((item) => {
- if (typeof item == 'string') {
- item = this.MenuItems[item];
- }
- if (item && item.title) {
- menu.push(
- item.title == '-' ?
-
- :
- {item.title}
- );
- }
- count++;
- });
-
- // Ensure that menu is inside the app-container.
- var hSize = 12 * REM_SIZE;
- var vSize = REM_SIZE * (0.7 + menu.length * 2.5);
- var left = (this.props.bounds.right - this.props.clickAt.x < hSize) ?
- (this.props.clickAt.x - this.props.bounds.left - hSize) :
- (this.props.clickAt.x - this.props.bounds.left);
- var top = (this.props.bounds.bottom - this.props.clickAt.y < vSize) ?
- (this.props.clickAt.y - this.props.bounds.top - vSize) :
- (this.props.clickAt.y - this.props.bounds.top);
-
- var position = {
- left: left + 'px',
- top: top + 'px'
- };
-
- return (
-
- );
- }
-}
-/* END Popup/dropdown menu */
-
-/* The X menu to be displayed in title bars */
-class MenuCancel extends React.PureComponent {
- constructor(props) {
- super(props);
- }
-
- render() {
- return (
- close
- );
- }
-}
-
-class LoadSpinner extends React.PureComponent {
- render() {
- return (this.props.show ?
- : null);
- }
-}
-
-// Toggle [Title text >] -> [Title text v]
-class MoreButton extends React.PureComponent {
- constructor(props) {
- super(props);
-
- this.state = {
- open: props.open
- };
- this.handleToggle = this.handleToggle.bind(this);
- }
-
- handleToggle() {
- let open = !this.state.open;
- this.setState({open: open});
- if (this.props.onToggle) {
- this.props.onToggle(open);
- }
- }
-
- render() {
- return ({this.props.title}...
- {this.state.open ? expand_more :
- chevron_right }
- );
- }
-}
-
-/* BEGIN Lettertile: Avatar box: either a bitmap or a letter tile or a stock icon. */
-class LetterTile extends React.PureComponent {
- render() {
- let avatar;
- if (this.props.avatar === true) {
- if (this.props.topic && this.props.title && this.props.title.trim()) {
- let letter = this.props.title.trim().charAt(0);
- let color = "lettertile dark-color" + (Math.abs(stringHash(this.props.topic)) % 16);
- avatar = ()
- } else {
- avatar = (Tinode.topicType(this.props.topic) == 'grp') ?
- group :
- person ;
- }
- } else if (this.props.avatar) {
- avatar = ;
- } else {
- avatar = null;
- }
- return avatar;
- }
-}
-/* END Lettertile */
-
-/* BEGIN In-place text editor. Shows text with an icon
- * which toggles it into an input field */
-class InPlaceEdit extends React.Component {
- constructor(props) {
- super(props);
-
- this.state = {
- active: props.active,
- initialValue: props.value || '',
- value: props.value || ''
- };
-
- this.handeTextChange = this.handeTextChange.bind(this);
- this.handleKeyDown = this.handleKeyDown.bind(this);
- this.handleStartEditing = this.handleStartEditing.bind(this);
- this.handleEditingFinished = this.handleEditingFinished.bind(this);
- this.handlePasswordFinished = this.handlePasswordFinished.bind(this);
- }
-
- static getDerivedStateFromProps(nextProps, prevState) {
- // If text has changed while in read mode, update text and discard changes.
- // Ignore update if in edit mode.
- if (prevState.initialValue != nextProps.value && !prevState.active) {
- return {
- initialValue: nextProps.value || '',
- value: nextProps.value || ''
- };
- }
- return null;
- }
-
- handeTextChange(e) {
- this.setState({value: e.target.value});
- }
-
- handleKeyDown(e) {
- if (e.keyCode === 27) {
- // Escape pressed
- this.setState({value: this.props.value, active: false});
- } else if (e.keyCode === 13) {
- // Enter pressed
- this.handleEditingFinished();
- }
- }
-
- handleStartEditing() {
- if (!this.props.readOnly) {
- ReactDOM.findDOMNode(this).focus();
- this.setState({active: true});
- }
- }
-
- handleEditingFinished() {
- this.setState({active: false});
- let value = this.state.value.trim();
- if ((value || this.props.value) && (value !== this.props.value)) {
- this.props.onFinished(value);
- }
- }
-
- handlePasswordFinished(value) {
- this.setState({active: false});
- if (value && (value !== this.props.value)) {
- this.props.onFinished(value);
- }
- }
-
- render() {
- if (this.state.active) {
- var fieldType = this.props.type || 'text';
- } else {
- var spanText = this.props.type == 'password' ? '••••••••' : this.state.value;
- var spanClass = 'in-place-edit' +
- (this.props.readOnly ? ' disabled' : '');
- if (!spanText) {
- spanText = this.props.placeholder;
- spanClass += ' placeholder';
- }
- if (spanText.length > 20) {
- // FIXME: this is wrong for RTL languages.
- spanText = spanText.substring(0, 19) + '...';
- }
- }
- return (
- this.state.active ?
- (fieldType == 'password' ?
-
- :
-
- )
- :
-
- {spanText}
-
- );
- }
-};
-
-class VisiblePassword extends React.PureComponent {
- constructor(props) {
- super(props);
-
- this.state = {
- value: this.props.value,
- visible: false
- };
-
- this.handleVisibility = this.handleVisibility.bind(this);
- this.handeTextChange = this.handeTextChange.bind(this);
- this.handleKeyDown = this.handleKeyDown.bind(this);
- this.handleEditingFinished = this.handleEditingFinished.bind(this);
- }
-
- handeTextChange(e) {
- this.setState({value: e.target.value});
- if (this.props.onChange) {
- this.props.onChange(e);
- }
- }
-
- handleVisibility(e) {
- e.preventDefault();
- this.setState({visible: !this.state.visible});
- }
-
- handleKeyDown(e) {
- if (e.keyCode == 27) {
- // Escape pressed
- this.setState({value: this.props.value, visible: false});
- if (this.props.onFinished) {
- this.props.onFinished();
- }
- } else if (e.keyCode == 13) {
- // Enter pressed
- this.handleEditingFinished();
- }
- }
-
- handleEditingFinished(e) {
- if (e) {
- let currentTarget = e.currentTarget;
- setTimeout(() => {
- if (!currentTarget.contains(document.activeElement)) {
- if (this.props.onFinished) {
- this.props.onFinished(this.state.value);
- }
- }
- }, 0);
- } else if (this.props.onFinished) {
- this.props.onFinished(this.state.value.trim());
- }
- }
-
- render() {
- return (
-
-
-
-
- {this.state.visible ? 'visibility' : 'visibility_off'}
-
-
-
- );
- }
-}
-
-/* END InPlaceEdit */
-
-/* BEGIN Combobox for selecting host name */
-class HostSelector extends React.PureComponent {
- constructor(props) {
- super(props);
-
- this.state = {
- hostName: props.serverAddress,
- changed: false
- };
-
- this.handleHostNameChange = this.handleHostNameChange.bind(this);
- this.handleEditingFinished = this.handleEditingFinished.bind(this);
- }
-
- handleHostNameChange(e) {
- this.setState({hostName: e.target.value, changed: true});
- }
-
- handleEditingFinished() {
- if (this.state.changed) {
- this.setState({changed: false});
- this.props.onServerAddressChange(this.state.hostName.trim());
- }
- }
-
- render() {
- var hostOptions = [];
- for (var key in KNOWN_HOSTS) {
- var item = KNOWN_HOSTS[key];
- hostOptions.push(
-
- );
- }
- return (
-
-
-
- {hostOptions}
-
-
- );
- }
-}
-/* END Combobox for selecting host name */
-
-/* BEGIN CheckBox: styled checkbox */
-class CheckBox extends React.PureComponent {
- constructor(props) {
- super(props);
-
- this.handleChange = this.handleChange.bind(this);
- }
-
- handleChange() {
- this.props.onChange(this.props.name, !this.props.checked);
- }
-
- render() {
- return (
- this.props.onChange ? (
- this.props.checked ?
- check_box :
- check_box_outline_blank
- ) : (
- this.props.checked ?
- check_box :
- check_box_outline_blank
- )
- );
- }
-}
-/* END CheckBox */
-
-/* BEGIN PermissionsEditor: Component for editing permissions */
-//
-class PermissionsEditor extends React.Component {
- constructor(props) {
- super(props);
-
- this.state = {
- mode: (props.mode || '').replace('N', '')
- };
-
- this.handleChange = this.handleChange.bind(this);
- this.handleSubmit = this.handleSubmit.bind(this);
- this.handleCancel = this.handleCancel.bind(this);
- }
-
- handleChange(val) {
- let mode = this.state.mode;
- let idx = mode.indexOf(val);
- if (idx == -1) {
- mode += val;
- } else {
- mode = mode.replace(val, '');
- }
- this.setState({mode: mode});
- }
-
- handleSubmit() {
- // Normalize string, otherwise cannot check if mode has changed.
- var mode = (this.state.mode || 'N').split('').sort().join('');
- var before = (this.props.mode || 'N').split('').sort().join('')
- if (mode !== before) {
- this.props.onSubmit(mode);
- } else {
- this.props.onCancel();
- }
- }
-
- handleCancel() {
- this.props.onCancel();
- }
-
- render() {
- const all = 'JRWPASDO';
- const names = {
- 'J': 'Join (J)',
- 'R': 'Read (R)',
- 'W': 'Write (W)',
- 'P': 'Get notified (P)',
- 'A': 'Approve (A)',
- 'S': 'Share (S)',
- 'D': 'Delete (D)',
- 'O': 'Owner (O)'
- };
-
- let skip = this.props.skip || '';
- let mode = this.state.mode;
- let compare = (this.props.compare || '').replace('N', '');
- let items = [];
- for (let i=0; i= 0 && mode.indexOf(c) < 0) {
- // Permission is marked as inactive: hide unchecked permissions, disable checked permissions
- continue;
- }
- items.push(
-
- {names[c]}
- {skip.indexOf(c) < 0 ?
- = 0)} onChange={this.handleChange}/>
- :
- = 0)} />
- } {this.props.compare ?
- = 0)}/>
- : null}
-
- );
- }
-
- return (
-
- {this.props.userTitle ?
-
: null}
-
Permissions
-
- {this.props.compare ?
-
- {this.props.modeTitle}
- {this.props.compareTitle}
- :
- null}
-
- {items}
-
-
-
- Ok
- Cancel
-
-
- );
- }
-};
-/* END PermissionsEditor */
-
-/* BEGIN ChipInput: group membership widget */
-class ChipInput extends React.Component {
- constructor(props) {
- super(props);
-
- this.state = {
- placeholder: props.chips ? '' : props.prompt,
- sortedChips: ChipInput.sortChips(props.chips, props.required),
- chipIndex: ChipInput.indexChips(props.chips),
- input: '',
- focused: false
- };
-
- this.handleTextInput = this.handleTextInput.bind(this);
- this.removeChipAt = this.removeChipAt.bind(this);
- this.handleChipCancel = this.handleChipCancel.bind(this);
- this.handleFocusGained = this.handleFocusGained.bind(this);
- this.handleFocusLost = this.handleFocusLost.bind(this);
- this.handleKeyDown = this.handleKeyDown.bind(this);
- }
-
- UNSAFE_componentWillReceiveProps(nextProps) {
- this.setState({
- sortedChips: ChipInput.sortChips(nextProps.chips, nextProps.required),
- chipIndex: ChipInput.indexChips(nextProps.chips)
- });
- if (nextProps.chips.length > this.props.chips.length) {
- // Chip added: clear input.
- this.setState({input: ''});
- }
- }
-
- // Map chip index to user name
- static indexChips(chips) {
- var index = {};
- var count = 0;
- chips.map(function(item) {
- index[item.user] = count;
- count ++;
- });
- return index;
- }
-
- // Have non-removable chips appear before all other chips.
- static sortChips(chips, keep) {
- var required = [];
- var normal = [];
- chips.map(function(item) {
- if (item.user === keep) {
- required.push(item);
- } else {
- normal.push(item);
- }
- });
- return required.concat(normal);
- }
-
- handleTextInput(e) {
- this.setState({input: e.target.value});
- if (this.props.filterFunc) {
- this.props.filterFunc(e.target.value);
- }
- }
-
- removeChipAt(idx) {
- var removed = this.state.sortedChips[idx];
- this.props.onChipRemoved(removed.user, this.state.chipIndex[removed.user]);
- }
-
- handleChipCancel(item, idx) {
- this.removeChipAt(idx);
- }
-
- handleFocusGained() {
- this.setState({focused: true});
- }
-
- handleFocusLost() {
- this.setState({focused: false});
- if (this.props.onFocusLost) {
- this.props.onFocusLost(this.state.input);
- }
- }
-
- handleKeyDown(e) {
- if (e.key === 'Backspace') {
- if (this.state.input.length == 0 && this.state.sortedChips.length > 0) {
- var at = this.state.sortedChips.length - 1;
- if (this.state.sortedChips[at].user !== this.props.required) {
- this.removeChipAt(at);
- }
- }
- } else if (e.key === 'Enter') {
- if (this.props.onEnter) {
- this.props.onEnter(this.state.input);
- }
- } else if (e.key === 'Escape') {
- if (this.props.onCancel) {
- this.props.onCancel();
- }
- }
- }
-
- render() {
- var chips = [];
- var count = 0;
- this.state.sortedChips.map((item) => {
- chips.push(
-
- );
- count++;
- });
- var className = "chip-input" + (this.state.focused ? ' focused' : '');
- return (
-
- {chips}
-
-
- );
- }
-};
-
-class Chip extends React.PureComponent {
- constructor(props) {
- super(props);
-
- this.handleCancel = this.handleCancel.bind(this);
- }
-
- handleCancel() {
- this.props.onCancel(this.props.topic, this.props.index);
- }
-
- render() {
- var title = this.props.title || this.props.topic;
- return (
-
- {this.props.noAvatar ?
-
:
-
-
-
- }
-
{title}
- {this.props.onCancel && !this.props.required ?
-
×
- :
}
-
- );
- }
-};
-/* END ChipInput */
-
-/* BEGIN GroupSubs: a list of group subscribers currently online */
-class GroupSubs extends React.Component {
- constructor(props) {
- super(props);
-
- this.state = {
- onlineSubs: props.subscribers || []
- };
- }
-
- static getDerivedStateFromProps(nextProps, prevState) {
- return {
- onlineSubs: nextProps.subscribers ? nextProps.subscribers : []
- };
- }
-
- render() {
- var usersOnline = [];
- this.state.onlineSubs.map((sub) => {
- usersOnline.push(
-
-
-
- );
- });
- return (
- {usersOnline}
- );
- }
-};
-/* END GroupSubs */
-
-/* BEGIN Login: a login form */
-class LoginView extends React.Component {
- constructor(props) {
- super(props);
-
- this.state = {
- login: props.login,
- password: '',
- hostName: props.serverAddress,
- saveToken: localStorage.getObject('keep-logged-in')
- };
- this.handleLoginChange = this.handleLoginChange.bind(this);
- this.handlePasswordChange = this.handlePasswordChange.bind(this);
- this.handleToggleSaveToken = this.handleToggleSaveToken.bind(this);
- this.handleSubmit = this.handleSubmit.bind(this);
- }
-
- handleLoginChange(e) {
- this.setState({login: e.target.value});
- }
-
- handlePasswordChange(e) {
- this.setState({password: e.target.value});
- }
-
- handleToggleSaveToken() {
- localStorage.setObject('keep-logged-in', !this.state.saveToken);
- this.setState({saveToken: !this.state.saveToken});
- }
-
- handleSubmit(e) {
- e.preventDefault();
- this.props.onLogin(this.state.login.trim(), this.state.password.trim());
- }
-
- render() {
- var submitClasses = 'blue';
- if (this.props.disabled) {
- submitClasses += ' disabled';
- }
- return (
-
- );
- }
-};
-/* END Login */
-
-/* BEGIN Account registration */
-class CreateAccountView extends React.PureComponent {
- constructor(props) {
- super(props);
-
- this.state = {
- login: '',
- password: '',
- email: '',
- fn: '', // full/formatted name
- imageDataUrl: null,
- errorCleared: false,
- saveToken: localStorage.getObject('keep-logged-in')
- };
-
- this.handleLoginChange = this.handleLoginChange.bind(this);
- this.handlePasswordChange = this.handlePasswordChange.bind(this);
- this.handleEmailChange = this.handleEmailChange.bind(this);
- this.handleFnChange = this.handleFnChange.bind(this);
- this.handleImageChanged = this.handleImageChanged.bind(this);
- this.handleToggleSaveToken = this.handleToggleSaveToken.bind(this);
- this.handleSubmit = this.handleSubmit.bind(this);
- }
-
- handleLoginChange(e) {
- this.setState({login: e.target.value});
- }
-
- handlePasswordChange(password) {
- this.setState({password: password});
- }
-
- handleEmailChange(e) {
- this.setState({email: e.target.value})
- }
-
- handleFnChange(e) {
- this.setState({fn: e.target.value});
- }
-
- handleImageChanged(img) {
- this.setState({imageDataUrl: img});
- }
-
- handleToggleSaveToken() {
- localStorage.setObject('keep-logged-in', !this.state.saveToken);
- this.setState({saveToken: !this.state.saveToken});
- }
-
- handleSubmit(e) {
- e.preventDefault();
- // TODO: check email for validity
- this.setState({errorCleared: false});
- this.props.onCreateAccount(
- this.state.login.trim(),
- this.state.password.trim(),
- vcard(this.state.fn, this.state.imageDataUrl),
- {'meth': 'email', 'val': this.state.email});
- }
-
- render() {
- var submitClasses = 'blue';
- if (this.props.disabled) {
- submitClasses += ' disabled';
- }
- return (
-
- );
- }
-};
-
-class AvatarUpload extends React.Component {
- constructor(props) {
- super(props);
-
- this.state = {
- dataUrl: props.avatar
- };
-
- this.handleFileUpload = this.handleFileUpload.bind(this);
- }
-
- static getDerivedStateFromProps(nextProps, prevState) {
- if (prevState.dataUrl != nextProps.avatar) {
- return {
- dataUrl: nextProps.avatar
- };
- }
- return null;
- }
-
- handleFileUpload(e) {
- imageFileScaledToBase64(e.target.files[0], AVATAR_SIZE, AVATAR_SIZE, true,
- // Success
- (base64bits, mime) => {
- var du = makeImageUrl({data: base64bits, type: mime});
- this.setState({dataUrl: du});
- this.props.onImageChanged(du);
- },
- // Failure
- (err) => {
- this.props.onError(err, 'err');
- });
- // Clear the value so the same file can be uploaded again.
- e.target.value = '';
- }
-
- render() {
- // Randomize id value in case more than one AvatarUpload is shown
- // at the same time.
- var randId = "file-input-avatar-" + (Math.random() + '').substr(2);
- return (
-
- {this.state.dataUrl ?
-
:
- this.props.readOnly && this.props.uid ?
-
-
-
- :
-
128×128
}
- {this.props.readOnly ? null :
-
}
- {this.props.readOnly ? null :
-
- file_upload
- }
-
- );
- }
-};
-/* END Account registration */
-
-
-/* BEGIN PasswordResetView: a password reset form */
-class PasswordResetView extends React.PureComponent {
- constructor(props) {
- super(props);
-
- this.state = {
- email: '',
- password: ''
- };
-
- this.handleSubmit = this.handleSubmit.bind(this);
- this.handleEmailChange = this.handleEmailChange.bind(this);
- this.handlePasswordChange = this.handlePasswordChange.bind(this);
- }
-
- componentDidMount() {
- let parsed = parseUrlHash(window.location.hash);
- this.setState({token: parsed.params.token, scheme: parsed.params.scheme});
- }
-
- handleSubmit(e) {
- e.preventDefault();
- if (this.state.token) {
- this.props.onReset(this.state.scheme, this.state.password.trim(), this.state.token);
- } else {
- this.props.onRequest("email", this.state.email.trim());
- }
- }
-
- handleEmailChange(e) {
- this.setState({email: e.target.value});
- }
-
- handlePasswordChange(e) {
- this.setState({password: e.target.value});
- }
-
- render() {
- let reset = (this.state.token && this.state.scheme);
- return (
-
- );
- }
-}
-/* END PasswordResetView */
-
-
-/* BEGIN Tinode config panel */
-class SettingsView extends React.PureComponent {
- constructor(props) {
- super(props);
-
- this.state = {
- transport: props.transport || 'def',
- serverAddress: props.serverAddress,
- };
-
- this.handleSubmit = this.handleSubmit.bind(this);
- this.handleTransportSelected = this.handleTransportSelected.bind(this);
- this.handleServerAddressChange = this.handleServerAddressChange.bind(this);
- }
-
- handleSubmit(e) {
- e.preventDefault();
- this.props.onUpdate({
- transport: this.state.transport,
- serverAddress: this.state.serverAddress
- });
- }
-
- handleTransportSelected(e) {
- this.setState({transport: e.currentTarget.value});
- }
-
- handleServerAddressChange(name) {
- this.setState({serverAddress: name});
- this.props.onServerAddressChange(name);
- }
-
- render() {
- var names = {def: "default", ws: "websocket", lp: "long polling"};
- var transportOptions = [];
- var instance = this;
- ['def', 'ws', 'lp'].map(function(item){
- var id = 'transport-' + item;
- var name = names[item];
- transportOptions.push(
-
-
- {name}
-
- );
- });
- return (
-
- );
- }
-};
-/* END Tinode config panel */
-
-/* BEGIN Manage side panel - handle Login, Account Registration, Contacts, NewTopic views */
-class SideNavbar extends React.PureComponent {
- render() {
- return (
-
-
-
-
-
{this.props.title}
- {this.props.state === 'login' ?
-
:
- this.props.state === 'contacts' ?
-
:
- null}
- {this.props.onCancel ?
-
: null}
-
- );
- }
-};
-
-class MenuStart extends React.PureComponent {
- render() {
- return (
-
- );
- }
-};
-
-class MenuContacts extends React.PureComponent {
- render() {
- return (
-
- );
- }
-};
-
-class SidepanelView extends React.Component {
- constructor(props) {
- super(props);
-
- this.handleLoginRequested = this.handleLoginRequested.bind(this);
- }
-
- handleLoginRequested(login, password) {
- this.props.onLoginRequest(login, password);
- }
-
- render() {
- var title = null;
- var avatar = false;
- var onCancel = undefined;
- var view = this.props.state || (this.props.myUserId ? 'contacts' : 'login');
- switch (view) {
- case 'login':
- title = "Sign In";
- break;
- case 'register':
- title = "Create Account";
- onCancel = this.props.onCancel;
- break;
- case 'settings':
- title = "Settings";
- onCancel = this.props.onCancel;
- break;
- case 'edit':
- title = "Edit Account";
- onCancel = this.props.onCancel;
- break;
- case 'contacts':
- title = this.props.title;
- avatar = this.props.avatar ? this.props.avatar : true;
- break;
- case 'newtpk':
- title = "Start New Chat";
- onCancel = this.props.onCancel;
- break;
- case 'cred':
- title = "Confirm Credentials";
- onCancel = this.props.onCancel;
- break;
- case 'reset':
- title = "Reset Password";
- onCancel = this.props.onCancel;
- break;
- default:;
- };
- return (
-
-
-
-
-
- {view === 'login' ?
-
:
-
- view === 'register' ?
-
:
-
- view === 'settings' ?
-
:
-
- view === 'edit' ?
-
:
-
- view === 'contacts' ?
-
:
-
- view === 'newtpk' ?
-
:
-
- view === 'cred' ?
-
:
-
- view === 'reset' ?
-
:
- null}
-
- );
- }
-};
-
-class ErrorPanel extends React.PureComponent {
- constructor(props) {
- super(props);
-
- this.state = {
- show: false,
- };
-
- this.hide = this.hide.bind(this);
- }
-
- static getDerivedStateFromProps(nextProps, prevState) {
- return {
- show: !(!nextProps.level)
- };
- }
-
- hide() {
- this.setState({show: false});
- if (this.props.onClearError) {
- this.props.onClearError();
- }
- }
-
- render() {
- var icon = this.props.level == 'err' ? 'error': 'warning';
- return (
-
-
{icon}
- {this.props.text}
-
-
- );
- }
-};
-
-/* END Side panel */
-
-/* EditAccount parameters */
-class EditAccountView extends React.Component {
- constructor(props) {
- super(props);
-
- let me = this.props.tinode.getMeTopic();
- let defacs = me.getDefaultAccess();
- let fnd = this.props.tinode.getFndTopic();
- this.state = {
- fullName: me.public ? me.public.fn : undefined,
- avatar: makeImageUrl(me.public ? me.public.photo : null),
- auth: defacs ? defacs.auth : null,
- anon: defacs ? defacs.anon : null,
- tags: fnd.tags(),
- showPermissionEditorFor: undefined,
- previousOnTags: fnd.onTagsUpdated
- };
-
- this.tnNewTags = this.tnNewTags.bind(this);
- this.handleFullNameUpdate = this.handleFullNameUpdate.bind(this);
- this.handlePasswordUpdate = this.handlePasswordUpdate.bind(this);
- this.handleImageChanged = this.handleImageChanged.bind(this);
- this.handleCheckboxClick = this.handleCheckboxClick.bind(this);
- this.handleLaunchPermissionsEditor = this.handleLaunchPermissionsEditor.bind(this);
- this.handleHidePermissionsEditor = this.handleHidePermissionsEditor.bind(this);
- this.handlePermissionsChanged = this.handlePermissionsChanged.bind(this);
- this.handleTagsUpdated = this.handleTagsUpdated.bind(this);
- }
-
- componentDidMount() {
- let fnd = this.props.tinode.getFndTopic();
- fnd.onTagsUpdated = this.tnNewTags;
- if (!fnd.isSubscribed()) {
- fnd.subscribe(fnd.startMetaQuery().withLaterDesc().withTags().build()).catch((err) => {
- this.props.onError(err.message, 'err');
- });
- }
- }
-
- componentWillUnmount() {
- var fnd = this.props.tinode.getFndTopic();
- fnd.onTagsUpdated = this.state.previousOnTags;
- }
-
- tnNewTags(tags) {
- this.setState({tags: tags});
- }
-
- handleFullNameUpdate(fn) {
- this.setState({fullName: fn});
- this.props.onUpdateAccount(undefined, vcard(fn, this.state.avatar));
- }
-
- handlePasswordUpdate(pwd) {
- this.setState({password: pwd});
- this.props.onUpdateAccount(pwd);
- }
-
- handleImageChanged(img) {
- this.setState({avatar: img});
- this.props.onUpdateAccount(undefined, vcard(this.state.fullName, img));
- }
-
- handleCheckboxClick(what, checked) {
- if (what == 'sound') {
- this.props.onToggleMessageSounds(checked);
- } else if (what == 'alert') {
- this.props.onTogglePushNotifications(checked);
- }
- }
-
- handleLaunchPermissionsEditor(which) {
- this.setState({
- showPermissionEditorFor: which,
- editedPermissions: this.state[which]
- });
- }
-
- handleHidePermissionsEditor() {
- this.setState({showPermissionEditorFor: undefined});
- }
-
- handlePermissionsChanged(perm) {
- let defacs = {};
- defacs[this.state.showPermissionEditorFor] = perm;
- this.props.onUpdateAccount(undefined, undefined, defacs);
-
- let newState = {showPermissionEditorFor: undefined};
- newState[this.state.showPermissionEditorFor] = perm;
- this.setState(newState);
- }
-
- handleTagsUpdated(tags) {
- // Check if tags have actually changed.
- if (arrayEqual(this.state.tags.slice(0), tags.slice(0))) {
- return;
- }
- this.props.onUpdateTags(tags);
- }
-
- render() {
- var tags = [];
- this.state.tags.map(function(tag) {
- tags.push({tag} );
- });
- if (tags.length == 0) {
- tags = No tags defined. Add some. ;
- }
- return (
- {this.state.showPermissionEditorFor ?
-
- :
-
-
-
-
Your name
-
-
Password
-
-
-
-
-
-
-
- Address:
- {this.props.myUserId}
-
-
- Default access mode:
-
-
-
Auth: {this.state.auth}
-
Anon: {this.state.anon}
-
-
-
-
- Message sound:
-
-
-
- Notification
- alerts{!this.props.desktopAlertsEnabled ? ' (requires HTTPS)' : null}:
-
-
-
-
-
-
-
- }
- );
- }
-};
-/* END EditAccount */
-
-/* BEGIN TagManager: edit topic or user tags */
-class TagManager extends React.Component {
- constructor(props) {
- super(props);
-
- this.state = {
- tags: this.props.tags,
- tagInput: '',
- activated: this.props.activated,
- noTagsMessage: "Add some tags"
- };
-
- this.handleShowTagManager = this.handleShowTagManager.bind(this);
- this.handleTagInput = this.handleTagInput.bind(this);
- this.handleAddTag = this.handleAddTag.bind(this);
- this.handleRemoveTag = this.handleRemoveTag.bind(this);
- this.handleSubmit = this.handleSubmit.bind(this);
- this.handleCancel = this.handleCancel.bind(this);
- }
-
- static getDerivedStateFromProps(nextProps, prevState) {
- if (!arrayEqual(nextProps.tags, prevState.tags) && !prevState.activated) {
- return {tags: nextProps.tags};
- }
- return null;
- }
-
- handleShowTagManager() {
- this.setState({activated: true});
- }
-
- handleTagInput(text) {
- this.setState({tagInput: text});
- // Check if user entered ',', ' ' or ';'
- if (text.length > 0) {
- var last = text[text.length-1];
- if (last == ',' || last == ' ' || last == ';') {
- var tag = text.substr(0, text.length-1).trim();
- if (tag.length >= MIN_TAG_LENGTH) {
- this.handleAddTag(tag);
- }
- }
- }
- }
-
- handleAddTag(tag) {
- tag = tag.trim();
- if (tag.length > 0) {
- let tags = this.state.tags.slice(0);
- tags.push(tag);
- this.setState({tags: tags, tagInput: ''});
- if (this.props.onTagsChanged) {
- this.props.onTagsChanged(tags);
- }
- }
- }
-
- handleRemoveTag(tag, index) {
- var tags = this.state.tags.slice(0);
- tags.splice(index, 1);
- this.setState({tags: tags});
- if (this.props.onTagsChanged) {
- this.props.onTagsChanged(tags);
- }
- }
-
- handleSubmit() {
- let tags = this.state.tags.slice(0);
- let inp = this.state.tagInput.trim();
- if (inp.length > 0) {
- tags.push(inp);
- if (this.props.onTagsChanged) {
- this.props.onTagsChanged(tags);
- }
- }
- this.props.onSubmit(tags);
- this.setState({activated: false, tagInput: '', tags: this.props.tags});
- }
-
- handleCancel() {
- this.setState({activated: false, tagInput: '', tags: this.props.tags});
- if (this.props.onCancel) {
- this.props.onCancel();
- }
- }
-
- render() {
- var tags = [];
- if (this.state.activated) {
- this.state.tags.map(function(tag) {
- tags.push({user: tag});
- });
- } else {
- this.state.tags.map(function(tag) {
- tags.push({tag} );
- });
- if (tags.length == 0) {
- tags = No tags defined. Add some. ;
- }
- }
- return (
-
-
- {this.props.title}
-
- {this.state.activated ?
-
-
- {this.props.onSubmit || this.props.onCancel ?
-
- OK
- Cancel
-
- : null}
-
- :
-
- }
-
- );
- }
-};
-/* END TagManager */
-
-/* BEGIN Contact list (list of topics) */
-/* A single topic */;
-class Contact extends React.Component {
- constructor(props) {
- super(props);
-
- this.handleClick = this.handleClick.bind(this);
- this.handleContextClick = this.handleContextClick.bind(this);
- }
-
- handleClick(e) {
- e.preventDefault();
- e.stopPropagation();
- if (this.props.onSelected) {
- this.props.onSelected(this.props.item, this.props.index, this.props.now, this.props.acs);
- }
- }
-
- handleContextClick(e) {
- e.preventDefault();
- e.stopPropagation();
- this.props.showContextMenu({ topicName: this.props.item, y: e.pageY, x: e.pageX });
- }
-
- render() {
- var title = this.props.title;
- if (!title) {
- title = unknown ;
- } else if (title.length > 30) {
- // FIXME: this is wrong for RTL languages.
- title = title.substring(0, 28) + '...';
- }
- var online = this.props.now ? 'online' : 'offline';
- var avatar = this.props.avatar ? this.props.avatar : true;
- var badges = [];
- if (this.props.badges && this.props.badges.length > 0) {
- var count = 0;
- this.props.badges.map(function(b) {
- var style = 'badge' + (b.color ? ' ' + b.color : '');
- badges.push({b.name} );
- count ++;
- });
- }
- if (this.props.showMode && this.props.acs) {
- badges.push({this.props.acs.getMode()} );
- }
-
- return (
-
-
-
- {this.props.showOnline ? :
- (this.props.showCheckmark && this.props.selected ?
- check_circle
- : null)}
-
-
-
{title}
- {this.props.unread > 0 ? : null}
-
- {this.props.comment ?
{this.props.comment}
: null}
-
{badges}
-
- {this.props.showContextMenu ?
-
-
- expand_more
-
- : null}
-
- );
- }
-};
-
-/* The counter of unread messages in the topic */
-class UnreadBadge extends React.PureComponent {
- render() {
- var showUnreadBadge = null;
- if (this.props.count > 0) {
- var count = this.props.count > 9 ? "9+" : this.props.count;
- showUnreadBadge = {count} ;
- }
- return showUnreadBadge;
- }
-};
-
-/* Contact's labels: [you], [muted], [blocked], etc */
-// FIXME: this class is unused.
-class ContactBadges_UNUSED_REMOVE extends React.PureComponent {
- render() {
- let badges = null;
- if (this.props.badges && this.props.badges.length > 0) {
- badges = [];
- this.props.badges.map(function(b) {
- var style = 'badge' + (b.color ? ' ' + b.color : '');
- // Badge names are expected to be unique, so using the name as the key.
- badges.push({b.name} );
- });
- }
- return badges;
- }
-};
-
-/* ContactsView holds all contacts-related stuff */
-class ContactsView extends React.Component {
- constructor(props) {
- super(props);
-
- this.state = ContactsView.getDerivedStateFromProps(props, {});
- }
-
- static getDerivedStateFromProps(nextProps, prevState) {
- let contacts = [];
- let unreadThreads = 0;
- nextProps.chatList.map((c) => {
- unreadThreads += c.unread > 0 ? 1 : 0;
- contacts.push(c);
- });
- contacts.sort(function(a, b){
- return (b.touched || 0) - (a.touched || 0);
- });
-
- updateFavicon(unreadThreads);
-
- return {contactList: contacts};
- }
-
- render() {
- return (
- You have no chats ¯\_(ツ)_/¯}
- topicSelected={this.props.topicSelected}
- myUserId={this.props.myUserId}
- showOnline={true}
- showUnread={true}
- onTopicSelected={this.props.onTopicSelected}
- showContextMenu={this.props.showContextMenu} />
- );
- }
-};
-/* END Contact list */
-
-/* BEGIN ContactList: component for showing a list of contacts,
- * such as a list of group members in a group chat */
-class ContactList extends React.Component {
- render() {
- var contactNodes = [];
- var showCheckmark = Array.isArray(this.props.topicSelected);
- if (this.props.contacts && this.props.contacts.length > 0) {
- this.props.contacts.map((c) => {
- var key = c.topic ? c.topic : c.user;
- // If filter function is provided, filter out the items
- // which don't satisfy the condition.
- if (this.props.filterFunc && this.props.filter) {
- var content = [key];
- if (c.private && c.private.comment) {
- content.push(('' + c.private.comment).toLowerCase());
- }
- if (c.public && c.public.fn) {
- content.push(('' + c.public.fn).toLowerCase());
- }
- if (!this.props.filterFunc(this.props.filter, content)) {
- return;
- }
- }
-
- var selected = showCheckmark ?
- (this.props.topicSelected.indexOf(key) > -1) :
- (this.props.topicSelected === key);
- var badges = [];
- if (this.props.showMode) {
- if (key === this.props.myUserId) {
- badges.push({name: "you", color: 'green'});
- }
- if (c.acs && c.acs.isOwner()) {
- badges.push({name: "owner"});
- }
- }
- var comment = Array.isArray(c.private) ?
- c.private.join(', ') : (c.private ? c.private.comment : null);
-
- contactNodes.push(
-
- );
- }, this);
- }
-
- return (
-
- {contactNodes.length > 0 ?
-
- :
-
- {this.props.emptyListMessage}
-
}
-
- );
- }
-};
-/* END ContactList */
-
-/* BEGIN GroupMembers: control for managing a list of group members */
-class GroupManager extends React.Component {
- constructor(props) {
- super(props);
-
- this.state = {
- members: props.members,
- index: GroupManager.indexMembers(props.members),
- contactFilter: '',
- noContactsMessage: "You have no contacts :-(",
- selectedContacts: GroupManager.selectedContacts(props.members)
- };
-
- this.handleContactSelected = this.handleContactSelected.bind(this);
- this.handleMemberRemoved = this.handleMemberRemoved.bind(this);
- this.handleContactFilter = this.handleContactFilter.bind(this);
- this.handleSubmit = this.handleSubmit.bind(this);
- this.handleCancel = this.handleCancel.bind(this);
- }
-
- static indexMembers(members) {
- var index = {};
- members.map(function(m) {
- index[m.user] = {delta: 0, present: true}; // Delta: 0 unchanged, +1 added, -1 removed
- });
- return index;
- }
-
- static selectedContacts(members) {
- var sel = [];
- members.map(function(m) {
- sel.push(m.user);
- });
- return sel;
- }
-
- handleContactSelected(userId, index) {
- var status = this.state.index[userId];
- if (status) {
- if (status.present) {
- // Prevent duplicate members
- return;
- }
- status.delta += 1;
- status.present = true;
- } else {
- status = {delta: 1, present: true};
- }
-
- var m = this.state.members.slice();
- m.push(this.props.contacts[index]);
-
- var sel = GroupManager.selectedContacts(m);
-
- var i = this.state.index;
- i[userId] = status;
-
- this.setState({members: m, index: i, selectedContacts: sel});
- }
-
- handleMemberRemoved(userId, index) {
- var status = this.state.index[userId];
- if (!status || !status.present) {
- return;
- }
- status.present = false;
- status.delta -= 1;
-
- var m = this.state.members.slice();
- m.splice(index, 1);
-
- var sel = GroupManager.selectedContacts(m);
-
- var i = this.state.index;
- i[userId] = status;
-
- this.setState({members: m, index: i, selectedContacts: sel});
- }
-
- handleContactFilter(val) {
- var msg = !val ?
- "You have no contacts :-(" :
- "No contacts match '" + val + "'";
-
- this.setState({contactFilter: val, noContactsMessage: msg});
- }
-
- static doContactFiltering(filter, values) {
- if (filter) {
- for (var i=0; i= 0) {
- return true;
- }
- }
- return false;
- }
- return true;
- }
-
- handleSubmit() {
- var instance = this;
- var members = [];
- var added = [];
- var removed = [];
-
- var keys = Object.keys(this.state.index);
- keys.map(function(k) {
- if (instance.state.index[k].present) {
- members.push(k);
- }
-
- if (instance.state.index[k].delta > 0) {
- added.push(k);
- } else if (instance.state.index[k].delta < 0) {
- removed.push(k);
- }
- });
- this.props.onSubmit(members, added, removed);
- }
-
- handleCancel() {
- this.props.onCancel();
- }
-
- render() {
- return (
-
-
- Group members
-
-
-
-
-
- All contacts
-
-
-
- OK
- Cancel
-
-
- );
- }
-};
-/* END GroupManager */
-
-/* BEGIN Create new topic and invite users or send an invite */
-class NewTopicView extends React.Component {
- constructor(props) {
- super(props);
-
- this.state = {
- tabSelected: 'p2p',
- contactList: props.searchResults
- };
-
- this.handleTabClick = this.handleTabClick.bind(this);
- this.handleContactSelected = this.handleContactSelected.bind(this);
- this.handleNewGroupSubmit = this.handleNewGroupSubmit.bind(this);
- this.handleGroupByID = this.handleGroupByID.bind(this);
- }
-
- componentDidMount() {
- this.props.onInitFind();
- }
-
- static getDerivedStateFromProps(nextProps, prevState) {
- return {
- contactList: nextProps.searchResults
- };
- }
-
- handleTabClick(e) {
- e.preventDefault();
- navigateTo(addUrlParam(window.location.hash, 'tab', e.currentTarget.dataset.id));
- this.setState({tabSelected: e.currentTarget.dataset.id});
- }
-
- handleContactSelected(sel) {
- if (this.state.tabSelected === 'p2p') {
- navigateTo(removeUrlParam(window.location.hash, 'tab'));
- this.props.onCreateTopic(sel, undefined);
- }
- }
-
- handleNewGroupSubmit(name, dataUrl, priv, tags) {
- navigateTo(removeUrlParam(window.location.hash, 'tab'));
- this.props.onCreateTopic(undefined, vcard(name, dataUrl), priv, tags);
- }
-
- handleGroupByID(topicName) {
- navigateTo(removeUrlParam(window.location.hash, 'tab'));
- this.props.onCreateTopic(topicName);
- }
-
- render() {
- return (
-
-
- {this.state.tabSelected === 'grp' ?
-
:
- this.state.tabSelected === 'byid' ?
-
:
-
-
-
-
}
-
- );
- }
-};
-
-class NewTopicGroup extends React.PureComponent {
- constructor(props) {
- super(props);
-
- this.state = {
- fn: '', // full/formatted name
- private: '',
- imageDataUrl: null,
- tags: []
- };
-
- this.handleFnChange = this.handleFnChange.bind(this);
- this.handlePrivateChange = this.handlePrivateChange.bind(this);
- this.handleImageChanged = this.handleImageChanged.bind(this);
- this.handleTagsChanged = this.handleTagsChanged.bind(this);
- this.handleTagsChanged = this.handleTagsChanged.bind(this);
- this.handleSubmit = this.handleSubmit.bind(this);
- }
-
- handleFnChange(e) {
- this.setState({fn: e.target.value});
- }
-
- handlePrivateChange(e) {
- this.setState({private: e.target.value});
- }
-
- handleImageChanged(img) {
- this.setState({imageDataUrl: img});
- }
-
- handleTagsChanged(tags) {
- this.setState({tags: tags});
- }
-
- handleSubmit(e) {
- e.preventDefault();
- if (this.state.fn && this.state.fn.trim()) {
- this.props.onSubmit(this.state.fn.trim(),
- this.state.imageDataUrl, this.state.private.trim(),
- this.state.tags);
- }
- }
-
- render() {
- var submitClasses = 'blue';
- if (this.props.disabled) {
- submitClasses += ' disabled';
- }
- return (
-
- );
- }
-};
-
-class SearchContacts extends React.PureComponent {
- constructor(props) {
- super(props);
-
- this.state = {
- edited: false,
- search: ''
- };
-
- this.handleSearchChange = this.handleSearchChange.bind(this);
- this.handleSearch = this.handleSearch.bind(this);
- this.handleClear = this.handleClear.bind(this);
- this.handleKeyDown = this.handleKeyDown.bind(this);
- }
-
- componentWillUnmount() {
- if (this.state.edited) {
- this.setState({search: '', edited: false});
- this.props.onSearchContacts(Tinode.DEL_CHAR);
- }
- }
-
- handleSearchChange(e) {
- this.setState({search: e.target.value});
- }
-
- handleSearch(e) {
- e.preventDefault();
- var query = this.state.search.trim();
- this.setState({edited: (query.length > 0)});
- this.props.onSearchContacts(query.length > 0 ? query : Tinode.DEL_CHAR);
- }
-
- handleClear() {
- if (this.state.edited) {
- this.props.onSearchContacts(Tinode.DEL_CHAR);
- }
- this.setState({search: '', edited: false});
- }
-
- handleKeyDown(e) {
- if (e.key === 'Enter') {
- this.handleSearch(e);
- } else if (e.key === 'Escape') {
- this.handleClear();
- }
- }
-
- render() {
- return (
-
- );
- }
-};
-
-class NewTopicById extends React.PureComponent {
- constructor(props) {
- super(props);
-
- this.state = {
- groupId: '',
- };
-
- this.handleChange = this.handleChange.bind(this);
- this.handleKeyPress = this.handleKeyPress.bind(this);
- this.handleSubmit = this.handleSubmit.bind(this);
- }
-
- handleChange(e) {
- this.setState({groupId: e.target.value});
- }
-
- handleKeyPress(e) {
- if (e.key === 'Enter') {
- this.handleSubmit(e);
- }
- }
-
- handleSubmit(e) {
- e.preventDefault();
- if (this.state.groupId) {
- var name = this.state.groupId.trim();
- if (name.length > 3 && (name.substr(0, 3) == 'usr' || name.substr(0, 3) == 'grp')) {
- this.props.onSubmit(name);
- } else {
- this.props.onError("Invalid ID", 'err');
- }
- }
- }
-
- render() {
- return (
-
- );
- }
-};
-/* END Create new topic and invite users or send an invite */
-
-/* BEGIN ValidationView: panel for confirming credentials, like email or phone */
-class ValidationView extends React.PureComponent {
- constructor(props) {
- super(props);
-
- this.state = {
- code: props.credCode || ''
- };
-
- this.handleChange = this.handleChange.bind(this);
- this.handleKeyPress = this.handleKeyPress.bind(this);
- this.handleSubmit = this.handleSubmit.bind(this);
- }
-
- handleChange(e) {
- this.setState({code: e.target.value});
- }
-
- handleKeyPress(e) {
- if (e.key === 'Enter') {
- this.handleSubmit(e);
- }
- }
-
- handleSubmit(e) {
- e.preventDefault();
- if (this.state.code && this.state.code.trim()) {
- this.props.onSubmit(this.props.credMethod, this.state.code.trim());
- }
- }
-
- render() {
- var methods = {'email': 'email', 'tel': 'phone'};
- var method = methods[this.props.credMethod] || this.props.credMethod;
- return (
-
-
-
- Enter confirmation code sent to you by {method}:
-
-
-
-
-
-
- Confirm
-
-
- );
- }
-};
-/* END ValidationView */
-
-/* BEGIN InfoView: panel with topic/user info */
-class InfoView extends React.Component {
- constructor(props) {
- super(props);
-
- this.state = {
- topic: null,
- owner: false,
- admin: false,
- sharer: false,
- muted: false,
- address: null,
- groupTopic: undefined,
- fullName: undefined,
- avatar: null,
- private: null,
- selectedContact: null,
- access: null,
- modeGiven: null,
- modeWant: null,
- modeGiven2: null, // P2P topic, the other user mode given
- modeWant2: null, // P2P topic, the other user mode want
- auth: null,
- anon: null,
- contactList: [],
- tags: [],
- showMemberPanel: false,
- showPermissionEditorFor: undefined,
- moreInfoExpanded: false,
- previousMetaDesc: undefined,
- previousSubsUpdated: undefined,
- previousTagsUpdated: undefined
- };
-
- this.resetSubs = this.resetSubs.bind(this);
- this.resetDesc = this.resetDesc.bind(this);
- this.onMetaDesc = this.onMetaDesc.bind(this);
- this.onSubsUpdated = this.onSubsUpdated.bind(this);
- this.onTagsUpdated = this.onTagsUpdated.bind(this);
- this.handleFullNameUpdate = this.handleFullNameUpdate.bind(this);
- this.handlePrivateUpdate = this.handlePrivateUpdate.bind(this);
- this.handleImageChanged = this.handleImageChanged.bind(this);
- this.handleMuted = this.handleMuted.bind(this);
- this.handlePermissionsChanged = this.handlePermissionsChanged.bind(this);
- this.handleLaunchPermissionsEditor = this.handleLaunchPermissionsEditor.bind(this);
- this.handleHidePermissionsEditor = this.handleHidePermissionsEditor.bind(this);
- this.handleShowAddMembers = this.handleShowAddMembers.bind(this);
- this.handleHideAddMembers = this.handleHideAddMembers.bind(this);
- this.handleMemberUpdateRequest = this.handleMemberUpdateRequest.bind(this);
- this.handleLeave = this.handleLeave.bind(this);
- this.handleMemberSelected = this.handleMemberSelected.bind(this);
- this.handleMoreInfo = this.handleMoreInfo.bind(this);
- this.handleTagsUpdated = this.handleTagsUpdated.bind(this);
- this.handleContextMenu = this.handleContextMenu.bind(this);
- }
-
- // No need to separately handle component mount.
- UNSAFE_componentWillReceiveProps(props) {
- var topic = this.props.tinode.getTopic(props.topic);
- if (!topic) {
- return;
- }
-
- if (this.onMetaDesc != topic.onMetaDesc) {
- this.previousMetaDesc = topic.onMetaDesc;
- topic.onMetaDesc = this.onMetaDesc;
-
- this.previousSubsUpdated = topic.onSubsUpdated;
- topic.onSubsUpdated = this.onSubsUpdated;
-
- if (topic.getType() == 'grp') {
- this.previousTagsUpdated = topic.onTagsUpdated;
- topic.onTagsUpdated = this.onTagsUpdated;
- } else {
- this.previousTagsUpdated = undefined;
- }
- }
-
- if (this.state.topic != props.topic) {
- this.setState({topic: props.topic});
- this.resetDesc(topic, props);
- this.resetSubs(topic, props);
- }
- }
-
- componentWillUnmount() {
- var topic = this.props.tinode.getTopic(this.props.topic);
- if (!topic) {
- return;
- }
- this.setState({topic: null});
- topic.onMetaDesc = this.previousMetaDesc;
- topic.onSubsUpdated = this.previousSubsUpdated;
- topic.onTagsUpdated = this.previousTagsUpdated;
- }
-
- resetSubs(topic, props) {
- var newState = {contactList: []};
- if (topic.getType() == 'p2p') {
- // Fetch the other party in the p2p conversation.
- // Topic may not be ready yet, so check if user is found.
- var user2 = topic.subscriber(props.topic);
- if (user2) {
- newState.modeGiven2 = user2.acs.getGiven();
- newState.modeWant2 = user2.acs.getWant();
- }
- } else {
- topic.subscribers(function(sub) {
- newState.contactList.push(sub);
- }, this);
- }
-
- this.setState(newState);
- }
-
- resetDesc(topic, props) {
- var defacs = topic.getDefaultAccess() || {};
- var acs = topic.getAccessMode();
- this.setState({
- owner: acs && acs.isOwner(),
- admin: acs && acs.isAdmin(),
- sharer: acs && (acs.isAdmin() || acs.isSharer()),
- muted: acs && acs.isMuted(),
-
- fullName: topic.public ? topic.public.fn : undefined,
- avatar: makeImageUrl(topic.public ? topic.public.photo : null),
- private: topic.private ? topic.private.comment : null,
- address: topic.name,
- groupTopic: (topic.getType() == 'grp'),
- showMemberPanel: false,
- access: acs ? acs.getMode() : undefined,
- modeGiven: acs ? acs.getGiven() : undefined,
- modeWant: acs ? acs.getWant() : undefined,
- auth: defacs.auth,
- anon: defacs.anon
- });
-
- if (topic.getType() == 'grp' && acs && acs.isOwner()) {
- // Requesting tags: owner is editing the topic.
- topic.getMeta(topic.startMetaQuery().withTags().build());
- }
- }
-
- onMetaDesc(desc) {
- var topic = this.props.tinode.getTopic(this.props.topic);
- if (!topic) {
- return;
- }
- this.resetDesc(topic, this.props);
-
- if (this.previousMetaDesc && this.previousMetaDesc != this.onMetaDesc) {
- this.previousMetaDesc(desc);
- }
- }
-
- onSubsUpdated() {
- var topic = this.props.tinode.getTopic(this.props.topic);
- if (!topic) {
- return;
- }
- this.resetSubs(topic, this.props);
-
- if (this.previousSubsUpdated && this.previousSubsUpdated != this.onSubsUpdated) {
- this.previousSubsUpdated();
- }
- }
-
- onTagsUpdated(tags) {
- this.setState({tags: tags});
-
- if (this.previousTagsUpdated && this.previousTagsUpdated != this.onTagsUpdated) {
- this.previousTagsUpdated();
- }
- }
-
- handleFullNameUpdate(fn) {
- if (this.state.fullName !== fn) {
- this.setState({fullName: fn});
- this.props.onTopicDescUpdate(this.props.topic,
- vcard(fn, this.state.avatar),
- null);
- }
- }
-
- handlePrivateUpdate(priv) {
- if (this.state.priv !== priv) {
- this.setState({private: priv});
- this.props.onTopicDescUpdate(this.props.topic,
- null,
- priv);
- }
- }
-
- handleImageChanged(img) {
- this.setState({avatar: img});
- this.props.onTopicDescUpdate(this.props.topic,
- vcard(this.state.fullName, img),
- null);
- }
-
- handleMuted(ignored, checked) {
- this.setState({muted: checked});
- this.props.onChangePermissions(this.props.topic, checked ? '-P' : '+P');
- }
-
- handlePermissionsChanged(perm) {
- switch (this.state.showPermissionEditorFor) {
- case 'auth':
- this.props.onTopicDescUpdate(this.props.topic, null, null, {auth: perm});
- break;
- case 'anon':
- this.props.onTopicDescUpdate(this.props.topic, null, null, {anon: perm});
- break;
- case 'mode':
- case 'want':
- this.props.onChangePermissions(this.props.topic, perm);
- break;
- case 'given':
- this.props.onChangePermissions(this.props.topic, perm, this.props.topic);
- break;
- case 'user':
- this.props.onChangePermissions(this.props.topic, perm, this.state.userPermissionsEdited);
- break;
- }
-
- this.setState({showPermissionEditorFor: undefined});
- }
-
- handleLaunchPermissionsEditor(which, uid) {
- let toEdit, toCompare, toSkip, titleEdit, titleCompare, userTitle, userAvatar;
- switch (which) {
- case 'mode':
- toEdit = this.state.access;
- break;
- case 'want':
- toEdit = this.state.modeWant;
- toCompare = this.state.modeGiven;
- toSkip = this.state.groupTopic ? 'O' : 'ASDO';
- titleEdit = "Requested";
- titleCompare = "Granted";
- break;
- case 'given':
- toEdit = this.state.modeGiven2;
- toCompare = this.state.modeWant2;
- toSkip = this.state.groupTopic ? (this.state.owner ? '' : 'O') : 'ASDO';
- titleEdit = "Granted";
- titleCompare = "Requested";
- break;
- case 'auth':
- toEdit = this.state.auth;
- toSkip = 'O';
- break;
- case 'anon':
- toEdit = this.state.anon;
- toSkip = 'O';
- break;
- case 'user': {
- let topic = this.props.tinode.getTopic(this.props.topic);
- if (!topic) {
- return;
- }
- var user = topic.subscriber(uid);
- if (!user || !user.acs) {
- return;
- }
- toEdit = user.acs.getGiven();
- toCompare = user.acs.getWant();
- toSkip = this.state.owner ? '' : 'O';
- titleEdit = "Granted";
- titleCompare = "Requested";
- if (user.public) {
- userTitle = user.public.fn;
- userAvatar = user.public.photo;
- }
- break;
- }
- default:
- console.log("Unknown permission editing mode '" + which + "'");
- break;
- }
- this.setState({
- showPermissionEditorFor: which,
- userPermissionsEdited: uid,
- userPermissionsTitle: userTitle,
- userPermissionsAvatar: userAvatar,
- editedPermissions: toEdit,
- immutablePermissions: toCompare,
- editedPermissionsTitle: titleEdit,
- immutablePermissionsTitle: titleCompare,
- editedPermissionsSkipped: toSkip,
- });
- }
-
- handleHidePermissionsEditor() {
- this.setState({showPermissionEditorFor: undefined});
- }
-
- handleShowAddMembers() {
- this.props.onInitFind();
- this.setState({showMemberPanel: true});
- }
-
- handleHideAddMembers() {
- this.setState({showMemberPanel: false});
- }
-
- handleMemberUpdateRequest(members, added, removed) {
- this.props.onMemberUpdateRequest(this.props.topic, added, removed);
- this.setState({showMemberPanel: false});
- }
-
- handleLeave() {
- this.props.onLeaveTopic(this.props.topic);
- }
-
- handleMemberSelected(uid) {
- this.setState({selectedContact: uid});
- }
-
- handleMoreInfo(open) {
- this.setState({moreInfoExpanded: open});
- }
-
- handleTagsUpdated(tags) {
- if (!arrayEqual(this.state.tags.slice(0), tags.slice(0))) {
- this.props.onTopicTagsUpdate(this.props.topic, tags);
- }
- }
-
- handleContextMenu(params) {
- var instance = this;
- var topic = this.props.tinode.getTopic(this.props.topic);
- if (!topic) {
- return;
- }
- var user = topic.subscriber(params.topicName);
- if (!user || !user.acs) {
- return;
- }
-
- var menuItems = [
- {title: "Edit permissions", handler: function() {
- instance.handleLaunchPermissionsEditor('user', params.topicName);
- }},
- 'member_delete',
- user.acs.isMuted() ? 'member_unmute' : 'member_mute',
- user.acs.isJoiner() ? 'member_block' : 'member_unblock'
- ];
- this.props.showContextMenu({
- topicName: this.props.topic,
- x: params.x,
- y: params.y,
- user: params.topicName}, menuItems);
- }
-
- render() {
- return (
-
-
- {this.props.displayMobile ?
-
: null}
- {this.state.showMemberPanel ?
-
- :
- this.state.showPermissionEditorFor ?
-
- :
-
-
-
-
Name
-
Unknown}
- readOnly={!this.state.owner}
- value={this.state.fullName}
- onFinished={this.handleFullNameUpdate} />
-
Private comment
-
-
-
-
-
-
-
- Muted:
-
-
-
- {this.state.moreInfoExpanded ?
-
-
- Address:
- {this.state.address}
-
- {this.state.groupTopic ?
-
- Your permissions:
-
- {this.state.access}
-
-
- :
-
-
Permissions:
-
-
Yours:
- {this.state.access}
-
-
{this.state.fullName ? this.state.fullName : "Other"}′s:
-
- {this.state.modeGiven2}
-
-
-
-
- }
- {this.state.sharer && (this.state.auth || this.state.anon) ?
-
-
Default access mode:
-
-
Auth: {this.state.admin ?
-
- {this.state.auth}
-
- :
- {this.state.auth}
- }
-
-
Anon: {this.state.admin ?
-
- {this.state.anon}
-
- :
- {this.state.anon}
- }
-
-
-
- :
- null
- }
-
- :
- null
- }
-
-
- {this.state.owner ?
-
- :
- null
- }
- {this.state.owner ?
: null }
- {this.state.groupTopic ?
-
-
- Group members:
-
-
-
-
- :
-
- }
-
- }
-
- );
- }
-};
-/* END InfoView */
-
-/* BEGIN Conversation panel */
-class ChatMessage extends React.Component {
- constructor(props) {
- super(props);
-
- this.state = {
- progress: 0
- };
-
- if (props.uploader) {
- props.uploader.onProgress = this.handleProgress.bind(this);
- }
-
- this.handlePreviewImage = this.handlePreviewImage.bind(this);
- this.handleContextClick = this.handleContextClick.bind(this);
- this.handleCancelUpload = this.handleCancelUpload.bind(this);
- }
-
- handlePreviewImage(e) {
- e.preventDefault();
- this.props.onImagePreview({
- url: e.target.src,
- filename: e.target.title,
- width: e.target.dataset.width,
- height: e.target.dataset.height,
- size: e.target.dataset.size,
- type: e.target.dataset.mime
- });
- }
-
- handleContextClick(e) {
- e.preventDefault();
- e.stopPropagation();
- this.props.showContextMenu({ seq: this.props.seq, y: e.pageY, x: e.pageX });
- }
-
- handleProgress(ratio) {
- this.setState({progress: ratio});
- }
-
- handleCancelUpload() {
- this.props.uploader.cancel();
- }
-
- render() {
- var elementKey = 0;
-
- var formatter = function(style, data, values) {
- elementKey += 1;
- var el = Drafty.tagName(style);
- if (el) {
- var attr = Drafty.attrValue(style, data) || {};
- attr.key = elementKey;
- if (style == 'IM') {
- // Additional processing for images
- var dim = fitImageSize(data.width, data.height,
- Math.min(this.props.viewportWidth - REM_SIZE * 4, REM_SIZE * 36), REM_SIZE * 24, false);
- attr.className = 'inline-image';
- attr.style = dim ? { width: dim.dstWidth + 'px', height: dim.dstHeight + 'px' } : null;
- attr.onClick = this.handlePreviewImage;
- }
- return React.createElement(el, attr, values);
- } else {
- return values;
- }
- };
-
- var sideClass = this.props.sequence + ' ' + (this.props.response ? 'left' : 'right');
- var bubbleClass = (this.props.sequence == 'single' || this.props.sequence == 'last') ?
- 'bubble tip' : 'bubble';
- var avatar = this.props.userAvatar || true;
- var fullDisplay = (this.props.userFrom && this.props.response &&
- (this.props.sequence == 'single' || this.props.sequence == 'last'));
-
- var content = this.props.content;
- var attachments = [];
- if (this.props.mimeType == Drafty.getContentType()) {
- Drafty.attachments(content, function(att, i) {
- attachments.push( );
- }, this);
- content = React.createElement('span', null, Drafty.format(content, formatter, this));
- } else if (typeof content != 'string') {
- content = error_outline invalid content
- }
-
- return (
-
- {this.props.userFrom && this.props.response ?
-
- {fullDisplay ?
- :
- null}
-
:
- null}
-
-
- {fullDisplay ?
{this.props.userName}
: null}
-
-
- );
- }
-};
-
-/* Received/read indicator */
-class ReceivedMarker extends React.PureComponent {
- render() {
- let timestamp;
- if (this.props.received <= Tinode.MESSAGE_STATUS_SENDING) {
- timestamp = "sending ...";
- } else if (this.props.received == Tinode.MESSAGE_STATUS_FAILED) {
- timestamp = "failed";
- } else {
- timestamp = shortDateFormat(this.props.timestamp);
- }
-
- let marker = null;
- if (this.props.received <= Tinode.MESSAGE_STATUS_SENDING) {
- marker = (access_time ); // watch face
- } else if (this.props.received == Tinode.MESSAGE_STATUS_FAILED) {
- marker = (error_outline ); // icon (!)
- } else if (this.props.received == Tinode.MESSAGE_STATUS_SENT) {
- marker = (done ); // checkmark
- } else if (this.props.received == Tinode.MESSAGE_STATUS_RECEIVED) {
- marker = (done_all ); // double checkmark
- } else if (this.props.received == Tinode.MESSAGE_STATUS_READ) {
- marker = (done_all ); // blue double checkmark
- }
-
- return (
-
- {timestamp}{'\u00a0'}{marker}
-
- );
- }
-};
-
-/* File uload/download progress indicator with a cancel inside */
-class FileProgress extends React.PureComponent {
- render() {
- return (
-
-
- {this.props.progress < 0.999 ?
-
close cancel
- :
-
finishing...
- }
-
- );
- }
-}
-
-class Attachment extends React.Component {
- constructor(props) {
- super(props);
-
- this.state = {
- downloader: null,
- progress: 0
- };
-
- this.downloadFile = this.downloadFile.bind(this);
- this.handleCancel = this.handleCancel.bind(this);
- }
-
- downloadFile(url, filename, mimetype) {
- var downloader = this.props.tinode.getLargeFileHelper();
- this.setState({downloader: downloader});
- downloader.download(url, filename, mimetype, (loaded) => {
- this.setState({progress: loaded / this.props.size});
- }).then(() => {
- this.setState({downloader: null, progress: 0});
- }).catch((err) => {
- if (err) {
- this.props.onError("Error downloading file: " + err.message, 'err');
- }
- this.setState({downloader: null, progress: 0});
- });
- }
-
- handleCancel() {
- if (this.props.uploader) {
- this.props.onCancelUpload();
- } else if (this.state.downloader) {
- this.state.downloader.cancel();
- }
- }
-
- render() {
- let filename = this.props.filename || 'file_attachment';
- if (filename.length > 36) {
- filename = filename.substr(0, 16) + '...' + filename.substr(-16);
- }
- let size = this.props.size > 0 ?
- ({bytesToHumanSize(this.props.size)}) :
- null;
-
- // Detect if the download URL is relative or absolute.
- // If the URL is relative use LargeFileHelper to attach authentication
- // credentials to the request.
- let url, helperFunc;
- if (!this.props.uploader && !this.state.downloader &&
- !(/^(?:(?:[a-z]+:)?\/\/)/i.test(this.props.downloadUrl))) {
- // Relative URL. Use download helper.
- url = "javascript:;";
- helperFunc = (e) => {
- this.downloadFile(this.props.downloadUrl, this.props.filename, this.props.mimetype);
- };
- } else {
- url = this.props.downloadUrl;
- helperFunc = null;
- }
- return (
-
-
insert_drive_file
-
-
{filename} {size}
- {this.props.uploader || this.state.downloader ?
-
- :
-
- }
-
-
- );
- }
-};
-
-const NOT_FOUND_TOPIC_TITLE = "Not found";
-
-class MessagesView extends React.Component {
- constructor(props) {
- super(props);
-
- this.state = {
- messages: [],
- onlineSubs: [],
- topic: '',
- title: '',
- avatar: null,
- scrollPosition: 0,
- readOnly: props.acs ? !props.acs.isWriter() : true,
- writeOnly: props.acs ? !props.acs.isReader() : true,
- typingIndicator: false,
- imagePreview: null
- };
-
- this.propsChange = this.propsChange.bind(this);
- this.leave = this.leave.bind(this);
- this.handleScrollReference = this.handleScrollReference.bind(this);
- this.fetchMoreMessages = this.fetchMoreMessages.bind(this);
- this.handleDescChange = this.handleDescChange.bind(this);
- this.handleSubsUpdated = this.handleSubsUpdated.bind(this);
- this.handleNewMessage = this.handleNewMessage.bind(this);
- this.handleAllMessagesReceived = this.handleAllMessagesReceived.bind(this);
- this.handleInfoReceipt = this.handleInfoReceipt.bind(this);
- this.handleImagePreview = this.handleImagePreview.bind(this);
- this.handleCloseImagePreview = this.handleCloseImagePreview.bind(this);
- this.handleContextClick = this.handleContextClick.bind(this);
- this.handleShowContextMenuMessage = this.handleShowContextMenuMessage.bind(this);
- this.handleBackNavigation = this.handleBackNavigation.bind(this);
- }
-
- // Scroll last message into view on component update e.g. on message received.
- componentDidUpdate(prevProps, prevState) {
- if (this.messagesScroller &&
- (prevState.title != this.state.title ||
- prevState.messages.length != this.state.messages.length)) {
- this.messagesScroller.scrollTop = this.messagesScroller.scrollHeight - this.state.scrollPosition;
- }
- }
-
- componentDidMount() {
- this.propsChange(this.props);
- if (this.messagesScroller) {
- this.messagesScroller.addEventListener('scroll', this.fetchMoreMessages);
- }
- }
-
- componentWillUnmount() {
- this.leave(this.state.topic);
- if (this.messagesScroller) {
- this.messagesScroller.removeEventListener('scroll', this.fetchMoreMessages);
- }
- }
-
- UNSAFE_componentWillReceiveProps(nextProps) {
- this.propsChange(nextProps);
- }
-
- propsChange(props) {
- if (!props || !props.topic) {
- let oldTopic = this.state.topic;
- this.setState({messages: [], onlineSubs: [], topic: null}, this.leave(oldTopic));
- return;
- }
-
- if (!props.connected) {
- // connection lost, clear online subs
- this.setState({onlineSubs: []});
- return;
- }
-
- let topic = this.props.tinode.getTopic(props.topic);
- if (!topic) {
- return;
- }
-
- let newGroupTopic = Tinode.isNewGroupTopicName(props.topic);
- let tryToResubscribe = !this.props.connected && props.connected;
-
- if (props.topic != this.state.topic) {
- let msgs = [];
- let subs = [];
-
- // Bind the new topic to component.
- topic.onData = this.handleNewMessage;
- topic.onAllMessagesReceived = this.handleAllMessagesReceived;
- topic.onInfo = this.handleInfoReceipt;
- topic.onMetaDesc = this.handleDescChange;
- topic.onSubsUpdated = this.handleSubsUpdated;
- topic.onPres = this.handleSubsUpdated;
- // Unbind the previous topic from this component.
- this.leave(this.state.topic);
-
- this.handleDescChange(topic);
- topic.subscribers((sub) => {
- if (sub.online && sub.user != this.props.myUserId) {
- subs.push(sub);
- }
- });
-
- topic.messages(function(msg) {
- if (!msg.deleted) {
- msgs = msgs.concat(msg);
- }
- });
-
- this.setState({
- messages: msgs,
- onlineSubs: subs,
- topic: props.topic,
- imagePreview: null,
- scrollPosition: 0
- });
- tryToResubscribe = true;
-
- // The user switched to the new topic before the timer for
- // the previous topic has triggered, kill it.
- this.props.readTimerHandler(null);
- }
-
- this.setState({
- readOnly: props.acs ? !props.acs.isWriter() : true,
- writeOnly: props.acs ? !props.acs.isReader() : true
- });
-
- if (!topic.isSubscribed() && tryToResubscribe) {
- // Don't request the tags. They are useless unless the user
- // is the owner and is editing the topic.
- let getQuery = topic.startMetaQuery()
- .withLaterDesc()
- .withLaterSub()
- .withLaterData(MESSAGES_PAGE)
- .withLaterDel();
- let setQuery = newGroupTopic ? props.newGroupTopicParams : undefined;
- // Show "loading" spinner.
- this.setState({ fetchingMessages: true });
- topic.subscribe(getQuery.build(), setQuery)
- .then((ctrl) => {
- this.setState({topic: ctrl.topic});
- this.props.onNewTopicCreated(props.topic, ctrl.topic);
- // If there are unsent messages, try sending them now.
- topic.queuedMessages((pub) => {
- if (!pub._sending && topic.isSubscribed()) {
- topic.publishMessage(pub);
- }
- });
- })
- .catch((err) => {
- this.props.onError(err.message, 'err');
- this.setState({
- title: NOT_FOUND_TOPIC_TITLE,
- avatar: null,
- readOnly: true,
- writeOnly: true,
- fetchingMessages: false,
- messages: [],
- onlineSubs: [],
- typingIndicator: false,
- imagePreview: null
- });
- });
- }
- }
-
- leave(oldTopicName) {
- if (!oldTopicName) {
- return;
- }
- let oldTopic = this.props.tinode.getTopic(oldTopicName);
- if (oldTopic && oldTopic.isSubscribed()) {
- oldTopic.leave(false)
- .catch(() => { /* do nothing here */ })
- .finally(() => {
- // We don't care if the request succeeded or failed.
- // The topic is dead regardless.
- this.setState({fetchingMessages: false});
- oldTopic.onData = undefined;
- oldTopic.onAllMessagesReceived = undefined;
- oldTopic.onInfo = undefined;
- oldTopic.onMetaDesc = undefined;
- oldTopic.onSubsUpdated = undefined;
- oldTopic.onPres = undefined;
- });
- }
- }
-
- handleScrollReference(node) {
- if (node) {
- node.addEventListener('scroll', this.fetchMoreMessages);
- this.messagesScroller = node;
- }
- }
-
- // Get older messages
- fetchMoreMessages(event) {
- if (event.target.scrollTop <= 0) {
- let newState = {scrollPosition: event.target.scrollHeight - event.target.scrollTop};
- this.setState((prevState, props) => {
- if (!prevState.fetchingMessages) {
- var topic = this.props.tinode.getTopic(this.state.topic);
- if (topic && topic.isSubscribed() && topic.msgHasMoreMessages()) {
- newState.fetchingMessages = true;
- topic.getMessagesPage(MESSAGES_PAGE).catch((err) => {
- this.setState({fetchingMessages: false});
- this.props.onError(err.message, 'err');
- });
- }
- }
- return newState;
- });
- }
- }
-
- handleDescChange(desc) {
- if (desc.public) {
- this.setState({
- title: desc.public.fn,
- avatar: makeImageUrl(desc.public.photo)
- });
- } else {
- this.setState({
- title: '',
- avatar: null
- });
- }
- if (desc.acs) {
- this.setState({
- readOnly: !desc.acs.isWriter(),
- writeOnly: !desc.acs.isReader()
- });
- }
- }
-
- handleSubsUpdated() {
- if (this.state.topic) {
- var subs = [];
- var topic = this.props.tinode.getTopic(this.state.topic);
- topic.subscribers((sub) => {
- if (sub.online && sub.user != this.props.myUserId) {
- subs.push(sub);
- }
- });
- this.setState({onlineSubs: subs});
- }
- }
-
- handleNewMessage(msg) {
- // Regenerate messages list
- var topic = this.props.tinode.getTopic(this.state.topic);
- var newState = {messages: []};
- topic.messages(function(m) {
- if (!m.deleted) {
- newState.messages = newState.messages.concat(m);
- }
- });
-
- // msg could be null if one or more messages were deleted.
- if (msg && !msg.deleted) {
- // If the message is added to the end of the message list,
- // scroll to the bottom.
- if (topic.isNewMessage(msg.seq)) {
- newState.scrollPosition = 0;
- }
-
- // Aknowledge all messages, including own messages.
- let status = topic.msgStatus(msg);
- if (status >= Tinode.MESSAGE_STATUS_SENT) {
- this.props.readTimerHandler(() => {
- topic.noteRead(msg.seq);
- });
- }
- this.props.onData(msg);
- }
-
- this.setState(newState);
- }
-
- handleAllMessagesReceived(count) {
- this.setState({fetchingMessages: false});
- }
-
- handleInfoReceipt(info) {
- switch (info.what) {
- case 'kp': {
- clearTimeout(this.keyPressTimer);
- var instance = this;
- this.keyPressTimer = setTimeout(function() {
- instance.setState({typingIndicator: false});
- }, KEYPRESS_DELAY + 1000);
- if (!this.state.typingIndicator) {
- this.setState({typingIndicator: true});
- }
- break;
- }
- case 'read':
- case 'recv':
- // Redraw due to changed recv/read status.
- this.forceUpdate();
- break;
- default:
- console.log("Other change in topic: ", info.what);
- }
- }
-
- handleImagePreview(content) {
- this.setState({ imagePreview: content });
- }
-
- handleCloseImagePreview() {
- this.setState({ imagePreview: null });
- }
-
- handleContextClick(e) {
- e.preventDefault();
- e.stopPropagation();
- this.props.showContextMenu({ topicName: this.state.topic, y: e.pageY, x: e.pageX });
- }
-
- handleShowContextMenuMessage(params) {
- params.topicName = this.state.topic;
- var menuItems = ['message_delete'];
- var topic = this.props.tinode.getTopic(params.topicName);
- if (topic) {
- var acs = topic.getAccessMode();
- if (acs && acs.isDeleter()) {
- menuItems.push('message_delete_hard');
- }
- }
- this.props.showContextMenu(params, menuItems);
- }
-
- handleBackNavigation() {
- this.props.onHideMessagesView();
- }
-
- render() {
- var component = null;
- if (this.state.topic) {
- var messageNodes = [];
- var topic = this.props.tinode.getTopic(this.state.topic);
- var groupTopic = topic.getType() == 'grp';
- var previousFrom = null;
- for (var i=0; i
- );
- }
-
- let lastSeen = null;
- let cont = this.props.tinode.getMeTopic().getContact(this.state.topic);
- if (cont && Tinode.topicType(cont.topic) == 'p2p') {
- if (cont.online) {
- lastSeen = "online now";
- } else if (cont.seen) {
- lastSeen = "Last active: " + shortDateFormat(cont.seen.when);
- // TODO(gene): also handle user agent in c.seen.ua
- }
- }
- var avatar = this.state.avatar || true;
- var online = this.props.online ? 'online' + (this.state.typingIndicator ? ' typing' : '') : 'offline';
-
- component = (
-
-
- {this.props.displayMobile ?
-
- arrow_back
-
- :
- null}
-
-
-
-
-
-
{this.state.title || Unknown }
-
{lastSeen}
-
- {groupTopic ?
-
:
-
- }
-
-
- {this.props.displayMobile ?
-
- : null}
-
-
-
- {this.state.writeOnly ?
-
-
no access to messages
-
- :
- null
- }
-
-
- {this.state.imagePreview ?
-
: null}
-
- );
- } else {
- component = (
-
- );
- }
- return component;
- }
-};
-
-/* Send message form */
-class SendMessage extends React.PureComponent {
- constructor(props) {
- super(props);
-
- this.state = {
- message: '',
- // Make initial keypress time as if it happened 5001 milliseconds in the past.
- keypressTimestamp: new Date().getTime() - KEYPRESS_DELAY - 1
- };
-
- this.handlePasteEvent = this.handlePasteEvent.bind(this);
- this.handleAttachImage = this.handleAttachImage.bind(this);
- this.handleAttachFile = this.handleAttachFile.bind(this);
- this.handleSend = this.handleSend.bind(this);
- this.handleKeyPress = this.handleKeyPress.bind(this);
- this.handleMessageTyping = this.handleMessageTyping.bind(this);
- }
-
- componentDidMount() {
- this.pasteFile.addEventListener('paste', this.handlePasteEvent, false);
- }
-
- componentWillUnmount() {
- this.pasteFile.removeEventListener('paste', this.handlePasteEvent, false)
- }
-
- handlePasteEvent(e) {
- if (this.props.disabled) {
- return;
- }
- // FIXME: handle large files too.
- if (filePasted(e,
- (bits, mime, width, height, fname) => {
- this.props.sendMessage(Drafty.insertImage(null,
- 0, mime, bits, width, height, fname));
- },
- (mime, bits, fname) => {
- this.props.sendMessage(Drafty.attachFile(null, mime, bits, fname));
- },
- this.props.onError)) {
-
- // If a file was pasted, don't paste base64 data into input field.
- e.preventDefault();
- }
- }
-
- handleAttachImage(e) {
- if (e.target.files && e.target.files.length > 0) {
- let file = e.target.files[0];
- // Check if the uploaded file is indeed an image and if it isn't too large.
- if (file.size > MAX_INBAND_ATTACHMENT_SIZE || SUPPORTED_IMAGE_FORMATS.indexOf(file.type) < 0) {
- // Convert image for size or format.
- imageFileScaledToBase64(file, MAX_IMAGE_DIM, MAX_IMAGE_DIM, false,
- // Success
- (bits, mime, width, height, fname) => {
- this.props.sendMessage(Drafty.insertImage(null,
- 0, mime, bits, width, height, fname));
- },
- // Failure
- (err) => {
- this.props.onError(err, 'err');
- });
- } else {
- // Image can be uploaded as is. No conversion is needed.
- imageFileToBase64(file,
- // Success
- (bits, mime, width, height, fname) => {
- this.props.sendMessage(Drafty.insertImage(null,
- 0, mime, bits, width, height, fname));
- },
- // Failure
- (err) => {
- this.props.onError(err, 'err');
- }
- );
- }
- }
- // Clear the value so the same file can be uploaded again.
- e.target.value = '';
- }
-
- handleAttachFile(e) {
- if (e.target.files && e.target.files.length > 0) {
- var file = e.target.files[0];
- if (file.size > MAX_EXTERN_ATTACHMENT_SIZE) {
- // Too large.
- this.props.onError("The file size " + bytesToHumanSize(file.size) +
- " exceeds the " + bytesToHumanSize(MAX_EXTERN_ATTACHMENT_SIZE) + " limit.", 'err');
- } else if (file.size > MAX_INBAND_ATTACHMENT_SIZE) {
- // Too large to send inband - uploading out of band and sending as a link.
- let uploader = this.props.tinode.getLargeFileHelper();
- if (!uploader) {
- this.props.onError("Cannot initiate file upload.");
- return;
- }
- // Format data and initiate upload.
- let uploadCompletionPromise = uploader.upload(file);
- let msg = Drafty.attachFile(null, file.type, null, file.name, file.size, uploadCompletionPromise);
- // Pass data and the uploader to the TinodeWeb.
- this.props.sendMessage(msg, uploadCompletionPromise, uploader);
- } else {
- // Small enough to send inband.
- fileToBase64(file,
- (mime, bits, fname) => {
- this.props.sendMessage(Drafty.attachFile(null, mime, bits, fname));
- },
- this.props.onError
- );
- }
- }
- // Clear the value so the same file can be uploaded again.
- e.target.value = '';
- }
-
- handleSend() {
- var message = this.state.message.trim();
- if (message) {
- this.props.sendMessage(this.state.message.trim());
- this.setState({message: ''});
- }
- }
-
- /* Send on Enter key */
- handleKeyPress(e) {
- // Remove this if you don't want Enter to trigger send
- if (e.key === 'Enter') {
- // Have Shift-Enter insert a line break instead
- if (!e.shiftKey) {
- e.preventDefault();
- e.stopPropagation();
-
- this.handleSend();
- }
- }
- }
-
- handleMessageTyping(e) {
- var newState = {message: e.target.value};
- var now = new Date().getTime();
- if (now - this.state.keypressTimestamp > KEYPRESS_DELAY) {
- var topic = this.props.tinode.getTopic(this.props.topic);
- if (topic.isSubscribed()) {
- topic.noteKeyPress();
- }
- newState.keypressTimestamp = now;
- }
- this.setState(newState);
- }
-
- render() {
- var prompt = this.props.disabled ? "Messaging disabled" : "New message";
- var instance = this;
- return (
-
- {this.props.disabled ?
-
photo :
-
- photo
- }
- {this.props.disabled ?
-
attach_file :
-
- attach_file
- }
-
- {this.props.disabled ?
-
send :
-
send }
-
-
-
- );
- }
-};
-
-/* This is just a static page to display when no conversation is selected. */
-class LogoView extends React.PureComponent {
- render() {
- var version = APP_NAME + ' (' + Tinode.getLibrary() + ')';
- return (
-
-
-
-
- Tinode Web
-
-
Client: {version}
-
Server: {this.props.serverVersion} ({this.props.serverAddress})
-
-
- );
- }
-};
-
-class ImagePreview extends React.PureComponent {
- constructor(props) {
- super(props);
-
- this.state = {};
- }
-
- componentDidMount() {
- this.setState({
- width: this.container.clientWidth,
- height: this.container.clientHeight
- });
- }
-
- render() {
- if (!this.props.content) {
- return null;
- }
- var instance = this;
- var dim = fitImageSize(this.props.content.width, this.props.content.height,
- this.state.width, this.state.height, false);
- var size = dim ? { width: dim.dstWidth + 'px', height: dim.dstHeight + 'px' } :
- ((this.props.content.width > this.props.content.height) ? {width: '100%'} : {height: '100%'});
- size.maxWidth = '100%';
- size.maxHeight = '100%';
-
- var filename = this.props.content.filename;
- var maxlength = (this.props.content.width / REM_SIZE) | 0;
- if (filename.length > maxlength) {
- filename = filename.slice(0, maxlength-2) + '...' + filename.slice(2-maxlength);
- }
- return (
-
-
-
-
-
-
-
- );
- }
-};
-/* END Conversation panel */
-
-/* The top-level class to hold all fuinctionality together */
-class TinodeWeb extends React.Component {
- constructor(props) {
- super(props);
-
- this.state = this.getBlankState();
-
- this.handleResize = this.handleResize.bind(this);
- this.handleHashRoute = this.handleHashRoute.bind(this);
- this.handleOnline = this.handleOnline.bind(this);
- this.handleAppVisibility = this.handleAppVisibility.bind(this);
- this.handleReadTimer = this.handleReadTimer.bind(this);
- this.handleVisibilityEvent = this.handleVisibilityEvent.bind(this);
- this.handleError = this.handleError.bind(this);
- this.handleLoginRequest = this.handleLoginRequest.bind(this);
- this.handleConnected = this.handleConnected.bind(this);
- this.doLogin = this.doLogin.bind(this);
- this.handleCredentialsRequest = this.handleCredentialsRequest.bind(this);
- this.handleLoginSuccessful = this.handleLoginSuccessful.bind(this);
- this.handleDisconnect = this.handleDisconnect.bind(this);
- this.tnMeMetaDesc = this.tnMeMetaDesc.bind(this);
- this.tnMeContactUpdate = this.tnMeContactUpdate.bind(this);
- this.tnMeSubsUpdated = this.tnMeSubsUpdated.bind(this);
- this.resetContactList = this.resetContactList.bind(this);
- this.tnData = this.tnData.bind(this);
- this.tnInitFind = this.tnInitFind.bind(this);
- this.tnFndSubsUpdated = this.tnFndSubsUpdated.bind(this);
- this.handleSearchContacts = this.handleSearchContacts.bind(this);
- this.handleTopicSelected = this.handleTopicSelected.bind(this);
- this.handleHideMessagesView = this.handleHideMessagesView.bind(this);
- this.handleSendMessage = this.handleSendMessage.bind(this);
- this.handleNewAccount = this.handleNewAccount.bind(this);
- this.handleNewAccountRequest = this.handleNewAccountRequest.bind(this);
- this.handleUpdateAccountRequest = this.handleUpdateAccountRequest.bind(this);
- this.handleUpdateAccountTagsRequest = this.handleUpdateAccountTagsRequest.bind(this);
- this.handleSettings = this.handleSettings.bind(this);
- this.handleGlobalSettings = this.handleGlobalSettings.bind(this);
- this.handleToggleMessageSounds = this.handleToggleMessageSounds.bind(this);
- this.initDesktopAlerts = this.initDesktopAlerts.bind(this);
- this.togglePushToken = this.togglePushToken.bind(this);
- this.requestPushToken = this.requestPushToken.bind(this);
- this.handleSidepanelCancel = this.handleSidepanelCancel.bind(this);
- this.handleNewTopic = this.handleNewTopic.bind(this);
- this.handleNewTopicRequest = this.handleNewTopicRequest.bind(this);
- this.handleNewTopicCreated = this.handleNewTopicCreated.bind(this);
- this.handleTopicUpdateRequest = this.handleTopicUpdateRequest.bind(this);
- this.handleChangePermissions = this.handleChangePermissions.bind(this);
- this.handleTagsUpdated = this.handleTagsUpdated.bind(this);
- this.handleLogout = this.handleLogout.bind(this);
- this.handleLeaveUnsubRequest = this.handleLeaveUnsubRequest.bind(this);
- this.handleDialogCancel = this.handleDialogCancel.bind(this);
- this.handleShowContextMenu = this.handleShowContextMenu.bind(this);
- this.defaultTopicContextMenu = this.defaultTopicContextMenu.bind(this);
- this.handleHideContextMenu = this.handleHideContextMenu.bind(this);
- this.handleShowInfoView = this.handleShowInfoView.bind(this);
- this.handleHideInfoView = this.handleHideInfoView.bind(this);
- this.handleMemberUpdateRequest = this.handleMemberUpdateRequest.bind(this);
- this.handleValidateCredentialsRequest = this.handleValidateCredentialsRequest.bind(this);
- this.handlePasswordResetRequest = this.handlePasswordResetRequest.bind(this);
- this.handleResetPassword = this.handleResetPassword.bind(this);
- }
-
- getBlankState() {
- let settings = localStorage.getObject("settings") || {};
-
- return {
- connected: false,
- transport: settings.transport || null,
- serverAddress: settings.serverAddress || detectServerAddress(),
- serverVersion: "no connection",
- // "On" is the default, so saving the "off" state.
- messageSounds: !settings.messageSoundsOff,
- desktopAlerts: settings.desktopAlerts,
- desktopAlertsEnabled: (isSecureConnection() || isLocalHost()) &&
- (typeof firebase != 'undefined') && (typeof navigator != 'undefined') &&
- (typeof FIREBASE_INIT != 'undefined'),
- firebaseToken: localStorage.getObject("firebase-token"),
-
- errorText: '',
- errorLevel: null,
-
- sidePanelSelected: 'login',
- sidePanelTitle: null,
- sidePanelAvatar: null,
- dialogSelected: null,
- contextMenuVisible: false,
- login: '',
- password: '',
- myUserId: null,
- liveConnection: navigator.onLine,
- topicSelected: '',
- topicSelectedOnline: false,
- topicSelectedAcs: null,
- newGroupTopicParams: null,
- loginDisabled: false,
- displayMobile: (window.innerWidth <= MEDIA_BREAKPOINT),
- showInfoPanel: false,
- mobilePanel: 'sidepanel',
-
- contextMenuVisible: false,
- contextMenuBounds: null,
- contextMenuClickAt: null,
- contextMenuParams: null,
- contextMenuItems: [],
-
- // Chats as shown in the ContactsView
- chatList: [],
- // Contacts returned by a search query.
- searchResults: [],
- // Merged results of a search query and p2p chats.
- searchableContacts: [],
- credMethod: undefined,
- credCode: undefined
- };
- }
-
- componentDidMount() {
- window.addEventListener('resize', this.handleResize);
- window.addEventListener('online', (e) => { this.handleOnline(true); });
- window.addEventListener('offline', (e) => { this.handleOnline(false); });
- window.addEventListener('hashchange', this.handleHashRoute);
- // Window/tab visible or invisible for pausing timers.
- document.addEventListener('visibilitychange', this.handleVisibilityEvent);
-
- this.setState({viewportWidth: document.documentElement.clientWidth});
-
- this.tinode = TinodeWeb.tnSetup(this.state.serverAddress, this.state.transport);
- this.tinode.onConnect = this.handleConnected;
- this.tinode.onDisconnect = this.handleDisconnect;
-
- // Initialize desktop alerts.
- if (this.state.desktopAlertsEnabled) {
- try {
- this.fbPush = firebase.initializeApp(FIREBASE_INIT, APP_NAME).messaging();
- this.fbPush.usePublicVapidKey(FIREBASE_INIT.messagingVapidKey);
- navigator.serviceWorker.register('/service-worker.js').then((reg) => {
- this.fbPush.useServiceWorker(reg);
- this.initDesktopAlerts();
- if (this.state.desktopAlerts) {
- if (!this.state.firebaseToken) {
- this.togglePushToken(true);
- } else {
- this.tinode.setDeviceToken(this.state.firebaseToken);
- }
- }
- }).catch((err) => {
- // registration failed :(
- console.log("Failed to register service worker:", err);
- });
- } catch (err) {
- this.handleError("Failed to initialize push notifications", 'err');
- console.log("Failed to initialize push notifications", err);
- this.setState({desktopAlertsEnabled: false});
- }
- }
-
- let token = localStorage.getObject('keep-logged-in') ?
- localStorage.getObject('auth-token') : undefined;
-
- let parsedNav = parseUrlHash(window.location.hash);
- if (token) {
- // When reading from storage, date is returned as string.
- token.expires = new Date(token.expires);
- this.tinode.setAuthToken(token);
- this.tinode.connect().catch((err) => {
- // Socket error
- this.handleError(err.message, 'err');
- });
- delete parsedNav.params.info;
- delete parsedNav.params.tab;
- parsedNav.path[0] = '';
- navigateTo(composeUrlHash(parsedNav.path, parsedNav.params));
- } else if (!parsedNav.params.token) {
- navigateTo('');
- }
-
- this.readTimer = null;
- this.readTimerCallback = null;
-
- this.handleHashRoute();
- }
-
- componentWillUnmount() {
- window.removeEventListener('resize', this.handleResize);
- window.removeEventListener('hashchange', this.handleHashRoute);
- document.removeEventListener('visibilitychange', this.handleVisibilityEvent);
- }
-
- // Setup transport (usually websocket) and server address. This will terminate connection with the server.
- static tnSetup(serverAddress, transport) {
- let tinode = new Tinode(APP_NAME, serverAddress, API_KEY, transport, isSecureConnection());
- tinode.enableLogging(true, true);
- return tinode;
- }
-
- handleResize() {
- var mobile = document.documentElement.clientWidth <= MEDIA_BREAKPOINT;
- this.setState({viewportWidth: document.documentElement.clientWidth});
- if (this.state.displayMobile != mobile) {
- this.setState({displayMobile: mobile});
- }
- }
-
- // Handle for hashchange event: display appropriate panels.
- handleHashRoute() {
- var hash = parseUrlHash(window.location.hash);
- if (hash.path && hash.path.length > 0) {
- // Left-side panel selector.
- if (['register','settings','edit','cred','reset','newtpk','contacts',''].includes(hash.path[0])) {
- this.setState({sidePanelSelected: hash.path[0]});
- } else {
- console.log("Unknown sidepanel view", hash.path[0]);
- }
-
- // Topic for MessagesView selector.
- if (hash.path.length > 1 && hash.path[1] != this.state.topicSelected) {
- this.setState({
- topicSelected: Tinode.topicType(hash.path[1]) ? hash.path[1] : null
- });
- }
- } else {
- // Empty hashpath
- this.setState({sidePanelSelected: ''});
- }
-
- // Save validation credentials, if available.
- if (hash.params.method) {
- this.setState({ credMethod: hash.params.method });
- }
- if (hash.params.code) {
- this.setState({ credCode: hash.params.code });
- }
-
- // Additional parameters of panels.
- this.setState({
- showInfoPanel: hash.params.info,
- newTopicTabSelected: hash.params.tab
- });
- }
-
- handleOnline(online) {
- var newState = {liveConnection: online};
- if (online) {
- this.handleError('', null);
- } else {
- this.handleError("No connection", 'warn');
- }
- this.setState({liveConnection: online});
- }
-
- // Handling read notifications here to be able to pause
- // them then the window/tab is not visible.
- handleAppVisibility(visible, callback) {
- clearTimeout(this.readTimer);
- this.readTimerCallback = callback;
- if (visible && callback) {
- this.readTimer = setTimeout(callback, READ_DELAY);
- } else {
- this.readTimer = null;
- }
- }
-
- handleReadTimer(callback) {
- this.handleAppVisibility(!document.hidden, callback);
- }
-
- handleVisibilityEvent() {
- this.handleAppVisibility(!document.hidden, this.readTimerCallback);
- }
-
- handleError(err, level) {
- this.setState({errorText: err, errorLevel: level});
- }
-
- // User clicked Login button in the side panel.
- handleLoginRequest(login, password) {
- this.setState({loginDisabled: true, login: login, password: password});
- this.handleError('', null);
-
- if (this.tinode.isConnected()) {
- this.doLogin(login, password, {meth: this.state.credMethod, resp: this.state.credCode});
- } else {
- this.tinode.connect().catch((err) => {
- // Socket error
- this.setState({loginDisabled: false});
- this.handleError(err.message, 'err');
- });
- }
- }
-
- // Connection succeeded.
- handleConnected() {
- var params = this.tinode.getServerInfo();
- this.setState({
- serverVersion: params.ver + ' ' + (params.build ? params.build : 'none') + '; '
- });
- this.doLogin(this.state.login, this.state.password, {meth: this.state.credMethod, resp: this.state.credCode});
- }
-
- doLogin(login, password, cred) {
- if (this.tinode.isAuthenticated()) {
- // Already logged in. Go to default screen.
- navigateTo("");
- return;
- }
- // Sanitize and package credentail.
- cred = Tinode.credential(cred);
- // Try to login with login/password. If they are not available, try token. If no token, ask for login/password.
- let promise = null;
- let token = this.tinode.getAuthToken();
- if (login && password) {
- this.setState({password: null});
- promise = this.tinode.loginBasic(login, password, cred);
- } else if (token) {
- promise = this.tinode.loginToken(token.token, cred);
- }
-
- if (promise) {
- promise.then((ctrl) => {
- if (ctrl.code >= 300 && ctrl.text === 'validate credentials') {
- if (cred) {
- this.handleError("Code does not match", 'warn');
- }
- this.handleCredentialsRequest(ctrl.params);
- } else {
- this.handleLoginSuccessful();
- }
- }).catch((err) => {
- // Login failed, report error.
- this.setState({loginDisabled: false, credMethod: undefined, credCode: undefined});
- this.handleError(err.message, 'err');
- localStorage.removeItem('auth-token');
- navigateTo('');
- });
- } else {
- // No login credentials provided.
- // Make sure we are on the login page.
- navigateTo('');
- this.setState({loginDisabled: false});
- }
- }
-
- handleCredentialsRequest(params) {
- var parsed = parseUrlHash(window.location.hash);
- parsed.path[0] = 'cred';
- parsed.params['method'] = params.cred[0];
- navigateTo(composeUrlHash(parsed.path, parsed.params));
- }
-
- handleLoginSuccessful() {
- this.handleError('', null);
-
- // Refresh authentication token.
- if (localStorage.getObject('keep-logged-in')) {
- localStorage.setObject('auth-token', this.tinode.getAuthToken());
- }
- // Logged in fine, subscribe to 'me' attaching callbacks from the contacts view.
- var me = this.tinode.getMeTopic();
- me.onMetaDesc = this.tnMeMetaDesc;
- me.onContactUpdate = this.tnMeContactUpdate;
- me.onSubsUpdated = this.tnMeSubsUpdated;
- this.setState({
- connected: true,
- credMethod: undefined,
- credCode: undefined,
- myUserId: this.tinode.getCurrentUserID()
- });
- // Subscribe, fetch topic desc, the list of subscriptions. Messages are not fetched.
- me.subscribe(
- me.startMetaQuery().
- withLaterSub().
- withDesc().
- build()
- ).catch((err) => {
- localStorage.removeItem('auth-token');
- this.handleError(err.message, 'err');
- navigateTo('');
- });
- navigateTo(setUrlSidePanel(window.location.hash, 'contacts'));
- }
-
- handleDisconnect(err) {
- this.setState({
- connected: false,
- topicSelectedOnline: false,
- dialogSelected: null,
- errorText: err && err.message ? err.message : "Disconnected",
- errorLevel: err && err.message ? 'err' : 'warn',
- loginDisabled: false,
- contextMenuVisible: false,
- serverVersion: "no connection"
- });
- }
-
- tnMeMetaDesc(desc) {
- if (desc && desc.public) {
- this.setState({
- sidePanelTitle: desc.public.fn,
- sidePanelAvatar: makeImageUrl(desc.public.photo)
- });
- }
- }
-
- // Reactions to updates to the contact list.
- tnMeContactUpdate(what, cont) {
- if (what == 'on' || what == 'off') {
- this.resetContactList();
- if (this.state.topicSelected == cont.topic) {
- this.setState({topicSelectedOnline: (what == 'on')});
- }
- } else if (what == 'read') {
- this.resetContactList();
- } else if (what == 'msg') {
- // New message received
- // Skip update if the topic is currently open, otherwise the badge will annoyingly flash.
- if (this.state.topicSelected != cont.topic) {
- if (this.state.messageSounds) {
- POP_SOUND.play();
- }
- this.resetContactList();
- } else if (document.hidden && this.state.messageSounds) {
- POP_SOUND.play();
- }
- } else if (what == 'recv') {
- // Explicitly ignoring "recv" -- it causes no visible updates to contact list.
- } else if (what == 'gone' || what == 'unsub') {
- // Topic deleted or user unsubscribed. Remove topic from view.
- // If the currently selected topic is gone, clear the selection.
- if (this.state.topicSelected == cont.topic) {
- this.handleTopicSelected(null);
- }
- // Redraw without the deleted topic.
- this.resetContactList();
- } else if (what == 'acs') {
- // Permissions changed. If it's for the currently selected topic,
- // update the views.
- if (this.state.topicSelected == cont.topic) {
- this.setState({topicSelectedAcs: cont.acs});
- }
- } else if (what == 'del') {
- // messages deleted (hard or soft) -- update pill counter.
- } else {
- // TODO(gene): handle other types of notifications:
- // * ua -- user agent changes (maybe display a pictogram for mobile/desktop).
- // * upd -- topic 'public' updated, issue getMeta().
- console.log("Unsupported (yet) presence update:" + what + " in: " + cont.topic);
- }
- }
-
- tnMeSubsUpdated(unused) {
- this.resetContactList();
- }
-
- // Merge search results and contact list to create a single flat
- // list of kown contacts for GroupManager to use.
- static prepareSearchableContacts(chatList, foundContacts) {
- let merged = {};
-
- // For chatList topics merge only p2p topics and convert them to the
- // same format as foundContacts.
- for (const c of chatList) {
- if (Tinode.topicType(c.topic) == 'p2p') {
- merged[c.topic] = {
- user: c.topic,
- updated: c.updated,
- public: c.public,
- private: c.private,
- acs: c.acs
- };
- }
- }
-
- // Add all foundCountacts if they have not been added already.
- for (const c of foundContacts) {
- if (!merged[c.user]) {
- merged[c.user] = c;
- }
- }
-
- return Object.values(merged);
- }
-
- resetContactList() {
- let newState = {
- chatList: []
- };
- this.tinode.getMeTopic().contacts((c) => {
- newState.chatList.push(c);
- if (this.state.topicSelected == c.topic) {
- newState.topicSelectedOnline = c.online;
- newState.topicSelectedAcs = c.acs;
- }
- });
- // Merge search results and chat list.
- newState.searchableContacts = TinodeWeb.prepareSearchableContacts(newState.chatList, this.state.searchResults);
- this.setState(newState);
- }
-
- // Sending "received" notifications
- tnData(data) {
- let topic = this.tinode.getTopic(data.topic);
- if (topic.msgStatus(data) >= Tinode.MESSAGE_STATUS_SENT) {
- clearTimeout(this.receivedTimer);
- this.receivedTimer = setTimeout(() => {
- this.receivedTimer = undefined;
- topic.noteRecv(data.seq);
- }, RECEIVED_DELAY);
- }
- }
-
- /* Fnd topic: find contacts by tokens */
- tnInitFind() {
- let fnd = this.tinode.getFndTopic();
- if (fnd.isSubscribed()) {
- this.tnFndSubsUpdated();
- } else {
- fnd.onSubsUpdated = this.tnFndSubsUpdated;
- fnd.subscribe(fnd.startMetaQuery().withSub().withTags().build()).catch((err) => {
- this.handleError(err.message, 'err');
- });
- }
- }
-
- tnFndSubsUpdated() {
- let foundContacts = [];
- // Don't attempt to create P2P topics which already exist. Server will reject the duplicates.
- this.tinode.getFndTopic().contacts((s) => {
- foundContacts.push(s);
- });
- this.setState({
- searchResults: foundContacts,
- searchableContacts: TinodeWeb.prepareSearchableContacts(this.state.chatList, foundContacts)
- });
- }
-
- /** Called when the user enters a contact into the contact search field in the NewAccount panel
- @param query {Array} is an array of contacts to search for
- */
- handleSearchContacts(query) {
- var fnd = this.tinode.getFndTopic();
- fnd.setMeta({desc: {public: query}}).then((ctrl) => {
- return fnd.getMeta(fnd.startMetaQuery().withSub().build());
- }).catch((err) => {
- this.handleError(err.message, 'err');
- });
- }
-
- // User clicked on a contact in the side panel or deleted a contact.
- handleTopicSelected(topicName, unused_index, online, acs) {
- if (topicName) {
- this.setState({
- errorText: '',
- errorLevel: null,
- mobilePanel: 'topic-view',
- showInfoPanel: false
- });
- // Different contact selected.
- if (this.state.topicSelected != topicName) {
- this.setState({
- topicSelectedOnline: online,
- topicSelectedAcs: acs
- });
- navigateTo(setUrlTopic('', topicName));
- }
- } else {
- // Currently selected contact deleted
- this.setState({
- errorText: '',
- errorLevel: null,
- mobilePanel: 'sidepanel',
- topicSelectedOnline: false,
- topicSelectedAcs: null,
- showInfoPanel: false
- });
- if (this.state.topicSelected) {
- navigateTo(setUrlTopic('', null));
- }
- }
- }
-
- // In mobile view user requested to show sidepanel
- handleHideMessagesView() {
- this.setState({
- mobilePanel: 'sidepanel'
- });
- navigateTo(setUrlTopic(window.location.hash, null));
- }
-
- // User is sending a message, either plain text or a drafty object, possibly
- // with attachments.
- handleSendMessage(msg, promise, uploader) {
- let topic = this.tinode.getTopic(this.state.topicSelected);
-
- msg = topic.createMessage(msg, false);
- // The uploader is used to show progress.
- msg._uploader = uploader;
-
- if (!topic.isSubscribed()) {
- if (!promise) {
- promise = Promise.resolve();
- }
- promise = promise.then(() => { return topic.subscribe(); });
- }
-
- if (promise) {
- promise = promise.catch((err) => {
- this.handleError(err.message, 'err');
- });
- }
-
- topic.publishDraft(msg, promise)
- .catch((err) => {
- this.handleError(err.message, 'err');
- });
- }
-
- // User chose a Sign Up menu item.
- handleNewAccount() {
- navigateTo(setUrlSidePanel(window.location.hash, 'register'));
- }
-
- // Actual registration of a new account.
- handleNewAccountRequest(login_, password_, public_, cred_, tags_) {
- this.tinode.connect(this.state.serverAddress)
- .then(() => {
- return this.tinode.createAccountBasic(login_, password_,
- {public: public_, tags: tags_, cred: Tinode.credential(cred_)});
- }).then((ctrl) => {
- if (ctrl.code >= 300 && ctrl.text == 'validate credentials') {
- this.handleCredentialsRequest(ctrl.params);
- } else {
- this.handleLoginSuccessful(this);
- }
- }).catch((err) => {
- this.handleError(err.message, 'err');
- });
- }
-
- handleUpdateAccountRequest(password, pub, defacs) {
- if (pub || defacs) {
- this.tinode.getMeTopic().setMeta({desc: {public: pub, defacs: defacs}}).catch((err) => {
- this.handleError(err.message, 'err');
- });
- }
- if (password) {
- this.tinode.updateAccountBasic(null, this.tinode.getCurrentLogin(), password).catch((err) => {
- this.handleError(err.message, 'err');
- });
- }
- }
-
- handleUpdateAccountTagsRequest(tags) {
- this.tinode.getFndTopic().setMeta({tags: tags})
- .catch((err) => {
- this.handleError(err.message, 'err');
- });
- }
-
- // User chose Settings menu item.
- handleSettings() {
- navigateTo(setUrlSidePanel(window.location.hash, this.state.myUserId ? 'edit' : 'settings'));
- }
-
- // User updated global parameters.
- handleGlobalSettings(settings) {
- let serverAddress = settings.serverAddress || this.state.serverAddress;
- let transport = settings.transport || this.state.transport;
- if (this.tinode) {
- this.tinode.onDisconnect = undefined;
- this.tinode.disconnect();
- }
- this.tinode = TinodeWeb.tnSetup(serverAddress, transport);
- this.tinode.onConnect = this.handleConnected;
- this.tinode.onDisconnect = this.handleDisconnect;
-
- this.setState({
- serverAddress: serverAddress,
- transport: transport
- });
- localStorage.setObject('settings', {
- serverAddress: serverAddress,
- transport: transport
- });
-
- navigateTo(setUrlSidePanel(window.location.hash, ''));
- }
-
- // Initialize desktop alerts = push notifications.
- initDesktopAlerts() {
- // Google could not be bothered to mention that
- // onTokenRefresh is never called.
- this.fbPush.onTokenRefresh(() => {
- this.requestPushToken(true);
- });
-
- this.fbPush.onMessage((payload) => {
- // No need to do anything about it.
- // All the magic happends in the service worker.
- });
- }
-
- togglePushToken(enabled) {
- if (enabled) {
- if (!this.state.firebaseToken) {
- this.fbPush.requestPermission().then(() => {
- this.requestPushToken(true);
- }).catch((err) => {
- this.handleError(err.message, 'err');
- this.setState({desktopAlerts: false, firebaseToken: null});
- localStorage.updateObject('settings', {desktopAlerts: false});
- console.log("Failed to get permission to notify.", err);
- });
- } else {
- this.setState({desktopAlerts: true});
- localStorage.updateObject('settings', {desktopAlerts: true});
- }
- } else if (this.state.firebaseToken) {
- this.fbPush.deleteToken(this.state.firebaseToken).catch((err) => {
- console.log("Unable to delete token.", err);
- }).finally(() => {
- localStorage.updateObject('settings', {desktopAlerts: false});
- localStorage.removeItem('firebase-token');
- this.setState({desktopAlerts: false, firebaseToken: null});
- });
- } else {
- this.setState({desktopAlerts: false, firebaseToken: null});
- localStorage.updateObject('settings', {desktopAlerts: false});
- }
- }
-
- requestPushToken(sendToServer) {
- this.fbPush.getToken().then((refreshedToken) => {
- if (refreshedToken != this.state.firebaseToken) {
- this.tinode.setDeviceToken(refreshedToken, sendToServer);
- localStorage.setObject('firebase-token', refreshedToken);
- }
- this.setState({firebaseToken: refreshedToken, desktopAlerts: true});
- localStorage.updateObject('settings', {desktopAlerts: true});
- }).catch((err) => {
- this.handleError(err.message, 'err');
- console.log("Failed to retrieve firebase token", err);
- });
- }
-
- handleToggleMessageSounds(enabled) {
- this.setState({messageSounds: enabled});
- localStorage.updateObject('settings', {
- messageSoundsOff: !enabled
- });
- }
-
- // User clicked Cancel button in Setting or Sign Up panel.
- handleSidepanelCancel() {
- var parsed = parseUrlHash(window.location.hash);
- parsed.path[0] = this.state.myUserId ? 'contacts' : '';
- if (parsed.params) {
- delete parsed.params.code;
- delete parsed.params.method;
- delete parsed.params.tab;
- }
- navigateTo(composeUrlHash(parsed.path, parsed.params));
- this.setState({errorText: '', errorLevel: null});
- }
-
- // User clicked a (+) menu item.
- handleNewTopic() {
- navigateTo(setUrlSidePanel(window.location.hash, 'newtpk'));
- }
-
- // Request to start a new topic. New P2P topic requires peer's name.
- handleNewTopicRequest(peerName, pub, priv, tags) {
- var topicName = peerName || this.tinode.newGroupTopicName();
- if (!peerName) {
- this.setState(
- {newGroupTopicParams: {desc: {public: pub, private: {comment: priv}}, tags: tags}},
- () => {this.handleTopicSelected(topicName)}
- );
- } else {
- this.handleTopicSelected(topicName);
- }
- }
-
- // New topic was creted, here is the new topic name.
- handleNewTopicCreated(oldName, newName) {
- if (this.state.topicSelected == oldName && oldName != newName) {
- // If the current URl contains the old topic name, replace it with new.
- // Update the name of the selected topic first so the navigator doen't clear
- // the state.
- this.setState({topicSelected: newName}, () => { navigateTo(setUrlTopic('', newName)); });
- }
- }
-
- handleTopicUpdateRequest(topicName, pub, priv, permissions) {
- var topic = this.tinode.getTopic(topicName);
- if (topic) {
- var params = {};
- if (pub) {
- params.public = pub;
- }
- if (priv) {
- params.private = {comment: priv};
- }
- if (permissions) {
- params.defacs = permissions;
- }
- topic.setMeta({desc: params}).catch((err) => {
- this.handleError(err.message, 'err');
- });
- }
- }
-
- handleChangePermissions(topicName, mode, uid) {
- var topic = this.tinode.getTopic(topicName);
- if (topic) {
- var am = topic.getAccessMode();
- if (uid) {
- am.updateGiven(mode);
- mode = am.getGiven();
- } else {
- am.updateWant(mode);
- mode = am.getWant();
- }
- topic.setMeta({sub: {user: uid, mode: mode}}).catch((err) => {
- this.handleError(err.message, 'err');
- });
- }
- }
-
- handleTagsUpdated(topicName, tags) {
- var topic = this.tinode.getTopic(topicName);
- if (topic) {
- var instance = this;
- topic.setMeta({tags: tags}).catch((err) => {
- this.handleError(err.message, 'err');
- });
- }
- }
-
- handleLogout() {
- updateFavicon(0);
- localStorage.removeItem('auth-token');
- if (this.tinode) {
- this.tinode.onDisconnect = undefined;
- this.tinode.disconnect();
- }
- this.setState(this.getBlankState());
- this.tinode = TinodeWeb.tnSetup(this.state.serverAddress, this.state.transport);
- this.tinode.onConnect = this.handleConnected;
- this.tinode.onDisconnect = this.handleDisconnect;
- navigateTo('');
- }
-
- handleLeaveUnsubRequest(topicName) {
- var topic = this.tinode.getTopic(topicName);
- if (!topic) {
- return;
- }
-
- topic.leave(true).then((ctrl) => {
- // Hide MessagesView and InfoView panels.
- navigateTo(setUrlTopic(window.location.hash, ''));
- }).catch((err) => {
- this.handleError(err.message, 'err');
- });
- }
-
- handleDialogCancel() {
- this.setState({dialogSelected: null});
- }
-
- handleShowContextMenu(params, menuItems) {
- this.setState({
- contextMenuVisible: true,
- contextMenuClickAt: {x: params.x, y: params.y},
- contextMenuParams: params,
- contextMenuItems: menuItems || this.defaultTopicContextMenu(params.topicName),
- contextMenuBounds: ReactDOM.findDOMNode(this).getBoundingClientRect()
- });
- }
-
- defaultTopicContextMenu(topicName) {
- var muted = false, blocked = false, subscribed = false, deleter = false;
- var topic = this.tinode.getTopic(topicName);
- if (topic) {
- if (topic.isSubscribed()) {
- subscribed = true;
- var acs = topic.getAccessMode();
- muted = acs && acs.isMuted();
- blocked = acs && !acs.isJoiner();
- deleter = acs && acs.isDeleter();
- }
- }
-
- return [
- subscribed ? {title: "Info", handler: this.handleShowInfoView} : null,
- subscribed ? 'messages_clear' : null,
- subscribed && deleter ? 'messages_clear_hard' : null,
- subscribed ? (muted ? 'topic_unmute' : 'topic_mute') : null,
- subscribed ? (blocked ? 'topic_unblock' : 'topic_block') : null,
- 'topic_delete'
- ];
- }
-
- handleHideContextMenu() {
- this.setState({
- contextMenuVisible: false,
- contextMenuClickAt: null,
- contextMenuParams: null,
- contextMenuBounds: null
- });
- }
-
- handleShowInfoView() {
- navigateTo(addUrlParam(window.location.hash, 'info', true));
- this.setState({showInfoPanel: true});
- }
-
- handleHideInfoView() {
- navigateTo(removeUrlParam(window.location.hash, 'info'));
- this.setState({showInfoPanel: false});
- }
-
- handleMemberUpdateRequest(topicName, added, removed) {
- if (!topicName) {
- return;
- }
-
- var topic = this.tinode.getTopic(topicName);
- if (!topic) {
- return;
- }
-
- if (added && added.length > 0) {
- added.map((uid) => {
- topic.invite(uid, null).catch((err) => {
- this.handleError(err.message, 'err');
- });
- });
- }
-
- if (removed && removed.length > 0) {
- removed.map((uid) => {
- topic.delSubscription(uid).catch((err) => {
- this.handleError(err.message, 'err');
- });
- });
- }
- }
-
- handleValidateCredentialsRequest(cred, code) {
- this.setState({credMethod: cred, credCode: code});
- this.doLogin(null, null, {meth: cred, resp: code});
- }
-
- handlePasswordResetRequest(method, value) {
- // If already connected, connnect() will return a resolved promise.
- this.tinode.connect()
- .then(() => {
- return this.tinode.requestResetAuthSecret('basic', method, value)
- })
- .catch((err) => {
- // Socket error
- this.handleError(err.message, 'err');
- });
- }
-
- handleResetPassword(scheme, newPassword, token) {
- token = base64ReEncode(token);
- if (!token) {
- this.handleError("Invalid security token", 'err');
- } else {
- this.tinode.connect()
- .then(() => {
- return this.tinode.updateAccountBasic(null, null, newPassword, {token: token});
- })
- .catch((err) => {
- // Socket error
- this.handleError(err.message, 'err');
- });
- }
- }
-
- render() {
- return (
-
- {this.state.contextMenuVisible ?
-
- :
- null
- }
-
-
-
-
-
- {this.state.showInfoPanel ?
-
- :
- null
- }
-
- );
- }
-};
-
-if (typeof module != 'undefined') {
- module.exports = TinodeWeb;
-}
diff --git a/src/widgets/attachment.jsx b/src/widgets/attachment.jsx
new file mode 100644
index 00000000..1ee0331b
--- /dev/null
+++ b/src/widgets/attachment.jsx
@@ -0,0 +1,82 @@
+import React from 'react';
+
+import FileProgress from './file-progress.jsx';
+
+export default class Attachment extends React.Component {
+ constructor(props) {
+ super(props);
+
+ this.state = {
+ downloader: null,
+ progress: 0
+ };
+
+ this.downloadFile = this.downloadFile.bind(this);
+ this.handleCancel = this.handleCancel.bind(this);
+ }
+
+ downloadFile(url, filename, mimetype) {
+ var downloader = this.props.tinode.getLargeFileHelper();
+ this.setState({downloader: downloader});
+ downloader.download(url, filename, mimetype, (loaded) => {
+ this.setState({progress: loaded / this.props.size});
+ }).then(() => {
+ this.setState({downloader: null, progress: 0});
+ }).catch((err) => {
+ if (err) {
+ this.props.onError("Error downloading file: " + err.message, 'err');
+ }
+ this.setState({downloader: null, progress: 0});
+ });
+ }
+
+ handleCancel() {
+ if (this.props.uploader) {
+ this.props.onCancelUpload();
+ } else if (this.state.downloader) {
+ this.state.downloader.cancel();
+ }
+ }
+
+ render() {
+ let filename = this.props.filename || 'file_attachment';
+ if (filename.length > 36) {
+ filename = filename.substr(0, 16) + '...' + filename.substr(-16);
+ }
+ let size = this.props.size > 0 ?
+ ({bytesToHumanSize(this.props.size)}) :
+ null;
+
+ // Detect if the download URL is relative or absolute.
+ // If the URL is relative use LargeFileHelper to attach authentication
+ // credentials to the request.
+ let url, helperFunc;
+ if (!this.props.uploader && !this.state.downloader &&
+ !(/^(?:(?:[a-z]+:)?\/\/)/i.test(this.props.downloadUrl))) {
+ // Relative URL. Use download helper.
+ url = "javascript:;";
+ helperFunc = (e) => {
+ this.downloadFile(this.props.downloadUrl, this.props.filename, this.props.mimetype);
+ };
+ } else {
+ url = this.props.downloadUrl;
+ helperFunc = null;
+ }
+ return (
+
+
insert_drive_file
+
+
{filename} {size}
+ {this.props.uploader || this.state.downloader ?
+
+ :
+
+ }
+
+
+ );
+ }
+};
diff --git a/src/widgets/avatar-upload.jsx b/src/widgets/avatar-upload.jsx
new file mode 100644
index 00000000..c82c20d6
--- /dev/null
+++ b/src/widgets/avatar-upload.jsx
@@ -0,0 +1,71 @@
+import React from 'react';
+
+import LetterTile from './letter-tile.jsx';
+
+import { AVATAR_SIZE } from '../config.js';
+import { imageFileScaledToBase64, makeImageUrl } from '../lib/blob-helpers.js';
+
+export default class AvatarUpload extends React.Component {
+ constructor(props) {
+ super(props);
+
+ this.state = {
+ dataUrl: props.avatar
+ };
+
+ this.handleFileUpload = this.handleFileUpload.bind(this);
+ }
+
+ static getDerivedStateFromProps(nextProps, prevState) {
+ if (prevState.dataUrl != nextProps.avatar) {
+ return {
+ dataUrl: nextProps.avatar
+ };
+ }
+ return null;
+ }
+
+ handleFileUpload(e) {
+ imageFileScaledToBase64(e.target.files[0], AVATAR_SIZE, AVATAR_SIZE, true,
+ // Success
+ (base64bits, mime) => {
+ var du = makeImageUrl({data: base64bits, type: mime});
+ this.setState({dataUrl: du});
+ this.props.onImageChanged(du);
+ },
+ // Failure
+ (err) => {
+ this.props.onError(err, 'err');
+ });
+ // Clear the value so the same file can be uploaded again.
+ e.target.value = '';
+ }
+
+ render() {
+ // Randomize id value in case more than one AvatarUpload is shown
+ // at the same time.
+ var randId = "file-input-avatar-" + (Math.random() + '').substr(2);
+ return (
+
+ {this.state.dataUrl ?
+
:
+ this.props.readOnly && this.props.uid ?
+
+
+
+ :
+
{AVATAR_SIZE}×{AVATAR_SIZE}
}
+ {this.props.readOnly ? null :
+
}
+ {this.props.readOnly ? null :
+
+ file_upload
+ }
+
+ );
+ }
+};
diff --git a/src/widgets/chat-message.jsx b/src/widgets/chat-message.jsx
new file mode 100644
index 00000000..754e0e68
--- /dev/null
+++ b/src/widgets/chat-message.jsx
@@ -0,0 +1,139 @@
+// Single message, sent or received.
+import React from 'react';
+import { FormattedMessage } from 'react-intl';
+import { Drafty } from 'tinode-sdk'
+
+import Attachment from './attachment.jsx';
+import LetterTile from './letter-tile.jsx';
+import ReceivedMarker from './received-marker.jsx'
+
+import { REM_SIZE } from '../config.js';
+import { fitImageSize } from '../lib/blob-helpers.js';
+
+export default class ChatMessage extends React.Component {
+ constructor(props) {
+ super(props);
+
+ this.state = {
+ progress: 0
+ };
+
+ if (props.uploader) {
+ props.uploader.onProgress = this.handleProgress.bind(this);
+ }
+
+ this.handlePreviewImage = this.handlePreviewImage.bind(this);
+ this.handleContextClick = this.handleContextClick.bind(this);
+ this.handleCancelUpload = this.handleCancelUpload.bind(this);
+ }
+
+ handlePreviewImage(e) {
+ e.preventDefault();
+ this.props.onImagePreview({
+ url: e.target.src,
+ filename: e.target.title,
+ width: e.target.dataset.width,
+ height: e.target.dataset.height,
+ size: e.target.dataset.size,
+ type: e.target.dataset.mime
+ });
+ }
+
+ handleContextClick(e) {
+ e.preventDefault();
+ e.stopPropagation();
+ this.props.showContextMenu({ seq: this.props.seq, y: e.pageY, x: e.pageX });
+ }
+
+ handleProgress(ratio) {
+ this.setState({progress: ratio});
+ }
+
+ handleCancelUpload() {
+ this.props.uploader.cancel();
+ }
+
+ render() {
+ let elementKey = 0;
+ const formatter = function(style, data, values) {
+ elementKey += 1;
+ let el = Drafty.tagName(style);
+ if (el) {
+ let attr = Drafty.attrValue(style, data) || {};
+ attr.key = elementKey;
+ if (style == 'IM') {
+ // Additional processing for images
+ let dim = fitImageSize(data.width, data.height,
+ Math.min(this.props.viewportWidth - REM_SIZE * 4, REM_SIZE * 36), REM_SIZE * 24, false);
+ attr.className = 'inline-image';
+ attr.style = dim ? { width: dim.dstWidth + 'px', height: dim.dstHeight + 'px' } : null;
+ attr.onClick = this.handlePreviewImage;
+ }
+ return React.createElement(el, attr, values);
+ } else {
+ return values;
+ }
+ };
+
+ var sideClass = this.props.sequence + ' ' + (this.props.response ? 'left' : 'right');
+ var bubbleClass = (this.props.sequence == 'single' || this.props.sequence == 'last') ?
+ 'bubble tip' : 'bubble';
+ var avatar = this.props.userAvatar || true;
+ var fullDisplay = (this.props.userFrom && this.props.response &&
+ (this.props.sequence == 'single' || this.props.sequence == 'last'));
+
+ var content = this.props.content;
+ var attachments = [];
+ if (this.props.mimeType == Drafty.getContentType()) {
+ Drafty.attachments(content, function(att, i) {
+ attachments.push( );
+ }, this);
+ content = React.createElement('span', null, Drafty.format(content, formatter, this));
+ } else if (typeof content != 'string') {
+ content = error_outline
+
+
+ }
+
+ return (
+
+ {this.props.userFrom && this.props.response ?
+
+ {fullDisplay ?
+ :
+ null}
+
:
+ null}
+
+
+ {fullDisplay ?
{this.props.userName}
: null}
+
+
+ );
+ }
+};
diff --git a/src/widgets/checkbox.jsx b/src/widgets/checkbox.jsx
new file mode 100644
index 00000000..04f48f37
--- /dev/null
+++ b/src/widgets/checkbox.jsx
@@ -0,0 +1,29 @@
+import React from 'react';
+
+/* BEGIN CheckBox: styled checkbox */
+export default class CheckBox extends React.PureComponent {
+ constructor(props) {
+ super(props);
+
+ this.handleChange = this.handleChange.bind(this);
+ }
+
+ handleChange() {
+ this.props.onChange(this.props.name, !this.props.checked);
+ }
+
+ render() {
+ return (
+ this.props.onChange ? (
+ this.props.checked ?
+ check_box :
+ check_box_outline_blank
+ ) : (
+ this.props.checked ?
+ check_box :
+ check_box_outline_blank
+ )
+ );
+ }
+}
+/* END CheckBox */
diff --git a/src/widgets/chip-input.jsx b/src/widgets/chip-input.jsx
new file mode 100644
index 00000000..685b39d7
--- /dev/null
+++ b/src/widgets/chip-input.jsx
@@ -0,0 +1,142 @@
+import React from 'react';
+
+import Chip from './chip.jsx';
+
+import { makeImageUrl } from '../lib/blob-helpers.js';
+
+/* BEGIN ChipInput: group membership widget */
+export default class ChipInput extends React.Component {
+ constructor(props) {
+ super(props);
+
+ this.state = {
+ placeholder: props.chips ? '' : props.prompt,
+ sortedChips: ChipInput.sortChips(props.chips, props.required),
+ chipIndex: ChipInput.indexChips(props.chips),
+ input: '',
+ focused: false
+ };
+
+ this.handleTextInput = this.handleTextInput.bind(this);
+ this.removeChipAt = this.removeChipAt.bind(this);
+ this.handleChipCancel = this.handleChipCancel.bind(this);
+ this.handleFocusGained = this.handleFocusGained.bind(this);
+ this.handleFocusLost = this.handleFocusLost.bind(this);
+ this.handleKeyDown = this.handleKeyDown.bind(this);
+ }
+
+ UNSAFE_componentWillReceiveProps(nextProps) {
+ this.setState({
+ sortedChips: ChipInput.sortChips(nextProps.chips, nextProps.required),
+ chipIndex: ChipInput.indexChips(nextProps.chips)
+ });
+ if (nextProps.chips.length > this.props.chips.length) {
+ // Chip added: clear input.
+ this.setState({input: ''});
+ }
+ }
+
+ // Map chip index to user name
+ static indexChips(chips) {
+ var index = {};
+ var count = 0;
+ chips.map(function(item) {
+ index[item.user] = count;
+ count ++;
+ });
+ return index;
+ }
+
+ // Have non-removable chips appear before all other chips.
+ static sortChips(chips, keep) {
+ var required = [];
+ var normal = [];
+ chips.map(function(item) {
+ if (item.user === keep) {
+ required.push(item);
+ } else {
+ normal.push(item);
+ }
+ });
+ return required.concat(normal);
+ }
+
+ handleTextInput(e) {
+ this.setState({input: e.target.value});
+ if (this.props.filterFunc) {
+ this.props.filterFunc(e.target.value);
+ }
+ }
+
+ removeChipAt(idx) {
+ var removed = this.state.sortedChips[idx];
+ this.props.onChipRemoved(removed.user, this.state.chipIndex[removed.user]);
+ }
+
+ handleChipCancel(item, idx) {
+ this.removeChipAt(idx);
+ }
+
+ handleFocusGained() {
+ this.setState({focused: true});
+ }
+
+ handleFocusLost() {
+ this.setState({focused: false});
+ if (this.props.onFocusLost) {
+ this.props.onFocusLost(this.state.input);
+ }
+ }
+
+ handleKeyDown(e) {
+ if (e.key === 'Backspace') {
+ if (this.state.input.length == 0 && this.state.sortedChips.length > 0) {
+ var at = this.state.sortedChips.length - 1;
+ if (this.state.sortedChips[at].user !== this.props.required) {
+ this.removeChipAt(at);
+ }
+ }
+ } else if (e.key === 'Enter') {
+ if (this.props.onEnter) {
+ this.props.onEnter(this.state.input);
+ }
+ } else if (e.key === 'Escape') {
+ if (this.props.onCancel) {
+ this.props.onCancel();
+ }
+ }
+ }
+
+ render() {
+ var chips = [];
+ var count = 0;
+ this.state.sortedChips.map((item) => {
+ chips.push(
+
+ );
+ count++;
+ });
+ var className = "chip-input" + (this.state.focused ? ' focused' : '');
+ return (
+
+ {chips}
+
+
+ );
+ }
+};
diff --git a/src/widgets/chip.jsx b/src/widgets/chip.jsx
new file mode 100644
index 00000000..0465600f
--- /dev/null
+++ b/src/widgets/chip.jsx
@@ -0,0 +1,36 @@
+import React from 'react';
+
+import LetterTile from './letter-tile.jsx';
+
+export default class Chip extends React.PureComponent {
+ constructor(props) {
+ super(props);
+
+ this.handleCancel = this.handleCancel.bind(this);
+ }
+
+ handleCancel() {
+ this.props.onCancel(this.props.topic, this.props.index);
+ }
+
+ render() {
+ var title = this.props.title || this.props.topic;
+ return (
+
+ {this.props.noAvatar ?
+
:
+
+
+
+ }
+
{title}
+ {this.props.onCancel && !this.props.required ?
+
×
+ :
}
+
+ );
+ }
+};
diff --git a/src/widgets/contact-badges.jsx b/src/widgets/contact-badges.jsx
new file mode 100644
index 00000000..313f37b7
--- /dev/null
+++ b/src/widgets/contact-badges.jsx
@@ -0,0 +1,17 @@
+import React from 'react';
+
+/* Contact's labels: [you], [muted], [blocked], etc */
+// FIXME: this class is unused.
+export default class ContactBadges extends React.PureComponent {
+ render() {
+ let badges = null;
+ if (this.props.badges && this.props.badges.length > 0) {
+ badges = [];
+ this.props.badges.map(function(b) {
+ let style = 'badge' + (b.color ? ' ' + b.color : '');
+ badges.push({b.name} );
+ });
+ }
+ return {badges} ;
+ }
+};
diff --git a/src/widgets/contact-list.jsx b/src/widgets/contact-list.jsx
new file mode 100644
index 00000000..2cbfd46a
--- /dev/null
+++ b/src/widgets/contact-list.jsx
@@ -0,0 +1,98 @@
+// ContactList: component for showing a list of contacts,
+// such as a list of group members in a group chat.
+import React from 'react';
+import { defineMessages, injectIntl } from 'react-intl';
+
+import Contact from './contact.jsx';
+
+import { makeImageUrl } from '../lib/blob-helpers.js';
+
+const messages = defineMessages({
+ badge_you: {
+ id: 'badge_you',
+ defaultMessage: 'you',
+ description: 'Badge for indicating the current user'
+ },
+ badge_owner: {
+ id: 'badge_owner',
+ defaultMessage: 'owner',
+ description: 'Badge for indicating the owner'
+ }
+});
+
+class ContactList extends React.Component {
+ render() {
+ 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;
+ // If filter function is provided, filter out the items
+ // which don't satisfy the condition.
+ if (this.props.filterFunc && this.props.filter) {
+ var content = [key];
+ if (c.private && c.private.comment) {
+ content.push(('' + c.private.comment).toLowerCase());
+ }
+ if (c.public && c.public.fn) {
+ content.push(('' + c.public.fn).toLowerCase());
+ }
+ if (!this.props.filterFunc(this.props.filter, content)) {
+ return;
+ }
+ }
+
+ var selected = showCheckmark ?
+ (this.props.topicSelected.indexOf(key) > -1) :
+ (this.props.topicSelected === key);
+ var badges = [];
+ if (this.props.showMode) {
+ if (key === this.props.myUserId) {
+ badges.push({name: formatMessage(messages.badge_you), color: 'green'});
+ }
+ if (c.acs && c.acs.isOwner()) {
+ badges.push({name: formatMessage(messages.badge_owner), color: 'blue'});
+ }
+ }
+ var comment = Array.isArray(c.private) ?
+ c.private.join(',') : (c.private ? c.private.comment : null);
+
+ contactNodes.push(
+
+ );
+ }, this);
+ }
+
+ return (
+
+ {contactNodes.length > 0 ?
+
+ :
+
+ {this.props.emptyListMessage}
+
}
+
+ );
+ }
+};
+
+export default injectIntl(ContactList);
diff --git a/src/widgets/contact.jsx b/src/widgets/contact.jsx
new file mode 100644
index 00000000..a73e6d54
--- /dev/null
+++ b/src/widgets/contact.jsx
@@ -0,0 +1,75 @@
+// A single topic or user.
+import React from 'react';
+import { FormattedMessage } from 'react-intl';
+
+import LetterTile from './letter-tile.jsx';
+import ContactBadges from './contact-badges.jsx';
+import UnreadBadge from './unread-badge.jsx';
+
+export default class Contact extends React.Component {
+ constructor(props) {
+ super(props);
+
+ this.handleClick = this.handleClick.bind(this);
+ this.handleContextClick = this.handleContextClick.bind(this);
+ }
+
+ handleClick(e) {
+ e.preventDefault();
+ e.stopPropagation();
+ if (this.props.onSelected) {
+ this.props.onSelected(this.props.item, this.props.index, this.props.now, this.props.acs);
+ }
+ }
+
+ handleContextClick(e) {
+ e.preventDefault();
+ e.stopPropagation();
+ this.props.showContextMenu({ topicName: this.props.item, y: e.pageY, x: e.pageX });
+ }
+
+ render() {
+ let title = this.props.title;
+ if (!title) {
+ title = ;
+ } else if (title.length > 30) {
+ // FIXME: this is probably wrong for RTL languages.
+ title = title.substring(0, 28) + '...';
+ }
+ let online = this.props.now ? 'online' : 'offline';
+ let avatar = this.props.avatar ? this.props.avatar : true;
+ let badges = this.props.badges.slice();
+ if (this.props.showMode && this.props.acs) {
+ badges.push({name: this.props.acs.getMode(), key: 'mode'});
+ }
+
+ return (
+
+
+
+ {this.props.showOnline ? :
+ (this.props.showCheckmark && this.props.selected ?
+ check_circle
+ : null)}
+
+
+
{title}
+ {this.props.unread > 0 ? : null}
+
+ {this.props.comment ?
{this.props.comment}
: null}
+
+
+ {this.props.showContextMenu ?
+
+
+ expand_more
+
+ : null}
+
+ );
+ }
+};
diff --git a/src/widgets/context-menu.jsx b/src/widgets/context-menu.jsx
new file mode 100644
index 00000000..bc9d8532
--- /dev/null
+++ b/src/widgets/context-menu.jsx
@@ -0,0 +1,257 @@
+// Context Menu: popup/dropdown menu.
+import React from 'react';
+import ReactDOM from 'react-dom';
+import { injectIntl, defineMessages } from 'react-intl';
+
+import { REM_SIZE } from '../config.js';
+
+const messages = defineMessages({
+ info: {
+ id: 'menu_item_info',
+ defaultMessage: 'Info',
+ description: 'Show extended topic information'
+ },
+ clear_messages: {
+ id: 'menu_item_clear_messages',
+ defaultMessage: 'Clear messages',
+ description: 'Delete all messages'
+ },
+ clear_for_all: {
+ id: 'menu_item_clear_messages_for_all',
+ defaultMessage: 'Clear for All',
+ description: 'Delete all message(s) for all members'
+ },
+ 'delete': {
+ id: 'menu_item_delete',
+ defaultMessage: 'Delete',
+ description: 'Delete selected messages'
+ },
+ delete_for_all: {
+ id: 'menu_item_delete_for_all',
+ defaultMessage: 'Delete for All',
+ description: 'Delete selected message(s) for all members'
+ },
+ mute: {
+ id: 'menu_item_mute',
+ defaultMessage: 'Mute',
+ description: 'Turn off notifications'
+ },
+ unmute: {
+ id: 'menu_item_unmute',
+ defaultMessage: 'Unmute',
+ description: 'Turn notifications on'
+ },
+ topic_delete: {
+ id: 'menu_item_delete_topic',
+ defaultMessage: 'Delete',
+ description: 'Delete entire topic'
+ },
+ unblock: {
+ id: 'menu_item_unblock',
+ defaultMessage: 'Unblock',
+ description: 'Unblock user'
+ },
+ block: {
+ id: 'menu_item_block',
+ defaultMessage: 'Block',
+ description: 'Block user'
+ },
+ member_delete: {
+ id: 'menu_item_member_delete',
+ defaultMessage: 'Remove',
+ description: 'Remove user from topic'
+ }
+});
+
+class ContextMenu extends React.Component {
+ constructor(props) {
+ super(props);
+
+ const {formatMessage} = props.intl;
+
+ this.handlePageClick = this.handlePageClick.bind(this);
+ this.handleEscapeKey = this.handleEscapeKey.bind(this);
+ this.handleClick = this.handleClick.bind(this);
+
+ // Preconfigured menu items.
+ this.MenuItems = {
+ 'topic_info': {title: formatMessage(messages.info), handler: null},
+
+ 'messages_clear': {title: formatMessage(messages.clear_messages), handler: (params, errorHandler) => {
+ this.deleteMessages(true, false, params, errorHandler);
+ }},
+ 'messages_clear_hard': {title: formatMessage(messages.clear_for_all), handler: (params, errorHandler) => {
+ this.deleteMessages(true, true, params, errorHandler);
+ }},
+ 'message_delete': {title: formatMessage(messages.delete), handler: (params, errorHandler) => {
+ this.deleteMessages(false, false, params, errorHandler);
+ }},
+ 'message_delete_hard': {title: formatMessage(messages.delete_for_all), handler: (params, errorHandler) => {
+ this.deleteMessages(false, true, params, errorHandler);
+ }},
+ 'topic_unmute': {title: formatMessage(messages.unmute), handler: this.topicPermissionSetter.bind(this, '+P')},
+ 'topic_mute': {title: formatMessage(messages.mute), handler: this.topicPermissionSetter.bind(this, '-P')},
+ 'topic_unblock': {title: formatMessage(messages.unblock), handler: this.topicPermissionSetter.bind(this, '+J')},
+ 'topic_block': {title: formatMessage(messages.block), handler: this.topicPermissionSetter.bind(this, '-J')},
+ 'topic_delete': {title: formatMessage(messages.topic_delete), handler: (params, errorHandler) => {
+ let topic = this.props.tinode.getTopic(params.topicName);
+ if (!topic) {
+ console.log("Topic not found: ", params.topicName);
+ return;
+ }
+ topic.delTopic().catch((err) => {
+ if (errorHandler) {
+ errorHandler(err.message, 'err');
+ }
+ });
+ }},
+ // menu_item_edit_permissions is defined elsewhere.
+ 'permissions': {title: formatMessage({id: 'menu_item_edit_permissions'}), handler: null},
+ 'member_delete': {title: formatMessage(messages.member_delete), handler: (params, errorHandler) => {
+ let topic = this.props.tinode.getTopic(params.topicName);
+ if (!topic || !params.user) {
+ console.log("Topic or user not found: '" + params.topicName + "', '" + params.user + "'");
+ return;
+ }
+ topic.delSubscription(params.user).catch((err) => {
+ if (errorHandler) {
+ errorHandler(err.message, 'err');
+ }
+ });
+ }},
+ 'member_mute': {title: formatMessage(messages.mute), handler: this.topicPermissionSetter.bind(this, '-P')},
+ 'member_unmute': {title: formatMessage(messages.unmute), handler: this.topicPermissionSetter.bind(this, '+P')},
+ 'member_block': {title: formatMessage(messages.block), handler: this.topicPermissionSetter.bind(this, '-J')},
+ 'member_unblock': {title: formatMessage(messages.unblock), handler: this.topicPermissionSetter.bind(this, '+J')},
+ };
+ }
+
+ componentDidMount() {
+ document.addEventListener('mousedown', this.handlePageClick, false);
+ document.addEventListener('keyup', this.handleEscapeKey, false);
+ }
+
+ componentWillUnmount() {
+ document.removeEventListener('mousedown', this.handlePageClick, false);
+ document.removeEventListener('keyup', this.handleEscapeKey, false);
+ }
+
+ handlePageClick(e) {
+ if (ReactDOM.findDOMNode(this).contains(e.target)) {
+ return;
+ }
+ e.preventDefault();
+ e.stopPropagation();
+ this.props.hide();
+ }
+
+ handleEscapeKey(e) {
+ if (e.keyCode === 27) {
+ this.props.hide();
+ }
+ }
+
+ handleClick(e) {
+ e.preventDefault();
+ e.stopPropagation();
+ this.props.hide();
+ let item = this.props.items[e.currentTarget.dataset.id];
+ if (typeof item == 'string') {
+ item = this.MenuItems[item];
+ }
+ item.handler(this.props.params, this.props.onError);
+ }
+
+ // Menu Actions
+
+ deleteMessages(all, hard, params, errorHandler) {
+ const topic = this.props.tinode.getTopic(params.topicName);
+ if (!topic) {
+ console.log("Topic not found: ", params.topicName);
+ return;
+ }
+ // We don't know if the message is still pending (e.g. attachment is being uploaded),
+ // so try cancelling first. No harm if we can't cancel.
+ if (topic.cancelSend(params.seq)) {
+ return Promise.resolve();
+ }
+ // Can't cancel. Delete instead.
+ var promise = all ?
+ topic.delMessagesAll(hard) :
+ topic.delMessagesList([params.seq], hard);
+ promise.catch((err) => {
+ if (errorHandler) {
+ errorHandler(err.message, 'err');
+ }
+ });
+ }
+
+ // Function is used by context menu to set permissions.
+ topicPermissionSetter(mode, params, errorHandler) {
+ const topic = this.props.tinode.getTopic(params.topicName);
+ if (!topic) {
+ console.log("Topic not found", params.topicName);
+ return;
+ }
+
+ let am, user;
+ if (params.user) {
+ user = topic.subscriber(params.user);
+ if (!user) {
+ console.log("Subscriber not found", params.topicName + "[" + params.user + "]");
+ return;
+ }
+ am = user.acs.updateGiven(mode).getGiven();
+ } else {
+ am = topic.getAccessMode().updateWant(mode).getWant();
+ }
+
+ topic.setMeta({sub: {user: params.user, mode: am}}).catch((err) => {
+ if (errorHandler) {
+ errorHandler(err.message, 'err');
+ }
+ });
+ }
+
+ render() {
+ let count = 0;
+ let menu = [];
+ this.props.items.map((item) => {
+ if (typeof item == 'string') {
+ item = this.MenuItems[item];
+ }
+ if (item && item.title) {
+ menu.push(
+ item.title == '-' ?
+
+ :
+ {item.title}
+ );
+ }
+ count++;
+ });
+
+ // Ensure that menu is inside the app-container.
+ const hSize = 12 * REM_SIZE;
+ const vSize = REM_SIZE * (0.7 + menu.length * 2.5);
+ const left = (this.props.bounds.right - this.props.clickAt.x < hSize) ?
+ (this.props.clickAt.x - this.props.bounds.left - hSize) :
+ (this.props.clickAt.x - this.props.bounds.left);
+ const top = (this.props.bounds.bottom - this.props.clickAt.y < vSize) ?
+ (this.props.clickAt.y - this.props.bounds.top - vSize) :
+ (this.props.clickAt.y - this.props.bounds.top);
+
+ const position = {
+ left: left + 'px',
+ top: top + 'px'
+ };
+
+ return (
+
+ );
+ }
+}
+
+export default injectIntl(ContextMenu);
diff --git a/src/widgets/error-panel.jsx b/src/widgets/error-panel.jsx
new file mode 100644
index 00000000..3ff11117
--- /dev/null
+++ b/src/widgets/error-panel.jsx
@@ -0,0 +1,41 @@
+import React from 'react';
+
+import MenuCancel from './menu-cancel.jsx';
+
+export default class ErrorPanel extends React.PureComponent {
+ constructor(props) {
+ super(props);
+
+ this.state = {
+ show: false,
+ };
+
+ this.hide = this.hide.bind(this);
+ }
+
+ static getDerivedStateFromProps(nextProps, prevState) {
+ return {
+ show: !(!nextProps.level)
+ };
+ }
+
+ hide() {
+ this.setState({show: false});
+ if (this.props.onClearError) {
+ this.props.onClearError();
+ }
+ }
+
+ render() {
+ var icon = this.props.level == 'err' ? 'error': 'warning';
+ return (
+
+
{icon}
+ {this.props.text}
+
+
+ );
+ }
+};
diff --git a/src/widgets/file-progress.jsx b/src/widgets/file-progress.jsx
new file mode 100644
index 00000000..03ce7d6a
--- /dev/null
+++ b/src/widgets/file-progress.jsx
@@ -0,0 +1,22 @@
+// File uload/download progress indicator with a cancel inside.
+import React from 'react';
+import { FormattedMessage } from 'react-intl';
+
+export default class FileProgress extends React.PureComponent {
+ render() {
+ return (
+
+
+ {this.props.progress < 0.999 ?
+
+ close
+
+ :
+
+ }
+
+ );
+ }
+}
diff --git a/src/widgets/group-manager.jsx b/src/widgets/group-manager.jsx
new file mode 100644
index 00000000..0dfcce35
--- /dev/null
+++ b/src/widgets/group-manager.jsx
@@ -0,0 +1,191 @@
+// GroupMembers: control for managing a list of group members.
+import React from 'react';
+import { FormattedMessage, defineMessages, injectIntl } from 'react-intl';
+
+import ChipInput from './chip-input.jsx';
+import ContactList from './contact-list.jsx';
+
+const messages = defineMessages({
+ no_contacts: {
+ id: 'no_contacts',
+ defaultMessage: 'You have no contacts :-(',
+ description: 'Shown in ContactsView when the user has no contacts'
+ },
+ contacts_not_found: {
+ id: 'contacts_not_found_short',
+ defaultMessage: "No contacts match '{query}'",
+ description: 'Shown in ContactsView when search returned no results'
+ }
+});
+
+class GroupManager extends React.Component {
+ constructor(props) {
+ super(props);
+
+ this.state = {
+ members: props.members,
+ index: GroupManager.indexMembers(props.members),
+ contactFilter: '',
+ noContactsMessage: props.intl.formatMessage(messages.no_contacts),
+ selectedContacts: GroupManager.selectedContacts(props.members)
+ };
+
+ this.handleContactSelected = this.handleContactSelected.bind(this);
+ this.handleMemberRemoved = this.handleMemberRemoved.bind(this);
+ this.handleContactFilter = this.handleContactFilter.bind(this);
+ this.handleSubmit = this.handleSubmit.bind(this);
+ this.handleCancel = this.handleCancel.bind(this);
+ }
+
+ static indexMembers(members) {
+ let index = {};
+ members.map(function(m) {
+ index[m.user] = {delta: 0, present: true}; // Delta: 0 unchanged, +1 added, -1 removed
+ });
+ return index;
+ }
+
+ static selectedContacts(members) {
+ let sel = [];
+ members.map(function(m) {
+ sel.push(m.user);
+ });
+ return sel;
+ }
+
+ handleContactSelected(userId, index) {
+ let status = this.state.index[userId];
+ if (status) {
+ if (status.present) {
+ // Prevent duplicate members
+ return;
+ }
+ status.delta += 1;
+ status.present = true;
+ } else {
+ status = {delta: 1, present: true};
+ }
+
+ var m = this.state.members.slice();
+ m.push(this.props.contacts[index]);
+
+ var sel = GroupManager.selectedContacts(m);
+
+ var i = this.state.index;
+ i[userId] = status;
+
+ this.setState({members: m, index: i, selectedContacts: sel});
+ }
+
+ handleMemberRemoved(userId, index) {
+ var status = this.state.index[userId];
+ if (!status || !status.present) {
+ return;
+ }
+ status.present = false;
+ status.delta -= 1;
+
+ var m = this.state.members.slice();
+ m.splice(index, 1);
+
+ var sel = GroupManager.selectedContacts(m);
+
+ var i = this.state.index;
+ i[userId] = status;
+
+ this.setState({members: m, index: i, selectedContacts: sel});
+ }
+
+ handleContactFilter(val) {
+ const {formatMessage} = this.props.intl;
+ const msg = !val ?
+ formatMessage(messages.no_contacts) :
+ formatMessage(messages.contacts_not_found, {query: val});
+
+ this.setState({contactFilter: val, noContactsMessage: msg});
+ }
+
+ static doContactFiltering(filter, values) {
+ if (filter) {
+ for (var i=0; i= 0) {
+ return true;
+ }
+ }
+ return false;
+ }
+ return true;
+ }
+
+ handleSubmit() {
+ var instance = this;
+ var members = [];
+ var added = [];
+ var removed = [];
+
+ var keys = Object.keys(this.state.index);
+ keys.map(function(k) {
+ if (instance.state.index[k].present) {
+ members.push(k);
+ }
+
+ if (instance.state.index[k].delta > 0) {
+ added.push(k);
+ } else if (instance.state.index[k].delta < 0) {
+ removed.push(k);
+ }
+ });
+ this.props.onSubmit(members, added, removed);
+ }
+
+ handleCancel() {
+ this.props.onCancel();
+ }
+
+ render() {
+ const {formatMessage} = this.props.intl;
+ return (
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ );
+ }
+};
+
+export default injectIntl(GroupManager);
diff --git a/src/widgets/group-subs.jsx b/src/widgets/group-subs.jsx
new file mode 100644
index 00000000..251e183f
--- /dev/null
+++ b/src/widgets/group-subs.jsx
@@ -0,0 +1,39 @@
+/* GroupSubs: a list of group subscribers currently online */
+
+import React from 'react';
+
+import LetterTile from './letter-tile.jsx';
+import { makeImageUrl } from '../lib/blob-helpers.js';
+
+export default class GroupSubs extends React.Component {
+ constructor(props) {
+ super(props);
+
+ this.state = {
+ onlineSubs: props.subscribers || []
+ };
+ }
+
+ static getDerivedStateFromProps(nextProps, prevState) {
+ return {
+ onlineSubs: nextProps.subscribers ? nextProps.subscribers : []
+ };
+ }
+
+ render() {
+ var usersOnline = [];
+ this.state.onlineSubs.map((sub) => {
+ usersOnline.push(
+
+
+
+ );
+ });
+ return (
+ {usersOnline}
+ );
+ }
+};
diff --git a/src/widgets/host-selector.jsx b/src/widgets/host-selector.jsx
new file mode 100644
index 00000000..bafd9862
--- /dev/null
+++ b/src/widgets/host-selector.jsx
@@ -0,0 +1,50 @@
+import React from 'react';
+
+import { KNOWN_HOSTS } from '../config.js';
+
+/* Combobox for selecting host name */
+
+export default class HostSelector extends React.PureComponent {
+ constructor(props) {
+ super(props);
+
+ this.state = {
+ hostName: props.serverAddress,
+ changed: false
+ };
+
+ this.handleHostNameChange = this.handleHostNameChange.bind(this);
+ this.handleEditingFinished = this.handleEditingFinished.bind(this);
+ }
+
+ handleHostNameChange(e) {
+ this.setState({hostName: e.target.value, changed: true});
+ }
+
+ handleEditingFinished() {
+ if (this.state.changed) {
+ this.setState({changed: false});
+ this.props.onServerAddressChange(this.state.hostName.trim());
+ }
+ }
+
+ render() {
+ var hostOptions = [];
+ for (let key in KNOWN_HOSTS) {
+ let item = KNOWN_HOSTS[key];
+ hostOptions.push(
+
+ );
+ }
+ return (
+
+
+
+ {hostOptions}
+
+
+ );
+ }
+}
diff --git a/src/widgets/image-preview.jsx b/src/widgets/image-preview.jsx
new file mode 100644
index 00000000..30287261
--- /dev/null
+++ b/src/widgets/image-preview.jsx
@@ -0,0 +1,71 @@
+import React from 'react';
+import { FormattedMessage } from 'react-intl';
+
+import { REM_SIZE } from '../config.js';
+import { fitImageSize } from '../lib/blob-helpers.js';
+import { bytesToHumanSize } from '../lib/strformat.js';
+
+export default class ImagePreview extends React.PureComponent {
+ constructor(props) {
+ super(props);
+
+ this.state = {};
+ }
+
+ componentDidMount() {
+ this.setState({
+ width: this.container.clientWidth,
+ height: this.container.clientHeight
+ });
+ }
+
+ render() {
+ if (!this.props.content) {
+ return null;
+ }
+ var instance = this;
+ var dim = fitImageSize(this.props.content.width, this.props.content.height,
+ this.state.width, this.state.height, false);
+ var size = dim ? { width: dim.dstWidth + 'px', height: dim.dstHeight + 'px' } :
+ ((this.props.content.width > this.props.content.height) ? {width: '100%'} : {height: '100%'});
+ size.maxWidth = '100%';
+ size.maxHeight = '100%';
+
+ var filename = this.props.content.filename;
+ var maxlength = (this.props.content.width / REM_SIZE) | 0;
+ if (filename.length > maxlength) {
+ filename = filename.slice(0, maxlength-2) + '...' + filename.slice(2-maxlength);
+ }
+ return (
+
+
+
+
+
+
+
+ );
+ }
+};
diff --git a/src/widgets/in-place-edit.jsx b/src/widgets/in-place-edit.jsx
new file mode 100644
index 00000000..6a0bda66
--- /dev/null
+++ b/src/widgets/in-place-edit.jsx
@@ -0,0 +1,115 @@
+// In-place text editor. Shows text with an icon which toggles it into an input field.
+import React from 'react';
+import ReactDOM from 'react-dom';
+
+import VisiblePassword from './visible-password.jsx';
+
+export default class InPlaceEdit extends React.Component {
+ constructor(props) {
+ super(props);
+
+ this.state = {
+ active: props.active,
+ initialValue: props.value || '',
+ value: props.value || ''
+ };
+
+ this.handeTextChange = this.handeTextChange.bind(this);
+ this.handleKeyDown = this.handleKeyDown.bind(this);
+ this.handleStartEditing = this.handleStartEditing.bind(this);
+ this.handleEditingFinished = this.handleEditingFinished.bind(this);
+ this.handlePasswordFinished = this.handlePasswordFinished.bind(this);
+ }
+
+ static getDerivedStateFromProps(nextProps, prevState) {
+ // If text has changed while in read mode, update text and discard changes.
+ // Ignore update if in edit mode.
+ if (prevState.initialValue != nextProps.value && !prevState.active) {
+ return {
+ initialValue: nextProps.value || '',
+ value: nextProps.value || ''
+ };
+ }
+ return null;
+ }
+
+ handeTextChange(e) {
+ this.setState({value: e.target.value});
+ }
+
+ handleKeyDown(e) {
+ if (e.keyCode === 27) {
+ // Escape pressed
+ this.setState({value: this.props.value, active: false});
+ } else if (e.keyCode === 13) {
+ // Enter pressed
+ this.handleEditingFinished();
+ }
+ }
+
+ handleStartEditing() {
+ if (!this.props.readOnly) {
+ ReactDOM.findDOMNode(this).focus();
+ this.setState({active: true});
+ }
+ }
+
+ handleEditingFinished() {
+ this.setState({active: false});
+ let value = this.state.value.trim();
+ if ((value || this.props.value) && (value !== this.props.value)) {
+ this.props.onFinished(value);
+ }
+ }
+
+ handlePasswordFinished(value) {
+ this.setState({active: false});
+ if (value && (value !== this.props.value)) {
+ this.props.onFinished(value);
+ }
+ }
+
+ render() {
+ if (this.state.active) {
+ var fieldType = this.props.type || 'text';
+ } else {
+ var spanText = this.props.type == 'password' ? '••••••••' : this.state.value;
+ var spanClass = 'in-place-edit' +
+ (this.props.readOnly ? ' disabled' : '');
+ if (!spanText) {
+ spanText = this.props.placeholder;
+ spanClass += ' placeholder';
+ }
+ if (spanText.length > 20) {
+ // FIXME: this is wrong for RTL languages.
+ spanText = spanText.substring(0, 19) + '...';
+ }
+ }
+ return (
+ this.state.active ?
+ (fieldType == 'password' ?
+
+ :
+
+ )
+ :
+
+ {spanText}
+
+ );
+ }
+};
diff --git a/src/widgets/letter-tile.jsx b/src/widgets/letter-tile.jsx
new file mode 100644
index 00000000..5180b520
--- /dev/null
+++ b/src/widgets/letter-tile.jsx
@@ -0,0 +1,27 @@
+import React from 'react';
+
+import Tinode from 'tinode-sdk';
+
+import { stringHash } from '../lib/strformat.js';
+
+export default class LetterTile extends React.PureComponent {
+ render() {
+ let avatar;
+ if (this.props.avatar === true) {
+ if (this.props.topic && this.props.title && this.props.title.trim()) {
+ let letter = this.props.title.trim().charAt(0);
+ let color = "lettertile dark-color" + (Math.abs(stringHash(this.props.topic)) % 16);
+ avatar = ()
+ } else {
+ avatar = (Tinode.topicType(this.props.topic) == 'grp') ?
+ group :
+ person ;
+ }
+ } else if (this.props.avatar) {
+ avatar = ;
+ } else {
+ avatar = null;
+ }
+ return avatar;
+ }
+}
diff --git a/src/widgets/load-spinner.jsx b/src/widgets/load-spinner.jsx
new file mode 100644
index 00000000..6d4aab82
--- /dev/null
+++ b/src/widgets/load-spinner.jsx
@@ -0,0 +1,8 @@
+import React from 'react';
+
+export default class LoadSpinner extends React.PureComponent {
+ render() {
+ return (this.props.show ?
+ : null);
+ }
+}
diff --git a/src/widgets/menu-cancel.jsx b/src/widgets/menu-cancel.jsx
new file mode 100644
index 00000000..22bc0429
--- /dev/null
+++ b/src/widgets/menu-cancel.jsx
@@ -0,0 +1,14 @@
+// The X menu to be displayed in title bars.
+import React from 'react';
+
+export default class MenuCancel extends React.PureComponent {
+ constructor(props) {
+ super(props);
+ }
+
+ render() {
+ return (
+ close
+ );
+ }
+}
diff --git a/src/widgets/menu-contacts.jsx b/src/widgets/menu-contacts.jsx
new file mode 100644
index 00000000..4f371cf3
--- /dev/null
+++ b/src/widgets/menu-contacts.jsx
@@ -0,0 +1,13 @@
+import React from 'react';
+
+export default class MenuContacts extends React.PureComponent {
+ render() {
+ return (
+
+ );
+ }
+};
diff --git a/src/widgets/menu-start.jsx b/src/widgets/menu-start.jsx
new file mode 100644
index 00000000..f5b13833
--- /dev/null
+++ b/src/widgets/menu-start.jsx
@@ -0,0 +1,13 @@
+import React from 'react';
+
+export default class MenuStart extends React.PureComponent {
+ render() {
+ return (
+
+ );
+ }
+};
diff --git a/src/widgets/more-button.jsx b/src/widgets/more-button.jsx
new file mode 100644
index 00000000..38668f0d
--- /dev/null
+++ b/src/widgets/more-button.jsx
@@ -0,0 +1,29 @@
+// Toggle [Title text >] -> [Title text v]
+
+import React from 'react';
+
+export default class MoreButton extends React.PureComponent {
+ constructor(props) {
+ super(props);
+
+ this.state = {
+ open: props.open
+ };
+ this.handleToggle = this.handleToggle.bind(this);
+ }
+
+ handleToggle() {
+ let open = !this.state.open;
+ this.setState({open: open});
+ if (this.props.onToggle) {
+ this.props.onToggle(open);
+ }
+ }
+
+ render() {
+ return ({this.props.title}...
+ {this.state.open ? expand_more :
+ chevron_right }
+ );
+ }
+}
diff --git a/src/widgets/new-topic-by-id.jsx b/src/widgets/new-topic-by-id.jsx
new file mode 100644
index 00000000..eef10933
--- /dev/null
+++ b/src/widgets/new-topic-by-id.jsx
@@ -0,0 +1,69 @@
+import React from 'react';
+import { FormattedMessage, defineMessages, injectIntl } from 'react-intl';
+
+const messages = defineMessages({
+ invalid_id: {
+ id: 'error_invalid_id',
+ defaultMessage: 'Invalid ID',
+ description: 'Error message'
+ }
+});
+
+class NewTopicById extends React.PureComponent {
+ constructor(props) {
+ super(props);
+
+ this.state = {
+ groupId: '',
+ };
+
+ this.handleChange = this.handleChange.bind(this);
+ this.handleKeyPress = this.handleKeyPress.bind(this);
+ this.handleSubmit = this.handleSubmit.bind(this);
+ }
+
+ handleChange(e) {
+ this.setState({groupId: e.target.value});
+ }
+
+ handleKeyPress(e) {
+ if (e.key === 'Enter') {
+ this.handleSubmit(e);
+ }
+ }
+
+ handleSubmit(e) {
+ e.preventDefault();
+ if (this.state.groupId) {
+ var name = this.state.groupId.trim();
+ if (name.length > 3 && (name.substr(0, 3) == 'usr' || name.substr(0, 3) == 'grp')) {
+ this.props.onSubmit(name);
+ } else {
+ this.props.onError(this.props.intl.formatMessage(messages.invalid_id), 'err');
+ }
+ }
+ }
+
+ render() {
+ return (
+
+
+ {
+ (prompt) =>
+ }
+
+
+
+
+
+
+
+ );
+ }
+};
+
+export default injectIntl(NewTopicById);
diff --git a/src/widgets/new-topic-group.jsx b/src/widgets/new-topic-group.jsx
new file mode 100644
index 00000000..293ed398
--- /dev/null
+++ b/src/widgets/new-topic-group.jsx
@@ -0,0 +1,97 @@
+import React from 'react';
+import { FormattedMessage } from 'react-intl';
+
+import AvatarUpload from './avatar-upload.jsx';
+import TagManager from './tag-manager.jsx';
+
+export default class NewTopicGroup extends React.PureComponent {
+ constructor(props) {
+ super(props);
+
+ this.state = {
+ fn: '', // full/formatted name
+ private: '',
+ imageDataUrl: null,
+ tags: []
+ };
+
+ this.handleFnChange = this.handleFnChange.bind(this);
+ this.handlePrivateChange = this.handlePrivateChange.bind(this);
+ this.handleImageChanged = this.handleImageChanged.bind(this);
+ this.handleTagsChanged = this.handleTagsChanged.bind(this);
+ this.handleTagsChanged = this.handleTagsChanged.bind(this);
+ this.handleSubmit = this.handleSubmit.bind(this);
+ }
+
+ handleFnChange(e) {
+ this.setState({fn: e.target.value});
+ }
+
+ handlePrivateChange(e) {
+ this.setState({private: e.target.value});
+ }
+
+ handleImageChanged(img) {
+ this.setState({imageDataUrl: img});
+ }
+
+ handleTagsChanged(tags) {
+ this.setState({tags: tags});
+ }
+
+ handleSubmit(e) {
+ e.preventDefault();
+ if (this.state.fn && this.state.fn.trim()) {
+ this.props.onSubmit(this.state.fn.trim(),
+ this.state.imageDataUrl, this.state.private.trim(),
+ this.state.tags);
+ }
+ }
+
+ render() {
+ var submitClasses = 'blue';
+ if (this.props.disabled) {
+ submitClasses += ' disabled';
+ }
+ return (
+
+ );
+ }
+};
diff --git a/src/widgets/permissions-editor.jsx b/src/widgets/permissions-editor.jsx
new file mode 100644
index 00000000..e8df36f0
--- /dev/null
+++ b/src/widgets/permissions-editor.jsx
@@ -0,0 +1,165 @@
+// PermissionsEditor: Component for editing permissions
+//
+import React from 'react';
+import { FormattedMessage, defineMessages, injectIntl } from 'react-intl';
+
+import CheckBox from './checkbox.jsx';
+import Contact from './contact.jsx';
+
+import { makeImageUrl } from '../lib/blob-helpers.js';
+
+// Translatable permission names.
+const messages = defineMessages({
+ 'joiner': {
+ id: 'permission_join',
+ defaultMessage: "Join ({val})",
+ description: 'Name of J permission'
+ },
+ 'reader': {
+ id: 'permission_read',
+ defaultMessage: "Read ({val})",
+ description: 'Name of R permission'
+ },
+ 'writer': {
+ id: 'permission_write',
+ defaultMessage: "Write ({val})",
+ description: 'Name of W permission'
+ },
+ 'preser': {
+ id: 'permission_pres',
+ defaultMessage: "Get notified ({val})",
+ description: 'Name of P permission'
+ },
+ 'approver': {
+ id: 'permission_admin',
+ defaultMessage: "Approve ({val})",
+ description: 'Name of A permission'
+ },
+ 'sharer': {
+ id: 'permission_share',
+ defaultMessage: "Share ({val})",
+ description: 'Name of S permission'
+ },
+ 'deleter': {
+ id: 'permission_delete',
+ defaultMessage: "Delete ({val})",
+ description: 'Name of D permission'
+ },
+ 'owner': {
+ id: 'permission_owner',
+ defaultMessage: "Owner ({val})",
+ description: 'Name of O permission'
+ }
+});
+
+class PermissionsEditor extends React.Component {
+ constructor(props) {
+ super(props);
+
+ this.state = {
+ mode: (props.mode || '').replace('N', '')
+ };
+
+ this.handleChange = this.handleChange.bind(this);
+ this.handleSubmit = this.handleSubmit.bind(this);
+ this.handleCancel = this.handleCancel.bind(this);
+ }
+
+ handleChange(val) {
+ let mode = this.state.mode;
+ let idx = mode.indexOf(val);
+ if (idx == -1) {
+ mode += val;
+ } else {
+ mode = mode.replace(val, '');
+ }
+ this.setState({mode: mode});
+ }
+
+ handleSubmit() {
+ // Normalize string, otherwise cannot check if mode has changed.
+ var mode = (this.state.mode || 'N').split('').sort().join('');
+ var before = (this.props.mode || 'N').split('').sort().join('')
+ if (mode !== before) {
+ this.props.onSubmit(mode);
+ } else {
+ this.props.onCancel();
+ }
+ }
+
+ handleCancel() {
+ this.props.onCancel();
+ }
+
+ render() {
+ const {formatMessage} = this.props.intl;
+ const all = 'JRWPASDO';
+ const names = {
+ 'J': formatMessage(messages.joiner, {val: 'J'}),
+ 'R': formatMessage(messages.reader, {val: 'R'}),
+ 'W': formatMessage(messages.writer, {val: 'W'}),
+ 'P': formatMessage(messages.preser, {val: 'P'}),
+ 'A': formatMessage(messages.approver, {val: 'A'}),
+ 'S': formatMessage(messages.sharer, {val: 'S'}),
+ 'D': formatMessage(messages.deleter, {val: 'D'}),
+ 'O': formatMessage(messages.owner, {val: 'O'})
+ };
+
+ let skip = this.props.skip || '';
+ let mode = this.state.mode;
+ let compare = (this.props.compare || '').replace('N', '');
+ let items = [];
+ for (let i=0; i= 0 && mode.indexOf(c) < 0) {
+ // Permission is marked as inactive: hide unchecked permissions, disable checked permissions
+ continue;
+ }
+ items.push(
+
+ {names[c]}
+ {skip.indexOf(c) < 0 ?
+ = 0)} onChange={this.handleChange}/>
+ :
+ = 0)} />
+ } {this.props.compare ?
+ = 0)}/>
+ : null}
+
+ );
+ }
+
+ return (
+
+ {this.props.userTitle ?
+
: null}
+
+
+ {this.props.compare ?
+
+ {this.props.modeTitle}
+ {this.props.compareTitle}
+ :
+ null}
+
+ {items}
+
+
+
+
+
+
+
+
+
+
+
+ );
+ }
+};
+
+export default injectIntl(PermissionsEditor);
diff --git a/src/widgets/received-marker.jsx b/src/widgets/received-marker.jsx
new file mode 100644
index 00000000..9d94d8a2
--- /dev/null
+++ b/src/widgets/received-marker.jsx
@@ -0,0 +1,55 @@
+// Received/read indicator.
+import React from 'react';
+import { defineMessages, injectIntl } from 'react-intl';
+
+import Tinode from 'tinode-sdk';
+
+import { shortDateFormat } from '../lib/strformat.js';
+
+const messages = defineMessages({
+ 'sending': {
+ 'id': 'message_sending',
+ 'defaultMessage': 'sending...',
+ 'description': 'Message being sent, in place of time stamp'
+ },
+ 'failed': {
+ 'id': 'message_sending_failed',
+ 'defaultMessage': 'failed',
+ 'description': 'Failed to send message, in place of time stamp'
+ }
+});
+
+class ReceivedMarker extends React.PureComponent {
+ render() {
+ const {formatMessage} = this.props.intl;
+ let timestamp;
+ if (this.props.received <= Tinode.MESSAGE_STATUS_SENDING) {
+ timestamp = formatMessage(messages.sending);
+ } else if (this.props.received == Tinode.MESSAGE_STATUS_FAILED) {
+ timestamp = formatMessage(messages.failed);
+ } else {
+ timestamp = shortDateFormat(this.props.timestamp);
+ }
+
+ let marker = null;
+ if (this.props.received <= Tinode.MESSAGE_STATUS_SENDING) {
+ marker = (access_time ); // watch face
+ } else if (this.props.received == Tinode.MESSAGE_STATUS_FAILED) {
+ marker = (error_outline ); // icon (!)
+ } else if (this.props.received == Tinode.MESSAGE_STATUS_SENT) {
+ marker = (done ); // checkmark
+ } else if (this.props.received == Tinode.MESSAGE_STATUS_RECEIVED) {
+ marker = (done_all ); // double checkmark
+ } else if (this.props.received == Tinode.MESSAGE_STATUS_READ) {
+ marker = (done_all ); // blue double checkmark
+ }
+
+ return (
+
+ {timestamp}{'\u00a0'}{marker}
+
+ );
+ }
+};
+
+export default injectIntl(ReceivedMarker);
diff --git a/src/widgets/search-contacts.jsx b/src/widgets/search-contacts.jsx
new file mode 100644
index 00000000..8751b5bc
--- /dev/null
+++ b/src/widgets/search-contacts.jsx
@@ -0,0 +1,73 @@
+import React from 'react';
+import { FormattedMessage } from 'react-intl';
+
+import Tinode from 'tinode-sdk';
+
+export default class SearchContacts extends React.PureComponent {
+ constructor(props) {
+ super(props);
+
+ this.state = {
+ edited: false,
+ search: ''
+ };
+
+ this.handleSearchChange = this.handleSearchChange.bind(this);
+ this.handleSearch = this.handleSearch.bind(this);
+ this.handleClear = this.handleClear.bind(this);
+ this.handleKeyDown = this.handleKeyDown.bind(this);
+ }
+
+ componentWillUnmount() {
+ if (this.state.edited) {
+ this.setState({search: '', edited: false});
+ this.props.onSearchContacts(Tinode.DEL_CHAR);
+ }
+ }
+
+ handleSearchChange(e) {
+ this.setState({search: e.target.value});
+ }
+
+ handleSearch(e) {
+ e.preventDefault();
+ var query = this.state.search.trim();
+ this.setState({edited: (query.length > 0)});
+ this.props.onSearchContacts(query.length > 0 ? query : Tinode.DEL_CHAR);
+ }
+
+ handleClear() {
+ if (this.state.edited) {
+ this.props.onSearchContacts(Tinode.DEL_CHAR);
+ }
+ this.setState({search: '', edited: false});
+ }
+
+ handleKeyDown(e) {
+ if (e.key === 'Enter') {
+ this.handleSearch(e);
+ } else if (e.key === 'Escape') {
+ this.handleClear();
+ }
+ }
+
+ render() {
+ return (
+
+
+
search
+
{
+ (search_placeholder) =>
+ }
+
+ close
+
+
+
+ );
+ }
+};
diff --git a/src/widgets/send-message.jsx b/src/widgets/send-message.jsx
new file mode 100644
index 00000000..781573bf
--- /dev/null
+++ b/src/widgets/send-message.jsx
@@ -0,0 +1,220 @@
+// Send message form.
+import React from 'react';
+import { defineMessages, injectIntl } from 'react-intl';
+import { Drafty } from 'tinode-sdk';
+
+import { KEYPRESS_DELAY, MAX_EXTERN_ATTACHMENT_SIZE, MAX_IMAGE_DIM, MAX_INBAND_ATTACHMENT_SIZE } from '../config.js';
+import { SUPPORTED_IMAGE_FORMATS, filePasted, imageFileToBase64, imageFileScaledToBase64 } from '../lib/blob-helpers.js';
+import { bytesToHumanSize } from '../lib/strformat.js';
+
+const messages = defineMessages({
+ 'messaging_disabled': {
+ id: 'messaging_disabled_prompt',
+ defaultMessage: 'Messaging disabled',
+ description: 'Prompt in SendMessage in read-only topic'
+ },
+ 'type_new_message': {
+ id: 'new_message_prompt',
+ defaultMessage: 'New message',
+ description: 'Prompt in SendMessage in read-only topic'
+ },
+ 'file_attachment_too_large': {
+ id: 'file_attachment_too_large',
+ defaultMessage: 'The file size {size} exceeds the {limit} limit.',
+ description: 'Error message when attachment is too large'
+ },
+ 'cannot_initiate_upload': {
+ id: 'cannot_initiate_file_upload',
+ defaultMessage: 'Cannot initiate file upload.',
+ description: 'Generic error messagewhen attachment fails'
+ },
+});
+
+class SendMessage extends React.PureComponent {
+ constructor(props) {
+ super(props);
+
+ this.state = {
+ message: '',
+ // Make initial keypress time as if it happened 5001 milliseconds in the past.
+ keypressTimestamp: new Date().getTime() - KEYPRESS_DELAY - 1
+ };
+
+ this.handlePasteEvent = this.handlePasteEvent.bind(this);
+ this.handleAttachImage = this.handleAttachImage.bind(this);
+ this.handleAttachFile = this.handleAttachFile.bind(this);
+ this.handleSend = this.handleSend.bind(this);
+ this.handleKeyPress = this.handleKeyPress.bind(this);
+ this.handleMessageTyping = this.handleMessageTyping.bind(this);
+ }
+
+ componentDidMount() {
+ this.pasteFile.addEventListener('paste', this.handlePasteEvent, false);
+ }
+
+ componentWillUnmount() {
+ this.pasteFile.removeEventListener('paste', this.handlePasteEvent, false)
+ }
+
+ handlePasteEvent(e) {
+ if (this.props.disabled) {
+ return;
+ }
+ // FIXME: handle large files too.
+ if (filePasted(e,
+ (bits, mime, width, height, fname) => {
+ this.props.sendMessage(Drafty.insertImage(null,
+ 0, mime, bits, width, height, fname));
+ },
+ (mime, bits, fname) => {
+ this.props.sendMessage(Drafty.attachFile(null, mime, bits, fname));
+ },
+ this.props.onError)) {
+
+ // If a file was pasted, don't paste base64 data into input field.
+ e.preventDefault();
+ }
+ }
+
+ handleAttachImage(e) {
+ if (e.target.files && e.target.files.length > 0) {
+ let file = e.target.files[0];
+ // Check if the uploaded file is indeed an image and if it isn't too large.
+ if (file.size > MAX_INBAND_ATTACHMENT_SIZE || SUPPORTED_IMAGE_FORMATS.indexOf(file.type) < 0) {
+ // Convert image for size or format.
+ imageFileScaledToBase64(file, MAX_IMAGE_DIM, MAX_IMAGE_DIM, false,
+ // Success
+ (bits, mime, width, height, fname) => {
+ this.props.sendMessage(Drafty.insertImage(null,
+ 0, mime, bits, width, height, fname));
+ },
+ // Failure
+ (err) => {
+ this.props.onError(err, 'err');
+ });
+ } else {
+ // Image can be uploaded as is. No conversion is needed.
+ imageFileToBase64(file,
+ // Success
+ (bits, mime, width, height, fname) => {
+ this.props.sendMessage(Drafty.insertImage(null,
+ 0, mime, bits, width, height, fname));
+ },
+ // Failure
+ (err) => {
+ this.props.onError(err, 'err');
+ }
+ );
+ }
+ }
+ // Clear the value so the same file can be uploaded again.
+ e.target.value = '';
+ }
+
+ handleAttachFile(e) {
+ const {formatMessage} = this.props.intl;
+ if (e.target.files && e.target.files.length > 0) {
+ var file = e.target.files[0];
+ if (file.size > MAX_EXTERN_ATTACHMENT_SIZE) {
+ // Too large.
+ this.props.onError(formatMessage(messages.file_attachment_too_large,
+ {size: bytesToHumanSize(file.size), limit: bytesToHumanSize(MAX_EXTERN_ATTACHMENT_SIZE)}), 'err');
+ } else if (file.size > MAX_INBAND_ATTACHMENT_SIZE) {
+ // Too large to send inband - uploading out of band and sending as a link.
+ let uploader = this.props.tinode.getLargeFileHelper();
+ if (!uploader) {
+ this.props.onError(formatMessage(messages.cannot_initiate_upload));
+ return;
+ }
+ // Format data and initiate upload.
+ let uploadCompletionPromise = uploader.upload(file);
+ let msg = Drafty.attachFile(null, file.type, null, file.name, file.size, uploadCompletionPromise);
+ // Pass data and the uploader to the TinodeWeb.
+ this.props.sendMessage(msg, uploadCompletionPromise, uploader);
+ } else {
+ // Small enough to send inband.
+ fileToBase64(file,
+ (mime, bits, fname) => {
+ this.props.sendMessage(Drafty.attachFile(null, mime, bits, fname));
+ },
+ this.props.onError
+ );
+ }
+ }
+ // Clear the value so the same file can be uploaded again.
+ e.target.value = '';
+ }
+
+ handleSend() {
+ var message = this.state.message.trim();
+ if (message) {
+ this.props.sendMessage(this.state.message.trim());
+ this.setState({message: ''});
+ }
+ }
+
+ /* Send on Enter key */
+ handleKeyPress(e) {
+ // Remove this if you don't want Enter to trigger send
+ if (e.key === 'Enter') {
+ // Have Shift-Enter insert a line break instead
+ if (!e.shiftKey) {
+ e.preventDefault();
+ e.stopPropagation();
+
+ this.handleSend();
+ }
+ }
+ }
+
+ handleMessageTyping(e) {
+ var newState = {message: e.target.value};
+ var now = new Date().getTime();
+ if (now - this.state.keypressTimestamp > KEYPRESS_DELAY) {
+ var topic = this.props.tinode.getTopic(this.props.topic);
+ if (topic.isSubscribed()) {
+ topic.noteKeyPress();
+ }
+ newState.keypressTimestamp = now;
+ }
+ this.setState(newState);
+ }
+
+ render() {
+ const {formatMessage} = this.props.intl;
+ const prompt = this.props.disabled ?
+ formatMessage(messages.messaging_disabled) :
+ formatMessage(messages.type_new_message);
+ let instance = this;
+ return (
+
+ {this.props.disabled ?
+
photo :
+
+ photo
+ }
+ {this.props.disabled ?
+
attach_file :
+
+ attach_file
+ }
+
+ {this.props.disabled ?
+
send :
+
+ send
+ }
+
+
+
+ );
+ }
+};
+
+export default injectIntl(SendMessage);
diff --git a/src/widgets/side-navbar.jsx b/src/widgets/side-navbar.jsx
new file mode 100644
index 00000000..444f5d8a
--- /dev/null
+++ b/src/widgets/side-navbar.jsx
@@ -0,0 +1,29 @@
+import React from 'react';
+
+import LetterTile from './letter-tile.jsx';
+import MenuCancel from './menu-cancel.jsx';
+import MenuContacts from './menu-contacts.jsx';
+import MenuStart from './menu-start.jsx';
+
+export default class SideNavbar extends React.PureComponent {
+ render() {
+ return (
+
+
+
+
+
{this.props.title}
+ {this.props.state === 'login' ?
+
:
+ this.props.state === 'contacts' ?
+
:
+ null}
+ {this.props.onCancel ?
+
: null}
+
+ );
+ }
+};
diff --git a/src/widgets/tag-manager.jsx b/src/widgets/tag-manager.jsx
new file mode 100644
index 00000000..633cb1c8
--- /dev/null
+++ b/src/widgets/tag-manager.jsx
@@ -0,0 +1,152 @@
+// TagManager: edit topic or user tags.
+import React from 'react';
+import { FormattedMessage } from 'react-intl';
+
+import ChipInput from './chip-input.jsx';
+
+import { MIN_TAG_LENGTH } from '../config.js';
+import { arrayEqual } from '../lib/utils.js';
+
+export default class TagManager extends React.Component {
+ constructor(props) {
+ super(props);
+
+ this.state = {
+ tags: this.props.tags,
+ tagInput: '',
+ activated: this.props.activated
+ };
+
+ this.handleShowTagManager = this.handleShowTagManager.bind(this);
+ this.handleTagInput = this.handleTagInput.bind(this);
+ this.handleAddTag = this.handleAddTag.bind(this);
+ this.handleRemoveTag = this.handleRemoveTag.bind(this);
+ this.handleSubmit = this.handleSubmit.bind(this);
+ this.handleCancel = this.handleCancel.bind(this);
+ }
+
+ static getDerivedStateFromProps(nextProps, prevState) {
+ if (!arrayEqual(nextProps.tags, prevState.tags) && !prevState.activated) {
+ return {tags: nextProps.tags};
+ }
+ return null;
+ }
+
+ handleShowTagManager() {
+ this.setState({activated: true});
+ }
+
+ handleTagInput(text) {
+ this.setState({tagInput: text});
+ // Check if user entered ',', ' ' or ';'
+ if (text.length > 0) {
+ var last = text[text.length-1];
+ if (last == ',' || last == ' ' || last == ';') {
+ var tag = text.substr(0, text.length-1).trim();
+ if (tag.length >= MIN_TAG_LENGTH) {
+ this.handleAddTag(tag);
+ }
+ }
+ }
+ }
+
+ handleAddTag(tag) {
+ tag = tag.trim();
+ if (tag.length > 0) {
+ let tags = this.state.tags.slice(0);
+ tags.push(tag);
+ this.setState({tags: tags, tagInput: ''});
+ if (this.props.onTagsChanged) {
+ this.props.onTagsChanged(tags);
+ }
+ }
+ }
+
+ handleRemoveTag(tag, index) {
+ var tags = this.state.tags.slice(0);
+ tags.splice(index, 1);
+ this.setState({tags: tags});
+ if (this.props.onTagsChanged) {
+ this.props.onTagsChanged(tags);
+ }
+ }
+
+ handleSubmit() {
+ let tags = this.state.tags.slice(0);
+ let inp = this.state.tagInput.trim();
+ if (inp.length > 0) {
+ tags.push(inp);
+ if (this.props.onTagsChanged) {
+ this.props.onTagsChanged(tags);
+ }
+ }
+ this.props.onSubmit(tags);
+ this.setState({activated: false, tagInput: '', tags: this.props.tags});
+ }
+
+ handleCancel() {
+ this.setState({activated: false, tagInput: '', tags: this.props.tags});
+ if (this.props.onCancel) {
+ this.props.onCancel();
+ }
+ }
+
+ render() {
+ var tags = [];
+ if (this.state.activated) {
+ this.state.tags.map(function(tag) {
+ tags.push({user: tag});
+ });
+ } else {
+ this.state.tags.map(function(tag) {
+ tags.push({tag} );
+ });
+ if (tags.length == 0) {
+ tags = (
+
+ );
+ }
+ }
+ return (
+
+
+ {this.props.title}
+
+ {this.state.activated ?
+
+
{
+ (add_tags_prompt) =>
+ }
+ {this.props.onSubmit || this.props.onCancel ?
+
+
+
+
+
+
+
+
+ : null}
+
+ :
+
+ }
+
+ );
+ }
+};
diff --git a/src/widgets/unread-badge.jsx b/src/widgets/unread-badge.jsx
new file mode 100644
index 00000000..b9627922
--- /dev/null
+++ b/src/widgets/unread-badge.jsx
@@ -0,0 +1,13 @@
+// The counter of unread messages in the topic.
+import React from 'react';
+
+export default class UnreadBadge extends React.PureComponent {
+ render() {
+ var showUnreadBadge = null;
+ if (this.props.count > 0) {
+ var count = this.props.count > 9 ? "9+" : this.props.count;
+ showUnreadBadge = {count} ;
+ }
+ return showUnreadBadge;
+ }
+};
diff --git a/src/widgets/visible-password.jsx b/src/widgets/visible-password.jsx
new file mode 100644
index 00000000..e7fa139c
--- /dev/null
+++ b/src/widgets/visible-password.jsx
@@ -0,0 +1,80 @@
+// Password with a visiblity toggle.
+import React from 'react';
+
+export default class VisiblePassword extends React.PureComponent {
+ constructor(props) {
+ super(props);
+
+ this.state = {
+ value: this.props.value,
+ visible: false
+ };
+
+ this.handleVisibility = this.handleVisibility.bind(this);
+ this.handeTextChange = this.handeTextChange.bind(this);
+ this.handleKeyDown = this.handleKeyDown.bind(this);
+ this.handleEditingFinished = this.handleEditingFinished.bind(this);
+ }
+
+ handeTextChange(e) {
+ this.setState({value: e.target.value});
+ if (this.props.onChange) {
+ this.props.onChange(e);
+ }
+ }
+
+ handleVisibility(e) {
+ e.preventDefault();
+ this.setState({visible: !this.state.visible});
+ }
+
+ handleKeyDown(e) {
+ if (e.keyCode == 27) {
+ // Escape pressed
+ this.setState({value: this.props.value, visible: false});
+ if (this.props.onFinished) {
+ this.props.onFinished();
+ }
+ } else if (e.keyCode == 13) {
+ // Enter pressed
+ this.handleEditingFinished();
+ }
+ }
+
+ handleEditingFinished(e) {
+ if (e) {
+ let currentTarget = e.currentTarget;
+ setTimeout(() => {
+ if (!currentTarget.contains(document.activeElement)) {
+ if (this.props.onFinished) {
+ this.props.onFinished(this.state.value);
+ }
+ }
+ }, 0);
+ } else if (this.props.onFinished) {
+ this.props.onFinished(this.state.value.trim());
+ }
+ }
+
+ render() {
+ return (
+
+
+
+
+ {this.state.visible ? 'visibility' : 'visibility_off'}
+
+
+
+ );
+ }
+}
diff --git a/umd/index.dev.js b/umd/index.dev.js
index 8ab660d1..9baadf47 100644
--- a/umd/index.dev.js
+++ b/umd/index.dev.js
@@ -1,35690 +1,859 @@
-(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Webapp = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i\"},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,s=(e.name?'':\"\")+' ';return console.log(\"open: \"+s),s},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}}}},o=function(){};o.parse=function(e){if(\"string\"!=typeof e)return null;var s=e.split(/\\r?\\n/),i=[],r={},o=[];s.map(function(e){var s,a,c=[];if(t.map(function(t){c=c.concat(function(e,t,n,s){for(var i=[],r=0,o=e.slice(0);o.length>0;){var a=t.exec(o);if(null==a)break;var c=a.index+a[0].lastIndexOf(a[1]);o=o.slice(c+1),r=(c+=r)+1;var u=n?n.exec(o):null;if(null==u)break;var h=u.index+u[0].indexOf(u[1]);o=o.slice(h+1),r=(h+=r)+1,i.push({text:e.slice(c+1,h),children:[],start:c,end:h,type:s})}return i}(e,t.start,t.end,t.name))}),0==c.length)a={txt:e};else{c.sort(function(e,t){return e.start-t.start}),c=function e(t){if(0==t.length)return[];for(var n=[t[0]],s=t[0],i=1;is.end?(n.push(t[i]),s=t[i]):t[i].endn&&r.push({text:t.slice(n,a.start)});var c={type:a.type},u=e(t,a.start+1,a.end-1,a.children);u.length>0?c.children=u:c.text=a.text,r.push(c),n=a.end+1}return ni;return i=e.offset+e.len,t})}(a.txt)).length>0){var h=[];for(var l in s){var d=s[l],f=r[d.unique];f||(f=i.length,r[d.unique]=f,i.push({tp:d.type,data:d.data})),h.push({at:d.offset,len:d.len,key:f})}a.ent=h}o.push(a)});var a={txt:\"\"};if(o.length>0){a.txt=o[0].txt,a.fmt=(o[0].fmt||[]).concat(o[0].ent||[]);for(var c=1;c0&&(a.ent=i)}return a},o.insertImage=function(e,t,n,s,i,r,o,a,c){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:s,width:i,height:r,name:o,ref:c,size:0|a}}),e},o.attachFile=function(e,t,n,s,i,r){(e=e||{txt:\"\"}).ent=e.ent||[],e.fmt=e.fmt||[],e.fmt.push({at:-1,len:0,key:e.ent.length});var o={tp:\"EX\",data:{mime:t,val:n,name:s,ref:r,size:0|i}};return r instanceof Promise&&(o.data.ref=r.then(function(e){o.data.ref=e},function(e){})),e.ent.push(o),e},o.UNSAFE_toHTML=function(e){var t,n,s,i=e.txt,o=e.fmt,a=e.ent,c=[];if(o)for(var u in o){var h,l=o[u],d=l.tp;if(!d){var f=a[l.key];f&&(d=f.tp,h=f.data)}r[d]&&(c.push({idx:l.at+l.len,what:r[d].close(h)}),c.push({idx:l.at,what:r[d].open(h)}))}for(var u in c.sort(function(e,t){return t.idx-e.idx}),c)c[u].what&&(t=i,n=c[u].idx,s=c[u].what,i=t.slice(0,n)+s+t.slice(n));return i},o.format=function(e,t,n){var i=e.txt,r=e.fmt,o=e.ent;if(i=i||\"\",!r)return[i];var a=[].concat(r);return a.map(function(e){e.at=e.at||0,e.len=e.len||0}),a.sort(function(e,t){return e.at-t.at==0?t.len-e.len:e.at-t.at}),a=a.map(function(e){var t,n=e.tp;return n||(e.key=e.key||0,t=o[e.key].data,n=o[e.key].tp),{tp:n,data:t,at:e.at,len:e.len}}),function e(t,n,i,r,o,a){for(var c=[],u=0;u0)for(var t in e.ent)if(\"EX\"==e.ent[t].tp)return!0;return!1},o.attachments=function(e,t,n){if(e.ent&&e.ent.length>0)for(var s in e.ent)\"EX\"==e.ent[s].tp&&t.call(n,e.ent[s].data,s)},o.getDownloadUrl=function(e){var t=null;return e.val?t=i(e.val,e.mime):\"string\"==typeof e.ref&&(t=e.ref),t},o.isUploading=function(e){return e.ref instanceof Promise},o.getPreviewUrl=function(e){return e.val?i(e.val,e.mime):null},o.getEntitySize=function(e){return e.size?e.size:e.val?.75*e.val.length|0:0},o.getEntityMimeType=function(e){return e.mime||\"text/plain\"},o.tagName=function(e){return s[e]?s[e].name:void 0},o.attrValue=function(e,t){if(t&&r[e])return r[e].props(t)},o.getContentType=function(){return\"text/x-drafty\"},e.exports=o,e=e.exports;var a=\"0.15.9-rc1\",c={exports:{}};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)}if(true)var s=a;var i;\"undefined\"!=typeof WebSocket&&(i=WebSocket),\"undefined\"==typeof btoa&&(t.btoa=function(){for(var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:\"\",n=\"\",s=0,i=0,r=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\";t.charAt(0|i)||(r=\"=\",i%1);n+=r.charAt(63&s>>8-i%1*8)){if((e=t.charCodeAt(i+=.75))>255)throw new Error(\"'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.\");s=s<<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,s=0,i=0,r=0;n=e.charAt(r++);~n&&(i=s%4?64*i+n:n,s++%4)?t+=String.fromCharCode(255&i>>(-2*s&6)):0)n=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\".indexOf(n);return t}),\"undefined\"==typeof window&&(t.window={WebSocket:i,URL:{createObjectURL:function(){throw new Error(\"Unable to use window.URL in a non browser application\")}}});var r=\"0\",o=s||\"0.15\",u=\"tinodejs/\"+o,h=503,l=\"Connection failed\";function d(e){return btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,function(e,t){return String.fromCharCode(\"0x\"+t)}))}function f(e,t,s){if(null==t)return e;if(\"object\"!=n(t))return t||e;if(t instanceof Date)return t;if(t instanceof M)return new M(t);if(t instanceof Array)return t.length>0?t:e;for(var i in e&&e!==w.DEL_CHAR||(e=t.constructor()),t)!t.hasOwnProperty(i)||!t[i]&&!1!==t[i]||s&&s[i]||\"_generated\"==i||(e[i]=f(e[i],t[i]));return e}function p(e,t,n,s){return e[t]=f(e[t],n,s),e[t]}function g(){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 _(e,t){if(\"ts\"===e&&\"string\"==typeof t&&t.length>=20&&t.length<=24){var s=new Date(t);if(s)return s}else if(\"acs\"===e&&\"object\"===n(t))return new M(t);return t}function v(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 m(e,t,n){var s=null;return\"http\"!==t&&\"https\"!==t&&\"ws\"!==t&&\"wss\"!==t||(s=t+\"://\",\"/\"!==(s+=e).charAt(s.length-1)&&(s+=\"/\"),s+=\"v\"+r+\"/channels\",\"http\"!==t&&\"https\"!==t||(s+=\"/lp\"),s+=\"?apikey=\"+n),s}var b=function(e,t,s,r,o){var a=this,c=e,u=r,d=t,f=o,p=2e3,v=10,b=.3,w=null,S=0,M=!1,T=function(e){a.logger&&a.logger(e)};function y(e){var t=null;e.connect=function(n){return t&&1===t.readyState?Promise.resolve():(n&&(c=n),new Promise(function(n,s){var r=m(c,u?\"wss\":\"ws\",d);T(\"Connecting to: \"+r);var o=new i(r);o.onopen=function(t){M=!1,e.onOpen&&e.onOpen(),n(),f&&(clearTimeout(w),w=null,S=0)},o.onclose=function(n){t=null,e.onDisconnect&&e.onDisconnect(null),!M&&f&&function(){var e=this;clearTimeout(w);var t=p*(Math.pow(2,S)*(1+b*Math.random()));S=S>=v?S:S+1,w=setTimeout(function(){T(\"Reconnecting, iter=\"+S+\", timeout=\"+t),M||e.connect().catch(function(){})},t)}.call(e)},o.onerror=function(e){s(e)},o.onmessage=function(t){e.onMessage&&e.onMessage(t.data)},t=o}))},e.disconnect=function(){t&&(M=!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 D(e){var t=null,n=null,s=null;e.connect=function(s){return n?Promise.resolve():(s&&(c=s),new Promise(function(s,i){var r=m(c,u?\"https\":\"http\",d);T(\"Connecting to: \"+r),(n=function n(s,i,r){var o=g();return o.onreadystatechange=function(a){if(4==o.readyState)if(201==o.status){var c=JSON.parse(o.responseText,_);o.responseText,t=s+\"&sid=\"+c.ctrl.params.sid,(o=n(t)).send(null),e.onOpen&&e.onOpen(),i&&i()}else if(200==o.status)e.onMessage&&e.onMessage(o.responseText),(o=n(t)).send(null);else if(r&&r(o.responseText),e.onMessage&&o.responseText&&e.onMessage(o.responseText),e.onDisconnect){var u=o.status||h,d=o.responseText||l;e.onDisconnect(new Error(d+\"(\"+u+\")\"))}},o.open(\"GET\",s,!0),o}(r,s,i)).send(null)}).catch(function(){}))},e.disconnect=function(){s&&(s.onreadystatechange=void 0,s.abort(),s=null),n&&(n.onreadystatechange=void 0,n.abort(),n=null),e.onDisconnect&&e.onDisconnect(null),t=null},e.sendText=function(e){var n,i;if(n=t,(i=g()).onreadystatechange=function(e){if(4==i.readyState&&i.status>=400)throw new Error(\"LP sender failed, \"+i.status)},i.open(\"POST\",n,!0),!(s=i)||1!=s.readyState)throw new Error(\"Long poller failed to connect\");s.send(e)},e.isConnected=function(){return n&&!0},e.transport=function(){return\"lp\"}}\"lp\"===s?D(this):\"ws\"===s?y(this):\"object\"==(\"undefined\"==typeof window?\"undefined\":n(window))&&window.WebSocket?y(this):D(this),this.onMessage=void 0,this.onDisconnect=void 0,this.onOpen=void 0,this.logger=void 0},w=function(e,t,s,i,r){var a=this;this._appName=e||\"Undefined\",this._apiKey=s,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 s=[\"chrome\",\"safari\",\"mobile\",\"version\"],i=e.substr(n.index+n[0].length).split(\" \"),r=[],o=0;o0?r[0][0]+\"/\"+r[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 c=n[1].split(\".\");t=n[0]+\"/\"+c[0]+(c[1]?\".\"+c[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 b(t,s,i,r,!0),this.logger=function(e){if(a._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 c=this.cachePut=function(e,t,n){a._cache[e+\":\"+t]=n},d=this.cacheGet=function(e,t){return a._cache[e+\":\"+t]},p=this.cacheDel=function(e,t){delete a._cache[e+\":\"+t]},g=this.cacheMap=function(e,t){for(var n in a._cache)if(e(a._cache[n],n,t))break};this.attachCacheToTopic=function(e){e._tinode=a,e._cacheGetUser=function(e){var t=d(\"user\",e);if(t)return{user:e,public:f({},t)}},e._cachePutUser=function(e,t){return c(\"user\",e,f({},t.public))},e._cacheDelUser=function(e){return p(\"user\",e)},e._cachePutSelf=function(){return c(\"topic\",e.name,e)},e._cacheDelSelf=function(){return p(\"topic\",e.name)}};var m=function(e,t,n,s){var i=a._pendingPromises[e];i&&(delete a._pendingPromises[e],t>=200&&t<400?i.resolve&&i.resolve(n):i.reject&&i.reject(new Error(\"Error: \"+s+\" (\"+t+\")\")))},w=this.getNextUniqueId=function(){return 0!=a._messageId?\"\"+a._messageId++:void 0};this.initPacket=function(e,t){switch(e){case\"hi\":return{hi:{id:w(),ver:o,ua:a._appName+\" (\"+(a._browser?a._browser+\"; \":\"\")+a._platform+\"); \"+u,dev:a._deviceToken,lang:a._humanLanguage}};case\"acc\":return{acc:{id:w(),user:null,scheme:null,secret:null,login:!1,tags:null,desc:{},cred:{}}};case\"login\":return{login:{id:w(),scheme:null,secret:null}};case\"sub\":return{sub:{id:w(),topic:t,set:{},get:{}}};case\"leave\":return{leave:{id:w(),topic:t,unsub:!1}};case\"pub\":return{pub:{id:w(),topic:t,noecho:!1,head:null,content:{}}};case\"get\":return{get:{id:w(),topic:t,what:null,desc:{},sub:{},data:{}}};case\"set\":return{set:{id:w(),topic:t,desc:{},sub:{},tags:[]}};case\"del\":return{del:{id:w(),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 s;t&&(s=function(e){var t=null;return e&&(t=new Promise(function(t,n){a._pendingPromises[e]={resolve:t,reject:n}})),t}(t)),e=function e(t){return Object.keys(t).forEach(function(s){\"_\"==s[0]?delete t[s]:t[s]?Array.isArray(t[s])&&0==t[s].length?delete t[s]:t[s]?\"object\"!=n(t[s])||t[s]instanceof Date||(e(t[s]),0==Object.getOwnPropertyNames(t[s]).length&&delete t[s]):delete t[s]:delete t[s]}),t}(e);var i=JSON.stringify(e);a.logger(\"out: \"+(a._trimLongStrings?JSON.stringify(e,v):i));try{a._connection.sendText(i)}catch(e){if(!t)throw e;m(t,h,null,e.message)}return s},this.loginSuccessful=function(e){e.params&&e.params.user&&(a._myUID=e.params.user,a._authenticated=e&&e.code>=200&&e.code<300,e.params&&e.params.token&&e.params.expires?a._authToken={token:e.params.token,expires:new Date(e.params.expires)}:a._authToken=null,a.onLogin&&a.onLogin(e.code,e.text))},this._connection.onMessage=function(e){if(e){a._inPacketCount++,a.onRawMessage&&a.onRawMessage(e);var t=JSON.parse(e,_);if(t)if(a.logger(\"in: \"+(a._trimLongStrings?JSON.stringify(t,v):e)),a.onMessage&&a.onMessage(t),t.ctrl)a.onCtrlMessage&&a.onCtrlMessage(t.ctrl),t.ctrl.id&&m(t.ctrl.id,t.ctrl.code,t.ctrl,t.ctrl.text),t.ctrl.params&&\"data\"==t.ctrl.params.what&&(n=d(\"topic\",t.ctrl.topic))&&n._allMessagesReceived(t.ctrl.params.count);else if(t.meta)(n=d(\"topic\",t.meta.topic))&&n._routeMeta(t.meta),a.onMetaMessage&&a.onMetaMessage(t.meta);else if(t.data)(n=d(\"topic\",t.data.topic))&&n._routeData(t.data),a.onDataMessage&&a.onDataMessage(t.data);else if(t.pres)(n=d(\"topic\",t.pres.topic))&&n._routePres(t.pres),a.onPresMessage&&a.onPresMessage(t.pres);else if(t.info){var n;(n=d(\"topic\",t.info.topic))&&n._routeInfo(t.info),a.onInfoMessage&&a.onInfoMessage(t.info)}else a.logger(\"ERROR: Unknown packet received.\");else a.logger(\"in: \"+e),a.logger(\"ERROR: failed to parse data\")}},this._connection.onOpen=function(){a.hello()},this._connection.onDisconnect=function(e){for(var t in a._inPacketCount=0,a._serverInfo=null,a._authenticated=!1,a._pendingPromises){var n=a._pendingPromises[t];n&&n.reject&&n.reject(new Error(l+\" (\"+h+\")\"))}a._pendingPromises={},g(function(e,t){0===t.lastIndexOf(\"topic:\",0)&&e._resetSub()}),a.onDisconnect&&a.onDisconnect(e)}};w.credential=function(e,t,s,i){if(\"object\"==n(e)){var r=e;t=r.val,s=r.params,i=r.resp,e=r.meth}return e&&(t||i)?[{meth:e,val:t,resp:i,params:s}]:null},w.topicType=function(e){return{me:\"me\",fnd:\"fnd\",grp:\"grp\",new:\"grp\",usr:\"p2p\"}[\"string\"==typeof e?e.substring(0,3):\"xxx\"]},w.isNewGroupTopicName=function(e){return\"string\"==typeof e&&\"new\"==e.substring(0,3)},w.getVersion=function(){return o},w.setWebSocketProvider=function(e){i=e},w.getLibrary=function(){return u},w.MESSAGE_STATUS_NONE=0,w.MESSAGE_STATUS_QUEUED=1,w.MESSAGE_STATUS_SENDING=2,w.MESSAGE_STATUS_FAILED=3,w.MESSAGE_STATUS_SENT=4,w.MESSAGE_STATUS_RECEIVED=5,w.MESSAGE_STATUS_READ=6,w.MESSAGE_STATUS_TO_ME=7,w.DEL_CHAR=\"\\u2421\",w.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,s,i){var r=this.initPacket(\"acc\");return r.acc.user=e,r.acc.scheme=t,r.acc.secret=n,r.acc.login=s,i&&(r.acc.desc.defacs=i.defacs,r.acc.desc.public=i.public,r.acc.desc.private=i.private,r.acc.tags=i.tags,r.acc.cred=i.cred,r.acc.token=i.token),this.send(r,r.acc.id)},createAccount:function(e,t,n,s){var i=this,r=this.account(\"new\",e,t,n,s);return n&&(r=r.then(function(e){return i.loginSuccessful(e),e})),r},createAccountBasic:function(e,t,n){return e=e||\"\",t=t||\"\",this.createAccount(\"basic\",d(e+\":\"+t),!0,n)},updateAccountBasic:function(e,t,n,s){return t=t||\"\",n=n||\"\",this.account(e,\"basic\",d(t+\":\"+n),!1,s)},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 s=this,i=this.initPacket(\"login\");return i.login.scheme=e,i.login.secret=t,i.login.cred=n,this.send(i,i.login.id).then(function(e){return s.loginSuccessful(e),e})},loginBasic:function(e,t,n){var s=this;return this.login(\"basic\",d(e+\":\"+t),n).then(function(t){return s._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 s=this.initPacket(\"sub\",e);return e||(e=\"new\"),s.sub.get=t,n&&(n.sub&&(s.sub.set.sub=n.sub),w.isNewGroupTopicName(e)&&n.desc&&(s.sub.set.desc=n.desc),n.tags&&(s.sub.set.tags=n.tags)),this.send(s,s.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,s){var i=this.initPacket(\"pub\",t),r=\"string\"==typeof n?e.parse(n):n;return r&&!e.isPlainText(r)&&(i.pub.head={mime:e.getContentType()},n=r),i.pub.noecho=s,i.pub.content=n,i.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=f(n.get,t),this.send(n,n.get.id)},setMeta:function(e,t){var n=this.initPacket(\"set\",e),s=[];return t&&[\"desc\",\"sub\",\"tags\"].map(function(e){t.hasOwnProperty(e)&&(s.push(e),n.set[e]=t[e])}),0==s.length?Promise.reject(new Error(\"Invalid {set} parameters\")):this.send(n,n.set.id)},delMessages:function(e,t,n){var s=this.initPacket(\"del\",e);return s.del.what=\"msg\",s.del.delseq=t,s.del.hard=n,this.send(s,s.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 s=this.initPacket(\"note\",e);s.note.what=t,s.note.seq=n,this.send(s)},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 y:\"fnd\"==e?new D:new T(e),this.cachePut(\"topic\",e,t),this.attachCacheToTopic(t)),t},newTopic:function(e){var t=new T(\"new\",e);return this.attachCacheToTopic(t),t},newGroupTopicName:function(){return\"new\"+this.getNextUniqueId()},newTopicWith:function(e,t){var n=new T(e,t);return this.attachCacheToTopic(n),n},getMeTopic:function(){return this.getTopic(\"me\")},getFndTopic:function(){return this.getTopic(\"fnd\")},getLargeFileHelper:function(){return new E(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 S=function(e){this.topic=e;var t=e._tinode.getMeTopic();this.contact=t&&t.getContact(e.name),this.what={}};S.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 s={ims:e,limit:t};return\"me\"==this.topic.getType()?s.topic=n:s.user=n,this.what.sub=s,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(s){n.what.hasOwnProperty(s)&&(t.push(s),Object.getOwnPropertyNames(n.what[s]).length>0&&(e[s]=n.what[s]))}),t.length>0?e.what=t.join(\" \"):e=void 0,e}};var M=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)};M._NONE=0,M._JOIN=1,M._READ=2,M._WRITE=4,M._PRES=8,M._APPROVE=16,M._SHARE=32,M._DELETE=64,M._OWNER=128,M._BITMASK=M._JOIN|M._READ|M._WRITE|M._PRES|M._APPROVE|M._SHARE|M._DELETE|M._OWNER,M._INVALID=1048576,M.decode=function(e){if(!e)return null;if(\"number\"==typeof e)return e&M._BITMASK;if(\"N\"===e||\"n\"===e)return M._NONE;for(var t={J:M._JOIN,R:M._READ,W:M._WRITE,P:M._PRES,A:M._APPROVE,S:M._SHARE,D:M._DELETE,O:M._OWNER},n=M._NONE,s=0;s0)){c=!0;break}r=o-1}return c?o:s?-1:a<0?o+1:o}function s(e,t){var s=n(e,t,!1);return t.splice(s,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,s,i){n|=0,s=s||t.length;for(var r=n;r=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 s=n._tinode.getMeTopic();s&&s._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 s=[];e.attachments(t.content,function(e){s.push(e.ref)}),t.head.attachments=s}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 s=e.seq||this._getQueuedSeqId();return e._generated||(e._generated=!0,e.seq=s,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,s=this.startMetaQuery();t?s.withLaterData(e):s.withEarlierData(e);var i=this.getMeta(s.build());return t||(i=i.then(function(e){e&&e.params&&!e.params.count&&(n._noEarlierMsgs=!0)})),i},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,s=e.length;n1&&t.push(i)}t.sort().filter(function(e,t,n){return!t||e!=n[t-1]})}return 0==t.length&&t.push(w.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 s=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,s,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 i in this._users){var r=this._users[i];r.user!==s&&r[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 w.topicType(this.name)},getAccessMode:function(){return this.acs},getDefaultAccess:function(){return this.defacs},startMetaQuery:function(){return new S(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!=M._NONE||(\"p2p\"==this.getType()&&this.leave(),this._processMetaSub([{user:n,deleted:new Date,_generated:!0}]));else{var s=(new M).updateAll(e.dacs);s&&s.mode!=M._NONE&&((t=this._cacheGetUser(n))?t.acs=s:(t={user:n,acs:s},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(f(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 s=e[n];if(s.user){s.updated=new Date(s.updated),s.deleted=s.deleted?new Date(s.deleted):null;var i=null;s.deleted?(delete this._users[s.user],i=s):((i=this._users[s.user])||(i=this._cacheGetUser(s.user)),i=this._updateCachedUser(s.user,s,s._generated)),this.onMetaSub&&this.onMetaSub(i)}else s._generated||(t=s)}t&&this.onMetaDesc&&this.onMetaDesc(t),this.onSubsUpdated&&this.onSubsUpdated(Object.keys(this._users))},_processMetaTags:function(e){1==e.length&&e[0]==w.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,s=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 M(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 s=this._cacheGetUser(e);return s?s=f(s,t):(n&&this.getMeta(this.startMetaQuery().withLaterOneSub(e).build()),s=f({},t)),this._cachePutUser(e,s),p(this._users,e,s)},_getQueuedSeqId:function(){return this._queuedSeqId++}};var y=function(e){T.call(this,\"me\",e),this._contacts={},e&&(this.onContactUpdate=e.onContactUpdate)};y.prototype=Object.create(T.prototype,{_processMetaSub:{value:function(e){var t=0;for(var n in e){var s=e[n],i=s.topic;if(\"fnd\"!=i&&\"me\"!=i){s.updated=new Date(s.updated),s.touched=s.touched?new Date(s.touched):null,s.deleted=s.deleted?new Date(s.deleted):null,s.seq=0|s.seq,s.recv=0|s.recv,s.read=0|s.read,s.unread=s.seq-s.read;var r=null;if(s.deleted)r=s,delete this._contacts[i];else if(s.seen&&s.seen.when&&(s.seen.when=new Date(s.seen.when)),r=p(this._contacts,i,s),\"p2p\"==w.topicType(i)&&this._cachePutUser(i,r),!s._generated){var o=this._tinode.getTopic(i);o&&o._processMetaDesc(s,!0)}t++,this.onMetaSub&&this.onMetaSub(r)}}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 M).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 M(e.dacs);if(!n||n.mode==M._INVALID)return void this._tinode.logger(\"Invalid access mode update\",e.src,e.dacs);if(n.mode==M._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 s in this._contacts)n.call(t,this._contacts[s],s,this._contacts)},enumerable:!0,configurable:!0,writable:!0},setMsgReadRecv:{value:function(e,t,n,s){var i,r=this._contacts[e],o=!1;if(r){switch(n|=0,t){case\"recv\":i=r.recv,r.recv=r.recv?Math.max(r.recv,n):n,o=i!=r.recv;break;case\"read\":i=r.read,r.read=r.read?Math.max(r.read,n):n,r.unread=r.seq-r.read,o=i!=r.read,r.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(D.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 s in this._contacts)n.call(t,this._contacts[s],s,this._contacts)},enumerable:!0,configurable:!0,writable:!0}}),D.prototype.constructor=D;var E=function(e){this._tinode=e,this._apiKey=e._apiKey,this._authToken=e.getAuthToken(),this._msgId=e.getNextUniqueId(),this.xhr=g(),this.toResolve=null,this.toReject=null,this.onProgress=null,this.onSuccess=null,this.onFailure=null};E.prototype={upload:function(e,t,n,s){var i=this;if(!this._authToken)throw new Error(\"Must authenticate first\");var o=this;this.xhr.open(\"POST\",\"/v\"+r+\"/file/u/\",!0),this.xhr.setRequestHeader(\"X-Tinode-APIKey\",this._apiKey),this.xhr.setRequestHeader(\"X-Tinode-Auth\",\"Token \"+this._authToken.token);var a=new Promise(function(e,t){i.toResolve=e,i.toReject=t});this.onProgress=t,this.onSuccess=n,this.onFailure=s,this.xhr.upload.onprogress=function(e){e.lengthComputable&&o.onProgress&&o.onProgress(e.loaded/e.total)},this.xhr.onload=function(){var e;try{e=JSON.parse(this.response,_)}catch(e){o._tinode.logger(\"Invalid server response in LargeFileHelper\",this.response)}this.status>=200&&this.status<300?(o.toResolve&&o.toResolve(e.ctrl.params.url),o.onSuccess&&o.onSuccess(e.ctrl)):this.status>=400?(o.toReject&&o.toReject(new Error(e.ctrl.text+\" (\"+e.ctrl.code+\")\")),o.onFailure&&o.onFailure(e.ctrl)):o._tinode.logger(\"Unexpected server response status\",this.status,this.response)},this.xhr.onerror=function(e){o.toReject&&o.toReject(new Error(\"failed\")),o.onFailure&&o.onFailure(null)},this.xhr.onabort=function(e){o.toReject&&o.toReject(new Error(\"upload cancelled by user\")),o.onFailure&&o.onFailure(null)};try{var c=new FormData;c.append(\"file\",e),c.set(\"id\",this._msgId),this.xhr.send(c)}catch(e){this.toReject&&this.toReject(e),this.onFailure&&this.onFailure(null)}return a},download:function(e,t,n,s){var i=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 r=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=s,this.xhr.onprogress=function(e){r.onProgress&&r.onProgress(e.loaded)};var o=new Promise(function(e,t){i.toResolve=e,i.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),r.toResolve&&r.toResolve()}else if(this.status>=400&&r.toReject){var s=new FileReader;s.onload=function(){try{var e=JSON.parse(this.result,_);r.toReject(new Error(e.ctrl.text+\" (\"+e.ctrl.code+\")\"))}catch(e){r._tinode.logger(\"Invalid server response in LargeFileHelper\",this.result),r.toReject(e)}},s.readAsText(this.response)}},this.xhr.onerror=function(e){r.toReject&&r.toReject(new Error(\"failed\"))},this.xhr.onabort=function(){r.toReject&&r.toReject(null)};try{this.xhr.send()}catch(e){this.toReject&&this.toReject(e)}return o},cancel:function(){this.xhr&&this.xhr.readyState<4&&this.xhr.abort()},getId:function(){return this._msgId}};var x=function e(t,n){this.status=e.STATUS_NONE,this.topic=t,this.content=n};x.STATUS_NONE=0,x.STATUS_QUEUED=1,x.STATUS_SENDING=2,x.STATUS_FAILED=3,x.STATUS_SENT=4,x.STATUS_RECEIVED=5,x.STATUS_READ=6,x.STATUS_TO_ME=7,(x.prototype={toJSON:function(){},fromJSON:function(e){}}).constructor=x,c.exports=w,c.exports.Drafty=e}.call(this,\"undefined\"!=typeof global?global:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{}),c=c.exports});\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webapp/node_modules/webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\")))\n\n//# sourceURL=webpack:///../tinode-js/umd/tinode.prod.js?");
+
+/***/ }),
+
+/***/ "./node_modules/react-intl/locale-data/ru.js":
+/*!***************************************************!*\
+ !*** ./node_modules/react-intl/locale-data/ru.js ***!
+ \***************************************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+eval("!function(e,a){ true?module.exports=a():undefined}(this,function(){\"use strict\";return[{locale:\"ru\",pluralRuleFunction:function(e,a){var t=String(e).split(\".\"),r=t[0],o=!t[1],n=r.slice(-1),l=r.slice(-2);return a?\"other\":o&&1==n&&11!=l?\"one\":o&&n>=2&&n<=4&&(l<12||l>14)?\"few\":o&&0==n||o&&n>=5&&n<=9||o&&l>=11&&l<=14?\"many\":\"other\"},fields:{year:{displayName:\"год\",relative:{0:\"в этом году\",1:\"в следующем году\",\"-1\":\"в прошлом году\"},relativeTime:{future:{one:\"через {0} год\",few:\"через {0} года\",many:\"через {0} лет\",other:\"через {0} года\"},past:{one:\"{0} год назад\",few:\"{0} года назад\",many:\"{0} лет назад\",other:\"{0} года назад\"}}},month:{displayName:\"месяц\",relative:{0:\"в этом месяце\",1:\"в следующем месяце\",\"-1\":\"в прошлом месяце\"},relativeTime:{future:{one:\"через {0} месяц\",few:\"через {0} месяца\",many:\"через {0} месяцев\",other:\"через {0} месяца\"},past:{one:\"{0} месяц назад\",few:\"{0} месяца назад\",many:\"{0} месяцев назад\",other:\"{0} месяца назад\"}}},day:{displayName:\"день\",relative:{0:\"сегодня\",1:\"завтра\",2:\"послезавтра\",\"-2\":\"позавчера\",\"-1\":\"вчера\"},relativeTime:{future:{one:\"через {0} день\",few:\"через {0} дня\",many:\"через {0} дней\",other:\"через {0} дня\"},past:{one:\"{0} день назад\",few:\"{0} дня назад\",many:\"{0} дней назад\",other:\"{0} дня назад\"}}},hour:{displayName:\"час\",relative:{0:\"в этом часе\"},relativeTime:{future:{one:\"через {0} час\",few:\"через {0} часа\",many:\"через {0} часов\",other:\"через {0} часа\"},past:{one:\"{0} час назад\",few:\"{0} часа назад\",many:\"{0} часов назад\",other:\"{0} часа назад\"}}},minute:{displayName:\"минута\",relative:{0:\"в эту минуту\"},relativeTime:{future:{one:\"через {0} минуту\",few:\"через {0} минуты\",many:\"через {0} минут\",other:\"через {0} минуты\"},past:{one:\"{0} минуту назад\",few:\"{0} минуты назад\",many:\"{0} минут назад\",other:\"{0} минуты назад\"}}},second:{displayName:\"секунда\",relative:{0:\"сейчас\"},relativeTime:{future:{one:\"через {0} секунду\",few:\"через {0} секунды\",many:\"через {0} секунд\",other:\"через {0} секунды\"},past:{one:\"{0} секунду назад\",few:\"{0} секунды назад\",many:\"{0} секунд назад\",other:\"{0} секунды назад\"}}}}},{locale:\"ru-BY\",parentLocale:\"ru\"},{locale:\"ru-KG\",parentLocale:\"ru\"},{locale:\"ru-KZ\",parentLocale:\"ru\"},{locale:\"ru-MD\",parentLocale:\"ru\"},{locale:\"ru-UA\",parentLocale:\"ru\"}]});\n\n\n//# sourceURL=webpack:///./node_modules/react-intl/locale-data/ru.js?");
+
+/***/ }),
+
+/***/ "./node_modules/webpack/buildin/global.js":
+/*!***********************************!*\
+ !*** (webpack)/buildin/global.js ***!
+ \***********************************/
+/*! no static exports found */
+/***/ (function(module, exports) {
+
+eval("var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || Function(\"return this\")() || (1, eval)(\"this\");\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === \"object\") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n\n\n//# sourceURL=webpack:///(webpack)/buildin/global.js?");
+
+/***/ }),
+
+/***/ "./src/config.js":
+/*!***********************!*\
+ !*** ./src/config.js ***!
+ \***********************/
+/*! exports provided: APP_NAME, API_KEY, KNOWN_HOSTS, DEFAULT_HOST, KEYPRESS_DELAY, RECEIVED_DELAY, READ_DELAY, MIN_TAG_LENGTH, MEDIA_BREAKPOINT, REM_SIZE, AVATAR_SIZE, MESSAGES_PAGE, MAX_INBAND_ATTACHMENT_SIZE, MAX_EXTERN_ATTACHMENT_SIZE, MAX_IMAGE_DIM */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
+
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"APP_NAME\", function() { return APP_NAME; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"API_KEY\", function() { return API_KEY; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"KNOWN_HOSTS\", function() { return KNOWN_HOSTS; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DEFAULT_HOST\", function() { return DEFAULT_HOST; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"KEYPRESS_DELAY\", function() { return KEYPRESS_DELAY; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RECEIVED_DELAY\", function() { return RECEIVED_DELAY; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"READ_DELAY\", function() { return READ_DELAY; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"MIN_TAG_LENGTH\", function() { return MIN_TAG_LENGTH; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"MEDIA_BREAKPOINT\", function() { return MEDIA_BREAKPOINT; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"REM_SIZE\", function() { return REM_SIZE; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"AVATAR_SIZE\", function() { return AVATAR_SIZE; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"MESSAGES_PAGE\", function() { return MESSAGES_PAGE; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"MAX_INBAND_ATTACHMENT_SIZE\", function() { return MAX_INBAND_ATTACHMENT_SIZE; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"MAX_EXTERN_ATTACHMENT_SIZE\", function() { return MAX_EXTERN_ATTACHMENT_SIZE; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"MAX_IMAGE_DIM\", function() { return MAX_IMAGE_DIM; });\n/* harmony import */ var _version_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./version.js */ \"./src/version.js\");\n\nvar APP_NAME = 'TinodeWeb/' + (_version_js__WEBPACK_IMPORTED_MODULE_0__[\"PACKAGE_VERSION\"] || '0.15');\nvar API_KEY = 'AQEAAAABAAD_rAp4DJh05a1HAwFT3A6K';\nvar KNOWN_HOSTS = {\n hosted: 'api.tinode.co',\n local: 'localhost:6060'\n};\nvar DEFAULT_HOST = KNOWN_HOSTS.hosted;\nvar KEYPRESS_DELAY = 3 * 1000;\nvar RECEIVED_DELAY = 500;\nvar READ_DELAY = 1000;\nvar MIN_TAG_LENGTH = 4;\nvar MEDIA_BREAKPOINT = 640;\nvar REM_SIZE = 13;\nvar AVATAR_SIZE = 128;\nvar MESSAGES_PAGE = 24;\nvar MAX_INBAND_ATTACHMENT_SIZE = 195840;\nvar MAX_EXTERN_ATTACHMENT_SIZE = 1 << 23;\nvar MAX_IMAGE_DIM = 768;\n\n//# sourceURL=webpack:///./src/config.js?");
+
+/***/ }),
+
+/***/ "./src/index.js":
+/*!**********************!*\
+ !*** ./src/index.js ***!
+ \**********************/
+/*! no exports provided */
+/***/ (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 */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-dom */ \"react-dom\");\n/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-intl */ \"react-intl\");\n/* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_intl__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var react_intl_locale_data_ru__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-intl/locale-data/ru */ \"./node_modules/react-intl/locale-data/ru.js\");\n/* harmony import */ var react_intl_locale_data_ru__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_intl_locale_data_ru__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _messages_json__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./messages.json */ \"./src/messages.json\");\nvar _messages_json__WEBPACK_IMPORTED_MODULE_4___namespace = /*#__PURE__*/__webpack_require__.t(/*! ./messages.json */ \"./src/messages.json\", 1);\n/* harmony import */ var _views_tinode_web_jsx__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./views/tinode-web.jsx */ \"./src/views/tinode-web.jsx\");\n/* harmony import */ var _lib_navigation_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./lib/navigation.js */ \"./src/lib/navigation.js\");\n\n\n\n\nObject(react_intl__WEBPACK_IMPORTED_MODULE_2__[\"addLocaleData\"])(react_intl_locale_data_ru__WEBPACK_IMPORTED_MODULE_3___default.a);\n\n\n\n\nvar _HashNavigation$parse = _lib_navigation_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"].parseUrlHash(window.location.hash),\n params = _HashNavigation$parse.params;\n\nvar language = params && params.hl || navigator.languages && navigator.languages[0] || navigator.language || navigator.userLanguage;\nvar baseLanguage = language.toLowerCase().split(/[-_]+/)[0];\nvar messages = _messages_json__WEBPACK_IMPORTED_MODULE_4__[language] || _messages_json__WEBPACK_IMPORTED_MODULE_4__[baseLanguage] || _messages_json__WEBPACK_IMPORTED_MODULE_4__.en;\nreact_dom__WEBPACK_IMPORTED_MODULE_1___default.a.render(react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_2__[\"IntlProvider\"], {\n locale: language,\n messages: messages,\n textComponent: react__WEBPACK_IMPORTED_MODULE_0___default.a.Fragment\n}, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_views_tinode_web_jsx__WEBPACK_IMPORTED_MODULE_5__[\"default\"], null)), document.getElementById('mountPoint'));\n\n//# sourceURL=webpack:///./src/index.js?");
+
+/***/ }),
+
+/***/ "./src/lib/blob-helpers.js":
+/*!*********************************!*\
+ !*** ./src/lib/blob-helpers.js ***!
+ \*********************************/
+/*! exports provided: SUPPORTED_IMAGE_FORMATS, MIME_EXTENSIONS, makeImageUrl, fitImageSize, fileNameForMime, imageFileScaledToBase64, imageFileToBase64, fileToBase64, filePasted, getMimeType, base64EncodedLen, base64DecodedLen, base64ReEncode */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
+
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"SUPPORTED_IMAGE_FORMATS\", function() { return SUPPORTED_IMAGE_FORMATS; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"MIME_EXTENSIONS\", function() { return MIME_EXTENSIONS; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"makeImageUrl\", function() { return makeImageUrl; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fitImageSize\", function() { return fitImageSize; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fileNameForMime\", function() { return fileNameForMime; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"imageFileScaledToBase64\", function() { return imageFileScaledToBase64; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"imageFileToBase64\", function() { return imageFileToBase64; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fileToBase64\", function() { return fileToBase64; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"filePasted\", function() { return filePasted; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getMimeType\", function() { return getMimeType; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"base64EncodedLen\", function() { return base64EncodedLen; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"base64DecodedLen\", function() { return base64DecodedLen; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"base64ReEncode\", function() { return base64ReEncode; });\n/* harmony import */ var _config_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../config.js */ \"./src/config.js\");\n\nvar SUPPORTED_IMAGE_FORMATS = ['image/jpeg', 'image/gif', 'image/png', 'image/svg', 'image/svg+xml'];\nvar MIME_EXTENSIONS = ['jpg', 'gif', 'png', 'svg', 'svg'];\nfunction makeImageUrl(photo) {\n return photo && photo.type && photo.data ? 'data:image/' + photo.type + ';base64,' + photo.data : null;\n}\nfunction fitImageSize(width, height, maxWidth, maxHeight, forceSquare) {\n if (!width || !height || !maxWidth || !maxHeight) {\n return null;\n }\n\n if (forceSquare) {\n maxWidth = maxHeight = Math.min(maxWidth, maxHeight);\n }\n\n var scale = Math.min(Math.min(width, maxWidth) / width, Math.min(height, maxHeight) / height);\n var size = {\n dstWidth: width * scale | 0,\n dstHeight: height * scale | 0\n };\n\n if (forceSquare) {\n size.dstWidth = size.dstHeight = Math.min(size.dstWidth, size.dstHeight);\n size.srcWidth = size.srcHeight = Math.min(width, height);\n size.xoffset = (width - size.srcWidth) / 2 | 0;\n size.yoffset = (height - size.srcWidth) / 2 | 0;\n } else {\n size.xoffset = size.yoffset = 0;\n size.srcWidth = width;\n size.srcHeight = height;\n }\n\n return size;\n}\nfunction fileNameForMime(fname, mime) {\n var idx = SUPPORTED_IMAGE_FORMATS.indexOf(mime);\n var ext = MIME_EXTENSIONS[idx];\n var at = fname.lastIndexOf('.');\n\n if (at >= 0) {\n fname = fname.substring(0, at);\n }\n\n return fname + '.' + ext;\n}\nfunction imageFileScaledToBase64(file, width, height, forceSquare, onSuccess, onError) {\n var img = new Image();\n img.crossOrigin = 'Anonymous';\n\n img.onerror = function (err) {\n onError(\"Image format unrecognized\");\n };\n\n img.onload = function () {\n var dim = fitImageSize(this.width, this.height, width, height, forceSquare);\n\n if (!dim) {\n onError(\"Invalid image\");\n return;\n }\n\n var canvas = document.createElement('canvas');\n canvas.width = dim.dstWidth;\n canvas.height = dim.dstHeight;\n var ctx = canvas.getContext('2d');\n ctx.imageSmoothingEnabled = true;\n ctx.drawImage(this, dim.xoffset, dim.yoffset, dim.srcWidth, dim.srcHeight, 0, 0, dim.dstWidth, dim.dstHeight);\n var mime = this.width != dim.dstWidth || this.height != dim.dstHeight || SUPPORTED_IMAGE_FORMATS.indexOf(file.type) < 0 ? 'image/jpeg' : file.type;\n var imageBits = canvas.toDataURL(mime);\n var parts = imageBits.split(',');\n mime = getMimeType(parts[0]);\n\n if (!mime) {\n onError(\"Unsupported image format\");\n return;\n }\n\n var quality = 0.78;\n\n if (base64DecodedLen(imageBits.length) > _config_js__WEBPACK_IMPORTED_MODULE_0__[\"MAX_INBAND_ATTACHMENT_SIZE\"]) {\n mime = 'image/jpeg';\n }\n\n if (mime == 'image/jpeg') {\n while (base64DecodedLen(imageBits.length) > _config_js__WEBPACK_IMPORTED_MODULE_0__[\"MAX_INBAND_ATTACHMENT_SIZE\"] && quality > 0.45) {\n imageBits = canvas.toDataURL(mime, quality);\n quality *= 0.84;\n }\n }\n\n if (base64DecodedLen(imageBits.length) > _config_js__WEBPACK_IMPORTED_MODULE_0__[\"MAX_INBAND_ATTACHMENT_SIZE\"]) {\n onError(\"The image size \" + bytesToHumanSize(base64DecodedLen(imageBits.length)) + \" exceeds the \" + bytesToHumanSize(_config_js__WEBPACK_IMPORTED_MODULE_0__[\"MAX_INBAND_ATTACHMENT_SIZE\"]) + \" limit.\", \"err\");\n return;\n }\n\n canvas = null;\n onSuccess(imageBits.split(',')[1], mime, dim.dstWidth, dim.dstHeight, fileNameForMime(file.name, mime));\n };\n\n img.src = URL.createObjectURL(file);\n}\nfunction imageFileToBase64(file, onSuccess, onError) {\n var reader = new FileReader();\n reader.addEventListener('load', function () {\n var parts = reader.result.split(',');\n var mime = getMimeType(parts[0]);\n\n if (!mime) {\n onError(\"Failed to process image file\");\n return;\n }\n\n var img = new Image();\n img.crossOrigin = 'Anonymous';\n\n img.onload = function () {\n onSuccess(parts[1], mime, this.width, this.height, fileNameForMime(file.name, mime));\n };\n\n img.onerror = function (err) {\n onError(\"Image format not recognized\");\n };\n\n img.src = URL.createObjectURL(file);\n }, false);\n reader.readAsDataURL(file);\n}\nfunction fileToBase64(file, onSuccess, onError) {\n var reader = new FileReader();\n reader.addEventListener('load', function () {\n onSuccess(file.type, reader.result.split(',')[1], file.name);\n });\n reader.readAsDataURL(file);\n}\nfunction filePasted(event, onImageSuccess, onAttachmentSuccess, onError) {\n var items = (event.clipboardData || event.originalEvent.clipboardData || {}).items;\n\n for (var i in items) {\n var item = items[i];\n\n if (item.kind === 'file') {\n var file = item.getAsFile();\n\n if (!file) {\n console.log(\"Failed to get file object from pasted file item\", item.kind, item.type);\n continue;\n }\n\n if (file.type && file.type.split('/')[0] == 'image') {\n if (file.size > _config_js__WEBPACK_IMPORTED_MODULE_0__[\"MAX_INBAND_ATTACHMENT_SIZE\"] || SUPPORTED_IMAGE_FORMATS.indexOf(file.type) < 0) {\n imageFileScaledToBase64(file, _config_js__WEBPACK_IMPORTED_MODULE_0__[\"MAX_IMAGE_DIM\"], _config_js__WEBPACK_IMPORTED_MODULE_0__[\"MAX_IMAGE_DIM\"], false, onImageSuccess, onError);\n } else {\n imageFileToBase64(file, onImageSuccess, onError);\n }\n } else {\n fileToBase64(file, onAttachmentSuccess, onError);\n }\n\n return true;\n }\n }\n\n return false;\n}\nfunction getMimeType(header) {\n var mime = /^data:(image\\/[-+a-z0-9.]+);base64/.exec(header);\n return mime && mime.length > 1 ? mime[1] : null;\n}\nfunction base64EncodedLen(n) {\n return Math.floor((n + 2) / 3) * 4;\n}\nfunction base64DecodedLen(n) {\n return Math.floor(n / 4) * 3;\n}\nfunction base64ReEncode(str) {\n if (str) {\n str = str.replace('-', '+').replace('_', '/');\n\n try {\n str = btoa(atob(str));\n } catch (err) {\n console.log(\"Failed to base64 re-encode string\");\n str = null;\n }\n }\n\n return str;\n}\n\n//# sourceURL=webpack:///./src/lib/blob-helpers.js?");
+
+/***/ }),
+
+/***/ "./src/lib/host-name.js":
+/*!******************************!*\
+ !*** ./src/lib/host-name.js ***!
+ \******************************/
+/*! exports provided: detectServerAddress, isSecureConnection, isLocalHost */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
+
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"detectServerAddress\", function() { return detectServerAddress; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isSecureConnection\", function() { return isSecureConnection; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isLocalHost\", function() { return isLocalHost; });\n/* harmony import */ var _config_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../config.js */ \"./src/config.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\n\nfunction detectServerAddress() {\n var host = _config_js__WEBPACK_IMPORTED_MODULE_0__[\"DEFAULT_HOST\"];\n\n if (_typeof(window.location) == 'object') {\n if (window.location.protocol == 'file:' || window.location.hostname == 'localhost') {\n host = _config_js__WEBPACK_IMPORTED_MODULE_0__[\"KNOWN_HOSTS\"].local;\n } else if (window.location.hostname) {\n host = window.location.hostname + (window.location.port ? ':' + window.location.port : '');\n }\n }\n\n return host;\n}\nfunction isSecureConnection() {\n if (_typeof(window.location) == 'object') {\n return window.location.protocol == 'https:';\n }\n\n return false;\n}\nfunction isLocalHost() {\n if (_typeof(window.location) == 'object') {\n return window.location.hostname == 'localhost';\n }\n\n return false;\n}\n\n//# sourceURL=webpack:///./src/lib/host-name.js?");
+
+/***/ }),
+
+/***/ "./src/lib/local-storage.js":
+/*!**********************************!*\
+ !*** ./src/lib/local-storage.js ***!
+ \**********************************/
+/*! exports provided: default */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
+
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return LocalStorageUtil; });\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\nvar LocalStorageUtil = function () {\n function LocalStorageUtil() {\n _classCallCheck(this, LocalStorageUtil);\n }\n\n _createClass(LocalStorageUtil, null, [{\n key: \"setObject\",\n value: function setObject(key, value) {\n localStorage.setItem(key, JSON.stringify(value));\n }\n }, {\n key: \"getObject\",\n value: function getObject(key) {\n var value = localStorage.getItem(key);\n return value && JSON.parse(value);\n }\n }, {\n key: \"updateObject\",\n value: function updateObject(key, value) {\n var oldVal = this.getObject(key);\n this.setObject(key, Object.assign(oldVal || {}, value));\n }\n }, {\n key: \"removeItem\",\n value: function removeItem(key) {\n localStorage.removeItem(key);\n }\n }]);\n\n return LocalStorageUtil;\n}();\n\n\n\n//# sourceURL=webpack:///./src/lib/local-storage.js?");
+
+/***/ }),
+
+/***/ "./src/lib/navigation.js":
+/*!*******************************!*\
+ !*** ./src/lib/navigation.js ***!
+ \*******************************/
+/*! exports provided: default */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
-Object.defineProperty(exports, '__esModule', { value: true });
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return HashNavigation; });\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\nvar HashNavigation = function () {\n function HashNavigation() {\n _classCallCheck(this, HashNavigation);\n }\n\n _createClass(HashNavigation, null, [{\n key: \"parseUrlHash\",\n value: function parseUrlHash(hash) {\n var parts = hash.split('?', 2);\n var params = {};\n var path = [];\n\n if (parts[0]) {\n path = parts[0].substr(1).split('/');\n }\n\n if (parts[1]) {\n parts[1].split('&').forEach(function (part) {\n var item = part.split('=');\n\n if (item[0]) {\n params[decodeURIComponent(item[0])] = decodeURIComponent(item[1]);\n }\n });\n }\n\n return {\n path: path,\n params: params\n };\n }\n }, {\n key: \"navigateTo\",\n value: function navigateTo(url) {\n window.location.hash = url;\n }\n }, {\n key: \"composeUrlHash\",\n value: function composeUrlHash(path, params) {\n var url = path.join('/');\n var args = [];\n\n for (var key in params) {\n if (params.hasOwnProperty(key)) {\n args.push(key + '=' + params[key]);\n }\n }\n\n if (args.length > 0) {\n url += '?' + args.join('&');\n }\n\n return url;\n }\n }, {\n key: \"addUrlParam\",\n value: function addUrlParam(hash, key, value) {\n var parsed = this.parseUrlHash(hash);\n parsed.params[key] = value;\n return this.composeUrlHash(parsed.path, parsed.params);\n }\n }, {\n key: \"removeUrlParam\",\n value: function removeUrlParam(hash, key) {\n var parsed = this.parseUrlHash(hash);\n delete parsed.params[key];\n return this.composeUrlHash(parsed.path, parsed.params);\n }\n }, {\n key: \"setUrlSidePanel\",\n value: function setUrlSidePanel(hash, sidepanel) {\n var parsed = this.parseUrlHash(hash);\n parsed.path[0] = sidepanel;\n return this.composeUrlHash(parsed.path, parsed.params);\n }\n }, {\n key: \"setUrlTopic\",\n value: function setUrlTopic(hash, topic) {\n var parsed = this.parseUrlHash(hash);\n parsed.path[1] = topic;\n delete parsed.params.info;\n return this.composeUrlHash(parsed.path, parsed.params);\n }\n }]);\n\n return HashNavigation;\n}();\n\n\n\n//# sourceURL=webpack:///./src/lib/navigation.js?");
-var util = require('@firebase/util');
+/***/ }),
-/**
- * Copyright 2017 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-var contains = function (obj, key) {
- return Object.prototype.hasOwnProperty.call(obj, key);
-};
-var DEFAULT_ENTRY_NAME = '[DEFAULT]';
-// An array to capture listeners before the true auth functions
-// exist
-var tokenListeners = [];
-/**
- * Global context object for a collection of services using
- * a shared authentication state.
- */
-var FirebaseAppImpl = /** @class */ (function () {
- function FirebaseAppImpl(options, config, firebase_) {
- this.firebase_ = firebase_;
- this.isDeleted_ = false;
- this.services_ = {};
- this.name_ = config.name;
- this._automaticDataCollectionEnabled =
- config.automaticDataCollectionEnabled || false;
- this.options_ = util.deepCopy(options);
- this.INTERNAL = {
- getUid: function () { return null; },
- getToken: function () { return Promise.resolve(null); },
- addAuthTokenListener: function (callback) {
- tokenListeners.push(callback);
- // Make sure callback is called, asynchronously, in the absence of the auth module
- setTimeout(function () { return callback(null); }, 0);
- },
- removeAuthTokenListener: function (callback) {
- tokenListeners = tokenListeners.filter(function (listener) { return listener !== callback; });
- }
- };
- }
- Object.defineProperty(FirebaseAppImpl.prototype, "automaticDataCollectionEnabled", {
- get: function () {
- this.checkDestroyed_();
- return this._automaticDataCollectionEnabled;
- },
- set: function (val) {
- this.checkDestroyed_();
- this._automaticDataCollectionEnabled = val;
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(FirebaseAppImpl.prototype, "name", {
- get: function () {
- this.checkDestroyed_();
- return this.name_;
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(FirebaseAppImpl.prototype, "options", {
- get: function () {
- this.checkDestroyed_();
- return this.options_;
- },
- enumerable: true,
- configurable: true
- });
- FirebaseAppImpl.prototype.delete = function () {
- var _this = this;
- return new Promise(function (resolve) {
- _this.checkDestroyed_();
- resolve();
- })
- .then(function () {
- _this.firebase_.INTERNAL.removeApp(_this.name_);
- var services = [];
- Object.keys(_this.services_).forEach(function (serviceKey) {
- Object.keys(_this.services_[serviceKey]).forEach(function (instanceKey) {
- services.push(_this.services_[serviceKey][instanceKey]);
- });
- });
- return Promise.all(services.map(function (service) {
- return service.INTERNAL.delete();
- }));
- })
- .then(function () {
- _this.isDeleted_ = true;
- _this.services_ = {};
- });
- };
- /**
- * Return a service instance associated with this app (creating it
- * on demand), identified by the passed instanceIdentifier.
- *
- * NOTE: Currently storage is the only one that is leveraging this
- * functionality. They invoke it by calling:
- *
- * ```javascript
- * firebase.app().storage('STORAGE BUCKET ID')
- * ```
- *
- * The service name is passed to this already
- * @internal
- */
- FirebaseAppImpl.prototype._getService = function (name, instanceIdentifier) {
- if (instanceIdentifier === void 0) { instanceIdentifier = DEFAULT_ENTRY_NAME; }
- this.checkDestroyed_();
- if (!this.services_[name]) {
- this.services_[name] = {};
- }
- if (!this.services_[name][instanceIdentifier]) {
- /**
- * If a custom instance has been defined (i.e. not '[DEFAULT]')
- * then we will pass that instance on, otherwise we pass `null`
- */
- var instanceSpecifier = instanceIdentifier !== DEFAULT_ENTRY_NAME
- ? instanceIdentifier
- : undefined;
- var service = this.firebase_.INTERNAL.factories[name](this, this.extendApp.bind(this), instanceSpecifier);
- this.services_[name][instanceIdentifier] = service;
- }
- return this.services_[name][instanceIdentifier];
- };
- /**
- * Callback function used to extend an App instance at the time
- * of service instance creation.
- */
- FirebaseAppImpl.prototype.extendApp = function (props) {
- var _this = this;
- // Copy the object onto the FirebaseAppImpl prototype
- util.deepExtend(this, props);
- /**
- * If the app has overwritten the addAuthTokenListener stub, forward
- * the active token listeners on to the true fxn.
- *
- * TODO: This function is required due to our current module
- * structure. Once we are able to rely strictly upon a single module
- * implementation, this code should be refactored and Auth should
- * provide these stubs and the upgrade logic
- */
- if (props.INTERNAL && props.INTERNAL.addAuthTokenListener) {
- tokenListeners.forEach(function (listener) {
- _this.INTERNAL.addAuthTokenListener(listener);
- });
- tokenListeners = [];
- }
- };
- /**
- * This function will throw an Error if the App has already been deleted -
- * use before performing API actions on the App.
- */
- FirebaseAppImpl.prototype.checkDestroyed_ = function () {
- if (this.isDeleted_) {
- error('app-deleted', { name: this.name_ });
- }
- };
- return FirebaseAppImpl;
-}());
-// Prevent dead-code elimination of these methods w/o invalid property
-// copying.
-(FirebaseAppImpl.prototype.name && FirebaseAppImpl.prototype.options) ||
- FirebaseAppImpl.prototype.delete ||
- console.log('dc');
-/**
- * Return a firebase namespace object.
- *
- * In production, this will be called exactly once and the result
- * assigned to the 'firebase' global. It may be called multiple times
- * in unit tests.
- */
-function createFirebaseNamespace() {
- var apps_ = {};
- var factories = {};
- var appHooks = {};
- // A namespace is a plain JavaScript Object.
- var namespace = {
- // Hack to prevent Babel from modifying the object returned
- // as the firebase namespace.
- __esModule: true,
- initializeApp: initializeApp,
- app: app,
- apps: null,
- Promise: Promise,
- SDK_VERSION: '5.5.0',
- INTERNAL: {
- registerService: registerService,
- createFirebaseNamespace: createFirebaseNamespace,
- extendNamespace: extendNamespace,
- createSubscribe: util.createSubscribe,
- ErrorFactory: util.ErrorFactory,
- removeApp: removeApp,
- factories: factories,
- useAsService: useAsService,
- Promise: Promise,
- deepExtend: util.deepExtend
- }
- };
- // Inject a circular default export to allow Babel users who were previously
- // using:
- //
- // import firebase from 'firebase';
- // which becomes: var firebase = require('firebase').default;
- //
- // instead of
- //
- // import * as firebase from 'firebase';
- // which becomes: var firebase = require('firebase');
- util.patchProperty(namespace, 'default', namespace);
- // firebase.apps is a read-only getter.
- Object.defineProperty(namespace, 'apps', {
- get: getApps
- });
- /**
- * Called by App.delete() - but before any services associated with the App
- * are deleted.
- */
- function removeApp(name) {
- var app = apps_[name];
- callAppHooks(app, 'delete');
- delete apps_[name];
- }
- /**
- * Get the App object for a given name (or DEFAULT).
- */
- function app(name) {
- name = name || DEFAULT_ENTRY_NAME;
- if (!contains(apps_, name)) {
- error('no-app', { name: name });
- }
- return apps_[name];
- }
- util.patchProperty(app, 'App', FirebaseAppImpl);
- function initializeApp(options, rawConfig) {
- if (rawConfig === void 0) { rawConfig = {}; }
- if (typeof rawConfig !== 'object' || rawConfig === null) {
- var name_1 = rawConfig;
- rawConfig = { name: name_1 };
- }
- var config = rawConfig;
- if (config.name === undefined) {
- config.name = DEFAULT_ENTRY_NAME;
- }
- var name = config.name;
- if (typeof name !== 'string' || !name) {
- error('bad-app-name', { name: name + '' });
- }
- if (contains(apps_, name)) {
- error('duplicate-app', { name: name });
- }
- var app = new FirebaseAppImpl(options, config, namespace);
- apps_[name] = app;
- callAppHooks(app, 'create');
- return app;
- }
- /*
- * Return an array of all the non-deleted FirebaseApps.
- */
- function getApps() {
- // Make a copy so caller cannot mutate the apps list.
- return Object.keys(apps_).map(function (name) { return apps_[name]; });
- }
- /*
- * Register a Firebase Service.
- *
- * firebase.INTERNAL.registerService()
- *
- * TODO: Implement serviceProperties.
- */
- function registerService(name, createService, serviceProperties, appHook, allowMultipleInstances) {
- // Cannot re-register a service that already exists
- if (factories[name]) {
- error('duplicate-service', { name: name });
- }
- // Capture the service factory for later service instantiation
- factories[name] = createService;
- // Capture the appHook, if passed
- if (appHook) {
- appHooks[name] = appHook;
- // Run the **new** app hook on all existing apps
- getApps().forEach(function (app) {
- appHook('create', app);
- });
- }
- // The Service namespace is an accessor function ...
- var serviceNamespace = function (appArg) {
- if (appArg === void 0) { appArg = app(); }
- if (typeof appArg[name] !== 'function') {
- // Invalid argument.
- // This happens in the following case: firebase.storage('gs:/')
- error('invalid-app-argument', { name: name });
- }
- // Forward service instance lookup to the FirebaseApp.
- return appArg[name]();
- };
- // ... and a container for service-level properties.
- if (serviceProperties !== undefined) {
- util.deepExtend(serviceNamespace, serviceProperties);
- }
- // Monkey-patch the serviceNamespace onto the firebase namespace
- namespace[name] = serviceNamespace;
- // Patch the FirebaseAppImpl prototype
- FirebaseAppImpl.prototype[name] = function () {
- var args = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- args[_i] = arguments[_i];
- }
- var serviceFxn = this._getService.bind(this, name);
- return serviceFxn.apply(this, allowMultipleInstances ? args : []);
- };
- return serviceNamespace;
- }
- /**
- * Patch the top-level firebase namespace with additional properties.
- *
- * firebase.INTERNAL.extendNamespace()
- */
- function extendNamespace(props) {
- util.deepExtend(namespace, props);
- }
- function callAppHooks(app, eventName) {
- Object.keys(factories).forEach(function (serviceName) {
- // Ignore virtual services
- var factoryName = useAsService(app, serviceName);
- if (factoryName === null) {
- return;
- }
- if (appHooks[factoryName]) {
- appHooks[factoryName](eventName, app);
- }
- });
- }
- // Map the requested service to a registered service name
- // (used to map auth to serverAuth service when needed).
- function useAsService(app, name) {
- if (name === 'serverAuth') {
- return null;
- }
- var useService = name;
- var options = app.options;
- return useService;
- }
- return namespace;
-}
-function error(code, args) {
- throw appErrors.create(code, args);
-}
-// TypeScript does not support non-string indexes!
-// let errors: {[code: AppError: string} = {
-var errors = {
- '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.'
-};
-var appErrors = new util.ErrorFactory('app', 'Firebase', errors);
+/***/ "./src/lib/strformat.js":
+/*!******************************!*\
+ !*** ./src/lib/strformat.js ***!
+ \******************************/
+/*! exports provided: shortDateFormat, bytesToHumanSize, stringHash */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
-/**
- * Copyright 2017 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-var firebase = createFirebaseNamespace();
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"shortDateFormat\", function() { return shortDateFormat; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"bytesToHumanSize\", function() { return bytesToHumanSize; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"stringHash\", function() { return stringHash; });\nfunction shortDateFormat(then) {\n var locale = window.navigator.userLanguage || window.navigator.language;\n var now = new Date();\n\n if (then.getFullYear() == now.getFullYear()) {\n if (then.getMonth() == now.getMonth() && then.getDate() == now.getDate()) {\n return then.toLocaleTimeString(locale, {\n hour12: false,\n hour: '2-digit',\n minute: '2-digit'\n });\n } else {\n return then.toLocaleDateString(locale, {\n hour12: false,\n month: 'short',\n day: 'numeric',\n hour: '2-digit',\n minute: '2-digit'\n });\n }\n }\n\n return then.toLocaleDateString(locale, {\n hour12: false,\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n hour: '2-digit',\n minute: '2-digit'\n });\n}\nfunction bytesToHumanSize(bytes) {\n if (!bytes || bytes == 0) {\n return '0 Bytes';\n }\n\n var sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB'];\n var bucket = Math.min(Math.floor(Math.log2(bytes) / 10) | 0, sizes.length - 1);\n var count = bytes / Math.pow(1024, bucket);\n var round = bucket > 0 ? count < 3 ? 2 : count < 30 ? 1 : 0 : 0;\n return count.toFixed(round) + ' ' + sizes[bucket];\n}\nfunction stringHash(value) {\n var hash = 0;\n value = '' + value;\n\n for (var i = 0; i < value.length; i++) {\n hash = (hash << 5) - hash + value.charCodeAt(i);\n hash = hash & hash;\n }\n\n return hash;\n}\n\n//# sourceURL=webpack:///./src/lib/strformat.js?");
-exports.firebase = firebase;
-exports.default = firebase;
+/***/ }),
-},{"@firebase/util":5}],2:[function(require,module,exports){
-'use strict';
+/***/ "./src/lib/utils.js":
+/*!**************************!*\
+ !*** ./src/lib/utils.js ***!
+ \**************************/
+/*! exports provided: updateFavicon, vcard, arrayEqual */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
-Object.defineProperty(exports, '__esModule', { value: true });
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"updateFavicon\", function() { return updateFavicon; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"vcard\", function() { return vcard; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"arrayEqual\", function() { return arrayEqual; });\nfunction updateFavicon(count) {\n var oldIcon = document.getElementById('shortcut-icon');\n\n if (oldIcon) {\n var head = document.head || document.getElementsByTagName('head')[0];\n var newIcon = document.createElement('link');\n newIcon.type = 'image/png';\n newIcon.id = 'shortcut-icon';\n newIcon.rel = 'shortcut icon';\n newIcon.href = 'img/logo32x32' + (count > 0 ? 'a' : '') + '.png';\n head.removeChild(oldIcon);\n head.appendChild(newIcon);\n }\n\n document.title = (count > 0 ? '(' + count + ') ' : '') + 'Tinode';\n}\nfunction vcard(fn, imageDataUrl) {\n var card = null;\n\n if (fn && fn.trim() || imageDataUrl) {\n card = {};\n\n if (fn) {\n card.fn = fn.trim();\n }\n\n if (imageDataUrl) {\n var dataStart = imageDataUrl.indexOf(',');\n card.photo = {\n data: imageDataUrl.substring(dataStart + 1),\n type: 'jpg'\n };\n }\n }\n\n return card;\n}\nfunction arrayEqual(a, b) {\n if (a.length != b.length) {\n return false;\n }\n\n a.sort();\n b.sort();\n\n for (var i = 0, l = a.length; i < l; i++) {\n if (a[i] !== b[i]) {\n return false;\n }\n }\n\n return true;\n}\n\n//# sourceURL=webpack:///./src/lib/utils.js?");
-function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
+/***/ }),
-var util = require('@firebase/util');
-var tslib_1 = require('tslib');
-var firebase = _interopDefault(require('@firebase/app'));
+/***/ "./src/messages.json":
+/*!***************************!*\
+ !*** ./src/messages.json ***!
+ \***************************/
+/*! exports provided: en, ru, default */
+/***/ (function(module) {
-/**
- * Copyright 2018 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
+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?");
-/**
- * Copyright 2017 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-var ERROR_CODES = {
- AVAILABLE_IN_WINDOW: 'only-available-in-window',
- AVAILABLE_IN_SW: 'only-available-in-sw',
- SHOULD_BE_INHERITED: 'should-be-overriden',
- BAD_SENDER_ID: 'bad-sender-id',
- INCORRECT_GCM_SENDER_ID: 'incorrect-gcm-sender-id',
- PERMISSION_DEFAULT: 'permission-default',
- PERMISSION_BLOCKED: 'permission-blocked',
- UNSUPPORTED_BROWSER: 'unsupported-browser',
- NOTIFICATIONS_BLOCKED: 'notifications-blocked',
- FAILED_DEFAULT_REGISTRATION: 'failed-serviceworker-registration',
- SW_REGISTRATION_EXPECTED: 'sw-registration-expected',
- GET_SUBSCRIPTION_FAILED: 'get-subscription-failed',
- INVALID_SAVED_TOKEN: 'invalid-saved-token',
- SW_REG_REDUNDANT: 'sw-reg-redundant',
- TOKEN_SUBSCRIBE_FAILED: 'token-subscribe-failed',
- TOKEN_SUBSCRIBE_NO_TOKEN: 'token-subscribe-no-token',
- TOKEN_SUBSCRIBE_NO_PUSH_SET: 'token-subscribe-no-push-set',
- TOKEN_UNSUBSCRIBE_FAILED: 'token-unsubscribe-failed',
- TOKEN_UPDATE_FAILED: 'token-update-failed',
- TOKEN_UPDATE_NO_TOKEN: 'token-update-no-token',
- USE_SW_BEFORE_GET_TOKEN: 'use-sw-before-get-token',
- INVALID_DELETE_TOKEN: 'invalid-delete-token',
- DELETE_TOKEN_NOT_FOUND: 'delete-token-not-found',
- DELETE_SCOPE_NOT_FOUND: 'delete-scope-not-found',
- BG_HANDLER_FUNCTION_EXPECTED: 'bg-handler-function-expected',
- NO_WINDOW_CLIENT_TO_MSG: 'no-window-client-to-msg',
- UNABLE_TO_RESUBSCRIBE: 'unable-to-resubscribe',
- NO_FCM_TOKEN_FOR_RESUBSCRIBE: 'no-fcm-token-for-resubscribe',
- FAILED_TO_DELETE_TOKEN: 'failed-to-delete-token',
- NO_SW_IN_REG: 'no-sw-in-reg',
- BAD_SCOPE: 'bad-scope',
- BAD_VAPID_KEY: 'bad-vapid-key',
- BAD_SUBSCRIPTION: 'bad-subscription',
- BAD_TOKEN: 'bad-token',
- BAD_PUSH_SET: 'bad-push-set',
- FAILED_DELETE_VAPID_KEY: 'failed-delete-vapid-key',
- INVALID_PUBLIC_VAPID_KEY: 'invalid-public-vapid-key',
- USE_PUBLIC_KEY_BEFORE_GET_TOKEN: 'use-public-key-before-get-token',
- PUBLIC_KEY_DECRYPTION_FAILED: 'public-vapid-key-decryption-failed'
-};
-var ERROR_MAP = (_a = {}, _a[ERROR_CODES.AVAILABLE_IN_WINDOW] = 'This method is available in a Window context.', _a[ERROR_CODES.AVAILABLE_IN_SW] = 'This method is available in a service worker ' + 'context.', _a[ERROR_CODES.SHOULD_BE_INHERITED] = 'This method should be overriden by ' + 'extended classes.', _a[ERROR_CODES.BAD_SENDER_ID] = "Please ensure that 'messagingSenderId' is set " +
- 'correctly in the options passed into firebase.initializeApp().', _a[ERROR_CODES.PERMISSION_DEFAULT] = 'The required permissions were not granted and ' + 'dismissed instead.', _a[ERROR_CODES.PERMISSION_BLOCKED] = 'The required permissions were not granted and ' + 'blocked instead.', _a[ERROR_CODES.UNSUPPORTED_BROWSER] = "This browser doesn't support the API's " +
- 'required to use the firebase SDK.', _a[ERROR_CODES.NOTIFICATIONS_BLOCKED] = 'Notifications have been blocked.', _a[ERROR_CODES.FAILED_DEFAULT_REGISTRATION] = 'We are unable to register the ' +
- 'default service worker. {$browserErrorMessage}', _a[ERROR_CODES.SW_REGISTRATION_EXPECTED] = 'A service worker registration was the ' + 'expected input.', _a[ERROR_CODES.GET_SUBSCRIPTION_FAILED] = 'There was an error when trying to get ' +
- 'any existing Push Subscriptions.', _a[ERROR_CODES.INVALID_SAVED_TOKEN] = 'Unable to access details of the saved token.', _a[ERROR_CODES.SW_REG_REDUNDANT] = 'The service worker being used for push was made ' + 'redundant.', _a[ERROR_CODES.TOKEN_SUBSCRIBE_FAILED] = 'A problem occured while subscribing the ' + 'user to FCM: {$message}', _a[ERROR_CODES.TOKEN_SUBSCRIBE_NO_TOKEN] = 'FCM returned no token when subscribing ' + 'the user to push.', _a[ERROR_CODES.TOKEN_SUBSCRIBE_NO_PUSH_SET] = 'FCM returned an invalid response ' + 'when getting an FCM token.', _a[ERROR_CODES.TOKEN_UNSUBSCRIBE_FAILED] = 'A problem occured while unsubscribing the ' + 'user from FCM: {$message}', _a[ERROR_CODES.TOKEN_UPDATE_FAILED] = 'A problem occured while updating the ' + 'user from FCM: {$message}', _a[ERROR_CODES.TOKEN_UPDATE_NO_TOKEN] = 'FCM returned no token when updating ' + 'the user to push.', _a[ERROR_CODES.USE_SW_BEFORE_GET_TOKEN] = 'The useServiceWorker() method may only be called once and must be ' +
- 'called before calling getToken() to ensure your service worker is used.', _a[ERROR_CODES.INVALID_DELETE_TOKEN] = 'You must pass a valid token into ' +
- 'deleteToken(), i.e. the token from getToken().', _a[ERROR_CODES.DELETE_TOKEN_NOT_FOUND] = 'The deletion attempt for token could not ' +
- 'be performed as the token was not found.', _a[ERROR_CODES.DELETE_SCOPE_NOT_FOUND] = 'The deletion attempt for service worker ' +
- 'scope could not be performed as the scope was not found.', _a[ERROR_CODES.BG_HANDLER_FUNCTION_EXPECTED] = 'The input to ' + 'setBackgroundMessageHandler() must be a function.', _a[ERROR_CODES.NO_WINDOW_CLIENT_TO_MSG] = 'An attempt was made to message a ' + 'non-existant window client.', _a[ERROR_CODES.UNABLE_TO_RESUBSCRIBE] = 'There was an error while re-subscribing ' +
- 'the FCM token for push messaging. Will have to resubscribe the ' +
- 'user on next visit. {$message}', _a[ERROR_CODES.NO_FCM_TOKEN_FOR_RESUBSCRIBE] = 'Could not find an FCM token ' +
- 'and as a result, unable to resubscribe. Will have to resubscribe the ' +
- 'user on next visit.', _a[ERROR_CODES.FAILED_TO_DELETE_TOKEN] = 'Unable to delete the currently saved token.', _a[ERROR_CODES.NO_SW_IN_REG] = 'Even though the service worker registration was ' +
- 'successful, there was a problem accessing the service worker itself.', _a[ERROR_CODES.INCORRECT_GCM_SENDER_ID] = "Please change your web app manifest's " +
- "'gcm_sender_id' value to '103953800507' to use Firebase messaging.", _a[ERROR_CODES.BAD_SCOPE] = 'The service worker scope must be a string with at ' +
- 'least one character.', _a[ERROR_CODES.BAD_VAPID_KEY] = 'The public VAPID key is not a Uint8Array with 65 bytes.', _a[ERROR_CODES.BAD_SUBSCRIPTION] = 'The subscription must be a valid ' + 'PushSubscription.', _a[ERROR_CODES.BAD_TOKEN] = 'The FCM Token used for storage / lookup was not ' +
- 'a valid token string.', _a[ERROR_CODES.BAD_PUSH_SET] = 'The FCM push set used for storage / lookup was not ' +
- 'not a valid push set string.', _a[ERROR_CODES.FAILED_DELETE_VAPID_KEY] = 'The VAPID key could not be deleted.', _a[ERROR_CODES.INVALID_PUBLIC_VAPID_KEY] = 'The public VAPID key must be a string.', _a[ERROR_CODES.PUBLIC_KEY_DECRYPTION_FAILED] = 'The public VAPID key did not equal ' + '65 bytes when decrypted.', _a);
-var errorFactory = new util.ErrorFactory('messaging', 'Messaging', ERROR_MAP);
-var _a;
+/***/ }),
-/**
- * Copyright 2017 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-var DEFAULT_PUBLIC_VAPID_KEY = new Uint8Array([
- 0x04,
- 0x33,
- 0x94,
- 0xf7,
- 0xdf,
- 0xa1,
- 0xeb,
- 0xb1,
- 0xdc,
- 0x03,
- 0xa2,
- 0x5e,
- 0x15,
- 0x71,
- 0xdb,
- 0x48,
- 0xd3,
- 0x2e,
- 0xed,
- 0xed,
- 0xb2,
- 0x34,
- 0xdb,
- 0xb7,
- 0x47,
- 0x3a,
- 0x0c,
- 0x8f,
- 0xc4,
- 0xcc,
- 0xe1,
- 0x6f,
- 0x3c,
- 0x8c,
- 0x84,
- 0xdf,
- 0xab,
- 0xb6,
- 0x66,
- 0x3e,
- 0xf2,
- 0x0c,
- 0xd4,
- 0x8b,
- 0xfe,
- 0xe3,
- 0xf9,
- 0x76,
- 0x2f,
- 0x14,
- 0x1c,
- 0x63,
- 0x08,
- 0x6a,
- 0x6f,
- 0x2d,
- 0xb1,
- 0x1a,
- 0x95,
- 0xb0,
- 0xce,
- 0x37,
- 0xc0,
- 0x9c,
- 0x6e
-]);
-var ENDPOINT = 'https://fcm.googleapis.com';
+/***/ "./src/version.js":
+/*!************************!*\
+ !*** ./src/version.js ***!
+ \************************/
+/*! exports provided: PACKAGE_VERSION */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
-/**
- * Copyright 2017 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-var MessageParameter;
-(function (MessageParameter) {
- MessageParameter["TYPE_OF_MSG"] = "firebase-messaging-msg-type";
- MessageParameter["DATA"] = "firebase-messaging-msg-data";
-})(MessageParameter || (MessageParameter = {}));
-var MessageType;
-(function (MessageType) {
- MessageType["PUSH_MSG_RECEIVED"] = "push-msg-received";
- MessageType["NOTIFICATION_CLICKED"] = "notification-clicked";
-})(MessageType || (MessageType = {}));
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PACKAGE_VERSION\", function() { return PACKAGE_VERSION; });\nvar PACKAGE_VERSION = \"0.15.9-rc1\";\n\n//# sourceURL=webpack:///./src/version.js?");
-/**
- * Copyright 2018 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-function isArrayBufferEqual(a, b) {
- if (a == null || b == null) {
- return false;
- }
- if (a === b) {
- return true;
- }
- if (a.byteLength !== b.byteLength) {
- return false;
- }
- var viewA = new DataView(a);
- var viewB = new DataView(b);
- for (var i = 0; i < a.byteLength; i++) {
- if (viewA.getUint8(i) !== viewB.getUint8(i)) {
- return false;
- }
- }
- return true;
-}
+/***/ }),
-/**
- * Copyright 2017 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-function toBase64(arrayBuffer) {
- var uint8Version = new Uint8Array(arrayBuffer);
- return btoa(String.fromCharCode.apply(null, uint8Version));
-}
-function arrayBufferToBase64(arrayBuffer) {
- var base64String = toBase64(arrayBuffer);
- return base64String
- .replace(/=/g, '')
- .replace(/\+/g, '-')
- .replace(/\//g, '_');
-}
+/***/ "./src/views/contacts-view.jsx":
+/*!*************************************!*\
+ !*** ./src/views/contacts-view.jsx ***!
+ \*************************************/
+/*! exports provided: default */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
-/**
- * Copyright 2017 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-var IidModel = /** @class */ (function () {
- function IidModel() {
- }
- IidModel.prototype.getToken = function (senderId, subscription, publicVapidKey) {
- return tslib_1.__awaiter(this, void 0, void 0, function () {
- var p256dh, auth, fcmSubscribeBody, applicationPubKey, headers, subscribeOptions, responseData, response, err_1, message;
- return tslib_1.__generator(this, function (_a) {
- switch (_a.label) {
- case 0:
- p256dh = arrayBufferToBase64(subscription.getKey('p256dh'));
- auth = arrayBufferToBase64(subscription.getKey('auth'));
- fcmSubscribeBody = "authorized_entity=" + senderId + "&" +
- ("endpoint=" + subscription.endpoint + "&") +
- ("encryption_key=" + p256dh + "&") +
- ("encryption_auth=" + auth);
- if (!isArrayBufferEqual(publicVapidKey.buffer, DEFAULT_PUBLIC_VAPID_KEY.buffer)) {
- applicationPubKey = arrayBufferToBase64(publicVapidKey);
- fcmSubscribeBody += "&application_pub_key=" + applicationPubKey;
- }
- headers = new Headers();
- headers.append('Content-Type', 'application/x-www-form-urlencoded');
- subscribeOptions = {
- method: 'POST',
- headers: headers,
- body: fcmSubscribeBody
- };
- _a.label = 1;
- case 1:
- _a.trys.push([1, 4, , 5]);
- return [4 /*yield*/, fetch(ENDPOINT + '/fcm/connect/subscribe', subscribeOptions)];
- case 2:
- response = _a.sent();
- return [4 /*yield*/, response.json()];
- case 3:
- responseData = _a.sent();
- return [3 /*break*/, 5];
- case 4:
- err_1 = _a.sent();
- throw errorFactory.create(ERROR_CODES.TOKEN_SUBSCRIBE_FAILED);
- case 5:
- if (responseData.error) {
- message = responseData.error.message;
- throw errorFactory.create(ERROR_CODES.TOKEN_SUBSCRIBE_FAILED, {
- message: message
- });
- }
- if (!responseData.token) {
- throw errorFactory.create(ERROR_CODES.TOKEN_SUBSCRIBE_NO_TOKEN);
- }
- if (!responseData.pushSet) {
- throw errorFactory.create(ERROR_CODES.TOKEN_SUBSCRIBE_NO_PUSH_SET);
- }
- return [2 /*return*/, {
- token: responseData.token,
- pushSet: responseData.pushSet
- }];
- }
- });
- });
- };
- /**
- * Update the underlying token details for fcmToken.
- */
- IidModel.prototype.updateToken = function (senderId, fcmToken, fcmPushSet, subscription, publicVapidKey) {
- return tslib_1.__awaiter(this, void 0, void 0, function () {
- var p256dh, auth, fcmUpdateBody, applicationPubKey, headers, updateOptions, responseData, response, err_2, message;
- return tslib_1.__generator(this, function (_a) {
- switch (_a.label) {
- case 0:
- p256dh = arrayBufferToBase64(subscription.getKey('p256dh'));
- auth = arrayBufferToBase64(subscription.getKey('auth'));
- fcmUpdateBody = "push_set=" + fcmPushSet + "&" +
- ("token=" + fcmToken + "&") +
- ("authorized_entity=" + senderId + "&") +
- ("endpoint=" + subscription.endpoint + "&") +
- ("encryption_key=" + p256dh + "&") +
- ("encryption_auth=" + auth);
- if (!isArrayBufferEqual(publicVapidKey.buffer, DEFAULT_PUBLIC_VAPID_KEY.buffer)) {
- applicationPubKey = arrayBufferToBase64(publicVapidKey);
- fcmUpdateBody += "&application_pub_key=" + applicationPubKey;
- }
- headers = new Headers();
- headers.append('Content-Type', 'application/x-www-form-urlencoded');
- updateOptions = {
- method: 'POST',
- headers: headers,
- body: fcmUpdateBody
- };
- _a.label = 1;
- case 1:
- _a.trys.push([1, 4, , 5]);
- return [4 /*yield*/, fetch(ENDPOINT + '/fcm/connect/subscribe', updateOptions)];
- case 2:
- response = _a.sent();
- return [4 /*yield*/, response.json()];
- case 3:
- responseData = _a.sent();
- return [3 /*break*/, 5];
- case 4:
- err_2 = _a.sent();
- throw errorFactory.create(ERROR_CODES.TOKEN_UPDATE_FAILED);
- case 5:
- if (responseData.error) {
- message = responseData.error.message;
- throw errorFactory.create(ERROR_CODES.TOKEN_UPDATE_FAILED, {
- message: message
- });
- }
- if (!responseData.token) {
- throw errorFactory.create(ERROR_CODES.TOKEN_UPDATE_NO_TOKEN);
- }
- return [2 /*return*/, responseData.token];
- }
- });
- });
- };
- /**
- * Given a fcmToken, pushSet and messagingSenderId, delete an FCM token.
- */
- IidModel.prototype.deleteToken = function (senderId, fcmToken, fcmPushSet) {
- return tslib_1.__awaiter(this, void 0, void 0, function () {
- var fcmUnsubscribeBody, headers, unsubscribeOptions, response, responseData, message, err_3;
- return tslib_1.__generator(this, function (_a) {
- switch (_a.label) {
- case 0:
- fcmUnsubscribeBody = "authorized_entity=" + senderId + "&" +
- ("token=" + fcmToken + "&") +
- ("pushSet=" + fcmPushSet);
- headers = new Headers();
- headers.append('Content-Type', 'application/x-www-form-urlencoded');
- unsubscribeOptions = {
- method: 'POST',
- headers: headers,
- body: fcmUnsubscribeBody
- };
- _a.label = 1;
- case 1:
- _a.trys.push([1, 4, , 5]);
- return [4 /*yield*/, fetch(ENDPOINT + '/fcm/connect/unsubscribe', unsubscribeOptions)];
- case 2:
- response = _a.sent();
- return [4 /*yield*/, response.json()];
- case 3:
- responseData = _a.sent();
- if (responseData.error) {
- message = responseData.error.message;
- throw errorFactory.create(ERROR_CODES.TOKEN_UNSUBSCRIBE_FAILED, {
- message: message
- });
- }
- return [3 /*break*/, 5];
- case 4:
- err_3 = _a.sent();
- throw errorFactory.create(ERROR_CODES.TOKEN_UNSUBSCRIBE_FAILED);
- case 5: return [2 /*return*/];
- }
- });
- });
- };
- return IidModel;
-}());
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-intl */ \"react-intl\");\n/* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_intl__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _widgets_contact_list_jsx__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../widgets/contact-list.jsx */ \"./src/widgets/contact-list.jsx\");\n/* harmony import */ var _lib_utils_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../lib/utils.js */ \"./src/lib/utils.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 'contacts_not_found': {\n \"id\": \"contacts_not_found\",\n \"defaultMessage\": \"You have no chats \\xAF\\\\\\\\_(\\u30C4)_/\\xAF\"\n }\n});\n\nvar ContactsView = function (_React$Component) {\n _inherits(ContactsView, _React$Component);\n\n function ContactsView(props) {\n var _this;\n\n _classCallCheck(this, ContactsView);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(ContactsView).call(this, props));\n _this.state = ContactsView.getDerivedStateFromProps(props, {});\n return _this;\n }\n\n _createClass(ContactsView, [{\n key: \"render\",\n value: function render() {\n var formatHTMLMessage = this.props.intl.formatHTMLMessage;\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_widgets_contact_list_jsx__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n connected: this.props.connected,\n contacts: this.state.contactList,\n emptyListMessage: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", null, formatHTMLMessage(messages.contacts_not_found)),\n topicSelected: this.props.topicSelected,\n myUserId: this.props.myUserId,\n showOnline: true,\n showUnread: true,\n onTopicSelected: this.props.onTopicSelected,\n showContextMenu: this.props.showContextMenu\n });\n }\n }], [{\n key: \"getDerivedStateFromProps\",\n value: function getDerivedStateFromProps(nextProps, prevState) {\n var contacts = [];\n var unreadThreads = 0;\n nextProps.chatList.map(function (c) {\n unreadThreads += c.unread > 0 ? 1 : 0;\n contacts.push(c);\n });\n contacts.sort(function (a, b) {\n return (b.touched || 0) - (a.touched || 0);\n });\n Object(_lib_utils_js__WEBPACK_IMPORTED_MODULE_3__[\"updateFavicon\"])(unreadThreads);\n return {\n contactList: contacts\n };\n }\n }]);\n\n return ContactsView;\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\"])(ContactsView));\n\n//# sourceURL=webpack:///./src/views/contacts-view.jsx?");
-/**
- * Copyright 2017 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-function base64ToArrayBuffer(base64String) {
- var padding = '='.repeat((4 - base64String.length % 4) % 4);
- var base64 = (base64String + padding)
- .replace(/\-/g, '+')
- .replace(/_/g, '/');
- var rawData = atob(base64);
- var outputArray = new Uint8Array(rawData.length);
- for (var i = 0; i < rawData.length; ++i) {
- outputArray[i] = rawData.charCodeAt(i);
- }
- return outputArray;
-}
+/***/ }),
-/**
- * Copyright 2017 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-var OLD_DB_NAME = 'undefined';
-var OLD_OBJECT_STORE_NAME = 'fcm_token_object_Store';
-function handleDb(db) {
- if (!db.objectStoreNames.contains(OLD_OBJECT_STORE_NAME)) {
- // We found a database with the name 'undefined', but our expected object
- // store isn't defined.
- return;
- }
- var transaction = db.transaction(OLD_OBJECT_STORE_NAME);
- var objectStore = transaction.objectStore(OLD_OBJECT_STORE_NAME);
- var iidModel = new IidModel();
- var openCursorRequest = objectStore.openCursor();
- openCursorRequest.onerror = function (event) {
- // NOOP - Nothing we can do.
- console.warn('Unable to cleanup old IDB.', event);
- };
- openCursorRequest.onsuccess = function () {
- var cursor = openCursorRequest.result;
- if (cursor) {
- // cursor.value contains the current record being iterated through
- // this is where you'd do something with the result
- var tokenDetails = cursor.value;
- iidModel.deleteToken(tokenDetails.fcmSenderId, tokenDetails.fcmToken, tokenDetails.fcmPushSet);
- cursor.continue();
- }
- else {
- db.close();
- indexedDB.deleteDatabase(OLD_DB_NAME);
- }
- };
-}
-function cleanV1() {
- var request = indexedDB.open(OLD_DB_NAME);
- request.onerror = function (event) {
- // NOOP - Nothing we can do.
- };
- request.onsuccess = function (event) {
- var db = request.result;
- handleDb(db);
- };
-}
+/***/ "./src/views/create-account-view.jsx":
+/*!*******************************************!*\
+ !*** ./src/views/create-account-view.jsx ***!
+ \*******************************************/
+/*! exports provided: default */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
-/**
- * Copyright 2017 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-var DbInterface = /** @class */ (function () {
- function DbInterface() {
- this.dbPromise = null;
- }
- /** Gets record(s) from the objectStore that match the given key. */
- DbInterface.prototype.get = function (key) {
- return this.createTransaction(function (objectStore) { return objectStore.get(key); });
- };
- /** Gets record(s) from the objectStore that match the given index. */
- DbInterface.prototype.getIndex = function (index, key) {
- function runRequest(objectStore) {
- var idbIndex = objectStore.index(index);
- return idbIndex.get(key);
- }
- return this.createTransaction(runRequest);
- };
- /** Assigns or overwrites the record for the given value. */
- // tslint:disable-next-line:no-any IndexedDB values are of type "any"
- DbInterface.prototype.put = function (value) {
- return this.createTransaction(function (objectStore) { return objectStore.put(value); }, 'readwrite');
- };
- /** Deletes record(s) from the objectStore that match the given key. */
- DbInterface.prototype.delete = function (key) {
- return this.createTransaction(function (objectStore) { return objectStore.delete(key); }, 'readwrite');
- };
- /**
- * Close the currently open database.
- */
- DbInterface.prototype.closeDatabase = function () {
- return tslib_1.__awaiter(this, void 0, void 0, function () {
- var db;
- return tslib_1.__generator(this, function (_a) {
- switch (_a.label) {
- case 0:
- if (!this.dbPromise) return [3 /*break*/, 2];
- return [4 /*yield*/, this.dbPromise];
- case 1:
- db = _a.sent();
- db.close();
- this.dbPromise = null;
- _a.label = 2;
- case 2: return [2 /*return*/];
- }
- });
- });
- };
- /**
- * Creates an IndexedDB Transaction and passes its objectStore to the
- * runRequest function, which runs the database request.
- *
- * @return Promise that resolves with the result of the runRequest function
- */
- DbInterface.prototype.createTransaction = function (runRequest, mode) {
- if (mode === void 0) { mode = 'readonly'; }
- return tslib_1.__awaiter(this, void 0, void 0, function () {
- var db, transaction, request, result;
- return tslib_1.__generator(this, function (_a) {
- switch (_a.label) {
- case 0: return [4 /*yield*/, this.getDb()];
- case 1:
- db = _a.sent();
- transaction = db.transaction(this.objectStoreName, mode);
- request = transaction.objectStore(this.objectStoreName);
- return [4 /*yield*/, promisify(runRequest(request))];
- case 2:
- result = _a.sent();
- return [2 /*return*/, new Promise(function (resolve, reject) {
- transaction.oncomplete = function () {
- resolve(result);
- };
- transaction.onerror = function () {
- reject(transaction.error);
- };
- })];
- }
- });
- });
- };
- /** Gets the cached db connection or opens a new one. */
- DbInterface.prototype.getDb = function () {
- var _this = this;
- if (!this.dbPromise) {
- this.dbPromise = new Promise(function (resolve, reject) {
- var request = indexedDB.open(_this.dbName, _this.dbVersion);
- request.onsuccess = function () {
- resolve(request.result);
- };
- request.onerror = function () {
- _this.dbPromise = null;
- reject(request.error);
- };
- request.onupgradeneeded = function (event) { return _this.onDbUpgrade(request, event); };
- });
- }
- return this.dbPromise;
- };
- return DbInterface;
-}());
-/** Promisifies an IDBRequest. Resolves with the IDBRequest's result. */
-function promisify(request) {
- return new Promise(function (resolve, reject) {
- request.onsuccess = function () {
- resolve(request.result);
- };
- request.onerror = function () {
- reject(request.error);
- };
- });
-}
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return CreateAccountView; });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-intl */ \"react-intl\");\n/* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_intl__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _widgets_avatar_upload_jsx__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../widgets/avatar-upload.jsx */ \"./src/widgets/avatar-upload.jsx\");\n/* harmony import */ var _widgets_checkbox_jsx__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../widgets/checkbox.jsx */ \"./src/widgets/checkbox.jsx\");\n/* harmony import */ var _widgets_visible_password_jsx__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../widgets/visible-password.jsx */ \"./src/widgets/visible-password.jsx\");\n/* harmony import */ var _lib_local_storage_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../lib/local-storage.js */ \"./src/lib/local-storage.js\");\n/* harmony import */ var _lib_utils_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../lib/utils.js */ \"./src/lib/utils.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 _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\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\n\n\n\n\n\n\n\n\nvar CreateAccountView = function (_React$PureComponent) {\n _inherits(CreateAccountView, _React$PureComponent);\n\n function CreateAccountView(props) {\n var _this;\n\n _classCallCheck(this, CreateAccountView);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(CreateAccountView).call(this, props));\n _this.state = {\n login: '',\n password: '',\n email: '',\n fn: '',\n imageDataUrl: null,\n errorCleared: false,\n saveToken: _lib_local_storage_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"].getObject('keep-logged-in')\n };\n _this.handleLoginChange = _this.handleLoginChange.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handlePasswordChange = _this.handlePasswordChange.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleEmailChange = _this.handleEmailChange.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleFnChange = _this.handleFnChange.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleImageChanged = _this.handleImageChanged.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleToggleSaveToken = _this.handleToggleSaveToken.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleSubmit = _this.handleSubmit.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n return _this;\n }\n\n _createClass(CreateAccountView, [{\n key: \"handleLoginChange\",\n value: function handleLoginChange(e) {\n this.setState({\n login: e.target.value\n });\n }\n }, {\n key: \"handlePasswordChange\",\n value: function handlePasswordChange(password) {\n this.setState({\n password: password\n });\n }\n }, {\n key: \"handleEmailChange\",\n value: function handleEmailChange(e) {\n this.setState({\n email: e.target.value\n });\n }\n }, {\n key: \"handleFnChange\",\n value: function handleFnChange(e) {\n this.setState({\n fn: e.target.value\n });\n }\n }, {\n key: \"handleImageChanged\",\n value: function handleImageChanged(img) {\n this.setState({\n imageDataUrl: img\n });\n }\n }, {\n key: \"handleToggleSaveToken\",\n value: function handleToggleSaveToken() {\n _lib_local_storage_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"].setObject('keep-logged-in', !this.state.saveToken);\n this.setState({\n saveToken: !this.state.saveToken\n });\n }\n }, {\n key: \"handleSubmit\",\n value: function handleSubmit(e) {\n e.preventDefault();\n this.setState({\n errorCleared: false\n });\n this.props.onCreateAccount(this.state.login.trim(), this.state.password.trim(), Object(_lib_utils_js__WEBPACK_IMPORTED_MODULE_6__[\"vcard\"])(this.state.fn, this.state.imageDataUrl), {\n 'meth': 'email',\n 'val': this.state.email\n });\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this2 = this;\n\n var submitClasses = 'blue';\n\n if (this.props.disabled) {\n submitClasses += ' disabled';\n }\n\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"form\", {\n className: \"panel-form-column\",\n onSubmit: this.handleSubmit\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"panel-form-row\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"panel-form-column\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"login_prompt\"\n }, function (login_prompt) {\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"input\", {\n type: \"text\",\n placeholder: login_prompt,\n autoComplete: \"user-name\",\n value: _this2.state.login,\n onChange: _this2.handleLoginChange,\n required: true,\n autoFocus: true\n });\n }), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"password_prompt\"\n }, function (password_prompt) {\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_widgets_visible_password_jsx__WEBPACK_IMPORTED_MODULE_4__[\"default\"], {\n placeholder: password_prompt,\n autoComplete: \"new-password\",\n value: _this2.state.password,\n onFinished: _this2.handlePasswordChange,\n required: true\n });\n })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_widgets_avatar_upload_jsx__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n onImageChanged: this.handleImageChanged,\n onError: this.props.onError\n })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"panel-form-row\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"full_name_prompt\",\n defaultMessage: \"Full name, e.g. John Doe\"\n }, function (full_name_prompt) {\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"input\", {\n type: \"text\",\n placeholder: full_name_prompt,\n autoComplete: \"name\",\n value: _this2.state.fn,\n onChange: _this2.handleFnChange,\n required: true\n });\n })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"panel-form-row\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"email_prompt\",\n defaultMessage: \"Email, e.g. jdoe@example.com\"\n }, function (email_prompt) {\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"input\", {\n type: \"email\",\n placeholder: email_prompt,\n autoComplete: \"email\",\n value: _this2.state.email,\n onChange: _this2.handleEmailChange,\n required: true\n });\n })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"panel-form-row\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_widgets_checkbox_jsx__WEBPACK_IMPORTED_MODULE_3__[\"default\"], {\n id: \"save-token\",\n name: \"save-token\",\n checked: this.state.saveToken,\n onChange: this.handleToggleSaveToken\n }), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"stay_logged_in\"\n }, function (stay_logged_in) {\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"label\", {\n htmlFor: \"save-token\"\n }, \"\\xA0\", stay_logged_in);\n })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"dialog-buttons\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"button\", {\n className: submitClasses,\n type: \"submit\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"button_sign_up\",\n defaultMessage: \"Sign up\"\n }))));\n }\n }]);\n\n return CreateAccountView;\n}(react__WEBPACK_IMPORTED_MODULE_0___default.a.PureComponent);\n\n\n;\n\n//# sourceURL=webpack:///./src/views/create-account-view.jsx?");
-/**
- * Copyright 2017 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-var TokenDetailsModel = /** @class */ (function (_super) {
- tslib_1.__extends(TokenDetailsModel, _super);
- function TokenDetailsModel() {
- var _this = _super !== null && _super.apply(this, arguments) || this;
- _this.dbName = 'fcm_token_details_db';
- _this.dbVersion = 3;
- _this.objectStoreName = 'fcm_token_object_Store';
- return _this;
- }
- TokenDetailsModel.prototype.onDbUpgrade = function (request, event) {
- var db = request.result;
- // Lack of 'break' statements is intentional.
- switch (event.oldVersion) {
- case 0: {
- // New IDB instance
- var objectStore = db.createObjectStore(this.objectStoreName, {
- keyPath: 'swScope'
- });
- // Make sure the sender ID can be searched
- objectStore.createIndex('fcmSenderId', 'fcmSenderId', {
- unique: false
- });
- objectStore.createIndex('fcmToken', 'fcmToken', { unique: true });
- }
- case 1: {
- // Prior to version 2, we were using either 'fcm_token_details_db'
- // or 'undefined' as the database name due to bug in the SDK
- // So remove the old tokens and databases.
- cleanV1();
- }
- case 2: {
- var objectStore = request.transaction.objectStore(this.objectStoreName);
- var cursorRequest_1 = objectStore.openCursor();
- cursorRequest_1.onsuccess = function () {
- var cursor = cursorRequest_1.result;
- if (cursor) {
- var value = cursor.value;
- var newValue = tslib_1.__assign({}, value);
- if (!value.createTime) {
- newValue.createTime = Date.now();
- }
- if (typeof value.vapidKey === 'string') {
- newValue.vapidKey = base64ToArrayBuffer(value.vapidKey);
- }
- if (typeof value.auth === 'string') {
- newValue.auth = base64ToArrayBuffer(value.auth).buffer;
- }
- if (typeof value.auth === 'string') {
- newValue.p256dh = base64ToArrayBuffer(value.p256dh).buffer;
- }
- cursor.update(newValue);
- cursor.continue();
- }
- };
- }
- }
- };
- /**
- * Given a token, this method will look up the details in indexedDB.
- */
- TokenDetailsModel.prototype.getTokenDetailsFromToken = function (fcmToken) {
- return tslib_1.__awaiter(this, void 0, void 0, function () {
- return tslib_1.__generator(this, function (_a) {
- if (!fcmToken) {
- throw errorFactory.create(ERROR_CODES.BAD_TOKEN);
- }
- validateInputs({ fcmToken: fcmToken });
- return [2 /*return*/, this.getIndex('fcmToken', fcmToken)];
- });
- });
- };
- /**
- * Given a service worker scope, this method will look up the details in
- * indexedDB.
- * @return The details associated with that token.
- */
- TokenDetailsModel.prototype.getTokenDetailsFromSWScope = function (swScope) {
- return tslib_1.__awaiter(this, void 0, void 0, function () {
- return tslib_1.__generator(this, function (_a) {
- if (!swScope) {
- throw errorFactory.create(ERROR_CODES.BAD_SCOPE);
- }
- validateInputs({ swScope: swScope });
- return [2 /*return*/, this.get(swScope)];
- });
- });
- };
- /**
- * Save the details for the fcm token for re-use at a later date.
- * @param input A plain js object containing args to save.
- */
- TokenDetailsModel.prototype.saveTokenDetails = function (tokenDetails) {
- return tslib_1.__awaiter(this, void 0, void 0, function () {
- return tslib_1.__generator(this, function (_a) {
- if (!tokenDetails.swScope) {
- throw errorFactory.create(ERROR_CODES.BAD_SCOPE);
- }
- if (!tokenDetails.vapidKey) {
- throw errorFactory.create(ERROR_CODES.BAD_VAPID_KEY);
- }
- if (!tokenDetails.endpoint || !tokenDetails.auth || !tokenDetails.p256dh) {
- throw errorFactory.create(ERROR_CODES.BAD_SUBSCRIPTION);
- }
- if (!tokenDetails.fcmSenderId) {
- throw errorFactory.create(ERROR_CODES.BAD_SENDER_ID);
- }
- if (!tokenDetails.fcmToken) {
- throw errorFactory.create(ERROR_CODES.BAD_TOKEN);
- }
- if (!tokenDetails.fcmPushSet) {
- throw errorFactory.create(ERROR_CODES.BAD_PUSH_SET);
- }
- validateInputs(tokenDetails);
- return [2 /*return*/, this.put(tokenDetails)];
- });
- });
- };
- /**
- * This method deletes details of the current FCM token.
- * It's returning a promise in case we need to move to an async
- * method for deleting at a later date.
- *
- * @return Resolves once the FCM token details have been deleted and returns
- * the deleted details.
- */
- TokenDetailsModel.prototype.deleteToken = function (token) {
- return tslib_1.__awaiter(this, void 0, void 0, function () {
- var details;
- return tslib_1.__generator(this, function (_a) {
- switch (_a.label) {
- case 0:
- if (typeof token !== 'string' || token.length === 0) {
- return [2 /*return*/, Promise.reject(errorFactory.create(ERROR_CODES.INVALID_DELETE_TOKEN))];
- }
- return [4 /*yield*/, this.getTokenDetailsFromToken(token)];
- case 1:
- details = _a.sent();
- if (!details) {
- throw errorFactory.create(ERROR_CODES.DELETE_TOKEN_NOT_FOUND);
- }
- return [4 /*yield*/, this.delete(details.swScope)];
- case 2:
- _a.sent();
- return [2 /*return*/, details];
- }
- });
- });
- };
- return TokenDetailsModel;
-}(DbInterface));
-/**
- * This method takes an object and will check for known arguments and
- * validate the input.
- * @return Promise that resolves if input is valid, rejects otherwise.
- */
-function validateInputs(input) {
- if (input.fcmToken) {
- if (typeof input.fcmToken !== 'string' || input.fcmToken.length === 0) {
- throw errorFactory.create(ERROR_CODES.BAD_TOKEN);
- }
- }
- if (input.swScope) {
- if (typeof input.swScope !== 'string' || input.swScope.length === 0) {
- throw errorFactory.create(ERROR_CODES.BAD_SCOPE);
- }
- }
- if (input.vapidKey) {
- if (!(input.vapidKey instanceof Uint8Array) ||
- input.vapidKey.length !== 65) {
- throw errorFactory.create(ERROR_CODES.BAD_VAPID_KEY);
- }
- }
- if (input.endpoint) {
- if (typeof input.endpoint !== 'string' || input.endpoint.length === 0) {
- throw errorFactory.create(ERROR_CODES.BAD_SUBSCRIPTION);
- }
- }
- if (input.auth) {
- if (!(input.auth instanceof ArrayBuffer)) {
- throw errorFactory.create(ERROR_CODES.BAD_SUBSCRIPTION);
- }
- }
- if (input.p256dh) {
- if (!(input.p256dh instanceof ArrayBuffer)) {
- throw errorFactory.create(ERROR_CODES.BAD_SUBSCRIPTION);
- }
- }
- if (input.fcmSenderId) {
- if (typeof input.fcmSenderId !== 'string' ||
- input.fcmSenderId.length === 0) {
- throw errorFactory.create(ERROR_CODES.BAD_SENDER_ID);
- }
- }
- if (input.fcmPushSet) {
- if (typeof input.fcmPushSet !== 'string' || input.fcmPushSet.length === 0) {
- throw errorFactory.create(ERROR_CODES.BAD_PUSH_SET);
- }
- }
-}
+/***/ }),
-/**
- * Copyright 2017 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-var UNCOMPRESSED_PUBLIC_KEY_SIZE = 65;
-var VapidDetailsModel = /** @class */ (function (_super) {
- tslib_1.__extends(VapidDetailsModel, _super);
- function VapidDetailsModel() {
- var _this = _super !== null && _super.apply(this, arguments) || this;
- _this.dbName = 'fcm_vapid_details_db';
- _this.dbVersion = 1;
- _this.objectStoreName = 'fcm_vapid_object_Store';
- return _this;
- }
- VapidDetailsModel.prototype.onDbUpgrade = function (request) {
- var db = request.result;
- db.createObjectStore(this.objectStoreName, { keyPath: 'swScope' });
- };
- /**
- * Given a service worker scope, this method will look up the vapid key
- * in indexedDB.
- */
- VapidDetailsModel.prototype.getVapidFromSWScope = function (swScope) {
- return tslib_1.__awaiter(this, void 0, void 0, function () {
- var result;
- return tslib_1.__generator(this, function (_a) {
- switch (_a.label) {
- case 0:
- if (typeof swScope !== 'string' || swScope.length === 0) {
- throw errorFactory.create(ERROR_CODES.BAD_SCOPE);
- }
- return [4 /*yield*/, this.get(swScope)];
- case 1:
- result = _a.sent();
- return [2 /*return*/, result ? result.vapidKey : undefined];
- }
- });
- });
- };
- /**
- * Save a vapid key against a swScope for later date.
- */
- VapidDetailsModel.prototype.saveVapidDetails = function (swScope, vapidKey) {
- return tslib_1.__awaiter(this, void 0, void 0, function () {
- var details;
- return tslib_1.__generator(this, function (_a) {
- if (typeof swScope !== 'string' || swScope.length === 0) {
- throw errorFactory.create(ERROR_CODES.BAD_SCOPE);
- }
- if (vapidKey === null || vapidKey.length !== UNCOMPRESSED_PUBLIC_KEY_SIZE) {
- throw errorFactory.create(ERROR_CODES.BAD_VAPID_KEY);
- }
- details = {
- swScope: swScope,
- vapidKey: vapidKey
- };
- return [2 /*return*/, this.put(details)];
- });
- });
- };
- /**
- * This method deletes details of the current FCM VAPID key for a SW scope.
- * Resolves once the scope/vapid details have been deleted and returns the
- * deleted vapid key.
- */
- VapidDetailsModel.prototype.deleteVapidDetails = function (swScope) {
- return tslib_1.__awaiter(this, void 0, void 0, function () {
- var vapidKey;
- return tslib_1.__generator(this, function (_a) {
- switch (_a.label) {
- case 0: return [4 /*yield*/, this.getVapidFromSWScope(swScope)];
- case 1:
- vapidKey = _a.sent();
- if (!vapidKey) {
- throw errorFactory.create(ERROR_CODES.DELETE_SCOPE_NOT_FOUND);
- }
- return [4 /*yield*/, this.delete(swScope)];
- case 2:
- _a.sent();
- return [2 /*return*/, vapidKey];
- }
- });
- });
- };
- return VapidDetailsModel;
-}(DbInterface));
+/***/ "./src/views/edit-account-view.jsx":
+/*!*****************************************!*\
+ !*** ./src/views/edit-account-view.jsx ***!
+ \*****************************************/
+/*! exports provided: default */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
-/**
- * Copyright 2017 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-var SENDER_ID_OPTION_NAME = 'messagingSenderId';
-// Database cache should be invalidated once a week.
-var TOKEN_EXPIRATION_MILLIS = 7 * 24 * 60 * 60 * 1000; // 7 days
-var BaseController = /** @class */ (function () {
- /**
- * An interface of the Messaging Service API
- */
- function BaseController(app) {
- var _this = this;
- if (!app.options[SENDER_ID_OPTION_NAME] ||
- typeof app.options[SENDER_ID_OPTION_NAME] !== 'string') {
- throw errorFactory.create(ERROR_CODES.BAD_SENDER_ID);
- }
- this.messagingSenderId = app.options[SENDER_ID_OPTION_NAME];
- this.tokenDetailsModel = new TokenDetailsModel();
- this.vapidDetailsModel = new VapidDetailsModel();
- this.iidModel = new IidModel();
- this.app = app;
- this.INTERNAL = {
- delete: function () { return _this.delete(); }
- };
- }
- /**
- * @export
- */
- BaseController.prototype.getToken = function () {
- return tslib_1.__awaiter(this, void 0, void 0, function () {
- var currentPermission, swReg, publicVapidKey, pushSubscription, tokenDetails;
- return tslib_1.__generator(this, function (_a) {
- switch (_a.label) {
- case 0:
- currentPermission = this.getNotificationPermission_();
- if (currentPermission === 'denied') {
- throw errorFactory.create(ERROR_CODES.NOTIFICATIONS_BLOCKED);
- }
- else if (currentPermission !== 'granted') {
- // We must wait for permission to be granted
- return [2 /*return*/, null];
- }
- return [4 /*yield*/, this.getSWRegistration_()];
- case 1:
- swReg = _a.sent();
- return [4 /*yield*/, this.getPublicVapidKey_()];
- case 2:
- publicVapidKey = _a.sent();
- return [4 /*yield*/, this.getPushSubscription(swReg, publicVapidKey)];
- case 3:
- pushSubscription = _a.sent();
- return [4 /*yield*/, this.tokenDetailsModel.getTokenDetailsFromSWScope(swReg.scope)];
- case 4:
- tokenDetails = _a.sent();
- if (tokenDetails) {
- return [2 /*return*/, this.manageExistingToken(swReg, pushSubscription, publicVapidKey, tokenDetails)];
- }
- return [2 /*return*/, this.getNewToken(swReg, pushSubscription, publicVapidKey)];
- }
- });
- });
- };
- /**
- * manageExistingToken is triggered if there's an existing FCM token in the
- * database and it can take 3 different actions:
- * 1) Retrieve the existing FCM token from the database.
- * 2) If VAPID details have changed: Delete the existing token and create a
- * new one with the new VAPID key.
- * 3) If the database cache is invalidated: Send a request to FCM to update
- * the token, and to check if the token is still valid on FCM-side.
- */
- BaseController.prototype.manageExistingToken = function (swReg, pushSubscription, publicVapidKey, tokenDetails) {
- return tslib_1.__awaiter(this, void 0, void 0, function () {
- var isTokenValid, now;
- return tslib_1.__generator(this, function (_a) {
- switch (_a.label) {
- case 0:
- isTokenValid = isTokenStillValid(pushSubscription, publicVapidKey, tokenDetails);
- if (isTokenValid) {
- now = Date.now();
- if (now < tokenDetails.createTime + TOKEN_EXPIRATION_MILLIS) {
- return [2 /*return*/, tokenDetails.fcmToken];
- }
- else {
- return [2 /*return*/, this.updateToken(swReg, pushSubscription, publicVapidKey, tokenDetails)];
- }
- }
- // If the token is no longer valid (for example if the VAPID details
- // have changed), delete the existing token from the FCM client and server
- // database. No need to unsubscribe from the Service Worker as we have a
- // good push subscription that we'd like to use in getNewToken.
- return [4 /*yield*/, this.deleteTokenFromDB(tokenDetails.fcmToken)];
- case 1:
- // If the token is no longer valid (for example if the VAPID details
- // have changed), delete the existing token from the FCM client and server
- // database. No need to unsubscribe from the Service Worker as we have a
- // good push subscription that we'd like to use in getNewToken.
- _a.sent();
- return [2 /*return*/, this.getNewToken(swReg, pushSubscription, publicVapidKey)];
- }
- });
- });
- };
- BaseController.prototype.updateToken = function (swReg, pushSubscription, publicVapidKey, tokenDetails) {
- return tslib_1.__awaiter(this, void 0, void 0, function () {
- var updatedToken, allDetails, e_1;
- return tslib_1.__generator(this, function (_a) {
- switch (_a.label) {
- case 0:
- _a.trys.push([0, 4, , 6]);
- return [4 /*yield*/, this.iidModel.updateToken(this.messagingSenderId, tokenDetails.fcmToken, tokenDetails.fcmPushSet, pushSubscription, publicVapidKey)];
- case 1:
- updatedToken = _a.sent();
- allDetails = {
- swScope: swReg.scope,
- vapidKey: publicVapidKey,
- fcmSenderId: this.messagingSenderId,
- fcmToken: updatedToken,
- fcmPushSet: tokenDetails.fcmPushSet,
- createTime: Date.now(),
- endpoint: pushSubscription.endpoint,
- auth: pushSubscription.getKey('auth'),
- p256dh: pushSubscription.getKey('p256dh')
- };
- return [4 /*yield*/, this.tokenDetailsModel.saveTokenDetails(allDetails)];
- case 2:
- _a.sent();
- return [4 /*yield*/, this.vapidDetailsModel.saveVapidDetails(swReg.scope, publicVapidKey)];
- case 3:
- _a.sent();
- return [2 /*return*/, updatedToken];
- case 4:
- e_1 = _a.sent();
- return [4 /*yield*/, this.deleteToken(tokenDetails.fcmToken)];
- case 5:
- _a.sent();
- throw e_1;
- case 6: return [2 /*return*/];
- }
- });
- });
- };
- BaseController.prototype.getNewToken = function (swReg, pushSubscription, publicVapidKey) {
- return tslib_1.__awaiter(this, void 0, void 0, function () {
- var tokenDetails, allDetails;
- return tslib_1.__generator(this, function (_a) {
- switch (_a.label) {
- case 0: return [4 /*yield*/, this.iidModel.getToken(this.messagingSenderId, pushSubscription, publicVapidKey)];
- case 1:
- tokenDetails = _a.sent();
- allDetails = {
- swScope: swReg.scope,
- vapidKey: publicVapidKey,
- fcmSenderId: this.messagingSenderId,
- fcmToken: tokenDetails.token,
- fcmPushSet: tokenDetails.pushSet,
- createTime: Date.now(),
- endpoint: pushSubscription.endpoint,
- auth: pushSubscription.getKey('auth'),
- p256dh: pushSubscription.getKey('p256dh')
- };
- return [4 /*yield*/, this.tokenDetailsModel.saveTokenDetails(allDetails)];
- case 2:
- _a.sent();
- return [4 /*yield*/, this.vapidDetailsModel.saveVapidDetails(swReg.scope, publicVapidKey)];
- case 3:
- _a.sent();
- return [2 /*return*/, tokenDetails.token];
- }
- });
- });
- };
- /**
- * This method deletes tokens that the token manager looks after,
- * unsubscribes the token from FCM and then unregisters the push
- * subscription if it exists. It returns a promise that indicates
- * whether or not the unsubscribe request was processed successfully.
- */
- BaseController.prototype.deleteToken = function (token) {
- return tslib_1.__awaiter(this, void 0, void 0, function () {
- var registration, pushSubscription;
- return tslib_1.__generator(this, function (_a) {
- switch (_a.label) {
- case 0:
- // Delete the token details from the database.
- return [4 /*yield*/, this.deleteTokenFromDB(token)];
- case 1:
- // Delete the token details from the database.
- _a.sent();
- return [4 /*yield*/, this.getSWRegistration_()];
- case 2:
- registration = _a.sent();
- if (!registration) return [3 /*break*/, 4];
- return [4 /*yield*/, registration.pushManager.getSubscription()];
- case 3:
- pushSubscription = _a.sent();
- if (pushSubscription) {
- return [2 /*return*/, pushSubscription.unsubscribe()];
- }
- _a.label = 4;
- case 4:
- // If there's no SW, consider it a success.
- return [2 /*return*/, true];
- }
- });
- });
- };
- /**
- * This method will delete the token from the client database, and make a
- * call to FCM to remove it from the server DB. Does not temper with the
- * push subscription.
- */
- BaseController.prototype.deleteTokenFromDB = function (token) {
- return tslib_1.__awaiter(this, void 0, void 0, function () {
- var details;
- return tslib_1.__generator(this, function (_a) {
- switch (_a.label) {
- case 0: return [4 /*yield*/, this.tokenDetailsModel.deleteToken(token)];
- case 1:
- details = _a.sent();
- return [4 /*yield*/, this.iidModel.deleteToken(details.fcmSenderId, details.fcmToken, details.fcmPushSet)];
- case 2:
- _a.sent();
- return [2 /*return*/];
- }
- });
- });
- };
- /**
- * Gets a PushSubscription for the current user.
- */
- BaseController.prototype.getPushSubscription = function (swRegistration, publicVapidKey) {
- return swRegistration.pushManager.getSubscription().then(function (subscription) {
- if (subscription) {
- return subscription;
- }
- return swRegistration.pushManager.subscribe({
- userVisibleOnly: true,
- applicationServerKey: publicVapidKey
- });
- });
- };
- //
- // The following methods should only be available in the window.
- //
- BaseController.prototype.requestPermission = function () {
- throw errorFactory.create(ERROR_CODES.AVAILABLE_IN_WINDOW);
- };
- BaseController.prototype.useServiceWorker = function (registration) {
- throw errorFactory.create(ERROR_CODES.AVAILABLE_IN_WINDOW);
- };
- BaseController.prototype.usePublicVapidKey = function (b64PublicKey) {
- throw errorFactory.create(ERROR_CODES.AVAILABLE_IN_WINDOW);
- };
- BaseController.prototype.onMessage = function (nextOrObserver, error, completed) {
- throw errorFactory.create(ERROR_CODES.AVAILABLE_IN_WINDOW);
- };
- BaseController.prototype.onTokenRefresh = function (nextOrObserver, error, completed) {
- throw errorFactory.create(ERROR_CODES.AVAILABLE_IN_WINDOW);
- };
- //
- // The following methods are used by the service worker only.
- //
- BaseController.prototype.setBackgroundMessageHandler = function (callback) {
- throw errorFactory.create(ERROR_CODES.AVAILABLE_IN_SW);
- };
- //
- // The following methods are used by the service themselves and not exposed
- // publicly or not expected to be used by developers.
- //
- /**
- * This method is required to adhere to the Firebase interface.
- * It closes any currently open indexdb database connections.
- */
- BaseController.prototype.delete = function () {
- return tslib_1.__awaiter(this, void 0, void 0, function () {
- return tslib_1.__generator(this, function (_a) {
- switch (_a.label) {
- case 0: return [4 /*yield*/, Promise.all([
- this.tokenDetailsModel.closeDatabase(),
- this.vapidDetailsModel.closeDatabase()
- ])];
- case 1:
- _a.sent();
- return [2 /*return*/];
- }
- });
- });
- };
- /**
- * Returns the current Notification Permission state.
- */
- BaseController.prototype.getNotificationPermission_ = function () {
- // TODO: Remove the cast when this issue is fixed:
- // https://github.com/Microsoft/TypeScript/issues/14701
- // tslint:disable-next-line no-any
- return Notification.permission;
- };
- BaseController.prototype.getTokenDetailsModel = function () {
- return this.tokenDetailsModel;
- };
- BaseController.prototype.getVapidDetailsModel = function () {
- return this.vapidDetailsModel;
- };
- // Visible for testing
- // TODO: make protected
- BaseController.prototype.getIidModel = function () {
- return this.iidModel;
- };
- return BaseController;
-}());
-/**
- * Checks if the tokenDetails match the details provided in the clients.
- */
-function isTokenStillValid(pushSubscription, publicVapidKey, tokenDetails) {
- if (!tokenDetails.vapidKey ||
- !isArrayBufferEqual(publicVapidKey.buffer, tokenDetails.vapidKey.buffer)) {
- return false;
- }
- var isEndpointEqual = pushSubscription.endpoint === tokenDetails.endpoint;
- var isAuthEqual = isArrayBufferEqual(pushSubscription.getKey('auth'), tokenDetails.auth);
- var isP256dhEqual = isArrayBufferEqual(pushSubscription.getKey('p256dh'), tokenDetails.p256dh);
- return isEndpointEqual && isAuthEqual && isP256dhEqual;
-}
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return EditAccountView; });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-intl */ \"react-intl\");\n/* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_intl__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _widgets_avatar_upload_jsx__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../widgets/avatar-upload.jsx */ \"./src/widgets/avatar-upload.jsx\");\n/* harmony import */ var _widgets_checkbox_jsx__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../widgets/checkbox.jsx */ \"./src/widgets/checkbox.jsx\");\n/* harmony import */ var _widgets_in_place_edit_jsx__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../widgets/in-place-edit.jsx */ \"./src/widgets/in-place-edit.jsx\");\n/* harmony import */ var _widgets_permissions_editor_jsx__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../widgets/permissions-editor.jsx */ \"./src/widgets/permissions-editor.jsx\");\n/* harmony import */ var _widgets_tag_manager_jsx__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../widgets/tag-manager.jsx */ \"./src/widgets/tag-manager.jsx\");\n/* harmony import */ var _lib_blob_helpers_js__WEBPACK_IMPORTED_MODULE_7__ = __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 _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\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\n\n\n\n\n\n\n\n\n\nvar EditAccountView = function (_React$Component) {\n _inherits(EditAccountView, _React$Component);\n\n function EditAccountView(props) {\n var _this;\n\n _classCallCheck(this, EditAccountView);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(EditAccountView).call(this, props));\n\n var me = _this.props.tinode.getMeTopic();\n\n var defacs = me.getDefaultAccess();\n\n var fnd = _this.props.tinode.getFndTopic();\n\n _this.state = {\n fullName: me.public ? me.public.fn : undefined,\n avatar: Object(_lib_blob_helpers_js__WEBPACK_IMPORTED_MODULE_7__[\"makeImageUrl\"])(me.public ? me.public.photo : null),\n auth: defacs ? defacs.auth : null,\n anon: defacs ? defacs.anon : null,\n tags: fnd.tags(),\n showPermissionEditorFor: undefined,\n previousOnTags: fnd.onTagsUpdated\n };\n _this.tnNewTags = _this.tnNewTags.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleFullNameUpdate = _this.handleFullNameUpdate.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handlePasswordUpdate = _this.handlePasswordUpdate.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleImageChanged = _this.handleImageChanged.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleCheckboxClick = _this.handleCheckboxClick.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleLaunchPermissionsEditor = _this.handleLaunchPermissionsEditor.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleHidePermissionsEditor = _this.handleHidePermissionsEditor.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handlePermissionsChanged = _this.handlePermissionsChanged.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleTagsUpdated = _this.handleTagsUpdated.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n return _this;\n }\n\n _createClass(EditAccountView, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n var _this2 = this;\n\n var fnd = this.props.tinode.getFndTopic();\n fnd.onTagsUpdated = this.tnNewTags;\n\n if (!fnd.isSubscribed()) {\n fnd.subscribe(fnd.startMetaQuery().withLaterDesc().withTags().build()).catch(function (err) {\n _this2.props.onError(err.message, 'err');\n });\n }\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n var fnd = this.props.tinode.getFndTopic();\n fnd.onTagsUpdated = this.state.previousOnTags;\n }\n }, {\n key: \"tnNewTags\",\n value: function tnNewTags(tags) {\n this.setState({\n tags: tags\n });\n }\n }, {\n key: \"handleFullNameUpdate\",\n value: function handleFullNameUpdate(fn) {\n this.setState({\n fullName: fn\n });\n this.props.onUpdateAccount(undefined, vcard(fn, this.state.avatar));\n }\n }, {\n key: \"handlePasswordUpdate\",\n value: function handlePasswordUpdate(pwd) {\n this.setState({\n password: pwd\n });\n this.props.onUpdateAccount(pwd);\n }\n }, {\n key: \"handleImageChanged\",\n value: function handleImageChanged(img) {\n this.setState({\n avatar: img\n });\n this.props.onUpdateAccount(undefined, vcard(this.state.fullName, img));\n }\n }, {\n key: \"handleCheckboxClick\",\n value: function handleCheckboxClick(what, checked) {\n if (what == 'sound') {\n this.props.onToggleMessageSounds(checked);\n } else if (what == 'alert') {\n this.props.onTogglePushNotifications(checked);\n }\n }\n }, {\n key: \"handleLaunchPermissionsEditor\",\n value: function handleLaunchPermissionsEditor(which) {\n this.setState({\n showPermissionEditorFor: which,\n editedPermissions: this.state[which]\n });\n }\n }, {\n key: \"handleHidePermissionsEditor\",\n value: function handleHidePermissionsEditor() {\n this.setState({\n showPermissionEditorFor: undefined\n });\n }\n }, {\n key: \"handlePermissionsChanged\",\n value: function handlePermissionsChanged(perm) {\n var defacs = {};\n defacs[this.state.showPermissionEditorFor] = perm;\n this.props.onUpdateAccount(undefined, undefined, defacs);\n var newState = {\n showPermissionEditorFor: undefined\n };\n newState[this.state.showPermissionEditorFor] = perm;\n this.setState(newState);\n }\n }, {\n key: \"handleTagsUpdated\",\n value: function handleTagsUpdated(tags) {\n if (arrayEqual(this.state.tags.slice(0), tags.slice(0))) {\n return;\n }\n\n this.props.onUpdateTags(tags);\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this3 = this;\n\n var tags = [];\n this.state.tags.map(function (tag) {\n tags.push(react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", {\n className: \"badge\",\n key: tags.length\n }, tag));\n });\n\n if (tags.length == 0) {\n tags = react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"i\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"tags_not_found\"\n }));\n }\n\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_0___default.a.Fragment, null, this.state.showPermissionEditorFor ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_widgets_permissions_editor_jsx__WEBPACK_IMPORTED_MODULE_5__[\"default\"], {\n mode: this.state.editedPermissions,\n skip: \"O\",\n onSubmit: this.handlePermissionsChanged,\n onCancel: this.handleHidePermissionsEditor\n }) : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n id: \"edit-account\",\n className: \"scrollable-panel\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"panel-form-row\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"panel-form-column\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"label\", {\n className: \"small\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"label_your_name\",\n defaultMessage: \"Your name\"\n }))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"full_name_prompt\"\n }, function (full_name_placeholder) {\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_widgets_in_place_edit_jsx__WEBPACK_IMPORTED_MODULE_4__[\"default\"], {\n placeholder: full_name_placeholder,\n value: _this3.state.fullName,\n onFinished: _this3.handleFullNameUpdate\n });\n })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"label\", {\n className: \"small\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"label_password\",\n defaultMessage: \"Password\"\n }))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"password_unchanged_prompt\",\n defaultMessage: \"Unchanged\"\n }, function (password_unchanged) {\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_widgets_in_place_edit_jsx__WEBPACK_IMPORTED_MODULE_4__[\"default\"], {\n placeholder: password_unchanged,\n type: \"password\",\n onFinished: _this3.handlePasswordUpdate\n });\n }))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_widgets_avatar_upload_jsx__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n avatar: this.state.avatar,\n uid: this.props.myUserId,\n title: this.state.fullName,\n onImageChanged: this.handleImageChanged,\n onError: this.props.onError\n })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"hr\"\n }), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"panel-form-column\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"panel-form-row\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"label\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"label_user_id\",\n defaultMessage: \"Address:\"\n })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"tt\", null, this.props.myUserId)), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"label\", {\n className: \"small\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"label_default_access_mode\",\n defaultMessage: \"Default access mode:\"\n }))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"quoted\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, \"Auth: \", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"tt\", {\n className: \"clickable\",\n onClick: this.handleLaunchPermissionsEditor.bind(this, 'auth')\n }, this.state.auth)), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, \"Anon: \", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"tt\", {\n className: \"clickable\",\n onClick: this.handleLaunchPermissionsEditor.bind(this, 'anon')\n }, this.state.anon)))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"hr\"\n }), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"panel-form-row\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"label\", {\n htmlFor: \"message-sound\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"label_message_sound\",\n defaultMessage: \"Message sound:\"\n })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_widgets_checkbox_jsx__WEBPACK_IMPORTED_MODULE_3__[\"default\"], {\n name: \"sound\",\n id: \"message-sound\",\n checked: this.props.messageSounds,\n onChange: this.handleCheckboxClick\n })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"panel-form-row\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"label\", {\n htmlFor: \"desktop-alerts\"\n }, this.props.desktopAlertsEnabled ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"label_push_notifications\",\n defaultMessage: \"Notification alerts:\"\n }) : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"label_push_notifications_disabled\",\n defaultMessage: \"Notification alerts (requires HTTPS):\"\n })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_widgets_checkbox_jsx__WEBPACK_IMPORTED_MODULE_3__[\"default\"], {\n name: \"alert\",\n id: \"desktop-alerts\",\n checked: this.props.desktopAlerts,\n onChange: this.props.desktopAlertsEnabled ? this.handleCheckboxClick : null\n })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"hr\"\n }), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"title_tag_manager\",\n defaultMessage: \"Tags (user discovery)\"\n }, function (title_tag_manager) {\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_widgets_tag_manager_jsx__WEBPACK_IMPORTED_MODULE_6__[\"default\"], {\n title: title_tag_manager,\n activated: false,\n tags: _this3.state.tags,\n onSubmit: _this3.handleTagsUpdated\n });\n }), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"hr\"\n }), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"panel-form-column\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"a\", {\n href: \"javascript:;\",\n className: \"red flat-button\",\n onClick: this.props.onLogout\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"i\", {\n className: \"material-icons\"\n }, \"exit_to_app\"), \" \", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"button_logout\",\n defaultMessage: \"Logout\"\n })))));\n }\n }]);\n\n return EditAccountView;\n}(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component);\n\n\n;\n\n//# sourceURL=webpack:///./src/views/edit-account-view.jsx?");
-/**
- * Copyright 2017 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-var FCM_MSG = 'FCM_MSG';
-var SwController = /** @class */ (function (_super) {
- tslib_1.__extends(SwController, _super);
- function SwController(app) {
- var _this = _super.call(this, app) || this;
- _this.bgMessageHandler = null;
- self.addEventListener('push', function (e) {
- _this.onPush(e);
- });
- self.addEventListener('pushsubscriptionchange', function (e) {
- _this.onSubChange(e);
- });
- self.addEventListener('notificationclick', function (e) {
- _this.onNotificationClick(e);
- });
- return _this;
- }
- // Visible for testing
- // TODO: Make private
- SwController.prototype.onPush = function (event) {
- event.waitUntil(this.onPush_(event));
- };
- // Visible for testing
- // TODO: Make private
- SwController.prototype.onSubChange = function (event) {
- event.waitUntil(this.onSubChange_(event));
- };
- // Visible for testing
- // TODO: Make private
- SwController.prototype.onNotificationClick = function (event) {
- event.waitUntil(this.onNotificationClick_(event));
- };
- /**
- * A handler for push events that shows notifications based on the content of
- * the payload.
- *
- * The payload must be a JSON-encoded Object with a `notification` key. The
- * value of the `notification` property will be used as the NotificationOptions
- * object passed to showNotification. Additionally, the `title` property of the
- * notification object will be used as the title.
- *
- * If there is no notification data in the payload then no notification will be
- * shown.
- */
- SwController.prototype.onPush_ = function (event) {
- return tslib_1.__awaiter(this, void 0, void 0, function () {
- var msgPayload, hasVisibleClients, notificationDetails, notificationTitle, reg, actions, maxActions;
- return tslib_1.__generator(this, function (_a) {
- switch (_a.label) {
- case 0:
- if (!event.data) {
- return [2 /*return*/];
- }
- try {
- msgPayload = event.data.json();
- }
- catch (err) {
- // Not JSON so not an FCM message
- return [2 /*return*/];
- }
- return [4 /*yield*/, this.hasVisibleClients_()];
- case 1:
- hasVisibleClients = _a.sent();
- if (hasVisibleClients) {
- // App in foreground. Send to page.
- return [2 /*return*/, this.sendMessageToWindowClients_(msgPayload)];
- }
- notificationDetails = this.getNotificationData_(msgPayload);
- if (!notificationDetails) return [3 /*break*/, 3];
- notificationTitle = notificationDetails.title || '';
- return [4 /*yield*/, this.getSWRegistration_()];
- case 2:
- reg = _a.sent();
- actions = notificationDetails.actions;
- maxActions = Notification.maxActions;
- // tslint:enable no-any
- if (actions && maxActions && actions.length > maxActions) {
- console.warn("This browser only supports " + maxActions + " actions." +
- "The remaining actions will not be displayed.");
- }
- return [2 /*return*/, reg.showNotification(notificationTitle, notificationDetails)];
- case 3:
- if (!this.bgMessageHandler) return [3 /*break*/, 5];
- return [4 /*yield*/, this.bgMessageHandler(msgPayload)];
- case 4:
- _a.sent();
- return [2 /*return*/];
- case 5: return [2 /*return*/];
- }
- });
- });
- };
- SwController.prototype.onSubChange_ = function (event) {
- return tslib_1.__awaiter(this, void 0, void 0, function () {
- var registration, err_1, err_2, tokenDetailsModel, tokenDetails;
- return tslib_1.__generator(this, function (_a) {
- switch (_a.label) {
- case 0:
- _a.trys.push([0, 2, , 3]);
- return [4 /*yield*/, this.getSWRegistration_()];
- case 1:
- registration = _a.sent();
- return [3 /*break*/, 3];
- case 2:
- err_1 = _a.sent();
- throw errorFactory.create(ERROR_CODES.UNABLE_TO_RESUBSCRIBE, {
- message: err_1
- });
- case 3:
- _a.trys.push([3, 5, , 8]);
- return [4 /*yield*/, registration.pushManager.getSubscription()];
- case 4:
- _a.sent();
- return [3 /*break*/, 8];
- case 5:
- err_2 = _a.sent();
- tokenDetailsModel = this.getTokenDetailsModel();
- return [4 /*yield*/, tokenDetailsModel.getTokenDetailsFromSWScope(registration.scope)];
- case 6:
- tokenDetails = _a.sent();
- if (!tokenDetails) {
- // This should rarely occure, but could if indexedDB
- // is corrupted or wiped
- throw err_2;
- }
- // Attempt to delete the token if we know it's bad
- return [4 /*yield*/, this.deleteToken(tokenDetails.fcmToken)];
- case 7:
- // Attempt to delete the token if we know it's bad
- _a.sent();
- throw err_2;
- case 8: return [2 /*return*/];
- }
- });
- });
- };
- SwController.prototype.onNotificationClick_ = function (event) {
- return tslib_1.__awaiter(this, void 0, void 0, function () {
- var msgPayload, link, windowClient, internalMsg;
- return tslib_1.__generator(this, function (_a) {
- switch (_a.label) {
- case 0:
- if (!event.notification ||
- !event.notification.data ||
- !event.notification.data[FCM_MSG]) {
- // Not an FCM notification, do nothing.
- return [2 /*return*/];
- }
- else if (event.action) {
- // User clicked on an action button.
- // This will allow devs to act on action button clicks by using a custom
- // onNotificationClick listener that they define.
- return [2 /*return*/];
- }
- // Prevent other listeners from receiving the event
- event.stopImmediatePropagation();
- event.notification.close();
- msgPayload = event.notification.data[FCM_MSG];
- if (!msgPayload.notification) {
- // Nothing to do.
- return [2 /*return*/];
- }
- link = (msgPayload.fcmOptions && msgPayload.fcmOptions.link) ||
- msgPayload.notification.click_action;
- if (!link) {
- // Nothing to do.
- return [2 /*return*/];
- }
- return [4 /*yield*/, this.getWindowClient_(link)];
- case 1:
- windowClient = _a.sent();
- if (!!windowClient) return [3 /*break*/, 3];
- return [4 /*yield*/, self.clients.openWindow(link)];
- case 2:
- // Unable to find window client so need to open one.
- windowClient = _a.sent();
- return [3 /*break*/, 5];
- case 3: return [4 /*yield*/, windowClient.focus()];
- case 4:
- windowClient = _a.sent();
- _a.label = 5;
- case 5:
- if (!windowClient) {
- // Window Client will not be returned if it's for a third party origin.
- return [2 /*return*/];
- }
- // Delete notification and fcmOptions data from payload before sending to
- // the page.
- delete msgPayload.notification;
- delete msgPayload.fcmOptions;
- internalMsg = createNewMsg(MessageType.NOTIFICATION_CLICKED, msgPayload);
- // Attempt to send a message to the client to handle the data
- // Is affected by: https://github.com/slightlyoff/ServiceWorker/issues/728
- return [2 /*return*/, this.attemptToMessageClient_(windowClient, internalMsg)];
- }
- });
- });
- };
- // Visible for testing
- // TODO: Make private
- SwController.prototype.getNotificationData_ = function (msgPayload) {
- if (!msgPayload) {
- return;
- }
- if (typeof msgPayload.notification !== 'object') {
- return;
- }
- var notificationInformation = tslib_1.__assign({}, msgPayload.notification);
- // Put the message payload under FCM_MSG name so we can identify the
- // notification as being an FCM notification vs a notification from
- // somewhere else (i.e. normal web push or developer generated
- // notification).
- notificationInformation.data = tslib_1.__assign({}, msgPayload.notification.data, (_a = {}, _a[FCM_MSG] = msgPayload, _a));
- return notificationInformation;
- var _a;
- };
- /**
- * Calling setBackgroundMessageHandler will opt in to some specific
- * behaviours.
- * 1.) If a notification doesn't need to be shown due to a window already
- * being visible, then push messages will be sent to the page.
- * 2.) If a notification needs to be shown, and the message contains no
- * notification data this method will be called
- * and the promise it returns will be passed to event.waitUntil.
- * If you do not set this callback then all push messages will let and the
- * developer can handle them in a their own 'push' event callback
- *
- * @param callback The callback to be called when a push message is received
- * and a notification must be shown. The callback will be given the data from
- * the push message.
- */
- SwController.prototype.setBackgroundMessageHandler = function (callback) {
- if (!callback || typeof callback !== 'function') {
- throw errorFactory.create(ERROR_CODES.BG_HANDLER_FUNCTION_EXPECTED);
- }
- this.bgMessageHandler = callback;
- };
- /**
- * @param url The URL to look for when focusing a client.
- * @return Returns an existing window client or a newly opened WindowClient.
- */
- // Visible for testing
- // TODO: Make private
- SwController.prototype.getWindowClient_ = function (url) {
- return tslib_1.__awaiter(this, void 0, void 0, function () {
- var parsedURL, clientList, suitableClient, i, parsedClientUrl;
- return tslib_1.__generator(this, function (_a) {
- switch (_a.label) {
- case 0:
- parsedURL = new URL(url, self.location.href).href;
- return [4 /*yield*/, getClientList()];
- case 1:
- clientList = _a.sent();
- suitableClient = null;
- for (i = 0; i < clientList.length; i++) {
- parsedClientUrl = new URL(clientList[i].url, self.location.href)
- .href;
- if (parsedClientUrl === parsedURL) {
- suitableClient = clientList[i];
- break;
- }
- }
- return [2 /*return*/, suitableClient];
- }
- });
- });
- };
- /**
- * This message will attempt to send the message to a window client.
- * @param client The WindowClient to send the message to.
- * @param message The message to send to the client.
- * @returns Returns a promise that resolves after sending the message. This
- * does not guarantee that the message was successfully received.
- */
- // Visible for testing
- // TODO: Make private
- SwController.prototype.attemptToMessageClient_ = function (client, message) {
- return tslib_1.__awaiter(this, void 0, void 0, function () {
- return tslib_1.__generator(this, function (_a) {
- // NOTE: This returns a promise in case this API is abstracted later on to
- // do additional work
- if (!client) {
- throw errorFactory.create(ERROR_CODES.NO_WINDOW_CLIENT_TO_MSG);
- }
- client.postMessage(message);
- return [2 /*return*/];
- });
- });
- };
- /**
- * @returns If there is currently a visible WindowClient, this method will
- * resolve to true, otherwise false.
- */
- // Visible for testing
- // TODO: Make private
- SwController.prototype.hasVisibleClients_ = function () {
- return tslib_1.__awaiter(this, void 0, void 0, function () {
- var clientList;
- return tslib_1.__generator(this, function (_a) {
- switch (_a.label) {
- case 0: return [4 /*yield*/, getClientList()];
- case 1:
- clientList = _a.sent();
- return [2 /*return*/, clientList.some(function (client) { return client.visibilityState === 'visible'; })];
- }
- });
- });
- };
- /**
- * @param msgPayload The data from the push event that should be sent to all
- * available pages.
- * @returns Returns a promise that resolves once the message has been sent to
- * all WindowClients.
- */
- // Visible for testing
- // TODO: Make private
- SwController.prototype.sendMessageToWindowClients_ = function (msgPayload) {
- return tslib_1.__awaiter(this, void 0, void 0, function () {
- var _this = this;
- var clientList, internalMsg;
- return tslib_1.__generator(this, function (_a) {
- switch (_a.label) {
- case 0: return [4 /*yield*/, getClientList()];
- case 1:
- clientList = _a.sent();
- internalMsg = createNewMsg(MessageType.PUSH_MSG_RECEIVED, msgPayload);
- return [4 /*yield*/, Promise.all(clientList.map(function (client) {
- return _this.attemptToMessageClient_(client, internalMsg);
- }))];
- case 2:
- _a.sent();
- return [2 /*return*/];
- }
- });
- });
- };
- /**
- * This will register the default service worker and return the registration.
- * @return he service worker registration to be used for the push service.
- */
- SwController.prototype.getSWRegistration_ = function () {
- return tslib_1.__awaiter(this, void 0, void 0, function () {
- return tslib_1.__generator(this, function (_a) {
- return [2 /*return*/, self.registration];
- });
- });
- };
- /**
- * This will return the default VAPID key or the uint8array version of the
- * public VAPID key provided by the developer.
- */
- SwController.prototype.getPublicVapidKey_ = function () {
- return tslib_1.__awaiter(this, void 0, void 0, function () {
- var swReg, vapidKeyFromDatabase;
- return tslib_1.__generator(this, function (_a) {
- switch (_a.label) {
- case 0: return [4 /*yield*/, this.getSWRegistration_()];
- case 1:
- swReg = _a.sent();
- if (!swReg) {
- throw errorFactory.create(ERROR_CODES.SW_REGISTRATION_EXPECTED);
- }
- return [4 /*yield*/, this.getVapidDetailsModel().getVapidFromSWScope(swReg.scope)];
- case 2:
- vapidKeyFromDatabase = _a.sent();
- if (vapidKeyFromDatabase == null) {
- return [2 /*return*/, DEFAULT_PUBLIC_VAPID_KEY];
- }
- return [2 /*return*/, vapidKeyFromDatabase];
- }
- });
- });
- };
- return SwController;
-}(BaseController));
-function getClientList() {
- return self.clients.matchAll({
- type: 'window',
- includeUncontrolled: true
- // TS doesn't know that "type: 'window'" means it'll return WindowClient[]
- });
-}
-function createNewMsg(msgType, msgData) {
- return _a = {}, _a[MessageParameter.TYPE_OF_MSG] = msgType, _a[MessageParameter.DATA] = msgData, _a;
- var _a;
-}
+/***/ }),
-/**
- * Copyright 2017 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-var DEFAULT_SW_PATH = '/firebase-messaging-sw.js';
-var DEFAULT_SW_SCOPE = '/firebase-cloud-messaging-push-scope';
+/***/ "./src/views/info-view.jsx":
+/*!*********************************!*\
+ !*** ./src/views/info-view.jsx ***!
+ \*********************************/
+/*! exports provided: default */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
-/**
- * Copyright 2017 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-var WindowController = /** @class */ (function (_super) {
- tslib_1.__extends(WindowController, _super);
- /**
- * A service that provides a MessagingService instance.
- */
- function WindowController(app) {
- var _this = _super.call(this, app) || this;
- _this.registrationToUse = null;
- _this.publicVapidKeyToUse = null;
- _this.manifestCheckPromise = null;
- _this.messageObserver = null;
- // @ts-ignore: Unused variable error, this is not implemented yet.
- _this.tokenRefreshObserver = null;
- _this.onMessageInternal = util.createSubscribe(function (observer) {
- _this.messageObserver = observer;
- });
- _this.onTokenRefreshInternal = util.createSubscribe(function (observer) {
- _this.tokenRefreshObserver = observer;
- });
- _this.setupSWMessageListener_();
- return _this;
- }
- /**
- * This method returns an FCM token if it can be generated.
- * The return promise will reject if the browser doesn't support
- * FCM, if permission is denied for notifications or it's not
- * possible to generate a token.
- *
- * @return Returns a promise that resolves to an FCM token or null if
- * permission isn't granted.
- */
- WindowController.prototype.getToken = function () {
- return tslib_1.__awaiter(this, void 0, void 0, function () {
- return tslib_1.__generator(this, function (_a) {
- switch (_a.label) {
- case 0:
- if (!this.manifestCheckPromise) {
- this.manifestCheckPromise = manifestCheck();
- }
- return [4 /*yield*/, this.manifestCheckPromise];
- case 1:
- _a.sent();
- return [2 /*return*/, _super.prototype.getToken.call(this)];
- }
- });
- });
- };
- /**
- * Request permission if it is not currently granted
- *
- * @return Resolves if the permission was granted, otherwise rejects
- */
- WindowController.prototype.requestPermission = function () {
- return tslib_1.__awaiter(this, void 0, void 0, function () {
- var permissionResult;
- return tslib_1.__generator(this, function (_a) {
- switch (_a.label) {
- case 0:
- if (this.getNotificationPermission_() === 'granted') {
- return [2 /*return*/];
- }
- return [4 /*yield*/, Notification.requestPermission()];
- case 1:
- permissionResult = _a.sent();
- if (permissionResult === 'granted') {
- return [2 /*return*/];
- }
- else if (permissionResult === 'denied') {
- throw errorFactory.create(ERROR_CODES.PERMISSION_BLOCKED);
- }
- else {
- throw errorFactory.create(ERROR_CODES.PERMISSION_DEFAULT);
- }
- return [2 /*return*/];
- }
- });
- });
- };
- /**
- * This method allows a developer to override the default service worker and
- * instead use a custom service worker.
- *
- * @param registration The service worker registration that should be used to
- * receive the push messages.
- */
- WindowController.prototype.useServiceWorker = function (registration) {
- if (!(registration instanceof ServiceWorkerRegistration)) {
- throw errorFactory.create(ERROR_CODES.SW_REGISTRATION_EXPECTED);
- }
- if (this.registrationToUse != null) {
- throw errorFactory.create(ERROR_CODES.USE_SW_BEFORE_GET_TOKEN);
- }
- this.registrationToUse = registration;
- };
- /**
- * This method allows a developer to override the default vapid key
- * and instead use a custom VAPID public key.
- *
- * @param publicKey A URL safe base64 encoded string.
- */
- WindowController.prototype.usePublicVapidKey = function (publicKey) {
- if (typeof publicKey !== 'string') {
- throw errorFactory.create(ERROR_CODES.INVALID_PUBLIC_VAPID_KEY);
- }
- if (this.publicVapidKeyToUse != null) {
- throw errorFactory.create(ERROR_CODES.USE_PUBLIC_KEY_BEFORE_GET_TOKEN);
- }
- var parsedKey = base64ToArrayBuffer(publicKey);
- if (parsedKey.length !== 65) {
- throw errorFactory.create(ERROR_CODES.PUBLIC_KEY_DECRYPTION_FAILED);
- }
- this.publicVapidKeyToUse = parsedKey;
- };
- /**
- * @export
- * @param nextOrObserver An observer object or a function triggered on
- * message.
- * @param error A function triggered on message error.
- * @param completed function triggered when the observer is removed.
- * @return The unsubscribe function for the observer.
- */
- WindowController.prototype.onMessage = function (nextOrObserver, error, completed) {
- if (typeof nextOrObserver === 'function') {
- return this.onMessageInternal(nextOrObserver, error, completed);
- }
- else {
- return this.onMessageInternal(nextOrObserver);
- }
- };
- /**
- * @param nextOrObserver An observer object or a function triggered on token
- * refresh.
- * @param error A function triggered on token refresh error.
- * @param completed function triggered when the observer is removed.
- * @return The unsubscribe function for the observer.
- */
- WindowController.prototype.onTokenRefresh = function (nextOrObserver, error, completed) {
- if (typeof nextOrObserver === 'function') {
- return this.onTokenRefreshInternal(nextOrObserver, error, completed);
- }
- else {
- return this.onTokenRefreshInternal(nextOrObserver);
- }
- };
- /**
- * Given a registration, wait for the service worker it relates to
- * become activer
- * @param registration Registration to wait for service worker to become active
- * @return Wait for service worker registration to become active
- */
- // Visible for testing
- // TODO: Make private
- WindowController.prototype.waitForRegistrationToActivate_ = function (registration) {
- var serviceWorker = registration.installing || registration.waiting || registration.active;
- return new Promise(function (resolve, reject) {
- if (!serviceWorker) {
- // This is a rare scenario but has occured in firefox
- reject(errorFactory.create(ERROR_CODES.NO_SW_IN_REG));
- return;
- }
- // Because the Promise function is called on next tick there is a
- // small chance that the worker became active or redundant already.
- if (serviceWorker.state === 'activated') {
- resolve(registration);
- return;
- }
- if (serviceWorker.state === 'redundant') {
- reject(errorFactory.create(ERROR_CODES.SW_REG_REDUNDANT));
- return;
- }
- var stateChangeListener = function () {
- if (serviceWorker.state === 'activated') {
- resolve(registration);
- }
- else if (serviceWorker.state === 'redundant') {
- reject(errorFactory.create(ERROR_CODES.SW_REG_REDUNDANT));
- }
- else {
- // Return early and wait to next state change
- return;
- }
- serviceWorker.removeEventListener('statechange', stateChangeListener);
- };
- serviceWorker.addEventListener('statechange', stateChangeListener);
- });
- };
- /**
- * This will register the default service worker and return the registration
- * @return The service worker registration to be used for the push service.
- */
- WindowController.prototype.getSWRegistration_ = function () {
- var _this = this;
- if (this.registrationToUse) {
- return this.waitForRegistrationToActivate_(this.registrationToUse);
- }
- // Make the registration null so we know useServiceWorker will not
- // use a new service worker as registrationToUse is no longer undefined
- this.registrationToUse = null;
- return navigator.serviceWorker
- .register(DEFAULT_SW_PATH, {
- scope: DEFAULT_SW_SCOPE
- })
- .catch(function (err) {
- throw errorFactory.create(ERROR_CODES.FAILED_DEFAULT_REGISTRATION, {
- browserErrorMessage: err.message
- });
- })
- .then(function (registration) {
- return _this.waitForRegistrationToActivate_(registration).then(function () {
- _this.registrationToUse = registration;
- // We update after activation due to an issue with Firefox v49 where
- // a race condition occassionally causes the service work to not
- // install
- registration.update();
- return registration;
- });
- });
- };
- /**
- * This will return the default VAPID key or the uint8array version of the public VAPID key
- * provided by the developer.
- */
- WindowController.prototype.getPublicVapidKey_ = function () {
- return tslib_1.__awaiter(this, void 0, void 0, function () {
- return tslib_1.__generator(this, function (_a) {
- if (this.publicVapidKeyToUse) {
- return [2 /*return*/, this.publicVapidKeyToUse];
- }
- return [2 /*return*/, DEFAULT_PUBLIC_VAPID_KEY];
- });
- });
- };
- /**
- * This method will set up a message listener to handle
- * events from the service worker that should trigger
- * events in the page.
- */
- // Visible for testing
- // TODO: Make private
- WindowController.prototype.setupSWMessageListener_ = function () {
- var _this = this;
- navigator.serviceWorker.addEventListener('message', function (event) {
- if (!event.data || !event.data[MessageParameter.TYPE_OF_MSG]) {
- // Not a message from FCM
- return;
- }
- var workerPageMessage = event.data;
- switch (workerPageMessage[MessageParameter.TYPE_OF_MSG]) {
- case MessageType.PUSH_MSG_RECEIVED:
- case MessageType.NOTIFICATION_CLICKED:
- var pushMessage = workerPageMessage[MessageParameter.DATA];
- if (_this.messageObserver) {
- _this.messageObserver.next(pushMessage);
- }
- break;
- default:
- // Noop.
- break;
- }
- }, false);
- };
- return WindowController;
-}(BaseController));
-/**
- * The method checks that a manifest is defined and has the correct GCM
- * sender ID.
- * @return Returns a promise that resolves if the manifest matches
- * our required sender ID
- */
-// Exported for testing
-function manifestCheck() {
- return tslib_1.__awaiter(this, void 0, void 0, function () {
- var manifestTag, manifestContent, response, e_1;
- return tslib_1.__generator(this, function (_a) {
- switch (_a.label) {
- case 0:
- manifestTag = document.querySelector('link[rel="manifest"]');
- if (!manifestTag) {
- return [2 /*return*/];
- }
- _a.label = 1;
- case 1:
- _a.trys.push([1, 4, , 5]);
- return [4 /*yield*/, fetch(manifestTag.href)];
- case 2:
- response = _a.sent();
- return [4 /*yield*/, response.json()];
- case 3:
- manifestContent = _a.sent();
- return [3 /*break*/, 5];
- case 4:
- e_1 = _a.sent();
- // If the download or parsing fails allow check.
- // We only want to error if we KNOW that the gcm_sender_id is incorrect.
- return [2 /*return*/];
- case 5:
- if (!manifestContent || !manifestContent.gcm_sender_id) {
- return [2 /*return*/];
- }
- if (manifestContent.gcm_sender_id !== '103953800507') {
- throw errorFactory.create(ERROR_CODES.INCORRECT_GCM_SENDER_ID);
- }
- return [2 /*return*/];
- }
- });
- });
-}
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-intl */ \"react-intl\");\n/* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_intl__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var tinode_sdk__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! tinode-sdk */ \"../tinode-js/umd/tinode.prod.js\");\n/* harmony import */ var tinode_sdk__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(tinode_sdk__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _widgets_avatar_upload_jsx__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../widgets/avatar-upload.jsx */ \"./src/widgets/avatar-upload.jsx\");\n/* harmony import */ var _widgets_checkbox_jsx__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../widgets/checkbox.jsx */ \"./src/widgets/checkbox.jsx\");\n/* harmony import */ var _widgets_contact_list_jsx__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../widgets/contact-list.jsx */ \"./src/widgets/contact-list.jsx\");\n/* harmony import */ var _widgets_group_manager_jsx__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../widgets/group-manager.jsx */ \"./src/widgets/group-manager.jsx\");\n/* harmony import */ var _widgets_in_place_edit_jsx__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../widgets/in-place-edit.jsx */ \"./src/widgets/in-place-edit.jsx\");\n/* harmony import */ var _widgets_menu_cancel_jsx__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../widgets/menu-cancel.jsx */ \"./src/widgets/menu-cancel.jsx\");\n/* harmony import */ var _widgets_more_button_jsx__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../widgets/more-button.jsx */ \"./src/widgets/more-button.jsx\");\n/* harmony import */ var _widgets_permissions_editor_jsx__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../widgets/permissions-editor.jsx */ \"./src/widgets/permissions-editor.jsx\");\n/* harmony import */ var _widgets_tag_manager_jsx__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../widgets/tag-manager.jsx */ \"./src/widgets/tag-manager.jsx\");\n/* harmony import */ var _lib_blob_helpers_js__WEBPACK_IMPORTED_MODULE_12__ = __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 _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\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nvar messages = Object(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"defineMessages\"])({\n requested: {\n \"id\": \"requested_permissions\",\n \"defaultMessage\": \"Requested\"\n },\n granted: {\n \"id\": \"granted_permissions\",\n \"defaultMessage\": \"Granted\"\n },\n edit_permissions: {\n \"id\": \"menu_item_edit_permissions\",\n \"defaultMessage\": \"Edit permissions\"\n },\n other_user: {\n \"id\": \"label_other_user\",\n \"defaultMessage\": \"Other\"\n }\n});\n\nvar InfoView = function (_React$Component) {\n _inherits(InfoView, _React$Component);\n\n function InfoView(props) {\n var _this;\n\n _classCallCheck(this, InfoView);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(InfoView).call(this, props));\n _this.state = {\n topic: null,\n owner: false,\n admin: false,\n sharer: false,\n muted: false,\n address: null,\n groupTopic: undefined,\n fullName: undefined,\n avatar: null,\n private: null,\n selectedContact: null,\n access: null,\n modeGiven: null,\n modeWant: null,\n modeGiven2: null,\n modeWant2: null,\n auth: null,\n anon: null,\n contactList: [],\n tags: [],\n showMemberPanel: false,\n showPermissionEditorFor: undefined,\n moreInfoExpanded: false,\n previousMetaDesc: undefined,\n previousSubsUpdated: undefined,\n previousTagsUpdated: undefined\n };\n _this.resetSubs = _this.resetSubs.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.resetDesc = _this.resetDesc.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.onMetaDesc = _this.onMetaDesc.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.onSubsUpdated = _this.onSubsUpdated.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.onTagsUpdated = _this.onTagsUpdated.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleFullNameUpdate = _this.handleFullNameUpdate.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handlePrivateUpdate = _this.handlePrivateUpdate.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleImageChanged = _this.handleImageChanged.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleMuted = _this.handleMuted.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handlePermissionsChanged = _this.handlePermissionsChanged.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleLaunchPermissionsEditor = _this.handleLaunchPermissionsEditor.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleHidePermissionsEditor = _this.handleHidePermissionsEditor.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleShowAddMembers = _this.handleShowAddMembers.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleHideAddMembers = _this.handleHideAddMembers.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleMemberUpdateRequest = _this.handleMemberUpdateRequest.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleLeave = _this.handleLeave.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleMemberSelected = _this.handleMemberSelected.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleMoreInfo = _this.handleMoreInfo.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleTagsUpdated = _this.handleTagsUpdated.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleContextMenu = _this.handleContextMenu.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n return _this;\n }\n\n _createClass(InfoView, [{\n key: \"UNSAFE_componentWillReceiveProps\",\n value: function UNSAFE_componentWillReceiveProps(props) {\n var topic = this.props.tinode.getTopic(props.topic);\n\n if (!topic) {\n return;\n }\n\n if (this.onMetaDesc != topic.onMetaDesc) {\n this.previousMetaDesc = topic.onMetaDesc;\n topic.onMetaDesc = this.onMetaDesc;\n this.previousSubsUpdated = topic.onSubsUpdated;\n topic.onSubsUpdated = this.onSubsUpdated;\n\n if (topic.getType() == 'grp') {\n this.previousTagsUpdated = topic.onTagsUpdated;\n topic.onTagsUpdated = this.onTagsUpdated;\n } else {\n this.previousTagsUpdated = undefined;\n }\n }\n\n if (this.state.topic != props.topic) {\n this.setState({\n topic: props.topic\n });\n this.resetDesc(topic, props);\n this.resetSubs(topic, props);\n }\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n var topic = this.props.tinode.getTopic(this.props.topic);\n\n if (!topic) {\n return;\n }\n\n this.setState({\n topic: null\n });\n topic.onMetaDesc = this.previousMetaDesc;\n topic.onSubsUpdated = this.previousSubsUpdated;\n topic.onTagsUpdated = this.previousTagsUpdated;\n }\n }, {\n key: \"resetSubs\",\n value: function resetSubs(topic, props) {\n var newState = {\n contactList: []\n };\n\n if (topic.getType() == 'p2p') {\n var user2 = topic.subscriber(props.topic);\n\n if (user2) {\n newState.modeGiven2 = user2.acs.getGiven();\n newState.modeWant2 = user2.acs.getWant();\n }\n } else {\n topic.subscribers(function (sub) {\n newState.contactList.push(sub);\n }, this);\n }\n\n this.setState(newState);\n }\n }, {\n key: \"resetDesc\",\n value: function resetDesc(topic, props) {\n var defacs = topic.getDefaultAccess() || {};\n var acs = topic.getAccessMode();\n this.setState({\n owner: acs && acs.isOwner(),\n admin: acs && acs.isAdmin(),\n sharer: acs && (acs.isAdmin() || acs.isSharer()),\n muted: acs && acs.isMuted(),\n fullName: topic.public ? topic.public.fn : undefined,\n avatar: Object(_lib_blob_helpers_js__WEBPACK_IMPORTED_MODULE_12__[\"makeImageUrl\"])(topic.public ? topic.public.photo : null),\n private: topic.private ? topic.private.comment : null,\n address: topic.name,\n groupTopic: topic.getType() == 'grp',\n showMemberPanel: false,\n access: acs ? acs.getMode() : undefined,\n modeGiven: acs ? acs.getGiven() : undefined,\n modeWant: acs ? acs.getWant() : undefined,\n auth: defacs.auth,\n anon: defacs.anon\n });\n\n if (topic.getType() == 'grp' && acs && acs.isOwner()) {\n topic.getMeta(topic.startMetaQuery().withTags().build());\n }\n }\n }, {\n key: \"onMetaDesc\",\n value: function onMetaDesc(desc) {\n var topic = this.props.tinode.getTopic(this.props.topic);\n\n if (!topic) {\n return;\n }\n\n this.resetDesc(topic, this.props);\n\n if (this.previousMetaDesc && this.previousMetaDesc != this.onMetaDesc) {\n this.previousMetaDesc(desc);\n }\n }\n }, {\n key: \"onSubsUpdated\",\n value: function onSubsUpdated() {\n var topic = this.props.tinode.getTopic(this.props.topic);\n\n if (!topic) {\n return;\n }\n\n this.resetSubs(topic, this.props);\n\n if (this.previousSubsUpdated && this.previousSubsUpdated != this.onSubsUpdated) {\n this.previousSubsUpdated();\n }\n }\n }, {\n key: \"onTagsUpdated\",\n value: function onTagsUpdated(tags) {\n this.setState({\n tags: tags\n });\n\n if (this.previousTagsUpdated && this.previousTagsUpdated != this.onTagsUpdated) {\n this.previousTagsUpdated();\n }\n }\n }, {\n key: \"handleFullNameUpdate\",\n value: function handleFullNameUpdate(fn) {\n if (this.state.fullName !== fn) {\n this.setState({\n fullName: fn\n });\n this.props.onTopicDescUpdate(this.props.topic, vcard(fn, this.state.avatar), null);\n }\n }\n }, {\n key: \"handlePrivateUpdate\",\n value: function handlePrivateUpdate(priv) {\n if (this.state.priv !== priv) {\n this.setState({\n private: priv\n });\n this.props.onTopicDescUpdate(this.props.topic, null, priv || tinode_sdk__WEBPACK_IMPORTED_MODULE_2___default.a.DEL_CHAR);\n }\n }\n }, {\n key: \"handleImageChanged\",\n value: function handleImageChanged(img) {\n this.setState({\n avatar: img\n });\n this.props.onTopicDescUpdate(this.props.topic, vcard(this.state.fullName, img), null);\n }\n }, {\n key: \"handleMuted\",\n value: function handleMuted(ignored, checked) {\n this.setState({\n muted: checked\n });\n this.props.onChangePermissions(this.props.topic, checked ? '-P' : '+P');\n }\n }, {\n key: \"handlePermissionsChanged\",\n value: function handlePermissionsChanged(perm) {\n switch (this.state.showPermissionEditorFor) {\n case 'auth':\n this.props.onTopicDescUpdate(this.props.topic, null, null, {\n auth: perm\n });\n break;\n\n case 'anon':\n this.props.onTopicDescUpdate(this.props.topic, null, null, {\n anon: perm\n });\n break;\n\n case 'mode':\n case 'want':\n this.props.onChangePermissions(this.props.topic, perm);\n break;\n\n case 'given':\n this.props.onChangePermissions(this.props.topic, perm, this.props.topic);\n break;\n\n case 'user':\n this.props.onChangePermissions(this.props.topic, perm, this.state.userPermissionsEdited);\n break;\n }\n\n this.setState({\n showPermissionEditorFor: undefined\n });\n }\n }, {\n key: \"handleLaunchPermissionsEditor\",\n value: function handleLaunchPermissionsEditor(which, uid) {\n var formatMessage = this.props.intl.formatMessage;\n var toEdit, toCompare, toSkip, titleEdit, titleCompare, userTitle, userAvatar;\n\n switch (which) {\n case 'mode':\n toEdit = this.state.access;\n break;\n\n case 'want':\n toEdit = this.state.modeWant;\n toCompare = this.state.modeGiven;\n toSkip = this.state.groupTopic ? 'O' : 'ASDO';\n titleEdit = formatMessage(messages.requested);\n titleCompare = formatMessage(messages.granted);\n break;\n\n case 'given':\n toEdit = this.state.modeGiven2;\n toCompare = this.state.modeWant2;\n toSkip = this.state.groupTopic ? this.state.owner ? '' : 'O' : 'ASDO';\n titleEdit = formatMessage(messages.granted);\n titleCompare = formatMessage(messages.requested);\n break;\n\n case 'auth':\n toEdit = this.state.auth;\n toSkip = 'O';\n break;\n\n case 'anon':\n toEdit = this.state.anon;\n toSkip = 'O';\n break;\n\n case 'user':\n {\n var topic = this.props.tinode.getTopic(this.props.topic);\n\n if (!topic) {\n return;\n }\n\n var user = topic.subscriber(uid);\n\n if (!user || !user.acs) {\n return;\n }\n\n toEdit = user.acs.getGiven();\n toCompare = user.acs.getWant();\n toSkip = this.state.owner ? '' : 'O';\n titleEdit = formatMessage(messages.granted);\n titleCompare = formatMessage(messages.requested);\n\n if (user.public) {\n userTitle = user.public.fn;\n userAvatar = user.public.photo;\n }\n\n break;\n }\n\n default:\n console.log(\"Unknown permission editing mode '\" + which + \"'\");\n break;\n }\n\n this.setState({\n showPermissionEditorFor: which,\n userPermissionsEdited: uid,\n userPermissionsTitle: userTitle,\n userPermissionsAvatar: userAvatar,\n editedPermissions: toEdit,\n immutablePermissions: toCompare,\n editedPermissionsTitle: titleEdit,\n immutablePermissionsTitle: titleCompare,\n editedPermissionsSkipped: toSkip\n });\n }\n }, {\n key: \"handleHidePermissionsEditor\",\n value: function handleHidePermissionsEditor() {\n this.setState({\n showPermissionEditorFor: undefined\n });\n }\n }, {\n key: \"handleShowAddMembers\",\n value: function handleShowAddMembers() {\n this.props.onInitFind();\n this.setState({\n showMemberPanel: true\n });\n }\n }, {\n key: \"handleHideAddMembers\",\n value: function handleHideAddMembers() {\n this.setState({\n showMemberPanel: false\n });\n }\n }, {\n key: \"handleMemberUpdateRequest\",\n value: function handleMemberUpdateRequest(members, added, removed) {\n this.props.onMemberUpdateRequest(this.props.topic, added, removed);\n this.setState({\n showMemberPanel: false\n });\n }\n }, {\n key: \"handleLeave\",\n value: function handleLeave() {\n this.props.onLeaveTopic(this.props.topic);\n }\n }, {\n key: \"handleMemberSelected\",\n value: function handleMemberSelected(uid) {\n this.setState({\n selectedContact: uid\n });\n }\n }, {\n key: \"handleMoreInfo\",\n value: function handleMoreInfo(open) {\n this.setState({\n moreInfoExpanded: open\n });\n }\n }, {\n key: \"handleTagsUpdated\",\n value: function handleTagsUpdated(tags) {\n if (!arrayEqual(this.state.tags.slice(0), tags.slice(0))) {\n this.props.onTopicTagsUpdate(this.props.topic, tags);\n }\n }\n }, {\n key: \"handleContextMenu\",\n value: function handleContextMenu(params) {\n var formatMessage = this.props.intl.formatMessage;\n var instance = this;\n var topic = this.props.tinode.getTopic(this.props.topic);\n\n if (!topic) {\n return;\n }\n\n var user = topic.subscriber(params.topicName);\n\n if (!user || !user.acs) {\n return;\n }\n\n var menuItems = [{\n title: formatMessage(messages.edit_permissions),\n handler: function handler() {\n instance.handleLaunchPermissionsEditor('user', params.topicName);\n }\n }, 'member_delete', user.acs.isMuted() ? 'member_unmute' : 'member_mute', user.acs.isJoiner() ? 'member_block' : 'member_unblock'];\n this.props.showContextMenu({\n topicName: this.props.topic,\n x: params.x,\n y: params.y,\n user: params.topicName\n }, menuItems);\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this2 = this;\n\n var formatMessage = this.props.intl.formatMessage;\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n id: \"info-view\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"caption-panel\",\n id: \"info-caption-panel\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"panel-title\",\n id: \"info-title\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"title_info\",\n defaultMessage: \"Info\"\n })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_widgets_menu_cancel_jsx__WEBPACK_IMPORTED_MODULE_8__[\"default\"], {\n onCancel: this.props.onCancel\n }))), this.props.displayMobile ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(ErrorPanel, {\n level: this.props.errorLevel,\n text: this.props.errorText,\n onClearError: this.props.onError\n }) : null, this.state.showMemberPanel ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_widgets_group_manager_jsx__WEBPACK_IMPORTED_MODULE_6__[\"default\"], {\n members: this.state.contactList,\n requiredMember: this.props.myUserId,\n myUserId: this.props.myUserId,\n contacts: this.props.searchableContacts,\n onCancel: this.handleHideAddMembers,\n onSubmit: this.handleMemberUpdateRequest\n }) : this.state.showPermissionEditorFor ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_widgets_permissions_editor_jsx__WEBPACK_IMPORTED_MODULE_10__[\"default\"], {\n mode: this.state.editedPermissions,\n compare: this.state.immutablePermissions,\n skip: this.state.editedPermissionsSkipped,\n modeTitle: this.state.editedPermissionsTitle,\n compareTitle: this.state.immutablePermissionsTitle,\n userTitle: this.state.userPermissionsTitle,\n item: this.state.userPermissionsEdited,\n userAvatar: this.state.userPermissionsAvatar,\n onSubmit: this.handlePermissionsChanged,\n onCancel: this.handleHidePermissionsEditor\n }) : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n id: \"info-view-content\",\n className: \"scrollable-panel\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"panel-form-row\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"panel-form-column\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"label\", {\n className: \"small\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"label_topic_name\",\n defaultMessage: \"Name\"\n }))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_widgets_in_place_edit_jsx__WEBPACK_IMPORTED_MODULE_7__[\"default\"], {\n placeholder: this.state.groupTopic ? \"Group name\" : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"i\", null, \"Unknown\"),\n readOnly: !this.state.owner,\n value: this.state.fullName,\n onFinished: this.handleFullNameUpdate\n })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"label\", {\n className: \"small\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"label_private\",\n defaultMessage: \"Private comment\"\n }))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"private_editing_placeholder\",\n defaultMessage: \"Visible to you only\"\n }, function (private_placeholder) {\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_widgets_in_place_edit_jsx__WEBPACK_IMPORTED_MODULE_7__[\"default\"], {\n placeholder: private_placeholder,\n value: _this2.state.private,\n onFinished: _this2.handlePrivateUpdate\n });\n }))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_widgets_avatar_upload_jsx__WEBPACK_IMPORTED_MODULE_3__[\"default\"], {\n avatar: this.state.avatar,\n readOnly: !this.state.owner,\n uid: this.props.topic,\n title: this.state.fullName,\n onImageChanged: this.handleImageChanged,\n onError: this.props.onError\n })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"hr\"\n }), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"panel-form-column\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"panel-form-row\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"label\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"label_muting_topic\",\n defaultMessage: \"Muted:\"\n })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_widgets_checkbox_jsx__WEBPACK_IMPORTED_MODULE_4__[\"default\"], {\n name: \"P\",\n checked: this.state.muted,\n onChange: this.handleMuted\n })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"action_more\",\n defaultMessage: \"More\"\n }, function (more) {\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_widgets_more_button_jsx__WEBPACK_IMPORTED_MODULE_9__[\"default\"], {\n title: more,\n open: _this2.state.moreInfoExpanded,\n onToggle: _this2.handleMoreInfo\n });\n }), this.state.moreInfoExpanded ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"panel-form-column\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"panel-form-row\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"label\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"label_user_id\"\n })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"tt\", null, this.state.address)), this.state.groupTopic ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"panel-form-row\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"label\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"label_your_permissions\",\n defaultMessage: \"Your permissions:\"\n })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"tt\", {\n className: \"clickable\",\n onClick: this.handleLaunchPermissionsEditor.bind(this, 'want')\n }, this.state.access)) : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"label\", {\n className: \"small\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"label_permissions\",\n defaultMessage: \"Permissions:\"\n }))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"quoted\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"label_you\",\n defaultMessage: \"You:\"\n }), \" \\xA0\", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"tt\", {\n className: \"clickable\",\n onClick: this.handleLaunchPermissionsEditor.bind(this, 'want')\n }, this.state.access)), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, this.state.fullName ? this.state.fullName : formatMessage(messages.other_user), \": \\xA0\", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"tt\", {\n className: \"clickable\",\n onClick: this.handleLaunchPermissionsEditor.bind(this, 'given')\n }, this.state.modeGiven2)))), this.state.sharer && (this.state.auth || this.state.anon) ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"label\", {\n className: \"small\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"label_default_access\",\n defaultMessage: \"Default access mode:\"\n }))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"quoted\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, \"Auth: \", this.state.admin ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"tt\", {\n className: \"clickable\",\n onClick: this.handleLaunchPermissionsEditor.bind(this, 'auth')\n }, this.state.auth) : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"tt\", null, this.state.auth)), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, \"Anon: \", this.state.admin ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"tt\", {\n className: \"clickable\",\n onClick: this.handleLaunchPermissionsEditor.bind(this, 'anon')\n }, this.state.anon) : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"tt\", null, this.state.anon)))) : null) : null), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"hr\"\n }), this.state.owner ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"title_tag_manager\"\n }, function (tags) {\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_widgets_tag_manager_jsx__WEBPACK_IMPORTED_MODULE_11__[\"default\"], {\n title: tags,\n tags: _this2.state.tags,\n activated: false,\n onSubmit: _this2.handleTagsUpdated\n });\n }) : null, this.state.owner ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"hr\"\n }) : null, this.state.groupTopic ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"panel-form-column\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"panel-form-row\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"label\", {\n className: \"small\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"label_group_members\",\n defaultMessage: \"Group members:\"\n }))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"panel-form-row\"\n }, this.state.sharer ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"a\", {\n href: \"javascript:;\",\n className: \"flat-button\",\n onClick: this.handleShowAddMembers\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"i\", {\n className: \"material-icons\"\n }, \"person_add\"), \" \", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"button_add_members\",\n defaultMessage: \"Add members\"\n })) : null, !this.state.owner ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"a\", {\n href: \"javascript:;\",\n className: \"red flat-button\",\n onClick: this.handleLeave\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"i\", {\n className: \"material-icons\"\n }, \"exit_to_app\"), \" \", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"button_leave\",\n defaultMessage: \"Leave\"\n })) : null), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"group_has_no_members\",\n defaultMessage: \"No members\"\n }, function (no_members) {\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_widgets_contact_list_jsx__WEBPACK_IMPORTED_MODULE_5__[\"default\"], {\n contacts: _this2.state.contactList,\n myUserId: _this2.props.myUserId,\n emptyListMessage: no_members,\n topicSelected: _this2.state.selectedContact,\n showOnline: false,\n showUnread: false,\n showMode: true,\n noScroll: true,\n onTopicSelected: _this2.handleMemberSelected,\n showContextMenu: _this2.state.admin ? _this2.handleContextMenu : false\n });\n })) : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"panel-form-row\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"a\", {\n href: \"javascript:;\",\n className: \"red flat-button\",\n onClick: this.handleLeave\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"i\", {\n className: \"material-icons\"\n }, \"exit_to_app\"), \" \", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"action_leave_chat\",\n defaultMessage: \"Leave\"\n })))));\n }\n }]);\n\n return InfoView;\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\"])(InfoView));\n\n//# sourceURL=webpack:///./src/views/info-view.jsx?");
-/**
- * Copyright 2017 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-function registerMessaging(instance) {
- var messagingName = 'messaging';
- var factoryMethod = function (app) {
- if (!isSupported()) {
- throw errorFactory.create(ERROR_CODES.UNSUPPORTED_BROWSER);
- }
- if (self && 'ServiceWorkerGlobalScope' in self) {
- // Running in ServiceWorker context
- return new SwController(app);
- }
- else {
- // Assume we are in the window context.
- return new WindowController(app);
- }
- };
- var namespaceExports = {
- isSupported: isSupported
- };
- instance.INTERNAL.registerService(messagingName, factoryMethod, namespaceExports);
-}
-registerMessaging(firebase);
-function isSupported() {
- if (self && 'ServiceWorkerGlobalScope' in self) {
- // Running in ServiceWorker context
- return isSWControllerSupported();
- }
- else {
- // Assume we are in the window context.
- return isWindowControllerSupported();
- }
-}
-/**
- * Checks to see if the required APIs exist.
- */
-function isWindowControllerSupported() {
- return (navigator.cookieEnabled &&
- 'serviceWorker' in navigator &&
- 'PushManager' in window &&
- 'Notification' in window &&
- 'fetch' in window &&
- ServiceWorkerRegistration.prototype.hasOwnProperty('showNotification') &&
- PushSubscription.prototype.hasOwnProperty('getKey'));
-}
-/**
- * Checks to see if the required APIs exist within SW Context.
- */
-function isSWControllerSupported() {
- return ('PushManager' in self &&
- 'Notification' in self &&
- ServiceWorkerRegistration.prototype.hasOwnProperty('showNotification') &&
- PushSubscription.prototype.hasOwnProperty('getKey'));
-}
+/***/ }),
-exports.registerMessaging = registerMessaging;
-exports.isSupported = isSupported;
+/***/ "./src/views/login-view.jsx":
+/*!**********************************!*\
+ !*** ./src/views/login-view.jsx ***!
+ \**********************************/
+/*! exports provided: default */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
-},{"@firebase/app":1,"@firebase/util":5,"tslib":24}],3:[function(require,module,exports){
-(function (global,setImmediate){
-'use strict';
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return LoginView; });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-intl */ \"react-intl\");\n/* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_intl__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _widgets_checkbox_jsx__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../widgets/checkbox.jsx */ \"./src/widgets/checkbox.jsx\");\n/* harmony import */ var _widgets_visible_password_jsx__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../widgets/visible-password.jsx */ \"./src/widgets/visible-password.jsx\");\n/* harmony import */ var _lib_local_storage_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../lib/local-storage.js */ \"./src/lib/local-storage.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 _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\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\n\n\n\n\n\n\nvar LoginView = function (_React$Component) {\n _inherits(LoginView, _React$Component);\n\n function LoginView(props) {\n var _this;\n\n _classCallCheck(this, LoginView);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(LoginView).call(this, props));\n _this.state = {\n login: props.login,\n password: '',\n hostName: props.serverAddress,\n saveToken: _lib_local_storage_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"].getObject('keep-logged-in')\n };\n _this.handleLoginChange = _this.handleLoginChange.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handlePasswordChange = _this.handlePasswordChange.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleToggleSaveToken = _this.handleToggleSaveToken.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleSubmit = _this.handleSubmit.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n return _this;\n }\n\n _createClass(LoginView, [{\n key: \"handleLoginChange\",\n value: function handleLoginChange(e) {\n this.setState({\n login: e.target.value\n });\n }\n }, {\n key: \"handlePasswordChange\",\n value: function handlePasswordChange(e) {\n this.setState({\n password: e.target.value\n });\n }\n }, {\n key: \"handleToggleSaveToken\",\n value: function handleToggleSaveToken() {\n _lib_local_storage_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"].setObject('keep-logged-in', !this.state.saveToken);\n this.setState({\n saveToken: !this.state.saveToken\n });\n }\n }, {\n key: \"handleSubmit\",\n value: function handleSubmit(e) {\n e.preventDefault();\n this.props.onLogin(this.state.login.trim(), this.state.password.trim());\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this2 = this;\n\n var submitClasses = 'blue';\n\n if (this.props.disabled) {\n submitClasses += ' disabled';\n }\n\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"form\", {\n id: \"login-form\",\n onSubmit: this.handleSubmit\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"login_prompt\",\n defaultMessage: \"Login\"\n }, function (login_prompt) {\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"input\", {\n type: \"text\",\n id: \"inputLogin\",\n placeholder: login_prompt,\n autoComplete: \"username\",\n value: _this2.state.login,\n onChange: _this2.handleLoginChange,\n required: true,\n autoFocus: true\n });\n }), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"password_prompt\",\n defaultMessage: \"Password\"\n }, function (password_prompt) {\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_widgets_visible_password_jsx__WEBPACK_IMPORTED_MODULE_3__[\"default\"], {\n type: \"password\",\n id: \"inputPassword\",\n placeholder: password_prompt,\n autoComplete: \"current-password\",\n value: _this2.state.password,\n onChange: _this2.handlePasswordChange,\n required: true\n });\n }), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"panel-form-row\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_widgets_checkbox_jsx__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n id: \"save-token\",\n name: \"save-token\",\n checked: this.state.saveToken,\n onChange: this.handleToggleSaveToken\n }), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"label\", {\n htmlFor: \"save-token\"\n }, \"\\xA0\", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"stay_logged_in\",\n defaultMessage: \"Stay logged in\"\n })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"a\", {\n href: \"#reset\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"forgot_password_link\",\n defaultMessage: \"Forgot password?\"\n }))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"dialog-buttons\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"button\", {\n className: submitClasses,\n type: \"submit\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"button_sign_in\",\n defaultMessage: \"Sign in\"\n }))));\n }\n }]);\n\n return LoginView;\n}(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component);\n\n\n;\n\n//# sourceURL=webpack:///./src/views/login-view.jsx?");
-require('whatwg-fetch');
+/***/ }),
-// Store setTimeout reference so promise-polyfill will be unaffected by
-// other code modifying setTimeout (like sinon.useFakeTimers())
-var setTimeoutFunc = setTimeout;
+/***/ "./src/views/logo-view.jsx":
+/*!*********************************!*\
+ !*** ./src/views/logo-view.jsx ***!
+ \*********************************/
+/*! exports provided: default */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
-function noop() {}
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return LogoView; });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-intl */ \"react-intl\");\n/* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_intl__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var tinode_sdk__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! tinode-sdk */ \"../tinode-js/umd/tinode.prod.js\");\n/* harmony import */ var tinode_sdk__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(tinode_sdk__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _config_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../config.js */ \"./src/config.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\n\nvar LogoView = function (_React$PureComponent) {\n _inherits(LogoView, _React$PureComponent);\n\n function LogoView() {\n _classCallCheck(this, LogoView);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(LogoView).apply(this, arguments));\n }\n\n _createClass(LogoView, [{\n key: \"render\",\n value: function render() {\n var version = _config_js__WEBPACK_IMPORTED_MODULE_3__[\"APP_NAME\"] + ' (' + tinode_sdk__WEBPACK_IMPORTED_MODULE_2___default.a.getLibrary() + ')';\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n id: \"dummy-view\",\n className: this.props.hideSelf ? 'nodisplay' : null\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"a\", {\n href: \"https://github.com/tinode/chat/\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"img\", {\n id: \"logo\",\n alt: \"logo\",\n src: \"img/logo.svg\"\n }), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"h2\", null, \"Tinode Web\")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"p\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"label_client\",\n defaultMessage: \"Client:\"\n }), \" \", version), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"p\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"label_server\",\n defaultMessage: \"Server:\"\n }), \" \", this.props.serverVersion, \"(\", this.props.serverAddress, \")\")));\n }\n }]);\n\n return LogoView;\n}(react__WEBPACK_IMPORTED_MODULE_0___default.a.PureComponent);\n\n\n;\n\n//# sourceURL=webpack:///./src/views/logo-view.jsx?");
-// Polyfill for Function.prototype.bind
-function bind(fn, thisArg) {
- return function() {
- fn.apply(thisArg, arguments);
- };
-}
+/***/ }),
-function Promise(fn) {
- if (!(this instanceof Promise))
- throw new TypeError('Promises must be constructed via new');
- if (typeof fn !== 'function') throw new TypeError('not a function');
- this._state = 0;
- this._handled = false;
- this._value = undefined;
- this._deferreds = [];
+/***/ "./src/views/messages-view.jsx":
+/*!*************************************!*\
+ !*** ./src/views/messages-view.jsx ***!
+ \*************************************/
+/*! exports provided: default */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
- doResolve(fn, this);
-}
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-intl */ \"react-intl\");\n/* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_intl__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var tinode_sdk__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! tinode-sdk */ \"../tinode-js/umd/tinode.prod.js\");\n/* harmony import */ var tinode_sdk__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(tinode_sdk__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _widgets_chat_message_jsx__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../widgets/chat-message.jsx */ \"./src/widgets/chat-message.jsx\");\n/* harmony import */ var _widgets_error_panel_jsx__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../widgets/error-panel.jsx */ \"./src/widgets/error-panel.jsx\");\n/* harmony import */ var _widgets_group_subs_jsx__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../widgets/group-subs.jsx */ \"./src/widgets/group-subs.jsx\");\n/* harmony import */ var _widgets_image_preview_jsx__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../widgets/image-preview.jsx */ \"./src/widgets/image-preview.jsx\");\n/* harmony import */ var _widgets_letter_tile_jsx__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../widgets/letter-tile.jsx */ \"./src/widgets/letter-tile.jsx\");\n/* harmony import */ var _widgets_load_spinner_jsx__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../widgets/load-spinner.jsx */ \"./src/widgets/load-spinner.jsx\");\n/* harmony import */ var _logo_view_jsx__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./logo-view.jsx */ \"./src/views/logo-view.jsx\");\n/* harmony import */ var _widgets_send_message_jsx__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../widgets/send-message.jsx */ \"./src/widgets/send-message.jsx\");\n/* harmony import */ var _config_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../config.js */ \"./src/config.js\");\n/* harmony import */ var _lib_blob_helpers_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../lib/blob-helpers.js */ \"./src/lib/blob-helpers.js\");\n/* harmony import */ var _lib_strformat_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../lib/strformat.js */ \"./src/lib/strformat.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 _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\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nvar messages = Object(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"defineMessages\"])({\n online_now: {\n \"id\": \"online_now\",\n \"defaultMessage\": \"online now\"\n },\n last_seen: {\n \"id\": \"last_seen_timestamp\",\n \"defaultMessage\": \"Last seen\"\n },\n 'not_found': {\n \"id\": \"title_not_found\",\n \"defaultMessage\": \"Not found\"\n }\n});\n\nvar MessagesView = function (_React$Component) {\n _inherits(MessagesView, _React$Component);\n\n function MessagesView(props) {\n var _this;\n\n _classCallCheck(this, MessagesView);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(MessagesView).call(this, props));\n _this.state = {\n messages: [],\n onlineSubs: [],\n topic: '',\n title: '',\n avatar: null,\n scrollPosition: 0,\n readOnly: props.acs ? !props.acs.isWriter() : true,\n writeOnly: props.acs ? !props.acs.isReader() : true,\n typingIndicator: false,\n imagePreview: null\n };\n _this.propsChange = _this.propsChange.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.leave = _this.leave.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleScrollReference = _this.handleScrollReference.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.fetchMoreMessages = _this.fetchMoreMessages.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleDescChange = _this.handleDescChange.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleSubsUpdated = _this.handleSubsUpdated.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleNewMessage = _this.handleNewMessage.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleAllMessagesReceived = _this.handleAllMessagesReceived.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleInfoReceipt = _this.handleInfoReceipt.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleImagePreview = _this.handleImagePreview.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleCloseImagePreview = _this.handleCloseImagePreview.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleContextClick = _this.handleContextClick.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleShowContextMenuMessage = _this.handleShowContextMenuMessage.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleBackNavigation = _this.handleBackNavigation.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n return _this;\n }\n\n _createClass(MessagesView, [{\n key: \"componentDidUpdate\",\n value: function componentDidUpdate(prevProps, prevState) {\n if (this.messagesScroller && (prevState.title != this.state.title || prevState.messages.length != this.state.messages.length)) {\n this.messagesScroller.scrollTop = this.messagesScroller.scrollHeight - this.state.scrollPosition;\n }\n }\n }, {\n key: \"componentDidMount\",\n value: function componentDidMount() {\n this.propsChange(this.props);\n\n if (this.messagesScroller) {\n this.messagesScroller.addEventListener('scroll', this.fetchMoreMessages);\n }\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n this.leave(this.state.topic);\n\n if (this.messagesScroller) {\n this.messagesScroller.removeEventListener('scroll', this.fetchMoreMessages);\n }\n }\n }, {\n key: \"UNSAFE_componentWillReceiveProps\",\n value: function UNSAFE_componentWillReceiveProps(nextProps) {\n this.propsChange(nextProps);\n }\n }, {\n key: \"propsChange\",\n value: function propsChange(props) {\n var _this2 = this;\n\n if (!props || !props.topic) {\n var oldTopic = this.state.topic;\n this.setState({\n messages: [],\n onlineSubs: [],\n topic: null\n }, this.leave(oldTopic));\n return;\n }\n\n if (!props.connected) {\n this.setState({\n onlineSubs: []\n });\n return;\n }\n\n var topic = this.props.tinode.getTopic(props.topic);\n\n if (!topic) {\n return;\n }\n\n var newGroupTopic = tinode_sdk__WEBPACK_IMPORTED_MODULE_2___default.a.isNewGroupTopicName(props.topic);\n var tryToResubscribe = !this.props.connected && props.connected;\n\n if (props.topic != this.state.topic) {\n var msgs = [];\n var subs = [];\n topic.onData = this.handleNewMessage;\n topic.onAllMessagesReceived = this.handleAllMessagesReceived;\n topic.onInfo = this.handleInfoReceipt;\n topic.onMetaDesc = this.handleDescChange;\n topic.onSubsUpdated = this.handleSubsUpdated;\n topic.onPres = this.handleSubsUpdated;\n this.leave(this.state.topic);\n this.handleDescChange(topic);\n topic.subscribers(function (sub) {\n if (sub.online && sub.user != _this2.props.myUserId) {\n subs.push(sub);\n }\n });\n topic.messages(function (msg) {\n if (!msg.deleted) {\n msgs = msgs.concat(msg);\n }\n });\n this.setState({\n messages: msgs,\n onlineSubs: subs,\n topic: props.topic,\n imagePreview: null,\n scrollPosition: 0\n });\n tryToResubscribe = true;\n this.props.readTimerHandler(null);\n }\n\n this.setState({\n readOnly: props.acs ? !props.acs.isWriter() : true,\n writeOnly: props.acs ? !props.acs.isReader() : true\n });\n\n if (!topic.isSubscribed() && tryToResubscribe) {\n var getQuery = topic.startMetaQuery().withLaterDesc().withLaterSub().withLaterData(_config_js__WEBPACK_IMPORTED_MODULE_11__[\"MESSAGES_PAGE\"]).withLaterDel();\n var setQuery = newGroupTopic ? props.newGroupTopicParams : undefined;\n this.setState({\n fetchingMessages: true\n });\n topic.subscribe(getQuery.build(), setQuery).then(function (ctrl) {\n _this2.setState({\n topic: ctrl.topic\n });\n\n _this2.props.onNewTopicCreated(props.topic, ctrl.topic);\n\n topic.queuedMessages(function (pub) {\n if (!pub._sending && topic.isSubscribed()) {\n topic.publishMessage(pub);\n }\n });\n }).catch(function (err) {\n _this2.props.onError(err.message, 'err');\n\n var formatMessage = _this2.props.intl.formatMessage;\n\n _this2.setState({\n title: formatMessage(messages.not_found),\n avatar: null,\n readOnly: true,\n writeOnly: true,\n fetchingMessages: false,\n messages: [],\n onlineSubs: [],\n typingIndicator: false,\n imagePreview: null\n });\n });\n }\n }\n }, {\n key: \"leave\",\n value: function leave(oldTopicName) {\n var _this3 = this;\n\n if (!oldTopicName) {\n return;\n }\n\n var oldTopic = this.props.tinode.getTopic(oldTopicName);\n\n if (oldTopic && oldTopic.isSubscribed()) {\n oldTopic.leave(false).catch(function () {}).finally(function () {\n _this3.setState({\n fetchingMessages: false\n });\n\n oldTopic.onData = undefined;\n oldTopic.onAllMessagesReceived = undefined;\n oldTopic.onInfo = undefined;\n oldTopic.onMetaDesc = undefined;\n oldTopic.onSubsUpdated = undefined;\n oldTopic.onPres = undefined;\n });\n }\n }\n }, {\n key: \"handleScrollReference\",\n value: function handleScrollReference(node) {\n if (node) {\n node.addEventListener('scroll', this.fetchMoreMessages);\n this.messagesScroller = node;\n }\n }\n }, {\n key: \"fetchMoreMessages\",\n value: function fetchMoreMessages(event) {\n var _this4 = this;\n\n if (event.target.scrollTop <= 0) {\n var newState = {\n scrollPosition: event.target.scrollHeight - event.target.scrollTop\n };\n this.setState(function (prevState, props) {\n if (!prevState.fetchingMessages) {\n var topic = _this4.props.tinode.getTopic(_this4.state.topic);\n\n if (topic && topic.isSubscribed() && topic.msgHasMoreMessages()) {\n newState.fetchingMessages = true;\n topic.getMessagesPage(_config_js__WEBPACK_IMPORTED_MODULE_11__[\"MESSAGES_PAGE\"]).catch(function (err) {\n _this4.setState({\n fetchingMessages: false\n });\n\n _this4.props.onError(err.message, 'err');\n });\n }\n }\n\n return newState;\n });\n }\n }\n }, {\n key: \"handleDescChange\",\n value: function handleDescChange(desc) {\n if (desc.public) {\n this.setState({\n title: desc.public.fn,\n avatar: Object(_lib_blob_helpers_js__WEBPACK_IMPORTED_MODULE_12__[\"makeImageUrl\"])(desc.public.photo)\n });\n } else {\n this.setState({\n title: '',\n avatar: null\n });\n }\n\n if (desc.acs) {\n this.setState({\n readOnly: !desc.acs.isWriter(),\n writeOnly: !desc.acs.isReader()\n });\n }\n }\n }, {\n key: \"handleSubsUpdated\",\n value: function handleSubsUpdated() {\n var _this5 = this;\n\n if (this.state.topic) {\n var subs = [];\n var topic = this.props.tinode.getTopic(this.state.topic);\n topic.subscribers(function (sub) {\n if (sub.online && sub.user != _this5.props.myUserId) {\n subs.push(sub);\n }\n });\n this.setState({\n onlineSubs: subs\n });\n }\n }\n }, {\n key: \"handleNewMessage\",\n value: function handleNewMessage(msg) {\n var topic = this.props.tinode.getTopic(this.state.topic);\n var newState = {\n messages: []\n };\n topic.messages(function (m) {\n if (!m.deleted) {\n newState.messages = newState.messages.concat(m);\n }\n });\n\n if (msg && !msg.deleted) {\n if (topic.isNewMessage(msg.seq)) {\n newState.scrollPosition = 0;\n }\n\n var status = topic.msgStatus(msg);\n\n if (status >= tinode_sdk__WEBPACK_IMPORTED_MODULE_2___default.a.MESSAGE_STATUS_SENT) {\n this.props.readTimerHandler(function () {\n topic.noteRead(msg.seq);\n });\n }\n\n this.props.onData(msg);\n }\n\n this.setState(newState);\n }\n }, {\n key: \"handleAllMessagesReceived\",\n value: function handleAllMessagesReceived(count) {\n this.setState({\n fetchingMessages: false\n });\n }\n }, {\n key: \"handleInfoReceipt\",\n value: function handleInfoReceipt(info) {\n switch (info.what) {\n case 'kp':\n {\n clearTimeout(this.keyPressTimer);\n var instance = this;\n this.keyPressTimer = setTimeout(function () {\n instance.setState({\n typingIndicator: false\n });\n }, _config_js__WEBPACK_IMPORTED_MODULE_11__[\"KEYPRESS_DELAY\"] + 1000);\n\n if (!this.state.typingIndicator) {\n this.setState({\n typingIndicator: true\n });\n }\n\n break;\n }\n\n case 'read':\n case 'recv':\n this.forceUpdate();\n break;\n\n default:\n console.log(\"Other change in topic: \", info.what);\n }\n }\n }, {\n key: \"handleImagePreview\",\n value: function handleImagePreview(content) {\n this.setState({\n imagePreview: content\n });\n }\n }, {\n key: \"handleCloseImagePreview\",\n value: function handleCloseImagePreview() {\n this.setState({\n imagePreview: null\n });\n }\n }, {\n key: \"handleContextClick\",\n value: function handleContextClick(e) {\n e.preventDefault();\n e.stopPropagation();\n this.props.showContextMenu({\n topicName: this.state.topic,\n y: e.pageY,\n x: e.pageX\n });\n }\n }, {\n key: \"handleShowContextMenuMessage\",\n value: function handleShowContextMenuMessage(params) {\n params.topicName = this.state.topic;\n var menuItems = ['message_delete'];\n var topic = this.props.tinode.getTopic(params.topicName);\n\n if (topic) {\n var acs = topic.getAccessMode();\n\n if (acs && acs.isDeleter()) {\n menuItems.push('message_delete_hard');\n }\n }\n\n this.props.showContextMenu(params, menuItems);\n }\n }, {\n key: \"handleBackNavigation\",\n value: function handleBackNavigation() {\n this.props.onHideMessagesView();\n }\n }, {\n key: \"render\",\n value: function render() {\n var formatMessage = this.props.intl.formatMessage;\n var component;\n\n if (this.state.topic) {\n var messageNodes = [];\n var topic = this.props.tinode.getTopic(this.state.topic);\n var groupTopic = topic.getType() == 'grp';\n var previousFrom = null;\n var chatBoxClass = null;\n\n for (var i = 0; i < this.state.messages.length; i++) {\n var msg = this.state.messages[i];\n var nextFrom = null;\n\n if (i + 1 < this.state.messages.length) {\n nextFrom = this.state.messages[i + 1].from;\n }\n\n var sequence = 'single';\n\n if (msg.from == previousFrom) {\n if (msg.from == nextFrom) {\n sequence = 'middle';\n } else {\n sequence = 'last';\n }\n } else if (msg.from == nextFrom) {\n sequence = 'first';\n }\n\n previousFrom = msg.from;\n var isReply = !(msg.from == this.props.myUserId);\n var deliveryStatus = topic.msgStatus(msg);\n var userName = void 0,\n userAvatar = void 0,\n userFrom = void 0;\n\n if (groupTopic) {\n var user = topic.userDesc(msg.from);\n\n if (user && user.public) {\n userName = user.public.fn;\n userAvatar = Object(_lib_blob_helpers_js__WEBPACK_IMPORTED_MODULE_12__[\"makeImageUrl\"])(user.public.photo);\n }\n\n userFrom = msg.from;\n chatBoxClass = 'chat-box group';\n } else {\n chatBoxClass = 'chat-box';\n }\n\n messageNodes.push(react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_widgets_chat_message_jsx__WEBPACK_IMPORTED_MODULE_3__[\"default\"], {\n tinode: this.props.tinode,\n content: msg.content,\n mimeType: msg.head ? msg.head.mime : null,\n timestamp: msg.ts,\n response: isReply,\n seq: msg.seq,\n userFrom: userFrom,\n userName: userName,\n userAvatar: userAvatar,\n sequence: sequence,\n received: deliveryStatus,\n uploader: msg._uploader,\n viewportWidth: this.props.viewportWidth,\n showContextMenu: this.handleShowContextMenuMessage,\n onImagePreview: this.handleImagePreview,\n onError: this.props.onError,\n key: msg.seq\n }));\n }\n\n var lastSeen = null;\n var cont = this.props.tinode.getMeTopic().getContact(this.state.topic);\n\n if (cont && tinode_sdk__WEBPACK_IMPORTED_MODULE_2___default.a.topicType(cont.topic) == 'p2p') {\n if (cont.online) {\n lastSeen = formatMessage(messages.online_now);\n } else if (cont.seen) {\n lastSeen = formatMessage(messages.last_seen) + \": \" + Object(_lib_strformat_js__WEBPACK_IMPORTED_MODULE_13__[\"shortDateFormat\"])(cont.seen.when);\n }\n }\n\n var avatar = this.state.avatar || true;\n var online = this.props.online ? 'online' + (this.state.typingIndicator ? ' typing' : '') : 'offline';\n component = react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n id: \"topic-view\",\n className: this.props.hideSelf ? 'nodisplay' : null\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n id: \"topic-caption-panel\",\n className: \"caption-panel\"\n }, this.props.displayMobile ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"a\", {\n href: \"javascript:;\",\n id: \"hide-message-view\",\n onClick: this.handleBackNavigation\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"i\", {\n className: \"material-icons\"\n }, \"arrow_back\")) : null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"avatar-box\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_widgets_letter_tile_jsx__WEBPACK_IMPORTED_MODULE_7__[\"default\"], {\n avatar: avatar,\n topic: this.state.topic,\n title: this.state.title\n }), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", {\n className: online\n })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n id: \"topic-title-group\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n id: \"topic-title\",\n className: \"panel-title\"\n }, this.state.title || react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"i\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"unnamed_topic\",\n defaultMessage: \"Unnamed\"\n }))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n id: \"topic-last-seen\"\n }, lastSeen)), groupTopic ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_widgets_group_subs_jsx__WEBPACK_IMPORTED_MODULE_5__[\"default\"], {\n subscribers: this.state.onlineSubs\n }) : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n id: \"topic-users\"\n }), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"a\", {\n href: \"javascript:;\",\n onClick: this.handleContextClick\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"i\", {\n className: \"material-icons\"\n }, \"more_vert\")))), this.props.displayMobile ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_widgets_error_panel_jsx__WEBPACK_IMPORTED_MODULE_4__[\"default\"], {\n level: this.props.errorLevel,\n text: this.props.errorText,\n onClearError: this.props.onError\n }) : null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_widgets_load_spinner_jsx__WEBPACK_IMPORTED_MODULE_8__[\"default\"], {\n show: this.state.fetchingMessages\n }), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n id: \"messages-container\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n id: \"messages-panel\",\n ref: this.handleScrollReference\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"ul\", {\n id: \"scroller\",\n className: chatBoxClass\n }, messageNodes)), this.state.writeOnly ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n id: \"write-only-background\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n id: \"write-only-note\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"messages_not_readable\",\n defaultMessage: \"no access to messages\"\n }))) : null), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_widgets_send_message_jsx__WEBPACK_IMPORTED_MODULE_10__[\"default\"], {\n tinode: this.props.tinode,\n topic: this.props.topic,\n disabled: this.state.readOnly,\n sendMessage: this.props.sendMessage,\n onError: this.props.onError\n }), this.state.imagePreview ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_widgets_image_preview_jsx__WEBPACK_IMPORTED_MODULE_6__[\"default\"], {\n content: this.state.imagePreview,\n onClose: this.handleCloseImagePreview\n }) : null);\n } else {\n component = react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_logo_view_jsx__WEBPACK_IMPORTED_MODULE_9__[\"default\"], {\n hideSelf: this.props.hideSelf,\n serverVersion: this.props.serverVersion,\n serverAddress: this.props.serverAddress\n });\n }\n\n return component;\n }\n }]);\n\n return MessagesView;\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\"])(MessagesView));\n\n//# sourceURL=webpack:///./src/views/messages-view.jsx?");
-function handle(self, deferred) {
- while (self._state === 3) {
- self = self._value;
- }
- if (self._state === 0) {
- self._deferreds.push(deferred);
- return;
- }
- self._handled = true;
- Promise._immediateFn(function() {
- var cb = self._state === 1 ? deferred.onFulfilled : deferred.onRejected;
- if (cb === null) {
- (self._state === 1 ? resolve : reject)(deferred.promise, self._value);
- return;
- }
- var ret;
- try {
- ret = cb(self._value);
- } catch (e) {
- reject(deferred.promise, e);
- return;
- }
- resolve(deferred.promise, ret);
- });
-}
+/***/ }),
-function resolve(self, newValue) {
- try {
- // Promise Resolution Procedure: https://github.com/promises-aplus/promises-spec#the-promise-resolution-procedure
- if (newValue === self)
- throw new TypeError('A promise cannot be resolved with itself.');
- if (
- newValue &&
- (typeof newValue === 'object' || typeof newValue === 'function')
- ) {
- var then = newValue.then;
- if (newValue instanceof Promise) {
- self._state = 3;
- self._value = newValue;
- finale(self);
- return;
- } else if (typeof then === 'function') {
- doResolve(bind(then, newValue), self);
- return;
- }
- }
- self._state = 1;
- self._value = newValue;
- finale(self);
- } catch (e) {
- reject(self, e);
- }
-}
+/***/ "./src/views/new-topic-view.jsx":
+/*!**************************************!*\
+ !*** ./src/views/new-topic-view.jsx ***!
+ \**************************************/
+/*! exports provided: default */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
-function reject(self, newValue) {
- self._state = 2;
- self._value = newValue;
- finale(self);
-}
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return NewTopicView; });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-intl */ \"react-intl\");\n/* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_intl__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _widgets_contact_list_jsx__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../widgets/contact-list.jsx */ \"./src/widgets/contact-list.jsx\");\n/* harmony import */ var _widgets_new_topic_by_id_jsx__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../widgets/new-topic-by-id.jsx */ \"./src/widgets/new-topic-by-id.jsx\");\n/* harmony import */ var _widgets_new_topic_group_jsx__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../widgets/new-topic-group.jsx */ \"./src/widgets/new-topic-group.jsx\");\n/* harmony import */ var _widgets_search_contacts_jsx__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../widgets/search-contacts.jsx */ \"./src/widgets/search-contacts.jsx\");\n/* harmony import */ var _lib_navigation_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../lib/navigation.js */ \"./src/lib/navigation.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 _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\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\n\n\n\n\n\n\n\n\nvar NewTopicView = function (_React$Component) {\n _inherits(NewTopicView, _React$Component);\n\n function NewTopicView(props) {\n var _this;\n\n _classCallCheck(this, NewTopicView);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(NewTopicView).call(this, props));\n _this.state = {\n tabSelected: 'p2p',\n contactList: props.searchResults\n };\n _this.handleTabClick = _this.handleTabClick.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleContactSelected = _this.handleContactSelected.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleNewGroupSubmit = _this.handleNewGroupSubmit.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleGroupByID = _this.handleGroupByID.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n return _this;\n }\n\n _createClass(NewTopicView, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n this.props.onInitFind();\n }\n }, {\n key: \"handleTabClick\",\n value: function handleTabClick(e) {\n e.preventDefault();\n _lib_navigation_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"].navigateTo(_lib_navigation_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"].addUrlParam(window.location.hash, 'tab', e.currentTarget.dataset.id));\n this.setState({\n tabSelected: e.currentTarget.dataset.id\n });\n }\n }, {\n key: \"handleContactSelected\",\n value: function handleContactSelected(sel) {\n if (this.state.tabSelected === 'p2p') {\n _lib_navigation_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"].navigateTo(_lib_navigation_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"].removeUrlParam(window.location.hash, 'tab'));\n this.props.onCreateTopic(sel, undefined);\n }\n }\n }, {\n key: \"handleNewGroupSubmit\",\n value: function handleNewGroupSubmit(name, dataUrl, priv, tags) {\n _lib_navigation_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"].navigateTo(_lib_navigation_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"].removeUrlParam(window.location.hash, 'tab'));\n this.props.onCreateTopic(undefined, vcard(name, dataUrl), priv, tags);\n }\n }, {\n key: \"handleGroupByID\",\n value: function handleGroupByID(topicName) {\n _lib_navigation_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"].navigateTo(_lib_navigation_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"].removeUrlParam(window.location.hash, 'tab'));\n this.props.onCreateTopic(topicName);\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this2 = this;\n\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"flex-column\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"ul\", {\n className: \"tabbar\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"li\", {\n className: this.state.tabSelected === \"p2p\" ? \"active\" : null\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"a\", {\n href: \"javascript:;\",\n \"data-id\": \"p2p\",\n onClick: this.handleTabClick\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"tabtitle_find_user\",\n defaultMessage: \"find\"\n }))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"li\", {\n className: this.state.tabSelected === \"grp\" ? \"active\" : null\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"a\", {\n href: \"javascript:;\",\n \"data-id\": \"grp\",\n onClick: this.handleTabClick\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"tabtitle_new_group\",\n defaultMessage: \"new group\"\n }))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"li\", {\n className: this.state.tabSelected === \"byid\" ? \"active\" : null\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"a\", {\n href: \"javascript:;\",\n \"data-id\": \"byid\",\n onClick: this.handleTabClick\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"tabtitle_group_by_id\",\n defaultMessage: \"by id\"\n })))), this.state.tabSelected === 'grp' ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_widgets_new_topic_group_jsx__WEBPACK_IMPORTED_MODULE_4__[\"default\"], {\n onSubmit: this.handleNewGroupSubmit\n }) : this.state.tabSelected === 'byid' ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_widgets_new_topic_by_id_jsx__WEBPACK_IMPORTED_MODULE_3__[\"default\"], {\n onSubmit: this.handleGroupByID,\n onError: this.props.onError\n }) : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"flex-column\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_widgets_search_contacts_jsx__WEBPACK_IMPORTED_MODULE_5__[\"default\"], {\n type: \"p2p\",\n onSearchContacts: this.props.onSearchContacts\n }), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"search_for_contacts\",\n defaultMessage: \"Use search to find contacts\"\n }, function (search_for_contacts) {\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_widgets_contact_list_jsx__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n contacts: _this2.state.contactList,\n myUserId: _this2.props.myUserId,\n emptyListMessage: search_for_contacts,\n topicSelected: _this2.state.selectedContact,\n showOnline: false,\n showUnread: false,\n showContextMenu: false,\n onTopicSelected: _this2.handleContactSelected\n });\n })));\n }\n }], [{\n key: \"getDerivedStateFromProps\",\n value: function getDerivedStateFromProps(nextProps, prevState) {\n return {\n contactList: nextProps.searchResults\n };\n }\n }]);\n\n return NewTopicView;\n}(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component);\n\n\n;\n\n//# sourceURL=webpack:///./src/views/new-topic-view.jsx?");
-function finale(self) {
- if (self._state === 2 && self._deferreds.length === 0) {
- Promise._immediateFn(function() {
- if (!self._handled) {
- Promise._unhandledRejectionFn(self._value);
- }
- });
- }
+/***/ }),
- for (var i = 0, len = self._deferreds.length; i < len; i++) {
- handle(self, self._deferreds[i]);
- }
- self._deferreds = null;
-}
+/***/ "./src/views/password-reset-view.jsx":
+/*!*******************************************!*\
+ !*** ./src/views/password-reset-view.jsx ***!
+ \*******************************************/
+/*! exports provided: default */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
-function Handler(onFulfilled, onRejected, promise) {
- this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null;
- this.onRejected = typeof onRejected === 'function' ? onRejected : null;
- this.promise = promise;
-}
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return PasswordResetView; });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-intl */ \"react-intl\");\n/* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_intl__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _widgets_visible_password_jsx__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../widgets/visible-password.jsx */ \"./src/widgets/visible-password.jsx\");\n/* harmony import */ var _lib_navigation_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../lib/navigation.js */ \"./src/lib/navigation.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 _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\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\n\n\n\n\n\nvar PasswordResetView = function (_React$PureComponent) {\n _inherits(PasswordResetView, _React$PureComponent);\n\n function PasswordResetView(props) {\n var _this;\n\n _classCallCheck(this, PasswordResetView);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(PasswordResetView).call(this, props));\n _this.state = {\n email: '',\n password: ''\n };\n _this.handleSubmit = _this.handleSubmit.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleEmailChange = _this.handleEmailChange.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handlePasswordChange = _this.handlePasswordChange.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n return _this;\n }\n\n _createClass(PasswordResetView, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n var parsed = _lib_navigation_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"].parseUrlHash(window.location.hash);\n this.setState({\n token: parsed.params.token,\n scheme: parsed.params.scheme\n });\n }\n }, {\n key: \"handleSubmit\",\n value: function handleSubmit(e) {\n e.preventDefault();\n\n if (this.state.token) {\n this.props.onReset(this.state.scheme, this.state.password.trim(), this.state.token);\n } else {\n this.props.onRequest('email', this.state.email.trim());\n }\n }\n }, {\n key: \"handleEmailChange\",\n value: function handleEmailChange(e) {\n this.setState({\n email: e.target.value\n });\n }\n }, {\n key: \"handlePasswordChange\",\n value: function handlePasswordChange(e) {\n this.setState({\n password: e.target.value\n });\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this2 = this;\n\n var reset = this.state.token && this.state.scheme;\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"form\", {\n id: \"password-reset-form\",\n onSubmit: this.handleSubmit\n }, reset ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"new_password_placeholder\",\n defaultMessage: \"Enter new password\"\n }, function (placeholder) {\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_widgets_visible_password_jsx__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n placeholder: placeholder,\n autoComplete: \"new-password\",\n value: _this2.state.password,\n required: true,\n autoFocus: true,\n onChange: _this2.handlePasswordChange\n });\n }) : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_0___default.a.Fragment, null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"label\", {\n htmlFor: \"inputEmail\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"label_reset_password\",\n defaultMessage: \"Send a password reset email:\"\n })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"credential_email_prompt\",\n defaultMessage: \"Your registration email\"\n }, function (placeholder) {\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"input\", {\n type: \"email\",\n id: \"inputEmail\",\n placeholder: placeholder,\n autoComplete: \"email\",\n value: _this2.state.email,\n onChange: _this2.handleEmailChange,\n required: true,\n autoFocus: true\n });\n })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"dialog-buttons\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"button\", {\n className: \"blue\",\n type: \"submit\"\n }, reset ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"button_reset\",\n defaultMessage: \"Reset\"\n }) : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"button_send_request\",\n defaultMessage: \"Send request\"\n }))));\n }\n }]);\n\n return PasswordResetView;\n}(react__WEBPACK_IMPORTED_MODULE_0___default.a.PureComponent);\n\n\n\n//# sourceURL=webpack:///./src/views/password-reset-view.jsx?");
-/**
- * Take a potentially misbehaving resolver function and make sure
- * onFulfilled and onRejected are only called once.
- *
- * Makes no guarantees about asynchrony.
- */
-function doResolve(fn, self) {
- var done = false;
- try {
- fn(
- function(value) {
- if (done) return;
- done = true;
- resolve(self, value);
- },
- function(reason) {
- if (done) return;
- done = true;
- reject(self, reason);
- }
- );
- } catch (ex) {
- if (done) return;
- done = true;
- reject(self, ex);
- }
-}
+/***/ }),
-Promise.prototype['catch'] = function(onRejected) {
- return this.then(null, onRejected);
-};
+/***/ "./src/views/settings-view.jsx":
+/*!*************************************!*\
+ !*** ./src/views/settings-view.jsx ***!
+ \*************************************/
+/*! exports provided: default */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
-Promise.prototype.then = function(onFulfilled, onRejected) {
- var prom = new this.constructor(noop);
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return SettingsView; });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-intl */ \"react-intl\");\n/* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_intl__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _widgets_host_selector_jsx__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../widgets/host-selector.jsx */ \"./src/widgets/host-selector.jsx\");\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 _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\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\n\n\n\n\nvar SettingsView = function (_React$PureComponent) {\n _inherits(SettingsView, _React$PureComponent);\n\n function SettingsView(props) {\n var _this;\n\n _classCallCheck(this, SettingsView);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(SettingsView).call(this, props));\n _this.state = {\n transport: props.transport || 'def',\n serverAddress: props.serverAddress\n };\n _this.handleSubmit = _this.handleSubmit.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleTransportSelected = _this.handleTransportSelected.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleServerAddressChange = _this.handleServerAddressChange.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n return _this;\n }\n\n _createClass(SettingsView, [{\n key: \"handleSubmit\",\n value: function handleSubmit(e) {\n e.preventDefault();\n this.props.onUpdate({\n transport: this.state.transport,\n serverAddress: this.state.serverAddress\n });\n }\n }, {\n key: \"handleTransportSelected\",\n value: function handleTransportSelected(e) {\n this.setState({\n transport: e.currentTarget.value\n });\n }\n }, {\n key: \"handleServerAddressChange\",\n value: function handleServerAddressChange(name) {\n this.setState({\n serverAddress: name\n });\n this.props.onServerAddressChange(name);\n }\n }, {\n key: \"render\",\n value: function render() {\n var names = {\n def: \"default\",\n ws: \"websocket\",\n lp: \"long polling\"\n };\n var transportOptions = [];\n var instance = this;\n ['def', 'ws', 'lp'].map(function (item) {\n var id = 'transport-' + item;\n var name = names[item];\n transportOptions.push(react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"li\", {\n key: item\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"input\", {\n type: \"radio\",\n id: id,\n name: \"transport-select\",\n value: item,\n checked: instance.state.transport === item,\n onChange: instance.handleTransportSelected\n }), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"label\", {\n htmlFor: id\n }, name)));\n });\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"form\", {\n id: \"settings-form\",\n className: \"panel-form\",\n onSubmit: this.handleSubmit\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"panel-form-row\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"label\", {\n className: \"small\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"label_server_to_use\",\n defaultMessage: \"Server to use:\"\n }))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_widgets_host_selector_jsx__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n serverAddress: this.state.serverAddress,\n onServerAddressChange: this.handleServerAddressChange\n }), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"panel-form-row\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"label\", {\n className: \"small\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"label_wire_transport\",\n defaultMessage: \"Wire transport:\"\n }))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"panel-form-row\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"ul\", {\n className: \"quoted\"\n }, transportOptions)), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"dialog-buttons\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"button\", {\n type: \"submit\",\n className: \"blue\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"button_update\",\n defaultMessage: \"Update\"\n }))));\n }\n }]);\n\n return SettingsView;\n}(react__WEBPACK_IMPORTED_MODULE_0___default.a.PureComponent);\n\n\n;\n\n//# sourceURL=webpack:///./src/views/settings-view.jsx?");
- handle(this, new Handler(onFulfilled, onRejected, prom));
- return prom;
-};
+/***/ }),
-Promise.prototype['finally'] = function(callback) {
- var constructor = this.constructor;
- return this.then(
- function(value) {
- return constructor.resolve(callback()).then(function() {
- return value;
- });
- },
- function(reason) {
- return constructor.resolve(callback()).then(function() {
- return constructor.reject(reason);
- });
- }
- );
-};
+/***/ "./src/views/sidepanel-view.jsx":
+/*!**************************************!*\
+ !*** ./src/views/sidepanel-view.jsx ***!
+ \**************************************/
+/*! exports provided: default */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
-Promise.all = function(arr) {
- return new Promise(function(resolve, reject) {
- if (!arr || typeof arr.length === 'undefined')
- throw new TypeError('Promise.all accepts an array');
- var args = Array.prototype.slice.call(arr);
- if (args.length === 0) return resolve([]);
- var remaining = args.length;
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-intl */ \"react-intl\");\n/* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_intl__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _widgets_side_navbar_jsx__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../widgets/side-navbar.jsx */ \"./src/widgets/side-navbar.jsx\");\n/* harmony import */ var _widgets_error_panel_jsx__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../widgets/error-panel.jsx */ \"./src/widgets/error-panel.jsx\");\n/* harmony import */ var _contacts_view_jsx__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./contacts-view.jsx */ \"./src/views/contacts-view.jsx\");\n/* harmony import */ var _create_account_view_jsx__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./create-account-view.jsx */ \"./src/views/create-account-view.jsx\");\n/* harmony import */ var _edit_account_view_jsx__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./edit-account-view.jsx */ \"./src/views/edit-account-view.jsx\");\n/* harmony import */ var _login_view_jsx__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./login-view.jsx */ \"./src/views/login-view.jsx\");\n/* harmony import */ var _new_topic_view_jsx__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./new-topic-view.jsx */ \"./src/views/new-topic-view.jsx\");\n/* harmony import */ var _password_reset_view_jsx__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./password-reset-view.jsx */ \"./src/views/password-reset-view.jsx\");\n/* harmony import */ var _settings_view_jsx__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./settings-view.jsx */ \"./src/views/settings-view.jsx\");\n/* harmony import */ var _validation_view_jsx__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./validation-view.jsx */ \"./src/views/validation-view.jsx\");\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 _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\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\n\n\n\n\n\n\n\n\n\n\n\n\nvar messages = Object(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"defineMessages\"])({\n 'login': {\n \"id\": \"sidepanel_title_login\",\n \"defaultMessage\": \"Sign In\"\n },\n 'register': {\n \"id\": \"sidepanel_title_register\",\n \"defaultMessage\": \"Create Account\"\n },\n 'settings': {\n \"id\": \"sidepanel_title_settings\",\n \"defaultMessage\": \"Settings\"\n },\n 'edit': {\n \"id\": \"sidepanel_title_edit_account\",\n \"defaultMessage\": \"Edit Account\"\n },\n 'newtpk': {\n \"id\": \"sidepanel_title_newtpk\",\n \"defaultMessage\": \"Start New Chat\"\n },\n 'cred': {\n \"id\": \"sidepanel_title_cred\",\n \"defaultMessage\": \"Confirm Credentials\"\n },\n 'reset': {\n \"id\": \"sidepanel_title_reset\",\n \"defaultMessage\": \"Reset Password\"\n }\n});\n\nvar SidepanelView = function (_React$Component) {\n _inherits(SidepanelView, _React$Component);\n\n function SidepanelView(props) {\n var _this;\n\n _classCallCheck(this, SidepanelView);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(SidepanelView).call(this, props));\n _this.handleLoginRequested = _this.handleLoginRequested.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n return _this;\n }\n\n _createClass(SidepanelView, [{\n key: \"handleLoginRequested\",\n value: function handleLoginRequested(login, password) {\n this.props.onLoginRequest(login, password);\n }\n }, {\n key: \"render\",\n value: function render() {\n var formatMessage = this.props.intl.formatMessage;\n var view = this.props.state || (this.props.myUserId ? 'contacts' : 'login');\n var title, avatar;\n\n if (view == 'contacts') {\n title = this.props.title;\n avatar = this.props.avatar ? this.props.avatar : true;\n } else {\n title = formatMessage(messages[view]);\n avatar = false;\n }\n\n var onCancel;\n\n if (view != 'login') {\n onCancel = this.props.onCancel;\n }\n\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n id: \"sidepanel\",\n className: this.props.hideSelf ? 'nodisplay' : null\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_widgets_side_navbar_jsx__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n state: view,\n title: title,\n avatar: avatar,\n myUserId: this.props.myUserId,\n onSignUp: this.props.onSignUp,\n onSettings: this.props.onSettings,\n onNewTopic: this.props.onNewTopic,\n onCancel: onCancel\n }), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_widgets_error_panel_jsx__WEBPACK_IMPORTED_MODULE_3__[\"default\"], {\n level: this.props.errorLevel,\n text: this.props.errorText,\n onClearError: this.props.onError\n }), view === 'login' ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_login_view_jsx__WEBPACK_IMPORTED_MODULE_7__[\"default\"], {\n login: this.props.login,\n disabled: this.props.loginDisabled,\n onLogin: this.handleLoginRequested\n }) : view === 'register' ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_create_account_view_jsx__WEBPACK_IMPORTED_MODULE_5__[\"default\"], {\n onCreateAccount: this.props.onCreateAccount,\n onCancel: this.props.onCancel,\n onError: this.props.onError\n }) : view === 'settings' ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_settings_view_jsx__WEBPACK_IMPORTED_MODULE_10__[\"default\"], {\n transport: this.props.transport,\n serverAddress: this.props.serverAddress,\n onServerAddressChange: this.props.onGlobalSettings,\n onCancel: this.props.onCancel,\n onUpdate: this.props.onGlobalSettings\n }) : view === 'edit' ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_edit_account_view_jsx__WEBPACK_IMPORTED_MODULE_6__[\"default\"], {\n tinode: this.props.tinode,\n myUserId: this.props.myUserId,\n messageSounds: this.props.messageSounds,\n desktopAlerts: this.props.desktopAlerts,\n desktopAlertsEnabled: this.props.desktopAlertsEnabled,\n onUpdateAccount: this.props.onUpdateAccount,\n onUpdateTags: this.props.onUpdateAccountTags,\n onTogglePushNotifications: this.props.onTogglePushNotifications,\n onToggleMessageSounds: this.props.onToggleMessageSounds,\n onLogout: this.props.onLogout,\n onCancel: this.props.onCancel,\n onError: this.props.onError\n }) : view === 'contacts' ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_contacts_view_jsx__WEBPACK_IMPORTED_MODULE_4__[\"default\"], {\n tinode: this.props.tinode,\n myUserId: this.props.myUserId,\n connected: this.props.connected,\n topicSelected: this.props.topicSelected,\n chatList: this.props.chatList,\n showContextMenu: this.props.showContextMenu,\n onTopicSelected: this.props.onTopicSelected\n }) : view === 'newtpk' ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_new_topic_view_jsx__WEBPACK_IMPORTED_MODULE_8__[\"default\"], {\n searchResults: this.props.searchResults,\n onInitFind: this.props.onInitFind,\n onSearchContacts: this.props.onSearchContacts,\n onCreateTopic: this.props.onCreateTopic,\n onError: this.props.onError\n }) : view === 'cred' ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_validation_view_jsx__WEBPACK_IMPORTED_MODULE_11__[\"default\"], {\n credCode: this.props.credCode,\n credMethod: this.props.credMethod,\n onSubmit: this.props.onValidateCredentials,\n onCancel: this.props.onCancel,\n onError: this.props.onError\n }) : view === 'reset' ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_password_reset_view_jsx__WEBPACK_IMPORTED_MODULE_9__[\"default\"], {\n onRequest: this.props.onPasswordResetRequest,\n onReset: this.props.onResetPassword\n }) : null);\n }\n }]);\n\n return SidepanelView;\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\"])(SidepanelView));\n\n//# sourceURL=webpack:///./src/views/sidepanel-view.jsx?");
- function res(i, val) {
- try {
- if (val && (typeof val === 'object' || typeof val === 'function')) {
- var then = val.then;
- if (typeof then === 'function') {
- then.call(
- val,
- function(val) {
- res(i, val);
- },
- reject
- );
- return;
- }
- }
- args[i] = val;
- if (--remaining === 0) {
- resolve(args);
- }
- } catch (ex) {
- reject(ex);
- }
- }
+/***/ }),
- for (var i = 0; i < args.length; i++) {
- res(i, args[i]);
- }
- });
-};
+/***/ "./src/views/tinode-web.jsx":
+/*!**********************************!*\
+ !*** ./src/views/tinode-web.jsx ***!
+ \**********************************/
+/*! exports provided: default */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
-Promise.resolve = function(value) {
- if (value && typeof value === 'object' && value.constructor === Promise) {
- return value;
- }
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-dom */ \"react-dom\");\n/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-intl */ \"react-intl\");\n/* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_intl__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var firebase_app__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! firebase/app */ \"firebase/app\");\n/* harmony import */ var firebase_app__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(firebase_app__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var firebase_messaging__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! firebase/messaging */ \"firebase/messaging\");\n/* harmony import */ var firebase_messaging__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(firebase_messaging__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var tinode_sdk__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! tinode-sdk */ \"../tinode-js/umd/tinode.prod.js\");\n/* harmony import */ var tinode_sdk__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(tinode_sdk__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _widgets_context_menu_jsx__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../widgets/context-menu.jsx */ \"./src/widgets/context-menu.jsx\");\n/* harmony import */ var _info_view_jsx__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./info-view.jsx */ \"./src/views/info-view.jsx\");\n/* harmony import */ var _messages_view_jsx__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./messages-view.jsx */ \"./src/views/messages-view.jsx\");\n/* harmony import */ var _sidepanel_view_jsx__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./sidepanel-view.jsx */ \"./src/views/sidepanel-view.jsx\");\n/* harmony import */ var _config_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../config.js */ \"./src/config.js\");\n/* harmony import */ var _lib_blob_helpers_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../lib/blob-helpers.js */ \"./src/lib/blob-helpers.js\");\n/* harmony import */ var _lib_host_name_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../lib/host-name.js */ \"./src/lib/host-name.js\");\n/* harmony import */ var _lib_local_storage_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../lib/local-storage.js */ \"./src/lib/local-storage.js\");\n/* harmony import */ var _lib_navigation_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../lib/navigation.js */ \"./src/lib/navigation.js\");\n/* harmony import */ var _lib_utils_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../lib/utils.js */ \"./src/lib/utils.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 _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return 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 _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\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nvar POP_SOUND = new Audio('audio/msg.mp3');\n\nvar TinodeWeb = function (_React$Component) {\n _inherits(TinodeWeb, _React$Component);\n\n function TinodeWeb(props) {\n var _this;\n\n _classCallCheck(this, TinodeWeb);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(TinodeWeb).call(this, props));\n _this.state = _this.getBlankState();\n _this.handleResize = _this.handleResize.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleHashRoute = _this.handleHashRoute.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleOnline = _this.handleOnline.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleAppVisibility = _this.handleAppVisibility.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleReadTimer = _this.handleReadTimer.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleVisibilityEvent = _this.handleVisibilityEvent.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleError = _this.handleError.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleLoginRequest = _this.handleLoginRequest.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleConnected = _this.handleConnected.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.doLogin = _this.doLogin.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleCredentialsRequest = _this.handleCredentialsRequest.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleLoginSuccessful = _this.handleLoginSuccessful.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleDisconnect = _this.handleDisconnect.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.tnMeMetaDesc = _this.tnMeMetaDesc.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.tnMeContactUpdate = _this.tnMeContactUpdate.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.tnMeSubsUpdated = _this.tnMeSubsUpdated.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.resetContactList = _this.resetContactList.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.tnData = _this.tnData.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.tnInitFind = _this.tnInitFind.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.tnFndSubsUpdated = _this.tnFndSubsUpdated.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleSearchContacts = _this.handleSearchContacts.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleTopicSelected = _this.handleTopicSelected.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleHideMessagesView = _this.handleHideMessagesView.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleSendMessage = _this.handleSendMessage.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleNewAccount = _this.handleNewAccount.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleNewAccountRequest = _this.handleNewAccountRequest.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleUpdateAccountRequest = _this.handleUpdateAccountRequest.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleUpdateAccountTagsRequest = _this.handleUpdateAccountTagsRequest.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleSettings = _this.handleSettings.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleGlobalSettings = _this.handleGlobalSettings.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleToggleMessageSounds = _this.handleToggleMessageSounds.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.initDesktopAlerts = _this.initDesktopAlerts.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.togglePushToken = _this.togglePushToken.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.requestPushToken = _this.requestPushToken.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleSidepanelCancel = _this.handleSidepanelCancel.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleNewTopic = _this.handleNewTopic.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleNewTopicRequest = _this.handleNewTopicRequest.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleNewTopicCreated = _this.handleNewTopicCreated.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleTopicUpdateRequest = _this.handleTopicUpdateRequest.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleChangePermissions = _this.handleChangePermissions.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleTagsUpdated = _this.handleTagsUpdated.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleLogout = _this.handleLogout.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleLeaveUnsubRequest = _this.handleLeaveUnsubRequest.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleDialogCancel = _this.handleDialogCancel.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleShowContextMenu = _this.handleShowContextMenu.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.defaultTopicContextMenu = _this.defaultTopicContextMenu.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleHideContextMenu = _this.handleHideContextMenu.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleShowInfoView = _this.handleShowInfoView.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleHideInfoView = _this.handleHideInfoView.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleMemberUpdateRequest = _this.handleMemberUpdateRequest.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleValidateCredentialsRequest = _this.handleValidateCredentialsRequest.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handlePasswordResetRequest = _this.handlePasswordResetRequest.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleResetPassword = _this.handleResetPassword.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n return _this;\n }\n\n _createClass(TinodeWeb, [{\n key: \"getBlankState\",\n value: function getBlankState() {\n var _ref;\n\n var settings = _lib_local_storage_js__WEBPACK_IMPORTED_MODULE_13__[\"default\"].getObject(\"settings\") || {};\n return _ref = {\n connected: false,\n transport: settings.transport || null,\n serverAddress: settings.serverAddress || Object(_lib_host_name_js__WEBPACK_IMPORTED_MODULE_12__[\"detectServerAddress\"])(),\n serverVersion: \"no connection\",\n messageSounds: !settings.messageSoundsOff,\n desktopAlerts: settings.desktopAlerts,\n desktopAlertsEnabled: (Object(_lib_host_name_js__WEBPACK_IMPORTED_MODULE_12__[\"isSecureConnection\"])() || Object(_lib_host_name_js__WEBPACK_IMPORTED_MODULE_12__[\"isLocalHost\"])()) && typeof firebase_app__WEBPACK_IMPORTED_MODULE_3__ != 'undefined' && typeof navigator != 'undefined' && typeof FIREBASE_INIT != 'undefined',\n firebaseToken: _lib_local_storage_js__WEBPACK_IMPORTED_MODULE_13__[\"default\"].getObject(\"firebase-token\"),\n errorText: '',\n errorLevel: null,\n sidePanelSelected: 'login',\n sidePanelTitle: null,\n sidePanelAvatar: null,\n dialogSelected: null,\n contextMenuVisible: false,\n login: '',\n password: '',\n myUserId: null,\n liveConnection: navigator.onLine,\n topicSelected: '',\n topicSelectedOnline: false,\n topicSelectedAcs: null,\n newGroupTopicParams: null,\n loginDisabled: false,\n displayMobile: window.innerWidth <= _config_js__WEBPACK_IMPORTED_MODULE_10__[\"MEDIA_BREAKPOINT\"],\n showInfoPanel: false,\n mobilePanel: 'sidepanel'\n }, _defineProperty(_ref, \"contextMenuVisible\", false), _defineProperty(_ref, \"contextMenuBounds\", null), _defineProperty(_ref, \"contextMenuClickAt\", null), _defineProperty(_ref, \"contextMenuParams\", null), _defineProperty(_ref, \"contextMenuItems\", []), _defineProperty(_ref, \"chatList\", []), _defineProperty(_ref, \"searchResults\", []), _defineProperty(_ref, \"searchableContacts\", []), _defineProperty(_ref, \"credMethod\", undefined), _defineProperty(_ref, \"credCode\", undefined), _ref;\n }\n }, {\n key: \"componentDidMount\",\n value: function componentDidMount() {\n var _this2 = this;\n\n window.addEventListener('resize', this.handleResize);\n window.addEventListener('online', function (e) {\n _this2.handleOnline(true);\n });\n window.addEventListener('offline', function (e) {\n _this2.handleOnline(false);\n });\n window.addEventListener('hashchange', this.handleHashRoute);\n document.addEventListener('visibilitychange', this.handleVisibilityEvent);\n this.setState({\n viewportWidth: document.documentElement.clientWidth\n });\n this.tinode = TinodeWeb.tnSetup(this.state.serverAddress, this.state.transport);\n this.tinode.onConnect = this.handleConnected;\n this.tinode.onDisconnect = this.handleDisconnect;\n\n if (this.state.desktopAlertsEnabled) {\n try {\n this.fbPush = firebase_app__WEBPACK_IMPORTED_MODULE_3__[\"initializeApp\"](FIREBASE_INIT, _config_js__WEBPACK_IMPORTED_MODULE_10__[\"APP_NAME\"]).messaging();\n this.fbPush.usePublicVapidKey(FIREBASE_INIT.messagingVapidKey);\n navigator.serviceWorker.register('/service-worker.js').then(function (reg) {\n _this2.fbPush.useServiceWorker(reg);\n\n _this2.initDesktopAlerts();\n\n if (_this2.state.desktopAlerts) {\n if (!_this2.state.firebaseToken) {\n _this2.togglePushToken(true);\n } else {\n _this2.tinode.setDeviceToken(_this2.state.firebaseToken);\n }\n }\n }).catch(function (err) {\n console.log(\"Failed to register service worker:\", err);\n });\n } catch (err) {\n this.handleError(\"Failed to initialize push notifications\", 'err');\n console.log(\"Failed to initialize push notifications\", err);\n this.setState({\n desktopAlertsEnabled: false\n });\n }\n }\n\n var token = _lib_local_storage_js__WEBPACK_IMPORTED_MODULE_13__[\"default\"].getObject('keep-logged-in') ? _lib_local_storage_js__WEBPACK_IMPORTED_MODULE_13__[\"default\"].getObject('auth-token') : undefined;\n var parsedNav = _lib_navigation_js__WEBPACK_IMPORTED_MODULE_14__[\"default\"].parseUrlHash(window.location.hash);\n\n if (token) {\n token.expires = new Date(token.expires);\n this.tinode.setAuthToken(token);\n this.tinode.connect().catch(function (err) {\n _this2.handleError(err.message, 'err');\n });\n delete parsedNav.params.info;\n delete parsedNav.params.tab;\n parsedNav.path[0] = '';\n _lib_navigation_js__WEBPACK_IMPORTED_MODULE_14__[\"default\"].navigateTo(_lib_navigation_js__WEBPACK_IMPORTED_MODULE_14__[\"default\"].composeUrlHash(parsedNav.path, parsedNav.params));\n } else if (!parsedNav.params.token) {\n _lib_navigation_js__WEBPACK_IMPORTED_MODULE_14__[\"default\"].navigateTo('');\n }\n\n this.readTimer = null;\n this.readTimerCallback = null;\n this.handleHashRoute();\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n window.removeEventListener('resize', this.handleResize);\n window.removeEventListener('hashchange', this.handleHashRoute);\n document.removeEventListener('visibilitychange', this.handleVisibilityEvent);\n }\n }, {\n key: \"handleResize\",\n value: function handleResize() {\n var mobile = document.documentElement.clientWidth <= _config_js__WEBPACK_IMPORTED_MODULE_10__[\"MEDIA_BREAKPOINT\"];\n this.setState({\n viewportWidth: document.documentElement.clientWidth\n });\n\n if (this.state.displayMobile != mobile) {\n this.setState({\n displayMobile: mobile\n });\n }\n }\n }, {\n key: \"handleHashRoute\",\n value: function handleHashRoute() {\n var hash = _lib_navigation_js__WEBPACK_IMPORTED_MODULE_14__[\"default\"].parseUrlHash(window.location.hash);\n\n if (hash.path && hash.path.length > 0) {\n if (['register', 'settings', 'edit', 'cred', 'reset', 'newtpk', 'contacts', ''].includes(hash.path[0])) {\n this.setState({\n sidePanelSelected: hash.path[0]\n });\n } else {\n console.log(\"Unknown sidepanel view\", hash.path[0]);\n }\n\n if (hash.path.length > 1 && hash.path[1] != this.state.topicSelected) {\n this.setState({\n topicSelected: tinode_sdk__WEBPACK_IMPORTED_MODULE_5___default.a.topicType(hash.path[1]) ? hash.path[1] : null\n });\n }\n } else {\n this.setState({\n sidePanelSelected: ''\n });\n }\n\n if (hash.params.method) {\n this.setState({\n credMethod: hash.params.method\n });\n }\n\n if (hash.params.code) {\n this.setState({\n credCode: hash.params.code\n });\n }\n\n this.setState({\n showInfoPanel: hash.params.info,\n newTopicTabSelected: hash.params.tab\n });\n }\n }, {\n key: \"handleOnline\",\n value: function handleOnline(online) {\n var newState = {\n liveConnection: online\n };\n\n if (online) {\n this.handleError('', null);\n } else {\n this.handleError(\"No connection\", 'warn');\n }\n\n this.setState({\n liveConnection: online\n });\n }\n }, {\n key: \"handleAppVisibility\",\n value: function handleAppVisibility(visible, callback) {\n clearTimeout(this.readTimer);\n this.readTimerCallback = callback;\n\n if (visible && callback) {\n this.readTimer = setTimeout(callback, _config_js__WEBPACK_IMPORTED_MODULE_10__[\"READ_DELAY\"]);\n } else {\n this.readTimer = null;\n }\n }\n }, {\n key: \"handleReadTimer\",\n value: function handleReadTimer(callback) {\n this.handleAppVisibility(!document.hidden, callback);\n }\n }, {\n key: \"handleVisibilityEvent\",\n value: function handleVisibilityEvent() {\n this.handleAppVisibility(!document.hidden, this.readTimerCallback);\n }\n }, {\n key: \"handleError\",\n value: function handleError(err, level) {\n this.setState({\n errorText: err,\n errorLevel: level\n });\n }\n }, {\n key: \"handleLoginRequest\",\n value: function handleLoginRequest(login, password) {\n var _this3 = this;\n\n this.setState({\n loginDisabled: true,\n login: login,\n password: password\n });\n this.handleError('', null);\n\n if (this.tinode.isConnected()) {\n this.doLogin(login, password, {\n meth: this.state.credMethod,\n resp: this.state.credCode\n });\n } else {\n this.tinode.connect().catch(function (err) {\n _this3.setState({\n loginDisabled: false\n });\n\n _this3.handleError(err.message, 'err');\n });\n }\n }\n }, {\n key: \"handleConnected\",\n value: function handleConnected() {\n var params = this.tinode.getServerInfo();\n this.setState({\n serverVersion: params.ver + ' ' + (params.build ? params.build : 'none') + '; '\n });\n this.doLogin(this.state.login, this.state.password, {\n meth: this.state.credMethod,\n resp: this.state.credCode\n });\n }\n }, {\n key: \"doLogin\",\n value: function doLogin(login, password, cred) {\n var _this4 = this;\n\n if (this.tinode.isAuthenticated()) {\n _lib_navigation_js__WEBPACK_IMPORTED_MODULE_14__[\"default\"].navigateTo('');\n return;\n }\n\n cred = tinode_sdk__WEBPACK_IMPORTED_MODULE_5___default.a.credential(cred);\n var promise = null;\n var token = this.tinode.getAuthToken();\n\n if (login && password) {\n this.setState({\n password: null\n });\n promise = this.tinode.loginBasic(login, password, cred);\n } else if (token) {\n promise = this.tinode.loginToken(token.token, cred);\n }\n\n if (promise) {\n promise.then(function (ctrl) {\n if (ctrl.code >= 300 && ctrl.text === 'validate credentials') {\n if (cred) {\n _this4.handleError(\"Code does not match\", 'warn');\n }\n\n _this4.handleCredentialsRequest(ctrl.params);\n } else {\n _this4.handleLoginSuccessful();\n }\n }).catch(function (err) {\n _this4.setState({\n loginDisabled: false,\n credMethod: undefined,\n credCode: undefined\n });\n\n _this4.handleError(err.message, 'err');\n\n localStorage.removeItem('auth-token');\n _lib_navigation_js__WEBPACK_IMPORTED_MODULE_14__[\"default\"].navigateTo('');\n });\n } else {\n _lib_navigation_js__WEBPACK_IMPORTED_MODULE_14__[\"default\"].navigateTo('');\n this.setState({\n loginDisabled: false\n });\n }\n }\n }, {\n key: \"handleCredentialsRequest\",\n value: function handleCredentialsRequest(params) {\n var parsed = _lib_navigation_js__WEBPACK_IMPORTED_MODULE_14__[\"default\"].parseUrlHash(window.location.hash);\n parsed.path[0] = 'cred';\n parsed.params['method'] = params.cred[0];\n _lib_navigation_js__WEBPACK_IMPORTED_MODULE_14__[\"default\"].navigateTo(_lib_navigation_js__WEBPACK_IMPORTED_MODULE_14__[\"default\"].composeUrlHash(parsed.path, parsed.params));\n }\n }, {\n key: \"handleLoginSuccessful\",\n value: function handleLoginSuccessful() {\n var _this5 = this;\n\n this.handleError('', null);\n\n if (_lib_local_storage_js__WEBPACK_IMPORTED_MODULE_13__[\"default\"].getObject('keep-logged-in')) {\n _lib_local_storage_js__WEBPACK_IMPORTED_MODULE_13__[\"default\"].setObject('auth-token', this.tinode.getAuthToken());\n }\n\n var me = this.tinode.getMeTopic();\n me.onMetaDesc = this.tnMeMetaDesc;\n me.onContactUpdate = this.tnMeContactUpdate;\n me.onSubsUpdated = this.tnMeSubsUpdated;\n this.setState({\n connected: true,\n credMethod: undefined,\n credCode: undefined,\n myUserId: this.tinode.getCurrentUserID()\n });\n me.subscribe(me.startMetaQuery().withLaterSub().withDesc().build()).catch(function (err) {\n localStorage.removeItem('auth-token');\n\n _this5.handleError(err.message, 'err');\n\n _lib_navigation_js__WEBPACK_IMPORTED_MODULE_14__[\"default\"].navigateTo('');\n });\n _lib_navigation_js__WEBPACK_IMPORTED_MODULE_14__[\"default\"].navigateTo(_lib_navigation_js__WEBPACK_IMPORTED_MODULE_14__[\"default\"].setUrlSidePanel(window.location.hash, 'contacts'));\n }\n }, {\n key: \"handleDisconnect\",\n value: function handleDisconnect(err) {\n this.setState({\n connected: false,\n topicSelectedOnline: false,\n dialogSelected: null,\n errorText: err && err.message ? err.message : \"Disconnected\",\n errorLevel: err && err.message ? 'err' : 'warn',\n loginDisabled: false,\n contextMenuVisible: false,\n serverVersion: \"no connection\"\n });\n }\n }, {\n key: \"tnMeMetaDesc\",\n value: function tnMeMetaDesc(desc) {\n if (desc && desc.public) {\n this.setState({\n sidePanelTitle: desc.public.fn,\n sidePanelAvatar: Object(_lib_blob_helpers_js__WEBPACK_IMPORTED_MODULE_11__[\"makeImageUrl\"])(desc.public.photo)\n });\n }\n }\n }, {\n key: \"tnMeContactUpdate\",\n value: function tnMeContactUpdate(what, cont) {\n if (what == 'on' || what == 'off') {\n this.resetContactList();\n\n if (this.state.topicSelected == cont.topic) {\n this.setState({\n topicSelectedOnline: what == 'on'\n });\n }\n } else if (what == 'read') {\n this.resetContactList();\n } else if (what == 'msg') {\n if (this.state.topicSelected != cont.topic) {\n if (this.state.messageSounds) {\n POP_SOUND.play();\n }\n\n this.resetContactList();\n } else if (document.hidden && this.state.messageSounds) {\n POP_SOUND.play();\n }\n } else if (what == 'recv') {} else if (what == 'gone' || what == 'unsub') {\n if (this.state.topicSelected == cont.topic) {\n this.handleTopicSelected(null);\n }\n\n this.resetContactList();\n } else if (what == 'acs') {\n if (this.state.topicSelected == cont.topic) {\n this.setState({\n topicSelectedAcs: cont.acs\n });\n }\n } else if (what == 'del') {} else {\n console.log(\"Unsupported (yet) presence update:\" + what + \" in: \" + cont.topic);\n }\n }\n }, {\n key: \"tnMeSubsUpdated\",\n value: function tnMeSubsUpdated(unused) {\n this.resetContactList();\n }\n }, {\n key: \"resetContactList\",\n value: function resetContactList() {\n var _this6 = this;\n\n var newState = {\n chatList: []\n };\n this.tinode.getMeTopic().contacts(function (c) {\n newState.chatList.push(c);\n\n if (_this6.state.topicSelected == c.topic) {\n newState.topicSelectedOnline = c.online;\n newState.topicSelectedAcs = c.acs;\n }\n });\n newState.searchableContacts = TinodeWeb.prepareSearchableContacts(newState.chatList, this.state.searchResults);\n this.setState(newState);\n }\n }, {\n key: \"tnData\",\n value: function tnData(data) {\n var _this7 = this;\n\n var topic = this.tinode.getTopic(data.topic);\n\n if (topic.msgStatus(data) >= tinode_sdk__WEBPACK_IMPORTED_MODULE_5___default.a.MESSAGE_STATUS_SENT) {\n clearTimeout(this.receivedTimer);\n this.receivedTimer = setTimeout(function () {\n _this7.receivedTimer = undefined;\n topic.noteRecv(data.seq);\n }, _config_js__WEBPACK_IMPORTED_MODULE_10__[\"RECEIVED_DELAY\"]);\n }\n }\n }, {\n key: \"tnInitFind\",\n value: function tnInitFind() {\n var _this8 = this;\n\n var fnd = this.tinode.getFndTopic();\n\n if (fnd.isSubscribed()) {\n this.tnFndSubsUpdated();\n } else {\n fnd.onSubsUpdated = this.tnFndSubsUpdated;\n fnd.subscribe(fnd.startMetaQuery().withSub().withTags().build()).catch(function (err) {\n _this8.handleError(err.message, 'err');\n });\n }\n }\n }, {\n key: \"tnFndSubsUpdated\",\n value: function tnFndSubsUpdated() {\n var foundContacts = [];\n this.tinode.getFndTopic().contacts(function (s) {\n foundContacts.push(s);\n });\n this.setState({\n searchResults: foundContacts,\n searchableContacts: TinodeWeb.prepareSearchableContacts(this.state.chatList, foundContacts)\n });\n }\n }, {\n key: \"handleSearchContacts\",\n value: function handleSearchContacts(query) {\n var _this9 = this;\n\n var fnd = this.tinode.getFndTopic();\n fnd.setMeta({\n desc: {\n public: query\n }\n }).then(function (ctrl) {\n return fnd.getMeta(fnd.startMetaQuery().withSub().build());\n }).catch(function (err) {\n _this9.handleError(err.message, 'err');\n });\n }\n }, {\n key: \"handleTopicSelected\",\n value: function handleTopicSelected(topicName, unused_index, online, acs) {\n if (topicName) {\n this.setState({\n errorText: '',\n errorLevel: null,\n mobilePanel: 'topic-view',\n showInfoPanel: false\n });\n\n if (this.state.topicSelected != topicName) {\n this.setState({\n topicSelectedOnline: online,\n topicSelectedAcs: acs\n });\n _lib_navigation_js__WEBPACK_IMPORTED_MODULE_14__[\"default\"].navigateTo(_lib_navigation_js__WEBPACK_IMPORTED_MODULE_14__[\"default\"].setUrlTopic('', topicName));\n }\n } else {\n this.setState({\n errorText: '',\n errorLevel: null,\n mobilePanel: 'sidepanel',\n topicSelectedOnline: false,\n topicSelectedAcs: null,\n showInfoPanel: false\n });\n\n if (this.state.topicSelected) {\n _lib_navigation_js__WEBPACK_IMPORTED_MODULE_14__[\"default\"].navigateTo(_lib_navigation_js__WEBPACK_IMPORTED_MODULE_14__[\"default\"].setUrlTopic('', null));\n }\n }\n }\n }, {\n key: \"handleHideMessagesView\",\n value: function handleHideMessagesView() {\n this.setState({\n mobilePanel: 'sidepanel'\n });\n _lib_navigation_js__WEBPACK_IMPORTED_MODULE_14__[\"default\"].navigateTo(_lib_navigation_js__WEBPACK_IMPORTED_MODULE_14__[\"default\"].setUrlTopic(window.location.hash, null));\n }\n }, {\n key: \"handleSendMessage\",\n value: function handleSendMessage(msg, promise, uploader) {\n var _this10 = this;\n\n var topic = this.tinode.getTopic(this.state.topicSelected);\n msg = topic.createMessage(msg, false);\n msg._uploader = uploader;\n\n if (!topic.isSubscribed()) {\n if (!promise) {\n promise = Promise.resolve();\n }\n\n promise = promise.then(function () {\n return topic.subscribe();\n });\n }\n\n if (promise) {\n promise = promise.catch(function (err) {\n _this10.handleError(err.message, 'err');\n });\n }\n\n topic.publishDraft(msg, promise).catch(function (err) {\n _this10.handleError(err.message, 'err');\n });\n }\n }, {\n key: \"handleNewAccount\",\n value: function handleNewAccount() {\n _lib_navigation_js__WEBPACK_IMPORTED_MODULE_14__[\"default\"].navigateTo(_lib_navigation_js__WEBPACK_IMPORTED_MODULE_14__[\"default\"].setUrlSidePanel(window.location.hash, 'register'));\n }\n }, {\n key: \"handleNewAccountRequest\",\n value: function handleNewAccountRequest(login_, password_, public_, cred_, tags_) {\n var _this11 = this;\n\n this.tinode.connect(this.state.serverAddress).then(function () {\n return _this11.tinode.createAccountBasic(login_, password_, {\n public: public_,\n tags: tags_,\n cred: tinode_sdk__WEBPACK_IMPORTED_MODULE_5___default.a.credential(cred_)\n });\n }).then(function (ctrl) {\n if (ctrl.code >= 300 && ctrl.text == 'validate credentials') {\n _this11.handleCredentialsRequest(ctrl.params);\n } else {\n _this11.handleLoginSuccessful(_this11);\n }\n }).catch(function (err) {\n _this11.handleError(err.message, 'err');\n });\n }\n }, {\n key: \"handleUpdateAccountRequest\",\n value: function handleUpdateAccountRequest(password, pub, defacs) {\n var _this12 = this;\n\n if (pub || defacs) {\n this.tinode.getMeTopic().setMeta({\n desc: {\n public: pub,\n defacs: defacs\n }\n }).catch(function (err) {\n _this12.handleError(err.message, 'err');\n });\n }\n\n if (password) {\n this.tinode.updateAccountBasic(null, this.tinode.getCurrentLogin(), password).catch(function (err) {\n _this12.handleError(err.message, 'err');\n });\n }\n }\n }, {\n key: \"handleUpdateAccountTagsRequest\",\n value: function handleUpdateAccountTagsRequest(tags) {\n var _this13 = this;\n\n this.tinode.getFndTopic().setMeta({\n tags: tags\n }).catch(function (err) {\n _this13.handleError(err.message, 'err');\n });\n }\n }, {\n key: \"handleSettings\",\n value: function handleSettings() {\n _lib_navigation_js__WEBPACK_IMPORTED_MODULE_14__[\"default\"].navigateTo(_lib_navigation_js__WEBPACK_IMPORTED_MODULE_14__[\"default\"].setUrlSidePanel(window.location.hash, this.state.myUserId ? 'edit' : 'settings'));\n }\n }, {\n key: \"handleGlobalSettings\",\n value: function handleGlobalSettings(settings) {\n var serverAddress = settings.serverAddress || this.state.serverAddress;\n var transport = settings.transport || this.state.transport;\n\n if (this.tinode) {\n this.tinode.onDisconnect = undefined;\n this.tinode.disconnect();\n }\n\n this.tinode = TinodeWeb.tnSetup(serverAddress, transport);\n this.tinode.onConnect = this.handleConnected;\n this.tinode.onDisconnect = this.handleDisconnect;\n this.setState({\n serverAddress: serverAddress,\n transport: transport\n });\n _lib_local_storage_js__WEBPACK_IMPORTED_MODULE_13__[\"default\"].setObject('settings', {\n serverAddress: serverAddress,\n transport: transport\n });\n _lib_navigation_js__WEBPACK_IMPORTED_MODULE_14__[\"default\"].navigateTo(_lib_navigation_js__WEBPACK_IMPORTED_MODULE_14__[\"default\"].setUrlSidePanel(window.location.hash, ''));\n }\n }, {\n key: \"initDesktopAlerts\",\n value: function initDesktopAlerts() {\n var _this14 = this;\n\n this.fbPush.onTokenRefresh(function () {\n _this14.requestPushToken(true);\n });\n this.fbPush.onMessage(function (payload) {});\n }\n }, {\n key: \"togglePushToken\",\n value: function togglePushToken(enabled) {\n var _this15 = this;\n\n if (enabled) {\n if (!this.state.firebaseToken) {\n this.fbPush.requestPermission().then(function () {\n _this15.requestPushToken(true);\n }).catch(function (err) {\n _this15.handleError(err.message, 'err');\n\n _this15.setState({\n desktopAlerts: false,\n firebaseToken: null\n });\n\n _lib_local_storage_js__WEBPACK_IMPORTED_MODULE_13__[\"default\"].updateObject('settings', {\n desktopAlerts: false\n });\n console.log(\"Failed to get permission to notify.\", err);\n });\n } else {\n this.setState({\n desktopAlerts: true\n });\n _lib_local_storage_js__WEBPACK_IMPORTED_MODULE_13__[\"default\"].updateObject('settings', {\n desktopAlerts: true\n });\n }\n } else if (this.state.firebaseToken) {\n this.fbPush.deleteToken(this.state.firebaseToken).catch(function (err) {\n console.log(\"Unable to delete token.\", err);\n }).finally(function () {\n _lib_local_storage_js__WEBPACK_IMPORTED_MODULE_13__[\"default\"].updateObject('settings', {\n desktopAlerts: false\n });\n localStorage.removeItem('firebase-token');\n\n _this15.setState({\n desktopAlerts: false,\n firebaseToken: null\n });\n });\n } else {\n this.setState({\n desktopAlerts: false,\n firebaseToken: null\n });\n _lib_local_storage_js__WEBPACK_IMPORTED_MODULE_13__[\"default\"].updateObject('settings', {\n desktopAlerts: false\n });\n }\n }\n }, {\n key: \"requestPushToken\",\n value: function requestPushToken(sendToServer) {\n var _this16 = this;\n\n this.fbPush.getToken().then(function (refreshedToken) {\n if (refreshedToken != _this16.state.firebaseToken) {\n _this16.tinode.setDeviceToken(refreshedToken, sendToServer);\n\n _lib_local_storage_js__WEBPACK_IMPORTED_MODULE_13__[\"default\"].setObject('firebase-token', refreshedToken);\n }\n\n _this16.setState({\n firebaseToken: refreshedToken,\n desktopAlerts: true\n });\n\n _lib_local_storage_js__WEBPACK_IMPORTED_MODULE_13__[\"default\"].updateObject('settings', {\n desktopAlerts: true\n });\n }).catch(function (err) {\n _this16.handleError(err.message, 'err');\n\n console.log(\"Failed to retrieve firebase token\", err);\n });\n }\n }, {\n key: \"handleToggleMessageSounds\",\n value: function handleToggleMessageSounds(enabled) {\n this.setState({\n messageSounds: enabled\n });\n _lib_local_storage_js__WEBPACK_IMPORTED_MODULE_13__[\"default\"].updateObject('settings', {\n messageSoundsOff: !enabled\n });\n }\n }, {\n key: \"handleSidepanelCancel\",\n value: function handleSidepanelCancel() {\n var parsed = _lib_navigation_js__WEBPACK_IMPORTED_MODULE_14__[\"default\"].parseUrlHash(window.location.hash);\n parsed.path[0] = this.state.myUserId ? 'contacts' : '';\n\n if (parsed.params) {\n delete parsed.params.code;\n delete parsed.params.method;\n delete parsed.params.tab;\n }\n\n _lib_navigation_js__WEBPACK_IMPORTED_MODULE_14__[\"default\"].navigateTo(_lib_navigation_js__WEBPACK_IMPORTED_MODULE_14__[\"default\"].composeUrlHash(parsed.path, parsed.params));\n this.setState({\n errorText: '',\n errorLevel: null\n });\n }\n }, {\n key: \"handleNewTopic\",\n value: function handleNewTopic() {\n _lib_navigation_js__WEBPACK_IMPORTED_MODULE_14__[\"default\"].navigateTo(_lib_navigation_js__WEBPACK_IMPORTED_MODULE_14__[\"default\"].setUrlSidePanel(window.location.hash, 'newtpk'));\n }\n }, {\n key: \"handleNewTopicRequest\",\n value: function handleNewTopicRequest(peerName, pub, priv, tags) {\n var _this17 = this;\n\n var topicName = peerName || this.tinode.newGroupTopicName();\n\n if (!peerName) {\n this.setState({\n newGroupTopicParams: {\n desc: {\n public: pub,\n private: {\n comment: priv\n }\n },\n tags: tags\n }\n }, function () {\n _this17.handleTopicSelected(topicName);\n });\n } else {\n this.handleTopicSelected(topicName);\n }\n }\n }, {\n key: \"handleNewTopicCreated\",\n value: function handleNewTopicCreated(oldName, newName) {\n if (this.state.topicSelected == oldName && oldName != newName) {\n this.setState({\n topicSelected: newName\n }, function () {\n _lib_navigation_js__WEBPACK_IMPORTED_MODULE_14__[\"default\"].navigateTo(_lib_navigation_js__WEBPACK_IMPORTED_MODULE_14__[\"default\"].setUrlTopic('', newName));\n });\n }\n }\n }, {\n key: \"handleTopicUpdateRequest\",\n value: function handleTopicUpdateRequest(topicName, pub, priv, permissions) {\n var _this18 = this;\n\n var topic = this.tinode.getTopic(topicName);\n\n if (topic) {\n var params = {};\n\n if (pub) {\n params.public = pub;\n }\n\n if (priv) {\n params.private = priv === tinode_sdk__WEBPACK_IMPORTED_MODULE_5___default.a.DEL_CHAR ? tinode_sdk__WEBPACK_IMPORTED_MODULE_5___default.a.DEL_CHAR : {\n comment: priv\n };\n }\n\n if (permissions) {\n params.defacs = permissions;\n }\n\n topic.setMeta({\n desc: params\n }).catch(function (err) {\n _this18.handleError(err.message, 'err');\n });\n }\n }\n }, {\n key: \"handleChangePermissions\",\n value: function handleChangePermissions(topicName, mode, uid) {\n var _this19 = this;\n\n var topic = this.tinode.getTopic(topicName);\n\n if (topic) {\n var am = topic.getAccessMode();\n\n if (uid) {\n am.updateGiven(mode);\n mode = am.getGiven();\n } else {\n am.updateWant(mode);\n mode = am.getWant();\n }\n\n topic.setMeta({\n sub: {\n user: uid,\n mode: mode\n }\n }).catch(function (err) {\n _this19.handleError(err.message, 'err');\n });\n }\n }\n }, {\n key: \"handleTagsUpdated\",\n value: function handleTagsUpdated(topicName, tags) {\n var _this20 = this;\n\n var topic = this.tinode.getTopic(topicName);\n\n if (topic) {\n var instance = this;\n topic.setMeta({\n tags: tags\n }).catch(function (err) {\n _this20.handleError(err.message, 'err');\n });\n }\n }\n }, {\n key: \"handleLogout\",\n value: function handleLogout() {\n Object(_lib_utils_js__WEBPACK_IMPORTED_MODULE_15__[\"updateFavicon\"])(0);\n localStorage.removeItem('auth-token');\n\n if (this.tinode) {\n this.tinode.onDisconnect = undefined;\n this.tinode.disconnect();\n }\n\n this.setState(this.getBlankState());\n this.tinode = TinodeWeb.tnSetup(this.state.serverAddress, this.state.transport);\n this.tinode.onConnect = this.handleConnected;\n this.tinode.onDisconnect = this.handleDisconnect;\n _lib_navigation_js__WEBPACK_IMPORTED_MODULE_14__[\"default\"].navigateTo('');\n }\n }, {\n key: \"handleLeaveUnsubRequest\",\n value: function handleLeaveUnsubRequest(topicName) {\n var _this21 = this;\n\n var topic = this.tinode.getTopic(topicName);\n\n if (!topic) {\n return;\n }\n\n topic.leave(true).then(function (ctrl) {\n _lib_navigation_js__WEBPACK_IMPORTED_MODULE_14__[\"default\"].navigateTo(_lib_navigation_js__WEBPACK_IMPORTED_MODULE_14__[\"default\"].setUrlTopic(window.location.hash, ''));\n }).catch(function (err) {\n _this21.handleError(err.message, 'err');\n });\n }\n }, {\n key: \"handleDialogCancel\",\n value: function handleDialogCancel() {\n this.setState({\n dialogSelected: null\n });\n }\n }, {\n key: \"handleShowContextMenu\",\n value: function handleShowContextMenu(params, menuItems) {\n this.setState({\n contextMenuVisible: true,\n contextMenuClickAt: {\n x: params.x,\n y: params.y\n },\n contextMenuParams: params,\n contextMenuItems: menuItems || this.defaultTopicContextMenu(params.topicName),\n contextMenuBounds: react_dom__WEBPACK_IMPORTED_MODULE_1___default.a.findDOMNode(this).getBoundingClientRect()\n });\n }\n }, {\n key: \"defaultTopicContextMenu\",\n value: function defaultTopicContextMenu(topicName) {\n var topic = this.tinode.getTopic(topicName);\n var formatMessage = this.props.intl.formatMessage;\n var muted = false,\n blocked = false,\n subscribed = false,\n deleter = false;\n\n if (topic) {\n if (topic.isSubscribed()) {\n subscribed = true;\n var acs = topic.getAccessMode();\n muted = acs && acs.isMuted();\n blocked = acs && !acs.isJoiner();\n deleter = acs && acs.isDeleter();\n }\n }\n\n return [subscribed ? {\n title: formatMessage({\n id: 'menu_item_info'\n }),\n handler: this.handleShowInfoView\n } : null, subscribed ? 'messages_clear' : null, subscribed && deleter ? 'messages_clear_hard' : null, subscribed ? muted ? 'topic_unmute' : 'topic_mute' : null, subscribed ? blocked ? 'topic_unblock' : 'topic_block' : null, 'topic_delete'];\n }\n }, {\n key: \"handleHideContextMenu\",\n value: function handleHideContextMenu() {\n this.setState({\n contextMenuVisible: false,\n contextMenuClickAt: null,\n contextMenuParams: null,\n contextMenuBounds: null\n });\n }\n }, {\n key: \"handleShowInfoView\",\n value: function handleShowInfoView() {\n _lib_navigation_js__WEBPACK_IMPORTED_MODULE_14__[\"default\"].navigateTo(_lib_navigation_js__WEBPACK_IMPORTED_MODULE_14__[\"default\"].addUrlParam(window.location.hash, 'info', true));\n this.setState({\n showInfoPanel: true\n });\n }\n }, {\n key: \"handleHideInfoView\",\n value: function handleHideInfoView() {\n _lib_navigation_js__WEBPACK_IMPORTED_MODULE_14__[\"default\"].navigateTo(_lib_navigation_js__WEBPACK_IMPORTED_MODULE_14__[\"default\"].removeUrlParam(window.location.hash, 'info'));\n this.setState({\n showInfoPanel: false\n });\n }\n }, {\n key: \"handleMemberUpdateRequest\",\n value: function handleMemberUpdateRequest(topicName, added, removed) {\n var _this22 = this;\n\n if (!topicName) {\n return;\n }\n\n var topic = this.tinode.getTopic(topicName);\n\n if (!topic) {\n return;\n }\n\n if (added && added.length > 0) {\n added.map(function (uid) {\n topic.invite(uid, null).catch(function (err) {\n _this22.handleError(err.message, 'err');\n });\n });\n }\n\n if (removed && removed.length > 0) {\n removed.map(function (uid) {\n topic.delSubscription(uid).catch(function (err) {\n _this22.handleError(err.message, 'err');\n });\n });\n }\n }\n }, {\n key: \"handleValidateCredentialsRequest\",\n value: function handleValidateCredentialsRequest(cred, code) {\n this.setState({\n credMethod: cred,\n credCode: code\n });\n this.doLogin(null, null, {\n meth: cred,\n resp: code\n });\n }\n }, {\n key: \"handlePasswordResetRequest\",\n value: function handlePasswordResetRequest(method, value) {\n var _this23 = this;\n\n this.tinode.connect().then(function () {\n return _this23.tinode.requestResetAuthSecret('basic', method, value);\n }).catch(function (err) {\n _this23.handleError(err.message, 'err');\n });\n }\n }, {\n key: \"handleResetPassword\",\n value: function handleResetPassword(scheme, newPassword, token) {\n var _this24 = this;\n\n token = base64ReEncode(token);\n\n if (!token) {\n this.handleError(\"Invalid security token\", 'err');\n } else {\n this.tinode.connect().then(function () {\n return _this24.tinode.updateAccountBasic(null, null, newPassword, {\n token: token\n });\n }).catch(function (err) {\n _this24.handleError(err.message, 'err');\n });\n }\n }\n }, {\n key: \"render\",\n value: function render() {\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n id: \"app-container\"\n }, this.state.contextMenuVisible ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_widgets_context_menu_jsx__WEBPACK_IMPORTED_MODULE_6__[\"default\"], {\n tinode: this.tinode,\n bounds: this.state.contextMenuBounds,\n clickAt: this.state.contextMenuClickAt,\n params: this.state.contextMenuParams,\n items: this.state.contextMenuItems,\n hide: this.handleHideContextMenu,\n onAction: this.handleContextMenuAction,\n onError: this.handleError\n }) : null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_sidepanel_view_jsx__WEBPACK_IMPORTED_MODULE_9__[\"default\"], {\n tinode: this.tinode,\n connected: this.state.connected,\n displayMobile: this.state.displayMobile,\n hideSelf: this.state.displayMobile && this.state.mobilePanel !== 'sidepanel',\n state: this.state.sidePanelSelected,\n title: this.state.sidePanelTitle,\n avatar: this.state.sidePanelAvatar,\n login: this.state.login,\n myUserId: this.state.myUserId,\n loginDisabled: this.state.loginDisabled,\n errorText: this.state.errorText,\n errorLevel: this.state.errorLevel,\n topicSelected: this.state.topicSelected,\n chatList: this.state.chatList,\n credMethod: this.state.credMethod,\n credCode: this.state.credCode,\n transport: this.state.transport,\n messageSounds: this.state.messageSounds,\n desktopAlerts: this.state.desktopAlerts,\n desktopAlertsEnabled: this.state.desktopAlertsEnabled,\n serverAddress: this.state.serverAddress,\n onGlobalSettings: this.handleGlobalSettings,\n onSignUp: this.handleNewAccount,\n onSettings: this.handleSettings,\n onLoginRequest: this.handleLoginRequest,\n onCreateAccount: this.handleNewAccountRequest,\n onUpdateAccount: this.handleUpdateAccountRequest,\n onUpdateAccountTags: this.handleUpdateAccountTagsRequest,\n onTogglePushNotifications: this.togglePushToken,\n onToggleMessageSounds: this.handleToggleMessageSounds,\n onTopicSelected: this.handleTopicSelected,\n onCreateTopic: this.handleNewTopicRequest,\n onNewTopic: this.handleNewTopic,\n onLogout: this.handleLogout,\n onCancel: this.handleSidepanelCancel,\n onError: this.handleError,\n onValidateCredentials: this.handleValidateCredentialsRequest,\n onPasswordResetRequest: this.handlePasswordResetRequest,\n onResetPassword: this.handleResetPassword,\n onInitFind: this.tnInitFind,\n searchResults: this.state.searchResults,\n onSearchContacts: this.handleSearchContacts,\n showContextMenu: this.handleShowContextMenu\n }), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_messages_view_jsx__WEBPACK_IMPORTED_MODULE_8__[\"default\"], {\n tinode: this.tinode,\n connected: this.state.connected,\n online: this.state.topicSelectedOnline,\n acs: this.state.topicSelectedAcs,\n displayMobile: this.state.displayMobile,\n viewportWidth: this.state.viewportWidth,\n hideSelf: this.state.displayMobile && (this.state.mobilePanel !== 'topic-view' || this.state.showInfoPanel),\n topic: this.state.topicSelected,\n myUserId: this.state.myUserId,\n serverVersion: this.state.serverVersion,\n serverAddress: this.state.serverAddress,\n errorText: this.state.errorText,\n errorLevel: this.state.errorLevel,\n newGroupTopicParams: this.state.newGroupTopicParams,\n onHideMessagesView: this.handleHideMessagesView,\n onData: this.tnData,\n onError: this.handleError,\n onNewTopicCreated: this.handleNewTopicCreated,\n readTimerHandler: this.handleReadTimer,\n showContextMenu: this.handleShowContextMenu,\n sendMessage: this.handleSendMessage\n }), this.state.showInfoPanel ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_info_view_jsx__WEBPACK_IMPORTED_MODULE_7__[\"default\"], {\n tinode: this.tinode,\n connected: this.state.connected,\n displayMobile: this.state.displayMobile,\n topic: this.state.topicSelected,\n searchableContacts: this.state.searchableContacts,\n myUserId: this.state.myUserId,\n errorText: this.state.errorText,\n errorLevel: this.state.errorLevel,\n onTopicDescUpdate: this.handleTopicUpdateRequest,\n onCancel: this.handleHideInfoView,\n onChangePermissions: this.handleChangePermissions,\n onMemberUpdateRequest: this.handleMemberUpdateRequest,\n onLeaveTopic: this.handleLeaveUnsubRequest,\n onAddMember: this.handleManageGroupMembers,\n onTopicTagsUpdate: this.handleTagsUpdated,\n onInitFind: this.tnInitFind,\n onError: this.handleError,\n showContextMenu: this.handleShowContextMenu\n }) : null);\n }\n }], [{\n key: \"tnSetup\",\n value: function tnSetup(serverAddress, transport) {\n var tinode = new tinode_sdk__WEBPACK_IMPORTED_MODULE_5___default.a(_config_js__WEBPACK_IMPORTED_MODULE_10__[\"APP_NAME\"], serverAddress, _config_js__WEBPACK_IMPORTED_MODULE_10__[\"API_KEY\"], transport, Object(_lib_host_name_js__WEBPACK_IMPORTED_MODULE_12__[\"isSecureConnection\"])());\n tinode.enableLogging(true, true);\n return tinode;\n }\n }, {\n key: \"prepareSearchableContacts\",\n value: function prepareSearchableContacts(chatList, foundContacts) {\n var merged = {};\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = chatList[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var c = _step.value;\n\n if (tinode_sdk__WEBPACK_IMPORTED_MODULE_5___default.a.topicType(c.topic) == 'p2p') {\n merged[c.topic] = {\n user: c.topic,\n updated: c.updated,\n public: c.public,\n private: c.private,\n acs: c.acs\n };\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n var _iteratorNormalCompletion2 = true;\n var _didIteratorError2 = false;\n var _iteratorError2 = undefined;\n\n try {\n for (var _iterator2 = foundContacts[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n var _c = _step2.value;\n\n if (!merged[_c.user]) {\n merged[_c.user] = _c;\n }\n }\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2.return != null) {\n _iterator2.return();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n\n return Object.values(merged);\n }\n }]);\n\n return TinodeWeb;\n}(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component);\n\n;\n/* harmony default export */ __webpack_exports__[\"default\"] = (Object(react_intl__WEBPACK_IMPORTED_MODULE_2__[\"injectIntl\"])(TinodeWeb));\n\n//# sourceURL=webpack:///./src/views/tinode-web.jsx?");
- return new Promise(function(resolve) {
- resolve(value);
- });
-};
+/***/ }),
-Promise.reject = function(value) {
- return new Promise(function(resolve, reject) {
- reject(value);
- });
-};
+/***/ "./src/views/validation-view.jsx":
+/*!***************************************!*\
+ !*** ./src/views/validation-view.jsx ***!
+ \***************************************/
+/*! exports provided: default */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
-Promise.race = function(values) {
- return new Promise(function(resolve, reject) {
- for (var i = 0, len = values.length; i < len; i++) {
- values[i].then(resolve, reject);
- }
- });
-};
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-intl */ \"react-intl\");\n/* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_intl__WEBPACK_IMPORTED_MODULE_1__);\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 _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\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\n\n\nvar messages = Object(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"defineMessages\"])({\n phone: {\n \"id\": \"phone_dative\",\n \"defaultMessage\": \"phone\"\n },\n email: {\n \"id\": \"email_dative\",\n \"defaultMessage\": \"email\"\n }\n});\n\nvar ValidationView = function (_React$PureComponent) {\n _inherits(ValidationView, _React$PureComponent);\n\n function ValidationView(props) {\n var _this;\n\n _classCallCheck(this, ValidationView);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(ValidationView).call(this, props));\n _this.state = {\n code: props.credCode || ''\n };\n _this.handleChange = _this.handleChange.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleKeyPress = _this.handleKeyPress.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleSubmit = _this.handleSubmit.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n return _this;\n }\n\n _createClass(ValidationView, [{\n key: \"handleChange\",\n value: function handleChange(e) {\n this.setState({\n code: e.target.value\n });\n }\n }, {\n key: \"handleKeyPress\",\n value: function handleKeyPress(e) {\n if (e.key === 'Enter') {\n this.handleSubmit(e);\n }\n }\n }, {\n key: \"handleSubmit\",\n value: function handleSubmit(e) {\n e.preventDefault();\n\n if (this.state.code && this.state.code.trim()) {\n this.props.onSubmit(this.props.credMethod, this.state.code.trim());\n }\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this2 = this;\n\n var formatMessage = this.props.intl.formatMessage;\n var methods = {\n 'email': formatMessage(messages.email),\n 'tel': formatMessage(messages.phone)\n };\n var method = methods[this.props.credMethod] || this.props.credMethod;\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"panel-form\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"panel-form-row\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"label\", {\n className: \"small\",\n htmlFor: \"enter-confirmation-code\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"enter_confirmation_code_prompt\",\n defaultMessage: \"Enter confirmation code sent to you by {method}:\",\n values: {\n method: method\n }\n }))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"panel-form-row\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"numeric_confirmation_code_prompt\",\n defaultMessage: \"Numbers only\"\n }, function (numbers_only) {\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"input\", {\n type: \"text\",\n id: \"enter-confirmation-code\",\n placeholder: numbers_only,\n value: _this2.state.code,\n onChange: _this2.handleChange,\n onKeyPress: _this2.handleKeyPress,\n required: true\n });\n })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"dialog-buttons\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"button\", {\n className: \"blue\",\n onClick: this.handleSubmit\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"button_confirm\",\n defaultMessage: \"Confirm\"\n }))));\n }\n }]);\n\n return ValidationView;\n}(react__WEBPACK_IMPORTED_MODULE_0___default.a.PureComponent);\n\n;\n/* harmony default export */ __webpack_exports__[\"default\"] = (Object(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"injectIntl\"])(ValidationView));\n\n//# sourceURL=webpack:///./src/views/validation-view.jsx?");
-// Use polyfill for setImmediate for performance gains
-Promise._immediateFn =
- (typeof setImmediate === 'function' &&
- function(fn) {
- setImmediate(fn);
- }) ||
- function(fn) {
- setTimeoutFunc(fn, 0);
- };
+/***/ }),
-Promise._unhandledRejectionFn = function _unhandledRejectionFn(err) {
- if (typeof console !== 'undefined' && console) {
- console.warn('Possible Unhandled Promise Rejection:', err); // eslint-disable-line no-console
- }
-};
+/***/ "./src/widgets/attachment.jsx":
+/*!************************************!*\
+ !*** ./src/widgets/attachment.jsx ***!
+ \************************************/
+/*! exports provided: default */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
-var globalNS = (function() {
- // the only reliable means to get the global object is
- // `Function('return this')()`
- // However, this causes CSP violations in Chrome apps.
- if (typeof self !== 'undefined') {
- return self;
- }
- if (typeof window !== 'undefined') {
- return window;
- }
- if (typeof global !== 'undefined') {
- return global;
- }
- throw new Error('unable to locate global object');
-})();
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return Attachment; });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _file_progress_jsx__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./file-progress.jsx */ \"./src/widgets/file-progress.jsx\");\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 _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\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\n\n\n\nvar Attachment = function (_React$Component) {\n _inherits(Attachment, _React$Component);\n\n function Attachment(props) {\n var _this;\n\n _classCallCheck(this, Attachment);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(Attachment).call(this, props));\n _this.state = {\n downloader: null,\n progress: 0\n };\n _this.downloadFile = _this.downloadFile.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleCancel = _this.handleCancel.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n return _this;\n }\n\n _createClass(Attachment, [{\n key: \"downloadFile\",\n value: function downloadFile(url, filename, mimetype) {\n var _this2 = this;\n\n var downloader = this.props.tinode.getLargeFileHelper();\n this.setState({\n downloader: downloader\n });\n downloader.download(url, filename, mimetype, function (loaded) {\n _this2.setState({\n progress: loaded / _this2.props.size\n });\n }).then(function () {\n _this2.setState({\n downloader: null,\n progress: 0\n });\n }).catch(function (err) {\n if (err) {\n _this2.props.onError(\"Error downloading file: \" + err.message, 'err');\n }\n\n _this2.setState({\n downloader: null,\n progress: 0\n });\n });\n }\n }, {\n key: \"handleCancel\",\n value: function handleCancel() {\n if (this.props.uploader) {\n this.props.onCancelUpload();\n } else if (this.state.downloader) {\n this.state.downloader.cancel();\n }\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this3 = this;\n\n var filename = this.props.filename || 'file_attachment';\n\n if (filename.length > 36) {\n filename = filename.substr(0, 16) + '...' + filename.substr(-16);\n }\n\n var size = this.props.size > 0 ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", {\n className: \"small gray\"\n }, \"(\", bytesToHumanSize(this.props.size), \")\") : null;\n var url, helperFunc;\n\n if (!this.props.uploader && !this.state.downloader && !/^(?:(?:[a-z]+:)?\\/\\/)/i.test(this.props.downloadUrl)) {\n url = \"javascript:;\";\n\n helperFunc = function helperFunc(e) {\n _this3.downloadFile(_this3.props.downloadUrl, _this3.props.filename, _this3.props.mimetype);\n };\n } else {\n url = this.props.downloadUrl;\n helperFunc = null;\n }\n\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"attachment\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"i\", {\n className: \"material-icons big gray\"\n }, \"insert_drive_file\")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"flex-column\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, filename, \" \", size), this.props.uploader || this.state.downloader ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_file_progress_jsx__WEBPACK_IMPORTED_MODULE_1__[\"default\"], {\n progress: this.props.uploader ? this.props.progress : this.state.progress,\n onCancel: this.handleCancel\n }) : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"a\", {\n href: url,\n download: this.props.filename,\n onClick: helperFunc\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"i\", {\n className: \"material-icons\"\n }, \"file_download\"), \" save\"))));\n }\n }]);\n\n return Attachment;\n}(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component);\n\n\n;\n\n//# sourceURL=webpack:///./src/widgets/attachment.jsx?");
-if (!globalNS.Promise) {
- globalNS.Promise = Promise;
-}
+/***/ }),
-function createCommonjsModule(fn, module) {
- return module = { exports: {} }, fn(module, module.exports), module.exports;
-}
+/***/ "./src/widgets/avatar-upload.jsx":
+/*!***************************************!*\
+ !*** ./src/widgets/avatar-upload.jsx ***!
+ \***************************************/
+/*! exports provided: default */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
-var _global = createCommonjsModule(function (module) {
-// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
-var global = module.exports = typeof window != 'undefined' && window.Math == Math
- ? window : typeof self != 'undefined' && self.Math == Math ? self
- // eslint-disable-next-line no-new-func
- : Function('return this')();
-if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef
-});
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return AvatarUpload; });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _letter_tile_jsx__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./letter-tile.jsx */ \"./src/widgets/letter-tile.jsx\");\n/* harmony import */ var _config_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../config.js */ \"./src/config.js\");\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 _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\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\n\n\n\n\n\nvar AvatarUpload = function (_React$Component) {\n _inherits(AvatarUpload, _React$Component);\n\n function AvatarUpload(props) {\n var _this;\n\n _classCallCheck(this, AvatarUpload);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(AvatarUpload).call(this, props));\n _this.state = {\n dataUrl: props.avatar\n };\n _this.handleFileUpload = _this.handleFileUpload.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n return _this;\n }\n\n _createClass(AvatarUpload, [{\n key: \"handleFileUpload\",\n value: function handleFileUpload(e) {\n var _this2 = this;\n\n Object(_lib_blob_helpers_js__WEBPACK_IMPORTED_MODULE_3__[\"imageFileScaledToBase64\"])(e.target.files[0], _config_js__WEBPACK_IMPORTED_MODULE_2__[\"AVATAR_SIZE\"], _config_js__WEBPACK_IMPORTED_MODULE_2__[\"AVATAR_SIZE\"], true, function (base64bits, mime) {\n var du = Object(_lib_blob_helpers_js__WEBPACK_IMPORTED_MODULE_3__[\"makeImageUrl\"])({\n data: base64bits,\n type: mime\n });\n\n _this2.setState({\n dataUrl: du\n });\n\n _this2.props.onImageChanged(du);\n }, function (err) {\n _this2.props.onError(err, 'err');\n });\n e.target.value = '';\n }\n }, {\n key: \"render\",\n value: function render() {\n var randId = \"file-input-avatar-\" + (Math.random() + '').substr(2);\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"avatar-upload\"\n }, this.state.dataUrl ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"img\", {\n src: this.state.dataUrl,\n className: \"preview\"\n }) : this.props.readOnly && this.props.uid ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"avatar-box\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_letter_tile_jsx__WEBPACK_IMPORTED_MODULE_1__[\"default\"], {\n avatar: true,\n topic: this.props.uid,\n title: this.props.title\n })) : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"blank\"\n }, _config_js__WEBPACK_IMPORTED_MODULE_2__[\"AVATAR_SIZE\"], \"\\xD7\", _config_js__WEBPACK_IMPORTED_MODULE_2__[\"AVATAR_SIZE\"]), this.props.readOnly ? null : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"input\", {\n type: \"file\",\n id: randId,\n className: \"inputfile hidden\",\n accept: \"image/*\",\n onChange: this.handleFileUpload\n }), this.props.readOnly ? null : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"label\", {\n htmlFor: randId,\n className: \"round\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"i\", {\n className: \"material-icons\"\n }, \"file_upload\")));\n }\n }], [{\n key: \"getDerivedStateFromProps\",\n value: function getDerivedStateFromProps(nextProps, prevState) {\n if (prevState.dataUrl != nextProps.avatar) {\n return {\n dataUrl: nextProps.avatar\n };\n }\n\n return null;\n }\n }]);\n\n return AvatarUpload;\n}(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component);\n\n\n;\n\n//# sourceURL=webpack:///./src/widgets/avatar-upload.jsx?");
-var _core = createCommonjsModule(function (module) {
-var core = module.exports = { version: '2.5.5' };
-if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef
-});
-var _core_1 = _core.version;
+/***/ }),
-var _isObject = function (it) {
- return typeof it === 'object' ? it !== null : typeof it === 'function';
-};
+/***/ "./src/widgets/chat-message.jsx":
+/*!**************************************!*\
+ !*** ./src/widgets/chat-message.jsx ***!
+ \**************************************/
+/*! exports provided: default */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
-var _anObject = function (it) {
- if (!_isObject(it)) throw TypeError(it + ' is not an object!');
- return it;
-};
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return ChatMessage; });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-intl */ \"react-intl\");\n/* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_intl__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var tinode_sdk__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! tinode-sdk */ \"../tinode-js/umd/tinode.prod.js\");\n/* harmony import */ var tinode_sdk__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(tinode_sdk__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _attachment_jsx__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./attachment.jsx */ \"./src/widgets/attachment.jsx\");\n/* harmony import */ var _letter_tile_jsx__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./letter-tile.jsx */ \"./src/widgets/letter-tile.jsx\");\n/* harmony import */ var _received_marker_jsx__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./received-marker.jsx */ \"./src/widgets/received-marker.jsx\");\n/* harmony import */ var _config_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../config.js */ \"./src/config.js\");\n/* harmony import */ var _lib_blob_helpers_js__WEBPACK_IMPORTED_MODULE_7__ = __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 _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\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\n\n\n\n\n\n\n\n\n\nvar ChatMessage = function (_React$Component) {\n _inherits(ChatMessage, _React$Component);\n\n function ChatMessage(props) {\n var _this;\n\n _classCallCheck(this, ChatMessage);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(ChatMessage).call(this, props));\n _this.state = {\n progress: 0\n };\n\n if (props.uploader) {\n props.uploader.onProgress = _this.handleProgress.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n }\n\n _this.handlePreviewImage = _this.handlePreviewImage.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleContextClick = _this.handleContextClick.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleCancelUpload = _this.handleCancelUpload.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n return _this;\n }\n\n _createClass(ChatMessage, [{\n key: \"handlePreviewImage\",\n value: function handlePreviewImage(e) {\n e.preventDefault();\n this.props.onImagePreview({\n url: e.target.src,\n filename: e.target.title,\n width: e.target.dataset.width,\n height: e.target.dataset.height,\n size: e.target.dataset.size,\n type: e.target.dataset.mime\n });\n }\n }, {\n key: \"handleContextClick\",\n value: function handleContextClick(e) {\n e.preventDefault();\n e.stopPropagation();\n this.props.showContextMenu({\n seq: this.props.seq,\n y: e.pageY,\n x: e.pageX\n });\n }\n }, {\n key: \"handleProgress\",\n value: function handleProgress(ratio) {\n this.setState({\n progress: ratio\n });\n }\n }, {\n key: \"handleCancelUpload\",\n value: function handleCancelUpload() {\n this.props.uploader.cancel();\n }\n }, {\n key: \"render\",\n value: function render() {\n var elementKey = 0;\n\n var formatter = function formatter(style, data, values) {\n elementKey += 1;\n var el = tinode_sdk__WEBPACK_IMPORTED_MODULE_2__[\"Drafty\"].tagName(style);\n\n if (el) {\n var attr = tinode_sdk__WEBPACK_IMPORTED_MODULE_2__[\"Drafty\"].attrValue(style, data) || {};\n attr.key = elementKey;\n\n if (style == 'IM') {\n var dim = Object(_lib_blob_helpers_js__WEBPACK_IMPORTED_MODULE_7__[\"fitImageSize\"])(data.width, data.height, Math.min(this.props.viewportWidth - _config_js__WEBPACK_IMPORTED_MODULE_6__[\"REM_SIZE\"] * 4, _config_js__WEBPACK_IMPORTED_MODULE_6__[\"REM_SIZE\"] * 36), _config_js__WEBPACK_IMPORTED_MODULE_6__[\"REM_SIZE\"] * 24, false);\n attr.className = 'inline-image';\n attr.style = dim ? {\n width: dim.dstWidth + 'px',\n height: dim.dstHeight + 'px'\n } : null;\n attr.onClick = this.handlePreviewImage;\n }\n\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(el, attr, values);\n } else {\n return values;\n }\n };\n\n var sideClass = this.props.sequence + ' ' + (this.props.response ? 'left' : 'right');\n var bubbleClass = this.props.sequence == 'single' || this.props.sequence == 'last' ? 'bubble tip' : 'bubble';\n var avatar = this.props.userAvatar || true;\n var fullDisplay = this.props.userFrom && this.props.response && (this.props.sequence == 'single' || this.props.sequence == 'last');\n var content = this.props.content;\n var attachments = [];\n\n if (this.props.mimeType == tinode_sdk__WEBPACK_IMPORTED_MODULE_2__[\"Drafty\"].getContentType()) {\n tinode_sdk__WEBPACK_IMPORTED_MODULE_2__[\"Drafty\"].attachments(content, function (att, i) {\n attachments.push(react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_attachment_jsx__WEBPACK_IMPORTED_MODULE_3__[\"default\"], {\n tinode: this.props.tinode,\n downloadUrl: tinode_sdk__WEBPACK_IMPORTED_MODULE_2__[\"Drafty\"].getDownloadUrl(att),\n filename: att.name,\n uploader: tinode_sdk__WEBPACK_IMPORTED_MODULE_2__[\"Drafty\"].isUploading(att),\n mimetype: att.mime,\n size: tinode_sdk__WEBPACK_IMPORTED_MODULE_2__[\"Drafty\"].getEntitySize(att),\n progress: this.state.progress,\n onCancelUpload: this.handleCancelUpload,\n onError: this.props.onError,\n key: i\n }));\n }, this);\n content = react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement('span', null, tinode_sdk__WEBPACK_IMPORTED_MODULE_2__[\"Drafty\"].format(content, formatter, this));\n } else if (typeof content != 'string') {\n content = react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"i\", {\n className: \"material-icons\"\n }, \"error_outline\"), \" \", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"i\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"invalid_content\",\n defaultMessage: \"invalid content\"\n })));\n }\n\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"li\", {\n className: sideClass\n }, this.props.userFrom && this.props.response ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"avatar-box\"\n }, fullDisplay ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_letter_tile_jsx__WEBPACK_IMPORTED_MODULE_4__[\"default\"], {\n topic: this.props.userFrom,\n title: this.props.userName,\n avatar: avatar\n }) : null) : null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: bubbleClass\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"message-content\"\n }, content, attachments, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_received_marker_jsx__WEBPACK_IMPORTED_MODULE_5__[\"default\"], {\n timestamp: this.props.timestamp,\n received: this.props.received\n })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", {\n className: \"menuTrigger\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"a\", {\n href: \"javascript:;\",\n onClick: this.handleContextClick\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"i\", {\n className: \"material-icons\"\n }, \"expand_more\")))), fullDisplay ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"author\"\n }, this.props.userName) : null));\n }\n }]);\n\n return ChatMessage;\n}(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component);\n\n\n;\n\n//# sourceURL=webpack:///./src/widgets/chat-message.jsx?");
-var _fails = function (exec) {
- try {
- return !!exec();
- } catch (e) {
- return true;
- }
-};
+/***/ }),
-// Thank's IE8 for his funny defineProperty
-var _descriptors = !_fails(function () {
- return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
-});
+/***/ "./src/widgets/checkbox.jsx":
+/*!**********************************!*\
+ !*** ./src/widgets/checkbox.jsx ***!
+ \**********************************/
+/*! exports provided: default */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
-var document = _global.document;
-// typeof document.createElement is 'object' in old IE
-var is = _isObject(document) && _isObject(document.createElement);
-var _domCreate = function (it) {
- return is ? document.createElement(it) : {};
-};
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return CheckBox; });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\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 _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\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\n\n\nvar CheckBox = function (_React$PureComponent) {\n _inherits(CheckBox, _React$PureComponent);\n\n function CheckBox(props) {\n var _this;\n\n _classCallCheck(this, CheckBox);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(CheckBox).call(this, props));\n _this.handleChange = _this.handleChange.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n return _this;\n }\n\n _createClass(CheckBox, [{\n key: \"handleChange\",\n value: function handleChange() {\n this.props.onChange(this.props.name, !this.props.checked);\n }\n }, {\n key: \"render\",\n value: function render() {\n return this.props.onChange ? this.props.checked ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"i\", {\n className: \"material-icons blue clickable\",\n onClick: this.handleChange\n }, \"check_box\") : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"i\", {\n className: \"material-icons blue clickable\",\n onClick: this.handleChange\n }, \"check_box_outline_blank\") : this.props.checked ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"i\", {\n className: \"material-icons\"\n }, \"check_box\") : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"i\", {\n className: \"material-icons\"\n }, \"check_box_outline_blank\");\n }\n }]);\n\n return CheckBox;\n}(react__WEBPACK_IMPORTED_MODULE_0___default.a.PureComponent);\n\n\n\n//# sourceURL=webpack:///./src/widgets/checkbox.jsx?");
-var _ie8DomDefine = !_descriptors && !_fails(function () {
- return Object.defineProperty(_domCreate('div'), 'a', { get: function () { return 7; } }).a != 7;
-});
+/***/ }),
-// 7.1.1 ToPrimitive(input [, PreferredType])
+/***/ "./src/widgets/chip-input.jsx":
+/*!************************************!*\
+ !*** ./src/widgets/chip-input.jsx ***!
+ \************************************/
+/*! exports provided: default */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
-// instead of the ES6 spec version, we didn't implement @@toPrimitive case
-// and the second argument - flag - preferred type is a string
-var _toPrimitive = function (it, S) {
- if (!_isObject(it)) return it;
- var fn, val;
- if (S && typeof (fn = it.toString) == 'function' && !_isObject(val = fn.call(it))) return val;
- if (typeof (fn = it.valueOf) == 'function' && !_isObject(val = fn.call(it))) return val;
- if (!S && typeof (fn = it.toString) == 'function' && !_isObject(val = fn.call(it))) return val;
- throw TypeError("Can't convert object to primitive value");
-};
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return ChipInput; });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _chip_jsx__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./chip.jsx */ \"./src/widgets/chip.jsx\");\n/* harmony import */ var _lib_blob_helpers_js__WEBPACK_IMPORTED_MODULE_2__ = __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 _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\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\n\n\n\n\nvar ChipInput = function (_React$Component) {\n _inherits(ChipInput, _React$Component);\n\n function ChipInput(props) {\n var _this;\n\n _classCallCheck(this, ChipInput);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(ChipInput).call(this, props));\n _this.state = {\n placeholder: props.chips ? '' : props.prompt,\n sortedChips: ChipInput.sortChips(props.chips, props.required),\n chipIndex: ChipInput.indexChips(props.chips),\n input: '',\n focused: false\n };\n _this.handleTextInput = _this.handleTextInput.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.removeChipAt = _this.removeChipAt.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleChipCancel = _this.handleChipCancel.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleFocusGained = _this.handleFocusGained.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleFocusLost = _this.handleFocusLost.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleKeyDown = _this.handleKeyDown.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n return _this;\n }\n\n _createClass(ChipInput, [{\n key: \"UNSAFE_componentWillReceiveProps\",\n value: function UNSAFE_componentWillReceiveProps(nextProps) {\n this.setState({\n sortedChips: ChipInput.sortChips(nextProps.chips, nextProps.required),\n chipIndex: ChipInput.indexChips(nextProps.chips)\n });\n\n if (nextProps.chips.length > this.props.chips.length) {\n this.setState({\n input: ''\n });\n }\n }\n }, {\n key: \"handleTextInput\",\n value: function handleTextInput(e) {\n this.setState({\n input: e.target.value\n });\n\n if (this.props.filterFunc) {\n this.props.filterFunc(e.target.value);\n }\n }\n }, {\n key: \"removeChipAt\",\n value: function removeChipAt(idx) {\n var removed = this.state.sortedChips[idx];\n this.props.onChipRemoved(removed.user, this.state.chipIndex[removed.user]);\n }\n }, {\n key: \"handleChipCancel\",\n value: function handleChipCancel(item, idx) {\n this.removeChipAt(idx);\n }\n }, {\n key: \"handleFocusGained\",\n value: function handleFocusGained() {\n this.setState({\n focused: true\n });\n }\n }, {\n key: \"handleFocusLost\",\n value: function handleFocusLost() {\n this.setState({\n focused: false\n });\n\n if (this.props.onFocusLost) {\n this.props.onFocusLost(this.state.input);\n }\n }\n }, {\n key: \"handleKeyDown\",\n value: function handleKeyDown(e) {\n if (e.key === 'Backspace') {\n if (this.state.input.length == 0 && this.state.sortedChips.length > 0) {\n var at = this.state.sortedChips.length - 1;\n\n if (this.state.sortedChips[at].user !== this.props.required) {\n this.removeChipAt(at);\n }\n }\n } else if (e.key === 'Enter') {\n if (this.props.onEnter) {\n this.props.onEnter(this.state.input);\n }\n } else if (e.key === 'Escape') {\n if (this.props.onCancel) {\n this.props.onCancel();\n }\n }\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this2 = this;\n\n var chips = [];\n var count = 0;\n this.state.sortedChips.map(function (item) {\n chips.push(react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_chip_jsx__WEBPACK_IMPORTED_MODULE_1__[\"default\"], {\n onCancel: _this2.handleChipCancel,\n avatar: Object(_lib_blob_helpers_js__WEBPACK_IMPORTED_MODULE_2__[\"makeImageUrl\"])(item.public ? item.public.photo : null),\n title: item.public ? item.public.fn : undefined,\n noAvatar: _this2.props.avatarDisabled,\n topic: item.user,\n required: item.user === _this2.props.required,\n index: count,\n key: item.user\n }));\n count++;\n });\n var className = \"chip-input\" + (this.state.focused ? ' focused' : '');\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: className\n }, chips, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"input\", {\n type: \"text\",\n placeholder: this.state.placeholder,\n onChange: this.handleTextInput,\n onFocus: this.handleFocusGained,\n onBlur: this.handleFocusLost,\n onKeyDown: this.handleKeyDown,\n value: this.state.input,\n autoFocus: true\n }));\n }\n }], [{\n key: \"indexChips\",\n value: function indexChips(chips) {\n var index = {};\n var count = 0;\n chips.map(function (item) {\n index[item.user] = count;\n count++;\n });\n return index;\n }\n }, {\n key: \"sortChips\",\n value: function sortChips(chips, keep) {\n var required = [];\n var normal = [];\n chips.map(function (item) {\n if (item.user === keep) {\n required.push(item);\n } else {\n normal.push(item);\n }\n });\n return required.concat(normal);\n }\n }]);\n\n return ChipInput;\n}(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component);\n\n\n;\n\n//# sourceURL=webpack:///./src/widgets/chip-input.jsx?");
-var dP = Object.defineProperty;
+/***/ }),
-var f = _descriptors ? Object.defineProperty : function defineProperty(O, P, Attributes) {
- _anObject(O);
- P = _toPrimitive(P, true);
- _anObject(Attributes);
- if (_ie8DomDefine) try {
- return dP(O, P, Attributes);
- } catch (e) { /* empty */ }
- if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');
- if ('value' in Attributes) O[P] = Attributes.value;
- return O;
-};
+/***/ "./src/widgets/chip.jsx":
+/*!******************************!*\
+ !*** ./src/widgets/chip.jsx ***!
+ \******************************/
+/*! exports provided: default */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
-var _objectDp = {
- f: f
-};
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return Chip; });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _letter_tile_jsx__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./letter-tile.jsx */ \"./src/widgets/letter-tile.jsx\");\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 _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\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\n\n\n\nvar Chip = function (_React$PureComponent) {\n _inherits(Chip, _React$PureComponent);\n\n function Chip(props) {\n var _this;\n\n _classCallCheck(this, Chip);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(Chip).call(this, props));\n _this.handleCancel = _this.handleCancel.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n return _this;\n }\n\n _createClass(Chip, [{\n key: \"handleCancel\",\n value: function handleCancel() {\n this.props.onCancel(this.props.topic, this.props.index);\n }\n }, {\n key: \"render\",\n value: function render() {\n var title = this.props.title || this.props.topic;\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"chip\"\n }, this.props.noAvatar ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", {\n className: \"spacer\"\n }) : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"avatar-box\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_letter_tile_jsx__WEBPACK_IMPORTED_MODULE_1__[\"default\"], {\n avatar: this.props.avatar || true,\n topic: this.props.topic,\n title: this.props.title\n })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", null, title), this.props.onCancel && !this.props.required ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"a\", {\n href: \"javascript:;\",\n onClick: this.handleCancel\n }, \"\\xD7\") : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", {\n className: \"spacer\"\n }));\n }\n }]);\n\n return Chip;\n}(react__WEBPACK_IMPORTED_MODULE_0___default.a.PureComponent);\n\n\n;\n\n//# sourceURL=webpack:///./src/widgets/chip.jsx?");
-var _propertyDesc = function (bitmap, value) {
- return {
- enumerable: !(bitmap & 1),
- configurable: !(bitmap & 2),
- writable: !(bitmap & 4),
- value: value
- };
-};
+/***/ }),
-var _hide = _descriptors ? function (object, key, value) {
- return _objectDp.f(object, key, _propertyDesc(1, value));
-} : function (object, key, value) {
- object[key] = value;
- return object;
-};
+/***/ "./src/widgets/contact-badges.jsx":
+/*!****************************************!*\
+ !*** ./src/widgets/contact-badges.jsx ***!
+ \****************************************/
+/*! exports provided: default */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
-var hasOwnProperty = {}.hasOwnProperty;
-var _has = function (it, key) {
- return hasOwnProperty.call(it, key);
-};
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return ContactBadges; });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\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\nvar ContactBadges = function (_React$PureComponent) {\n _inherits(ContactBadges, _React$PureComponent);\n\n function ContactBadges() {\n _classCallCheck(this, ContactBadges);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(ContactBadges).apply(this, arguments));\n }\n\n _createClass(ContactBadges, [{\n key: \"render\",\n value: function render() {\n var badges = null;\n\n if (this.props.badges && this.props.badges.length > 0) {\n badges = [];\n this.props.badges.map(function (b) {\n var style = 'badge' + (b.color ? ' ' + b.color : '');\n badges.push(react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", {\n className: style,\n key: b.key || b.name\n }, b.name));\n });\n }\n\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", null, badges);\n }\n }]);\n\n return ContactBadges;\n}(react__WEBPACK_IMPORTED_MODULE_0___default.a.PureComponent);\n\n\n;\n\n//# sourceURL=webpack:///./src/widgets/contact-badges.jsx?");
-var id = 0;
-var px = Math.random();
-var _uid = function (key) {
- return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));
-};
+/***/ }),
-var _redefine = createCommonjsModule(function (module) {
-var SRC = _uid('src');
-var TO_STRING = 'toString';
-var $toString = Function[TO_STRING];
-var TPL = ('' + $toString).split(TO_STRING);
+/***/ "./src/widgets/contact-list.jsx":
+/*!**************************************!*\
+ !*** ./src/widgets/contact-list.jsx ***!
+ \**************************************/
+/*! exports provided: default */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
-_core.inspectSource = function (it) {
- return $toString.call(it);
-};
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-intl */ \"react-intl\");\n/* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_intl__WEBPACK_IMPORTED_MODULE_1__);\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?");
-(module.exports = function (O, key, val, safe) {
- var isFunction = typeof val == 'function';
- if (isFunction) _has(val, 'name') || _hide(val, 'name', key);
- if (O[key] === val) return;
- if (isFunction) _has(val, SRC) || _hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key)));
- if (O === _global) {
- O[key] = val;
- } else if (!safe) {
- delete O[key];
- _hide(O, key, val);
- } else if (O[key]) {
- O[key] = val;
- } else {
- _hide(O, key, val);
- }
-// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
-})(Function.prototype, TO_STRING, function toString() {
- return typeof this == 'function' && this[SRC] || $toString.call(this);
-});
-});
+/***/ }),
-var _aFunction = function (it) {
- if (typeof it != 'function') throw TypeError(it + ' is not a function!');
- return it;
-};
+/***/ "./src/widgets/contact.jsx":
+/*!*********************************!*\
+ !*** ./src/widgets/contact.jsx ***!
+ \*********************************/
+/*! exports provided: default */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
-// optional / simple context binding
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return Contact; });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-intl */ \"react-intl\");\n/* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_intl__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _letter_tile_jsx__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./letter-tile.jsx */ \"./src/widgets/letter-tile.jsx\");\n/* harmony import */ var _contact_badges_jsx__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./contact-badges.jsx */ \"./src/widgets/contact-badges.jsx\");\n/* harmony import */ var _unread_badge_jsx__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./unread-badge.jsx */ \"./src/widgets/unread-badge.jsx\");\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 _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\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\n\n\n\n\n\n\nvar Contact = function (_React$Component) {\n _inherits(Contact, _React$Component);\n\n function Contact(props) {\n var _this;\n\n _classCallCheck(this, Contact);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(Contact).call(this, props));\n _this.handleClick = _this.handleClick.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleContextClick = _this.handleContextClick.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n return _this;\n }\n\n _createClass(Contact, [{\n key: \"handleClick\",\n value: function handleClick(e) {\n e.preventDefault();\n e.stopPropagation();\n\n if (this.props.onSelected) {\n this.props.onSelected(this.props.item, this.props.index, this.props.now, this.props.acs);\n }\n }\n }, {\n key: \"handleContextClick\",\n value: function handleContextClick(e) {\n e.preventDefault();\n e.stopPropagation();\n this.props.showContextMenu({\n topicName: this.props.item,\n y: e.pageY,\n x: e.pageX\n });\n }\n }, {\n key: \"render\",\n value: function render() {\n var title = this.props.title;\n\n if (!title) {\n title = react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"i\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"unnamed_topic\"\n }));\n } else if (title.length > 30) {\n title = title.substring(0, 28) + '...';\n }\n\n var online = this.props.now ? 'online' : 'offline';\n var avatar = this.props.avatar ? this.props.avatar : true;\n var badges = this.props.badges.slice();\n\n if (this.props.showMode && this.props.acs) {\n badges.push({\n name: this.props.acs.getMode(),\n key: 'mode'\n });\n }\n\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"li\", {\n className: !this.props.showCheckmark && this.props.selected ? \"selected\" : null,\n onClick: this.handleClick\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"avatar-box\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_letter_tile_jsx__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n avatar: avatar,\n title: this.props.title,\n topic: this.props.item\n }), this.props.showOnline ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", {\n className: online\n }) : this.props.showCheckmark && this.props.selected ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"i\", {\n className: \"checkmark material-icons\"\n }, \"check_circle\") : null), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"text-box\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", {\n className: \"contact-title\"\n }, title), this.props.unread > 0 ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_unread_badge_jsx__WEBPACK_IMPORTED_MODULE_4__[\"default\"], {\n count: this.props.unread\n }) : null), this.props.comment ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"contact-comment\"\n }, this.props.comment) : null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_contact_badges_jsx__WEBPACK_IMPORTED_MODULE_3__[\"default\"], {\n badges: badges\n })), this.props.showContextMenu ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", {\n className: \"menuTrigger\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"a\", {\n href: \"javascript:;\",\n onClick: this.handleContextClick\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"i\", {\n className: \"material-icons\"\n }, \"expand_more\"))) : null);\n }\n }]);\n\n return Contact;\n}(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component);\n\n\n;\n\n//# sourceURL=webpack:///./src/widgets/contact.jsx?");
-var _ctx = function (fn, that, length) {
- _aFunction(fn);
- if (that === undefined) return fn;
- switch (length) {
- case 1: return function (a) {
- return fn.call(that, a);
- };
- case 2: return function (a, b) {
- return fn.call(that, a, b);
- };
- case 3: return function (a, b, c) {
- return fn.call(that, a, b, c);
- };
- }
- return function (/* ...args */) {
- return fn.apply(that, arguments);
- };
-};
+/***/ }),
-var PROTOTYPE = 'prototype';
+/***/ "./src/widgets/context-menu.jsx":
+/*!**************************************!*\
+ !*** ./src/widgets/context-menu.jsx ***!
+ \**************************************/
+/*! exports provided: default */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
-var $export = function (type, name, source) {
- var IS_FORCED = type & $export.F;
- var IS_GLOBAL = type & $export.G;
- var IS_STATIC = type & $export.S;
- var IS_PROTO = type & $export.P;
- var IS_BIND = type & $export.B;
- var target = IS_GLOBAL ? _global : IS_STATIC ? _global[name] || (_global[name] = {}) : (_global[name] || {})[PROTOTYPE];
- var exports = IS_GLOBAL ? _core : _core[name] || (_core[name] = {});
- var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {});
- var key, own, out, exp;
- if (IS_GLOBAL) source = name;
- for (key in source) {
- // contains in native
- own = !IS_FORCED && target && target[key] !== undefined;
- // export native or passed
- out = (own ? target : source)[key];
- // bind timers to global for call from export context
- exp = IS_BIND && own ? _ctx(out, _global) : IS_PROTO && typeof out == 'function' ? _ctx(Function.call, out) : out;
- // extend global
- if (target) _redefine(target, key, out, type & $export.U);
- // export
- if (exports[key] != out) _hide(exports, key, exp);
- if (IS_PROTO && expProto[key] != out) expProto[key] = out;
- }
-};
-_global.core = _core;
-// type bitmap
-$export.F = 1; // forced
-$export.G = 2; // global
-$export.S = 4; // static
-$export.P = 8; // proto
-$export.B = 16; // bind
-$export.W = 32; // wrap
-$export.U = 64; // safe
-$export.R = 128; // real proto method for `library`
-var _export = $export;
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-dom */ \"react-dom\");\n/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-intl */ \"react-intl\");\n/* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_intl__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _config_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../config.js */ \"./src/config.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 _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\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\n\n\n\n\nvar messages = Object(react_intl__WEBPACK_IMPORTED_MODULE_2__[\"defineMessages\"])({\n info: {\n \"id\": \"menu_item_info\",\n \"defaultMessage\": \"Info\"\n },\n clear_messages: {\n \"id\": \"menu_item_clear_messages\",\n \"defaultMessage\": \"Clear messages\"\n },\n clear_for_all: {\n \"id\": \"menu_item_clear_messages_for_all\",\n \"defaultMessage\": \"Clear for All\"\n },\n 'delete': {\n \"id\": \"menu_item_delete\",\n \"defaultMessage\": \"Delete\"\n },\n delete_for_all: {\n \"id\": \"menu_item_delete_for_all\",\n \"defaultMessage\": \"Delete for All\"\n },\n mute: {\n \"id\": \"menu_item_mute\",\n \"defaultMessage\": \"Mute\"\n },\n unmute: {\n \"id\": \"menu_item_unmute\",\n \"defaultMessage\": \"Unmute\"\n },\n topic_delete: {\n \"id\": \"menu_item_delete_topic\",\n \"defaultMessage\": \"Delete\"\n },\n unblock: {\n \"id\": \"menu_item_unblock\",\n \"defaultMessage\": \"Unblock\"\n },\n block: {\n \"id\": \"menu_item_block\",\n \"defaultMessage\": \"Block\"\n },\n member_delete: {\n \"id\": \"menu_item_member_delete\",\n \"defaultMessage\": \"Remove\"\n }\n});\n\nvar ContextMenu = function (_React$Component) {\n _inherits(ContextMenu, _React$Component);\n\n function ContextMenu(props) {\n var _this;\n\n _classCallCheck(this, ContextMenu);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(ContextMenu).call(this, props));\n var formatMessage = props.intl.formatMessage;\n _this.handlePageClick = _this.handlePageClick.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleEscapeKey = _this.handleEscapeKey.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleClick = _this.handleClick.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.MenuItems = {\n 'topic_info': {\n title: formatMessage(messages.info),\n handler: null\n },\n 'messages_clear': {\n title: formatMessage(messages.clear_messages),\n handler: function handler(params, errorHandler) {\n _this.deleteMessages(true, false, params, errorHandler);\n }\n },\n 'messages_clear_hard': {\n title: formatMessage(messages.clear_for_all),\n handler: function handler(params, errorHandler) {\n _this.deleteMessages(true, true, params, errorHandler);\n }\n },\n 'message_delete': {\n title: formatMessage(messages.delete),\n handler: function handler(params, errorHandler) {\n _this.deleteMessages(false, false, params, errorHandler);\n }\n },\n 'message_delete_hard': {\n title: formatMessage(messages.delete_for_all),\n handler: function handler(params, errorHandler) {\n _this.deleteMessages(false, true, params, errorHandler);\n }\n },\n 'topic_unmute': {\n title: formatMessage(messages.unmute),\n handler: _this.topicPermissionSetter.bind(_assertThisInitialized(_assertThisInitialized(_this)), '+P')\n },\n 'topic_mute': {\n title: formatMessage(messages.mute),\n handler: _this.topicPermissionSetter.bind(_assertThisInitialized(_assertThisInitialized(_this)), '-P')\n },\n 'topic_unblock': {\n title: formatMessage(messages.unblock),\n handler: _this.topicPermissionSetter.bind(_assertThisInitialized(_assertThisInitialized(_this)), '+J')\n },\n 'topic_block': {\n title: formatMessage(messages.block),\n handler: _this.topicPermissionSetter.bind(_assertThisInitialized(_assertThisInitialized(_this)), '-J')\n },\n 'topic_delete': {\n title: formatMessage(messages.topic_delete),\n handler: function handler(params, errorHandler) {\n var topic = _this.props.tinode.getTopic(params.topicName);\n\n if (!topic) {\n console.log(\"Topic not found: \", params.topicName);\n return;\n }\n\n topic.delTopic().catch(function (err) {\n if (errorHandler) {\n errorHandler(err.message, 'err');\n }\n });\n }\n },\n 'permissions': {\n title: formatMessage({\n id: 'menu_item_edit_permissions'\n }),\n handler: null\n },\n 'member_delete': {\n title: formatMessage(messages.member_delete),\n handler: function handler(params, errorHandler) {\n var topic = _this.props.tinode.getTopic(params.topicName);\n\n if (!topic || !params.user) {\n console.log(\"Topic or user not found: '\" + params.topicName + \"', '\" + params.user + \"'\");\n return;\n }\n\n topic.delSubscription(params.user).catch(function (err) {\n if (errorHandler) {\n errorHandler(err.message, 'err');\n }\n });\n }\n },\n 'member_mute': {\n title: formatMessage(messages.mute),\n handler: _this.topicPermissionSetter.bind(_assertThisInitialized(_assertThisInitialized(_this)), '-P')\n },\n 'member_unmute': {\n title: formatMessage(messages.unmute),\n handler: _this.topicPermissionSetter.bind(_assertThisInitialized(_assertThisInitialized(_this)), '+P')\n },\n 'member_block': {\n title: formatMessage(messages.block),\n handler: _this.topicPermissionSetter.bind(_assertThisInitialized(_assertThisInitialized(_this)), '-J')\n },\n 'member_unblock': {\n title: formatMessage(messages.unblock),\n handler: _this.topicPermissionSetter.bind(_assertThisInitialized(_assertThisInitialized(_this)), '+J')\n }\n };\n return _this;\n }\n\n _createClass(ContextMenu, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n document.addEventListener('mousedown', this.handlePageClick, false);\n document.addEventListener('keyup', this.handleEscapeKey, false);\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n document.removeEventListener('mousedown', this.handlePageClick, false);\n document.removeEventListener('keyup', this.handleEscapeKey, false);\n }\n }, {\n key: \"handlePageClick\",\n value: function handlePageClick(e) {\n if (react_dom__WEBPACK_IMPORTED_MODULE_1___default.a.findDOMNode(this).contains(e.target)) {\n return;\n }\n\n e.preventDefault();\n e.stopPropagation();\n this.props.hide();\n }\n }, {\n key: \"handleEscapeKey\",\n value: function handleEscapeKey(e) {\n if (e.keyCode === 27) {\n this.props.hide();\n }\n }\n }, {\n key: \"handleClick\",\n value: function handleClick(e) {\n e.preventDefault();\n e.stopPropagation();\n this.props.hide();\n var item = this.props.items[e.currentTarget.dataset.id];\n\n if (typeof item == 'string') {\n item = this.MenuItems[item];\n }\n\n item.handler(this.props.params, this.props.onError);\n }\n }, {\n key: \"deleteMessages\",\n value: function deleteMessages(all, hard, params, errorHandler) {\n var topic = this.props.tinode.getTopic(params.topicName);\n\n if (!topic) {\n console.log(\"Topic not found: \", params.topicName);\n return;\n }\n\n if (topic.cancelSend(params.seq)) {\n return Promise.resolve();\n }\n\n var promise = all ? topic.delMessagesAll(hard) : topic.delMessagesList([params.seq], hard);\n promise.catch(function (err) {\n if (errorHandler) {\n errorHandler(err.message, 'err');\n }\n });\n }\n }, {\n key: \"topicPermissionSetter\",\n value: function topicPermissionSetter(mode, params, errorHandler) {\n var topic = this.props.tinode.getTopic(params.topicName);\n\n if (!topic) {\n console.log(\"Topic not found\", params.topicName);\n return;\n }\n\n var am, user;\n\n if (params.user) {\n user = topic.subscriber(params.user);\n\n if (!user) {\n console.log(\"Subscriber not found\", params.topicName + \"[\" + params.user + \"]\");\n return;\n }\n\n am = user.acs.updateGiven(mode).getGiven();\n } else {\n am = topic.getAccessMode().updateWant(mode).getWant();\n }\n\n topic.setMeta({\n sub: {\n user: params.user,\n mode: am\n }\n }).catch(function (err) {\n if (errorHandler) {\n errorHandler(err.message, 'err');\n }\n });\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this2 = this;\n\n var count = 0;\n var menu = [];\n this.props.items.map(function (item) {\n if (typeof item == 'string') {\n item = _this2.MenuItems[item];\n }\n\n if (item && item.title) {\n menu.push(item.title == '-' ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"li\", {\n className: \"separator\",\n key: count\n }) : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"li\", {\n onClick: _this2.handleClick,\n \"data-id\": count,\n key: count\n }, item.title));\n }\n\n count++;\n });\n var hSize = 12 * _config_js__WEBPACK_IMPORTED_MODULE_3__[\"REM_SIZE\"];\n var vSize = _config_js__WEBPACK_IMPORTED_MODULE_3__[\"REM_SIZE\"] * (0.7 + menu.length * 2.5);\n var left = this.props.bounds.right - this.props.clickAt.x < hSize ? this.props.clickAt.x - this.props.bounds.left - hSize : this.props.clickAt.x - this.props.bounds.left;\n var top = this.props.bounds.bottom - this.props.clickAt.y < vSize ? this.props.clickAt.y - this.props.bounds.top - vSize : this.props.clickAt.y - this.props.bounds.top;\n var position = {\n left: left + 'px',\n top: top + 'px'\n };\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"ul\", {\n className: \"menu\",\n style: position\n }, menu);\n }\n }]);\n\n return ContextMenu;\n}(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Object(react_intl__WEBPACK_IMPORTED_MODULE_2__[\"injectIntl\"])(ContextMenu));\n\n//# sourceURL=webpack:///./src/widgets/context-menu.jsx?");
-var toString = {}.toString;
+/***/ }),
-var _cof = function (it) {
- return toString.call(it).slice(8, -1);
-};
+/***/ "./src/widgets/error-panel.jsx":
+/*!*************************************!*\
+ !*** ./src/widgets/error-panel.jsx ***!
+ \*************************************/
+/*! exports provided: default */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
-// fallback for non-array-like ES3 and non-enumerable old V8 strings
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return ErrorPanel; });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _menu_cancel_jsx__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./menu-cancel.jsx */ \"./src/widgets/menu-cancel.jsx\");\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 _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\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\n\n\n\nvar ErrorPanel = function (_React$PureComponent) {\n _inherits(ErrorPanel, _React$PureComponent);\n\n function ErrorPanel(props) {\n var _this;\n\n _classCallCheck(this, ErrorPanel);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(ErrorPanel).call(this, props));\n _this.state = {\n show: false\n };\n _this.hide = _this.hide.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n return _this;\n }\n\n _createClass(ErrorPanel, [{\n key: \"hide\",\n value: function hide() {\n this.setState({\n show: false\n });\n\n if (this.props.onClearError) {\n this.props.onClearError();\n }\n }\n }, {\n key: \"render\",\n value: function render() {\n var icon = this.props.level == 'err' ? 'error' : 'warning';\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: this.state.show ? this.props.level == 'err' ? 'alert-box error' : 'alert-box warning' : \"alert-box\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"icon\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"i\", {\n className: \"material-icons\"\n }, icon)), this.props.text, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"cancel\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_menu_cancel_jsx__WEBPACK_IMPORTED_MODULE_1__[\"default\"], {\n onCancel: this.hide\n })));\n }\n }], [{\n key: \"getDerivedStateFromProps\",\n value: function getDerivedStateFromProps(nextProps, prevState) {\n return {\n show: !!nextProps.level\n };\n }\n }]);\n\n return ErrorPanel;\n}(react__WEBPACK_IMPORTED_MODULE_0___default.a.PureComponent);\n\n\n;\n\n//# sourceURL=webpack:///./src/widgets/error-panel.jsx?");
-// eslint-disable-next-line no-prototype-builtins
-var _iobject = Object('z').propertyIsEnumerable(0) ? Object : function (it) {
- return _cof(it) == 'String' ? it.split('') : Object(it);
-};
+/***/ }),
-// 7.2.1 RequireObjectCoercible(argument)
-var _defined = function (it) {
- if (it == undefined) throw TypeError("Can't call method on " + it);
- return it;
-};
+/***/ "./src/widgets/file-progress.jsx":
+/*!***************************************!*\
+ !*** ./src/widgets/file-progress.jsx ***!
+ \***************************************/
+/*! exports provided: default */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
-// 7.1.13 ToObject(argument)
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return FileProgress; });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-intl */ \"react-intl\");\n/* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_intl__WEBPACK_IMPORTED_MODULE_1__);\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\nvar FileProgress = function (_React$PureComponent) {\n _inherits(FileProgress, _React$PureComponent);\n\n function FileProgress() {\n _classCallCheck(this, FileProgress);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(FileProgress).apply(this, arguments));\n }\n\n _createClass(FileProgress, [{\n key: \"render\",\n value: function render() {\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"uploader\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", {\n style: {\n width: this.props.progress * 100 + \"%\"\n }\n })), this.props.progress < 0.999 ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"a\", {\n href: \"javascript:;\",\n onClick: this.props.onCancel\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"i\", {\n className: \"material-icons\"\n }, \"close\"), \" \", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"action_cancel\",\n defaultMessage: \"cancel\"\n })) : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"upload_finishing\",\n defaultMessage: \"finishing...\"\n }));\n }\n }]);\n\n return FileProgress;\n}(react__WEBPACK_IMPORTED_MODULE_0___default.a.PureComponent);\n\n\n\n//# sourceURL=webpack:///./src/widgets/file-progress.jsx?");
-var _toObject = function (it) {
- return Object(_defined(it));
-};
+/***/ }),
-// 7.1.4 ToInteger
-var ceil = Math.ceil;
-var floor = Math.floor;
-var _toInteger = function (it) {
- return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
-};
+/***/ "./src/widgets/group-manager.jsx":
+/*!***************************************!*\
+ !*** ./src/widgets/group-manager.jsx ***!
+ \***************************************/
+/*! exports provided: default */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
-// 7.1.15 ToLength
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-intl */ \"react-intl\");\n/* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_intl__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _chip_input_jsx__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./chip-input.jsx */ \"./src/widgets/chip-input.jsx\");\n/* harmony import */ var _contact_list_jsx__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./contact-list.jsx */ \"./src/widgets/contact-list.jsx\");\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 _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\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\n\n\n\n\nvar messages = Object(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"defineMessages\"])({\n no_contacts: {\n \"id\": \"no_contacts\",\n \"defaultMessage\": \"You have no contacts :-(\"\n },\n contacts_not_found: {\n \"id\": \"contacts_not_found_short\",\n \"defaultMessage\": \"No contacts match '{query}'\"\n }\n});\n\nvar GroupManager = function (_React$Component) {\n _inherits(GroupManager, _React$Component);\n\n function GroupManager(props) {\n var _this;\n\n _classCallCheck(this, GroupManager);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(GroupManager).call(this, props));\n _this.state = {\n members: props.members,\n index: GroupManager.indexMembers(props.members),\n contactFilter: '',\n noContactsMessage: props.intl.formatMessage(messages.no_contacts),\n selectedContacts: GroupManager.selectedContacts(props.members)\n };\n _this.handleContactSelected = _this.handleContactSelected.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleMemberRemoved = _this.handleMemberRemoved.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleContactFilter = _this.handleContactFilter.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleSubmit = _this.handleSubmit.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleCancel = _this.handleCancel.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n return _this;\n }\n\n _createClass(GroupManager, [{\n key: \"handleContactSelected\",\n value: function handleContactSelected(userId, index) {\n var status = this.state.index[userId];\n\n if (status) {\n if (status.present) {\n return;\n }\n\n status.delta += 1;\n status.present = true;\n } else {\n status = {\n delta: 1,\n present: true\n };\n }\n\n var m = this.state.members.slice();\n m.push(this.props.contacts[index]);\n var sel = GroupManager.selectedContacts(m);\n var i = this.state.index;\n i[userId] = status;\n this.setState({\n members: m,\n index: i,\n selectedContacts: sel\n });\n }\n }, {\n key: \"handleMemberRemoved\",\n value: function handleMemberRemoved(userId, index) {\n var status = this.state.index[userId];\n\n if (!status || !status.present) {\n return;\n }\n\n status.present = false;\n status.delta -= 1;\n var m = this.state.members.slice();\n m.splice(index, 1);\n var sel = GroupManager.selectedContacts(m);\n var i = this.state.index;\n i[userId] = status;\n this.setState({\n members: m,\n index: i,\n selectedContacts: sel\n });\n }\n }, {\n key: \"handleContactFilter\",\n value: function handleContactFilter(val) {\n var formatMessage = this.props.intl.formatMessage;\n var msg = !val ? formatMessage(messages.no_contacts) : formatMessage(messages.contacts_not_found, {\n query: val\n });\n this.setState({\n contactFilter: val,\n noContactsMessage: msg\n });\n }\n }, {\n key: \"handleSubmit\",\n value: function handleSubmit() {\n var instance = this;\n var members = [];\n var added = [];\n var removed = [];\n var keys = Object.keys(this.state.index);\n keys.map(function (k) {\n if (instance.state.index[k].present) {\n members.push(k);\n }\n\n if (instance.state.index[k].delta > 0) {\n added.push(k);\n } else if (instance.state.index[k].delta < 0) {\n removed.push(k);\n }\n });\n this.props.onSubmit(members, added, removed);\n }\n }, {\n key: \"handleCancel\",\n value: function handleCancel() {\n this.props.onCancel();\n }\n }, {\n key: \"render\",\n value: function render() {\n var formatMessage = this.props.intl.formatMessage;\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n id: \"group-manager\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"panel-form-row\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"label\", {\n className: \"small\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"title_group_members\",\n defaultMessage: \"Group Members\"\n }))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"panel-form-row\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_chip_input_jsx__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n chips: this.state.members,\n required: this.props.requiredMember,\n prompt: \"add members\",\n filterFunc: this.handleContactFilter,\n onChipRemoved: this.handleMemberRemoved\n })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"panel-form-row\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"label\", {\n className: \"small\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"title_all_contacts\",\n defaultMessage: \"All Contacts\"\n }))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_contact_list_jsx__WEBPACK_IMPORTED_MODULE_3__[\"default\"], {\n contacts: this.props.contacts,\n myUserId: this.props.myUserId,\n topicSelected: this.state.selectedContacts,\n filter: this.state.contactFilter,\n filterFunc: GroupManager.doContactFiltering,\n emptyListMessage: this.state.noContactsMessage,\n showOnline: false,\n showUnread: false,\n onTopicSelected: this.handleContactSelected\n }), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n id: \"group-manager-buttons\",\n className: \"panel-form-row\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"button\", {\n className: \"blue\",\n onClick: this.handleSubmit\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"button_ok\",\n defaultMessage: \"OK\"\n })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"button\", {\n className: \"white\",\n onClick: this.handleCancel\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"button_cancel\",\n defaultMessage: \"Cancel\"\n }))));\n }\n }], [{\n key: \"indexMembers\",\n value: function indexMembers(members) {\n var index = {};\n members.map(function (m) {\n index[m.user] = {\n delta: 0,\n present: true\n };\n });\n return index;\n }\n }, {\n key: \"selectedContacts\",\n value: function selectedContacts(members) {\n var sel = [];\n members.map(function (m) {\n sel.push(m.user);\n });\n return sel;\n }\n }, {\n key: \"doContactFiltering\",\n value: function doContactFiltering(filter, values) {\n if (filter) {\n for (var i = 0; i < values.length; i++) {\n if (values[i].indexOf(filter) >= 0) {\n return true;\n }\n }\n\n return false;\n }\n\n return true;\n }\n }]);\n\n return GroupManager;\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\"])(GroupManager));\n\n//# sourceURL=webpack:///./src/widgets/group-manager.jsx?");
-var min = Math.min;
-var _toLength = function (it) {
- return it > 0 ? min(_toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991
-};
+/***/ }),
-// 7.2.2 IsArray(argument)
+/***/ "./src/widgets/group-subs.jsx":
+/*!************************************!*\
+ !*** ./src/widgets/group-subs.jsx ***!
+ \************************************/
+/*! exports provided: default */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
-var _isArray = Array.isArray || function isArray(arg) {
- return _cof(arg) == 'Array';
-};
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return GroupSubs; });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _letter_tile_jsx__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./letter-tile.jsx */ \"./src/widgets/letter-tile.jsx\");\n/* harmony import */ var _lib_blob_helpers_js__WEBPACK_IMPORTED_MODULE_2__ = __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 GroupSubs = function (_React$Component) {\n _inherits(GroupSubs, _React$Component);\n\n function GroupSubs(props) {\n var _this;\n\n _classCallCheck(this, GroupSubs);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(GroupSubs).call(this, props));\n _this.state = {\n onlineSubs: props.subscribers || []\n };\n return _this;\n }\n\n _createClass(GroupSubs, [{\n key: \"render\",\n value: function render() {\n var usersOnline = [];\n this.state.onlineSubs.map(function (sub) {\n usersOnline.push(react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"avatar-box\",\n key: sub.user\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_letter_tile_jsx__WEBPACK_IMPORTED_MODULE_1__[\"default\"], {\n topic: sub.user,\n avatar: Object(_lib_blob_helpers_js__WEBPACK_IMPORTED_MODULE_2__[\"makeImageUrl\"])(sub.public ? sub.public.photo : null) || true,\n title: sub.public ? sub.public.fn : null\n })));\n });\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n id: \"topic-users\"\n }, usersOnline);\n }\n }], [{\n key: \"getDerivedStateFromProps\",\n value: function getDerivedStateFromProps(nextProps, prevState) {\n return {\n onlineSubs: nextProps.subscribers ? nextProps.subscribers : []\n };\n }\n }]);\n\n return GroupSubs;\n}(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component);\n\n\n;\n\n//# sourceURL=webpack:///./src/widgets/group-subs.jsx?");
-var SHARED = '__core-js_shared__';
-var store = _global[SHARED] || (_global[SHARED] = {});
-var _shared = function (key) {
- return store[key] || (store[key] = {});
-};
+/***/ }),
-var _wks = createCommonjsModule(function (module) {
-var store = _shared('wks');
+/***/ "./src/widgets/host-selector.jsx":
+/*!***************************************!*\
+ !*** ./src/widgets/host-selector.jsx ***!
+ \***************************************/
+/*! exports provided: default */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
-var Symbol = _global.Symbol;
-var USE_SYMBOL = typeof Symbol == 'function';
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return HostSelector; });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _config_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../config.js */ \"./src/config.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 _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\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\n\n\n\nvar HostSelector = function (_React$PureComponent) {\n _inherits(HostSelector, _React$PureComponent);\n\n function HostSelector(props) {\n var _this;\n\n _classCallCheck(this, HostSelector);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(HostSelector).call(this, props));\n _this.state = {\n hostName: props.serverAddress,\n changed: false\n };\n _this.handleHostNameChange = _this.handleHostNameChange.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleEditingFinished = _this.handleEditingFinished.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n return _this;\n }\n\n _createClass(HostSelector, [{\n key: \"handleHostNameChange\",\n value: function handleHostNameChange(e) {\n this.setState({\n hostName: e.target.value,\n changed: true\n });\n }\n }, {\n key: \"handleEditingFinished\",\n value: function handleEditingFinished() {\n if (this.state.changed) {\n this.setState({\n changed: false\n });\n this.props.onServerAddressChange(this.state.hostName.trim());\n }\n }\n }, {\n key: \"render\",\n value: function render() {\n var hostOptions = [];\n\n for (var key in _config_js__WEBPACK_IMPORTED_MODULE_1__[\"KNOWN_HOSTS\"]) {\n var item = _config_js__WEBPACK_IMPORTED_MODULE_1__[\"KNOWN_HOSTS\"][key];\n hostOptions.push(react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"option\", {\n key: item,\n value: item\n }));\n }\n\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"panel-form-row\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"input\", {\n type: \"search\",\n id: \"host-name\",\n placeholder: this.props.hostName,\n list: \"known-hosts\",\n className: \"quoted\",\n value: this.state.hostName,\n onChange: this.handleHostNameChange,\n onBlur: this.handleEditingFinished,\n required: true\n }), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"datalist\", {\n id: \"known-hosts\"\n }, hostOptions));\n }\n }]);\n\n return HostSelector;\n}(react__WEBPACK_IMPORTED_MODULE_0___default.a.PureComponent);\n\n\n\n//# sourceURL=webpack:///./src/widgets/host-selector.jsx?");
-var $exports = module.exports = function (name) {
- return store[name] || (store[name] =
- USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : _uid)('Symbol.' + name));
-};
+/***/ }),
-$exports.store = store;
-});
+/***/ "./src/widgets/image-preview.jsx":
+/*!***************************************!*\
+ !*** ./src/widgets/image-preview.jsx ***!
+ \***************************************/
+/*! exports provided: default */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
-var SPECIES = _wks('species');
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return ImagePreview; });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-intl */ \"react-intl\");\n/* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_intl__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _config_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../config.js */ \"./src/config.js\");\n/* harmony import */ var _lib_blob_helpers_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../lib/blob-helpers.js */ \"./src/lib/blob-helpers.js\");\n/* harmony import */ var _lib_strformat_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../lib/strformat.js */ \"./src/lib/strformat.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\n\n\nvar ImagePreview = function (_React$PureComponent) {\n _inherits(ImagePreview, _React$PureComponent);\n\n function ImagePreview(props) {\n var _this;\n\n _classCallCheck(this, ImagePreview);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(ImagePreview).call(this, props));\n _this.state = {};\n return _this;\n }\n\n _createClass(ImagePreview, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n this.setState({\n width: this.container.clientWidth,\n height: this.container.clientHeight\n });\n }\n }, {\n key: \"render\",\n value: function render() {\n if (!this.props.content) {\n return null;\n }\n\n var instance = this;\n var dim = Object(_lib_blob_helpers_js__WEBPACK_IMPORTED_MODULE_3__[\"fitImageSize\"])(this.props.content.width, this.props.content.height, this.state.width, this.state.height, false);\n var size = dim ? {\n width: dim.dstWidth + 'px',\n height: dim.dstHeight + 'px'\n } : this.props.content.width > this.props.content.height ? {\n width: '100%'\n } : {\n height: '100%'\n };\n size.maxWidth = '100%';\n size.maxHeight = '100%';\n var filename = this.props.content.filename;\n var maxlength = this.props.content.width / _config_js__WEBPACK_IMPORTED_MODULE_2__[\"REM_SIZE\"] | 0;\n\n if (filename.length > maxlength) {\n filename = filename.slice(0, maxlength - 2) + '...' + filename.slice(2 - maxlength);\n }\n\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n id: \"image-preview\",\n onClick: this.props.onClose\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n id: \"image-preview-caption-panel\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"a\", {\n href: this.props.content.url,\n download: this.props.content.filename\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"i\", {\n className: \"material-icons\"\n }, \"file_download\"), \" \", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"download_action\",\n defaultMessage: \"download\"\n })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"a\", {\n href: \"javascript:;\",\n onClick: this.props.onClose\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"i\", {\n className: \"material-icons gray\"\n }, \"close\"))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n id: \"image-preview-container\",\n ref: function ref(_ref) {\n instance.container = _ref;\n }\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"img\", {\n src: this.props.content.url,\n style: size\n })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n id: \"image-preview-footer\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"b\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"label_file_name\",\n defaultMessage: \"File name:\"\n }))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", {\n title: this.props.content.filename\n }, filename))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"b\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"label_content_type\",\n defaultMessage: \"Content type:\"\n }))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, this.props.content.type)), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"b\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"label_size\",\n defaultMessage: \"Size:\"\n }))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, this.props.content.width, \" \\xD7 \", this.props.content.height, \" px; \", Object(_lib_strformat_js__WEBPACK_IMPORTED_MODULE_4__[\"bytesToHumanSize\"])(this.props.content.size)))));\n }\n }]);\n\n return ImagePreview;\n}(react__WEBPACK_IMPORTED_MODULE_0___default.a.PureComponent);\n\n\n;\n\n//# sourceURL=webpack:///./src/widgets/image-preview.jsx?");
-var _arraySpeciesConstructor = function (original) {
- var C;
- if (_isArray(original)) {
- C = original.constructor;
- // cross-realm fallback
- if (typeof C == 'function' && (C === Array || _isArray(C.prototype))) C = undefined;
- if (_isObject(C)) {
- C = C[SPECIES];
- if (C === null) C = undefined;
- }
- } return C === undefined ? Array : C;
-};
+/***/ }),
-// 9.4.2.3 ArraySpeciesCreate(originalArray, length)
+/***/ "./src/widgets/in-place-edit.jsx":
+/*!***************************************!*\
+ !*** ./src/widgets/in-place-edit.jsx ***!
+ \***************************************/
+/*! exports provided: default */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return InPlaceEdit; });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-dom */ \"react-dom\");\n/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _visible_password_jsx__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./visible-password.jsx */ \"./src/widgets/visible-password.jsx\");\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 _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\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\n\n\n\n\nvar InPlaceEdit = function (_React$Component) {\n _inherits(InPlaceEdit, _React$Component);\n\n function InPlaceEdit(props) {\n var _this;\n\n _classCallCheck(this, InPlaceEdit);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(InPlaceEdit).call(this, props));\n _this.state = {\n active: props.active,\n initialValue: props.value || '',\n value: props.value || ''\n };\n _this.handeTextChange = _this.handeTextChange.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleKeyDown = _this.handleKeyDown.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleStartEditing = _this.handleStartEditing.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleEditingFinished = _this.handleEditingFinished.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handlePasswordFinished = _this.handlePasswordFinished.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n return _this;\n }\n\n _createClass(InPlaceEdit, [{\n key: \"handeTextChange\",\n value: function handeTextChange(e) {\n this.setState({\n value: e.target.value\n });\n }\n }, {\n key: \"handleKeyDown\",\n value: function handleKeyDown(e) {\n if (e.keyCode === 27) {\n this.setState({\n value: this.props.value,\n active: false\n });\n } else if (e.keyCode === 13) {\n this.handleEditingFinished();\n }\n }\n }, {\n key: \"handleStartEditing\",\n value: function handleStartEditing() {\n if (!this.props.readOnly) {\n react_dom__WEBPACK_IMPORTED_MODULE_1___default.a.findDOMNode(this).focus();\n this.setState({\n active: true\n });\n }\n }\n }, {\n key: \"handleEditingFinished\",\n value: function handleEditingFinished() {\n this.setState({\n active: false\n });\n var value = this.state.value.trim();\n\n if ((value || this.props.value) && value !== this.props.value) {\n this.props.onFinished(value);\n }\n }\n }, {\n key: \"handlePasswordFinished\",\n value: function handlePasswordFinished(value) {\n this.setState({\n active: false\n });\n\n if (value && value !== this.props.value) {\n this.props.onFinished(value);\n }\n }\n }, {\n key: \"render\",\n value: function render() {\n if (this.state.active) {\n var fieldType = this.props.type || 'text';\n } else {\n var spanText = this.props.type == 'password' ? '••••••••' : this.state.value;\n var spanClass = 'in-place-edit' + (this.props.readOnly ? ' disabled' : '');\n\n if (!spanText) {\n spanText = this.props.placeholder;\n spanClass += ' placeholder';\n }\n\n if (spanText.length > 20) {\n spanText = spanText.substring(0, 19) + '...';\n }\n }\n\n return this.state.active ? fieldType == 'password' ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_visible_password_jsx__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n value: this.state.value,\n placeholder: this.props.placeholder,\n required: this.props.required ? 'required' : '',\n autoComplete: this.props.autoComplete,\n autoFocus: true,\n onFinished: this.handlePasswordFinished\n }) : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"input\", {\n type: fieldType,\n value: this.state.value,\n placeholder: this.props.placeholder,\n required: this.props.required ? 'required' : '',\n autoComplete: this.props.autoComplete,\n autoFocus: true,\n onChange: this.handeTextChange,\n onKeyDown: this.handleKeyDown,\n onBlur: this.handleEditingFinished\n }) : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", {\n className: spanClass,\n onClick: this.handleStartEditing\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", {\n className: \"content\"\n }, spanText));\n }\n }], [{\n key: \"getDerivedStateFromProps\",\n value: function getDerivedStateFromProps(nextProps, prevState) {\n if (prevState.initialValue != nextProps.value && !prevState.active) {\n return {\n initialValue: nextProps.value || '',\n value: nextProps.value || ''\n };\n }\n\n return null;\n }\n }]);\n\n return InPlaceEdit;\n}(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component);\n\n\n;\n\n//# sourceURL=webpack:///./src/widgets/in-place-edit.jsx?");
-var _arraySpeciesCreate = function (original, length) {
- return new (_arraySpeciesConstructor(original))(length);
-};
+/***/ }),
-// 0 -> Array#forEach
-// 1 -> Array#map
-// 2 -> Array#filter
-// 3 -> Array#some
-// 4 -> Array#every
-// 5 -> Array#find
-// 6 -> Array#findIndex
+/***/ "./src/widgets/letter-tile.jsx":
+/*!*************************************!*\
+ !*** ./src/widgets/letter-tile.jsx ***!
+ \*************************************/
+/*! exports provided: default */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return LetterTile; });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var tinode_sdk__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! tinode-sdk */ \"../tinode-js/umd/tinode.prod.js\");\n/* harmony import */ var tinode_sdk__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(tinode_sdk__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _lib_strformat_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../lib/strformat.js */ \"./src/lib/strformat.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 LetterTile = function (_React$PureComponent) {\n _inherits(LetterTile, _React$PureComponent);\n\n function LetterTile() {\n _classCallCheck(this, LetterTile);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(LetterTile).apply(this, arguments));\n }\n\n _createClass(LetterTile, [{\n key: \"render\",\n value: function render() {\n var avatar;\n\n if (this.props.avatar === true) {\n if (this.props.topic && this.props.title && this.props.title.trim()) {\n var letter = this.props.title.trim().charAt(0);\n var color = \"lettertile dark-color\" + Math.abs(Object(_lib_strformat_js__WEBPACK_IMPORTED_MODULE_2__[\"stringHash\"])(this.props.topic)) % 16;\n avatar = react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: color\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, letter));\n } else {\n avatar = tinode_sdk__WEBPACK_IMPORTED_MODULE_1___default.a.topicType(this.props.topic) == 'grp' ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"i\", {\n className: \"material-icons\"\n }, \"group\") : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"i\", {\n className: \"material-icons\"\n }, \"person\");\n }\n } else if (this.props.avatar) {\n avatar = react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"img\", {\n className: \"avatar\",\n alt: \"avatar\",\n src: this.props.avatar\n });\n } else {\n avatar = null;\n }\n\n return avatar;\n }\n }]);\n\n return LetterTile;\n}(react__WEBPACK_IMPORTED_MODULE_0___default.a.PureComponent);\n\n\n\n//# sourceURL=webpack:///./src/widgets/letter-tile.jsx?");
+/***/ }),
+/***/ "./src/widgets/load-spinner.jsx":
+/*!**************************************!*\
+ !*** ./src/widgets/load-spinner.jsx ***!
+ \**************************************/
+/*! exports provided: default */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return LoadSpinner; });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\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\nvar LoadSpinner = function (_React$PureComponent) {\n _inherits(LoadSpinner, _React$PureComponent);\n\n function LoadSpinner() {\n _classCallCheck(this, LoadSpinner);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(LoadSpinner).apply(this, arguments));\n }\n\n _createClass(LoadSpinner, [{\n key: \"render\",\n value: function render() {\n return this.props.show ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"load-spinner-box\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"loader-spinner\"\n })) : null;\n }\n }]);\n\n return LoadSpinner;\n}(react__WEBPACK_IMPORTED_MODULE_0___default.a.PureComponent);\n\n\n\n//# sourceURL=webpack:///./src/widgets/load-spinner.jsx?");
-var _arrayMethods = function (TYPE, $create) {
- var IS_MAP = TYPE == 1;
- var IS_FILTER = TYPE == 2;
- var IS_SOME = TYPE == 3;
- var IS_EVERY = TYPE == 4;
- var IS_FIND_INDEX = TYPE == 6;
- var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
- var create = $create || _arraySpeciesCreate;
- return function ($this, callbackfn, that) {
- var O = _toObject($this);
- var self = _iobject(O);
- var f = _ctx(callbackfn, that, 3);
- var length = _toLength(self.length);
- var index = 0;
- var result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined;
- var val, res;
- for (;length > index; index++) if (NO_HOLES || index in self) {
- val = self[index];
- res = f(val, index, O);
- if (TYPE) {
- if (IS_MAP) result[index] = res; // map
- else if (res) switch (TYPE) {
- case 3: return true; // some
- case 5: return val; // find
- case 6: return index; // findIndex
- case 2: result.push(val); // filter
- } else if (IS_EVERY) return false; // every
- }
- }
- return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result;
- };
-};
+/***/ }),
-// 22.1.3.31 Array.prototype[@@unscopables]
-var UNSCOPABLES = _wks('unscopables');
-var ArrayProto = Array.prototype;
-if (ArrayProto[UNSCOPABLES] == undefined) _hide(ArrayProto, UNSCOPABLES, {});
-var _addToUnscopables = function (key) {
- ArrayProto[UNSCOPABLES][key] = true;
-};
+/***/ "./src/widgets/menu-cancel.jsx":
+/*!*************************************!*\
+ !*** ./src/widgets/menu-cancel.jsx ***!
+ \*************************************/
+/*! exports provided: default */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
-// 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined)
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return MenuCancel; });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\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\nvar MenuCancel = function (_React$PureComponent) {\n _inherits(MenuCancel, _React$PureComponent);\n\n function MenuCancel(props) {\n _classCallCheck(this, MenuCancel);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(MenuCancel).call(this, props));\n }\n\n _createClass(MenuCancel, [{\n key: \"render\",\n value: function render() {\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"a\", {\n href: \"javascript:;\",\n onClick: this.props.onCancel\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"i\", {\n className: \"material-icons\"\n }, \"close\"));\n }\n }]);\n\n return MenuCancel;\n}(react__WEBPACK_IMPORTED_MODULE_0___default.a.PureComponent);\n\n\n\n//# sourceURL=webpack:///./src/widgets/menu-cancel.jsx?");
-var $find = _arrayMethods(5);
-var KEY = 'find';
-var forced = true;
-// Shouldn't skip holes
-if (KEY in []) Array(1)[KEY](function () { forced = false; });
-_export(_export.P + _export.F * forced, 'Array', {
- find: function find(callbackfn /* , that = undefined */) {
- return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
- }
-});
-_addToUnscopables(KEY);
+/***/ }),
-var find = _core.Array.find;
+/***/ "./src/widgets/menu-contacts.jsx":
+/*!***************************************!*\
+ !*** ./src/widgets/menu-contacts.jsx ***!
+ \***************************************/
+/*! exports provided: default */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
-// 22.1.3.9 Array.prototype.findIndex(predicate, thisArg = undefined)
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return MenuContacts; });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\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\nvar MenuContacts = function (_React$PureComponent) {\n _inherits(MenuContacts, _React$PureComponent);\n\n function MenuContacts() {\n _classCallCheck(this, MenuContacts);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(MenuContacts).apply(this, arguments));\n }\n\n _createClass(MenuContacts, [{\n key: \"render\",\n value: function render() {\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"a\", {\n href: \"javascript:;\",\n onClick: this.props.onNewTopic\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"i\", {\n className: \"material-icons\"\n }, \"chat\")), \"\\xA0\", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"a\", {\n href: \"javascript:;\",\n onClick: this.props.onSettings\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"i\", {\n className: \"material-icons\"\n }, \"settings\")));\n }\n }]);\n\n return MenuContacts;\n}(react__WEBPACK_IMPORTED_MODULE_0___default.a.PureComponent);\n\n\n;\n\n//# sourceURL=webpack:///./src/widgets/menu-contacts.jsx?");
-var $find$1 = _arrayMethods(6);
-var KEY$1 = 'findIndex';
-var forced$1 = true;
-// Shouldn't skip holes
-if (KEY$1 in []) Array(1)[KEY$1](function () { forced$1 = false; });
-_export(_export.P + _export.F * forced$1, 'Array', {
- findIndex: function findIndex(callbackfn /* , that = undefined */) {
- return $find$1(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
- }
-});
-_addToUnscopables(KEY$1);
+/***/ }),
-var findIndex = _core.Array.findIndex;
+/***/ "./src/widgets/menu-start.jsx":
+/*!************************************!*\
+ !*** ./src/widgets/menu-start.jsx ***!
+ \************************************/
+/*! exports provided: default */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
-// to indexed object, toObject with fallback for non-array-like ES3 strings
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return MenuStart; });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\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\nvar MenuStart = function (_React$PureComponent) {\n _inherits(MenuStart, _React$PureComponent);\n\n function MenuStart() {\n _classCallCheck(this, MenuStart);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(MenuStart).apply(this, arguments));\n }\n\n _createClass(MenuStart, [{\n key: \"render\",\n value: function render() {\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"a\", {\n href: \"javascript:;\",\n onClick: this.props.onSignUp\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"i\", {\n className: \"material-icons\"\n }, \"person_add\")), \"\\xA0\", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"a\", {\n href: \"javascript:;\",\n onClick: this.props.onSettings\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"i\", {\n className: \"material-icons\"\n }, \"settings\")));\n }\n }]);\n\n return MenuStart;\n}(react__WEBPACK_IMPORTED_MODULE_0___default.a.PureComponent);\n\n\n;\n\n//# sourceURL=webpack:///./src/widgets/menu-start.jsx?");
+/***/ }),
-var _toIobject = function (it) {
- return _iobject(_defined(it));
-};
+/***/ "./src/widgets/more-button.jsx":
+/*!*************************************!*\
+ !*** ./src/widgets/more-button.jsx ***!
+ \*************************************/
+/*! exports provided: default */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
-var max = Math.max;
-var min$1 = Math.min;
-var _toAbsoluteIndex = function (index, length) {
- index = _toInteger(index);
- return index < 0 ? max(index + length, 0) : min$1(index, length);
-};
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return MoreButton; });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\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 _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\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\n\n\nvar MoreButton = function (_React$PureComponent) {\n _inherits(MoreButton, _React$PureComponent);\n\n function MoreButton(props) {\n var _this;\n\n _classCallCheck(this, MoreButton);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(MoreButton).call(this, props));\n _this.state = {\n open: props.open\n };\n _this.handleToggle = _this.handleToggle.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n return _this;\n }\n\n _createClass(MoreButton, [{\n key: \"handleToggle\",\n value: function handleToggle() {\n var open = !this.state.open;\n this.setState({\n open: open\n });\n\n if (this.props.onToggle) {\n this.props.onToggle(open);\n }\n }\n }, {\n key: \"render\",\n value: function render() {\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"label\", {\n className: \"small\",\n onClick: this.handleToggle\n }, this.props.title, \"...\", this.state.open ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"i\", {\n className: \"material-icons\"\n }, \"expand_more\") : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"i\", {\n className: \"material-icons\"\n }, \"chevron_right\"));\n }\n }]);\n\n return MoreButton;\n}(react__WEBPACK_IMPORTED_MODULE_0___default.a.PureComponent);\n\n\n\n//# sourceURL=webpack:///./src/widgets/more-button.jsx?");
-// false -> Array#indexOf
-// true -> Array#includes
+/***/ }),
+/***/ "./src/widgets/new-topic-by-id.jsx":
+/*!*****************************************!*\
+ !*** ./src/widgets/new-topic-by-id.jsx ***!
+ \*****************************************/
+/*! exports provided: default */
+/***/ (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 */ \"react\");\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 */ \"react-intl\");\n/* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_intl__WEBPACK_IMPORTED_MODULE_1__);\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 _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\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\n\n\nvar messages = Object(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"defineMessages\"])({\n invalid_id: {\n \"id\": \"error_invalid_id\",\n \"defaultMessage\": \"Invalid ID\"\n }\n});\n\nvar NewTopicById = function (_React$PureComponent) {\n _inherits(NewTopicById, _React$PureComponent);\n\n function NewTopicById(props) {\n var _this;\n\n _classCallCheck(this, NewTopicById);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(NewTopicById).call(this, props));\n _this.state = {\n groupId: ''\n };\n _this.handleChange = _this.handleChange.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleKeyPress = _this.handleKeyPress.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleSubmit = _this.handleSubmit.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n return _this;\n }\n\n _createClass(NewTopicById, [{\n key: \"handleChange\",\n value: function handleChange(e) {\n this.setState({\n groupId: e.target.value\n });\n }\n }, {\n key: \"handleKeyPress\",\n value: function handleKeyPress(e) {\n if (e.key === 'Enter') {\n this.handleSubmit(e);\n }\n }\n }, {\n key: \"handleSubmit\",\n value: function handleSubmit(e) {\n e.preventDefault();\n\n if (this.state.groupId) {\n var name = this.state.groupId.trim();\n\n if (name.length > 3 && (name.substr(0, 3) == 'usr' || name.substr(0, 3) == 'grp')) {\n this.props.onSubmit(name);\n } else {\n this.props.onError(this.props.intl.formatMessage(messages.invalid_id), 'err');\n }\n }\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this2 = this;\n\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"panel-form\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"panel-form-row\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"group_user_id_prompt\",\n defaultMessage: \"Group or User ID\"\n }, function (prompt) {\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"input\", {\n type: \"text\",\n placeholder: prompt,\n value: _this2.state.groupId,\n onChange: _this2.handleChange,\n onKeyPress: _this2.handleKeyPress,\n required: true\n });\n })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"dialog-buttons\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"button\", {\n className: \"blue\",\n onClick: this.handleSubmit\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"button_subscribe\",\n defaultMessage: \"Subscribe\"\n }))));\n }\n }]);\n\n return NewTopicById;\n}(react__WEBPACK_IMPORTED_MODULE_0___default.a.PureComponent);\n\n;\n/* harmony default export */ __webpack_exports__[\"default\"] = (Object(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"injectIntl\"])(NewTopicById));\n\n//# sourceURL=webpack:///./src/widgets/new-topic-by-id.jsx?");
-var _arrayIncludes = function (IS_INCLUDES) {
- return function ($this, el, fromIndex) {
- var O = _toIobject($this);
- var length = _toLength(O.length);
- var index = _toAbsoluteIndex(fromIndex, length);
- var value;
- // Array#includes uses SameValueZero equality algorithm
- // eslint-disable-next-line no-self-compare
- if (IS_INCLUDES && el != el) while (length > index) {
- value = O[index++];
- // eslint-disable-next-line no-self-compare
- if (value != value) return true;
- // Array#indexOf ignores holes, Array#includes - not
- } else for (;length > index; index++) if (IS_INCLUDES || index in O) {
- if (O[index] === el) return IS_INCLUDES || index || 0;
- } return !IS_INCLUDES && -1;
- };
-};
+/***/ }),
-var shared = _shared('keys');
+/***/ "./src/widgets/new-topic-group.jsx":
+/*!*****************************************!*\
+ !*** ./src/widgets/new-topic-group.jsx ***!
+ \*****************************************/
+/*! exports provided: default */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
-var _sharedKey = function (key) {
- return shared[key] || (shared[key] = _uid(key));
-};
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return NewTopicGroup; });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-intl */ \"react-intl\");\n/* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_intl__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _avatar_upload_jsx__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./avatar-upload.jsx */ \"./src/widgets/avatar-upload.jsx\");\n/* harmony import */ var _tag_manager_jsx__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./tag-manager.jsx */ \"./src/widgets/tag-manager.jsx\");\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 _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\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\n\n\n\n\n\nvar NewTopicGroup = function (_React$PureComponent) {\n _inherits(NewTopicGroup, _React$PureComponent);\n\n function NewTopicGroup(props) {\n var _this;\n\n _classCallCheck(this, NewTopicGroup);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(NewTopicGroup).call(this, props));\n _this.state = {\n fn: '',\n private: '',\n imageDataUrl: null,\n tags: []\n };\n _this.handleFnChange = _this.handleFnChange.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handlePrivateChange = _this.handlePrivateChange.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleImageChanged = _this.handleImageChanged.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleTagsChanged = _this.handleTagsChanged.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleTagsChanged = _this.handleTagsChanged.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleSubmit = _this.handleSubmit.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n return _this;\n }\n\n _createClass(NewTopicGroup, [{\n key: \"handleFnChange\",\n value: function handleFnChange(e) {\n this.setState({\n fn: e.target.value\n });\n }\n }, {\n key: \"handlePrivateChange\",\n value: function handlePrivateChange(e) {\n this.setState({\n private: e.target.value\n });\n }\n }, {\n key: \"handleImageChanged\",\n value: function handleImageChanged(img) {\n this.setState({\n imageDataUrl: img\n });\n }\n }, {\n key: \"handleTagsChanged\",\n value: function handleTagsChanged(tags) {\n this.setState({\n tags: tags\n });\n }\n }, {\n key: \"handleSubmit\",\n value: function handleSubmit(e) {\n e.preventDefault();\n\n if (this.state.fn && this.state.fn.trim()) {\n this.props.onSubmit(this.state.fn.trim(), this.state.imageDataUrl, this.state.private.trim(), this.state.tags);\n }\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this2 = this;\n\n var submitClasses = 'blue';\n\n if (this.props.disabled) {\n submitClasses += ' disabled';\n }\n\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"form\", {\n className: \"panel-form\",\n onSubmit: this.handleSubmit\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"panel-form-row\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"panel-form-column\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"label\", {\n className: \"small\",\n htmlFor: \"new-topic-fn\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"label_topic_name\"\n })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"topic_name_editing_placeholder\",\n defaultMessage: \"Freeform name of the group\"\n }, function (placeholder) {\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"input\", {\n type: \"text\",\n id: \"new-topic-fn\",\n placeholder: placeholder,\n value: _this2.state.fn,\n onChange: _this2.handleFnChange,\n autoFocus: true,\n required: true\n });\n }), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"br\", null), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"label\", {\n className: \"small\",\n htmlFor: \"new-topic-priv\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"label_private\"\n })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"private_editing_placeholder\"\n }, function (placeholder) {\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"input\", {\n type: \"text\",\n id: \"new-topic-priv\",\n placeholder: placeholder,\n value: _this2.state.private,\n onChange: _this2.handlePrivateChange\n });\n })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_avatar_upload_jsx__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n onError: this.props.onError,\n onImageChanged: this.handleImageChanged\n })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"title_tag_manager\"\n }, function (title) {\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_tag_manager_jsx__WEBPACK_IMPORTED_MODULE_3__[\"default\"], {\n tags: _this2.state.tags,\n activated: true,\n onTagsChanged: _this2.handleTagsChanged,\n title: title\n });\n }), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"dialog-buttons\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"button\", {\n className: submitClasses\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"button_create\",\n defaultMessage: \"Create\"\n }))));\n }\n }]);\n\n return NewTopicGroup;\n}(react__WEBPACK_IMPORTED_MODULE_0___default.a.PureComponent);\n\n\n;\n\n//# sourceURL=webpack:///./src/widgets/new-topic-group.jsx?");
-var arrayIndexOf = _arrayIncludes(false);
-var IE_PROTO = _sharedKey('IE_PROTO');
+/***/ }),
-var _objectKeysInternal = function (object, names) {
- var O = _toIobject(object);
- var i = 0;
- var result = [];
- var key;
- for (key in O) if (key != IE_PROTO) _has(O, key) && result.push(key);
- // Don't enum bug & hidden keys
- while (names.length > i) if (_has(O, key = names[i++])) {
- ~arrayIndexOf(result, key) || result.push(key);
- }
- return result;
-};
+/***/ "./src/widgets/permissions-editor.jsx":
+/*!********************************************!*\
+ !*** ./src/widgets/permissions-editor.jsx ***!
+ \********************************************/
+/*! exports provided: default */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
-// IE 8- don't enum bug keys
-var _enumBugKeys = (
- 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'
-).split(',');
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-intl */ \"react-intl\");\n/* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_intl__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _checkbox_jsx__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./checkbox.jsx */ \"./src/widgets/checkbox.jsx\");\n/* harmony import */ var _contact_jsx__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./contact.jsx */ \"./src/widgets/contact.jsx\");\n/* harmony import */ var _lib_blob_helpers_js__WEBPACK_IMPORTED_MODULE_4__ = __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 _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\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\n\n\n\n\n\nvar messages = Object(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"defineMessages\"])({\n 'joiner': {\n \"id\": \"permission_join\",\n \"defaultMessage\": \"Join ({val})\"\n },\n 'reader': {\n \"id\": \"permission_read\",\n \"defaultMessage\": \"Read ({val})\"\n },\n 'writer': {\n \"id\": \"permission_write\",\n \"defaultMessage\": \"Write ({val})\"\n },\n 'preser': {\n \"id\": \"permission_pres\",\n \"defaultMessage\": \"Get notified ({val})\"\n },\n 'approver': {\n \"id\": \"permission_admin\",\n \"defaultMessage\": \"Approve ({val})\"\n },\n 'sharer': {\n \"id\": \"permission_share\",\n \"defaultMessage\": \"Share ({val})\"\n },\n 'deleter': {\n \"id\": \"permission_delete\",\n \"defaultMessage\": \"Delete ({val})\"\n },\n 'owner': {\n \"id\": \"permission_owner\",\n \"defaultMessage\": \"Owner ({val})\"\n }\n});\n\nvar PermissionsEditor = function (_React$Component) {\n _inherits(PermissionsEditor, _React$Component);\n\n function PermissionsEditor(props) {\n var _this;\n\n _classCallCheck(this, PermissionsEditor);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(PermissionsEditor).call(this, props));\n _this.state = {\n mode: (props.mode || '').replace('N', '')\n };\n _this.handleChange = _this.handleChange.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleSubmit = _this.handleSubmit.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleCancel = _this.handleCancel.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n return _this;\n }\n\n _createClass(PermissionsEditor, [{\n key: \"handleChange\",\n value: function handleChange(val) {\n var mode = this.state.mode;\n var idx = mode.indexOf(val);\n\n if (idx == -1) {\n mode += val;\n } else {\n mode = mode.replace(val, '');\n }\n\n this.setState({\n mode: mode\n });\n }\n }, {\n key: \"handleSubmit\",\n value: function handleSubmit() {\n var mode = (this.state.mode || 'N').split('').sort().join('');\n var before = (this.props.mode || 'N').split('').sort().join('');\n\n if (mode !== before) {\n this.props.onSubmit(mode);\n } else {\n this.props.onCancel();\n }\n }\n }, {\n key: \"handleCancel\",\n value: function handleCancel() {\n this.props.onCancel();\n }\n }, {\n key: \"render\",\n value: function render() {\n var formatMessage = this.props.intl.formatMessage;\n var all = 'JRWPASDO';\n var names = {\n 'J': formatMessage(messages.joiner, {\n val: 'J'\n }),\n 'R': formatMessage(messages.reader, {\n val: 'R'\n }),\n 'W': formatMessage(messages.writer, {\n val: 'W'\n }),\n 'P': formatMessage(messages.preser, {\n val: 'P'\n }),\n 'A': formatMessage(messages.approver, {\n val: 'A'\n }),\n 'S': formatMessage(messages.sharer, {\n val: 'S'\n }),\n 'D': formatMessage(messages.deleter, {\n val: 'D'\n }),\n 'O': formatMessage(messages.owner, {\n val: 'O'\n })\n };\n var skip = this.props.skip || '';\n var mode = this.state.mode;\n var compare = (this.props.compare || '').replace('N', '');\n var items = [];\n\n for (var i = 0; i < all.length; i++) {\n var c = all.charAt(i);\n\n if (skip.indexOf(c) >= 0 && mode.indexOf(c) < 0) {\n continue;\n }\n\n items.push(react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"tr\", {\n key: c\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"td\", null, names[c]), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"td\", {\n className: \"checkbox\"\n }, skip.indexOf(c) < 0 ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_checkbox_jsx__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n name: c,\n checked: mode.indexOf(c) >= 0,\n onChange: this.handleChange\n }) : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_checkbox_jsx__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n name: c,\n checked: mode.indexOf(c) >= 0\n })), this.props.compare ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"td\", {\n className: \"checkbox\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_checkbox_jsx__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n name: c,\n checked: compare.indexOf(c) >= 0\n })) : null));\n }\n\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"panel-form-column\"\n }, this.props.userTitle ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"ul\", {\n className: \"contact-box\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_contact_jsx__WEBPACK_IMPORTED_MODULE_3__[\"default\"], {\n item: this.props.item,\n title: this.props.userTitle,\n avatar: Object(_lib_blob_helpers_js__WEBPACK_IMPORTED_MODULE_4__[\"makeImageUrl\"])(this.props.userAvatar ? this.props.userAvatar : null)\n })) : null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"label\", {\n className: \"small\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"title_permissions\",\n defaultMessage: \"Permissions\"\n })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"table\", {\n className: \"permission-editor\"\n }, this.props.compare ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"thead\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"tr\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"th\", null), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"th\", null, this.props.modeTitle), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"th\", null, this.props.compareTitle))) : null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"tbody\", null, items)), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"br\", null), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"dialog-buttons\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"button\", {\n className: \"blue\",\n onClick: this.handleSubmit\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"button_ok\"\n })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"button\", {\n className: \"white\",\n onClick: this.handleCancel\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"button_cancel\"\n }))));\n }\n }]);\n\n return PermissionsEditor;\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\"])(PermissionsEditor));\n\n//# sourceURL=webpack:///./src/widgets/permissions-editor.jsx?");
-// 19.1.2.14 / 15.2.3.14 Object.keys(O)
+/***/ }),
+/***/ "./src/widgets/received-marker.jsx":
+/*!*****************************************!*\
+ !*** ./src/widgets/received-marker.jsx ***!
+ \*****************************************/
+/*! exports provided: default */
+/***/ (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 */ \"react\");\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 */ \"react-intl\");\n/* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_intl__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var tinode_sdk__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! tinode-sdk */ \"../tinode-js/umd/tinode.prod.js\");\n/* harmony import */ var tinode_sdk__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(tinode_sdk__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _lib_strformat_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../lib/strformat.js */ \"./src/lib/strformat.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 'sending': {\n \"id\": \"message_sending\",\n \"defaultMessage\": \"sending...\"\n },\n 'failed': {\n \"id\": \"message_sending_failed\",\n \"defaultMessage\": \"failed\"\n }\n});\n\nvar ReceivedMarker = function (_React$PureComponent) {\n _inherits(ReceivedMarker, _React$PureComponent);\n\n function ReceivedMarker() {\n _classCallCheck(this, ReceivedMarker);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(ReceivedMarker).apply(this, arguments));\n }\n\n _createClass(ReceivedMarker, [{\n key: \"render\",\n value: function render() {\n var formatMessage = this.props.intl.formatMessage;\n var timestamp;\n\n if (this.props.received <= tinode_sdk__WEBPACK_IMPORTED_MODULE_2___default.a.MESSAGE_STATUS_SENDING) {\n timestamp = formatMessage(messages.sending);\n } else if (this.props.received == tinode_sdk__WEBPACK_IMPORTED_MODULE_2___default.a.MESSAGE_STATUS_FAILED) {\n timestamp = formatMessage(messages.failed);\n } else {\n timestamp = Object(_lib_strformat_js__WEBPACK_IMPORTED_MODULE_3__[\"shortDateFormat\"])(this.props.timestamp);\n }\n\n var marker = null;\n\n if (this.props.received <= tinode_sdk__WEBPACK_IMPORTED_MODULE_2___default.a.MESSAGE_STATUS_SENDING) {\n marker = react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"i\", {\n className: \"material-icons small\"\n }, \"access_time\");\n } else if (this.props.received == tinode_sdk__WEBPACK_IMPORTED_MODULE_2___default.a.MESSAGE_STATUS_FAILED) {\n marker = react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"i\", {\n className: \"material-icons small red\"\n }, \"error_outline\");\n } else if (this.props.received == tinode_sdk__WEBPACK_IMPORTED_MODULE_2___default.a.MESSAGE_STATUS_SENT) {\n marker = react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"i\", {\n className: \"material-icons small\"\n }, \"done\");\n } else if (this.props.received == tinode_sdk__WEBPACK_IMPORTED_MODULE_2___default.a.MESSAGE_STATUS_RECEIVED) {\n marker = react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"i\", {\n className: \"material-icons small\"\n }, \"done_all\");\n } else if (this.props.received == tinode_sdk__WEBPACK_IMPORTED_MODULE_2___default.a.MESSAGE_STATUS_READ) {\n marker = react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"i\", {\n className: \"material-icons small blue\"\n }, \"done_all\");\n }\n\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", {\n className: \"timestamp\"\n }, timestamp, \"\\xA0\", marker);\n }\n }]);\n\n return ReceivedMarker;\n}(react__WEBPACK_IMPORTED_MODULE_0___default.a.PureComponent);\n\n;\n/* harmony default export */ __webpack_exports__[\"default\"] = (Object(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"injectIntl\"])(ReceivedMarker));\n\n//# sourceURL=webpack:///./src/widgets/received-marker.jsx?");
-var _objectKeys = Object.keys || function keys(O) {
- return _objectKeysInternal(O, _enumBugKeys);
-};
+/***/ }),
-var f$1 = Object.getOwnPropertySymbols;
+/***/ "./src/widgets/search-contacts.jsx":
+/*!*****************************************!*\
+ !*** ./src/widgets/search-contacts.jsx ***!
+ \*****************************************/
+/*! exports provided: default */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
-var _objectGops = {
- f: f$1
-};
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return SearchContacts; });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-intl */ \"react-intl\");\n/* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_intl__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var tinode_sdk__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! tinode-sdk */ \"../tinode-js/umd/tinode.prod.js\");\n/* harmony import */ var tinode_sdk__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(tinode_sdk__WEBPACK_IMPORTED_MODULE_2__);\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 _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\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\n\n\n\n\nvar SearchContacts = function (_React$PureComponent) {\n _inherits(SearchContacts, _React$PureComponent);\n\n function SearchContacts(props) {\n var _this;\n\n _classCallCheck(this, SearchContacts);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(SearchContacts).call(this, props));\n _this.state = {\n edited: false,\n search: ''\n };\n _this.handleSearchChange = _this.handleSearchChange.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleSearch = _this.handleSearch.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleClear = _this.handleClear.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleKeyDown = _this.handleKeyDown.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n return _this;\n }\n\n _createClass(SearchContacts, [{\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n if (this.state.edited) {\n this.setState({\n search: '',\n edited: false\n });\n this.props.onSearchContacts(tinode_sdk__WEBPACK_IMPORTED_MODULE_2___default.a.DEL_CHAR);\n }\n }\n }, {\n key: \"handleSearchChange\",\n value: function handleSearchChange(e) {\n this.setState({\n search: e.target.value\n });\n }\n }, {\n key: \"handleSearch\",\n value: function handleSearch(e) {\n e.preventDefault();\n var query = this.state.search.trim();\n this.setState({\n edited: query.length > 0\n });\n this.props.onSearchContacts(query.length > 0 ? query : tinode_sdk__WEBPACK_IMPORTED_MODULE_2___default.a.DEL_CHAR);\n }\n }, {\n key: \"handleClear\",\n value: function handleClear() {\n if (this.state.edited) {\n this.props.onSearchContacts(tinode_sdk__WEBPACK_IMPORTED_MODULE_2___default.a.DEL_CHAR);\n }\n\n this.setState({\n search: '',\n edited: false\n });\n }\n }, {\n key: \"handleKeyDown\",\n value: function handleKeyDown(e) {\n if (e.key === 'Enter') {\n this.handleSearch(e);\n } else if (e.key === 'Escape') {\n this.handleClear();\n }\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this2 = this;\n\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"panel-form\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"panel-form-row\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"i\", {\n className: \"material-icons search\"\n }, \"search\"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"search_placeholder\",\n defaultMessage: \"List like email:alice@example.com, tel:17025550003...\"\n }, function (search_placeholder) {\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"input\", {\n className: \"search\",\n type: \"text\",\n placeholder: search_placeholder,\n value: _this2.state.search,\n onChange: _this2.handleSearchChange,\n onKeyDown: _this2.handleKeyDown,\n required: true,\n autoFocus: true\n });\n }), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"a\", {\n href: \"javascript:;\",\n onClick: this.handleClear\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"i\", {\n className: \"material-icons\"\n }, \"close\"))));\n }\n }]);\n\n return SearchContacts;\n}(react__WEBPACK_IMPORTED_MODULE_0___default.a.PureComponent);\n\n\n;\n\n//# sourceURL=webpack:///./src/widgets/search-contacts.jsx?");
-var f$2 = {}.propertyIsEnumerable;
+/***/ }),
-var _objectPie = {
- f: f$2
-};
+/***/ "./src/widgets/send-message.jsx":
+/*!**************************************!*\
+ !*** ./src/widgets/send-message.jsx ***!
+ \**************************************/
+/*! exports provided: default */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
-// 19.1.2.1 Object.assign(target, source, ...)
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-intl */ \"react-intl\");\n/* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_intl__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var tinode_sdk__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! tinode-sdk */ \"../tinode-js/umd/tinode.prod.js\");\n/* harmony import */ var tinode_sdk__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(tinode_sdk__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _config_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../config.js */ \"./src/config.js\");\n/* harmony import */ var _lib_blob_helpers_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../lib/blob-helpers.js */ \"./src/lib/blob-helpers.js\");\n/* harmony import */ var _lib_strformat_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../lib/strformat.js */ \"./src/lib/strformat.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 _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\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\n\n\n\n\n\n\nvar messages = Object(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"defineMessages\"])({\n 'messaging_disabled': {\n \"id\": \"messaging_disabled_prompt\",\n \"defaultMessage\": \"Messaging disabled\"\n },\n 'type_new_message': {\n \"id\": \"new_message_prompt\",\n \"defaultMessage\": \"New message\"\n },\n 'file_attachment_too_large': {\n \"id\": \"file_attachment_too_large\",\n \"defaultMessage\": \"The file size {size} exceeds the {limit} limit.\"\n },\n 'cannot_initiate_upload': {\n \"id\": \"cannot_initiate_file_upload\",\n \"defaultMessage\": \"Cannot initiate file upload.\"\n }\n});\n\nvar SendMessage = function (_React$PureComponent) {\n _inherits(SendMessage, _React$PureComponent);\n\n function SendMessage(props) {\n var _this;\n\n _classCallCheck(this, SendMessage);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(SendMessage).call(this, props));\n _this.state = {\n message: '',\n keypressTimestamp: new Date().getTime() - _config_js__WEBPACK_IMPORTED_MODULE_3__[\"KEYPRESS_DELAY\"] - 1\n };\n _this.handlePasteEvent = _this.handlePasteEvent.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleAttachImage = _this.handleAttachImage.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleAttachFile = _this.handleAttachFile.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleSend = _this.handleSend.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleKeyPress = _this.handleKeyPress.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleMessageTyping = _this.handleMessageTyping.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n return _this;\n }\n\n _createClass(SendMessage, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n this.pasteFile.addEventListener('paste', this.handlePasteEvent, false);\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n this.pasteFile.removeEventListener('paste', this.handlePasteEvent, false);\n }\n }, {\n key: \"handlePasteEvent\",\n value: function handlePasteEvent(e) {\n var _this2 = this;\n\n if (this.props.disabled) {\n return;\n }\n\n if (Object(_lib_blob_helpers_js__WEBPACK_IMPORTED_MODULE_4__[\"filePasted\"])(e, function (bits, mime, width, height, fname) {\n _this2.props.sendMessage(tinode_sdk__WEBPACK_IMPORTED_MODULE_2__[\"Drafty\"].insertImage(null, 0, mime, bits, width, height, fname));\n }, function (mime, bits, fname) {\n _this2.props.sendMessage(tinode_sdk__WEBPACK_IMPORTED_MODULE_2__[\"Drafty\"].attachFile(null, mime, bits, fname));\n }, this.props.onError)) {\n e.preventDefault();\n }\n }\n }, {\n key: \"handleAttachImage\",\n value: function handleAttachImage(e) {\n var _this3 = this;\n\n if (e.target.files && e.target.files.length > 0) {\n var file = e.target.files[0];\n\n if (file.size > _config_js__WEBPACK_IMPORTED_MODULE_3__[\"MAX_INBAND_ATTACHMENT_SIZE\"] || _lib_blob_helpers_js__WEBPACK_IMPORTED_MODULE_4__[\"SUPPORTED_IMAGE_FORMATS\"].indexOf(file.type) < 0) {\n Object(_lib_blob_helpers_js__WEBPACK_IMPORTED_MODULE_4__[\"imageFileScaledToBase64\"])(file, _config_js__WEBPACK_IMPORTED_MODULE_3__[\"MAX_IMAGE_DIM\"], _config_js__WEBPACK_IMPORTED_MODULE_3__[\"MAX_IMAGE_DIM\"], false, function (bits, mime, width, height, fname) {\n _this3.props.sendMessage(tinode_sdk__WEBPACK_IMPORTED_MODULE_2__[\"Drafty\"].insertImage(null, 0, mime, bits, width, height, fname));\n }, function (err) {\n _this3.props.onError(err, 'err');\n });\n } else {\n Object(_lib_blob_helpers_js__WEBPACK_IMPORTED_MODULE_4__[\"imageFileToBase64\"])(file, function (bits, mime, width, height, fname) {\n _this3.props.sendMessage(tinode_sdk__WEBPACK_IMPORTED_MODULE_2__[\"Drafty\"].insertImage(null, 0, mime, bits, width, height, fname));\n }, function (err) {\n _this3.props.onError(err, 'err');\n });\n }\n }\n\n e.target.value = '';\n }\n }, {\n key: \"handleAttachFile\",\n value: function handleAttachFile(e) {\n var _this4 = this;\n\n var formatMessage = this.props.intl.formatMessage;\n\n if (e.target.files && e.target.files.length > 0) {\n var file = e.target.files[0];\n\n if (file.size > _config_js__WEBPACK_IMPORTED_MODULE_3__[\"MAX_EXTERN_ATTACHMENT_SIZE\"]) {\n this.props.onError(formatMessage(messages.file_attachment_too_large, {\n size: Object(_lib_strformat_js__WEBPACK_IMPORTED_MODULE_5__[\"bytesToHumanSize\"])(file.size),\n limit: Object(_lib_strformat_js__WEBPACK_IMPORTED_MODULE_5__[\"bytesToHumanSize\"])(_config_js__WEBPACK_IMPORTED_MODULE_3__[\"MAX_EXTERN_ATTACHMENT_SIZE\"])\n }), 'err');\n } else if (file.size > _config_js__WEBPACK_IMPORTED_MODULE_3__[\"MAX_INBAND_ATTACHMENT_SIZE\"]) {\n var uploader = this.props.tinode.getLargeFileHelper();\n\n if (!uploader) {\n this.props.onError(formatMessage(messages.cannot_initiate_upload));\n return;\n }\n\n var uploadCompletionPromise = uploader.upload(file);\n var msg = tinode_sdk__WEBPACK_IMPORTED_MODULE_2__[\"Drafty\"].attachFile(null, file.type, null, file.name, file.size, uploadCompletionPromise);\n this.props.sendMessage(msg, uploadCompletionPromise, uploader);\n } else {\n fileToBase64(file, function (mime, bits, fname) {\n _this4.props.sendMessage(tinode_sdk__WEBPACK_IMPORTED_MODULE_2__[\"Drafty\"].attachFile(null, mime, bits, fname));\n }, this.props.onError);\n }\n }\n\n e.target.value = '';\n }\n }, {\n key: \"handleSend\",\n value: function handleSend() {\n var message = this.state.message.trim();\n\n if (message) {\n this.props.sendMessage(this.state.message.trim());\n this.setState({\n message: ''\n });\n }\n }\n }, {\n key: \"handleKeyPress\",\n value: function handleKeyPress(e) {\n if (e.key === 'Enter') {\n if (!e.shiftKey) {\n e.preventDefault();\n e.stopPropagation();\n this.handleSend();\n }\n }\n }\n }, {\n key: \"handleMessageTyping\",\n value: function handleMessageTyping(e) {\n var newState = {\n message: e.target.value\n };\n var now = new Date().getTime();\n\n if (now - this.state.keypressTimestamp > _config_js__WEBPACK_IMPORTED_MODULE_3__[\"KEYPRESS_DELAY\"]) {\n var topic = this.props.tinode.getTopic(this.props.topic);\n\n if (topic.isSubscribed()) {\n topic.noteKeyPress();\n }\n\n newState.keypressTimestamp = now;\n }\n\n this.setState(newState);\n }\n }, {\n key: \"render\",\n value: function render() {\n var formatMessage = this.props.intl.formatMessage;\n var prompt = this.props.disabled ? formatMessage(messages.messaging_disabled) : formatMessage(messages.type_new_message);\n var instance = this;\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n id: \"send-message-panel\"\n }, this.props.disabled ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"i\", {\n className: \"material-icons disabled\"\n }, \"photo\") : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"a\", {\n href: \"javascript:;\",\n onClick: function onClick(e) {\n instance.attachImage.click();\n },\n title: \"Add image\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"i\", {\n className: \"material-icons secondary\"\n }, \"photo\")), this.props.disabled ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"i\", {\n className: \"material-icons disabled\"\n }, \"attach_file\") : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"a\", {\n href: \"javascript:;\",\n onClick: function onClick(e) {\n instance.attachFile.click();\n },\n title: \"Attach file\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"i\", {\n className: \"material-icons secondary\"\n }, \"attach_file\")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"textarea\", {\n id: \"sendMessage\",\n placeholder: prompt,\n disabled: this.props.disabled,\n value: this.state.message,\n onChange: this.handleMessageTyping,\n onKeyPress: this.handleKeyPress,\n ref: function ref(_ref) {\n instance.pasteFile = _ref;\n },\n autoFocus: true\n }), this.props.disabled ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"i\", {\n className: \"material-icons disabled\"\n }, \"send\") : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"a\", {\n href: \"javascript:;\",\n onClick: this.handleSend,\n title: \"Send\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"i\", {\n className: \"material-icons\"\n }, \"send\")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"input\", {\n type: \"file\",\n ref: function ref(_ref2) {\n instance.attachFile = _ref2;\n },\n onChange: this.handleAttachFile,\n style: {\n display: 'none'\n }\n }), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"input\", {\n type: \"file\",\n ref: function ref(_ref3) {\n instance.attachImage = _ref3;\n },\n accept: \"image/*\",\n onChange: this.handleAttachImage,\n style: {\n display: 'none'\n }\n }));\n }\n }]);\n\n return SendMessage;\n}(react__WEBPACK_IMPORTED_MODULE_0___default.a.PureComponent);\n\n;\n/* harmony default export */ __webpack_exports__[\"default\"] = (Object(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"injectIntl\"])(SendMessage));\n\n//# sourceURL=webpack:///./src/widgets/send-message.jsx?");
+/***/ }),
+/***/ "./src/widgets/side-navbar.jsx":
+/*!*************************************!*\
+ !*** ./src/widgets/side-navbar.jsx ***!
+ \*************************************/
+/*! exports provided: default */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return SideNavbar; });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _letter_tile_jsx__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./letter-tile.jsx */ \"./src/widgets/letter-tile.jsx\");\n/* harmony import */ var _menu_cancel_jsx__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./menu-cancel.jsx */ \"./src/widgets/menu-cancel.jsx\");\n/* harmony import */ var _menu_contacts_jsx__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./menu-contacts.jsx */ \"./src/widgets/menu-contacts.jsx\");\n/* harmony import */ var _menu_start_jsx__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./menu-start.jsx */ \"./src/widgets/menu-start.jsx\");\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\n\n\nvar SideNavbar = function (_React$PureComponent) {\n _inherits(SideNavbar, _React$PureComponent);\n\n function SideNavbar() {\n _classCallCheck(this, SideNavbar);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(SideNavbar).apply(this, arguments));\n }\n\n _createClass(SideNavbar, [{\n key: \"render\",\n value: function render() {\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n id: \"side-caption-panel\",\n className: \"caption-panel\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n id: \"self-avatar\",\n className: \"avatar-box\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_letter_tile_jsx__WEBPACK_IMPORTED_MODULE_1__[\"default\"], {\n avatar: this.props.avatar,\n topic: this.props.myUserId,\n title: this.props.title\n })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n id: \"sidepanel-title\",\n className: \"panel-title\"\n }, this.props.title), this.props.state === 'login' ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_menu_start_jsx__WEBPACK_IMPORTED_MODULE_4__[\"default\"], {\n onSignUp: this.props.onSignUp,\n onSettings: this.props.onSettings\n }) : this.props.state === 'contacts' ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_menu_contacts_jsx__WEBPACK_IMPORTED_MODULE_3__[\"default\"], {\n onNewTopic: this.props.onNewTopic,\n onSettings: this.props.onSettings\n }) : null, this.props.onCancel ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_menu_cancel_jsx__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n onCancel: this.props.onCancel\n }) : null);\n }\n }]);\n\n return SideNavbar;\n}(react__WEBPACK_IMPORTED_MODULE_0___default.a.PureComponent);\n\n\n;\n\n//# sourceURL=webpack:///./src/widgets/side-navbar.jsx?");
+/***/ }),
-var $assign = Object.assign;
+/***/ "./src/widgets/tag-manager.jsx":
+/*!*************************************!*\
+ !*** ./src/widgets/tag-manager.jsx ***!
+ \*************************************/
+/*! exports provided: default */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
-// should work with symbols and should have deterministic property order (V8 bug)
-var _objectAssign = !$assign || _fails(function () {
- var A = {};
- var B = {};
- // eslint-disable-next-line no-undef
- var S = Symbol();
- var K = 'abcdefghijklmnopqrst';
- A[S] = 7;
- K.split('').forEach(function (k) { B[k] = k; });
- return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;
-}) ? function assign(target, source) { // eslint-disable-line no-unused-vars
- var T = _toObject(target);
- var aLen = arguments.length;
- var index = 1;
- var getSymbols = _objectGops.f;
- var isEnum = _objectPie.f;
- while (aLen > index) {
- var S = _iobject(arguments[index++]);
- var keys = getSymbols ? _objectKeys(S).concat(getSymbols(S)) : _objectKeys(S);
- var length = keys.length;
- var j = 0;
- var key;
- while (length > j) if (isEnum.call(S, key = keys[j++])) T[key] = S[key];
- } return T;
-} : $assign;
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return TagManager; });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-intl */ \"react-intl\");\n/* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_intl__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _chip_input_jsx__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./chip-input.jsx */ \"./src/widgets/chip-input.jsx\");\n/* harmony import */ var _config_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../config.js */ \"./src/config.js\");\n/* harmony import */ var _lib_utils_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../lib/utils.js */ \"./src/lib/utils.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 _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\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\n\n\n\n\n\n\nvar TagManager = function (_React$Component) {\n _inherits(TagManager, _React$Component);\n\n function TagManager(props) {\n var _this;\n\n _classCallCheck(this, TagManager);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(TagManager).call(this, props));\n _this.state = {\n tags: _this.props.tags,\n tagInput: '',\n activated: _this.props.activated\n };\n _this.handleShowTagManager = _this.handleShowTagManager.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleTagInput = _this.handleTagInput.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleAddTag = _this.handleAddTag.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleRemoveTag = _this.handleRemoveTag.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleSubmit = _this.handleSubmit.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleCancel = _this.handleCancel.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n return _this;\n }\n\n _createClass(TagManager, [{\n key: \"handleShowTagManager\",\n value: function handleShowTagManager() {\n this.setState({\n activated: true\n });\n }\n }, {\n key: \"handleTagInput\",\n value: function handleTagInput(text) {\n this.setState({\n tagInput: text\n });\n\n if (text.length > 0) {\n var last = text[text.length - 1];\n\n if (last == ',' || last == ' ' || last == ';') {\n var tag = text.substr(0, text.length - 1).trim();\n\n if (tag.length >= _config_js__WEBPACK_IMPORTED_MODULE_3__[\"MIN_TAG_LENGTH\"]) {\n this.handleAddTag(tag);\n }\n }\n }\n }\n }, {\n key: \"handleAddTag\",\n value: function handleAddTag(tag) {\n tag = tag.trim();\n\n if (tag.length > 0) {\n var tags = this.state.tags.slice(0);\n tags.push(tag);\n this.setState({\n tags: tags,\n tagInput: ''\n });\n\n if (this.props.onTagsChanged) {\n this.props.onTagsChanged(tags);\n }\n }\n }\n }, {\n key: \"handleRemoveTag\",\n value: function handleRemoveTag(tag, index) {\n var tags = this.state.tags.slice(0);\n tags.splice(index, 1);\n this.setState({\n tags: tags\n });\n\n if (this.props.onTagsChanged) {\n this.props.onTagsChanged(tags);\n }\n }\n }, {\n key: \"handleSubmit\",\n value: function handleSubmit() {\n var tags = this.state.tags.slice(0);\n var inp = this.state.tagInput.trim();\n\n if (inp.length > 0) {\n tags.push(inp);\n\n if (this.props.onTagsChanged) {\n this.props.onTagsChanged(tags);\n }\n }\n\n this.props.onSubmit(tags);\n this.setState({\n activated: false,\n tagInput: '',\n tags: this.props.tags\n });\n }\n }, {\n key: \"handleCancel\",\n value: function handleCancel() {\n this.setState({\n activated: false,\n tagInput: '',\n tags: this.props.tags\n });\n\n if (this.props.onCancel) {\n this.props.onCancel();\n }\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this2 = this;\n\n var tags = [];\n\n if (this.state.activated) {\n this.state.tags.map(function (tag) {\n tags.push({\n user: tag\n });\n });\n } else {\n this.state.tags.map(function (tag) {\n tags.push(react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", {\n className: \"badge\",\n key: tags.length\n }, tag));\n });\n\n if (tags.length == 0) {\n tags = react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"i\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"tags_not_found\",\n defaultMessage: \"No tags defined. Add some.\"\n }));\n }\n }\n\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"panel-form-column\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"panel-form-row\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"label\", {\n className: \"small\"\n }, this.props.title)), this.state.activated ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"tags_editor_no_tags\",\n defaultMessage: \"Add some tags\"\n }, function (add_tags_prompt) {\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_chip_input_jsx__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n chips: tags,\n avatarDisabled: true,\n prompt: add_tags_prompt,\n onEnter: _this2.handleAddTag,\n onFocusLost: _this2.handleAddTag,\n onCancel: _this2.handleCancel,\n onChipRemoved: _this2.handleRemoveTag,\n filterFunc: _this2.handleTagInput\n });\n }), this.props.onSubmit || this.props.onCancel ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n id: \"tag-manager-buttons\",\n className: \"panel-form-row\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"button\", {\n className: \"blue\",\n onClick: this.handleSubmit\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"button_ok\",\n defautMessage: \"OK\",\n description: \"Confirmation button [OK]\"\n })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"button\", {\n className: \"white\",\n onClick: this.handleCancel\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"button_cancel\",\n defautMessage: \"Cancel\",\n description: \"Rejection button [Cancel]\"\n }))) : null) : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"a\", {\n href: \"javascript:;\",\n className: \"flat-button\",\n onClick: this.handleShowTagManager\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"i\", {\n className: \"material-icons\"\n }, \"edit\"), \" \", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"title_manage_tags\",\n defaultMessage: \"Manage tags\"\n })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", null, tags)));\n }\n }], [{\n key: \"getDerivedStateFromProps\",\n value: function getDerivedStateFromProps(nextProps, prevState) {\n if (!Object(_lib_utils_js__WEBPACK_IMPORTED_MODULE_4__[\"arrayEqual\"])(nextProps.tags, prevState.tags) && !prevState.activated) {\n return {\n tags: nextProps.tags\n };\n }\n\n return null;\n }\n }]);\n\n return TagManager;\n}(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component);\n\n\n;\n\n//# sourceURL=webpack:///./src/widgets/tag-manager.jsx?");
-// 19.1.3.1 Object.assign(target, source)
+/***/ }),
+/***/ "./src/widgets/unread-badge.jsx":
+/*!**************************************!*\
+ !*** ./src/widgets/unread-badge.jsx ***!
+ \**************************************/
+/*! exports provided: default */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
-_export(_export.S + _export.F, 'Object', { assign: _objectAssign });
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return UnreadBadge; });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\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\nvar UnreadBadge = function (_React$PureComponent) {\n _inherits(UnreadBadge, _React$PureComponent);\n\n function UnreadBadge() {\n _classCallCheck(this, UnreadBadge);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(UnreadBadge).apply(this, arguments));\n }\n\n _createClass(UnreadBadge, [{\n key: \"render\",\n value: function render() {\n var showUnreadBadge = null;\n\n if (this.props.count > 0) {\n var count = this.props.count > 9 ? \"9+\" : this.props.count;\n showUnreadBadge = react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", {\n className: \"unread\"\n }, count);\n }\n\n return showUnreadBadge;\n }\n }]);\n\n return UnreadBadge;\n}(react__WEBPACK_IMPORTED_MODULE_0___default.a.PureComponent);\n\n\n;\n\n//# sourceURL=webpack:///./src/widgets/unread-badge.jsx?");
-var assign = _core.Object.assign;
+/***/ }),
-// 7.2.8 IsRegExp(argument)
+/***/ "./src/widgets/visible-password.jsx":
+/*!******************************************!*\
+ !*** ./src/widgets/visible-password.jsx ***!
+ \******************************************/
+/*! exports provided: default */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return VisiblePassword; });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\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 _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\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\n\n\nvar VisiblePassword = function (_React$PureComponent) {\n _inherits(VisiblePassword, _React$PureComponent);\n\n function VisiblePassword(props) {\n var _this;\n\n _classCallCheck(this, VisiblePassword);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(VisiblePassword).call(this, props));\n _this.state = {\n value: _this.props.value,\n visible: false\n };\n _this.handleVisibility = _this.handleVisibility.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handeTextChange = _this.handeTextChange.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleKeyDown = _this.handleKeyDown.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleEditingFinished = _this.handleEditingFinished.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n return _this;\n }\n\n _createClass(VisiblePassword, [{\n key: \"handeTextChange\",\n value: function handeTextChange(e) {\n this.setState({\n value: e.target.value\n });\n\n if (this.props.onChange) {\n this.props.onChange(e);\n }\n }\n }, {\n key: \"handleVisibility\",\n value: function handleVisibility(e) {\n e.preventDefault();\n this.setState({\n visible: !this.state.visible\n });\n }\n }, {\n key: \"handleKeyDown\",\n value: function handleKeyDown(e) {\n if (e.keyCode == 27) {\n this.setState({\n value: this.props.value,\n visible: false\n });\n\n if (this.props.onFinished) {\n this.props.onFinished();\n }\n } else if (e.keyCode == 13) {\n this.handleEditingFinished();\n }\n }\n }, {\n key: \"handleEditingFinished\",\n value: function handleEditingFinished(e) {\n var _this2 = this;\n\n if (e) {\n var currentTarget = e.currentTarget;\n setTimeout(function () {\n if (!currentTarget.contains(document.activeElement)) {\n if (_this2.props.onFinished) {\n _this2.props.onFinished(_this2.state.value);\n }\n }\n }, 0);\n } else if (this.props.onFinished) {\n this.props.onFinished(this.state.value.trim());\n }\n }\n }, {\n key: \"render\",\n value: function render() {\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n tabIndex: \"-1\",\n className: \"group-focus\",\n onBlur: this.handleEditingFinished\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"input\", {\n className: \"with-visibility\",\n type: this.state.visible ? \"text\" : \"password\",\n value: this.state.value,\n placeholder: this.props.placeholder,\n required: this.props.required ? 'required' : '',\n autoFocus: this.props.autoFocus ? 'autoFocus' : '',\n autoComplete: this.props.autoComplete,\n onChange: this.handeTextChange,\n onKeyDown: this.handleKeyDown\n }), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", {\n onClick: this.handleVisibility\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"i\", {\n className: \"material-icons clickable light-gray\"\n }, this.state.visible ? 'visibility' : 'visibility_off')));\n }\n }]);\n\n return VisiblePassword;\n}(react__WEBPACK_IMPORTED_MODULE_0___default.a.PureComponent);\n\n\n\n//# sourceURL=webpack:///./src/widgets/visible-password.jsx?");
-var MATCH = _wks('match');
-var _isRegexp = function (it) {
- var isRegExp;
- return _isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : _cof(it) == 'RegExp');
-};
+/***/ }),
-// helper for String#{startsWith, endsWith, includes}
+/***/ 0:
+/*!****************************!*\
+ !*** multi ./src/index.js ***!
+ \****************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+eval("module.exports = __webpack_require__(/*! ./src/index.js */\"./src/index.js\");\n\n\n//# sourceURL=webpack:///multi_./src/index.js?");
+/***/ }),
-var _stringContext = function (that, searchString, NAME) {
- if (_isRegexp(searchString)) throw TypeError('String#' + NAME + " doesn't accept regex!");
- return String(_defined(that));
-};
+/***/ "firebase/app":
+/*!***************************!*\
+ !*** external "firebase" ***!
+ \***************************/
+/*! no static exports found */
+/***/ (function(module, exports) {
-var MATCH$1 = _wks('match');
-var _failsIsRegexp = function (KEY) {
- var re = /./;
- try {
- '/./'[KEY](re);
- } catch (e) {
- try {
- re[MATCH$1] = false;
- return !'/./'[KEY](re);
- } catch (f) { /* empty */ }
- } return true;
-};
+eval("module.exports = firebase;\n\n//# sourceURL=webpack:///external_%22firebase%22?");
-var STARTS_WITH = 'startsWith';
-var $startsWith = ''[STARTS_WITH];
+/***/ }),
-_export(_export.P + _export.F * _failsIsRegexp(STARTS_WITH), 'String', {
- startsWith: function startsWith(searchString /* , position = 0 */) {
- var that = _stringContext(this, searchString, STARTS_WITH);
- var index = _toLength(Math.min(arguments.length > 1 ? arguments[1] : undefined, that.length));
- var search = String(searchString);
- return $startsWith
- ? $startsWith.call(that, search, index)
- : that.slice(index, index + search.length) === search;
- }
-});
+/***/ "firebase/messaging":
+/*!*****************************************!*\
+ !*** external ["firebase","messaging"] ***!
+ \*****************************************/
+/*! no static exports found */
+/***/ (function(module, exports) {
-var startsWith = _core.String.startsWith;
+eval("module.exports = firebase[\"messaging\"];\n\n//# sourceURL=webpack:///external_%5B%22firebase%22,%22messaging%22%5D?");
-var _stringRepeat = function repeat(count) {
- var str = String(_defined(this));
- var res = '';
- var n = _toInteger(count);
- if (n < 0 || n == Infinity) throw RangeError("Count can't be negative");
- for (;n > 0; (n >>>= 1) && (str += str)) if (n & 1) res += str;
- return res;
-};
+/***/ }),
-_export(_export.P, 'String', {
- // 21.1.3.13 String.prototype.repeat(count)
- repeat: _stringRepeat
-});
+/***/ "react":
+/*!************************!*\
+ !*** external "React" ***!
+ \************************/
+/*! no static exports found */
+/***/ (function(module, exports) {
-var repeat = _core.String.repeat;
+eval("module.exports = React;\n\n//# sourceURL=webpack:///external_%22React%22?");
-var _meta = createCommonjsModule(function (module) {
-var META = _uid('meta');
+/***/ }),
+/***/ "react-dom":
+/*!***************************!*\
+ !*** external "ReactDOM" ***!
+ \***************************/
+/*! no static exports found */
+/***/ (function(module, exports) {
-var setDesc = _objectDp.f;
-var id = 0;
-var isExtensible = Object.isExtensible || function () {
- return true;
-};
-var FREEZE = !_fails(function () {
- return isExtensible(Object.preventExtensions({}));
-});
-var setMeta = function (it) {
- setDesc(it, META, { value: {
- i: 'O' + ++id, // object ID
- w: {} // weak collections IDs
- } });
-};
-var fastKey = function (it, create) {
- // return primitive with prefix
- if (!_isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;
- if (!_has(it, META)) {
- // can't set metadata to uncaught frozen object
- if (!isExtensible(it)) return 'F';
- // not necessary to add metadata
- if (!create) return 'E';
- // add missing metadata
- setMeta(it);
- // return object ID
- } return it[META].i;
-};
-var getWeak = function (it, create) {
- if (!_has(it, META)) {
- // can't set metadata to uncaught frozen object
- if (!isExtensible(it)) return true;
- // not necessary to add metadata
- if (!create) return false;
- // add missing metadata
- setMeta(it);
- // return hash weak collections IDs
- } return it[META].w;
-};
-// add metadata on freeze-family methods calling
-var onFreeze = function (it) {
- if (FREEZE && meta.NEED && isExtensible(it) && !_has(it, META)) setMeta(it);
- return it;
-};
-var meta = module.exports = {
- KEY: META,
- NEED: false,
- fastKey: fastKey,
- getWeak: getWeak,
- onFreeze: onFreeze
-};
-});
-var _meta_1 = _meta.KEY;
-var _meta_2 = _meta.NEED;
-var _meta_3 = _meta.fastKey;
-var _meta_4 = _meta.getWeak;
-var _meta_5 = _meta.onFreeze;
+eval("module.exports = ReactDOM;\n\n//# sourceURL=webpack:///external_%22ReactDOM%22?");
-var def = _objectDp.f;
+/***/ }),
-var TAG = _wks('toStringTag');
+/***/ "react-intl":
+/*!****************************!*\
+ !*** external "ReactIntl" ***!
+ \****************************/
+/*! no static exports found */
+/***/ (function(module, exports) {
-var _setToStringTag = function (it, tag, stat) {
- if (it && !_has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag });
-};
+eval("module.exports = ReactIntl;\n\n//# sourceURL=webpack:///external_%22ReactIntl%22?");
-var f$3 = _wks;
+/***/ })
-var _wksExt = {
- f: f$3
-};
-
-var _library = false;
-
-var defineProperty = _objectDp.f;
-var _wksDefine = function (name) {
- var $Symbol = _core.Symbol || (_core.Symbol = _library ? {} : _global.Symbol || {});
- if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: _wksExt.f(name) });
-};
-
-// all enumerable object keys, includes symbols
-
-
-
-var _enumKeys = function (it) {
- var result = _objectKeys(it);
- var getSymbols = _objectGops.f;
- if (getSymbols) {
- var symbols = getSymbols(it);
- var isEnum = _objectPie.f;
- var i = 0;
- var key;
- while (symbols.length > i) if (isEnum.call(it, key = symbols[i++])) result.push(key);
- } return result;
-};
-
-var _objectDps = _descriptors ? Object.defineProperties : function defineProperties(O, Properties) {
- _anObject(O);
- var keys = _objectKeys(Properties);
- var length = keys.length;
- var i = 0;
- var P;
- while (length > i) _objectDp.f(O, P = keys[i++], Properties[P]);
- return O;
-};
-
-var document$1 = _global.document;
-var _html = document$1 && document$1.documentElement;
-
-// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
-
-
-
-var IE_PROTO$1 = _sharedKey('IE_PROTO');
-var Empty = function () { /* empty */ };
-var PROTOTYPE$1 = 'prototype';
-
-// Create object with fake `null` prototype: use iframe Object with cleared prototype
-var createDict = function () {
- // Thrash, waste and sodomy: IE GC bug
- var iframe = _domCreate('iframe');
- var i = _enumBugKeys.length;
- var lt = '<';
- var gt = '>';
- var iframeDocument;
- iframe.style.display = 'none';
- _html.appendChild(iframe);
- iframe.src = 'javascript:'; // eslint-disable-line no-script-url
- // createDict = iframe.contentWindow.Object;
- // html.removeChild(iframe);
- iframeDocument = iframe.contentWindow.document;
- iframeDocument.open();
- iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);
- iframeDocument.close();
- createDict = iframeDocument.F;
- while (i--) delete createDict[PROTOTYPE$1][_enumBugKeys[i]];
- return createDict();
-};
-
-var _objectCreate = Object.create || function create(O, Properties) {
- var result;
- if (O !== null) {
- Empty[PROTOTYPE$1] = _anObject(O);
- result = new Empty();
- Empty[PROTOTYPE$1] = null;
- // add "__proto__" for Object.getPrototypeOf polyfill
- result[IE_PROTO$1] = O;
- } else result = createDict();
- return Properties === undefined ? result : _objectDps(result, Properties);
-};
-
-// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)
-
-var hiddenKeys = _enumBugKeys.concat('length', 'prototype');
-
-var f$4 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
- return _objectKeysInternal(O, hiddenKeys);
-};
-
-var _objectGopn = {
- f: f$4
-};
-
-// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window
-
-var gOPN = _objectGopn.f;
-var toString$1 = {}.toString;
-
-var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
- ? Object.getOwnPropertyNames(window) : [];
-
-var getWindowNames = function (it) {
- try {
- return gOPN(it);
- } catch (e) {
- return windowNames.slice();
- }
-};
-
-var f$5 = function getOwnPropertyNames(it) {
- return windowNames && toString$1.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(_toIobject(it));
-};
-
-var _objectGopnExt = {
- f: f$5
-};
-
-var gOPD = Object.getOwnPropertyDescriptor;
-
-var f$6 = _descriptors ? gOPD : function getOwnPropertyDescriptor(O, P) {
- O = _toIobject(O);
- P = _toPrimitive(P, true);
- if (_ie8DomDefine) try {
- return gOPD(O, P);
- } catch (e) { /* empty */ }
- if (_has(O, P)) return _propertyDesc(!_objectPie.f.call(O, P), O[P]);
-};
-
-var _objectGopd = {
- f: f$6
-};
-
-// ECMAScript 6 symbols shim
-
-
-
-
-
-var META = _meta.KEY;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-var gOPD$1 = _objectGopd.f;
-var dP$1 = _objectDp.f;
-var gOPN$1 = _objectGopnExt.f;
-var $Symbol = _global.Symbol;
-var $JSON = _global.JSON;
-var _stringify = $JSON && $JSON.stringify;
-var PROTOTYPE$2 = 'prototype';
-var HIDDEN = _wks('_hidden');
-var TO_PRIMITIVE = _wks('toPrimitive');
-var isEnum = {}.propertyIsEnumerable;
-var SymbolRegistry = _shared('symbol-registry');
-var AllSymbols = _shared('symbols');
-var OPSymbols = _shared('op-symbols');
-var ObjectProto = Object[PROTOTYPE$2];
-var USE_NATIVE = typeof $Symbol == 'function';
-var QObject = _global.QObject;
-// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173
-var setter = !QObject || !QObject[PROTOTYPE$2] || !QObject[PROTOTYPE$2].findChild;
-
-// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687
-var setSymbolDesc = _descriptors && _fails(function () {
- return _objectCreate(dP$1({}, 'a', {
- get: function () { return dP$1(this, 'a', { value: 7 }).a; }
- })).a != 7;
-}) ? function (it, key, D) {
- var protoDesc = gOPD$1(ObjectProto, key);
- if (protoDesc) delete ObjectProto[key];
- dP$1(it, key, D);
- if (protoDesc && it !== ObjectProto) dP$1(ObjectProto, key, protoDesc);
-} : dP$1;
-
-var wrap = function (tag) {
- var sym = AllSymbols[tag] = _objectCreate($Symbol[PROTOTYPE$2]);
- sym._k = tag;
- return sym;
-};
-
-var isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function (it) {
- return typeof it == 'symbol';
-} : function (it) {
- return it instanceof $Symbol;
-};
-
-var $defineProperty = function defineProperty(it, key, D) {
- if (it === ObjectProto) $defineProperty(OPSymbols, key, D);
- _anObject(it);
- key = _toPrimitive(key, true);
- _anObject(D);
- if (_has(AllSymbols, key)) {
- if (!D.enumerable) {
- if (!_has(it, HIDDEN)) dP$1(it, HIDDEN, _propertyDesc(1, {}));
- it[HIDDEN][key] = true;
- } else {
- if (_has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false;
- D = _objectCreate(D, { enumerable: _propertyDesc(0, false) });
- } return setSymbolDesc(it, key, D);
- } return dP$1(it, key, D);
-};
-var $defineProperties = function defineProperties(it, P) {
- _anObject(it);
- var keys = _enumKeys(P = _toIobject(P));
- var i = 0;
- var l = keys.length;
- var key;
- while (l > i) $defineProperty(it, key = keys[i++], P[key]);
- return it;
-};
-var $create = function create(it, P) {
- return P === undefined ? _objectCreate(it) : $defineProperties(_objectCreate(it), P);
-};
-var $propertyIsEnumerable = function propertyIsEnumerable(key) {
- var E = isEnum.call(this, key = _toPrimitive(key, true));
- if (this === ObjectProto && _has(AllSymbols, key) && !_has(OPSymbols, key)) return false;
- return E || !_has(this, key) || !_has(AllSymbols, key) || _has(this, HIDDEN) && this[HIDDEN][key] ? E : true;
-};
-var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) {
- it = _toIobject(it);
- key = _toPrimitive(key, true);
- if (it === ObjectProto && _has(AllSymbols, key) && !_has(OPSymbols, key)) return;
- var D = gOPD$1(it, key);
- if (D && _has(AllSymbols, key) && !(_has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true;
- return D;
-};
-var $getOwnPropertyNames = function getOwnPropertyNames(it) {
- var names = gOPN$1(_toIobject(it));
- var result = [];
- var i = 0;
- var key;
- while (names.length > i) {
- if (!_has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key);
- } return result;
-};
-var $getOwnPropertySymbols = function getOwnPropertySymbols(it) {
- var IS_OP = it === ObjectProto;
- var names = gOPN$1(IS_OP ? OPSymbols : _toIobject(it));
- var result = [];
- var i = 0;
- var key;
- while (names.length > i) {
- if (_has(AllSymbols, key = names[i++]) && (IS_OP ? _has(ObjectProto, key) : true)) result.push(AllSymbols[key]);
- } return result;
-};
-
-// 19.4.1.1 Symbol([description])
-if (!USE_NATIVE) {
- $Symbol = function Symbol() {
- if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor!');
- var tag = _uid(arguments.length > 0 ? arguments[0] : undefined);
- var $set = function (value) {
- if (this === ObjectProto) $set.call(OPSymbols, value);
- if (_has(this, HIDDEN) && _has(this[HIDDEN], tag)) this[HIDDEN][tag] = false;
- setSymbolDesc(this, tag, _propertyDesc(1, value));
- };
- if (_descriptors && setter) setSymbolDesc(ObjectProto, tag, { configurable: true, set: $set });
- return wrap(tag);
- };
- _redefine($Symbol[PROTOTYPE$2], 'toString', function toString() {
- return this._k;
- });
-
- _objectGopd.f = $getOwnPropertyDescriptor;
- _objectDp.f = $defineProperty;
- _objectGopn.f = _objectGopnExt.f = $getOwnPropertyNames;
- _objectPie.f = $propertyIsEnumerable;
- _objectGops.f = $getOwnPropertySymbols;
-
- if (_descriptors && !_library) {
- _redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true);
- }
-
- _wksExt.f = function (name) {
- return wrap(_wks(name));
- };
-}
-
-_export(_export.G + _export.W + _export.F * !USE_NATIVE, { Symbol: $Symbol });
-
-for (var es6Symbols = (
- // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14
- 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables'
-).split(','), j = 0; es6Symbols.length > j;)_wks(es6Symbols[j++]);
-
-for (var wellKnownSymbols = _objectKeys(_wks.store), k = 0; wellKnownSymbols.length > k;) _wksDefine(wellKnownSymbols[k++]);
-
-_export(_export.S + _export.F * !USE_NATIVE, 'Symbol', {
- // 19.4.2.1 Symbol.for(key)
- 'for': function (key) {
- return _has(SymbolRegistry, key += '')
- ? SymbolRegistry[key]
- : SymbolRegistry[key] = $Symbol(key);
- },
- // 19.4.2.5 Symbol.keyFor(sym)
- keyFor: function keyFor(sym) {
- if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol!');
- for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key;
- },
- useSetter: function () { setter = true; },
- useSimple: function () { setter = false; }
-});
-
-_export(_export.S + _export.F * !USE_NATIVE, 'Object', {
- // 19.1.2.2 Object.create(O [, Properties])
- create: $create,
- // 19.1.2.4 Object.defineProperty(O, P, Attributes)
- defineProperty: $defineProperty,
- // 19.1.2.3 Object.defineProperties(O, Properties)
- defineProperties: $defineProperties,
- // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)
- getOwnPropertyDescriptor: $getOwnPropertyDescriptor,
- // 19.1.2.7 Object.getOwnPropertyNames(O)
- getOwnPropertyNames: $getOwnPropertyNames,
- // 19.1.2.8 Object.getOwnPropertySymbols(O)
- getOwnPropertySymbols: $getOwnPropertySymbols
-});
-
-// 24.3.2 JSON.stringify(value [, replacer [, space]])
-$JSON && _export(_export.S + _export.F * (!USE_NATIVE || _fails(function () {
- var S = $Symbol();
- // MS Edge converts symbol values to JSON as {}
- // WebKit converts symbol values to JSON as null
- // V8 throws on boxed symbols
- return _stringify([S]) != '[null]' || _stringify({ a: S }) != '{}' || _stringify(Object(S)) != '{}';
-})), 'JSON', {
- stringify: function stringify(it) {
- var args = [it];
- var i = 1;
- var replacer, $replacer;
- while (arguments.length > i) args.push(arguments[i++]);
- $replacer = replacer = args[1];
- if (!_isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined
- if (!_isArray(replacer)) replacer = function (key, value) {
- if (typeof $replacer == 'function') value = $replacer.call(this, key, value);
- if (!isSymbol(value)) return value;
- };
- args[1] = replacer;
- return _stringify.apply($JSON, args);
- }
-});
-
-// 19.4.3.4 Symbol.prototype[@@toPrimitive](hint)
-$Symbol[PROTOTYPE$2][TO_PRIMITIVE] || _hide($Symbol[PROTOTYPE$2], TO_PRIMITIVE, $Symbol[PROTOTYPE$2].valueOf);
-// 19.4.3.5 Symbol.prototype[@@toStringTag]
-_setToStringTag($Symbol, 'Symbol');
-// 20.2.1.9 Math[@@toStringTag]
-_setToStringTag(Math, 'Math', true);
-// 24.3.3 JSON[@@toStringTag]
-_setToStringTag(_global.JSON, 'JSON', true);
-
-// getting tag from 19.1.3.6 Object.prototype.toString()
-
-var TAG$1 = _wks('toStringTag');
-// ES3 wrong here
-var ARG = _cof(function () { return arguments; }()) == 'Arguments';
-
-// fallback for IE11 Script Access Denied error
-var tryGet = function (it, key) {
- try {
- return it[key];
- } catch (e) { /* empty */ }
-};
-
-var _classof = function (it) {
- var O, T, B;
- return it === undefined ? 'Undefined' : it === null ? 'Null'
- // @@toStringTag case
- : typeof (T = tryGet(O = Object(it), TAG$1)) == 'string' ? T
- // builtinTag case
- : ARG ? _cof(O)
- // ES3 arguments fallback
- : (B = _cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;
-};
-
-// 19.1.3.6 Object.prototype.toString()
-
-var test = {};
-test[_wks('toStringTag')] = 'z';
-if (test + '' != '[object z]') {
- _redefine(Object.prototype, 'toString', function toString() {
- return '[object ' + _classof(this) + ']';
- }, true);
-}
-
-_wksDefine('asyncIterator');
-
-_wksDefine('observable');
-
-var symbol = _core.Symbol;
-
-// true -> String#at
-// false -> String#codePointAt
-var _stringAt = function (TO_STRING) {
- return function (that, pos) {
- var s = String(_defined(that));
- var i = _toInteger(pos);
- var l = s.length;
- var a, b;
- if (i < 0 || i >= l) return TO_STRING ? '' : undefined;
- a = s.charCodeAt(i);
- return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff
- ? TO_STRING ? s.charAt(i) : a
- : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;
- };
-};
-
-var _iterators = {};
-
-var IteratorPrototype = {};
-
-// 25.1.2.1.1 %IteratorPrototype%[@@iterator]()
-_hide(IteratorPrototype, _wks('iterator'), function () { return this; });
-
-var _iterCreate = function (Constructor, NAME, next) {
- Constructor.prototype = _objectCreate(IteratorPrototype, { next: _propertyDesc(1, next) });
- _setToStringTag(Constructor, NAME + ' Iterator');
-};
-
-// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)
-
-
-var IE_PROTO$2 = _sharedKey('IE_PROTO');
-var ObjectProto$1 = Object.prototype;
-
-var _objectGpo = Object.getPrototypeOf || function (O) {
- O = _toObject(O);
- if (_has(O, IE_PROTO$2)) return O[IE_PROTO$2];
- if (typeof O.constructor == 'function' && O instanceof O.constructor) {
- return O.constructor.prototype;
- } return O instanceof Object ? ObjectProto$1 : null;
-};
-
-var ITERATOR = _wks('iterator');
-var BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next`
-var FF_ITERATOR = '@@iterator';
-var KEYS = 'keys';
-var VALUES = 'values';
-
-var returnThis = function () { return this; };
-
-var _iterDefine = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {
- _iterCreate(Constructor, NAME, next);
- var getMethod = function (kind) {
- if (!BUGGY && kind in proto) return proto[kind];
- switch (kind) {
- case KEYS: return function keys() { return new Constructor(this, kind); };
- case VALUES: return function values() { return new Constructor(this, kind); };
- } return function entries() { return new Constructor(this, kind); };
- };
- var TAG = NAME + ' Iterator';
- var DEF_VALUES = DEFAULT == VALUES;
- var VALUES_BUG = false;
- var proto = Base.prototype;
- var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT];
- var $default = $native || getMethod(DEFAULT);
- var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined;
- var $anyNative = NAME == 'Array' ? proto.entries || $native : $native;
- var methods, key, IteratorPrototype;
- // Fix native
- if ($anyNative) {
- IteratorPrototype = _objectGpo($anyNative.call(new Base()));
- if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) {
- // Set @@toStringTag to native iterators
- _setToStringTag(IteratorPrototype, TAG, true);
- // fix for some old engines
- if (!_library && typeof IteratorPrototype[ITERATOR] != 'function') _hide(IteratorPrototype, ITERATOR, returnThis);
- }
- }
- // fix Array#{values, @@iterator}.name in V8 / FF
- if (DEF_VALUES && $native && $native.name !== VALUES) {
- VALUES_BUG = true;
- $default = function values() { return $native.call(this); };
- }
- // Define iterator
- if ((!_library || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) {
- _hide(proto, ITERATOR, $default);
- }
- // Plug for library
- _iterators[NAME] = $default;
- _iterators[TAG] = returnThis;
- if (DEFAULT) {
- methods = {
- values: DEF_VALUES ? $default : getMethod(VALUES),
- keys: IS_SET ? $default : getMethod(KEYS),
- entries: $entries
- };
- if (FORCED) for (key in methods) {
- if (!(key in proto)) _redefine(proto, key, methods[key]);
- } else _export(_export.P + _export.F * (BUGGY || VALUES_BUG), NAME, methods);
- }
- return methods;
-};
-
-var $at = _stringAt(true);
-
-// 21.1.3.27 String.prototype[@@iterator]()
-_iterDefine(String, 'String', function (iterated) {
- this._t = String(iterated); // target
- this._i = 0; // next index
-// 21.1.5.2.1 %StringIteratorPrototype%.next()
-}, function () {
- var O = this._t;
- var index = this._i;
- var point;
- if (index >= O.length) return { value: undefined, done: true };
- point = $at(O, index);
- this._i += point.length;
- return { value: point, done: false };
-});
-
-var _iterStep = function (done, value) {
- return { value: value, done: !!done };
-};
-
-// 22.1.3.4 Array.prototype.entries()
-// 22.1.3.13 Array.prototype.keys()
-// 22.1.3.29 Array.prototype.values()
-// 22.1.3.30 Array.prototype[@@iterator]()
-var es6_array_iterator = _iterDefine(Array, 'Array', function (iterated, kind) {
- this._t = _toIobject(iterated); // target
- this._i = 0; // next index
- this._k = kind; // kind
-// 22.1.5.2.1 %ArrayIteratorPrototype%.next()
-}, function () {
- var O = this._t;
- var kind = this._k;
- var index = this._i++;
- if (!O || index >= O.length) {
- this._t = undefined;
- return _iterStep(1);
- }
- if (kind == 'keys') return _iterStep(0, index);
- if (kind == 'values') return _iterStep(0, O[index]);
- return _iterStep(0, [index, O[index]]);
-}, 'values');
-
-// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)
-_iterators.Arguments = _iterators.Array;
-
-_addToUnscopables('keys');
-_addToUnscopables('values');
-_addToUnscopables('entries');
-
-var ITERATOR$1 = _wks('iterator');
-var TO_STRING_TAG = _wks('toStringTag');
-var ArrayValues = _iterators.Array;
-
-var DOMIterables = {
- CSSRuleList: true, // TODO: Not spec compliant, should be false.
- CSSStyleDeclaration: false,
- CSSValueList: false,
- ClientRectList: false,
- DOMRectList: false,
- DOMStringList: false,
- DOMTokenList: true,
- DataTransferItemList: false,
- FileList: false,
- HTMLAllCollection: false,
- HTMLCollection: false,
- HTMLFormElement: false,
- HTMLSelectElement: false,
- MediaList: true, // TODO: Not spec compliant, should be false.
- MimeTypeArray: false,
- NamedNodeMap: false,
- NodeList: true,
- PaintRequestList: false,
- Plugin: false,
- PluginArray: false,
- SVGLengthList: false,
- SVGNumberList: false,
- SVGPathSegList: false,
- SVGPointList: false,
- SVGStringList: false,
- SVGTransformList: false,
- SourceBufferList: false,
- StyleSheetList: true, // TODO: Not spec compliant, should be false.
- TextTrackCueList: false,
- TextTrackList: false,
- TouchList: false
-};
-
-for (var collections = _objectKeys(DOMIterables), i = 0; i < collections.length; i++) {
- var NAME = collections[i];
- var explicit = DOMIterables[NAME];
- var Collection = _global[NAME];
- var proto = Collection && Collection.prototype;
- var key;
- if (proto) {
- if (!proto[ITERATOR$1]) _hide(proto, ITERATOR$1, ArrayValues);
- if (!proto[TO_STRING_TAG]) _hide(proto, TO_STRING_TAG, NAME);
- _iterators[NAME] = ArrayValues;
- if (explicit) for (key in es6_array_iterator) if (!proto[key]) _redefine(proto, key, es6_array_iterator[key], true);
- }
-}
-
-var iterator = _wksExt.f('iterator');
-
-/**
- * Copyright 2017 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {},require("timers").setImmediate)
-},{"timers":29,"whatwg-fetch":4}],4:[function(require,module,exports){
-(function(self) {
- 'use strict';
-
- if (self.fetch) {
- return
- }
-
- var support = {
- searchParams: 'URLSearchParams' in self,
- iterable: 'Symbol' in self && 'iterator' in Symbol,
- blob: 'FileReader' in self && 'Blob' in self && (function() {
- try {
- new Blob()
- return true
- } catch(e) {
- return false
- }
- })(),
- formData: 'FormData' in self,
- arrayBuffer: 'ArrayBuffer' in self
- }
-
- if (support.arrayBuffer) {
- var viewClasses = [
- '[object Int8Array]',
- '[object Uint8Array]',
- '[object Uint8ClampedArray]',
- '[object Int16Array]',
- '[object Uint16Array]',
- '[object Int32Array]',
- '[object Uint32Array]',
- '[object Float32Array]',
- '[object Float64Array]'
- ]
-
- var isDataView = function(obj) {
- return obj && DataView.prototype.isPrototypeOf(obj)
- }
-
- var isArrayBufferView = ArrayBuffer.isView || function(obj) {
- return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1
- }
- }
-
- function normalizeName(name) {
- if (typeof name !== 'string') {
- name = String(name)
- }
- if (/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(name)) {
- throw new TypeError('Invalid character in header field name')
- }
- return name.toLowerCase()
- }
-
- function normalizeValue(value) {
- if (typeof value !== 'string') {
- value = String(value)
- }
- return value
- }
-
- // Build a destructive iterator for the value list
- function iteratorFor(items) {
- var iterator = {
- next: function() {
- var value = items.shift()
- return {done: value === undefined, value: value}
- }
- }
-
- if (support.iterable) {
- iterator[Symbol.iterator] = function() {
- return iterator
- }
- }
-
- return iterator
- }
-
- function Headers(headers) {
- this.map = {}
-
- if (headers instanceof Headers) {
- headers.forEach(function(value, name) {
- this.append(name, value)
- }, this)
- } else if (Array.isArray(headers)) {
- headers.forEach(function(header) {
- this.append(header[0], header[1])
- }, this)
- } else if (headers) {
- Object.getOwnPropertyNames(headers).forEach(function(name) {
- this.append(name, headers[name])
- }, this)
- }
- }
-
- Headers.prototype.append = function(name, value) {
- name = normalizeName(name)
- value = normalizeValue(value)
- var oldValue = this.map[name]
- this.map[name] = oldValue ? oldValue+','+value : value
- }
-
- Headers.prototype['delete'] = function(name) {
- delete this.map[normalizeName(name)]
- }
-
- Headers.prototype.get = function(name) {
- name = normalizeName(name)
- return this.has(name) ? this.map[name] : null
- }
-
- Headers.prototype.has = function(name) {
- return this.map.hasOwnProperty(normalizeName(name))
- }
-
- Headers.prototype.set = function(name, value) {
- this.map[normalizeName(name)] = normalizeValue(value)
- }
-
- Headers.prototype.forEach = function(callback, thisArg) {
- for (var name in this.map) {
- if (this.map.hasOwnProperty(name)) {
- callback.call(thisArg, this.map[name], name, this)
- }
- }
- }
-
- Headers.prototype.keys = function() {
- var items = []
- this.forEach(function(value, name) { items.push(name) })
- return iteratorFor(items)
- }
-
- Headers.prototype.values = function() {
- var items = []
- this.forEach(function(value) { items.push(value) })
- return iteratorFor(items)
- }
-
- Headers.prototype.entries = function() {
- var items = []
- this.forEach(function(value, name) { items.push([name, value]) })
- return iteratorFor(items)
- }
-
- if (support.iterable) {
- Headers.prototype[Symbol.iterator] = Headers.prototype.entries
- }
-
- function consumed(body) {
- if (body.bodyUsed) {
- return Promise.reject(new TypeError('Already read'))
- }
- body.bodyUsed = true
- }
-
- function fileReaderReady(reader) {
- return new Promise(function(resolve, reject) {
- reader.onload = function() {
- resolve(reader.result)
- }
- reader.onerror = function() {
- reject(reader.error)
- }
- })
- }
-
- function readBlobAsArrayBuffer(blob) {
- var reader = new FileReader()
- var promise = fileReaderReady(reader)
- reader.readAsArrayBuffer(blob)
- return promise
- }
-
- function readBlobAsText(blob) {
- var reader = new FileReader()
- var promise = fileReaderReady(reader)
- reader.readAsText(blob)
- return promise
- }
-
- function readArrayBufferAsText(buf) {
- var view = new Uint8Array(buf)
- var chars = new Array(view.length)
-
- for (var i = 0; i < view.length; i++) {
- chars[i] = String.fromCharCode(view[i])
- }
- return chars.join('')
- }
-
- function bufferClone(buf) {
- if (buf.slice) {
- return buf.slice(0)
- } else {
- var view = new Uint8Array(buf.byteLength)
- view.set(new Uint8Array(buf))
- return view.buffer
- }
- }
-
- function Body() {
- this.bodyUsed = false
-
- this._initBody = function(body) {
- this._bodyInit = body
- if (!body) {
- this._bodyText = ''
- } else if (typeof body === 'string') {
- this._bodyText = body
- } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {
- this._bodyBlob = body
- } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {
- this._bodyFormData = body
- } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {
- this._bodyText = body.toString()
- } else if (support.arrayBuffer && support.blob && isDataView(body)) {
- this._bodyArrayBuffer = bufferClone(body.buffer)
- // IE 10-11 can't handle a DataView body.
- this._bodyInit = new Blob([this._bodyArrayBuffer])
- } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) {
- this._bodyArrayBuffer = bufferClone(body)
- } else {
- throw new Error('unsupported BodyInit type')
- }
-
- if (!this.headers.get('content-type')) {
- if (typeof body === 'string') {
- this.headers.set('content-type', 'text/plain;charset=UTF-8')
- } else if (this._bodyBlob && this._bodyBlob.type) {
- this.headers.set('content-type', this._bodyBlob.type)
- } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {
- this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8')
- }
- }
- }
-
- if (support.blob) {
- this.blob = function() {
- var rejected = consumed(this)
- if (rejected) {
- return rejected
- }
-
- if (this._bodyBlob) {
- return Promise.resolve(this._bodyBlob)
- } else if (this._bodyArrayBuffer) {
- return Promise.resolve(new Blob([this._bodyArrayBuffer]))
- } else if (this._bodyFormData) {
- throw new Error('could not read FormData body as blob')
- } else {
- return Promise.resolve(new Blob([this._bodyText]))
- }
- }
-
- this.arrayBuffer = function() {
- if (this._bodyArrayBuffer) {
- return consumed(this) || Promise.resolve(this._bodyArrayBuffer)
- } else {
- return this.blob().then(readBlobAsArrayBuffer)
- }
- }
- }
-
- this.text = function() {
- var rejected = consumed(this)
- if (rejected) {
- return rejected
- }
-
- if (this._bodyBlob) {
- return readBlobAsText(this._bodyBlob)
- } else if (this._bodyArrayBuffer) {
- return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer))
- } else if (this._bodyFormData) {
- throw new Error('could not read FormData body as text')
- } else {
- return Promise.resolve(this._bodyText)
- }
- }
-
- if (support.formData) {
- this.formData = function() {
- return this.text().then(decode)
- }
- }
-
- this.json = function() {
- return this.text().then(JSON.parse)
- }
-
- return this
- }
-
- // HTTP methods whose capitalization should be normalized
- var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT']
-
- function normalizeMethod(method) {
- var upcased = method.toUpperCase()
- return (methods.indexOf(upcased) > -1) ? upcased : method
- }
-
- function Request(input, options) {
- options = options || {}
- var body = options.body
-
- if (input instanceof Request) {
- if (input.bodyUsed) {
- throw new TypeError('Already read')
- }
- this.url = input.url
- this.credentials = input.credentials
- if (!options.headers) {
- this.headers = new Headers(input.headers)
- }
- this.method = input.method
- this.mode = input.mode
- if (!body && input._bodyInit != null) {
- body = input._bodyInit
- input.bodyUsed = true
- }
- } else {
- this.url = String(input)
- }
-
- this.credentials = options.credentials || this.credentials || 'omit'
- if (options.headers || !this.headers) {
- this.headers = new Headers(options.headers)
- }
- this.method = normalizeMethod(options.method || this.method || 'GET')
- this.mode = options.mode || this.mode || null
- this.referrer = null
-
- if ((this.method === 'GET' || this.method === 'HEAD') && body) {
- throw new TypeError('Body not allowed for GET or HEAD requests')
- }
- this._initBody(body)
- }
-
- Request.prototype.clone = function() {
- return new Request(this, { body: this._bodyInit })
- }
-
- function decode(body) {
- var form = new FormData()
- body.trim().split('&').forEach(function(bytes) {
- if (bytes) {
- var split = bytes.split('=')
- var name = split.shift().replace(/\+/g, ' ')
- var value = split.join('=').replace(/\+/g, ' ')
- form.append(decodeURIComponent(name), decodeURIComponent(value))
- }
- })
- return form
- }
-
- function parseHeaders(rawHeaders) {
- var headers = new Headers()
- // Replace instances of \r\n and \n followed by at least one space or horizontal tab with a space
- // https://tools.ietf.org/html/rfc7230#section-3.2
- var preProcessedHeaders = rawHeaders.replace(/\r?\n[\t ]+/g, ' ')
- preProcessedHeaders.split(/\r?\n/).forEach(function(line) {
- var parts = line.split(':')
- var key = parts.shift().trim()
- if (key) {
- var value = parts.join(':').trim()
- headers.append(key, value)
- }
- })
- return headers
- }
-
- Body.call(Request.prototype)
-
- function Response(bodyInit, options) {
- if (!options) {
- options = {}
- }
-
- this.type = 'default'
- this.status = options.status === undefined ? 200 : options.status
- this.ok = this.status >= 200 && this.status < 300
- this.statusText = 'statusText' in options ? options.statusText : 'OK'
- this.headers = new Headers(options.headers)
- this.url = options.url || ''
- this._initBody(bodyInit)
- }
-
- Body.call(Response.prototype)
-
- Response.prototype.clone = function() {
- return new Response(this._bodyInit, {
- status: this.status,
- statusText: this.statusText,
- headers: new Headers(this.headers),
- url: this.url
- })
- }
-
- Response.error = function() {
- var response = new Response(null, {status: 0, statusText: ''})
- response.type = 'error'
- return response
- }
-
- var redirectStatuses = [301, 302, 303, 307, 308]
-
- Response.redirect = function(url, status) {
- if (redirectStatuses.indexOf(status) === -1) {
- throw new RangeError('Invalid status code')
- }
-
- return new Response(null, {status: status, headers: {location: url}})
- }
-
- self.Headers = Headers
- self.Request = Request
- self.Response = Response
-
- self.fetch = function(input, init) {
- return new Promise(function(resolve, reject) {
- var request = new Request(input, init)
- var xhr = new XMLHttpRequest()
-
- xhr.onload = function() {
- var options = {
- status: xhr.status,
- statusText: xhr.statusText,
- headers: parseHeaders(xhr.getAllResponseHeaders() || '')
- }
- options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL')
- var body = 'response' in xhr ? xhr.response : xhr.responseText
- resolve(new Response(body, options))
- }
-
- xhr.onerror = function() {
- reject(new TypeError('Network request failed'))
- }
-
- xhr.ontimeout = function() {
- reject(new TypeError('Network request failed'))
- }
-
- xhr.open(request.method, request.url, true)
-
- if (request.credentials === 'include') {
- xhr.withCredentials = true
- } else if (request.credentials === 'omit') {
- xhr.withCredentials = false
- }
-
- if ('responseType' in xhr && support.blob) {
- xhr.responseType = 'blob'
- }
-
- request.headers.forEach(function(value, name) {
- xhr.setRequestHeader(name, value)
- })
-
- xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit)
- })
- }
- self.fetch.polyfill = true
-})(typeof self !== 'undefined' ? self : this);
-
-},{}],5:[function(require,module,exports){
-'use strict';
-
-Object.defineProperty(exports, '__esModule', { value: true });
-
-var tslib_1 = require('tslib');
-
-/**
- * Copyright 2017 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * @fileoverview Firebase constants. Some of these (@defines) can be overridden at compile-time.
- */
-var CONSTANTS = {
- /**
- * @define {boolean} Whether this is the client Node.js SDK.
- */
- NODE_CLIENT: false,
- /**
- * @define {boolean} Whether this is the Admin Node.js SDK.
- */
- NODE_ADMIN: false,
- /**
- * Firebase SDK Version
- */
- SDK_VERSION: '${JSCORE_VERSION}'
-};
-
-/**
- * Copyright 2017 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Throws an error if the provided assertion is falsy
- * @param {*} assertion The assertion to be tested for falsiness
- * @param {!string} message The message to display if the check fails
- */
-var assert = function (assertion, message) {
- if (!assertion) {
- throw assertionError(message);
- }
-};
-/**
- * Returns an Error object suitable for throwing.
- * @param {string} message
- * @return {!Error}
- */
-var assertionError = function (message) {
- return new Error('Firebase Database (' +
- CONSTANTS.SDK_VERSION +
- ') INTERNAL ASSERT FAILED: ' +
- message);
-};
-
-/**
- * Copyright 2017 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-var stringToByteArray = function (str) {
- // TODO(user): Use native implementations if/when available
- var out = [], p = 0;
- for (var i = 0; i < str.length; i++) {
- var c = str.charCodeAt(i);
- if (c < 128) {
- out[p++] = c;
- }
- else if (c < 2048) {
- out[p++] = (c >> 6) | 192;
- out[p++] = (c & 63) | 128;
- }
- else if ((c & 0xfc00) == 0xd800 &&
- i + 1 < str.length &&
- (str.charCodeAt(i + 1) & 0xfc00) == 0xdc00) {
- // Surrogate Pair
- c = 0x10000 + ((c & 0x03ff) << 10) + (str.charCodeAt(++i) & 0x03ff);
- out[p++] = (c >> 18) | 240;
- out[p++] = ((c >> 12) & 63) | 128;
- out[p++] = ((c >> 6) & 63) | 128;
- out[p++] = (c & 63) | 128;
- }
- else {
- out[p++] = (c >> 12) | 224;
- out[p++] = ((c >> 6) & 63) | 128;
- out[p++] = (c & 63) | 128;
- }
- }
- return out;
-};
-/**
- * Turns an array of numbers into the string given by the concatenation of the
- * characters to which the numbers correspond.
- * @param {Array} bytes Array of numbers representing characters.
- * @return {string} Stringification of the array.
- */
-var byteArrayToString = function (bytes) {
- // TODO(user): Use native implementations if/when available
- var out = [], pos = 0, c = 0;
- while (pos < bytes.length) {
- var c1 = bytes[pos++];
- if (c1 < 128) {
- out[c++] = String.fromCharCode(c1);
- }
- else if (c1 > 191 && c1 < 224) {
- var c2 = bytes[pos++];
- out[c++] = String.fromCharCode(((c1 & 31) << 6) | (c2 & 63));
- }
- else if (c1 > 239 && c1 < 365) {
- // Surrogate Pair
- var c2 = bytes[pos++];
- var c3 = bytes[pos++];
- var c4 = bytes[pos++];
- var u = (((c1 & 7) << 18) | ((c2 & 63) << 12) | ((c3 & 63) << 6) | (c4 & 63)) -
- 0x10000;
- out[c++] = String.fromCharCode(0xd800 + (u >> 10));
- out[c++] = String.fromCharCode(0xdc00 + (u & 1023));
- }
- else {
- var c2 = bytes[pos++];
- var c3 = bytes[pos++];
- out[c++] = String.fromCharCode(((c1 & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
- }
- }
- return out.join('');
-};
-// Static lookup maps, lazily populated by init_()
-var base64 = {
- /**
- * Maps bytes to characters.
- * @type {Object}
- * @private
- */
- byteToCharMap_: null,
- /**
- * Maps characters to bytes.
- * @type {Object}
- * @private
- */
- charToByteMap_: null,
- /**
- * Maps bytes to websafe characters.
- * @type {Object}
- * @private
- */
- byteToCharMapWebSafe_: null,
- /**
- * Maps websafe characters to bytes.
- * @type {Object}
- * @private
- */
- charToByteMapWebSafe_: null,
- /**
- * Our default alphabet, shared between
- * ENCODED_VALS and ENCODED_VALS_WEBSAFE
- * @type {string}
- */
- ENCODED_VALS_BASE: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' + 'abcdefghijklmnopqrstuvwxyz' + '0123456789',
- /**
- * Our default alphabet. Value 64 (=) is special; it means "nothing."
- * @type {string}
- */
- get ENCODED_VALS() {
- return this.ENCODED_VALS_BASE + '+/=';
- },
- /**
- * Our websafe alphabet.
- * @type {string}
- */
- get ENCODED_VALS_WEBSAFE() {
- return this.ENCODED_VALS_BASE + '-_.';
- },
- /**
- * Whether this browser supports the atob and btoa functions. This extension
- * started at Mozilla but is now implemented by many browsers. We use the
- * ASSUME_* variables to avoid pulling in the full useragent detection library
- * but still allowing the standard per-browser compilations.
- *
- * @type {boolean}
- */
- HAS_NATIVE_SUPPORT: typeof atob === 'function',
- /**
- * Base64-encode an array of bytes.
- *
- * @param {Array|Uint8Array} input An array of bytes (numbers with
- * value in [0, 255]) to encode.
- * @param {boolean=} opt_webSafe Boolean indicating we should use the
- * alternative alphabet.
- * @return {string} The base64 encoded string.
- */
- encodeByteArray: function (input, opt_webSafe) {
- if (!Array.isArray(input)) {
- throw Error('encodeByteArray takes an array as a parameter');
- }
- this.init_();
- var byteToCharMap = opt_webSafe
- ? this.byteToCharMapWebSafe_
- : this.byteToCharMap_;
- var output = [];
- for (var i = 0; i < input.length; i += 3) {
- var byte1 = input[i];
- var haveByte2 = i + 1 < input.length;
- var byte2 = haveByte2 ? input[i + 1] : 0;
- var haveByte3 = i + 2 < input.length;
- var byte3 = haveByte3 ? input[i + 2] : 0;
- var outByte1 = byte1 >> 2;
- var outByte2 = ((byte1 & 0x03) << 4) | (byte2 >> 4);
- var outByte3 = ((byte2 & 0x0f) << 2) | (byte3 >> 6);
- var outByte4 = byte3 & 0x3f;
- if (!haveByte3) {
- outByte4 = 64;
- if (!haveByte2) {
- outByte3 = 64;
- }
- }
- output.push(byteToCharMap[outByte1], byteToCharMap[outByte2], byteToCharMap[outByte3], byteToCharMap[outByte4]);
- }
- return output.join('');
- },
- /**
- * Base64-encode a string.
- *
- * @param {string} input A string to encode.
- * @param {boolean=} opt_webSafe If true, we should use the
- * alternative alphabet.
- * @return {string} The base64 encoded string.
- */
- encodeString: function (input, opt_webSafe) {
- // Shortcut for Mozilla browsers that implement
- // a native base64 encoder in the form of "btoa/atob"
- if (this.HAS_NATIVE_SUPPORT && !opt_webSafe) {
- return btoa(input);
- }
- return this.encodeByteArray(stringToByteArray(input), opt_webSafe);
- },
- /**
- * Base64-decode a string.
- *
- * @param {string} input to decode.
- * @param {boolean=} opt_webSafe True if we should use the
- * alternative alphabet.
- * @return {string} string representing the decoded value.
- */
- decodeString: function (input, opt_webSafe) {
- // Shortcut for Mozilla browsers that implement
- // a native base64 encoder in the form of "btoa/atob"
- if (this.HAS_NATIVE_SUPPORT && !opt_webSafe) {
- return atob(input);
- }
- return byteArrayToString(this.decodeStringToByteArray(input, opt_webSafe));
- },
- /**
- * Base64-decode a string.
- *
- * In base-64 decoding, groups of four characters are converted into three
- * bytes. If the encoder did not apply padding, the input length may not
- * be a multiple of 4.
- *
- * In this case, the last group will have fewer than 4 characters, and
- * padding will be inferred. If the group has one or two characters, it decodes
- * to one byte. If the group has three characters, it decodes to two bytes.
- *
- * @param {string} input Input to decode.
- * @param {boolean=} opt_webSafe True if we should use the web-safe alphabet.
- * @return {!Array} bytes representing the decoded value.
- */
- decodeStringToByteArray: function (input, opt_webSafe) {
- this.init_();
- var charToByteMap = opt_webSafe
- ? this.charToByteMapWebSafe_
- : this.charToByteMap_;
- var output = [];
- for (var i = 0; i < input.length;) {
- var byte1 = charToByteMap[input.charAt(i++)];
- var haveByte2 = i < input.length;
- var byte2 = haveByte2 ? charToByteMap[input.charAt(i)] : 0;
- ++i;
- var haveByte3 = i < input.length;
- var byte3 = haveByte3 ? charToByteMap[input.charAt(i)] : 64;
- ++i;
- var haveByte4 = i < input.length;
- var byte4 = haveByte4 ? charToByteMap[input.charAt(i)] : 64;
- ++i;
- if (byte1 == null || byte2 == null || byte3 == null || byte4 == null) {
- throw Error();
- }
- var outByte1 = (byte1 << 2) | (byte2 >> 4);
- output.push(outByte1);
- if (byte3 != 64) {
- var outByte2 = ((byte2 << 4) & 0xf0) | (byte3 >> 2);
- output.push(outByte2);
- if (byte4 != 64) {
- var outByte3 = ((byte3 << 6) & 0xc0) | byte4;
- output.push(outByte3);
- }
- }
- }
- return output;
- },
- /**
- * Lazy static initialization function. Called before
- * accessing any of the static map variables.
- * @private
- */
- init_: function () {
- if (!this.byteToCharMap_) {
- this.byteToCharMap_ = {};
- this.charToByteMap_ = {};
- this.byteToCharMapWebSafe_ = {};
- this.charToByteMapWebSafe_ = {};
- // We want quick mappings back and forth, so we precompute two maps.
- for (var i = 0; i < this.ENCODED_VALS.length; i++) {
- this.byteToCharMap_[i] = this.ENCODED_VALS.charAt(i);
- this.charToByteMap_[this.byteToCharMap_[i]] = i;
- this.byteToCharMapWebSafe_[i] = this.ENCODED_VALS_WEBSAFE.charAt(i);
- this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[i]] = i;
- // Be forgiving when decoding and correctly decode both encodings.
- if (i >= this.ENCODED_VALS_BASE.length) {
- this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(i)] = i;
- this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(i)] = i;
- }
- }
- }
- }
-};
-/**
- * URL-safe base64 encoding
- * @param {!string} str
- * @return {!string}
- */
-var base64Encode = function (str) {
- var utf8Bytes = stringToByteArray(str);
- return base64.encodeByteArray(utf8Bytes, true);
-};
-/**
- * URL-safe base64 decoding
- *
- * NOTE: DO NOT use the global atob() function - it does NOT support the
- * base64Url variant encoding.
- *
- * @param {string} str To be decoded
- * @return {?string} Decoded result, if possible
- */
-var base64Decode = function (str) {
- try {
- return base64.decodeString(str, true);
- }
- catch (e) {
- console.error('base64Decode failed: ', e);
- }
- return null;
-};
-
-/**
- * Copyright 2017 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Do a deep-copy of basic JavaScript Objects or Arrays.
- */
-function deepCopy(value) {
- return deepExtend(undefined, value);
-}
-/**
- * Copy properties from source to target (recursively allows extension
- * of Objects and Arrays). Scalar values in the target are over-written.
- * If target is undefined, an object of the appropriate type will be created
- * (and returned).
- *
- * We recursively copy all child properties of plain Objects in the source- so
- * that namespace- like dictionaries are merged.
- *
- * Note that the target can be a function, in which case the properties in
- * the source Object are copied onto it as static properties of the Function.
- */
-function deepExtend(target, source) {
- if (!(source instanceof Object)) {
- return source;
- }
- switch (source.constructor) {
- case Date:
- // Treat Dates like scalars; if the target date object had any child
- // properties - they will be lost!
- var dateValue = source;
- return new Date(dateValue.getTime());
- case Object:
- if (target === undefined) {
- target = {};
- }
- break;
- case Array:
- // Always copy the array source and overwrite the target.
- target = [];
- break;
- default:
- // Not a plain Object - treat it as a scalar.
- return source;
- }
- for (var prop in source) {
- if (!source.hasOwnProperty(prop)) {
- continue;
- }
- target[prop] = deepExtend(target[prop], source[prop]);
- }
- return target;
-}
-// TODO: Really needed (for JSCompiler type checking)?
-function patchProperty(obj, prop, value) {
- obj[prop] = value;
-}
-
-/**
- * Copyright 2017 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-var Deferred = /** @class */ (function () {
- function Deferred() {
- var _this = this;
- this.promise = new Promise(function (resolve, reject) {
- _this.resolve = resolve;
- _this.reject = reject;
- });
- }
- /**
- * Our API internals are not promiseified and cannot because our callback APIs have subtle expectations around
- * invoking promises inline, which Promises are forbidden to do. This method accepts an optional node-style callback
- * and returns a node-style callback which will resolve or reject the Deferred's promise.
- * @param {((?function(?(Error)): (?|undefined))| (?function(?(Error),?=): (?|undefined)))=} callback
- * @return {!function(?(Error), ?=)}
- */
- Deferred.prototype.wrapCallback = function (callback) {
- var _this = this;
- return function (error, value) {
- if (error) {
- _this.reject(error);
- }
- else {
- _this.resolve(value);
- }
- if (typeof callback === 'function') {
- // Attaching noop handler just in case developer wasn't expecting
- // promises
- _this.promise.catch(function () { });
- // Some of our callbacks don't expect a value and our own tests
- // assert that the parameter length is 1
- if (callback.length === 1) {
- callback(error);
- }
- else {
- callback(error, value);
- }
- }
- };
- };
- return Deferred;
-}());
-
-/**
- * Copyright 2017 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Returns navigator.userAgent string or '' if it's not defined.
- * @return {string} user agent string
- */
-var getUA = function () {
- if (typeof navigator !== 'undefined' &&
- typeof navigator['userAgent'] === 'string') {
- return navigator['userAgent'];
- }
- else {
- return '';
- }
-};
-/**
- * Detect Cordova / PhoneGap / Ionic frameworks on a mobile device.
- *
- * Deliberately does not rely on checking `file://` URLs (as this fails PhoneGap in the Ripple emulator) nor
- * Cordova `onDeviceReady`, which would normally wait for a callback.
- *
- * @return {boolean} isMobileCordova
- */
-var isMobileCordova = function () {
- return (typeof window !== 'undefined' &&
- !!(window['cordova'] || window['phonegap'] || window['PhoneGap']) &&
- /ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(getUA()));
-};
-/**
- * Detect React Native.
- *
- * @return {boolean} True if ReactNative environment is detected.
- */
-var isReactNative = function () {
- return (typeof navigator === 'object' && navigator['product'] === 'ReactNative');
-};
-/**
- * Detect Node.js.
- *
- * @return {boolean} True if Node.js environment is detected.
- */
-var isNodeSdk = function () {
- return CONSTANTS.NODE_CLIENT === true || CONSTANTS.NODE_ADMIN === true;
-};
-
-var ERROR_NAME = 'FirebaseError';
-var captureStackTrace = Error
- .captureStackTrace;
-// Export for faking in tests
-function patchCapture(captureFake) {
- var result = captureStackTrace;
- captureStackTrace = captureFake;
- return result;
-}
-var FirebaseError = /** @class */ (function () {
- function FirebaseError(code, message) {
- this.code = code;
- this.message = message;
- // We want the stack value, if implemented by Error
- if (captureStackTrace) {
- // Patches this.stack, omitted calls above ErrorFactory#create
- captureStackTrace(this, ErrorFactory.prototype.create);
- }
- else {
- try {
- // In case of IE11, stack will be set only after error is raised.
- // https://docs.microsoft.com/en-us/scripting/javascript/reference/stack-property-error-javascript
- throw Error.apply(this, arguments);
- }
- catch (err) {
- this.name = ERROR_NAME;
- // Make non-enumerable getter for the property.
- Object.defineProperty(this, 'stack', {
- get: function () {
- return err.stack;
- }
- });
- }
- }
- }
- return FirebaseError;
-}());
-// Back-door inheritance
-FirebaseError.prototype = Object.create(Error.prototype);
-FirebaseError.prototype.constructor = FirebaseError;
-FirebaseError.prototype.name = ERROR_NAME;
-var ErrorFactory = /** @class */ (function () {
- function ErrorFactory(service, serviceName, errors) {
- this.service = service;
- this.serviceName = serviceName;
- this.errors = errors;
- // Matches {$name}, by default.
- this.pattern = /\{\$([^}]+)}/g;
- // empty
- }
- ErrorFactory.prototype.create = function (code, data) {
- if (data === undefined) {
- data = {};
- }
- var template = this.errors[code];
- var fullCode = this.service + '/' + code;
- var message;
- if (template === undefined) {
- message = 'Error';
- }
- else {
- message = template.replace(this.pattern, function (match, key) {
- var value = data[key];
- return value !== undefined ? value.toString() : '<' + key + '?>';
- });
- }
- // Service: Error message (service/code).
- message = this.serviceName + ': ' + message + ' (' + fullCode + ').';
- var err = new FirebaseError(fullCode, message);
- // Populate the Error object with message parts for programmatic
- // accesses (e.g., e.file).
- for (var prop in data) {
- if (!data.hasOwnProperty(prop) || prop.slice(-1) === '_') {
- continue;
- }
- err[prop] = data[prop];
- }
- return err;
- };
- return ErrorFactory;
-}());
-
-/**
- * Copyright 2017 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Evaluates a JSON string into a javascript object.
- *
- * @param {string} str A string containing JSON.
- * @return {*} The javascript object representing the specified JSON.
- */
-function jsonEval(str) {
- return JSON.parse(str);
-}
-/**
- * Returns JSON representing a javascript object.
- * @param {*} data Javascript object to be stringified.
- * @return {string} The JSON contents of the object.
- */
-function stringify(data) {
- return JSON.stringify(data);
-}
-
-/**
- * Copyright 2017 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Decodes a Firebase auth. token into constituent parts.
- *
- * Notes:
- * - May return with invalid / incomplete claims if there's no native base64 decoding support.
- * - Doesn't check if the token is actually valid.
- *
- * @param {?string} token
- * @return {{header: *, claims: *, data: *, signature: string}}
- */
-var decode = function (token) {
- var header = {}, claims = {}, data = {}, signature = '';
- try {
- var parts = token.split('.');
- header = jsonEval(base64Decode(parts[0]) || '');
- claims = jsonEval(base64Decode(parts[1]) || '');
- signature = parts[2];
- data = claims['d'] || {};
- delete claims['d'];
- }
- catch (e) { }
- return {
- header: header,
- claims: claims,
- data: data,
- signature: signature
- };
-};
-/**
- * Decodes a Firebase auth. token and checks the validity of its time-based claims. Will return true if the
- * token is within the time window authorized by the 'nbf' (not-before) and 'iat' (issued-at) claims.
- *
- * Notes:
- * - May return a false negative if there's no native base64 decoding support.
- * - Doesn't check if the token is actually valid.
- *
- * @param {?string} token
- * @return {boolean}
- */
-var isValidTimestamp = function (token) {
- var claims = decode(token).claims, now = Math.floor(new Date().getTime() / 1000), validSince, validUntil;
- if (typeof claims === 'object') {
- if (claims.hasOwnProperty('nbf')) {
- validSince = claims['nbf'];
- }
- else if (claims.hasOwnProperty('iat')) {
- validSince = claims['iat'];
- }
- if (claims.hasOwnProperty('exp')) {
- validUntil = claims['exp'];
- }
- else {
- // token will expire after 24h by default
- validUntil = validSince + 86400;
- }
- }
- return (now && validSince && validUntil && now >= validSince && now <= validUntil);
-};
-/**
- * Decodes a Firebase auth. token and returns its issued at time if valid, null otherwise.
- *
- * Notes:
- * - May return null if there's no native base64 decoding support.
- * - Doesn't check if the token is actually valid.
- *
- * @param {?string} token
- * @return {?number}
- */
-var issuedAtTime = function (token) {
- var claims = decode(token).claims;
- if (typeof claims === 'object' && claims.hasOwnProperty('iat')) {
- return claims['iat'];
- }
- return null;
-};
-/**
- * Decodes a Firebase auth. token and checks the validity of its format. Expects a valid issued-at time.
- *
- * Notes:
- * - May return a false negative if there's no native base64 decoding support.
- * - Doesn't check if the token is actually valid.
- *
- * @param {?string} token
- * @return {boolean}
- */
-var isValidFormat = function (token) {
- var decoded = decode(token), claims = decoded.claims;
- return !!claims && typeof claims === 'object' && claims.hasOwnProperty('iat');
-};
-/**
- * Attempts to peer into an auth token and determine if it's an admin auth token by looking at the claims portion.
- *
- * Notes:
- * - May return a false negative if there's no native base64 decoding support.
- * - Doesn't check if the token is actually valid.
- *
- * @param {?string} token
- * @return {boolean}
- */
-var isAdmin = function (token) {
- var claims = decode(token).claims;
- return typeof claims === 'object' && claims['admin'] === true;
-};
-
-/**
- * Copyright 2017 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-// See http://www.devthought.com/2012/01/18/an-object-is-not-a-hash/
-var contains = function (obj, key) {
- return Object.prototype.hasOwnProperty.call(obj, key);
-};
-var safeGet = function (obj, key) {
- if (Object.prototype.hasOwnProperty.call(obj, key))
- return obj[key];
- // else return undefined.
-};
-/**
- * Enumerates the keys/values in an object, excluding keys defined on the prototype.
- *
- * @param {?Object.} obj Object to enumerate.
- * @param {!function(K, V)} fn Function to call for each key and value.
- * @template K,V
- */
-var forEach = function (obj, fn) {
- for (var key in obj) {
- if (Object.prototype.hasOwnProperty.call(obj, key)) {
- fn(key, obj[key]);
- }
- }
-};
-/**
- * Copies all the (own) properties from one object to another.
- * @param {!Object} objTo
- * @param {!Object} objFrom
- * @return {!Object} objTo
- */
-var extend = function (objTo, objFrom) {
- forEach(objFrom, function (key, value) {
- objTo[key] = value;
- });
- return objTo;
-};
-/**
- * Returns a clone of the specified object.
- * @param {!Object} obj
- * @return {!Object} cloned obj.
- */
-var clone = function (obj) {
- return extend({}, obj);
-};
-/**
- * Returns true if obj has typeof "object" and is not null. Unlike goog.isObject(), does not return true
- * for functions.
- *
- * @param obj {*} A potential object.
- * @returns {boolean} True if it's an object.
- */
-var isNonNullObject = function (obj) {
- return typeof obj === 'object' && obj !== null;
-};
-var isEmpty = function (obj) {
- for (var key in obj) {
- return false;
- }
- return true;
-};
-var getCount = function (obj) {
- var rv = 0;
- for (var key in obj) {
- rv++;
- }
- return rv;
-};
-var map = function (obj, f, opt_obj) {
- var res = {};
- for (var key in obj) {
- res[key] = f.call(opt_obj, obj[key], key, obj);
- }
- return res;
-};
-var findKey = function (obj, fn, opt_this) {
- for (var key in obj) {
- if (fn.call(opt_this, obj[key], key, obj)) {
- return key;
- }
- }
- return undefined;
-};
-var findValue = function (obj, fn, opt_this) {
- var key = findKey(obj, fn, opt_this);
- return key && obj[key];
-};
-var getAnyKey = function (obj) {
- for (var key in obj) {
- return key;
- }
-};
-var getValues = function (obj) {
- var res = [];
- var i = 0;
- for (var key in obj) {
- res[i++] = obj[key];
- }
- return res;
-};
-/**
- * Tests whether every key/value pair in an object pass the test implemented
- * by the provided function
- *
- * @param {?Object.} obj Object to test.
- * @param {!function(K, V)} fn Function to call for each key and value.
- * @template K,V
- */
-var every = function (obj, fn) {
- for (var key in obj) {
- if (Object.prototype.hasOwnProperty.call(obj, key)) {
- if (!fn(key, obj[key])) {
- return false;
- }
- }
- }
- return true;
-};
-
-/**
- * Copyright 2017 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Returns a querystring-formatted string (e.g. &arg=val&arg2=val2) from a params
- * object (e.g. {arg: 'val', arg2: 'val2'})
- * Note: You must prepend it with ? when adding it to a URL.
- *
- * @param {!Object} querystringParams
- * @return {string}
- */
-var querystring = function (querystringParams) {
- var params = [];
- forEach(querystringParams, function (key, value) {
- if (Array.isArray(value)) {
- value.forEach(function (arrayVal) {
- params.push(encodeURIComponent(key) + '=' + encodeURIComponent(arrayVal));
- });
- }
- else {
- params.push(encodeURIComponent(key) + '=' + encodeURIComponent(value));
- }
- });
- return params.length ? '&' + params.join('&') : '';
-};
-/**
- * Decodes a querystring (e.g. ?arg=val&arg2=val2) into a params object (e.g. {arg: 'val', arg2: 'val2'})
- *
- * @param {string} querystring
- * @return {!Object}
- */
-var querystringDecode = function (querystring) {
- var obj = {};
- var tokens = querystring.replace(/^\?/, '').split('&');
- tokens.forEach(function (token) {
- if (token) {
- var key = token.split('=');
- obj[key[0]] = key[1];
- }
- });
- return obj;
-};
-
-/**
- * Copyright 2017 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-// Copyright 2011 The Closure Library Authors. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS-IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-/**
- * @fileoverview Abstract cryptographic hash interface.
- *
- * See Sha1 and Md5 for sample implementations.
- *
- */
-/**
- * Create a cryptographic hash instance.
- *
- * @constructor
- * @struct
- */
-var Hash = /** @class */ (function () {
- function Hash() {
- /**
- * The block size for the hasher.
- * @type {number}
- */
- this.blockSize = -1;
- }
- return Hash;
-}());
-
-/**
- * Copyright 2017 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * @fileoverview SHA-1 cryptographic hash.
- * Variable names follow the notation in FIPS PUB 180-3:
- * http://csrc.nist.gov/publications/fips/fips180-3/fips180-3_final.pdf.
- *
- * Usage:
- * var sha1 = new sha1();
- * sha1.update(bytes);
- * var hash = sha1.digest();
- *
- * Performance:
- * Chrome 23: ~400 Mbit/s
- * Firefox 16: ~250 Mbit/s
- *
- */
-/**
- * SHA-1 cryptographic hash constructor.
- *
- * The properties declared here are discussed in the above algorithm document.
- * @constructor
- * @extends {Hash}
- * @final
- * @struct
- */
-var Sha1 = /** @class */ (function (_super) {
- tslib_1.__extends(Sha1, _super);
- function Sha1() {
- var _this = _super.call(this) || this;
- /**
- * Holds the previous values of accumulated variables a-e in the compress_
- * function.
- * @type {!Array}
- * @private
- */
- _this.chain_ = [];
- /**
- * A buffer holding the partially computed hash result.
- * @type {!Array}
- * @private
- */
- _this.buf_ = [];
- /**
- * An array of 80 bytes, each a part of the message to be hashed. Referred to
- * as the message schedule in the docs.
- * @type {!Array}
- * @private
- */
- _this.W_ = [];
- /**
- * Contains data needed to pad messages less than 64 bytes.
- * @type {!Array}
- * @private
- */
- _this.pad_ = [];
- /**
- * @private {number}
- */
- _this.inbuf_ = 0;
- /**
- * @private {number}
- */
- _this.total_ = 0;
- _this.blockSize = 512 / 8;
- _this.pad_[0] = 128;
- for (var i = 1; i < _this.blockSize; ++i) {
- _this.pad_[i] = 0;
- }
- _this.reset();
- return _this;
- }
- Sha1.prototype.reset = function () {
- this.chain_[0] = 0x67452301;
- this.chain_[1] = 0xefcdab89;
- this.chain_[2] = 0x98badcfe;
- this.chain_[3] = 0x10325476;
- this.chain_[4] = 0xc3d2e1f0;
- this.inbuf_ = 0;
- this.total_ = 0;
- };
- /**
- * Internal compress helper function.
- * @param {!Array|!Uint8Array|string} buf Block to compress.
- * @param {number=} opt_offset Offset of the block in the buffer.
- * @private
- */
- Sha1.prototype.compress_ = function (buf, opt_offset) {
- if (!opt_offset) {
- opt_offset = 0;
- }
- var W = this.W_;
- // get 16 big endian words
- if (typeof buf === 'string') {
- for (var i = 0; i < 16; i++) {
- // TODO(user): [bug 8140122] Recent versions of Safari for Mac OS and iOS
- // have a bug that turns the post-increment ++ operator into pre-increment
- // during JIT compilation. We have code that depends heavily on SHA-1 for
- // correctness and which is affected by this bug, so I've removed all uses
- // of post-increment ++ in which the result value is used. We can revert
- // this change once the Safari bug
- // (https://bugs.webkit.org/show_bug.cgi?id=109036) has been fixed and
- // most clients have been updated.
- W[i] =
- (buf.charCodeAt(opt_offset) << 24) |
- (buf.charCodeAt(opt_offset + 1) << 16) |
- (buf.charCodeAt(opt_offset + 2) << 8) |
- buf.charCodeAt(opt_offset + 3);
- opt_offset += 4;
- }
- }
- else {
- for (var i = 0; i < 16; i++) {
- W[i] =
- (buf[opt_offset] << 24) |
- (buf[opt_offset + 1] << 16) |
- (buf[opt_offset + 2] << 8) |
- buf[opt_offset + 3];
- opt_offset += 4;
- }
- }
- // expand to 80 words
- for (var i = 16; i < 80; i++) {
- var t = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16];
- W[i] = ((t << 1) | (t >>> 31)) & 0xffffffff;
- }
- var a = this.chain_[0];
- var b = this.chain_[1];
- var c = this.chain_[2];
- var d = this.chain_[3];
- var e = this.chain_[4];
- var f, k;
- // TODO(user): Try to unroll this loop to speed up the computation.
- for (var i = 0; i < 80; i++) {
- if (i < 40) {
- if (i < 20) {
- f = d ^ (b & (c ^ d));
- k = 0x5a827999;
- }
- else {
- f = b ^ c ^ d;
- k = 0x6ed9eba1;
- }
- }
- else {
- if (i < 60) {
- f = (b & c) | (d & (b | c));
- k = 0x8f1bbcdc;
- }
- else {
- f = b ^ c ^ d;
- k = 0xca62c1d6;
- }
- }
- var t = (((a << 5) | (a >>> 27)) + f + e + k + W[i]) & 0xffffffff;
- e = d;
- d = c;
- c = ((b << 30) | (b >>> 2)) & 0xffffffff;
- b = a;
- a = t;
- }
- this.chain_[0] = (this.chain_[0] + a) & 0xffffffff;
- this.chain_[1] = (this.chain_[1] + b) & 0xffffffff;
- this.chain_[2] = (this.chain_[2] + c) & 0xffffffff;
- this.chain_[3] = (this.chain_[3] + d) & 0xffffffff;
- this.chain_[4] = (this.chain_[4] + e) & 0xffffffff;
- };
- Sha1.prototype.update = function (bytes, opt_length) {
- // TODO(johnlenz): tighten the function signature and remove this check
- if (bytes == null) {
- return;
- }
- if (opt_length === undefined) {
- opt_length = bytes.length;
- }
- var lengthMinusBlock = opt_length - this.blockSize;
- var n = 0;
- // Using local instead of member variables gives ~5% speedup on Firefox 16.
- var buf = this.buf_;
- var inbuf = this.inbuf_;
- // The outer while loop should execute at most twice.
- while (n < opt_length) {
- // When we have no data in the block to top up, we can directly process the
- // input buffer (assuming it contains sufficient data). This gives ~25%
- // speedup on Chrome 23 and ~15% speedup on Firefox 16, but requires that
- // the data is provided in large chunks (or in multiples of 64 bytes).
- if (inbuf == 0) {
- while (n <= lengthMinusBlock) {
- this.compress_(bytes, n);
- n += this.blockSize;
- }
- }
- if (typeof bytes === 'string') {
- while (n < opt_length) {
- buf[inbuf] = bytes.charCodeAt(n);
- ++inbuf;
- ++n;
- if (inbuf == this.blockSize) {
- this.compress_(buf);
- inbuf = 0;
- // Jump to the outer loop so we use the full-block optimization.
- break;
- }
- }
- }
- else {
- while (n < opt_length) {
- buf[inbuf] = bytes[n];
- ++inbuf;
- ++n;
- if (inbuf == this.blockSize) {
- this.compress_(buf);
- inbuf = 0;
- // Jump to the outer loop so we use the full-block optimization.
- break;
- }
- }
- }
- }
- this.inbuf_ = inbuf;
- this.total_ += opt_length;
- };
- /** @override */
- Sha1.prototype.digest = function () {
- var digest = [];
- var totalBits = this.total_ * 8;
- // Add pad 0x80 0x00*.
- if (this.inbuf_ < 56) {
- this.update(this.pad_, 56 - this.inbuf_);
- }
- else {
- this.update(this.pad_, this.blockSize - (this.inbuf_ - 56));
- }
- // Add # bits.
- for (var i = this.blockSize - 1; i >= 56; i--) {
- this.buf_[i] = totalBits & 255;
- totalBits /= 256; // Don't use bit-shifting here!
- }
- this.compress_(this.buf_);
- var n = 0;
- for (var i = 0; i < 5; i++) {
- for (var j = 24; j >= 0; j -= 8) {
- digest[n] = (this.chain_[i] >> j) & 255;
- ++n;
- }
- }
- return digest;
- };
- return Sha1;
-}(Hash));
-
-/**
- * Helper to make a Subscribe function (just like Promise helps make a
- * Thenable).
- *
- * @param executor Function which can make calls to a single Observer
- * as a proxy.
- * @param onNoObservers Callback when count of Observers goes to zero.
- */
-function createSubscribe(executor, onNoObservers) {
- var proxy = new ObserverProxy(executor, onNoObservers);
- return proxy.subscribe.bind(proxy);
-}
-/**
- * Implement fan-out for any number of Observers attached via a subscribe
- * function.
- */
-var ObserverProxy = /** @class */ (function () {
- /**
- * @param executor Function which can make calls to a single Observer
- * as a proxy.
- * @param onNoObservers Callback when count of Observers goes to zero.
- */
- function ObserverProxy(executor, onNoObservers) {
- var _this = this;
- this.observers = [];
- this.unsubscribes = [];
- this.observerCount = 0;
- // Micro-task scheduling by calling task.then().
- this.task = Promise.resolve();
- this.finalized = false;
- this.onNoObservers = onNoObservers;
- // Call the executor asynchronously so subscribers that are called
- // synchronously after the creation of the subscribe function
- // can still receive the very first value generated in the executor.
- this.task
- .then(function () {
- executor(_this);
- })
- .catch(function (e) {
- _this.error(e);
- });
- }
- ObserverProxy.prototype.next = function (value) {
- this.forEachObserver(function (observer) {
- observer.next(value);
- });
- };
- ObserverProxy.prototype.error = function (error) {
- this.forEachObserver(function (observer) {
- observer.error(error);
- });
- this.close(error);
- };
- ObserverProxy.prototype.complete = function () {
- this.forEachObserver(function (observer) {
- observer.complete();
- });
- this.close();
- };
- /**
- * Subscribe function that can be used to add an Observer to the fan-out list.
- *
- * - We require that no event is sent to a subscriber sychronously to their
- * call to subscribe().
- */
- ObserverProxy.prototype.subscribe = function (nextOrObserver, error, complete) {
- var _this = this;
- var observer;
- if (nextOrObserver === undefined &&
- error === undefined &&
- complete === undefined) {
- throw new Error('Missing Observer.');
- }
- // Assemble an Observer object when passed as callback functions.
- if (implementsAnyMethods(nextOrObserver, ['next', 'error', 'complete'])) {
- observer = nextOrObserver;
- }
- else {
- observer = {
- next: nextOrObserver,
- error: error,
- complete: complete
- };
- }
- if (observer.next === undefined) {
- observer.next = noop;
- }
- if (observer.error === undefined) {
- observer.error = noop;
- }
- if (observer.complete === undefined) {
- observer.complete = noop;
- }
- var unsub = this.unsubscribeOne.bind(this, this.observers.length);
- // Attempt to subscribe to a terminated Observable - we
- // just respond to the Observer with the final error or complete
- // event.
- if (this.finalized) {
- this.task.then(function () {
- try {
- if (_this.finalError) {
- observer.error(_this.finalError);
- }
- else {
- observer.complete();
- }
- }
- catch (e) {
- // nothing
- }
- return;
- });
- }
- this.observers.push(observer);
- return unsub;
- };
- // Unsubscribe is synchronous - we guarantee that no events are sent to
- // any unsubscribed Observer.
- ObserverProxy.prototype.unsubscribeOne = function (i) {
- if (this.observers === undefined || this.observers[i] === undefined) {
- return;
- }
- delete this.observers[i];
- this.observerCount -= 1;
- if (this.observerCount === 0 && this.onNoObservers !== undefined) {
- this.onNoObservers(this);
- }
- };
- ObserverProxy.prototype.forEachObserver = function (fn) {
- if (this.finalized) {
- // Already closed by previous event....just eat the additional values.
- return;
- }
- // Since sendOne calls asynchronously - there is no chance that
- // this.observers will become undefined.
- for (var i = 0; i < this.observers.length; i++) {
- this.sendOne(i, fn);
- }
- };
- // Call the Observer via one of it's callback function. We are careful to
- // confirm that the observe has not been unsubscribed since this asynchronous
- // function had been queued.
- ObserverProxy.prototype.sendOne = function (i, fn) {
- var _this = this;
- // Execute the callback asynchronously
- this.task.then(function () {
- if (_this.observers !== undefined && _this.observers[i] !== undefined) {
- try {
- fn(_this.observers[i]);
- }
- catch (e) {
- // Ignore exceptions raised in Observers or missing methods of an
- // Observer.
- // Log error to console. b/31404806
- if (typeof console !== 'undefined' && console.error) {
- console.error(e);
- }
- }
- }
- });
- };
- ObserverProxy.prototype.close = function (err) {
- var _this = this;
- if (this.finalized) {
- return;
- }
- this.finalized = true;
- if (err !== undefined) {
- this.finalError = err;
- }
- // Proxy is no longer needed - garbage collect references
- this.task.then(function () {
- _this.observers = undefined;
- _this.onNoObservers = undefined;
- });
- };
- return ObserverProxy;
-}());
-/** Turn synchronous function into one called asynchronously. */
-function async(fn, onError) {
- return function () {
- var args = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- args[_i] = arguments[_i];
- }
- Promise.resolve(true)
- .then(function () {
- fn.apply(void 0, args);
- })
- .catch(function (error) {
- if (onError) {
- onError(error);
- }
- });
- };
-}
-/**
- * Return true if the object passed in implements any of the named methods.
- */
-function implementsAnyMethods(obj, methods) {
- if (typeof obj !== 'object' || obj === null) {
- return false;
- }
- for (var _i = 0, methods_1 = methods; _i < methods_1.length; _i++) {
- var method = methods_1[_i];
- if (method in obj && typeof obj[method] === 'function') {
- return true;
- }
- }
- return false;
-}
-function noop() {
- // do nothing
-}
-
-/**
- * Copyright 2017 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Check to make sure the appropriate number of arguments are provided for a public function.
- * Throws an error if it fails.
- *
- * @param {!string} fnName The function name
- * @param {!number} minCount The minimum number of arguments to allow for the function call
- * @param {!number} maxCount The maximum number of argument to allow for the function call
- * @param {!number} argCount The actual number of arguments provided.
- */
-var validateArgCount = function (fnName, minCount, maxCount, argCount) {
- var argError;
- if (argCount < minCount) {
- argError = 'at least ' + minCount;
- }
- else if (argCount > maxCount) {
- argError = maxCount === 0 ? 'none' : 'no more than ' + maxCount;
- }
- if (argError) {
- var error = fnName +
- ' failed: Was called with ' +
- argCount +
- (argCount === 1 ? ' argument.' : ' arguments.') +
- ' Expects ' +
- argError +
- '.';
- throw new Error(error);
- }
-};
-/**
- * Generates a string to prefix an error message about failed argument validation
- *
- * @param {!string} fnName The function name
- * @param {!number} argumentNumber The index of the argument
- * @param {boolean} optional Whether or not the argument is optional
- * @return {!string} The prefix to add to the error thrown for validation.
- */
-function errorPrefix(fnName, argumentNumber, optional) {
- var argName = '';
- switch (argumentNumber) {
- case 1:
- argName = optional ? 'first' : 'First';
- break;
- case 2:
- argName = optional ? 'second' : 'Second';
- break;
- case 3:
- argName = optional ? 'third' : 'Third';
- break;
- case 4:
- argName = optional ? 'fourth' : 'Fourth';
- break;
- default:
- throw new Error('errorPrefix called with argumentNumber > 4. Need to update it?');
- }
- var error = fnName + ' failed: ';
- error += argName + ' argument ';
- return error;
-}
-/**
- * @param {!string} fnName
- * @param {!number} argumentNumber
- * @param {!string} namespace
- * @param {boolean} optional
- */
-function validateNamespace(fnName, argumentNumber, namespace, optional) {
- if (optional && !namespace)
- return;
- if (typeof namespace !== 'string') {
- //TODO: I should do more validation here. We only allow certain chars in namespaces.
- throw new Error(errorPrefix(fnName, argumentNumber, optional) +
- 'must be a valid firebase namespace.');
- }
-}
-function validateCallback(fnName, argumentNumber, callback, optional) {
- if (optional && !callback)
- return;
- if (typeof callback !== 'function')
- throw new Error(errorPrefix(fnName, argumentNumber, optional) +
- 'must be a valid function.');
-}
-function validateContextObject(fnName, argumentNumber, context, optional) {
- if (optional && !context)
- return;
- if (typeof context !== 'object' || context === null)
- throw new Error(errorPrefix(fnName, argumentNumber, optional) +
- 'must be a valid context object.');
-}
-
-/**
- * Copyright 2017 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-// Code originally came from goog.crypt.stringToUtf8ByteArray, but for some reason they
-// automatically replaced '\r\n' with '\n', and they didn't handle surrogate pairs,
-// so it's been modified.
-// Note that not all Unicode characters appear as single characters in JavaScript strings.
-// fromCharCode returns the UTF-16 encoding of a character - so some Unicode characters
-// use 2 characters in Javascript. All 4-byte UTF-8 characters begin with a first
-// character in the range 0xD800 - 0xDBFF (the first character of a so-called surrogate
-// pair).
-// See http://www.ecma-international.org/ecma-262/5.1/#sec-15.1.3
-/**
- * @param {string} str
- * @return {Array}
- */
-var stringToByteArray$1 = function (str) {
- var out = [], p = 0;
- for (var i = 0; i < str.length; i++) {
- var c = str.charCodeAt(i);
- // Is this the lead surrogate in a surrogate pair?
- if (c >= 0xd800 && c <= 0xdbff) {
- var high = c - 0xd800; // the high 10 bits.
- i++;
- assert(i < str.length, 'Surrogate pair missing trail surrogate.');
- var low = str.charCodeAt(i) - 0xdc00; // the low 10 bits.
- c = 0x10000 + (high << 10) + low;
- }
- if (c < 128) {
- out[p++] = c;
- }
- else if (c < 2048) {
- out[p++] = (c >> 6) | 192;
- out[p++] = (c & 63) | 128;
- }
- else if (c < 65536) {
- out[p++] = (c >> 12) | 224;
- out[p++] = ((c >> 6) & 63) | 128;
- out[p++] = (c & 63) | 128;
- }
- else {
- out[p++] = (c >> 18) | 240;
- out[p++] = ((c >> 12) & 63) | 128;
- out[p++] = ((c >> 6) & 63) | 128;
- out[p++] = (c & 63) | 128;
- }
- }
- return out;
-};
-/**
- * Calculate length without actually converting; useful for doing cheaper validation.
- * @param {string} str
- * @return {number}
- */
-var stringLength = function (str) {
- var p = 0;
- for (var i = 0; i < str.length; i++) {
- var c = str.charCodeAt(i);
- if (c < 128) {
- p++;
- }
- else if (c < 2048) {
- p += 2;
- }
- else if (c >= 0xd800 && c <= 0xdbff) {
- // Lead surrogate of a surrogate pair. The pair together will take 4 bytes to represent.
- p += 4;
- i++; // skip trail surrogate.
- }
- else {
- p += 3;
- }
- }
- return p;
-};
-
-/**
- * Copyright 2017 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-exports.assert = assert;
-exports.assertionError = assertionError;
-exports.base64 = base64;
-exports.base64Decode = base64Decode;
-exports.base64Encode = base64Encode;
-exports.CONSTANTS = CONSTANTS;
-exports.deepCopy = deepCopy;
-exports.deepExtend = deepExtend;
-exports.patchProperty = patchProperty;
-exports.Deferred = Deferred;
-exports.getUA = getUA;
-exports.isMobileCordova = isMobileCordova;
-exports.isNodeSdk = isNodeSdk;
-exports.isReactNative = isReactNative;
-exports.ErrorFactory = ErrorFactory;
-exports.FirebaseError = FirebaseError;
-exports.patchCapture = patchCapture;
-exports.jsonEval = jsonEval;
-exports.stringify = stringify;
-exports.decode = decode;
-exports.isAdmin = isAdmin;
-exports.issuedAtTime = issuedAtTime;
-exports.isValidFormat = isValidFormat;
-exports.isValidTimestamp = isValidTimestamp;
-exports.clone = clone;
-exports.contains = contains;
-exports.every = every;
-exports.extend = extend;
-exports.findKey = findKey;
-exports.findValue = findValue;
-exports.forEach = forEach;
-exports.getAnyKey = getAnyKey;
-exports.getCount = getCount;
-exports.getValues = getValues;
-exports.isEmpty = isEmpty;
-exports.isNonNullObject = isNonNullObject;
-exports.map = map;
-exports.safeGet = safeGet;
-exports.querystring = querystring;
-exports.querystringDecode = querystringDecode;
-exports.Sha1 = Sha1;
-exports.async = async;
-exports.createSubscribe = createSubscribe;
-exports.errorPrefix = errorPrefix;
-exports.validateArgCount = validateArgCount;
-exports.validateCallback = validateCallback;
-exports.validateContextObject = validateContextObject;
-exports.validateNamespace = validateNamespace;
-exports.stringLength = stringLength;
-exports.stringToByteArray = stringToByteArray$1;
-
-},{"tslib":24}],6:[function(require,module,exports){
-'use strict';
-
-function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
-
-require('@firebase/polyfill');
-var firebase = _interopDefault(require('@firebase/app'));
-
-/**
- * Copyright 2018 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-module.exports = firebase;
-
-},{"@firebase/app":1,"@firebase/polyfill":3}],7:[function(require,module,exports){
-'use strict';
-
-require('@firebase/messaging');
-
-/**
- * Copyright 2017 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-},{"@firebase/messaging":2}],8:[function(require,module,exports){
-/*
-object-assign
-(c) Sindre Sorhus
-@license MIT
-*/
-
-'use strict';
-/* eslint-disable no-unused-vars */
-var getOwnPropertySymbols = Object.getOwnPropertySymbols;
-var hasOwnProperty = Object.prototype.hasOwnProperty;
-var propIsEnumerable = Object.prototype.propertyIsEnumerable;
-
-function toObject(val) {
- if (val === null || val === undefined) {
- throw new TypeError('Object.assign cannot be called with null or undefined');
- }
-
- return Object(val);
-}
-
-function shouldUseNative() {
- try {
- if (!Object.assign) {
- return false;
- }
-
- // Detect buggy property enumeration order in older V8 versions.
-
- // https://bugs.chromium.org/p/v8/issues/detail?id=4118
- var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
- test1[5] = 'de';
- if (Object.getOwnPropertyNames(test1)[0] === '5') {
- return false;
- }
-
- // https://bugs.chromium.org/p/v8/issues/detail?id=3056
- var test2 = {};
- for (var i = 0; i < 10; i++) {
- test2['_' + String.fromCharCode(i)] = i;
- }
- var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
- return test2[n];
- });
- if (order2.join('') !== '0123456789') {
- return false;
- }
-
- // https://bugs.chromium.org/p/v8/issues/detail?id=3056
- var test3 = {};
- 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
- test3[letter] = letter;
- });
- if (Object.keys(Object.assign({}, test3)).join('') !==
- 'abcdefghijklmnopqrst') {
- return false;
- }
-
- return true;
- } catch (err) {
- // We don't expect any of the above to throw, but better to be safe.
- return false;
- }
-}
-
-module.exports = shouldUseNative() ? Object.assign : function (target, source) {
- var from;
- var to = toObject(target);
- var symbols;
-
- for (var s = 1; s < arguments.length; s++) {
- from = Object(arguments[s]);
-
- for (var key in from) {
- if (hasOwnProperty.call(from, key)) {
- to[key] = from[key];
- }
- }
-
- if (getOwnPropertySymbols) {
- symbols = getOwnPropertySymbols(from);
- for (var i = 0; i < symbols.length; i++) {
- if (propIsEnumerable.call(from, symbols[i])) {
- to[symbols[i]] = from[symbols[i]];
- }
- }
- }
- }
-
- return to;
-};
-
-},{}],9:[function(require,module,exports){
-(function (process){
-/**
- * Copyright (c) 2013-present, Facebook, Inc.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-'use strict';
-
-var printWarning = function() {};
-
-if (process.env.NODE_ENV !== 'production') {
- var ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');
- var loggedTypeFailures = {};
-
- printWarning = function(text) {
- var message = 'Warning: ' + text;
- if (typeof console !== 'undefined') {
- console.error(message);
- }
- try {
- // --- Welcome to debugging React ---
- // This error was thrown as a convenience so that you can use this stack
- // to find the callsite that caused this warning to fire.
- throw new Error(message);
- } catch (x) {}
- };
-}
-
-/**
- * Assert that the values match with the type specs.
- * Error messages are memorized and will only be shown once.
- *
- * @param {object} typeSpecs Map of name to a ReactPropType
- * @param {object} values Runtime values that need to be type-checked
- * @param {string} location e.g. "prop", "context", "child context"
- * @param {string} componentName Name of the component for error messages.
- * @param {?Function} getStack Returns the component stack.
- * @private
- */
-function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
- if (process.env.NODE_ENV !== 'production') {
- for (var typeSpecName in typeSpecs) {
- if (typeSpecs.hasOwnProperty(typeSpecName)) {
- var error;
- // Prop type validation may throw. In case they do, we don't want to
- // fail the render phase where it didn't fail before. So we log it.
- // After these have been cleaned up, we'll let them throw.
- try {
- // This is intentionally an invariant that gets caught. It's the same
- // behavior as without this statement except with a better message.
- if (typeof typeSpecs[typeSpecName] !== 'function') {
- var err = Error(
- (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
- 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.'
- );
- err.name = 'Invariant Violation';
- throw err;
- }
- error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
- } catch (ex) {
- error = ex;
- }
- if (error && !(error instanceof Error)) {
- printWarning(
- (componentName || 'React class') + ': type specification of ' +
- location + ' `' + typeSpecName + '` is invalid; the type checker ' +
- 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +
- 'You may have forgotten to pass an argument to the type checker ' +
- 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +
- 'shape all require an argument).'
- )
-
- }
- if (error instanceof Error && !(error.message in loggedTypeFailures)) {
- // Only monitor this failure once because there tends to be a lot of the
- // same error.
- loggedTypeFailures[error.message] = true;
-
- var stack = getStack ? getStack() : '';
-
- printWarning(
- 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')
- );
- }
- }
- }
- }
-}
-
-module.exports = checkPropTypes;
-
-}).call(this,require('_process'))
-},{"./lib/ReactPropTypesSecret":10,"_process":28}],10:[function(require,module,exports){
-/**
- * Copyright (c) 2013-present, Facebook, Inc.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-'use strict';
-
-var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
-
-module.exports = ReactPropTypesSecret;
-
-},{}],11:[function(require,module,exports){
-(function (process){
-/** @license React v16.5.2
- * react-dom.development.js
- *
- * Copyright (c) Facebook, Inc. and its affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-'use strict';
-
-
-
-if (process.env.NODE_ENV !== "production") {
- (function() {
-'use strict';
-
-var React = require('react');
-var _assign = require('object-assign');
-var checkPropTypes = require('prop-types/checkPropTypes');
-var schedule = require('schedule');
-var tracing = require('schedule/tracing');
-
-/**
- * Use invariant() to assert state which your program assumes to be true.
- *
- * Provide sprintf-style format (only %s is supported) and arguments
- * to provide information about what broke and what you were
- * expecting.
- *
- * The invariant message will be stripped in production, but the invariant
- * will remain to ensure logic does not differ in production.
- */
-
-var validateFormat = function () {};
-
-{
- validateFormat = function (format) {
- if (format === undefined) {
- throw new Error('invariant requires an error message argument');
- }
- };
-}
-
-function invariant(condition, format, a, b, c, d, e, f) {
- validateFormat(format);
-
- if (!condition) {
- var error = void 0;
- if (format === undefined) {
- error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
- } else {
- var args = [a, b, c, d, e, f];
- var argIndex = 0;
- error = new Error(format.replace(/%s/g, function () {
- return args[argIndex++];
- }));
- error.name = 'Invariant Violation';
- }
-
- error.framesToPop = 1; // we don't care about invariant's own frame
- throw error;
- }
-}
-
-// Relying on the `invariant()` implementation lets us
-// preserve the format and params in the www builds.
-
-!React ? invariant(false, 'ReactDOM was loaded before React. Make sure you load the React package before loading ReactDOM.') : void 0;
-
-var invokeGuardedCallbackImpl = function (name, func, context, a, b, c, d, e, f) {
- var funcArgs = Array.prototype.slice.call(arguments, 3);
- try {
- func.apply(context, funcArgs);
- } catch (error) {
- this.onError(error);
- }
-};
-
-{
- // In DEV mode, we swap out invokeGuardedCallback for a special version
- // that plays more nicely with the browser's DevTools. The idea is to preserve
- // "Pause on exceptions" behavior. Because React wraps all user-provided
- // functions in invokeGuardedCallback, and the production version of
- // invokeGuardedCallback uses a try-catch, all user exceptions are treated
- // like caught exceptions, and the DevTools won't pause unless the developer
- // takes the extra step of enabling pause on caught exceptions. This is
- // untintuitive, though, because even though React has caught the error, from
- // the developer's perspective, the error is uncaught.
- //
- // To preserve the expected "Pause on exceptions" behavior, we don't use a
- // try-catch in DEV. Instead, we synchronously dispatch a fake event to a fake
- // DOM node, and call the user-provided callback from inside an event handler
- // for that fake event. If the callback throws, the error is "captured" using
- // a global event handler. But because the error happens in a different
- // event loop context, it does not interrupt the normal program flow.
- // Effectively, this gives us try-catch behavior without actually using
- // try-catch. Neat!
-
- // Check that the browser supports the APIs we need to implement our special
- // DEV version of invokeGuardedCallback
- if (typeof window !== 'undefined' && typeof window.dispatchEvent === 'function' && typeof document !== 'undefined' && typeof document.createEvent === 'function') {
- var fakeNode = document.createElement('react');
-
- var invokeGuardedCallbackDev = function (name, func, context, a, b, c, d, e, f) {
- // If document doesn't exist we know for sure we will crash in this method
- // when we call document.createEvent(). However this can cause confusing
- // errors: https://github.com/facebookincubator/create-react-app/issues/3482
- // So we preemptively throw with a better message instead.
- !(typeof document !== 'undefined') ? invariant(false, 'The `document` global was defined when React was initialized, but is not defined anymore. This can happen in a test environment if a component schedules an update from an asynchronous callback, but the test has already finished running. To solve this, you can either unmount the component at the end of your test (and ensure that any asynchronous operations get canceled in `componentWillUnmount`), or you can change the test itself to be asynchronous.') : void 0;
- var evt = document.createEvent('Event');
-
- // Keeps track of whether the user-provided callback threw an error. We
- // set this to true at the beginning, then set it to false right after
- // calling the function. If the function errors, `didError` will never be
- // set to false. This strategy works even if the browser is flaky and
- // fails to call our global error handler, because it doesn't rely on
- // the error event at all.
- var didError = true;
-
- // Keeps track of the value of window.event so that we can reset it
- // during the callback to let user code access window.event in the
- // browsers that support it.
- var windowEvent = window.event;
-
- // Create an event handler for our fake event. We will synchronously
- // dispatch our fake event using `dispatchEvent`. Inside the handler, we
- // call the user-provided callback.
- var funcArgs = Array.prototype.slice.call(arguments, 3);
- function callCallback() {
- // We immediately remove the callback from event listeners so that
- // nested `invokeGuardedCallback` calls do not clash. Otherwise, a
- // nested call would trigger the fake event handlers of any call higher
- // in the stack.
- fakeNode.removeEventListener(evtType, callCallback, false);
-
- // We check for window.hasOwnProperty('event') to prevent the
- // window.event assignment in both IE <= 10 as they throw an error
- // "Member not found" in strict mode, and in Firefox which does not
- // support window.event.
- if (typeof window.event !== 'undefined' && window.hasOwnProperty('event')) {
- window.event = windowEvent;
- }
-
- func.apply(context, funcArgs);
- didError = false;
- }
-
- // Create a global error event handler. We use this to capture the value
- // that was thrown. It's possible that this error handler will fire more
- // than once; for example, if non-React code also calls `dispatchEvent`
- // and a handler for that event throws. We should be resilient to most of
- // those cases. Even if our error event handler fires more than once, the
- // last error event is always used. If the callback actually does error,
- // we know that the last error event is the correct one, because it's not
- // possible for anything else to have happened in between our callback
- // erroring and the code that follows the `dispatchEvent` call below. If
- // the callback doesn't error, but the error event was fired, we know to
- // ignore it because `didError` will be false, as described above.
- var error = void 0;
- // Use this to track whether the error event is ever called.
- var didSetError = false;
- var isCrossOriginError = false;
-
- function handleWindowError(event) {
- error = event.error;
- didSetError = true;
- if (error === null && event.colno === 0 && event.lineno === 0) {
- isCrossOriginError = true;
- }
- if (event.defaultPrevented) {
- // Some other error handler has prevented default.
- // Browsers silence the error report if this happens.
- // We'll remember this to later decide whether to log it or not.
- if (error != null && typeof error === 'object') {
- try {
- error._suppressLogging = true;
- } catch (inner) {
- // Ignore.
- }
- }
- }
- }
-
- // Create a fake event type.
- var evtType = 'react-' + (name ? name : 'invokeguardedcallback');
-
- // Attach our event handlers
- window.addEventListener('error', handleWindowError);
- fakeNode.addEventListener(evtType, callCallback, false);
-
- // Synchronously dispatch our fake event. If the user-provided function
- // errors, it will trigger our global error handler.
- evt.initEvent(evtType, false, false);
- fakeNode.dispatchEvent(evt);
-
- if (didError) {
- if (!didSetError) {
- // The callback errored, but the error event never fired.
- error = new Error('An error was thrown inside one of your components, but React ' + "doesn't know what it was. This is likely due to browser " + 'flakiness. React does its best to preserve the "Pause on ' + 'exceptions" behavior of the DevTools, which requires some ' + "DEV-mode only tricks. It's possible that these don't work in " + 'your browser. Try triggering the error in production mode, ' + 'or switching to a modern browser. If you suspect that this is ' + 'actually an issue with React, please file an issue.');
- } else if (isCrossOriginError) {
- error = new Error("A cross-origin error was thrown. React doesn't have access to " + 'the actual error object in development. ' + 'See https://fb.me/react-crossorigin-error for more information.');
- }
- this.onError(error);
- }
-
- // Remove our event listeners
- window.removeEventListener('error', handleWindowError);
- };
-
- invokeGuardedCallbackImpl = invokeGuardedCallbackDev;
- }
-}
-
-var invokeGuardedCallbackImpl$1 = invokeGuardedCallbackImpl;
-
-// Used by Fiber to simulate a try-catch.
-var hasError = false;
-var caughtError = null;
-
-// Used by event system to capture/rethrow the first error.
-var hasRethrowError = false;
-var rethrowError = null;
-
-var reporter = {
- onError: function (error) {
- hasError = true;
- caughtError = error;
- }
-};
-
-/**
- * Call a function while guarding against errors that happens within it.
- * Returns an error if it throws, otherwise null.
- *
- * In production, this is implemented using a try-catch. The reason we don't
- * use a try-catch directly is so that we can swap out a different
- * implementation in DEV mode.
- *
- * @param {String} name of the guard to use for logging or debugging
- * @param {Function} func The function to invoke
- * @param {*} context The context to use when calling the function
- * @param {...*} args Arguments for function
- */
-function invokeGuardedCallback(name, func, context, a, b, c, d, e, f) {
- hasError = false;
- caughtError = null;
- invokeGuardedCallbackImpl$1.apply(reporter, arguments);
-}
-
-/**
- * Same as invokeGuardedCallback, but instead of returning an error, it stores
- * it in a global so it can be rethrown by `rethrowCaughtError` later.
- * TODO: See if caughtError and rethrowError can be unified.
- *
- * @param {String} name of the guard to use for logging or debugging
- * @param {Function} func The function to invoke
- * @param {*} context The context to use when calling the function
- * @param {...*} args Arguments for function
- */
-function invokeGuardedCallbackAndCatchFirstError(name, func, context, a, b, c, d, e, f) {
- invokeGuardedCallback.apply(this, arguments);
- if (hasError) {
- var error = clearCaughtError();
- if (!hasRethrowError) {
- hasRethrowError = true;
- rethrowError = error;
- }
- }
-}
-
-/**
- * During execution of guarded functions we will capture the first error which
- * we will rethrow to be handled by the top level error handler.
- */
-function rethrowCaughtError() {
- if (hasRethrowError) {
- var error = rethrowError;
- hasRethrowError = false;
- rethrowError = null;
- throw error;
- }
-}
-
-function hasCaughtError() {
- return hasError;
-}
-
-function clearCaughtError() {
- if (hasError) {
- var error = caughtError;
- hasError = false;
- caughtError = null;
- return error;
- } else {
- invariant(false, 'clearCaughtError was called but no error was captured. This error is likely caused by a bug in React. Please file an issue.');
- }
-}
-
-/**
- * Injectable ordering of event plugins.
- */
-var eventPluginOrder = null;
-
-/**
- * Injectable mapping from names to event plugin modules.
- */
-var namesToPlugins = {};
-
-/**
- * Recomputes the plugin list using the injected plugins and plugin ordering.
- *
- * @private
- */
-function recomputePluginOrdering() {
- if (!eventPluginOrder) {
- // Wait until an `eventPluginOrder` is injected.
- return;
- }
- for (var pluginName in namesToPlugins) {
- var pluginModule = namesToPlugins[pluginName];
- var pluginIndex = eventPluginOrder.indexOf(pluginName);
- !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;
- if (plugins[pluginIndex]) {
- continue;
- }
- !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;
- plugins[pluginIndex] = pluginModule;
- var publishedEvents = pluginModule.eventTypes;
- for (var eventName in publishedEvents) {
- !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;
- }
- }
-}
-
-/**
- * Publishes an event so that it can be dispatched by the supplied plugin.
- *
- * @param {object} dispatchConfig Dispatch configuration for the event.
- * @param {object} PluginModule Plugin publishing the event.
- * @return {boolean} True if the event was successfully published.
- * @private
- */
-function publishEventForPlugin(dispatchConfig, pluginModule, eventName) {
- !!eventNameDispatchConfigs.hasOwnProperty(eventName) ? invariant(false, 'EventPluginHub: More than one plugin attempted to publish the same event name, `%s`.', eventName) : void 0;
- eventNameDispatchConfigs[eventName] = dispatchConfig;
-
- var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames;
- if (phasedRegistrationNames) {
- for (var phaseName in phasedRegistrationNames) {
- if (phasedRegistrationNames.hasOwnProperty(phaseName)) {
- var phasedRegistrationName = phasedRegistrationNames[phaseName];
- publishRegistrationName(phasedRegistrationName, pluginModule, eventName);
- }
- }
- return true;
- } else if (dispatchConfig.registrationName) {
- publishRegistrationName(dispatchConfig.registrationName, pluginModule, eventName);
- return true;
- }
- return false;
-}
-
-/**
- * Publishes a registration name that is used to identify dispatched events.
- *
- * @param {string} registrationName Registration name to add.
- * @param {object} PluginModule Plugin publishing the event.
- * @private
- */
-function publishRegistrationName(registrationName, pluginModule, eventName) {
- !!registrationNameModules[registrationName] ? invariant(false, 'EventPluginHub: More than one plugin attempted to publish the same registration name, `%s`.', registrationName) : void 0;
- registrationNameModules[registrationName] = pluginModule;
- registrationNameDependencies[registrationName] = pluginModule.eventTypes[eventName].dependencies;
-
- {
- var lowerCasedName = registrationName.toLowerCase();
- possibleRegistrationNames[lowerCasedName] = registrationName;
-
- if (registrationName === 'onDoubleClick') {
- possibleRegistrationNames.ondblclick = registrationName;
- }
- }
-}
-
-/**
- * Registers plugins so that they can extract and dispatch events.
- *
- * @see {EventPluginHub}
- */
-
-/**
- * Ordered list of injected plugins.
- */
-var plugins = [];
-
-/**
- * Mapping from event name to dispatch config
- */
-var eventNameDispatchConfigs = {};
-
-/**
- * Mapping from registration name to plugin module
- */
-var registrationNameModules = {};
-
-/**
- * Mapping from registration name to event name
- */
-var registrationNameDependencies = {};
-
-/**
- * Mapping from lowercase registration names to the properly cased version,
- * used to warn in the case of missing event handlers. Available
- * only in true.
- * @type {Object}
- */
-var possibleRegistrationNames = {};
-// Trust the developer to only use possibleRegistrationNames in true
-
-/**
- * Injects an ordering of plugins (by plugin name). This allows the ordering
- * to be decoupled from injection of the actual plugins so that ordering is
- * always deterministic regardless of packaging, on-the-fly injection, etc.
- *
- * @param {array} InjectedEventPluginOrder
- * @internal
- * @see {EventPluginHub.injection.injectEventPluginOrder}
- */
-function injectEventPluginOrder(injectedEventPluginOrder) {
- !!eventPluginOrder ? invariant(false, 'EventPluginRegistry: Cannot inject event plugin ordering more than once. You are likely trying to load more than one copy of React.') : void 0;
- // Clone the ordering so it cannot be dynamically mutated.
- eventPluginOrder = Array.prototype.slice.call(injectedEventPluginOrder);
- recomputePluginOrdering();
-}
-
-/**
- * Injects plugins to be used by `EventPluginHub`. The plugin names must be
- * in the ordering injected by `injectEventPluginOrder`.
- *
- * Plugins can be injected as part of page initialization or on-the-fly.
- *
- * @param {object} injectedNamesToPlugins Map from names to plugin modules.
- * @internal
- * @see {EventPluginHub.injection.injectEventPluginsByName}
- */
-function injectEventPluginsByName(injectedNamesToPlugins) {
- var isOrderingDirty = false;
- for (var pluginName in injectedNamesToPlugins) {
- if (!injectedNamesToPlugins.hasOwnProperty(pluginName)) {
- continue;
- }
- var pluginModule = injectedNamesToPlugins[pluginName];
- if (!namesToPlugins.hasOwnProperty(pluginName) || namesToPlugins[pluginName] !== pluginModule) {
- !!namesToPlugins[pluginName] ? invariant(false, 'EventPluginRegistry: Cannot inject two different event plugins using the same name, `%s`.', pluginName) : void 0;
- namesToPlugins[pluginName] = pluginModule;
- isOrderingDirty = true;
- }
- }
- if (isOrderingDirty) {
- recomputePluginOrdering();
- }
-}
-
-/**
- * Similar to invariant but only logs a warning if the condition is not met.
- * This can be used to log issues in development environments in critical
- * paths. Removing the logging code for production environments will keep the
- * same logic and follow the same code paths.
- */
-
-var warningWithoutStack = function () {};
-
-{
- warningWithoutStack = function (condition, format) {
- for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
- args[_key - 2] = arguments[_key];
- }
-
- if (format === undefined) {
- throw new Error('`warningWithoutStack(condition, format, ...args)` requires a warning ' + 'message argument');
- }
- if (args.length > 8) {
- // Check before the condition to catch violations early.
- throw new Error('warningWithoutStack() currently supports at most 8 arguments.');
- }
- if (condition) {
- return;
- }
- if (typeof console !== 'undefined') {
- var _args$map = args.map(function (item) {
- return '' + item;
- }),
- a = _args$map[0],
- b = _args$map[1],
- c = _args$map[2],
- d = _args$map[3],
- e = _args$map[4],
- f = _args$map[5],
- g = _args$map[6],
- h = _args$map[7];
-
- var message = 'Warning: ' + format;
-
- // We intentionally don't use spread (or .apply) because it breaks IE9:
- // https://github.com/facebook/react/issues/13610
- switch (args.length) {
- case 0:
- console.error(message);
- break;
- case 1:
- console.error(message, a);
- break;
- case 2:
- console.error(message, a, b);
- break;
- case 3:
- console.error(message, a, b, c);
- break;
- case 4:
- console.error(message, a, b, c, d);
- break;
- case 5:
- console.error(message, a, b, c, d, e);
- break;
- case 6:
- console.error(message, a, b, c, d, e, f);
- break;
- case 7:
- console.error(message, a, b, c, d, e, f, g);
- break;
- case 8:
- console.error(message, a, b, c, d, e, f, g, h);
- break;
- default:
- throw new Error('warningWithoutStack() currently supports at most 8 arguments.');
- }
- }
- try {
- // --- Welcome to debugging React ---
- // This error was thrown as a convenience so that you can use this stack
- // to find the callsite that caused this warning to fire.
- var argIndex = 0;
- var _message = 'Warning: ' + format.replace(/%s/g, function () {
- return args[argIndex++];
- });
- throw new Error(_message);
- } catch (x) {}
- };
-}
-
-var warningWithoutStack$1 = warningWithoutStack;
-
-var getFiberCurrentPropsFromNode = null;
-var getInstanceFromNode = null;
-var getNodeFromInstance = null;
-
-function setComponentTree(getFiberCurrentPropsFromNodeImpl, getInstanceFromNodeImpl, getNodeFromInstanceImpl) {
- getFiberCurrentPropsFromNode = getFiberCurrentPropsFromNodeImpl;
- getInstanceFromNode = getInstanceFromNodeImpl;
- getNodeFromInstance = getNodeFromInstanceImpl;
- {
- !(getNodeFromInstance && getInstanceFromNode) ? warningWithoutStack$1(false, 'EventPluginUtils.setComponentTree(...): Injected ' + 'module is missing getNodeFromInstance or getInstanceFromNode.') : void 0;
- }
-}
-
-var validateEventDispatches = void 0;
-{
- validateEventDispatches = function (event) {
- var dispatchListeners = event._dispatchListeners;
- var dispatchInstances = event._dispatchInstances;
-
- var listenersIsArr = Array.isArray(dispatchListeners);
- var listenersLen = listenersIsArr ? dispatchListeners.length : dispatchListeners ? 1 : 0;
-
- var instancesIsArr = Array.isArray(dispatchInstances);
- var instancesLen = instancesIsArr ? dispatchInstances.length : dispatchInstances ? 1 : 0;
-
- !(instancesIsArr === listenersIsArr && instancesLen === listenersLen) ? warningWithoutStack$1(false, 'EventPluginUtils: Invalid `event`.') : void 0;
- };
-}
-
-/**
- * Dispatch the event to the listener.
- * @param {SyntheticEvent} event SyntheticEvent to handle
- * @param {boolean} simulated If the event is simulated (changes exn behavior)
- * @param {function} listener Application-level callback
- * @param {*} inst Internal component instance
- */
-function executeDispatch(event, simulated, listener, inst) {
- var type = event.type || 'unknown-event';
- event.currentTarget = getNodeFromInstance(inst);
- invokeGuardedCallbackAndCatchFirstError(type, listener, undefined, event);
- event.currentTarget = null;
-}
-
-/**
- * Standard/simple iteration through an event's collected dispatches.
- */
-function executeDispatchesInOrder(event, simulated) {
- var dispatchListeners = event._dispatchListeners;
- var dispatchInstances = event._dispatchInstances;
- {
- validateEventDispatches(event);
- }
- if (Array.isArray(dispatchListeners)) {
- for (var i = 0; i < dispatchListeners.length; i++) {
- if (event.isPropagationStopped()) {
- break;
- }
- // Listeners and Instances are two parallel arrays that are always in sync.
- executeDispatch(event, simulated, dispatchListeners[i], dispatchInstances[i]);
- }
- } else if (dispatchListeners) {
- executeDispatch(event, simulated, dispatchListeners, dispatchInstances);
- }
- event._dispatchListeners = null;
- event._dispatchInstances = null;
-}
-
-/**
- * @see executeDispatchesInOrderStopAtTrueImpl
- */
-
-
-/**
- * Execution of a "direct" dispatch - there must be at most one dispatch
- * accumulated on the event or it is considered an error. It doesn't really make
- * sense for an event with multiple dispatches (bubbled) to keep track of the
- * return values at each dispatch execution, but it does tend to make sense when
- * dealing with "direct" dispatches.
- *
- * @return {*} The return value of executing the single dispatch.
- */
-
-
-/**
- * @param {SyntheticEvent} event
- * @return {boolean} True iff number of dispatches accumulated is greater than 0.
- */
-
-/**
- * Accumulates items that must not be null or undefined into the first one. This
- * is used to conserve memory by avoiding array allocations, and thus sacrifices
- * API cleanness. Since `current` can be null before being passed in and not
- * null after this function, make sure to assign it back to `current`:
- *
- * `a = accumulateInto(a, b);`
- *
- * This API should be sparingly used. Try `accumulate` for something cleaner.
- *
- * @return {*|array<*>} An accumulation of items.
- */
-
-function accumulateInto(current, next) {
- !(next != null) ? invariant(false, 'accumulateInto(...): Accumulated items must not be null or undefined.') : void 0;
-
- if (current == null) {
- return next;
- }
-
- // Both are not empty. Warning: Never call x.concat(y) when you are not
- // certain that x is an Array (x could be a string with concat method).
- if (Array.isArray(current)) {
- if (Array.isArray(next)) {
- current.push.apply(current, next);
- return current;
- }
- current.push(next);
- return current;
- }
-
- if (Array.isArray(next)) {
- // A bit too dangerous to mutate `next`.
- return [current].concat(next);
- }
-
- return [current, next];
-}
-
-/**
- * @param {array} arr an "accumulation" of items which is either an Array or
- * a single item. Useful when paired with the `accumulate` module. This is a
- * simple utility that allows us to reason about a collection of items, but
- * handling the case when there is exactly one item (and we do not need to
- * allocate an array).
- * @param {function} cb Callback invoked with each element or a collection.
- * @param {?} [scope] Scope used as `this` in a callback.
- */
-function forEachAccumulated(arr, cb, scope) {
- if (Array.isArray(arr)) {
- arr.forEach(cb, scope);
- } else if (arr) {
- cb.call(scope, arr);
- }
-}
-
-/**
- * Internal queue of events that have accumulated their dispatches and are
- * waiting to have their dispatches executed.
- */
-var eventQueue = null;
-
-/**
- * Dispatches an event and releases it back into the pool, unless persistent.
- *
- * @param {?object} event Synthetic event to be dispatched.
- * @param {boolean} simulated If the event is simulated (changes exn behavior)
- * @private
- */
-var executeDispatchesAndRelease = function (event, simulated) {
- if (event) {
- executeDispatchesInOrder(event, simulated);
-
- if (!event.isPersistent()) {
- event.constructor.release(event);
- }
- }
-};
-var executeDispatchesAndReleaseSimulated = function (e) {
- return executeDispatchesAndRelease(e, true);
-};
-var executeDispatchesAndReleaseTopLevel = function (e) {
- return executeDispatchesAndRelease(e, false);
-};
-
-function isInteractive(tag) {
- return tag === 'button' || tag === 'input' || tag === 'select' || tag === 'textarea';
-}
-
-function shouldPreventMouseEvent(name, type, props) {
- switch (name) {
- case 'onClick':
- case 'onClickCapture':
- case 'onDoubleClick':
- case 'onDoubleClickCapture':
- case 'onMouseDown':
- case 'onMouseDownCapture':
- case 'onMouseMove':
- case 'onMouseMoveCapture':
- case 'onMouseUp':
- case 'onMouseUpCapture':
- return !!(props.disabled && isInteractive(type));
- default:
- return false;
- }
-}
-
-/**
- * This is a unified interface for event plugins to be installed and configured.
- *
- * Event plugins can implement the following properties:
- *
- * `extractEvents` {function(string, DOMEventTarget, string, object): *}
- * Required. When a top-level event is fired, this method is expected to
- * extract synthetic events that will in turn be queued and dispatched.
- *
- * `eventTypes` {object}
- * Optional, plugins that fire events must publish a mapping of registration
- * names that are used to register listeners. Values of this mapping must
- * be objects that contain `registrationName` or `phasedRegistrationNames`.
- *
- * `executeDispatch` {function(object, function, string)}
- * Optional, allows plugins to override how an event gets dispatched. By
- * default, the listener is simply invoked.
- *
- * Each plugin that is injected into `EventsPluginHub` is immediately operable.
- *
- * @public
- */
-
-/**
- * Methods for injecting dependencies.
- */
-var injection = {
- /**
- * @param {array} InjectedEventPluginOrder
- * @public
- */
- injectEventPluginOrder: injectEventPluginOrder,
-
- /**
- * @param {object} injectedNamesToPlugins Map from names to plugin modules.
- */
- injectEventPluginsByName: injectEventPluginsByName
-};
-
-/**
- * @param {object} inst The instance, which is the source of events.
- * @param {string} registrationName Name of listener (e.g. `onClick`).
- * @return {?function} The stored callback.
- */
-function getListener(inst, registrationName) {
- var listener = void 0;
-
- // TODO: shouldPreventMouseEvent is DOM-specific and definitely should not
- // live here; needs to be moved to a better place soon
- var stateNode = inst.stateNode;
- if (!stateNode) {
- // Work in progress (ex: onload events in incremental mode).
- return null;
- }
- var props = getFiberCurrentPropsFromNode(stateNode);
- if (!props) {
- // Work in progress.
- return null;
- }
- listener = props[registrationName];
- if (shouldPreventMouseEvent(registrationName, inst.type, props)) {
- return null;
- }
- !(!listener || typeof listener === 'function') ? invariant(false, 'Expected `%s` listener to be a function, instead got a value of `%s` type.', registrationName, typeof listener) : void 0;
- return listener;
-}
-
-/**
- * Allows registered plugins an opportunity to extract events from top-level
- * native browser events.
- *
- * @return {*} An accumulation of synthetic events.
- * @internal
- */
-function extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget) {
- var events = null;
- for (var i = 0; i < plugins.length; i++) {
- // Not every plugin in the ordering may be loaded at runtime.
- var possiblePlugin = plugins[i];
- if (possiblePlugin) {
- var extractedEvents = possiblePlugin.extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget);
- if (extractedEvents) {
- events = accumulateInto(events, extractedEvents);
- }
- }
- }
- return events;
-}
-
-function runEventsInBatch(events, simulated) {
- if (events !== null) {
- eventQueue = accumulateInto(eventQueue, events);
- }
-
- // Set `eventQueue` to null before processing it so that we can tell if more
- // events get enqueued while processing.
- var processingEventQueue = eventQueue;
- eventQueue = null;
-
- if (!processingEventQueue) {
- return;
- }
-
- if (simulated) {
- forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseSimulated);
- } else {
- forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseTopLevel);
- }
- !!eventQueue ? invariant(false, 'processEventQueue(): Additional events were enqueued while processing an event queue. Support for this has not yet been implemented.') : void 0;
- // This would be a good time to rethrow if any of the event handlers threw.
- rethrowCaughtError();
-}
-
-function runExtractedEventsInBatch(topLevelType, targetInst, nativeEvent, nativeEventTarget) {
- var events = extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget);
- runEventsInBatch(events, false);
-}
-
-var FunctionalComponent = 0;
-var FunctionalComponentLazy = 1;
-var ClassComponent = 2;
-var ClassComponentLazy = 3;
-var IndeterminateComponent = 4; // Before we know whether it is functional or class
-var HostRoot = 5; // Root of a host tree. Could be nested inside another node.
-var HostPortal = 6; // A subtree. Could be an entry point to a different renderer.
-var HostComponent = 7;
-var HostText = 8;
-var Fragment = 9;
-var Mode = 10;
-var ContextConsumer = 11;
-var ContextProvider = 12;
-var ForwardRef = 13;
-var ForwardRefLazy = 14;
-var Profiler = 15;
-var PlaceholderComponent = 16;
-
-var randomKey = Math.random().toString(36).slice(2);
-var internalInstanceKey = '__reactInternalInstance$' + randomKey;
-var internalEventHandlersKey = '__reactEventHandlers$' + randomKey;
-
-function precacheFiberNode(hostInst, node) {
- node[internalInstanceKey] = hostInst;
-}
-
-/**
- * Given a DOM node, return the closest ReactDOMComponent or
- * ReactDOMTextComponent instance ancestor.
- */
-function getClosestInstanceFromNode(node) {
- if (node[internalInstanceKey]) {
- return node[internalInstanceKey];
- }
-
- while (!node[internalInstanceKey]) {
- if (node.parentNode) {
- node = node.parentNode;
- } else {
- // Top of the tree. This node must not be part of a React tree (or is
- // unmounted, potentially).
- return null;
- }
- }
-
- var inst = node[internalInstanceKey];
- if (inst.tag === HostComponent || inst.tag === HostText) {
- // In Fiber, this will always be the deepest root.
- return inst;
- }
-
- return null;
-}
-
-/**
- * Given a DOM node, return the ReactDOMComponent or ReactDOMTextComponent
- * instance, or null if the node was not rendered by this React.
- */
-function getInstanceFromNode$1(node) {
- var inst = node[internalInstanceKey];
- if (inst) {
- if (inst.tag === HostComponent || inst.tag === HostText) {
- return inst;
- } else {
- return null;
- }
- }
- return null;
-}
-
-/**
- * Given a ReactDOMComponent or ReactDOMTextComponent, return the corresponding
- * DOM node.
- */
-function getNodeFromInstance$1(inst) {
- if (inst.tag === HostComponent || inst.tag === HostText) {
- // In Fiber this, is just the state node right now. We assume it will be
- // a host component or host text.
- return inst.stateNode;
- }
-
- // Without this first invariant, passing a non-DOM-component triggers the next
- // invariant for a missing parent, which is super confusing.
- invariant(false, 'getNodeFromInstance: Invalid argument.');
-}
-
-function getFiberCurrentPropsFromNode$1(node) {
- return node[internalEventHandlersKey] || null;
-}
-
-function updateFiberProps(node, props) {
- node[internalEventHandlersKey] = props;
-}
-
-function getParent(inst) {
- do {
- inst = inst.return;
- // TODO: If this is a HostRoot we might want to bail out.
- // That is depending on if we want nested subtrees (layers) to bubble
- // events to their parent. We could also go through parentNode on the
- // host node but that wouldn't work for React Native and doesn't let us
- // do the portal feature.
- } while (inst && inst.tag !== HostComponent);
- if (inst) {
- return inst;
- }
- return null;
-}
-
-/**
- * Return the lowest common ancestor of A and B, or null if they are in
- * different trees.
- */
-function getLowestCommonAncestor(instA, instB) {
- var depthA = 0;
- for (var tempA = instA; tempA; tempA = getParent(tempA)) {
- depthA++;
- }
- var depthB = 0;
- for (var tempB = instB; tempB; tempB = getParent(tempB)) {
- depthB++;
- }
-
- // If A is deeper, crawl up.
- while (depthA - depthB > 0) {
- instA = getParent(instA);
- depthA--;
- }
-
- // If B is deeper, crawl up.
- while (depthB - depthA > 0) {
- instB = getParent(instB);
- depthB--;
- }
-
- // Walk in lockstep until we find a match.
- var depth = depthA;
- while (depth--) {
- if (instA === instB || instA === instB.alternate) {
- return instA;
- }
- instA = getParent(instA);
- instB = getParent(instB);
- }
- return null;
-}
-
-/**
- * Return if A is an ancestor of B.
- */
-
-
-/**
- * Return the parent instance of the passed-in instance.
- */
-
-
-/**
- * Simulates the traversal of a two-phase, capture/bubble event dispatch.
- */
-function traverseTwoPhase(inst, fn, arg) {
- var path = [];
- while (inst) {
- path.push(inst);
- inst = getParent(inst);
- }
- var i = void 0;
- for (i = path.length; i-- > 0;) {
- fn(path[i], 'captured', arg);
- }
- for (i = 0; i < path.length; i++) {
- fn(path[i], 'bubbled', arg);
- }
-}
-
-/**
- * Traverses the ID hierarchy and invokes the supplied `cb` on any IDs that
- * should would receive a `mouseEnter` or `mouseLeave` event.
- *
- * Does not invoke the callback on the nearest common ancestor because nothing
- * "entered" or "left" that element.
- */
-function traverseEnterLeave(from, to, fn, argFrom, argTo) {
- var common = from && to ? getLowestCommonAncestor(from, to) : null;
- var pathFrom = [];
- while (true) {
- if (!from) {
- break;
- }
- if (from === common) {
- break;
- }
- var alternate = from.alternate;
- if (alternate !== null && alternate === common) {
- break;
- }
- pathFrom.push(from);
- from = getParent(from);
- }
- var pathTo = [];
- while (true) {
- if (!to) {
- break;
- }
- if (to === common) {
- break;
- }
- var _alternate = to.alternate;
- if (_alternate !== null && _alternate === common) {
- break;
- }
- pathTo.push(to);
- to = getParent(to);
- }
- for (var i = 0; i < pathFrom.length; i++) {
- fn(pathFrom[i], 'bubbled', argFrom);
- }
- for (var _i = pathTo.length; _i-- > 0;) {
- fn(pathTo[_i], 'captured', argTo);
- }
-}
-
-/**
- * Some event types have a notion of different registration names for different
- * "phases" of propagation. This finds listeners by a given phase.
- */
-function listenerAtPhase(inst, event, propagationPhase) {
- var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];
- return getListener(inst, registrationName);
-}
-
-/**
- * A small set of propagation patterns, each of which will accept a small amount
- * of information, and generate a set of "dispatch ready event objects" - which
- * are sets of events that have already been annotated with a set of dispatched
- * listener functions/ids. The API is designed this way to discourage these
- * propagation strategies from actually executing the dispatches, since we
- * always want to collect the entire set of dispatches before executing even a
- * single one.
- */
-
-/**
- * Tags a `SyntheticEvent` with dispatched listeners. Creating this function
- * here, allows us to not have to bind or create functions for each event.
- * Mutating the event's members allows us to not have to create a wrapping
- * "dispatch" object that pairs the event with the listener.
- */
-function accumulateDirectionalDispatches(inst, phase, event) {
- {
- !inst ? warningWithoutStack$1(false, 'Dispatching inst must not be null') : void 0;
- }
- var listener = listenerAtPhase(inst, event, phase);
- if (listener) {
- event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);
- event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);
- }
-}
-
-/**
- * Collect dispatches (must be entirely collected before dispatching - see unit
- * tests). Lazily allocate the array to conserve memory. We must loop through
- * each event and perform the traversal for each one. We cannot perform a
- * single traversal for the entire collection of events because each event may
- * have a different target.
- */
-function accumulateTwoPhaseDispatchesSingle(event) {
- if (event && event.dispatchConfig.phasedRegistrationNames) {
- traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);
- }
-}
-
-/**
- * Accumulates without regard to direction, does not look for phased
- * registration names. Same as `accumulateDirectDispatchesSingle` but without
- * requiring that the `dispatchMarker` be the same as the dispatched ID.
- */
-function accumulateDispatches(inst, ignoredDirection, event) {
- if (inst && event && event.dispatchConfig.registrationName) {
- var registrationName = event.dispatchConfig.registrationName;
- var listener = getListener(inst, registrationName);
- if (listener) {
- event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);
- event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);
- }
- }
-}
-
-/**
- * Accumulates dispatches on an `SyntheticEvent`, but only for the
- * `dispatchMarker`.
- * @param {SyntheticEvent} event
- */
-function accumulateDirectDispatchesSingle(event) {
- if (event && event.dispatchConfig.registrationName) {
- accumulateDispatches(event._targetInst, null, event);
- }
-}
-
-function accumulateTwoPhaseDispatches(events) {
- forEachAccumulated(events, accumulateTwoPhaseDispatchesSingle);
-}
-
-
-
-function accumulateEnterLeaveDispatches(leave, enter, from, to) {
- traverseEnterLeave(from, to, accumulateDispatches, leave, enter);
-}
-
-function accumulateDirectDispatches(events) {
- forEachAccumulated(events, accumulateDirectDispatchesSingle);
-}
-
-var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
-
-// Do not uses the below two methods directly!
-// Instead use constants exported from DOMTopLevelEventTypes in ReactDOM.
-// (It is the only module that is allowed to access these methods.)
-
-function unsafeCastStringToDOMTopLevelType(topLevelType) {
- return topLevelType;
-}
-
-function unsafeCastDOMTopLevelTypeToString(topLevelType) {
- return topLevelType;
-}
-
-/**
- * Generate a mapping of standard vendor prefixes using the defined style property and event name.
- *
- * @param {string} styleProp
- * @param {string} eventName
- * @returns {object}
- */
-function makePrefixMap(styleProp, eventName) {
- var prefixes = {};
-
- prefixes[styleProp.toLowerCase()] = eventName.toLowerCase();
- prefixes['Webkit' + styleProp] = 'webkit' + eventName;
- prefixes['Moz' + styleProp] = 'moz' + eventName;
-
- return prefixes;
-}
-
-/**
- * A list of event names to a configurable list of vendor prefixes.
- */
-var vendorPrefixes = {
- animationend: makePrefixMap('Animation', 'AnimationEnd'),
- animationiteration: makePrefixMap('Animation', 'AnimationIteration'),
- animationstart: makePrefixMap('Animation', 'AnimationStart'),
- transitionend: makePrefixMap('Transition', 'TransitionEnd')
-};
-
-/**
- * Event names that have already been detected and prefixed (if applicable).
- */
-var prefixedEventNames = {};
-
-/**
- * Element to check for prefixes on.
- */
-var style = {};
-
-/**
- * Bootstrap if a DOM exists.
- */
-if (canUseDOM) {
- style = document.createElement('div').style;
-
- // On some platforms, in particular some releases of Android 4.x,
- // the un-prefixed "animation" and "transition" properties are defined on the
- // style object but the events that fire will still be prefixed, so we need
- // to check if the un-prefixed events are usable, and if not remove them from the map.
- if (!('AnimationEvent' in window)) {
- delete vendorPrefixes.animationend.animation;
- delete vendorPrefixes.animationiteration.animation;
- delete vendorPrefixes.animationstart.animation;
- }
-
- // Same as above
- if (!('TransitionEvent' in window)) {
- delete vendorPrefixes.transitionend.transition;
- }
-}
-
-/**
- * Attempts to determine the correct vendor prefixed event name.
- *
- * @param {string} eventName
- * @returns {string}
- */
-function getVendorPrefixedEventName(eventName) {
- if (prefixedEventNames[eventName]) {
- return prefixedEventNames[eventName];
- } else if (!vendorPrefixes[eventName]) {
- return eventName;
- }
-
- var prefixMap = vendorPrefixes[eventName];
-
- for (var styleProp in prefixMap) {
- if (prefixMap.hasOwnProperty(styleProp) && styleProp in style) {
- return prefixedEventNames[eventName] = prefixMap[styleProp];
- }
- }
-
- return eventName;
-}
-
-/**
- * To identify top level events in ReactDOM, we use constants defined by this
- * module. This is the only module that uses the unsafe* methods to express
- * that the constants actually correspond to the browser event names. This lets
- * us save some bundle size by avoiding a top level type -> event name map.
- * The rest of ReactDOM code should import top level types from this file.
- */
-var TOP_ABORT = unsafeCastStringToDOMTopLevelType('abort');
-var TOP_ANIMATION_END = unsafeCastStringToDOMTopLevelType(getVendorPrefixedEventName('animationend'));
-var TOP_ANIMATION_ITERATION = unsafeCastStringToDOMTopLevelType(getVendorPrefixedEventName('animationiteration'));
-var TOP_ANIMATION_START = unsafeCastStringToDOMTopLevelType(getVendorPrefixedEventName('animationstart'));
-var TOP_BLUR = unsafeCastStringToDOMTopLevelType('blur');
-var TOP_CAN_PLAY = unsafeCastStringToDOMTopLevelType('canplay');
-var TOP_CAN_PLAY_THROUGH = unsafeCastStringToDOMTopLevelType('canplaythrough');
-var TOP_CANCEL = unsafeCastStringToDOMTopLevelType('cancel');
-var TOP_CHANGE = unsafeCastStringToDOMTopLevelType('change');
-var TOP_CLICK = unsafeCastStringToDOMTopLevelType('click');
-var TOP_CLOSE = unsafeCastStringToDOMTopLevelType('close');
-var TOP_COMPOSITION_END = unsafeCastStringToDOMTopLevelType('compositionend');
-var TOP_COMPOSITION_START = unsafeCastStringToDOMTopLevelType('compositionstart');
-var TOP_COMPOSITION_UPDATE = unsafeCastStringToDOMTopLevelType('compositionupdate');
-var TOP_CONTEXT_MENU = unsafeCastStringToDOMTopLevelType('contextmenu');
-var TOP_COPY = unsafeCastStringToDOMTopLevelType('copy');
-var TOP_CUT = unsafeCastStringToDOMTopLevelType('cut');
-var TOP_DOUBLE_CLICK = unsafeCastStringToDOMTopLevelType('dblclick');
-var TOP_AUX_CLICK = unsafeCastStringToDOMTopLevelType('auxclick');
-var TOP_DRAG = unsafeCastStringToDOMTopLevelType('drag');
-var TOP_DRAG_END = unsafeCastStringToDOMTopLevelType('dragend');
-var TOP_DRAG_ENTER = unsafeCastStringToDOMTopLevelType('dragenter');
-var TOP_DRAG_EXIT = unsafeCastStringToDOMTopLevelType('dragexit');
-var TOP_DRAG_LEAVE = unsafeCastStringToDOMTopLevelType('dragleave');
-var TOP_DRAG_OVER = unsafeCastStringToDOMTopLevelType('dragover');
-var TOP_DRAG_START = unsafeCastStringToDOMTopLevelType('dragstart');
-var TOP_DROP = unsafeCastStringToDOMTopLevelType('drop');
-var TOP_DURATION_CHANGE = unsafeCastStringToDOMTopLevelType('durationchange');
-var TOP_EMPTIED = unsafeCastStringToDOMTopLevelType('emptied');
-var TOP_ENCRYPTED = unsafeCastStringToDOMTopLevelType('encrypted');
-var TOP_ENDED = unsafeCastStringToDOMTopLevelType('ended');
-var TOP_ERROR = unsafeCastStringToDOMTopLevelType('error');
-var TOP_FOCUS = unsafeCastStringToDOMTopLevelType('focus');
-var TOP_GOT_POINTER_CAPTURE = unsafeCastStringToDOMTopLevelType('gotpointercapture');
-var TOP_INPUT = unsafeCastStringToDOMTopLevelType('input');
-var TOP_INVALID = unsafeCastStringToDOMTopLevelType('invalid');
-var TOP_KEY_DOWN = unsafeCastStringToDOMTopLevelType('keydown');
-var TOP_KEY_PRESS = unsafeCastStringToDOMTopLevelType('keypress');
-var TOP_KEY_UP = unsafeCastStringToDOMTopLevelType('keyup');
-var TOP_LOAD = unsafeCastStringToDOMTopLevelType('load');
-var TOP_LOAD_START = unsafeCastStringToDOMTopLevelType('loadstart');
-var TOP_LOADED_DATA = unsafeCastStringToDOMTopLevelType('loadeddata');
-var TOP_LOADED_METADATA = unsafeCastStringToDOMTopLevelType('loadedmetadata');
-var TOP_LOST_POINTER_CAPTURE = unsafeCastStringToDOMTopLevelType('lostpointercapture');
-var TOP_MOUSE_DOWN = unsafeCastStringToDOMTopLevelType('mousedown');
-var TOP_MOUSE_MOVE = unsafeCastStringToDOMTopLevelType('mousemove');
-var TOP_MOUSE_OUT = unsafeCastStringToDOMTopLevelType('mouseout');
-var TOP_MOUSE_OVER = unsafeCastStringToDOMTopLevelType('mouseover');
-var TOP_MOUSE_UP = unsafeCastStringToDOMTopLevelType('mouseup');
-var TOP_PASTE = unsafeCastStringToDOMTopLevelType('paste');
-var TOP_PAUSE = unsafeCastStringToDOMTopLevelType('pause');
-var TOP_PLAY = unsafeCastStringToDOMTopLevelType('play');
-var TOP_PLAYING = unsafeCastStringToDOMTopLevelType('playing');
-var TOP_POINTER_CANCEL = unsafeCastStringToDOMTopLevelType('pointercancel');
-var TOP_POINTER_DOWN = unsafeCastStringToDOMTopLevelType('pointerdown');
-
-
-var TOP_POINTER_MOVE = unsafeCastStringToDOMTopLevelType('pointermove');
-var TOP_POINTER_OUT = unsafeCastStringToDOMTopLevelType('pointerout');
-var TOP_POINTER_OVER = unsafeCastStringToDOMTopLevelType('pointerover');
-var TOP_POINTER_UP = unsafeCastStringToDOMTopLevelType('pointerup');
-var TOP_PROGRESS = unsafeCastStringToDOMTopLevelType('progress');
-var TOP_RATE_CHANGE = unsafeCastStringToDOMTopLevelType('ratechange');
-var TOP_RESET = unsafeCastStringToDOMTopLevelType('reset');
-var TOP_SCROLL = unsafeCastStringToDOMTopLevelType('scroll');
-var TOP_SEEKED = unsafeCastStringToDOMTopLevelType('seeked');
-var TOP_SEEKING = unsafeCastStringToDOMTopLevelType('seeking');
-var TOP_SELECTION_CHANGE = unsafeCastStringToDOMTopLevelType('selectionchange');
-var TOP_STALLED = unsafeCastStringToDOMTopLevelType('stalled');
-var TOP_SUBMIT = unsafeCastStringToDOMTopLevelType('submit');
-var TOP_SUSPEND = unsafeCastStringToDOMTopLevelType('suspend');
-var TOP_TEXT_INPUT = unsafeCastStringToDOMTopLevelType('textInput');
-var TOP_TIME_UPDATE = unsafeCastStringToDOMTopLevelType('timeupdate');
-var TOP_TOGGLE = unsafeCastStringToDOMTopLevelType('toggle');
-var TOP_TOUCH_CANCEL = unsafeCastStringToDOMTopLevelType('touchcancel');
-var TOP_TOUCH_END = unsafeCastStringToDOMTopLevelType('touchend');
-var TOP_TOUCH_MOVE = unsafeCastStringToDOMTopLevelType('touchmove');
-var TOP_TOUCH_START = unsafeCastStringToDOMTopLevelType('touchstart');
-var TOP_TRANSITION_END = unsafeCastStringToDOMTopLevelType(getVendorPrefixedEventName('transitionend'));
-var TOP_VOLUME_CHANGE = unsafeCastStringToDOMTopLevelType('volumechange');
-var TOP_WAITING = unsafeCastStringToDOMTopLevelType('waiting');
-var TOP_WHEEL = unsafeCastStringToDOMTopLevelType('wheel');
-
-// List of events that need to be individually attached to media elements.
-// Note that events in this list will *not* be listened to at the top level
-// unless they're explicitly whitelisted in `ReactBrowserEventEmitter.listenTo`.
-var mediaEventTypes = [TOP_ABORT, TOP_CAN_PLAY, TOP_CAN_PLAY_THROUGH, TOP_DURATION_CHANGE, TOP_EMPTIED, TOP_ENCRYPTED, TOP_ENDED, TOP_ERROR, TOP_LOADED_DATA, TOP_LOADED_METADATA, TOP_LOAD_START, TOP_PAUSE, TOP_PLAY, TOP_PLAYING, TOP_PROGRESS, TOP_RATE_CHANGE, TOP_SEEKED, TOP_SEEKING, TOP_STALLED, TOP_SUSPEND, TOP_TIME_UPDATE, TOP_VOLUME_CHANGE, TOP_WAITING];
-
-function getRawEventName(topLevelType) {
- return unsafeCastDOMTopLevelTypeToString(topLevelType);
-}
-
-/**
- * These variables store information about text content of a target node,
- * allowing comparison of content before and after a given event.
- *
- * Identify the node where selection currently begins, then observe
- * both its text content and its current position in the DOM. Since the
- * browser may natively replace the target node during composition, we can
- * use its position to find its replacement.
- *
- *
- */
-
-var root = null;
-var startText = null;
-var fallbackText = null;
-
-function initialize(nativeEventTarget) {
- root = nativeEventTarget;
- startText = getText();
- return true;
-}
-
-function reset() {
- root = null;
- startText = null;
- fallbackText = null;
-}
-
-function getData() {
- if (fallbackText) {
- return fallbackText;
- }
-
- var start = void 0;
- var startValue = startText;
- var startLength = startValue.length;
- var end = void 0;
- var endValue = getText();
- var endLength = endValue.length;
-
- for (start = 0; start < startLength; start++) {
- if (startValue[start] !== endValue[start]) {
- break;
- }
- }
-
- var minEnd = startLength - start;
- for (end = 1; end <= minEnd; end++) {
- if (startValue[startLength - end] !== endValue[endLength - end]) {
- break;
- }
- }
-
- var sliceTail = end > 1 ? 1 - end : undefined;
- fallbackText = endValue.slice(start, sliceTail);
- return fallbackText;
-}
-
-function getText() {
- if ('value' in root) {
- return root.value;
- }
- return root.textContent;
-}
-
-/* eslint valid-typeof: 0 */
-
-var EVENT_POOL_SIZE = 10;
-
-/**
- * @interface Event
- * @see http://www.w3.org/TR/DOM-Level-3-Events/
- */
-var EventInterface = {
- type: null,
- target: null,
- // currentTarget is set when dispatching; no use in copying it here
- currentTarget: function () {
- return null;
- },
- eventPhase: null,
- bubbles: null,
- cancelable: null,
- timeStamp: function (event) {
- return event.timeStamp || Date.now();
- },
- defaultPrevented: null,
- isTrusted: null
-};
-
-function functionThatReturnsTrue() {
- return true;
-}
-
-function functionThatReturnsFalse() {
- return false;
-}
-
-/**
- * Synthetic events are dispatched by event plugins, typically in response to a
- * top-level event delegation handler.
- *
- * These systems should generally use pooling to reduce the frequency of garbage
- * collection. The system should check `isPersistent` to determine whether the
- * event should be released into the pool after being dispatched. Users that
- * need a persisted event should invoke `persist`.
- *
- * Synthetic events (and subclasses) implement the DOM Level 3 Events API by
- * normalizing browser quirks. Subclasses do not necessarily have to implement a
- * DOM interface; custom application-specific events can also subclass this.
- *
- * @param {object} dispatchConfig Configuration used to dispatch this event.
- * @param {*} targetInst Marker identifying the event target.
- * @param {object} nativeEvent Native browser event.
- * @param {DOMEventTarget} nativeEventTarget Target node.
- */
-function SyntheticEvent(dispatchConfig, targetInst, nativeEvent, nativeEventTarget) {
- {
- // these have a getter/setter for warnings
- delete this.nativeEvent;
- delete this.preventDefault;
- delete this.stopPropagation;
- delete this.isDefaultPrevented;
- delete this.isPropagationStopped;
- }
-
- this.dispatchConfig = dispatchConfig;
- this._targetInst = targetInst;
- this.nativeEvent = nativeEvent;
-
- var Interface = this.constructor.Interface;
- for (var propName in Interface) {
- if (!Interface.hasOwnProperty(propName)) {
- continue;
- }
- {
- delete this[propName]; // this has a getter/setter for warnings
- }
- var normalize = Interface[propName];
- if (normalize) {
- this[propName] = normalize(nativeEvent);
- } else {
- if (propName === 'target') {
- this.target = nativeEventTarget;
- } else {
- this[propName] = nativeEvent[propName];
- }
- }
- }
-
- var defaultPrevented = nativeEvent.defaultPrevented != null ? nativeEvent.defaultPrevented : nativeEvent.returnValue === false;
- if (defaultPrevented) {
- this.isDefaultPrevented = functionThatReturnsTrue;
- } else {
- this.isDefaultPrevented = functionThatReturnsFalse;
- }
- this.isPropagationStopped = functionThatReturnsFalse;
- return this;
-}
-
-_assign(SyntheticEvent.prototype, {
- preventDefault: function () {
- this.defaultPrevented = true;
- var event = this.nativeEvent;
- if (!event) {
- return;
- }
-
- if (event.preventDefault) {
- event.preventDefault();
- } else if (typeof event.returnValue !== 'unknown') {
- event.returnValue = false;
- }
- this.isDefaultPrevented = functionThatReturnsTrue;
- },
-
- stopPropagation: function () {
- var event = this.nativeEvent;
- if (!event) {
- return;
- }
-
- if (event.stopPropagation) {
- event.stopPropagation();
- } else if (typeof event.cancelBubble !== 'unknown') {
- // The ChangeEventPlugin registers a "propertychange" event for
- // IE. This event does not support bubbling or cancelling, and
- // any references to cancelBubble throw "Member not found". A
- // typeof check of "unknown" circumvents this issue (and is also
- // IE specific).
- event.cancelBubble = true;
- }
-
- this.isPropagationStopped = functionThatReturnsTrue;
- },
-
- /**
- * We release all dispatched `SyntheticEvent`s after each event loop, adding
- * them back into the pool. This allows a way to hold onto a reference that
- * won't be added back into the pool.
- */
- persist: function () {
- this.isPersistent = functionThatReturnsTrue;
- },
-
- /**
- * Checks if this event should be released back into the pool.
- *
- * @return {boolean} True if this should not be released, false otherwise.
- */
- isPersistent: functionThatReturnsFalse,
-
- /**
- * `PooledClass` looks for `destructor` on each instance it releases.
- */
- destructor: function () {
- var Interface = this.constructor.Interface;
- for (var propName in Interface) {
- {
- Object.defineProperty(this, propName, getPooledWarningPropertyDefinition(propName, Interface[propName]));
- }
- }
- this.dispatchConfig = null;
- this._targetInst = null;
- this.nativeEvent = null;
- this.isDefaultPrevented = functionThatReturnsFalse;
- this.isPropagationStopped = functionThatReturnsFalse;
- this._dispatchListeners = null;
- this._dispatchInstances = null;
- {
- Object.defineProperty(this, 'nativeEvent', getPooledWarningPropertyDefinition('nativeEvent', null));
- Object.defineProperty(this, 'isDefaultPrevented', getPooledWarningPropertyDefinition('isDefaultPrevented', functionThatReturnsFalse));
- Object.defineProperty(this, 'isPropagationStopped', getPooledWarningPropertyDefinition('isPropagationStopped', functionThatReturnsFalse));
- Object.defineProperty(this, 'preventDefault', getPooledWarningPropertyDefinition('preventDefault', function () {}));
- Object.defineProperty(this, 'stopPropagation', getPooledWarningPropertyDefinition('stopPropagation', function () {}));
- }
- }
-});
-
-SyntheticEvent.Interface = EventInterface;
-
-/**
- * Helper to reduce boilerplate when creating subclasses.
- */
-SyntheticEvent.extend = function (Interface) {
- var Super = this;
-
- var E = function () {};
- E.prototype = Super.prototype;
- var prototype = new E();
-
- function Class() {
- return Super.apply(this, arguments);
- }
- _assign(prototype, Class.prototype);
- Class.prototype = prototype;
- Class.prototype.constructor = Class;
-
- Class.Interface = _assign({}, Super.Interface, Interface);
- Class.extend = Super.extend;
- addEventPoolingTo(Class);
-
- return Class;
-};
-
-addEventPoolingTo(SyntheticEvent);
-
-/**
- * Helper to nullify syntheticEvent instance properties when destructing
- *
- * @param {String} propName
- * @param {?object} getVal
- * @return {object} defineProperty object
- */
-function getPooledWarningPropertyDefinition(propName, getVal) {
- var isFunction = typeof getVal === 'function';
- return {
- configurable: true,
- set: set,
- get: get
- };
-
- function set(val) {
- var action = isFunction ? 'setting the method' : 'setting the property';
- warn(action, 'This is effectively a no-op');
- return val;
- }
-
- function get() {
- var action = isFunction ? 'accessing the method' : 'accessing the property';
- var result = isFunction ? 'This is a no-op function' : 'This is set to null';
- warn(action, result);
- return getVal;
- }
-
- function warn(action, result) {
- var warningCondition = false;
- !warningCondition ? warningWithoutStack$1(false, "This synthetic event is reused for performance reasons. If you're seeing this, " + "you're %s `%s` on a released/nullified synthetic event. %s. " + 'If you must keep the original synthetic event around, use event.persist(). ' + 'See https://fb.me/react-event-pooling for more information.', action, propName, result) : void 0;
- }
-}
-
-function getPooledEvent(dispatchConfig, targetInst, nativeEvent, nativeInst) {
- var EventConstructor = this;
- if (EventConstructor.eventPool.length) {
- var instance = EventConstructor.eventPool.pop();
- EventConstructor.call(instance, dispatchConfig, targetInst, nativeEvent, nativeInst);
- return instance;
- }
- return new EventConstructor(dispatchConfig, targetInst, nativeEvent, nativeInst);
-}
-
-function releasePooledEvent(event) {
- var EventConstructor = this;
- !(event instanceof EventConstructor) ? invariant(false, 'Trying to release an event instance into a pool of a different type.') : void 0;
- event.destructor();
- if (EventConstructor.eventPool.length < EVENT_POOL_SIZE) {
- EventConstructor.eventPool.push(event);
- }
-}
-
-function addEventPoolingTo(EventConstructor) {
- EventConstructor.eventPool = [];
- EventConstructor.getPooled = getPooledEvent;
- EventConstructor.release = releasePooledEvent;
-}
-
-/**
- * @interface Event
- * @see http://www.w3.org/TR/DOM-Level-3-Events/#events-compositionevents
- */
-var SyntheticCompositionEvent = SyntheticEvent.extend({
- data: null
-});
-
-/**
- * @interface Event
- * @see http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105
- * /#events-inputevents
- */
-var SyntheticInputEvent = SyntheticEvent.extend({
- data: null
-});
-
-var END_KEYCODES = [9, 13, 27, 32]; // Tab, Return, Esc, Space
-var START_KEYCODE = 229;
-
-var canUseCompositionEvent = canUseDOM && 'CompositionEvent' in window;
-
-var documentMode = null;
-if (canUseDOM && 'documentMode' in document) {
- documentMode = document.documentMode;
-}
-
-// Webkit offers a very useful `textInput` event that can be used to
-// directly represent `beforeInput`. The IE `textinput` event is not as
-// useful, so we don't use it.
-var canUseTextInputEvent = canUseDOM && 'TextEvent' in window && !documentMode;
-
-// In IE9+, we have access to composition events, but the data supplied
-// by the native compositionend event may be incorrect. Japanese ideographic
-// spaces, for instance (\u3000) are not recorded correctly.
-var useFallbackCompositionData = canUseDOM && (!canUseCompositionEvent || documentMode && documentMode > 8 && documentMode <= 11);
-
-var SPACEBAR_CODE = 32;
-var SPACEBAR_CHAR = String.fromCharCode(SPACEBAR_CODE);
-
-// Events and their corresponding property names.
-var eventTypes = {
- beforeInput: {
- phasedRegistrationNames: {
- bubbled: 'onBeforeInput',
- captured: 'onBeforeInputCapture'
- },
- dependencies: [TOP_COMPOSITION_END, TOP_KEY_PRESS, TOP_TEXT_INPUT, TOP_PASTE]
- },
- compositionEnd: {
- phasedRegistrationNames: {
- bubbled: 'onCompositionEnd',
- captured: 'onCompositionEndCapture'
- },
- dependencies: [TOP_BLUR, TOP_COMPOSITION_END, TOP_KEY_DOWN, TOP_KEY_PRESS, TOP_KEY_UP, TOP_MOUSE_DOWN]
- },
- compositionStart: {
- phasedRegistrationNames: {
- bubbled: 'onCompositionStart',
- captured: 'onCompositionStartCapture'
- },
- dependencies: [TOP_BLUR, TOP_COMPOSITION_START, TOP_KEY_DOWN, TOP_KEY_PRESS, TOP_KEY_UP, TOP_MOUSE_DOWN]
- },
- compositionUpdate: {
- phasedRegistrationNames: {
- bubbled: 'onCompositionUpdate',
- captured: 'onCompositionUpdateCapture'
- },
- dependencies: [TOP_BLUR, TOP_COMPOSITION_UPDATE, TOP_KEY_DOWN, TOP_KEY_PRESS, TOP_KEY_UP, TOP_MOUSE_DOWN]
- }
-};
-
-// Track whether we've ever handled a keypress on the space key.
-var hasSpaceKeypress = false;
-
-/**
- * Return whether a native keypress event is assumed to be a command.
- * This is required because Firefox fires `keypress` events for key commands
- * (cut, copy, select-all, etc.) even though no character is inserted.
- */
-function isKeypressCommand(nativeEvent) {
- return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&
- // ctrlKey && altKey is equivalent to AltGr, and is not a command.
- !(nativeEvent.ctrlKey && nativeEvent.altKey);
-}
-
-/**
- * Translate native top level events into event types.
- *
- * @param {string} topLevelType
- * @return {object}
- */
-function getCompositionEventType(topLevelType) {
- switch (topLevelType) {
- case TOP_COMPOSITION_START:
- return eventTypes.compositionStart;
- case TOP_COMPOSITION_END:
- return eventTypes.compositionEnd;
- case TOP_COMPOSITION_UPDATE:
- return eventTypes.compositionUpdate;
- }
-}
-
-/**
- * Does our fallback best-guess model think this event signifies that
- * composition has begun?
- *
- * @param {string} topLevelType
- * @param {object} nativeEvent
- * @return {boolean}
- */
-function isFallbackCompositionStart(topLevelType, nativeEvent) {
- return topLevelType === TOP_KEY_DOWN && nativeEvent.keyCode === START_KEYCODE;
-}
-
-/**
- * Does our fallback mode think that this event is the end of composition?
- *
- * @param {string} topLevelType
- * @param {object} nativeEvent
- * @return {boolean}
- */
-function isFallbackCompositionEnd(topLevelType, nativeEvent) {
- switch (topLevelType) {
- case TOP_KEY_UP:
- // Command keys insert or clear IME input.
- return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1;
- case TOP_KEY_DOWN:
- // Expect IME keyCode on each keydown. If we get any other
- // code we must have exited earlier.
- return nativeEvent.keyCode !== START_KEYCODE;
- case TOP_KEY_PRESS:
- case TOP_MOUSE_DOWN:
- case TOP_BLUR:
- // Events are not possible without cancelling IME.
- return true;
- default:
- return false;
- }
-}
-
-/**
- * Google Input Tools provides composition data via a CustomEvent,
- * with the `data` property populated in the `detail` object. If this
- * is available on the event object, use it. If not, this is a plain
- * composition event and we have nothing special to extract.
- *
- * @param {object} nativeEvent
- * @return {?string}
- */
-function getDataFromCustomEvent(nativeEvent) {
- var detail = nativeEvent.detail;
- if (typeof detail === 'object' && 'data' in detail) {
- return detail.data;
- }
- return null;
-}
-
-/**
- * Check if a composition event was triggered by Korean IME.
- * Our fallback mode does not work well with IE's Korean IME,
- * so just use native composition events when Korean IME is used.
- * Although CompositionEvent.locale property is deprecated,
- * it is available in IE, where our fallback mode is enabled.
- *
- * @param {object} nativeEvent
- * @return {boolean}
- */
-function isUsingKoreanIME(nativeEvent) {
- return nativeEvent.locale === 'ko';
-}
-
-// Track the current IME composition status, if any.
-var isComposing = false;
-
-/**
- * @return {?object} A SyntheticCompositionEvent.
- */
-function extractCompositionEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget) {
- var eventType = void 0;
- var fallbackData = void 0;
-
- if (canUseCompositionEvent) {
- eventType = getCompositionEventType(topLevelType);
- } else if (!isComposing) {
- if (isFallbackCompositionStart(topLevelType, nativeEvent)) {
- eventType = eventTypes.compositionStart;
- }
- } else if (isFallbackCompositionEnd(topLevelType, nativeEvent)) {
- eventType = eventTypes.compositionEnd;
- }
-
- if (!eventType) {
- return null;
- }
-
- if (useFallbackCompositionData && !isUsingKoreanIME(nativeEvent)) {
- // The current composition is stored statically and must not be
- // overwritten while composition continues.
- if (!isComposing && eventType === eventTypes.compositionStart) {
- isComposing = initialize(nativeEventTarget);
- } else if (eventType === eventTypes.compositionEnd) {
- if (isComposing) {
- fallbackData = getData();
- }
- }
- }
-
- var event = SyntheticCompositionEvent.getPooled(eventType, targetInst, nativeEvent, nativeEventTarget);
-
- if (fallbackData) {
- // Inject data generated from fallback path into the synthetic event.
- // This matches the property of native CompositionEventInterface.
- event.data = fallbackData;
- } else {
- var customData = getDataFromCustomEvent(nativeEvent);
- if (customData !== null) {
- event.data = customData;
- }
- }
-
- accumulateTwoPhaseDispatches(event);
- return event;
-}
-
-/**
- * @param {TopLevelType} topLevelType Number from `TopLevelType`.
- * @param {object} nativeEvent Native browser event.
- * @return {?string} The string corresponding to this `beforeInput` event.
- */
-function getNativeBeforeInputChars(topLevelType, nativeEvent) {
- switch (topLevelType) {
- case TOP_COMPOSITION_END:
- return getDataFromCustomEvent(nativeEvent);
- case TOP_KEY_PRESS:
- /**
- * If native `textInput` events are available, our goal is to make
- * use of them. However, there is a special case: the spacebar key.
- * In Webkit, preventing default on a spacebar `textInput` event
- * cancels character insertion, but it *also* causes the browser
- * to fall back to its default spacebar behavior of scrolling the
- * page.
- *
- * Tracking at:
- * https://code.google.com/p/chromium/issues/detail?id=355103
- *
- * To avoid this issue, use the keypress event as if no `textInput`
- * event is available.
- */
- var which = nativeEvent.which;
- if (which !== SPACEBAR_CODE) {
- return null;
- }
-
- hasSpaceKeypress = true;
- return SPACEBAR_CHAR;
-
- case TOP_TEXT_INPUT:
- // Record the characters to be added to the DOM.
- var chars = nativeEvent.data;
-
- // If it's a spacebar character, assume that we have already handled
- // it at the keypress level and bail immediately. Android Chrome
- // doesn't give us keycodes, so we need to ignore it.
- if (chars === SPACEBAR_CHAR && hasSpaceKeypress) {
- return null;
- }
-
- return chars;
-
- default:
- // For other native event types, do nothing.
- return null;
- }
-}
-
-/**
- * For browsers that do not provide the `textInput` event, extract the
- * appropriate string to use for SyntheticInputEvent.
- *
- * @param {number} topLevelType Number from `TopLevelEventTypes`.
- * @param {object} nativeEvent Native browser event.
- * @return {?string} The fallback string for this `beforeInput` event.
- */
-function getFallbackBeforeInputChars(topLevelType, nativeEvent) {
- // If we are currently composing (IME) and using a fallback to do so,
- // try to extract the composed characters from the fallback object.
- // If composition event is available, we extract a string only at
- // compositionevent, otherwise extract it at fallback events.
- if (isComposing) {
- if (topLevelType === TOP_COMPOSITION_END || !canUseCompositionEvent && isFallbackCompositionEnd(topLevelType, nativeEvent)) {
- var chars = getData();
- reset();
- isComposing = false;
- return chars;
- }
- return null;
- }
-
- switch (topLevelType) {
- case TOP_PASTE:
- // If a paste event occurs after a keypress, throw out the input
- // chars. Paste events should not lead to BeforeInput events.
- return null;
- case TOP_KEY_PRESS:
- /**
- * As of v27, Firefox may fire keypress events even when no character
- * will be inserted. A few possibilities:
- *
- * - `which` is `0`. Arrow keys, Esc key, etc.
- *
- * - `which` is the pressed key code, but no char is available.
- * Ex: 'AltGr + d` in Polish. There is no modified character for
- * this key combination and no character is inserted into the
- * document, but FF fires the keypress for char code `100` anyway.
- * No `input` event will occur.
- *
- * - `which` is the pressed key code, but a command combination is
- * being used. Ex: `Cmd+C`. No character is inserted, and no
- * `input` event will occur.
- */
- if (!isKeypressCommand(nativeEvent)) {
- // IE fires the `keypress` event when a user types an emoji via
- // Touch keyboard of Windows. In such a case, the `char` property
- // holds an emoji character like `\uD83D\uDE0A`. Because its length
- // is 2, the property `which` does not represent an emoji correctly.
- // In such a case, we directly return the `char` property instead of
- // using `which`.
- if (nativeEvent.char && nativeEvent.char.length > 1) {
- return nativeEvent.char;
- } else if (nativeEvent.which) {
- return String.fromCharCode(nativeEvent.which);
- }
- }
- return null;
- case TOP_COMPOSITION_END:
- return useFallbackCompositionData && !isUsingKoreanIME(nativeEvent) ? null : nativeEvent.data;
- default:
- return null;
- }
-}
-
-/**
- * Extract a SyntheticInputEvent for `beforeInput`, based on either native
- * `textInput` or fallback behavior.
- *
- * @return {?object} A SyntheticInputEvent.
- */
-function extractBeforeInputEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget) {
- var chars = void 0;
-
- if (canUseTextInputEvent) {
- chars = getNativeBeforeInputChars(topLevelType, nativeEvent);
- } else {
- chars = getFallbackBeforeInputChars(topLevelType, nativeEvent);
- }
-
- // If no characters are being inserted, no BeforeInput event should
- // be fired.
- if (!chars) {
- return null;
- }
-
- var event = SyntheticInputEvent.getPooled(eventTypes.beforeInput, targetInst, nativeEvent, nativeEventTarget);
-
- event.data = chars;
- accumulateTwoPhaseDispatches(event);
- return event;
-}
-
-/**
- * Create an `onBeforeInput` event to match
- * http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105/#events-inputevents.
- *
- * This event plugin is based on the native `textInput` event
- * available in Chrome, Safari, Opera, and IE. This event fires after
- * `onKeyPress` and `onCompositionEnd`, but before `onInput`.
- *
- * `beforeInput` is spec'd but not implemented in any browsers, and
- * the `input` event does not provide any useful information about what has
- * actually been added, contrary to the spec. Thus, `textInput` is the best
- * available event to identify the characters that have actually been inserted
- * into the target node.
- *
- * This plugin is also responsible for emitting `composition` events, thus
- * allowing us to share composition fallback code for both `beforeInput` and
- * `composition` event types.
- */
-var BeforeInputEventPlugin = {
- eventTypes: eventTypes,
-
- extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
- var composition = extractCompositionEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget);
-
- var beforeInput = extractBeforeInputEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget);
-
- if (composition === null) {
- return beforeInput;
- }
-
- if (beforeInput === null) {
- return composition;
- }
-
- return [composition, beforeInput];
- }
-};
-
-// Use to restore controlled state after a change event has fired.
-
-var restoreImpl = null;
-var restoreTarget = null;
-var restoreQueue = null;
-
-function restoreStateOfTarget(target) {
- // We perform this translation at the end of the event loop so that we
- // always receive the correct fiber here
- var internalInstance = getInstanceFromNode(target);
- if (!internalInstance) {
- // Unmounted
- return;
- }
- !(typeof restoreImpl === 'function') ? invariant(false, 'setRestoreImplementation() needs to be called to handle a target for controlled events. This error is likely caused by a bug in React. Please file an issue.') : void 0;
- var props = getFiberCurrentPropsFromNode(internalInstance.stateNode);
- restoreImpl(internalInstance.stateNode, internalInstance.type, props);
-}
-
-function setRestoreImplementation(impl) {
- restoreImpl = impl;
-}
-
-function enqueueStateRestore(target) {
- if (restoreTarget) {
- if (restoreQueue) {
- restoreQueue.push(target);
- } else {
- restoreQueue = [target];
- }
- } else {
- restoreTarget = target;
- }
-}
-
-function needsStateRestore() {
- return restoreTarget !== null || restoreQueue !== null;
-}
-
-function restoreStateIfNeeded() {
- if (!restoreTarget) {
- return;
- }
- var target = restoreTarget;
- var queuedTargets = restoreQueue;
- restoreTarget = null;
- restoreQueue = null;
-
- restoreStateOfTarget(target);
- if (queuedTargets) {
- for (var i = 0; i < queuedTargets.length; i++) {
- restoreStateOfTarget(queuedTargets[i]);
- }
- }
-}
-
-// Used as a way to call batchedUpdates when we don't have a reference to
-// the renderer. Such as when we're dispatching events or if third party
-// libraries need to call batchedUpdates. Eventually, this API will go away when
-// everything is batched by default. We'll then have a similar API to opt-out of
-// scheduled work and instead do synchronous work.
-
-// Defaults
-var _batchedUpdatesImpl = function (fn, bookkeeping) {
- return fn(bookkeeping);
-};
-var _interactiveUpdatesImpl = function (fn, a, b) {
- return fn(a, b);
-};
-var _flushInteractiveUpdatesImpl = function () {};
-
-var isBatching = false;
-function batchedUpdates(fn, bookkeeping) {
- if (isBatching) {
- // If we are currently inside another batch, we need to wait until it
- // fully completes before restoring state.
- return fn(bookkeeping);
- }
- isBatching = true;
- try {
- return _batchedUpdatesImpl(fn, bookkeeping);
- } finally {
- // Here we wait until all updates have propagated, which is important
- // when using controlled components within layers:
- // https://github.com/facebook/react/issues/1698
- // Then we restore state of any controlled component.
- isBatching = false;
- var controlledComponentsHavePendingUpdates = needsStateRestore();
- if (controlledComponentsHavePendingUpdates) {
- // If a controlled event was fired, we may need to restore the state of
- // the DOM node back to the controlled value. This is necessary when React
- // bails out of the update without touching the DOM.
- _flushInteractiveUpdatesImpl();
- restoreStateIfNeeded();
- }
- }
-}
-
-function interactiveUpdates(fn, a, b) {
- return _interactiveUpdatesImpl(fn, a, b);
-}
-
-
-
-function setBatchingImplementation(batchedUpdatesImpl, interactiveUpdatesImpl, flushInteractiveUpdatesImpl) {
- _batchedUpdatesImpl = batchedUpdatesImpl;
- _interactiveUpdatesImpl = interactiveUpdatesImpl;
- _flushInteractiveUpdatesImpl = flushInteractiveUpdatesImpl;
-}
-
-/**
- * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#input-type-attr-summary
- */
-var supportedInputTypes = {
- color: true,
- date: true,
- datetime: true,
- 'datetime-local': true,
- email: true,
- month: true,
- number: true,
- password: true,
- range: true,
- search: true,
- tel: true,
- text: true,
- time: true,
- url: true,
- week: true
-};
-
-function isTextInputElement(elem) {
- var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
-
- if (nodeName === 'input') {
- return !!supportedInputTypes[elem.type];
- }
-
- if (nodeName === 'textarea') {
- return true;
- }
-
- return false;
-}
-
-/**
- * HTML nodeType values that represent the type of the node
- */
-
-var ELEMENT_NODE = 1;
-var TEXT_NODE = 3;
-var COMMENT_NODE = 8;
-var DOCUMENT_NODE = 9;
-var DOCUMENT_FRAGMENT_NODE = 11;
-
-/**
- * Gets the target node from a native browser event by accounting for
- * inconsistencies in browser DOM APIs.
- *
- * @param {object} nativeEvent Native browser event.
- * @return {DOMEventTarget} Target node.
- */
-function getEventTarget(nativeEvent) {
- // Fallback to nativeEvent.srcElement for IE9
- // https://github.com/facebook/react/issues/12506
- var target = nativeEvent.target || nativeEvent.srcElement || window;
-
- // Normalize SVG element events #4963
- if (target.correspondingUseElement) {
- target = target.correspondingUseElement;
- }
-
- // Safari may fire events on text nodes (Node.TEXT_NODE is 3).
- // @see http://www.quirksmode.org/js/events_properties.html
- return target.nodeType === TEXT_NODE ? target.parentNode : target;
-}
-
-/**
- * Checks if an event is supported in the current execution environment.
- *
- * NOTE: This will not work correctly for non-generic events such as `change`,
- * `reset`, `load`, `error`, and `select`.
- *
- * Borrows from Modernizr.
- *
- * @param {string} eventNameSuffix Event name, e.g. "click".
- * @return {boolean} True if the event is supported.
- * @internal
- * @license Modernizr 3.0.0pre (Custom Build) | MIT
- */
-function isEventSupported(eventNameSuffix) {
- if (!canUseDOM) {
- return false;
- }
-
- var eventName = 'on' + eventNameSuffix;
- var isSupported = eventName in document;
-
- if (!isSupported) {
- var element = document.createElement('div');
- element.setAttribute(eventName, 'return;');
- isSupported = typeof element[eventName] === 'function';
- }
-
- return isSupported;
-}
-
-function isCheckable(elem) {
- var type = elem.type;
- var nodeName = elem.nodeName;
- return nodeName && nodeName.toLowerCase() === 'input' && (type === 'checkbox' || type === 'radio');
-}
-
-function getTracker(node) {
- return node._valueTracker;
-}
-
-function detachTracker(node) {
- node._valueTracker = null;
-}
-
-function getValueFromNode(node) {
- var value = '';
- if (!node) {
- return value;
- }
-
- if (isCheckable(node)) {
- value = node.checked ? 'true' : 'false';
- } else {
- value = node.value;
- }
-
- return value;
-}
-
-function trackValueOnNode(node) {
- var valueField = isCheckable(node) ? 'checked' : 'value';
- var descriptor = Object.getOwnPropertyDescriptor(node.constructor.prototype, valueField);
-
- var currentValue = '' + node[valueField];
-
- // if someone has already defined a value or Safari, then bail
- // and don't track value will cause over reporting of changes,
- // but it's better then a hard failure
- // (needed for certain tests that spyOn input values and Safari)
- if (node.hasOwnProperty(valueField) || typeof descriptor === 'undefined' || typeof descriptor.get !== 'function' || typeof descriptor.set !== 'function') {
- return;
- }
- var get = descriptor.get,
- set = descriptor.set;
-
- Object.defineProperty(node, valueField, {
- configurable: true,
- get: function () {
- return get.call(this);
- },
- set: function (value) {
- currentValue = '' + value;
- set.call(this, value);
- }
- });
- // We could've passed this the first time
- // but it triggers a bug in IE11 and Edge 14/15.
- // Calling defineProperty() again should be equivalent.
- // https://github.com/facebook/react/issues/11768
- Object.defineProperty(node, valueField, {
- enumerable: descriptor.enumerable
- });
-
- var tracker = {
- getValue: function () {
- return currentValue;
- },
- setValue: function (value) {
- currentValue = '' + value;
- },
- stopTracking: function () {
- detachTracker(node);
- delete node[valueField];
- }
- };
- return tracker;
-}
-
-function track(node) {
- if (getTracker(node)) {
- return;
- }
-
- // TODO: Once it's just Fiber we can move this to node._wrapperState
- node._valueTracker = trackValueOnNode(node);
-}
-
-function updateValueIfChanged(node) {
- if (!node) {
- return false;
- }
-
- var tracker = getTracker(node);
- // if there is no tracker at this point it's unlikely
- // that trying again will succeed
- if (!tracker) {
- return true;
- }
-
- var lastValue = tracker.getValue();
- var nextValue = getValueFromNode(node);
- if (nextValue !== lastValue) {
- tracker.setValue(nextValue);
- return true;
- }
- return false;
-}
-
-var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
-
-var BEFORE_SLASH_RE = /^(.*)[\\\/]/;
-
-var describeComponentFrame = function (name, source, ownerName) {
- var sourceInfo = '';
- if (source) {
- var path = source.fileName;
- var fileName = path.replace(BEFORE_SLASH_RE, '');
- {
- // In DEV, include code for a common special case:
- // prefer "folder/index.js" instead of just "index.js".
- if (/^index\./.test(fileName)) {
- var match = path.match(BEFORE_SLASH_RE);
- if (match) {
- var pathBeforeSlash = match[1];
- if (pathBeforeSlash) {
- var folderName = pathBeforeSlash.replace(BEFORE_SLASH_RE, '');
- fileName = folderName + '/' + fileName;
- }
- }
- }
- }
- sourceInfo = ' (at ' + fileName + ':' + source.lineNumber + ')';
- } else if (ownerName) {
- sourceInfo = ' (created by ' + ownerName + ')';
- }
- return '\n in ' + (name || 'Unknown') + sourceInfo;
-};
-
-// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
-// nor polyfill, then a plain number is used for performance.
-var hasSymbol = typeof Symbol === 'function' && Symbol.for;
-
-var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
-var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
-var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
-var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
-var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
-var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
-var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace;
-var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
-var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
-var REACT_PLACEHOLDER_TYPE = hasSymbol ? Symbol.for('react.placeholder') : 0xead1;
-
-var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
-var FAUX_ITERATOR_SYMBOL = '@@iterator';
-
-function getIteratorFn(maybeIterable) {
- if (maybeIterable === null || typeof maybeIterable !== 'object') {
- return null;
- }
- var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
- if (typeof maybeIterator === 'function') {
- return maybeIterator;
- }
- return null;
-}
-
-var Pending = 0;
-var Resolved = 1;
-var Rejected = 2;
-
-function getResultFromResolvedThenable(thenable) {
- return thenable._reactResult;
-}
-
-function refineResolvedThenable(thenable) {
- return thenable._reactStatus === Resolved ? thenable._reactResult : null;
-}
-
-function getComponentName(type) {
- if (type == null) {
- // Host root, text node or just invalid type.
- return null;
- }
- {
- if (typeof type.tag === 'number') {
- warningWithoutStack$1(false, 'Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.');
- }
- }
- if (typeof type === 'function') {
- return type.displayName || type.name || null;
- }
- if (typeof type === 'string') {
- return type;
- }
- switch (type) {
- case REACT_ASYNC_MODE_TYPE:
- return 'AsyncMode';
- case REACT_FRAGMENT_TYPE:
- return 'Fragment';
- case REACT_PORTAL_TYPE:
- return 'Portal';
- case REACT_PROFILER_TYPE:
- return 'Profiler';
- case REACT_STRICT_MODE_TYPE:
- return 'StrictMode';
- case REACT_PLACEHOLDER_TYPE:
- return 'Placeholder';
- }
- if (typeof type === 'object') {
- switch (type.$$typeof) {
- case REACT_CONTEXT_TYPE:
- return 'Context.Consumer';
- case REACT_PROVIDER_TYPE:
- return 'Context.Provider';
- case REACT_FORWARD_REF_TYPE:
- var renderFn = type.render;
- var functionName = renderFn.displayName || renderFn.name || '';
- return type.displayName || (functionName !== '' ? 'ForwardRef(' + functionName + ')' : 'ForwardRef');
- }
- if (typeof type.then === 'function') {
- var thenable = type;
- var resolvedThenable = refineResolvedThenable(thenable);
- if (resolvedThenable) {
- return getComponentName(resolvedThenable);
- }
- }
- }
- return null;
-}
-
-var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
-
-function describeFiber(fiber) {
- switch (fiber.tag) {
- case IndeterminateComponent:
- case FunctionalComponent:
- case FunctionalComponentLazy:
- case ClassComponent:
- case ClassComponentLazy:
- case HostComponent:
- case Mode:
- var owner = fiber._debugOwner;
- var source = fiber._debugSource;
- var name = getComponentName(fiber.type);
- var ownerName = null;
- if (owner) {
- ownerName = getComponentName(owner.type);
- }
- return describeComponentFrame(name, source, ownerName);
- default:
- return '';
- }
-}
-
-function getStackByFiberInDevAndProd(workInProgress) {
- var info = '';
- var node = workInProgress;
- do {
- info += describeFiber(node);
- node = node.return;
- } while (node);
- return info;
-}
-
-var current = null;
-var phase = null;
-
-function getCurrentFiberOwnerNameInDevOrNull() {
- {
- if (current === null) {
- return null;
- }
- var owner = current._debugOwner;
- if (owner !== null && typeof owner !== 'undefined') {
- return getComponentName(owner.type);
- }
- }
- return null;
-}
-
-function getCurrentFiberStackInDev() {
- {
- if (current === null) {
- return '';
- }
- // Safe because if current fiber exists, we are reconciling,
- // and it is guaranteed to be the work-in-progress version.
- return getStackByFiberInDevAndProd(current);
- }
- return '';
-}
-
-function resetCurrentFiber() {
- {
- ReactDebugCurrentFrame.getCurrentStack = null;
- current = null;
- phase = null;
- }
-}
-
-function setCurrentFiber(fiber) {
- {
- ReactDebugCurrentFrame.getCurrentStack = getCurrentFiberStackInDev;
- current = fiber;
- phase = null;
- }
-}
-
-function setCurrentPhase(lifeCyclePhase) {
- {
- phase = lifeCyclePhase;
- }
-}
-
-/**
- * Similar to invariant but only logs a warning if the condition is not met.
- * This can be used to log issues in development environments in critical
- * paths. Removing the logging code for production environments will keep the
- * same logic and follow the same code paths.
- */
-
-var warning = warningWithoutStack$1;
-
-{
- warning = function (condition, format) {
- if (condition) {
- return;
- }
- var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
- var stack = ReactDebugCurrentFrame.getStackAddendum();
- // eslint-disable-next-line react-internal/warning-and-invariant-args
-
- for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
- args[_key - 2] = arguments[_key];
- }
-
- warningWithoutStack$1.apply(undefined, [false, format + '%s'].concat(args, [stack]));
- };
-}
-
-var warning$1 = warning;
-
-// A reserved attribute.
-// It is handled by React separately and shouldn't be written to the DOM.
-var RESERVED = 0;
-
-// A simple string attribute.
-// Attributes that aren't in the whitelist are presumed to have this type.
-var STRING = 1;
-
-// A string attribute that accepts booleans in React. In HTML, these are called
-// "enumerated" attributes with "true" and "false" as possible values.
-// When true, it should be set to a "true" string.
-// When false, it should be set to a "false" string.
-var BOOLEANISH_STRING = 2;
-
-// A real boolean attribute.
-// When true, it should be present (set either to an empty string or its name).
-// When false, it should be omitted.
-var BOOLEAN = 3;
-
-// An attribute that can be used as a flag as well as with a value.
-// When true, it should be present (set either to an empty string or its name).
-// When false, it should be omitted.
-// For any other value, should be present with that value.
-var OVERLOADED_BOOLEAN = 4;
-
-// An attribute that must be numeric or parse as a numeric.
-// When falsy, it should be removed.
-var NUMERIC = 5;
-
-// An attribute that must be positive numeric or parse as a positive numeric.
-// When falsy, it should be removed.
-var POSITIVE_NUMERIC = 6;
-
-/* eslint-disable max-len */
-var ATTRIBUTE_NAME_START_CHAR = ':A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD';
-/* eslint-enable max-len */
-var ATTRIBUTE_NAME_CHAR = ATTRIBUTE_NAME_START_CHAR + '\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040';
-
-
-var ROOT_ATTRIBUTE_NAME = 'data-reactroot';
-var VALID_ATTRIBUTE_NAME_REGEX = new RegExp('^[' + ATTRIBUTE_NAME_START_CHAR + '][' + ATTRIBUTE_NAME_CHAR + ']*$');
-
-var hasOwnProperty = Object.prototype.hasOwnProperty;
-var illegalAttributeNameCache = {};
-var validatedAttributeNameCache = {};
-
-function isAttributeNameSafe(attributeName) {
- if (hasOwnProperty.call(validatedAttributeNameCache, attributeName)) {
- return true;
- }
- if (hasOwnProperty.call(illegalAttributeNameCache, attributeName)) {
- return false;
- }
- if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) {
- validatedAttributeNameCache[attributeName] = true;
- return true;
- }
- illegalAttributeNameCache[attributeName] = true;
- {
- warning$1(false, 'Invalid attribute name: `%s`', attributeName);
- }
- return false;
-}
-
-function shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag) {
- if (propertyInfo !== null) {
- return propertyInfo.type === RESERVED;
- }
- if (isCustomComponentTag) {
- return false;
- }
- if (name.length > 2 && (name[0] === 'o' || name[0] === 'O') && (name[1] === 'n' || name[1] === 'N')) {
- return true;
- }
- return false;
-}
-
-function shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag) {
- if (propertyInfo !== null && propertyInfo.type === RESERVED) {
- return false;
- }
- switch (typeof value) {
- case 'function':
- // $FlowIssue symbol is perfectly valid here
- case 'symbol':
- // eslint-disable-line
- return true;
- case 'boolean':
- {
- if (isCustomComponentTag) {
- return false;
- }
- if (propertyInfo !== null) {
- return !propertyInfo.acceptsBooleans;
- } else {
- var prefix = name.toLowerCase().slice(0, 5);
- return prefix !== 'data-' && prefix !== 'aria-';
- }
- }
- default:
- return false;
- }
-}
-
-function shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag) {
- if (value === null || typeof value === 'undefined') {
- return true;
- }
- if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag)) {
- return true;
- }
- if (isCustomComponentTag) {
- return false;
- }
- if (propertyInfo !== null) {
- switch (propertyInfo.type) {
- case BOOLEAN:
- return !value;
- case OVERLOADED_BOOLEAN:
- return value === false;
- case NUMERIC:
- return isNaN(value);
- case POSITIVE_NUMERIC:
- return isNaN(value) || value < 1;
- }
- }
- return false;
-}
-
-function getPropertyInfo(name) {
- return properties.hasOwnProperty(name) ? properties[name] : null;
-}
-
-function PropertyInfoRecord(name, type, mustUseProperty, attributeName, attributeNamespace) {
- this.acceptsBooleans = type === BOOLEANISH_STRING || type === BOOLEAN || type === OVERLOADED_BOOLEAN;
- this.attributeName = attributeName;
- this.attributeNamespace = attributeNamespace;
- this.mustUseProperty = mustUseProperty;
- this.propertyName = name;
- this.type = type;
-}
-
-// When adding attributes to this list, be sure to also add them to
-// the `possibleStandardNames` module to ensure casing and incorrect
-// name warnings.
-var properties = {};
-
-// These props are reserved by React. They shouldn't be written to the DOM.
-['children', 'dangerouslySetInnerHTML',
-// TODO: This prevents the assignment of defaultValue to regular
-// elements (not just inputs). Now that ReactDOMInput assigns to the
-// defaultValue property -- do we need this?
-'defaultValue', 'defaultChecked', 'innerHTML', 'suppressContentEditableWarning', 'suppressHydrationWarning', 'style'].forEach(function (name) {
- properties[name] = new PropertyInfoRecord(name, RESERVED, false, // mustUseProperty
- name, // attributeName
- null);
-} // attributeNamespace
-);
-
-// A few React string attributes have a different name.
-// This is a mapping from React prop names to the attribute names.
-[['acceptCharset', 'accept-charset'], ['className', 'class'], ['htmlFor', 'for'], ['httpEquiv', 'http-equiv']].forEach(function (_ref) {
- var name = _ref[0],
- attributeName = _ref[1];
-
- properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
- attributeName, // attributeName
- null);
-} // attributeNamespace
-);
-
-// These are "enumerated" HTML attributes that accept "true" and "false".
-// In React, we let users pass `true` and `false` even though technically
-// these aren't boolean attributes (they are coerced to strings).
-['contentEditable', 'draggable', 'spellCheck', 'value'].forEach(function (name) {
- properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, // mustUseProperty
- name.toLowerCase(), // attributeName
- null);
-} // attributeNamespace
-);
-
-// These are "enumerated" SVG attributes that accept "true" and "false".
-// In React, we let users pass `true` and `false` even though technically
-// these aren't boolean attributes (they are coerced to strings).
-// Since these are SVG attributes, their attribute names are case-sensitive.
-['autoReverse', 'externalResourcesRequired', 'focusable', 'preserveAlpha'].forEach(function (name) {
- properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, // mustUseProperty
- name, // attributeName
- null);
-} // attributeNamespace
-);
-
-// These are HTML boolean attributes.
-['allowFullScreen', 'async',
-// Note: there is a special case that prevents it from being written to the DOM
-// on the client side because the browsers are inconsistent. Instead we call focus().
-'autoFocus', 'autoPlay', 'controls', 'default', 'defer', 'disabled', 'formNoValidate', 'hidden', 'loop', 'noModule', 'noValidate', 'open', 'playsInline', 'readOnly', 'required', 'reversed', 'scoped', 'seamless',
-// Microdata
-'itemScope'].forEach(function (name) {
- properties[name] = new PropertyInfoRecord(name, BOOLEAN, false, // mustUseProperty
- name.toLowerCase(), // attributeName
- null);
-} // attributeNamespace
-);
-
-// These are the few React props that we set as DOM properties
-// rather than attributes. These are all booleans.
-['checked',
-// Note: `option.selected` is not updated if `select.multiple` is
-// disabled with `removeAttribute`. We have special logic for handling this.
-'multiple', 'muted', 'selected'].forEach(function (name) {
- properties[name] = new PropertyInfoRecord(name, BOOLEAN, true, // mustUseProperty
- name, // attributeName
- null);
-} // attributeNamespace
-);
-
-// These are HTML attributes that are "overloaded booleans": they behave like
-// booleans, but can also accept a string value.
-['capture', 'download'].forEach(function (name) {
- properties[name] = new PropertyInfoRecord(name, OVERLOADED_BOOLEAN, false, // mustUseProperty
- name, // attributeName
- null);
-} // attributeNamespace
-);
-
-// These are HTML attributes that must be positive numbers.
-['cols', 'rows', 'size', 'span'].forEach(function (name) {
- properties[name] = new PropertyInfoRecord(name, POSITIVE_NUMERIC, false, // mustUseProperty
- name, // attributeName
- null);
-} // attributeNamespace
-);
-
-// These are HTML attributes that must be numbers.
-['rowSpan', 'start'].forEach(function (name) {
- properties[name] = new PropertyInfoRecord(name, NUMERIC, false, // mustUseProperty
- name.toLowerCase(), // attributeName
- null);
-} // attributeNamespace
-);
-
-var CAMELIZE = /[\-\:]([a-z])/g;
-var capitalize = function (token) {
- return token[1].toUpperCase();
-};
-
-// This is a list of all SVG attributes that need special casing, namespacing,
-// or boolean value assignment. Regular attributes that just accept strings
-// and have the same names are omitted, just like in the HTML whitelist.
-// Some of these attributes can be hard to find. This list was created by
-// scrapping the MDN documentation.
-['accent-height', 'alignment-baseline', 'arabic-form', 'baseline-shift', 'cap-height', 'clip-path', 'clip-rule', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'dominant-baseline', 'enable-background', 'fill-opacity', 'fill-rule', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'glyph-name', 'glyph-orientation-horizontal', 'glyph-orientation-vertical', 'horiz-adv-x', 'horiz-origin-x', 'image-rendering', 'letter-spacing', 'lighting-color', 'marker-end', 'marker-mid', 'marker-start', 'overline-position', 'overline-thickness', 'paint-order', 'panose-1', 'pointer-events', 'rendering-intent', 'shape-rendering', 'stop-color', 'stop-opacity', 'strikethrough-position', 'strikethrough-thickness', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'text-anchor', 'text-decoration', 'text-rendering', 'underline-position', 'underline-thickness', 'unicode-bidi', 'unicode-range', 'units-per-em', 'v-alphabetic', 'v-hanging', 'v-ideographic', 'v-mathematical', 'vector-effect', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'word-spacing', 'writing-mode', 'xmlns:xlink', 'x-height'].forEach(function (attributeName) {
- var name = attributeName.replace(CAMELIZE, capitalize);
- properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
- attributeName, null);
-} // attributeNamespace
-);
-
-// String SVG attributes with the xlink namespace.
-['xlink:actuate', 'xlink:arcrole', 'xlink:href', 'xlink:role', 'xlink:show', 'xlink:title', 'xlink:type'].forEach(function (attributeName) {
- var name = attributeName.replace(CAMELIZE, capitalize);
- properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
- attributeName, 'http://www.w3.org/1999/xlink');
-});
-
-// String SVG attributes with the xml namespace.
-['xml:base', 'xml:lang', 'xml:space'].forEach(function (attributeName) {
- var name = attributeName.replace(CAMELIZE, capitalize);
- properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
- attributeName, 'http://www.w3.org/XML/1998/namespace');
-});
-
-// Special case: this attribute exists both in HTML and SVG.
-// Its "tabindex" attribute name is case-sensitive in SVG so we can't just use
-// its React `tabIndex` name, like we do for attributes that exist only in HTML.
-properties.tabIndex = new PropertyInfoRecord('tabIndex', STRING, false, // mustUseProperty
-'tabindex', // attributeName
-null);
-
-/**
- * Get the value for a property on a node. Only used in DEV for SSR validation.
- * The "expected" argument is used as a hint of what the expected value is.
- * Some properties have multiple equivalent values.
- */
-function getValueForProperty(node, name, expected, propertyInfo) {
- {
- if (propertyInfo.mustUseProperty) {
- var propertyName = propertyInfo.propertyName;
-
- return node[propertyName];
- } else {
- var attributeName = propertyInfo.attributeName;
-
- var stringValue = null;
-
- if (propertyInfo.type === OVERLOADED_BOOLEAN) {
- if (node.hasAttribute(attributeName)) {
- var value = node.getAttribute(attributeName);
- if (value === '') {
- return true;
- }
- if (shouldRemoveAttribute(name, expected, propertyInfo, false)) {
- return value;
- }
- if (value === '' + expected) {
- return expected;
- }
- return value;
- }
- } else if (node.hasAttribute(attributeName)) {
- if (shouldRemoveAttribute(name, expected, propertyInfo, false)) {
- // We had an attribute but shouldn't have had one, so read it
- // for the error message.
- return node.getAttribute(attributeName);
- }
- if (propertyInfo.type === BOOLEAN) {
- // If this was a boolean, it doesn't matter what the value is
- // the fact that we have it is the same as the expected.
- return expected;
- }
- // Even if this property uses a namespace we use getAttribute
- // because we assume its namespaced name is the same as our config.
- // To use getAttributeNS we need the local name which we don't have
- // in our config atm.
- stringValue = node.getAttribute(attributeName);
- }
-
- if (shouldRemoveAttribute(name, expected, propertyInfo, false)) {
- return stringValue === null ? expected : stringValue;
- } else if (stringValue === '' + expected) {
- return expected;
- } else {
- return stringValue;
- }
- }
- }
-}
-
-/**
- * Get the value for a attribute on a node. Only used in DEV for SSR validation.
- * The third argument is used as a hint of what the expected value is. Some
- * attributes have multiple equivalent values.
- */
-function getValueForAttribute(node, name, expected) {
- {
- if (!isAttributeNameSafe(name)) {
- return;
- }
- if (!node.hasAttribute(name)) {
- return expected === undefined ? undefined : null;
- }
- var value = node.getAttribute(name);
- if (value === '' + expected) {
- return expected;
- }
- return value;
- }
-}
-
-/**
- * Sets the value for a property on a node.
- *
- * @param {DOMElement} node
- * @param {string} name
- * @param {*} value
- */
-function setValueForProperty(node, name, value, isCustomComponentTag) {
- var propertyInfo = getPropertyInfo(name);
- if (shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag)) {
- return;
- }
- if (shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag)) {
- value = null;
- }
- // If the prop isn't in the special list, treat it as a simple attribute.
- if (isCustomComponentTag || propertyInfo === null) {
- if (isAttributeNameSafe(name)) {
- var _attributeName = name;
- if (value === null) {
- node.removeAttribute(_attributeName);
- } else {
- node.setAttribute(_attributeName, '' + value);
- }
- }
- return;
- }
- var mustUseProperty = propertyInfo.mustUseProperty;
-
- if (mustUseProperty) {
- var propertyName = propertyInfo.propertyName;
-
- if (value === null) {
- var type = propertyInfo.type;
-
- node[propertyName] = type === BOOLEAN ? false : '';
- } else {
- // Contrary to `setAttribute`, object properties are properly
- // `toString`ed by IE8/9.
- node[propertyName] = value;
- }
- return;
- }
- // The rest are treated as attributes with special cases.
- var attributeName = propertyInfo.attributeName,
- attributeNamespace = propertyInfo.attributeNamespace;
-
- if (value === null) {
- node.removeAttribute(attributeName);
- } else {
- var _type = propertyInfo.type;
-
- var attributeValue = void 0;
- if (_type === BOOLEAN || _type === OVERLOADED_BOOLEAN && value === true) {
- attributeValue = '';
- } else {
- // `setAttribute` with objects becomes only `[object]` in IE8/9,
- // ('' + value) makes it output the correct toString()-value.
- attributeValue = '' + value;
- }
- if (attributeNamespace) {
- node.setAttributeNS(attributeNamespace, attributeName, attributeValue);
- } else {
- node.setAttribute(attributeName, attributeValue);
- }
- }
-}
-
-// Flow does not allow string concatenation of most non-string types. To work
-// around this limitation, we use an opaque type that can only be obtained by
-// passing the value through getToStringValue first.
-function toString(value) {
- return '' + value;
-}
-
-function getToStringValue(value) {
- switch (typeof value) {
- case 'boolean':
- case 'number':
- case 'object':
- case 'string':
- case 'undefined':
- return value;
- default:
- // function, symbol are assigned as empty strings
- return '';
- }
-}
-
-var ReactDebugCurrentFrame$1 = null;
-
-var ReactControlledValuePropTypes = {
- checkPropTypes: null
-};
-
-{
- ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
-
- var hasReadOnlyValue = {
- button: true,
- checkbox: true,
- image: true,
- hidden: true,
- radio: true,
- reset: true,
- submit: true
- };
-
- var propTypes = {
- value: function (props, propName, componentName) {
- if (hasReadOnlyValue[props.type] || props.onChange || props.readOnly || props.disabled || props[propName] == null) {
- return null;
- }
- return new Error('You provided a `value` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultValue`. Otherwise, ' + 'set either `onChange` or `readOnly`.');
- },
- checked: function (props, propName, componentName) {
- if (props.onChange || props.readOnly || props.disabled || props[propName] == null) {
- return null;
- }
- return new Error('You provided a `checked` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultChecked`. Otherwise, ' + 'set either `onChange` or `readOnly`.');
- }
- };
-
- /**
- * Provide a linked `value` attribute for controlled forms. You should not use
- * this outside of the ReactDOM controlled form components.
- */
- ReactControlledValuePropTypes.checkPropTypes = function (tagName, props) {
- checkPropTypes(propTypes, props, 'prop', tagName, ReactDebugCurrentFrame$1.getStackAddendum);
- };
-}
-
-// Exports ReactDOM.createRoot
-var enableUserTimingAPI = true;
-
-// Experimental error-boundary API that can recover from errors within a single
-// render phase
-var enableGetDerivedStateFromCatch = false;
-// Suspense
-var enableSuspense = false;
-// Helps identify side effects in begin-phase lifecycle hooks and setState reducers:
-var debugRenderPhaseSideEffects = false;
-
-// In some cases, StrictMode should also double-render lifecycles.
-// This can be confusing for tests though,
-// And it can be bad for performance in production.
-// This feature flag can be used to control the behavior:
-var debugRenderPhaseSideEffectsForStrictMode = true;
-
-// To preserve the "Pause on caught exceptions" behavior of the debugger, we
-// replay the begin phase of a failed component inside invokeGuardedCallback.
-var replayFailedUnitOfWorkWithInvokeGuardedCallback = true;
-
-// Warn about deprecated, async-unsafe lifecycles; relates to RFC #6:
-var warnAboutDeprecatedLifecycles = false;
-
-// Warn about legacy context API
-var warnAboutLegacyContextAPI = false;
-
-// Gather advanced timing metrics for Profiler subtrees.
-var enableProfilerTimer = true;
-
-// Trace which interactions trigger each commit.
-var enableSchedulerTracing = true;
-
-// Only used in www builds.
-
-
-// Only used in www builds.
-
-
-// React Fire: prevent the value and checked attributes from syncing
-// with their related DOM properties
-var disableInputAttributeSyncing = false;
-
-// TODO: direct imports like some-package/src/* are bad. Fix me.
-var didWarnValueDefaultValue = false;
-var didWarnCheckedDefaultChecked = false;
-var didWarnControlledToUncontrolled = false;
-var didWarnUncontrolledToControlled = false;
-
-function isControlled(props) {
- var usesChecked = props.type === 'checkbox' || props.type === 'radio';
- return usesChecked ? props.checked != null : props.value != null;
-}
-
-/**
- * Implements an host component that allows setting these optional
- * props: `checked`, `value`, `defaultChecked`, and `defaultValue`.
- *
- * If `checked` or `value` are not supplied (or null/undefined), user actions
- * that affect the checked state or value will trigger updates to the element.
- *
- * If they are supplied (and not null/undefined), the rendered element will not
- * trigger updates to the element. Instead, the props must change in order for
- * the rendered element to be updated.
- *
- * The rendered element will be initialized as unchecked (or `defaultChecked`)
- * with an empty value (or `defaultValue`).
- *
- * See http://www.w3.org/TR/2012/WD-html5-20121025/the-input-element.html
- */
-
-function getHostProps(element, props) {
- var node = element;
- var checked = props.checked;
-
- var hostProps = _assign({}, props, {
- defaultChecked: undefined,
- defaultValue: undefined,
- value: undefined,
- checked: checked != null ? checked : node._wrapperState.initialChecked
- });
-
- return hostProps;
-}
-
-function initWrapperState(element, props) {
- {
- ReactControlledValuePropTypes.checkPropTypes('input', props);
-
- if (props.checked !== undefined && props.defaultChecked !== undefined && !didWarnCheckedDefaultChecked) {
- warning$1(false, '%s contains an input of type %s with both checked and defaultChecked props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the checked prop, or the defaultChecked prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', getCurrentFiberOwnerNameInDevOrNull() || 'A component', props.type);
- didWarnCheckedDefaultChecked = true;
- }
- if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue) {
- warning$1(false, '%s contains an input of type %s with both value and defaultValue props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', getCurrentFiberOwnerNameInDevOrNull() || 'A component', props.type);
- didWarnValueDefaultValue = true;
- }
- }
-
- var node = element;
- var defaultValue = props.defaultValue == null ? '' : props.defaultValue;
-
- node._wrapperState = {
- initialChecked: props.checked != null ? props.checked : props.defaultChecked,
- initialValue: getToStringValue(props.value != null ? props.value : defaultValue),
- controlled: isControlled(props)
- };
-}
-
-function updateChecked(element, props) {
- var node = element;
- var checked = props.checked;
- if (checked != null) {
- setValueForProperty(node, 'checked', checked, false);
- }
-}
-
-function updateWrapper(element, props) {
- var node = element;
- {
- var _controlled = isControlled(props);
-
- if (!node._wrapperState.controlled && _controlled && !didWarnUncontrolledToControlled) {
- warning$1(false, 'A component is changing an uncontrolled input of type %s to be controlled. ' + 'Input elements should not switch from uncontrolled to controlled (or vice versa). ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components', props.type);
- didWarnUncontrolledToControlled = true;
- }
- if (node._wrapperState.controlled && !_controlled && !didWarnControlledToUncontrolled) {
- warning$1(false, 'A component is changing a controlled input of type %s to be uncontrolled. ' + 'Input elements should not switch from controlled to uncontrolled (or vice versa). ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components', props.type);
- didWarnControlledToUncontrolled = true;
- }
- }
-
- updateChecked(element, props);
-
- var value = getToStringValue(props.value);
- var type = props.type;
-
- if (value != null) {
- if (type === 'number') {
- if (value === 0 && node.value === '' ||
- // We explicitly want to coerce to number here if possible.
- // eslint-disable-next-line
- node.value != value) {
- node.value = toString(value);
- }
- } else if (node.value !== toString(value)) {
- node.value = toString(value);
- }
- } else if (type === 'submit' || type === 'reset') {
- // Submit/reset inputs need the attribute removed completely to avoid
- // blank-text buttons.
- node.removeAttribute('value');
- return;
- }
-
- if (disableInputAttributeSyncing) {
- // When not syncing the value attribute, React only assigns a new value
- // whenever the defaultValue React prop has changed. When not present,
- // React does nothing
- if (props.hasOwnProperty('defaultValue')) {
- setDefaultValue(node, props.type, getToStringValue(props.defaultValue));
- }
- } else {
- // When syncing the value attribute, the value comes from a cascade of
- // properties:
- // 1. The value React property
- // 2. The defaultValue React property
- // 3. Otherwise there should be no change
- if (props.hasOwnProperty('value')) {
- setDefaultValue(node, props.type, value);
- } else if (props.hasOwnProperty('defaultValue')) {
- setDefaultValue(node, props.type, getToStringValue(props.defaultValue));
- }
- }
-
- if (disableInputAttributeSyncing) {
- // When not syncing the checked attribute, the attribute is directly
- // controllable from the defaultValue React property. It needs to be
- // updated as new props come in.
- if (props.defaultChecked == null) {
- node.removeAttribute('checked');
- } else {
- node.defaultChecked = !!props.defaultChecked;
- }
- } else {
- // When syncing the checked attribute, it only changes when it needs
- // to be removed, such as transitioning from a checkbox into a text input
- if (props.checked == null && props.defaultChecked != null) {
- node.defaultChecked = !!props.defaultChecked;
- }
- }
-}
-
-function postMountWrapper(element, props, isHydrating) {
- var node = element;
-
- // Do not assign value if it is already set. This prevents user text input
- // from being lost during SSR hydration.
- if (props.hasOwnProperty('value') || props.hasOwnProperty('defaultValue')) {
- var type = props.type;
- var isButton = type === 'submit' || type === 'reset';
-
- // Avoid setting value attribute on submit/reset inputs as it overrides the
- // default value provided by the browser. See: #12872
- if (isButton && (props.value === undefined || props.value === null)) {
- return;
- }
-
- var _initialValue = toString(node._wrapperState.initialValue);
-
- // Do not assign value if it is already set. This prevents user text input
- // from being lost during SSR hydration.
- if (!isHydrating) {
- if (disableInputAttributeSyncing) {
- var value = getToStringValue(props.value);
-
- // When not syncing the value attribute, the value property points
- // directly to the React prop. Only assign it if it exists.
- if (value != null) {
- // Always assign on buttons so that it is possible to assign an
- // empty string to clear button text.
- //
- // Otherwise, do not re-assign the value property if is empty. This
- // potentially avoids a DOM write and prevents Firefox (~60.0.1) from
- // prematurely marking required inputs as invalid. Equality is compared
- // to the current value in case the browser provided value is not an
- // empty string.
- if (isButton || value !== node.value) {
- node.value = toString(value);
- }
- }
- } else {
- // When syncing the value attribute, the value property should use
- // the the wrapperState._initialValue property. This uses:
- //
- // 1. The value React property when present
- // 2. The defaultValue React property when present
- // 3. An empty string
- if (_initialValue !== node.value) {
- node.value = _initialValue;
- }
- }
- }
-
- if (disableInputAttributeSyncing) {
- // When not syncing the value attribute, assign the value attribute
- // directly from the defaultValue React property (when present)
- var defaultValue = getToStringValue(props.defaultValue);
- if (defaultValue != null) {
- node.defaultValue = toString(defaultValue);
- }
- } else {
- // Otherwise, the value attribute is synchronized to the property,
- // so we assign defaultValue to the same thing as the value property
- // assignment step above.
- node.defaultValue = _initialValue;
- }
- }
-
- // Normally, we'd just do `node.checked = node.checked` upon initial mount, less this bug
- // this is needed to work around a chrome bug where setting defaultChecked
- // will sometimes influence the value of checked (even after detachment).
- // Reference: https://bugs.chromium.org/p/chromium/issues/detail?id=608416
- // We need to temporarily unset name to avoid disrupting radio button groups.
- var name = node.name;
- if (name !== '') {
- node.name = '';
- }
-
- if (disableInputAttributeSyncing) {
- // When not syncing the checked attribute, the checked property
- // never gets assigned. It must be manually set. We don't want
- // to do this when hydrating so that existing user input isn't
- // modified
- if (!isHydrating) {
- updateChecked(element, props);
- }
-
- // Only assign the checked attribute if it is defined. This saves
- // a DOM write when controlling the checked attribute isn't needed
- // (text inputs, submit/reset)
- if (props.hasOwnProperty('defaultChecked')) {
- node.defaultChecked = !node.defaultChecked;
- node.defaultChecked = !!props.defaultChecked;
- }
- } else {
- // When syncing the checked attribute, both the the checked property and
- // attribute are assigned at the same time using defaultChecked. This uses:
- //
- // 1. The checked React property when present
- // 2. The defaultChecked React property when present
- // 3. Otherwise, false
- node.defaultChecked = !node.defaultChecked;
- node.defaultChecked = !!node._wrapperState.initialChecked;
- }
-
- if (name !== '') {
- node.name = name;
- }
-}
-
-function restoreControlledState(element, props) {
- var node = element;
- updateWrapper(node, props);
- updateNamedCousins(node, props);
-}
-
-function updateNamedCousins(rootNode, props) {
- var name = props.name;
- if (props.type === 'radio' && name != null) {
- var queryRoot = rootNode;
-
- while (queryRoot.parentNode) {
- queryRoot = queryRoot.parentNode;
- }
-
- // If `rootNode.form` was non-null, then we could try `form.elements`,
- // but that sometimes behaves strangely in IE8. We could also try using
- // `form.getElementsByName`, but that will only return direct children
- // and won't include inputs that use the HTML5 `form=` attribute. Since
- // the input might not even be in a form. It might not even be in the
- // document. Let's just use the local `querySelectorAll` to ensure we don't
- // miss anything.
- var group = queryRoot.querySelectorAll('input[name=' + JSON.stringify('' + name) + '][type="radio"]');
-
- for (var i = 0; i < group.length; i++) {
- var otherNode = group[i];
- if (otherNode === rootNode || otherNode.form !== rootNode.form) {
- continue;
- }
- // This will throw if radio buttons rendered by different copies of React
- // and the same name are rendered into the same form (same as #1939).
- // That's probably okay; we don't support it just as we don't support
- // mixing React radio buttons with non-React ones.
- var otherProps = getFiberCurrentPropsFromNode$1(otherNode);
- !otherProps ? invariant(false, 'ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported.') : void 0;
-
- // We need update the tracked value on the named cousin since the value
- // was changed but the input saw no event or value set
- updateValueIfChanged(otherNode);
-
- // If this is a controlled radio button group, forcing the input that
- // was previously checked to update will cause it to be come re-checked
- // as appropriate.
- updateWrapper(otherNode, otherProps);
- }
- }
-}
-
-// In Chrome, assigning defaultValue to certain input types triggers input validation.
-// For number inputs, the display value loses trailing decimal points. For email inputs,
-// Chrome raises "The specified value is not a valid email address".
-//
-// Here we check to see if the defaultValue has actually changed, avoiding these problems
-// when the user is inputting text
-//
-// https://github.com/facebook/react/issues/7253
-function setDefaultValue(node, type, value) {
- if (
- // Focused number inputs synchronize on blur. See ChangeEventPlugin.js
- type !== 'number' || node.ownerDocument.activeElement !== node) {
- if (value == null) {
- node.defaultValue = toString(node._wrapperState.initialValue);
- } else if (node.defaultValue !== toString(value)) {
- node.defaultValue = toString(value);
- }
- }
-}
-
-var eventTypes$1 = {
- change: {
- phasedRegistrationNames: {
- bubbled: 'onChange',
- captured: 'onChangeCapture'
- },
- dependencies: [TOP_BLUR, TOP_CHANGE, TOP_CLICK, TOP_FOCUS, TOP_INPUT, TOP_KEY_DOWN, TOP_KEY_UP, TOP_SELECTION_CHANGE]
- }
-};
-
-function createAndAccumulateChangeEvent(inst, nativeEvent, target) {
- var event = SyntheticEvent.getPooled(eventTypes$1.change, inst, nativeEvent, target);
- event.type = 'change';
- // Flag this event loop as needing state restore.
- enqueueStateRestore(target);
- accumulateTwoPhaseDispatches(event);
- return event;
-}
-/**
- * For IE shims
- */
-var activeElement = null;
-var activeElementInst = null;
-
-/**
- * SECTION: handle `change` event
- */
-function shouldUseChangeEvent(elem) {
- var nodeName = elem.nodeName && elem.nodeName.toLowerCase();
- return nodeName === 'select' || nodeName === 'input' && elem.type === 'file';
-}
-
-function manualDispatchChangeEvent(nativeEvent) {
- var event = createAndAccumulateChangeEvent(activeElementInst, nativeEvent, getEventTarget(nativeEvent));
-
- // If change and propertychange bubbled, we'd just bind to it like all the
- // other events and have it go through ReactBrowserEventEmitter. Since it
- // doesn't, we manually listen for the events and so we have to enqueue and
- // process the abstract event manually.
- //
- // Batching is necessary here in order to ensure that all event handlers run
- // before the next rerender (including event handlers attached to ancestor
- // elements instead of directly on the input). Without this, controlled
- // components don't work properly in conjunction with event bubbling because
- // the component is rerendered and the value reverted before all the event
- // handlers can run. See https://github.com/facebook/react/issues/708.
- batchedUpdates(runEventInBatch, event);
-}
-
-function runEventInBatch(event) {
- runEventsInBatch(event, false);
-}
-
-function getInstIfValueChanged(targetInst) {
- var targetNode = getNodeFromInstance$1(targetInst);
- if (updateValueIfChanged(targetNode)) {
- return targetInst;
- }
-}
-
-function getTargetInstForChangeEvent(topLevelType, targetInst) {
- if (topLevelType === TOP_CHANGE) {
- return targetInst;
- }
-}
-
-/**
- * SECTION: handle `input` event
- */
-var isInputEventSupported = false;
-if (canUseDOM) {
- // IE9 claims to support the input event but fails to trigger it when
- // deleting text, so we ignore its input events.
- isInputEventSupported = isEventSupported('input') && (!document.documentMode || document.documentMode > 9);
-}
-
-/**
- * (For IE <=9) Starts tracking propertychange events on the passed-in element
- * and override the value property so that we can distinguish user events from
- * value changes in JS.
- */
-function startWatchingForValueChange(target, targetInst) {
- activeElement = target;
- activeElementInst = targetInst;
- activeElement.attachEvent('onpropertychange', handlePropertyChange);
-}
-
-/**
- * (For IE <=9) Removes the event listeners from the currently-tracked element,
- * if any exists.
- */
-function stopWatchingForValueChange() {
- if (!activeElement) {
- return;
- }
- activeElement.detachEvent('onpropertychange', handlePropertyChange);
- activeElement = null;
- activeElementInst = null;
-}
-
-/**
- * (For IE <=9) Handles a propertychange event, sending a `change` event if
- * the value of the active element has changed.
- */
-function handlePropertyChange(nativeEvent) {
- if (nativeEvent.propertyName !== 'value') {
- return;
- }
- if (getInstIfValueChanged(activeElementInst)) {
- manualDispatchChangeEvent(nativeEvent);
- }
-}
-
-function handleEventsForInputEventPolyfill(topLevelType, target, targetInst) {
- if (topLevelType === TOP_FOCUS) {
- // In IE9, propertychange fires for most input events but is buggy and
- // doesn't fire when text is deleted, but conveniently, selectionchange
- // appears to fire in all of the remaining cases so we catch those and
- // forward the event if the value has changed
- // In either case, we don't want to call the event handler if the value
- // is changed from JS so we redefine a setter for `.value` that updates
- // our activeElementValue variable, allowing us to ignore those changes
- //
- // stopWatching() should be a noop here but we call it just in case we
- // missed a blur event somehow.
- stopWatchingForValueChange();
- startWatchingForValueChange(target, targetInst);
- } else if (topLevelType === TOP_BLUR) {
- stopWatchingForValueChange();
- }
-}
-
-// For IE8 and IE9.
-function getTargetInstForInputEventPolyfill(topLevelType, targetInst) {
- if (topLevelType === TOP_SELECTION_CHANGE || topLevelType === TOP_KEY_UP || topLevelType === TOP_KEY_DOWN) {
- // On the selectionchange event, the target is just document which isn't
- // helpful for us so just check activeElement instead.
- //
- // 99% of the time, keydown and keyup aren't necessary. IE8 fails to fire
- // propertychange on the first input event after setting `value` from a
- // script and fires only keydown, keypress, keyup. Catching keyup usually
- // gets it and catching keydown lets us fire an event for the first
- // keystroke if user does a key repeat (it'll be a little delayed: right
- // before the second keystroke). Other input methods (e.g., paste) seem to
- // fire selectionchange normally.
- return getInstIfValueChanged(activeElementInst);
- }
-}
-
-/**
- * SECTION: handle `click` event
- */
-function shouldUseClickEvent(elem) {
- // Use the `click` event to detect changes to checkbox and radio inputs.
- // This approach works across all browsers, whereas `change` does not fire
- // until `blur` in IE8.
- var nodeName = elem.nodeName;
- return nodeName && nodeName.toLowerCase() === 'input' && (elem.type === 'checkbox' || elem.type === 'radio');
-}
-
-function getTargetInstForClickEvent(topLevelType, targetInst) {
- if (topLevelType === TOP_CLICK) {
- return getInstIfValueChanged(targetInst);
- }
-}
-
-function getTargetInstForInputOrChangeEvent(topLevelType, targetInst) {
- if (topLevelType === TOP_INPUT || topLevelType === TOP_CHANGE) {
- return getInstIfValueChanged(targetInst);
- }
-}
-
-function handleControlledInputBlur(node) {
- var state = node._wrapperState;
-
- if (!state || !state.controlled || node.type !== 'number') {
- return;
- }
-
- if (!disableInputAttributeSyncing) {
- // If controlled, assign the value attribute to the current value on blur
- setDefaultValue(node, 'number', node.value);
- }
-}
-
-/**
- * This plugin creates an `onChange` event that normalizes change events
- * across form elements. This event fires at a time when it's possible to
- * change the element's value without seeing a flicker.
- *
- * Supported elements are:
- * - input (see `isTextInputElement`)
- * - textarea
- * - select
- */
-var ChangeEventPlugin = {
- eventTypes: eventTypes$1,
-
- _isInputEventSupported: isInputEventSupported,
-
- extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
- var targetNode = targetInst ? getNodeFromInstance$1(targetInst) : window;
-
- var getTargetInstFunc = void 0,
- handleEventFunc = void 0;
- if (shouldUseChangeEvent(targetNode)) {
- getTargetInstFunc = getTargetInstForChangeEvent;
- } else if (isTextInputElement(targetNode)) {
- if (isInputEventSupported) {
- getTargetInstFunc = getTargetInstForInputOrChangeEvent;
- } else {
- getTargetInstFunc = getTargetInstForInputEventPolyfill;
- handleEventFunc = handleEventsForInputEventPolyfill;
- }
- } else if (shouldUseClickEvent(targetNode)) {
- getTargetInstFunc = getTargetInstForClickEvent;
- }
-
- if (getTargetInstFunc) {
- var inst = getTargetInstFunc(topLevelType, targetInst);
- if (inst) {
- var event = createAndAccumulateChangeEvent(inst, nativeEvent, nativeEventTarget);
- return event;
- }
- }
-
- if (handleEventFunc) {
- handleEventFunc(topLevelType, targetNode, targetInst);
- }
-
- // When blurring, set the value attribute for number inputs
- if (topLevelType === TOP_BLUR) {
- handleControlledInputBlur(targetNode);
- }
- }
-};
-
-/**
- * Module that is injectable into `EventPluginHub`, that specifies a
- * deterministic ordering of `EventPlugin`s. A convenient way to reason about
- * plugins, without having to package every one of them. This is better than
- * having plugins be ordered in the same order that they are injected because
- * that ordering would be influenced by the packaging order.
- * `ResponderEventPlugin` must occur before `SimpleEventPlugin` so that
- * preventing default on events is convenient in `SimpleEventPlugin` handlers.
- */
-var DOMEventPluginOrder = ['ResponderEventPlugin', 'SimpleEventPlugin', 'EnterLeaveEventPlugin', 'ChangeEventPlugin', 'SelectEventPlugin', 'BeforeInputEventPlugin'];
-
-var SyntheticUIEvent = SyntheticEvent.extend({
- view: null,
- detail: null
-});
-
-/**
- * Translation from modifier key to the associated property in the event.
- * @see http://www.w3.org/TR/DOM-Level-3-Events/#keys-Modifiers
- */
-
-var modifierKeyToProp = {
- Alt: 'altKey',
- Control: 'ctrlKey',
- Meta: 'metaKey',
- Shift: 'shiftKey'
-};
-
-// IE8 does not implement getModifierState so we simply map it to the only
-// modifier keys exposed by the event itself, does not support Lock-keys.
-// Currently, all major browsers except Chrome seems to support Lock-keys.
-function modifierStateGetter(keyArg) {
- var syntheticEvent = this;
- var nativeEvent = syntheticEvent.nativeEvent;
- if (nativeEvent.getModifierState) {
- return nativeEvent.getModifierState(keyArg);
- }
- var keyProp = modifierKeyToProp[keyArg];
- return keyProp ? !!nativeEvent[keyProp] : false;
-}
-
-function getEventModifierState(nativeEvent) {
- return modifierStateGetter;
-}
-
-var previousScreenX = 0;
-var previousScreenY = 0;
-// Use flags to signal movementX/Y has already been set
-var isMovementXSet = false;
-var isMovementYSet = false;
-
-/**
- * @interface MouseEvent
- * @see http://www.w3.org/TR/DOM-Level-3-Events/
- */
-var SyntheticMouseEvent = SyntheticUIEvent.extend({
- screenX: null,
- screenY: null,
- clientX: null,
- clientY: null,
- pageX: null,
- pageY: null,
- ctrlKey: null,
- shiftKey: null,
- altKey: null,
- metaKey: null,
- getModifierState: getEventModifierState,
- button: null,
- buttons: null,
- relatedTarget: function (event) {
- return event.relatedTarget || (event.fromElement === event.srcElement ? event.toElement : event.fromElement);
- },
- movementX: function (event) {
- if ('movementX' in event) {
- return event.movementX;
- }
-
- var screenX = previousScreenX;
- previousScreenX = event.screenX;
-
- if (!isMovementXSet) {
- isMovementXSet = true;
- return 0;
- }
-
- return event.type === 'mousemove' ? event.screenX - screenX : 0;
- },
- movementY: function (event) {
- if ('movementY' in event) {
- return event.movementY;
- }
-
- var screenY = previousScreenY;
- previousScreenY = event.screenY;
-
- if (!isMovementYSet) {
- isMovementYSet = true;
- return 0;
- }
-
- return event.type === 'mousemove' ? event.screenY - screenY : 0;
- }
-});
-
-/**
- * @interface PointerEvent
- * @see http://www.w3.org/TR/pointerevents/
- */
-var SyntheticPointerEvent = SyntheticMouseEvent.extend({
- pointerId: null,
- width: null,
- height: null,
- pressure: null,
- tangentialPressure: null,
- tiltX: null,
- tiltY: null,
- twist: null,
- pointerType: null,
- isPrimary: null
-});
-
-var eventTypes$2 = {
- mouseEnter: {
- registrationName: 'onMouseEnter',
- dependencies: [TOP_MOUSE_OUT, TOP_MOUSE_OVER]
- },
- mouseLeave: {
- registrationName: 'onMouseLeave',
- dependencies: [TOP_MOUSE_OUT, TOP_MOUSE_OVER]
- },
- pointerEnter: {
- registrationName: 'onPointerEnter',
- dependencies: [TOP_POINTER_OUT, TOP_POINTER_OVER]
- },
- pointerLeave: {
- registrationName: 'onPointerLeave',
- dependencies: [TOP_POINTER_OUT, TOP_POINTER_OVER]
- }
-};
-
-var EnterLeaveEventPlugin = {
- eventTypes: eventTypes$2,
-
- /**
- * For almost every interaction we care about, there will be both a top-level
- * `mouseover` and `mouseout` event that occurs. Only use `mouseout` so that
- * we do not extract duplicate events. However, moving the mouse into the
- * browser from outside will not fire a `mouseout` event. In this case, we use
- * the `mouseover` top-level event.
- */
- extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
- var isOverEvent = topLevelType === TOP_MOUSE_OVER || topLevelType === TOP_POINTER_OVER;
- var isOutEvent = topLevelType === TOP_MOUSE_OUT || topLevelType === TOP_POINTER_OUT;
-
- if (isOverEvent && (nativeEvent.relatedTarget || nativeEvent.fromElement)) {
- return null;
- }
-
- if (!isOutEvent && !isOverEvent) {
- // Must not be a mouse or pointer in or out - ignoring.
- return null;
- }
-
- var win = void 0;
- if (nativeEventTarget.window === nativeEventTarget) {
- // `nativeEventTarget` is probably a window object.
- win = nativeEventTarget;
- } else {
- // TODO: Figure out why `ownerDocument` is sometimes undefined in IE8.
- var doc = nativeEventTarget.ownerDocument;
- if (doc) {
- win = doc.defaultView || doc.parentWindow;
- } else {
- win = window;
- }
- }
-
- var from = void 0;
- var to = void 0;
- if (isOutEvent) {
- from = targetInst;
- var related = nativeEvent.relatedTarget || nativeEvent.toElement;
- to = related ? getClosestInstanceFromNode(related) : null;
- } else {
- // Moving to a node from outside the window.
- from = null;
- to = targetInst;
- }
-
- if (from === to) {
- // Nothing pertains to our managed components.
- return null;
- }
-
- var eventInterface = void 0,
- leaveEventType = void 0,
- enterEventType = void 0,
- eventTypePrefix = void 0;
-
- if (topLevelType === TOP_MOUSE_OUT || topLevelType === TOP_MOUSE_OVER) {
- eventInterface = SyntheticMouseEvent;
- leaveEventType = eventTypes$2.mouseLeave;
- enterEventType = eventTypes$2.mouseEnter;
- eventTypePrefix = 'mouse';
- } else if (topLevelType === TOP_POINTER_OUT || topLevelType === TOP_POINTER_OVER) {
- eventInterface = SyntheticPointerEvent;
- leaveEventType = eventTypes$2.pointerLeave;
- enterEventType = eventTypes$2.pointerEnter;
- eventTypePrefix = 'pointer';
- }
-
- var fromNode = from == null ? win : getNodeFromInstance$1(from);
- var toNode = to == null ? win : getNodeFromInstance$1(to);
-
- var leave = eventInterface.getPooled(leaveEventType, from, nativeEvent, nativeEventTarget);
- leave.type = eventTypePrefix + 'leave';
- leave.target = fromNode;
- leave.relatedTarget = toNode;
-
- var enter = eventInterface.getPooled(enterEventType, to, nativeEvent, nativeEventTarget);
- enter.type = eventTypePrefix + 'enter';
- enter.target = toNode;
- enter.relatedTarget = fromNode;
-
- accumulateEnterLeaveDispatches(leave, enter, from, to);
-
- return [leave, enter];
- }
-};
-
-/*eslint-disable no-self-compare */
-
-var hasOwnProperty$1 = Object.prototype.hasOwnProperty;
-
-/**
- * inlined Object.is polyfill to avoid requiring consumers ship their own
- * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
- */
-function is(x, y) {
- // SameValue algorithm
- if (x === y) {
- // Steps 1-5, 7-10
- // Steps 6.b-6.e: +0 != -0
- // Added the nonzero y check to make Flow happy, but it is redundant
- return x !== 0 || y !== 0 || 1 / x === 1 / y;
- } else {
- // Step 6.a: NaN == NaN
- return x !== x && y !== y;
- }
-}
-
-/**
- * Performs equality by iterating through keys on an object and returning false
- * when any key has values which are not strictly equal between the arguments.
- * Returns true when the values of all keys are strictly equal.
- */
-function shallowEqual(objA, objB) {
- if (is(objA, objB)) {
- return true;
- }
-
- if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {
- return false;
- }
-
- var keysA = Object.keys(objA);
- var keysB = Object.keys(objB);
-
- if (keysA.length !== keysB.length) {
- return false;
- }
-
- // Test for A's keys different from B.
- for (var i = 0; i < keysA.length; i++) {
- if (!hasOwnProperty$1.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {
- return false;
- }
- }
-
- return true;
-}
-
-/**
- * `ReactInstanceMap` maintains a mapping from a public facing stateful
- * instance (key) and the internal representation (value). This allows public
- * methods to accept the user facing instance as an argument and map them back
- * to internal methods.
- *
- * Note that this module is currently shared and assumed to be stateless.
- * If this becomes an actual Map, that will break.
- */
-
-/**
- * This API should be called `delete` but we'd have to make sure to always
- * transform these to strings for IE support. When this transform is fully
- * supported we can rename it.
- */
-
-
-function get(key) {
- return key._reactInternalFiber;
-}
-
-function has(key) {
- return key._reactInternalFiber !== undefined;
-}
-
-function set(key, value) {
- key._reactInternalFiber = value;
-}
-
-// Don't change these two values. They're used by React Dev Tools.
-var NoEffect = /* */0;
-var PerformedWork = /* */1;
-
-// You can change the rest (and add more).
-var Placement = /* */2;
-var Update = /* */4;
-var PlacementAndUpdate = /* */6;
-var Deletion = /* */8;
-var ContentReset = /* */16;
-var Callback = /* */32;
-var DidCapture = /* */64;
-var Ref = /* */128;
-var Snapshot = /* */256;
-
-// Update & Callback & Ref & Snapshot
-var LifecycleEffectMask = /* */420;
-
-// Union of all host effects
-var HostEffectMask = /* */511;
-
-var Incomplete = /* */512;
-var ShouldCapture = /* */1024;
-
-var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;
-
-var MOUNTING = 1;
-var MOUNTED = 2;
-var UNMOUNTED = 3;
-
-function isFiberMountedImpl(fiber) {
- var node = fiber;
- if (!fiber.alternate) {
- // If there is no alternate, this might be a new tree that isn't inserted
- // yet. If it is, then it will have a pending insertion effect on it.
- if ((node.effectTag & Placement) !== NoEffect) {
- return MOUNTING;
- }
- while (node.return) {
- node = node.return;
- if ((node.effectTag & Placement) !== NoEffect) {
- return MOUNTING;
- }
- }
- } else {
- while (node.return) {
- node = node.return;
- }
- }
- if (node.tag === HostRoot) {
- // TODO: Check if this was a nested HostRoot when used with
- // renderContainerIntoSubtree.
- return MOUNTED;
- }
- // If we didn't hit the root, that means that we're in an disconnected tree
- // that has been unmounted.
- return UNMOUNTED;
-}
-
-function isFiberMounted(fiber) {
- return isFiberMountedImpl(fiber) === MOUNTED;
-}
-
-function isMounted(component) {
- {
- var owner = ReactCurrentOwner$1.current;
- if (owner !== null && (owner.tag === ClassComponent || owner.tag === ClassComponentLazy)) {
- var ownerFiber = owner;
- var instance = ownerFiber.stateNode;
- !instance._warnedAboutRefsInRender ? warningWithoutStack$1(false, '%s is accessing isMounted inside its render() function. ' + 'render() should be a pure function of props and state. It should ' + 'never access something that requires stale data from the previous ' + 'render, such as refs. Move this logic to componentDidMount and ' + 'componentDidUpdate instead.', getComponentName(ownerFiber.type) || 'A component') : void 0;
- instance._warnedAboutRefsInRender = true;
- }
- }
-
- var fiber = get(component);
- if (!fiber) {
- return false;
- }
- return isFiberMountedImpl(fiber) === MOUNTED;
-}
-
-function assertIsMounted(fiber) {
- !(isFiberMountedImpl(fiber) === MOUNTED) ? invariant(false, 'Unable to find node on an unmounted component.') : void 0;
-}
-
-function findCurrentFiberUsingSlowPath(fiber) {
- var alternate = fiber.alternate;
- if (!alternate) {
- // If there is no alternate, then we only need to check if it is mounted.
- var state = isFiberMountedImpl(fiber);
- !(state !== UNMOUNTED) ? invariant(false, 'Unable to find node on an unmounted component.') : void 0;
- if (state === MOUNTING) {
- return null;
- }
- return fiber;
- }
- // If we have two possible branches, we'll walk backwards up to the root
- // to see what path the root points to. On the way we may hit one of the
- // special cases and we'll deal with them.
- var a = fiber;
- var b = alternate;
- while (true) {
- var parentA = a.return;
- var parentB = parentA ? parentA.alternate : null;
- if (!parentA || !parentB) {
- // We're at the root.
- break;
- }
-
- // If both copies of the parent fiber point to the same child, we can
- // assume that the child is current. This happens when we bailout on low
- // priority: the bailed out fiber's child reuses the current child.
- if (parentA.child === parentB.child) {
- var child = parentA.child;
- while (child) {
- if (child === a) {
- // We've determined that A is the current branch.
- assertIsMounted(parentA);
- return fiber;
- }
- if (child === b) {
- // We've determined that B is the current branch.
- assertIsMounted(parentA);
- return alternate;
- }
- child = child.sibling;
- }
- // We should never have an alternate for any mounting node. So the only
- // way this could possibly happen is if this was unmounted, if at all.
- invariant(false, 'Unable to find node on an unmounted component.');
- }
-
- if (a.return !== b.return) {
- // The return pointer of A and the return pointer of B point to different
- // fibers. We assume that return pointers never criss-cross, so A must
- // belong to the child set of A.return, and B must belong to the child
- // set of B.return.
- a = parentA;
- b = parentB;
- } else {
- // The return pointers point to the same fiber. We'll have to use the
- // default, slow path: scan the child sets of each parent alternate to see
- // which child belongs to which set.
- //
- // Search parent A's child set
- var didFindChild = false;
- var _child = parentA.child;
- while (_child) {
- if (_child === a) {
- didFindChild = true;
- a = parentA;
- b = parentB;
- break;
- }
- if (_child === b) {
- didFindChild = true;
- b = parentA;
- a = parentB;
- break;
- }
- _child = _child.sibling;
- }
- if (!didFindChild) {
- // Search parent B's child set
- _child = parentB.child;
- while (_child) {
- if (_child === a) {
- didFindChild = true;
- a = parentB;
- b = parentA;
- break;
- }
- if (_child === b) {
- didFindChild = true;
- b = parentB;
- a = parentA;
- break;
- }
- _child = _child.sibling;
- }
- !didFindChild ? invariant(false, 'Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue.') : void 0;
- }
- }
-
- !(a.alternate === b) ? invariant(false, 'Return fibers should always be each others\' alternates. This error is likely caused by a bug in React. Please file an issue.') : void 0;
- }
- // If the root is not a host container, we're in a disconnected tree. I.e.
- // unmounted.
- !(a.tag === HostRoot) ? invariant(false, 'Unable to find node on an unmounted component.') : void 0;
- if (a.stateNode.current === a) {
- // We've determined that A is the current branch.
- return fiber;
- }
- // Otherwise B has to be current branch.
- return alternate;
-}
-
-function findCurrentHostFiber(parent) {
- var currentParent = findCurrentFiberUsingSlowPath(parent);
- if (!currentParent) {
- return null;
- }
-
- // Next we'll drill down this component to find the first HostComponent/Text.
- var node = currentParent;
- while (true) {
- if (node.tag === HostComponent || node.tag === HostText) {
- return node;
- } else if (node.child) {
- node.child.return = node;
- node = node.child;
- continue;
- }
- if (node === currentParent) {
- return null;
- }
- while (!node.sibling) {
- if (!node.return || node.return === currentParent) {
- return null;
- }
- node = node.return;
- }
- node.sibling.return = node.return;
- node = node.sibling;
- }
- // Flow needs the return null here, but ESLint complains about it.
- // eslint-disable-next-line no-unreachable
- return null;
-}
-
-function findCurrentHostFiberWithNoPortals(parent) {
- var currentParent = findCurrentFiberUsingSlowPath(parent);
- if (!currentParent) {
- return null;
- }
-
- // Next we'll drill down this component to find the first HostComponent/Text.
- var node = currentParent;
- while (true) {
- if (node.tag === HostComponent || node.tag === HostText) {
- return node;
- } else if (node.child && node.tag !== HostPortal) {
- node.child.return = node;
- node = node.child;
- continue;
- }
- if (node === currentParent) {
- return null;
- }
- while (!node.sibling) {
- if (!node.return || node.return === currentParent) {
- return null;
- }
- node = node.return;
- }
- node.sibling.return = node.return;
- node = node.sibling;
- }
- // Flow needs the return null here, but ESLint complains about it.
- // eslint-disable-next-line no-unreachable
- return null;
-}
-
-function addEventBubbleListener(element, eventType, listener) {
- element.addEventListener(eventType, listener, false);
-}
-
-function addEventCaptureListener(element, eventType, listener) {
- element.addEventListener(eventType, listener, true);
-}
-
-/**
- * @interface Event
- * @see http://www.w3.org/TR/css3-animations/#AnimationEvent-interface
- * @see https://developer.mozilla.org/en-US/docs/Web/API/AnimationEvent
- */
-var SyntheticAnimationEvent = SyntheticEvent.extend({
- animationName: null,
- elapsedTime: null,
- pseudoElement: null
-});
-
-/**
- * @interface Event
- * @see http://www.w3.org/TR/clipboard-apis/
- */
-var SyntheticClipboardEvent = SyntheticEvent.extend({
- clipboardData: function (event) {
- return 'clipboardData' in event ? event.clipboardData : window.clipboardData;
- }
-});
-
-/**
- * @interface FocusEvent
- * @see http://www.w3.org/TR/DOM-Level-3-Events/
- */
-var SyntheticFocusEvent = SyntheticUIEvent.extend({
- relatedTarget: null
-});
-
-/**
- * `charCode` represents the actual "character code" and is safe to use with
- * `String.fromCharCode`. As such, only keys that correspond to printable
- * characters produce a valid `charCode`, the only exception to this is Enter.
- * The Tab-key is considered non-printable and does not have a `charCode`,
- * presumably because it does not produce a tab-character in browsers.
- *
- * @param {object} nativeEvent Native browser event.
- * @return {number} Normalized `charCode` property.
- */
-function getEventCharCode(nativeEvent) {
- var charCode = void 0;
- var keyCode = nativeEvent.keyCode;
-
- if ('charCode' in nativeEvent) {
- charCode = nativeEvent.charCode;
-
- // FF does not set `charCode` for the Enter-key, check against `keyCode`.
- if (charCode === 0 && keyCode === 13) {
- charCode = 13;
- }
- } else {
- // IE8 does not implement `charCode`, but `keyCode` has the correct value.
- charCode = keyCode;
- }
-
- // IE and Edge (on Windows) and Chrome / Safari (on Windows and Linux)
- // report Enter as charCode 10 when ctrl is pressed.
- if (charCode === 10) {
- charCode = 13;
- }
-
- // Some non-printable keys are reported in `charCode`/`keyCode`, discard them.
- // Must not discard the (non-)printable Enter-key.
- if (charCode >= 32 || charCode === 13) {
- return charCode;
- }
-
- return 0;
-}
-
-/**
- * Normalization of deprecated HTML5 `key` values
- * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names
- */
-var normalizeKey = {
- Esc: 'Escape',
- Spacebar: ' ',
- Left: 'ArrowLeft',
- Up: 'ArrowUp',
- Right: 'ArrowRight',
- Down: 'ArrowDown',
- Del: 'Delete',
- Win: 'OS',
- Menu: 'ContextMenu',
- Apps: 'ContextMenu',
- Scroll: 'ScrollLock',
- MozPrintableKey: 'Unidentified'
-};
-
-/**
- * Translation from legacy `keyCode` to HTML5 `key`
- * Only special keys supported, all others depend on keyboard layout or browser
- * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names
- */
-var translateToKey = {
- '8': 'Backspace',
- '9': 'Tab',
- '12': 'Clear',
- '13': 'Enter',
- '16': 'Shift',
- '17': 'Control',
- '18': 'Alt',
- '19': 'Pause',
- '20': 'CapsLock',
- '27': 'Escape',
- '32': ' ',
- '33': 'PageUp',
- '34': 'PageDown',
- '35': 'End',
- '36': 'Home',
- '37': 'ArrowLeft',
- '38': 'ArrowUp',
- '39': 'ArrowRight',
- '40': 'ArrowDown',
- '45': 'Insert',
- '46': 'Delete',
- '112': 'F1',
- '113': 'F2',
- '114': 'F3',
- '115': 'F4',
- '116': 'F5',
- '117': 'F6',
- '118': 'F7',
- '119': 'F8',
- '120': 'F9',
- '121': 'F10',
- '122': 'F11',
- '123': 'F12',
- '144': 'NumLock',
- '145': 'ScrollLock',
- '224': 'Meta'
-};
-
-/**
- * @param {object} nativeEvent Native browser event.
- * @return {string} Normalized `key` property.
- */
-function getEventKey(nativeEvent) {
- if (nativeEvent.key) {
- // Normalize inconsistent values reported by browsers due to
- // implementations of a working draft specification.
-
- // FireFox implements `key` but returns `MozPrintableKey` for all
- // printable characters (normalized to `Unidentified`), ignore it.
- var key = normalizeKey[nativeEvent.key] || nativeEvent.key;
- if (key !== 'Unidentified') {
- return key;
- }
- }
-
- // Browser does not implement `key`, polyfill as much of it as we can.
- if (nativeEvent.type === 'keypress') {
- var charCode = getEventCharCode(nativeEvent);
-
- // The enter-key is technically both printable and non-printable and can
- // thus be captured by `keypress`, no other non-printable key should.
- return charCode === 13 ? 'Enter' : String.fromCharCode(charCode);
- }
- if (nativeEvent.type === 'keydown' || nativeEvent.type === 'keyup') {
- // While user keyboard layout determines the actual meaning of each
- // `keyCode` value, almost all function keys have a universal value.
- return translateToKey[nativeEvent.keyCode] || 'Unidentified';
- }
- return '';
-}
-
-/**
- * @interface KeyboardEvent
- * @see http://www.w3.org/TR/DOM-Level-3-Events/
- */
-var SyntheticKeyboardEvent = SyntheticUIEvent.extend({
- key: getEventKey,
- location: null,
- ctrlKey: null,
- shiftKey: null,
- altKey: null,
- metaKey: null,
- repeat: null,
- locale: null,
- getModifierState: getEventModifierState,
- // Legacy Interface
- charCode: function (event) {
- // `charCode` is the result of a KeyPress event and represents the value of
- // the actual printable character.
-
- // KeyPress is deprecated, but its replacement is not yet final and not
- // implemented in any major browser. Only KeyPress has charCode.
- if (event.type === 'keypress') {
- return getEventCharCode(event);
- }
- return 0;
- },
- keyCode: function (event) {
- // `keyCode` is the result of a KeyDown/Up event and represents the value of
- // physical keyboard key.
-
- // The actual meaning of the value depends on the users' keyboard layout
- // which cannot be detected. Assuming that it is a US keyboard layout
- // provides a surprisingly accurate mapping for US and European users.
- // Due to this, it is left to the user to implement at this time.
- if (event.type === 'keydown' || event.type === 'keyup') {
- return event.keyCode;
- }
- return 0;
- },
- which: function (event) {
- // `which` is an alias for either `keyCode` or `charCode` depending on the
- // type of the event.
- if (event.type === 'keypress') {
- return getEventCharCode(event);
- }
- if (event.type === 'keydown' || event.type === 'keyup') {
- return event.keyCode;
- }
- return 0;
- }
-});
-
-/**
- * @interface DragEvent
- * @see http://www.w3.org/TR/DOM-Level-3-Events/
- */
-var SyntheticDragEvent = SyntheticMouseEvent.extend({
- dataTransfer: null
-});
-
-/**
- * @interface TouchEvent
- * @see http://www.w3.org/TR/touch-events/
- */
-var SyntheticTouchEvent = SyntheticUIEvent.extend({
- touches: null,
- targetTouches: null,
- changedTouches: null,
- altKey: null,
- metaKey: null,
- ctrlKey: null,
- shiftKey: null,
- getModifierState: getEventModifierState
-});
-
-/**
- * @interface Event
- * @see http://www.w3.org/TR/2009/WD-css3-transitions-20090320/#transition-events-
- * @see https://developer.mozilla.org/en-US/docs/Web/API/TransitionEvent
- */
-var SyntheticTransitionEvent = SyntheticEvent.extend({
- propertyName: null,
- elapsedTime: null,
- pseudoElement: null
-});
-
-/**
- * @interface WheelEvent
- * @see http://www.w3.org/TR/DOM-Level-3-Events/
- */
-var SyntheticWheelEvent = SyntheticMouseEvent.extend({
- deltaX: function (event) {
- return 'deltaX' in event ? event.deltaX : // Fallback to `wheelDeltaX` for Webkit and normalize (right is positive).
- 'wheelDeltaX' in event ? -event.wheelDeltaX : 0;
- },
- deltaY: function (event) {
- return 'deltaY' in event ? event.deltaY : // Fallback to `wheelDeltaY` for Webkit and normalize (down is positive).
- 'wheelDeltaY' in event ? -event.wheelDeltaY : // Fallback to `wheelDelta` for IE<9 and normalize (down is positive).
- 'wheelDelta' in event ? -event.wheelDelta : 0;
- },
-
- deltaZ: null,
-
- // Browsers without "deltaMode" is reporting in raw wheel delta where one
- // notch on the scroll is always +/- 120, roughly equivalent to pixels.
- // A good approximation of DOM_DELTA_LINE (1) is 5% of viewport size or
- // ~40 pixels, for DOM_DELTA_SCREEN (2) it is 87.5% of viewport size.
- deltaMode: null
-});
-
-/**
- * Turns
- * ['abort', ...]
- * into
- * eventTypes = {
- * 'abort': {
- * phasedRegistrationNames: {
- * bubbled: 'onAbort',
- * captured: 'onAbortCapture',
- * },
- * dependencies: [TOP_ABORT],
- * },
- * ...
- * };
- * topLevelEventsToDispatchConfig = new Map([
- * [TOP_ABORT, { sameConfig }],
- * ]);
- */
-
-var interactiveEventTypeNames = [[TOP_BLUR, 'blur'], [TOP_CANCEL, 'cancel'], [TOP_CLICK, 'click'], [TOP_CLOSE, 'close'], [TOP_CONTEXT_MENU, 'contextMenu'], [TOP_COPY, 'copy'], [TOP_CUT, 'cut'], [TOP_AUX_CLICK, 'auxClick'], [TOP_DOUBLE_CLICK, 'doubleClick'], [TOP_DRAG_END, 'dragEnd'], [TOP_DRAG_START, 'dragStart'], [TOP_DROP, 'drop'], [TOP_FOCUS, 'focus'], [TOP_INPUT, 'input'], [TOP_INVALID, 'invalid'], [TOP_KEY_DOWN, 'keyDown'], [TOP_KEY_PRESS, 'keyPress'], [TOP_KEY_UP, 'keyUp'], [TOP_MOUSE_DOWN, 'mouseDown'], [TOP_MOUSE_UP, 'mouseUp'], [TOP_PASTE, 'paste'], [TOP_PAUSE, 'pause'], [TOP_PLAY, 'play'], [TOP_POINTER_CANCEL, 'pointerCancel'], [TOP_POINTER_DOWN, 'pointerDown'], [TOP_POINTER_UP, 'pointerUp'], [TOP_RATE_CHANGE, 'rateChange'], [TOP_RESET, 'reset'], [TOP_SEEKED, 'seeked'], [TOP_SUBMIT, 'submit'], [TOP_TOUCH_CANCEL, 'touchCancel'], [TOP_TOUCH_END, 'touchEnd'], [TOP_TOUCH_START, 'touchStart'], [TOP_VOLUME_CHANGE, 'volumeChange']];
-var nonInteractiveEventTypeNames = [[TOP_ABORT, 'abort'], [TOP_ANIMATION_END, 'animationEnd'], [TOP_ANIMATION_ITERATION, 'animationIteration'], [TOP_ANIMATION_START, 'animationStart'], [TOP_CAN_PLAY, 'canPlay'], [TOP_CAN_PLAY_THROUGH, 'canPlayThrough'], [TOP_DRAG, 'drag'], [TOP_DRAG_ENTER, 'dragEnter'], [TOP_DRAG_EXIT, 'dragExit'], [TOP_DRAG_LEAVE, 'dragLeave'], [TOP_DRAG_OVER, 'dragOver'], [TOP_DURATION_CHANGE, 'durationChange'], [TOP_EMPTIED, 'emptied'], [TOP_ENCRYPTED, 'encrypted'], [TOP_ENDED, 'ended'], [TOP_ERROR, 'error'], [TOP_GOT_POINTER_CAPTURE, 'gotPointerCapture'], [TOP_LOAD, 'load'], [TOP_LOADED_DATA, 'loadedData'], [TOP_LOADED_METADATA, 'loadedMetadata'], [TOP_LOAD_START, 'loadStart'], [TOP_LOST_POINTER_CAPTURE, 'lostPointerCapture'], [TOP_MOUSE_MOVE, 'mouseMove'], [TOP_MOUSE_OUT, 'mouseOut'], [TOP_MOUSE_OVER, 'mouseOver'], [TOP_PLAYING, 'playing'], [TOP_POINTER_MOVE, 'pointerMove'], [TOP_POINTER_OUT, 'pointerOut'], [TOP_POINTER_OVER, 'pointerOver'], [TOP_PROGRESS, 'progress'], [TOP_SCROLL, 'scroll'], [TOP_SEEKING, 'seeking'], [TOP_STALLED, 'stalled'], [TOP_SUSPEND, 'suspend'], [TOP_TIME_UPDATE, 'timeUpdate'], [TOP_TOGGLE, 'toggle'], [TOP_TOUCH_MOVE, 'touchMove'], [TOP_TRANSITION_END, 'transitionEnd'], [TOP_WAITING, 'waiting'], [TOP_WHEEL, 'wheel']];
-
-var eventTypes$4 = {};
-var topLevelEventsToDispatchConfig = {};
-
-function addEventTypeNameToConfig(_ref, isInteractive) {
- var topEvent = _ref[0],
- event = _ref[1];
-
- var capitalizedEvent = event[0].toUpperCase() + event.slice(1);
- var onEvent = 'on' + capitalizedEvent;
-
- var type = {
- phasedRegistrationNames: {
- bubbled: onEvent,
- captured: onEvent + 'Capture'
- },
- dependencies: [topEvent],
- isInteractive: isInteractive
- };
- eventTypes$4[event] = type;
- topLevelEventsToDispatchConfig[topEvent] = type;
-}
-
-interactiveEventTypeNames.forEach(function (eventTuple) {
- addEventTypeNameToConfig(eventTuple, true);
-});
-nonInteractiveEventTypeNames.forEach(function (eventTuple) {
- addEventTypeNameToConfig(eventTuple, false);
-});
-
-// Only used in DEV for exhaustiveness validation.
-var knownHTMLTopLevelTypes = [TOP_ABORT, TOP_CANCEL, TOP_CAN_PLAY, TOP_CAN_PLAY_THROUGH, TOP_CLOSE, TOP_DURATION_CHANGE, TOP_EMPTIED, TOP_ENCRYPTED, TOP_ENDED, TOP_ERROR, TOP_INPUT, TOP_INVALID, TOP_LOAD, TOP_LOADED_DATA, TOP_LOADED_METADATA, TOP_LOAD_START, TOP_PAUSE, TOP_PLAY, TOP_PLAYING, TOP_PROGRESS, TOP_RATE_CHANGE, TOP_RESET, TOP_SEEKED, TOP_SEEKING, TOP_STALLED, TOP_SUBMIT, TOP_SUSPEND, TOP_TIME_UPDATE, TOP_TOGGLE, TOP_VOLUME_CHANGE, TOP_WAITING];
-
-var SimpleEventPlugin = {
- eventTypes: eventTypes$4,
-
- isInteractiveTopLevelEventType: function (topLevelType) {
- var config = topLevelEventsToDispatchConfig[topLevelType];
- return config !== undefined && config.isInteractive === true;
- },
-
-
- extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
- var dispatchConfig = topLevelEventsToDispatchConfig[topLevelType];
- if (!dispatchConfig) {
- return null;
- }
- var EventConstructor = void 0;
- switch (topLevelType) {
- case TOP_KEY_PRESS:
- // Firefox creates a keypress event for function keys too. This removes
- // the unwanted keypress events. Enter is however both printable and
- // non-printable. One would expect Tab to be as well (but it isn't).
- if (getEventCharCode(nativeEvent) === 0) {
- return null;
- }
- /* falls through */
- case TOP_KEY_DOWN:
- case TOP_KEY_UP:
- EventConstructor = SyntheticKeyboardEvent;
- break;
- case TOP_BLUR:
- case TOP_FOCUS:
- EventConstructor = SyntheticFocusEvent;
- break;
- case TOP_CLICK:
- // Firefox creates a click event on right mouse clicks. This removes the
- // unwanted click events.
- if (nativeEvent.button === 2) {
- return null;
- }
- /* falls through */
- case TOP_AUX_CLICK:
- case TOP_DOUBLE_CLICK:
- case TOP_MOUSE_DOWN:
- case TOP_MOUSE_MOVE:
- case TOP_MOUSE_UP:
- // TODO: Disabled elements should not respond to mouse events
- /* falls through */
- case TOP_MOUSE_OUT:
- case TOP_MOUSE_OVER:
- case TOP_CONTEXT_MENU:
- EventConstructor = SyntheticMouseEvent;
- break;
- case TOP_DRAG:
- case TOP_DRAG_END:
- case TOP_DRAG_ENTER:
- case TOP_DRAG_EXIT:
- case TOP_DRAG_LEAVE:
- case TOP_DRAG_OVER:
- case TOP_DRAG_START:
- case TOP_DROP:
- EventConstructor = SyntheticDragEvent;
- break;
- case TOP_TOUCH_CANCEL:
- case TOP_TOUCH_END:
- case TOP_TOUCH_MOVE:
- case TOP_TOUCH_START:
- EventConstructor = SyntheticTouchEvent;
- break;
- case TOP_ANIMATION_END:
- case TOP_ANIMATION_ITERATION:
- case TOP_ANIMATION_START:
- EventConstructor = SyntheticAnimationEvent;
- break;
- case TOP_TRANSITION_END:
- EventConstructor = SyntheticTransitionEvent;
- break;
- case TOP_SCROLL:
- EventConstructor = SyntheticUIEvent;
- break;
- case TOP_WHEEL:
- EventConstructor = SyntheticWheelEvent;
- break;
- case TOP_COPY:
- case TOP_CUT:
- case TOP_PASTE:
- EventConstructor = SyntheticClipboardEvent;
- break;
- case TOP_GOT_POINTER_CAPTURE:
- case TOP_LOST_POINTER_CAPTURE:
- case TOP_POINTER_CANCEL:
- case TOP_POINTER_DOWN:
- case TOP_POINTER_MOVE:
- case TOP_POINTER_OUT:
- case TOP_POINTER_OVER:
- case TOP_POINTER_UP:
- EventConstructor = SyntheticPointerEvent;
- break;
- default:
- {
- if (knownHTMLTopLevelTypes.indexOf(topLevelType) === -1) {
- warningWithoutStack$1(false, 'SimpleEventPlugin: Unhandled event type, `%s`. This warning ' + 'is likely caused by a bug in React. Please file an issue.', topLevelType);
- }
- }
- // HTML Events
- // @see http://www.w3.org/TR/html5/index.html#events-0
- EventConstructor = SyntheticEvent;
- break;
- }
- var event = EventConstructor.getPooled(dispatchConfig, targetInst, nativeEvent, nativeEventTarget);
- accumulateTwoPhaseDispatches(event);
- return event;
- }
-};
-
-var isInteractiveTopLevelEventType = SimpleEventPlugin.isInteractiveTopLevelEventType;
-
-
-var CALLBACK_BOOKKEEPING_POOL_SIZE = 10;
-var callbackBookkeepingPool = [];
-
-/**
- * Find the deepest React component completely containing the root of the
- * passed-in instance (for use when entire React trees are nested within each
- * other). If React trees are not nested, returns null.
- */
-function findRootContainerNode(inst) {
- // TODO: It may be a good idea to cache this to prevent unnecessary DOM
- // traversal, but caching is difficult to do correctly without using a
- // mutation observer to listen for all DOM changes.
- while (inst.return) {
- inst = inst.return;
- }
- if (inst.tag !== HostRoot) {
- // This can happen if we're in a detached tree.
- return null;
- }
- return inst.stateNode.containerInfo;
-}
-
-// Used to store ancestor hierarchy in top level callback
-function getTopLevelCallbackBookKeeping(topLevelType, nativeEvent, targetInst) {
- if (callbackBookkeepingPool.length) {
- var instance = callbackBookkeepingPool.pop();
- instance.topLevelType = topLevelType;
- instance.nativeEvent = nativeEvent;
- instance.targetInst = targetInst;
- return instance;
- }
- return {
- topLevelType: topLevelType,
- nativeEvent: nativeEvent,
- targetInst: targetInst,
- ancestors: []
- };
-}
-
-function releaseTopLevelCallbackBookKeeping(instance) {
- instance.topLevelType = null;
- instance.nativeEvent = null;
- instance.targetInst = null;
- instance.ancestors.length = 0;
- if (callbackBookkeepingPool.length < CALLBACK_BOOKKEEPING_POOL_SIZE) {
- callbackBookkeepingPool.push(instance);
- }
-}
-
-function handleTopLevel(bookKeeping) {
- var targetInst = bookKeeping.targetInst;
-
- // Loop through the hierarchy, in case there's any nested components.
- // It's important that we build the array of ancestors before calling any
- // event handlers, because event handlers can modify the DOM, leading to
- // inconsistencies with ReactMount's node cache. See #1105.
- var ancestor = targetInst;
- do {
- if (!ancestor) {
- bookKeeping.ancestors.push(ancestor);
- break;
- }
- var root = findRootContainerNode(ancestor);
- if (!root) {
- break;
- }
- bookKeeping.ancestors.push(ancestor);
- ancestor = getClosestInstanceFromNode(root);
- } while (ancestor);
-
- for (var i = 0; i < bookKeeping.ancestors.length; i++) {
- targetInst = bookKeeping.ancestors[i];
- runExtractedEventsInBatch(bookKeeping.topLevelType, targetInst, bookKeeping.nativeEvent, getEventTarget(bookKeeping.nativeEvent));
- }
-}
-
-// TODO: can we stop exporting these?
-var _enabled = true;
-
-function setEnabled(enabled) {
- _enabled = !!enabled;
-}
-
-function isEnabled() {
- return _enabled;
-}
-
-/**
- * Traps top-level events by using event bubbling.
- *
- * @param {number} topLevelType Number from `TopLevelEventTypes`.
- * @param {object} element Element on which to attach listener.
- * @return {?object} An object with a remove function which will forcefully
- * remove the listener.
- * @internal
- */
-function trapBubbledEvent(topLevelType, element) {
- if (!element) {
- return null;
- }
- var dispatch = isInteractiveTopLevelEventType(topLevelType) ? dispatchInteractiveEvent : dispatchEvent;
-
- addEventBubbleListener(element, getRawEventName(topLevelType),
- // Check if interactive and wrap in interactiveUpdates
- dispatch.bind(null, topLevelType));
-}
-
-/**
- * Traps a top-level event by using event capturing.
- *
- * @param {number} topLevelType Number from `TopLevelEventTypes`.
- * @param {object} element Element on which to attach listener.
- * @return {?object} An object with a remove function which will forcefully
- * remove the listener.
- * @internal
- */
-function trapCapturedEvent(topLevelType, element) {
- if (!element) {
- return null;
- }
- var dispatch = isInteractiveTopLevelEventType(topLevelType) ? dispatchInteractiveEvent : dispatchEvent;
-
- addEventCaptureListener(element, getRawEventName(topLevelType),
- // Check if interactive and wrap in interactiveUpdates
- dispatch.bind(null, topLevelType));
-}
-
-function dispatchInteractiveEvent(topLevelType, nativeEvent) {
- interactiveUpdates(dispatchEvent, topLevelType, nativeEvent);
-}
-
-function dispatchEvent(topLevelType, nativeEvent) {
- if (!_enabled) {
- return;
- }
-
- var nativeEventTarget = getEventTarget(nativeEvent);
- var targetInst = getClosestInstanceFromNode(nativeEventTarget);
- if (targetInst !== null && typeof targetInst.tag === 'number' && !isFiberMounted(targetInst)) {
- // If we get an event (ex: img onload) before committing that
- // component's mount, ignore it for now (that is, treat it as if it was an
- // event on a non-React tree). We might also consider queueing events and
- // dispatching them after the mount.
- targetInst = null;
- }
-
- var bookKeeping = getTopLevelCallbackBookKeeping(topLevelType, nativeEvent, targetInst);
-
- try {
- // Event queue being processed in the same cycle allows
- // `preventDefault`.
- batchedUpdates(handleTopLevel, bookKeeping);
- } finally {
- releaseTopLevelCallbackBookKeeping(bookKeeping);
- }
-}
-
-/**
- * Summary of `ReactBrowserEventEmitter` event handling:
- *
- * - Top-level delegation is used to trap most native browser events. This
- * may only occur in the main thread and is the responsibility of
- * ReactDOMEventListener, which is injected and can therefore support
- * pluggable event sources. This is the only work that occurs in the main
- * thread.
- *
- * - We normalize and de-duplicate events to account for browser quirks. This
- * may be done in the worker thread.
- *
- * - Forward these native events (with the associated top-level type used to
- * trap it) to `EventPluginHub`, which in turn will ask plugins if they want
- * to extract any synthetic events.
- *
- * - The `EventPluginHub` will then process each event by annotating them with
- * "dispatches", a sequence of listeners and IDs that care about that event.
- *
- * - The `EventPluginHub` then dispatches the events.
- *
- * Overview of React and the event system:
- *
- * +------------+ .
- * | DOM | .
- * +------------+ .
- * | .
- * v .
- * +------------+ .
- * | ReactEvent | .
- * | Listener | .
- * +------------+ . +-----------+
- * | . +--------+|SimpleEvent|
- * | . | |Plugin |
- * +-----|------+ . v +-----------+
- * | | | . +--------------+ +------------+
- * | +-----------.--->|EventPluginHub| | Event |
- * | | . | | +-----------+ | Propagators|
- * | ReactEvent | . | | |TapEvent | |------------|
- * | Emitter | . | |<---+|Plugin | |other plugin|
- * | | . | | +-----------+ | utilities |
- * | +-----------.--->| | +------------+
- * | | | . +--------------+
- * +-----|------+ . ^ +-----------+
- * | . | |Enter/Leave|
- * + . +-------+|Plugin |
- * +-------------+ . +-----------+
- * | application | .
- * |-------------| .
- * | | .
- * | | .
- * +-------------+ .
- * .
- * React Core . General Purpose Event Plugin System
- */
-
-var alreadyListeningTo = {};
-var reactTopListenersCounter = 0;
-
-/**
- * To ensure no conflicts with other potential React instances on the page
- */
-var topListenersIDKey = '_reactListenersID' + ('' + Math.random()).slice(2);
-
-function getListeningForDocument(mountAt) {
- // In IE8, `mountAt` is a host object and doesn't have `hasOwnProperty`
- // directly.
- if (!Object.prototype.hasOwnProperty.call(mountAt, topListenersIDKey)) {
- mountAt[topListenersIDKey] = reactTopListenersCounter++;
- alreadyListeningTo[mountAt[topListenersIDKey]] = {};
- }
- return alreadyListeningTo[mountAt[topListenersIDKey]];
-}
-
-/**
- * We listen for bubbled touch events on the document object.
- *
- * Firefox v8.01 (and possibly others) exhibited strange behavior when
- * mounting `onmousemove` events at some node that was not the document
- * element. The symptoms were that if your mouse is not moving over something
- * contained within that mount point (for example on the background) the
- * top-level listeners for `onmousemove` won't be called. However, if you
- * register the `mousemove` on the document object, then it will of course
- * catch all `mousemove`s. This along with iOS quirks, justifies restricting
- * top-level listeners to the document object only, at least for these
- * movement types of events and possibly all events.
- *
- * @see http://www.quirksmode.org/blog/archives/2010/09/click_event_del.html
- *
- * Also, `keyup`/`keypress`/`keydown` do not bubble to the window on IE, but
- * they bubble to document.
- *
- * @param {string} registrationName Name of listener (e.g. `onClick`).
- * @param {object} mountAt Container where to mount the listener
- */
-function listenTo(registrationName, mountAt) {
- var isListening = getListeningForDocument(mountAt);
- var dependencies = registrationNameDependencies[registrationName];
-
- for (var i = 0; i < dependencies.length; i++) {
- var dependency = dependencies[i];
- if (!(isListening.hasOwnProperty(dependency) && isListening[dependency])) {
- switch (dependency) {
- case TOP_SCROLL:
- trapCapturedEvent(TOP_SCROLL, mountAt);
- break;
- case TOP_FOCUS:
- case TOP_BLUR:
- trapCapturedEvent(TOP_FOCUS, mountAt);
- trapCapturedEvent(TOP_BLUR, mountAt);
- // We set the flag for a single dependency later in this function,
- // but this ensures we mark both as attached rather than just one.
- isListening[TOP_BLUR] = true;
- isListening[TOP_FOCUS] = true;
- break;
- case TOP_CANCEL:
- case TOP_CLOSE:
- if (isEventSupported(getRawEventName(dependency))) {
- trapCapturedEvent(dependency, mountAt);
- }
- break;
- case TOP_INVALID:
- case TOP_SUBMIT:
- case TOP_RESET:
- // We listen to them on the target DOM elements.
- // Some of them bubble so we don't want them to fire twice.
- break;
- default:
- // By default, listen on the top level to all non-media events.
- // Media events don't bubble so adding the listener wouldn't do anything.
- var isMediaEvent = mediaEventTypes.indexOf(dependency) !== -1;
- if (!isMediaEvent) {
- trapBubbledEvent(dependency, mountAt);
- }
- break;
- }
- isListening[dependency] = true;
- }
- }
-}
-
-function isListeningToAllDependencies(registrationName, mountAt) {
- var isListening = getListeningForDocument(mountAt);
- var dependencies = registrationNameDependencies[registrationName];
- for (var i = 0; i < dependencies.length; i++) {
- var dependency = dependencies[i];
- if (!(isListening.hasOwnProperty(dependency) && isListening[dependency])) {
- return false;
- }
- }
- return true;
-}
-
-function getActiveElement(doc) {
- doc = doc || (typeof document !== 'undefined' ? document : undefined);
- if (typeof doc === 'undefined') {
- return null;
- }
- try {
- return doc.activeElement || doc.body;
- } catch (e) {
- return doc.body;
- }
-}
-
-/**
- * Given any node return the first leaf node without children.
- *
- * @param {DOMElement|DOMTextNode} node
- * @return {DOMElement|DOMTextNode}
- */
-function getLeafNode(node) {
- while (node && node.firstChild) {
- node = node.firstChild;
- }
- return node;
-}
-
-/**
- * Get the next sibling within a container. This will walk up the
- * DOM if a node's siblings have been exhausted.
- *
- * @param {DOMElement|DOMTextNode} node
- * @return {?DOMElement|DOMTextNode}
- */
-function getSiblingNode(node) {
- while (node) {
- if (node.nextSibling) {
- return node.nextSibling;
- }
- node = node.parentNode;
- }
-}
-
-/**
- * Get object describing the nodes which contain characters at offset.
- *
- * @param {DOMElement|DOMTextNode} root
- * @param {number} offset
- * @return {?object}
- */
-function getNodeForCharacterOffset(root, offset) {
- var node = getLeafNode(root);
- var nodeStart = 0;
- var nodeEnd = 0;
-
- while (node) {
- if (node.nodeType === TEXT_NODE) {
- nodeEnd = nodeStart + node.textContent.length;
-
- if (nodeStart <= offset && nodeEnd >= offset) {
- return {
- node: node,
- offset: offset - nodeStart
- };
- }
-
- nodeStart = nodeEnd;
- }
-
- node = getLeafNode(getSiblingNode(node));
- }
-}
-
-/**
- * @param {DOMElement} outerNode
- * @return {?object}
- */
-function getOffsets(outerNode) {
- var ownerDocument = outerNode.ownerDocument;
-
- var win = ownerDocument && ownerDocument.defaultView || window;
- var selection = win.getSelection && win.getSelection();
-
- if (!selection || selection.rangeCount === 0) {
- return null;
- }
-
- var anchorNode = selection.anchorNode,
- anchorOffset = selection.anchorOffset,
- focusNode = selection.focusNode,
- focusOffset = selection.focusOffset;
-
- // In Firefox, anchorNode and focusNode can be "anonymous divs", e.g. the
- // up/down buttons on an . Anonymous divs do not seem to
- // expose properties, triggering a "Permission denied error" if any of its
- // properties are accessed. The only seemingly possible way to avoid erroring
- // is to access a property that typically works for non-anonymous divs and
- // catch any error that may otherwise arise. See
- // https://bugzilla.mozilla.org/show_bug.cgi?id=208427
-
- try {
- /* eslint-disable no-unused-expressions */
- anchorNode.nodeType;
- focusNode.nodeType;
- /* eslint-enable no-unused-expressions */
- } catch (e) {
- return null;
- }
-
- return getModernOffsetsFromPoints(outerNode, anchorNode, anchorOffset, focusNode, focusOffset);
-}
-
-/**
- * Returns {start, end} where `start` is the character/codepoint index of
- * (anchorNode, anchorOffset) within the textContent of `outerNode`, and
- * `end` is the index of (focusNode, focusOffset).
- *
- * Returns null if you pass in garbage input but we should probably just crash.
- *
- * Exported only for testing.
- */
-function getModernOffsetsFromPoints(outerNode, anchorNode, anchorOffset, focusNode, focusOffset) {
- var length = 0;
- var start = -1;
- var end = -1;
- var indexWithinAnchor = 0;
- var indexWithinFocus = 0;
- var node = outerNode;
- var parentNode = null;
-
- outer: while (true) {
- var next = null;
-
- while (true) {
- if (node === anchorNode && (anchorOffset === 0 || node.nodeType === TEXT_NODE)) {
- start = length + anchorOffset;
- }
- if (node === focusNode && (focusOffset === 0 || node.nodeType === TEXT_NODE)) {
- end = length + focusOffset;
- }
-
- if (node.nodeType === TEXT_NODE) {
- length += node.nodeValue.length;
- }
-
- if ((next = node.firstChild) === null) {
- break;
- }
- // Moving from `node` to its first child `next`.
- parentNode = node;
- node = next;
- }
-
- while (true) {
- if (node === outerNode) {
- // If `outerNode` has children, this is always the second time visiting
- // it. If it has no children, this is still the first loop, and the only
- // valid selection is anchorNode and focusNode both equal to this node
- // and both offsets 0, in which case we will have handled above.
- break outer;
- }
- if (parentNode === anchorNode && ++indexWithinAnchor === anchorOffset) {
- start = length;
- }
- if (parentNode === focusNode && ++indexWithinFocus === focusOffset) {
- end = length;
- }
- if ((next = node.nextSibling) !== null) {
- break;
- }
- node = parentNode;
- parentNode = node.parentNode;
- }
-
- // Moving from `node` to its next sibling `next`.
- node = next;
- }
-
- if (start === -1 || end === -1) {
- // This should never happen. (Would happen if the anchor/focus nodes aren't
- // actually inside the passed-in node.)
- return null;
- }
-
- return {
- start: start,
- end: end
- };
-}
-
-/**
- * In modern non-IE browsers, we can support both forward and backward
- * selections.
- *
- * Note: IE10+ supports the Selection object, but it does not support
- * the `extend` method, which means that even in modern IE, it's not possible
- * to programmatically create a backward selection. Thus, for all IE
- * versions, we use the old IE API to create our selections.
- *
- * @param {DOMElement|DOMTextNode} node
- * @param {object} offsets
- */
-function setOffsets(node, offsets) {
- var doc = node.ownerDocument || document;
- var win = doc && doc.defaultView || window;
- var selection = win.getSelection();
- var length = node.textContent.length;
- var start = Math.min(offsets.start, length);
- var end = offsets.end === undefined ? start : Math.min(offsets.end, length);
-
- // IE 11 uses modern selection, but doesn't support the extend method.
- // Flip backward selections, so we can set with a single range.
- if (!selection.extend && start > end) {
- var temp = end;
- end = start;
- start = temp;
- }
-
- var startMarker = getNodeForCharacterOffset(node, start);
- var endMarker = getNodeForCharacterOffset(node, end);
-
- if (startMarker && endMarker) {
- if (selection.rangeCount === 1 && selection.anchorNode === startMarker.node && selection.anchorOffset === startMarker.offset && selection.focusNode === endMarker.node && selection.focusOffset === endMarker.offset) {
- return;
- }
- var range = doc.createRange();
- range.setStart(startMarker.node, startMarker.offset);
- selection.removeAllRanges();
-
- if (start > end) {
- selection.addRange(range);
- selection.extend(endMarker.node, endMarker.offset);
- } else {
- range.setEnd(endMarker.node, endMarker.offset);
- selection.addRange(range);
- }
- }
-}
-
-function isTextNode(node) {
- return node && node.nodeType === TEXT_NODE;
-}
-
-function containsNode(outerNode, innerNode) {
- if (!outerNode || !innerNode) {
- return false;
- } else if (outerNode === innerNode) {
- return true;
- } else if (isTextNode(outerNode)) {
- return false;
- } else if (isTextNode(innerNode)) {
- return containsNode(outerNode, innerNode.parentNode);
- } else if ('contains' in outerNode) {
- return outerNode.contains(innerNode);
- } else if (outerNode.compareDocumentPosition) {
- return !!(outerNode.compareDocumentPosition(innerNode) & 16);
- } else {
- return false;
- }
-}
-
-function isInDocument(node) {
- return node && node.ownerDocument && containsNode(node.ownerDocument.documentElement, node);
-}
-
-function getActiveElementDeep() {
- var win = window;
- var element = getActiveElement();
- while (element instanceof win.HTMLIFrameElement) {
- // Accessing the contentDocument of a HTMLIframeElement can cause the browser
- // to throw, e.g. if it has a cross-origin src attribute
- try {
- win = element.contentDocument.defaultView;
- } catch (e) {
- return element;
- }
- element = getActiveElement(win.document);
- }
- return element;
-}
-
-/**
- * @ReactInputSelection: React input selection module. Based on Selection.js,
- * but modified to be suitable for react and has a couple of bug fixes (doesn't
- * assume buttons have range selections allowed).
- * Input selection module for React.
- */
-
-/**
- * @hasSelectionCapabilities: we get the element types that support selection
- * from https://html.spec.whatwg.org/#do-not-apply, looking at `selectionStart`
- * and `selectionEnd` rows.
- */
-function hasSelectionCapabilities(elem) {
- var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
- return nodeName && (nodeName === 'input' && (elem.type === 'text' || elem.type === 'search' || elem.type === 'tel' || elem.type === 'url' || elem.type === 'password') || nodeName === 'textarea' || elem.contentEditable === 'true');
-}
-
-function getSelectionInformation() {
- var focusedElem = getActiveElementDeep();
- return {
- focusedElem: focusedElem,
- selectionRange: hasSelectionCapabilities(focusedElem) ? getSelection$1(focusedElem) : null
- };
-}
-
-/**
- * @restoreSelection: If any selection information was potentially lost,
- * restore it. This is useful when performing operations that could remove dom
- * nodes and place them back in, resulting in focus being lost.
- */
-function restoreSelection(priorSelectionInformation) {
- var curFocusedElem = getActiveElementDeep();
- var priorFocusedElem = priorSelectionInformation.focusedElem;
- var priorSelectionRange = priorSelectionInformation.selectionRange;
- if (curFocusedElem !== priorFocusedElem && isInDocument(priorFocusedElem)) {
- if (priorSelectionRange !== null && hasSelectionCapabilities(priorFocusedElem)) {
- setSelection(priorFocusedElem, priorSelectionRange);
- }
-
- // Focusing a node can change the scroll position, which is undesirable
- var ancestors = [];
- var ancestor = priorFocusedElem;
- while (ancestor = ancestor.parentNode) {
- if (ancestor.nodeType === ELEMENT_NODE) {
- ancestors.push({
- element: ancestor,
- left: ancestor.scrollLeft,
- top: ancestor.scrollTop
- });
- }
- }
-
- if (typeof priorFocusedElem.focus === 'function') {
- priorFocusedElem.focus();
- }
-
- for (var i = 0; i < ancestors.length; i++) {
- var info = ancestors[i];
- info.element.scrollLeft = info.left;
- info.element.scrollTop = info.top;
- }
- }
-}
-
-/**
- * @getSelection: Gets the selection bounds of a focused textarea, input or
- * contentEditable node.
- * -@input: Look up selection bounds of this input
- * -@return {start: selectionStart, end: selectionEnd}
- */
-function getSelection$1(input) {
- var selection = void 0;
-
- if ('selectionStart' in input) {
- // Modern browser with input or textarea.
- selection = {
- start: input.selectionStart,
- end: input.selectionEnd
- };
- } else {
- // Content editable or old IE textarea.
- selection = getOffsets(input);
- }
-
- return selection || { start: 0, end: 0 };
-}
-
-/**
- * @setSelection: Sets the selection bounds of a textarea or input and focuses
- * the input.
- * -@input Set selection bounds of this input or textarea
- * -@offsets Object of same form that is returned from get*
- */
-function setSelection(input, offsets) {
- var start = offsets.start,
- end = offsets.end;
-
- if (end === undefined) {
- end = start;
- }
-
- if ('selectionStart' in input) {
- input.selectionStart = start;
- input.selectionEnd = Math.min(end, input.value.length);
- } else {
- setOffsets(input, offsets);
- }
-}
-
-var skipSelectionChangeEvent = canUseDOM && 'documentMode' in document && document.documentMode <= 11;
-
-var eventTypes$3 = {
- select: {
- phasedRegistrationNames: {
- bubbled: 'onSelect',
- captured: 'onSelectCapture'
- },
- dependencies: [TOP_BLUR, TOP_CONTEXT_MENU, TOP_DRAG_END, TOP_FOCUS, TOP_KEY_DOWN, TOP_KEY_UP, TOP_MOUSE_DOWN, TOP_MOUSE_UP, TOP_SELECTION_CHANGE]
- }
-};
-
-var activeElement$1 = null;
-var activeElementInst$1 = null;
-var lastSelection = null;
-var mouseDown = false;
-
-/**
- * Get an object which is a unique representation of the current selection.
- *
- * The return value will not be consistent across nodes or browsers, but
- * two identical selections on the same node will return identical objects.
- *
- * @param {DOMElement} node
- * @return {object}
- */
-function getSelection(node) {
- if ('selectionStart' in node && hasSelectionCapabilities(node)) {
- return {
- start: node.selectionStart,
- end: node.selectionEnd
- };
- } else {
- var win = node.ownerDocument && node.ownerDocument.defaultView || window;
- var selection = win.getSelection();
- return {
- anchorNode: selection.anchorNode,
- anchorOffset: selection.anchorOffset,
- focusNode: selection.focusNode,
- focusOffset: selection.focusOffset
- };
- }
-}
-
-/**
- * Get document associated with the event target.
- *
- * @param {object} nativeEventTarget
- * @return {Document}
- */
-function getEventTargetDocument(eventTarget) {
- return eventTarget.window === eventTarget ? eventTarget.document : eventTarget.nodeType === DOCUMENT_NODE ? eventTarget : eventTarget.ownerDocument;
-}
-
-/**
- * Poll selection to see whether it's changed.
- *
- * @param {object} nativeEvent
- * @param {object} nativeEventTarget
- * @return {?SyntheticEvent}
- */
-function constructSelectEvent(nativeEvent, nativeEventTarget) {
- // Ensure we have the right element, and that the user is not dragging a
- // selection (this matches native `select` event behavior). In HTML5, select
- // fires only on input and textarea thus if there's no focused element we
- // won't dispatch.
- var doc = getEventTargetDocument(nativeEventTarget);
-
- if (mouseDown || activeElement$1 == null || activeElement$1 !== getActiveElement(doc)) {
- return null;
- }
-
- // Only fire when selection has actually changed.
- var currentSelection = getSelection(activeElement$1);
- if (!lastSelection || !shallowEqual(lastSelection, currentSelection)) {
- lastSelection = currentSelection;
-
- var syntheticEvent = SyntheticEvent.getPooled(eventTypes$3.select, activeElementInst$1, nativeEvent, nativeEventTarget);
-
- syntheticEvent.type = 'select';
- syntheticEvent.target = activeElement$1;
-
- accumulateTwoPhaseDispatches(syntheticEvent);
-
- return syntheticEvent;
- }
-
- return null;
-}
-
-/**
- * This plugin creates an `onSelect` event that normalizes select events
- * across form elements.
- *
- * Supported elements are:
- * - input (see `isTextInputElement`)
- * - textarea
- * - contentEditable
- *
- * This differs from native browser implementations in the following ways:
- * - Fires on contentEditable fields as well as inputs.
- * - Fires for collapsed selection.
- * - Fires after user input.
- */
-var SelectEventPlugin = {
- eventTypes: eventTypes$3,
-
- extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
- var doc = getEventTargetDocument(nativeEventTarget);
- // Track whether all listeners exists for this plugin. If none exist, we do
- // not extract events. See #3639.
- if (!doc || !isListeningToAllDependencies('onSelect', doc)) {
- return null;
- }
-
- var targetNode = targetInst ? getNodeFromInstance$1(targetInst) : window;
-
- switch (topLevelType) {
- // Track the input node that has focus.
- case TOP_FOCUS:
- if (isTextInputElement(targetNode) || targetNode.contentEditable === 'true') {
- activeElement$1 = targetNode;
- activeElementInst$1 = targetInst;
- lastSelection = null;
- }
- break;
- case TOP_BLUR:
- activeElement$1 = null;
- activeElementInst$1 = null;
- lastSelection = null;
- break;
- // Don't fire the event while the user is dragging. This matches the
- // semantics of the native select event.
- case TOP_MOUSE_DOWN:
- mouseDown = true;
- break;
- case TOP_CONTEXT_MENU:
- case TOP_MOUSE_UP:
- case TOP_DRAG_END:
- mouseDown = false;
- return constructSelectEvent(nativeEvent, nativeEventTarget);
- // Chrome and IE fire non-standard event when selection is changed (and
- // sometimes when it hasn't). IE's event fires out of order with respect
- // to key and input events on deletion, so we discard it.
- //
- // Firefox doesn't support selectionchange, so check selection status
- // after each key entry. The selection changes after keydown and before
- // keyup, but we check on keydown as well in the case of holding down a
- // key, when multiple keydown events are fired but only one keyup is.
- // This is also our approach for IE handling, for the reason above.
- case TOP_SELECTION_CHANGE:
- if (skipSelectionChangeEvent) {
- break;
- }
- // falls through
- case TOP_KEY_DOWN:
- case TOP_KEY_UP:
- return constructSelectEvent(nativeEvent, nativeEventTarget);
- }
-
- return null;
- }
-};
-
-/**
- * Inject modules for resolving DOM hierarchy and plugin ordering.
- */
-injection.injectEventPluginOrder(DOMEventPluginOrder);
-setComponentTree(getFiberCurrentPropsFromNode$1, getInstanceFromNode$1, getNodeFromInstance$1);
-
-/**
- * Some important event plugins included by default (without having to require
- * them).
- */
-injection.injectEventPluginsByName({
- SimpleEventPlugin: SimpleEventPlugin,
- EnterLeaveEventPlugin: EnterLeaveEventPlugin,
- ChangeEventPlugin: ChangeEventPlugin,
- SelectEventPlugin: SelectEventPlugin,
- BeforeInputEventPlugin: BeforeInputEventPlugin
-});
-
-var didWarnSelectedSetOnOption = false;
-var didWarnInvalidChild = false;
-
-function flattenChildren(children) {
- var content = '';
-
- // Flatten children. We'll warn if they are invalid
- // during validateProps() which runs for hydration too.
- // Note that this would throw on non-element objects.
- // Elements are stringified (which is normally irrelevant
- // but matters for ).
- React.Children.forEach(children, function (child) {
- if (child == null) {
- return;
- }
- content += child;
- // Note: we don't warn about invalid children here.
- // Instead, this is done separately below so that
- // it happens during the hydration codepath too.
- });
-
- return content;
-}
-
-/**
- * Implements an host component that warns when `selected` is set.
- */
-
-function validateProps(element, props) {
- {
- // This mirrors the codepath above, but runs for hydration too.
- // Warn about invalid children here so that client and hydration are consistent.
- // TODO: this seems like it could cause a DEV-only throw for hydration
- // if children contains a non-element object. We should try to avoid that.
- if (typeof props.children === 'object' && props.children !== null) {
- React.Children.forEach(props.children, function (child) {
- if (child == null) {
- return;
- }
- if (typeof child === 'string' || typeof child === 'number') {
- return;
- }
- if (typeof child.type !== 'string') {
- return;
- }
- if (!didWarnInvalidChild) {
- didWarnInvalidChild = true;
- warning$1(false, 'Only strings and numbers are supported as children.');
- }
- });
- }
-
- // TODO: Remove support for `selected` in .
- if (props.selected != null && !didWarnSelectedSetOnOption) {
- warning$1(false, 'Use the `defaultValue` or `value` props on instead of ' + 'setting `selected` on .');
- didWarnSelectedSetOnOption = true;
- }
- }
-}
-
-function postMountWrapper$1(element, props) {
- // value="" should make a value attribute (#6219)
- if (props.value != null) {
- element.setAttribute('value', toString(getToStringValue(props.value)));
- }
-}
-
-function getHostProps$1(element, props) {
- var hostProps = _assign({ children: undefined }, props);
- var content = flattenChildren(props.children);
-
- if (content) {
- hostProps.children = content;
- }
-
- return hostProps;
-}
-
-// TODO: direct imports like some-package/src/* are bad. Fix me.
-var didWarnValueDefaultValue$1 = void 0;
-
-{
- didWarnValueDefaultValue$1 = false;
-}
-
-function getDeclarationErrorAddendum() {
- var ownerName = getCurrentFiberOwnerNameInDevOrNull();
- if (ownerName) {
- return '\n\nCheck the render method of `' + ownerName + '`.';
- }
- return '';
-}
-
-var valuePropNames = ['value', 'defaultValue'];
-
-/**
- * Validation function for `value` and `defaultValue`.
- */
-function checkSelectPropTypes(props) {
- ReactControlledValuePropTypes.checkPropTypes('select', props);
-
- for (var i = 0; i < valuePropNames.length; i++) {
- var propName = valuePropNames[i];
- if (props[propName] == null) {
- continue;
- }
- var isArray = Array.isArray(props[propName]);
- if (props.multiple && !isArray) {
- warning$1(false, 'The `%s` prop supplied to must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum());
- } else if (!props.multiple && isArray) {
- warning$1(false, 'The `%s` prop supplied to must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum());
- }
- }
-}
-
-function updateOptions(node, multiple, propValue, setDefaultSelected) {
- var options = node.options;
-
- if (multiple) {
- var selectedValues = propValue;
- var selectedValue = {};
- for (var i = 0; i < selectedValues.length; i++) {
- // Prefix to avoid chaos with special keys.
- selectedValue['$' + selectedValues[i]] = true;
- }
- for (var _i = 0; _i < options.length; _i++) {
- var selected = selectedValue.hasOwnProperty('$' + options[_i].value);
- if (options[_i].selected !== selected) {
- options[_i].selected = selected;
- }
- if (selected && setDefaultSelected) {
- options[_i].defaultSelected = true;
- }
- }
- } else {
- // Do not set `select.value` as exact behavior isn't consistent across all
- // browsers for all cases.
- var _selectedValue = toString(getToStringValue(propValue));
- var defaultSelected = null;
- for (var _i2 = 0; _i2 < options.length; _i2++) {
- if (options[_i2].value === _selectedValue) {
- options[_i2].selected = true;
- if (setDefaultSelected) {
- options[_i2].defaultSelected = true;
- }
- return;
- }
- if (defaultSelected === null && !options[_i2].disabled) {
- defaultSelected = options[_i2];
- }
- }
- if (defaultSelected !== null) {
- defaultSelected.selected = true;
- }
- }
-}
-
-/**
- * Implements a host component that allows optionally setting the
- * props `value` and `defaultValue`. If `multiple` is false, the prop must be a
- * stringable. If `multiple` is true, the prop must be an array of stringables.
- *
- * If `value` is not supplied (or null/undefined), user actions that change the
- * selected option will trigger updates to the rendered options.
- *
- * If it is supplied (and not null/undefined), the rendered options will not
- * update in response to user actions. Instead, the `value` prop must change in
- * order for the rendered options to update.
- *
- * If `defaultValue` is provided, any options with the supplied values will be
- * selected.
- */
-
-function getHostProps$2(element, props) {
- return _assign({}, props, {
- value: undefined
- });
-}
-
-function initWrapperState$1(element, props) {
- var node = element;
- {
- checkSelectPropTypes(props);
- }
-
- node._wrapperState = {
- wasMultiple: !!props.multiple
- };
-
- {
- if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue$1) {
- warning$1(false, 'Select elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled select ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components');
- didWarnValueDefaultValue$1 = true;
- }
- }
-}
-
-function postMountWrapper$2(element, props) {
- var node = element;
- node.multiple = !!props.multiple;
- var value = props.value;
- if (value != null) {
- updateOptions(node, !!props.multiple, value, false);
- } else if (props.defaultValue != null) {
- updateOptions(node, !!props.multiple, props.defaultValue, true);
- }
-}
-
-function postUpdateWrapper(element, props) {
- var node = element;
- var wasMultiple = node._wrapperState.wasMultiple;
- node._wrapperState.wasMultiple = !!props.multiple;
-
- var value = props.value;
- if (value != null) {
- updateOptions(node, !!props.multiple, value, false);
- } else if (wasMultiple !== !!props.multiple) {
- // For simplicity, reapply `defaultValue` if `multiple` is toggled.
- if (props.defaultValue != null) {
- updateOptions(node, !!props.multiple, props.defaultValue, true);
- } else {
- // Revert the select back to its default unselected state.
- updateOptions(node, !!props.multiple, props.multiple ? [] : '', false);
- }
- }
-}
-
-function restoreControlledState$2(element, props) {
- var node = element;
- var value = props.value;
-
- if (value != null) {
- updateOptions(node, !!props.multiple, value, false);
- }
-}
-
-var didWarnValDefaultVal = false;
-
-/**
- * Implements a