@iotize/device-client.js
Version:
IoTize Device client for Javascript
8 lines • 366 kB
JavaScript
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("rxjs"),require("rxjs/operators")):"function"==typeof define&&define.amd?define(["rxjs","rxjs/operators"],e):"object"==typeof exports?exports.IoTizeDeviceClient=e(require("rxjs"),require("rxjs/operators")):t.IoTizeDeviceClient=e(t.rxjs,t.rxjs.operators)}(window,(function(t,e){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=80)}([function(t,e,r){var n;t.exports=(n=n||function(t,e){var r=Object.create||function(){function t(){}return function(e){var r;return t.prototype=e,r=new t,t.prototype=null,r}}(),n={},o=n.lib={},i=o.Base={extend:function(t){var e=r(this);return t&&e.mixIn(t),e.hasOwnProperty("init")&&this.init!==e.init||(e.init=function(){e.$super.init.apply(this,arguments)}),e.init.prototype=e,e.$super=this,e},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}},a=o.WordArray=i.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=null!=e?e:4*t.length},toString:function(t){return(t||u).stringify(this)},concat:function(t){var e=this.words,r=t.words,n=this.sigBytes,o=t.sigBytes;if(this.clamp(),n%4)for(var i=0;i<o;i++){var a=r[i>>>2]>>>24-i%4*8&255;e[n+i>>>2]|=a<<24-(n+i)%4*8}else for(i=0;i<o;i+=4)e[n+i>>>2]=r[i>>>2];return this.sigBytes+=o,this},clamp:function(){var e=this.words,r=this.sigBytes;e[r>>>2]&=4294967295<<32-r%4*8,e.length=t.ceil(r/4)},clone:function(){var t=i.clone.call(this);return t.words=this.words.slice(0),t},random:function(e){for(var r,n=[],o=function(e){e=e;var r=987654321,n=4294967295;return function(){var o=((r=36969*(65535&r)+(r>>16)&n)<<16)+(e=18e3*(65535&e)+(e>>16)&n)&n;return o/=4294967296,(o+=.5)*(t.random()>.5?1:-1)}},i=0;i<e;i+=4){var s=o(4294967296*(r||t.random()));r=987654071*s(),n.push(4294967296*s()|0)}return new a.init(n,e)}}),s=n.enc={},u=s.Hex={stringify:function(t){for(var e=t.words,r=t.sigBytes,n=[],o=0;o<r;o++){var i=e[o>>>2]>>>24-o%4*8&255;n.push((i>>>4).toString(16)),n.push((15&i).toString(16))}return n.join("")},parse:function(t){for(var e=t.length,r=[],n=0;n<e;n+=2)r[n>>>3]|=parseInt(t.substr(n,2),16)<<24-n%8*4;return new a.init(r,e/2)}},c=s.Latin1={stringify:function(t){for(var e=t.words,r=t.sigBytes,n=[],o=0;o<r;o++){var i=e[o>>>2]>>>24-o%4*8&255;n.push(String.fromCharCode(i))}return n.join("")},parse:function(t){for(var e=t.length,r=[],n=0;n<e;n++)r[n>>>2]|=(255&t.charCodeAt(n))<<24-n%4*8;return new a.init(r,e)}},p=s.Utf8={stringify:function(t){try{return decodeURIComponent(escape(c.stringify(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(t){return c.parse(unescape(encodeURIComponent(t)))}},l=o.BufferedBlockAlgorithm=i.extend({reset:function(){this._data=new a.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=p.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(e){var r=this._data,n=r.words,o=r.sigBytes,i=this.blockSize,s=o/(4*i),u=(s=e?t.ceil(s):t.max((0|s)-this._minBufferSize,0))*i,c=t.min(4*u,o);if(u){for(var p=0;p<u;p+=i)this._doProcessBlock(n,p);var l=n.splice(0,u);r.sigBytes-=c}return new a.init(l,c)},clone:function(){var t=i.clone.call(this);return t._data=this._data.clone(),t},_minBufferSize:0}),f=(o.Hasher=l.extend({cfg:i.extend(),init:function(t){this.cfg=this.cfg.extend(t),this.reset()},reset:function(){l.reset.call(this),this._doReset()},update:function(t){return this._append(t),this._process(),this},finalize:function(t){return t&&this._append(t),this._doFinalize()},blockSize:16,_createHelper:function(t){return function(e,r){return new t.init(r).finalize(e)}},_createHmacHelper:function(t){return function(e,r){return new f.HMAC.init(t,r).finalize(e)}}}),n.algo={});return n}(Math),n)},function(t,e,r){"use strict";var n=this&&this.__assign||Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t};Object.defineProperty(e,"__esModule",{value:!0});var o="@iotize:device-client.js",i=r(85);e.lazyDebug=function(t,e){i(o+":"+t)(e())},e.default=function(t){var e=n({},console);return e.debug=i(o+":"+t),e}},function(t,e,r){var n;t.exports=(n=r(0),r(8),void(n.lib.Cipher||function(t){var e=n,r=e.lib,o=r.Base,i=r.WordArray,a=r.BufferedBlockAlgorithm,s=e.enc,u=(s.Utf8,s.Base64),c=e.algo.EvpKDF,p=r.Cipher=a.extend({cfg:o.extend(),createEncryptor:function(t,e){return this.create(this._ENC_XFORM_MODE,t,e)},createDecryptor:function(t,e){return this.create(this._DEC_XFORM_MODE,t,e)},init:function(t,e,r){this.cfg=this.cfg.extend(r),this._xformMode=t,this._key=e,this.reset()},reset:function(){a.reset.call(this),this._doReset()},process:function(t){return this._append(t),this._process()},finalize:function(t){return t&&this._append(t),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function t(t){return"string"==typeof t?_:g}return function(e){return{encrypt:function(r,n,o){return t(n).encrypt(e,r,n,o)},decrypt:function(r,n,o){return t(n).decrypt(e,r,n,o)}}}}()}),l=(r.StreamCipher=p.extend({_doFinalize:function(){return this._process(!0)},blockSize:1}),e.mode={}),f=r.BlockCipherMode=o.extend({createEncryptor:function(t,e){return this.Encryptor.create(t,e)},createDecryptor:function(t,e){return this.Decryptor.create(t,e)},init:function(t,e){this._cipher=t,this._iv=e}}),h=l.CBC=function(){var e=f.extend();function r(e,r,n){var o=this._iv;if(o){var i=o;this._iv=t}else i=this._prevBlock;for(var a=0;a<n;a++)e[r+a]^=i[a]}return e.Encryptor=e.extend({processBlock:function(t,e){var n=this._cipher,o=n.blockSize;r.call(this,t,e,o),n.encryptBlock(t,e),this._prevBlock=t.slice(e,e+o)}}),e.Decryptor=e.extend({processBlock:function(t,e){var n=this._cipher,o=n.blockSize,i=t.slice(e,e+o);n.decryptBlock(t,e),r.call(this,t,e,o),this._prevBlock=i}}),e}(),d=(e.pad={}).Pkcs7={pad:function(t,e){for(var r=4*e,n=r-t.sigBytes%r,o=n<<24|n<<16|n<<8|n,a=[],s=0;s<n;s+=4)a.push(o);var u=i.create(a,n);t.concat(u)},unpad:function(t){var e=255&t.words[t.sigBytes-1>>>2];t.sigBytes-=e}},y=(r.BlockCipher=p.extend({cfg:p.cfg.extend({mode:h,padding:d}),reset:function(){p.reset.call(this);var t=this.cfg,e=t.iv,r=t.mode;if(this._xformMode==this._ENC_XFORM_MODE)var n=r.createEncryptor;else n=r.createDecryptor,this._minBufferSize=1;this._mode&&this._mode.__creator==n?this._mode.init(this,e&&e.words):(this._mode=n.call(r,this,e&&e.words),this._mode.__creator=n)},_doProcessBlock:function(t,e){this._mode.processBlock(t,e)},_doFinalize:function(){var t=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){t.pad(this._data,this.blockSize);var e=this._process(!0)}else e=this._process(!0),t.unpad(e);return e},blockSize:4}),r.CipherParams=o.extend({init:function(t){this.mixIn(t)},toString:function(t){return(t||this.formatter).stringify(this)}})),v=(e.format={}).OpenSSL={stringify:function(t){var e=t.ciphertext,r=t.salt;if(r)var n=i.create([1398893684,1701076831]).concat(r).concat(e);else n=e;return n.toString(u)},parse:function(t){var e=u.parse(t),r=e.words;if(1398893684==r[0]&&1701076831==r[1]){var n=i.create(r.slice(2,4));r.splice(0,4),e.sigBytes-=16}return y.create({ciphertext:e,salt:n})}},g=r.SerializableCipher=o.extend({cfg:o.extend({format:v}),encrypt:function(t,e,r,n){n=this.cfg.extend(n);var o=t.createEncryptor(r,n),i=o.finalize(e),a=o.cfg;return y.create({ciphertext:i,key:r,iv:a.iv,algorithm:t,mode:a.mode,padding:a.padding,blockSize:t.blockSize,formatter:n.format})},decrypt:function(t,e,r,n){return n=this.cfg.extend(n),e=this._parse(e,n.format),t.createDecryptor(r,n).finalize(e.ciphertext)},_parse:function(t,e){return"string"==typeof t?e.parse(t,this):t}}),m=(e.kdf={}).OpenSSL={execute:function(t,e,r,n){n||(n=i.random(8));var o=c.create({keySize:e+r}).compute(t,n),a=i.create(o.words.slice(e),4*r);return o.sigBytes=4*e,y.create({key:o,iv:a,salt:n})}},_=r.PasswordBasedCipher=g.extend({cfg:g.cfg.extend({kdf:m}),encrypt:function(t,e,r,n){var o=(n=this.cfg.extend(n)).kdf.execute(r,t.keySize,t.ivSize);n.iv=o.iv;var i=g.encrypt.call(this,t,e,o.key,n);return i.mixIn(o),i},decrypt:function(t,e,r,n){n=this.cfg.extend(n),e=this._parse(e,n.format);var o=n.kdf.execute(r,t.keySize,t.ivSize,e.salt);return n.iv=o.iv,g.decrypt.call(this,t,e,o.key,n)}})}()))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(42);e.APDU=n;var o=r(14);e.FormatHelper=o.FormatHelper;var i=r(47);e.Crypto=i},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(168),o=r(13),i=r(7),a=r(1),s=r(6),u=a.default("TapApi"),c=function(){function t(t,e){this.client=t,this.config=e}return t.prototype._call=function(t){return this._callObservable(t).pipe(o.first()).toPromise()},t.prototype._callObservable=function(t){var e=this._convertToCommandArgs(t),r="CALL: "+t.methodType+" "+t.path+" body="+(t.body instanceof Uint8Array?s.FormatHelper.toHexString(t.body):JSON.stringify(t.body))+" ("+e[0].toString()+")";return this.client.command(e[0],e[1]).pipe(o.tap((function(t){u.debug(r+" => "+t.toString())}),(function(t){u.debug(r+" => "+t.message)})))},t.prototype._convertToCommandArgs=function(e){return t.callToCommandArgs(e,this.config)},t.callToCommandArgs=function(e,r){var o=e.path,a=r?r.resolvePath(o):e.path,s=r?r.getRoute(e.methodType,o):void 0;if("string"==typeof e.bodyEncoder){if(!r)throw new Error("Api config should be pass when using a reference to a body encoder");e.bodyEncoder=r.getBodyConverter(e.bodyEncoder)}r&&s&&s.bodyEncoder&&(e.bodyEncoder=r.getBodyConverter(s.bodyEncoder));var u,c=e.returnTypeConverter||(s?s.returnTypeConverter:void 0);u="string"==typeof c?r.getBodyConverter(c):c;var p=n.PathParameter.fillAllParams(a,e.pathParameters||{}),l=t.encodeBody(e),f=e.methodType.toUpperCase();if(!(f in i.ApiRequest))throw new Error('Missing method "'+f+'"');return[i.ApiRequest[f](p,l),u]},t.encodeBody=function(t){if(void 0===t.body)return new Uint8Array(0);if(t.body instanceof Uint8Array)return t.body;var e=t.bodyEncoder;if(!e)throw new Error('No valid converter for body type "'+(t&&t.body&&t.body.constructor&&t.body.constructor.name?t.body.constructor.name:typeof t.body)+'" (path '+t.path+")");if("function"==typeof e)return e(t.body);if("function"==typeof e.encode)return e.encode(t.body);throw new Error("Illegal argument for encoder: "+e+" (type "+typeof e+")")},t}();e.AbstractService=c},function(e,r){e.exports=t},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(){}return t.toByteBuffer=function(t){for(var e=new Uint8Array(t.length),r=0,n=t.length;r<n;r++)e[r]=t.charCodeAt(r);return e},t.toHexString=function(t){return t?Array.prototype.map.call(t,(function(t){return("00"+t.toString(16)).slice(-2)})).join("").toUpperCase():""},t.toBinaryString=function(t){return Array.prototype.map.call(t,(function(t){for(var e="",r=7;r>=0;r--)e+=(1<<r&t)>0?"1":"0";return e})).join("")},t.hexStringToBuffer=function(t){for(var e=new Uint8Array(Math.ceil(t.length/2)),r=0;r<e.length;r++)e[r]=parseInt(t.substr(2*r,2),16);return e},t.toAsciiString=function(t){return String.fromCharCode.apply(null,Array.from(t))},t.toUnsignedInt=function(t,e,r){void 0===e&&(e=4),void 0===r&&(r=!0);var n=0;r&&(t=t.reverse());for(var o=0;o<t.length&&o<e;o++)n=(n<<8)+(255&t[o]);return n},t}();e.FormatHelper=n},function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(41)),n(r(61)),n(r(52)),n(r(60)),n(r(140)),n(r(141));var o=r(31);e.ResponseImpl=o.Response},function(t,e,r){var n,o,i,a,s,u,c,p;t.exports=(p=r(0),r(29),r(30),o=(n=p).lib,i=o.Base,a=o.WordArray,s=n.algo,u=s.MD5,c=s.EvpKDF=i.extend({cfg:i.extend({keySize:4,hasher:u,iterations:1}),init:function(t){this.cfg=this.cfg.extend(t)},compute:function(t,e){for(var r=this.cfg,n=r.hasher.create(),o=a.create(),i=o.words,s=r.keySize,u=r.iterations;i.length<s;){c&&n.update(c);var c=n.update(t).finalize(e);n.reset();for(var p=1;p<u;p++)c=n.finalize(c),n.reset();o.concat(c)}return o.sigBytes=4*s,o}}),n.EvpKDF=function(t,e,r){return c.create(r).compute(t,e)},p.EvpKDF)},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}(r(54)),r(58)},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(16),o=function(){function t(t){this.options=t}return t.uint8Instance=function(e){return void 0===e&&(e=!1),t.uint8(e)},t.uint8=function(e){return void 0===e&&(e=!1),new t({signed:!1,sizeOf:8,leastSignificantBitFirst:e})},t.uint16Instance=function(e){return void 0===e&&(e=!1),t.uint16(e)},t.uint16=function(e){return void 0===e&&(e=!1),new t({signed:!1,sizeOf:16,leastSignificantBitFirst:e})},t.uint32Instance=function(e){return void 0===e&&(e=!1),t.uint32(e)},t.uint32=function(e){return void 0===e&&(e=!1),new t({signed:!1,sizeOf:32,leastSignificantBitFirst:e})},t.int8Instance=function(e){return void 0===e&&(e=!1),t.int8(e)},t.int8=function(e){return void 0===e&&(e=!1),new t({signed:!0,sizeOf:8,leastSignificantBitFirst:e})},t.int16Instance=function(e){return void 0===e&&(e=!1),t.int16(e)},t.int16=function(e){return void 0===e&&(e=!1),new t({signed:!0,sizeOf:16,leastSignificantBitFirst:e})},t.int32Instance=function(e){return void 0===e&&(e=!1),t.int32(e)},t.int32=function(e){return void 0===e&&(e=!1),new t({signed:!0,sizeOf:32,leastSignificantBitFirst:e})},t.prototype.decode=function(e){if(8*e.length<this.options.sizeOf)throw n.ConverterError.unexpectedBufferSize(this.options.sizeOf/8,e);return t.fromBytes(e,this.options.sizeOf/8,this.options.signed,this.options.leastSignificantBitFirst)},t.prototype.encode=function(t){for(var e=new Uint8Array(this.options.sizeOf>>3),r=0;r<e.length;r++){var n=8*(e.length-r-1);e[r]=t>>n&255}return this.options.leastSignificantBitFirst&&e.reverse(),e},t.toOpaqueMsb=function(t,e){if(8==e)return new Uint8Array([255&t]);if(16==e)return new Uint8Array([t>>8&255,255&t]);if(32==e)return new Uint8Array([t>>24&255,t>>16&255,t>>8&255,255&t]);throw new Error("Invalid size "+e+". Must be 8, 16 or 32")},t.fromOpaqueMsb=function(t,e){if(e||(e=8*t.length),8==e)return 255&t[0];if(16==e)return(255&t[1])+((255&t[0])<<8);if(32==e)return(255&t[3])+((255&t[2])<<8)+((255&t[1])<<16)+((255&t[0])<<24);throw new Error("Invalid size "+e+". Must be 8, 16 or 32")},t.fromBytes=function(t,e,r,n){n&&(t=t.reverse());for(var o,i=0,a=0,s=0;s<e;s++){if(o=8*(e-s-1),a>(i+=(255&t[s])<<o>>>0)&&!r)throw new Error("Overflow. Last value: "+a+" but new is "+i);a=i}return r&&128==(128&t[0])&&(i=-(Math.pow(2,8*e)-i)),i},t}();e.NumberConverter=o},function(t,e,r){var n,o,i;t.exports=(i=r(0),o=(n=i).lib.WordArray,n.enc.Base64={stringify:function(t){var e=t.words,r=t.sigBytes,n=this._map;t.clamp();for(var o=[],i=0;i<r;i+=3)for(var a=(e[i>>>2]>>>24-i%4*8&255)<<16|(e[i+1>>>2]>>>24-(i+1)%4*8&255)<<8|e[i+2>>>2]>>>24-(i+2)%4*8&255,s=0;s<4&&i+.75*s<r;s++)o.push(n.charAt(a>>>6*(3-s)&63));var u=n.charAt(64);if(u)for(;o.length%4;)o.push(u);return o.join("")},parse:function(t){var e=t.length,r=this._map,n=this._reverseMap;if(!n){n=this._reverseMap=[];for(var i=0;i<r.length;i++)n[r.charCodeAt(i)]=i}var a=r.charAt(64);if(a){var s=t.indexOf(a);-1!==s&&(e=s)}return function(t,e,r){for(var n=[],i=0,a=0;a<e;a++)if(a%4){var s=r[t.charCodeAt(a-1)]<<a%4*2,u=r[t.charCodeAt(a)]>>>6-a%4*2;n[i>>>2]|=(s|u)<<24-i%4*8,i++}return o.create(n,i)}(t,e,n)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},i.enc.Base64)},function(t,e,r){var n;t.exports=(n=r(0),function(t){var e=n,r=e.lib,o=r.WordArray,i=r.Hasher,a=e.algo,s=[];!function(){for(var e=0;e<64;e++)s[e]=4294967296*t.abs(t.sin(e+1))|0}();var u=a.MD5=i.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(t,e){for(var r=0;r<16;r++){var n=e+r,o=t[n];t[n]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8)}var i=this._hash.words,a=t[e+0],u=t[e+1],h=t[e+2],d=t[e+3],y=t[e+4],v=t[e+5],g=t[e+6],m=t[e+7],_=t[e+8],C=t[e+9],b=t[e+10],w=t[e+11],T=t[e+12],S=t[e+13],P=t[e+14],E=t[e+15],I=i[0],B=i[1],A=i[2],O=i[3];I=c(I,B,A,O,a,7,s[0]),O=c(O,I,B,A,u,12,s[1]),A=c(A,O,I,B,h,17,s[2]),B=c(B,A,O,I,d,22,s[3]),I=c(I,B,A,O,y,7,s[4]),O=c(O,I,B,A,v,12,s[5]),A=c(A,O,I,B,g,17,s[6]),B=c(B,A,O,I,m,22,s[7]),I=c(I,B,A,O,_,7,s[8]),O=c(O,I,B,A,C,12,s[9]),A=c(A,O,I,B,b,17,s[10]),B=c(B,A,O,I,w,22,s[11]),I=c(I,B,A,O,T,7,s[12]),O=c(O,I,B,A,S,12,s[13]),A=c(A,O,I,B,P,17,s[14]),I=p(I,B=c(B,A,O,I,E,22,s[15]),A,O,u,5,s[16]),O=p(O,I,B,A,g,9,s[17]),A=p(A,O,I,B,w,14,s[18]),B=p(B,A,O,I,a,20,s[19]),I=p(I,B,A,O,v,5,s[20]),O=p(O,I,B,A,b,9,s[21]),A=p(A,O,I,B,E,14,s[22]),B=p(B,A,O,I,y,20,s[23]),I=p(I,B,A,O,C,5,s[24]),O=p(O,I,B,A,P,9,s[25]),A=p(A,O,I,B,d,14,s[26]),B=p(B,A,O,I,_,20,s[27]),I=p(I,B,A,O,S,5,s[28]),O=p(O,I,B,A,h,9,s[29]),A=p(A,O,I,B,m,14,s[30]),I=l(I,B=p(B,A,O,I,T,20,s[31]),A,O,v,4,s[32]),O=l(O,I,B,A,_,11,s[33]),A=l(A,O,I,B,w,16,s[34]),B=l(B,A,O,I,P,23,s[35]),I=l(I,B,A,O,u,4,s[36]),O=l(O,I,B,A,y,11,s[37]),A=l(A,O,I,B,m,16,s[38]),B=l(B,A,O,I,b,23,s[39]),I=l(I,B,A,O,S,4,s[40]),O=l(O,I,B,A,a,11,s[41]),A=l(A,O,I,B,d,16,s[42]),B=l(B,A,O,I,g,23,s[43]),I=l(I,B,A,O,C,4,s[44]),O=l(O,I,B,A,T,11,s[45]),A=l(A,O,I,B,E,16,s[46]),I=f(I,B=l(B,A,O,I,h,23,s[47]),A,O,a,6,s[48]),O=f(O,I,B,A,m,10,s[49]),A=f(A,O,I,B,P,15,s[50]),B=f(B,A,O,I,v,21,s[51]),I=f(I,B,A,O,T,6,s[52]),O=f(O,I,B,A,d,10,s[53]),A=f(A,O,I,B,b,15,s[54]),B=f(B,A,O,I,u,21,s[55]),I=f(I,B,A,O,_,6,s[56]),O=f(O,I,B,A,E,10,s[57]),A=f(A,O,I,B,g,15,s[58]),B=f(B,A,O,I,S,21,s[59]),I=f(I,B,A,O,y,6,s[60]),O=f(O,I,B,A,w,10,s[61]),A=f(A,O,I,B,h,15,s[62]),B=f(B,A,O,I,C,21,s[63]),i[0]=i[0]+I|0,i[1]=i[1]+B|0,i[2]=i[2]+A|0,i[3]=i[3]+O|0},_doFinalize:function(){var e=this._data,r=e.words,n=8*this._nDataBytes,o=8*e.sigBytes;r[o>>>5]|=128<<24-o%32;var i=t.floor(n/4294967296),a=n;r[15+(o+64>>>9<<4)]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),r[14+(o+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),e.sigBytes=4*(r.length+1),this._process();for(var s=this._hash,u=s.words,c=0;c<4;c++){var p=u[c];u[c]=16711935&(p<<8|p>>>24)|4278255360&(p<<24|p>>>8)}return s},clone:function(){var t=i.clone.call(this);return t._hash=this._hash.clone(),t}});function c(t,e,r,n,o,i,a){var s=t+(e&r|~e&n)+o+a;return(s<<i|s>>>32-i)+e}function p(t,e,r,n,o,i,a){var s=t+(e&n|r&~n)+o+a;return(s<<i|s>>>32-i)+e}function l(t,e,r,n,o,i,a){var s=t+(e^r^n)+o+a;return(s<<i|s>>>32-i)+e}function f(t,e,r,n,o,i,a){var s=t+(r^(e|~n))+o+a;return(s<<i|s>>>32-i)+e}e.MD5=i._createHelper(u),e.HmacMD5=i._createHmacHelper(u)}(Math),n.MD5)},function(t,r){t.exports=e},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}(r(6))},function(t,e,r){"use strict";(function(t){
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
* @license MIT
*/
var n=r(132),o=r(133),i=r(134);function a(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(t,e){if(a()<e)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=u.prototype:(null===t&&(t=new u(e)),t.length=e),t}function u(t,e,r){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(t,e,r);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return l(this,t)}return c(this,t,e,r)}function c(t,e,r,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");e=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n);u.TYPED_ARRAY_SUPPORT?(t=e).__proto__=u.prototype:t=f(t,e);return t}(t,e,r,n):"string"==typeof e?function(t,e,r){"string"==typeof r&&""!==r||(r="utf8");if(!u.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|d(e,r),o=(t=s(t,n)).write(e,r);o!==n&&(t=t.slice(0,o));return t}(t,e,r):function(t,e){if(u.isBuffer(e)){var r=0|h(e.length);return 0===(t=s(t,r)).length?t:(e.copy(t,0,0,r),t)}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(n=e.length)!=n?s(t,0):f(t,e);if("Buffer"===e.type&&i(e.data))return f(t,e.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function p(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function l(t,e){if(p(e),t=s(t,e<0?0:0|h(e)),!u.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function f(t,e){var r=e.length<0?0:0|h(e.length);t=s(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[n];return t}function h(t){if(t>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|t}function d(t,e){if(u.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return H(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return V(t).length;default:if(n)return H(t).length;e=(""+e).toLowerCase(),n=!0}}function y(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return O(this,e,r);case"utf8":case"utf-8":return E(this,e,r);case"ascii":return B(this,e,r);case"latin1":case"binary":return A(this,e,r);case"base64":return P(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function v(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function g(t,e,r,n,o){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=o?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(o)return-1;r=t.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof e&&(e=u.from(e,n)),u.isBuffer(e))return 0===e.length?-1:m(t,e,r,n,o);if("number"==typeof e)return e&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):m(t,[e],r,n,o);throw new TypeError("val must be string, number or Buffer")}function m(t,e,r,n,o){var i,a=1,s=t.length,u=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;a=2,s/=2,u/=2,r/=2}function c(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(o){var p=-1;for(i=r;i<s;i++)if(c(t,i)===c(e,-1===p?0:i-p)){if(-1===p&&(p=i),i-p+1===u)return p*a}else-1!==p&&(i-=i-p),p=-1}else for(r+u>s&&(r=s-u),i=r;i>=0;i--){for(var l=!0,f=0;f<u;f++)if(c(t,i+f)!==c(e,f)){l=!1;break}if(l)return i}return-1}function _(t,e,r,n){r=Number(r)||0;var o=t.length-r;n?(n=Number(n))>o&&(n=o):n=o;var i=e.length;if(i%2!=0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var a=0;a<n;++a){var s=parseInt(e.substr(2*a,2),16);if(isNaN(s))return a;t[r+a]=s}return a}function C(t,e,r,n){return z(H(e,t.length-r),t,r,n)}function b(t,e,r,n){return z(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function w(t,e,r,n){return b(t,e,r,n)}function T(t,e,r,n){return z(V(e),t,r,n)}function S(t,e,r,n){return z(function(t,e){for(var r,n,o,i=[],a=0;a<t.length&&!((e-=2)<0);++a)r=t.charCodeAt(a),n=r>>8,o=r%256,i.push(o),i.push(n);return i}(e,t.length-r),t,r,n)}function P(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function E(t,e,r){r=Math.min(t.length,r);for(var n=[],o=e;o<r;){var i,a,s,u,c=t[o],p=null,l=c>239?4:c>223?3:c>191?2:1;if(o+l<=r)switch(l){case 1:c<128&&(p=c);break;case 2:128==(192&(i=t[o+1]))&&(u=(31&c)<<6|63&i)>127&&(p=u);break;case 3:i=t[o+1],a=t[o+2],128==(192&i)&&128==(192&a)&&(u=(15&c)<<12|(63&i)<<6|63&a)>2047&&(u<55296||u>57343)&&(p=u);break;case 4:i=t[o+1],a=t[o+2],s=t[o+3],128==(192&i)&&128==(192&a)&&128==(192&s)&&(u=(15&c)<<18|(63&i)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(p=u)}null===p?(p=65533,l=1):p>65535&&(p-=65536,n.push(p>>>10&1023|55296),p=56320|1023&p),n.push(p),o+=l}return function(t){var e=t.length;if(e<=I)return String.fromCharCode.apply(String,t);var r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=I));return r}(n)}e.Buffer=u,e.SlowBuffer=function(t){+t!=t&&(t=0);return u.alloc(+t)},e.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=a(),u.poolSize=8192,u._augment=function(t){return t.__proto__=u.prototype,t},u.from=function(t,e,r){return c(null,t,e,r)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(t,e,r){return function(t,e,r,n){return p(e),e<=0?s(t,e):void 0!==r?"string"==typeof n?s(t,e).fill(r,n):s(t,e).fill(r):s(t,e)}(null,t,e,r)},u.allocUnsafe=function(t){return l(null,t)},u.allocUnsafeSlow=function(t){return l(null,t)},u.isBuffer=function(t){return!(null==t||!t._isBuffer)},u.compare=function(t,e){if(!u.isBuffer(t)||!u.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,o=0,i=Math.min(r,n);o<i;++o)if(t[o]!==e[o]){r=t[o],n=e[o];break}return r<n?-1:n<r?1:0},u.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(t,e){if(!i(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return u.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=u.allocUnsafe(e),o=0;for(r=0;r<t.length;++r){var a=t[r];if(!u.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(n,o),o+=a.length}return n},u.byteLength=d,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)v(this,e,e+1);return this},u.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)v(this,e,e+3),v(this,e+1,e+2);return this},u.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)v(this,e,e+7),v(this,e+1,e+6),v(this,e+2,e+5),v(this,e+3,e+4);return this},u.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?E(this,0,t):y.apply(this,arguments)},u.prototype.equals=function(t){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===u.compare(this,t)},u.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),"<Buffer "+t+">"},u.prototype.compare=function(t,e,r,n,o){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),e<0||r>t.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&e>=r)return 0;if(n>=o)return-1;if(e>=r)return 1;if(this===t)return 0;for(var i=(o>>>=0)-(n>>>=0),a=(r>>>=0)-(e>>>=0),s=Math.min(i,a),c=this.slice(n,o),p=t.slice(e,r),l=0;l<s;++l)if(c[l]!==p[l]){i=c[l],a=p[l];break}return i<a?-1:a<i?1:0},u.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},u.prototype.indexOf=function(t,e,r){return g(this,t,e,r,!0)},u.prototype.lastIndexOf=function(t,e,r){return g(this,t,e,r,!1)},u.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var o=this.length-e;if((void 0===r||r>o)&&(r=o),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return _(this,t,e,r);case"utf8":case"utf-8":return C(this,t,e,r);case"ascii":return b(this,t,e,r);case"latin1":case"binary":return w(this,t,e,r);case"base64":return T(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,t,e,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var I=4096;function B(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(127&t[o]);return n}function A(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(t[o]);return n}function O(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var o="",i=e;i<r;++i)o+=j(t[i]);return o}function R(t,e,r){for(var n=t.slice(e,r),o="",i=0;i<n.length;i+=2)o+=String.fromCharCode(n[i]+256*n[i+1]);return o}function U(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function M(t,e,r,n,o,i){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||e<i)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function N(t,e,r,n){e<0&&(e=65535+e+1);for(var o=0,i=Math.min(t.length-r,2);o<i;++o)t[r+o]=(e&255<<8*(n?o:1-o))>>>8*(n?o:1-o)}function k(t,e,r,n){e<0&&(e=4294967295+e+1);for(var o=0,i=Math.min(t.length-r,4);o<i;++o)t[r+o]=e>>>8*(n?o:3-o)&255}function L(t,e,r,n,o,i){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function F(t,e,r,n,i){return i||L(t,0,r,4),o.write(t,e,r,n,23,4),r+4}function D(t,e,r,n,i){return i||L(t,0,r,8),o.write(t,e,r,n,52,8),r+8}u.prototype.slice=function(t,e){var r,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t),u.TYPED_ARRAY_SUPPORT)(r=this.subarray(t,e)).__proto__=u.prototype;else{var o=e-t;r=new u(o,void 0);for(var i=0;i<o;++i)r[i]=this[i+t]}return r},u.prototype.readUIntLE=function(t,e,r){t|=0,e|=0,r||U(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return n},u.prototype.readUIntBE=function(t,e,r){t|=0,e|=0,r||U(t,e,this.length);for(var n=this[t+--e],o=1;e>0&&(o*=256);)n+=this[t+--e]*o;return n},u.prototype.readUInt8=function(t,e){return e||U(t,1,this.length),this[t]},u.prototype.readUInt16LE=function(t,e){return e||U(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUInt16BE=function(t,e){return e||U(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUInt32LE=function(t,e){return e||U(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUInt32BE=function(t,e){return e||U(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||U(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*e)),n},u.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||U(t,e,this.length);for(var n=e,o=1,i=this[t+--n];n>0&&(o*=256);)i+=this[t+--n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*e)),i},u.prototype.readInt8=function(t,e){return e||U(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){e||U(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(t,e){e||U(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(t,e){return e||U(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return e||U(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readFloatLE=function(t,e){return e||U(t,4,this.length),o.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return e||U(t,4,this.length),o.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return e||U(t,8,this.length),o.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return e||U(t,8,this.length),o.read(this,t,!1,52,8)},u.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||M(this,t,e,r,Math.pow(2,8*r)-1,0);var o=1,i=0;for(this[e]=255&t;++i<r&&(o*=256);)this[e+i]=t/o&255;return e+r},u.prototype.writeUIntBE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||M(this,t,e,r,Math.pow(2,8*r)-1,0);var o=r-1,i=1;for(this[e+o]=255&t;--o>=0&&(i*=256);)this[e+o]=t/i&255;return e+r},u.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||M(this,t,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},u.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||M(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):N(this,t,e,!0),e+2},u.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||M(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):N(this,t,e,!1),e+2},u.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||M(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):k(this,t,e,!0),e+4},u.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||M(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):k(this,t,e,!1),e+4},u.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var o=Math.pow(2,8*r-1);M(this,t,e,r,o-1,-o)}var i=0,a=1,s=0;for(this[e]=255&t;++i<r&&(a*=256);)t<0&&0===s&&0!==this[e+i-1]&&(s=1),this[e+i]=(t/a>>0)-s&255;return e+r},u.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var o=Math.pow(2,8*r-1);M(this,t,e,r,o-1,-o)}var i=r-1,a=1,s=0;for(this[e+i]=255&t;--i>=0&&(a*=256);)t<0&&0===s&&0!==this[e+i+1]&&(s=1),this[e+i]=(t/a>>0)-s&255;return e+r},u.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||M(this,t,e,1,127,-128),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||M(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):N(this,t,e,!0),e+2},u.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||M(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):N(this,t,e,!1),e+2},u.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||M(this,t,e,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):k(this,t,e,!0),e+4},u.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||M(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):k(this,t,e,!1),e+4},u.prototype.writeFloatLE=function(t,e,r){return F(this,t,e,!0,r)},u.prototype.writeFloatBE=function(t,e,r){return F(this,t,e,!1,r)},u.prototype.writeDoubleLE=function(t,e,r){return D(this,t,e,!0,r)},u.prototype.writeDoubleBE=function(t,e,r){return D(this,t,e,!1,r)},u.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var o,i=n-r;if(this===t&&r<e&&e<n)for(o=i-1;o>=0;--o)t[o+e]=this[o+r];else if(i<1e3||!u.TYPED_ARRAY_SUPPORT)for(o=0;o<i;++o)t[o+e]=this[o+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+i),e);return i},u.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===t.length){var o=t.charCodeAt(0);o<256&&(t=o)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var i;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i<r;++i)this[i]=t;else{var a=u.isBuffer(t)?t:H(new u(t,n).toString()),s=a.length;for(i=0;i<r-e;++i)this[i+e]=a[i%s]}return this};var x=/[^+\/0-9A-Za-z-_]/g;function j(t){return t<16?"0"+t.toString(16):t.toString(16)}function H(t,e){var r;e=e||1/0;for(var n=t.length,o=null,i=[],a=0;a<n;++a){if((r=t.charCodeAt(a))>55295&&r<57344){if(!o){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function V(t){return n.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(x,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function z(t,e,r,n){for(var o=0;o<n&&!(o+r>=e.length||o>=t.length);++o)e[o+r]=t[o];return o}}).call(this,r(131))},function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0});var i=function(t){function e(e,r,n){var o=t.call(this,r)||this;return o.code=e,o.cause=n,o}return o(e,t),e.unexpectedBufferSize=function(t,r){return new e(e.Code.UnexpectedBufferSizeError,"Expected buffer of "+t+" byte(s) but found only "+r.length+" byte(s)")},e.nullBufferError=function(t){return new e(e.Code.NullBufferError,t)},e}(Error);e.ConverterError=i,function(t){!function(t){t.UnexpectedBufferSizeError="UnexpectedBufferSizeError",t.NullBufferError="NullBufferError"}(t.Code||(t.Code={}))}(i=e.ConverterError||(e.ConverterError={})),e.ConverterError=i},function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0});var o=r(22),i=r(161);n(r(33)),n(r(34)),n(r(22)),e.UartSettingsConverterInstance=new o.ReversedUartSettingsConverter,e.ProtocolConfigurationConverterInstance=new i.ReversedProtocolConfigurationConverter},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});r(96);!function(t){t[t.GET=1]="GET",t[t.POST=2]="POST",t[t.PUT=3]="PUT"}(e.MethodType||(e.MethodType={}))},function(t,e,r){var n;t.exports=(n=r(0),r(20),r(106),r(107),r(11),r(12),r(29),r(49),r(108),r(50),r(109),r(110),r(111),r(30),r(112),r(8),r(2),r(113),r(114),r(115),r(116),r(117),r(118),r(119),r(120),r(121),r(122),r(123),r(124),r(125),r(126),r(127),r(128),n)},function(t,e,r){var n,o,i,a,s,u;t.exports=(u=r(0),o=(n=u).lib,i=o.Base,a=o.WordArray,(s=n.x64={}).Word=i.extend({init:function(t,e){this.high=t,this.low=e}}),s.WordArray=i.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=null!=e?e:8*t.length},toX32:function(){for(var t=this.words,e=t.length,r=[],n=0;n<e;n++){var o=t[n];r.push(o.high),r.push(o.low)}return a.create(r,this.sigBytes)},clone:function(){for(var t=i.clone.call(this),e=t.words=this.words.slice(0),r=e.length,n=0;n<r;n++)e[n]=e[n].clone();return t}}),u)},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(52),o=r(9),i=function(){function t(){}return t.instance=function(){return new t},t.prototype.decode=function(t){var e=o.TapStreamReader.fromArray(t).readTapRequest(),r=new n.Header(e.header.path);return n.ApiRequest.create(e.header.methodType,r.getPath(),e.payload)},t.prototype.encode=function(t){var e=t.getHeader(),r={header:{path:e.path,methodType:t.getMethod()},payload:t.getData()},n=(new o.TapStreamWriter).writeTapRequestHeader(r.header);return void 0!==e.resourceInstance&&n.writeU2(e.resourceInstance),n.writeBytes(r.payload).toBytes},t.HEADER_LENGTH=7,t}();e.IotizeLWM2MCommandConverter=i},function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(152)),n(r(156)),n(r(74)),n(r(157)),n(r(158)),n(r(159))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}(r(73))},function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(82)),n(r(83))},function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(26)),n(r(27)),n(r(28))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(){}return t.IOTIZE_200_NO_ERROR=0,t.IOTIZE_PENDING=1,t.IOTIZE_201_CREATED=65,t.IOTIZE_202_DELETED=66,t.IOTIZE_204_CHANGED=68,t.IOTIZE_205_CONTENT=69,t.IOTIZE_206_BUSY=70,t.IOTIZE_400_BAD_REQUEST=128,t.IOTIZE_401_UNAUTHORIZED=129,t.IOTIZE_404_NOT_FOUND=132,t.IOTIZE_405_METHOD_NOT_ALLOWED=133,t.IOTIZE_406_NOT_ACCEPTABLE=134,t.IOTIZE_500_INTERNAL_SERVER_ERROR=160,t.IOTIZE_501_NOT_IMPLEMENTED=161,t.IOTIZE_503_SERVICE_UNAVAILABLE=163,t.IOTIZE_504_NVM_ERROR=164,t.IOTIZE_505_UNABLE_TO_CONNECT_TO_TARGET=165,t.IOTIZE_506_TARGET_POWER_FAILURE=166,t.IOTIZE_507_NVM_FUL=167,t.IOTIZE_TARGET_PROTOCOL_ERROR=176,t.IOTIZE_TARGET_PROTOCOL_BUSY=177,t.IOTIZE_TARGET_PROTOCOL_REAL=178,t.IOTIZE_TARGET_PROTOCOL_WRONG_PARAM=179,t.IOTIZE_TARGET_PROTOCOL_FORBIDDEN=180,t.IOTIZE_TARGET_PROTOCOL_DATA=181,t.IOTIZE_TARGET_PROTOCOL_COM=182,t.IOTIZE_TARGET_PROTOCOL_LOST_COM=183,t.IOTIZE_TARGET_PROTOCOL_PARAM=184,t.IOTIZE_TARGET_PROTOCOL_INT=185,t.IOTIZE_TARGET_PROTOCOL_ABORT=186,t.IOTIZE_TARGET_PROTOCOL_NOT_IMPLEMENTED=187,t}();e.ResultCode=n},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ResultCodeTranslation={0:"No error",1:"PENDING",65:"CREATED",66:"DELETED",68:"CHANGED",69:"CONTENT",70:"BUSY",128:"Bad request. Meaning device cannot understand your request.",129:"UNAUTHORIZED",132:"NOT_FOUND",133:"METHOD_NOT_ALLOWED",134:"NOT_ACCEPTABLE",160:"INTERNAL_SERVER_ERROR",161:"This resource has not been implemented yet",163:"SERVICE_UNAVAILABLE",164:"NVM_ERROR",165:"UNABLE_TO_CONNECT_TO_TARGET",166:"TARGET_POWER_FAILURE",167:"NVM_FUL",176:"TARGET_PROTOCOL_ERROR",177:"TARGET_PROTOCOL_BUSY",178:"TARGET_PROTOCOL_REAL",179:"TARGET_PROTOCOL_WRONG_PARAM",180:"TARGET_PROTOCOL_FORBIDDEN",181:"TARGET_PROTOCOL_DATA",182:"TARGET_PROTOCOL_COM",183:"TARGET_PROTOCOL_LOST_COM",184:"TARGET_PROTOCOL_PARAM",185:"TARGET_PROTOCOL_INT",186:"TARGET_PROTOCOL_ABORT",187:"TARGET_PROTOCOL_NOT_IMPLEMENTED"}},function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0});var i=r(95),a=r(27),s=r(18);e.TapResponseErrorCode="TapResponseError";var u=function(t){function r(n,o){var i=t.call(this,r.createErrorMessage(n,o))||this;return i.response=n,i.request=o,i.code=e.TapResponseErrorCode,i}return o(r,t),r.createErrorMessage=function(t,e){var r=t.codeRet(),n="Tap request failed. ";return e&&(n="Tap request "+s.MethodType[e.getMethod()]+" "+e.getHeader().getPath()+" failed. "),n+=(r in a.ResultCodeTranslation?a.ResultCodeTranslation[r]:"an unknown error")+" (code=0x"+r.toString(16)+")"},r}(i.LWM2MError);e.ResponseError=u},function(t,e,r){var n,o,i,a,s,u,c,p;t.exports=(p=r(0),o=(n=p).lib,i=o.WordArray,a=o.Hasher,s=n.algo,u=[],c=s.SHA1=a.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var r=this._hash.words,n=r[0],o=r[1],i=r[2],a=r[3],s=r[4],c=0;c<80;c++){if(c<16)u[c]=0|t[e+c];else{var p=u[c-3]^u[c-8]^u[c-14]^u[c-16];u[c]=p<<1|p>>>31}var l=(n<<5|n>>>27)+s+u[c];l+=c<20?1518500249+(o&i|~o&a):c<40?1859775393+(o^i^a):c<60?(o&i|o&a|i&a)-1894007588:(o^i^a)-899497514,s=a,a=i,i=o<<30|o>>>2,o=n,n=l}r[0]=r[0]+n|0,r[1]=r[1]+o|0,r[2]=r[2]+i|0,r[3]=r[3]+a|0,r[4]=r[4]+s|0},_doFinalize:function(){var t=this._data,e=t.words,r=8*this._nDataBytes,n=8*t.sigBytes;return e[n>>>5]|=128<<24-n%32,e[14+(n+64>>>9<<4)]=Math.floor(r/4294967296),e[15+(n+64>>>9<<4)]=r,t.sigBytes=4*e.length,this._process(),this._hash},clone:function(){var t=a.clone.call(this);return t._hash=this._hash.clone(),t}}),n.SHA1=a._createHelper(c),n.HmacSHA1=a._createHmacHelper(c),p.SHA1)},function(t,e,r){var n,o,i,a;t.exports=(n=r(0),i=(o=n).lib.Base,a=o.enc.Utf8,void(o.algo.HMAC=i.extend({init:function(t,e){t=this._hasher=new t.init,"string"==typeof e&&(e=a.parse(e));var r=t.blockSize,n=4*r;e.sigBytes>n&&(e=t.finalize(e)),e.clamp();for(var o=this._oKey=e.clone(),i=this._iKey=e.clone(),s=o.words,u=i.words,c=0;c<r;c++)s[c]^=1549556828,u[c]^=909522486;o.sigBytes=i.sigBytes=n,this.reset()},reset:function(){var t=this._hasher;t.reset(),t.update(this._iKey)},update:function(t){return this._hasher.update(t),this},finalize:function(t){var e=this._hasher,r=e.finalize(t);return e.reset(),e.finalize(this._oKey.clone().concat(r))}})))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(26),o=r(3),i=r(28),a=function(){function t(t){this.data=t,this._body=void 0}return t.SUCCESS=function(e){return t.create(n.ResultCode.IOTIZE_200_NO_ERROR,e)},t.ERROR=function(e){return e=e||n.ResultCode.IOTIZE_400_BAD_REQUEST,t.create(e)},t.create=function(e,r){if(r&&r.length>0){var n=new Uint8Array(1+r.length);return n[0]=e,n.set(r,1),new t(n)}return new t(Uint8Array.from([e]))},t.prototype.body=function(t){return this.successful(),t?t.decode(this.rawBody()):(this._body||(this.decoder?this._body=this.decoder.decode(this.rawBody()):this._body=this.rawBody()),this._body)},t.prototype.rawBody=function(){return null!=this.data&&this.data.length>1?this.data.slice(1):new Uint8Array(0)},t.prototype.setBodyDecoder=function(t){return this.decoder=t,this},t.prototype.hasBody=function(){return null!=this.rawBody()},t.prototype.codeRet=function(){return this.data[0]},t.prototype.toString=function(){return'ResponseMessage[codeRet="'+this.codeRet()+'";data="'+(this.hasBody()?o.FormatHelper.toHexString(this.rawBody()):"NO DATA")+'";decoder='+(this.decoder?this.decoder.constructor.name:"NONE")+"]"},t.prototype.toBytes=function(){return this.data},t.prototype.setBody=function(t){this._body=t},t.prototype.isSuccess=function(){return 0==(128&this.codeRet())},t.prototype.isSuccessful=function(){return 0==(128&this.codeRet())},t.prototype.successful=function(){if(!this.isSuccessful())throw new i.ResponseError(this,this._request)},t.prototype.setRequest=function(t){this._request=t},t}();e.Response=a},function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(142)),n(r(10)),n(r(64)),n(r(65)),n(r(62)),n(r(66)),n(r(67)),n(r(143)),n(r(68))},function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.creat