diff --git a/CHANGELOG.md b/CHANGELOG.md index ca1f84a..f7ee1ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ # CHANGELOG +## 1.0.0-rc.30(2021-08-03) +### Fix +- BOSClient: fix issue of lack of '/' prefix of object url; + ## 1.0.0-rc.29(2021-08-03) +### Feature - BOSClient: support "config.removeVersionPrefix"(boolean) parameter to dynamic control 'v1' prefix of resource in generatePresignedUrl, generateUrl; ## 1.0.0-rc.28(2021-03-26) diff --git a/README.md b/README.md index 90c3ba1..181391e 100644 --- a/README.md +++ b/README.md @@ -17,5 +17,5 @@ Baidu Cloud Engine JavaScript SDK ## 通过CDN引用 ```html - + ``` diff --git a/dist/baidubce-sdk.bundle.js b/dist/baidubce-sdk.bundle.js index 387071a..b14f4b6 100644 --- a/dist/baidubce-sdk.bundle.js +++ b/dist/baidubce-sdk.bundle.js @@ -44710,7 +44710,7 @@ exports.createContext = Script.createContext = function (context) { },{"indexof":134}],208:[function(require,module,exports){ module.exports={ "name": "@baiducloud/sdk", - "version": "1.0.0-rc.29", + "version": "1.0.0-rc.30", "description": "Baidu Cloud Engine JavaScript SDK", "main": "./index.js", "browser": { @@ -45728,7 +45728,7 @@ BosClient.prototype.generatePresignedUrl = function (bucketName, key, timestamp, params = params || {}; var resource = path.normalize(path.join( - config.removeVersionPrefix ? '' : '/v1', + config.removeVersionPrefix ? '/' : '/v1', /\.[\w\-]+\.bcebos\.com$/.test(config.endpoint) ? '' : strings.normalize(bucketName || ''), strings.normalize(key || '', false) )).replace(/\\/g, '/'); @@ -45750,7 +45750,7 @@ BosClient.prototype.generatePresignedUrl = function (bucketName, key, timestamp, BosClient.prototype.generateUrl = function (bucketName, key, pipeline, cdn, config) { config = u.extend({}, this.config, config); var resource = path.normalize(path.join( - config.removeVersionPrefix ? '' : '/v1', + config.removeVersionPrefix ? '/' : '/v1', strings.normalize(bucketName || ''), strings.normalize(key || '', false) )).replace(/\\/g, '/'); @@ -46630,7 +46630,7 @@ BosClient.prototype.sendRequest = function (httpMethod, varArgs) { var config = u.extend({}, this.config, args.config); var resource = path.normalize(path.join( - args.removeVersionPrefix ? '' : '/v1', + args.removeVersionPrefix ? '/' : '/v1', /\.[\w\-]+\.bcebos\.com$/.test(config.endpoint) ? '' : strings.normalize(args.bucketName || ''), strings.normalize(args.key || '', false) )).replace(/\\/g, '/'); diff --git a/dist/baidubce-sdk.bundle.min.js b/dist/baidubce-sdk.bundle.min.js index 22a24e2..52cce70 100644 --- a/dist/baidubce-sdk.bundle.min.js +++ b/dist/baidubce-sdk.bundle.min.js @@ -17,8 +17,8 @@ e.head[t]=r>=o?r-o:0}while(--n);n=o,t=n;do{r=e.prev[--t],e.prev[t]=r>=o?r-o:0}wh y(e,a,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],h(e,t),l(a,f,e.bl_count)}function x(e,t,n){var r,i,a=-1,o=t[1],s=0,c=7,f=4;for(0===o&&(c=138,f=3),t[2*(n+1)+1]=65535,r=0;r<=n;r++)i=o,o=t[2*(r+1)+1],++s=3&&0===e.bl_tree[2*ne[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}function S(e,t,n,r){var i;for(c(e,t-257,5),c(e,n-1,5),c(e,r-4,4),i=0;i>>=1)if(1&n&&0!==e.dyn_ltree[2*t])return B;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return N;for(t=32;t0?(e.strm.data_type===q&&(e.strm.data_type=T(e)),w(e,e.l_desc),w(e,e.d_desc),o=E(e),i=e.opt_len+3+7>>>3,(a=e.static_len+3+7>>>3)<=i&&(i=a)):i=a=n+5,n+4<=i&&-1!==t?j(e,t,n,r):e.strategy===O||a===i?(c(e,(P<<1)+(r?1:0),3),_(e,re,ie)):(c(e,(L<<1)+(r?1:0),3),S(e,e.l_desc.max_code+1,e.d_desc.max_code+1,o+1),_(e,e.dyn_ltree,e.dyn_dtree)),b(e),r&&m(e)}function I(e,t,n){return e.pending_buf[e.d_buf+2*e.last_lit]=t>>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&n,e.last_lit++,0===t?e.dyn_ltree[2*n]++:(e.matches++,t--,e.dyn_ltree[2*(oe[n]+D+1)]++,e.dyn_dtree[2*o(t)]++),e.last_lit===e.lit_bufsize-1}var C=e("../utils/common"),O=4,B=0,N=1,q=2,U=0,P=1,L=2,z=29,D=256,F=D+1+z,G=30,H=19,Z=2*F+1,K=15,X=16,J=7,Y=256,V=16,W=17,$=18,Q=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],ee=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],te=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],ne=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],re=new Array(2*(F+2));r(re);var ie=new Array(2*G);r(ie);var ae=new Array(512);r(ae);var oe=new Array(256);r(oe);var se=new Array(z);r(se);var ce=new Array(G);r(ce);var fe,ue,de,he=!1;n._tr_init=A,n._tr_stored_block=j,n._tr_flush_block=M,n._tr_tally=I,n._tr_align=R},{"../utils/common":143}],153:[function(e,t,n){"use strict";function r(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}t.exports=r},{}],154:[function(e,t,n){t.exports={"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}},{}],155:[function(e,t,n){"use strict";var r=e("asn1.js");n.certificate=e("./certificate");var i=r.define("RSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())});n.RSAPrivateKey=i;var a=r.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())});n.RSAPublicKey=a;var o=r.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(s),this.key("subjectPublicKey").bitstr())});n.PublicKey=o;var s=r.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())}),c=r.define("PrivateKeyInfo",function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(s),this.key("subjectPrivateKey").octstr())});n.PrivateKey=c;var f=r.define("EncryptedPrivateKeyInfo",function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())});n.EncryptedPrivateKey=f;var u=r.define("DSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())});n.DSAPrivateKey=u,n.DSAparam=r.define("DSAparam",function(){this.int()});var d=r.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(h),this.key("publicKey").optional().explicit(1).bitstr())});n.ECPrivateKey=d;var h=r.define("ECParameters",function(){this.choice({namedCurve:this.objid()})});n.signature=r.define("signature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())})},{"./certificate":156,"asn1.js":3}],156:[function(e,t,n){"use strict";var r=e("asn1.js"),i=r.define("Time",function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})}),a=r.define("AttributeTypeValue",function(){this.seq().obj(this.key("type").objid(),this.key("value").any())}),o=r.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())}),s=r.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(o),this.key("subjectPublicKey").bitstr())}),c=r.define("RelativeDistinguishedName",function(){this.setof(a)}),f=r.define("RDNSequence",function(){this.seqof(c)}),u=r.define("Name",function(){this.choice({rdnSequence:this.use(f)})}),d=r.define("Validity",function(){this.seq().obj(this.key("notBefore").use(i),this.key("notAfter").use(i))}),h=r.define("Extension",function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())}),l=r.define("TBSCertificate",function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(o),this.key("issuer").use(u),this.key("validity").use(d),this.key("subject").use(u),this.key("subjectPublicKeyInfo").use(s),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(h).optional())}),p=r.define("X509Certificate",function(){this.seq().obj(this.key("tbsCertificate").use(l),this.key("signatureAlgorithm").use(o),this.key("signatureValue").bitstr())});t.exports=p},{"asn1.js":3}],157:[function(e,t,n){var r=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r\+\/\=]+)[\n\r]+/m,i=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,a=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r\+\/\=]+)-----END \1-----$/m,o=e("evp_bytestokey"),s=e("browserify-aes"),c=e("safe-buffer").Buffer;t.exports=function(e,t){var n,f=e.toString(),u=f.match(r);if(u){var d="aes"+u[1],h=c.from(u[2],"hex"),l=c.from(u[3].replace(/[\r\n]/g,""),"base64"),p=o(t,h.slice(0,8),parseInt(u[1],10)).key,b=[],m=s.createDecipheriv(d,p,h);b.push(m.update(l)),b.push(m.final()),n=c.concat(b)}else{var v=f.match(a);n=new c(v[2].replace(/[\r\n]/g,""),"base64")}return{tag:f.match(i)[1],data:n}}},{"browserify-aes":28,evp_bytestokey:95,"safe-buffer":190}],158:[function(e,t,n){function r(e){var t;"object"!=typeof e||u.isBuffer(e)||(t=e.passphrase,e=e.key),"string"==typeof e&&(e=u.from(e));var n,r,o=s(e,t),c=o.tag,f=o.data;switch(c){case"CERTIFICATE":r=a.certificate.decode(f,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(r||(r=a.PublicKey.decode(f,"der")),n=r.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return a.RSAPublicKey.decode(r.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return r.subjectPrivateKey=r.subjectPublicKey,{type:"ec",data:r};case"1.2.840.10040.4.1":return r.algorithm.params.pub_key=a.DSAparam.decode(r.subjectPublicKey.data,"der"),{type:"dsa",data:r.algorithm.params};default:throw new Error("unknown key id "+n)}throw new Error("unknown key type "+c);case"ENCRYPTED PRIVATE KEY":f=a.EncryptedPrivateKey.decode(f,"der"),f=i(f,t);case"PRIVATE KEY":switch(r=a.PrivateKey.decode(f,"der"),n=r.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return a.RSAPrivateKey.decode(r.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:r.algorithm.curve,privateKey:a.ECPrivateKey.decode(r.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return r.algorithm.params.priv_key=a.DSAparam.decode(r.subjectPrivateKey,"der"),{type:"dsa",params:r.algorithm.params};default:throw new Error("unknown key id "+n)}throw new Error("unknown key type "+c);case"RSA PUBLIC KEY":return a.RSAPublicKey.decode(f,"der");case"RSA PRIVATE KEY":return a.RSAPrivateKey.decode(f,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:a.DSAPrivateKey.decode(f,"der")};case"EC PRIVATE KEY":return f=a.ECPrivateKey.decode(f,"der"),{curve:f.parameters.value,privateKey:f.privateKey};default:throw new Error("unknown key type "+c)}}function i(e,t){var n=e.algorithm.decrypt.kde.kdeparams.salt,r=parseInt(e.algorithm.decrypt.kde.kdeparams.iters.toString(),10),i=o[e.algorithm.decrypt.cipher.algo.join(".")],a=e.algorithm.decrypt.cipher.iv,s=e.subjectPrivateKey,d=parseInt(i.split("-")[1],10)/8,h=f.pbkdf2Sync(t,n,r,d,"sha1"),l=c.createDecipheriv(i,h,a),p=[];return p.push(l.update(s)),p.push(l.final()),u.concat(p)}var a=e("./asn1"),o=e("./aesid.json"),s=e("./fixProc"),c=e("browserify-aes"),f=e("pbkdf2"),u=e("safe-buffer").Buffer;t.exports=r,r.signature=a.signature},{"./aesid.json":154,"./asn1":155,"./fixProc":157,"browserify-aes":28,pbkdf2:160,"safe-buffer":190}],159:[function(e,t,n){(function(e){function t(e,t){for(var n=0,r=e.length-1;r>=0;r--){var i=e[r];"."===i?e.splice(r,1):".."===i?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n--;n)e.unshift("..");return e}function r(e){"string"!=typeof e&&(e+="");var t,n=0,r=-1,i=!0;for(t=e.length-1;t>=0;--t)if(47===e.charCodeAt(t)){if(!i){n=t+1;break}}else-1===r&&(i=!1,r=t+1);return-1===r?"":e.slice(n,r)}function i(e,t){if(e.filter)return e.filter(t);for(var n=[],r=0;r=-1&&!r;a--){var o=a>=0?arguments[a]:e.cwd();if("string"!=typeof o)throw new TypeError("Arguments to path.resolve must be strings");o&&(n=o+"/"+n,r="/"===o.charAt(0))}return n=t(i(n.split("/"),function(e){return!!e}),!r).join("/"),(r?"/":"")+n||"."},n.normalize=function(e){var r=n.isAbsolute(e),o="/"===a(e,-1);return e=t(i(e.split("/"),function(e){return!!e}),!r).join("/"),e||r||(e="."),e&&o&&(e+="/"),(r?"/":"")+e},n.isAbsolute=function(e){return"/"===e.charAt(0)},n.join=function(){var e=Array.prototype.slice.call(arguments,0);return n.normalize(i(e,function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e}).join("/"))},n.relative=function(e,t){function r(e){for(var t=0;t=0&&""===e[n];n--);return t>n?[]:e.slice(t,n-t+1)}e=n.resolve(e).substr(1),t=n.resolve(t).substr(1);for(var i=r(e.split("/")),a=r(t.split("/")),o=Math.min(i.length,a.length),s=o,c=0;c=1;--a)if(47===(t=e.charCodeAt(a))){if(!i){r=a;break}}else i=!1;return-1===r?n?"/":".":n&&1===r?"/":e.slice(0,r)},n.basename=function(e,t){var n=r(e);return t&&n.substr(-1*t.length)===t&&(n=n.substr(0,n.length-t.length)),n},n.extname=function(e){"string"!=typeof e&&(e+="");for(var t=-1,n=0,r=-1,i=!0,a=0,o=e.length-1;o>=0;--o){var s=e.charCodeAt(o);if(47!==s)-1===r&&(i=!1,r=o+1),46===s?-1===t?t=o:1!==a&&(a=1):-1!==t&&(a=-1);else if(!i){n=o+1;break}}return-1===t||-1===r||0===a||1===a&&t===r-1&&t===n+1?"":e.slice(t,r)};var a="b"==="ab".substr(-1)?function(e,t,n){return e.substr(t,n)}:function(e,t,n){return t<0&&(t=e.length+t),e.substr(t,n)}}).call(this,e("_process"))},{_process:165}],160:[function(e,t,n){n.pbkdf2=e("./lib/async"),n.pbkdf2Sync=e("./lib/sync")},{"./lib/async":161,"./lib/sync":164}],161:[function(e,t,n){(function(n,r){function i(e){if(r.process&&!r.process.browser)return Promise.resolve(!1);if(!h||!h.importKey||!h.deriveBits)return Promise.resolve(!1);if(void 0!==p[e])return p[e];s=s||d.alloc(8);var t=a(s,s,10,128,e).then(function(){return!0}).catch(function(){return!1});return p[e]=t,t}function a(e,t,n,r,i){return h.importKey("raw",e,{name:"PBKDF2"},!1,["deriveBits"]).then(function(e){return h.deriveBits({name:"PBKDF2",salt:t,iterations:n,hash:{name:i}},e,r<<3)}).then(function(e){return d.from(e)})}function o(e,t){e.then(function(e){n.nextTick(function(){t(null,e)})},function(e){n.nextTick(function(){t(e)})})}var s,c=e("./precondition"),f=e("./default-encoding"),u=e("./sync"),d=e("safe-buffer").Buffer,h=r.crypto&&r.crypto.subtle,l={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},p=[];t.exports=function(e,t,s,h,p,b){"function"==typeof p&&(b=p,p=void 0),p=p||"sha1";var m=l[p.toLowerCase()];if(!m||"function"!=typeof r.Promise)return n.nextTick(function(){var n;try{n=u(e,t,s,h,p)}catch(e){return b(e)}b(null,n)});if(c(e,t,s,h),"function"!=typeof b)throw new Error("No callback provided to pbkdf2");d.isBuffer(e)||(e=d.from(e,f)),d.isBuffer(t)||(t=d.from(t,f)),o(i(m).then(function(n){return n?a(e,t,s,h,m):u(e,t,s,h,p)}),b)}}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./default-encoding":162,"./precondition":163,"./sync":164,_process:165,"safe-buffer":190}],162:[function(e,t,n){(function(e){var n;if(e.browser)n="utf-8";else{n=parseInt(e.version.split(".")[0].slice(1),10)>=6?"utf-8":"binary"}t.exports=n}).call(this,e("_process"))},{_process:165}],163:[function(e,t,n){(function(e){function n(t,n){if("string"!=typeof t&&!e.isBuffer(t))throw new TypeError(n+" must be a buffer or string")}var r=Math.pow(2,30)-1;t.exports=function(e,t,i,a){if(n(e,"Password"),n(t,"Salt"),"number"!=typeof i)throw new TypeError("Iterations not a number");if(i<0)throw new TypeError("Bad iterations");if("number"!=typeof a)throw new TypeError("Key length not a number");if(a<0||a>r||a!==a)throw new TypeError("Bad key length")}}).call(this,{isBuffer:e("../../is-buffer/index.js")})},{"../../is-buffer/index.js":136}],164:[function(e,t,n){function r(e,t,n){var r=i(e),a="sha512"===e||"sha384"===e?128:64;t.length>a?t=r(t):t.length1)for(var n=1;n=t.length){a++;break}var o=t.slice(2,i-1);if(("0002"!==r.toString("hex")&&!n||"0001"!==r.toString("hex")&&n)&&a++,o.length<8&&a++,a)throw new Error("decryption error");return t.slice(i)}function a(e,t){e=l.from(e),t=l.from(t);var n=0,r=e.length;e.length!==t.length&&(n++,r=Math.min(e.length,t.length));for(var i=-1;++ic||new f(t).cmp(s.modulus)>=0)throw new Error("decryption error");var d;d=n?h(new f(t),s):u(t,s);var p=l.alloc(c-d.length);if(d=l.concat([p,d],c),4===a)return r(s,d);if(1===a)return i(s,d,n);if(3===a)return d;throw new Error("unknown padding")}},{"./mgf":167,"./withPublic":170,"./xor":171,"bn.js":23,"browserify-rsa":46,"create-hash":61,"parse-asn1":158,"safe-buffer":190}],169:[function(e,t,n){function r(e,t){var n=e.modulus.byteLength(),r=t.length,i=c("sha1").update(p.alloc(0)).digest(),a=i.length,o=2*a;if(r>n-o-2)throw new Error("message too long");var h=p.alloc(n-r-o-2),l=n-a-1,b=s(a),m=u(p.concat([i,h,p.alloc(1,1),t],l),f(b,l)),v=u(b,f(m,a));return new d(p.concat([p.alloc(1),v,m],n))}function i(e,t,n){var r=t.length,i=e.modulus.byteLength();if(r>i-11)throw new Error("message too long");var o;return o=n?p.alloc(i-r-3,255):a(i-r-3),new d(p.concat([p.from([0,n?1:2]),o,p.alloc(1),t],i))}function a(e){for(var t,n=p.allocUnsafe(e),r=0,i=s(2*e),a=0;r=0)throw new Error("data too long for modulus")}return n?l(s,c):h(s,c)}},{"./mgf":167,"./withPublic":170,"./xor":171,"bn.js":23,"browserify-rsa":46,"create-hash":61,"parse-asn1":158,randombytes:177,"safe-buffer":190}],170:[function(e,t,n){function r(e,t){return a.from(e.toRed(i.mont(t.modulus)).redPow(new i(t.publicExponent)).fromRed().toArray())}var i=e("bn.js"),a=e("safe-buffer").Buffer;t.exports=r},{"bn.js":23,"safe-buffer":190}],171:[function(e,t,n){t.exports=function(e,t){for(var n=e.length,r=-1;++r1&&(r=n[0]+"@",e=n[1]),e=e.replace(C,"."),r+a(e.split("."),t).join(".")}function s(e){for(var t,n,r=[],i=0,a=e.length;i=55296&&t<=56319&&i65535&&(e-=65536,t+=q(e>>>10&1023|55296),e=56320|1023&e),t+=q(e)}).join("")}function f(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:x}function u(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function d(e,t,n){var r=0;for(e=n?N(e/T):e>>1,e+=N(e/t);e>B*E>>1;r+=x)e=N(e/B);return N(r+(B+1)*e/(e+S))}function h(e){var t,n,r,a,o,s,u,h,l,p,b=[],m=e.length,v=0,g=j,y=A;for(n=e.lastIndexOf(R),n<0&&(n=0),r=0;r=128&&i("not-basic"),b.push(e.charCodeAt(r));for(a=n>0?n+1:0;a=m&&i("invalid-input"),h=f(e.charCodeAt(a++)),(h>=x||h>N((w-v)/s))&&i("overflow"),v+=h*s,l=u<=y?k:u>=y+E?E:u-y,!(hN(w/p)&&i("overflow"),s*=p;t=b.length+1,y=d(v-o,t,0==o),N(v/t)>w-g&&i("overflow"),g+=N(v/t),v%=t,b.splice(v++,0,g)}return c(b)}function l(e){var t,n,r,a,o,c,f,h,l,p,b,m,v,g,y,_=[];for(e=s(e),m=e.length,t=j,n=0,o=A,c=0;c=t&&bN((w-n)/v)&&i("overflow"),n+=(f-t)*v,t=f,c=0;cw&&i("overflow"),b==t){for(h=n,l=x;p=l<=o?k:l>=o+E?E:l-o,!(h= 0x80 (not a basic code point)","invalid-input":"Invalid input"},B=x-k,N=Math.floor,q=String.fromCharCode;if(y={version:"1.4.1",ucs2:{decode:s,encode:c},decode:h,encode:l,toASCII:b,toUnicode:p},"function"==typeof define&&"object"==typeof define.amd&&define.amd)define("punycode",function(){return y});else if(m&&v)if(t.exports==m)v.exports=y;else for(_ in y)y.hasOwnProperty(_)&&(m[_]=y[_]);else r.punycode=y}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],173:[function(e,t,n){(function(e){!function(e){"use strict";if("function"==typeof bootstrap)bootstrap("promise",e);else if("object"==typeof n&&"object"==typeof t)t.exports=e();else if("function"==typeof define&&define.amd)define(e);else if("undefined"!=typeof ses){if(!ses.ok())return;ses.makeQ=e}else{if("undefined"==typeof window&&"undefined"==typeof self)throw new Error("This environment was not anticipated by Q. Please file a bug.");var r="undefined"!=typeof window?window:self,i=r.Q;r.Q=e(),r.Q.noConflict=function(){return r.Q=i,this}}}(function(){"use strict";function t(e){return function(){return X.apply(e,arguments)}}function n(e){return e===Object(e)}function r(e){return"[object StopIteration]"===ne(e)||e instanceof G}function i(e,t){if(D&&t.stack&&"object"==typeof e&&null!==e&&e.stack){for(var n=[],r=t;r;r=r.source)r.stack&&(!e.__minimumStackCounter__||e.__minimumStackCounter__>r.stackCounter)&&(Q(e,"__minimumStackCounter__",{value:r.stackCounter,configurable:!0}),n.unshift(r.stack));n.unshift(e.stack);var i=n.join("\n"+re+"\n"),o=a(i);Q(e,"stack",{value:o,configurable:!0})}}function a(e){for(var t=e.split("\n"),n=[],r=0;r=H&&r<=fe}function f(){if(D)try{throw new Error}catch(r){var e=r.stack.split("\n"),t=e[0].indexOf("@")>0?e[1]:e[2],n=s(t);if(!n)return;return F=n[0],n[1]}}function u(e){return e instanceof p?e:g(e)?A(e):T(e)}function d(){function e(e){t=e,u.longStackSupport&&D&&(a.source=e),Y(n,function(t,n){u.nextTick(function(){e.promiseDispatch.apply(e,n)})},void 0),n=void 0,r=void 0}var t,n=[],r=[],i=$(d.prototype),a=$(p.prototype);if(a.promiseDispatch=function(e,i,a){var o=J(arguments);n?(n.push(o),"when"===i&&a[1]&&r.push(a[1])):u.nextTick(function(){t.promiseDispatch.apply(t,o)})},a.valueOf=function(){if(n)return a;var e=m(t);return v(e)&&(t=e),e},a.inspect=function(){return t?t.inspect():{state:"pending"}},u.longStackSupport&&D)try{throw new Error}catch(e){a.stack=e.stack.substring(e.stack.indexOf("\n")+1),a.stackCounter=ie++}return i.promise=a,i.resolve=function(n){t||e(u(n))},i.fulfill=function(n){t||e(T(n))},i.reject=function(n){t||e(S(n))},i.notify=function(e){t||Y(r,function(t,n){u.nextTick(function(){n(e)})},void 0)},i}function h(e){if("function"!=typeof e)throw new TypeError("resolver must be a function.");var t=d();try{e(t.resolve,t.reject,t.notify)}catch(e){t.reject(e)}return t.promise}function l(e){return h(function(t,n){for(var r=0,i=e.length;r=r)throw new TypeError}for(;n2?e.resolve(J(arguments,1)):e.resolve(n)}},u.Promise=h,u.promise=h,h.race=l,h.all=N,h.reject=S,h.resolve=u,u.passByCopy=function(e){return e},p.prototype.passByCopy=function(){return this},u.join=function(e,t){return u(e).join(t)},p.prototype.join=function(e){return u([this,e]).spread(function(e,t){if(e===t)return e;throw new Error("Q can't join: not the same: "+e+" "+t)})},u.race=l,p.prototype.race=function(){return this.then(u.race)},u.makePromise=p,p.prototype.toString=function(){return"[object Promise]"},p.prototype.then=function(e,t,n){function r(t){try{return"function"==typeof e?e(t):t}catch(e){return S(e)}}function a(e){if("function"==typeof t){i(e,s);try{return t(e)}catch(e){return S(e)}}return S(e)}function o(e){return"function"==typeof n?n(e):e}var s=this,c=d(),f=!1;return u.nextTick(function(){s.promiseDispatch(function(e){f||(f=!0,c.resolve(r(e)))},"when",[function(e){f||(f=!0,c.resolve(a(e)))}])}),s.promiseDispatch(void 0,"when",[void 0,function(e){var t,n=!1;try{t=o(e)}catch(e){if(n=!0,!u.onerror)throw e;u.onerror(e)}n||c.notify(t)}]),c.promise},u.tap=function(e,t){return u(e).tap(t)},p.prototype.tap=function(e){return e=u(e),this.then(function(t){return e.fcall(t).thenResolve(t)})},u.when=b,p.prototype.thenResolve=function(e){return this.then(function(){return e})},u.thenResolve=function(e,t){return u(e).thenResolve(t)},p.prototype.thenReject=function(e){return this.then(function(){throw e})},u.thenReject=function(e,t){return u(e).thenReject(t)},u.nearer=m,u.isPromise=v,u.isPromiseAlike=g,u.isPending=y,p.prototype.isPending=function(){return"pending"===this.inspect().state},u.isFulfilled=_,p.prototype.isFulfilled=function(){return"fulfilled"===this.inspect().state},u.isRejected=w,p.prototype.isRejected=function(){return"rejected"===this.inspect().state};var ae=[],oe=[],se=[],ce=!0;u.resetUnhandledRejections=x,u.getUnhandledReasons=function(){return ae.slice()},u.stopUnhandledRejectionTracking=function(){x(),ce=!1},x(),u.reject=S,u.fulfill=T,u.master=j,u.spread=R,p.prototype.spread=function(e,t){return this.all().then(function(t){return e.apply(void 0,t)},t)},u.async=M,u.spawn=I,u.return=C,u.promised=O,u.dispatch=B,p.prototype.dispatch=function(e,t){var n=this,r=d();return u.nextTick(function(){n.promiseDispatch(r.resolve,e,t)}),r.promise},u.get=function(e,t){return u(e).dispatch("get",[t])},p.prototype.get=function(e){return this.dispatch("get",[e])},u.set=function(e,t,n){return u(e).dispatch("set",[t,n])},p.prototype.set=function(e,t){return this.dispatch("set",[e,t])},u.del=u.delete=function(e,t){return u(e).dispatch("delete",[t])},p.prototype.del=p.prototype.delete=function(e){return this.dispatch("delete",[e])},u.mapply=u.post=function(e,t,n){return u(e).dispatch("post",[t,n])},p.prototype.mapply=p.prototype.post=function(e,t){return this.dispatch("post",[e,t])},u.send=u.mcall=u.invoke=function(e,t){return u(e).dispatch("post",[t,J(arguments,2)])},p.prototype.send=p.prototype.mcall=p.prototype.invoke=function(e){return this.dispatch("post",[e,J(arguments,1)])},u.fapply=function(e,t){return u(e).dispatch("apply",[void 0,t])},p.prototype.fapply=function(e){return this.dispatch("apply",[void 0,e])},u.try=u.fcall=function(e){return u(e).dispatch("apply",[void 0,J(arguments,1)])},p.prototype.fcall=function(){return this.dispatch("apply",[void 0,J(arguments)])},u.fbind=function(e){var t=u(e),n=J(arguments,1);return function(){return t.dispatch("apply",[this,n.concat(J(arguments))])}},p.prototype.fbind=function(){var e=this,t=J(arguments);return function(){return e.dispatch("apply",[this,t.concat(J(arguments))])}},u.keys=function(e){return u(e).dispatch("keys",[])},p.prototype.keys=function(){return this.dispatch("keys",[])},u.all=N,p.prototype.all=function(){return N(this)},u.any=q,p.prototype.any=function(){return q(this)},u.allResolved=function(e,t,n){return function(){return"undefined"!=typeof console&&"function"==typeof console.warn&&console.warn(t+" is deprecated, use "+n+" instead.",new Error("").stack),e.apply(e,arguments)}}(U,"allResolved","allSettled"),p.prototype.allResolved=function(){return U(this)},u.allSettled=P,p.prototype.allSettled=function(){return this.then(function(e){return N(W(e,function(e){function t(){return e.inspect()}return e=u(e),e.then(t,t)}))})},u.fail=u.catch=function(e,t){return u(e).then(void 0,t)},p.prototype.fail=p.prototype.catch=function(e){return this.then(void 0,e)},u.progress=L,p.prototype.progress=function(e){return this.then(void 0,void 0,e)},u.fin=u.finally=function(e,t){return u(e).finally(t)},p.prototype.fin=p.prototype.finally=function(e){if(!e||"function"!=typeof e.apply)throw new Error("Q can't apply finally callback");return e=u(e),this.then(function(t){return e.fcall().then(function(){return t})},function(t){return e.fcall().then(function(){throw t})})},u.done=function(e,t,n,r){return u(e).done(t,n,r)},p.prototype.done=function(t,n,r){var a=function(e){u.nextTick(function(){if(i(e,o),!u.onerror)throw e;u.onerror(e)})},o=t||n||r?this.then(t,n,r):this;"object"==typeof e&&e&&e.domain&&(a=e.domain.bind(a)),o.then(void 0,a)},u.timeout=function(e,t,n){return u(e).timeout(t,n)},p.prototype.timeout=function(e,t){var n=d(),r=setTimeout(function(){t&&"string"!=typeof t||(t=new Error(t||"Timed out after "+e+" ms"),t.code="ETIMEDOUT"),n.reject(t)},e);return this.then(function(e){clearTimeout(r),n.resolve(e)},function(e){clearTimeout(r),n.reject(e)},n.notify),n.promise},u.delay=function(e,t){return void 0===t&&(t=e,e=void 0),u(e).delay(t)},p.prototype.delay=function(e){return this.then(function(t){var n=d();return setTimeout(function(){n.resolve(t)},e),n.promise})},u.nfapply=function(e,t){return u(e).nfapply(t)},p.prototype.nfapply=function(e){var t=d(),n=J(e);return n.push(t.makeNodeResolver()),this.fapply(n).fail(t.reject),t.promise},u.nfcall=function(e){var t=J(arguments,1);return u(e).nfapply(t)},p.prototype.nfcall=function(){var e=J(arguments),t=d();return e.push(t.makeNodeResolver()),this.fapply(e).fail(t.reject),t.promise},u.nfbind=u.denodeify=function(e){if(void 0===e)throw new Error("Q can't wrap an undefined function");var t=J(arguments,1);return function(){var n=t.concat(J(arguments)),r=d();return n.push(r.makeNodeResolver()),u(e).fapply(n).fail(r.reject),r.promise}},p.prototype.nfbind=p.prototype.denodeify=function(){var e=J(arguments);return e.unshift(this),u.denodeify.apply(void 0,e)},u.nbind=function(e,t){var n=J(arguments,2);return function(){function r(){return e.apply(t,arguments)}var i=n.concat(J(arguments)),a=d();return i.push(a.makeNodeResolver()),u(r).fapply(i).fail(a.reject),a.promise}},p.prototype.nbind=function(){var e=J(arguments,0);return e.unshift(this),u.nbind.apply(void 0,e)},u.nmapply=u.npost=function(e,t,n){return u(e).npost(t,n)},p.prototype.nmapply=p.prototype.npost=function(e,t){var n=J(t||[]),r=d();return n.push(r.makeNodeResolver()),this.dispatch("post",[e,n]).fail(r.reject),r.promise},u.nsend=u.nmcall=u.ninvoke=function(e,t){var n=J(arguments,2),r=d();return n.push(r.makeNodeResolver()),u(e).dispatch("post",[t,n]).fail(r.reject),r.promise},p.prototype.nsend=p.prototype.nmcall=p.prototype.ninvoke=function(e){var t=J(arguments,1),n=d();return t.push(n.makeNodeResolver()),this.dispatch("post",[e,t]).fail(n.reject),n.promise},u.nodeify=z,p.prototype.nodeify=function(e){if(!e)return this;this.then(function(t){u.nextTick(function(){e(null,t)})},function(t){u.nextTick(function(){e(t)})})},u.noConflict=function(){throw new Error("Q.noConflict only works when Q is used as a global")};var fe=f();return u})}).call(this,e("_process"))},{_process:165}],174:[function(e,t,n){"use strict";function r(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.exports=function(e,t,n,a){t=t||"&",n=n||"=";var o={};if("string"!=typeof e||0===e.length)return o;var s=/\+/g;e=e.split(t);var c=1e3;a&&"number"==typeof a.maxKeys&&(c=a.maxKeys);var f=e.length;c>0&&f>c&&(f=c);for(var u=0;u=0?(d=b.substr(0,m),h=b.substr(m+1)):(d=b,h=""),l=decodeURIComponent(d),p=decodeURIComponent(h),r(o,l)?i(o[l])?o[l].push(p):o[l]=[o[l],p]:o[l]=p}return o};var i=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},{}],175:[function(e,t,n){"use strict";function r(e,t){if(e.map)return e.map(t);for(var n=[],r=0;rs)throw new RangeError("requested too many random bytes");var r=c.allocUnsafe(e);if(e>0)if(e>o)for(var i=0;ib||e<0)throw new TypeError("offset must be a uint32");if(e>l||e>t)throw new RangeError("offset out of range")}function o(e,t,n){if("number"!=typeof e||e!==e)throw new TypeError("size must be a number");if(e>b||e<0)throw new TypeError("size must be a uint32");if(e+t>n||e>l)throw new RangeError("buffer too small")}function s(e,t,n,i){if(!(h.isBuffer(e)||e instanceof r.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if("function"==typeof t)i=t,t=0,n=e.length;else if("function"==typeof n)i=n,n=e.length-t;else if("function"!=typeof i)throw new TypeError('"cb" argument must be a function');return a(t,e.length),o(n,t,e.length),c(e,t,n,i)}function c(e,n,r,i){if(t.browser){var a=e.buffer,o=new Uint8Array(a,n,r);return p.getRandomValues(o),i?void t.nextTick(function(){i(null,e)}):e}return i?void d(r,function(t,r){if(t)return i(t);r.copy(e,n),i(null,e)}):(d(r).copy(e,n),e)}function f(e,t,n){if(void 0===t&&(t=0),!(h.isBuffer(e)||e instanceof r.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');return a(t,e.length),void 0===n&&(n=e.length-t),o(n,t,e.length),c(e,t,n)}var u=e("safe-buffer"),d=e("randombytes"),h=u.Buffer,l=u.kMaxLength,p=r.crypto||r.msCrypto,b=Math.pow(2,32)-1;p&&p.getRandomValues||!t.browser?(n.randomFill=s,n.randomFillSync=f):(n.randomFill=i,n.randomFillSync=i)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:165,randombytes:177,"safe-buffer":190}],179:[function(e,t,n){t.exports=e("./lib/_stream_duplex.js")},{"./lib/_stream_duplex.js":180}],180:[function(e,t,n){(function(n){function r(e){if(!(this instanceof r))return new r(e);s.call(this,e),c.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",i)}function i(){this.allowHalfOpen||this._writableState.ended||n.nextTick(this.end.bind(this))}t.exports=r;var a=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t},o=e("core-util-is");o.inherits=e("inherits");var s=e("./_stream_readable"),c=e("./_stream_writable");o.inherits(r,s),function(e,t){for(var n=0,r=e.length;n0)if(t.ended&&!i){var s=new Error("stream.push() after EOF");e.emit("error",s)}else if(t.endEmitted&&i){var s=new Error("stream.unshift() after end event");e.emit("error",s)}else!t.decoder||i||r||(n=t.decoder.write(n)),i||(t.reading=!1),t.flowing&&0===t.length&&!t.sync?(e.emit("data",n),e.read(0)):(t.length+=t.objectMode?1:n.length,i?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&d(e)),l(e,t);else i||(t.reading=!1);return o(t)}function o(e){return!e.ended&&(e.needReadable||e.length=M)e=M;else{e--;for(var t=1;t<32;t<<=1)e|=e>>t;e++}return e}function c(e,t){return 0===t.length&&t.ended?0:t.objectMode?0===e?0:1:isNaN(e)||A.isNull(e)?t.flowing&&t.buffer.length?t.buffer[0].length:t.length:e<=0?0:(e>t.highWaterMark&&(t.highWaterMark=s(e)),e>t.length?t.ended?t.length:(t.needReadable=!0,0):e)}function f(e,t){var n=null;return A.isBuffer(t)||A.isString(t)||A.isNullOrUndefined(t)||e.objectMode||(n=new TypeError("Invalid non-string/buffer chunk")),n}function u(e,t){if(t.decoder&&!t.ended){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,d(e)}function d(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(R("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?n.nextTick(function(){h(e)}):h(e))}function h(e){R("emit readable"),e.emit("readable"),g(e)}function l(e,t){t.readingMore||(t.readingMore=!0,n.nextTick(function(){p(e,t)}))}function p(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=i)n=a?r.join(""):E.concat(r,i),r.length=0;else if(e0)throw new Error("endReadable called on non-empty stream");t.endEmitted||(t.ended=!0,n.nextTick(function(){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}))}function w(e,t){for(var n=0,r=e.length;n0)&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return R("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?_(this):d(this),null;if(0===(e=c(e,t))&&t.ended)return 0===t.length&&_(this),null;var r=t.needReadable;R("need readable",r),(0===t.length||t.length-e0?y(e,t):null,A.isNull(i)&&(t.needReadable=!0,e=0),t.length-=e,0!==t.length||t.ended||(t.needReadable=!0),n!==e&&t.ended&&0===t.length&&_(this),A.isNull(i)||this.emit("data",i),i},i.prototype._read=function(e){this.emit("error",new Error("not implemented"))},i.prototype.pipe=function(e,t){function r(e){R("onunpipe"),e===d&&a()}function i(){R("onend"),e.end()}function a(){R("cleanup"),e.removeListener("close",c),e.removeListener("finish",f),e.removeListener("drain",m),e.removeListener("error",s),e.removeListener("unpipe",r),d.removeListener("end",i),d.removeListener("end",a),d.removeListener("data",o),!h.awaitDrain||e._writableState&&!e._writableState.needDrain||m()}function o(t){R("ondata"),!1===e.write(t)&&(R("false write response, pause",d._readableState.awaitDrain),d._readableState.awaitDrain++,d.pause())}function s(t){R("onerror",t),u(),e.removeListener("error",s),0===S.listenerCount(e,"error")&&e.emit("error",t)}function c(){e.removeListener("finish",f),u()}function f(){R("onfinish"),e.removeListener("close",c),u()}function u(){R("unpipe"),d.unpipe(e)}var d=this,h=this._readableState;switch(h.pipesCount){case 0:h.pipes=e;break;case 1:h.pipes=[h.pipes,e];break;default:h.pipes.push(e)}h.pipesCount+=1,R("pipe count=%d opts=%j",h.pipesCount,t);var l=(!t||!1!==t.end)&&e!==n.stdout&&e!==n.stderr,p=l?i:a;h.endEmitted?n.nextTick(p):d.once("end",p),e.on("unpipe",r);var m=b(d);return e.on("drain",m),d.on("data",o),e._events&&e._events.error?k(e._events.error)?e._events.error.unshift(s):e._events.error=[s,e._events.error]:e.on("error",s),e.once("close",c),e.once("finish",f),e.emit("pipe",d),h.flowing||(R("pipe resume"),d.resume()),e},i.prototype.unpipe=function(e){var t=this._readableState;if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this),this);if(!e){var n=t.pipes,r=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i1){for(var n=[],r=0;r>>32-t}function a(e,t,n,r,a,o,s,c){return i(e+(t^n^r)+o+s|0,c)+a|0}function o(e,t,n,r,a,o,s,c){return i(e+(t&n|~t&r)+o+s|0,c)+a|0}function s(e,t,n,r,a,o,s,c){return i(e+((t|~n)^r)+o+s|0,c)+a|0}function c(e,t,n,r,a,o,s,c){return i(e+(t&r|n&~r)+o+s|0,c)+a|0}function f(e,t,n,r,a,o,s,c){return i(e+(t^(n|~r))+o+s|0,c)+a|0} var u=e("buffer").Buffer,d=e("inherits"),h=e("hash-base"),l=new Array(16),p=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],b=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],m=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],v=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],g=[0,1518500249,1859775393,2400959708,2840853838],y=[1352829926,1548603684,1836072691,2053994217,0];d(r,h),r.prototype._update=function(){for(var e=l,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);for(var n=0|this._a,r=0|this._b,u=0|this._c,d=0|this._d,h=0|this._e,_=0|this._a,w=0|this._b,x=0|this._c,k=0|this._d,E=0|this._e,S=0;S<80;S+=1){var T,A;S<16?(T=a(n,r,u,d,h,e[p[S]],g[0],m[S]),A=f(_,w,x,k,E,e[b[S]],y[0],v[S])):S<32?(T=o(n,r,u,d,h,e[p[S]],g[1],m[S]),A=c(_,w,x,k,E,e[b[S]],y[1],v[S])):S<48?(T=s(n,r,u,d,h,e[p[S]],g[2],m[S]),A=s(_,w,x,k,E,e[b[S]],y[2],v[S])):S<64?(T=c(n,r,u,d,h,e[p[S]],g[3],m[S]),A=o(_,w,x,k,E,e[b[S]],y[3],v[S])):(T=f(n,r,u,d,h,e[p[S]],g[4],m[S]),A=a(_,w,x,k,E,e[b[S]],y[4],v[S])),n=h,h=d,d=i(u,10),u=r,r=T,_=E,E=k,k=i(x,10),x=w,w=A}var j=this._b+u+k|0;this._b=this._c+d+E|0,this._c=this._d+h+_|0,this._d=this._e+n+w|0,this._e=this._a+r+x|0,this._a=j},r.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=u.alloc?u.alloc(20):new u(20);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e.writeInt32LE(this._e,16),e},t.exports=r},{buffer:56,"hash-base":96,inherits:135}],190:[function(e,t,n){function r(e,t){for(var n in e)t[n]=e[n]}function i(e,t,n){return o(e,t,n)}var a=e("buffer"),o=a.Buffer;o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?t.exports=a:(r(a,n),n.Buffer=i),r(o,i),i.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return o(e,t,n)},i.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var r=o(e);return void 0!==t?"string"==typeof n?r.fill(t,n):r.fill(t):r.fill(0),r},i.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return o(e)},i.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return a.SlowBuffer(e)}},{buffer:56}],191:[function(e,t,n){(function(n){"use strict";var r,i=e("buffer"),a=i.Buffer,o={};for(r in i)i.hasOwnProperty(r)&&"SlowBuffer"!==r&&"Buffer"!==r&&(o[r]=i[r]);var s=o.Buffer={};for(r in a)a.hasOwnProperty(r)&&"allocUnsafe"!==r&&"allocUnsafeSlow"!==r&&(s[r]=a[r]);if(o.Buffer.prototype=a.prototype,s.from&&s.from!==Uint8Array.from||(s.from=function(e,t,n){if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type '+typeof e);if(e&&void 0===e.length)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);return a(e,t,n)}),s.alloc||(s.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError('The "size" argument must be of type number. Received type '+typeof e);if(e<0||e>=2*(1<<30))throw new RangeError('The value "'+e+'" is invalid for option "size"');var r=a(e);return t&&0!==t.length?"string"==typeof n?r.fill(t,n):r.fill(t):r.fill(0),r}),!o.kStringMaxLength)try{o.kStringMaxLength=n.binding("buffer").kStringMaxLength}catch(e){}o.constants||(o.constants={MAX_LENGTH:o.kMaxLength},o.kStringMaxLength&&(o.constants.MAX_STRING_LENGTH=o.kStringMaxLength)),t.exports=o}).call(this,e("_process"))},{_process:165,buffer:56}],192:[function(e,t,n){function r(e,t){this._block=i.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}var i=e("safe-buffer").Buffer;r.prototype.update=function(e,t){"string"==typeof e&&(t=t||"utf8",e=i.from(e,t));for(var n=this._block,r=this._blockSize,a=e.length,o=this._len,s=0;s=this._finalSize&&(this._update(this._block),this._block.fill(0));var n=8*this._len;if(n<=4294967295)this._block.writeUInt32BE(n,this._blockSize-4);else{var r=(4294967295&n)>>>0,i=(n-r)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(r,this._blockSize-4)}this._update(this._block);var a=this._hash();return e?a.toString(e):a},r.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=r},{"safe-buffer":190}],193:[function(e,t,n){var n=t.exports=function(e){e=e.toLowerCase();var t=n[e];if(!t)throw new Error(e+" is not supported (we accept pull requests)");return new t};n.sha=e("./sha"),n.sha1=e("./sha1"),n.sha224=e("./sha224"),n.sha256=e("./sha256"),n.sha384=e("./sha384"),n.sha512=e("./sha512")},{"./sha":194,"./sha1":195,"./sha224":196,"./sha256":197,"./sha384":198,"./sha512":199}],194:[function(e,t,n){function r(){this.init(),this._w=d,c.call(this,64,56)}function i(e){return e<<5|e>>>27}function a(e){return e<<30|e>>>2}function o(e,t,n,r){return 0===e?t&n|~t&r:2===e?t&n|t&r|n&r:t^n^r}var s=e("inherits"),c=e("./hash"),f=e("safe-buffer").Buffer,u=[1518500249,1859775393,-1894007588,-899497514],d=new Array(80);s(r,c),r.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},r.prototype._update=function(e){for(var t=this._w,n=0|this._a,r=0|this._b,s=0|this._c,c=0|this._d,f=0|this._e,d=0;d<16;++d)t[d]=e.readInt32BE(4*d);for(;d<80;++d)t[d]=t[d-3]^t[d-8]^t[d-14]^t[d-16];for(var h=0;h<80;++h){var l=~~(h/20),p=i(n)+o(l,r,s,c)+f+t[h]+u[l]|0;f=c,c=s,s=a(r),r=n,n=p}this._a=n+this._a|0,this._b=r+this._b|0,this._c=s+this._c|0,this._d=c+this._d|0,this._e=f+this._e|0},r.prototype._hash=function(){var e=f.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},t.exports=r},{"./hash":192,inherits:135,"safe-buffer":190}],195:[function(e,t,n){function r(){this.init(),this._w=h,f.call(this,64,56)}function i(e){return e<<1|e>>>31}function a(e){return e<<5|e>>>27}function o(e){return e<<30|e>>>2}function s(e,t,n,r){return 0===e?t&n|~t&r:2===e?t&n|t&r|n&r:t^n^r}var c=e("inherits"),f=e("./hash"),u=e("safe-buffer").Buffer,d=[1518500249,1859775393,-1894007588,-899497514],h=new Array(80);c(r,f),r.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},r.prototype._update=function(e){for(var t=this._w,n=0|this._a,r=0|this._b,c=0|this._c,f=0|this._d,u=0|this._e,h=0;h<16;++h)t[h]=e.readInt32BE(4*h);for(;h<80;++h)t[h]=i(t[h-3]^t[h-8]^t[h-14]^t[h-16]);for(var l=0;l<80;++l){var p=~~(l/20),b=a(n)+s(p,r,c,f)+u+t[l]+d[p]|0;u=f,f=c,c=o(r),r=n,n=b}this._a=n+this._a|0,this._b=r+this._b|0,this._c=c+this._c|0,this._d=f+this._d|0,this._e=u+this._e|0},r.prototype._hash=function(){var e=u.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},t.exports=r},{"./hash":192,inherits:135,"safe-buffer":190}],196:[function(e,t,n){function r(){this.init(),this._w=c,o.call(this,64,56)}var i=e("inherits"),a=e("./sha256"),o=e("./hash"),s=e("safe-buffer").Buffer,c=new Array(64);i(r,a),r.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},r.prototype._hash=function(){var e=s.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e},t.exports=r},{"./hash":192,"./sha256":197,inherits:135,"safe-buffer":190}],197:[function(e,t,n){function r(){this.init(),this._w=p,d.call(this,64,56)}function i(e,t,n){return n^e&(t^n)}function a(e,t,n){return e&t|n&(e|t)}function o(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function s(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function c(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}function f(e){return(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10}var u=e("inherits"),d=e("./hash"),h=e("safe-buffer").Buffer,l=[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],p=new Array(64);u(r,d),r.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},r.prototype._update=function(e){for(var t=this._w,n=0|this._a,r=0|this._b,u=0|this._c,d=0|this._d,h=0|this._e,p=0|this._f,b=0|this._g,m=0|this._h,v=0;v<16;++v)t[v]=e.readInt32BE(4*v);for(;v<64;++v)t[v]=f(t[v-2])+t[v-7]+c(t[v-15])+t[v-16]|0;for(var g=0;g<64;++g){var y=m+s(h)+i(h,p,b)+l[g]+t[g]|0,_=o(n)+a(n,r,u)|0;m=b,b=p,p=h,h=d+y|0,d=u,u=r,r=n,n=y+_|0}this._a=n+this._a|0,this._b=r+this._b|0,this._c=u+this._c|0,this._d=d+this._d|0,this._e=h+this._e|0,this._f=p+this._f|0,this._g=b+this._g|0,this._h=m+this._h|0},r.prototype._hash=function(){var e=h.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},t.exports=r},{"./hash":192,inherits:135,"safe-buffer":190}],198:[function(e,t,n){function r(){this.init(),this._w=c,o.call(this,128,112)}var i=e("inherits"),a=e("./sha512"),o=e("./hash"),s=e("safe-buffer").Buffer,c=new Array(160);i(r,a),r.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},r.prototype._hash=function(){function e(e,n,r){t.writeInt32BE(e,r),t.writeInt32BE(n,r+4)}var t=s.allocUnsafe(48);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=r},{"./hash":192,"./sha512":199,inherits:135,"safe-buffer":190}],199:[function(e,t,n){function r(){this.init(),this._w=v,p.call(this,128,112)}function i(e,t,n){return n^e&(t^n)}function a(e,t,n){return e&t|n&(e|t)}function o(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function s(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function c(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function f(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function u(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function d(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function h(e,t){return e>>>0>>0?1:0}var l=e("inherits"),p=e("./hash"),b=e("safe-buffer").Buffer,m=[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],v=new Array(160);l(r,p),r.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},r.prototype._update=function(e){for(var t=this._w,n=0|this._ah,r=0|this._bh,l=0|this._ch,p=0|this._dh,b=0|this._eh,v=0|this._fh,g=0|this._gh,y=0|this._hh,_=0|this._al,w=0|this._bl,x=0|this._cl,k=0|this._dl,E=0|this._el,S=0|this._fl,T=0|this._gl,A=0|this._hl,j=0;j<32;j+=2)t[j]=e.readInt32BE(4*j),t[j+1]=e.readInt32BE(4*j+4);for(;j<160;j+=2){var R=t[j-30],M=t[j-30+1],I=c(R,M),C=f(M,R);R=t[j-4],M=t[j-4+1];var O=u(R,M),B=d(M,R),N=t[j-14],q=t[j-14+1],U=t[j-32],P=t[j-32+1],L=C+q|0,z=I+N+h(L,C)|0;L=L+B|0,z=z+O+h(L,B)|0,L=L+P|0,z=z+U+h(L,P)|0,t[j]=z,t[j+1]=L}for(var D=0;D<160;D+=2){z=t[D],L=t[D+1];var F=a(n,r,l),G=a(_,w,x),H=o(n,_),Z=o(_,n),K=s(b,E),X=s(E,b),J=m[D],Y=m[D+1],V=i(b,v,g),W=i(E,S,T),$=A+X|0,Q=y+K+h($,A)|0;$=$+W|0,Q=Q+V+h($,W)|0,$=$+Y|0,Q=Q+J+h($,Y)|0,$=$+L|0,Q=Q+z+h($,L)|0;var ee=Z+G|0,te=H+F+h(ee,Z)|0;y=g,A=T,g=v,T=S,v=b,S=E,E=k+$|0,b=p+Q+h(E,k)|0,p=l,k=x,l=r,x=w,r=n,w=_,_=$+ee|0,n=Q+te+h(_,$)|0}this._al=this._al+_|0,this._bl=this._bl+w|0,this._cl=this._cl+x|0,this._dl=this._dl+k|0,this._el=this._el+E|0,this._fl=this._fl+S|0,this._gl=this._gl+T|0,this._hl=this._hl+A|0,this._ah=this._ah+n+h(this._al,_)|0,this._bh=this._bh+r+h(this._bl,w)|0,this._ch=this._ch+l+h(this._cl,x)|0,this._dh=this._dh+p+h(this._dl,k)|0,this._eh=this._eh+b+h(this._el,E)|0,this._fh=this._fh+v+h(this._fl,S)|0,this._gh=this._gh+g+h(this._gl,T)|0,this._hh=this._hh+y+h(this._hl,A)|0},r.prototype._hash=function(){function e(e,n,r){t.writeInt32BE(e,r),t.writeInt32BE(n,r+4)}var t=b.allocUnsafe(64);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=r},{"./hash":192,inherits:135,"safe-buffer":190}],200:[function(e,t,n){function r(){i.call(this)}t.exports=r;var i=e("events").EventEmitter;e("inherits")(r,i),r.Readable=e("readable-stream/readable.js"),r.Writable=e("readable-stream/writable.js"),r.Duplex=e("readable-stream/duplex.js"),r.Transform=e("readable-stream/transform.js"),r.PassThrough=e("readable-stream/passthrough.js"),r.Stream=r,r.prototype.pipe=function(e,t){function n(t){e.writable&&!1===e.write(t)&&f.pause&&f.pause()}function r(){f.readable&&f.resume&&f.resume()}function a(){u||(u=!0,e.end())}function o(){u||(u=!0,"function"==typeof e.destroy&&e.destroy())}function s(e){if(c(),0===i.listenerCount(this,"error"))throw e}function c(){f.removeListener("data",n),e.removeListener("drain",r),f.removeListener("end",a),f.removeListener("close",o),f.removeListener("error",s),e.removeListener("error",s),f.removeListener("end",c),f.removeListener("close",c),e.removeListener("close",c)}var f=this;f.on("data",n),e.on("drain",r),e._isStdio||t&&!1===t.end||(f.on("end",a),f.on("close",o));var u=!1;return f.on("error",s),e.on("error",s),f.on("end",c),f.on("close",c),e.on("close",c),e.emit("pipe",f),e}},{events:94,inherits:135,"readable-stream/duplex.js":179,"readable-stream/passthrough.js":185,"readable-stream/readable.js":186,"readable-stream/transform.js":187,"readable-stream/writable.js":188}],201:[function(e,t,n){function r(e){if(e&&!c(e))throw new Error("Unknown encoding: "+e)}function i(e){return e.toString(this.encoding)}function a(e){this.charReceived=e.length%2,this.charLength=this.charReceived?2:0}function o(e){this.charReceived=e.length%3,this.charLength=this.charReceived?3:0}var s=e("buffer").Buffer,c=s.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}},f=n.StringDecoder=function(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),r(e),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=a;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=o;break;default:return void(this.write=i)}this.charBuffer=new s(6),this.charReceived=0,this.charLength=0};f.prototype.write=function(e){for(var t="";this.charLength;){var n=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,0,n),this.charReceived+=n,this.charReceived=55296&&r<=56319)){if(this.charReceived=this.charLength=0,0===e.length)return t;break}this.charLength+=this.surrogateSize,t=""}this.detectIncompleteChar(e);var i=e.length;this.charLength&&(e.copy(this.charBuffer,0,e.length-this.charReceived,i),i-=this.charReceived),t+=e.toString(this.encoding,0,i);var i=t.length-1,r=t.charCodeAt(i);if(r>=55296&&r<=56319){var a=this.surrogateSize;return this.charLength+=a,this.charReceived+=a,this.charBuffer.copy(this.charBuffer,a,0,a),e.copy(this.charBuffer,0,0,a),t.substring(0,i)}return t},f.prototype.detectIncompleteChar=function(e){for(var t=e.length>=3?3:e.length;t>0;t--){var n=e[e.length-t];if(1==t&&n>>5==6){this.charLength=2;break}if(t<=2&&n>>4==14){this.charLength=3;break}if(t<=3&&n>>3==30){this.charLength=4;break}}this.charReceived=t},f.prototype.end=function(e){var t="";if(e&&e.length&&(t=this.write(e)),this.charReceived){var n=this.charReceived,r=this.charBuffer,i=this.encoding;t+=r.slice(0,n).toString(i)}return t}},{buffer:56}],202:[function(e,t,n){(function(e){!function(){var r="object"==typeof self&&self.self===self&&self||"object"==typeof e&&e.global===e&&e||this||{},i=r._,a=Array.prototype,o=Object.prototype,s="undefined"!=typeof Symbol?Symbol.prototype:null,c=a.push,f=a.slice,u=o.toString,d=o.hasOwnProperty,h=Array.isArray,l=Object.keys,p=Object.create,b=function(){},m=function(e){return e instanceof m?e:this instanceof m?void(this._wrapped=e):new m(e)};void 0===n||n.nodeType?r._=m:(void 0!==t&&!t.nodeType&&t.exports&&(n=t.exports=m),n._=m),m.VERSION="1.9.1";var v,g=function(e,t,n){if(void 0===t)return e;switch(null==n?3:n){case 1:return function(n){return e.call(t,n)};case 3:return function(n,r,i){return e.call(t,n,r,i)};case 4:return function(n,r,i,a){return e.call(t,n,r,i,a)}}return function(){return e.apply(t,arguments)}},y=function(e,t,n){return m.iteratee!==v?m.iteratee(e,t):null==e?m.identity:m.isFunction(e)?g(e,t,n):m.isObject(e)&&!m.isArray(e)?m.matcher(e):m.property(e)};m.iteratee=v=function(e,t){return y(e,t,1/0)};var _=function(e,t){return t=null==t?e.length-1:+t,function(){for(var n=Math.max(arguments.length-t,0),r=Array(n),i=0;i=0&&t<=S};m.each=m.forEach=function(e,t,n){t=g(t,n);var r,i;if(A(e))for(r=0,i=e.length;r0?0:o-1;for(i||(r=t[a?a[s]:s],s+=e);s>=0&&s=3;return t(e,g(n,i,4),r,a)}};m.reduce=m.foldl=m.inject=j(1),m.reduceRight=m.foldr=j(-1),m.find=m.detect=function(e,t,n){var r=A(e)?m.findIndex:m.findKey,i=r(e,t,n);if(void 0!==i&&-1!==i)return e[i]},m.filter=m.select=function(e,t,n){var r=[];return t=y(t,n),m.each(e,function(e,n,i){t(e,n,i)&&r.push(e)}),r},m.reject=function(e,t,n){return m.filter(e,m.negate(y(t)),n)},m.every=m.all=function(e,t,n){t=y(t,n);for(var r=!A(e)&&m.keys(e),i=(r||e).length,a=0;a=0},m.invoke=_(function(e,t,n){var r,i;return m.isFunction(t)?i=t:m.isArray(t)&&(r=t.slice(0,-1),t=t[t.length-1]),m.map(e,function(e){var a=i;if(!a){if(r&&r.length&&(e=E(e,r)),null==e)return;a=e[t]}return null==a?a:a.apply(e,n)})}),m.pluck=function(e,t){return m.map(e,m.property(t))},m.where=function(e,t){return m.filter(e,m.matcher(t))},m.findWhere=function(e,t){return m.find(e,m.matcher(t))},m.max=function(e,t,n){var r,i,a=-1/0,o=-1/0;if(null==t||"number"==typeof t&&"object"!=typeof e[0]&&null!=e){e=A(e)?e:m.values(e);for(var s=0,c=e.length;sa&&(a=r)}else t=y(t,n),m.each(e,function(e,n,r){((i=t(e,n,r))>o||i===-1/0&&a===-1/0)&&(a=e,o=i)});return a},m.min=function(e,t,n){var r,i,a=1/0,o=1/0;if(null==t||"number"==typeof t&&"object"!=typeof e[0]&&null!=e){e=A(e)?e:m.values(e);for(var s=0,c=e.length;sr||void 0===n)return 1;if(n0?0:i-1;a>=0&&a0?o=a>=0?a:Math.max(a+s,o):s=a>=0?Math.min(a+1,s):a+s+1;else if(n&&a&&s)return a=n(r,i),r[a]===i?a:-1;if(i!==i)return a=t(f.call(r,o,s),m.isNaN),a>=0?a+o:-1;for(a=e>0?o:s-1;a>=0&&at?(r&&(clearTimeout(r),r=null),s=f,o=e.apply(i,a),r||(i=a=null)):r||!1===n.trailing||(r=setTimeout(c,u)),o};return f.cancel=function(){clearTimeout(r),s=0,r=i=a=null},f},m.debounce=function(e,t,n){var r,i,a=function(t,n){r=null,n&&(i=e.apply(t,n))},o=_(function(o){if(r&&clearTimeout(r),n){var s=!r;r=setTimeout(a,t),s&&(i=e.apply(this,o))}else r=m.delay(a,t,this,o);return i});return o.cancel=function(){clearTimeout(r),r=null},o},m.wrap=function(e,t){return m.partial(t,e)},m.negate=function(e){return function(){return!e.apply(this,arguments)}},m.compose=function(){var e=arguments,t=e.length-1;return function(){for(var n=t,r=e[t].apply(this,arguments);n--;)r=e[n].call(this,r);return r}},m.after=function(e,t){return function(){if(--e<1)return t.apply(this,arguments)}},m.before=function(e,t){var n;return function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=null),n}},m.once=m.partial(m.before,2),m.restArguments=_;var N=!{toString:null}.propertyIsEnumerable("toString"),q=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],U=function(e,t){var n=q.length,r=e.constructor,i=m.isFunction(r)&&r.prototype||o,a="constructor";for(k(e,a)&&!m.contains(t,a)&&t.push(a);n--;)(a=q[n])in e&&e[a]!==i[a]&&!m.contains(t,a)&&t.push(a)};m.keys=function(e){if(!m.isObject(e))return[];if(l)return l(e);var t=[];for(var n in e)k(e,n)&&t.push(n);return N&&U(e,t),t},m.allKeys=function(e){if(!m.isObject(e))return[];var t=[];for(var n in e)t.push(n);return N&&U(e,t),t},m.values=function(e){for(var t=m.keys(e),n=t.length,r=Array(n),i=0;i1&&(r=g(r,t[1])),t=m.allKeys(e)):(r=L,t=I(t,!1,!1),e=Object(e));for(var i=0,a=t.length;i1&&(n=t[1])):(t=m.map(I(t,!1,!1),String),r=function(e,n){return!m.contains(t,n)}),m.pick(e,r,n)}),m.defaults=P(m.allKeys,!0),m.create=function(e,t){var n=w(e);return t&&m.extendOwn(n,t),n},m.clone=function(e){return m.isObject(e)?m.isArray(e)?e.slice():m.extend({},e):e},m.tap=function(e,t){return t(e),e}, -m.isMatch=function(e,t){var n=m.keys(t),r=n.length;if(null==e)return!r;for(var i=Object(e),a=0;a":">",'"':""","'":"'","`":"`"},H=m.invert(G),Z=function(e){var t=function(t){return e[t]},n="(?:"+m.keys(e).join("|")+")",r=RegExp(n),i=RegExp(n,"g");return function(e){return e=null==e?"":""+e,r.test(e)?e.replace(i,t):e}};m.escape=Z(G),m.unescape=Z(H),m.result=function(e,t,n){m.isArray(t)||(t=[t]);var r=t.length;if(!r)return m.isFunction(n)?n.call(e):n;for(var i=0;i/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var X=/(.)^/,J={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},Y=/\\|'|\r|\n|\u2028|\u2029/g,V=function(e){return"\\"+J[e]};m.template=function(e,t,n){!t&&n&&(t=n),t=m.defaults({},t,m.templateSettings);var r=RegExp([(t.escape||X).source,(t.interpolate||X).source,(t.evaluate||X).source].join("|")+"|$","g"),i=0,a="__p+='";e.replace(r,function(t,n,r,o,s){return a+=e.slice(i,s).replace(Y,V),i=s+t.length,n?a+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":r?a+="'+\n((__t=("+r+"))==null?'':__t)+\n'":o&&(a+="';\n"+o+"\n__p+='"),t}),a+="';\n",t.variable||(a="with(obj||{}){\n"+a+"}\n"),a="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+a+"return __p;\n";var o;try{o=new Function(t.variable||"obj","_",a)}catch(e){throw e.source=a,e}var s=function(e){return o.call(this,e,m)};return s.source="function("+(t.variable||"obj")+"){\n"+a+"}",s},m.chain=function(e){var t=m(e);return t._chain=!0,t};var W=function(e,t){return e._chain?m(t).chain():t};m.mixin=function(e){return m.each(m.functions(e),function(t){var n=m[t]=e[t];m.prototype[t]=function(){var e=[this._wrapped];return c.apply(e,arguments),W(this,n.apply(m,e))}}),m},m.mixin(m),m.each(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var t=a[e];m.prototype[e]=function(){var n=this._wrapped;return t.apply(n,arguments),"shift"!==e&&"splice"!==e||0!==n.length||delete n[0],W(this,n)}}),m.each(["concat","join","slice"],function(e){var t=a[e];m.prototype[e]=function(){return W(this,t.apply(this._wrapped,arguments))}}),m.prototype.value=function(){return this._wrapped},m.prototype.valueOf=m.prototype.toJSON=m.prototype.value,m.prototype.toString=function(){return String(this._wrapped)},"function"==typeof define&&define.amd&&define("underscore",[],function(){return m})}()}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],203:[function(e,t,n){function r(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}function i(e,t,n){if(e&&f(e)&&e instanceof r)return e;var i=new r;return i.parse(e,t,n),i}function a(e){return c(e)&&(e=i(e)),e instanceof r?e.format():r.prototype.format.call(e)}function o(e,t){return i(e,!1,!0).resolve(t)}function s(e,t){return e?i(e,!1,!0).resolveObject(t):t}function c(e){return"string"==typeof e}function f(e){return"object"==typeof e&&null!==e}function u(e){return null===e}function d(e){return null==e}var h=e("punycode");n.parse=i,n.resolve=o,n.resolveObject=s,n.format=a,n.Url=r;var l=/^([a-z0-9.+-]+:)/i,p=/:[0-9]*$/,b=["<",">",'"',"`"," ","\r","\n","\t"],m=["{","}","|","\\","^","`"].concat(b),v=["'"].concat(m),g=["%","/","?",";","#"].concat(v),y=["/","?","#"],_=/^[a-z0-9A-Z_-]{0,63}$/,w=/^([a-z0-9A-Z_-]{0,63})(.*)$/,x={javascript:!0,"javascript:":!0},k={javascript:!0,"javascript:":!0},E={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},S=e("querystring");r.prototype.parse=function(e,t,n){if(!c(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var r=e;r=r.trim();var i=l.exec(r);if(i){i=i[0];var a=i.toLowerCase();this.protocol=a,r=r.substr(i.length)}if(n||i||r.match(/^\/\/[^@\/]+@[^@\/]+/)){var o="//"===r.substr(0,2);!o||i&&k[i]||(r=r.substr(2),this.slashes=!0)}if(!k[i]&&(o||i&&!E[i])){for(var s=-1,f=0;f127?j+="x":j+=A[R];if(!j.match(_)){var I=m.slice(0,f),C=m.slice(f+1),O=A.match(w);O&&(I.push(O[1]),C.unshift(O[2])),C.length&&(r="/"+C.join(".")+r),this.hostname=I.join(".");break}}}if(this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),!b){for(var B=this.hostname.split("."),N=[],f=0;f0)&&n.host.split("@");m&&(n.auth=m.shift(),n.host=n.hostname=m.shift())}return n.search=e.search,n.query=e.query,u(n.pathname)&&u(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n}if(!p.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var v=p.slice(-1)[0],g=(n.host||e.host)&&("."===v||".."===v)||""===v,y=0,_=p.length;_>=0;_--)v=p[_],"."==v?p.splice(_,1):".."===v?(p.splice(_,1),y++):y&&(p.splice(_,1),y--);if(!h&&!l)for(;y--;y)p.unshift("..");!h||""===p[0]||p[0]&&"/"===p[0].charAt(0)||p.unshift(""),g&&"/"!==p.join("/").substr(-1)&&p.push("");var w=""===p[0]||p[0]&&"/"===p[0].charAt(0);if(b){n.hostname=n.host=w?"":p.length?p.shift():"";var m=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@");m&&(n.auth=m.shift(),n.host=n.hostname=m.shift())}return h=h||n.host&&p.length,h&&!w&&p.unshift(""),p.length?n.pathname=p.join("/"):(n.pathname=null,n.path=null),u(n.pathname)&&u(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},r.prototype.parseHost=function(){var e=this.host,t=p.exec(e);t&&(t=t[0],":"!==t&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},{punycode:172,querystring:176}],204:[function(e,t,n){(function(n){"use strict";function r(e){return!e||("utf8"===(e=e.toLowerCase())||"utf-8"===e)}function i(e,t){if(r(t))return encodeURIComponent(e);for(var n=l.encode(e,t),i="",a="",o=0;o0&&u>c&&(u=c);for(var d=0;d=0?(h=m.substr(0,v),l=m.substr(v+1)):(h=m,l=""),h&&h.indexOf("%")>=0)try{p=a(h,f)}catch(e){p=h}else p=h;if(l&&l.indexOf("%")>=0)try{b=a(l,f)}catch(e){b=l}else b=l;s(i,p)?Array.isArray(i[p])?i[p].push(b):i[p]=[i[p],b]:i[p]=b}return i}function s(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function c(e){return/^[\x00-\x7F]*$/.test(e)}function f(e,t){return e=String(e),e=c(e)?encodeURIComponent(e):i(e,t)}function u(e,t,n){if(!t)throw new TypeError("stringify expects an object");return t+"="+f(e,n.charset)}function d(e,t,n){var r=[];if(!t)throw new TypeError("stringify expects an object");for(var i=0;i","木休大人 <523317421@qq.com>","yangwei ","lurunze "],license:"MIT",dependencies:{async:"^2.6.1",debug:"^3.1.0",q:"^1.5.1",underscore:"^1.9.1",urlencode:"^1.1.0"},devDependencies:{browserify:"10.2.6",coveralls:"^3.0.2","expect.js":"^0.3.1","fs-walk":"0.0.2",istanbul:"^0.4.5",mocha:"^5.2.0"}}},{}],209:[function(e,t,n){function r(e,t){this.ak=e,this.sk=t}var i=e("util"),a=e("underscore"),o=e("debug")("bce-sdk:auth"),s=e("./headers"),c=e("./strings");r.prototype.generateAuthorization=function(e,t,n,r,a,s,c){var f=a?new Date(1e3*a):new Date,u=i.format("bce-auth-v1/%s/%s/%d",this.ak,f.toISOString().replace(/\.\d+Z$/,"Z"),s||1800);o("rawSessionKey = %j",u);var d=this.hash(u,this.sk),h=this.uriCanonicalization(t),l=this.queryStringCanonicalization(n||{}),p=this.headersCanonicalization(r||{},c),b=p[0],m=p[1];o("canonicalUri = %j",h),o("canonicalQueryString = %j",l),o("canonicalHeaders = %j",b),o("signedHeaders = %j",m);var v=i.format("%s\n%s\n%s\n%s",e,h,l,b);o("rawSignature = %j",v),o("sessionKey = %j",d);var g=this.hash(v,d);return m.length?i.format("%s/%s/%s",u,m.join(";"),g):i.format("%s//%s",u,g)},r.prototype.uriCanonicalization=function(e){return e},r.prototype.queryStringCanonicalization=function(e){var t=[];return Object.keys(e).forEach(function(n){if(n.toLowerCase()!==s.AUTHORIZATION.toLowerCase()){var r=null==e[n]?"":e[n];t.push(n+"="+c.normalize(r))}}),t.sort(),t.join("&")},r.prototype.headersCanonicalization=function(e,t){t&&t.length||(t=[s.HOST,s.CONTENT_MD5,s.CONTENT_LENGTH,s.CONTENT_TYPE]),o("headers = %j, headersToSign = %j",e,t);var n={};t.forEach(function(e){n[e.toLowerCase()]=!0});var r=[];Object.keys(e).forEach(function(t){var o=e[t];null!=(o=a.isString(o)?c.trim(o):o)&&""!==o&&(t=t.toLowerCase(),(/^x\-bce\-/.test(t)||!0===n[t])&&r.push(i.format("%s:%s",c.normalize(t),c.normalize(o))))}),r.sort();var f=[];return r.forEach(function(e){f.push(e.split(":")[0])}),[r.join("\n"),f]},r.prototype.hash=function(t,n){var r=e("crypto"),i=r.createHmac("sha256",n);return i.update(t),i.digest("hex")},t.exports=r},{"./headers":221,"./strings":233,crypto:65,debug:66,underscore:202,util:206}],210:[function(e,t,n){function r(e){c.call(this,e,"bcc",!0)}function i(){throw new Error("unimplemented method")}var a=e("util"),o=e("underscore"),s=e("debug")("bce-sdk:BccClient"),c=e("./bce_base_client");a.inherits(r,c),r.prototype.listInstances=function(e){var t=e||{},n=o.extend({maxKeys:1e3},o.pick(t,"maxKeys","marker"));return this.sendRequest("GET","/v1/instance",{params:n,config:t.config})},r.prototype.getPackages=function(e){var t=e||{};return this.sendRequest("GET","/v1/instance/price",{config:t.config})},r.prototype.getImages=function(e){var t=e||{},n=o.extend({maxKeys:1e3,imageType:"All"},o.pick(t,"maxKeys","marker","imageType"));return this.sendRequest("GET","/v1/image",{config:t.config,params:n})},r.prototype.createInstance=function(e,t){var n=this;return this.getClientToken().then(function(r){var i=t||{},a=r.body.token,o={clientToken:a};return s("createInstance, params = %j, body = %j",o,e),n.sendRequest("POST","/v1/instance",{config:i.config,params:o,body:JSON.stringify(e)})})},r.prototype.getInstance=function(e,t){var n=t||{};return this.sendRequest("GET","/v1/instance/"+e,{config:n.config})},r.prototype.startInstance=function(e,t){var n=t||{},r={start:""};return this.sendRequest("PUT","/v1/instance/"+e,{params:r,config:n.config})},r.prototype.stopInstance=function(e,t){var n=t||{},r={stop:""};return this.sendRequest("PUT","/v1/instance/"+e,{params:r,config:n.config})},r.prototype.restartInstance=function(e,t){var n=t||{},r={reboot:""};return this.sendRequest("PUT","/v1/instance/"+e,{params:r,config:n.config})},r.prototype.changeInstanceAdminPassword=i,r.prototype.rebuildInstance=i,r.prototype.deleteInstance=function(e,t){var n=t||{};return this.sendRequest("DELETE","/v1/instance/"+e,{config:n.config})},r.prototype.joinSecurityGroup=i,r.prototype.leaveSecurityGroup=i,r.prototype.getVNCUrl=function(e,t){var n=t||{};return this.sendRequest("GET","/v1/instance/"+e+"/vnc",{config:n.config})},r.prototype.getClientToken=function(e){return this.sendRequest("POST","/v1/token/create")},r.prototype._generateClientToken=function(){return"ClientToken:"+(Date.now().toString(16)+(Number.MAX_VALUE*Math.random()).toString(16).substr(0,8))},t.exports=r},{"./bce_base_client":211,debug:66,underscore:202,util:206}],211:[function(e,t,n){function r(e,t,n){a.call(this),this.config=s.extend({},c.DEFAULT_CONFIG,e),this.serviceId=t,this.regionSupported=!!n,this.config.endpoint=this._computeEndpoint(),this._httpAgent=null}var i=e("util"),a=e("events").EventEmitter,o=e("q"),s=e("underscore"),c=e("./config"),f=e("./auth"),u=e("./http_client"),d=e("./headers");i.inherits(r,a),r.prototype._computeEndpoint=function(){return this.config.endpoint?this.config.endpoint:this.regionSupported?i.format("%s://%s.%s.%s",this.config.protocol,this.serviceId,this.config.region,c.DEFAULT_SERVICE_DOMAIN):i.format("%s://%s.%s",this.config.protocol,this.serviceId,c.DEFAULT_SERVICE_DOMAIN)},r.prototype.createSignature=function(e,t,n,r,i){var a=Date.now()+(this.timeOffset||0);return i[d.X_BCE_DATE]=new Date(a).toISOString().replace(/\.\d+Z$/,"Z"),o.fcall(function(){return new f(e.ak,e.sk).generateAuthorization(t,n,r,i,a/1e3)})},r.prototype.sendRequest=function(e,t,n){var r={body:null,headers:{},params:{},config:{},outputStream:null},i=s.extend(r,n),a=s.extend({},this.config,i.config);return a.sessionToken&&(i.headers[d.SESSION_TOKEN]=a.sessionToken),this.sendHTTPRequest(e,t,i,a)},r.prototype.sendHTTPRequest=function(e,t,n,i){function a(){var r=this._httpAgent=new u(i);return s.each(["progress","error","abort","timeout"],function(e){r.on(e,function(t){c.emit(e,t)})}),this._httpAgent.sendRequest(e,t,n.body,n.headers,n.params,s.bind(this.createSignature,this),n.outputStream)}var c=this;return a.call(c).catch(function(e){var t=new Date(e[d.X_BCE_DATE]).getTime();return r.prototype.timeOffset=t-Date.now(),403===e[d.X_STATUS_CODE]&&"RequestTimeTooSkewed"===e[d.X_CODE]?a.call(c):o.reject(e)})},t.exports=r},{"./auth":209,"./config":217,"./headers":221,"./http_client":223,events:94,q:173,underscore:202,util:206}],212:[function(e,t,n){(function(n){function r(e){d.call(this,e,"bcs",!0)}var i=e("crypto"),a=e("util"),o=e("path"),s=e("fs"),c=e("underscore"),f=e("./headers"),u=e("./http_client"),d=e("./bce_base_client"),h=e("./mime.types");a.inherits(r,d),r.prototype.listBuckets=function(e){return e=e||{},this.sendRequest("GET",{config:e.config})},r.prototype.createBucket=function(e,t){return t=t||{},this.sendRequest("PUT",{bucketName:e,config:t.config})},r.prototype.setBucketAcl=function(e,t,n){n=n||{};var r={};return r[f.CONTENT_TYPE]="application/json; charset=UTF-8",this.sendRequest("PUT",{bucketName:e,body:JSON.stringify({accessControlList:t}),headers:r,params:{acl:""},config:n.config})},r.prototype.setBucketCannedAcl=function(e,t,n){n=n||{};var r={};return r[f.X_BCE_ACL]=t,this.sendRequest("PUT",{bucketName:e,headers:r,params:{acl:""},config:n.config})},r.prototype.getBucketAcl=function(e,t){return t=t||{},this.sendRequest("GET",{bucketName:e,params:{acl:"1"},config:t.config})},r.prototype.deleteBucket=function(e,t){return t=t||{},this.sendRequest("DELETE",{bucketName:e,config:t.config})},r.prototype.deleteObject=function(e,t,n){return n=n||{},this.sendRequest("DELETE",{bucketName:e,key:t,config:n.config})},r.prototype.listObjects=function(e,t){t=t||{};var n=c.extend({},c.pick(t,"start","limit"));return this.sendRequest("GET",{bucketName:e,params:n,config:t.config})},r.prototype.getObjectMetadata=function(e,t,n){return n=n||{},this.sendRequest("HEAD",{bucketName:e,key:t,config:n.config})},r.prototype.putObject=function(e,t,n,r){if(!t)throw new TypeError("key should not be empty.");return r=this._checkOptions(r||{}),this.sendRequest("PUT",{bucketName:e,key:t,body:n,headers:r.headers,config:r.config})},r.prototype.putObjectFromBlob=function(e,t,n,r){var i={};return i[f.CONTENT_LENGTH]=n.size,r=c.extend(i,r),this.putObject(e,t,n,r)},r.prototype.putObjectFromString=function(t,r,i,a){var o={};return o[f.CONTENT_LENGTH]=n.byteLength(i),o[f.CONTENT_MD5]=e("./crypto").md5sum(i,null,"hex"),a=c.extend(o,a),this.putObject(t,r,i,a)},r.prototype.putObjectFromFile=function(t,n,r,i){i=i||{};var a={};a[f.CONTENT_LENGTH]=s.statSync(r).size,a[f.CONTENT_TYPE]=i[f.CONTENT_TYPE]||h.guess(o.extname(r)),i=c.extend(a,i);var u=s.createReadStream(r);if(!c.has(i,f.CONTENT_MD5)){var d=this;return e("./crypto").md5file(r,"hex").then(function(e){return i[f.CONTENT_MD5]=e,d.putObject(t,n,u,i)})}return this.putObject(t,n,u,i)},r.prototype.createSignature=function(e,t,r,a){var o=["Method="+t,"Bucket="+r,"Object="+a].join("\n"),s="MBO\n"+o+"\n",c=i.createHmac("sha1",e.sk);c.update(new n(s,"utf-8"));var f=encodeURIComponent(c.digest("base64")).replace(/%2F/g,"/");return["MBO",e.ak,f].join(":")},r.prototype.sendRequest=function(t,n){var r={bucketName:null,key:null,body:null,headers:{},params:{},config:{},outputStream:null},i=c.extend(r,n),a=c.extend({},this.config,i.config),o="/";i.bucketName&&(o+=i.bucketName),i.key&&(o+="/"+i.key);var s=this.createSignature(a.credentials,t,i.bucketName?i.bucketName:"",i.key?"/"+i.key:"/"),f=this,d=this._httpAgent=new u(a);return c.each(["progress","error","abort","timeout"],function(e){d.on(e,function(t){f.emit(e,t)})}),d.buildQueryString=function(t){var n=e("querystring").stringify(t);return n?"sign="+s+"&"+n:"sign="+s},d.sendRequest(t,o,i.body,i.headers,i.params,null,i.outputStream)},r.prototype._checkOptions=function(e,t){var n={};return n.config=e.config||{},n.headers=this._prepareObjectHeaders(e),n.params=c.pick(e,t||[]),n},r.prototype._prepareObjectHeaders=function(e){var t=[f.CONTENT_LENGTH,f.CONTENT_ENCODING,f.CONTENT_MD5,f.CONTENT_TYPE,f.CONTENT_DISPOSITION,f.ETAG,f.SESSION_TOKEN],r=0,i=c.pick(e,function(e,i){return-1!==t.indexOf(i)||(/^x\-bce\-meta\-/.test(i)?(r+=n.byteLength(i)+n.byteLength(""+e),!0):void 0)});if(r>2048)throw new TypeError("Metadata size should not be greater than 2048.");if(c.has(i,f.CONTENT_LENGTH)){var o=i[f.CONTENT_LENGTH];if(o<0)throw new TypeError("content_length should not be negative.");if(o>5368709120)throw new TypeError("Object length should be less than 5368709120. Use multi-part upload instead.")}if(c.has(i,"ETag")){var s=i.ETag;/^"/.test(s)||(i.ETag=a.format('"%s"',s))}return c.has(i,f.CONTENT_TYPE)||(i[f.CONTENT_TYPE]="application/octet-stream"),i},t.exports=r}).call(this,e("buffer").Buffer)},{"./bce_base_client":211,"./crypto":218,"./headers":221,"./http_client":223,"./mime.types":228,buffer:56,crypto:65,fs:25,path:159,querystring:176,underscore:202,util:206}],213:[function(e,t,n){(function(n){function r(e){b.call(this,e,"bos",!0),this._httpAgent=null}var i=e("util"),a=e("path"),o=e("fs"),s=e("querystring"),c=e("underscore"),f=e("q"),u=e("./headers"),d=e("./strings"),h=e("./auth"),l=e("./crypto"),p=e("./http_client"),b=e("./bce_base_client"),m=e("./mime.types"),v=e("./wm_stream"),g=e("./multipart"),y={scale:"s",width:"w",height:"h",quality:"q",format:"f",angle:"a",display:"d",limit:"l",crop:"c",offsetX:"x",offsetY:"y",watermark:"wm",key:"k",gravity:"g",gravityX:"x",gravityY:"y",opacity:"o",text:"t",fontSize:"sz",fontFamily:"ff",fontColor:"fc",fontStyle:"fs"};i.inherits(r,b),r.prototype.generatePresignedUrl=function(t,n,r,o,f,u,l,p){p=c.extend({},this.config,p),u=u||{};var b=a.normalize(a.join(p.removeVersionPrefix?"":"/v1",/\.[\w\-]+\.bcebos\.com$/.test(p.endpoint)?"":d.normalize(t||""),d.normalize(n||"",!1))).replace(/\\/g,"/");f=f||{},f.Host=e("url").parse(p.endpoint).host;var m=p.credentials,v=new h(m.ak,m.sk),g=v.generateAuthorization("GET",b,u,f,r,o,l);return u.authorization=g,i.format("%s%s?%s",p.endpoint,b,s.encode(u))},r.prototype.generateUrl=function(e,t,n,r,o){o=c.extend({},this.config,o);var s=a.normalize(a.join(o.removeVersionPrefix?"":"/v1",d.normalize(e||""),d.normalize(t||"",!1))).replace(/\\/g,"/"),f="";return n&&(f=c.isString(n)?/^@/.test(n)?n:"@"+n:"@"+c.map(n,function(e){return c.map(e,function(e,t){return[y[t]||t,e].join("_")}).join(",")}).join("|")),f?r?i.format("http://%s/%s%s",r,a.normalize(t),f):i.format("http://%s.%s/%s%s",a.normalize(e),"bceimg.com",a.normalize(t),f):i.format("%s%s%s",this.config.endpoint,s,f)},r.prototype.listBuckets=function(e){return e=e||{},this.sendRequest("GET",{config:e.config})},r.prototype.putBucket=r.prototype.createBucket=function(e,t){return t=t||{},this.sendRequest("PUT",{bucketName:e,config:t.config})},r.prototype.putBucketStorageclass=function(e,t,n){n=n||{};var r={};return r[u.CONTENT_TYPE]="application/json; charset=UTF-8",this.sendRequest("PUT",{bucketName:e,headers:r,params:{storageClass:""},body:JSON.stringify({storageClass:t}),config:n.config})},r.prototype.listObjects=function(e,t){t=t||{};var n=c.extend({maxKeys:1e3},c.pick(t,"maxKeys","prefix","marker","delimiter"));return this.sendRequest("GET",{bucketName:e,params:n,config:t.config})},r.prototype.headBucket=r.prototype.doesBucketExist=function(e,t){return t=t||{},this.sendRequest("HEAD",{bucketName:e,config:t.config}).then(function(){return f(!0)},function(e){return e&&403===e[u.X_STATUS_CODE]?f(!0):e&&404===e[u.X_STATUS_CODE]?f(!1):f.reject(e)})},r.prototype.deleteBucket=function(e,t){return t=t||{},this.sendRequest("DELETE",{bucketName:e,config:t.config})},r.prototype.setBucketCannedAcl=function(e,t,n){n=n||{};var r={};return r[u.X_BCE_ACL]=t,this.sendRequest("PUT",{bucketName:e,headers:r,params:{acl:""},config:n.config})},r.prototype.putBucketAcl=function(e,t,n){n=n||{};var r={};return r[u.CONTENT_TYPE]="application/json; charset=UTF-8",r[u.X_BCE_ACL]=t,this.sendRequest("PUT",{bucketName:e,headers:r,params:{acl:""},config:n.config})},r.prototype.setBucketAcl=function(e,t,n){n=n||{};var r={} -;return r[u.CONTENT_TYPE]="application/json; charset=UTF-8",this.sendRequest("PUT",{bucketName:e,body:JSON.stringify({accessControlList:t}),headers:r,params:{acl:""},config:n.config})},r.prototype.getBucketAcl=function(e,t){return t=t||{},this.sendRequest("GET",{bucketName:e,params:{acl:""},config:t.config})},r.prototype.getObjectAcl=function(e,t,n){return n=n||{},this.sendRequest("GET",{bucketName:e,key:t,params:{acl:""},config:n.config})},r.prototype.putObjectAcl=function(e,t,n,r){r=r||{};var i={};return i[u.CONTENT_TYPE]="application/json; charset=UTF-8",this.sendRequest("PUT",{bucketName:e,key:t,body:JSON.stringify({accessControlList:n}),headers:i,params:{acl:""},config:r.config})},r.prototype.putObjectCannedAcl=function(e,t,n,r){r=r||{};var i={};return i[u.X_BCE_ACL]=n,this.sendRequest("PUT",{bucketName:e,key:t,headers:i,params:{acl:""},config:r.config})},r.prototype.getBucketLocation=function(e,t){return t=t||{},this.sendRequest("GET",{bucketName:e,params:{location:""},config:t.config})},r.prototype.deleteMultipleObjects=function(e,t,n){n=n||{};var r=c.map(t,function(e){return{key:e}});return this.sendRequest("POST",{bucketName:e,params:{delete:""},body:JSON.stringify({objects:r}),config:n.config})},r.prototype.deleteObject=function(e,t,n){return n=n||{},this.sendRequest("DELETE",{bucketName:e,key:t,config:n.config})},r.prototype.putObject=function(e,t,n,r){if(!t)throw new TypeError("key should not be empty.");return r=this._checkOptions(r||{}),this.sendRequest("PUT",{bucketName:e,key:t,body:n,headers:r.headers,config:r.config})},r.prototype.putObjectFromBlob=function(e,t,n,r){var i={};return i[u.CONTENT_LENGTH]=n.size,r=c.extend(i,r),this.putObject(e,t,n,r)},r.prototype.putObjectFromDataUrl=function(e,t,r,i){r=new n(r,"base64");var a={};return a[u.CONTENT_LENGTH]=r.length,i=c.extend(a,i),this.putObject(e,t,r,i)},r.prototype.putObjectFromString=function(e,t,r,i){i=i||{};var o={};return o[u.CONTENT_LENGTH]=n.byteLength(r),o[u.CONTENT_TYPE]=i[u.CONTENT_TYPE]||m.guess(a.extname(t)),o[u.CONTENT_MD5]=l.md5sum(r),i=c.extend(o,i),this.putObject(e,t,r,i)},r.prototype.putObjectFromFile=function(e,t,n,r){function i(a){return v.putObject(e,t,o.createReadStream(n,p),r).catch(function(e){var t=new Date(e[u.X_BCE_DATE]).getTime();return b.prototype.timeOffset=t-Date.now(),400===e[u.X_STATUS_CODE]&&"Http400"===e[u.X_CODE]&&a>0?i(--a):f.reject(e)})}r=r||{};var s={},d=o.statSync(n).size,h=c.has(r,u.CONTENT_LENGTH)?r[u.CONTENT_LENGTH]:d;if(h>d)throw new Error("options['Content-Length'] should less than "+d);s[u.CONTENT_LENGTH]=h,s[u.CONTENT_TYPE]=r[u.CONTENT_TYPE]||m.guess(a.extname(n)),r=c.extend(s,r);var p={start:0,end:Math.max(0,h-1)},v=this;if(!c.has(r,u.CONTENT_MD5)){var g=o.createReadStream(n,p);return l.md5stream(g).then(function(e){return r[u.CONTENT_MD5]=e,i(r.retryCount||3)})}return i(r.retryCount||3)},r.prototype.getObjectMetadata=function(e,t,n){return n=n||{},this.sendRequest("HEAD",{bucketName:e,key:t,config:n.config})},r.prototype.getObject=function(e,t,n,r){r=r||{};var a=new v;return this.sendRequest("GET",{bucketName:e,key:t,headers:{Range:n?i.format("bytes=%s",n):""},config:r.config,outputStream:a}).then(function(e){return e.body=a.store,e})},r.prototype.getObjectToFile=function(e,t,n,r,a){return a=a||{},this.sendRequest("GET",{bucketName:e,key:t,headers:{Range:r?i.format("bytes=%s",r):""},config:a.config,outputStream:o.createWriteStream(n)})},r.prototype.copyObject=function(e,t,n,r,a){if(!e)throw new TypeError("sourceBucketName should not be empty");if(!t)throw new TypeError("sourceKey should not be empty");if(!n)throw new TypeError("targetBucketName should not be empty");if(!r)throw new TypeError("targetKey should not be empty");a=this._checkOptions(a||{});var o=!1;return c.some(a.headers,function(e,t){if(0===t.indexOf("x-bce-meta-"))return o=!0,!0}),a.headers["x-bce-copy-source"]=d.normalize(i.format("/%s/%s",e,t),!1),c.has(a.headers,"ETag")&&(a.headers["x-bce-copy-source-if-match"]=a.headers.ETag),a.headers["x-bce-metadata-directive"]=o?"replace":"copy",this.sendRequest("PUT",{bucketName:n,key:r,headers:a.headers,config:a.config})},r.prototype.initiateMultipartUpload=function(e,t,n){n=n||{};var r={};return r[u.CONTENT_TYPE]=m.guess(a.extname(t)),n=this._checkOptions(c.extend(r,n)),this.sendRequest("POST",{bucketName:e,key:t,params:{uploads:""},headers:n.headers,config:n.config})},r.prototype.abortMultipartUpload=function(e,t,n,r){return r=r||{},this.sendRequest("DELETE",{bucketName:e,key:t,params:{uploadId:n},config:r.config})},r.prototype.completeMultipartUpload=function(e,t,n,r,i){var a={};return a[u.CONTENT_TYPE]="application/json; charset=UTF-8",i=this._checkOptions(c.extend(a,i)),this.sendRequest("POST",{bucketName:e,key:t,body:JSON.stringify({parts:r}),headers:i.headers,params:{uploadId:n},config:i.config})},r.prototype.uploadPartFromFile=function(e,t,n,r,i,a,s,c){var f=s,u=s+i-1,d=o.createReadStream(a,{start:f,end:u});return this.uploadPart(e,t,n,r,i,d,c)},r.prototype.uploadPartFromBlob=function(e,t,n,r,a,o,s){if(o.size!==a)throw new TypeError(i.format("Invalid partSize %d and data length %d",a,o.size));var f={};return f[u.CONTENT_LENGTH]=a,f[u.CONTENT_TYPE]="application/octet-stream",s=this._checkOptions(c.extend(f,s)),this.sendRequest("PUT",{bucketName:e,key:t,body:o,headers:s.headers,params:{partNumber:r,uploadId:n},config:s.config})},r.prototype.uploadPartFromDataUrl=function(e,t,r,a,o,s,f){var d=new n(s,"base64");if(d.length!==o)throw new TypeError(i.format("Invalid partSize %d and data length %d",o,d.length));var h={};return h[u.CONTENT_LENGTH]=o,h[u.CONTENT_TYPE]="application/octet-stream",f=this._checkOptions(c.extend(h,f)),this.sendRequest("PUT",{bucketName:e,key:t,body:d,headers:f.headers,params:{partNumber:a,uploadId:r},config:f.config})},r.prototype.uploadPart=function(e,t,n,r,a,s,f){function d(){return f=h._checkOptions(f),h.sendRequest("PUT",{bucketName:e,key:t,body:p,headers:f.headers,params:{partNumber:r,uploadId:n},config:f.config})}if(!e)throw new TypeError("bucketName should not be empty");if(!t)throw new TypeError("key should not be empty");if(r<1||r>1e4)throw new TypeError(i.format("Invalid partNumber %d. The valid range is from %d to %d.",r,1,1e4));var h=this,p=o.createReadStream(s.path,{start:s.start,end:s.end}),b={};return b[u.CONTENT_LENGTH]=a,b[u.CONTENT_TYPE]="application/octet-stream",f=c.extend(b,f),f[u.CONTENT_MD5]?d():l.md5stream(s).then(function(e){return f[u.CONTENT_MD5]=e,d()})},r.prototype.uploadPartCopy=function(e,t,n,r,a,o,s,c){if(!e)throw new TypeError("sourceBucket should not be empty");if(!t)throw new TypeError("sourceKey should not be empty");if(!n)throw new TypeError("targetBucket should not be empty");if(!r)throw new TypeError("targetKey should not be empty");if(o<1||o>1e4)throw new TypeError(i.format("Invalid partNumber %d. The valid range is from %d to %d.",o,1,1e4));return c=this._checkOptions(c||{}),c.headers["x-bce-copy-source"]=d.normalize(i.format("/%s/%s",e,t),!1),c.headers["x-bce-copy-source-range"]=s?i.format("bytes=%s",s):"",this.sendRequest("PUT",{bucketName:n,key:r,headers:c.headers,config:c.config,params:{partNumber:o,uploadId:a}})},r.prototype.listParts=function(e,t,n,r){if(!n)throw new TypeError("uploadId should not empty");var i=["maxParts","partNumberMarker","uploadId"];return r=this._checkOptions(r||{},i),r.params.uploadId=n,this.sendRequest("GET",{bucketName:e,key:t,params:r.params,config:r.config})},r.prototype.listMultipartUploads=function(e,t){var n=["delimiter","maxUploads","keyMarker","prefix","uploads"];return t=this._checkOptions(t||{},n),t.params.uploads="",this.sendRequest("GET",{bucketName:e,params:t.params,config:t.config})},r.prototype.appendObject=function(e,t,n,r,i){if(!t)throw new TypeError("key should not be empty.");i=this._checkOptions(i||{});var a={append:""};return c.isNumber(r)&&(a.offset=r),this.sendRequest("POST",{bucketName:e,key:t,body:n,headers:i.headers,params:a,config:i.config})},r.prototype.appendObjectFromBlob=function(e,t,n,r,i){var a={};return a[u.CONTENT_LENGTH]=n.size,i=c.extend(a,i),this.appendObject(e,t,n,r,i)},r.prototype.appendObjectFromDataUrl=function(e,t,r,i,a){r=new n(r,"base64");var o={};return o[u.CONTENT_LENGTH]=r.length,a=c.extend(o,a),this.appendObject(e,t,r,i,a)},r.prototype.appendObjectFromString=function(e,t,r,i,o){o=o||{};var s={};return s[u.CONTENT_LENGTH]=n.byteLength(r),s[u.CONTENT_TYPE]=o[u.CONTENT_TYPE]||m.guess(a.extname(t)),s[u.CONTENT_MD5]=l.md5sum(r),o=c.extend(s,o),this.appendObject(e,t,r,i,o)},r.prototype.appendObjectFromFile=function(e,t,n,r,i,s){if(s=s||{},0===i)return this.appendObjectFromString(e,t,"",r,s);var f={},d=o.statSync(n).size;if(i+r>d)throw new Error("Can't read the content beyond the end of file.");f[u.CONTENT_LENGTH]=i,f[u.CONTENT_TYPE]=s[u.CONTENT_TYPE]||m.guess(a.extname(n)),s=c.extend(f,s);var h={start:r||0,end:(r||0)+i-1},p=o.createReadStream(n,h);if(!c.has(s,u.CONTENT_MD5)){var b=this,v=o.createReadStream(n,h);return l.md5stream(v).then(function(n){return s[u.CONTENT_MD5]=n,b.appendObject(e,t,p,r,s)})}return this.appendObject(e,t,p,r,s)},r.prototype.signPostObjectPolicy=function(e){var t=this.config.credentials,r=new h(t.ak,t.sk);return e=new n(JSON.stringify(e)).toString("base64"),{policy:e,signature:r.hash(e,t.sk)}},r.prototype.postObject=function(e,t,r,i){var a="MM8964"+(Math.random()*Math.pow(2,63)).toString(36),s="multipart/form-data; boundary="+a;if(c.isString(r))r=o.readFileSync(r);else if(!n.isBuffer(r))throw new Error("Invalid data type.");var f=this.config.credentials,d=f.ak,h=["signature","accessKey","key","file"];i=c.omit(i||{},h);var l=new g(a);for(var p in i)i.hasOwnProperty(p)&&"policy"!==p&&l.addPart(p,i[p]);if(i.policy){var b=this.signPostObjectPolicy(i.policy);l.addPart("policy",b.policy),l.addPart("signature",b.signature)}l.addPart("accessKey",d),l.addPart("key",t),l.addPart("file",r);var m=l.encode(),v={};return v[u.CONTENT_TYPE]=s,this.sendRequest("POST",{bucketName:e,body:m,headers:v})},r.prototype.sendRequest=function(e,t){var n={bucketName:null,key:null,body:null,headers:{},params:{},config:{},outputStream:null},r=c.extend(n,t),i=c.extend({},this.config,r.config),o=a.normalize(a.join(r.removeVersionPrefix?"":"/v1",/\.[\w\-]+\.bcebos\.com$/.test(i.endpoint)?"":d.normalize(r.bucketName||""),d.normalize(r.key||"",!1))).replace(/\\/g,"/");return i.sessionToken&&(r.headers[u.SESSION_TOKEN]=i.sessionToken),this.sendHTTPRequest(e,o,r,i)},r.prototype.sendHTTPRequest=function(e,t,n,r){function i(){var i=this._httpAgent=new p(r),o={httpMethod:e,resource:t,args:n,config:r};c.each(["progress","error","abort","timeout"],function(e){i.on(e,function(t){a.emit(e,t,o)})});var s=this._httpAgent.sendRequest(e,t,n.body,n.headers,n.params,c.bind(this.createSignature,this),n.outputStream);return s.abort=function(){if(i._req&&i._req.xhr){i._req.xhr.abort()}},s}var a=this;return i.call(a).catch(function(e){var t=new Date(e[u.X_BCE_DATE]).getTime();return b.prototype.timeOffset=t-Date.now(),403===e[u.X_STATUS_CODE]&&"RequestTimeTooSkewed"===e[u.X_CODE]?i.call(a):f.reject(e)})},r.prototype._checkOptions=function(e,t){var n={};return n.config=e.config||{},n.headers=this._prepareObjectHeaders(e),n.params=c.pick(e,t||[]),n},r.prototype._prepareObjectHeaders=function(e){var t=[u.CONTENT_LENGTH,u.CONTENT_ENCODING,u.CONTENT_MD5,u.X_BCE_CONTENT_SHA256,u.CONTENT_TYPE,u.CONTENT_DISPOSITION,u.ETAG,u.SESSION_TOKEN,u.CACHE_CONTROL,u.EXPIRES,u.X_BCE_ACL,u.X_BCE_GRANT_READ,u.X_BCE_GRANT_FULL_CONTROL,u.X_BCE_OBJECT_ACL,u.X_BCE_OBJECT_GRANT_READ,u.X_BCE_STORAGE_CLASS],r=0,a=c.pick(e,function(e,i){return-1!==t.indexOf(i)||(/^x\-bce\-meta\-/.test(i)?(r+=n.byteLength(i)+n.byteLength(""+e),!0):void 0)});if(r>2048)throw new TypeError("Metadata size should not be greater than 2048.");if(c.has(a,u.CONTENT_LENGTH)){var o=a[u.CONTENT_LENGTH];if(o<0)throw new TypeError("content_length should not be negative.");if(o>5368709120)throw new TypeError("Object length should be less than 5368709120. Use multi-part upload instead.")}if(c.has(a,"ETag")){var s=a.ETag;/^"/.test(s)||(a.ETag=i.format('"%s"',s))}if(c.has(a,u.CONTENT_TYPE)||(a[u.CONTENT_TYPE]="application/octet-stream"),c.has(a,u.X_BCE_STORAGE_CLASS)){const f=a[u.X_BCE_STORAGE_CLASS],d=["STANDARD","STANDARD_IA","ARCHIVE","COLD","MAZ_STANDARD","MAZ_STANDARD_IA"];d.includes(f)||(a[u.X_BCE_STORAGE_CLASS]=d[0])}return a},t.exports=r}).call(this,e("buffer").Buffer)},{"./auth":209,"./bce_base_client":211,"./crypto":218,"./headers":221,"./http_client":223,"./mime.types":228,"./multipart":229,"./strings":233,"./wm_stream":244,buffer:56,fs:25,path:159,q:173,querystring:176,underscore:202,url:203,util:206}],214:[function(e,t,n){function r(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:null;this.cells=this.cells||[];var n=new c;n.column=e,null!==t&&(n.value=s(t)),this.cells.push(n)}}]),e}(),u=function e(){o(this,e),this.storageType=null},d=function e(){o(this,e),this.tableVersion=0,this.compressType=null,this.ttl=null,this.storageType=null,this.maxVersions=null},h=function e(){o(this,e),this.tableVersion=null,this.compressType=null,this.ttl=null,this.maxVersions=null},l=function(){function e(){o(this,e),this.rowkey=null,this.cells=null}return i(e,[{key:"addCells",value:function(e,t){this.cells=this.cells||[];var n=new c;n.column=e,n.value=s(t),this.cells.push(n)}},{key:"encode",value:function(e){return s(e)}}]),e}(),p=function(){function e(){o(this,e),this.rows=null}return i(e,[{key:"addRows",value:function(e,t,n){this.rows=this.rows||[];var r=new f;r.addCells(t,n),r.rowkey=r.encode(e),this.rows.push(r)}}]),e}(),b=function(){function e(){o(this,e),this.rowkey=null,this.cells=null}return i(e,[{key:"encode",value:function(e){return s(e)}},{key:"addCells",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(this.cells=this.cells||[],null!=e){var t=new c;t.column=s(e),this.cells.push(t)}}}]),e}(),m=function(){function e(){o(this,e),this.rows=null}return i(e,[{key:"addRows",value:function(e,t){this.rows=this.rows||[];var n=new f;n.addCells(t),n.rowkey=n.encode(e),this.rows.push(n)}}]),e}(),v=function(){function e(){o(this,e),this.rowkey=null,this.cells=null}return i(e,[{key:"encode",value:function(e){return s(e)}},{key:"addCells",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(this.cells=this.cells||[],null!=e){var t=new c;t.column=e,this.cells.push(t)}}}]),e}(),g=function(){function e(){o(this,e),this.rows=null}return i(e,[{key:"addRows",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.rows=this.rows||[];var n=new f;null!==t&&n.addCells(t),n.rowkey=n.encode(e),this.rows.push(n)}}]),e}(),y=function(){function e(){o(this,e),this.startRowkey=null,this.includeStart=!0,this.stopRowkey=null,this.includeStop=!1,this.selector=null,this.limit=null}return i(e,[{key:"encode",value:function(e){return s(e)}},{key:"addCells",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(this.selector=this.selector||[],null!=e){var t=new c;t.column=e,this.selector.push(t)}}}]),e}();t.exports={Cell:c,Row:f,CreateInstanceRequest:u,CreateTableRequest:d,UpdateTableRequest:h,PutRowRequest:l,BatchPutRowRequest:p,DeleteRowRequest:b,BatchDeleteRowRequest:m,GetRowRequest:v,BatchGetRowRequest:g,ScanRequest:y}},{urlencode:204}],215:[function(e,t,n){function r(e){o.call(this,e,"bts",!0)}var i=e("util"),a=e("./bts/models"),o=e("./bce_base_client"),s=a.CreateInstanceRequest,c=a.CreateTableRequest,f=a.UpdateTableRequest,u=a.PutRowRequest,d=a.BatchPutRowRequest,h=a.DeleteRowRequest,l=a.BatchDeleteRowRequest,p=a.GetRowRequest,b=a.BatchGetRowRequest,m=a.ScanRequest;i.inherits(r,o),r.prototype.listInstances=function(){return this.sendRequest("GET","/v1/instances",null)},r.prototype.dropInstance=function(e){return this.sendRequest("DELETE","/v1/instance/"+e,null)},r.prototype.showInstance=function(e){return this.sendRequest("GET","/v1/instance/"+e,null)},r.prototype.createInstance=function(e,t){return this.sendRequest("PUT","/v1/instance/"+e,{body:JSON.stringify(t)})},r.prototype.createTable=function(e,t,n){return this.sendRequest("PUT","/v1/instance/"+e+"/table/"+t,{body:JSON.stringify(n)})},r.prototype.updateTable=function(e,t,n){return this.sendRequest("PUT","/v1/instance/"+e+"/table/"+t,{body:JSON.stringify(n)})},r.prototype.dropTable=function(e,t){return this.sendRequest("DELETE","/v1/instance/"+e+"/table/"+t,null)},r.prototype.showTable=function(e,t,n){var r={onlyState:""};return n?this.sendRequest("GET","/v1/instance/"+e+"/table/"+t,{params:r}):this.sendRequest("GET","/v1/instance/"+e+"/table/"+t,null)},r.prototype.listTables=function(e){return this.sendRequest("GET","/v1/instance/"+e+"/tables",null)},r.prototype.putRow=function(e,t,n){return n.rowkey=n.encode(n.rowkey),this.sendRequest("PUT","/v1/instance/"+e+"/table/"+t+"/row",{body:JSON.stringify(n)})},r.prototype.batchPutRow=function(e,t,n){return this.sendRequest("PUT","/v1/instance/"+e+"/table/"+t+"/rows",{body:JSON.stringify(n)})},r.prototype.deleteRow=function(e,t,n){return n.rowkey=n.encode(n.rowkey),this.sendRequest("DELETE","/v1/instance/"+e+"/table/"+t+"/row",{body:JSON.stringify(n)})},r.prototype.batchDeleteRow=function(e,t,n){return this.sendRequest("DELETE","/v1/instance/"+e+"/table/"+t+"/rows",{body:JSON.stringify(n)})},r.prototype.getRow=function(e,t,n){return n.rowkey=n.encode(n.rowkey),this.sendRequest("GET","/v1/instance/"+e+"/table/"+t+"/row",{body:JSON.stringify(n)})},r.prototype.batchGetRow=function(e,t,n){return this.sendRequest("GET","/v1/instance/"+e+"/table/"+t+"/rows",{body:JSON.stringify(n)})},r.prototype.scan=function(e,t,n){return null!==n.startRowkey&&(n.startRowkey=n.encode(n.startRowkey)),null!==n.stopRowkey&&(n.stopRowkey=n.encode(n.stopRowkey)),this.sendRequest("GET","/v1/instance/"+e+"/table/"+t+"/rows",{body:JSON.stringify(n)})},t.exports={BtsClient:r,CreateInstanceRequest:s,CreateTableRequest:c,UpdateTableRequest:f,PutRowRequest:u,BatchPutRowRequest:d,DeleteRowRequest:h,BatchDeleteRowRequest:l,GetRowRequest:p,BatchGetRowRequest:b,ScanRequest:m}},{"./bce_base_client":211,"./bts/models":214,util:206}],216:[function(e,t,n){function r(e){c.call(this,e,"cfc",!0)}var i=e("util"),a=e("./strings"),o=e("underscore"),s=e("debug")("bce-sdk:CfcClient"),c=e("./bce_base_client");i.inherits(r,c),r.prototype.listFunctions=function(e){var t=e||{},n=o.extend(o.pick(t,"Marker","MaxItems"));return s("params ",n),this.sendRequest("GET","/v1/functions",{params:n,config:t.config})},r.prototype.createFunction=function(e){return s("createFunction, body = %j",e),this.sendRequest("POST","/v1/functions",{params:{},body:JSON.stringify(e)})},r.prototype.getFunction=function(e,t){var n=t||{},r=o.extend(o.pick(n,"Qualifier"));return this.sendRequest("GET","/v1/functions/"+a.normalize(e),{params:r})},r.prototype.deleteFunction=function(e,t){var n=t||{},r=o.extend(o.pick(n,"Qualifier"));return this.sendRequest("DELETE","/v1/functions/"+e,{params:r})},r.prototype.invocations=function(e,t,n){var r=n||{},i=o.extend(o.pick(r,"Qualifier","invocationType","logType","logToBody"));return this.sendRequest("POST","/v1/functions/"+a.normalize(e)+"/invocations",{params:i,body:JSON.stringify(t)})},r.prototype.invoke=r.prototype.invocations,r.prototype.updateFunctionCode=function(e,t){return this.sendRequest("PUT","/v1/functions/"+e+"/code",{body:JSON.stringify(t)})},r.prototype.getFunctionConfiguration=function(e,t){var n=t||{},r=o.extend(o.pick(n,"Qualifier"));return this.sendRequest("GET","/v1/functions/"+e+"/configuration",{params:r})},r.prototype.updateFunctionConfiguration=function(e,t){return this.sendRequest("PUT","/v1/functions/"+e+"/configuration",{body:JSON.stringify(t)})},r.prototype.listVersionsByFunction=function(e,t){var n=t||{},r=o.extend(o.pick(n,"Marker","MaxItems"));return this.sendRequest("GET","/v1/functions/"+e+"/versions",{params:r})},r.prototype.publishVersion=function(e,t){var n={};return null!=t&&(n.Description=t),this.sendRequest("POST","/v1/functions/"+e+"/versions",{body:JSON.stringify(n)})},r.prototype.createAlias=function(e,t){return this.sendRequest("POST","/v1/functions/"+e+"/aliases",{body:JSON.stringify(t)})},r.prototype.getAlias=function(e,t){return this.sendRequest("GET","/v1/functions/"+e+"/aliases/"+t,{})},r.prototype.updateAlias=function(e,t,n){return this.sendRequest("PUT","/v1/functions/"+e+"/aliases/"+t,{body:JSON.stringify(n)})},r.prototype.deleteAlias=function(e,t){return this.sendRequest("DELETE","/v1/functions/"+e+"/aliases/"+t,{})},r.prototype.listAliases=function(e,t){var n=t||{},r=o.extend(o.pick(n,"FunctionVersion","Marker","MaxItems"));return this.sendRequest("GET","/v1/functions/"+e+"/aliases/",{params:r})},r.prototype.listRelations=function(e){var t=e||{},n=o.extend(o.pick(t,"FunctionBrn"));return this.sendRequest("GET","/v1/relation",{params:n})},r.prototype.createRelation=function(e,t){s("createRelation, body = %j",e);var n=t||{};o.extend(o.pick(n,"FunctionBrn"));return this.sendRequest("POST","/v1/relation",{body:JSON.stringify(e)})},r.prototype.updateRelation=function(e){return this.sendRequest("PUT","/v1/relation",{body:JSON.stringify(e)})},r.prototype.deleteRelation=function(e){var t=e||{},n=o.extend(o.pick(t,"Target","Source","RelationId"));return this.sendRequest("DELETE","/v1/relation",{params:n})},r.prototype.listEventSourceMappings=function(e){var t=e||{},n=o.extend(o.pick(t,"FunctionName"));return this.sendRequest("GET","/v1/event-source-mappings",{params:n})},r.prototype.createEventSourceMapping=function(e){return s("createEventSourceMapping, body = %j",e),this.sendRequest("POST","/v1/event-source-mappings",{body:JSON.stringify(e)})},r.prototype.updateEventSourceMapping=function(e,t){return this.sendRequest("PUT","/v1/event-source-mappings/"+e,{body:JSON.stringify(t)})},r.prototype.deleteEventSourceMapping=function(e){return this.sendRequest("DELETE","/v1/event-source-mappings/"+e,{})},r.prototype.sendRequest=function(e,t,n){return this.config.workspaceId&&(n.headers||(n.headers={}),n.headers["X-CFC-Workspace-Id"]=this.config.workspaceId),c.prototype.sendRequest.call(this,e,t,n)},t.exports=r},{"./bce_base_client":211,"./strings":233,debug:66,underscore:202,util:206}],217:[function(e,t,n){n.DEFAULT_SERVICE_DOMAIN="baidubce.com",n.DEFAULT_CONFIG={protocol:"http",region:"bj"}},{}],218:[function(e,t,n){(function(t){var r=e("fs"),i=e("crypto"),a=e("q");n.md5sum=function(e,n,r){t.isBuffer(e)||(e=new t(e,n||"UTF-8"));var a=i.createHash("md5");return a.update(e),a.digest(r||"base64")},n.md5stream=function(e,t){var n=a.defer(),r=i.createHash("md5");return e.on("data",function(e){r.update(e)}),e.on("end",function(){n.resolve(r.digest(t||"base64"))}),e.on("error",function(e){n.reject(e)}),n.promise},n.md5file=function(e,t){return n.md5stream(r.createReadStream(e),t)},n.md5blob=function(e,t){var r=a.defer(),i=new FileReader;return i.readAsArrayBuffer(e),i.onerror=function(e){r.reject(i.error)},i.onloadend=function(e){if(e.target.readyState===FileReader.DONE){var i=e.target.result,a=n.md5sum(i,null,t);r.resolve(a)}},r.promise}}).call(this,e("buffer").Buffer)},{buffer:56,crypto:65,fs:25,q:173}],219:[function(e,t,n){(function(t){function r(e){l.call(this,e,"doc",!1),this._documentId=null}function i(e){l.call(this,e,"doc",!1),this._name=null,this._endpoint=null}var a=e("fs"),o=e("path"),s=e("util"),c=e("url"),f=e("q"),u=e("underscore"),d=e("debug")("bce-sdk:Document"),h=e("./bos_client"),l=e("./bce_base_client"),p=e("./helper"),b=e("./crypto");s.inherits(r,l),r.prototype._buildUrl=function(){var e="/v2/document",t=u.toArray(arguments);return t.length&&(e+="/"+t.join("/")),e},r.prototype.getId=function(){return this._documentId},r.prototype.setId=function(e){return this._documentId=e,this},r.prototype.create=function(e,n){var r=u.extend({},n),i=-1,s=/^bos:\/\//;if(u.isString(e)){if(s.test(e))try{var d=c.parse(e),h=d.host,l=d.pathname.substr(1);r=u.extend(r,d.query);var p=r.title||o.basename(l),m=r.format||o.extname(l).substr(1),v=r.notification;return this.createFromBos(h,l,p,m,v)}catch(e){return f.reject(e)}i=1,r.format=r.format||o.extname(e).substr(1),r.title=r.title||o.basename(e,o.extname(e))}else if(t.isBuffer(e)){if(null==r.format||null==r.title)return f.reject(new Error("buffer type required options.format and options.title"));i=2}else{if(!("undefined"!=typeof Blob&&e instanceof Blob))return f.reject(new Error("Unsupported dataType."));i=4,r.format=r.format||o.extname(e.name).substr(1),r.title=r.title||o.basename(e.name,o.extname(e.name))}if(!r.title||!r.format)return f.reject(new Error("`title` and `format` are required."));if(r.meta.md5)return this._doCreate(e,r);var g=this;return 1===i?b.md5stream(a.createReadStream(e),"hex").then(function(t){return r.meta.md5=t,g._doCreate(e,r)}):4===i?b.md5blob(e,"hex").then(function(t){return r.meta.md5=t,g._doCreate(e,r)}):this._doCreate(e,r)},r.prototype._doCreate=function(e,t){var n=null,r=null,i=null,a=null,o=this;return o.register(t).then(function(t){d("register[response = %j]",t),n=t.body.documentId,r=t.body.bucket,i=t.body.object,a=t.body.bosEndpoint;var s=u.extend({},o.config,{endpoint:a}),c=new h(s);return p.upload(c,r,i,e)}).then(function(e){return d("upload[response = %j]",e),o.publish()}).then(function(e){return d("publish[response = %j]",e),e.body={documentId:n,bucket:r,object:i,bosEndpoint:a},e})},r.prototype.register=function(e){d("register[options = %j]",e);var t=this,n=this._buildUrl();return this.sendRequest("POST",n,{params:{register:""},headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}).then(function(e){return t.setId(e.body.documentId),e})},r.prototype.publish=function(e){var t=this._buildUrl(e||this._documentId);return this.sendRequest("PUT",t,{params:{publish:""}})},r.prototype.get=function(e){var t=this._buildUrl(e||this._documentId);return this.sendRequest("GET",t)},r.prototype.read=function(e){var t=this._buildUrl(e||this._documentId);return this.sendRequest("GET",t,{params:{read:""}})},r.prototype.download=function(e){var t=this._buildUrl(e||this._documentId);return this.sendRequest("GET",t,{params:{download:""}})},r.prototype.createFromBos=function(e,t,n,r,i){var a=this._buildUrl(),s={bucket:e,object:t,title:n},c=r||o.extname(t).substr(1);if(!c)throw new Error("Document format parameter required");s.format=c,i&&(s.notification=i),d("createFromBos:arguments = [%j], body = [%j]",arguments,s);var f=this;return this.sendRequest("POST",a,{params:{source:"bos"},headers:{"Content-Type":"application/json"},body:JSON.stringify(s)}).then(function(e){return f.setId(e.body.documentId),e})},r.prototype.removeAll=function(){var e=this;return e.list().then(function(t){var n=(t.body.documents||[]).map(function(t){return e.remove(t.documentId)});return f.all(n)})},r.prototype.remove=function(e){var t=this._buildUrl(e||this._documentId);return this.sendRequest("DELETE",t)},r.prototype.list=function(e){var t=e||"",n=this._buildUrl();return this.sendRequest("GET",n,{params:{status:t}})},s.inherits(i,l),i.prototype._buildUrl=function(){var e="/v1/notification",t=u.toArray(arguments);return t.length&&(e+="/"+t.join("/")),e},i.prototype.create=function(e,t){var n=this,r=this._buildUrl();return n.sendRequest("POST",r,{headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e,endpoint:t})}).then(function(r){return n._name=e,n._endpoint=t,r})},i.prototype.get=function(e){var t=this._buildUrl(e||this._name);return this.sendRequest("GET",t)},i.prototype.list=function(){return this.sendRequest("GET",this._buildUrl())},i.prototype.remove=function(e){var t=this._buildUrl(e||this._name);return this.sendRequest("DELETE",t)},i.prototype.removeAll=function(){var e=this;return e.list().then(function(t){var n=(t.body.notifications||[]).map(function(t){return e.remove(t.name)});return f.all(n)})},n.Document=r,n.Notification=i}).call(this,{isBuffer:e("../node_modules/is-buffer/index.js")})},{"../node_modules/is-buffer/index.js":136,"./bce_base_client":211,"./bos_client":213,"./crypto":218,"./helper":222,debug:66,fs:25,path:159,q:173,underscore:202,url:203,util:206}],220:[function(e,t,n){(function(n){function r(e){s.call(this,e,"face",!0)}var i=e("util"),a=e("underscore"),o=e("debug")("bce-sdk:FaceClient"),s=e("./bce_base_client");i.inherits(r,s),r.prototype.createApp=function(e){e=e||{};return this.sendRequest("POST","/v1/app",{config:e.config})},r.prototype.listApps=function(e){e=e||{};return this.sendRequest("GET","/v1/app",{config:e.config})},r.prototype.createGroup=function(e,t,n){n=n||{};var r="/v1/app/"+e+"/group";return this.sendRequest("POST",r,{body:JSON.stringify({groupName:t}),config:n.config})},r.prototype.deleteGroup=function(e,t,n){n=n||{};var r="/v1/app/"+e+"/group/"+t;return this.sendRequest("DELETE",r,{config:n.config})},r.prototype.getGroup=function(e,t,n){n=n||{};var r="/v1/app/"+e+"/group/"+t;return this.sendRequest("GET",r,{config:n.config})},r.prototype.listGroups=function(e,t){t=t||{};var n="/v1/app/"+e+"/group";return this.sendRequest("GET",n,{config:t.config})},r.prototype.createPerson=function(e,t,n,r,i){i=i||{},r=r.map(function(e){return{bosPath:e}}),o("Create Person Faces = %j",r);var a="/v1/app/"+e+"/person";return this.sendRequest("POST",a,{body:JSON.stringify({personName:n,groupName:t,faces:r}),config:i.config})},r.prototype.deletePerson=function(e,t,n){n=n||{};var r="/v1/app/"+e+"/person/"+t;return this.sendRequest("DELETE",r,{config:n.config})},r.prototype.updatePerson=function(e,t,n,r){r=r||{},n=n.map(function(e){return{bosPath:e}});var i="/v1/app/"+e+"/person/"+t;return this.sendRequest("PUT",i,{body:JSON.stringify({faces:n}),config:r.config})},r.prototype.getPerson=function(e,t,n){n=n||{};var r="/v1/app/"+e+"/person/"+t;return this.sendRequest("GET",r,{config:n.config})},r.prototype.listPersons=function(e,t){t=t||{};var n="/v1/app/"+e+"/person",r=a.pick(t,"groupName");return this.sendRequest("GET",n,{params:r,config:t.config})},r.prototype.identify=function(e,t,r,i){i=i||{};var a={};a=n.isBuffer(r)?{base64:r.toString("base64")}:{bosPath:r};var o="/v1/app/"+e+"/group/"+t;return this.sendRequest("POST",o,{params:{identify:""},body:JSON.stringify(a),config:i.config})},r.prototype.verify=function(e,t,r,i){i=i||{};var a={};a=n.isBuffer(r)?{base64:r.toString("base64")}:{bosPath:r};var o="/v1/app/"+e+"/person/"+t;return this.sendRequest("POST",o,{params:{verify:""},body:JSON.stringify(a),config:i.config})},t.exports=r}).call(this,{isBuffer:e("../node_modules/is-buffer/index.js")})},{"../node_modules/is-buffer/index.js":136,"./bce_base_client":211,debug:66,underscore:202,util:206}],221:[function(e,t,n){n.CONTENT_TYPE="Content-Type",n.CONTENT_LENGTH="Content-Length",n.CONTENT_MD5="Content-MD5",n.CONTENT_ENCODING="Content-Encoding",n.CONTENT_DISPOSITION="Content-Disposition",n.ETAG="ETag",n.CONNECTION="Connection",n.HOST="Host",n.USER_AGENT="User-Agent",n.CACHE_CONTROL="Cache-Control",n.EXPIRES="Expires",n.AUTHORIZATION="Authorization",n.X_BCE_DATE="x-bce-date",n.X_BCE_ACL="x-bce-acl",n.X_BCE_GRANT_READ="x-bce-grant-read",n.X_BCE_GRANT_FULL_CONTROL="x-bce-grant-full-control",n.X_BCE_REQUEST_ID="x-bce-request-id",n.X_BCE_CONTENT_SHA256="x-bce-content-sha256",n.X_BCE_OBJECT_ACL="x-bce-object-acl",n.X_BCE_OBJECT_GRANT_READ="x-bce-object-grant-read",n.X_BCE_STORAGE_CLASS="x-bce-storage-class",n.X_HTTP_HEADERS="http_headers",n.X_BODY="body", +m.isMatch=function(e,t){var n=m.keys(t),r=n.length;if(null==e)return!r;for(var i=Object(e),a=0;a":">",'"':""","'":"'","`":"`"},H=m.invert(G),Z=function(e){var t=function(t){return e[t]},n="(?:"+m.keys(e).join("|")+")",r=RegExp(n),i=RegExp(n,"g");return function(e){return e=null==e?"":""+e,r.test(e)?e.replace(i,t):e}};m.escape=Z(G),m.unescape=Z(H),m.result=function(e,t,n){m.isArray(t)||(t=[t]);var r=t.length;if(!r)return m.isFunction(n)?n.call(e):n;for(var i=0;i/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var X=/(.)^/,J={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},Y=/\\|'|\r|\n|\u2028|\u2029/g,V=function(e){return"\\"+J[e]};m.template=function(e,t,n){!t&&n&&(t=n),t=m.defaults({},t,m.templateSettings);var r=RegExp([(t.escape||X).source,(t.interpolate||X).source,(t.evaluate||X).source].join("|")+"|$","g"),i=0,a="__p+='";e.replace(r,function(t,n,r,o,s){return a+=e.slice(i,s).replace(Y,V),i=s+t.length,n?a+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":r?a+="'+\n((__t=("+r+"))==null?'':__t)+\n'":o&&(a+="';\n"+o+"\n__p+='"),t}),a+="';\n",t.variable||(a="with(obj||{}){\n"+a+"}\n"),a="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+a+"return __p;\n";var o;try{o=new Function(t.variable||"obj","_",a)}catch(e){throw e.source=a,e}var s=function(e){return o.call(this,e,m)};return s.source="function("+(t.variable||"obj")+"){\n"+a+"}",s},m.chain=function(e){var t=m(e);return t._chain=!0,t};var W=function(e,t){return e._chain?m(t).chain():t};m.mixin=function(e){return m.each(m.functions(e),function(t){var n=m[t]=e[t];m.prototype[t]=function(){var e=[this._wrapped];return c.apply(e,arguments),W(this,n.apply(m,e))}}),m},m.mixin(m),m.each(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var t=a[e];m.prototype[e]=function(){var n=this._wrapped;return t.apply(n,arguments),"shift"!==e&&"splice"!==e||0!==n.length||delete n[0],W(this,n)}}),m.each(["concat","join","slice"],function(e){var t=a[e];m.prototype[e]=function(){return W(this,t.apply(this._wrapped,arguments))}}),m.prototype.value=function(){return this._wrapped},m.prototype.valueOf=m.prototype.toJSON=m.prototype.value,m.prototype.toString=function(){return String(this._wrapped)},"function"==typeof define&&define.amd&&define("underscore",[],function(){return m})}()}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],203:[function(e,t,n){function r(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}function i(e,t,n){if(e&&f(e)&&e instanceof r)return e;var i=new r;return i.parse(e,t,n),i}function a(e){return c(e)&&(e=i(e)),e instanceof r?e.format():r.prototype.format.call(e)}function o(e,t){return i(e,!1,!0).resolve(t)}function s(e,t){return e?i(e,!1,!0).resolveObject(t):t}function c(e){return"string"==typeof e}function f(e){return"object"==typeof e&&null!==e}function u(e){return null===e}function d(e){return null==e}var h=e("punycode");n.parse=i,n.resolve=o,n.resolveObject=s,n.format=a,n.Url=r;var l=/^([a-z0-9.+-]+:)/i,p=/:[0-9]*$/,b=["<",">",'"',"`"," ","\r","\n","\t"],m=["{","}","|","\\","^","`"].concat(b),v=["'"].concat(m),g=["%","/","?",";","#"].concat(v),y=["/","?","#"],_=/^[a-z0-9A-Z_-]{0,63}$/,w=/^([a-z0-9A-Z_-]{0,63})(.*)$/,x={javascript:!0,"javascript:":!0},k={javascript:!0,"javascript:":!0},E={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},S=e("querystring");r.prototype.parse=function(e,t,n){if(!c(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var r=e;r=r.trim();var i=l.exec(r);if(i){i=i[0];var a=i.toLowerCase();this.protocol=a,r=r.substr(i.length)}if(n||i||r.match(/^\/\/[^@\/]+@[^@\/]+/)){var o="//"===r.substr(0,2);!o||i&&k[i]||(r=r.substr(2),this.slashes=!0)}if(!k[i]&&(o||i&&!E[i])){for(var s=-1,f=0;f127?j+="x":j+=A[R];if(!j.match(_)){var I=m.slice(0,f),C=m.slice(f+1),O=A.match(w);O&&(I.push(O[1]),C.unshift(O[2])),C.length&&(r="/"+C.join(".")+r),this.hostname=I.join(".");break}}}if(this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),!b){for(var B=this.hostname.split("."),N=[],f=0;f0)&&n.host.split("@");m&&(n.auth=m.shift(),n.host=n.hostname=m.shift())}return n.search=e.search,n.query=e.query,u(n.pathname)&&u(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n}if(!p.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var v=p.slice(-1)[0],g=(n.host||e.host)&&("."===v||".."===v)||""===v,y=0,_=p.length;_>=0;_--)v=p[_],"."==v?p.splice(_,1):".."===v?(p.splice(_,1),y++):y&&(p.splice(_,1),y--);if(!h&&!l)for(;y--;y)p.unshift("..");!h||""===p[0]||p[0]&&"/"===p[0].charAt(0)||p.unshift(""),g&&"/"!==p.join("/").substr(-1)&&p.push("");var w=""===p[0]||p[0]&&"/"===p[0].charAt(0);if(b){n.hostname=n.host=w?"":p.length?p.shift():"";var m=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@");m&&(n.auth=m.shift(),n.host=n.hostname=m.shift())}return h=h||n.host&&p.length,h&&!w&&p.unshift(""),p.length?n.pathname=p.join("/"):(n.pathname=null,n.path=null),u(n.pathname)&&u(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},r.prototype.parseHost=function(){var e=this.host,t=p.exec(e);t&&(t=t[0],":"!==t&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},{punycode:172,querystring:176}],204:[function(e,t,n){(function(n){"use strict";function r(e){return!e||("utf8"===(e=e.toLowerCase())||"utf-8"===e)}function i(e,t){if(r(t))return encodeURIComponent(e);for(var n=l.encode(e,t),i="",a="",o=0;o0&&u>c&&(u=c);for(var d=0;d=0?(h=m.substr(0,v),l=m.substr(v+1)):(h=m,l=""),h&&h.indexOf("%")>=0)try{p=a(h,f)}catch(e){p=h}else p=h;if(l&&l.indexOf("%")>=0)try{b=a(l,f)}catch(e){b=l}else b=l;s(i,p)?Array.isArray(i[p])?i[p].push(b):i[p]=[i[p],b]:i[p]=b}return i}function s(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function c(e){return/^[\x00-\x7F]*$/.test(e)}function f(e,t){return e=String(e),e=c(e)?encodeURIComponent(e):i(e,t)}function u(e,t,n){if(!t)throw new TypeError("stringify expects an object");return t+"="+f(e,n.charset)}function d(e,t,n){var r=[];if(!t)throw new TypeError("stringify expects an object");for(var i=0;i","木休大人 <523317421@qq.com>","yangwei ","lurunze "],license:"MIT",dependencies:{async:"^2.6.1",debug:"^3.1.0",q:"^1.5.1",underscore:"^1.9.1",urlencode:"^1.1.0"},devDependencies:{browserify:"10.2.6",coveralls:"^3.0.2","expect.js":"^0.3.1","fs-walk":"0.0.2",istanbul:"^0.4.5",mocha:"^5.2.0"}}},{}],209:[function(e,t,n){function r(e,t){this.ak=e,this.sk=t}var i=e("util"),a=e("underscore"),o=e("debug")("bce-sdk:auth"),s=e("./headers"),c=e("./strings");r.prototype.generateAuthorization=function(e,t,n,r,a,s,c){var f=a?new Date(1e3*a):new Date,u=i.format("bce-auth-v1/%s/%s/%d",this.ak,f.toISOString().replace(/\.\d+Z$/,"Z"),s||1800);o("rawSessionKey = %j",u);var d=this.hash(u,this.sk),h=this.uriCanonicalization(t),l=this.queryStringCanonicalization(n||{}),p=this.headersCanonicalization(r||{},c),b=p[0],m=p[1];o("canonicalUri = %j",h),o("canonicalQueryString = %j",l),o("canonicalHeaders = %j",b),o("signedHeaders = %j",m);var v=i.format("%s\n%s\n%s\n%s",e,h,l,b);o("rawSignature = %j",v),o("sessionKey = %j",d);var g=this.hash(v,d);return m.length?i.format("%s/%s/%s",u,m.join(";"),g):i.format("%s//%s",u,g)},r.prototype.uriCanonicalization=function(e){return e},r.prototype.queryStringCanonicalization=function(e){var t=[];return Object.keys(e).forEach(function(n){if(n.toLowerCase()!==s.AUTHORIZATION.toLowerCase()){var r=null==e[n]?"":e[n];t.push(n+"="+c.normalize(r))}}),t.sort(),t.join("&")},r.prototype.headersCanonicalization=function(e,t){t&&t.length||(t=[s.HOST,s.CONTENT_MD5,s.CONTENT_LENGTH,s.CONTENT_TYPE]),o("headers = %j, headersToSign = %j",e,t);var n={};t.forEach(function(e){n[e.toLowerCase()]=!0});var r=[];Object.keys(e).forEach(function(t){var o=e[t];null!=(o=a.isString(o)?c.trim(o):o)&&""!==o&&(t=t.toLowerCase(),(/^x\-bce\-/.test(t)||!0===n[t])&&r.push(i.format("%s:%s",c.normalize(t),c.normalize(o))))}),r.sort();var f=[];return r.forEach(function(e){f.push(e.split(":")[0])}),[r.join("\n"),f]},r.prototype.hash=function(t,n){var r=e("crypto"),i=r.createHmac("sha256",n);return i.update(t),i.digest("hex")},t.exports=r},{"./headers":221,"./strings":233,crypto:65,debug:66,underscore:202,util:206}],210:[function(e,t,n){function r(e){c.call(this,e,"bcc",!0)}function i(){throw new Error("unimplemented method")}var a=e("util"),o=e("underscore"),s=e("debug")("bce-sdk:BccClient"),c=e("./bce_base_client");a.inherits(r,c),r.prototype.listInstances=function(e){var t=e||{},n=o.extend({maxKeys:1e3},o.pick(t,"maxKeys","marker"));return this.sendRequest("GET","/v1/instance",{params:n,config:t.config})},r.prototype.getPackages=function(e){var t=e||{};return this.sendRequest("GET","/v1/instance/price",{config:t.config})},r.prototype.getImages=function(e){var t=e||{},n=o.extend({maxKeys:1e3,imageType:"All"},o.pick(t,"maxKeys","marker","imageType"));return this.sendRequest("GET","/v1/image",{config:t.config,params:n})},r.prototype.createInstance=function(e,t){var n=this;return this.getClientToken().then(function(r){var i=t||{},a=r.body.token,o={clientToken:a};return s("createInstance, params = %j, body = %j",o,e),n.sendRequest("POST","/v1/instance",{config:i.config,params:o,body:JSON.stringify(e)})})},r.prototype.getInstance=function(e,t){var n=t||{};return this.sendRequest("GET","/v1/instance/"+e,{config:n.config})},r.prototype.startInstance=function(e,t){var n=t||{},r={start:""};return this.sendRequest("PUT","/v1/instance/"+e,{params:r,config:n.config})},r.prototype.stopInstance=function(e,t){var n=t||{},r={stop:""};return this.sendRequest("PUT","/v1/instance/"+e,{params:r,config:n.config})},r.prototype.restartInstance=function(e,t){var n=t||{},r={reboot:""};return this.sendRequest("PUT","/v1/instance/"+e,{params:r,config:n.config})},r.prototype.changeInstanceAdminPassword=i,r.prototype.rebuildInstance=i,r.prototype.deleteInstance=function(e,t){var n=t||{};return this.sendRequest("DELETE","/v1/instance/"+e,{config:n.config})},r.prototype.joinSecurityGroup=i,r.prototype.leaveSecurityGroup=i,r.prototype.getVNCUrl=function(e,t){var n=t||{};return this.sendRequest("GET","/v1/instance/"+e+"/vnc",{config:n.config})},r.prototype.getClientToken=function(e){return this.sendRequest("POST","/v1/token/create")},r.prototype._generateClientToken=function(){return"ClientToken:"+(Date.now().toString(16)+(Number.MAX_VALUE*Math.random()).toString(16).substr(0,8))},t.exports=r},{"./bce_base_client":211,debug:66,underscore:202,util:206}],211:[function(e,t,n){function r(e,t,n){a.call(this),this.config=s.extend({},c.DEFAULT_CONFIG,e),this.serviceId=t,this.regionSupported=!!n,this.config.endpoint=this._computeEndpoint(),this._httpAgent=null}var i=e("util"),a=e("events").EventEmitter,o=e("q"),s=e("underscore"),c=e("./config"),f=e("./auth"),u=e("./http_client"),d=e("./headers");i.inherits(r,a),r.prototype._computeEndpoint=function(){return this.config.endpoint?this.config.endpoint:this.regionSupported?i.format("%s://%s.%s.%s",this.config.protocol,this.serviceId,this.config.region,c.DEFAULT_SERVICE_DOMAIN):i.format("%s://%s.%s",this.config.protocol,this.serviceId,c.DEFAULT_SERVICE_DOMAIN)},r.prototype.createSignature=function(e,t,n,r,i){var a=Date.now()+(this.timeOffset||0);return i[d.X_BCE_DATE]=new Date(a).toISOString().replace(/\.\d+Z$/,"Z"),o.fcall(function(){return new f(e.ak,e.sk).generateAuthorization(t,n,r,i,a/1e3)})},r.prototype.sendRequest=function(e,t,n){var r={body:null,headers:{},params:{},config:{},outputStream:null},i=s.extend(r,n),a=s.extend({},this.config,i.config);return a.sessionToken&&(i.headers[d.SESSION_TOKEN]=a.sessionToken),this.sendHTTPRequest(e,t,i,a)},r.prototype.sendHTTPRequest=function(e,t,n,i){function a(){var r=this._httpAgent=new u(i);return s.each(["progress","error","abort","timeout"],function(e){r.on(e,function(t){c.emit(e,t)})}),this._httpAgent.sendRequest(e,t,n.body,n.headers,n.params,s.bind(this.createSignature,this),n.outputStream)}var c=this;return a.call(c).catch(function(e){var t=new Date(e[d.X_BCE_DATE]).getTime();return r.prototype.timeOffset=t-Date.now(),403===e[d.X_STATUS_CODE]&&"RequestTimeTooSkewed"===e[d.X_CODE]?a.call(c):o.reject(e)})},t.exports=r},{"./auth":209,"./config":217,"./headers":221,"./http_client":223,events:94,q:173,underscore:202,util:206}],212:[function(e,t,n){(function(n){function r(e){d.call(this,e,"bcs",!0)}var i=e("crypto"),a=e("util"),o=e("path"),s=e("fs"),c=e("underscore"),f=e("./headers"),u=e("./http_client"),d=e("./bce_base_client"),h=e("./mime.types");a.inherits(r,d),r.prototype.listBuckets=function(e){return e=e||{},this.sendRequest("GET",{config:e.config})},r.prototype.createBucket=function(e,t){return t=t||{},this.sendRequest("PUT",{bucketName:e,config:t.config})},r.prototype.setBucketAcl=function(e,t,n){n=n||{};var r={};return r[f.CONTENT_TYPE]="application/json; charset=UTF-8",this.sendRequest("PUT",{bucketName:e,body:JSON.stringify({accessControlList:t}),headers:r,params:{acl:""},config:n.config})},r.prototype.setBucketCannedAcl=function(e,t,n){n=n||{};var r={};return r[f.X_BCE_ACL]=t,this.sendRequest("PUT",{bucketName:e,headers:r,params:{acl:""},config:n.config})},r.prototype.getBucketAcl=function(e,t){return t=t||{},this.sendRequest("GET",{bucketName:e,params:{acl:"1"},config:t.config})},r.prototype.deleteBucket=function(e,t){return t=t||{},this.sendRequest("DELETE",{bucketName:e,config:t.config})},r.prototype.deleteObject=function(e,t,n){return n=n||{},this.sendRequest("DELETE",{bucketName:e,key:t,config:n.config})},r.prototype.listObjects=function(e,t){t=t||{};var n=c.extend({},c.pick(t,"start","limit"));return this.sendRequest("GET",{bucketName:e,params:n,config:t.config})},r.prototype.getObjectMetadata=function(e,t,n){return n=n||{},this.sendRequest("HEAD",{bucketName:e,key:t,config:n.config})},r.prototype.putObject=function(e,t,n,r){if(!t)throw new TypeError("key should not be empty.");return r=this._checkOptions(r||{}),this.sendRequest("PUT",{bucketName:e,key:t,body:n,headers:r.headers,config:r.config})},r.prototype.putObjectFromBlob=function(e,t,n,r){var i={};return i[f.CONTENT_LENGTH]=n.size,r=c.extend(i,r),this.putObject(e,t,n,r)},r.prototype.putObjectFromString=function(t,r,i,a){var o={};return o[f.CONTENT_LENGTH]=n.byteLength(i),o[f.CONTENT_MD5]=e("./crypto").md5sum(i,null,"hex"),a=c.extend(o,a),this.putObject(t,r,i,a)},r.prototype.putObjectFromFile=function(t,n,r,i){i=i||{};var a={};a[f.CONTENT_LENGTH]=s.statSync(r).size,a[f.CONTENT_TYPE]=i[f.CONTENT_TYPE]||h.guess(o.extname(r)),i=c.extend(a,i);var u=s.createReadStream(r);if(!c.has(i,f.CONTENT_MD5)){var d=this;return e("./crypto").md5file(r,"hex").then(function(e){return i[f.CONTENT_MD5]=e,d.putObject(t,n,u,i)})}return this.putObject(t,n,u,i)},r.prototype.createSignature=function(e,t,r,a){var o=["Method="+t,"Bucket="+r,"Object="+a].join("\n"),s="MBO\n"+o+"\n",c=i.createHmac("sha1",e.sk);c.update(new n(s,"utf-8"));var f=encodeURIComponent(c.digest("base64")).replace(/%2F/g,"/");return["MBO",e.ak,f].join(":")},r.prototype.sendRequest=function(t,n){var r={bucketName:null,key:null,body:null,headers:{},params:{},config:{},outputStream:null},i=c.extend(r,n),a=c.extend({},this.config,i.config),o="/";i.bucketName&&(o+=i.bucketName),i.key&&(o+="/"+i.key);var s=this.createSignature(a.credentials,t,i.bucketName?i.bucketName:"",i.key?"/"+i.key:"/"),f=this,d=this._httpAgent=new u(a);return c.each(["progress","error","abort","timeout"],function(e){d.on(e,function(t){f.emit(e,t)})}),d.buildQueryString=function(t){var n=e("querystring").stringify(t);return n?"sign="+s+"&"+n:"sign="+s},d.sendRequest(t,o,i.body,i.headers,i.params,null,i.outputStream)},r.prototype._checkOptions=function(e,t){var n={};return n.config=e.config||{},n.headers=this._prepareObjectHeaders(e),n.params=c.pick(e,t||[]),n},r.prototype._prepareObjectHeaders=function(e){var t=[f.CONTENT_LENGTH,f.CONTENT_ENCODING,f.CONTENT_MD5,f.CONTENT_TYPE,f.CONTENT_DISPOSITION,f.ETAG,f.SESSION_TOKEN],r=0,i=c.pick(e,function(e,i){return-1!==t.indexOf(i)||(/^x\-bce\-meta\-/.test(i)?(r+=n.byteLength(i)+n.byteLength(""+e),!0):void 0)});if(r>2048)throw new TypeError("Metadata size should not be greater than 2048.");if(c.has(i,f.CONTENT_LENGTH)){var o=i[f.CONTENT_LENGTH];if(o<0)throw new TypeError("content_length should not be negative.");if(o>5368709120)throw new TypeError("Object length should be less than 5368709120. Use multi-part upload instead.")}if(c.has(i,"ETag")){var s=i.ETag;/^"/.test(s)||(i.ETag=a.format('"%s"',s))}return c.has(i,f.CONTENT_TYPE)||(i[f.CONTENT_TYPE]="application/octet-stream"),i},t.exports=r}).call(this,e("buffer").Buffer)},{"./bce_base_client":211,"./crypto":218,"./headers":221,"./http_client":223,"./mime.types":228,buffer:56,crypto:65,fs:25,path:159,querystring:176,underscore:202,util:206}],213:[function(e,t,n){(function(n){function r(e){b.call(this,e,"bos",!0),this._httpAgent=null}var i=e("util"),a=e("path"),o=e("fs"),s=e("querystring"),c=e("underscore"),f=e("q"),u=e("./headers"),d=e("./strings"),h=e("./auth"),l=e("./crypto"),p=e("./http_client"),b=e("./bce_base_client"),m=e("./mime.types"),v=e("./wm_stream"),g=e("./multipart"),y={scale:"s",width:"w",height:"h",quality:"q",format:"f",angle:"a",display:"d",limit:"l",crop:"c",offsetX:"x",offsetY:"y",watermark:"wm",key:"k",gravity:"g",gravityX:"x",gravityY:"y",opacity:"o",text:"t",fontSize:"sz",fontFamily:"ff",fontColor:"fc",fontStyle:"fs"};i.inherits(r,b),r.prototype.generatePresignedUrl=function(t,n,r,o,f,u,l,p){p=c.extend({},this.config,p),u=u||{};var b=a.normalize(a.join(p.removeVersionPrefix?"/":"/v1",/\.[\w\-]+\.bcebos\.com$/.test(p.endpoint)?"":d.normalize(t||""),d.normalize(n||"",!1))).replace(/\\/g,"/");f=f||{},f.Host=e("url").parse(p.endpoint).host;var m=p.credentials,v=new h(m.ak,m.sk),g=v.generateAuthorization("GET",b,u,f,r,o,l);return u.authorization=g,i.format("%s%s?%s",p.endpoint,b,s.encode(u))},r.prototype.generateUrl=function(e,t,n,r,o){o=c.extend({},this.config,o);var s=a.normalize(a.join(o.removeVersionPrefix?"/":"/v1",d.normalize(e||""),d.normalize(t||"",!1))).replace(/\\/g,"/"),f="";return n&&(f=c.isString(n)?/^@/.test(n)?n:"@"+n:"@"+c.map(n,function(e){return c.map(e,function(e,t){return[y[t]||t,e].join("_")}).join(",")}).join("|")),f?r?i.format("http://%s/%s%s",r,a.normalize(t),f):i.format("http://%s.%s/%s%s",a.normalize(e),"bceimg.com",a.normalize(t),f):i.format("%s%s%s",this.config.endpoint,s,f)},r.prototype.listBuckets=function(e){return e=e||{},this.sendRequest("GET",{config:e.config})},r.prototype.putBucket=r.prototype.createBucket=function(e,t){return t=t||{},this.sendRequest("PUT",{bucketName:e,config:t.config})},r.prototype.putBucketStorageclass=function(e,t,n){n=n||{};var r={};return r[u.CONTENT_TYPE]="application/json; charset=UTF-8",this.sendRequest("PUT",{bucketName:e,headers:r,params:{storageClass:""},body:JSON.stringify({storageClass:t}),config:n.config})},r.prototype.listObjects=function(e,t){t=t||{};var n=c.extend({maxKeys:1e3},c.pick(t,"maxKeys","prefix","marker","delimiter"));return this.sendRequest("GET",{bucketName:e,params:n,config:t.config})},r.prototype.headBucket=r.prototype.doesBucketExist=function(e,t){return t=t||{},this.sendRequest("HEAD",{bucketName:e,config:t.config}).then(function(){return f(!0)},function(e){return e&&403===e[u.X_STATUS_CODE]?f(!0):e&&404===e[u.X_STATUS_CODE]?f(!1):f.reject(e)})},r.prototype.deleteBucket=function(e,t){return t=t||{},this.sendRequest("DELETE",{bucketName:e,config:t.config})},r.prototype.setBucketCannedAcl=function(e,t,n){n=n||{};var r={};return r[u.X_BCE_ACL]=t,this.sendRequest("PUT",{bucketName:e,headers:r,params:{acl:""},config:n.config})},r.prototype.putBucketAcl=function(e,t,n){n=n||{};var r={};return r[u.CONTENT_TYPE]="application/json; charset=UTF-8",r[u.X_BCE_ACL]=t,this.sendRequest("PUT",{bucketName:e,headers:r,params:{acl:""},config:n.config})},r.prototype.setBucketAcl=function(e,t,n){n=n||{};var r={} +;return r[u.CONTENT_TYPE]="application/json; charset=UTF-8",this.sendRequest("PUT",{bucketName:e,body:JSON.stringify({accessControlList:t}),headers:r,params:{acl:""},config:n.config})},r.prototype.getBucketAcl=function(e,t){return t=t||{},this.sendRequest("GET",{bucketName:e,params:{acl:""},config:t.config})},r.prototype.getObjectAcl=function(e,t,n){return n=n||{},this.sendRequest("GET",{bucketName:e,key:t,params:{acl:""},config:n.config})},r.prototype.putObjectAcl=function(e,t,n,r){r=r||{};var i={};return i[u.CONTENT_TYPE]="application/json; charset=UTF-8",this.sendRequest("PUT",{bucketName:e,key:t,body:JSON.stringify({accessControlList:n}),headers:i,params:{acl:""},config:r.config})},r.prototype.putObjectCannedAcl=function(e,t,n,r){r=r||{};var i={};return i[u.X_BCE_ACL]=n,this.sendRequest("PUT",{bucketName:e,key:t,headers:i,params:{acl:""},config:r.config})},r.prototype.getBucketLocation=function(e,t){return t=t||{},this.sendRequest("GET",{bucketName:e,params:{location:""},config:t.config})},r.prototype.deleteMultipleObjects=function(e,t,n){n=n||{};var r=c.map(t,function(e){return{key:e}});return this.sendRequest("POST",{bucketName:e,params:{delete:""},body:JSON.stringify({objects:r}),config:n.config})},r.prototype.deleteObject=function(e,t,n){return n=n||{},this.sendRequest("DELETE",{bucketName:e,key:t,config:n.config})},r.prototype.putObject=function(e,t,n,r){if(!t)throw new TypeError("key should not be empty.");return r=this._checkOptions(r||{}),this.sendRequest("PUT",{bucketName:e,key:t,body:n,headers:r.headers,config:r.config})},r.prototype.putObjectFromBlob=function(e,t,n,r){var i={};return i[u.CONTENT_LENGTH]=n.size,r=c.extend(i,r),this.putObject(e,t,n,r)},r.prototype.putObjectFromDataUrl=function(e,t,r,i){r=new n(r,"base64");var a={};return a[u.CONTENT_LENGTH]=r.length,i=c.extend(a,i),this.putObject(e,t,r,i)},r.prototype.putObjectFromString=function(e,t,r,i){i=i||{};var o={};return o[u.CONTENT_LENGTH]=n.byteLength(r),o[u.CONTENT_TYPE]=i[u.CONTENT_TYPE]||m.guess(a.extname(t)),o[u.CONTENT_MD5]=l.md5sum(r),i=c.extend(o,i),this.putObject(e,t,r,i)},r.prototype.putObjectFromFile=function(e,t,n,r){function i(a){return v.putObject(e,t,o.createReadStream(n,p),r).catch(function(e){var t=new Date(e[u.X_BCE_DATE]).getTime();return b.prototype.timeOffset=t-Date.now(),400===e[u.X_STATUS_CODE]&&"Http400"===e[u.X_CODE]&&a>0?i(--a):f.reject(e)})}r=r||{};var s={},d=o.statSync(n).size,h=c.has(r,u.CONTENT_LENGTH)?r[u.CONTENT_LENGTH]:d;if(h>d)throw new Error("options['Content-Length'] should less than "+d);s[u.CONTENT_LENGTH]=h,s[u.CONTENT_TYPE]=r[u.CONTENT_TYPE]||m.guess(a.extname(n)),r=c.extend(s,r);var p={start:0,end:Math.max(0,h-1)},v=this;if(!c.has(r,u.CONTENT_MD5)){var g=o.createReadStream(n,p);return l.md5stream(g).then(function(e){return r[u.CONTENT_MD5]=e,i(r.retryCount||3)})}return i(r.retryCount||3)},r.prototype.getObjectMetadata=function(e,t,n){return n=n||{},this.sendRequest("HEAD",{bucketName:e,key:t,config:n.config})},r.prototype.getObject=function(e,t,n,r){r=r||{};var a=new v;return this.sendRequest("GET",{bucketName:e,key:t,headers:{Range:n?i.format("bytes=%s",n):""},config:r.config,outputStream:a}).then(function(e){return e.body=a.store,e})},r.prototype.getObjectToFile=function(e,t,n,r,a){return a=a||{},this.sendRequest("GET",{bucketName:e,key:t,headers:{Range:r?i.format("bytes=%s",r):""},config:a.config,outputStream:o.createWriteStream(n)})},r.prototype.copyObject=function(e,t,n,r,a){if(!e)throw new TypeError("sourceBucketName should not be empty");if(!t)throw new TypeError("sourceKey should not be empty");if(!n)throw new TypeError("targetBucketName should not be empty");if(!r)throw new TypeError("targetKey should not be empty");a=this._checkOptions(a||{});var o=!1;return c.some(a.headers,function(e,t){if(0===t.indexOf("x-bce-meta-"))return o=!0,!0}),a.headers["x-bce-copy-source"]=d.normalize(i.format("/%s/%s",e,t),!1),c.has(a.headers,"ETag")&&(a.headers["x-bce-copy-source-if-match"]=a.headers.ETag),a.headers["x-bce-metadata-directive"]=o?"replace":"copy",this.sendRequest("PUT",{bucketName:n,key:r,headers:a.headers,config:a.config})},r.prototype.initiateMultipartUpload=function(e,t,n){n=n||{};var r={};return r[u.CONTENT_TYPE]=m.guess(a.extname(t)),n=this._checkOptions(c.extend(r,n)),this.sendRequest("POST",{bucketName:e,key:t,params:{uploads:""},headers:n.headers,config:n.config})},r.prototype.abortMultipartUpload=function(e,t,n,r){return r=r||{},this.sendRequest("DELETE",{bucketName:e,key:t,params:{uploadId:n},config:r.config})},r.prototype.completeMultipartUpload=function(e,t,n,r,i){var a={};return a[u.CONTENT_TYPE]="application/json; charset=UTF-8",i=this._checkOptions(c.extend(a,i)),this.sendRequest("POST",{bucketName:e,key:t,body:JSON.stringify({parts:r}),headers:i.headers,params:{uploadId:n},config:i.config})},r.prototype.uploadPartFromFile=function(e,t,n,r,i,a,s,c){var f=s,u=s+i-1,d=o.createReadStream(a,{start:f,end:u});return this.uploadPart(e,t,n,r,i,d,c)},r.prototype.uploadPartFromBlob=function(e,t,n,r,a,o,s){if(o.size!==a)throw new TypeError(i.format("Invalid partSize %d and data length %d",a,o.size));var f={};return f[u.CONTENT_LENGTH]=a,f[u.CONTENT_TYPE]="application/octet-stream",s=this._checkOptions(c.extend(f,s)),this.sendRequest("PUT",{bucketName:e,key:t,body:o,headers:s.headers,params:{partNumber:r,uploadId:n},config:s.config})},r.prototype.uploadPartFromDataUrl=function(e,t,r,a,o,s,f){var d=new n(s,"base64");if(d.length!==o)throw new TypeError(i.format("Invalid partSize %d and data length %d",o,d.length));var h={};return h[u.CONTENT_LENGTH]=o,h[u.CONTENT_TYPE]="application/octet-stream",f=this._checkOptions(c.extend(h,f)),this.sendRequest("PUT",{bucketName:e,key:t,body:d,headers:f.headers,params:{partNumber:a,uploadId:r},config:f.config})},r.prototype.uploadPart=function(e,t,n,r,a,s,f){function d(){return f=h._checkOptions(f),h.sendRequest("PUT",{bucketName:e,key:t,body:p,headers:f.headers,params:{partNumber:r,uploadId:n},config:f.config})}if(!e)throw new TypeError("bucketName should not be empty");if(!t)throw new TypeError("key should not be empty");if(r<1||r>1e4)throw new TypeError(i.format("Invalid partNumber %d. The valid range is from %d to %d.",r,1,1e4));var h=this,p=o.createReadStream(s.path,{start:s.start,end:s.end}),b={};return b[u.CONTENT_LENGTH]=a,b[u.CONTENT_TYPE]="application/octet-stream",f=c.extend(b,f),f[u.CONTENT_MD5]?d():l.md5stream(s).then(function(e){return f[u.CONTENT_MD5]=e,d()})},r.prototype.uploadPartCopy=function(e,t,n,r,a,o,s,c){if(!e)throw new TypeError("sourceBucket should not be empty");if(!t)throw new TypeError("sourceKey should not be empty");if(!n)throw new TypeError("targetBucket should not be empty");if(!r)throw new TypeError("targetKey should not be empty");if(o<1||o>1e4)throw new TypeError(i.format("Invalid partNumber %d. The valid range is from %d to %d.",o,1,1e4));return c=this._checkOptions(c||{}),c.headers["x-bce-copy-source"]=d.normalize(i.format("/%s/%s",e,t),!1),c.headers["x-bce-copy-source-range"]=s?i.format("bytes=%s",s):"",this.sendRequest("PUT",{bucketName:n,key:r,headers:c.headers,config:c.config,params:{partNumber:o,uploadId:a}})},r.prototype.listParts=function(e,t,n,r){if(!n)throw new TypeError("uploadId should not empty");var i=["maxParts","partNumberMarker","uploadId"];return r=this._checkOptions(r||{},i),r.params.uploadId=n,this.sendRequest("GET",{bucketName:e,key:t,params:r.params,config:r.config})},r.prototype.listMultipartUploads=function(e,t){var n=["delimiter","maxUploads","keyMarker","prefix","uploads"];return t=this._checkOptions(t||{},n),t.params.uploads="",this.sendRequest("GET",{bucketName:e,params:t.params,config:t.config})},r.prototype.appendObject=function(e,t,n,r,i){if(!t)throw new TypeError("key should not be empty.");i=this._checkOptions(i||{});var a={append:""};return c.isNumber(r)&&(a.offset=r),this.sendRequest("POST",{bucketName:e,key:t,body:n,headers:i.headers,params:a,config:i.config})},r.prototype.appendObjectFromBlob=function(e,t,n,r,i){var a={};return a[u.CONTENT_LENGTH]=n.size,i=c.extend(a,i),this.appendObject(e,t,n,r,i)},r.prototype.appendObjectFromDataUrl=function(e,t,r,i,a){r=new n(r,"base64");var o={};return o[u.CONTENT_LENGTH]=r.length,a=c.extend(o,a),this.appendObject(e,t,r,i,a)},r.prototype.appendObjectFromString=function(e,t,r,i,o){o=o||{};var s={};return s[u.CONTENT_LENGTH]=n.byteLength(r),s[u.CONTENT_TYPE]=o[u.CONTENT_TYPE]||m.guess(a.extname(t)),s[u.CONTENT_MD5]=l.md5sum(r),o=c.extend(s,o),this.appendObject(e,t,r,i,o)},r.prototype.appendObjectFromFile=function(e,t,n,r,i,s){if(s=s||{},0===i)return this.appendObjectFromString(e,t,"",r,s);var f={},d=o.statSync(n).size;if(i+r>d)throw new Error("Can't read the content beyond the end of file.");f[u.CONTENT_LENGTH]=i,f[u.CONTENT_TYPE]=s[u.CONTENT_TYPE]||m.guess(a.extname(n)),s=c.extend(f,s);var h={start:r||0,end:(r||0)+i-1},p=o.createReadStream(n,h);if(!c.has(s,u.CONTENT_MD5)){var b=this,v=o.createReadStream(n,h);return l.md5stream(v).then(function(n){return s[u.CONTENT_MD5]=n,b.appendObject(e,t,p,r,s)})}return this.appendObject(e,t,p,r,s)},r.prototype.signPostObjectPolicy=function(e){var t=this.config.credentials,r=new h(t.ak,t.sk);return e=new n(JSON.stringify(e)).toString("base64"),{policy:e,signature:r.hash(e,t.sk)}},r.prototype.postObject=function(e,t,r,i){var a="MM8964"+(Math.random()*Math.pow(2,63)).toString(36),s="multipart/form-data; boundary="+a;if(c.isString(r))r=o.readFileSync(r);else if(!n.isBuffer(r))throw new Error("Invalid data type.");var f=this.config.credentials,d=f.ak,h=["signature","accessKey","key","file"];i=c.omit(i||{},h);var l=new g(a);for(var p in i)i.hasOwnProperty(p)&&"policy"!==p&&l.addPart(p,i[p]);if(i.policy){var b=this.signPostObjectPolicy(i.policy);l.addPart("policy",b.policy),l.addPart("signature",b.signature)}l.addPart("accessKey",d),l.addPart("key",t),l.addPart("file",r);var m=l.encode(),v={};return v[u.CONTENT_TYPE]=s,this.sendRequest("POST",{bucketName:e,body:m,headers:v})},r.prototype.sendRequest=function(e,t){var n={bucketName:null,key:null,body:null,headers:{},params:{},config:{},outputStream:null},r=c.extend(n,t),i=c.extend({},this.config,r.config),o=a.normalize(a.join(r.removeVersionPrefix?"/":"/v1",/\.[\w\-]+\.bcebos\.com$/.test(i.endpoint)?"":d.normalize(r.bucketName||""),d.normalize(r.key||"",!1))).replace(/\\/g,"/");return i.sessionToken&&(r.headers[u.SESSION_TOKEN]=i.sessionToken),this.sendHTTPRequest(e,o,r,i)},r.prototype.sendHTTPRequest=function(e,t,n,r){function i(){var i=this._httpAgent=new p(r),o={httpMethod:e,resource:t,args:n,config:r};c.each(["progress","error","abort","timeout"],function(e){i.on(e,function(t){a.emit(e,t,o)})});var s=this._httpAgent.sendRequest(e,t,n.body,n.headers,n.params,c.bind(this.createSignature,this),n.outputStream);return s.abort=function(){if(i._req&&i._req.xhr){i._req.xhr.abort()}},s}var a=this;return i.call(a).catch(function(e){var t=new Date(e[u.X_BCE_DATE]).getTime();return b.prototype.timeOffset=t-Date.now(),403===e[u.X_STATUS_CODE]&&"RequestTimeTooSkewed"===e[u.X_CODE]?i.call(a):f.reject(e)})},r.prototype._checkOptions=function(e,t){var n={};return n.config=e.config||{},n.headers=this._prepareObjectHeaders(e),n.params=c.pick(e,t||[]),n},r.prototype._prepareObjectHeaders=function(e){var t=[u.CONTENT_LENGTH,u.CONTENT_ENCODING,u.CONTENT_MD5,u.X_BCE_CONTENT_SHA256,u.CONTENT_TYPE,u.CONTENT_DISPOSITION,u.ETAG,u.SESSION_TOKEN,u.CACHE_CONTROL,u.EXPIRES,u.X_BCE_ACL,u.X_BCE_GRANT_READ,u.X_BCE_GRANT_FULL_CONTROL,u.X_BCE_OBJECT_ACL,u.X_BCE_OBJECT_GRANT_READ,u.X_BCE_STORAGE_CLASS],r=0,a=c.pick(e,function(e,i){return-1!==t.indexOf(i)||(/^x\-bce\-meta\-/.test(i)?(r+=n.byteLength(i)+n.byteLength(""+e),!0):void 0)});if(r>2048)throw new TypeError("Metadata size should not be greater than 2048.");if(c.has(a,u.CONTENT_LENGTH)){var o=a[u.CONTENT_LENGTH];if(o<0)throw new TypeError("content_length should not be negative.");if(o>5368709120)throw new TypeError("Object length should be less than 5368709120. Use multi-part upload instead.")}if(c.has(a,"ETag")){var s=a.ETag;/^"/.test(s)||(a.ETag=i.format('"%s"',s))}if(c.has(a,u.CONTENT_TYPE)||(a[u.CONTENT_TYPE]="application/octet-stream"),c.has(a,u.X_BCE_STORAGE_CLASS)){const f=a[u.X_BCE_STORAGE_CLASS],d=["STANDARD","STANDARD_IA","ARCHIVE","COLD","MAZ_STANDARD","MAZ_STANDARD_IA"];d.includes(f)||(a[u.X_BCE_STORAGE_CLASS]=d[0])}return a},t.exports=r}).call(this,e("buffer").Buffer)},{"./auth":209,"./bce_base_client":211,"./crypto":218,"./headers":221,"./http_client":223,"./mime.types":228,"./multipart":229,"./strings":233,"./wm_stream":244,buffer:56,fs:25,path:159,q:173,querystring:176,underscore:202,url:203,util:206}],214:[function(e,t,n){function r(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:null;this.cells=this.cells||[];var n=new c;n.column=e,null!==t&&(n.value=s(t)),this.cells.push(n)}}]),e}(),u=function e(){o(this,e),this.storageType=null},d=function e(){o(this,e),this.tableVersion=0,this.compressType=null,this.ttl=null,this.storageType=null,this.maxVersions=null},h=function e(){o(this,e),this.tableVersion=null,this.compressType=null,this.ttl=null,this.maxVersions=null},l=function(){function e(){o(this,e),this.rowkey=null,this.cells=null}return i(e,[{key:"addCells",value:function(e,t){this.cells=this.cells||[];var n=new c;n.column=e,n.value=s(t),this.cells.push(n)}},{key:"encode",value:function(e){return s(e)}}]),e}(),p=function(){function e(){o(this,e),this.rows=null}return i(e,[{key:"addRows",value:function(e,t,n){this.rows=this.rows||[];var r=new f;r.addCells(t,n),r.rowkey=r.encode(e),this.rows.push(r)}}]),e}(),b=function(){function e(){o(this,e),this.rowkey=null,this.cells=null}return i(e,[{key:"encode",value:function(e){return s(e)}},{key:"addCells",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(this.cells=this.cells||[],null!=e){var t=new c;t.column=s(e),this.cells.push(t)}}}]),e}(),m=function(){function e(){o(this,e),this.rows=null}return i(e,[{key:"addRows",value:function(e,t){this.rows=this.rows||[];var n=new f;n.addCells(t),n.rowkey=n.encode(e),this.rows.push(n)}}]),e}(),v=function(){function e(){o(this,e),this.rowkey=null,this.cells=null}return i(e,[{key:"encode",value:function(e){return s(e)}},{key:"addCells",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(this.cells=this.cells||[],null!=e){var t=new c;t.column=e,this.cells.push(t)}}}]),e}(),g=function(){function e(){o(this,e),this.rows=null}return i(e,[{key:"addRows",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.rows=this.rows||[];var n=new f;null!==t&&n.addCells(t),n.rowkey=n.encode(e),this.rows.push(n)}}]),e}(),y=function(){function e(){o(this,e),this.startRowkey=null,this.includeStart=!0,this.stopRowkey=null,this.includeStop=!1,this.selector=null,this.limit=null}return i(e,[{key:"encode",value:function(e){return s(e)}},{key:"addCells",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(this.selector=this.selector||[],null!=e){var t=new c;t.column=e,this.selector.push(t)}}}]),e}();t.exports={Cell:c,Row:f,CreateInstanceRequest:u,CreateTableRequest:d,UpdateTableRequest:h,PutRowRequest:l,BatchPutRowRequest:p,DeleteRowRequest:b,BatchDeleteRowRequest:m,GetRowRequest:v,BatchGetRowRequest:g,ScanRequest:y}},{urlencode:204}],215:[function(e,t,n){function r(e){o.call(this,e,"bts",!0)}var i=e("util"),a=e("./bts/models"),o=e("./bce_base_client"),s=a.CreateInstanceRequest,c=a.CreateTableRequest,f=a.UpdateTableRequest,u=a.PutRowRequest,d=a.BatchPutRowRequest,h=a.DeleteRowRequest,l=a.BatchDeleteRowRequest,p=a.GetRowRequest,b=a.BatchGetRowRequest,m=a.ScanRequest;i.inherits(r,o),r.prototype.listInstances=function(){return this.sendRequest("GET","/v1/instances",null)},r.prototype.dropInstance=function(e){return this.sendRequest("DELETE","/v1/instance/"+e,null)},r.prototype.showInstance=function(e){return this.sendRequest("GET","/v1/instance/"+e,null)},r.prototype.createInstance=function(e,t){return this.sendRequest("PUT","/v1/instance/"+e,{body:JSON.stringify(t)})},r.prototype.createTable=function(e,t,n){return this.sendRequest("PUT","/v1/instance/"+e+"/table/"+t,{body:JSON.stringify(n)})},r.prototype.updateTable=function(e,t,n){return this.sendRequest("PUT","/v1/instance/"+e+"/table/"+t,{body:JSON.stringify(n)})},r.prototype.dropTable=function(e,t){return this.sendRequest("DELETE","/v1/instance/"+e+"/table/"+t,null)},r.prototype.showTable=function(e,t,n){var r={onlyState:""};return n?this.sendRequest("GET","/v1/instance/"+e+"/table/"+t,{params:r}):this.sendRequest("GET","/v1/instance/"+e+"/table/"+t,null)},r.prototype.listTables=function(e){return this.sendRequest("GET","/v1/instance/"+e+"/tables",null)},r.prototype.putRow=function(e,t,n){return n.rowkey=n.encode(n.rowkey),this.sendRequest("PUT","/v1/instance/"+e+"/table/"+t+"/row",{body:JSON.stringify(n)})},r.prototype.batchPutRow=function(e,t,n){return this.sendRequest("PUT","/v1/instance/"+e+"/table/"+t+"/rows",{body:JSON.stringify(n)})},r.prototype.deleteRow=function(e,t,n){return n.rowkey=n.encode(n.rowkey),this.sendRequest("DELETE","/v1/instance/"+e+"/table/"+t+"/row",{body:JSON.stringify(n)})},r.prototype.batchDeleteRow=function(e,t,n){return this.sendRequest("DELETE","/v1/instance/"+e+"/table/"+t+"/rows",{body:JSON.stringify(n)})},r.prototype.getRow=function(e,t,n){return n.rowkey=n.encode(n.rowkey),this.sendRequest("GET","/v1/instance/"+e+"/table/"+t+"/row",{body:JSON.stringify(n)})},r.prototype.batchGetRow=function(e,t,n){return this.sendRequest("GET","/v1/instance/"+e+"/table/"+t+"/rows",{body:JSON.stringify(n)})},r.prototype.scan=function(e,t,n){return null!==n.startRowkey&&(n.startRowkey=n.encode(n.startRowkey)),null!==n.stopRowkey&&(n.stopRowkey=n.encode(n.stopRowkey)),this.sendRequest("GET","/v1/instance/"+e+"/table/"+t+"/rows",{body:JSON.stringify(n)})},t.exports={BtsClient:r,CreateInstanceRequest:s,CreateTableRequest:c,UpdateTableRequest:f,PutRowRequest:u,BatchPutRowRequest:d,DeleteRowRequest:h,BatchDeleteRowRequest:l,GetRowRequest:p,BatchGetRowRequest:b,ScanRequest:m}},{"./bce_base_client":211,"./bts/models":214,util:206}],216:[function(e,t,n){function r(e){c.call(this,e,"cfc",!0)}var i=e("util"),a=e("./strings"),o=e("underscore"),s=e("debug")("bce-sdk:CfcClient"),c=e("./bce_base_client");i.inherits(r,c),r.prototype.listFunctions=function(e){var t=e||{},n=o.extend(o.pick(t,"Marker","MaxItems"));return s("params ",n),this.sendRequest("GET","/v1/functions",{params:n,config:t.config})},r.prototype.createFunction=function(e){return s("createFunction, body = %j",e),this.sendRequest("POST","/v1/functions",{params:{},body:JSON.stringify(e)})},r.prototype.getFunction=function(e,t){var n=t||{},r=o.extend(o.pick(n,"Qualifier"));return this.sendRequest("GET","/v1/functions/"+a.normalize(e),{params:r})},r.prototype.deleteFunction=function(e,t){var n=t||{},r=o.extend(o.pick(n,"Qualifier"));return this.sendRequest("DELETE","/v1/functions/"+e,{params:r})},r.prototype.invocations=function(e,t,n){var r=n||{},i=o.extend(o.pick(r,"Qualifier","invocationType","logType","logToBody"));return this.sendRequest("POST","/v1/functions/"+a.normalize(e)+"/invocations",{params:i,body:JSON.stringify(t)})},r.prototype.invoke=r.prototype.invocations,r.prototype.updateFunctionCode=function(e,t){return this.sendRequest("PUT","/v1/functions/"+e+"/code",{body:JSON.stringify(t)})},r.prototype.getFunctionConfiguration=function(e,t){var n=t||{},r=o.extend(o.pick(n,"Qualifier"));return this.sendRequest("GET","/v1/functions/"+e+"/configuration",{params:r})},r.prototype.updateFunctionConfiguration=function(e,t){return this.sendRequest("PUT","/v1/functions/"+e+"/configuration",{body:JSON.stringify(t)})},r.prototype.listVersionsByFunction=function(e,t){var n=t||{},r=o.extend(o.pick(n,"Marker","MaxItems"));return this.sendRequest("GET","/v1/functions/"+e+"/versions",{params:r})},r.prototype.publishVersion=function(e,t){var n={};return null!=t&&(n.Description=t),this.sendRequest("POST","/v1/functions/"+e+"/versions",{body:JSON.stringify(n)})},r.prototype.createAlias=function(e,t){return this.sendRequest("POST","/v1/functions/"+e+"/aliases",{body:JSON.stringify(t)})},r.prototype.getAlias=function(e,t){return this.sendRequest("GET","/v1/functions/"+e+"/aliases/"+t,{})},r.prototype.updateAlias=function(e,t,n){return this.sendRequest("PUT","/v1/functions/"+e+"/aliases/"+t,{body:JSON.stringify(n)})},r.prototype.deleteAlias=function(e,t){return this.sendRequest("DELETE","/v1/functions/"+e+"/aliases/"+t,{})},r.prototype.listAliases=function(e,t){var n=t||{},r=o.extend(o.pick(n,"FunctionVersion","Marker","MaxItems"));return this.sendRequest("GET","/v1/functions/"+e+"/aliases/",{params:r})},r.prototype.listRelations=function(e){var t=e||{},n=o.extend(o.pick(t,"FunctionBrn"));return this.sendRequest("GET","/v1/relation",{params:n})},r.prototype.createRelation=function(e,t){s("createRelation, body = %j",e);var n=t||{};o.extend(o.pick(n,"FunctionBrn"));return this.sendRequest("POST","/v1/relation",{body:JSON.stringify(e)})},r.prototype.updateRelation=function(e){return this.sendRequest("PUT","/v1/relation",{body:JSON.stringify(e)})},r.prototype.deleteRelation=function(e){var t=e||{},n=o.extend(o.pick(t,"Target","Source","RelationId"));return this.sendRequest("DELETE","/v1/relation",{params:n})},r.prototype.listEventSourceMappings=function(e){var t=e||{},n=o.extend(o.pick(t,"FunctionName"));return this.sendRequest("GET","/v1/event-source-mappings",{params:n})},r.prototype.createEventSourceMapping=function(e){return s("createEventSourceMapping, body = %j",e),this.sendRequest("POST","/v1/event-source-mappings",{body:JSON.stringify(e)})},r.prototype.updateEventSourceMapping=function(e,t){return this.sendRequest("PUT","/v1/event-source-mappings/"+e,{body:JSON.stringify(t)})},r.prototype.deleteEventSourceMapping=function(e){return this.sendRequest("DELETE","/v1/event-source-mappings/"+e,{})},r.prototype.sendRequest=function(e,t,n){return this.config.workspaceId&&(n.headers||(n.headers={}),n.headers["X-CFC-Workspace-Id"]=this.config.workspaceId),c.prototype.sendRequest.call(this,e,t,n)},t.exports=r},{"./bce_base_client":211,"./strings":233,debug:66,underscore:202,util:206}],217:[function(e,t,n){n.DEFAULT_SERVICE_DOMAIN="baidubce.com",n.DEFAULT_CONFIG={protocol:"http",region:"bj"}},{}],218:[function(e,t,n){(function(t){var r=e("fs"),i=e("crypto"),a=e("q");n.md5sum=function(e,n,r){t.isBuffer(e)||(e=new t(e,n||"UTF-8"));var a=i.createHash("md5");return a.update(e),a.digest(r||"base64")},n.md5stream=function(e,t){var n=a.defer(),r=i.createHash("md5");return e.on("data",function(e){r.update(e)}),e.on("end",function(){n.resolve(r.digest(t||"base64"))}),e.on("error",function(e){n.reject(e)}),n.promise},n.md5file=function(e,t){return n.md5stream(r.createReadStream(e),t)},n.md5blob=function(e,t){var r=a.defer(),i=new FileReader;return i.readAsArrayBuffer(e),i.onerror=function(e){r.reject(i.error)},i.onloadend=function(e){if(e.target.readyState===FileReader.DONE){var i=e.target.result,a=n.md5sum(i,null,t);r.resolve(a)}},r.promise}}).call(this,e("buffer").Buffer)},{buffer:56,crypto:65,fs:25,q:173}],219:[function(e,t,n){(function(t){function r(e){l.call(this,e,"doc",!1),this._documentId=null}function i(e){l.call(this,e,"doc",!1),this._name=null,this._endpoint=null}var a=e("fs"),o=e("path"),s=e("util"),c=e("url"),f=e("q"),u=e("underscore"),d=e("debug")("bce-sdk:Document"),h=e("./bos_client"),l=e("./bce_base_client"),p=e("./helper"),b=e("./crypto");s.inherits(r,l),r.prototype._buildUrl=function(){var e="/v2/document",t=u.toArray(arguments);return t.length&&(e+="/"+t.join("/")),e},r.prototype.getId=function(){return this._documentId},r.prototype.setId=function(e){return this._documentId=e,this},r.prototype.create=function(e,n){var r=u.extend({},n),i=-1,s=/^bos:\/\//;if(u.isString(e)){if(s.test(e))try{var d=c.parse(e),h=d.host,l=d.pathname.substr(1);r=u.extend(r,d.query);var p=r.title||o.basename(l),m=r.format||o.extname(l).substr(1),v=r.notification;return this.createFromBos(h,l,p,m,v)}catch(e){return f.reject(e)}i=1,r.format=r.format||o.extname(e).substr(1),r.title=r.title||o.basename(e,o.extname(e))}else if(t.isBuffer(e)){if(null==r.format||null==r.title)return f.reject(new Error("buffer type required options.format and options.title"));i=2}else{if(!("undefined"!=typeof Blob&&e instanceof Blob))return f.reject(new Error("Unsupported dataType."));i=4,r.format=r.format||o.extname(e.name).substr(1),r.title=r.title||o.basename(e.name,o.extname(e.name))}if(!r.title||!r.format)return f.reject(new Error("`title` and `format` are required."));if(r.meta.md5)return this._doCreate(e,r);var g=this;return 1===i?b.md5stream(a.createReadStream(e),"hex").then(function(t){return r.meta.md5=t,g._doCreate(e,r)}):4===i?b.md5blob(e,"hex").then(function(t){return r.meta.md5=t,g._doCreate(e,r)}):this._doCreate(e,r)},r.prototype._doCreate=function(e,t){var n=null,r=null,i=null,a=null,o=this;return o.register(t).then(function(t){d("register[response = %j]",t),n=t.body.documentId,r=t.body.bucket,i=t.body.object,a=t.body.bosEndpoint;var s=u.extend({},o.config,{endpoint:a}),c=new h(s);return p.upload(c,r,i,e)}).then(function(e){return d("upload[response = %j]",e),o.publish()}).then(function(e){return d("publish[response = %j]",e),e.body={documentId:n,bucket:r,object:i,bosEndpoint:a},e})},r.prototype.register=function(e){d("register[options = %j]",e);var t=this,n=this._buildUrl();return this.sendRequest("POST",n,{params:{register:""},headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}).then(function(e){return t.setId(e.body.documentId),e})},r.prototype.publish=function(e){var t=this._buildUrl(e||this._documentId);return this.sendRequest("PUT",t,{params:{publish:""}})},r.prototype.get=function(e){var t=this._buildUrl(e||this._documentId);return this.sendRequest("GET",t)},r.prototype.read=function(e){var t=this._buildUrl(e||this._documentId);return this.sendRequest("GET",t,{params:{read:""}})},r.prototype.download=function(e){var t=this._buildUrl(e||this._documentId);return this.sendRequest("GET",t,{params:{download:""}})},r.prototype.createFromBos=function(e,t,n,r,i){var a=this._buildUrl(),s={bucket:e,object:t,title:n},c=r||o.extname(t).substr(1);if(!c)throw new Error("Document format parameter required");s.format=c,i&&(s.notification=i),d("createFromBos:arguments = [%j], body = [%j]",arguments,s);var f=this;return this.sendRequest("POST",a,{params:{source:"bos"},headers:{"Content-Type":"application/json"},body:JSON.stringify(s)}).then(function(e){return f.setId(e.body.documentId),e})},r.prototype.removeAll=function(){var e=this;return e.list().then(function(t){var n=(t.body.documents||[]).map(function(t){return e.remove(t.documentId)});return f.all(n)})},r.prototype.remove=function(e){var t=this._buildUrl(e||this._documentId);return this.sendRequest("DELETE",t)},r.prototype.list=function(e){var t=e||"",n=this._buildUrl();return this.sendRequest("GET",n,{params:{status:t}})},s.inherits(i,l),i.prototype._buildUrl=function(){var e="/v1/notification",t=u.toArray(arguments);return t.length&&(e+="/"+t.join("/")),e},i.prototype.create=function(e,t){var n=this,r=this._buildUrl();return n.sendRequest("POST",r,{headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e,endpoint:t})}).then(function(r){return n._name=e,n._endpoint=t,r})},i.prototype.get=function(e){var t=this._buildUrl(e||this._name);return this.sendRequest("GET",t)},i.prototype.list=function(){return this.sendRequest("GET",this._buildUrl())},i.prototype.remove=function(e){var t=this._buildUrl(e||this._name);return this.sendRequest("DELETE",t)},i.prototype.removeAll=function(){var e=this;return e.list().then(function(t){var n=(t.body.notifications||[]).map(function(t){return e.remove(t.name)});return f.all(n)})},n.Document=r,n.Notification=i}).call(this,{isBuffer:e("../node_modules/is-buffer/index.js")})},{"../node_modules/is-buffer/index.js":136,"./bce_base_client":211,"./bos_client":213,"./crypto":218,"./helper":222,debug:66,fs:25,path:159,q:173,underscore:202,url:203,util:206}],220:[function(e,t,n){(function(n){function r(e){s.call(this,e,"face",!0)}var i=e("util"),a=e("underscore"),o=e("debug")("bce-sdk:FaceClient"),s=e("./bce_base_client");i.inherits(r,s),r.prototype.createApp=function(e){e=e||{};return this.sendRequest("POST","/v1/app",{config:e.config})},r.prototype.listApps=function(e){e=e||{};return this.sendRequest("GET","/v1/app",{config:e.config})},r.prototype.createGroup=function(e,t,n){n=n||{};var r="/v1/app/"+e+"/group";return this.sendRequest("POST",r,{body:JSON.stringify({groupName:t}),config:n.config})},r.prototype.deleteGroup=function(e,t,n){n=n||{};var r="/v1/app/"+e+"/group/"+t;return this.sendRequest("DELETE",r,{config:n.config})},r.prototype.getGroup=function(e,t,n){n=n||{};var r="/v1/app/"+e+"/group/"+t;return this.sendRequest("GET",r,{config:n.config})},r.prototype.listGroups=function(e,t){t=t||{};var n="/v1/app/"+e+"/group";return this.sendRequest("GET",n,{config:t.config})},r.prototype.createPerson=function(e,t,n,r,i){i=i||{},r=r.map(function(e){return{bosPath:e}}),o("Create Person Faces = %j",r);var a="/v1/app/"+e+"/person";return this.sendRequest("POST",a,{body:JSON.stringify({personName:n,groupName:t,faces:r}),config:i.config})},r.prototype.deletePerson=function(e,t,n){n=n||{};var r="/v1/app/"+e+"/person/"+t;return this.sendRequest("DELETE",r,{config:n.config})},r.prototype.updatePerson=function(e,t,n,r){r=r||{},n=n.map(function(e){return{bosPath:e}});var i="/v1/app/"+e+"/person/"+t;return this.sendRequest("PUT",i,{body:JSON.stringify({faces:n}),config:r.config})},r.prototype.getPerson=function(e,t,n){n=n||{};var r="/v1/app/"+e+"/person/"+t;return this.sendRequest("GET",r,{config:n.config})},r.prototype.listPersons=function(e,t){t=t||{};var n="/v1/app/"+e+"/person",r=a.pick(t,"groupName");return this.sendRequest("GET",n,{params:r,config:t.config})},r.prototype.identify=function(e,t,r,i){i=i||{};var a={};a=n.isBuffer(r)?{base64:r.toString("base64")}:{bosPath:r};var o="/v1/app/"+e+"/group/"+t;return this.sendRequest("POST",o,{params:{identify:""},body:JSON.stringify(a),config:i.config})},r.prototype.verify=function(e,t,r,i){i=i||{};var a={};a=n.isBuffer(r)?{base64:r.toString("base64")}:{bosPath:r};var o="/v1/app/"+e+"/person/"+t;return this.sendRequest("POST",o,{params:{verify:""},body:JSON.stringify(a),config:i.config})},t.exports=r}).call(this,{isBuffer:e("../node_modules/is-buffer/index.js")})},{"../node_modules/is-buffer/index.js":136,"./bce_base_client":211,debug:66,underscore:202,util:206}],221:[function(e,t,n){n.CONTENT_TYPE="Content-Type",n.CONTENT_LENGTH="Content-Length",n.CONTENT_MD5="Content-MD5",n.CONTENT_ENCODING="Content-Encoding",n.CONTENT_DISPOSITION="Content-Disposition",n.ETAG="ETag",n.CONNECTION="Connection",n.HOST="Host",n.USER_AGENT="User-Agent",n.CACHE_CONTROL="Cache-Control",n.EXPIRES="Expires",n.AUTHORIZATION="Authorization",n.X_BCE_DATE="x-bce-date",n.X_BCE_ACL="x-bce-acl",n.X_BCE_GRANT_READ="x-bce-grant-read",n.X_BCE_GRANT_FULL_CONTROL="x-bce-grant-full-control",n.X_BCE_REQUEST_ID="x-bce-request-id",n.X_BCE_CONTENT_SHA256="x-bce-content-sha256",n.X_BCE_OBJECT_ACL="x-bce-object-acl",n.X_BCE_OBJECT_GRANT_READ="x-bce-object-grant-read",n.X_BCE_STORAGE_CLASS="x-bce-storage-class",n.X_HTTP_HEADERS="http_headers",n.X_BODY="body", n.X_STATUS_CODE="status_code",n.X_MESSAGE="message",n.X_CODE="code",n.X_REQUEST_ID="request_id",n.SESSION_TOKEN="x-bce-security-token",n.X_VOD_MEDIA_TITLE="x-vod-media-title",n.X_VOD_MEDIA_DESCRIPTION="x-vod-media-description",n.ACCEPT_ENCODING="accept-encoding",n.ACCEPT="accept"},{}],222:[function(e,t,n){(function(t){function r(e,t,n,r,o,s,h,l){var p;return e.initiateMultipartUpload(r,o,l).then(function(f){p=f.body.uploadId,d("initiateMultipartUpload = %j",f);var l=u.defer(),b=a(t,p,r,o,s,h),m={lengthComputable:!0,loaded:0,total:b.length};return c.mapLimit(b,2,i(e,n,m),function(e,t){e?l.reject(e):l.resolve(t)}),l.promise}).then(function(t){var n=f.map(t,function(e,t){return{partNumber:t+1,eTag:e.http_headers.etag}});return d("parts = %j",n),e.completeMultipartUpload(r,o,p,n)})}function i(e,t,n){return function(r,i){var a=function(t){++n.loaded,e.emit("progress",n),i(null,t)},o=function(e){i(e)};if(t===h)return d("client.uploadPartFromFile(%j)",f.omit(r,"data")),e.uploadPartFromFile(r.bucket,r.object,r.uploadId,r.partNumber,r.partSize,r.data,r.start).then(a,o);if(t===l){d("client.uploadPartFromDataUrl(%j)",f.omit(r,"data"));var s=r.data.slice(r.start,r.stop+1).toString("base64");return e.uploadPartFromDataUrl(r.bucket,r.object,r.uploadId,r.partNumber,r.partSize,s).then(a,o)}if(t===p){d("client.uploadPartFromBlob(%j)",f.omit(r,"data"));var c=r.data.slice(r.start,r.stop+1);return e.uploadPartFromBlob(r.bucket,r.object,r.uploadId,r.partNumber,r.partSize,c).then(a,o)}}}function a(e,t,n,r,i,a){for(var o=i,s=0,c=1,f=[];o>0;){var u=Math.min(o,a);f.push({data:e,uploadId:t,bucket:n,object:r,partNumber:c,partSize:u,start:s,stop:s+u-1}),o-=u,s+=u,c+=1}return f}var o=e("fs"),s=e("stream"),c=e("async"),f=e("underscore"),u=e("q"),d=e("debug")("bce-sdk:helper"),h=1,l=2,p=4;n.omitNull=function(e,t,n){return null!=e},n.upload=function(e,n,i,a,c){var f=0,u=-1;if("string"==typeof a?(f=o.lstatSync(a).size,u=h):t.isBuffer(a)?(f=a.length,u=l):a instanceof s.Readable?u=3:"undefined"!=typeof Blob&&a instanceof Blob&&(f=a.size,u=p),-1===u)throw new Error("Unsupported `data` type.");if(3===u)return e.putObject(n,i,a,c);if(f<=5242880){if(u===h)return e.putObjectFromFile(n,i,a,c);if(u===l)return e.putObject(n,i,a,c);if(u===p)return e.putObjectFromBlob(n,i,a,c)}else if(f>5242880)return d("%s > %s -> multi-part",f,5242880),r(e,a,u,n,i,f,1048576,c)}}).call(this,{isBuffer:e("../node_modules/is-buffer/index.js")})},{"../node_modules/is-buffer/index.js":136,async:21,debug:66,fs:25,q:173,stream:200,underscore:202}],223:[function(e,t,n){(function(n){function r(e){p.call(this),this.config=e,this._req=null}function i(e,t,n,r,i){return new y(e.ak,e.sk).generateAuthorization(t,n,r,i)}function a(e){return e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof e.then}function o(e){return"undefined"!=typeof Blob&&e instanceof Blob||("undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer||("undefined"!=typeof FormData&&e instanceof FormData||void 0))}function s(e,t){var n={};return n[g.X_HTTP_HEADERS]=e,n[g.X_BODY]=t,n}function c(e,t,r,i,a){var o={};return o[g.X_STATUS_CODE]=e,o[g.X_MESSAGE]=n.isBuffer(t)?String(t):t,r&&(o[g.X_CODE]=r),i&&(o[g.X_REQUEST_ID]=i),a&&(o[g.X_BCE_DATE]=a),o}var f=e("process"),u=e("http"),d=e("https"),h=e("util"),l=e("stream"),p=e("events").EventEmitter,b=e("underscore"),m=e("q"),v=e("debug")("bce-sdk:HttpClient"),g=e("./headers"),y=e("./auth");h.inherits(r,p),r.prototype.sendRequest=function(t,n,r,o,s,c,u){t=t.toUpperCase();var d=this._getRequestUrl(n,s),l=e("url").parse(d);v("httpMethod = %s, requestUrl = %s, options = %j",t,d,l);var p={};if("object"==typeof navigator?p[g.USER_AGENT]=navigator.userAgent:p[g.USER_AGENT]=h.format("bce-sdk-nodejs/%s/%s/%s",e("../package.json").version,f.platform,f.version),p[g.X_BCE_DATE]=(new Date).toISOString().replace(/\.\d+Z$/,"Z"),p[g.CONNECTION]="close",p[g.CONTENT_TYPE]="application/json; charset=UTF-8",p[g.HOST]=l.host,o=b.extend({},p,o),!o.hasOwnProperty(g.CONTENT_LENGTH)){var m=this._guessContentLength(r);0===m&&/GET|HEAD/i.test(t)||(o[g.CONTENT_LENGTH]=m)}var y=this;if(l.method=t,l.headers=o,l.mode="prefer-fast",l.withCredentials=!1,l.rejectUnauthorized=!1,"function"==typeof c){var _=c(this.config.credentials,t,n,s,o);if(a(_))return _.then(function(e,t){return o[g.AUTHORIZATION]=e,t&&(o[g.X_BCE_DATE]=t),v("options = %j",l),y._doRequest(l,r,u)});if("string"!=typeof _)throw new Error("Invalid signature = ("+_+")");o[g.AUTHORIZATION]=_}else o[g.AUTHORIZATION]=i(this.config.credentials,t,n,s,o);return v("options = %j",l),y._doRequest(l,r,u)},r.prototype._isValidStatus=function(e){return e>=200&&e<300},r.prototype._doRequest=function(e,t,n){var r=m.defer(),i="https:"===e.protocol?d:u,a=this,o=a._req=i.request(e,function(e){if(a._isValidStatus(e.statusCode)&&n&&n instanceof l.Writable)return e.pipe(n),n.on("finish",function(){r.resolve(s(a._fixHeaders(e.headers),{}))}),void n.on("error",function(e){r.reject(e)});r.resolve(a._recvResponse(e))});o.xhr&&"object"==typeof o.xhr.upload&&b.each(["progress","error","abort","timeout"],function(e){o.xhr.upload.addEventListener(e,function(t){a.emit(e,t)},!1)}),o.on("error",function(e){r.reject(e)});try{a._sendRequest(o,t)}catch(e){r.reject(e)}return r.promise},r.prototype._generateRequestId=function(){function e(){var e=(~~(65535*Math.random())).toString(16);return e.length<4&&(e+=new Array(4-e.length+1).join("0")),e}return h.format("%s%s-%s-%s-%s-%s%s%s",e(),e(),e(),e(),e(),e(),e(),e())},r.prototype._guessContentLength=function(e){if(null==e)return 0;if("string"==typeof e)return n.byteLength(e);if("object"==typeof e){if("undefined"!=typeof Blob&&e instanceof Blob)return e.size;if("undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer)return e.byteLength;if(n.isBuffer(e))return e.length}else if(n.isBuffer(e))return e.length;throw new Error("No Content-Length is specified.")},r.prototype._fixHeaders=function(e){var t={};return e&&Object.keys(e).forEach(function(n){var r=e[n].trim();r&&(n=n.toLowerCase(),"etag"===n&&(r=r.replace(/"/g,"")),t[n]=r)}),t},r.prototype._recvResponse=function(e){function t(e){var t=r["content-type"];return e.length?t&&/(application|text)\/json/.test(t)?JSON.parse(e.toString()):e:{}}var r=this._fixHeaders(e.headers),i=e.statusCode,a=m.defer(),o=[];return e.on("data",function(e){n.isBuffer(e)?o.push(e):o.push(new n(e))}),e.on("error",function(e){a.reject(e)}),e.on("end",function(){var e=n.concat(o),f=null;try{v("responseHeaders = %j",r),f=t(e)}catch(e){return v("statusCode = %s, Parse response body error = %s",i,e.message),void a.reject(c(i,e.message))}i>=100&&i<200?a.reject(c(i,"Can not handle 1xx http status code.")):(i<100||i>=300)&&(f.requestId?a.reject(c(i,f.message,f.code,f.requestId,r.date)):a.reject(c(i,f))),a.resolve(s(r,f))}),a.promise},r.prototype._sendRequest=function(e,t){if(!t)return void e.end();if("string"==typeof t&&(t=new n(t)),n.isBuffer(t)||o(t))e.write(t),e.end();else{if(!(t instanceof l.Readable))throw new Error("Invalid body type = "+typeof t);if(!t.readable)throw new Error("stream is not readable");t.on("data",function(t){e.write(t)}),t.on("end",function(){e.end()})}},r.prototype.buildQueryString=function(t){return e("querystring").stringify(t).replace(/[()'!~.*\-_]/g,function(e){return"%"+e.charCodeAt().toString(16)})},r.prototype._getRequestUrl=function(e,t){var n=e,r=this.buildQueryString(t);return r&&(n+="?"+r),this.config.endpoint+n},t.exports=r}).call(this,e("buffer").Buffer)},{"../package.json":208,"./auth":209,"./headers":221,buffer:56,debug:66,events:94,http:110,https:113,process:165,q:173,querystring:176,stream:200,underscore:202,url:203,util:206}],224:[function(e,t,n){function r(e){c.call(this,e,"iot",!0)}var i=e("util"),a=e("path"),o=e("underscore"),s=e("./strings"),c=e("./bce_base_client");i.inherits(r,c),r.prototype.getUsage=function(e){return e=e||{},this.sendRequest("GET","/v1/usage",{config:e.config})},r.prototype.getEndpointUsage=function(e,t){return t=t||{},this.sendRequest("GET","/v1/endpoint/"+e+"/usage",{config:t.config})},r.prototype.getEndpointUsageRange=function(e,t,n,r){r=r||{};var i=this._buildUrl("/v1/endpoint/",s.normalize(e||""),"/usage-query");return this.sendRequest("POST",i,{params:{start:t,end:n},config:r.config})},r.prototype.getClientOnline=function(e,t,n){n=n||{};var r=this._buildUrl("/v2/endpoint",s.normalize(e||""),"/client",s.normalize(t||"",!1),"/status/online");return this.sendRequest("GET",r,{config:n.config})},r.prototype.getClientOnlineBatch=function(e,t,n){n=n||{};var r=this._buildUrl("/v2/endpoint",s.normalize(e||""),"/batch-client-query/status");return this.sendRequest("POST",r,{body:JSON.stringify(t||[]),config:n.config})},r.prototype._buildUrl=function(){var e=o.toArray(arguments);return a.normalize(e.join("/")).replace(/\\/g,"/")},t.exports=r},{"./bce_base_client":211,"./strings":233,path:159,underscore:202,util:206}],225:[function(e,t,n){function r(e){c.call(this,e,"lss",!0),this._name=null}function i(e){c.call(this,e,"lss",!0),this._sessionId=null}function a(e){c.call(this,e,"lss",!0),this._name=null,this._endpoint=null}var o=e("util"),s=e("q"),c=e("./bce_base_client");o.inherits(r,c),r.prototype._buildUrl=function(e){return"/v3/live/preset"+(e?"/"+e:"")},r.prototype.setName=function(e){return this._name=e,this},r.prototype.create=function(e){var t=this,n=t._buildUrl(!1);return t.sendRequest("POST",n,{body:JSON.stringify(e)}).then(function(n){return t.setName(e.presetName),n})},r.prototype.remove=function(e){var t=this._buildUrl(e||this._name);return this.sendRequest("DELETE",t)},r.prototype.removeAll=function(){var e=this;return e.list().then(function(t){var n=t.body.presets.filter(function(e){return!/^(bce|lss)\./.test(e.presetName)}).map(function(t){return e.remove(t.presetName)});return s.all(n)})},r.prototype.get=function(e){var t=this._buildUrl(e||this._name);return this.sendRequest("GET",t)},r.prototype.list=function(){var e=this._buildUrl();return this.sendRequest("GET",e)},o.inherits(i,c),i.prototype._buildUrl=function(e){return"/v3/live/session"+(e?"/"+e:"")},i.prototype.setSessionId=function(e){return this._sessionId=e,this},i.prototype.create=function(e){var t=this,n=t._buildUrl(!1);return t.sendRequest("POST",n,{body:JSON.stringify(e)}).then(function(e){var n=e.body;return t.setSessionId(n.sessionId),e})},i.prototype.remove=function(e){var t=this._buildUrl(e||this._sessionId);return this.sendRequest("DELETE",t)},i.prototype.removeAll=function(){var e=this;return e.list().then(function(t){var n=t.body.liveInfos.map(function(t){return e.remove(t.sessionId)});return s.all(n)})},i.prototype.get=function(e){var t=this._buildUrl(e||this._sessionId);return this.sendRequest("GET",t)},i.prototype.list=function(){var e=this._buildUrl();return this.sendRequest("GET",e)},i.prototype.pause=function(e){var t=this._buildUrl(e||this._sessionId);return this.sendRequest("PUT",t,{params:{stop:""}})},i.prototype.resume=function(e){var t=this._buildUrl(e||this._sessionId);return this.sendRequest("PUT",t,{params:{resume:""}})},i.prototype.refresh=function(e){var t=this._buildUrl(e||this._sessionId);return this.sendRequest("PUT",t,{params:{refresh:""}})},o.inherits(a,c),a.prototype._buildUrl=function(e){return"/v3/live/notification"+(e?"/"+e:"")},a.prototype.create=function(e,t){var n=this._buildUrl(),r={name:e,endpoint:t},i=this;return this.sendRequest("POST",n,{body:JSON.stringify(r)}).then(function(n){return i._name=e,i._endpoint=t,n})},a.prototype.get=function(e){var t=e||this._name;if(!t)throw new TypeError("name is required");var n=this._buildUrl(t);return this.sendRequest("GET",n)},a.prototype.remove=function(e){var t=e||this._name;if(!t)throw new TypeError("name is required");var n=this._buildUrl(t);return this.sendRequest("DELETE",n)},a.prototype.removeAll=function(){var e=this;return e.list().then(function(t){var n=(t.body.notifications||[]).map(function(t){return e.remove(t.name)});return s.all(n)})},a.prototype.list=function(){var e=this._buildUrl();return this.sendRequest("GET",e)},n.Preset=r,n.Session=i,n.Notification=a},{"./bce_base_client":211,q:173,util:206}],226:[function(e,t,n){function r(e){d.call(this,e,"media",!0),this._id=null}function i(e){d.call(this,e,"media",!0)}function a(e){d.call(this,e,"media",!0),this._name=null}function o(e){d.call(this,e,"media",!0),this._name=null}function s(e){d.call(this,e,"media",!0),this._jobId=null}function c(e){d.call(this,e,"media",!0),this._jobId=null}var f=e("util"),u=e("q"),d=e("./bce_base_client");f.inherits(r,d),r.prototype._buildUrl=function(e){var t="/v3/watermark";if(!1===e)return t;var n=e||this._id;return t+(n?"/"+n:"")},r.prototype.setId=function(e){return this._id=e,this},r.prototype.create=function(e){var t=this,n=t._buildUrl(!1);return t.sendRequest("POST",n,{body:JSON.stringify(e)}).then(function(e){return t.setId(e.body.watermarkId),e})},r.prototype.remove=function(e){var t=this._buildUrl(e);return this.sendRequest("DELETE",t)},r.prototype.removeAll=function(){var e=this;return e.list().then(function(t){var n=t.body.watermarks.map(function(t){return e.remove(t.watermarkId)});return u.all(n)})},r.prototype.get=function(e){var t=this,n=t._buildUrl(e);return t.sendRequest("GET",n).then(function(e){return t.setId(e.body.watermarkId),e})},r.prototype.list=function(){var e=this._buildUrl(!1);return this.sendRequest("GET",e)},f.inherits(i,d),i.prototype.get=function(e,t){return this.sendRequest("GET","/v3/mediainfo",{params:{bucket:e,key:t}})},f.inherits(a,d),a.prototype.setName=function(e){return this._name=e,this},a.prototype._buildUrl=function(e){var t="/v3/pipeline";if(!1===e)return t;var n=e||this._name;return t+(n?"/"+n:"")},a.prototype.create=function(e){var t=this,n=t._buildUrl(!1);return t.sendRequest("POST",n,{body:JSON.stringify(e)}).then(function(n){return t.setName(e.pipelineName),n})},a.prototype.get=function(e){var t=this,n=t._buildUrl(e);return t.sendRequest("GET",n).then(function(e){return t.setName(e.body.pipelineName),e})},a.prototype.list=function(){var e=this._buildUrl(!1);return this.sendRequest("GET",e)},a.prototype.remove=function(e){var t=this._buildUrl(e);return this.sendRequest("DELETE",t)},a.prototype.removeAll=function(){var e=this;return e.list().then(function(t){var n=t.body.pipelines.filter(function(e){var t=e.jobStatus;return t.running+t.pending<=0}).map(function(t){return e.remove(t.pipelineName)});return u.all(n)})},a.prototype.addTranscodingJob=function(e){var t=e.pipelineName||this._name;if(!t)throw new Error("`pipelineName` is required.");e.pipelineName=t;var n=new c(this.config);return n.create(e).then(function(e){return n})},a.prototype.addThumbnailJob=function(e){var t=e.pipelineName||this._name;if(!t)throw new Error("`pipelineName` is required.");e.pipelineName=t;var n=new s(this.config);return n.create(e).then(function(e){return n})},a.prototype.getTranscodingJobs=function(e){var t=e||this._name;if(!t)throw new Error("`pipelineName` is required.");return new c(this.config).list(t)},a.prototype.getThumbnailJobs=function(e){var t=e||this._name;if(!t)throw new Error("`pipelineName` is required");return new s(this.config).list(t)},f.inherits(o,d),o.prototype._buildUrl=function(e){var t="/v3/preset";if(!1===e)return t;var n=e||this._name;return t+(n?"/"+n:"")},o.prototype.setName=function(e){return this._name=e,this},o.prototype.create=function(e){var t=this,n=this._buildUrl(!1);return this.sendRequest("POST",n,{body:JSON.stringify(e)}).then(function(n){return t.setName(e.presetName),n})},o.prototype.get=function(e){var t=this,n=t._buildUrl(e);return t.sendRequest("GET",n).then(function(e){return t.setName(e.body.presetName),e})},o.prototype.list=function(){var e=this._buildUrl(!1);return this.sendRequest("GET",e)},o.prototype.remove=function(e){var t=this._buildUrl(e);return this.sendRequest("DELETE",t)},o.prototype.removeAll=function(){var e=this;return e.list().then(function(t){var n=t.body.presets.filter(function(e){return!/^bce\./.test(e.presetName)}).map(function(t){return e.remove(t.presetName)});return u.all(n)})},f.inherits(s,d),s.prototype._buildUrl=function(){return"/v3/job/thumbnail"},s.prototype.create=function(e){var t=this,n=this._buildUrl();return this.sendRequest("POST",n,{body:JSON.stringify(e)}).then(function(e){return t._jobId=e.body.jobId,e})},s.prototype.get=function(e){var t=e||this._jobId;if(!t)throw new Error("`jobId` is required");var n=this,r=this._buildUrl()+"/"+t;return this.sendRequest("GET",r).then(function(e){return n._jobId=t,e})},s.prototype.list=function(e){var t=this._buildUrl();return this.sendRequest("GET",t,{params:{pipelineName:e}})},f.inherits(c,d),c.prototype._buildUrl=function(){return"/v3/job/transcoding"},c.prototype.create=function(e){var t=this,n=t._buildUrl();return t.sendRequest("POST",n,{body:JSON.stringify(e)}).then(function(e){return t._jobId=e.body.jobId,e})},c.prototype.get=function(e){var t=e||this._jobId;if(!t)throw new Error("`jobId` is required");var n=this,r=n._buildUrl()+"/"+t;return n.sendRequest("GET",r).then(function(e){return n._jobId=t,e})},c.prototype.list=function(e){var t=this._buildUrl();return this.sendRequest("GET",t,{params:{pipelineName:e}})},n.Watermark=r,n.MediaInfo=i,n.Transcoding=c,n.Thumbnail=s,n.Pipeline=a,n.Preset=o},{"./bce_base_client":211,q:173,util:206}],227:[function(e,t,n){function r(e){c.call(this,e,"media",!0)}var i=e("util"),a=e("underscore"),o=e("./auth"),s=e("./http_client"),c=e("./bce_base_client");i.inherits(r,c),r.prototype.createPipeline=function(e,t,n,r,i,a){var o=a||{},s=JSON.stringify({pipelineName:e,sourceBucket:t,targetBucket:n,config:r||{capacity:5},description:i||""});return this.sendRequest("POST","/v3/pipeline",{body:s,config:o.config})},r.prototype.getPipeline=function(e,t){var n="/v3/pipeline/"+e,r=t||{};return this.sendRequest("GET",n,{config:r.config})},r.prototype.deletePipeline=function(e,t){var n="/v3/pipeline/"+e,r=t||{};return this.sendRequest("DELETE",n,{config:r.config})},r.prototype.getAllPipelines=function(e){var t=e||{};return this.sendRequest("GET","/v3/pipeline",{config:t.config})},r.prototype.createJob=function(e,t,n,r,i){var a=i||{},o=JSON.stringify({pipelineName:e,source:t,target:n,presetName:r});return this.sendRequest("POST","/v3/job",{body:o,config:a.config})},r.prototype.getAllJobs=function(e,t){var n=t||{},r={pipelineName:e};return this.sendRequest("GET","/v3/job",{params:r,config:n.config})},r.prototype.getJob=function(e,t){var n="/v3/job/"+e,r=t||{};return this.sendRequest("GET",n,{config:r.config})},r.prototype.createPreset=function(e,t,n,r,i,a,o,s,c){var f=c||{},u={presetName:e,container:t};return n&&(u.clip=n),r&&(u.audio=r),i&&(u.video=i),a&&(u.encryption=a),null!=o&&(u.transmux=o),s&&(u.description=s),this.sendRequest("POST","/v3/preset",{body:JSON.stringify(u),config:f.config})},r.prototype.getPreset=function(e,t){var n="/v3/preset/"+e,r=t||{};return this.sendRequest("GET",n,{config:r.config})},r.prototype.deletePreset=function(e,t){var n="/v3/preset/"+e,r=t||{};return this.sendRequest("DELETE",n,{config:r.config})},r.prototype.getMediainfo=function(e,t,n){var r=n||{},i={bucket:e,key:t};return this.sendRequest("GET","/v3/mediainfo",{params:i,config:r.config})},r.prototype.getProgress=function(){return this.sendRequest("GET","/v3/statistic/job/realtime")},r.prototype.createSignature=function(e,t,n,r,i){var a=new o(e.ak,e.sk),s=["host"];return a.generateAuthorization(t,n,r,i,0,0,s)},r.prototype.sendRequest=function(e,t,n){var r={bucketName:null,key:null,body:null,headers:{},params:{},config:{},outputStream:null},i=a.extend(r,n),o=a.extend({},this.config,i.config),c=this,f=this._httpAgent=new s(o);return a.each(["progress","error","abort","timeout"],function(e){f.on(e,function(t){c.emit(e,t)})}),this._httpAgent.sendRequest(e,t,i.body,i.headers,i.params,a.bind(this.createSignature,this),i.outputStream)},t.exports=r},{"./auth":209,"./bce_base_client":211,"./http_client":223,underscore:202,util:206}],228:[function(e,t,n){var r={ez:"application/andrew-inset",aw:"application/applixware",atom:"application/atom+xml",atomcat:"application/atomcat+xml",atomsvc:"application/atomsvc+xml",ccxml:"application/ccxml+xml",cdmia:"application/cdmi-capability",cdmic:"application/cdmi-container",cdmid:"application/cdmi-domain",cdmio:"application/cdmi-object",cdmiq:"application/cdmi-queue",cu:"application/cu-seeme",davmount:"application/davmount+xml",dbk:"application/docbook+xml",dssc:"application/dssc+der",xdssc:"application/dssc+xml",ecma:"application/ecmascript",emma:"application/emma+xml",epub:"application/epub+zip",exi:"application/exi",pfr:"application/font-tdpfr",gml:"application/gml+xml",gpx:"application/gpx+xml",gxf:"application/gxf",stk:"application/hyperstudio",ink:"application/inkml+xml",inkml:"application/inkml+xml",ipfix:"application/ipfix",jar:"application/java-archive",ser:"application/java-serialized-object",class:"application/java-vm",js:"application/javascript",json:"application/json",jsonml:"application/jsonml+json",lostxml:"application/lost+xml",hqx:"application/mac-binhex40",cpt:"application/mac-compactpro",mads:"application/mads+xml",mrc:"application/marc",mrcx:"application/marcxml+xml",ma:"application/mathematica",nb:"application/mathematica",mb:"application/mathematica",mathml:"application/mathml+xml",mbox:"application/mbox",mscml:"application/mediaservercontrol+xml",metalink:"application/metalink+xml",meta4:"application/metalink4+xml",mets:"application/mets+xml",mods:"application/mods+xml",m21:"application/mp21",mp21:"application/mp21",mp4s:"application/mp4",doc:"application/msword",dot:"application/msword",mxf:"application/mxf",bin:"application/octet-stream",dms:"application/octet-stream",lrf:"application/octet-stream",mar:"application/octet-stream",so:"application/octet-stream",dist:"application/octet-stream",distz:"application/octet-stream",pkg:"application/octet-stream",bpk:"application/octet-stream",dump:"application/octet-stream",elc:"application/octet-stream",deploy:"application/octet-stream",oda:"application/oda",opf:"application/oebps-package+xml",ogx:"application/ogg",omdoc:"application/omdoc+xml",onetoc:"application/onenote",onetoc2:"application/onenote",onetmp:"application/onenote",onepkg:"application/onenote",oxps:"application/oxps",xer:"application/patch-ops-error+xml",pdf:"application/pdf",pgp:"application/pgp-encrypted",asc:"application/pgp-signature",sig:"application/pgp-signature",prf:"application/pics-rules",p10:"application/pkcs10",p7m:"application/pkcs7-mime",p7c:"application/pkcs7-mime",p7s:"application/pkcs7-signature",p8:"application/pkcs8",ac:"application/pkix-attr-cert",cer:"application/pkix-cert",crl:"application/pkix-crl",pkipath:"application/pkix-pkipath",pki:"application/pkixcmp",pls:"application/pls+xml",ai:"application/postscript",eps:"application/postscript",ps:"application/postscript",cww:"application/prs.cww",pskcxml:"application/pskc+xml",rdf:"application/rdf+xml",rif:"application/reginfo+xml",rnc:"application/relax-ng-compact-syntax",rl:"application/resource-lists+xml",rld:"application/resource-lists-diff+xml",rs:"application/rls-services+xml",gbr:"application/rpki-ghostbusters",mft:"application/rpki-manifest",roa:"application/rpki-roa",rsd:"application/rsd+xml",rss:"application/rss+xml",rtf:"application/rtf",sbml:"application/sbml+xml",scq:"application/scvp-cv-request",scs:"application/scvp-cv-response",spq:"application/scvp-vp-request",spp:"application/scvp-vp-response",sdp:"application/sdp",setpay:"application/set-payment-initiation",setreg:"application/set-registration-initiation",shf:"application/shf+xml",smi:"application/smil+xml",smil:"application/smil+xml",rq:"application/sparql-query",srx:"application/sparql-results+xml",gram:"application/srgs",grxml:"application/srgs+xml",sru:"application/sru+xml",ssdl:"application/ssdl+xml",ssml:"application/ssml+xml",tei:"application/tei+xml",teicorpus:"application/tei+xml",tfi:"application/thraud+xml",tsd:"application/timestamped-data",plb:"application/vnd.3gpp.pic-bw-large",psb:"application/vnd.3gpp.pic-bw-small",pvb:"application/vnd.3gpp.pic-bw-var",tcap:"application/vnd.3gpp2.tcap",pwn:"application/vnd.3m.post-it-notes",aso:"application/vnd.accpac.simply.aso",imp:"application/vnd.accpac.simply.imp",acu:"application/vnd.acucobol",atc:"application/vnd.acucorp",acutc:"application/vnd.acucorp",air:"application/vnd.adobe.air-application-installer-package+zip",fcdt:"application/vnd.adobe.formscentral.fcdt",fxp:"application/vnd.adobe.fxp",fxpl:"application/vnd.adobe.fxp",xdp:"application/vnd.adobe.xdp+xml",xfdf:"application/vnd.adobe.xfdf",ahead:"application/vnd.ahead.space",azf:"application/vnd.airzip.filesecure.azf",azs:"application/vnd.airzip.filesecure.azs",azw:"application/vnd.amazon.ebook",acc:"application/vnd.americandynamics.acc",ami:"application/vnd.amiga.ami",apk:"application/vnd.android.package-archive",cii:"application/vnd.anser-web-certificate-issue-initiation",fti:"application/vnd.anser-web-funds-transfer-initiation",atx:"application/vnd.antix.game-component",mpkg:"application/vnd.apple.installer+xml",m3u8:"application/vnd.apple.mpegurl",swi:"application/vnd.aristanetworks.swi",iota:"application/vnd.astraea-software.iota",aep:"application/vnd.audiograph",mpm:"application/vnd.blueice.multipass",bmi:"application/vnd.bmi",rep:"application/vnd.businessobjects",cdxml:"application/vnd.chemdraw+xml",mmd:"application/vnd.chipnuts.karaoke-mmd",cdy:"application/vnd.cinderella",cla:"application/vnd.claymore",rp9:"application/vnd.cloanto.rp9",c4g:"application/vnd.clonk.c4group",c4d:"application/vnd.clonk.c4group",c4f:"application/vnd.clonk.c4group",c4p:"application/vnd.clonk.c4group",c4u:"application/vnd.clonk.c4group",c11amc:"application/vnd.cluetrust.cartomobile-config",c11amz:"application/vnd.cluetrust.cartomobile-config-pkg",csp:"application/vnd.commonspace",cdbcmsg:"application/vnd.contact.cmsg",cmc:"application/vnd.cosmocaller",clkx:"application/vnd.crick.clicker",clkk:"application/vnd.crick.clicker.keyboard",clkp:"application/vnd.crick.clicker.palette",clkt:"application/vnd.crick.clicker.template",clkw:"application/vnd.crick.clicker.wordbank",wbs:"application/vnd.criticaltools.wbs+xml",pml:"application/vnd.ctc-posml",ppd:"application/vnd.cups-ppd",car:"application/vnd.curl.car",pcurl:"application/vnd.curl.pcurl",dart:"application/vnd.dart",rdz:"application/vnd.data-vision.rdz",uvf:"application/vnd.dece.data",uvvf:"application/vnd.dece.data",uvd:"application/vnd.dece.data",uvvd:"application/vnd.dece.data",uvt:"application/vnd.dece.ttml+xml",uvvt:"application/vnd.dece.ttml+xml",uvx:"application/vnd.dece.unspecified",uvvx:"application/vnd.dece.unspecified",uvz:"application/vnd.dece.zip",uvvz:"application/vnd.dece.zip",fe_launch:"application/vnd.denovo.fcselayout-link",dna:"application/vnd.dna",mlp:"application/vnd.dolby.mlp",dpg:"application/vnd.dpgraph",dfac:"application/vnd.dreamfactory",kpxx:"application/vnd.ds-keypoint",ait:"application/vnd.dvb.ait",svc:"application/vnd.dvb.service",geo:"application/vnd.dynageo",mag:"application/vnd.ecowin.chart",nml:"application/vnd.enliven",esf:"application/vnd.epson.esf",msf:"application/vnd.epson.msf",qam:"application/vnd.epson.quickanime",slt:"application/vnd.epson.salt",ssf:"application/vnd.epson.ssf",es3:"application/vnd.eszigno3+xml",et3:"application/vnd.eszigno3+xml",ez2:"application/vnd.ezpix-album",ez3:"application/vnd.ezpix-package",fdf:"application/vnd.fdf",mseed:"application/vnd.fdsn.mseed",seed:"application/vnd.fdsn.seed",dataless:"application/vnd.fdsn.seed",gph:"application/vnd.flographit",ftc:"application/vnd.fluxtime.clip",fm:"application/vnd.framemaker",frame:"application/vnd.framemaker",maker:"application/vnd.framemaker",book:"application/vnd.framemaker",fnc:"application/vnd.frogans.fnc",ltf:"application/vnd.frogans.ltf",fsc:"application/vnd.fsc.weblaunch",oas:"application/vnd.fujitsu.oasys",oa2:"application/vnd.fujitsu.oasys2",oa3:"application/vnd.fujitsu.oasys3",fg5:"application/vnd.fujitsu.oasysgp",bh2:"application/vnd.fujitsu.oasysprs",ddd:"application/vnd.fujixerox.ddd",xdw:"application/vnd.fujixerox.docuworks",xbd:"application/vnd.fujixerox.docuworks.binder",fzs:"application/vnd.fuzzysheet",txd:"application/vnd.genomatix.tuxedo",ggb:"application/vnd.geogebra.file",ggt:"application/vnd.geogebra.tool",gex:"application/vnd.geometry-explorer",gre:"application/vnd.geometry-explorer",gxt:"application/vnd.geonext",g2w:"application/vnd.geoplan",g3w:"application/vnd.geospace",gmx:"application/vnd.gmx",kml:"application/vnd.google-earth.kml+xml",kmz:"application/vnd.google-earth.kmz",gqf:"application/vnd.grafeq",gqs:"application/vnd.grafeq",gac:"application/vnd.groove-account",ghf:"application/vnd.groove-help",gim:"application/vnd.groove-identity-message",grv:"application/vnd.groove-injector",gtm:"application/vnd.groove-tool-message",tpl:"application/vnd.groove-tool-template",vcg:"application/vnd.groove-vcard",hal:"application/vnd.hal+xml",zmm:"application/vnd.handheld-entertainment+xml",hbci:"application/vnd.hbci",les:"application/vnd.hhe.lesson-player",hpgl:"application/vnd.hp-hpgl",hpid:"application/vnd.hp-hpid",hps:"application/vnd.hp-hps",jlt:"application/vnd.hp-jlyt",pcl:"application/vnd.hp-pcl",pclxl:"application/vnd.hp-pclxl","sfd-hdstx":"application/vnd.hydrostatix.sof-data",mpy:"application/vnd.ibm.minipay",afp:"application/vnd.ibm.modcap",listafp:"application/vnd.ibm.modcap",list3820:"application/vnd.ibm.modcap",irm:"application/vnd.ibm.rights-management",sc:"application/vnd.ibm.secure-container",icc:"application/vnd.iccprofile",icm:"application/vnd.iccprofile",igl:"application/vnd.igloader",ivp:"application/vnd.immervision-ivp",ivu:"application/vnd.immervision-ivu",igm:"application/vnd.insors.igm",xpw:"application/vnd.intercon.formnet",xpx:"application/vnd.intercon.formnet",i2g:"application/vnd.intergeo",qbo:"application/vnd.intu.qbo",qfx:"application/vnd.intu.qfx",rcprofile:"application/vnd.ipunplugged.rcprofile",irp:"application/vnd.irepository.package+xml",xpr:"application/vnd.is-xpr",fcs:"application/vnd.isac.fcs",jam:"application/vnd.jam",rms:"application/vnd.jcp.javame.midlet-rms",jisp:"application/vnd.jisp",joda:"application/vnd.joost.joda-archive",ktz:"application/vnd.kahootz",ktr:"application/vnd.kahootz",karbon:"application/vnd.kde.karbon",chrt:"application/vnd.kde.kchart",kfo:"application/vnd.kde.kformula",flw:"application/vnd.kde.kivio",kon:"application/vnd.kde.kontour",kpr:"application/vnd.kde.kpresenter",kpt:"application/vnd.kde.kpresenter",ksp:"application/vnd.kde.kspread",kwd:"application/vnd.kde.kword",kwt:"application/vnd.kde.kword",htke:"application/vnd.kenameaapp",kia:"application/vnd.kidspiration",kne:"application/vnd.kinar",knp:"application/vnd.kinar",skp:"application/vnd.koan",skd:"application/vnd.koan",skt:"application/vnd.koan",skm:"application/vnd.koan",sse:"application/vnd.kodak-descriptor",lasxml:"application/vnd.las.las+xml",lbd:"application/vnd.llamagraphics.life-balance.desktop",lbe:"application/vnd.llamagraphics.life-balance.exchange+xml",123:"application/vnd.lotus-1-2-3",apr:"application/vnd.lotus-approach",pre:"application/vnd.lotus-freelance",nsf:"application/vnd.lotus-notes",org:"application/vnd.lotus-organizer",scm:"application/vnd.lotus-screencam",lwp:"application/vnd.lotus-wordpro",portpkg:"application/vnd.macports.portpkg",mcd:"application/vnd.mcd",mc1:"application/vnd.medcalcdata",cdkey:"application/vnd.mediastation.cdkey",mwf:"application/vnd.mfer",mfm:"application/vnd.mfmp",flo:"application/vnd.micrografx.flo",igx:"application/vnd.micrografx.igx",mif:"application/vnd.mif",daf:"application/vnd.mobius.daf",dis:"application/vnd.mobius.dis",mbk:"application/vnd.mobius.mbk",mqy:"application/vnd.mobius.mqy",msl:"application/vnd.mobius.msl",plc:"application/vnd.mobius.plc",txf:"application/vnd.mobius.txf",mpn:"application/vnd.mophun.application",mpc:"application/vnd.mophun.certificate",xul:"application/vnd.mozilla.xul+xml",cil:"application/vnd.ms-artgalry",cab:"application/vnd.ms-cab-compressed",xls:"application/vnd.ms-excel",xlm:"application/vnd.ms-excel",xla:"application/vnd.ms-excel", xlc:"application/vnd.ms-excel",xlt:"application/vnd.ms-excel",xlw:"application/vnd.ms-excel",xlam:"application/vnd.ms-excel.addin.macroenabled.12",xlsb:"application/vnd.ms-excel.sheet.binary.macroenabled.12",xlsm:"application/vnd.ms-excel.sheet.macroenabled.12",xltm:"application/vnd.ms-excel.template.macroenabled.12",eot:"application/vnd.ms-fontobject",chm:"application/vnd.ms-htmlhelp",ims:"application/vnd.ms-ims",lrm:"application/vnd.ms-lrm",thmx:"application/vnd.ms-officetheme",cat:"application/vnd.ms-pki.seccat",stl:"application/vnd.ms-pki.stl",ppt:"application/vnd.ms-powerpoint",pps:"application/vnd.ms-powerpoint",pot:"application/vnd.ms-powerpoint",ppam:"application/vnd.ms-powerpoint.addin.macroenabled.12",pptm:"application/vnd.ms-powerpoint.presentation.macroenabled.12",sldm:"application/vnd.ms-powerpoint.slide.macroenabled.12",ppsm:"application/vnd.ms-powerpoint.slideshow.macroenabled.12",potm:"application/vnd.ms-powerpoint.template.macroenabled.12",mpp:"application/vnd.ms-project",mpt:"application/vnd.ms-project",docm:"application/vnd.ms-word.document.macroenabled.12",dotm:"application/vnd.ms-word.template.macroenabled.12",wps:"application/vnd.ms-works",wks:"application/vnd.ms-works",wcm:"application/vnd.ms-works",wdb:"application/vnd.ms-works",wpl:"application/vnd.ms-wpl",xps:"application/vnd.ms-xpsdocument",mseq:"application/vnd.mseq",mus:"application/vnd.musician",msty:"application/vnd.muvee.style",taglet:"application/vnd.mynfc",nlu:"application/vnd.neurolanguage.nlu",ntf:"application/vnd.nitf",nitf:"application/vnd.nitf",nnd:"application/vnd.noblenet-directory",nns:"application/vnd.noblenet-sealer",nnw:"application/vnd.noblenet-web",ngdat:"application/vnd.nokia.n-gage.data","n-gage":"application/vnd.nokia.n-gage.symbian.install",rpst:"application/vnd.nokia.radio-preset",rpss:"application/vnd.nokia.radio-presets",edm:"application/vnd.novadigm.edm",edx:"application/vnd.novadigm.edx",ext:"application/vnd.novadigm.ext",odc:"application/vnd.oasis.opendocument.chart",otc:"application/vnd.oasis.opendocument.chart-template",odb:"application/vnd.oasis.opendocument.database",odf:"application/vnd.oasis.opendocument.formula",odft:"application/vnd.oasis.opendocument.formula-template",odg:"application/vnd.oasis.opendocument.graphics",otg:"application/vnd.oasis.opendocument.graphics-template",odi:"application/vnd.oasis.opendocument.image",oti:"application/vnd.oasis.opendocument.image-template",odp:"application/vnd.oasis.opendocument.presentation",otp:"application/vnd.oasis.opendocument.presentation-template",ods:"application/vnd.oasis.opendocument.spreadsheet",ots:"application/vnd.oasis.opendocument.spreadsheet-template",odt:"application/vnd.oasis.opendocument.text",odm:"application/vnd.oasis.opendocument.text-master",ott:"application/vnd.oasis.opendocument.text-template",oth:"application/vnd.oasis.opendocument.text-web",xo:"application/vnd.olpc-sugar",dd2:"application/vnd.oma.dd2+xml",oxt:"application/vnd.openofficeorg.extension",pptx:"application/vnd.openxmlformats-officedocument.presentationml.presentation",sldx:"application/vnd.openxmlformats-officedocument.presentationml.slide",ppsx:"application/vnd.openxmlformats-officedocument.presentationml.slideshow",potx:"application/vnd.openxmlformats-officedocument.presentationml.template",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",xltx:"application/vnd.openxmlformats-officedocument.spreadsheetml.template",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",dotx:"application/vnd.openxmlformats-officedocument.wordprocessingml.template",mgp:"application/vnd.osgeo.mapguide.package",dp:"application/vnd.osgi.dp",esa:"application/vnd.osgi.subsystem",pdb:"application/vnd.palm",pqa:"application/vnd.palm",oprc:"application/vnd.palm",paw:"application/vnd.pawaafile",str:"application/vnd.pg.format",ei6:"application/vnd.pg.osasli",efif:"application/vnd.picsel",wg:"application/vnd.pmi.widget",plf:"application/vnd.pocketlearn",pbd:"application/vnd.powerbuilder6",box:"application/vnd.previewsystems.box",mgz:"application/vnd.proteus.magazine",qps:"application/vnd.publishare-delta-tree",ptid:"application/vnd.pvi.ptid1",qxd:"application/vnd.quark.quarkxpress",qxt:"application/vnd.quark.quarkxpress",qwd:"application/vnd.quark.quarkxpress",qwt:"application/vnd.quark.quarkxpress",qxl:"application/vnd.quark.quarkxpress",qxb:"application/vnd.quark.quarkxpress",bed:"application/vnd.realvnc.bed",mxl:"application/vnd.recordare.musicxml",musicxml:"application/vnd.recordare.musicxml+xml",cryptonote:"application/vnd.rig.cryptonote",cod:"application/vnd.rim.cod",rm:"application/vnd.rn-realmedia",rmvb:"application/vnd.rn-realmedia-vbr",link66:"application/vnd.route66.link66+xml",st:"application/vnd.sailingtracker.track",see:"application/vnd.seemail",sema:"application/vnd.sema",semd:"application/vnd.semd",semf:"application/vnd.semf",ifm:"application/vnd.shana.informed.formdata",itp:"application/vnd.shana.informed.formtemplate",iif:"application/vnd.shana.informed.interchange",ipk:"application/vnd.shana.informed.package",twd:"application/vnd.simtech-mindmapper",twds:"application/vnd.simtech-mindmapper",mmf:"application/vnd.smaf",teacher:"application/vnd.smart.teacher",sdkm:"application/vnd.solent.sdkm+xml",sdkd:"application/vnd.solent.sdkm+xml",dxp:"application/vnd.spotfire.dxp",sfs:"application/vnd.spotfire.sfs",sdc:"application/vnd.stardivision.calc",sda:"application/vnd.stardivision.draw",sdd:"application/vnd.stardivision.impress",smf:"application/vnd.stardivision.math",sdw:"application/vnd.stardivision.writer",vor:"application/vnd.stardivision.writer",sgl:"application/vnd.stardivision.writer-global",smzip:"application/vnd.stepmania.package",sm:"application/vnd.stepmania.stepchart",sxc:"application/vnd.sun.xml.calc",stc:"application/vnd.sun.xml.calc.template",sxd:"application/vnd.sun.xml.draw",std:"application/vnd.sun.xml.draw.template",sxi:"application/vnd.sun.xml.impress",sti:"application/vnd.sun.xml.impress.template",sxm:"application/vnd.sun.xml.math",sxw:"application/vnd.sun.xml.writer",sxg:"application/vnd.sun.xml.writer.global",stw:"application/vnd.sun.xml.writer.template",sus:"application/vnd.sus-calendar",susp:"application/vnd.sus-calendar",svd:"application/vnd.svd",sis:"application/vnd.symbian.install",sisx:"application/vnd.symbian.install",xsm:"application/vnd.syncml+xml",bdm:"application/vnd.syncml.dm+wbxml",xdm:"application/vnd.syncml.dm+xml",tao:"application/vnd.tao.intent-module-archive",pcap:"application/vnd.tcpdump.pcap",cap:"application/vnd.tcpdump.pcap",dmp:"application/vnd.tcpdump.pcap",tmo:"application/vnd.tmobile-livetv",tpt:"application/vnd.trid.tpt",mxs:"application/vnd.triscape.mxs",tra:"application/vnd.trueapp",ufd:"application/vnd.ufdl",ufdl:"application/vnd.ufdl",utz:"application/vnd.uiq.theme",umj:"application/vnd.umajin",unityweb:"application/vnd.unity",uoml:"application/vnd.uoml+xml",vcx:"application/vnd.vcx",vsd:"application/vnd.visio",vst:"application/vnd.visio",vss:"application/vnd.visio",vsw:"application/vnd.visio",vis:"application/vnd.visionary",vsf:"application/vnd.vsf",wbxml:"application/vnd.wap.wbxml",wmlc:"application/vnd.wap.wmlc",wmlsc:"application/vnd.wap.wmlscriptc",wtb:"application/vnd.webturbo",nbp:"application/vnd.wolfram.player",wpd:"application/vnd.wordperfect",wqd:"application/vnd.wqd",stf:"application/vnd.wt.stf",xar:"application/vnd.xara",xfdl:"application/vnd.xfdl",hvd:"application/vnd.yamaha.hv-dic",hvs:"application/vnd.yamaha.hv-script",hvp:"application/vnd.yamaha.hv-voice",osf:"application/vnd.yamaha.openscoreformat",osfpvg:"application/vnd.yamaha.openscoreformat.osfpvg+xml",saf:"application/vnd.yamaha.smaf-audio",spf:"application/vnd.yamaha.smaf-phrase",cmp:"application/vnd.yellowriver-custom-menu",zir:"application/vnd.zul",zirz:"application/vnd.zul",zaz:"application/vnd.zzazz.deck+xml",vxml:"application/voicexml+xml",wgt:"application/widget",hlp:"application/winhlp",wsdl:"application/wsdl+xml",wspolicy:"application/wspolicy+xml","7z":"application/x-7z-compressed",abw:"application/x-abiword",ace:"application/x-ace-compressed",dmg:"application/x-apple-diskimage",aab:"application/x-authorware-bin",x32:"application/x-authorware-bin",u32:"application/x-authorware-bin",vox:"application/x-authorware-bin",aam:"application/x-authorware-map",aas:"application/x-authorware-seg",bcpio:"application/x-bcpio",torrent:"application/x-bittorrent",blb:"application/x-blorb",blorb:"application/x-blorb",bz:"application/x-bzip",bz2:"application/x-bzip2",boz:"application/x-bzip2",cbr:"application/x-cbr",cba:"application/x-cbr",cbt:"application/x-cbr",cbz:"application/x-cbr",cb7:"application/x-cbr",vcd:"application/x-cdlink",cfs:"application/x-cfs-compressed",chat:"application/x-chat",pgn:"application/x-chess-pgn",nsc:"application/x-conference",cpio:"application/x-cpio",csh:"application/x-csh",deb:"application/x-debian-package",udeb:"application/x-debian-package",dgc:"application/x-dgc-compressed",dir:"application/x-director",dcr:"application/x-director",dxr:"application/x-director",cst:"application/x-director",cct:"application/x-director",cxt:"application/x-director",w3d:"application/x-director",fgd:"application/x-director",swa:"application/x-director",wad:"application/x-doom",ncx:"application/x-dtbncx+xml",dtb:"application/x-dtbook+xml",res:"application/x-dtbresource+xml",dvi:"application/x-dvi",evy:"application/x-envoy",eva:"application/x-eva",bdf:"application/x-font-bdf",gsf:"application/x-font-ghostscript",psf:"application/x-font-linux-psf",otf:"application/x-font-otf",pcf:"application/x-font-pcf",snf:"application/x-font-snf",ttf:"application/x-font-ttf",ttc:"application/x-font-ttf",pfa:"application/x-font-type1",pfb:"application/x-font-type1",pfm:"application/x-font-type1",afm:"application/x-font-type1",woff:"application/x-font-woff",arc:"application/x-freearc",spl:"application/x-futuresplash",gca:"application/x-gca-compressed",ulx:"application/x-glulx",gnumeric:"application/x-gnumeric",gramps:"application/x-gramps-xml",gtar:"application/x-gtar",tbz:"application/x-gtar",tgz:"application/x-gtar","tar.gz":"application/x-gtar",tbz2:"application/x-gtar","tar.bz2":"application/x-gtar",gz:"application/x-gzip",hdf:"application/x-hdf",install:"application/x-install-instructions",iso:"application/x-iso9660-image",jnlp:"application/x-java-jnlp-file",latex:"application/x-latex",lzh:"application/x-lzh-compressed",lha:"application/x-lzh-compressed",mie:"application/x-mie",prc:"application/x-mobipocket-ebook",mobi:"application/x-mobipocket-ebook",application:"application/x-ms-application",lnk:"application/x-ms-shortcut",wmd:"application/x-ms-wmd",xbap:"application/x-ms-xbap",mdb:"application/x-msaccess",obd:"application/x-msbinder",crd:"application/x-mscardfile",clp:"application/x-msclip",exe:"application/x-msdownload",dll:"application/x-msdownload",com:"application/x-msdownload",bat:"application/x-msdownload",msi:"application/x-msdownload",mvb:"application/x-msmediaview",m13:"application/x-msmediaview",m14:"application/x-msmediaview",wmf:"application/x-msmetafile",wmz:"application/x-msmetafile",emf:"application/x-msmetafile",emz:"application/x-msmetafile",mny:"application/x-msmoney",pub:"application/x-mspublisher",scd:"application/x-msschedule",trm:"application/x-msterminal",wri:"application/x-mswrite",nc:"application/x-netcdf",cdf:"application/x-netcdf",nzb:"application/x-nzb",p12:"application/x-pkcs12",pfx:"application/x-pkcs12",p7b:"application/x-pkcs7-certificates",spc:"application/x-pkcs7-certificates",p7r:"application/x-pkcs7-certreqresp",rar:"application/x-rar-compressed",ris:"application/x-research-info-systems",sh:"application/x-sh",shar:"application/x-shar",swf:"application/x-shockwave-flash",xap:"application/x-silverlight-app",sql:"application/x-sql",sit:"application/x-stuffit",sitx:"application/x-stuffitx",srt:"application/x-subrip",sv4cpio:"application/x-sv4cpio",sv4crc:"application/x-sv4crc",t3:"application/x-t3vm-image",gam:"application/x-tads",tar:"application/x-tar",tcl:"application/x-tcl",tex:"application/x-tex",tfm:"application/x-tex-tfm",texinfo:"application/x-texinfo",texi:"application/x-texinfo",obj:"application/x-tgif",ustar:"application/x-ustar",src:"application/x-wais-source",der:"application/x-x509-ca-cert",crt:"application/x-x509-ca-cert",fig:"application/x-xfig",xlf:"application/x-xliff+xml",xpi:"application/x-xpinstall",xz:"application/x-xz",z1:"application/x-zmachine",z2:"application/x-zmachine",z3:"application/x-zmachine",z4:"application/x-zmachine",z5:"application/x-zmachine",z6:"application/x-zmachine",z7:"application/x-zmachine",z8:"application/x-zmachine",xaml:"application/xaml+xml",xdf:"application/xcap-diff+xml",xenc:"application/xenc+xml",xhtml:"application/xhtml+xml",xht:"application/xhtml+xml",xml:"application/xml",xsl:"application/xml",dtd:"application/xml-dtd",xop:"application/xop+xml",xpl:"application/xproc+xml",xslt:"application/xslt+xml",xspf:"application/xspf+xml",mxml:"application/xv+xml",xhvml:"application/xv+xml",xvml:"application/xv+xml",xvm:"application/xv+xml",yang:"application/yang",yin:"application/yin+xml",zip:"application/zip",adp:"audio/adpcm",au:"audio/basic",snd:"audio/basic",mid:"audio/midi",midi:"audio/midi",kar:"audio/midi",rmi:"audio/midi",mp4a:"audio/mp4",mpga:"audio/mpeg",mp2:"audio/mpeg",mp2a:"audio/mpeg",mp3:"audio/mpeg",m2a:"audio/mpeg",m3a:"audio/mpeg",oga:"audio/ogg",ogg:"audio/ogg",spx:"audio/ogg",s3m:"audio/s3m",sil:"audio/silk",uva:"audio/vnd.dece.audio",uvva:"audio/vnd.dece.audio",eol:"audio/vnd.digital-winds",dra:"audio/vnd.dra",dts:"audio/vnd.dts",dtshd:"audio/vnd.dts.hd",lvp:"audio/vnd.lucent.voice",pya:"audio/vnd.ms-playready.media.pya",ecelp4800:"audio/vnd.nuera.ecelp4800",ecelp7470:"audio/vnd.nuera.ecelp7470",ecelp9600:"audio/vnd.nuera.ecelp9600",rip:"audio/vnd.rip",weba:"audio/webm",aac:"audio/x-aac",aif:"audio/x-aiff",aiff:"audio/x-aiff",aifc:"audio/x-aiff",caf:"audio/x-caf",flac:"audio/x-flac",mka:"audio/x-matroska",m3u:"audio/x-mpegurl",wax:"audio/x-ms-wax",wma:"audio/x-ms-wma",ram:"audio/x-pn-realaudio",ra:"audio/x-pn-realaudio",rmp:"audio/x-pn-realaudio-plugin",wav:"audio/x-wav",xm:"audio/xm",cdx:"chemical/x-cdx",cif:"chemical/x-cif",cmdf:"chemical/x-cmdf",cml:"chemical/x-cml",csml:"chemical/x-csml",xyz:"chemical/x-xyz",bmp:"image/bmp",cgm:"image/cgm",g3:"image/g3fax",gif:"image/gif",ief:"image/ief",jpeg:"image/jpeg",jpg:"image/jpeg",jpe:"image/jpeg",ktx:"image/ktx",png:"image/png",btif:"image/prs.btif",sgi:"image/sgi",svg:"image/svg+xml",svgz:"image/svg+xml",tiff:"image/tiff",tif:"image/tiff",psd:"image/vnd.adobe.photoshop",uvi:"image/vnd.dece.graphic",uvvi:"image/vnd.dece.graphic",uvg:"image/vnd.dece.graphic",uvvg:"image/vnd.dece.graphic",sub:"image/vnd.dvb.subtitle",djvu:"image/vnd.djvu",djv:"image/vnd.djvu",dwg:"image/vnd.dwg",dxf:"image/vnd.dxf",fbs:"image/vnd.fastbidsheet",fpx:"image/vnd.fpx",fst:"image/vnd.fst",mmr:"image/vnd.fujixerox.edmics-mmr",rlc:"image/vnd.fujixerox.edmics-rlc",mdi:"image/vnd.ms-modi",wdp:"image/vnd.ms-photo",npx:"image/vnd.net-fpx",wbmp:"image/vnd.wap.wbmp",xif:"image/vnd.xiff",webp:"image/webp","3ds":"image/x-3ds",ras:"image/x-cmu-raster",cmx:"image/x-cmx",fh:"image/x-freehand",fhc:"image/x-freehand",fh4:"image/x-freehand",fh5:"image/x-freehand",fh7:"image/x-freehand",ico:"image/x-icon",sid:"image/x-mrsid-image",pcx:"image/x-pcx",pic:"image/x-pict",pct:"image/x-pict",pnm:"image/x-portable-anymap",pbm:"image/x-portable-bitmap",pgm:"image/x-portable-graymap",ppm:"image/x-portable-pixmap",rgb:"image/x-rgb",tga:"image/x-tga",xbm:"image/x-xbitmap",xpm:"image/x-xpixmap",xwd:"image/x-xwindowdump",eml:"message/rfc822",mime:"message/rfc822",igs:"model/iges",iges:"model/iges",msh:"model/mesh",mesh:"model/mesh",silo:"model/mesh",dae:"model/vnd.collada+xml",dwf:"model/vnd.dwf",gdl:"model/vnd.gdl",gtw:"model/vnd.gtw",mts:"model/vnd.mts",vtu:"model/vnd.vtu",wrl:"model/vrml",vrml:"model/vrml",x3db:"model/x3d+binary",x3dbz:"model/x3d+binary",x3dv:"model/x3d+vrml",x3dvz:"model/x3d+vrml",x3d:"model/x3d+xml",x3dz:"model/x3d+xml",appcache:"text/cache-manifest",ics:"text/calendar",ifb:"text/calendar",css:"text/css",csv:"text/csv",html:"text/html",htm:"text/html",n3:"text/n3",txt:"text/plain",text:"text/plain",conf:"text/plain",def:"text/plain",list:"text/plain",log:"text/plain",in:"text/plain",dsc:"text/prs.lines.tag",rtx:"text/richtext",sgml:"text/sgml",sgm:"text/sgml",tsv:"text/tab-separated-values",t:"text/troff",tr:"text/troff",roff:"text/troff",man:"text/troff",me:"text/troff",ms:"text/troff",ttl:"text/turtle",uri:"text/uri-list",uris:"text/uri-list",urls:"text/uri-list",vcard:"text/vcard",curl:"text/vnd.curl",dcurl:"text/vnd.curl.dcurl",scurl:"text/vnd.curl.scurl",mcurl:"text/vnd.curl.mcurl",fly:"text/vnd.fly",flx:"text/vnd.fmi.flexstor",gv:"text/vnd.graphviz","3dml":"text/vnd.in3d.3dml",spot:"text/vnd.in3d.spot",jad:"text/vnd.sun.j2me.app-descriptor",wml:"text/vnd.wap.wml",wmls:"text/vnd.wap.wmlscript",s:"text/x-asm",asm:"text/x-asm",c:"text/x-c",cc:"text/x-c",cxx:"text/x-c",cpp:"text/x-c",h:"text/x-c",hh:"text/x-c",dic:"text/x-c",f:"text/x-fortran",for:"text/x-fortran",f77:"text/x-fortran",f90:"text/x-fortran",java:"text/x-java-source",opml:"text/x-opml",p:"text/x-pascal",pas:"text/x-pascal",nfo:"text/x-nfo",etx:"text/x-setext",sfv:"text/x-sfv",uu:"text/x-uuencode",vcs:"text/x-vcalendar",vcf:"text/x-vcard","3gp":"video/3gpp","3g2":"video/3gpp2",h261:"video/h261",h263:"video/h263",h264:"video/h264",jpgv:"video/jpeg",jpm:"video/jpm",jpgm:"video/jpm",mj2:"video/mj2",mjp2:"video/mj2",mp4:"video/mp4",mp4v:"video/mp4",mpg4:"video/mp4",mpeg:"video/mpeg",mpg:"video/mpeg",mpe:"video/mpeg",m1v:"video/mpeg",m2v:"video/mpeg",ogv:"video/ogg",qt:"video/quicktime",mov:"video/quicktime",uvh:"video/vnd.dece.hd",uvvh:"video/vnd.dece.hd",uvm:"video/vnd.dece.mobile",uvvm:"video/vnd.dece.mobile",uvp:"video/vnd.dece.pd",uvvp:"video/vnd.dece.pd",uvs:"video/vnd.dece.sd",uvvs:"video/vnd.dece.sd",uvv:"video/vnd.dece.video",uvvv:"video/vnd.dece.video",dvb:"video/vnd.dvb.file",fvt:"video/vnd.fvt",mxu:"video/vnd.mpegurl",m4u:"video/vnd.mpegurl",pyv:"video/vnd.ms-playready.media.pyv",uvu:"video/vnd.uvvu.mp4",uvvu:"video/vnd.uvvu.mp4",viv:"video/vnd.vivo",webm:"video/webm",f4v:"video/x-f4v",fli:"video/x-fli",flv:"video/x-flv",m4v:"video/x-m4v",mkv:"video/x-matroska",mk3d:"video/x-matroska",mks:"video/x-matroska",mng:"video/x-mng",asf:"video/x-ms-asf",asx:"video/x-ms-asf",vob:"video/x-ms-vob",wm:"video/x-ms-wm",wmv:"video/x-ms-wmv",wmx:"video/x-ms-wmx",wvx:"video/x-ms-wvx",avi:"video/x-msvideo",movie:"video/x-sgi-movie",smv:"video/x-smv",ice:"x-conference/x-cooltalk"};n.guess=function(e){return e&&e.length?("."===e[0]&&(e=e.substr(1)),r[e.toLowerCase()]||"application/octet-stream"):"application/octet-stream"}},{}],229:[function(e,t,n){(function(n){function r(e){this._boundary=e,this._parts=[]}var i=e("util"),a=e("underscore");r.prototype.addPart=function(e,t){var r=[],o=i.format('--%s\r\nContent-Disposition: form-data; name="%s"%s\r\n\r\n',this._boundary,e,"");if(r.push(new n(o)),n.isBuffer(t))r.push(t),r.push(new n("\r\n"));else{if(!a.isString(t))throw new Error("Invalid data type.");r.push(new n(t+"\r\n"))}this._parts.push(n.concat(r))},r.prototype.encode=function(){return n.concat([n.concat(this._parts),new n(i.format("--%s--",this._boundary))])},t.exports=r}).call(this,e("buffer").Buffer)},{buffer:56,underscore:202,util:206}],230:[function(e,t,n){(function(n){function r(e){o.call(this,e,"face",!0)}var i=e("util"),a=e("debug")("bce-sdk:OCRClient"),o=e("./bce_base_client");i.inherits(r,o),r.prototype._apiCall=function(e,t,r,i){a("url = %j, data = %j, language = %j, options = %j",e,t,r,i),i=i||{};var o={};return o=n.isBuffer(t)?{base64:t.toString("base64")}:{bosPath:t},r&&(o.language=r),this.sendRequest("POST",e,{body:JSON.stringify(o),config:i.config})},r.prototype.allText=function(e,t,n){return this._apiCall("/v1/recognize/text",e,t,n)},r.prototype.oneLine=function(e,t,n){return this._apiCall("/v1/recognize/line",e,t,n)},r.prototype.singleCharacter=function(e,t,n){return this._apiCall("/v1/recognize/character",e,t,n)},t.exports=r}).call(this,{isBuffer:e("../node_modules/is-buffer/index.js")})},{"../node_modules/is-buffer/index.js":136,"./bce_base_client":211,debug:66,util:206}],231:[function(e,t,n){function r(e,t,n){s.call(this,e,"qns",!0),this._account=t,this._name=n}function i(e,t,n){s.call(this,e,"qns",!0),this._account=t,this._name=n}var a=e("util"),o=e("underscore"),s=e("./bce_base_client");a.inherits(r,s),r.prototype._buildUrl=function(){return"/v1/"+this._account+"/topic/"+this._name},r.prototype.create=function(e){e=e||{};var t=o.pick(e,"delayInSeconds","maximumMessageSizeInBytes","messageRetentionPeriodInSeconds");return this.sendRequest("PUT",this._buildUrl(),{body:JSON.stringify(t)})},r.prototype.remove=function(){return this.sendRequest("DELETE",this._buildUrl())},r.prototype.get=function(){return this.sendRequest("GET",this._buildUrl())},r.prototype.update=function(e){e=e||{};var t=o.pick(e,"delayInSeconds","maximumMessageSizeInBytes","messageRetentionPeriodInSeconds");return this.sendRequest("PUT",this._buildUrl(),{headers:{"If-Match":"*"},body:JSON.stringify(t)})},r.prototype.sendMessages=function(e){var t=this._buildUrl()+"/message";return e=o.map(e,function(e){return o.isString(e)?{messageBody:e}:e}),this.sendRequest("POST",t,{body:JSON.stringify({messages:e})})},r.prototype.list=function(e){e=e||{};var t=o.pick(e,"marker","maxRecords"),n="/v1/"+this._account+"/topic";return this.sendRequest("GET",n,{params:t})},r.prototype.createSubscription=function(e,t){t=t||{};var n=new i(this.config,this._account,e);return null==t.topic&&(t.topic=this._name),n.create(t)},a.inherits(i,s),i.prototype._buildUrl=function(){return"/v1/"+this._account+"/subscription/"+this._name},i.prototype.create=function(e){e=e||{};var t=o.pick(e,"receiveMessageWaitTimeInSeconds","topic","visibilityTimeoutInSeconds","pushConfig");return this.sendRequest("PUT",this._buildUrl(),{body:JSON.stringify(t)})},i.prototype.remove=function(){return this.sendRequest("DELETE",this._buildUrl())},i.prototype.get=function(){return this.sendRequest("GET",this._buildUrl())},i.prototype.update=function(e){e=e||{};var t=o.pick(e,"receiveMessageWaitTimeInSeconds","visibilityTimeoutInSeconds");return this.sendRequest("PUT",this._buildUrl(),{headers:{"If-Match":"*"},body:JSON.stringify(t)})},i.prototype.receiveMessages=function(e){e=e||{};var t=o.pick(e,"waitInSeconds","maxMessages","peek"),n=this._buildUrl()+"/message";return this.sendRequest("GET",n,{body:JSON.stringify(t)})},i.prototype.deleteMessage=function(e){var t=this._buildUrl()+"/message";return this.sendRequest("DELETE",t,{params:{receiptHandle:e}})},i.prototype.changeVisibility=function(e,t){var n=this._buildUrl()+"/message";return this.sendRequest("PUT",n,{params:{receiptHandle:e,visibilityTimeoutInSeconds:t}})},i.prototype.list=function(e){e=e||{};var t=o.pick(e,"marker","maxRecords"),n="/v1/"+this._account+"/subscription";return this.sendRequest("GET",n,{params:t})},n.Topic=r,n.Subscription=i},{"./bce_base_client":211,underscore:202,util:206}],232:[function(e,t,n){function r(e){s.call(this,e,"ses",!0)}var i=e("fs"),a=e("path"),o=e("util"),s=e("./bce_base_client");o.inherits(r,s),r.prototype.addVerifiedEmail=function(e){var t="/v1/verifiedEmail/"+encodeURIComponent(e);return this.sendRequest("PUT",t)},r.prototype.getAllVerifiedEmails=function(){return this.sendRequest("GET","/v1/verifiedEmail")},r.prototype.getVerifiedEmail=function(e){var t="/v1/verifiedEmail/"+encodeURIComponent(e);return this.sendRequest("GET",t)},r.prototype.deleteVerifiedEmail=function(e){var t="/v1/verifiedEmail/"+encodeURIComponent(e);return this.sendRequest("DELETE",t)},r.prototype.getQuota=function(){return this.sendRequest("GET","/v1/quota")},r.prototype.setQuota=function(e){return Object.keys(e).forEach(function(t){var n=e[t];e[t]=n.toString()}),this.sendRequest("PUT","/v1/quota",{body:JSON.stringify(e)})},r.prototype.sendMail=function(e){var t={from:"",name:""};"string"==typeof e.from?(t.from=e.from,t.name=-1!==e.from.indexOf("@")?e.from.split("@")[0]:""):e.from&&e.from.addr&&(t.from=e.from.addr,t.name=e.from.name?e.from.name:-1!==e.from.addr.indexOf("@")?e.from.addr.split("@")[0]:"");var n=e.to||[];"string"==typeof n&&(n=[n]);var r=e.cc||[];"string"==typeof r&&(r=[r]);var o=e.bcc||[];"string"==typeof o&&(o=[o]);var s=e.subject,c=e.text||"",f=e.html||"",u=e.attachments||[];u=u.map(function(e){return"string"==typeof e?{file_name:a.basename(e),file_data:{data:i.readFileSync(e).toString("base64")}}:e});var d=JSON.stringify({mail:{source:t,destination:{to_addr:n.map(function(e){return{addr:e}}),cc_addr:r.map(function(e){return{addr:e}}),bcc_addr:o.map(function(e){return{addr:e}})},subject:{charset:1,data:s},priority:1,message:{text:{charset:1,data:c},html:{charset:1,data:f}},attachments:u}});return this.sendRequest("POST","/v1/email",{body:d})},t.exports=r},{"./bce_base_client":211,fs:25,path:159,util:206}],233:[function(e,t,n){var r={"!":"%21","'":"%27","(":"%28",")":"%29","*":"%2A"};n.normalize=function(e,t){var n=encodeURIComponent(e);return n=n.replace(/[!'\(\)\*]/g,function(e){return r[e]}),!1===t&&(n=n.replace(/%2F/gi,"/")),n},n.trim=function(e){return(e||"").replace(/^\s+|\s+$/g,"")}},{}],234:[function(e,t,n){function r(e){o.call(this,e,"sts",!0)}var i=e("util"),a=e("underscore"),o=e("./bce_base_client");i.inherits(r,o),r.prototype.getSessionToken=function(e,t,n){n=n||{};var r="";t&&(t=a.pick(t,"id","accessControlList"),t.accessControlList&&(t.accessControlList=a.map(t.accessControlList,function(e){return a.pick(e,"eid","service","region","effect","resource","permission")})),r=JSON.stringify(t));return this.sendRequest("POST","/v1/sessionToken",{config:n.config,params:{durationSeconds:e},body:r})},t.exports=r},{"./bce_base_client":211,underscore:202,util:206}],235:[function(e,t,n){function r(e){s.call(this,e,"tsdb",!0),this._httpAgent=null}var i=e("util"),a=e("underscore"),o=e("./http_client"),s=e("./bce_base_client");i.inherits(r,s),r.prototype.createDatabase=function(e,t,n,r,i,a,o,s){s=s||{};var c={clientToken:e};return this.sendRequest("POST","/v1/database",{params:c,body:JSON.stringify({databaseName:t,ingestDataPointsMonthly:n,storeBytesQuota:o,purchaseLength:r,couponName:a,description:i}),headers:s.headers,config:s.config})},r.prototype.deleteDatabase=function(e,t){t=t||{};var n="/v1/database/"+e,r={databaseId:e,query:""};return this.sendRequest("DELETE",n,{params:r,headers:t.headers,config:t.config})},r.prototype.getDatabaseInfo=function(e,t){t=t||{};var n="/v1/database/"+e,r={databaseId:e,query:""};return this.sendRequest("GET",n,{params:r,headers:t.headers,config:t.config})},r.prototype.listDatabase=function(e){e=e||{};var t={query:""};return this.sendRequest("GET","/v1/database",{params:t,headers:e.headers,config:e.config})},r.prototype.sendRequest=function(e,t,n){var r={metricName:null,database:null,key:null,body:null,headers:{},params:{},config:{},outputStream:null},i=a.extend(r,n),s=a.extend({},this.config,i.config),c=this,f=this._httpAgent=new o(s),u={httpMethod:e,resource:t,args:i,config:s};return a.each(["progress","error","abort","timeout"],function(e){f.on(e,function(t){c.emit(e,t,u)})}),this._httpAgent.sendRequest(e,t,i.body,i.headers,i.params,a.bind(this.createSignature,this),i.outputStream)},t.exports=r},{"./bce_base_client":211,"./http_client":223,underscore:202,util:206}],236:[function(e,t,n){function r(e){d.call(this,e,"tsdb",!0),this._httpAgent=null}var i=e("util"),a=e("underscore"),o=e("querystring"),s=e("zlib"),c=e("./headers"),f=e("./auth.js"),u=e("./http_client"),d=e("./bce_base_client");i.inherits(r,d),r.prototype.writeDatapoints=function(e,t,n){n=n||{};var r={query:""},i=JSON.stringify({datapoints:e});return 0!=t&&(i=s.gzipSync(i),n.headers=n.headers||{},n.headers[c.CONTENT_ENCODING]="gzip"),this.sendRequest("POST","/v1/datapoint",{body:i,params:r,headers:n.headers,config:n.config})},r.prototype.getMetrics=function(e){e=e||{};var t={query:""};return this.sendRequest("GET","/v1/metric",{params:t,headers:e.headers,config:e.config})},r.prototype.getTags=function(e,t){t=t||{};var n="/v1/metric/"+e+"/tag",r={metricName:e,query:""};return this.sendRequest("GET",n,{params:r,headers:t.headers,config:t.config})},r.prototype.getFields=function(e,t){t=t||{};var n="/v1/metric/"+e+"/field",r={metricName:e,query:""};return this.sendRequest("GET",n,{params:r,headers:t.headers,config:t.config})},r.prototype.getDatapoints=function(e,t){t=t||{};var n=a.extend({query:"",disablePresampling:!1},a.pick(t,"disablePresampling"));return this.sendRequest("PUT","/v1/datapoint",{body:JSON.stringify({queries:e}),params:n,headers:t.headers,config:t.config})},r.prototype.getRowsWithSql=function(e,t){t=t||{};var n=a.extend({sql:e});return this.sendRequest("GET","/v1/row",{params:n,headers:t.headers,config:t.config})},r.prototype.generatePresignedUrl=function(t,n,r,s,c,u,d){d=a.extend({},this.config,d),c=a.extend({query:JSON.stringify({queries:t}),disablePresampling:!1},a.pick(c,"disablePresampling")),s=s||{},s.Host=e("url").parse(d.endpoint).host;var h=d.credentials,l=new f(h.ak,h.sk),p=l.generateAuthorization("GET","/v1/datapoint",c,s,n,r,u);return c.authorization=p,i.format("%s%s?%s",d.endpoint,"/v1/datapoint",o.encode(c))},r.prototype.generatePresignedUrlWithSql=function(t,n,r,s,c,u,d){d=a.extend({},this.config,d),c=a.extend({sql:t}),s=s||{},s.Host=e("url").parse(d.endpoint).host;var h=d.credentials,l=new f(h.ak,h.sk),p=l.generateAuthorization("GET","/v1/row",c,s,n,r,u);return c.authorization=p,i.format("%s%s?%s",d.endpoint,"/v1/row",o.encode(c))},r.prototype.createSignature=function(e,t,n,r,i){var a=new f(e.ak,e.sk),o=["host"];return a.generateAuthorization(t,n,r,i,0,0,o)},r.prototype.sendRequest=function(e,t,n){var r={metricName:null,key:null,body:null,headers:{"Content-Type":"application/json; charset=UTF-8"},params:{},config:{},outputStream:null},i=a.extend(r,n),o=a.extend({},this.config,i.config),s=this,c=this._httpAgent=new u(o),f={httpMethod:e,resource:t,args:i,config:o};return a.each(["progress","error","abort","timeout"],function(e){c.on(e,function(t){s.emit(e,t,f)})}),this._httpAgent.sendRequest(e,t,i.body,i.headers,i.params,a.bind(this.createSignature,this),i.outputStream)},t.exports=r},{"./auth.js":209,"./bce_base_client":211,"./headers":221,"./http_client":223,querystring:176,underscore:202,url:203,util:206,zlib:54}],237:[function(e,t,n){function r(e){s.call(this,e,"vod",!1),this._mediaId=null,this._sourceBucket=null,this._sourceKey=null,this._host=null}var i=e("util"),a=e("underscore"),o=e("debug")("bce-sdk:VodClient.Media"),s=e("../bce_base_client"),c=e("../helper"),f=e("./Statistic");i.inherits(r,s),r.prototype.setMediaId=function(e){return this._mediaId=e,this},r.prototype._buildUrl=function(){var e="/v1/media",t=a.toArray(arguments);return t.length&&(e+="/"+t.join("/")),e},r.prototype.apply=function(e){var t=this._buildUrl(),n={params:{apply:"",mode:e}},r=this;return this.sendRequest("POST",t,n).then(function(e){return r._mediaId=e.body.mediaId,r._sourceBucket=e.body.sourceBucket,r._sourceKey=e.body.sourceKey,r._host=e.body.host,e})},r.prototype.process=function(e,t){var n=this._buildUrl(this._mediaId),r=a.extend({title:e,description:null,sourceExtension:null,transcodingPresetGroupName:null},t);return r=a.pick(r,c.omitNull),this.sendRequest("POST",n,{params:{process:""},body:JSON.stringify(r)})},r.prototype.disable=function(e){var t=this._buildUrl(e||this._mediaId);return this.sendRequest("PUT",t,{params:{disable:""}})},r.prototype.resume=function(e){var t=this._buildUrl(e||this._mediaId);return this.sendRequest("PUT",t,{params:{publish:""}})},r.prototype.remove=function(e){var t=this._buildUrl(e||this._mediaId);return this.sendRequest("DELETE",t)},r.prototype.get=function(e){var t=this._buildUrl(e||this._mediaId);return o("url = %j",t),this.sendRequest("GET",t)},r.prototype.getPartInfo=function(e,t,n){var r=this._buildUrl(e||this._mediaId);return o("url = %j",r), this.sendRequest("GET",r,{params:{scope:t,taskId:n}})},r.prototype.getDownloadUrl=function(e,t){var n=t||86400,r=this._buildUrl(e||this._mediaId);return this.sendRequest("GET",r,{params:{sourcedownload:"",expiredInSeconds:n}})},r.prototype.update=function(e,t){var n=this._buildUrl(this._mediaId),r=a.pick({title:e,description:t},a.identity);return this.sendRequest("PUT",n,{params:{attributes:""},body:JSON.stringify(r)})},r.prototype.stat=function(e){return new f(this.config).setMediaId(this._mediaId).stat(e)},r.prototype.list=function(e){var t=this._buildUrl(),n=a.extend({pageSize:10,pageNo:null,marker:null,maxSize:null,status:null,begin:null,end:null,title:null},e);return n=a.pick(n,c.omitNull),null!=n.marker?(delete n.pageNo,delete n.pageSize):n.pageSize&&(delete n.marker,delete n.maxSize),o("list params = %j",n),this.sendRequest("GET",t,{params:n})},t.exports=r},{"../bce_base_client":211,"../helper":222,"./Statistic":241,debug:66,underscore:202,util:206}],238:[function(e,t,n){function r(e){o.call(this,e,"vod",!1)}var i=e("util"),a=e("underscore"),o=e("../bce_base_client");i.inherits(r,o),r.prototype._buildUrl=function(){var e="/v1/notification",t=a.toArray(arguments);return t.length&&(e+="/"+t.join("/")),e},r.prototype.create=function(e,t){var n=this._buildUrl(),r={name:e,endpoint:t};return this.sendRequest("POST",n,{body:JSON.stringify(r)})},r.prototype.get=function(e){var t=this._buildUrl(e);return this.sendRequest("GET",t)},r.prototype.listAll=function(){var e=this._buildUrl();return this.sendRequest("GET",e)},r.prototype.remove=function(e){var t=this._buildUrl(e);return this.sendRequest("DELETE",t)},t.exports=r},{"../bce_base_client":211,underscore:202,util:206}],239:[function(e,t,n){(function(n){function r(e){o.call(this,e,"vod",!1),this._mediaId=null}var i=e("util"),a=e("underscore"),o=e("../bce_base_client"),s=e("../helper");i.inherits(r,o),r.prototype.setMediaId=function(e){return this._mediaId=e,this},r.prototype._buildUrl=function(){var e="/v1/media",t=a.toArray(arguments);return t.length&&(e+="/"+t.join("/")),e},r.prototype.delivery=function(e){var t=this._buildUrl(this._mediaId,"delivery"),n=a.pick({transcodingPresetName:e},a.identity);return this.sendRequest("GET",t,{params:n}).then(function(e){return!0===e.body.success&&(e.body=e.body.result),e})},r.prototype.code=function(e){var t=this._buildUrl(this._mediaId,"code"),r=a.extend({width:100,height:100,autostart:!0,ak:null,transcodingPresetName:null},e);return r=a.pick(r,s.omitNull),this.sendRequest("GET",t,{params:r}).then(function(e){for(var t=e.body.codes,r=0;r