From ba712b07e5cd5714aea275145e9fd337b642428a Mon Sep 17 00:00:00 2001 From: Bradley Griffiths Date: Fri, 17 Jun 2022 09:54:06 +0000 Subject: [PATCH] Remove maps. --- s3direct/static/s3direct/dist/index.css | 10 +--------- s3direct/static/s3direct/dist/index.css.map | 1 - s3direct/static/s3direct/dist/index.js | 3 ++- s3direct/static/s3direct/dist/index.js.map | 1 - 4 files changed, 3 insertions(+), 12 deletions(-) delete mode 100644 s3direct/static/s3direct/dist/index.css.map delete mode 100644 s3direct/static/s3direct/dist/index.js.map diff --git a/s3direct/static/s3direct/dist/index.css b/s3direct/static/s3direct/dist/index.css index 2aab3070..1b7c5e6e 100644 --- a/s3direct/static/s3direct/dist/index.css +++ b/s3direct/static/s3direct/dist/index.css @@ -1,9 +1 @@ -/*! - * Bootstrap v2.3.1 - * - * Copyright 2012 Twitter, Inc - * Licensed under the Apache License v2.0 - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Designed and built with all the love in the world @twitter by @mdo and @fat. - */.clearfix{*zoom:1}.clearfix:after,.clearfix:before{content:"";display:table;line-height:0}.clearfix:after{clear:both}.hide-text{background-color:transparent;border:0;color:transparent;font:0/0 a;text-shadow:none}.input-block-level{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;min-height:30px;width:100%}@-webkit-keyframes progress-bar-stripes{0%{background-position:40px 0}to{background-position:0 0}}@-moz-keyframes progress-bar-stripes{0%{background-position:40px 0}to{background-position:0 0}}@-ms-keyframes progress-bar-stripes{0%{background-position:40px 0}to{background-position:0 0}}@-o-keyframes progress-bar-stripes{0%{background-position:0 0}to{background-position:40px 0}}@keyframes progress-bar-stripes{0%{background-position:40px 0}to{background-position:0 0}}.progress{background-color:#f7f7f7;background-image:-moz-linear-gradient(top,#f5f5f5,#f9f9f9);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f5f5f5),to(#f9f9f9));background-image:-webkit-linear-gradient(top,#f5f5f5,#f9f9f9);background-image:-o-linear-gradient(top,#f5f5f5,#f9f9f9);background-image:linear-gradient(180deg,#f5f5f5,#f9f9f9);-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.1);-moz-box-shadow:inset 0 1px 2px rgba(0,0,0,.1);box-shadow:inset 0 1px 2px rgba(0,0,0,.1);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#fff5f5f5",endColorstr="#fff9f9f9",GradientType=0);height:20px;margin-bottom:20px;overflow:hidden}.progress,.progress .bar{background-repeat:repeat-x}.progress .bar{background-color:#0e90d2;background-image:-moz-linear-gradient(top,#149bdf,#0480be);background-image:-webkit-gradient(linear,0 0,0 100%,from(#149bdf),to(#0480be));background-image:-webkit-linear-gradient(top,#149bdf,#0480be);background-image:-o-linear-gradient(top,#149bdf,#0480be);background-image:linear-gradient(180deg,#149bdf,#0480be);-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);-moz-box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;color:#fff;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#ff149bdf",endColorstr="#ff0480be",GradientType=0);float:left;font-size:12px;height:100%;text-align:center;text-shadow:0 -1px 0 rgba(0,0,0,.25);-webkit-transition:width .6s ease;-moz-transition:width .6s ease;-o-transition:width .6s ease;transition:width .6s ease;width:0}.progress .bar+.bar{-webkit-box-shadow:inset 1px 0 0 rgba(0,0,0,.15),inset 0 -1px 0 rgba(0,0,0,.15);-moz-box-shadow:inset 1px 0 0 rgba(0,0,0,.15),inset 0 -1px 0 rgba(0,0,0,.15);box-shadow:inset 1px 0 0 rgba(0,0,0,.15),inset 0 -1px 0 rgba(0,0,0,.15)}.progress-striped .bar{background-color:#149bdf;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(.25,hsla(0,0%,100%,.15)),color-stop(.25,transparent),color-stop(.5,transparent),color-stop(.5,hsla(0,0%,100%,.15)),color-stop(.75,hsla(0,0%,100%,.15)),color-stop(.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,hsla(0,0%,100%,.15) 25%,transparent 0,transparent 50%,hsla(0,0%,100%,.15) 0,hsla(0,0%,100%,.15) 75%,transparent 0,transparent);background-image:-moz-linear-gradient(45deg,hsla(0,0%,100%,.15) 25%,transparent 25%,transparent 50%,hsla(0,0%,100%,.15) 50%,hsla(0,0%,100%,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,hsla(0,0%,100%,.15) 25%,transparent 25%,transparent 50%,hsla(0,0%,100%,.15) 50%,hsla(0,0%,100%,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,hsla(0,0%,100%,.15) 25%,transparent 0,transparent 50%,hsla(0,0%,100%,.15) 0,hsla(0,0%,100%,.15) 75%,transparent 0,transparent);-webkit-background-size:40px 40px;-moz-background-size:40px 40px;-o-background-size:40px 40px;background-size:40px 40px}.progress.active .bar{-webkit-animation:progress-bar-stripes 2s linear infinite;-moz-animation:progress-bar-stripes 2s linear infinite;-ms-animation:progress-bar-stripes 2s linear infinite;-o-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite}.progress .bar-danger,.progress-danger .bar{background-color:#dd514c;background-image:-moz-linear-gradient(top,#ee5f5b,#c43c35);background-image:-webkit-gradient(linear,0 0,0 100%,from(#ee5f5b),to(#c43c35));background-image:-webkit-linear-gradient(top,#ee5f5b,#c43c35);background-image:-o-linear-gradient(top,#ee5f5b,#c43c35);background-image:linear-gradient(180deg,#ee5f5b,#c43c35);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#ffee5f5b",endColorstr="#ffc43c35",GradientType=0)}.progress-danger.progress-striped .bar,.progress-striped .bar-danger{background-color:#ee5f5b;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(.25,hsla(0,0%,100%,.15)),color-stop(.25,transparent),color-stop(.5,transparent),color-stop(.5,hsla(0,0%,100%,.15)),color-stop(.75,hsla(0,0%,100%,.15)),color-stop(.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,hsla(0,0%,100%,.15) 25%,transparent 0,transparent 50%,hsla(0,0%,100%,.15) 0,hsla(0,0%,100%,.15) 75%,transparent 0,transparent);background-image:-moz-linear-gradient(45deg,hsla(0,0%,100%,.15) 25%,transparent 25%,transparent 50%,hsla(0,0%,100%,.15) 50%,hsla(0,0%,100%,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,hsla(0,0%,100%,.15) 25%,transparent 25%,transparent 50%,hsla(0,0%,100%,.15) 50%,hsla(0,0%,100%,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,hsla(0,0%,100%,.15) 25%,transparent 0,transparent 50%,hsla(0,0%,100%,.15) 0,hsla(0,0%,100%,.15) 75%,transparent 0,transparent)}.progress .bar-success,.progress-success .bar{background-color:#5eb95e;background-image:-moz-linear-gradient(top,#62c462,#57a957);background-image:-webkit-gradient(linear,0 0,0 100%,from(#62c462),to(#57a957));background-image:-webkit-linear-gradient(top,#62c462,#57a957);background-image:-o-linear-gradient(top,#62c462,#57a957);background-image:linear-gradient(180deg,#62c462,#57a957);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#ff62c462",endColorstr="#ff57a957",GradientType=0)}.progress-striped .bar-success,.progress-success.progress-striped .bar{background-color:#62c462;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(.25,hsla(0,0%,100%,.15)),color-stop(.25,transparent),color-stop(.5,transparent),color-stop(.5,hsla(0,0%,100%,.15)),color-stop(.75,hsla(0,0%,100%,.15)),color-stop(.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,hsla(0,0%,100%,.15) 25%,transparent 0,transparent 50%,hsla(0,0%,100%,.15) 0,hsla(0,0%,100%,.15) 75%,transparent 0,transparent);background-image:-moz-linear-gradient(45deg,hsla(0,0%,100%,.15) 25%,transparent 25%,transparent 50%,hsla(0,0%,100%,.15) 50%,hsla(0,0%,100%,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,hsla(0,0%,100%,.15) 25%,transparent 25%,transparent 50%,hsla(0,0%,100%,.15) 50%,hsla(0,0%,100%,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,hsla(0,0%,100%,.15) 25%,transparent 0,transparent 50%,hsla(0,0%,100%,.15) 0,hsla(0,0%,100%,.15) 75%,transparent 0,transparent)}.progress .bar-info,.progress-info .bar{background-color:#4bb1cf;background-image:-moz-linear-gradient(top,#5bc0de,#339bb9);background-image:-webkit-gradient(linear,0 0,0 100%,from(#5bc0de),to(#339bb9));background-image:-webkit-linear-gradient(top,#5bc0de,#339bb9);background-image:-o-linear-gradient(top,#5bc0de,#339bb9);background-image:linear-gradient(180deg,#5bc0de,#339bb9);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#ff5bc0de",endColorstr="#ff339bb9",GradientType=0)}.progress-info.progress-striped .bar,.progress-striped .bar-info{background-color:#5bc0de;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(.25,hsla(0,0%,100%,.15)),color-stop(.25,transparent),color-stop(.5,transparent),color-stop(.5,hsla(0,0%,100%,.15)),color-stop(.75,hsla(0,0%,100%,.15)),color-stop(.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,hsla(0,0%,100%,.15) 25%,transparent 0,transparent 50%,hsla(0,0%,100%,.15) 0,hsla(0,0%,100%,.15) 75%,transparent 0,transparent);background-image:-moz-linear-gradient(45deg,hsla(0,0%,100%,.15) 25%,transparent 25%,transparent 50%,hsla(0,0%,100%,.15) 50%,hsla(0,0%,100%,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,hsla(0,0%,100%,.15) 25%,transparent 25%,transparent 50%,hsla(0,0%,100%,.15) 50%,hsla(0,0%,100%,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,hsla(0,0%,100%,.15) 25%,transparent 0,transparent 50%,hsla(0,0%,100%,.15) 0,hsla(0,0%,100%,.15) 75%,transparent 0,transparent)}.progress .bar-warning,.progress-warning .bar{background-color:#faa732;background-image:-moz-linear-gradient(top,#fbb450,#f89406);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fbb450),to(#f89406));background-image:-webkit-linear-gradient(top,#fbb450,#f89406);background-image:-o-linear-gradient(top,#fbb450,#f89406);background-image:linear-gradient(180deg,#fbb450,#f89406);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#fffbb450",endColorstr="#fff89406",GradientType=0)}.progress-striped .bar-warning,.progress-warning.progress-striped .bar{background-color:#fbb450;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(.25,hsla(0,0%,100%,.15)),color-stop(.25,transparent),color-stop(.5,transparent),color-stop(.5,hsla(0,0%,100%,.15)),color-stop(.75,hsla(0,0%,100%,.15)),color-stop(.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,hsla(0,0%,100%,.15) 25%,transparent 0,transparent 50%,hsla(0,0%,100%,.15) 0,hsla(0,0%,100%,.15) 75%,transparent 0,transparent);background-image:-moz-linear-gradient(45deg,hsla(0,0%,100%,.15) 25%,transparent 25%,transparent 50%,hsla(0,0%,100%,.15) 50%,hsla(0,0%,100%,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,hsla(0,0%,100%,.15) 25%,transparent 25%,transparent 50%,hsla(0,0%,100%,.15) 50%,hsla(0,0%,100%,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,hsla(0,0%,100%,.15) 25%,transparent 0,transparent 50%,hsla(0,0%,100%,.15) 0,hsla(0,0%,100%,.15) 75%,transparent 0,transparent)}.s3direct{float:left}.s3direct .progress{background:#333;border-radius:0;height:25px;overflow:visible;position:relative;width:200px}.s3direct .cancel-button{font-size:25px;line-height:25px;position:absolute;right:-20px}.s3direct .cancel-button:focus{text-decoration:none}.s3direct .file-remove{margin-top:10px;text-transform:uppercase}.s3direct .file-input,.s3direct .file-link,.s3direct .file-remove,.s3direct .progress{clear:left;display:none;float:left}.s3direct.form-active .file-input,.s3direct.link-active .file-link,.s3direct.link-active .file-remove,.s3direct.progress-active .progress{display:block} \ No newline at end of file +.clearfix:before,.clearfix:after{content:"";line-height:0;display:table}.clearfix:after{clear:both}.hide-text{font:0/0 a;color:#0000;text-shadow:none;background-color:#0000;border:0}.input-block-level{width:100%;min-height:30px;box-sizing:border-box;display:block}@-webkit-keyframes progress-bar-stripes{0%{background-position:40px 0}to{background-position:0 0}}@-moz-keyframes progress-bar-stripes{0%{background-position:40px 0}to{background-position:0 0}}@-o-keyframes progress-bar-stripes{0%{background-position:0 0}to{background-position:40px 0}}@keyframes progress-bar-stripes{0%{background-position:40px 0}to{background-position:0 0}}.progress{height:20px;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#fff5f5f5",endColorstr="#fff9f9f9",GradientType=0);background-color:#f7f7f7;background-image:linear-gradient(#f5f5f5,#f9f9f9);background-repeat:repeat-x;border-radius:4px;margin-bottom:20px;overflow:hidden;box-shadow:inset 0 1px 2px #0000001a}.progress .bar{width:0%;height:100%;color:#fff;float:left;text-align:center;text-shadow:0 -1px #00000040;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#ff149bdf",endColorstr="#ff0480be",GradientType=0);box-sizing:border-box;-o-transition:width .6s ease;background-color:#0e90d2;background-image:linear-gradient(#149bdf,#0480be);background-repeat:repeat-x;font-size:12px;transition:width .6s;box-shadow:inset 0 -1px #00000026}.progress .bar+.bar{box-shadow:inset 1px 0 #00000026,inset 0 -1px #00000026}.progress-striped .bar{-webkit-background-size:40px 40px;-moz-background-size:40px 40px;-o-background-size:40px 40px;background-color:#149bdf;background-image:linear-gradient(45deg,#ffffff26 25%,#0000 25% 50%,#ffffff26 50% 75%,#0000 75%,#0000);background-size:40px 40px}.progress.active .bar{-ms-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite}.progress-danger .bar,.progress .bar-danger{filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#ffee5f5b",endColorstr="#ffc43c35",GradientType=0);background-color:#dd514c;background-image:linear-gradient(#ee5f5b,#c43c35);background-repeat:repeat-x}.progress-danger.progress-striped .bar,.progress-striped .bar-danger{background-color:#ee5f5b;background-image:linear-gradient(45deg,#ffffff26 25%,#0000 25% 50%,#ffffff26 50% 75%,#0000 75%,#0000)}.progress-success .bar,.progress .bar-success{filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#ff62c462",endColorstr="#ff57a957",GradientType=0);background-color:#5eb95e;background-image:linear-gradient(#62c462,#57a957);background-repeat:repeat-x}.progress-success.progress-striped .bar,.progress-striped .bar-success{background-color:#62c462;background-image:linear-gradient(45deg,#ffffff26 25%,#0000 25% 50%,#ffffff26 50% 75%,#0000 75%,#0000)}.progress-info .bar,.progress .bar-info{filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#ff5bc0de",endColorstr="#ff339bb9",GradientType=0);background-color:#4bb1cf;background-image:linear-gradient(#5bc0de,#339bb9);background-repeat:repeat-x}.progress-info.progress-striped .bar,.progress-striped .bar-info{background-color:#5bc0de;background-image:linear-gradient(45deg,#ffffff26 25%,#0000 25% 50%,#ffffff26 50% 75%,#0000 75%,#0000)}.progress-warning .bar,.progress .bar-warning{filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#fffbb450",endColorstr="#fff89406",GradientType=0);background-color:#faa732;background-image:linear-gradient(#fbb450,#f89406);background-repeat:repeat-x}.progress-warning.progress-striped .bar,.progress-striped .bar-warning{background-color:#fbb450;background-image:linear-gradient(45deg,#ffffff26 25%,#0000 25% 50%,#ffffff26 50% 75%,#0000 75%,#0000)}.s3direct{float:left}.s3direct .progress{width:200px;height:25px;background:#333;border-radius:0;position:relative;overflow:visible}.s3direct .cancel-button{font-size:25px;line-height:25px;position:absolute;right:-20px}.s3direct .cancel-button:focus{text-decoration:none}.s3direct .file-remove{text-transform:uppercase;margin-top:10px}.s3direct .progress,.s3direct .file-link,.s3direct .file-remove,.s3direct .file-input{float:left;clear:left;display:none}.s3direct.progress-active .progress,.s3direct.link-active .file-link,.s3direct.link-active .file-remove,.s3direct.form-active .file-input{display:block} \ No newline at end of file diff --git a/s3direct/static/s3direct/dist/index.css.map b/s3direct/static/s3direct/dist/index.css.map deleted file mode 100644 index c90ed437..00000000 --- a/s3direct/static/s3direct/dist/index.css.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["css/bootstrap-progress.css","css/styles.css"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACpfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"index.css","sourceRoot":"../../../../src","sourcesContent":["/*!\n * Bootstrap v2.3.1\n *\n * Copyright 2012 Twitter, Inc\n * Licensed under the Apache License v2.0\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Designed and built with all the love in the world @twitter by @mdo and @fat.\n */\n.clearfix {\n *zoom: 1;\n}\n.clearfix:before,\n.clearfix:after {\n display: table;\n content: \"\";\n line-height: 0;\n}\n.clearfix:after {\n clear: both;\n}\n.hide-text {\n font: 0/0 a;\n color: transparent;\n text-shadow: none;\n background-color: transparent;\n border: 0;\n}\n.input-block-level {\n display: block;\n width: 100%;\n min-height: 30px;\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n}\n@-webkit-keyframes progress-bar-stripes {\n from {\n background-position: 40px 0;\n }\n to {\n background-position: 0 0;\n }\n}\n@-moz-keyframes progress-bar-stripes {\n from {\n background-position: 40px 0;\n }\n to {\n background-position: 0 0;\n }\n}\n@-ms-keyframes progress-bar-stripes {\n from {\n background-position: 40px 0;\n }\n to {\n background-position: 0 0;\n }\n}\n@-o-keyframes progress-bar-stripes {\n from {\n background-position: 0 0;\n }\n to {\n background-position: 40px 0;\n }\n}\n@keyframes progress-bar-stripes {\n from {\n background-position: 40px 0;\n }\n to {\n background-position: 0 0;\n }\n}\n.progress {\n overflow: hidden;\n height: 20px;\n margin-bottom: 20px;\n background-color: #f7f7f7;\n background-image: -moz-linear-gradient(top, #f5f5f5, #f9f9f9);\n background-image: -webkit-gradient(\n linear,\n 0 0,\n 0 100%,\n from(#f5f5f5),\n to(#f9f9f9)\n );\n background-image: -webkit-linear-gradient(top, #f5f5f5, #f9f9f9);\n background-image: -o-linear-gradient(top, #f5f5f5, #f9f9f9);\n background-image: linear-gradient(to bottom, #f5f5f5, #f9f9f9);\n background-repeat: repeat-x;\n filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#fff9f9f9', GradientType=0);\n -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);\n -moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);\n box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);\n -webkit-border-radius: 4px;\n -moz-border-radius: 4px;\n border-radius: 4px;\n}\n.progress .bar {\n width: 0%;\n height: 100%;\n color: #ffffff;\n float: left;\n font-size: 12px;\n text-align: center;\n text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);\n background-color: #0e90d2;\n background-image: -moz-linear-gradient(top, #149bdf, #0480be);\n background-image: -webkit-gradient(\n linear,\n 0 0,\n 0 100%,\n from(#149bdf),\n to(#0480be)\n );\n background-image: -webkit-linear-gradient(top, #149bdf, #0480be);\n background-image: -o-linear-gradient(top, #149bdf, #0480be);\n background-image: linear-gradient(to bottom, #149bdf, #0480be);\n background-repeat: repeat-x;\n filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff149bdf', endColorstr='#ff0480be', GradientType=0);\n -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);\n -moz-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);\n box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n -webkit-transition: width 0.6s ease;\n -moz-transition: width 0.6s ease;\n -o-transition: width 0.6s ease;\n transition: width 0.6s ease;\n}\n.progress .bar + .bar {\n -webkit-box-shadow: inset 1px 0 0 rgba(0, 0, 0, 0.15),\n inset 0 -1px 0 rgba(0, 0, 0, 0.15);\n -moz-box-shadow: inset 1px 0 0 rgba(0, 0, 0, 0.15),\n inset 0 -1px 0 rgba(0, 0, 0, 0.15);\n box-shadow: inset 1px 0 0 rgba(0, 0, 0, 0.15),\n inset 0 -1px 0 rgba(0, 0, 0, 0.15);\n}\n.progress-striped .bar {\n background-color: #149bdf;\n background-image: -webkit-gradient(\n linear,\n 0 100%,\n 100% 0,\n color-stop(0.25, rgba(255, 255, 255, 0.15)),\n color-stop(0.25, transparent),\n color-stop(0.5, transparent),\n color-stop(0.5, rgba(255, 255, 255, 0.15)),\n color-stop(0.75, rgba(255, 255, 255, 0.15)),\n color-stop(0.75, transparent),\n to(transparent)\n );\n background-image: -webkit-linear-gradient(\n 45deg,\n rgba(255, 255, 255, 0.15) 25%,\n transparent 25%,\n transparent 50%,\n rgba(255, 255, 255, 0.15) 50%,\n rgba(255, 255, 255, 0.15) 75%,\n transparent 75%,\n transparent\n );\n background-image: -moz-linear-gradient(\n 45deg,\n rgba(255, 255, 255, 0.15) 25%,\n transparent 25%,\n transparent 50%,\n rgba(255, 255, 255, 0.15) 50%,\n rgba(255, 255, 255, 0.15) 75%,\n transparent 75%,\n transparent\n );\n background-image: -o-linear-gradient(\n 45deg,\n rgba(255, 255, 255, 0.15) 25%,\n transparent 25%,\n transparent 50%,\n rgba(255, 255, 255, 0.15) 50%,\n rgba(255, 255, 255, 0.15) 75%,\n transparent 75%,\n transparent\n );\n background-image: linear-gradient(\n 45deg,\n rgba(255, 255, 255, 0.15) 25%,\n transparent 25%,\n transparent 50%,\n rgba(255, 255, 255, 0.15) 50%,\n rgba(255, 255, 255, 0.15) 75%,\n transparent 75%,\n transparent\n );\n -webkit-background-size: 40px 40px;\n -moz-background-size: 40px 40px;\n -o-background-size: 40px 40px;\n background-size: 40px 40px;\n}\n.progress.active .bar {\n -webkit-animation: progress-bar-stripes 2s linear infinite;\n -moz-animation: progress-bar-stripes 2s linear infinite;\n -ms-animation: progress-bar-stripes 2s linear infinite;\n -o-animation: progress-bar-stripes 2s linear infinite;\n animation: progress-bar-stripes 2s linear infinite;\n}\n.progress-danger .bar,\n.progress .bar-danger {\n background-color: #dd514c;\n background-image: -moz-linear-gradient(top, #ee5f5b, #c43c35);\n background-image: -webkit-gradient(\n linear,\n 0 0,\n 0 100%,\n from(#ee5f5b),\n to(#c43c35)\n );\n background-image: -webkit-linear-gradient(top, #ee5f5b, #c43c35);\n background-image: -o-linear-gradient(top, #ee5f5b, #c43c35);\n background-image: linear-gradient(to bottom, #ee5f5b, #c43c35);\n background-repeat: repeat-x;\n filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffee5f5b', endColorstr='#ffc43c35', GradientType=0);\n}\n.progress-danger.progress-striped .bar,\n.progress-striped .bar-danger {\n background-color: #ee5f5b;\n background-image: -webkit-gradient(\n linear,\n 0 100%,\n 100% 0,\n color-stop(0.25, rgba(255, 255, 255, 0.15)),\n color-stop(0.25, transparent),\n color-stop(0.5, transparent),\n color-stop(0.5, rgba(255, 255, 255, 0.15)),\n color-stop(0.75, rgba(255, 255, 255, 0.15)),\n color-stop(0.75, transparent),\n to(transparent)\n );\n background-image: -webkit-linear-gradient(\n 45deg,\n rgba(255, 255, 255, 0.15) 25%,\n transparent 25%,\n transparent 50%,\n rgba(255, 255, 255, 0.15) 50%,\n rgba(255, 255, 255, 0.15) 75%,\n transparent 75%,\n transparent\n );\n background-image: -moz-linear-gradient(\n 45deg,\n rgba(255, 255, 255, 0.15) 25%,\n transparent 25%,\n transparent 50%,\n rgba(255, 255, 255, 0.15) 50%,\n rgba(255, 255, 255, 0.15) 75%,\n transparent 75%,\n transparent\n );\n background-image: -o-linear-gradient(\n 45deg,\n rgba(255, 255, 255, 0.15) 25%,\n transparent 25%,\n transparent 50%,\n rgba(255, 255, 255, 0.15) 50%,\n rgba(255, 255, 255, 0.15) 75%,\n transparent 75%,\n transparent\n );\n background-image: linear-gradient(\n 45deg,\n rgba(255, 255, 255, 0.15) 25%,\n transparent 25%,\n transparent 50%,\n rgba(255, 255, 255, 0.15) 50%,\n rgba(255, 255, 255, 0.15) 75%,\n transparent 75%,\n transparent\n );\n}\n.progress-success .bar,\n.progress .bar-success {\n background-color: #5eb95e;\n background-image: -moz-linear-gradient(top, #62c462, #57a957);\n background-image: -webkit-gradient(\n linear,\n 0 0,\n 0 100%,\n from(#62c462),\n to(#57a957)\n );\n background-image: -webkit-linear-gradient(top, #62c462, #57a957);\n background-image: -o-linear-gradient(top, #62c462, #57a957);\n background-image: linear-gradient(to bottom, #62c462, #57a957);\n background-repeat: repeat-x;\n filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff62c462', endColorstr='#ff57a957', GradientType=0);\n}\n.progress-success.progress-striped .bar,\n.progress-striped .bar-success {\n background-color: #62c462;\n background-image: -webkit-gradient(\n linear,\n 0 100%,\n 100% 0,\n color-stop(0.25, rgba(255, 255, 255, 0.15)),\n color-stop(0.25, transparent),\n color-stop(0.5, transparent),\n color-stop(0.5, rgba(255, 255, 255, 0.15)),\n color-stop(0.75, rgba(255, 255, 255, 0.15)),\n color-stop(0.75, transparent),\n to(transparent)\n );\n background-image: -webkit-linear-gradient(\n 45deg,\n rgba(255, 255, 255, 0.15) 25%,\n transparent 25%,\n transparent 50%,\n rgba(255, 255, 255, 0.15) 50%,\n rgba(255, 255, 255, 0.15) 75%,\n transparent 75%,\n transparent\n );\n background-image: -moz-linear-gradient(\n 45deg,\n rgba(255, 255, 255, 0.15) 25%,\n transparent 25%,\n transparent 50%,\n rgba(255, 255, 255, 0.15) 50%,\n rgba(255, 255, 255, 0.15) 75%,\n transparent 75%,\n transparent\n );\n background-image: -o-linear-gradient(\n 45deg,\n rgba(255, 255, 255, 0.15) 25%,\n transparent 25%,\n transparent 50%,\n rgba(255, 255, 255, 0.15) 50%,\n rgba(255, 255, 255, 0.15) 75%,\n transparent 75%,\n transparent\n );\n background-image: linear-gradient(\n 45deg,\n rgba(255, 255, 255, 0.15) 25%,\n transparent 25%,\n transparent 50%,\n rgba(255, 255, 255, 0.15) 50%,\n rgba(255, 255, 255, 0.15) 75%,\n transparent 75%,\n transparent\n );\n}\n.progress-info .bar,\n.progress .bar-info {\n background-color: #4bb1cf;\n background-image: -moz-linear-gradient(top, #5bc0de, #339bb9);\n background-image: -webkit-gradient(\n linear,\n 0 0,\n 0 100%,\n from(#5bc0de),\n to(#339bb9)\n );\n background-image: -webkit-linear-gradient(top, #5bc0de, #339bb9);\n background-image: -o-linear-gradient(top, #5bc0de, #339bb9);\n background-image: linear-gradient(to bottom, #5bc0de, #339bb9);\n background-repeat: repeat-x;\n filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff339bb9', GradientType=0);\n}\n.progress-info.progress-striped .bar,\n.progress-striped .bar-info {\n background-color: #5bc0de;\n background-image: -webkit-gradient(\n linear,\n 0 100%,\n 100% 0,\n color-stop(0.25, rgba(255, 255, 255, 0.15)),\n color-stop(0.25, transparent),\n color-stop(0.5, transparent),\n color-stop(0.5, rgba(255, 255, 255, 0.15)),\n color-stop(0.75, rgba(255, 255, 255, 0.15)),\n color-stop(0.75, transparent),\n to(transparent)\n );\n background-image: -webkit-linear-gradient(\n 45deg,\n rgba(255, 255, 255, 0.15) 25%,\n transparent 25%,\n transparent 50%,\n rgba(255, 255, 255, 0.15) 50%,\n rgba(255, 255, 255, 0.15) 75%,\n transparent 75%,\n transparent\n );\n background-image: -moz-linear-gradient(\n 45deg,\n rgba(255, 255, 255, 0.15) 25%,\n transparent 25%,\n transparent 50%,\n rgba(255, 255, 255, 0.15) 50%,\n rgba(255, 255, 255, 0.15) 75%,\n transparent 75%,\n transparent\n );\n background-image: -o-linear-gradient(\n 45deg,\n rgba(255, 255, 255, 0.15) 25%,\n transparent 25%,\n transparent 50%,\n rgba(255, 255, 255, 0.15) 50%,\n rgba(255, 255, 255, 0.15) 75%,\n transparent 75%,\n transparent\n );\n background-image: linear-gradient(\n 45deg,\n rgba(255, 255, 255, 0.15) 25%,\n transparent 25%,\n transparent 50%,\n rgba(255, 255, 255, 0.15) 50%,\n rgba(255, 255, 255, 0.15) 75%,\n transparent 75%,\n transparent\n );\n}\n.progress-warning .bar,\n.progress .bar-warning {\n background-color: #faa732;\n background-image: -moz-linear-gradient(top, #fbb450, #f89406);\n background-image: -webkit-gradient(\n linear,\n 0 0,\n 0 100%,\n from(#fbb450),\n to(#f89406)\n );\n background-image: -webkit-linear-gradient(top, #fbb450, #f89406);\n background-image: -o-linear-gradient(top, #fbb450, #f89406);\n background-image: linear-gradient(to bottom, #fbb450, #f89406);\n background-repeat: repeat-x;\n filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffbb450', endColorstr='#fff89406', GradientType=0);\n}\n.progress-warning.progress-striped .bar,\n.progress-striped .bar-warning {\n background-color: #fbb450;\n background-image: -webkit-gradient(\n linear,\n 0 100%,\n 100% 0,\n color-stop(0.25, rgba(255, 255, 255, 0.15)),\n color-stop(0.25, transparent),\n color-stop(0.5, transparent),\n color-stop(0.5, rgba(255, 255, 255, 0.15)),\n color-stop(0.75, rgba(255, 255, 255, 0.15)),\n color-stop(0.75, transparent),\n to(transparent)\n );\n background-image: -webkit-linear-gradient(\n 45deg,\n rgba(255, 255, 255, 0.15) 25%,\n transparent 25%,\n transparent 50%,\n rgba(255, 255, 255, 0.15) 50%,\n rgba(255, 255, 255, 0.15) 75%,\n transparent 75%,\n transparent\n );\n background-image: -moz-linear-gradient(\n 45deg,\n rgba(255, 255, 255, 0.15) 25%,\n transparent 25%,\n transparent 50%,\n rgba(255, 255, 255, 0.15) 50%,\n rgba(255, 255, 255, 0.15) 75%,\n transparent 75%,\n transparent\n );\n background-image: -o-linear-gradient(\n 45deg,\n rgba(255, 255, 255, 0.15) 25%,\n transparent 25%,\n transparent 50%,\n rgba(255, 255, 255, 0.15) 50%,\n rgba(255, 255, 255, 0.15) 75%,\n transparent 75%,\n transparent\n );\n background-image: linear-gradient(\n 45deg,\n rgba(255, 255, 255, 0.15) 25%,\n transparent 25%,\n transparent 50%,\n rgba(255, 255, 255, 0.15) 50%,\n rgba(255, 255, 255, 0.15) 75%,\n transparent 75%,\n transparent\n );\n}\n",".s3direct {\n float: left;\n}\n\n.s3direct .progress {\n background: #333;\n width: 200px;\n position: relative;\n overflow: visible;\n height: 25px;\n border-radius: 0;\n}\n\n.s3direct .cancel-button {\n position: absolute;\n right: -20px;\n font-size: 25px;\n line-height: 25px;\n}\n\n.s3direct .cancel-button:focus {\n text-decoration: none;\n}\n\n.s3direct .file-remove {\n margin-top: 10px;\n text-transform: uppercase;\n}\n\n.s3direct .progress,\n.s3direct .file-link,\n.s3direct .file-remove,\n.s3direct .file-input {\n display: none;\n float: left;\n clear: left;\n}\n\n.s3direct.progress-active .progress,\n.s3direct.link-active .file-link,\n.s3direct.link-active .file-remove,\n.s3direct.form-active .file-input {\n display: block;\n}\n"]} \ No newline at end of file diff --git a/s3direct/static/s3direct/dist/index.js b/s3direct/static/s3direct/dist/index.js index e2e7b77b..c717cafa 100644 --- a/s3direct/static/s3direct/dist/index.js +++ b/s3direct/static/s3direct/dist/index.js @@ -1 +1,2 @@ -!function(){function t(t,e,r,n){Object.defineProperty(t,e,{get:r,set:n,enumerable:!0,configurable:!0})}function e(t){return t&&t.__esModule?t.default:t}var r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},n={},i={},o=r.parcelRequire952e;null==o&&((o=function(t){if(t in n)return n[t].exports;if(t in i){var e=i[t];delete i[t];var r={id:t,exports:{}};return n[t]=r,e.call(r.exports,r,r.exports),r.exports}var o=new Error("Cannot find module '"+t+"'");throw o.code="MODULE_NOT_FOUND",o}).register=function(t,e){i[t]=e},r.parcelRequire952e=o),o.register("gvLJ0",(function(t,e){var r=o("2yz1O"),n=o("2X4kY"),i=o("4Sxqp").Buffer,s=[1518500249,1859775393,-1894007588,-899497514],a=new Array(80);function u(){this.init(),this._w=a,n.call(this,64,56)}function h(t){return t<<30|t>>>2}function p(t,e,r,n){return 0===t?e&r|~e&n:2===t?e&r|e&n|r&n:e^r^n}r(u,n),u.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},u.prototype._update=function(t){for(var e,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,a=0|this._d,u=0|this._e,f=0;f<16;++f)r[f]=t.readInt32BE(4*f);for(;f<80;++f)r[f]=r[f-3]^r[f-8]^r[f-14]^r[f-16];for(var c=0;c<80;++c){var l=~~(c/20),d=0|((e=n)<<5|e>>>27)+p(l,i,o,a)+u+r[c]+s[l];u=a,a=o,o=h(i),i=n,n=d}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=u+this._e|0},u.prototype._hash=function(){var t=i.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},t.exports=u})),o.register("2yz1O",(function(t,e){"function"==typeof Object.create?t.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}})),o.register("2X4kY",(function(t,e){var r=o("4Sxqp").Buffer;function n(t,e){this._block=r.alloc(t),this._finalSize=e,this._blockSize=t,this._len=0}n.prototype.update=function(t,e){"string"==typeof t&&(e=e||"utf8",t=r.from(t,e));for(var n=this._block,i=this._blockSize,o=t.length,s=this._len,a=0;a=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(4294967295&r)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var o=this._hash();return t?o.toString(t):o},n.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=n})),o.register("4Sxqp",(function(t,e){var r=o("cFM5c"),n=r.Buffer;function i(t,e){for(var r in t)e[r]=t[r]}function s(t,e,r){return n(t,e,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?t.exports=r:(i(r,t.exports),t.exports.Buffer=s),i(n,s),s.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return n(t,e,r)},s.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var i=n(t);return void 0!==e?"string"==typeof r?i.fill(e,r):i.fill(e):i.fill(0),i},s.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n(t)},s.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return r.SlowBuffer(t)}})),o.register("cFM5c",(function(e,r){var n,i,s,a;t(e.exports,"Buffer",(function(){return n}),(function(t){return n=t})),t(e.exports,"SlowBuffer",(function(){return i}),(function(t){return i=t})),t(e.exports,"INSPECT_MAX_BYTES",(function(){return s}),(function(t){return s=t})),t(e.exports,"kMaxLength",(function(){return a}),(function(t){return a=t}));var u=o("das8S"),h=o("6HbER"),p="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;n=l,i=function(t){+t!=t&&(t=0);return l.alloc(+t)},s=50;var f=2147483647;function c(t){if(t>f)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return Object.setPrototypeOf(e,l.prototype),e}function l(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return g(t)}return d(t,e,r)}function d(t,e,r){if("string"==typeof t)return function(t,e){"string"==typeof e&&""!==e||(e="utf8");if(!l.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=0|b(t,e),n=c(r),i=n.write(t,e);i!==r&&(n=n.slice(0,i));return n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(K(t,Uint8Array)){var e=new Uint8Array(t);return v(e.buffer,e.byteOffset,e.byteLength)}return m(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(K(t,ArrayBuffer)||t&&K(t.buffer,ArrayBuffer))return v(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(K(t,SharedArrayBuffer)||t&&K(t.buffer,SharedArrayBuffer)))return v(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return l.from(n,e,r);var i=function(t){if(l.isBuffer(t)){var e=0|w(t.length),r=c(e);return 0===r.length||t.copy(r,0,0,e),r}if(void 0!==t.length)return"number"!=typeof t.length||Y(t.length)?c(0):m(t);if("Buffer"===t.type&&Array.isArray(t.data))return m(t.data)}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return l.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function y(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function g(t){return y(t),c(t<0?0:0|w(t))}function m(t){for(var e=t.length<0?0:0|w(t.length),r=c(e),n=0;n=f)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+f.toString(16)+" bytes");return 0|t}function b(t,e){if(l.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||K(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return N(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return X(t).length;default:if(i)return n?-1:N(t).length;e=(""+e).toLowerCase(),i=!0}}function _(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return M(this,e,r);case"utf8":case"utf-8":return C(this,e,r);case"ascii":return q(this,e,r);case"latin1":case"binary":return R(this,e,r);case"base64":return T(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return z(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function S(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function U(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Y(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=l.from(e,n)),l.isBuffer(e))return 0===e.length?-1:P(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):P(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function P(t,e,r,n,i){var o,s=1,a=t.length,u=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;s=2,a/=2,u/=2,r/=2}function h(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){var p=-1;for(o=r;oa&&(r=a-u),o=r;o>=0;o--){for(var f=!0,c=0;ci&&(n=i):n=i;var o=e.length;n>o/2&&(n=o/2);for(var s=0;s>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function T(t,e,r){return 0===e&&r===t.length?u.fromByteArray(t):u.fromByteArray(t.slice(e,r))}function C(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i239?4:h>223?3:h>191?2:1;if(i+f<=r)switch(f){case 1:h<128&&(p=h);break;case 2:128==(192&(o=t[i+1]))&&(u=(31&h)<<6|63&o)>127&&(p=u);break;case 3:o=t[i+1],s=t[i+2],128==(192&o)&&128==(192&s)&&(u=(15&h)<<12|(63&o)<<6|63&s)>2047&&(u<55296||u>57343)&&(p=u);break;case 4:o=t[i+1],s=t[i+2],a=t[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(u=(15&h)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(p=u)}null===p?(p=65533,f=1):p>65535&&(p-=65536,n.push(p>>>10&1023|55296),p=56320|1023&p),n.push(p),i+=f}return function(t){var e=t.length;if(e<=O)return String.fromCharCode.apply(String,t);var r="",n=0;for(;nn.length?l.from(o).copy(n,i):Uint8Array.prototype.set.call(n,o,i);else{if(!l.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,i)}i+=o.length}return n},l.byteLength=b,l.prototype._isBuffer=!0,l.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;ee&&(t+=" ... "),""},p&&(l.prototype[p]=l.prototype.inspect),l.prototype.compare=function(t,e,r,n,i){if(K(t,Uint8Array)&&(t=l.from(t,t.offset,t.byteLength)),!l.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0),a=Math.min(o,s),u=this.slice(n,i),h=t.slice(e,r),p=0;p>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return E(this,t,e,r);case"utf8":case"utf-8":return A(this,t,e,r);case"ascii":case"latin1":case"binary":return B(this,t,e,r);case"base64":return I(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var O=4096;function q(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;in)&&(r=n);for(var i="",o=e;or)throw new RangeError("Trying to access beyond buffer length")}function F(t,e,r,n,i,o){if(!l.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function j(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function L(t,e,r,n,i){return e=+e,r>>>=0,i||j(t,0,r,4),h.write(t,e,r,n,23,4),r+4}function H(t,e,r,n,i){return e=+e,r>>>=0,i||j(t,0,r,8),h.write(t,e,r,n,52,8),r+8}l.prototype.slice=function(t,e){var r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e>>=0,e>>>=0,r||k(t,e,this.length);for(var n=this[t],i=1,o=0;++o>>=0,e>>>=0,r||k(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},l.prototype.readUint8=l.prototype.readUInt8=function(t,e){return t>>>=0,e||k(t,1,this.length),this[t]},l.prototype.readUint16LE=l.prototype.readUInt16LE=function(t,e){return t>>>=0,e||k(t,2,this.length),this[t]|this[t+1]<<8},l.prototype.readUint16BE=l.prototype.readUInt16BE=function(t,e){return t>>>=0,e||k(t,2,this.length),this[t]<<8|this[t+1]},l.prototype.readUint32LE=l.prototype.readUInt32LE=function(t,e){return t>>>=0,e||k(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},l.prototype.readUint32BE=l.prototype.readUInt32BE=function(t,e){return t>>>=0,e||k(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},l.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||k(t,e,this.length);for(var n=this[t],i=1,o=0;++o=(i*=128)&&(n-=Math.pow(2,8*e)),n},l.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||k(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},l.prototype.readInt8=function(t,e){return t>>>=0,e||k(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},l.prototype.readInt16LE=function(t,e){t>>>=0,e||k(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt16BE=function(t,e){t>>>=0,e||k(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt32LE=function(t,e){return t>>>=0,e||k(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},l.prototype.readInt32BE=function(t,e){return t>>>=0,e||k(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},l.prototype.readFloatLE=function(t,e){return t>>>=0,e||k(t,4,this.length),h.read(this,t,!0,23,4)},l.prototype.readFloatBE=function(t,e){return t>>>=0,e||k(t,4,this.length),h.read(this,t,!1,23,4)},l.prototype.readDoubleLE=function(t,e){return t>>>=0,e||k(t,8,this.length),h.read(this,t,!0,52,8)},l.prototype.readDoubleBE=function(t,e){return t>>>=0,e||k(t,8,this.length),h.read(this,t,!1,52,8)},l.prototype.writeUintLE=l.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e>>>=0,r>>>=0,n)||F(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[e]=255&t;++o>>=0,r>>>=0,n)||F(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},l.prototype.writeUint8=l.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||F(this,t,e,1,255,0),this[e]=255&t,e+1},l.prototype.writeUint16LE=l.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||F(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},l.prototype.writeUint16BE=l.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||F(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},l.prototype.writeUint32LE=l.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||F(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},l.prototype.writeUint32BE=l.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||F(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},l.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);F(this,t,e,r,i-1,-i)}var o=0,s=1,a=0;for(this[e]=255&t;++o>0)-a&255;return e+r},l.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);F(this,t,e,r,i-1,-i)}var o=r-1,s=1,a=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+r},l.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||F(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},l.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||F(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},l.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||F(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},l.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||F(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},l.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||F(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},l.prototype.writeFloatLE=function(t,e,r){return L(this,t,e,!0,r)},l.prototype.writeFloatBE=function(t,e,r){return L(this,t,e,!1,r)},l.prototype.writeDoubleLE=function(t,e,r){return H(this,t,e,!0,r)},l.prototype.writeDoubleBE=function(t,e,r){return H(this,t,e,!1,r)},l.prototype.copy=function(t,e,r,n){if(!l.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function X(t){return u.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(D,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function W(t,e,r,n){for(var i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function K(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function Y(t){return t!=t}var V=function(){for(var t="0123456789abcdef",e=new Array(256),r=0;r<16;++r)for(var n=16*r,i=0;i<16;++i)e[n+i]=t[r]+t[i];return e}()})),o.register("das8S",(function(e,r){var n,i;t(e.exports,"toByteArray",(function(){return n}),(function(t){return n=t})),t(e.exports,"fromByteArray",(function(){return i}),(function(t){return i=t})),n=function(t){var e,r,n=f(t),i=n[0],o=n[1],u=new a(function(t,e,r){return 3*(e+r)/4-r}(0,i,o)),h=0,p=o>0?i-4:i;for(r=0;r>16&255,u[h++]=e>>8&255,u[h++]=255&e;2===o&&(e=s[t.charCodeAt(r)]<<2|s[t.charCodeAt(r+1)]>>4,u[h++]=255&e);1===o&&(e=s[t.charCodeAt(r)]<<10|s[t.charCodeAt(r+1)]<<4|s[t.charCodeAt(r+2)]>>2,u[h++]=e>>8&255,u[h++]=255&e);return u},i=function(t){for(var e,r=t.length,n=r%3,i=[],s=16383,a=0,u=r-n;au?u:a+s));1===n?(e=t[r-1],i.push(o[e>>2]+o[e<<4&63]+"==")):2===n&&(e=(t[r-2]<<8)+t[r-1],i.push(o[e>>10]+o[e>>4&63]+o[e<<2&63]+"="));return i.join("")};for(var o=[],s=[],a="undefined"!=typeof Uint8Array?Uint8Array:Array,u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",h=0,p=u.length;h0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function c(t,e,r){for(var n,i,s=[],a=e;a>18&63]+o[i>>12&63]+o[i>>6&63]+o[63&i]);return s.join("")}s["-".charCodeAt(0)]=62,s["_".charCodeAt(0)]=63})),o.register("6HbER",(function(e,r){var n,i;t(e.exports,"read",(function(){return n}),(function(t){return n=t})),t(e.exports,"write",(function(){return i}),(function(t){return i=t})),n=function(t,e,r,n,i){var o,s,a=8*i-n-1,u=(1<>1,p=-7,f=r?i-1:0,c=r?-1:1,l=t[e+f];for(f+=c,o=l&(1<<-p)-1,l>>=-p,p+=a;p>0;o=256*o+t[e+f],f+=c,p-=8);for(s=o&(1<<-p)-1,o>>=-p,p+=n;p>0;s=256*s+t[e+f],f+=c,p-=8);if(0===o)o=1-h;else{if(o===u)return s?NaN:1/0*(l?-1:1);s+=Math.pow(2,n),o-=h}return(l?-1:1)*s*Math.pow(2,o-n)},i=function(t,e,r,n,i,o){var s,a,u,h=8*o-i-1,p=(1<>1,c=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,l=n?0:o-1,d=n?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=p):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),(e+=s+f>=1?c/u:c*Math.pow(2,1-f))*u>=2&&(s++,u/=2),s+f>=p?(a=0,s=p):s+f>=1?(a=(e*u-1)*Math.pow(2,i),s+=f):(a=e*Math.pow(2,f-1)*Math.pow(2,i),s=0));i>=8;t[r+l]=255&a,l+=d,a/=256,i-=8);for(s=s<0;t[r+l]=255&s,l+=d,s/=256,h-=8);t[r+l-d]|=128*y}})),o.register("dgph6",(function(t,e){var r=o("2yz1O"),n=o("2X4kY"),i=o("4Sxqp").Buffer,s=[1518500249,1859775393,-1894007588,-899497514],a=new Array(80);function u(){this.init(),this._w=a,n.call(this,64,56)}function h(t){return t<<5|t>>>27}function p(t){return t<<30|t>>>2}function f(t,e,r,n){return 0===t?e&r|~e&n:2===t?e&r|e&n|r&n:e^r^n}r(u,n),u.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},u.prototype._update=function(t){for(var e,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,a=0|this._d,u=0|this._e,c=0;c<16;++c)r[c]=t.readInt32BE(4*c);for(;c<80;++c)r[c]=(e=r[c-3]^r[c-8]^r[c-14]^r[c-16])<<1|e>>>31;for(var l=0;l<80;++l){var d=~~(l/20),y=h(n)+f(d,i,o,a)+u+r[l]+s[d]|0;u=a,a=o,o=p(i),i=n,n=y}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=u+this._e|0},u.prototype._hash=function(){var t=i.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},t.exports=u})),o.register("18PiT",(function(t,e){var r=o("2yz1O"),n=o("jhpWv"),i=o("2X4kY"),s=o("4Sxqp").Buffer,a=new Array(64);function u(){this.init(),this._w=a,i.call(this,64,56)}r(u,n),u.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},u.prototype._hash=function(){var t=s.allocUnsafe(28);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t},t.exports=u})),o.register("jhpWv",(function(t,e){var r=o("2yz1O"),n=o("2X4kY"),i=o("4Sxqp").Buffer,s=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],a=new Array(64);function u(){this.init(),this._w=a,n.call(this,64,56)}function h(t,e,r){return r^t&(e^r)}function p(t,e,r){return t&e|r&(t|e)}function f(t){return(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10)}function c(t){return(t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7)}function l(t){return(t>>>7|t<<25)^(t>>>18|t<<14)^t>>>3}r(u,n),u.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},u.prototype._update=function(t){for(var e,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,a=0|this._d,u=0|this._e,d=0|this._f,y=0|this._g,g=0|this._h,m=0;m<16;++m)r[m]=t.readInt32BE(4*m);for(;m<64;++m)r[m]=0|(((e=r[m-2])>>>17|e<<15)^(e>>>19|e<<13)^e>>>10)+r[m-7]+l(r[m-15])+r[m-16];for(var v=0;v<64;++v){var w=g+c(u)+h(u,d,y)+s[v]+r[v]|0,b=f(n)+p(n,i,o)|0;g=y,y=d,d=u,u=a+w|0,a=o,o=i,i=n,n=w+b|0}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=u+this._e|0,this._f=d+this._f|0,this._g=y+this._g|0,this._h=g+this._h|0},u.prototype._hash=function(){var t=i.allocUnsafe(32);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t.writeInt32BE(this._h,28),t},t.exports=u})),o.register("8o8Fh",(function(t,e){var r=o("2yz1O"),n=o("5XiLX"),i=o("2X4kY"),s=o("4Sxqp").Buffer,a=new Array(160);function u(){this.init(),this._w=a,i.call(this,128,112)}r(u,n),u.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},u.prototype._hash=function(){var t=s.allocUnsafe(48);function e(e,r,n){t.writeInt32BE(e,n),t.writeInt32BE(r,n+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),t},t.exports=u})),o.register("5XiLX",(function(t,e){var r=o("2yz1O"),n=o("2X4kY"),i=o("4Sxqp").Buffer,s=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],a=new Array(160);function u(){this.init(),this._w=a,n.call(this,128,112)}function h(t,e,r){return r^t&(e^r)}function p(t,e,r){return t&e|r&(t|e)}function f(t,e){return(t>>>28|e<<4)^(e>>>2|t<<30)^(e>>>7|t<<25)}function c(t,e){return(t>>>14|e<<18)^(t>>>18|e<<14)^(e>>>9|t<<23)}function l(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^t>>>7}function d(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^(t>>>7|e<<25)}function y(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^t>>>6}function g(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^(t>>>6|e<<26)}function m(t,e){return t>>>0>>0?1:0}r(u,n),u.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},u.prototype._update=function(t){for(var e=this._w,r=0|this._ah,n=0|this._bh,i=0|this._ch,o=0|this._dh,a=0|this._eh,u=0|this._fh,v=0|this._gh,w=0|this._hh,b=0|this._al,_=0|this._bl,S=0|this._cl,U=0|this._dl,P=0|this._el,E=0|this._fl,A=0|this._gl,B=0|this._hl,I=0;I<32;I+=2)e[I]=t.readInt32BE(4*I),e[I+1]=t.readInt32BE(4*I+4);for(;I<160;I+=2){var x=e[I-30],T=e[I-30+1],C=l(x,T),O=d(T,x),q=y(x=e[I-4],T=e[I-4+1]),R=g(T,x),M=e[I-14],z=e[I-14+1],k=e[I-32],F=e[I-32+1],j=O+z|0,L=C+M+m(j,O)|0;L=(L=L+q+m(j=j+R|0,R)|0)+k+m(j=j+F|0,F)|0,e[I]=L,e[I+1]=j}for(var H=0;H<160;H+=2){L=e[H],j=e[H+1];var D=p(r,n,i),N=p(b,_,S),X=f(r,b),W=f(b,r),K=c(a,P),Y=c(P,a),V=s[H],J=s[H+1],G=h(a,u,v),$=h(P,E,A),Z=B+Y|0,Q=w+K+m(Z,B)|0;Q=(Q=(Q=Q+G+m(Z=Z+$|0,$)|0)+V+m(Z=Z+J|0,J)|0)+L+m(Z=Z+j|0,j)|0;var tt=W+N|0,et=X+D+m(tt,W)|0;w=v,B=A,v=u,A=E,u=a,E=P,a=o+Q+m(P=U+Z|0,U)|0,o=i,U=S,i=n,S=_,n=r,_=b,r=Q+et+m(b=Z+tt|0,Z)|0}this._al=this._al+b|0,this._bl=this._bl+_|0,this._cl=this._cl+S|0,this._dl=this._dl+U|0,this._el=this._el+P|0,this._fl=this._fl+E|0,this._gl=this._gl+A|0,this._hl=this._hl+B|0,this._ah=this._ah+r+m(this._al,b)|0,this._bh=this._bh+n+m(this._bl,_)|0,this._ch=this._ch+i+m(this._cl,S)|0,this._dh=this._dh+o+m(this._dl,U)|0,this._eh=this._eh+a+m(this._el,P)|0,this._fh=this._fh+u+m(this._fl,E)|0,this._gh=this._gh+v+m(this._gl,A)|0,this._hh=this._hh+w+m(this._hl,B)|0},u.prototype._hash=function(){var t=i.allocUnsafe(64);function e(e,r,n){t.writeInt32BE(e,n),t.writeInt32BE(r,n+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),t},t.exports=u}));var s={};!function(t,e){var r,n;"object"==typeof s?s=e():"function"==typeof define&&define.amd?define(e):(t=t||self,r=t.Cookies,(n=t.Cookies=e()).noConflict=function(){return t.Cookies=r,n})}(s,(function(){"use strict";function t(t){for(var e=1;e-1&&(this.maxRetries=r),v.call(this,t,e)}function _(t,e){var r={method:"POST",path:"?uploads",step:"initiate",x_amz_headers:t.xAmzHeadersAtInitiate,not_signed_headers:t.notSignedHeadersAtInitiate,response_match:"(.+)"};w.call(this,t,r),this.awsKey=e}function S(t){t.info("will attempt to complete upload");var e={method:"POST",contentType:"application/xml; charset=UTF-8",path:"?uploadId="+t.uploadId,x_amz_headers:t.xAmzHeadersCommon||t.xAmzHeadersAtComplete,step:"complete"};w.call(this,t,e)}function U(t,e){this.awsKey=e,t.info("will attempt to verify existence of the file");var r={method:"HEAD",path:"",x_amz_headers:t.xAmzHeadersCommon,success404:!0,step:"head_object"};b.call(this,t,r)}function P(t){b.call(this,t),this.updateRequest(this.setupRequest(0))}function E(t,e){this.part=e,this.partNumber=e.partNumber,this.start=(this.partNumber-1)*t.con.partSize,this.end=Math.min(this.partNumber*t.con.partSize,t.sizeBytes);var r={method:"PUT",path:"?partNumber="+this.partNumber+"&uploadId="+t.uploadId,step:"upload #"+this.partNumber,x_amz_headers:t.xAmzHeadersCommon||t.xAmzHeadersAtUpload,contentSha256:"UNSIGNED-PAYLOAD",onProgress:this.onProgress.bind(this)};v.call(this,t,r)}function A(t){t.info("will attempt to abort the upload"),t.abortParts();var e={method:"DELETE",path:"?uploadId="+t.uploadId,x_amz_headers:t.xAmzHeadersCommon,success404:!0,step:"abort"};v.call(this,t,e)}function B(t){var e,r=t||"/";try{e=new URL(r)}catch(t){(e=document.createElement("a")).href=r}return{protocol:e.protocol,hostname:e.hostname,pathname:e.pathname.replace(/(^\/?)/,"/"),port:e.port,search:"?"===e.search[0]?e.search.substr(1):e.search,hash:e.hash,host:e.host}}function I(t){return t?new Date(t).toISOString():""}function x(t){var e=T(t.responseText,"Code"),r=T(t.responseText,"Message");return e.length?["AWS Code: ",e,", Message:",r].join(""):""}function T(t,e){var r=t.match(["<",e,">(.+)"].join(""));return r?r[1]:""}function C(){var t,e={};return t=new Promise((function(t,r){e={resolve:t,reject:r}})),{resolve:e.resolve,reject:e.reject,promise:t}}function O(t,e,r){function n(t,e){if("object"==typeof e)for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])}return t=t||{},n(e=e||{},r=r||{}),n(t,e),t}function q(e){var i=JSON.parse(r.getItem("awsUploads")||"{}");if(e){for(var o in i)if(i.hasOwnProperty(o)){var s=i[o];new Date(s.completedAt||n)-1)return t.splice(r,1),!0}function k(t){for(var e=0;t>=1024;)t/=1024,++e;return[t.toFixed(2).replace(".00",""),["B","Kb","Mb","Gb","Tb","Pb","Eb","Zb","Yb"][e]].join(" ")}function F(t){var e=F.supported();this.cacheStore=t?{}:e?localStorage:void 0}g.create=function(t){var e=O({},t);return g.getLocalTimeOffset(e).then((function(t){return e.localTimeOffset=t,new Promise((function(t,r){var n=new g(e);!0===n.supported?t(n):r(n._instantiationError)}))}))},g.getLocalTimeOffset=function(t){return new Promise((function(r,n){if("number"==typeof t.localTimeOffset)return r(t.localTimeOffset);if(t.timeUrl){var i=new XMLHttpRequest;i.open("GET",t.timeUrl+"?requestTime="+(new Date).getTime()),i.onreadystatechange=function(){if(4===i.readyState&&200===i.status){var t=new Date(Date.parse(i.responseText))-new Date;e.d("localTimeOffset is",t,"ms"),r(t)}},i.onerror=function(t){e.e("xhr error timeUrl",t),n("Fetching offset time failed with status: "+t.status)},i.send()}else r(0)}))},g.prototype.config={},g.prototype.localTimeOffset=0,g.prototype.supported=!1,g.prototype._instantiationError=void 0,g.prototype.evaporatingCount=0,g.prototype.pendingFiles={},g.prototype.filesInProcess=[],g.prototype.queuedFiles=[],g.prototype.startNextFile=function(t){if(this.queuedFiles.length&&!(this.evaporatingCount>=this.config.maxConcurrentParts)){var r=this.queuedFiles.shift();0===r.status?(e.d("Starting",decodeURIComponent(r.name),"reason:",t),this.evaporatingCnt(1),r.start()):(e.d("Requeued",decodeURIComponent(r.name),"status:",r.status,"reason:",t),this.queuedFiles.push(r))}},g.prototype.fileCleanup=function(t){z(this.queuedFiles,t),z(this.filesInProcess,t)&&this.evaporatingCnt(-1),t.done(),this.consumeRemainingSlots()},g.prototype.queueFile=function(t){this.filesInProcess.push(t),this.queuedFiles.push(t),1===this.filesInProcess.length&&this.startNextFile("first file")},g.prototype.add=function(t,e){var r,n=this;return new Promise((function(i,o){var s,a,u,h=O(e,{});if(d.forEach((function(t){delete h[t]})),r=O(n.config,h),void 0===t||void 0===t.file)return o("Missing file");if(r.maxFileSize&&t.file.size>r.maxFileSize)return o("File size too large. Maximum size allowed is "+r.maxFileSize);if(void 0===t.name)return o("Missing attribute: name");r.encodeFilename&&(t.name=(s=t.name,a=s.split("/"),u=[],a.forEach((function(t){for(var e=[],r=encodeURIComponent(t),n=0;n-1&&t.push(n.stop())}return t.length||t.push(Promise.reject("No files to cancel.")),Promise.all(t)},g.prototype._cancelOne=function(t){var e=[];return this.pendingFiles[t]?e.push(this.pendingFiles[t].stop()):e.push(Promise.reject("File does not exist")),Promise.all(e)},g.prototype.pause=function(t,e){var r=void 0!==(e=e||{}).force&&e.force;return void 0===t?this._pauseAll(r):this._pauseOne(t,r)},g.prototype._pauseAll=function(t){e.d("Pausing all file uploads");var r=[];for(var n in this.pendingFiles)if(this.pendingFiles.hasOwnProperty(n)){var i=this.pendingFiles[n];c.indexOf(i.status)>-1&&this._pause(i,t,r)}return Promise.all(r)},g.prototype._pauseOne=function(t,e){var r=[],n=this.pendingFiles[t];return void 0===n?r.push(Promise.reject("Cannot pause a file that has not been added.")):n.status===o&&r.push(Promise.reject("Cannot pause a file that is already paused.")),r.length||this._pause(n,e,r),Promise.all(r)},g.prototype._pause=function(t,e,r){r.push(t.pause(e)),z(this.filesInProcess,t),z(this.queuedFiles,t)},g.prototype.resume=function(t){return void 0===t?this._resumeAll():this._resumeOne(t)},g.prototype._resumeAll=function(){for(var t in e.d("Resuming all file uploads"),this.pendingFiles)if(this.pendingFiles.hasOwnProperty(t)){var r=this.pendingFiles[t];f.indexOf(r.status)>-1&&this.resumeFile(r)}return Promise.resolve()},g.prototype._resumeOne=function(t){var e=this.pendingFiles[t],r=[];return void 0===e?r.push(Promise.reject("Cannot pause a file that does not exist.")):-1===f.indexOf(e.status)?r.push(Promise.reject("Cannot resume a file that has not been paused.")):this.resumeFile(e),Promise.all(r)},g.prototype.resumeFile=function(t){t.resume(),this.queueFile(t)},g.prototype.forceRetry=function(){},g.prototype.consumeRemainingSlots=function(){var t=this.config.maxConcurrentParts-this.evaporatingCount;if(t)for(var e=0;e0&&(n.secondsLeft=Math.round(r/e)),n},m.prototype.onProgress=function(){-1===[u,o].indexOf(this.status)&&(this.progress(this.fileTotalBytesUploaded/this.sizeBytes,this.progessStats()),this.loaded=0)},m.prototype.startMonitor=function(){clearInterval(this.progressInterval),this.startTime=new Date,this.loaded=0,this.totalUploaded=0,this.onProgress(),this.progressInterval=setInterval(this.onProgress.bind(this),this.con.progressIntervalMS)},m.prototype.stopMonitor=function(){clearInterval(this.progressInterval)},m.prototype.startNextFile=function(t){this.evaporate.startNextFile(t)},m.prototype.evaporatingCnt=function(t){this.evaporate.evaporatingCnt(t)},m.prototype.consumeRemainingSlots=function(){this.evaporate.consumeRemainingSlots()},m.prototype.getRemainingSlots=function(){var t=this.evaporate.evaporatingCount;return!this.partsInProcess.length&&t>0&&(t-=1),this.con.maxConcurrentParts-t},m.prototype.lastPartSatisfied=Promise.resolve("onStart"),m.prototype.start=function(){if(this.status=i,this.startMonitor(),this.started(this.id),this.uploadId)return e.d("resuming FileUpload ",this.id),this.consumeSlots();var t=this.name;this.getUnfinishedFileUpload();var r=this.con.computeContentMd5&&this.con.allowS3ExistenceOptimization&&void 0!==this.firstMd5Digest&&void 0!==this.eTag;if(this.uploadId){if(r)return this.reuseS3Object(t).then(this.deferredCompletion.resolve).catch(this.uploadFileFromScratch.bind(this));this.resumeInterruptedUpload().then(this._uploadComplete.bind(this)).catch(this.uploadFileFromScratch.bind(this))}else this.uploadFileFromScratch("")},m.prototype.uploadFileFromScratch=function(t){if(-1!==c.indexOf(this.status))return e.d(t),this.uploadId=void 0,this.uploadFile(this.name).then(this._uploadComplete.bind(this)).catch(this._abortUpload.bind(this))},m.prototype._uploadComplete=function(){this.completeUpload().then(this.deferredCompletion.resolve)},m.prototype.stop=function(){e.d("stopping FileUpload ",this.id),this.setStatus(s),this.info("Canceling uploads..."),this.abortedByUser=!0;var t=this;return this.abortUpload().then((function(){throw"User aborted the upload"})).catch((function(e){t.deferredCompletion.reject(e)}))},m.prototype.pause=function(t){e.d("pausing FileUpload, force:",!!t,this.id);var r=[];return this.info("Pausing uploads..."),this.status=p,t?this.abortParts(!0):(r=this.partsInProcess.map((function(t){return this.s3Parts[t].awsRequest.awsDeferred.promise}),this),this.pausing()),Promise.all(r).then(function(){this.stopMonitor(),this.status=o,this.startNextFile("pause"),this.paused()}.bind(this))},m.prototype.resume=function(){this.status=0,this.resumed()},m.prototype.done=function(){clearInterval(this.progressInterval),this.startNextFile("file done"),this.partsOnS3=[],this.s3Parts=[]},m.prototype._startCompleteUpload=function(t){return function(){(t?this.completeUpload():Promise.resolve()).then(this.deferredCompletion.resolve.bind(this))}},m.prototype._abortUpload=function(){if(!this.abortedByUser){var t=this;this.abortUpload().then((function(){t.deferredCompletion.reject("File upload aborted due to a part failing to upload")}),this.deferredCompletion.reject.bind(this))}},m.prototype.abortParts=function(t){var e=this;this.partsInProcess.slice(0).forEach((function(r){var n=e.s3Parts[r];n&&(n.awsRequest.abort(),t&&(n.status=0),z(e.partsInProcess,n.partNumber),e.partsToUpload.length&&e.evaporatingCnt(-1))}))},m.prototype.makeParts=function(t){this.numParts=Math.ceil(this.sizeBytes/this.con.partSize)||1;var e=[],r=this;function n(t){z(r.partsToUpload,t.partNumber),z(r.partsInProcess,t.partNumber),r.partsToUpload.length&&r.evaporatingCnt(-1)}function i(t){return function(){n(t),r.partsToUpload.length&&r.consumeRemainingSlots(),r.partsToUpload.lengtht&&this.con.bucket===e.bucket&&(!this.con.onlyRetryForSameFileName||this.name===e.awsKey)},m.prototype.partSuccess=function(t,r){var n=r.part;if(e.d(r.request.step,"ETag:",t),n.isEmpty||'"d41d8cd98f00b204e9800998ecf8427e"'!==t)return n.eTag=t,n.status=3,this.partsOnS3.push(n),!0;n.status=a,r.resetLoadedBytes();var i=["eTag matches MD5 of 0 length blob for part #",r.partNumber,"Retrying part."].join(" ");e.w(i),this.warn(i)},m.prototype.listPartsSuccess=function(t,e){this.info("uploadId",this.uploadId,"is not complete. Fetching parts from part marker",t.partNumberMarker),e=e.replace(/(\r\n|\n|\r)/gm,"");for(var r=/(.+?)<\/Part\>/g;;){var n=(r.exec(e)||[])[1];if(!n)break;var i=parseInt(T(n,"Size"),10);this.fileTotalBytesUploaded+=i,this.partsOnS3.push({eTag:T(n,"ETag").replace(/"/g,'"'),partNumber:parseInt(T(n,"PartNumber"),10),size:i,LastModified:T(n,"LastModified")})}return"true"===T(e,"IsTruncated")?T(e,"NextPartNumberMarker"):void 0},m.prototype.makePartsfromPartsOnS3=function(){-1!==c.indexOf(this.status)&&(this.nameChanged(this.name),this.partsOnS3.forEach(function(t){var e=this.makePart(t.partNumber,3,t.size);e.eTag=t.eTag,e.loadedBytes=t.size,e.loadedBytesPrevious=t.size,e.finishedUploadingAt=t.LastModified}.bind(this)))},m.prototype.completeUpload=function(){var t=this;return new S(this).send().then((function(e){t.eTag=T(e.responseText,"ETag").replace(/"/g,'"'),t.completeUploadFile(e)}))},m.prototype.getCompletedPayload=function(){var t=[];return t.push(""),this.s3Parts.forEach((function(e,r){r>0&&["",r,"",e.eTag,""].forEach((function(e){t.push(e)}))})),t.push(""),t.join("")},m.prototype.consumeSlots=function(){if(0===this.partsToUpload.length)return-1;if(this.partsToUpload.length!==this.partsInProcess.length&&this.status===i){var t=Math.min(this.getRemainingSlots(),this.partsToUpload.length);if(!t)return-1;for(var e=0,r=0;r1&&this.evaporatingCnt(1),this.partsInProcess.push(n.partNumber);var o=n.awsRequest;if(this.lastPartSatisfied.then(o.delaySend.bind(o)),this.lastPartSatisfied=o.getStartedPromise(),(e+=1)===t)break}}var s=this.partsToUpload.length===this.partsInProcess.length,a=this.getRemainingSlots();return s&&a>0&&this.startNextFile("consume slots"),a}return 0},m.prototype.canStartPart=function(t){return-1===this.partsInProcess.indexOf(t.partNumber)&&!t.awsRequest.errorExceptionStatus()},m.prototype.uploadFile=function(t){this.removeUploadFile();var e=this;return new _(e,t).send().then((function(){return e.uploadInitiated(e.uploadId),e.partsToUpload=[],e.uploadParts().then((function(){}),(function(t){throw t}))}))},m.prototype.uploadParts=function(){if(this.loaded=0,this.totalUploaded=0,-1===c.indexOf(this.status))return Promise.reject("Part uploading stopped because the file was canceled");var t=this.makeParts();return this.setStatus(i),this.startTime=new Date,this.consumeSlots(),Promise.all(t)},m.prototype.abortUpload=function(){return new Promise(function(t,e){void 0!==this.uploadId?new A(this).send().then(t,e):t()}.bind(this)).then(function(){this.setStatus(u),this.cancelled(),this.removeUploadFile()}.bind(this),this.deferredCompletion.reject.bind(this))},m.prototype.resumeInterruptedUpload=function(){return new P(this).send().then(this.uploadParts.bind(this))},m.prototype.reuseS3Object=function(t){var r=this;this.makeParts(1),this.partsToUpload=[];var n=this.s3Parts[1];function i(e){throw r.name=t,e}return n.awsRequest.getPartMd5Digest().then((function(){if(r.firstMd5Digest===n.md5_digest)return new U(r,t).send().then((function(t){e.d("headObject found matching object on S3."),r.completeUploadFile(t),r.nameChanged(r.name)})).catch(i);i(r.con.allowS3ExistenceOptimization?"File's first part MD5 digest does not match what was stored.":"allowS3ExistenceOptimization is not enabled.")}))},v.prototype.fileUpload=void 0,v.prototype.con=void 0,v.prototype.awsUrl=void 0,v.prototype.awsHost=void 0,v.prototype.authorize=function(){},v.prototype.localTimeOffset=0,v.prototype.awsDeferred=void 0,v.prototype.started=void 0,v.prototype.getPath=function(){var t="/"+this.con.bucket+"/"+this.fileUpload.name;return(this.con.cloudfront||this.awsUrl.indexOf("cloudfront")>-1)&&(t="/"+this.fileUpload.name),t},v.prototype.updateRequest=function(t){this.request=t;var r=function(t,e){var r=t.con;function n(t){this.request=t}function i(t){n.call(this,t)}function o(t){this._cr=void 0,n.call(this,t)}return n.prototype.request={},n.prototype.error=function(){},n.prototype.authorizationString=function(){},n.prototype.stringToSign=function(){},n.prototype.canonicalRequest=function(){},n.prototype.setHeaders=function(){},n.prototype.datetime=function(t){return new Date((new Date).getTime()+t)},n.prototype.dateString=function(t){return this.datetime(t).toISOString().slice(0,19).replace(/-|:/g,"")+"Z"},i.prototype=Object.create(n.prototype),i.prototype.constructor=i,i.prototype.authorizationString=function(){return["AWS ",r.aws_key,":",this.request.auth].join("")},i.prototype.stringToSign=function(){var n,i="",o=[];for(var s in this.request.x_amz_headers)this.request.x_amz_headers.hasOwnProperty(s)&&o.push(s);return o.sort(),o.forEach(function(t){i+=t+":"+this.request.x_amz_headers[t]+"\n"}.bind(this)),n=this.request.method+"\n"+(this.request.md5_digest||"")+"\n"+(this.request.contentType||"")+"\n\n"+i+(r.cloudfront?"/"+r.bucket:"")+t.getPath()+this.request.path,e.d("V2 stringToSign:",n),n},i.prototype.dateString=function(t){return this.datetime(t).toUTCString()},i.prototype.getPayload=function(){return Promise.resolve()},o.prototype=Object.create(n.prototype),o.prototype.constructor=o,o.prototype._cr=void 0,o.prototype.payload=null,o.prototype.error=function(){this._cr=void 0},o.prototype.getPayload=function(){return t.getPayload().then(function(t){this.payload=t}.bind(this))},o.prototype.authorizationString=function(){var t=[],e=this.credentialString(),n=this.canonicalHeaders();return t.push(["AWS4-HMAC-SHA256 Credential=",r.aws_key,"/",e].join("")),t.push("SignedHeaders="+n.signedHeaders),t.push("Signature="+this.request.auth),t.join(", ")},o.prototype.stringToSign=function(){var t=[];t.push("AWS4-HMAC-SHA256"),t.push(this.request.dateString),t.push(this.credentialString()),t.push(r.cryptoHexEncodedHash256(this.canonicalRequest()));var n=t.join("\n");return e.d("V4 stringToSign:",n),n},o.prototype.credentialString=function(){var t=[];return t.push(this.request.dateString.slice(0,8)),t.push(r.awsRegion),t.push("s3"),t.push("aws4_request"),t.join("/")},o.prototype.canonicalQueryString=function(){var e,r,n=t.request.query_string||"",i=B([t.awsUrl,this.request.path,n].join("")).search,o=i.length?i.split("&"):[],s=[];for(r=0;r1?encodeURIComponent(e[1]):null});var a=s.sort((function(t,e){return t.namee.name?1:0})),u=[];for(r=0;re?1:0})),u=[],h=[],p=this.request.not_signed_headers||[],f=[];for(e=0;e=200&&t.status<=299||this.request.success404&&404===t.status},v.prototype.stringToSign=function(){return encodeURIComponent(this.signer.stringToSign())},v.prototype.canonicalRequest=function(){return this.signer.canonicalRequest()},v.prototype.signResponse=function(t,e,r){var n=this;return new Promise((function(i){if("function"==typeof n.con.signResponseHandler)return n.con.signResponseHandler(t,e,r).then(i);i(t)}))},v.prototype.sendRequestToAWS=function(){var t=this;return new Promise((function(e,r){var n=new XMLHttpRequest;t.currentXhr=n;var i=[t.awsUrl,t.getPath(),t.request.path].join(""),o={};for(var s in t.request.query_string&&(i+=t.request.query_string),O(o,t.request.not_signed_headers),O(o,t.request.x_amz_headers),n.onreadystatechange=function(){if(4===n.readyState)if(t.success_status(n))t.request.response_match&&void 0===n.response.match(new RegExp(t.request.response_match))?r("AWS response does not match set pattern: "+t.request.response_match):e();else{var i=n.responseText?x(n):" ";i+="status:"+n.status,r(i)}},n.open(t.request.method,i),n.setRequestHeader("Authorization",t.signer.authorizationString()),o)o.hasOwnProperty(s)&&n.setRequestHeader(s,o[s]);t.signer.setHeaders(n),t.request.contentType&&n.setRequestHeader("Content-Type",t.request.contentType),t.request.md5_digest&&n.setRequestHeader("Content-MD5",t.request.md5_digest),n.onerror=function(t){var e=t.responseText?x(t):"transport error";r(e)},"function"==typeof t.request.onProgress&&(n.upload.onprogress=t.request.onProgress),t.getPayload().then(n.send.bind(n),r),setTimeout((function(){t.started.resolve("request sent "+t.request.step)}),20),t.signer.payload=null,t.payloadPromise=void 0}))},v.prototype.authorize=function(){return this.request.dateString=this.signer.dateString(this.localTimeOffset),this.request.x_amz_headers=O(this.request.x_amz_headers,{"x-amz-date":this.request.dateString}),this.signer.getPayload().then(function(){return function(t){var e=t.fileUpload,r=e.con,n=t.request;function i(){this.request=n}function o(){i.call(this)}return i.prototype=Object.create(i.prototype),i.prototype.request={},i.makeSignParamsObject=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&("function"==typeof t[r]?e[r]=t[r]():e[r]=t[r]);return e},i.prototype.authorize=function(){return new Promise((function(o,s){var a=new XMLHttpRequest;t.currentXhr=a;var u=t.stringToSign(),h=[r.signerUrl,"?to_sign=",u,"&datetime=",n.dateString];r.sendCanonicalRequestToSignerUrl&&(h.push("&canonical_request="),h.push(encodeURIComponent(t.canonicalRequest()))),h=h.join("");var p=i.makeSignParamsObject(e.signParams);for(var f in p)p.hasOwnProperty(f)&&(h+="&"+encodeURIComponent(f)+"="+encodeURIComponent(p[f]));r.xhrWithCredentials&&(a.withCredentials=!0),a.onreadystatechange=function(){if(4===a.readyState)if(200===a.status)t.signResponse(a.response,u,n.dateString).then(o);else{if([401,403].indexOf(a.status)>-1){var r="status:"+a.status;return e.deferredCompletion.reject("Permission denied "+r),s(r)}s("Signature fetch returned status: "+a.status)}},a.onerror=function(t){s("authorizedSend transport error: "+t.responseText)},a.open("GET",h);var c=i.makeSignParamsObject(r.signHeaders);for(var l in c)c.hasOwnProperty(l)&&a.setRequestHeader(l,c[l]);"function"==typeof e.beforeSigner&&e.beforeSigner(a,h),a.send()}))},o.prototype=Object.create(i.prototype),o.prototype.authorize=function(){return r.customAuthMethod(i.makeSignParamsObject(e.signParams),i.makeSignParamsObject(r.signHeaders),t.stringToSign(),n.dateString,t.canonicalRequest()).catch((function(t){throw e.deferredCompletion.reject(t),t}))},"function"==typeof r.customAuthMethod?new o:new i}(this).authorize()}.bind(this))},v.prototype.authorizationSuccess=function(t){e.d(this.request.step,"signature:",t),this.request.auth=t},v.prototype.trySend=function(){var t=this;return this.authorize().then((function(e){t.authorizationSuccess(e),t.fileUpload.status!==u&&t.sendRequestToAWS().then(t.success.bind(t),t.error.bind(t))}),t.error.bind(t))},v.prototype.send=function(){return this.trySend(),this.awsDeferred.promise},w.prototype=Object.create(v.prototype),w.prototype.constructor=w,w.prototype.errorExceptionStatus=function(){return[u,s].indexOf(this.fileUpload.status)>-1},b.prototype=Object.create(w.prototype),b.prototype.constructor=b,b.prototype.maxRetries=1,b.prototype.errorHandler=function(t){if(this.attempts>this.maxRetries){var r=["MaxRetries exceeded. Will re-upload file id ",this.fileUpload.id,", ",t].join("");return e.w(r),this.awsDeferred.reject(r),!0}},b.prototype.rejectedSuccess=function(){var t=Array.prototype.slice.call(arguments,1).join("");return this.awsDeferred.reject(t),!1},_.prototype=Object.create(w.prototype),_.prototype.constructor=_,_.prototype.success=function(){var t=this.currentXhr.response.match(new RegExp(this.request.response_match));this.fileUpload.uploadId=t[1],this.fileUpload.awsKey=this.awsKey,e.d("InitiateMultipartUpload ID is",this.fileUpload.uploadId),this.fileUpload.createUploadFile(),this.awsDeferred.resolve(this.currentXhr)},S.prototype=Object.create(w.prototype),S.prototype.constructor=S,S.prototype.getPayload=function(){return Promise.resolve(this.fileUpload.getCompletedPayload())},U.prototype=Object.create(b.prototype),U.prototype.constructor=U,U.prototype.awsKey=void 0,U.prototype.success=function(){(this.currentXhr.getResponseHeader("Etag")===this.fileUpload.eTag||this.rejectedSuccess("uploadId ",this.fileUpload.id," found on S3 but the Etag doesn't match."))&&this.awsDeferred.resolve(this.currentXhr)},P.prototype=Object.create(b.prototype),P.prototype.constructor=P,P.prototype.awsKey=void 0,P.prototype.partNumberMarker=0,P.prototype.setupRequest=function(t){var r=["setupRequest() for uploadId:",this.fileUpload.uploadId,"for part marker:",t].join(" ");e.d(r),this.fileUpload.info(r),this.awsKey=this.fileUpload.name,this.partNumberMarker=t;var n={method:"GET",path:["?uploadId=",this.fileUpload.uploadId].join(""),query_string:"&part-number-marker="+t,x_amz_headers:this.fileUpload.xAmzHeadersCommon,step:"get upload parts",success404:!0};return this.request=n,n},P.prototype.success=function(){if(404!==this.currentXhr.status){var t=this.fileUpload.listPartsSuccess(this,this.currentXhr.responseText);if(t){var e=this.setupRequest(t);this.updateRequest(e),this.trySend()}else this.fileUpload.makePartsfromPartsOnS3(),this.awsDeferred.resolve(this.currentXhr)}else this.rejectedSuccess("uploadId ",this.fileUpload.id," not found on S3.")&&this.awsDeferred.resolve(this.currentXhr)},E.prototype=Object.create(v.prototype),E.prototype.constructor=E,E.prototype.part=1,E.prototype.payloadPromise=void 0,E.prototype.start=0,E.prototype.end=0,E.prototype.partNumber=void 0,E.prototype.getPartMd5Digest=function(){var t=this,r=this.part;return new Promise((function(e,n){t.con.computeContentMd5&&!r.md5_digest?t.getPayload().then((function(r){var n=t.con.cryptoMd5Method(r);1===t.partNumber&&t.con.computeContentMd5&&void 0===t.fileUpload.firstMd5Digest&&(t.fileUpload.firstMd5Digest=n,t.fileUpload.updateUploadFile({firstMd5Digest:n})),e(n)}),n):e(r.md5_digest)})).then((function(r){r&&(e.d(t.request.step,"MD5 digest:",r),t.request.md5_digest=r,t.part.md5_digest=r)}))},E.prototype.sendRequestToAWS=function(){return this.stalledInterval=setInterval(this.stalledPartMonitor(),l),this.stalledPartMonitor(),v.prototype.sendRequestToAWS.call(this)},E.prototype.send=function(){if(3!==this.part.status&&-1===[u,o,s].indexOf(this.fileUpload.status)){e.d("uploadPart #",this.partNumber,1===this.attempts?"submitting":"retrying"),this.part.status=i,this.attempts+=1,this.part.loadedBytesPrevious=null;var t=this;return this.getPartMd5Digest().then((function(){e.d("Sending",t.request.step),v.prototype.send.call(t)}))}},E.prototype.success=function(){clearInterval(this.stalledInterval);var t=this.currentXhr.getResponseHeader("ETag");this.currentXhr=null,this.fileUpload.partSuccess(t,this)&&this.awsDeferred.resolve(this.currentXhr)},E.prototype.onProgress=function(t){if(t.loaded>0){var e=t.loaded-this.part.loadedBytes;e&&(this.part.loadedBytes=t.loaded,this.fileUpload.updateLoaded(e))}},E.prototype.stalledPartMonitor=function(){var t=this.part.loadedBytes,r=this;return function(){clearInterval(r.stalledInterval),-1===[i,a,p,o].indexOf(r.fileUpload.status)&&r.part.status!==u&&r.part.loadedBytes-1},E.prototype.delaySend=function(){var t=this.backOffWait();this.attempts+=1,setTimeout(this.send.bind(this),t)},E.prototype.errorHandler=function(t){if(clearInterval(this.stalledInterval),t.match(/status:404/)){var r="404 error on part PUT. The part and the file will abort. "+t;return e.w(r),this.fileUpload.error(r),this.part.status=u,this.awsDeferred.reject(r),!0}return this.resetLoadedBytes(),this.part.status=a,this.errorExceptionStatus()||this.delaySend(),!0},E.prototype.abort=function(){this.currentXhr&&this.currentXhr.abort(),this.resetLoadedBytes(),this.attempts=1},E.size=0,E.prototype.streamToArrayBuffer=function(t){return new Promise(function(e,r){if(!t.readable)return e([]);var n=new Uint8Array(Math.min(this.con.partSize,this.end-this.start)),i=0;function o(t){1!==t.byteLength&&(n.set(t,i),i+=t.byteLength)}function s(t){t?r(t):e(n),u()}function a(){e(n),u()}function u(){n=null,t.removeListener("data",o),t.removeListener("end",s),t.removeListener("error",s),t.removeListener("close",a)}t.on("data",o),t.on("end",s),t.on("error",s),t.on("close",a)}.bind(this))},E.prototype.getPayload=function(){return void 0===this.payloadPromise&&(this.payloadPromise=this.con.readableStreams?this.payloadFromStream():this.payloadFromBlob()),this.payloadPromise},E.prototype.payloadFromStream=function(){var t=this.con.readableStreamPartMethod(this.fileUpload.file,this.start,this.end-1);return new Promise(function(e,r){this.streamToArrayBuffer(t).then(function(t){e(t)}.bind(this),r)}.bind(this))},E.prototype.payloadFromBlob=function(){var t=this.fileUpload.file,e=t[t.slice?"slice":t.mozSlice?"mozSlice":"webkitSlice"](this.start,this.end);return this.con.computeContentMd5?new Promise((function(t){var r=new FileReader;r.onloadend=function(){var e=this.result&&void 0!==this.result.buffer?new Uint8Array(this.result.buffer):this.result;t(e)},r.readAsArrayBuffer(e)})):Promise.resolve(e)},E.prototype.stalledInterval=-1,E.prototype.getStartedPromise=function(){return this.started.promise},A.prototype=Object.create(v.prototype),A.prototype.constructor=A,A.prototype.maxRetries=1,A.prototype.success=function(){this.fileUpload.setStatus(u),this.awsDeferred.resolve(this.currentXhr)},A.prototype.errorHandler=function(t){if(this.attempts>this.maxRetries){var r="Error aborting upload, Exceeded retries deleting the file upload: "+t;return e.w(r),this.fileUpload.error(r),this.awsDeferred.reject(r),!0}},F.prototype.supported=!1,F.prototype.cacheStore=void 0,F.prototype.getItem=function(t){if(this.cacheStore)return this.cacheStore[t]},F.prototype.setItem=function(t,e){this.cacheStore&&(this.cacheStore[t]=e)},F.prototype.removeItem=function(t){if(this.cacheStore)return delete this.cacheStore[t]},F.supported=function(){var t=!1;if("undefined"==typeof window)return t;if(!("localStorage"in window))return t;try{var e="___test";localStorage[e]="OK";var r=localStorage[e];return delete localStorage[e],"OK"===r}catch(e){return t}},e={d:function(){},w:function(){},e:function(){}},h?h=g:"undefined"!=typeof window&&(window.Evaporate=g)}();var p={};!function(t){if("object"==typeof p)p=t();else if("function"==typeof define&&define.amd)define(t);else{var e;try{e=window}catch(t){e=self}e.SparkMD5=t()}}((function(t){"use strict";var e=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function r(t,e){var r=t[0],n=t[1],i=t[2],o=t[3];n=((n+=((i=((i+=((o=((o+=((r=((r+=(n&i|~n&o)+e[0]-680876936|0)<<7|r>>>25)+n|0)&n|~r&i)+e[1]-389564586|0)<<12|o>>>20)+r|0)&r|~o&n)+e[2]+606105819|0)<<17|i>>>15)+o|0)&o|~i&r)+e[3]-1044525330|0)<<22|n>>>10)+i|0,n=((n+=((i=((i+=((o=((o+=((r=((r+=(n&i|~n&o)+e[4]-176418897|0)<<7|r>>>25)+n|0)&n|~r&i)+e[5]+1200080426|0)<<12|o>>>20)+r|0)&r|~o&n)+e[6]-1473231341|0)<<17|i>>>15)+o|0)&o|~i&r)+e[7]-45705983|0)<<22|n>>>10)+i|0,n=((n+=((i=((i+=((o=((o+=((r=((r+=(n&i|~n&o)+e[8]+1770035416|0)<<7|r>>>25)+n|0)&n|~r&i)+e[9]-1958414417|0)<<12|o>>>20)+r|0)&r|~o&n)+e[10]-42063|0)<<17|i>>>15)+o|0)&o|~i&r)+e[11]-1990404162|0)<<22|n>>>10)+i|0,n=((n+=((i=((i+=((o=((o+=((r=((r+=(n&i|~n&o)+e[12]+1804603682|0)<<7|r>>>25)+n|0)&n|~r&i)+e[13]-40341101|0)<<12|o>>>20)+r|0)&r|~o&n)+e[14]-1502002290|0)<<17|i>>>15)+o|0)&o|~i&r)+e[15]+1236535329|0)<<22|n>>>10)+i|0,n=((n+=((i=((i+=((o=((o+=((r=((r+=(n&o|i&~o)+e[1]-165796510|0)<<5|r>>>27)+n|0)&i|n&~i)+e[6]-1069501632|0)<<9|o>>>23)+r|0)&n|r&~n)+e[11]+643717713|0)<<14|i>>>18)+o|0)&r|o&~r)+e[0]-373897302|0)<<20|n>>>12)+i|0,n=((n+=((i=((i+=((o=((o+=((r=((r+=(n&o|i&~o)+e[5]-701558691|0)<<5|r>>>27)+n|0)&i|n&~i)+e[10]+38016083|0)<<9|o>>>23)+r|0)&n|r&~n)+e[15]-660478335|0)<<14|i>>>18)+o|0)&r|o&~r)+e[4]-405537848|0)<<20|n>>>12)+i|0,n=((n+=((i=((i+=((o=((o+=((r=((r+=(n&o|i&~o)+e[9]+568446438|0)<<5|r>>>27)+n|0)&i|n&~i)+e[14]-1019803690|0)<<9|o>>>23)+r|0)&n|r&~n)+e[3]-187363961|0)<<14|i>>>18)+o|0)&r|o&~r)+e[8]+1163531501|0)<<20|n>>>12)+i|0,n=((n+=((i=((i+=((o=((o+=((r=((r+=(n&o|i&~o)+e[13]-1444681467|0)<<5|r>>>27)+n|0)&i|n&~i)+e[2]-51403784|0)<<9|o>>>23)+r|0)&n|r&~n)+e[7]+1735328473|0)<<14|i>>>18)+o|0)&r|o&~r)+e[12]-1926607734|0)<<20|n>>>12)+i|0,n=((n+=((i=((i+=((o=((o+=((r=((r+=(n^i^o)+e[5]-378558|0)<<4|r>>>28)+n|0)^n^i)+e[8]-2022574463|0)<<11|o>>>21)+r|0)^r^n)+e[11]+1839030562|0)<<16|i>>>16)+o|0)^o^r)+e[14]-35309556|0)<<23|n>>>9)+i|0,n=((n+=((i=((i+=((o=((o+=((r=((r+=(n^i^o)+e[1]-1530992060|0)<<4|r>>>28)+n|0)^n^i)+e[4]+1272893353|0)<<11|o>>>21)+r|0)^r^n)+e[7]-155497632|0)<<16|i>>>16)+o|0)^o^r)+e[10]-1094730640|0)<<23|n>>>9)+i|0,n=((n+=((i=((i+=((o=((o+=((r=((r+=(n^i^o)+e[13]+681279174|0)<<4|r>>>28)+n|0)^n^i)+e[0]-358537222|0)<<11|o>>>21)+r|0)^r^n)+e[3]-722521979|0)<<16|i>>>16)+o|0)^o^r)+e[6]+76029189|0)<<23|n>>>9)+i|0,n=((n+=((i=((i+=((o=((o+=((r=((r+=(n^i^o)+e[9]-640364487|0)<<4|r>>>28)+n|0)^n^i)+e[12]-421815835|0)<<11|o>>>21)+r|0)^r^n)+e[15]+530742520|0)<<16|i>>>16)+o|0)^o^r)+e[2]-995338651|0)<<23|n>>>9)+i|0,n=((n+=((o=((o+=(n^((r=((r+=(i^(n|~o))+e[0]-198630844|0)<<6|r>>>26)+n|0)|~i))+e[7]+1126891415|0)<<10|o>>>22)+r|0)^((i=((i+=(r^(o|~n))+e[14]-1416354905|0)<<15|i>>>17)+o|0)|~r))+e[5]-57434055|0)<<21|n>>>11)+i|0,n=((n+=((o=((o+=(n^((r=((r+=(i^(n|~o))+e[12]+1700485571|0)<<6|r>>>26)+n|0)|~i))+e[3]-1894986606|0)<<10|o>>>22)+r|0)^((i=((i+=(r^(o|~n))+e[10]-1051523|0)<<15|i>>>17)+o|0)|~r))+e[1]-2054922799|0)<<21|n>>>11)+i|0,n=((n+=((o=((o+=(n^((r=((r+=(i^(n|~o))+e[8]+1873313359|0)<<6|r>>>26)+n|0)|~i))+e[15]-30611744|0)<<10|o>>>22)+r|0)^((i=((i+=(r^(o|~n))+e[6]-1560198380|0)<<15|i>>>17)+o|0)|~r))+e[13]+1309151649|0)<<21|n>>>11)+i|0,n=((n+=((o=((o+=(n^((r=((r+=(i^(n|~o))+e[4]-145523070|0)<<6|r>>>26)+n|0)|~i))+e[11]-1120210379|0)<<10|o>>>22)+r|0)^((i=((i+=(r^(o|~n))+e[2]+718787259|0)<<15|i>>>17)+o|0)|~r))+e[9]-343485551|0)<<21|n>>>11)+i|0,t[0]=r+t[0]|0,t[1]=n+t[1]|0,t[2]=i+t[2]|0,t[3]=o+t[3]|0}function n(t){var e,r=[];for(e=0;e<64;e+=4)r[e>>2]=t.charCodeAt(e)+(t.charCodeAt(e+1)<<8)+(t.charCodeAt(e+2)<<16)+(t.charCodeAt(e+3)<<24);return r}function i(t){var e,r=[];for(e=0;e<64;e+=4)r[e>>2]=t[e]+(t[e+1]<<8)+(t[e+2]<<16)+(t[e+3]<<24);return r}function o(t){var e,i,o,s,a,u,h=t.length,p=[1732584193,-271733879,-1732584194,271733878];for(e=64;e<=h;e+=64)r(p,n(t.substring(e-64,e)));for(i=(t=t.substring(e-64)).length,o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],e=0;e>2]|=t.charCodeAt(e)<<(e%4<<3);if(o[e>>2]|=128<<(e%4<<3),e>55)for(r(p,o),e=0;e<16;e+=1)o[e]=0;return s=(s=8*h).toString(16).match(/(.*?)(.{0,8})$/),a=parseInt(s[2],16),u=parseInt(s[1],16)||0,o[14]=a,o[15]=u,r(p,o),p}function s(t){var r,n="";for(r=0;r<4;r+=1)n+=e[t>>8*r+4&15]+e[t>>8*r&15];return n}function a(t){var e;for(e=0;e>16)+(e>>16)+(r>>16)<<16|65535&r},"undefined"==typeof ArrayBuffer||ArrayBuffer.prototype.slice||function(){function e(t,e){return(t=0|t||0)<0?Math.max(t+e,0):Math.min(t,e)}ArrayBuffer.prototype.slice=function(r,n){var i,o,s,a,u=this.byteLength,h=e(r,u),p=u;return n!==t&&(p=e(n,u)),h>p?new ArrayBuffer(0):(i=p-h,o=new ArrayBuffer(i),s=new Uint8Array(o),a=new Uint8Array(this,h,i),s.set(a),o)}}(),p.prototype.append=function(t){return this.appendBinary(u(t)),this},p.prototype.appendBinary=function(t){this._buff+=t,this._length+=t.length;var e,i=this._buff.length;for(e=64;e<=i;e+=64)r(this._hash,n(this._buff.substring(e-64,e)));return this._buff=this._buff.substring(e-64),this},p.prototype.end=function(t){var e,r,n=this._buff,i=n.length,o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(e=0;e>2]|=n.charCodeAt(e)<<(e%4<<3);return this._finish(o,i),r=a(this._hash),t&&(r=h(r)),this.reset(),r},p.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},p.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},p.prototype.setState=function(t){return this._buff=t.buff,this._length=t.length,this._hash=t.hash,this},p.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},p.prototype._finish=function(t,e){var n,i,o,s=e;if(t[s>>2]|=128<<(s%4<<3),s>55)for(r(this._hash,t),s=0;s<16;s+=1)t[s]=0;n=(n=8*this._length).toString(16).match(/(.*?)(.{0,8})$/),i=parseInt(n[2],16),o=parseInt(n[1],16)||0,t[14]=i,t[15]=o,r(this._hash,t)},p.hash=function(t,e){return p.hashBinary(u(t),e)},p.hashBinary=function(t,e){var r=a(o(t));return e?h(r):r},p.ArrayBuffer=function(){this.reset()},p.ArrayBuffer.prototype.append=function(t){var e,n,o,s,a,u=(n=this._buff.buffer,o=t,s=!0,(a=new Uint8Array(n.byteLength+o.byteLength)).set(new Uint8Array(n)),a.set(new Uint8Array(o),n.byteLength),s?a:a.buffer),h=u.length;for(this._length+=t.byteLength,e=64;e<=h;e+=64)r(this._hash,i(u.subarray(e-64,e)));return this._buff=e-64>2]|=n[e]<<(e%4<<3);return this._finish(o,i),r=a(this._hash),t&&(r=h(r)),this.reset(),r},p.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},p.ArrayBuffer.prototype.getState=function(){var t,e=p.prototype.getState.call(this);return e.buff=(t=e.buff,String.fromCharCode.apply(null,new Uint8Array(t))),e},p.ArrayBuffer.prototype.setState=function(t){return t.buff=function(t,e){var r,n=t.length,i=new ArrayBuffer(n),o=new Uint8Array(i);for(r=0;r>2]|=t[e]<<(e%4<<3);if(o[e>>2]|=128<<(e%4<<3),e>55)for(r(p,o),e=0;e<16;e+=1)o[e]=0;return s=(s=8*h).toString(16).match(/(.*?)(.{0,8})$/),a=parseInt(s[2],16),u=parseInt(s[1],16)||0,o[14]=a,o[15]=u,r(p,o),p}(new Uint8Array(t)));return e?h(n):n},p}));const f=(t,e,r,n,i,o)=>{let s=new XMLHttpRequest;s.open(t,e,!0),Object.keys(n).forEach((t=>{s.setRequestHeader(t,n[t])})),s.onload=()=>{o(s.status,s.responseText)},s.onerror=s.onabort=()=>{y(!1),l(i,"Sorry, failed to upload file.")},s.send(r)},c=t=>{let e;try{e=JSON.parse(t)}catch(t){e=null}return e},l=(t,e)=>{t.className="s3direct form-active",t.querySelector(".file-input").value="",alert(e)};let d=0;const y=t=>{const e=document.querySelector(".submit-row");if(!e)return;const r=e.querySelectorAll("input[type=submit],button[type=submit]");!0===t?d++:d--,[].forEach.call(r,(t=>{t.disabled=0!==d}))},g=(t,e,r,n)=>{const i=t.querySelector(".file-link"),o=t.querySelector(".file-url");o.value=e+"/"+r+"/"+n,i.setAttribute("href",o.value),i.innerHTML=(t=>decodeURIComponent((t+"").replace(/\+/g,"%20")))(o.value).split("/").pop(),t.className="s3direct link-active",t.querySelector(".bar").style.width="0%",y(!1)},m=t=>btoa(e(p).ArrayBuffer.hash(t,!0)),v=t=>e(a)("sha256").update(t,"utf-8").digest("hex"),w=t=>{const r=t.querySelector(".csrf-cookie-name"),n=document.querySelector("input[name=csrfmiddlewaretoken]");return n?n.value:e(s).get(r.value)},b=(t,e,r)=>{const n={};return t&&(n["x-amz-acl"]=t),r&&(n["x-amz-security-token"]=r),e&&(n["x-amz-server-side-encryption"]=e),n},_=t=>{const e={};return t&&(e["x-amz-security-token"]=t),e},S=(t,e,r)=>(n,i,o,s,a)=>new Promise(((n,i)=>{const a=new FormData,u={"X-CSRFToken":w(t)};a.append("to_sign",o),a.append("datetime",s),a.append("dest",r),f("POST",e,a,u,t,((t,e)=>{const r=c(e);if(200===t)n(r.s3ObjKey);else i(r.error)}))})),U=(t,r,n,i,o)=>{const s={customAuthMethod:S(t,r,o),aws_key:n.access_key_id,bucket:n.bucket,aws_url:n.endpoint,awsRegion:n.region,computeContentMd5:!0,cryptoMd5Method:m,cryptoHexEncodedHash256:v,partSize:20971520,logging:!0,allowS3ExistenceOptimization:n.allow_existence_optimization,s3FileCacheHoursAgo:n.allow_existence_optimization?12:0},a={name:n.object_key,file:i,contentType:i.type,xAmzHeadersCommon:_(n.session_token),xAmzHeadersAtInitiate:b(n.acl,n.server_side_encryption,n.session_token),progress:(e,r)=>{((t,e)=>{t.querySelector(".bar").style.width=Math.round(100*e)+"%"})(t,e)},warn:(e,r,n)=>{n.includes("InvalidAccessKeyId")&&l(t,n)}},u={};n.cache_control&&(u["Cache-Control"]=n.cache_control),n.content_disposition&&(u["Content-Disposition"]=n.content_disposition),a.notSignedHeadersAtInitiate=u,e(h).create(s).then((e=>{y(!0),t.className="s3direct progress-active";const r=t.querySelector(".cancel-button"),i=t=>{t.preventDefault(),e.cancel(`${n.bucket}/${a.name}`)};r.addEventListener("click",i,!1),e.add(a).then((e=>{r.removeEventListener("click",i),g(t,n.endpoint,n.bucket,e)}),(e=>(r.removeEventListener("click",i),l(t,e))))}))},P=t=>{const e=t.target.parentElement,r=e.querySelector(".file-input").files[0],n=e.querySelector(".file-dest").value,i=e.getAttribute("data-policy-url"),o=e.getAttribute("data-signing-url"),s=new FormData,a={"X-CSRFToken":w(e)};s.append("dest",n),s.append("name",r.name),s.append("type",r.type),s.append("size",r.size),f("POST",i,s,a,e,((t,i)=>{const s=c(i);switch(t){case 200:U(e,o,s,r,n);break;case 400:case 403:case 500:l(e,s.error);break;default:l(e,"Sorry, could not get upload URL.")}}))},E=t=>{t.preventDefault();const e=t.target.parentElement;e.querySelector(".file-url").value="",e.querySelector(".file-input").value="",e.className="s3direct form-active"},A=t=>{const e=t.querySelector(".file-url"),r=t.querySelector(".file-input"),n=t.querySelector(".file-remove"),i=""===e.value?"form":"link";t.className="s3direct "+i+"-active",n.addEventListener("click",E,!1),r.addEventListener("change",P,!1)};document.addEventListener("DOMContentLoaded",(t=>{new MutationObserver((function(t){[].forEach.call(document.querySelectorAll(".s3direct"),A)})).observe(document.body,{childList:!0,subtree:!0})}))}(); \ No newline at end of file +!function(){function t(t,e,r,n){Object.defineProperty(t,e,{get:r,set:n,enumerable:!0,configurable:!0})}function e(t){return t&&t.__esModule?t.default:t}var r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},n={},i={},o=r.parcelRequire952e;null==o&&((o=function(t){if(t in n)return n[t].exports;if(t in i){var e=i[t];delete i[t];var r={id:t,exports:{}};return n[t]=r,e.call(r.exports,r,r.exports),r.exports}var o=new Error("Cannot find module '"+t+"'");throw o.code="MODULE_NOT_FOUND",o}).register=function(t,e){i[t]=e},r.parcelRequire952e=o),o.register("gvLJ0",(function(t,e){var r=o("2yz1O"),n=o("2X4kY"),i=o("4Sxqp").Buffer,s=[1518500249,1859775393,-1894007588,-899497514],a=new Array(80);function u(){this.init(),this._w=a,n.call(this,64,56)}function h(t){return t<<30|t>>>2}function p(t,e,r,n){return 0===t?e&r|~e&n:2===t?e&r|e&n|r&n:e^r^n}r(u,n),u.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},u.prototype._update=function(t){for(var e,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,a=0|this._d,u=0|this._e,f=0;f<16;++f)r[f]=t.readInt32BE(4*f);for(;f<80;++f)r[f]=r[f-3]^r[f-8]^r[f-14]^r[f-16];for(var c=0;c<80;++c){var l=~~(c/20),d=0|((e=n)<<5|e>>>27)+p(l,i,o,a)+u+r[c]+s[l];u=a,a=o,o=h(i),i=n,n=d}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=u+this._e|0},u.prototype._hash=function(){var t=i.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},t.exports=u})),o.register("2yz1O",(function(t,e){"function"==typeof Object.create?t.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}})),o.register("2X4kY",(function(t,e){var r=o("4Sxqp").Buffer;function n(t,e){this._block=r.alloc(t),this._finalSize=e,this._blockSize=t,this._len=0}n.prototype.update=function(t,e){"string"==typeof t&&(e=e||"utf8",t=r.from(t,e));for(var n=this._block,i=this._blockSize,o=t.length,s=this._len,a=0;a=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(4294967295&r)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var o=this._hash();return t?o.toString(t):o},n.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=n})),o.register("4Sxqp",(function(t,e){var r=o("6j8M1"),n=r.Buffer;function i(t,e){for(var r in t)e[r]=t[r]}function s(t,e,r){return n(t,e,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?t.exports=r:(i(r,t.exports),t.exports.Buffer=s),i(n,s),s.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return n(t,e,r)},s.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var i=n(t);return void 0!==e?"string"==typeof r?i.fill(e,r):i.fill(e):i.fill(0),i},s.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n(t)},s.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return r.SlowBuffer(t)}})),o.register("6j8M1",(function(e,r){var n,i,s,a;t(e.exports,"Buffer",(function(){return n}),(function(t){return n=t})),t(e.exports,"SlowBuffer",(function(){return i}),(function(t){return i=t})),t(e.exports,"INSPECT_MAX_BYTES",(function(){return s}),(function(t){return s=t})),t(e.exports,"kMaxLength",(function(){return a}),(function(t){return a=t}));var u=o("das8S"),h=o("6HbER");const p="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;n=l,i=function(t){+t!=t&&(t=0);return l.alloc(+t)},s=50;const f=2147483647;function c(t){if(t>f)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,l.prototype),e}function l(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return g(t)}return d(t,e,r)}function d(t,e,r){if("string"==typeof t)return function(t,e){"string"==typeof e&&""!==e||(e="utf8");if(!l.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const r=0|_(t,e);let n=c(r);const i=n.write(t,e);i!==r&&(n=n.slice(0,i));return n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(tt(t,Uint8Array)){const e=new Uint8Array(t);return w(e.buffer,e.byteOffset,e.byteLength)}return m(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(tt(t,ArrayBuffer)||t&&tt(t.buffer,ArrayBuffer))return w(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(tt(t,SharedArrayBuffer)||t&&tt(t.buffer,SharedArrayBuffer)))return w(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return l.from(n,e,r);const i=function(t){if(l.isBuffer(t)){const e=0|v(t.length),r=c(e);return 0===r.length||t.copy(r,0,0,e),r}if(void 0!==t.length)return"number"!=typeof t.length||et(t.length)?c(0):m(t);if("Buffer"===t.type&&Array.isArray(t.data))return m(t.data)}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return l.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function y(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function g(t){return y(t),c(t<0?0:0|v(t))}function m(t){const e=t.length<0?0:0|v(t.length),r=c(e);for(let n=0;n=f)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+f.toString(16)+" bytes");return 0|t}function _(t,e){if(l.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||tt(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);const r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return J(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return Z(t).length;default:if(i)return n?-1:J(t).length;e=(""+e).toLowerCase(),i=!0}}function b(t,e,r){let n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return M(this,e,r);case"utf8":case"utf-8":return O(this,e,r);case"ascii":return R(this,e,r);case"latin1":case"binary":return q(this,e,r);case"base64":return T(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return z(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function S(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function U(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),et(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=l.from(e,n)),l.isBuffer(e))return 0===e.length?-1:B(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):B(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function B(t,e,r,n,i){let o,s=1,a=t.length,u=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;s=2,a/=2,u/=2,r/=2}function h(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){let n=-1;for(o=r;oa&&(r=a-u),o=r;o>=0;o--){let r=!0;for(let n=0;ni&&(n=i):n=i;const o=e.length;let s;for(n>o/2&&(n=o/2),s=0;s>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function T(t,e,r){return 0===e&&r===t.length?u.fromByteArray(t):u.fromByteArray(t.slice(e,r))}function O(t,e,r){r=Math.min(t.length,r);const n=[];let i=e;for(;i239?4:e>223?3:e>191?2:1;if(i+s<=r){let r,n,a,u;switch(s){case 1:e<128&&(o=e);break;case 2:r=t[i+1],128==(192&r)&&(u=(31&e)<<6|63&r,u>127&&(o=u));break;case 3:r=t[i+1],n=t[i+2],128==(192&r)&&128==(192&n)&&(u=(15&e)<<12|(63&r)<<6|63&n,u>2047&&(u<55296||u>57343)&&(o=u));break;case 4:r=t[i+1],n=t[i+2],a=t[i+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(u=(15&e)<<18|(63&r)<<12|(63&n)<<6|63&a,u>65535&&u<1114112&&(o=u))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(t){const e=t.length;if(e<=C)return String.fromCharCode.apply(String,t);let r="",n=0;for(;nn.length?(l.isBuffer(e)||(e=l.from(e)),e.copy(n,i)):Uint8Array.prototype.set.call(n,e,i);else{if(!l.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(n,i)}i+=e.length}return n},l.byteLength=_,l.prototype._isBuffer=!0,l.prototype.swap16=function(){const t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;ee&&(t+=" ... "),""},p&&(l.prototype[p]=l.prototype.inspect),l.prototype.compare=function(t,e,r,n,i){if(tt(t,Uint8Array)&&(t=l.from(t,t.offset,t.byteLength)),!l.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;let o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0);const a=Math.min(o,s),u=this.slice(n,i),h=t.slice(e,r);for(let t=0;t>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return I(this,t,e,r);case"utf8":case"utf-8":return E(this,t,e,r);case"ascii":case"latin1":case"binary":return P(this,t,e,r);case"base64":return A(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const C=4096;function R(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;in)&&(r=n);let i="";for(let n=e;nr)throw new RangeError("Trying to access beyond buffer length")}function k(t,e,r,n,i,o){if(!l.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function j(t,e,r,n,i){Y(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,r}function L(t,e,r,n,i){Y(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r+7]=o,o>>=8,t[r+6]=o,o>>=8,t[r+5]=o,o>>=8,t[r+4]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=s,s>>=8,t[r+2]=s,s>>=8,t[r+1]=s,s>>=8,t[r]=s,r+8}function H(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function N(t,e,r,n,i){return e=+e,r>>>=0,i||H(t,0,r,4),h.write(t,e,r,n,23,4),r+4}function D(t,e,r,n,i){return e=+e,r>>>=0,i||H(t,0,r,8),h.write(t,e,r,n,52,8),r+8}l.prototype.slice=function(t,e){const r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e>>=0,e>>>=0,r||F(t,e,this.length);let n=this[t],i=1,o=0;for(;++o>>=0,e>>>=0,r||F(t,e,this.length);let n=this[t+--e],i=1;for(;e>0&&(i*=256);)n+=this[t+--e]*i;return n},l.prototype.readUint8=l.prototype.readUInt8=function(t,e){return t>>>=0,e||F(t,1,this.length),this[t]},l.prototype.readUint16LE=l.prototype.readUInt16LE=function(t,e){return t>>>=0,e||F(t,2,this.length),this[t]|this[t+1]<<8},l.prototype.readUint16BE=l.prototype.readUInt16BE=function(t,e){return t>>>=0,e||F(t,2,this.length),this[t]<<8|this[t+1]},l.prototype.readUint32LE=l.prototype.readUInt32LE=function(t,e){return t>>>=0,e||F(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},l.prototype.readUint32BE=l.prototype.readUInt32BE=function(t,e){return t>>>=0,e||F(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},l.prototype.readBigUInt64LE=nt((function(t){K(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||V(t,this.length-8);const n=e+256*this[++t]+65536*this[++t]+this[++t]*2**24,i=this[++t]+256*this[++t]+65536*this[++t]+r*2**24;return BigInt(n)+(BigInt(i)<>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||V(t,this.length-8);const n=e*2**24+65536*this[++t]+256*this[++t]+this[++t],i=this[++t]*2**24+65536*this[++t]+256*this[++t]+r;return(BigInt(n)<>>=0,e>>>=0,r||F(t,e,this.length);let n=this[t],i=1,o=0;for(;++o=i&&(n-=Math.pow(2,8*e)),n},l.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||F(t,e,this.length);let n=e,i=1,o=this[t+--n];for(;n>0&&(i*=256);)o+=this[t+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o},l.prototype.readInt8=function(t,e){return t>>>=0,e||F(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},l.prototype.readInt16LE=function(t,e){t>>>=0,e||F(t,2,this.length);const r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt16BE=function(t,e){t>>>=0,e||F(t,2,this.length);const r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt32LE=function(t,e){return t>>>=0,e||F(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},l.prototype.readInt32BE=function(t,e){return t>>>=0,e||F(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},l.prototype.readBigInt64LE=nt((function(t){K(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||V(t,this.length-8);const n=this[t+4]+256*this[t+5]+65536*this[t+6]+(r<<24);return(BigInt(n)<>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||V(t,this.length-8);const n=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(n)<>>=0,e||F(t,4,this.length),h.read(this,t,!0,23,4)},l.prototype.readFloatBE=function(t,e){return t>>>=0,e||F(t,4,this.length),h.read(this,t,!1,23,4)},l.prototype.readDoubleLE=function(t,e){return t>>>=0,e||F(t,8,this.length),h.read(this,t,!0,52,8)},l.prototype.readDoubleBE=function(t,e){return t>>>=0,e||F(t,8,this.length),h.read(this,t,!1,52,8)},l.prototype.writeUintLE=l.prototype.writeUIntLE=function(t,e,r,n){if(t=+t,e>>>=0,r>>>=0,!n){k(this,t,e,r,Math.pow(2,8*r)-1,0)}let i=1,o=0;for(this[e]=255&t;++o>>=0,r>>>=0,!n){k(this,t,e,r,Math.pow(2,8*r)-1,0)}let i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},l.prototype.writeUint8=l.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,1,255,0),this[e]=255&t,e+1},l.prototype.writeUint16LE=l.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},l.prototype.writeUint16BE=l.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},l.prototype.writeUint32LE=l.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},l.prototype.writeUint32BE=l.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},l.prototype.writeBigUInt64LE=nt((function(t,e=0){return j(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),l.prototype.writeBigUInt64BE=nt((function(t,e=0){return L(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),l.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);k(this,t,e,r,n-1,-n)}let i=0,o=1,s=0;for(this[e]=255&t;++i>0)-s&255;return e+r},l.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);k(this,t,e,r,n-1,-n)}let i=r-1,o=1,s=0;for(this[e+i]=255&t;--i>=0&&(o*=256);)t<0&&0===s&&0!==this[e+i+1]&&(s=1),this[e+i]=(t/o>>0)-s&255;return e+r},l.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},l.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},l.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},l.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},l.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},l.prototype.writeBigInt64LE=nt((function(t,e=0){return j(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),l.prototype.writeBigInt64BE=nt((function(t,e=0){return L(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),l.prototype.writeFloatLE=function(t,e,r){return N(this,t,e,!0,r)},l.prototype.writeFloatBE=function(t,e,r){return N(this,t,e,!1,r)},l.prototype.writeDoubleLE=function(t,e,r){return D(this,t,e,!0,r)},l.prototype.writeDoubleBE=function(t,e,r){return D(this,t,e,!1,r)},l.prototype.copy=function(t,e,r,n){if(!l.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function Y(t,e,r,n,i,o){if(t>r||t3?0===e||e===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(o+1)}${n}`:`>= -(2${n} ** ${8*(o+1)-1}${n}) and < 2 ** ${8*(o+1)-1}${n}`:`>= ${e}${n} and <= ${r}${n}`,new X.ERR_OUT_OF_RANGE("value",i,t)}!function(t,e,r){K(e,"offset"),void 0!==t[e]&&void 0!==t[e+r]||V(e,t.length-(r+1))}(n,i,o)}function K(t,e){if("number"!=typeof t)throw new X.ERR_INVALID_ARG_TYPE(e,"number",t)}function V(t,e,r){if(Math.floor(t)!==t)throw K(t,r),new X.ERR_OUT_OF_RANGE(r||"offset","an integer",t);if(e<0)throw new X.ERR_BUFFER_OUT_OF_BOUNDS;throw new X.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}$("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),$("ERR_INVALID_ARG_TYPE",(function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`}),TypeError),$("ERR_OUT_OF_RANGE",(function(t,e,r){let n=`The value of "${t}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=W(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=W(i)),i+="n"),n+=` It must be ${e}. Received ${i}`,n}),RangeError);const G=/[^+/0-9A-Za-z-_]/g;function J(t,e){let r;e=e||1/0;const n=t.length;let i=null;const o=[];for(let s=0;s55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function Z(t){return u.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(G,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function Q(t,e,r,n){let i;for(i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function tt(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function et(t){return t!=t}const rt=function(){const t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)e[n+i]=t[r]+t[i]}return e}();function nt(t){return"undefined"==typeof BigInt?it:t}function it(){throw new Error("BigInt not supported")}})),o.register("das8S",(function(e,r){var n,i;t(e.exports,"toByteArray",(function(){return n}),(function(t){return n=t})),t(e.exports,"fromByteArray",(function(){return i}),(function(t){return i=t})),n=function(t){var e,r,n=f(t),i=n[0],o=n[1],u=new a(function(t,e,r){return 3*(e+r)/4-r}(0,i,o)),h=0,p=o>0?i-4:i;for(r=0;r>16&255,u[h++]=e>>8&255,u[h++]=255&e;2===o&&(e=s[t.charCodeAt(r)]<<2|s[t.charCodeAt(r+1)]>>4,u[h++]=255&e);1===o&&(e=s[t.charCodeAt(r)]<<10|s[t.charCodeAt(r+1)]<<4|s[t.charCodeAt(r+2)]>>2,u[h++]=e>>8&255,u[h++]=255&e);return u},i=function(t){for(var e,r=t.length,n=r%3,i=[],s=16383,a=0,u=r-n;au?u:a+s));1===n?(e=t[r-1],i.push(o[e>>2]+o[e<<4&63]+"==")):2===n&&(e=(t[r-2]<<8)+t[r-1],i.push(o[e>>10]+o[e>>4&63]+o[e<<2&63]+"="));return i.join("")};for(var o=[],s=[],a="undefined"!=typeof Uint8Array?Uint8Array:Array,u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",h=0,p=u.length;h0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function c(t,e,r){for(var n,i,s=[],a=e;a>18&63]+o[i>>12&63]+o[i>>6&63]+o[63&i]);return s.join("")}s["-".charCodeAt(0)]=62,s["_".charCodeAt(0)]=63})),o.register("6HbER",(function(e,r){ +/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */var n,i;t(e.exports,"read",(function(){return n}),(function(t){return n=t})),t(e.exports,"write",(function(){return i}),(function(t){return i=t})),n=function(t,e,r,n,i){var o,s,a=8*i-n-1,u=(1<>1,p=-7,f=r?i-1:0,c=r?-1:1,l=t[e+f];for(f+=c,o=l&(1<<-p)-1,l>>=-p,p+=a;p>0;o=256*o+t[e+f],f+=c,p-=8);for(s=o&(1<<-p)-1,o>>=-p,p+=n;p>0;s=256*s+t[e+f],f+=c,p-=8);if(0===o)o=1-h;else{if(o===u)return s?NaN:1/0*(l?-1:1);s+=Math.pow(2,n),o-=h}return(l?-1:1)*s*Math.pow(2,o-n)},i=function(t,e,r,n,i,o){var s,a,u,h=8*o-i-1,p=(1<>1,c=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,l=n?0:o-1,d=n?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=p):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),(e+=s+f>=1?c/u:c*Math.pow(2,1-f))*u>=2&&(s++,u/=2),s+f>=p?(a=0,s=p):s+f>=1?(a=(e*u-1)*Math.pow(2,i),s+=f):(a=e*Math.pow(2,f-1)*Math.pow(2,i),s=0));i>=8;t[r+l]=255&a,l+=d,a/=256,i-=8);for(s=s<0;t[r+l]=255&s,l+=d,s/=256,h-=8);t[r+l-d]|=128*y}})),o.register("dgph6",(function(t,e){var r=o("2yz1O"),n=o("2X4kY"),i=o("4Sxqp").Buffer,s=[1518500249,1859775393,-1894007588,-899497514],a=new Array(80);function u(){this.init(),this._w=a,n.call(this,64,56)}function h(t){return t<<5|t>>>27}function p(t){return t<<30|t>>>2}function f(t,e,r,n){return 0===t?e&r|~e&n:2===t?e&r|e&n|r&n:e^r^n}r(u,n),u.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},u.prototype._update=function(t){for(var e,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,a=0|this._d,u=0|this._e,c=0;c<16;++c)r[c]=t.readInt32BE(4*c);for(;c<80;++c)r[c]=(e=r[c-3]^r[c-8]^r[c-14]^r[c-16])<<1|e>>>31;for(var l=0;l<80;++l){var d=~~(l/20),y=h(n)+f(d,i,o,a)+u+r[l]+s[d]|0;u=a,a=o,o=p(i),i=n,n=y}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=u+this._e|0},u.prototype._hash=function(){var t=i.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},t.exports=u})),o.register("18PiT",(function(t,e){var r=o("2yz1O"),n=o("jhpWv"),i=o("2X4kY"),s=o("4Sxqp").Buffer,a=new Array(64);function u(){this.init(),this._w=a,i.call(this,64,56)}r(u,n),u.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},u.prototype._hash=function(){var t=s.allocUnsafe(28);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t},t.exports=u})),o.register("jhpWv",(function(t,e){var r=o("2yz1O"),n=o("2X4kY"),i=o("4Sxqp").Buffer,s=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],a=new Array(64);function u(){this.init(),this._w=a,n.call(this,64,56)}function h(t,e,r){return r^t&(e^r)}function p(t,e,r){return t&e|r&(t|e)}function f(t){return(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10)}function c(t){return(t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7)}function l(t){return(t>>>7|t<<25)^(t>>>18|t<<14)^t>>>3}r(u,n),u.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},u.prototype._update=function(t){for(var e,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,a=0|this._d,u=0|this._e,d=0|this._f,y=0|this._g,g=0|this._h,m=0;m<16;++m)r[m]=t.readInt32BE(4*m);for(;m<64;++m)r[m]=0|(((e=r[m-2])>>>17|e<<15)^(e>>>19|e<<13)^e>>>10)+r[m-7]+l(r[m-15])+r[m-16];for(var w=0;w<64;++w){var v=g+c(u)+h(u,d,y)+s[w]+r[w]|0,_=f(n)+p(n,i,o)|0;g=y,y=d,d=u,u=a+v|0,a=o,o=i,i=n,n=v+_|0}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=u+this._e|0,this._f=d+this._f|0,this._g=y+this._g|0,this._h=g+this._h|0},u.prototype._hash=function(){var t=i.allocUnsafe(32);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t.writeInt32BE(this._h,28),t},t.exports=u})),o.register("8o8Fh",(function(t,e){var r=o("2yz1O"),n=o("5XiLX"),i=o("2X4kY"),s=o("4Sxqp").Buffer,a=new Array(160);function u(){this.init(),this._w=a,i.call(this,128,112)}r(u,n),u.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},u.prototype._hash=function(){var t=s.allocUnsafe(48);function e(e,r,n){t.writeInt32BE(e,n),t.writeInt32BE(r,n+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),t},t.exports=u})),o.register("5XiLX",(function(t,e){var r=o("2yz1O"),n=o("2X4kY"),i=o("4Sxqp").Buffer,s=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],a=new Array(160);function u(){this.init(),this._w=a,n.call(this,128,112)}function h(t,e,r){return r^t&(e^r)}function p(t,e,r){return t&e|r&(t|e)}function f(t,e){return(t>>>28|e<<4)^(e>>>2|t<<30)^(e>>>7|t<<25)}function c(t,e){return(t>>>14|e<<18)^(t>>>18|e<<14)^(e>>>9|t<<23)}function l(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^t>>>7}function d(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^(t>>>7|e<<25)}function y(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^t>>>6}function g(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^(t>>>6|e<<26)}function m(t,e){return t>>>0>>0?1:0}r(u,n),u.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},u.prototype._update=function(t){for(var e=this._w,r=0|this._ah,n=0|this._bh,i=0|this._ch,o=0|this._dh,a=0|this._eh,u=0|this._fh,w=0|this._gh,v=0|this._hh,_=0|this._al,b=0|this._bl,S=0|this._cl,U=0|this._dl,B=0|this._el,I=0|this._fl,E=0|this._gl,P=0|this._hl,A=0;A<32;A+=2)e[A]=t.readInt32BE(4*A),e[A+1]=t.readInt32BE(4*A+4);for(;A<160;A+=2){var x=e[A-30],T=e[A-30+1],O=l(x,T),C=d(T,x),R=y(x=e[A-4],T=e[A-4+1]),q=g(T,x),M=e[A-14],z=e[A-14+1],F=e[A-32],k=e[A-32+1],j=C+z|0,L=O+M+m(j,C)|0;L=(L=L+R+m(j=j+q|0,q)|0)+F+m(j=j+k|0,k)|0,e[A]=L,e[A+1]=j}for(var H=0;H<160;H+=2){L=e[H],j=e[H+1];var N=p(r,n,i),D=p(_,b,S),X=f(r,_),$=f(_,r),W=c(a,B),Y=c(B,a),K=s[H],V=s[H+1],G=h(a,u,w),J=h(B,I,E),Z=P+Y|0,Q=v+W+m(Z,P)|0;Q=(Q=(Q=Q+G+m(Z=Z+J|0,J)|0)+K+m(Z=Z+V|0,V)|0)+L+m(Z=Z+j|0,j)|0;var tt=$+D|0,et=X+N+m(tt,$)|0;v=w,P=E,w=u,E=I,u=a,I=B,a=o+Q+m(B=U+Z|0,U)|0,o=i,U=S,i=n,S=b,n=r,b=_,r=Q+et+m(_=Z+tt|0,Z)|0}this._al=this._al+_|0,this._bl=this._bl+b|0,this._cl=this._cl+S|0,this._dl=this._dl+U|0,this._el=this._el+B|0,this._fl=this._fl+I|0,this._gl=this._gl+E|0,this._hl=this._hl+P|0,this._ah=this._ah+r+m(this._al,_)|0,this._bh=this._bh+n+m(this._bl,b)|0,this._ch=this._ch+i+m(this._cl,S)|0,this._dh=this._dh+o+m(this._dl,U)|0,this._eh=this._eh+a+m(this._el,B)|0,this._fh=this._fh+u+m(this._fl,I)|0,this._gh=this._gh+w+m(this._gl,E)|0,this._hh=this._hh+v+m(this._hl,P)|0},u.prototype._hash=function(){var t=i.allocUnsafe(64);function e(e,r,n){t.writeInt32BE(e,n),t.writeInt32BE(r,n+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),t},t.exports=u}));var s={};s=function(){"use strict";function t(t){for(var e=1;e-1&&(this.maxRetries=r),w.call(this,t,e)}function b(t,e){var r={method:"POST",path:"?uploads",step:"initiate",x_amz_headers:t.xAmzHeadersAtInitiate,not_signed_headers:t.notSignedHeadersAtInitiate,response_match:"(.+)"};v.call(this,t,r),this.awsKey=e}function S(t){t.info("will attempt to complete upload");var e={method:"POST",contentType:"application/xml; charset=UTF-8",path:"?uploadId="+t.uploadId,x_amz_headers:t.xAmzHeadersCommon||t.xAmzHeadersAtComplete,step:"complete"};v.call(this,t,e)}function U(t,e){this.awsKey=e,t.info("will attempt to verify existence of the file");var r={method:"HEAD",path:"",x_amz_headers:t.xAmzHeadersCommon,success404:!0,step:"head_object"};_.call(this,t,r)}function B(t){_.call(this,t),this.updateRequest(this.setupRequest(0))}function I(t,e){this.part=e,this.partNumber=e.partNumber,this.start=(this.partNumber-1)*t.con.partSize,this.end=Math.min(this.partNumber*t.con.partSize,t.sizeBytes);var r={method:"PUT",path:"?partNumber="+this.partNumber+"&uploadId="+t.uploadId,step:"upload #"+this.partNumber,x_amz_headers:t.xAmzHeadersCommon||t.xAmzHeadersAtUpload,contentSha256:"UNSIGNED-PAYLOAD",onProgress:this.onProgress.bind(this)};w.call(this,t,r)}function E(t){t.info("will attempt to abort the upload"),t.abortParts();var e={method:"DELETE",path:"?uploadId="+t.uploadId,x_amz_headers:t.xAmzHeadersCommon,success404:!0,step:"abort"};w.call(this,t,e)}function P(t){var e,r=t||"/";try{e=new URL(r)}catch(t){(e=document.createElement("a")).href=r}return{protocol:e.protocol,hostname:e.hostname,pathname:e.pathname.replace(/(^\/?)/,"/"),port:e.port,search:"?"===e.search[0]?e.search.substr(1):e.search,hash:e.hash,host:e.host}}function A(t){return t?new Date(t).toISOString():""}function x(t){var e=T(t.responseText,"Code"),r=T(t.responseText,"Message");return e.length?["AWS Code: ",e,", Message:",r].join(""):""}function T(t,e){var r=t.match(["<",e,">(.+)"].join(""));return r?r[1]:""}function O(){var t,e={};return t=new Promise((function(t,r){e={resolve:t,reject:r}})),{resolve:e.resolve,reject:e.reject,promise:t}}function C(t,e,r){function n(t,e){if("object"==typeof e)for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])}return t=t||{},n(e=e||{},r=r||{}),n(t,e),t}function R(e){var i=JSON.parse(r.getItem("awsUploads")||"{}");if(e){for(var o in i)if(i.hasOwnProperty(o)){var s=i[o];new Date(s.completedAt||n)-1)return t.splice(r,1),!0}function F(t){for(var e=0;t>=1024;)t/=1024,++e;return[t.toFixed(2).replace(".00",""),["B","Kb","Mb","Gb","Tb","Pb","Eb","Zb","Yb"][e]].join(" ")}function k(t){var e=k.supported();this.cacheStore=t?{}:e?localStorage:void 0}g.create=function(t){var e=C({},t);return g.getLocalTimeOffset(e).then((function(t){return e.localTimeOffset=t,new Promise((function(t,r){var n=new g(e);!0===n.supported?t(n):r(n._instantiationError)}))}))},g.getLocalTimeOffset=function(t){return new Promise((function(r,n){if("number"==typeof t.localTimeOffset)return r(t.localTimeOffset);if(t.timeUrl){var i=new XMLHttpRequest;i.open("GET",t.timeUrl+"?requestTime="+(new Date).getTime()),i.onreadystatechange=function(){if(4===i.readyState&&200===i.status){var t=new Date(Date.parse(i.responseText))-new Date;e.d("localTimeOffset is",t,"ms"),r(t)}},i.onerror=function(t){e.e("xhr error timeUrl",t),n("Fetching offset time failed with status: "+t.status)},i.send()}else r(0)}))},g.prototype.config={},g.prototype.localTimeOffset=0,g.prototype.supported=!1,g.prototype._instantiationError=void 0,g.prototype.evaporatingCount=0,g.prototype.pendingFiles={},g.prototype.filesInProcess=[],g.prototype.queuedFiles=[],g.prototype.startNextFile=function(t){if(this.queuedFiles.length&&!(this.evaporatingCount>=this.config.maxConcurrentParts)){var r=this.queuedFiles.shift();0===r.status?(e.d("Starting",decodeURIComponent(r.name),"reason:",t),this.evaporatingCnt(1),r.start()):(e.d("Requeued",decodeURIComponent(r.name),"status:",r.status,"reason:",t),this.queuedFiles.push(r))}},g.prototype.fileCleanup=function(t){z(this.queuedFiles,t),z(this.filesInProcess,t)&&this.evaporatingCnt(-1),t.done(),this.consumeRemainingSlots()},g.prototype.queueFile=function(t){this.filesInProcess.push(t),this.queuedFiles.push(t),1===this.filesInProcess.length&&this.startNextFile("first file")},g.prototype.add=function(t,e){var r,n=this;return new Promise((function(i,o){var s,a,u,h=C(e,{});if(d.forEach((function(t){delete h[t]})),r=C(n.config,h),void 0===t||void 0===t.file)return o("Missing file");if(r.maxFileSize&&t.file.size>r.maxFileSize)return o("File size too large. Maximum size allowed is "+r.maxFileSize);if(void 0===t.name)return o("Missing attribute: name");r.encodeFilename&&(t.name=(s=t.name,a=s.split("/"),u=[],a.forEach((function(t){for(var e=[],r=encodeURIComponent(t),n=0;n-1&&t.push(n.stop())}return t.length||t.push(Promise.reject("No files to cancel.")),Promise.all(t)},g.prototype._cancelOne=function(t){var e=[];return this.pendingFiles[t]?e.push(this.pendingFiles[t].stop()):e.push(Promise.reject("File does not exist")),Promise.all(e)},g.prototype.pause=function(t,e){var r=void 0!==(e=e||{}).force&&e.force;return void 0===t?this._pauseAll(r):this._pauseOne(t,r)},g.prototype._pauseAll=function(t){e.d("Pausing all file uploads");var r=[];for(var n in this.pendingFiles)if(this.pendingFiles.hasOwnProperty(n)){var i=this.pendingFiles[n];c.indexOf(i.status)>-1&&this._pause(i,t,r)}return Promise.all(r)},g.prototype._pauseOne=function(t,e){var r=[],n=this.pendingFiles[t];return void 0===n?r.push(Promise.reject("Cannot pause a file that has not been added.")):n.status===o&&r.push(Promise.reject("Cannot pause a file that is already paused.")),r.length||this._pause(n,e,r),Promise.all(r)},g.prototype._pause=function(t,e,r){r.push(t.pause(e)),z(this.filesInProcess,t),z(this.queuedFiles,t)},g.prototype.resume=function(t){return void 0===t?this._resumeAll():this._resumeOne(t)},g.prototype._resumeAll=function(){for(var t in e.d("Resuming all file uploads"),this.pendingFiles)if(this.pendingFiles.hasOwnProperty(t)){var r=this.pendingFiles[t];f.indexOf(r.status)>-1&&this.resumeFile(r)}return Promise.resolve()},g.prototype._resumeOne=function(t){var e=this.pendingFiles[t],r=[];return void 0===e?r.push(Promise.reject("Cannot pause a file that does not exist.")):-1===f.indexOf(e.status)?r.push(Promise.reject("Cannot resume a file that has not been paused.")):this.resumeFile(e),Promise.all(r)},g.prototype.resumeFile=function(t){t.resume(),this.queueFile(t)},g.prototype.forceRetry=function(){},g.prototype.consumeRemainingSlots=function(){var t=this.config.maxConcurrentParts-this.evaporatingCount;if(t)for(var e=0;e0&&(n.secondsLeft=Math.round(r/e)),n},m.prototype.onProgress=function(){-1===[u,o].indexOf(this.status)&&(this.progress(this.fileTotalBytesUploaded/this.sizeBytes,this.progessStats()),this.loaded=0)},m.prototype.startMonitor=function(){clearInterval(this.progressInterval),this.startTime=new Date,this.loaded=0,this.totalUploaded=0,this.onProgress(),this.progressInterval=setInterval(this.onProgress.bind(this),this.con.progressIntervalMS)},m.prototype.stopMonitor=function(){clearInterval(this.progressInterval)},m.prototype.startNextFile=function(t){this.evaporate.startNextFile(t)},m.prototype.evaporatingCnt=function(t){this.evaporate.evaporatingCnt(t)},m.prototype.consumeRemainingSlots=function(){this.evaporate.consumeRemainingSlots()},m.prototype.getRemainingSlots=function(){var t=this.evaporate.evaporatingCount;return!this.partsInProcess.length&&t>0&&(t-=1),this.con.maxConcurrentParts-t},m.prototype.lastPartSatisfied=Promise.resolve("onStart"),m.prototype.start=function(){if(this.status=i,this.startMonitor(),this.started(this.id),this.uploadId)return e.d("resuming FileUpload ",this.id),this.consumeSlots();var t=this.name;this.getUnfinishedFileUpload();var r=this.con.computeContentMd5&&this.con.allowS3ExistenceOptimization&&void 0!==this.firstMd5Digest&&void 0!==this.eTag;if(this.uploadId){if(r)return this.reuseS3Object(t).then(this.deferredCompletion.resolve).catch(this.uploadFileFromScratch.bind(this));this.resumeInterruptedUpload().then(this._uploadComplete.bind(this)).catch(this.uploadFileFromScratch.bind(this))}else this.uploadFileFromScratch("")},m.prototype.uploadFileFromScratch=function(t){if(-1!==c.indexOf(this.status))return e.d(t),this.uploadId=void 0,this.uploadFile(this.name).then(this._uploadComplete.bind(this)).catch(this._abortUpload.bind(this))},m.prototype._uploadComplete=function(){this.completeUpload().then(this.deferredCompletion.resolve)},m.prototype.stop=function(){e.d("stopping FileUpload ",this.id),this.setStatus(s),this.info("Canceling uploads..."),this.abortedByUser=!0;var t=this;return this.abortUpload().then((function(){throw"User aborted the upload"})).catch((function(e){t.deferredCompletion.reject(e)}))},m.prototype.pause=function(t){e.d("pausing FileUpload, force:",!!t,this.id);var r=[];return this.info("Pausing uploads..."),this.status=p,t?this.abortParts(!0):(r=this.partsInProcess.map((function(t){return this.s3Parts[t].awsRequest.awsDeferred.promise}),this),this.pausing()),Promise.all(r).then(function(){this.stopMonitor(),this.status=o,this.startNextFile("pause"),this.paused()}.bind(this))},m.prototype.resume=function(){this.status=0,this.resumed()},m.prototype.done=function(){clearInterval(this.progressInterval),this.startNextFile("file done"),this.partsOnS3=[],this.s3Parts=[]},m.prototype._startCompleteUpload=function(t){return function(){(t?this.completeUpload():Promise.resolve()).then(this.deferredCompletion.resolve.bind(this))}},m.prototype._abortUpload=function(){if(!this.abortedByUser){var t=this;this.abortUpload().then((function(){t.deferredCompletion.reject("File upload aborted due to a part failing to upload")}),this.deferredCompletion.reject.bind(this))}},m.prototype.abortParts=function(t){var e=this;this.partsInProcess.slice(0).forEach((function(r){var n=e.s3Parts[r];n&&(n.awsRequest.abort(),t&&(n.status=0),z(e.partsInProcess,n.partNumber),e.partsToUpload.length&&e.evaporatingCnt(-1))}))},m.prototype.makeParts=function(t){this.numParts=Math.ceil(this.sizeBytes/this.con.partSize)||1;var e=[],r=this;function n(t){z(r.partsToUpload,t.partNumber),z(r.partsInProcess,t.partNumber),r.partsToUpload.length&&r.evaporatingCnt(-1)}function i(t){return function(){n(t),r.partsToUpload.length&&r.consumeRemainingSlots(),r.partsToUpload.lengtht&&this.con.bucket===e.bucket&&(!this.con.onlyRetryForSameFileName||this.name===e.awsKey)},m.prototype.partSuccess=function(t,r){var n=r.part;if(e.d(r.request.step,"ETag:",t),n.isEmpty||'"d41d8cd98f00b204e9800998ecf8427e"'!==t)return n.eTag=t,n.status=3,this.partsOnS3.push(n),!0;n.status=a,r.resetLoadedBytes();var i=["eTag matches MD5 of 0 length blob for part #",r.partNumber,"Retrying part."].join(" ");e.w(i),this.warn(i)},m.prototype.listPartsSuccess=function(t,e){this.info("uploadId",this.uploadId,"is not complete. Fetching parts from part marker",t.partNumberMarker),e=e.replace(/(\r\n|\n|\r)/gm,"");for(var r=/(.+?)<\/Part\>/g;;){var n=(r.exec(e)||[])[1];if(!n)break;var i=parseInt(T(n,"Size"),10);this.fileTotalBytesUploaded+=i,this.partsOnS3.push({eTag:T(n,"ETag").replace(/"/g,'"'),partNumber:parseInt(T(n,"PartNumber"),10),size:i,LastModified:T(n,"LastModified")})}return"true"===T(e,"IsTruncated")?T(e,"NextPartNumberMarker"):void 0},m.prototype.makePartsfromPartsOnS3=function(){-1!==c.indexOf(this.status)&&(this.nameChanged(this.name),this.partsOnS3.forEach(function(t){var e=this.makePart(t.partNumber,3,t.size);e.eTag=t.eTag,e.loadedBytes=t.size,e.loadedBytesPrevious=t.size,e.finishedUploadingAt=t.LastModified}.bind(this)))},m.prototype.completeUpload=function(){var t=this;return new S(this).send().then((function(e){t.eTag=T(e.responseText,"ETag").replace(/"/g,'"'),t.completeUploadFile(e)}))},m.prototype.getCompletedPayload=function(){var t=[];return t.push(""),this.s3Parts.forEach((function(e,r){r>0&&["",r,"",e.eTag,""].forEach((function(e){t.push(e)}))})),t.push(""),t.join("")},m.prototype.consumeSlots=function(){if(0===this.partsToUpload.length)return-1;if(this.partsToUpload.length!==this.partsInProcess.length&&this.status===i){var t=Math.min(this.getRemainingSlots(),this.partsToUpload.length);if(!t)return-1;for(var e=0,r=0;r1&&this.evaporatingCnt(1),this.partsInProcess.push(n.partNumber);var o=n.awsRequest;if(this.lastPartSatisfied.then(o.delaySend.bind(o)),this.lastPartSatisfied=o.getStartedPromise(),(e+=1)===t)break}}var s=this.partsToUpload.length===this.partsInProcess.length,a=this.getRemainingSlots();return s&&a>0&&this.startNextFile("consume slots"),a}return 0},m.prototype.canStartPart=function(t){return-1===this.partsInProcess.indexOf(t.partNumber)&&!t.awsRequest.errorExceptionStatus()},m.prototype.uploadFile=function(t){this.removeUploadFile();var e=this;return new b(e,t).send().then((function(){return e.uploadInitiated(e.uploadId),e.partsToUpload=[],e.uploadParts().then((function(){}),(function(t){throw t}))}))},m.prototype.uploadParts=function(){if(this.loaded=0,this.totalUploaded=0,-1===c.indexOf(this.status))return Promise.reject("Part uploading stopped because the file was canceled");var t=this.makeParts();return this.setStatus(i),this.startTime=new Date,this.consumeSlots(),Promise.all(t)},m.prototype.abortUpload=function(){return new Promise(function(t,e){void 0!==this.uploadId?new E(this).send().then(t,e):t()}.bind(this)).then(function(){this.setStatus(u),this.cancelled(),this.removeUploadFile()}.bind(this),this.deferredCompletion.reject.bind(this))},m.prototype.resumeInterruptedUpload=function(){return new B(this).send().then(this.uploadParts.bind(this))},m.prototype.reuseS3Object=function(t){var r=this;this.makeParts(1),this.partsToUpload=[];var n=this.s3Parts[1];function i(e){throw r.name=t,e}return n.awsRequest.getPartMd5Digest().then((function(){if(r.firstMd5Digest===n.md5_digest)return new U(r,t).send().then((function(t){e.d("headObject found matching object on S3."),r.completeUploadFile(t),r.nameChanged(r.name)})).catch(i);i(r.con.allowS3ExistenceOptimization?"File's first part MD5 digest does not match what was stored.":"allowS3ExistenceOptimization is not enabled.")}))},w.prototype.fileUpload=void 0,w.prototype.con=void 0,w.prototype.awsUrl=void 0,w.prototype.awsHost=void 0,w.prototype.authorize=function(){},w.prototype.localTimeOffset=0,w.prototype.awsDeferred=void 0,w.prototype.started=void 0,w.prototype.getPath=function(){var t="/"+this.con.bucket+"/"+this.fileUpload.name;return(this.con.cloudfront||this.awsUrl.indexOf("cloudfront")>-1)&&(t="/"+this.fileUpload.name),t},w.prototype.updateRequest=function(t){this.request=t;var r=function(t,e){var r=t.con;function n(t){this.request=t}function i(t){n.call(this,t)}function o(t){this._cr=void 0,n.call(this,t)}return n.prototype.request={},n.prototype.error=function(){},n.prototype.authorizationString=function(){},n.prototype.stringToSign=function(){},n.prototype.canonicalRequest=function(){},n.prototype.setHeaders=function(){},n.prototype.datetime=function(t){return new Date((new Date).getTime()+t)},n.prototype.dateString=function(t){return this.datetime(t).toISOString().slice(0,19).replace(/-|:/g,"")+"Z"},i.prototype=Object.create(n.prototype),i.prototype.constructor=i,i.prototype.authorizationString=function(){return["AWS ",r.aws_key,":",this.request.auth].join("")},i.prototype.stringToSign=function(){var n,i="",o=[];for(var s in this.request.x_amz_headers)this.request.x_amz_headers.hasOwnProperty(s)&&o.push(s);return o.sort(),o.forEach(function(t){i+=t+":"+this.request.x_amz_headers[t]+"\n"}.bind(this)),n=this.request.method+"\n"+(this.request.md5_digest||"")+"\n"+(this.request.contentType||"")+"\n\n"+i+(r.cloudfront?"/"+r.bucket:"")+t.getPath()+this.request.path,e.d("V2 stringToSign:",n),n},i.prototype.dateString=function(t){return this.datetime(t).toUTCString()},i.prototype.getPayload=function(){return Promise.resolve()},o.prototype=Object.create(n.prototype),o.prototype.constructor=o,o.prototype._cr=void 0,o.prototype.payload=null,o.prototype.error=function(){this._cr=void 0},o.prototype.getPayload=function(){return t.getPayload().then(function(t){this.payload=t}.bind(this))},o.prototype.authorizationString=function(){var t=[],e=this.credentialString(),n=this.canonicalHeaders();return t.push(["AWS4-HMAC-SHA256 Credential=",r.aws_key,"/",e].join("")),t.push("SignedHeaders="+n.signedHeaders),t.push("Signature="+this.request.auth),t.join(", ")},o.prototype.stringToSign=function(){var t=[];t.push("AWS4-HMAC-SHA256"),t.push(this.request.dateString),t.push(this.credentialString()),t.push(r.cryptoHexEncodedHash256(this.canonicalRequest()));var n=t.join("\n");return e.d("V4 stringToSign:",n),n},o.prototype.credentialString=function(){var t=[];return t.push(this.request.dateString.slice(0,8)),t.push(r.awsRegion),t.push("s3"),t.push("aws4_request"),t.join("/")},o.prototype.canonicalQueryString=function(){var e,r,n=t.request.query_string||"",i=P([t.awsUrl,this.request.path,n].join("")).search,o=i.length?i.split("&"):[],s=[];for(r=0;r1?encodeURIComponent(e[1]):null});var a=s.sort((function(t,e){return t.namee.name?1:0})),u=[];for(r=0;re?1:0})),u=[],h=[],p=this.request.not_signed_headers||[],f=[];for(e=0;e=200&&t.status<=299||this.request.success404&&404===t.status},w.prototype.stringToSign=function(){return encodeURIComponent(this.signer.stringToSign())},w.prototype.canonicalRequest=function(){return this.signer.canonicalRequest()},w.prototype.signResponse=function(t,e,r){var n=this;return new Promise((function(i){if("function"==typeof n.con.signResponseHandler)return n.con.signResponseHandler(t,e,r).then(i);i(t)}))},w.prototype.sendRequestToAWS=function(){var t=this;return new Promise((function(e,r){var n=new XMLHttpRequest;t.currentXhr=n;var i=[t.awsUrl,t.getPath(),t.request.path].join(""),o={};for(var s in t.request.query_string&&(i+=t.request.query_string),C(o,t.request.not_signed_headers),C(o,t.request.x_amz_headers),n.onreadystatechange=function(){if(4===n.readyState)if(t.success_status(n))t.request.response_match&&void 0===n.response.match(new RegExp(t.request.response_match))?r("AWS response does not match set pattern: "+t.request.response_match):e();else{var i=n.responseText?x(n):" ";i+="status:"+n.status,r(i)}},n.open(t.request.method,i),n.setRequestHeader("Authorization",t.signer.authorizationString()),o)o.hasOwnProperty(s)&&n.setRequestHeader(s,o[s]);t.signer.setHeaders(n),t.request.contentType&&n.setRequestHeader("Content-Type",t.request.contentType),t.request.md5_digest&&n.setRequestHeader("Content-MD5",t.request.md5_digest),n.onerror=function(t){var e=t.responseText?x(t):"transport error";r(e)},"function"==typeof t.request.onProgress&&(n.upload.onprogress=t.request.onProgress),t.getPayload().then(n.send.bind(n),r),setTimeout((function(){t.started.resolve("request sent "+t.request.step)}),20),t.signer.payload=null,t.payloadPromise=void 0}))},w.prototype.authorize=function(){return this.request.dateString=this.signer.dateString(this.localTimeOffset),this.request.x_amz_headers=C(this.request.x_amz_headers,{"x-amz-date":this.request.dateString}),this.signer.getPayload().then(function(){return function(t){var e=t.fileUpload,r=e.con,n=t.request;function i(){this.request=n}function o(){i.call(this)}return i.prototype=Object.create(i.prototype),i.prototype.request={},i.makeSignParamsObject=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&("function"==typeof t[r]?e[r]=t[r]():e[r]=t[r]);return e},i.prototype.authorize=function(){return new Promise((function(o,s){var a=new XMLHttpRequest;t.currentXhr=a;var u=t.stringToSign(),h=[r.signerUrl,"?to_sign=",u,"&datetime=",n.dateString];r.sendCanonicalRequestToSignerUrl&&(h.push("&canonical_request="),h.push(encodeURIComponent(t.canonicalRequest()))),h=h.join("");var p=i.makeSignParamsObject(e.signParams);for(var f in p)p.hasOwnProperty(f)&&(h+="&"+encodeURIComponent(f)+"="+encodeURIComponent(p[f]));r.xhrWithCredentials&&(a.withCredentials=!0),a.onreadystatechange=function(){if(4===a.readyState)if(200===a.status)t.signResponse(a.response,u,n.dateString).then(o);else{if([401,403].indexOf(a.status)>-1){var r="status:"+a.status;return e.deferredCompletion.reject("Permission denied "+r),s(r)}s("Signature fetch returned status: "+a.status)}},a.onerror=function(t){s("authorizedSend transport error: "+t.responseText)},a.open("GET",h);var c=i.makeSignParamsObject(r.signHeaders);for(var l in c)c.hasOwnProperty(l)&&a.setRequestHeader(l,c[l]);"function"==typeof e.beforeSigner&&e.beforeSigner(a,h),a.send()}))},o.prototype=Object.create(i.prototype),o.prototype.authorize=function(){return r.customAuthMethod(i.makeSignParamsObject(e.signParams),i.makeSignParamsObject(r.signHeaders),t.stringToSign(),n.dateString,t.canonicalRequest()).catch((function(t){throw e.deferredCompletion.reject(t),t}))},"function"==typeof r.customAuthMethod?new o:new i}(this).authorize()}.bind(this))},w.prototype.authorizationSuccess=function(t){e.d(this.request.step,"signature:",t),this.request.auth=t},w.prototype.trySend=function(){var t=this;return this.authorize().then((function(e){t.authorizationSuccess(e),t.fileUpload.status!==u&&t.sendRequestToAWS().then(t.success.bind(t),t.error.bind(t))}),t.error.bind(t))},w.prototype.send=function(){return this.trySend(),this.awsDeferred.promise},v.prototype=Object.create(w.prototype),v.prototype.constructor=v,v.prototype.errorExceptionStatus=function(){return[u,s].indexOf(this.fileUpload.status)>-1},_.prototype=Object.create(v.prototype),_.prototype.constructor=_,_.prototype.maxRetries=1,_.prototype.errorHandler=function(t){if(this.attempts>this.maxRetries){var r=["MaxRetries exceeded. Will re-upload file id ",this.fileUpload.id,", ",t].join("");return e.w(r),this.awsDeferred.reject(r),!0}},_.prototype.rejectedSuccess=function(){var t=Array.prototype.slice.call(arguments,1).join("");return this.awsDeferred.reject(t),!1},b.prototype=Object.create(v.prototype),b.prototype.constructor=b,b.prototype.success=function(){var t=this.currentXhr.response.match(new RegExp(this.request.response_match));this.fileUpload.uploadId=t[1],this.fileUpload.awsKey=this.awsKey,e.d("InitiateMultipartUpload ID is",this.fileUpload.uploadId),this.fileUpload.createUploadFile(),this.awsDeferred.resolve(this.currentXhr)},S.prototype=Object.create(v.prototype),S.prototype.constructor=S,S.prototype.getPayload=function(){return Promise.resolve(this.fileUpload.getCompletedPayload())},U.prototype=Object.create(_.prototype),U.prototype.constructor=U,U.prototype.awsKey=void 0,U.prototype.success=function(){(this.currentXhr.getResponseHeader("Etag")===this.fileUpload.eTag||this.rejectedSuccess("uploadId ",this.fileUpload.id," found on S3 but the Etag doesn't match."))&&this.awsDeferred.resolve(this.currentXhr)},B.prototype=Object.create(_.prototype),B.prototype.constructor=B,B.prototype.awsKey=void 0,B.prototype.partNumberMarker=0,B.prototype.setupRequest=function(t){var r=["setupRequest() for uploadId:",this.fileUpload.uploadId,"for part marker:",t].join(" ");e.d(r),this.fileUpload.info(r),this.awsKey=this.fileUpload.name,this.partNumberMarker=t;var n={method:"GET",path:["?uploadId=",this.fileUpload.uploadId].join(""),query_string:"&part-number-marker="+t,x_amz_headers:this.fileUpload.xAmzHeadersCommon,step:"get upload parts",success404:!0};return this.request=n,n},B.prototype.success=function(){if(404!==this.currentXhr.status){var t=this.fileUpload.listPartsSuccess(this,this.currentXhr.responseText);if(t){var e=this.setupRequest(t);this.updateRequest(e),this.trySend()}else this.fileUpload.makePartsfromPartsOnS3(),this.awsDeferred.resolve(this.currentXhr)}else this.rejectedSuccess("uploadId ",this.fileUpload.id," not found on S3.")&&this.awsDeferred.resolve(this.currentXhr)},I.prototype=Object.create(w.prototype),I.prototype.constructor=I,I.prototype.part=1,I.prototype.payloadPromise=void 0,I.prototype.start=0,I.prototype.end=0,I.prototype.partNumber=void 0,I.prototype.getPartMd5Digest=function(){var t=this,r=this.part;return new Promise((function(e,n){t.con.computeContentMd5&&!r.md5_digest?t.getPayload().then((function(r){var n=t.con.cryptoMd5Method(r);1===t.partNumber&&t.con.computeContentMd5&&void 0===t.fileUpload.firstMd5Digest&&(t.fileUpload.firstMd5Digest=n,t.fileUpload.updateUploadFile({firstMd5Digest:n})),e(n)}),n):e(r.md5_digest)})).then((function(r){r&&(e.d(t.request.step,"MD5 digest:",r),t.request.md5_digest=r,t.part.md5_digest=r)}))},I.prototype.sendRequestToAWS=function(){return this.stalledInterval=setInterval(this.stalledPartMonitor(),l),this.stalledPartMonitor(),w.prototype.sendRequestToAWS.call(this)},I.prototype.send=function(){if(3!==this.part.status&&-1===[u,o,s].indexOf(this.fileUpload.status)){e.d("uploadPart #",this.partNumber,1===this.attempts?"submitting":"retrying"),this.part.status=i,this.attempts+=1,this.part.loadedBytesPrevious=null;var t=this;return this.getPartMd5Digest().then((function(){e.d("Sending",t.request.step),w.prototype.send.call(t)}))}},I.prototype.success=function(){clearInterval(this.stalledInterval);var t=this.currentXhr.getResponseHeader("ETag");this.currentXhr=null,this.fileUpload.partSuccess(t,this)&&this.awsDeferred.resolve(this.currentXhr)},I.prototype.onProgress=function(t){if(t.loaded>0){var e=t.loaded-this.part.loadedBytes;e&&(this.part.loadedBytes=t.loaded,this.fileUpload.updateLoaded(e))}},I.prototype.stalledPartMonitor=function(){var t=this.part.loadedBytes,r=this;return function(){clearInterval(r.stalledInterval),-1===[i,a,p,o].indexOf(r.fileUpload.status)&&r.part.status!==u&&r.part.loadedBytes-1},I.prototype.delaySend=function(){var t=this.backOffWait();this.attempts+=1,setTimeout(this.send.bind(this),t)},I.prototype.errorHandler=function(t){if(clearInterval(this.stalledInterval),t.match(/status:404/)){var r="404 error on part PUT. The part and the file will abort. "+t;return e.w(r),this.fileUpload.error(r),this.part.status=u,this.awsDeferred.reject(r),!0}return this.resetLoadedBytes(),this.part.status=a,this.errorExceptionStatus()||this.delaySend(),!0},I.prototype.abort=function(){this.currentXhr&&this.currentXhr.abort(),this.resetLoadedBytes(),this.attempts=1},I.size=0,I.prototype.streamToArrayBuffer=function(t){return new Promise(function(e,r){if(!t.readable)return e([]);var n=new Uint8Array(Math.min(this.con.partSize,this.end-this.start)),i=0;function o(t){1!==t.byteLength&&(n.set(t,i),i+=t.byteLength)}function s(t){t?r(t):e(n),u()}function a(){e(n),u()}function u(){n=null,t.removeListener("data",o),t.removeListener("end",s),t.removeListener("error",s),t.removeListener("close",a)}t.on("data",o),t.on("end",s),t.on("error",s),t.on("close",a)}.bind(this))},I.prototype.getPayload=function(){return void 0===this.payloadPromise&&(this.payloadPromise=this.con.readableStreams?this.payloadFromStream():this.payloadFromBlob()),this.payloadPromise},I.prototype.payloadFromStream=function(){var t=this.con.readableStreamPartMethod(this.fileUpload.file,this.start,this.end-1);return new Promise(function(e,r){this.streamToArrayBuffer(t).then(function(t){e(t)}.bind(this),r)}.bind(this))},I.prototype.payloadFromBlob=function(){var t=this.fileUpload.file,e=t[t.slice?"slice":t.mozSlice?"mozSlice":"webkitSlice"](this.start,this.end);return this.con.computeContentMd5?new Promise((function(t){var r=new FileReader;r.onloadend=function(){var e=this.result&&void 0!==this.result.buffer?new Uint8Array(this.result.buffer):this.result;t(e)},r.readAsArrayBuffer(e)})):Promise.resolve(e)},I.prototype.stalledInterval=-1,I.prototype.getStartedPromise=function(){return this.started.promise},E.prototype=Object.create(w.prototype),E.prototype.constructor=E,E.prototype.maxRetries=1,E.prototype.success=function(){this.fileUpload.setStatus(u),this.awsDeferred.resolve(this.currentXhr)},E.prototype.errorHandler=function(t){if(this.attempts>this.maxRetries){var r="Error aborting upload, Exceeded retries deleting the file upload: "+t;return e.w(r),this.fileUpload.error(r),this.awsDeferred.reject(r),!0}},k.prototype.supported=!1,k.prototype.cacheStore=void 0,k.prototype.getItem=function(t){if(this.cacheStore)return this.cacheStore[t]},k.prototype.setItem=function(t,e){this.cacheStore&&(this.cacheStore[t]=e)},k.prototype.removeItem=function(t){if(this.cacheStore)return delete this.cacheStore[t]},k.supported=function(){var t=!1;if("undefined"==typeof window)return t;if(!("localStorage"in window))return t;try{var e="___test";localStorage[e]="OK";var r=localStorage[e];return delete localStorage[e],"OK"===r}catch(e){return t}},e={d:function(){},w:function(){},e:function(){}},h?h=g:"undefined"!=typeof window&&(window.Evaporate=g)}();var p={};p=function(t){"use strict";var e=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function r(t,e){var r=t[0],n=t[1],i=t[2],o=t[3];n=((n+=((i=((i+=((o=((o+=((r=((r+=(n&i|~n&o)+e[0]-680876936|0)<<7|r>>>25)+n|0)&n|~r&i)+e[1]-389564586|0)<<12|o>>>20)+r|0)&r|~o&n)+e[2]+606105819|0)<<17|i>>>15)+o|0)&o|~i&r)+e[3]-1044525330|0)<<22|n>>>10)+i|0,n=((n+=((i=((i+=((o=((o+=((r=((r+=(n&i|~n&o)+e[4]-176418897|0)<<7|r>>>25)+n|0)&n|~r&i)+e[5]+1200080426|0)<<12|o>>>20)+r|0)&r|~o&n)+e[6]-1473231341|0)<<17|i>>>15)+o|0)&o|~i&r)+e[7]-45705983|0)<<22|n>>>10)+i|0,n=((n+=((i=((i+=((o=((o+=((r=((r+=(n&i|~n&o)+e[8]+1770035416|0)<<7|r>>>25)+n|0)&n|~r&i)+e[9]-1958414417|0)<<12|o>>>20)+r|0)&r|~o&n)+e[10]-42063|0)<<17|i>>>15)+o|0)&o|~i&r)+e[11]-1990404162|0)<<22|n>>>10)+i|0,n=((n+=((i=((i+=((o=((o+=((r=((r+=(n&i|~n&o)+e[12]+1804603682|0)<<7|r>>>25)+n|0)&n|~r&i)+e[13]-40341101|0)<<12|o>>>20)+r|0)&r|~o&n)+e[14]-1502002290|0)<<17|i>>>15)+o|0)&o|~i&r)+e[15]+1236535329|0)<<22|n>>>10)+i|0,n=((n+=((i=((i+=((o=((o+=((r=((r+=(n&o|i&~o)+e[1]-165796510|0)<<5|r>>>27)+n|0)&i|n&~i)+e[6]-1069501632|0)<<9|o>>>23)+r|0)&n|r&~n)+e[11]+643717713|0)<<14|i>>>18)+o|0)&r|o&~r)+e[0]-373897302|0)<<20|n>>>12)+i|0,n=((n+=((i=((i+=((o=((o+=((r=((r+=(n&o|i&~o)+e[5]-701558691|0)<<5|r>>>27)+n|0)&i|n&~i)+e[10]+38016083|0)<<9|o>>>23)+r|0)&n|r&~n)+e[15]-660478335|0)<<14|i>>>18)+o|0)&r|o&~r)+e[4]-405537848|0)<<20|n>>>12)+i|0,n=((n+=((i=((i+=((o=((o+=((r=((r+=(n&o|i&~o)+e[9]+568446438|0)<<5|r>>>27)+n|0)&i|n&~i)+e[14]-1019803690|0)<<9|o>>>23)+r|0)&n|r&~n)+e[3]-187363961|0)<<14|i>>>18)+o|0)&r|o&~r)+e[8]+1163531501|0)<<20|n>>>12)+i|0,n=((n+=((i=((i+=((o=((o+=((r=((r+=(n&o|i&~o)+e[13]-1444681467|0)<<5|r>>>27)+n|0)&i|n&~i)+e[2]-51403784|0)<<9|o>>>23)+r|0)&n|r&~n)+e[7]+1735328473|0)<<14|i>>>18)+o|0)&r|o&~r)+e[12]-1926607734|0)<<20|n>>>12)+i|0,n=((n+=((i=((i+=((o=((o+=((r=((r+=(n^i^o)+e[5]-378558|0)<<4|r>>>28)+n|0)^n^i)+e[8]-2022574463|0)<<11|o>>>21)+r|0)^r^n)+e[11]+1839030562|0)<<16|i>>>16)+o|0)^o^r)+e[14]-35309556|0)<<23|n>>>9)+i|0,n=((n+=((i=((i+=((o=((o+=((r=((r+=(n^i^o)+e[1]-1530992060|0)<<4|r>>>28)+n|0)^n^i)+e[4]+1272893353|0)<<11|o>>>21)+r|0)^r^n)+e[7]-155497632|0)<<16|i>>>16)+o|0)^o^r)+e[10]-1094730640|0)<<23|n>>>9)+i|0,n=((n+=((i=((i+=((o=((o+=((r=((r+=(n^i^o)+e[13]+681279174|0)<<4|r>>>28)+n|0)^n^i)+e[0]-358537222|0)<<11|o>>>21)+r|0)^r^n)+e[3]-722521979|0)<<16|i>>>16)+o|0)^o^r)+e[6]+76029189|0)<<23|n>>>9)+i|0,n=((n+=((i=((i+=((o=((o+=((r=((r+=(n^i^o)+e[9]-640364487|0)<<4|r>>>28)+n|0)^n^i)+e[12]-421815835|0)<<11|o>>>21)+r|0)^r^n)+e[15]+530742520|0)<<16|i>>>16)+o|0)^o^r)+e[2]-995338651|0)<<23|n>>>9)+i|0,n=((n+=((o=((o+=(n^((r=((r+=(i^(n|~o))+e[0]-198630844|0)<<6|r>>>26)+n|0)|~i))+e[7]+1126891415|0)<<10|o>>>22)+r|0)^((i=((i+=(r^(o|~n))+e[14]-1416354905|0)<<15|i>>>17)+o|0)|~r))+e[5]-57434055|0)<<21|n>>>11)+i|0,n=((n+=((o=((o+=(n^((r=((r+=(i^(n|~o))+e[12]+1700485571|0)<<6|r>>>26)+n|0)|~i))+e[3]-1894986606|0)<<10|o>>>22)+r|0)^((i=((i+=(r^(o|~n))+e[10]-1051523|0)<<15|i>>>17)+o|0)|~r))+e[1]-2054922799|0)<<21|n>>>11)+i|0,n=((n+=((o=((o+=(n^((r=((r+=(i^(n|~o))+e[8]+1873313359|0)<<6|r>>>26)+n|0)|~i))+e[15]-30611744|0)<<10|o>>>22)+r|0)^((i=((i+=(r^(o|~n))+e[6]-1560198380|0)<<15|i>>>17)+o|0)|~r))+e[13]+1309151649|0)<<21|n>>>11)+i|0,n=((n+=((o=((o+=(n^((r=((r+=(i^(n|~o))+e[4]-145523070|0)<<6|r>>>26)+n|0)|~i))+e[11]-1120210379|0)<<10|o>>>22)+r|0)^((i=((i+=(r^(o|~n))+e[2]+718787259|0)<<15|i>>>17)+o|0)|~r))+e[9]-343485551|0)<<21|n>>>11)+i|0,t[0]=r+t[0]|0,t[1]=n+t[1]|0,t[2]=i+t[2]|0,t[3]=o+t[3]|0}function n(t){var e,r=[];for(e=0;e<64;e+=4)r[e>>2]=t.charCodeAt(e)+(t.charCodeAt(e+1)<<8)+(t.charCodeAt(e+2)<<16)+(t.charCodeAt(e+3)<<24);return r}function i(t){var e,r=[];for(e=0;e<64;e+=4)r[e>>2]=t[e]+(t[e+1]<<8)+(t[e+2]<<16)+(t[e+3]<<24);return r}function o(t){var e,i,o,s,a,u,h=t.length,p=[1732584193,-271733879,-1732584194,271733878];for(e=64;e<=h;e+=64)r(p,n(t.substring(e-64,e)));for(i=(t=t.substring(e-64)).length,o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],e=0;e>2]|=t.charCodeAt(e)<<(e%4<<3);if(o[e>>2]|=128<<(e%4<<3),e>55)for(r(p,o),e=0;e<16;e+=1)o[e]=0;return s=(s=8*h).toString(16).match(/(.*?)(.{0,8})$/),a=parseInt(s[2],16),u=parseInt(s[1],16)||0,o[14]=a,o[15]=u,r(p,o),p}function s(t){var e,n,o,s,a,u,h=t.length,p=[1732584193,-271733879,-1732584194,271733878];for(e=64;e<=h;e+=64)r(p,i(t.subarray(e-64,e)));for(n=(t=e-64>2]|=t[e]<<(e%4<<3);if(o[e>>2]|=128<<(e%4<<3),e>55)for(r(p,o),e=0;e<16;e+=1)o[e]=0;return s=(s=8*h).toString(16).match(/(.*?)(.{0,8})$/),a=parseInt(s[2],16),u=parseInt(s[1],16)||0,o[14]=a,o[15]=u,r(p,o),p}function a(t){var r,n="";for(r=0;r<4;r+=1)n+=e[t>>8*r+4&15]+e[t>>8*r&15];return n}function u(t){var e;for(e=0;ep?new ArrayBuffer(0):(i=p-h,o=new ArrayBuffer(i),s=new Uint8Array(o),a=new Uint8Array(this,h,i),s.set(a),o)}}(),d.prototype.append=function(t){return this.appendBinary(h(t)),this},d.prototype.appendBinary=function(t){this._buff+=t,this._length+=t.length;var e,i=this._buff.length;for(e=64;e<=i;e+=64)r(this._hash,n(this._buff.substring(e-64,e)));return this._buff=this._buff.substring(e-64),this},d.prototype.end=function(t){var e,r,n=this._buff,i=n.length,o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(e=0;e>2]|=n.charCodeAt(e)<<(e%4<<3);return this._finish(o,i),r=u(this._hash),t&&(r=l(r)),this.reset(),r},d.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},d.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},d.prototype.setState=function(t){return this._buff=t.buff,this._length=t.length,this._hash=t.hash,this},d.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},d.prototype._finish=function(t,e){var n,i,o,s=e;if(t[s>>2]|=128<<(s%4<<3),s>55)for(r(this._hash,t),s=0;s<16;s+=1)t[s]=0;n=(n=8*this._length).toString(16).match(/(.*?)(.{0,8})$/),i=parseInt(n[2],16),o=parseInt(n[1],16)||0,t[14]=i,t[15]=o,r(this._hash,t)},d.hash=function(t,e){return d.hashBinary(h(t),e)},d.hashBinary=function(t,e){var r=u(o(t));return e?l(r):r},d.ArrayBuffer=function(){this.reset()},d.ArrayBuffer.prototype.append=function(t){var e,n=c(this._buff.buffer,t,!0),o=n.length;for(this._length+=t.byteLength,e=64;e<=o;e+=64)r(this._hash,i(n.subarray(e-64,e)));return this._buff=e-64>2]|=n[e]<<(e%4<<3);return this._finish(o,i),r=u(this._hash),t&&(r=l(r)),this.reset(),r},d.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},d.ArrayBuffer.prototype.getState=function(){var t=d.prototype.getState.call(this);return t.buff=f(t.buff),t},d.ArrayBuffer.prototype.setState=function(t){return t.buff=p(t.buff,!0),d.prototype.setState.call(this,t)},d.ArrayBuffer.prototype.destroy=d.prototype.destroy,d.ArrayBuffer.prototype._finish=d.prototype._finish,d.ArrayBuffer.hash=function(t,e){var r=u(s(new Uint8Array(t)));return e?l(r):r},d}();const f=(t,e,r,n,i,o)=>{let s=new XMLHttpRequest;s.open(t,e,!0),Object.keys(n).forEach((t=>{s.setRequestHeader(t,n[t])})),s.onload=()=>{o(s.status,s.responseText)},s.onerror=s.onabort=()=>{y(!1),l(i,"Sorry, failed to upload file.")},s.send(r)},c=t=>{let e;try{e=JSON.parse(t)}catch(t){e=null}return e},l=(t,e)=>{t.className="s3direct form-active",t.querySelector(".file-input").value="",alert(e)};let d=0;const y=t=>{const e=document.querySelector(".submit-row");if(!e)return;const r=e.querySelectorAll("input[type=submit],button[type=submit]");!0===t?d++:d--,[].forEach.call(r,(t=>{t.disabled=0!==d}))},g=(t,e,r,n)=>{const i=t.querySelector(".file-link"),o=t.querySelector(".file-url");o.value=e+"/"+r+"/"+n,i.setAttribute("href",o.value),i.innerHTML=(t=>decodeURIComponent((t+"").replace(/\+/g,"%20")))(o.value).split("/").pop(),t.className="s3direct link-active",t.querySelector(".bar").style.width="0%",y(!1)},m=t=>btoa(e(p).ArrayBuffer.hash(t,!0)),w=t=>e(a)("sha256").update(t,"utf-8").digest("hex"),v=t=>{const r=t.querySelector(".csrf-cookie-name"),n=document.querySelector("input[name=csrfmiddlewaretoken]");return n?n.value:e(s).get(r.value)},_=(t,e,r)=>{const n={};return t&&(n["x-amz-acl"]=t),r&&(n["x-amz-security-token"]=r),e&&(n["x-amz-server-side-encryption"]=e),n},b=t=>{const e={};return t&&(e["x-amz-security-token"]=t),e},S=(t,e,r)=>(n,i,o,s,a)=>new Promise(((n,i)=>{const a=new FormData,u={"X-CSRFToken":v(t)};a.append("to_sign",o),a.append("datetime",s),a.append("dest",r),f("POST",e,a,u,t,((t,e)=>{const r=c(e);if(200===t)n(r.s3ObjKey);else i(r.error)}))})),U=(t,r,n,i,o)=>{const s={customAuthMethod:S(t,r,o),aws_key:n.access_key_id,bucket:n.bucket,aws_url:n.endpoint,awsRegion:n.region,computeContentMd5:!0,cryptoMd5Method:m,cryptoHexEncodedHash256:w,partSize:20971520,logging:!0,allowS3ExistenceOptimization:n.allow_existence_optimization,s3FileCacheHoursAgo:n.allow_existence_optimization?12:0},a={name:n.object_key,file:i,contentType:i.type,xAmzHeadersCommon:b(n.session_token),xAmzHeadersAtInitiate:_(n.acl,n.server_side_encryption,n.session_token),progress:(e,r)=>{((t,e)=>{t.querySelector(".bar").style.width=Math.round(100*e)+"%"})(t,e)},warn:(e,r,n)=>{n.includes("InvalidAccessKeyId")&&l(t,n)}},u={};n.cache_control&&(u["Cache-Control"]=n.cache_control),n.content_disposition&&(u["Content-Disposition"]=n.content_disposition),a.notSignedHeadersAtInitiate=u,e(h).create(s).then((e=>{y(!0),t.className="s3direct progress-active";const r=t.querySelector(".cancel-button"),i=t=>{t.preventDefault(),e.cancel(`${n.bucket}/${a.name}`)};r.addEventListener("click",i,!1),e.add(a).then((e=>{r.removeEventListener("click",i),g(t,n.endpoint,n.bucket,e)}),(e=>(r.removeEventListener("click",i),l(t,e))))}))},B=t=>{const e=t.target.parentElement,r=e.querySelector(".file-input").files[0],n=e.querySelector(".file-dest").value,i=e.getAttribute("data-policy-url"),o=e.getAttribute("data-signing-url"),s=new FormData,a={"X-CSRFToken":v(e)};s.append("dest",n),s.append("name",r.name),s.append("type",r.type),s.append("size",r.size),f("POST",i,s,a,e,((t,i)=>{const s=c(i);switch(t){case 200:U(e,o,s,r,n);break;case 400:case 403:case 500:l(e,s.error);break;default:l(e,"Sorry, could not get upload URL.")}}))},I=t=>{t.preventDefault();const e=t.target.parentElement;e.querySelector(".file-url").value="",e.querySelector(".file-input").value="",e.className="s3direct form-active"},E=t=>{const e=t.querySelector(".file-url");if(e.name.includes("__prefix__"))return!1;const r=t.querySelector(".file-input"),n=t.querySelector(".file-remove"),i=""===e.value?"form":"link";t.className="s3direct "+i+"-active",n.addEventListener("click",I,!1),r.addEventListener("change",B,!1)},P=()=>{document.querySelectorAll(".s3direct:not(.form-active, .link-active)").forEach(E)};document.addEventListener("DOMContentLoaded",(t=>{P();new MutationObserver((()=>P())).observe(document.body,{childList:!0,subtree:!0})}))}(); \ No newline at end of file diff --git a/s3direct/static/s3direct/dist/index.js.map b/s3direct/static/s3direct/dist/index.js.map deleted file mode 100644 index c20e9b68..00000000 --- a/s3direct/static/s3direct/dist/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../node_modules/js-cookie/src/js.cookie.js","../node_modules/inherits/inherits_browser.js","../node_modules/base64-js/index.js","../node_modules/ieee754/index.js","../node_modules/isarray/index.js","../node_modules/buffer/index.js","../node_modules/safe-buffer/index.js","../node_modules/sha.js/hash.js","../node_modules/sha.js/sha.js","../node_modules/sha.js/sha1.js","../node_modules/sha.js/sha256.js","../node_modules/sha.js/sha224.js","../node_modules/sha.js/sha512.js","../node_modules/sha.js/sha384.js","../node_modules/sha.js/index.js","../node_modules/evaporate/evaporate.js","../node_modules/spark-md5/spark-md5.js","index.js","../node_modules/parcel-bundler/src/builtins/bundle-url.js","../node_modules/parcel-bundler/src/builtins/css-loader.js","../node_modules/parcel-bundler/src/builtins/hmr-runtime.js"],"names":["request","method","url","data","headers","el","cb","req","XMLHttpRequest","open","Object","keys","forEach","key","setRequestHeader","onload","status","responseText","onerror","onabort","disableSubmit","error","send","parseNameFromUrl","decodeURIComponent","replace","parseJson","json","JSON","parse","e","updateProgressBar","element","progressRatio","bar","querySelector","style","width","Math","round","msg","className","value","alert","concurrentUploads","submitRow","document","buttons","querySelectorAll","call","disabled","finishUpload","endpoint","bucket","objectKey","link","setAttribute","innerHTML","split","pop","computeMd5","btoa","SparkMD5","ArrayBuffer","hash","computeSha256","update","digest","getCsrfToken","cookieInput","input","token","Cookies","get","generateAmzInitHeaders","acl","serverSideEncryption","sessionToken","generateAmzCommonHeaders","generateCustomAuthMethod","signingUrl","dest","getAwsV4Signature","_signParams","_signHeaders","stringToSign","signatureDateTime","_canonicalRequest","Promise","resolve","reject","form","FormData","append","resp","response","s3ObjKey","initiateUpload","uploadParameters","file","createConfig","customAuthMethod","aws_key","access_key_id","aws_url","awsRegion","region","computeContentMd5","cryptoMd5Method","cryptoHexEncodedHash256","partSize","logging","allowS3ExistenceOptimization","allow_existence_optimization","s3FileCacheHoursAgo","addConfig","name","object_key","contentType","type","xAmzHeadersCommon","session_token","xAmzHeadersAtInitiate","server_side_encryption","progress","stats","warn","warnType","area","includes","optHeaders","cache_control","content_disposition","Evaporate","create","then","evaporate","cancelButton","cancelUpload","preventDefault","cancel","addEventListener","add","s3Objkey","removeEventListener","reason","checkFileAndInitiateUpload","event","target","parentElement","files","destCheckUrl","getAttribute","signerUrl","size","removeUpload","addHandlers","remove","tagName","index","array","bundleURL","getBundleURLCached","getBundleURL","Error","err","matches","stack","match","getBaseURL","exports","bundle","require","updateLink","newLink","cloneNode","href","Date","now","parentNode","insertBefore","nextSibling","cssTimeout","reloadCSS","setTimeout","links","i","length","module","OVERLAY_ID","OldModule","Module","moduleName","hot","hotData","_acceptCallbacks","_disposeCallbacks","accept","fn","push","dispose","checkedAssets","assetsToAccept","parent","isParcelRequire","WebSocket","hostname","location","protocol","ws","onmessage","handled","assets","asset","isNew","didAccept","hmrAcceptCheck","global","parcelRequire","id","every","generated","js","console","clear","hmrApply","v","hmrAcceptRun","window","reload","close","onclose","log","removeErrorOverlay","message","overlay","createErrorOverlay","body","appendChild","getElementById","createElement","stackTrace","innerText","getParents","modules","parents","k","d","dep","Array","isArray","concat","Function","deps","cached","cache","some"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpFA;AACA;AACA;AACA;AACA;AACA;;;;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AC7vDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AC9DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;ACjFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AC9FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;ACnGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;ACvIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;ACrDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;ACpQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;ACtmEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A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","file":"index.js","sourceRoot":"../../../../src","sourcesContent":["/*!\n * JavaScript Cookie v2.2.0\n * https://github.com/js-cookie/js-cookie\n *\n * Copyright 2006, 2015 Klaus Hartl & Fagner Brack\n * Released under the MIT license\n */\n;(function (factory) {\n\tvar registeredInModuleLoader = false;\n\tif (typeof define === 'function' && define.amd) {\n\t\tdefine(factory);\n\t\tregisteredInModuleLoader = true;\n\t}\n\tif (typeof exports === 'object') {\n\t\tmodule.exports = factory();\n\t\tregisteredInModuleLoader = true;\n\t}\n\tif (!registeredInModuleLoader) {\n\t\tvar OldCookies = window.Cookies;\n\t\tvar api = window.Cookies = factory();\n\t\tapi.noConflict = function () {\n\t\t\twindow.Cookies = OldCookies;\n\t\t\treturn api;\n\t\t};\n\t}\n}(function () {\n\tfunction extend () {\n\t\tvar i = 0;\n\t\tvar result = {};\n\t\tfor (; i < arguments.length; i++) {\n\t\t\tvar attributes = arguments[ i ];\n\t\t\tfor (var key in attributes) {\n\t\t\t\tresult[key] = attributes[key];\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}\n\n\tfunction init (converter) {\n\t\tfunction api (key, value, attributes) {\n\t\t\tvar result;\n\t\t\tif (typeof document === 'undefined') {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Write\n\n\t\t\tif (arguments.length > 1) {\n\t\t\t\tattributes = extend({\n\t\t\t\t\tpath: '/'\n\t\t\t\t}, api.defaults, attributes);\n\n\t\t\t\tif (typeof attributes.expires === 'number') {\n\t\t\t\t\tvar expires = new Date();\n\t\t\t\t\texpires.setMilliseconds(expires.getMilliseconds() + attributes.expires * 864e+5);\n\t\t\t\t\tattributes.expires = expires;\n\t\t\t\t}\n\n\t\t\t\t// We're using \"expires\" because \"max-age\" is not supported by IE\n\t\t\t\tattributes.expires = attributes.expires ? attributes.expires.toUTCString() : '';\n\n\t\t\t\ttry {\n\t\t\t\t\tresult = JSON.stringify(value);\n\t\t\t\t\tif (/^[\\{\\[]/.test(result)) {\n\t\t\t\t\t\tvalue = result;\n\t\t\t\t\t}\n\t\t\t\t} catch (e) {}\n\n\t\t\t\tif (!converter.write) {\n\t\t\t\t\tvalue = encodeURIComponent(String(value))\n\t\t\t\t\t\t.replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent);\n\t\t\t\t} else {\n\t\t\t\t\tvalue = converter.write(value, key);\n\t\t\t\t}\n\n\t\t\t\tkey = encodeURIComponent(String(key));\n\t\t\t\tkey = key.replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent);\n\t\t\t\tkey = key.replace(/[\\(\\)]/g, escape);\n\n\t\t\t\tvar stringifiedAttributes = '';\n\n\t\t\t\tfor (var attributeName in attributes) {\n\t\t\t\t\tif (!attributes[attributeName]) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tstringifiedAttributes += '; ' + attributeName;\n\t\t\t\t\tif (attributes[attributeName] === true) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tstringifiedAttributes += '=' + attributes[attributeName];\n\t\t\t\t}\n\t\t\t\treturn (document.cookie = key + '=' + value + stringifiedAttributes);\n\t\t\t}\n\n\t\t\t// Read\n\n\t\t\tif (!key) {\n\t\t\t\tresult = {};\n\t\t\t}\n\n\t\t\t// To prevent the for loop in the first place assign an empty array\n\t\t\t// in case there are no cookies at all. Also prevents odd result when\n\t\t\t// calling \"get()\"\n\t\t\tvar cookies = document.cookie ? document.cookie.split('; ') : [];\n\t\t\tvar rdecode = /(%[0-9A-Z]{2})+/g;\n\t\t\tvar i = 0;\n\n\t\t\tfor (; i < cookies.length; i++) {\n\t\t\t\tvar parts = cookies[i].split('=');\n\t\t\t\tvar cookie = parts.slice(1).join('=');\n\n\t\t\t\tif (!this.json && cookie.charAt(0) === '\"') {\n\t\t\t\t\tcookie = cookie.slice(1, -1);\n\t\t\t\t}\n\n\t\t\t\ttry {\n\t\t\t\t\tvar name = parts[0].replace(rdecode, decodeURIComponent);\n\t\t\t\t\tcookie = converter.read ?\n\t\t\t\t\t\tconverter.read(cookie, name) : converter(cookie, name) ||\n\t\t\t\t\t\tcookie.replace(rdecode, decodeURIComponent);\n\n\t\t\t\t\tif (this.json) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tcookie = JSON.parse(cookie);\n\t\t\t\t\t\t} catch (e) {}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (key === name) {\n\t\t\t\t\t\tresult = cookie;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!key) {\n\t\t\t\t\t\tresult[name] = cookie;\n\t\t\t\t\t}\n\t\t\t\t} catch (e) {}\n\t\t\t}\n\n\t\t\treturn result;\n\t\t}\n\n\t\tapi.set = api;\n\t\tapi.get = function (key) {\n\t\t\treturn api.call(api, key);\n\t\t};\n\t\tapi.getJSON = function () {\n\t\t\treturn api.apply({\n\t\t\t\tjson: true\n\t\t\t}, [].slice.call(arguments));\n\t\t};\n\t\tapi.defaults = {};\n\n\t\tapi.remove = function (key, attributes) {\n\t\t\tapi(key, '', extend(attributes, {\n\t\t\t\texpires: -1\n\t\t\t}));\n\t\t};\n\n\t\tapi.withConverter = init;\n\n\t\treturn api;\n\t}\n\n\treturn init(function () {});\n}));\n","if (typeof Object.create === 'function') {\n // implementation from standard node.js 'util' module\n module.exports = function inherits(ctor, superCtor) {\n ctor.super_ = superCtor\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n };\n} else {\n // old school shim for old browsers\n module.exports = function inherits(ctor, superCtor) {\n ctor.super_ = superCtor\n var TempCtor = function () {}\n TempCtor.prototype = superCtor.prototype\n ctor.prototype = new TempCtor()\n ctor.prototype.constructor = ctor\n }\n}\n","'use strict'\n\nexports.byteLength = byteLength\nexports.toByteArray = toByteArray\nexports.fromByteArray = fromByteArray\n\nvar lookup = []\nvar revLookup = []\nvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array\n\nvar code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\nfor (var i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i]\n revLookup[code.charCodeAt(i)] = i\n}\n\n// Support decoding URL-safe base64 strings, as Node.js does.\n// See: https://en.wikipedia.org/wiki/Base64#URL_applications\nrevLookup['-'.charCodeAt(0)] = 62\nrevLookup['_'.charCodeAt(0)] = 63\n\nfunction getLens (b64) {\n var len = b64.length\n\n if (len % 4 > 0) {\n throw new Error('Invalid string. Length must be a multiple of 4')\n }\n\n // Trim off extra bytes after placeholder bytes are found\n // See: https://github.com/beatgammit/base64-js/issues/42\n var validLen = b64.indexOf('=')\n if (validLen === -1) validLen = len\n\n var placeHoldersLen = validLen === len\n ? 0\n : 4 - (validLen % 4)\n\n return [validLen, placeHoldersLen]\n}\n\n// base64 is 4/3 + up to two characters of the original data\nfunction byteLength (b64) {\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction _byteLength (b64, validLen, placeHoldersLen) {\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction toByteArray (b64) {\n var tmp\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n\n var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))\n\n var curByte = 0\n\n // if there are placeholders, only get up to the last complete 4 chars\n var len = placeHoldersLen > 0\n ? validLen - 4\n : validLen\n\n for (var i = 0; i < len; i += 4) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 18) |\n (revLookup[b64.charCodeAt(i + 1)] << 12) |\n (revLookup[b64.charCodeAt(i + 2)] << 6) |\n revLookup[b64.charCodeAt(i + 3)]\n arr[curByte++] = (tmp >> 16) & 0xFF\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 2) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 2) |\n (revLookup[b64.charCodeAt(i + 1)] >> 4)\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 1) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 10) |\n (revLookup[b64.charCodeAt(i + 1)] << 4) |\n (revLookup[b64.charCodeAt(i + 2)] >> 2)\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n return arr\n}\n\nfunction tripletToBase64 (num) {\n return lookup[num >> 18 & 0x3F] +\n lookup[num >> 12 & 0x3F] +\n lookup[num >> 6 & 0x3F] +\n lookup[num & 0x3F]\n}\n\nfunction encodeChunk (uint8, start, end) {\n var tmp\n var output = []\n for (var i = start; i < end; i += 3) {\n tmp =\n ((uint8[i] << 16) & 0xFF0000) +\n ((uint8[i + 1] << 8) & 0xFF00) +\n (uint8[i + 2] & 0xFF)\n output.push(tripletToBase64(tmp))\n }\n return output.join('')\n}\n\nfunction fromByteArray (uint8) {\n var tmp\n var len = uint8.length\n var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n var parts = []\n var maxChunkLength = 16383 // must be multiple of 3\n\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(\n uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)\n ))\n }\n\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = uint8[len - 1]\n parts.push(\n lookup[tmp >> 2] +\n lookup[(tmp << 4) & 0x3F] +\n '=='\n )\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + uint8[len - 1]\n parts.push(\n lookup[tmp >> 10] +\n lookup[(tmp >> 4) & 0x3F] +\n lookup[(tmp << 2) & 0x3F] +\n '='\n )\n }\n\n return parts.join('')\n}\n","exports.read = function (buffer, offset, isLE, mLen, nBytes) {\n var e, m\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var nBits = -7\n var i = isLE ? (nBytes - 1) : 0\n var d = isLE ? -1 : 1\n var s = buffer[offset + i]\n\n i += d\n\n e = s & ((1 << (-nBits)) - 1)\n s >>= (-nBits)\n nBits += eLen\n for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n m = e & ((1 << (-nBits)) - 1)\n e >>= (-nBits)\n nBits += mLen\n for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n if (e === 0) {\n e = 1 - eBias\n } else if (e === eMax) {\n return m ? NaN : ((s ? -1 : 1) * Infinity)\n } else {\n m = m + Math.pow(2, mLen)\n e = e - eBias\n }\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen)\n}\n\nexports.write = function (buffer, value, offset, isLE, mLen, nBytes) {\n var e, m, c\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)\n var i = isLE ? 0 : (nBytes - 1)\n var d = isLE ? 1 : -1\n var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0\n\n value = Math.abs(value)\n\n if (isNaN(value) || value === Infinity) {\n m = isNaN(value) ? 1 : 0\n e = eMax\n } else {\n e = Math.floor(Math.log(value) / Math.LN2)\n if (value * (c = Math.pow(2, -e)) < 1) {\n e--\n c *= 2\n }\n if (e + eBias >= 1) {\n value += rt / c\n } else {\n value += rt * Math.pow(2, 1 - eBias)\n }\n if (value * c >= 2) {\n e++\n c /= 2\n }\n\n if (e + eBias >= eMax) {\n m = 0\n e = eMax\n } else if (e + eBias >= 1) {\n m = ((value * c) - 1) * Math.pow(2, mLen)\n e = e + eBias\n } else {\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)\n e = 0\n }\n }\n\n for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}\n\n e = (e << mLen) | m\n eLen += mLen\n for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}\n\n buffer[offset + i - d] |= s * 128\n}\n","var toString = {}.toString;\n\nmodule.exports = Array.isArray || function (arr) {\n return toString.call(arr) == '[object Array]';\n};\n","/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n/* eslint-disable no-proto */\n\n'use strict'\n\nvar base64 = require('base64-js')\nvar ieee754 = require('ieee754')\nvar isArray = require('isarray')\n\nexports.Buffer = Buffer\nexports.SlowBuffer = SlowBuffer\nexports.INSPECT_MAX_BYTES = 50\n\n/**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n * === true Use Uint8Array implementation (fastest)\n * === false Use Object implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * Due to various browser bugs, sometimes the Object implementation will be used even\n * when the browser supports typed arrays.\n *\n * Note:\n *\n * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,\n * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.\n *\n * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.\n *\n * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of\n * incorrect length in some situations.\n\n * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they\n * get the Object implementation, which is slower but behaves correctly.\n */\nBuffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined\n ? global.TYPED_ARRAY_SUPPORT\n : typedArraySupport()\n\n/*\n * Export kMaxLength after typed array support is determined.\n */\nexports.kMaxLength = kMaxLength()\n\nfunction typedArraySupport () {\n try {\n var arr = new Uint8Array(1)\n arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}\n return arr.foo() === 42 && // typed array instances can be augmented\n typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`\n arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`\n } catch (e) {\n return false\n }\n}\n\nfunction kMaxLength () {\n return Buffer.TYPED_ARRAY_SUPPORT\n ? 0x7fffffff\n : 0x3fffffff\n}\n\nfunction createBuffer (that, length) {\n if (kMaxLength() < length) {\n throw new RangeError('Invalid typed array length')\n }\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = new Uint8Array(length)\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n if (that === null) {\n that = new Buffer(length)\n }\n that.length = length\n }\n\n return that\n}\n\n/**\n * The Buffer constructor returns instances of `Uint8Array` that have their\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n * returns a single octet.\n *\n * The `Uint8Array` prototype remains unmodified.\n */\n\nfunction Buffer (arg, encodingOrOffset, length) {\n if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n return new Buffer(arg, encodingOrOffset, length)\n }\n\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new Error(\n 'If encoding is specified then the first argument must be a string'\n )\n }\n return allocUnsafe(this, arg)\n }\n return from(this, arg, encodingOrOffset, length)\n}\n\nBuffer.poolSize = 8192 // not used by this implementation\n\n// TODO: Legacy, not needed anymore. Remove in next major version.\nBuffer._augment = function (arr) {\n arr.__proto__ = Buffer.prototype\n return arr\n}\n\nfunction from (that, value, encodingOrOffset, length) {\n if (typeof value === 'number') {\n throw new TypeError('\"value\" argument must not be a number')\n }\n\n if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {\n return fromArrayBuffer(that, value, encodingOrOffset, length)\n }\n\n if (typeof value === 'string') {\n return fromString(that, value, encodingOrOffset)\n }\n\n return fromObject(that, value)\n}\n\n/**\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n * if value is a number.\n * Buffer.from(str[, encoding])\n * Buffer.from(array)\n * Buffer.from(buffer)\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\n **/\nBuffer.from = function (value, encodingOrOffset, length) {\n return from(null, value, encodingOrOffset, length)\n}\n\nif (Buffer.TYPED_ARRAY_SUPPORT) {\n Buffer.prototype.__proto__ = Uint8Array.prototype\n Buffer.__proto__ = Uint8Array\n if (typeof Symbol !== 'undefined' && Symbol.species &&\n Buffer[Symbol.species] === Buffer) {\n // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97\n Object.defineProperty(Buffer, Symbol.species, {\n value: null,\n configurable: true\n })\n }\n}\n\nfunction assertSize (size) {\n if (typeof size !== 'number') {\n throw new TypeError('\"size\" argument must be a number')\n } else if (size < 0) {\n throw new RangeError('\"size\" argument must not be negative')\n }\n}\n\nfunction alloc (that, size, fill, encoding) {\n assertSize(size)\n if (size <= 0) {\n return createBuffer(that, size)\n }\n if (fill !== undefined) {\n // Only pay attention to encoding if it's a string. This\n // prevents accidentally sending in a number that would\n // be interpretted as a start offset.\n return typeof encoding === 'string'\n ? createBuffer(that, size).fill(fill, encoding)\n : createBuffer(that, size).fill(fill)\n }\n return createBuffer(that, size)\n}\n\n/**\n * Creates a new filled Buffer instance.\n * alloc(size[, fill[, encoding]])\n **/\nBuffer.alloc = function (size, fill, encoding) {\n return alloc(null, size, fill, encoding)\n}\n\nfunction allocUnsafe (that, size) {\n assertSize(size)\n that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n for (var i = 0; i < size; ++i) {\n that[i] = 0\n }\n }\n return that\n}\n\n/**\n * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\n * */\nBuffer.allocUnsafe = function (size) {\n return allocUnsafe(null, size)\n}\n/**\n * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\n */\nBuffer.allocUnsafeSlow = function (size) {\n return allocUnsafe(null, size)\n}\n\nfunction fromString (that, string, encoding) {\n if (typeof encoding !== 'string' || encoding === '') {\n encoding = 'utf8'\n }\n\n if (!Buffer.isEncoding(encoding)) {\n throw new TypeError('\"encoding\" must be a valid string encoding')\n }\n\n var length = byteLength(string, encoding) | 0\n that = createBuffer(that, length)\n\n var actual = that.write(string, encoding)\n\n if (actual !== length) {\n // Writing a hex string, for example, that contains invalid characters will\n // cause everything after the first invalid character to be ignored. (e.g.\n // 'abxxcd' will be treated as 'ab')\n that = that.slice(0, actual)\n }\n\n return that\n}\n\nfunction fromArrayLike (that, array) {\n var length = array.length < 0 ? 0 : checked(array.length) | 0\n that = createBuffer(that, length)\n for (var i = 0; i < length; i += 1) {\n that[i] = array[i] & 255\n }\n return that\n}\n\nfunction fromArrayBuffer (that, array, byteOffset, length) {\n array.byteLength // this throws if `array` is not a valid ArrayBuffer\n\n if (byteOffset < 0 || array.byteLength < byteOffset) {\n throw new RangeError('\\'offset\\' is out of bounds')\n }\n\n if (array.byteLength < byteOffset + (length || 0)) {\n throw new RangeError('\\'length\\' is out of bounds')\n }\n\n if (byteOffset === undefined && length === undefined) {\n array = new Uint8Array(array)\n } else if (length === undefined) {\n array = new Uint8Array(array, byteOffset)\n } else {\n array = new Uint8Array(array, byteOffset, length)\n }\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = array\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n that = fromArrayLike(that, array)\n }\n return that\n}\n\nfunction fromObject (that, obj) {\n if (Buffer.isBuffer(obj)) {\n var len = checked(obj.length) | 0\n that = createBuffer(that, len)\n\n if (that.length === 0) {\n return that\n }\n\n obj.copy(that, 0, 0, len)\n return that\n }\n\n if (obj) {\n if ((typeof ArrayBuffer !== 'undefined' &&\n obj.buffer instanceof ArrayBuffer) || 'length' in obj) {\n if (typeof obj.length !== 'number' || isnan(obj.length)) {\n return createBuffer(that, 0)\n }\n return fromArrayLike(that, obj)\n }\n\n if (obj.type === 'Buffer' && isArray(obj.data)) {\n return fromArrayLike(that, obj.data)\n }\n }\n\n throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')\n}\n\nfunction checked (length) {\n // Note: cannot use `length < kMaxLength()` here because that fails when\n // length is NaN (which is otherwise coerced to zero.)\n if (length >= kMaxLength()) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum ' +\n 'size: 0x' + kMaxLength().toString(16) + ' bytes')\n }\n return length | 0\n}\n\nfunction SlowBuffer (length) {\n if (+length != length) { // eslint-disable-line eqeqeq\n length = 0\n }\n return Buffer.alloc(+length)\n}\n\nBuffer.isBuffer = function isBuffer (b) {\n return !!(b != null && b._isBuffer)\n}\n\nBuffer.compare = function compare (a, b) {\n if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n throw new TypeError('Arguments must be Buffers')\n }\n\n if (a === b) return 0\n\n var x = a.length\n var y = b.length\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i]\n y = b[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\nBuffer.isEncoding = function isEncoding (encoding) {\n switch (String(encoding).toLowerCase()) {\n case 'hex':\n case 'utf8':\n case 'utf-8':\n case 'ascii':\n case 'latin1':\n case 'binary':\n case 'base64':\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return true\n default:\n return false\n }\n}\n\nBuffer.concat = function concat (list, length) {\n if (!isArray(list)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n\n if (list.length === 0) {\n return Buffer.alloc(0)\n }\n\n var i\n if (length === undefined) {\n length = 0\n for (i = 0; i < list.length; ++i) {\n length += list[i].length\n }\n }\n\n var buffer = Buffer.allocUnsafe(length)\n var pos = 0\n for (i = 0; i < list.length; ++i) {\n var buf = list[i]\n if (!Buffer.isBuffer(buf)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n buf.copy(buffer, pos)\n pos += buf.length\n }\n return buffer\n}\n\nfunction byteLength (string, encoding) {\n if (Buffer.isBuffer(string)) {\n return string.length\n }\n if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&\n (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {\n return string.byteLength\n }\n if (typeof string !== 'string') {\n string = '' + string\n }\n\n var len = string.length\n if (len === 0) return 0\n\n // Use a for loop to avoid recursion\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'ascii':\n case 'latin1':\n case 'binary':\n return len\n case 'utf8':\n case 'utf-8':\n case undefined:\n return utf8ToBytes(string).length\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return len * 2\n case 'hex':\n return len >>> 1\n case 'base64':\n return base64ToBytes(string).length\n default:\n if (loweredCase) return utf8ToBytes(string).length // assume utf8\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\nBuffer.byteLength = byteLength\n\nfunction slowToString (encoding, start, end) {\n var loweredCase = false\n\n // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n // property of a typed array.\n\n // This behaves neither like String nor Uint8Array in that we set start/end\n // to their upper/lower bounds if the value passed is out of range.\n // undefined is handled specially as per ECMA-262 6th Edition,\n // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n if (start === undefined || start < 0) {\n start = 0\n }\n // Return early if start > this.length. Done here to prevent potential uint32\n // coercion fail below.\n if (start > this.length) {\n return ''\n }\n\n if (end === undefined || end > this.length) {\n end = this.length\n }\n\n if (end <= 0) {\n return ''\n }\n\n // Force coersion to uint32. This will also coerce falsey/NaN values to 0.\n end >>>= 0\n start >>>= 0\n\n if (end <= start) {\n return ''\n }\n\n if (!encoding) encoding = 'utf8'\n\n while (true) {\n switch (encoding) {\n case 'hex':\n return hexSlice(this, start, end)\n\n case 'utf8':\n case 'utf-8':\n return utf8Slice(this, start, end)\n\n case 'ascii':\n return asciiSlice(this, start, end)\n\n case 'latin1':\n case 'binary':\n return latin1Slice(this, start, end)\n\n case 'base64':\n return base64Slice(this, start, end)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return utf16leSlice(this, start, end)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = (encoding + '').toLowerCase()\n loweredCase = true\n }\n }\n}\n\n// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect\n// Buffer instances.\nBuffer.prototype._isBuffer = true\n\nfunction swap (b, n, m) {\n var i = b[n]\n b[n] = b[m]\n b[m] = i\n}\n\nBuffer.prototype.swap16 = function swap16 () {\n var len = this.length\n if (len % 2 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 16-bits')\n }\n for (var i = 0; i < len; i += 2) {\n swap(this, i, i + 1)\n }\n return this\n}\n\nBuffer.prototype.swap32 = function swap32 () {\n var len = this.length\n if (len % 4 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 32-bits')\n }\n for (var i = 0; i < len; i += 4) {\n swap(this, i, i + 3)\n swap(this, i + 1, i + 2)\n }\n return this\n}\n\nBuffer.prototype.swap64 = function swap64 () {\n var len = this.length\n if (len % 8 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 64-bits')\n }\n for (var i = 0; i < len; i += 8) {\n swap(this, i, i + 7)\n swap(this, i + 1, i + 6)\n swap(this, i + 2, i + 5)\n swap(this, i + 3, i + 4)\n }\n return this\n}\n\nBuffer.prototype.toString = function toString () {\n var length = this.length | 0\n if (length === 0) return ''\n if (arguments.length === 0) return utf8Slice(this, 0, length)\n return slowToString.apply(this, arguments)\n}\n\nBuffer.prototype.equals = function equals (b) {\n if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')\n if (this === b) return true\n return Buffer.compare(this, b) === 0\n}\n\nBuffer.prototype.inspect = function inspect () {\n var str = ''\n var max = exports.INSPECT_MAX_BYTES\n if (this.length > 0) {\n str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')\n if (this.length > max) str += ' ... '\n }\n return ''\n}\n\nBuffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {\n if (!Buffer.isBuffer(target)) {\n throw new TypeError('Argument must be a Buffer')\n }\n\n if (start === undefined) {\n start = 0\n }\n if (end === undefined) {\n end = target ? target.length : 0\n }\n if (thisStart === undefined) {\n thisStart = 0\n }\n if (thisEnd === undefined) {\n thisEnd = this.length\n }\n\n if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n throw new RangeError('out of range index')\n }\n\n if (thisStart >= thisEnd && start >= end) {\n return 0\n }\n if (thisStart >= thisEnd) {\n return -1\n }\n if (start >= end) {\n return 1\n }\n\n start >>>= 0\n end >>>= 0\n thisStart >>>= 0\n thisEnd >>>= 0\n\n if (this === target) return 0\n\n var x = thisEnd - thisStart\n var y = end - start\n var len = Math.min(x, y)\n\n var thisCopy = this.slice(thisStart, thisEnd)\n var targetCopy = target.slice(start, end)\n\n for (var i = 0; i < len; ++i) {\n if (thisCopy[i] !== targetCopy[i]) {\n x = thisCopy[i]\n y = targetCopy[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\n// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\n// OR the last index of `val` in `buffer` at offset <= `byteOffset`.\n//\n// Arguments:\n// - buffer - a Buffer to search\n// - val - a string, Buffer, or number\n// - byteOffset - an index into `buffer`; will be clamped to an int32\n// - encoding - an optional encoding, relevant is val is a string\n// - dir - true for indexOf, false for lastIndexOf\nfunction bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}\n\nfunction arrayIndexOf (arr, val, byteOffset, encoding, dir) {\n var indexSize = 1\n var arrLength = arr.length\n var valLength = val.length\n\n if (encoding !== undefined) {\n encoding = String(encoding).toLowerCase()\n if (encoding === 'ucs2' || encoding === 'ucs-2' ||\n encoding === 'utf16le' || encoding === 'utf-16le') {\n if (arr.length < 2 || val.length < 2) {\n return -1\n }\n indexSize = 2\n arrLength /= 2\n valLength /= 2\n byteOffset /= 2\n }\n }\n\n function read (buf, i) {\n if (indexSize === 1) {\n return buf[i]\n } else {\n return buf.readUInt16BE(i * indexSize)\n }\n }\n\n var i\n if (dir) {\n var foundIndex = -1\n for (i = byteOffset; i < arrLength; i++) {\n if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\n if (foundIndex === -1) foundIndex = i\n if (i - foundIndex + 1 === valLength) return foundIndex * indexSize\n } else {\n if (foundIndex !== -1) i -= i - foundIndex\n foundIndex = -1\n }\n }\n } else {\n if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength\n for (i = byteOffset; i >= 0; i--) {\n var found = true\n for (var j = 0; j < valLength; j++) {\n if (read(arr, i + j) !== read(val, j)) {\n found = false\n break\n }\n }\n if (found) return i\n }\n }\n\n return -1\n}\n\nBuffer.prototype.includes = function includes (val, byteOffset, encoding) {\n return this.indexOf(val, byteOffset, encoding) !== -1\n}\n\nBuffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, true)\n}\n\nBuffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, false)\n}\n\nfunction hexWrite (buf, string, offset, length) {\n offset = Number(offset) || 0\n var remaining = buf.length - offset\n if (!length) {\n length = remaining\n } else {\n length = Number(length)\n if (length > remaining) {\n length = remaining\n }\n }\n\n // must be an even number of digits\n var strLen = string.length\n if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')\n\n if (length > strLen / 2) {\n length = strLen / 2\n }\n for (var i = 0; i < length; ++i) {\n var parsed = parseInt(string.substr(i * 2, 2), 16)\n if (isNaN(parsed)) return i\n buf[offset + i] = parsed\n }\n return i\n}\n\nfunction utf8Write (buf, string, offset, length) {\n return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nfunction asciiWrite (buf, string, offset, length) {\n return blitBuffer(asciiToBytes(string), buf, offset, length)\n}\n\nfunction latin1Write (buf, string, offset, length) {\n return asciiWrite(buf, string, offset, length)\n}\n\nfunction base64Write (buf, string, offset, length) {\n return blitBuffer(base64ToBytes(string), buf, offset, length)\n}\n\nfunction ucs2Write (buf, string, offset, length) {\n return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nBuffer.prototype.write = function write (string, offset, length, encoding) {\n // Buffer#write(string)\n if (offset === undefined) {\n encoding = 'utf8'\n length = this.length\n offset = 0\n // Buffer#write(string, encoding)\n } else if (length === undefined && typeof offset === 'string') {\n encoding = offset\n length = this.length\n offset = 0\n // Buffer#write(string, offset[, length][, encoding])\n } else if (isFinite(offset)) {\n offset = offset | 0\n if (isFinite(length)) {\n length = length | 0\n if (encoding === undefined) encoding = 'utf8'\n } else {\n encoding = length\n length = undefined\n }\n // legacy write(string, encoding, offset, length) - remove in v0.13\n } else {\n throw new Error(\n 'Buffer.write(string, encoding, offset[, length]) is no longer supported'\n )\n }\n\n var remaining = this.length - offset\n if (length === undefined || length > remaining) length = remaining\n\n if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {\n throw new RangeError('Attempt to write outside buffer bounds')\n }\n\n if (!encoding) encoding = 'utf8'\n\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'hex':\n return hexWrite(this, string, offset, length)\n\n case 'utf8':\n case 'utf-8':\n return utf8Write(this, string, offset, length)\n\n case 'ascii':\n return asciiWrite(this, string, offset, length)\n\n case 'latin1':\n case 'binary':\n return latin1Write(this, string, offset, length)\n\n case 'base64':\n // Warning: maxLength not taken into account in base64Write\n return base64Write(this, string, offset, length)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return ucs2Write(this, string, offset, length)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\n\nBuffer.prototype.toJSON = function toJSON () {\n return {\n type: 'Buffer',\n data: Array.prototype.slice.call(this._arr || this, 0)\n }\n}\n\nfunction base64Slice (buf, start, end) {\n if (start === 0 && end === buf.length) {\n return base64.fromByteArray(buf)\n } else {\n return base64.fromByteArray(buf.slice(start, end))\n }\n}\n\nfunction utf8Slice (buf, start, end) {\n end = Math.min(buf.length, end)\n var res = []\n\n var i = start\n while (i < end) {\n var firstByte = buf[i]\n var codePoint = null\n var bytesPerSequence = (firstByte > 0xEF) ? 4\n : (firstByte > 0xDF) ? 3\n : (firstByte > 0xBF) ? 2\n : 1\n\n if (i + bytesPerSequence <= end) {\n var secondByte, thirdByte, fourthByte, tempCodePoint\n\n switch (bytesPerSequence) {\n case 1:\n if (firstByte < 0x80) {\n codePoint = firstByte\n }\n break\n case 2:\n secondByte = buf[i + 1]\n if ((secondByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)\n if (tempCodePoint > 0x7F) {\n codePoint = tempCodePoint\n }\n }\n break\n case 3:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)\n if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {\n codePoint = tempCodePoint\n }\n }\n break\n case 4:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n fourthByte = buf[i + 3]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)\n if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {\n codePoint = tempCodePoint\n }\n }\n }\n }\n\n if (codePoint === null) {\n // we did not generate a valid codePoint so insert a\n // replacement char (U+FFFD) and advance only 1 byte\n codePoint = 0xFFFD\n bytesPerSequence = 1\n } else if (codePoint > 0xFFFF) {\n // encode to utf16 (surrogate pair dance)\n codePoint -= 0x10000\n res.push(codePoint >>> 10 & 0x3FF | 0xD800)\n codePoint = 0xDC00 | codePoint & 0x3FF\n }\n\n res.push(codePoint)\n i += bytesPerSequence\n }\n\n return decodeCodePointsArray(res)\n}\n\n// Based on http://stackoverflow.com/a/22747272/680742, the browser with\n// the lowest limit is Chrome, with 0x10000 args.\n// We go 1 magnitude less, for safety\nvar MAX_ARGUMENTS_LENGTH = 0x1000\n\nfunction decodeCodePointsArray (codePoints) {\n var len = codePoints.length\n if (len <= MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints) // avoid extra slice()\n }\n\n // Decode in chunks to avoid \"call stack size exceeded\".\n var res = ''\n var i = 0\n while (i < len) {\n res += String.fromCharCode.apply(\n String,\n codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)\n )\n }\n return res\n}\n\nfunction asciiSlice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i] & 0x7F)\n }\n return ret\n}\n\nfunction latin1Slice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i])\n }\n return ret\n}\n\nfunction hexSlice (buf, start, end) {\n var len = buf.length\n\n if (!start || start < 0) start = 0\n if (!end || end < 0 || end > len) end = len\n\n var out = ''\n for (var i = start; i < end; ++i) {\n out += toHex(buf[i])\n }\n return out\n}\n\nfunction utf16leSlice (buf, start, end) {\n var bytes = buf.slice(start, end)\n var res = ''\n for (var i = 0; i < bytes.length; i += 2) {\n res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)\n }\n return res\n}\n\nBuffer.prototype.slice = function slice (start, end) {\n var len = this.length\n start = ~~start\n end = end === undefined ? len : ~~end\n\n if (start < 0) {\n start += len\n if (start < 0) start = 0\n } else if (start > len) {\n start = len\n }\n\n if (end < 0) {\n end += len\n if (end < 0) end = 0\n } else if (end > len) {\n end = len\n }\n\n if (end < start) end = start\n\n var newBuf\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n newBuf = this.subarray(start, end)\n newBuf.__proto__ = Buffer.prototype\n } else {\n var sliceLen = end - start\n newBuf = new Buffer(sliceLen, undefined)\n for (var i = 0; i < sliceLen; ++i) {\n newBuf[i] = this[i + start]\n }\n }\n\n return newBuf\n}\n\n/*\n * Need to make sure that buffer isn't trying to write out of bounds.\n */\nfunction checkOffset (offset, ext, length) {\n if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n}\n\nBuffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n checkOffset(offset, byteLength, this.length)\n }\n\n var val = this[offset + --byteLength]\n var mul = 1\n while (byteLength > 0 && (mul *= 0x100)) {\n val += this[offset + --byteLength] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n return this[offset]\n}\n\nBuffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return this[offset] | (this[offset + 1] << 8)\n}\n\nBuffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return (this[offset] << 8) | this[offset + 1]\n}\n\nBuffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return ((this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16)) +\n (this[offset + 3] * 0x1000000)\n}\n\nBuffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] * 0x1000000) +\n ((this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n this[offset + 3])\n}\n\nBuffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var i = byteLength\n var mul = 1\n var val = this[offset + --i]\n while (i > 0 && (mul *= 0x100)) {\n val += this[offset + --i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readInt8 = function readInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n if (!(this[offset] & 0x80)) return (this[offset])\n return ((0xff - this[offset] + 1) * -1)\n}\n\nBuffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset] | (this[offset + 1] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset + 1] | (this[offset] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16) |\n (this[offset + 3] << 24)\n}\n\nBuffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] << 24) |\n (this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n (this[offset + 3])\n}\n\nBuffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, true, 23, 4)\n}\n\nBuffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, false, 23, 4)\n}\n\nBuffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, true, 52, 8)\n}\n\nBuffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, false, 52, 8)\n}\n\nfunction checkInt (buf, value, offset, ext, max, min) {\n if (!Buffer.isBuffer(buf)) throw new TypeError('\"buffer\" argument must be a Buffer instance')\n if (value > max || value < min) throw new RangeError('\"value\" argument is out of bounds')\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n}\n\nBuffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var mul = 1\n var i = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var i = byteLength - 1\n var mul = 1\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nfunction objectWriteUInt16 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {\n buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>\n (littleEndian ? i : 1 - i) * 8\n }\n}\n\nBuffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nfunction objectWriteUInt32 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffffffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {\n buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff\n }\n}\n\nBuffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset + 3] = (value >>> 24)\n this[offset + 2] = (value >>> 16)\n this[offset + 1] = (value >>> 8)\n this[offset] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = 0\n var mul = 1\n var sub = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = byteLength - 1\n var mul = 1\n var sub = 0\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n if (value < 0) value = 0xff + value + 1\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n this[offset + 2] = (value >>> 16)\n this[offset + 3] = (value >>> 24)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (value < 0) value = 0xffffffff + value + 1\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nfunction checkIEEE754 (buf, value, offset, ext, max, min) {\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n if (offset < 0) throw new RangeError('Index out of range')\n}\n\nfunction writeFloat (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)\n }\n ieee754.write(buf, value, offset, littleEndian, 23, 4)\n return offset + 4\n}\n\nBuffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {\n return writeFloat(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {\n return writeFloat(this, value, offset, false, noAssert)\n}\n\nfunction writeDouble (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)\n }\n ieee754.write(buf, value, offset, littleEndian, 52, 8)\n return offset + 8\n}\n\nBuffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {\n return writeDouble(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {\n return writeDouble(this, value, offset, false, noAssert)\n}\n\n// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\nBuffer.prototype.copy = function copy (target, targetStart, start, end) {\n if (!start) start = 0\n if (!end && end !== 0) end = this.length\n if (targetStart >= target.length) targetStart = target.length\n if (!targetStart) targetStart = 0\n if (end > 0 && end < start) end = start\n\n // Copy 0 bytes; we're done\n if (end === start) return 0\n if (target.length === 0 || this.length === 0) return 0\n\n // Fatal error conditions\n if (targetStart < 0) {\n throw new RangeError('targetStart out of bounds')\n }\n if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')\n if (end < 0) throw new RangeError('sourceEnd out of bounds')\n\n // Are we oob?\n if (end > this.length) end = this.length\n if (target.length - targetStart < end - start) {\n end = target.length - targetStart + start\n }\n\n var len = end - start\n var i\n\n if (this === target && start < targetStart && targetStart < end) {\n // descending copy from end\n for (i = len - 1; i >= 0; --i) {\n target[i + targetStart] = this[i + start]\n }\n } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {\n // ascending copy from start\n for (i = 0; i < len; ++i) {\n target[i + targetStart] = this[i + start]\n }\n } else {\n Uint8Array.prototype.set.call(\n target,\n this.subarray(start, start + len),\n targetStart\n )\n }\n\n return len\n}\n\n// Usage:\n// buffer.fill(number[, offset[, end]])\n// buffer.fill(buffer[, offset[, end]])\n// buffer.fill(string[, offset[, end]][, encoding])\nBuffer.prototype.fill = function fill (val, start, end, encoding) {\n // Handle string cases:\n if (typeof val === 'string') {\n if (typeof start === 'string') {\n encoding = start\n start = 0\n end = this.length\n } else if (typeof end === 'string') {\n encoding = end\n end = this.length\n }\n if (val.length === 1) {\n var code = val.charCodeAt(0)\n if (code < 256) {\n val = code\n }\n }\n if (encoding !== undefined && typeof encoding !== 'string') {\n throw new TypeError('encoding must be a string')\n }\n if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n } else if (typeof val === 'number') {\n val = val & 255\n }\n\n // Invalid ranges are not set to a default, so can range check early.\n if (start < 0 || this.length < start || this.length < end) {\n throw new RangeError('Out of range index')\n }\n\n if (end <= start) {\n return this\n }\n\n start = start >>> 0\n end = end === undefined ? this.length : end >>> 0\n\n if (!val) val = 0\n\n var i\n if (typeof val === 'number') {\n for (i = start; i < end; ++i) {\n this[i] = val\n }\n } else {\n var bytes = Buffer.isBuffer(val)\n ? val\n : utf8ToBytes(new Buffer(val, encoding).toString())\n var len = bytes.length\n for (i = 0; i < end - start; ++i) {\n this[i + start] = bytes[i % len]\n }\n }\n\n return this\n}\n\n// HELPER FUNCTIONS\n// ================\n\nvar INVALID_BASE64_RE = /[^+\\/0-9A-Za-z-_]/g\n\nfunction base64clean (str) {\n // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n str = stringtrim(str).replace(INVALID_BASE64_RE, '')\n // Node converts strings with length < 2 to ''\n if (str.length < 2) return ''\n // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n while (str.length % 4 !== 0) {\n str = str + '='\n }\n return str\n}\n\nfunction stringtrim (str) {\n if (str.trim) return str.trim()\n return str.replace(/^\\s+|\\s+$/g, '')\n}\n\nfunction toHex (n) {\n if (n < 16) return '0' + n.toString(16)\n return n.toString(16)\n}\n\nfunction utf8ToBytes (string, units) {\n units = units || Infinity\n var codePoint\n var length = string.length\n var leadSurrogate = null\n var bytes = []\n\n for (var i = 0; i < length; ++i) {\n codePoint = string.charCodeAt(i)\n\n // is surrogate component\n if (codePoint > 0xD7FF && codePoint < 0xE000) {\n // last char was a lead\n if (!leadSurrogate) {\n // no lead yet\n if (codePoint > 0xDBFF) {\n // unexpected trail\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n } else if (i + 1 === length) {\n // unpaired lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n }\n\n // valid lead\n leadSurrogate = codePoint\n\n continue\n }\n\n // 2 leads in a row\n if (codePoint < 0xDC00) {\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n leadSurrogate = codePoint\n continue\n }\n\n // valid surrogate pair\n codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000\n } else if (leadSurrogate) {\n // valid bmp char, but last char was a lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n }\n\n leadSurrogate = null\n\n // encode utf8\n if (codePoint < 0x80) {\n if ((units -= 1) < 0) break\n bytes.push(codePoint)\n } else if (codePoint < 0x800) {\n if ((units -= 2) < 0) break\n bytes.push(\n codePoint >> 0x6 | 0xC0,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x10000) {\n if ((units -= 3) < 0) break\n bytes.push(\n codePoint >> 0xC | 0xE0,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x110000) {\n if ((units -= 4) < 0) break\n bytes.push(\n codePoint >> 0x12 | 0xF0,\n codePoint >> 0xC & 0x3F | 0x80,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else {\n throw new Error('Invalid code point')\n }\n }\n\n return bytes\n}\n\nfunction asciiToBytes (str) {\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n // Node's code seems to be doing this and not & 0x7F..\n byteArray.push(str.charCodeAt(i) & 0xFF)\n }\n return byteArray\n}\n\nfunction utf16leToBytes (str, units) {\n var c, hi, lo\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n if ((units -= 2) < 0) break\n\n c = str.charCodeAt(i)\n hi = c >> 8\n lo = c % 256\n byteArray.push(lo)\n byteArray.push(hi)\n }\n\n return byteArray\n}\n\nfunction base64ToBytes (str) {\n return base64.toByteArray(base64clean(str))\n}\n\nfunction blitBuffer (src, dst, offset, length) {\n for (var i = 0; i < length; ++i) {\n if ((i + offset >= dst.length) || (i >= src.length)) break\n dst[i + offset] = src[i]\n }\n return i\n}\n\nfunction isnan (val) {\n return val !== val // eslint-disable-line no-self-compare\n}\n","/* eslint-disable node/no-deprecated-api */\nvar buffer = require('buffer')\nvar Buffer = buffer.Buffer\n\n// alternative to using Object.keys for old browsers\nfunction copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}\nif (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {\n module.exports = buffer\n} else {\n // Copy properties from require('buffer')\n copyProps(buffer, exports)\n exports.Buffer = SafeBuffer\n}\n\nfunction SafeBuffer (arg, encodingOrOffset, length) {\n return Buffer(arg, encodingOrOffset, length)\n}\n\n// Copy static methods from Buffer\ncopyProps(Buffer, SafeBuffer)\n\nSafeBuffer.from = function (arg, encodingOrOffset, length) {\n if (typeof arg === 'number') {\n throw new TypeError('Argument must not be a number')\n }\n return Buffer(arg, encodingOrOffset, length)\n}\n\nSafeBuffer.alloc = function (size, fill, encoding) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n var buf = Buffer(size)\n if (fill !== undefined) {\n if (typeof encoding === 'string') {\n buf.fill(fill, encoding)\n } else {\n buf.fill(fill)\n }\n } else {\n buf.fill(0)\n }\n return buf\n}\n\nSafeBuffer.allocUnsafe = function (size) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n return Buffer(size)\n}\n\nSafeBuffer.allocUnsafeSlow = function (size) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n return buffer.SlowBuffer(size)\n}\n","var Buffer = require('safe-buffer').Buffer\n\n// prototype class for hash functions\nfunction Hash (blockSize, finalSize) {\n this._block = Buffer.alloc(blockSize)\n this._finalSize = finalSize\n this._blockSize = blockSize\n this._len = 0\n}\n\nHash.prototype.update = function (data, enc) {\n if (typeof data === 'string') {\n enc = enc || 'utf8'\n data = Buffer.from(data, enc)\n }\n\n var block = this._block\n var blockSize = this._blockSize\n var length = data.length\n var accum = this._len\n\n for (var offset = 0; offset < length;) {\n var assigned = accum % blockSize\n var remainder = Math.min(length - offset, blockSize - assigned)\n\n for (var i = 0; i < remainder; i++) {\n block[assigned + i] = data[offset + i]\n }\n\n accum += remainder\n offset += remainder\n\n if ((accum % blockSize) === 0) {\n this._update(block)\n }\n }\n\n this._len += length\n return this\n}\n\nHash.prototype.digest = function (enc) {\n var rem = this._len % this._blockSize\n\n this._block[rem] = 0x80\n\n // zero (rem + 1) trailing bits, where (rem + 1) is the smallest\n // non-negative solution to the equation (length + 1 + (rem + 1)) === finalSize mod blockSize\n this._block.fill(0, rem + 1)\n\n if (rem >= this._finalSize) {\n this._update(this._block)\n this._block.fill(0)\n }\n\n var bits = this._len * 8\n\n // uint32\n if (bits <= 0xffffffff) {\n this._block.writeUInt32BE(bits, this._blockSize - 4)\n\n // uint64\n } else {\n var lowBits = (bits & 0xffffffff) >>> 0\n var highBits = (bits - lowBits) / 0x100000000\n\n this._block.writeUInt32BE(highBits, this._blockSize - 8)\n this._block.writeUInt32BE(lowBits, this._blockSize - 4)\n }\n\n this._update(this._block)\n var hash = this._hash()\n\n return enc ? hash.toString(enc) : hash\n}\n\nHash.prototype._update = function () {\n throw new Error('_update must be implemented by subclass')\n}\n\nmodule.exports = Hash\n","/*\n * A JavaScript implementation of the Secure Hash Algorithm, SHA-0, as defined\n * in FIPS PUB 180-1\n * This source code is derived from sha1.js of the same repository.\n * The difference between SHA-0 and SHA-1 is just a bitwise rotate left\n * operation was added.\n */\n\nvar inherits = require('inherits')\nvar Hash = require('./hash')\nvar Buffer = require('safe-buffer').Buffer\n\nvar K = [\n 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc | 0, 0xca62c1d6 | 0\n]\n\nvar W = new Array(80)\n\nfunction Sha () {\n this.init()\n this._w = W\n\n Hash.call(this, 64, 56)\n}\n\ninherits(Sha, Hash)\n\nSha.prototype.init = function () {\n this._a = 0x67452301\n this._b = 0xefcdab89\n this._c = 0x98badcfe\n this._d = 0x10325476\n this._e = 0xc3d2e1f0\n\n return this\n}\n\nfunction rotl5 (num) {\n return (num << 5) | (num >>> 27)\n}\n\nfunction rotl30 (num) {\n return (num << 30) | (num >>> 2)\n}\n\nfunction ft (s, b, c, d) {\n if (s === 0) return (b & c) | ((~b) & d)\n if (s === 2) return (b & c) | (b & d) | (c & d)\n return b ^ c ^ d\n}\n\nSha.prototype._update = function (M) {\n var W = this._w\n\n var a = this._a | 0\n var b = this._b | 0\n var c = this._c | 0\n var d = this._d | 0\n var e = this._e | 0\n\n for (var i = 0; i < 16; ++i) W[i] = M.readInt32BE(i * 4)\n for (; i < 80; ++i) W[i] = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16]\n\n for (var j = 0; j < 80; ++j) {\n var s = ~~(j / 20)\n var t = (rotl5(a) + ft(s, b, c, d) + e + W[j] + K[s]) | 0\n\n e = d\n d = c\n c = rotl30(b)\n b = a\n a = t\n }\n\n this._a = (a + this._a) | 0\n this._b = (b + this._b) | 0\n this._c = (c + this._c) | 0\n this._d = (d + this._d) | 0\n this._e = (e + this._e) | 0\n}\n\nSha.prototype._hash = function () {\n var H = Buffer.allocUnsafe(20)\n\n H.writeInt32BE(this._a | 0, 0)\n H.writeInt32BE(this._b | 0, 4)\n H.writeInt32BE(this._c | 0, 8)\n H.writeInt32BE(this._d | 0, 12)\n H.writeInt32BE(this._e | 0, 16)\n\n return H\n}\n\nmodule.exports = Sha\n","/*\n * A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined\n * in FIPS PUB 180-1\n * Version 2.1a Copyright Paul Johnston 2000 - 2002.\n * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\n * Distributed under the BSD License\n * See http://pajhome.org.uk/crypt/md5 for details.\n */\n\nvar inherits = require('inherits')\nvar Hash = require('./hash')\nvar Buffer = require('safe-buffer').Buffer\n\nvar K = [\n 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc | 0, 0xca62c1d6 | 0\n]\n\nvar W = new Array(80)\n\nfunction Sha1 () {\n this.init()\n this._w = W\n\n Hash.call(this, 64, 56)\n}\n\ninherits(Sha1, Hash)\n\nSha1.prototype.init = function () {\n this._a = 0x67452301\n this._b = 0xefcdab89\n this._c = 0x98badcfe\n this._d = 0x10325476\n this._e = 0xc3d2e1f0\n\n return this\n}\n\nfunction rotl1 (num) {\n return (num << 1) | (num >>> 31)\n}\n\nfunction rotl5 (num) {\n return (num << 5) | (num >>> 27)\n}\n\nfunction rotl30 (num) {\n return (num << 30) | (num >>> 2)\n}\n\nfunction ft (s, b, c, d) {\n if (s === 0) return (b & c) | ((~b) & d)\n if (s === 2) return (b & c) | (b & d) | (c & d)\n return b ^ c ^ d\n}\n\nSha1.prototype._update = function (M) {\n var W = this._w\n\n var a = this._a | 0\n var b = this._b | 0\n var c = this._c | 0\n var d = this._d | 0\n var e = this._e | 0\n\n for (var i = 0; i < 16; ++i) W[i] = M.readInt32BE(i * 4)\n for (; i < 80; ++i) W[i] = rotl1(W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16])\n\n for (var j = 0; j < 80; ++j) {\n var s = ~~(j / 20)\n var t = (rotl5(a) + ft(s, b, c, d) + e + W[j] + K[s]) | 0\n\n e = d\n d = c\n c = rotl30(b)\n b = a\n a = t\n }\n\n this._a = (a + this._a) | 0\n this._b = (b + this._b) | 0\n this._c = (c + this._c) | 0\n this._d = (d + this._d) | 0\n this._e = (e + this._e) | 0\n}\n\nSha1.prototype._hash = function () {\n var H = Buffer.allocUnsafe(20)\n\n H.writeInt32BE(this._a | 0, 0)\n H.writeInt32BE(this._b | 0, 4)\n H.writeInt32BE(this._c | 0, 8)\n H.writeInt32BE(this._d | 0, 12)\n H.writeInt32BE(this._e | 0, 16)\n\n return H\n}\n\nmodule.exports = Sha1\n","/**\n * A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined\n * in FIPS 180-2\n * Version 2.2-beta Copyright Angel Marin, Paul Johnston 2000 - 2009.\n * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\n *\n */\n\nvar inherits = require('inherits')\nvar Hash = require('./hash')\nvar Buffer = require('safe-buffer').Buffer\n\nvar K = [\n 0x428A2F98, 0x71374491, 0xB5C0FBCF, 0xE9B5DBA5,\n 0x3956C25B, 0x59F111F1, 0x923F82A4, 0xAB1C5ED5,\n 0xD807AA98, 0x12835B01, 0x243185BE, 0x550C7DC3,\n 0x72BE5D74, 0x80DEB1FE, 0x9BDC06A7, 0xC19BF174,\n 0xE49B69C1, 0xEFBE4786, 0x0FC19DC6, 0x240CA1CC,\n 0x2DE92C6F, 0x4A7484AA, 0x5CB0A9DC, 0x76F988DA,\n 0x983E5152, 0xA831C66D, 0xB00327C8, 0xBF597FC7,\n 0xC6E00BF3, 0xD5A79147, 0x06CA6351, 0x14292967,\n 0x27B70A85, 0x2E1B2138, 0x4D2C6DFC, 0x53380D13,\n 0x650A7354, 0x766A0ABB, 0x81C2C92E, 0x92722C85,\n 0xA2BFE8A1, 0xA81A664B, 0xC24B8B70, 0xC76C51A3,\n 0xD192E819, 0xD6990624, 0xF40E3585, 0x106AA070,\n 0x19A4C116, 0x1E376C08, 0x2748774C, 0x34B0BCB5,\n 0x391C0CB3, 0x4ED8AA4A, 0x5B9CCA4F, 0x682E6FF3,\n 0x748F82EE, 0x78A5636F, 0x84C87814, 0x8CC70208,\n 0x90BEFFFA, 0xA4506CEB, 0xBEF9A3F7, 0xC67178F2\n]\n\nvar W = new Array(64)\n\nfunction Sha256 () {\n this.init()\n\n this._w = W // new Array(64)\n\n Hash.call(this, 64, 56)\n}\n\ninherits(Sha256, Hash)\n\nSha256.prototype.init = function () {\n this._a = 0x6a09e667\n this._b = 0xbb67ae85\n this._c = 0x3c6ef372\n this._d = 0xa54ff53a\n this._e = 0x510e527f\n this._f = 0x9b05688c\n this._g = 0x1f83d9ab\n this._h = 0x5be0cd19\n\n return this\n}\n\nfunction ch (x, y, z) {\n return z ^ (x & (y ^ z))\n}\n\nfunction maj (x, y, z) {\n return (x & y) | (z & (x | y))\n}\n\nfunction sigma0 (x) {\n return (x >>> 2 | x << 30) ^ (x >>> 13 | x << 19) ^ (x >>> 22 | x << 10)\n}\n\nfunction sigma1 (x) {\n return (x >>> 6 | x << 26) ^ (x >>> 11 | x << 21) ^ (x >>> 25 | x << 7)\n}\n\nfunction gamma0 (x) {\n return (x >>> 7 | x << 25) ^ (x >>> 18 | x << 14) ^ (x >>> 3)\n}\n\nfunction gamma1 (x) {\n return (x >>> 17 | x << 15) ^ (x >>> 19 | x << 13) ^ (x >>> 10)\n}\n\nSha256.prototype._update = function (M) {\n var W = this._w\n\n var a = this._a | 0\n var b = this._b | 0\n var c = this._c | 0\n var d = this._d | 0\n var e = this._e | 0\n var f = this._f | 0\n var g = this._g | 0\n var h = this._h | 0\n\n for (var i = 0; i < 16; ++i) W[i] = M.readInt32BE(i * 4)\n for (; i < 64; ++i) W[i] = (gamma1(W[i - 2]) + W[i - 7] + gamma0(W[i - 15]) + W[i - 16]) | 0\n\n for (var j = 0; j < 64; ++j) {\n var T1 = (h + sigma1(e) + ch(e, f, g) + K[j] + W[j]) | 0\n var T2 = (sigma0(a) + maj(a, b, c)) | 0\n\n h = g\n g = f\n f = e\n e = (d + T1) | 0\n d = c\n c = b\n b = a\n a = (T1 + T2) | 0\n }\n\n this._a = (a + this._a) | 0\n this._b = (b + this._b) | 0\n this._c = (c + this._c) | 0\n this._d = (d + this._d) | 0\n this._e = (e + this._e) | 0\n this._f = (f + this._f) | 0\n this._g = (g + this._g) | 0\n this._h = (h + this._h) | 0\n}\n\nSha256.prototype._hash = function () {\n var H = Buffer.allocUnsafe(32)\n\n H.writeInt32BE(this._a, 0)\n H.writeInt32BE(this._b, 4)\n H.writeInt32BE(this._c, 8)\n H.writeInt32BE(this._d, 12)\n H.writeInt32BE(this._e, 16)\n H.writeInt32BE(this._f, 20)\n H.writeInt32BE(this._g, 24)\n H.writeInt32BE(this._h, 28)\n\n return H\n}\n\nmodule.exports = Sha256\n","/**\n * A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined\n * in FIPS 180-2\n * Version 2.2-beta Copyright Angel Marin, Paul Johnston 2000 - 2009.\n * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\n *\n */\n\nvar inherits = require('inherits')\nvar Sha256 = require('./sha256')\nvar Hash = require('./hash')\nvar Buffer = require('safe-buffer').Buffer\n\nvar W = new Array(64)\n\nfunction Sha224 () {\n this.init()\n\n this._w = W // new Array(64)\n\n Hash.call(this, 64, 56)\n}\n\ninherits(Sha224, Sha256)\n\nSha224.prototype.init = function () {\n this._a = 0xc1059ed8\n this._b = 0x367cd507\n this._c = 0x3070dd17\n this._d = 0xf70e5939\n this._e = 0xffc00b31\n this._f = 0x68581511\n this._g = 0x64f98fa7\n this._h = 0xbefa4fa4\n\n return this\n}\n\nSha224.prototype._hash = function () {\n var H = Buffer.allocUnsafe(28)\n\n H.writeInt32BE(this._a, 0)\n H.writeInt32BE(this._b, 4)\n H.writeInt32BE(this._c, 8)\n H.writeInt32BE(this._d, 12)\n H.writeInt32BE(this._e, 16)\n H.writeInt32BE(this._f, 20)\n H.writeInt32BE(this._g, 24)\n\n return H\n}\n\nmodule.exports = Sha224\n","var inherits = require('inherits')\nvar Hash = require('./hash')\nvar Buffer = require('safe-buffer').Buffer\n\nvar K = [\n 0x428a2f98, 0xd728ae22, 0x71374491, 0x23ef65cd,\n 0xb5c0fbcf, 0xec4d3b2f, 0xe9b5dba5, 0x8189dbbc,\n 0x3956c25b, 0xf348b538, 0x59f111f1, 0xb605d019,\n 0x923f82a4, 0xaf194f9b, 0xab1c5ed5, 0xda6d8118,\n 0xd807aa98, 0xa3030242, 0x12835b01, 0x45706fbe,\n 0x243185be, 0x4ee4b28c, 0x550c7dc3, 0xd5ffb4e2,\n 0x72be5d74, 0xf27b896f, 0x80deb1fe, 0x3b1696b1,\n 0x9bdc06a7, 0x25c71235, 0xc19bf174, 0xcf692694,\n 0xe49b69c1, 0x9ef14ad2, 0xefbe4786, 0x384f25e3,\n 0x0fc19dc6, 0x8b8cd5b5, 0x240ca1cc, 0x77ac9c65,\n 0x2de92c6f, 0x592b0275, 0x4a7484aa, 0x6ea6e483,\n 0x5cb0a9dc, 0xbd41fbd4, 0x76f988da, 0x831153b5,\n 0x983e5152, 0xee66dfab, 0xa831c66d, 0x2db43210,\n 0xb00327c8, 0x98fb213f, 0xbf597fc7, 0xbeef0ee4,\n 0xc6e00bf3, 0x3da88fc2, 0xd5a79147, 0x930aa725,\n 0x06ca6351, 0xe003826f, 0x14292967, 0x0a0e6e70,\n 0x27b70a85, 0x46d22ffc, 0x2e1b2138, 0x5c26c926,\n 0x4d2c6dfc, 0x5ac42aed, 0x53380d13, 0x9d95b3df,\n 0x650a7354, 0x8baf63de, 0x766a0abb, 0x3c77b2a8,\n 0x81c2c92e, 0x47edaee6, 0x92722c85, 0x1482353b,\n 0xa2bfe8a1, 0x4cf10364, 0xa81a664b, 0xbc423001,\n 0xc24b8b70, 0xd0f89791, 0xc76c51a3, 0x0654be30,\n 0xd192e819, 0xd6ef5218, 0xd6990624, 0x5565a910,\n 0xf40e3585, 0x5771202a, 0x106aa070, 0x32bbd1b8,\n 0x19a4c116, 0xb8d2d0c8, 0x1e376c08, 0x5141ab53,\n 0x2748774c, 0xdf8eeb99, 0x34b0bcb5, 0xe19b48a8,\n 0x391c0cb3, 0xc5c95a63, 0x4ed8aa4a, 0xe3418acb,\n 0x5b9cca4f, 0x7763e373, 0x682e6ff3, 0xd6b2b8a3,\n 0x748f82ee, 0x5defb2fc, 0x78a5636f, 0x43172f60,\n 0x84c87814, 0xa1f0ab72, 0x8cc70208, 0x1a6439ec,\n 0x90befffa, 0x23631e28, 0xa4506ceb, 0xde82bde9,\n 0xbef9a3f7, 0xb2c67915, 0xc67178f2, 0xe372532b,\n 0xca273ece, 0xea26619c, 0xd186b8c7, 0x21c0c207,\n 0xeada7dd6, 0xcde0eb1e, 0xf57d4f7f, 0xee6ed178,\n 0x06f067aa, 0x72176fba, 0x0a637dc5, 0xa2c898a6,\n 0x113f9804, 0xbef90dae, 0x1b710b35, 0x131c471b,\n 0x28db77f5, 0x23047d84, 0x32caab7b, 0x40c72493,\n 0x3c9ebe0a, 0x15c9bebc, 0x431d67c4, 0x9c100d4c,\n 0x4cc5d4be, 0xcb3e42b6, 0x597f299c, 0xfc657e2a,\n 0x5fcb6fab, 0x3ad6faec, 0x6c44198c, 0x4a475817\n]\n\nvar W = new Array(160)\n\nfunction Sha512 () {\n this.init()\n this._w = W\n\n Hash.call(this, 128, 112)\n}\n\ninherits(Sha512, Hash)\n\nSha512.prototype.init = function () {\n this._ah = 0x6a09e667\n this._bh = 0xbb67ae85\n this._ch = 0x3c6ef372\n this._dh = 0xa54ff53a\n this._eh = 0x510e527f\n this._fh = 0x9b05688c\n this._gh = 0x1f83d9ab\n this._hh = 0x5be0cd19\n\n this._al = 0xf3bcc908\n this._bl = 0x84caa73b\n this._cl = 0xfe94f82b\n this._dl = 0x5f1d36f1\n this._el = 0xade682d1\n this._fl = 0x2b3e6c1f\n this._gl = 0xfb41bd6b\n this._hl = 0x137e2179\n\n return this\n}\n\nfunction Ch (x, y, z) {\n return z ^ (x & (y ^ z))\n}\n\nfunction maj (x, y, z) {\n return (x & y) | (z & (x | y))\n}\n\nfunction sigma0 (x, xl) {\n return (x >>> 28 | xl << 4) ^ (xl >>> 2 | x << 30) ^ (xl >>> 7 | x << 25)\n}\n\nfunction sigma1 (x, xl) {\n return (x >>> 14 | xl << 18) ^ (x >>> 18 | xl << 14) ^ (xl >>> 9 | x << 23)\n}\n\nfunction Gamma0 (x, xl) {\n return (x >>> 1 | xl << 31) ^ (x >>> 8 | xl << 24) ^ (x >>> 7)\n}\n\nfunction Gamma0l (x, xl) {\n return (x >>> 1 | xl << 31) ^ (x >>> 8 | xl << 24) ^ (x >>> 7 | xl << 25)\n}\n\nfunction Gamma1 (x, xl) {\n return (x >>> 19 | xl << 13) ^ (xl >>> 29 | x << 3) ^ (x >>> 6)\n}\n\nfunction Gamma1l (x, xl) {\n return (x >>> 19 | xl << 13) ^ (xl >>> 29 | x << 3) ^ (x >>> 6 | xl << 26)\n}\n\nfunction getCarry (a, b) {\n return (a >>> 0) < (b >>> 0) ? 1 : 0\n}\n\nSha512.prototype._update = function (M) {\n var W = this._w\n\n var ah = this._ah | 0\n var bh = this._bh | 0\n var ch = this._ch | 0\n var dh = this._dh | 0\n var eh = this._eh | 0\n var fh = this._fh | 0\n var gh = this._gh | 0\n var hh = this._hh | 0\n\n var al = this._al | 0\n var bl = this._bl | 0\n var cl = this._cl | 0\n var dl = this._dl | 0\n var el = this._el | 0\n var fl = this._fl | 0\n var gl = this._gl | 0\n var hl = this._hl | 0\n\n for (var i = 0; i < 32; i += 2) {\n W[i] = M.readInt32BE(i * 4)\n W[i + 1] = M.readInt32BE(i * 4 + 4)\n }\n for (; i < 160; i += 2) {\n var xh = W[i - 15 * 2]\n var xl = W[i - 15 * 2 + 1]\n var gamma0 = Gamma0(xh, xl)\n var gamma0l = Gamma0l(xl, xh)\n\n xh = W[i - 2 * 2]\n xl = W[i - 2 * 2 + 1]\n var gamma1 = Gamma1(xh, xl)\n var gamma1l = Gamma1l(xl, xh)\n\n // W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16]\n var Wi7h = W[i - 7 * 2]\n var Wi7l = W[i - 7 * 2 + 1]\n\n var Wi16h = W[i - 16 * 2]\n var Wi16l = W[i - 16 * 2 + 1]\n\n var Wil = (gamma0l + Wi7l) | 0\n var Wih = (gamma0 + Wi7h + getCarry(Wil, gamma0l)) | 0\n Wil = (Wil + gamma1l) | 0\n Wih = (Wih + gamma1 + getCarry(Wil, gamma1l)) | 0\n Wil = (Wil + Wi16l) | 0\n Wih = (Wih + Wi16h + getCarry(Wil, Wi16l)) | 0\n\n W[i] = Wih\n W[i + 1] = Wil\n }\n\n for (var j = 0; j < 160; j += 2) {\n Wih = W[j]\n Wil = W[j + 1]\n\n var majh = maj(ah, bh, ch)\n var majl = maj(al, bl, cl)\n\n var sigma0h = sigma0(ah, al)\n var sigma0l = sigma0(al, ah)\n var sigma1h = sigma1(eh, el)\n var sigma1l = sigma1(el, eh)\n\n // t1 = h + sigma1 + ch + K[j] + W[j]\n var Kih = K[j]\n var Kil = K[j + 1]\n\n var chh = Ch(eh, fh, gh)\n var chl = Ch(el, fl, gl)\n\n var t1l = (hl + sigma1l) | 0\n var t1h = (hh + sigma1h + getCarry(t1l, hl)) | 0\n t1l = (t1l + chl) | 0\n t1h = (t1h + chh + getCarry(t1l, chl)) | 0\n t1l = (t1l + Kil) | 0\n t1h = (t1h + Kih + getCarry(t1l, Kil)) | 0\n t1l = (t1l + Wil) | 0\n t1h = (t1h + Wih + getCarry(t1l, Wil)) | 0\n\n // t2 = sigma0 + maj\n var t2l = (sigma0l + majl) | 0\n var t2h = (sigma0h + majh + getCarry(t2l, sigma0l)) | 0\n\n hh = gh\n hl = gl\n gh = fh\n gl = fl\n fh = eh\n fl = el\n el = (dl + t1l) | 0\n eh = (dh + t1h + getCarry(el, dl)) | 0\n dh = ch\n dl = cl\n ch = bh\n cl = bl\n bh = ah\n bl = al\n al = (t1l + t2l) | 0\n ah = (t1h + t2h + getCarry(al, t1l)) | 0\n }\n\n this._al = (this._al + al) | 0\n this._bl = (this._bl + bl) | 0\n this._cl = (this._cl + cl) | 0\n this._dl = (this._dl + dl) | 0\n this._el = (this._el + el) | 0\n this._fl = (this._fl + fl) | 0\n this._gl = (this._gl + gl) | 0\n this._hl = (this._hl + hl) | 0\n\n this._ah = (this._ah + ah + getCarry(this._al, al)) | 0\n this._bh = (this._bh + bh + getCarry(this._bl, bl)) | 0\n this._ch = (this._ch + ch + getCarry(this._cl, cl)) | 0\n this._dh = (this._dh + dh + getCarry(this._dl, dl)) | 0\n this._eh = (this._eh + eh + getCarry(this._el, el)) | 0\n this._fh = (this._fh + fh + getCarry(this._fl, fl)) | 0\n this._gh = (this._gh + gh + getCarry(this._gl, gl)) | 0\n this._hh = (this._hh + hh + getCarry(this._hl, hl)) | 0\n}\n\nSha512.prototype._hash = function () {\n var H = Buffer.allocUnsafe(64)\n\n function writeInt64BE (h, l, offset) {\n H.writeInt32BE(h, offset)\n H.writeInt32BE(l, offset + 4)\n }\n\n writeInt64BE(this._ah, this._al, 0)\n writeInt64BE(this._bh, this._bl, 8)\n writeInt64BE(this._ch, this._cl, 16)\n writeInt64BE(this._dh, this._dl, 24)\n writeInt64BE(this._eh, this._el, 32)\n writeInt64BE(this._fh, this._fl, 40)\n writeInt64BE(this._gh, this._gl, 48)\n writeInt64BE(this._hh, this._hl, 56)\n\n return H\n}\n\nmodule.exports = Sha512\n","var inherits = require('inherits')\nvar SHA512 = require('./sha512')\nvar Hash = require('./hash')\nvar Buffer = require('safe-buffer').Buffer\n\nvar W = new Array(160)\n\nfunction Sha384 () {\n this.init()\n this._w = W\n\n Hash.call(this, 128, 112)\n}\n\ninherits(Sha384, SHA512)\n\nSha384.prototype.init = function () {\n this._ah = 0xcbbb9d5d\n this._bh = 0x629a292a\n this._ch = 0x9159015a\n this._dh = 0x152fecd8\n this._eh = 0x67332667\n this._fh = 0x8eb44a87\n this._gh = 0xdb0c2e0d\n this._hh = 0x47b5481d\n\n this._al = 0xc1059ed8\n this._bl = 0x367cd507\n this._cl = 0x3070dd17\n this._dl = 0xf70e5939\n this._el = 0xffc00b31\n this._fl = 0x68581511\n this._gl = 0x64f98fa7\n this._hl = 0xbefa4fa4\n\n return this\n}\n\nSha384.prototype._hash = function () {\n var H = Buffer.allocUnsafe(48)\n\n function writeInt64BE (h, l, offset) {\n H.writeInt32BE(h, offset)\n H.writeInt32BE(l, offset + 4)\n }\n\n writeInt64BE(this._ah, this._al, 0)\n writeInt64BE(this._bh, this._bl, 8)\n writeInt64BE(this._ch, this._cl, 16)\n writeInt64BE(this._dh, this._dl, 24)\n writeInt64BE(this._eh, this._el, 32)\n writeInt64BE(this._fh, this._fl, 40)\n\n return H\n}\n\nmodule.exports = Sha384\n","var exports = module.exports = function SHA (algorithm) {\n algorithm = algorithm.toLowerCase()\n\n var Algorithm = exports[algorithm]\n if (!Algorithm) throw new Error(algorithm + ' is not supported (we accept pull requests)')\n\n return new Algorithm()\n}\n\nexports.sha = require('./sha')\nexports.sha1 = require('./sha1')\nexports.sha224 = require('./sha224')\nexports.sha256 = require('./sha256')\nexports.sha384 = require('./sha384')\nexports.sha512 = require('./sha512')\n","/*Copyright (c) 2016, TT Labs, Inc.\n All rights reserved.\n\n Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\n Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\n Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\n Neither the name of the TT Labs, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.*/\n\n\n/***************************************************************************************************\n * *\n * version 2.1.4 *\n * *\n ***************************************************************************************************/\n\n(function () {\n \"use strict\";\n\n var FAR_FUTURE = new Date('2060-10-22'),\n HOURS_AGO,\n PENDING = 0, EVAPORATING = 2, COMPLETE = 3, PAUSED = 4, CANCELED = 5, ERROR = 10, ABORTED = 20, PAUSING = 30,\n PAUSED_STATUSES = [PAUSED, PAUSING],\n ACTIVE_STATUSES = [PENDING, EVAPORATING, ERROR],\n ETAG_OF_0_LENGTH_BLOB = '\"d41d8cd98f00b204e9800998ecf8427e\"',\n PARTS_MONITOR_INTERVAL_MS = 2 * 60 * 1000,\n IMMUTABLE_OPTIONS = [\n 'maxConcurrentParts',\n 'logging',\n 'cloudfront',\n 'encodeFilename',\n 'computeContentMd5',\n 'allowS3ExistenceOptimization',\n 'onlyRetryForSameFileName',\n 'timeUrl',\n 'cryptoMd5Method',\n 'cryptoHexEncodedHash256',\n 'awsRegion',\n 'awsSignatureVersion',\n 'evaporateChanged'\n ],\n S3_EXTRA_ENCODED_CHARS = {\n 33: \"%21\", // !\n 39: \"%27\", // '\n 40: \"%28\", // (\n 41: \"%29\", // )\n 42: \"%2A\" // *\n },\n l;\n\n var Evaporate = function (config) {\n this.config = extend({\n readableStreams: false,\n readableStreamPartMethod: null,\n bucket: null,\n logging: true,\n maxConcurrentParts: 5,\n partSize: 6 * 1024 * 1024,\n retryBackoffPower: 2,\n maxRetryBackoffSecs: 300,\n progressIntervalMS: 1000,\n cloudfront: false,\n s3Acceleration: false,\n mockLocalStorage: false,\n encodeFilename: true,\n computeContentMd5: false,\n allowS3ExistenceOptimization: false,\n onlyRetryForSameFileName: false,\n timeUrl: null,\n cryptoMd5Method: null,\n cryptoHexEncodedHash256: null,\n aws_key: null,\n awsRegion: 'us-east-1',\n awsSignatureVersion: '4',\n sendCanonicalRequestToSignerUrl: false,\n s3FileCacheHoursAgo: null, // Must be a whole number of hours. Will be interpreted as negative (hours in the past).\n signParams: {},\n signHeaders: {},\n customAuthMethod: undefined,\n maxFileSize: null,\n signResponseHandler: null,\n xhrWithCredentials: false,\n // undocumented, experimental\n localTimeOffset: undefined,\n evaporateChanged: function () {},\n abortCompletionThrottlingMs: 1000\n }, config);\n\n if (typeof window !== 'undefined' && window.console) {\n l = window.console;\n l.d = l.log;\n l.w = window.console.warn ? l.warn : l.d;\n l.e = window.console.error ? l.error : l.d;\n }\n\n this._instantiationError = this.validateEvaporateOptions();\n if (typeof this._instantiationError === 'string') {\n this.supported = false;\n return;\n } else {\n delete this._instantiationError;\n }\n\n if (!this.config.logging) {\n // Reset the logger to be a no_op\n l = noOpLogger();\n }\n\n var _d = new Date();\n HOURS_AGO = new Date(_d.setHours(_d.getHours() - (this.config.s3FileCacheHoursAgo || -100)));\n if (typeof config.localTimeOffset === 'number') {\n this.localTimeOffset = config.localTimeOffset;\n } else {\n var self = this;\n Evaporate.getLocalTimeOffset(this.config)\n .then(function (offset) {\n self.localTimeOffset = offset;\n });\n }\n this.pendingFiles = {};\n this.queuedFiles = [];\n this.filesInProcess = [];\n historyCache = new HistoryCache(this.config.mockLocalStorage);\n };\n Evaporate.create = function (config) {\n var evapConfig = extend({}, config);\n return Evaporate.getLocalTimeOffset(evapConfig)\n .then(function (offset) {\n evapConfig.localTimeOffset = offset;\n return new Promise(function (resolve, reject) {\n var e = new Evaporate(evapConfig);\n if (e.supported === true) {\n resolve(e);\n } else {\n reject(e._instantiationError);\n }\n });\n });\n };\n Evaporate.getLocalTimeOffset = function (config) {\n return new Promise(function (resolve, reject) {\n if (typeof config.localTimeOffset === 'number') {\n return resolve(config.localTimeOffset);\n }\n if (config.timeUrl) {\n var xhr = new XMLHttpRequest();\n\n xhr.open(\"GET\", config.timeUrl + '?requestTime=' + new Date().getTime());\n xhr.onreadystatechange = function () {\n if (xhr.readyState === 4) {\n if (xhr.status === 200) {\n var server_date = new Date(Date.parse(xhr.responseText)),\n offset = server_date - new Date();\n l.d('localTimeOffset is', offset, 'ms');\n resolve(offset);\n }\n }\n };\n\n xhr.onerror = function (xhr) {\n l.e('xhr error timeUrl', xhr);\n reject('Fetching offset time failed with status: ' + xhr.status);\n };\n xhr.send();\n } else {\n resolve(0);\n }\n });\n };\n Evaporate.prototype.config = {};\n Evaporate.prototype.localTimeOffset = 0;\n Evaporate.prototype.supported = false;\n Evaporate.prototype._instantiationError = undefined;\n Evaporate.prototype.evaporatingCount = 0;\n Evaporate.prototype.pendingFiles = {};\n Evaporate.prototype.filesInProcess = [];\n Evaporate.prototype.queuedFiles = [];\n Evaporate.prototype.startNextFile = function (reason) {\n if (!this.queuedFiles.length ||\n this.evaporatingCount >= this.config.maxConcurrentParts) { return; }\n var fileUpload = this.queuedFiles.shift();\n if (fileUpload.status === PENDING) {\n l.d('Starting', decodeURIComponent(fileUpload.name), 'reason:', reason);\n this.evaporatingCnt(+1);\n fileUpload.start();\n } else {\n // Add the file back to the stack, it's not ready\n l.d('Requeued', decodeURIComponent(fileUpload.name), 'status:', fileUpload.status, 'reason:', reason);\n this.queuedFiles.push(fileUpload);\n }\n };\n Evaporate.prototype.fileCleanup = function (fileUpload) {\n removeAtIndex(this.queuedFiles, fileUpload);\n if (removeAtIndex(this.filesInProcess, fileUpload)) {\n this.evaporatingCnt(-1);\n }\n fileUpload.done();\n this.consumeRemainingSlots();\n };\n Evaporate.prototype.queueFile = function (fileUpload) {\n this.filesInProcess.push(fileUpload);\n this.queuedFiles.push(fileUpload);\n if (this.filesInProcess.length === 1) {\n this.startNextFile('first file');\n }\n };\n Evaporate.prototype.add = function (file, pConfig) {\n var self = this,\n fileConfig;\n return new Promise(function (resolve, reject) {\n var c = extend(pConfig, {});\n\n IMMUTABLE_OPTIONS.forEach(function (a) { delete c[a]; });\n\n fileConfig = extend(self.config, c);\n\n if (typeof file === 'undefined' || typeof file.file === 'undefined') {\n return reject('Missing file');\n }\n if (fileConfig.maxFileSize && file.file.size > fileConfig.maxFileSize) {\n return reject('File size too large. Maximum size allowed is ' + fileConfig.maxFileSize);\n }\n if (typeof file.name === 'undefined') {\n return reject('Missing attribute: name');\n }\n\n if (fileConfig.encodeFilename) {\n // correctly encode to an S3 object name, considering '/' and ' '\n file.name = s3EncodedObjectName(file.name);\n }\n\n var fileUpload = new FileUpload(extend({\n started: function () {},\n uploadInitiated: function () {},\n progress: function () {},\n complete: function () {},\n cancelled: function () {},\n paused: function () {},\n resumed: function () {},\n pausing: function () {},\n nameChanged: function () {},\n info: function () {},\n warn: function () {},\n error: function () {},\n beforeSigner: undefined,\n xAmzHeadersAtInitiate: {},\n notSignedHeadersAtInitiate: {},\n xAmzHeadersCommon: null,\n xAmzHeadersAtUpload: {},\n xAmzHeadersAtComplete: {}\n }, file, {\n status: PENDING,\n priority: 0,\n loadedBytes: 0,\n sizeBytes: file.file.size,\n eTag: ''\n }), fileConfig, self),\n fileKey = fileUpload.id;\n\n self.pendingFiles[fileKey] = fileUpload;\n\n self.queueFile(fileUpload);\n\n // Resolve or reject the Add promise based on how the fileUpload completes\n fileUpload.deferredCompletion.promise\n .then(\n function () {\n self.fileCleanup(fileUpload);\n resolve(decodeURIComponent(fileUpload.name));\n },\n function (reason) {\n self.fileCleanup(fileUpload);\n reject(reason);\n }\n );\n })\n };\n Evaporate.prototype.cancel = function (id) {\n return typeof id === 'undefined' ? this._cancelAll() : this._cancelOne(id);\n };\n Evaporate.prototype._cancelAll = function () {\n l.d('Canceling all file uploads');\n var promises = [];\n for (var key in this.pendingFiles) {\n if (this.pendingFiles.hasOwnProperty(key)) {\n var file = this.pendingFiles[key];\n if (ACTIVE_STATUSES.indexOf(file.status) > -1) {\n promises.push(file.stop());\n }\n }\n }\n if (!promises.length) {\n promises.push(Promise.reject('No files to cancel.'));\n }\n return Promise.all(promises);\n };\n Evaporate.prototype._cancelOne = function (id) {\n var promise = [];\n if (this.pendingFiles[id]) {\n promise.push(this.pendingFiles[id].stop());\n } else {\n promise.push(Promise.reject('File does not exist'));\n }\n return Promise.all(promise);\n };\n Evaporate.prototype.pause = function (id, options) {\n options = options || {};\n var force = typeof options.force === 'undefined' ? false : options.force;\n return typeof id === 'undefined' ? this._pauseAll(force) : this._pauseOne(id, force);\n };\n Evaporate.prototype._pauseAll = function (force) {\n l.d('Pausing all file uploads');\n var promises = [];\n for (var key in this.pendingFiles) {\n if (this.pendingFiles.hasOwnProperty(key)) {\n var file = this.pendingFiles[key];\n if (ACTIVE_STATUSES.indexOf(file.status) > -1) {\n this._pause(file, force, promises);\n }\n }\n }\n return Promise.all(promises);\n };\n Evaporate.prototype._pauseOne = function (id, force) {\n var promises = [],\n file = this.pendingFiles[id];\n if (typeof file === 'undefined') {\n promises.push(Promise.reject('Cannot pause a file that has not been added.'));\n } else if (file.status === PAUSED) {\n promises.push(Promise.reject('Cannot pause a file that is already paused.'));\n }\n if (!promises.length) {\n this._pause(file, force, promises);\n }\n return Promise.all(promises);\n };\n Evaporate.prototype._pause = function(fileUpload, force, promises) {\n promises.push(fileUpload.pause(force));\n removeAtIndex(this.filesInProcess, fileUpload);\n removeAtIndex(this.queuedFiles, fileUpload);\n };\n Evaporate.prototype.resume = function (id) {\n return typeof id === 'undefined' ? this._resumeAll() : this._resumeOne(id);\n };\n Evaporate.prototype._resumeAll = function () {\n l.d('Resuming all file uploads');\n for (var key in this.pendingFiles) {\n if (this.pendingFiles.hasOwnProperty(key)) {\n var file = this.pendingFiles[key];\n if (PAUSED_STATUSES.indexOf(file.status) > -1) {\n this.resumeFile(file);\n }\n }\n }\n return Promise.resolve();\n };\n Evaporate.prototype._resumeOne = function (id) {\n var file = this.pendingFiles[id],\n promises = [];\n if (typeof file === 'undefined') {\n promises.push(Promise.reject('Cannot pause a file that does not exist.'));\n } else if (PAUSED_STATUSES.indexOf(file.status) === -1) {\n promises.push(Promise.reject('Cannot resume a file that has not been paused.'));\n } else {\n this.resumeFile(file);\n }\n return Promise.all(promises);\n };\n Evaporate.prototype.resumeFile = function (fileUpload) {\n fileUpload.resume();\n this.queueFile(fileUpload);\n };\n Evaporate.prototype.forceRetry = function () {};\n Evaporate.prototype.consumeRemainingSlots = function () {\n var avail = this.config.maxConcurrentParts - this.evaporatingCount;\n if (!avail) { return; }\n for (var i = 0; i < this.filesInProcess.length; i++) {\n var file = this.filesInProcess[i];\n var consumed = file.consumeSlots();\n if (consumed < 0) { continue; }\n avail -= consumed;\n if (!avail) { return; }\n }\n };\n Evaporate.prototype.validateEvaporateOptions = function () {\n this.supported = !(\n typeof File === 'undefined' ||\n typeof Promise === 'undefined');\n\n if (!this.supported) {\n return 'Evaporate requires support for File and Promise';\n }\n\n if (this.config.readableStreams) {\n if (typeof this.config.readableStreamPartMethod !== 'function') {\n return \"Option readableStreamPartMethod is required when readableStreams is set.\"\n }\n } else {\n if (typeof Blob === 'undefined' || typeof (\n Blob.prototype.webkitSlice ||\n Blob.prototype.mozSlice ||\n Blob.prototype.slice) === 'undefined') {\n return 'Evaporate requires support for Blob [webkitSlice || mozSlice || slice]';\n }\n }\n\n if (!this.config.signerUrl && typeof this.config.customAuthMethod !== 'function') {\n return \"Option signerUrl is required unless customAuthMethod is present.\";\n }\n\n if (!this.config.bucket) {\n return \"The AWS 'bucket' option must be present.\";\n }\n\n if (this.config.computeContentMd5) {\n this.supported = typeof FileReader.prototype.readAsArrayBuffer !== 'undefined';\n if (!this.supported) {\n return 'The browser\\'s FileReader object does not support readAsArrayBuffer';\n }\n\n if (typeof this.config.cryptoMd5Method !== 'function') {\n return 'Option computeContentMd5 has been set but cryptoMd5Method is not defined.'\n }\n\n if (this.config.awsSignatureVersion === '4') {\n if (typeof this.config.cryptoHexEncodedHash256 !== 'function') {\n return 'Option awsSignatureVersion is 4 but cryptoHexEncodedHash256 is not defined.';\n }\n }\n } else if (this.config.awsSignatureVersion === '4') {\n return 'Option awsSignatureVersion is 4 but computeContentMd5 is not enabled.';\n }\n return true;\n };\n Evaporate.prototype.evaporatingCnt = function (incr) {\n this.evaporatingCount = Math.max(0, this.evaporatingCount + incr);\n this.config.evaporateChanged(this, this.evaporatingCount);\n };\n\n\n function FileUpload(file, con, evaporate) {\n this.fileTotalBytesUploaded = 0;\n this.s3Parts = [];\n this.partsOnS3 = [];\n this.partsInProcess = [];\n this.partsToUpload = [];\n this.numParts = -1;\n this.con = extend({}, con);\n this.evaporate = evaporate;\n this.localTimeOffset = evaporate.localTimeOffset;\n this.deferredCompletion = defer();\n\n extend(this, file);\n\n this.id = decodeURIComponent(this.con.bucket + '/' + this.name);\n\n this.signParams = con.signParams;\n }\n FileUpload.prototype.con = undefined;\n FileUpload.prototype.evaporate = undefined;\n FileUpload.prototype.localTimeOffset = 0;\n FileUpload.prototype.id = undefined;\n FileUpload.prototype.status = PENDING;\n FileUpload.prototype.numParts = -1;\n FileUpload.prototype.fileTotalBytesUploaded = 0;\n FileUpload.prototype.partsInProcess = [];\n FileUpload.prototype.partsToUpload = [];\n FileUpload.prototype.s3Parts = [];\n FileUpload.prototype.partsOnS3 = [];\n FileUpload.prototype.deferredCompletion = undefined;\n FileUpload.prototype.abortedByUser = false;\n\n // Progress and Stats\n FileUpload.prototype.progressInterval = undefined;\n FileUpload.prototype.startTime = undefined;\n FileUpload.prototype.loaded = 0;\n FileUpload.prototype.totalUploaded = 0;\n FileUpload.prototype.updateLoaded = function (loadedNow) {\n this.loaded += loadedNow;\n this.fileTotalBytesUploaded += loadedNow;\n };\n FileUpload.prototype.progessStats = function () {\n // Adapted from https://github.com/fkjaekel\n // https://github.com/TTLabs/EvaporateJS/issues/13\n if (this.fileTotalBytesUploaded === 0) {\n return {\n speed: 0,\n readableSpeed: \"\",\n loaded: 0,\n totalUploaded: 0,\n remainingSize: this.sizeBytes,\n secondsLeft: -1,\n fileSize: this.sizeBytes,\n };\n }\n\n this.totalUploaded += this.loaded;\n var delta = (new Date() - this.startTime) / 1000,\n avgSpeed = this.totalUploaded / delta,\n remainingSize = this.sizeBytes - this.fileTotalBytesUploaded,\n stats = {\n speed: avgSpeed,\n readableSpeed: readableFileSize(avgSpeed),\n loaded: this.loaded,\n totalUploaded: this.fileTotalBytesUploaded,\n remainingSize: remainingSize,\n secondsLeft: -1,\n fileSize: this.sizeBytes,\n\n };\n\n if (avgSpeed > 0) {\n stats.secondsLeft = Math.round(remainingSize / avgSpeed);\n }\n\n return stats;\n };\n FileUpload.prototype.onProgress = function () {\n if ([ABORTED, PAUSED].indexOf(this.status) === -1) {\n this.progress(this.fileTotalBytesUploaded / this.sizeBytes, this.progessStats());\n this.loaded = 0;\n }\n };\n FileUpload.prototype.startMonitor = function () {\n clearInterval(this.progressInterval);\n this.startTime = new Date();\n this.loaded = 0;\n this.totalUploaded = 0;\n this.onProgress();\n this.progressInterval = setInterval(this.onProgress.bind(this), this.con.progressIntervalMS);\n };\n FileUpload.prototype.stopMonitor = function () {\n clearInterval(this.progressInterval);\n };\n\n // Evaporate proxies\n FileUpload.prototype.startNextFile = function (reason) {\n this.evaporate.startNextFile(reason);\n };\n FileUpload.prototype.evaporatingCnt = function (incr) {\n this.evaporate.evaporatingCnt(incr);\n };\n FileUpload.prototype.consumeRemainingSlots = function () {\n this.evaporate.consumeRemainingSlots();\n };\n FileUpload.prototype.getRemainingSlots = function () {\n var evapCount = this.evaporate.evaporatingCount;\n if (!this.partsInProcess.length && evapCount > 0) {\n // we can use our file slot\n evapCount -= 1;\n }\n return this.con.maxConcurrentParts - evapCount;\n };\n\n FileUpload.prototype.lastPartSatisfied = Promise.resolve('onStart');\n\n FileUpload.prototype.start = function () {\n this.status = EVAPORATING;\n this.startMonitor();\n this.started(this.id);\n\n if (this.uploadId) {\n l.d('resuming FileUpload ', this.id);\n return this.consumeSlots();\n }\n\n var awsKey = this.name;\n\n this.getUnfinishedFileUpload();\n\n var existenceOptimized = this.con.computeContentMd5 &&\n this.con.allowS3ExistenceOptimization &&\n typeof this.firstMd5Digest !== 'undefined' &&\n typeof this.eTag !== 'undefined';\n\n if (this.uploadId) {\n if (existenceOptimized) {\n return this.reuseS3Object(awsKey)\n .then(this.deferredCompletion.resolve)\n .catch(this.uploadFileFromScratch.bind(this));\n }\n\n this.resumeInterruptedUpload()\n .then(this._uploadComplete.bind(this))\n .catch(this.uploadFileFromScratch.bind(this));\n } else {\n this.uploadFileFromScratch(\"\");\n }\n };\n FileUpload.prototype.uploadFileFromScratch = function (reason) {\n if (ACTIVE_STATUSES.indexOf(this.status) === -1) { return; }\n l.d(reason);\n this.uploadId = undefined;\n return this.uploadFile(this.name)\n .then(this._uploadComplete.bind(this))\n .catch(this._abortUpload.bind(this));\n };\n FileUpload.prototype._uploadComplete = function () {\n this.completeUpload().then(this.deferredCompletion.resolve);\n };\n FileUpload.prototype.stop = function () {\n l.d('stopping FileUpload ', this.id);\n this.setStatus(CANCELED);\n this.info('Canceling uploads...');\n this.abortedByUser = true;\n var self = this;\n return this.abortUpload()\n .then(function () {\n throw(\"User aborted the upload\");\n })\n .catch(function (reason) {\n self.deferredCompletion.reject(reason);\n });\n };\n FileUpload.prototype.pause = function (force) {\n l.d('pausing FileUpload, force:', !!force, this.id);\n var promises = [];\n this.info('Pausing uploads...');\n this.status = PAUSING;\n if (force) {\n this.abortParts(true);\n } else {\n promises = this.partsInProcess.map(function (p) {\n return this.s3Parts[p].awsRequest.awsDeferred.promise\n }, this);\n this.pausing();\n }\n return Promise.all(promises)\n .then(function () {\n this.stopMonitor();\n this.status = PAUSED;\n this.startNextFile('pause');\n this.paused();\n }.bind(this));\n };\n FileUpload.prototype.resume = function () {\n this.status = PENDING;\n this.resumed();\n };\n FileUpload.prototype.done = function () {\n clearInterval(this.progressInterval);\n this.startNextFile('file done');\n this.partsOnS3 = [];\n this.s3Parts = [];\n };\n FileUpload.prototype._startCompleteUpload = function (callComplete) {\n return function () {\n var promise = callComplete ? this.completeUpload() : Promise.resolve();\n promise.then(this.deferredCompletion.resolve.bind(this));\n }\n };\n FileUpload.prototype._abortUpload = function () {\n if (!this.abortedByUser) {\n var self = this;\n this.abortUpload()\n .then(\n function () { self.deferredCompletion.reject('File upload aborted due to a part failing to upload'); },\n this.deferredCompletion.reject.bind(this));\n }\n };\n\n FileUpload.prototype.abortParts = function (pause) {\n var self = this;\n var toAbort = this.partsInProcess.slice(0);\n toAbort.forEach(function (i) {\n var s3Part = self.s3Parts[i];\n if (s3Part) {\n s3Part.awsRequest.abort();\n if (pause) { s3Part.status = PENDING; }\n removeAtIndex(self.partsInProcess, s3Part.partNumber);\n if (self.partsToUpload.length) { self.evaporatingCnt(-1); }\n }\n });\n };\n FileUpload.prototype.makeParts = function (firstPart) {\n this.numParts = Math.ceil(this.sizeBytes / this.con.partSize) || 1; // issue #58\n var partsDeferredPromises = [];\n\n var self = this;\n\n function cleanUpAfterPart(s3Part) {\n removeAtIndex(self.partsToUpload, s3Part.partNumber);\n removeAtIndex(self.partsInProcess, s3Part.partNumber);\n\n if (self.partsToUpload.length) { self.evaporatingCnt(-1); }\n }\n\n function resolve(s3Part) { return function () {\n cleanUpAfterPart(s3Part);\n if (self.partsToUpload.length) { self.consumeRemainingSlots(); }\n if (self.partsToUpload.length < self.con.maxConcurrentParts) {\n self.startNextFile('part resolve');\n }\n };\n }\n function reject(s3Part) { return function () {\n cleanUpAfterPart(s3Part);\n };\n }\n\n var limit = firstPart ? 1 : this.numParts;\n\n for (var part = 1; part <= limit; part++) {\n var s3Part = this.s3Parts[part];\n if (typeof s3Part !== \"undefined\"){\n if(s3Part.status === COMPLETE) { continue; }\n } else {\n s3Part = this.makePart(part, PENDING, this.sizeBytes);\n }\n s3Part.awsRequest = new PutPart(this, s3Part);\n s3Part.awsRequest.awsDeferred.promise\n .then(resolve(s3Part), reject(s3Part));\n\n this.partsToUpload.push(part);\n partsDeferredPromises.push(this.s3Parts[part].awsRequest.awsDeferred.promise);\n }\n\n return partsDeferredPromises;\n };\n FileUpload.prototype.makePart = function (partNumber, status, size) {\n var s3Part = {\n status: status,\n loadedBytes: 0,\n loadedBytesPrevious: null,\n isEmpty: (size === 0), // issue #58\n md5_digest: null,\n partNumber: partNumber\n };\n\n this.s3Parts[partNumber] = s3Part;\n\n return s3Part;\n };\n FileUpload.prototype.setStatus = function (s) {\n this.status = s;\n };\n\n FileUpload.prototype.createUploadFile = function () {\n if (this.status === ABORTED) { return; }\n var fileKey = uploadKey(this),\n newUpload = {\n awsKey: this.name,\n bucket: this.con.bucket,\n uploadId: this.uploadId,\n fileSize: this.sizeBytes,\n fileType: this.file.type,\n lastModifiedDate: dateISOString(this.file.lastModified),\n partSize: this.con.partSize,\n signParams: this.con.signParams,\n createdAt: new Date().toISOString()\n };\n saveUpload(fileKey, newUpload);\n };\n FileUpload.prototype.updateUploadFile = function (updates) {\n var fileKey = uploadKey(this),\n uploads = getSavedUploads(),\n upload = extend({}, uploads[fileKey], updates);\n saveUpload(fileKey, upload);\n };\n FileUpload.prototype.completeUploadFile = function (xhr) {\n var uploads = getSavedUploads(),\n upload = uploads[uploadKey(this)];\n\n if (typeof upload !== 'undefined') {\n upload.completedAt = new Date().toISOString();\n upload.eTag = this.eTag;\n upload.firstMd5Digest = this.firstMd5Digest;\n uploads[uploadKey(this)] = upload;\n historyCache.setItem('awsUploads', JSON.stringify(uploads));\n }\n\n this.complete(xhr, this.name, this.progessStats());\n this.setStatus(COMPLETE);\n this.onProgress();\n };\n FileUpload.prototype.removeUploadFile = function (){\n if (typeof this.file !== 'undefined') {\n removeUpload(uploadKey(this));\n }\n };\n FileUpload.prototype.getUnfinishedFileUpload = function () {\n var savedUploads = getSavedUploads(true),\n u = savedUploads[uploadKey(this)];\n\n if (this.canRetryUpload(u)) {\n this.uploadId = u.uploadId;\n this.name = u.awsKey;\n this.eTag = u.eTag;\n this.firstMd5Digest = u.firstMd5Digest;\n this.signParams = u.signParams;\n }\n };\n FileUpload.prototype.canRetryUpload = function (u) {\n // Must be the same file name, file size, last_modified, file type as previous upload\n if (typeof u === 'undefined') {\n return false;\n }\n var completedAt = new Date(u.completedAt || FAR_FUTURE);\n\n // check that the part sizes and bucket match, and if the file name of the upload\n // matches if onlyRetryForSameFileName is true\n return this.con.partSize === u.partSize &&\n completedAt > HOURS_AGO &&\n this.con.bucket === u.bucket &&\n (this.con.onlyRetryForSameFileName ? this.name === u.awsKey : true);\n };\n\n FileUpload.prototype.partSuccess = function (eTag, putRequest) {\n var part = putRequest.part;\n l.d(putRequest.request.step, 'ETag:', eTag);\n if (part.isEmpty || (eTag !== ETAG_OF_0_LENGTH_BLOB)) { // issue #58\n part.eTag = eTag;\n part.status = COMPLETE;\n this.partsOnS3.push(part);\n return true;\n } else {\n part.status = ERROR;\n putRequest.resetLoadedBytes();\n var msg = ['eTag matches MD5 of 0 length blob for part #', putRequest.partNumber, 'Retrying part.'].join(\" \");\n l.w(msg);\n this.warn(msg);\n }\n };\n FileUpload.prototype.listPartsSuccess = function (listPartsRequest, partsXml) {\n this.info('uploadId', this.uploadId, 'is not complete. Fetching parts from part marker', listPartsRequest.partNumberMarker);\n partsXml = partsXml.replace(/(\\r\\n|\\n|\\r)/gm, \"\"); // strip line breaks to ease the regex requirements\n var partRegex = /(.+?)<\\/Part\\>/g;\n\n while (true) {\n var cp = (partRegex.exec(partsXml) || [])[1];\n if (!cp) { break; }\n\n var partSize = parseInt(elementText(cp, \"Size\"), 10);\n this.fileTotalBytesUploaded += partSize;\n this.partsOnS3.push({\n eTag: elementText(cp, \"ETag\").replace(/"/g, '\"'),\n partNumber: parseInt(elementText(cp, \"PartNumber\"), 10),\n size: partSize,\n LastModified: elementText(cp, \"LastModified\")\n });\n }\n return elementText(partsXml, \"IsTruncated\") === 'true' ? elementText(partsXml, \"NextPartNumberMarker\") : undefined;\n };\n FileUpload.prototype.makePartsfromPartsOnS3 = function () {\n if (ACTIVE_STATUSES.indexOf(this.status) === -1) { return; }\n this.nameChanged(this.name);\n this.partsOnS3.forEach(function (cp) {\n var uploadedPart = this.makePart(cp.partNumber, COMPLETE, cp.size);\n uploadedPart.eTag = cp.eTag;\n uploadedPart.loadedBytes = cp.size;\n uploadedPart.loadedBytesPrevious = cp.size;\n uploadedPart.finishedUploadingAt = cp.LastModified;\n }.bind(this));\n };\n FileUpload.prototype.completeUpload = function () {\n var self = this;\n return new CompleteMultipartUpload(this)\n .send()\n .then(\n function (xhr) {\n self.eTag = elementText(xhr.responseText, \"ETag\").replace(/"/g, '\"');\n self.completeUploadFile(xhr);\n });\n };\n FileUpload.prototype.getCompletedPayload = function () {\n var completeDoc = [];\n completeDoc.push('');\n this.s3Parts.forEach(function (part, partNumber) {\n if (partNumber > 0) {\n ['', partNumber, '', part.eTag, '']\n .forEach(function (a) { completeDoc.push(a); });\n }\n });\n completeDoc.push('');\n\n return completeDoc.join(\"\");\n };\n FileUpload.prototype.consumeSlots = function () {\n if (this.partsToUpload.length === 0) { return -1 }\n if (this.partsToUpload.length !== this.partsInProcess.length &&\n this.status === EVAPORATING) {\n\n var partsToUpload = Math.min(this.getRemainingSlots(), this.partsToUpload.length);\n\n if (!partsToUpload) { return -1; }\n\n var satisfied = 0;\n for (var i = 0; i < this.partsToUpload.length; i++) {\n var s3Part = this.s3Parts[this.partsToUpload[i]];\n\n if (s3Part.status === EVAPORATING) { continue; }\n\n if (this.canStartPart(s3Part)) {\n if (this.partsInProcess.length && this.partsToUpload.length > 1) {\n this.evaporatingCnt(+1);\n }\n this.partsInProcess.push(s3Part.partNumber);\n var awsRequest = s3Part.awsRequest;\n this.lastPartSatisfied.then(awsRequest.delaySend.bind(awsRequest));\n this.lastPartSatisfied = awsRequest.getStartedPromise();\n } else { continue; }\n\n satisfied += 1;\n\n if (satisfied === partsToUpload) { break; }\n\n }\n var allInProcess = this.partsToUpload.length === this.partsInProcess.length,\n remainingSlots = this.getRemainingSlots();\n if (allInProcess && remainingSlots > 0) {\n // We don't need any more slots...\n this.startNextFile('consume slots');\n }\n return remainingSlots;\n }\n return 0;\n };\n FileUpload.prototype.canStartPart = function (part) {\n return this.partsInProcess.indexOf(part.partNumber) === -1 && !part.awsRequest.errorExceptionStatus();\n };\n FileUpload.prototype.uploadFile = function (awsKey) {\n this.removeUploadFile();\n var self = this;\n return new InitiateMultipartUpload(self, awsKey)\n .send()\n .then(\n function () {\n self.uploadInitiated(self.uploadId);\n self.partsToUpload = [];\n return self.uploadParts()\n .then(\n function () {},\n function (reason) {\n throw(reason);\n })\n });\n };\n FileUpload.prototype.uploadParts = function () {\n this.loaded = 0;\n this.totalUploaded = 0;\n if (ACTIVE_STATUSES.indexOf(this.status) === -1) {\n return Promise.reject('Part uploading stopped because the file was canceled');\n }\n var promises = this.makeParts();\n this.setStatus(EVAPORATING);\n this.startTime = new Date();\n this.consumeSlots();\n return Promise.all(promises);\n };\n FileUpload.prototype.abortUpload = function () {\n return new Promise(function (resolve, reject) {\n\n if(typeof this.uploadId === 'undefined') {\n resolve();\n return;\n }\n\n new DeleteMultipartUpload(this)\n .send()\n .then(resolve, reject);\n }.bind(this))\n .then(\n function () {\n this.setStatus(ABORTED);\n this.cancelled();\n this.removeUploadFile();\n }.bind(this),\n this.deferredCompletion.reject.bind(this));\n };\n FileUpload.prototype.resumeInterruptedUpload = function () {\n return new ResumeInterruptedUpload(this)\n .send()\n .then(this.uploadParts.bind(this));\n };\n FileUpload.prototype.reuseS3Object = function (awsKey) {\n var self = this;\n // Attempt to reuse entire uploaded object on S3\n this.makeParts(1);\n this.partsToUpload = [];\n var firstS3Part = this.s3Parts[1];\n function reject(reason) {\n self.name = awsKey;\n throw(reason);\n }\n return firstS3Part.awsRequest.getPartMd5Digest()\n .then(function () {\n if (self.firstMd5Digest === firstS3Part.md5_digest) {\n return new ReuseS3Object(self, awsKey)\n .send()\n .then(\n function (xhr) {\n l.d('headObject found matching object on S3.');\n self.completeUploadFile(xhr);\n self.nameChanged(self.name);\n })\n .catch(reject);\n\n } else {\n var msg = self.con.allowS3ExistenceOptimization ? 'File\\'s first part MD5 digest does not match what was stored.' : 'allowS3ExistenceOptimization is not enabled.';\n reject(msg);\n }\n });\n };\n\n\n function SignedS3AWSRequest(fileUpload, request) {\n this.fileUpload = fileUpload;\n this.con = fileUpload.con;\n this.attempts = 1;\n this.localTimeOffset = this.fileUpload.localTimeOffset;\n this.awsDeferred = defer();\n this.started = defer();\n\n this.awsUrl = awsUrl(this.con);\n this.awsHost = uri(this.awsUrl).hostname;\n\n var r = extend({}, request);\n if (fileUpload.contentType) {\n r.contentType = fileUpload.contentType;\n }\n\n this.updateRequest(r);\n }\n SignedS3AWSRequest.prototype.fileUpload = undefined;\n SignedS3AWSRequest.prototype.con = undefined;\n SignedS3AWSRequest.prototype.awsUrl = undefined;\n SignedS3AWSRequest.prototype.awsHost = undefined;\n SignedS3AWSRequest.prototype.authorize = function () {};\n SignedS3AWSRequest.prototype.localTimeOffset = 0;\n SignedS3AWSRequest.prototype.awsDeferred = undefined;\n SignedS3AWSRequest.prototype.started = undefined;\n SignedS3AWSRequest.prototype.getPath = function () {\n var path = '/' + this.con.bucket + '/' + this.fileUpload.name;\n if (this.con.cloudfront || this.awsUrl.indexOf('cloudfront') > -1) {\n path = '/' + this.fileUpload.name;\n }\n return path;\n };\n\n SignedS3AWSRequest.prototype.updateRequest = function (request) {\n this.request = request;\n var SigningClass = signingVersion(this, l);\n this.signer = new SigningClass(request);\n };\n SignedS3AWSRequest.prototype.success = function () { this.awsDeferred.resolve(this.currentXhr); };\n SignedS3AWSRequest.prototype.backOffWait = function () {\n return (this.attempts === 1) ? 0 : 1000 * Math.min(\n this.con.maxRetryBackoffSecs,\n Math.pow(this.con.retryBackoffPower, this.attempts - 2)\n );\n };\n SignedS3AWSRequest.prototype.error = function (reason) {\n if (this.errorExceptionStatus()) {\n return;\n }\n\n this.signer.error();\n l.d(this.request.step, 'error:', this.fileUpload.id, reason);\n\n if (typeof this.errorHandler(reason) !== 'undefined' ) {\n return;\n }\n\n this.fileUpload.warn('Error in ', this.request.step, reason);\n this.fileUpload.setStatus(ERROR);\n\n var self = this,\n backOffWait = this.backOffWait();\n this.attempts += 1;\n\n setTimeout(function () {\n if (!self.errorExceptionStatus()) { self.trySend(); }\n }, backOffWait);\n };\n SignedS3AWSRequest.prototype.errorHandler = function () { };\n SignedS3AWSRequest.prototype.errorExceptionStatus = function () { return false; };\n SignedS3AWSRequest.prototype.getPayload = function () { return Promise.resolve(null); };\n SignedS3AWSRequest.prototype.success_status = function (xhr) {\n return (xhr.status >= 200 && xhr.status <= 299) ||\n this.request.success404 && xhr.status === 404;\n };\n SignedS3AWSRequest.prototype.stringToSign = function () {\n return encodeURIComponent(this.signer.stringToSign());\n };\n SignedS3AWSRequest.prototype.canonicalRequest = function () {\n return this.signer.canonicalRequest();\n }\n SignedS3AWSRequest.prototype.signResponse = function(payload, stringToSign, signatureDateTime) {\n var self = this;\n return new Promise(function (resolve) {\n if (typeof self.con.signResponseHandler === 'function') {\n return self.con.signResponseHandler(payload, stringToSign, signatureDateTime)\n .then(resolve);\n }\n resolve(payload);\n });\n };\n SignedS3AWSRequest.prototype.sendRequestToAWS = function () {\n var self = this;\n return new Promise( function (resolve, reject) {\n var xhr = new XMLHttpRequest();\n self.currentXhr = xhr;\n\n var url = [self.awsUrl, self.getPath(), self.request.path].join(\"\"),\n all_headers = {};\n\n if (self.request.query_string) {\n url += self.request.query_string;\n }\n extend(all_headers, self.request.not_signed_headers);\n extend(all_headers, self.request.x_amz_headers);\n\n xhr.onreadystatechange = function () {\n if (xhr.readyState === 4) {\n\n if (self.success_status(xhr)) {\n if (self.request.response_match &&\n xhr.response.match(new RegExp(self.request.response_match)) === undefined) {\n reject('AWS response does not match set pattern: ' + self.request.response_match);\n } else {\n resolve();\n }\n } else {\n var reason = xhr.responseText ? getAwsResponse(xhr) : ' ';\n reason += 'status:' + xhr.status;\n reject(reason);\n }\n }\n };\n\n xhr.open(self.request.method, url);\n xhr.setRequestHeader('Authorization', self.signer.authorizationString());\n\n for (var key in all_headers) {\n if (all_headers.hasOwnProperty(key)) {\n xhr.setRequestHeader(key, all_headers[key]);\n }\n }\n\n self.signer.setHeaders(xhr);\n\n if (self.request.contentType) {\n xhr.setRequestHeader('Content-Type', self.request.contentType);\n }\n\n if (self.request.md5_digest) {\n xhr.setRequestHeader('Content-MD5', self.request.md5_digest);\n }\n xhr.onerror = function (xhr) {\n var reason = xhr.responseText ? getAwsResponse(xhr) : 'transport error';\n reject(reason);\n };\n\n if (typeof self.request.onProgress === 'function') {\n xhr.upload.onprogress = self.request.onProgress;\n }\n\n self.getPayload()\n .then(xhr.send.bind(xhr), reject);\n\n setTimeout(function () { // We have to delay here or Safari will hang\n self.started.resolve('request sent ' + self.request.step);\n }, 20);\n self.signer.payload = null;\n self.payloadPromise = undefined;\n });\n };\n //see: http://docs.amazonwebservices.com/AmazonS3/latest/dev/RESTAuthentication.html#ConstructingTheAuthenticationHeader\n SignedS3AWSRequest.prototype.authorize = function () {\n this.request.dateString = this.signer.dateString(this.localTimeOffset);\n this.request.x_amz_headers = extend(this.request.x_amz_headers, {\n 'x-amz-date': this.request.dateString\n });\n return this.signer.getPayload()\n .then(function () {\n return authorizationMethod(this).authorize();\n }.bind(this));\n };\n SignedS3AWSRequest.prototype.authorizationSuccess = function (authorization) {\n l.d(this.request.step, 'signature:', authorization);\n this.request.auth = authorization;\n };\n SignedS3AWSRequest.prototype.trySend = function () {\n var self = this;\n return this.authorize()\n .then(\n function (value) {\n self.authorizationSuccess(value);\n if (self.fileUpload.status === ABORTED) { return; }\n self.sendRequestToAWS().then(self.success.bind(self), self.error.bind(self));\n },\n self.error.bind(self));\n };\n SignedS3AWSRequest.prototype.send = function () {\n this.trySend();\n return this.awsDeferred.promise;\n };\n\n function CancelableS3AWSRequest(fileUpload, request) {\n SignedS3AWSRequest.call(this, fileUpload, request);\n }\n CancelableS3AWSRequest.prototype = Object.create(SignedS3AWSRequest.prototype);\n CancelableS3AWSRequest.prototype.constructor = CancelableS3AWSRequest;\n CancelableS3AWSRequest.prototype.errorExceptionStatus = function () {\n return [ABORTED, CANCELED].indexOf(this.fileUpload.status) > -1;\n };\n\n function SignedS3AWSRequestWithRetryLimit(fileUpload, request, maxRetries) {\n if (maxRetries > -1) {\n this.maxRetries = maxRetries;\n }\n SignedS3AWSRequest.call(this, fileUpload, request);\n }\n SignedS3AWSRequestWithRetryLimit.prototype = Object.create(CancelableS3AWSRequest.prototype);\n SignedS3AWSRequestWithRetryLimit.prototype.constructor = SignedS3AWSRequestWithRetryLimit;\n SignedS3AWSRequestWithRetryLimit.prototype.maxRetries = 1;\n SignedS3AWSRequestWithRetryLimit.prototype.errorHandler = function (reason) {\n if (this.attempts > this.maxRetries) {\n var msg = ['MaxRetries exceeded. Will re-upload file id ', this.fileUpload.id, ', ', reason].join(\"\");\n l.w(msg);\n this.awsDeferred.reject(msg);\n return true;\n }\n };\n SignedS3AWSRequestWithRetryLimit.prototype.rejectedSuccess = function () {\n var reason = Array.prototype.slice.call(arguments, 1).join(\"\");\n this.awsDeferred.reject(reason);\n return false;\n };\n\n // see: http://docs.amazonwebservices.com/AmazonS3/latest/API/mpUploadInitiate.html\n function InitiateMultipartUpload(fileUpload, awsKey) {\n var request = {\n method: 'POST',\n path: '?uploads',\n step: 'initiate',\n x_amz_headers: fileUpload.xAmzHeadersAtInitiate,\n not_signed_headers: fileUpload.notSignedHeadersAtInitiate,\n response_match: '(.+)<\\/UploadId>'\n };\n\n CancelableS3AWSRequest.call(this, fileUpload, request);\n this.awsKey = awsKey;\n }\n InitiateMultipartUpload.prototype = Object.create(CancelableS3AWSRequest.prototype);\n InitiateMultipartUpload.prototype.constructor = InitiateMultipartUpload;\n InitiateMultipartUpload.prototype.success = function () {\n var match = this.currentXhr.response.match(new RegExp(this.request.response_match));\n this.fileUpload.uploadId = match[1];\n this.fileUpload.awsKey = this.awsKey;\n l.d('InitiateMultipartUpload ID is', this.fileUpload.uploadId);\n this.fileUpload.createUploadFile();\n this.awsDeferred.resolve(this.currentXhr);\n };\n\n //http://docs.amazonwebservices.com/AmazonS3/latest/API/mpUploadComplete.html\n function CompleteMultipartUpload(fileUpload) {\n fileUpload.info('will attempt to complete upload');\n var request = {\n method: 'POST',\n contentType: 'application/xml; charset=UTF-8',\n path: '?uploadId=' + fileUpload.uploadId,\n x_amz_headers: fileUpload.xAmzHeadersCommon || fileUpload.xAmzHeadersAtComplete,\n step: 'complete'\n };\n CancelableS3AWSRequest.call(this, fileUpload, request);\n }\n CompleteMultipartUpload.prototype = Object.create(CancelableS3AWSRequest.prototype);\n CompleteMultipartUpload.prototype.constructor = CompleteMultipartUpload;\n CompleteMultipartUpload.prototype.getPayload = function () {\n return Promise.resolve(this.fileUpload.getCompletedPayload());\n };\n\n //http://docs.amazonwebservices.com/AmazonS3/latest/API/mpUploadComplete.html\n function ReuseS3Object(fileUpload, awsKey) {\n this.awsKey = awsKey;\n\n fileUpload.info('will attempt to verify existence of the file');\n\n var request = {\n method: 'HEAD',\n path: '',\n x_amz_headers: fileUpload.xAmzHeadersCommon,\n success404: true,\n step: 'head_object'\n };\n\n SignedS3AWSRequestWithRetryLimit.call(this, fileUpload, request);\n }\n ReuseS3Object.prototype = Object.create(SignedS3AWSRequestWithRetryLimit.prototype);\n ReuseS3Object.prototype.constructor = ReuseS3Object;\n ReuseS3Object.prototype.awsKey = undefined;\n ReuseS3Object.prototype.success = function () {\n var eTag = this.currentXhr.getResponseHeader('Etag');\n if (eTag !== this.fileUpload.eTag &&\n !this.rejectedSuccess('uploadId ', this.fileUpload.id, ' found on S3 but the Etag doesn\\'t match.')) { return; }\n this.awsDeferred.resolve(this.currentXhr);\n };\n\n //http://docs.amazonwebservices.com/AmazonS3/latest/API/mpUploadListParts.html\n function ResumeInterruptedUpload(fileUpload) {\n SignedS3AWSRequestWithRetryLimit.call(this, fileUpload);\n this.updateRequest(this.setupRequest(0));\n }\n ResumeInterruptedUpload.prototype = Object.create(SignedS3AWSRequestWithRetryLimit.prototype);\n ResumeInterruptedUpload.prototype.constructor = ResumeInterruptedUpload;\n ResumeInterruptedUpload.prototype.awsKey = undefined;\n ResumeInterruptedUpload.prototype.partNumberMarker = 0;\n ResumeInterruptedUpload.prototype.setupRequest = function (partNumberMarker) {\n var msg = ['setupRequest() for uploadId:', this.fileUpload.uploadId, 'for part marker:', partNumberMarker].join(\" \");\n l.d(msg);\n\n this.fileUpload.info(msg);\n\n this.awsKey = this.fileUpload.name;\n this.partNumberMarker = partNumberMarker;\n\n var request = {\n method: 'GET',\n path: ['?uploadId=', this.fileUpload.uploadId].join(\"\"),\n query_string: \"&part-number-marker=\" + partNumberMarker,\n x_amz_headers: this.fileUpload.xAmzHeadersCommon,\n step: 'get upload parts',\n success404: true\n };\n\n this.request = request;\n return request;\n };\n ResumeInterruptedUpload.prototype.success = function () {\n if (this.currentXhr.status === 404) {\n // Success! Upload is no longer recognized, so there is nothing to fetch\n if (this.rejectedSuccess('uploadId ', this.fileUpload.id, ' not found on S3.')) { this.awsDeferred.resolve(this.currentXhr); }\n return;\n }\n\n var nextPartNumber = this.fileUpload.listPartsSuccess(this, this.currentXhr.responseText);\n if (nextPartNumber) {\n var request = this.setupRequest(nextPartNumber); // let's fetch the next set of parts\n this.updateRequest(request);\n this.trySend();\n } else {\n this.fileUpload.makePartsfromPartsOnS3();\n this.awsDeferred.resolve(this.currentXhr);\n }\n };\n\n //http://docs.aws.amazon.com/AmazonS3/latest/API/mpUploadUploadPart.html\n function PutPart(fileUpload, part) {\n this.part = part;\n\n this.partNumber = part.partNumber;\n this.start = (this.partNumber - 1) * fileUpload.con.partSize;\n this.end = Math.min(this.partNumber * fileUpload.con.partSize, fileUpload.sizeBytes);\n\n var request = {\n method: 'PUT',\n path: '?partNumber=' + this.partNumber + '&uploadId=' + fileUpload.uploadId,\n step: 'upload #' + this.partNumber,\n x_amz_headers: fileUpload.xAmzHeadersCommon || fileUpload.xAmzHeadersAtUpload,\n contentSha256: \"UNSIGNED-PAYLOAD\",\n onProgress: this.onProgress.bind(this)\n };\n\n SignedS3AWSRequest.call(this, fileUpload, request);\n }\n PutPart.prototype = Object.create(SignedS3AWSRequest.prototype);\n PutPart.prototype.constructor = PutPart;\n PutPart.prototype.part = 1;\n PutPart.prototype.payloadPromise = undefined;\n PutPart.prototype.start = 0;\n PutPart.prototype.end = 0;\n PutPart.prototype.partNumber = undefined;\n PutPart.prototype.getPartMd5Digest = function () {\n var self = this,\n part = this.part;\n return new Promise(function (resolve, reject) {\n if (self.con.computeContentMd5 && !part.md5_digest) {\n self.getPayload()\n .then(function (data) {\n var md5_digest = self.con.cryptoMd5Method(data);\n if (self.partNumber === 1 && self.con.computeContentMd5 && typeof self.fileUpload.firstMd5Digest === \"undefined\") {\n self.fileUpload.firstMd5Digest = md5_digest;\n self.fileUpload.updateUploadFile({firstMd5Digest: md5_digest})\n }\n resolve(md5_digest);\n }, reject);\n } else {\n resolve(part.md5_digest);\n }\n }).then(function (md5_digest) {\n if (md5_digest) {\n l.d(self.request.step, 'MD5 digest:', md5_digest);\n self.request.md5_digest = md5_digest;\n self.part.md5_digest = md5_digest;\n }\n });\n };\n PutPart.prototype.sendRequestToAWS = function () {\n this.stalledInterval = setInterval(this.stalledPartMonitor(), PARTS_MONITOR_INTERVAL_MS);\n this.stalledPartMonitor();\n return SignedS3AWSRequest.prototype.sendRequestToAWS.call(this);\n };\n PutPart.prototype.send = function () {\n if (this.part.status !== COMPLETE &&\n [ABORTED, PAUSED, CANCELED].indexOf(this.fileUpload.status) === -1\n ) {\n l.d('uploadPart #', this.partNumber, this.attempts === 1 ? 'submitting' : 'retrying');\n\n this.part.status = EVAPORATING;\n this.attempts += 1;\n this.part.loadedBytesPrevious = null;\n\n var self = this;\n return this.getPartMd5Digest()\n .then(function () {\n l.d('Sending', self.request.step);\n SignedS3AWSRequest.prototype.send.call(self);\n });\n }\n };\n PutPart.prototype.success = function () {\n clearInterval(this.stalledInterval);\n var eTag = this.currentXhr.getResponseHeader('ETag');\n this.currentXhr = null;\n if (this.fileUpload.partSuccess(eTag, this)) { this.awsDeferred.resolve(this.currentXhr); }\n };\n PutPart.prototype.onProgress = function (evt) {\n if (evt.loaded > 0) {\n var loadedNow = evt.loaded - this.part.loadedBytes;\n if (loadedNow) {\n this.part.loadedBytes = evt.loaded;\n this.fileUpload.updateLoaded(loadedNow);\n }\n }\n };\n PutPart.prototype.stalledPartMonitor = function () {\n var lastLoaded = this.part.loadedBytes;\n var self = this;\n return function () {\n clearInterval(self.stalledInterval);\n if ([EVAPORATING, ERROR, PAUSING, PAUSED].indexOf(self.fileUpload.status) === -1 &&\n self.part.status !== ABORTED &&\n self.part.loadedBytes < this.size) {\n if (lastLoaded === self.part.loadedBytes) {\n l.w('Part stalled. Will abort and retry:', self.partNumber, decodeURIComponent(self.fileUpload.name));\n self.abort();\n if (!self.errorExceptionStatus()) {\n self.delaySend();\n }\n } else {\n self.stalledInterval = setInterval(self.stalledPartMonitor(), PARTS_MONITOR_INTERVAL_MS);\n }\n }\n }\n };\n PutPart.prototype.resetLoadedBytes = function () {\n this.fileUpload.updateLoaded(-this.part.loadedBytes);\n this.part.loadedBytes = 0;\n this.fileUpload.onProgress();\n };\n PutPart.prototype.errorExceptionStatus = function () {\n return [CANCELED, ABORTED, PAUSED, PAUSING].indexOf(this.fileUpload.status) > -1;\n };\n PutPart.prototype.delaySend = function () {\n var backOffWait = this.backOffWait();\n this.attempts += 1;\n setTimeout(this.send.bind(this), backOffWait);\n };\n PutPart.prototype.errorHandler = function (reason) {\n clearInterval(this.stalledInterval);\n if (reason.match(/status:404/)) {\n var errMsg = '404 error on part PUT. The part and the file will abort. ' + reason;\n l.w(errMsg);\n this.fileUpload.error(errMsg);\n this.part.status = ABORTED;\n this.awsDeferred.reject(errMsg);\n return true;\n }\n this.resetLoadedBytes();\n this.part.status = ERROR;\n\n if (!this.errorExceptionStatus()) {\n this.delaySend();\n }\n return true;\n };\n PutPart.prototype.abort = function () {\n if (this.currentXhr) {\n this.currentXhr.abort();\n }\n this.resetLoadedBytes();\n this.attempts = 1;\n };\n PutPart.size = 0;\n PutPart.prototype.streamToArrayBuffer = function (stream) {\n return new Promise(function (resolve, reject) {\n // stream is empty or ended\n if (!stream.readable) { return resolve([]); }\n\n var arr = new Uint8Array(Math.min(this.con.partSize, this.end - this.start)),\n i = 0;\n stream.on('data', onData);\n stream.on('end', onEnd);\n stream.on('error', onEnd);\n stream.on('close', onClose);\n\n function onData(data) {\n if (data.byteLength === 1) { return; }\n arr.set(data, i);\n i += data.byteLength;\n }\n\n function onEnd(err) {\n if (err) { reject(err); }\n else { resolve(arr); }\n cleanup();\n }\n\n function onClose() {\n resolve(arr);\n cleanup();\n }\n\n function cleanup() {\n arr = null;\n stream.removeListener('data', onData);\n stream.removeListener('end', onEnd);\n stream.removeListener('error', onEnd);\n stream.removeListener('close', onClose);\n }\n }.bind(this));\n };\n PutPart.prototype.getPayload = function () {\n if (typeof this.payloadPromise === 'undefined') {\n this.payloadPromise = this.con.readableStreams ? this.payloadFromStream() : this.payloadFromBlob();\n }\n return this.payloadPromise;\n };\n PutPart.prototype.payloadFromStream = function () {\n var stream = this.con.readableStreamPartMethod(this.fileUpload.file, this.start, this.end - 1);\n return new Promise(function (resolve, reject) {\n var streamPromise = this.streamToArrayBuffer(stream);\n streamPromise.then(function (data) {\n resolve(data);\n }.bind(this), reject);\n }.bind(this));\n };\n PutPart.prototype.payloadFromBlob = function () {\n // browsers' implementation of the Blob.slice function has been renamed a couple of times, and the meaning of the\n // 2nd parameter changed. For example Gecko went from slice(start,length) -> mozSlice(start, end) -> slice(start, end).\n // As of 12/12/12, it seems that the unified 'slice' is the best bet, hence it being first in the list. See\n // https://developer.mozilla.org/en-US/docs/DOM/Blob for more info.\n var file = this.fileUpload.file,\n slicerFn = (file.slice ? 'slice' : (file.mozSlice ? 'mozSlice' : 'webkitSlice')),\n blob = file[slicerFn](this.start, this.end);\n if (this.con.computeContentMd5) {\n return new Promise(function (resolve) {\n var reader = new FileReader();\n reader.onloadend = function () {\n var buffer = this.result && typeof this.result.buffer !== 'undefined',\n result = buffer ? new Uint8Array(this.result.buffer) : this.result;\n resolve(result);\n };\n reader.readAsArrayBuffer(blob);\n });\n }\n return Promise.resolve(blob);\n };\n PutPart.prototype.stalledInterval = -1;\n PutPart.prototype.getStartedPromise = function () {\n return this.started.promise;\n };\n\n\n //http://docs.amazonwebservices.com/AmazonS3/latest/API/mpUploadAbort.html\n function DeleteMultipartUpload(fileUpload) {\n fileUpload.info('will attempt to abort the upload');\n\n fileUpload.abortParts();\n\n var request = {\n method: 'DELETE',\n path: '?uploadId=' + fileUpload.uploadId,\n x_amz_headers: fileUpload.xAmzHeadersCommon,\n success404: true,\n step: 'abort'\n };\n\n SignedS3AWSRequest.call(this, fileUpload, request);\n }\n DeleteMultipartUpload.prototype = Object.create(SignedS3AWSRequest.prototype);\n DeleteMultipartUpload.prototype.constructor = DeleteMultipartUpload;\n DeleteMultipartUpload.prototype.maxRetries = 1;\n DeleteMultipartUpload.prototype.success = function () {\n this.fileUpload.setStatus(ABORTED);\n this.awsDeferred.resolve(this.currentXhr);\n };\n DeleteMultipartUpload.prototype.errorHandler = function (reason) {\n if (this.attempts > this.maxRetries) {\n var msg = 'Error aborting upload, Exceeded retries deleting the file upload: ' + reason;\n l.w(msg);\n this.fileUpload.error(msg);\n this.awsDeferred.reject(msg);\n return true;\n }\n };\n\n function signingVersion(awsRequest, l) {\n var con = awsRequest.con;\n function AwsSignature(request) {\n this.request = request;\n }\n AwsSignature.prototype.request = {};\n AwsSignature.prototype.error = function () {};\n AwsSignature.prototype.authorizationString = function () {};\n AwsSignature.prototype.stringToSign = function () {};\n AwsSignature.prototype.canonicalRequest = function () {};\n AwsSignature.prototype.setHeaders = function () {};\n AwsSignature.prototype.datetime = function (timeOffset) {\n return new Date(new Date().getTime() + timeOffset);\n\n };\n AwsSignature.prototype.dateString = function (timeOffset) {\n return this.datetime(timeOffset).toISOString().slice(0, 19).replace(/-|:/g, '') + \"Z\";\n };\n\n function AwsSignatureV2(request) {\n AwsSignature.call(this, request);\n }\n AwsSignatureV2.prototype = Object.create(AwsSignature.prototype);\n AwsSignatureV2.prototype.constructor = AwsSignatureV2;\n AwsSignatureV2.prototype.authorizationString = function () {\n return ['AWS ', con.aws_key, ':', this.request.auth].join('');\n };\n AwsSignatureV2.prototype.stringToSign = function () {\n var x_amz_headers = '', result, header_key_array = [];\n\n for (var key in this.request.x_amz_headers) {\n if (this.request.x_amz_headers.hasOwnProperty(key)) {\n header_key_array.push(key);\n }\n }\n header_key_array.sort();\n\n header_key_array.forEach(function (header_key) {\n x_amz_headers += (header_key + ':' + this.request.x_amz_headers[header_key] + '\\n');\n }.bind(this));\n\n result = this.request.method + '\\n' +\n (this.request.md5_digest || '') + '\\n' +\n (this.request.contentType || '') + '\\n' +\n '\\n' +\n x_amz_headers +\n (con.cloudfront ? '/' + con.bucket : '') +\n awsRequest.getPath() + this.request.path;\n\n l.d('V2 stringToSign:', result);\n return result;\n\n };\n AwsSignatureV2.prototype.dateString = function (timeOffset) {\n return this.datetime(timeOffset).toUTCString();\n };\n AwsSignatureV2.prototype.getPayload = function () { return Promise.resolve(); };\n\n function AwsSignatureV4(request) {\n this._cr = undefined\n AwsSignature.call(this, request);\n }\n AwsSignatureV4.prototype = Object.create(AwsSignature.prototype);\n AwsSignatureV4.prototype.constructor = AwsSignatureV4;\n AwsSignatureV4.prototype._cr = undefined;\n AwsSignatureV4.prototype.payload = null;\n AwsSignatureV4.prototype.error = function () { this._cr = undefined; };\n AwsSignatureV4.prototype.getPayload = function () {\n return awsRequest.getPayload()\n .then(function (data) {\n this.payload = data;\n }.bind(this));\n };\n AwsSignatureV4.prototype.authorizationString = function () {\n var authParts = [];\n\n var credentials = this.credentialString();\n var headers = this.canonicalHeaders();\n\n authParts.push(['AWS4-HMAC-SHA256 Credential=', con.aws_key, '/', credentials].join(''));\n authParts.push('SignedHeaders=' + headers.signedHeaders);\n authParts.push('Signature=' + this.request.auth);\n\n return authParts.join(', ');\n };\n AwsSignatureV4.prototype.stringToSign = function () {\n var signParts = [];\n signParts.push('AWS4-HMAC-SHA256');\n signParts.push(this.request.dateString);\n signParts.push(this.credentialString());\n signParts.push(con.cryptoHexEncodedHash256(this.canonicalRequest()));\n var result = signParts.join('\\n');\n\n l.d('V4 stringToSign:', result);\n return result;\n };\n AwsSignatureV4.prototype.credentialString = function () {\n var credParts = [];\n\n credParts.push(this.request.dateString.slice(0, 8));\n credParts.push(con.awsRegion);\n credParts.push('s3');\n credParts.push('aws4_request');\n return credParts.join('/');\n };\n AwsSignatureV4.prototype.canonicalQueryString = function () {\n var qs = awsRequest.request.query_string || '',\n search = uri([awsRequest.awsUrl, this.request.path, qs].join(\"\")).search,\n searchParts = search.length ? search.split('&') : [],\n encoded = [],\n nameValue,\n i;\n\n for (i = 0; i < searchParts.length; i++) {\n nameValue = searchParts[i].split(\"=\");\n encoded.push({\n name: encodeURIComponent(nameValue[0]),\n value: nameValue.length > 1 ? encodeURIComponent(nameValue[1]) : null\n })\n }\n var sorted = encoded.sort(function (a, b) {\n if (a.name < b.name) {\n return -1;\n } else if (a.name > b.name) {\n return 1;\n }\n return 0;\n });\n\n var result = [];\n for (i = 0; i < sorted.length; i++) {\n nameValue = sorted[i].value ? [sorted[i].name, sorted[i].value].join(\"=\") : sorted[i].name + '=';\n result.push(nameValue);\n }\n\n return result.join('&');\n };\n AwsSignatureV4.prototype.getPayloadSha256Content = function () {\n var result = this.request.contentSha256 || con.cryptoHexEncodedHash256(this.payload || '');\n l.d(this.request.step, 'getPayloadSha256Content:', result);\n return result;\n };\n AwsSignatureV4.prototype.canonicalHeaders = function () {\n var canonicalHeaders = [],\n keys = [],\n i;\n\n function addHeader(name, value) {\n var key = name.toLowerCase();\n keys.push(key);\n canonicalHeaders[key] = value.replace(/\\s+/g, ' ');\n }\n\n if (this.request.md5_digest) {\n addHeader(\"Content-Md5\", this.request.md5_digest);\n }\n\n addHeader('Host', awsRequest.awsHost);\n\n if (this.request.contentType) {\n addHeader('Content-Type', this.request.contentType || '');\n }\n\n var amzHeaders = this.request.x_amz_headers || {};\n for (var key in amzHeaders) {\n if (amzHeaders.hasOwnProperty(key)) {\n addHeader(key, amzHeaders[key]);\n }\n }\n\n var sortedKeys = keys.sort(function (a, b) {\n if (a < b) {\n return -1;\n } else if (a > b) {\n return 1;\n }\n return 0;\n });\n\n var result = [];\n\n var unsigned_headers = [],\n not_signed = this.request.not_signed_headers || [],\n signed_headers = [];\n for (i = 0; i < not_signed.length; i++) {\n unsigned_headers.push(not_signed[i].toLowerCase());\n }\n\n for (i = 0; i < sortedKeys.length; i++) {\n var k = sortedKeys[i];\n result.push([k, canonicalHeaders[k]].join(\":\"));\n if (unsigned_headers.indexOf(k) === -1) {\n signed_headers.push(k);\n }\n }\n\n return {\n canonicalHeaders: result.join(\"\\n\"),\n signedHeaders: signed_headers.join(\";\")\n };\n };\n AwsSignatureV4.prototype.canonicalRequest = function () {\n if (typeof this._cr !== 'undefined') { return this._cr; }\n var canonParts = [];\n\n canonParts.push(this.request.method);\n canonParts.push(uri([awsRequest.awsUrl, awsRequest.getPath(), this.request.path].join(\"\")).pathname);\n canonParts.push(this.canonicalQueryString() || '');\n\n var headers = this.canonicalHeaders();\n canonParts.push(headers.canonicalHeaders + '\\n');\n canonParts.push(headers.signedHeaders);\n canonParts.push(this.getPayloadSha256Content());\n\n this._cr = canonParts.join(\"\\n\");\n l.d(this.request.step, 'V4 CanonicalRequest:', this._cr);\n return this._cr;\n };\n AwsSignatureV4.prototype.setHeaders = function (xhr) {\n xhr.setRequestHeader(\"x-amz-content-sha256\", this.getPayloadSha256Content());\n };\n\n return con.awsSignatureVersion === '4' ? AwsSignatureV4 : AwsSignatureV2;\n }\n function authorizationMethod(awsRequest) {\n var fileUpload = awsRequest.fileUpload,\n con = fileUpload.con,\n request = awsRequest.request;\n\n function AuthorizationMethod() {\n this.request = request;\n }\n AuthorizationMethod.prototype = Object.create(AuthorizationMethod.prototype);\n AuthorizationMethod.prototype.request = {};\n AuthorizationMethod.makeSignParamsObject = function (params) {\n var out = {};\n for (var param in params) {\n if (!params.hasOwnProperty(param)) { continue; }\n if (typeof params[param] === 'function') {\n out[param] = params[param]();\n } else {\n out[param] = params[param];\n }\n }\n return out;\n };\n AuthorizationMethod.prototype.authorize = function () {\n return new Promise(function (resolve, reject) {\n var xhr = new XMLHttpRequest();\n awsRequest.currentXhr = xhr;\n\n var stringToSign = awsRequest.stringToSign(),\n url = [con.signerUrl, '?to_sign=', stringToSign, '&datetime=', request.dateString];\n if (con.sendCanonicalRequestToSignerUrl) {\n url.push('&canonical_request=');\n url.push(encodeURIComponent(awsRequest.canonicalRequest()));\n }\n url = url.join(\"\");\n\n var signParams = AuthorizationMethod.makeSignParamsObject(fileUpload.signParams);\n for (var param in signParams) {\n if (!signParams.hasOwnProperty(param)) { continue; }\n url += ('&' + encodeURIComponent(param) + '=' + encodeURIComponent(signParams[param]));\n }\n\n if (con.xhrWithCredentials) {\n xhr.withCredentials = true;\n }\n\n xhr.onreadystatechange = function () {\n if (xhr.readyState === 4) {\n if (xhr.status === 200) {\n awsRequest.signResponse(xhr.response, stringToSign, request.dateString)\n .then(resolve);\n } else {\n if ([401, 403].indexOf(xhr.status) > -1) {\n var reason = \"status:\" + xhr.status;\n fileUpload.deferredCompletion.reject('Permission denied ' + reason);\n return reject(reason);\n }\n reject(\"Signature fetch returned status: \" + xhr.status);\n }\n }\n };\n\n xhr.onerror = function (xhr) {\n reject('authorizedSend transport error: ' + xhr.responseText);\n };\n\n xhr.open('GET', url);\n var signHeaders = AuthorizationMethod.makeSignParamsObject(con.signHeaders);\n for (var header in signHeaders) {\n if (!signHeaders.hasOwnProperty(header)) { continue; }\n xhr.setRequestHeader(header, signHeaders[header])\n }\n\n if (typeof fileUpload.beforeSigner === 'function') {\n fileUpload.beforeSigner(xhr, url);\n }\n xhr.send();\n });\n };\n\n function AuthorizationCustom() {\n AuthorizationMethod.call(this);\n }\n AuthorizationCustom.prototype = Object.create(AuthorizationMethod.prototype);\n AuthorizationCustom.prototype.authorize = function () {\n return con.customAuthMethod(\n AuthorizationMethod.makeSignParamsObject(fileUpload.signParams),\n AuthorizationMethod.makeSignParamsObject(con.signHeaders),\n awsRequest.stringToSign(),\n request.dateString,\n awsRequest.canonicalRequest())\n .catch(function (reason) {\n fileUpload.deferredCompletion.reject(reason);\n throw reason;\n });\n };\n\n if (typeof con.customAuthMethod === 'function') {\n return new AuthorizationCustom()\n }\n\n return new AuthorizationMethod();\n }\n\n function awsUrl(con) {\n var url;\n if (con.aws_url) {\n url = [con.aws_url];\n } else {\n if (con.s3Acceleration) {\n url = [\"https://\", con.bucket, \".s3-accelerate\"];\n con.cloudfront = true;\n } else {\n url = [\"https://\", (con.cloudfront ? con.bucket + \".\" : \"\"), \"s3\"];\n if (con.awsRegion !== \"us-east-1\") {\n url.push(\"-\", con.awsRegion);\n }\n }\n url.push(\".amazonaws.com\");\n }\n return url.join(\"\");\n }\n\n function s3EncodedObjectName(fileName) {\n var fileParts = fileName.split('/'),\n encodedParts = [];\n fileParts.forEach(function (p) {\n var buf = [],\n enc = encodeURIComponent(p);\n for (var i = 0; i < enc.length; i++) {\n buf.push(S3_EXTRA_ENCODED_CHARS[enc.charCodeAt(i)] || enc.charAt(i));\n }\n encodedParts.push(buf.join(\"\"));\n });\n return encodedParts.join('/');\n }\n\n function uri(url) {\n var p,\n href = url || '/';\n\n try {\n p = new URL(href);\n } catch (e) {\n p = document.createElement('a');\n p.href = href;\n }\n\n return {\n protocol: p.protocol, // => \"http:\"\n hostname: p.hostname, // => \"example.com\"\n // IE omits the leading slash, so add it if it's missing\n pathname: p.pathname.replace(/(^\\/?)/, \"/\"), // => \"/pathname/\"\n port: p.port, // => \"3000\"\n search: (p.search[0] === '?') ? p.search.substr(1) : p.search, // => \"search=test\"\n hash: p.hash, // => \"#hash\"\n host: p.host // => \"example.com:3000\"\n };\n }\n\n function dateISOString(date) {\n // Try to get the modified date as an ISO String, if the date exists\n return date ? new Date(date).toISOString() : '';\n }\n\n function getAwsResponse(xhr) {\n var code = elementText(xhr.responseText, \"Code\"),\n msg = elementText(xhr.responseText, \"Message\");\n return code.length ? ['AWS Code: ', code, ', Message:', msg].join(\"\") : '';\n }\n\n function elementText(source, element) {\n var match = source.match([\"<\", element, \">(.+)\"].join(\"\"));\n return match ? match[1] : '';\n }\n\n function defer() {\n var deferred = {}, promise;\n promise = new Promise(function(resolve, reject){\n deferred = {resolve: resolve, reject: reject};\n });\n return {\n resolve: deferred.resolve,\n reject: deferred.reject,\n promise: promise\n }\n }\n\n function extend(obj1, obj2, obj3) {\n function ext(target, source) {\n if (typeof source !== 'object') { return; }\n for (var key in source) {\n if (source.hasOwnProperty(key)) {\n target[key] = source[key];\n }\n }\n }\n\n obj1 = obj1 || {};\n obj2 = obj2 || {};\n obj3 = obj3 || {};\n ext(obj2, obj3);\n ext(obj1, obj2);\n\n return obj1;\n }\n\n function getSavedUploads(purge) {\n var uploads = JSON.parse(historyCache.getItem('awsUploads') || '{}');\n\n if (purge) {\n for (var key in uploads) {\n if (uploads.hasOwnProperty(key)) {\n var upload = uploads[key],\n completedAt = new Date(upload.completedAt || FAR_FUTURE);\n\n if (completedAt < HOURS_AGO) {\n // The upload is recent, let's keep it\n delete uploads[key];\n }\n }\n }\n\n historyCache.setItem('awsUploads', JSON.stringify(uploads));\n }\n\n return uploads;\n }\n\n function uploadKey(fileUpload) {\n // The key tries to give a signature to a file in the absence of its path.\n // \"---\"\n return [\n fileUpload.file.name,\n fileUpload.file.type,\n dateISOString(fileUpload.file.lastModified),\n fileUpload.sizeBytes\n ].join(\"-\");\n }\n\n function saveUpload(uploadKey, upload) {\n var uploads = getSavedUploads();\n uploads[uploadKey] = upload;\n historyCache.setItem('awsUploads', JSON.stringify(uploads));\n }\n\n function removeUpload(uploadKey) {\n var uploads = getSavedUploads();\n delete uploads[uploadKey];\n historyCache.setItem('awsUploads', JSON.stringify(uploads));\n }\n\n function removeAtIndex(a, i) {\n var idx = a.indexOf(i);\n if (idx > -1) {\n a.splice(idx, 1);\n return true;\n }\n }\n\n function readableFileSize(size) {\n // Adapted from https://github.com/fkjaekel\n // https://github.com/TTLabs/EvaporateJS/issues/13\n var units = ['B', 'Kb', 'Mb', 'Gb', 'Tb', 'Pb', 'Eb', 'Zb', 'Yb'],\n i = 0;\n while(size >= 1024) {\n size /= 1024;\n ++i;\n }\n return [size.toFixed(2).replace('.00', ''), units[i]].join(\" \");\n }\n\n var historyCache;\n function HistoryCache(mockLocalStorage) {\n var supported = HistoryCache.supported();\n this.cacheStore = mockLocalStorage ? {} : (supported ? localStorage : undefined);\n }\n HistoryCache.prototype.supported = false;\n HistoryCache.prototype.cacheStore = undefined;\n HistoryCache.prototype.getItem = function (key) { if (this.cacheStore) { return this.cacheStore[key]; }};\n HistoryCache.prototype.setItem = function (key, value) { if (this.cacheStore) { this.cacheStore[key] = value; }};\n HistoryCache.prototype.removeItem = function (key) { if (this.cacheStore) { return delete this.cacheStore[key] }};\n HistoryCache.supported = function () {\n var result = false;\n if (typeof window !== 'undefined') {\n if (!('localStorage' in window)) {\n return result;\n }\n } else {\n return result;\n }\n\n // Try to use storage (it might be disabled, e.g. user is in private mode)\n try {\n var k = '___test';\n localStorage[k] = 'OK';\n var test = localStorage[k];\n delete localStorage[k];\n return test === 'OK';\n } catch (e) {\n return result;\n }\n };\n\n function noOpLogger() { return {d: function () {}, w: function () {}, e: function () {}}; }\n\n l = noOpLogger();\n\n if (typeof module !== 'undefined' && module.exports) {\n module.exports = Evaporate;\n } else if (typeof window !== 'undefined') {\n window.Evaporate = Evaporate;\n }\n\n}());\n","(function (factory) {\n if (typeof exports === 'object') {\n // Node/CommonJS\n module.exports = factory();\n } else if (typeof define === 'function' && define.amd) {\n // AMD\n define(factory);\n } else {\n // Browser globals (with support for web workers)\n var glob;\n\n try {\n glob = window;\n } catch (e) {\n glob = self;\n }\n\n glob.SparkMD5 = factory();\n }\n}(function (undefined) {\n\n 'use strict';\n\n /*\n * Fastest md5 implementation around (JKM md5).\n * Credits: Joseph Myers\n *\n * @see http://www.myersdaily.org/joseph/javascript/md5-text.html\n * @see http://jsperf.com/md5-shootout/7\n */\n\n /* this function is much faster,\n so if possible we use it. Some IEs\n are the only ones I know of that\n need the idiotic second function,\n generated by an if clause. */\n var add32 = function (a, b) {\n return (a + b) & 0xFFFFFFFF;\n },\n hex_chr = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'];\n\n\n function cmn(q, a, b, x, s, t) {\n a = add32(add32(a, q), add32(x, t));\n return add32((a << s) | (a >>> (32 - s)), b);\n }\n\n function md5cycle(x, k) {\n var a = x[0],\n b = x[1],\n c = x[2],\n d = x[3];\n\n a += (b & c | ~b & d) + k[0] - 680876936 | 0;\n a = (a << 7 | a >>> 25) + b | 0;\n d += (a & b | ~a & c) + k[1] - 389564586 | 0;\n d = (d << 12 | d >>> 20) + a | 0;\n c += (d & a | ~d & b) + k[2] + 606105819 | 0;\n c = (c << 17 | c >>> 15) + d | 0;\n b += (c & d | ~c & a) + k[3] - 1044525330 | 0;\n b = (b << 22 | b >>> 10) + c | 0;\n a += (b & c | ~b & d) + k[4] - 176418897 | 0;\n a = (a << 7 | a >>> 25) + b | 0;\n d += (a & b | ~a & c) + k[5] + 1200080426 | 0;\n d = (d << 12 | d >>> 20) + a | 0;\n c += (d & a | ~d & b) + k[6] - 1473231341 | 0;\n c = (c << 17 | c >>> 15) + d | 0;\n b += (c & d | ~c & a) + k[7] - 45705983 | 0;\n b = (b << 22 | b >>> 10) + c | 0;\n a += (b & c | ~b & d) + k[8] + 1770035416 | 0;\n a = (a << 7 | a >>> 25) + b | 0;\n d += (a & b | ~a & c) + k[9] - 1958414417 | 0;\n d = (d << 12 | d >>> 20) + a | 0;\n c += (d & a | ~d & b) + k[10] - 42063 | 0;\n c = (c << 17 | c >>> 15) + d | 0;\n b += (c & d | ~c & a) + k[11] - 1990404162 | 0;\n b = (b << 22 | b >>> 10) + c | 0;\n a += (b & c | ~b & d) + k[12] + 1804603682 | 0;\n a = (a << 7 | a >>> 25) + b | 0;\n d += (a & b | ~a & c) + k[13] - 40341101 | 0;\n d = (d << 12 | d >>> 20) + a | 0;\n c += (d & a | ~d & b) + k[14] - 1502002290 | 0;\n c = (c << 17 | c >>> 15) + d | 0;\n b += (c & d | ~c & a) + k[15] + 1236535329 | 0;\n b = (b << 22 | b >>> 10) + c | 0;\n\n a += (b & d | c & ~d) + k[1] - 165796510 | 0;\n a = (a << 5 | a >>> 27) + b | 0;\n d += (a & c | b & ~c) + k[6] - 1069501632 | 0;\n d = (d << 9 | d >>> 23) + a | 0;\n c += (d & b | a & ~b) + k[11] + 643717713 | 0;\n c = (c << 14 | c >>> 18) + d | 0;\n b += (c & a | d & ~a) + k[0] - 373897302 | 0;\n b = (b << 20 | b >>> 12) + c | 0;\n a += (b & d | c & ~d) + k[5] - 701558691 | 0;\n a = (a << 5 | a >>> 27) + b | 0;\n d += (a & c | b & ~c) + k[10] + 38016083 | 0;\n d = (d << 9 | d >>> 23) + a | 0;\n c += (d & b | a & ~b) + k[15] - 660478335 | 0;\n c = (c << 14 | c >>> 18) + d | 0;\n b += (c & a | d & ~a) + k[4] - 405537848 | 0;\n b = (b << 20 | b >>> 12) + c | 0;\n a += (b & d | c & ~d) + k[9] + 568446438 | 0;\n a = (a << 5 | a >>> 27) + b | 0;\n d += (a & c | b & ~c) + k[14] - 1019803690 | 0;\n d = (d << 9 | d >>> 23) + a | 0;\n c += (d & b | a & ~b) + k[3] - 187363961 | 0;\n c = (c << 14 | c >>> 18) + d | 0;\n b += (c & a | d & ~a) + k[8] + 1163531501 | 0;\n b = (b << 20 | b >>> 12) + c | 0;\n a += (b & d | c & ~d) + k[13] - 1444681467 | 0;\n a = (a << 5 | a >>> 27) + b | 0;\n d += (a & c | b & ~c) + k[2] - 51403784 | 0;\n d = (d << 9 | d >>> 23) + a | 0;\n c += (d & b | a & ~b) + k[7] + 1735328473 | 0;\n c = (c << 14 | c >>> 18) + d | 0;\n b += (c & a | d & ~a) + k[12] - 1926607734 | 0;\n b = (b << 20 | b >>> 12) + c | 0;\n\n a += (b ^ c ^ d) + k[5] - 378558 | 0;\n a = (a << 4 | a >>> 28) + b | 0;\n d += (a ^ b ^ c) + k[8] - 2022574463 | 0;\n d = (d << 11 | d >>> 21) + a | 0;\n c += (d ^ a ^ b) + k[11] + 1839030562 | 0;\n c = (c << 16 | c >>> 16) + d | 0;\n b += (c ^ d ^ a) + k[14] - 35309556 | 0;\n b = (b << 23 | b >>> 9) + c | 0;\n a += (b ^ c ^ d) + k[1] - 1530992060 | 0;\n a = (a << 4 | a >>> 28) + b | 0;\n d += (a ^ b ^ c) + k[4] + 1272893353 | 0;\n d = (d << 11 | d >>> 21) + a | 0;\n c += (d ^ a ^ b) + k[7] - 155497632 | 0;\n c = (c << 16 | c >>> 16) + d | 0;\n b += (c ^ d ^ a) + k[10] - 1094730640 | 0;\n b = (b << 23 | b >>> 9) + c | 0;\n a += (b ^ c ^ d) + k[13] + 681279174 | 0;\n a = (a << 4 | a >>> 28) + b | 0;\n d += (a ^ b ^ c) + k[0] - 358537222 | 0;\n d = (d << 11 | d >>> 21) + a | 0;\n c += (d ^ a ^ b) + k[3] - 722521979 | 0;\n c = (c << 16 | c >>> 16) + d | 0;\n b += (c ^ d ^ a) + k[6] + 76029189 | 0;\n b = (b << 23 | b >>> 9) + c | 0;\n a += (b ^ c ^ d) + k[9] - 640364487 | 0;\n a = (a << 4 | a >>> 28) + b | 0;\n d += (a ^ b ^ c) + k[12] - 421815835 | 0;\n d = (d << 11 | d >>> 21) + a | 0;\n c += (d ^ a ^ b) + k[15] + 530742520 | 0;\n c = (c << 16 | c >>> 16) + d | 0;\n b += (c ^ d ^ a) + k[2] - 995338651 | 0;\n b = (b << 23 | b >>> 9) + c | 0;\n\n a += (c ^ (b | ~d)) + k[0] - 198630844 | 0;\n a = (a << 6 | a >>> 26) + b | 0;\n d += (b ^ (a | ~c)) + k[7] + 1126891415 | 0;\n d = (d << 10 | d >>> 22) + a | 0;\n c += (a ^ (d | ~b)) + k[14] - 1416354905 | 0;\n c = (c << 15 | c >>> 17) + d | 0;\n b += (d ^ (c | ~a)) + k[5] - 57434055 | 0;\n b = (b << 21 |b >>> 11) + c | 0;\n a += (c ^ (b | ~d)) + k[12] + 1700485571 | 0;\n a = (a << 6 | a >>> 26) + b | 0;\n d += (b ^ (a | ~c)) + k[3] - 1894986606 | 0;\n d = (d << 10 | d >>> 22) + a | 0;\n c += (a ^ (d | ~b)) + k[10] - 1051523 | 0;\n c = (c << 15 | c >>> 17) + d | 0;\n b += (d ^ (c | ~a)) + k[1] - 2054922799 | 0;\n b = (b << 21 |b >>> 11) + c | 0;\n a += (c ^ (b | ~d)) + k[8] + 1873313359 | 0;\n a = (a << 6 | a >>> 26) + b | 0;\n d += (b ^ (a | ~c)) + k[15] - 30611744 | 0;\n d = (d << 10 | d >>> 22) + a | 0;\n c += (a ^ (d | ~b)) + k[6] - 1560198380 | 0;\n c = (c << 15 | c >>> 17) + d | 0;\n b += (d ^ (c | ~a)) + k[13] + 1309151649 | 0;\n b = (b << 21 |b >>> 11) + c | 0;\n a += (c ^ (b | ~d)) + k[4] - 145523070 | 0;\n a = (a << 6 | a >>> 26) + b | 0;\n d += (b ^ (a | ~c)) + k[11] - 1120210379 | 0;\n d = (d << 10 | d >>> 22) + a | 0;\n c += (a ^ (d | ~b)) + k[2] + 718787259 | 0;\n c = (c << 15 | c >>> 17) + d | 0;\n b += (d ^ (c | ~a)) + k[9] - 343485551 | 0;\n b = (b << 21 | b >>> 11) + c | 0;\n\n x[0] = a + x[0] | 0;\n x[1] = b + x[1] | 0;\n x[2] = c + x[2] | 0;\n x[3] = d + x[3] | 0;\n }\n\n function md5blk(s) {\n var md5blks = [],\n i; /* Andy King said do it this way. */\n\n for (i = 0; i < 64; i += 4) {\n md5blks[i >> 2] = s.charCodeAt(i) + (s.charCodeAt(i + 1) << 8) + (s.charCodeAt(i + 2) << 16) + (s.charCodeAt(i + 3) << 24);\n }\n return md5blks;\n }\n\n function md5blk_array(a) {\n var md5blks = [],\n i; /* Andy King said do it this way. */\n\n for (i = 0; i < 64; i += 4) {\n md5blks[i >> 2] = a[i] + (a[i + 1] << 8) + (a[i + 2] << 16) + (a[i + 3] << 24);\n }\n return md5blks;\n }\n\n function md51(s) {\n var n = s.length,\n state = [1732584193, -271733879, -1732584194, 271733878],\n i,\n length,\n tail,\n tmp,\n lo,\n hi;\n\n for (i = 64; i <= n; i += 64) {\n md5cycle(state, md5blk(s.substring(i - 64, i)));\n }\n s = s.substring(i - 64);\n length = s.length;\n tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];\n for (i = 0; i < length; i += 1) {\n tail[i >> 2] |= s.charCodeAt(i) << ((i % 4) << 3);\n }\n tail[i >> 2] |= 0x80 << ((i % 4) << 3);\n if (i > 55) {\n md5cycle(state, tail);\n for (i = 0; i < 16; i += 1) {\n tail[i] = 0;\n }\n }\n\n // Beware that the final length might not fit in 32 bits so we take care of that\n tmp = n * 8;\n tmp = tmp.toString(16).match(/(.*?)(.{0,8})$/);\n lo = parseInt(tmp[2], 16);\n hi = parseInt(tmp[1], 16) || 0;\n\n tail[14] = lo;\n tail[15] = hi;\n\n md5cycle(state, tail);\n return state;\n }\n\n function md51_array(a) {\n var n = a.length,\n state = [1732584193, -271733879, -1732584194, 271733878],\n i,\n length,\n tail,\n tmp,\n lo,\n hi;\n\n for (i = 64; i <= n; i += 64) {\n md5cycle(state, md5blk_array(a.subarray(i - 64, i)));\n }\n\n // Not sure if it is a bug, however IE10 will always produce a sub array of length 1\n // containing the last element of the parent array if the sub array specified starts\n // beyond the length of the parent array - weird.\n // https://connect.microsoft.com/IE/feedback/details/771452/typed-array-subarray-issue\n a = (i - 64) < n ? a.subarray(i - 64) : new Uint8Array(0);\n\n length = a.length;\n tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];\n for (i = 0; i < length; i += 1) {\n tail[i >> 2] |= a[i] << ((i % 4) << 3);\n }\n\n tail[i >> 2] |= 0x80 << ((i % 4) << 3);\n if (i > 55) {\n md5cycle(state, tail);\n for (i = 0; i < 16; i += 1) {\n tail[i] = 0;\n }\n }\n\n // Beware that the final length might not fit in 32 bits so we take care of that\n tmp = n * 8;\n tmp = tmp.toString(16).match(/(.*?)(.{0,8})$/);\n lo = parseInt(tmp[2], 16);\n hi = parseInt(tmp[1], 16) || 0;\n\n tail[14] = lo;\n tail[15] = hi;\n\n md5cycle(state, tail);\n\n return state;\n }\n\n function rhex(n) {\n var s = '',\n j;\n for (j = 0; j < 4; j += 1) {\n s += hex_chr[(n >> (j * 8 + 4)) & 0x0F] + hex_chr[(n >> (j * 8)) & 0x0F];\n }\n return s;\n }\n\n function hex(x) {\n var i;\n for (i = 0; i < x.length; i += 1) {\n x[i] = rhex(x[i]);\n }\n return x.join('');\n }\n\n // In some cases the fast add32 function cannot be used..\n if (hex(md51('hello')) !== '5d41402abc4b2a76b9719d911017c592') {\n add32 = function (x, y) {\n var lsw = (x & 0xFFFF) + (y & 0xFFFF),\n msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return (msw << 16) | (lsw & 0xFFFF);\n };\n }\n\n // ---------------------------------------------------\n\n /**\n * ArrayBuffer slice polyfill.\n *\n * @see https://github.com/ttaubert/node-arraybuffer-slice\n */\n\n if (typeof ArrayBuffer !== 'undefined' && !ArrayBuffer.prototype.slice) {\n (function () {\n function clamp(val, length) {\n val = (val | 0) || 0;\n\n if (val < 0) {\n return Math.max(val + length, 0);\n }\n\n return Math.min(val, length);\n }\n\n ArrayBuffer.prototype.slice = function (from, to) {\n var length = this.byteLength,\n begin = clamp(from, length),\n end = length,\n num,\n target,\n targetArray,\n sourceArray;\n\n if (to !== undefined) {\n end = clamp(to, length);\n }\n\n if (begin > end) {\n return new ArrayBuffer(0);\n }\n\n num = end - begin;\n target = new ArrayBuffer(num);\n targetArray = new Uint8Array(target);\n\n sourceArray = new Uint8Array(this, begin, num);\n targetArray.set(sourceArray);\n\n return target;\n };\n })();\n }\n\n // ---------------------------------------------------\n\n /**\n * Helpers.\n */\n\n function toUtf8(str) {\n if (/[\\u0080-\\uFFFF]/.test(str)) {\n str = unescape(encodeURIComponent(str));\n }\n\n return str;\n }\n\n function utf8Str2ArrayBuffer(str, returnUInt8Array) {\n var length = str.length,\n buff = new ArrayBuffer(length),\n arr = new Uint8Array(buff),\n i;\n\n for (i = 0; i < length; i += 1) {\n arr[i] = str.charCodeAt(i);\n }\n\n return returnUInt8Array ? arr : buff;\n }\n\n function arrayBuffer2Utf8Str(buff) {\n return String.fromCharCode.apply(null, new Uint8Array(buff));\n }\n\n function concatenateArrayBuffers(first, second, returnUInt8Array) {\n var result = new Uint8Array(first.byteLength + second.byteLength);\n\n result.set(new Uint8Array(first));\n result.set(new Uint8Array(second), first.byteLength);\n\n return returnUInt8Array ? result : result.buffer;\n }\n\n function hexToBinaryString(hex) {\n var bytes = [],\n length = hex.length,\n x;\n\n for (x = 0; x < length - 1; x += 2) {\n bytes.push(parseInt(hex.substr(x, 2), 16));\n }\n\n return String.fromCharCode.apply(String, bytes);\n }\n\n // ---------------------------------------------------\n\n /**\n * SparkMD5 OOP implementation.\n *\n * Use this class to perform an incremental md5, otherwise use the\n * static methods instead.\n */\n\n function SparkMD5() {\n // call reset to init the instance\n this.reset();\n }\n\n /**\n * Appends a string.\n * A conversion will be applied if an utf8 string is detected.\n *\n * @param {String} str The string to be appended\n *\n * @return {SparkMD5} The instance itself\n */\n SparkMD5.prototype.append = function (str) {\n // Converts the string to utf8 bytes if necessary\n // Then append as binary\n this.appendBinary(toUtf8(str));\n\n return this;\n };\n\n /**\n * Appends a binary string.\n *\n * @param {String} contents The binary string to be appended\n *\n * @return {SparkMD5} The instance itself\n */\n SparkMD5.prototype.appendBinary = function (contents) {\n this._buff += contents;\n this._length += contents.length;\n\n var length = this._buff.length,\n i;\n\n for (i = 64; i <= length; i += 64) {\n md5cycle(this._hash, md5blk(this._buff.substring(i - 64, i)));\n }\n\n this._buff = this._buff.substring(i - 64);\n\n return this;\n };\n\n /**\n * Finishes the incremental computation, reseting the internal state and\n * returning the result.\n *\n * @param {Boolean} raw True to get the raw string, false to get the hex string\n *\n * @return {String} The result\n */\n SparkMD5.prototype.end = function (raw) {\n var buff = this._buff,\n length = buff.length,\n i,\n tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n ret;\n\n for (i = 0; i < length; i += 1) {\n tail[i >> 2] |= buff.charCodeAt(i) << ((i % 4) << 3);\n }\n\n this._finish(tail, length);\n ret = hex(this._hash);\n\n if (raw) {\n ret = hexToBinaryString(ret);\n }\n\n this.reset();\n\n return ret;\n };\n\n /**\n * Resets the internal state of the computation.\n *\n * @return {SparkMD5} The instance itself\n */\n SparkMD5.prototype.reset = function () {\n this._buff = '';\n this._length = 0;\n this._hash = [1732584193, -271733879, -1732584194, 271733878];\n\n return this;\n };\n\n /**\n * Gets the internal state of the computation.\n *\n * @return {Object} The state\n */\n SparkMD5.prototype.getState = function () {\n return {\n buff: this._buff,\n length: this._length,\n hash: this._hash\n };\n };\n\n /**\n * Gets the internal state of the computation.\n *\n * @param {Object} state The state\n *\n * @return {SparkMD5} The instance itself\n */\n SparkMD5.prototype.setState = function (state) {\n this._buff = state.buff;\n this._length = state.length;\n this._hash = state.hash;\n\n return this;\n };\n\n /**\n * Releases memory used by the incremental buffer and other additional\n * resources. If you plan to use the instance again, use reset instead.\n */\n SparkMD5.prototype.destroy = function () {\n delete this._hash;\n delete this._buff;\n delete this._length;\n };\n\n /**\n * Finish the final calculation based on the tail.\n *\n * @param {Array} tail The tail (will be modified)\n * @param {Number} length The length of the remaining buffer\n */\n SparkMD5.prototype._finish = function (tail, length) {\n var i = length,\n tmp,\n lo,\n hi;\n\n tail[i >> 2] |= 0x80 << ((i % 4) << 3);\n if (i > 55) {\n md5cycle(this._hash, tail);\n for (i = 0; i < 16; i += 1) {\n tail[i] = 0;\n }\n }\n\n // Do the final computation based on the tail and length\n // Beware that the final length may not fit in 32 bits so we take care of that\n tmp = this._length * 8;\n tmp = tmp.toString(16).match(/(.*?)(.{0,8})$/);\n lo = parseInt(tmp[2], 16);\n hi = parseInt(tmp[1], 16) || 0;\n\n tail[14] = lo;\n tail[15] = hi;\n md5cycle(this._hash, tail);\n };\n\n /**\n * Performs the md5 hash on a string.\n * A conversion will be applied if utf8 string is detected.\n *\n * @param {String} str The string\n * @param {Boolean} raw True to get the raw string, false to get the hex string\n *\n * @return {String} The result\n */\n SparkMD5.hash = function (str, raw) {\n // Converts the string to utf8 bytes if necessary\n // Then compute it using the binary function\n return SparkMD5.hashBinary(toUtf8(str), raw);\n };\n\n /**\n * Performs the md5 hash on a binary string.\n *\n * @param {String} content The binary string\n * @param {Boolean} raw True to get the raw string, false to get the hex string\n *\n * @return {String} The result\n */\n SparkMD5.hashBinary = function (content, raw) {\n var hash = md51(content),\n ret = hex(hash);\n\n return raw ? hexToBinaryString(ret) : ret;\n };\n\n // ---------------------------------------------------\n\n /**\n * SparkMD5 OOP implementation for array buffers.\n *\n * Use this class to perform an incremental md5 ONLY for array buffers.\n */\n SparkMD5.ArrayBuffer = function () {\n // call reset to init the instance\n this.reset();\n };\n\n /**\n * Appends an array buffer.\n *\n * @param {ArrayBuffer} arr The array to be appended\n *\n * @return {SparkMD5.ArrayBuffer} The instance itself\n */\n SparkMD5.ArrayBuffer.prototype.append = function (arr) {\n var buff = concatenateArrayBuffers(this._buff.buffer, arr, true),\n length = buff.length,\n i;\n\n this._length += arr.byteLength;\n\n for (i = 64; i <= length; i += 64) {\n md5cycle(this._hash, md5blk_array(buff.subarray(i - 64, i)));\n }\n\n this._buff = (i - 64) < length ? new Uint8Array(buff.buffer.slice(i - 64)) : new Uint8Array(0);\n\n return this;\n };\n\n /**\n * Finishes the incremental computation, reseting the internal state and\n * returning the result.\n *\n * @param {Boolean} raw True to get the raw string, false to get the hex string\n *\n * @return {String} The result\n */\n SparkMD5.ArrayBuffer.prototype.end = function (raw) {\n var buff = this._buff,\n length = buff.length,\n tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n i,\n ret;\n\n for (i = 0; i < length; i += 1) {\n tail[i >> 2] |= buff[i] << ((i % 4) << 3);\n }\n\n this._finish(tail, length);\n ret = hex(this._hash);\n\n if (raw) {\n ret = hexToBinaryString(ret);\n }\n\n this.reset();\n\n return ret;\n };\n\n /**\n * Resets the internal state of the computation.\n *\n * @return {SparkMD5.ArrayBuffer} The instance itself\n */\n SparkMD5.ArrayBuffer.prototype.reset = function () {\n this._buff = new Uint8Array(0);\n this._length = 0;\n this._hash = [1732584193, -271733879, -1732584194, 271733878];\n\n return this;\n };\n\n /**\n * Gets the internal state of the computation.\n *\n * @return {Object} The state\n */\n SparkMD5.ArrayBuffer.prototype.getState = function () {\n var state = SparkMD5.prototype.getState.call(this);\n\n // Convert buffer to a string\n state.buff = arrayBuffer2Utf8Str(state.buff);\n\n return state;\n };\n\n /**\n * Gets the internal state of the computation.\n *\n * @param {Object} state The state\n *\n * @return {SparkMD5.ArrayBuffer} The instance itself\n */\n SparkMD5.ArrayBuffer.prototype.setState = function (state) {\n // Convert string to buffer\n state.buff = utf8Str2ArrayBuffer(state.buff, true);\n\n return SparkMD5.prototype.setState.call(this, state);\n };\n\n SparkMD5.ArrayBuffer.prototype.destroy = SparkMD5.prototype.destroy;\n\n SparkMD5.ArrayBuffer.prototype._finish = SparkMD5.prototype._finish;\n\n /**\n * Performs the md5 hash on an array buffer.\n *\n * @param {ArrayBuffer} arr The array buffer\n * @param {Boolean} raw True to get the raw string, false to get the hex one\n *\n * @return {String} The result\n */\n SparkMD5.ArrayBuffer.hash = function (arr, raw) {\n var hash = md51_array(new Uint8Array(arr)),\n ret = hex(hash);\n\n return raw ? hexToBinaryString(ret) : ret;\n };\n\n return SparkMD5;\n}));\n","import Cookies from 'js-cookie';\nimport createHash from 'sha.js';\nimport Evaporate from 'evaporate';\nimport SparkMD5 from 'spark-md5';\n\nimport './css/bootstrap-progress.css';\nimport './css/styles.css';\n\nconst request = (method, url, data, headers, el, cb) => {\n let req = new XMLHttpRequest();\n req.open(method, url, true);\n\n Object.keys(headers).forEach(key => {\n req.setRequestHeader(key, headers[key]);\n });\n\n req.onload = () => {\n cb(req.status, req.responseText);\n };\n\n req.onerror = req.onabort = () => {\n disableSubmit(false);\n error(el, 'Sorry, failed to upload file.');\n };\n\n req.send(data);\n};\n\nconst parseNameFromUrl = url => {\n return decodeURIComponent((url + '').replace(/\\+/g, '%20'));\n};\n\nconst parseJson = json => {\n let data;\n try {\n data = JSON.parse(json);\n } catch (e) {\n data = null;\n }\n return data;\n};\n\nconst updateProgressBar = (element, progressRatio) => {\n const bar = element.querySelector('.bar');\n bar.style.width = Math.round(progressRatio * 100) + '%';\n};\n\nconst error = (el, msg) => {\n el.className = 's3direct form-active';\n el.querySelector('.file-input').value = '';\n alert(msg);\n};\n\nlet concurrentUploads = 0;\n\nconst disableSubmit = status => {\n const submitRow = document.querySelector('.submit-row');\n if (!submitRow) return;\n\n const buttons = submitRow.querySelectorAll(\n 'input[type=submit],button[type=submit]'\n );\n\n if (status === true) concurrentUploads++;\n else concurrentUploads--;\n\n [].forEach.call(buttons, el => {\n el.disabled = concurrentUploads !== 0;\n });\n};\n\nconst finishUpload = (element, endpoint, bucket, objectKey) => {\n const link = element.querySelector('.file-link');\n const url = element.querySelector('.file-url');\n url.value = endpoint + '/' + bucket + '/' + objectKey;\n link.setAttribute('href', url.value);\n link.innerHTML = parseNameFromUrl(url.value)\n .split('/')\n .pop();\n element.className = 's3direct link-active';\n element.querySelector('.bar').style.width = '0%';\n disableSubmit(false);\n};\n\nconst computeMd5 = data => {\n return btoa(SparkMD5.ArrayBuffer.hash(data, true));\n};\n\nconst computeSha256 = data => {\n return createHash('sha256')\n .update(data, 'utf-8')\n .digest('hex');\n};\n\nconst getCsrfToken = element => {\n const cookieInput = element.querySelector('.csrf-cookie-name');\n const input = document.querySelector('input[name=csrfmiddlewaretoken]');\n const token = input ? input.value : Cookies.get(cookieInput.value);\n return token;\n};\n\nconst generateAmzInitHeaders = (acl, serverSideEncryption, sessionToken) => {\n const headers = {};\n if (acl) headers['x-amz-acl'] = acl;\n if (sessionToken) headers['x-amz-security-token'] = sessionToken;\n if (serverSideEncryption) {\n headers['x-amz-server-side-encryption'] = serverSideEncryption;\n }\n return headers;\n};\n\nconst generateAmzCommonHeaders = sessionToken => {\n const headers = {};\n if (sessionToken) headers['x-amz-security-token'] = sessionToken;\n return headers;\n};\n\nconst generateCustomAuthMethod = (element, signingUrl, dest) => {\n const getAwsV4Signature = (\n _signParams,\n _signHeaders,\n stringToSign,\n signatureDateTime,\n _canonicalRequest\n ) => {\n return new Promise((resolve, reject) => {\n const form = new FormData();\n const headers = { 'X-CSRFToken': getCsrfToken(element) };\n\n form.append('to_sign', stringToSign);\n form.append('datetime', signatureDateTime);\n form.append('dest', dest);\n\n request('POST', signingUrl, form, headers, element, (status, resp) => {\n const response = parseJson(resp);\n switch (status) {\n case 200:\n resolve(response.s3ObjKey);\n break;\n case 403:\n default:\n reject(response.error);\n break;\n }\n });\n });\n };\n\n return getAwsV4Signature;\n};\n\nconst initiateUpload = (element, signingUrl, uploadParameters, file, dest) => {\n const createConfig = {\n customAuthMethod: generateCustomAuthMethod(element, signingUrl, dest),\n aws_key: uploadParameters.access_key_id,\n bucket: uploadParameters.bucket,\n aws_url: uploadParameters.endpoint,\n awsRegion: uploadParameters.region,\n computeContentMd5: true,\n cryptoMd5Method: computeMd5,\n cryptoHexEncodedHash256: computeSha256,\n partSize: 20 * 1024 * 1024,\n logging: true,\n allowS3ExistenceOptimization: uploadParameters.allow_existence_optimization,\n s3FileCacheHoursAgo: uploadParameters.allow_existence_optimization ? 12 : 0\n };\n\n const addConfig = {\n name: uploadParameters.object_key,\n file: file,\n contentType: file.type,\n xAmzHeadersCommon: generateAmzCommonHeaders(uploadParameters.session_token),\n xAmzHeadersAtInitiate: generateAmzInitHeaders(\n uploadParameters.acl,\n uploadParameters.server_side_encryption,\n uploadParameters.session_token\n ),\n progress: (progressRatio, stats) => {\n updateProgressBar(element, progressRatio);\n },\n warn: (warnType, area, msg) => {\n if (msg.includes('InvalidAccessKeyId')) {\n error(element, msg);\n }\n }\n };\n\n const optHeaders = {};\n\n if (uploadParameters.cache_control) {\n optHeaders['Cache-Control'] = uploadParameters.cache_control;\n }\n\n if (uploadParameters.content_disposition) {\n optHeaders['Content-Disposition'] = uploadParameters.content_disposition;\n }\n\n addConfig['notSignedHeadersAtInitiate'] = optHeaders;\n\n Evaporate.create(createConfig).then(evaporate => {\n disableSubmit(true);\n\n element.className = 's3direct progress-active';\n\n const cancelButton = element.querySelector('.cancel-button');\n\n const cancelUpload = e => {\n e.preventDefault();\n evaporate.cancel(`${uploadParameters.bucket}/${addConfig.name}`);\n };\n\n cancelButton.addEventListener('click', cancelUpload, false);\n\n evaporate.add(addConfig).then(\n s3Objkey => {\n cancelButton.removeEventListener('click', cancelUpload);\n finishUpload(\n element,\n uploadParameters.endpoint,\n uploadParameters.bucket,\n s3Objkey\n );\n },\n reason => {\n cancelButton.removeEventListener('click', cancelUpload);\n return error(element, reason);\n }\n );\n });\n};\n\nconst checkFileAndInitiateUpload = event => {\n const element = event.target.parentElement;\n const file = element.querySelector('.file-input').files[0];\n const dest = element.querySelector('.file-dest').value;\n const destCheckUrl = element.getAttribute('data-policy-url');\n const signerUrl = element.getAttribute('data-signing-url');\n const form = new FormData();\n const headers = { 'X-CSRFToken': getCsrfToken(element) };\n\n form.append('dest', dest);\n form.append('name', file.name);\n form.append('type', file.type);\n form.append('size', file.size);\n\n request('POST', destCheckUrl, form, headers, element, (status, response) => {\n const uploadParameters = parseJson(response);\n switch (status) {\n case 200:\n initiateUpload(element, signerUrl, uploadParameters, file, dest);\n break;\n case 400:\n case 403:\n case 500:\n error(element, uploadParameters.error);\n break;\n default:\n error(element, 'Sorry, could not get upload URL.');\n }\n });\n};\n\nconst removeUpload = e => {\n e.preventDefault();\n const el = e.target.parentElement;\n el.querySelector('.file-url').value = '';\n el.querySelector('.file-input').value = '';\n el.className = 's3direct form-active';\n};\n\nconst addHandlers = el => {\n const url = el.querySelector('.file-url');\n const input = el.querySelector('.file-input');\n const remove = el.querySelector('.file-remove');\n const status = url.value === '' ? 'form' : 'link';\n\n el.className = 's3direct ' + status + '-active';\n remove.addEventListener('click', removeUpload, false);\n input.addEventListener('change', checkFileAndInitiateUpload, false);\n};\n\ndocument.addEventListener('DOMContentLoaded', event => {\n [].forEach.call(document.querySelectorAll('.s3direct'), addHandlers);\n});\n\ndocument.addEventListener('DOMNodeInserted', event => {\n if (event.target.tagName) {\n const el = event.target.querySelectorAll('.s3direct');\n [].forEach.call(el, (element, index, array) => {\n addHandlers(element);\n });\n }\n});\n","var bundleURL = null;\nfunction getBundleURLCached() {\n if (!bundleURL) {\n bundleURL = getBundleURL();\n }\n\n return bundleURL;\n}\n\nfunction getBundleURL() {\n // Attempt to find the URL of the current script and use that as the base URL\n try {\n throw new Error;\n } catch (err) {\n var matches = ('' + err.stack).match(/(https?|file|ftp|chrome-extension|moz-extension):\\/\\/[^)\\n]+/g);\n if (matches) {\n return getBaseURL(matches[0]);\n }\n }\n\n return '/';\n}\n\nfunction getBaseURL(url) {\n return ('' + url).replace(/^((?:https?|file|ftp|chrome-extension|moz-extension):\\/\\/.+)\\/[^/]+$/, '$1') + '/';\n}\n\nexports.getBundleURL = getBundleURLCached;\nexports.getBaseURL = getBaseURL;\n","var bundle = require('./bundle-url');\n\nfunction updateLink(link) {\n var newLink = link.cloneNode();\n newLink.onload = function () {\n link.remove();\n };\n newLink.href = link.href.split('?')[0] + '?' + Date.now();\n link.parentNode.insertBefore(newLink, link.nextSibling);\n}\n\nvar cssTimeout = null;\nfunction reloadCSS() {\n if (cssTimeout) {\n return;\n }\n\n cssTimeout = setTimeout(function () {\n var links = document.querySelectorAll('link[rel=\"stylesheet\"]');\n for (var i = 0; i < links.length; i++) {\n if (bundle.getBaseURL(links[i].href) === bundle.getBundleURL()) {\n updateLink(links[i]);\n }\n }\n\n cssTimeout = null;\n }, 50);\n}\n\nmodule.exports = reloadCSS;\n","var OVERLAY_ID = '__parcel__error__overlay__';\n\nvar OldModule = module.bundle.Module;\n\nfunction Module(moduleName) {\n OldModule.call(this, moduleName);\n this.hot = {\n data: module.bundle.hotData,\n _acceptCallbacks: [],\n _disposeCallbacks: [],\n accept: function (fn) {\n this._acceptCallbacks.push(fn || function () {});\n },\n dispose: function (fn) {\n this._disposeCallbacks.push(fn);\n }\n };\n\n module.bundle.hotData = null;\n}\n\nmodule.bundle.Module = Module;\nvar checkedAssets, assetsToAccept;\n\nvar parent = module.bundle.parent;\nif ((!parent || !parent.isParcelRequire) && typeof WebSocket !== 'undefined') {\n var hostname = process.env.HMR_HOSTNAME || location.hostname;\n var protocol = location.protocol === 'https:' ? 'wss' : 'ws';\n var ws = new WebSocket(protocol + '://' + hostname + ':' + process.env.HMR_PORT + '/');\n ws.onmessage = function(event) {\n checkedAssets = {};\n assetsToAccept = [];\n\n var data = JSON.parse(event.data);\n\n if (data.type === 'update') {\n var handled = false;\n data.assets.forEach(function(asset) {\n if (!asset.isNew) {\n var didAccept = hmrAcceptCheck(global.parcelRequire, asset.id);\n if (didAccept) {\n handled = true;\n }\n }\n });\n\n // Enable HMR for CSS by default.\n handled = handled || data.assets.every(function(asset) {\n return asset.type === 'css' && asset.generated.js;\n });\n\n if (handled) {\n console.clear();\n\n data.assets.forEach(function (asset) {\n hmrApply(global.parcelRequire, asset);\n });\n\n assetsToAccept.forEach(function (v) {\n hmrAcceptRun(v[0], v[1]);\n });\n } else {\n window.location.reload();\n }\n }\n\n if (data.type === 'reload') {\n ws.close();\n ws.onclose = function () {\n location.reload();\n }\n }\n\n if (data.type === 'error-resolved') {\n console.log('[parcel] ✨ Error resolved');\n\n removeErrorOverlay();\n }\n\n if (data.type === 'error') {\n console.error('[parcel] 🚨 ' + data.error.message + '\\n' + data.error.stack);\n\n removeErrorOverlay();\n\n var overlay = createErrorOverlay(data);\n document.body.appendChild(overlay);\n }\n };\n}\n\nfunction removeErrorOverlay() {\n var overlay = document.getElementById(OVERLAY_ID);\n if (overlay) {\n overlay.remove();\n }\n}\n\nfunction createErrorOverlay(data) {\n var overlay = document.createElement('div');\n overlay.id = OVERLAY_ID;\n\n // html encode message and stack trace\n var message = document.createElement('div');\n var stackTrace = document.createElement('pre');\n message.innerText = data.error.message;\n stackTrace.innerText = data.error.stack;\n\n overlay.innerHTML = (\n '
' +\n 'ERROR' +\n '🚨' +\n '
' + message.innerHTML + '
' +\n '
' + stackTrace.innerHTML + '
' +\n '
'\n );\n\n return overlay;\n\n}\n\nfunction getParents(bundle, id) {\n var modules = bundle.modules;\n if (!modules) {\n return [];\n }\n\n var parents = [];\n var k, d, dep;\n\n for (k in modules) {\n for (d in modules[k][1]) {\n dep = modules[k][1][d];\n if (dep === id || (Array.isArray(dep) && dep[dep.length - 1] === id)) {\n parents.push(k);\n }\n }\n }\n\n if (bundle.parent) {\n parents = parents.concat(getParents(bundle.parent, id));\n }\n\n return parents;\n}\n\nfunction hmrApply(bundle, asset) {\n var modules = bundle.modules;\n if (!modules) {\n return;\n }\n\n if (modules[asset.id] || !bundle.parent) {\n var fn = new Function('require', 'module', 'exports', asset.generated.js);\n asset.isNew = !modules[asset.id];\n modules[asset.id] = [fn, asset.deps];\n } else if (bundle.parent) {\n hmrApply(bundle.parent, asset);\n }\n}\n\nfunction hmrAcceptCheck(bundle, id) {\n var modules = bundle.modules;\n if (!modules) {\n return;\n }\n\n if (!modules[id] && bundle.parent) {\n return hmrAcceptCheck(bundle.parent, id);\n }\n\n if (checkedAssets[id]) {\n return;\n }\n checkedAssets[id] = true;\n\n var cached = bundle.cache[id];\n\n assetsToAccept.push([bundle, id]);\n\n if (cached && cached.hot && cached.hot._acceptCallbacks.length) {\n return true;\n }\n\n return getParents(global.parcelRequire, id).some(function (id) {\n return hmrAcceptCheck(global.parcelRequire, id)\n });\n}\n\nfunction hmrAcceptRun(bundle, id) {\n var cached = bundle.cache[id];\n bundle.hotData = {};\n if (cached) {\n cached.hot.data = bundle.hotData;\n }\n\n if (cached && cached.hot && cached.hot._disposeCallbacks.length) {\n cached.hot._disposeCallbacks.forEach(function (cb) {\n cb(bundle.hotData);\n });\n }\n\n delete bundle.cache[id];\n bundle(id);\n\n cached = bundle.cache[id];\n if (cached && cached.hot && cached.hot._acceptCallbacks.length) {\n cached.hot._acceptCallbacks.forEach(function (cb) {\n cb();\n });\n return true;\n }\n}\n"]} \ No newline at end of file