@jeraldj/client-services 8.1.6 → 8.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +1 -1
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see index.js.LICENSE.txt */
2
- !function e(t,r){if("object"==typeof exports&&"object"==typeof module)module.exports=r(require("jsonld"),require("crypto-ld"));else if("function"==typeof define&&define.amd)define(["jsonld","crypto-ld"],r);else{var n="object"==typeof exports?r(require("jsonld"),require("crypto-ld")):r(t.jsonld,t["crypto-ld"]);for(var i in n)("object"==typeof exports?exports:t)[i]=n[i]}}(window,function(e,t){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function t(){return e.default}:function t(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=217)}([function(e,t,r){"use strict";r.r(t);var n=r(60),i=r.n(n);for(var o in n)["default"].indexOf(o)<0&&function(e){r.d(t,e,function(){return n[e]})}(o);var a=r(61),s=r.n(a);for(var o in a)["default"].indexOf(o)<0&&function(e){r.d(t,e,function(){return a[e]})}(o);var u=r(62);r.d(t,"CsHttpSerializer",function(){return u.b}),r.d(t,"CsHttpRequestType",function(){return u.a}),r.d(t,"CsRequest",function(){return u.c});var c=r(63),f=r.n(c);for(var o in c)["default","CsHttpSerializer","CsHttpRequestType","CsRequest"].indexOf(o)<0&&function(e){r.d(t,e,function(){return c[e]})}(o);var l=r(64);r.d(t,"CsHttpResponseCode",function(){return l.a}),r.d(t,"CsResponse",function(){return l.b});var p=r(65),h=r.n(p);for(var o in p)["default","CsHttpSerializer","CsHttpRequestType","CsRequest","CsHttpResponseCode","CsResponse"].indexOf(o)<0&&function(e){r.d(t,e,function(){return p[e]})}(o)},,function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.multiBindToService=t.getServiceIdentifierAsString=t.typeConstraint=t.namedConstraint=t.taggedConstraint=t.traverseAncerstors=t.decorate=t.id=t.MetadataReader=t.postConstruct=t.targetName=t.multiInject=t.unmanaged=t.optional=t.LazyServiceIdentifer=t.inject=t.named=t.tagged=t.injectable=t.ContainerModule=t.AsyncContainerModule=t.TargetTypeEnum=t.BindingTypeEnum=t.BindingScopeEnum=t.Container=t.METADATA_KEY=void 0;var n=r(7);t.METADATA_KEY=n;var i=r(87);Object.defineProperty(t,"Container",{enumerable:!0,get:function(){return i.Container}});var o=r(18);Object.defineProperty(t,"BindingScopeEnum",{enumerable:!0,get:function(){return o.BindingScopeEnum}}),Object.defineProperty(t,"BindingTypeEnum",{enumerable:!0,get:function(){return o.BindingTypeEnum}}),Object.defineProperty(t,"TargetTypeEnum",{enumerable:!0,get:function(){return o.TargetTypeEnum}});var a=r(103);Object.defineProperty(t,"AsyncContainerModule",{enumerable:!0,get:function(){return a.AsyncContainerModule}}),Object.defineProperty(t,"ContainerModule",{enumerable:!0,get:function(){return a.ContainerModule}});var s=r(104);Object.defineProperty(t,"injectable",{enumerable:!0,get:function(){return s.injectable}});var u=r(105);Object.defineProperty(t,"tagged",{enumerable:!0,get:function(){return u.tagged}});var c=r(106);Object.defineProperty(t,"named",{enumerable:!0,get:function(){return c.named}});var f=r(56);Object.defineProperty(t,"inject",{enumerable:!0,get:function(){return f.inject}}),Object.defineProperty(t,"LazyServiceIdentifer",{enumerable:!0,get:function(){return f.LazyServiceIdentifer}});var l=r(107);Object.defineProperty(t,"optional",{enumerable:!0,get:function(){return l.optional}});var p=r(108);Object.defineProperty(t,"unmanaged",{enumerable:!0,get:function(){return p.unmanaged}});var h=r(109);Object.defineProperty(t,"multiInject",{enumerable:!0,get:function(){return h.multiInject}});var d=r(110);Object.defineProperty(t,"targetName",{enumerable:!0,get:function(){return d.targetName}});var y=r(111);Object.defineProperty(t,"postConstruct",{enumerable:!0,get:function(){return y.postConstruct}});var g=r(54);Object.defineProperty(t,"MetadataReader",{enumerable:!0,get:function(){return g.MetadataReader}});var v=r(24);Object.defineProperty(t,"id",{enumerable:!0,get:function(){return v.id}});var m=r(19);Object.defineProperty(t,"decorate",{enumerable:!0,get:function(){return m.decorate}});var b=r(59);Object.defineProperty(t,"traverseAncerstors",{enumerable:!0,get:function(){return b.traverseAncerstors}}),Object.defineProperty(t,"taggedConstraint",{enumerable:!0,get:function(){return b.taggedConstraint}}),Object.defineProperty(t,"namedConstraint",{enumerable:!0,get:function(){return b.namedConstraint}}),Object.defineProperty(t,"typeConstraint",{enumerable:!0,get:function(){return b.typeConstraint}});var E=r(30);Object.defineProperty(t,"getServiceIdentifierAsString",{enumerable:!0,get:function(){return E.getServiceIdentifierAsString}});var T=r(112);Object.defineProperty(t,"multiBindToService",{enumerable:!0,get:function(){return T.multiBindToService}})},function(e,t,r){"use strict";r.d(t,"a",function(){return i});var n=!1,i={Promise:void 0,set useDeprecatedSynchronousErrorHandling(e){var t;e&&(new Error).stack;n=e},get useDeprecatedSynchronousErrorHandling(){return n}}},function(e,t){e.exports={options:{usePureJavaScript:!1}}},function(e,t,r){"use strict";r.d(t,"a",function(){return h});var n=r(9);function i(e){for(;e;){var t=e,r=t.closed,i=t.destination,o=t.isStopped;if(r||o)return!1;e=i&&i instanceof n.a?i:null}return!0}var o=r(15),a=r(17);function s(e,t,r){if(e){if(e instanceof n.a)return e;if(e[o.a])return e[o.a]()}return e||t||r?new n.a(e,t,r):new n.a(a.a)}var u=r(21);function c(e){return e}function f(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return l(e)}function l(e){return 0===e.length?c:1===e.length?e[0]:function t(r){return e.reduce(function(e,t){return t(e)},r)}}var p=r(3),h=function(){function e(e){this._isScalar=!1,e&&(this._subscribe=e)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(e,t,r){var n=this.operator,i=s(e,t,r);if(n?i.add(n.call(i,this.source)):i.add(this.source||p.a.useDeprecatedSynchronousErrorHandling&&!i.syncErrorThrowable?this._subscribe(i):this._trySubscribe(i)),p.a.useDeprecatedSynchronousErrorHandling&&i.syncErrorThrowable&&(i.syncErrorThrowable=!1,i.syncErrorThrown))throw i.syncErrorValue;return i},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){p.a.useDeprecatedSynchronousErrorHandling&&(e.syncErrorThrown=!0,e.syncErrorValue=t),i(e)?e.error(t):console.warn(t)}},e.prototype.forEach=function(e,t){var r=this;return new(t=d(t))(function(t,n){var i;i=r.subscribe(function(t){try{e(t)}catch(e){n(e),i&&i.unsubscribe()}},n,t)})},e.prototype._subscribe=function(e){var t=this.source;return t&&t.subscribe(e)},e.prototype[u.a]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 0===e.length?this:l(e)(this)},e.prototype.toPromise=function(e){var t=this;return new(e=d(e))(function(e,r){var n;t.subscribe(function(e){return n=e},function(e){return r(e)},function(){return e(n)})})},e.create=function(t){return new e(t)},e}();function d(e){if(e||(e=p.a.Promise||Promise),!e)throw new Error("no Promise impl found");return e}},function(e,t,r){"use strict";r.d(t,"a",function(){return i});var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)};function i(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var o=function(){return o=Object.assign||function e(t){for(var r,n=1,i=arguments.length;n<i;n++)for(var o in r=arguments[n])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t},o.apply(this,arguments)};function a(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r}function s(e,t,r,n){var i=arguments.length,o=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n,a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,r,o):a(t,r))||o);return i>3&&o&&Object.defineProperty(t,r,o),o}function u(e,t){return function(r,n){t(r,n,e)}}function c(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function f(e,t,r,n){function i(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=Promise))(function(r,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){e.done?r(e.value):i(e.value).then(a,s)}u((n=n.apply(e,t||[])).next())})}function l(e,t){var r={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},n,i,o,a;return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(e){return function(t){return u([e,t])}}function u(a){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=2&a[0]?i.return:a[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,a[1])).done)return o;switch(i=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,i=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(!(o=r.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){r=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){r.label=a[1];break}if(6===a[0]&&r.label<o[1]){r.label=o[1],o=a;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(a);break}o[2]&&r.ops.pop(),r.trys.pop();continue}a=t.call(e,r)}catch(e){a=[6,e],i=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}}function p(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}function h(e,t){for(var r in e)"default"===r||t.hasOwnProperty(r)||(t[r]=e[r])}function d(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function y(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,o=[],a;try{for(;(void 0===t||t-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(e){a={error:e}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return o}function g(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(y(arguments[t]));return e}function v(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;for(var n=Array(e),i=0,t=0;t<r;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,i++)n[i]=o[a];return n}function m(e){return this instanceof m?(this.v=e,this):new m(e)}function b(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(e,t||[]),i,o=[];return i={},a("next"),a("throw"),a("return"),i[Symbol.asyncIterator]=function(){return this},i;function a(e){n[e]&&(i[e]=function(t){return new Promise(function(r,n){o.push([e,t,r,n])>1||s(e,t)})})}function s(e,t){try{u(n[e](t))}catch(e){l(o[0][3],e)}}function u(e){e.value instanceof m?Promise.resolve(e.value.v).then(c,f):l(o[0][2],e)}function c(e){s("next",e)}function f(e){s("throw",e)}function l(e,t){e(t),o.shift(),o.length&&s(o[0][0],o[0][1])}}function E(e){var t,r;return t={},n("next"),n("throw",function(e){throw e}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(n,i){t[n]=e[n]?function(t){return(r=!r)?{value:m(e[n](t)),done:"return"===n}:i?i(t):t}:i}}function T(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=d(e),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(t){r[t]=e[t]&&function(r){return new Promise(function(n,o){i(n,o,(r=e[t](r)).done,r.value)})}}function i(e,t,r,n){Promise.resolve(n).then(function(t){e({value:t,done:r})},t)}}function S(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function w(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function C(e){return e&&e.__esModule?e:{default:e}}function _(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)}function I(e,t,r){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,r),r}},function(e,t,r){"use strict";function n(){return[t.INJECT_TAG,t.MULTI_INJECT_TAG,t.NAME_TAG,t.UNMANAGED_TAG,t.NAMED_TAG,t.OPTIONAL_TAG]}Object.defineProperty(t,"__esModule",{value:!0}),t.NON_CUSTOM_TAG_KEYS=t.POST_CONSTRUCT=t.DESIGN_PARAM_TYPES=t.PARAM_TYPES=t.TAGGED_PROP=t.TAGGED=t.MULTI_INJECT_TAG=t.INJECT_TAG=t.OPTIONAL_TAG=t.UNMANAGED_TAG=t.NAME_TAG=t.NAMED_TAG=void 0,t.NAMED_TAG="named",t.NAME_TAG="name",t.UNMANAGED_TAG="unmanaged",t.OPTIONAL_TAG="optional",t.INJECT_TAG="inject",t.MULTI_INJECT_TAG="multi_inject",t.TAGGED="inversify:tagged",t.TAGGED_PROP="inversify:tagged_props",t.PARAM_TYPES="inversify:paramtypes",t.DESIGN_PARAM_TYPES="design:paramtypes",t.POST_CONSTRUCT="post_construct",t.NON_CUSTOM_TAG_KEYS=n()},function(e,t,r){(function(t,n,i,o){var a=r(4),s=r(189),u=e.exports=a.util=a.util||{};function c(e){if(8!==e&&16!==e&&24!==e&&32!==e)throw new Error("Only 8, 16, 24, or 32 bits supported: "+e)}function f(e){if(this.data="",this.read=0,"string"==typeof e)this.data=e;else if(u.isArrayBuffer(e)||u.isArrayBufferView(e))if(void 0!==o&&e instanceof o)this.data=e.toString("binary");else{var t=new Uint8Array(e);try{this.data=String.fromCharCode.apply(null,t)}catch(e){for(var r=0;r<t.length;++r)this.putByte(t[r])}}else(e instanceof f||"object"==typeof e&&"string"==typeof e.data&&"number"==typeof e.read)&&(this.data=e.data,this.read=e.read);this._constructedStringLength=0}!function(){if(void 0!==t&&t.nextTick&&!t.browser)return u.nextTick=t.nextTick,void(u.setImmediate="function"==typeof n?n:u.nextTick);if("function"==typeof n)return u.setImmediate=function(){return n.apply(void 0,arguments)},void(u.nextTick=function(e){return n(e)});if(u.setImmediate=function(e){setTimeout(e,0)},"undefined"!=typeof window&&"function"==typeof window.postMessage){var e="forge.setImmediate",r=[];function i(t){if(t.source===window&&t.data===e){t.stopPropagation();var n=r.slice();r.length=0,n.forEach(function(e){e()})}}u.setImmediate=function(t){r.push(t),1===r.length&&window.postMessage(e,"*")},window.addEventListener("message",i,!0)}if("undefined"!=typeof MutationObserver){var o=Date.now(),a=!0,s=document.createElement("div"),r=[];new MutationObserver(function(){var e=r.slice();r.length=0,e.forEach(function(e){e()})}).observe(s,{attributes:!0});var c=u.setImmediate;u.setImmediate=function(e){Date.now()-o>15?(o=Date.now(),c(e)):(r.push(e),1===r.length&&s.setAttribute("a",a=!a))}}u.nextTick=u.setImmediate}(),u.isNodejs=void 0!==t&&t.versions&&t.versions.node,u.globalScope=u.isNodejs?i:"undefined"==typeof self?window:self,u.isArray=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},u.isArrayBuffer=function(e){return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer},u.isArrayBufferView=function(e){return e&&u.isArrayBuffer(e.buffer)&&void 0!==e.byteLength},u.ByteBuffer=f,u.ByteStringBuffer=f;var l=4096;function p(e,t){t=t||{},this.read=t.readOffset||0,this.growSize=t.growSize||1024;var r=u.isArrayBuffer(e),n=u.isArrayBufferView(e);if(r||n)return this.data=r?new DataView(e):new DataView(e.buffer,e.byteOffset,e.byteLength),void(this.write="writeOffset"in t?t.writeOffset:this.data.byteLength);this.data=new DataView(new ArrayBuffer(0)),this.write=0,null!=e&&this.putBytes(e),"writeOffset"in t&&(this.write=t.writeOffset)}u.ByteStringBuffer.prototype._optimizeConstructedString=function(e){this._constructedStringLength+=e,this._constructedStringLength>l&&(this.data.substr(0,1),this._constructedStringLength=0)},u.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read},u.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0},u.ByteStringBuffer.prototype.putByte=function(e){return this.putBytes(String.fromCharCode(e))},u.ByteStringBuffer.prototype.fillWithByte=function(e,t){e=String.fromCharCode(e);for(var r=this.data;t>0;)1&t&&(r+=e),(t>>>=1)>0&&(e+=e);return this.data=r,this._optimizeConstructedString(t),this},u.ByteStringBuffer.prototype.putBytes=function(e){return this.data+=e,this._optimizeConstructedString(e.length),this},u.ByteStringBuffer.prototype.putString=function(e){return this.putBytes(u.encodeUtf8(e))},u.ByteStringBuffer.prototype.putInt16=function(e){return this.putBytes(String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},u.ByteStringBuffer.prototype.putInt24=function(e){return this.putBytes(String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},u.ByteStringBuffer.prototype.putInt32=function(e){return this.putBytes(String.fromCharCode(e>>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},u.ByteStringBuffer.prototype.putInt16Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255))},u.ByteStringBuffer.prototype.putInt24Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255))},u.ByteStringBuffer.prototype.putInt32Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>24&255))},u.ByteStringBuffer.prototype.putInt=function(e,t){c(t);var r="";do{t-=8,r+=String.fromCharCode(e>>t&255)}while(t>0);return this.putBytes(r)},u.ByteStringBuffer.prototype.putSignedInt=function(e,t){return e<0&&(e+=2<<t-1),this.putInt(e,t)},u.ByteStringBuffer.prototype.putBuffer=function(e){return this.putBytes(e.getBytes())},u.ByteStringBuffer.prototype.getByte=function(){return this.data.charCodeAt(this.read++)},u.ByteStringBuffer.prototype.getInt16=function(){var e=this.data.charCodeAt(this.read)<<8^this.data.charCodeAt(this.read+1);return this.read+=2,e},u.ByteStringBuffer.prototype.getInt24=function(){var e=this.data.charCodeAt(this.read)<<16^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2);return this.read+=3,e},u.ByteStringBuffer.prototype.getInt32=function(){var e=this.data.charCodeAt(this.read)<<24^this.data.charCodeAt(this.read+1)<<16^this.data.charCodeAt(this.read+2)<<8^this.data.charCodeAt(this.read+3);return this.read+=4,e},u.ByteStringBuffer.prototype.getInt16Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8;return this.read+=2,e},u.ByteStringBuffer.prototype.getInt24Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16;return this.read+=3,e},u.ByteStringBuffer.prototype.getInt32Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16^this.data.charCodeAt(this.read+3)<<24;return this.read+=4,e},u.ByteStringBuffer.prototype.getInt=function(e){c(e);var t=0;do{t=(t<<8)+this.data.charCodeAt(this.read++),e-=8}while(e>0);return t},u.ByteStringBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),r=2<<e-2;return t>=r&&(t-=r<<1),t},u.ByteStringBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):0===e?t="":(t=0===this.read?this.data:this.data.slice(this.read),this.clear()),t},u.ByteStringBuffer.prototype.bytes=function(e){return void 0===e?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},u.ByteStringBuffer.prototype.at=function(e){return this.data.charCodeAt(this.read+e)},u.ByteStringBuffer.prototype.setAt=function(e,t){return this.data=this.data.substr(0,this.read+e)+String.fromCharCode(t)+this.data.substr(this.read+e+1),this},u.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)},u.ByteStringBuffer.prototype.copy=function(){var e=u.createBuffer(this.data);return e.read=this.read,e},u.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this},u.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this},u.ByteStringBuffer.prototype.truncate=function(e){var t=Math.max(0,this.length()-e);return this.data=this.data.substr(this.read,t),this.read=0,this},u.ByteStringBuffer.prototype.toHex=function(){for(var e="",t=this.read;t<this.data.length;++t){var r=this.data.charCodeAt(t);r<16&&(e+="0"),e+=r.toString(16)}return e},u.ByteStringBuffer.prototype.toString=function(){return u.decodeUtf8(this.bytes())},u.DataBuffer=p,u.DataBuffer.prototype.length=function(){return this.write-this.read},u.DataBuffer.prototype.isEmpty=function(){return this.length()<=0},u.DataBuffer.prototype.accommodate=function(e,t){if(this.length()>=e)return this;t=Math.max(t||this.growSize,e);var r=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),n=new Uint8Array(this.length()+t);return n.set(r),this.data=new DataView(n.buffer),this},u.DataBuffer.prototype.putByte=function(e){return this.accommodate(1),this.data.setUint8(this.write++,e),this},u.DataBuffer.prototype.fillWithByte=function(e,t){this.accommodate(t);for(var r=0;r<t;++r)this.data.setUint8(e);return this},u.DataBuffer.prototype.putBytes=function(e,t){if(u.isArrayBufferView(e)){var r,n=(r=new Uint8Array(e.buffer,e.byteOffset,e.byteLength)).byteLength-r.byteOffset,i;return this.accommodate(n),(i=new Uint8Array(this.data.buffer,this.write)).set(r),this.write+=n,this}if(u.isArrayBuffer(e)){var r=new Uint8Array(e),i;return this.accommodate(r.byteLength),(i=new Uint8Array(this.data.buffer)).set(r,this.write),this.write+=r.byteLength,this}if(e instanceof u.DataBuffer||"object"==typeof e&&"number"==typeof e.read&&"number"==typeof e.write&&u.isArrayBufferView(e.data)){var r=new Uint8Array(e.data.byteLength,e.read,e.length()),i;return this.accommodate(r.byteLength),(i=new Uint8Array(e.data.byteLength,this.write)).set(r),this.write+=r.byteLength,this}if(e instanceof u.ByteStringBuffer&&(e=e.data,t="binary"),t=t||"binary","string"==typeof e){var o;if("hex"===t)return this.accommodate(Math.ceil(e.length/2)),o=new Uint8Array(this.data.buffer,this.write),this.write+=u.binary.hex.decode(e,o,this.write),this;if("base64"===t)return this.accommodate(3*Math.ceil(e.length/4)),o=new Uint8Array(this.data.buffer,this.write),this.write+=u.binary.base64.decode(e,o,this.write),this;if("utf8"===t&&(e=u.encodeUtf8(e),t="binary"),"binary"===t||"raw"===t)return this.accommodate(e.length),o=new Uint8Array(this.data.buffer,this.write),this.write+=u.binary.raw.decode(o),this;if("utf16"===t)return this.accommodate(2*e.length),o=new Uint16Array(this.data.buffer,this.write),this.write+=u.text.utf16.encode(o),this;throw new Error("Invalid encoding: "+t)}throw Error("Invalid parameter: "+e)},u.DataBuffer.prototype.putBuffer=function(e){return this.putBytes(e),e.clear(),this},u.DataBuffer.prototype.putString=function(e){return this.putBytes(e,"utf16")},u.DataBuffer.prototype.putInt16=function(e){return this.accommodate(2),this.data.setInt16(this.write,e),this.write+=2,this},u.DataBuffer.prototype.putInt24=function(e){return this.accommodate(3),this.data.setInt16(this.write,e>>8&65535),this.data.setInt8(this.write,e>>16&255),this.write+=3,this},u.DataBuffer.prototype.putInt32=function(e){return this.accommodate(4),this.data.setInt32(this.write,e),this.write+=4,this},u.DataBuffer.prototype.putInt16Le=function(e){return this.accommodate(2),this.data.setInt16(this.write,e,!0),this.write+=2,this},u.DataBuffer.prototype.putInt24Le=function(e){return this.accommodate(3),this.data.setInt8(this.write,e>>16&255),this.data.setInt16(this.write,e>>8&65535,!0),this.write+=3,this},u.DataBuffer.prototype.putInt32Le=function(e){return this.accommodate(4),this.data.setInt32(this.write,e,!0),this.write+=4,this},u.DataBuffer.prototype.putInt=function(e,t){c(t),this.accommodate(t/8);do{t-=8,this.data.setInt8(this.write++,e>>t&255)}while(t>0);return this},u.DataBuffer.prototype.putSignedInt=function(e,t){return c(t),this.accommodate(t/8),e<0&&(e+=2<<t-1),this.putInt(e,t)},u.DataBuffer.prototype.getByte=function(){return this.data.getInt8(this.read++)},u.DataBuffer.prototype.getInt16=function(){var e=this.data.getInt16(this.read);return this.read+=2,e},u.DataBuffer.prototype.getInt24=function(){var e=this.data.getInt16(this.read)<<8^this.data.getInt8(this.read+2);return this.read+=3,e},u.DataBuffer.prototype.getInt32=function(){var e=this.data.getInt32(this.read);return this.read+=4,e},u.DataBuffer.prototype.getInt16Le=function(){var e=this.data.getInt16(this.read,!0);return this.read+=2,e},u.DataBuffer.prototype.getInt24Le=function(){var e=this.data.getInt8(this.read)^this.data.getInt16(this.read+1,!0)<<8;return this.read+=3,e},u.DataBuffer.prototype.getInt32Le=function(){var e=this.data.getInt32(this.read,!0);return this.read+=4,e},u.DataBuffer.prototype.getInt=function(e){c(e);var t=0;do{t=(t<<8)+this.data.getInt8(this.read++),e-=8}while(e>0);return t},u.DataBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),r=2<<e-2;return t>=r&&(t-=r<<1),t},u.DataBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):0===e?t="":(t=0===this.read?this.data:this.data.slice(this.read),this.clear()),t},u.DataBuffer.prototype.bytes=function(e){return void 0===e?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},u.DataBuffer.prototype.at=function(e){return this.data.getUint8(this.read+e)},u.DataBuffer.prototype.setAt=function(e,t){return this.data.setUint8(e,t),this},u.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)},u.DataBuffer.prototype.copy=function(){return new u.DataBuffer(this)},u.DataBuffer.prototype.compact=function(){if(this.read>0){var e=new Uint8Array(this.data.buffer,this.read),t=new Uint8Array(e.byteLength);t.set(e),this.data=new DataView(t),this.write-=this.read,this.read=0}return this},u.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this},u.DataBuffer.prototype.truncate=function(e){return this.write=Math.max(0,this.length()-e),this.read=Math.min(this.read,this.write),this},u.DataBuffer.prototype.toHex=function(){for(var e="",t=this.read;t<this.data.byteLength;++t){var r=this.data.getUint8(t);r<16&&(e+="0"),e+=r.toString(16)}return e},u.DataBuffer.prototype.toString=function(e){var t=new Uint8Array(this.data,this.read,this.length());if("binary"===(e=e||"utf8")||"raw"===e)return u.binary.raw.encode(t);if("hex"===e)return u.binary.hex.encode(t);if("base64"===e)return u.binary.base64.encode(t);if("utf8"===e)return u.text.utf8.decode(t);if("utf16"===e)return u.text.utf16.decode(t);throw new Error("Invalid encoding: "+e)},u.createBuffer=function(e,t){return t=t||"raw",void 0!==e&&"utf8"===t&&(e=u.encodeUtf8(e)),new u.ByteBuffer(e)},u.fillString=function(e,t){for(var r="";t>0;)1&t&&(r+=e),(t>>>=1)>0&&(e+=e);return r},u.xorBytes=function(e,t,r){for(var n="",i="",o="",a=0,s=0;r>0;--r,++a)i=e.charCodeAt(a)^t.charCodeAt(a),s>=10&&(n+=o,o="",s=0),o+=String.fromCharCode(i),++s;return n+=o},u.hexToBytes=function(e){var t="",r=0;for(!0&e.length&&(r=1,t+=String.fromCharCode(parseInt(e[0],16)));r<e.length;r+=2)t+=String.fromCharCode(parseInt(e.substr(r,2),16));return t},u.bytesToHex=function(e){return u.createBuffer(e).toHex()},u.int32ToBytes=function(e){return String.fromCharCode(e>>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e)};var h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",d=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],y="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";u.encode64=function(e,t){for(var r="",n="",i,o,a,s=0;s<e.length;)i=e.charCodeAt(s++),o=e.charCodeAt(s++),a=e.charCodeAt(s++),r+=h.charAt(i>>2),r+=h.charAt((3&i)<<4|o>>4),isNaN(o)?r+="==":(r+=h.charAt((15&o)<<2|a>>6),r+=isNaN(a)?"=":h.charAt(63&a)),t&&r.length>t&&(n+=r.substr(0,t)+"\r\n",r=r.substr(t));return n+=r},u.decode64=function(e){e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var t="",r,n,i,o,a=0;a<e.length;)r=d[e.charCodeAt(a++)-43],n=d[e.charCodeAt(a++)-43],i=d[e.charCodeAt(a++)-43],o=d[e.charCodeAt(a++)-43],t+=String.fromCharCode(r<<2|n>>4),64!==i&&(t+=String.fromCharCode((15&n)<<4|i>>2),64!==o&&(t+=String.fromCharCode((3&i)<<6|o)));return t},u.encodeUtf8=function(e){return unescape(encodeURIComponent(e))},u.decodeUtf8=function(e){return decodeURIComponent(escape(e))},u.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:s.encode,decode:s.decode}},u.binary.raw.encode=function(e){return String.fromCharCode.apply(null,e)},u.binary.raw.decode=function(e,t,r){var n=t;n||(n=new Uint8Array(e.length));for(var i=r=r||0,o=0;o<e.length;++o)n[i++]=e.charCodeAt(o);return t?i-r:n},u.binary.hex.encode=u.bytesToHex,u.binary.hex.decode=function(e,t,r){var n=t;n||(n=new Uint8Array(Math.ceil(e.length/2)));var i=0,o=r=r||0;for(1&e.length&&(i=1,n[o++]=parseInt(e[0],16));i<e.length;i+=2)n[o++]=parseInt(e.substr(i,2),16);return t?o-r:n},u.binary.base64.encode=function(e,t){for(var r="",n="",i,o,a,s=0;s<e.byteLength;)i=e[s++],o=e[s++],a=e[s++],r+=h.charAt(i>>2),r+=h.charAt((3&i)<<4|o>>4),isNaN(o)?r+="==":(r+=h.charAt((15&o)<<2|a>>6),r+=isNaN(a)?"=":h.charAt(63&a)),t&&r.length>t&&(n+=r.substr(0,t)+"\r\n",r=r.substr(t));return n+=r},u.binary.base64.decode=function(e,t,r){var n=t,i,o,a,s;n||(n=new Uint8Array(3*Math.ceil(e.length/4))),e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var u=0,c=r=r||0;u<e.length;)i=d[e.charCodeAt(u++)-43],o=d[e.charCodeAt(u++)-43],a=d[e.charCodeAt(u++)-43],s=d[e.charCodeAt(u++)-43],n[c++]=i<<2|o>>4,64!==a&&(n[c++]=(15&o)<<4|a>>2,64!==s&&(n[c++]=(3&a)<<6|s));return t?c-r:n.subarray(0,c)},u.binary.base58.encode=function(e,t){return u.binary.baseN.encode(e,y,t)},u.binary.base58.decode=function(e,t){return u.binary.baseN.decode(e,y,t)},u.text={utf8:{},utf16:{}},u.text.utf8.encode=function(e,t,r){e=u.encodeUtf8(e);var n=t;n||(n=new Uint8Array(e.length));for(var i=r=r||0,o=0;o<e.length;++o)n[i++]=e.charCodeAt(o);return t?i-r:n},u.text.utf8.decode=function(e){return u.decodeUtf8(String.fromCharCode.apply(null,e))},u.text.utf16.encode=function(e,t,r){var n=t;n||(n=new Uint8Array(2*e.length));for(var i=new Uint16Array(n.buffer),o=r=r||0,a=r,s=0;s<e.length;++s)i[a++]=e.charCodeAt(s),o+=2;return t?o-r:n},u.text.utf16.decode=function(e){return String.fromCharCode.apply(null,new Uint16Array(e.buffer))},u.deflate=function(e,t,r){if(t=u.decode64(e.deflate(u.encode64(t)).rval),r){var n=2,i;32&t.charCodeAt(1)&&(n=6),t=t.substring(n,t.length-4)}return t},u.inflate=function(e,t,r){var n=e.inflate(u.encode64(t)).rval;return null===n?null:u.decode64(n)};var g=function(e,t,r){if(!e)throw new Error("WebStorage not available.");var n;if(null===r?n=e.removeItem(t):(r=u.encode64(JSON.stringify(r)),n=e.setItem(t,r)),void 0!==n&&!0!==n.rval){var i=new Error(n.error.message);throw i.id=n.error.id,i.name=n.error.name,i}},v=function(e,t){if(!e)throw new Error("WebStorage not available.");var r=e.getItem(t);if(e.init)if(null===r.rval){if(r.error){var n=new Error(r.error.message);throw n.id=r.error.id,n.name=r.error.name,n}r=null}else r=r.rval;return null!==r&&(r=JSON.parse(u.decode64(r))),r},m=function(e,t,r,n){var i=v(e,t);null===i&&(i={}),i[r]=n,g(e,t,i)},b=function(e,t,r){var n=v(e,t);return null!==n&&(n=r in n?n[r]:null),n},E=function(e,t,r){var n=v(e,t);if(null!==n&&r in n){delete n[r];var i=!0;for(var o in n){i=!1;break}i&&(n=null),g(e,t,n)}},T=function(e,t){g(e,t,null)},S=function(e,t,r){var n=null,i;void 0===r&&(r=["web","flash"]);var o=!1,a=null;for(var s in r){i=r[s];try{if("flash"===i||"both"===i){if(null===t[0])throw new Error("Flash local storage not available.");n=e.apply(this,t),o="flash"===i}"web"!==i&&"both"!==i||(t[0]=localStorage,n=e.apply(this,t),o=!0)}catch(e){a=e}if(o)break}if(!o)throw a;return n};u.setItem=function(e,t,r,n,i){S(m,arguments,i)},u.getItem=function(e,t,r,n){return S(b,arguments,n)},u.removeItem=function(e,t,r,n){S(E,arguments,n)},u.clearItems=function(e,t,r){S(T,arguments,r)},u.parseUrl=function(e){var t=/^(https?):\/\/([^:&^\/]*):?(\d*)(.*)$/g;t.lastIndex=0;var r=t.exec(e),n=null===r?null:{full:e,scheme:r[1],host:r[2],port:r[3],path:r[4]};return n&&(n.fullHost=n.host,n.port?(80!==n.port&&"http"===n.scheme||443!==n.port&&"https"===n.scheme)&&(n.fullHost+=":"+n.port):"http"===n.scheme?n.port=80:"https"===n.scheme&&(n.port=443),n.full=n.scheme+"://"+n.fullHost),n};var w=null;u.getQueryVariables=function(e){var t=function(e){for(var t={},r=e.split("&"),n=0;n<r.length;n++){var i=r[n].indexOf("="),o,a;i>0?(o=r[n].substring(0,i),a=r[n].substring(i+1)):(o=r[n],a=null),o in t||(t[o]=[]),o in Object.prototype||null===a||t[o].push(unescape(a))}return t},r;return void 0===e?(null===w&&(w="undefined"!=typeof window&&window.location&&window.location.search?t(window.location.search.substring(1)):{}),r=w):r=t(e),r},u.parseFragment=function(e){var t=e,r="",n=e.indexOf("?");n>0&&(t=e.substring(0,n),r=e.substring(n+1));var i=t.split("/"),o;return i.length>0&&""===i[0]&&i.shift(),{pathString:t,queryString:r,path:i,query:""===r?{}:u.getQueryVariables(r)}},u.makeRequest=function(e){var t=u.parseFragment(e),r={path:t.pathString,query:t.queryString,getPath:function(e){return void 0===e?t.path:t.path[e]},getQuery:function(e,r){var n;return void 0===e?n=t.query:(n=t.query[e])&&void 0!==r&&(n=n[r]),n},getQueryLast:function(e,t){var n,i=r.getQuery(e);return n=i?i[i.length-1]:t}};return r},u.makeLink=function(e,t,r){e=jQuery.isArray(e)?e.join("/"):e;var n=jQuery.param(t||{});return r=r||"",e+(n.length>0?"?"+n:"")+(r.length>0?"#"+r:"")},u.isEmpty=function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0},u.format=function(e){for(var t=/%./g,r,n,i=0,o=[],a=0;r=t.exec(e);){(n=e.substring(a,t.lastIndex-2)).length>0&&o.push(n),a=t.lastIndex;var s=r[0][1];switch(s){case"s":case"o":i<arguments.length?o.push(arguments[1+i++]):o.push("<?>");break;case"%":o.push("%");break;default:o.push("<%"+s+"?>")}}return o.push(e.substring(a)),o.join("")},u.formatNumber=function(e,t,r,n){var i=e,o=isNaN(t=Math.abs(t))?2:t,a=void 0===r?",":r,s=void 0===n?".":n,u=i<0?"-":"",c=parseInt(i=Math.abs(+i||0).toFixed(o),10)+"",f=c.length>3?c.length%3:0;return u+(f?c.substr(0,f)+s:"")+c.substr(f).replace(/(\d{3})(?=\d)/g,"$1"+s)+(o?a+Math.abs(i-c).toFixed(o).slice(2):"")},u.formatSize=function(e){return e=e>=1073741824?u.formatNumber(e/1073741824,2,".","")+" GiB":e>=1048576?u.formatNumber(e/1048576,2,".","")+" MiB":e>=1024?u.formatNumber(e/1024,0)+" KiB":u.formatNumber(e,0)+" bytes"},u.bytesFromIP=function(e){return-1!==e.indexOf(".")?u.bytesFromIPv4(e):-1!==e.indexOf(":")?u.bytesFromIPv6(e):null},u.bytesFromIPv4=function(e){if(4!==(e=e.split(".")).length)return null;for(var t=u.createBuffer(),r=0;r<e.length;++r){var n=parseInt(e[r],10);if(isNaN(n))return null;t.putByte(n)}return t.getBytes()},u.bytesFromIPv6=function(e){for(var t=0,r=2*(8-(e=e.split(":").filter(function(e){return 0===e.length&&++t,!0})).length+t),n=u.createBuffer(),i=0;i<8;++i)if(e[i]&&0!==e[i].length){var o=u.hexToBytes(e[i]);o.length<2&&n.putByte(0),n.putBytes(o)}else n.fillWithByte(0,r),r=0;return n.getBytes()},u.bytesToIP=function(e){return 4===e.length?u.bytesToIPv4(e):16===e.length?u.bytesToIPv6(e):null},u.bytesToIPv4=function(e){if(4!==e.length)return null;for(var t=[],r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t.join(".")},u.bytesToIPv6=function(e){if(16!==e.length)return null;for(var t=[],r=[],n=0,i=0;i<e.length;i+=2){for(var o=u.bytesToHex(e[i]+e[i+1]);"0"===o[0]&&"0"!==o;)o=o.substr(1);if("0"===o){var a=r[r.length-1],s=t.length;a&&s===a.end+1?(a.end=s,a.end-a.start>r[n].end-r[n].start&&(n=r.length-1)):r.push({start:s,end:s})}t.push(o)}if(r.length>0){var c=r[n];c.end-c.start>0&&(t.splice(c.start,c.end-c.start+1,""),0===c.start&&t.unshift(""),7===c.end&&t.push(""))}return t.join(":")},u.estimateCores=function(e,t){if("function"==typeof e&&(t=e,e={}),e=e||{},"cores"in u&&!e.update)return t(null,u.cores);if("undefined"!=typeof navigator&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return u.cores=navigator.hardwareConcurrency,t(null,u.cores);if("undefined"==typeof Worker)return u.cores=1,t(null,u.cores);if("undefined"==typeof Blob)return u.cores=2,t(null,u.cores);var r=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",function(e){for(var t=Date.now(),r=t+4;Date.now()<r;);self.postMessage({st:t,et:r})})}.toString(),")()"],{type:"application/javascript"}));function n(e,a,s){if(0===a){var c=Math.floor(e.reduce(function(e,t){return e+t},0)/e.length);return u.cores=Math.max(1,c),URL.revokeObjectURL(r),t(null,u.cores)}i(s,function(t,r){e.push(o(s,r)),n(e,a-1,s)})}function i(e,t){for(var n=[],i=[],o=0;o<e;++o){var a=new Worker(r);a.addEventListener("message",function(r){if(i.push(r.data),i.length===e){for(var o=0;o<e;++o)n[o].terminate();t(null,i)}}),n.push(a)}for(var o=0;o<e;++o)n[o].postMessage(o)}function o(e,t){for(var r=[],n=0;n<e;++n)for(var i=t[n],o=r[n]=[],a=0;a<e;++a)if(n!==a){var s=t[a];(i.st>s.st&&i.st<s.et||s.st>i.st&&s.st<i.et)&&o.push(a)}return r.reduce(function(e,t){return Math.max(e,t.length)},0)}n([],5,16)}}).call(this,r(36),r(134).setImmediate,r(29),r(74).Buffer)},function(e,t,r){"use strict";r.d(t,"a",function(){return f});var n=r(6),i=r(20),o=r(17),a=r(10),s=r(15),u=r(3),c=r(13),f=function(e){function t(r,n,i){var a=e.call(this)||this;switch(a.syncErrorValue=null,a.syncErrorThrown=!1,a.syncErrorThrowable=!1,a.isStopped=!1,arguments.length){case 0:a.destination=o.a;break;case 1:if(!r){a.destination=o.a;break}if("object"==typeof r){r instanceof t?(a.syncErrorThrowable=r.syncErrorThrowable,a.destination=r,r.add(a)):(a.syncErrorThrowable=!0,a.destination=new l(a,r));break}default:a.syncErrorThrowable=!0,a.destination=new l(a,r,n,i)}return a}return n.a(t,e),t.prototype[s.a]=function(){return this},t.create=function(e,r,n){var i=new t(e,r,n);return i.syncErrorThrowable=!1,i},t.prototype.next=function(e){this.isStopped||this._next(e)},t.prototype.error=function(e){this.isStopped||(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this))},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){this.destination.error(e),this.unsubscribe()},t.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},t.prototype._unsubscribeAndRecycle=function(){var e=this._parentOrParents;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=e,this},t}(a.a),l=function(e){function t(t,r,n,a){var s=e.call(this)||this,u;s._parentSubscriber=t;var c=s;return Object(i.a)(r)?u=r:r&&(u=r.next,n=r.error,a=r.complete,r!==o.a&&(c=Object.create(r),Object(i.a)(c.unsubscribe)&&s.add(c.unsubscribe.bind(c)),c.unsubscribe=s.unsubscribe.bind(s))),s._context=c,s._next=u,s._error=n,s._complete=a,s}return n.a(t,e),t.prototype.next=function(e){if(!this.isStopped&&this._next){var t=this._parentSubscriber;u.a.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?this.__tryOrSetError(t,this._next,e)&&this.unsubscribe():this.__tryOrUnsub(this._next,e)}},t.prototype.error=function(e){if(!this.isStopped){var t=this._parentSubscriber,r=u.a.useDeprecatedSynchronousErrorHandling;if(this._error)r&&t.syncErrorThrowable?(this.__tryOrSetError(t,this._error,e),this.unsubscribe()):(this.__tryOrUnsub(this._error,e),this.unsubscribe());else if(t.syncErrorThrowable)r?(t.syncErrorValue=e,t.syncErrorThrown=!0):Object(c.a)(e),this.unsubscribe();else{if(this.unsubscribe(),r)throw e;Object(c.a)(e)}}},t.prototype.complete=function(){var e=this;if(!this.isStopped){var t=this._parentSubscriber;if(this._complete){var r=function(){return e._complete.call(e._context)};u.a.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?(this.__tryOrSetError(t,r),this.unsubscribe()):(this.__tryOrUnsub(r),this.unsubscribe())}else this.unsubscribe()}},t.prototype.__tryOrUnsub=function(e,t){try{e.call(this._context,t)}catch(e){if(this.unsubscribe(),u.a.useDeprecatedSynchronousErrorHandling)throw e;Object(c.a)(e)}},t.prototype.__tryOrSetError=function(e,t,r){if(!u.a.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{t.call(this._context,r)}catch(t){return u.a.useDeprecatedSynchronousErrorHandling?(e.syncErrorValue=t,e.syncErrorThrown=!0,!0):(Object(c.a)(t),!0)}return!1},t.prototype._unsubscribe=function(){var e=this._parentSubscriber;this._context=null,this._parentSubscriber=null,e.unsubscribe()},t}(f)},function(e,t,r){"use strict";r.d(t,"a",function(){return u});var n=function(){return Array.isArray||function(e){return e&&"number"==typeof e.length}}(),i=r(34),o=r(20),a,s=function(){function e(e){return Error.call(this),this.message=e?e.length+" errors occurred during unsubscription:\n"+e.map(function(e,t){return t+1+") "+e.toString()}).join("\n "):"",this.name="UnsubscriptionError",this.errors=e,this}return e.prototype=Object.create(Error.prototype),e}(),u=function(){function e(e){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,e&&(this._ctorUnsubscribe=!0,this._unsubscribe=e)}var t;return e.prototype.unsubscribe=function(){var t;if(!this.closed){var r=this,a=r._parentOrParents,u=r._ctorUnsubscribe,f=r._unsubscribe,l=r._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,a instanceof e)a.remove(this);else if(null!==a)for(var p=0;p<a.length;++p){var h;a[p].remove(this)}if(Object(o.a)(f)){u&&(this._unsubscribe=void 0);try{f.call(this)}catch(e){t=e instanceof s?c(e.errors):[e]}}if(n(l))for(var p=-1,d=l.length;++p<d;){var y=l[p];if(Object(i.a)(y))try{y.unsubscribe()}catch(e){t=t||[],e instanceof s?t=t.concat(c(e.errors)):t.push(e)}}if(t)throw new s(t)}},e.prototype.add=function(t){var r=t;if(!t)return e.EMPTY;switch(typeof t){case"function":r=new e(t);case"object":if(r===this||r.closed||"function"!=typeof r.unsubscribe)return r;if(this.closed)return r.unsubscribe(),r;if(!(r instanceof e)){var n=r;(r=new e)._subscriptions=[n]}break;default:throw new Error("unrecognized teardown "+t+" added to Subscription.")}var i=r._parentOrParents;if(null===i)r._parentOrParents=this;else if(i instanceof e){if(i===this)return r;r._parentOrParents=[i,this]}else{if(-1!==i.indexOf(this))return r;i.push(this)}var o=this._subscriptions;return null===o?this._subscriptions=[r]:o.push(r),r},e.prototype.remove=function(e){var t=this._subscriptions;if(t){var r=t.indexOf(e);-1!==r&&t.splice(r,1)}},e.EMPTY=((t=new e).closed=!0,t),e}();function c(e){return e.reduce(function(e,t){return e.concat(t instanceof s?t.errors:t)},[])}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.STACK_OVERFLOW=t.CIRCULAR_DEPENDENCY_IN_FACTORY=t.POST_CONSTRUCT_ERROR=t.MULTIPLE_POST_CONSTRUCT_METHODS=t.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK=t.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE=t.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE=t.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT=t.ARGUMENTS_LENGTH_MISMATCH=t.INVALID_DECORATOR_OPERATION=t.INVALID_TO_SELF_VALUE=t.INVALID_FUNCTION_BINDING=t.INVALID_MIDDLEWARE_RETURN=t.NO_MORE_SNAPSHOTS_AVAILABLE=t.INVALID_BINDING_TYPE=t.NOT_IMPLEMENTED=t.CIRCULAR_DEPENDENCY=t.UNDEFINED_INJECT_ANNOTATION=t.MISSING_INJECT_ANNOTATION=t.MISSING_INJECTABLE_ANNOTATION=t.NOT_REGISTERED=t.CANNOT_UNBIND=t.AMBIGUOUS_MATCH=t.KEY_NOT_FOUND=t.NULL_ARGUMENT=t.DUPLICATED_METADATA=t.DUPLICATED_INJECTABLE_DECORATOR=void 0,t.DUPLICATED_INJECTABLE_DECORATOR="Cannot apply @injectable decorator multiple times.",t.DUPLICATED_METADATA="Metadata key was used more than once in a parameter:",t.NULL_ARGUMENT="NULL argument",t.KEY_NOT_FOUND="Key Not Found",t.AMBIGUOUS_MATCH="Ambiguous match found for serviceIdentifier:",t.CANNOT_UNBIND="Could not unbind serviceIdentifier:",t.NOT_REGISTERED="No matching bindings found for serviceIdentifier:",t.MISSING_INJECTABLE_ANNOTATION="Missing required @injectable annotation in:",t.MISSING_INJECT_ANNOTATION="Missing required @inject or @multiInject annotation in:";var n=function(e){return"@inject called with undefined this could mean that the class "+e+" has a circular dependency problem. You can use a LazyServiceIdentifer to overcome this limitation."};t.UNDEFINED_INJECT_ANNOTATION=n,t.CIRCULAR_DEPENDENCY="Circular dependency found:",t.NOT_IMPLEMENTED="Sorry, this feature is not fully implemented yet.",t.INVALID_BINDING_TYPE="Invalid binding type:",t.NO_MORE_SNAPSHOTS_AVAILABLE="No snapshot available to restore.",t.INVALID_MIDDLEWARE_RETURN="Invalid return type in middleware. Middleware must return!",t.INVALID_FUNCTION_BINDING="Value provided to function binding must be a function!",t.INVALID_TO_SELF_VALUE="The toSelf function can only be applied when a constructor is used as service identifier",t.INVALID_DECORATOR_OPERATION="The @inject @multiInject @tagged and @named decorators must be applied to the parameters of a class constructor or a class property.";var i=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return"The number of constructor arguments in the derived class "+e[0]+" must be >= than the number of constructor arguments of its base class."};t.ARGUMENTS_LENGTH_MISMATCH=i,t.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT="Invalid Container constructor argument. Container options must be an object.",t.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE="Invalid Container option. Default scope must be a string ('singleton' or 'transient').",t.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE="Invalid Container option. Auto bind injectable must be a boolean",t.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK="Invalid Container option. Skip base check must be a boolean",t.MULTIPLE_POST_CONSTRUCT_METHODS="Cannot apply @postConstruct decorator multiple times in the same class";var o=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return"@postConstruct error in class "+e[0]+": "+e[1]};t.POST_CONSTRUCT_ERROR=o;var a=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return"It looks like there is a circular dependency in one of the '"+e[0]+"' bindings. Please investigate bindings withservice identifier '"+e[1]+"'."};t.CIRCULAR_DEPENDENCY_IN_FACTORY=a,t.STACK_OVERFLOW="Maximum call stack size exceeded"},function(e,t,r){"use strict";r.d(t,"a",function(){return n});var n=function(){function e(e,t){this._code=t}return Object.defineProperty(e.prototype,"code",{get:function(){return this._code},enumerable:!1,configurable:!0}),e}()},function(e,t,r){"use strict";function n(e){setTimeout(function(){throw e},0)}r.d(t,"a",function(){return n})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Metadata=void 0;var n=r(7),i=function(){function e(e,t){this.key=e,this.value=t}return e.prototype.toString=function(){return this.key===n.NAMED_TAG?"named: "+this.value.toString()+" ":"tagged: { key:"+this.key.toString()+", value: "+this.value+" }"},e}();t.Metadata=i},function(e,t,r){"use strict";r.d(t,"a",function(){return n});var n=function(){return"function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random()}(),i=n},function(e,t,r){"use strict";r.d(t,"b",function(){return a}),r.d(t,"c",function(){return u}),r.d(t,"d",function(){return f}),r.d(t,"e",function(){return l.a}),r.d(t,"a",function(){return n.a});var n=r(12),i=(o=function(e,t){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},o(e,t)},function(e,t){function r(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o,a=function(e){function t(r,n){var i=e.call(this,r,t.code)||this;return i.response=n,Object.setPrototypeOf(i,t.prototype),i}return i(t,e),t.isInstance=function(e){return e.code&&e.code===t.code},t.code="HTTP_CLIENT_ERROR",t}(n.a),s=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),u=function(e){function t(r,n){var i=e.call(this,r,t.code)||this;return i.response=n,Object.setPrototypeOf(i,t.prototype),i}return s(t,e),t.isInstance=function(e){return e.code&&e.code===t.code},t.code="HTTP_SERVER_ERROR",t}(n.a),c=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),f=function(e){function t(r){var n=e.call(this,r,t.code)||this;return Object.setPrototypeOf(n,t.prototype),n}return c(t,e),t.isInstance=function(e){return e.code&&e.code===t.code},t.code="NETWORK_ERROR",t}(n.a),l=r(32)},function(e,t,r){"use strict";r.d(t,"a",function(){return o});var n=r(3),i=r(13),o={closed:!0,next:function(e){},error:function(e){if(n.a.useDeprecatedSynchronousErrorHandling)throw e;Object(i.a)(e)},complete:function(){}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TargetTypeEnum=t.BindingTypeEnum=t.BindingScopeEnum=void 0;var n={Request:"Request",Singleton:"Singleton",Transient:"Transient"};t.BindingScopeEnum=n;var i={ConstantValue:"ConstantValue",Constructor:"Constructor",DynamicValue:"DynamicValue",Factory:"Factory",Function:"Function",Instance:"Instance",Invalid:"Invalid",Provider:"Provider"};t.BindingTypeEnum=i;var o={ClassProperty:"ClassProperty",ConstructorArgument:"ConstructorArgument",Variable:"Variable"};t.TargetTypeEnum=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tagProperty=t.tagParameter=t.decorate=void 0;var n=r(11),i=r(7);function o(e,t,r,n){var o;s(i.TAGGED,e,t,n,r)}function a(e,t,r){var n;s(i.TAGGED_PROP,e.constructor,t,r)}function s(e,t,r,i,o){var a={},s="number"==typeof o,u=void 0!==o&&s?o.toString():r;if(s&&void 0!==r)throw new Error(n.INVALID_DECORATOR_OPERATION);Reflect.hasOwnMetadata(e,t)&&(a=Reflect.getMetadata(e,t));var c=a[u];if(Array.isArray(c))for(var f=0,l=c;f<l.length;f++){var p=l[f];if(p.key===i.key)throw new Error(n.DUPLICATED_METADATA+" "+p.key.toString())}else c=[];c.push(i),a[u]=c,Reflect.defineMetadata(e,a,t)}function u(e,t){Reflect.decorate(e,t)}function c(e,t){return function(r,n){t(r,n,e)}}function f(e,t,r){"number"==typeof r?u([c(r,e)],t):"string"==typeof r?Reflect.decorate([e],t,r):u([e],t)}t.tagParameter=o,t.tagProperty=a,t.decorate=f},function(e,t,r){"use strict";function n(e){return"function"==typeof e}r.d(t,"a",function(){return n})},function(e,t,r){"use strict";r.d(t,"a",function(){return n});var n=function(){return"function"==typeof Symbol&&Symbol.observable||"@@observable"}()},function(e,t,r){"use strict";r.d(t,"a",function(){return o});var n=r(5),i=r(10);function o(e,t){return new n.a(function(r){var n=new i.a,o=0;return n.add(t.schedule(function(){o!==e.length?(r.next(e[o++]),r.closed||n.add(this.schedule())):r.complete()})),n})}},function(e,t,r){"use strict";var n,i,o;r.r(t),r.d(t,"GroupMembershipType",function(){return n}),r.d(t,"GroupEntityStatus",function(){return i}),r.d(t,"GroupMemberRole",function(){return o}),r.d(t,"CsGroupActivity",function(){return a}),r.d(t,"CsGroupMember",function(){return s}),r.d(t,"CsGroup",function(){return u}),function(e){e.INVITE_ONLY="invite_only",e.MODERATED="moderated"}(n||(n={})),function(e){e.ACTIVE="active",e.INACTIVE="inactive",e.SUSPENDED="suspended"}(i||(i={})),function(e){e.ADMIN="admin",e.MEMBER="member"}(o||(o={}));var a=function(){function e(){}return e.fromJSON=function(t){return Object.setPrototypeOf(t,new e)},e}(),s=function(){function e(){}return e.fromJSON=function(t){return Object.setPrototypeOf(t,new e)},e}(),u=function(){function e(){}return e.fromJSON=function(t){var r=Object.setPrototypeOf(t,new e);return r.active=r.status===i.ACTIVE,r.members&&(r.members=r.members.map(function(e){return s.fromJSON(e)})),r.activities&&(r.activities=r.activities.map(function(e){return a.fromJSON(e)})),r},e.prototype.isActive=function(){return this.active=this.status===i.ACTIVE,this.active},e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.id=void 0;var n=0;function i(){return n++}t.id=i},function(e,t,r){"use strict";r.d(t,"a",function(){return i});var n,i=function(){function e(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return e.prototype=Object.create(Error.prototype),e}()},,function(e,t,r){"use strict";var n;r.d(t,"a",function(){return n}),function(e){e.ENROLMENT_COUNT="enrolmentCount",e.COMPLETED_COUNT="completedCount",e.LEAF_NODES_COUNT="leafNodesCount",e.PROGRESS="progress"}(n||(n={}))},,function(e,t,r){(function(t){var r;r="undefined"!=typeof window?window:void 0!==t?t:"undefined"!=typeof self?self:{},e.exports=r}).call(this,r(29))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.circularDependencyToException=t.listMetadataForTarget=t.listRegisteredBindingsForServiceIdentifier=t.getServiceIdentifierAsString=t.getFunctionName=void 0;var n=r(11);function i(e){var t,t;return"function"==typeof e?(t=e).name:"symbol"==typeof e?e.toString():t=e}function o(e,t,r){var n="",i=r(e,t);return 0!==i.length&&(n="\nRegistered bindings:",i.forEach(function(e){var t="Object";null!==e.implementationType&&(t=f(e.implementationType)),n=n+"\n "+t,e.constraint.metaData&&(n=n+" - "+e.constraint.metaData)})),n}function a(e,t){return null!==e.parentRequest&&(e.parentRequest.serviceIdentifier===t||a(e.parentRequest,t))}function s(e){function t(e,r){void 0===r&&(r=[]);var n=i(e.serviceIdentifier);return r.push(n),null!==e.parentRequest?t(e.parentRequest,r):r}var r;return t(e).reverse().join(" --\x3e ")}function u(e){e.childRequests.forEach(function(e){if(a(e,e.serviceIdentifier)){var t=s(e);throw new Error(n.CIRCULAR_DEPENDENCY+" "+t)}u(e)})}function c(e,t){if(t.isTagged()||t.isNamed()){var r="",n=t.getNamedTag(),i=t.getCustomTags();return null!==n&&(r+=n.toString()+"\n"),null!==i&&i.forEach(function(e){r+=e.toString()+"\n"})," "+e+"\n "+e+" - "+r}return" "+e}function f(e){if(e.name)return e.name;var t=e.toString(),r=t.match(/^function\s*([^\s(]+)/);return r?r[1]:"Anonymous function: "+t}t.getServiceIdentifierAsString=i,t.listRegisteredBindingsForServiceIdentifier=o,t.circularDependencyToException=u,t.listMetadataForTarget=c,t.getFunctionName=f},function(e,t,r){var n=r(4);r(48),r(139),r(140),r(8),n.random&&n.random.getBytes?e.exports=n.random:function(t){var r={},i=new Array(4),o=n.util.createBuffer();function a(){var e=n.prng.create(r);return e.getBytes=function(t,r){return e.generate(t,r)},e.getBytesSync=function(t){return e.generate(t)},e}r.formatKey=function(e){var t=n.util.createBuffer(e);return(e=new Array(4))[0]=t.getInt32(),e[1]=t.getInt32(),e[2]=t.getInt32(),e[3]=t.getInt32(),n.aes._expandKey(e,!1)},r.formatSeed=function(e){var t=n.util.createBuffer(e);return(e=new Array(4))[0]=t.getInt32(),e[1]=t.getInt32(),e[2]=t.getInt32(),e[3]=t.getInt32(),e},r.cipher=function(e,t){return n.aes._updateBlock(e,t,i,!1),o.putInt32(i[0]),o.putInt32(i[1]),o.putInt32(i[2]),o.putInt32(i[3]),o.getBytes()},r.increment=function(e){return++e[3],e},r.md=n.md.sha256;var s=a(),u=null,c=n.util.globalScope,f=c.crypto||c.msCrypto;if(f&&f.getRandomValues&&(u=function(e){return f.getRandomValues(e)}),n.options.usePureJavaScript||!n.util.isNodejs&&!u){if("undefined"==typeof window||window.document,s.collectInt(+new Date,32),"undefined"!=typeof navigator){var l="";for(var p in navigator)try{"string"==typeof navigator[p]&&(l+=navigator[p])}catch(e){}s.collect(l),l=null}t&&(t().mousemove(function(e){s.collectInt(e.clientX,16),s.collectInt(e.clientY,16)}),t().keypress(function(e){s.collectInt(e.charCode,8)}))}if(n.random)for(var p in s)n.random[p]=s[p];else n.random=s;n.random.createInstance=a,e.exports=n.random}("undefined"!=typeof jQuery?jQuery:null)},function(e,t,r){"use strict";r.d(t,"a",function(){return a});var n=r(12),i=(o=function(e,t){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},o(e,t)},function(e,t){function r(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o,a=function(e){function t(r){var n=e.call(this,r,"REQUEST_BUILD_ERROR")||this;return Object.setPrototypeOf(n,t.prototype),n}return i(t,e),t}(n.a)},function(e,t,r){var n=r(4);r(8),r(49);var i=e.exports=n.asn1=n.asn1||{};function o(e,t,r){if(r>t){var n=new Error("Too few bytes to parse DER.");throw n.available=e.length(),n.remaining=t,n.requested=r,n}}i.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192},i.Type={NONE:0,BOOLEAN:1,INTEGER:2,BITSTRING:3,OCTETSTRING:4,NULL:5,OID:6,ODESC:7,EXTERNAL:8,REAL:9,ENUMERATED:10,EMBEDDED:11,UTF8:12,ROID:13,SEQUENCE:16,SET:17,PRINTABLESTRING:19,IA5STRING:22,UTCTIME:23,GENERALIZEDTIME:24,BMPSTRING:30},i.create=function(e,t,r,o,a){if(n.util.isArray(o)){for(var s=[],u=0;u<o.length;++u)void 0!==o[u]&&s.push(o[u]);o=s}var c={tagClass:e,type:t,constructed:r,composed:r||n.util.isArray(o),value:o};return a&&"bitStringContents"in a&&(c.bitStringContents=a.bitStringContents,c.original=i.copy(c)),c},i.copy=function(e,t){var r;if(n.util.isArray(e)){r=[];for(var o=0;o<e.length;++o)r.push(i.copy(e[o],t));return r}return"string"==typeof e?e:(r={tagClass:e.tagClass,type:e.type,constructed:e.constructed,composed:e.composed,value:i.copy(e.value,t)},t&&!t.excludeBitStringContents&&(r.bitStringContents=e.bitStringContents),r)},i.equals=function(e,t,r){if(n.util.isArray(e)){if(!n.util.isArray(t))return!1;if(e.length!==t.length)return!1;for(var o=0;o<e.length;++o)if(!i.equals(e[o],t[o]))return!1;return!0}if(typeof e!=typeof t)return!1;if("string"==typeof e)return e===t;var a=e.tagClass===t.tagClass&&e.type===t.type&&e.constructed===t.constructed&&e.composed===t.composed&&i.equals(e.value,t.value);return r&&r.includeBitStringContents&&(a=a&&e.bitStringContents===t.bitStringContents),a},i.getBerValueLength=function(e){var t=e.getByte(),r,n;if(128!==t)return r=128&t?e.getInt((127&t)<<3):t};var a=function(e,t){var r=e.getByte();if(t--,128!==r){var n,i;if(128&r){var a=127&r;o(e,t,a),n=e.getInt(a<<3)}else n=r;if(n<0)throw new Error("Negative length: "+n);return n}};function s(e,t,r,n){var u;o(e,t,2);var c=e.getByte();t--;var f=192&c,l=31&c;u=e.length();var p=a(e,t),h,d;if(t-=u-e.length(),void 0!==p&&p>t){if(n.strict){var y=new Error("Too few bytes to read ASN.1 value.");throw y.available=e.length(),y.remaining=t,y.requested=p,y}p=t}var g=!(32&~c);if(g)if(h=[],void 0===p)for(;;){if(o(e,t,2),e.bytes(2)===String.fromCharCode(0,0)){e.getBytes(2),t-=2;break}u=e.length(),h.push(s(e,t,r+1,n)),t-=u-e.length()}else for(;p>0;)u=e.length(),h.push(s(e,p,r+1,n)),t-=u-e.length(),p-=u-e.length();if(void 0===h&&f===i.Class.UNIVERSAL&&l===i.Type.BITSTRING&&(d=e.bytes(p)),void 0===h&&n.decodeBitStrings&&f===i.Class.UNIVERSAL&&l===i.Type.BITSTRING&&p>1){var v=e.read,m=t,b=0;if(l===i.Type.BITSTRING&&(o(e,t,1),b=e.getByte(),t--),0===b)try{u=e.length();var E,T=s(e,t,r+1,{verbose:n.verbose,strict:!0,decodeBitStrings:!0}),S=u-e.length();t-=S,l==i.Type.BITSTRING&&S++;var w=T.tagClass;S!==p||w!==i.Class.UNIVERSAL&&w!==i.Class.CONTEXT_SPECIFIC||(h=[T])}catch(e){}void 0===h&&(e.read=v,t=m)}if(void 0===h){if(void 0===p){if(n.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");p=t}if(l===i.Type.BMPSTRING)for(h="";p>0;p-=2)o(e,t,2),h+=String.fromCharCode(e.getInt16()),t-=2;else h=e.getBytes(p)}var C=void 0===d?null:{bitStringContents:d};return i.create(f,l,g,h,C)}i.fromDer=function(e,t){return void 0===t&&(t={strict:!0,decodeBitStrings:!0}),"boolean"==typeof t&&(t={strict:t,decodeBitStrings:!0}),"strict"in t||(t.strict=!0),"decodeBitStrings"in t||(t.decodeBitStrings=!0),"string"==typeof e&&(e=n.util.createBuffer(e)),s(e,e.length(),0,t)},i.toDer=function(e){var t=n.util.createBuffer(),r=e.tagClass|e.type,o=n.util.createBuffer(),a=!1;if("bitStringContents"in e&&(a=!0,e.original&&(a=i.equals(e,e.original))),a)o.putBytes(e.bitStringContents);else if(e.composed){e.constructed?r|=32:o.putByte(0);for(var s=0;s<e.value.length;++s)void 0!==e.value[s]&&o.putBuffer(i.toDer(e.value[s]))}else if(e.type===i.Type.BMPSTRING)for(var s=0;s<e.value.length;++s)o.putInt16(e.value.charCodeAt(s));else!(e.type===i.Type.INTEGER&&e.value.length>1)||(0!==e.value.charCodeAt(0)||128&e.value.charCodeAt(1))&&(255!==e.value.charCodeAt(0)||128&~e.value.charCodeAt(1))?o.putBytes(e.value):o.putBytes(e.value.substr(1));if(t.putByte(r),o.length()<=127)t.putByte(127&o.length());else{var u=o.length(),c="";do{c+=String.fromCharCode(255&u),u>>>=8}while(u>0);t.putByte(128|c.length);for(var s=c.length-1;s>=0;--s)t.putByte(c.charCodeAt(s))}return t.putBuffer(o),t},i.oidToDer=function(e){var t=e.split("."),r=n.util.createBuffer(),i,o,a,s;r.putByte(40*parseInt(t[0],10)+parseInt(t[1],10));for(var u=2;u<t.length;++u){i=!0,o=[],a=parseInt(t[u],10);do{s=127&a,a>>>=7,i||(s|=128),o.push(s),i=!1}while(a>0);for(var c=o.length-1;c>=0;--c)r.putByte(o[c])}return r},i.derToOid=function(e){var t;"string"==typeof e&&(e=n.util.createBuffer(e));var r=e.getByte();t=Math.floor(r/40)+"."+r%40;for(var i=0;e.length()>0;)i<<=7,128&(r=e.getByte())?i+=127&r:(t+="."+(i+r),i=0);return t},i.utcTimeToDate=function(e){var t=new Date,r=parseInt(e.substr(0,2),10);r=r>=50?1900+r:2e3+r;var n=parseInt(e.substr(2,2),10)-1,i=parseInt(e.substr(4,2),10),o=parseInt(e.substr(6,2),10),a=parseInt(e.substr(8,2),10),s=0;if(e.length>11){var u=e.charAt(10),c=10;"+"!==u&&"-"!==u&&(s=parseInt(e.substr(10,2),10),c+=2)}if(t.setUTCFullYear(r,n,i),t.setUTCHours(o,a,s,0),c&&("+"===(u=e.charAt(c))||"-"===u)){var f,l,p=60*parseInt(e.substr(c+1,2),10)+parseInt(e.substr(c+4,2),10);p*=6e4,"+"===u?t.setTime(+t-p):t.setTime(+t+p)}return t},i.generalizedTimeToDate=function(e){var t=new Date,r=parseInt(e.substr(0,4),10),n=parseInt(e.substr(4,2),10)-1,i=parseInt(e.substr(6,2),10),o=parseInt(e.substr(8,2),10),a=parseInt(e.substr(10,2),10),s=parseInt(e.substr(12,2),10),u=0,c=0,f=!1;"Z"===e.charAt(e.length-1)&&(f=!0);var l=e.length-5,p=e.charAt(l),h,d;"+"!==p&&"-"!==p||(c=60*parseInt(e.substr(l+1,2),10)+parseInt(e.substr(l+4,2),10),c*=6e4,"+"===p&&(c*=-1),f=!0);return"."===e.charAt(14)&&(u=1e3*parseFloat(e.substr(14),10)),f?(t.setUTCFullYear(r,n,i),t.setUTCHours(o,a,s,u),t.setTime(+t+c)):(t.setFullYear(r,n,i),t.setHours(o,a,s,u)),t},i.dateToUtcTime=function(e){if("string"==typeof e)return e;var t="",r=[];r.push((""+e.getUTCFullYear()).substr(2)),r.push(""+(e.getUTCMonth()+1)),r.push(""+e.getUTCDate()),r.push(""+e.getUTCHours()),r.push(""+e.getUTCMinutes()),r.push(""+e.getUTCSeconds());for(var n=0;n<r.length;++n)r[n].length<2&&(t+="0"),t+=r[n];return t+="Z"},i.dateToGeneralizedTime=function(e){if("string"==typeof e)return e;var t="",r=[];r.push(""+e.getUTCFullYear()),r.push(""+(e.getUTCMonth()+1)),r.push(""+e.getUTCDate()),r.push(""+e.getUTCHours()),r.push(""+e.getUTCMinutes()),r.push(""+e.getUTCSeconds());for(var n=0;n<r.length;++n)r[n].length<2&&(t+="0"),t+=r[n];return t+="Z"},i.integerToDer=function(e){var t=n.util.createBuffer();if(e>=-128&&e<128)return t.putSignedInt(e,8);if(e>=-32768&&e<32768)return t.putSignedInt(e,16);if(e>=-8388608&&e<8388608)return t.putSignedInt(e,24);if(e>=-2147483648&&e<2147483648)return t.putSignedInt(e,32);var r=new Error("Integer too large; max is 32-bits.");throw r.integer=e,r},i.derToInteger=function(e){"string"==typeof e&&(e=n.util.createBuffer(e));var t=8*e.length();if(t>32)throw new Error("Integer too large; max is 32-bits.");return e.getSignedInt(t)},i.validate=function(e,t,r,o){var a=!1;if(e.tagClass!==t.tagClass&&void 0!==t.tagClass||e.type!==t.type&&void 0!==t.type)o&&(e.tagClass!==t.tagClass&&o.push("["+t.name+'] Expected tag class "'+t.tagClass+'", got "'+e.tagClass+'"'),e.type!==t.type&&o.push("["+t.name+'] Expected type "'+t.type+'", got "'+e.type+'"'));else if(e.constructed===t.constructed||void 0===t.constructed){if(a=!0,t.value&&n.util.isArray(t.value))for(var s=0,u=0;a&&u<t.value.length;++u)a=t.value[u].optional||!1,e.value[s]&&((a=i.validate(e.value[s],t.value[u],r,o))?++s:t.value[u].optional&&(a=!0)),!a&&o&&o.push("["+t.name+'] Tag class "'+t.tagClass+'", type "'+t.type+'" expected value length "'+t.value.length+'", got "'+e.value.length+'"');var c;if(a&&r)if(t.capture&&(r[t.capture]=e.value),t.captureAsn1&&(r[t.captureAsn1]=e),t.captureBitStringContents&&"bitStringContents"in e&&(r[t.captureBitStringContents]=e.bitStringContents),t.captureBitStringValue&&"bitStringContents"in e)if(e.bitStringContents.length<2)r[t.captureBitStringValue]="";else{var f;if(0!==e.bitStringContents.charCodeAt(0))throw new Error("captureBitStringValue only supported for zero unused bits");r[t.captureBitStringValue]=e.bitStringContents.slice(1)}}else o&&o.push("["+t.name+'] Expected constructed "'+t.constructed+'", got "'+e.constructed+'"');return a};var u=/[^\\u0000-\\u00ff]/;i.prettyPrint=function(e,t,r){var o="";r=r||2,(t=t||0)>0&&(o+="\n");for(var a="",s=0;s<t*r;++s)a+=" ";switch(o+=a+"Tag: ",e.tagClass){case i.Class.UNIVERSAL:o+="Universal:";break;case i.Class.APPLICATION:o+="Application:";break;case i.Class.CONTEXT_SPECIFIC:o+="Context-Specific:";break;case i.Class.PRIVATE:o+="Private:"}if(e.tagClass===i.Class.UNIVERSAL)switch(o+=e.type,e.type){case i.Type.NONE:o+=" (None)";break;case i.Type.BOOLEAN:o+=" (Boolean)";break;case i.Type.INTEGER:o+=" (Integer)";break;case i.Type.BITSTRING:o+=" (Bit string)";break;case i.Type.OCTETSTRING:o+=" (Octet string)";break;case i.Type.NULL:o+=" (Null)";break;case i.Type.OID:o+=" (Object Identifier)";break;case i.Type.ODESC:o+=" (Object Descriptor)";break;case i.Type.EXTERNAL:o+=" (External or Instance of)";break;case i.Type.REAL:o+=" (Real)";break;case i.Type.ENUMERATED:o+=" (Enumerated)";break;case i.Type.EMBEDDED:o+=" (Embedded PDV)";break;case i.Type.UTF8:o+=" (UTF8)";break;case i.Type.ROID:o+=" (Relative Object Identifier)";break;case i.Type.SEQUENCE:o+=" (Sequence)";break;case i.Type.SET:o+=" (Set)";break;case i.Type.PRINTABLESTRING:o+=" (Printable String)";break;case i.Type.IA5String:o+=" (IA5String (ASCII))";break;case i.Type.UTCTIME:o+=" (UTC time)";break;case i.Type.GENERALIZEDTIME:o+=" (Generalized time)";break;case i.Type.BMPSTRING:o+=" (BMP String)"}else o+=e.type;if(o+="\n",o+=a+"Constructed: "+e.constructed+"\n",e.composed){for(var c=0,f="",s=0;s<e.value.length;++s)void 0!==e.value[s]&&(c+=1,f+=i.prettyPrint(e.value[s],t+1,r),s+1<e.value.length&&(f+=","));o+=a+"Sub values: "+c+f}else{if(o+=a+"Value: ",e.type===i.Type.OID){var l=i.derToOid(e.value);o+=l,n.pki&&n.pki.oids&&l in n.pki.oids&&(o+=" ("+n.pki.oids[l]+") ")}if(e.type===i.Type.INTEGER)try{o+=i.derToInteger(e.value)}catch(t){o+="0x"+n.util.bytesToHex(e.value)}else if(e.type===i.Type.BITSTRING){if(e.value.length>1?o+="0x"+n.util.bytesToHex(e.value.slice(1)):o+="(none)",e.value.length>0){var p=e.value.charCodeAt(0);1==p?o+=" (1 unused bit shown)":p>1&&(o+=" ("+p+" unused bits shown)")}}else e.type===i.Type.OCTETSTRING?(u.test(e.value)||(o+="("+e.value+") "),o+="0x"+n.util.bytesToHex(e.value)):e.type===i.Type.UTF8?o+=n.util.decodeUtf8(e.value):e.type===i.Type.PRINTABLESTRING||e.type===i.Type.IA5String?o+=e.value:u.test(e.value)?o+="0x"+n.util.bytesToHex(e.value):0===e.value.length?o+="[null]":o+=e.value}return o}},function(e,t,r){"use strict";function n(e){return null!==e&&"object"==typeof e}r.d(t,"a",function(){return n})},function(e,t,r){"use strict";r.d(t,"a",function(){return n});var n=function(e){return function(t){for(var r=0,n=e.length;r<n&&!t.closed;r++)t.next(e[r]);t.complete()}}},function(e,t){var r=e.exports={},n,i;function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}function u(e){if(i===clearTimeout)return clearTimeout(e);if((i===a||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(e);try{return i(e)}catch(t){try{return i.call(null,e)}catch(t){return i.call(this,e)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(e){n=o}try{i="function"==typeof clearTimeout?clearTimeout:a}catch(e){i=a}}();var c=[],f=!1,l,p=-1;function h(){f&&l&&(f=!1,l.length?c=l.concat(c):p=-1,c.length&&d())}function d(){if(!f){var e=s(h);f=!0;for(var t=c.length;t;){for(l=c,c=[];++p<t;)l&&l[p].run();p=-1,t=c.length}l=null,f=!1,u(e)}}function y(e,t){this.fun=e,this.array=t}function g(){}r.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];c.push(new y(e,t)),1!==c.length||f||s(d)},y.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=g,r.addListener=g,r.once=g,r.off=g,r.removeListener=g,r.removeAllListeners=g,r.emit=g,r.prependListener=g,r.prependOnceListener=g,r.listeners=function(e){return[]},r.binding=function(e){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(e){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}},function(e,t,r){var n=r(4);e.exports=n.md=n.md||{},n.md.algorithms=n.md.algorithms||{}},,,,,,,,,function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BindingOnSyntax=void 0;var n=r(47),i=function(){function e(e){this._binding=e}return e.prototype.onActivation=function(e){return this._binding.onActivation=e,new n.BindingWhenSyntax(this._binding)},e}();t.BindingOnSyntax=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BindingWhenSyntax=void 0;var n=r(46),i=r(59),o=function(){function e(e){this._binding=e}return e.prototype.when=function(e){return this._binding.constraint=e,new n.BindingOnSyntax(this._binding)},e.prototype.whenTargetNamed=function(e){return this._binding.constraint=i.namedConstraint(e),new n.BindingOnSyntax(this._binding)},e.prototype.whenTargetIsDefault=function(){return this._binding.constraint=function(e){var t;return null!==e.target&&!e.target.isNamed()&&!e.target.isTagged()},new n.BindingOnSyntax(this._binding)},e.prototype.whenTargetTagged=function(e,t){return this._binding.constraint=i.taggedConstraint(e)(t),new n.BindingOnSyntax(this._binding)},e.prototype.whenInjectedInto=function(e){return this._binding.constraint=function(t){return i.typeConstraint(e)(t.parentRequest)},new n.BindingOnSyntax(this._binding)},e.prototype.whenParentNamed=function(e){return this._binding.constraint=function(t){return i.namedConstraint(e)(t.parentRequest)},new n.BindingOnSyntax(this._binding)},e.prototype.whenParentTagged=function(e,t){return this._binding.constraint=function(r){return i.taggedConstraint(e)(t)(r.parentRequest)},new n.BindingOnSyntax(this._binding)},e.prototype.whenAnyAncestorIs=function(e){return this._binding.constraint=function(t){return i.traverseAncerstors(t,i.typeConstraint(e))},new n.BindingOnSyntax(this._binding)},e.prototype.whenNoAncestorIs=function(e){return this._binding.constraint=function(t){return!i.traverseAncerstors(t,i.typeConstraint(e))},new n.BindingOnSyntax(this._binding)},e.prototype.whenAnyAncestorNamed=function(e){return this._binding.constraint=function(t){return i.traverseAncerstors(t,i.namedConstraint(e))},new n.BindingOnSyntax(this._binding)},e.prototype.whenNoAncestorNamed=function(e){return this._binding.constraint=function(t){return!i.traverseAncerstors(t,i.namedConstraint(e))},new n.BindingOnSyntax(this._binding)},e.prototype.whenAnyAncestorTagged=function(e,t){return this._binding.constraint=function(r){return i.traverseAncerstors(r,i.taggedConstraint(e)(t))},new n.BindingOnSyntax(this._binding)},e.prototype.whenNoAncestorTagged=function(e,t){return this._binding.constraint=function(r){return!i.traverseAncerstors(r,i.taggedConstraint(e)(t))},new n.BindingOnSyntax(this._binding)},e.prototype.whenAnyAncestorMatches=function(e){return this._binding.constraint=function(t){return i.traverseAncerstors(t,e)},new n.BindingOnSyntax(this._binding)},e.prototype.whenNoAncestorMatches=function(e){return this._binding.constraint=function(t){return!i.traverseAncerstors(t,e)},new n.BindingOnSyntax(this._binding)},e}();t.BindingWhenSyntax=o},function(e,t,r){var n=r(4);function i(e,t){var r=function(){return new n.aes.Algorithm(e,t)};n.cipher.registerAlgorithm(e,r)}r(118),r(135),r(8),e.exports=n.aes=n.aes||{},n.aes.startEncrypting=function(e,t,r,n){var i=y({key:e,output:r,decrypt:!1,mode:n});return i.start(t),i},n.aes.createEncryptionCipher=function(e,t){return y({key:e,output:null,decrypt:!1,mode:t})},n.aes.startDecrypting=function(e,t,r,n){var i=y({key:e,output:r,decrypt:!0,mode:n});return i.start(t),i},n.aes.createDecryptionCipher=function(e,t){return y({key:e,output:null,decrypt:!0,mode:t})},n.aes.Algorithm=function(e,t){o||p();var r=this;r.name=e,r.mode=new t({blockSize:16,cipher:{encrypt:function(e,t){return d(r._w,e,t,!1)},decrypt:function(e,t){return d(r._w,e,t,!0)}}}),r._init=!1},n.aes.Algorithm.prototype.initialize=function(e){if(!this._init){var t=e.key,r;if("string"!=typeof t||16!==t.length&&24!==t.length&&32!==t.length){if(n.util.isArray(t)&&(16===t.length||24===t.length||32===t.length)){r=t,t=n.util.createBuffer();for(var i=0;i<r.length;++i)t.putByte(r[i])}}else t=n.util.createBuffer(t);if(!n.util.isArray(t)){r=t,t=[];var o=r.length();if(16===o||24===o||32===o){o>>>=2;for(var i=0;i<o;++i)t.push(r.getInt32())}}if(!n.util.isArray(t)||4!==t.length&&6!==t.length&&8!==t.length)throw new Error("Invalid key parameter.");var a=this.mode.name,s=-1!==["CFB","OFB","CTR","GCM"].indexOf(a);this._w=h(t,e.decrypt&&!s),this._init=!0}},n.aes._expandKey=function(e,t){return o||p(),h(e,t)},n.aes._updateBlock=d,i("AES-ECB",n.cipher.modes.ecb),i("AES-CBC",n.cipher.modes.cbc),i("AES-CFB",n.cipher.modes.cfb),i("AES-OFB",n.cipher.modes.ofb),i("AES-CTR",n.cipher.modes.ctr),i("AES-GCM",n.cipher.modes.gcm);var o=!1,a=4,s,u,c,f,l;function p(){o=!0,c=[0,1,2,4,8,16,32,64,128,27,54];for(var e=new Array(256),t=0;t<128;++t)e[t]=t<<1,e[t+128]=t+128<<1^283;s=new Array(256),u=new Array(256),f=new Array(4),l=new Array(4);for(var t=0;t<4;++t)f[t]=new Array(256),l[t]=new Array(256);for(var r=0,n=0,i,a,p,h,d,y,g,t=0;t<256;++t){h=(h=n^n<<1^n<<2^n<<3^n<<4)>>8^255&h^99,s[r]=h,u[h]=r,y=(d=e[h])<<24^h<<16^h<<8^h^d,g=((i=e[r])^(a=e[i])^(p=e[a]))<<24^(r^p)<<16^(r^a^p)<<8^r^i^p;for(var v=0;v<4;++v)f[v][r]=y,l[v][h]=g,y=y<<24|y>>>8,g=g<<24|g>>>8;0===r?r=n=1:(r=i^e[e[e[i^p]]],n^=e[e[n]])}}function h(e,t){for(var r=e.slice(0),n,i=1,o=r.length,u,f=a*(o+6+1),p=o;p<f;++p)n=r[p-1],p%o===0?(n=s[n>>>16&255]<<24^s[n>>>8&255]<<16^s[255&n]<<8^s[n>>>24]^c[i]<<24,i++):o>6&&p%o===4&&(n=s[n>>>24]<<24^s[n>>>16&255]<<16^s[n>>>8&255]<<8^s[255&n]),r[p]=r[p-o]^n;if(t){for(var h,d=l[0],y=l[1],g=l[2],v=l[3],m=r.slice(0),p=0,b=(f=r.length)-a;p<f;p+=a,b-=a)if(0===p||p===f-a)m[p]=r[b],m[p+1]=r[b+3],m[p+2]=r[b+2],m[p+3]=r[b+1];else for(var E=0;E<a;++E)h=r[b+E],m[p+(3&-E)]=d[s[h>>>24]]^y[s[h>>>16&255]]^g[s[h>>>8&255]]^v[s[255&h]];r=m}return r}function d(e,t,r,n){var i=e.length/4-1,o,a,c,p,h,d,y,g,v,m,b,E;n?(o=l[0],a=l[1],c=l[2],p=l[3],h=u):(o=f[0],a=f[1],c=f[2],p=f[3],h=s),d=t[0]^e[0],y=t[n?3:1]^e[1],g=t[2]^e[2],v=t[n?1:3]^e[3];for(var T=3,S=1;S<i;++S)m=o[d>>>24]^a[y>>>16&255]^c[g>>>8&255]^p[255&v]^e[++T],b=o[y>>>24]^a[g>>>16&255]^c[v>>>8&255]^p[255&d]^e[++T],E=o[g>>>24]^a[v>>>16&255]^c[d>>>8&255]^p[255&y]^e[++T],v=o[v>>>24]^a[d>>>16&255]^c[y>>>8&255]^p[255&g]^e[++T],d=m,y=b,g=E;r[0]=h[d>>>24]<<24^h[y>>>16&255]<<16^h[g>>>8&255]<<8^h[255&v]^e[++T],r[n?3:1]=h[y>>>24]<<24^h[g>>>16&255]<<16^h[v>>>8&255]<<8^h[255&d]^e[++T],r[2]=h[g>>>24]<<24^h[v>>>16&255]<<16^h[d>>>8&255]<<8^h[255&y]^e[++T],r[n?1:3]=h[v>>>24]<<24^h[d>>>16&255]<<16^h[y>>>8&255]<<8^h[255&g]^e[++T]}function y(e){var t,r="AES-"+((e=e||{}).mode||"CBC").toUpperCase(),i,o=(i=e.decrypt?n.cipher.createDecipher(r,e.key):n.cipher.createCipher(r,e.key)).start;return i.start=function(e,t){var r=null;t instanceof n.util.ByteBuffer&&(r=t,t={}),(t=t||{}).output=r,t.iv=e,o.call(i,t)},i}},function(e,t,r){var n=r(4);n.pki=n.pki||{};var i=e.exports=n.pki.oids=n.oids=n.oids||{};function o(e,t){i[e]=t,i[t]=e}function a(e,t){i[e]=t}o("1.2.840.113549.1.1.1","rsaEncryption"),o("1.2.840.113549.1.1.4","md5WithRSAEncryption"),o("1.2.840.113549.1.1.5","sha1WithRSAEncryption"),o("1.2.840.113549.1.1.7","RSAES-OAEP"),o("1.2.840.113549.1.1.8","mgf1"),o("1.2.840.113549.1.1.9","pSpecified"),o("1.2.840.113549.1.1.10","RSASSA-PSS"),o("1.2.840.113549.1.1.11","sha256WithRSAEncryption"),o("1.2.840.113549.1.1.12","sha384WithRSAEncryption"),o("1.2.840.113549.1.1.13","sha512WithRSAEncryption"),o("1.3.101.112","EdDSA25519"),o("1.2.840.10040.4.3","dsa-with-sha1"),o("1.3.14.3.2.7","desCBC"),o("1.3.14.3.2.26","sha1"),o("2.16.840.1.101.3.4.2.1","sha256"),o("2.16.840.1.101.3.4.2.2","sha384"),o("2.16.840.1.101.3.4.2.3","sha512"),o("1.2.840.113549.2.5","md5"),o("1.2.840.113549.1.7.1","data"),o("1.2.840.113549.1.7.2","signedData"),o("1.2.840.113549.1.7.3","envelopedData"),o("1.2.840.113549.1.7.4","signedAndEnvelopedData"),o("1.2.840.113549.1.7.5","digestedData"),o("1.2.840.113549.1.7.6","encryptedData"),o("1.2.840.113549.1.9.1","emailAddress"),o("1.2.840.113549.1.9.2","unstructuredName"),o("1.2.840.113549.1.9.3","contentType"),o("1.2.840.113549.1.9.4","messageDigest"),o("1.2.840.113549.1.9.5","signingTime"),o("1.2.840.113549.1.9.6","counterSignature"),o("1.2.840.113549.1.9.7","challengePassword"),o("1.2.840.113549.1.9.8","unstructuredAddress"),o("1.2.840.113549.1.9.14","extensionRequest"),o("1.2.840.113549.1.9.20","friendlyName"),o("1.2.840.113549.1.9.21","localKeyId"),o("1.2.840.113549.1.9.22.1","x509Certificate"),o("1.2.840.113549.1.12.10.1.1","keyBag"),o("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag"),o("1.2.840.113549.1.12.10.1.3","certBag"),o("1.2.840.113549.1.12.10.1.4","crlBag"),o("1.2.840.113549.1.12.10.1.5","secretBag"),o("1.2.840.113549.1.12.10.1.6","safeContentsBag"),o("1.2.840.113549.1.5.13","pkcs5PBES2"),o("1.2.840.113549.1.5.12","pkcs5PBKDF2"),o("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4"),o("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4"),o("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC"),o("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC"),o("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC"),o("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC"),o("1.2.840.113549.2.7","hmacWithSHA1"),o("1.2.840.113549.2.8","hmacWithSHA224"),o("1.2.840.113549.2.9","hmacWithSHA256"),o("1.2.840.113549.2.10","hmacWithSHA384"),o("1.2.840.113549.2.11","hmacWithSHA512"),o("1.2.840.113549.3.7","des-EDE3-CBC"),o("2.16.840.1.101.3.4.1.2","aes128-CBC"),o("2.16.840.1.101.3.4.1.22","aes192-CBC"),o("2.16.840.1.101.3.4.1.42","aes256-CBC"),o("2.5.4.3","commonName"),o("2.5.4.5","serialName"),o("2.5.4.6","countryName"),o("2.5.4.7","localityName"),o("2.5.4.8","stateOrProvinceName"),o("2.5.4.9","streetAddress"),o("2.5.4.10","organizationName"),o("2.5.4.11","organizationalUnitName"),o("2.5.4.13","description"),o("2.5.4.15","businessCategory"),o("2.5.4.17","postalCode"),o("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName"),o("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName"),o("2.16.840.1.113730.1.1","nsCertType"),o("2.16.840.1.113730.1.13","nsComment"),a("2.5.29.1","authorityKeyIdentifier"),a("2.5.29.2","keyAttributes"),a("2.5.29.3","certificatePolicies"),a("2.5.29.4","keyUsageRestriction"),a("2.5.29.5","policyMapping"),a("2.5.29.6","subtreesConstraint"),a("2.5.29.7","subjectAltName"),a("2.5.29.8","issuerAltName"),a("2.5.29.9","subjectDirectoryAttributes"),a("2.5.29.10","basicConstraints"),a("2.5.29.11","nameConstraints"),a("2.5.29.12","policyConstraints"),a("2.5.29.13","basicConstraints"),o("2.5.29.14","subjectKeyIdentifier"),o("2.5.29.15","keyUsage"),a("2.5.29.16","privateKeyUsagePeriod"),o("2.5.29.17","subjectAltName"),o("2.5.29.18","issuerAltName"),o("2.5.29.19","basicConstraints"),a("2.5.29.20","cRLNumber"),a("2.5.29.21","cRLReason"),a("2.5.29.22","expirationDate"),a("2.5.29.23","instructionCode"),a("2.5.29.24","invalidityDate"),a("2.5.29.25","cRLDistributionPoints"),a("2.5.29.26","issuingDistributionPoint"),a("2.5.29.27","deltaCRLIndicator"),a("2.5.29.28","issuingDistributionPoint"),a("2.5.29.29","certificateIssuer"),a("2.5.29.30","nameConstraints"),o("2.5.29.31","cRLDistributionPoints"),o("2.5.29.32","certificatePolicies"),a("2.5.29.33","policyMappings"),a("2.5.29.34","policyConstraints"),o("2.5.29.35","authorityKeyIdentifier"),a("2.5.29.36","policyConstraints"),o("2.5.29.37","extKeyUsage"),a("2.5.29.46","freshestCRL"),a("2.5.29.54","inhibitAnyPolicy"),o("1.3.6.1.4.1.11129.2.4.2","timestampList"),o("1.3.6.1.5.5.7.1.1","authorityInfoAccess"),o("1.3.6.1.5.5.7.3.1","serverAuth"),o("1.3.6.1.5.5.7.3.2","clientAuth"),o("1.3.6.1.5.5.7.3.3","codeSigning"),o("1.3.6.1.5.5.7.3.4","emailProtection"),o("1.3.6.1.5.5.7.3.8","timeStamping")},function(e,t,r){"use strict";r.d(t,"a",function(){return n});var n=function(){function e(){}return e.TRACE_ID="trace_id",e}()},function(e,t,r){var n=r(4);r(8);var i=e.exports=n.pem=n.pem||{};function o(e){for(var t=e.name+": ",r=[],n=function(e,t){return" "+t},i=0;i<e.values.length;++i)r.push(e.values[i].replace(/^(\S+\r\n)/,n));t+=r.join(",")+"\r\n";for(var o=0,a=-1,i=0;i<t.length;++i,++o)if(o>65&&-1!==a){var s=t[a];","===s?(++a,t=t.substr(0,a)+"\r\n "+t.substr(a)):t=t.substr(0,a)+"\r\n"+s+t.substr(a+1),o=i-a-1,a=-1,++i}else" "!==t[i]&&"\t"!==t[i]&&","!==t[i]||(a=i);return t}function a(e){return e.replace(/^\s+/,"")}i.encode=function(e,t){t=t||{};var r="-----BEGIN "+e.type+"-----\r\n",i;if(e.procType&&(r+=o(i={name:"Proc-Type",values:[String(e.procType.version),e.procType.type]})),e.contentDomain&&(r+=o(i={name:"Content-Domain",values:[e.contentDomain]})),e.dekInfo&&(i={name:"DEK-Info",values:[e.dekInfo.algorithm]},e.dekInfo.parameters&&i.values.push(e.dekInfo.parameters),r+=o(i)),e.headers)for(var a=0;a<e.headers.length;++a)r+=o(e.headers[a]);return e.procType&&(r+="\r\n"),r+=n.util.encode64(e.body,t.maxline||64)+"\r\n",r+="-----END "+e.type+"-----\r\n"},i.decode=function(e){for(var t=[],r=/\s*-----BEGIN ([A-Z0-9- ]+)-----\r?\n?([\x21-\x7e\s]+?(?:\r?\n\r?\n))?([:A-Za-z0-9+\/=\s]+?)-----END \1-----/g,i=/([\x21-\x7e]+):\s*([\x21-\x7e\s^:]+)/,o=/\r?\n/,s;s=r.exec(e);){var u={type:s[1],procType:null,contentDomain:null,dekInfo:null,headers:[],body:n.util.decode64(s[3])};if(t.push(u),s[2]){for(var c=s[2].split(o),f=0;s&&f<c.length;){for(var l=c[f].replace(/\s+$/,""),p=f+1;p<c.length;++p){var h=c[p];if(!/\s/.test(h[0]))break;l+=h,f=p}if(s=l.match(i)){for(var d={name:s[1],values:[]},y=s[2].split(","),g=0;g<y.length;++g)d.values.push(a(y[g]));if(u.procType)if(u.contentDomain||"Content-Domain"!==d.name)if(u.dekInfo||"DEK-Info"!==d.name)u.headers.push(d);else{if(0===d.values.length)throw new Error('Invalid PEM formatted message. The "DEK-Info" header must have at least one subfield.');u.dekInfo={algorithm:y[0],parameters:y[1]||null}}else u.contentDomain=y[0]||"";else{if("Proc-Type"!==d.name)throw new Error('Invalid PEM formatted message. The first encapsulated header must be "Proc-Type".');if(2!==d.values.length)throw new Error('Invalid PEM formatted message. The "Proc-Type" header must have two subfields.');u.procType={version:y[0],type:y[1]}}}++f}if("ENCRYPTED"===u.procType&&!u.dekInfo)throw new Error('Invalid PEM formatted message. The "DEK-Info" header must be present if "Proc-Type" is "ENCRYPTED".')}}if(0===t.length)throw new Error("Invalid PEM formatted message.");return t}},,function(e,t,r){"use strict";function n(){var e,t,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",a=r.toStringTag||"@@toStringTag";function s(r,n,o,a){var s=n&&n.prototype instanceof c?n:c,f=Object.create(s.prototype);return i(f,"_invoke",function(r,n,i){var o,a,s,c=0,f=i||[],l=!1,p={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function t(r,n){return o=r,a=0,s=e,p.n=n,u}};function h(r,n){for(a=r,s=n,t=0;!l&&c&&!i&&t<f.length;t++){var i,o=f[t],h=p.p,d=o[2];r>3?(i=d===n)&&(s=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=e):o[0]<=h&&((i=r<2&&h<o[1])?(a=0,p.v=n,p.n=o[1]):h<d&&(i=r<3||o[0]>n||n>d)&&(o[4]=r,o[5]=n,p.n=d,a=0))}if(i||r>1)return u;throw l=!0,n}return function(i,f,d){if(c>1)throw TypeError("Generator is already running");for(l&&1===f&&h(f,d),a=f,s=d;(t=a<2?e:s)||!l;){o||(a?a<3?(a>1&&(p.n=-1),h(a,s)):p.n=s:p.v=s);try{if(c=2,o){if(a||(i="next"),t=o[i]){if(!(t=t.call(o,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,a<2&&(a=0)}else 1===a&&(t=o.return)&&t.call(o),a<2&&(s=TypeError("The iterator does not provide a '"+i+"' method"),a=1);o=e}else if((t=(l=p.n<0)?s:r.call(n,p))!==u)break}catch(t){o=e,a=1,s=t}finally{c=1}}return{value:t,done:l}}}(r,o,a),!0),f}var u={};function c(){}function f(){}function l(){}t=Object.getPrototypeOf;var p=[][o]?t(t([][o]())):(i(t={},o,function(){return this}),t),h=l.prototype=c.prototype=Object.create(p);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,i(e,a,"GeneratorFunction")),e.prototype=Object.create(h),e}return f.prototype=l,i(h,"constructor",l),i(l,"constructor",f),f.displayName="GeneratorFunction",i(l,a,"GeneratorFunction"),i(h),i(h,a,"Generator"),i(h,o,function(){return this}),i(h,"toString",function(){return"[object Generator]"}),(n=function e(){return{w:s,m:d}})()}function i(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}i=function e(t,r,n,a){function s(e,r){i(t,e,function(t){return this._invoke(e,r,t)})}r?o?o(t,r,{value:n,enumerable:!a,configurable:!a,writable:!a}):t[r]=n:(s("next",0),s("throw",1),s("return",2))},i(e,t,r,n)}function o(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function a(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function s(e){o(a,n,i,s,u,"next",e)}function u(e){o(a,n,i,s,u,"throw",e)}s(void 0)})}}var s={};e.exports=s;var u=r(66);Object.assign(s,u);var c=r(175),f=r(182);s.sign=function(){var e=a(n().m(function e(t){var r,i,o,a,s,u,f,l,p=arguments,h;return n().w(function(e){for(;;)switch(e.p=e.n){case 0:return i=(r=p.length>1&&void 0!==p[1]?p[1]:{}).suite,o=r.purpose,a=r.documentLoader,s=r.expansionMap,u=r.compactProof,e.p=1,e.n=2,(new c).add(t,{suite:i,purpose:o,documentLoader:a,expansionMap:s,compactProof:u});case 2:return e.a(2,e.v);case 3:if(e.p=3,h=e.v,a||"jsonld.InvalidUrl"!==h.name){e.n=4;break}throw f=h.details.url,(l=new Error('A URL "'.concat(f,'" could not be fetched; you need to pass ')+'"documentLoader" or resolve the URL before calling "sign".')).cause=h,l;case 4:throw h;case 5:return e.a(2)}},e,null,[[1,3]])}));function t(t){return e.apply(this,arguments)}return t}(),s.verify=function(){var e=a(n().m(function e(t){var r,i,o,a,s,u,l,p,h,d,y=arguments;return n().w(function(e){for(;;)switch(e.n){case 0:return i=(r=y.length>1&&void 0!==y[1]?y[1]:{}).suite,o=r.purpose,a=r.documentLoader,s=r.expansionMap,u=r.compactProof,e.n=1,(new c).verify(t,{suite:i,purpose:o,documentLoader:a,expansionMap:s,compactProof:u});case 1:return l=e.v,(p=l.error)&&(a||"jsonld.InvalidUrl"!==p.name?l.error=new f(p):(h=p.details.url,d=new Error('A URL "'.concat(h,'" could not be fetched; you need to pass ')+'"documentLoader" or resolve the URL before calling "verify".'),l.error=new f(d))),e.a(2,l)}},e)}));function t(t){return e.apply(this,arguments)}return t}(),s.suites=r(183).suites,s.purposes=r(202).purposes,Object.assign(s,r(73)),Object.assign(s,r(129))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MetadataReader=void 0;var n=r(7),i=function(){function e(){}return e.prototype.getConstructorMetadata=function(e){var t,r;return{compilerGeneratedMetadata:Reflect.getMetadata(n.PARAM_TYPES,e),userGeneratedMetadata:Reflect.getMetadata(n.TAGGED,e)||{}}},e.prototype.getPropertiesMetadata=function(e){var t;return Reflect.getMetadata(n.TAGGED_PROP,e)||[]},e}();t.MetadataReader=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isStackOverflowExeption=void 0;var n=r(11);function i(e){return e instanceof RangeError||e.message===n.STACK_OVERFLOW}t.isStackOverflowExeption=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.inject=t.LazyServiceIdentifer=void 0;var n=r(11),i=r(7),o=r(14),a=r(19),s=function(){function e(e){this._cb=e}return e.prototype.unwrap=function(){return this._cb()},e}();function u(e){return function(t,r,s){if(void 0===e)throw new Error(n.UNDEFINED_INJECT_ANNOTATION(t.name));var u=new o.Metadata(i.INJECT_TAG,e);"number"==typeof s?a.tagParameter(t,r,s,u):a.tagProperty(t,r,u)}}t.LazyServiceIdentifer=s,t.inject=u},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Target=void 0;var n=r(7),i=r(24),o=r(14),a=r(94),s=function(){function e(e,t,r,s){this.id=i.id(),this.type=e,this.serviceIdentifier=r,this.name=new a.QueryableString(t||""),this.metadata=new Array;var u=null;"string"==typeof s?u=new o.Metadata(n.NAMED_TAG,s):s instanceof o.Metadata&&(u=s),null!==u&&this.metadata.push(u)}return e.prototype.hasTag=function(e){for(var t=0,r=this.metadata;t<r.length;t++){var n;if(r[t].key===e)return!0}return!1},e.prototype.isArray=function(){return this.hasTag(n.MULTI_INJECT_TAG)},e.prototype.matchesArray=function(e){return this.matchesTag(n.MULTI_INJECT_TAG)(e)},e.prototype.isNamed=function(){return this.hasTag(n.NAMED_TAG)},e.prototype.isTagged=function(){return this.metadata.some(function(e){return n.NON_CUSTOM_TAG_KEYS.every(function(t){return e.key!==t})})},e.prototype.isOptional=function(){return this.matchesTag(n.OPTIONAL_TAG)(!0)},e.prototype.getNamedTag=function(){return this.isNamed()?this.metadata.filter(function(e){return e.key===n.NAMED_TAG})[0]:null},e.prototype.getCustomTags=function(){return this.isTagged()?this.metadata.filter(function(e){return n.NON_CUSTOM_TAG_KEYS.every(function(t){return e.key!==t})}):null},e.prototype.matchesNamedTag=function(e){return this.matchesTag(n.NAMED_TAG)(e)},e.prototype.matchesTag=function(e){var t=this;return function(r){for(var n=0,i=t.metadata;n<i.length;n++){var o=i[n];if(o.key===e&&o.value===r)return!0}return!1}},e}();t.Target=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BindingWhenOnSyntax=void 0;var n=r(46),i=r(47),o=function(){function e(e){this._binding=e,this._bindingWhenSyntax=new i.BindingWhenSyntax(this._binding),this._bindingOnSyntax=new n.BindingOnSyntax(this._binding)}return e.prototype.when=function(e){return this._bindingWhenSyntax.when(e)},e.prototype.whenTargetNamed=function(e){return this._bindingWhenSyntax.whenTargetNamed(e)},e.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},e.prototype.whenTargetTagged=function(e,t){return this._bindingWhenSyntax.whenTargetTagged(e,t)},e.prototype.whenInjectedInto=function(e){return this._bindingWhenSyntax.whenInjectedInto(e)},e.prototype.whenParentNamed=function(e){return this._bindingWhenSyntax.whenParentNamed(e)},e.prototype.whenParentTagged=function(e,t){return this._bindingWhenSyntax.whenParentTagged(e,t)},e.prototype.whenAnyAncestorIs=function(e){return this._bindingWhenSyntax.whenAnyAncestorIs(e)},e.prototype.whenNoAncestorIs=function(e){return this._bindingWhenSyntax.whenNoAncestorIs(e)},e.prototype.whenAnyAncestorNamed=function(e){return this._bindingWhenSyntax.whenAnyAncestorNamed(e)},e.prototype.whenAnyAncestorTagged=function(e,t){return this._bindingWhenSyntax.whenAnyAncestorTagged(e,t)},e.prototype.whenNoAncestorNamed=function(e){return this._bindingWhenSyntax.whenNoAncestorNamed(e)},e.prototype.whenNoAncestorTagged=function(e,t){return this._bindingWhenSyntax.whenNoAncestorTagged(e,t)},e.prototype.whenAnyAncestorMatches=function(e){return this._bindingWhenSyntax.whenAnyAncestorMatches(e)},e.prototype.whenNoAncestorMatches=function(e){return this._bindingWhenSyntax.whenNoAncestorMatches(e)},e.prototype.onActivation=function(e){return this._bindingOnSyntax.onActivation(e)},e}();t.BindingWhenOnSyntax=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.typeConstraint=t.namedConstraint=t.taggedConstraint=t.traverseAncerstors=void 0;var n=r(7),i=r(14),o=function(e,t){var r=e.parentRequest;return null!==r&&(!!t(r)||o(r,t))};t.traverseAncerstors=o;var a=function(e){return function(t){var r=function(r){return null!==r&&null!==r.target&&r.target.matchesTag(e)(t)};return r.metaData=new i.Metadata(e,t),r}};t.taggedConstraint=a;var s=a(n.NAMED_TAG);t.namedConstraint=s;var u=function(e){return function(t){var r=null;if(null!==t){var n;if(r=t.bindings[0],"string"==typeof e)return r.serviceIdentifier===e;var i=t.bindings[0].implementationType;return e===i}return!1}};t.typeConstraint=u},function(e,t){},function(e,t){},function(e,t,r){"use strict";r.d(t,"b",function(){return i}),r.d(t,"a",function(){return o}),r.d(t,"c",function(){return a});var n=r(32),i,o;!function(e){e.JSON="json",e.URLENCODED="urlencoded",e.UTF8="utf8",e.RAW="raw"}(i||(i={})),function(e){e.GET="GET",e.POST="POST",e.PATCH="PATCH",e.DELETE="DELETE",e.PUT="PUT"}(o||(o={}));var a=function(){function e(){this._serializer=i.JSON,this._responseInterceptors=[],this._withBearerToken=!1,this._headers={},this._body={},this._parameters={},this._withUserToken=!1,this._requestInterceptors=[]}return e.fromJSON=function(t){var r=new e.Builder;return t.body&&r.withBody(t.body),t.type&&r.withType(t.type),t.host&&r.withHost(t.host),t.path&&r.withPath(t.path),t.serializer&&r.withSerializer(t.serializer),t.withBearerToken&&r.withBearerToken(t.withBearerToken),t.withUserToken&&r.withUserToken(t.withUserToken),t.headers&&r.headers(t.headers),t.parameters&&r.withParameters(t.parameters),r.build()},Object.defineProperty(e.prototype,"serializer",{get:function(){return this._serializer},set:function(e){this._serializer=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"withBearerToken",{get:function(){return this._withBearerToken},set:function(e){this._withBearerToken=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"body",{get:function(){return this._body},set:function(e){this._body=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"path",{get:function(){return this._path},set:function(e){this._path=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"type",{get:function(){return this._type},set:function(e){this._type=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"responseInterceptors",{get:function(){return this._responseInterceptors},set:function(e){this._responseInterceptors=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"headers",{get:function(){return this._headers},set:function(e){this._headers=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parameters",{get:function(){return this._parameters},set:function(e){this._parameters=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"withUserToken",{get:function(){return this._withUserToken},set:function(e){this._withUserToken=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"requestInterceptors",{get:function(){return this._requestInterceptors},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"host",{get:function(){return this._host},enumerable:!1,configurable:!0}),e.prototype.toJSON=function(){return JSON.stringify({body:this._body,type:this._type,host:this._host,path:this._path,serializer:this._serializer,withBearerToken:this._withBearerToken,withUserToken:this._withUserToken,headers:this._headers,parameters:this._parameters})},e.Builder=function(){function t(){this.request=new e}return t.prototype.withHost=function(e){return this.request._host=e,this},t.prototype.withPath=function(e){return this.request._path=e,this},t.prototype.withType=function(e){return this.request._type=e,this},t.prototype.withResponseInterceptor=function(e){return this.request._responseInterceptors.push(e),this},t.prototype.withRequestInterceptor=function(e){return this.request._requestInterceptors.push(e),this},t.prototype.withHeaders=function(e){return this.request._headers=e,this},t.prototype.withBody=function(e){return this.request._body=e,this},t.prototype.withParameters=function(e){return this.request._parameters=e,this},t.prototype.withBearerToken=function(e){return this.request.withBearerToken=e,this},t.prototype.withUserToken=function(e){return this.request.withUserToken=e,this},t.prototype.withSerializer=function(e){return this.request._serializer=e,this},t.prototype.build=function(){if(!this.request._path)throw new n.a("withPath() is required");if(!this.request._type)throw new n.a("withType() is required");return this.request},t}(),e}()},function(e,t){},function(e,t,r){"use strict";var n;r.d(t,"a",function(){return n}),r.d(t,"b",function(){return i}),function(e){e[e.HTTP_UNAUTHORISED=401]="HTTP_UNAUTHORISED",e[e.HTTP_FORBIDDEN=403]="HTTP_FORBIDDEN",e[e.HTTP_SUCCESS=200]="HTTP_SUCCESS",e[e.HTTP_BAD_REQUEST=400]="HTTP_BAD_REQUEST",e[e.HTTP_KONG_FAILURE=447]="HTTP_KONG_FAILURE",e[e.HTTP_INTERNAL_SERVER_ERROR=500]="HTTP_INTERNAL_SERVER_ERROR"}(n||(n={}));var i=function(){function e(){}return Object.defineProperty(e.prototype,"responseCode",{get:function(){return this._responseCode},set:function(e){this._responseCode=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"errorMesg",{get:function(){return this._errorMesg},set:function(e){this._errorMesg=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"body",{get:function(){return this._body},set:function(e){this._body=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"headers",{get:function(){return this._headers},set:function(e){this._headers=e},enumerable:!1,configurable:!0}),e.prototype.toJSON=function(){return JSON.stringify({responseCode:this._responseCode,errorMesg:this._errorMesg,body:this._body,headers:this._headers})},e}()},function(e,t){},function(e,t,r){"use strict";var n,i=r(70).constants;e.exports={SECURITY_CONTEXT_URL:i.SECURITY_CONTEXT_V2_URL,SECURITY_CONTEXT_V1_URL:i.SECURITY_CONTEXT_V1_URL,SECURITY_CONTEXT_V2_URL:i.SECURITY_CONTEXT_V2_URL,SECURITY_PROOF_URL:"https://w3id.org/security#proof",SECURITY_SIGNATURE_URL:"https://w3id.org/security#signature"}},function(t,r){t.exports=e},function(e,t,r){var n=r(4),i;r(37),r(8),(e.exports=n.hmac=n.hmac||{}).create=function(){var e=null,t=null,r=null,i=null,o={start:function(o,a){if(null!==o)if("string"==typeof o){if(!((o=o.toLowerCase())in n.md.algorithms))throw new Error('Unknown hash algorithm "'+o+'"');t=n.md.algorithms[o].create()}else t=o;if(null===a)a=e;else{if("string"==typeof a)a=n.util.createBuffer(a);else if(n.util.isArray(a)){var s=a;a=n.util.createBuffer();for(var u=0;u<s.length;++u)a.putByte(s[u])}var c=a.length();c>t.blockLength&&(t.start(),t.update(a.bytes()),a=t.digest()),r=n.util.createBuffer(),i=n.util.createBuffer(),c=a.length();for(var u=0;u<c;++u){var s=a.at(u);r.putByte(54^s),i.putByte(92^s)}if(c<t.blockLength)for(var s=t.blockLength-c,u=0;u<s;++u)r.putByte(54),i.putByte(92);e=a,r=r.bytes(),i=i.bytes()}t.start(),t.update(r)},update:function(e){t.update(e)},getMac:function(){var e=t.digest().bytes();return t.start(),t.update(i),t.update(e),t.digest()}};return o.digest=o.getMac,o}},function(e,t,r){var n=r(4);r(37),r(8);var i=e.exports=n.sha1=n.sha1||{};n.md.sha1=n.md.algorithms.sha1=i,i.create=function(){a||s();var e=null,t=n.util.createBuffer(),r=new Array(80),i={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){i.messageLength=0,i.fullMessageLength=i.messageLength64=[];for(var r=i.messageLengthSize/4,o=0;o<r;++o)i.fullMessageLength.push(0);return t=n.util.createBuffer(),e={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878,h4:3285377520},i}};return i.start(),i.update=function(o,a){"utf8"===a&&(o=n.util.encodeUtf8(o));var s=o.length;i.messageLength+=s,s=[s/4294967296>>>0,s>>>0];for(var c=i.fullMessageLength.length-1;c>=0;--c)i.fullMessageLength[c]+=s[1],s[1]=s[0]+(i.fullMessageLength[c]/4294967296>>>0),i.fullMessageLength[c]=i.fullMessageLength[c]>>>0,s[0]=s[1]/4294967296>>>0;return t.putBytes(o),u(e,r,t),(t.read>2048||0===t.length())&&t.compact(),i},i.digest=function(){var a=n.util.createBuffer();a.putBytes(t.bytes());var s,c=i.fullMessageLength[i.fullMessageLength.length-1]+i.messageLengthSize&i.blockLength-1,f,l;a.putBytes(o.substr(0,i.blockLength-c));for(var p=8*i.fullMessageLength[0],h=0;h<i.fullMessageLength.length-1;++h)p+=l=(f=8*i.fullMessageLength[h+1])/4294967296>>>0,a.putInt32(p>>>0),p=f>>>0;a.putInt32(p);var d={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4};u(d,r,a);var y=n.util.createBuffer();return y.putInt32(d.h0),y.putInt32(d.h1),y.putInt32(d.h2),y.putInt32(d.h3),y.putInt32(d.h4),y},i};var o=null,a=!1;function s(){o=String.fromCharCode(128),o+=n.util.fillString(String.fromCharCode(0),64),a=!0}function u(e,t,r){for(var n,i,o,a,s,u,c,f,l=r.length();l>=64;){for(i=e.h0,o=e.h1,a=e.h2,s=e.h3,u=e.h4,f=0;f<16;++f)n=r.getInt32(),t[f]=n,n=(i<<5|i>>>27)+(c=s^o&(a^s))+u+1518500249+n,u=s,s=a,a=(o<<30|o>>>2)>>>0,o=i,i=n;for(;f<20;++f)n=(n=t[f-3]^t[f-8]^t[f-14]^t[f-16])<<1|n>>>31,t[f]=n,n=(i<<5|i>>>27)+(c=s^o&(a^s))+u+1518500249+n,u=s,s=a,a=(o<<30|o>>>2)>>>0,o=i,i=n;for(;f<32;++f)n=(n=t[f-3]^t[f-8]^t[f-14]^t[f-16])<<1|n>>>31,t[f]=n,n=(i<<5|i>>>27)+(c=o^a^s)+u+1859775393+n,u=s,s=a,a=(o<<30|o>>>2)>>>0,o=i,i=n;for(;f<40;++f)n=(n=t[f-6]^t[f-16]^t[f-28]^t[f-32])<<2|n>>>30,t[f]=n,n=(i<<5|i>>>27)+(c=o^a^s)+u+1859775393+n,u=s,s=a,a=(o<<30|o>>>2)>>>0,o=i,i=n;for(;f<60;++f)n=(n=t[f-6]^t[f-16]^t[f-28]^t[f-32])<<2|n>>>30,t[f]=n,n=(i<<5|i>>>27)+(c=o&a|s&(o^a))+u+2400959708+n,u=s,s=a,a=(o<<30|o>>>2)>>>0,o=i,i=n;for(;f<80;++f)n=(n=t[f-6]^t[f-16]^t[f-28]^t[f-32])<<2|n>>>30,t[f]=n,n=(i<<5|i>>>27)+(c=o^a^s)+u+3395469782+n,u=s,s=a,a=(o<<30|o>>>2)>>>0,o=i,i=n;e.h0=e.h0+i|0,e.h1=e.h1+o|0,e.h2=e.h2+a|0,e.h3=e.h3+s|0,e.h4=e.h4+u|0,l-=64}}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function i(e,t){return e(t={exports:{}},t.exports),t.exports}r.r(t),r.d(t,"constants",function(){return u}),r.d(t,"contexts",function(){return s});var o=i(function(e,t){!function(e,t){for(var r in t)e[r]=t[r]}(t,function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0)}([function(e,t,r){const n=t.contexts=new Map,i=t.constants=r(1);n.set(i.SECURITY_CONTEXT_V1_URL,r(2)),n.set(i.SECURITY_CONTEXT_V2_URL,r(3))},function(e,t,r){t.SECURITY_CONTEXT_V1_URL="https://w3id.org/security/v1",t.SECURITY_CONTEXT_V2_URL="https://w3id.org/security/v2"},function(e,t){e.exports={"@context":{id:"@id",type:"@type",dc:"http://purl.org/dc/terms/",sec:"https://w3id.org/security#",xsd:"http://www.w3.org/2001/XMLSchema#",EcdsaKoblitzSignature2016:"sec:EcdsaKoblitzSignature2016",Ed25519Signature2018:"sec:Ed25519Signature2018",EncryptedMessage:"sec:EncryptedMessage",GraphSignature2012:"sec:GraphSignature2012",LinkedDataSignature2015:"sec:LinkedDataSignature2015",LinkedDataSignature2016:"sec:LinkedDataSignature2016",CryptographicKey:"sec:Key",authenticationTag:"sec:authenticationTag",canonicalizationAlgorithm:"sec:canonicalizationAlgorithm",cipherAlgorithm:"sec:cipherAlgorithm",cipherData:"sec:cipherData",cipherKey:"sec:cipherKey",created:{"@id":"dc:created","@type":"xsd:dateTime"},creator:{"@id":"dc:creator","@type":"@id"},digestAlgorithm:"sec:digestAlgorithm",digestValue:"sec:digestValue",domain:"sec:domain",encryptionKey:"sec:encryptionKey",expiration:{"@id":"sec:expiration","@type":"xsd:dateTime"},expires:{"@id":"sec:expiration","@type":"xsd:dateTime"},initializationVector:"sec:initializationVector",iterationCount:"sec:iterationCount",nonce:"sec:nonce",normalizationAlgorithm:"sec:normalizationAlgorithm",owner:{"@id":"sec:owner","@type":"@id"},password:"sec:password",privateKey:{"@id":"sec:privateKey","@type":"@id"},privateKeyPem:"sec:privateKeyPem",publicKey:{"@id":"sec:publicKey","@type":"@id"},publicKeyBase58:"sec:publicKeyBase58",publicKeyPem:"sec:publicKeyPem",publicKeyWif:"sec:publicKeyWif",publicKeyService:{"@id":"sec:publicKeyService","@type":"@id"},revoked:{"@id":"sec:revoked","@type":"xsd:dateTime"},salt:"sec:salt",signature:"sec:signature",signatureAlgorithm:"sec:signingAlgorithm",signatureValue:"sec:signatureValue"}}},function(e,t){e.exports={"@context":[{"@version":1.1},"https://w3id.org/security/v1",{AesKeyWrappingKey2019:"sec:AesKeyWrappingKey2019",DeleteKeyOperation:"sec:DeleteKeyOperation",DeriveSecretOperation:"sec:DeriveSecretOperation",EcdsaSecp256k1Signature2019:"sec:EcdsaSecp256k1Signature2019",EcdsaSecp256r1Signature2019:"sec:EcdsaSecp256r1Signature2019",EcdsaSecp256k1VerificationKey2019:"sec:EcdsaSecp256k1VerificationKey2019",EcdsaSecp256r1VerificationKey2019:"sec:EcdsaSecp256r1VerificationKey2019",Ed25519Signature2018:"sec:Ed25519Signature2018",Ed25519VerificationKey2018:"sec:Ed25519VerificationKey2018",EquihashProof2018:"sec:EquihashProof2018",ExportKeyOperation:"sec:ExportKeyOperation",GenerateKeyOperation:"sec:GenerateKeyOperation",KmsOperation:"sec:KmsOperation",RevokeKeyOperation:"sec:RevokeKeyOperation",RsaSignature2018:"sec:RsaSignature2018",RsaVerificationKey2018:"sec:RsaVerificationKey2018",Sha256HmacKey2019:"sec:Sha256HmacKey2019",SignOperation:"sec:SignOperation",UnwrapKeyOperation:"sec:UnwrapKeyOperation",VerifyOperation:"sec:VerifyOperation",WrapKeyOperation:"sec:WrapKeyOperation",X25519KeyAgreementKey2019:"sec:X25519KeyAgreementKey2019",allowedAction:"sec:allowedAction",assertionMethod:{"@id":"sec:assertionMethod","@type":"@id","@container":"@set"},authentication:{"@id":"sec:authenticationMethod","@type":"@id","@container":"@set"},capability:{"@id":"sec:capability","@type":"@id"},capabilityAction:"sec:capabilityAction",capabilityChain:{"@id":"sec:capabilityChain","@type":"@id","@container":"@list"},capabilityDelegation:{"@id":"sec:capabilityDelegationMethod","@type":"@id","@container":"@set"},capabilityInvocation:{"@id":"sec:capabilityInvocationMethod","@type":"@id","@container":"@set"},caveat:{"@id":"sec:caveat","@type":"@id","@container":"@set"},challenge:"sec:challenge",ciphertext:"sec:ciphertext",controller:{"@id":"sec:controller","@type":"@id"},delegator:{"@id":"sec:delegator","@type":"@id"},equihashParameterK:{"@id":"sec:equihashParameterK","@type":"xsd:integer"},equihashParameterN:{"@id":"sec:equihashParameterN","@type":"xsd:integer"},invocationTarget:{"@id":"sec:invocationTarget","@type":"@id"},invoker:{"@id":"sec:invoker","@type":"@id"},jws:"sec:jws",keyAgreement:{"@id":"sec:keyAgreementMethod","@type":"@id","@container":"@set"},kmsModule:{"@id":"sec:kmsModule"},parentCapability:{"@id":"sec:parentCapability","@type":"@id"},plaintext:"sec:plaintext",proof:{"@id":"sec:proof","@type":"@id","@container":"@graph"},proofPurpose:{"@id":"sec:proofPurpose","@type":"@vocab"},proofValue:"sec:proofValue",referenceId:"sec:referenceId",unwrappedKey:"sec:unwrappedKey",verificationMethod:{"@id":"sec:verificationMethod","@type":"@id"},verifyData:"sec:verifyData",wrappedKey:"sec:wrappedKey"}]}}]))}),a=n(o),s=o.contexts,u=o.constants;t.default=a},,function(e,t,r){"use strict";function n(){var e,t,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",a=r.toStringTag||"@@toStringTag";function s(r,n,o,a){var s=n&&n.prototype instanceof c?n:c,f=Object.create(s.prototype);return i(f,"_invoke",function(r,n,i){var o,a,s,c=0,f=i||[],l=!1,p={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function t(r,n){return o=r,a=0,s=e,p.n=n,u}};function h(r,n){for(a=r,s=n,t=0;!l&&c&&!i&&t<f.length;t++){var i,o=f[t],h=p.p,d=o[2];r>3?(i=d===n)&&(s=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=e):o[0]<=h&&((i=r<2&&h<o[1])?(a=0,p.v=n,p.n=o[1]):h<d&&(i=r<3||o[0]>n||n>d)&&(o[4]=r,o[5]=n,p.n=d,a=0))}if(i||r>1)return u;throw l=!0,n}return function(i,f,d){if(c>1)throw TypeError("Generator is already running");for(l&&1===f&&h(f,d),a=f,s=d;(t=a<2?e:s)||!l;){o||(a?a<3?(a>1&&(p.n=-1),h(a,s)):p.n=s:p.v=s);try{if(c=2,o){if(a||(i="next"),t=o[i]){if(!(t=t.call(o,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,a<2&&(a=0)}else 1===a&&(t=o.return)&&t.call(o),a<2&&(s=TypeError("The iterator does not provide a '"+i+"' method"),a=1);o=e}else if((t=(l=p.n<0)?s:r.call(n,p))!==u)break}catch(t){o=e,a=1,s=t}finally{c=1}}return{value:t,done:l}}}(r,o,a),!0),f}var u={};function c(){}function f(){}function l(){}t=Object.getPrototypeOf;var p=[][o]?t(t([][o]())):(i(t={},o,function(){return this}),t),h=l.prototype=c.prototype=Object.create(p);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,i(e,a,"GeneratorFunction")),e.prototype=Object.create(h),e}return f.prototype=l,i(h,"constructor",l),i(l,"constructor",f),f.displayName="GeneratorFunction",i(l,a,"GeneratorFunction"),i(h),i(h,a,"Generator"),i(h,o,function(){return this}),i(h,"toString",function(){return"[object Generator]"}),(n=function e(){return{w:s,m:d}})()}function i(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}i=function e(t,r,n,a){function s(e,r){i(t,e,function(t){return this._invoke(e,r,t)})}r?o?o(t,r,{value:n,enumerable:!a,configurable:!a,writable:!a}):t[r]=n:(s("next",0),s("throw",1),s("return",2))},i(e,t,r,n)}function o(e,t,r){return(t=p(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function s(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var o=e.apply(t,r);function s(e){a(o,n,i,s,u,"next",e)}function u(e){a(o,n,i,s,u,"throw",e)}s(void 0)})}}function u(e){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u(e)}function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,p(n.key),n)}}function l(e,t,r){return t&&f(e.prototype,t),r&&f(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function p(e){var t=h(e,"string");return"symbol"==u(t)?t:t+""}function h(e,t){if("object"!=u(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=u(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function d(e,t,r){return t=T(t),y(e,v()?Reflect.construct(t,r||[],T(e).constructor):t.apply(e,r))}function y(e,t){if(t&&("object"==u(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return g(e)}function g(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function v(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(v=function t(){return!!e})()}function m(e,t,r,n){var i=b(T(1&n?e.prototype:e),t,r);return 2&n&&"function"==typeof i?function(e){return i.apply(r,e)}:i}function b(){return b="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=E(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}},b.apply(null,arguments)}function E(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=T(e)););return e}function T(e){return T=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},T(e)}function S(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&w(e,t)}function w(e,t){return w=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},w(e,t)}var C=r(66),_=r(67),I=r(131);e.exports=function(e){function t(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=r.term,i=r.controller,o=r.date,a=r.maxTimestampDelta,s=void 0===a?1/0:a;if(c(this,t),e=d(this,t,[{term:n,date:o,maxTimestampDelta:s}]),void 0!==i){if("object"!==u(i))throw new TypeError('"controller" must be an object.');e.controller=i}return e}return S(t,e),l(t,[{key:"validate",value:function(){var e=s(n().m(function e(r,i){var a,s,c,f,l,p,h,d,y,g,v;return n().w(function(e){for(;;)switch(e.p=e.n){case 0:return a=i.verificationMethod,s=i.documentLoader,c=i.expansionMap,e.p=1,e.n=2,m(t,"validate",this,3)([r,{verificationMethod:a,documentLoader:s,expansionMap:c}]);case 2:if((f=e.v).valid){e.n=3;break}throw f.error;case 3:if(l=a.id,!this.controller){e.n=4;break}f.controller=this.controller,e.n=13;break;case 4:if(p=a.controller,h=a.owner,!p){e.n=8;break}if("object"!==u(p)){e.n=5;break}d=p.id,e.n=7;break;case 5:if("string"==typeof p){e.n=6;break}throw new TypeError('"controller" must be a string representing a URL.');case 6:d=p;case 7:e.n=11;break;case 8:if(!h){e.n=11;break}if("object"!==u(h)){e.n=9;break}d=h.id,e.n=11;break;case 9:if("string"==typeof h){e.n=10;break}throw new TypeError('"owner" must be a string representing a URL.');case 10:d=h;case 11:return e.n=12,_.frame(d,o({"@context":C.SECURITY_CONTEXT_URL,id:d},this.term,{"@embed":"@never",id:l}),{documentLoader:s,compactToRelative:!1});case 12:y=e.v,f.controller=y;case 13:if(g=_.getValues(f.controller,this.term),f.valid=g.some(function(e){return e===l||"object"===u(e)&&e.id===l}),f.valid){e.n=14;break}throw new Error('Verification method "'.concat(a.id,'" not authorized ')+'by controller for proof purpose "'.concat(this.term,'".'));case 14:return e.a(2,f);case 15:return e.p=15,v=e.v,e.a(2,{valid:!1,error:v})}},e,this,[[1,15]])}));function r(t,r){return e.apply(this,arguments)}return r}()}])}(I)},function(e,r){e.exports=t},function(e,t){},function(e,t,r){var n=r(4);function i(e,t){var r=function(){return new n.des.Algorithm(e,t)};n.cipher.registerAlgorithm(e,r)}r(118),r(135),r(8),e.exports=n.des=n.des||{},n.des.startEncrypting=function(e,t,r,n){var i=y({key:e,output:r,decrypt:!1,mode:n||(null===t?"ECB":"CBC")});return i.start(t),i},n.des.createEncryptionCipher=function(e,t){return y({key:e,output:null,decrypt:!1,mode:t})},n.des.startDecrypting=function(e,t,r,n){var i=y({key:e,output:r,decrypt:!0,mode:n||(null===t?"ECB":"CBC")});return i.start(t),i},n.des.createDecryptionCipher=function(e,t){return y({key:e,output:null,decrypt:!0,mode:t})},n.des.Algorithm=function(e,t){var r=this;r.name=e,r.mode=new t({blockSize:8,cipher:{encrypt:function(e,t){return d(r._keys,e,t,!1)},decrypt:function(e,t){return d(r._keys,e,t,!0)}}}),r._init=!1},n.des.Algorithm.prototype.initialize=function(e){if(!this._init){var t=n.util.createBuffer(e.key);if(0===this.name.indexOf("3DES")&&24!==t.length())throw new Error("Invalid Triple-DES key size: "+8*t.length());this._keys=h(t),this._init=!0}},i("DES-ECB",n.cipher.modes.ecb),i("DES-CBC",n.cipher.modes.cbc),i("DES-CFB",n.cipher.modes.cfb),i("DES-OFB",n.cipher.modes.ofb),i("DES-CTR",n.cipher.modes.ctr),i("3DES-ECB",n.cipher.modes.ecb),i("3DES-CBC",n.cipher.modes.cbc),i("3DES-CFB",n.cipher.modes.cfb),i("3DES-OFB",n.cipher.modes.ofb),i("3DES-CTR",n.cipher.modes.ctr);var o=[16843776,0,65536,16843780,16842756,66564,4,65536,1024,16843776,16843780,1024,16778244,16842756,16777216,4,1028,16778240,16778240,66560,66560,16842752,16842752,16778244,65540,16777220,16777220,65540,0,1028,66564,16777216,65536,16843780,4,16842752,16843776,16777216,16777216,1024,16842756,65536,66560,16777220,1024,4,16778244,66564,16843780,65540,16842752,16778244,16777220,1028,66564,16843776,1028,16778240,16778240,0,65540,66560,0,16842756],a=[-2146402272,-2147450880,32768,1081376,1048576,32,-2146435040,-2147450848,-2147483616,-2146402272,-2146402304,-2147483648,-2147450880,1048576,32,-2146435040,1081344,1048608,-2147450848,0,-2147483648,32768,1081376,-2146435072,1048608,-2147483616,0,1081344,32800,-2146402304,-2146435072,32800,0,1081376,-2146435040,1048576,-2147450848,-2146435072,-2146402304,32768,-2146435072,-2147450880,32,-2146402272,1081376,32,32768,-2147483648,32800,-2146402304,1048576,-2147483616,1048608,-2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],s=[520,134349312,0,134348808,134218240,0,131592,134218240,131080,134217736,134217736,131072,134349320,131080,134348800,520,134217728,8,134349312,512,131584,134348800,134348808,131592,134218248,131584,131072,134218248,8,134349320,512,134217728,134349312,134217728,131080,520,131072,134349312,134218240,0,512,131080,134349320,134218240,134217736,512,0,134348808,134218248,131072,134217728,134349320,8,131592,131584,134217736,134348800,134218248,520,134348800,131592,8,134348808,131584],u=[8396801,8321,8321,128,8396928,8388737,8388609,8193,0,8396800,8396800,8396929,129,0,8388736,8388609,1,8192,8388608,8396801,128,8388608,8193,8320,8388737,1,8320,8388736,8192,8396928,8396929,129,8388736,8388609,8396800,8396929,129,0,0,8396800,8320,8388736,8388737,1,8396801,8321,8321,128,8396929,129,1,8192,8388609,8193,8396928,8388737,8193,8320,8388608,8396801,128,8388608,8192,8396928],c=[256,34078976,34078720,1107296512,524288,256,1073741824,34078720,1074266368,524288,33554688,1074266368,1107296512,1107820544,524544,1073741824,33554432,1074266112,1074266112,0,1073742080,1107820800,1107820800,33554688,1107820544,1073742080,0,1107296256,34078976,33554432,1107296256,524544,524288,1107296512,256,33554432,1073741824,34078720,1107296512,1074266368,33554688,1073741824,1107820544,34078976,1074266368,256,33554432,1107820544,1107820800,524544,1107296256,1107820800,34078720,0,1074266112,1107296256,524544,33554688,1073742080,524288,0,1074266112,34078976,1073742080],f=[536870928,541065216,16384,541081616,541065216,16,541081616,4194304,536887296,4210704,4194304,536870928,4194320,536887296,536870912,16400,0,4194320,536887312,16384,4210688,536887312,16,541065232,541065232,0,4210704,541081600,16400,4210688,541081600,536870912,536887296,16,541065232,4210688,541081616,4194304,16400,536870928,4194304,536887296,536870912,16400,536870928,541081616,4210688,541065216,4210704,541081600,0,541065232,16,16384,541065216,4210704,16384,4194320,536887312,0,541081600,536870912,4194320,536887312],l=[2097152,69206018,67110914,0,2048,67110914,2099202,69208064,69208066,2097152,0,67108866,2,67108864,69206018,2050,67110912,2099202,2097154,67110912,67108866,69206016,69208064,2097154,69206016,2048,2050,69208066,2099200,2,67108864,2099200,67108864,2099200,2097152,67110914,67110914,69206018,69206018,2,2097154,67108864,67110912,2097152,69208064,2050,2099202,69208064,2050,67108866,69208066,69206016,2099200,0,2,69208066,0,2099202,69206016,2048,67108866,67110912,2048,2097154],p=[268439616,4096,262144,268701760,268435456,268439616,64,268435456,262208,268697600,268701760,266240,268701696,266304,4096,64,268697600,268435520,268439552,4160,266240,262208,268697664,268701696,4160,0,0,268697664,268435520,268439552,266304,262144,266304,262144,268701696,4096,64,268697664,4096,266304,268439552,64,268435520,268697600,268697664,268435456,262144,268439616,0,268701760,262208,268435520,268697600,268439552,268439616,0,268701760,266240,266240,4160,4160,262208,268435456,268701696];function h(e){for(var t=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],r=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],n=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],i=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],o=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],a=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],s=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],u=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],c=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],f=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],l=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],p=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],h=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],d=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],y=e.length()>8?3:1,g=[],v=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],m=0,b,E=0;E<y;E++){var T=e.getInt32(),S=e.getInt32();T^=(b=252645135&(T>>>4^S))<<4,T^=b=65535&((S^=b)>>>-16^T),T^=(b=858993459&(T>>>2^(S^=b<<-16)))<<2,T^=b=65535&((S^=b)>>>-16^T),T^=(b=1431655765&(T>>>1^(S^=b<<-16)))<<1,T^=b=16711935&((S^=b)>>>8^T),b=(T^=(b=1431655765&(T>>>1^(S^=b<<8)))<<1)<<8|(S^=b)>>>20&240,T=S<<24|S<<8&16711680|S>>>8&65280|S>>>24&240,S=b;for(var w=0;w<v.length;++w){v[w]?(T=T<<2|T>>>26,S=S<<2|S>>>26):(T=T<<1|T>>>27,S=S<<1|S>>>27);var C=t[(T&=-15)>>>28]|r[T>>>24&15]|n[T>>>20&15]|i[T>>>16&15]|o[T>>>12&15]|a[T>>>8&15]|s[T>>>4&15],_=u[(S&=-15)>>>28]|c[S>>>24&15]|f[S>>>20&15]|l[S>>>16&15]|p[S>>>12&15]|h[S>>>8&15]|d[S>>>4&15];b=65535&(_>>>16^C),g[m++]=C^b,g[m++]=_^b<<16}}return g}function d(e,t,r,n){var i=32===e.length?3:9,h,d;h=3===i?n?[30,-2,-2]:[0,32,2]:n?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2];var y=t[0],g=t[1];y^=(d=252645135&(y>>>4^g))<<4,y^=(d=65535&(y>>>16^(g^=d)))<<16,y^=d=858993459&((g^=d)>>>2^y),y^=d=16711935&((g^=d<<2)>>>8^y),y=(y^=(d=1431655765&(y>>>1^(g^=d<<8)))<<1)<<1|y>>>31,g=(g^=d)<<1|g>>>31;for(var v=0;v<i;v+=3){for(var m=h[v+1],b=h[v+2],E=h[v];E!=m;E+=b){var T=g^e[E],S=(g>>>4|g<<28)^e[E+1];d=y,y=g,g=d^(a[T>>>24&63]|u[T>>>16&63]|f[T>>>8&63]|p[63&T]|o[S>>>24&63]|s[S>>>16&63]|c[S>>>8&63]|l[63&S])}d=y,y=g,g=d}g=g>>>1|g<<31,g^=d=1431655765&((y=y>>>1|y<<31)>>>1^g),g^=(d=16711935&(g>>>8^(y^=d<<1)))<<8,g^=(d=858993459&(g>>>2^(y^=d)))<<2,g^=d=65535&((y^=d)>>>16^g),g^=d=252645135&((y^=d<<16)>>>4^g),y^=d<<4,r[0]=y,r[1]=g}function y(e){var t,r="DES-"+((e=e||{}).mode||"CBC").toUpperCase(),i,o=(i=e.decrypt?n.cipher.createDecipher(r,e.key):n.cipher.createCipher(r,e.key)).start;return i.start=function(e,t){var r=null;t instanceof n.util.ByteBuffer&&(r=t,t={}),(t=t||{}).output=r,t.iv=e,o.call(i,t)},i}},function(e,t,r){var n=r(4);if(r(33),r(77),r(49),r(142),r(143),r(31),r(8),void 0===i)var i=n.jsbn.BigInteger;var o=n.util.isNodejs?r(121):null,a=n.asn1,s=n.util;n.pki=n.pki||{},e.exports=n.pki.rsa=n.rsa=n.rsa||{};var u=n.pki,c=[6,4,2,4,2,4,6,2],f={name:"PrivateKeyInfo",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:a.Class.UNIVERSAL,type:a.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:a.Class.UNIVERSAL,type:a.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},l={name:"RSAPrivateKey",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},p={name:"RSAPublicKey",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},h=n.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:a.Class.UNIVERSAL,type:a.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:a.Class.UNIVERSAL,type:a.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},d=function(e){var t;if(!(e.algorithm in u.oids)){var r=new Error("Unknown message digest algorithm.");throw r.algorithm=e.algorithm,r}t=u.oids[e.algorithm];var n=a.oidToDer(t).getBytes(),i=a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[]),o=a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[]);o.value.push(a.create(a.Class.UNIVERSAL,a.Type.OID,!1,n)),o.value.push(a.create(a.Class.UNIVERSAL,a.Type.NULL,!1,""));var s=a.create(a.Class.UNIVERSAL,a.Type.OCTETSTRING,!1,e.digest().getBytes());return i.value.push(o),i.value.push(s),a.toDer(i).getBytes()},y=function(e,t,r){if(r)return e.modPow(t.e,t.n);if(!t.p||!t.q)return e.modPow(t.d,t.n);var o;t.dP||(t.dP=t.d.mod(t.p.subtract(i.ONE))),t.dQ||(t.dQ=t.d.mod(t.q.subtract(i.ONE))),t.qInv||(t.qInv=t.q.modInverse(t.p));do{o=new i(n.util.bytesToHex(n.random.getBytes(t.n.bitLength()/8)),16)}while(o.compareTo(t.n)>=0||!o.gcd(t.n).equals(i.ONE));for(var a=(e=e.multiply(o.modPow(t.e,t.n)).mod(t.n)).mod(t.p).modPow(t.dP,t.p),s=e.mod(t.q).modPow(t.dQ,t.q);a.compareTo(s)<0;)a=a.add(t.p);var u=a.subtract(s).multiply(t.qInv).mod(t.p).multiply(t.q).add(s);return u=u.multiply(o.modInverse(t.n)).mod(t.n)};function g(e,t,r){var i=n.util.createBuffer(),o=Math.ceil(t.n.bitLength()/8);if(e.length>o-11){var a=new Error("Message is too long for PKCS#1 v1.5 padding.");throw a.length=e.length,a.max=o-11,a}i.putByte(0),i.putByte(r);var s=o-3-e.length,u;if(0===r||1===r){u=0===r?0:255;for(var c=0;c<s;++c)i.putByte(u)}else for(;s>0;){for(var f=0,l=n.random.getBytes(s),c=0;c<s;++c)0===(u=l.charCodeAt(c))?++f:i.putByte(u);s=f}return i.putByte(0),i.putBytes(e),i}function v(e,t,r,i){var o=Math.ceil(t.n.bitLength()/8),a=n.util.createBuffer(e),s=a.getByte(),u=a.getByte();if(0!==s||r&&0!==u&&1!==u||!r&&2!=u||r&&0===u&&void 0===i)throw new Error("Encryption block is invalid.");var c=0,f;if(0===u){c=o-3-i;for(var l=0;l<c;++l)if(0!==a.getByte())throw new Error("Encryption block is invalid.")}else if(1===u)for(c=0;a.length()>1;){if(255!==a.getByte()){--a.read;break}++c}else if(2===u)for(c=0;a.length()>1;){if(0===a.getByte()){--a.read;break}++c}if(0!==a.getByte()||c!==o-3-a.length())throw new Error("Encryption block is invalid.");return a.getBytes()}function m(e,t,r){"function"==typeof t&&(r=t,t={});var o={algorithm:{name:(t=t||{}).algorithm||"PRIMEINC",options:{workers:t.workers||2,workLoad:t.workLoad||100,workerScript:t.workerScript}}};function a(){s(e.pBits,function(t,n){return t?r(t):(e.p=n,null!==e.q?c(t,e.q):void s(e.qBits,c))})}function s(e,t){n.prime.generateProbablePrime(e,o,t)}function c(t,n){if(t)return r(t);if(e.q=n,e.p.compareTo(e.q)<0){var o=e.p;e.p=e.q,e.q=o}if(0!==e.p.subtract(i.ONE).gcd(e.e).compareTo(i.ONE))return e.p=null,void a();if(0!==e.q.subtract(i.ONE).gcd(e.e).compareTo(i.ONE))return e.q=null,void s(e.qBits,c);if(e.p1=e.p.subtract(i.ONE),e.q1=e.q.subtract(i.ONE),e.phi=e.p1.multiply(e.q1),0!==e.phi.gcd(e.e).compareTo(i.ONE))return e.p=e.q=null,void a();if(e.n=e.p.multiply(e.q),e.n.bitLength()!==e.bits)return e.q=null,void s(e.qBits,c);var f=e.e.modInverse(e.phi);e.keys={privateKey:u.rsa.setPrivateKey(e.n,e.e,f,e.p,e.q,f.mod(e.p1),f.mod(e.q1),e.q.modInverse(e.p)),publicKey:u.rsa.setPublicKey(e.n,e.e)},r(null,e.keys)}"prng"in t&&(o.prng=t.prng),a()}function b(e){var t=e.toString(16);t[0]>="8"&&(t="00"+t);var r=n.util.hexToBytes(t);return!(r.length>1)||(0!==r.charCodeAt(0)||128&r.charCodeAt(1))&&(255!==r.charCodeAt(0)||128&~r.charCodeAt(1))?r:r.substr(1)}function E(e){return e<=100?27:e<=150?18:e<=200?15:e<=250?12:e<=300?9:e<=350?8:e<=400?7:e<=500?6:e<=600?5:e<=800?4:e<=1250?3:2}function T(e){return n.util.isNodejs&&"function"==typeof o[e]}function S(e){return void 0!==s.globalScope&&"object"==typeof s.globalScope.crypto&&"object"==typeof s.globalScope.crypto.subtle&&"function"==typeof s.globalScope.crypto.subtle[e]}function w(e){return void 0!==s.globalScope&&"object"==typeof s.globalScope.msCrypto&&"object"==typeof s.globalScope.msCrypto.subtle&&"function"==typeof s.globalScope.msCrypto.subtle[e]}function C(e){for(var t=n.util.hexToBytes(e.toString(16)),r=new Uint8Array(t.length),i=0;i<t.length;++i)r[i]=t.charCodeAt(i);return r}function _(e){if("RSA"!==e.kty)throw new Error('Unsupported key algorithm "'+e.kty+'"; algorithm must be "RSA".');return u.setRsaPrivateKey(A(e.n),A(e.e),A(e.d),A(e.p),A(e.q),A(e.dp),A(e.dq),A(e.qi))}function I(e){if("RSA"!==e.kty)throw new Error('Key algorithm must be "RSA".');return u.setRsaPublicKey(A(e.n),A(e.e))}function A(e){return new i(n.util.bytesToHex(n.util.decode64(e)),16)}u.rsa.encrypt=function(e,t,r){var o=r,a,s=Math.ceil(t.n.bitLength()/8);!1!==r&&!0!==r?(o=2===r,a=g(e,t,r)):(a=n.util.createBuffer()).putBytes(e);for(var u=new i(a.toHex(),16),c,f=y(u,t,o).toString(16),l=n.util.createBuffer(),p=s-Math.ceil(f.length/2);p>0;)l.putByte(0),--p;return l.putBytes(n.util.hexToBytes(f)),l.getBytes()},u.rsa.decrypt=function(e,t,r,o){var a=Math.ceil(t.n.bitLength()/8);if(e.length!==a){var s=new Error("Encrypted message length is invalid.");throw s.length=e.length,s.expected=a,s}var u=new i(n.util.createBuffer(e).toHex(),16);if(u.compareTo(t.n)>=0)throw new Error("Encrypted message is invalid.");for(var c,f=y(u,t,r).toString(16),l=n.util.createBuffer(),p=a-Math.ceil(f.length/2);p>0;)l.putByte(0),--p;return l.putBytes(n.util.hexToBytes(f)),!1!==o?v(l.getBytes(),t,r):l.getBytes()},u.rsa.createKeyPairGenerationState=function(e,t,r){"string"==typeof e&&(e=parseInt(e,10)),e=e||2048;var o=(r=r||{}).prng||n.random,a={nextBytes:function(e){for(var t=o.getBytesSync(e.length),r=0;r<e.length;++r)e[r]=t.charCodeAt(r)}},s=r.algorithm||"PRIMEINC",u;if("PRIMEINC"!==s)throw new Error("Invalid key generation algorithm: "+s);return(u={algorithm:s,state:0,bits:e,rng:a,eInt:t||65537,e:new i(null),p:null,q:null,qBits:e>>1,pBits:e-(e>>1),pqState:0,num:null,keys:null}).e.fromInt(u.eInt),u},u.rsa.stepKeyPairGenerationState=function(e,t){"algorithm"in e||(e.algorithm="PRIMEINC");var r=new i(null);r.fromInt(30);for(var n=0,o=function(e,t){return e|t},a=+new Date,s,f=0;null===e.keys&&(t<=0||f<t);){if(0===e.state){var l=null===e.p?e.pBits:e.qBits,p=l-1;0===e.pqState?(e.num=new i(l,e.rng),e.num.testBit(p)||e.num.bitwiseTo(i.ONE.shiftLeft(p),o,e.num),e.num.dAddOffset(31-e.num.mod(r).byteValue(),0),n=0,++e.pqState):1===e.pqState?e.num.bitLength()>l?e.pqState=0:e.num.isProbablePrime(E(e.num.bitLength()))?++e.pqState:e.num.dAddOffset(c[n++%8],0):2===e.pqState?e.pqState=0===e.num.subtract(i.ONE).gcd(e.e).compareTo(i.ONE)?3:0:3===e.pqState&&(e.pqState=0,null===e.p?e.p=e.num:e.q=e.num,null!==e.p&&null!==e.q&&++e.state,e.num=null)}else if(1===e.state)e.p.compareTo(e.q)<0&&(e.num=e.p,e.p=e.q,e.q=e.num),++e.state;else if(2===e.state)e.p1=e.p.subtract(i.ONE),e.q1=e.q.subtract(i.ONE),e.phi=e.p1.multiply(e.q1),++e.state;else if(3===e.state)0===e.phi.gcd(e.e).compareTo(i.ONE)?++e.state:(e.p=null,e.q=null,e.state=0);else if(4===e.state)e.n=e.p.multiply(e.q),e.n.bitLength()===e.bits?++e.state:(e.q=null,e.state=0);else if(5===e.state){var h=e.e.modInverse(e.phi);e.keys={privateKey:u.rsa.setPrivateKey(e.n,e.e,h,e.p,e.q,h.mod(e.p1),h.mod(e.q1),e.q.modInverse(e.p)),publicKey:u.rsa.setPublicKey(e.n,e.e)}}f+=(s=+new Date)-a,a=s}return null!==e.keys},u.rsa.generateKeyPair=function(e,t,r,i){if(1===arguments.length?"object"==typeof e?(r=e,e=void 0):"function"==typeof e&&(i=e,e=void 0):2===arguments.length?"number"==typeof e?"function"==typeof t?(i=t,t=void 0):"number"!=typeof t&&(r=t,t=void 0):(r=e,i=t,e=void 0,t=void 0):3===arguments.length&&("number"==typeof t?"function"==typeof r&&(i=r,r=void 0):(i=r,r=t,t=void 0)),r=r||{},void 0===e&&(e=r.bits||2048),void 0===t&&(t=r.e||65537),!n.options.usePureJavaScript&&!r.prng&&e>=256&&e<=16384&&(65537===t||3===t))if(i){if(T("generateKeyPair"))return o.generateKeyPair("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},function(e,t,r){if(e)return i(e);i(null,{privateKey:u.privateKeyFromPem(r),publicKey:u.publicKeyFromPem(t)})});if(S("generateKey")&&S("exportKey"))return s.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:C(t),hash:{name:"SHA-256"}},!0,["sign","verify"]).then(function(e){return s.globalScope.crypto.subtle.exportKey("pkcs8",e.privateKey)}).then(void 0,function(e){i(e)}).then(function(e){if(e){var t=u.privateKeyFromAsn1(a.fromDer(n.util.createBuffer(e)));i(null,{privateKey:t,publicKey:u.setRsaPublicKey(t.n,t.e)})}});if(w("generateKey")&&w("exportKey")){var c=s.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:C(t),hash:{name:"SHA-256"}},!0,["sign","verify"]);return c.oncomplete=function(e){var t=e.target.result,r=s.globalScope.msCrypto.subtle.exportKey("pkcs8",t.privateKey);r.oncomplete=function(e){var t=e.target.result,r=u.privateKeyFromAsn1(a.fromDer(n.util.createBuffer(t)));i(null,{privateKey:r,publicKey:u.setRsaPublicKey(r.n,r.e)})},r.onerror=function(e){i(e)}},void(c.onerror=function(e){i(e)})}}else if(T("generateKeyPairSync")){var f=o.generateKeyPairSync("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:u.privateKeyFromPem(f.privateKey),publicKey:u.publicKeyFromPem(f.publicKey)}}var l=u.rsa.createKeyPairGenerationState(e,t,r);if(!i)return u.rsa.stepKeyPairGenerationState(l,0),l.keys;m(l,r,i)},u.setRsaPublicKey=u.rsa.setPublicKey=function(e,t){var r={n:e,e:t,encrypt:function(e,t,i){if("string"==typeof t?t=t.toUpperCase():void 0===t&&(t="RSAES-PKCS1-V1_5"),"RSAES-PKCS1-V1_5"===t)t={encode:function(e,t,r){return g(e,t,2).getBytes()}};else if("RSA-OAEP"===t||"RSAES-OAEP"===t)t={encode:function(e,t){return n.pkcs1.encode_rsa_oaep(t,e,i)}};else if(-1!==["RAW","NONE","NULL",null].indexOf(t))t={encode:function(e){return e}};else if("string"==typeof t)throw new Error('Unsupported encryption scheme: "'+t+'".');var o=t.encode(e,r,!0);return u.rsa.encrypt(o,r,!0)},verify:function(e,t,n){"string"==typeof n?n=n.toUpperCase():void 0===n&&(n="RSASSA-PKCS1-V1_5"),"RSASSA-PKCS1-V1_5"===n?n={verify:function(e,t){var n;return t=v(t,r,!0),e===a.fromDer(t).value[1].value}}:"NONE"!==n&&"NULL"!==n&&null!==n||(n={verify:function(e,t){return e===(t=v(t,r,!0))}});var i=u.rsa.decrypt(t,r,!0,!1);return n.verify(e,i,r.n.bitLength())}};return r},u.setRsaPrivateKey=u.rsa.setPrivateKey=function(e,t,r,i,o,a,s,c){var f={n:e,e:t,d:r,p:i,q:o,dP:a,dQ:s,qInv:c,decrypt:function(e,t,r){"string"==typeof t?t=t.toUpperCase():void 0===t&&(t="RSAES-PKCS1-V1_5");var i=u.rsa.decrypt(e,f,!1,!1);if("RSAES-PKCS1-V1_5"===t)t={decode:v};else if("RSA-OAEP"===t||"RSAES-OAEP"===t)t={decode:function(e,t){return n.pkcs1.decode_rsa_oaep(t,e,r)}};else{if(-1===["RAW","NONE","NULL",null].indexOf(t))throw new Error('Unsupported encryption scheme: "'+t+'".');t={decode:function(e){return e}}}return t.decode(i,f,!1)},sign:function(e,t){var r=!1;"string"==typeof t&&(t=t.toUpperCase()),void 0===t||"RSASSA-PKCS1-V1_5"===t?(t={encode:d},r=1):"NONE"!==t&&"NULL"!==t&&null!==t||(t={encode:function(){return e}},r=1);var n=t.encode(e,f.n.bitLength());return u.rsa.encrypt(n,f,r)}};return f},u.wrapRsaPrivateKey=function(e){return a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,a.integerToDer(0).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(u.oids.rsaEncryption).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.NULL,!1,"")]),a.create(a.Class.UNIVERSAL,a.Type.OCTETSTRING,!1,a.toDer(e).getBytes())])},u.privateKeyFromAsn1=function(e){var t={},r=[],o,s,c,p,h,d,y,g;if(a.validate(e,f,t,r)&&(e=a.fromDer(n.util.createBuffer(t.privateKey))),t={},r=[],!a.validate(e,l,t,r)){var v=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw v.errors=r,v}return o=n.util.createBuffer(t.privateKeyModulus).toHex(),s=n.util.createBuffer(t.privateKeyPublicExponent).toHex(),c=n.util.createBuffer(t.privateKeyPrivateExponent).toHex(),p=n.util.createBuffer(t.privateKeyPrime1).toHex(),h=n.util.createBuffer(t.privateKeyPrime2).toHex(),d=n.util.createBuffer(t.privateKeyExponent1).toHex(),y=n.util.createBuffer(t.privateKeyExponent2).toHex(),g=n.util.createBuffer(t.privateKeyCoefficient).toHex(),u.setRsaPrivateKey(new i(o,16),new i(s,16),new i(c,16),new i(p,16),new i(h,16),new i(d,16),new i(y,16),new i(g,16))},u.privateKeyToAsn1=u.privateKeyToRSAPrivateKey=function(e){return a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,a.integerToDer(0).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,b(e.n)),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,b(e.e)),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,b(e.d)),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,b(e.p)),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,b(e.q)),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,b(e.dP)),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,b(e.dQ)),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,b(e.qInv))])},u.publicKeyFromAsn1=function(e){var t={},r=[],o;if(a.validate(e,h,t,r)){var s=a.derToOid(t.publicKeyOid),o;if(s!==u.oids.rsaEncryption)throw(o=new Error("Cannot read public key. Unknown OID.")).oid=s,o;e=t.rsaPublicKey}if(r=[],!a.validate(e,p,t,r))throw(o=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.")).errors=r,o;var c=n.util.createBuffer(t.publicKeyModulus).toHex(),f=n.util.createBuffer(t.publicKeyExponent).toHex();return u.setRsaPublicKey(new i(c,16),new i(f,16))},u.publicKeyToAsn1=u.publicKeyToSubjectPublicKeyInfo=function(e){return a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(u.oids.rsaEncryption).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.NULL,!1,"")]),a.create(a.Class.UNIVERSAL,a.Type.BITSTRING,!1,[u.publicKeyToRSAPublicKey(e)])])},u.publicKeyToRSAPublicKey=function(e){return a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,b(e.n)),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,b(e.e))])}},function(e,t,r){var n=r(4),i;e.exports=n.jsbn=n.jsbn||{};var o=0xdeadbeefcafe,a=!0;function s(e,t,r){this.data=[],null!=e&&("number"==typeof e?this.fromNumber(e,t,r):null==t&&"string"!=typeof e?this.fromString(e,256):this.fromString(e,t))}function u(){return new s(null)}function c(e,t,r,n,i,o){for(;--o>=0;){var a=t*this.data[e++]+r.data[n]+i;i=Math.floor(a/67108864),r.data[n++]=67108863&a}return i}function f(e,t,r,n,i,o){for(var a=32767&t,s=t>>15;--o>=0;){var u=32767&this.data[e],c=this.data[e++]>>15,f=s*u+c*a;i=((u=a*u+((32767&f)<<15)+r.data[n]+(1073741823&i))>>>30)+(f>>>15)+s*c+(i>>>30),r.data[n++]=1073741823&u}return i}function l(e,t,r,n,i,o){for(var a=16383&t,s=t>>14;--o>=0;){var u=16383&this.data[e],c=this.data[e++]>>14,f=s*u+c*a;i=((u=a*u+((16383&f)<<14)+r.data[n]+i)>>28)+(f>>14)+s*c,r.data[n++]=268435455&u}return i}n.jsbn.BigInteger=s,"undefined"==typeof navigator?(s.prototype.am=l,i=28):"Microsoft Internet Explorer"==navigator.appName?(s.prototype.am=f,i=30):"Netscape"!=navigator.appName?(s.prototype.am=c,i=26):(s.prototype.am=l,i=28),s.prototype.DB=i,s.prototype.DM=(1<<i)-1,s.prototype.DV=1<<i;var p=52;s.prototype.FV=Math.pow(2,p),s.prototype.F1=p-i,s.prototype.F2=2*i-p;var h="0123456789abcdefghijklmnopqrstuvwxyz",d=new Array,y,g;for(y="0".charCodeAt(0),g=0;g<=9;++g)d[y++]=g;for(y="a".charCodeAt(0),g=10;g<36;++g)d[y++]=g;for(y="A".charCodeAt(0),g=10;g<36;++g)d[y++]=g;function v(e){return h.charAt(e)}function m(e,t){var r=d[e.charCodeAt(t)];return null==r?-1:r}function b(e){for(var t=this.t-1;t>=0;--t)e.data[t]=this.data[t];e.t=this.t,e.s=this.s}function E(e){this.t=1,this.s=e<0?-1:0,e>0?this.data[0]=e:e<-1?this.data[0]=e+this.DV:this.t=0}function T(e){var t=u();return t.fromInt(e),t}function S(e,t){var r;if(16==t)r=4;else if(8==t)r=3;else if(256==t)r=8;else if(2==t)r=1;else if(32==t)r=5;else{if(4!=t)return void this.fromRadix(e,t);r=2}this.t=0,this.s=0;for(var n=e.length,i=!1,o=0;--n>=0;){var a=8==r?255&e[n]:m(e,n);a<0?"-"==e.charAt(n)&&(i=!0):(i=!1,0==o?this.data[this.t++]=a:o+r>this.DB?(this.data[this.t-1]|=(a&(1<<this.DB-o)-1)<<o,this.data[this.t++]=a>>this.DB-o):this.data[this.t-1]|=a<<o,(o+=r)>=this.DB&&(o-=this.DB))}8==r&&128&e[0]&&(this.s=-1,o>0&&(this.data[this.t-1]|=(1<<this.DB-o)-1<<o)),this.clamp(),i&&s.ZERO.subTo(this,this)}function w(){for(var e=this.s&this.DM;this.t>0&&this.data[this.t-1]==e;)--this.t}function C(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(16==e)t=4;else if(8==e)t=3;else if(2==e)t=1;else if(32==e)t=5;else{if(4!=e)return this.toRadix(e);t=2}var r=(1<<t)-1,n,i=!1,o="",a=this.t,s=this.DB-a*this.DB%t;if(a-- >0)for(s<this.DB&&(n=this.data[a]>>s)>0&&(i=!0,o=v(n));a>=0;)s<t?(n=(this.data[a]&(1<<s)-1)<<t-s,n|=this.data[--a]>>(s+=this.DB-t)):(n=this.data[a]>>(s-=t)&r,s<=0&&(s+=this.DB,--a)),n>0&&(i=!0),i&&(o+=v(n));return i?o:"0"}function _(){var e=u();return s.ZERO.subTo(this,e),e}function I(){return this.s<0?this.negate():this}function A(e){var t=this.s-e.s;if(0!=t)return t;var r=this.t;if(0!=(t=r-e.t))return this.s<0?-t:t;for(;--r>=0;)if(0!=(t=this.data[r]-e.data[r]))return t;return 0}function R(e){var t=1,r;return 0!=(r=e>>>16)&&(e=r,t+=16),0!=(r=e>>8)&&(e=r,t+=8),0!=(r=e>>4)&&(e=r,t+=4),0!=(r=e>>2)&&(e=r,t+=2),0!=(r=e>>1)&&(e=r,t+=1),t}function O(){return this.t<=0?0:this.DB*(this.t-1)+R(this.data[this.t-1]^this.s&this.DM)}function P(e,t){var r;for(r=this.t-1;r>=0;--r)t.data[r+e]=this.data[r];for(r=e-1;r>=0;--r)t.data[r]=0;t.t=this.t+e,t.s=this.s}function B(e,t){for(var r=e;r<this.t;++r)t.data[r-e]=this.data[r];t.t=Math.max(this.t-e,0),t.s=this.s}function k(e,t){var r=e%this.DB,n=this.DB-r,i=(1<<n)-1,o=Math.floor(e/this.DB),a=this.s<<r&this.DM,s;for(s=this.t-1;s>=0;--s)t.data[s+o+1]=this.data[s]>>n|a,a=(this.data[s]&i)<<r;for(s=o-1;s>=0;--s)t.data[s]=0;t.data[o]=a,t.t=this.t+o+1,t.s=this.s,t.clamp()}function N(e,t){t.s=this.s;var r=Math.floor(e/this.DB);if(r>=this.t)t.t=0;else{var n=e%this.DB,i=this.DB-n,o=(1<<n)-1;t.data[0]=this.data[r]>>n;for(var a=r+1;a<this.t;++a)t.data[a-r-1]|=(this.data[a]&o)<<i,t.data[a-r]=this.data[a]>>n;n>0&&(t.data[this.t-r-1]|=(this.s&o)<<i),t.t=this.t-r,t.clamp()}}function U(e,t){for(var r=0,n=0,i=Math.min(e.t,this.t);r<i;)n+=this.data[r]-e.data[r],t.data[r++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n-=e.s;r<this.t;)n+=this.data[r],t.data[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<e.t;)n-=e.data[r],t.data[r++]=n&this.DM,n>>=this.DB;n-=e.s}t.s=n<0?-1:0,n<-1?t.data[r++]=this.DV+n:n>0&&(t.data[r++]=n),t.t=r,t.clamp()}function D(e,t){var r=this.abs(),n=e.abs(),i=r.t;for(t.t=i+n.t;--i>=0;)t.data[i]=0;for(i=0;i<n.t;++i)t.data[i+r.t]=r.am(0,n.data[i],t,i,0,r.t);t.s=0,t.clamp(),this.s!=e.s&&s.ZERO.subTo(t,t)}function x(e){for(var t=this.abs(),r=e.t=2*t.t;--r>=0;)e.data[r]=0;for(r=0;r<t.t-1;++r){var n=t.am(r,t.data[r],e,2*r,0,1);(e.data[r+t.t]+=t.am(r+1,2*t.data[r],e,2*r+1,n,t.t-r-1))>=t.DV&&(e.data[r+t.t]-=t.DV,e.data[r+t.t+1]=1)}e.t>0&&(e.data[e.t-1]+=t.am(r,t.data[r],e,2*r,0,1)),e.s=0,e.clamp()}function L(e,t,r){var n=e.abs();if(!(n.t<=0)){var i=this.abs();if(i.t<n.t)return null!=t&&t.fromInt(0),void(null!=r&&this.copyTo(r));null==r&&(r=u());var o=u(),a=this.s,c=e.s,f=this.DB-R(n.data[n.t-1]);f>0?(n.lShiftTo(f,o),i.lShiftTo(f,r)):(n.copyTo(o),i.copyTo(r));var l=o.t,p=o.data[l-1];if(0!=p){var h=p*(1<<this.F1)+(l>1?o.data[l-2]>>this.F2:0),d=this.FV/h,y=(1<<this.F1)/h,g=1<<this.F2,v=r.t,m=v-l,b=null==t?u():t;for(o.dlShiftTo(m,b),r.compareTo(b)>=0&&(r.data[r.t++]=1,r.subTo(b,r)),s.ONE.dlShiftTo(l,b),b.subTo(o,o);o.t<l;)o.data[o.t++]=0;for(;--m>=0;){var E=r.data[--v]==p?this.DM:Math.floor(r.data[v]*d+(r.data[v-1]+g)*y);if((r.data[v]+=o.am(0,E,r,m,0,l))<E)for(o.dlShiftTo(m,b),r.subTo(b,r);r.data[v]<--E;)r.subTo(b,r)}null!=t&&(r.drShiftTo(l,t),a!=c&&s.ZERO.subTo(t,t)),r.t=l,r.clamp(),f>0&&r.rShiftTo(f,r),a<0&&s.ZERO.subTo(r,r)}}}function j(e){var t=u();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(s.ZERO)>0&&e.subTo(t,t),t}function M(e){this.m=e}function V(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e}function F(e){return e}function K(e){e.divRemTo(this.m,null,e)}function H(e,t,r){e.multiplyTo(t,r),this.reduce(r)}function q(e,t){e.squareTo(t),this.reduce(t)}function G(){if(this.t<1)return 0;var e=this.data[0];if(!(1&e))return 0;var t=3&e;return(t=(t=(t=(t=t*(2-(15&e)*t)&15)*(2-(255&e)*t)&255)*(2-((65535&e)*t&65535))&65535)*(2-e*t%this.DV)%this.DV)>0?this.DV-t:-t}function z(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}function Y(e){var t=u();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(s.ZERO)>0&&this.m.subTo(t,t),t}function W(e){var t=u();return e.copyTo(t),this.reduce(t),t}function Q(e){for(;e.t<=this.mt2;)e.data[e.t++]=0;for(var t=0;t<this.m.t;++t){var r=32767&e.data[t],n=r*this.mpl+((r*this.mph+(e.data[t]>>15)*this.mpl&this.um)<<15)&e.DM;for(r=t+this.m.t,e.data[r]+=this.m.am(0,n,e,t,0,this.m.t);e.data[r]>=e.DV;)e.data[r]-=e.DV,e.data[++r]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)}function X(e,t){e.squareTo(t),this.reduce(t)}function Z(e,t,r){e.multiplyTo(t,r),this.reduce(r)}function $(){return 0==(this.t>0?1&this.data[0]:this.s)}function J(e,t){if(e>4294967295||e<1)return s.ONE;var r=u(),n=u(),i=t.convert(this),o=R(e)-1;for(i.copyTo(r);--o>=0;)if(t.sqrTo(r,n),(e&1<<o)>0)t.mulTo(n,i,r);else{var a=r;r=n,n=a}return t.revert(r)}function ee(e,t){var r;return r=e<256||t.isEven()?new M(t):new z(t),this.exp(e,r)}function te(){var e=u();return this.copyTo(e),e}function re(){if(this.s<0){if(1==this.t)return this.data[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this.data[0];if(0==this.t)return 0}return(this.data[1]&(1<<32-this.DB)-1)<<this.DB|this.data[0]}function ne(){return 0==this.t?this.s:this.data[0]<<24>>24}function ie(){return 0==this.t?this.s:this.data[0]<<16>>16}function oe(e){return Math.floor(Math.LN2*this.DB/Math.log(e))}function ae(){return this.s<0?-1:this.t<=0||1==this.t&&this.data[0]<=0?0:1}function se(e){if(null==e&&(e=10),0==this.signum()||e<2||e>36)return"0";var t=this.chunkSize(e),r=Math.pow(e,t),n=T(r),i=u(),o=u(),a="";for(this.divRemTo(n,i,o);i.signum()>0;)a=(r+o.intValue()).toString(e).substr(1)+a,i.divRemTo(n,i,o);return o.intValue().toString(e)+a}function ue(e,t){this.fromInt(0),null==t&&(t=10);for(var r=this.chunkSize(t),n=Math.pow(t,r),i=!1,o=0,a=0,u=0;u<e.length;++u){var c=m(e,u);c<0?"-"==e.charAt(u)&&0==this.signum()&&(i=!0):(a=t*a+c,++o>=r&&(this.dMultiply(n),this.dAddOffset(a,0),o=0,a=0))}o>0&&(this.dMultiply(Math.pow(t,o)),this.dAddOffset(a,0)),i&&s.ZERO.subTo(this,this)}function ce(e,t,r){if("number"==typeof t)if(e<2)this.fromInt(1);else for(this.fromNumber(e,r),this.testBit(e-1)||this.bitwiseTo(s.ONE.shiftLeft(e-1),ve,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(s.ONE.shiftLeft(e-1),this);else{var n=new Array,i=7&e;n.length=1+(e>>3),t.nextBytes(n),i>0?n[0]&=(1<<i)-1:n[0]=0,this.fromString(n,256)}}function fe(){var e=this.t,t=new Array;t[0]=this.s;var r=this.DB-e*this.DB%8,n,i=0;if(e-- >0)for(r<this.DB&&(n=this.data[e]>>r)!=(this.s&this.DM)>>r&&(t[i++]=n|this.s<<this.DB-r);e>=0;)r<8?(n=(this.data[e]&(1<<r)-1)<<8-r,n|=this.data[--e]>>(r+=this.DB-8)):(n=this.data[e]>>(r-=8)&255,r<=0&&(r+=this.DB,--e)),128&n&&(n|=-256),0==i&&(128&this.s)!=(128&n)&&++i,(i>0||n!=this.s)&&(t[i++]=n);return t}function le(e){return 0==this.compareTo(e)}function pe(e){return this.compareTo(e)<0?this:e}function he(e){return this.compareTo(e)>0?this:e}function de(e,t,r){var n,i,o=Math.min(e.t,this.t);for(n=0;n<o;++n)r.data[n]=t(this.data[n],e.data[n]);if(e.t<this.t){for(i=e.s&this.DM,n=o;n<this.t;++n)r.data[n]=t(this.data[n],i);r.t=this.t}else{for(i=this.s&this.DM,n=o;n<e.t;++n)r.data[n]=t(i,e.data[n]);r.t=e.t}r.s=t(this.s,e.s),r.clamp()}function ye(e,t){return e&t}function ge(e){var t=u();return this.bitwiseTo(e,ye,t),t}function ve(e,t){return e|t}function me(e){var t=u();return this.bitwiseTo(e,ve,t),t}function be(e,t){return e^t}function Ee(e){var t=u();return this.bitwiseTo(e,be,t),t}function Te(e,t){return e&~t}function Se(e){var t=u();return this.bitwiseTo(e,Te,t),t}function we(){for(var e=u(),t=0;t<this.t;++t)e.data[t]=this.DM&~this.data[t];return e.t=this.t,e.s=~this.s,e}function Ce(e){var t=u();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t}function _e(e){var t=u();return e<0?this.lShiftTo(-e,t):this.rShiftTo(e,t),t}function Ie(e){if(0==e)return-1;var t=0;return 65535&e||(e>>=16,t+=16),255&e||(e>>=8,t+=8),15&e||(e>>=4,t+=4),3&e||(e>>=2,t+=2),1&e||++t,t}function Ae(){for(var e=0;e<this.t;++e)if(0!=this.data[e])return e*this.DB+Ie(this.data[e]);return this.s<0?this.t*this.DB:-1}function Re(e){for(var t=0;0!=e;)e&=e-1,++t;return t}function Oe(){for(var e=0,t=this.s&this.DM,r=0;r<this.t;++r)e+=Re(this.data[r]^t);return e}function Pe(e){var t=Math.floor(e/this.DB);return t>=this.t?0!=this.s:!!(this.data[t]&1<<e%this.DB)}function Be(e,t){var r=s.ONE.shiftLeft(e);return this.bitwiseTo(r,t,r),r}function ke(e){return this.changeBit(e,ve)}function Ne(e){return this.changeBit(e,Te)}function Ue(e){return this.changeBit(e,be)}function De(e,t){for(var r=0,n=0,i=Math.min(e.t,this.t);r<i;)n+=this.data[r]+e.data[r],t.data[r++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n+=e.s;r<this.t;)n+=this.data[r],t.data[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<e.t;)n+=e.data[r],t.data[r++]=n&this.DM,n>>=this.DB;n+=e.s}t.s=n<0?-1:0,n>0?t.data[r++]=n:n<-1&&(t.data[r++]=this.DV+n),t.t=r,t.clamp()}function xe(e){var t=u();return this.addTo(e,t),t}function Le(e){var t=u();return this.subTo(e,t),t}function je(e){var t=u();return this.multiplyTo(e,t),t}function Me(e){var t=u();return this.divRemTo(e,t,null),t}function Ve(e){var t=u();return this.divRemTo(e,null,t),t}function Fe(e){var t=u(),r=u();return this.divRemTo(e,t,r),new Array(t,r)}function Ke(e){this.data[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()}function He(e,t){if(0!=e){for(;this.t<=t;)this.data[this.t++]=0;for(this.data[t]+=e;this.data[t]>=this.DV;)this.data[t]-=this.DV,++t>=this.t&&(this.data[this.t++]=0),++this.data[t]}}function qe(){}function Ge(e){return e}function ze(e,t,r){e.multiplyTo(t,r)}function Ye(e,t){e.squareTo(t)}function We(e){return this.exp(e,new qe)}function Qe(e,t,r){var n=Math.min(this.t+e.t,t),i;for(r.s=0,r.t=n;n>0;)r.data[--n]=0;for(i=r.t-this.t;n<i;++n)r.data[n+this.t]=this.am(0,e.data[n],r,n,0,this.t);for(i=Math.min(e.t,t);n<i;++n)this.am(0,e.data[n],r,n,0,t-n);r.clamp()}function Xe(e,t,r){--t;var n=r.t=this.t+e.t-t;for(r.s=0;--n>=0;)r.data[n]=0;for(n=Math.max(t-this.t,0);n<e.t;++n)r.data[this.t+n-t]=this.am(t-n,e.data[n],r,0,0,this.t+n-t);r.clamp(),r.drShiftTo(1,r)}function Ze(e){this.r2=u(),this.q3=u(),s.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}function $e(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=u();return e.copyTo(t),this.reduce(t),t}function Je(e){return e}function et(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e)}function tt(e,t){e.squareTo(t),this.reduce(t)}function rt(e,t,r){e.multiplyTo(t,r),this.reduce(r)}function nt(e,t){var r=e.bitLength(),n,i=T(1),o;if(r<=0)return i;n=r<18?1:r<48?3:r<144?4:r<768?5:6,o=r<8?new M(t):t.isEven()?new Ze(t):new z(t);var a=new Array,s=3,c=n-1,f=(1<<n)-1;if(a[1]=o.convert(this),n>1){var l=u();for(o.sqrTo(a[1],l);s<=f;)a[s]=u(),o.mulTo(l,a[s-2],a[s]),s+=2}var p=e.t-1,h,d=!0,y=u(),g;for(r=R(e.data[p])-1;p>=0;){for(r>=c?h=e.data[p]>>r-c&f:(h=(e.data[p]&(1<<r+1)-1)<<c-r,p>0&&(h|=e.data[p-1]>>this.DB+r-c)),s=n;!(1&h);)h>>=1,--s;if((r-=s)<0&&(r+=this.DB,--p),d)a[h].copyTo(i),d=!1;else{for(;s>1;)o.sqrTo(i,y),o.sqrTo(y,i),s-=2;s>0?o.sqrTo(i,y):(g=i,i=y,y=g),o.mulTo(y,a[h],i)}for(;p>=0&&!(e.data[p]&1<<r);)o.sqrTo(i,y),g=i,i=y,y=g,--r<0&&(r=this.DB-1,--p)}return o.revert(i)}function it(e){var t=this.s<0?this.negate():this.clone(),r=e.s<0?e.negate():e.clone();if(t.compareTo(r)<0){var n=t;t=r,r=n}var i=t.getLowestSetBit(),o=r.getLowestSetBit();if(o<0)return t;for(i<o&&(o=i),o>0&&(t.rShiftTo(o,t),r.rShiftTo(o,r));t.signum()>0;)(i=t.getLowestSetBit())>0&&t.rShiftTo(i,t),(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),t.compareTo(r)>=0?(t.subTo(r,t),t.rShiftTo(1,t)):(r.subTo(t,r),r.rShiftTo(1,r));return o>0&&r.lShiftTo(o,r),r}function ot(e){if(e<=0)return 0;var t=this.DV%e,r=this.s<0?e-1:0;if(this.t>0)if(0==t)r=this.data[0]%e;else for(var n=this.t-1;n>=0;--n)r=(t*r+this.data[n])%e;return r}function at(e){var t=e.isEven();if(this.isEven()&&t||0==e.signum())return s.ZERO;for(var r=e.clone(),n=this.clone(),i=T(1),o=T(0),a=T(0),u=T(1);0!=r.signum();){for(;r.isEven();)r.rShiftTo(1,r),t?(i.isEven()&&o.isEven()||(i.addTo(this,i),o.subTo(e,o)),i.rShiftTo(1,i)):o.isEven()||o.subTo(e,o),o.rShiftTo(1,o);for(;n.isEven();)n.rShiftTo(1,n),t?(a.isEven()&&u.isEven()||(a.addTo(this,a),u.subTo(e,u)),a.rShiftTo(1,a)):u.isEven()||u.subTo(e,u),u.rShiftTo(1,u);r.compareTo(n)>=0?(r.subTo(n,r),t&&i.subTo(a,i),o.subTo(u,o)):(n.subTo(r,n),t&&a.subTo(i,a),u.subTo(o,u))}return 0!=n.compareTo(s.ONE)?s.ZERO:u.compareTo(e)>=0?u.subtract(e):u.signum()<0?(u.addTo(e,u),u.signum()<0?u.add(e):u):u}M.prototype.convert=V,M.prototype.revert=F,M.prototype.reduce=K,M.prototype.mulTo=H,M.prototype.sqrTo=q,z.prototype.convert=Y,z.prototype.revert=W,z.prototype.reduce=Q,z.prototype.mulTo=Z,z.prototype.sqrTo=X,s.prototype.copyTo=b,s.prototype.fromInt=E,s.prototype.fromString=S,s.prototype.clamp=w,s.prototype.dlShiftTo=P,s.prototype.drShiftTo=B,s.prototype.lShiftTo=k,s.prototype.rShiftTo=N,s.prototype.subTo=U,s.prototype.multiplyTo=D,s.prototype.squareTo=x,s.prototype.divRemTo=L,s.prototype.invDigit=G,s.prototype.isEven=$,s.prototype.exp=J,s.prototype.toString=C,s.prototype.negate=_,s.prototype.abs=I,s.prototype.compareTo=A,s.prototype.bitLength=O,s.prototype.mod=j,s.prototype.modPowInt=ee,s.ZERO=T(0),s.ONE=T(1),qe.prototype.convert=Ge,qe.prototype.revert=Ge,qe.prototype.mulTo=ze,qe.prototype.sqrTo=Ye,Ze.prototype.convert=$e,Ze.prototype.revert=Je,Ze.prototype.reduce=et,Ze.prototype.mulTo=rt,Ze.prototype.sqrTo=tt;var st=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509],ut=(1<<26)/st[st.length-1];function ct(e){var t,r=this.abs();if(1==r.t&&r.data[0]<=st[st.length-1]){for(t=0;t<st.length;++t)if(r.data[0]==st[t])return!0;return!1}if(r.isEven())return!1;for(t=1;t<st.length;){for(var n=st[t],i=t+1;i<st.length&&n<ut;)n*=st[i++];for(n=r.modInt(n);t<i;)if(n%st[t++]==0)return!1}return r.millerRabin(e)}function ft(e){var t=this.subtract(s.ONE),r=t.getLowestSetBit();if(r<=0)return!1;for(var n=t.shiftRight(r),i=lt(),o,a=0;a<e;++a){do{o=new s(this.bitLength(),i)}while(o.compareTo(s.ONE)<=0||o.compareTo(t)>=0);var u=o.modPow(n,this);if(0!=u.compareTo(s.ONE)&&0!=u.compareTo(t)){for(var c=1;c++<r&&0!=u.compareTo(t);)if(0==(u=u.modPowInt(2,this)).compareTo(s.ONE))return!1;if(0!=u.compareTo(t))return!1}}return!0}function lt(){return{nextBytes:function(e){for(var t=0;t<e.length;++t)e[t]=Math.floor(256*Math.random())}}}s.prototype.chunkSize=oe,s.prototype.toRadix=se,s.prototype.fromRadix=ue,s.prototype.fromNumber=ce,s.prototype.bitwiseTo=de,s.prototype.changeBit=Be,s.prototype.addTo=De,s.prototype.dMultiply=Ke,s.prototype.dAddOffset=He,s.prototype.multiplyLowerTo=Qe,s.prototype.multiplyUpperTo=Xe,s.prototype.modInt=ot,s.prototype.millerRabin=ft,s.prototype.clone=te,s.prototype.intValue=re,s.prototype.byteValue=ne,s.prototype.shortValue=ie,s.prototype.signum=ae,s.prototype.toByteArray=fe,s.prototype.equals=le,s.prototype.min=pe,s.prototype.max=he,s.prototype.and=ge,s.prototype.or=me,s.prototype.xor=Ee,s.prototype.andNot=Se,s.prototype.not=we,s.prototype.shiftLeft=Ce,s.prototype.shiftRight=_e,s.prototype.getLowestSetBit=Ae,s.prototype.bitCount=Oe,s.prototype.testBit=Pe,s.prototype.setBit=ke,s.prototype.clearBit=Ne,s.prototype.flipBit=Ue,s.prototype.add=xe,s.prototype.subtract=Le,s.prototype.multiply=je,s.prototype.divide=Me,s.prototype.remainder=Ve,s.prototype.divideAndRemainder=Fe,s.prototype.modPow=nt,s.prototype.modInverse=at,s.prototype.pow=We,s.prototype.gcd=it,s.prototype.isProbablePrime=ct},,,,,,,,,function(e,t,r){(function(e,t){var r;!function(r){!function(e){var n="object"==typeof t?t:"object"==typeof self?self:"object"==typeof this?this:Function("return this;")(),i=o(r);function o(e,t){return function(r,n){"function"!=typeof e[r]&&Object.defineProperty(e,r,{configurable:!0,writable:!0,value:n}),t&&t(r,n)}}void 0===n.Reflect?n.Reflect=r:i=o(n.Reflect,i),e(i)}(function(t){var r=Object.prototype.hasOwnProperty,n="function"==typeof Symbol,i=n&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",o=n&&void 0!==Symbol.iterator?Symbol.iterator:"@@iterator",a="function"==typeof Object.create,s={__proto__:[]}instanceof Array,u=!a&&!s,c={create:a?function(){return oe(Object.create(null))}:s?function(){return oe({__proto__:null})}:function(){return oe({})},has:u?function(e,t){return r.call(e,t)}:function(e,t){return t in e},get:u?function(e,t){return r.call(e,t)?e[t]:void 0}:function(e,t){return e[t]}},f=Object.getPrototypeOf(Function),l="object"==typeof e&&e.env&&"true"===e.env.REFLECT_METADATA_USE_MAP_POLYFILL,p=l||"function"!=typeof Map||"function"!=typeof Map.prototype.entries?re():Map,h=l||"function"!=typeof Set||"function"!=typeof Set.prototype.entries?ne():Set,d,y=new(l||"function"!=typeof WeakMap?ie():WeakMap);function g(e,t,r,n){if(L(r)){if(!z(e))throw new TypeError;if(!W(t))throw new TypeError;return I(e,t)}if(!z(e))throw new TypeError;if(!V(t))throw new TypeError;if(!V(n)&&!L(n)&&!j(n))throw new TypeError;return j(n)&&(n=void 0),A(e,t,r=G(r),n)}function v(e,t){function r(r,n){if(!V(r))throw new TypeError;if(!L(n)&&!Q(n))throw new TypeError;N(e,t,r,n)}return r}function m(e,t,r,n){if(!V(r))throw new TypeError;return L(n)||(n=G(n)),N(e,t,r,n)}function b(e,t,r){if(!V(t))throw new TypeError;return L(r)||(r=G(r)),O(e,t,r)}function E(e,t,r){if(!V(t))throw new TypeError;return L(r)||(r=G(r)),P(e,t,r)}function T(e,t,r){if(!V(t))throw new TypeError;return L(r)||(r=G(r)),B(e,t,r)}function S(e,t,r){if(!V(t))throw new TypeError;return L(r)||(r=G(r)),k(e,t,r)}function w(e,t){if(!V(e))throw new TypeError;return L(t)||(t=G(t)),U(e,t)}function C(e,t){if(!V(e))throw new TypeError;return L(t)||(t=G(t)),D(e,t)}function _(e,t,r){if(!V(t))throw new TypeError;L(r)||(r=G(r));var n=R(t,r,!1);if(L(n))return!1;if(!n.delete(e))return!1;if(n.size>0)return!0;var i=y.get(t);return i.delete(r),i.size>0||y.delete(t),!0}function I(e,t){for(var r=e.length-1;r>=0;--r){var n,i=(0,e[r])(t);if(!L(i)&&!j(i)){if(!W(i))throw new TypeError;t=i}}return t}function A(e,t,r,n){for(var i=e.length-1;i>=0;--i){var o,a=(0,e[i])(t,r,n);if(!L(a)&&!j(a)){if(!V(a))throw new TypeError;n=a}}return n}function R(e,t,r){var n=y.get(e);if(L(n)){if(!r)return;n=new p,y.set(e,n)}var i=n.get(t);if(L(i)){if(!r)return;i=new p,n.set(t,i)}return i}function O(e,t,r){var n;if(P(e,t,r))return!0;var i=te(t);return!j(i)&&O(e,i,r)}function P(e,t,r){var n=R(t,r,!1);return!L(n)&&H(n.has(e))}function B(e,t,r){var n;if(P(e,t,r))return k(e,t,r);var i=te(t);return j(i)?void 0:B(e,i,r)}function k(e,t,r){var n=R(t,r,!1);if(!L(n))return n.get(e)}function N(e,t,r,n){var i;R(r,n,!0).set(e,t)}function U(e,t){var r=D(e,t),n=te(e);if(null===n)return r;var i=U(n,t);if(i.length<=0)return r;if(r.length<=0)return i;for(var o=new h,a=[],s=0,u=r;s<u.length;s++){var c=u[s],f;(f=o.has(c))||(o.add(c),a.push(c))}for(var l=0,p=i;l<p.length;l++){var c=p[l],f;(f=o.has(c))||(o.add(c),a.push(c))}return a}function D(e,t){var r=[],n=R(e,t,!1);if(L(n))return r;for(var i,o=Z(n.keys()),a=0;;){var s=J(o);if(!s)return r.length=a,r;var u=$(s);try{r[a]=u}catch(e){try{ee(o)}finally{throw e}}a++}}function x(e){if(null===e)return 1;switch(typeof e){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===e?1:6;default:return 6}}function L(e){return void 0===e}function j(e){return null===e}function M(e){return"symbol"==typeof e}function V(e){return"object"==typeof e?null!==e:"function"==typeof e}function F(e,t){switch(x(e)){case 0:case 1:case 2:case 3:case 4:case 5:return e}var r=3===t?"string":5===t?"number":"default",n=X(e,i);if(void 0!==n){var o=n.call(e,r);if(V(o))throw new TypeError;return o}return K(e,"default"===r?"number":r)}function K(e,t){if("string"===t){var r=e.toString,n,i,n;if(Y(r))if(!V(n=r.call(e)))return n;if(Y(i=e.valueOf))if(!V(n=i.call(e)))return n}else{var i,n;if(Y(i=e.valueOf))if(!V(n=i.call(e)))return n;var o=e.toString,n;if(Y(o))if(!V(n=o.call(e)))return n}throw new TypeError}function H(e){return!!e}function q(e){return""+e}function G(e){var t=F(e,3);return M(t)?t:q(t)}function z(e){return Array.isArray?Array.isArray(e):e instanceof Object?e instanceof Array:"[object Array]"===Object.prototype.toString.call(e)}function Y(e){return"function"==typeof e}function W(e){return"function"==typeof e}function Q(e){switch(x(e)){case 3:case 4:return!0;default:return!1}}function X(e,t){var r=e[t];if(null!=r){if(!Y(r))throw new TypeError;return r}}function Z(e){var t=X(e,o);if(!Y(t))throw new TypeError;var r=t.call(e);if(!V(r))throw new TypeError;return r}function $(e){return e.value}function J(e){var t=e.next();return!t.done&&t}function ee(e){var t=e.return;t&&t.call(e)}function te(e){var t=Object.getPrototypeOf(e);if("function"!=typeof e||e===f)return t;if(t!==f)return t;var r=e.prototype,n=r&&Object.getPrototypeOf(r);if(null==n||n===Object.prototype)return t;var i=n.constructor;return"function"!=typeof i||i===e?t:i}function re(){var e={},t=[],r=function(){function e(e,t,r){this._index=0,this._keys=e,this._values=t,this._selector=r}return e.prototype["@@iterator"]=function(){return this},e.prototype[o]=function(){return this},e.prototype.next=function(){var e=this._index;if(e>=0&&e<this._keys.length){var r=this._selector(this._keys[e],this._values[e]);return e+1>=this._keys.length?(this._index=-1,this._keys=t,this._values=t):this._index++,{value:r,done:!1}}return{value:void 0,done:!0}},e.prototype.throw=function(e){throw this._index>=0&&(this._index=-1,this._keys=t,this._values=t),e},e.prototype.return=function(e){return this._index>=0&&(this._index=-1,this._keys=t,this._values=t),{value:e,done:!0}},e}();return function(){function t(){this._keys=[],this._values=[],this._cacheKey=e,this._cacheIndex=-2}return Object.defineProperty(t.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),t.prototype.has=function(e){return this._find(e,!1)>=0},t.prototype.get=function(e){var t=this._find(e,!1);return t>=0?this._values[t]:void 0},t.prototype.set=function(e,t){var r=this._find(e,!0);return this._values[r]=t,this},t.prototype.delete=function(t){var r=this._find(t,!1);if(r>=0){for(var n=this._keys.length,i=r+1;i<n;i++)this._keys[i-1]=this._keys[i],this._values[i-1]=this._values[i];return this._keys.length--,this._values.length--,t===this._cacheKey&&(this._cacheKey=e,this._cacheIndex=-2),!0}return!1},t.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=e,this._cacheIndex=-2},t.prototype.keys=function(){return new r(this._keys,this._values,n)},t.prototype.values=function(){return new r(this._keys,this._values,i)},t.prototype.entries=function(){return new r(this._keys,this._values,a)},t.prototype["@@iterator"]=function(){return this.entries()},t.prototype[o]=function(){return this.entries()},t.prototype._find=function(e,t){return this._cacheKey!==e&&(this._cacheIndex=this._keys.indexOf(this._cacheKey=e)),this._cacheIndex<0&&t&&(this._cacheIndex=this._keys.length,this._keys.push(e),this._values.push(void 0)),this._cacheIndex},t}();function n(e,t){return e}function i(e,t){return t}function a(e,t){return[e,t]}}function ne(){return function(){function e(){this._map=new p}return Object.defineProperty(e.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),e.prototype.has=function(e){return this._map.has(e)},e.prototype.add=function(e){return this._map.set(e,e),this},e.prototype.delete=function(e){return this._map.delete(e)},e.prototype.clear=function(){this._map.clear()},e.prototype.keys=function(){return this._map.keys()},e.prototype.values=function(){return this._map.values()},e.prototype.entries=function(){return this._map.entries()},e.prototype["@@iterator"]=function(){return this.keys()},e.prototype[o]=function(){return this.keys()},e}()}function ie(){var e=16,t=c.create(),n=i();return function(){function e(){this._key=i()}return e.prototype.has=function(e){var t=o(e,!1);return void 0!==t&&c.has(t,this._key)},e.prototype.get=function(e){var t=o(e,!1);return void 0!==t?c.get(t,this._key):void 0},e.prototype.set=function(e,t){var r;return o(e,!0)[this._key]=t,this},e.prototype.delete=function(e){var t=o(e,!1);return void 0!==t&&delete t[this._key]},e.prototype.clear=function(){this._key=i()},e}();function i(){var e;do{e="@@WeakMap@@"+u()}while(c.has(t,e));return t[e]=!0,e}function o(e,t){if(!r.call(e,n)){if(!t)return;Object.defineProperty(e,n,{value:c.create()})}return e[n]}function a(e,t){for(var r=0;r<t;++r)e[r]=255*Math.random()|0;return e}function s(e){return"function"==typeof Uint8Array?"undefined"!=typeof crypto?crypto.getRandomValues(new Uint8Array(e)):"undefined"!=typeof msCrypto?msCrypto.getRandomValues(new Uint8Array(e)):a(new Uint8Array(e),e):a(new Array(e),e)}function u(){var t=s(e);t[6]=79&t[6]|64,t[8]=191&t[8]|128;for(var r="",n=0;n<e;++n){var i=t[n];4!==n&&6!==n&&8!==n||(r+="-"),i<16&&(r+="0"),r+=i.toString(16).toLowerCase()}return r}}function oe(e){return e.__=void 0,delete e.__,e}t("decorate",g),t("metadata",v),t("defineMetadata",m),t("hasMetadata",b),t("hasOwnMetadata",E),t("getMetadata",T),t("getOwnMetadata",S),t("getMetadataKeys",w),t("getOwnMetadataKeys",C),t("deleteMetadata",_)})}(r||(r={}))}).call(this,r(36),r(29))},function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){function i(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=Promise))(function(r,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){e.done?r(e.value):i(e.value).then(a,s)}u((n=n.apply(e,t||[])).next())})},i=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},n,i,o,a;return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(e){return function(t){return u([e,t])}}function u(a){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=2&a[0]?i.return:a[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,a[1])).done)return o;switch(i=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,i=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(!(o=r.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){r=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){r.label=a[1];break}if(6===a[0]&&r.label<o[1]){r.label=o[1],o=a;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(a);break}o[2]&&r.ops.pop(),r.trys.pop();continue}a=t.call(e,r)}catch(e){a=[6,e],i=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}},o=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.Container=void 0;var a=r(88),s=r(11),u=r(18),c=r(7),f=r(54),l=r(89),p=r(96),h=r(98),d=r(24),y=r(30),g=r(101),v=r(102),m=function(){function e(e){this._appliedMiddleware=[];var t=e||{};if("object"!=typeof t)throw new Error(""+s.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT);if(void 0===t.defaultScope)t.defaultScope=u.BindingScopeEnum.Transient;else if(t.defaultScope!==u.BindingScopeEnum.Singleton&&t.defaultScope!==u.BindingScopeEnum.Transient&&t.defaultScope!==u.BindingScopeEnum.Request)throw new Error(""+s.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE);if(void 0===t.autoBindInjectable)t.autoBindInjectable=!1;else if("boolean"!=typeof t.autoBindInjectable)throw new Error(""+s.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE);if(void 0===t.skipBaseClassChecks)t.skipBaseClassChecks=!1;else if("boolean"!=typeof t.skipBaseClassChecks)throw new Error(""+s.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK);this.options={autoBindInjectable:t.autoBindInjectable,defaultScope:t.defaultScope,skipBaseClassChecks:t.skipBaseClassChecks},this.id=d.id(),this._bindingDictionary=new v.Lookup,this._snapshots=[],this._middleware=null,this.parent=null,this._metadataReader=new f.MetadataReader}return e.merge=function(t,r){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];var a=new e,s=o([t,r],n).map(function(e){return l.getBindingDictionary(e)}),u=l.getBindingDictionary(a);function c(e,t){e.traverse(function(e,r){r.forEach(function(e){t.add(e.serviceIdentifier,e.clone())})})}return s.forEach(function(e){c(e,u)}),a},e.prototype.load=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var r=this._getContainerModuleHelpersFactory(),n=0,i=e;n<i.length;n++){var o=i[n],a=r(o.id);o.registry(a.bindFunction,a.unbindFunction,a.isboundFunction,a.rebindFunction)}},e.prototype.loadAsync=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return n(this,void 0,void 0,function(){var t,r,n,o,a;return i(this,function(i){switch(i.label){case 0:t=this._getContainerModuleHelpersFactory(),r=0,n=e,i.label=1;case 1:return r<n.length?(o=n[r],a=t(o.id),[4,o.registry(a.bindFunction,a.unbindFunction,a.isboundFunction,a.rebindFunction)]):[3,4];case 2:i.sent(),i.label=3;case 3:return r++,[3,1];case 4:return[2]}})})},e.prototype.unload=function(){for(var e=this,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=function(e){return function(t){return t.moduleId===e}};t.forEach(function(t){var r=n(t.id);e._bindingDictionary.removeByCondition(r)})},e.prototype.bind=function(e){var t=this.options.defaultScope||u.BindingScopeEnum.Transient,r=new a.Binding(e,t);return this._bindingDictionary.add(e,r),new h.BindingToSyntax(r)},e.prototype.rebind=function(e){return this.unbind(e),this.bind(e)},e.prototype.unbind=function(e){try{this._bindingDictionary.remove(e)}catch(t){throw new Error(s.CANNOT_UNBIND+" "+y.getServiceIdentifierAsString(e))}},e.prototype.unbindAll=function(){this._bindingDictionary=new v.Lookup},e.prototype.isBound=function(e){var t=this._bindingDictionary.hasKey(e);return!t&&this.parent&&(t=this.parent.isBound(e)),t},e.prototype.isBoundNamed=function(e,t){return this.isBoundTagged(e,c.NAMED_TAG,t)},e.prototype.isBoundTagged=function(e,t,r){var n=!1;if(this._bindingDictionary.hasKey(e)){var i=this._bindingDictionary.get(e),o=l.createMockRequest(this,e,t,r);n=i.some(function(e){return e.constraint(o)})}return!n&&this.parent&&(n=this.parent.isBoundTagged(e,t,r)),n},e.prototype.snapshot=function(){this._snapshots.push(g.ContainerSnapshot.of(this._bindingDictionary.clone(),this._middleware))},e.prototype.restore=function(){var e=this._snapshots.pop();if(void 0===e)throw new Error(s.NO_MORE_SNAPSHOTS_AVAILABLE);this._bindingDictionary=e.bindings,this._middleware=e.middleware},e.prototype.createChild=function(t){var r=new e(t||this.options);return r.parent=this,r},e.prototype.applyMiddleware=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._appliedMiddleware=this._appliedMiddleware.concat(e);var r=this._middleware?this._middleware:this._planAndResolve();this._middleware=e.reduce(function(e,t){return t(e)},r)},e.prototype.applyCustomMetadataReader=function(e){this._metadataReader=e},e.prototype.get=function(e){return this._get(!1,!1,u.TargetTypeEnum.Variable,e)},e.prototype.getTagged=function(e,t,r){return this._get(!1,!1,u.TargetTypeEnum.Variable,e,t,r)},e.prototype.getNamed=function(e,t){return this.getTagged(e,c.NAMED_TAG,t)},e.prototype.getAll=function(e){return this._get(!0,!0,u.TargetTypeEnum.Variable,e)},e.prototype.getAllTagged=function(e,t,r){return this._get(!1,!0,u.TargetTypeEnum.Variable,e,t,r)},e.prototype.getAllNamed=function(e,t){return this.getAllTagged(e,c.NAMED_TAG,t)},e.prototype.resolve=function(e){var t=this.createChild();return t.bind(e).toSelf(),this._appliedMiddleware.forEach(function(e){t.applyMiddleware(e)}),t.get(e)},e.prototype._getContainerModuleHelpersFactory=function(){var e=this,t=function(e,t){e._binding.moduleId=t},r=function(r){return function(n){var i,o=e.bind.bind(e)(n);return t(o,r),o}},n=function(t){return function(t){var r;e.unbind.bind(e)(t)}},i=function(t){return function(t){var r;return e.isBound.bind(e)(t)}},o=function(r){return function(n){var i,o=e.rebind.bind(e)(n);return t(o,r),o}};return function(e){return{bindFunction:r(e),isboundFunction:i(e),rebindFunction:o(e),unbindFunction:n(e)}}},e.prototype._get=function(e,t,r,n,i,o){var a=null,u={avoidConstraints:e,contextInterceptor:function(e){return e},isMultiInject:t,key:i,serviceIdentifier:n,targetType:r,value:o};if(this._middleware){if(null==(a=this._middleware(u)))throw new Error(s.INVALID_MIDDLEWARE_RETURN)}else a=this._planAndResolve()(u);return a},e.prototype._planAndResolve=function(){var e=this;return function(t){var r=l.plan(e._metadataReader,e,t.isMultiInject,t.targetType,t.serviceIdentifier,t.key,t.value,t.avoidConstraints),n;return r=t.contextInterceptor(r),p.resolve(r)}},e}();t.Container=m},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Binding=void 0;var n=r(18),i=r(24),o=function(){function e(e,t){this.id=i.id(),this.activated=!1,this.serviceIdentifier=e,this.scope=t,this.type=n.BindingTypeEnum.Invalid,this.constraint=function(e){return!0},this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.onActivation=null,this.dynamicValue=null}return e.prototype.clone=function(){var t=new e(this.serviceIdentifier,this.scope);return t.activated=t.scope===n.BindingScopeEnum.Singleton&&this.activated,t.implementationType=this.implementationType,t.dynamicValue=this.dynamicValue,t.scope=this.scope,t.type=this.type,t.factory=this.factory,t.provider=this.provider,t.constraint=this.constraint,t.onActivation=this.onActivation,t.cache=this.cache,t},e}();t.Binding=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getBindingDictionary=t.createMockRequest=t.plan=void 0;var n=r(90),i=r(11),o=r(18),a=r(7),s=r(55),u=r(30),c=r(91),f=r(14),l=r(92),p=r(93),h=r(95),d=r(57);function y(e){return e._bindingDictionary}function g(e,t,r,n,i,o){var s=e?a.MULTI_INJECT_TAG:a.INJECT_TAG,u=new f.Metadata(s,r),c=new d.Target(t,n,r,u);if(void 0!==i){var l=new f.Metadata(i,o);c.metadata.push(l)}return c}function v(e,t,r,i,o){var a=E(r.container,o.serviceIdentifier),s=[];return a.length===n.BindingCount.NoBindingsAvailable&&r.container.options.autoBindInjectable&&"function"==typeof o.serviceIdentifier&&e.getConstructorMetadata(o.serviceIdentifier).compilerGeneratedMetadata&&(r.container.bind(o.serviceIdentifier).toSelf(),a=E(r.container,o.serviceIdentifier)),s=t?a:a.filter(function(e){var t=new h.Request(e.serviceIdentifier,r,i,e,o);return e.constraint(t)}),m(o.serviceIdentifier,s,o,r.container),s}function m(e,t,r,o){switch(t.length){case n.BindingCount.NoBindingsAvailable:if(r.isOptional())return t;var a=u.getServiceIdentifierAsString(e),s=i.NOT_REGISTERED;throw s+=u.listMetadataForTarget(a,r),s+=u.listRegisteredBindingsForServiceIdentifier(o,a,E),new Error(s);case n.BindingCount.OnlyOneBindingAvailable:if(!r.isArray())return t;case n.BindingCount.MultipleBindingsAvailable:default:if(r.isArray())return t;var a=u.getServiceIdentifierAsString(e),s=i.AMBIGUOUS_MATCH+" "+a;throw s+=u.listRegisteredBindingsForServiceIdentifier(o,a,E),new Error(s)}}function b(e,t,r,n,a,s){var u,c;if(null===a){u=v(e,t,n,null,s),c=new h.Request(r,n,null,u,s);var f=new l.Plan(n,c);n.addPlan(f)}else u=v(e,t,n,a,s),c=a.addChildRequest(s.serviceIdentifier,u,s);u.forEach(function(t){var r=null;if(s.isArray())r=c.addChildRequest(t.serviceIdentifier,t,s);else{if(t.cache)return;r=c}if(t.type===o.BindingTypeEnum.Instance&&null!==t.implementationType){var a=p.getDependencies(e,t.implementationType);if(!n.container.options.skipBaseClassChecks){var u=p.getBaseClassDependencyCount(e,t.implementationType);if(a.length<u){var f=i.ARGUMENTS_LENGTH_MISMATCH(p.getFunctionName(t.implementationType));throw new Error(f)}}a.forEach(function(t){b(e,!1,t.serviceIdentifier,n,r,t)})}})}function E(e,t){var r=[],n=y(e);return n.hasKey(t)?r=n.get(t):null!==e.parent&&(r=E(e.parent,t)),r}function T(e,t,r,n,i,o,a,f){void 0===f&&(f=!1);var l=new c.Context(t),p=g(r,n,i,"",o,a);try{return b(e,f,i,l,null,p),l}catch(e){throw s.isStackOverflowExeption(e)&&l.plan&&u.circularDependencyToException(l.plan.rootRequest),e}}function S(e,t,r,n){var i=new d.Target(o.TargetTypeEnum.Variable,"",t,new f.Metadata(r,n)),a=new c.Context(e),s;return new h.Request(t,a,null,[],i)}t.getBindingDictionary=y,t.plan=T,t.createMockRequest=S},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BindingCount=void 0;var n={MultipleBindingsAvailable:2,NoBindingsAvailable:0,OnlyOneBindingAvailable:1};t.BindingCount=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Context=void 0;var n=r(24),i=function(){function e(e){this.id=n.id(),this.container=e}return e.prototype.addPlan=function(e){this.plan=e},e.prototype.setCurrentRequest=function(e){this.currentRequest=e},e}();t.Context=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Plan=void 0;var n=function(){function e(e,t){this.parentContext=e,this.rootRequest=t}return e}();t.Plan=n},function(e,t,r){"use strict";var n=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.getFunctionName=t.getBaseClassDependencyCount=t.getDependencies=void 0;var i=r(56),o=r(11),a=r(18),s=r(7),u=r(30);Object.defineProperty(t,"getFunctionName",{enumerable:!0,get:function(){return u.getFunctionName}});var c=r(57);function f(e,t){var r,n;return l(e,u.getFunctionName(t),t,!1)}function l(e,t,r,i){var a=e.getConstructorMetadata(r),s=a.compilerGeneratedMetadata;if(void 0===s){var u=o.MISSING_INJECTABLE_ANNOTATION+" "+t+".";throw new Error(u)}var c=a.userGeneratedMetadata,f=Object.keys(c),l=0===r.length&&f.length>0,p=f.length>r.length,y,g=h(i,t,s,c,l||p?f.length:r.length),v=d(e,r),m;return n(n([],g),v)}function p(e,t,r,n,s){var u=s[e.toString()]||[],f=g(u),l=!0!==f.unmanaged,p=n[e],h=f.inject||f.multiInject;if((p=h||p)instanceof i.LazyServiceIdentifer&&(p=p.unwrap()),l){var d,y,v,m;if(!t&&(p===Object||p===Function||void 0===p)){var b=o.MISSING_INJECT_ANNOTATION+" argument "+e+" in class "+r+".";throw new Error(b)}var E=new c.Target(a.TargetTypeEnum.ConstructorArgument,f.targetName,p);return E.metadata=u,E}return null}function h(e,t,r,n,i){for(var o=[],a=0;a<i;a++){var s,u=p(a,e,t,r,n);null!==u&&o.push(u)}return o}function d(e,t){for(var r=e.getPropertiesMetadata(t),i=[],o,s=0,u=Object.keys(r);s<u.length;s++){var f=u[s],l=r[f],p=g(r[f]),h=p.targetName||f,y=p.inject||p.multiInject,v=new c.Target(a.TargetTypeEnum.ClassProperty,h,y);v.metadata=l,i.push(v)}var m=Object.getPrototypeOf(t.prototype).constructor;if(m!==Object){var b=d(e,m);i=n(n([],i),b)}return i}function y(e,t){var r=Object.getPrototypeOf(t.prototype).constructor;if(r!==Object){var n,i=l(e,u.getFunctionName(r),r,!0),o=i.map(function(e){return e.metadata.filter(function(e){return e.key===s.UNMANAGED_TAG})}),a=[].concat.apply([],o).length,c=i.length-a;return c>0?c:y(e,r)}return 0}function g(e){var t={};return e.forEach(function(e){t[e.key.toString()]=e.value}),{inject:t[s.INJECT_TAG],multiInject:t[s.MULTI_INJECT_TAG],targetName:t[s.NAME_TAG],unmanaged:t[s.UNMANAGED_TAG]}}t.getDependencies=f,t.getBaseClassDependencyCount=y},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.QueryableString=void 0;var n=function(){function e(e){this.str=e}return e.prototype.startsWith=function(e){return 0===this.str.indexOf(e)},e.prototype.endsWith=function(e){var t="",r=e.split("").reverse().join("");return t=this.str.split("").reverse().join(""),this.startsWith.call({str:t},r)},e.prototype.contains=function(e){return-1!==this.str.indexOf(e)},e.prototype.equals=function(e){return this.str===e},e.prototype.value=function(){return this.str},e}();t.QueryableString=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Request=void 0;var n=r(24),i=function(){function e(e,t,r,i,o){this.id=n.id(),this.serviceIdentifier=e,this.parentContext=t,this.parentRequest=r,this.target=o,this.childRequests=[],this.bindings=Array.isArray(i)?i:[i],this.requestScope=null===r?new Map:null}return e.prototype.addChildRequest=function(t,r,n){var i=new e(t,this.parentContext,this,r,n);return this.childRequests.push(i),i},e}();t.Request=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resolve=void 0;var n=r(11),i=r(18),o=r(55),a=r(30),s=r(97),u=function(e,t,r){try{return r()}catch(r){throw o.isStackOverflowExeption(r)?new Error(n.CIRCULAR_DEPENDENCY_IN_FACTORY(e,t.toString())):r}},c=function(e){return function(t){t.parentContext.setCurrentRequest(t);var r=t.bindings,o=t.childRequests,f=t.target&&t.target.isArray(),l=!(t.parentRequest&&t.parentRequest.target&&t.target&&t.parentRequest.target.matchesArray(t.target.serviceIdentifier));if(f&&l)return o.map(function(t){var r;return c(e)(t)});var p=null;if(!t.target.isOptional()||0!==r.length){var h=r[0],d=h.scope===i.BindingScopeEnum.Singleton,y=h.scope===i.BindingScopeEnum.Request;if(d&&h.activated)return h.cache;if(y&&null!==e&&e.has(h.id))return e.get(h.id);if(h.type===i.BindingTypeEnum.ConstantValue)p=h.cache,h.activated=!0;else if(h.type===i.BindingTypeEnum.Function)p=h.cache,h.activated=!0;else if(h.type===i.BindingTypeEnum.Constructor)p=h.implementationType;else if(h.type===i.BindingTypeEnum.DynamicValue&&null!==h.dynamicValue)p=u("toDynamicValue",h.serviceIdentifier,function(){return h.dynamicValue(t.parentContext)});else if(h.type===i.BindingTypeEnum.Factory&&null!==h.factory)p=u("toFactory",h.serviceIdentifier,function(){return h.factory(t.parentContext)});else if(h.type===i.BindingTypeEnum.Provider&&null!==h.provider)p=u("toProvider",h.serviceIdentifier,function(){return h.provider(t.parentContext)});else{if(h.type!==i.BindingTypeEnum.Instance||null===h.implementationType){var g=a.getServiceIdentifierAsString(t.serviceIdentifier);throw new Error(n.INVALID_BINDING_TYPE+" "+g)}p=s.resolveInstance(h.implementationType,o,c(e))}return"function"==typeof h.onActivation&&(p=h.onActivation(t.parentContext,p)),d&&(h.cache=p,h.activated=!0),y&&null!==e&&!e.has(h.id)&&e.set(h.id,p),p}}};function f(e){var t;return c(e.plan.rootRequest.requestScope)(e.plan.rootRequest)}t.resolve=f},function(e,t,r){"use strict";var n=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.resolveInstance=void 0;var i=r(11),o=r(18),a=r(7);function s(e,t,r){var n=t.filter(function(e){return null!==e.target&&e.target.type===o.TargetTypeEnum.ClassProperty}),i=n.map(r);return n.forEach(function(t,r){var n="";n=t.target.name.value();var o=i[r];e[n]=o}),e}function u(e,t){return new(e.bind.apply(e,n([void 0],t)))}function c(e,t){if(Reflect.hasMetadata(a.POST_CONSTRUCT,e)){var r=Reflect.getMetadata(a.POST_CONSTRUCT,e);try{t[r.value]()}catch(t){throw new Error(i.POST_CONSTRUCT_ERROR(e.name,t.message))}}}function f(e,t,r){var n=null,i,a;t.length>0?n=s(n=u(e,t.filter(function(e){return null!==e.target&&e.target.type===o.TargetTypeEnum.ConstructorArgument}).map(r)),t,r):n=new e;return c(e,n),n}t.resolveInstance=f},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BindingToSyntax=void 0;var n=r(11),i=r(18),o=r(99),a=r(58),s=function(){function e(e){this._binding=e}return e.prototype.to=function(e){return this._binding.type=i.BindingTypeEnum.Instance,this._binding.implementationType=e,new o.BindingInWhenOnSyntax(this._binding)},e.prototype.toSelf=function(){if("function"!=typeof this._binding.serviceIdentifier)throw new Error(""+n.INVALID_TO_SELF_VALUE);var e=this._binding.serviceIdentifier;return this.to(e)},e.prototype.toConstantValue=function(e){return this._binding.type=i.BindingTypeEnum.ConstantValue,this._binding.cache=e,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=i.BindingScopeEnum.Singleton,new a.BindingWhenOnSyntax(this._binding)},e.prototype.toDynamicValue=function(e){return this._binding.type=i.BindingTypeEnum.DynamicValue,this._binding.cache=null,this._binding.dynamicValue=e,this._binding.implementationType=null,new o.BindingInWhenOnSyntax(this._binding)},e.prototype.toConstructor=function(e){return this._binding.type=i.BindingTypeEnum.Constructor,this._binding.implementationType=e,this._binding.scope=i.BindingScopeEnum.Singleton,new a.BindingWhenOnSyntax(this._binding)},e.prototype.toFactory=function(e){return this._binding.type=i.BindingTypeEnum.Factory,this._binding.factory=e,this._binding.scope=i.BindingScopeEnum.Singleton,new a.BindingWhenOnSyntax(this._binding)},e.prototype.toFunction=function(e){if("function"!=typeof e)throw new Error(n.INVALID_FUNCTION_BINDING);var t=this.toConstantValue(e);return this._binding.type=i.BindingTypeEnum.Function,this._binding.scope=i.BindingScopeEnum.Singleton,t},e.prototype.toAutoFactory=function(e){return this._binding.type=i.BindingTypeEnum.Factory,this._binding.factory=function(t){var r;return function(){return t.container.get(e)}},this._binding.scope=i.BindingScopeEnum.Singleton,new a.BindingWhenOnSyntax(this._binding)},e.prototype.toProvider=function(e){return this._binding.type=i.BindingTypeEnum.Provider,this._binding.provider=e,this._binding.scope=i.BindingScopeEnum.Singleton,new a.BindingWhenOnSyntax(this._binding)},e.prototype.toService=function(e){this.toDynamicValue(function(t){return t.container.get(e)})},e}();t.BindingToSyntax=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BindingInWhenOnSyntax=void 0;var n=r(100),i=r(46),o=r(47),a=function(){function e(e){this._binding=e,this._bindingWhenSyntax=new o.BindingWhenSyntax(this._binding),this._bindingOnSyntax=new i.BindingOnSyntax(this._binding),this._bindingInSyntax=new n.BindingInSyntax(e)}return e.prototype.inRequestScope=function(){return this._bindingInSyntax.inRequestScope()},e.prototype.inSingletonScope=function(){return this._bindingInSyntax.inSingletonScope()},e.prototype.inTransientScope=function(){return this._bindingInSyntax.inTransientScope()},e.prototype.when=function(e){return this._bindingWhenSyntax.when(e)},e.prototype.whenTargetNamed=function(e){return this._bindingWhenSyntax.whenTargetNamed(e)},e.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},e.prototype.whenTargetTagged=function(e,t){return this._bindingWhenSyntax.whenTargetTagged(e,t)},e.prototype.whenInjectedInto=function(e){return this._bindingWhenSyntax.whenInjectedInto(e)},e.prototype.whenParentNamed=function(e){return this._bindingWhenSyntax.whenParentNamed(e)},e.prototype.whenParentTagged=function(e,t){return this._bindingWhenSyntax.whenParentTagged(e,t)},e.prototype.whenAnyAncestorIs=function(e){return this._bindingWhenSyntax.whenAnyAncestorIs(e)},e.prototype.whenNoAncestorIs=function(e){return this._bindingWhenSyntax.whenNoAncestorIs(e)},e.prototype.whenAnyAncestorNamed=function(e){return this._bindingWhenSyntax.whenAnyAncestorNamed(e)},e.prototype.whenAnyAncestorTagged=function(e,t){return this._bindingWhenSyntax.whenAnyAncestorTagged(e,t)},e.prototype.whenNoAncestorNamed=function(e){return this._bindingWhenSyntax.whenNoAncestorNamed(e)},e.prototype.whenNoAncestorTagged=function(e,t){return this._bindingWhenSyntax.whenNoAncestorTagged(e,t)},e.prototype.whenAnyAncestorMatches=function(e){return this._bindingWhenSyntax.whenAnyAncestorMatches(e)},e.prototype.whenNoAncestorMatches=function(e){return this._bindingWhenSyntax.whenNoAncestorMatches(e)},e.prototype.onActivation=function(e){return this._bindingOnSyntax.onActivation(e)},e}();t.BindingInWhenOnSyntax=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BindingInSyntax=void 0;var n=r(18),i=r(58),o=function(){function e(e){this._binding=e}return e.prototype.inRequestScope=function(){return this._binding.scope=n.BindingScopeEnum.Request,new i.BindingWhenOnSyntax(this._binding)},e.prototype.inSingletonScope=function(){return this._binding.scope=n.BindingScopeEnum.Singleton,new i.BindingWhenOnSyntax(this._binding)},e.prototype.inTransientScope=function(){return this._binding.scope=n.BindingScopeEnum.Transient,new i.BindingWhenOnSyntax(this._binding)},e}();t.BindingInSyntax=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ContainerSnapshot=void 0;var n=function(){function e(){}return e.of=function(t,r){var n=new e;return n.bindings=t,n.middleware=r,n},e}();t.ContainerSnapshot=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Lookup=void 0;var n=r(11),i=function(){function e(){this._map=new Map}return e.prototype.getMap=function(){return this._map},e.prototype.add=function(e,t){if(null==e)throw new Error(n.NULL_ARGUMENT);if(null==t)throw new Error(n.NULL_ARGUMENT);var r=this._map.get(e);void 0!==r?(r.push(t),this._map.set(e,r)):this._map.set(e,[t])},e.prototype.get=function(e){if(null==e)throw new Error(n.NULL_ARGUMENT);var t=this._map.get(e);if(void 0!==t)return t;throw new Error(n.KEY_NOT_FOUND)},e.prototype.remove=function(e){if(null==e)throw new Error(n.NULL_ARGUMENT);if(!this._map.delete(e))throw new Error(n.KEY_NOT_FOUND)},e.prototype.removeByCondition=function(e){var t=this;this._map.forEach(function(r,n){var i=r.filter(function(t){return!e(t)});i.length>0?t._map.set(n,i):t._map.delete(n)})},e.prototype.hasKey=function(e){if(null==e)throw new Error(n.NULL_ARGUMENT);return this._map.has(e)},e.prototype.clone=function(){var t=new e;return this._map.forEach(function(e,r){e.forEach(function(e){return t.add(r,e.clone())})}),t},e.prototype.traverse=function(e){this._map.forEach(function(t,r){e(r,t)})},e}();t.Lookup=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AsyncContainerModule=t.ContainerModule=void 0;var n=r(24),i=function(){function e(e){this.id=n.id(),this.registry=e}return e}();t.ContainerModule=i;var o=function(){function e(e){this.id=n.id(),this.registry=e}return e}();t.AsyncContainerModule=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.injectable=void 0;var n=r(11),i=r(7);function o(){return function(e){if(Reflect.hasOwnMetadata(i.PARAM_TYPES,e))throw new Error(n.DUPLICATED_INJECTABLE_DECORATOR);var t=Reflect.getMetadata(i.DESIGN_PARAM_TYPES,e)||[];return Reflect.defineMetadata(i.PARAM_TYPES,t,e),e}}t.injectable=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tagged=void 0;var n=r(14),i=r(19);function o(e,t){return function(r,o,a){var s=new n.Metadata(e,t);"number"==typeof a?i.tagParameter(r,o,a,s):i.tagProperty(r,o,s)}}t.tagged=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.named=void 0;var n=r(7),i=r(14),o=r(19);function a(e){return function(t,r,a){var s=new i.Metadata(n.NAMED_TAG,e);"number"==typeof a?o.tagParameter(t,r,a,s):o.tagProperty(t,r,s)}}t.named=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.optional=void 0;var n=r(7),i=r(14),o=r(19);function a(){return function(e,t,r){var a=new i.Metadata(n.OPTIONAL_TAG,!0);"number"==typeof r?o.tagParameter(e,t,r,a):o.tagProperty(e,t,a)}}t.optional=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.unmanaged=void 0;var n=r(7),i=r(14),o=r(19);function a(){return function(e,t,r){var a=new i.Metadata(n.UNMANAGED_TAG,!0);o.tagParameter(e,t,r,a)}}t.unmanaged=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.multiInject=void 0;var n=r(7),i=r(14),o=r(19);function a(e){return function(t,r,a){var s=new i.Metadata(n.MULTI_INJECT_TAG,e);"number"==typeof a?o.tagParameter(t,r,a,s):o.tagProperty(t,r,s)}}t.multiInject=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.targetName=void 0;var n=r(7),i=r(14),o=r(19);function a(e){return function(t,r,a){var s=new i.Metadata(n.NAME_TAG,e);o.tagParameter(t,r,a,s)}}t.targetName=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.postConstruct=void 0;var n=r(11),i=r(7),o=r(14);function a(){return function(e,t,r){var a=new o.Metadata(i.POST_CONSTRUCT,t);if(Reflect.hasOwnMetadata(i.POST_CONSTRUCT,e.constructor))throw new Error(n.MULTIPLE_POST_CONSTRUCT_METHODS);Reflect.defineMetadata(i.POST_CONSTRUCT,a,e.constructor)}}t.postConstruct=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.multiBindToService=void 0;var n=function(e){return function(t){return function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return r.forEach(function(r){return e.bind(r).toService(t)})}}};t.multiBindToService=n},function(e,t,r){"use strict";var n=String.prototype.replace,i=/%20/g,o="RFC1738",a="RFC3986";e.exports={default:a,formatters:{RFC1738:function(e){return n.call(e,i,"+")},RFC3986:function(e){return String(e)}},RFC1738:o,RFC3986:a}},function(e,t,r){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e,t){return c(e)||u(e,t)||a(e,t)||o()}function o(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function a(e,t){if(e){if("string"==typeof e)return s(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?s(e,t):void 0}}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function u(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],u=!0,c=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){c=!0,i=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}function c(e){if(Array.isArray(e))return e}function f(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",i=r.toStringTag||"@@toStringTag";function o(r,n,i,o){var u=n&&n.prototype instanceof s?n:s,c=Object.create(u.prototype);return l(c,"_invoke",function(r,n,i){var o,s,u,c=0,f=i||[],l=!1,p={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function t(r,n){return o=r,s=0,u=e,p.n=n,a}};function h(r,n){for(s=r,u=n,t=0;!l&&c&&!i&&t<f.length;t++){var i,o=f[t],h=p.p,d=o[2];r>3?(i=d===n)&&(u=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=h&&((i=r<2&&h<o[1])?(s=0,p.v=n,p.n=o[1]):h<d&&(i=r<3||o[0]>n||n>d)&&(o[4]=r,o[5]=n,p.n=d,s=0))}if(i||r>1)return a;throw l=!0,n}return function(i,f,d){if(c>1)throw TypeError("Generator is already running");for(l&&1===f&&h(f,d),s=f,u=d;(t=s<2?e:u)||!l;){o||(s?s<3?(s>1&&(p.n=-1),h(s,u)):p.n=u:p.v=u);try{if(c=2,o){if(s||(i="next"),t=o[i]){if(!(t=t.call(o,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(u=TypeError("The iterator does not provide a '"+i+"' method"),s=1);o=e}else if((t=(l=p.n<0)?u:r.call(n,p))!==a)break}catch(t){o=e,s=1,u=t}finally{c=1}}return{value:t,done:l}}}(r,i,o),!0),c}var a={};function s(){}function u(){}function c(){}t=Object.getPrototypeOf;var p=[][n]?t(t([][n]())):(l(t={},n,function(){return this}),t),h=c.prototype=s.prototype=Object.create(p);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,l(e,i,"GeneratorFunction")),e.prototype=Object.create(h),e}return u.prototype=c,l(h,"constructor",c),l(c,"constructor",u),u.displayName="GeneratorFunction",l(c,i,"GeneratorFunction"),l(h),l(h,i,"Generator"),l(h,n,function(){return this}),l(h,"toString",function(){return"[object Generator]"}),(f=function e(){return{w:o,m:d}})()}function l(e,t,r,n){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}l=function e(t,r,n,o){function a(e,r){l(t,e,function(t){return this._invoke(e,r,t)})}r?i?i(t,r,{value:n,enumerable:!o,configurable:!o,writable:!o}):t[r]=n:(a("next",0),a("throw",1),a("return",2))},l(e,t,r,n)}function p(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function h(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var o=e.apply(t,r);function a(e){p(o,n,i,a,s,"next",e)}function s(e){p(o,n,i,a,s,"throw",e)}a(void 0)})}}function d(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function y(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,v(n.key),n)}}function g(e,t,r){return t&&y(e.prototype,t),r&&y(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function v(e){var t=m(e,"string");return"symbol"==n(t)?t:t+""}function m(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function b(e,t,r){return t=I(t),E(e,S()?Reflect.construct(t,r||[],I(e).constructor):t.apply(e,r))}function E(e,t){if(t&&("object"==n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return T(e)}function T(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function S(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(S=function t(){return!!e})()}function w(e,t,r,n){var i=C(I(1&n?e.prototype:e),t,r);return 2&n&&"function"==typeof i?function(e){return i.apply(r,e)}:i}function C(){return C="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=_(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}},C.apply(null,arguments)}function _(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=I(e)););return e}function I(e){return I=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},I(e)}function A(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&R(e,t)}function R(e,t){return R=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},R(e,t)}var O=r(115),P=r(67),B=r(132);e.exports=function(e){function t(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=r.type,i=r.alg,o=r.LDKeyClass,a=r.creator,s=r.verificationMethod,u=r.signer,c=r.key,f=r.proof,l=r.date,p=r.useNativeCanonize;if(d(this,t),(e=b(this,t,[{type:n,creator:a,verificationMethod:s,proof:f,date:l,useNativeCanonize:p}])).alg=i,e.LDKeyClass=o,e.signer=u,c){if(void 0===s&&void 0===a){var h=c.publicNode();h.owner?e.creator=h.id:e.verificationMethod=h.id}e.key=c,"function"==typeof c.signer&&(e.signer=c.signer()),"function"==typeof c.verifier&&(e.verifier=c.verifier())}return e}return A(t,e),g(t,[{key:"sign",value:function(){var e=h(f().m(function e(t){var r,n,i,o,a,s,u;return f().w(function(e){for(;;)switch(e.n){case 0:if(r=t.verifyData,n=t.proof,this.signer&&"function"==typeof this.signer.sign){e.n=1;break}throw new Error("A signer API has not been specified.");case 1:return i={alg:this.alg,b64:!1,crit:["b64"]},o=B.encodeBase64Url(JSON.stringify(i)),a=B.createJws({encodedHeader:o,verifyData:r}),e.n=2,this.signer.sign({data:a});case 2:return s=e.v,u=B.encodeBase64Url(s),n.jws=o+".."+u,e.a(2,n)}},e,this)}));function t(t){return e.apply(this,arguments)}return t}()},{key:"verifySignature",value:function(){var e=h(f().m(function e(t){var r,o,a,s,u,c,l,p,h,d,y,g,v;return f().w(function(e){for(;;)switch(e.p=e.n){case 0:if(r=t.verifyData,o=t.verificationMethod,(a=t.proof).jws&&"string"==typeof a.jws&&a.jws.includes(".")){e.n=1;break}throw new TypeError('The proof does not include a valid "jws" property.');case 1:s=a.jws.split("."),u=i(s,3),c=u[0],l=u[2],e.p=2,p=JSON.parse(B.decodeBase64UrlToString(c)),e.n=4;break;case 3:throw e.p=3,v=e.v,new Error("Could not parse JWS header; "+v);case 4:if(p&&"object"===n(p)){e.n=5;break}throw new Error("Invalid JWS header.");case 5:if(p.alg===this.alg&&!1===p.b64&&Array.isArray(p.crit)&&1===p.crit.length&&"b64"===p.crit[0]||3!==Object.keys(p).length){e.n=6;break}throw new Error("Invalid JWS header parameters for ".concat(this.type,"."));case 6:if(h=B.decodeBase64Url(l),d=B.createJws({encodedHeader:c,verifyData:r}),y=this.verifier){e.n=8;break}return e.n=7,this.LDKeyClass.from(o);case 7:g=e.v,y=g.verifier();case 8:return e.a(2,y.verify({data:d,signature:h}))}},e,this,[[2,3]])}));function t(t){return e.apply(this,arguments)}return t}()},{key:"assertVerificationMethod",value:function(){var e=h(f().m(function e(t){var r;return f().w(function(e){for(;;)switch(e.n){case 0:if(r=t.verificationMethod,P.hasValue(r,"type",this.requiredKeyType)){e.n=1;break}throw new Error('Invalid key type. Key type must be "'.concat(this.requiredKeyType,'".'));case 1:return e.a(2)}},e,this)}));function t(t){return e.apply(this,arguments)}return t}()},{key:"getVerificationMethod",value:function(){var e=h(f().m(function e(r){var n,i,o;return f().w(function(e){for(;;)switch(e.n){case 0:if(n=r.proof,i=r.documentLoader,!this.key){e.n=1;break}return e.a(2,this.key.publicNode());case 1:return e.n=2,w(t,"getVerificationMethod",this,3)([{proof:n,documentLoader:i}]);case 2:return o=e.v,e.n=3,this.assertVerificationMethod({verificationMethod:o});case 3:return e.a(2,o)}},e,this)}));function r(t){return e.apply(this,arguments)}return r}()},{key:"matchProof",value:function(){var e=h(f().m(function e(r){var i,o,a,s,u,c;return f().w(function(e){for(;;)switch(e.n){case 0:return i=r.proof,o=r.document,a=r.purpose,s=r.documentLoader,u=r.expansionMap,e.n=1,w(t,"matchProof",this,3)([{proof:i,document:o,purpose:a,documentLoader:s,expansionMap:u}]);case 1:if(e.v){e.n=2;break}return e.a(2,!1);case 2:if(this.key){e.n=3;break}return e.a(2,!0);case 3:if((c=i.verificationMethod)||(c=i.creator),"object"!==n(c)){e.n=4;break}return e.a(2,c.id===this.key.id);case 4:return e.a(2,c===this.key.id)}},e,this)}));function r(t){return e.apply(this,arguments)}return r}()}])}(O)},function(e,t,r){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function o(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach(function(t){a(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function a(e,t,r){return(t=d(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function s(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",i=r.toStringTag||"@@toStringTag";function o(r,n,i,o){var s=n&&n.prototype instanceof c?n:c,f=Object.create(s.prototype);return u(f,"_invoke",function(r,n,i){var o,s,u,c=0,f=i||[],l=!1,p={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function t(r,n){return o=r,s=0,u=e,p.n=n,a}};function h(r,n){for(s=r,u=n,t=0;!l&&c&&!i&&t<f.length;t++){var i,o=f[t],h=p.p,d=o[2];r>3?(i=d===n)&&(u=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=h&&((i=r<2&&h<o[1])?(s=0,p.v=n,p.n=o[1]):h<d&&(i=r<3||o[0]>n||n>d)&&(o[4]=r,o[5]=n,p.n=d,s=0))}if(i||r>1)return a;throw l=!0,n}return function(i,f,d){if(c>1)throw TypeError("Generator is already running");for(l&&1===f&&h(f,d),s=f,u=d;(t=s<2?e:u)||!l;){o||(s?s<3?(s>1&&(p.n=-1),h(s,u)):p.n=u:p.v=u);try{if(c=2,o){if(s||(i="next"),t=o[i]){if(!(t=t.call(o,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(u=TypeError("The iterator does not provide a '"+i+"' method"),s=1);o=e}else if((t=(l=p.n<0)?u:r.call(n,p))!==a)break}catch(t){o=e,s=1,u=t}finally{c=1}}return{value:t,done:l}}}(r,i,o),!0),f}var a={};function c(){}function f(){}function l(){}t=Object.getPrototypeOf;var p=[][n]?t(t([][n]())):(u(t={},n,function(){return this}),t),h=l.prototype=c.prototype=Object.create(p);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,u(e,i,"GeneratorFunction")),e.prototype=Object.create(h),e}return f.prototype=l,u(h,"constructor",l),u(l,"constructor",f),f.displayName="GeneratorFunction",u(l,i,"GeneratorFunction"),u(h),u(h,i,"Generator"),u(h,n,function(){return this}),u(h,"toString",function(){return"[object Generator]"}),(s=function e(){return{w:o,m:d}})()}function u(e,t,r,n){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}u=function e(t,r,n,o){function a(e,r){u(t,e,function(t){return this._invoke(e,r,t)})}r?i?i(t,r,{value:n,enumerable:!o,configurable:!o,writable:!o}):t[r]=n:(a("next",0),a("throw",1),a("return",2))},u(e,t,r,n)}function c(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function f(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var o=e.apply(t,r);function a(e){c(o,n,i,a,s,"next",e)}function s(e){c(o,n,i,a,s,"throw",e)}a(void 0)})}}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function p(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,d(n.key),n)}}function h(e,t,r){return t&&p(e.prototype,t),r&&p(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function d(e){var t=y(e,"string");return"symbol"==n(t)?t:t+""}function y(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function g(e,t,r){return t=E(t),v(e,b()?Reflect.construct(t,r||[],E(e).constructor):t.apply(e,r))}function v(e,t){if(t&&("object"==n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return m(e)}function m(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function b(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(b=function t(){return!!e})()}function E(e){return E=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},E(e)}function T(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&S(e,t)}function S(e,t){return S=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},S(e,t)}var w=r(66),C=r(67),_=r(132),I=r(150);e.exports=function(e){function t(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=r.type,i=r.creator,o=r.verificationMethod,a=r.proof,s=r.date,u=r.useNativeCanonize;if(l(this,t),void 0!==o&&"string"!=typeof o)throw new TypeError('"verificationMethod" must be a URL string.');if((e=g(this,t,[{type:n}])).creator=i,e.verificationMethod=o,e.proof=a,void 0!==s&&(e.date=new Date(s),isNaN(e.date)))throw TypeError('"date" "'.concat(s,'" is not a valid date.'));return e.useNativeCanonize=u,e}return T(t,e),h(t,[{key:"createProof",value:function(){var e=f(s().m(function e(t){var r,n,i,o,a,u,c,f;return s().w(function(e){for(;;)switch(e.n){case 0:if(r=t.document,n=t.purpose,i=t.documentLoader,o=t.expansionMap,a=t.compactProof,!this.proof){e.n=2;break}return e.n=1,C.compact(this.proof,w.SECURITY_CONTEXT_URL,{documentLoader:i,expansionMap:o,compactToRelative:!1});case 1:u=e.v,e.n=3;break;case 2:u={"@context":w.SECURITY_CONTEXT_URL};case 3:return u.type=this.type,c=this.date,void 0===u.created&&void 0===c&&(c=new Date),void 0!==c&&"string"!=typeof c&&(c=_.w3cDate(c)),void 0!==c&&(u.created=c),void 0!==this.verificationMethod&&(u.verificationMethod=this.verificationMethod),void 0!==this.creator&&(u.creator=this.creator),e.n=4,this.updateProof({document:r,proof:u,purpose:n,documentLoader:i,expansionMap:o,compactProof:a});case 4:return u=e.v,e.n=5,n.update(u,{document:r,suite:this,documentLoader:i,expansionMap:o});case 5:return u=e.v,e.n=6,this.createVerifyData({document:r,proof:u,documentLoader:i,expansionMap:o,compactProof:a});case 6:return f=e.v,e.n=7,this.sign({verifyData:f,document:r,proof:u,documentLoader:i,expansionMap:o});case 7:return u=e.v,e.a(2,u)}},e,this)}));function t(t){return e.apply(this,arguments)}return t}()},{key:"updateProof",value:function(){var e=f(s().m(function e(t){var r;return s().w(function(e){for(;;)if(0===e.n)return r=t.proof,e.a(2,r)},e)}));function t(t){return e.apply(this,arguments)}return t}()},{key:"verifyProof",value:function(){var e=f(s().m(function e(t){var r,n,i,o,a,u,c,f,l,p,h;return s().w(function(e){for(;;)switch(e.p=e.n){case 0:return r=t.proof,n=t.document,i=t.purpose,o=t.documentLoader,a=t.expansionMap,u=t.compactProof,e.p=1,e.n=2,this.createVerifyData({document:n,proof:r,documentLoader:o,expansionMap:a,compactProof:u});case 2:return c=e.v,e.n=3,this.getVerificationMethod({proof:r,document:n,documentLoader:o,expansionMap:a});case 3:return f=e.v,e.n=4,this.verifySignature({verifyData:c,verificationMethod:f,document:n,proof:r,documentLoader:o,expansionMap:a});case 4:if(l=e.v){e.n=5;break}throw new Error("Invalid signature.");case 5:return e.n=6,i.validate(r,{document:n,suite:this,verificationMethod:f,documentLoader:o,expansionMap:a});case 6:if((p=e.v).valid){e.n=7;break}throw p.error;case 7:return e.a(2,{verified:!0,purposeResult:p});case 8:return e.p=8,h=e.v,e.a(2,{verified:!1,error:h})}},e,this,[[1,8]])}));function t(t){return e.apply(this,arguments)}return t}()},{key:"canonize",value:function(){var e=f(s().m(function e(t,r){var n,i,o;return s().w(function(e){for(;;)if(0===e.n)return n=r.documentLoader,i=r.expansionMap,o=r.skipExpansion,e.a(2,C.canonize(t,{algorithm:"URDNA2015",format:"application/n-quads",documentLoader:n,expansionMap:i,skipExpansion:o,useNative:this.useNativeCanonize}))},e,this)}));function t(t,r){return e.apply(this,arguments)}return t}()},{key:"canonizeProof",value:function(){var e=f(s().m(function e(t,r){var n,i;return s().w(function(e){for(;;)if(0===e.n)return n=r.documentLoader,i=r.expansionMap,delete(t=o({},t)).jws,delete t.signatureValue,delete t.proofValue,e.a(2,this.canonize(t,{documentLoader:n,expansionMap:i,skipExpansion:!1}))},e,this)}));function t(t,r){return e.apply(this,arguments)}return t}()},{key:"createVerifyData",value:function(){var e=f(s().m(function e(t){var r,n,i,o,a,u;return s().w(function(e){for(;;)switch(e.n){case 0:return r=t.document,n=t.proof,i=t.documentLoader,o=t.expansionMap,e.n=1,this.canonizeProof(n,{documentLoader:i,expansionMap:o});case 1:return a=e.v,e.n=2,this.canonize(r,{documentLoader:i,expansionMap:o});case 2:return u=e.v,e.a(2,_.concat(_.sha256(a),_.sha256(u)))}},e,this)}));function t(t){return e.apply(this,arguments)}return t}()},{key:"getVerificationMethod",value:function(){var e=f(s().m(function e(t){var r,i,o,a,u;return s().w(function(e){for(;;)switch(e.n){case 0:if(r=t.proof,i=t.documentLoader,(o=r.verificationMethod)||(a=r.creator,o=a),"object"===n(o)&&(o=o.id),o){e.n=1;break}throw new Error('No "verificationMethod" or "creator" found in proof.');case 1:return e.n=2,C.frame(o,{"@context":w.SECURITY_CONTEXT_URL,"@embed":"@always",id:o},{documentLoader:i,compactToRelative:!1});case 2:if(u=e.v){e.n=3;break}throw new Error("Verification method ".concat(o," not found."));case 3:if(void 0===u.revoked){e.n=4;break}throw new Error("The verification method has been revoked.");case 4:return e.a(2,u)}},e)}));function t(t){return e.apply(this,arguments)}return t}()},{key:"sign",value:function(){var e=f(s().m(function e(){return s().w(function(e){for(;;)switch(e.n){case 0:throw new Error("Must be implemented by a derived class.");case 1:return e.a(2)}},e)}));function t(){return e.apply(this,arguments)}return t}()},{key:"verifySignature",value:function(){var e=f(s().m(function e(){return s().w(function(e){for(;;)switch(e.n){case 0:throw new Error("Must be implemented by a derived class.");case 1:return e.a(2)}},e)}));function t(){return e.apply(this,arguments)}return t}()}])}(I)},function(e,t,r){"use strict";(function(e){var n=r(185),i=r(186),o=r(187);function a(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}function s(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function u(e,t){if(s()<t)throw new RangeError("Invalid typed array length");return c.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=c.prototype:(null===e&&(e=new c(t)),e.length=t),e}function c(e,t,r){if(!(c.TYPED_ARRAY_SUPPORT||this instanceof c))return new c(e,t,r);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return h(this,e)}return f(this,e,t,r)}function f(e,t,r,n){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?g(e,t,r,n):"string"==typeof t?d(e,t,r):v(e,t)}function l(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function p(e,t,r,n){return l(t),t<=0?u(e,t):void 0!==r?"string"==typeof n?u(e,t).fill(r,n):u(e,t).fill(r):u(e,t)}function h(e,t){if(l(t),e=u(e,t<0?0:0|m(t)),!c.TYPED_ARRAY_SUPPORT)for(var r=0;r<t;++r)e[r]=0;return e}function d(e,t,r){if("string"==typeof r&&""!==r||(r="utf8"),!c.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|E(t,r),i=(e=u(e,n)).write(t,r);return i!==n&&(e=e.slice(0,i)),e}function y(e,t){var r=t.length<0?0:0|m(t.length);e=u(e,r);for(var n=0;n<r;n+=1)e[n]=255&t[n];return e}function g(e,t,r,n){if(t.byteLength,r<0||t.byteLength<r)throw new RangeError("'offset' is out of bounds");if(t.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");return t=void 0===r&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,r):new Uint8Array(t,r,n),c.TYPED_ARRAY_SUPPORT?(e=t).__proto__=c.prototype:e=y(e,t),e}function v(e,t){if(c.isBuffer(t)){var r=0|m(t.length);return 0===(e=u(e,r)).length||t.copy(e,0,0,r),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||te(t.length)?u(e,0):y(e,t);if("Buffer"===t.type&&o(t.data))return y(e,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function m(e){if(e>=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|e}function b(e){return+e!=e&&(e=0),c.alloc(+e)}function E(e,t){if(c.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return X(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return J(e).length;default:if(n)return X(e).length;t=(""+t).toLowerCase(),n=!0}}function T(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return L(this,t,r);case"utf8":case"utf-8":return k(this,t,r);case"ascii":return D(this,t,r);case"latin1":case"binary":return x(this,t,r);case"base64":return B(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function S(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function w(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=c.from(t,n)),c.isBuffer(t))return 0===t.length?-1:C(e,t,r,n,i);if("number"==typeof t)return t&=255,c.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):C(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function C(e,t,r,n,i){var o=1,a=e.length,s=t.length,u;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;o=2,a/=2,s/=2,r/=2}function c(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i){var f=-1;for(u=r;u<a;u++)if(c(e,u)===c(t,-1===f?0:u-f)){if(-1===f&&(f=u),u-f+1===s)return f*o}else-1!==f&&(u-=u-f),f=-1}else for(r+s>a&&(r=a-s),u=r;u>=0;u--){for(var l=!0,p=0;p<s;p++)if(c(e,u+p)!==c(t,p)){l=!1;break}if(l)return u}return-1}function _(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a<n;++a){var s=parseInt(t.substr(2*a,2),16);if(isNaN(s))return a;e[r+a]=s}return a}function I(e,t,r,n){return ee(X(t,e.length-r),e,r,n)}function A(e,t,r,n){return ee(Z(t),e,r,n)}function R(e,t,r,n){return A(e,t,r,n)}function O(e,t,r,n){return ee(J(t),e,r,n)}function P(e,t,r,n){return ee($(t,e.length-r),e,r,n)}function B(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function k(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var o=e[i],a=null,s=o>239?4:o>223?3:o>191?2:1,u,c,f,l;if(i+s<=r)switch(s){case 1:o<128&&(a=o);break;case 2:128==(192&(u=e[i+1]))&&(l=(31&o)<<6|63&u)>127&&(a=l);break;case 3:u=e[i+1],c=e[i+2],128==(192&u)&&128==(192&c)&&(l=(15&o)<<12|(63&u)<<6|63&c)>2047&&(l<55296||l>57343)&&(a=l);break;case 4:u=e[i+1],c=e[i+2],f=e[i+3],128==(192&u)&&128==(192&c)&&128==(192&f)&&(l=(15&o)<<18|(63&u)<<12|(63&c)<<6|63&f)>65535&&l<1114112&&(a=l)}null===a?(a=65533,s=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|1023&a),n.push(a),i+=s}return U(n)}t.Buffer=c,t.SlowBuffer=b,t.INSPECT_MAX_BYTES=50,c.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:a(),t.kMaxLength=s(),c.poolSize=8192,c._augment=function(e){return e.__proto__=c.prototype,e},c.from=function(e,t,r){return f(null,e,t,r)},c.TYPED_ARRAY_SUPPORT&&(c.prototype.__proto__=Uint8Array.prototype,c.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&c[Symbol.species]===c&&Object.defineProperty(c,Symbol.species,{value:null,configurable:!0})),c.alloc=function(e,t,r){return p(null,e,t,r)},c.allocUnsafe=function(e){return h(null,e)},c.allocUnsafeSlow=function(e){return h(null,e)},c.isBuffer=function e(t){return!(null==t||!t._isBuffer)},c.compare=function e(t,r){if(!c.isBuffer(t)||!c.isBuffer(r))throw new TypeError("Arguments must be Buffers");if(t===r)return 0;for(var n=t.length,i=r.length,o=0,a=Math.min(n,i);o<a;++o)if(t[o]!==r[o]){n=t[o],i=r[o];break}return n<i?-1:i<n?1:0},c.isEncoding=function e(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}},c.concat=function e(t,r){if(!o(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return c.alloc(0);var n;if(void 0===r)for(r=0,n=0;n<t.length;++n)r+=t[n].length;var i=c.allocUnsafe(r),a=0;for(n=0;n<t.length;++n){var s=t[n];if(!c.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(i,a),a+=s.length}return i},c.byteLength=E,c.prototype._isBuffer=!0,c.prototype.swap16=function e(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r<t;r+=2)S(this,r,r+1);return this},c.prototype.swap32=function e(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var r=0;r<t;r+=4)S(this,r,r+3),S(this,r+1,r+2);return this},c.prototype.swap64=function e(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var r=0;r<t;r+=8)S(this,r,r+7),S(this,r+1,r+6),S(this,r+2,r+5),S(this,r+3,r+4);return this},c.prototype.toString=function e(){var t=0|this.length;return 0===t?"":0===arguments.length?k(this,0,t):T.apply(this,arguments)},c.prototype.equals=function e(t){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===c.compare(this,t)},c.prototype.inspect=function e(){var r="",n=t.INSPECT_MAX_BYTES;return this.length>0&&(r=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(r+=" ... ")),"<Buffer "+r+">"},c.prototype.compare=function e(t,r,n,i,o){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===r&&(r=0),void 0===n&&(n=t?t.length:0),void 0===i&&(i=0),void 0===o&&(o=this.length),r<0||n>t.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&r>=n)return 0;if(i>=o)return-1;if(r>=n)return 1;if(this===t)return 0;for(var a=(o>>>=0)-(i>>>=0),s=(n>>>=0)-(r>>>=0),u=Math.min(a,s),f=this.slice(i,o),l=t.slice(r,n),p=0;p<u;++p)if(f[p]!==l[p]){a=f[p],s=l[p];break}return a<s?-1:s<a?1:0},c.prototype.includes=function e(t,r,n){return-1!==this.indexOf(t,r,n)},c.prototype.indexOf=function e(t,r,n){return w(this,t,r,n,!0)},c.prototype.lastIndexOf=function e(t,r,n){return w(this,t,r,n,!1)},c.prototype.write=function e(t,r,n,i){if(void 0===r)i="utf8",n=this.length,r=0;else if(void 0===n&&"string"==typeof r)i=r,n=this.length,r=0;else{if(!isFinite(r))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");r|=0,isFinite(n)?(n|=0,void 0===i&&(i="utf8")):(i=n,n=void 0)}var o=this.length-r;if((void 0===n||n>o)&&(n=o),t.length>0&&(n<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var a=!1;;)switch(i){case"hex":return _(this,t,r,n);case"utf8":case"utf-8":return I(this,t,r,n);case"ascii":return A(this,t,r,n);case"latin1":case"binary":return R(this,t,r,n);case"base64":return O(this,t,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,t,r,n);default:if(a)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),a=!0}},c.prototype.toJSON=function e(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var N=4096;function U(e){var t=e.length;if(t<=N)return String.fromCharCode.apply(String,e);for(var r="",n=0;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=N));return r}function D(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function x(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function L(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=t;o<r;++o)i+=Q(e[o]);return i}function j(e,t,r){for(var n=e.slice(t,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function M(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function V(e,t,r,n,i,o){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function F(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-r,2);i<o;++i)e[r+i]=(t&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function K(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-r,4);i<o;++i)e[r+i]=t>>>8*(n?i:3-i)&255}function H(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function q(e,t,r,n,o){return o||H(e,t,r,4,34028234663852886e22,-34028234663852886e22),i.write(e,t,r,n,23,4),r+4}function G(e,t,r,n,o){return o||H(e,t,r,8,17976931348623157e292,-17976931348623157e292),i.write(e,t,r,n,52,8),r+8}c.prototype.slice=function e(t,r){var n=this.length,i;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(r=void 0===r?n:~~r)<0?(r+=n)<0&&(r=0):r>n&&(r=n),r<t&&(r=t),c.TYPED_ARRAY_SUPPORT)(i=this.subarray(t,r)).__proto__=c.prototype;else{var o=r-t;i=new c(o,void 0);for(var a=0;a<o;++a)i[a]=this[a+t]}return i},c.prototype.readUIntLE=function e(t,r,n){t|=0,r|=0,n||M(t,r,this.length);for(var i=this[t],o=1,a=0;++a<r&&(o*=256);)i+=this[t+a]*o;return i},c.prototype.readUIntBE=function e(t,r,n){t|=0,r|=0,n||M(t,r,this.length);for(var i=this[t+--r],o=1;r>0&&(o*=256);)i+=this[t+--r]*o;return i},c.prototype.readUInt8=function e(t,r){return r||M(t,1,this.length),this[t]},c.prototype.readUInt16LE=function e(t,r){return r||M(t,2,this.length),this[t]|this[t+1]<<8},c.prototype.readUInt16BE=function e(t,r){return r||M(t,2,this.length),this[t]<<8|this[t+1]},c.prototype.readUInt32LE=function e(t,r){return r||M(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},c.prototype.readUInt32BE=function e(t,r){return r||M(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},c.prototype.readIntLE=function e(t,r,n){t|=0,r|=0,n||M(t,r,this.length);for(var i=this[t],o=1,a=0;++a<r&&(o*=256);)i+=this[t+a]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*r)),i},c.prototype.readIntBE=function e(t,r,n){t|=0,r|=0,n||M(t,r,this.length);for(var i=r,o=1,a=this[t+--i];i>0&&(o*=256);)a+=this[t+--i]*o;return a>=(o*=128)&&(a-=Math.pow(2,8*r)),a},c.prototype.readInt8=function e(t,r){return r||M(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},c.prototype.readInt16LE=function e(t,r){r||M(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt16BE=function e(t,r){r||M(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt32LE=function e(t,r){return r||M(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},c.prototype.readInt32BE=function e(t,r){return r||M(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},c.prototype.readFloatLE=function e(t,r){return r||M(t,4,this.length),i.read(this,t,!0,23,4)},c.prototype.readFloatBE=function e(t,r){return r||M(t,4,this.length),i.read(this,t,!1,23,4)},c.prototype.readDoubleLE=function e(t,r){return r||M(t,8,this.length),i.read(this,t,!0,52,8)},c.prototype.readDoubleBE=function e(t,r){return r||M(t,8,this.length),i.read(this,t,!1,52,8)},c.prototype.writeUIntLE=function e(t,r,n,i){var o;(t=+t,r|=0,n|=0,i)||V(this,t,r,n,Math.pow(2,8*n)-1,0);var a=1,s=0;for(this[r]=255&t;++s<n&&(a*=256);)this[r+s]=t/a&255;return r+n},c.prototype.writeUIntBE=function e(t,r,n,i){var o;(t=+t,r|=0,n|=0,i)||V(this,t,r,n,Math.pow(2,8*n)-1,0);var a=n-1,s=1;for(this[r+a]=255&t;--a>=0&&(s*=256);)this[r+a]=t/s&255;return r+n},c.prototype.writeUInt8=function e(t,r,n){return t=+t,r|=0,n||V(this,t,r,1,255,0),c.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[r]=255&t,r+1},c.prototype.writeUInt16LE=function e(t,r,n){return t=+t,r|=0,n||V(this,t,r,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):F(this,t,r,!0),r+2},c.prototype.writeUInt16BE=function e(t,r,n){return t=+t,r|=0,n||V(this,t,r,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):F(this,t,r,!1),r+2},c.prototype.writeUInt32LE=function e(t,r,n){return t=+t,r|=0,n||V(this,t,r,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=255&t):K(this,t,r,!0),r+4},c.prototype.writeUInt32BE=function e(t,r,n){return t=+t,r|=0,n||V(this,t,r,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):K(this,t,r,!1),r+4},c.prototype.writeIntLE=function e(t,r,n,i){if(t=+t,r|=0,!i){var o=Math.pow(2,8*n-1);V(this,t,r,n,o-1,-o)}var a=0,s=1,u=0;for(this[r]=255&t;++a<n&&(s*=256);)t<0&&0===u&&0!==this[r+a-1]&&(u=1),this[r+a]=(t/s|0)-u&255;return r+n},c.prototype.writeIntBE=function e(t,r,n,i){if(t=+t,r|=0,!i){var o=Math.pow(2,8*n-1);V(this,t,r,n,o-1,-o)}var a=n-1,s=1,u=0;for(this[r+a]=255&t;--a>=0&&(s*=256);)t<0&&0===u&&0!==this[r+a+1]&&(u=1),this[r+a]=(t/s|0)-u&255;return r+n},c.prototype.writeInt8=function e(t,r,n){return t=+t,r|=0,n||V(this,t,r,1,127,-128),c.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[r]=255&t,r+1},c.prototype.writeInt16LE=function e(t,r,n){return t=+t,r|=0,n||V(this,t,r,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):F(this,t,r,!0),r+2},c.prototype.writeInt16BE=function e(t,r,n){return t=+t,r|=0,n||V(this,t,r,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):F(this,t,r,!1),r+2},c.prototype.writeInt32LE=function e(t,r,n){return t=+t,r|=0,n||V(this,t,r,4,2147483647,-2147483648),c.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24):K(this,t,r,!0),r+4},c.prototype.writeInt32BE=function e(t,r,n){return t=+t,r|=0,n||V(this,t,r,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),c.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):K(this,t,r,!1),r+4},c.prototype.writeFloatLE=function e(t,r,n){return q(this,t,r,!0,n)},c.prototype.writeFloatBE=function e(t,r,n){return q(this,t,r,!1,n)},c.prototype.writeDoubleLE=function e(t,r,n){return G(this,t,r,!0,n)},c.prototype.writeDoubleBE=function e(t,r,n){return G(this,t,r,!1,n)},c.prototype.copy=function e(t,r,n,i){if(n||(n=0),i||0===i||(i=this.length),r>=t.length&&(r=t.length),r||(r=0),i>0&&i<n&&(i=n),i===n)return 0;if(0===t.length||0===this.length)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-r<i-n&&(i=t.length-r+n);var o=i-n,a;if(this===t&&n<r&&r<i)for(a=o-1;a>=0;--a)t[a+r]=this[a+n];else if(o<1e3||!c.TYPED_ARRAY_SUPPORT)for(a=0;a<o;++a)t[a+r]=this[a+n];else Uint8Array.prototype.set.call(t,this.subarray(n,n+o),r);return o},c.prototype.fill=function e(t,r,n,i){if("string"==typeof t){if("string"==typeof r?(i=r,r=0,n=this.length):"string"==typeof n&&(i=n,n=this.length),1===t.length){var o=t.charCodeAt(0);o<256&&(t=o)}if(void 0!==i&&"string"!=typeof i)throw new TypeError("encoding must be a string");if("string"==typeof i&&!c.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}else"number"==typeof t&&(t&=255);if(r<0||this.length<r||this.length<n)throw new RangeError("Out of range index");if(n<=r)return this;var a;if(r>>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(a=r;a<n;++a)this[a]=t;else{var s=c.isBuffer(t)?t:X(new c(t,i).toString()),u=s.length;for(a=0;a<n-r;++a)this[a+r]=s[a%u]}return this};var z=/[^+\/0-9A-Za-z-_]/g;function Y(e){if((e=W(e).replace(z,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}function W(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function Q(e){return e<16?"0"+e.toString(16):e.toString(16)}function X(e,t){var r;t=t||1/0;for(var n=e.length,i=null,o=[],a=0;a<n;++a){if((r=e.charCodeAt(a))>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function Z(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}function $(e,t){for(var r,n,i,o=[],a=0;a<e.length&&!((t-=2)<0);++a)n=(r=e.charCodeAt(a))>>8,i=r%256,o.push(i),o.push(n);return o}function J(e){return n.toByteArray(Y(e))}function ee(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function te(e){return e!=e}}).call(this,r(29))},function(e,t,r){e.exports=r(4),r(48),r(190),r(33),r(118),r(147),r(75),r(192),r(68),r(194),r(149),r(195),r(146),r(120),r(51),r(142),r(144),r(196),r(137),r(143),r(140),r(123),r(31),r(141),r(197),r(198),r(136),r(8)},function(e,t,r){var n=r(4);r(8),e.exports=n.cipher=n.cipher||{},n.cipher.algorithms=n.cipher.algorithms||{},n.cipher.createCipher=function(e,t){var r=e;if("string"==typeof r&&(r=n.cipher.getAlgorithm(r))&&(r=r()),!r)throw new Error("Unsupported algorithm: "+e);return new n.cipher.BlockCipher({algorithm:r,key:t,decrypt:!1})},n.cipher.createDecipher=function(e,t){var r=e;if("string"==typeof r&&(r=n.cipher.getAlgorithm(r))&&(r=r()),!r)throw new Error("Unsupported algorithm: "+e);return new n.cipher.BlockCipher({algorithm:r,key:t,decrypt:!0})},n.cipher.registerAlgorithm=function(e,t){e=e.toUpperCase(),n.cipher.algorithms[e]=t},n.cipher.getAlgorithm=function(e){return(e=e.toUpperCase())in n.cipher.algorithms?n.cipher.algorithms[e]:null};var i=n.cipher.BlockCipher=function(e){this.algorithm=e.algorithm,this.mode=this.algorithm.mode,this.blockSize=this.mode.blockSize,this._finish=!1,this._input=null,this.output=null,this._op=e.decrypt?this.mode.decrypt:this.mode.encrypt,this._decrypt=e.decrypt,this.algorithm.initialize(e)};i.prototype.start=function(e){e=e||{};var t={};for(var r in e)t[r]=e[r];t.decrypt=this._decrypt,this._finish=!1,this._input=n.util.createBuffer(),this.output=e.output||n.util.createBuffer(),this.mode.start(t)},i.prototype.update=function(e){for(e&&this._input.putBuffer(e);!this._op.call(this.mode,this._input,this.output,this._finish)&&!this._finish;);this._input.compact()},i.prototype.finish=function(e){!e||"ECB"!==this.mode.name&&"CBC"!==this.mode.name||(this.mode.pad=function(t){return e(this.blockSize,t,!1)},this.mode.unpad=function(t){return e(this.blockSize,t,!0)});var t={};return t.decrypt=this._decrypt,t.overflow=this._input.length()%this.blockSize,!(!this._decrypt&&this.mode.pad&&!this.mode.pad(this._input,t))&&(this._finish=!0,this.update(),!(this._decrypt&&this.mode.unpad&&!this.mode.unpad(this.output,t))&&!(this.mode.afterFinish&&!this.mode.afterFinish(this.output,t)))}},function(e,t,r){var n=r(4);r(37),r(8);var i=e.exports=n.md5=n.md5||{};n.md.md5=n.md.algorithms.md5=i,i.create=function(){c||f();var e=null,t=n.util.createBuffer(),r=new Array(16),i={algorithm:"md5",blockLength:64,digestLength:16,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){i.messageLength=0,i.fullMessageLength=i.messageLength64=[];for(var r=i.messageLengthSize/4,o=0;o<r;++o)i.fullMessageLength.push(0);return t=n.util.createBuffer(),e={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878},i}};return i.start(),i.update=function(o,a){"utf8"===a&&(o=n.util.encodeUtf8(o));var s=o.length;i.messageLength+=s,s=[s/4294967296>>>0,s>>>0];for(var u=i.fullMessageLength.length-1;u>=0;--u)i.fullMessageLength[u]+=s[1],s[1]=s[0]+(i.fullMessageLength[u]/4294967296>>>0),i.fullMessageLength[u]=i.fullMessageLength[u]>>>0,s[0]=s[1]/4294967296>>>0;return t.putBytes(o),l(e,r,t),(t.read>2048||0===t.length())&&t.compact(),i},i.digest=function(){var a=n.util.createBuffer();a.putBytes(t.bytes());var s,u=i.fullMessageLength[i.fullMessageLength.length-1]+i.messageLengthSize&i.blockLength-1;a.putBytes(o.substr(0,i.blockLength-u));for(var c,f=0,p=i.fullMessageLength.length-1;p>=0;--p)f=(c=8*i.fullMessageLength[p]+f)/4294967296>>>0,a.putInt32Le(c>>>0);var h={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3};l(h,r,a);var d=n.util.createBuffer();return d.putInt32Le(h.h0),d.putInt32Le(h.h1),d.putInt32Le(h.h2),d.putInt32Le(h.h3),d},i};var o=null,a=null,s=null,u=null,c=!1;function f(){o=String.fromCharCode(128),o+=n.util.fillString(String.fromCharCode(0),64),a=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,1,6,11,0,5,10,15,4,9,14,3,8,13,2,7,12,5,8,11,14,1,4,7,10,13,0,3,6,9,12,15,2,0,7,14,5,12,3,10,1,8,15,6,13,4,11,2,9],s=[7,12,17,22,7,12,17,22,7,12,17,22,7,12,17,22,5,9,14,20,5,9,14,20,5,9,14,20,5,9,14,20,4,11,16,23,4,11,16,23,4,11,16,23,4,11,16,23,6,10,15,21,6,10,15,21,6,10,15,21,6,10,15,21],u=new Array(64);for(var e=0;e<64;++e)u[e]=Math.floor(4294967296*Math.abs(Math.sin(e+1)));c=!0}function l(e,t,r){for(var n,i,o,c,f,l,p,h,d=r.length();d>=64;){for(i=e.h0,o=e.h1,c=e.h2,f=e.h3,h=0;h<16;++h)t[h]=r.getInt32Le(),n=i+(l=f^o&(c^f))+u[h]+t[h],i=f,f=c,c=o,o+=n<<(p=s[h])|n>>>32-p;for(;h<32;++h)n=i+(l=c^f&(o^c))+u[h]+t[a[h]],i=f,f=c,c=o,o+=n<<(p=s[h])|n>>>32-p;for(;h<48;++h)n=i+(l=o^c^f)+u[h]+t[a[h]],i=f,f=c,c=o,o+=n<<(p=s[h])|n>>>32-p;for(;h<64;++h)n=i+(l=c^(o|~f))+u[h]+t[a[h]],i=f,f=c,c=o,o+=n<<(p=s[h])|n>>>32-p;e.h0=e.h0+i|0,e.h1=e.h1+o|0,e.h2=e.h2+c|0,e.h3=e.h3+f|0,d-=64}}},function(e,t,r){(function(t){var n=r(4);r(68),r(37),r(8);var i=n.pkcs5=n.pkcs5||{},o;n.util.isNodejs&&!n.options.usePureJavaScript&&(o=r(121)),e.exports=n.pbkdf2=i.pbkdf2=function(e,r,i,a,s,u){if("function"==typeof s&&(u=s,s=null),n.util.isNodejs&&!n.options.usePureJavaScript&&o.pbkdf2&&(null===s||"object"!=typeof s)&&(o.pbkdf2Sync.length>4||!s||"sha1"===s))return"string"!=typeof s&&(s="sha1"),e=t.from(e,"binary"),r=t.from(r,"binary"),u?4===o.pbkdf2Sync.length?o.pbkdf2(e,r,i,a,function(e,t){if(e)return u(e);u(null,t.toString("binary"))}):o.pbkdf2(e,r,i,a,s,function(e,t){if(e)return u(e);u(null,t.toString("binary"))}):4===o.pbkdf2Sync.length?o.pbkdf2Sync(e,r,i,a).toString("binary"):o.pbkdf2Sync(e,r,i,a,s).toString("binary");if(null==s&&(s="sha1"),"string"==typeof s){if(!(s in n.md.algorithms))throw new Error("Unknown hash algorithm: "+s);s=n.md[s].create()}var c=s.digestLength;if(a>4294967295*c){var f=new Error("Derived key is too long.");if(u)return u(f);throw f}var l=Math.ceil(a/c),p=a-(l-1)*c,h=n.hmac.create();h.start(s,e);var d="",y,g,v;if(!u){for(var m=1;m<=l;++m){h.start(null,null),h.update(r),h.update(n.util.int32ToBytes(m)),y=v=h.digest().getBytes();for(var b=2;b<=i;++b)h.start(null,null),h.update(v),g=h.digest().getBytes(),y=n.util.xorBytes(y,g,c),v=g;d+=m<l?y:y.substr(0,p)}return d}var m=1,b;function E(){if(m>l)return u(null,d);h.start(null,null),h.update(r),h.update(n.util.int32ToBytes(m)),y=v=h.digest().getBytes(),b=2,T()}function T(){if(b<=i)return h.start(null,null),h.update(v),g=h.digest().getBytes(),y=n.util.xorBytes(y,g,c),v=g,++b,n.util.setImmediate(T);d+=m<l?y:y.substr(0,p),++m,E()}E()}}).call(this,r(74).Buffer)},function(e,t){},function(e,t,r){var n=r(4);r(48),r(33),r(75),r(37),r(191),r(49),r(51),r(123),r(76),r(8);var i=n.asn1,o=e.exports=n.pki=n.pki||{},a=o.oids,s={};s.CN=a.commonName,s.commonName="CN",s.C=a.countryName,s.countryName="C",s.L=a.localityName,s.localityName="L",s.ST=a.stateOrProvinceName,s.stateOrProvinceName="ST",s.O=a.organizationName,s.organizationName="O",s.OU=a.organizationalUnitName,s.organizationalUnitName="OU",s.E=a.emailAddress,s.emailAddress="E";var u=n.pki.rsa.publicKeyValidator,c={name:"Certificate",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"tbsCertificate",value:[{name:"Certificate.TBSCertificate.version",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.version.integer",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"certVersion"}]},{name:"Certificate.TBSCertificate.serialNumber",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"certSerialNumber"},{name:"Certificate.TBSCertificate.signature",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.signature.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"certinfoSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:i.Class.UNIVERSAL,optional:!0,captureAsn1:"certinfoSignatureParams"}]},{name:"Certificate.TBSCertificate.issuer",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"certIssuer"},{name:"Certificate.TBSCertificate.validity",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.validity.notBefore (utc)",tagClass:i.Class.UNIVERSAL,type:i.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity1UTCTime"},{name:"Certificate.TBSCertificate.validity.notBefore (generalized)",tagClass:i.Class.UNIVERSAL,type:i.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity2GeneralizedTime"},{name:"Certificate.TBSCertificate.validity.notAfter (utc)",tagClass:i.Class.UNIVERSAL,type:i.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity3UTCTime"},{name:"Certificate.TBSCertificate.validity.notAfter (generalized)",tagClass:i.Class.UNIVERSAL,type:i.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity4GeneralizedTime"}]},{name:"Certificate.TBSCertificate.subject",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"certSubject"},u,{name:"Certificate.TBSCertificate.issuerUniqueID",tagClass:i.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.issuerUniqueID.id",tagClass:i.Class.UNIVERSAL,type:i.Type.BITSTRING,constructed:!1,captureBitStringValue:"certIssuerUniqueId"}]},{name:"Certificate.TBSCertificate.subjectUniqueID",tagClass:i.Class.CONTEXT_SPECIFIC,type:2,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.subjectUniqueID.id",tagClass:i.Class.UNIVERSAL,type:i.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSubjectUniqueId"}]},{name:"Certificate.TBSCertificate.extensions",tagClass:i.Class.CONTEXT_SPECIFIC,type:3,constructed:!0,captureAsn1:"certExtensions",optional:!0}]},{name:"Certificate.signatureAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.signatureAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"certSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:i.Class.UNIVERSAL,optional:!0,captureAsn1:"certSignatureParams"}]},{name:"Certificate.signatureValue",tagClass:i.Class.UNIVERSAL,type:i.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSignature"}]},f={name:"rsapss",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.hashAlgorithm",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier",tagClass:i.Class.UNIVERSAL,type:i.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"hashOid"}]}]},{name:"rsapss.maskGenAlgorithm",tagClass:i.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier",tagClass:i.Class.UNIVERSAL,type:i.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"maskGenOid"},{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"maskGenHashOid"}]}]}]},{name:"rsapss.saltLength",tagClass:i.Class.CONTEXT_SPECIFIC,type:2,optional:!0,value:[{name:"rsapss.saltLength.saltLength",tagClass:i.Class.UNIVERSAL,type:i.Class.INTEGER,constructed:!1,capture:"saltLength"}]},{name:"rsapss.trailerField",tagClass:i.Class.CONTEXT_SPECIFIC,type:3,optional:!0,value:[{name:"rsapss.trailer.trailer",tagClass:i.Class.UNIVERSAL,type:i.Class.INTEGER,constructed:!1,capture:"trailer"}]}]},l={name:"CertificationRequestInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfo",value:[{name:"CertificationRequestInfo.integer",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"certificationRequestInfoVersion"},{name:"CertificationRequestInfo.subject",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfoSubject"},u,{name:"CertificationRequestInfo.attributes",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"certificationRequestInfoAttributes",value:[{name:"CertificationRequestInfo.attributes",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequestInfo.attributes.type",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1},{name:"CertificationRequestInfo.attributes.value",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0}]}]}]},p={name:"CertificationRequest",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"csr",value:[l,{name:"CertificationRequest.signatureAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequest.signatureAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"csrSignatureOid"},{name:"CertificationRequest.signatureAlgorithm.parameters",tagClass:i.Class.UNIVERSAL,optional:!0,captureAsn1:"csrSignatureParams"}]},{name:"CertificationRequest.signature",tagClass:i.Class.UNIVERSAL,type:i.Type.BITSTRING,constructed:!1,captureBitStringValue:"csrSignature"}]};function h(e,t){"string"==typeof t&&(t={shortName:t});for(var r=null,n,i=0;null===r&&i<e.attributes.length;++i)n=e.attributes[i],(t.type&&t.type===n.type||t.name&&t.name===n.name||t.shortName&&t.shortName===n.shortName)&&(r=n);return r}o.RDNAttributesAsArray=function(e,t){for(var r=[],n,o,u,c=0;c<e.value.length;++c){n=e.value[c];for(var f=0;f<n.value.length;++f)u={},o=n.value[f],u.type=i.derToOid(o.value[0].value),u.value=o.value[1].value,u.valueTagClass=o.value[1].type,u.type in a&&(u.name=a[u.type],u.name in s&&(u.shortName=s[u.name])),t&&(t.update(u.type),t.update(u.value)),r.push(u)}return r},o.CRIAttributesAsArray=function(e){for(var t=[],r=0;r<e.length;++r)for(var n=e[r],u=i.derToOid(n.value[0].value),c=n.value[1].value,f=0;f<c.length;++f){var l={};if(l.type=u,l.value=c[f].value,l.valueTagClass=c[f].type,l.type in a&&(l.name=a[l.type],l.name in s&&(l.shortName=s[l.name])),l.type===a.extensionRequest){l.extensions=[];for(var p=0;p<l.value.length;++p)l.extensions.push(o.certificateExtensionFromAsn1(l.value[p]))}t.push(l)}return t};var d=function(e,t,r){var n={};if(e!==a["RSASSA-PSS"])return n;r&&(n={hash:{algorithmOid:a.sha1},mgf:{algorithmOid:a.mgf1,hash:{algorithmOid:a.sha1}},saltLength:20});var o={},s=[];if(!i.validate(t,f,o,s)){var u=new Error("Cannot read RSASSA-PSS parameter block.");throw u.errors=s,u}return void 0!==o.hashOid&&(n.hash=n.hash||{},n.hash.algorithmOid=i.derToOid(o.hashOid)),void 0!==o.maskGenOid&&(n.mgf=n.mgf||{},n.mgf.algorithmOid=i.derToOid(o.maskGenOid),n.mgf.hash=n.mgf.hash||{},n.mgf.hash.algorithmOid=i.derToOid(o.maskGenHashOid)),void 0!==o.saltLength&&(n.saltLength=o.saltLength.charCodeAt(0)),n};function y(e){for(var t=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]),r,o,a=e.attributes,s=0;s<a.length;++s){var u=(r=a[s]).value,c=i.Type.PRINTABLESTRING;"valueTagClass"in r&&(c=r.valueTagClass)===i.Type.UTF8&&(u=n.util.encodeUtf8(u)),o=i.create(i.Class.UNIVERSAL,i.Type.SET,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(r.type).getBytes()),i.create(i.Class.UNIVERSAL,c,!1,u)])]),t.value.push(o)}return t}function g(e){for(var t={},r=0;r<e.length;++r){var o=e[r];if(o.shortName&&(o.valueTagClass===i.Type.UTF8||o.valueTagClass===i.Type.PRINTABLESTRING||o.valueTagClass===i.Type.IA5STRING)){var a=o.value;o.valueTagClass===i.Type.UTF8&&(a=n.util.encodeUtf8(o.value)),o.shortName in t?n.util.isArray(t[o.shortName])?t[o.shortName].push(a):t[o.shortName]=[t[o.shortName],a]:t[o.shortName]=a}}return t}function v(e){for(var t,r=0;r<e.length;++r){if(void 0===(t=e[r]).name&&(t.type&&t.type in o.oids?t.name=o.oids[t.type]:t.shortName&&t.shortName in s&&(t.name=o.oids[s[t.shortName]])),void 0===t.type){var n;if(!t.name||!(t.name in o.oids))throw(n=new Error("Attribute type not specified.")).attribute=t,n;t.type=o.oids[t.name]}if(void 0===t.shortName&&t.name&&t.name in s&&(t.shortName=s[t.name]),t.type===a.extensionRequest&&(t.valueConstructed=!0,t.valueTagClass=i.Type.SEQUENCE,!t.value&&t.extensions)){t.value=[];for(var u=0;u<t.extensions.length;++u)t.value.push(o.certificateExtensionToAsn1(m(t.extensions[u])))}var n;if(void 0===t.value)throw(n=new Error("Attribute value not specified.")).attribute=t,n}}function m(e,t){if(t=t||{},void 0===e.name&&e.id&&e.id in o.oids&&(e.name=o.oids[e.id]),void 0===e.id){var r;if(!e.name||!(e.name in o.oids))throw(r=new Error("Extension ID not specified.")).extension=e,r;e.id=o.oids[e.name]}if(void 0!==e.value)return e;if("keyUsage"===e.name){var s=0,u=0,c=0;e.digitalSignature&&(u|=128,s=7),e.nonRepudiation&&(u|=64,s=6),e.keyEncipherment&&(u|=32,s=5),e.dataEncipherment&&(u|=16,s=4),e.keyAgreement&&(u|=8,s=3),e.keyCertSign&&(u|=4,s=2),e.cRLSign&&(u|=2,s=1),e.encipherOnly&&(u|=1,s=0),e.decipherOnly&&(c|=128,s=7);var f=String.fromCharCode(s);0!==c?f+=String.fromCharCode(u)+String.fromCharCode(c):0!==u&&(f+=String.fromCharCode(u)),e.value=i.create(i.Class.UNIVERSAL,i.Type.BITSTRING,!1,f)}else if("basicConstraints"===e.name)e.value=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]),e.cA&&e.value.value.push(i.create(i.Class.UNIVERSAL,i.Type.BOOLEAN,!1,String.fromCharCode(255))),"pathLenConstraint"in e&&e.value.value.push(i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(e.pathLenConstraint).getBytes()));else if("extKeyUsage"===e.name){e.value=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);var l=e.value.value;for(var p in e)!0===e[p]&&(p in a?l.push(i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a[p]).getBytes())):-1!==p.indexOf(".")&&l.push(i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(p).getBytes())))}else if("nsCertType"===e.name){var s=0,u=0;e.client&&(u|=128,s=7),e.server&&(u|=64,s=6),e.email&&(u|=32,s=5),e.objsign&&(u|=16,s=4),e.reserved&&(u|=8,s=3),e.sslCA&&(u|=4,s=2),e.emailCA&&(u|=2,s=1),e.objCA&&(u|=1,s=0);var f=String.fromCharCode(s);0!==u&&(f+=String.fromCharCode(u)),e.value=i.create(i.Class.UNIVERSAL,i.Type.BITSTRING,!1,f)}else if("subjectAltName"===e.name||"issuerAltName"===e.name){var h;e.value=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);for(var d=0;d<e.altNames.length;++d){var f=(h=e.altNames[d]).value,r;if(7===h.type&&h.ip){if(null===(f=n.util.bytesFromIP(h.ip)))throw(r=new Error('Extension "ip" value is not a valid IPv4 or IPv6 address.')).extension=e,r}else 8===h.type&&(f=h.oid?i.oidToDer(i.oidToDer(h.oid)):i.oidToDer(f));e.value.value.push(i.create(i.Class.CONTEXT_SPECIFIC,h.type,!1,f))}}else if("nsComment"===e.name&&t.cert){if(!/^[\x00-\x7F]*$/.test(e.comment)||e.comment.length<1||e.comment.length>128)throw new Error('Invalid "nsComment" content.');e.value=i.create(i.Class.UNIVERSAL,i.Type.IA5STRING,!1,e.comment)}else if("subjectKeyIdentifier"===e.name&&t.cert){var g=t.cert.generateSubjectKeyIdentifier();e.subjectKeyIdentifier=g.toHex(),e.value=i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,g.getBytes())}else if("authorityKeyIdentifier"===e.name&&t.cert){e.value=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);var l=e.value.value;if(e.keyIdentifier){var v=!0===e.keyIdentifier?t.cert.generateSubjectKeyIdentifier().getBytes():e.keyIdentifier;l.push(i.create(i.Class.CONTEXT_SPECIFIC,0,!1,v))}if(e.authorityCertIssuer){var m=[i.create(i.Class.CONTEXT_SPECIFIC,4,!0,[y(!0===e.authorityCertIssuer?t.cert.issuer:e.authorityCertIssuer)])];l.push(i.create(i.Class.CONTEXT_SPECIFIC,1,!0,m))}if(e.serialNumber){var b=n.util.hexToBytes(!0===e.serialNumber?t.cert.serialNumber:e.serialNumber);l.push(i.create(i.Class.CONTEXT_SPECIFIC,2,!1,b))}}else if("cRLDistributionPoints"===e.name){e.value=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);for(var l=e.value.value,E=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]),T=i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[]),h,d=0;d<e.altNames.length;++d){var f=(h=e.altNames[d]).value,r;if(7===h.type&&h.ip){if(null===(f=n.util.bytesFromIP(h.ip)))throw(r=new Error('Extension "ip" value is not a valid IPv4 or IPv6 address.')).extension=e,r}else 8===h.type&&(f=h.oid?i.oidToDer(i.oidToDer(h.oid)):i.oidToDer(f));T.value.push(i.create(i.Class.CONTEXT_SPECIFIC,h.type,!1,f))}E.value.push(i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[T])),l.push(E)}var r;if(void 0===e.value)throw(r=new Error("Extension value not specified.")).extension=e,r;return e}function b(e,t){if(e===a["RSASSA-PSS"]){var r=[];return void 0!==t.hash.algorithmOid&&r.push(i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(t.hash.algorithmOid).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")])])),void 0!==t.mgf.algorithmOid&&r.push(i.create(i.Class.CONTEXT_SPECIFIC,1,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(t.mgf.algorithmOid).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(t.mgf.hash.algorithmOid).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")])])])),void 0!==t.saltLength&&r.push(i.create(i.Class.CONTEXT_SPECIFIC,2,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(t.saltLength).getBytes())])),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,r)}return i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")}function E(e){var t=i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[]);if(0===e.attributes.length)return t;for(var r=e.attributes,o=0;o<r.length;++o){var a=r[o],s=a.value,u=i.Type.UTF8;"valueTagClass"in a&&(u=a.valueTagClass),u===i.Type.UTF8&&(s=n.util.encodeUtf8(s));var c=!1;"valueConstructed"in a&&(c=a.valueConstructed);var f=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.type).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SET,!0,[i.create(i.Class.UNIVERSAL,u,c,s)])]);t.value.push(f)}return t}o.certificateFromPem=function(e,t,r){var a=n.pem.decode(e)[0];if("CERTIFICATE"!==a.type&&"X509 CERTIFICATE"!==a.type&&"TRUSTED CERTIFICATE"!==a.type){var s=new Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".');throw s.headerType=a.type,s}if(a.procType&&"ENCRYPTED"===a.procType.type)throw new Error("Could not convert certificate from PEM; PEM is encrypted.");var u=i.fromDer(a.body,r);return o.certificateFromAsn1(u,t)},o.certificateToPem=function(e,t){var r={type:"CERTIFICATE",body:i.toDer(o.certificateToAsn1(e)).getBytes()};return n.pem.encode(r,{maxline:t})},o.publicKeyFromPem=function(e){var t=n.pem.decode(e)[0];if("PUBLIC KEY"!==t.type&&"RSA PUBLIC KEY"!==t.type){var r=new Error('Could not convert public key from PEM; PEM header type is not "PUBLIC KEY" or "RSA PUBLIC KEY".');throw r.headerType=t.type,r}if(t.procType&&"ENCRYPTED"===t.procType.type)throw new Error("Could not convert public key from PEM; PEM is encrypted.");var a=i.fromDer(t.body);return o.publicKeyFromAsn1(a)},o.publicKeyToPem=function(e,t){var r={type:"PUBLIC KEY",body:i.toDer(o.publicKeyToAsn1(e)).getBytes()};return n.pem.encode(r,{maxline:t})},o.publicKeyToRSAPublicKeyPem=function(e,t){var r={type:"RSA PUBLIC KEY",body:i.toDer(o.publicKeyToRSAPublicKey(e)).getBytes()};return n.pem.encode(r,{maxline:t})},o.getPublicKeyFingerprint=function(e,t){var r=(t=t||{}).md||n.md.sha1.create(),a,s;switch(t.type||"RSAPublicKey"){case"RSAPublicKey":s=i.toDer(o.publicKeyToRSAPublicKey(e)).getBytes();break;case"SubjectPublicKeyInfo":s=i.toDer(o.publicKeyToAsn1(e)).getBytes();break;default:throw new Error('Unknown fingerprint type "'+t.type+'".')}r.start(),r.update(s);var u=r.digest();if("hex"===t.encoding){var c=u.toHex();return t.delimiter?c.match(/.{2}/g).join(t.delimiter):c}if("binary"===t.encoding)return u.getBytes();if(t.encoding)throw new Error('Unknown encoding "'+t.encoding+'".');return u},o.certificationRequestFromPem=function(e,t,r){var a=n.pem.decode(e)[0];if("CERTIFICATE REQUEST"!==a.type){var s=new Error('Could not convert certification request from PEM; PEM header type is not "CERTIFICATE REQUEST".');throw s.headerType=a.type,s}if(a.procType&&"ENCRYPTED"===a.procType.type)throw new Error("Could not convert certification request from PEM; PEM is encrypted.");var u=i.fromDer(a.body,r);return o.certificationRequestFromAsn1(u,t)},o.certificationRequestToPem=function(e,t){var r={type:"CERTIFICATE REQUEST",body:i.toDer(o.certificationRequestToAsn1(e)).getBytes()};return n.pem.encode(r,{maxline:t})},o.createCertificate=function(){var e={version:2,serialNumber:"00",signatureOid:null,signature:null,siginfo:{}};return e.siginfo.algorithmOid=null,e.validity={},e.validity.notBefore=new Date,e.validity.notAfter=new Date,e.issuer={},e.issuer.getField=function(t){return h(e.issuer,t)},e.issuer.addField=function(t){v([t]),e.issuer.attributes.push(t)},e.issuer.attributes=[],e.issuer.hash=null,e.subject={},e.subject.getField=function(t){return h(e.subject,t)},e.subject.addField=function(t){v([t]),e.subject.attributes.push(t)},e.subject.attributes=[],e.subject.hash=null,e.extensions=[],e.publicKey=null,e.md=null,e.setSubject=function(t,r){v(t),e.subject.attributes=t,delete e.subject.uniqueId,r&&(e.subject.uniqueId=r),e.subject.hash=null},e.setIssuer=function(t,r){v(t),e.issuer.attributes=t,delete e.issuer.uniqueId,r&&(e.issuer.uniqueId=r),e.issuer.hash=null},e.setExtensions=function(t){for(var r=0;r<t.length;++r)m(t[r],{cert:e});e.extensions=t},e.getExtension=function(t){"string"==typeof t&&(t={name:t});for(var r=null,n,i=0;null===r&&i<e.extensions.length;++i)n=e.extensions[i],(t.id&&n.id===t.id||t.name&&n.name===t.name)&&(r=n);return r},e.sign=function(t,r){e.md=r||n.md.sha1.create();var s=a[e.md.algorithm+"WithRSAEncryption"];if(!s){var u=new Error("Could not compute certificate digest. Unknown message digest algorithm OID.");throw u.algorithm=e.md.algorithm,u}e.signatureOid=e.siginfo.algorithmOid=s,e.tbsCertificate=o.getTBSCertificate(e);var c=i.toDer(e.tbsCertificate);e.md.update(c.getBytes()),e.signature=t.sign(e.md)},e.verify=function(t){var r=!1;if(!e.issued(t)){var s=t.issuer,u=e.subject,c;throw(c=new Error("The parent certificate did not issue the given child certificate; the child certificate's issuer does not match the parent's subject.")).expectedIssuer=s.attributes,c.actualIssuer=u.attributes,c}var f=t.md;if(null===f){var l,c;if(t.signatureOid in a)switch(a[t.signatureOid]){case"sha1WithRSAEncryption":f=n.md.sha1.create();break;case"md5WithRSAEncryption":f=n.md.md5.create();break;case"sha256WithRSAEncryption":case"RSASSA-PSS":f=n.md.sha256.create();break;case"sha384WithRSAEncryption":f=n.md.sha384.create();break;case"sha512WithRSAEncryption":f=n.md.sha512.create()}if(null===f)throw(c=new Error("Could not compute certificate digest. Unknown signature OID.")).signatureOid=t.signatureOid,c;var p=t.tbsCertificate||o.getTBSCertificate(t),h=i.toDer(p);f.update(h.getBytes())}if(null!==f){var d;switch(t.signatureOid){case a.sha1WithRSAEncryption:d=void 0;break;case a["RSASSA-PSS"]:var y,g,c,c;if(void 0===(y=a[t.signatureParameters.mgf.hash.algorithmOid])||void 0===n.md[y])throw(c=new Error("Unsupported MGF hash function.")).oid=t.signatureParameters.mgf.hash.algorithmOid,c.name=y,c;if(void 0===(g=a[t.signatureParameters.mgf.algorithmOid])||void 0===n.mgf[g])throw(c=new Error("Unsupported MGF function.")).oid=t.signatureParameters.mgf.algorithmOid,c.name=g,c;if(g=n.mgf[g].create(n.md[y].create()),void 0===(y=a[t.signatureParameters.hash.algorithmOid])||void 0===n.md[y])throw{message:"Unsupported RSASSA-PSS hash function.",oid:t.signatureParameters.hash.algorithmOid,name:y};d=n.pss.create(n.md[y].create(),g,t.signatureParameters.saltLength)}r=e.publicKey.verify(f.digest().getBytes(),t.signature,d)}return r},e.isIssuer=function(t){var r=!1,n=e.issuer,i=t.subject;if(n.hash&&i.hash)r=n.hash===i.hash;else if(n.attributes.length===i.attributes.length){var o,a;r=!0;for(var s=0;r&&s<n.attributes.length;++s)o=n.attributes[s],a=i.attributes[s],o.type===a.type&&o.value===a.value||(r=!1)}return r},e.issued=function(t){return t.isIssuer(e)},e.generateSubjectKeyIdentifier=function(){return o.getPublicKeyFingerprint(e.publicKey,{type:"RSAPublicKey"})},e.verifySubjectKeyIdentifier=function(){for(var t=a.subjectKeyIdentifier,r=0;r<e.extensions.length;++r){var i=e.extensions[r];if(i.id===t){var o=e.generateSubjectKeyIdentifier().getBytes();return n.util.hexToBytes(i.subjectKeyIdentifier)===o}}return!1},e},o.certificateFromAsn1=function(e,t){var r={},s=[],u,f;if(!i.validate(e,c,r,s))throw(u=new Error("Cannot read X.509 certificate. ASN.1 object is not an X509v3 Certificate.")).errors=s,u;if((f=i.derToOid(r.publicKeyOid))!==o.oids.rsaEncryption)throw new Error("Cannot read public key. OID is not RSA.");var l=o.createCertificate();l.version=r.certVersion?r.certVersion.charCodeAt(0):0;var p=n.util.createBuffer(r.certSerialNumber);l.serialNumber=p.toHex(),l.signatureOid=n.asn1.derToOid(r.certSignatureOid),l.signatureParameters=d(l.signatureOid,r.certSignatureParams,!0),l.siginfo.algorithmOid=n.asn1.derToOid(r.certinfoSignatureOid),l.siginfo.parameters=d(l.siginfo.algorithmOid,r.certinfoSignatureParams,!1),l.signature=r.certSignature;var y=[];if(void 0!==r.certValidity1UTCTime&&y.push(i.utcTimeToDate(r.certValidity1UTCTime)),void 0!==r.certValidity2GeneralizedTime&&y.push(i.generalizedTimeToDate(r.certValidity2GeneralizedTime)),void 0!==r.certValidity3UTCTime&&y.push(i.utcTimeToDate(r.certValidity3UTCTime)),void 0!==r.certValidity4GeneralizedTime&&y.push(i.generalizedTimeToDate(r.certValidity4GeneralizedTime)),y.length>2)throw new Error("Cannot read notBefore/notAfter validity times; more than two times were provided in the certificate.");if(y.length<2)throw new Error("Cannot read notBefore/notAfter validity times; they were not provided as either UTCTime or GeneralizedTime.");if(l.validity.notBefore=y[0],l.validity.notAfter=y[1],l.tbsCertificate=r.tbsCertificate,t){var f,u;if(l.md=null,l.signatureOid in a)switch(f=a[l.signatureOid]){case"sha1WithRSAEncryption":l.md=n.md.sha1.create();break;case"md5WithRSAEncryption":l.md=n.md.md5.create();break;case"sha256WithRSAEncryption":case"RSASSA-PSS":l.md=n.md.sha256.create();break;case"sha384WithRSAEncryption":l.md=n.md.sha384.create();break;case"sha512WithRSAEncryption":l.md=n.md.sha512.create()}if(null===l.md)throw(u=new Error("Could not compute certificate digest. Unknown signature OID.")).signatureOid=l.signatureOid,u;var g=i.toDer(l.tbsCertificate);l.md.update(g.getBytes())}var m=n.md.sha1.create();l.issuer.getField=function(e){return h(l.issuer,e)},l.issuer.addField=function(e){v([e]),l.issuer.attributes.push(e)},l.issuer.attributes=o.RDNAttributesAsArray(r.certIssuer,m),r.certIssuerUniqueId&&(l.issuer.uniqueId=r.certIssuerUniqueId),l.issuer.hash=m.digest().toHex();var b=n.md.sha1.create();return l.subject.getField=function(e){return h(l.subject,e)},l.subject.addField=function(e){v([e]),l.subject.attributes.push(e)},l.subject.attributes=o.RDNAttributesAsArray(r.certSubject,b),r.certSubjectUniqueId&&(l.subject.uniqueId=r.certSubjectUniqueId),l.subject.hash=b.digest().toHex(),r.certExtensions?l.extensions=o.certificateExtensionsFromAsn1(r.certExtensions):l.extensions=[],l.publicKey=o.publicKeyFromAsn1(r.subjectPublicKeyInfo),l},o.certificateExtensionsFromAsn1=function(e){for(var t=[],r=0;r<e.value.length;++r)for(var n=e.value[r],i=0;i<n.value.length;++i)t.push(o.certificateExtensionFromAsn1(n.value[i]));return t},o.certificateExtensionFromAsn1=function(e){var t={};if(t.id=i.derToOid(e.value[0].value),t.critical=!1,e.value[1].type===i.Type.BOOLEAN?(t.critical=0!==e.value[1].value.charCodeAt(0),t.value=e.value[2].value):t.value=e.value[1].value,t.id in a)if(t.name=a[t.id],"keyUsage"===t.name){var r,o=0,s=0;(r=i.fromDer(t.value)).value.length>1&&(o=r.value.charCodeAt(1),s=r.value.length>2?r.value.charCodeAt(2):0),t.digitalSignature=!(128&~o),t.nonRepudiation=!(64&~o),t.keyEncipherment=!(32&~o),t.dataEncipherment=!(16&~o),t.keyAgreement=!(8&~o),t.keyCertSign=!(4&~o),t.cRLSign=!(2&~o),t.encipherOnly=!(1&~o),t.decipherOnly=!(128&~s)}else if("basicConstraints"===t.name){var r;(r=i.fromDer(t.value)).value.length>0&&r.value[0].type===i.Type.BOOLEAN?t.cA=0!==r.value[0].value.charCodeAt(0):t.cA=!1;var u=null;r.value.length>0&&r.value[0].type===i.Type.INTEGER?u=r.value[0].value:r.value.length>1&&(u=r.value[1].value),null!==u&&(t.pathLenConstraint=i.derToInteger(u))}else if("extKeyUsage"===t.name)for(var r=i.fromDer(t.value),c=0;c<r.value.length;++c){var f=i.derToOid(r.value[c].value);f in a?t[a[f]]=!0:t[f]=!0}else if("nsCertType"===t.name){var r,o=0;(r=i.fromDer(t.value)).value.length>1&&(o=r.value.charCodeAt(1)),t.client=!(128&~o),t.server=!(64&~o),t.email=!(32&~o),t.objsign=!(16&~o),t.reserved=!(8&~o),t.sslCA=!(4&~o),t.emailCA=!(2&~o),t.objCA=!(1&~o)}else if("subjectAltName"===t.name||"issuerAltName"===t.name){var l;t.altNames=[];for(var r=i.fromDer(t.value),p=0;p<r.value.length;++p){var h={type:(l=r.value[p]).type,value:l.value};switch(t.altNames.push(h),l.type){case 1:case 2:case 6:break;case 7:h.ip=n.util.bytesToIP(l.value);break;case 8:h.oid=i.derToOid(l.value)}}}else if("subjectKeyIdentifier"===t.name){var r=i.fromDer(t.value);t.subjectKeyIdentifier=n.util.bytesToHex(r.value)}return t},o.certificationRequestFromAsn1=function(e,t){var r={},s=[],u,c;if(!i.validate(e,p,r,s))throw(u=new Error("Cannot read PKCS#10 certificate request. ASN.1 object is not a PKCS#10 CertificationRequest.")).errors=s,u;if((c=i.derToOid(r.publicKeyOid))!==o.oids.rsaEncryption)throw new Error("Cannot read public key. OID is not RSA.");var f=o.createCertificationRequest();if(f.version=r.csrVersion?r.csrVersion.charCodeAt(0):0,f.signatureOid=n.asn1.derToOid(r.csrSignatureOid),f.signatureParameters=d(f.signatureOid,r.csrSignatureParams,!0),f.siginfo.algorithmOid=n.asn1.derToOid(r.csrSignatureOid),f.siginfo.parameters=d(f.siginfo.algorithmOid,r.csrSignatureParams,!1),f.signature=r.csrSignature,f.certificationRequestInfo=r.certificationRequestInfo,t){var c,u;if(f.md=null,f.signatureOid in a)switch(c=a[f.signatureOid]){case"sha1WithRSAEncryption":f.md=n.md.sha1.create();break;case"md5WithRSAEncryption":f.md=n.md.md5.create();break;case"sha256WithRSAEncryption":case"RSASSA-PSS":f.md=n.md.sha256.create();break;case"sha384WithRSAEncryption":f.md=n.md.sha384.create();break;case"sha512WithRSAEncryption":f.md=n.md.sha512.create()}if(null===f.md)throw(u=new Error("Could not compute certification request digest. Unknown signature OID.")).signatureOid=f.signatureOid,u;var l=i.toDer(f.certificationRequestInfo);f.md.update(l.getBytes())}var y=n.md.sha1.create();return f.subject.getField=function(e){return h(f.subject,e)},f.subject.addField=function(e){v([e]),f.subject.attributes.push(e)},f.subject.attributes=o.RDNAttributesAsArray(r.certificationRequestInfoSubject,y),f.subject.hash=y.digest().toHex(),f.publicKey=o.publicKeyFromAsn1(r.subjectPublicKeyInfo),f.getAttribute=function(e){return h(f,e)},f.addAttribute=function(e){v([e]),f.attributes.push(e)},f.attributes=o.CRIAttributesAsArray(r.certificationRequestInfoAttributes||[]),f},o.createCertificationRequest=function(){var e={version:0,signatureOid:null,signature:null,siginfo:{}};return e.siginfo.algorithmOid=null,e.subject={},e.subject.getField=function(t){return h(e.subject,t)},e.subject.addField=function(t){v([t]),e.subject.attributes.push(t)},e.subject.attributes=[],e.subject.hash=null,e.publicKey=null,e.attributes=[],e.getAttribute=function(t){return h(e,t)},e.addAttribute=function(t){v([t]),e.attributes.push(t)},e.md=null,e.setSubject=function(t){v(t),e.subject.attributes=t,e.subject.hash=null},e.setAttributes=function(t){v(t),e.attributes=t},e.sign=function(t,r){e.md=r||n.md.sha1.create();var s=a[e.md.algorithm+"WithRSAEncryption"];if(!s){var u=new Error("Could not compute certification request digest. Unknown message digest algorithm OID.");throw u.algorithm=e.md.algorithm,u}e.signatureOid=e.siginfo.algorithmOid=s,e.certificationRequestInfo=o.getCertificationRequestInfo(e);var c=i.toDer(e.certificationRequestInfo);e.md.update(c.getBytes()),e.signature=t.sign(e.md)},e.verify=function(){var t=!1,r=e.md;if(null===r){var s,u;if(e.signatureOid in a)switch(a[e.signatureOid]){case"sha1WithRSAEncryption":r=n.md.sha1.create();break;case"md5WithRSAEncryption":r=n.md.md5.create();break;case"sha256WithRSAEncryption":case"RSASSA-PSS":r=n.md.sha256.create();break;case"sha384WithRSAEncryption":r=n.md.sha384.create();break;case"sha512WithRSAEncryption":r=n.md.sha512.create()}if(null===r)throw(u=new Error("Could not compute certification request digest. Unknown signature OID.")).signatureOid=e.signatureOid,u;var c=e.certificationRequestInfo||o.getCertificationRequestInfo(e),f=i.toDer(c);r.update(f.getBytes())}if(null!==r){var l;switch(e.signatureOid){case a.sha1WithRSAEncryption:break;case a["RSASSA-PSS"]:var p,h,u,u,u;if(void 0===(p=a[e.signatureParameters.mgf.hash.algorithmOid])||void 0===n.md[p])throw(u=new Error("Unsupported MGF hash function.")).oid=e.signatureParameters.mgf.hash.algorithmOid,u.name=p,u;if(void 0===(h=a[e.signatureParameters.mgf.algorithmOid])||void 0===n.mgf[h])throw(u=new Error("Unsupported MGF function.")).oid=e.signatureParameters.mgf.algorithmOid,u.name=h,u;if(h=n.mgf[h].create(n.md[p].create()),void 0===(p=a[e.signatureParameters.hash.algorithmOid])||void 0===n.md[p])throw(u=new Error("Unsupported RSASSA-PSS hash function.")).oid=e.signatureParameters.hash.algorithmOid,u.name=p,u;l=n.pss.create(n.md[p].create(),h,e.signatureParameters.saltLength)}t=e.publicKey.verify(r.digest().getBytes(),e.signature,l)}return t},e};var T=new Date("1950-01-01T00:00:00Z"),S=new Date("2050-01-01T00:00:00Z");function w(e){return e>=T&&e<S?i.create(i.Class.UNIVERSAL,i.Type.UTCTIME,!1,i.dateToUtcTime(e)):i.create(i.Class.UNIVERSAL,i.Type.GENERALIZEDTIME,!1,i.dateToGeneralizedTime(e))}o.getTBSCertificate=function(e){var t=w(e.validity.notBefore),r=w(e.validity.notAfter),a=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(e.version).getBytes())]),i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,n.util.hexToBytes(e.serialNumber)),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.siginfo.algorithmOid).getBytes()),b(e.siginfo.algorithmOid,e.siginfo.parameters)]),y(e.issuer),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[t,r]),y(e.subject),o.publicKeyToAsn1(e.publicKey)]);return e.issuer.uniqueId&&a.value.push(i.create(i.Class.CONTEXT_SPECIFIC,1,!0,[i.create(i.Class.UNIVERSAL,i.Type.BITSTRING,!1,String.fromCharCode(0)+e.issuer.uniqueId)])),e.subject.uniqueId&&a.value.push(i.create(i.Class.CONTEXT_SPECIFIC,2,!0,[i.create(i.Class.UNIVERSAL,i.Type.BITSTRING,!1,String.fromCharCode(0)+e.subject.uniqueId)])),e.extensions.length>0&&a.value.push(o.certificateExtensionsToAsn1(e.extensions)),a},o.getCertificationRequestInfo=function(e){var t;return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(e.version).getBytes()),y(e.subject),o.publicKeyToAsn1(e.publicKey),E(e)])},o.distinguishedNameToAsn1=function(e){return y(e)},o.certificateToAsn1=function(e){var t=e.tbsCertificate||o.getTBSCertificate(e);return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[t,i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.signatureOid).getBytes()),b(e.signatureOid,e.signatureParameters)]),i.create(i.Class.UNIVERSAL,i.Type.BITSTRING,!1,String.fromCharCode(0)+e.signature)])},o.certificateExtensionsToAsn1=function(e){var t=i.create(i.Class.CONTEXT_SPECIFIC,3,!0,[]),r=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);t.value.push(r);for(var n=0;n<e.length;++n)r.value.push(o.certificateExtensionToAsn1(e[n]));return t},o.certificateExtensionToAsn1=function(e){var t=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);t.value.push(i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.id).getBytes())),e.critical&&t.value.push(i.create(i.Class.UNIVERSAL,i.Type.BOOLEAN,!1,String.fromCharCode(255)));var r=e.value;return"string"!=typeof e.value&&(r=i.toDer(r).getBytes()),t.value.push(i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,r)),t},o.certificationRequestToAsn1=function(e){var t=e.certificationRequestInfo||o.getCertificationRequestInfo(e);return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[t,i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.signatureOid).getBytes()),b(e.signatureOid,e.signatureParameters)]),i.create(i.Class.UNIVERSAL,i.Type.BITSTRING,!1,String.fromCharCode(0)+e.signature)])},o.createCaStore=function(e){var t={certs:{}};function r(e){return a(e),t.certs[e.hash]||null}function a(e){if(!e.hash){var t=n.md.sha1.create();e.attributes=o.RDNAttributesAsArray(y(e),t),e.hash=t.digest().toHex()}}if(t.getIssuer=function(e){var t;return r(e.issuer)},t.addCertificate=function(e){if("string"==typeof e&&(e=n.pki.certificateFromPem(e)),a(e.subject),!t.hasCertificate(e))if(e.subject.hash in t.certs){var r=t.certs[e.subject.hash];n.util.isArray(r)||(r=[r]),r.push(e),t.certs[e.subject.hash]=r}else t.certs[e.subject.hash]=e},t.hasCertificate=function(e){"string"==typeof e&&(e=n.pki.certificateFromPem(e));var t=r(e.subject);if(!t)return!1;n.util.isArray(t)||(t=[t]);for(var a=i.toDer(o.certificateToAsn1(e)).getBytes(),s=0;s<t.length;++s){var u;if(a===i.toDer(o.certificateToAsn1(t[s])).getBytes())return!0}return!1},t.listAllCertificates=function(){var e=[];for(var r in t.certs)if(t.certs.hasOwnProperty(r)){var i=t.certs[r];if(n.util.isArray(i))for(var o=0;o<i.length;++o)e.push(i[o]);else e.push(i)}return e},t.removeCertificate=function(e){var s;if("string"==typeof e&&(e=n.pki.certificateFromPem(e)),a(e.subject),!t.hasCertificate(e))return null;var u=r(e.subject);if(!n.util.isArray(u))return s=t.certs[e.subject.hash],delete t.certs[e.subject.hash],s;for(var c=i.toDer(o.certificateToAsn1(e)).getBytes(),f=0;f<u.length;++f){var l;c===i.toDer(o.certificateToAsn1(u[f])).getBytes()&&(s=u[f],u.splice(f,1))}return 0===u.length&&delete t.certs[e.subject.hash],s},e)for(var s=0;s<e.length;++s){var u=e[s];t.addCertificate(u)}return t},o.certificateError={bad_certificate:"forge.pki.BadCertificate",unsupported_certificate:"forge.pki.UnsupportedCertificate",certificate_revoked:"forge.pki.CertificateRevoked",certificate_expired:"forge.pki.CertificateExpired",certificate_unknown:"forge.pki.CertificateUnknown",unknown_ca:"forge.pki.UnknownCertificateAuthority"},o.verifyCertificateChain=function(e,t,r){"function"==typeof r&&(r={verify:r}),r=r||{};var i=(t=t.slice(0)).slice(0),a=r.validityCheckDate;void 0===a&&(a=new Date);var s=!0,u=null,c=0;do{var f=t.shift(),l=null,p=!1;if(a&&(a<f.validity.notBefore||a>f.validity.notAfter)&&(u={message:"Certificate is not valid yet or has expired.",error:o.certificateError.certificate_expired,notBefore:f.validity.notBefore,notAfter:f.validity.notAfter,now:a}),null===u){if(null===(l=t[0]||e.getIssuer(f))&&f.isIssuer(f)&&(p=!0,l=f),l){var h=l;n.util.isArray(h)||(h=[h]);for(var d=!1;!d&&h.length>0;){l=h.shift();try{d=l.verify(f)}catch(e){}}d||(u={message:"Certificate signature is invalid.",error:o.certificateError.bad_certificate})}null!==u||l&&!p||e.hasCertificate(f)||(u={message:"Certificate is not trusted.",error:o.certificateError.unknown_ca})}if(null===u&&l&&!f.isIssuer(l)&&(u={message:"Certificate issuer is invalid.",error:o.certificateError.bad_certificate}),null===u)for(var y={keyUsage:!0,basicConstraints:!0},g=0;null===u&&g<f.extensions.length;++g){var v=f.extensions[g];v.critical&&!(v.name in y)&&(u={message:"Certificate has an unsupported critical extension.",error:o.certificateError.unsupported_certificate})}if(null===u&&(!s||0===t.length&&(!l||p))){var m=f.getExtension("basicConstraints"),b=f.getExtension("keyUsage"),E;if(null!==b&&(b.keyCertSign&&null!==m||(u={message:"Certificate keyUsage or basicConstraints conflict or indicate that the certificate is not a CA. If the certificate is the only one in the chain or isn't the first then the certificate must be a valid CA.",error:o.certificateError.bad_certificate})),null!==u||null===m||m.cA||(u={message:"Certificate basicConstraints indicates the certificate is not a CA.",error:o.certificateError.bad_certificate}),null===u&&null!==b&&"pathLenConstraint"in m)c-1>m.pathLenConstraint&&(u={message:"Certificate basicConstraints pathLenConstraint violated.",error:o.certificateError.bad_certificate})}var T=null===u||u.error,S=r.verify?r.verify(T,c,i):T;if(!0!==S)throw!0===T&&(u={message:"The application rejected the certificate.",error:o.certificateError.bad_certificate}),(S||0===S)&&("object"!=typeof S||n.util.isArray(S)?"string"==typeof S&&(u.error=S):(S.message&&(u.message=S.message),S.error&&(u.error=S.error))),u;u=null,s=!1,++c}while(t.length>0);return!0}},function(e,t,r){var n=r(4),i;r(31),r(8),(e.exports=n.pss=n.pss||{}).create=function(e){3===arguments.length&&(e={md:arguments[0],mgf:arguments[1],saltLength:arguments[2]});var t=e.md,r=e.mgf,i=t.digestLength,o=e.salt||null,a;if("string"==typeof o&&(o=n.util.createBuffer(o)),"saltLength"in e)a=e.saltLength;else{if(null===o)throw new Error("Salt length not specified or specific salt not given.");a=o.length()}if(null!==o&&o.length()!==a)throw new Error("Given salt length does not match length of given salt.");var s=e.prng||n.random,u={encode:function(e,u){var c,f=u-1,l=Math.ceil(f/8),p=e.digest().getBytes(),h;if(l<i+a+2)throw new Error("Message is too long to encrypt.");h=null===o?s.getBytesSync(a):o.bytes();var d=new n.util.ByteBuffer;d.fillWithByte(0,8),d.putBytes(p),d.putBytes(h),t.start(),t.update(d.getBytes());var y=t.digest().getBytes(),g=new n.util.ByteBuffer;g.fillWithByte(0,l-a-i-2),g.putByte(1),g.putBytes(h);var v=g.getBytes(),m=l-i-1,b=r.generate(y,m),E="";for(c=0;c<m;c++)E+=String.fromCharCode(v.charCodeAt(c)^b.charCodeAt(c));var T=65280>>8*l-f&255;return(E=String.fromCharCode(E.charCodeAt(0)&~T)+E.substr(1))+y+String.fromCharCode(188)},verify:function(e,o,s){var u,c=s-1,f=Math.ceil(c/8);if(o=o.substr(-f),f<i+a+2)throw new Error("Inconsistent parameters to PSS signature verification.");if(188!==o.charCodeAt(f-1))throw new Error("Encoded message does not end in 0xBC.");var l=f-i-1,p=o.substr(0,l),h=o.substr(l,i),d=65280>>8*f-c&255;if(0!==(p.charCodeAt(0)&d))throw new Error("Bits beyond keysize not zero as expected.");var y=r.generate(h,l),g="";for(u=0;u<l;u++)g+=String.fromCharCode(p.charCodeAt(u)^y.charCodeAt(u));g=String.fromCharCode(g.charCodeAt(0)&~d)+g.substr(1);var v=f-i-a-2;for(u=0;u<v;u++)if(0!==g.charCodeAt(u))throw new Error("Leftmost octets not zero as expected");if(1!==g.charCodeAt(v))throw new Error("Inconsistent PSS signature, 0x01 marker not found");var m=g.substr(-a),b=new n.util.ByteBuffer,E;return b.fillWithByte(0,8),b.putBytes(e),b.putBytes(m),t.start(),t.update(b.getBytes()),h===t.digest().getBytes()}};return u}},function(e,t){},function(e,t,r){"use strict";r.d(t,"a",function(){return l});var n=r(6),i=r(5),o=r(9),a=r(10),s=r(25),u=function(e){function t(t,r){var n=e.call(this)||this;return n.subject=t,n.subscriber=r,n.closed=!1,n}return n.a(t,e),t.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var e=this.subject,t=e.observers;if(this.subject=null,t&&0!==t.length&&!e.isStopped&&!e.closed){var r=t.indexOf(this.subscriber);-1!==r&&t.splice(r,1)}}},t}(a.a),c=r(15),f=function(e){function t(t){var r=e.call(this,t)||this;return r.destination=t,r}return n.a(t,e),t}(o.a),l=function(e){function t(){var t=e.call(this)||this;return t.observers=[],t.closed=!1,t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return n.a(t,e),t.prototype[c.a]=function(){return new f(this)},t.prototype.lift=function(e){var t=new p(this,this);return t.operator=e,t},t.prototype.next=function(e){if(this.closed)throw new s.a;if(!this.isStopped)for(var t=this.observers,r=t.length,n=t.slice(),i=0;i<r;i++)n[i].next(e)},t.prototype.error=function(e){if(this.closed)throw new s.a;this.hasError=!0,this.thrownError=e,this.isStopped=!0;for(var t=this.observers,r=t.length,n=t.slice(),i=0;i<r;i++)n[i].error(e);this.observers.length=0},t.prototype.complete=function(){if(this.closed)throw new s.a;this.isStopped=!0;for(var e=this.observers,t=e.length,r=e.slice(),n=0;n<t;n++)r[n].complete();this.observers.length=0},t.prototype.unsubscribe=function(){this.isStopped=!0,this.closed=!0,this.observers=null},t.prototype._trySubscribe=function(t){if(this.closed)throw new s.a;return e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){if(this.closed)throw new s.a;return this.hasError?(e.error(this.thrownError),a.a.EMPTY):this.isStopped?(e.complete(),a.a.EMPTY):(this.observers.push(e),new u(this,e))},t.prototype.asObservable=function(){var e=new i.a;return e.source=this,e},t.create=function(e,t){return new p(e,t)},t}(i.a),p=function(e){function t(t,r){var n=e.call(this)||this;return n.destination=t,n.source=r,n}return n.a(t,e),t.prototype.next=function(e){var t=this.destination;t&&t.next&&t.next(e)},t.prototype.error=function(e){var t=this.destination;t&&t.error&&this.destination.error(e)},t.prototype.complete=function(){var e=this.destination;e&&e.complete&&this.destination.complete()},t.prototype._subscribe=function(e){var t;return this.source?this.source.subscribe(e):a.a.EMPTY},t}(l)},function(e,t,r){"use strict";var n=r(173),i=r(174),o=r(113);e.exports={formats:o,parse:i,stringify:n}},function(e,t,r){var n,i;n=this,i=function(){"use strict";var e="millisecond",t="second",r="minute",n="hour",i="day",o="week",a="month",s="quarter",u="year",c="date",f=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[^0-9]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?.?(\d+)?$/,l=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,p={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},h=function(e,t,r){var n=String(e);return!n||n.length>=t?e:""+Array(t+1-n.length).join(r)+e},d={s:h,z:function(e){var t=-e.utcOffset(),r=Math.abs(t),n=Math.floor(r/60),i=r%60;return(t<=0?"+":"-")+h(n,2,"0")+":"+h(i,2,"0")},m:function e(t,r){if(t.date()<r.date())return-e(r,t);var n=12*(r.year()-t.year())+(r.month()-t.month()),i=t.clone().add(n,a),o=r-i<0,s=t.clone().add(n+(o?-1:1),a);return+(-(n+(r-i)/(o?i-s:s-i))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(f){return{M:a,y:u,w:o,d:i,D:c,h:n,m:r,s:t,ms:e,Q:s}[f]||String(f||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},y="en",g={};g[y]=p;var v=function(e){return e instanceof T},m=function(e,t,r){var n;if(!e)return y;if("string"==typeof e)g[e]&&(n=e),t&&(g[e]=t,n=e);else{var i=e.name;g[i]=e,n=i}return!r&&n&&(y=n),n||!r&&y},b=function(e,t){if(v(e))return e.clone();var r="object"==typeof t?t:{};return r.date=e,r.args=arguments,new T(r)},E=d;E.l=m,E.i=v,E.w=function(e,t){return b(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var T=function(){function p(e){this.$L=m(e.locale,null,!0),this.parse(e)}var h=p.prototype;return h.parse=function(e){this.$d=function(e){var t=e.date,r=e.utc;if(null===t)return new Date(NaN);if(E.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var n=t.match(f);if(n){var i=n[2]-1||0,o=(n[7]||"0").substring(0,3);return r?new Date(Date.UTC(n[1],i,n[3]||1,n[4]||0,n[5]||0,n[6]||0,o)):new Date(n[1],i,n[3]||1,n[4]||0,n[5]||0,n[6]||0,o)}}return new Date(t)}(e),this.$x=e.x||{},this.init()},h.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},h.$utils=function(){return E},h.isValid=function(){return!("Invalid Date"===this.$d.toString())},h.isSame=function(e,t){var r=b(e);return this.startOf(t)<=r&&r<=this.endOf(t)},h.isAfter=function(e,t){return b(e)<this.startOf(t)},h.isBefore=function(e,t){return this.endOf(t)<b(e)},h.$g=function(e,t,r){return E.u(e)?this[t]:this.set(r,e)},h.unix=function(){return Math.floor(this.valueOf()/1e3)},h.valueOf=function(){return this.$d.getTime()},h.startOf=function(e,s){var f=this,l=!!E.u(s)||s,p=E.p(e),h=function(e,t){var r=E.w(f.$u?Date.UTC(f.$y,t,e):new Date(f.$y,t,e),f);return l?r:r.endOf(i)},d=function(e,t){return E.w(f.toDate()[e].apply(f.toDate("s"),(l?[0,0,0,0]:[23,59,59,999]).slice(t)),f)},y=this.$W,g=this.$M,v=this.$D,m="set"+(this.$u?"UTC":"");switch(p){case u:return l?h(1,0):h(31,11);case a:return l?h(1,g):h(0,g+1);case o:var b=this.$locale().weekStart||0,T=(y<b?y+7:y)-b;return h(l?v-T:v+(6-T),g);case i:case c:return d(m+"Hours",0);case n:return d(m+"Minutes",1);case r:return d(m+"Seconds",2);case t:return d(m+"Milliseconds",3);default:return this.clone()}},h.endOf=function(e){return this.startOf(e,!1)},h.$set=function(o,s){var f,l=E.p(o),p="set"+(this.$u?"UTC":""),h=(f={},f[i]=p+"Date",f[c]=p+"Date",f[a]=p+"Month",f[u]=p+"FullYear",f[n]=p+"Hours",f[r]=p+"Minutes",f[t]=p+"Seconds",f[e]=p+"Milliseconds",f)[l],d=l===i?this.$D+(s-this.$W):s;if(l===a||l===u){var y=this.clone().set(c,1);y.$d[h](d),y.init(),this.$d=y.set(c,Math.min(this.$D,y.daysInMonth())).$d}else h&&this.$d[h](d);return this.init(),this},h.set=function(e,t){return this.clone().$set(e,t)},h.get=function(e){return this[E.p(e)]()},h.add=function(e,s){var c,f=this;e=Number(e);var l=E.p(s),p=function(t){var r=b(f);return E.w(r.date(r.date()+Math.round(t*e)),f)};if(l===a)return this.set(a,this.$M+e);if(l===u)return this.set(u,this.$y+e);if(l===i)return p(1);if(l===o)return p(7);var h=(c={},c[r]=6e4,c[n]=36e5,c[t]=1e3,c)[l]||1,d=this.$d.getTime()+e*h;return E.w(d,this)},h.subtract=function(e,t){return this.add(-1*e,t)},h.format=function(e){var t=this;if(!this.isValid())return"Invalid Date";var r=e||"YYYY-MM-DDTHH:mm:ssZ",n=E.z(this),i=this.$locale(),o=this.$H,a=this.$m,s=this.$M,u=i.weekdays,c=i.months,f=function(e,n,i,o){return e&&(e[n]||e(t,r))||i[n].substr(0,o)},p=function(e){return E.s(o%12||12,e,"0")},h=i.meridiem||function(e,t,r){var n=e<12?"AM":"PM";return r?n.toLowerCase():n},d={YY:String(this.$y).slice(-2),YYYY:this.$y,M:s+1,MM:E.s(s+1,2,"0"),MMM:f(i.monthsShort,s,c,3),MMMM:f(c,s),D:this.$D,DD:E.s(this.$D,2,"0"),d:String(this.$W),dd:f(i.weekdaysMin,this.$W,u,2),ddd:f(i.weekdaysShort,this.$W,u,3),dddd:u[this.$W],H:String(o),HH:E.s(o,2,"0"),h:p(1),hh:p(2),a:h(o,a,!0),A:h(o,a,!1),m:String(a),mm:E.s(a,2,"0"),s:String(this.$s),ss:E.s(this.$s,2,"0"),SSS:E.s(this.$ms,3,"0"),Z:n};return r.replace(l,function(e,t){return t||d[e]||n.replace(":","")})},h.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},h.diff=function(e,c,f){var l,p=E.p(c),h=b(e),d=6e4*(h.utcOffset()-this.utcOffset()),y=this-h,g=E.m(this,h);return g=(l={},l[u]=g/12,l[a]=g,l[s]=g/3,l[o]=(y-d)/6048e5,l[i]=(y-d)/864e5,l[n]=y/36e5,l[r]=y/6e4,l[t]=y/1e3,l)[p]||y,f?g:E.a(g)},h.daysInMonth=function(){return this.endOf(a).$D},h.$locale=function(){return g[this.$L]},h.locale=function(e,t){if(!e)return this.$L;var r=this.clone(),n=m(e,t,!0);return n&&(r.$L=n),r},h.clone=function(){return E.w(this.$d,this)},h.toDate=function(){return new Date(this.valueOf())},h.toJSON=function(){return this.isValid()?this.toISOString():null},h.toISOString=function(){return this.$d.toISOString()},h.toString=function(){return this.$d.toUTCString()},p}(),S=T.prototype;return b.prototype=S,[["$ms",e],["$s",t],["$m",r],["$H",n],["$W",i],["$M",a],["$y",u],["$D",c]].forEach(function(e){S[e[1]]=function(t){return this.$g(t,e[0],e[1])}}),b.extend=function(e,t){return e.$i||(e(t,T,b),e.$i=!0),b},b.locale=m,b.isDayjs=v,b.unix=function(e){return b(1e3*e)},b.en=g[y],b.Ls=g,b.p={},b},e.exports=i()},function(e,t,r){"use strict";var n=r(113),i=Object.prototype.hasOwnProperty,o=Array.isArray,a=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),s=function e(t){for(;t.length>1;){var r=t.pop(),n=r.obj[r.prop];if(o(n)){for(var i=[],a=0;a<n.length;++a)void 0!==n[a]&&i.push(n[a]);r.obj[r.prop]=i}}},u=function e(t,r){for(var n=r&&r.plainObjects?Object.create(null):{},i=0;i<t.length;++i)void 0!==t[i]&&(n[i]=t[i]);return n},c=function e(t,r,n){if(!r)return t;if("object"!=typeof r){if(o(t))t.push(r);else{if(!t||"object"!=typeof t)return[t,r];(n&&(n.plainObjects||n.allowPrototypes)||!i.call(Object.prototype,r))&&(t[r]=!0)}return t}if(!t||"object"!=typeof t)return[t].concat(r);var a=t;return o(t)&&!o(r)&&(a=u(t,n)),o(t)&&o(r)?(r.forEach(function(r,o){if(i.call(t,o)){var a=t[o];a&&"object"==typeof a&&r&&"object"==typeof r?t[o]=e(a,r,n):t.push(r)}else t[o]=r}),t):Object.keys(r).reduce(function(t,o){var a=r[o];return i.call(t,o)?t[o]=e(t[o],a,n):t[o]=a,t},a)},f=function e(t,r){return Object.keys(r).reduce(function(e,t){return e[t]=r[t],e},t)},l=function(e,t,r){var n=e.replace(/\+/g," ");if("iso-8859-1"===r)return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch(e){return n}},p=function e(t,r,i,o,s){if(0===t.length)return t;var u=t;if("symbol"==typeof t?u=Symbol.prototype.toString.call(t):"string"!=typeof t&&(u=String(t)),"iso-8859-1"===i)return escape(u).replace(/%u[0-9a-f]{4}/gi,function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"});for(var c="",f=0;f<u.length;++f){var l=u.charCodeAt(f);45===l||46===l||95===l||126===l||l>=48&&l<=57||l>=65&&l<=90||l>=97&&l<=122||s===n.RFC1738&&(40===l||41===l)?c+=u.charAt(f):l<128?c+=a[l]:l<2048?c+=a[192|l>>6]+a[128|63&l]:l<55296||l>=57344?c+=a[224|l>>12]+a[128|l>>6&63]+a[128|63&l]:(f+=1,l=65536+((1023&l)<<10|1023&u.charCodeAt(f)),c+=a[240|l>>18]+a[128|l>>12&63]+a[128|l>>6&63]+a[128|63&l])}return c},h=function e(t){for(var r=[{obj:{o:t},prop:"o"}],n=[],i=0;i<r.length;++i)for(var o=r[i],a=o.obj[o.prop],u=Object.keys(a),c=0;c<u.length;++c){var f=u[c],l=a[f];"object"==typeof l&&null!==l&&-1===n.indexOf(l)&&(r.push({obj:a,prop:f}),n.push(l))}return s(r),t},d=function e(t){return"[object RegExp]"===Object.prototype.toString.call(t)},y=function e(t){return!(!t||"object"!=typeof t)&&!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))},g=function e(t,r){return[].concat(t,r)},v=function e(t,r){if(o(t)){for(var n=[],i=0;i<t.length;i+=1)n.push(r(t[i]));return n}return r(t)};e.exports={arrayToObject:u,assign:f,combine:g,compact:h,decode:l,encode:p,isBuffer:y,isRegExp:d,maybeMap:v,merge:c}},function(e,t,r){"use strict";function n(){var e,t,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",a=r.toStringTag||"@@toStringTag";function s(r,n,o,a){var s=n&&n.prototype instanceof c?n:c,f=Object.create(s.prototype);return i(f,"_invoke",function(r,n,i){var o,a,s,c=0,f=i||[],l=!1,p={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function t(r,n){return o=r,a=0,s=e,p.n=n,u}};function h(r,n){for(a=r,s=n,t=0;!l&&c&&!i&&t<f.length;t++){var i,o=f[t],h=p.p,d=o[2];r>3?(i=d===n)&&(s=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=e):o[0]<=h&&((i=r<2&&h<o[1])?(a=0,p.v=n,p.n=o[1]):h<d&&(i=r<3||o[0]>n||n>d)&&(o[4]=r,o[5]=n,p.n=d,a=0))}if(i||r>1)return u;throw l=!0,n}return function(i,f,d){if(c>1)throw TypeError("Generator is already running");for(l&&1===f&&h(f,d),a=f,s=d;(t=a<2?e:s)||!l;){o||(a?a<3?(a>1&&(p.n=-1),h(a,s)):p.n=s:p.v=s);try{if(c=2,o){if(a||(i="next"),t=o[i]){if(!(t=t.call(o,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,a<2&&(a=0)}else 1===a&&(t=o.return)&&t.call(o),a<2&&(s=TypeError("The iterator does not provide a '"+i+"' method"),a=1);o=e}else if((t=(l=p.n<0)?s:r.call(n,p))!==u)break}catch(t){o=e,a=1,s=t}finally{c=1}}return{value:t,done:l}}}(r,o,a),!0),f}var u={};function c(){}function f(){}function l(){}t=Object.getPrototypeOf;var p=[][o]?t(t([][o]())):(i(t={},o,function(){return this}),t),h=l.prototype=c.prototype=Object.create(p);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,i(e,a,"GeneratorFunction")),e.prototype=Object.create(h),e}return f.prototype=l,i(h,"constructor",l),i(l,"constructor",f),f.displayName="GeneratorFunction",i(l,a,"GeneratorFunction"),i(h),i(h,a,"Generator"),i(h,o,function(){return this}),i(h,"toString",function(){return"[object Generator]"}),(n=function e(){return{w:s,m:d}})()}function i(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}i=function e(t,r,n,a){function s(e,r){i(t,e,function(t){return this._invoke(e,r,t)})}r?o?o(t,r,{value:n,enumerable:!a,configurable:!a,writable:!a}):t[r]=n:(s("next",0),s("throw",1),s("return",2))},i(e,t,r,n)}function o(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function a(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function s(e){o(a,n,i,s,u,"next",e)}function u(e){o(a,n,i,s,u,"throw",e)}s(void 0)})}}var s=r(176),u={};e.exports=u,u.extendContextLoader=function(e){return function(){var t=a(n().m(function t(r){var i;return n().w(function(t){for(;;)switch(t.n){case 0:if(void 0===(i=s[r])){t.n=1;break}return t.a(2,{contextUrl:null,documentUrl:r,document:i});case 1:return t.a(2,e(r))}},t)}));return function(e){return t.apply(this,arguments)}}()},u.strictDocumentLoader=u.extendContextLoader(function(e){throw new Error("".concat(e," not found."))})},function(e,t,r){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",a=r.toStringTag||"@@toStringTag";function s(r,n,i,a){var s=n&&n.prototype instanceof c?n:c,f=Object.create(s.prototype);return o(f,"_invoke",function(r,n,i){var o,a,s,c=0,f=i||[],l=!1,p={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function t(r,n){return o=r,a=0,s=e,p.n=n,u}};function h(r,n){for(a=r,s=n,t=0;!l&&c&&!i&&t<f.length;t++){var i,o=f[t],h=p.p,d=o[2];r>3?(i=d===n)&&(s=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=e):o[0]<=h&&((i=r<2&&h<o[1])?(a=0,p.v=n,p.n=o[1]):h<d&&(i=r<3||o[0]>n||n>d)&&(o[4]=r,o[5]=n,p.n=d,a=0))}if(i||r>1)return u;throw l=!0,n}return function(i,f,d){if(c>1)throw TypeError("Generator is already running");for(l&&1===f&&h(f,d),a=f,s=d;(t=a<2?e:s)||!l;){o||(a?a<3?(a>1&&(p.n=-1),h(a,s)):p.n=s:p.v=s);try{if(c=2,o){if(a||(i="next"),t=o[i]){if(!(t=t.call(o,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,a<2&&(a=0)}else 1===a&&(t=o.return)&&t.call(o),a<2&&(s=TypeError("The iterator does not provide a '"+i+"' method"),a=1);o=e}else if((t=(l=p.n<0)?s:r.call(n,p))!==u)break}catch(t){o=e,a=1,s=t}finally{c=1}}return{value:t,done:l}}}(r,i,a),!0),f}var u={};function c(){}function f(){}function l(){}t=Object.getPrototypeOf;var p=[][n]?t(t([][n]())):(o(t={},n,function(){return this}),t),h=l.prototype=c.prototype=Object.create(p);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,o(e,a,"GeneratorFunction")),e.prototype=Object.create(h),e}return f.prototype=l,o(h,"constructor",l),o(l,"constructor",f),f.displayName="GeneratorFunction",o(l,a,"GeneratorFunction"),o(h),o(h,a,"Generator"),o(h,n,function(){return this}),o(h,"toString",function(){return"[object Generator]"}),(i=function e(){return{w:s,m:d}})()}function o(e,t,r,n){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}o=function e(t,r,n,a){function s(e,r){o(t,e,function(t){return this._invoke(e,r,t)})}r?i?i(t,r,{value:n,enumerable:!a,configurable:!a,writable:!a}):t[r]=n:(s("next",0),s("throw",1),s("return",2))},o(e,t,r,n)}function a(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function s(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var o=e.apply(t,r);function s(e){a(o,n,i,s,u,"next",e)}function u(e){a(o,n,i,s,u,"throw",e)}s(void 0)})}}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,l(n.key),n)}}function f(e,t,r){return t&&c(e.prototype,t),r&&c(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function l(e){var t=p(e,"string");return"symbol"==n(t)?t:t+""}function p(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function h(e,t,r){return t=v(t),d(e,g()?Reflect.construct(t,r||[],v(e).constructor):t.apply(e,r))}function d(e,t){if(t&&("object"==n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return y(e)}function y(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function g(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(g=function t(){return!!e})()}function v(e){return v=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},v(e)}function m(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&b(e,t)}function b(e,t){return b=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},b(e,t)}var E=r(72);e.exports=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e.controller,n=e.date,i=e.maxTimestampDelta,o=void 0===i?1/0:i;return u(this,t),h(this,t,[{term:"publicKey",controller:r,date:n,maxTimestampDelta:o}])}return m(t,e),f(t,[{key:"update",value:function(){var e=s(i().m(function e(t){return i().w(function(e){for(;;)if(0===e.n)return e.a(2,t)},e)}));function t(t){return e.apply(this,arguments)}return t}()},{key:"match",value:function(){var e=s(i().m(function e(t){return i().w(function(e){for(;;)if(0===e.n)return e.a(2,void 0===t.proofPurpose)},e)}));function t(t){return e.apply(this,arguments)}return t}()}])}(E)},function(e,t,r){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",a=r.toStringTag||"@@toStringTag";function s(r,n,i,a){var s=n&&n.prototype instanceof c?n:c,f=Object.create(s.prototype);return o(f,"_invoke",function(r,n,i){var o,a,s,c=0,f=i||[],l=!1,p={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function t(r,n){return o=r,a=0,s=e,p.n=n,u}};function h(r,n){for(a=r,s=n,t=0;!l&&c&&!i&&t<f.length;t++){var i,o=f[t],h=p.p,d=o[2];r>3?(i=d===n)&&(s=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=e):o[0]<=h&&((i=r<2&&h<o[1])?(a=0,p.v=n,p.n=o[1]):h<d&&(i=r<3||o[0]>n||n>d)&&(o[4]=r,o[5]=n,p.n=d,a=0))}if(i||r>1)return u;throw l=!0,n}return function(i,f,d){if(c>1)throw TypeError("Generator is already running");for(l&&1===f&&h(f,d),a=f,s=d;(t=a<2?e:s)||!l;){o||(a?a<3?(a>1&&(p.n=-1),h(a,s)):p.n=s:p.v=s);try{if(c=2,o){if(a||(i="next"),t=o[i]){if(!(t=t.call(o,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,a<2&&(a=0)}else 1===a&&(t=o.return)&&t.call(o),a<2&&(s=TypeError("The iterator does not provide a '"+i+"' method"),a=1);o=e}else if((t=(l=p.n<0)?s:r.call(n,p))!==u)break}catch(t){o=e,a=1,s=t}finally{c=1}}return{value:t,done:l}}}(r,i,a),!0),f}var u={};function c(){}function f(){}function l(){}t=Object.getPrototypeOf;var p=[][n]?t(t([][n]())):(o(t={},n,function(){return this}),t),h=l.prototype=c.prototype=Object.create(p);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,o(e,a,"GeneratorFunction")),e.prototype=Object.create(h),e}return f.prototype=l,o(h,"constructor",l),o(l,"constructor",f),f.displayName="GeneratorFunction",o(l,a,"GeneratorFunction"),o(h),o(h,a,"Generator"),o(h,n,function(){return this}),o(h,"toString",function(){return"[object Generator]"}),(i=function e(){return{w:s,m:d}})()}function o(e,t,r,n){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}o=function e(t,r,n,a){function s(e,r){o(t,e,function(t){return this._invoke(e,r,t)})}r?i?i(t,r,{value:n,enumerable:!a,configurable:!a,writable:!a}):t[r]=n:(s("next",0),s("throw",1),s("return",2))},o(e,t,r,n)}function a(e){if(null==e)throw new TypeError("Cannot destructure "+e)}function s(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function u(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var o=e.apply(t,r);function a(e){s(o,n,i,a,u,"next",e)}function u(e){s(o,n,i,a,u,"throw",e)}a(void 0)})}}function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,p(n.key),n)}}function l(e,t,r){return t&&f(e.prototype,t),r&&f(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function p(e){var t=h(e,"string");return"symbol"==n(t)?t:t+""}function h(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}e.exports=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.term,n=t.date,i=t.maxTimestampDelta,o=void 0===i?1/0:i;if(c(this,e),void 0===r)throw new Error('"term" is required.');if(void 0!==o&&"number"!=typeof o)throw new TypeError('"maxTimestampDelta" must be a number.');if(this.term=r,void 0!==n&&(this.date=new Date(n),isNaN(this.date)))throw TypeError('"date" "'.concat(n,'" is not a valid date.'));this.maxTimestampDelta=o}return l(e,[{key:"validate",value:function(){var e=u(i().m(function e(t,r){var n,o,s,u;return i().w(function(e){for(;;)switch(e.p=e.n){case 0:if(a(r),e.p=1,this.maxTimestampDelta===1/0){e.n=2;break}if(n=(this.date||new Date).getTime(),o=1e3*this.maxTimestampDelta,(s=new Date(t.created).getTime())>=n-o&&s<=n+o){e.n=2;break}throw new Error("The proof's created timestamp is out of range.");case 2:return e.a(2,{valid:!0});case 3:return e.p=3,u=e.v,e.a(2,{valid:!1,error:u})}},e,this,[[1,3]])}));function t(t,r){return e.apply(this,arguments)}return t}()},{key:"update",value:function(){var e=u(i().m(function e(t,r){return i().w(function(e){for(;;)if(0===e.n)return a(r),t.proofPurpose=this.term,e.a(2,t)},e,this)}));function t(t,r){return e.apply(this,arguments)}return t}()},{key:"match",value:function(){var e=u(i().m(function e(t,r){return i().w(function(e){for(;;)if(0===e.n)return a(r),e.a(2,t.proofPurpose===this.term)},e,this)}));function t(t,r){return e.apply(this,arguments)}return t}()}])}()},function(e,t,r){"use strict";(function(t){var n=r(133),i=r(117),o={};function a(){return n.nodejs?function(e,r){var n=t.from(e,r);return new Uint8Array(n.buffer,n.byteOffset,n.length)}:function(e,t){var r=new i.util.ByteBuffer(e,t);return i.util.binary.raw.decode(r.getBytes())}}function s(){return n.nodejs?function(e,r){var n=t.concat([t.from(e.buffer,e.byteOffset,e.length),t.from(r.buffer,r.byteOffset,r.length)]);return new Uint8Array(n.buffer,n.byteOffset,n.length)}:function(e,t){var r=new Uint8Array(e.length+t.length);return r.set(e,0),r.set(t,e.length),r}}function u(){if(n.nodejs){var e=r(199);return function(t,r){var n=e.createHash("sha256");n.update(t,r);var i=n.digest();return new Uint8Array(i.buffer,i.byteOffset,i.length)}}return function(e,t){var r=i.md.sha256.create();r.update(e,t||"utf8");var n=r.digest();return i.util.binary.raw.decode(n.getBytes())}}function c(){return n.nodejs?function(e){var r=e.encodedHeader,n=e.verifyData,i=t.concat([t.from(r+".","utf8"),t.from(n.buffer,n.byteOffset,n.length)]);return new Uint8Array(i.buffer,i.byteOffset,i.length)}:function(e){var t=e.encodedHeader,r=e.verifyData,n=new i.util.ByteBuffer(t+".","utf8"),o=i.util.binary.raw.encode(r);return n.putBytes(o),i.util.binary.raw.decode(n.getBytes())}}function f(){if(n.nodejs){var e=r(124);return function(r){return e("string"==typeof r?r:t.from(r.buffer,r.byteOffset,r.length))}}return function(e){var t,r;return t="string"==typeof e?i.util.encodeUtf8(e):i.util.binary.raw.encode(e),i.util.encode64(t).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}}function l(){if(n.nodejs){var e=r(124);return function(t){var r=e.toBuffer(t);return new Uint8Array(r.buffer,r.offset,r.length)}}return function(e){var t=e.replace(/-/g,"+").replace(/_/g,"/"),r=t.length%4;if(0===r);else if(2===r)t+="==";else{if(3!==r)throw new Error("Illegal base64 string.");t+="="}return i.util.binary.base64.decode(t)}}function p(){if(n.nodejs){var e=r(124);return function(t){return e.decode(t)}}return function(e){var t=e.replace(/-/g,"+").replace(/_/g,"/"),r=t.length%4;if(0===r);else if(2===r)t+="==";else{if(3!==r)throw new Error("Illegal base64 string.");t+="="}var n=i.util.decode64(t);return i.util.decodeUtf8(n)}}e.exports=o,o.createJws=c(),o.w3cDate=function(e){null==e?e=new Date:"number"!=typeof e&&"string"!=typeof e||(e=new Date(e));var t=e.toISOString();return t.substr(0,t.length-5)+"Z"},o.encodeBase64Url=f(),o.decodeBase64Url=l(),o.decodeBase64UrlToString=p(),o.sha256=u(),o.concat=s(),o.stringToBytes=a()}).call(this,r(116).Buffer)},function(e,t,r){"use strict";(function(t){var r=void 0!==t&&t.versions&&t.versions.node,n=!r&&("undefined"!=typeof window||"undefined"!=typeof self);e.exports={nodejs:r,browser:n}}).call(this,r(36))},function(e,t,r){(function(e){var n=void 0!==e&&e||"undefined"!=typeof self&&self||window,i=Function.prototype.apply;function o(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new o(i.call(setTimeout,n,arguments),clearTimeout)},t.setInterval=function(){return new o(i.call(setInterval,n,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(n,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout(function t(){e._onTimeout&&e._onTimeout()},t))},r(188),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,r(29))},function(e,t,r){var n=r(4);r(8),n.cipher=n.cipher||{};var i=e.exports=n.cipher.modes=n.cipher.modes||{};function o(e,t){if("string"==typeof e&&(e=n.util.createBuffer(e)),n.util.isArray(e)&&e.length>4){var r=e;e=n.util.createBuffer();for(var i=0;i<r.length;++i)e.putByte(r[i])}if(e.length()<t)throw new Error("Invalid IV length; got "+e.length()+" bytes and expected "+t+" bytes.");if(!n.util.isArray(e)){for(var o=[],a=t/4,i=0;i<a;++i)o.push(e.getInt32());e=o}return e}function a(e){e[e.length-1]=e[e.length-1]+1&4294967295}function s(e){return[e/4294967296|0,4294967295&e]}i.ecb=function(e){e=e||{},this.name="ECB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)},i.ecb.prototype.start=function(e){},i.ecb.prototype.encrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=e.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(var n=0;n<this._ints;++n)t.putInt32(this._outBlock[n])},i.ecb.prototype.decrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=e.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(var n=0;n<this._ints;++n)t.putInt32(this._outBlock[n])},i.ecb.prototype.pad=function(e,t){var r=e.length()===this.blockSize?this.blockSize:this.blockSize-e.length();return e.fillWithByte(r,r),!0},i.ecb.prototype.unpad=function(e,t){if(t.overflow>0)return!1;var r=e.length(),n=e.at(r-1);return!(n>this.blockSize<<2)&&(e.truncate(n),!0)},i.cbc=function(e){e=e||{},this.name="CBC",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)},i.cbc.prototype.start=function(e){if(null===e.iv){if(!this._prev)throw new Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else{if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=o(e.iv,this.blockSize),this._prev=this._iv.slice(0)}},i.cbc.prototype.encrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=this._prev[n]^e.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(var n=0;n<this._ints;++n)t.putInt32(this._outBlock[n]);this._prev=this._outBlock},i.cbc.prototype.decrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=e.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(var n=0;n<this._ints;++n)t.putInt32(this._prev[n]^this._outBlock[n]);this._prev=this._inBlock.slice(0)},i.cbc.prototype.pad=function(e,t){var r=e.length()===this.blockSize?this.blockSize:this.blockSize-e.length();return e.fillWithByte(r,r),!0},i.cbc.prototype.unpad=function(e,t){if(t.overflow>0)return!1;var r=e.length(),n=e.at(r-1);return!(n>this.blockSize<<2)&&(e.truncate(n),!0)},i.cfb=function(e){e=e||{},this.name="CFB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0},i.cfb.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=o(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},i.cfb.prototype.encrypt=function(e,t,r){var n=e.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i<this._ints;++i)this._inBlock[i]=e.getInt32()^this._outBlock[i],t.putInt32(this._inBlock[i]);else{var o=(this.blockSize-n)%this.blockSize;o>0&&(o=this.blockSize-o),this._partialOutput.clear();for(var i=0;i<this._ints;++i)this._partialBlock[i]=e.getInt32()^this._outBlock[i],this._partialOutput.putInt32(this._partialBlock[i]);if(o>0)e.read-=this.blockSize;else for(var i=0;i<this._ints;++i)this._inBlock[i]=this._partialBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),o>0&&!r)return t.putBytes(this._partialOutput.getBytes(o-this._partialBytes)),this._partialBytes=o,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},i.cfb.prototype.decrypt=function(e,t,r){var n=e.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i<this._ints;++i)this._inBlock[i]=e.getInt32(),t.putInt32(this._inBlock[i]^this._outBlock[i]);else{var o=(this.blockSize-n)%this.blockSize;o>0&&(o=this.blockSize-o),this._partialOutput.clear();for(var i=0;i<this._ints;++i)this._partialBlock[i]=e.getInt32(),this._partialOutput.putInt32(this._partialBlock[i]^this._outBlock[i]);if(o>0)e.read-=this.blockSize;else for(var i=0;i<this._ints;++i)this._inBlock[i]=this._partialBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),o>0&&!r)return t.putBytes(this._partialOutput.getBytes(o-this._partialBytes)),this._partialBytes=o,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},i.ofb=function(e){e=e||{},this.name="OFB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0},i.ofb.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=o(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},i.ofb.prototype.encrypt=function(e,t,r){var n=e.length();if(0===e.length())return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i<this._ints;++i)t.putInt32(e.getInt32()^this._outBlock[i]),this._inBlock[i]=this._outBlock[i];else{var o=(this.blockSize-n)%this.blockSize;o>0&&(o=this.blockSize-o),this._partialOutput.clear();for(var i=0;i<this._ints;++i)this._partialOutput.putInt32(e.getInt32()^this._outBlock[i]);if(o>0)e.read-=this.blockSize;else for(var i=0;i<this._ints;++i)this._inBlock[i]=this._outBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),o>0&&!r)return t.putBytes(this._partialOutput.getBytes(o-this._partialBytes)),this._partialBytes=o,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},i.ofb.prototype.decrypt=i.ofb.prototype.encrypt,i.ctr=function(e){e=e||{},this.name="CTR",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0},i.ctr.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=o(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},i.ctr.prototype.encrypt=function(e,t,r){var n=e.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i<this._ints;++i)t.putInt32(e.getInt32()^this._outBlock[i]);else{var o=(this.blockSize-n)%this.blockSize;o>0&&(o=this.blockSize-o),this._partialOutput.clear();for(var i=0;i<this._ints;++i)this._partialOutput.putInt32(e.getInt32()^this._outBlock[i]);if(o>0&&(e.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),o>0&&!r)return t.putBytes(this._partialOutput.getBytes(o-this._partialBytes)),this._partialBytes=o,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}a(this._inBlock)},i.ctr.prototype.decrypt=i.ctr.prototype.encrypt,i.gcm=function(e){e=e||{},this.name="GCM",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0,this._R=3774873600},i.gcm.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");var t=n.util.createBuffer(e.iv),r;if(this._cipherLength=0,r="additionalData"in e?n.util.createBuffer(e.additionalData):n.util.createBuffer(),this._tagLength="tagLength"in e?e.tagLength:128,this._tag=null,e.decrypt&&(this._tag=n.util.createBuffer(e.tag).getBytes(),this._tag.length!==this._tagLength/8))throw new Error("Authentication tag does not match tag length.");this._hashBlock=new Array(this._ints),this.tag=null,this._hashSubkey=new Array(this._ints),this.cipher.encrypt([0,0,0,0],this._hashSubkey),this.componentBits=4,this._m=this.generateHashTable(this._hashSubkey,this.componentBits);var i=t.length();if(12===i)this._j0=[t.getInt32(),t.getInt32(),t.getInt32(),1];else{for(this._j0=[0,0,0,0];t.length()>0;)this._j0=this.ghash(this._hashSubkey,this._j0,[t.getInt32(),t.getInt32(),t.getInt32(),t.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(s(8*i)))}this._inBlock=this._j0.slice(0),a(this._inBlock),this._partialBytes=0,r=n.util.createBuffer(r),this._aDataLength=s(8*r.length());var o=r.length()%this.blockSize;for(o&&r.fillWithByte(0,this.blockSize-o),this._s=[0,0,0,0];r.length()>0;)this._s=this.ghash(this._hashSubkey,this._s,[r.getInt32(),r.getInt32(),r.getInt32(),r.getInt32()])},i.gcm.prototype.encrypt=function(e,t,r){var n=e.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize){for(var i=0;i<this._ints;++i)t.putInt32(this._outBlock[i]^=e.getInt32());this._cipherLength+=this.blockSize}else{var o=(this.blockSize-n)%this.blockSize;o>0&&(o=this.blockSize-o),this._partialOutput.clear();for(var i=0;i<this._ints;++i)this._partialOutput.putInt32(e.getInt32()^this._outBlock[i]);if(o<=0||r){if(r){var s=n%this.blockSize;this._cipherLength+=s,this._partialOutput.truncate(this.blockSize-s)}else this._cipherLength+=this.blockSize;for(var i=0;i<this._ints;++i)this._outBlock[i]=this._partialOutput.getInt32();this._partialOutput.read-=this.blockSize}if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),o>0&&!r)return e.read-=this.blockSize,t.putBytes(this._partialOutput.getBytes(o-this._partialBytes)),this._partialBytes=o,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),a(this._inBlock)},i.gcm.prototype.decrypt=function(e,t,r){var n=e.length();if(n<this.blockSize&&!(r&&n>0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),a(this._inBlock),this._hashBlock[0]=e.getInt32(),this._hashBlock[1]=e.getInt32(),this._hashBlock[2]=e.getInt32(),this._hashBlock[3]=e.getInt32(),this._s=this.ghash(this._hashSubkey,this._s,this._hashBlock);for(var i=0;i<this._ints;++i)t.putInt32(this._outBlock[i]^this._hashBlock[i]);n<this.blockSize?this._cipherLength+=n%this.blockSize:this._cipherLength+=this.blockSize},i.gcm.prototype.afterFinish=function(e,t){var r=!0;t.decrypt&&t.overflow&&e.truncate(this.blockSize-t.overflow),this.tag=n.util.createBuffer();var i=this._aDataLength.concat(s(8*this._cipherLength));this._s=this.ghash(this._hashSubkey,this._s,i);var o=[];this.cipher.encrypt(this._j0,o);for(var a=0;a<this._ints;++a)this.tag.putInt32(this._s[a]^o[a]);return this.tag.truncate(this.tag.length()%(this._tagLength/8)),t.decrypt&&this.tag.bytes()!==this._tag&&(r=!1),r},i.gcm.prototype.multiply=function(e,t){for(var r=[0,0,0,0],n=t.slice(0),i=0;i<128;++i){var o;e[i/32|0]&1<<31-i%32&&(r[0]^=n[0],r[1]^=n[1],r[2]^=n[2],r[3]^=n[3]),this.pow(n,n)}return r},i.gcm.prototype.pow=function(e,t){for(var r=1&e[3],n=3;n>0;--n)t[n]=e[n]>>>1|(1&e[n-1])<<31;t[0]=e[0]>>>1,r&&(t[0]^=this._R)},i.gcm.prototype.tableMultiply=function(e){for(var t=[0,0,0,0],r=0;r<32;++r){var n,i=e[r/8|0]>>>4*(7-r%8)&15,o=this._m[r][i];t[0]^=o[0],t[1]^=o[1],t[2]^=o[2],t[3]^=o[3]}return t},i.gcm.prototype.ghash=function(e,t,r){return t[0]^=r[0],t[1]^=r[1],t[2]^=r[2],t[3]^=r[3],this.tableMultiply(t)},i.gcm.prototype.generateHashTable=function(e,t){for(var r=8/t,n=4*r,i=16*r,o=new Array(i),a=0;a<i;++a){var s=[0,0,0,0],u,c=(n-1-a%n)*t;s[a/n|0]=1<<t-1<<c,o[a]=this.generateSubHashTable(this.multiply(s,e),t)}return o},i.gcm.prototype.generateSubHashTable=function(e,t){var r=1<<t,n=r>>>1,i=new Array(r);i[n]=e.slice(0);for(var o=n>>>1;o>0;)this.pow(i[2*o],i[o]=[]),o>>=1;for(o=2;o<n;){for(var a=1;a<o;++a){var s=i[o],u=i[a];i[o+a]=[s[0]^u[0],s[1]^u[1],s[2]^u[2],s[3]^u[3]]}o*=2}for(i[0]=[0,0,0,0],o=n+1;o<r;++o){var c=i[o^n];i[o]=[e[0]^c[0],e[1]^c[1],e[2]^c[2],e[3]^c[3]]}return i}},function(e,t,r){var n=r(4);r(33),r(68),r(119),r(51),r(137),r(31),r(69),r(8);var i=function(e,t,r,i){var o=n.util.createBuffer(),a=e.length>>1,s=a+(1&e.length),u=e.substr(0,s),c=e.substr(a,s),f=n.util.createBuffer(),l=n.hmac.create();r=t+r;var p=Math.ceil(i/16),h=Math.ceil(i/20);l.start("MD5",u);var d=n.util.createBuffer();f.putBytes(r);for(var y=0;y<p;++y)l.start(null,null),l.update(f.getBytes()),f.putBuffer(l.digest()),l.start(null,null),l.update(f.bytes()+r),d.putBuffer(l.digest());l.start("SHA1",c);var g=n.util.createBuffer();f.clear(),f.putBytes(r);for(var y=0;y<h;++y)l.start(null,null),l.update(f.getBytes()),f.putBuffer(l.digest()),l.start(null,null),l.update(f.bytes()+r),g.putBuffer(l.digest());return o.putBytes(n.util.xorBytes(d.getBytes(),g.getBytes(),i)),o},o=function(e,t,r,n){},a=function(e,t,r){var i=n.hmac.create();i.start("SHA1",e);var o=n.util.createBuffer();return o.putInt32(t[0]),o.putInt32(t[1]),o.putByte(r.type),o.putByte(r.version.major),o.putByte(r.version.minor),o.putInt16(r.length),o.putBytes(r.fragment.bytes()),i.update(o.getBytes()),i.digest().getBytes()},s=function(e,t,r){var i=!1;try{var o=e.deflate(t.fragment.getBytes());t.fragment=n.util.createBuffer(o),t.length=o.length,i=!0}catch(e){}return i},u=function(e,t,r){var i=!1;try{var o=e.inflate(t.fragment.getBytes());t.fragment=n.util.createBuffer(o),t.length=o.length,i=!0}catch(e){}return i},c=function(e,t){var r=0;switch(t){case 1:r=e.getByte();break;case 2:r=e.getInt16();break;case 3:r=e.getInt24();break;case 4:r=e.getInt32()}return n.util.createBuffer(e.getBytes(r))},f=function(e,t,r){e.putInt(r.length(),t<<3),e.putBuffer(r)},l={Versions:{TLS_1_0:{major:3,minor:1},TLS_1_1:{major:3,minor:2},TLS_1_2:{major:3,minor:3}}};l.SupportedVersions=[l.Versions.TLS_1_1,l.Versions.TLS_1_0],l.Version=l.SupportedVersions[0],l.MaxFragment=15360,l.ConnectionEnd={server:0,client:1},l.PRFAlgorithm={tls_prf_sha256:0},l.BulkCipherAlgorithm={none:null,rc4:0,des3:1,aes:2},l.CipherType={stream:0,block:1,aead:2},l.MACAlgorithm={none:null,hmac_md5:0,hmac_sha1:1,hmac_sha256:2,hmac_sha384:3,hmac_sha512:4},l.CompressionMethod={none:0,deflate:1},l.ContentType={change_cipher_spec:20,alert:21,handshake:22,application_data:23,heartbeat:24},l.HandshakeType={hello_request:0,client_hello:1,server_hello:2,certificate:11,server_key_exchange:12,certificate_request:13,server_hello_done:14,certificate_verify:15,client_key_exchange:16,finished:20},l.Alert={},l.Alert.Level={warning:1,fatal:2},l.Alert.Description={close_notify:0,unexpected_message:10,bad_record_mac:20,decryption_failed:21,record_overflow:22,decompression_failure:30,handshake_failure:40,bad_certificate:42,unsupported_certificate:43,certificate_revoked:44,certificate_expired:45,certificate_unknown:46,illegal_parameter:47,unknown_ca:48,access_denied:49,decode_error:50,decrypt_error:51,export_restriction:60,protocol_version:70,insufficient_security:71,internal_error:80,user_canceled:90,no_renegotiation:100},l.HeartbeatMessageType={heartbeat_request:1,heartbeat_response:2},l.CipherSuites={},l.getCipherSuite=function(e){var t=null;for(var r in l.CipherSuites){var n=l.CipherSuites[r];if(n.id[0]===e.charCodeAt(0)&&n.id[1]===e.charCodeAt(1)){t=n;break}}return t},l.handleUnexpected=function(e,t){var r;!e.open&&e.entity===l.ConnectionEnd.client||e.error(e,{message:"Unexpected message. Received TLS record out of order.",send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.unexpected_message}})},l.handleHelloRequest=function(e,t,r){!e.handshaking&&e.handshakes>0&&(l.queue(e,l.createAlert(e,{level:l.Alert.Level.warning,description:l.Alert.Description.no_renegotiation})),l.flush(e)),e.process()},l.parseHelloMessage=function(e,t,r){var i=null,o=e.entity===l.ConnectionEnd.client;if(r<38)e.error(e,{message:o?"Invalid ServerHello message. Message too short.":"Invalid ClientHello message. Message too short.",send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.illegal_parameter}});else{var a=t.fragment,s=a.length();if(i={version:{major:a.getByte(),minor:a.getByte()},random:n.util.createBuffer(a.getBytes(32)),session_id:c(a,1),extensions:[]},o?(i.cipher_suite=a.getBytes(2),i.compression_method=a.getByte()):(i.cipher_suites=c(a,2),i.compression_methods=c(a,1)),(s=r-(s-a.length()))>0){for(var u=c(a,2);u.length()>0;)i.extensions.push({type:[u.getByte(),u.getByte()],data:c(u,2)});if(!o)for(var f=0;f<i.extensions.length;++f){var p=i.extensions[f];if(0===p.type[0]&&0===p.type[1])for(var h=c(p.data,2);h.length()>0;){var d;if(0!==h.getByte())break;e.session.extensions.server_name.serverNameList.push(c(h,2).getBytes())}}}if(e.session.version&&(i.version.major!==e.session.version.major||i.version.minor!==e.session.version.minor))return e.error(e,{message:"TLS version change is disallowed during renegotiation.",send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.protocol_version}});if(o)e.session.cipherSuite=l.getCipherSuite(i.cipher_suite);else for(var y=n.util.createBuffer(i.cipher_suites.bytes());y.length()>0&&(e.session.cipherSuite=l.getCipherSuite(y.getBytes(2)),null===e.session.cipherSuite););if(null===e.session.cipherSuite)return e.error(e,{message:"No cipher suites in common.",send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.handshake_failure},cipherSuite:n.util.bytesToHex(i.cipher_suite)});e.session.compressionMethod=o?i.compression_method:l.CompressionMethod.none}return i},l.createSecurityParameters=function(e,t){var r=e.entity===l.ConnectionEnd.client,n=t.random.bytes(),i=r?e.session.sp.client_random:n,o=r?n:l.createRandom().getBytes();e.session.sp={entity:e.entity,prf_algorithm:l.PRFAlgorithm.tls_prf_sha256,bulk_cipher_algorithm:null,cipher_type:null,enc_key_length:null,block_length:null,fixed_iv_length:null,record_iv_length:null,mac_algorithm:null,mac_length:null,mac_key_length:null,compression_algorithm:e.session.compressionMethod,pre_master_secret:null,master_secret:null,client_random:i,server_random:o}},l.handleServerHello=function(e,t,r){var n=l.parseHelloMessage(e,t,r);if(!e.fail){if(!(n.version.minor<=e.version.minor))return e.error(e,{message:"Incompatible TLS version.",send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.protocol_version}});e.version.minor=n.version.minor,e.session.version=e.version;var i=n.session_id.bytes();i.length>0&&i===e.session.id?(e.expect=v,e.session.resuming=!0,e.session.sp.server_random=n.random.bytes()):(e.expect=h,e.session.resuming=!1,l.createSecurityParameters(e,n)),e.session.id=i,e.process()}},l.handleClientHello=function(e,t,r){var i=l.parseHelloMessage(e,t,r);if(!e.fail){var o=i.session_id.bytes(),a=null;if(e.sessionCache&&(null===(a=e.sessionCache.getSession(o))?o="":(a.version.major!==i.version.major||a.version.minor>i.version.minor)&&(a=null,o="")),0===o.length&&(o=n.random.getBytes(32)),e.session.id=o,e.session.clientHelloVersion=i.version,e.session.sp={},a)e.version=e.session.version=a.version,e.session.sp=a.sp;else{for(var s,u=1;u<l.SupportedVersions.length&&!((s=l.SupportedVersions[u]).minor<=i.version.minor);++u);e.version={major:s.major,minor:s.minor},e.session.version=e.version}null!==a?(e.expect=_,e.session.resuming=!0,e.session.sp.client_random=i.random.bytes()):(e.expect=!1!==e.verifyClient?S:w,e.session.resuming=!1,l.createSecurityParameters(e,i)),e.open=!0,l.queue(e,l.createRecord(e,{type:l.ContentType.handshake,data:l.createServerHello(e)})),e.session.resuming?(l.queue(e,l.createRecord(e,{type:l.ContentType.change_cipher_spec,data:l.createChangeCipherSpec()})),e.state.pending=l.createConnectionState(e),e.state.current.write=e.state.pending.write,l.queue(e,l.createRecord(e,{type:l.ContentType.handshake,data:l.createFinished(e)}))):(l.queue(e,l.createRecord(e,{type:l.ContentType.handshake,data:l.createCertificate(e)})),e.fail||(l.queue(e,l.createRecord(e,{type:l.ContentType.handshake,data:l.createServerKeyExchange(e)})),!1!==e.verifyClient&&l.queue(e,l.createRecord(e,{type:l.ContentType.handshake,data:l.createCertificateRequest(e)})),l.queue(e,l.createRecord(e,{type:l.ContentType.handshake,data:l.createServerHelloDone(e)})))),l.flush(e),e.process()}},l.handleCertificate=function(e,t,r){if(r<3)return e.error(e,{message:"Invalid Certificate message. Message too short.",send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.illegal_parameter}});var i=t.fragment,o={certificate_list:c(i,3)},a,s,u=[];try{for(;o.certificate_list.length()>0;)a=c(o.certificate_list,3),s=n.asn1.fromDer(a),a=n.pki.certificateFromAsn1(s,!0),u.push(a)}catch(t){return e.error(e,{message:"Could not parse certificate list.",cause:t,send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.bad_certificate}})}var f=e.entity===l.ConnectionEnd.client;!f&&!0!==e.verifyClient||0!==u.length?0===u.length?e.expect=f?d:w:(f?e.session.serverCertificate=u[0]:e.session.clientCertificate=u[0],l.verifyCertificateChain(e,u)&&(e.expect=f?d:w)):e.error(e,{message:f?"No server certificate provided.":"No client certificate provided.",send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.illegal_parameter}}),e.process()},l.handleServerKeyExchange=function(e,t,r){if(r>0)return e.error(e,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.unsupported_certificate}});e.expect=y,e.process()},l.handleClientKeyExchange=function(e,t,r){if(r<48)return e.error(e,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.unsupported_certificate}});var i=t.fragment,o={enc_pre_master_secret:c(i,2).getBytes()},a=null;if(e.getPrivateKey)try{a=e.getPrivateKey(e,e.session.serverCertificate),a=n.pki.privateKeyFromPem(a)}catch(t){e.error(e,{message:"Could not get private key.",cause:t,send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.internal_error}})}if(null===a)return e.error(e,{message:"No private key set.",send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.internal_error}});try{var s=e.session.sp;s.pre_master_secret=a.decrypt(o.enc_pre_master_secret);var u=e.session.clientHelloVersion;if(u.major!==s.pre_master_secret.charCodeAt(0)||u.minor!==s.pre_master_secret.charCodeAt(1))throw new Error("TLS version rollback attack detected.")}catch(e){s.pre_master_secret=n.random.getBytes(48)}e.expect=_,null!==e.session.clientCertificate&&(e.expect=C),e.process()},l.handleCertificateRequest=function(e,t,r){if(r<3)return e.error(e,{message:"Invalid CertificateRequest. Message too short.",send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.illegal_parameter}});var n=t.fragment,i={certificate_types:c(n,1),certificate_authorities:c(n,2)};e.session.certificateRequest=i,e.expect=g,e.process()},l.handleCertificateVerify=function(e,t,r){if(r<2)return e.error(e,{message:"Invalid CertificateVerify. Message too short.",send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.illegal_parameter}});var i=t.fragment;i.read-=4;var o=i.bytes();i.read+=4;var a={signature:c(i,2).getBytes()},s=n.util.createBuffer();s.putBuffer(e.session.md5.digest()),s.putBuffer(e.session.sha1.digest()),s=s.getBytes();try{var u;if(!e.session.clientCertificate.publicKey.verify(s,a.signature,"NONE"))throw new Error("CertificateVerify signature does not match.");e.session.md5.update(o),e.session.sha1.update(o)}catch(t){return e.error(e,{message:"Bad signature in CertificateVerify.",send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.handshake_failure}})}e.expect=_,e.process()},l.handleServerHelloDone=function(e,t,r){if(r>0)return e.error(e,{message:"Invalid ServerHelloDone message. Invalid length.",send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.record_overflow}});if(null===e.serverCertificate){var i={message:"No server certificate provided. Not enough security.",send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.insufficient_security}},o=0,a=e.verify(e,i.alert.description,0,[]);if(!0!==a)return(a||0===a)&&("object"!=typeof a||n.util.isArray(a)?"number"==typeof a&&(i.alert.description=a):(a.message&&(i.message=a.message),a.alert&&(i.alert.description=a.alert))),e.error(e,i)}null!==e.session.certificateRequest&&(t=l.createRecord(e,{type:l.ContentType.handshake,data:l.createCertificate(e)}),l.queue(e,t)),t=l.createRecord(e,{type:l.ContentType.handshake,data:l.createClientKeyExchange(e)}),l.queue(e,t),e.expect=E;var s=function(e,t){null!==e.session.certificateRequest&&null!==e.session.clientCertificate&&l.queue(e,l.createRecord(e,{type:l.ContentType.handshake,data:l.createCertificateVerify(e,t)})),l.queue(e,l.createRecord(e,{type:l.ContentType.change_cipher_spec,data:l.createChangeCipherSpec()})),e.state.pending=l.createConnectionState(e),e.state.current.write=e.state.pending.write,l.queue(e,l.createRecord(e,{type:l.ContentType.handshake,data:l.createFinished(e)})),e.expect=v,l.flush(e),e.process()};if(null===e.session.certificateRequest||null===e.session.clientCertificate)return s(e,null);l.getClientSignature(e,s)},l.handleChangeCipherSpec=function(e,t){if(1!==t.fragment.getByte())return e.error(e,{message:"Invalid ChangeCipherSpec message received.",send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.illegal_parameter}});var r=e.entity===l.ConnectionEnd.client;(e.session.resuming&&r||!e.session.resuming&&!r)&&(e.state.pending=l.createConnectionState(e)),e.state.current.read=e.state.pending.read,(!e.session.resuming&&r||e.session.resuming&&!r)&&(e.state.pending=null),e.expect=r?m:I,e.process()},l.handleFinished=function(e,t,r){var o=t.fragment;o.read-=4;var a=o.bytes();o.read+=4;var s=t.fragment.getBytes();(o=n.util.createBuffer()).putBuffer(e.session.md5.digest()),o.putBuffer(e.session.sha1.digest());var u=e.entity===l.ConnectionEnd.client,c=u?"server finished":"client finished",f=e.session.sp,p=12,h;if((o=i(f.master_secret,c,o.getBytes(),p)).getBytes()!==s)return e.error(e,{message:"Invalid verify_data in Finished message.",send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.decrypt_error}});e.session.md5.update(a),e.session.sha1.update(a),(e.session.resuming&&u||!e.session.resuming&&!u)&&(l.queue(e,l.createRecord(e,{type:l.ContentType.change_cipher_spec,data:l.createChangeCipherSpec()})),e.state.current.write=e.state.pending.write,e.state.pending=null,l.queue(e,l.createRecord(e,{type:l.ContentType.handshake,data:l.createFinished(e)}))),e.expect=u?b:A,e.handshaking=!1,++e.handshakes,e.peerCertificate=u?e.session.serverCertificate:e.session.clientCertificate,l.flush(e),e.isConnected=!0,e.connected(e),e.process()},l.handleAlert=function(e,t){var r=t.fragment,n={level:r.getByte(),description:r.getByte()},i;switch(n.description){case l.Alert.Description.close_notify:i="Connection closed.";break;case l.Alert.Description.unexpected_message:i="Unexpected message.";break;case l.Alert.Description.bad_record_mac:i="Bad record MAC.";break;case l.Alert.Description.decryption_failed:i="Decryption failed.";break;case l.Alert.Description.record_overflow:i="Record overflow.";break;case l.Alert.Description.decompression_failure:i="Decompression failed.";break;case l.Alert.Description.handshake_failure:i="Handshake failure.";break;case l.Alert.Description.bad_certificate:i="Bad certificate.";break;case l.Alert.Description.unsupported_certificate:i="Unsupported certificate.";break;case l.Alert.Description.certificate_revoked:i="Certificate revoked.";break;case l.Alert.Description.certificate_expired:i="Certificate expired.";break;case l.Alert.Description.certificate_unknown:i="Certificate unknown.";break;case l.Alert.Description.illegal_parameter:i="Illegal parameter.";break;case l.Alert.Description.unknown_ca:i="Unknown certificate authority.";break;case l.Alert.Description.access_denied:i="Access denied.";break;case l.Alert.Description.decode_error:i="Decode error.";break;case l.Alert.Description.decrypt_error:i="Decrypt error.";break;case l.Alert.Description.export_restriction:i="Export restriction.";break;case l.Alert.Description.protocol_version:i="Unsupported protocol version.";break;case l.Alert.Description.insufficient_security:i="Insufficient security.";break;case l.Alert.Description.internal_error:i="Internal error.";break;case l.Alert.Description.user_canceled:i="User canceled.";break;case l.Alert.Description.no_renegotiation:i="Renegotiation not supported.";break;default:i="Unknown error."}if(n.description===l.Alert.Description.close_notify)return e.close();e.error(e,{message:i,send:!1,origin:e.entity===l.ConnectionEnd.client?"server":"client",alert:n}),e.process()},l.handleHandshake=function(e,t){var r=t.fragment,i=r.getByte(),o=r.getInt24();if(o>r.length())return e.fragmented=t,t.fragment=n.util.createBuffer(),r.read-=4,e.process();e.fragmented=null,r.read-=4;var a=r.bytes(o+4);r.read+=4,i in H[e.entity][e.expect]?(e.entity!==l.ConnectionEnd.server||e.open||e.fail||(e.handshaking=!0,e.session={version:null,extensions:{server_name:{serverNameList:[]}},cipherSuite:null,compressionMethod:null,serverCertificate:null,clientCertificate:null,md5:n.md.md5.create(),sha1:n.md.sha1.create()}),i!==l.HandshakeType.hello_request&&i!==l.HandshakeType.certificate_verify&&i!==l.HandshakeType.finished&&(e.session.md5.update(a),e.session.sha1.update(a)),H[e.entity][e.expect][i](e,t,o)):l.handleUnexpected(e,t)},l.handleApplicationData=function(e,t){e.data.putBuffer(t.fragment),e.dataReady(e),e.process()},l.handleHeartbeat=function(e,t){var r=t.fragment,i=r.getByte(),o=r.getInt16(),a=r.getBytes(o);if(i===l.HeartbeatMessageType.heartbeat_request){if(e.handshaking||o>a.length)return e.process();l.queue(e,l.createRecord(e,{type:l.ContentType.heartbeat,data:l.createHeartbeat(l.HeartbeatMessageType.heartbeat_response,a)})),l.flush(e)}else if(i===l.HeartbeatMessageType.heartbeat_response){if(a!==e.expectedHeartbeatPayload)return e.process();e.heartbeatReceived&&e.heartbeatReceived(e,n.util.createBuffer(a))}e.process()};var p=0,h=1,d=2,y=3,g=4,v=5,m=6,b=7,E=8,T=0,S=1,w=2,C=3,_=4,I=5,A=6,R=7,O=l.handleUnexpected,P=l.handleChangeCipherSpec,B=l.handleAlert,k=l.handleHandshake,N=l.handleApplicationData,U=l.handleHeartbeat,D=[];D[l.ConnectionEnd.client]=[[O,B,k,O,U],[O,B,k,O,U],[O,B,k,O,U],[O,B,k,O,U],[O,B,k,O,U],[P,B,O,O,U],[O,B,k,O,U],[O,B,k,N,U],[O,B,k,O,U]],D[l.ConnectionEnd.server]=[[O,B,k,O,U],[O,B,k,O,U],[O,B,k,O,U],[O,B,k,O,U],[P,B,O,O,U],[O,B,k,O,U],[O,B,k,N,U],[O,B,k,O,U]];var x=l.handleHelloRequest,L=l.handleServerHello,j=l.handleCertificate,M=l.handleServerKeyExchange,V=l.handleCertificateRequest,F=l.handleServerHelloDone,K=l.handleFinished,H=[];H[l.ConnectionEnd.client]=[[O,O,L,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O],[x,O,O,O,O,O,O,O,O,O,O,j,M,V,F,O,O,O,O,O,O],[x,O,O,O,O,O,O,O,O,O,O,O,M,V,F,O,O,O,O,O,O],[x,O,O,O,O,O,O,O,O,O,O,O,O,V,F,O,O,O,O,O,O],[x,O,O,O,O,O,O,O,O,O,O,O,O,O,F,O,O,O,O,O,O],[x,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O],[x,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,K],[x,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O],[x,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O]];var q=l.handleClientHello,G=l.handleClientKeyExchange,z=l.handleCertificateVerify;H[l.ConnectionEnd.server]=[[O,q,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O],[O,O,O,O,O,O,O,O,O,O,O,j,O,O,O,O,O,O,O,O,O],[O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,G,O,O,O,O],[O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,z,O,O,O,O,O],[O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O],[O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,K],[O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O],[O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O]],l.generateKeys=function(e,t){var r=i,n=t.client_random+t.server_random;e.session.resuming||(t.master_secret=r(t.pre_master_secret,"master secret",n,48).bytes(),t.pre_master_secret=null),n=t.server_random+t.client_random;var o=2*t.mac_key_length+2*t.enc_key_length,a=e.version.major===l.Versions.TLS_1_0.major&&e.version.minor===l.Versions.TLS_1_0.minor;a&&(o+=2*t.fixed_iv_length);var s=r(t.master_secret,"key expansion",n,o),u={client_write_MAC_key:s.getBytes(t.mac_key_length),server_write_MAC_key:s.getBytes(t.mac_key_length),client_write_key:s.getBytes(t.enc_key_length),server_write_key:s.getBytes(t.enc_key_length)};return a&&(u.client_write_IV=s.getBytes(t.fixed_iv_length),u.server_write_IV=s.getBytes(t.fixed_iv_length)),u},l.createConnectionState=function(e){var t=e.entity===l.ConnectionEnd.client,r=function(){var e={sequenceNumber:[0,0],macKey:null,macLength:0,macFunction:null,cipherState:null,cipherFunction:function(e){return!0},compressionState:null,compressFunction:function(e){return!0},updateSequenceNumber:function(){4294967295===e.sequenceNumber[1]?(e.sequenceNumber[1]=0,++e.sequenceNumber[0]):++e.sequenceNumber[1]}};return e},n={read:r(),write:r()};if(n.read.update=function(e,t){return n.read.cipherFunction(t,n.read)?n.read.compressFunction(e,t,n.read)||e.error(e,{message:"Could not decompress record.",send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.decompression_failure}}):e.error(e,{message:"Could not decrypt record or bad MAC.",send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.bad_record_mac}}),!e.fail},n.write.update=function(e,t){return n.write.compressFunction(e,t,n.write)?n.write.cipherFunction(t,n.write)||e.error(e,{message:"Could not encrypt record.",send:!1,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.internal_error}}):e.error(e,{message:"Could not compress record.",send:!1,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.internal_error}}),!e.fail},e.session){var i=e.session.sp;switch(e.session.cipherSuite.initSecurityParameters(i),i.keys=l.generateKeys(e,i),n.read.macKey=t?i.keys.server_write_MAC_key:i.keys.client_write_MAC_key,n.write.macKey=t?i.keys.client_write_MAC_key:i.keys.server_write_MAC_key,e.session.cipherSuite.initConnectionState(n,e,i),i.compression_algorithm){case l.CompressionMethod.none:break;case l.CompressionMethod.deflate:n.read.compressFunction=u,n.write.compressFunction=s;break;default:throw new Error("Unsupported compression algorithm.")}}return n},l.createRandom=function(){var e=new Date,t=+e+6e4*e.getTimezoneOffset(),r=n.util.createBuffer();return r.putInt32(t),r.putBytes(n.random.getBytes(28)),r},l.createRecord=function(e,t){return t.data?{type:t.type,version:{major:e.version.major,minor:e.version.minor},length:t.data.length(),fragment:t.data}:null;var r},l.createAlert=function(e,t){var r=n.util.createBuffer();return r.putByte(t.level),r.putByte(t.description),l.createRecord(e,{type:l.ContentType.alert,data:r})},l.createClientHello=function(e){e.session.clientHelloVersion={major:e.version.major,minor:e.version.minor};for(var t=n.util.createBuffer(),r=0;r<e.cipherSuites.length;++r){var i=e.cipherSuites[r];t.putByte(i.id[0]),t.putByte(i.id[1])}var o=t.length(),a=n.util.createBuffer();a.putByte(l.CompressionMethod.none);var s=a.length(),u=n.util.createBuffer();if(e.virtualHost){var c=n.util.createBuffer();c.putByte(0),c.putByte(0);var p=n.util.createBuffer();p.putByte(0),f(p,2,n.util.createBuffer(e.virtualHost));var h=n.util.createBuffer();f(h,2,p),f(c,2,h),u.putBuffer(c)}var d=u.length();d>0&&(d+=2);var y=e.session.id,g=y.length+1+2+4+28+2+o+1+s+d,v=n.util.createBuffer();return v.putByte(l.HandshakeType.client_hello),v.putInt24(g),v.putByte(e.version.major),v.putByte(e.version.minor),v.putBytes(e.session.sp.client_random),f(v,1,n.util.createBuffer(y)),f(v,2,t),f(v,1,a),d>0&&f(v,2,u),v},l.createServerHello=function(e){var t=e.session.id,r=t.length+1+2+4+28+2+1,i=n.util.createBuffer();return i.putByte(l.HandshakeType.server_hello),i.putInt24(r),i.putByte(e.version.major),i.putByte(e.version.minor),i.putBytes(e.session.sp.server_random),f(i,1,n.util.createBuffer(t)),i.putByte(e.session.cipherSuite.id[0]),i.putByte(e.session.cipherSuite.id[1]),i.putByte(e.session.compressionMethod),i},l.createCertificate=function(e){var t=e.entity===l.ConnectionEnd.client,r=null,i;e.getCertificate&&(i=t?e.session.certificateRequest:e.session.extensions.server_name.serverNameList,r=e.getCertificate(e,i));var o=n.util.createBuffer();if(null!==r)try{n.util.isArray(r)||(r=[r]);for(var a=null,s=0;s<r.length;++s){var u=n.pem.decode(r[s])[0];if("CERTIFICATE"!==u.type&&"X509 CERTIFICATE"!==u.type&&"TRUSTED CERTIFICATE"!==u.type){var c=new Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".');throw c.headerType=u.type,c}if(u.procType&&"ENCRYPTED"===u.procType.type)throw new Error("Could not convert certificate from PEM; PEM is encrypted.");var p=n.util.createBuffer(u.body);null===a&&(a=n.asn1.fromDer(p.bytes(),!1));var h=n.util.createBuffer();f(h,3,p),o.putBuffer(h)}r=n.pki.certificateFromAsn1(a),t?e.session.clientCertificate=r:e.session.serverCertificate=r}catch(t){return e.error(e,{message:"Could not send certificate list.",cause:t,send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.bad_certificate}})}var d=3+o.length(),y=n.util.createBuffer();return y.putByte(l.HandshakeType.certificate),y.putInt24(d),f(y,3,o),y},l.createClientKeyExchange=function(e){var t=n.util.createBuffer();t.putByte(e.session.clientHelloVersion.major),t.putByte(e.session.clientHelloVersion.minor),t.putBytes(n.random.getBytes(46));var r=e.session.sp,i;r.pre_master_secret=t.getBytes();var o=(t=e.session.serverCertificate.publicKey.encrypt(r.pre_master_secret)).length+2,a=n.util.createBuffer();return a.putByte(l.HandshakeType.client_key_exchange),a.putInt24(o),a.putInt16(t.length),a.putBytes(t),a},l.createServerKeyExchange=function(e){var t=0,r=n.util.createBuffer();return r},l.getClientSignature=function(e,t){var r=n.util.createBuffer();r.putBuffer(e.session.md5.digest()),r.putBuffer(e.session.sha1.digest()),r=r.getBytes(),e.getSignature=e.getSignature||function(e,t,r){var i=null;if(e.getPrivateKey)try{i=e.getPrivateKey(e,e.session.clientCertificate),i=n.pki.privateKeyFromPem(i)}catch(t){e.error(e,{message:"Could not get private key.",cause:t,send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.internal_error}})}null===i?e.error(e,{message:"No private key set.",send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.internal_error}}):t=i.sign(t,null),r(e,t)},e.getSignature(e,r,t)},l.createCertificateVerify=function(e,t){var r=t.length+2,i=n.util.createBuffer();return i.putByte(l.HandshakeType.certificate_verify),i.putInt24(r),i.putInt16(t.length),i.putBytes(t),i},l.createCertificateRequest=function(e){var t=n.util.createBuffer();t.putByte(1);var r=n.util.createBuffer();for(var i in e.caStore.certs){var o=e.caStore.certs[i],a=n.pki.distinguishedNameToAsn1(o.subject),s=n.asn1.toDer(a);r.putInt16(s.length()),r.putBuffer(s)}var u=1+t.length()+2+r.length(),c=n.util.createBuffer();return c.putByte(l.HandshakeType.certificate_request),c.putInt24(u),f(c,1,t),f(c,2,r),c},l.createServerHelloDone=function(e){var t=n.util.createBuffer();return t.putByte(l.HandshakeType.server_hello_done),t.putInt24(0),t},l.createChangeCipherSpec=function(){var e=n.util.createBuffer();return e.putByte(1),e},l.createFinished=function(e){var t=n.util.createBuffer();t.putBuffer(e.session.md5.digest()),t.putBuffer(e.session.sha1.digest());var r=e.entity===l.ConnectionEnd.client,o=e.session.sp,a=12,s,u=r?"client finished":"server finished";t=i(o.master_secret,u,t.getBytes(),a);var c=n.util.createBuffer();return c.putByte(l.HandshakeType.finished),c.putInt24(t.length()),c.putBuffer(t),c},l.createHeartbeat=function(e,t,r){void 0===r&&(r=t.length);var i=n.util.createBuffer();i.putByte(e),i.putInt16(r),i.putBytes(t);var o=i.length(),a=Math.max(16,o-r-3);return i.putBytes(n.random.getBytes(a)),i},l.queue=function(e,t){if(t&&(0!==t.fragment.length()||t.type!==l.ContentType.handshake&&t.type!==l.ContentType.alert&&t.type!==l.ContentType.change_cipher_spec)){if(t.type===l.ContentType.handshake){var r=t.fragment.bytes();e.session.md5.update(r),e.session.sha1.update(r),r=null}var i;if(t.fragment.length()<=l.MaxFragment)i=[t];else{i=[];for(var o=t.fragment.bytes();o.length>l.MaxFragment;)i.push(l.createRecord(e,{type:t.type,data:n.util.createBuffer(o.slice(0,l.MaxFragment))})),o=o.slice(l.MaxFragment);o.length>0&&i.push(l.createRecord(e,{type:t.type,data:n.util.createBuffer(o)}))}for(var a=0;a<i.length&&!e.fail;++a){var s=i[a],u;e.state.current.write.update(e,s)&&e.records.push(s)}}},l.flush=function(e){for(var t=0;t<e.records.length;++t){var r=e.records[t];e.tlsData.putByte(r.type),e.tlsData.putByte(r.version.major),e.tlsData.putByte(r.version.minor),e.tlsData.putInt16(r.fragment.length()),e.tlsData.putBuffer(e.records[t].fragment)}return e.records=[],e.tlsDataReady(e)};var Y=function(e){switch(e){case!0:return!0;case n.pki.certificateError.bad_certificate:return l.Alert.Description.bad_certificate;case n.pki.certificateError.unsupported_certificate:return l.Alert.Description.unsupported_certificate;case n.pki.certificateError.certificate_revoked:return l.Alert.Description.certificate_revoked;case n.pki.certificateError.certificate_expired:return l.Alert.Description.certificate_expired;case n.pki.certificateError.certificate_unknown:return l.Alert.Description.certificate_unknown;case n.pki.certificateError.unknown_ca:return l.Alert.Description.unknown_ca;default:return l.Alert.Description.bad_certificate}},W=function(e){switch(e){case!0:return!0;case l.Alert.Description.bad_certificate:return n.pki.certificateError.bad_certificate;case l.Alert.Description.unsupported_certificate:return n.pki.certificateError.unsupported_certificate;case l.Alert.Description.certificate_revoked:return n.pki.certificateError.certificate_revoked;case l.Alert.Description.certificate_expired:return n.pki.certificateError.certificate_expired;case l.Alert.Description.certificate_unknown:return n.pki.certificateError.certificate_unknown;case l.Alert.Description.unknown_ca:return n.pki.certificateError.unknown_ca;default:return n.pki.certificateError.bad_certificate}};for(var Q in l.verifyCertificateChain=function(e,t){try{var r={};for(var i in e.verifyOptions)r[i]=e.verifyOptions[i];r.verify=function(t,r,i){var o=Y(t),a=e.verify(e,t,r,i);if(!0!==a){if("object"==typeof a&&!n.util.isArray(a)){var s=new Error("The application rejected the certificate.");throw s.send=!0,s.alert={level:l.Alert.Level.fatal,description:l.Alert.Description.bad_certificate},a.message&&(s.message=a.message),a.alert&&(s.alert.description=a.alert),s}a!==t&&(a=W(a))}return a},n.pki.verifyCertificateChain(e.caStore,t,r)}catch(t){var o=t;("object"!=typeof o||n.util.isArray(o))&&(o={send:!0,alert:{level:l.Alert.Level.fatal,description:Y(t)}}),"send"in o||(o.send=!0),"alert"in o||(o.alert={level:l.Alert.Level.fatal,description:Y(o.error)}),e.error(e,o)}return!e.fail},l.createSessionCache=function(e,t){var r=null;if(e&&e.getSession&&e.setSession&&e.order)r=e;else{for(var i in(r={}).cache=e||{},r.capacity=Math.max(t||100,1),r.order=[],e)r.order.length<=t?r.order.push(i):delete e[i];r.getSession=function(e){var t=null,i=null;if(e?i=n.util.bytesToHex(e):r.order.length>0&&(i=r.order[0]),null!==i&&i in r.cache)for(var o in t=r.cache[i],delete r.cache[i],r.order)if(r.order[o]===i){r.order.splice(o,1);break}return t},r.setSession=function(e,t){if(r.order.length===r.capacity){var i=r.order.shift();delete r.cache[i]}var i=n.util.bytesToHex(e);r.order.push(i),r.cache[i]=t}}return r},l.createConnection=function(e){var t=null;t=e.caStore?n.util.isArray(e.caStore)?n.pki.createCaStore(e.caStore):e.caStore:n.pki.createCaStore();var r=e.cipherSuites||null;if(null===r)for(var i in r=[],l.CipherSuites)r.push(l.CipherSuites[i]);var o=e.server?l.ConnectionEnd.server:l.ConnectionEnd.client,a=e.sessionCache?l.createSessionCache(e.sessionCache):null,s={version:{major:l.Version.major,minor:l.Version.minor},entity:o,sessionId:e.sessionId,caStore:t,sessionCache:a,cipherSuites:r,connected:e.connected,virtualHost:e.virtualHost||null,verifyClient:e.verifyClient||!1,verify:e.verify||function(e,t,r,n){return t},verifyOptions:e.verifyOptions||{},getCertificate:e.getCertificate||null,getPrivateKey:e.getPrivateKey||null,getSignature:e.getSignature||null,input:n.util.createBuffer(),tlsData:n.util.createBuffer(),data:n.util.createBuffer(),tlsDataReady:e.tlsDataReady,dataReady:e.dataReady,heartbeatReceived:e.heartbeatReceived,closed:e.closed,error:function(t,r){r.origin=r.origin||(t.entity===l.ConnectionEnd.client?"client":"server"),r.send&&(l.queue(t,l.createAlert(t,r.alert)),l.flush(t));var n=!1!==r.fatal;n&&(t.fail=!0),e.error(t,r),n&&t.close(!1)},deflate:e.deflate||null,inflate:e.inflate||null,reset:function(e){s.version={major:l.Version.major,minor:l.Version.minor},s.record=null,s.session=null,s.peerCertificate=null,s.state={pending:null,current:null},s.expect=(s.entity,l.ConnectionEnd.client,0),s.fragmented=null,s.records=[],s.open=!1,s.handshakes=0,s.handshaking=!1,s.isConnected=!1,s.fail=!(e||void 0===e),s.input.clear(),s.tlsData.clear(),s.data.clear(),s.state.current=l.createConnectionState(s)}};s.reset();var u=function(e,t){var r=t.type-l.ContentType.change_cipher_spec,n=D[e.entity][e.expect];r in n?n[r](e,t):l.handleUnexpected(e,t)},c=function(e){var t=0,r=e.input,i=r.length();if(i<5)t=5-i;else{e.record={type:r.getByte(),version:{major:r.getByte(),minor:r.getByte()},length:r.getInt16(),fragment:n.util.createBuffer(),ready:!1};var o=e.record.version.major===e.version.major;o&&e.session&&e.session.version&&(o=e.record.version.minor===e.version.minor),o||e.error(e,{message:"Incompatible TLS version.",send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.protocol_version}})}return t},f=function(e){var t=0,r=e.input,n=r.length(),i;n<e.record.length?t=e.record.length-n:(e.record.fragment.putBytes(r.getBytes(e.record.length)),r.compact(),e.state.current.read.update(e,e.record)&&(null!==e.fragmented&&(e.fragmented.type===e.record.type?(e.fragmented.fragment.putBuffer(e.record.fragment),e.record=e.fragmented):e.error(e,{message:"Invalid fragmented record.",send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.unexpected_message}})),e.record.ready=!0));return t};return s.handshake=function(e){if(s.entity!==l.ConnectionEnd.client)s.error(s,{message:"Cannot initiate handshake as a server.",fatal:!1});else if(s.handshaking)s.error(s,{message:"Handshake already in progress.",fatal:!1});else{s.fail&&!s.open&&0===s.handshakes&&(s.fail=!1),s.handshaking=!0;var t=null;(e=e||"").length>0&&(s.sessionCache&&(t=s.sessionCache.getSession(e)),null===t&&(e="")),0===e.length&&s.sessionCache&&null!==(t=s.sessionCache.getSession())&&(e=t.id),s.session={id:e,version:null,cipherSuite:null,compressionMethod:null,serverCertificate:null,certificateRequest:null,clientCertificate:null,sp:{},md5:n.md.md5.create(),sha1:n.md.sha1.create()},t&&(s.version=t.version,s.session.sp=t.sp),s.session.sp.client_random=l.createRandom().getBytes(),s.open=!0,l.queue(s,l.createRecord(s,{type:l.ContentType.handshake,data:l.createClientHello(s)})),l.flush(s)}},s.process=function(e){var t=0;return e&&s.input.putBytes(e),s.fail||(null!==s.record&&s.record.ready&&s.record.fragment.isEmpty()&&(s.record=null),null===s.record&&(t=c(s)),s.fail||null===s.record||s.record.ready||(t=f(s)),!s.fail&&null!==s.record&&s.record.ready&&u(s,s.record)),t},s.prepare=function(e){return l.queue(s,l.createRecord(s,{type:l.ContentType.application_data,data:n.util.createBuffer(e)})),l.flush(s)},s.prepareHeartbeatRequest=function(e,t){return e instanceof n.util.ByteBuffer&&(e=e.bytes()),void 0===t&&(t=e.length),s.expectedHeartbeatPayload=e,l.queue(s,l.createRecord(s,{type:l.ContentType.heartbeat,data:l.createHeartbeat(l.HeartbeatMessageType.heartbeat_request,e,t)})),l.flush(s)},s.close=function(e){if(!s.fail&&s.sessionCache&&s.session){var t={id:s.session.id,version:s.session.version,sp:s.session.sp};t.sp.keys=null,s.sessionCache.setSession(t.id,t)}s.open&&(s.open=!1,s.input.clear(),(s.isConnected||s.handshaking)&&(s.isConnected=s.handshaking=!1,l.queue(s,l.createAlert(s,{level:l.Alert.Level.warning,description:l.Alert.Description.close_notify})),l.flush(s)),s.closed(s)),s.reset(e)},s},e.exports=n.tls=n.tls||{},l)"function"!=typeof l[Q]&&(n.tls[Q]=l[Q]);n.tls.prf_tls1=i,n.tls.hmac_sha1=a,n.tls.createSessionCache=l.createSessionCache,n.tls.createConnection=l.createConnection},function(e,t,r){var n=r(4);r(33),r(49),r(138),r(51),r(120),r(144),r(123),r(76),r(8),r(122);var i=n.asn1,o=e.exports=n.pki=n.pki||{};o.pemToDer=function(e){var t=n.pem.decode(e)[0];if(t.procType&&"ENCRYPTED"===t.procType.type)throw new Error("Could not convert PEM to DER; PEM is encrypted.");return n.util.createBuffer(t.body)},o.privateKeyFromPem=function(e){var t=n.pem.decode(e)[0];if("PRIVATE KEY"!==t.type&&"RSA PRIVATE KEY"!==t.type){var r=new Error('Could not convert private key from PEM; PEM header type is not "PRIVATE KEY" or "RSA PRIVATE KEY".');throw r.headerType=t.type,r}if(t.procType&&"ENCRYPTED"===t.procType.type)throw new Error("Could not convert private key from PEM; PEM is encrypted.");var a=i.fromDer(t.body);return o.privateKeyFromAsn1(a)},o.privateKeyToPem=function(e,t){var r={type:"RSA PRIVATE KEY",body:i.toDer(o.privateKeyToAsn1(e)).getBytes()};return n.pem.encode(r,{maxline:t})},o.privateKeyInfoToPem=function(e,t){var r={type:"PRIVATE KEY",body:i.toDer(e).getBytes()};return n.pem.encode(r,{maxline:t})}},function(e,t,r){var n=r(4);if(r(48),r(33),r(75),r(37),r(49),r(120),r(51),r(31),r(141),r(76),r(8),void 0===i)var i=n.jsbn.BigInteger;var o=n.asn1,a=n.pki=n.pki||{};e.exports=a.pbe=n.pbe=n.pbe||{};var s=a.oids,u={name:"EncryptedPrivateKeyInfo",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:o.Class.UNIVERSAL,type:o.Type.OID,constructed:!1,capture:"encryptionOid"},{name:"AlgorithmIdentifier.parameters",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,captureAsn1:"encryptionParams"}]},{name:"EncryptedPrivateKeyInfo.encryptedData",tagClass:o.Class.UNIVERSAL,type:o.Type.OCTETSTRING,constructed:!1,capture:"encryptedData"}]},c={name:"PBES2Algorithms",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",tagClass:o.Class.UNIVERSAL,type:o.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:o.Class.UNIVERSAL,type:o.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"kdfIterationCount"},{name:"PBES2Algorithms.params.keyLength",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,optional:!0,capture:"keyLength"},{name:"PBES2Algorithms.params.prf",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:"PBES2Algorithms.params.prf.algorithm",tagClass:o.Class.UNIVERSAL,type:o.Type.OID,constructed:!1,capture:"prfOid"}]}]}]},{name:"PBES2Algorithms.encryptionScheme",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:o.Class.UNIVERSAL,type:o.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:o.Class.UNIVERSAL,type:o.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},f={name:"pkcs-12PbeParams",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:o.Class.UNIVERSAL,type:o.Type.OCTETSTRING,constructed:!1,capture:"salt"},{name:"pkcs-12PbeParams.iterations",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"iterations"}]};function l(e,t){return e.start().update(t).digest().getBytes()}function p(e){var t;if(e){if(!(t=a.oids[o.derToOid(e)])){var r=new Error("Unsupported PRF OID.");throw r.oid=e,r.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],r}}else t="hmacWithSHA1";return h(t)}function h(e){var t=n.md;switch(e){case"hmacWithSHA224":t=n.md.sha512;case"hmacWithSHA1":case"hmacWithSHA256":case"hmacWithSHA384":case"hmacWithSHA512":e=e.substr(8).toLowerCase();break;default:var r=new Error("Unsupported PRF algorithm.");throw r.algorithm=e,r.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],r}if(!t||!(e in t))throw new Error("Unknown hash algorithm: "+e);return t[e].create()}function d(e,t,r,i){var s=o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OCTETSTRING,!1,e),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,t.getBytes())]);return"hmacWithSHA1"!==i&&s.value.push(o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,n.util.hexToBytes(r.toString(16))),o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OID,!1,o.oidToDer(a.oids[i]).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.NULL,!1,"")])),s}a.encryptPrivateKeyInfo=function(e,t,r){(r=r||{}).saltSize=r.saltSize||8,r.count=r.count||2048,r.algorithm=r.algorithm||"aes128",r.prfAlgorithm=r.prfAlgorithm||"sha1";var i=n.random.getBytesSync(r.saltSize),u=r.count,c=o.integerToDer(u),f,l,p,y;if(0===r.algorithm.indexOf("aes")||"des"===r.algorithm){var g,v,m;switch(r.algorithm){case"aes128":f=16,g=16,v=s["aes128-CBC"],m=n.aes.createEncryptionCipher;break;case"aes192":f=24,g=16,v=s["aes192-CBC"],m=n.aes.createEncryptionCipher;break;case"aes256":f=32,g=16,v=s["aes256-CBC"],m=n.aes.createEncryptionCipher;break;case"des":f=8,g=8,v=s.desCBC,m=n.des.createEncryptionCipher;break;default:var b;throw(b=new Error("Cannot encrypt private key. Unknown encryption algorithm.")).algorithm=r.algorithm,b}var E="hmacWith"+r.prfAlgorithm.toUpperCase(),T=h(E),S=n.pkcs5.pbkdf2(t,i,u,f,T),w=n.random.getBytesSync(g),C;(C=m(S)).start(w),C.update(o.toDer(e)),C.finish(),p=C.output.getBytes();var _=d(i,c,f,E);l=o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OID,!1,o.oidToDer(s.pkcs5PBES2).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OID,!1,o.oidToDer(s.pkcs5PBKDF2).getBytes()),_]),o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OID,!1,o.oidToDer(v).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.OCTETSTRING,!1,w)])])])}else{var b;if("3des"!==r.algorithm)throw(b=new Error("Cannot encrypt private key. Unknown encryption algorithm.")).algorithm=r.algorithm,b;f=24;var I=new n.util.ByteBuffer(i),S=a.pbe.generatePkcs12Key(t,I,1,u,f),w=a.pbe.generatePkcs12Key(t,I,2,u,f),C;(C=n.des.createEncryptionCipher(S)).start(w),C.update(o.toDer(e)),C.finish(),p=C.output.getBytes(),l=o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OID,!1,o.oidToDer(s["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OCTETSTRING,!1,i),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,c.getBytes())])])}return o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[l,o.create(o.Class.UNIVERSAL,o.Type.OCTETSTRING,!1,p)])},a.decryptPrivateKeyInfo=function(e,t){var r=null,i={},s=[];if(!o.validate(e,u,i,s)){var c=new Error("Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw c.errors=s,c}var f=o.derToOid(i.encryptionOid),l=a.pbe.getCipher(f,i.encryptionParams,t),p=n.util.createBuffer(i.encryptedData);return l.update(p),l.finish()&&(r=o.fromDer(l.output)),r},a.encryptedPrivateKeyToPem=function(e,t){var r={type:"ENCRYPTED PRIVATE KEY",body:o.toDer(e).getBytes()};return n.pem.encode(r,{maxline:t})},a.encryptedPrivateKeyFromPem=function(e){var t=n.pem.decode(e)[0];if("ENCRYPTED PRIVATE KEY"!==t.type){var r=new Error('Could not convert encrypted private key from PEM; PEM header type is "ENCRYPTED PRIVATE KEY".');throw r.headerType=t.type,r}if(t.procType&&"ENCRYPTED"===t.procType.type)throw new Error("Could not convert encrypted private key from PEM; PEM is encrypted.");return o.fromDer(t.body)},a.encryptRsaPrivateKey=function(e,t,r){if(!(r=r||{}).legacy){var i=a.wrapRsaPrivateKey(a.privateKeyToAsn1(e));return i=a.encryptPrivateKeyInfo(i,t,r),a.encryptedPrivateKeyToPem(i)}var s,u,c,f;switch(r.algorithm){case"aes128":s="AES-128-CBC",c=16,u=n.random.getBytesSync(16),f=n.aes.createEncryptionCipher;break;case"aes192":s="AES-192-CBC",c=24,u=n.random.getBytesSync(16),f=n.aes.createEncryptionCipher;break;case"aes256":s="AES-256-CBC",c=32,u=n.random.getBytesSync(16),f=n.aes.createEncryptionCipher;break;case"3des":s="DES-EDE3-CBC",c=24,u=n.random.getBytesSync(8),f=n.des.createEncryptionCipher;break;case"des":s="DES-CBC",c=8,u=n.random.getBytesSync(8),f=n.des.createEncryptionCipher;break;default:var l=new Error('Could not encrypt RSA private key; unsupported encryption algorithm "'+r.algorithm+'".');throw l.algorithm=r.algorithm,l}var p,h=f(n.pbe.opensslDeriveBytes(t,u.substr(0,8),c));h.start(u),h.update(o.toDer(a.privateKeyToAsn1(e))),h.finish();var d={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:s,parameters:n.util.bytesToHex(u).toUpperCase()},body:h.output.getBytes()};return n.pem.encode(d)},a.decryptRsaPrivateKey=function(e,t){var r=null,i=n.pem.decode(e)[0],s;if("ENCRYPTED PRIVATE KEY"!==i.type&&"PRIVATE KEY"!==i.type&&"RSA PRIVATE KEY"!==i.type)throw(s=new Error('Could not convert private key from PEM; PEM header type is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".')).headerType=s,s;if(i.procType&&"ENCRYPTED"===i.procType.type){var u,c;switch(i.dekInfo.algorithm){case"DES-CBC":u=8,c=n.des.createDecryptionCipher;break;case"DES-EDE3-CBC":u=24,c=n.des.createDecryptionCipher;break;case"AES-128-CBC":u=16,c=n.aes.createDecryptionCipher;break;case"AES-192-CBC":u=24,c=n.aes.createDecryptionCipher;break;case"AES-256-CBC":u=32,c=n.aes.createDecryptionCipher;break;case"RC2-40-CBC":u=5,c=function(e){return n.rc2.createDecryptionCipher(e,40)};break;case"RC2-64-CBC":u=8,c=function(e){return n.rc2.createDecryptionCipher(e,64)};break;case"RC2-128-CBC":u=16,c=function(e){return n.rc2.createDecryptionCipher(e,128)};break;default:var s;throw(s=new Error('Could not decrypt private key; unsupported encryption algorithm "'+i.dekInfo.algorithm+'".')).algorithm=i.dekInfo.algorithm,s}var f=n.util.hexToBytes(i.dekInfo.parameters),l,p=c(n.pbe.opensslDeriveBytes(t,f.substr(0,8),u));if(p.start(f),p.update(n.util.createBuffer(i.body)),!p.finish())return r;r=p.output.getBytes()}else r=i.body;return null!==(r="ENCRYPTED PRIVATE KEY"===i.type?a.decryptPrivateKeyInfo(o.fromDer(r),t):o.fromDer(r))&&(r=a.privateKeyFromAsn1(r)),r},a.pbe.generatePkcs12Key=function(e,t,r,i,o,a){var s,u;if(null==a){if(!("sha1"in n.md))throw new Error('"sha1" hash algorithm unavailable.');a=n.md.sha1.create()}var c=a.digestLength,f=a.blockLength,l=new n.util.ByteBuffer,p=new n.util.ByteBuffer;if(null!=e){for(u=0;u<e.length;u++)p.putInt16(e.charCodeAt(u));p.putInt16(0)}var h=p.length(),d=t.length(),y=new n.util.ByteBuffer;y.fillWithByte(r,f);var g=f*Math.ceil(d/f),v=new n.util.ByteBuffer;for(u=0;u<g;u++)v.putByte(t.at(u%d));var m=f*Math.ceil(h/f),b=new n.util.ByteBuffer;for(u=0;u<m;u++)b.putByte(p.at(u%h));var E=v;E.putBuffer(b);for(var T=Math.ceil(o/c),S=1;S<=T;S++){var w=new n.util.ByteBuffer;w.putBytes(y.bytes()),w.putBytes(E.bytes());for(var C=0;C<i;C++)a.start(),a.update(w.getBytes()),w=a.digest();var _=new n.util.ByteBuffer;for(u=0;u<f;u++)_.putByte(w.at(u%c));var I=Math.ceil(d/f)+Math.ceil(h/f),A=new n.util.ByteBuffer;for(s=0;s<I;s++){var R=new n.util.ByteBuffer(E.getBytes(f)),O=511;for(u=_.length()-1;u>=0;u--)O>>=8,O+=_.at(u)+R.at(u),R.setAt(u,255&O);A.putBuffer(R)}E=A,l.putBuffer(w)}return l.truncate(l.length()-o),l},a.pbe.getCipher=function(e,t,r){switch(e){case a.oids.pkcs5PBES2:return a.pbe.getCipherForPBES2(e,t,r);case a.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case a.oids["pbewithSHAAnd40BitRC2-CBC"]:return a.pbe.getCipherForPKCS12PBE(e,t,r);default:var n=new Error("Cannot read encrypted PBE data block. Unsupported OID.");throw n.oid=e,n.supportedOids=["pkcs5PBES2","pbeWithSHAAnd3-KeyTripleDES-CBC","pbewithSHAAnd40BitRC2-CBC"],n}},a.pbe.getCipherForPBES2=function(e,t,r){var i={},s=[],u,u,u;if(!o.validate(t,c,i,s))throw(u=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.")).errors=s,u;if((e=o.derToOid(i.kdfOid))!==a.oids.pkcs5PBKDF2)throw(u=new Error("Cannot read encrypted private key. Unsupported key derivation function OID.")).oid=e,u.supportedOids=["pkcs5PBKDF2"],u;if((e=o.derToOid(i.encOid))!==a.oids["aes128-CBC"]&&e!==a.oids["aes192-CBC"]&&e!==a.oids["aes256-CBC"]&&e!==a.oids["des-EDE3-CBC"]&&e!==a.oids.desCBC)throw(u=new Error("Cannot read encrypted private key. Unsupported encryption scheme OID.")).oid=e,u.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],u;var f=i.kdfSalt,l=n.util.createBuffer(i.kdfIterationCount),h,d;switch(l=l.getInt(l.length()<<3),a.oids[e]){case"aes128-CBC":h=16,d=n.aes.createDecryptionCipher;break;case"aes192-CBC":h=24,d=n.aes.createDecryptionCipher;break;case"aes256-CBC":h=32,d=n.aes.createDecryptionCipher;break;case"des-EDE3-CBC":h=24,d=n.des.createDecryptionCipher;break;case"desCBC":h=8,d=n.des.createDecryptionCipher}var y=p(i.prfOid),g=n.pkcs5.pbkdf2(r,f,l,h,y),v=i.encIv,m=d(g);return m.start(v),m},a.pbe.getCipherForPKCS12PBE=function(e,t,r){var i={},s=[],u;if(!o.validate(t,f,i,s))throw(u=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.")).errors=s,u;var c=n.util.createBuffer(i.salt),l=n.util.createBuffer(i.iterations),h,d,y;switch(l=l.getInt(l.length()<<3),e){case a.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:h=24,d=8,y=n.des.startDecrypting;break;case a.oids["pbewithSHAAnd40BitRC2-CBC"]:h=5,d=8,y=function(e,t){var r=n.rc2.createDecryptionCipher(e,40);return r.start(t,null),r};break;default:var u;throw(u=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.")).oid=e,u}var g=p(i.prfOid),v=a.pbe.generatePkcs12Key(r,c,1,l,h,g),m;return g.start(),y(v,a.pbe.generatePkcs12Key(r,c,2,l,d,g))},a.pbe.opensslDeriveBytes=function(e,t,r,i){if(null==i){if(!("md5"in n.md))throw new Error('"md5" hash algorithm unavailable.');i=n.md.md5.create()}null===t&&(t="");for(var o=[l(i,e+t)],a=16,s=1;a<r;++s,a+=16)o.push(l(i,o[s-1]+e+t));return o.join("").substr(0,r)}},function(e,t,r){var n=r(4);r(37),r(8);var i=e.exports=n.sha256=n.sha256||{};n.md.sha256=n.md.algorithms.sha256=i,i.create=function(){a||u();var e=null,t=n.util.createBuffer(),r=new Array(64),i={algorithm:"sha256",blockLength:64,digestLength:32,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){i.messageLength=0,i.fullMessageLength=i.messageLength64=[];for(var r=i.messageLengthSize/4,o=0;o<r;++o)i.fullMessageLength.push(0);return t=n.util.createBuffer(),e={h0:1779033703,h1:3144134277,h2:1013904242,h3:2773480762,h4:1359893119,h5:2600822924,h6:528734635,h7:1541459225},i}};return i.start(),i.update=function(o,a){"utf8"===a&&(o=n.util.encodeUtf8(o));var s=o.length;i.messageLength+=s,s=[s/4294967296>>>0,s>>>0];for(var u=i.fullMessageLength.length-1;u>=0;--u)i.fullMessageLength[u]+=s[1],s[1]=s[0]+(i.fullMessageLength[u]/4294967296>>>0),i.fullMessageLength[u]=i.fullMessageLength[u]>>>0,s[0]=s[1]/4294967296>>>0;return t.putBytes(o),c(e,r,t),(t.read>2048||0===t.length())&&t.compact(),i},i.digest=function(){var a=n.util.createBuffer();a.putBytes(t.bytes());var s,u=i.fullMessageLength[i.fullMessageLength.length-1]+i.messageLengthSize&i.blockLength-1,f,l;a.putBytes(o.substr(0,i.blockLength-u));for(var p=8*i.fullMessageLength[0],h=0;h<i.fullMessageLength.length-1;++h)p+=l=(f=8*i.fullMessageLength[h+1])/4294967296>>>0,a.putInt32(p>>>0),p=f>>>0;a.putInt32(p);var d={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4,h5:e.h5,h6:e.h6,h7:e.h7};c(d,r,a);var y=n.util.createBuffer();return y.putInt32(d.h0),y.putInt32(d.h1),y.putInt32(d.h2),y.putInt32(d.h3),y.putInt32(d.h4),y.putInt32(d.h5),y.putInt32(d.h6),y.putInt32(d.h7),y},i};var o=null,a=!1,s=null;function u(){o=String.fromCharCode(128),o+=n.util.fillString(String.fromCharCode(0),64),s=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],a=!0}function c(e,t,r){for(var n,i,o,a,u,c,f,l,p,h,d,y,g,v,m,b=r.length();b>=64;){for(f=0;f<16;++f)t[f]=r.getInt32();for(;f<64;++f)n=((n=t[f-2])>>>17|n<<15)^(n>>>19|n<<13)^n>>>10,i=((i=t[f-15])>>>7|i<<25)^(i>>>18|i<<14)^i>>>3,t[f]=n+t[f-7]+i+t[f-16]|0;for(l=e.h0,p=e.h1,h=e.h2,d=e.h3,y=e.h4,g=e.h5,v=e.h6,m=e.h7,f=0;f<64;++f)o=(l>>>2|l<<30)^(l>>>13|l<<19)^(l>>>22|l<<10),c=l&p|h&(l^p),n=m+(a=(y>>>6|y<<26)^(y>>>11|y<<21)^(y>>>25|y<<7))+(u=v^y&(g^v))+s[f]+t[f],m=v,v=g,g=y,y=d+n>>>0,d=h,h=p,p=l,l=n+(i=o+c)>>>0;e.h0=e.h0+l|0,e.h1=e.h1+p|0,e.h2=e.h2+h|0,e.h3=e.h3+d|0,e.h4=e.h4+y|0,e.h5=e.h5+g|0,e.h6=e.h6+v|0,e.h7=e.h7+m|0,b-=64}}},function(e,t,r){(function(t){var n=r(4);r(8);var i=null,o;!n.util.isNodejs||n.options.usePureJavaScript||t.versions["node-webkit"]||(i=r(121)),(e.exports=n.prng=n.prng||{}).create=function(e){for(var t={plugin:e,key:null,seed:null,time:null,reseeds:0,generated:0,keyBytes:""},r=e.md,o=new Array(32),a=0;a<32;++a)o[a]=r.create();function s(e){if(t.pools[0].messageLength>=32)return c(),e();var r=32-t.pools[0].messageLength<<5;t.seedFile(r,function(r,n){if(r)return e(r);t.collect(n),c(),e()})}function u(){if(t.pools[0].messageLength>=32)return c();var e=32-t.pools[0].messageLength<<5;t.collect(t.seedFileSync(e)),c()}function c(){t.reseeds=4294967295===t.reseeds?0:t.reseeds+1;var e=t.plugin.md.create();e.update(t.keyBytes);for(var r=1,n=0;n<32;++n)t.reseeds%r===0&&(e.update(t.pools[n].digest().getBytes()),t.pools[n].start()),r<<=1;t.keyBytes=e.digest().getBytes(),e.start(),e.update(t.keyBytes);var i=e.digest().getBytes();t.key=t.plugin.formatKey(t.keyBytes),t.seed=t.plugin.formatSeed(i),t.generated=0}function f(e){var t=null,r=n.util.globalScope,i=r.crypto||r.msCrypto;i&&i.getRandomValues&&(t=function(e){return i.getRandomValues(e)});var o=n.util.createBuffer();if(t)for(;o.length()<e;){var a=Math.max(1,Math.min(e-o.length(),65536)/4),s=new Uint32Array(Math.floor(a));try{t(s);for(var u=0;u<s.length;++u)o.putInt32(s[u])}catch(e){if(!("undefined"!=typeof QuotaExceededError&&e instanceof QuotaExceededError))throw e}}if(o.length()<e)for(var c,f,l,p=Math.floor(65536*Math.random());o.length()<e;){f=16807*(65535&p),f+=(32767&(c=16807*(p>>16)))<<16,p=4294967295&(f=(2147483647&(f+=c>>15))+(f>>31));for(var u=0;u<3;++u)l=p>>>(u<<3),l^=Math.floor(256*Math.random()),o.putByte(String.fromCharCode(255&l))}return o.getBytes(e)}return t.pools=o,t.pool=0,t.generate=function(e,r){if(!r)return t.generateSync(e);var i=t.plugin.cipher,o=t.plugin.increment,a=t.plugin.formatKey,u=t.plugin.formatSeed,c=n.util.createBuffer();function f(l){if(l)return r(l);if(c.length()>=e)return r(null,c.getBytes(e));if(t.generated>1048575&&(t.key=null),null===t.key)return n.util.nextTick(function(){s(f)});var p=i(t.key,t.seed);t.generated+=p.length,c.putBytes(p),t.key=a(i(t.key,o(t.seed))),t.seed=u(i(t.key,t.seed)),n.util.setImmediate(f)}t.key=null,f()},t.generateSync=function(e){var r=t.plugin.cipher,i=t.plugin.increment,o=t.plugin.formatKey,a=t.plugin.formatSeed;t.key=null;for(var s=n.util.createBuffer();s.length()<e;){t.generated>1048575&&(t.key=null),null===t.key&&u();var c=r(t.key,t.seed);t.generated+=c.length,s.putBytes(c),t.key=o(r(t.key,i(t.seed))),t.seed=a(r(t.key,t.seed))}return s.getBytes(e)},i?(t.seedFile=function(e,t){i.randomBytes(e,function(e,r){if(e)return t(e);t(null,r.toString())})},t.seedFileSync=function(e){return i.randomBytes(e).toString()}):(t.seedFile=function(e,t){try{t(null,f(e))}catch(e){t(e)}},t.seedFileSync=f),t.collect=function(e){for(var r=e.length,n=0;n<r;++n)t.pools[t.pool].update(e.substr(n,1)),t.pool=31===t.pool?0:t.pool+1},t.collectInt=function(e,r){for(var n="",i=0;i<r;i+=8)n+=String.fromCharCode(e>>i&255);t.collect(n)},t.registerWorker=function(e){if(e===self)t.seedFile=function(e,t){function r(e){var n=e.data;n.forge&&n.forge.prng&&(self.removeEventListener("message",r),t(n.forge.prng.err,n.forge.prng.bytes))}self.addEventListener("message",r),self.postMessage({forge:{prng:{needed:e}}})};else{var r=function(r){var n=r.data;n.forge&&n.forge.prng&&t.seedFile(n.forge.prng.needed,function(t,r){e.postMessage({forge:{prng:{err:t,bytes:r}}})})};e.addEventListener("message",r)}},t}}).call(this,r(36))},function(e,t,r){var n=r(4);r(8);var i=[217,120,249,196,25,221,181,237,40,233,253,121,74,160,216,157,198,126,55,131,43,118,83,142,98,76,100,136,68,139,251,162,23,154,89,245,135,179,79,19,97,69,109,141,9,129,125,50,189,143,64,235,134,183,123,11,240,149,33,34,92,107,78,130,84,214,101,147,206,96,178,28,115,86,192,20,167,140,241,220,18,117,202,31,59,190,228,209,66,61,212,48,163,60,182,38,111,191,14,218,70,105,7,87,39,242,29,155,188,148,67,3,248,17,199,246,144,239,62,231,6,195,213,47,200,102,30,215,8,232,234,222,128,82,238,247,132,170,114,172,53,77,106,42,150,26,210,113,90,21,73,116,75,159,208,94,4,24,164,236,194,224,65,110,15,81,203,204,36,145,175,80,161,244,112,57,153,124,58,133,35,184,180,122,252,2,54,91,37,85,151,49,45,93,250,152,227,138,146,174,5,223,41,16,103,108,186,201,211,0,230,207,225,158,168,44,99,22,1,63,88,226,137,169,13,56,52,27,171,51,255,176,187,72,12,95,185,177,205,46,197,243,219,71,229,165,156,119,10,166,32,104,254,127,193,173],o=[1,2,3,5],a=function(e,t){return e<<t&65535|(65535&e)>>16-t},s=function(e,t){return(65535&e)>>t|e<<16-t&65535};e.exports=n.rc2=n.rc2||{},n.rc2.expandKey=function(e,t){"string"==typeof e&&(e=n.util.createBuffer(e)),t=t||128;var r=e,o=e.length(),a=t,s=Math.ceil(a/8),u=255>>(7&a),c;for(c=o;c<128;c++)r.putByte(i[r.at(c-1)+r.at(c-o)&255]);for(r.setAt(128-s,i[r.at(128-s)&u]),c=127-s;c>=0;c--)r.setAt(c,i[r.at(c+1)^r.at(c+s)]);return r};var u=function(e,t,r){var i=!1,u=null,c=null,f=null,l,p,h,d,y=[];for(e=n.rc2.expandKey(e,t),h=0;h<64;h++)y.push(e.getInt16Le());r?(l=function(e){for(h=0;h<4;h++)e[h]+=y[d]+(e[(h+3)%4]&e[(h+2)%4])+(~e[(h+3)%4]&e[(h+1)%4]),e[h]=a(e[h],o[h]),d++},p=function(e){for(h=0;h<4;h++)e[h]+=y[63&e[(h+3)%4]]}):(l=function(e){for(h=3;h>=0;h--)e[h]=s(e[h],o[h]),e[h]-=y[d]+(e[(h+3)%4]&e[(h+2)%4])+(~e[(h+3)%4]&e[(h+1)%4]),d--},p=function(e){for(h=3;h>=0;h--)e[h]-=y[63&e[(h+3)%4]]});var g=function(e){var t=[];for(h=0;h<4;h++){var n=u.getInt16Le();null!==f&&(r?n^=f.getInt16Le():f.putInt16Le(n)),t.push(65535&n)}d=r?0:63;for(var i=0;i<e.length;i++)for(var o=0;o<e[i][0];o++)e[i][1](t);for(h=0;h<4;h++)null!==f&&(r?f.putInt16Le(t[h]):t[h]^=f.getInt16Le()),c.putInt16Le(t[h])},v=null;return v={start:function(e,t){e&&"string"==typeof e&&(e=n.util.createBuffer(e)),i=!1,u=n.util.createBuffer(),c=t||new n.util.createBuffer,f=e,v.output=c},update:function(e){for(i||u.putBuffer(e);u.length()>=8;)g([[5,l],[1,p],[6,l],[1,p],[5,l]])},finish:function(e){var t=!0;if(r)if(e)t=e(8,u,!r);else{var n=8===u.length()?8:8-u.length();u.fillWithByte(n,n)}if(t&&(i=!0,v.update()),!r&&(t=0===u.length()))if(e)t=e(8,c,!r);else{var o=c.length(),a=c.at(o-1);a>o?t=!1:c.truncate(a)}return t}}};n.rc2.startEncrypting=function(e,t,r){var i=n.rc2.createEncryptionCipher(e,128);return i.start(t,r),i},n.rc2.createEncryptionCipher=function(e,t){return u(e,t,!0)},n.rc2.startDecrypting=function(e,t,r){var i=n.rc2.createDecryptionCipher(e,128);return i.start(t,r),i},n.rc2.createDecryptionCipher=function(e,t){return u(e,t,!1)}},function(e,t,r){var n=r(4);r(8),r(31),r(69);var i=e.exports=n.pkcs1=n.pkcs1||{};function o(e,t,r){r||(r=n.md.sha1.create());for(var i="",o=Math.ceil(t/r.digestLength),a=0;a<o;++a){var s=String.fromCharCode(a>>24&255,a>>16&255,a>>8&255,255&a);r.start(),r.update(e+s),i+=r.digest().getBytes()}return i.substring(0,t)}i.encode_rsa_oaep=function(e,t,r){var i,a,s,u;"string"==typeof r?(i=r,a=arguments[3]||void 0,s=arguments[4]||void 0):r&&(i=r.label||void 0,a=r.seed||void 0,s=r.md||void 0,r.mgf1&&r.mgf1.md&&(u=r.mgf1.md)),s?s.start():s=n.md.sha1.create(),u||(u=s);var c=Math.ceil(e.n.bitLength()/8),f=c-2*s.digestLength-2,l;if(t.length>f)throw(l=new Error("RSAES-OAEP input message length is too long.")).length=t.length,l.maxLength=f,l;i||(i=""),s.update(i,"raw");for(var p=s.digest(),h="",d=f-t.length,y=0;y<d;y++)h+="\0";var g=p.getBytes()+h+""+t;if(a){if(a.length!==s.digestLength){var l;throw(l=new Error("Invalid RSAES-OAEP seed. The seed length must match the digest length.")).seedLength=a.length,l.digestLength=s.digestLength,l}}else a=n.random.getBytes(s.digestLength);var v=o(a,c-s.digestLength-1,u),m=n.util.xorBytes(g,v,g.length),b=o(m,s.digestLength,u),E;return"\0"+n.util.xorBytes(a,b,a.length)+m},i.decode_rsa_oaep=function(e,t,r){var i,a,s;"string"==typeof r?(i=r,a=arguments[3]||void 0):r&&(i=r.label||void 0,a=r.md||void 0,r.mgf1&&r.mgf1.md&&(s=r.mgf1.md));var u=Math.ceil(e.n.bitLength()/8),c;if(t.length!==u)throw(c=new Error("RSAES-OAEP encoded message length is invalid.")).length=t.length,c.expectedLength=u,c;if(void 0===a?a=n.md.sha1.create():a.start(),s||(s=a),u<2*a.digestLength+2)throw new Error("RSAES-OAEP key is too short for the hash function.");i||(i=""),a.update(i,"raw");for(var f=a.digest().getBytes(),l=t.charAt(0),p=t.substring(1,a.digestLength+1),h=t.substring(1+a.digestLength),d=o(h,a.digestLength,s),y,g=o(n.util.xorBytes(p,d,p.length),u-a.digestLength-1,s),v=n.util.xorBytes(h,g,h.length),m=v.substring(0,a.digestLength),c="\0"!==l,b=0;b<a.digestLength;++b)c|=f.charAt(b)!==m.charAt(b);for(var E=1,T=a.digestLength,S=a.digestLength;S<v.length;S++){var w=v.charCodeAt(S),C,_;c|=w&(E?65534:0),T+=E&=1&w^1}if(c||1!==v.charCodeAt(T))throw new Error("Invalid RSAES-OAEP padding.");return v.substring(T+1)}},function(e,t,r){var n=r(4);r(8),r(77),r(31),function(){if(n.prime)e.exports=n.prime;else{var t=e.exports=n.prime=n.prime||{},r=n.jsbn.BigInteger,i=[6,4,2,4,2,4,6,2],o=new r(null);o.fromInt(30);var a=function(e,t){return e|t};t.generateProbablePrime=function(e,t,r){"function"==typeof t&&(r=t,t={});var i=(t=t||{}).algorithm||"PRIMEINC";"string"==typeof i&&(i={name:i}),i.options=i.options||{};var o=t.prng||n.random,a={nextBytes:function(e){for(var t=o.getBytesSync(e.length),r=0;r<e.length;++r)e[r]=t.charCodeAt(r)}};if("PRIMEINC"===i.name)return s(e,a,i.options,r);throw new Error("Invalid prime generation algorithm: "+i.name)}}function s(e,t,r,n){return"workers"in r?f(e,t,r,n):u(e,t,r,n)}function u(e,t,r,n){var i=l(e,t),o=0,a=p(i.bitLength());"millerRabinTests"in r&&(a=r.millerRabinTests);var s=10;"maxBlockTime"in r&&(s=r.maxBlockTime),c(i,e,t,0,a,s,n)}function c(e,t,r,o,a,s,u){var f=+new Date;do{if(e.bitLength()>t&&(e=l(t,r)),e.isProbablePrime(a))return u(null,e);e.dAddOffset(i[o++%8],0)}while(s<0||+new Date-f<s);n.util.setImmediate(function(){c(e,t,r,o,a,s,u)})}function f(e,t,i,o){if("undefined"==typeof Worker)return u(e,t,i,o);var a=l(e,t),s=i.workers,c=i.workLoad||100,f=30*c/8,p=i.workerScript||"forge/prime.worker.js";if(-1===s)return n.util.estimateCores(function(e,t){e&&(t=2),s=t-1,h()});function h(){s=Math.max(1,s);for(var n=[],i=0;i<s;++i)n[i]=new Worker(p);for(var u=s,i=0;i<s;++i)n[i].addEventListener("message",d);var h=!1;function d(i){if(!h){--u;var s=i.data;if(s.found){for(var p=0;p<n.length;++p)n[p].terminate();return h=!0,o(null,new r(s.prime,16))}a.bitLength()>e&&(a=l(e,t));var d=a.toString(16);i.target.postMessage({hex:d,workLoad:c}),a.dAddOffset(f,0)}}}h()}function l(e,t){var n=new r(e,t),i=e-1;return n.testBit(i)||n.bitwiseTo(r.ONE.shiftLeft(i),a,n),n.dAddOffset(31-n.mod(o).byteValue(),0),n}function p(e){return e<=100?27:e<=150?18:e<=200?15:e<=250?12:e<=300?9:e<=350?8:e<=400?7:e<=500?6:e<=600?5:e<=800?4:e<=1250?3:2}}()},function(e,t,r){var n=r(4);r(33),r(68),r(49),r(145),r(138),r(31),r(76),r(69),r(8),r(122);var i=n.asn1,o=n.pki,a=e.exports=n.pkcs12=n.pkcs12||{},s={name:"ContentInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.contentType",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:i.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"content"}]},u={name:"PFX",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"},s,{name:"PFX.macData",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"mac",value:[{name:"PFX.macData.mac",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"macAlgorithm"},{name:"PFX.macData.mac.digestAlgorithm.parameters",tagClass:i.Class.UNIVERSAL,captureAsn1:"macAlgorithmParameters"}]},{name:"PFX.macData.mac.digest",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"macDigest"}]},{name:"PFX.macData.macSalt",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"macSalt"},{name:"PFX.macData.iterations",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,optional:!0,capture:"macIterations"}]}]},c={name:"SafeBag",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SafeBag.bagId",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"bagId"},{name:"SafeBag.bagValue",tagClass:i.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"bagValue"},{name:"SafeBag.bagAttributes",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0,optional:!0,capture:"bagAttributes"}]},f={name:"Attribute",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"Attribute.attrId",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"oid"},{name:"Attribute.attrValues",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0,capture:"values"}]},l={name:"CertBag",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"CertBag.certId",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"certId"},{name:"CertBag.certValue",tagClass:i.Class.CONTEXT_SPECIFIC,constructed:!0,value:[{name:"CertBag.certValue[0]",tagClass:i.Class.UNIVERSAL,type:i.Class.OCTETSTRING,constructed:!1,capture:"cert"}]}]};function p(e,t,r,n){for(var i=[],o=0;o<e.length;o++)for(var a=0;a<e[o].safeBags.length;a++){var s=e[o].safeBags[a];void 0!==n&&s.type!==n||(null!==t?void 0!==s.attributes[t]&&s.attributes[t].indexOf(r)>=0&&i.push(s):i.push(s))}return i}function h(e){if(e.composed||e.constructed){for(var t=n.util.createBuffer(),r=0;r<e.value.length;++r)t.putBytes(e.value[r].value);e.composed=e.constructed=!1,e.value=t.getBytes()}return e}function d(e,t,r,n){if((t=i.fromDer(t,r)).tagClass!==i.Class.UNIVERSAL||t.type!==i.Type.SEQUENCE||!0!==t.constructed)throw new Error("PKCS#12 AuthenticatedSafe expected to be a SEQUENCE OF ContentInfo");for(var a=0;a<t.value.length;a++){var u=t.value[a],c={},f=[],l;if(!i.validate(u,s,c,f))throw(l=new Error("Cannot read ContentInfo.")).errors=f,l;var p={encrypted:!1},d=null,v=c.content.value[0];switch(i.derToOid(c.contentType)){case o.oids.data:if(v.tagClass!==i.Class.UNIVERSAL||v.type!==i.Type.OCTETSTRING)throw new Error("PKCS#12 SafeContents Data is not an OCTET STRING.");d=h(v).value;break;case o.oids.encryptedData:d=y(v,n),p.encrypted=!0;break;default:var l;throw(l=new Error("Unsupported PKCS#12 contentType.")).contentType=i.derToOid(c.contentType),l}p.safeBags=g(d,r,n),e.safeContents.push(p)}}function y(e,t){var r={},a=[],s;if(!i.validate(e,n.pkcs7.asn1.encryptedDataValidator,r,a))throw(s=new Error("Cannot read EncryptedContentInfo.")).errors=a,s;var u=i.derToOid(r.contentType),s;if(u!==o.oids.data)throw(s=new Error("PKCS#12 EncryptedContentInfo ContentType is not Data.")).oid=u,s;u=i.derToOid(r.encAlgorithm);var c=o.pbe.getCipher(u,r.encParameter,t),f=h(r.encryptedContentAsn1),l=n.util.createBuffer(f.value);if(c.update(l),!c.finish())throw new Error("Failed to decrypt PKCS#12 SafeContents.");return c.output.getBytes()}function g(e,t,r){if(!t&&0===e.length)return[];if((e=i.fromDer(e,t)).tagClass!==i.Class.UNIVERSAL||e.type!==i.Type.SEQUENCE||!0!==e.constructed)throw new Error("PKCS#12 SafeContents expected to be a SEQUENCE OF SafeBag.");for(var n=[],a=0;a<e.value.length;a++){var s=e.value[a],u={},f=[],p;if(!i.validate(s,c,u,f))throw(p=new Error("Cannot read SafeBag.")).errors=f,p;var h={type:i.derToOid(u.bagId),attributes:v(u.bagAttributes)},d,y;n.push(h);var g=u.bagValue.value[0],p;switch(h.type){case o.oids.pkcs8ShroudedKeyBag:if(null===(g=o.decryptPrivateKeyInfo(g,r)))throw new Error("Unable to decrypt PKCS#8 ShroudedKeyBag, wrong password?");case o.oids.keyBag:try{h.key=o.privateKeyFromAsn1(g)}catch(e){h.key=null,h.asn1=g}continue;case o.oids.certBag:d=l,y=function(){if(i.derToOid(u.certId)!==o.oids.x509Certificate){var e=new Error("Unsupported certificate type, only X.509 supported.");throw e.oid=i.derToOid(u.certId),e}var r=i.fromDer(u.cert,t);try{h.cert=o.certificateFromAsn1(r,!0)}catch(e){h.cert=null,h.asn1=r}};break;default:var p;throw(p=new Error("Unsupported PKCS#12 SafeBag type.")).oid=h.type,p}if(void 0!==d&&!i.validate(g,d,u,f))throw(p=new Error("Cannot read PKCS#12 "+d.name)).errors=f,p;y()}return n}function v(e){var t={};if(void 0!==e)for(var r=0;r<e.length;++r){var n={},a=[];if(!i.validate(e[r],f,n,a)){var s=new Error("Cannot read PKCS#12 BagAttribute.");throw s.errors=a,s}var u=i.derToOid(n.oid);if(void 0!==o.oids[u]){t[o.oids[u]]=[];for(var c=0;c<n.values.length;++c)t[o.oids[u]].push(n.values[c].value)}}return t}a.pkcs12FromAsn1=function(e,t,r){"string"==typeof t?(r=t,t=!0):void 0===t&&(t=!0);var s={},c=[],f;if(!i.validate(e,u,s,c))throw(f=new Error("Cannot read PKCS#12 PFX. ASN.1 object is not an PKCS#12 PFX.")).errors=f,f;var l={version:s.version.charCodeAt(0),safeContents:[],getBags:function(e){var t={},r;return"localKeyId"in e?r=e.localKeyId:"localKeyIdHex"in e&&(r=n.util.hexToBytes(e.localKeyIdHex)),void 0===r&&!("friendlyName"in e)&&"bagType"in e&&(t[e.bagType]=p(l.safeContents,null,null,e.bagType)),void 0!==r&&(t.localKeyId=p(l.safeContents,"localKeyId",r,e.bagType)),"friendlyName"in e&&(t.friendlyName=p(l.safeContents,"friendlyName",e.friendlyName,e.bagType)),t},getBagsByFriendlyName:function(e,t){return p(l.safeContents,"friendlyName",e,t)},getBagsByLocalKeyId:function(e,t){return p(l.safeContents,"localKeyId",e,t)}},f,f;if(3!==s.version.charCodeAt(0))throw(f=new Error("PKCS#12 PFX of version other than 3 not supported.")).version=s.version.charCodeAt(0),f;if(i.derToOid(s.contentType)!==o.oids.data)throw(f=new Error("Only PKCS#12 PFX in password integrity mode supported.")).oid=i.derToOid(s.contentType),f;var y=s.content.value[0];if(y.tagClass!==i.Class.UNIVERSAL||y.type!==i.Type.OCTETSTRING)throw new Error("PKCS#12 authSafe content data is not an OCTET STRING.");if(y=h(y),s.mac){var g=null,v=0,m=i.derToOid(s.macAlgorithm);switch(m){case o.oids.sha1:g=n.md.sha1.create(),v=20;break;case o.oids.sha256:g=n.md.sha256.create(),v=32;break;case o.oids.sha384:g=n.md.sha384.create(),v=48;break;case o.oids.sha512:g=n.md.sha512.create(),v=64;break;case o.oids.md5:g=n.md.md5.create(),v=16}if(null===g)throw new Error("PKCS#12 uses unsupported MAC algorithm: "+m);var b=new n.util.ByteBuffer(s.macSalt),E="macIterations"in s?parseInt(n.util.bytesToHex(s.macIterations),16):1,T=a.generateKey(r,b,3,E,v,g),S=n.hmac.create(),w;if(S.start(g,T),S.update(y.value),S.getMac().getBytes()!==s.macDigest)throw new Error("PKCS#12 MAC could not be verified. Invalid password?")}return d(l,y.value,t,r),l},a.toPkcs12Asn1=function(e,t,r,s){(s=s||{}).saltSize=s.saltSize||8,s.count=s.count||2048,s.algorithm=s.algorithm||s.encAlgorithm||"aes128","useMac"in s||(s.useMac=!0),"localKeyId"in s||(s.localKeyId=null),"generateLocalKeyId"in s||(s.generateLocalKeyId=!0);var u=s.localKeyId,c;if(null!==u)u=n.util.hexToBytes(u);else if(s.generateLocalKeyId)if(t){var f=n.util.isArray(t)?t[0]:t,l;"string"==typeof f&&(f=o.certificateFromPem(f)),(l=n.md.sha1.create()).update(i.toDer(o.certificateToAsn1(f)).getBytes()),u=l.digest().getBytes()}else u=n.random.getBytes(20);var p=[];null!==u&&p.push(i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(o.oids.localKeyId).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SET,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,u)])])),"friendlyName"in s&&p.push(i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(o.oids.friendlyName).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SET,!0,[i.create(i.Class.UNIVERSAL,i.Type.BMPSTRING,!1,s.friendlyName)])])),p.length>0&&(c=i.create(i.Class.UNIVERSAL,i.Type.SET,!0,p));var h=[],d=[];null!==t&&(d=n.util.isArray(t)?t:[t]);for(var y=[],g=0;g<d.length;++g){"string"==typeof(t=d[g])&&(t=o.certificateFromPem(t));var v=0===g?c:void 0,m=o.certificateToAsn1(t),b=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(o.oids.certBag).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(o.oids.x509Certificate).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,i.toDer(m).getBytes())])])]),v]);y.push(b)}if(y.length>0){var E=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,y),T=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(o.oids.data).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,i.toDer(E).getBytes())])]);h.push(T)}var S=null;if(null!==e){var w=o.wrapRsaPrivateKey(o.privateKeyToAsn1(e));S=null===r?i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(o.oids.keyBag).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[w]),c]):i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(o.oids.pkcs8ShroudedKeyBag).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[o.encryptPrivateKeyInfo(w,r,s)]),c]);var C=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[S]),_=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(o.oids.data).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,i.toDer(C).getBytes())])]);h.push(_)}var I=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,h),A;if(s.useMac){var l=n.md.sha1.create(),R=new n.util.ByteBuffer(n.random.getBytes(s.saltSize)),O=s.count,e=a.generateKey(r,R,3,O,20),P=n.hmac.create();P.start(l,e),P.update(i.toDer(I).getBytes());var B=P.getMac();A=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(o.oids.sha1).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")]),i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,B.getBytes())]),i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,R.getBytes()),i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(O).getBytes())])}return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(3).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(o.oids.data).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,i.toDer(I).getBytes())])]),A])},a.generateKey=n.pbe.generatePkcs12Key},function(e,t,r){var n=r(4);r(33),r(8);var i=n.asn1,o=e.exports=n.pkcs7asn1=n.pkcs7asn1||{};n.pkcs7=n.pkcs7||{},n.pkcs7.asn1=o;var a={name:"ContentInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.ContentType",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,captureAsn1:"content"}]};o.contentInfoValidator=a;var s={name:"EncryptedContentInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentType",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"contentType"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentEncryptionAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm.parameter",tagClass:i.Class.UNIVERSAL,captureAsn1:"encParameter"}]},{name:"EncryptedContentInfo.encryptedContent",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,capture:"encryptedContent",captureAsn1:"encryptedContentAsn1"}]};o.envelopedDataValidator={name:"EnvelopedData",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EnvelopedData.Version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"},{name:"EnvelopedData.RecipientInfos",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0,captureAsn1:"recipientInfos"}].concat(s)},o.encryptedDataValidator={name:"EncryptedData",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedData.Version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"}].concat(s)};var u={name:"SignerInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1},{name:"SignerInfo.issuerAndSerialNumber",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.issuerAndSerialNumber.issuer",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"SignerInfo.issuerAndSerialNumber.serialNumber",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"SignerInfo.digestAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.digestAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"digestAlgorithm"},{name:"SignerInfo.digestAlgorithm.parameter",tagClass:i.Class.UNIVERSAL,constructed:!1,captureAsn1:"digestParameter",optional:!0}]},{name:"SignerInfo.authenticatedAttributes",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"authenticatedAttributes"},{name:"SignerInfo.digestEncryptionAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,capture:"signatureAlgorithm"},{name:"SignerInfo.encryptedDigest",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"signature"},{name:"SignerInfo.unauthenticatedAttributes",tagClass:i.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,capture:"unauthenticatedAttributes"}]};o.signedDataValidator={name:"SignedData",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SignedData.Version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"},{name:"SignedData.DigestAlgorithms",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0,captureAsn1:"digestAlgorithms"},a,{name:"SignedData.Certificates",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,optional:!0,captureAsn1:"certificates"},{name:"SignedData.CertificateRevocationLists",tagClass:i.Class.CONTEXT_SPECIFIC,type:1,optional:!0,captureAsn1:"crls"},{name:"SignedData.SignerInfos",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,capture:"signerInfos",optional:!0,value:[u]}]},o.recipientInfoValidator={name:"RecipientInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"},{name:"RecipientInfo.issuerAndSerial",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.issuerAndSerial.issuer",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"RecipientInfo.issuerAndSerial.serialNumber",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"RecipientInfo.keyEncryptionAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.keyEncryptionAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"RecipientInfo.keyEncryptionAlgorithm.parameter",tagClass:i.Class.UNIVERSAL,constructed:!1,captureAsn1:"encParameter"}]},{name:"RecipientInfo.encryptedKey",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"encKey"}]}},function(e,t,r){var n=r(4),i;r(8),n.mgf=n.mgf||{},(e.exports=n.mgf.mgf1=n.mgf1=n.mgf1||{}).create=function(e){var t;return{generate:function(t,r){for(var i=new n.util.ByteBuffer,o=Math.ceil(r/e.digestLength),a=0;a<o;a++){var s=new n.util.ByteBuffer;s.putInt32(a),e.start(),e.update(t+s.getBytes()),i.putBuffer(e.digest())}return i.truncate(i.length()-r),i.getBytes()}}}},function(e,t,r){var n=r(4);e.exports=n.debug=n.debug||{},n.debug.storage={},n.debug.get=function(e,t){var r;return void 0===e?r=n.debug.storage:e in n.debug.storage&&(r=void 0===t?n.debug.storage[e]:n.debug.storage[e][t]),r},n.debug.set=function(e,t,r){e in n.debug.storage||(n.debug.storage[e]={}),n.debug.storage[e][t]=r},n.debug.clear=function(e,t){void 0===e?n.debug.storage={}:e in n.debug.storage&&(void 0===t?delete n.debug.storage[e]:delete n.debug.storage[e][t])}},function(e,t,r){var n=r(4);r(37),r(8);var i=e.exports=n.sha512=n.sha512||{};n.md.sha512=n.md.algorithms.sha512=i;var o=n.sha384=n.sha512.sha384=n.sha512.sha384||{};o.create=function(){return i.create("SHA-384")},n.md.sha384=n.md.algorithms.sha384=o,n.sha512.sha256=n.sha512.sha256||{create:function(){return i.create("SHA-512/256")}},n.md["sha512/256"]=n.md.algorithms["sha512/256"]=n.sha512.sha256,n.sha512.sha224=n.sha512.sha224||{create:function(){return i.create("SHA-512/224")}},n.md["sha512/224"]=n.md.algorithms["sha512/224"]=n.sha512.sha224,i.create=function(e){if(s||f(),void 0===e&&(e="SHA-512"),!(e in c))throw new Error("Invalid SHA-512 algorithm: "+e);for(var t=c[e],r=null,i=n.util.createBuffer(),o=new Array(80),u=0;u<80;++u)o[u]=new Array(2);var p=64;switch(e){case"SHA-384":p=48;break;case"SHA-512/256":p=32;break;case"SHA-512/224":p=28}var h={algorithm:e.replace("-","").toLowerCase(),blockLength:128,digestLength:p,messageLength:0,fullMessageLength:null,messageLengthSize:16,start:function(){h.messageLength=0,h.fullMessageLength=h.messageLength128=[];for(var e=h.messageLengthSize/4,o=0;o<e;++o)h.fullMessageLength.push(0);i=n.util.createBuffer(),r=new Array(t.length);for(var o=0;o<t.length;++o)r[o]=t[o].slice(0);return h}};return h.start(),h.update=function(e,t){"utf8"===t&&(e=n.util.encodeUtf8(e));var a=e.length;h.messageLength+=a,a=[a/4294967296>>>0,a>>>0];for(var s=h.fullMessageLength.length-1;s>=0;--s)h.fullMessageLength[s]+=a[1],a[1]=a[0]+(h.fullMessageLength[s]/4294967296>>>0),h.fullMessageLength[s]=h.fullMessageLength[s]>>>0,a[0]=a[1]/4294967296>>>0;return i.putBytes(e),l(r,o,i),(i.read>2048||0===i.length())&&i.compact(),h},h.digest=function(){var t=n.util.createBuffer();t.putBytes(i.bytes());var s,u=h.fullMessageLength[h.fullMessageLength.length-1]+h.messageLengthSize&h.blockLength-1,c,f;t.putBytes(a.substr(0,h.blockLength-u));for(var p=8*h.fullMessageLength[0],d=0;d<h.fullMessageLength.length-1;++d)p+=f=(c=8*h.fullMessageLength[d+1])/4294967296>>>0,t.putInt32(p>>>0),p=c>>>0;t.putInt32(p);for(var y=new Array(r.length),d=0;d<r.length;++d)y[d]=r[d].slice(0);l(y,o,t);var g=n.util.createBuffer(),v;v="SHA-512"===e?y.length:"SHA-384"===e?y.length-2:y.length-4;for(var d=0;d<v;++d)g.putInt32(y[d][0]),d===v-1&&"SHA-512/224"===e||g.putInt32(y[d][1]);return g},h};var a=null,s=!1,u=null,c=null;function f(){a=String.fromCharCode(128),a+=n.util.fillString(String.fromCharCode(0),128),u=[[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]],(c={})["SHA-512"]=[[1779033703,4089235720],[3144134277,2227873595],[1013904242,4271175723],[2773480762,1595750129],[1359893119,2917565137],[2600822924,725511199],[528734635,4215389547],[1541459225,327033209]],c["SHA-384"]=[[3418070365,3238371032],[1654270250,914150663],[2438529370,812702999],[355462360,4144912697],[1731405415,4290775857],[2394180231,1750603025],[3675008525,1694076839],[1203062813,3204075428]],c["SHA-512/256"]=[[573645204,4230739756],[2673172387,3360449730],[596883563,1867755857],[2520282905,1497426621],[2519219938,2827943907],[3193839141,1401305490],[721525244,746961066],[246885852,2177182882]],c["SHA-512/224"]=[[2352822216,424955298],[1944164710,2312950998],[502970286,855612546],[1738396948,1479516111],[258812777,2077511080],[2011393907,79989058],[1067287976,1780299464],[286451373,2446758561]],s=!0}function l(e,t,r){for(var n,i,o,a,s,c,f,l,p,h,d,y,g,v,m,b,E,T,S,w,C,_,I,A,R,O,P,B,k,N,U,D,x,L,j,M=r.length();M>=128;){for(k=0;k<16;++k)t[k][0]=r.getInt32()>>>0,t[k][1]=r.getInt32()>>>0;for(;k<80;++k)n=(((N=(D=t[k-2])[0])>>>19|(U=D[1])<<13)^(U>>>29|N<<3)^N>>>6)>>>0,i=((N<<13|U>>>19)^(U<<3|N>>>29)^(N<<26|U>>>6))>>>0,o=(((N=(L=t[k-15])[0])>>>1|(U=L[1])<<31)^(N>>>8|U<<24)^N>>>7)>>>0,a=((N<<31|U>>>1)^(N<<24|U>>>8)^(N<<25|U>>>7))>>>0,x=t[k-7],j=t[k-16],U=i+x[1]+a+j[1],t[k][0]=n+x[0]+o+j[0]+(U/4294967296>>>0)>>>0,t[k][1]=U>>>0;for(g=e[0][0],v=e[0][1],m=e[1][0],b=e[1][1],E=e[2][0],T=e[2][1],S=e[3][0],w=e[3][1],C=e[4][0],_=e[4][1],I=e[5][0],A=e[5][1],R=e[6][0],O=e[6][1],P=e[7][0],B=e[7][1],k=0;k<80;++k)f=((C>>>14|_<<18)^(C>>>18|_<<14)^(_>>>9|C<<23))>>>0,p=(R^C&(I^R))>>>0,s=((g>>>28|v<<4)^(v>>>2|g<<30)^(v>>>7|g<<25))>>>0,c=((g<<4|v>>>28)^(v<<30|g>>>2)^(v<<25|g>>>7))>>>0,d=(g&m|E&(g^m))>>>0,y=(v&b|T&(v^b))>>>0,U=B+(l=((C<<18|_>>>14)^(C<<14|_>>>18)^(_<<23|C>>>9))>>>0)+(h=(O^_&(A^O))>>>0)+u[k][1]+t[k][1],n=P+f+p+u[k][0]+t[k][0]+(U/4294967296>>>0)>>>0,i=U>>>0,o=s+d+((U=c+y)/4294967296>>>0)>>>0,a=U>>>0,P=R,B=O,R=I,O=A,I=C,A=_,C=S+n+((U=w+i)/4294967296>>>0)>>>0,_=U>>>0,S=E,w=T,E=m,T=b,m=g,b=v,g=n+o+((U=i+a)/4294967296>>>0)>>>0,v=U>>>0;U=e[0][1]+v,e[0][0]=e[0][0]+g+(U/4294967296>>>0)>>>0,e[0][1]=U>>>0,U=e[1][1]+b,e[1][0]=e[1][0]+m+(U/4294967296>>>0)>>>0,e[1][1]=U>>>0,U=e[2][1]+T,e[2][0]=e[2][0]+E+(U/4294967296>>>0)>>>0,e[2][1]=U>>>0,U=e[3][1]+w,e[3][0]=e[3][0]+S+(U/4294967296>>>0)>>>0,e[3][1]=U>>>0,U=e[4][1]+_,e[4][0]=e[4][0]+C+(U/4294967296>>>0)>>>0,e[4][1]=U>>>0,U=e[5][1]+A,e[5][0]=e[5][0]+I+(U/4294967296>>>0)>>>0,e[5][1]=U>>>0,U=e[6][1]+O,e[6][0]=e[6][0]+R+(U/4294967296>>>0)>>>0,e[6][1]=U>>>0,U=e[7][1]+B,e[7][0]=e[7][0]+P+(U/4294967296>>>0)>>>0,e[7][1]=U>>>0,M-=128}}},function(e,t,r){var n=r(4);r(8),e.exports=n.log=n.log||{},n.log.levels=["none","error","warning","info","debug","verbose","max"];var i={},o=[],a=null;n.log.LEVEL_LOCKED=2,n.log.NO_LEVEL_CHECK=4,n.log.INTERPOLATE=8;for(var s=0;s<n.log.levels.length;++s){var u=n.log.levels[s];i[u]={index:s,name:u.toUpperCase()}}n.log.logMessage=function(e){for(var t=i[e.level].index,r=0;r<o.length;++r){var a=o[r],s;if(a.flags&n.log.NO_LEVEL_CHECK)a.f(e);else t<=i[a.level].index&&a.f(a,e)}},n.log.prepareStandard=function(e){"standard"in e||(e.standard=i[e.level].name+" ["+e.category+"] "+e.message)},n.log.prepareFull=function(e){if(!("full"in e)){var t=[e.message];t=t.concat([]||!1),e.full=n.util.format.apply(this,t)}},n.log.prepareStandardFull=function(e){"standardFull"in e||(n.log.prepareStandard(e),e.standardFull=e.standard)};for(var c=["error","warning","info","debug","verbose"],s=0;s<c.length;++s)(function(e){n.log[e]=function(t,r){var i=Array.prototype.slice.call(arguments).slice(2),o={timestamp:new Date,level:e,category:t,message:r,arguments:i};n.log.logMessage(o)}})(c[s]);if(n.log.makeLogger=function(e){var t={flags:0,f:e};return n.log.setLevel(t,"none"),t},n.log.setLevel=function(e,t){var r=!1;if(e&&!(e.flags&n.log.LEVEL_LOCKED))for(var i=0;i<n.log.levels.length;++i){var o;if(t==n.log.levels[i]){e.level=t,r=!0;break}}return r},n.log.lock=function(e,t){void 0===t||t?e.flags|=n.log.LEVEL_LOCKED:e.flags&=~n.log.LEVEL_LOCKED},n.log.addLogger=function(e){o.push(e)},"undefined"!=typeof console&&"log"in console){var f;if(console.error&&console.warn&&console.info&&console.debug){var l={error:console.error,warning:console.warn,info:console.info,debug:console.debug,verbose:console.debug},p=function(e,t){n.log.prepareStandard(t);var r=l[t.level],i=[t.standard];i=i.concat(t.arguments.slice()),r.apply(console,i)};f=n.log.makeLogger(p)}else{var p=function(e,t){n.log.prepareStandardFull(t),console.log(t.standardFull)};f=n.log.makeLogger(p)}n.log.setLevel(f,"debug"),n.log.addLogger(f),a=f}else console={log:function(){}};if(null!==a){var h=n.util.getQueryVariables(),d;if("console.level"in h&&n.log.setLevel(a,h["console.level"].slice(-1)[0]),"console.lock"in h)"true"==h["console.lock"].slice(-1)[0]&&n.log.lock(a)}n.log.consoleLogger=a},function(e,t,r){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",a=r.toStringTag||"@@toStringTag";function s(r,n,i,a){var s=n&&n.prototype instanceof c?n:c,f=Object.create(s.prototype);return o(f,"_invoke",function(r,n,i){var o,a,s,c=0,f=i||[],l=!1,p={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function t(r,n){return o=r,a=0,s=e,p.n=n,u}};function h(r,n){for(a=r,s=n,t=0;!l&&c&&!i&&t<f.length;t++){var i,o=f[t],h=p.p,d=o[2];r>3?(i=d===n)&&(s=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=e):o[0]<=h&&((i=r<2&&h<o[1])?(a=0,p.v=n,p.n=o[1]):h<d&&(i=r<3||o[0]>n||n>d)&&(o[4]=r,o[5]=n,p.n=d,a=0))}if(i||r>1)return u;throw l=!0,n}return function(i,f,d){if(c>1)throw TypeError("Generator is already running");for(l&&1===f&&h(f,d),a=f,s=d;(t=a<2?e:s)||!l;){o||(a?a<3?(a>1&&(p.n=-1),h(a,s)):p.n=s:p.v=s);try{if(c=2,o){if(a||(i="next"),t=o[i]){if(!(t=t.call(o,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,a<2&&(a=0)}else 1===a&&(t=o.return)&&t.call(o),a<2&&(s=TypeError("The iterator does not provide a '"+i+"' method"),a=1);o=e}else if((t=(l=p.n<0)?s:r.call(n,p))!==u)break}catch(t){o=e,a=1,s=t}finally{c=1}}return{value:t,done:l}}}(r,i,a),!0),f}var u={};function c(){}function f(){}function l(){}t=Object.getPrototypeOf;var p=[][n]?t(t([][n]())):(o(t={},n,function(){return this}),t),h=l.prototype=c.prototype=Object.create(p);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,o(e,a,"GeneratorFunction")),e.prototype=Object.create(h),e}return f.prototype=l,o(h,"constructor",l),o(l,"constructor",f),f.displayName="GeneratorFunction",o(l,a,"GeneratorFunction"),o(h),o(h,a,"Generator"),o(h,n,function(){return this}),o(h,"toString",function(){return"[object Generator]"}),(i=function e(){return{w:s,m:d}})()}function o(e,t,r,n){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}o=function e(t,r,n,a){function s(e,r){o(t,e,function(t){return this._invoke(e,r,t)})}r?i?i(t,r,{value:n,enumerable:!a,configurable:!a,writable:!a}):t[r]=n:(s("next",0),s("throw",1),s("return",2))},o(e,t,r,n)}function a(e){if(null==e)throw new TypeError("Cannot destructure "+e)}function s(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function u(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var o=e.apply(t,r);function a(e){s(o,n,i,a,u,"next",e)}function u(e){s(o,n,i,a,u,"throw",e)}a(void 0)})}}function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,p(n.key),n)}}function l(e,t,r){return t&&f(e.prototype,t),r&&f(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function p(e){var t=h(e,"string");return"symbol"==n(t)?t:t+""}function h(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}e.exports=function(){function e(){var t,r=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).type;if(c(this,e),"string"!=typeof r)throw new TypeError('A LinkedDataProof must have a "type".');this.type=r}return l(e,[{key:"createProof",value:function(){var e=u(i().m(function e(t){return i().w(function(e){for(;;)switch(e.n){case 0:throw a(t),new Error('"createProof" must be implemented in a derived class.');case 1:return e.a(2)}},e)}));function t(t){return e.apply(this,arguments)}return t}()},{key:"verifyProof",value:function(){var e=u(i().m(function e(t){return i().w(function(e){for(;;)switch(e.n){case 0:throw a(t),new Error('"verifyProof" must be implemented in a derived class.');case 1:return e.a(2)}},e)}));function t(t){return e.apply(this,arguments)}return t}()},{key:"matchProof",value:function(){var e=u(i().m(function e(t){var r;return i().w(function(e){for(;;)if(0===e.n)return r=t.proof,e.a(2,r.type===this.type)},e,this)}));function t(t){return e.apply(this,arguments)}return t}()}])}()},function(e,t,r){"use strict";(function(t){function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",a=r.toStringTag||"@@toStringTag";function s(r,n,i,a){var s=n&&n.prototype instanceof c?n:c,f=Object.create(s.prototype);return o(f,"_invoke",function(r,n,i){var o,a,s,c=0,f=i||[],l=!1,p={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function t(r,n){return o=r,a=0,s=e,p.n=n,u}};function h(r,n){for(a=r,s=n,t=0;!l&&c&&!i&&t<f.length;t++){var i,o=f[t],h=p.p,d=o[2];r>3?(i=d===n)&&(s=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=e):o[0]<=h&&((i=r<2&&h<o[1])?(a=0,p.v=n,p.n=o[1]):h<d&&(i=r<3||o[0]>n||n>d)&&(o[4]=r,o[5]=n,p.n=d,a=0))}if(i||r>1)return u;throw l=!0,n}return function(i,f,d){if(c>1)throw TypeError("Generator is already running");for(l&&1===f&&h(f,d),a=f,s=d;(t=a<2?e:s)||!l;){o||(a?a<3?(a>1&&(p.n=-1),h(a,s)):p.n=s:p.v=s);try{if(c=2,o){if(a||(i="next"),t=o[i]){if(!(t=t.call(o,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,a<2&&(a=0)}else 1===a&&(t=o.return)&&t.call(o),a<2&&(s=TypeError("The iterator does not provide a '"+i+"' method"),a=1);o=e}else if((t=(l=p.n<0)?s:r.call(n,p))!==u)break}catch(t){o=e,a=1,s=t}finally{c=1}}return{value:t,done:l}}}(r,i,a),!0),f}var u={};function c(){}function f(){}function l(){}t=Object.getPrototypeOf;var p=[][n]?t(t([][n]())):(o(t={},n,function(){return this}),t),h=l.prototype=c.prototype=Object.create(p);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,o(e,a,"GeneratorFunction")),e.prototype=Object.create(h),e}return f.prototype=l,o(h,"constructor",l),o(l,"constructor",f),f.displayName="GeneratorFunction",o(l,a,"GeneratorFunction"),o(h),o(h,a,"Generator"),o(h,n,function(){return this}),o(h,"toString",function(){return"[object Generator]"}),(i=function e(){return{w:s,m:d}})()}function o(e,t,r,n){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}o=function e(t,r,n,a){function s(e,r){o(t,e,function(t){return this._invoke(e,r,t)})}r?i?i(t,r,{value:n,enumerable:!a,configurable:!a,writable:!a}):t[r]=n:(s("next",0),s("throw",1),s("return",2))},o(e,t,r,n)}function a(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function s(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var o=e.apply(t,r);function s(e){a(o,n,i,s,u,"next",e)}function u(e){a(o,n,i,s,u,"throw",e)}s(void 0)})}}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,l(n.key),n)}}function f(e,t,r){return t&&c(e.prototype,t),r&&c(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function l(e){var t=p(e,"string");return"symbol"==n(t)?t:t+""}function p(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function h(e,t,r){return t=E(t),d(e,g()?Reflect.construct(t,r||[],E(e).constructor):t.apply(e,r))}function d(e,t){if(t&&("object"==n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return y(e)}function y(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function g(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(g=function t(){return!!e})()}function v(e,t,r,n){var i=m(E(1&n?e.prototype:e),t,r);return 2&n&&"function"==typeof i?function(e){return i.apply(r,e)}:i}function m(){return m="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=b(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}},m.apply(null,arguments)}function b(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=E(e)););return e}function E(e){return E=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},E(e)}function T(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&S(e,t)}function S(e,t){return S=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},S(e,t)}var w=r(133),C=r(117),_=r(115);e.exports=function(e){function n(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.type,i=void 0===r?"LinkedDataSignature2015":r,o=t.privateKeyPem,a=t.publicKeyPem,s=t.creator,c=t.date,f=t.domain,l=t.nonce,p=t.useNativeCanonize;if(u(this,n),void 0!==f&&"string"!=typeof f)throw new TypeError('"domain" must be a string.');if(void 0!==l&&"string"!=typeof l)throw new TypeError('"nonce" must be a string.');return(e=h(this,n,[{type:i,creator:s,date:c,domain:f,nonce:l,useNativeCanonize:p}])).legacy=!0,e.privateKeyPem=o,e.publicKeyPem=a,e.nonce=l,e.domain=f,e}return T(n,e),f(n,[{key:"updateProof",value:function(){var e=s(i().m(function e(t){var r;return i().w(function(e){for(;;)if(0===e.n)return r=t.proof,void 0!==this.domain&&(r.domain=this.domain),void 0!==this.nonce&&(r.nonce=this.nonce),e.a(2,r)},e,this)}));function t(t){return e.apply(this,arguments)}return t}()},{key:"verifyProof",value:function(){var e=s(i().m(function e(t){var r,o,a,s,u,c,f;return i().w(function(e){for(;;)switch(e.p=e.n){case 0:if(r=t.proof,o=t.document,a=t.purpose,s=t.documentLoader,u=t.expansionMap,c=t.compactProof,e.p=1,void 0===this.domain||r.domain===this.domain){e.n=2;break}throw new Error("The domain is not as expected; "+'domain="'.concat(r.domain,'", expected="').concat(this.domain,'"'));case 2:return e.a(2,v(n,"verifyProof",this,3)([{proof:r,document:o,purpose:a,documentLoader:s,expansionMap:u,compactProof:c}]));case 3:return e.p=3,f=e.v,e.a(2,{verified:!1,error:f})}},e,this,[[1,3]])}));function t(t){return e.apply(this,arguments)}return t}()},{key:"createVerifyData",value:function(){var e=s(i().m(function e(t){var r,n,o,a,s,u,c,f,l,p,h,d;return i().w(function(e){for(;;)switch(e.n){case 0:return r=t.document,n=t.proof,o=t.documentLoader,a=t.expansionMap,e.n=1,this.canonize(r,{documentLoader:o,expansionMap:a});case 1:for(s=e.v,u="",c={"http://purl.org/dc/elements/1.1/created":n.created,"https://w3id.org/security#domain":n.domain,"https://w3id.org/security#nonce":n.nonce},f=Object.keys(c).sort(),l=0;l<f.length;++l)p=f[l],null!=(h=c[p])&&(u+=p+": "+h+"\n");return u+=s,d=new C.util.ByteBuffer(u,"utf8"),e.a(2,C.util.binary.raw.decode(d.getBytes()))}},e,this)}));function t(t){return e.apply(this,arguments)}return t}()},{key:"sign",value:function(){var e=s(i().m(function e(n){var o,a,s,u,c,f,l,p;return i().w(function(e){for(;;)switch(e.n){case 0:if(o=n.verifyData,a=n.proof,"string"==typeof(s=this.privateKeyPem)){e.n=1;break}throw new TypeError('"privateKeyPem" must be a PEM formatted string.');case 1:return w.nodejs?(c=r(152),(f=c.createSign("RSA-SHA256")).update(t.from(o.buffer,o.byteOffset,o.length)),u=f.sign(s,"base64")):(l=C.pki.privateKeyFromPem(s),(p=C.md.sha256.create()).update(C.util.binary.raw.encode(o),"binary"),u=C.util.encode64(l.sign(p))),a.signatureValue=u,e.a(2,a)}},e,this)}));function n(t){return e.apply(this,arguments)}return n}()},{key:"verifySignature",value:function(){var e=s(i().m(function e(n){var o,a,s,u,c,f,l,p;return i().w(function(e){for(;;)switch(e.p=e.n){case 0:if(o=n.verifyData,a=n.proof,"string"==typeof(s=this.publicKeyPem)){e.n=1;break}throw new TypeError('Could not verify signature; invalid "publicKeyPem".');case 1:if(!w.nodejs){e.n=2;break}return u=r(152),(c=u.createVerify("RSA-SHA256")).update(t.from(o.buffer,o.byteOffset,o.length)),e.a(2,c.verify(s,a.signatureValue,"base64"));case 2:return f=C.pki.publicKeyFromPem(s),(l=C.md.sha256.create()).update(C.util.binary.raw.encode(o),"binary"),e.p=3,e.a(2,f.verify(l.digest().bytes(),C.util.decode64(a.signatureValue)));case 4:return e.p=4,p=e.v,e.a(2,!1)}},e,this,[[3,4]])}));function n(t){return e.apply(this,arguments)}return n}()},{key:"getVerificationMethod",value:function(){var e=s(i().m(function e(t){var r,o,a;return i().w(function(e){for(;;)switch(e.n){case 0:return r=t.proof,o=t.documentLoader,e.n=1,v(n,"getVerificationMethod",this,3)([{proof:r,documentLoader:o}]);case 1:return a=e.v,this.publicKeyPem||(this.publicKeyPem=a.publicKeyPem),e.a(2,a)}},e,this)}));function t(t){return e.apply(this,arguments)}return t}()}])}(_)}).call(this,r(116).Buffer)},function(e,t){},,,,,,,,,,,,,,,,,function(e,t,r){"use strict";function n(e){return e&&"function"==typeof e.schedule}r.d(t,"a",function(){return u});var i=r(5),o=r(35),a=r(22);function s(e,t){return t?Object(a.a)(e,t):new i.a(Object(o.a)(e))}function u(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e[e.length-1];return n(r)?(e.pop(),Object(a.a)(e,r)):s(e)}},,function(e,t,r){(function(t,r,n,i){var o,o,a;a=function(){return function e(t,r,n){function i(a,s){if(!r[a]){if(!t[a]){var u=!1;if(o)return o(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var f=r[a]={exports:{}};t[a][0].call(f.exports,function(e){var r;return i(t[a][1][e]||e)},f,f.exports,e,t,r,n)}return r[a].exports}for(var o=!1,a=0;a<n.length;a++)i(n[a]);return i}({1:[function(e,t,r){"use strict";var n=e("./utils"),i=e("./support"),o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";r.encode=function(e){for(var t,r,i,a,s,u,c,f=[],l=0,p=e.length,h=p,d="string"!==n.getTypeOf(e);l<e.length;)h=p-l,i=d?(t=e[l++],r=l<p?e[l++]:0,l<p?e[l++]:0):(t=e.charCodeAt(l++),r=l<p?e.charCodeAt(l++):0,l<p?e.charCodeAt(l++):0),a=t>>2,s=(3&t)<<4|r>>4,u=1<h?(15&r)<<2|i>>6:64,c=2<h?63&i:64,f.push(o.charAt(a)+o.charAt(s)+o.charAt(u)+o.charAt(c));return f.join("")},r.decode=function(e){var t,r,n,a,s,u,c=0,f=0,l="data:";if(e.substr(0,5)===l)throw new Error("Invalid base64 input, it looks like a data url.");var p,h=3*(e=e.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(e.charAt(e.length-1)===o.charAt(64)&&h--,e.charAt(e.length-2)===o.charAt(64)&&h--,h%1!=0)throw new Error("Invalid base64 input, bad content length.");for(p=i.uint8array?new Uint8Array(0|h):new Array(0|h);c<e.length;)t=o.indexOf(e.charAt(c++))<<2|(a=o.indexOf(e.charAt(c++)))>>4,r=(15&a)<<4|(s=o.indexOf(e.charAt(c++)))>>2,n=(3&s)<<6|(u=o.indexOf(e.charAt(c++))),p[f++]=t,64!==s&&(p[f++]=r),64!==u&&(p[f++]=n);return p}},{"./support":30,"./utils":32}],2:[function(e,t,r){"use strict";var n=e("./external"),i=e("./stream/DataWorker"),o=e("./stream/Crc32Probe"),a=e("./stream/DataLengthProbe");function s(e,t,r,n,i){this.compressedSize=e,this.uncompressedSize=t,this.crc32=r,this.compression=n,this.compressedContent=i}s.prototype={getContentWorker:function(){var e=new i(n.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new a("data_length")),t=this;return e.on("end",function(){if(this.streamInfo.data_length!==t.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),e},getCompressedWorker:function(){return new i(n.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},s.createWorkerFrom=function(e,t,r){return e.pipe(new o).pipe(new a("uncompressedSize")).pipe(t.compressWorker(r)).pipe(new a("compressedSize")).withStreamInfo("compression",t)},t.exports=s},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(e,t,r){"use strict";var n=e("./stream/GenericWorker");r.STORE={magic:"\0\0",compressWorker:function(){return new n("STORE compression")},uncompressWorker:function(){return new n("STORE decompression")}},r.DEFLATE=e("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(e,t,r){"use strict";var n=e("./utils"),i=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();t.exports=function(e,t){return void 0!==e&&e.length?"string"!==n.getTypeOf(e)?function(e,t,r,n){var o=i,a=0+r;e^=-1;for(var s=0;s<a;s++)e=e>>>8^o[255&(e^t[s])];return-1^e}(0|t,e,e.length,0):function(e,t,r,n){var o=i,a=0+r;e^=-1;for(var s=0;s<a;s++)e=e>>>8^o[255&(e^t.charCodeAt(s))];return-1^e}(0|t,e,e.length,0):0}},{"./utils":32}],5:[function(e,t,r){"use strict";r.base64=!1,r.binary=!1,r.dir=!1,r.createFolders=!0,r.date=null,r.compression=null,r.compressionOptions=null,r.comment=null,r.unixPermissions=null,r.dosPermissions=null},{}],6:[function(e,t,r){"use strict";var n=null;n="undefined"!=typeof Promise?Promise:e("lie"),t.exports={Promise:n}},{lie:37}],7:[function(e,t,r){"use strict";var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,i=e("pako"),o=e("./utils"),a=e("./stream/GenericWorker"),s=n?"uint8array":"array";function u(e,t){a.call(this,"FlateWorker/"+e),this._pako=null,this._pakoAction=e,this._pakoOptions=t,this.meta={}}r.magic="\b\0",o.inherits(u,a),u.prototype.processChunk=function(e){this.meta=e.meta,null===this._pako&&this._createPako(),this._pako.push(o.transformTo(s,e.data),!1)},u.prototype.flush=function(){a.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},u.prototype.cleanUp=function(){a.prototype.cleanUp.call(this),this._pako=null},u.prototype._createPako=function(){this._pako=new i[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var e=this;this._pako.onData=function(t){e.push({data:t,meta:e.meta})}},r.compressWorker=function(e){return new u("Deflate",e)},r.uncompressWorker=function(){return new u("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(e,t,r){"use strict";function n(e,t){var r,n="";for(r=0;r<t;r++)n+=String.fromCharCode(255&e),e>>>=8;return n}function i(e,t,r,i,a,f){var l,p,h=e.file,d=e.compression,y=f!==s.utf8encode,g=o.transformTo("string",f(h.name)),v=o.transformTo("string",s.utf8encode(h.name)),m=h.comment,b=o.transformTo("string",f(m)),E=o.transformTo("string",s.utf8encode(m)),T=v.length!==h.name.length,S=E.length!==m.length,w="",C="",_="",I=h.dir,A=h.date,R={crc32:0,compressedSize:0,uncompressedSize:0};t&&!r||(R.crc32=e.crc32,R.compressedSize=e.compressedSize,R.uncompressedSize=e.uncompressedSize);var O=0;t&&(O|=8),y||!T&&!S||(O|=2048);var P=0,B=0;I&&(P|=16),"UNIX"===a?(B=798,P|=function(e,t){var r=e;return e||(r=t?16893:33204),(65535&r)<<16}(h.unixPermissions,I)):(B=20,P|=function(e){return 63&(e||0)}(h.dosPermissions)),l=A.getUTCHours(),l<<=6,l|=A.getUTCMinutes(),l<<=5,l|=A.getUTCSeconds()/2,p=A.getUTCFullYear()-1980,p<<=4,p|=A.getUTCMonth()+1,p<<=5,p|=A.getUTCDate(),T&&(C=n(1,1)+n(u(g),4)+v,w+="up"+n(C.length,2)+C),S&&(_=n(1,1)+n(u(b),4)+E,w+="uc"+n(_.length,2)+_);var k="";return k+="\n\0",k+=n(O,2),k+=d.magic,k+=n(l,2),k+=n(p,2),k+=n(R.crc32,4),k+=n(R.compressedSize,4),k+=n(R.uncompressedSize,4),k+=n(g.length,2),k+=n(w.length,2),{fileRecord:c.LOCAL_FILE_HEADER+k+g+w,dirRecord:c.CENTRAL_FILE_HEADER+n(B,2)+k+n(b.length,2)+"\0\0\0\0"+n(P,4)+n(i,4)+g+w+b}}var o=e("../utils"),a=e("../stream/GenericWorker"),s=e("../utf8"),u=e("../crc32"),c=e("../signature");function f(e,t,r,n){a.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=t,this.zipPlatform=r,this.encodeFileName=n,this.streamFiles=e,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}o.inherits(f,a),f.prototype.push=function(e){var t=e.meta.percent||0,r=this.entriesCount,n=this._sources.length;this.accumulate?this.contentBuffer.push(e):(this.bytesWritten+=e.data.length,a.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:r?(t+100*(r-n-1))/r:100}}))},f.prototype.openedSource=function(e){this.currentSourceOffset=this.bytesWritten,this.currentFile=e.file.name;var t=this.streamFiles&&!e.file.dir;if(t){var r=i(e,t,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:r.fileRecord,meta:{percent:0}})}else this.accumulate=!0},f.prototype.closedSource=function(e){this.accumulate=!1;var t=this.streamFiles&&!e.file.dir,r=i(e,t,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(r.dirRecord),t)this.push({data:function(e){return c.DATA_DESCRIPTOR+n(e.crc32,4)+n(e.compressedSize,4)+n(e.uncompressedSize,4)}(e),meta:{percent:100}});else for(this.push({data:r.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},f.prototype.flush=function(){for(var e=this.bytesWritten,t=0;t<this.dirRecords.length;t++)this.push({data:this.dirRecords[t],meta:{percent:100}});var r=this.bytesWritten-e,i=function(e,t,r,i,a){var s=o.transformTo("string",a(i));return c.CENTRAL_DIRECTORY_END+"\0\0\0\0"+n(e,2)+n(e,2)+n(t,4)+n(r,4)+n(s.length,2)+s}(this.dirRecords.length,r,e,this.zipComment,this.encodeFileName);this.push({data:i,meta:{percent:100}})},f.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},f.prototype.registerPrevious=function(e){this._sources.push(e);var t=this;return e.on("data",function(e){t.processChunk(e)}),e.on("end",function(){t.closedSource(t.previous.streamInfo),t._sources.length?t.prepareNextSource():t.end()}),e.on("error",function(e){t.error(e)}),this},f.prototype.resume=function(){return!!a.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},f.prototype.error=function(e){var t=this._sources;if(!a.prototype.error.call(this,e))return!1;for(var r=0;r<t.length;r++)try{t[r].error(e)}catch(e){}return!0},f.prototype.lock=function(){a.prototype.lock.call(this);for(var e=this._sources,t=0;t<e.length;t++)e[t].lock()},t.exports=f},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(e,t,r){"use strict";var n=e("../compressions"),i=e("./ZipFileWorker");r.generateWorker=function(e,t,r){var o=new i(t.streamFiles,r,t.platform,t.encodeFileName),a=0;try{e.forEach(function(e,r){a++;var i=function(e,t){var r=e||t,i=n[r];if(!i)throw new Error(r+" is not a valid compression method !");return i}(r.options.compression,t.compression),s=r.options.compressionOptions||t.compressionOptions||{},u=r.dir,c=r.date;r._compressWorker(i,s).withStreamInfo("file",{name:e,dir:u,date:c,comment:r.comment||"",unixPermissions:r.unixPermissions,dosPermissions:r.dosPermissions}).pipe(o)}),o.entriesCount=a}catch(e){o.error(e)}return o}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(e,t,r){"use strict";function n(){if(!(this instanceof n))return new n;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var e=new n;for(var t in this)"function"!=typeof this[t]&&(e[t]=this[t]);return e}}(n.prototype=e("./object")).loadAsync=e("./load"),n.support=e("./support"),n.defaults=e("./defaults"),n.version="3.10.1",n.loadAsync=function(e,t){return(new n).loadAsync(e,t)},n.external=e("./external"),t.exports=n},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(e,t,r){"use strict";var n=e("./utils"),i=e("./external"),o=e("./utf8"),a=e("./zipEntries"),s=e("./stream/Crc32Probe"),u=e("./nodejsUtils");function c(e){return new i.Promise(function(t,r){var n=e.decompressed.getContentWorker().pipe(new s);n.on("error",function(e){r(e)}).on("end",function(){n.streamInfo.crc32!==e.decompressed.crc32?r(new Error("Corrupted zip : CRC32 mismatch")):t()}).resume()})}t.exports=function(e,t){var r=this;return t=n.extend(t||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:o.utf8decode}),u.isNode&&u.isStream(e)?i.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):n.prepareContent("the loaded zip file",e,!0,t.optimizedBinaryString,t.base64).then(function(e){var r=new a(t);return r.load(e),r}).then(function(e){var r=[i.Promise.resolve(e)],n=e.files;if(t.checkCRC32)for(var o=0;o<n.length;o++)r.push(c(n[o]));return i.Promise.all(r)}).then(function(e){for(var i=e.shift(),o=i.files,a=0;a<o.length;a++){var s=o[a],u=s.fileNameStr,c=n.resolve(s.fileNameStr);r.file(c,s.decompressed,{binary:!0,optimizedBinaryString:!0,date:s.date,dir:s.dir,comment:s.fileCommentStr.length?s.fileCommentStr:null,unixPermissions:s.unixPermissions,dosPermissions:s.dosPermissions,createFolders:t.createFolders}),s.dir||(r.file(c).unsafeOriginalName=u)}return i.zipComment.length&&(r.comment=i.zipComment),r})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(e,t,r){"use strict";var n=e("../utils"),i=e("../stream/GenericWorker");function o(e,t){i.call(this,"Nodejs stream input adapter for "+e),this._upstreamEnded=!1,this._bindStream(t)}n.inherits(o,i),o.prototype._bindStream=function(e){var t=this;(this._stream=e).pause(),e.on("data",function(e){t.push({data:e,meta:{percent:0}})}).on("error",function(e){t.isPaused?this.generatedError=e:t.error(e)}).on("end",function(){t.isPaused?t._upstreamEnded=!0:t.end()})},o.prototype.pause=function(){return!!i.prototype.pause.call(this)&&(this._stream.pause(),!0)},o.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},t.exports=o},{"../stream/GenericWorker":28,"../utils":32}],13:[function(e,t,r){"use strict";var n=e("readable-stream").Readable;function i(e,t,r){n.call(this,t),this._helper=e;var i=this;e.on("data",function(e,t){i.push(e)||i._helper.pause(),r&&r(t)}).on("error",function(e){i.emit("error",e)}).on("end",function(){i.push(null)})}e("../utils").inherits(i,n),i.prototype._read=function(){this._helper.resume()},t.exports=i},{"../utils":32,"readable-stream":16}],14:[function(e,r,n){"use strict";r.exports={isNode:void 0!==t,newBufferFrom:function(e,r){if(t.from&&t.from!==Uint8Array.from)return t.from(e,r);if("number"==typeof e)throw new Error('The "data" argument must not be a number');return new t(e,r)},allocBuffer:function(e){if(t.alloc)return t.alloc(e);var r=new t(e);return r.fill(0),r},isBuffer:function(e){return t.isBuffer(e)},isStream:function(e){return e&&"function"==typeof e.on&&"function"==typeof e.pause&&"function"==typeof e.resume}}},{}],15:[function(e,t,r){"use strict";function n(e,t,r){var n,i=o.getTypeOf(t),s=o.extend(r||{},u);s.date=s.date||new Date,null!==s.compression&&(s.compression=s.compression.toUpperCase()),"string"==typeof s.unixPermissions&&(s.unixPermissions=parseInt(s.unixPermissions,8)),s.unixPermissions&&16384&s.unixPermissions&&(s.dir=!0),s.dosPermissions&&16&s.dosPermissions&&(s.dir=!0),s.dir&&(e=y(e)),s.createFolders&&(n=d(e))&&g.call(this,n,!0);var l="string"===i&&!1===s.binary&&!1===s.base64;r&&void 0!==r.binary||(s.binary=!l),(t instanceof c&&0===t.uncompressedSize||s.dir||!t||0===t.length)&&(s.base64=!1,s.binary=!0,t="",s.compression="STORE",i="string");var v=null;v=t instanceof c||t instanceof a?t:p.isNode&&p.isStream(t)?new h(e,t):o.prepareContent(e,t,s.binary,s.optimizedBinaryString,s.base64);var m=new f(e,v,s);this.files[e]=m}var i=e("./utf8"),o=e("./utils"),a=e("./stream/GenericWorker"),s=e("./stream/StreamHelper"),u=e("./defaults"),c=e("./compressedObject"),f=e("./zipObject"),l=e("./generate"),p=e("./nodejsUtils"),h=e("./nodejs/NodejsStreamInputAdapter"),d=function(e){"/"===e.slice(-1)&&(e=e.substring(0,e.length-1));var t=e.lastIndexOf("/");return 0<t?e.substring(0,t):""},y=function(e){return"/"!==e.slice(-1)&&(e+="/"),e},g=function(e,t){return t=void 0!==t?t:u.createFolders,e=y(e),this.files[e]||n.call(this,e,null,{dir:!0,createFolders:t}),this.files[e]};function v(e){return"[object RegExp]"===Object.prototype.toString.call(e)}var m={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(e){var t,r,n;for(t in this.files)n=this.files[t],(r=t.slice(this.root.length,t.length))&&t.slice(0,this.root.length)===this.root&&e(r,n)},filter:function(e){var t=[];return this.forEach(function(r,n){e(r,n)&&t.push(n)}),t},file:function(e,t,r){if(1!==arguments.length)return e=this.root+e,n.call(this,e,t,r),this;if(v(e)){var i=e;return this.filter(function(e,t){return!t.dir&&i.test(e)})}var o=this.files[this.root+e];return o&&!o.dir?o:null},folder:function(e){if(!e)return this;if(v(e))return this.filter(function(t,r){return r.dir&&e.test(t)});var t=this.root+e,r=g.call(this,t),n=this.clone();return n.root=r.name,n},remove:function(e){e=this.root+e;var t=this.files[e];if(t||("/"!==e.slice(-1)&&(e+="/"),t=this.files[e]),t&&!t.dir)delete this.files[e];else for(var r=this.filter(function(t,r){return r.name.slice(0,e.length)===e}),n=0;n<r.length;n++)delete this.files[r[n].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(e){var t,r={};try{if((r=o.extend(e||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:i.utf8encode})).type=r.type.toLowerCase(),r.compression=r.compression.toUpperCase(),"binarystring"===r.type&&(r.type="string"),!r.type)throw new Error("No output type specified.");o.checkSupport(r.type),"darwin"!==r.platform&&"freebsd"!==r.platform&&"linux"!==r.platform&&"sunos"!==r.platform||(r.platform="UNIX"),"win32"===r.platform&&(r.platform="DOS");var n=r.comment||this.comment||"";t=l.generateWorker(this,r,n)}catch(e){(t=new a("error")).error(e)}return new s(t,r.type||"string",r.mimeType)},generateAsync:function(e,t){return this.generateInternalStream(e).accumulate(t)},generateNodeStream:function(e,t){return(e=e||{}).type||(e.type="nodebuffer"),this.generateInternalStream(e).toNodejsStream(t)}};t.exports=m},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(e,t,r){"use strict";t.exports=e("stream")},{stream:void 0}],17:[function(e,t,r){"use strict";var n=e("./DataReader");function i(e){n.call(this,e);for(var t=0;t<this.data.length;t++)e[t]=255&e[t]}e("../utils").inherits(i,n),i.prototype.byteAt=function(e){return this.data[this.zero+e]},i.prototype.lastIndexOfSignature=function(e){for(var t=e.charCodeAt(0),r=e.charCodeAt(1),n=e.charCodeAt(2),i=e.charCodeAt(3),o=this.length-4;0<=o;--o)if(this.data[o]===t&&this.data[o+1]===r&&this.data[o+2]===n&&this.data[o+3]===i)return o-this.zero;return-1},i.prototype.readAndCheckSignature=function(e){var t=e.charCodeAt(0),r=e.charCodeAt(1),n=e.charCodeAt(2),i=e.charCodeAt(3),o=this.readData(4);return t===o[0]&&r===o[1]&&n===o[2]&&i===o[3]},i.prototype.readData=function(e){if(this.checkOffset(e),0===e)return[];var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./DataReader":18}],18:[function(e,t,r){"use strict";var n=e("../utils");function i(e){this.data=e,this.length=e.length,this.index=0,this.zero=0}i.prototype={checkOffset:function(e){this.checkIndex(this.index+e)},checkIndex:function(e){if(this.length<this.zero+e||e<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+e+"). Corrupted zip ?")},setIndex:function(e){this.checkIndex(e),this.index=e},skip:function(e){this.setIndex(this.index+e)},byteAt:function(){},readInt:function(e){var t,r=0;for(this.checkOffset(e),t=this.index+e-1;t>=this.index;t--)r=(r<<8)+this.byteAt(t);return this.index+=e,r},readString:function(e){return n.transformTo("string",this.readData(e))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var e=this.readInt(4);return new Date(Date.UTC(1980+(e>>25&127),(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(31&e)<<1))}},t.exports=i},{"../utils":32}],19:[function(e,t,r){"use strict";var n=e("./Uint8ArrayReader");function i(e){n.call(this,e)}e("../utils").inherits(i,n),i.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(e,t,r){"use strict";var n=e("./DataReader");function i(e){n.call(this,e)}e("../utils").inherits(i,n),i.prototype.byteAt=function(e){return this.data.charCodeAt(this.zero+e)},i.prototype.lastIndexOfSignature=function(e){return this.data.lastIndexOf(e)-this.zero},i.prototype.readAndCheckSignature=function(e){return e===this.readData(4)},i.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./DataReader":18}],21:[function(e,t,r){"use strict";var n=e("./ArrayReader");function i(e){n.call(this,e)}e("../utils").inherits(i,n),i.prototype.readData=function(e){if(this.checkOffset(e),0===e)return new Uint8Array(0);var t=this.data.subarray(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./ArrayReader":17}],22:[function(e,t,r){"use strict";var n=e("../utils"),i=e("../support"),o=e("./ArrayReader"),a=e("./StringReader"),s=e("./NodeBufferReader"),u=e("./Uint8ArrayReader");t.exports=function(e){var t=n.getTypeOf(e);return n.checkSupport(t),"string"!==t||i.uint8array?"nodebuffer"===t?new s(e):i.uint8array?new u(n.transformTo("uint8array",e)):new o(n.transformTo("array",e)):new a(e)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(e,t,r){"use strict";r.LOCAL_FILE_HEADER="PK",r.CENTRAL_FILE_HEADER="PK",r.CENTRAL_DIRECTORY_END="PK",r.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK",r.ZIP64_CENTRAL_DIRECTORY_END="PK",r.DATA_DESCRIPTOR="PK\b"},{}],24:[function(e,t,r){"use strict";var n=e("./GenericWorker"),i=e("../utils");function o(e){n.call(this,"ConvertWorker to "+e),this.destType=e}i.inherits(o,n),o.prototype.processChunk=function(e){this.push({data:i.transformTo(this.destType,e.data),meta:e.meta})},t.exports=o},{"../utils":32,"./GenericWorker":28}],25:[function(e,t,r){"use strict";var n=e("./GenericWorker"),i=e("../crc32");function o(){n.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}e("../utils").inherits(o,n),o.prototype.processChunk=function(e){this.streamInfo.crc32=i(e.data,this.streamInfo.crc32||0),this.push(e)},t.exports=o},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(e,t,r){"use strict";var n=e("../utils"),i=e("./GenericWorker");function o(e){i.call(this,"DataLengthProbe for "+e),this.propName=e,this.withStreamInfo(e,0)}n.inherits(o,i),o.prototype.processChunk=function(e){if(e){var t=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=t+e.data.length}i.prototype.processChunk.call(this,e)},t.exports=o},{"../utils":32,"./GenericWorker":28}],27:[function(e,t,r){"use strict";var n=e("../utils"),i=e("./GenericWorker");function o(e){i.call(this,"DataWorker");var t=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,e.then(function(e){t.dataIsReady=!0,t.data=e,t.max=e&&e.length||0,t.type=n.getTypeOf(e),t.isPaused||t._tickAndRepeat()},function(e){t.error(e)})}n.inherits(o,i),o.prototype.cleanUp=function(){i.prototype.cleanUp.call(this),this.data=null},o.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,n.delay(this._tickAndRepeat,[],this)),!0)},o.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(n.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},o.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var e=null,t=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":e=this.data.substring(this.index,t);break;case"uint8array":e=this.data.subarray(this.index,t);break;case"array":case"nodebuffer":e=this.data.slice(this.index,t)}return this.index=t,this.push({data:e,meta:{percent:this.max?this.index/this.max*100:0}})},t.exports=o},{"../utils":32,"./GenericWorker":28}],28:[function(e,t,r){"use strict";function n(e){this.name=e||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}n.prototype={push:function(e){this.emit("data",e)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(e){this.emit("error",e)}return!0},error:function(e){return!this.isFinished&&(this.isPaused?this.generatedError=e:(this.isFinished=!0,this.emit("error",e),this.previous&&this.previous.error(e),this.cleanUp()),!0)},on:function(e,t){return this._listeners[e].push(t),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(e,t){if(this._listeners[e])for(var r=0;r<this._listeners[e].length;r++)this._listeners[e][r].call(this,t)},pipe:function(e){return e.registerPrevious(this)},registerPrevious:function(e){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=e.streamInfo,this.mergeStreamInfo(),this.previous=e;var t=this;return e.on("data",function(e){t.processChunk(e)}),e.on("end",function(){t.end()}),e.on("error",function(e){t.error(e)}),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var e=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),e=!0),this.previous&&this.previous.resume(),!e},flush:function(){},processChunk:function(e){this.push(e)},withStreamInfo:function(e,t){return this.extraStreamInfo[e]=t,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var e in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,e)&&(this.streamInfo[e]=this.extraStreamInfo[e])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var e="Worker "+this.name;return this.previous?this.previous+" -> "+e:e}},t.exports=n},{}],29:[function(e,r,n){"use strict";var i=e("../utils"),o=e("./ConvertWorker"),a=e("./GenericWorker"),s=e("../base64"),u=e("../support"),c=e("../external"),f=null;if(u.nodestream)try{f=e("../nodejs/NodejsStreamOutputAdapter")}catch(e){}function l(e,r){return new c.Promise(function(n,o){var a=[],u=e._internalType,c=e._outputType,f=e._mimeType;e.on("data",function(e,t){a.push(e),r&&r(t)}).on("error",function(e){a=[],o(e)}).on("end",function(){try{var e=function(e,t,r){switch(e){case"blob":return i.newBlob(i.transformTo("arraybuffer",t),r);case"base64":return s.encode(t);default:return i.transformTo(e,t)}}(c,function(e,r){var n,i=0,o=null,a=0;for(n=0;n<r.length;n++)a+=r[n].length;switch(e){case"string":return r.join("");case"array":return Array.prototype.concat.apply([],r);case"uint8array":for(o=new Uint8Array(a),n=0;n<r.length;n++)o.set(r[n],i),i+=r[n].length;return o;case"nodebuffer":return t.concat(r);default:throw new Error("concat : unsupported type '"+e+"'")}}(u,a),f);n(e)}catch(e){o(e)}a=[]}).resume()})}function p(e,t,r){var n=t;switch(t){case"blob":case"arraybuffer":n="uint8array";break;case"base64":n="string"}try{this._internalType=n,this._outputType=t,this._mimeType=r,i.checkSupport(n),this._worker=e.pipe(new o(n)),e.lock()}catch(e){this._worker=new a("error"),this._worker.error(e)}}p.prototype={accumulate:function(e){return l(this,e)},on:function(e,t){var r=this;return"data"===e?this._worker.on(e,function(e){t.call(r,e.data,e.meta)}):this._worker.on(e,function(){i.delay(t,arguments,r)}),this},resume:function(){return i.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(e){if(i.checkSupport("nodestream"),"nodebuffer"!==this._outputType)throw new Error(this._outputType+" is not supported by this method");return new f(this,{objectMode:"nodebuffer"!==this._outputType},e)}},r.exports=p},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(e,r,n){"use strict";if(n.base64=!0,n.array=!0,n.string=!0,n.arraybuffer="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array,n.nodebuffer=void 0!==t,n.uint8array="undefined"!=typeof Uint8Array,"undefined"==typeof ArrayBuffer)n.blob=!1;else{var i=new ArrayBuffer(0);try{n.blob=0===new Blob([i],{type:"application/zip"}).size}catch(e){try{var o=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);o.append(i),n.blob=0===o.getBlob("application/zip").size}catch(e){n.blob=!1}}}try{n.nodestream=!!e("readable-stream").Readable}catch(e){n.nodestream=!1}},{"readable-stream":16}],31:[function(e,t,r){"use strict";for(var n=e("./utils"),i=e("./support"),o=e("./nodejsUtils"),a=e("./stream/GenericWorker"),s=new Array(256),u=0;u<256;u++)s[u]=252<=u?6:248<=u?5:240<=u?4:224<=u?3:192<=u?2:1;function c(){a.call(this,"utf-8 decode"),this.leftOver=null}function f(){a.call(this,"utf-8 encode")}s[254]=s[254]=1,r.utf8encode=function(e){return i.nodebuffer?o.newBufferFrom(e,"utf-8"):function(e){var t,r,n,o,a,s=e.length,u=0;for(o=0;o<s;o++)55296==(64512&(r=e.charCodeAt(o)))&&o+1<s&&56320==(64512&(n=e.charCodeAt(o+1)))&&(r=65536+(r-55296<<10)+(n-56320),o++),u+=r<128?1:r<2048?2:r<65536?3:4;for(t=i.uint8array?new Uint8Array(u):new Array(u),o=a=0;a<u;o++)55296==(64512&(r=e.charCodeAt(o)))&&o+1<s&&56320==(64512&(n=e.charCodeAt(o+1)))&&(r=65536+(r-55296<<10)+(n-56320),o++),r<128?t[a++]=r:(r<2048?t[a++]=192|r>>>6:(r<65536?t[a++]=224|r>>>12:(t[a++]=240|r>>>18,t[a++]=128|r>>>12&63),t[a++]=128|r>>>6&63),t[a++]=128|63&r);return t}(e)},r.utf8decode=function(e){return i.nodebuffer?n.transformTo("nodebuffer",e).toString("utf-8"):function(e){var t,r,i,o,a=e.length,u=new Array(2*a);for(t=r=0;t<a;)if((i=e[t++])<128)u[r++]=i;else if(4<(o=s[i]))u[r++]=65533,t+=o-1;else{for(i&=2===o?31:3===o?15:7;1<o&&t<a;)i=i<<6|63&e[t++],o--;1<o?u[r++]=65533:i<65536?u[r++]=i:(i-=65536,u[r++]=55296|i>>10&1023,u[r++]=56320|1023&i)}return u.length!==r&&(u.subarray?u=u.subarray(0,r):u.length=r),n.applyFromCharCode(u)}(e=n.transformTo(i.uint8array?"uint8array":"array",e))},n.inherits(c,a),c.prototype.processChunk=function(e){var t=n.transformTo(i.uint8array?"uint8array":"array",e.data);if(this.leftOver&&this.leftOver.length){if(i.uint8array){var o=t;(t=new Uint8Array(o.length+this.leftOver.length)).set(this.leftOver,0),t.set(o,this.leftOver.length)}else t=this.leftOver.concat(t);this.leftOver=null}var a=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;0<=r&&128==(192&e[r]);)r--;return r<0||0===r?t:r+s[e[r]]>t?r:t}(t),u=t;a!==t.length&&(i.uint8array?(u=t.subarray(0,a),this.leftOver=t.subarray(a,t.length)):(u=t.slice(0,a),this.leftOver=t.slice(a,t.length))),this.push({data:r.utf8decode(u),meta:e.meta})},c.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:r.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},r.Utf8DecodeWorker=c,n.inherits(f,a),f.prototype.processChunk=function(e){this.push({data:r.utf8encode(e.data),meta:e.meta})},r.Utf8EncodeWorker=f},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(e,t,n){"use strict";var i=e("./support"),o=e("./base64"),a=e("./nodejsUtils"),s=e("./external");function u(e){return e}function c(e,t){for(var r=0;r<e.length;++r)t[r]=255&e.charCodeAt(r);return t}e("setimmediate"),n.newBlob=function(e,t){n.checkSupport("blob");try{return new Blob([e],{type:t})}catch(n){try{var r=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return r.append(e),r.getBlob(t)}catch(e){throw new Error("Bug : can't construct the Blob.")}}};var f={stringifyByChunk:function(e,t,r){var n=[],i=0,o=e.length;if(o<=r)return String.fromCharCode.apply(null,e);for(;i<o;)"array"===t||"nodebuffer"===t?n.push(String.fromCharCode.apply(null,e.slice(i,Math.min(i+r,o)))):n.push(String.fromCharCode.apply(null,e.subarray(i,Math.min(i+r,o)))),i+=r;return n.join("")},stringifyByChar:function(e){for(var t="",r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t},applyCanBeUsed:{uint8array:function(){try{return i.uint8array&&1===String.fromCharCode.apply(null,new Uint8Array(1)).length}catch(e){return!1}}(),nodebuffer:function(){try{return i.nodebuffer&&1===String.fromCharCode.apply(null,a.allocBuffer(1)).length}catch(e){return!1}}()}};function l(e){var t=65536,r=n.getTypeOf(e),i=!0;if("uint8array"===r?i=f.applyCanBeUsed.uint8array:"nodebuffer"===r&&(i=f.applyCanBeUsed.nodebuffer),i)for(;1<t;)try{return f.stringifyByChunk(e,r,t)}catch(e){t=Math.floor(t/2)}return f.stringifyByChar(e)}function p(e,t){for(var r=0;r<e.length;r++)t[r]=e[r];return t}n.applyFromCharCode=l;var h={};h.string={string:u,array:function(e){return c(e,new Array(e.length))},arraybuffer:function(e){return h.string.uint8array(e).buffer},uint8array:function(e){return c(e,new Uint8Array(e.length))},nodebuffer:function(e){return c(e,a.allocBuffer(e.length))}},h.array={string:l,array:u,arraybuffer:function(e){return new Uint8Array(e).buffer},uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return a.newBufferFrom(e)}},h.arraybuffer={string:function(e){return l(new Uint8Array(e))},array:function(e){return p(new Uint8Array(e),new Array(e.byteLength))},arraybuffer:u,uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return a.newBufferFrom(new Uint8Array(e))}},h.uint8array={string:l,array:function(e){return p(e,new Array(e.length))},arraybuffer:function(e){return e.buffer},uint8array:u,nodebuffer:function(e){return a.newBufferFrom(e)}},h.nodebuffer={string:l,array:function(e){return p(e,new Array(e.length))},arraybuffer:function(e){return h.nodebuffer.uint8array(e).buffer},uint8array:function(e){return p(e,new Uint8Array(e.length))},nodebuffer:u},n.transformTo=function(e,t){if(t=t||"",!e)return t;n.checkSupport(e);var r=n.getTypeOf(t);return h[r][e](t)},n.resolve=function(e){for(var t=e.split("/"),r=[],n=0;n<t.length;n++){var i=t[n];"."===i||""===i&&0!==n&&n!==t.length-1||(".."===i?r.pop():r.push(i))}return r.join("/")},n.getTypeOf=function(e){return"string"==typeof e?"string":"[object Array]"===Object.prototype.toString.call(e)?"array":i.nodebuffer&&a.isBuffer(e)?"nodebuffer":i.uint8array&&e instanceof Uint8Array?"uint8array":i.arraybuffer&&e instanceof ArrayBuffer?"arraybuffer":void 0},n.checkSupport=function(e){if(!i[e.toLowerCase()])throw new Error(e+" is not supported by this platform")},n.MAX_VALUE_16BITS=65535,n.MAX_VALUE_32BITS=-1,n.pretty=function(e){var t,r,n="";for(r=0;r<(e||"").length;r++)n+="\\x"+((t=e.charCodeAt(r))<16?"0":"")+t.toString(16).toUpperCase();return n},n.delay=function(e,t,n){r(function(){e.apply(n||null,t||[])})},n.inherits=function(e,t){function r(){}r.prototype=t.prototype,e.prototype=new r},n.extend=function(){var e,t,r={};for(e=0;e<arguments.length;e++)for(t in arguments[e])Object.prototype.hasOwnProperty.call(arguments[e],t)&&void 0===r[t]&&(r[t]=arguments[e][t]);return r},n.prepareContent=function(e,t,r,a,u){return s.Promise.resolve(t).then(function(e){return i.blob&&(e instanceof Blob||-1!==["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(e)))&&"undefined"!=typeof FileReader?new s.Promise(function(t,r){var n=new FileReader;n.onload=function(e){t(e.target.result)},n.onerror=function(e){r(e.target.error)},n.readAsArrayBuffer(e)}):e}).then(function(t){var f=n.getTypeOf(t);return f?("arraybuffer"===f?t=n.transformTo("uint8array",t):"string"===f&&(u?t=o.decode(t):r&&!0!==a&&(t=function(e){return c(e,i.uint8array?new Uint8Array(e.length):new Array(e.length))}(t))),t):s.Promise.reject(new Error("Can't read the data of '"+e+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(e,t,r){"use strict";var n=e("./reader/readerFor"),i=e("./utils"),o=e("./signature"),a=e("./zipEntry"),s=e("./support");function u(e){this.files=[],this.loadOptions=e}u.prototype={checkSignature:function(e){if(!this.reader.readAndCheckSignature(e)){this.reader.index-=4;var t=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+i.pretty(t)+", expected "+i.pretty(e)+")")}},isSignature:function(e,t){var r=this.reader.index;this.reader.setIndex(e);var n=this.reader.readString(4)===t;return this.reader.setIndex(r),n},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var e=this.reader.readData(this.zipCommentLength),t=s.uint8array?"uint8array":"array",r=i.transformTo(t,e);this.zipComment=this.loadOptions.decodeFileName(r)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var e,t,r,n=this.zip64EndOfCentralSize-44;0<n;)e=this.reader.readInt(2),t=this.reader.readInt(4),r=this.reader.readData(t),this.zip64ExtensibleData[e]={id:e,length:t,value:r}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var e,t;for(e=0;e<this.files.length;e++)t=this.files[e],this.reader.setIndex(t.localHeaderOffset),this.checkSignature(o.LOCAL_FILE_HEADER),t.readLocalPart(this.reader),t.handleUTF8(),t.processAttributes()},readCentralDir:function(){var e;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(o.CENTRAL_FILE_HEADER);)(e=new a({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(e);if(this.centralDirRecords!==this.files.length&&0!==this.centralDirRecords&&0===this.files.length)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var e=this.reader.lastIndexOfSignature(o.CENTRAL_DIRECTORY_END);if(e<0)throw this.isSignature(0,o.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(e);var t=e;if(this.checkSignature(o.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===i.MAX_VALUE_16BITS||this.diskWithCentralDirStart===i.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===i.MAX_VALUE_16BITS||this.centralDirRecords===i.MAX_VALUE_16BITS||this.centralDirSize===i.MAX_VALUE_32BITS||this.centralDirOffset===i.MAX_VALUE_32BITS){if(this.zip64=!0,(e=this.reader.lastIndexOfSignature(o.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(e),this.checkSignature(o.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,o.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(o.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(o.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var r=this.centralDirOffset+this.centralDirSize;this.zip64&&(r+=20,r+=12+this.zip64EndOfCentralSize);var n=t-r;if(0<n)this.isSignature(t,o.CENTRAL_FILE_HEADER)||(this.reader.zero=n);else if(n<0)throw new Error("Corrupted zip: missing "+Math.abs(n)+" bytes.")},prepareReader:function(e){this.reader=n(e)},load:function(e){this.prepareReader(e),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},t.exports=u},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(e,t,r){"use strict";var n=e("./reader/readerFor"),i=e("./utils"),o=e("./compressedObject"),a=e("./crc32"),s=e("./utf8"),u=e("./compressions"),c=e("./support");function f(e,t){this.options=e,this.loadOptions=t}f.prototype={isEncrypted:function(){return!(1&~this.bitFlag)},useUTF8:function(){return!(2048&~this.bitFlag)},readLocalPart:function(e){var t,r;if(e.skip(22),this.fileNameLength=e.readInt(2),r=e.readInt(2),this.fileName=e.readData(this.fileNameLength),e.skip(r),-1===this.compressedSize||-1===this.uncompressedSize)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(null===(t=function(e){for(var t in u)if(Object.prototype.hasOwnProperty.call(u,t)&&u[t].magic===e)return u[t];return null}(this.compressionMethod)))throw new Error("Corrupted zip : compression "+i.pretty(this.compressionMethod)+" unknown (inner file : "+i.transformTo("string",this.fileName)+")");this.decompressed=new o(this.compressedSize,this.uncompressedSize,this.crc32,t,e.readData(this.compressedSize))},readCentralPart:function(e){this.versionMadeBy=e.readInt(2),e.skip(2),this.bitFlag=e.readInt(2),this.compressionMethod=e.readString(2),this.date=e.readDate(),this.crc32=e.readInt(4),this.compressedSize=e.readInt(4),this.uncompressedSize=e.readInt(4);var t=e.readInt(2);if(this.extraFieldsLength=e.readInt(2),this.fileCommentLength=e.readInt(2),this.diskNumberStart=e.readInt(2),this.internalFileAttributes=e.readInt(2),this.externalFileAttributes=e.readInt(4),this.localHeaderOffset=e.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");e.skip(t),this.readExtraFields(e),this.parseZIP64ExtraField(e),this.fileComment=e.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var e=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),0==e&&(this.dosPermissions=63&this.externalFileAttributes),3==e&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var e=n(this.extraFields[1].value);this.uncompressedSize===i.MAX_VALUE_32BITS&&(this.uncompressedSize=e.readInt(8)),this.compressedSize===i.MAX_VALUE_32BITS&&(this.compressedSize=e.readInt(8)),this.localHeaderOffset===i.MAX_VALUE_32BITS&&(this.localHeaderOffset=e.readInt(8)),this.diskNumberStart===i.MAX_VALUE_32BITS&&(this.diskNumberStart=e.readInt(4))}},readExtraFields:function(e){var t,r,n,i=e.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});e.index+4<i;)t=e.readInt(2),r=e.readInt(2),n=e.readData(r),this.extraFields[t]={id:t,length:r,value:n};e.setIndex(i)},handleUTF8:function(){var e=c.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=s.utf8decode(this.fileName),this.fileCommentStr=s.utf8decode(this.fileComment);else{var t=this.findExtraFieldUnicodePath();if(null!==t)this.fileNameStr=t;else{var r=i.transformTo(e,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(r)}var n=this.findExtraFieldUnicodeComment();if(null!==n)this.fileCommentStr=n;else{var o=i.transformTo(e,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(o)}}},findExtraFieldUnicodePath:function(){var e=this.extraFields[28789];if(e){var t=n(e.value);return 1!==t.readInt(1)||a(this.fileName)!==t.readInt(4)?null:s.utf8decode(t.readData(e.length-5))}return null},findExtraFieldUnicodeComment:function(){var e=this.extraFields[25461];if(e){var t=n(e.value);return 1!==t.readInt(1)||a(this.fileComment)!==t.readInt(4)?null:s.utf8decode(t.readData(e.length-5))}return null}},t.exports=f},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(e,t,r){"use strict";function n(e,t,r){this.name=e,this.dir=r.dir,this.date=r.date,this.comment=r.comment,this.unixPermissions=r.unixPermissions,this.dosPermissions=r.dosPermissions,this._data=t,this._dataBinary=r.binary,this.options={compression:r.compression,compressionOptions:r.compressionOptions}}var i=e("./stream/StreamHelper"),o=e("./stream/DataWorker"),a=e("./utf8"),s=e("./compressedObject"),u=e("./stream/GenericWorker");n.prototype={internalStream:function(e){var t=null,r="string";try{if(!e)throw new Error("No output type specified.");var n="string"===(r=e.toLowerCase())||"text"===r;"binarystring"!==r&&"text"!==r||(r="string"),t=this._decompressWorker();var o=!this._dataBinary;o&&!n&&(t=t.pipe(new a.Utf8EncodeWorker)),!o&&n&&(t=t.pipe(new a.Utf8DecodeWorker))}catch(e){(t=new u("error")).error(e)}return new i(t,r,"")},async:function(e,t){return this.internalStream(e).accumulate(t)},nodeStream:function(e,t){return this.internalStream(e||"nodebuffer").toNodejsStream(t)},_compressWorker:function(e,t){if(this._data instanceof s&&this._data.compression.magic===e.magic)return this._data.getCompressedWorker();var r=this._decompressWorker();return this._dataBinary||(r=r.pipe(new a.Utf8EncodeWorker)),s.createWorkerFrom(r,e,t)},_decompressWorker:function(){return this._data instanceof s?this._data.getContentWorker():this._data instanceof u?this._data:new o(this._data)}};for(var c=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],f=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},l=0;l<c.length;l++)n.prototype[c[l]]=f;t.exports=n},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(e,t,r){(function(e){"use strict";var r,n,i=e.MutationObserver||e.WebKitMutationObserver;if(i){var o=0,a=new i(f),s=e.document.createTextNode("");a.observe(s,{characterData:!0}),r=function(){s.data=o=++o%2}}else if(e.setImmediate||void 0===e.MessageChannel)r="document"in e&&"onreadystatechange"in e.document.createElement("script")?function(){var t=e.document.createElement("script");t.onreadystatechange=function(){f(),t.onreadystatechange=null,t.parentNode.removeChild(t),t=null},e.document.documentElement.appendChild(t)}:function(){setTimeout(f,0)};else{var u=new e.MessageChannel;u.port1.onmessage=f,r=function(){u.port2.postMessage(0)}}var c=[];function f(){var e,t;n=!0;for(var r=c.length;r;){for(t=c,c=[],e=-1;++e<r;)t[e]();r=c.length}n=!1}t.exports=function(e){1!==c.push(e)||n||r()}}).call(this,void 0!==n?n:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],37:[function(e,t,r){"use strict";var n=e("immediate");function i(){}var o={},a=["REJECTED"],s=["FULFILLED"],u=["PENDING"];function c(e){if("function"!=typeof e)throw new TypeError("resolver must be a function");this.state=u,this.queue=[],this.outcome=void 0,e!==i&&h(this,e)}function f(e,t,r){this.promise=e,"function"==typeof t&&(this.onFulfilled=t,this.callFulfilled=this.otherCallFulfilled),"function"==typeof r&&(this.onRejected=r,this.callRejected=this.otherCallRejected)}function l(e,t,r){n(function(){var n;try{n=t(r)}catch(n){return o.reject(e,n)}n===e?o.reject(e,new TypeError("Cannot resolve promise with itself")):o.resolve(e,n)})}function p(e){var t=e&&e.then;if(e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof t)return function(){t.apply(e,arguments)}}function h(e,t){var r=!1;function n(t){r||(r=!0,o.reject(e,t))}function i(t){r||(r=!0,o.resolve(e,t))}var a=d(function(){t(i,n)});"error"===a.status&&n(a.value)}function d(e,t){var r={};try{r.value=e(t),r.status="success"}catch(e){r.status="error",r.value=e}return r}(t.exports=c).prototype.finally=function(e){if("function"!=typeof e)return this;var t=this.constructor;return this.then(function(r){return t.resolve(e()).then(function(){return r})},function(r){return t.resolve(e()).then(function(){throw r})})},c.prototype.catch=function(e){return this.then(null,e)},c.prototype.then=function(e,t){if("function"!=typeof e&&this.state===s||"function"!=typeof t&&this.state===a)return this;var r=new this.constructor(i);return this.state!==u?l(r,this.state===s?e:t,this.outcome):this.queue.push(new f(r,e,t)),r},f.prototype.callFulfilled=function(e){o.resolve(this.promise,e)},f.prototype.otherCallFulfilled=function(e){l(this.promise,this.onFulfilled,e)},f.prototype.callRejected=function(e){o.reject(this.promise,e)},f.prototype.otherCallRejected=function(e){l(this.promise,this.onRejected,e)},o.resolve=function(e,t){var r=d(p,t);if("error"===r.status)return o.reject(e,r.value);var n=r.value;if(n)h(e,n);else{e.state=s,e.outcome=t;for(var i=-1,a=e.queue.length;++i<a;)e.queue[i].callFulfilled(t)}return e},o.reject=function(e,t){e.state=a,e.outcome=t;for(var r=-1,n=e.queue.length;++r<n;)e.queue[r].callRejected(t);return e},c.resolve=function(e){return e instanceof this?e:o.resolve(new this(i),e)},c.reject=function(e){var t=new this(i);return o.reject(t,e)},c.all=function(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var r=e.length,n=!1;if(!r)return this.resolve([]);for(var a=new Array(r),s=0,u=-1,c=new this(i);++u<r;)f(e[u],u);return c;function f(e,i){t.resolve(e).then(function(e){a[i]=e,++s!==r||n||(n=!0,o.resolve(c,a))},function(e){n||(n=!0,o.reject(c,e))})}},c.race=function(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var r=e.length,n=!1;if(!r)return this.resolve([]);for(var a=-1,s=new this(i),u;++a<r;)u=e[a],t.resolve(u).then(function(e){n||(n=!0,o.resolve(s,e))},function(e){n||(n=!0,o.reject(s,e))});return s}},{immediate:36}],38:[function(e,t,r){"use strict";var n={};(0,e("./lib/utils/common").assign)(n,e("./lib/deflate"),e("./lib/inflate"),e("./lib/zlib/constants")),t.exports=n},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(e,t,r){"use strict";var n=e("./zlib/deflate"),i=e("./utils/common"),o=e("./utils/strings"),a=e("./zlib/messages"),s=e("./zlib/zstream"),u=Object.prototype.toString,c=0,f=-1,l=0,p=8;function h(e){if(!(this instanceof h))return new h(e);this.options=i.assign({level:f,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,to:""},e||{});var t=this.options;t.raw&&0<t.windowBits?t.windowBits=-t.windowBits:t.gzip&&0<t.windowBits&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new s,this.strm.avail_out=0;var r=n.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(0!==r)throw new Error(a[r]);if(t.header&&n.deflateSetHeader(this.strm,t.header),t.dictionary){var c;if(c="string"==typeof t.dictionary?o.string2buf(t.dictionary):"[object ArrayBuffer]"===u.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,0!==(r=n.deflateSetDictionary(this.strm,c)))throw new Error(a[r]);this._dict_set=!0}}function d(e,t){var r=new h(t);if(r.push(e,!0),r.err)throw r.msg||a[r.err];return r.result}h.prototype.push=function(e,t){var r,a,s=this.strm,c=this.options.chunkSize;if(this.ended)return!1;a=t===~~t?t:!0===t?4:0,"string"==typeof e?s.input=o.string2buf(e):"[object ArrayBuffer]"===u.call(e)?s.input=new Uint8Array(e):s.input=e,s.next_in=0,s.avail_in=s.input.length;do{if(0===s.avail_out&&(s.output=new i.Buf8(c),s.next_out=0,s.avail_out=c),1!==(r=n.deflate(s,a))&&0!==r)return this.onEnd(r),!(this.ended=!0);0!==s.avail_out&&(0!==s.avail_in||4!==a&&2!==a)||("string"===this.options.to?this.onData(o.buf2binstring(i.shrinkBuf(s.output,s.next_out))):this.onData(i.shrinkBuf(s.output,s.next_out)))}while((0<s.avail_in||0===s.avail_out)&&1!==r);return 4===a?(r=n.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,0===r):2!==a||(this.onEnd(0),!(s.avail_out=0))},h.prototype.onData=function(e){this.chunks.push(e)},h.prototype.onEnd=function(e){0===e&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},r.Deflate=h,r.deflate=d,r.deflateRaw=function(e,t){return(t=t||{}).raw=!0,d(e,t)},r.gzip=function(e,t){return(t=t||{}).gzip=!0,d(e,t)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(e,t,r){"use strict";var n=e("./zlib/inflate"),i=e("./utils/common"),o=e("./utils/strings"),a=e("./zlib/constants"),s=e("./zlib/messages"),u=e("./zlib/zstream"),c=e("./zlib/gzheader"),f=Object.prototype.toString;function l(e){if(!(this instanceof l))return new l(e);this.options=i.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&0<=t.windowBits&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(0<=t.windowBits&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),15<t.windowBits&&t.windowBits<48&&!(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new u,this.strm.avail_out=0;var r=n.inflateInit2(this.strm,t.windowBits);if(r!==a.Z_OK)throw new Error(s[r]);this.header=new c,n.inflateGetHeader(this.strm,this.header)}function p(e,t){var r=new l(t);if(r.push(e,!0),r.err)throw r.msg||s[r.err];return r.result}l.prototype.push=function(e,t){var r,s,u,c,l,p,h=this.strm,d=this.options.chunkSize,y=this.options.dictionary,g=!1;if(this.ended)return!1;s=t===~~t?t:!0===t?a.Z_FINISH:a.Z_NO_FLUSH,"string"==typeof e?h.input=o.binstring2buf(e):"[object ArrayBuffer]"===f.call(e)?h.input=new Uint8Array(e):h.input=e,h.next_in=0,h.avail_in=h.input.length;do{if(0===h.avail_out&&(h.output=new i.Buf8(d),h.next_out=0,h.avail_out=d),(r=n.inflate(h,a.Z_NO_FLUSH))===a.Z_NEED_DICT&&y&&(p="string"==typeof y?o.string2buf(y):"[object ArrayBuffer]"===f.call(y)?new Uint8Array(y):y,r=n.inflateSetDictionary(this.strm,p)),r===a.Z_BUF_ERROR&&!0===g&&(r=a.Z_OK,g=!1),r!==a.Z_STREAM_END&&r!==a.Z_OK)return this.onEnd(r),!(this.ended=!0);h.next_out&&(0!==h.avail_out&&r!==a.Z_STREAM_END&&(0!==h.avail_in||s!==a.Z_FINISH&&s!==a.Z_SYNC_FLUSH)||("string"===this.options.to?(u=o.utf8border(h.output,h.next_out),c=h.next_out-u,l=o.buf2string(h.output,u),h.next_out=c,h.avail_out=d-c,c&&i.arraySet(h.output,h.output,u,c,0),this.onData(l)):this.onData(i.shrinkBuf(h.output,h.next_out)))),0===h.avail_in&&0===h.avail_out&&(g=!0)}while((0<h.avail_in||0===h.avail_out)&&r!==a.Z_STREAM_END);return r===a.Z_STREAM_END&&(s=a.Z_FINISH),s===a.Z_FINISH?(r=n.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===a.Z_OK):s!==a.Z_SYNC_FLUSH||(this.onEnd(a.Z_OK),!(h.avail_out=0))},l.prototype.onData=function(e){this.chunks.push(e)},l.prototype.onEnd=function(e){e===a.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},r.Inflate=l,r.inflate=p,r.inflateRaw=function(e,t){return(t=t||{}).raw=!0,p(e,t)},r.ungzip=p},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(e,t,r){"use strict";var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;r.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var r=t.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(var n in r)r.hasOwnProperty(n)&&(e[n]=r[n])}}return e},r.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var i={arraySet:function(e,t,r,n,i){if(t.subarray&&e.subarray)e.set(t.subarray(r,r+n),i);else for(var o=0;o<n;o++)e[i+o]=t[r+o]},flattenChunks:function(e){var t,r,n,i,o,a;for(t=n=0,r=e.length;t<r;t++)n+=e[t].length;for(a=new Uint8Array(n),t=i=0,r=e.length;t<r;t++)o=e[t],a.set(o,i),i+=o.length;return a}},o={arraySet:function(e,t,r,n,i){for(var o=0;o<n;o++)e[i+o]=t[r+o]},flattenChunks:function(e){return[].concat.apply([],e)}};r.setTyped=function(e){e?(r.Buf8=Uint8Array,r.Buf16=Uint16Array,r.Buf32=Int32Array,r.assign(r,i)):(r.Buf8=Array,r.Buf16=Array,r.Buf32=Array,r.assign(r,o))},r.setTyped(n)},{}],42:[function(e,t,r){"use strict";var n=e("./common"),i=!0,o=!0;try{String.fromCharCode.apply(null,[0])}catch(e){i=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){o=!1}for(var a=new n.Buf8(256),s=0;s<256;s++)a[s]=252<=s?6:248<=s?5:240<=s?4:224<=s?3:192<=s?2:1;function u(e,t){if(t<65537&&(e.subarray&&o||!e.subarray&&i))return String.fromCharCode.apply(null,n.shrinkBuf(e,t));for(var r="",a=0;a<t;a++)r+=String.fromCharCode(e[a]);return r}a[254]=a[254]=1,r.string2buf=function(e){var t,r,i,o,a,s=e.length,u=0;for(o=0;o<s;o++)55296==(64512&(r=e.charCodeAt(o)))&&o+1<s&&56320==(64512&(i=e.charCodeAt(o+1)))&&(r=65536+(r-55296<<10)+(i-56320),o++),u+=r<128?1:r<2048?2:r<65536?3:4;for(t=new n.Buf8(u),o=a=0;a<u;o++)55296==(64512&(r=e.charCodeAt(o)))&&o+1<s&&56320==(64512&(i=e.charCodeAt(o+1)))&&(r=65536+(r-55296<<10)+(i-56320),o++),r<128?t[a++]=r:(r<2048?t[a++]=192|r>>>6:(r<65536?t[a++]=224|r>>>12:(t[a++]=240|r>>>18,t[a++]=128|r>>>12&63),t[a++]=128|r>>>6&63),t[a++]=128|63&r);return t},r.buf2binstring=function(e){return u(e,e.length)},r.binstring2buf=function(e){for(var t=new n.Buf8(e.length),r=0,i=t.length;r<i;r++)t[r]=e.charCodeAt(r);return t},r.buf2string=function(e,t){var r,n,i,o,s=t||e.length,c=new Array(2*s);for(r=n=0;r<s;)if((i=e[r++])<128)c[n++]=i;else if(4<(o=a[i]))c[n++]=65533,r+=o-1;else{for(i&=2===o?31:3===o?15:7;1<o&&r<s;)i=i<<6|63&e[r++],o--;1<o?c[n++]=65533:i<65536?c[n++]=i:(i-=65536,c[n++]=55296|i>>10&1023,c[n++]=56320|1023&i)}return u(c,n)},r.utf8border=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;0<=r&&128==(192&e[r]);)r--;return r<0||0===r?t:r+a[e[r]]>t?r:t}},{"./common":41}],43:[function(e,t,r){"use strict";t.exports=function(e,t,r,n){for(var i=65535&e,o=e>>>16&65535,a=0;0!==r;){for(r-=a=2e3<r?2e3:r;o=o+(i=i+t[n++]|0)|0,--a;);i%=65521,o%=65521}return i|o<<16}},{}],44:[function(e,t,r){"use strict";t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(e,t,r){"use strict";var n=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();t.exports=function(e,t,r,i){var o=n,a=i+r;e^=-1;for(var s=i;s<a;s++)e=e>>>8^o[255&(e^t[s])];return-1^e}},{}],46:[function(e,t,r){"use strict";var n,i=e("../utils/common"),o=e("./trees"),a=e("./adler32"),s=e("./crc32"),u=e("./messages"),c=0,f=4,l=0,p=-2,h=-1,d=4,y=2,g=8,v=9,m=286,b=30,E=19,T=573,S=15,w=3,C=258,_=262,I=42,A=113,R=1,O=2,P=3,B=4;function k(e,t){return e.msg=u[t],t}function N(e){return(e<<1)-(4<e?9:0)}function U(e){for(var t=e.length;0<=--t;)e[t]=0}function D(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(i.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function x(e,t){o._tr_flush_block(e,0<=e.block_start?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,D(e.strm)}function L(e,t){e.pending_buf[e.pending++]=t}function j(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function M(e,t){var r,n,i=e.max_chain_length,o=e.strstart,a=e.prev_length,s=e.nice_match,u=e.strstart>e.w_size-_?e.strstart-(e.w_size-_):0,c=e.window,f=e.w_mask,l=e.prev,p=e.strstart+C,h=c[o+a-1],d=c[o+a];e.prev_length>=e.good_match&&(i>>=2),s>e.lookahead&&(s=e.lookahead);do{if(c[(r=t)+a]===d&&c[r+a-1]===h&&c[r]===c[o]&&c[++r]===c[o+1]){o+=2,r++;do{}while(c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&o<p);if(n=C-(p-o),o=p-C,a<n){if(e.match_start=t,s<=(a=n))break;h=c[o+a-1],d=c[o+a]}}}while((t=l[t&f])>u&&0!=--i);return a<=e.lookahead?a:e.lookahead}function V(e){var t,r,n,o,u,c,f,l,p,h,d=e.w_size;do{if(o=e.window_size-e.lookahead-e.strstart,e.strstart>=d+(d-_)){for(i.arraySet(e.window,e.window,d,d,0),e.match_start-=d,e.strstart-=d,e.block_start-=d,t=r=e.hash_size;n=e.head[--t],e.head[t]=d<=n?n-d:0,--r;);for(t=r=d;n=e.prev[--t],e.prev[t]=d<=n?n-d:0,--r;);o+=d}if(0===e.strm.avail_in)break;if(c=e.strm,f=e.window,l=e.strstart+e.lookahead,h=void 0,(p=o)<(h=c.avail_in)&&(h=p),r=0===h?0:(c.avail_in-=h,i.arraySet(f,c.input,c.next_in,h,l),1===c.state.wrap?c.adler=a(c.adler,f,h,l):2===c.state.wrap&&(c.adler=s(c.adler,f,h,l)),c.next_in+=h,c.total_in+=h,h),e.lookahead+=r,e.lookahead+e.insert>=3)for(u=e.strstart-e.insert,e.ins_h=e.window[u],e.ins_h=(e.ins_h<<e.hash_shift^e.window[u+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[u+3-1])&e.hash_mask,e.prev[u&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=u,u++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead<_&&0!==e.strm.avail_in)}function F(e,t){for(var r,n;;){if(e.lookahead<_){if(V(e),e.lookahead<_&&0===t)return 1;if(0===e.lookahead)break}if(r=0,e.lookahead>=3&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==r&&e.strstart-r<=e.w_size-_&&(e.match_length=M(e,r)),e.match_length>=3)if(n=o._tr_tally(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){for(e.match_length--;e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart,0!=--e.match_length;);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else n=o._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(x(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,4===t?(x(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(x(e,!1),0===e.strm.avail_out)?1:2}function K(e,t){for(var r,n,i;;){if(e.lookahead<_){if(V(e),e.lookahead<_&&0===t)return 1;if(0===e.lookahead)break}if(r=0,e.lookahead>=3&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,0!==r&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-_&&(e.match_length=M(e,r),e.match_length<=5&&(1===e.strategy||3===e.match_length&&4096<e.strstart-e.match_start)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){for(i=e.strstart+e.lookahead-3,n=o._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;++e.strstart<=i&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!=--e.prev_length;);if(e.match_available=0,e.match_length=2,e.strstart++,n&&(x(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if((n=o._tr_tally(e,0,e.window[e.strstart-1]))&&x(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(n=o._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,4===t?(x(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(x(e,!1),0===e.strm.avail_out)?1:2}function H(e,t,r,n,i){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=n,this.func=i}function q(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new i.Buf16(2*T),this.dyn_dtree=new i.Buf16(122),this.bl_tree=new i.Buf16(78),U(this.dyn_ltree),U(this.dyn_dtree),U(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new i.Buf16(16),this.heap=new i.Buf16(573),U(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new i.Buf16(573),U(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function G(e){var t;return e&&e.state?(e.total_in=e.total_out=0,e.data_type=2,(t=e.state).pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?I:A,e.adler=2===t.wrap?0:1,t.last_flush=0,o._tr_init(t),0):k(e,p)}function z(e){var t=G(e);return 0===t&&function(e){e.window_size=2*e.w_size,U(e.head),e.max_lazy_match=n[e.level].max_lazy,e.good_match=n[e.level].good_length,e.nice_match=n[e.level].nice_length,e.max_chain_length=n[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0}(e.state),t}function Y(e,t,r,n,o,a){if(!e)return p;var s=1;if(t===h&&(t=6),n<0?(s=0,n=-n):15<n&&(s=2,n-=16),o<1||9<o||8!==r||n<8||15<n||t<0||9<t||a<0||4<a)return k(e,p);8===n&&(n=9);var u=new q;return(e.state=u).strm=e,u.wrap=s,u.gzhead=null,u.w_bits=n,u.w_size=1<<u.w_bits,u.w_mask=u.w_size-1,u.hash_bits=o+7,u.hash_size=1<<u.hash_bits,u.hash_mask=u.hash_size-1,u.hash_shift=~~((u.hash_bits+3-1)/3),u.window=new i.Buf8(2*u.w_size),u.head=new i.Buf16(u.hash_size),u.prev=new i.Buf16(u.w_size),u.lit_bufsize=1<<o+6,u.pending_buf_size=4*u.lit_bufsize,u.pending_buf=new i.Buf8(u.pending_buf_size),u.d_buf=1*u.lit_bufsize,u.l_buf=3*u.lit_bufsize,u.level=t,u.strategy=a,u.method=r,z(e)}n=[new H(0,0,0,0,function(e,t){var r=65535;for(r>e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(V(e),0===e.lookahead&&0===t)return 1;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+r;if((0===e.strstart||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,x(e,!1),0===e.strm.avail_out))return 1;if(e.strstart-e.block_start>=e.w_size-_&&(x(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(x(e,!0),0===e.strm.avail_out?3:4):(e.strstart>e.block_start&&(x(e,!1),e.strm.avail_out),1)}),new H(4,4,8,4,F),new H(4,5,16,8,F),new H(4,6,32,32,F),new H(4,4,16,16,K),new H(8,16,32,32,K),new H(8,16,128,128,K),new H(8,32,128,256,K),new H(32,128,258,1024,K),new H(32,258,258,4096,K)],r.deflateInit=function(e,t){return Y(e,t,8,15,8,0)},r.deflateInit2=Y,r.deflateReset=z,r.deflateResetKeep=G,r.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?p:(e.state.gzhead=t,0):p},r.deflate=function(e,t){var r,i,a,u;if(!e||!e.state||5<t||t<0)return e?k(e,p):p;if(i=e.state,!e.output||!e.input&&0!==e.avail_in||666===i.status&&4!==t)return k(e,0===e.avail_out?-5:p);if(i.strm=e,r=i.last_flush,i.last_flush=t,i.status===I)if(2===i.wrap)e.adler=0,L(i,31),L(i,139),L(i,8),i.gzhead?(L(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),L(i,255&i.gzhead.time),L(i,i.gzhead.time>>8&255),L(i,i.gzhead.time>>16&255),L(i,i.gzhead.time>>24&255),L(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),L(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(L(i,255&i.gzhead.extra.length),L(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=s(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(L(i,0),L(i,0),L(i,0),L(i,0),L(i,0),L(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),L(i,3),i.status=A);else{var c=8+(i.w_bits-8<<4)<<8;c|=(2<=i.strategy||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(c|=32),c+=31-c%31,i.status=A,j(i,c),0!==i.strstart&&(j(i,e.adler>>>16),j(i,65535&e.adler)),e.adler=1}if(69===i.status)if(i.gzhead.extra){for(a=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),D(e),a=i.pending,i.pending!==i.pending_buf_size));)L(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(73===i.status)if(i.gzhead.name){a=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),D(e),a=i.pending,i.pending===i.pending_buf_size)){u=1;break}u=i.gzindex<i.gzhead.name.length?255&i.gzhead.name.charCodeAt(i.gzindex++):0,L(i,u)}while(0!==u);i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),0===u&&(i.gzindex=0,i.status=91)}else i.status=91;if(91===i.status)if(i.gzhead.comment){a=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),D(e),a=i.pending,i.pending===i.pending_buf_size)){u=1;break}u=i.gzindex<i.gzhead.comment.length?255&i.gzhead.comment.charCodeAt(i.gzindex++):0,L(i,u)}while(0!==u);i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),0===u&&(i.status=103)}else i.status=103;if(103===i.status&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&D(e),i.pending+2<=i.pending_buf_size&&(L(i,255&e.adler),L(i,e.adler>>8&255),e.adler=0,i.status=A)):i.status=A),0!==i.pending){if(D(e),0===e.avail_out)return i.last_flush=-1,0}else if(0===e.avail_in&&N(t)<=N(r)&&4!==t)return k(e,-5);if(666===i.status&&0!==e.avail_in)return k(e,-5);if(0!==e.avail_in||0!==i.lookahead||0!==t&&666!==i.status){var f=2===i.strategy?function(e,t){for(var r;;){if(0===e.lookahead&&(V(e),0===e.lookahead)){if(0===t)return 1;break}if(e.match_length=0,r=o._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(x(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(x(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(x(e,!1),0===e.strm.avail_out)?1:2}(i,t):3===i.strategy?function(e,t){for(var r,n,i,a,s=e.window;;){if(e.lookahead<=C){if(V(e),e.lookahead<=C&&0===t)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&0<e.strstart&&(n=s[i=e.strstart-1])===s[++i]&&n===s[++i]&&n===s[++i]){a=e.strstart+C;do{}while(n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&i<a);e.match_length=C-(a-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(r=o._tr_tally(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=o._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(x(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(x(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(x(e,!1),0===e.strm.avail_out)?1:2}(i,t):n[i.level].func(i,t);if(3!==f&&4!==f||(i.status=666),1===f||3===f)return 0===e.avail_out&&(i.last_flush=-1),0;if(2===f&&(1===t?o._tr_align(i):5!==t&&(o._tr_stored_block(i,0,0,!1),3===t&&(U(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),D(e),0===e.avail_out))return i.last_flush=-1,0}return 4!==t?0:i.wrap<=0?1:(2===i.wrap?(L(i,255&e.adler),L(i,e.adler>>8&255),L(i,e.adler>>16&255),L(i,e.adler>>24&255),L(i,255&e.total_in),L(i,e.total_in>>8&255),L(i,e.total_in>>16&255),L(i,e.total_in>>24&255)):(j(i,e.adler>>>16),j(i,65535&e.adler)),D(e),0<i.wrap&&(i.wrap=-i.wrap),0!==i.pending?0:1)},r.deflateEnd=function(e){var t;return e&&e.state?(t=e.state.status)!==I&&69!==t&&73!==t&&91!==t&&103!==t&&t!==A&&666!==t?k(e,p):(e.state=null,t===A?k(e,-3):0):p},r.deflateSetDictionary=function(e,t){var r,n,o,s,u,c,f,l,h=t.length;if(!e||!e.state)return p;if(2===(s=(r=e.state).wrap)||1===s&&r.status!==I||r.lookahead)return p;for(1===s&&(e.adler=a(e.adler,t,h,0)),r.wrap=0,h>=r.w_size&&(0===s&&(U(r.head),r.strstart=0,r.block_start=0,r.insert=0),l=new i.Buf8(r.w_size),i.arraySet(l,t,h-r.w_size,r.w_size,0),t=l,h=r.w_size),u=e.avail_in,c=e.next_in,f=e.input,e.avail_in=h,e.next_in=0,e.input=t,V(r);r.lookahead>=3;){for(n=r.strstart,o=r.lookahead-2;r.ins_h=(r.ins_h<<r.hash_shift^r.window[n+3-1])&r.hash_mask,r.prev[n&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=n,n++,--o;);r.strstart=n,r.lookahead=2,V(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=2,r.match_available=0,e.next_in=c,e.input=f,e.avail_in=u,r.wrap=s,0},r.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(e,t,r){"use strict";t.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(e,t,r){"use strict";t.exports=function(e,t){var r,n,i,o,a,s,u,c,f,l,p,h,d,y,g,v,m,b,E,T,S,w,C,_,I;r=e.state,n=e.next_in,_=e.input,i=n+(e.avail_in-5),o=e.next_out,I=e.output,a=o-(t-e.avail_out),s=o+(e.avail_out-257),u=r.dmax,c=r.wsize,f=r.whave,l=r.wnext,p=r.window,h=r.hold,d=r.bits,y=r.lencode,g=r.distcode,v=(1<<r.lenbits)-1,m=(1<<r.distbits)-1;e:do{d<15&&(h+=_[n++]<<d,d+=8,h+=_[n++]<<d,d+=8),b=y[h&v];t:for(;;){if(h>>>=E=b>>>24,d-=E,0==(E=b>>>16&255))I[o++]=65535&b;else{if(!(16&E)){if(!(64&E)){b=y[(65535&b)+(h&(1<<E)-1)];continue t}if(32&E){r.mode=12;break e}e.msg="invalid literal/length code",r.mode=30;break e}T=65535&b,(E&=15)&&(d<E&&(h+=_[n++]<<d,d+=8),T+=h&(1<<E)-1,h>>>=E,d-=E),d<15&&(h+=_[n++]<<d,d+=8,h+=_[n++]<<d,d+=8),b=g[h&m];r:for(;;){if(h>>>=E=b>>>24,d-=E,!(16&(E=b>>>16&255))){if(!(64&E)){b=g[(65535&b)+(h&(1<<E)-1)];continue r}e.msg="invalid distance code",r.mode=30;break e}if(S=65535&b,d<(E&=15)&&(h+=_[n++]<<d,(d+=8)<E&&(h+=_[n++]<<d,d+=8)),u<(S+=h&(1<<E)-1)){e.msg="invalid distance too far back",r.mode=30;break e}if(h>>>=E,d-=E,(E=o-a)<S){if(f<(E=S-E)&&r.sane){e.msg="invalid distance too far back",r.mode=30;break e}if(C=p,(w=0)===l){if(w+=c-E,E<T){for(T-=E;I[o++]=p[w++],--E;);w=o-S,C=I}}else if(l<E){if(w+=c+l-E,(E-=l)<T){for(T-=E;I[o++]=p[w++],--E;);if(w=0,l<T){for(T-=E=l;I[o++]=p[w++],--E;);w=o-S,C=I}}}else if(w+=l-E,E<T){for(T-=E;I[o++]=p[w++],--E;);w=o-S,C=I}for(;2<T;)I[o++]=C[w++],I[o++]=C[w++],I[o++]=C[w++],T-=3;T&&(I[o++]=C[w++],1<T&&(I[o++]=C[w++]))}else{for(w=o-S;I[o++]=I[w++],I[o++]=I[w++],I[o++]=I[w++],2<(T-=3););T&&(I[o++]=I[w++],1<T&&(I[o++]=I[w++]))}break}}break}}while(n<i&&o<s);n-=T=d>>3,h&=(1<<(d-=T<<3))-1,e.next_in=n,e.next_out=o,e.avail_in=n<i?i-n+5:5-(n-i),e.avail_out=o<s?s-o+257:257-(o-s),r.hold=h,r.bits=d}},{}],49:[function(e,t,r){"use strict";var n=e("../utils/common"),i=e("./adler32"),o=e("./crc32"),a=e("./inffast"),s=e("./inftrees"),u=1,c=2,f=0,l=-2,p=1,h=852,d=592;function y(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function g(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new n.Buf16(320),this.work=new n.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function v(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=1,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new n.Buf32(h),t.distcode=t.distdyn=new n.Buf32(d),t.sane=1,t.back=-1,0):l}function m(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,v(e)):l}function b(e,t){var r,n;return e&&e.state?(n=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||15<t)?l:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,m(e))):l}function E(e,t){var r,n;return e?(n=new g,(e.state=n).window=null,0!==(r=b(e,t))&&(e.state=null),r):l}var T,S,w=!0;function C(e){if(w){var t;for(T=new n.Buf32(512),S=new n.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(s(1,e.lens,0,288,T,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;s(2,e.lens,0,32,S,0,e.work,{bits:5}),w=!1}e.lencode=T,e.lenbits=9,e.distcode=S,e.distbits=5}function _(e,t,r,i){var o,a=e.state;return null===a.window&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new n.Buf8(a.wsize)),i>=a.wsize?(n.arraySet(a.window,t,r-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):(i<(o=a.wsize-a.wnext)&&(o=i),n.arraySet(a.window,t,r-i,o,a.wnext),(i-=o)?(n.arraySet(a.window,t,r-i,i,0),a.wnext=i,a.whave=a.wsize):(a.wnext+=o,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=o))),0}r.inflateReset=m,r.inflateReset2=b,r.inflateResetKeep=v,r.inflateInit=function(e){return E(e,15)},r.inflateInit2=E,r.inflate=function(e,t){var r,u,c,f,p,h,d,g,v,m,b,E,T,S,w,I,A,R,O,P,B,k,N,U,D=0,x=new n.Buf8(4),L=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return l;12===(r=e.state).mode&&(r.mode=13),p=e.next_out,c=e.output,d=e.avail_out,f=e.next_in,u=e.input,h=e.avail_in,g=r.hold,v=r.bits,m=h,b=d,k=0;e:for(;;)switch(r.mode){case 1:if(0===r.wrap){r.mode=13;break}for(;v<16;){if(0===h)break e;h--,g+=u[f++]<<v,v+=8}if(2&r.wrap&&35615===g){x[r.check=0]=255&g,x[1]=g>>>8&255,r.check=o(r.check,x,2,0),v=g=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&g)<<8)+(g>>8))%31){e.msg="incorrect header check",r.mode=30;break}if(8!=(15&g)){e.msg="unknown compression method",r.mode=30;break}if(v-=4,B=8+(15&(g>>>=4)),0===r.wbits)r.wbits=B;else if(B>r.wbits){e.msg="invalid window size",r.mode=30;break}r.dmax=1<<B,e.adler=r.check=1,r.mode=512&g?10:12,v=g=0;break;case 2:for(;v<16;){if(0===h)break e;h--,g+=u[f++]<<v,v+=8}if(r.flags=g,8!=(255&r.flags)){e.msg="unknown compression method",r.mode=30;break}if(57344&r.flags){e.msg="unknown header flags set",r.mode=30;break}r.head&&(r.head.text=g>>8&1),512&r.flags&&(x[0]=255&g,x[1]=g>>>8&255,r.check=o(r.check,x,2,0)),v=g=0,r.mode=3;case 3:for(;v<32;){if(0===h)break e;h--,g+=u[f++]<<v,v+=8}r.head&&(r.head.time=g),512&r.flags&&(x[0]=255&g,x[1]=g>>>8&255,x[2]=g>>>16&255,x[3]=g>>>24&255,r.check=o(r.check,x,4,0)),v=g=0,r.mode=4;case 4:for(;v<16;){if(0===h)break e;h--,g+=u[f++]<<v,v+=8}r.head&&(r.head.xflags=255&g,r.head.os=g>>8),512&r.flags&&(x[0]=255&g,x[1]=g>>>8&255,r.check=o(r.check,x,2,0)),v=g=0,r.mode=5;case 5:if(1024&r.flags){for(;v<16;){if(0===h)break e;h--,g+=u[f++]<<v,v+=8}r.length=g,r.head&&(r.head.extra_len=g),512&r.flags&&(x[0]=255&g,x[1]=g>>>8&255,r.check=o(r.check,x,2,0)),v=g=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&(h<(E=r.length)&&(E=h),E&&(r.head&&(B=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),n.arraySet(r.head.extra,u,f,E,B)),512&r.flags&&(r.check=o(r.check,u,E,f)),h-=E,f+=E,r.length-=E),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===h)break e;for(E=0;B=u[f+E++],r.head&&B&&r.length<65536&&(r.head.name+=String.fromCharCode(B)),B&&E<h;);if(512&r.flags&&(r.check=o(r.check,u,E,f)),h-=E,f+=E,B)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=8;case 8:if(4096&r.flags){if(0===h)break e;for(E=0;B=u[f+E++],r.head&&B&&r.length<65536&&(r.head.comment+=String.fromCharCode(B)),B&&E<h;);if(512&r.flags&&(r.check=o(r.check,u,E,f)),h-=E,f+=E,B)break e}else r.head&&(r.head.comment=null);r.mode=9;case 9:if(512&r.flags){for(;v<16;){if(0===h)break e;h--,g+=u[f++]<<v,v+=8}if(g!==(65535&r.check)){e.msg="header crc mismatch",r.mode=30;break}v=g=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=12;break;case 10:for(;v<32;){if(0===h)break e;h--,g+=u[f++]<<v,v+=8}e.adler=r.check=y(g),v=g=0,r.mode=11;case 11:if(0===r.havedict)return e.next_out=p,e.avail_out=d,e.next_in=f,e.avail_in=h,r.hold=g,r.bits=v,2;e.adler=r.check=1,r.mode=12;case 12:if(5===t||6===t)break e;case 13:if(r.last){g>>>=7&v,v-=7&v,r.mode=27;break}for(;v<3;){if(0===h)break e;h--,g+=u[f++]<<v,v+=8}switch(r.last=1&g,v-=1,3&(g>>>=1)){case 0:r.mode=14;break;case 1:if(C(r),r.mode=20,6!==t)break;g>>>=2,v-=2;break e;case 2:r.mode=17;break;case 3:e.msg="invalid block type",r.mode=30}g>>>=2,v-=2;break;case 14:for(g>>>=7&v,v-=7&v;v<32;){if(0===h)break e;h--,g+=u[f++]<<v,v+=8}if((65535&g)!=(g>>>16^65535)){e.msg="invalid stored block lengths",r.mode=30;break}if(r.length=65535&g,v=g=0,r.mode=15,6===t)break e;case 15:r.mode=16;case 16:if(E=r.length){if(h<E&&(E=h),d<E&&(E=d),0===E)break e;n.arraySet(c,u,f,E,p),h-=E,f+=E,d-=E,p+=E,r.length-=E;break}r.mode=12;break;case 17:for(;v<14;){if(0===h)break e;h--,g+=u[f++]<<v,v+=8}if(r.nlen=257+(31&g),g>>>=5,v-=5,r.ndist=1+(31&g),g>>>=5,v-=5,r.ncode=4+(15&g),g>>>=4,v-=4,286<r.nlen||30<r.ndist){e.msg="too many length or distance symbols",r.mode=30;break}r.have=0,r.mode=18;case 18:for(;r.have<r.ncode;){for(;v<3;){if(0===h)break e;h--,g+=u[f++]<<v,v+=8}r.lens[L[r.have++]]=7&g,g>>>=3,v-=3}for(;r.have<19;)r.lens[L[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,N={bits:r.lenbits},k=s(0,r.lens,0,19,r.lencode,0,r.work,N),r.lenbits=N.bits,k){e.msg="invalid code lengths set",r.mode=30;break}r.have=0,r.mode=19;case 19:for(;r.have<r.nlen+r.ndist;){for(;I=(D=r.lencode[g&(1<<r.lenbits)-1])>>>16&255,A=65535&D,!((w=D>>>24)<=v);){if(0===h)break e;h--,g+=u[f++]<<v,v+=8}if(A<16)g>>>=w,v-=w,r.lens[r.have++]=A;else{if(16===A){for(U=w+2;v<U;){if(0===h)break e;h--,g+=u[f++]<<v,v+=8}if(g>>>=w,v-=w,0===r.have){e.msg="invalid bit length repeat",r.mode=30;break}B=r.lens[r.have-1],E=3+(3&g),g>>>=2,v-=2}else if(17===A){for(U=w+3;v<U;){if(0===h)break e;h--,g+=u[f++]<<v,v+=8}v-=w,B=0,E=3+(7&(g>>>=w)),g>>>=3,v-=3}else{for(U=w+7;v<U;){if(0===h)break e;h--,g+=u[f++]<<v,v+=8}v-=w,B=0,E=11+(127&(g>>>=w)),g>>>=7,v-=7}if(r.have+E>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=30;break}for(;E--;)r.lens[r.have++]=B}}if(30===r.mode)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=30;break}if(r.lenbits=9,N={bits:r.lenbits},k=s(1,r.lens,0,r.nlen,r.lencode,0,r.work,N),r.lenbits=N.bits,k){e.msg="invalid literal/lengths set",r.mode=30;break}if(r.distbits=6,r.distcode=r.distdyn,N={bits:r.distbits},k=s(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,N),r.distbits=N.bits,k){e.msg="invalid distances set",r.mode=30;break}if(r.mode=20,6===t)break e;case 20:r.mode=21;case 21:if(6<=h&&258<=d){e.next_out=p,e.avail_out=d,e.next_in=f,e.avail_in=h,r.hold=g,r.bits=v,a(e,b),p=e.next_out,c=e.output,d=e.avail_out,f=e.next_in,u=e.input,h=e.avail_in,g=r.hold,v=r.bits,12===r.mode&&(r.back=-1);break}for(r.back=0;I=(D=r.lencode[g&(1<<r.lenbits)-1])>>>16&255,A=65535&D,!((w=D>>>24)<=v);){if(0===h)break e;h--,g+=u[f++]<<v,v+=8}if(I&&!(240&I)){for(R=w,O=I,P=A;I=(D=r.lencode[P+((g&(1<<R+O)-1)>>R)])>>>16&255,A=65535&D,!(R+(w=D>>>24)<=v);){if(0===h)break e;h--,g+=u[f++]<<v,v+=8}g>>>=R,v-=R,r.back+=R}if(g>>>=w,v-=w,r.back+=w,r.length=A,0===I){r.mode=26;break}if(32&I){r.back=-1,r.mode=12;break}if(64&I){e.msg="invalid literal/length code",r.mode=30;break}r.extra=15&I,r.mode=22;case 22:if(r.extra){for(U=r.extra;v<U;){if(0===h)break e;h--,g+=u[f++]<<v,v+=8}r.length+=g&(1<<r.extra)-1,g>>>=r.extra,v-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;I=(D=r.distcode[g&(1<<r.distbits)-1])>>>16&255,A=65535&D,!((w=D>>>24)<=v);){if(0===h)break e;h--,g+=u[f++]<<v,v+=8}if(!(240&I)){for(R=w,O=I,P=A;I=(D=r.distcode[P+((g&(1<<R+O)-1)>>R)])>>>16&255,A=65535&D,!(R+(w=D>>>24)<=v);){if(0===h)break e;h--,g+=u[f++]<<v,v+=8}g>>>=R,v-=R,r.back+=R}if(g>>>=w,v-=w,r.back+=w,64&I){e.msg="invalid distance code",r.mode=30;break}r.offset=A,r.extra=15&I,r.mode=24;case 24:if(r.extra){for(U=r.extra;v<U;){if(0===h)break e;h--,g+=u[f++]<<v,v+=8}r.offset+=g&(1<<r.extra)-1,g>>>=r.extra,v-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=30;break}r.mode=25;case 25:if(0===d)break e;if(E=b-d,r.offset>E){if((E=r.offset-E)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=30;break}T=E>r.wnext?(E-=r.wnext,r.wsize-E):r.wnext-E,E>r.length&&(E=r.length),S=r.window}else S=c,T=p-r.offset,E=r.length;for(d<E&&(E=d),d-=E,r.length-=E;c[p++]=S[T++],--E;);0===r.length&&(r.mode=21);break;case 26:if(0===d)break e;c[p++]=r.length,d--,r.mode=21;break;case 27:if(r.wrap){for(;v<32;){if(0===h)break e;h--,g|=u[f++]<<v,v+=8}if(b-=d,e.total_out+=b,r.total+=b,b&&(e.adler=r.check=r.flags?o(r.check,c,b,p-b):i(r.check,c,b,p-b)),b=d,(r.flags?g:y(g))!==r.check){e.msg="incorrect data check",r.mode=30;break}v=g=0}r.mode=28;case 28:if(r.wrap&&r.flags){for(;v<32;){if(0===h)break e;h--,g+=u[f++]<<v,v+=8}if(g!==(4294967295&r.total)){e.msg="incorrect length check",r.mode=30;break}v=g=0}r.mode=29;case 29:k=1;break e;case 30:k=-3;break e;case 31:return-4;default:return l}return e.next_out=p,e.avail_out=d,e.next_in=f,e.avail_in=h,r.hold=g,r.bits=v,(r.wsize||b!==e.avail_out&&r.mode<30&&(r.mode<27||4!==t))&&_(e,e.output,e.next_out,b-e.avail_out)?(r.mode=31,-4):(m-=e.avail_in,b-=e.avail_out,e.total_in+=m,e.total_out+=b,r.total+=b,r.wrap&&b&&(e.adler=r.check=r.flags?o(r.check,c,b,e.next_out-b):i(r.check,c,b,e.next_out-b)),e.data_type=r.bits+(r.last?64:0)+(12===r.mode?128:0)+(20===r.mode||15===r.mode?256:0),(0==m&&0===b||4===t)&&0===k&&(k=-5),k)},r.inflateEnd=function(e){if(!e||!e.state)return l;var t=e.state;return t.window&&(t.window=null),e.state=null,0},r.inflateGetHeader=function(e,t){var r;return e&&e.state&&2&(r=e.state).wrap?((r.head=t).done=!1,0):l},r.inflateSetDictionary=function(e,t){var r,n=t.length;return e&&e.state?0!==(r=e.state).wrap&&11!==r.mode?l:11===r.mode&&i(1,t,n,0)!==r.check?-3:_(e,t,n,n)?(r.mode=31,-4):(r.havedict=1,0):l},r.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(e,t,r){"use strict";var n=e("../utils/common"),i=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],o=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],a=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],s=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];t.exports=function(e,t,r,u,c,f,l,p){var h,d,y,g,v,m,b,E,T,S=p.bits,w=0,C=0,_=0,I=0,A=0,R=0,O=0,P=0,B=0,k=0,N=null,U=0,D=new n.Buf16(16),x=new n.Buf16(16),L=null,j=0;for(w=0;w<=15;w++)D[w]=0;for(C=0;C<u;C++)D[t[r+C]]++;for(A=S,I=15;1<=I&&0===D[I];I--);if(I<A&&(A=I),0===I)return c[f++]=20971520,c[f++]=20971520,p.bits=1,0;for(_=1;_<I&&0===D[_];_++);for(A<_&&(A=_),w=P=1;w<=15;w++)if(P<<=1,(P-=D[w])<0)return-1;if(0<P&&(0===e||1!==I))return-1;for(x[1]=0,w=1;w<15;w++)x[w+1]=x[w]+D[w];for(C=0;C<u;C++)0!==t[r+C]&&(l[x[t[r+C]]++]=C);if(m=0===e?(N=L=l,19):1===e?(N=i,U-=257,L=o,j-=257,256):(N=a,L=s,-1),w=_,v=f,O=C=k=0,y=-1,g=(B=1<<(R=A))-1,1===e&&852<B||2===e&&592<B)return 1;for(;;){for(b=w-O,T=l[C]<m?(E=0,l[C]):l[C]>m?(E=L[j+l[C]],N[U+l[C]]):(E=96,0),h=1<<w-O,_=d=1<<R;c[v+(k>>O)+(d-=h)]=b<<24|E<<16|T,0!==d;);for(h=1<<w-1;k&h;)h>>=1;if(0!==h?(k&=h-1,k+=h):k=0,C++,0==--D[w]){if(w===I)break;w=t[r+l[C]]}if(A<w&&(k&g)!==y){for(0===O&&(O=A),v+=_,P=1<<(R=w-O);R+O<I&&!((P-=D[R+O])<=0);)R++,P<<=1;if(B+=1<<R,1===e&&852<B||2===e&&592<B)return 1;c[y=k&g]=A<<24|R<<16|v-f}}return 0!==k&&(c[v+k]=w-O<<24|64<<16),p.bits=A,0}},{"../utils/common":41}],51:[function(e,t,r){"use strict";t.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(e,t,r){"use strict";var n=e("../utils/common"),i=0,o=1;function a(e){for(var t=e.length;0<=--t;)e[t]=0}var s=0,u=29,c=256,f=286,l=30,p=19,h=573,d=15,y=16,g=7,v=256,m=16,b=17,E=18,T=[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],S=[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],w=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],C=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],_=new Array(576);a(_);var I=new Array(60);a(I);var A=new Array(512);a(A);var R=new Array(256);a(R);var O=new Array(u);a(O);var P,B,k,N=new Array(l);function U(e,t,r,n,i){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=e&&e.length}function D(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function x(e){return e<256?A[e]:A[256+(e>>>7)]}function L(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function j(e,t,r){e.bi_valid>y-r?(e.bi_buf|=t<<e.bi_valid&65535,L(e,e.bi_buf),e.bi_buf=t>>y-e.bi_valid,e.bi_valid+=r-y):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=r)}function M(e,t,r){j(e,r[2*t],r[2*t+1])}function V(e,t){for(var r=0;r|=1&e,e>>>=1,r<<=1,0<--t;);return r>>>1}function F(e,t,r){var n,i,o=new Array(16),a=0;for(n=1;n<=d;n++)o[n]=a=a+r[n-1]<<1;for(i=0;i<=t;i++){var s=e[2*i+1];0!==s&&(e[2*i]=V(o[s]++,s))}}function K(e){var t;for(t=0;t<f;t++)e.dyn_ltree[2*t]=0;for(t=0;t<l;t++)e.dyn_dtree[2*t]=0;for(t=0;t<p;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function H(e){8<e.bi_valid?L(e,e.bi_buf):0<e.bi_valid&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function q(e,t,r,n){var i=2*t,o=2*r;return e[i]<e[o]||e[i]===e[o]&&n[t]<=n[r]}function G(e,t,r){for(var n=e.heap[r],i=r<<1;i<=e.heap_len&&(i<e.heap_len&&q(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!q(t,n,e.heap[i],e.depth));)e.heap[r]=e.heap[i],r=i,i<<=1;e.heap[r]=n}function z(e,t,r){var n,i,o,a,s=0;if(0!==e.last_lit)for(;n=e.pending_buf[e.d_buf+2*s]<<8|e.pending_buf[e.d_buf+2*s+1],i=e.pending_buf[e.l_buf+s],s++,0===n?M(e,i,t):(M(e,(o=R[i])+c+1,t),0!==(a=T[o])&&j(e,i-=O[o],a),M(e,o=x(--n),r),0!==(a=S[o])&&j(e,n-=N[o],a)),s<e.last_lit;);M(e,v,t)}function Y(e,t){var r,n,i,o=t.dyn_tree,a=t.stat_desc.static_tree,s=t.stat_desc.has_stree,u=t.stat_desc.elems,c=-1;for(e.heap_len=0,e.heap_max=h,r=0;r<u;r++)0!==o[2*r]?(e.heap[++e.heap_len]=c=r,e.depth[r]=0):o[2*r+1]=0;for(;e.heap_len<2;)o[2*(i=e.heap[++e.heap_len]=c<2?++c:0)]=1,e.depth[i]=0,e.opt_len--,s&&(e.static_len-=a[2*i+1]);for(t.max_code=c,r=e.heap_len>>1;1<=r;r--)G(e,o,r);for(i=u;r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],G(e,o,1),n=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=n,o[2*i]=o[2*r]+o[2*n],e.depth[i]=(e.depth[r]>=e.depth[n]?e.depth[r]:e.depth[n])+1,o[2*r+1]=o[2*n+1]=i,e.heap[1]=i++,G(e,o,1),2<=e.heap_len;);e.heap[--e.heap_max]=e.heap[1],function(e,t){var r,n,i,o,a,s,u=t.dyn_tree,c=t.max_code,f=t.stat_desc.static_tree,l=t.stat_desc.has_stree,p=t.stat_desc.extra_bits,y=t.stat_desc.extra_base,g=t.stat_desc.max_length,v=0;for(o=0;o<=d;o++)e.bl_count[o]=0;for(u[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;r<h;r++)g<(o=u[2*u[2*(n=e.heap[r])+1]+1]+1)&&(o=g,v++),u[2*n+1]=o,c<n||(e.bl_count[o]++,a=0,y<=n&&(a=p[n-y]),s=u[2*n],e.opt_len+=s*(o+a),l&&(e.static_len+=s*(f[2*n+1]+a)));if(0!==v){do{for(o=g-1;0===e.bl_count[o];)o--;e.bl_count[o]--,e.bl_count[o+1]+=2,e.bl_count[g]--,v-=2}while(0<v);for(o=g;0!==o;o--)for(n=e.bl_count[o];0!==n;)c<(i=e.heap[--r])||(u[2*i+1]!==o&&(e.opt_len+=(o-u[2*i+1])*u[2*i],u[2*i+1]=o),n--)}}(e,t),F(o,c,e.bl_count)}function W(e,t,r){var n,i,o=-1,a=t[1],s=0,u=7,c=4;for(0===a&&(u=138,c=3),t[2*(r+1)+1]=65535,n=0;n<=r;n++)i=a,a=t[2*(n+1)+1],++s<u&&i===a||(s<c?e.bl_tree[2*i]+=s:0!==i?(i!==o&&e.bl_tree[2*i]++,e.bl_tree[32]++):s<=10?e.bl_tree[34]++:e.bl_tree[36]++,o=i,c=(s=0)===a?(u=138,3):i===a?(u=6,3):(u=7,4))}function Q(e,t,r){var n,i,o=-1,a=t[1],s=0,u=7,c=4;for(0===a&&(u=138,c=3),n=0;n<=r;n++)if(i=a,a=t[2*(n+1)+1],!(++s<u&&i===a)){if(s<c)for(;M(e,i,e.bl_tree),0!=--s;);else 0!==i?(i!==o&&(M(e,i,e.bl_tree),s--),M(e,m,e.bl_tree),j(e,s-3,2)):s<=10?(M(e,b,e.bl_tree),j(e,s-3,3)):(M(e,E,e.bl_tree),j(e,s-11,7));o=i,c=(s=0)===a?(u=138,3):i===a?(u=6,3):(u=7,4)}}a(N);var X=!1;function Z(e,t,r,i){j(e,0+(i?1:0),3),function(e,t,r,i){H(e),L(e,r),L(e,~r),n.arraySet(e.pending_buf,e.window,t,r,e.pending),e.pending+=r}(e,t,r,!0)}r._tr_init=function(e){X||(function(){var e,t,r,n,i,o=new Array(16);for(n=r=0;n<28;n++)for(O[n]=r,e=0;e<1<<T[n];e++)R[r++]=n;for(R[r-1]=n,n=i=0;n<16;n++)for(N[n]=i,e=0;e<1<<S[n];e++)A[i++]=n;for(i>>=7;n<l;n++)for(N[n]=i<<7,e=0;e<1<<S[n]-7;e++)A[256+i++]=n;for(t=0;t<=d;t++)o[t]=0;for(e=0;e<=143;)_[2*e+1]=8,e++,o[8]++;for(;e<=255;)_[2*e+1]=9,e++,o[9]++;for(;e<=279;)_[2*e+1]=7,e++,o[7]++;for(;e<=287;)_[2*e+1]=8,e++,o[8]++;for(F(_,287,o),e=0;e<l;e++)I[2*e+1]=5,I[2*e]=V(e,5);P=new U(_,T,257,f,d),B=new U(I,S,0,l,d),k=new U(new Array(0),w,0,p,7)}(),X=!0),e.l_desc=new D(e.dyn_ltree,P),e.d_desc=new D(e.dyn_dtree,B),e.bl_desc=new D(e.bl_tree,k),e.bi_buf=0,e.bi_valid=0,K(e)},r._tr_stored_block=Z,r._tr_flush_block=function(e,t,r,n){var i,o,a=0;0<e.level?(2===e.strm.data_type&&(e.strm.data_type=function(e){var t,r=4093624447;for(t=0;t<=31;t++,r>>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<c;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0}(e)),Y(e,e.l_desc),Y(e,e.d_desc),a=function(e){var t;for(W(e,e.dyn_ltree,e.l_desc.max_code),W(e,e.dyn_dtree,e.d_desc.max_code),Y(e,e.bl_desc),t=18;3<=t&&0===e.bl_tree[2*C[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),i=e.opt_len+3+7>>>3,(o=e.static_len+3+7>>>3)<=i&&(i=o)):i=o=r+5,r+4<=i&&-1!==t?Z(e,t,r,n):4===e.strategy||o===i?(j(e,2+(n?1:0),3),z(e,_,I)):(j(e,4+(n?1:0),3),function(e,t,r,n){var i;for(j(e,t-257,5),j(e,r-1,5),j(e,n-4,4),i=0;i<n;i++)j(e,e.bl_tree[2*C[i]+1],3);Q(e,e.dyn_ltree,t-1),Q(e,e.dyn_dtree,r-1)}(e,e.l_desc.max_code+1,e.d_desc.max_code+1,a+1),z(e,e.dyn_ltree,e.dyn_dtree)),K(e),n&&H(e)},r._tr_tally=function(e,t,r){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&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(R[r]+c+1)]++,e.dyn_dtree[2*x(t)]++),e.last_lit===e.lit_bufsize-1},r._tr_align=function(e){j(e,2,3),M(e,v,_),function(e){16===e.bi_valid?(L(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):8<=e.bi_valid&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},{"../utils/common":41}],53:[function(e,t,r){"use strict";t.exports=function(){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}},{}],54:[function(e,t,r){(function(e){!function(e,t){"use strict";if(!e.setImmediate){var r,n,o,a,s=1,u={},c=!1,f=e.document,l=Object.getPrototypeOf&&Object.getPrototypeOf(e);l=l&&l.setTimeout?l:e,r="[object process]"==={}.toString.call(e.process)?function(e){i.nextTick(function(){h(e)})}:function(){if(e.postMessage&&!e.importScripts){var t=!0,r=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=r,t}}()?(a="setImmediate$"+Math.random()+"$",e.addEventListener?e.addEventListener("message",d,!1):e.attachEvent("onmessage",d),function(t){e.postMessage(a+t,"*")}):e.MessageChannel?((o=new MessageChannel).port1.onmessage=function(e){h(e.data)},function(e){o.port2.postMessage(e)}):f&&"onreadystatechange"in f.createElement("script")?(n=f.documentElement,function(e){var t=f.createElement("script");t.onreadystatechange=function(){h(e),t.onreadystatechange=null,n.removeChild(t),t=null},n.appendChild(t)}):function(e){setTimeout(h,0,e)},l.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n<t.length;n++)t[n]=arguments[n+1];var i={callback:e,args:t};return u[s]=i,r(s),s++},l.clearImmediate=p}function p(e){delete u[e]}function h(e){if(c)setTimeout(h,0,e);else{var r=u[e];if(r){c=!0;try{!function(e){var r=e.callback,n=e.args;switch(n.length){case 0:r();break;case 1:r(n[0]);break;case 2:r(n[0],n[1]);break;case 3:r(n[0],n[1],n[2]);break;default:r.apply(t,n)}}(r)}finally{p(e),c=!1}}}}function d(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(a)&&h(+t.data.slice(a.length))}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,void 0!==n?n:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[10])(10)},e.exports=a()}).call(this,r(116).Buffer,r(134).setImmediate,r(29),r(36))},function(e,t,r){"use strict";(function(e){var t="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==e&&e||{},r="URLSearchParams"in t,n="Symbol"in t&&"iterator"in Symbol,i="FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(e){return!1}}(),o="FormData"in t,a="ArrayBuffer"in t;function s(e){return e&&DataView.prototype.isPrototypeOf(e)}if(a)var u=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],c=ArrayBuffer.isView||function(e){return e&&u.indexOf(Object.prototype.toString.call(e))>-1};function f(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function l(e){return"string"!=typeof e&&(e=String(e)),e}function p(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return n&&(t[Symbol.iterator]=function(){return t}),t}function h(e){this.map={},e instanceof h?e.forEach(function(e,t){this.append(t,e)},this):Array.isArray(e)?e.forEach(function(e){if(2!=e.length)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+e.length);this.append(e[0],e[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}function d(e){if(!e._noBody)return e.bodyUsed?Promise.reject(new TypeError("Already read")):void(e.bodyUsed=!0)}function y(e){return new Promise(function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}})}function g(e){var t=new FileReader,r=y(t);return t.readAsArrayBuffer(e),r}function v(e){var t=new FileReader,r=y(t),n=/charset=([A-Za-z0-9_-]+)/.exec(e.type),i=n?n[1]:"utf-8";return t.readAsText(e,i),r}function m(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n<t.length;n++)r[n]=String.fromCharCode(t[n]);return r.join("")}function b(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function E(){return this.bodyUsed=!1,this._initBody=function(e){this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:i&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:o&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:r&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():a&&i&&s(e)?(this._bodyArrayBuffer=b(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):a&&(ArrayBuffer.prototype.isPrototypeOf(e)||c(e))?this._bodyArrayBuffer=b(e):this._bodyText=e=Object.prototype.toString.call(e):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i&&(this.blob=function(){var e=d(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer){var e=d(this);return e||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}if(i)return this.blob().then(g);throw new Error("could not read as ArrayBuffer")},this.text=function(){var e=d(this);if(e)return e;if(this._bodyBlob)return v(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(m(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},o&&(this.formData=function(){return this.text().then(C)}),this.json=function(){return this.text().then(JSON.parse)},this}h.prototype.append=function(e,t){e=f(e),t=l(t);var r=this.map[e];this.map[e]=r?r+", "+t:t},h.prototype.delete=function(e){delete this.map[f(e)]},h.prototype.get=function(e){return e=f(e),this.has(e)?this.map[e]:null},h.prototype.has=function(e){return this.map.hasOwnProperty(f(e))},h.prototype.set=function(e,t){this.map[f(e)]=l(t)},h.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},h.prototype.keys=function(){var e=[];return this.forEach(function(t,r){e.push(r)}),p(e)},h.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),p(e)},h.prototype.entries=function(){var e=[];return this.forEach(function(t,r){e.push([r,t])}),p(e)},n&&(h.prototype[Symbol.iterator]=h.prototype.entries);var T=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function S(e){var t=e.toUpperCase();return T.indexOf(t)>-1?t:e}function w(e,r){if(!(this instanceof w))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var n=(r=r||{}).body;if(e instanceof w){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,r.headers||(this.headers=new h(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,n||null==e._bodyInit||(n=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=r.credentials||this.credentials||"same-origin",!r.headers&&this.headers||(this.headers=new h(r.headers)),this.method=S(r.method||this.method||"GET"),this.mode=r.mode||this.mode||null,this.signal=r.signal||this.signal||function(){var e;if("AbortController"in t)return(new AbortController).signal}(),this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(n),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==r.cache&&"no-cache"!==r.cache)){var i=/([?&])_=[^&]*/;if(i.test(this.url))this.url=this.url.replace(i,"$1_="+(new Date).getTime());else{var o=/\?/;this.url+=(o.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}}function C(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var r=e.split("="),n=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(i))}}),t}function _(e){var t=new h,r;return e.replace(/\r?\n[\t ]+/g," ").split("\r").map(function(e){return 0===e.indexOf("\n")?e.substr(1,e.length):e}).forEach(function(e){var r=e.split(":"),n=r.shift().trim();if(n){var i=r.join(":").trim();try{t.append(n,i)}catch(e){console.warn("Response "+e.message)}}}),t}function I(e,t){if(!(this instanceof I))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=void 0===t.statusText?"":""+t.statusText,this.headers=new h(t.headers),this.url=t.url||"",this._initBody(e)}w.prototype.clone=function(){return new w(this,{body:this._bodyInit})},E.call(w.prototype),E.call(I.prototype),I.prototype.clone=function(){return new I(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new h(this.headers),url:this.url})},I.error=function(){var e=new I(null,{status:200,statusText:""});return e.status=0,e.type="error",e};var A=[301,302,303,307,308];I.redirect=function(e,t){if(-1===A.indexOf(t))throw new RangeError("Invalid status code");return new I(null,{status:t,headers:{location:e}})};var R=t.DOMException;try{new R}catch(e){(R=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack}).prototype=Object.create(Error.prototype),R.prototype.constructor=R}function O(e,r){return new Promise(function(n,o){var s=new w(e,r);if(s.signal&&s.signal.aborted)return o(new R("Aborted","AbortError"));var u=new XMLHttpRequest;function c(){u.abort()}function p(e){try{return""===e&&t.location.href?t.location.href:e}catch(t){return e}}if(u.onload=function(){var e={statusText:u.statusText,headers:_(u.getAllResponseHeaders()||"")};s.url.startsWith("file://")&&(u.status<200||u.status>599)?e.status=200:e.status=u.status,e.url="responseURL"in u?u.responseURL:e.headers.get("X-Request-URL");var t="response"in u?u.response:u.responseText;setTimeout(function(){n(new I(t,e))},0)},u.onerror=function(){setTimeout(function(){o(new TypeError("Network request failed"))},0)},u.ontimeout=function(){setTimeout(function(){o(new TypeError("Network request timed out"))},0)},u.onabort=function(){setTimeout(function(){o(new R("Aborted","AbortError"))},0)},u.open(s.method,p(s.url),!0),"include"===s.credentials?u.withCredentials=!0:"omit"===s.credentials&&(u.withCredentials=!1),"responseType"in u&&(i?u.responseType="blob":a&&(u.responseType="arraybuffer")),r&&"object"==typeof r.headers&&!(r.headers instanceof h||t.Headers&&r.headers instanceof t.Headers)){var d=[];Object.getOwnPropertyNames(r.headers).forEach(function(e){d.push(f(e)),u.setRequestHeader(e,l(r.headers[e]))}),s.headers.forEach(function(e,t){-1===d.indexOf(t)&&u.setRequestHeader(t,e)})}else s.headers.forEach(function(e,t){u.setRequestHeader(t,e)});s.signal&&(s.signal.addEventListener("abort",c),u.onreadystatechange=function(){4===u.readyState&&s.signal.removeEventListener("abort",c)}),u.send(void 0===s._bodyInit?null:s._bodyInit)})}O.polyfill=!0,t.fetch||(t.fetch=O,t.Headers=h,t.Request=w,t.Response=I)}).call(this,r(29))},function(e,t,r){"use strict";var n=r(128),i=r(113),o=Object.prototype.hasOwnProperty,a={brackets:function e(t){return t+"[]"},comma:"comma",indices:function e(t,r){return t+"["+r+"]"},repeat:function e(t){return t}},s=Array.isArray,u=String.prototype.split,c=Array.prototype.push,f=function(e,t){c.apply(e,s(t)?t:[t])},l=Date.prototype.toISOString,p=i.default,h={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:n.encode,encodeValuesOnly:!1,format:p,formatter:i.formatters[p],indices:!1,serializeDate:function e(t){return l.call(t)},skipNulls:!1,strictNullHandling:!1},d=function e(t){return"string"==typeof t||"number"==typeof t||"boolean"==typeof t||"symbol"==typeof t||"bigint"==typeof t},y=function e(t,r,i,o,a,c,l,p,y,g,v,m,b,E){var T=t;if("function"==typeof l?T=l(r,T):T instanceof Date?T=g(T):"comma"===i&&s(T)&&(T=n.maybeMap(T,function(e){return e instanceof Date?g(e):e})),null===T){if(o)return c&&!b?c(r,h.encoder,E,"key",v):r;T=""}if(d(T)||n.isBuffer(T)){if(c){var S=b?r:c(r,h.encoder,E,"key",v);if("comma"===i&&b){for(var w=u.call(String(T),","),C="",_=0;_<w.length;++_)C+=(0===_?"":",")+m(c(w[_],h.encoder,E,"value",v));return[m(S)+"="+C]}return[m(S)+"="+m(c(T,h.encoder,E,"value",v))]}return[m(r)+"="+m(String(T))]}var I=[],A;if(void 0===T)return I;if("comma"===i&&s(T))A=[{value:T.length>0?T.join(",")||null:void 0}];else if(s(l))A=l;else{var R=Object.keys(T);A=p?R.sort(p):R}for(var O=0;O<A.length;++O){var P=A[O],B="object"==typeof P&&void 0!==P.value?P.value:T[P];if(!a||null!==B){var k=s(T)?"function"==typeof i?i(r,P):r:r+(y?"."+P:"["+P+"]");f(I,e(B,k,i,o,a,c,l,p,y,g,v,m,b,E))}}return I},g=function e(t){if(!t)return h;if(null!==t.encoder&&void 0!==t.encoder&&"function"!=typeof t.encoder)throw new TypeError("Encoder has to be a function.");var r=t.charset||h.charset;if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=i.default;if(void 0!==t.format){if(!o.call(i.formatters,t.format))throw new TypeError("Unknown format option provided.");n=t.format}var a=i.formatters[n],u=h.filter;return("function"==typeof t.filter||s(t.filter))&&(u=t.filter),{addQueryPrefix:"boolean"==typeof t.addQueryPrefix?t.addQueryPrefix:h.addQueryPrefix,allowDots:void 0===t.allowDots?h.allowDots:!!t.allowDots,charset:r,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:h.charsetSentinel,delimiter:void 0===t.delimiter?h.delimiter:t.delimiter,encode:"boolean"==typeof t.encode?t.encode:h.encode,encoder:"function"==typeof t.encoder?t.encoder:h.encoder,encodeValuesOnly:"boolean"==typeof t.encodeValuesOnly?t.encodeValuesOnly:h.encodeValuesOnly,filter:u,format:n,formatter:a,serializeDate:"function"==typeof t.serializeDate?t.serializeDate:h.serializeDate,skipNulls:"boolean"==typeof t.skipNulls?t.skipNulls:h.skipNulls,sort:"function"==typeof t.sort?t.sort:null,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:h.strictNullHandling}};e.exports=function(e,t){var r=e,n=g(t),i,o;"function"==typeof n.filter?r=(o=n.filter)("",r):s(n.filter)&&(i=o=n.filter);var u=[],c;if("object"!=typeof r||null===r)return"";c=t&&t.arrayFormat in a?t.arrayFormat:t&&"indices"in t?t.indices?"indices":"repeat":"indices";var l=a[c];i||(i=Object.keys(r)),n.sort&&i.sort(n.sort);for(var p=0;p<i.length;++p){var h=i[p];n.skipNulls&&null===r[h]||f(u,y(r[h],h,l,n.strictNullHandling,n.skipNulls,n.encode?n.encoder:null,n.filter,n.sort,n.allowDots,n.serializeDate,n.format,n.formatter,n.encodeValuesOnly,n.charset))}var d=u.join(n.delimiter),v=!0===n.addQueryPrefix?"?":"";return n.charsetSentinel&&("iso-8859-1"===n.charset?v+="utf8=%26%2310003%3B&":v+="utf8=%E2%9C%93&"),d.length>0?v+d:""}},function(e,t,r){"use strict";var n=r(128),i=Object.prototype.hasOwnProperty,o=Array.isArray,a={allowDots:!1,allowPrototypes:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:n.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},s=function(e){return e.replace(/&#(\d+);/g,function(e,t){return String.fromCharCode(parseInt(t,10))})},u=function(e,t){return e&&"string"==typeof e&&t.comma&&e.indexOf(",")>-1?e.split(","):e},c="utf8=%26%2310003%3B",f="utf8=%E2%9C%93",l=function e(t,r){var l={},p=r.ignoreQueryPrefix?t.replace(/^\?/,""):t,h=r.parameterLimit===1/0?void 0:r.parameterLimit,d=p.split(r.delimiter,h),y=-1,g,v=r.charset;if(r.charsetSentinel)for(g=0;g<d.length;++g)0===d[g].indexOf("utf8=")&&(d[g]===f?v="utf-8":d[g]===c&&(v="iso-8859-1"),y=g,g=d.length);for(g=0;g<d.length;++g)if(g!==y){var m=d[g],b=m.indexOf("]="),E=-1===b?m.indexOf("="):b+1,T,S;-1===E?(T=r.decoder(m,a.decoder,v,"key"),S=r.strictNullHandling?null:""):(T=r.decoder(m.slice(0,E),a.decoder,v,"key"),S=n.maybeMap(u(m.slice(E+1),r),function(e){return r.decoder(e,a.decoder,v,"value")})),S&&r.interpretNumericEntities&&"iso-8859-1"===v&&(S=s(S)),m.indexOf("[]=")>-1&&(S=o(S)?[S]:S),i.call(l,T)?l[T]=n.combine(l[T],S):l[T]=S}return l},p=function(e,t,r,n){for(var i=n?t:u(t,r),o=e.length-1;o>=0;--o){var a,s=e[o];if("[]"===s&&r.parseArrays)a=[].concat(i);else{a=r.plainObjects?Object.create(null):{};var c="["===s.charAt(0)&&"]"===s.charAt(s.length-1)?s.slice(1,-1):s,f=parseInt(c,10);r.parseArrays||""!==c?!isNaN(f)&&s!==c&&String(f)===c&&f>=0&&r.parseArrays&&f<=r.arrayLimit?(a=[])[f]=i:"__proto__"!==c&&(a[c]=i):a={0:i}}i=a}return i},h=function e(t,r,n,o){if(t){var a=n.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,s=/(\[[^[\]]*])/,u=/(\[[^[\]]*])/g,c=n.depth>0&&s.exec(a),f=c?a.slice(0,c.index):a,l=[];if(f){if(!n.plainObjects&&i.call(Object.prototype,f)&&!n.allowPrototypes)return;l.push(f)}for(var h=0;n.depth>0&&null!==(c=u.exec(a))&&h<n.depth;){if(h+=1,!n.plainObjects&&i.call(Object.prototype,c[1].slice(1,-1))&&!n.allowPrototypes)return;l.push(c[1])}return c&&l.push("["+a.slice(c.index)+"]"),p(l,r,n,o)}},d=function e(t){if(!t)return a;if(null!==t.decoder&&void 0!==t.decoder&&"function"!=typeof t.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=void 0===t.charset?a.charset:t.charset;return{allowDots:void 0===t.allowDots?a.allowDots:!!t.allowDots,allowPrototypes:"boolean"==typeof t.allowPrototypes?t.allowPrototypes:a.allowPrototypes,arrayLimit:"number"==typeof t.arrayLimit?t.arrayLimit:a.arrayLimit,charset:r,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:a.charsetSentinel,comma:"boolean"==typeof t.comma?t.comma:a.comma,decoder:"function"==typeof t.decoder?t.decoder:a.decoder,delimiter:"string"==typeof t.delimiter||n.isRegExp(t.delimiter)?t.delimiter:a.delimiter,depth:"number"==typeof t.depth||!1===t.depth?+t.depth:a.depth,ignoreQueryPrefix:!0===t.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof t.interpretNumericEntities?t.interpretNumericEntities:a.interpretNumericEntities,parameterLimit:"number"==typeof t.parameterLimit?t.parameterLimit:a.parameterLimit,parseArrays:!1!==t.parseArrays,plainObjects:"boolean"==typeof t.plainObjects?t.plainObjects:a.plainObjects,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:a.strictNullHandling}};e.exports=function(e,t){var r=d(t);if(""===e||null==e)return r.plainObjects?Object.create(null):{};for(var i="string"==typeof e?l(e,r):e,o=r.plainObjects?Object.create(null):{},a=Object.keys(i),s=0;s<a.length;++s){var u=a[s],c=h(u,i[u],r,"string"==typeof e);o=n.merge(o,c,r)}return n.compact(o)}},function(e,t,r){"use strict";function n(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=s(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function e(){};return{s:i,n:function t(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function e(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function t(){r=r.call(e)},n:function e(){var t=r.next();return a=t.done,t},e:function e(t){u=!0,o=t},f:function e(){try{a||null==r.return||r.return()}finally{if(u)throw o}}}}function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function o(e){return c(e)||u(e)||s(e)||a()}function a(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function s(e,t){if(e){if("string"==typeof e)return f(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?f(e,t):void 0}}function u(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function c(e){if(Array.isArray(e))return f(e)}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function l(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",i=r.toStringTag||"@@toStringTag";function o(r,n,i,o){var u=n&&n.prototype instanceof s?n:s,c=Object.create(u.prototype);return p(c,"_invoke",function(r,n,i){var o,s,u,c=0,f=i||[],l=!1,p={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function t(r,n){return o=r,s=0,u=e,p.n=n,a}};function h(r,n){for(s=r,u=n,t=0;!l&&c&&!i&&t<f.length;t++){var i,o=f[t],h=p.p,d=o[2];r>3?(i=d===n)&&(u=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=h&&((i=r<2&&h<o[1])?(s=0,p.v=n,p.n=o[1]):h<d&&(i=r<3||o[0]>n||n>d)&&(o[4]=r,o[5]=n,p.n=d,s=0))}if(i||r>1)return a;throw l=!0,n}return function(i,f,d){if(c>1)throw TypeError("Generator is already running");for(l&&1===f&&h(f,d),s=f,u=d;(t=s<2?e:u)||!l;){o||(s?s<3?(s>1&&(p.n=-1),h(s,u)):p.n=u:p.v=u);try{if(c=2,o){if(s||(i="next"),t=o[i]){if(!(t=t.call(o,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(u=TypeError("The iterator does not provide a '"+i+"' method"),s=1);o=e}else if((t=(l=p.n<0)?u:r.call(n,p))!==a)break}catch(t){o=e,s=1,u=t}finally{c=1}}return{value:t,done:l}}}(r,i,o),!0),c}var a={};function s(){}function u(){}function c(){}t=Object.getPrototypeOf;var f=[][n]?t(t([][n]())):(p(t={},n,function(){return this}),t),h=c.prototype=s.prototype=Object.create(f);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,p(e,i,"GeneratorFunction")),e.prototype=Object.create(h),e}return u.prototype=c,p(h,"constructor",c),p(c,"constructor",u),u.displayName="GeneratorFunction",p(c,i,"GeneratorFunction"),p(h),p(h,i,"Generator"),p(h,n,function(){return this}),p(h,"toString",function(){return"[object Generator]"}),(l=function e(){return{w:o,m:d}})()}function p(e,t,r,n){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}p=function e(t,r,n,o){function a(e,r){p(t,e,function(t){return this._invoke(e,r,t)})}r?i?i(t,r,{value:n,enumerable:!o,configurable:!o,writable:!o}):t[r]=n:(a("next",0),a("throw",1),a("return",2))},p(e,t,r,n)}function h(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function d(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?h(Object(r),!0).forEach(function(t){y(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):h(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function y(e,t,r){return(t=T(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function g(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function v(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var o=e.apply(t,r);function a(e){g(o,n,i,a,s,"next",e)}function s(e){g(o,n,i,a,s,"throw",e)}a(void 0)})}}function m(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function b(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,T(n.key),n)}}function E(e,t,r){return t&&b(e.prototype,t),r&&b(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function T(e){var t=S(e,"string");return"symbol"==i(t)?t:t+""}function S(e,t){if("object"!=i(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var w=r(66),C=r(67),_=r(129),I=_.extendContextLoader,A=_.strictDocumentLoader,R,O=r(177).serializeError,P=r(181),B=r(130);function k(e){return N.apply(this,arguments)}function N(){return(N=v(l().m(function e(t){var r,n,i,o,a,s,u;return l().w(function(e){for(;;)switch(e.n){case 0:if(r=t.document,n=t.legacy,i=t.documentLoader,o=t.expansionMap,a=t.compactProof,s=n?"signature":"proof",!a){e.n=2;break}return e.n=1,C.compact(r,w.SECURITY_CONTEXT_URL,{documentLoader:i,expansionMap:o,compactToRelative:!1});case 1:r=e.v;case 2:if(u=C.getValues(r,s),delete r[s],0!==u.length){e.n=3;break}throw new Error("No matching proofs found in the given document.");case 3:return u=u.map(function(e){return d({"@context":w.SECURITY_CONTEXT_URL},e)}),e.a(2,{proofSet:u,document:r})}},e)}))).apply(this,arguments)}function U(e){return D.apply(this,arguments)}function D(){return D=v(l().m(function e(t){var r,i,o,a,s,u,c,f,p;return l().w(function(e){for(;;)switch(e.n){case 0:return r=t.document,i=t.suites,o=t.proofSet,a=t.purpose,s=t.documentLoader,u=t.expansionMap,c=t.compactProof,e.n=1,Promise.all(o.map(function(e){return a.match(e,{document:r,documentLoader:s,expansionMap:u})}));case 1:if(f=e.v,0!==(p=o.filter(function(e,t){return f[t]})).length){e.n=2;break}return e.a(2,[]);case 2:return e.n=3,Promise.all(p.map(function(){var e=v(l().m(function e(t){var o,f,p,h;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:o=n(i),e.p=1,o.s();case 2:if((f=o.n()).done){e.n=5;break}return p=f.value,e.n=3,p.matchProof({proof:t,document:r,documentLoader:s,expansionMap:u});case 3:if(!e.v){e.n=4;break}return e.a(2,p.verifyProof({proof:t,document:r,purpose:a,documentLoader:s,expansionMap:u,compactProof:c}).catch(function(e){return{verified:!1,error:e}}));case 4:e.n=2;break;case 5:e.n=7;break;case 6:e.p=6,h=e.v,o.e(h);case 7:return e.p=7,o.f(),e.f(7);case 8:return e.a(2)}},e,null,[[1,6,7,8]])}));return function(t){return e.apply(this,arguments)}}()));case 3:return e.a(2,e.v.map(function(e,t){return e?(e.error&&x(e.error),d({proof:p[t]},e)):null}).filter(function(e){return e}))}},e)})),D.apply(this,arguments)}function x(e){Object.defineProperty(e,"toJSON",{value:function e(){return O(this)},configurable:!0,writable:!0})}function L(e){return j.apply(this,arguments)}function j(){return(j=v(l().m(function e(t){var r,n,i,o,a,s,u,c,f;return l().w(function(e){for(;;)switch(e.n){case 0:return r=t.document,n=t.documentLoader,i=t.expansionMap,o=C.getValues(r,"@context"),e.n=1,C.compact({"@type":"_:b0"},o,{documentLoader:n,expansionMap:i});case 1:return delete(a=e.v)["@context"],s=Object.keys(a)[0],(u={"@context":o})["@type"]=C.getValues(r,"@type").concat(C.getValues(r,s)),e.n=2,C.expand(u,{documentLoader:n,expansionMap:i});case 2:if(f=e.v[0]){e.n=3;break}f={};case 3:return c=f,e.a(2,{types:C.getValues(c,"@type"),alias:s})}},e)}))).apply(this,arguments)}e.exports=function(){function e(){m(this,e)}return E(e,[{key:"add",value:function(){var e=v(l().m(function e(t){var r,n,i,o,a,s,u,c,f,p,h,g,v,m,b,E,T,S=arguments;return l().w(function(e){for(;;)switch(e.n){case 0:if(n=(r=S.length>1&&void 0!==S[1]?S[1]:{}).suite,i=r.purpose,o=r.documentLoader,a=r.expansionMap,s=r.compactProof,u=void 0===s||s,n){e.n=1;break}throw new TypeError('"options.suite" is required.');case 1:if(i){e.n=2;break}throw new TypeError('"options.purpose" is required.');case 2:if(!n.legacy){e.n=3;break}if(i instanceof B){e.n=3;break}throw new TypeError('The "'.concat(n.type,'" suite requires "options.purpose" to be ')+'an instance of "PublicKeyProofPurpose".');case 3:if(o=o?I(o):A,!1!==a&&(a=P),"string"!=typeof t){e.n=5;break}return e.n=4,o(t);case 4:t=e.v;case 5:if(!u){e.n=7;break}return e.n=6,C.compact(t,w.SECURITY_CONTEXT_URL,{documentLoader:o,expansionMap:a,compactToRelative:!1});case 6:c=e.v,e.n=8;break;case 7:c=d({},t);case 8:return f=n.legacy?"signature":"proof",delete c[f],e.n=9,n.createProof({document:c,purpose:i,documentLoader:o,expansionMap:a,compactProof:u});case 9:if(p=e.v,!u){e.n=12;break}return h=n.legacy?y({},w.SECURITY_SIGNATURE_URL,p):y({},w.SECURITY_PROOF_URL,{"@graph":p}),e.n=10,L({document:t,documentLoader:o,expansionMap:a});case 10:return g=e.v,v=g.types,m=g.alias,h["@type"]=v,b=C.getValues(t,"@context"),e.n=11,C.compact(h,b,{documentLoader:o,expansionMap:a,compactToRelative:!1});case 11:delete(E=e.v)[m],delete E["@context"],T=Object.keys(E)[0],C.addValue(t,T,E[T]),e.n=13;break;case 12:delete p["@context"],C.addValue(t,f,p);case 13:return e.a(2,t)}},e)}));function t(t){return e.apply(this,arguments)}return t}()},{key:"verify",value:function(){var e=v(l().m(function e(t){var r,n,i,a,s,u,c,f,p,h,y,g,v,m,b,E,T,S=arguments,w;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(n=(r=S.length>1&&void 0!==S[1]?S[1]:{}).suite,i=r.purpose,a=r.documentLoader,s=r.expansionMap,u=r.compactProof,c=void 0===u||u,n){e.n=1;break}throw new TypeError('"options.suite" is required.');case 1:if(i){e.n=2;break}throw new TypeError('"options.purpose" is required.');case 2:if(0!==(f=Array.isArray(n)?n:[n]).length){e.n=3;break}throw new TypeError("At least one suite is required.");case 3:if(!(p=f.some(function(e){return e.legacy}))){e.n=5;break}if(!f.some(function(e){return!e.legacy})){e.n=4;break}throw new Error("Legacy suites may not be combined with current suites.");case 4:if(i instanceof B){e.n=5;break}throw new TypeError('"options.purpose" must be an instance of "PublicKeyProofPurpose"to use a legacy suite.');case 5:if(a=a?I(a):A,!1!==s&&(s=P),e.p=6,"string"!=typeof t){e.n=8;break}return e.n=7,a(t);case 7:t=e.v,e.n=9;break;case 8:t=d({},t);case 9:return e.n=10,k({document:t,legacy:p,documentLoader:a,expansionMap:s,compactProof:c});case 10:return h=e.v,y=h.proofSet,g=h.document,t=g,e.n=11,U({document:t,suites:f,proofSet:y,purpose:i,documentLoader:a,expansionMap:s,compactProof:c});case 11:if(0!==(v=e.v).length){e.n=12;break}throw new Error("Could not verify any proofs; no proofs matched the required suite and purpose.");case 12:if(m=v.some(function(e){return e.verified})){e.n=13;break}return E=(b=[]).concat.apply(b,o(v.filter(function(e){return e.error}).map(function(e){return e.error}))),T={verified:m,results:v},E.length>0&&(T.error=E),e.a(2,T);case 13:return e.a(2,{verified:m,results:v});case 14:return e.p=14,x(w=e.v),e.a(2,{verified:!1,error:w})}},e,null,[[6,14]])}));function t(t){return e.apply(this,arguments)}return t}()}])}()},function(e,t,r){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e,t,r){return(t=o(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e){var t=a(e,"string");return"symbol"==n(t)?t:t+""}function a(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var s=r(66),u,c=r(70).contexts;e.exports=i(i({},s.SECURITY_CONTEXT_V1_URL,c.get(s.SECURITY_CONTEXT_V1_URL)),s.SECURITY_CONTEXT_V2_URL,c.get(s.SECURITY_CONTEXT_V2_URL))},function(e,t,r){"use strict";const{inspect:n}=r(178);class i extends Error{constructor(e){super(n(e)),this.name="NonError",Error.captureStackTrace(this,i)}}const o=["name","message","stack","code"],a=(e,t,r)=>{const n=r||(Array.isArray(e)?[]:{});t.push(e);for(const[r,i]of Object.entries(e))"function"!=typeof i&&(i&&"object"==typeof i?t.includes(e[r])?n[r]="[Circular]":n[r]=a(e[r],t.slice()):n[r]=i);for(const t of o)"string"==typeof e[t]&&(n[t]=e[t]);return n},s=e=>"object"==typeof e&&null!==e?a(e,[]):"function"==typeof e?`[Function: ${e.name||"anonymous"}]`:e,u=e=>{if(e instanceof Error)return e;if("object"==typeof e&&null!==e&&!Array.isArray(e)){const t=new Error;return a(e,[],t),t}return new i(e)};e.exports={serializeError:s,deserializeError:u}},function(e,t,r){(function(e){var n=Object.getOwnPropertyDescriptors||function e(t){for(var r=Object.keys(t),n={},i=0;i<r.length;i++)n[r[i]]=Object.getOwnPropertyDescriptor(t,r[i]);return n},i=/%[sdj%]/g;t.format=function(e){if(!S(e)){for(var t=[],r=0;r<arguments.length;r++)t.push(s(arguments[r]));return t.join(" ")}for(var r=1,n=arguments,o=n.length,a=String(e).replace(i,function(e){if("%%"===e)return"%";if(r>=o)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}}),u=n[r];r<o;u=n[++r])b(u)||!I(u)?a+=" "+u:a+=" "+s(u);return a},t.deprecate=function(r,n){if(void 0!==e&&!0===e.noDeprecation)return r;if(void 0===e)return function(){return t.deprecate(r,n).apply(this,arguments)};var i=!1;function o(){if(!i){if(e.throwDeprecation)throw new Error(n);e.traceDeprecation?console.trace(n):console.error(n),i=!0}return r.apply(this,arguments)}return o};var o={},a;function s(e,r){var n={seen:[],stylize:c};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),m(r)?n.showHidden=r:r&&t._extend(n,r),C(n.showHidden)&&(n.showHidden=!1),C(n.depth)&&(n.depth=2),C(n.colors)&&(n.colors=!1),C(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=u),l(n,e,n.depth)}function u(e,t){var r=s.styles[t];return r?"["+s.colors[r][0]+"m"+e+"["+s.colors[r][1]+"m":e}function c(e,t){return e}function f(e){var t={};return e.forEach(function(e,r){t[e]=!0}),t}function l(e,r,n){if(e.customInspect&&r&&O(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,e);return S(i)||(i=l(e,i,n)),i}var o=p(e,r);if(o)return o;var a=Object.keys(r),s=f(a);if(e.showHidden&&(a=Object.getOwnPropertyNames(r)),R(r)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return h(r);if(0===a.length){if(O(r)){var u=r.name?": "+r.name:"";return e.stylize("[Function"+u+"]","special")}if(_(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(A(r))return e.stylize(Date.prototype.toString.call(r),"date");if(R(r))return h(r)}var c="",m=!1,b=["{","}"],E,T;(v(r)&&(m=!0,b=["[","]"]),O(r))&&(c=" [Function"+(r.name?": "+r.name:"")+"]");return _(r)&&(c=" "+RegExp.prototype.toString.call(r)),A(r)&&(c=" "+Date.prototype.toUTCString.call(r)),R(r)&&(c=" "+h(r)),0!==a.length||m&&0!=r.length?n<0?_(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),T=m?d(e,r,n,s,a):a.map(function(t){return y(e,r,n,s,t,m)}),e.seen.pop(),g(T,c,b)):b[0]+c+b[1]}function p(e,t){if(C(t))return e.stylize("undefined","undefined");if(S(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}return T(t)?e.stylize(""+t,"number"):m(t)?e.stylize(""+t,"boolean"):b(t)?e.stylize("null","null"):void 0}function h(e){return"["+Error.prototype.toString.call(e)+"]"}function d(e,t,r,n,i){for(var o=[],a=0,s=t.length;a<s;++a)D(t,String(a))?o.push(y(e,t,r,n,String(a),!0)):o.push("");return i.forEach(function(i){i.match(/^\d+$/)||o.push(y(e,t,r,n,i,!0))}),o}function y(e,t,r,n,i,o){var a,s,u;if((u=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?s=u.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):u.set&&(s=e.stylize("[Setter]","special")),D(n,i)||(a="["+i+"]"),s||(e.seen.indexOf(u.value)<0?(s=b(r)?l(e,u.value,null):l(e,u.value,r-1)).indexOf("\n")>-1&&(s=o?s.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+s.split("\n").map(function(e){return" "+e}).join("\n")):s=e.stylize("[Circular]","special")),C(a)){if(o&&i.match(/^\d+$/))return s;(a=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+s}function g(e,t,r){var n=0,i;return e.reduce(function(e,t){return n++,t.indexOf("\n")>=0&&n++,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}function v(e){return Array.isArray(e)}function m(e){return"boolean"==typeof e}function b(e){return null===e}function E(e){return null==e}function T(e){return"number"==typeof e}function S(e){return"string"==typeof e}function w(e){return"symbol"==typeof e}function C(e){return void 0===e}function _(e){return I(e)&&"[object RegExp]"===B(e)}function I(e){return"object"==typeof e&&null!==e}function A(e){return I(e)&&"[object Date]"===B(e)}function R(e){return I(e)&&("[object Error]"===B(e)||e instanceof Error)}function O(e){return"function"==typeof e}function P(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e}function B(e){return Object.prototype.toString.call(e)}function k(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(r){if(C(a)&&(a=e.env.NODE_DEBUG||""),r=r.toUpperCase(),!o[r])if(new RegExp("\\b"+r+"\\b","i").test(a)){var n=e.pid;o[r]=function(){var e=t.format.apply(t,arguments);console.error("%s %d: %s",r,n,e)}}else o[r]=function(){};return o[r]},t.inspect=s,s.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},s.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=v,t.isBoolean=m,t.isNull=b,t.isNullOrUndefined=E,t.isNumber=T,t.isString=S,t.isSymbol=w,t.isUndefined=C,t.isRegExp=_,t.isObject=I,t.isDate=A,t.isError=R,t.isFunction=O,t.isPrimitive=P,t.isBuffer=r(179);var N=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function U(){var e=new Date,t=[k(e.getHours()),k(e.getMinutes()),k(e.getSeconds())].join(":");return[e.getDate(),N[e.getMonth()],t].join(" ")}function D(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){console.log("%s - %s",U(),t.format.apply(t,arguments))},t.inherits=r(180),t._extend=function(e,t){if(!t||!I(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e};var x="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function L(e,t){if(!e){var r=new Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}function j(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');function r(){for(var r=[],n=0;n<arguments.length;n++)r.push(arguments[n]);var i=r.pop();if("function"!=typeof i)throw new TypeError("The last argument must be of type Function");var o=this,a=function(){return i.apply(o,arguments)};t.apply(this,r).then(function(t){e.nextTick(a,null,t)},function(t){e.nextTick(L,t,a)})}return Object.setPrototypeOf(r,Object.getPrototypeOf(t)),Object.defineProperties(r,n(t)),r}t.promisify=function e(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');if(x&&t[x]){var r;if("function"!=typeof(r=t[x]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(r,x,{value:r,enumerable:!1,writable:!1,configurable:!0}),r}function r(){for(var e,r,n=new Promise(function(t,n){e=t,r=n}),i=[],o=0;o<arguments.length;o++)i.push(arguments[o]);i.push(function(t,n){t?r(t):e(n)});try{t.apply(this,i)}catch(e){r(e)}return n}return Object.setPrototypeOf(r,Object.getPrototypeOf(t)),x&&Object.defineProperty(r,x,{value:r,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(r,n(t))},t.promisify.custom=x,t.callbackify=j}).call(this,r(36))},function(e,t){e.exports=function e(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},function(e,t){"function"==typeof Object.create?e.exports=function e(t,r){t.super_=r,t.prototype=Object.create(r.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function e(t,r){t.super_=r;var n=function(){};n.prototype=r.prototype,t.prototype=new n,t.prototype.constructor=t}},function(e,t,r){"use strict";e.exports=function(e){if(e.unmappedProperty)throw new Error('The property "'+e.unmappedProperty+'" in the input was not defined in the context.')}},function(e,t,r){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a(n.key),n)}}function o(e,t,r){return t&&i(e.prototype,t),r&&i(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function a(e){var t=s(e,"string");return"symbol"==n(t)?t:t+""}function s(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t,r){return t=m(t),f(e,y()?Reflect.construct(t,r||[],m(e).constructor):t.apply(e,r))}function f(e,t){if(t&&("object"==n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return l(e)}function l(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function p(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&v(e,t)}function h(e){var t="function"==typeof Map?new Map:void 0;return h=function e(r){if(null===r||!g(r))return r;if("function"!=typeof r)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(r))return t.get(r);t.set(r,n)}function n(){return d(r,arguments,m(this).constructor)}return n.prototype=Object.create(r.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),v(n,r)},h(e)}function d(e,t,r){if(y())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,t);var i=new(e.bind.apply(e,n));return r&&v(i,r.prototype),i}function y(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(y=function t(){return!!e})()}function g(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}function v(e,t){return v=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},v(e,t)}function m(e){return m=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},m(e)}var b=function(e){function t(e){var r;return u(this,t),(r=c(this,t,["Verification error(s)."])).name="VerificationError",r.errors=[].concat(e),r}return p(t,e),o(t)}(h(Error));e.exports=b},function(e,t,r){"use strict";var n={};e.exports=n,n.suites={Ed25519Signature2018:r(184),JwsLinkedDataSignature:r(114),LinkedDataProof:r(150),LinkedDataSignature:r(115),LinkedDataSignature2015:r(151),GraphSignature2012:r(200),RsaSignature2018:r(201)}},function(e,t,r){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a(n.key),n)}}function o(e,t,r){return t&&i(e.prototype,t),r&&i(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function a(e){var t=s(e,"string");return"symbol"==n(t)?t:t+""}function s(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t,r){return t=h(t),f(e,p()?Reflect.construct(t,r||[],h(e).constructor):t.apply(e,r))}function f(e,t){if(t&&("object"==n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return l(e)}function l(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function p(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(p=function t(){return!!e})()}function h(e){return h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},h(e)}function d(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&y(e,t)}function y(e,t){return y=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},y(e,t)}var g,v=r(73).Ed25519KeyPair,m=r(114);e.exports=function(e){function t(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=r.signer,i=r.key,o=r.creator,a=r.verificationMethod,s=r.proof,f=r.date,l=r.useNativeCanonize;return u(this,t),(e=c(this,t,[{type:"Ed25519Signature2018",alg:"EdDSA",LDKeyClass:v,creator:o,verificationMethod:a,signer:n,key:i,proof:s,date:f,useNativeCanonize:l}])).requiredKeyType="Ed25519VerificationKey2018",e}return d(t,e),o(t)}(m)},function(e,t,r){"use strict";t.byteLength=f,t.toByteArray=p,t.fromByteArray=y;for(var n=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=64;s<u;++s)n[s]=a[s],i[a.charCodeAt(s)]=s;function c(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("="),n;return-1===r&&(r=t),[r,r===t?0:4-r%4]}function f(e){var t=c(e),r=t[0],n=t[1];return 3*(r+n)/4-n}function l(e,t,r){return 3*(t+r)/4-r}function p(e){var t,r=c(e),n=r[0],a=r[1],s=new o(l(e,n,a)),u=0,f=a>0?n-4:n,p;for(p=0;p<f;p+=4)t=i[e.charCodeAt(p)]<<18|i[e.charCodeAt(p+1)]<<12|i[e.charCodeAt(p+2)]<<6|i[e.charCodeAt(p+3)],s[u++]=t>>16&255,s[u++]=t>>8&255,s[u++]=255&t;return 2===a&&(t=i[e.charCodeAt(p)]<<2|i[e.charCodeAt(p+1)]>>4,s[u++]=255&t),1===a&&(t=i[e.charCodeAt(p)]<<10|i[e.charCodeAt(p+1)]<<4|i[e.charCodeAt(p+2)]>>2,s[u++]=t>>8&255,s[u++]=255&t),s}function h(e){return n[e>>18&63]+n[e>>12&63]+n[e>>6&63]+n[63&e]}function d(e,t,r){for(var n,i=[],o=t;o<r;o+=3)n=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(255&e[o+2]),i.push(h(n));return i.join("")}function y(e){for(var t,r=e.length,i=r%3,o=[],a=16383,s=0,u=r-i;s<u;s+=a)o.push(d(e,s,s+a>u?u:s+a));return 1===i?(t=e[r-1],o.push(n[t>>2]+n[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],o.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"=")),o.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(e,t){t.read=function(e,t,r,n,i){var o,a,s=8*i-n-1,u=(1<<s)-1,c=u>>1,f=-7,l=r?i-1:0,p=r?-1:1,h=e[t+l];for(l+=p,o=h&(1<<-f)-1,h>>=-f,f+=s;f>0;o=256*o+e[t+l],l+=p,f-=8);for(a=o&(1<<-f)-1,o>>=-f,f+=n;f>0;a=256*a+e[t+l],l+=p,f-=8);if(0===o)o=1-c;else{if(o===u)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,n),o-=c}return(h?-1:1)*a*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var a,s,u,c=8*o-i-1,f=(1<<c)-1,l=f>>1,p=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:o-1,d=n?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=f):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+l>=1?p/u:p*Math.pow(2,1-l))*u>=2&&(a++,u/=2),a+l>=f?(s=0,a=f):a+l>=1?(s=(t*u-1)*Math.pow(2,i),a+=l):(s=t*Math.pow(2,l-1)*Math.pow(2,i),a=0));i>=8;e[r+h]=255&s,h+=d,s/=256,i-=8);for(a=a<<i|s,c+=i;c>0;e[r+h]=255&a,h+=d,a/=256,c-=8);e[r+h-d]|=128*y}},function(e,t){var r={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==r.call(e)}},function(e,t,r){(function(e,t){!function(e,r){"use strict";if(!e.setImmediate){var n=1,i={},o=!1,a=e.document,s,u=Object.getPrototypeOf&&Object.getPrototypeOf(e);u=u&&u.setTimeout?u:e,"[object process]"==={}.toString.call(e.process)?h():d()?y():e.MessageChannel?g():a&&"onreadystatechange"in a.createElement("script")?v():m(),u.setImmediate=c,u.clearImmediate=f}function c(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),r=0;r<t.length;r++)t[r]=arguments[r+1];var o={callback:e,args:t};return i[n]=o,s(n),n++}function f(e){delete i[e]}function l(e){var t=e.callback,n=e.args;switch(n.length){case 0:t();break;case 1:t(n[0]);break;case 2:t(n[0],n[1]);break;case 3:t(n[0],n[1],n[2]);break;default:t.apply(r,n)}}function p(e){if(o)setTimeout(p,0,e);else{var t=i[e];if(t){o=!0;try{l(t)}finally{f(e),o=!1}}}}function h(){s=function(e){t.nextTick(function(){p(e)})}}function d(){if(e.postMessage&&!e.importScripts){var t=!0,r=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=r,t}}function y(){var t="setImmediate$"+Math.random()+"$",r=function(r){r.source===e&&"string"==typeof r.data&&0===r.data.indexOf(t)&&p(+r.data.slice(t.length))};e.addEventListener?e.addEventListener("message",r,!1):e.attachEvent("onmessage",r),s=function(r){e.postMessage(t+r,"*")}}function g(){var e=new MessageChannel;e.port1.onmessage=function(e){var t;p(e.data)},s=function(t){e.port2.postMessage(t)}}function v(){var e=a.documentElement;s=function(t){var r=a.createElement("script");r.onreadystatechange=function(){p(t),r.onreadystatechange=null,e.removeChild(r),r=null},e.appendChild(r)}}function m(){s=function(e){setTimeout(p,0,e)}}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,r(29),r(36))},function(e,t,r){(function(t){var r={};e.exports=r;var n={};function i(e,t){var r=0,n=t.length,i=t.charAt(0),o=[0];for(r=0;r<e.length();++r){for(var a=0,s=e.at(r);a<o.length;++a)s+=o[a]<<8,o[a]=s%n,s=s/n|0;for(;s>0;)o.push(s%n),s=s/n|0}var u="";for(r=0;0===e.at(r)&&r<e.length()-1;++r)u+=i;for(r=o.length-1;r>=0;--r)u+=t[o[r]];return u}r.encode=function(e,t,r){if("string"!=typeof t)throw new TypeError('"alphabet" must be a string.');if(void 0!==r&&"number"!=typeof r)throw new TypeError('"maxline" must be a number.');var n="";if(e instanceof Uint8Array){var o=0,a=t.length,s=t.charAt(0),u=[0];for(o=0;o<e.length;++o){for(var c=0,f=e[o];c<u.length;++c)f+=u[c]<<8,u[c]=f%a,f=f/a|0;for(;f>0;)u.push(f%a),f=f/a|0}for(o=0;0===e[o]&&o<e.length-1;++o)n+=s;for(o=u.length-1;o>=0;--o)n+=t[u[o]]}else n=i(e,t);if(r){var l=new RegExp(".{1,"+r+"}","g");n=n.match(l).join("\r\n")}return n},r.decode=function(e,r){if("string"!=typeof e)throw new TypeError('"input" must be a string.');if("string"!=typeof r)throw new TypeError('"alphabet" must be a string.');var i=n[r];if(!i){i=n[r]=[];for(var o=0;o<r.length;++o)i[r.charCodeAt(o)]=o}e=e.replace(/\s/g,"");for(var a=r.length,s=r.charAt(0),u=[0],o=0;o<e.length;o++){var c=i[e.charCodeAt(o)];if(void 0===c)return;for(var f=0,l=c;f<u.length;++f)l+=u[f]*a,u[f]=255&l,l>>=8;for(;l>0;)u.push(255&l),l>>=8}for(var p=0;e[p]===s&&p<e.length-1;++p)u.push(0);return void 0!==t?t.from(u.reverse()):new Uint8Array(u.reverse())}}).call(this,r(74).Buffer)},function(e,t,r){var n=r(4);r(48),r(136);var i=e.exports=n.tls;function o(e,t,r){var o=t.entity===n.tls.ConnectionEnd.client;e.read.cipherState={init:!1,cipher:n.cipher.createDecipher("AES-CBC",o?r.keys.server_write_key:r.keys.client_write_key),iv:o?r.keys.server_write_IV:r.keys.client_write_IV},e.write.cipherState={init:!1,cipher:n.cipher.createCipher("AES-CBC",o?r.keys.client_write_key:r.keys.server_write_key),iv:o?r.keys.client_write_IV:r.keys.server_write_IV},e.read.cipherFunction=c,e.write.cipherFunction=a,e.read.macLength=e.write.macLength=r.mac_length,e.read.macFunction=e.write.macFunction=i.hmac_sha1}function a(e,t){var r=!1,o=t.macFunction(t.macKey,t.sequenceNumber,e),a;e.fragment.putBytes(o),t.updateSequenceNumber(),a=e.version.minor===i.Versions.TLS_1_0.minor?t.cipherState.init?null:t.cipherState.iv:n.random.getBytesSync(16),t.cipherState.init=!0;var u=t.cipherState.cipher;return u.start({iv:a}),e.version.minor>=i.Versions.TLS_1_1.minor&&u.output.putBytes(a),u.update(e.fragment),u.finish(s)&&(e.fragment=u.output,e.length=e.fragment.length(),r=!0),r}function s(e,t,r){if(!r){var n=e-t.length()%e;t.fillWithByte(n-1,n)}return!0}function u(e,t,r){var n=!0;if(r){for(var i=t.length(),o=t.last(),a=i-1-o;a<i-1;++a)n=n&&t.at(a)==o;n&&t.truncate(o+1)}return n}function c(e,t){var r=!1,o;o=e.version.minor===i.Versions.TLS_1_0.minor?t.cipherState.init?null:t.cipherState.iv:e.fragment.getBytes(16),t.cipherState.init=!0;var a=t.cipherState.cipher;a.start({iv:o}),a.update(e.fragment),r=a.finish(u);var s=t.macLength,c=n.random.getBytesSync(s),l=a.output.length();l>=s?(e.fragment=a.output.getBytes(l-s),c=a.output.getBytes(s)):e.fragment=a.output.getBytes(),e.fragment=n.util.createBuffer(e.fragment),e.length=e.fragment.length();var p=t.macFunction(t.macKey,t.sequenceNumber,e);return t.updateSequenceNumber(),r=f(t.macKey,c,p)&&r}function f(e,t,r){var i=n.hmac.create();return i.start("SHA1",e),i.update(t),t=i.digest().getBytes(),i.start(null,null),i.update(r),t===(r=i.digest().getBytes())}i.CipherSuites.TLS_RSA_WITH_AES_128_CBC_SHA={id:[0,47],name:"TLS_RSA_WITH_AES_128_CBC_SHA",initSecurityParameters:function(e){e.bulk_cipher_algorithm=i.BulkCipherAlgorithm.aes,e.cipher_type=i.CipherType.block,e.enc_key_length=16,e.block_length=16,e.fixed_iv_length=16,e.record_iv_length=16,e.mac_algorithm=i.MACAlgorithm.hmac_sha1,e.mac_length=20,e.mac_key_length=20},initConnectionState:o},i.CipherSuites.TLS_RSA_WITH_AES_256_CBC_SHA={id:[0,53],name:"TLS_RSA_WITH_AES_256_CBC_SHA",initSecurityParameters:function(e){e.bulk_cipher_algorithm=i.BulkCipherAlgorithm.aes,e.cipher_type=i.CipherType.block,e.enc_key_length=32,e.block_length=16,e.fixed_iv_length=16,e.record_iv_length=16,e.mac_algorithm=i.MACAlgorithm.hmac_sha1,e.mac_length=20,e.mac_key_length=20},initConnectionState:o}},function(e,t,r){var n=r(4);r(146),e.exports=n.mgf=n.mgf||{},n.mgf.mgf1=n.mgf1},function(e,t,r){(function(t){var n=r(4);r(77),r(31),r(148),r(8);var i=r(193),o=i.publicKeyValidator,a=i.privateKeyValidator;if(void 0===s)var s=n.jsbn.BigInteger;var u=n.util.ByteBuffer,c=void 0===t?Uint8Array:t;n.pki=n.pki||{},e.exports=n.pki.ed25519=n.ed25519=n.ed25519||{};var f=n.ed25519;function l(e){var r=e.message;if(r instanceof Uint8Array||r instanceof c)return r;var n=e.encoding;if(void 0===r){if(!e.md)throw new TypeError('"options.message" or "options.md" not specified.');r=e.md.digest().getBytes(),n="binary"}if("string"==typeof r&&!n)throw new TypeError('"options.encoding" must be "binary" or "utf8".');if("string"==typeof r){if(void 0!==t)return t.from(r,n);r=new u(r,n)}else if(!(r instanceof u))throw new TypeError('"options.message" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a string with "options.encoding" specifying its encoding.');for(var i=new c(r.length()),o=0;o<i.length;++o)i[o]=r.at(o);return i}f.constants={},f.constants.PUBLIC_KEY_BYTE_LENGTH=32,f.constants.PRIVATE_KEY_BYTE_LENGTH=64,f.constants.SEED_BYTE_LENGTH=32,f.constants.SIGN_BYTE_LENGTH=64,f.constants.HASH_BYTE_LENGTH=64,f.generateKeyPair=function(e){var t=(e=e||{}).seed;if(void 0===t)t=n.random.getBytesSync(f.constants.SEED_BYTE_LENGTH);else if("string"==typeof t){if(t.length!==f.constants.SEED_BYTE_LENGTH)throw new TypeError('"seed" must be '+f.constants.SEED_BYTE_LENGTH+" bytes in length.")}else if(!(t instanceof Uint8Array))throw new TypeError('"seed" must be a node.js Buffer, Uint8Array, or a binary string.');t=l({message:t,encoding:"binary"});for(var r=new c(f.constants.PUBLIC_KEY_BYTE_LENGTH),i=new c(f.constants.PRIVATE_KEY_BYTE_LENGTH),o=0;o<32;++o)i[o]=t[o];return T(r,i),{publicKey:r,privateKey:i}},f.privateKeyFromAsn1=function(e){var t={},r=[],i;if(!n.asn1.validate(e,a,t,r)){var o=new Error("Invalid Key.");throw o.errors=r,o}var s=n.asn1.derToOid(t.privateKeyOid),u=n.oids.EdDSA25519;if(s!==u)throw new Error('Invalid OID "'+s+'"; OID must be "'+u+'".');var c=t.privateKey,f;return{privateKeyBytes:l({message:n.asn1.fromDer(c).value,encoding:"binary"})}},f.publicKeyFromAsn1=function(e){var t={},r=[],i;if(!n.asn1.validate(e,o,t,r)){var a=new Error("Invalid Key.");throw a.errors=r,a}var s=n.asn1.derToOid(t.publicKeyOid),u=n.oids.EdDSA25519;if(s!==u)throw new Error('Invalid OID "'+s+'"; OID must be "'+u+'".');var c=t.ed25519PublicKey;if(c.length!==f.constants.PUBLIC_KEY_BYTE_LENGTH)throw new Error("Key length is invalid.");return l({message:c,encoding:"binary"})},f.publicKeyFromPrivateKey=function(e){var t=l({message:(e=e||{}).privateKey,encoding:"binary"});if(t.length!==f.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+f.constants.PRIVATE_KEY_BYTE_LENGTH);for(var r=new c(f.constants.PUBLIC_KEY_BYTE_LENGTH),n=0;n<r.length;++n)r[n]=t[32+n];return r},f.sign=function(e){var t=l(e=e||{}),r=l({message:e.privateKey,encoding:"binary"}),n;if(r.length===f.constants.SEED_BYTE_LENGTH)r=f.generateKeyPair({seed:r}).privateKey;else if(r.length!==f.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+f.constants.SEED_BYTE_LENGTH+" or "+f.constants.PRIVATE_KEY_BYTE_LENGTH);var i=new c(f.constants.SIGN_BYTE_LENGTH+t.length);S(i,t,t.length,r);for(var o=new c(f.constants.SIGN_BYTE_LENGTH),a=0;a<o.length;++a)o[a]=i[a];return o},f.verify=function(e){var t=l(e=e||{});if(void 0===e.signature)throw new TypeError('"options.signature" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a binary string.');var r=l({message:e.signature,encoding:"binary"});if(r.length!==f.constants.SIGN_BYTE_LENGTH)throw new TypeError('"options.signature" must have a byte length of '+f.constants.SIGN_BYTE_LENGTH);var n=l({message:e.publicKey,encoding:"binary"});if(n.length!==f.constants.PUBLIC_KEY_BYTE_LENGTH)throw new TypeError('"options.publicKey" must have a byte length of '+f.constants.PUBLIC_KEY_BYTE_LENGTH);var i=new c(f.constants.SIGN_BYTE_LENGTH+t.length),o=new c(f.constants.SIGN_BYTE_LENGTH+t.length),a;for(a=0;a<f.constants.SIGN_BYTE_LENGTH;++a)i[a]=r[a];for(a=0;a<t.length;++a)i[a+f.constants.SIGN_BYTE_LENGTH]=t[a];return w(o,i,i.length,n)>=0};var p=H(),h=H([1]),d=H([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),y=H([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),g=H([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),v=H([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),m=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]),b=H([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function E(e,r){var i=n.md.sha512.create(),o=new u(e);i.update(o.getBytes(r),"binary");var a=i.digest().getBytes();if(void 0!==t)return t.from(a,"binary");for(var s=new c(f.constants.HASH_BYTE_LENGTH),l=0;l<64;++l)s[l]=a.charCodeAt(l);return s}function T(e,t){var r=[H(),H(),H(),H()],n,i=E(t,32);for(i[0]&=248,i[31]&=127,i[31]|=64,j(r,i),R(e,r),n=0;n<32;++n)t[n+32]=e[n];return 0}function S(e,t,r,n){var i,o,a=new Float64Array(64),s=[H(),H(),H(),H()],u=E(n,32);u[0]&=248,u[31]&=127,u[31]|=64;var c=r+64;for(i=0;i<r;++i)e[64+i]=t[i];for(i=0;i<32;++i)e[32+i]=u[32+i];var f=E(e.subarray(32),r+32);for(_(f),j(s,f),R(e,s),i=32;i<64;++i)e[i]=n[i];var l=E(e,r+64);for(_(l),i=32;i<64;++i)a[i]=0;for(i=0;i<32;++i)a[i]=f[i];for(i=0;i<32;++i)for(o=0;o<32;o++)a[i+o]+=l[i]*u[o];return C(e.subarray(32),a),c}function w(e,t,r,n){var i,o,a=new c(32),s=[H(),H(),H(),H()],u=[H(),H(),H(),H()];if(o=-1,r<64)return-1;if(P(u,n))return-1;for(i=0;i<r;++i)e[i]=t[i];for(i=0;i<32;++i)e[i+32]=n[i];var f=E(e,r);if(_(f),L(s,u,f),j(u,t.subarray(32)),I(s,u),R(a,s),r-=64,U(t,0,a,0)){for(i=0;i<r;++i)e[i]=0;return-1}for(i=0;i<r;++i)e[i]=t[i+64];return o=r}function C(e,t){var r,n,i,o;for(n=63;n>=32;--n){for(r=0,i=n-32,o=n-12;i<o;++i)t[i]+=r-16*t[n]*m[i-(n-32)],r=t[i]+128>>8,t[i]-=256*r;t[i]+=r,t[n]=0}for(r=0,i=0;i<32;++i)t[i]+=r-(t[31]>>4)*m[i],r=t[i]>>8,t[i]&=255;for(i=0;i<32;++i)t[i]-=r*m[i];for(n=0;n<32;++n)t[n+1]+=t[n]>>8,e[n]=255&t[n]}function _(e){for(var t=new Float64Array(64),r=0;r<64;++r)t[r]=e[r],e[r]=0;C(e,t)}function I(e,t){var r=H(),n=H(),i=H(),o=H(),a=H(),s=H(),u=H(),c=H(),f=H();G(r,e[1],e[0]),G(f,t[1],t[0]),Y(r,r,f),q(n,e[0],e[1]),q(f,t[0],t[1]),Y(n,n,f),Y(i,e[3],t[3]),Y(i,i,y),Y(o,e[2],t[2]),q(o,o,o),G(a,n,r),G(s,o,i),q(u,o,i),q(c,n,r),Y(e[0],a,s),Y(e[1],c,u),Y(e[2],u,s),Y(e[3],a,c)}function A(e,t,r){for(var n=0;n<4;++n)K(e[n],t[n],r)}function R(e,t){var r=H(),n=H(),i=H();V(i,t[2]),Y(r,t[0],i),Y(n,t[1],i),O(e,n),e[31]^=x(r)<<7}function O(e,t){var r,n,i,o=H(),a=H();for(r=0;r<16;++r)a[r]=t[r];for(F(a),F(a),F(a),n=0;n<2;++n){for(o[0]=a[0]-65517,r=1;r<15;++r)o[r]=a[r]-65535-(o[r-1]>>16&1),o[r-1]&=65535;o[15]=a[15]-32767-(o[14]>>16&1),i=o[15]>>16&1,o[14]&=65535,K(a,o,1-i)}for(r=0;r<16;r++)e[2*r]=255&a[r],e[2*r+1]=a[r]>>8}function P(e,t){var r=H(),n=H(),i=H(),o=H(),a=H(),s=H(),u=H();return M(e[2],h),B(e[1],t),z(i,e[1]),Y(o,i,d),G(i,i,e[2]),q(o,e[2],o),z(a,o),z(s,a),Y(u,s,a),Y(r,u,i),Y(r,r,o),k(r,r),Y(r,r,i),Y(r,r,o),Y(r,r,o),Y(e[0],r,o),z(n,e[0]),Y(n,n,o),N(n,i)&&Y(e[0],e[0],b),z(n,e[0]),Y(n,n,o),N(n,i)?-1:(x(e[0])===t[31]>>7&&G(e[0],p,e[0]),Y(e[3],e[0],e[1]),0)}function B(e,t){var r;for(r=0;r<16;++r)e[r]=t[2*r]+(t[2*r+1]<<8);e[15]&=32767}function k(e,t){var r=H(),n;for(n=0;n<16;++n)r[n]=t[n];for(n=250;n>=0;--n)z(r,r),1!==n&&Y(r,r,t);for(n=0;n<16;++n)e[n]=r[n]}function N(e,t){var r=new c(32),n=new c(32);return O(r,e),O(n,t),U(r,0,n,0)}function U(e,t,r,n){return D(e,t,r,n,32)}function D(e,t,r,n,i){var o,a=0;for(o=0;o<i;++o)a|=e[t+o]^r[n+o];return(1&a-1>>>8)-1}function x(e){var t=new c(32);return O(t,e),1&t[0]}function L(e,t,r){var n,i;for(M(e[0],p),M(e[1],h),M(e[2],h),M(e[3],p),i=255;i>=0;--i)A(e,t,n=r[i/8|0]>>(7&i)&1),I(t,e),I(e,e),A(e,t,n)}function j(e,t){var r=[H(),H(),H(),H()];M(r[0],g),M(r[1],v),M(r[2],h),Y(r[3],g,v),L(e,r,t)}function M(e,t){var r;for(r=0;r<16;r++)e[r]=0|t[r]}function V(e,t){var r=H(),n;for(n=0;n<16;++n)r[n]=t[n];for(n=253;n>=0;--n)z(r,r),2!==n&&4!==n&&Y(r,r,t);for(n=0;n<16;++n)e[n]=r[n]}function F(e){var t,r,n=1;for(t=0;t<16;++t)r=e[t]+n+65535,n=Math.floor(r/65536),e[t]=r-65536*n;e[0]+=n-1+37*(n-1)}function K(e,t,r){for(var n,i=~(r-1),o=0;o<16;++o)n=i&(e[o]^t[o]),e[o]^=n,t[o]^=n}function H(e){var t,r=new Float64Array(16);if(e)for(t=0;t<e.length;++t)r[t]=e[t];return r}function q(e,t,r){for(var n=0;n<16;++n)e[n]=t[n]+r[n]}function G(e,t,r){for(var n=0;n<16;++n)e[n]=t[n]-r[n]}function z(e,t){Y(e,t,t)}function Y(e,t,r){var n,i,o=0,a=0,s=0,u=0,c=0,f=0,l=0,p=0,h=0,d=0,y=0,g=0,v=0,m=0,b=0,E=0,T=0,S=0,w=0,C=0,_=0,I=0,A=0,R=0,O=0,P=0,B=0,k=0,N=0,U=0,D=0,x=r[0],L=r[1],j=r[2],M=r[3],V=r[4],F=r[5],K=r[6],H=r[7],q=r[8],G=r[9],z=r[10],Y=r[11],W=r[12],Q=r[13],X=r[14],Z=r[15];o+=(n=t[0])*x,a+=n*L,s+=n*j,u+=n*M,c+=n*V,f+=n*F,l+=n*K,p+=n*H,h+=n*q,d+=n*G,y+=n*z,g+=n*Y,v+=n*W,m+=n*Q,b+=n*X,E+=n*Z,a+=(n=t[1])*x,s+=n*L,u+=n*j,c+=n*M,f+=n*V,l+=n*F,p+=n*K,h+=n*H,d+=n*q,y+=n*G,g+=n*z,v+=n*Y,m+=n*W,b+=n*Q,E+=n*X,T+=n*Z,s+=(n=t[2])*x,u+=n*L,c+=n*j,f+=n*M,l+=n*V,p+=n*F,h+=n*K,d+=n*H,y+=n*q,g+=n*G,v+=n*z,m+=n*Y,b+=n*W,E+=n*Q,T+=n*X,S+=n*Z,u+=(n=t[3])*x,c+=n*L,f+=n*j,l+=n*M,p+=n*V,h+=n*F,d+=n*K,y+=n*H,g+=n*q,v+=n*G,m+=n*z,b+=n*Y,E+=n*W,T+=n*Q,S+=n*X,w+=n*Z,c+=(n=t[4])*x,f+=n*L,l+=n*j,p+=n*M,h+=n*V,d+=n*F,y+=n*K,g+=n*H,v+=n*q,m+=n*G,b+=n*z,E+=n*Y,T+=n*W,S+=n*Q,w+=n*X,C+=n*Z,f+=(n=t[5])*x,l+=n*L,p+=n*j,h+=n*M,d+=n*V,y+=n*F,g+=n*K,v+=n*H,m+=n*q,b+=n*G,E+=n*z,T+=n*Y,S+=n*W,w+=n*Q,C+=n*X,_+=n*Z,l+=(n=t[6])*x,p+=n*L,h+=n*j,d+=n*M,y+=n*V,g+=n*F,v+=n*K,m+=n*H,b+=n*q,E+=n*G,T+=n*z,S+=n*Y,w+=n*W,C+=n*Q,_+=n*X,I+=n*Z,p+=(n=t[7])*x,h+=n*L,d+=n*j,y+=n*M,g+=n*V,v+=n*F,m+=n*K,b+=n*H,E+=n*q,T+=n*G,S+=n*z,w+=n*Y,C+=n*W,_+=n*Q,I+=n*X,A+=n*Z,h+=(n=t[8])*x,d+=n*L,y+=n*j,g+=n*M,v+=n*V,m+=n*F,b+=n*K,E+=n*H,T+=n*q,S+=n*G,w+=n*z,C+=n*Y,_+=n*W,I+=n*Q,A+=n*X,R+=n*Z,d+=(n=t[9])*x,y+=n*L,g+=n*j,v+=n*M,m+=n*V,b+=n*F,E+=n*K,T+=n*H,S+=n*q,w+=n*G,C+=n*z,_+=n*Y,I+=n*W,A+=n*Q,R+=n*X,O+=n*Z,y+=(n=t[10])*x,g+=n*L,v+=n*j,m+=n*M,b+=n*V,E+=n*F,T+=n*K,S+=n*H,w+=n*q,C+=n*G,_+=n*z,I+=n*Y,A+=n*W,R+=n*Q,O+=n*X,P+=n*Z,g+=(n=t[11])*x,v+=n*L,m+=n*j,b+=n*M,E+=n*V,T+=n*F,S+=n*K,w+=n*H,C+=n*q,_+=n*G,I+=n*z,A+=n*Y,R+=n*W,O+=n*Q,P+=n*X,B+=n*Z,v+=(n=t[12])*x,m+=n*L,b+=n*j,E+=n*M,T+=n*V,S+=n*F,w+=n*K,C+=n*H,_+=n*q,I+=n*G,A+=n*z,R+=n*Y,O+=n*W,P+=n*Q,B+=n*X,k+=n*Z,m+=(n=t[13])*x,b+=n*L,E+=n*j,T+=n*M,S+=n*V,w+=n*F,C+=n*K,_+=n*H,I+=n*q,A+=n*G,R+=n*z,O+=n*Y,P+=n*W,B+=n*Q,k+=n*X,N+=n*Z,b+=(n=t[14])*x,E+=n*L,T+=n*j,S+=n*M,w+=n*V,C+=n*F,_+=n*K,I+=n*H,A+=n*q,R+=n*G,O+=n*z,P+=n*Y,B+=n*W,k+=n*Q,N+=n*X,U+=n*Z,E+=(n=t[15])*x,a+=38*(S+=n*j),s+=38*(w+=n*M),u+=38*(C+=n*V),c+=38*(_+=n*F),f+=38*(I+=n*K),l+=38*(A+=n*H),p+=38*(R+=n*q),h+=38*(O+=n*G),d+=38*(P+=n*z),y+=38*(B+=n*Y),g+=38*(k+=n*W),v+=38*(N+=n*Q),m+=38*(U+=n*X),b+=38*(D+=n*Z),o=(n=(o+=38*(T+=n*L))+(i=1)+65535)-65536*(i=Math.floor(n/65536)),a=(n=a+i+65535)-65536*(i=Math.floor(n/65536)),s=(n=s+i+65535)-65536*(i=Math.floor(n/65536)),u=(n=u+i+65535)-65536*(i=Math.floor(n/65536)),c=(n=c+i+65535)-65536*(i=Math.floor(n/65536)),f=(n=f+i+65535)-65536*(i=Math.floor(n/65536)),l=(n=l+i+65535)-65536*(i=Math.floor(n/65536)),p=(n=p+i+65535)-65536*(i=Math.floor(n/65536)),h=(n=h+i+65535)-65536*(i=Math.floor(n/65536)),d=(n=d+i+65535)-65536*(i=Math.floor(n/65536)),y=(n=y+i+65535)-65536*(i=Math.floor(n/65536)),g=(n=g+i+65535)-65536*(i=Math.floor(n/65536)),v=(n=v+i+65535)-65536*(i=Math.floor(n/65536)),m=(n=m+i+65535)-65536*(i=Math.floor(n/65536)),b=(n=b+i+65535)-65536*(i=Math.floor(n/65536)),E=(n=E+i+65535)-65536*(i=Math.floor(n/65536)),o=(n=(o+=i-1+37*(i-1))+(i=1)+65535)-65536*(i=Math.floor(n/65536)),a=(n=a+i+65535)-65536*(i=Math.floor(n/65536)),s=(n=s+i+65535)-65536*(i=Math.floor(n/65536)),u=(n=u+i+65535)-65536*(i=Math.floor(n/65536)),c=(n=c+i+65535)-65536*(i=Math.floor(n/65536)),f=(n=f+i+65535)-65536*(i=Math.floor(n/65536)),l=(n=l+i+65535)-65536*(i=Math.floor(n/65536)),p=(n=p+i+65535)-65536*(i=Math.floor(n/65536)),h=(n=h+i+65535)-65536*(i=Math.floor(n/65536)),d=(n=d+i+65535)-65536*(i=Math.floor(n/65536)),y=(n=y+i+65535)-65536*(i=Math.floor(n/65536)),g=(n=g+i+65535)-65536*(i=Math.floor(n/65536)),v=(n=v+i+65535)-65536*(i=Math.floor(n/65536)),m=(n=m+i+65535)-65536*(i=Math.floor(n/65536)),b=(n=b+i+65535)-65536*(i=Math.floor(n/65536)),E=(n=E+i+65535)-65536*(i=Math.floor(n/65536)),o+=i-1+37*(i-1),e[0]=o,e[1]=a,e[2]=s,e[3]=u,e[4]=c,e[5]=f,e[6]=l,e[7]=p,e[8]=h,e[9]=d,e[10]=y,e[11]=g,e[12]=v,e[13]=m,e[14]=b,e[15]=E}}).call(this,r(74).Buffer)},function(e,t,r){var n=r(4);r(33);var i=n.asn1;t.privateKeyValidator={name:"PrivateKeyInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},t.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{tagClass:i.Class.UNIVERSAL,type:i.Type.BITSTRING,constructed:!1,composed:!0,captureBitStringValue:"ed25519PublicKey"}]}},function(e,t,r){var n=r(4);r(8),r(31),r(77),e.exports=n.kem=n.kem||{};var i=n.jsbn.BigInteger;function o(e,t,r,i){e.generate=function(e,o){for(var a=new n.util.ByteBuffer,s=Math.ceil(o/i)+r,u=new n.util.ByteBuffer,c=r;c<s;++c){u.putInt32(c),t.start(),t.update(e+u.getBytes());var f=t.digest();a.putBytes(f.getBytes(i))}return a.truncate(a.length()-o),a.getBytes()}}n.kem.rsa={},n.kem.rsa.create=function(e,t){var r=(t=t||{}).prng||n.random,o={encrypt:function(t,o){var a=Math.ceil(t.n.bitLength()/8),s;do{s=new i(n.util.bytesToHex(r.getBytesSync(a)),16).mod(t.n)}while(s.compareTo(i.ONE)<=0);var u=a-(s=n.util.hexToBytes(s.toString(16))).length,c,f;return u>0&&(s=n.util.fillString(String.fromCharCode(0),u)+s),{encapsulation:t.encrypt(s,"NONE"),key:e.generate(s,o)}},decrypt:function(t,r,n){var i=t.decrypt(r,"NONE");return e.generate(i,n)}};return o},n.kem.kdf1=function(e,t){o(this,e,0,t||e.digestLength)},n.kem.kdf2=function(e,t){o(this,e,1,t||e.digestLength)}},function(e,t,r){e.exports=r(37),r(119),r(69),r(139),r(148)},function(e,t,r){var n=r(4);r(48),r(33),r(75),r(49),r(51),r(145),r(31),r(8),r(122);var i=n.asn1,o=e.exports=n.pkcs7=n.pkcs7||{};function a(e){var t={},r=[];if(!i.validate(e,o.asn1.recipientInfoValidator,t,r)){var a=new Error("Cannot read PKCS#7 RecipientInfo. ASN.1 object is not an PKCS#7 RecipientInfo.");throw a.errors=r,a}return{version:t.version.charCodeAt(0),issuer:n.pki.RDNAttributesAsArray(t.issuer),serialNumber:n.util.createBuffer(t.serial).toHex(),encryptedContent:{algorithm:i.derToOid(t.encAlgorithm),parameter:t.encParameter.value,content:t.encKey}}}function s(e){return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(e.version).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[n.pki.distinguishedNameToAsn1({attributes:e.issuer}),i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,n.util.hexToBytes(e.serialNumber))]),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.encryptedContent.algorithm).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")]),i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,e.encryptedContent.content)])}function u(e){for(var t=[],r=0;r<e.length;++r)t.push(a(e[r]));return t}function c(e){for(var t=[],r=0;r<e.length;++r)t.push(s(e[r]));return t}function f(e){var t={},r=[];if(!i.validate(e,o.asn1.signerInfoValidator,t,r)){var a=new Error("Cannot read PKCS#7 SignerInfo. ASN.1 object is not an PKCS#7 SignerInfo.");throw a.errors=r,a}var s={version:t.version.charCodeAt(0),issuer:n.pki.RDNAttributesAsArray(t.issuer),serialNumber:n.util.createBuffer(t.serial).toHex(),digestAlgorithm:i.derToOid(t.digestAlgorithm),signatureAlgorithm:i.derToOid(t.signatureAlgorithm),signature:t.signature,authenticatedAttributes:[],unauthenticatedAttributes:[]},u=t.authenticatedAttributes||[],c=t.unauthenticatedAttributes||[];return s}function l(e){var t=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(e.version).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[n.pki.distinguishedNameToAsn1({attributes:e.issuer}),i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,n.util.hexToBytes(e.serialNumber))]),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.digestAlgorithm).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")])]);if(e.authenticatedAttributesAsn1&&t.value.push(e.authenticatedAttributesAsn1),t.value.push(i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.signatureAlgorithm).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")])),t.value.push(i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,e.signature)),e.unauthenticatedAttributes.length>0){for(var r=i.create(i.Class.CONTEXT_SPECIFIC,1,!0,[]),o=0;o<e.unauthenticatedAttributes.length;++o){var a=e.unauthenticatedAttributes[o];r.values.push(d(a))}t.value.push(r)}return t}function p(e){for(var t=[],r=0;r<e.length;++r)t.push(f(e[r]));return t}function h(e){for(var t=[],r=0;r<e.length;++r)t.push(l(e[r]));return t}function d(e){var t;if(e.type===n.pki.oids.contentType)t=i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.value).getBytes());else if(e.type===n.pki.oids.messageDigest)t=i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,e.value.bytes());else if(e.type===n.pki.oids.signingTime){var r=new Date("1950-01-01T00:00:00Z"),o=new Date("2050-01-01T00:00:00Z"),a=e.value;if("string"==typeof a){var s=Date.parse(a);a=isNaN(s)?13===a.length?i.utcTimeToDate(a):i.generalizedTimeToDate(a):new Date(s)}t=a>=r&&a<o?i.create(i.Class.UNIVERSAL,i.Type.UTCTIME,!1,i.dateToUtcTime(a)):i.create(i.Class.UNIVERSAL,i.Type.GENERALIZEDTIME,!1,i.dateToGeneralizedTime(a))}return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.type).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SET,!0,[t])])}function y(e){return[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(n.pki.oids.data).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.algorithm).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,e.parameter.getBytes())]),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,e.content.getBytes())])]}function g(e,t,r){var o={},a=[],s;if(!i.validate(t,r,o,a)){var u=new Error("Cannot read PKCS#7 message. ASN.1 object is not a supported PKCS#7 message.");throw u.errors=u,u}if(i.derToOid(o.contentType)!==n.pki.oids.data)throw new Error("Unsupported PKCS#7 message. Only wrapped ContentType Data supported.");if(o.encryptedContent){var c="";if(n.util.isArray(o.encryptedContent))for(var f=0;f<o.encryptedContent.length;++f){if(o.encryptedContent[f].type!==i.Type.OCTETSTRING)throw new Error("Malformed PKCS#7 message, expecting encrypted content constructed of only OCTET STRING objects.");c+=o.encryptedContent[f].value}else c=o.encryptedContent;e.encryptedContent={algorithm:i.derToOid(o.encAlgorithm),parameter:n.util.createBuffer(o.encParameter.value),content:n.util.createBuffer(c)}}if(o.content){var c="";if(n.util.isArray(o.content))for(var f=0;f<o.content.length;++f){if(o.content[f].type!==i.Type.OCTETSTRING)throw new Error("Malformed PKCS#7 message, expecting content constructed of only OCTET STRING objects.");c+=o.content[f].value}else c=o.content;e.content=n.util.createBuffer(c)}return e.version=o.version.charCodeAt(0),e.rawCapture=o,o}function v(e){if(void 0===e.encryptedContent.key)throw new Error("Symmetric key not available.");if(void 0===e.content){var t;switch(e.encryptedContent.algorithm){case n.pki.oids["aes128-CBC"]:case n.pki.oids["aes192-CBC"]:case n.pki.oids["aes256-CBC"]:t=n.aes.createDecryptionCipher(e.encryptedContent.key);break;case n.pki.oids.desCBC:case n.pki.oids["des-EDE3-CBC"]:t=n.des.createDecryptionCipher(e.encryptedContent.key);break;default:throw new Error("Unsupported symmetric cipher, OID "+e.encryptedContent.algorithm)}if(t.start(e.encryptedContent.parameter),t.update(e.encryptedContent.content),!t.finish())throw new Error("Symmetric decryption failed.");e.content=t.output}}o.messageFromPem=function(e){var t=n.pem.decode(e)[0];if("PKCS7"!==t.type){var r=new Error('Could not convert PKCS#7 message from PEM; PEM header type is not "PKCS#7".');throw r.headerType=t.type,r}if(t.procType&&"ENCRYPTED"===t.procType.type)throw new Error("Could not convert PKCS#7 message from PEM; PEM is encrypted.");var a=i.fromDer(t.body);return o.messageFromAsn1(a)},o.messageToPem=function(e,t){var r={type:"PKCS7",body:i.toDer(e.toAsn1()).getBytes()};return n.pem.encode(r,{maxline:t})},o.messageFromAsn1=function(e){var t={},r=[];if(!i.validate(e,o.asn1.contentInfoValidator,t,r)){var a=new Error("Cannot read PKCS#7 message. ASN.1 object is not an PKCS#7 ContentInfo.");throw a.errors=r,a}var s=i.derToOid(t.contentType),u;switch(s){case n.pki.oids.envelopedData:u=o.createEnvelopedData();break;case n.pki.oids.encryptedData:u=o.createEncryptedData();break;case n.pki.oids.signedData:u=o.createSignedData();break;default:throw new Error("Cannot read PKCS#7 message. ContentType with OID "+s+" is not (yet) supported.")}return u.fromAsn1(t.content.value[0]),u},o.createSignedData=function(){var e=null;return e={type:n.pki.oids.signedData,version:1,certificates:[],crls:[],signers:[],digestAlgorithmIdentifiers:[],contentInfo:null,signerInfos:[],fromAsn1:function(t){if(g(e,t,o.asn1.signedDataValidator),e.certificates=[],e.crls=[],e.digestAlgorithmIdentifiers=[],e.contentInfo=null,e.signerInfos=[],e.rawCapture.certificates)for(var r=e.rawCapture.certificates.value,i=0;i<r.length;++i)e.certificates.push(n.pki.certificateFromAsn1(r[i]))},toAsn1:function(){e.contentInfo||e.sign();for(var t=[],r=0;r<e.certificates.length;++r)t.push(n.pki.certificateToAsn1(e.certificates[r]));var o=[],a=i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(e.version).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SET,!0,e.digestAlgorithmIdentifiers),e.contentInfo])]);return t.length>0&&a.value[0].value.push(i.create(i.Class.CONTEXT_SPECIFIC,0,!0,t)),o.length>0&&a.value[0].value.push(i.create(i.Class.CONTEXT_SPECIFIC,1,!0,o)),a.value[0].value.push(i.create(i.Class.UNIVERSAL,i.Type.SET,!0,e.signerInfos)),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.type).getBytes()),a])},addSigner:function(t){var r=t.issuer,i=t.serialNumber;if(t.certificate){var o=t.certificate;"string"==typeof o&&(o=n.pki.certificateFromPem(o)),r=o.issuer.attributes,i=o.serialNumber}var a=t.key;if(!a)throw new Error("Could not add PKCS#7 signer; no private key specified.");"string"==typeof a&&(a=n.pki.privateKeyFromPem(a));var s=t.digestAlgorithm||n.pki.oids.sha1;switch(s){case n.pki.oids.sha1:case n.pki.oids.sha256:case n.pki.oids.sha384:case n.pki.oids.sha512:case n.pki.oids.md5:break;default:throw new Error("Could not add PKCS#7 signer; unknown message digest algorithm: "+s)}var u=t.authenticatedAttributes||[];if(u.length>0){for(var c=!1,f=!1,l=0;l<u.length;++l){var p=u[l];if(c||p.type!==n.pki.oids.contentType){if(f||p.type!==n.pki.oids.messageDigest);else if(f=!0,c)break}else if(c=!0,f)break}if(!c||!f)throw new Error("Invalid signer.authenticatedAttributes. If signer.authenticatedAttributes is specified, then it must contain at least two attributes, PKCS #9 content-type and PKCS #9 message-digest.")}e.signers.push({key:a,version:1,issuer:r,serialNumber:i,digestAlgorithm:s,signatureAlgorithm:n.pki.oids.rsaEncryption,signature:null,authenticatedAttributes:u,unauthenticatedAttributes:[]})},sign:function(o){var a,s;(o=o||{},"object"!=typeof e.content||null===e.contentInfo)&&(e.contentInfo=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(n.pki.oids.data).getBytes())]),"content"in e&&(e.content instanceof n.util.ByteBuffer?a=e.content.bytes():"string"==typeof e.content&&(a=n.util.encodeUtf8(e.content)),o.detached?e.detachedContent=i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,a):e.contentInfo.value.push(i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,a)]))));0!==e.signers.length&&r(t())},verify:function(){throw new Error("PKCS#7 signature verification not yet implemented.")},addCertificate:function(t){"string"==typeof t&&(t=n.pki.certificateFromPem(t)),e.certificates.push(t)},addCertificateRevokationList:function(e){throw new Error("PKCS#7 CRL support not yet implemented.")}};function t(){for(var t={},r=0;r<e.signers.length;++r){var o=e.signers[r],a;(a=o.digestAlgorithm)in t||(t[a]=n.md[n.pki.oids[a]].create()),0===o.authenticatedAttributes.length?o.md=t[a]:o.md=n.md[n.pki.oids[a]].create()}for(var a in e.digestAlgorithmIdentifiers=[],t)e.digestAlgorithmIdentifiers.push(i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")]));return t}function r(t){var r;if(!(r=e.detachedContent?e.detachedContent:(r=e.contentInfo.value[1]).value[0]))throw new Error("Could not sign PKCS#7 message; there is no content to sign.");var o=i.derToOid(e.contentInfo.value[0].value),a=i.toDer(r);for(var s in a.getByte(),i.getBerValueLength(a),a=a.getBytes(),t)t[s].start().update(a);for(var u=new Date,c=0;c<e.signers.length;++c){var f=e.signers[c];if(0===f.authenticatedAttributes.length){if(o!==n.pki.oids.data)throw new Error("Invalid signer; authenticatedAttributes must be present when the ContentInfo content type is not PKCS#7 Data.")}else{f.authenticatedAttributesAsn1=i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[]);for(var l=i.create(i.Class.UNIVERSAL,i.Type.SET,!0,[]),p=0;p<f.authenticatedAttributes.length;++p){var y=f.authenticatedAttributes[p];y.type===n.pki.oids.messageDigest?y.value=t[f.digestAlgorithm].digest():y.type===n.pki.oids.signingTime&&(y.value||(y.value=u)),l.value.push(d(y)),f.authenticatedAttributesAsn1.value.push(d(y))}a=i.toDer(l).getBytes(),f.md.start().update(a)}f.signature=f.key.sign(f.md,"RSASSA-PKCS1-V1_5")}e.signerInfos=h(e.signers)}},o.createEncryptedData=function(){var e=null;return e={type:n.pki.oids.encryptedData,version:0,encryptedContent:{algorithm:n.pki.oids["aes256-CBC"]},fromAsn1:function(t){g(e,t,o.asn1.encryptedDataValidator)},decrypt:function(t){void 0!==t&&(e.encryptedContent.key=t),v(e)}}},o.createEnvelopedData=function(){var e=null;return e={type:n.pki.oids.envelopedData,version:0,recipients:[],encryptedContent:{algorithm:n.pki.oids["aes256-CBC"]},fromAsn1:function(t){var r=g(e,t,o.asn1.envelopedDataValidator);e.recipients=u(r.recipientInfos.value)},toAsn1:function(){return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.type).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(e.version).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SET,!0,c(e.recipients)),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,y(e.encryptedContent))])])])},findRecipient:function(t){for(var r=t.issuer.attributes,n=0;n<e.recipients.length;++n){var i=e.recipients[n],o=i.issuer;if(i.serialNumber===t.serialNumber&&o.length===r.length){for(var a=!0,s=0;s<r.length;++s)if(o[s].type!==r[s].type||o[s].value!==r[s].value){a=!1;break}if(a)return i}}return null},decrypt:function(t,r){if(void 0===e.encryptedContent.key&&void 0!==t&&void 0!==r)switch(t.encryptedContent.algorithm){case n.pki.oids.rsaEncryption:case n.pki.oids.desCBC:var i=r.decrypt(t.encryptedContent.content);e.encryptedContent.key=n.util.createBuffer(i);break;default:throw new Error("Unsupported asymmetric cipher, OID "+t.encryptedContent.algorithm)}v(e)},addRecipient:function(t){e.recipients.push({version:0,issuer:t.issuer.attributes,serialNumber:t.serialNumber,encryptedContent:{algorithm:n.pki.oids.rsaEncryption,key:t.publicKey}})},encrypt:function(t,r){if(void 0===e.encryptedContent.content){var i,o,a;switch(r=r||e.encryptedContent.algorithm,t=t||e.encryptedContent.key,r){case n.pki.oids["aes128-CBC"]:i=16,o=16,a=n.aes.createEncryptionCipher;break;case n.pki.oids["aes192-CBC"]:i=24,o=16,a=n.aes.createEncryptionCipher;break;case n.pki.oids["aes256-CBC"]:i=32,o=16,a=n.aes.createEncryptionCipher;break;case n.pki.oids["des-EDE3-CBC"]:i=24,o=8,a=n.des.createEncryptionCipher;break;default:throw new Error("Unsupported symmetric cipher, OID "+r)}if(void 0===t)t=n.util.createBuffer(n.random.getBytes(i));else if(t.length()!=i)throw new Error("Symmetric key has wrong length; got "+t.length()+" bytes, expected "+i+".");e.encryptedContent.algorithm=r,e.encryptedContent.key=t,e.encryptedContent.parameter=n.util.createBuffer(n.random.getBytes(o));var s=a(t);if(s.start(e.encryptedContent.parameter.copy()),s.update(e.content),!s.finish())throw new Error("Symmetric encryption failed.");e.encryptedContent.content=s.output}for(var u=0;u<e.recipients.length;++u){var c=e.recipients[u];if(void 0===c.encryptedContent.content){if(c.encryptedContent.algorithm!==n.pki.oids.rsaEncryption)throw new Error("Unsupported asymmetric cipher, OID "+c.encryptedContent.algorithm);c.encryptedContent.content=c.encryptedContent.key.encrypt(e.encryptedContent.key.data)}}}}}},function(e,t,r){var n=r(4);r(48),r(68),r(119),r(69),r(8);var i=e.exports=n.ssh=n.ssh||{};function o(e,t){var r=t.toString(16);r[0]>="8"&&(r="00"+r);var i=n.util.hexToBytes(r);e.putInt32(i.length),e.putBytes(i)}function a(e,t){e.putInt32(t.length),e.putString(t)}function s(){for(var e=n.md.sha1.create(),t=arguments.length,r=0;r<t;++r)e.update(arguments[r]);return e.digest()}i.privateKeyToPutty=function(e,t,r){var i="ssh-rsa",u=""===(t=t||"")?"none":"aes256-cbc",c="PuTTY-User-Key-File-2: "+i+"\r\n";c+="Encryption: "+u+"\r\n",c+="Comment: "+(r=r||"")+"\r\n";var f=n.util.createBuffer();a(f,i),o(f,e.e),o(f,e.n);var l=n.util.encode64(f.bytes(),64),p=Math.floor(l.length/66)+1;c+="Public-Lines: "+p+"\r\n",c+=l;var h=n.util.createBuffer(),d;if(o(h,e.d),o(h,e.p),o(h,e.q),o(h,e.qInv),t){var y=h.length()+16-1;y-=y%16;var g=s(h.bytes());g.truncate(g.length()-y+h.length()),h.putBuffer(g);var v=n.util.createBuffer();v.putBuffer(s("\0\0\0\0",t)),v.putBuffer(s("\0\0\0",t));var m=n.aes.createEncryptionCipher(v.truncate(8),"CBC");m.start(n.util.createBuffer().fillWithByte(0,16)),m.update(h.copy()),m.finish();var b=m.output;b.truncate(16),d=n.util.encode64(b.bytes(),64)}else d=n.util.encode64(h.bytes(),64);c+="\r\nPrivate-Lines: "+(p=Math.floor(d.length/66)+1)+"\r\n",c+=d;var E=s("putty-private-key-file-mac-key",t),T=n.util.createBuffer();a(T,i),a(T,u),a(T,r),T.putInt32(f.length()),T.putBuffer(f),T.putInt32(h.length()),T.putBuffer(h);var S=n.hmac.create();return S.start("sha1",E),S.update(T.bytes()),c+="\r\nPrivate-MAC: "+S.digest().toHex()+"\r\n"},i.publicKeyToOpenSSH=function(e,t){var r="ssh-rsa";t=t||"";var i=n.util.createBuffer();return a(i,r),o(i,e.e),o(i,e.n),r+" "+n.util.encode64(i.bytes())+" "+t},i.privateKeyToOpenSSH=function(e,t){return t?n.pki.encryptRsaPrivateKey(e,t,{legacy:!0,algorithm:"aes128"}):n.pki.privateKeyToPem(e)},i.getPublicKeyFingerprint=function(e,t){var r=(t=t||{}).md||n.md.md5.create(),i="ssh-rsa",s=n.util.createBuffer();a(s,i),o(s,e.e),o(s,e.n),r.start(),r.update(s.getBytes());var u=r.digest();if("hex"===t.encoding){var c=u.toHex();return t.delimiter?c.match(/.{2}/g).join(t.delimiter):c}if("binary"===t.encoding)return u.getBytes();if(t.encoding)throw new Error('Unknown encoding "'+t.encoding+'".');return u}},function(e,t,r){var n=r(4);r(147),r(149),r(8);var i="forge.task",o=0,a={},s=0;n.debug.set(i,"tasks",a);var u={};n.debug.set(i,"queues",u);var c="?",f=30,l=20,p="ready",h="running",d="blocked",y="sleeping",g="done",v="error",m="stop",b="start",E="block",T="unblock",S="sleep",w="wakeup",C="cancel",_="fail",I={};I[p]={},I[p][m]=p,I[p][b]=h,I[p][C]=g,I[p][_]=v,I[h]={},I[h][m]=p,I[h][b]=h,I[h][E]=d,I[h][T]=h,I[h][S]=y,I[h][w]=h,I[h][C]=g,I[h][_]=v,I[d]={},I[d][m]=d,I[d][b]=d,I[d][E]=d,I[d][T]=d,I[d][S]=d,I[d][w]=d,I[d][C]=g,I[d][_]=v,I[y]={},I[y][m]=y,I[y][b]=y,I[y][E]=y,I[y][T]=y,I[y][S]=y,I[y][w]=y,I[y][C]=g,I[y][_]=v,I[g]={},I[g][m]=g,I[g][b]=g,I[g][E]=g,I[g][T]=g,I[g][S]=g,I[g][w]=g,I[g][C]=g,I[g][_]=v,I[v]={},I[v][m]=v,I[v][b]=v,I[v][E]=v,I[v][T]=v,I[v][S]=v,I[v][w]=v,I[v][C]=v,I[v][_]=v;var A=function(e){this.id=-1,this.name=e.name||c,this.parent=e.parent||null,this.run=e.run,this.subtasks=[],this.error=!1,this.state=p,this.blocks=0,this.timeoutId=null,this.swapTime=null,this.userData=null,this.id=s++,a[this.id]=this};A.prototype.debug=function(e){e=e||"",n.log.debug(i,e,"[%s][%s] task:",this.id,this.name,this,"subtasks:",this.subtasks.length,"queue:",u)},A.prototype.next=function(e,t){"function"==typeof e&&(t=e,e=this.name);var r=new A({run:t,name:e,parent:this});return r.state=h,r.type=this.type,r.successCallback=this.successCallback||null,r.failureCallback=this.failureCallback||null,this.subtasks.push(r),this},A.prototype.parallel=function(e,t){return n.util.isArray(e)&&(t=e,e=this.name),this.next(e,function(r){var i=r;i.block(t.length);for(var o=function(e,r){n.task.start({type:e,run:function(e){t[r](e)},success:function(e){i.unblock()},failure:function(e){i.unblock()}})},a=0;a<t.length;a++){var s,u;o(e+"__parallel-"+r.id+"-"+a,a)}})},A.prototype.stop=function(){this.state=I[this.state][m]},A.prototype.start=function(){this.error=!1,this.state=I[this.state][b],this.state===h&&(this.start=new Date,this.run(this),O(this,0))},A.prototype.block=function(e){e=void 0===e?1:e,this.blocks+=e,this.blocks>0&&(this.state=I[this.state][E])},A.prototype.unblock=function(e){return e=void 0===e?1:e,this.blocks-=e,0===this.blocks&&this.state!==g&&(this.state=h,O(this,0)),this.blocks},A.prototype.sleep=function(e){e=void 0===e?0:e,this.state=I[this.state][S];var t=this;this.timeoutId=setTimeout(function(){t.timeoutId=null,t.state=h,O(t,0)},e)},A.prototype.wait=function(e){e.wait(this)},A.prototype.wakeup=function(){this.state===y&&(cancelTimeout(this.timeoutId),this.timeoutId=null,this.state=h,O(this,0))},A.prototype.cancel=function(){this.state=I[this.state][C],this.permitsNeeded=0,null!==this.timeoutId&&(cancelTimeout(this.timeoutId),this.timeoutId=null),this.subtasks=[]},A.prototype.fail=function(e){if(this.error=!0,P(this,!0),e)e.error=this.error,e.swapTime=this.swapTime,e.userData=this.userData,O(e,0);else{if(null!==this.parent){for(var t=this.parent;null!==t.parent;)t.error=this.error,t.swapTime=this.swapTime,t.userData=this.userData,t=t.parent;P(t,!0)}this.failureCallback&&this.failureCallback(this)}};var R=function(e){e.error=!1,e.state=I[e.state][b],setTimeout(function(){e.state===h&&(e.swapTime=+new Date,e.run(e),O(e,0))},0)},O=function(e,t){var r=t>f||+new Date-e.swapTime>l,n=function(t){if(t++,e.state===h)if(r&&(e.swapTime=+new Date),e.subtasks.length>0){var n=e.subtasks.shift();n.error=e.error,n.swapTime=e.swapTime,n.userData=e.userData,n.run(n),n.error||O(n,t)}else P(e),e.error||null!==e.parent&&(e.parent.error=e.error,e.parent.swapTime=e.swapTime,e.parent.userData=e.userData,O(e.parent,t))};r?setTimeout(n,0):n(t)},P=function(e,t){e.state=g,delete a[e.id],null===e.parent&&(e.type in u?0===u[e.type].length?n.log.error(i,"[%s][%s] task queue empty [%s]",e.id,e.name,e.type):u[e.type][0]!==e?n.log.error(i,"[%s][%s] task not first in queue [%s]",e.id,e.name,e.type):(u[e.type].shift(),0===u[e.type].length?delete u[e.type]:u[e.type][0].start()):n.log.error(i,"[%s][%s] task queue missing [%s]",e.id,e.name,e.type),t||(e.error&&e.failureCallback?e.failureCallback(e):!e.error&&e.successCallback&&e.successCallback(e)))};e.exports=n.task=n.task||{},n.task.start=function(e){var t=new A({run:e.run,name:e.name||c});t.type=e.type,t.successCallback=e.success||null,t.failureCallback=e.failure||null,t.type in u?u[e.type].push(t):(u[t.type]=[t],R(t))},n.task.cancel=function(e){e in u&&(u[e]=[u[e][0]])},n.task.createCondition=function(){var e={tasks:{},wait:function(t){t.id in e.tasks||(t.block(),e.tasks[t.id]=t)},notify:function(){var t=e.tasks;for(var r in e.tasks={},t)t[r].unblock()}};return e}},function(e,t){},function(e,t,r){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",a=r.toStringTag||"@@toStringTag";function s(r,n,i,a){var s=n&&n.prototype instanceof c?n:c,f=Object.create(s.prototype);return o(f,"_invoke",function(r,n,i){var o,a,s,c=0,f=i||[],l=!1,p={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function t(r,n){return o=r,a=0,s=e,p.n=n,u}};function h(r,n){for(a=r,s=n,t=0;!l&&c&&!i&&t<f.length;t++){var i,o=f[t],h=p.p,d=o[2];r>3?(i=d===n)&&(s=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=e):o[0]<=h&&((i=r<2&&h<o[1])?(a=0,p.v=n,p.n=o[1]):h<d&&(i=r<3||o[0]>n||n>d)&&(o[4]=r,o[5]=n,p.n=d,a=0))}if(i||r>1)return u;throw l=!0,n}return function(i,f,d){if(c>1)throw TypeError("Generator is already running");for(l&&1===f&&h(f,d),a=f,s=d;(t=a<2?e:s)||!l;){o||(a?a<3?(a>1&&(p.n=-1),h(a,s)):p.n=s:p.v=s);try{if(c=2,o){if(a||(i="next"),t=o[i]){if(!(t=t.call(o,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,a<2&&(a=0)}else 1===a&&(t=o.return)&&t.call(o),a<2&&(s=TypeError("The iterator does not provide a '"+i+"' method"),a=1);o=e}else if((t=(l=p.n<0)?s:r.call(n,p))!==u)break}catch(t){o=e,a=1,s=t}finally{c=1}}return{value:t,done:l}}}(r,i,a),!0),f}var u={};function c(){}function f(){}function l(){}t=Object.getPrototypeOf;var p=[][n]?t(t([][n]())):(o(t={},n,function(){return this}),t),h=l.prototype=c.prototype=Object.create(p);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,o(e,a,"GeneratorFunction")),e.prototype=Object.create(h),e}return f.prototype=l,o(h,"constructor",l),o(l,"constructor",f),f.displayName="GeneratorFunction",o(l,a,"GeneratorFunction"),o(h),o(h,a,"Generator"),o(h,n,function(){return this}),o(h,"toString",function(){return"[object Generator]"}),(i=function e(){return{w:s,m:d}})()}function o(e,t,r,n){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}o=function e(t,r,n,a){function s(e,r){o(t,e,function(t){return this._invoke(e,r,t)})}r?i?i(t,r,{value:n,enumerable:!a,configurable:!a,writable:!a}):t[r]=n:(s("next",0),s("throw",1),s("return",2))},o(e,t,r,n)}function a(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function s(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var o=e.apply(t,r);function s(e){a(o,n,i,s,u,"next",e)}function u(e){a(o,n,i,s,u,"throw",e)}s(void 0)})}}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,l(n.key),n)}}function f(e,t,r){return t&&c(e.prototype,t),r&&c(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function l(e){var t=p(e,"string");return"symbol"==n(t)?t:t+""}function p(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function h(e,t,r){return t=v(t),d(e,g()?Reflect.construct(t,r||[],v(e).constructor):t.apply(e,r))}function d(e,t){if(t&&("object"==n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return y(e)}function y(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function g(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(g=function t(){return!!e})()}function v(e){return v=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},v(e)}function m(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&b(e,t)}function b(e,t){return b=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},b(e,t)}var E=r(67),T=r(117),S=r(151);e.exports=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e.privateKeyPem,n=e.publicKeyPem,i=e.creator,o=e.date,a=e.domain,s=e.nonce;return u(this,t),h(this,t,[{type:"GraphSignature2012",privateKeyPem:r,publicKeyPem:n,creator:i,date:o,domain:a,nonce:s}])}return m(t,e),f(t,[{key:"canonize",value:function(){var e=s(i().m(function e(t,r){var n,o,a;return i().w(function(e){for(;;)if(0===e.n)return n=r.documentLoader,o=r.expansionMap,a=r.skipExpansion,e.a(2,E.canonize(t,{algorithm:"URGNA2012",format:"application/n-quads",documentLoader:n,expansionMap:o,skipExpansion:a}))},e)}));function t(t,r){return e.apply(this,arguments)}return t}()},{key:"createVerifyData",value:function(){var e=s(i().m(function e(t){var r,n,o,a,s,u,c;return i().w(function(e){for(;;)switch(e.n){case 0:return r=t.document,n=t.proof,o=t.documentLoader,a=t.expansionMap,e.n=1,this.canonize(r,{documentLoader:o,expansionMap:a});case 1:return s=e.v,u="",null!==n.nonce&&void 0!==n.nonce&&(u+=n.nonce),u+=n.created,u+=s,null!==n.domain&&void 0!==n.domain&&(u+="@"+n.domain),c=new T.util.ByteBuffer(u,"utf8"),e.a(2,T.util.binary.raw.decode(c.getBytes()))}},e,this)}));function t(t){return e.apply(this,arguments)}return t}()}])}(S)},function(e,t,r){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a(n.key),n)}}function o(e,t,r){return t&&i(e.prototype,t),r&&i(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function a(e){var t=s(e,"string");return"symbol"==n(t)?t:t+""}function s(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t,r){return t=h(t),f(e,p()?Reflect.construct(t,r||[],h(e).constructor):t.apply(e,r))}function f(e,t){if(t&&("object"==n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return l(e)}function l(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function p(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(p=function t(){return!!e})()}function h(e){return h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},h(e)}function d(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&y(e,t)}function y(e,t){return y=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},y(e,t)}var g,v=r(73).RSAKeyPair,m=r(114);e.exports=function(e){function t(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=r.signer,i=r.key,o=r.creator,a=r.verificationMethod,s=r.proof,f=r.date,l=r.useNativeCanonize;return u(this,t),(e=c(this,t,[{type:"RsaSignature2018",alg:"PS256",LDKeyClass:v,creator:o,verificationMethod:a,signer:n,key:i,proof:s,date:f,useNativeCanonize:l}])).requiredKeyType="RsaVerificationKey2018",e}return d(t,e),o(t)}(m)},function(e,t,r){"use strict";var n={};e.exports=n,n.purposes={AssertionProofPurpose:r(203),AuthenticationProofPurpose:r(204),ControllerProofPurpose:r(72),ProofPurpose:r(131),PublicKeyProofPurpose:r(130)}},function(e,t,r){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a(n.key),n)}}function o(e,t,r){return t&&i(e.prototype,t),r&&i(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function a(e){var t=s(e,"string");return"symbol"==n(t)?t:t+""}function s(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t,r){return t=h(t),f(e,p()?Reflect.construct(t,r||[],h(e).constructor):t.apply(e,r))}function f(e,t){if(t&&("object"==n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return l(e)}function l(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function p(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(p=function t(){return!!e})()}function h(e){return h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},h(e)}function d(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&y(e,t)}function y(e,t){return y=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},y(e,t)}var g=r(72);e.exports=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e.term,n=void 0===r?"assertionMethod":r,i=e.controller,o=e.date,a=e.maxTimestampDelta,s=void 0===a?1/0:a;return u(this,t),c(this,t,[{term:n,controller:i,date:o,maxTimestampDelta:s}])}return d(t,e),o(t)}(g)},function(e,t,r){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",a=r.toStringTag||"@@toStringTag";function s(r,n,i,a){var s=n&&n.prototype instanceof c?n:c,f=Object.create(s.prototype);return o(f,"_invoke",function(r,n,i){var o,a,s,c=0,f=i||[],l=!1,p={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function t(r,n){return o=r,a=0,s=e,p.n=n,u}};function h(r,n){for(a=r,s=n,t=0;!l&&c&&!i&&t<f.length;t++){var i,o=f[t],h=p.p,d=o[2];r>3?(i=d===n)&&(s=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=e):o[0]<=h&&((i=r<2&&h<o[1])?(a=0,p.v=n,p.n=o[1]):h<d&&(i=r<3||o[0]>n||n>d)&&(o[4]=r,o[5]=n,p.n=d,a=0))}if(i||r>1)return u;throw l=!0,n}return function(i,f,d){if(c>1)throw TypeError("Generator is already running");for(l&&1===f&&h(f,d),a=f,s=d;(t=a<2?e:s)||!l;){o||(a?a<3?(a>1&&(p.n=-1),h(a,s)):p.n=s:p.v=s);try{if(c=2,o){if(a||(i="next"),t=o[i]){if(!(t=t.call(o,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,a<2&&(a=0)}else 1===a&&(t=o.return)&&t.call(o),a<2&&(s=TypeError("The iterator does not provide a '"+i+"' method"),a=1);o=e}else if((t=(l=p.n<0)?s:r.call(n,p))!==u)break}catch(t){o=e,a=1,s=t}finally{c=1}}return{value:t,done:l}}}(r,i,a),!0),f}var u={};function c(){}function f(){}function l(){}t=Object.getPrototypeOf;var p=[][n]?t(t([][n]())):(o(t={},n,function(){return this}),t),h=l.prototype=c.prototype=Object.create(p);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,o(e,a,"GeneratorFunction")),e.prototype=Object.create(h),e}return f.prototype=l,o(h,"constructor",l),o(l,"constructor",f),f.displayName="GeneratorFunction",o(l,a,"GeneratorFunction"),o(h),o(h,a,"Generator"),o(h,n,function(){return this}),o(h,"toString",function(){return"[object Generator]"}),(i=function e(){return{w:s,m:d}})()}function o(e,t,r,n){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}o=function e(t,r,n,a){function s(e,r){o(t,e,function(t){return this._invoke(e,r,t)})}r?i?i(t,r,{value:n,enumerable:!a,configurable:!a,writable:!a}):t[r]=n:(s("next",0),s("throw",1),s("return",2))},o(e,t,r,n)}function a(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function s(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var o=e.apply(t,r);function s(e){a(o,n,i,s,u,"next",e)}function u(e){a(o,n,i,s,u,"throw",e)}s(void 0)})}}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,l(n.key),n)}}function f(e,t,r){return t&&c(e.prototype,t),r&&c(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function l(e){var t=p(e,"string");return"symbol"==n(t)?t:t+""}function p(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function h(e,t,r){return t=E(t),d(e,g()?Reflect.construct(t,r||[],E(e).constructor):t.apply(e,r))}function d(e,t){if(t&&("object"==n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return y(e)}function y(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function g(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(g=function t(){return!!e})()}function v(e,t,r,n){var i=m(E(1&n?e.prototype:e),t,r);return 2&n&&"function"==typeof i?function(e){return i.apply(r,e)}:i}function m(){return m="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=b(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}},m.apply(null,arguments)}function b(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=E(e)););return e}function E(e){return E=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},E(e)}function T(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&S(e,t)}function S(e,t){return S=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},S(e,t)}var w=r(72);e.exports=function(e){function t(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=r.term,i=void 0===n?"authentication":n,o=r.controller,a=r.challenge,s=r.date,c=r.domain,f=r.maxTimestampDelta,l=void 0===f?1/0:f;if(u(this,t),e=h(this,t,[{term:i,controller:o,date:s,maxTimestampDelta:l}]),"string"!=typeof a)throw new TypeError('"challenge" must be a string.');if(void 0!==c&&"string"!=typeof c)throw new TypeError('"domain" must be a string.');return e.challenge=a,e.domain=c,e}return T(t,e),f(t,[{key:"validate",value:function(){var e=s(i().m(function e(r,n){var o,a,s,u;return i().w(function(e){for(;;)switch(e.p=e.n){case 0:if(o=n.verificationMethod,a=n.documentLoader,s=n.expansionMap,e.p=1,r.challenge===this.challenge){e.n=2;break}throw new Error("The challenge is not as expected; "+'challenge="'.concat(r.challenge,'", expected="').concat(this.challenge,'"'));case 2:if(void 0===this.domain||r.domain===this.domain){e.n=3;break}throw new Error("The domain is not as expected; "+'domain="'.concat(r.domain,'", expected="').concat(this.domain,'"'));case 3:return e.a(2,v(t,"validate",this,3)([r,{verificationMethod:o,documentLoader:a,expansionMap:s}]));case 4:return e.p=4,u=e.v,e.a(2,{valid:!1,error:u})}},e,this,[[1,4]])}));function r(t,r){return e.apply(this,arguments)}return r}()},{key:"update",value:function(){var e=s(i().m(function e(r,n){var o,a,s,u;return i().w(function(e){for(;;)switch(e.n){case 0:return o=n.document,a=n.suite,s=n.documentLoader,u=n.expansionMap,e.n=1,v(t,"update",this,3)([r,{document:o,suite:a,documentLoader:s,expansionMap:u}]);case 1:return(r=e.v).challenge=this.challenge,void 0!==this.domain&&(r.domain=this.domain),e.a(2,r)}},e,this)}));function r(t,r){return e.apply(this,arguments)}return r}()}])}(w)},,,,,,,,,,,,,function(e,t,r){"use strict";r.r(t),r.d(t,"CsModule",function(){return rr});var n=r(86),i=r(172),o=r(2),a=r(125),s=r(0),u=r(16),c=function(e,t,r,n){var i=arguments.length,o=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n,a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,r,o):a(t,r))||o);return i>3&&o&&Object.defineProperty(t,r,o),o},f=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=function(){function e(){this.http=window.cordova.plugin.http}return e.prototype.setSerializer=function(e){this.http.setDataSerializer(e)},e.prototype.addHeaders=function(e){for(var t in e)e.hasOwnProperty(t)&&this.http.setHeader("*",t,e[t])},e.prototype.addHeader=function(e,t){this.http.setHeader("*",e,t)},e.prototype.get=function(e,t,r,n,i){return this.invokeRequest(s.CsHttpRequestType.GET,e+t,n,r,i)},e.prototype.delete=function(e,t,r,n,i){return this.invokeRequest(s.CsHttpRequestType.DELETE,e+t,n,r,i)},e.prototype.patch=function(e,t,r,n,i){return this.invokeRequest(s.CsHttpRequestType.PATCH,e+t,n,r,i)},e.prototype.post=function(e,t,r,n,i){return this.invokeRequest(s.CsHttpRequestType.POST,e+t,n,r,i)},e.prototype.invokeRequest=function(e,t,r,n,i){var o=new a.a,c={method:e.toLowerCase(),headers:n,serializer:i};return e===s.CsHttpRequestType.POST||e===s.CsHttpRequestType.PATCH?c.data=r:e!==s.CsHttpRequestType.GET&&e!==s.CsHttpRequestType.DELETE||(c.params=r),this.http.sendRequest(t,c,function(e){var t=new s.CsResponse;try{t.body=JSON.parse(e.data)}catch(r){t.body=e.data}t.responseCode=e.status,t.errorMesg="",t.headers=e.headers,o.next(t),o.complete()},function(e){var r=new s.CsResponse;if(0===e.status)return o.error(new u.d("\n "+t+" -\n "+(e.error||"")+"\n ")),void o.complete();try{try{r.body=JSON.parse(e.error)}catch(t){if(r.body=e.error,e.status<=0)throw t}r.responseCode=e.status,r.errorMesg="SERVER_ERROR",r.headers=e.headers,r.responseCode>=400&&r.responseCode<=499?o.error(new u.b("\n "+t+" -\n "+(e.error||"")+"\n ",r)):o.error(new u.c("\n "+t+" -\n "+(e.error||"")+"\n ",r))}catch(r){o.error(new u.d("\n "+t+" -\n "+(e.error||"")+"\n ")),o.complete()}}),o},e=c([Object(o.injectable)(),f("design:paramtypes",[])],e)}(),p=r(5),h=r(35),d=r(13),y=function(e){return function(t){return e.then(function(e){t.closed||(t.next(e),t.complete())},function(e){return t.error(e)}).then(null,d.a),t}};function g(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}var v=g(),m=v,b=function(e){return function(t){for(var r=e[v]();;){var n=void 0;try{n=r.next()}catch(e){return t.error(e),t}if(n.done){t.complete();break}if(t.next(n.value),t.closed)break}return"function"==typeof r.return&&t.add(function(){r.return&&r.return()}),t}},E=r(21),T=function(e){return function(t){var r=e[E.a]();if("function"!=typeof r.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return r.subscribe(t)}},S=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e};function w(e){return!!e&&"function"!=typeof e.subscribe&&"function"==typeof e.then}var C=r(34),_=function(e){if(e&&"function"==typeof e[E.a])return T(e);if(S(e))return Object(h.a)(e);if(w(e))return y(e);if(e&&"function"==typeof e[v])return b(e);var t=Object(C.a)(e)?"an invalid object":"'"+e+"'",r;throw new TypeError("You provided "+t+" where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.")},I=r(10);function A(e,t){return new p.a(function(r){var n=new I.a;return n.add(t.schedule(function(){var i=e[E.a]();n.add(i.subscribe({next:function(e){n.add(t.schedule(function(){return r.next(e)}))},error:function(e){n.add(t.schedule(function(){return r.error(e)}))},complete:function(){n.add(t.schedule(function(){return r.complete()}))}}))})),n})}function R(e,t){return new p.a(function(r){var n=new I.a;return n.add(t.schedule(function(){return e.then(function(e){n.add(t.schedule(function(){r.next(e),n.add(t.schedule(function(){return r.complete()}))}))},function(e){n.add(t.schedule(function(){return r.error(e)}))})})),n})}var O=r(22);function P(e,t){if(!e)throw new Error("Iterable cannot be null");return new p.a(function(r){var n=new I.a,i;return n.add(function(){i&&"function"==typeof i.return&&i.return()}),n.add(t.schedule(function(){i=e[v](),n.add(t.schedule(function(){if(!r.closed){var e,t;try{var n=i.next();e=n.value,t=n.done}catch(e){return void r.error(e)}t?r.complete():(r.next(e),this.schedule())}}))})),n})}function B(e){return e&&"function"==typeof e[E.a]}function k(e){return e&&"function"==typeof e[v]}function N(e,t){if(null!=e){if(B(e))return A(e,t);if(w(e))return R(e,t);if(S(e))return Object(O.a)(e,t);if(k(e)||"string"==typeof e)return P(e,t)}throw new TypeError((null!==e&&typeof e||e)+" is not observable")}function U(e,t){return t?N(e,t):e instanceof p.a?e:new p.a(_(e))}var D=new p.a(function(e){return e.complete()});function x(e){return e?L(e):D}function L(e){return new p.a(function(t){return e.schedule(function(){return t.complete()})})}function j(e){return new p.a(function(t){var r,n;try{r=e()}catch(e){return void t.error(e)}return(r?U(r):x()).subscribe(t)})}var M=r(126),V=function(){return V=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},V.apply(this,arguments)},F=function(e,t,r,n){var i=arguments.length,o=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n,a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,r,o):a(t,r))||o);return i>3&&o&&Object.defineProperty(t,r,o),o},K=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},H=function(e,t,r,n){function i(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=Promise))(function(r,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){e.done?r(e.value):i(e.value).then(a,s)}u((n=n.apply(e,t||[])).next())})},q=function(e,t){var r={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},n,i,o,a;return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(e){return function(t){return u([e,t])}}function u(a){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=2&a[0]?i.return:a[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,a[1])).done)return o;switch(i=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,i=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(!(o=r.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){r=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){r.label=a[1];break}if(6===a[0]&&r.label<o[1]){r.label=o[1],o=a;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(a);break}o[2]&&r.ops.pop(),r.trys.pop();continue}a=t.call(e,r)}catch(e){a=[6,e],i=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}},G=function(){function e(){this.headers={}}var t;return t=e,e.mapError=function(e,t){return H(this,void 0,void 0,function(){return q(this,function(r){if(u.c.isInstance(t)||u.b.isInstance(t))throw t;throw new u.d("\n "+e+" -\n "+(t||"")+"\n ")})})},e.mapResponse=function(e){return H(this,void 0,void 0,function(){var t,r;return q(this,function(n){switch(n.label){case 0:return(t=new s.CsResponse).responseCode=e.status,r=t,[4,e.text()];case 1:r.body=n.sent(),t.headers={},e.headers&&e.headers.forEach(function(e,r){return t.headers[r]=e});try{t.body=JSON.parse(t.body)}catch(e){t.body=t.body}if(e.ok)return[2,t];throw t.errorMesg="SERVER_ERROR",e.status>=400&&e.status<=499?new u.b("\n "+e.url+"\n ",t):new u.c("\n "+e.url+"\n ",t)}})})},e.prototype.setSerializer=function(e){this.serializer=e},e.prototype.addHeader=function(e,t){this.headers[e]=t},e.prototype.addHeaders=function(e){this.headers=V(V({},this.headers),e)},e.prototype.get=function(e,t,r,n,i){var o=new URL(e+t);return this.addHeader("content-type","text/plain"),"object"==typeof n&&Object.keys(n).forEach(function(e){o.searchParams.append(e,n[e])}),this.invokeRequest(s.CsHttpRequestType.GET,o,r,void 0)},e.prototype.delete=function(e,t,r,n,i){var o=new URL(e+t);return this.addHeader("content-type","text/plain"),"object"==typeof n&&Object.keys(n).forEach(function(e){o.searchParams.append(e,n[e])}),this.invokeRequest(s.CsHttpRequestType.DELETE,o,r,void 0)},e.prototype.patch=function(e,t,r,n,i){var o=new URL(e+t);return i===s.CsHttpSerializer.URLENCODED&&"object"==typeof n?(this.addHeader("content-type","application/x-www-form-urlencoded"),n=M.stringify(n)):"object"==typeof n&&(delete this.headers["content-type"],n=JSON.stringify(n)),this.invokeRequest(s.CsHttpRequestType.PATCH,o,r,n)},e.prototype.post=function(e,t,r,n,i){var o=new URL(e+t);return i===s.CsHttpSerializer.URLENCODED&&"object"==typeof n?(this.addHeader("content-type","application/x-www-form-urlencoded"),n=M.stringify(n)):"object"==typeof n&&(delete this.headers["content-type"],n=JSON.stringify(n)),this.invokeRequest(s.CsHttpRequestType.POST,o,r,n)},e.prototype.invokeRequest=function(e,r,n,i){var o=this;return j(function(){return fetch(r.toString(),{method:e,headers:V(V({},o.headers),n),body:i,credentials:"same-origin"}).then(t.mapResponse).catch(function(e){return t.mapError(r.toString(),e)})})},e=t=F([Object(o.injectable)(),K("design:paramtypes",[])],e)}(),z={CONTAINER:Symbol.for("CONTAINER"),core:{HTTP_ADAPTER:Symbol.for("HTTP_ADAPTER"),global:{CHANNEL_ID:Symbol.for("CHANNEL_ID"),PRODUCER_ID:Symbol.for("PRODUCER_ID"),DEVICE_ID:Symbol.for("DEVICE_ID"),SESSION_ID:Symbol.for("SESSION_ID"),APP_VERSION:Symbol.for("APP_VERSION")},api:{HOST:Symbol.for("HOST"),authentication:{USER_TOKEN:Symbol.for("USER_TOKEN"),MANAGED_USER_TOKEN:Symbol.for("MANAGED_USER_TOKEN"),BEARER_TOKEN:Symbol.for("BEARER_TOKEN")}},HTTP_SERVICE:Symbol.for("HTTP_SERVICE"),CLIENT_STORAGE:Symbol.for("CLIENT_STORAGE")},services:{user:{USER_SERVICE_API_PATH:Symbol.for("USER_SERVICE_API_PATH"),USER_SERVICE:Symbol.for("USER_SERVICE")},content:{CONTENT_SERVICE_HIERARCHY_API_PATH:Symbol.for("CONTENT_SERVICE_HIERARCHY_API_PATH"),CONTENT_SERVICE_QUESTION_LIST_API_PATH:Symbol.for("CONTENT_SERVICE_QUESTION_LIST_API_PATH"),CONTENT_SERVICE:Symbol.for("CONTENT_SERVICE")},group:{GROUP_SERVICE_API_PATH:Symbol.for("GROUP_SERVICE_API_PATH"),GROUP_SERVICE_DATA_API_PATH:Symbol.for("GROUP_SERVICE_DATA_API_PATH"),GROUP_SERVICE:Symbol.for("GROUP_SERVICE"),GROUP_ACTIVITY_SERVICE:Symbol.for("GROUP_ACTIVITY_SERVICE"),GROUP_SERVICE_UPDATE_GUIDELINES_API_PATH:Symbol.for("GROUP_SERVICE_UPDATE_GUIDELINES_API_PATH")},framework:{FRAMEWORK_SERVICE_API_PATH:Symbol.for("FRAMEWORK_SERVICE_API_PATH"),FRAMEWORK_SERVICE:Symbol.for("FRAMEWORK_SERVICE")},location:{LOCATION_SERVICE_API_PATH:Symbol.for("LOCATION_SERVICE_API_PATH"),LOCATION_SERVICE:Symbol.for("LOCATION_SERVICE")},course:{COURSE_SERVICE_API_PATH:Symbol.for("COURSE_SERVICE_API_PATH"),COURSE_SERVICE_CERT_REGISTRATION_API_PATH:Symbol.for("COURSE_SERVICE_CERT_REGISTRATION_API_PATH"),COURSE_SERVICE:Symbol.for("COURSE_SERVICE")},form:{FORM_SERVICE_API_PATH:Symbol.for("FORM_SERVICE_API_PATH"),FORM_SERVICE:Symbol.for("FORM_SERVICE")},systemSettings:{SYSTEM_SETTINGS_SERVICE_API_PATH:Symbol.for("SYSTEM_SETTINGS_SERVICE_API_PATH"),SYSTEM_SETTINGS_SERVICE:Symbol.for("SYSTEM_SETTINGS_SERVICE")},discussion:{DISCUSSION_SERVICE_API_PATH:Symbol.for("DISCUSSION_SERVICE_API_PATH"),DISCUSSION_SERVICE:Symbol.for("DISCUSSION_SERVICE")},notification:{NOTIFICATION_SERVICE_API_PATH:Symbol.for("NOTIFICATION_SERVICE_API_PATH"),NOTIFICATION_SERVICE:Symbol.for("NOTIFICATION_SERVICE")},certificate:{CERTIFICATE_SERVICE_API_PATH:Symbol.for("CERTIFICATE_SERVICE_API_PATH"),CERTIFICATE_SERVICE_API_PATH_LEGACY:Symbol.for("CERTIFICATE_SERVICE_API_PATH_LEGACY"),RC_API_PATH:Symbol.for("RC_API_PATH"),CERTIFICATE_SERVICE:Symbol.for("CERTIFICATE_SERVICE")}}},Y=function(){function e(){}return e}(),W=r(169),Q=function(){function e(e){this.container=e}return e.prototype.interceptRequest=function(e){var t=this.container.get(z.core.api.authentication.BEARER_TOKEN);return t&&(e.headers.Authorization="Bearer "+t),Object(W.a)(e)},e}(),X=function(){function e(e){this.container=e}return e.prototype.interceptRequest=function(e){var t=this.container.get(z.core.api.authentication.USER_TOKEN),r=this.container.get(z.core.api.authentication.MANAGED_USER_TOKEN);return t&&(e.headers["X-Authenticated-User-Token"]=t),r&&(e.headers["X-Authenticated-For"]=r),Object(W.a)(e)},e}(),Z=r(50),$=function(){return $=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},$.apply(this,arguments)},J=function(e,t,r,n){var i=arguments.length,o=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n,a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,r,o):a(t,r))||o);return i>3&&o&&Object.defineProperty(t,r,o),o},ee=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},te=function(e,t){return function(r,n){t(r,n,e)}},re=function(e,t,r,n){function i(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=Promise))(function(r,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){e.done?r(e.value):i(e.value).then(a,s)}u((n=n.apply(e,t||[])).next())})},ne=function(e,t){var r={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},n,i,o,a;return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(e){return function(t){return u([e,t])}}function u(a){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=2&a[0]?i.return:a[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,a[1])).done)return o;switch(i=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,i=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(!(o=r.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){r=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){r.label=a[1];break}if(6===a[0]&&r.label<o[1]){r.label=o[1],o=a;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(a);break}o[2]&&r.ops.pop(),r.trys.pop();continue}a=t.call(e,r)}catch(e){a=[6,e],i=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}},ie=function(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;for(var n=Array(e),i=0,t=0;t<r;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,i++)n[i]=o[a];return n},oe=function(){function e(e,t,r){this.container=e,this.http=t,this.clientStorage=r,this._requestInterceptors=[],this._responseInterceptors=[]}return Object.defineProperty(e.prototype,"bearerTokenInjectRequestInterceptor",{get:function(){return this._bearerTokenInjectRequestInterceptor||(this._bearerTokenInjectRequestInterceptor=new Q(this.container)),this._bearerTokenInjectRequestInterceptor},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"userTokenInjectRequestInterceptor",{get:function(){return this._userTokenInjectRequestInterceptor||(this._userTokenInjectRequestInterceptor=new X(this.container)),this._userTokenInjectRequestInterceptor},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"host",{get:function(){return this.container.get(z.core.api.HOST)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"channelId",{get:function(){return this.container.get(z.core.global.CHANNEL_ID)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"deviceId",{get:function(){return this.container.get(z.core.global.DEVICE_ID)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"producerId",{get:function(){return this.container.get(z.core.global.PRODUCER_ID)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sessionId",{get:function(){return this.container.get(z.core.global.SESSION_ID)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"appVersion",{get:function(){return this.container.get(z.core.global.APP_VERSION)},enumerable:!1,configurable:!0}),e.prototype.init=function(){var e=this;this.clientStorage&&this.clientStorage.getItem(Z.a.TRACE_ID).then(function(t){e._traceId=t||""})},Object.defineProperty(e.prototype,"requestInterceptors",{get:function(){return this._requestInterceptors},set:function(e){this._requestInterceptors=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"responseInterceptors",{get:function(){return this._responseInterceptors},set:function(e){this._responseInterceptors=e},enumerable:!1,configurable:!0}),e.prototype.fetch=function(e){var t=this,r;return this.addGlobalHeader(),this.buildInterceptorsFromRequest(e),U(re(t,void 0,void 0,function(){var t,r,n,i,o,a;return ne(this,function(c){switch(c.label){case 0:return[4,this.interceptRequest(e)];case 1:e=c.sent(),c.label=2;case 2:switch(c.trys.push([2,14,,21]),r=e.type){case s.CsHttpRequestType.GET:return[3,3];case s.CsHttpRequestType.PATCH:return[3,5];case s.CsHttpRequestType.POST:return[3,7];case s.CsHttpRequestType.DELETE:return[3,9]}return[3,11];case 3:return[4,this.http.get(e.host||this.host,e.path,e.headers,e.parameters,e.serializer).toPromise()];case 4:return t=c.sent(),[3,12];case 5:return[4,this.http.patch(e.host||this.host,e.path,e.headers,e.body,e.serializer).toPromise()];case 6:return t=c.sent(),[3,12];case 7:return[4,this.http.post(e.host||this.host,e.path,e.headers,e.body,e.serializer).toPromise()];case 8:return t=c.sent(),[3,12];case 9:return[4,this.http.delete(e.host||this.host,e.path,e.headers,e.parameters,e.serializer).toPromise()];case 10:return t=c.sent(),[3,12];case 11:throw new Error("Unsupported type");case 12:return n=t.headers["X-Trace-Enabled"]||"",this.clientStorage&&n!==this._traceId&&this.clientStorage.setItem(Z.a.TRACE_ID,n),[4,this.interceptResponse(e,t)];case 13:return[2,c.sent()];case 14:if(i=c.sent(),o=function(t){if(t.responseCode>=400&&t.responseCode<=499)throw new u.b("\n "+(e.host+e.path)+" -\n "+(t.errorMesg||"")+"\n ",t);if(t.responseCode>=500&&t.responseCode<=599)throw new u.c("\n "+(e.host+e.path)+" -\n "+(t.errorMesg||"")+"\n ",t);return t},!u.b.isInstance(i)&&!u.c.isInstance(i))return[3,19];c.label=15;case 15:return c.trys.push([15,17,,18]),[4,this.interceptResponse(e,i.response)];case 16:return t=c.sent(),[2,o(t)];case 17:if((a=c.sent()).responseCode)return[2,o(a)];throw a;case 18:return[3,20];case 19:throw i;case 20:return[3,21];case 21:return[2]}})}))},e.prototype.addGlobalHeader=function(){return re(this,void 0,void 0,function(){var e;return ne(this,function(t){return e=$($($($($($({Accept:"application/json","Content-Type":"application/json","Access-Control-Allow-Origin":"*"},this.channelId?{"X-Channel-Id":this.channelId}:{}),this.producerId?{"X-App-Id":this.producerId}:{}),this.deviceId?{"X-Device-Id":this.deviceId}:{}),this.sessionId?{"X-Session-Id":this.sessionId}:{}),this.appVersion?{"X-App-Ver":this.appVersion}:{}),this._traceId?{"X-Request-Id":this._traceId}:{}),this.http.addHeaders(e),[2]})})},e.prototype.interceptRequest=function(e){return re(this,void 0,void 0,function(){var t,r,n,i;return ne(this,function(o){switch(o.label){case 0:t=ie(this.requestInterceptors,e.requestInterceptors),r=0,n=t,o.label=1;case 1:return r<n.length?[4,(i=n[r]).interceptRequest(e).toPromise()]:[3,4];case 2:e=o.sent(),o.label=3;case 3:return r++,[3,1];case 4:return[2,e]}})})},e.prototype.interceptResponse=function(e,t){return re(this,void 0,void 0,function(){var r,n,i,o;return ne(this,function(a){switch(a.label){case 0:r=ie(this.responseInterceptors,e.responseInterceptors),n=0,i=r,a.label=1;case 1:return n<i.length?[4,(o=i[n]).interceptResponse(e,t).toPromise()]:[3,4];case 2:t=a.sent(),a.label=3;case 3:return n++,[3,1];case 4:if(t.responseCode!==s.CsHttpResponseCode.HTTP_SUCCESS)throw t;return[2,t]}})})},e.prototype.buildInterceptorsFromRequest=function(e){e.withBearerToken&&-1===e.requestInterceptors.indexOf(this.bearerTokenInjectRequestInterceptor)&&e.requestInterceptors.push(this.bearerTokenInjectRequestInterceptor),e.withUserToken&&-1===e.requestInterceptors.indexOf(this.userTokenInjectRequestInterceptor)&&e.requestInterceptors.push(this.userTokenInjectRequestInterceptor),this.http.setSerializer(e.serializer)},e=J([Object(o.injectable)(),te(0,Object(o.inject)(z.CONTAINER)),te(1,Object(o.inject)(z.core.HTTP_ADAPTER)),te(2,Object(o.optional)()),te(2,Object(o.inject)(z.core.CLIENT_STORAGE)),ee("design:paramtypes",[o.Container,Y,Z.a])],e)}(),ae=r(23),se=r(6),ue=r(9);function ce(e,t){return function r(n){if("function"!=typeof e)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return n.lift(new fe(e,t))}}var fe=function(){function e(e,t){this.project=e,this.thisArg=t}return e.prototype.call=function(e,t){return t.subscribe(new le(e,this.project,this.thisArg))},e}(),le=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.project=r,i.count=0,i.thisArg=n||i,i}return se.a(t,e),t.prototype._next=function(e){var t;try{t=this.project.call(this.thisArg,e,this.count++)}catch(e){return void this.destination.error(e)}this.destination.next(t)},t}(ue.a),pe=function(e){function t(t){var r=e.call(this)||this;return r.parent=t,r}return se.a(t,e),t.prototype._next=function(e){this.parent.notifyNext(e)},t.prototype._error=function(e){this.parent.notifyError(e),this.unsubscribe()},t.prototype._complete=function(){this.parent.notifyComplete(),this.unsubscribe()},t}(ue.a),he=function(e){function t(t,r,n){var i=e.call(this)||this;return i.parent=t,i.outerValue=r,i.outerIndex=n,i}return se.a(t,e),t.prototype._next=function(e){this.parent.notifyNext(this.outerValue,e,this.outerIndex,this)},t.prototype._error=function(e){this.parent.notifyError(e),this.unsubscribe()},t.prototype._complete=function(){this.parent.notifyComplete(this),this.unsubscribe()},t}(ue.a),de=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return se.a(t,e),t.prototype.notifyNext=function(e){this.destination.next(e)},t.prototype.notifyError=function(e){this.destination.error(e)},t.prototype.notifyComplete=function(){this.destination.complete()},t}(ue.a),ye=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return se.a(t,e),t.prototype.notifyNext=function(e,t,r,n){this.destination.next(t)},t.prototype.notifyError=function(e){this.destination.error(e)},t.prototype.notifyComplete=function(e){this.destination.complete()},t}(ue.a);function ge(e,t){if(!t.closed){if(e instanceof p.a)return e.subscribe(t);var r;try{r=_(e)(t)}catch(e){t.error(e)}return r}}function ve(e,t,r){return void 0===r&&(r=Number.POSITIVE_INFINITY),"function"==typeof t?function(n){return n.pipe(ve(function(r,n){return U(e(r,n)).pipe(ce(function(e,i){return t(r,e,n,i)}))},r))}:("number"==typeof t&&(r=t),function(t){return t.lift(new me(e,r))})}var me=function(){function e(e,t){void 0===t&&(t=Number.POSITIVE_INFINITY),this.project=e,this.concurrent=t}return e.prototype.call=function(e,t){return t.subscribe(new be(e,this.project,this.concurrent))},e}(),be=function(e){function t(t,r,n){void 0===n&&(n=Number.POSITIVE_INFINITY);var i=e.call(this,t)||this;return i.project=r,i.concurrent=n,i.hasCompleted=!1,i.buffer=[],i.active=0,i.index=0,i}return se.a(t,e),t.prototype._next=function(e){this.active<this.concurrent?this._tryNext(e):this.buffer.push(e)},t.prototype._tryNext=function(e){var t,r=this.index++;try{t=this.project(e,r)}catch(e){return void this.destination.error(e)}this.active++,this._innerSub(t)},t.prototype._innerSub=function(e){var t=new pe(this),r=this.destination;r.add(t);var n=ge(e,t);n!==t&&r.add(n)},t.prototype._complete=function(){this.hasCompleted=!0,0===this.active&&0===this.buffer.length&&this.destination.complete(),this.unsubscribe()},t.prototype.notifyNext=function(e){this.destination.next(e)},t.prototype.notifyComplete=function(){var e=this.buffer;this.active--,e.length>0?this._next(e.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},t}(de),Ee=ve,Te=r(127),Se=function(){return Se=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Se.apply(this,arguments)},we=function(e,t,r,n){var i=arguments.length,o=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n,a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,r,o):a(t,r))||o);return i>3&&o&&Object.defineProperty(t,r,o),o},Ce=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},_e=function(e,t){return function(r,n){t(r,n,e)}},Ie=function(e,t,r,n){function i(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=Promise))(function(r,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){e.done?r(e.value):i(e.value).then(a,s)}u((n=n.apply(e,t||[])).next())})},Ae=function(e,t){var r={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},n,i,o,a;return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(e){return function(t){return u([e,t])}}function u(a){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=2&a[0]?i.return:a[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,a[1])).done)return o;switch(i=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,i=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(!(o=r.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){r=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){r.label=a[1];break}if(6===a[0]&&r.label<o[1]){r.label=o[1],o=a;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(a);break}o[2]&&r.ops.pop(),r.trys.pop();continue}a=t.call(e,r)}catch(e){a=[6,e],i=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}},Re=function(){function e(e,t,r,n,i){this.httpService=e,this.apiPath=t,this.container=r,this.formService=n,this.updateGroupGuidelinesApiPath=i}return Object.defineProperty(e.prototype,"activityService",{get:function(){return this._activityService||(this._activityService=this.container.get(z.services.group.GROUP_ACTIVITY_SERVICE)),this._activityService},enumerable:!1,configurable:!0}),e.prototype.create=function(e,t){var r=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.POST).withPath((t?t.apiPath:this.apiPath)+"/create").withBearerToken(!0).withUserToken(!0).withBody({request:e}).build();return this.httpService.fetch(r).pipe(ce(function(e){return e.body.result}))},e.prototype.updateById=function(e,t,r){var n=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.PATCH).withPath((r?r.apiPath:this.apiPath)+"/update").withBearerToken(!0).withUserToken(!0).withBody({request:Se({groupId:e},t)}).build();return this.httpService.fetch(n).pipe(ce(function(e){return e.body.result}))},e.prototype.addMembers=function(e,t,r){var n=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.PATCH).withPath((r?r.apiPath:this.apiPath)+"/update").withBearerToken(!0).withUserToken(!0).withBody({request:{groupId:e,members:{add:t.members}}}).build();return this.httpService.fetch(n).pipe(ce(function(e){return e.body.result}))},e.prototype.removeMembers=function(e,t,r){var n=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.PATCH).withPath((r?r.apiPath:this.apiPath)+"/update").withBearerToken(!0).withUserToken(!0).withBody({request:{groupId:e,members:{remove:t.userIds}}}).build();return this.httpService.fetch(n).pipe(ce(function(e){return e.body.result}))},e.prototype.updateMembers=function(e,t,r){var n=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.PATCH).withPath((r?r.apiPath:this.apiPath)+"/update").withBearerToken(!0).withUserToken(!0).withBody({request:{groupId:e,members:{edit:t.members}}}).build();return this.httpService.fetch(n).pipe(ce(function(e){return e.body.result}))},e.prototype.addActivities=function(e,t,r){var n=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.PATCH).withPath((r?r.apiPath:this.apiPath)+"/update").withBearerToken(!0).withUserToken(!0).withBody({request:{groupId:e,activities:{add:t.activities}}}).build();return this.httpService.fetch(n).pipe(ce(function(e){return e.body.result}))},e.prototype.updateActivities=function(e,t,r){var n=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.PATCH).withPath((r?r.apiPath:this.apiPath)+"/update").withBearerToken(!0).withUserToken(!0).withBody({request:{groupId:e,activities:{edit:t.activities}}}).build();return this.httpService.fetch(n).pipe(ce(function(e){return e.body.result}))},e.prototype.removeActivities=function(e,t,r){var n=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.PATCH).withPath((r?r.apiPath:this.apiPath)+"/update").withBearerToken(!0).withUserToken(!0).withBody({request:{groupId:e,activities:{remove:t.activityIds}}}).build();return this.httpService.fetch(n).pipe(ce(function(e){return e.body.result}))},e.prototype.getById=function(e,t,r){var n=this,i=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.GET).withPath((r?r.apiPath:this.apiPath)+"/read/"+e).withParameters(t?{fields:(o=[],t.includeMembers&&o.push("members"),t.includeActivities&&o.push("activities"),o.join(","))}:{}).withBearerToken(!0).withUserToken(!0).build(),o;return this.httpService.fetch(i).pipe(ce(function(e){return e.body.result}),ve(function(e){return Ie(n,void 0,void 0,function(){var r,n,i;return Ae(this,function(o){switch(o.label){case 0:return t&&t.groupActivities&&t.includeActivities?[4,this.getSupportedActivities().toPromise()]:[2,ae.CsGroup.fromJSON(e)];case 1:return r=o.sent(),n=r.data.fields.sort(function(e,t){return e.index-t.index}),i=e.activities,delete e.activities,e.activitiesGrouped=n.map(function(e){var t=i.filter(function(t){return t.type===e.activityType}).sort(function(t,r){for(var n=0,i=0,o=e.sortBy;i<o.length;i++){var a=o[i];if(0!==n)break;for(var s in a)s in a&&(n=String(t.activityInfo[s]).localeCompare(String(r.activityInfo[s])),n="asc"===a[s]?n:-n)}return n});return{title:e.title,translations:e.translations,count:t.length,isEnabled:e.isEnabled,objectType:e.objectType,items:t}}),[2,ae.CsGroup.fromJSON(e)]}})})}))},e.prototype.search=function(e,t){var r=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.POST).withPath((t?t.apiPath:this.apiPath)+"/list").withBearerToken(!0).withUserToken(!0).withBody({request:e}).build();return this.httpService.fetch(r).pipe(ce(function(e){return e.body.result.group.sort(function(e,t){var r=t.updatedOn||t.createdOn,n=e.updatedOn||e.createdOn;return e.status===ae.GroupEntityStatus.SUSPENDED&&t.status!==ae.GroupEntityStatus.SUSPENDED?1:t.status===ae.GroupEntityStatus.SUSPENDED&&e.status!==ae.GroupEntityStatus.SUSPENDED?-1:Te(r.slice(0,r.lastIndexOf(":"))).valueOf()-Te(n.slice(0,n.lastIndexOf(":"))).valueOf()}).map(function(e){return ae.CsGroup.fromJSON(e)})}))},e.prototype.deleteById=function(e,t){var r=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.POST).withPath((t?t.apiPath:this.apiPath)+"/delete").withBearerToken(!0).withUserToken(!0).withBody({request:{groupId:e}}).build();return this.httpService.fetch(r).pipe(ce(function(e){return e.body.result}))},e.prototype.suspendById=function(e,t){return this.updateById(e,{status:ae.GroupEntityStatus.SUSPENDED},t)},e.prototype.reactivateById=function(e,t){return this.updateById(e,{status:ae.GroupEntityStatus.ACTIVE},t)},e.prototype.getSupportedActivities=function(e){var t={type:"group",subType:"supported_activities",action:"list"};return this.formService.getForm(t).pipe(ce(function(e){return e.data.fields=e.data.fields.filter(function(e){return"content"===e.objectType.toLowerCase()}),e}))},e.prototype.updateGroupGuidelines=function(e,t){var r=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.PATCH).withPath((t?t.apiPath:this.updateGroupGuidelinesApiPath)+"/update").withBearerToken(!0).withUserToken(!0).withBody({request:Se({},e)}).build();return this.httpService.fetch(r).pipe(ce(function(e){return e.body.result}))},e.prototype.getActivityDataById=function(e,t){var r=e.activitiesGrouped,n=[],i;return r?(this.groupContentsByActivityType(r).activities[t.type].forEach(function(e){t.id===e.identifier&&(n=e)}),n):[]},e.prototype.groupContentsByActivityType=function(e){var t=e.reduce(function(e,t){return e[t.title]=t.items.map(function(e){var t;return Se(Se({},e.activityInfo),{type:e.type,cardImg:e["activityInfo.appIcon"]||""})}),e},{});return Object.keys(t).forEach(function(e){return t[e].length<=0&&delete t[e]}),{activities:t}},e=we([Object(o.injectable)(),_e(0,Object(o.inject)(z.core.HTTP_SERVICE)),_e(1,Object(o.inject)(z.services.group.GROUP_SERVICE_API_PATH)),_e(2,Object(o.inject)(z.CONTAINER)),_e(3,Object(o.inject)(z.services.form.FORM_SERVICE)),_e(4,Object(o.optional)()),_e(4,Object(o.inject)(z.services.group.GROUP_SERVICE_UPDATE_GUIDELINES_API_PATH)),Ce("design:paramtypes",[Object,String,o.Container,Object,String])],e)}(),Oe=function(e,t,r,n){var i=arguments.length,o=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n,a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,r,o):a(t,r))||o);return i>3&&o&&Object.defineProperty(t,r,o),o},Pe=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},Be=function(e,t){return function(r,n){t(r,n,e)}},ke=function(){function e(e,t,r){this.httpService=e,this.hierarchyApiPath=t,this.questionListApiPath=r}return e.prototype.getQuestionSetHierarchy=function(e,t){var r=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.GET).withPath((t?t.hierarchyApiPath:this.hierarchyApiPath)+"/hierarchy/"+e).withBearerToken(!0).withUserToken(!0).build();return this.httpService.fetch(r).pipe(ce(function(e){return e.body.result}))},e.prototype.getQuestionSetRead=function(e,t,r){var n=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.GET).withPath((r?r.hierarchyApiPath:this.hierarchyApiPath)+"/read/"+e).withParameters(t||{}).withBearerToken(!0).withUserToken(!0).build();return this.httpService.fetch(n).pipe(ce(function(e){return e.body.result}))},e.prototype.getQuestionList=function(e,t){var r=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.POST).withPath((t?t.questionListApiPath:this.questionListApiPath)+"/list").withBearerToken(!0).withUserToken(!0).withBody({request:{search:{identifier:e}}}).build();return this.httpService.fetch(r).pipe(ce(function(e){return e.body.result}))},e=Oe([Object(o.injectable)(),Be(0,Object(o.inject)(z.core.HTTP_SERVICE)),Be(1,Object(o.inject)(z.services.content.CONTENT_SERVICE_HIERARCHY_API_PATH)),Be(2,Object(o.inject)(z.services.content.CONTENT_SERVICE_QUESTION_LIST_API_PATH)),Pe("design:paramtypes",[Object,String,String])],e)}();function Ne(e){return function t(r){var n=new Ue(e),i=r.lift(n);return n.caught=i}}var Ue=function(){function e(e){this.selector=e}return e.prototype.call=function(e,t){return t.subscribe(new De(e,this.selector,this.caught))},e}(),De=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.selector=r,i.caught=n,i}return se.a(t,e),t.prototype.error=function(t){if(!this.isStopped){var r=void 0;try{r=this.selector(t,this.caught)}catch(t){return void e.prototype.error.call(this,t)}this._unsubscribeAndRecycle();var n=new pe(this);this.add(n);var i=ge(r,n);i!==n&&this.add(i)}},t}(de),xe=function(){function e(){this.categoryConfig={}}return Object.defineProperty(e,"instance",{get:function(){return this._instance||(this._instance=new e),this._instance},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"config",{get:function(){return this.categoryConfig},enumerable:!1,configurable:!0}),e.prototype.updateState=function(e,t){this.categoryConfig[e]=t},e.prototype.dispose=function(){this.categoryConfig={}},e}(),Le=function(){return Le=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Le.apply(this,arguments)},je=function(e,t,r,n){var i=arguments.length,o=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n,a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,r,o):a(t,r))||o);return i>3&&o&&Object.defineProperty(t,r,o),o},Me=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},Ve=function(e,t){return function(r,n){t(r,n,e)}},Fe=function(){function e(e,t,r){this.httpService=e,this.apiPath=t,this.formService=r}return e.prototype.getFramework=function(e,t,r){var n=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.GET).withPath((r?r.apiPath:this.apiPath)+"/read/"+e).withParameters(Le({},(null==t?void 0:t.requiredCategories.length)?{categories:t.requiredCategories.join(",")}:{})).withBearerToken(!0).build();return this.httpService.fetch(n).pipe(ce(function(e){return e.body.result.framework}))},e.prototype.getFrameworkConfig=function(e,t,r){var n=this,i;return xe.instance.config[e]?Object(W.a)(xe.instance.config[e]):(null==t?void 0:t.framework)?Object(W.a)(this.transformCategoriesToConfig(null==t?void 0:t.framework.categories)):(null==r?void 0:r.params)?this.formService.getForm(null==r?void 0:r.params,{apiPath:r.apiPath}).pipe(ce(function(e){return e.data.fields}),Ne(function(r){var i;return n.transformFramework(e,null!==(i=null==t?void 0:t.apiPath)&&void 0!==i?i:"")})):this.transformFramework(e,null!==(i=null==t?void 0:t.apiPath)&&void 0!==i?i:"")},e.prototype.getFrameworkConfigMap=function(e,t,r){return this.getFrameworkConfig(e,t,r).pipe(ce(function(e){return e.reduce(function(e,t){var r;return Le(Le({},e),((r={})[t.identifier]=t,r))},{})}))},e.prototype.transformFramework=function(e,t){var r=this;return this.getFramework(e,{requiredCategories:[]},{apiPath:t}).pipe(ce(function(e){return r.transformCategoriesToConfig(e.categories)}))},e.prototype.transformCategoriesToConfig=function(e){return e.map(function(e){var t=e.index,r=e.code,n=e.name;return{code:r,label:n,identifier:"fwCategory"+t,index:t,placeHolder:"Select "+r,name:n}})},e=je([Object(o.injectable)(),Ve(0,Object(o.inject)(z.core.HTTP_SERVICE)),Ve(1,Object(o.inject)(z.services.framework.FRAMEWORK_SERVICE_API_PATH)),Ve(2,Object(o.inject)(z.services.form.FORM_SERVICE)),Me("design:paramtypes",[Object,String,Object])],e)}(),Ke=function(e,t,r,n){var i=arguments.length,o=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n,a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,r,o):a(t,r))||o);return i>3&&o&&Object.defineProperty(t,r,o),o},He=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},qe=function(e,t){return function(r,n){t(r,n,e)}},Ge=function(){function e(e,t){this.httpService=e,this.apiPath=t}return e.prototype.searchLocations=function(e,t){var r=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.POST).withPath((t?t.apiPath:this.apiPath)+"/search").withBearerToken(!0).withUserToken(!1).withBody({request:e}).build();return this.httpService.fetch(r).pipe(ce(function(e){return e.body.result.response}))},e=Ke([Object(o.injectable)(),qe(0,Object(o.inject)(z.core.HTTP_SERVICE)),qe(1,Object(o.inject)(z.services.location.LOCATION_SERVICE_API_PATH)),He("design:paramtypes",[Object,String])],e)}(),ze=function(e,t,r,n){var i=arguments.length,o=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n,a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,r,o):a(t,r))||o);return i>3&&o&&Object.defineProperty(t,r,o),o},Ye=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},We=function(e,t){return function(r,n){t(r,n,e)}},Qe=function(){function e(e,t,r){this.httpService=e,this.apiPath=t,this.certRegistrationApiPath=r}return e.prototype.getUserEnrolledCourses=function(e,t,r){void 0===t&&(t={});var n=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.POST).withPath((r?r.apiPath:this.apiPath)+"/user/enrollment/list").withParameters(t).withBearerToken(!0).withUserToken(!0).withBody({request:e}).build();return this.httpService.fetch(n).pipe(ce(function(e){return e.body.result.courses}))},e.prototype.getSignedCourseCertificate=function(e,t){if(!(this.certRegistrationApiPath||t&&t.certRegistrationApiPath))throw new Error("Required certRegistrationApiPath configuration");var r=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.GET).withPath((t?t.certRegistrationApiPath:this.certRegistrationApiPath)+"/download/"+e).withBearerToken(!0).withUserToken(!0).build();return this.httpService.fetch(r).pipe(ce(function(e){return e.body.result}))},e.prototype.getContentState=function(e,t){var r=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.POST).withPath((t?t.apiPath:this.apiPath)+"/content/state/read").withBearerToken(!0).withUserToken(!0).withBody({request:e}).build();return this.httpService.fetch(r).pipe(ce(function(e){return e.body.result.contentList.map(function(e){return e.score?(e.bestScore=e.score.reduce(function(e,t){return e?e.totalScore<t.totalScore?t:e:t},void 0),e):e})}))},e.prototype.updateContentState=function(e,t){var r=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.PATCH).withPath((t?t.apiPath:this.apiPath)+"/content/state/update").withBearerToken(!0).withUserToken(!0).withBody({request:e}).build();return this.httpService.fetch(r).pipe(ce(function(e){return e.body.result}))},e=ze([Object(o.injectable)(),We(0,Object(o.inject)(z.core.HTTP_SERVICE)),We(1,Object(o.inject)(z.services.course.COURSE_SERVICE_API_PATH)),We(2,Object(o.optional)()),We(2,Object(o.inject)(z.services.course.COURSE_SERVICE_CERT_REGISTRATION_API_PATH)),Ye("design:paramtypes",[Object,String,String])],e)}(),Xe=function(){return Xe=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Xe.apply(this,arguments)},Ze=function(e,t,r,n){var i=arguments.length,o=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n,a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,r,o):a(t,r))||o);return i>3&&o&&Object.defineProperty(t,r,o),o},$e=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},Je=function(e,t){return function(r,n){t(r,n,e)}},et=function(e,t,r,n){function i(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=Promise))(function(r,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){e.done?r(e.value):i(e.value).then(a,s)}u((n=n.apply(e,t||[])).next())})},tt=function(e,t){var r={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},n,i,o,a;return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(e){return function(t){return u([e,t])}}function u(a){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=2&a[0]?i.return:a[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,a[1])).done)return o;switch(i=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,i=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(!(o=r.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){r=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){r.label=a[1];break}if(6===a[0]&&r.label<o[1]){r.label=o[1],o=a;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(a);break}o[2]&&r.ops.pop(),r.trys.pop();continue}a=t.call(e,r)}catch(e){a=[6,e],i=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}},rt=function(){function e(e,t){this.httpService=e,this.apiPath=t}return e.prototype.checkUserExists=function(e,t,r){var n=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.GET).withPath((r?r.apiPath:this.apiPath)+"/exists/"+e.key+"/"+e.value).withBearerToken(!0).withUserToken(!0).withParameters(Xe({},t?Xe({captchaResponse:t.token},t.app?{app:t.app}:{}):{})).build();return this.httpService.fetch(n).pipe(ce(function(e){return e.body.result}))},e.prototype.updateUserDeclarations=function(e,t){var r=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.PATCH).withPath((t?t.apiPath:this.apiPath)+"/declarations").withBearerToken(!0).withUserToken(!0).withBody({request:{declarations:e}}).build();return this.httpService.fetch(r).pipe(ce(function(e){return e.body.result}))},e.prototype.updateConsent=function(e,t){var r=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.POST).withPath((t?t.apiPath:this.apiPath)+"/consent/update").withBearerToken(!0).withUserToken(!0).withBody({request:{consent:e}}).build();return this.httpService.fetch(r).pipe(ce(function(e){return e.body.result}))},e.prototype.getConsent=function(e,t){var r=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.POST).withPath((t?t.apiPath:this.apiPath)+"/consent/read").withBearerToken(!0).withUserToken(!0).withBody({request:{consent:{filters:e}}}).build();return this.httpService.fetch(r).pipe(ce(function(e){return e.body.result}))},e.prototype.getUserFeed=function(e,t){var r=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.GET).withPath((t?t.apiPath:this.apiPath)+"/feed/"+e).withBearerToken(!0).withUserToken(!0).build();return this.httpService.fetch(r).pipe(ce(function(e){return e.body.result.response.userFeed}))},e.prototype.updateUserFeedEntry=function(e,t,r,n,i){var o=this;return j(function(){return et(o,void 0,void 0,function(){var o,a,u;return tt(this,function(c){switch(c.label){case 0:return[4,this.getUserFeed(e,i).toPromise()];case 1:return o=c.sent(),(a=o.find(function(e){return e.id===t&&e.category===r}))?(u=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.PATCH).withPath((i?i.apiPath:this.apiPath)+"/feed/update").withBearerToken(!0).withUserToken(!0).withBody({request:{userId:e,priority:a.priority,category:a.category,feedId:a.id,status:n.status,data:a.data}}).build(),[2,this.httpService.fetch(u).pipe(ce(function(e){return e.body.result.response})).toPromise()]):[2,{}]}})})})},e.prototype.deleteUserFeedEntry=function(e,t,r,n){var i=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.POST).withPath((n?n.apiPath:this.apiPath)+"/feed/delete").withBearerToken(!0).withUserToken(!0).withBody({request:{userId:e,category:r,feedId:t}}).build();return this.httpService.fetch(i).pipe(ce(function(e){return e.body.result.response}))},e.prototype.getProfileDetails=function(e,t){var r=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.GET).withPath((t?t.apiPath:this.apiPath)+"/read/"+e.userId).withParameters({fields:e.requiredFields.join(",")}).withBearerToken(!0).withUserToken(!0).withBody(e).build();return this.httpService.fetch(r).pipe(ce(function(e){return e.body.result.response}))},e.prototype.updateProfile=function(e,t){var r=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.PATCH).withPath((t?t.apiPath:this.apiPath)+"/update").withBearerToken(!0).withUserToken(!0).withBody({request:e}).build();return this.httpService.fetch(r).pipe(ce(function(e){return e.body.result}))},e=Ze([Object(o.injectable)(),Je(0,Object(o.inject)(z.core.HTTP_SERVICE)),Je(1,Object(o.inject)(z.services.user.USER_SERVICE_API_PATH)),$e("design:paramtypes",[Object,String])],e)}(),nt=r(27);function it(e,t){return t?new p.a(function(r){return t.schedule(ot,0,{error:e,subscriber:r})}):new p.a(function(t){return t.error(e)})}function ot(e){var t=e.error,r;e.subscriber.error(t)}var at=function(e,t,r,n){var i=arguments.length,o=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n,a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,r,o):a(t,r))||o);return i>3&&o&&Object.defineProperty(t,r,o),o},st=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},ut=function(e,t){return function(r,n){t(r,n,e)}},ct=function(){function e(e,t){this.httpService=e,this.dataApiPath=t}return e.prototype.getDataAggregation=function(e,t,r,n,i){var o=Date.now(),a=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.POST).withPath((i?i.dataApiPath:this.dataApiPath)+"/activity/agg").withBearerToken(!0).withUserToken(!0).withBody({request:{groupId:e,activityId:t.id,activityType:t.type}}).build();return this.httpService.fetch(a).pipe(ce(function(e){return e.body.result}),Ne(function(r){return u.b.isInstance(r)&&r.response.responseCode===s.CsHttpResponseCode.HTTP_BAD_REQUEST&&r.response.body.params.errmsg.includes("No member found in this group")?Object(W.a)({activity:{agg:[{metric:nt.a.ENROLMENT_COUNT,lastUpdatedOn:o,value:0}],id:t.id,type:t.type},groupId:e,members:[]}):it(r)}),ce(function(e){if(!r)return e;if(n)e.activity.agg.push({metric:nt.a.LEAF_NODES_COUNT,lastUpdatedOn:o,value:n});else{var i=(r.activities||[]).find(function(e){return e.id===t.id&&e.type.toLowerCase()===t.type.toLowerCase()&&e.activityInfo&&e.activityInfo.leafNodesCount});i&&(e.activity.agg.push({metric:nt.a.LEAF_NODES_COUNT,lastUpdatedOn:i.activityInfo.lastUpdatedOn?new Date(i.activityInfo.lastUpdatedOn).getTime():o,value:i.activityInfo.leafNodesCount}),n=i.activityInfo.leafNodesCount)}return e.members=(r.members||[]).map(function(t){var r=e.members.filter(function(e){return e.userId===t.userId}).sort(function(e,t){var r=e.agg.find(function(e){return e.metric===nt.a.COMPLETED_COUNT}),n=t.agg.find(function(e){return e.metric===nt.a.COMPLETED_COUNT});return r||n?!r&&n?1:r&&!n?-1:n.value-r.value:0})[0];if(r){if(n){var i=r.agg.find(function(e){return e.metric===nt.a.COMPLETED_COUNT});i&&r.agg.push({metric:nt.a.PROGRESS,lastUpdatedOn:o,value:Math.round(Math.min(i.value,n)/n*100)})}return r}return{role:t.role,createdBy:t.createdBy,name:t.name,userId:t.userId,status:t.status,agg:[{metric:nt.a.COMPLETED_COUNT,lastUpdatedOn:o,value:0}]}}),e}))},e.prototype.getDataForDashlets=function(e,t){var r=this.getAssessments(e,{}),n=[];t.members.forEach(function(e){var t={name:e.name,progress:0};e.agg.forEach(function(e){if(0===e.metric.lastIndexOf("score")){var n=r[e.metric.split(":")[1]];e.metric=n,t[n]=e.value}"progress"===e.metric&&(t.progress=e.value)}),n.push(t)});var i=0,o=0,a=[];return n.forEach(function(e,t){var r=function(e){if(!a.find(function(t){return t.data===e})){var t={title:e.charAt(0).toUpperCase()+e.substr(1),data:e,render:function(t,r,n){var i=t||n[e];return i||0===i?i:"NA"}};"progress"===e&&(t.title="Progress%"),a.push(t)}};for(var n in e)r(n)}),Object(W.a)({rows:n,columns:a})},e.prototype.getAssessments=function(e,t){var r=this;return e.forEach(function(e){e.children&&e.children.length?r.getAssessments(e.children,t):t[e.identifier]=e.name}),t},e=at([Object(o.injectable)(),ut(0,Object(o.inject)(z.core.HTTP_SERVICE)),ut(1,Object(o.inject)(z.services.group.GROUP_SERVICE_DATA_API_PATH)),st("design:paramtypes",[Object,String])],e)}(),ft=function(e,t,r,n){var i=arguments.length,o=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n,a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,r,o):a(t,r))||o);return i>3&&o&&Object.defineProperty(t,r,o),o},lt=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},pt=function(e,t){return function(r,n){t(r,n,e)}},ht=function(){function e(e,t){this.httpService=e,this.apiPath=t}return e.prototype.getForm=function(e,t){var r=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.POST).withPath((t?t.apiPath:this.apiPath)+"/read").withBody({request:e}).withBearerToken(!0).build();return this.httpService.fetch(r).pipe(ce(function(e){return e.body.result.form}))},e=ft([Object(o.injectable)(),pt(0,Object(o.inject)(z.core.HTTP_SERVICE)),pt(1,Object(o.inject)(z.services.form.FORM_SERVICE_API_PATH)),lt("design:paramtypes",[Object,String])],e)}(),dt=function(e,t,r,n){var i=arguments.length,o=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n,a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,r,o):a(t,r))||o);return i>3&&o&&Object.defineProperty(t,r,o),o},yt=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},gt=function(e,t){return function(r,n){t(r,n,e)}},vt=function(){function e(e,t){void 0===t&&(t=""),this.httpService=e,this.apiPath=t}return e.prototype.getSystemSettings=function(e,t){var r=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.GET).withPath((t?t.apiPath:this.apiPath)+"/system/settings/get/"+e).withBearerToken(!0).build();return this.httpService.fetch(r).pipe(ce(function(e){return e.body.result.response.value}))},e=dt([Object(o.injectable)(),gt(0,Object(o.inject)(z.core.HTTP_SERVICE)),gt(1,Object(o.optional)()),gt(1,Object(o.inject)(z.services.systemSettings.SYSTEM_SETTINGS_SERVICE_API_PATH)),yt("design:paramtypes",[Object,String])],e)}(),mt=function(){return mt=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},mt.apply(this,arguments)},bt=function(e,t,r,n){var i=arguments.length,o=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n,a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,r,o):a(t,r))||o);return i>3&&o&&Object.defineProperty(t,r,o),o},Et=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},Tt=function(e,t){return function(r,n){t(r,n,e)}},St=function(){function e(e,t,r,n){this.httpService=e,this.apiPath=t,this.container=r,this.formService=n}return e.prototype.fetchAllTags=function(e){var t=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.GET).withPath((e?e.apiPath:this.apiPath)+"/tags").withBearerToken(!0).withUserToken(!0).build();return this.httpService.fetch(t).pipe(ce(function(e){return e.body}))},e.prototype.createPost=function(e,t){var r=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.POST).withPath((t?t.apiPath:this.apiPath)+"/v3/topics").withBearerToken(!0).withUserToken(!0).withBody(e).build();return this.httpService.fetch(r).pipe(ce(function(e){return e.body}))},e.prototype.fetchAllCategories=function(e){var t=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.GET).withPath((e?e.apiPath:this.apiPath)+"/categories").withBearerToken(!0).withUserToken(!0).build();return this.httpService.fetch(t).pipe(ce(function(e){return e.body}))},e.prototype.fetchSingleCategoryDetails=function(e,t){var r=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.GET).withPath((t?t.apiPath:this.apiPath)+"/category/"+e).withBearerToken(!0).withUserToken(!0).build();return this.httpService.fetch(r).pipe(ce(function(e){return e.body}))},e.prototype.votePost=function(e,t,r){var n=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.POST).withPath((r?r.apiPath:this.apiPath)+"/v3/posts/"+e+"/vote").withBearerToken(!0).withUserToken(!0).withBody(t).build();return this.httpService.fetch(n).pipe(ce(function(e){return e.body}))},e.prototype.deleteVotePost=function(e,t){var r=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.DELETE).withPath((t?t.apiPath:this.apiPath)+"/v3/posts/"+e+"/vote").withBearerToken(!0).withUserToken(!0).build();return this.httpService.fetch(r).pipe(ce(function(e){return e.body}))},e.prototype.bookmarkPost=function(e,t){var r=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.POST).withPath((t?t.apiPath:this.apiPath)+"/v3/posts/"+e+"/bookmark").withBearerToken(!0).withUserToken(!0).build();return this.httpService.fetch(r).pipe(ce(function(e){return e.body}))},e.prototype.deleteBookmarkPost=function(e,t){var r=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.DELETE).withPath((t?t.apiPath:this.apiPath)+"/v3/posts/"+e+"/bookmark").withBearerToken(!0).withUserToken(!0).build();return this.httpService.fetch(r).pipe(ce(function(e){return e.body}))},e.prototype.replyPost=function(e,t,r){var n=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.POST).withPath((r?r.apiPath:this.apiPath)+"/v3/topics/"+e).withBearerToken(!0).withUserToken(!0).withBody(t).build();return this.httpService.fetch(n).pipe(ce(function(e){return e.body}))},e.prototype.fetchRecentD=function(e,t){var r=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.GET).withPath((t?t.apiPath:this.apiPath)+"/topics/recent/?page="+e).withBearerToken(!0).withUserToken(!0).build();return this.httpService.fetch(r).pipe(ce(function(e){return e.body}))},e.prototype.fetchTopicById=function(e,t,r,n){var i="/topic/"+e.toString()+"/"+t,o=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.GET).withPath(""+(n?n.apiPath:this.apiPath)+i+"?page="+r).withBearerToken(!0).withUserToken(!0).build();return this.httpService.fetch(o).pipe(ce(function(e){return e.body}))},e.prototype.fetchTopicByIdSort=function(e,t,r,n){var i="/topic/"+e.toString()+"/",o=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.GET).withPath(""+(n?n.apiPath:this.apiPath)+i+"?page="+r+"&sort="+t).withBearerToken(!0).withUserToken(!0).build();return this.httpService.fetch(o).pipe(ce(function(e){return e.body}))},e.prototype.fetchUnreadCOunt=function(e){var t=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.GET).withPath((e?e.apiPath:this.apiPath)+"/topics/unread/total").withBearerToken(!0).withUserToken(!0).build();return this.httpService.fetch(t).pipe(ce(function(e){return e.body}))},e.prototype.fetchProfileInfo=function(e,t){var r=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.GET).withPath((t?t.apiPath:this.apiPath)+"/users/"+e+"/about").withBearerToken(!0).withUserToken(!0).build();return this.httpService.fetch(r).pipe(ce(function(e){return e.body}))},e.prototype.fetchUpvoted=function(e,t,r){var n=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.GET).withPath((r?r.apiPath:this.apiPath)+"/user/"+e+"/upvoted?page="+(t||1)).withBearerToken(!0).withUserToken(!0).build();return this.httpService.fetch(n).pipe(ce(function(e){return e.body}))},e.prototype.fetchDownvoted=function(e,t,r){var n=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.GET).withPath((r?r.apiPath:this.apiPath)+"/user/"+e+"/downvoted?page="+(t||1)).withBearerToken(!0).withUserToken(!0).build();return this.httpService.fetch(n).pipe(ce(function(e){return e.body}))},e.prototype.fetchSaved=function(e,t,r){var n=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.GET).withPath((r?r.apiPath:this.apiPath)+"/user/"+e+"/bookmarks?page="+(t||1)).withBearerToken(!0).withUserToken(!0).build();return this.httpService.fetch(n).pipe(ce(function(e){return e.body}))},e.prototype.fetchNetworkProfile=function(e,t){var r=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.GET).withPath((t?t.apiPath:this.apiPath)+"/user/"+e).withBearerToken(!0).withUserToken(!0).build();return this.httpService.fetch(r).pipe(ce(function(e){return e.body}))},e.prototype.getContextBasedTopic=function(e,t,r){console.log(e,t,r,"csl");var n=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.GET).withPath((r?r.apiPath:this.apiPath)+"/category/"+e+"?page="+t).withBearerToken(!0).withUserToken(!0).build();return this.httpService.fetch(n).pipe(ce(function(e){return e.body}))},e.prototype.createUser=function(e,t){var r=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.POST).withPath((t?t.apiPath:this.apiPath)+"/user/v1/create").withBearerToken(!0).withUserToken(!0).withBody({request:mt({},e)}).build();return this.httpService.fetch(r).pipe(ce(function(e){return e.body}))},e.prototype.getForumIds=function(e,t){var r=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.POST).withPath((t?t.apiPath:this.apiPath)+"/forum/v2/read").withBearerToken(!0).withUserToken(!0).withBody({request:mt({},e)}).build();return this.httpService.fetch(r).pipe(ce(function(e){return e.body}))},e.prototype.getUserDetails=function(e,t){var r=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.GET).withPath((t?t.apiPath:this.apiPath)+"/user/uid/"+e).withBearerToken(!0).withUserToken(!0).build();return this.httpService.fetch(r).pipe(ce(function(e){return e.body}))},e.prototype.editPost=function(e,t,r){var n=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.POST).withPath((r?r.apiPath:this.apiPath)+"/v3/posts/"+e).withBearerToken(!0).withUserToken(!0).withBody(t).build();return this.httpService.fetch(n).pipe(ce(function(e){return e.body}))},e.prototype.deletePost=function(e,t,r){var n=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.DELETE).withPath((r?r.apiPath:this.apiPath)+"/v3/posts/"+e+"?uid="+t).withBearerToken(!0).withUserToken(!0).build();return this.httpService.fetch(n).pipe(ce(function(e){return e.body}))},e.prototype.removeForum=function(e,t){var r=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.POST).withPath((t?t.apiPath:this.apiPath)+"/forum/v2/remove").withBearerToken(!0).withUserToken(!0).withBody({request:mt({},e)}).build();return this.httpService.fetch(r).pipe(ce(function(e){return e.body}))},e.prototype.createForum=function(e,t){var r=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.POST).withPath((t?t.apiPath:this.apiPath)+"/forum/v3/create").withBearerToken(!0).withUserToken(!0).withBody(e).build();return this.httpService.fetch(r).pipe(ce(function(e){return e.body}))},e.prototype.attachForum=function(e){var t=this,r,n={type:"forum",action:"create",subType:e.type};return this.formService.getForm(n).pipe(ve(function(n){return(r=n.data.fields[0]).category.context=[e.context],t.createForum(r).pipe(ce(function(e){return e.result[0]}))}))},e.prototype.deleteTopic=function(e,t){var r=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.DELETE).withPath((t?t.apiPath:this.apiPath)+"/v3/topics/"+e).withBearerToken(!0).withUserToken(!0).build();return this.httpService.fetch(r).pipe(ce(function(e){return e.body}))},e.prototype.editTopic=function(e,t,r){var n=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.POST).withPath((r?r.apiPath:this.apiPath)+"/v3/topics/"+e).withBearerToken(!0).withUserToken(!0).withBody(t).build();return this.httpService.fetch(n).pipe(ce(function(e){return e.body}))},e.prototype.getContextBasedDiscussion=function(e,t){var r=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.POST).withPath((t?t.apiPath:this.apiPath)+"/category/list").withBearerToken(!0).withUserToken(!0).withBody({request:mt({},e)}).build();return this.httpService.fetch(r).pipe(ce(function(e){return e.body}))},e.prototype.getContextBasedTagDiscussion=function(e,t){var r=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.POST).withPath((t?t.apiPath:this.apiPath)+"/tags/list").withBearerToken(!0).withUserToken(!0).withBody({request:mt({},e)}).build();return this.httpService.fetch(r).pipe(ce(function(e){return e.body}))},e.prototype.recentPost=function(e,t,r){var n=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.GET).withPath((r?r.apiPath:this.apiPath)+"/user/"+e+"/posts?page="+(t||1)).withBearerToken(!0).withUserToken(!0).build();return this.httpService.fetch(n).pipe(ce(function(e){return e.body}))},e.prototype.fetchBestPost=function(e,t,r){var n=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.GET).withPath((r?r.apiPath:this.apiPath)+"/user/"+e+"/best?page="+(t||1)).withBearerToken(!0).withUserToken(!0).build();return this.httpService.fetch(n).pipe(ce(function(e){return e.body}))},e.prototype.popularPost=function(e){var t=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.GET).withPath((e?e.apiPath:this.apiPath)+"/popular").withBearerToken(!0).withUserToken(!0).build();return this.httpService.fetch(t).pipe(ce(function(e){return e.body}))},e.prototype.getSingleCategoryDetails=function(e,t){var r=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.GET).withPath((t?t.apiPath:this.apiPath)+"/category/"+e).withBearerToken(!0).withUserToken(!0).build();return this.httpService.fetch(r).pipe(ce(function(e){return e.body}))},e.prototype.contextBasedTags=function(e,t){var r=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.POST).withPath((t?t.apiPath:this.apiPath)+"/forum/tags").withBearerToken(!0).withUserToken(!0).withBody({request:mt({},e)}).build();return this.httpService.fetch(r).pipe(ce(function(e){return e.body}))},e.prototype.getTagBasedDiscussion=function(e,t){var r=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.GET).withPath((t?t.apiPath:this.apiPath)+"/tags/"+e).withBearerToken(!0).withUserToken(!0).build();return this.httpService.fetch(r).pipe(ce(function(e){return e.body}))},e.prototype.initializeUserDetails=function(e){var t=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.GET).withPath((e?e.apiPath:this.apiPath)+"/users/me").withBearerToken(!0).withUserToken(!0).build();return this.httpService.fetch(t).pipe(ce(function(e){return e.body}))},e=bt([Object(o.injectable)(),Tt(0,Object(o.inject)(z.core.HTTP_SERVICE)),Tt(1,Object(o.inject)(z.services.discussion.DISCUSSION_SERVICE_API_PATH)),Tt(2,Object(o.inject)(z.CONTAINER)),Tt(3,Object(o.inject)(z.services.form.FORM_SERVICE)),Et("design:paramtypes",[Object,String,o.Container,Object])],e)}(),wt=function(e,t,r,n){var i=arguments.length,o=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n,a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,r,o):a(t,r))||o);return i>3&&o&&Object.defineProperty(t,r,o),o},Ct=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},_t=function(e,t){return function(r,n){t(r,n,e)}},It=function(){function e(e,t){this.httpService=e,this.apiPath=t}return e.prototype.notificationRead=function(e,t){var r=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.GET).withPath((t?t.apiPath:this.apiPath)+"/read/"+e).withBearerToken(!0).withUserToken(!0).build();return this.httpService.fetch(r).pipe(ce(function(e){return e.body.result}))},e.prototype.notificationDelete=function(e,t){var r=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.POST).withPath((t?t.apiPath:this.apiPath)+"/delete").withBearerToken(!0).withUserToken(!0).withBody({request:e}).build();return this.httpService.fetch(r).pipe(ce(function(e){return e.body.result}))},e.prototype.notificationUpdate=function(e,t){var r=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.PATCH).withPath((t?t.apiPath:this.apiPath)+"/update").withBearerToken(!0).withUserToken(!0).withBody({request:e}).build();return this.httpService.fetch(r).pipe(ce(function(e){return e.body.result}))},e=wt([Object(o.injectable)(),_t(0,Object(o.inject)(z.core.HTTP_SERVICE)),_t(1,Object(o.inject)(z.services.notification.NOTIFICATION_SERVICE_API_PATH)),Ct("design:paramtypes",[Object,String])],e)}(),At;function Rt(e,t,r){return void 0===t&&(t=D),void 0===r&&(r=D),j(function(){return e()?t:r})}!function(e){e.CERTIFICATE_REGISTRY="certificate_registry",e.RC_CERTIFICATE_REGISTRY="rc_certificate_registry"}(At||(At={}));var Ot=r(53),Pt=r.n(Ot),Bt=r(70),kt={"@context":{"@version":1.1,"@protected":!0,id:"@id",type:"@type",VerifiableCredential:{"@id":"https://www.w3.org/2018/credentials#VerifiableCredential","@context":{"@version":1.1,"@protected":!0,id:"@id",type:"@type",cred:"https://www.w3.org/2018/credentials#",sec:"https://w3id.org/security#",xsd:"http://www.w3.org/2001/XMLSchema#",credentialSchema:{"@id":"cred:credentialSchema","@type":"@id","@context":{"@version":1.1,"@protected":!0,id:"@id",type:"@type",cred:"https://www.w3.org/2018/credentials#",JsonSchemaValidator2018:"cred:JsonSchemaValidator2018"}},credentialStatus:{"@id":"cred:credentialStatus","@type":"@id"},credentialSubject:{"@id":"cred:credentialSubject","@type":"@id"},evidence:{"@id":"cred:evidence","@type":"@id"},expirationDate:{"@id":"cred:expirationDate","@type":"xsd:dateTime"},holder:{"@id":"cred:holder","@type":"@id"},issued:{"@id":"cred:issued","@type":"xsd:dateTime"},issuer:{"@id":"cred:issuer","@type":"@id"},issuanceDate:{"@id":"cred:issuanceDate","@type":"xsd:dateTime"},proof:{"@id":"sec:proof","@type":"@id","@container":"@graph"},refreshService:{"@id":"cred:refreshService","@type":"@id","@context":{"@version":1.1,"@protected":!0,id:"@id",type:"@type",cred:"https://www.w3.org/2018/credentials#",ManualRefreshService2018:"cred:ManualRefreshService2018"}},termsOfUse:{"@id":"cred:termsOfUse","@type":"@id"},validFrom:{"@id":"cred:validFrom","@type":"xsd:dateTime"},validUntil:{"@id":"cred:validUntil","@type":"xsd:dateTime"}}},VerifiablePresentation:{"@id":"https://www.w3.org/2018/credentials#VerifiablePresentation","@context":{"@version":1.1,"@protected":!0,id:"@id",type:"@type",cred:"https://www.w3.org/2018/credentials#",sec:"https://w3id.org/security#",holder:{"@id":"cred:holder","@type":"@id"},proof:{"@id":"sec:proof","@type":"@id","@container":"@graph"},verifiableCredential:{"@id":"cred:verifiableCredential","@type":"@id","@container":"@graph"}}},EcdsaSecp256k1Signature2019:{"@id":"https://w3id.org/security#EcdsaSecp256k1Signature2019","@context":{"@version":1.1,"@protected":!0,id:"@id",type:"@type",sec:"https://w3id.org/security#",xsd:"http://www.w3.org/2001/XMLSchema#",challenge:"sec:challenge",created:{"@id":"http://purl.org/dc/terms/created","@type":"xsd:dateTime"},domain:"sec:domain",expires:{"@id":"sec:expiration","@type":"xsd:dateTime"},jws:"sec:jws",nonce:"sec:nonce",proofPurpose:{"@id":"sec:proofPurpose","@type":"@vocab","@context":{"@version":1.1,"@protected":!0,id:"@id",type:"@type",sec:"https://w3id.org/security#",assertionMethod:{"@id":"sec:assertionMethod","@type":"@id","@container":"@set"},authentication:{"@id":"sec:authenticationMethod","@type":"@id","@container":"@set"}}},proofValue:"sec:proofValue",verificationMethod:{"@id":"sec:verificationMethod","@type":"@id"}}},EcdsaSecp256r1Signature2019:{"@id":"https://w3id.org/security#EcdsaSecp256r1Signature2019","@context":{"@version":1.1,"@protected":!0,id:"@id",type:"@type",sec:"https://w3id.org/security#",xsd:"http://www.w3.org/2001/XMLSchema#",challenge:"sec:challenge",created:{"@id":"http://purl.org/dc/terms/created","@type":"xsd:dateTime"},domain:"sec:domain",expires:{"@id":"sec:expiration","@type":"xsd:dateTime"},jws:"sec:jws",nonce:"sec:nonce",proofPurpose:{"@id":"sec:proofPurpose","@type":"@vocab","@context":{"@version":1.1,"@protected":!0,id:"@id",type:"@type",sec:"https://w3id.org/security#",assertionMethod:{"@id":"sec:assertionMethod","@type":"@id","@container":"@set"},authentication:{"@id":"sec:authenticationMethod","@type":"@id","@container":"@set"}}},proofValue:"sec:proofValue",verificationMethod:{"@id":"sec:verificationMethod","@type":"@id"}}},Ed25519Signature2018:{"@id":"https://w3id.org/security#Ed25519Signature2018","@context":{"@version":1.1,"@protected":!0,id:"@id",type:"@type",sec:"https://w3id.org/security#",xsd:"http://www.w3.org/2001/XMLSchema#",challenge:"sec:challenge",created:{"@id":"http://purl.org/dc/terms/created","@type":"xsd:dateTime"},domain:"sec:domain",expires:{"@id":"sec:expiration","@type":"xsd:dateTime"},jws:"sec:jws",nonce:"sec:nonce",proofPurpose:{"@id":"sec:proofPurpose","@type":"@vocab","@context":{"@version":1.1,"@protected":!0,id:"@id",type:"@type",sec:"https://w3id.org/security#",assertionMethod:{"@id":"sec:assertionMethod","@type":"@id","@container":"@set"},authentication:{"@id":"sec:authenticationMethod","@type":"@id","@container":"@set"}}},proofValue:"sec:proofValue",verificationMethod:{"@id":"sec:verificationMethod","@type":"@id"}}},RsaSignature2018:{"@id":"https://w3id.org/security#RsaSignature2018","@context":{"@version":1.1,"@protected":!0,challenge:"sec:challenge",created:{"@id":"http://purl.org/dc/terms/created","@type":"xsd:dateTime"},domain:"sec:domain",expires:{"@id":"sec:expiration","@type":"xsd:dateTime"},jws:"sec:jws",nonce:"sec:nonce",proofPurpose:{"@id":"sec:proofPurpose","@type":"@vocab","@context":{"@version":1.1,"@protected":!0,id:"@id",type:"@type",sec:"https://w3id.org/security#",assertionMethod:{"@id":"sec:assertionMethod","@type":"@id","@container":"@set"},authentication:{"@id":"sec:authenticationMethod","@type":"@id","@container":"@set"}}},proofValue:"sec:proofValue",verificationMethod:{"@id":"sec:verificationMethod","@type":"@id"}}},proof:{"@id":"https://w3id.org/security#proof","@type":"@id","@container":"@graph"}}},Nt={"@version":1.1,"@protected":!0,SkillCertificate:{"@id":"https://github.com/sunbird-specs/vc-specs#SkillCertificate","@context":{id:"@id","@version":1.1,"@protected":!0,skills:"schema:Text"}},Person:{"@id":"https://github.com/sunbird-specs/vc-specs#Person","@context":{name:"schema:Text"}},trainedOn:{"@id":"https://github.com/sunbird-specs/vc-specs#trainedOn","@context":{name:"schema:Text"}}},Ut="https://gist.githubusercontent.com/dileepbapat/eb932596a70f75016411cc871113a789/raw/498e5af1d94784f114b32c1ab827f951a8a24def/skill",Dt=function(){return Dt=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Dt.apply(this,arguments)},xt=function(e,t,r,n){function i(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=Promise))(function(r,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){e.done?r(e.value):i(e.value).then(a,s)}u((n=n.apply(e,t||[])).next())})},Lt=function(e,t){var r={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},n,i,o,a;return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(e){return function(t){return u([e,t])}}function u(a){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=2&a[0]?i.return:a[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,a[1])).done)return o;switch(i=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,i=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(!(o=r.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){r=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){r.label=a[1];break}if(6===a[0]&&r.label<o[1]){r.label=o[1],o=a;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(a);break}o[2]&&r.ops.pop(),r.trys.pop();continue}a=t.call(e,r)}catch(e){a=[6,e],i=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}},jt=r(73),Mt=jt.RSAKeyPair,Vt=jt.Ed25519KeyPair,Ft="https://sunbird.org/",Kt="did:india",Ht=function(){function e(e,t){var r=this;this.httpService=e,this.container=t,this.publicKey="",this.customLoader=function(e){return xt(r,void 0,void 0,function(){var t,r,n,i,o,a;return Lt(this,function(u){switch(u.label){case 0:return t={"did:india":this.publicKey,"https://example.com/i/india":this.publicKey,"https://w3id.org/security/v1":Bt.contexts.get("https://w3id.org/security/v1"),"https://www.w3.org/2018/credentials#":kt,"https://www.w3.org/2018/credentials/v1":kt},void 0===(r=t[e])&&(r=Bt.contexts[e]),void 0!==r?[2,n={contextUrl:null,documentUrl:e,document:r}]:e.startsWith("{")?[2,JSON.parse(e)]:(console.log("====> host ",this.host),i=(new s.CsRequest.Builder).withHost("https://").withType(s.CsHttpRequestType.GET).withPath(e.split("//")[1]).withBearerToken(!1).withHeaders({Origin:this.host}).withUserToken(!1).build(),console.log("====> apiRequest ",i),[4,this.httpService.fetch(i).pipe(ce(function(e){return e.body}),Ne(function(e){throw e})).toPromise()]);case 1:return o=u.sent(),[2,a={contextUrl:null,documentUrl:e,document:o}]}})})}}return Object.defineProperty(e.prototype,"host",{get:function(){return this.container.get(z.core.api.HOST)},enumerable:!1,configurable:!0}),e.prototype.verifyData=function(e,t){return xt(this,void 0,void 0,function(){var r,n,i,o,a,s,u;return Lt(this,function(c){switch(c.label){case 0:this.publicKey=t,c.label=1;case 1:return c.trys.push([1,3,,4]),r=Pt.a.purposes.AssertionProofPurpose,n=void 0,i={"@context":Pt.a.SECURITY_CONTEXT_URL,id:Kt,type:"RsaVerificationKey2018",controller:Ft,publicKeyPem:this.publicKey},o={"@context":Pt.a.SECURITY_CONTEXT_URL,id:Ft,publicKey:[i],assertionMethod:[i.id]},a=new Mt(Dt({},i)),s=Pt.a.suites.RsaSignature2018,[4,Pt.a.verify(e,{suite:new s({key:a}),purpose:new r({controller:o}),documentLoader:this.customLoader,compactProof:!1})];case 2:return(n=c.sent()).certificateData={issuedTo:e.credentialSubject.recipientName,issuanceDate:e.issuanceDate,issuerName:e.issuer.name,trainingName:e.credentialSubject.trainingName,trainigId:e.credentialSubject.trainingId},[2,n];case 3:throw u=c.sent(),new Error("Invalid data");case 4:return[2]}})})},e}(),qt=r(171),Gt=r.n(qt),zt=function(){return zt=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},zt.apply(this,arguments)},Yt=function(e,t,r,n){var i=arguments.length,o=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n,a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,r,o):a(t,r))||o);return i>3&&o&&Object.defineProperty(t,r,o),o},Wt=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},Qt=function(e,t){return function(r,n){t(r,n,e)}},Xt=function(e,t,r,n){function i(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=Promise))(function(r,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){e.done?r(e.value):i(e.value).then(a,s)}u((n=n.apply(e,t||[])).next())})},Zt=function(e,t){var r={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},n,i,o,a;return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(e){return function(t){return u([e,t])}}function u(a){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=2&a[0]?i.return:a[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,a[1])).done)return o;switch(i=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,i=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(!(o=r.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){r=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){r.label=a[1];break}if(6===a[0]&&r.label<o[1]){r.label=o[1],o=a;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(a);break}o[2]&&r.ops.pop(),r.trys.pop();continue}a=t.call(e,r)}catch(e){a=[6,e],i=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}},$t=function(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;for(var n=Array(e),i=0,t=0;t<r;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,i++)n[i]=o[a];return n},Jt=function(){function e(e,t,r,n,i,o){this.httpService=e,this.apiPath=t,this.apiPathLegacy=r,this.rcApiPath=n,this.systemSettingsService=i,this.container=o}return e.prototype.fetchCertificatesV1=function(e,t){if(!(this.apiPath||t&&t.apiPath))throw new Error("Required certificate api Path configuration");var r=zt(zt({},e.size?{size:e.size}:null),{_source:["data.badge.issuer.name","pdfUrl","data.issuedOn","data.badge.name","related.courseId","related.Id"],query:{bool:{must:[{match_phrase:{"recipient.id":e.userId}}]}}}),n=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.POST).withPath((t?t.apiPath:this.apiPath)+"/certs/search").withBearerToken(!0).withUserToken(!0).withBody({request:r}).build();return this.httpService.fetch(n).pipe(ce(function(e){return e.body.result.response}),Ne(function(e){return console.error(e),Object(W.a)({count:0,content:[]})}))},e.prototype.fetchCertificatesV2=function(e,t){var r=this;return j(function(){return Xt(r,void 0,void 0,function(){var r,n,i,o;return Zt(this,function(a){switch(a.label){case 0:if(r=e.schemaName)return[3,4];a.label=1;case 1:return a.trys.push([1,3,,4]),[4,this.systemSettingsService.getSystemSettings("certificate_schema").toPromise()];case 2:return r=a.sent(),[3,4];case 3:throw n=a.sent(),new Error("Schema Name Not found");case 4:return i={filters:{recipient:{id:{eq:e.userId}}}},o=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.POST).withPath((t?t.rcApiPath:this.rcApiPath).replace("${schemaName}",r)+"/search").withBearerToken(!0).withUserToken(!0).withBody(i).build(),[2,this.httpService.fetch(o).pipe(ce(function(e){return e.body.map(function(e){var t;return{id:e.osid,trainingName:e.training.name,issuerName:e.issuer.name,issuedOn:e.issuer.osUpdatedAt,courseId:e.training.id,templateUrl:e.templateUrl,type:At.RC_CERTIFICATE_REGISTRY}})}),Ne(function(e){return console.error(e),Object(W.a)([])})).toPromise()]}})})})},e.prototype.fetchCertificates=function(e,t){var r=this;return this.fetchCertificatesV1(e,t).pipe(ve(function(n){return r.fetchCertificatesV2(e,t).pipe(ce(function(e){var t=n.content.map(function(e){return{id:e._id,trainingName:e._source.data?e._source.data.badge.name:void 0,issuerName:e._source.data?e._source.data.badge.issuer.name:void 0,issuedOn:e._source.data?e._source.data.issuedOn:void 0,courseId:e._source.related.courseId,pdfUrl:e._source.pdfUrl,templateUrl:e._source.templateUrl,type:At.CERTIFICATE_REGISTRY}}),r;return{certRegCount:n.count,rcCount:e.length,certificates:$t(t,e)}}))}))},e.prototype.getPublicKey=function(e,t){var r=this;return j(function(){return Xt(r,void 0,void 0,function(){var r,n,i;return Zt(this,function(o){switch(o.label){case 0:if(r=e.schemaName)return[3,4];o.label=1;case 1:return o.trys.push([1,3,,4]),[4,this.systemSettingsService.getSystemSettings("certificate_schema").toPromise()];case 2:return r=o.sent(),[3,4];case 3:throw n=o.sent(),new Error("Schema Name Not found");case 4:return i=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.GET).withPath((t?t.rcApiPath:this.rcApiPath).replace("${schemaName}",r)+"/key/"+e.osid).withBearerToken(!0).withUserToken(!0).withBody({request:e}).build(),[2,this.httpService.fetch(i).pipe(ce(function(e){return e.body})).toPromise()]}})})})},e.prototype.getCerificateDownloadURI=function(e,t){var r=this;return Rt(function(){return e.type===At.RC_CERTIFICATE_REGISTRY},j(function(){return Xt(r,void 0,void 0,function(){var r,n,i;return Zt(this,function(o){switch(o.label){case 0:if(r=e.schemaName)return[3,4];o.label=1;case 1:return o.trys.push([1,3,,4]),[4,this.systemSettingsService.getSystemSettings("certificate_schema").toPromise()];case 2:return r=o.sent(),[3,4];case 3:throw n=o.sent(),new Error("Schema Name Not found");case 4:return i=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.GET).withPath((t?t.rcApiPath:this.rcApiPath).replace("${schemaName}",r)+"/download/"+e.certificateId).withBearerToken(!0).withUserToken(!0).withHeaders({Accept:"image/svg+xml",template:e.templateUrl}).build(),[2,this.httpService.fetch(i).pipe(ce(function(e){return{printUri:e.body}})).toPromise()]}})})}),j(function(){var n=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.GET).withPath((t?t.apiPath:r.apiPath)+"/certs/download/"+e.certificateId).withBearerToken(!0).withUserToken(!0).build();return r.httpService.fetch(n).pipe(ce(function(e){return e.body.result}))}))},e.prototype.getLegacyCerificateDownloadURI=function(e,t){var r=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.POST).withPath((t?t.apiPathLegacy:this.apiPathLegacy)+"/certs/download").withBearerToken(!0).withUserToken(!0).withBody({request:e}).build();return this.httpService.fetch(r).pipe(ce(function(e){return e.body.result}))},e.prototype.getCertificateDetails=function(e,t){var r=this;return j(function(){return Xt(r,void 0,void 0,function(){var r,n,i;return Zt(this,function(o){switch(o.label){case 0:if(r=e.schemaName)return[3,4];o.label=1;case 1:return o.trys.push([1,3,,4]),[4,this.systemSettingsService.getSystemSettings("certificate_schema").toPromise()];case 2:return r=o.sent(),[3,4];case 3:throw n=o.sent(),new Error("Schema Name Not found");case 4:return i=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.GET).withPath((t?t.rcApiPath:this.rcApiPath).replace("${schemaName}",r)+"/download/"+e.certificateId).withBearerToken(!0).withUserToken(!0).build(),[2,this.httpService.fetch(i).pipe(ce(function(e){return console.log("CsCertificateDetailsResponse csl",e),e.body}),Ne(function(e){return console.error(e),Object(W.a)({status:"REVOKED"})})).toPromise()]}})})})},e.prototype.getEncodedData=function(e){var t=atob(e),r;return(new Gt.a).loadAsync(t).then(function(e){return e.files["certificate.json"].async("text")}).then(function(e){return JSON.parse(e)}).catch(function(e){console.log("error",e)})},e.prototype.verifyCertificate=function(e,t){var r=this;return this.getCertificateDetails({certificateId:e.certificateId,schemaName:e.schemaName},t).pipe(Ne(function(e){return console.error(e),Object(W.a)({status:"active"})}),ve(function(n){return Rt(function(){return!e.publicKey},j(function(){var i=JSON.parse(n._osSignedData);if(i&&i.issuer&&i.issuer.publicKey&&i.issuer.publicKey.length)return r.getPublicKey({osid:i.issuer.publicKey,schemaName:e.schemaName},t).pipe(ce(function(e){return e.value}),Ne(function(e){throw console.error(e),e}));throw new Error("Public Key Not found")}),j(function(){return Object(W.a)(e.publicKey)})).pipe(ve(function(e){return new Ht(r.httpService,r.container).verifyData(JSON.parse(n._osSignedData),e).then(function(e){return zt(zt({},e),{status:n.status})})}))}))},e=Yt([Object(o.injectable)(),Qt(0,Object(o.inject)(z.core.HTTP_SERVICE)),Qt(1,Object(o.inject)(z.services.certificate.CERTIFICATE_SERVICE_API_PATH)),Qt(2,Object(o.inject)(z.services.certificate.CERTIFICATE_SERVICE_API_PATH_LEGACY)),Qt(3,Object(o.inject)(z.services.certificate.RC_API_PATH)),Qt(4,Object(o.inject)(z.services.systemSettings.SYSTEM_SETTINGS_SERVICE)),Qt(5,Object(o.inject)(z.CONTAINER)),Wt("design:paramtypes",[Object,String,String,String,Object,o.Container])],e)}(),er=function(e,t,r,n){function i(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=Promise))(function(r,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){e.done?r(e.value):i(e.value).then(a,s)}u((n=n.apply(e,t||[])).next())})},tr=function(e,t){var r={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},n,i,o,a;return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(e){return function(t){return u([e,t])}}function u(a){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=2&a[0]?i.return:a[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,a[1])).done)return o;switch(i=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,i=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(!(o=r.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){r=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){r.label=a[1];break}if(6===a[0]&&r.label<o[1]){r.label=o[1],o=a;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(a);break}o[2]&&r.ops.pop(),r.trys.pop();continue}a=t.call(e,r)}catch(e){a=[6,e],i=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}},rr=function(){function e(){this._isInitialised=!1}return Object.defineProperty(e,"instance",{get:function(){return e._instance||(e._instance=new e),e._instance},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isInitialised",{get:function(){return this._isInitialised},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"config",{get:function(){return this._config},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"httpService",{get:function(){return this._container.get(z.core.HTTP_SERVICE)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"groupService",{get:function(){return this._container.get(z.services.group.GROUP_SERVICE)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"contentService",{get:function(){return this._container.get(z.services.content.CONTENT_SERVICE)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"frameworkService",{get:function(){return this._container.get(z.services.framework.FRAMEWORK_SERVICE)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"locationService",{get:function(){return this._container.get(z.services.location.LOCATION_SERVICE)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"courseService",{get:function(){return this._container.get(z.services.course.COURSE_SERVICE)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"userService",{get:function(){return this._container.get(z.services.user.USER_SERVICE)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"formService",{get:function(){return this._container.get(z.services.form.FORM_SERVICE)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"systemSettingsService",{get:function(){return this._container.get(z.services.systemSettings.SYSTEM_SETTINGS_SERVICE)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"discussionService",{get:function(){return this._container.get(z.services.discussion.DISCUSSION_SERVICE)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"notificationService",{get:function(){return this._container.get(z.services.notification.NOTIFICATION_SERVICE)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"certificateService",{get:function(){return this._container.get(z.services.certificate.CERTIFICATE_SERVICE)},enumerable:!1,configurable:!0}),e.prototype.init=function(e,t,r){return er(this,void 0,void 0,function(){return tr(this,function(n){return t&&(this.onUpdateConfigCallback=t),this._config=e,this._container=new o.Container,this._container.bind(z.CONTAINER).toConstantValue(this._container),this.updateConfig(e),this._isInitialised=!0,r&&this._container.bind(z.core.CLIENT_STORAGE).toConstantValue(r),this.httpService.init(),[2]})})},e.prototype.updateConfig=function(e){this._config=e;var t=this._isInitialised?"rebind":"bind";"HttpClientCordovaAdapter"===e.core.httpAdapter?this._container[t](z.core.HTTP_ADAPTER).to(l).inSingletonScope():this._container[t](z.core.HTTP_ADAPTER).to(G).inSingletonScope(),this._container[t](z.core.api.HOST).toConstantValue(e.core.api.host),this._container[t](z.core.global.CHANNEL_ID).toConstantValue(e.core.global.channelId),this._container[t](z.core.global.PRODUCER_ID).toConstantValue(e.core.global.producerId),this._container[t](z.core.global.DEVICE_ID).toConstantValue(e.core.global.deviceId),this._container[t](z.core.global.SESSION_ID).toConstantValue(e.core.global.sessionId),this._container[t](z.core.global.APP_VERSION).toConstantValue(e.core.global.appVersion),this._container[t](z.core.api.authentication.BEARER_TOKEN).toConstantValue(e.core.api.authentication.bearerToken),this._container[t](z.core.api.authentication.USER_TOKEN).toConstantValue(e.core.api.authentication.userToken),this._container[t](z.core.api.authentication.MANAGED_USER_TOKEN).toConstantValue(e.core.api.authentication.managedUserToken),this._container[t](z.core.HTTP_SERVICE).to(oe).inSingletonScope(),this._container[t](z.services.group.GROUP_SERVICE).to(Re).inSingletonScope(),this._container[t](z.services.group.GROUP_ACTIVITY_SERVICE).to(ct).inSingletonScope(),e.services.groupServiceConfig&&(this._container[t](z.services.group.GROUP_SERVICE_API_PATH).toConstantValue(e.services.groupServiceConfig.apiPath),this._container[t](z.services.group.GROUP_SERVICE_DATA_API_PATH).toConstantValue(e.services.groupServiceConfig.dataApiPath),e.services.groupServiceConfig.updateGroupGuidelinesApiPath&&this._container[t](z.services.group.GROUP_SERVICE_UPDATE_GUIDELINES_API_PATH).toConstantValue(e.services.groupServiceConfig.updateGroupGuidelinesApiPath)),this._container[t](z.services.framework.FRAMEWORK_SERVICE).to(Fe).inSingletonScope(),e.services.frameworkServiceConfig&&this._container[t](z.services.framework.FRAMEWORK_SERVICE_API_PATH).toConstantValue(e.services.frameworkServiceConfig.apiPath),this._container[t](z.services.location.LOCATION_SERVICE).to(Ge).inSingletonScope(),e.services.locationServiceConfig&&this._container[t](z.services.location.LOCATION_SERVICE_API_PATH).toConstantValue(e.services.locationServiceConfig.apiPath),this._container[t](z.services.course.COURSE_SERVICE).to(Qe).inSingletonScope(),e.services.courseServiceConfig&&(this._container[t](z.services.course.COURSE_SERVICE_API_PATH).toConstantValue(e.services.courseServiceConfig.apiPath),e.services.courseServiceConfig.certRegistrationApiPath&&this._container[t](z.services.course.COURSE_SERVICE_CERT_REGISTRATION_API_PATH).toConstantValue(e.services.courseServiceConfig.certRegistrationApiPath)),this._container[t](z.services.content.CONTENT_SERVICE).to(ke).inSingletonScope(),e.services.contentServiceConfig&&(this._container[t](z.services.content.CONTENT_SERVICE_HIERARCHY_API_PATH).toConstantValue(e.services.contentServiceConfig.hierarchyApiPath),this._container[t](z.services.content.CONTENT_SERVICE_QUESTION_LIST_API_PATH).toConstantValue(e.services.contentServiceConfig.questionListApiPath)),this._container[t](z.services.user.USER_SERVICE).to(rt).inSingletonScope(),e.services.userServiceConfig&&this._container[t](z.services.user.USER_SERVICE_API_PATH).toConstantValue(e.services.userServiceConfig.apiPath),this._container[t](z.services.form.FORM_SERVICE).to(ht).inSingletonScope(),e.services.formServiceConfig&&this._container[t](z.services.form.FORM_SERVICE_API_PATH).toConstantValue(e.services.formServiceConfig.apiPath),this._container[t](z.services.systemSettings.SYSTEM_SETTINGS_SERVICE).to(vt).inSingletonScope(),e.services.systemSettingsServiceConfig&&this._container[t](z.services.systemSettings.SYSTEM_SETTINGS_SERVICE_API_PATH).toConstantValue(e.services.systemSettingsServiceConfig.apiPath),"rebind"===t&&this.onUpdateConfigCallback&&this.onUpdateConfigCallback(),this._container[t](z.services.discussion.DISCUSSION_SERVICE).to(St).inSingletonScope(),e.services.discussionServiceConfig&&this._container[t](z.services.discussion.DISCUSSION_SERVICE_API_PATH).toConstantValue(e.services.discussionServiceConfig.apiPath),this._container[t](z.services.notification.NOTIFICATION_SERVICE).to(It).inSingletonScope(),e.services.notificationServiceConfig&&this._container[t](z.services.notification.NOTIFICATION_SERVICE_API_PATH).toConstantValue(e.services.notificationServiceConfig.apiPath),this._container[t](z.services.certificate.CERTIFICATE_SERVICE).to(Jt).inSingletonScope(),e.services.certificateServiceConfig&&(this._container[t](z.services.certificate.CERTIFICATE_SERVICE_API_PATH).toConstantValue(e.services.certificateServiceConfig.apiPath),this._container[t](z.services.certificate.CERTIFICATE_SERVICE_API_PATH_LEGACY).toConstantValue(e.services.certificateServiceConfig.apiPathLegacy?e.services.certificateServiceConfig.apiPathLegacy:""),e.services.certificateServiceConfig.rcApiPath&&this._container[t](z.services.certificate.RC_API_PATH).toConstantValue(e.services.certificateServiceConfig.rcApiPath))},e.prototype.updateAuthTokenConfig=function(e){this._config.core.api.authentication.userToken=e;var t=this._isInitialised?"rebind":"bind";this._container[t](z.core.api.authentication.USER_TOKEN).toConstantValue(this._config.core.api.authentication.userToken)},e}()}])});
2
+ !function e(t,r){if("object"==typeof exports&&"object"==typeof module)module.exports=r(require("jsonld"),require("crypto-ld"));else if("function"==typeof define&&define.amd)define(["jsonld","crypto-ld"],r);else{var n="object"==typeof exports?r(require("jsonld"),require("crypto-ld")):r(t.jsonld,t["crypto-ld"]);for(var i in n)("object"==typeof exports?exports:t)[i]=n[i]}}(window,function(e,t){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function t(){return e.default}:function t(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=217)}([function(e,t,r){"use strict";r.r(t);var n=r(60),i=r.n(n);for(var o in n)["default"].indexOf(o)<0&&function(e){r.d(t,e,function(){return n[e]})}(o);var a=r(61),s=r.n(a);for(var o in a)["default"].indexOf(o)<0&&function(e){r.d(t,e,function(){return a[e]})}(o);var u=r(62);r.d(t,"CsHttpSerializer",function(){return u.b}),r.d(t,"CsHttpRequestType",function(){return u.a}),r.d(t,"CsRequest",function(){return u.c});var c=r(63),f=r.n(c);for(var o in c)["default","CsHttpSerializer","CsHttpRequestType","CsRequest"].indexOf(o)<0&&function(e){r.d(t,e,function(){return c[e]})}(o);var l=r(64);r.d(t,"CsHttpResponseCode",function(){return l.a}),r.d(t,"CsResponse",function(){return l.b});var p=r(65),h=r.n(p);for(var o in p)["default","CsHttpSerializer","CsHttpRequestType","CsRequest","CsHttpResponseCode","CsResponse"].indexOf(o)<0&&function(e){r.d(t,e,function(){return p[e]})}(o)},,function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.multiBindToService=t.getServiceIdentifierAsString=t.typeConstraint=t.namedConstraint=t.taggedConstraint=t.traverseAncerstors=t.decorate=t.id=t.MetadataReader=t.postConstruct=t.targetName=t.multiInject=t.unmanaged=t.optional=t.LazyServiceIdentifer=t.inject=t.named=t.tagged=t.injectable=t.ContainerModule=t.AsyncContainerModule=t.TargetTypeEnum=t.BindingTypeEnum=t.BindingScopeEnum=t.Container=t.METADATA_KEY=void 0;var n=r(7);t.METADATA_KEY=n;var i=r(87);Object.defineProperty(t,"Container",{enumerable:!0,get:function(){return i.Container}});var o=r(18);Object.defineProperty(t,"BindingScopeEnum",{enumerable:!0,get:function(){return o.BindingScopeEnum}}),Object.defineProperty(t,"BindingTypeEnum",{enumerable:!0,get:function(){return o.BindingTypeEnum}}),Object.defineProperty(t,"TargetTypeEnum",{enumerable:!0,get:function(){return o.TargetTypeEnum}});var a=r(103);Object.defineProperty(t,"AsyncContainerModule",{enumerable:!0,get:function(){return a.AsyncContainerModule}}),Object.defineProperty(t,"ContainerModule",{enumerable:!0,get:function(){return a.ContainerModule}});var s=r(104);Object.defineProperty(t,"injectable",{enumerable:!0,get:function(){return s.injectable}});var u=r(105);Object.defineProperty(t,"tagged",{enumerable:!0,get:function(){return u.tagged}});var c=r(106);Object.defineProperty(t,"named",{enumerable:!0,get:function(){return c.named}});var f=r(56);Object.defineProperty(t,"inject",{enumerable:!0,get:function(){return f.inject}}),Object.defineProperty(t,"LazyServiceIdentifer",{enumerable:!0,get:function(){return f.LazyServiceIdentifer}});var l=r(107);Object.defineProperty(t,"optional",{enumerable:!0,get:function(){return l.optional}});var p=r(108);Object.defineProperty(t,"unmanaged",{enumerable:!0,get:function(){return p.unmanaged}});var h=r(109);Object.defineProperty(t,"multiInject",{enumerable:!0,get:function(){return h.multiInject}});var d=r(110);Object.defineProperty(t,"targetName",{enumerable:!0,get:function(){return d.targetName}});var y=r(111);Object.defineProperty(t,"postConstruct",{enumerable:!0,get:function(){return y.postConstruct}});var g=r(54);Object.defineProperty(t,"MetadataReader",{enumerable:!0,get:function(){return g.MetadataReader}});var v=r(24);Object.defineProperty(t,"id",{enumerable:!0,get:function(){return v.id}});var m=r(19);Object.defineProperty(t,"decorate",{enumerable:!0,get:function(){return m.decorate}});var b=r(59);Object.defineProperty(t,"traverseAncerstors",{enumerable:!0,get:function(){return b.traverseAncerstors}}),Object.defineProperty(t,"taggedConstraint",{enumerable:!0,get:function(){return b.taggedConstraint}}),Object.defineProperty(t,"namedConstraint",{enumerable:!0,get:function(){return b.namedConstraint}}),Object.defineProperty(t,"typeConstraint",{enumerable:!0,get:function(){return b.typeConstraint}});var E=r(30);Object.defineProperty(t,"getServiceIdentifierAsString",{enumerable:!0,get:function(){return E.getServiceIdentifierAsString}});var T=r(112);Object.defineProperty(t,"multiBindToService",{enumerable:!0,get:function(){return T.multiBindToService}})},function(e,t,r){"use strict";r.d(t,"a",function(){return i});var n=!1,i={Promise:void 0,set useDeprecatedSynchronousErrorHandling(e){var t;e&&(new Error).stack;n=e},get useDeprecatedSynchronousErrorHandling(){return n}}},function(e,t){e.exports={options:{usePureJavaScript:!1}}},function(e,t,r){"use strict";r.d(t,"a",function(){return h});var n=r(9);function i(e){for(;e;){var t=e,r=t.closed,i=t.destination,o=t.isStopped;if(r||o)return!1;e=i&&i instanceof n.a?i:null}return!0}var o=r(15),a=r(17);function s(e,t,r){if(e){if(e instanceof n.a)return e;if(e[o.a])return e[o.a]()}return e||t||r?new n.a(e,t,r):new n.a(a.a)}var u=r(21);function c(e){return e}function f(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return l(e)}function l(e){return 0===e.length?c:1===e.length?e[0]:function t(r){return e.reduce(function(e,t){return t(e)},r)}}var p=r(3),h=function(){function e(e){this._isScalar=!1,e&&(this._subscribe=e)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(e,t,r){var n=this.operator,i=s(e,t,r);if(n?i.add(n.call(i,this.source)):i.add(this.source||p.a.useDeprecatedSynchronousErrorHandling&&!i.syncErrorThrowable?this._subscribe(i):this._trySubscribe(i)),p.a.useDeprecatedSynchronousErrorHandling&&i.syncErrorThrowable&&(i.syncErrorThrowable=!1,i.syncErrorThrown))throw i.syncErrorValue;return i},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){p.a.useDeprecatedSynchronousErrorHandling&&(e.syncErrorThrown=!0,e.syncErrorValue=t),i(e)?e.error(t):console.warn(t)}},e.prototype.forEach=function(e,t){var r=this;return new(t=d(t))(function(t,n){var i;i=r.subscribe(function(t){try{e(t)}catch(e){n(e),i&&i.unsubscribe()}},n,t)})},e.prototype._subscribe=function(e){var t=this.source;return t&&t.subscribe(e)},e.prototype[u.a]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 0===e.length?this:l(e)(this)},e.prototype.toPromise=function(e){var t=this;return new(e=d(e))(function(e,r){var n;t.subscribe(function(e){return n=e},function(e){return r(e)},function(){return e(n)})})},e.create=function(t){return new e(t)},e}();function d(e){if(e||(e=p.a.Promise||Promise),!e)throw new Error("no Promise impl found");return e}},function(e,t,r){"use strict";r.d(t,"a",function(){return i});var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)};function i(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var o=function(){return o=Object.assign||function e(t){for(var r,n=1,i=arguments.length;n<i;n++)for(var o in r=arguments[n])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t},o.apply(this,arguments)};function a(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r}function s(e,t,r,n){var i=arguments.length,o=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n,a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,r,o):a(t,r))||o);return i>3&&o&&Object.defineProperty(t,r,o),o}function u(e,t){return function(r,n){t(r,n,e)}}function c(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function f(e,t,r,n){function i(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=Promise))(function(r,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){e.done?r(e.value):i(e.value).then(a,s)}u((n=n.apply(e,t||[])).next())})}function l(e,t){var r={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},n,i,o,a;return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(e){return function(t){return u([e,t])}}function u(a){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=2&a[0]?i.return:a[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,a[1])).done)return o;switch(i=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,i=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(!(o=r.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){r=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){r.label=a[1];break}if(6===a[0]&&r.label<o[1]){r.label=o[1],o=a;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(a);break}o[2]&&r.ops.pop(),r.trys.pop();continue}a=t.call(e,r)}catch(e){a=[6,e],i=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}}function p(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}function h(e,t){for(var r in e)"default"===r||t.hasOwnProperty(r)||(t[r]=e[r])}function d(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function y(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,o=[],a;try{for(;(void 0===t||t-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(e){a={error:e}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return o}function g(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(y(arguments[t]));return e}function v(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;for(var n=Array(e),i=0,t=0;t<r;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,i++)n[i]=o[a];return n}function m(e){return this instanceof m?(this.v=e,this):new m(e)}function b(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(e,t||[]),i,o=[];return i={},a("next"),a("throw"),a("return"),i[Symbol.asyncIterator]=function(){return this},i;function a(e){n[e]&&(i[e]=function(t){return new Promise(function(r,n){o.push([e,t,r,n])>1||s(e,t)})})}function s(e,t){try{u(n[e](t))}catch(e){l(o[0][3],e)}}function u(e){e.value instanceof m?Promise.resolve(e.value.v).then(c,f):l(o[0][2],e)}function c(e){s("next",e)}function f(e){s("throw",e)}function l(e,t){e(t),o.shift(),o.length&&s(o[0][0],o[0][1])}}function E(e){var t,r;return t={},n("next"),n("throw",function(e){throw e}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(n,i){t[n]=e[n]?function(t){return(r=!r)?{value:m(e[n](t)),done:"return"===n}:i?i(t):t}:i}}function T(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=d(e),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(t){r[t]=e[t]&&function(r){return new Promise(function(n,o){i(n,o,(r=e[t](r)).done,r.value)})}}function i(e,t,r,n){Promise.resolve(n).then(function(t){e({value:t,done:r})},t)}}function S(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function w(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function C(e){return e&&e.__esModule?e:{default:e}}function _(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)}function I(e,t,r){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,r),r}},function(e,t,r){"use strict";function n(){return[t.INJECT_TAG,t.MULTI_INJECT_TAG,t.NAME_TAG,t.UNMANAGED_TAG,t.NAMED_TAG,t.OPTIONAL_TAG]}Object.defineProperty(t,"__esModule",{value:!0}),t.NON_CUSTOM_TAG_KEYS=t.POST_CONSTRUCT=t.DESIGN_PARAM_TYPES=t.PARAM_TYPES=t.TAGGED_PROP=t.TAGGED=t.MULTI_INJECT_TAG=t.INJECT_TAG=t.OPTIONAL_TAG=t.UNMANAGED_TAG=t.NAME_TAG=t.NAMED_TAG=void 0,t.NAMED_TAG="named",t.NAME_TAG="name",t.UNMANAGED_TAG="unmanaged",t.OPTIONAL_TAG="optional",t.INJECT_TAG="inject",t.MULTI_INJECT_TAG="multi_inject",t.TAGGED="inversify:tagged",t.TAGGED_PROP="inversify:tagged_props",t.PARAM_TYPES="inversify:paramtypes",t.DESIGN_PARAM_TYPES="design:paramtypes",t.POST_CONSTRUCT="post_construct",t.NON_CUSTOM_TAG_KEYS=n()},function(e,t,r){(function(t,n,i,o){var a=r(4),s=r(189),u=e.exports=a.util=a.util||{};function c(e){if(8!==e&&16!==e&&24!==e&&32!==e)throw new Error("Only 8, 16, 24, or 32 bits supported: "+e)}function f(e){if(this.data="",this.read=0,"string"==typeof e)this.data=e;else if(u.isArrayBuffer(e)||u.isArrayBufferView(e))if(void 0!==o&&e instanceof o)this.data=e.toString("binary");else{var t=new Uint8Array(e);try{this.data=String.fromCharCode.apply(null,t)}catch(e){for(var r=0;r<t.length;++r)this.putByte(t[r])}}else(e instanceof f||"object"==typeof e&&"string"==typeof e.data&&"number"==typeof e.read)&&(this.data=e.data,this.read=e.read);this._constructedStringLength=0}!function(){if(void 0!==t&&t.nextTick&&!t.browser)return u.nextTick=t.nextTick,void(u.setImmediate="function"==typeof n?n:u.nextTick);if("function"==typeof n)return u.setImmediate=function(){return n.apply(void 0,arguments)},void(u.nextTick=function(e){return n(e)});if(u.setImmediate=function(e){setTimeout(e,0)},"undefined"!=typeof window&&"function"==typeof window.postMessage){var e="forge.setImmediate",r=[];function i(t){if(t.source===window&&t.data===e){t.stopPropagation();var n=r.slice();r.length=0,n.forEach(function(e){e()})}}u.setImmediate=function(t){r.push(t),1===r.length&&window.postMessage(e,"*")},window.addEventListener("message",i,!0)}if("undefined"!=typeof MutationObserver){var o=Date.now(),a=!0,s=document.createElement("div"),r=[];new MutationObserver(function(){var e=r.slice();r.length=0,e.forEach(function(e){e()})}).observe(s,{attributes:!0});var c=u.setImmediate;u.setImmediate=function(e){Date.now()-o>15?(o=Date.now(),c(e)):(r.push(e),1===r.length&&s.setAttribute("a",a=!a))}}u.nextTick=u.setImmediate}(),u.isNodejs=void 0!==t&&t.versions&&t.versions.node,u.globalScope=u.isNodejs?i:"undefined"==typeof self?window:self,u.isArray=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},u.isArrayBuffer=function(e){return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer},u.isArrayBufferView=function(e){return e&&u.isArrayBuffer(e.buffer)&&void 0!==e.byteLength},u.ByteBuffer=f,u.ByteStringBuffer=f;var l=4096;function p(e,t){t=t||{},this.read=t.readOffset||0,this.growSize=t.growSize||1024;var r=u.isArrayBuffer(e),n=u.isArrayBufferView(e);if(r||n)return this.data=r?new DataView(e):new DataView(e.buffer,e.byteOffset,e.byteLength),void(this.write="writeOffset"in t?t.writeOffset:this.data.byteLength);this.data=new DataView(new ArrayBuffer(0)),this.write=0,null!=e&&this.putBytes(e),"writeOffset"in t&&(this.write=t.writeOffset)}u.ByteStringBuffer.prototype._optimizeConstructedString=function(e){this._constructedStringLength+=e,this._constructedStringLength>l&&(this.data.substr(0,1),this._constructedStringLength=0)},u.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read},u.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0},u.ByteStringBuffer.prototype.putByte=function(e){return this.putBytes(String.fromCharCode(e))},u.ByteStringBuffer.prototype.fillWithByte=function(e,t){e=String.fromCharCode(e);for(var r=this.data;t>0;)1&t&&(r+=e),(t>>>=1)>0&&(e+=e);return this.data=r,this._optimizeConstructedString(t),this},u.ByteStringBuffer.prototype.putBytes=function(e){return this.data+=e,this._optimizeConstructedString(e.length),this},u.ByteStringBuffer.prototype.putString=function(e){return this.putBytes(u.encodeUtf8(e))},u.ByteStringBuffer.prototype.putInt16=function(e){return this.putBytes(String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},u.ByteStringBuffer.prototype.putInt24=function(e){return this.putBytes(String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},u.ByteStringBuffer.prototype.putInt32=function(e){return this.putBytes(String.fromCharCode(e>>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},u.ByteStringBuffer.prototype.putInt16Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255))},u.ByteStringBuffer.prototype.putInt24Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255))},u.ByteStringBuffer.prototype.putInt32Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>24&255))},u.ByteStringBuffer.prototype.putInt=function(e,t){c(t);var r="";do{t-=8,r+=String.fromCharCode(e>>t&255)}while(t>0);return this.putBytes(r)},u.ByteStringBuffer.prototype.putSignedInt=function(e,t){return e<0&&(e+=2<<t-1),this.putInt(e,t)},u.ByteStringBuffer.prototype.putBuffer=function(e){return this.putBytes(e.getBytes())},u.ByteStringBuffer.prototype.getByte=function(){return this.data.charCodeAt(this.read++)},u.ByteStringBuffer.prototype.getInt16=function(){var e=this.data.charCodeAt(this.read)<<8^this.data.charCodeAt(this.read+1);return this.read+=2,e},u.ByteStringBuffer.prototype.getInt24=function(){var e=this.data.charCodeAt(this.read)<<16^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2);return this.read+=3,e},u.ByteStringBuffer.prototype.getInt32=function(){var e=this.data.charCodeAt(this.read)<<24^this.data.charCodeAt(this.read+1)<<16^this.data.charCodeAt(this.read+2)<<8^this.data.charCodeAt(this.read+3);return this.read+=4,e},u.ByteStringBuffer.prototype.getInt16Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8;return this.read+=2,e},u.ByteStringBuffer.prototype.getInt24Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16;return this.read+=3,e},u.ByteStringBuffer.prototype.getInt32Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16^this.data.charCodeAt(this.read+3)<<24;return this.read+=4,e},u.ByteStringBuffer.prototype.getInt=function(e){c(e);var t=0;do{t=(t<<8)+this.data.charCodeAt(this.read++),e-=8}while(e>0);return t},u.ByteStringBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),r=2<<e-2;return t>=r&&(t-=r<<1),t},u.ByteStringBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):0===e?t="":(t=0===this.read?this.data:this.data.slice(this.read),this.clear()),t},u.ByteStringBuffer.prototype.bytes=function(e){return void 0===e?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},u.ByteStringBuffer.prototype.at=function(e){return this.data.charCodeAt(this.read+e)},u.ByteStringBuffer.prototype.setAt=function(e,t){return this.data=this.data.substr(0,this.read+e)+String.fromCharCode(t)+this.data.substr(this.read+e+1),this},u.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)},u.ByteStringBuffer.prototype.copy=function(){var e=u.createBuffer(this.data);return e.read=this.read,e},u.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this},u.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this},u.ByteStringBuffer.prototype.truncate=function(e){var t=Math.max(0,this.length()-e);return this.data=this.data.substr(this.read,t),this.read=0,this},u.ByteStringBuffer.prototype.toHex=function(){for(var e="",t=this.read;t<this.data.length;++t){var r=this.data.charCodeAt(t);r<16&&(e+="0"),e+=r.toString(16)}return e},u.ByteStringBuffer.prototype.toString=function(){return u.decodeUtf8(this.bytes())},u.DataBuffer=p,u.DataBuffer.prototype.length=function(){return this.write-this.read},u.DataBuffer.prototype.isEmpty=function(){return this.length()<=0},u.DataBuffer.prototype.accommodate=function(e,t){if(this.length()>=e)return this;t=Math.max(t||this.growSize,e);var r=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),n=new Uint8Array(this.length()+t);return n.set(r),this.data=new DataView(n.buffer),this},u.DataBuffer.prototype.putByte=function(e){return this.accommodate(1),this.data.setUint8(this.write++,e),this},u.DataBuffer.prototype.fillWithByte=function(e,t){this.accommodate(t);for(var r=0;r<t;++r)this.data.setUint8(e);return this},u.DataBuffer.prototype.putBytes=function(e,t){if(u.isArrayBufferView(e)){var r,n=(r=new Uint8Array(e.buffer,e.byteOffset,e.byteLength)).byteLength-r.byteOffset,i;return this.accommodate(n),(i=new Uint8Array(this.data.buffer,this.write)).set(r),this.write+=n,this}if(u.isArrayBuffer(e)){var r=new Uint8Array(e),i;return this.accommodate(r.byteLength),(i=new Uint8Array(this.data.buffer)).set(r,this.write),this.write+=r.byteLength,this}if(e instanceof u.DataBuffer||"object"==typeof e&&"number"==typeof e.read&&"number"==typeof e.write&&u.isArrayBufferView(e.data)){var r=new Uint8Array(e.data.byteLength,e.read,e.length()),i;return this.accommodate(r.byteLength),(i=new Uint8Array(e.data.byteLength,this.write)).set(r),this.write+=r.byteLength,this}if(e instanceof u.ByteStringBuffer&&(e=e.data,t="binary"),t=t||"binary","string"==typeof e){var o;if("hex"===t)return this.accommodate(Math.ceil(e.length/2)),o=new Uint8Array(this.data.buffer,this.write),this.write+=u.binary.hex.decode(e,o,this.write),this;if("base64"===t)return this.accommodate(3*Math.ceil(e.length/4)),o=new Uint8Array(this.data.buffer,this.write),this.write+=u.binary.base64.decode(e,o,this.write),this;if("utf8"===t&&(e=u.encodeUtf8(e),t="binary"),"binary"===t||"raw"===t)return this.accommodate(e.length),o=new Uint8Array(this.data.buffer,this.write),this.write+=u.binary.raw.decode(o),this;if("utf16"===t)return this.accommodate(2*e.length),o=new Uint16Array(this.data.buffer,this.write),this.write+=u.text.utf16.encode(o),this;throw new Error("Invalid encoding: "+t)}throw Error("Invalid parameter: "+e)},u.DataBuffer.prototype.putBuffer=function(e){return this.putBytes(e),e.clear(),this},u.DataBuffer.prototype.putString=function(e){return this.putBytes(e,"utf16")},u.DataBuffer.prototype.putInt16=function(e){return this.accommodate(2),this.data.setInt16(this.write,e),this.write+=2,this},u.DataBuffer.prototype.putInt24=function(e){return this.accommodate(3),this.data.setInt16(this.write,e>>8&65535),this.data.setInt8(this.write,e>>16&255),this.write+=3,this},u.DataBuffer.prototype.putInt32=function(e){return this.accommodate(4),this.data.setInt32(this.write,e),this.write+=4,this},u.DataBuffer.prototype.putInt16Le=function(e){return this.accommodate(2),this.data.setInt16(this.write,e,!0),this.write+=2,this},u.DataBuffer.prototype.putInt24Le=function(e){return this.accommodate(3),this.data.setInt8(this.write,e>>16&255),this.data.setInt16(this.write,e>>8&65535,!0),this.write+=3,this},u.DataBuffer.prototype.putInt32Le=function(e){return this.accommodate(4),this.data.setInt32(this.write,e,!0),this.write+=4,this},u.DataBuffer.prototype.putInt=function(e,t){c(t),this.accommodate(t/8);do{t-=8,this.data.setInt8(this.write++,e>>t&255)}while(t>0);return this},u.DataBuffer.prototype.putSignedInt=function(e,t){return c(t),this.accommodate(t/8),e<0&&(e+=2<<t-1),this.putInt(e,t)},u.DataBuffer.prototype.getByte=function(){return this.data.getInt8(this.read++)},u.DataBuffer.prototype.getInt16=function(){var e=this.data.getInt16(this.read);return this.read+=2,e},u.DataBuffer.prototype.getInt24=function(){var e=this.data.getInt16(this.read)<<8^this.data.getInt8(this.read+2);return this.read+=3,e},u.DataBuffer.prototype.getInt32=function(){var e=this.data.getInt32(this.read);return this.read+=4,e},u.DataBuffer.prototype.getInt16Le=function(){var e=this.data.getInt16(this.read,!0);return this.read+=2,e},u.DataBuffer.prototype.getInt24Le=function(){var e=this.data.getInt8(this.read)^this.data.getInt16(this.read+1,!0)<<8;return this.read+=3,e},u.DataBuffer.prototype.getInt32Le=function(){var e=this.data.getInt32(this.read,!0);return this.read+=4,e},u.DataBuffer.prototype.getInt=function(e){c(e);var t=0;do{t=(t<<8)+this.data.getInt8(this.read++),e-=8}while(e>0);return t},u.DataBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),r=2<<e-2;return t>=r&&(t-=r<<1),t},u.DataBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):0===e?t="":(t=0===this.read?this.data:this.data.slice(this.read),this.clear()),t},u.DataBuffer.prototype.bytes=function(e){return void 0===e?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},u.DataBuffer.prototype.at=function(e){return this.data.getUint8(this.read+e)},u.DataBuffer.prototype.setAt=function(e,t){return this.data.setUint8(e,t),this},u.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)},u.DataBuffer.prototype.copy=function(){return new u.DataBuffer(this)},u.DataBuffer.prototype.compact=function(){if(this.read>0){var e=new Uint8Array(this.data.buffer,this.read),t=new Uint8Array(e.byteLength);t.set(e),this.data=new DataView(t),this.write-=this.read,this.read=0}return this},u.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this},u.DataBuffer.prototype.truncate=function(e){return this.write=Math.max(0,this.length()-e),this.read=Math.min(this.read,this.write),this},u.DataBuffer.prototype.toHex=function(){for(var e="",t=this.read;t<this.data.byteLength;++t){var r=this.data.getUint8(t);r<16&&(e+="0"),e+=r.toString(16)}return e},u.DataBuffer.prototype.toString=function(e){var t=new Uint8Array(this.data,this.read,this.length());if("binary"===(e=e||"utf8")||"raw"===e)return u.binary.raw.encode(t);if("hex"===e)return u.binary.hex.encode(t);if("base64"===e)return u.binary.base64.encode(t);if("utf8"===e)return u.text.utf8.decode(t);if("utf16"===e)return u.text.utf16.decode(t);throw new Error("Invalid encoding: "+e)},u.createBuffer=function(e,t){return t=t||"raw",void 0!==e&&"utf8"===t&&(e=u.encodeUtf8(e)),new u.ByteBuffer(e)},u.fillString=function(e,t){for(var r="";t>0;)1&t&&(r+=e),(t>>>=1)>0&&(e+=e);return r},u.xorBytes=function(e,t,r){for(var n="",i="",o="",a=0,s=0;r>0;--r,++a)i=e.charCodeAt(a)^t.charCodeAt(a),s>=10&&(n+=o,o="",s=0),o+=String.fromCharCode(i),++s;return n+=o},u.hexToBytes=function(e){var t="",r=0;for(!0&e.length&&(r=1,t+=String.fromCharCode(parseInt(e[0],16)));r<e.length;r+=2)t+=String.fromCharCode(parseInt(e.substr(r,2),16));return t},u.bytesToHex=function(e){return u.createBuffer(e).toHex()},u.int32ToBytes=function(e){return String.fromCharCode(e>>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e)};var h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",d=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],y="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";u.encode64=function(e,t){for(var r="",n="",i,o,a,s=0;s<e.length;)i=e.charCodeAt(s++),o=e.charCodeAt(s++),a=e.charCodeAt(s++),r+=h.charAt(i>>2),r+=h.charAt((3&i)<<4|o>>4),isNaN(o)?r+="==":(r+=h.charAt((15&o)<<2|a>>6),r+=isNaN(a)?"=":h.charAt(63&a)),t&&r.length>t&&(n+=r.substr(0,t)+"\r\n",r=r.substr(t));return n+=r},u.decode64=function(e){e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var t="",r,n,i,o,a=0;a<e.length;)r=d[e.charCodeAt(a++)-43],n=d[e.charCodeAt(a++)-43],i=d[e.charCodeAt(a++)-43],o=d[e.charCodeAt(a++)-43],t+=String.fromCharCode(r<<2|n>>4),64!==i&&(t+=String.fromCharCode((15&n)<<4|i>>2),64!==o&&(t+=String.fromCharCode((3&i)<<6|o)));return t},u.encodeUtf8=function(e){return unescape(encodeURIComponent(e))},u.decodeUtf8=function(e){return decodeURIComponent(escape(e))},u.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:s.encode,decode:s.decode}},u.binary.raw.encode=function(e){return String.fromCharCode.apply(null,e)},u.binary.raw.decode=function(e,t,r){var n=t;n||(n=new Uint8Array(e.length));for(var i=r=r||0,o=0;o<e.length;++o)n[i++]=e.charCodeAt(o);return t?i-r:n},u.binary.hex.encode=u.bytesToHex,u.binary.hex.decode=function(e,t,r){var n=t;n||(n=new Uint8Array(Math.ceil(e.length/2)));var i=0,o=r=r||0;for(1&e.length&&(i=1,n[o++]=parseInt(e[0],16));i<e.length;i+=2)n[o++]=parseInt(e.substr(i,2),16);return t?o-r:n},u.binary.base64.encode=function(e,t){for(var r="",n="",i,o,a,s=0;s<e.byteLength;)i=e[s++],o=e[s++],a=e[s++],r+=h.charAt(i>>2),r+=h.charAt((3&i)<<4|o>>4),isNaN(o)?r+="==":(r+=h.charAt((15&o)<<2|a>>6),r+=isNaN(a)?"=":h.charAt(63&a)),t&&r.length>t&&(n+=r.substr(0,t)+"\r\n",r=r.substr(t));return n+=r},u.binary.base64.decode=function(e,t,r){var n=t,i,o,a,s;n||(n=new Uint8Array(3*Math.ceil(e.length/4))),e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var u=0,c=r=r||0;u<e.length;)i=d[e.charCodeAt(u++)-43],o=d[e.charCodeAt(u++)-43],a=d[e.charCodeAt(u++)-43],s=d[e.charCodeAt(u++)-43],n[c++]=i<<2|o>>4,64!==a&&(n[c++]=(15&o)<<4|a>>2,64!==s&&(n[c++]=(3&a)<<6|s));return t?c-r:n.subarray(0,c)},u.binary.base58.encode=function(e,t){return u.binary.baseN.encode(e,y,t)},u.binary.base58.decode=function(e,t){return u.binary.baseN.decode(e,y,t)},u.text={utf8:{},utf16:{}},u.text.utf8.encode=function(e,t,r){e=u.encodeUtf8(e);var n=t;n||(n=new Uint8Array(e.length));for(var i=r=r||0,o=0;o<e.length;++o)n[i++]=e.charCodeAt(o);return t?i-r:n},u.text.utf8.decode=function(e){return u.decodeUtf8(String.fromCharCode.apply(null,e))},u.text.utf16.encode=function(e,t,r){var n=t;n||(n=new Uint8Array(2*e.length));for(var i=new Uint16Array(n.buffer),o=r=r||0,a=r,s=0;s<e.length;++s)i[a++]=e.charCodeAt(s),o+=2;return t?o-r:n},u.text.utf16.decode=function(e){return String.fromCharCode.apply(null,new Uint16Array(e.buffer))},u.deflate=function(e,t,r){if(t=u.decode64(e.deflate(u.encode64(t)).rval),r){var n=2,i;32&t.charCodeAt(1)&&(n=6),t=t.substring(n,t.length-4)}return t},u.inflate=function(e,t,r){var n=e.inflate(u.encode64(t)).rval;return null===n?null:u.decode64(n)};var g=function(e,t,r){if(!e)throw new Error("WebStorage not available.");var n;if(null===r?n=e.removeItem(t):(r=u.encode64(JSON.stringify(r)),n=e.setItem(t,r)),void 0!==n&&!0!==n.rval){var i=new Error(n.error.message);throw i.id=n.error.id,i.name=n.error.name,i}},v=function(e,t){if(!e)throw new Error("WebStorage not available.");var r=e.getItem(t);if(e.init)if(null===r.rval){if(r.error){var n=new Error(r.error.message);throw n.id=r.error.id,n.name=r.error.name,n}r=null}else r=r.rval;return null!==r&&(r=JSON.parse(u.decode64(r))),r},m=function(e,t,r,n){var i=v(e,t);null===i&&(i={}),i[r]=n,g(e,t,i)},b=function(e,t,r){var n=v(e,t);return null!==n&&(n=r in n?n[r]:null),n},E=function(e,t,r){var n=v(e,t);if(null!==n&&r in n){delete n[r];var i=!0;for(var o in n){i=!1;break}i&&(n=null),g(e,t,n)}},T=function(e,t){g(e,t,null)},S=function(e,t,r){var n=null,i;void 0===r&&(r=["web","flash"]);var o=!1,a=null;for(var s in r){i=r[s];try{if("flash"===i||"both"===i){if(null===t[0])throw new Error("Flash local storage not available.");n=e.apply(this,t),o="flash"===i}"web"!==i&&"both"!==i||(t[0]=localStorage,n=e.apply(this,t),o=!0)}catch(e){a=e}if(o)break}if(!o)throw a;return n};u.setItem=function(e,t,r,n,i){S(m,arguments,i)},u.getItem=function(e,t,r,n){return S(b,arguments,n)},u.removeItem=function(e,t,r,n){S(E,arguments,n)},u.clearItems=function(e,t,r){S(T,arguments,r)},u.parseUrl=function(e){var t=/^(https?):\/\/([^:&^\/]*):?(\d*)(.*)$/g;t.lastIndex=0;var r=t.exec(e),n=null===r?null:{full:e,scheme:r[1],host:r[2],port:r[3],path:r[4]};return n&&(n.fullHost=n.host,n.port?(80!==n.port&&"http"===n.scheme||443!==n.port&&"https"===n.scheme)&&(n.fullHost+=":"+n.port):"http"===n.scheme?n.port=80:"https"===n.scheme&&(n.port=443),n.full=n.scheme+"://"+n.fullHost),n};var w=null;u.getQueryVariables=function(e){var t=function(e){for(var t={},r=e.split("&"),n=0;n<r.length;n++){var i=r[n].indexOf("="),o,a;i>0?(o=r[n].substring(0,i),a=r[n].substring(i+1)):(o=r[n],a=null),o in t||(t[o]=[]),o in Object.prototype||null===a||t[o].push(unescape(a))}return t},r;return void 0===e?(null===w&&(w="undefined"!=typeof window&&window.location&&window.location.search?t(window.location.search.substring(1)):{}),r=w):r=t(e),r},u.parseFragment=function(e){var t=e,r="",n=e.indexOf("?");n>0&&(t=e.substring(0,n),r=e.substring(n+1));var i=t.split("/"),o;return i.length>0&&""===i[0]&&i.shift(),{pathString:t,queryString:r,path:i,query:""===r?{}:u.getQueryVariables(r)}},u.makeRequest=function(e){var t=u.parseFragment(e),r={path:t.pathString,query:t.queryString,getPath:function(e){return void 0===e?t.path:t.path[e]},getQuery:function(e,r){var n;return void 0===e?n=t.query:(n=t.query[e])&&void 0!==r&&(n=n[r]),n},getQueryLast:function(e,t){var n,i=r.getQuery(e);return n=i?i[i.length-1]:t}};return r},u.makeLink=function(e,t,r){e=jQuery.isArray(e)?e.join("/"):e;var n=jQuery.param(t||{});return r=r||"",e+(n.length>0?"?"+n:"")+(r.length>0?"#"+r:"")},u.isEmpty=function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0},u.format=function(e){for(var t=/%./g,r,n,i=0,o=[],a=0;r=t.exec(e);){(n=e.substring(a,t.lastIndex-2)).length>0&&o.push(n),a=t.lastIndex;var s=r[0][1];switch(s){case"s":case"o":i<arguments.length?o.push(arguments[1+i++]):o.push("<?>");break;case"%":o.push("%");break;default:o.push("<%"+s+"?>")}}return o.push(e.substring(a)),o.join("")},u.formatNumber=function(e,t,r,n){var i=e,o=isNaN(t=Math.abs(t))?2:t,a=void 0===r?",":r,s=void 0===n?".":n,u=i<0?"-":"",c=parseInt(i=Math.abs(+i||0).toFixed(o),10)+"",f=c.length>3?c.length%3:0;return u+(f?c.substr(0,f)+s:"")+c.substr(f).replace(/(\d{3})(?=\d)/g,"$1"+s)+(o?a+Math.abs(i-c).toFixed(o).slice(2):"")},u.formatSize=function(e){return e=e>=1073741824?u.formatNumber(e/1073741824,2,".","")+" GiB":e>=1048576?u.formatNumber(e/1048576,2,".","")+" MiB":e>=1024?u.formatNumber(e/1024,0)+" KiB":u.formatNumber(e,0)+" bytes"},u.bytesFromIP=function(e){return-1!==e.indexOf(".")?u.bytesFromIPv4(e):-1!==e.indexOf(":")?u.bytesFromIPv6(e):null},u.bytesFromIPv4=function(e){if(4!==(e=e.split(".")).length)return null;for(var t=u.createBuffer(),r=0;r<e.length;++r){var n=parseInt(e[r],10);if(isNaN(n))return null;t.putByte(n)}return t.getBytes()},u.bytesFromIPv6=function(e){for(var t=0,r=2*(8-(e=e.split(":").filter(function(e){return 0===e.length&&++t,!0})).length+t),n=u.createBuffer(),i=0;i<8;++i)if(e[i]&&0!==e[i].length){var o=u.hexToBytes(e[i]);o.length<2&&n.putByte(0),n.putBytes(o)}else n.fillWithByte(0,r),r=0;return n.getBytes()},u.bytesToIP=function(e){return 4===e.length?u.bytesToIPv4(e):16===e.length?u.bytesToIPv6(e):null},u.bytesToIPv4=function(e){if(4!==e.length)return null;for(var t=[],r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t.join(".")},u.bytesToIPv6=function(e){if(16!==e.length)return null;for(var t=[],r=[],n=0,i=0;i<e.length;i+=2){for(var o=u.bytesToHex(e[i]+e[i+1]);"0"===o[0]&&"0"!==o;)o=o.substr(1);if("0"===o){var a=r[r.length-1],s=t.length;a&&s===a.end+1?(a.end=s,a.end-a.start>r[n].end-r[n].start&&(n=r.length-1)):r.push({start:s,end:s})}t.push(o)}if(r.length>0){var c=r[n];c.end-c.start>0&&(t.splice(c.start,c.end-c.start+1,""),0===c.start&&t.unshift(""),7===c.end&&t.push(""))}return t.join(":")},u.estimateCores=function(e,t){if("function"==typeof e&&(t=e,e={}),e=e||{},"cores"in u&&!e.update)return t(null,u.cores);if("undefined"!=typeof navigator&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return u.cores=navigator.hardwareConcurrency,t(null,u.cores);if("undefined"==typeof Worker)return u.cores=1,t(null,u.cores);if("undefined"==typeof Blob)return u.cores=2,t(null,u.cores);var r=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",function(e){for(var t=Date.now(),r=t+4;Date.now()<r;);self.postMessage({st:t,et:r})})}.toString(),")()"],{type:"application/javascript"}));function n(e,a,s){if(0===a){var c=Math.floor(e.reduce(function(e,t){return e+t},0)/e.length);return u.cores=Math.max(1,c),URL.revokeObjectURL(r),t(null,u.cores)}i(s,function(t,r){e.push(o(s,r)),n(e,a-1,s)})}function i(e,t){for(var n=[],i=[],o=0;o<e;++o){var a=new Worker(r);a.addEventListener("message",function(r){if(i.push(r.data),i.length===e){for(var o=0;o<e;++o)n[o].terminate();t(null,i)}}),n.push(a)}for(var o=0;o<e;++o)n[o].postMessage(o)}function o(e,t){for(var r=[],n=0;n<e;++n)for(var i=t[n],o=r[n]=[],a=0;a<e;++a)if(n!==a){var s=t[a];(i.st>s.st&&i.st<s.et||s.st>i.st&&s.st<i.et)&&o.push(a)}return r.reduce(function(e,t){return Math.max(e,t.length)},0)}n([],5,16)}}).call(this,r(36),r(134).setImmediate,r(29),r(74).Buffer)},function(e,t,r){"use strict";r.d(t,"a",function(){return f});var n=r(6),i=r(20),o=r(17),a=r(10),s=r(15),u=r(3),c=r(13),f=function(e){function t(r,n,i){var a=e.call(this)||this;switch(a.syncErrorValue=null,a.syncErrorThrown=!1,a.syncErrorThrowable=!1,a.isStopped=!1,arguments.length){case 0:a.destination=o.a;break;case 1:if(!r){a.destination=o.a;break}if("object"==typeof r){r instanceof t?(a.syncErrorThrowable=r.syncErrorThrowable,a.destination=r,r.add(a)):(a.syncErrorThrowable=!0,a.destination=new l(a,r));break}default:a.syncErrorThrowable=!0,a.destination=new l(a,r,n,i)}return a}return n.a(t,e),t.prototype[s.a]=function(){return this},t.create=function(e,r,n){var i=new t(e,r,n);return i.syncErrorThrowable=!1,i},t.prototype.next=function(e){this.isStopped||this._next(e)},t.prototype.error=function(e){this.isStopped||(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this))},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){this.destination.error(e),this.unsubscribe()},t.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},t.prototype._unsubscribeAndRecycle=function(){var e=this._parentOrParents;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=e,this},t}(a.a),l=function(e){function t(t,r,n,a){var s=e.call(this)||this,u;s._parentSubscriber=t;var c=s;return Object(i.a)(r)?u=r:r&&(u=r.next,n=r.error,a=r.complete,r!==o.a&&(c=Object.create(r),Object(i.a)(c.unsubscribe)&&s.add(c.unsubscribe.bind(c)),c.unsubscribe=s.unsubscribe.bind(s))),s._context=c,s._next=u,s._error=n,s._complete=a,s}return n.a(t,e),t.prototype.next=function(e){if(!this.isStopped&&this._next){var t=this._parentSubscriber;u.a.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?this.__tryOrSetError(t,this._next,e)&&this.unsubscribe():this.__tryOrUnsub(this._next,e)}},t.prototype.error=function(e){if(!this.isStopped){var t=this._parentSubscriber,r=u.a.useDeprecatedSynchronousErrorHandling;if(this._error)r&&t.syncErrorThrowable?(this.__tryOrSetError(t,this._error,e),this.unsubscribe()):(this.__tryOrUnsub(this._error,e),this.unsubscribe());else if(t.syncErrorThrowable)r?(t.syncErrorValue=e,t.syncErrorThrown=!0):Object(c.a)(e),this.unsubscribe();else{if(this.unsubscribe(),r)throw e;Object(c.a)(e)}}},t.prototype.complete=function(){var e=this;if(!this.isStopped){var t=this._parentSubscriber;if(this._complete){var r=function(){return e._complete.call(e._context)};u.a.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?(this.__tryOrSetError(t,r),this.unsubscribe()):(this.__tryOrUnsub(r),this.unsubscribe())}else this.unsubscribe()}},t.prototype.__tryOrUnsub=function(e,t){try{e.call(this._context,t)}catch(e){if(this.unsubscribe(),u.a.useDeprecatedSynchronousErrorHandling)throw e;Object(c.a)(e)}},t.prototype.__tryOrSetError=function(e,t,r){if(!u.a.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{t.call(this._context,r)}catch(t){return u.a.useDeprecatedSynchronousErrorHandling?(e.syncErrorValue=t,e.syncErrorThrown=!0,!0):(Object(c.a)(t),!0)}return!1},t.prototype._unsubscribe=function(){var e=this._parentSubscriber;this._context=null,this._parentSubscriber=null,e.unsubscribe()},t}(f)},function(e,t,r){"use strict";r.d(t,"a",function(){return u});var n=function(){return Array.isArray||function(e){return e&&"number"==typeof e.length}}(),i=r(34),o=r(20),a,s=function(){function e(e){return Error.call(this),this.message=e?e.length+" errors occurred during unsubscription:\n"+e.map(function(e,t){return t+1+") "+e.toString()}).join("\n "):"",this.name="UnsubscriptionError",this.errors=e,this}return e.prototype=Object.create(Error.prototype),e}(),u=function(){function e(e){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,e&&(this._ctorUnsubscribe=!0,this._unsubscribe=e)}var t;return e.prototype.unsubscribe=function(){var t;if(!this.closed){var r=this,a=r._parentOrParents,u=r._ctorUnsubscribe,f=r._unsubscribe,l=r._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,a instanceof e)a.remove(this);else if(null!==a)for(var p=0;p<a.length;++p){var h;a[p].remove(this)}if(Object(o.a)(f)){u&&(this._unsubscribe=void 0);try{f.call(this)}catch(e){t=e instanceof s?c(e.errors):[e]}}if(n(l))for(var p=-1,d=l.length;++p<d;){var y=l[p];if(Object(i.a)(y))try{y.unsubscribe()}catch(e){t=t||[],e instanceof s?t=t.concat(c(e.errors)):t.push(e)}}if(t)throw new s(t)}},e.prototype.add=function(t){var r=t;if(!t)return e.EMPTY;switch(typeof t){case"function":r=new e(t);case"object":if(r===this||r.closed||"function"!=typeof r.unsubscribe)return r;if(this.closed)return r.unsubscribe(),r;if(!(r instanceof e)){var n=r;(r=new e)._subscriptions=[n]}break;default:throw new Error("unrecognized teardown "+t+" added to Subscription.")}var i=r._parentOrParents;if(null===i)r._parentOrParents=this;else if(i instanceof e){if(i===this)return r;r._parentOrParents=[i,this]}else{if(-1!==i.indexOf(this))return r;i.push(this)}var o=this._subscriptions;return null===o?this._subscriptions=[r]:o.push(r),r},e.prototype.remove=function(e){var t=this._subscriptions;if(t){var r=t.indexOf(e);-1!==r&&t.splice(r,1)}},e.EMPTY=((t=new e).closed=!0,t),e}();function c(e){return e.reduce(function(e,t){return e.concat(t instanceof s?t.errors:t)},[])}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.STACK_OVERFLOW=t.CIRCULAR_DEPENDENCY_IN_FACTORY=t.POST_CONSTRUCT_ERROR=t.MULTIPLE_POST_CONSTRUCT_METHODS=t.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK=t.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE=t.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE=t.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT=t.ARGUMENTS_LENGTH_MISMATCH=t.INVALID_DECORATOR_OPERATION=t.INVALID_TO_SELF_VALUE=t.INVALID_FUNCTION_BINDING=t.INVALID_MIDDLEWARE_RETURN=t.NO_MORE_SNAPSHOTS_AVAILABLE=t.INVALID_BINDING_TYPE=t.NOT_IMPLEMENTED=t.CIRCULAR_DEPENDENCY=t.UNDEFINED_INJECT_ANNOTATION=t.MISSING_INJECT_ANNOTATION=t.MISSING_INJECTABLE_ANNOTATION=t.NOT_REGISTERED=t.CANNOT_UNBIND=t.AMBIGUOUS_MATCH=t.KEY_NOT_FOUND=t.NULL_ARGUMENT=t.DUPLICATED_METADATA=t.DUPLICATED_INJECTABLE_DECORATOR=void 0,t.DUPLICATED_INJECTABLE_DECORATOR="Cannot apply @injectable decorator multiple times.",t.DUPLICATED_METADATA="Metadata key was used more than once in a parameter:",t.NULL_ARGUMENT="NULL argument",t.KEY_NOT_FOUND="Key Not Found",t.AMBIGUOUS_MATCH="Ambiguous match found for serviceIdentifier:",t.CANNOT_UNBIND="Could not unbind serviceIdentifier:",t.NOT_REGISTERED="No matching bindings found for serviceIdentifier:",t.MISSING_INJECTABLE_ANNOTATION="Missing required @injectable annotation in:",t.MISSING_INJECT_ANNOTATION="Missing required @inject or @multiInject annotation in:";var n=function(e){return"@inject called with undefined this could mean that the class "+e+" has a circular dependency problem. You can use a LazyServiceIdentifer to overcome this limitation."};t.UNDEFINED_INJECT_ANNOTATION=n,t.CIRCULAR_DEPENDENCY="Circular dependency found:",t.NOT_IMPLEMENTED="Sorry, this feature is not fully implemented yet.",t.INVALID_BINDING_TYPE="Invalid binding type:",t.NO_MORE_SNAPSHOTS_AVAILABLE="No snapshot available to restore.",t.INVALID_MIDDLEWARE_RETURN="Invalid return type in middleware. Middleware must return!",t.INVALID_FUNCTION_BINDING="Value provided to function binding must be a function!",t.INVALID_TO_SELF_VALUE="The toSelf function can only be applied when a constructor is used as service identifier",t.INVALID_DECORATOR_OPERATION="The @inject @multiInject @tagged and @named decorators must be applied to the parameters of a class constructor or a class property.";var i=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return"The number of constructor arguments in the derived class "+e[0]+" must be >= than the number of constructor arguments of its base class."};t.ARGUMENTS_LENGTH_MISMATCH=i,t.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT="Invalid Container constructor argument. Container options must be an object.",t.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE="Invalid Container option. Default scope must be a string ('singleton' or 'transient').",t.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE="Invalid Container option. Auto bind injectable must be a boolean",t.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK="Invalid Container option. Skip base check must be a boolean",t.MULTIPLE_POST_CONSTRUCT_METHODS="Cannot apply @postConstruct decorator multiple times in the same class";var o=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return"@postConstruct error in class "+e[0]+": "+e[1]};t.POST_CONSTRUCT_ERROR=o;var a=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return"It looks like there is a circular dependency in one of the '"+e[0]+"' bindings. Please investigate bindings withservice identifier '"+e[1]+"'."};t.CIRCULAR_DEPENDENCY_IN_FACTORY=a,t.STACK_OVERFLOW="Maximum call stack size exceeded"},function(e,t,r){"use strict";r.d(t,"a",function(){return n});var n=function(){function e(e,t){this._code=t}return Object.defineProperty(e.prototype,"code",{get:function(){return this._code},enumerable:!1,configurable:!0}),e}()},function(e,t,r){"use strict";function n(e){setTimeout(function(){throw e},0)}r.d(t,"a",function(){return n})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Metadata=void 0;var n=r(7),i=function(){function e(e,t){this.key=e,this.value=t}return e.prototype.toString=function(){return this.key===n.NAMED_TAG?"named: "+this.value.toString()+" ":"tagged: { key:"+this.key.toString()+", value: "+this.value+" }"},e}();t.Metadata=i},function(e,t,r){"use strict";r.d(t,"a",function(){return n});var n=function(){return"function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random()}(),i=n},function(e,t,r){"use strict";r.d(t,"b",function(){return a}),r.d(t,"c",function(){return u}),r.d(t,"d",function(){return f}),r.d(t,"e",function(){return l.a}),r.d(t,"a",function(){return n.a});var n=r(12),i=(o=function(e,t){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},o(e,t)},function(e,t){function r(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o,a=function(e){function t(r,n){var i=e.call(this,r,t.code)||this;return i.response=n,Object.setPrototypeOf(i,t.prototype),i}return i(t,e),t.isInstance=function(e){return e.code&&e.code===t.code},t.code="HTTP_CLIENT_ERROR",t}(n.a),s=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),u=function(e){function t(r,n){var i=e.call(this,r,t.code)||this;return i.response=n,Object.setPrototypeOf(i,t.prototype),i}return s(t,e),t.isInstance=function(e){return e.code&&e.code===t.code},t.code="HTTP_SERVER_ERROR",t}(n.a),c=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),f=function(e){function t(r){var n=e.call(this,r,t.code)||this;return Object.setPrototypeOf(n,t.prototype),n}return c(t,e),t.isInstance=function(e){return e.code&&e.code===t.code},t.code="NETWORK_ERROR",t}(n.a),l=r(32)},function(e,t,r){"use strict";r.d(t,"a",function(){return o});var n=r(3),i=r(13),o={closed:!0,next:function(e){},error:function(e){if(n.a.useDeprecatedSynchronousErrorHandling)throw e;Object(i.a)(e)},complete:function(){}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TargetTypeEnum=t.BindingTypeEnum=t.BindingScopeEnum=void 0;var n={Request:"Request",Singleton:"Singleton",Transient:"Transient"};t.BindingScopeEnum=n;var i={ConstantValue:"ConstantValue",Constructor:"Constructor",DynamicValue:"DynamicValue",Factory:"Factory",Function:"Function",Instance:"Instance",Invalid:"Invalid",Provider:"Provider"};t.BindingTypeEnum=i;var o={ClassProperty:"ClassProperty",ConstructorArgument:"ConstructorArgument",Variable:"Variable"};t.TargetTypeEnum=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tagProperty=t.tagParameter=t.decorate=void 0;var n=r(11),i=r(7);function o(e,t,r,n){var o;s(i.TAGGED,e,t,n,r)}function a(e,t,r){var n;s(i.TAGGED_PROP,e.constructor,t,r)}function s(e,t,r,i,o){var a={},s="number"==typeof o,u=void 0!==o&&s?o.toString():r;if(s&&void 0!==r)throw new Error(n.INVALID_DECORATOR_OPERATION);Reflect.hasOwnMetadata(e,t)&&(a=Reflect.getMetadata(e,t));var c=a[u];if(Array.isArray(c))for(var f=0,l=c;f<l.length;f++){var p=l[f];if(p.key===i.key)throw new Error(n.DUPLICATED_METADATA+" "+p.key.toString())}else c=[];c.push(i),a[u]=c,Reflect.defineMetadata(e,a,t)}function u(e,t){Reflect.decorate(e,t)}function c(e,t){return function(r,n){t(r,n,e)}}function f(e,t,r){"number"==typeof r?u([c(r,e)],t):"string"==typeof r?Reflect.decorate([e],t,r):u([e],t)}t.tagParameter=o,t.tagProperty=a,t.decorate=f},function(e,t,r){"use strict";function n(e){return"function"==typeof e}r.d(t,"a",function(){return n})},function(e,t,r){"use strict";r.d(t,"a",function(){return n});var n=function(){return"function"==typeof Symbol&&Symbol.observable||"@@observable"}()},function(e,t,r){"use strict";r.d(t,"a",function(){return o});var n=r(5),i=r(10);function o(e,t){return new n.a(function(r){var n=new i.a,o=0;return n.add(t.schedule(function(){o!==e.length?(r.next(e[o++]),r.closed||n.add(this.schedule())):r.complete()})),n})}},function(e,t,r){"use strict";var n,i,o;r.r(t),r.d(t,"GroupMembershipType",function(){return n}),r.d(t,"GroupEntityStatus",function(){return i}),r.d(t,"GroupMemberRole",function(){return o}),r.d(t,"CsGroupActivity",function(){return a}),r.d(t,"CsGroupMember",function(){return s}),r.d(t,"CsGroup",function(){return u}),function(e){e.INVITE_ONLY="invite_only",e.MODERATED="moderated"}(n||(n={})),function(e){e.ACTIVE="active",e.INACTIVE="inactive",e.SUSPENDED="suspended"}(i||(i={})),function(e){e.ADMIN="admin",e.MEMBER="member"}(o||(o={}));var a=function(){function e(){}return e.fromJSON=function(t){return Object.setPrototypeOf(t,new e)},e}(),s=function(){function e(){}return e.fromJSON=function(t){return Object.setPrototypeOf(t,new e)},e}(),u=function(){function e(){}return e.fromJSON=function(t){var r=Object.setPrototypeOf(t,new e);return r.active=r.status===i.ACTIVE,r.members&&(r.members=r.members.map(function(e){return s.fromJSON(e)})),r.activities&&(r.activities=r.activities.map(function(e){return a.fromJSON(e)})),r},e.prototype.isActive=function(){return this.active=this.status===i.ACTIVE,this.active},e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.id=void 0;var n=0;function i(){return n++}t.id=i},function(e,t,r){"use strict";r.d(t,"a",function(){return i});var n,i=function(){function e(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return e.prototype=Object.create(Error.prototype),e}()},,function(e,t,r){"use strict";var n;r.d(t,"a",function(){return n}),function(e){e.ENROLMENT_COUNT="enrolmentCount",e.COMPLETED_COUNT="completedCount",e.LEAF_NODES_COUNT="leafNodesCount",e.PROGRESS="progress"}(n||(n={}))},,function(e,t,r){(function(t){var r;r="undefined"!=typeof window?window:void 0!==t?t:"undefined"!=typeof self?self:{},e.exports=r}).call(this,r(29))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.circularDependencyToException=t.listMetadataForTarget=t.listRegisteredBindingsForServiceIdentifier=t.getServiceIdentifierAsString=t.getFunctionName=void 0;var n=r(11);function i(e){var t,t;return"function"==typeof e?(t=e).name:"symbol"==typeof e?e.toString():t=e}function o(e,t,r){var n="",i=r(e,t);return 0!==i.length&&(n="\nRegistered bindings:",i.forEach(function(e){var t="Object";null!==e.implementationType&&(t=f(e.implementationType)),n=n+"\n "+t,e.constraint.metaData&&(n=n+" - "+e.constraint.metaData)})),n}function a(e,t){return null!==e.parentRequest&&(e.parentRequest.serviceIdentifier===t||a(e.parentRequest,t))}function s(e){function t(e,r){void 0===r&&(r=[]);var n=i(e.serviceIdentifier);return r.push(n),null!==e.parentRequest?t(e.parentRequest,r):r}var r;return t(e).reverse().join(" --\x3e ")}function u(e){e.childRequests.forEach(function(e){if(a(e,e.serviceIdentifier)){var t=s(e);throw new Error(n.CIRCULAR_DEPENDENCY+" "+t)}u(e)})}function c(e,t){if(t.isTagged()||t.isNamed()){var r="",n=t.getNamedTag(),i=t.getCustomTags();return null!==n&&(r+=n.toString()+"\n"),null!==i&&i.forEach(function(e){r+=e.toString()+"\n"})," "+e+"\n "+e+" - "+r}return" "+e}function f(e){if(e.name)return e.name;var t=e.toString(),r=t.match(/^function\s*([^\s(]+)/);return r?r[1]:"Anonymous function: "+t}t.getServiceIdentifierAsString=i,t.listRegisteredBindingsForServiceIdentifier=o,t.circularDependencyToException=u,t.listMetadataForTarget=c,t.getFunctionName=f},function(e,t,r){var n=r(4);r(48),r(139),r(140),r(8),n.random&&n.random.getBytes?e.exports=n.random:function(t){var r={},i=new Array(4),o=n.util.createBuffer();function a(){var e=n.prng.create(r);return e.getBytes=function(t,r){return e.generate(t,r)},e.getBytesSync=function(t){return e.generate(t)},e}r.formatKey=function(e){var t=n.util.createBuffer(e);return(e=new Array(4))[0]=t.getInt32(),e[1]=t.getInt32(),e[2]=t.getInt32(),e[3]=t.getInt32(),n.aes._expandKey(e,!1)},r.formatSeed=function(e){var t=n.util.createBuffer(e);return(e=new Array(4))[0]=t.getInt32(),e[1]=t.getInt32(),e[2]=t.getInt32(),e[3]=t.getInt32(),e},r.cipher=function(e,t){return n.aes._updateBlock(e,t,i,!1),o.putInt32(i[0]),o.putInt32(i[1]),o.putInt32(i[2]),o.putInt32(i[3]),o.getBytes()},r.increment=function(e){return++e[3],e},r.md=n.md.sha256;var s=a(),u=null,c=n.util.globalScope,f=c.crypto||c.msCrypto;if(f&&f.getRandomValues&&(u=function(e){return f.getRandomValues(e)}),n.options.usePureJavaScript||!n.util.isNodejs&&!u){if("undefined"==typeof window||window.document,s.collectInt(+new Date,32),"undefined"!=typeof navigator){var l="";for(var p in navigator)try{"string"==typeof navigator[p]&&(l+=navigator[p])}catch(e){}s.collect(l),l=null}t&&(t().mousemove(function(e){s.collectInt(e.clientX,16),s.collectInt(e.clientY,16)}),t().keypress(function(e){s.collectInt(e.charCode,8)}))}if(n.random)for(var p in s)n.random[p]=s[p];else n.random=s;n.random.createInstance=a,e.exports=n.random}("undefined"!=typeof jQuery?jQuery:null)},function(e,t,r){"use strict";r.d(t,"a",function(){return a});var n=r(12),i=(o=function(e,t){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},o(e,t)},function(e,t){function r(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o,a=function(e){function t(r){var n=e.call(this,r,"REQUEST_BUILD_ERROR")||this;return Object.setPrototypeOf(n,t.prototype),n}return i(t,e),t}(n.a)},function(e,t,r){var n=r(4);r(8),r(49);var i=e.exports=n.asn1=n.asn1||{};function o(e,t,r){if(r>t){var n=new Error("Too few bytes to parse DER.");throw n.available=e.length(),n.remaining=t,n.requested=r,n}}i.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192},i.Type={NONE:0,BOOLEAN:1,INTEGER:2,BITSTRING:3,OCTETSTRING:4,NULL:5,OID:6,ODESC:7,EXTERNAL:8,REAL:9,ENUMERATED:10,EMBEDDED:11,UTF8:12,ROID:13,SEQUENCE:16,SET:17,PRINTABLESTRING:19,IA5STRING:22,UTCTIME:23,GENERALIZEDTIME:24,BMPSTRING:30},i.create=function(e,t,r,o,a){if(n.util.isArray(o)){for(var s=[],u=0;u<o.length;++u)void 0!==o[u]&&s.push(o[u]);o=s}var c={tagClass:e,type:t,constructed:r,composed:r||n.util.isArray(o),value:o};return a&&"bitStringContents"in a&&(c.bitStringContents=a.bitStringContents,c.original=i.copy(c)),c},i.copy=function(e,t){var r;if(n.util.isArray(e)){r=[];for(var o=0;o<e.length;++o)r.push(i.copy(e[o],t));return r}return"string"==typeof e?e:(r={tagClass:e.tagClass,type:e.type,constructed:e.constructed,composed:e.composed,value:i.copy(e.value,t)},t&&!t.excludeBitStringContents&&(r.bitStringContents=e.bitStringContents),r)},i.equals=function(e,t,r){if(n.util.isArray(e)){if(!n.util.isArray(t))return!1;if(e.length!==t.length)return!1;for(var o=0;o<e.length;++o)if(!i.equals(e[o],t[o]))return!1;return!0}if(typeof e!=typeof t)return!1;if("string"==typeof e)return e===t;var a=e.tagClass===t.tagClass&&e.type===t.type&&e.constructed===t.constructed&&e.composed===t.composed&&i.equals(e.value,t.value);return r&&r.includeBitStringContents&&(a=a&&e.bitStringContents===t.bitStringContents),a},i.getBerValueLength=function(e){var t=e.getByte(),r,n;if(128!==t)return r=128&t?e.getInt((127&t)<<3):t};var a=function(e,t){var r=e.getByte();if(t--,128!==r){var n,i;if(128&r){var a=127&r;o(e,t,a),n=e.getInt(a<<3)}else n=r;if(n<0)throw new Error("Negative length: "+n);return n}};function s(e,t,r,n){var u;o(e,t,2);var c=e.getByte();t--;var f=192&c,l=31&c;u=e.length();var p=a(e,t),h,d;if(t-=u-e.length(),void 0!==p&&p>t){if(n.strict){var y=new Error("Too few bytes to read ASN.1 value.");throw y.available=e.length(),y.remaining=t,y.requested=p,y}p=t}var g=!(32&~c);if(g)if(h=[],void 0===p)for(;;){if(o(e,t,2),e.bytes(2)===String.fromCharCode(0,0)){e.getBytes(2),t-=2;break}u=e.length(),h.push(s(e,t,r+1,n)),t-=u-e.length()}else for(;p>0;)u=e.length(),h.push(s(e,p,r+1,n)),t-=u-e.length(),p-=u-e.length();if(void 0===h&&f===i.Class.UNIVERSAL&&l===i.Type.BITSTRING&&(d=e.bytes(p)),void 0===h&&n.decodeBitStrings&&f===i.Class.UNIVERSAL&&l===i.Type.BITSTRING&&p>1){var v=e.read,m=t,b=0;if(l===i.Type.BITSTRING&&(o(e,t,1),b=e.getByte(),t--),0===b)try{u=e.length();var E,T=s(e,t,r+1,{verbose:n.verbose,strict:!0,decodeBitStrings:!0}),S=u-e.length();t-=S,l==i.Type.BITSTRING&&S++;var w=T.tagClass;S!==p||w!==i.Class.UNIVERSAL&&w!==i.Class.CONTEXT_SPECIFIC||(h=[T])}catch(e){}void 0===h&&(e.read=v,t=m)}if(void 0===h){if(void 0===p){if(n.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");p=t}if(l===i.Type.BMPSTRING)for(h="";p>0;p-=2)o(e,t,2),h+=String.fromCharCode(e.getInt16()),t-=2;else h=e.getBytes(p)}var C=void 0===d?null:{bitStringContents:d};return i.create(f,l,g,h,C)}i.fromDer=function(e,t){return void 0===t&&(t={strict:!0,decodeBitStrings:!0}),"boolean"==typeof t&&(t={strict:t,decodeBitStrings:!0}),"strict"in t||(t.strict=!0),"decodeBitStrings"in t||(t.decodeBitStrings=!0),"string"==typeof e&&(e=n.util.createBuffer(e)),s(e,e.length(),0,t)},i.toDer=function(e){var t=n.util.createBuffer(),r=e.tagClass|e.type,o=n.util.createBuffer(),a=!1;if("bitStringContents"in e&&(a=!0,e.original&&(a=i.equals(e,e.original))),a)o.putBytes(e.bitStringContents);else if(e.composed){e.constructed?r|=32:o.putByte(0);for(var s=0;s<e.value.length;++s)void 0!==e.value[s]&&o.putBuffer(i.toDer(e.value[s]))}else if(e.type===i.Type.BMPSTRING)for(var s=0;s<e.value.length;++s)o.putInt16(e.value.charCodeAt(s));else!(e.type===i.Type.INTEGER&&e.value.length>1)||(0!==e.value.charCodeAt(0)||128&e.value.charCodeAt(1))&&(255!==e.value.charCodeAt(0)||128&~e.value.charCodeAt(1))?o.putBytes(e.value):o.putBytes(e.value.substr(1));if(t.putByte(r),o.length()<=127)t.putByte(127&o.length());else{var u=o.length(),c="";do{c+=String.fromCharCode(255&u),u>>>=8}while(u>0);t.putByte(128|c.length);for(var s=c.length-1;s>=0;--s)t.putByte(c.charCodeAt(s))}return t.putBuffer(o),t},i.oidToDer=function(e){var t=e.split("."),r=n.util.createBuffer(),i,o,a,s;r.putByte(40*parseInt(t[0],10)+parseInt(t[1],10));for(var u=2;u<t.length;++u){i=!0,o=[],a=parseInt(t[u],10);do{s=127&a,a>>>=7,i||(s|=128),o.push(s),i=!1}while(a>0);for(var c=o.length-1;c>=0;--c)r.putByte(o[c])}return r},i.derToOid=function(e){var t;"string"==typeof e&&(e=n.util.createBuffer(e));var r=e.getByte();t=Math.floor(r/40)+"."+r%40;for(var i=0;e.length()>0;)i<<=7,128&(r=e.getByte())?i+=127&r:(t+="."+(i+r),i=0);return t},i.utcTimeToDate=function(e){var t=new Date,r=parseInt(e.substr(0,2),10);r=r>=50?1900+r:2e3+r;var n=parseInt(e.substr(2,2),10)-1,i=parseInt(e.substr(4,2),10),o=parseInt(e.substr(6,2),10),a=parseInt(e.substr(8,2),10),s=0;if(e.length>11){var u=e.charAt(10),c=10;"+"!==u&&"-"!==u&&(s=parseInt(e.substr(10,2),10),c+=2)}if(t.setUTCFullYear(r,n,i),t.setUTCHours(o,a,s,0),c&&("+"===(u=e.charAt(c))||"-"===u)){var f,l,p=60*parseInt(e.substr(c+1,2),10)+parseInt(e.substr(c+4,2),10);p*=6e4,"+"===u?t.setTime(+t-p):t.setTime(+t+p)}return t},i.generalizedTimeToDate=function(e){var t=new Date,r=parseInt(e.substr(0,4),10),n=parseInt(e.substr(4,2),10)-1,i=parseInt(e.substr(6,2),10),o=parseInt(e.substr(8,2),10),a=parseInt(e.substr(10,2),10),s=parseInt(e.substr(12,2),10),u=0,c=0,f=!1;"Z"===e.charAt(e.length-1)&&(f=!0);var l=e.length-5,p=e.charAt(l),h,d;"+"!==p&&"-"!==p||(c=60*parseInt(e.substr(l+1,2),10)+parseInt(e.substr(l+4,2),10),c*=6e4,"+"===p&&(c*=-1),f=!0);return"."===e.charAt(14)&&(u=1e3*parseFloat(e.substr(14),10)),f?(t.setUTCFullYear(r,n,i),t.setUTCHours(o,a,s,u),t.setTime(+t+c)):(t.setFullYear(r,n,i),t.setHours(o,a,s,u)),t},i.dateToUtcTime=function(e){if("string"==typeof e)return e;var t="",r=[];r.push((""+e.getUTCFullYear()).substr(2)),r.push(""+(e.getUTCMonth()+1)),r.push(""+e.getUTCDate()),r.push(""+e.getUTCHours()),r.push(""+e.getUTCMinutes()),r.push(""+e.getUTCSeconds());for(var n=0;n<r.length;++n)r[n].length<2&&(t+="0"),t+=r[n];return t+="Z"},i.dateToGeneralizedTime=function(e){if("string"==typeof e)return e;var t="",r=[];r.push(""+e.getUTCFullYear()),r.push(""+(e.getUTCMonth()+1)),r.push(""+e.getUTCDate()),r.push(""+e.getUTCHours()),r.push(""+e.getUTCMinutes()),r.push(""+e.getUTCSeconds());for(var n=0;n<r.length;++n)r[n].length<2&&(t+="0"),t+=r[n];return t+="Z"},i.integerToDer=function(e){var t=n.util.createBuffer();if(e>=-128&&e<128)return t.putSignedInt(e,8);if(e>=-32768&&e<32768)return t.putSignedInt(e,16);if(e>=-8388608&&e<8388608)return t.putSignedInt(e,24);if(e>=-2147483648&&e<2147483648)return t.putSignedInt(e,32);var r=new Error("Integer too large; max is 32-bits.");throw r.integer=e,r},i.derToInteger=function(e){"string"==typeof e&&(e=n.util.createBuffer(e));var t=8*e.length();if(t>32)throw new Error("Integer too large; max is 32-bits.");return e.getSignedInt(t)},i.validate=function(e,t,r,o){var a=!1;if(e.tagClass!==t.tagClass&&void 0!==t.tagClass||e.type!==t.type&&void 0!==t.type)o&&(e.tagClass!==t.tagClass&&o.push("["+t.name+'] Expected tag class "'+t.tagClass+'", got "'+e.tagClass+'"'),e.type!==t.type&&o.push("["+t.name+'] Expected type "'+t.type+'", got "'+e.type+'"'));else if(e.constructed===t.constructed||void 0===t.constructed){if(a=!0,t.value&&n.util.isArray(t.value))for(var s=0,u=0;a&&u<t.value.length;++u)a=t.value[u].optional||!1,e.value[s]&&((a=i.validate(e.value[s],t.value[u],r,o))?++s:t.value[u].optional&&(a=!0)),!a&&o&&o.push("["+t.name+'] Tag class "'+t.tagClass+'", type "'+t.type+'" expected value length "'+t.value.length+'", got "'+e.value.length+'"');var c;if(a&&r)if(t.capture&&(r[t.capture]=e.value),t.captureAsn1&&(r[t.captureAsn1]=e),t.captureBitStringContents&&"bitStringContents"in e&&(r[t.captureBitStringContents]=e.bitStringContents),t.captureBitStringValue&&"bitStringContents"in e)if(e.bitStringContents.length<2)r[t.captureBitStringValue]="";else{var f;if(0!==e.bitStringContents.charCodeAt(0))throw new Error("captureBitStringValue only supported for zero unused bits");r[t.captureBitStringValue]=e.bitStringContents.slice(1)}}else o&&o.push("["+t.name+'] Expected constructed "'+t.constructed+'", got "'+e.constructed+'"');return a};var u=/[^\\u0000-\\u00ff]/;i.prettyPrint=function(e,t,r){var o="";r=r||2,(t=t||0)>0&&(o+="\n");for(var a="",s=0;s<t*r;++s)a+=" ";switch(o+=a+"Tag: ",e.tagClass){case i.Class.UNIVERSAL:o+="Universal:";break;case i.Class.APPLICATION:o+="Application:";break;case i.Class.CONTEXT_SPECIFIC:o+="Context-Specific:";break;case i.Class.PRIVATE:o+="Private:"}if(e.tagClass===i.Class.UNIVERSAL)switch(o+=e.type,e.type){case i.Type.NONE:o+=" (None)";break;case i.Type.BOOLEAN:o+=" (Boolean)";break;case i.Type.INTEGER:o+=" (Integer)";break;case i.Type.BITSTRING:o+=" (Bit string)";break;case i.Type.OCTETSTRING:o+=" (Octet string)";break;case i.Type.NULL:o+=" (Null)";break;case i.Type.OID:o+=" (Object Identifier)";break;case i.Type.ODESC:o+=" (Object Descriptor)";break;case i.Type.EXTERNAL:o+=" (External or Instance of)";break;case i.Type.REAL:o+=" (Real)";break;case i.Type.ENUMERATED:o+=" (Enumerated)";break;case i.Type.EMBEDDED:o+=" (Embedded PDV)";break;case i.Type.UTF8:o+=" (UTF8)";break;case i.Type.ROID:o+=" (Relative Object Identifier)";break;case i.Type.SEQUENCE:o+=" (Sequence)";break;case i.Type.SET:o+=" (Set)";break;case i.Type.PRINTABLESTRING:o+=" (Printable String)";break;case i.Type.IA5String:o+=" (IA5String (ASCII))";break;case i.Type.UTCTIME:o+=" (UTC time)";break;case i.Type.GENERALIZEDTIME:o+=" (Generalized time)";break;case i.Type.BMPSTRING:o+=" (BMP String)"}else o+=e.type;if(o+="\n",o+=a+"Constructed: "+e.constructed+"\n",e.composed){for(var c=0,f="",s=0;s<e.value.length;++s)void 0!==e.value[s]&&(c+=1,f+=i.prettyPrint(e.value[s],t+1,r),s+1<e.value.length&&(f+=","));o+=a+"Sub values: "+c+f}else{if(o+=a+"Value: ",e.type===i.Type.OID){var l=i.derToOid(e.value);o+=l,n.pki&&n.pki.oids&&l in n.pki.oids&&(o+=" ("+n.pki.oids[l]+") ")}if(e.type===i.Type.INTEGER)try{o+=i.derToInteger(e.value)}catch(t){o+="0x"+n.util.bytesToHex(e.value)}else if(e.type===i.Type.BITSTRING){if(e.value.length>1?o+="0x"+n.util.bytesToHex(e.value.slice(1)):o+="(none)",e.value.length>0){var p=e.value.charCodeAt(0);1==p?o+=" (1 unused bit shown)":p>1&&(o+=" ("+p+" unused bits shown)")}}else e.type===i.Type.OCTETSTRING?(u.test(e.value)||(o+="("+e.value+") "),o+="0x"+n.util.bytesToHex(e.value)):e.type===i.Type.UTF8?o+=n.util.decodeUtf8(e.value):e.type===i.Type.PRINTABLESTRING||e.type===i.Type.IA5String?o+=e.value:u.test(e.value)?o+="0x"+n.util.bytesToHex(e.value):0===e.value.length?o+="[null]":o+=e.value}return o}},function(e,t,r){"use strict";function n(e){return null!==e&&"object"==typeof e}r.d(t,"a",function(){return n})},function(e,t,r){"use strict";r.d(t,"a",function(){return n});var n=function(e){return function(t){for(var r=0,n=e.length;r<n&&!t.closed;r++)t.next(e[r]);t.complete()}}},function(e,t){var r=e.exports={},n,i;function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}function u(e){if(i===clearTimeout)return clearTimeout(e);if((i===a||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(e);try{return i(e)}catch(t){try{return i.call(null,e)}catch(t){return i.call(this,e)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(e){n=o}try{i="function"==typeof clearTimeout?clearTimeout:a}catch(e){i=a}}();var c=[],f=!1,l,p=-1;function h(){f&&l&&(f=!1,l.length?c=l.concat(c):p=-1,c.length&&d())}function d(){if(!f){var e=s(h);f=!0;for(var t=c.length;t;){for(l=c,c=[];++p<t;)l&&l[p].run();p=-1,t=c.length}l=null,f=!1,u(e)}}function y(e,t){this.fun=e,this.array=t}function g(){}r.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];c.push(new y(e,t)),1!==c.length||f||s(d)},y.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=g,r.addListener=g,r.once=g,r.off=g,r.removeListener=g,r.removeAllListeners=g,r.emit=g,r.prependListener=g,r.prependOnceListener=g,r.listeners=function(e){return[]},r.binding=function(e){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(e){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}},function(e,t,r){var n=r(4);e.exports=n.md=n.md||{},n.md.algorithms=n.md.algorithms||{}},,,,,,,,,function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BindingOnSyntax=void 0;var n=r(47),i=function(){function e(e){this._binding=e}return e.prototype.onActivation=function(e){return this._binding.onActivation=e,new n.BindingWhenSyntax(this._binding)},e}();t.BindingOnSyntax=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BindingWhenSyntax=void 0;var n=r(46),i=r(59),o=function(){function e(e){this._binding=e}return e.prototype.when=function(e){return this._binding.constraint=e,new n.BindingOnSyntax(this._binding)},e.prototype.whenTargetNamed=function(e){return this._binding.constraint=i.namedConstraint(e),new n.BindingOnSyntax(this._binding)},e.prototype.whenTargetIsDefault=function(){return this._binding.constraint=function(e){var t;return null!==e.target&&!e.target.isNamed()&&!e.target.isTagged()},new n.BindingOnSyntax(this._binding)},e.prototype.whenTargetTagged=function(e,t){return this._binding.constraint=i.taggedConstraint(e)(t),new n.BindingOnSyntax(this._binding)},e.prototype.whenInjectedInto=function(e){return this._binding.constraint=function(t){return i.typeConstraint(e)(t.parentRequest)},new n.BindingOnSyntax(this._binding)},e.prototype.whenParentNamed=function(e){return this._binding.constraint=function(t){return i.namedConstraint(e)(t.parentRequest)},new n.BindingOnSyntax(this._binding)},e.prototype.whenParentTagged=function(e,t){return this._binding.constraint=function(r){return i.taggedConstraint(e)(t)(r.parentRequest)},new n.BindingOnSyntax(this._binding)},e.prototype.whenAnyAncestorIs=function(e){return this._binding.constraint=function(t){return i.traverseAncerstors(t,i.typeConstraint(e))},new n.BindingOnSyntax(this._binding)},e.prototype.whenNoAncestorIs=function(e){return this._binding.constraint=function(t){return!i.traverseAncerstors(t,i.typeConstraint(e))},new n.BindingOnSyntax(this._binding)},e.prototype.whenAnyAncestorNamed=function(e){return this._binding.constraint=function(t){return i.traverseAncerstors(t,i.namedConstraint(e))},new n.BindingOnSyntax(this._binding)},e.prototype.whenNoAncestorNamed=function(e){return this._binding.constraint=function(t){return!i.traverseAncerstors(t,i.namedConstraint(e))},new n.BindingOnSyntax(this._binding)},e.prototype.whenAnyAncestorTagged=function(e,t){return this._binding.constraint=function(r){return i.traverseAncerstors(r,i.taggedConstraint(e)(t))},new n.BindingOnSyntax(this._binding)},e.prototype.whenNoAncestorTagged=function(e,t){return this._binding.constraint=function(r){return!i.traverseAncerstors(r,i.taggedConstraint(e)(t))},new n.BindingOnSyntax(this._binding)},e.prototype.whenAnyAncestorMatches=function(e){return this._binding.constraint=function(t){return i.traverseAncerstors(t,e)},new n.BindingOnSyntax(this._binding)},e.prototype.whenNoAncestorMatches=function(e){return this._binding.constraint=function(t){return!i.traverseAncerstors(t,e)},new n.BindingOnSyntax(this._binding)},e}();t.BindingWhenSyntax=o},function(e,t,r){var n=r(4);function i(e,t){var r=function(){return new n.aes.Algorithm(e,t)};n.cipher.registerAlgorithm(e,r)}r(118),r(135),r(8),e.exports=n.aes=n.aes||{},n.aes.startEncrypting=function(e,t,r,n){var i=y({key:e,output:r,decrypt:!1,mode:n});return i.start(t),i},n.aes.createEncryptionCipher=function(e,t){return y({key:e,output:null,decrypt:!1,mode:t})},n.aes.startDecrypting=function(e,t,r,n){var i=y({key:e,output:r,decrypt:!0,mode:n});return i.start(t),i},n.aes.createDecryptionCipher=function(e,t){return y({key:e,output:null,decrypt:!0,mode:t})},n.aes.Algorithm=function(e,t){o||p();var r=this;r.name=e,r.mode=new t({blockSize:16,cipher:{encrypt:function(e,t){return d(r._w,e,t,!1)},decrypt:function(e,t){return d(r._w,e,t,!0)}}}),r._init=!1},n.aes.Algorithm.prototype.initialize=function(e){if(!this._init){var t=e.key,r;if("string"!=typeof t||16!==t.length&&24!==t.length&&32!==t.length){if(n.util.isArray(t)&&(16===t.length||24===t.length||32===t.length)){r=t,t=n.util.createBuffer();for(var i=0;i<r.length;++i)t.putByte(r[i])}}else t=n.util.createBuffer(t);if(!n.util.isArray(t)){r=t,t=[];var o=r.length();if(16===o||24===o||32===o){o>>>=2;for(var i=0;i<o;++i)t.push(r.getInt32())}}if(!n.util.isArray(t)||4!==t.length&&6!==t.length&&8!==t.length)throw new Error("Invalid key parameter.");var a=this.mode.name,s=-1!==["CFB","OFB","CTR","GCM"].indexOf(a);this._w=h(t,e.decrypt&&!s),this._init=!0}},n.aes._expandKey=function(e,t){return o||p(),h(e,t)},n.aes._updateBlock=d,i("AES-ECB",n.cipher.modes.ecb),i("AES-CBC",n.cipher.modes.cbc),i("AES-CFB",n.cipher.modes.cfb),i("AES-OFB",n.cipher.modes.ofb),i("AES-CTR",n.cipher.modes.ctr),i("AES-GCM",n.cipher.modes.gcm);var o=!1,a=4,s,u,c,f,l;function p(){o=!0,c=[0,1,2,4,8,16,32,64,128,27,54];for(var e=new Array(256),t=0;t<128;++t)e[t]=t<<1,e[t+128]=t+128<<1^283;s=new Array(256),u=new Array(256),f=new Array(4),l=new Array(4);for(var t=0;t<4;++t)f[t]=new Array(256),l[t]=new Array(256);for(var r=0,n=0,i,a,p,h,d,y,g,t=0;t<256;++t){h=(h=n^n<<1^n<<2^n<<3^n<<4)>>8^255&h^99,s[r]=h,u[h]=r,y=(d=e[h])<<24^h<<16^h<<8^h^d,g=((i=e[r])^(a=e[i])^(p=e[a]))<<24^(r^p)<<16^(r^a^p)<<8^r^i^p;for(var v=0;v<4;++v)f[v][r]=y,l[v][h]=g,y=y<<24|y>>>8,g=g<<24|g>>>8;0===r?r=n=1:(r=i^e[e[e[i^p]]],n^=e[e[n]])}}function h(e,t){for(var r=e.slice(0),n,i=1,o=r.length,u,f=a*(o+6+1),p=o;p<f;++p)n=r[p-1],p%o===0?(n=s[n>>>16&255]<<24^s[n>>>8&255]<<16^s[255&n]<<8^s[n>>>24]^c[i]<<24,i++):o>6&&p%o===4&&(n=s[n>>>24]<<24^s[n>>>16&255]<<16^s[n>>>8&255]<<8^s[255&n]),r[p]=r[p-o]^n;if(t){for(var h,d=l[0],y=l[1],g=l[2],v=l[3],m=r.slice(0),p=0,b=(f=r.length)-a;p<f;p+=a,b-=a)if(0===p||p===f-a)m[p]=r[b],m[p+1]=r[b+3],m[p+2]=r[b+2],m[p+3]=r[b+1];else for(var E=0;E<a;++E)h=r[b+E],m[p+(3&-E)]=d[s[h>>>24]]^y[s[h>>>16&255]]^g[s[h>>>8&255]]^v[s[255&h]];r=m}return r}function d(e,t,r,n){var i=e.length/4-1,o,a,c,p,h,d,y,g,v,m,b,E;n?(o=l[0],a=l[1],c=l[2],p=l[3],h=u):(o=f[0],a=f[1],c=f[2],p=f[3],h=s),d=t[0]^e[0],y=t[n?3:1]^e[1],g=t[2]^e[2],v=t[n?1:3]^e[3];for(var T=3,S=1;S<i;++S)m=o[d>>>24]^a[y>>>16&255]^c[g>>>8&255]^p[255&v]^e[++T],b=o[y>>>24]^a[g>>>16&255]^c[v>>>8&255]^p[255&d]^e[++T],E=o[g>>>24]^a[v>>>16&255]^c[d>>>8&255]^p[255&y]^e[++T],v=o[v>>>24]^a[d>>>16&255]^c[y>>>8&255]^p[255&g]^e[++T],d=m,y=b,g=E;r[0]=h[d>>>24]<<24^h[y>>>16&255]<<16^h[g>>>8&255]<<8^h[255&v]^e[++T],r[n?3:1]=h[y>>>24]<<24^h[g>>>16&255]<<16^h[v>>>8&255]<<8^h[255&d]^e[++T],r[2]=h[g>>>24]<<24^h[v>>>16&255]<<16^h[d>>>8&255]<<8^h[255&y]^e[++T],r[n?1:3]=h[v>>>24]<<24^h[d>>>16&255]<<16^h[y>>>8&255]<<8^h[255&g]^e[++T]}function y(e){var t,r="AES-"+((e=e||{}).mode||"CBC").toUpperCase(),i,o=(i=e.decrypt?n.cipher.createDecipher(r,e.key):n.cipher.createCipher(r,e.key)).start;return i.start=function(e,t){var r=null;t instanceof n.util.ByteBuffer&&(r=t,t={}),(t=t||{}).output=r,t.iv=e,o.call(i,t)},i}},function(e,t,r){var n=r(4);n.pki=n.pki||{};var i=e.exports=n.pki.oids=n.oids=n.oids||{};function o(e,t){i[e]=t,i[t]=e}function a(e,t){i[e]=t}o("1.2.840.113549.1.1.1","rsaEncryption"),o("1.2.840.113549.1.1.4","md5WithRSAEncryption"),o("1.2.840.113549.1.1.5","sha1WithRSAEncryption"),o("1.2.840.113549.1.1.7","RSAES-OAEP"),o("1.2.840.113549.1.1.8","mgf1"),o("1.2.840.113549.1.1.9","pSpecified"),o("1.2.840.113549.1.1.10","RSASSA-PSS"),o("1.2.840.113549.1.1.11","sha256WithRSAEncryption"),o("1.2.840.113549.1.1.12","sha384WithRSAEncryption"),o("1.2.840.113549.1.1.13","sha512WithRSAEncryption"),o("1.3.101.112","EdDSA25519"),o("1.2.840.10040.4.3","dsa-with-sha1"),o("1.3.14.3.2.7","desCBC"),o("1.3.14.3.2.26","sha1"),o("2.16.840.1.101.3.4.2.1","sha256"),o("2.16.840.1.101.3.4.2.2","sha384"),o("2.16.840.1.101.3.4.2.3","sha512"),o("1.2.840.113549.2.5","md5"),o("1.2.840.113549.1.7.1","data"),o("1.2.840.113549.1.7.2","signedData"),o("1.2.840.113549.1.7.3","envelopedData"),o("1.2.840.113549.1.7.4","signedAndEnvelopedData"),o("1.2.840.113549.1.7.5","digestedData"),o("1.2.840.113549.1.7.6","encryptedData"),o("1.2.840.113549.1.9.1","emailAddress"),o("1.2.840.113549.1.9.2","unstructuredName"),o("1.2.840.113549.1.9.3","contentType"),o("1.2.840.113549.1.9.4","messageDigest"),o("1.2.840.113549.1.9.5","signingTime"),o("1.2.840.113549.1.9.6","counterSignature"),o("1.2.840.113549.1.9.7","challengePassword"),o("1.2.840.113549.1.9.8","unstructuredAddress"),o("1.2.840.113549.1.9.14","extensionRequest"),o("1.2.840.113549.1.9.20","friendlyName"),o("1.2.840.113549.1.9.21","localKeyId"),o("1.2.840.113549.1.9.22.1","x509Certificate"),o("1.2.840.113549.1.12.10.1.1","keyBag"),o("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag"),o("1.2.840.113549.1.12.10.1.3","certBag"),o("1.2.840.113549.1.12.10.1.4","crlBag"),o("1.2.840.113549.1.12.10.1.5","secretBag"),o("1.2.840.113549.1.12.10.1.6","safeContentsBag"),o("1.2.840.113549.1.5.13","pkcs5PBES2"),o("1.2.840.113549.1.5.12","pkcs5PBKDF2"),o("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4"),o("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4"),o("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC"),o("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC"),o("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC"),o("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC"),o("1.2.840.113549.2.7","hmacWithSHA1"),o("1.2.840.113549.2.8","hmacWithSHA224"),o("1.2.840.113549.2.9","hmacWithSHA256"),o("1.2.840.113549.2.10","hmacWithSHA384"),o("1.2.840.113549.2.11","hmacWithSHA512"),o("1.2.840.113549.3.7","des-EDE3-CBC"),o("2.16.840.1.101.3.4.1.2","aes128-CBC"),o("2.16.840.1.101.3.4.1.22","aes192-CBC"),o("2.16.840.1.101.3.4.1.42","aes256-CBC"),o("2.5.4.3","commonName"),o("2.5.4.5","serialName"),o("2.5.4.6","countryName"),o("2.5.4.7","localityName"),o("2.5.4.8","stateOrProvinceName"),o("2.5.4.9","streetAddress"),o("2.5.4.10","organizationName"),o("2.5.4.11","organizationalUnitName"),o("2.5.4.13","description"),o("2.5.4.15","businessCategory"),o("2.5.4.17","postalCode"),o("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName"),o("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName"),o("2.16.840.1.113730.1.1","nsCertType"),o("2.16.840.1.113730.1.13","nsComment"),a("2.5.29.1","authorityKeyIdentifier"),a("2.5.29.2","keyAttributes"),a("2.5.29.3","certificatePolicies"),a("2.5.29.4","keyUsageRestriction"),a("2.5.29.5","policyMapping"),a("2.5.29.6","subtreesConstraint"),a("2.5.29.7","subjectAltName"),a("2.5.29.8","issuerAltName"),a("2.5.29.9","subjectDirectoryAttributes"),a("2.5.29.10","basicConstraints"),a("2.5.29.11","nameConstraints"),a("2.5.29.12","policyConstraints"),a("2.5.29.13","basicConstraints"),o("2.5.29.14","subjectKeyIdentifier"),o("2.5.29.15","keyUsage"),a("2.5.29.16","privateKeyUsagePeriod"),o("2.5.29.17","subjectAltName"),o("2.5.29.18","issuerAltName"),o("2.5.29.19","basicConstraints"),a("2.5.29.20","cRLNumber"),a("2.5.29.21","cRLReason"),a("2.5.29.22","expirationDate"),a("2.5.29.23","instructionCode"),a("2.5.29.24","invalidityDate"),a("2.5.29.25","cRLDistributionPoints"),a("2.5.29.26","issuingDistributionPoint"),a("2.5.29.27","deltaCRLIndicator"),a("2.5.29.28","issuingDistributionPoint"),a("2.5.29.29","certificateIssuer"),a("2.5.29.30","nameConstraints"),o("2.5.29.31","cRLDistributionPoints"),o("2.5.29.32","certificatePolicies"),a("2.5.29.33","policyMappings"),a("2.5.29.34","policyConstraints"),o("2.5.29.35","authorityKeyIdentifier"),a("2.5.29.36","policyConstraints"),o("2.5.29.37","extKeyUsage"),a("2.5.29.46","freshestCRL"),a("2.5.29.54","inhibitAnyPolicy"),o("1.3.6.1.4.1.11129.2.4.2","timestampList"),o("1.3.6.1.5.5.7.1.1","authorityInfoAccess"),o("1.3.6.1.5.5.7.3.1","serverAuth"),o("1.3.6.1.5.5.7.3.2","clientAuth"),o("1.3.6.1.5.5.7.3.3","codeSigning"),o("1.3.6.1.5.5.7.3.4","emailProtection"),o("1.3.6.1.5.5.7.3.8","timeStamping")},function(e,t,r){"use strict";r.d(t,"a",function(){return n});var n=function(){function e(){}return e.TRACE_ID="trace_id",e}()},function(e,t,r){var n=r(4);r(8);var i=e.exports=n.pem=n.pem||{};function o(e){for(var t=e.name+": ",r=[],n=function(e,t){return" "+t},i=0;i<e.values.length;++i)r.push(e.values[i].replace(/^(\S+\r\n)/,n));t+=r.join(",")+"\r\n";for(var o=0,a=-1,i=0;i<t.length;++i,++o)if(o>65&&-1!==a){var s=t[a];","===s?(++a,t=t.substr(0,a)+"\r\n "+t.substr(a)):t=t.substr(0,a)+"\r\n"+s+t.substr(a+1),o=i-a-1,a=-1,++i}else" "!==t[i]&&"\t"!==t[i]&&","!==t[i]||(a=i);return t}function a(e){return e.replace(/^\s+/,"")}i.encode=function(e,t){t=t||{};var r="-----BEGIN "+e.type+"-----\r\n",i;if(e.procType&&(r+=o(i={name:"Proc-Type",values:[String(e.procType.version),e.procType.type]})),e.contentDomain&&(r+=o(i={name:"Content-Domain",values:[e.contentDomain]})),e.dekInfo&&(i={name:"DEK-Info",values:[e.dekInfo.algorithm]},e.dekInfo.parameters&&i.values.push(e.dekInfo.parameters),r+=o(i)),e.headers)for(var a=0;a<e.headers.length;++a)r+=o(e.headers[a]);return e.procType&&(r+="\r\n"),r+=n.util.encode64(e.body,t.maxline||64)+"\r\n",r+="-----END "+e.type+"-----\r\n"},i.decode=function(e){for(var t=[],r=/\s*-----BEGIN ([A-Z0-9- ]+)-----\r?\n?([\x21-\x7e\s]+?(?:\r?\n\r?\n))?([:A-Za-z0-9+\/=\s]+?)-----END \1-----/g,i=/([\x21-\x7e]+):\s*([\x21-\x7e\s^:]+)/,o=/\r?\n/,s;s=r.exec(e);){var u={type:s[1],procType:null,contentDomain:null,dekInfo:null,headers:[],body:n.util.decode64(s[3])};if(t.push(u),s[2]){for(var c=s[2].split(o),f=0;s&&f<c.length;){for(var l=c[f].replace(/\s+$/,""),p=f+1;p<c.length;++p){var h=c[p];if(!/\s/.test(h[0]))break;l+=h,f=p}if(s=l.match(i)){for(var d={name:s[1],values:[]},y=s[2].split(","),g=0;g<y.length;++g)d.values.push(a(y[g]));if(u.procType)if(u.contentDomain||"Content-Domain"!==d.name)if(u.dekInfo||"DEK-Info"!==d.name)u.headers.push(d);else{if(0===d.values.length)throw new Error('Invalid PEM formatted message. The "DEK-Info" header must have at least one subfield.');u.dekInfo={algorithm:y[0],parameters:y[1]||null}}else u.contentDomain=y[0]||"";else{if("Proc-Type"!==d.name)throw new Error('Invalid PEM formatted message. The first encapsulated header must be "Proc-Type".');if(2!==d.values.length)throw new Error('Invalid PEM formatted message. The "Proc-Type" header must have two subfields.');u.procType={version:y[0],type:y[1]}}}++f}if("ENCRYPTED"===u.procType&&!u.dekInfo)throw new Error('Invalid PEM formatted message. The "DEK-Info" header must be present if "Proc-Type" is "ENCRYPTED".')}}if(0===t.length)throw new Error("Invalid PEM formatted message.");return t}},,function(e,t,r){"use strict";function n(){var e,t,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",a=r.toStringTag||"@@toStringTag";function s(r,n,o,a){var s=n&&n.prototype instanceof c?n:c,f=Object.create(s.prototype);return i(f,"_invoke",function(r,n,i){var o,a,s,c=0,f=i||[],l=!1,p={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function t(r,n){return o=r,a=0,s=e,p.n=n,u}};function h(r,n){for(a=r,s=n,t=0;!l&&c&&!i&&t<f.length;t++){var i,o=f[t],h=p.p,d=o[2];r>3?(i=d===n)&&(s=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=e):o[0]<=h&&((i=r<2&&h<o[1])?(a=0,p.v=n,p.n=o[1]):h<d&&(i=r<3||o[0]>n||n>d)&&(o[4]=r,o[5]=n,p.n=d,a=0))}if(i||r>1)return u;throw l=!0,n}return function(i,f,d){if(c>1)throw TypeError("Generator is already running");for(l&&1===f&&h(f,d),a=f,s=d;(t=a<2?e:s)||!l;){o||(a?a<3?(a>1&&(p.n=-1),h(a,s)):p.n=s:p.v=s);try{if(c=2,o){if(a||(i="next"),t=o[i]){if(!(t=t.call(o,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,a<2&&(a=0)}else 1===a&&(t=o.return)&&t.call(o),a<2&&(s=TypeError("The iterator does not provide a '"+i+"' method"),a=1);o=e}else if((t=(l=p.n<0)?s:r.call(n,p))!==u)break}catch(t){o=e,a=1,s=t}finally{c=1}}return{value:t,done:l}}}(r,o,a),!0),f}var u={};function c(){}function f(){}function l(){}t=Object.getPrototypeOf;var p=[][o]?t(t([][o]())):(i(t={},o,function(){return this}),t),h=l.prototype=c.prototype=Object.create(p);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,i(e,a,"GeneratorFunction")),e.prototype=Object.create(h),e}return f.prototype=l,i(h,"constructor",l),i(l,"constructor",f),f.displayName="GeneratorFunction",i(l,a,"GeneratorFunction"),i(h),i(h,a,"Generator"),i(h,o,function(){return this}),i(h,"toString",function(){return"[object Generator]"}),(n=function e(){return{w:s,m:d}})()}function i(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}i=function e(t,r,n,a){function s(e,r){i(t,e,function(t){return this._invoke(e,r,t)})}r?o?o(t,r,{value:n,enumerable:!a,configurable:!a,writable:!a}):t[r]=n:(s("next",0),s("throw",1),s("return",2))},i(e,t,r,n)}function o(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function a(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function s(e){o(a,n,i,s,u,"next",e)}function u(e){o(a,n,i,s,u,"throw",e)}s(void 0)})}}var s={};e.exports=s;var u=r(66);Object.assign(s,u);var c=r(175),f=r(182);s.sign=function(){var e=a(n().m(function e(t){var r,i,o,a,s,u,f,l,p=arguments,h;return n().w(function(e){for(;;)switch(e.p=e.n){case 0:return i=(r=p.length>1&&void 0!==p[1]?p[1]:{}).suite,o=r.purpose,a=r.documentLoader,s=r.expansionMap,u=r.compactProof,e.p=1,e.n=2,(new c).add(t,{suite:i,purpose:o,documentLoader:a,expansionMap:s,compactProof:u});case 2:return e.a(2,e.v);case 3:if(e.p=3,h=e.v,a||"jsonld.InvalidUrl"!==h.name){e.n=4;break}throw f=h.details.url,(l=new Error('A URL "'.concat(f,'" could not be fetched; you need to pass ')+'"documentLoader" or resolve the URL before calling "sign".')).cause=h,l;case 4:throw h;case 5:return e.a(2)}},e,null,[[1,3]])}));function t(t){return e.apply(this,arguments)}return t}(),s.verify=function(){var e=a(n().m(function e(t){var r,i,o,a,s,u,l,p,h,d,y=arguments;return n().w(function(e){for(;;)switch(e.n){case 0:return i=(r=y.length>1&&void 0!==y[1]?y[1]:{}).suite,o=r.purpose,a=r.documentLoader,s=r.expansionMap,u=r.compactProof,e.n=1,(new c).verify(t,{suite:i,purpose:o,documentLoader:a,expansionMap:s,compactProof:u});case 1:return l=e.v,(p=l.error)&&(a||"jsonld.InvalidUrl"!==p.name?l.error=new f(p):(h=p.details.url,d=new Error('A URL "'.concat(h,'" could not be fetched; you need to pass ')+'"documentLoader" or resolve the URL before calling "verify".'),l.error=new f(d))),e.a(2,l)}},e)}));function t(t){return e.apply(this,arguments)}return t}(),s.suites=r(183).suites,s.purposes=r(202).purposes,Object.assign(s,r(73)),Object.assign(s,r(129))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MetadataReader=void 0;var n=r(7),i=function(){function e(){}return e.prototype.getConstructorMetadata=function(e){var t,r;return{compilerGeneratedMetadata:Reflect.getMetadata(n.PARAM_TYPES,e),userGeneratedMetadata:Reflect.getMetadata(n.TAGGED,e)||{}}},e.prototype.getPropertiesMetadata=function(e){var t;return Reflect.getMetadata(n.TAGGED_PROP,e)||[]},e}();t.MetadataReader=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isStackOverflowExeption=void 0;var n=r(11);function i(e){return e instanceof RangeError||e.message===n.STACK_OVERFLOW}t.isStackOverflowExeption=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.inject=t.LazyServiceIdentifer=void 0;var n=r(11),i=r(7),o=r(14),a=r(19),s=function(){function e(e){this._cb=e}return e.prototype.unwrap=function(){return this._cb()},e}();function u(e){return function(t,r,s){if(void 0===e)throw new Error(n.UNDEFINED_INJECT_ANNOTATION(t.name));var u=new o.Metadata(i.INJECT_TAG,e);"number"==typeof s?a.tagParameter(t,r,s,u):a.tagProperty(t,r,u)}}t.LazyServiceIdentifer=s,t.inject=u},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Target=void 0;var n=r(7),i=r(24),o=r(14),a=r(94),s=function(){function e(e,t,r,s){this.id=i.id(),this.type=e,this.serviceIdentifier=r,this.name=new a.QueryableString(t||""),this.metadata=new Array;var u=null;"string"==typeof s?u=new o.Metadata(n.NAMED_TAG,s):s instanceof o.Metadata&&(u=s),null!==u&&this.metadata.push(u)}return e.prototype.hasTag=function(e){for(var t=0,r=this.metadata;t<r.length;t++){var n;if(r[t].key===e)return!0}return!1},e.prototype.isArray=function(){return this.hasTag(n.MULTI_INJECT_TAG)},e.prototype.matchesArray=function(e){return this.matchesTag(n.MULTI_INJECT_TAG)(e)},e.prototype.isNamed=function(){return this.hasTag(n.NAMED_TAG)},e.prototype.isTagged=function(){return this.metadata.some(function(e){return n.NON_CUSTOM_TAG_KEYS.every(function(t){return e.key!==t})})},e.prototype.isOptional=function(){return this.matchesTag(n.OPTIONAL_TAG)(!0)},e.prototype.getNamedTag=function(){return this.isNamed()?this.metadata.filter(function(e){return e.key===n.NAMED_TAG})[0]:null},e.prototype.getCustomTags=function(){return this.isTagged()?this.metadata.filter(function(e){return n.NON_CUSTOM_TAG_KEYS.every(function(t){return e.key!==t})}):null},e.prototype.matchesNamedTag=function(e){return this.matchesTag(n.NAMED_TAG)(e)},e.prototype.matchesTag=function(e){var t=this;return function(r){for(var n=0,i=t.metadata;n<i.length;n++){var o=i[n];if(o.key===e&&o.value===r)return!0}return!1}},e}();t.Target=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BindingWhenOnSyntax=void 0;var n=r(46),i=r(47),o=function(){function e(e){this._binding=e,this._bindingWhenSyntax=new i.BindingWhenSyntax(this._binding),this._bindingOnSyntax=new n.BindingOnSyntax(this._binding)}return e.prototype.when=function(e){return this._bindingWhenSyntax.when(e)},e.prototype.whenTargetNamed=function(e){return this._bindingWhenSyntax.whenTargetNamed(e)},e.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},e.prototype.whenTargetTagged=function(e,t){return this._bindingWhenSyntax.whenTargetTagged(e,t)},e.prototype.whenInjectedInto=function(e){return this._bindingWhenSyntax.whenInjectedInto(e)},e.prototype.whenParentNamed=function(e){return this._bindingWhenSyntax.whenParentNamed(e)},e.prototype.whenParentTagged=function(e,t){return this._bindingWhenSyntax.whenParentTagged(e,t)},e.prototype.whenAnyAncestorIs=function(e){return this._bindingWhenSyntax.whenAnyAncestorIs(e)},e.prototype.whenNoAncestorIs=function(e){return this._bindingWhenSyntax.whenNoAncestorIs(e)},e.prototype.whenAnyAncestorNamed=function(e){return this._bindingWhenSyntax.whenAnyAncestorNamed(e)},e.prototype.whenAnyAncestorTagged=function(e,t){return this._bindingWhenSyntax.whenAnyAncestorTagged(e,t)},e.prototype.whenNoAncestorNamed=function(e){return this._bindingWhenSyntax.whenNoAncestorNamed(e)},e.prototype.whenNoAncestorTagged=function(e,t){return this._bindingWhenSyntax.whenNoAncestorTagged(e,t)},e.prototype.whenAnyAncestorMatches=function(e){return this._bindingWhenSyntax.whenAnyAncestorMatches(e)},e.prototype.whenNoAncestorMatches=function(e){return this._bindingWhenSyntax.whenNoAncestorMatches(e)},e.prototype.onActivation=function(e){return this._bindingOnSyntax.onActivation(e)},e}();t.BindingWhenOnSyntax=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.typeConstraint=t.namedConstraint=t.taggedConstraint=t.traverseAncerstors=void 0;var n=r(7),i=r(14),o=function(e,t){var r=e.parentRequest;return null!==r&&(!!t(r)||o(r,t))};t.traverseAncerstors=o;var a=function(e){return function(t){var r=function(r){return null!==r&&null!==r.target&&r.target.matchesTag(e)(t)};return r.metaData=new i.Metadata(e,t),r}};t.taggedConstraint=a;var s=a(n.NAMED_TAG);t.namedConstraint=s;var u=function(e){return function(t){var r=null;if(null!==t){var n;if(r=t.bindings[0],"string"==typeof e)return r.serviceIdentifier===e;var i=t.bindings[0].implementationType;return e===i}return!1}};t.typeConstraint=u},function(e,t){},function(e,t){},function(e,t,r){"use strict";r.d(t,"b",function(){return i}),r.d(t,"a",function(){return o}),r.d(t,"c",function(){return a});var n=r(32),i,o;!function(e){e.JSON="json",e.URLENCODED="urlencoded",e.UTF8="utf8",e.RAW="raw"}(i||(i={})),function(e){e.GET="GET",e.POST="POST",e.PATCH="PATCH",e.DELETE="DELETE",e.PUT="PUT"}(o||(o={}));var a=function(){function e(){this._serializer=i.JSON,this._responseInterceptors=[],this._withBearerToken=!1,this._headers={},this._body={},this._parameters={},this._withUserToken=!1,this._requestInterceptors=[]}return e.fromJSON=function(t){var r=new e.Builder;return t.body&&r.withBody(t.body),t.type&&r.withType(t.type),t.host&&r.withHost(t.host),t.path&&r.withPath(t.path),t.serializer&&r.withSerializer(t.serializer),t.withBearerToken&&r.withBearerToken(t.withBearerToken),t.withUserToken&&r.withUserToken(t.withUserToken),t.headers&&r.headers(t.headers),t.parameters&&r.withParameters(t.parameters),r.build()},Object.defineProperty(e.prototype,"serializer",{get:function(){return this._serializer},set:function(e){this._serializer=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"withBearerToken",{get:function(){return this._withBearerToken},set:function(e){this._withBearerToken=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"body",{get:function(){return this._body},set:function(e){this._body=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"path",{get:function(){return this._path},set:function(e){this._path=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"type",{get:function(){return this._type},set:function(e){this._type=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"responseInterceptors",{get:function(){return this._responseInterceptors},set:function(e){this._responseInterceptors=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"headers",{get:function(){return this._headers},set:function(e){this._headers=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parameters",{get:function(){return this._parameters},set:function(e){this._parameters=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"withUserToken",{get:function(){return this._withUserToken},set:function(e){this._withUserToken=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"requestInterceptors",{get:function(){return this._requestInterceptors},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"host",{get:function(){return this._host},enumerable:!1,configurable:!0}),e.prototype.toJSON=function(){return JSON.stringify({body:this._body,type:this._type,host:this._host,path:this._path,serializer:this._serializer,withBearerToken:this._withBearerToken,withUserToken:this._withUserToken,headers:this._headers,parameters:this._parameters})},e.Builder=function(){function t(){this.request=new e}return t.prototype.withHost=function(e){return this.request._host=e,this},t.prototype.withPath=function(e){return this.request._path=e,this},t.prototype.withType=function(e){return this.request._type=e,this},t.prototype.withResponseInterceptor=function(e){return this.request._responseInterceptors.push(e),this},t.prototype.withRequestInterceptor=function(e){return this.request._requestInterceptors.push(e),this},t.prototype.withHeaders=function(e){return this.request._headers=e,this},t.prototype.withBody=function(e){return this.request._body=e,this},t.prototype.withParameters=function(e){return this.request._parameters=e,this},t.prototype.withBearerToken=function(e){return this.request.withBearerToken=e,this},t.prototype.withUserToken=function(e){return this.request.withUserToken=e,this},t.prototype.withSerializer=function(e){return this.request._serializer=e,this},t.prototype.build=function(){if(!this.request._path)throw new n.a("withPath() is required");if(!this.request._type)throw new n.a("withType() is required");return this.request},t}(),e}()},function(e,t){},function(e,t,r){"use strict";var n;r.d(t,"a",function(){return n}),r.d(t,"b",function(){return i}),function(e){e[e.HTTP_UNAUTHORISED=401]="HTTP_UNAUTHORISED",e[e.HTTP_FORBIDDEN=403]="HTTP_FORBIDDEN",e[e.HTTP_SUCCESS=200]="HTTP_SUCCESS",e[e.HTTP_BAD_REQUEST=400]="HTTP_BAD_REQUEST",e[e.HTTP_KONG_FAILURE=447]="HTTP_KONG_FAILURE",e[e.HTTP_INTERNAL_SERVER_ERROR=500]="HTTP_INTERNAL_SERVER_ERROR"}(n||(n={}));var i=function(){function e(){}return Object.defineProperty(e.prototype,"responseCode",{get:function(){return this._responseCode},set:function(e){this._responseCode=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"errorMesg",{get:function(){return this._errorMesg},set:function(e){this._errorMesg=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"body",{get:function(){return this._body},set:function(e){this._body=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"headers",{get:function(){return this._headers},set:function(e){this._headers=e},enumerable:!1,configurable:!0}),e.prototype.toJSON=function(){return JSON.stringify({responseCode:this._responseCode,errorMesg:this._errorMesg,body:this._body,headers:this._headers})},e}()},function(e,t){},function(e,t,r){"use strict";var n,i=r(70).constants;e.exports={SECURITY_CONTEXT_URL:i.SECURITY_CONTEXT_V2_URL,SECURITY_CONTEXT_V1_URL:i.SECURITY_CONTEXT_V1_URL,SECURITY_CONTEXT_V2_URL:i.SECURITY_CONTEXT_V2_URL,SECURITY_PROOF_URL:"https://w3id.org/security#proof",SECURITY_SIGNATURE_URL:"https://w3id.org/security#signature"}},function(t,r){t.exports=e},function(e,t,r){var n=r(4),i;r(37),r(8),(e.exports=n.hmac=n.hmac||{}).create=function(){var e=null,t=null,r=null,i=null,o={start:function(o,a){if(null!==o)if("string"==typeof o){if(!((o=o.toLowerCase())in n.md.algorithms))throw new Error('Unknown hash algorithm "'+o+'"');t=n.md.algorithms[o].create()}else t=o;if(null===a)a=e;else{if("string"==typeof a)a=n.util.createBuffer(a);else if(n.util.isArray(a)){var s=a;a=n.util.createBuffer();for(var u=0;u<s.length;++u)a.putByte(s[u])}var c=a.length();c>t.blockLength&&(t.start(),t.update(a.bytes()),a=t.digest()),r=n.util.createBuffer(),i=n.util.createBuffer(),c=a.length();for(var u=0;u<c;++u){var s=a.at(u);r.putByte(54^s),i.putByte(92^s)}if(c<t.blockLength)for(var s=t.blockLength-c,u=0;u<s;++u)r.putByte(54),i.putByte(92);e=a,r=r.bytes(),i=i.bytes()}t.start(),t.update(r)},update:function(e){t.update(e)},getMac:function(){var e=t.digest().bytes();return t.start(),t.update(i),t.update(e),t.digest()}};return o.digest=o.getMac,o}},function(e,t,r){var n=r(4);r(37),r(8);var i=e.exports=n.sha1=n.sha1||{};n.md.sha1=n.md.algorithms.sha1=i,i.create=function(){a||s();var e=null,t=n.util.createBuffer(),r=new Array(80),i={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){i.messageLength=0,i.fullMessageLength=i.messageLength64=[];for(var r=i.messageLengthSize/4,o=0;o<r;++o)i.fullMessageLength.push(0);return t=n.util.createBuffer(),e={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878,h4:3285377520},i}};return i.start(),i.update=function(o,a){"utf8"===a&&(o=n.util.encodeUtf8(o));var s=o.length;i.messageLength+=s,s=[s/4294967296>>>0,s>>>0];for(var c=i.fullMessageLength.length-1;c>=0;--c)i.fullMessageLength[c]+=s[1],s[1]=s[0]+(i.fullMessageLength[c]/4294967296>>>0),i.fullMessageLength[c]=i.fullMessageLength[c]>>>0,s[0]=s[1]/4294967296>>>0;return t.putBytes(o),u(e,r,t),(t.read>2048||0===t.length())&&t.compact(),i},i.digest=function(){var a=n.util.createBuffer();a.putBytes(t.bytes());var s,c=i.fullMessageLength[i.fullMessageLength.length-1]+i.messageLengthSize&i.blockLength-1,f,l;a.putBytes(o.substr(0,i.blockLength-c));for(var p=8*i.fullMessageLength[0],h=0;h<i.fullMessageLength.length-1;++h)p+=l=(f=8*i.fullMessageLength[h+1])/4294967296>>>0,a.putInt32(p>>>0),p=f>>>0;a.putInt32(p);var d={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4};u(d,r,a);var y=n.util.createBuffer();return y.putInt32(d.h0),y.putInt32(d.h1),y.putInt32(d.h2),y.putInt32(d.h3),y.putInt32(d.h4),y},i};var o=null,a=!1;function s(){o=String.fromCharCode(128),o+=n.util.fillString(String.fromCharCode(0),64),a=!0}function u(e,t,r){for(var n,i,o,a,s,u,c,f,l=r.length();l>=64;){for(i=e.h0,o=e.h1,a=e.h2,s=e.h3,u=e.h4,f=0;f<16;++f)n=r.getInt32(),t[f]=n,n=(i<<5|i>>>27)+(c=s^o&(a^s))+u+1518500249+n,u=s,s=a,a=(o<<30|o>>>2)>>>0,o=i,i=n;for(;f<20;++f)n=(n=t[f-3]^t[f-8]^t[f-14]^t[f-16])<<1|n>>>31,t[f]=n,n=(i<<5|i>>>27)+(c=s^o&(a^s))+u+1518500249+n,u=s,s=a,a=(o<<30|o>>>2)>>>0,o=i,i=n;for(;f<32;++f)n=(n=t[f-3]^t[f-8]^t[f-14]^t[f-16])<<1|n>>>31,t[f]=n,n=(i<<5|i>>>27)+(c=o^a^s)+u+1859775393+n,u=s,s=a,a=(o<<30|o>>>2)>>>0,o=i,i=n;for(;f<40;++f)n=(n=t[f-6]^t[f-16]^t[f-28]^t[f-32])<<2|n>>>30,t[f]=n,n=(i<<5|i>>>27)+(c=o^a^s)+u+1859775393+n,u=s,s=a,a=(o<<30|o>>>2)>>>0,o=i,i=n;for(;f<60;++f)n=(n=t[f-6]^t[f-16]^t[f-28]^t[f-32])<<2|n>>>30,t[f]=n,n=(i<<5|i>>>27)+(c=o&a|s&(o^a))+u+2400959708+n,u=s,s=a,a=(o<<30|o>>>2)>>>0,o=i,i=n;for(;f<80;++f)n=(n=t[f-6]^t[f-16]^t[f-28]^t[f-32])<<2|n>>>30,t[f]=n,n=(i<<5|i>>>27)+(c=o^a^s)+u+3395469782+n,u=s,s=a,a=(o<<30|o>>>2)>>>0,o=i,i=n;e.h0=e.h0+i|0,e.h1=e.h1+o|0,e.h2=e.h2+a|0,e.h3=e.h3+s|0,e.h4=e.h4+u|0,l-=64}}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function i(e,t){return e(t={exports:{}},t.exports),t.exports}r.r(t),r.d(t,"constants",function(){return u}),r.d(t,"contexts",function(){return s});var o=i(function(e,t){!function(e,t){for(var r in t)e[r]=t[r]}(t,function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0)}([function(e,t,r){const n=t.contexts=new Map,i=t.constants=r(1);n.set(i.SECURITY_CONTEXT_V1_URL,r(2)),n.set(i.SECURITY_CONTEXT_V2_URL,r(3))},function(e,t,r){t.SECURITY_CONTEXT_V1_URL="https://w3id.org/security/v1",t.SECURITY_CONTEXT_V2_URL="https://w3id.org/security/v2"},function(e,t){e.exports={"@context":{id:"@id",type:"@type",dc:"http://purl.org/dc/terms/",sec:"https://w3id.org/security#",xsd:"http://www.w3.org/2001/XMLSchema#",EcdsaKoblitzSignature2016:"sec:EcdsaKoblitzSignature2016",Ed25519Signature2018:"sec:Ed25519Signature2018",EncryptedMessage:"sec:EncryptedMessage",GraphSignature2012:"sec:GraphSignature2012",LinkedDataSignature2015:"sec:LinkedDataSignature2015",LinkedDataSignature2016:"sec:LinkedDataSignature2016",CryptographicKey:"sec:Key",authenticationTag:"sec:authenticationTag",canonicalizationAlgorithm:"sec:canonicalizationAlgorithm",cipherAlgorithm:"sec:cipherAlgorithm",cipherData:"sec:cipherData",cipherKey:"sec:cipherKey",created:{"@id":"dc:created","@type":"xsd:dateTime"},creator:{"@id":"dc:creator","@type":"@id"},digestAlgorithm:"sec:digestAlgorithm",digestValue:"sec:digestValue",domain:"sec:domain",encryptionKey:"sec:encryptionKey",expiration:{"@id":"sec:expiration","@type":"xsd:dateTime"},expires:{"@id":"sec:expiration","@type":"xsd:dateTime"},initializationVector:"sec:initializationVector",iterationCount:"sec:iterationCount",nonce:"sec:nonce",normalizationAlgorithm:"sec:normalizationAlgorithm",owner:{"@id":"sec:owner","@type":"@id"},password:"sec:password",privateKey:{"@id":"sec:privateKey","@type":"@id"},privateKeyPem:"sec:privateKeyPem",publicKey:{"@id":"sec:publicKey","@type":"@id"},publicKeyBase58:"sec:publicKeyBase58",publicKeyPem:"sec:publicKeyPem",publicKeyWif:"sec:publicKeyWif",publicKeyService:{"@id":"sec:publicKeyService","@type":"@id"},revoked:{"@id":"sec:revoked","@type":"xsd:dateTime"},salt:"sec:salt",signature:"sec:signature",signatureAlgorithm:"sec:signingAlgorithm",signatureValue:"sec:signatureValue"}}},function(e,t){e.exports={"@context":[{"@version":1.1},"https://w3id.org/security/v1",{AesKeyWrappingKey2019:"sec:AesKeyWrappingKey2019",DeleteKeyOperation:"sec:DeleteKeyOperation",DeriveSecretOperation:"sec:DeriveSecretOperation",EcdsaSecp256k1Signature2019:"sec:EcdsaSecp256k1Signature2019",EcdsaSecp256r1Signature2019:"sec:EcdsaSecp256r1Signature2019",EcdsaSecp256k1VerificationKey2019:"sec:EcdsaSecp256k1VerificationKey2019",EcdsaSecp256r1VerificationKey2019:"sec:EcdsaSecp256r1VerificationKey2019",Ed25519Signature2018:"sec:Ed25519Signature2018",Ed25519VerificationKey2018:"sec:Ed25519VerificationKey2018",EquihashProof2018:"sec:EquihashProof2018",ExportKeyOperation:"sec:ExportKeyOperation",GenerateKeyOperation:"sec:GenerateKeyOperation",KmsOperation:"sec:KmsOperation",RevokeKeyOperation:"sec:RevokeKeyOperation",RsaSignature2018:"sec:RsaSignature2018",RsaVerificationKey2018:"sec:RsaVerificationKey2018",Sha256HmacKey2019:"sec:Sha256HmacKey2019",SignOperation:"sec:SignOperation",UnwrapKeyOperation:"sec:UnwrapKeyOperation",VerifyOperation:"sec:VerifyOperation",WrapKeyOperation:"sec:WrapKeyOperation",X25519KeyAgreementKey2019:"sec:X25519KeyAgreementKey2019",allowedAction:"sec:allowedAction",assertionMethod:{"@id":"sec:assertionMethod","@type":"@id","@container":"@set"},authentication:{"@id":"sec:authenticationMethod","@type":"@id","@container":"@set"},capability:{"@id":"sec:capability","@type":"@id"},capabilityAction:"sec:capabilityAction",capabilityChain:{"@id":"sec:capabilityChain","@type":"@id","@container":"@list"},capabilityDelegation:{"@id":"sec:capabilityDelegationMethod","@type":"@id","@container":"@set"},capabilityInvocation:{"@id":"sec:capabilityInvocationMethod","@type":"@id","@container":"@set"},caveat:{"@id":"sec:caveat","@type":"@id","@container":"@set"},challenge:"sec:challenge",ciphertext:"sec:ciphertext",controller:{"@id":"sec:controller","@type":"@id"},delegator:{"@id":"sec:delegator","@type":"@id"},equihashParameterK:{"@id":"sec:equihashParameterK","@type":"xsd:integer"},equihashParameterN:{"@id":"sec:equihashParameterN","@type":"xsd:integer"},invocationTarget:{"@id":"sec:invocationTarget","@type":"@id"},invoker:{"@id":"sec:invoker","@type":"@id"},jws:"sec:jws",keyAgreement:{"@id":"sec:keyAgreementMethod","@type":"@id","@container":"@set"},kmsModule:{"@id":"sec:kmsModule"},parentCapability:{"@id":"sec:parentCapability","@type":"@id"},plaintext:"sec:plaintext",proof:{"@id":"sec:proof","@type":"@id","@container":"@graph"},proofPurpose:{"@id":"sec:proofPurpose","@type":"@vocab"},proofValue:"sec:proofValue",referenceId:"sec:referenceId",unwrappedKey:"sec:unwrappedKey",verificationMethod:{"@id":"sec:verificationMethod","@type":"@id"},verifyData:"sec:verifyData",wrappedKey:"sec:wrappedKey"}]}}]))}),a=n(o),s=o.contexts,u=o.constants;t.default=a},,function(e,t,r){"use strict";function n(){var e,t,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",a=r.toStringTag||"@@toStringTag";function s(r,n,o,a){var s=n&&n.prototype instanceof c?n:c,f=Object.create(s.prototype);return i(f,"_invoke",function(r,n,i){var o,a,s,c=0,f=i||[],l=!1,p={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function t(r,n){return o=r,a=0,s=e,p.n=n,u}};function h(r,n){for(a=r,s=n,t=0;!l&&c&&!i&&t<f.length;t++){var i,o=f[t],h=p.p,d=o[2];r>3?(i=d===n)&&(s=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=e):o[0]<=h&&((i=r<2&&h<o[1])?(a=0,p.v=n,p.n=o[1]):h<d&&(i=r<3||o[0]>n||n>d)&&(o[4]=r,o[5]=n,p.n=d,a=0))}if(i||r>1)return u;throw l=!0,n}return function(i,f,d){if(c>1)throw TypeError("Generator is already running");for(l&&1===f&&h(f,d),a=f,s=d;(t=a<2?e:s)||!l;){o||(a?a<3?(a>1&&(p.n=-1),h(a,s)):p.n=s:p.v=s);try{if(c=2,o){if(a||(i="next"),t=o[i]){if(!(t=t.call(o,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,a<2&&(a=0)}else 1===a&&(t=o.return)&&t.call(o),a<2&&(s=TypeError("The iterator does not provide a '"+i+"' method"),a=1);o=e}else if((t=(l=p.n<0)?s:r.call(n,p))!==u)break}catch(t){o=e,a=1,s=t}finally{c=1}}return{value:t,done:l}}}(r,o,a),!0),f}var u={};function c(){}function f(){}function l(){}t=Object.getPrototypeOf;var p=[][o]?t(t([][o]())):(i(t={},o,function(){return this}),t),h=l.prototype=c.prototype=Object.create(p);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,i(e,a,"GeneratorFunction")),e.prototype=Object.create(h),e}return f.prototype=l,i(h,"constructor",l),i(l,"constructor",f),f.displayName="GeneratorFunction",i(l,a,"GeneratorFunction"),i(h),i(h,a,"Generator"),i(h,o,function(){return this}),i(h,"toString",function(){return"[object Generator]"}),(n=function e(){return{w:s,m:d}})()}function i(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}i=function e(t,r,n,a){function s(e,r){i(t,e,function(t){return this._invoke(e,r,t)})}r?o?o(t,r,{value:n,enumerable:!a,configurable:!a,writable:!a}):t[r]=n:(s("next",0),s("throw",1),s("return",2))},i(e,t,r,n)}function o(e,t,r){return(t=p(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function s(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var o=e.apply(t,r);function s(e){a(o,n,i,s,u,"next",e)}function u(e){a(o,n,i,s,u,"throw",e)}s(void 0)})}}function u(e){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u(e)}function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,p(n.key),n)}}function l(e,t,r){return t&&f(e.prototype,t),r&&f(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function p(e){var t=h(e,"string");return"symbol"==u(t)?t:t+""}function h(e,t){if("object"!=u(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=u(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function d(e,t,r){return t=T(t),y(e,v()?Reflect.construct(t,r||[],T(e).constructor):t.apply(e,r))}function y(e,t){if(t&&("object"==u(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return g(e)}function g(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function v(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(v=function t(){return!!e})()}function m(e,t,r,n){var i=b(T(1&n?e.prototype:e),t,r);return 2&n&&"function"==typeof i?function(e){return i.apply(r,e)}:i}function b(){return b="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=E(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}},b.apply(null,arguments)}function E(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=T(e)););return e}function T(e){return T=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},T(e)}function S(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&w(e,t)}function w(e,t){return w=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},w(e,t)}var C=r(66),_=r(67),I=r(131);e.exports=function(e){function t(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=r.term,i=r.controller,o=r.date,a=r.maxTimestampDelta,s=void 0===a?1/0:a;if(c(this,t),e=d(this,t,[{term:n,date:o,maxTimestampDelta:s}]),void 0!==i){if("object"!==u(i))throw new TypeError('"controller" must be an object.');e.controller=i}return e}return S(t,e),l(t,[{key:"validate",value:function(){var e=s(n().m(function e(r,i){var a,s,c,f,l,p,h,d,y,g,v;return n().w(function(e){for(;;)switch(e.p=e.n){case 0:return a=i.verificationMethod,s=i.documentLoader,c=i.expansionMap,e.p=1,e.n=2,m(t,"validate",this,3)([r,{verificationMethod:a,documentLoader:s,expansionMap:c}]);case 2:if((f=e.v).valid){e.n=3;break}throw f.error;case 3:if(l=a.id,!this.controller){e.n=4;break}f.controller=this.controller,e.n=13;break;case 4:if(p=a.controller,h=a.owner,!p){e.n=8;break}if("object"!==u(p)){e.n=5;break}d=p.id,e.n=7;break;case 5:if("string"==typeof p){e.n=6;break}throw new TypeError('"controller" must be a string representing a URL.');case 6:d=p;case 7:e.n=11;break;case 8:if(!h){e.n=11;break}if("object"!==u(h)){e.n=9;break}d=h.id,e.n=11;break;case 9:if("string"==typeof h){e.n=10;break}throw new TypeError('"owner" must be a string representing a URL.');case 10:d=h;case 11:return e.n=12,_.frame(d,o({"@context":C.SECURITY_CONTEXT_URL,id:d},this.term,{"@embed":"@never",id:l}),{documentLoader:s,compactToRelative:!1});case 12:y=e.v,f.controller=y;case 13:if(g=_.getValues(f.controller,this.term),f.valid=g.some(function(e){return e===l||"object"===u(e)&&e.id===l}),f.valid){e.n=14;break}throw new Error('Verification method "'.concat(a.id,'" not authorized ')+'by controller for proof purpose "'.concat(this.term,'".'));case 14:return e.a(2,f);case 15:return e.p=15,v=e.v,e.a(2,{valid:!1,error:v})}},e,this,[[1,15]])}));function r(t,r){return e.apply(this,arguments)}return r}()}])}(I)},function(e,r){e.exports=t},function(e,t){},function(e,t,r){var n=r(4);function i(e,t){var r=function(){return new n.des.Algorithm(e,t)};n.cipher.registerAlgorithm(e,r)}r(118),r(135),r(8),e.exports=n.des=n.des||{},n.des.startEncrypting=function(e,t,r,n){var i=y({key:e,output:r,decrypt:!1,mode:n||(null===t?"ECB":"CBC")});return i.start(t),i},n.des.createEncryptionCipher=function(e,t){return y({key:e,output:null,decrypt:!1,mode:t})},n.des.startDecrypting=function(e,t,r,n){var i=y({key:e,output:r,decrypt:!0,mode:n||(null===t?"ECB":"CBC")});return i.start(t),i},n.des.createDecryptionCipher=function(e,t){return y({key:e,output:null,decrypt:!0,mode:t})},n.des.Algorithm=function(e,t){var r=this;r.name=e,r.mode=new t({blockSize:8,cipher:{encrypt:function(e,t){return d(r._keys,e,t,!1)},decrypt:function(e,t){return d(r._keys,e,t,!0)}}}),r._init=!1},n.des.Algorithm.prototype.initialize=function(e){if(!this._init){var t=n.util.createBuffer(e.key);if(0===this.name.indexOf("3DES")&&24!==t.length())throw new Error("Invalid Triple-DES key size: "+8*t.length());this._keys=h(t),this._init=!0}},i("DES-ECB",n.cipher.modes.ecb),i("DES-CBC",n.cipher.modes.cbc),i("DES-CFB",n.cipher.modes.cfb),i("DES-OFB",n.cipher.modes.ofb),i("DES-CTR",n.cipher.modes.ctr),i("3DES-ECB",n.cipher.modes.ecb),i("3DES-CBC",n.cipher.modes.cbc),i("3DES-CFB",n.cipher.modes.cfb),i("3DES-OFB",n.cipher.modes.ofb),i("3DES-CTR",n.cipher.modes.ctr);var o=[16843776,0,65536,16843780,16842756,66564,4,65536,1024,16843776,16843780,1024,16778244,16842756,16777216,4,1028,16778240,16778240,66560,66560,16842752,16842752,16778244,65540,16777220,16777220,65540,0,1028,66564,16777216,65536,16843780,4,16842752,16843776,16777216,16777216,1024,16842756,65536,66560,16777220,1024,4,16778244,66564,16843780,65540,16842752,16778244,16777220,1028,66564,16843776,1028,16778240,16778240,0,65540,66560,0,16842756],a=[-2146402272,-2147450880,32768,1081376,1048576,32,-2146435040,-2147450848,-2147483616,-2146402272,-2146402304,-2147483648,-2147450880,1048576,32,-2146435040,1081344,1048608,-2147450848,0,-2147483648,32768,1081376,-2146435072,1048608,-2147483616,0,1081344,32800,-2146402304,-2146435072,32800,0,1081376,-2146435040,1048576,-2147450848,-2146435072,-2146402304,32768,-2146435072,-2147450880,32,-2146402272,1081376,32,32768,-2147483648,32800,-2146402304,1048576,-2147483616,1048608,-2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],s=[520,134349312,0,134348808,134218240,0,131592,134218240,131080,134217736,134217736,131072,134349320,131080,134348800,520,134217728,8,134349312,512,131584,134348800,134348808,131592,134218248,131584,131072,134218248,8,134349320,512,134217728,134349312,134217728,131080,520,131072,134349312,134218240,0,512,131080,134349320,134218240,134217736,512,0,134348808,134218248,131072,134217728,134349320,8,131592,131584,134217736,134348800,134218248,520,134348800,131592,8,134348808,131584],u=[8396801,8321,8321,128,8396928,8388737,8388609,8193,0,8396800,8396800,8396929,129,0,8388736,8388609,1,8192,8388608,8396801,128,8388608,8193,8320,8388737,1,8320,8388736,8192,8396928,8396929,129,8388736,8388609,8396800,8396929,129,0,0,8396800,8320,8388736,8388737,1,8396801,8321,8321,128,8396929,129,1,8192,8388609,8193,8396928,8388737,8193,8320,8388608,8396801,128,8388608,8192,8396928],c=[256,34078976,34078720,1107296512,524288,256,1073741824,34078720,1074266368,524288,33554688,1074266368,1107296512,1107820544,524544,1073741824,33554432,1074266112,1074266112,0,1073742080,1107820800,1107820800,33554688,1107820544,1073742080,0,1107296256,34078976,33554432,1107296256,524544,524288,1107296512,256,33554432,1073741824,34078720,1107296512,1074266368,33554688,1073741824,1107820544,34078976,1074266368,256,33554432,1107820544,1107820800,524544,1107296256,1107820800,34078720,0,1074266112,1107296256,524544,33554688,1073742080,524288,0,1074266112,34078976,1073742080],f=[536870928,541065216,16384,541081616,541065216,16,541081616,4194304,536887296,4210704,4194304,536870928,4194320,536887296,536870912,16400,0,4194320,536887312,16384,4210688,536887312,16,541065232,541065232,0,4210704,541081600,16400,4210688,541081600,536870912,536887296,16,541065232,4210688,541081616,4194304,16400,536870928,4194304,536887296,536870912,16400,536870928,541081616,4210688,541065216,4210704,541081600,0,541065232,16,16384,541065216,4210704,16384,4194320,536887312,0,541081600,536870912,4194320,536887312],l=[2097152,69206018,67110914,0,2048,67110914,2099202,69208064,69208066,2097152,0,67108866,2,67108864,69206018,2050,67110912,2099202,2097154,67110912,67108866,69206016,69208064,2097154,69206016,2048,2050,69208066,2099200,2,67108864,2099200,67108864,2099200,2097152,67110914,67110914,69206018,69206018,2,2097154,67108864,67110912,2097152,69208064,2050,2099202,69208064,2050,67108866,69208066,69206016,2099200,0,2,69208066,0,2099202,69206016,2048,67108866,67110912,2048,2097154],p=[268439616,4096,262144,268701760,268435456,268439616,64,268435456,262208,268697600,268701760,266240,268701696,266304,4096,64,268697600,268435520,268439552,4160,266240,262208,268697664,268701696,4160,0,0,268697664,268435520,268439552,266304,262144,266304,262144,268701696,4096,64,268697664,4096,266304,268439552,64,268435520,268697600,268697664,268435456,262144,268439616,0,268701760,262208,268435520,268697600,268439552,268439616,0,268701760,266240,266240,4160,4160,262208,268435456,268701696];function h(e){for(var t=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],r=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],n=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],i=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],o=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],a=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],s=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],u=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],c=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],f=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],l=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],p=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],h=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],d=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],y=e.length()>8?3:1,g=[],v=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],m=0,b,E=0;E<y;E++){var T=e.getInt32(),S=e.getInt32();T^=(b=252645135&(T>>>4^S))<<4,T^=b=65535&((S^=b)>>>-16^T),T^=(b=858993459&(T>>>2^(S^=b<<-16)))<<2,T^=b=65535&((S^=b)>>>-16^T),T^=(b=1431655765&(T>>>1^(S^=b<<-16)))<<1,T^=b=16711935&((S^=b)>>>8^T),b=(T^=(b=1431655765&(T>>>1^(S^=b<<8)))<<1)<<8|(S^=b)>>>20&240,T=S<<24|S<<8&16711680|S>>>8&65280|S>>>24&240,S=b;for(var w=0;w<v.length;++w){v[w]?(T=T<<2|T>>>26,S=S<<2|S>>>26):(T=T<<1|T>>>27,S=S<<1|S>>>27);var C=t[(T&=-15)>>>28]|r[T>>>24&15]|n[T>>>20&15]|i[T>>>16&15]|o[T>>>12&15]|a[T>>>8&15]|s[T>>>4&15],_=u[(S&=-15)>>>28]|c[S>>>24&15]|f[S>>>20&15]|l[S>>>16&15]|p[S>>>12&15]|h[S>>>8&15]|d[S>>>4&15];b=65535&(_>>>16^C),g[m++]=C^b,g[m++]=_^b<<16}}return g}function d(e,t,r,n){var i=32===e.length?3:9,h,d;h=3===i?n?[30,-2,-2]:[0,32,2]:n?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2];var y=t[0],g=t[1];y^=(d=252645135&(y>>>4^g))<<4,y^=(d=65535&(y>>>16^(g^=d)))<<16,y^=d=858993459&((g^=d)>>>2^y),y^=d=16711935&((g^=d<<2)>>>8^y),y=(y^=(d=1431655765&(y>>>1^(g^=d<<8)))<<1)<<1|y>>>31,g=(g^=d)<<1|g>>>31;for(var v=0;v<i;v+=3){for(var m=h[v+1],b=h[v+2],E=h[v];E!=m;E+=b){var T=g^e[E],S=(g>>>4|g<<28)^e[E+1];d=y,y=g,g=d^(a[T>>>24&63]|u[T>>>16&63]|f[T>>>8&63]|p[63&T]|o[S>>>24&63]|s[S>>>16&63]|c[S>>>8&63]|l[63&S])}d=y,y=g,g=d}g=g>>>1|g<<31,g^=d=1431655765&((y=y>>>1|y<<31)>>>1^g),g^=(d=16711935&(g>>>8^(y^=d<<1)))<<8,g^=(d=858993459&(g>>>2^(y^=d)))<<2,g^=d=65535&((y^=d)>>>16^g),g^=d=252645135&((y^=d<<16)>>>4^g),y^=d<<4,r[0]=y,r[1]=g}function y(e){var t,r="DES-"+((e=e||{}).mode||"CBC").toUpperCase(),i,o=(i=e.decrypt?n.cipher.createDecipher(r,e.key):n.cipher.createCipher(r,e.key)).start;return i.start=function(e,t){var r=null;t instanceof n.util.ByteBuffer&&(r=t,t={}),(t=t||{}).output=r,t.iv=e,o.call(i,t)},i}},function(e,t,r){var n=r(4);if(r(33),r(77),r(49),r(142),r(143),r(31),r(8),void 0===i)var i=n.jsbn.BigInteger;var o=n.util.isNodejs?r(121):null,a=n.asn1,s=n.util;n.pki=n.pki||{},e.exports=n.pki.rsa=n.rsa=n.rsa||{};var u=n.pki,c=[6,4,2,4,2,4,6,2],f={name:"PrivateKeyInfo",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:a.Class.UNIVERSAL,type:a.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:a.Class.UNIVERSAL,type:a.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},l={name:"RSAPrivateKey",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},p={name:"RSAPublicKey",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},h=n.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:a.Class.UNIVERSAL,type:a.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:a.Class.UNIVERSAL,type:a.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},d=function(e){var t;if(!(e.algorithm in u.oids)){var r=new Error("Unknown message digest algorithm.");throw r.algorithm=e.algorithm,r}t=u.oids[e.algorithm];var n=a.oidToDer(t).getBytes(),i=a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[]),o=a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[]);o.value.push(a.create(a.Class.UNIVERSAL,a.Type.OID,!1,n)),o.value.push(a.create(a.Class.UNIVERSAL,a.Type.NULL,!1,""));var s=a.create(a.Class.UNIVERSAL,a.Type.OCTETSTRING,!1,e.digest().getBytes());return i.value.push(o),i.value.push(s),a.toDer(i).getBytes()},y=function(e,t,r){if(r)return e.modPow(t.e,t.n);if(!t.p||!t.q)return e.modPow(t.d,t.n);var o;t.dP||(t.dP=t.d.mod(t.p.subtract(i.ONE))),t.dQ||(t.dQ=t.d.mod(t.q.subtract(i.ONE))),t.qInv||(t.qInv=t.q.modInverse(t.p));do{o=new i(n.util.bytesToHex(n.random.getBytes(t.n.bitLength()/8)),16)}while(o.compareTo(t.n)>=0||!o.gcd(t.n).equals(i.ONE));for(var a=(e=e.multiply(o.modPow(t.e,t.n)).mod(t.n)).mod(t.p).modPow(t.dP,t.p),s=e.mod(t.q).modPow(t.dQ,t.q);a.compareTo(s)<0;)a=a.add(t.p);var u=a.subtract(s).multiply(t.qInv).mod(t.p).multiply(t.q).add(s);return u=u.multiply(o.modInverse(t.n)).mod(t.n)};function g(e,t,r){var i=n.util.createBuffer(),o=Math.ceil(t.n.bitLength()/8);if(e.length>o-11){var a=new Error("Message is too long for PKCS#1 v1.5 padding.");throw a.length=e.length,a.max=o-11,a}i.putByte(0),i.putByte(r);var s=o-3-e.length,u;if(0===r||1===r){u=0===r?0:255;for(var c=0;c<s;++c)i.putByte(u)}else for(;s>0;){for(var f=0,l=n.random.getBytes(s),c=0;c<s;++c)0===(u=l.charCodeAt(c))?++f:i.putByte(u);s=f}return i.putByte(0),i.putBytes(e),i}function v(e,t,r,i){var o=Math.ceil(t.n.bitLength()/8),a=n.util.createBuffer(e),s=a.getByte(),u=a.getByte();if(0!==s||r&&0!==u&&1!==u||!r&&2!=u||r&&0===u&&void 0===i)throw new Error("Encryption block is invalid.");var c=0,f;if(0===u){c=o-3-i;for(var l=0;l<c;++l)if(0!==a.getByte())throw new Error("Encryption block is invalid.")}else if(1===u)for(c=0;a.length()>1;){if(255!==a.getByte()){--a.read;break}++c}else if(2===u)for(c=0;a.length()>1;){if(0===a.getByte()){--a.read;break}++c}if(0!==a.getByte()||c!==o-3-a.length())throw new Error("Encryption block is invalid.");return a.getBytes()}function m(e,t,r){"function"==typeof t&&(r=t,t={});var o={algorithm:{name:(t=t||{}).algorithm||"PRIMEINC",options:{workers:t.workers||2,workLoad:t.workLoad||100,workerScript:t.workerScript}}};function a(){s(e.pBits,function(t,n){return t?r(t):(e.p=n,null!==e.q?c(t,e.q):void s(e.qBits,c))})}function s(e,t){n.prime.generateProbablePrime(e,o,t)}function c(t,n){if(t)return r(t);if(e.q=n,e.p.compareTo(e.q)<0){var o=e.p;e.p=e.q,e.q=o}if(0!==e.p.subtract(i.ONE).gcd(e.e).compareTo(i.ONE))return e.p=null,void a();if(0!==e.q.subtract(i.ONE).gcd(e.e).compareTo(i.ONE))return e.q=null,void s(e.qBits,c);if(e.p1=e.p.subtract(i.ONE),e.q1=e.q.subtract(i.ONE),e.phi=e.p1.multiply(e.q1),0!==e.phi.gcd(e.e).compareTo(i.ONE))return e.p=e.q=null,void a();if(e.n=e.p.multiply(e.q),e.n.bitLength()!==e.bits)return e.q=null,void s(e.qBits,c);var f=e.e.modInverse(e.phi);e.keys={privateKey:u.rsa.setPrivateKey(e.n,e.e,f,e.p,e.q,f.mod(e.p1),f.mod(e.q1),e.q.modInverse(e.p)),publicKey:u.rsa.setPublicKey(e.n,e.e)},r(null,e.keys)}"prng"in t&&(o.prng=t.prng),a()}function b(e){var t=e.toString(16);t[0]>="8"&&(t="00"+t);var r=n.util.hexToBytes(t);return!(r.length>1)||(0!==r.charCodeAt(0)||128&r.charCodeAt(1))&&(255!==r.charCodeAt(0)||128&~r.charCodeAt(1))?r:r.substr(1)}function E(e){return e<=100?27:e<=150?18:e<=200?15:e<=250?12:e<=300?9:e<=350?8:e<=400?7:e<=500?6:e<=600?5:e<=800?4:e<=1250?3:2}function T(e){return n.util.isNodejs&&"function"==typeof o[e]}function S(e){return void 0!==s.globalScope&&"object"==typeof s.globalScope.crypto&&"object"==typeof s.globalScope.crypto.subtle&&"function"==typeof s.globalScope.crypto.subtle[e]}function w(e){return void 0!==s.globalScope&&"object"==typeof s.globalScope.msCrypto&&"object"==typeof s.globalScope.msCrypto.subtle&&"function"==typeof s.globalScope.msCrypto.subtle[e]}function C(e){for(var t=n.util.hexToBytes(e.toString(16)),r=new Uint8Array(t.length),i=0;i<t.length;++i)r[i]=t.charCodeAt(i);return r}function _(e){if("RSA"!==e.kty)throw new Error('Unsupported key algorithm "'+e.kty+'"; algorithm must be "RSA".');return u.setRsaPrivateKey(A(e.n),A(e.e),A(e.d),A(e.p),A(e.q),A(e.dp),A(e.dq),A(e.qi))}function I(e){if("RSA"!==e.kty)throw new Error('Key algorithm must be "RSA".');return u.setRsaPublicKey(A(e.n),A(e.e))}function A(e){return new i(n.util.bytesToHex(n.util.decode64(e)),16)}u.rsa.encrypt=function(e,t,r){var o=r,a,s=Math.ceil(t.n.bitLength()/8);!1!==r&&!0!==r?(o=2===r,a=g(e,t,r)):(a=n.util.createBuffer()).putBytes(e);for(var u=new i(a.toHex(),16),c,f=y(u,t,o).toString(16),l=n.util.createBuffer(),p=s-Math.ceil(f.length/2);p>0;)l.putByte(0),--p;return l.putBytes(n.util.hexToBytes(f)),l.getBytes()},u.rsa.decrypt=function(e,t,r,o){var a=Math.ceil(t.n.bitLength()/8);if(e.length!==a){var s=new Error("Encrypted message length is invalid.");throw s.length=e.length,s.expected=a,s}var u=new i(n.util.createBuffer(e).toHex(),16);if(u.compareTo(t.n)>=0)throw new Error("Encrypted message is invalid.");for(var c,f=y(u,t,r).toString(16),l=n.util.createBuffer(),p=a-Math.ceil(f.length/2);p>0;)l.putByte(0),--p;return l.putBytes(n.util.hexToBytes(f)),!1!==o?v(l.getBytes(),t,r):l.getBytes()},u.rsa.createKeyPairGenerationState=function(e,t,r){"string"==typeof e&&(e=parseInt(e,10)),e=e||2048;var o=(r=r||{}).prng||n.random,a={nextBytes:function(e){for(var t=o.getBytesSync(e.length),r=0;r<e.length;++r)e[r]=t.charCodeAt(r)}},s=r.algorithm||"PRIMEINC",u;if("PRIMEINC"!==s)throw new Error("Invalid key generation algorithm: "+s);return(u={algorithm:s,state:0,bits:e,rng:a,eInt:t||65537,e:new i(null),p:null,q:null,qBits:e>>1,pBits:e-(e>>1),pqState:0,num:null,keys:null}).e.fromInt(u.eInt),u},u.rsa.stepKeyPairGenerationState=function(e,t){"algorithm"in e||(e.algorithm="PRIMEINC");var r=new i(null);r.fromInt(30);for(var n=0,o=function(e,t){return e|t},a=+new Date,s,f=0;null===e.keys&&(t<=0||f<t);){if(0===e.state){var l=null===e.p?e.pBits:e.qBits,p=l-1;0===e.pqState?(e.num=new i(l,e.rng),e.num.testBit(p)||e.num.bitwiseTo(i.ONE.shiftLeft(p),o,e.num),e.num.dAddOffset(31-e.num.mod(r).byteValue(),0),n=0,++e.pqState):1===e.pqState?e.num.bitLength()>l?e.pqState=0:e.num.isProbablePrime(E(e.num.bitLength()))?++e.pqState:e.num.dAddOffset(c[n++%8],0):2===e.pqState?e.pqState=0===e.num.subtract(i.ONE).gcd(e.e).compareTo(i.ONE)?3:0:3===e.pqState&&(e.pqState=0,null===e.p?e.p=e.num:e.q=e.num,null!==e.p&&null!==e.q&&++e.state,e.num=null)}else if(1===e.state)e.p.compareTo(e.q)<0&&(e.num=e.p,e.p=e.q,e.q=e.num),++e.state;else if(2===e.state)e.p1=e.p.subtract(i.ONE),e.q1=e.q.subtract(i.ONE),e.phi=e.p1.multiply(e.q1),++e.state;else if(3===e.state)0===e.phi.gcd(e.e).compareTo(i.ONE)?++e.state:(e.p=null,e.q=null,e.state=0);else if(4===e.state)e.n=e.p.multiply(e.q),e.n.bitLength()===e.bits?++e.state:(e.q=null,e.state=0);else if(5===e.state){var h=e.e.modInverse(e.phi);e.keys={privateKey:u.rsa.setPrivateKey(e.n,e.e,h,e.p,e.q,h.mod(e.p1),h.mod(e.q1),e.q.modInverse(e.p)),publicKey:u.rsa.setPublicKey(e.n,e.e)}}f+=(s=+new Date)-a,a=s}return null!==e.keys},u.rsa.generateKeyPair=function(e,t,r,i){if(1===arguments.length?"object"==typeof e?(r=e,e=void 0):"function"==typeof e&&(i=e,e=void 0):2===arguments.length?"number"==typeof e?"function"==typeof t?(i=t,t=void 0):"number"!=typeof t&&(r=t,t=void 0):(r=e,i=t,e=void 0,t=void 0):3===arguments.length&&("number"==typeof t?"function"==typeof r&&(i=r,r=void 0):(i=r,r=t,t=void 0)),r=r||{},void 0===e&&(e=r.bits||2048),void 0===t&&(t=r.e||65537),!n.options.usePureJavaScript&&!r.prng&&e>=256&&e<=16384&&(65537===t||3===t))if(i){if(T("generateKeyPair"))return o.generateKeyPair("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},function(e,t,r){if(e)return i(e);i(null,{privateKey:u.privateKeyFromPem(r),publicKey:u.publicKeyFromPem(t)})});if(S("generateKey")&&S("exportKey"))return s.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:C(t),hash:{name:"SHA-256"}},!0,["sign","verify"]).then(function(e){return s.globalScope.crypto.subtle.exportKey("pkcs8",e.privateKey)}).then(void 0,function(e){i(e)}).then(function(e){if(e){var t=u.privateKeyFromAsn1(a.fromDer(n.util.createBuffer(e)));i(null,{privateKey:t,publicKey:u.setRsaPublicKey(t.n,t.e)})}});if(w("generateKey")&&w("exportKey")){var c=s.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:C(t),hash:{name:"SHA-256"}},!0,["sign","verify"]);return c.oncomplete=function(e){var t=e.target.result,r=s.globalScope.msCrypto.subtle.exportKey("pkcs8",t.privateKey);r.oncomplete=function(e){var t=e.target.result,r=u.privateKeyFromAsn1(a.fromDer(n.util.createBuffer(t)));i(null,{privateKey:r,publicKey:u.setRsaPublicKey(r.n,r.e)})},r.onerror=function(e){i(e)}},void(c.onerror=function(e){i(e)})}}else if(T("generateKeyPairSync")){var f=o.generateKeyPairSync("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:u.privateKeyFromPem(f.privateKey),publicKey:u.publicKeyFromPem(f.publicKey)}}var l=u.rsa.createKeyPairGenerationState(e,t,r);if(!i)return u.rsa.stepKeyPairGenerationState(l,0),l.keys;m(l,r,i)},u.setRsaPublicKey=u.rsa.setPublicKey=function(e,t){var r={n:e,e:t,encrypt:function(e,t,i){if("string"==typeof t?t=t.toUpperCase():void 0===t&&(t="RSAES-PKCS1-V1_5"),"RSAES-PKCS1-V1_5"===t)t={encode:function(e,t,r){return g(e,t,2).getBytes()}};else if("RSA-OAEP"===t||"RSAES-OAEP"===t)t={encode:function(e,t){return n.pkcs1.encode_rsa_oaep(t,e,i)}};else if(-1!==["RAW","NONE","NULL",null].indexOf(t))t={encode:function(e){return e}};else if("string"==typeof t)throw new Error('Unsupported encryption scheme: "'+t+'".');var o=t.encode(e,r,!0);return u.rsa.encrypt(o,r,!0)},verify:function(e,t,n){"string"==typeof n?n=n.toUpperCase():void 0===n&&(n="RSASSA-PKCS1-V1_5"),"RSASSA-PKCS1-V1_5"===n?n={verify:function(e,t){var n;return t=v(t,r,!0),e===a.fromDer(t).value[1].value}}:"NONE"!==n&&"NULL"!==n&&null!==n||(n={verify:function(e,t){return e===(t=v(t,r,!0))}});var i=u.rsa.decrypt(t,r,!0,!1);return n.verify(e,i,r.n.bitLength())}};return r},u.setRsaPrivateKey=u.rsa.setPrivateKey=function(e,t,r,i,o,a,s,c){var f={n:e,e:t,d:r,p:i,q:o,dP:a,dQ:s,qInv:c,decrypt:function(e,t,r){"string"==typeof t?t=t.toUpperCase():void 0===t&&(t="RSAES-PKCS1-V1_5");var i=u.rsa.decrypt(e,f,!1,!1);if("RSAES-PKCS1-V1_5"===t)t={decode:v};else if("RSA-OAEP"===t||"RSAES-OAEP"===t)t={decode:function(e,t){return n.pkcs1.decode_rsa_oaep(t,e,r)}};else{if(-1===["RAW","NONE","NULL",null].indexOf(t))throw new Error('Unsupported encryption scheme: "'+t+'".');t={decode:function(e){return e}}}return t.decode(i,f,!1)},sign:function(e,t){var r=!1;"string"==typeof t&&(t=t.toUpperCase()),void 0===t||"RSASSA-PKCS1-V1_5"===t?(t={encode:d},r=1):"NONE"!==t&&"NULL"!==t&&null!==t||(t={encode:function(){return e}},r=1);var n=t.encode(e,f.n.bitLength());return u.rsa.encrypt(n,f,r)}};return f},u.wrapRsaPrivateKey=function(e){return a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,a.integerToDer(0).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(u.oids.rsaEncryption).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.NULL,!1,"")]),a.create(a.Class.UNIVERSAL,a.Type.OCTETSTRING,!1,a.toDer(e).getBytes())])},u.privateKeyFromAsn1=function(e){var t={},r=[],o,s,c,p,h,d,y,g;if(a.validate(e,f,t,r)&&(e=a.fromDer(n.util.createBuffer(t.privateKey))),t={},r=[],!a.validate(e,l,t,r)){var v=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw v.errors=r,v}return o=n.util.createBuffer(t.privateKeyModulus).toHex(),s=n.util.createBuffer(t.privateKeyPublicExponent).toHex(),c=n.util.createBuffer(t.privateKeyPrivateExponent).toHex(),p=n.util.createBuffer(t.privateKeyPrime1).toHex(),h=n.util.createBuffer(t.privateKeyPrime2).toHex(),d=n.util.createBuffer(t.privateKeyExponent1).toHex(),y=n.util.createBuffer(t.privateKeyExponent2).toHex(),g=n.util.createBuffer(t.privateKeyCoefficient).toHex(),u.setRsaPrivateKey(new i(o,16),new i(s,16),new i(c,16),new i(p,16),new i(h,16),new i(d,16),new i(y,16),new i(g,16))},u.privateKeyToAsn1=u.privateKeyToRSAPrivateKey=function(e){return a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,a.integerToDer(0).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,b(e.n)),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,b(e.e)),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,b(e.d)),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,b(e.p)),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,b(e.q)),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,b(e.dP)),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,b(e.dQ)),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,b(e.qInv))])},u.publicKeyFromAsn1=function(e){var t={},r=[],o;if(a.validate(e,h,t,r)){var s=a.derToOid(t.publicKeyOid),o;if(s!==u.oids.rsaEncryption)throw(o=new Error("Cannot read public key. Unknown OID.")).oid=s,o;e=t.rsaPublicKey}if(r=[],!a.validate(e,p,t,r))throw(o=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.")).errors=r,o;var c=n.util.createBuffer(t.publicKeyModulus).toHex(),f=n.util.createBuffer(t.publicKeyExponent).toHex();return u.setRsaPublicKey(new i(c,16),new i(f,16))},u.publicKeyToAsn1=u.publicKeyToSubjectPublicKeyInfo=function(e){return a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(u.oids.rsaEncryption).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.NULL,!1,"")]),a.create(a.Class.UNIVERSAL,a.Type.BITSTRING,!1,[u.publicKeyToRSAPublicKey(e)])])},u.publicKeyToRSAPublicKey=function(e){return a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,b(e.n)),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,b(e.e))])}},function(e,t,r){var n=r(4),i;e.exports=n.jsbn=n.jsbn||{};var o=0xdeadbeefcafe,a=!0;function s(e,t,r){this.data=[],null!=e&&("number"==typeof e?this.fromNumber(e,t,r):null==t&&"string"!=typeof e?this.fromString(e,256):this.fromString(e,t))}function u(){return new s(null)}function c(e,t,r,n,i,o){for(;--o>=0;){var a=t*this.data[e++]+r.data[n]+i;i=Math.floor(a/67108864),r.data[n++]=67108863&a}return i}function f(e,t,r,n,i,o){for(var a=32767&t,s=t>>15;--o>=0;){var u=32767&this.data[e],c=this.data[e++]>>15,f=s*u+c*a;i=((u=a*u+((32767&f)<<15)+r.data[n]+(1073741823&i))>>>30)+(f>>>15)+s*c+(i>>>30),r.data[n++]=1073741823&u}return i}function l(e,t,r,n,i,o){for(var a=16383&t,s=t>>14;--o>=0;){var u=16383&this.data[e],c=this.data[e++]>>14,f=s*u+c*a;i=((u=a*u+((16383&f)<<14)+r.data[n]+i)>>28)+(f>>14)+s*c,r.data[n++]=268435455&u}return i}n.jsbn.BigInteger=s,"undefined"==typeof navigator?(s.prototype.am=l,i=28):"Microsoft Internet Explorer"==navigator.appName?(s.prototype.am=f,i=30):"Netscape"!=navigator.appName?(s.prototype.am=c,i=26):(s.prototype.am=l,i=28),s.prototype.DB=i,s.prototype.DM=(1<<i)-1,s.prototype.DV=1<<i;var p=52;s.prototype.FV=Math.pow(2,p),s.prototype.F1=p-i,s.prototype.F2=2*i-p;var h="0123456789abcdefghijklmnopqrstuvwxyz",d=new Array,y,g;for(y="0".charCodeAt(0),g=0;g<=9;++g)d[y++]=g;for(y="a".charCodeAt(0),g=10;g<36;++g)d[y++]=g;for(y="A".charCodeAt(0),g=10;g<36;++g)d[y++]=g;function v(e){return h.charAt(e)}function m(e,t){var r=d[e.charCodeAt(t)];return null==r?-1:r}function b(e){for(var t=this.t-1;t>=0;--t)e.data[t]=this.data[t];e.t=this.t,e.s=this.s}function E(e){this.t=1,this.s=e<0?-1:0,e>0?this.data[0]=e:e<-1?this.data[0]=e+this.DV:this.t=0}function T(e){var t=u();return t.fromInt(e),t}function S(e,t){var r;if(16==t)r=4;else if(8==t)r=3;else if(256==t)r=8;else if(2==t)r=1;else if(32==t)r=5;else{if(4!=t)return void this.fromRadix(e,t);r=2}this.t=0,this.s=0;for(var n=e.length,i=!1,o=0;--n>=0;){var a=8==r?255&e[n]:m(e,n);a<0?"-"==e.charAt(n)&&(i=!0):(i=!1,0==o?this.data[this.t++]=a:o+r>this.DB?(this.data[this.t-1]|=(a&(1<<this.DB-o)-1)<<o,this.data[this.t++]=a>>this.DB-o):this.data[this.t-1]|=a<<o,(o+=r)>=this.DB&&(o-=this.DB))}8==r&&128&e[0]&&(this.s=-1,o>0&&(this.data[this.t-1]|=(1<<this.DB-o)-1<<o)),this.clamp(),i&&s.ZERO.subTo(this,this)}function w(){for(var e=this.s&this.DM;this.t>0&&this.data[this.t-1]==e;)--this.t}function C(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(16==e)t=4;else if(8==e)t=3;else if(2==e)t=1;else if(32==e)t=5;else{if(4!=e)return this.toRadix(e);t=2}var r=(1<<t)-1,n,i=!1,o="",a=this.t,s=this.DB-a*this.DB%t;if(a-- >0)for(s<this.DB&&(n=this.data[a]>>s)>0&&(i=!0,o=v(n));a>=0;)s<t?(n=(this.data[a]&(1<<s)-1)<<t-s,n|=this.data[--a]>>(s+=this.DB-t)):(n=this.data[a]>>(s-=t)&r,s<=0&&(s+=this.DB,--a)),n>0&&(i=!0),i&&(o+=v(n));return i?o:"0"}function _(){var e=u();return s.ZERO.subTo(this,e),e}function I(){return this.s<0?this.negate():this}function A(e){var t=this.s-e.s;if(0!=t)return t;var r=this.t;if(0!=(t=r-e.t))return this.s<0?-t:t;for(;--r>=0;)if(0!=(t=this.data[r]-e.data[r]))return t;return 0}function R(e){var t=1,r;return 0!=(r=e>>>16)&&(e=r,t+=16),0!=(r=e>>8)&&(e=r,t+=8),0!=(r=e>>4)&&(e=r,t+=4),0!=(r=e>>2)&&(e=r,t+=2),0!=(r=e>>1)&&(e=r,t+=1),t}function O(){return this.t<=0?0:this.DB*(this.t-1)+R(this.data[this.t-1]^this.s&this.DM)}function P(e,t){var r;for(r=this.t-1;r>=0;--r)t.data[r+e]=this.data[r];for(r=e-1;r>=0;--r)t.data[r]=0;t.t=this.t+e,t.s=this.s}function B(e,t){for(var r=e;r<this.t;++r)t.data[r-e]=this.data[r];t.t=Math.max(this.t-e,0),t.s=this.s}function k(e,t){var r=e%this.DB,n=this.DB-r,i=(1<<n)-1,o=Math.floor(e/this.DB),a=this.s<<r&this.DM,s;for(s=this.t-1;s>=0;--s)t.data[s+o+1]=this.data[s]>>n|a,a=(this.data[s]&i)<<r;for(s=o-1;s>=0;--s)t.data[s]=0;t.data[o]=a,t.t=this.t+o+1,t.s=this.s,t.clamp()}function N(e,t){t.s=this.s;var r=Math.floor(e/this.DB);if(r>=this.t)t.t=0;else{var n=e%this.DB,i=this.DB-n,o=(1<<n)-1;t.data[0]=this.data[r]>>n;for(var a=r+1;a<this.t;++a)t.data[a-r-1]|=(this.data[a]&o)<<i,t.data[a-r]=this.data[a]>>n;n>0&&(t.data[this.t-r-1]|=(this.s&o)<<i),t.t=this.t-r,t.clamp()}}function U(e,t){for(var r=0,n=0,i=Math.min(e.t,this.t);r<i;)n+=this.data[r]-e.data[r],t.data[r++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n-=e.s;r<this.t;)n+=this.data[r],t.data[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<e.t;)n-=e.data[r],t.data[r++]=n&this.DM,n>>=this.DB;n-=e.s}t.s=n<0?-1:0,n<-1?t.data[r++]=this.DV+n:n>0&&(t.data[r++]=n),t.t=r,t.clamp()}function D(e,t){var r=this.abs(),n=e.abs(),i=r.t;for(t.t=i+n.t;--i>=0;)t.data[i]=0;for(i=0;i<n.t;++i)t.data[i+r.t]=r.am(0,n.data[i],t,i,0,r.t);t.s=0,t.clamp(),this.s!=e.s&&s.ZERO.subTo(t,t)}function x(e){for(var t=this.abs(),r=e.t=2*t.t;--r>=0;)e.data[r]=0;for(r=0;r<t.t-1;++r){var n=t.am(r,t.data[r],e,2*r,0,1);(e.data[r+t.t]+=t.am(r+1,2*t.data[r],e,2*r+1,n,t.t-r-1))>=t.DV&&(e.data[r+t.t]-=t.DV,e.data[r+t.t+1]=1)}e.t>0&&(e.data[e.t-1]+=t.am(r,t.data[r],e,2*r,0,1)),e.s=0,e.clamp()}function L(e,t,r){var n=e.abs();if(!(n.t<=0)){var i=this.abs();if(i.t<n.t)return null!=t&&t.fromInt(0),void(null!=r&&this.copyTo(r));null==r&&(r=u());var o=u(),a=this.s,c=e.s,f=this.DB-R(n.data[n.t-1]);f>0?(n.lShiftTo(f,o),i.lShiftTo(f,r)):(n.copyTo(o),i.copyTo(r));var l=o.t,p=o.data[l-1];if(0!=p){var h=p*(1<<this.F1)+(l>1?o.data[l-2]>>this.F2:0),d=this.FV/h,y=(1<<this.F1)/h,g=1<<this.F2,v=r.t,m=v-l,b=null==t?u():t;for(o.dlShiftTo(m,b),r.compareTo(b)>=0&&(r.data[r.t++]=1,r.subTo(b,r)),s.ONE.dlShiftTo(l,b),b.subTo(o,o);o.t<l;)o.data[o.t++]=0;for(;--m>=0;){var E=r.data[--v]==p?this.DM:Math.floor(r.data[v]*d+(r.data[v-1]+g)*y);if((r.data[v]+=o.am(0,E,r,m,0,l))<E)for(o.dlShiftTo(m,b),r.subTo(b,r);r.data[v]<--E;)r.subTo(b,r)}null!=t&&(r.drShiftTo(l,t),a!=c&&s.ZERO.subTo(t,t)),r.t=l,r.clamp(),f>0&&r.rShiftTo(f,r),a<0&&s.ZERO.subTo(r,r)}}}function j(e){var t=u();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(s.ZERO)>0&&e.subTo(t,t),t}function M(e){this.m=e}function V(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e}function F(e){return e}function K(e){e.divRemTo(this.m,null,e)}function H(e,t,r){e.multiplyTo(t,r),this.reduce(r)}function q(e,t){e.squareTo(t),this.reduce(t)}function G(){if(this.t<1)return 0;var e=this.data[0];if(!(1&e))return 0;var t=3&e;return(t=(t=(t=(t=t*(2-(15&e)*t)&15)*(2-(255&e)*t)&255)*(2-((65535&e)*t&65535))&65535)*(2-e*t%this.DV)%this.DV)>0?this.DV-t:-t}function z(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}function Y(e){var t=u();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(s.ZERO)>0&&this.m.subTo(t,t),t}function W(e){var t=u();return e.copyTo(t),this.reduce(t),t}function Q(e){for(;e.t<=this.mt2;)e.data[e.t++]=0;for(var t=0;t<this.m.t;++t){var r=32767&e.data[t],n=r*this.mpl+((r*this.mph+(e.data[t]>>15)*this.mpl&this.um)<<15)&e.DM;for(r=t+this.m.t,e.data[r]+=this.m.am(0,n,e,t,0,this.m.t);e.data[r]>=e.DV;)e.data[r]-=e.DV,e.data[++r]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)}function X(e,t){e.squareTo(t),this.reduce(t)}function Z(e,t,r){e.multiplyTo(t,r),this.reduce(r)}function $(){return 0==(this.t>0?1&this.data[0]:this.s)}function J(e,t){if(e>4294967295||e<1)return s.ONE;var r=u(),n=u(),i=t.convert(this),o=R(e)-1;for(i.copyTo(r);--o>=0;)if(t.sqrTo(r,n),(e&1<<o)>0)t.mulTo(n,i,r);else{var a=r;r=n,n=a}return t.revert(r)}function ee(e,t){var r;return r=e<256||t.isEven()?new M(t):new z(t),this.exp(e,r)}function te(){var e=u();return this.copyTo(e),e}function re(){if(this.s<0){if(1==this.t)return this.data[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this.data[0];if(0==this.t)return 0}return(this.data[1]&(1<<32-this.DB)-1)<<this.DB|this.data[0]}function ne(){return 0==this.t?this.s:this.data[0]<<24>>24}function ie(){return 0==this.t?this.s:this.data[0]<<16>>16}function oe(e){return Math.floor(Math.LN2*this.DB/Math.log(e))}function ae(){return this.s<0?-1:this.t<=0||1==this.t&&this.data[0]<=0?0:1}function se(e){if(null==e&&(e=10),0==this.signum()||e<2||e>36)return"0";var t=this.chunkSize(e),r=Math.pow(e,t),n=T(r),i=u(),o=u(),a="";for(this.divRemTo(n,i,o);i.signum()>0;)a=(r+o.intValue()).toString(e).substr(1)+a,i.divRemTo(n,i,o);return o.intValue().toString(e)+a}function ue(e,t){this.fromInt(0),null==t&&(t=10);for(var r=this.chunkSize(t),n=Math.pow(t,r),i=!1,o=0,a=0,u=0;u<e.length;++u){var c=m(e,u);c<0?"-"==e.charAt(u)&&0==this.signum()&&(i=!0):(a=t*a+c,++o>=r&&(this.dMultiply(n),this.dAddOffset(a,0),o=0,a=0))}o>0&&(this.dMultiply(Math.pow(t,o)),this.dAddOffset(a,0)),i&&s.ZERO.subTo(this,this)}function ce(e,t,r){if("number"==typeof t)if(e<2)this.fromInt(1);else for(this.fromNumber(e,r),this.testBit(e-1)||this.bitwiseTo(s.ONE.shiftLeft(e-1),ve,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(s.ONE.shiftLeft(e-1),this);else{var n=new Array,i=7&e;n.length=1+(e>>3),t.nextBytes(n),i>0?n[0]&=(1<<i)-1:n[0]=0,this.fromString(n,256)}}function fe(){var e=this.t,t=new Array;t[0]=this.s;var r=this.DB-e*this.DB%8,n,i=0;if(e-- >0)for(r<this.DB&&(n=this.data[e]>>r)!=(this.s&this.DM)>>r&&(t[i++]=n|this.s<<this.DB-r);e>=0;)r<8?(n=(this.data[e]&(1<<r)-1)<<8-r,n|=this.data[--e]>>(r+=this.DB-8)):(n=this.data[e]>>(r-=8)&255,r<=0&&(r+=this.DB,--e)),128&n&&(n|=-256),0==i&&(128&this.s)!=(128&n)&&++i,(i>0||n!=this.s)&&(t[i++]=n);return t}function le(e){return 0==this.compareTo(e)}function pe(e){return this.compareTo(e)<0?this:e}function he(e){return this.compareTo(e)>0?this:e}function de(e,t,r){var n,i,o=Math.min(e.t,this.t);for(n=0;n<o;++n)r.data[n]=t(this.data[n],e.data[n]);if(e.t<this.t){for(i=e.s&this.DM,n=o;n<this.t;++n)r.data[n]=t(this.data[n],i);r.t=this.t}else{for(i=this.s&this.DM,n=o;n<e.t;++n)r.data[n]=t(i,e.data[n]);r.t=e.t}r.s=t(this.s,e.s),r.clamp()}function ye(e,t){return e&t}function ge(e){var t=u();return this.bitwiseTo(e,ye,t),t}function ve(e,t){return e|t}function me(e){var t=u();return this.bitwiseTo(e,ve,t),t}function be(e,t){return e^t}function Ee(e){var t=u();return this.bitwiseTo(e,be,t),t}function Te(e,t){return e&~t}function Se(e){var t=u();return this.bitwiseTo(e,Te,t),t}function we(){for(var e=u(),t=0;t<this.t;++t)e.data[t]=this.DM&~this.data[t];return e.t=this.t,e.s=~this.s,e}function Ce(e){var t=u();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t}function _e(e){var t=u();return e<0?this.lShiftTo(-e,t):this.rShiftTo(e,t),t}function Ie(e){if(0==e)return-1;var t=0;return 65535&e||(e>>=16,t+=16),255&e||(e>>=8,t+=8),15&e||(e>>=4,t+=4),3&e||(e>>=2,t+=2),1&e||++t,t}function Ae(){for(var e=0;e<this.t;++e)if(0!=this.data[e])return e*this.DB+Ie(this.data[e]);return this.s<0?this.t*this.DB:-1}function Re(e){for(var t=0;0!=e;)e&=e-1,++t;return t}function Oe(){for(var e=0,t=this.s&this.DM,r=0;r<this.t;++r)e+=Re(this.data[r]^t);return e}function Pe(e){var t=Math.floor(e/this.DB);return t>=this.t?0!=this.s:!!(this.data[t]&1<<e%this.DB)}function Be(e,t){var r=s.ONE.shiftLeft(e);return this.bitwiseTo(r,t,r),r}function ke(e){return this.changeBit(e,ve)}function Ne(e){return this.changeBit(e,Te)}function Ue(e){return this.changeBit(e,be)}function De(e,t){for(var r=0,n=0,i=Math.min(e.t,this.t);r<i;)n+=this.data[r]+e.data[r],t.data[r++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n+=e.s;r<this.t;)n+=this.data[r],t.data[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<e.t;)n+=e.data[r],t.data[r++]=n&this.DM,n>>=this.DB;n+=e.s}t.s=n<0?-1:0,n>0?t.data[r++]=n:n<-1&&(t.data[r++]=this.DV+n),t.t=r,t.clamp()}function xe(e){var t=u();return this.addTo(e,t),t}function Le(e){var t=u();return this.subTo(e,t),t}function je(e){var t=u();return this.multiplyTo(e,t),t}function Me(e){var t=u();return this.divRemTo(e,t,null),t}function Ve(e){var t=u();return this.divRemTo(e,null,t),t}function Fe(e){var t=u(),r=u();return this.divRemTo(e,t,r),new Array(t,r)}function Ke(e){this.data[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()}function He(e,t){if(0!=e){for(;this.t<=t;)this.data[this.t++]=0;for(this.data[t]+=e;this.data[t]>=this.DV;)this.data[t]-=this.DV,++t>=this.t&&(this.data[this.t++]=0),++this.data[t]}}function qe(){}function Ge(e){return e}function ze(e,t,r){e.multiplyTo(t,r)}function Ye(e,t){e.squareTo(t)}function We(e){return this.exp(e,new qe)}function Qe(e,t,r){var n=Math.min(this.t+e.t,t),i;for(r.s=0,r.t=n;n>0;)r.data[--n]=0;for(i=r.t-this.t;n<i;++n)r.data[n+this.t]=this.am(0,e.data[n],r,n,0,this.t);for(i=Math.min(e.t,t);n<i;++n)this.am(0,e.data[n],r,n,0,t-n);r.clamp()}function Xe(e,t,r){--t;var n=r.t=this.t+e.t-t;for(r.s=0;--n>=0;)r.data[n]=0;for(n=Math.max(t-this.t,0);n<e.t;++n)r.data[this.t+n-t]=this.am(t-n,e.data[n],r,0,0,this.t+n-t);r.clamp(),r.drShiftTo(1,r)}function Ze(e){this.r2=u(),this.q3=u(),s.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}function $e(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=u();return e.copyTo(t),this.reduce(t),t}function Je(e){return e}function et(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e)}function tt(e,t){e.squareTo(t),this.reduce(t)}function rt(e,t,r){e.multiplyTo(t,r),this.reduce(r)}function nt(e,t){var r=e.bitLength(),n,i=T(1),o;if(r<=0)return i;n=r<18?1:r<48?3:r<144?4:r<768?5:6,o=r<8?new M(t):t.isEven()?new Ze(t):new z(t);var a=new Array,s=3,c=n-1,f=(1<<n)-1;if(a[1]=o.convert(this),n>1){var l=u();for(o.sqrTo(a[1],l);s<=f;)a[s]=u(),o.mulTo(l,a[s-2],a[s]),s+=2}var p=e.t-1,h,d=!0,y=u(),g;for(r=R(e.data[p])-1;p>=0;){for(r>=c?h=e.data[p]>>r-c&f:(h=(e.data[p]&(1<<r+1)-1)<<c-r,p>0&&(h|=e.data[p-1]>>this.DB+r-c)),s=n;!(1&h);)h>>=1,--s;if((r-=s)<0&&(r+=this.DB,--p),d)a[h].copyTo(i),d=!1;else{for(;s>1;)o.sqrTo(i,y),o.sqrTo(y,i),s-=2;s>0?o.sqrTo(i,y):(g=i,i=y,y=g),o.mulTo(y,a[h],i)}for(;p>=0&&!(e.data[p]&1<<r);)o.sqrTo(i,y),g=i,i=y,y=g,--r<0&&(r=this.DB-1,--p)}return o.revert(i)}function it(e){var t=this.s<0?this.negate():this.clone(),r=e.s<0?e.negate():e.clone();if(t.compareTo(r)<0){var n=t;t=r,r=n}var i=t.getLowestSetBit(),o=r.getLowestSetBit();if(o<0)return t;for(i<o&&(o=i),o>0&&(t.rShiftTo(o,t),r.rShiftTo(o,r));t.signum()>0;)(i=t.getLowestSetBit())>0&&t.rShiftTo(i,t),(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),t.compareTo(r)>=0?(t.subTo(r,t),t.rShiftTo(1,t)):(r.subTo(t,r),r.rShiftTo(1,r));return o>0&&r.lShiftTo(o,r),r}function ot(e){if(e<=0)return 0;var t=this.DV%e,r=this.s<0?e-1:0;if(this.t>0)if(0==t)r=this.data[0]%e;else for(var n=this.t-1;n>=0;--n)r=(t*r+this.data[n])%e;return r}function at(e){var t=e.isEven();if(this.isEven()&&t||0==e.signum())return s.ZERO;for(var r=e.clone(),n=this.clone(),i=T(1),o=T(0),a=T(0),u=T(1);0!=r.signum();){for(;r.isEven();)r.rShiftTo(1,r),t?(i.isEven()&&o.isEven()||(i.addTo(this,i),o.subTo(e,o)),i.rShiftTo(1,i)):o.isEven()||o.subTo(e,o),o.rShiftTo(1,o);for(;n.isEven();)n.rShiftTo(1,n),t?(a.isEven()&&u.isEven()||(a.addTo(this,a),u.subTo(e,u)),a.rShiftTo(1,a)):u.isEven()||u.subTo(e,u),u.rShiftTo(1,u);r.compareTo(n)>=0?(r.subTo(n,r),t&&i.subTo(a,i),o.subTo(u,o)):(n.subTo(r,n),t&&a.subTo(i,a),u.subTo(o,u))}return 0!=n.compareTo(s.ONE)?s.ZERO:u.compareTo(e)>=0?u.subtract(e):u.signum()<0?(u.addTo(e,u),u.signum()<0?u.add(e):u):u}M.prototype.convert=V,M.prototype.revert=F,M.prototype.reduce=K,M.prototype.mulTo=H,M.prototype.sqrTo=q,z.prototype.convert=Y,z.prototype.revert=W,z.prototype.reduce=Q,z.prototype.mulTo=Z,z.prototype.sqrTo=X,s.prototype.copyTo=b,s.prototype.fromInt=E,s.prototype.fromString=S,s.prototype.clamp=w,s.prototype.dlShiftTo=P,s.prototype.drShiftTo=B,s.prototype.lShiftTo=k,s.prototype.rShiftTo=N,s.prototype.subTo=U,s.prototype.multiplyTo=D,s.prototype.squareTo=x,s.prototype.divRemTo=L,s.prototype.invDigit=G,s.prototype.isEven=$,s.prototype.exp=J,s.prototype.toString=C,s.prototype.negate=_,s.prototype.abs=I,s.prototype.compareTo=A,s.prototype.bitLength=O,s.prototype.mod=j,s.prototype.modPowInt=ee,s.ZERO=T(0),s.ONE=T(1),qe.prototype.convert=Ge,qe.prototype.revert=Ge,qe.prototype.mulTo=ze,qe.prototype.sqrTo=Ye,Ze.prototype.convert=$e,Ze.prototype.revert=Je,Ze.prototype.reduce=et,Ze.prototype.mulTo=rt,Ze.prototype.sqrTo=tt;var st=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509],ut=(1<<26)/st[st.length-1];function ct(e){var t,r=this.abs();if(1==r.t&&r.data[0]<=st[st.length-1]){for(t=0;t<st.length;++t)if(r.data[0]==st[t])return!0;return!1}if(r.isEven())return!1;for(t=1;t<st.length;){for(var n=st[t],i=t+1;i<st.length&&n<ut;)n*=st[i++];for(n=r.modInt(n);t<i;)if(n%st[t++]==0)return!1}return r.millerRabin(e)}function ft(e){var t=this.subtract(s.ONE),r=t.getLowestSetBit();if(r<=0)return!1;for(var n=t.shiftRight(r),i=lt(),o,a=0;a<e;++a){do{o=new s(this.bitLength(),i)}while(o.compareTo(s.ONE)<=0||o.compareTo(t)>=0);var u=o.modPow(n,this);if(0!=u.compareTo(s.ONE)&&0!=u.compareTo(t)){for(var c=1;c++<r&&0!=u.compareTo(t);)if(0==(u=u.modPowInt(2,this)).compareTo(s.ONE))return!1;if(0!=u.compareTo(t))return!1}}return!0}function lt(){return{nextBytes:function(e){for(var t=0;t<e.length;++t)e[t]=Math.floor(256*Math.random())}}}s.prototype.chunkSize=oe,s.prototype.toRadix=se,s.prototype.fromRadix=ue,s.prototype.fromNumber=ce,s.prototype.bitwiseTo=de,s.prototype.changeBit=Be,s.prototype.addTo=De,s.prototype.dMultiply=Ke,s.prototype.dAddOffset=He,s.prototype.multiplyLowerTo=Qe,s.prototype.multiplyUpperTo=Xe,s.prototype.modInt=ot,s.prototype.millerRabin=ft,s.prototype.clone=te,s.prototype.intValue=re,s.prototype.byteValue=ne,s.prototype.shortValue=ie,s.prototype.signum=ae,s.prototype.toByteArray=fe,s.prototype.equals=le,s.prototype.min=pe,s.prototype.max=he,s.prototype.and=ge,s.prototype.or=me,s.prototype.xor=Ee,s.prototype.andNot=Se,s.prototype.not=we,s.prototype.shiftLeft=Ce,s.prototype.shiftRight=_e,s.prototype.getLowestSetBit=Ae,s.prototype.bitCount=Oe,s.prototype.testBit=Pe,s.prototype.setBit=ke,s.prototype.clearBit=Ne,s.prototype.flipBit=Ue,s.prototype.add=xe,s.prototype.subtract=Le,s.prototype.multiply=je,s.prototype.divide=Me,s.prototype.remainder=Ve,s.prototype.divideAndRemainder=Fe,s.prototype.modPow=nt,s.prototype.modInverse=at,s.prototype.pow=We,s.prototype.gcd=it,s.prototype.isProbablePrime=ct},,,,,,,,,function(e,t,r){(function(e,t){var r;!function(r){!function(e){var n="object"==typeof t?t:"object"==typeof self?self:"object"==typeof this?this:Function("return this;")(),i=o(r);function o(e,t){return function(r,n){"function"!=typeof e[r]&&Object.defineProperty(e,r,{configurable:!0,writable:!0,value:n}),t&&t(r,n)}}void 0===n.Reflect?n.Reflect=r:i=o(n.Reflect,i),e(i)}(function(t){var r=Object.prototype.hasOwnProperty,n="function"==typeof Symbol,i=n&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",o=n&&void 0!==Symbol.iterator?Symbol.iterator:"@@iterator",a="function"==typeof Object.create,s={__proto__:[]}instanceof Array,u=!a&&!s,c={create:a?function(){return oe(Object.create(null))}:s?function(){return oe({__proto__:null})}:function(){return oe({})},has:u?function(e,t){return r.call(e,t)}:function(e,t){return t in e},get:u?function(e,t){return r.call(e,t)?e[t]:void 0}:function(e,t){return e[t]}},f=Object.getPrototypeOf(Function),l="object"==typeof e&&e.env&&"true"===e.env.REFLECT_METADATA_USE_MAP_POLYFILL,p=l||"function"!=typeof Map||"function"!=typeof Map.prototype.entries?re():Map,h=l||"function"!=typeof Set||"function"!=typeof Set.prototype.entries?ne():Set,d,y=new(l||"function"!=typeof WeakMap?ie():WeakMap);function g(e,t,r,n){if(L(r)){if(!z(e))throw new TypeError;if(!W(t))throw new TypeError;return I(e,t)}if(!z(e))throw new TypeError;if(!V(t))throw new TypeError;if(!V(n)&&!L(n)&&!j(n))throw new TypeError;return j(n)&&(n=void 0),A(e,t,r=G(r),n)}function v(e,t){function r(r,n){if(!V(r))throw new TypeError;if(!L(n)&&!Q(n))throw new TypeError;N(e,t,r,n)}return r}function m(e,t,r,n){if(!V(r))throw new TypeError;return L(n)||(n=G(n)),N(e,t,r,n)}function b(e,t,r){if(!V(t))throw new TypeError;return L(r)||(r=G(r)),O(e,t,r)}function E(e,t,r){if(!V(t))throw new TypeError;return L(r)||(r=G(r)),P(e,t,r)}function T(e,t,r){if(!V(t))throw new TypeError;return L(r)||(r=G(r)),B(e,t,r)}function S(e,t,r){if(!V(t))throw new TypeError;return L(r)||(r=G(r)),k(e,t,r)}function w(e,t){if(!V(e))throw new TypeError;return L(t)||(t=G(t)),U(e,t)}function C(e,t){if(!V(e))throw new TypeError;return L(t)||(t=G(t)),D(e,t)}function _(e,t,r){if(!V(t))throw new TypeError;L(r)||(r=G(r));var n=R(t,r,!1);if(L(n))return!1;if(!n.delete(e))return!1;if(n.size>0)return!0;var i=y.get(t);return i.delete(r),i.size>0||y.delete(t),!0}function I(e,t){for(var r=e.length-1;r>=0;--r){var n,i=(0,e[r])(t);if(!L(i)&&!j(i)){if(!W(i))throw new TypeError;t=i}}return t}function A(e,t,r,n){for(var i=e.length-1;i>=0;--i){var o,a=(0,e[i])(t,r,n);if(!L(a)&&!j(a)){if(!V(a))throw new TypeError;n=a}}return n}function R(e,t,r){var n=y.get(e);if(L(n)){if(!r)return;n=new p,y.set(e,n)}var i=n.get(t);if(L(i)){if(!r)return;i=new p,n.set(t,i)}return i}function O(e,t,r){var n;if(P(e,t,r))return!0;var i=te(t);return!j(i)&&O(e,i,r)}function P(e,t,r){var n=R(t,r,!1);return!L(n)&&H(n.has(e))}function B(e,t,r){var n;if(P(e,t,r))return k(e,t,r);var i=te(t);return j(i)?void 0:B(e,i,r)}function k(e,t,r){var n=R(t,r,!1);if(!L(n))return n.get(e)}function N(e,t,r,n){var i;R(r,n,!0).set(e,t)}function U(e,t){var r=D(e,t),n=te(e);if(null===n)return r;var i=U(n,t);if(i.length<=0)return r;if(r.length<=0)return i;for(var o=new h,a=[],s=0,u=r;s<u.length;s++){var c=u[s],f;(f=o.has(c))||(o.add(c),a.push(c))}for(var l=0,p=i;l<p.length;l++){var c=p[l],f;(f=o.has(c))||(o.add(c),a.push(c))}return a}function D(e,t){var r=[],n=R(e,t,!1);if(L(n))return r;for(var i,o=Z(n.keys()),a=0;;){var s=J(o);if(!s)return r.length=a,r;var u=$(s);try{r[a]=u}catch(e){try{ee(o)}finally{throw e}}a++}}function x(e){if(null===e)return 1;switch(typeof e){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===e?1:6;default:return 6}}function L(e){return void 0===e}function j(e){return null===e}function M(e){return"symbol"==typeof e}function V(e){return"object"==typeof e?null!==e:"function"==typeof e}function F(e,t){switch(x(e)){case 0:case 1:case 2:case 3:case 4:case 5:return e}var r=3===t?"string":5===t?"number":"default",n=X(e,i);if(void 0!==n){var o=n.call(e,r);if(V(o))throw new TypeError;return o}return K(e,"default"===r?"number":r)}function K(e,t){if("string"===t){var r=e.toString,n,i,n;if(Y(r))if(!V(n=r.call(e)))return n;if(Y(i=e.valueOf))if(!V(n=i.call(e)))return n}else{var i,n;if(Y(i=e.valueOf))if(!V(n=i.call(e)))return n;var o=e.toString,n;if(Y(o))if(!V(n=o.call(e)))return n}throw new TypeError}function H(e){return!!e}function q(e){return""+e}function G(e){var t=F(e,3);return M(t)?t:q(t)}function z(e){return Array.isArray?Array.isArray(e):e instanceof Object?e instanceof Array:"[object Array]"===Object.prototype.toString.call(e)}function Y(e){return"function"==typeof e}function W(e){return"function"==typeof e}function Q(e){switch(x(e)){case 3:case 4:return!0;default:return!1}}function X(e,t){var r=e[t];if(null!=r){if(!Y(r))throw new TypeError;return r}}function Z(e){var t=X(e,o);if(!Y(t))throw new TypeError;var r=t.call(e);if(!V(r))throw new TypeError;return r}function $(e){return e.value}function J(e){var t=e.next();return!t.done&&t}function ee(e){var t=e.return;t&&t.call(e)}function te(e){var t=Object.getPrototypeOf(e);if("function"!=typeof e||e===f)return t;if(t!==f)return t;var r=e.prototype,n=r&&Object.getPrototypeOf(r);if(null==n||n===Object.prototype)return t;var i=n.constructor;return"function"!=typeof i||i===e?t:i}function re(){var e={},t=[],r=function(){function e(e,t,r){this._index=0,this._keys=e,this._values=t,this._selector=r}return e.prototype["@@iterator"]=function(){return this},e.prototype[o]=function(){return this},e.prototype.next=function(){var e=this._index;if(e>=0&&e<this._keys.length){var r=this._selector(this._keys[e],this._values[e]);return e+1>=this._keys.length?(this._index=-1,this._keys=t,this._values=t):this._index++,{value:r,done:!1}}return{value:void 0,done:!0}},e.prototype.throw=function(e){throw this._index>=0&&(this._index=-1,this._keys=t,this._values=t),e},e.prototype.return=function(e){return this._index>=0&&(this._index=-1,this._keys=t,this._values=t),{value:e,done:!0}},e}();return function(){function t(){this._keys=[],this._values=[],this._cacheKey=e,this._cacheIndex=-2}return Object.defineProperty(t.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),t.prototype.has=function(e){return this._find(e,!1)>=0},t.prototype.get=function(e){var t=this._find(e,!1);return t>=0?this._values[t]:void 0},t.prototype.set=function(e,t){var r=this._find(e,!0);return this._values[r]=t,this},t.prototype.delete=function(t){var r=this._find(t,!1);if(r>=0){for(var n=this._keys.length,i=r+1;i<n;i++)this._keys[i-1]=this._keys[i],this._values[i-1]=this._values[i];return this._keys.length--,this._values.length--,t===this._cacheKey&&(this._cacheKey=e,this._cacheIndex=-2),!0}return!1},t.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=e,this._cacheIndex=-2},t.prototype.keys=function(){return new r(this._keys,this._values,n)},t.prototype.values=function(){return new r(this._keys,this._values,i)},t.prototype.entries=function(){return new r(this._keys,this._values,a)},t.prototype["@@iterator"]=function(){return this.entries()},t.prototype[o]=function(){return this.entries()},t.prototype._find=function(e,t){return this._cacheKey!==e&&(this._cacheIndex=this._keys.indexOf(this._cacheKey=e)),this._cacheIndex<0&&t&&(this._cacheIndex=this._keys.length,this._keys.push(e),this._values.push(void 0)),this._cacheIndex},t}();function n(e,t){return e}function i(e,t){return t}function a(e,t){return[e,t]}}function ne(){return function(){function e(){this._map=new p}return Object.defineProperty(e.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),e.prototype.has=function(e){return this._map.has(e)},e.prototype.add=function(e){return this._map.set(e,e),this},e.prototype.delete=function(e){return this._map.delete(e)},e.prototype.clear=function(){this._map.clear()},e.prototype.keys=function(){return this._map.keys()},e.prototype.values=function(){return this._map.values()},e.prototype.entries=function(){return this._map.entries()},e.prototype["@@iterator"]=function(){return this.keys()},e.prototype[o]=function(){return this.keys()},e}()}function ie(){var e=16,t=c.create(),n=i();return function(){function e(){this._key=i()}return e.prototype.has=function(e){var t=o(e,!1);return void 0!==t&&c.has(t,this._key)},e.prototype.get=function(e){var t=o(e,!1);return void 0!==t?c.get(t,this._key):void 0},e.prototype.set=function(e,t){var r;return o(e,!0)[this._key]=t,this},e.prototype.delete=function(e){var t=o(e,!1);return void 0!==t&&delete t[this._key]},e.prototype.clear=function(){this._key=i()},e}();function i(){var e;do{e="@@WeakMap@@"+u()}while(c.has(t,e));return t[e]=!0,e}function o(e,t){if(!r.call(e,n)){if(!t)return;Object.defineProperty(e,n,{value:c.create()})}return e[n]}function a(e,t){for(var r=0;r<t;++r)e[r]=255*Math.random()|0;return e}function s(e){return"function"==typeof Uint8Array?"undefined"!=typeof crypto?crypto.getRandomValues(new Uint8Array(e)):"undefined"!=typeof msCrypto?msCrypto.getRandomValues(new Uint8Array(e)):a(new Uint8Array(e),e):a(new Array(e),e)}function u(){var t=s(e);t[6]=79&t[6]|64,t[8]=191&t[8]|128;for(var r="",n=0;n<e;++n){var i=t[n];4!==n&&6!==n&&8!==n||(r+="-"),i<16&&(r+="0"),r+=i.toString(16).toLowerCase()}return r}}function oe(e){return e.__=void 0,delete e.__,e}t("decorate",g),t("metadata",v),t("defineMetadata",m),t("hasMetadata",b),t("hasOwnMetadata",E),t("getMetadata",T),t("getOwnMetadata",S),t("getMetadataKeys",w),t("getOwnMetadataKeys",C),t("deleteMetadata",_)})}(r||(r={}))}).call(this,r(36),r(29))},function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){function i(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=Promise))(function(r,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){e.done?r(e.value):i(e.value).then(a,s)}u((n=n.apply(e,t||[])).next())})},i=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},n,i,o,a;return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(e){return function(t){return u([e,t])}}function u(a){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=2&a[0]?i.return:a[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,a[1])).done)return o;switch(i=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,i=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(!(o=r.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){r=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){r.label=a[1];break}if(6===a[0]&&r.label<o[1]){r.label=o[1],o=a;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(a);break}o[2]&&r.ops.pop(),r.trys.pop();continue}a=t.call(e,r)}catch(e){a=[6,e],i=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}},o=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.Container=void 0;var a=r(88),s=r(11),u=r(18),c=r(7),f=r(54),l=r(89),p=r(96),h=r(98),d=r(24),y=r(30),g=r(101),v=r(102),m=function(){function e(e){this._appliedMiddleware=[];var t=e||{};if("object"!=typeof t)throw new Error(""+s.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT);if(void 0===t.defaultScope)t.defaultScope=u.BindingScopeEnum.Transient;else if(t.defaultScope!==u.BindingScopeEnum.Singleton&&t.defaultScope!==u.BindingScopeEnum.Transient&&t.defaultScope!==u.BindingScopeEnum.Request)throw new Error(""+s.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE);if(void 0===t.autoBindInjectable)t.autoBindInjectable=!1;else if("boolean"!=typeof t.autoBindInjectable)throw new Error(""+s.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE);if(void 0===t.skipBaseClassChecks)t.skipBaseClassChecks=!1;else if("boolean"!=typeof t.skipBaseClassChecks)throw new Error(""+s.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK);this.options={autoBindInjectable:t.autoBindInjectable,defaultScope:t.defaultScope,skipBaseClassChecks:t.skipBaseClassChecks},this.id=d.id(),this._bindingDictionary=new v.Lookup,this._snapshots=[],this._middleware=null,this.parent=null,this._metadataReader=new f.MetadataReader}return e.merge=function(t,r){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];var a=new e,s=o([t,r],n).map(function(e){return l.getBindingDictionary(e)}),u=l.getBindingDictionary(a);function c(e,t){e.traverse(function(e,r){r.forEach(function(e){t.add(e.serviceIdentifier,e.clone())})})}return s.forEach(function(e){c(e,u)}),a},e.prototype.load=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var r=this._getContainerModuleHelpersFactory(),n=0,i=e;n<i.length;n++){var o=i[n],a=r(o.id);o.registry(a.bindFunction,a.unbindFunction,a.isboundFunction,a.rebindFunction)}},e.prototype.loadAsync=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return n(this,void 0,void 0,function(){var t,r,n,o,a;return i(this,function(i){switch(i.label){case 0:t=this._getContainerModuleHelpersFactory(),r=0,n=e,i.label=1;case 1:return r<n.length?(o=n[r],a=t(o.id),[4,o.registry(a.bindFunction,a.unbindFunction,a.isboundFunction,a.rebindFunction)]):[3,4];case 2:i.sent(),i.label=3;case 3:return r++,[3,1];case 4:return[2]}})})},e.prototype.unload=function(){for(var e=this,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=function(e){return function(t){return t.moduleId===e}};t.forEach(function(t){var r=n(t.id);e._bindingDictionary.removeByCondition(r)})},e.prototype.bind=function(e){var t=this.options.defaultScope||u.BindingScopeEnum.Transient,r=new a.Binding(e,t);return this._bindingDictionary.add(e,r),new h.BindingToSyntax(r)},e.prototype.rebind=function(e){return this.unbind(e),this.bind(e)},e.prototype.unbind=function(e){try{this._bindingDictionary.remove(e)}catch(t){throw new Error(s.CANNOT_UNBIND+" "+y.getServiceIdentifierAsString(e))}},e.prototype.unbindAll=function(){this._bindingDictionary=new v.Lookup},e.prototype.isBound=function(e){var t=this._bindingDictionary.hasKey(e);return!t&&this.parent&&(t=this.parent.isBound(e)),t},e.prototype.isBoundNamed=function(e,t){return this.isBoundTagged(e,c.NAMED_TAG,t)},e.prototype.isBoundTagged=function(e,t,r){var n=!1;if(this._bindingDictionary.hasKey(e)){var i=this._bindingDictionary.get(e),o=l.createMockRequest(this,e,t,r);n=i.some(function(e){return e.constraint(o)})}return!n&&this.parent&&(n=this.parent.isBoundTagged(e,t,r)),n},e.prototype.snapshot=function(){this._snapshots.push(g.ContainerSnapshot.of(this._bindingDictionary.clone(),this._middleware))},e.prototype.restore=function(){var e=this._snapshots.pop();if(void 0===e)throw new Error(s.NO_MORE_SNAPSHOTS_AVAILABLE);this._bindingDictionary=e.bindings,this._middleware=e.middleware},e.prototype.createChild=function(t){var r=new e(t||this.options);return r.parent=this,r},e.prototype.applyMiddleware=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._appliedMiddleware=this._appliedMiddleware.concat(e);var r=this._middleware?this._middleware:this._planAndResolve();this._middleware=e.reduce(function(e,t){return t(e)},r)},e.prototype.applyCustomMetadataReader=function(e){this._metadataReader=e},e.prototype.get=function(e){return this._get(!1,!1,u.TargetTypeEnum.Variable,e)},e.prototype.getTagged=function(e,t,r){return this._get(!1,!1,u.TargetTypeEnum.Variable,e,t,r)},e.prototype.getNamed=function(e,t){return this.getTagged(e,c.NAMED_TAG,t)},e.prototype.getAll=function(e){return this._get(!0,!0,u.TargetTypeEnum.Variable,e)},e.prototype.getAllTagged=function(e,t,r){return this._get(!1,!0,u.TargetTypeEnum.Variable,e,t,r)},e.prototype.getAllNamed=function(e,t){return this.getAllTagged(e,c.NAMED_TAG,t)},e.prototype.resolve=function(e){var t=this.createChild();return t.bind(e).toSelf(),this._appliedMiddleware.forEach(function(e){t.applyMiddleware(e)}),t.get(e)},e.prototype._getContainerModuleHelpersFactory=function(){var e=this,t=function(e,t){e._binding.moduleId=t},r=function(r){return function(n){var i,o=e.bind.bind(e)(n);return t(o,r),o}},n=function(t){return function(t){var r;e.unbind.bind(e)(t)}},i=function(t){return function(t){var r;return e.isBound.bind(e)(t)}},o=function(r){return function(n){var i,o=e.rebind.bind(e)(n);return t(o,r),o}};return function(e){return{bindFunction:r(e),isboundFunction:i(e),rebindFunction:o(e),unbindFunction:n(e)}}},e.prototype._get=function(e,t,r,n,i,o){var a=null,u={avoidConstraints:e,contextInterceptor:function(e){return e},isMultiInject:t,key:i,serviceIdentifier:n,targetType:r,value:o};if(this._middleware){if(null==(a=this._middleware(u)))throw new Error(s.INVALID_MIDDLEWARE_RETURN)}else a=this._planAndResolve()(u);return a},e.prototype._planAndResolve=function(){var e=this;return function(t){var r=l.plan(e._metadataReader,e,t.isMultiInject,t.targetType,t.serviceIdentifier,t.key,t.value,t.avoidConstraints),n;return r=t.contextInterceptor(r),p.resolve(r)}},e}();t.Container=m},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Binding=void 0;var n=r(18),i=r(24),o=function(){function e(e,t){this.id=i.id(),this.activated=!1,this.serviceIdentifier=e,this.scope=t,this.type=n.BindingTypeEnum.Invalid,this.constraint=function(e){return!0},this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.onActivation=null,this.dynamicValue=null}return e.prototype.clone=function(){var t=new e(this.serviceIdentifier,this.scope);return t.activated=t.scope===n.BindingScopeEnum.Singleton&&this.activated,t.implementationType=this.implementationType,t.dynamicValue=this.dynamicValue,t.scope=this.scope,t.type=this.type,t.factory=this.factory,t.provider=this.provider,t.constraint=this.constraint,t.onActivation=this.onActivation,t.cache=this.cache,t},e}();t.Binding=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getBindingDictionary=t.createMockRequest=t.plan=void 0;var n=r(90),i=r(11),o=r(18),a=r(7),s=r(55),u=r(30),c=r(91),f=r(14),l=r(92),p=r(93),h=r(95),d=r(57);function y(e){return e._bindingDictionary}function g(e,t,r,n,i,o){var s=e?a.MULTI_INJECT_TAG:a.INJECT_TAG,u=new f.Metadata(s,r),c=new d.Target(t,n,r,u);if(void 0!==i){var l=new f.Metadata(i,o);c.metadata.push(l)}return c}function v(e,t,r,i,o){var a=E(r.container,o.serviceIdentifier),s=[];return a.length===n.BindingCount.NoBindingsAvailable&&r.container.options.autoBindInjectable&&"function"==typeof o.serviceIdentifier&&e.getConstructorMetadata(o.serviceIdentifier).compilerGeneratedMetadata&&(r.container.bind(o.serviceIdentifier).toSelf(),a=E(r.container,o.serviceIdentifier)),s=t?a:a.filter(function(e){var t=new h.Request(e.serviceIdentifier,r,i,e,o);return e.constraint(t)}),m(o.serviceIdentifier,s,o,r.container),s}function m(e,t,r,o){switch(t.length){case n.BindingCount.NoBindingsAvailable:if(r.isOptional())return t;var a=u.getServiceIdentifierAsString(e),s=i.NOT_REGISTERED;throw s+=u.listMetadataForTarget(a,r),s+=u.listRegisteredBindingsForServiceIdentifier(o,a,E),new Error(s);case n.BindingCount.OnlyOneBindingAvailable:if(!r.isArray())return t;case n.BindingCount.MultipleBindingsAvailable:default:if(r.isArray())return t;var a=u.getServiceIdentifierAsString(e),s=i.AMBIGUOUS_MATCH+" "+a;throw s+=u.listRegisteredBindingsForServiceIdentifier(o,a,E),new Error(s)}}function b(e,t,r,n,a,s){var u,c;if(null===a){u=v(e,t,n,null,s),c=new h.Request(r,n,null,u,s);var f=new l.Plan(n,c);n.addPlan(f)}else u=v(e,t,n,a,s),c=a.addChildRequest(s.serviceIdentifier,u,s);u.forEach(function(t){var r=null;if(s.isArray())r=c.addChildRequest(t.serviceIdentifier,t,s);else{if(t.cache)return;r=c}if(t.type===o.BindingTypeEnum.Instance&&null!==t.implementationType){var a=p.getDependencies(e,t.implementationType);if(!n.container.options.skipBaseClassChecks){var u=p.getBaseClassDependencyCount(e,t.implementationType);if(a.length<u){var f=i.ARGUMENTS_LENGTH_MISMATCH(p.getFunctionName(t.implementationType));throw new Error(f)}}a.forEach(function(t){b(e,!1,t.serviceIdentifier,n,r,t)})}})}function E(e,t){var r=[],n=y(e);return n.hasKey(t)?r=n.get(t):null!==e.parent&&(r=E(e.parent,t)),r}function T(e,t,r,n,i,o,a,f){void 0===f&&(f=!1);var l=new c.Context(t),p=g(r,n,i,"",o,a);try{return b(e,f,i,l,null,p),l}catch(e){throw s.isStackOverflowExeption(e)&&l.plan&&u.circularDependencyToException(l.plan.rootRequest),e}}function S(e,t,r,n){var i=new d.Target(o.TargetTypeEnum.Variable,"",t,new f.Metadata(r,n)),a=new c.Context(e),s;return new h.Request(t,a,null,[],i)}t.getBindingDictionary=y,t.plan=T,t.createMockRequest=S},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BindingCount=void 0;var n={MultipleBindingsAvailable:2,NoBindingsAvailable:0,OnlyOneBindingAvailable:1};t.BindingCount=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Context=void 0;var n=r(24),i=function(){function e(e){this.id=n.id(),this.container=e}return e.prototype.addPlan=function(e){this.plan=e},e.prototype.setCurrentRequest=function(e){this.currentRequest=e},e}();t.Context=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Plan=void 0;var n=function(){function e(e,t){this.parentContext=e,this.rootRequest=t}return e}();t.Plan=n},function(e,t,r){"use strict";var n=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.getFunctionName=t.getBaseClassDependencyCount=t.getDependencies=void 0;var i=r(56),o=r(11),a=r(18),s=r(7),u=r(30);Object.defineProperty(t,"getFunctionName",{enumerable:!0,get:function(){return u.getFunctionName}});var c=r(57);function f(e,t){var r,n;return l(e,u.getFunctionName(t),t,!1)}function l(e,t,r,i){var a=e.getConstructorMetadata(r),s=a.compilerGeneratedMetadata;if(void 0===s){var u=o.MISSING_INJECTABLE_ANNOTATION+" "+t+".";throw new Error(u)}var c=a.userGeneratedMetadata,f=Object.keys(c),l=0===r.length&&f.length>0,p=f.length>r.length,y,g=h(i,t,s,c,l||p?f.length:r.length),v=d(e,r),m;return n(n([],g),v)}function p(e,t,r,n,s){var u=s[e.toString()]||[],f=g(u),l=!0!==f.unmanaged,p=n[e],h=f.inject||f.multiInject;if((p=h||p)instanceof i.LazyServiceIdentifer&&(p=p.unwrap()),l){var d,y,v,m;if(!t&&(p===Object||p===Function||void 0===p)){var b=o.MISSING_INJECT_ANNOTATION+" argument "+e+" in class "+r+".";throw new Error(b)}var E=new c.Target(a.TargetTypeEnum.ConstructorArgument,f.targetName,p);return E.metadata=u,E}return null}function h(e,t,r,n,i){for(var o=[],a=0;a<i;a++){var s,u=p(a,e,t,r,n);null!==u&&o.push(u)}return o}function d(e,t){for(var r=e.getPropertiesMetadata(t),i=[],o,s=0,u=Object.keys(r);s<u.length;s++){var f=u[s],l=r[f],p=g(r[f]),h=p.targetName||f,y=p.inject||p.multiInject,v=new c.Target(a.TargetTypeEnum.ClassProperty,h,y);v.metadata=l,i.push(v)}var m=Object.getPrototypeOf(t.prototype).constructor;if(m!==Object){var b=d(e,m);i=n(n([],i),b)}return i}function y(e,t){var r=Object.getPrototypeOf(t.prototype).constructor;if(r!==Object){var n,i=l(e,u.getFunctionName(r),r,!0),o=i.map(function(e){return e.metadata.filter(function(e){return e.key===s.UNMANAGED_TAG})}),a=[].concat.apply([],o).length,c=i.length-a;return c>0?c:y(e,r)}return 0}function g(e){var t={};return e.forEach(function(e){t[e.key.toString()]=e.value}),{inject:t[s.INJECT_TAG],multiInject:t[s.MULTI_INJECT_TAG],targetName:t[s.NAME_TAG],unmanaged:t[s.UNMANAGED_TAG]}}t.getDependencies=f,t.getBaseClassDependencyCount=y},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.QueryableString=void 0;var n=function(){function e(e){this.str=e}return e.prototype.startsWith=function(e){return 0===this.str.indexOf(e)},e.prototype.endsWith=function(e){var t="",r=e.split("").reverse().join("");return t=this.str.split("").reverse().join(""),this.startsWith.call({str:t},r)},e.prototype.contains=function(e){return-1!==this.str.indexOf(e)},e.prototype.equals=function(e){return this.str===e},e.prototype.value=function(){return this.str},e}();t.QueryableString=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Request=void 0;var n=r(24),i=function(){function e(e,t,r,i,o){this.id=n.id(),this.serviceIdentifier=e,this.parentContext=t,this.parentRequest=r,this.target=o,this.childRequests=[],this.bindings=Array.isArray(i)?i:[i],this.requestScope=null===r?new Map:null}return e.prototype.addChildRequest=function(t,r,n){var i=new e(t,this.parentContext,this,r,n);return this.childRequests.push(i),i},e}();t.Request=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resolve=void 0;var n=r(11),i=r(18),o=r(55),a=r(30),s=r(97),u=function(e,t,r){try{return r()}catch(r){throw o.isStackOverflowExeption(r)?new Error(n.CIRCULAR_DEPENDENCY_IN_FACTORY(e,t.toString())):r}},c=function(e){return function(t){t.parentContext.setCurrentRequest(t);var r=t.bindings,o=t.childRequests,f=t.target&&t.target.isArray(),l=!(t.parentRequest&&t.parentRequest.target&&t.target&&t.parentRequest.target.matchesArray(t.target.serviceIdentifier));if(f&&l)return o.map(function(t){var r;return c(e)(t)});var p=null;if(!t.target.isOptional()||0!==r.length){var h=r[0],d=h.scope===i.BindingScopeEnum.Singleton,y=h.scope===i.BindingScopeEnum.Request;if(d&&h.activated)return h.cache;if(y&&null!==e&&e.has(h.id))return e.get(h.id);if(h.type===i.BindingTypeEnum.ConstantValue)p=h.cache,h.activated=!0;else if(h.type===i.BindingTypeEnum.Function)p=h.cache,h.activated=!0;else if(h.type===i.BindingTypeEnum.Constructor)p=h.implementationType;else if(h.type===i.BindingTypeEnum.DynamicValue&&null!==h.dynamicValue)p=u("toDynamicValue",h.serviceIdentifier,function(){return h.dynamicValue(t.parentContext)});else if(h.type===i.BindingTypeEnum.Factory&&null!==h.factory)p=u("toFactory",h.serviceIdentifier,function(){return h.factory(t.parentContext)});else if(h.type===i.BindingTypeEnum.Provider&&null!==h.provider)p=u("toProvider",h.serviceIdentifier,function(){return h.provider(t.parentContext)});else{if(h.type!==i.BindingTypeEnum.Instance||null===h.implementationType){var g=a.getServiceIdentifierAsString(t.serviceIdentifier);throw new Error(n.INVALID_BINDING_TYPE+" "+g)}p=s.resolveInstance(h.implementationType,o,c(e))}return"function"==typeof h.onActivation&&(p=h.onActivation(t.parentContext,p)),d&&(h.cache=p,h.activated=!0),y&&null!==e&&!e.has(h.id)&&e.set(h.id,p),p}}};function f(e){var t;return c(e.plan.rootRequest.requestScope)(e.plan.rootRequest)}t.resolve=f},function(e,t,r){"use strict";var n=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.resolveInstance=void 0;var i=r(11),o=r(18),a=r(7);function s(e,t,r){var n=t.filter(function(e){return null!==e.target&&e.target.type===o.TargetTypeEnum.ClassProperty}),i=n.map(r);return n.forEach(function(t,r){var n="";n=t.target.name.value();var o=i[r];e[n]=o}),e}function u(e,t){return new(e.bind.apply(e,n([void 0],t)))}function c(e,t){if(Reflect.hasMetadata(a.POST_CONSTRUCT,e)){var r=Reflect.getMetadata(a.POST_CONSTRUCT,e);try{t[r.value]()}catch(t){throw new Error(i.POST_CONSTRUCT_ERROR(e.name,t.message))}}}function f(e,t,r){var n=null,i,a;t.length>0?n=s(n=u(e,t.filter(function(e){return null!==e.target&&e.target.type===o.TargetTypeEnum.ConstructorArgument}).map(r)),t,r):n=new e;return c(e,n),n}t.resolveInstance=f},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BindingToSyntax=void 0;var n=r(11),i=r(18),o=r(99),a=r(58),s=function(){function e(e){this._binding=e}return e.prototype.to=function(e){return this._binding.type=i.BindingTypeEnum.Instance,this._binding.implementationType=e,new o.BindingInWhenOnSyntax(this._binding)},e.prototype.toSelf=function(){if("function"!=typeof this._binding.serviceIdentifier)throw new Error(""+n.INVALID_TO_SELF_VALUE);var e=this._binding.serviceIdentifier;return this.to(e)},e.prototype.toConstantValue=function(e){return this._binding.type=i.BindingTypeEnum.ConstantValue,this._binding.cache=e,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=i.BindingScopeEnum.Singleton,new a.BindingWhenOnSyntax(this._binding)},e.prototype.toDynamicValue=function(e){return this._binding.type=i.BindingTypeEnum.DynamicValue,this._binding.cache=null,this._binding.dynamicValue=e,this._binding.implementationType=null,new o.BindingInWhenOnSyntax(this._binding)},e.prototype.toConstructor=function(e){return this._binding.type=i.BindingTypeEnum.Constructor,this._binding.implementationType=e,this._binding.scope=i.BindingScopeEnum.Singleton,new a.BindingWhenOnSyntax(this._binding)},e.prototype.toFactory=function(e){return this._binding.type=i.BindingTypeEnum.Factory,this._binding.factory=e,this._binding.scope=i.BindingScopeEnum.Singleton,new a.BindingWhenOnSyntax(this._binding)},e.prototype.toFunction=function(e){if("function"!=typeof e)throw new Error(n.INVALID_FUNCTION_BINDING);var t=this.toConstantValue(e);return this._binding.type=i.BindingTypeEnum.Function,this._binding.scope=i.BindingScopeEnum.Singleton,t},e.prototype.toAutoFactory=function(e){return this._binding.type=i.BindingTypeEnum.Factory,this._binding.factory=function(t){var r;return function(){return t.container.get(e)}},this._binding.scope=i.BindingScopeEnum.Singleton,new a.BindingWhenOnSyntax(this._binding)},e.prototype.toProvider=function(e){return this._binding.type=i.BindingTypeEnum.Provider,this._binding.provider=e,this._binding.scope=i.BindingScopeEnum.Singleton,new a.BindingWhenOnSyntax(this._binding)},e.prototype.toService=function(e){this.toDynamicValue(function(t){return t.container.get(e)})},e}();t.BindingToSyntax=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BindingInWhenOnSyntax=void 0;var n=r(100),i=r(46),o=r(47),a=function(){function e(e){this._binding=e,this._bindingWhenSyntax=new o.BindingWhenSyntax(this._binding),this._bindingOnSyntax=new i.BindingOnSyntax(this._binding),this._bindingInSyntax=new n.BindingInSyntax(e)}return e.prototype.inRequestScope=function(){return this._bindingInSyntax.inRequestScope()},e.prototype.inSingletonScope=function(){return this._bindingInSyntax.inSingletonScope()},e.prototype.inTransientScope=function(){return this._bindingInSyntax.inTransientScope()},e.prototype.when=function(e){return this._bindingWhenSyntax.when(e)},e.prototype.whenTargetNamed=function(e){return this._bindingWhenSyntax.whenTargetNamed(e)},e.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},e.prototype.whenTargetTagged=function(e,t){return this._bindingWhenSyntax.whenTargetTagged(e,t)},e.prototype.whenInjectedInto=function(e){return this._bindingWhenSyntax.whenInjectedInto(e)},e.prototype.whenParentNamed=function(e){return this._bindingWhenSyntax.whenParentNamed(e)},e.prototype.whenParentTagged=function(e,t){return this._bindingWhenSyntax.whenParentTagged(e,t)},e.prototype.whenAnyAncestorIs=function(e){return this._bindingWhenSyntax.whenAnyAncestorIs(e)},e.prototype.whenNoAncestorIs=function(e){return this._bindingWhenSyntax.whenNoAncestorIs(e)},e.prototype.whenAnyAncestorNamed=function(e){return this._bindingWhenSyntax.whenAnyAncestorNamed(e)},e.prototype.whenAnyAncestorTagged=function(e,t){return this._bindingWhenSyntax.whenAnyAncestorTagged(e,t)},e.prototype.whenNoAncestorNamed=function(e){return this._bindingWhenSyntax.whenNoAncestorNamed(e)},e.prototype.whenNoAncestorTagged=function(e,t){return this._bindingWhenSyntax.whenNoAncestorTagged(e,t)},e.prototype.whenAnyAncestorMatches=function(e){return this._bindingWhenSyntax.whenAnyAncestorMatches(e)},e.prototype.whenNoAncestorMatches=function(e){return this._bindingWhenSyntax.whenNoAncestorMatches(e)},e.prototype.onActivation=function(e){return this._bindingOnSyntax.onActivation(e)},e}();t.BindingInWhenOnSyntax=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BindingInSyntax=void 0;var n=r(18),i=r(58),o=function(){function e(e){this._binding=e}return e.prototype.inRequestScope=function(){return this._binding.scope=n.BindingScopeEnum.Request,new i.BindingWhenOnSyntax(this._binding)},e.prototype.inSingletonScope=function(){return this._binding.scope=n.BindingScopeEnum.Singleton,new i.BindingWhenOnSyntax(this._binding)},e.prototype.inTransientScope=function(){return this._binding.scope=n.BindingScopeEnum.Transient,new i.BindingWhenOnSyntax(this._binding)},e}();t.BindingInSyntax=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ContainerSnapshot=void 0;var n=function(){function e(){}return e.of=function(t,r){var n=new e;return n.bindings=t,n.middleware=r,n},e}();t.ContainerSnapshot=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Lookup=void 0;var n=r(11),i=function(){function e(){this._map=new Map}return e.prototype.getMap=function(){return this._map},e.prototype.add=function(e,t){if(null==e)throw new Error(n.NULL_ARGUMENT);if(null==t)throw new Error(n.NULL_ARGUMENT);var r=this._map.get(e);void 0!==r?(r.push(t),this._map.set(e,r)):this._map.set(e,[t])},e.prototype.get=function(e){if(null==e)throw new Error(n.NULL_ARGUMENT);var t=this._map.get(e);if(void 0!==t)return t;throw new Error(n.KEY_NOT_FOUND)},e.prototype.remove=function(e){if(null==e)throw new Error(n.NULL_ARGUMENT);if(!this._map.delete(e))throw new Error(n.KEY_NOT_FOUND)},e.prototype.removeByCondition=function(e){var t=this;this._map.forEach(function(r,n){var i=r.filter(function(t){return!e(t)});i.length>0?t._map.set(n,i):t._map.delete(n)})},e.prototype.hasKey=function(e){if(null==e)throw new Error(n.NULL_ARGUMENT);return this._map.has(e)},e.prototype.clone=function(){var t=new e;return this._map.forEach(function(e,r){e.forEach(function(e){return t.add(r,e.clone())})}),t},e.prototype.traverse=function(e){this._map.forEach(function(t,r){e(r,t)})},e}();t.Lookup=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AsyncContainerModule=t.ContainerModule=void 0;var n=r(24),i=function(){function e(e){this.id=n.id(),this.registry=e}return e}();t.ContainerModule=i;var o=function(){function e(e){this.id=n.id(),this.registry=e}return e}();t.AsyncContainerModule=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.injectable=void 0;var n=r(11),i=r(7);function o(){return function(e){if(Reflect.hasOwnMetadata(i.PARAM_TYPES,e))throw new Error(n.DUPLICATED_INJECTABLE_DECORATOR);var t=Reflect.getMetadata(i.DESIGN_PARAM_TYPES,e)||[];return Reflect.defineMetadata(i.PARAM_TYPES,t,e),e}}t.injectable=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tagged=void 0;var n=r(14),i=r(19);function o(e,t){return function(r,o,a){var s=new n.Metadata(e,t);"number"==typeof a?i.tagParameter(r,o,a,s):i.tagProperty(r,o,s)}}t.tagged=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.named=void 0;var n=r(7),i=r(14),o=r(19);function a(e){return function(t,r,a){var s=new i.Metadata(n.NAMED_TAG,e);"number"==typeof a?o.tagParameter(t,r,a,s):o.tagProperty(t,r,s)}}t.named=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.optional=void 0;var n=r(7),i=r(14),o=r(19);function a(){return function(e,t,r){var a=new i.Metadata(n.OPTIONAL_TAG,!0);"number"==typeof r?o.tagParameter(e,t,r,a):o.tagProperty(e,t,a)}}t.optional=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.unmanaged=void 0;var n=r(7),i=r(14),o=r(19);function a(){return function(e,t,r){var a=new i.Metadata(n.UNMANAGED_TAG,!0);o.tagParameter(e,t,r,a)}}t.unmanaged=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.multiInject=void 0;var n=r(7),i=r(14),o=r(19);function a(e){return function(t,r,a){var s=new i.Metadata(n.MULTI_INJECT_TAG,e);"number"==typeof a?o.tagParameter(t,r,a,s):o.tagProperty(t,r,s)}}t.multiInject=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.targetName=void 0;var n=r(7),i=r(14),o=r(19);function a(e){return function(t,r,a){var s=new i.Metadata(n.NAME_TAG,e);o.tagParameter(t,r,a,s)}}t.targetName=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.postConstruct=void 0;var n=r(11),i=r(7),o=r(14);function a(){return function(e,t,r){var a=new o.Metadata(i.POST_CONSTRUCT,t);if(Reflect.hasOwnMetadata(i.POST_CONSTRUCT,e.constructor))throw new Error(n.MULTIPLE_POST_CONSTRUCT_METHODS);Reflect.defineMetadata(i.POST_CONSTRUCT,a,e.constructor)}}t.postConstruct=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.multiBindToService=void 0;var n=function(e){return function(t){return function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return r.forEach(function(r){return e.bind(r).toService(t)})}}};t.multiBindToService=n},function(e,t,r){"use strict";var n=String.prototype.replace,i=/%20/g,o="RFC1738",a="RFC3986";e.exports={default:a,formatters:{RFC1738:function(e){return n.call(e,i,"+")},RFC3986:function(e){return String(e)}},RFC1738:o,RFC3986:a}},function(e,t,r){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e,t){return c(e)||u(e,t)||a(e,t)||o()}function o(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function a(e,t){if(e){if("string"==typeof e)return s(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?s(e,t):void 0}}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function u(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],u=!0,c=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){c=!0,i=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}function c(e){if(Array.isArray(e))return e}function f(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",i=r.toStringTag||"@@toStringTag";function o(r,n,i,o){var u=n&&n.prototype instanceof s?n:s,c=Object.create(u.prototype);return l(c,"_invoke",function(r,n,i){var o,s,u,c=0,f=i||[],l=!1,p={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function t(r,n){return o=r,s=0,u=e,p.n=n,a}};function h(r,n){for(s=r,u=n,t=0;!l&&c&&!i&&t<f.length;t++){var i,o=f[t],h=p.p,d=o[2];r>3?(i=d===n)&&(u=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=h&&((i=r<2&&h<o[1])?(s=0,p.v=n,p.n=o[1]):h<d&&(i=r<3||o[0]>n||n>d)&&(o[4]=r,o[5]=n,p.n=d,s=0))}if(i||r>1)return a;throw l=!0,n}return function(i,f,d){if(c>1)throw TypeError("Generator is already running");for(l&&1===f&&h(f,d),s=f,u=d;(t=s<2?e:u)||!l;){o||(s?s<3?(s>1&&(p.n=-1),h(s,u)):p.n=u:p.v=u);try{if(c=2,o){if(s||(i="next"),t=o[i]){if(!(t=t.call(o,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(u=TypeError("The iterator does not provide a '"+i+"' method"),s=1);o=e}else if((t=(l=p.n<0)?u:r.call(n,p))!==a)break}catch(t){o=e,s=1,u=t}finally{c=1}}return{value:t,done:l}}}(r,i,o),!0),c}var a={};function s(){}function u(){}function c(){}t=Object.getPrototypeOf;var p=[][n]?t(t([][n]())):(l(t={},n,function(){return this}),t),h=c.prototype=s.prototype=Object.create(p);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,l(e,i,"GeneratorFunction")),e.prototype=Object.create(h),e}return u.prototype=c,l(h,"constructor",c),l(c,"constructor",u),u.displayName="GeneratorFunction",l(c,i,"GeneratorFunction"),l(h),l(h,i,"Generator"),l(h,n,function(){return this}),l(h,"toString",function(){return"[object Generator]"}),(f=function e(){return{w:o,m:d}})()}function l(e,t,r,n){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}l=function e(t,r,n,o){function a(e,r){l(t,e,function(t){return this._invoke(e,r,t)})}r?i?i(t,r,{value:n,enumerable:!o,configurable:!o,writable:!o}):t[r]=n:(a("next",0),a("throw",1),a("return",2))},l(e,t,r,n)}function p(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function h(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var o=e.apply(t,r);function a(e){p(o,n,i,a,s,"next",e)}function s(e){p(o,n,i,a,s,"throw",e)}a(void 0)})}}function d(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function y(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,v(n.key),n)}}function g(e,t,r){return t&&y(e.prototype,t),r&&y(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function v(e){var t=m(e,"string");return"symbol"==n(t)?t:t+""}function m(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function b(e,t,r){return t=I(t),E(e,S()?Reflect.construct(t,r||[],I(e).constructor):t.apply(e,r))}function E(e,t){if(t&&("object"==n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return T(e)}function T(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function S(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(S=function t(){return!!e})()}function w(e,t,r,n){var i=C(I(1&n?e.prototype:e),t,r);return 2&n&&"function"==typeof i?function(e){return i.apply(r,e)}:i}function C(){return C="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=_(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}},C.apply(null,arguments)}function _(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=I(e)););return e}function I(e){return I=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},I(e)}function A(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&R(e,t)}function R(e,t){return R=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},R(e,t)}var O=r(115),P=r(67),B=r(132);e.exports=function(e){function t(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=r.type,i=r.alg,o=r.LDKeyClass,a=r.creator,s=r.verificationMethod,u=r.signer,c=r.key,f=r.proof,l=r.date,p=r.useNativeCanonize;if(d(this,t),(e=b(this,t,[{type:n,creator:a,verificationMethod:s,proof:f,date:l,useNativeCanonize:p}])).alg=i,e.LDKeyClass=o,e.signer=u,c){if(void 0===s&&void 0===a){var h=c.publicNode();h.owner?e.creator=h.id:e.verificationMethod=h.id}e.key=c,"function"==typeof c.signer&&(e.signer=c.signer()),"function"==typeof c.verifier&&(e.verifier=c.verifier())}return e}return A(t,e),g(t,[{key:"sign",value:function(){var e=h(f().m(function e(t){var r,n,i,o,a,s,u;return f().w(function(e){for(;;)switch(e.n){case 0:if(r=t.verifyData,n=t.proof,this.signer&&"function"==typeof this.signer.sign){e.n=1;break}throw new Error("A signer API has not been specified.");case 1:return i={alg:this.alg,b64:!1,crit:["b64"]},o=B.encodeBase64Url(JSON.stringify(i)),a=B.createJws({encodedHeader:o,verifyData:r}),e.n=2,this.signer.sign({data:a});case 2:return s=e.v,u=B.encodeBase64Url(s),n.jws=o+".."+u,e.a(2,n)}},e,this)}));function t(t){return e.apply(this,arguments)}return t}()},{key:"verifySignature",value:function(){var e=h(f().m(function e(t){var r,o,a,s,u,c,l,p,h,d,y,g,v;return f().w(function(e){for(;;)switch(e.p=e.n){case 0:if(r=t.verifyData,o=t.verificationMethod,(a=t.proof).jws&&"string"==typeof a.jws&&a.jws.includes(".")){e.n=1;break}throw new TypeError('The proof does not include a valid "jws" property.');case 1:s=a.jws.split("."),u=i(s,3),c=u[0],l=u[2],e.p=2,p=JSON.parse(B.decodeBase64UrlToString(c)),e.n=4;break;case 3:throw e.p=3,v=e.v,new Error("Could not parse JWS header; "+v);case 4:if(p&&"object"===n(p)){e.n=5;break}throw new Error("Invalid JWS header.");case 5:if(p.alg===this.alg&&!1===p.b64&&Array.isArray(p.crit)&&1===p.crit.length&&"b64"===p.crit[0]||3!==Object.keys(p).length){e.n=6;break}throw new Error("Invalid JWS header parameters for ".concat(this.type,"."));case 6:if(h=B.decodeBase64Url(l),d=B.createJws({encodedHeader:c,verifyData:r}),y=this.verifier){e.n=8;break}return e.n=7,this.LDKeyClass.from(o);case 7:g=e.v,y=g.verifier();case 8:return e.a(2,y.verify({data:d,signature:h}))}},e,this,[[2,3]])}));function t(t){return e.apply(this,arguments)}return t}()},{key:"assertVerificationMethod",value:function(){var e=h(f().m(function e(t){var r;return f().w(function(e){for(;;)switch(e.n){case 0:if(r=t.verificationMethod,P.hasValue(r,"type",this.requiredKeyType)){e.n=1;break}throw new Error('Invalid key type. Key type must be "'.concat(this.requiredKeyType,'".'));case 1:return e.a(2)}},e,this)}));function t(t){return e.apply(this,arguments)}return t}()},{key:"getVerificationMethod",value:function(){var e=h(f().m(function e(r){var n,i,o;return f().w(function(e){for(;;)switch(e.n){case 0:if(n=r.proof,i=r.documentLoader,!this.key){e.n=1;break}return e.a(2,this.key.publicNode());case 1:return e.n=2,w(t,"getVerificationMethod",this,3)([{proof:n,documentLoader:i}]);case 2:return o=e.v,e.n=3,this.assertVerificationMethod({verificationMethod:o});case 3:return e.a(2,o)}},e,this)}));function r(t){return e.apply(this,arguments)}return r}()},{key:"matchProof",value:function(){var e=h(f().m(function e(r){var i,o,a,s,u,c;return f().w(function(e){for(;;)switch(e.n){case 0:return i=r.proof,o=r.document,a=r.purpose,s=r.documentLoader,u=r.expansionMap,e.n=1,w(t,"matchProof",this,3)([{proof:i,document:o,purpose:a,documentLoader:s,expansionMap:u}]);case 1:if(e.v){e.n=2;break}return e.a(2,!1);case 2:if(this.key){e.n=3;break}return e.a(2,!0);case 3:if((c=i.verificationMethod)||(c=i.creator),"object"!==n(c)){e.n=4;break}return e.a(2,c.id===this.key.id);case 4:return e.a(2,c===this.key.id)}},e,this)}));function r(t){return e.apply(this,arguments)}return r}()}])}(O)},function(e,t,r){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function o(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach(function(t){a(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function a(e,t,r){return(t=d(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function s(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",i=r.toStringTag||"@@toStringTag";function o(r,n,i,o){var s=n&&n.prototype instanceof c?n:c,f=Object.create(s.prototype);return u(f,"_invoke",function(r,n,i){var o,s,u,c=0,f=i||[],l=!1,p={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function t(r,n){return o=r,s=0,u=e,p.n=n,a}};function h(r,n){for(s=r,u=n,t=0;!l&&c&&!i&&t<f.length;t++){var i,o=f[t],h=p.p,d=o[2];r>3?(i=d===n)&&(u=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=h&&((i=r<2&&h<o[1])?(s=0,p.v=n,p.n=o[1]):h<d&&(i=r<3||o[0]>n||n>d)&&(o[4]=r,o[5]=n,p.n=d,s=0))}if(i||r>1)return a;throw l=!0,n}return function(i,f,d){if(c>1)throw TypeError("Generator is already running");for(l&&1===f&&h(f,d),s=f,u=d;(t=s<2?e:u)||!l;){o||(s?s<3?(s>1&&(p.n=-1),h(s,u)):p.n=u:p.v=u);try{if(c=2,o){if(s||(i="next"),t=o[i]){if(!(t=t.call(o,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(u=TypeError("The iterator does not provide a '"+i+"' method"),s=1);o=e}else if((t=(l=p.n<0)?u:r.call(n,p))!==a)break}catch(t){o=e,s=1,u=t}finally{c=1}}return{value:t,done:l}}}(r,i,o),!0),f}var a={};function c(){}function f(){}function l(){}t=Object.getPrototypeOf;var p=[][n]?t(t([][n]())):(u(t={},n,function(){return this}),t),h=l.prototype=c.prototype=Object.create(p);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,u(e,i,"GeneratorFunction")),e.prototype=Object.create(h),e}return f.prototype=l,u(h,"constructor",l),u(l,"constructor",f),f.displayName="GeneratorFunction",u(l,i,"GeneratorFunction"),u(h),u(h,i,"Generator"),u(h,n,function(){return this}),u(h,"toString",function(){return"[object Generator]"}),(s=function e(){return{w:o,m:d}})()}function u(e,t,r,n){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}u=function e(t,r,n,o){function a(e,r){u(t,e,function(t){return this._invoke(e,r,t)})}r?i?i(t,r,{value:n,enumerable:!o,configurable:!o,writable:!o}):t[r]=n:(a("next",0),a("throw",1),a("return",2))},u(e,t,r,n)}function c(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function f(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var o=e.apply(t,r);function a(e){c(o,n,i,a,s,"next",e)}function s(e){c(o,n,i,a,s,"throw",e)}a(void 0)})}}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function p(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,d(n.key),n)}}function h(e,t,r){return t&&p(e.prototype,t),r&&p(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function d(e){var t=y(e,"string");return"symbol"==n(t)?t:t+""}function y(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function g(e,t,r){return t=E(t),v(e,b()?Reflect.construct(t,r||[],E(e).constructor):t.apply(e,r))}function v(e,t){if(t&&("object"==n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return m(e)}function m(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function b(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(b=function t(){return!!e})()}function E(e){return E=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},E(e)}function T(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&S(e,t)}function S(e,t){return S=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},S(e,t)}var w=r(66),C=r(67),_=r(132),I=r(150);e.exports=function(e){function t(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=r.type,i=r.creator,o=r.verificationMethod,a=r.proof,s=r.date,u=r.useNativeCanonize;if(l(this,t),void 0!==o&&"string"!=typeof o)throw new TypeError('"verificationMethod" must be a URL string.');if((e=g(this,t,[{type:n}])).creator=i,e.verificationMethod=o,e.proof=a,void 0!==s&&(e.date=new Date(s),isNaN(e.date)))throw TypeError('"date" "'.concat(s,'" is not a valid date.'));return e.useNativeCanonize=u,e}return T(t,e),h(t,[{key:"createProof",value:function(){var e=f(s().m(function e(t){var r,n,i,o,a,u,c,f;return s().w(function(e){for(;;)switch(e.n){case 0:if(r=t.document,n=t.purpose,i=t.documentLoader,o=t.expansionMap,a=t.compactProof,!this.proof){e.n=2;break}return e.n=1,C.compact(this.proof,w.SECURITY_CONTEXT_URL,{documentLoader:i,expansionMap:o,compactToRelative:!1});case 1:u=e.v,e.n=3;break;case 2:u={"@context":w.SECURITY_CONTEXT_URL};case 3:return u.type=this.type,c=this.date,void 0===u.created&&void 0===c&&(c=new Date),void 0!==c&&"string"!=typeof c&&(c=_.w3cDate(c)),void 0!==c&&(u.created=c),void 0!==this.verificationMethod&&(u.verificationMethod=this.verificationMethod),void 0!==this.creator&&(u.creator=this.creator),e.n=4,this.updateProof({document:r,proof:u,purpose:n,documentLoader:i,expansionMap:o,compactProof:a});case 4:return u=e.v,e.n=5,n.update(u,{document:r,suite:this,documentLoader:i,expansionMap:o});case 5:return u=e.v,e.n=6,this.createVerifyData({document:r,proof:u,documentLoader:i,expansionMap:o,compactProof:a});case 6:return f=e.v,e.n=7,this.sign({verifyData:f,document:r,proof:u,documentLoader:i,expansionMap:o});case 7:return u=e.v,e.a(2,u)}},e,this)}));function t(t){return e.apply(this,arguments)}return t}()},{key:"updateProof",value:function(){var e=f(s().m(function e(t){var r;return s().w(function(e){for(;;)if(0===e.n)return r=t.proof,e.a(2,r)},e)}));function t(t){return e.apply(this,arguments)}return t}()},{key:"verifyProof",value:function(){var e=f(s().m(function e(t){var r,n,i,o,a,u,c,f,l,p,h;return s().w(function(e){for(;;)switch(e.p=e.n){case 0:return r=t.proof,n=t.document,i=t.purpose,o=t.documentLoader,a=t.expansionMap,u=t.compactProof,e.p=1,e.n=2,this.createVerifyData({document:n,proof:r,documentLoader:o,expansionMap:a,compactProof:u});case 2:return c=e.v,e.n=3,this.getVerificationMethod({proof:r,document:n,documentLoader:o,expansionMap:a});case 3:return f=e.v,e.n=4,this.verifySignature({verifyData:c,verificationMethod:f,document:n,proof:r,documentLoader:o,expansionMap:a});case 4:if(l=e.v){e.n=5;break}throw new Error("Invalid signature.");case 5:return e.n=6,i.validate(r,{document:n,suite:this,verificationMethod:f,documentLoader:o,expansionMap:a});case 6:if((p=e.v).valid){e.n=7;break}throw p.error;case 7:return e.a(2,{verified:!0,purposeResult:p});case 8:return e.p=8,h=e.v,e.a(2,{verified:!1,error:h})}},e,this,[[1,8]])}));function t(t){return e.apply(this,arguments)}return t}()},{key:"canonize",value:function(){var e=f(s().m(function e(t,r){var n,i,o;return s().w(function(e){for(;;)if(0===e.n)return n=r.documentLoader,i=r.expansionMap,o=r.skipExpansion,e.a(2,C.canonize(t,{algorithm:"URDNA2015",format:"application/n-quads",documentLoader:n,expansionMap:i,skipExpansion:o,useNative:this.useNativeCanonize}))},e,this)}));function t(t,r){return e.apply(this,arguments)}return t}()},{key:"canonizeProof",value:function(){var e=f(s().m(function e(t,r){var n,i;return s().w(function(e){for(;;)if(0===e.n)return n=r.documentLoader,i=r.expansionMap,delete(t=o({},t)).jws,delete t.signatureValue,delete t.proofValue,e.a(2,this.canonize(t,{documentLoader:n,expansionMap:i,skipExpansion:!1}))},e,this)}));function t(t,r){return e.apply(this,arguments)}return t}()},{key:"createVerifyData",value:function(){var e=f(s().m(function e(t){var r,n,i,o,a,u;return s().w(function(e){for(;;)switch(e.n){case 0:return r=t.document,n=t.proof,i=t.documentLoader,o=t.expansionMap,e.n=1,this.canonizeProof(n,{documentLoader:i,expansionMap:o});case 1:return a=e.v,e.n=2,this.canonize(r,{documentLoader:i,expansionMap:o});case 2:return u=e.v,e.a(2,_.concat(_.sha256(a),_.sha256(u)))}},e,this)}));function t(t){return e.apply(this,arguments)}return t}()},{key:"getVerificationMethod",value:function(){var e=f(s().m(function e(t){var r,i,o,a,u;return s().w(function(e){for(;;)switch(e.n){case 0:if(r=t.proof,i=t.documentLoader,(o=r.verificationMethod)||(a=r.creator,o=a),"object"===n(o)&&(o=o.id),o){e.n=1;break}throw new Error('No "verificationMethod" or "creator" found in proof.');case 1:return e.n=2,C.frame(o,{"@context":w.SECURITY_CONTEXT_URL,"@embed":"@always",id:o},{documentLoader:i,compactToRelative:!1});case 2:if(u=e.v){e.n=3;break}throw new Error("Verification method ".concat(o," not found."));case 3:if(void 0===u.revoked){e.n=4;break}throw new Error("The verification method has been revoked.");case 4:return e.a(2,u)}},e)}));function t(t){return e.apply(this,arguments)}return t}()},{key:"sign",value:function(){var e=f(s().m(function e(){return s().w(function(e){for(;;)switch(e.n){case 0:throw new Error("Must be implemented by a derived class.");case 1:return e.a(2)}},e)}));function t(){return e.apply(this,arguments)}return t}()},{key:"verifySignature",value:function(){var e=f(s().m(function e(){return s().w(function(e){for(;;)switch(e.n){case 0:throw new Error("Must be implemented by a derived class.");case 1:return e.a(2)}},e)}));function t(){return e.apply(this,arguments)}return t}()}])}(I)},function(e,t,r){"use strict";(function(e){var n=r(185),i=r(186),o=r(187);function a(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}function s(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function u(e,t){if(s()<t)throw new RangeError("Invalid typed array length");return c.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=c.prototype:(null===e&&(e=new c(t)),e.length=t),e}function c(e,t,r){if(!(c.TYPED_ARRAY_SUPPORT||this instanceof c))return new c(e,t,r);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return h(this,e)}return f(this,e,t,r)}function f(e,t,r,n){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?g(e,t,r,n):"string"==typeof t?d(e,t,r):v(e,t)}function l(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function p(e,t,r,n){return l(t),t<=0?u(e,t):void 0!==r?"string"==typeof n?u(e,t).fill(r,n):u(e,t).fill(r):u(e,t)}function h(e,t){if(l(t),e=u(e,t<0?0:0|m(t)),!c.TYPED_ARRAY_SUPPORT)for(var r=0;r<t;++r)e[r]=0;return e}function d(e,t,r){if("string"==typeof r&&""!==r||(r="utf8"),!c.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|E(t,r),i=(e=u(e,n)).write(t,r);return i!==n&&(e=e.slice(0,i)),e}function y(e,t){var r=t.length<0?0:0|m(t.length);e=u(e,r);for(var n=0;n<r;n+=1)e[n]=255&t[n];return e}function g(e,t,r,n){if(t.byteLength,r<0||t.byteLength<r)throw new RangeError("'offset' is out of bounds");if(t.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");return t=void 0===r&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,r):new Uint8Array(t,r,n),c.TYPED_ARRAY_SUPPORT?(e=t).__proto__=c.prototype:e=y(e,t),e}function v(e,t){if(c.isBuffer(t)){var r=0|m(t.length);return 0===(e=u(e,r)).length||t.copy(e,0,0,r),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||te(t.length)?u(e,0):y(e,t);if("Buffer"===t.type&&o(t.data))return y(e,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function m(e){if(e>=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|e}function b(e){return+e!=e&&(e=0),c.alloc(+e)}function E(e,t){if(c.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return X(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return J(e).length;default:if(n)return X(e).length;t=(""+t).toLowerCase(),n=!0}}function T(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return L(this,t,r);case"utf8":case"utf-8":return k(this,t,r);case"ascii":return D(this,t,r);case"latin1":case"binary":return x(this,t,r);case"base64":return B(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function S(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function w(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=c.from(t,n)),c.isBuffer(t))return 0===t.length?-1:C(e,t,r,n,i);if("number"==typeof t)return t&=255,c.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):C(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function C(e,t,r,n,i){var o=1,a=e.length,s=t.length,u;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;o=2,a/=2,s/=2,r/=2}function c(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i){var f=-1;for(u=r;u<a;u++)if(c(e,u)===c(t,-1===f?0:u-f)){if(-1===f&&(f=u),u-f+1===s)return f*o}else-1!==f&&(u-=u-f),f=-1}else for(r+s>a&&(r=a-s),u=r;u>=0;u--){for(var l=!0,p=0;p<s;p++)if(c(e,u+p)!==c(t,p)){l=!1;break}if(l)return u}return-1}function _(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a<n;++a){var s=parseInt(t.substr(2*a,2),16);if(isNaN(s))return a;e[r+a]=s}return a}function I(e,t,r,n){return ee(X(t,e.length-r),e,r,n)}function A(e,t,r,n){return ee(Z(t),e,r,n)}function R(e,t,r,n){return A(e,t,r,n)}function O(e,t,r,n){return ee(J(t),e,r,n)}function P(e,t,r,n){return ee($(t,e.length-r),e,r,n)}function B(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function k(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var o=e[i],a=null,s=o>239?4:o>223?3:o>191?2:1,u,c,f,l;if(i+s<=r)switch(s){case 1:o<128&&(a=o);break;case 2:128==(192&(u=e[i+1]))&&(l=(31&o)<<6|63&u)>127&&(a=l);break;case 3:u=e[i+1],c=e[i+2],128==(192&u)&&128==(192&c)&&(l=(15&o)<<12|(63&u)<<6|63&c)>2047&&(l<55296||l>57343)&&(a=l);break;case 4:u=e[i+1],c=e[i+2],f=e[i+3],128==(192&u)&&128==(192&c)&&128==(192&f)&&(l=(15&o)<<18|(63&u)<<12|(63&c)<<6|63&f)>65535&&l<1114112&&(a=l)}null===a?(a=65533,s=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|1023&a),n.push(a),i+=s}return U(n)}t.Buffer=c,t.SlowBuffer=b,t.INSPECT_MAX_BYTES=50,c.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:a(),t.kMaxLength=s(),c.poolSize=8192,c._augment=function(e){return e.__proto__=c.prototype,e},c.from=function(e,t,r){return f(null,e,t,r)},c.TYPED_ARRAY_SUPPORT&&(c.prototype.__proto__=Uint8Array.prototype,c.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&c[Symbol.species]===c&&Object.defineProperty(c,Symbol.species,{value:null,configurable:!0})),c.alloc=function(e,t,r){return p(null,e,t,r)},c.allocUnsafe=function(e){return h(null,e)},c.allocUnsafeSlow=function(e){return h(null,e)},c.isBuffer=function e(t){return!(null==t||!t._isBuffer)},c.compare=function e(t,r){if(!c.isBuffer(t)||!c.isBuffer(r))throw new TypeError("Arguments must be Buffers");if(t===r)return 0;for(var n=t.length,i=r.length,o=0,a=Math.min(n,i);o<a;++o)if(t[o]!==r[o]){n=t[o],i=r[o];break}return n<i?-1:i<n?1:0},c.isEncoding=function e(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}},c.concat=function e(t,r){if(!o(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return c.alloc(0);var n;if(void 0===r)for(r=0,n=0;n<t.length;++n)r+=t[n].length;var i=c.allocUnsafe(r),a=0;for(n=0;n<t.length;++n){var s=t[n];if(!c.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(i,a),a+=s.length}return i},c.byteLength=E,c.prototype._isBuffer=!0,c.prototype.swap16=function e(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r<t;r+=2)S(this,r,r+1);return this},c.prototype.swap32=function e(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var r=0;r<t;r+=4)S(this,r,r+3),S(this,r+1,r+2);return this},c.prototype.swap64=function e(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var r=0;r<t;r+=8)S(this,r,r+7),S(this,r+1,r+6),S(this,r+2,r+5),S(this,r+3,r+4);return this},c.prototype.toString=function e(){var t=0|this.length;return 0===t?"":0===arguments.length?k(this,0,t):T.apply(this,arguments)},c.prototype.equals=function e(t){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===c.compare(this,t)},c.prototype.inspect=function e(){var r="",n=t.INSPECT_MAX_BYTES;return this.length>0&&(r=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(r+=" ... ")),"<Buffer "+r+">"},c.prototype.compare=function e(t,r,n,i,o){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===r&&(r=0),void 0===n&&(n=t?t.length:0),void 0===i&&(i=0),void 0===o&&(o=this.length),r<0||n>t.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&r>=n)return 0;if(i>=o)return-1;if(r>=n)return 1;if(this===t)return 0;for(var a=(o>>>=0)-(i>>>=0),s=(n>>>=0)-(r>>>=0),u=Math.min(a,s),f=this.slice(i,o),l=t.slice(r,n),p=0;p<u;++p)if(f[p]!==l[p]){a=f[p],s=l[p];break}return a<s?-1:s<a?1:0},c.prototype.includes=function e(t,r,n){return-1!==this.indexOf(t,r,n)},c.prototype.indexOf=function e(t,r,n){return w(this,t,r,n,!0)},c.prototype.lastIndexOf=function e(t,r,n){return w(this,t,r,n,!1)},c.prototype.write=function e(t,r,n,i){if(void 0===r)i="utf8",n=this.length,r=0;else if(void 0===n&&"string"==typeof r)i=r,n=this.length,r=0;else{if(!isFinite(r))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");r|=0,isFinite(n)?(n|=0,void 0===i&&(i="utf8")):(i=n,n=void 0)}var o=this.length-r;if((void 0===n||n>o)&&(n=o),t.length>0&&(n<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var a=!1;;)switch(i){case"hex":return _(this,t,r,n);case"utf8":case"utf-8":return I(this,t,r,n);case"ascii":return A(this,t,r,n);case"latin1":case"binary":return R(this,t,r,n);case"base64":return O(this,t,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,t,r,n);default:if(a)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),a=!0}},c.prototype.toJSON=function e(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var N=4096;function U(e){var t=e.length;if(t<=N)return String.fromCharCode.apply(String,e);for(var r="",n=0;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=N));return r}function D(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function x(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function L(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=t;o<r;++o)i+=Q(e[o]);return i}function j(e,t,r){for(var n=e.slice(t,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function M(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function V(e,t,r,n,i,o){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function F(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-r,2);i<o;++i)e[r+i]=(t&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function K(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-r,4);i<o;++i)e[r+i]=t>>>8*(n?i:3-i)&255}function H(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function q(e,t,r,n,o){return o||H(e,t,r,4,34028234663852886e22,-34028234663852886e22),i.write(e,t,r,n,23,4),r+4}function G(e,t,r,n,o){return o||H(e,t,r,8,17976931348623157e292,-17976931348623157e292),i.write(e,t,r,n,52,8),r+8}c.prototype.slice=function e(t,r){var n=this.length,i;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(r=void 0===r?n:~~r)<0?(r+=n)<0&&(r=0):r>n&&(r=n),r<t&&(r=t),c.TYPED_ARRAY_SUPPORT)(i=this.subarray(t,r)).__proto__=c.prototype;else{var o=r-t;i=new c(o,void 0);for(var a=0;a<o;++a)i[a]=this[a+t]}return i},c.prototype.readUIntLE=function e(t,r,n){t|=0,r|=0,n||M(t,r,this.length);for(var i=this[t],o=1,a=0;++a<r&&(o*=256);)i+=this[t+a]*o;return i},c.prototype.readUIntBE=function e(t,r,n){t|=0,r|=0,n||M(t,r,this.length);for(var i=this[t+--r],o=1;r>0&&(o*=256);)i+=this[t+--r]*o;return i},c.prototype.readUInt8=function e(t,r){return r||M(t,1,this.length),this[t]},c.prototype.readUInt16LE=function e(t,r){return r||M(t,2,this.length),this[t]|this[t+1]<<8},c.prototype.readUInt16BE=function e(t,r){return r||M(t,2,this.length),this[t]<<8|this[t+1]},c.prototype.readUInt32LE=function e(t,r){return r||M(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},c.prototype.readUInt32BE=function e(t,r){return r||M(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},c.prototype.readIntLE=function e(t,r,n){t|=0,r|=0,n||M(t,r,this.length);for(var i=this[t],o=1,a=0;++a<r&&(o*=256);)i+=this[t+a]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*r)),i},c.prototype.readIntBE=function e(t,r,n){t|=0,r|=0,n||M(t,r,this.length);for(var i=r,o=1,a=this[t+--i];i>0&&(o*=256);)a+=this[t+--i]*o;return a>=(o*=128)&&(a-=Math.pow(2,8*r)),a},c.prototype.readInt8=function e(t,r){return r||M(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},c.prototype.readInt16LE=function e(t,r){r||M(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt16BE=function e(t,r){r||M(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt32LE=function e(t,r){return r||M(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},c.prototype.readInt32BE=function e(t,r){return r||M(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},c.prototype.readFloatLE=function e(t,r){return r||M(t,4,this.length),i.read(this,t,!0,23,4)},c.prototype.readFloatBE=function e(t,r){return r||M(t,4,this.length),i.read(this,t,!1,23,4)},c.prototype.readDoubleLE=function e(t,r){return r||M(t,8,this.length),i.read(this,t,!0,52,8)},c.prototype.readDoubleBE=function e(t,r){return r||M(t,8,this.length),i.read(this,t,!1,52,8)},c.prototype.writeUIntLE=function e(t,r,n,i){var o;(t=+t,r|=0,n|=0,i)||V(this,t,r,n,Math.pow(2,8*n)-1,0);var a=1,s=0;for(this[r]=255&t;++s<n&&(a*=256);)this[r+s]=t/a&255;return r+n},c.prototype.writeUIntBE=function e(t,r,n,i){var o;(t=+t,r|=0,n|=0,i)||V(this,t,r,n,Math.pow(2,8*n)-1,0);var a=n-1,s=1;for(this[r+a]=255&t;--a>=0&&(s*=256);)this[r+a]=t/s&255;return r+n},c.prototype.writeUInt8=function e(t,r,n){return t=+t,r|=0,n||V(this,t,r,1,255,0),c.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[r]=255&t,r+1},c.prototype.writeUInt16LE=function e(t,r,n){return t=+t,r|=0,n||V(this,t,r,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):F(this,t,r,!0),r+2},c.prototype.writeUInt16BE=function e(t,r,n){return t=+t,r|=0,n||V(this,t,r,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):F(this,t,r,!1),r+2},c.prototype.writeUInt32LE=function e(t,r,n){return t=+t,r|=0,n||V(this,t,r,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=255&t):K(this,t,r,!0),r+4},c.prototype.writeUInt32BE=function e(t,r,n){return t=+t,r|=0,n||V(this,t,r,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):K(this,t,r,!1),r+4},c.prototype.writeIntLE=function e(t,r,n,i){if(t=+t,r|=0,!i){var o=Math.pow(2,8*n-1);V(this,t,r,n,o-1,-o)}var a=0,s=1,u=0;for(this[r]=255&t;++a<n&&(s*=256);)t<0&&0===u&&0!==this[r+a-1]&&(u=1),this[r+a]=(t/s|0)-u&255;return r+n},c.prototype.writeIntBE=function e(t,r,n,i){if(t=+t,r|=0,!i){var o=Math.pow(2,8*n-1);V(this,t,r,n,o-1,-o)}var a=n-1,s=1,u=0;for(this[r+a]=255&t;--a>=0&&(s*=256);)t<0&&0===u&&0!==this[r+a+1]&&(u=1),this[r+a]=(t/s|0)-u&255;return r+n},c.prototype.writeInt8=function e(t,r,n){return t=+t,r|=0,n||V(this,t,r,1,127,-128),c.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[r]=255&t,r+1},c.prototype.writeInt16LE=function e(t,r,n){return t=+t,r|=0,n||V(this,t,r,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):F(this,t,r,!0),r+2},c.prototype.writeInt16BE=function e(t,r,n){return t=+t,r|=0,n||V(this,t,r,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):F(this,t,r,!1),r+2},c.prototype.writeInt32LE=function e(t,r,n){return t=+t,r|=0,n||V(this,t,r,4,2147483647,-2147483648),c.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24):K(this,t,r,!0),r+4},c.prototype.writeInt32BE=function e(t,r,n){return t=+t,r|=0,n||V(this,t,r,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),c.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):K(this,t,r,!1),r+4},c.prototype.writeFloatLE=function e(t,r,n){return q(this,t,r,!0,n)},c.prototype.writeFloatBE=function e(t,r,n){return q(this,t,r,!1,n)},c.prototype.writeDoubleLE=function e(t,r,n){return G(this,t,r,!0,n)},c.prototype.writeDoubleBE=function e(t,r,n){return G(this,t,r,!1,n)},c.prototype.copy=function e(t,r,n,i){if(n||(n=0),i||0===i||(i=this.length),r>=t.length&&(r=t.length),r||(r=0),i>0&&i<n&&(i=n),i===n)return 0;if(0===t.length||0===this.length)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-r<i-n&&(i=t.length-r+n);var o=i-n,a;if(this===t&&n<r&&r<i)for(a=o-1;a>=0;--a)t[a+r]=this[a+n];else if(o<1e3||!c.TYPED_ARRAY_SUPPORT)for(a=0;a<o;++a)t[a+r]=this[a+n];else Uint8Array.prototype.set.call(t,this.subarray(n,n+o),r);return o},c.prototype.fill=function e(t,r,n,i){if("string"==typeof t){if("string"==typeof r?(i=r,r=0,n=this.length):"string"==typeof n&&(i=n,n=this.length),1===t.length){var o=t.charCodeAt(0);o<256&&(t=o)}if(void 0!==i&&"string"!=typeof i)throw new TypeError("encoding must be a string");if("string"==typeof i&&!c.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}else"number"==typeof t&&(t&=255);if(r<0||this.length<r||this.length<n)throw new RangeError("Out of range index");if(n<=r)return this;var a;if(r>>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(a=r;a<n;++a)this[a]=t;else{var s=c.isBuffer(t)?t:X(new c(t,i).toString()),u=s.length;for(a=0;a<n-r;++a)this[a+r]=s[a%u]}return this};var z=/[^+\/0-9A-Za-z-_]/g;function Y(e){if((e=W(e).replace(z,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}function W(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function Q(e){return e<16?"0"+e.toString(16):e.toString(16)}function X(e,t){var r;t=t||1/0;for(var n=e.length,i=null,o=[],a=0;a<n;++a){if((r=e.charCodeAt(a))>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function Z(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}function $(e,t){for(var r,n,i,o=[],a=0;a<e.length&&!((t-=2)<0);++a)n=(r=e.charCodeAt(a))>>8,i=r%256,o.push(i),o.push(n);return o}function J(e){return n.toByteArray(Y(e))}function ee(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function te(e){return e!=e}}).call(this,r(29))},function(e,t,r){e.exports=r(4),r(48),r(190),r(33),r(118),r(147),r(75),r(192),r(68),r(194),r(149),r(195),r(146),r(120),r(51),r(142),r(144),r(196),r(137),r(143),r(140),r(123),r(31),r(141),r(197),r(198),r(136),r(8)},function(e,t,r){var n=r(4);r(8),e.exports=n.cipher=n.cipher||{},n.cipher.algorithms=n.cipher.algorithms||{},n.cipher.createCipher=function(e,t){var r=e;if("string"==typeof r&&(r=n.cipher.getAlgorithm(r))&&(r=r()),!r)throw new Error("Unsupported algorithm: "+e);return new n.cipher.BlockCipher({algorithm:r,key:t,decrypt:!1})},n.cipher.createDecipher=function(e,t){var r=e;if("string"==typeof r&&(r=n.cipher.getAlgorithm(r))&&(r=r()),!r)throw new Error("Unsupported algorithm: "+e);return new n.cipher.BlockCipher({algorithm:r,key:t,decrypt:!0})},n.cipher.registerAlgorithm=function(e,t){e=e.toUpperCase(),n.cipher.algorithms[e]=t},n.cipher.getAlgorithm=function(e){return(e=e.toUpperCase())in n.cipher.algorithms?n.cipher.algorithms[e]:null};var i=n.cipher.BlockCipher=function(e){this.algorithm=e.algorithm,this.mode=this.algorithm.mode,this.blockSize=this.mode.blockSize,this._finish=!1,this._input=null,this.output=null,this._op=e.decrypt?this.mode.decrypt:this.mode.encrypt,this._decrypt=e.decrypt,this.algorithm.initialize(e)};i.prototype.start=function(e){e=e||{};var t={};for(var r in e)t[r]=e[r];t.decrypt=this._decrypt,this._finish=!1,this._input=n.util.createBuffer(),this.output=e.output||n.util.createBuffer(),this.mode.start(t)},i.prototype.update=function(e){for(e&&this._input.putBuffer(e);!this._op.call(this.mode,this._input,this.output,this._finish)&&!this._finish;);this._input.compact()},i.prototype.finish=function(e){!e||"ECB"!==this.mode.name&&"CBC"!==this.mode.name||(this.mode.pad=function(t){return e(this.blockSize,t,!1)},this.mode.unpad=function(t){return e(this.blockSize,t,!0)});var t={};return t.decrypt=this._decrypt,t.overflow=this._input.length()%this.blockSize,!(!this._decrypt&&this.mode.pad&&!this.mode.pad(this._input,t))&&(this._finish=!0,this.update(),!(this._decrypt&&this.mode.unpad&&!this.mode.unpad(this.output,t))&&!(this.mode.afterFinish&&!this.mode.afterFinish(this.output,t)))}},function(e,t,r){var n=r(4);r(37),r(8);var i=e.exports=n.md5=n.md5||{};n.md.md5=n.md.algorithms.md5=i,i.create=function(){c||f();var e=null,t=n.util.createBuffer(),r=new Array(16),i={algorithm:"md5",blockLength:64,digestLength:16,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){i.messageLength=0,i.fullMessageLength=i.messageLength64=[];for(var r=i.messageLengthSize/4,o=0;o<r;++o)i.fullMessageLength.push(0);return t=n.util.createBuffer(),e={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878},i}};return i.start(),i.update=function(o,a){"utf8"===a&&(o=n.util.encodeUtf8(o));var s=o.length;i.messageLength+=s,s=[s/4294967296>>>0,s>>>0];for(var u=i.fullMessageLength.length-1;u>=0;--u)i.fullMessageLength[u]+=s[1],s[1]=s[0]+(i.fullMessageLength[u]/4294967296>>>0),i.fullMessageLength[u]=i.fullMessageLength[u]>>>0,s[0]=s[1]/4294967296>>>0;return t.putBytes(o),l(e,r,t),(t.read>2048||0===t.length())&&t.compact(),i},i.digest=function(){var a=n.util.createBuffer();a.putBytes(t.bytes());var s,u=i.fullMessageLength[i.fullMessageLength.length-1]+i.messageLengthSize&i.blockLength-1;a.putBytes(o.substr(0,i.blockLength-u));for(var c,f=0,p=i.fullMessageLength.length-1;p>=0;--p)f=(c=8*i.fullMessageLength[p]+f)/4294967296>>>0,a.putInt32Le(c>>>0);var h={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3};l(h,r,a);var d=n.util.createBuffer();return d.putInt32Le(h.h0),d.putInt32Le(h.h1),d.putInt32Le(h.h2),d.putInt32Le(h.h3),d},i};var o=null,a=null,s=null,u=null,c=!1;function f(){o=String.fromCharCode(128),o+=n.util.fillString(String.fromCharCode(0),64),a=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,1,6,11,0,5,10,15,4,9,14,3,8,13,2,7,12,5,8,11,14,1,4,7,10,13,0,3,6,9,12,15,2,0,7,14,5,12,3,10,1,8,15,6,13,4,11,2,9],s=[7,12,17,22,7,12,17,22,7,12,17,22,7,12,17,22,5,9,14,20,5,9,14,20,5,9,14,20,5,9,14,20,4,11,16,23,4,11,16,23,4,11,16,23,4,11,16,23,6,10,15,21,6,10,15,21,6,10,15,21,6,10,15,21],u=new Array(64);for(var e=0;e<64;++e)u[e]=Math.floor(4294967296*Math.abs(Math.sin(e+1)));c=!0}function l(e,t,r){for(var n,i,o,c,f,l,p,h,d=r.length();d>=64;){for(i=e.h0,o=e.h1,c=e.h2,f=e.h3,h=0;h<16;++h)t[h]=r.getInt32Le(),n=i+(l=f^o&(c^f))+u[h]+t[h],i=f,f=c,c=o,o+=n<<(p=s[h])|n>>>32-p;for(;h<32;++h)n=i+(l=c^f&(o^c))+u[h]+t[a[h]],i=f,f=c,c=o,o+=n<<(p=s[h])|n>>>32-p;for(;h<48;++h)n=i+(l=o^c^f)+u[h]+t[a[h]],i=f,f=c,c=o,o+=n<<(p=s[h])|n>>>32-p;for(;h<64;++h)n=i+(l=c^(o|~f))+u[h]+t[a[h]],i=f,f=c,c=o,o+=n<<(p=s[h])|n>>>32-p;e.h0=e.h0+i|0,e.h1=e.h1+o|0,e.h2=e.h2+c|0,e.h3=e.h3+f|0,d-=64}}},function(e,t,r){(function(t){var n=r(4);r(68),r(37),r(8);var i=n.pkcs5=n.pkcs5||{},o;n.util.isNodejs&&!n.options.usePureJavaScript&&(o=r(121)),e.exports=n.pbkdf2=i.pbkdf2=function(e,r,i,a,s,u){if("function"==typeof s&&(u=s,s=null),n.util.isNodejs&&!n.options.usePureJavaScript&&o.pbkdf2&&(null===s||"object"!=typeof s)&&(o.pbkdf2Sync.length>4||!s||"sha1"===s))return"string"!=typeof s&&(s="sha1"),e=t.from(e,"binary"),r=t.from(r,"binary"),u?4===o.pbkdf2Sync.length?o.pbkdf2(e,r,i,a,function(e,t){if(e)return u(e);u(null,t.toString("binary"))}):o.pbkdf2(e,r,i,a,s,function(e,t){if(e)return u(e);u(null,t.toString("binary"))}):4===o.pbkdf2Sync.length?o.pbkdf2Sync(e,r,i,a).toString("binary"):o.pbkdf2Sync(e,r,i,a,s).toString("binary");if(null==s&&(s="sha1"),"string"==typeof s){if(!(s in n.md.algorithms))throw new Error("Unknown hash algorithm: "+s);s=n.md[s].create()}var c=s.digestLength;if(a>4294967295*c){var f=new Error("Derived key is too long.");if(u)return u(f);throw f}var l=Math.ceil(a/c),p=a-(l-1)*c,h=n.hmac.create();h.start(s,e);var d="",y,g,v;if(!u){for(var m=1;m<=l;++m){h.start(null,null),h.update(r),h.update(n.util.int32ToBytes(m)),y=v=h.digest().getBytes();for(var b=2;b<=i;++b)h.start(null,null),h.update(v),g=h.digest().getBytes(),y=n.util.xorBytes(y,g,c),v=g;d+=m<l?y:y.substr(0,p)}return d}var m=1,b;function E(){if(m>l)return u(null,d);h.start(null,null),h.update(r),h.update(n.util.int32ToBytes(m)),y=v=h.digest().getBytes(),b=2,T()}function T(){if(b<=i)return h.start(null,null),h.update(v),g=h.digest().getBytes(),y=n.util.xorBytes(y,g,c),v=g,++b,n.util.setImmediate(T);d+=m<l?y:y.substr(0,p),++m,E()}E()}}).call(this,r(74).Buffer)},function(e,t){},function(e,t,r){var n=r(4);r(48),r(33),r(75),r(37),r(191),r(49),r(51),r(123),r(76),r(8);var i=n.asn1,o=e.exports=n.pki=n.pki||{},a=o.oids,s={};s.CN=a.commonName,s.commonName="CN",s.C=a.countryName,s.countryName="C",s.L=a.localityName,s.localityName="L",s.ST=a.stateOrProvinceName,s.stateOrProvinceName="ST",s.O=a.organizationName,s.organizationName="O",s.OU=a.organizationalUnitName,s.organizationalUnitName="OU",s.E=a.emailAddress,s.emailAddress="E";var u=n.pki.rsa.publicKeyValidator,c={name:"Certificate",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"tbsCertificate",value:[{name:"Certificate.TBSCertificate.version",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.version.integer",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"certVersion"}]},{name:"Certificate.TBSCertificate.serialNumber",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"certSerialNumber"},{name:"Certificate.TBSCertificate.signature",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.signature.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"certinfoSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:i.Class.UNIVERSAL,optional:!0,captureAsn1:"certinfoSignatureParams"}]},{name:"Certificate.TBSCertificate.issuer",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"certIssuer"},{name:"Certificate.TBSCertificate.validity",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.validity.notBefore (utc)",tagClass:i.Class.UNIVERSAL,type:i.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity1UTCTime"},{name:"Certificate.TBSCertificate.validity.notBefore (generalized)",tagClass:i.Class.UNIVERSAL,type:i.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity2GeneralizedTime"},{name:"Certificate.TBSCertificate.validity.notAfter (utc)",tagClass:i.Class.UNIVERSAL,type:i.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity3UTCTime"},{name:"Certificate.TBSCertificate.validity.notAfter (generalized)",tagClass:i.Class.UNIVERSAL,type:i.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity4GeneralizedTime"}]},{name:"Certificate.TBSCertificate.subject",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"certSubject"},u,{name:"Certificate.TBSCertificate.issuerUniqueID",tagClass:i.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.issuerUniqueID.id",tagClass:i.Class.UNIVERSAL,type:i.Type.BITSTRING,constructed:!1,captureBitStringValue:"certIssuerUniqueId"}]},{name:"Certificate.TBSCertificate.subjectUniqueID",tagClass:i.Class.CONTEXT_SPECIFIC,type:2,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.subjectUniqueID.id",tagClass:i.Class.UNIVERSAL,type:i.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSubjectUniqueId"}]},{name:"Certificate.TBSCertificate.extensions",tagClass:i.Class.CONTEXT_SPECIFIC,type:3,constructed:!0,captureAsn1:"certExtensions",optional:!0}]},{name:"Certificate.signatureAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.signatureAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"certSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:i.Class.UNIVERSAL,optional:!0,captureAsn1:"certSignatureParams"}]},{name:"Certificate.signatureValue",tagClass:i.Class.UNIVERSAL,type:i.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSignature"}]},f={name:"rsapss",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.hashAlgorithm",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier",tagClass:i.Class.UNIVERSAL,type:i.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"hashOid"}]}]},{name:"rsapss.maskGenAlgorithm",tagClass:i.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier",tagClass:i.Class.UNIVERSAL,type:i.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"maskGenOid"},{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"maskGenHashOid"}]}]}]},{name:"rsapss.saltLength",tagClass:i.Class.CONTEXT_SPECIFIC,type:2,optional:!0,value:[{name:"rsapss.saltLength.saltLength",tagClass:i.Class.UNIVERSAL,type:i.Class.INTEGER,constructed:!1,capture:"saltLength"}]},{name:"rsapss.trailerField",tagClass:i.Class.CONTEXT_SPECIFIC,type:3,optional:!0,value:[{name:"rsapss.trailer.trailer",tagClass:i.Class.UNIVERSAL,type:i.Class.INTEGER,constructed:!1,capture:"trailer"}]}]},l={name:"CertificationRequestInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfo",value:[{name:"CertificationRequestInfo.integer",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"certificationRequestInfoVersion"},{name:"CertificationRequestInfo.subject",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfoSubject"},u,{name:"CertificationRequestInfo.attributes",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"certificationRequestInfoAttributes",value:[{name:"CertificationRequestInfo.attributes",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequestInfo.attributes.type",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1},{name:"CertificationRequestInfo.attributes.value",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0}]}]}]},p={name:"CertificationRequest",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"csr",value:[l,{name:"CertificationRequest.signatureAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequest.signatureAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"csrSignatureOid"},{name:"CertificationRequest.signatureAlgorithm.parameters",tagClass:i.Class.UNIVERSAL,optional:!0,captureAsn1:"csrSignatureParams"}]},{name:"CertificationRequest.signature",tagClass:i.Class.UNIVERSAL,type:i.Type.BITSTRING,constructed:!1,captureBitStringValue:"csrSignature"}]};function h(e,t){"string"==typeof t&&(t={shortName:t});for(var r=null,n,i=0;null===r&&i<e.attributes.length;++i)n=e.attributes[i],(t.type&&t.type===n.type||t.name&&t.name===n.name||t.shortName&&t.shortName===n.shortName)&&(r=n);return r}o.RDNAttributesAsArray=function(e,t){for(var r=[],n,o,u,c=0;c<e.value.length;++c){n=e.value[c];for(var f=0;f<n.value.length;++f)u={},o=n.value[f],u.type=i.derToOid(o.value[0].value),u.value=o.value[1].value,u.valueTagClass=o.value[1].type,u.type in a&&(u.name=a[u.type],u.name in s&&(u.shortName=s[u.name])),t&&(t.update(u.type),t.update(u.value)),r.push(u)}return r},o.CRIAttributesAsArray=function(e){for(var t=[],r=0;r<e.length;++r)for(var n=e[r],u=i.derToOid(n.value[0].value),c=n.value[1].value,f=0;f<c.length;++f){var l={};if(l.type=u,l.value=c[f].value,l.valueTagClass=c[f].type,l.type in a&&(l.name=a[l.type],l.name in s&&(l.shortName=s[l.name])),l.type===a.extensionRequest){l.extensions=[];for(var p=0;p<l.value.length;++p)l.extensions.push(o.certificateExtensionFromAsn1(l.value[p]))}t.push(l)}return t};var d=function(e,t,r){var n={};if(e!==a["RSASSA-PSS"])return n;r&&(n={hash:{algorithmOid:a.sha1},mgf:{algorithmOid:a.mgf1,hash:{algorithmOid:a.sha1}},saltLength:20});var o={},s=[];if(!i.validate(t,f,o,s)){var u=new Error("Cannot read RSASSA-PSS parameter block.");throw u.errors=s,u}return void 0!==o.hashOid&&(n.hash=n.hash||{},n.hash.algorithmOid=i.derToOid(o.hashOid)),void 0!==o.maskGenOid&&(n.mgf=n.mgf||{},n.mgf.algorithmOid=i.derToOid(o.maskGenOid),n.mgf.hash=n.mgf.hash||{},n.mgf.hash.algorithmOid=i.derToOid(o.maskGenHashOid)),void 0!==o.saltLength&&(n.saltLength=o.saltLength.charCodeAt(0)),n};function y(e){for(var t=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]),r,o,a=e.attributes,s=0;s<a.length;++s){var u=(r=a[s]).value,c=i.Type.PRINTABLESTRING;"valueTagClass"in r&&(c=r.valueTagClass)===i.Type.UTF8&&(u=n.util.encodeUtf8(u)),o=i.create(i.Class.UNIVERSAL,i.Type.SET,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(r.type).getBytes()),i.create(i.Class.UNIVERSAL,c,!1,u)])]),t.value.push(o)}return t}function g(e){for(var t={},r=0;r<e.length;++r){var o=e[r];if(o.shortName&&(o.valueTagClass===i.Type.UTF8||o.valueTagClass===i.Type.PRINTABLESTRING||o.valueTagClass===i.Type.IA5STRING)){var a=o.value;o.valueTagClass===i.Type.UTF8&&(a=n.util.encodeUtf8(o.value)),o.shortName in t?n.util.isArray(t[o.shortName])?t[o.shortName].push(a):t[o.shortName]=[t[o.shortName],a]:t[o.shortName]=a}}return t}function v(e){for(var t,r=0;r<e.length;++r){if(void 0===(t=e[r]).name&&(t.type&&t.type in o.oids?t.name=o.oids[t.type]:t.shortName&&t.shortName in s&&(t.name=o.oids[s[t.shortName]])),void 0===t.type){var n;if(!t.name||!(t.name in o.oids))throw(n=new Error("Attribute type not specified.")).attribute=t,n;t.type=o.oids[t.name]}if(void 0===t.shortName&&t.name&&t.name in s&&(t.shortName=s[t.name]),t.type===a.extensionRequest&&(t.valueConstructed=!0,t.valueTagClass=i.Type.SEQUENCE,!t.value&&t.extensions)){t.value=[];for(var u=0;u<t.extensions.length;++u)t.value.push(o.certificateExtensionToAsn1(m(t.extensions[u])))}var n;if(void 0===t.value)throw(n=new Error("Attribute value not specified.")).attribute=t,n}}function m(e,t){if(t=t||{},void 0===e.name&&e.id&&e.id in o.oids&&(e.name=o.oids[e.id]),void 0===e.id){var r;if(!e.name||!(e.name in o.oids))throw(r=new Error("Extension ID not specified.")).extension=e,r;e.id=o.oids[e.name]}if(void 0!==e.value)return e;if("keyUsage"===e.name){var s=0,u=0,c=0;e.digitalSignature&&(u|=128,s=7),e.nonRepudiation&&(u|=64,s=6),e.keyEncipherment&&(u|=32,s=5),e.dataEncipherment&&(u|=16,s=4),e.keyAgreement&&(u|=8,s=3),e.keyCertSign&&(u|=4,s=2),e.cRLSign&&(u|=2,s=1),e.encipherOnly&&(u|=1,s=0),e.decipherOnly&&(c|=128,s=7);var f=String.fromCharCode(s);0!==c?f+=String.fromCharCode(u)+String.fromCharCode(c):0!==u&&(f+=String.fromCharCode(u)),e.value=i.create(i.Class.UNIVERSAL,i.Type.BITSTRING,!1,f)}else if("basicConstraints"===e.name)e.value=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]),e.cA&&e.value.value.push(i.create(i.Class.UNIVERSAL,i.Type.BOOLEAN,!1,String.fromCharCode(255))),"pathLenConstraint"in e&&e.value.value.push(i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(e.pathLenConstraint).getBytes()));else if("extKeyUsage"===e.name){e.value=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);var l=e.value.value;for(var p in e)!0===e[p]&&(p in a?l.push(i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a[p]).getBytes())):-1!==p.indexOf(".")&&l.push(i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(p).getBytes())))}else if("nsCertType"===e.name){var s=0,u=0;e.client&&(u|=128,s=7),e.server&&(u|=64,s=6),e.email&&(u|=32,s=5),e.objsign&&(u|=16,s=4),e.reserved&&(u|=8,s=3),e.sslCA&&(u|=4,s=2),e.emailCA&&(u|=2,s=1),e.objCA&&(u|=1,s=0);var f=String.fromCharCode(s);0!==u&&(f+=String.fromCharCode(u)),e.value=i.create(i.Class.UNIVERSAL,i.Type.BITSTRING,!1,f)}else if("subjectAltName"===e.name||"issuerAltName"===e.name){var h;e.value=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);for(var d=0;d<e.altNames.length;++d){var f=(h=e.altNames[d]).value,r;if(7===h.type&&h.ip){if(null===(f=n.util.bytesFromIP(h.ip)))throw(r=new Error('Extension "ip" value is not a valid IPv4 or IPv6 address.')).extension=e,r}else 8===h.type&&(f=h.oid?i.oidToDer(i.oidToDer(h.oid)):i.oidToDer(f));e.value.value.push(i.create(i.Class.CONTEXT_SPECIFIC,h.type,!1,f))}}else if("nsComment"===e.name&&t.cert){if(!/^[\x00-\x7F]*$/.test(e.comment)||e.comment.length<1||e.comment.length>128)throw new Error('Invalid "nsComment" content.');e.value=i.create(i.Class.UNIVERSAL,i.Type.IA5STRING,!1,e.comment)}else if("subjectKeyIdentifier"===e.name&&t.cert){var g=t.cert.generateSubjectKeyIdentifier();e.subjectKeyIdentifier=g.toHex(),e.value=i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,g.getBytes())}else if("authorityKeyIdentifier"===e.name&&t.cert){e.value=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);var l=e.value.value;if(e.keyIdentifier){var v=!0===e.keyIdentifier?t.cert.generateSubjectKeyIdentifier().getBytes():e.keyIdentifier;l.push(i.create(i.Class.CONTEXT_SPECIFIC,0,!1,v))}if(e.authorityCertIssuer){var m=[i.create(i.Class.CONTEXT_SPECIFIC,4,!0,[y(!0===e.authorityCertIssuer?t.cert.issuer:e.authorityCertIssuer)])];l.push(i.create(i.Class.CONTEXT_SPECIFIC,1,!0,m))}if(e.serialNumber){var b=n.util.hexToBytes(!0===e.serialNumber?t.cert.serialNumber:e.serialNumber);l.push(i.create(i.Class.CONTEXT_SPECIFIC,2,!1,b))}}else if("cRLDistributionPoints"===e.name){e.value=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);for(var l=e.value.value,E=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]),T=i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[]),h,d=0;d<e.altNames.length;++d){var f=(h=e.altNames[d]).value,r;if(7===h.type&&h.ip){if(null===(f=n.util.bytesFromIP(h.ip)))throw(r=new Error('Extension "ip" value is not a valid IPv4 or IPv6 address.')).extension=e,r}else 8===h.type&&(f=h.oid?i.oidToDer(i.oidToDer(h.oid)):i.oidToDer(f));T.value.push(i.create(i.Class.CONTEXT_SPECIFIC,h.type,!1,f))}E.value.push(i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[T])),l.push(E)}var r;if(void 0===e.value)throw(r=new Error("Extension value not specified.")).extension=e,r;return e}function b(e,t){if(e===a["RSASSA-PSS"]){var r=[];return void 0!==t.hash.algorithmOid&&r.push(i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(t.hash.algorithmOid).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")])])),void 0!==t.mgf.algorithmOid&&r.push(i.create(i.Class.CONTEXT_SPECIFIC,1,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(t.mgf.algorithmOid).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(t.mgf.hash.algorithmOid).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")])])])),void 0!==t.saltLength&&r.push(i.create(i.Class.CONTEXT_SPECIFIC,2,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(t.saltLength).getBytes())])),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,r)}return i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")}function E(e){var t=i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[]);if(0===e.attributes.length)return t;for(var r=e.attributes,o=0;o<r.length;++o){var a=r[o],s=a.value,u=i.Type.UTF8;"valueTagClass"in a&&(u=a.valueTagClass),u===i.Type.UTF8&&(s=n.util.encodeUtf8(s));var c=!1;"valueConstructed"in a&&(c=a.valueConstructed);var f=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.type).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SET,!0,[i.create(i.Class.UNIVERSAL,u,c,s)])]);t.value.push(f)}return t}o.certificateFromPem=function(e,t,r){var a=n.pem.decode(e)[0];if("CERTIFICATE"!==a.type&&"X509 CERTIFICATE"!==a.type&&"TRUSTED CERTIFICATE"!==a.type){var s=new Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".');throw s.headerType=a.type,s}if(a.procType&&"ENCRYPTED"===a.procType.type)throw new Error("Could not convert certificate from PEM; PEM is encrypted.");var u=i.fromDer(a.body,r);return o.certificateFromAsn1(u,t)},o.certificateToPem=function(e,t){var r={type:"CERTIFICATE",body:i.toDer(o.certificateToAsn1(e)).getBytes()};return n.pem.encode(r,{maxline:t})},o.publicKeyFromPem=function(e){var t=n.pem.decode(e)[0];if("PUBLIC KEY"!==t.type&&"RSA PUBLIC KEY"!==t.type){var r=new Error('Could not convert public key from PEM; PEM header type is not "PUBLIC KEY" or "RSA PUBLIC KEY".');throw r.headerType=t.type,r}if(t.procType&&"ENCRYPTED"===t.procType.type)throw new Error("Could not convert public key from PEM; PEM is encrypted.");var a=i.fromDer(t.body);return o.publicKeyFromAsn1(a)},o.publicKeyToPem=function(e,t){var r={type:"PUBLIC KEY",body:i.toDer(o.publicKeyToAsn1(e)).getBytes()};return n.pem.encode(r,{maxline:t})},o.publicKeyToRSAPublicKeyPem=function(e,t){var r={type:"RSA PUBLIC KEY",body:i.toDer(o.publicKeyToRSAPublicKey(e)).getBytes()};return n.pem.encode(r,{maxline:t})},o.getPublicKeyFingerprint=function(e,t){var r=(t=t||{}).md||n.md.sha1.create(),a,s;switch(t.type||"RSAPublicKey"){case"RSAPublicKey":s=i.toDer(o.publicKeyToRSAPublicKey(e)).getBytes();break;case"SubjectPublicKeyInfo":s=i.toDer(o.publicKeyToAsn1(e)).getBytes();break;default:throw new Error('Unknown fingerprint type "'+t.type+'".')}r.start(),r.update(s);var u=r.digest();if("hex"===t.encoding){var c=u.toHex();return t.delimiter?c.match(/.{2}/g).join(t.delimiter):c}if("binary"===t.encoding)return u.getBytes();if(t.encoding)throw new Error('Unknown encoding "'+t.encoding+'".');return u},o.certificationRequestFromPem=function(e,t,r){var a=n.pem.decode(e)[0];if("CERTIFICATE REQUEST"!==a.type){var s=new Error('Could not convert certification request from PEM; PEM header type is not "CERTIFICATE REQUEST".');throw s.headerType=a.type,s}if(a.procType&&"ENCRYPTED"===a.procType.type)throw new Error("Could not convert certification request from PEM; PEM is encrypted.");var u=i.fromDer(a.body,r);return o.certificationRequestFromAsn1(u,t)},o.certificationRequestToPem=function(e,t){var r={type:"CERTIFICATE REQUEST",body:i.toDer(o.certificationRequestToAsn1(e)).getBytes()};return n.pem.encode(r,{maxline:t})},o.createCertificate=function(){var e={version:2,serialNumber:"00",signatureOid:null,signature:null,siginfo:{}};return e.siginfo.algorithmOid=null,e.validity={},e.validity.notBefore=new Date,e.validity.notAfter=new Date,e.issuer={},e.issuer.getField=function(t){return h(e.issuer,t)},e.issuer.addField=function(t){v([t]),e.issuer.attributes.push(t)},e.issuer.attributes=[],e.issuer.hash=null,e.subject={},e.subject.getField=function(t){return h(e.subject,t)},e.subject.addField=function(t){v([t]),e.subject.attributes.push(t)},e.subject.attributes=[],e.subject.hash=null,e.extensions=[],e.publicKey=null,e.md=null,e.setSubject=function(t,r){v(t),e.subject.attributes=t,delete e.subject.uniqueId,r&&(e.subject.uniqueId=r),e.subject.hash=null},e.setIssuer=function(t,r){v(t),e.issuer.attributes=t,delete e.issuer.uniqueId,r&&(e.issuer.uniqueId=r),e.issuer.hash=null},e.setExtensions=function(t){for(var r=0;r<t.length;++r)m(t[r],{cert:e});e.extensions=t},e.getExtension=function(t){"string"==typeof t&&(t={name:t});for(var r=null,n,i=0;null===r&&i<e.extensions.length;++i)n=e.extensions[i],(t.id&&n.id===t.id||t.name&&n.name===t.name)&&(r=n);return r},e.sign=function(t,r){e.md=r||n.md.sha1.create();var s=a[e.md.algorithm+"WithRSAEncryption"];if(!s){var u=new Error("Could not compute certificate digest. Unknown message digest algorithm OID.");throw u.algorithm=e.md.algorithm,u}e.signatureOid=e.siginfo.algorithmOid=s,e.tbsCertificate=o.getTBSCertificate(e);var c=i.toDer(e.tbsCertificate);e.md.update(c.getBytes()),e.signature=t.sign(e.md)},e.verify=function(t){var r=!1;if(!e.issued(t)){var s=t.issuer,u=e.subject,c;throw(c=new Error("The parent certificate did not issue the given child certificate; the child certificate's issuer does not match the parent's subject.")).expectedIssuer=s.attributes,c.actualIssuer=u.attributes,c}var f=t.md;if(null===f){var l,c;if(t.signatureOid in a)switch(a[t.signatureOid]){case"sha1WithRSAEncryption":f=n.md.sha1.create();break;case"md5WithRSAEncryption":f=n.md.md5.create();break;case"sha256WithRSAEncryption":case"RSASSA-PSS":f=n.md.sha256.create();break;case"sha384WithRSAEncryption":f=n.md.sha384.create();break;case"sha512WithRSAEncryption":f=n.md.sha512.create()}if(null===f)throw(c=new Error("Could not compute certificate digest. Unknown signature OID.")).signatureOid=t.signatureOid,c;var p=t.tbsCertificate||o.getTBSCertificate(t),h=i.toDer(p);f.update(h.getBytes())}if(null!==f){var d;switch(t.signatureOid){case a.sha1WithRSAEncryption:d=void 0;break;case a["RSASSA-PSS"]:var y,g,c,c;if(void 0===(y=a[t.signatureParameters.mgf.hash.algorithmOid])||void 0===n.md[y])throw(c=new Error("Unsupported MGF hash function.")).oid=t.signatureParameters.mgf.hash.algorithmOid,c.name=y,c;if(void 0===(g=a[t.signatureParameters.mgf.algorithmOid])||void 0===n.mgf[g])throw(c=new Error("Unsupported MGF function.")).oid=t.signatureParameters.mgf.algorithmOid,c.name=g,c;if(g=n.mgf[g].create(n.md[y].create()),void 0===(y=a[t.signatureParameters.hash.algorithmOid])||void 0===n.md[y])throw{message:"Unsupported RSASSA-PSS hash function.",oid:t.signatureParameters.hash.algorithmOid,name:y};d=n.pss.create(n.md[y].create(),g,t.signatureParameters.saltLength)}r=e.publicKey.verify(f.digest().getBytes(),t.signature,d)}return r},e.isIssuer=function(t){var r=!1,n=e.issuer,i=t.subject;if(n.hash&&i.hash)r=n.hash===i.hash;else if(n.attributes.length===i.attributes.length){var o,a;r=!0;for(var s=0;r&&s<n.attributes.length;++s)o=n.attributes[s],a=i.attributes[s],o.type===a.type&&o.value===a.value||(r=!1)}return r},e.issued=function(t){return t.isIssuer(e)},e.generateSubjectKeyIdentifier=function(){return o.getPublicKeyFingerprint(e.publicKey,{type:"RSAPublicKey"})},e.verifySubjectKeyIdentifier=function(){for(var t=a.subjectKeyIdentifier,r=0;r<e.extensions.length;++r){var i=e.extensions[r];if(i.id===t){var o=e.generateSubjectKeyIdentifier().getBytes();return n.util.hexToBytes(i.subjectKeyIdentifier)===o}}return!1},e},o.certificateFromAsn1=function(e,t){var r={},s=[],u,f;if(!i.validate(e,c,r,s))throw(u=new Error("Cannot read X.509 certificate. ASN.1 object is not an X509v3 Certificate.")).errors=s,u;if((f=i.derToOid(r.publicKeyOid))!==o.oids.rsaEncryption)throw new Error("Cannot read public key. OID is not RSA.");var l=o.createCertificate();l.version=r.certVersion?r.certVersion.charCodeAt(0):0;var p=n.util.createBuffer(r.certSerialNumber);l.serialNumber=p.toHex(),l.signatureOid=n.asn1.derToOid(r.certSignatureOid),l.signatureParameters=d(l.signatureOid,r.certSignatureParams,!0),l.siginfo.algorithmOid=n.asn1.derToOid(r.certinfoSignatureOid),l.siginfo.parameters=d(l.siginfo.algorithmOid,r.certinfoSignatureParams,!1),l.signature=r.certSignature;var y=[];if(void 0!==r.certValidity1UTCTime&&y.push(i.utcTimeToDate(r.certValidity1UTCTime)),void 0!==r.certValidity2GeneralizedTime&&y.push(i.generalizedTimeToDate(r.certValidity2GeneralizedTime)),void 0!==r.certValidity3UTCTime&&y.push(i.utcTimeToDate(r.certValidity3UTCTime)),void 0!==r.certValidity4GeneralizedTime&&y.push(i.generalizedTimeToDate(r.certValidity4GeneralizedTime)),y.length>2)throw new Error("Cannot read notBefore/notAfter validity times; more than two times were provided in the certificate.");if(y.length<2)throw new Error("Cannot read notBefore/notAfter validity times; they were not provided as either UTCTime or GeneralizedTime.");if(l.validity.notBefore=y[0],l.validity.notAfter=y[1],l.tbsCertificate=r.tbsCertificate,t){var f,u;if(l.md=null,l.signatureOid in a)switch(f=a[l.signatureOid]){case"sha1WithRSAEncryption":l.md=n.md.sha1.create();break;case"md5WithRSAEncryption":l.md=n.md.md5.create();break;case"sha256WithRSAEncryption":case"RSASSA-PSS":l.md=n.md.sha256.create();break;case"sha384WithRSAEncryption":l.md=n.md.sha384.create();break;case"sha512WithRSAEncryption":l.md=n.md.sha512.create()}if(null===l.md)throw(u=new Error("Could not compute certificate digest. Unknown signature OID.")).signatureOid=l.signatureOid,u;var g=i.toDer(l.tbsCertificate);l.md.update(g.getBytes())}var m=n.md.sha1.create();l.issuer.getField=function(e){return h(l.issuer,e)},l.issuer.addField=function(e){v([e]),l.issuer.attributes.push(e)},l.issuer.attributes=o.RDNAttributesAsArray(r.certIssuer,m),r.certIssuerUniqueId&&(l.issuer.uniqueId=r.certIssuerUniqueId),l.issuer.hash=m.digest().toHex();var b=n.md.sha1.create();return l.subject.getField=function(e){return h(l.subject,e)},l.subject.addField=function(e){v([e]),l.subject.attributes.push(e)},l.subject.attributes=o.RDNAttributesAsArray(r.certSubject,b),r.certSubjectUniqueId&&(l.subject.uniqueId=r.certSubjectUniqueId),l.subject.hash=b.digest().toHex(),r.certExtensions?l.extensions=o.certificateExtensionsFromAsn1(r.certExtensions):l.extensions=[],l.publicKey=o.publicKeyFromAsn1(r.subjectPublicKeyInfo),l},o.certificateExtensionsFromAsn1=function(e){for(var t=[],r=0;r<e.value.length;++r)for(var n=e.value[r],i=0;i<n.value.length;++i)t.push(o.certificateExtensionFromAsn1(n.value[i]));return t},o.certificateExtensionFromAsn1=function(e){var t={};if(t.id=i.derToOid(e.value[0].value),t.critical=!1,e.value[1].type===i.Type.BOOLEAN?(t.critical=0!==e.value[1].value.charCodeAt(0),t.value=e.value[2].value):t.value=e.value[1].value,t.id in a)if(t.name=a[t.id],"keyUsage"===t.name){var r,o=0,s=0;(r=i.fromDer(t.value)).value.length>1&&(o=r.value.charCodeAt(1),s=r.value.length>2?r.value.charCodeAt(2):0),t.digitalSignature=!(128&~o),t.nonRepudiation=!(64&~o),t.keyEncipherment=!(32&~o),t.dataEncipherment=!(16&~o),t.keyAgreement=!(8&~o),t.keyCertSign=!(4&~o),t.cRLSign=!(2&~o),t.encipherOnly=!(1&~o),t.decipherOnly=!(128&~s)}else if("basicConstraints"===t.name){var r;(r=i.fromDer(t.value)).value.length>0&&r.value[0].type===i.Type.BOOLEAN?t.cA=0!==r.value[0].value.charCodeAt(0):t.cA=!1;var u=null;r.value.length>0&&r.value[0].type===i.Type.INTEGER?u=r.value[0].value:r.value.length>1&&(u=r.value[1].value),null!==u&&(t.pathLenConstraint=i.derToInteger(u))}else if("extKeyUsage"===t.name)for(var r=i.fromDer(t.value),c=0;c<r.value.length;++c){var f=i.derToOid(r.value[c].value);f in a?t[a[f]]=!0:t[f]=!0}else if("nsCertType"===t.name){var r,o=0;(r=i.fromDer(t.value)).value.length>1&&(o=r.value.charCodeAt(1)),t.client=!(128&~o),t.server=!(64&~o),t.email=!(32&~o),t.objsign=!(16&~o),t.reserved=!(8&~o),t.sslCA=!(4&~o),t.emailCA=!(2&~o),t.objCA=!(1&~o)}else if("subjectAltName"===t.name||"issuerAltName"===t.name){var l;t.altNames=[];for(var r=i.fromDer(t.value),p=0;p<r.value.length;++p){var h={type:(l=r.value[p]).type,value:l.value};switch(t.altNames.push(h),l.type){case 1:case 2:case 6:break;case 7:h.ip=n.util.bytesToIP(l.value);break;case 8:h.oid=i.derToOid(l.value)}}}else if("subjectKeyIdentifier"===t.name){var r=i.fromDer(t.value);t.subjectKeyIdentifier=n.util.bytesToHex(r.value)}return t},o.certificationRequestFromAsn1=function(e,t){var r={},s=[],u,c;if(!i.validate(e,p,r,s))throw(u=new Error("Cannot read PKCS#10 certificate request. ASN.1 object is not a PKCS#10 CertificationRequest.")).errors=s,u;if((c=i.derToOid(r.publicKeyOid))!==o.oids.rsaEncryption)throw new Error("Cannot read public key. OID is not RSA.");var f=o.createCertificationRequest();if(f.version=r.csrVersion?r.csrVersion.charCodeAt(0):0,f.signatureOid=n.asn1.derToOid(r.csrSignatureOid),f.signatureParameters=d(f.signatureOid,r.csrSignatureParams,!0),f.siginfo.algorithmOid=n.asn1.derToOid(r.csrSignatureOid),f.siginfo.parameters=d(f.siginfo.algorithmOid,r.csrSignatureParams,!1),f.signature=r.csrSignature,f.certificationRequestInfo=r.certificationRequestInfo,t){var c,u;if(f.md=null,f.signatureOid in a)switch(c=a[f.signatureOid]){case"sha1WithRSAEncryption":f.md=n.md.sha1.create();break;case"md5WithRSAEncryption":f.md=n.md.md5.create();break;case"sha256WithRSAEncryption":case"RSASSA-PSS":f.md=n.md.sha256.create();break;case"sha384WithRSAEncryption":f.md=n.md.sha384.create();break;case"sha512WithRSAEncryption":f.md=n.md.sha512.create()}if(null===f.md)throw(u=new Error("Could not compute certification request digest. Unknown signature OID.")).signatureOid=f.signatureOid,u;var l=i.toDer(f.certificationRequestInfo);f.md.update(l.getBytes())}var y=n.md.sha1.create();return f.subject.getField=function(e){return h(f.subject,e)},f.subject.addField=function(e){v([e]),f.subject.attributes.push(e)},f.subject.attributes=o.RDNAttributesAsArray(r.certificationRequestInfoSubject,y),f.subject.hash=y.digest().toHex(),f.publicKey=o.publicKeyFromAsn1(r.subjectPublicKeyInfo),f.getAttribute=function(e){return h(f,e)},f.addAttribute=function(e){v([e]),f.attributes.push(e)},f.attributes=o.CRIAttributesAsArray(r.certificationRequestInfoAttributes||[]),f},o.createCertificationRequest=function(){var e={version:0,signatureOid:null,signature:null,siginfo:{}};return e.siginfo.algorithmOid=null,e.subject={},e.subject.getField=function(t){return h(e.subject,t)},e.subject.addField=function(t){v([t]),e.subject.attributes.push(t)},e.subject.attributes=[],e.subject.hash=null,e.publicKey=null,e.attributes=[],e.getAttribute=function(t){return h(e,t)},e.addAttribute=function(t){v([t]),e.attributes.push(t)},e.md=null,e.setSubject=function(t){v(t),e.subject.attributes=t,e.subject.hash=null},e.setAttributes=function(t){v(t),e.attributes=t},e.sign=function(t,r){e.md=r||n.md.sha1.create();var s=a[e.md.algorithm+"WithRSAEncryption"];if(!s){var u=new Error("Could not compute certification request digest. Unknown message digest algorithm OID.");throw u.algorithm=e.md.algorithm,u}e.signatureOid=e.siginfo.algorithmOid=s,e.certificationRequestInfo=o.getCertificationRequestInfo(e);var c=i.toDer(e.certificationRequestInfo);e.md.update(c.getBytes()),e.signature=t.sign(e.md)},e.verify=function(){var t=!1,r=e.md;if(null===r){var s,u;if(e.signatureOid in a)switch(a[e.signatureOid]){case"sha1WithRSAEncryption":r=n.md.sha1.create();break;case"md5WithRSAEncryption":r=n.md.md5.create();break;case"sha256WithRSAEncryption":case"RSASSA-PSS":r=n.md.sha256.create();break;case"sha384WithRSAEncryption":r=n.md.sha384.create();break;case"sha512WithRSAEncryption":r=n.md.sha512.create()}if(null===r)throw(u=new Error("Could not compute certification request digest. Unknown signature OID.")).signatureOid=e.signatureOid,u;var c=e.certificationRequestInfo||o.getCertificationRequestInfo(e),f=i.toDer(c);r.update(f.getBytes())}if(null!==r){var l;switch(e.signatureOid){case a.sha1WithRSAEncryption:break;case a["RSASSA-PSS"]:var p,h,u,u,u;if(void 0===(p=a[e.signatureParameters.mgf.hash.algorithmOid])||void 0===n.md[p])throw(u=new Error("Unsupported MGF hash function.")).oid=e.signatureParameters.mgf.hash.algorithmOid,u.name=p,u;if(void 0===(h=a[e.signatureParameters.mgf.algorithmOid])||void 0===n.mgf[h])throw(u=new Error("Unsupported MGF function.")).oid=e.signatureParameters.mgf.algorithmOid,u.name=h,u;if(h=n.mgf[h].create(n.md[p].create()),void 0===(p=a[e.signatureParameters.hash.algorithmOid])||void 0===n.md[p])throw(u=new Error("Unsupported RSASSA-PSS hash function.")).oid=e.signatureParameters.hash.algorithmOid,u.name=p,u;l=n.pss.create(n.md[p].create(),h,e.signatureParameters.saltLength)}t=e.publicKey.verify(r.digest().getBytes(),e.signature,l)}return t},e};var T=new Date("1950-01-01T00:00:00Z"),S=new Date("2050-01-01T00:00:00Z");function w(e){return e>=T&&e<S?i.create(i.Class.UNIVERSAL,i.Type.UTCTIME,!1,i.dateToUtcTime(e)):i.create(i.Class.UNIVERSAL,i.Type.GENERALIZEDTIME,!1,i.dateToGeneralizedTime(e))}o.getTBSCertificate=function(e){var t=w(e.validity.notBefore),r=w(e.validity.notAfter),a=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(e.version).getBytes())]),i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,n.util.hexToBytes(e.serialNumber)),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.siginfo.algorithmOid).getBytes()),b(e.siginfo.algorithmOid,e.siginfo.parameters)]),y(e.issuer),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[t,r]),y(e.subject),o.publicKeyToAsn1(e.publicKey)]);return e.issuer.uniqueId&&a.value.push(i.create(i.Class.CONTEXT_SPECIFIC,1,!0,[i.create(i.Class.UNIVERSAL,i.Type.BITSTRING,!1,String.fromCharCode(0)+e.issuer.uniqueId)])),e.subject.uniqueId&&a.value.push(i.create(i.Class.CONTEXT_SPECIFIC,2,!0,[i.create(i.Class.UNIVERSAL,i.Type.BITSTRING,!1,String.fromCharCode(0)+e.subject.uniqueId)])),e.extensions.length>0&&a.value.push(o.certificateExtensionsToAsn1(e.extensions)),a},o.getCertificationRequestInfo=function(e){var t;return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(e.version).getBytes()),y(e.subject),o.publicKeyToAsn1(e.publicKey),E(e)])},o.distinguishedNameToAsn1=function(e){return y(e)},o.certificateToAsn1=function(e){var t=e.tbsCertificate||o.getTBSCertificate(e);return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[t,i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.signatureOid).getBytes()),b(e.signatureOid,e.signatureParameters)]),i.create(i.Class.UNIVERSAL,i.Type.BITSTRING,!1,String.fromCharCode(0)+e.signature)])},o.certificateExtensionsToAsn1=function(e){var t=i.create(i.Class.CONTEXT_SPECIFIC,3,!0,[]),r=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);t.value.push(r);for(var n=0;n<e.length;++n)r.value.push(o.certificateExtensionToAsn1(e[n]));return t},o.certificateExtensionToAsn1=function(e){var t=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);t.value.push(i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.id).getBytes())),e.critical&&t.value.push(i.create(i.Class.UNIVERSAL,i.Type.BOOLEAN,!1,String.fromCharCode(255)));var r=e.value;return"string"!=typeof e.value&&(r=i.toDer(r).getBytes()),t.value.push(i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,r)),t},o.certificationRequestToAsn1=function(e){var t=e.certificationRequestInfo||o.getCertificationRequestInfo(e);return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[t,i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.signatureOid).getBytes()),b(e.signatureOid,e.signatureParameters)]),i.create(i.Class.UNIVERSAL,i.Type.BITSTRING,!1,String.fromCharCode(0)+e.signature)])},o.createCaStore=function(e){var t={certs:{}};function r(e){return a(e),t.certs[e.hash]||null}function a(e){if(!e.hash){var t=n.md.sha1.create();e.attributes=o.RDNAttributesAsArray(y(e),t),e.hash=t.digest().toHex()}}if(t.getIssuer=function(e){var t;return r(e.issuer)},t.addCertificate=function(e){if("string"==typeof e&&(e=n.pki.certificateFromPem(e)),a(e.subject),!t.hasCertificate(e))if(e.subject.hash in t.certs){var r=t.certs[e.subject.hash];n.util.isArray(r)||(r=[r]),r.push(e),t.certs[e.subject.hash]=r}else t.certs[e.subject.hash]=e},t.hasCertificate=function(e){"string"==typeof e&&(e=n.pki.certificateFromPem(e));var t=r(e.subject);if(!t)return!1;n.util.isArray(t)||(t=[t]);for(var a=i.toDer(o.certificateToAsn1(e)).getBytes(),s=0;s<t.length;++s){var u;if(a===i.toDer(o.certificateToAsn1(t[s])).getBytes())return!0}return!1},t.listAllCertificates=function(){var e=[];for(var r in t.certs)if(t.certs.hasOwnProperty(r)){var i=t.certs[r];if(n.util.isArray(i))for(var o=0;o<i.length;++o)e.push(i[o]);else e.push(i)}return e},t.removeCertificate=function(e){var s;if("string"==typeof e&&(e=n.pki.certificateFromPem(e)),a(e.subject),!t.hasCertificate(e))return null;var u=r(e.subject);if(!n.util.isArray(u))return s=t.certs[e.subject.hash],delete t.certs[e.subject.hash],s;for(var c=i.toDer(o.certificateToAsn1(e)).getBytes(),f=0;f<u.length;++f){var l;c===i.toDer(o.certificateToAsn1(u[f])).getBytes()&&(s=u[f],u.splice(f,1))}return 0===u.length&&delete t.certs[e.subject.hash],s},e)for(var s=0;s<e.length;++s){var u=e[s];t.addCertificate(u)}return t},o.certificateError={bad_certificate:"forge.pki.BadCertificate",unsupported_certificate:"forge.pki.UnsupportedCertificate",certificate_revoked:"forge.pki.CertificateRevoked",certificate_expired:"forge.pki.CertificateExpired",certificate_unknown:"forge.pki.CertificateUnknown",unknown_ca:"forge.pki.UnknownCertificateAuthority"},o.verifyCertificateChain=function(e,t,r){"function"==typeof r&&(r={verify:r}),r=r||{};var i=(t=t.slice(0)).slice(0),a=r.validityCheckDate;void 0===a&&(a=new Date);var s=!0,u=null,c=0;do{var f=t.shift(),l=null,p=!1;if(a&&(a<f.validity.notBefore||a>f.validity.notAfter)&&(u={message:"Certificate is not valid yet or has expired.",error:o.certificateError.certificate_expired,notBefore:f.validity.notBefore,notAfter:f.validity.notAfter,now:a}),null===u){if(null===(l=t[0]||e.getIssuer(f))&&f.isIssuer(f)&&(p=!0,l=f),l){var h=l;n.util.isArray(h)||(h=[h]);for(var d=!1;!d&&h.length>0;){l=h.shift();try{d=l.verify(f)}catch(e){}}d||(u={message:"Certificate signature is invalid.",error:o.certificateError.bad_certificate})}null!==u||l&&!p||e.hasCertificate(f)||(u={message:"Certificate is not trusted.",error:o.certificateError.unknown_ca})}if(null===u&&l&&!f.isIssuer(l)&&(u={message:"Certificate issuer is invalid.",error:o.certificateError.bad_certificate}),null===u)for(var y={keyUsage:!0,basicConstraints:!0},g=0;null===u&&g<f.extensions.length;++g){var v=f.extensions[g];v.critical&&!(v.name in y)&&(u={message:"Certificate has an unsupported critical extension.",error:o.certificateError.unsupported_certificate})}if(null===u&&(!s||0===t.length&&(!l||p))){var m=f.getExtension("basicConstraints"),b=f.getExtension("keyUsage"),E;if(null!==b&&(b.keyCertSign&&null!==m||(u={message:"Certificate keyUsage or basicConstraints conflict or indicate that the certificate is not a CA. If the certificate is the only one in the chain or isn't the first then the certificate must be a valid CA.",error:o.certificateError.bad_certificate})),null!==u||null===m||m.cA||(u={message:"Certificate basicConstraints indicates the certificate is not a CA.",error:o.certificateError.bad_certificate}),null===u&&null!==b&&"pathLenConstraint"in m)c-1>m.pathLenConstraint&&(u={message:"Certificate basicConstraints pathLenConstraint violated.",error:o.certificateError.bad_certificate})}var T=null===u||u.error,S=r.verify?r.verify(T,c,i):T;if(!0!==S)throw!0===T&&(u={message:"The application rejected the certificate.",error:o.certificateError.bad_certificate}),(S||0===S)&&("object"!=typeof S||n.util.isArray(S)?"string"==typeof S&&(u.error=S):(S.message&&(u.message=S.message),S.error&&(u.error=S.error))),u;u=null,s=!1,++c}while(t.length>0);return!0}},function(e,t,r){var n=r(4),i;r(31),r(8),(e.exports=n.pss=n.pss||{}).create=function(e){3===arguments.length&&(e={md:arguments[0],mgf:arguments[1],saltLength:arguments[2]});var t=e.md,r=e.mgf,i=t.digestLength,o=e.salt||null,a;if("string"==typeof o&&(o=n.util.createBuffer(o)),"saltLength"in e)a=e.saltLength;else{if(null===o)throw new Error("Salt length not specified or specific salt not given.");a=o.length()}if(null!==o&&o.length()!==a)throw new Error("Given salt length does not match length of given salt.");var s=e.prng||n.random,u={encode:function(e,u){var c,f=u-1,l=Math.ceil(f/8),p=e.digest().getBytes(),h;if(l<i+a+2)throw new Error("Message is too long to encrypt.");h=null===o?s.getBytesSync(a):o.bytes();var d=new n.util.ByteBuffer;d.fillWithByte(0,8),d.putBytes(p),d.putBytes(h),t.start(),t.update(d.getBytes());var y=t.digest().getBytes(),g=new n.util.ByteBuffer;g.fillWithByte(0,l-a-i-2),g.putByte(1),g.putBytes(h);var v=g.getBytes(),m=l-i-1,b=r.generate(y,m),E="";for(c=0;c<m;c++)E+=String.fromCharCode(v.charCodeAt(c)^b.charCodeAt(c));var T=65280>>8*l-f&255;return(E=String.fromCharCode(E.charCodeAt(0)&~T)+E.substr(1))+y+String.fromCharCode(188)},verify:function(e,o,s){var u,c=s-1,f=Math.ceil(c/8);if(o=o.substr(-f),f<i+a+2)throw new Error("Inconsistent parameters to PSS signature verification.");if(188!==o.charCodeAt(f-1))throw new Error("Encoded message does not end in 0xBC.");var l=f-i-1,p=o.substr(0,l),h=o.substr(l,i),d=65280>>8*f-c&255;if(0!==(p.charCodeAt(0)&d))throw new Error("Bits beyond keysize not zero as expected.");var y=r.generate(h,l),g="";for(u=0;u<l;u++)g+=String.fromCharCode(p.charCodeAt(u)^y.charCodeAt(u));g=String.fromCharCode(g.charCodeAt(0)&~d)+g.substr(1);var v=f-i-a-2;for(u=0;u<v;u++)if(0!==g.charCodeAt(u))throw new Error("Leftmost octets not zero as expected");if(1!==g.charCodeAt(v))throw new Error("Inconsistent PSS signature, 0x01 marker not found");var m=g.substr(-a),b=new n.util.ByteBuffer,E;return b.fillWithByte(0,8),b.putBytes(e),b.putBytes(m),t.start(),t.update(b.getBytes()),h===t.digest().getBytes()}};return u}},function(e,t){},function(e,t,r){"use strict";r.d(t,"a",function(){return l});var n=r(6),i=r(5),o=r(9),a=r(10),s=r(25),u=function(e){function t(t,r){var n=e.call(this)||this;return n.subject=t,n.subscriber=r,n.closed=!1,n}return n.a(t,e),t.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var e=this.subject,t=e.observers;if(this.subject=null,t&&0!==t.length&&!e.isStopped&&!e.closed){var r=t.indexOf(this.subscriber);-1!==r&&t.splice(r,1)}}},t}(a.a),c=r(15),f=function(e){function t(t){var r=e.call(this,t)||this;return r.destination=t,r}return n.a(t,e),t}(o.a),l=function(e){function t(){var t=e.call(this)||this;return t.observers=[],t.closed=!1,t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return n.a(t,e),t.prototype[c.a]=function(){return new f(this)},t.prototype.lift=function(e){var t=new p(this,this);return t.operator=e,t},t.prototype.next=function(e){if(this.closed)throw new s.a;if(!this.isStopped)for(var t=this.observers,r=t.length,n=t.slice(),i=0;i<r;i++)n[i].next(e)},t.prototype.error=function(e){if(this.closed)throw new s.a;this.hasError=!0,this.thrownError=e,this.isStopped=!0;for(var t=this.observers,r=t.length,n=t.slice(),i=0;i<r;i++)n[i].error(e);this.observers.length=0},t.prototype.complete=function(){if(this.closed)throw new s.a;this.isStopped=!0;for(var e=this.observers,t=e.length,r=e.slice(),n=0;n<t;n++)r[n].complete();this.observers.length=0},t.prototype.unsubscribe=function(){this.isStopped=!0,this.closed=!0,this.observers=null},t.prototype._trySubscribe=function(t){if(this.closed)throw new s.a;return e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){if(this.closed)throw new s.a;return this.hasError?(e.error(this.thrownError),a.a.EMPTY):this.isStopped?(e.complete(),a.a.EMPTY):(this.observers.push(e),new u(this,e))},t.prototype.asObservable=function(){var e=new i.a;return e.source=this,e},t.create=function(e,t){return new p(e,t)},t}(i.a),p=function(e){function t(t,r){var n=e.call(this)||this;return n.destination=t,n.source=r,n}return n.a(t,e),t.prototype.next=function(e){var t=this.destination;t&&t.next&&t.next(e)},t.prototype.error=function(e){var t=this.destination;t&&t.error&&this.destination.error(e)},t.prototype.complete=function(){var e=this.destination;e&&e.complete&&this.destination.complete()},t.prototype._subscribe=function(e){var t;return this.source?this.source.subscribe(e):a.a.EMPTY},t}(l)},function(e,t,r){"use strict";var n=r(173),i=r(174),o=r(113);e.exports={formats:o,parse:i,stringify:n}},function(e,t,r){var n,i;n=this,i=function(){"use strict";var e="millisecond",t="second",r="minute",n="hour",i="day",o="week",a="month",s="quarter",u="year",c="date",f=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[^0-9]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?.?(\d+)?$/,l=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,p={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},h=function(e,t,r){var n=String(e);return!n||n.length>=t?e:""+Array(t+1-n.length).join(r)+e},d={s:h,z:function(e){var t=-e.utcOffset(),r=Math.abs(t),n=Math.floor(r/60),i=r%60;return(t<=0?"+":"-")+h(n,2,"0")+":"+h(i,2,"0")},m:function e(t,r){if(t.date()<r.date())return-e(r,t);var n=12*(r.year()-t.year())+(r.month()-t.month()),i=t.clone().add(n,a),o=r-i<0,s=t.clone().add(n+(o?-1:1),a);return+(-(n+(r-i)/(o?i-s:s-i))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(f){return{M:a,y:u,w:o,d:i,D:c,h:n,m:r,s:t,ms:e,Q:s}[f]||String(f||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},y="en",g={};g[y]=p;var v=function(e){return e instanceof T},m=function(e,t,r){var n;if(!e)return y;if("string"==typeof e)g[e]&&(n=e),t&&(g[e]=t,n=e);else{var i=e.name;g[i]=e,n=i}return!r&&n&&(y=n),n||!r&&y},b=function(e,t){if(v(e))return e.clone();var r="object"==typeof t?t:{};return r.date=e,r.args=arguments,new T(r)},E=d;E.l=m,E.i=v,E.w=function(e,t){return b(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var T=function(){function p(e){this.$L=m(e.locale,null,!0),this.parse(e)}var h=p.prototype;return h.parse=function(e){this.$d=function(e){var t=e.date,r=e.utc;if(null===t)return new Date(NaN);if(E.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var n=t.match(f);if(n){var i=n[2]-1||0,o=(n[7]||"0").substring(0,3);return r?new Date(Date.UTC(n[1],i,n[3]||1,n[4]||0,n[5]||0,n[6]||0,o)):new Date(n[1],i,n[3]||1,n[4]||0,n[5]||0,n[6]||0,o)}}return new Date(t)}(e),this.$x=e.x||{},this.init()},h.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},h.$utils=function(){return E},h.isValid=function(){return!("Invalid Date"===this.$d.toString())},h.isSame=function(e,t){var r=b(e);return this.startOf(t)<=r&&r<=this.endOf(t)},h.isAfter=function(e,t){return b(e)<this.startOf(t)},h.isBefore=function(e,t){return this.endOf(t)<b(e)},h.$g=function(e,t,r){return E.u(e)?this[t]:this.set(r,e)},h.unix=function(){return Math.floor(this.valueOf()/1e3)},h.valueOf=function(){return this.$d.getTime()},h.startOf=function(e,s){var f=this,l=!!E.u(s)||s,p=E.p(e),h=function(e,t){var r=E.w(f.$u?Date.UTC(f.$y,t,e):new Date(f.$y,t,e),f);return l?r:r.endOf(i)},d=function(e,t){return E.w(f.toDate()[e].apply(f.toDate("s"),(l?[0,0,0,0]:[23,59,59,999]).slice(t)),f)},y=this.$W,g=this.$M,v=this.$D,m="set"+(this.$u?"UTC":"");switch(p){case u:return l?h(1,0):h(31,11);case a:return l?h(1,g):h(0,g+1);case o:var b=this.$locale().weekStart||0,T=(y<b?y+7:y)-b;return h(l?v-T:v+(6-T),g);case i:case c:return d(m+"Hours",0);case n:return d(m+"Minutes",1);case r:return d(m+"Seconds",2);case t:return d(m+"Milliseconds",3);default:return this.clone()}},h.endOf=function(e){return this.startOf(e,!1)},h.$set=function(o,s){var f,l=E.p(o),p="set"+(this.$u?"UTC":""),h=(f={},f[i]=p+"Date",f[c]=p+"Date",f[a]=p+"Month",f[u]=p+"FullYear",f[n]=p+"Hours",f[r]=p+"Minutes",f[t]=p+"Seconds",f[e]=p+"Milliseconds",f)[l],d=l===i?this.$D+(s-this.$W):s;if(l===a||l===u){var y=this.clone().set(c,1);y.$d[h](d),y.init(),this.$d=y.set(c,Math.min(this.$D,y.daysInMonth())).$d}else h&&this.$d[h](d);return this.init(),this},h.set=function(e,t){return this.clone().$set(e,t)},h.get=function(e){return this[E.p(e)]()},h.add=function(e,s){var c,f=this;e=Number(e);var l=E.p(s),p=function(t){var r=b(f);return E.w(r.date(r.date()+Math.round(t*e)),f)};if(l===a)return this.set(a,this.$M+e);if(l===u)return this.set(u,this.$y+e);if(l===i)return p(1);if(l===o)return p(7);var h=(c={},c[r]=6e4,c[n]=36e5,c[t]=1e3,c)[l]||1,d=this.$d.getTime()+e*h;return E.w(d,this)},h.subtract=function(e,t){return this.add(-1*e,t)},h.format=function(e){var t=this;if(!this.isValid())return"Invalid Date";var r=e||"YYYY-MM-DDTHH:mm:ssZ",n=E.z(this),i=this.$locale(),o=this.$H,a=this.$m,s=this.$M,u=i.weekdays,c=i.months,f=function(e,n,i,o){return e&&(e[n]||e(t,r))||i[n].substr(0,o)},p=function(e){return E.s(o%12||12,e,"0")},h=i.meridiem||function(e,t,r){var n=e<12?"AM":"PM";return r?n.toLowerCase():n},d={YY:String(this.$y).slice(-2),YYYY:this.$y,M:s+1,MM:E.s(s+1,2,"0"),MMM:f(i.monthsShort,s,c,3),MMMM:f(c,s),D:this.$D,DD:E.s(this.$D,2,"0"),d:String(this.$W),dd:f(i.weekdaysMin,this.$W,u,2),ddd:f(i.weekdaysShort,this.$W,u,3),dddd:u[this.$W],H:String(o),HH:E.s(o,2,"0"),h:p(1),hh:p(2),a:h(o,a,!0),A:h(o,a,!1),m:String(a),mm:E.s(a,2,"0"),s:String(this.$s),ss:E.s(this.$s,2,"0"),SSS:E.s(this.$ms,3,"0"),Z:n};return r.replace(l,function(e,t){return t||d[e]||n.replace(":","")})},h.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},h.diff=function(e,c,f){var l,p=E.p(c),h=b(e),d=6e4*(h.utcOffset()-this.utcOffset()),y=this-h,g=E.m(this,h);return g=(l={},l[u]=g/12,l[a]=g,l[s]=g/3,l[o]=(y-d)/6048e5,l[i]=(y-d)/864e5,l[n]=y/36e5,l[r]=y/6e4,l[t]=y/1e3,l)[p]||y,f?g:E.a(g)},h.daysInMonth=function(){return this.endOf(a).$D},h.$locale=function(){return g[this.$L]},h.locale=function(e,t){if(!e)return this.$L;var r=this.clone(),n=m(e,t,!0);return n&&(r.$L=n),r},h.clone=function(){return E.w(this.$d,this)},h.toDate=function(){return new Date(this.valueOf())},h.toJSON=function(){return this.isValid()?this.toISOString():null},h.toISOString=function(){return this.$d.toISOString()},h.toString=function(){return this.$d.toUTCString()},p}(),S=T.prototype;return b.prototype=S,[["$ms",e],["$s",t],["$m",r],["$H",n],["$W",i],["$M",a],["$y",u],["$D",c]].forEach(function(e){S[e[1]]=function(t){return this.$g(t,e[0],e[1])}}),b.extend=function(e,t){return e.$i||(e(t,T,b),e.$i=!0),b},b.locale=m,b.isDayjs=v,b.unix=function(e){return b(1e3*e)},b.en=g[y],b.Ls=g,b.p={},b},e.exports=i()},function(e,t,r){"use strict";var n=r(113),i=Object.prototype.hasOwnProperty,o=Array.isArray,a=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),s=function e(t){for(;t.length>1;){var r=t.pop(),n=r.obj[r.prop];if(o(n)){for(var i=[],a=0;a<n.length;++a)void 0!==n[a]&&i.push(n[a]);r.obj[r.prop]=i}}},u=function e(t,r){for(var n=r&&r.plainObjects?Object.create(null):{},i=0;i<t.length;++i)void 0!==t[i]&&(n[i]=t[i]);return n},c=function e(t,r,n){if(!r)return t;if("object"!=typeof r){if(o(t))t.push(r);else{if(!t||"object"!=typeof t)return[t,r];(n&&(n.plainObjects||n.allowPrototypes)||!i.call(Object.prototype,r))&&(t[r]=!0)}return t}if(!t||"object"!=typeof t)return[t].concat(r);var a=t;return o(t)&&!o(r)&&(a=u(t,n)),o(t)&&o(r)?(r.forEach(function(r,o){if(i.call(t,o)){var a=t[o];a&&"object"==typeof a&&r&&"object"==typeof r?t[o]=e(a,r,n):t.push(r)}else t[o]=r}),t):Object.keys(r).reduce(function(t,o){var a=r[o];return i.call(t,o)?t[o]=e(t[o],a,n):t[o]=a,t},a)},f=function e(t,r){return Object.keys(r).reduce(function(e,t){return e[t]=r[t],e},t)},l=function(e,t,r){var n=e.replace(/\+/g," ");if("iso-8859-1"===r)return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch(e){return n}},p=function e(t,r,i,o,s){if(0===t.length)return t;var u=t;if("symbol"==typeof t?u=Symbol.prototype.toString.call(t):"string"!=typeof t&&(u=String(t)),"iso-8859-1"===i)return escape(u).replace(/%u[0-9a-f]{4}/gi,function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"});for(var c="",f=0;f<u.length;++f){var l=u.charCodeAt(f);45===l||46===l||95===l||126===l||l>=48&&l<=57||l>=65&&l<=90||l>=97&&l<=122||s===n.RFC1738&&(40===l||41===l)?c+=u.charAt(f):l<128?c+=a[l]:l<2048?c+=a[192|l>>6]+a[128|63&l]:l<55296||l>=57344?c+=a[224|l>>12]+a[128|l>>6&63]+a[128|63&l]:(f+=1,l=65536+((1023&l)<<10|1023&u.charCodeAt(f)),c+=a[240|l>>18]+a[128|l>>12&63]+a[128|l>>6&63]+a[128|63&l])}return c},h=function e(t){for(var r=[{obj:{o:t},prop:"o"}],n=[],i=0;i<r.length;++i)for(var o=r[i],a=o.obj[o.prop],u=Object.keys(a),c=0;c<u.length;++c){var f=u[c],l=a[f];"object"==typeof l&&null!==l&&-1===n.indexOf(l)&&(r.push({obj:a,prop:f}),n.push(l))}return s(r),t},d=function e(t){return"[object RegExp]"===Object.prototype.toString.call(t)},y=function e(t){return!(!t||"object"!=typeof t)&&!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))},g=function e(t,r){return[].concat(t,r)},v=function e(t,r){if(o(t)){for(var n=[],i=0;i<t.length;i+=1)n.push(r(t[i]));return n}return r(t)};e.exports={arrayToObject:u,assign:f,combine:g,compact:h,decode:l,encode:p,isBuffer:y,isRegExp:d,maybeMap:v,merge:c}},function(e,t,r){"use strict";function n(){var e,t,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",a=r.toStringTag||"@@toStringTag";function s(r,n,o,a){var s=n&&n.prototype instanceof c?n:c,f=Object.create(s.prototype);return i(f,"_invoke",function(r,n,i){var o,a,s,c=0,f=i||[],l=!1,p={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function t(r,n){return o=r,a=0,s=e,p.n=n,u}};function h(r,n){for(a=r,s=n,t=0;!l&&c&&!i&&t<f.length;t++){var i,o=f[t],h=p.p,d=o[2];r>3?(i=d===n)&&(s=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=e):o[0]<=h&&((i=r<2&&h<o[1])?(a=0,p.v=n,p.n=o[1]):h<d&&(i=r<3||o[0]>n||n>d)&&(o[4]=r,o[5]=n,p.n=d,a=0))}if(i||r>1)return u;throw l=!0,n}return function(i,f,d){if(c>1)throw TypeError("Generator is already running");for(l&&1===f&&h(f,d),a=f,s=d;(t=a<2?e:s)||!l;){o||(a?a<3?(a>1&&(p.n=-1),h(a,s)):p.n=s:p.v=s);try{if(c=2,o){if(a||(i="next"),t=o[i]){if(!(t=t.call(o,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,a<2&&(a=0)}else 1===a&&(t=o.return)&&t.call(o),a<2&&(s=TypeError("The iterator does not provide a '"+i+"' method"),a=1);o=e}else if((t=(l=p.n<0)?s:r.call(n,p))!==u)break}catch(t){o=e,a=1,s=t}finally{c=1}}return{value:t,done:l}}}(r,o,a),!0),f}var u={};function c(){}function f(){}function l(){}t=Object.getPrototypeOf;var p=[][o]?t(t([][o]())):(i(t={},o,function(){return this}),t),h=l.prototype=c.prototype=Object.create(p);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,i(e,a,"GeneratorFunction")),e.prototype=Object.create(h),e}return f.prototype=l,i(h,"constructor",l),i(l,"constructor",f),f.displayName="GeneratorFunction",i(l,a,"GeneratorFunction"),i(h),i(h,a,"Generator"),i(h,o,function(){return this}),i(h,"toString",function(){return"[object Generator]"}),(n=function e(){return{w:s,m:d}})()}function i(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}i=function e(t,r,n,a){function s(e,r){i(t,e,function(t){return this._invoke(e,r,t)})}r?o?o(t,r,{value:n,enumerable:!a,configurable:!a,writable:!a}):t[r]=n:(s("next",0),s("throw",1),s("return",2))},i(e,t,r,n)}function o(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function a(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function s(e){o(a,n,i,s,u,"next",e)}function u(e){o(a,n,i,s,u,"throw",e)}s(void 0)})}}var s=r(176),u={};e.exports=u,u.extendContextLoader=function(e){return function(){var t=a(n().m(function t(r){var i;return n().w(function(t){for(;;)switch(t.n){case 0:if(void 0===(i=s[r])){t.n=1;break}return t.a(2,{contextUrl:null,documentUrl:r,document:i});case 1:return t.a(2,e(r))}},t)}));return function(e){return t.apply(this,arguments)}}()},u.strictDocumentLoader=u.extendContextLoader(function(e){throw new Error("".concat(e," not found."))})},function(e,t,r){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",a=r.toStringTag||"@@toStringTag";function s(r,n,i,a){var s=n&&n.prototype instanceof c?n:c,f=Object.create(s.prototype);return o(f,"_invoke",function(r,n,i){var o,a,s,c=0,f=i||[],l=!1,p={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function t(r,n){return o=r,a=0,s=e,p.n=n,u}};function h(r,n){for(a=r,s=n,t=0;!l&&c&&!i&&t<f.length;t++){var i,o=f[t],h=p.p,d=o[2];r>3?(i=d===n)&&(s=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=e):o[0]<=h&&((i=r<2&&h<o[1])?(a=0,p.v=n,p.n=o[1]):h<d&&(i=r<3||o[0]>n||n>d)&&(o[4]=r,o[5]=n,p.n=d,a=0))}if(i||r>1)return u;throw l=!0,n}return function(i,f,d){if(c>1)throw TypeError("Generator is already running");for(l&&1===f&&h(f,d),a=f,s=d;(t=a<2?e:s)||!l;){o||(a?a<3?(a>1&&(p.n=-1),h(a,s)):p.n=s:p.v=s);try{if(c=2,o){if(a||(i="next"),t=o[i]){if(!(t=t.call(o,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,a<2&&(a=0)}else 1===a&&(t=o.return)&&t.call(o),a<2&&(s=TypeError("The iterator does not provide a '"+i+"' method"),a=1);o=e}else if((t=(l=p.n<0)?s:r.call(n,p))!==u)break}catch(t){o=e,a=1,s=t}finally{c=1}}return{value:t,done:l}}}(r,i,a),!0),f}var u={};function c(){}function f(){}function l(){}t=Object.getPrototypeOf;var p=[][n]?t(t([][n]())):(o(t={},n,function(){return this}),t),h=l.prototype=c.prototype=Object.create(p);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,o(e,a,"GeneratorFunction")),e.prototype=Object.create(h),e}return f.prototype=l,o(h,"constructor",l),o(l,"constructor",f),f.displayName="GeneratorFunction",o(l,a,"GeneratorFunction"),o(h),o(h,a,"Generator"),o(h,n,function(){return this}),o(h,"toString",function(){return"[object Generator]"}),(i=function e(){return{w:s,m:d}})()}function o(e,t,r,n){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}o=function e(t,r,n,a){function s(e,r){o(t,e,function(t){return this._invoke(e,r,t)})}r?i?i(t,r,{value:n,enumerable:!a,configurable:!a,writable:!a}):t[r]=n:(s("next",0),s("throw",1),s("return",2))},o(e,t,r,n)}function a(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function s(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var o=e.apply(t,r);function s(e){a(o,n,i,s,u,"next",e)}function u(e){a(o,n,i,s,u,"throw",e)}s(void 0)})}}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,l(n.key),n)}}function f(e,t,r){return t&&c(e.prototype,t),r&&c(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function l(e){var t=p(e,"string");return"symbol"==n(t)?t:t+""}function p(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function h(e,t,r){return t=v(t),d(e,g()?Reflect.construct(t,r||[],v(e).constructor):t.apply(e,r))}function d(e,t){if(t&&("object"==n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return y(e)}function y(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function g(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(g=function t(){return!!e})()}function v(e){return v=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},v(e)}function m(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&b(e,t)}function b(e,t){return b=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},b(e,t)}var E=r(72);e.exports=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e.controller,n=e.date,i=e.maxTimestampDelta,o=void 0===i?1/0:i;return u(this,t),h(this,t,[{term:"publicKey",controller:r,date:n,maxTimestampDelta:o}])}return m(t,e),f(t,[{key:"update",value:function(){var e=s(i().m(function e(t){return i().w(function(e){for(;;)if(0===e.n)return e.a(2,t)},e)}));function t(t){return e.apply(this,arguments)}return t}()},{key:"match",value:function(){var e=s(i().m(function e(t){return i().w(function(e){for(;;)if(0===e.n)return e.a(2,void 0===t.proofPurpose)},e)}));function t(t){return e.apply(this,arguments)}return t}()}])}(E)},function(e,t,r){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",a=r.toStringTag||"@@toStringTag";function s(r,n,i,a){var s=n&&n.prototype instanceof c?n:c,f=Object.create(s.prototype);return o(f,"_invoke",function(r,n,i){var o,a,s,c=0,f=i||[],l=!1,p={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function t(r,n){return o=r,a=0,s=e,p.n=n,u}};function h(r,n){for(a=r,s=n,t=0;!l&&c&&!i&&t<f.length;t++){var i,o=f[t],h=p.p,d=o[2];r>3?(i=d===n)&&(s=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=e):o[0]<=h&&((i=r<2&&h<o[1])?(a=0,p.v=n,p.n=o[1]):h<d&&(i=r<3||o[0]>n||n>d)&&(o[4]=r,o[5]=n,p.n=d,a=0))}if(i||r>1)return u;throw l=!0,n}return function(i,f,d){if(c>1)throw TypeError("Generator is already running");for(l&&1===f&&h(f,d),a=f,s=d;(t=a<2?e:s)||!l;){o||(a?a<3?(a>1&&(p.n=-1),h(a,s)):p.n=s:p.v=s);try{if(c=2,o){if(a||(i="next"),t=o[i]){if(!(t=t.call(o,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,a<2&&(a=0)}else 1===a&&(t=o.return)&&t.call(o),a<2&&(s=TypeError("The iterator does not provide a '"+i+"' method"),a=1);o=e}else if((t=(l=p.n<0)?s:r.call(n,p))!==u)break}catch(t){o=e,a=1,s=t}finally{c=1}}return{value:t,done:l}}}(r,i,a),!0),f}var u={};function c(){}function f(){}function l(){}t=Object.getPrototypeOf;var p=[][n]?t(t([][n]())):(o(t={},n,function(){return this}),t),h=l.prototype=c.prototype=Object.create(p);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,o(e,a,"GeneratorFunction")),e.prototype=Object.create(h),e}return f.prototype=l,o(h,"constructor",l),o(l,"constructor",f),f.displayName="GeneratorFunction",o(l,a,"GeneratorFunction"),o(h),o(h,a,"Generator"),o(h,n,function(){return this}),o(h,"toString",function(){return"[object Generator]"}),(i=function e(){return{w:s,m:d}})()}function o(e,t,r,n){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}o=function e(t,r,n,a){function s(e,r){o(t,e,function(t){return this._invoke(e,r,t)})}r?i?i(t,r,{value:n,enumerable:!a,configurable:!a,writable:!a}):t[r]=n:(s("next",0),s("throw",1),s("return",2))},o(e,t,r,n)}function a(e){if(null==e)throw new TypeError("Cannot destructure "+e)}function s(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function u(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var o=e.apply(t,r);function a(e){s(o,n,i,a,u,"next",e)}function u(e){s(o,n,i,a,u,"throw",e)}a(void 0)})}}function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,p(n.key),n)}}function l(e,t,r){return t&&f(e.prototype,t),r&&f(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function p(e){var t=h(e,"string");return"symbol"==n(t)?t:t+""}function h(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}e.exports=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.term,n=t.date,i=t.maxTimestampDelta,o=void 0===i?1/0:i;if(c(this,e),void 0===r)throw new Error('"term" is required.');if(void 0!==o&&"number"!=typeof o)throw new TypeError('"maxTimestampDelta" must be a number.');if(this.term=r,void 0!==n&&(this.date=new Date(n),isNaN(this.date)))throw TypeError('"date" "'.concat(n,'" is not a valid date.'));this.maxTimestampDelta=o}return l(e,[{key:"validate",value:function(){var e=u(i().m(function e(t,r){var n,o,s,u;return i().w(function(e){for(;;)switch(e.p=e.n){case 0:if(a(r),e.p=1,this.maxTimestampDelta===1/0){e.n=2;break}if(n=(this.date||new Date).getTime(),o=1e3*this.maxTimestampDelta,(s=new Date(t.created).getTime())>=n-o&&s<=n+o){e.n=2;break}throw new Error("The proof's created timestamp is out of range.");case 2:return e.a(2,{valid:!0});case 3:return e.p=3,u=e.v,e.a(2,{valid:!1,error:u})}},e,this,[[1,3]])}));function t(t,r){return e.apply(this,arguments)}return t}()},{key:"update",value:function(){var e=u(i().m(function e(t,r){return i().w(function(e){for(;;)if(0===e.n)return a(r),t.proofPurpose=this.term,e.a(2,t)},e,this)}));function t(t,r){return e.apply(this,arguments)}return t}()},{key:"match",value:function(){var e=u(i().m(function e(t,r){return i().w(function(e){for(;;)if(0===e.n)return a(r),e.a(2,t.proofPurpose===this.term)},e,this)}));function t(t,r){return e.apply(this,arguments)}return t}()}])}()},function(e,t,r){"use strict";(function(t){var n=r(133),i=r(117),o={};function a(){return n.nodejs?function(e,r){var n=t.from(e,r);return new Uint8Array(n.buffer,n.byteOffset,n.length)}:function(e,t){var r=new i.util.ByteBuffer(e,t);return i.util.binary.raw.decode(r.getBytes())}}function s(){return n.nodejs?function(e,r){var n=t.concat([t.from(e.buffer,e.byteOffset,e.length),t.from(r.buffer,r.byteOffset,r.length)]);return new Uint8Array(n.buffer,n.byteOffset,n.length)}:function(e,t){var r=new Uint8Array(e.length+t.length);return r.set(e,0),r.set(t,e.length),r}}function u(){if(n.nodejs){var e=r(199);return function(t,r){var n=e.createHash("sha256");n.update(t,r);var i=n.digest();return new Uint8Array(i.buffer,i.byteOffset,i.length)}}return function(e,t){var r=i.md.sha256.create();r.update(e,t||"utf8");var n=r.digest();return i.util.binary.raw.decode(n.getBytes())}}function c(){return n.nodejs?function(e){var r=e.encodedHeader,n=e.verifyData,i=t.concat([t.from(r+".","utf8"),t.from(n.buffer,n.byteOffset,n.length)]);return new Uint8Array(i.buffer,i.byteOffset,i.length)}:function(e){var t=e.encodedHeader,r=e.verifyData,n=new i.util.ByteBuffer(t+".","utf8"),o=i.util.binary.raw.encode(r);return n.putBytes(o),i.util.binary.raw.decode(n.getBytes())}}function f(){if(n.nodejs){var e=r(124);return function(r){return e("string"==typeof r?r:t.from(r.buffer,r.byteOffset,r.length))}}return function(e){var t,r;return t="string"==typeof e?i.util.encodeUtf8(e):i.util.binary.raw.encode(e),i.util.encode64(t).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}}function l(){if(n.nodejs){var e=r(124);return function(t){var r=e.toBuffer(t);return new Uint8Array(r.buffer,r.offset,r.length)}}return function(e){var t=e.replace(/-/g,"+").replace(/_/g,"/"),r=t.length%4;if(0===r);else if(2===r)t+="==";else{if(3!==r)throw new Error("Illegal base64 string.");t+="="}return i.util.binary.base64.decode(t)}}function p(){if(n.nodejs){var e=r(124);return function(t){return e.decode(t)}}return function(e){var t=e.replace(/-/g,"+").replace(/_/g,"/"),r=t.length%4;if(0===r);else if(2===r)t+="==";else{if(3!==r)throw new Error("Illegal base64 string.");t+="="}var n=i.util.decode64(t);return i.util.decodeUtf8(n)}}e.exports=o,o.createJws=c(),o.w3cDate=function(e){null==e?e=new Date:"number"!=typeof e&&"string"!=typeof e||(e=new Date(e));var t=e.toISOString();return t.substr(0,t.length-5)+"Z"},o.encodeBase64Url=f(),o.decodeBase64Url=l(),o.decodeBase64UrlToString=p(),o.sha256=u(),o.concat=s(),o.stringToBytes=a()}).call(this,r(116).Buffer)},function(e,t,r){"use strict";(function(t){var r=void 0!==t&&t.versions&&t.versions.node,n=!r&&("undefined"!=typeof window||"undefined"!=typeof self);e.exports={nodejs:r,browser:n}}).call(this,r(36))},function(e,t,r){(function(e){var n=void 0!==e&&e||"undefined"!=typeof self&&self||window,i=Function.prototype.apply;function o(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new o(i.call(setTimeout,n,arguments),clearTimeout)},t.setInterval=function(){return new o(i.call(setInterval,n,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(n,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout(function t(){e._onTimeout&&e._onTimeout()},t))},r(188),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,r(29))},function(e,t,r){var n=r(4);r(8),n.cipher=n.cipher||{};var i=e.exports=n.cipher.modes=n.cipher.modes||{};function o(e,t){if("string"==typeof e&&(e=n.util.createBuffer(e)),n.util.isArray(e)&&e.length>4){var r=e;e=n.util.createBuffer();for(var i=0;i<r.length;++i)e.putByte(r[i])}if(e.length()<t)throw new Error("Invalid IV length; got "+e.length()+" bytes and expected "+t+" bytes.");if(!n.util.isArray(e)){for(var o=[],a=t/4,i=0;i<a;++i)o.push(e.getInt32());e=o}return e}function a(e){e[e.length-1]=e[e.length-1]+1&4294967295}function s(e){return[e/4294967296|0,4294967295&e]}i.ecb=function(e){e=e||{},this.name="ECB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)},i.ecb.prototype.start=function(e){},i.ecb.prototype.encrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=e.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(var n=0;n<this._ints;++n)t.putInt32(this._outBlock[n])},i.ecb.prototype.decrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=e.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(var n=0;n<this._ints;++n)t.putInt32(this._outBlock[n])},i.ecb.prototype.pad=function(e,t){var r=e.length()===this.blockSize?this.blockSize:this.blockSize-e.length();return e.fillWithByte(r,r),!0},i.ecb.prototype.unpad=function(e,t){if(t.overflow>0)return!1;var r=e.length(),n=e.at(r-1);return!(n>this.blockSize<<2)&&(e.truncate(n),!0)},i.cbc=function(e){e=e||{},this.name="CBC",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)},i.cbc.prototype.start=function(e){if(null===e.iv){if(!this._prev)throw new Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else{if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=o(e.iv,this.blockSize),this._prev=this._iv.slice(0)}},i.cbc.prototype.encrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=this._prev[n]^e.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(var n=0;n<this._ints;++n)t.putInt32(this._outBlock[n]);this._prev=this._outBlock},i.cbc.prototype.decrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=e.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(var n=0;n<this._ints;++n)t.putInt32(this._prev[n]^this._outBlock[n]);this._prev=this._inBlock.slice(0)},i.cbc.prototype.pad=function(e,t){var r=e.length()===this.blockSize?this.blockSize:this.blockSize-e.length();return e.fillWithByte(r,r),!0},i.cbc.prototype.unpad=function(e,t){if(t.overflow>0)return!1;var r=e.length(),n=e.at(r-1);return!(n>this.blockSize<<2)&&(e.truncate(n),!0)},i.cfb=function(e){e=e||{},this.name="CFB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0},i.cfb.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=o(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},i.cfb.prototype.encrypt=function(e,t,r){var n=e.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i<this._ints;++i)this._inBlock[i]=e.getInt32()^this._outBlock[i],t.putInt32(this._inBlock[i]);else{var o=(this.blockSize-n)%this.blockSize;o>0&&(o=this.blockSize-o),this._partialOutput.clear();for(var i=0;i<this._ints;++i)this._partialBlock[i]=e.getInt32()^this._outBlock[i],this._partialOutput.putInt32(this._partialBlock[i]);if(o>0)e.read-=this.blockSize;else for(var i=0;i<this._ints;++i)this._inBlock[i]=this._partialBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),o>0&&!r)return t.putBytes(this._partialOutput.getBytes(o-this._partialBytes)),this._partialBytes=o,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},i.cfb.prototype.decrypt=function(e,t,r){var n=e.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i<this._ints;++i)this._inBlock[i]=e.getInt32(),t.putInt32(this._inBlock[i]^this._outBlock[i]);else{var o=(this.blockSize-n)%this.blockSize;o>0&&(o=this.blockSize-o),this._partialOutput.clear();for(var i=0;i<this._ints;++i)this._partialBlock[i]=e.getInt32(),this._partialOutput.putInt32(this._partialBlock[i]^this._outBlock[i]);if(o>0)e.read-=this.blockSize;else for(var i=0;i<this._ints;++i)this._inBlock[i]=this._partialBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),o>0&&!r)return t.putBytes(this._partialOutput.getBytes(o-this._partialBytes)),this._partialBytes=o,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},i.ofb=function(e){e=e||{},this.name="OFB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0},i.ofb.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=o(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},i.ofb.prototype.encrypt=function(e,t,r){var n=e.length();if(0===e.length())return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i<this._ints;++i)t.putInt32(e.getInt32()^this._outBlock[i]),this._inBlock[i]=this._outBlock[i];else{var o=(this.blockSize-n)%this.blockSize;o>0&&(o=this.blockSize-o),this._partialOutput.clear();for(var i=0;i<this._ints;++i)this._partialOutput.putInt32(e.getInt32()^this._outBlock[i]);if(o>0)e.read-=this.blockSize;else for(var i=0;i<this._ints;++i)this._inBlock[i]=this._outBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),o>0&&!r)return t.putBytes(this._partialOutput.getBytes(o-this._partialBytes)),this._partialBytes=o,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},i.ofb.prototype.decrypt=i.ofb.prototype.encrypt,i.ctr=function(e){e=e||{},this.name="CTR",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0},i.ctr.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=o(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},i.ctr.prototype.encrypt=function(e,t,r){var n=e.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i<this._ints;++i)t.putInt32(e.getInt32()^this._outBlock[i]);else{var o=(this.blockSize-n)%this.blockSize;o>0&&(o=this.blockSize-o),this._partialOutput.clear();for(var i=0;i<this._ints;++i)this._partialOutput.putInt32(e.getInt32()^this._outBlock[i]);if(o>0&&(e.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),o>0&&!r)return t.putBytes(this._partialOutput.getBytes(o-this._partialBytes)),this._partialBytes=o,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}a(this._inBlock)},i.ctr.prototype.decrypt=i.ctr.prototype.encrypt,i.gcm=function(e){e=e||{},this.name="GCM",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0,this._R=3774873600},i.gcm.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");var t=n.util.createBuffer(e.iv),r;if(this._cipherLength=0,r="additionalData"in e?n.util.createBuffer(e.additionalData):n.util.createBuffer(),this._tagLength="tagLength"in e?e.tagLength:128,this._tag=null,e.decrypt&&(this._tag=n.util.createBuffer(e.tag).getBytes(),this._tag.length!==this._tagLength/8))throw new Error("Authentication tag does not match tag length.");this._hashBlock=new Array(this._ints),this.tag=null,this._hashSubkey=new Array(this._ints),this.cipher.encrypt([0,0,0,0],this._hashSubkey),this.componentBits=4,this._m=this.generateHashTable(this._hashSubkey,this.componentBits);var i=t.length();if(12===i)this._j0=[t.getInt32(),t.getInt32(),t.getInt32(),1];else{for(this._j0=[0,0,0,0];t.length()>0;)this._j0=this.ghash(this._hashSubkey,this._j0,[t.getInt32(),t.getInt32(),t.getInt32(),t.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(s(8*i)))}this._inBlock=this._j0.slice(0),a(this._inBlock),this._partialBytes=0,r=n.util.createBuffer(r),this._aDataLength=s(8*r.length());var o=r.length()%this.blockSize;for(o&&r.fillWithByte(0,this.blockSize-o),this._s=[0,0,0,0];r.length()>0;)this._s=this.ghash(this._hashSubkey,this._s,[r.getInt32(),r.getInt32(),r.getInt32(),r.getInt32()])},i.gcm.prototype.encrypt=function(e,t,r){var n=e.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize){for(var i=0;i<this._ints;++i)t.putInt32(this._outBlock[i]^=e.getInt32());this._cipherLength+=this.blockSize}else{var o=(this.blockSize-n)%this.blockSize;o>0&&(o=this.blockSize-o),this._partialOutput.clear();for(var i=0;i<this._ints;++i)this._partialOutput.putInt32(e.getInt32()^this._outBlock[i]);if(o<=0||r){if(r){var s=n%this.blockSize;this._cipherLength+=s,this._partialOutput.truncate(this.blockSize-s)}else this._cipherLength+=this.blockSize;for(var i=0;i<this._ints;++i)this._outBlock[i]=this._partialOutput.getInt32();this._partialOutput.read-=this.blockSize}if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),o>0&&!r)return e.read-=this.blockSize,t.putBytes(this._partialOutput.getBytes(o-this._partialBytes)),this._partialBytes=o,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),a(this._inBlock)},i.gcm.prototype.decrypt=function(e,t,r){var n=e.length();if(n<this.blockSize&&!(r&&n>0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),a(this._inBlock),this._hashBlock[0]=e.getInt32(),this._hashBlock[1]=e.getInt32(),this._hashBlock[2]=e.getInt32(),this._hashBlock[3]=e.getInt32(),this._s=this.ghash(this._hashSubkey,this._s,this._hashBlock);for(var i=0;i<this._ints;++i)t.putInt32(this._outBlock[i]^this._hashBlock[i]);n<this.blockSize?this._cipherLength+=n%this.blockSize:this._cipherLength+=this.blockSize},i.gcm.prototype.afterFinish=function(e,t){var r=!0;t.decrypt&&t.overflow&&e.truncate(this.blockSize-t.overflow),this.tag=n.util.createBuffer();var i=this._aDataLength.concat(s(8*this._cipherLength));this._s=this.ghash(this._hashSubkey,this._s,i);var o=[];this.cipher.encrypt(this._j0,o);for(var a=0;a<this._ints;++a)this.tag.putInt32(this._s[a]^o[a]);return this.tag.truncate(this.tag.length()%(this._tagLength/8)),t.decrypt&&this.tag.bytes()!==this._tag&&(r=!1),r},i.gcm.prototype.multiply=function(e,t){for(var r=[0,0,0,0],n=t.slice(0),i=0;i<128;++i){var o;e[i/32|0]&1<<31-i%32&&(r[0]^=n[0],r[1]^=n[1],r[2]^=n[2],r[3]^=n[3]),this.pow(n,n)}return r},i.gcm.prototype.pow=function(e,t){for(var r=1&e[3],n=3;n>0;--n)t[n]=e[n]>>>1|(1&e[n-1])<<31;t[0]=e[0]>>>1,r&&(t[0]^=this._R)},i.gcm.prototype.tableMultiply=function(e){for(var t=[0,0,0,0],r=0;r<32;++r){var n,i=e[r/8|0]>>>4*(7-r%8)&15,o=this._m[r][i];t[0]^=o[0],t[1]^=o[1],t[2]^=o[2],t[3]^=o[3]}return t},i.gcm.prototype.ghash=function(e,t,r){return t[0]^=r[0],t[1]^=r[1],t[2]^=r[2],t[3]^=r[3],this.tableMultiply(t)},i.gcm.prototype.generateHashTable=function(e,t){for(var r=8/t,n=4*r,i=16*r,o=new Array(i),a=0;a<i;++a){var s=[0,0,0,0],u,c=(n-1-a%n)*t;s[a/n|0]=1<<t-1<<c,o[a]=this.generateSubHashTable(this.multiply(s,e),t)}return o},i.gcm.prototype.generateSubHashTable=function(e,t){var r=1<<t,n=r>>>1,i=new Array(r);i[n]=e.slice(0);for(var o=n>>>1;o>0;)this.pow(i[2*o],i[o]=[]),o>>=1;for(o=2;o<n;){for(var a=1;a<o;++a){var s=i[o],u=i[a];i[o+a]=[s[0]^u[0],s[1]^u[1],s[2]^u[2],s[3]^u[3]]}o*=2}for(i[0]=[0,0,0,0],o=n+1;o<r;++o){var c=i[o^n];i[o]=[e[0]^c[0],e[1]^c[1],e[2]^c[2],e[3]^c[3]]}return i}},function(e,t,r){var n=r(4);r(33),r(68),r(119),r(51),r(137),r(31),r(69),r(8);var i=function(e,t,r,i){var o=n.util.createBuffer(),a=e.length>>1,s=a+(1&e.length),u=e.substr(0,s),c=e.substr(a,s),f=n.util.createBuffer(),l=n.hmac.create();r=t+r;var p=Math.ceil(i/16),h=Math.ceil(i/20);l.start("MD5",u);var d=n.util.createBuffer();f.putBytes(r);for(var y=0;y<p;++y)l.start(null,null),l.update(f.getBytes()),f.putBuffer(l.digest()),l.start(null,null),l.update(f.bytes()+r),d.putBuffer(l.digest());l.start("SHA1",c);var g=n.util.createBuffer();f.clear(),f.putBytes(r);for(var y=0;y<h;++y)l.start(null,null),l.update(f.getBytes()),f.putBuffer(l.digest()),l.start(null,null),l.update(f.bytes()+r),g.putBuffer(l.digest());return o.putBytes(n.util.xorBytes(d.getBytes(),g.getBytes(),i)),o},o=function(e,t,r,n){},a=function(e,t,r){var i=n.hmac.create();i.start("SHA1",e);var o=n.util.createBuffer();return o.putInt32(t[0]),o.putInt32(t[1]),o.putByte(r.type),o.putByte(r.version.major),o.putByte(r.version.minor),o.putInt16(r.length),o.putBytes(r.fragment.bytes()),i.update(o.getBytes()),i.digest().getBytes()},s=function(e,t,r){var i=!1;try{var o=e.deflate(t.fragment.getBytes());t.fragment=n.util.createBuffer(o),t.length=o.length,i=!0}catch(e){}return i},u=function(e,t,r){var i=!1;try{var o=e.inflate(t.fragment.getBytes());t.fragment=n.util.createBuffer(o),t.length=o.length,i=!0}catch(e){}return i},c=function(e,t){var r=0;switch(t){case 1:r=e.getByte();break;case 2:r=e.getInt16();break;case 3:r=e.getInt24();break;case 4:r=e.getInt32()}return n.util.createBuffer(e.getBytes(r))},f=function(e,t,r){e.putInt(r.length(),t<<3),e.putBuffer(r)},l={Versions:{TLS_1_0:{major:3,minor:1},TLS_1_1:{major:3,minor:2},TLS_1_2:{major:3,minor:3}}};l.SupportedVersions=[l.Versions.TLS_1_1,l.Versions.TLS_1_0],l.Version=l.SupportedVersions[0],l.MaxFragment=15360,l.ConnectionEnd={server:0,client:1},l.PRFAlgorithm={tls_prf_sha256:0},l.BulkCipherAlgorithm={none:null,rc4:0,des3:1,aes:2},l.CipherType={stream:0,block:1,aead:2},l.MACAlgorithm={none:null,hmac_md5:0,hmac_sha1:1,hmac_sha256:2,hmac_sha384:3,hmac_sha512:4},l.CompressionMethod={none:0,deflate:1},l.ContentType={change_cipher_spec:20,alert:21,handshake:22,application_data:23,heartbeat:24},l.HandshakeType={hello_request:0,client_hello:1,server_hello:2,certificate:11,server_key_exchange:12,certificate_request:13,server_hello_done:14,certificate_verify:15,client_key_exchange:16,finished:20},l.Alert={},l.Alert.Level={warning:1,fatal:2},l.Alert.Description={close_notify:0,unexpected_message:10,bad_record_mac:20,decryption_failed:21,record_overflow:22,decompression_failure:30,handshake_failure:40,bad_certificate:42,unsupported_certificate:43,certificate_revoked:44,certificate_expired:45,certificate_unknown:46,illegal_parameter:47,unknown_ca:48,access_denied:49,decode_error:50,decrypt_error:51,export_restriction:60,protocol_version:70,insufficient_security:71,internal_error:80,user_canceled:90,no_renegotiation:100},l.HeartbeatMessageType={heartbeat_request:1,heartbeat_response:2},l.CipherSuites={},l.getCipherSuite=function(e){var t=null;for(var r in l.CipherSuites){var n=l.CipherSuites[r];if(n.id[0]===e.charCodeAt(0)&&n.id[1]===e.charCodeAt(1)){t=n;break}}return t},l.handleUnexpected=function(e,t){var r;!e.open&&e.entity===l.ConnectionEnd.client||e.error(e,{message:"Unexpected message. Received TLS record out of order.",send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.unexpected_message}})},l.handleHelloRequest=function(e,t,r){!e.handshaking&&e.handshakes>0&&(l.queue(e,l.createAlert(e,{level:l.Alert.Level.warning,description:l.Alert.Description.no_renegotiation})),l.flush(e)),e.process()},l.parseHelloMessage=function(e,t,r){var i=null,o=e.entity===l.ConnectionEnd.client;if(r<38)e.error(e,{message:o?"Invalid ServerHello message. Message too short.":"Invalid ClientHello message. Message too short.",send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.illegal_parameter}});else{var a=t.fragment,s=a.length();if(i={version:{major:a.getByte(),minor:a.getByte()},random:n.util.createBuffer(a.getBytes(32)),session_id:c(a,1),extensions:[]},o?(i.cipher_suite=a.getBytes(2),i.compression_method=a.getByte()):(i.cipher_suites=c(a,2),i.compression_methods=c(a,1)),(s=r-(s-a.length()))>0){for(var u=c(a,2);u.length()>0;)i.extensions.push({type:[u.getByte(),u.getByte()],data:c(u,2)});if(!o)for(var f=0;f<i.extensions.length;++f){var p=i.extensions[f];if(0===p.type[0]&&0===p.type[1])for(var h=c(p.data,2);h.length()>0;){var d;if(0!==h.getByte())break;e.session.extensions.server_name.serverNameList.push(c(h,2).getBytes())}}}if(e.session.version&&(i.version.major!==e.session.version.major||i.version.minor!==e.session.version.minor))return e.error(e,{message:"TLS version change is disallowed during renegotiation.",send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.protocol_version}});if(o)e.session.cipherSuite=l.getCipherSuite(i.cipher_suite);else for(var y=n.util.createBuffer(i.cipher_suites.bytes());y.length()>0&&(e.session.cipherSuite=l.getCipherSuite(y.getBytes(2)),null===e.session.cipherSuite););if(null===e.session.cipherSuite)return e.error(e,{message:"No cipher suites in common.",send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.handshake_failure},cipherSuite:n.util.bytesToHex(i.cipher_suite)});e.session.compressionMethod=o?i.compression_method:l.CompressionMethod.none}return i},l.createSecurityParameters=function(e,t){var r=e.entity===l.ConnectionEnd.client,n=t.random.bytes(),i=r?e.session.sp.client_random:n,o=r?n:l.createRandom().getBytes();e.session.sp={entity:e.entity,prf_algorithm:l.PRFAlgorithm.tls_prf_sha256,bulk_cipher_algorithm:null,cipher_type:null,enc_key_length:null,block_length:null,fixed_iv_length:null,record_iv_length:null,mac_algorithm:null,mac_length:null,mac_key_length:null,compression_algorithm:e.session.compressionMethod,pre_master_secret:null,master_secret:null,client_random:i,server_random:o}},l.handleServerHello=function(e,t,r){var n=l.parseHelloMessage(e,t,r);if(!e.fail){if(!(n.version.minor<=e.version.minor))return e.error(e,{message:"Incompatible TLS version.",send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.protocol_version}});e.version.minor=n.version.minor,e.session.version=e.version;var i=n.session_id.bytes();i.length>0&&i===e.session.id?(e.expect=v,e.session.resuming=!0,e.session.sp.server_random=n.random.bytes()):(e.expect=h,e.session.resuming=!1,l.createSecurityParameters(e,n)),e.session.id=i,e.process()}},l.handleClientHello=function(e,t,r){var i=l.parseHelloMessage(e,t,r);if(!e.fail){var o=i.session_id.bytes(),a=null;if(e.sessionCache&&(null===(a=e.sessionCache.getSession(o))?o="":(a.version.major!==i.version.major||a.version.minor>i.version.minor)&&(a=null,o="")),0===o.length&&(o=n.random.getBytes(32)),e.session.id=o,e.session.clientHelloVersion=i.version,e.session.sp={},a)e.version=e.session.version=a.version,e.session.sp=a.sp;else{for(var s,u=1;u<l.SupportedVersions.length&&!((s=l.SupportedVersions[u]).minor<=i.version.minor);++u);e.version={major:s.major,minor:s.minor},e.session.version=e.version}null!==a?(e.expect=_,e.session.resuming=!0,e.session.sp.client_random=i.random.bytes()):(e.expect=!1!==e.verifyClient?S:w,e.session.resuming=!1,l.createSecurityParameters(e,i)),e.open=!0,l.queue(e,l.createRecord(e,{type:l.ContentType.handshake,data:l.createServerHello(e)})),e.session.resuming?(l.queue(e,l.createRecord(e,{type:l.ContentType.change_cipher_spec,data:l.createChangeCipherSpec()})),e.state.pending=l.createConnectionState(e),e.state.current.write=e.state.pending.write,l.queue(e,l.createRecord(e,{type:l.ContentType.handshake,data:l.createFinished(e)}))):(l.queue(e,l.createRecord(e,{type:l.ContentType.handshake,data:l.createCertificate(e)})),e.fail||(l.queue(e,l.createRecord(e,{type:l.ContentType.handshake,data:l.createServerKeyExchange(e)})),!1!==e.verifyClient&&l.queue(e,l.createRecord(e,{type:l.ContentType.handshake,data:l.createCertificateRequest(e)})),l.queue(e,l.createRecord(e,{type:l.ContentType.handshake,data:l.createServerHelloDone(e)})))),l.flush(e),e.process()}},l.handleCertificate=function(e,t,r){if(r<3)return e.error(e,{message:"Invalid Certificate message. Message too short.",send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.illegal_parameter}});var i=t.fragment,o={certificate_list:c(i,3)},a,s,u=[];try{for(;o.certificate_list.length()>0;)a=c(o.certificate_list,3),s=n.asn1.fromDer(a),a=n.pki.certificateFromAsn1(s,!0),u.push(a)}catch(t){return e.error(e,{message:"Could not parse certificate list.",cause:t,send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.bad_certificate}})}var f=e.entity===l.ConnectionEnd.client;!f&&!0!==e.verifyClient||0!==u.length?0===u.length?e.expect=f?d:w:(f?e.session.serverCertificate=u[0]:e.session.clientCertificate=u[0],l.verifyCertificateChain(e,u)&&(e.expect=f?d:w)):e.error(e,{message:f?"No server certificate provided.":"No client certificate provided.",send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.illegal_parameter}}),e.process()},l.handleServerKeyExchange=function(e,t,r){if(r>0)return e.error(e,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.unsupported_certificate}});e.expect=y,e.process()},l.handleClientKeyExchange=function(e,t,r){if(r<48)return e.error(e,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.unsupported_certificate}});var i=t.fragment,o={enc_pre_master_secret:c(i,2).getBytes()},a=null;if(e.getPrivateKey)try{a=e.getPrivateKey(e,e.session.serverCertificate),a=n.pki.privateKeyFromPem(a)}catch(t){e.error(e,{message:"Could not get private key.",cause:t,send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.internal_error}})}if(null===a)return e.error(e,{message:"No private key set.",send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.internal_error}});try{var s=e.session.sp;s.pre_master_secret=a.decrypt(o.enc_pre_master_secret);var u=e.session.clientHelloVersion;if(u.major!==s.pre_master_secret.charCodeAt(0)||u.minor!==s.pre_master_secret.charCodeAt(1))throw new Error("TLS version rollback attack detected.")}catch(e){s.pre_master_secret=n.random.getBytes(48)}e.expect=_,null!==e.session.clientCertificate&&(e.expect=C),e.process()},l.handleCertificateRequest=function(e,t,r){if(r<3)return e.error(e,{message:"Invalid CertificateRequest. Message too short.",send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.illegal_parameter}});var n=t.fragment,i={certificate_types:c(n,1),certificate_authorities:c(n,2)};e.session.certificateRequest=i,e.expect=g,e.process()},l.handleCertificateVerify=function(e,t,r){if(r<2)return e.error(e,{message:"Invalid CertificateVerify. Message too short.",send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.illegal_parameter}});var i=t.fragment;i.read-=4;var o=i.bytes();i.read+=4;var a={signature:c(i,2).getBytes()},s=n.util.createBuffer();s.putBuffer(e.session.md5.digest()),s.putBuffer(e.session.sha1.digest()),s=s.getBytes();try{var u;if(!e.session.clientCertificate.publicKey.verify(s,a.signature,"NONE"))throw new Error("CertificateVerify signature does not match.");e.session.md5.update(o),e.session.sha1.update(o)}catch(t){return e.error(e,{message:"Bad signature in CertificateVerify.",send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.handshake_failure}})}e.expect=_,e.process()},l.handleServerHelloDone=function(e,t,r){if(r>0)return e.error(e,{message:"Invalid ServerHelloDone message. Invalid length.",send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.record_overflow}});if(null===e.serverCertificate){var i={message:"No server certificate provided. Not enough security.",send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.insufficient_security}},o=0,a=e.verify(e,i.alert.description,0,[]);if(!0!==a)return(a||0===a)&&("object"!=typeof a||n.util.isArray(a)?"number"==typeof a&&(i.alert.description=a):(a.message&&(i.message=a.message),a.alert&&(i.alert.description=a.alert))),e.error(e,i)}null!==e.session.certificateRequest&&(t=l.createRecord(e,{type:l.ContentType.handshake,data:l.createCertificate(e)}),l.queue(e,t)),t=l.createRecord(e,{type:l.ContentType.handshake,data:l.createClientKeyExchange(e)}),l.queue(e,t),e.expect=E;var s=function(e,t){null!==e.session.certificateRequest&&null!==e.session.clientCertificate&&l.queue(e,l.createRecord(e,{type:l.ContentType.handshake,data:l.createCertificateVerify(e,t)})),l.queue(e,l.createRecord(e,{type:l.ContentType.change_cipher_spec,data:l.createChangeCipherSpec()})),e.state.pending=l.createConnectionState(e),e.state.current.write=e.state.pending.write,l.queue(e,l.createRecord(e,{type:l.ContentType.handshake,data:l.createFinished(e)})),e.expect=v,l.flush(e),e.process()};if(null===e.session.certificateRequest||null===e.session.clientCertificate)return s(e,null);l.getClientSignature(e,s)},l.handleChangeCipherSpec=function(e,t){if(1!==t.fragment.getByte())return e.error(e,{message:"Invalid ChangeCipherSpec message received.",send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.illegal_parameter}});var r=e.entity===l.ConnectionEnd.client;(e.session.resuming&&r||!e.session.resuming&&!r)&&(e.state.pending=l.createConnectionState(e)),e.state.current.read=e.state.pending.read,(!e.session.resuming&&r||e.session.resuming&&!r)&&(e.state.pending=null),e.expect=r?m:I,e.process()},l.handleFinished=function(e,t,r){var o=t.fragment;o.read-=4;var a=o.bytes();o.read+=4;var s=t.fragment.getBytes();(o=n.util.createBuffer()).putBuffer(e.session.md5.digest()),o.putBuffer(e.session.sha1.digest());var u=e.entity===l.ConnectionEnd.client,c=u?"server finished":"client finished",f=e.session.sp,p=12,h;if((o=i(f.master_secret,c,o.getBytes(),p)).getBytes()!==s)return e.error(e,{message:"Invalid verify_data in Finished message.",send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.decrypt_error}});e.session.md5.update(a),e.session.sha1.update(a),(e.session.resuming&&u||!e.session.resuming&&!u)&&(l.queue(e,l.createRecord(e,{type:l.ContentType.change_cipher_spec,data:l.createChangeCipherSpec()})),e.state.current.write=e.state.pending.write,e.state.pending=null,l.queue(e,l.createRecord(e,{type:l.ContentType.handshake,data:l.createFinished(e)}))),e.expect=u?b:A,e.handshaking=!1,++e.handshakes,e.peerCertificate=u?e.session.serverCertificate:e.session.clientCertificate,l.flush(e),e.isConnected=!0,e.connected(e),e.process()},l.handleAlert=function(e,t){var r=t.fragment,n={level:r.getByte(),description:r.getByte()},i;switch(n.description){case l.Alert.Description.close_notify:i="Connection closed.";break;case l.Alert.Description.unexpected_message:i="Unexpected message.";break;case l.Alert.Description.bad_record_mac:i="Bad record MAC.";break;case l.Alert.Description.decryption_failed:i="Decryption failed.";break;case l.Alert.Description.record_overflow:i="Record overflow.";break;case l.Alert.Description.decompression_failure:i="Decompression failed.";break;case l.Alert.Description.handshake_failure:i="Handshake failure.";break;case l.Alert.Description.bad_certificate:i="Bad certificate.";break;case l.Alert.Description.unsupported_certificate:i="Unsupported certificate.";break;case l.Alert.Description.certificate_revoked:i="Certificate revoked.";break;case l.Alert.Description.certificate_expired:i="Certificate expired.";break;case l.Alert.Description.certificate_unknown:i="Certificate unknown.";break;case l.Alert.Description.illegal_parameter:i="Illegal parameter.";break;case l.Alert.Description.unknown_ca:i="Unknown certificate authority.";break;case l.Alert.Description.access_denied:i="Access denied.";break;case l.Alert.Description.decode_error:i="Decode error.";break;case l.Alert.Description.decrypt_error:i="Decrypt error.";break;case l.Alert.Description.export_restriction:i="Export restriction.";break;case l.Alert.Description.protocol_version:i="Unsupported protocol version.";break;case l.Alert.Description.insufficient_security:i="Insufficient security.";break;case l.Alert.Description.internal_error:i="Internal error.";break;case l.Alert.Description.user_canceled:i="User canceled.";break;case l.Alert.Description.no_renegotiation:i="Renegotiation not supported.";break;default:i="Unknown error."}if(n.description===l.Alert.Description.close_notify)return e.close();e.error(e,{message:i,send:!1,origin:e.entity===l.ConnectionEnd.client?"server":"client",alert:n}),e.process()},l.handleHandshake=function(e,t){var r=t.fragment,i=r.getByte(),o=r.getInt24();if(o>r.length())return e.fragmented=t,t.fragment=n.util.createBuffer(),r.read-=4,e.process();e.fragmented=null,r.read-=4;var a=r.bytes(o+4);r.read+=4,i in H[e.entity][e.expect]?(e.entity!==l.ConnectionEnd.server||e.open||e.fail||(e.handshaking=!0,e.session={version:null,extensions:{server_name:{serverNameList:[]}},cipherSuite:null,compressionMethod:null,serverCertificate:null,clientCertificate:null,md5:n.md.md5.create(),sha1:n.md.sha1.create()}),i!==l.HandshakeType.hello_request&&i!==l.HandshakeType.certificate_verify&&i!==l.HandshakeType.finished&&(e.session.md5.update(a),e.session.sha1.update(a)),H[e.entity][e.expect][i](e,t,o)):l.handleUnexpected(e,t)},l.handleApplicationData=function(e,t){e.data.putBuffer(t.fragment),e.dataReady(e),e.process()},l.handleHeartbeat=function(e,t){var r=t.fragment,i=r.getByte(),o=r.getInt16(),a=r.getBytes(o);if(i===l.HeartbeatMessageType.heartbeat_request){if(e.handshaking||o>a.length)return e.process();l.queue(e,l.createRecord(e,{type:l.ContentType.heartbeat,data:l.createHeartbeat(l.HeartbeatMessageType.heartbeat_response,a)})),l.flush(e)}else if(i===l.HeartbeatMessageType.heartbeat_response){if(a!==e.expectedHeartbeatPayload)return e.process();e.heartbeatReceived&&e.heartbeatReceived(e,n.util.createBuffer(a))}e.process()};var p=0,h=1,d=2,y=3,g=4,v=5,m=6,b=7,E=8,T=0,S=1,w=2,C=3,_=4,I=5,A=6,R=7,O=l.handleUnexpected,P=l.handleChangeCipherSpec,B=l.handleAlert,k=l.handleHandshake,N=l.handleApplicationData,U=l.handleHeartbeat,D=[];D[l.ConnectionEnd.client]=[[O,B,k,O,U],[O,B,k,O,U],[O,B,k,O,U],[O,B,k,O,U],[O,B,k,O,U],[P,B,O,O,U],[O,B,k,O,U],[O,B,k,N,U],[O,B,k,O,U]],D[l.ConnectionEnd.server]=[[O,B,k,O,U],[O,B,k,O,U],[O,B,k,O,U],[O,B,k,O,U],[P,B,O,O,U],[O,B,k,O,U],[O,B,k,N,U],[O,B,k,O,U]];var x=l.handleHelloRequest,L=l.handleServerHello,j=l.handleCertificate,M=l.handleServerKeyExchange,V=l.handleCertificateRequest,F=l.handleServerHelloDone,K=l.handleFinished,H=[];H[l.ConnectionEnd.client]=[[O,O,L,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O],[x,O,O,O,O,O,O,O,O,O,O,j,M,V,F,O,O,O,O,O,O],[x,O,O,O,O,O,O,O,O,O,O,O,M,V,F,O,O,O,O,O,O],[x,O,O,O,O,O,O,O,O,O,O,O,O,V,F,O,O,O,O,O,O],[x,O,O,O,O,O,O,O,O,O,O,O,O,O,F,O,O,O,O,O,O],[x,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O],[x,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,K],[x,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O],[x,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O]];var q=l.handleClientHello,G=l.handleClientKeyExchange,z=l.handleCertificateVerify;H[l.ConnectionEnd.server]=[[O,q,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O],[O,O,O,O,O,O,O,O,O,O,O,j,O,O,O,O,O,O,O,O,O],[O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,G,O,O,O,O],[O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,z,O,O,O,O,O],[O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O],[O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,K],[O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O],[O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O]],l.generateKeys=function(e,t){var r=i,n=t.client_random+t.server_random;e.session.resuming||(t.master_secret=r(t.pre_master_secret,"master secret",n,48).bytes(),t.pre_master_secret=null),n=t.server_random+t.client_random;var o=2*t.mac_key_length+2*t.enc_key_length,a=e.version.major===l.Versions.TLS_1_0.major&&e.version.minor===l.Versions.TLS_1_0.minor;a&&(o+=2*t.fixed_iv_length);var s=r(t.master_secret,"key expansion",n,o),u={client_write_MAC_key:s.getBytes(t.mac_key_length),server_write_MAC_key:s.getBytes(t.mac_key_length),client_write_key:s.getBytes(t.enc_key_length),server_write_key:s.getBytes(t.enc_key_length)};return a&&(u.client_write_IV=s.getBytes(t.fixed_iv_length),u.server_write_IV=s.getBytes(t.fixed_iv_length)),u},l.createConnectionState=function(e){var t=e.entity===l.ConnectionEnd.client,r=function(){var e={sequenceNumber:[0,0],macKey:null,macLength:0,macFunction:null,cipherState:null,cipherFunction:function(e){return!0},compressionState:null,compressFunction:function(e){return!0},updateSequenceNumber:function(){4294967295===e.sequenceNumber[1]?(e.sequenceNumber[1]=0,++e.sequenceNumber[0]):++e.sequenceNumber[1]}};return e},n={read:r(),write:r()};if(n.read.update=function(e,t){return n.read.cipherFunction(t,n.read)?n.read.compressFunction(e,t,n.read)||e.error(e,{message:"Could not decompress record.",send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.decompression_failure}}):e.error(e,{message:"Could not decrypt record or bad MAC.",send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.bad_record_mac}}),!e.fail},n.write.update=function(e,t){return n.write.compressFunction(e,t,n.write)?n.write.cipherFunction(t,n.write)||e.error(e,{message:"Could not encrypt record.",send:!1,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.internal_error}}):e.error(e,{message:"Could not compress record.",send:!1,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.internal_error}}),!e.fail},e.session){var i=e.session.sp;switch(e.session.cipherSuite.initSecurityParameters(i),i.keys=l.generateKeys(e,i),n.read.macKey=t?i.keys.server_write_MAC_key:i.keys.client_write_MAC_key,n.write.macKey=t?i.keys.client_write_MAC_key:i.keys.server_write_MAC_key,e.session.cipherSuite.initConnectionState(n,e,i),i.compression_algorithm){case l.CompressionMethod.none:break;case l.CompressionMethod.deflate:n.read.compressFunction=u,n.write.compressFunction=s;break;default:throw new Error("Unsupported compression algorithm.")}}return n},l.createRandom=function(){var e=new Date,t=+e+6e4*e.getTimezoneOffset(),r=n.util.createBuffer();return r.putInt32(t),r.putBytes(n.random.getBytes(28)),r},l.createRecord=function(e,t){return t.data?{type:t.type,version:{major:e.version.major,minor:e.version.minor},length:t.data.length(),fragment:t.data}:null;var r},l.createAlert=function(e,t){var r=n.util.createBuffer();return r.putByte(t.level),r.putByte(t.description),l.createRecord(e,{type:l.ContentType.alert,data:r})},l.createClientHello=function(e){e.session.clientHelloVersion={major:e.version.major,minor:e.version.minor};for(var t=n.util.createBuffer(),r=0;r<e.cipherSuites.length;++r){var i=e.cipherSuites[r];t.putByte(i.id[0]),t.putByte(i.id[1])}var o=t.length(),a=n.util.createBuffer();a.putByte(l.CompressionMethod.none);var s=a.length(),u=n.util.createBuffer();if(e.virtualHost){var c=n.util.createBuffer();c.putByte(0),c.putByte(0);var p=n.util.createBuffer();p.putByte(0),f(p,2,n.util.createBuffer(e.virtualHost));var h=n.util.createBuffer();f(h,2,p),f(c,2,h),u.putBuffer(c)}var d=u.length();d>0&&(d+=2);var y=e.session.id,g=y.length+1+2+4+28+2+o+1+s+d,v=n.util.createBuffer();return v.putByte(l.HandshakeType.client_hello),v.putInt24(g),v.putByte(e.version.major),v.putByte(e.version.minor),v.putBytes(e.session.sp.client_random),f(v,1,n.util.createBuffer(y)),f(v,2,t),f(v,1,a),d>0&&f(v,2,u),v},l.createServerHello=function(e){var t=e.session.id,r=t.length+1+2+4+28+2+1,i=n.util.createBuffer();return i.putByte(l.HandshakeType.server_hello),i.putInt24(r),i.putByte(e.version.major),i.putByte(e.version.minor),i.putBytes(e.session.sp.server_random),f(i,1,n.util.createBuffer(t)),i.putByte(e.session.cipherSuite.id[0]),i.putByte(e.session.cipherSuite.id[1]),i.putByte(e.session.compressionMethod),i},l.createCertificate=function(e){var t=e.entity===l.ConnectionEnd.client,r=null,i;e.getCertificate&&(i=t?e.session.certificateRequest:e.session.extensions.server_name.serverNameList,r=e.getCertificate(e,i));var o=n.util.createBuffer();if(null!==r)try{n.util.isArray(r)||(r=[r]);for(var a=null,s=0;s<r.length;++s){var u=n.pem.decode(r[s])[0];if("CERTIFICATE"!==u.type&&"X509 CERTIFICATE"!==u.type&&"TRUSTED CERTIFICATE"!==u.type){var c=new Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".');throw c.headerType=u.type,c}if(u.procType&&"ENCRYPTED"===u.procType.type)throw new Error("Could not convert certificate from PEM; PEM is encrypted.");var p=n.util.createBuffer(u.body);null===a&&(a=n.asn1.fromDer(p.bytes(),!1));var h=n.util.createBuffer();f(h,3,p),o.putBuffer(h)}r=n.pki.certificateFromAsn1(a),t?e.session.clientCertificate=r:e.session.serverCertificate=r}catch(t){return e.error(e,{message:"Could not send certificate list.",cause:t,send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.bad_certificate}})}var d=3+o.length(),y=n.util.createBuffer();return y.putByte(l.HandshakeType.certificate),y.putInt24(d),f(y,3,o),y},l.createClientKeyExchange=function(e){var t=n.util.createBuffer();t.putByte(e.session.clientHelloVersion.major),t.putByte(e.session.clientHelloVersion.minor),t.putBytes(n.random.getBytes(46));var r=e.session.sp,i;r.pre_master_secret=t.getBytes();var o=(t=e.session.serverCertificate.publicKey.encrypt(r.pre_master_secret)).length+2,a=n.util.createBuffer();return a.putByte(l.HandshakeType.client_key_exchange),a.putInt24(o),a.putInt16(t.length),a.putBytes(t),a},l.createServerKeyExchange=function(e){var t=0,r=n.util.createBuffer();return r},l.getClientSignature=function(e,t){var r=n.util.createBuffer();r.putBuffer(e.session.md5.digest()),r.putBuffer(e.session.sha1.digest()),r=r.getBytes(),e.getSignature=e.getSignature||function(e,t,r){var i=null;if(e.getPrivateKey)try{i=e.getPrivateKey(e,e.session.clientCertificate),i=n.pki.privateKeyFromPem(i)}catch(t){e.error(e,{message:"Could not get private key.",cause:t,send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.internal_error}})}null===i?e.error(e,{message:"No private key set.",send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.internal_error}}):t=i.sign(t,null),r(e,t)},e.getSignature(e,r,t)},l.createCertificateVerify=function(e,t){var r=t.length+2,i=n.util.createBuffer();return i.putByte(l.HandshakeType.certificate_verify),i.putInt24(r),i.putInt16(t.length),i.putBytes(t),i},l.createCertificateRequest=function(e){var t=n.util.createBuffer();t.putByte(1);var r=n.util.createBuffer();for(var i in e.caStore.certs){var o=e.caStore.certs[i],a=n.pki.distinguishedNameToAsn1(o.subject),s=n.asn1.toDer(a);r.putInt16(s.length()),r.putBuffer(s)}var u=1+t.length()+2+r.length(),c=n.util.createBuffer();return c.putByte(l.HandshakeType.certificate_request),c.putInt24(u),f(c,1,t),f(c,2,r),c},l.createServerHelloDone=function(e){var t=n.util.createBuffer();return t.putByte(l.HandshakeType.server_hello_done),t.putInt24(0),t},l.createChangeCipherSpec=function(){var e=n.util.createBuffer();return e.putByte(1),e},l.createFinished=function(e){var t=n.util.createBuffer();t.putBuffer(e.session.md5.digest()),t.putBuffer(e.session.sha1.digest());var r=e.entity===l.ConnectionEnd.client,o=e.session.sp,a=12,s,u=r?"client finished":"server finished";t=i(o.master_secret,u,t.getBytes(),a);var c=n.util.createBuffer();return c.putByte(l.HandshakeType.finished),c.putInt24(t.length()),c.putBuffer(t),c},l.createHeartbeat=function(e,t,r){void 0===r&&(r=t.length);var i=n.util.createBuffer();i.putByte(e),i.putInt16(r),i.putBytes(t);var o=i.length(),a=Math.max(16,o-r-3);return i.putBytes(n.random.getBytes(a)),i},l.queue=function(e,t){if(t&&(0!==t.fragment.length()||t.type!==l.ContentType.handshake&&t.type!==l.ContentType.alert&&t.type!==l.ContentType.change_cipher_spec)){if(t.type===l.ContentType.handshake){var r=t.fragment.bytes();e.session.md5.update(r),e.session.sha1.update(r),r=null}var i;if(t.fragment.length()<=l.MaxFragment)i=[t];else{i=[];for(var o=t.fragment.bytes();o.length>l.MaxFragment;)i.push(l.createRecord(e,{type:t.type,data:n.util.createBuffer(o.slice(0,l.MaxFragment))})),o=o.slice(l.MaxFragment);o.length>0&&i.push(l.createRecord(e,{type:t.type,data:n.util.createBuffer(o)}))}for(var a=0;a<i.length&&!e.fail;++a){var s=i[a],u;e.state.current.write.update(e,s)&&e.records.push(s)}}},l.flush=function(e){for(var t=0;t<e.records.length;++t){var r=e.records[t];e.tlsData.putByte(r.type),e.tlsData.putByte(r.version.major),e.tlsData.putByte(r.version.minor),e.tlsData.putInt16(r.fragment.length()),e.tlsData.putBuffer(e.records[t].fragment)}return e.records=[],e.tlsDataReady(e)};var Y=function(e){switch(e){case!0:return!0;case n.pki.certificateError.bad_certificate:return l.Alert.Description.bad_certificate;case n.pki.certificateError.unsupported_certificate:return l.Alert.Description.unsupported_certificate;case n.pki.certificateError.certificate_revoked:return l.Alert.Description.certificate_revoked;case n.pki.certificateError.certificate_expired:return l.Alert.Description.certificate_expired;case n.pki.certificateError.certificate_unknown:return l.Alert.Description.certificate_unknown;case n.pki.certificateError.unknown_ca:return l.Alert.Description.unknown_ca;default:return l.Alert.Description.bad_certificate}},W=function(e){switch(e){case!0:return!0;case l.Alert.Description.bad_certificate:return n.pki.certificateError.bad_certificate;case l.Alert.Description.unsupported_certificate:return n.pki.certificateError.unsupported_certificate;case l.Alert.Description.certificate_revoked:return n.pki.certificateError.certificate_revoked;case l.Alert.Description.certificate_expired:return n.pki.certificateError.certificate_expired;case l.Alert.Description.certificate_unknown:return n.pki.certificateError.certificate_unknown;case l.Alert.Description.unknown_ca:return n.pki.certificateError.unknown_ca;default:return n.pki.certificateError.bad_certificate}};for(var Q in l.verifyCertificateChain=function(e,t){try{var r={};for(var i in e.verifyOptions)r[i]=e.verifyOptions[i];r.verify=function(t,r,i){var o=Y(t),a=e.verify(e,t,r,i);if(!0!==a){if("object"==typeof a&&!n.util.isArray(a)){var s=new Error("The application rejected the certificate.");throw s.send=!0,s.alert={level:l.Alert.Level.fatal,description:l.Alert.Description.bad_certificate},a.message&&(s.message=a.message),a.alert&&(s.alert.description=a.alert),s}a!==t&&(a=W(a))}return a},n.pki.verifyCertificateChain(e.caStore,t,r)}catch(t){var o=t;("object"!=typeof o||n.util.isArray(o))&&(o={send:!0,alert:{level:l.Alert.Level.fatal,description:Y(t)}}),"send"in o||(o.send=!0),"alert"in o||(o.alert={level:l.Alert.Level.fatal,description:Y(o.error)}),e.error(e,o)}return!e.fail},l.createSessionCache=function(e,t){var r=null;if(e&&e.getSession&&e.setSession&&e.order)r=e;else{for(var i in(r={}).cache=e||{},r.capacity=Math.max(t||100,1),r.order=[],e)r.order.length<=t?r.order.push(i):delete e[i];r.getSession=function(e){var t=null,i=null;if(e?i=n.util.bytesToHex(e):r.order.length>0&&(i=r.order[0]),null!==i&&i in r.cache)for(var o in t=r.cache[i],delete r.cache[i],r.order)if(r.order[o]===i){r.order.splice(o,1);break}return t},r.setSession=function(e,t){if(r.order.length===r.capacity){var i=r.order.shift();delete r.cache[i]}var i=n.util.bytesToHex(e);r.order.push(i),r.cache[i]=t}}return r},l.createConnection=function(e){var t=null;t=e.caStore?n.util.isArray(e.caStore)?n.pki.createCaStore(e.caStore):e.caStore:n.pki.createCaStore();var r=e.cipherSuites||null;if(null===r)for(var i in r=[],l.CipherSuites)r.push(l.CipherSuites[i]);var o=e.server?l.ConnectionEnd.server:l.ConnectionEnd.client,a=e.sessionCache?l.createSessionCache(e.sessionCache):null,s={version:{major:l.Version.major,minor:l.Version.minor},entity:o,sessionId:e.sessionId,caStore:t,sessionCache:a,cipherSuites:r,connected:e.connected,virtualHost:e.virtualHost||null,verifyClient:e.verifyClient||!1,verify:e.verify||function(e,t,r,n){return t},verifyOptions:e.verifyOptions||{},getCertificate:e.getCertificate||null,getPrivateKey:e.getPrivateKey||null,getSignature:e.getSignature||null,input:n.util.createBuffer(),tlsData:n.util.createBuffer(),data:n.util.createBuffer(),tlsDataReady:e.tlsDataReady,dataReady:e.dataReady,heartbeatReceived:e.heartbeatReceived,closed:e.closed,error:function(t,r){r.origin=r.origin||(t.entity===l.ConnectionEnd.client?"client":"server"),r.send&&(l.queue(t,l.createAlert(t,r.alert)),l.flush(t));var n=!1!==r.fatal;n&&(t.fail=!0),e.error(t,r),n&&t.close(!1)},deflate:e.deflate||null,inflate:e.inflate||null,reset:function(e){s.version={major:l.Version.major,minor:l.Version.minor},s.record=null,s.session=null,s.peerCertificate=null,s.state={pending:null,current:null},s.expect=(s.entity,l.ConnectionEnd.client,0),s.fragmented=null,s.records=[],s.open=!1,s.handshakes=0,s.handshaking=!1,s.isConnected=!1,s.fail=!(e||void 0===e),s.input.clear(),s.tlsData.clear(),s.data.clear(),s.state.current=l.createConnectionState(s)}};s.reset();var u=function(e,t){var r=t.type-l.ContentType.change_cipher_spec,n=D[e.entity][e.expect];r in n?n[r](e,t):l.handleUnexpected(e,t)},c=function(e){var t=0,r=e.input,i=r.length();if(i<5)t=5-i;else{e.record={type:r.getByte(),version:{major:r.getByte(),minor:r.getByte()},length:r.getInt16(),fragment:n.util.createBuffer(),ready:!1};var o=e.record.version.major===e.version.major;o&&e.session&&e.session.version&&(o=e.record.version.minor===e.version.minor),o||e.error(e,{message:"Incompatible TLS version.",send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.protocol_version}})}return t},f=function(e){var t=0,r=e.input,n=r.length(),i;n<e.record.length?t=e.record.length-n:(e.record.fragment.putBytes(r.getBytes(e.record.length)),r.compact(),e.state.current.read.update(e,e.record)&&(null!==e.fragmented&&(e.fragmented.type===e.record.type?(e.fragmented.fragment.putBuffer(e.record.fragment),e.record=e.fragmented):e.error(e,{message:"Invalid fragmented record.",send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.unexpected_message}})),e.record.ready=!0));return t};return s.handshake=function(e){if(s.entity!==l.ConnectionEnd.client)s.error(s,{message:"Cannot initiate handshake as a server.",fatal:!1});else if(s.handshaking)s.error(s,{message:"Handshake already in progress.",fatal:!1});else{s.fail&&!s.open&&0===s.handshakes&&(s.fail=!1),s.handshaking=!0;var t=null;(e=e||"").length>0&&(s.sessionCache&&(t=s.sessionCache.getSession(e)),null===t&&(e="")),0===e.length&&s.sessionCache&&null!==(t=s.sessionCache.getSession())&&(e=t.id),s.session={id:e,version:null,cipherSuite:null,compressionMethod:null,serverCertificate:null,certificateRequest:null,clientCertificate:null,sp:{},md5:n.md.md5.create(),sha1:n.md.sha1.create()},t&&(s.version=t.version,s.session.sp=t.sp),s.session.sp.client_random=l.createRandom().getBytes(),s.open=!0,l.queue(s,l.createRecord(s,{type:l.ContentType.handshake,data:l.createClientHello(s)})),l.flush(s)}},s.process=function(e){var t=0;return e&&s.input.putBytes(e),s.fail||(null!==s.record&&s.record.ready&&s.record.fragment.isEmpty()&&(s.record=null),null===s.record&&(t=c(s)),s.fail||null===s.record||s.record.ready||(t=f(s)),!s.fail&&null!==s.record&&s.record.ready&&u(s,s.record)),t},s.prepare=function(e){return l.queue(s,l.createRecord(s,{type:l.ContentType.application_data,data:n.util.createBuffer(e)})),l.flush(s)},s.prepareHeartbeatRequest=function(e,t){return e instanceof n.util.ByteBuffer&&(e=e.bytes()),void 0===t&&(t=e.length),s.expectedHeartbeatPayload=e,l.queue(s,l.createRecord(s,{type:l.ContentType.heartbeat,data:l.createHeartbeat(l.HeartbeatMessageType.heartbeat_request,e,t)})),l.flush(s)},s.close=function(e){if(!s.fail&&s.sessionCache&&s.session){var t={id:s.session.id,version:s.session.version,sp:s.session.sp};t.sp.keys=null,s.sessionCache.setSession(t.id,t)}s.open&&(s.open=!1,s.input.clear(),(s.isConnected||s.handshaking)&&(s.isConnected=s.handshaking=!1,l.queue(s,l.createAlert(s,{level:l.Alert.Level.warning,description:l.Alert.Description.close_notify})),l.flush(s)),s.closed(s)),s.reset(e)},s},e.exports=n.tls=n.tls||{},l)"function"!=typeof l[Q]&&(n.tls[Q]=l[Q]);n.tls.prf_tls1=i,n.tls.hmac_sha1=a,n.tls.createSessionCache=l.createSessionCache,n.tls.createConnection=l.createConnection},function(e,t,r){var n=r(4);r(33),r(49),r(138),r(51),r(120),r(144),r(123),r(76),r(8),r(122);var i=n.asn1,o=e.exports=n.pki=n.pki||{};o.pemToDer=function(e){var t=n.pem.decode(e)[0];if(t.procType&&"ENCRYPTED"===t.procType.type)throw new Error("Could not convert PEM to DER; PEM is encrypted.");return n.util.createBuffer(t.body)},o.privateKeyFromPem=function(e){var t=n.pem.decode(e)[0];if("PRIVATE KEY"!==t.type&&"RSA PRIVATE KEY"!==t.type){var r=new Error('Could not convert private key from PEM; PEM header type is not "PRIVATE KEY" or "RSA PRIVATE KEY".');throw r.headerType=t.type,r}if(t.procType&&"ENCRYPTED"===t.procType.type)throw new Error("Could not convert private key from PEM; PEM is encrypted.");var a=i.fromDer(t.body);return o.privateKeyFromAsn1(a)},o.privateKeyToPem=function(e,t){var r={type:"RSA PRIVATE KEY",body:i.toDer(o.privateKeyToAsn1(e)).getBytes()};return n.pem.encode(r,{maxline:t})},o.privateKeyInfoToPem=function(e,t){var r={type:"PRIVATE KEY",body:i.toDer(e).getBytes()};return n.pem.encode(r,{maxline:t})}},function(e,t,r){var n=r(4);if(r(48),r(33),r(75),r(37),r(49),r(120),r(51),r(31),r(141),r(76),r(8),void 0===i)var i=n.jsbn.BigInteger;var o=n.asn1,a=n.pki=n.pki||{};e.exports=a.pbe=n.pbe=n.pbe||{};var s=a.oids,u={name:"EncryptedPrivateKeyInfo",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:o.Class.UNIVERSAL,type:o.Type.OID,constructed:!1,capture:"encryptionOid"},{name:"AlgorithmIdentifier.parameters",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,captureAsn1:"encryptionParams"}]},{name:"EncryptedPrivateKeyInfo.encryptedData",tagClass:o.Class.UNIVERSAL,type:o.Type.OCTETSTRING,constructed:!1,capture:"encryptedData"}]},c={name:"PBES2Algorithms",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",tagClass:o.Class.UNIVERSAL,type:o.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:o.Class.UNIVERSAL,type:o.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"kdfIterationCount"},{name:"PBES2Algorithms.params.keyLength",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,optional:!0,capture:"keyLength"},{name:"PBES2Algorithms.params.prf",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:"PBES2Algorithms.params.prf.algorithm",tagClass:o.Class.UNIVERSAL,type:o.Type.OID,constructed:!1,capture:"prfOid"}]}]}]},{name:"PBES2Algorithms.encryptionScheme",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:o.Class.UNIVERSAL,type:o.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:o.Class.UNIVERSAL,type:o.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},f={name:"pkcs-12PbeParams",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:o.Class.UNIVERSAL,type:o.Type.OCTETSTRING,constructed:!1,capture:"salt"},{name:"pkcs-12PbeParams.iterations",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"iterations"}]};function l(e,t){return e.start().update(t).digest().getBytes()}function p(e){var t;if(e){if(!(t=a.oids[o.derToOid(e)])){var r=new Error("Unsupported PRF OID.");throw r.oid=e,r.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],r}}else t="hmacWithSHA1";return h(t)}function h(e){var t=n.md;switch(e){case"hmacWithSHA224":t=n.md.sha512;case"hmacWithSHA1":case"hmacWithSHA256":case"hmacWithSHA384":case"hmacWithSHA512":e=e.substr(8).toLowerCase();break;default:var r=new Error("Unsupported PRF algorithm.");throw r.algorithm=e,r.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],r}if(!t||!(e in t))throw new Error("Unknown hash algorithm: "+e);return t[e].create()}function d(e,t,r,i){var s=o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OCTETSTRING,!1,e),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,t.getBytes())]);return"hmacWithSHA1"!==i&&s.value.push(o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,n.util.hexToBytes(r.toString(16))),o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OID,!1,o.oidToDer(a.oids[i]).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.NULL,!1,"")])),s}a.encryptPrivateKeyInfo=function(e,t,r){(r=r||{}).saltSize=r.saltSize||8,r.count=r.count||2048,r.algorithm=r.algorithm||"aes128",r.prfAlgorithm=r.prfAlgorithm||"sha1";var i=n.random.getBytesSync(r.saltSize),u=r.count,c=o.integerToDer(u),f,l,p,y;if(0===r.algorithm.indexOf("aes")||"des"===r.algorithm){var g,v,m;switch(r.algorithm){case"aes128":f=16,g=16,v=s["aes128-CBC"],m=n.aes.createEncryptionCipher;break;case"aes192":f=24,g=16,v=s["aes192-CBC"],m=n.aes.createEncryptionCipher;break;case"aes256":f=32,g=16,v=s["aes256-CBC"],m=n.aes.createEncryptionCipher;break;case"des":f=8,g=8,v=s.desCBC,m=n.des.createEncryptionCipher;break;default:var b;throw(b=new Error("Cannot encrypt private key. Unknown encryption algorithm.")).algorithm=r.algorithm,b}var E="hmacWith"+r.prfAlgorithm.toUpperCase(),T=h(E),S=n.pkcs5.pbkdf2(t,i,u,f,T),w=n.random.getBytesSync(g),C;(C=m(S)).start(w),C.update(o.toDer(e)),C.finish(),p=C.output.getBytes();var _=d(i,c,f,E);l=o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OID,!1,o.oidToDer(s.pkcs5PBES2).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OID,!1,o.oidToDer(s.pkcs5PBKDF2).getBytes()),_]),o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OID,!1,o.oidToDer(v).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.OCTETSTRING,!1,w)])])])}else{var b;if("3des"!==r.algorithm)throw(b=new Error("Cannot encrypt private key. Unknown encryption algorithm.")).algorithm=r.algorithm,b;f=24;var I=new n.util.ByteBuffer(i),S=a.pbe.generatePkcs12Key(t,I,1,u,f),w=a.pbe.generatePkcs12Key(t,I,2,u,f),C;(C=n.des.createEncryptionCipher(S)).start(w),C.update(o.toDer(e)),C.finish(),p=C.output.getBytes(),l=o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OID,!1,o.oidToDer(s["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OCTETSTRING,!1,i),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,c.getBytes())])])}return o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[l,o.create(o.Class.UNIVERSAL,o.Type.OCTETSTRING,!1,p)])},a.decryptPrivateKeyInfo=function(e,t){var r=null,i={},s=[];if(!o.validate(e,u,i,s)){var c=new Error("Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw c.errors=s,c}var f=o.derToOid(i.encryptionOid),l=a.pbe.getCipher(f,i.encryptionParams,t),p=n.util.createBuffer(i.encryptedData);return l.update(p),l.finish()&&(r=o.fromDer(l.output)),r},a.encryptedPrivateKeyToPem=function(e,t){var r={type:"ENCRYPTED PRIVATE KEY",body:o.toDer(e).getBytes()};return n.pem.encode(r,{maxline:t})},a.encryptedPrivateKeyFromPem=function(e){var t=n.pem.decode(e)[0];if("ENCRYPTED PRIVATE KEY"!==t.type){var r=new Error('Could not convert encrypted private key from PEM; PEM header type is "ENCRYPTED PRIVATE KEY".');throw r.headerType=t.type,r}if(t.procType&&"ENCRYPTED"===t.procType.type)throw new Error("Could not convert encrypted private key from PEM; PEM is encrypted.");return o.fromDer(t.body)},a.encryptRsaPrivateKey=function(e,t,r){if(!(r=r||{}).legacy){var i=a.wrapRsaPrivateKey(a.privateKeyToAsn1(e));return i=a.encryptPrivateKeyInfo(i,t,r),a.encryptedPrivateKeyToPem(i)}var s,u,c,f;switch(r.algorithm){case"aes128":s="AES-128-CBC",c=16,u=n.random.getBytesSync(16),f=n.aes.createEncryptionCipher;break;case"aes192":s="AES-192-CBC",c=24,u=n.random.getBytesSync(16),f=n.aes.createEncryptionCipher;break;case"aes256":s="AES-256-CBC",c=32,u=n.random.getBytesSync(16),f=n.aes.createEncryptionCipher;break;case"3des":s="DES-EDE3-CBC",c=24,u=n.random.getBytesSync(8),f=n.des.createEncryptionCipher;break;case"des":s="DES-CBC",c=8,u=n.random.getBytesSync(8),f=n.des.createEncryptionCipher;break;default:var l=new Error('Could not encrypt RSA private key; unsupported encryption algorithm "'+r.algorithm+'".');throw l.algorithm=r.algorithm,l}var p,h=f(n.pbe.opensslDeriveBytes(t,u.substr(0,8),c));h.start(u),h.update(o.toDer(a.privateKeyToAsn1(e))),h.finish();var d={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:s,parameters:n.util.bytesToHex(u).toUpperCase()},body:h.output.getBytes()};return n.pem.encode(d)},a.decryptRsaPrivateKey=function(e,t){var r=null,i=n.pem.decode(e)[0],s;if("ENCRYPTED PRIVATE KEY"!==i.type&&"PRIVATE KEY"!==i.type&&"RSA PRIVATE KEY"!==i.type)throw(s=new Error('Could not convert private key from PEM; PEM header type is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".')).headerType=s,s;if(i.procType&&"ENCRYPTED"===i.procType.type){var u,c;switch(i.dekInfo.algorithm){case"DES-CBC":u=8,c=n.des.createDecryptionCipher;break;case"DES-EDE3-CBC":u=24,c=n.des.createDecryptionCipher;break;case"AES-128-CBC":u=16,c=n.aes.createDecryptionCipher;break;case"AES-192-CBC":u=24,c=n.aes.createDecryptionCipher;break;case"AES-256-CBC":u=32,c=n.aes.createDecryptionCipher;break;case"RC2-40-CBC":u=5,c=function(e){return n.rc2.createDecryptionCipher(e,40)};break;case"RC2-64-CBC":u=8,c=function(e){return n.rc2.createDecryptionCipher(e,64)};break;case"RC2-128-CBC":u=16,c=function(e){return n.rc2.createDecryptionCipher(e,128)};break;default:var s;throw(s=new Error('Could not decrypt private key; unsupported encryption algorithm "'+i.dekInfo.algorithm+'".')).algorithm=i.dekInfo.algorithm,s}var f=n.util.hexToBytes(i.dekInfo.parameters),l,p=c(n.pbe.opensslDeriveBytes(t,f.substr(0,8),u));if(p.start(f),p.update(n.util.createBuffer(i.body)),!p.finish())return r;r=p.output.getBytes()}else r=i.body;return null!==(r="ENCRYPTED PRIVATE KEY"===i.type?a.decryptPrivateKeyInfo(o.fromDer(r),t):o.fromDer(r))&&(r=a.privateKeyFromAsn1(r)),r},a.pbe.generatePkcs12Key=function(e,t,r,i,o,a){var s,u;if(null==a){if(!("sha1"in n.md))throw new Error('"sha1" hash algorithm unavailable.');a=n.md.sha1.create()}var c=a.digestLength,f=a.blockLength,l=new n.util.ByteBuffer,p=new n.util.ByteBuffer;if(null!=e){for(u=0;u<e.length;u++)p.putInt16(e.charCodeAt(u));p.putInt16(0)}var h=p.length(),d=t.length(),y=new n.util.ByteBuffer;y.fillWithByte(r,f);var g=f*Math.ceil(d/f),v=new n.util.ByteBuffer;for(u=0;u<g;u++)v.putByte(t.at(u%d));var m=f*Math.ceil(h/f),b=new n.util.ByteBuffer;for(u=0;u<m;u++)b.putByte(p.at(u%h));var E=v;E.putBuffer(b);for(var T=Math.ceil(o/c),S=1;S<=T;S++){var w=new n.util.ByteBuffer;w.putBytes(y.bytes()),w.putBytes(E.bytes());for(var C=0;C<i;C++)a.start(),a.update(w.getBytes()),w=a.digest();var _=new n.util.ByteBuffer;for(u=0;u<f;u++)_.putByte(w.at(u%c));var I=Math.ceil(d/f)+Math.ceil(h/f),A=new n.util.ByteBuffer;for(s=0;s<I;s++){var R=new n.util.ByteBuffer(E.getBytes(f)),O=511;for(u=_.length()-1;u>=0;u--)O>>=8,O+=_.at(u)+R.at(u),R.setAt(u,255&O);A.putBuffer(R)}E=A,l.putBuffer(w)}return l.truncate(l.length()-o),l},a.pbe.getCipher=function(e,t,r){switch(e){case a.oids.pkcs5PBES2:return a.pbe.getCipherForPBES2(e,t,r);case a.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case a.oids["pbewithSHAAnd40BitRC2-CBC"]:return a.pbe.getCipherForPKCS12PBE(e,t,r);default:var n=new Error("Cannot read encrypted PBE data block. Unsupported OID.");throw n.oid=e,n.supportedOids=["pkcs5PBES2","pbeWithSHAAnd3-KeyTripleDES-CBC","pbewithSHAAnd40BitRC2-CBC"],n}},a.pbe.getCipherForPBES2=function(e,t,r){var i={},s=[],u,u,u;if(!o.validate(t,c,i,s))throw(u=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.")).errors=s,u;if((e=o.derToOid(i.kdfOid))!==a.oids.pkcs5PBKDF2)throw(u=new Error("Cannot read encrypted private key. Unsupported key derivation function OID.")).oid=e,u.supportedOids=["pkcs5PBKDF2"],u;if((e=o.derToOid(i.encOid))!==a.oids["aes128-CBC"]&&e!==a.oids["aes192-CBC"]&&e!==a.oids["aes256-CBC"]&&e!==a.oids["des-EDE3-CBC"]&&e!==a.oids.desCBC)throw(u=new Error("Cannot read encrypted private key. Unsupported encryption scheme OID.")).oid=e,u.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],u;var f=i.kdfSalt,l=n.util.createBuffer(i.kdfIterationCount),h,d;switch(l=l.getInt(l.length()<<3),a.oids[e]){case"aes128-CBC":h=16,d=n.aes.createDecryptionCipher;break;case"aes192-CBC":h=24,d=n.aes.createDecryptionCipher;break;case"aes256-CBC":h=32,d=n.aes.createDecryptionCipher;break;case"des-EDE3-CBC":h=24,d=n.des.createDecryptionCipher;break;case"desCBC":h=8,d=n.des.createDecryptionCipher}var y=p(i.prfOid),g=n.pkcs5.pbkdf2(r,f,l,h,y),v=i.encIv,m=d(g);return m.start(v),m},a.pbe.getCipherForPKCS12PBE=function(e,t,r){var i={},s=[],u;if(!o.validate(t,f,i,s))throw(u=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.")).errors=s,u;var c=n.util.createBuffer(i.salt),l=n.util.createBuffer(i.iterations),h,d,y;switch(l=l.getInt(l.length()<<3),e){case a.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:h=24,d=8,y=n.des.startDecrypting;break;case a.oids["pbewithSHAAnd40BitRC2-CBC"]:h=5,d=8,y=function(e,t){var r=n.rc2.createDecryptionCipher(e,40);return r.start(t,null),r};break;default:var u;throw(u=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.")).oid=e,u}var g=p(i.prfOid),v=a.pbe.generatePkcs12Key(r,c,1,l,h,g),m;return g.start(),y(v,a.pbe.generatePkcs12Key(r,c,2,l,d,g))},a.pbe.opensslDeriveBytes=function(e,t,r,i){if(null==i){if(!("md5"in n.md))throw new Error('"md5" hash algorithm unavailable.');i=n.md.md5.create()}null===t&&(t="");for(var o=[l(i,e+t)],a=16,s=1;a<r;++s,a+=16)o.push(l(i,o[s-1]+e+t));return o.join("").substr(0,r)}},function(e,t,r){var n=r(4);r(37),r(8);var i=e.exports=n.sha256=n.sha256||{};n.md.sha256=n.md.algorithms.sha256=i,i.create=function(){a||u();var e=null,t=n.util.createBuffer(),r=new Array(64),i={algorithm:"sha256",blockLength:64,digestLength:32,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){i.messageLength=0,i.fullMessageLength=i.messageLength64=[];for(var r=i.messageLengthSize/4,o=0;o<r;++o)i.fullMessageLength.push(0);return t=n.util.createBuffer(),e={h0:1779033703,h1:3144134277,h2:1013904242,h3:2773480762,h4:1359893119,h5:2600822924,h6:528734635,h7:1541459225},i}};return i.start(),i.update=function(o,a){"utf8"===a&&(o=n.util.encodeUtf8(o));var s=o.length;i.messageLength+=s,s=[s/4294967296>>>0,s>>>0];for(var u=i.fullMessageLength.length-1;u>=0;--u)i.fullMessageLength[u]+=s[1],s[1]=s[0]+(i.fullMessageLength[u]/4294967296>>>0),i.fullMessageLength[u]=i.fullMessageLength[u]>>>0,s[0]=s[1]/4294967296>>>0;return t.putBytes(o),c(e,r,t),(t.read>2048||0===t.length())&&t.compact(),i},i.digest=function(){var a=n.util.createBuffer();a.putBytes(t.bytes());var s,u=i.fullMessageLength[i.fullMessageLength.length-1]+i.messageLengthSize&i.blockLength-1,f,l;a.putBytes(o.substr(0,i.blockLength-u));for(var p=8*i.fullMessageLength[0],h=0;h<i.fullMessageLength.length-1;++h)p+=l=(f=8*i.fullMessageLength[h+1])/4294967296>>>0,a.putInt32(p>>>0),p=f>>>0;a.putInt32(p);var d={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4,h5:e.h5,h6:e.h6,h7:e.h7};c(d,r,a);var y=n.util.createBuffer();return y.putInt32(d.h0),y.putInt32(d.h1),y.putInt32(d.h2),y.putInt32(d.h3),y.putInt32(d.h4),y.putInt32(d.h5),y.putInt32(d.h6),y.putInt32(d.h7),y},i};var o=null,a=!1,s=null;function u(){o=String.fromCharCode(128),o+=n.util.fillString(String.fromCharCode(0),64),s=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],a=!0}function c(e,t,r){for(var n,i,o,a,u,c,f,l,p,h,d,y,g,v,m,b=r.length();b>=64;){for(f=0;f<16;++f)t[f]=r.getInt32();for(;f<64;++f)n=((n=t[f-2])>>>17|n<<15)^(n>>>19|n<<13)^n>>>10,i=((i=t[f-15])>>>7|i<<25)^(i>>>18|i<<14)^i>>>3,t[f]=n+t[f-7]+i+t[f-16]|0;for(l=e.h0,p=e.h1,h=e.h2,d=e.h3,y=e.h4,g=e.h5,v=e.h6,m=e.h7,f=0;f<64;++f)o=(l>>>2|l<<30)^(l>>>13|l<<19)^(l>>>22|l<<10),c=l&p|h&(l^p),n=m+(a=(y>>>6|y<<26)^(y>>>11|y<<21)^(y>>>25|y<<7))+(u=v^y&(g^v))+s[f]+t[f],m=v,v=g,g=y,y=d+n>>>0,d=h,h=p,p=l,l=n+(i=o+c)>>>0;e.h0=e.h0+l|0,e.h1=e.h1+p|0,e.h2=e.h2+h|0,e.h3=e.h3+d|0,e.h4=e.h4+y|0,e.h5=e.h5+g|0,e.h6=e.h6+v|0,e.h7=e.h7+m|0,b-=64}}},function(e,t,r){(function(t){var n=r(4);r(8);var i=null,o;!n.util.isNodejs||n.options.usePureJavaScript||t.versions["node-webkit"]||(i=r(121)),(e.exports=n.prng=n.prng||{}).create=function(e){for(var t={plugin:e,key:null,seed:null,time:null,reseeds:0,generated:0,keyBytes:""},r=e.md,o=new Array(32),a=0;a<32;++a)o[a]=r.create();function s(e){if(t.pools[0].messageLength>=32)return c(),e();var r=32-t.pools[0].messageLength<<5;t.seedFile(r,function(r,n){if(r)return e(r);t.collect(n),c(),e()})}function u(){if(t.pools[0].messageLength>=32)return c();var e=32-t.pools[0].messageLength<<5;t.collect(t.seedFileSync(e)),c()}function c(){t.reseeds=4294967295===t.reseeds?0:t.reseeds+1;var e=t.plugin.md.create();e.update(t.keyBytes);for(var r=1,n=0;n<32;++n)t.reseeds%r===0&&(e.update(t.pools[n].digest().getBytes()),t.pools[n].start()),r<<=1;t.keyBytes=e.digest().getBytes(),e.start(),e.update(t.keyBytes);var i=e.digest().getBytes();t.key=t.plugin.formatKey(t.keyBytes),t.seed=t.plugin.formatSeed(i),t.generated=0}function f(e){var t=null,r=n.util.globalScope,i=r.crypto||r.msCrypto;i&&i.getRandomValues&&(t=function(e){return i.getRandomValues(e)});var o=n.util.createBuffer();if(t)for(;o.length()<e;){var a=Math.max(1,Math.min(e-o.length(),65536)/4),s=new Uint32Array(Math.floor(a));try{t(s);for(var u=0;u<s.length;++u)o.putInt32(s[u])}catch(e){if(!("undefined"!=typeof QuotaExceededError&&e instanceof QuotaExceededError))throw e}}if(o.length()<e)for(var c,f,l,p=Math.floor(65536*Math.random());o.length()<e;){f=16807*(65535&p),f+=(32767&(c=16807*(p>>16)))<<16,p=4294967295&(f=(2147483647&(f+=c>>15))+(f>>31));for(var u=0;u<3;++u)l=p>>>(u<<3),l^=Math.floor(256*Math.random()),o.putByte(String.fromCharCode(255&l))}return o.getBytes(e)}return t.pools=o,t.pool=0,t.generate=function(e,r){if(!r)return t.generateSync(e);var i=t.plugin.cipher,o=t.plugin.increment,a=t.plugin.formatKey,u=t.plugin.formatSeed,c=n.util.createBuffer();function f(l){if(l)return r(l);if(c.length()>=e)return r(null,c.getBytes(e));if(t.generated>1048575&&(t.key=null),null===t.key)return n.util.nextTick(function(){s(f)});var p=i(t.key,t.seed);t.generated+=p.length,c.putBytes(p),t.key=a(i(t.key,o(t.seed))),t.seed=u(i(t.key,t.seed)),n.util.setImmediate(f)}t.key=null,f()},t.generateSync=function(e){var r=t.plugin.cipher,i=t.plugin.increment,o=t.plugin.formatKey,a=t.plugin.formatSeed;t.key=null;for(var s=n.util.createBuffer();s.length()<e;){t.generated>1048575&&(t.key=null),null===t.key&&u();var c=r(t.key,t.seed);t.generated+=c.length,s.putBytes(c),t.key=o(r(t.key,i(t.seed))),t.seed=a(r(t.key,t.seed))}return s.getBytes(e)},i?(t.seedFile=function(e,t){i.randomBytes(e,function(e,r){if(e)return t(e);t(null,r.toString())})},t.seedFileSync=function(e){return i.randomBytes(e).toString()}):(t.seedFile=function(e,t){try{t(null,f(e))}catch(e){t(e)}},t.seedFileSync=f),t.collect=function(e){for(var r=e.length,n=0;n<r;++n)t.pools[t.pool].update(e.substr(n,1)),t.pool=31===t.pool?0:t.pool+1},t.collectInt=function(e,r){for(var n="",i=0;i<r;i+=8)n+=String.fromCharCode(e>>i&255);t.collect(n)},t.registerWorker=function(e){if(e===self)t.seedFile=function(e,t){function r(e){var n=e.data;n.forge&&n.forge.prng&&(self.removeEventListener("message",r),t(n.forge.prng.err,n.forge.prng.bytes))}self.addEventListener("message",r),self.postMessage({forge:{prng:{needed:e}}})};else{var r=function(r){var n=r.data;n.forge&&n.forge.prng&&t.seedFile(n.forge.prng.needed,function(t,r){e.postMessage({forge:{prng:{err:t,bytes:r}}})})};e.addEventListener("message",r)}},t}}).call(this,r(36))},function(e,t,r){var n=r(4);r(8);var i=[217,120,249,196,25,221,181,237,40,233,253,121,74,160,216,157,198,126,55,131,43,118,83,142,98,76,100,136,68,139,251,162,23,154,89,245,135,179,79,19,97,69,109,141,9,129,125,50,189,143,64,235,134,183,123,11,240,149,33,34,92,107,78,130,84,214,101,147,206,96,178,28,115,86,192,20,167,140,241,220,18,117,202,31,59,190,228,209,66,61,212,48,163,60,182,38,111,191,14,218,70,105,7,87,39,242,29,155,188,148,67,3,248,17,199,246,144,239,62,231,6,195,213,47,200,102,30,215,8,232,234,222,128,82,238,247,132,170,114,172,53,77,106,42,150,26,210,113,90,21,73,116,75,159,208,94,4,24,164,236,194,224,65,110,15,81,203,204,36,145,175,80,161,244,112,57,153,124,58,133,35,184,180,122,252,2,54,91,37,85,151,49,45,93,250,152,227,138,146,174,5,223,41,16,103,108,186,201,211,0,230,207,225,158,168,44,99,22,1,63,88,226,137,169,13,56,52,27,171,51,255,176,187,72,12,95,185,177,205,46,197,243,219,71,229,165,156,119,10,166,32,104,254,127,193,173],o=[1,2,3,5],a=function(e,t){return e<<t&65535|(65535&e)>>16-t},s=function(e,t){return(65535&e)>>t|e<<16-t&65535};e.exports=n.rc2=n.rc2||{},n.rc2.expandKey=function(e,t){"string"==typeof e&&(e=n.util.createBuffer(e)),t=t||128;var r=e,o=e.length(),a=t,s=Math.ceil(a/8),u=255>>(7&a),c;for(c=o;c<128;c++)r.putByte(i[r.at(c-1)+r.at(c-o)&255]);for(r.setAt(128-s,i[r.at(128-s)&u]),c=127-s;c>=0;c--)r.setAt(c,i[r.at(c+1)^r.at(c+s)]);return r};var u=function(e,t,r){var i=!1,u=null,c=null,f=null,l,p,h,d,y=[];for(e=n.rc2.expandKey(e,t),h=0;h<64;h++)y.push(e.getInt16Le());r?(l=function(e){for(h=0;h<4;h++)e[h]+=y[d]+(e[(h+3)%4]&e[(h+2)%4])+(~e[(h+3)%4]&e[(h+1)%4]),e[h]=a(e[h],o[h]),d++},p=function(e){for(h=0;h<4;h++)e[h]+=y[63&e[(h+3)%4]]}):(l=function(e){for(h=3;h>=0;h--)e[h]=s(e[h],o[h]),e[h]-=y[d]+(e[(h+3)%4]&e[(h+2)%4])+(~e[(h+3)%4]&e[(h+1)%4]),d--},p=function(e){for(h=3;h>=0;h--)e[h]-=y[63&e[(h+3)%4]]});var g=function(e){var t=[];for(h=0;h<4;h++){var n=u.getInt16Le();null!==f&&(r?n^=f.getInt16Le():f.putInt16Le(n)),t.push(65535&n)}d=r?0:63;for(var i=0;i<e.length;i++)for(var o=0;o<e[i][0];o++)e[i][1](t);for(h=0;h<4;h++)null!==f&&(r?f.putInt16Le(t[h]):t[h]^=f.getInt16Le()),c.putInt16Le(t[h])},v=null;return v={start:function(e,t){e&&"string"==typeof e&&(e=n.util.createBuffer(e)),i=!1,u=n.util.createBuffer(),c=t||new n.util.createBuffer,f=e,v.output=c},update:function(e){for(i||u.putBuffer(e);u.length()>=8;)g([[5,l],[1,p],[6,l],[1,p],[5,l]])},finish:function(e){var t=!0;if(r)if(e)t=e(8,u,!r);else{var n=8===u.length()?8:8-u.length();u.fillWithByte(n,n)}if(t&&(i=!0,v.update()),!r&&(t=0===u.length()))if(e)t=e(8,c,!r);else{var o=c.length(),a=c.at(o-1);a>o?t=!1:c.truncate(a)}return t}}};n.rc2.startEncrypting=function(e,t,r){var i=n.rc2.createEncryptionCipher(e,128);return i.start(t,r),i},n.rc2.createEncryptionCipher=function(e,t){return u(e,t,!0)},n.rc2.startDecrypting=function(e,t,r){var i=n.rc2.createDecryptionCipher(e,128);return i.start(t,r),i},n.rc2.createDecryptionCipher=function(e,t){return u(e,t,!1)}},function(e,t,r){var n=r(4);r(8),r(31),r(69);var i=e.exports=n.pkcs1=n.pkcs1||{};function o(e,t,r){r||(r=n.md.sha1.create());for(var i="",o=Math.ceil(t/r.digestLength),a=0;a<o;++a){var s=String.fromCharCode(a>>24&255,a>>16&255,a>>8&255,255&a);r.start(),r.update(e+s),i+=r.digest().getBytes()}return i.substring(0,t)}i.encode_rsa_oaep=function(e,t,r){var i,a,s,u;"string"==typeof r?(i=r,a=arguments[3]||void 0,s=arguments[4]||void 0):r&&(i=r.label||void 0,a=r.seed||void 0,s=r.md||void 0,r.mgf1&&r.mgf1.md&&(u=r.mgf1.md)),s?s.start():s=n.md.sha1.create(),u||(u=s);var c=Math.ceil(e.n.bitLength()/8),f=c-2*s.digestLength-2,l;if(t.length>f)throw(l=new Error("RSAES-OAEP input message length is too long.")).length=t.length,l.maxLength=f,l;i||(i=""),s.update(i,"raw");for(var p=s.digest(),h="",d=f-t.length,y=0;y<d;y++)h+="\0";var g=p.getBytes()+h+""+t;if(a){if(a.length!==s.digestLength){var l;throw(l=new Error("Invalid RSAES-OAEP seed. The seed length must match the digest length.")).seedLength=a.length,l.digestLength=s.digestLength,l}}else a=n.random.getBytes(s.digestLength);var v=o(a,c-s.digestLength-1,u),m=n.util.xorBytes(g,v,g.length),b=o(m,s.digestLength,u),E;return"\0"+n.util.xorBytes(a,b,a.length)+m},i.decode_rsa_oaep=function(e,t,r){var i,a,s;"string"==typeof r?(i=r,a=arguments[3]||void 0):r&&(i=r.label||void 0,a=r.md||void 0,r.mgf1&&r.mgf1.md&&(s=r.mgf1.md));var u=Math.ceil(e.n.bitLength()/8),c;if(t.length!==u)throw(c=new Error("RSAES-OAEP encoded message length is invalid.")).length=t.length,c.expectedLength=u,c;if(void 0===a?a=n.md.sha1.create():a.start(),s||(s=a),u<2*a.digestLength+2)throw new Error("RSAES-OAEP key is too short for the hash function.");i||(i=""),a.update(i,"raw");for(var f=a.digest().getBytes(),l=t.charAt(0),p=t.substring(1,a.digestLength+1),h=t.substring(1+a.digestLength),d=o(h,a.digestLength,s),y,g=o(n.util.xorBytes(p,d,p.length),u-a.digestLength-1,s),v=n.util.xorBytes(h,g,h.length),m=v.substring(0,a.digestLength),c="\0"!==l,b=0;b<a.digestLength;++b)c|=f.charAt(b)!==m.charAt(b);for(var E=1,T=a.digestLength,S=a.digestLength;S<v.length;S++){var w=v.charCodeAt(S),C,_;c|=w&(E?65534:0),T+=E&=1&w^1}if(c||1!==v.charCodeAt(T))throw new Error("Invalid RSAES-OAEP padding.");return v.substring(T+1)}},function(e,t,r){var n=r(4);r(8),r(77),r(31),function(){if(n.prime)e.exports=n.prime;else{var t=e.exports=n.prime=n.prime||{},r=n.jsbn.BigInteger,i=[6,4,2,4,2,4,6,2],o=new r(null);o.fromInt(30);var a=function(e,t){return e|t};t.generateProbablePrime=function(e,t,r){"function"==typeof t&&(r=t,t={});var i=(t=t||{}).algorithm||"PRIMEINC";"string"==typeof i&&(i={name:i}),i.options=i.options||{};var o=t.prng||n.random,a={nextBytes:function(e){for(var t=o.getBytesSync(e.length),r=0;r<e.length;++r)e[r]=t.charCodeAt(r)}};if("PRIMEINC"===i.name)return s(e,a,i.options,r);throw new Error("Invalid prime generation algorithm: "+i.name)}}function s(e,t,r,n){return"workers"in r?f(e,t,r,n):u(e,t,r,n)}function u(e,t,r,n){var i=l(e,t),o=0,a=p(i.bitLength());"millerRabinTests"in r&&(a=r.millerRabinTests);var s=10;"maxBlockTime"in r&&(s=r.maxBlockTime),c(i,e,t,0,a,s,n)}function c(e,t,r,o,a,s,u){var f=+new Date;do{if(e.bitLength()>t&&(e=l(t,r)),e.isProbablePrime(a))return u(null,e);e.dAddOffset(i[o++%8],0)}while(s<0||+new Date-f<s);n.util.setImmediate(function(){c(e,t,r,o,a,s,u)})}function f(e,t,i,o){if("undefined"==typeof Worker)return u(e,t,i,o);var a=l(e,t),s=i.workers,c=i.workLoad||100,f=30*c/8,p=i.workerScript||"forge/prime.worker.js";if(-1===s)return n.util.estimateCores(function(e,t){e&&(t=2),s=t-1,h()});function h(){s=Math.max(1,s);for(var n=[],i=0;i<s;++i)n[i]=new Worker(p);for(var u=s,i=0;i<s;++i)n[i].addEventListener("message",d);var h=!1;function d(i){if(!h){--u;var s=i.data;if(s.found){for(var p=0;p<n.length;++p)n[p].terminate();return h=!0,o(null,new r(s.prime,16))}a.bitLength()>e&&(a=l(e,t));var d=a.toString(16);i.target.postMessage({hex:d,workLoad:c}),a.dAddOffset(f,0)}}}h()}function l(e,t){var n=new r(e,t),i=e-1;return n.testBit(i)||n.bitwiseTo(r.ONE.shiftLeft(i),a,n),n.dAddOffset(31-n.mod(o).byteValue(),0),n}function p(e){return e<=100?27:e<=150?18:e<=200?15:e<=250?12:e<=300?9:e<=350?8:e<=400?7:e<=500?6:e<=600?5:e<=800?4:e<=1250?3:2}}()},function(e,t,r){var n=r(4);r(33),r(68),r(49),r(145),r(138),r(31),r(76),r(69),r(8),r(122);var i=n.asn1,o=n.pki,a=e.exports=n.pkcs12=n.pkcs12||{},s={name:"ContentInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.contentType",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:i.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"content"}]},u={name:"PFX",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"},s,{name:"PFX.macData",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"mac",value:[{name:"PFX.macData.mac",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"macAlgorithm"},{name:"PFX.macData.mac.digestAlgorithm.parameters",tagClass:i.Class.UNIVERSAL,captureAsn1:"macAlgorithmParameters"}]},{name:"PFX.macData.mac.digest",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"macDigest"}]},{name:"PFX.macData.macSalt",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"macSalt"},{name:"PFX.macData.iterations",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,optional:!0,capture:"macIterations"}]}]},c={name:"SafeBag",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SafeBag.bagId",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"bagId"},{name:"SafeBag.bagValue",tagClass:i.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"bagValue"},{name:"SafeBag.bagAttributes",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0,optional:!0,capture:"bagAttributes"}]},f={name:"Attribute",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"Attribute.attrId",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"oid"},{name:"Attribute.attrValues",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0,capture:"values"}]},l={name:"CertBag",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"CertBag.certId",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"certId"},{name:"CertBag.certValue",tagClass:i.Class.CONTEXT_SPECIFIC,constructed:!0,value:[{name:"CertBag.certValue[0]",tagClass:i.Class.UNIVERSAL,type:i.Class.OCTETSTRING,constructed:!1,capture:"cert"}]}]};function p(e,t,r,n){for(var i=[],o=0;o<e.length;o++)for(var a=0;a<e[o].safeBags.length;a++){var s=e[o].safeBags[a];void 0!==n&&s.type!==n||(null!==t?void 0!==s.attributes[t]&&s.attributes[t].indexOf(r)>=0&&i.push(s):i.push(s))}return i}function h(e){if(e.composed||e.constructed){for(var t=n.util.createBuffer(),r=0;r<e.value.length;++r)t.putBytes(e.value[r].value);e.composed=e.constructed=!1,e.value=t.getBytes()}return e}function d(e,t,r,n){if((t=i.fromDer(t,r)).tagClass!==i.Class.UNIVERSAL||t.type!==i.Type.SEQUENCE||!0!==t.constructed)throw new Error("PKCS#12 AuthenticatedSafe expected to be a SEQUENCE OF ContentInfo");for(var a=0;a<t.value.length;a++){var u=t.value[a],c={},f=[],l;if(!i.validate(u,s,c,f))throw(l=new Error("Cannot read ContentInfo.")).errors=f,l;var p={encrypted:!1},d=null,v=c.content.value[0];switch(i.derToOid(c.contentType)){case o.oids.data:if(v.tagClass!==i.Class.UNIVERSAL||v.type!==i.Type.OCTETSTRING)throw new Error("PKCS#12 SafeContents Data is not an OCTET STRING.");d=h(v).value;break;case o.oids.encryptedData:d=y(v,n),p.encrypted=!0;break;default:var l;throw(l=new Error("Unsupported PKCS#12 contentType.")).contentType=i.derToOid(c.contentType),l}p.safeBags=g(d,r,n),e.safeContents.push(p)}}function y(e,t){var r={},a=[],s;if(!i.validate(e,n.pkcs7.asn1.encryptedDataValidator,r,a))throw(s=new Error("Cannot read EncryptedContentInfo.")).errors=a,s;var u=i.derToOid(r.contentType),s;if(u!==o.oids.data)throw(s=new Error("PKCS#12 EncryptedContentInfo ContentType is not Data.")).oid=u,s;u=i.derToOid(r.encAlgorithm);var c=o.pbe.getCipher(u,r.encParameter,t),f=h(r.encryptedContentAsn1),l=n.util.createBuffer(f.value);if(c.update(l),!c.finish())throw new Error("Failed to decrypt PKCS#12 SafeContents.");return c.output.getBytes()}function g(e,t,r){if(!t&&0===e.length)return[];if((e=i.fromDer(e,t)).tagClass!==i.Class.UNIVERSAL||e.type!==i.Type.SEQUENCE||!0!==e.constructed)throw new Error("PKCS#12 SafeContents expected to be a SEQUENCE OF SafeBag.");for(var n=[],a=0;a<e.value.length;a++){var s=e.value[a],u={},f=[],p;if(!i.validate(s,c,u,f))throw(p=new Error("Cannot read SafeBag.")).errors=f,p;var h={type:i.derToOid(u.bagId),attributes:v(u.bagAttributes)},d,y;n.push(h);var g=u.bagValue.value[0],p;switch(h.type){case o.oids.pkcs8ShroudedKeyBag:if(null===(g=o.decryptPrivateKeyInfo(g,r)))throw new Error("Unable to decrypt PKCS#8 ShroudedKeyBag, wrong password?");case o.oids.keyBag:try{h.key=o.privateKeyFromAsn1(g)}catch(e){h.key=null,h.asn1=g}continue;case o.oids.certBag:d=l,y=function(){if(i.derToOid(u.certId)!==o.oids.x509Certificate){var e=new Error("Unsupported certificate type, only X.509 supported.");throw e.oid=i.derToOid(u.certId),e}var r=i.fromDer(u.cert,t);try{h.cert=o.certificateFromAsn1(r,!0)}catch(e){h.cert=null,h.asn1=r}};break;default:var p;throw(p=new Error("Unsupported PKCS#12 SafeBag type.")).oid=h.type,p}if(void 0!==d&&!i.validate(g,d,u,f))throw(p=new Error("Cannot read PKCS#12 "+d.name)).errors=f,p;y()}return n}function v(e){var t={};if(void 0!==e)for(var r=0;r<e.length;++r){var n={},a=[];if(!i.validate(e[r],f,n,a)){var s=new Error("Cannot read PKCS#12 BagAttribute.");throw s.errors=a,s}var u=i.derToOid(n.oid);if(void 0!==o.oids[u]){t[o.oids[u]]=[];for(var c=0;c<n.values.length;++c)t[o.oids[u]].push(n.values[c].value)}}return t}a.pkcs12FromAsn1=function(e,t,r){"string"==typeof t?(r=t,t=!0):void 0===t&&(t=!0);var s={},c=[],f;if(!i.validate(e,u,s,c))throw(f=new Error("Cannot read PKCS#12 PFX. ASN.1 object is not an PKCS#12 PFX.")).errors=f,f;var l={version:s.version.charCodeAt(0),safeContents:[],getBags:function(e){var t={},r;return"localKeyId"in e?r=e.localKeyId:"localKeyIdHex"in e&&(r=n.util.hexToBytes(e.localKeyIdHex)),void 0===r&&!("friendlyName"in e)&&"bagType"in e&&(t[e.bagType]=p(l.safeContents,null,null,e.bagType)),void 0!==r&&(t.localKeyId=p(l.safeContents,"localKeyId",r,e.bagType)),"friendlyName"in e&&(t.friendlyName=p(l.safeContents,"friendlyName",e.friendlyName,e.bagType)),t},getBagsByFriendlyName:function(e,t){return p(l.safeContents,"friendlyName",e,t)},getBagsByLocalKeyId:function(e,t){return p(l.safeContents,"localKeyId",e,t)}},f,f;if(3!==s.version.charCodeAt(0))throw(f=new Error("PKCS#12 PFX of version other than 3 not supported.")).version=s.version.charCodeAt(0),f;if(i.derToOid(s.contentType)!==o.oids.data)throw(f=new Error("Only PKCS#12 PFX in password integrity mode supported.")).oid=i.derToOid(s.contentType),f;var y=s.content.value[0];if(y.tagClass!==i.Class.UNIVERSAL||y.type!==i.Type.OCTETSTRING)throw new Error("PKCS#12 authSafe content data is not an OCTET STRING.");if(y=h(y),s.mac){var g=null,v=0,m=i.derToOid(s.macAlgorithm);switch(m){case o.oids.sha1:g=n.md.sha1.create(),v=20;break;case o.oids.sha256:g=n.md.sha256.create(),v=32;break;case o.oids.sha384:g=n.md.sha384.create(),v=48;break;case o.oids.sha512:g=n.md.sha512.create(),v=64;break;case o.oids.md5:g=n.md.md5.create(),v=16}if(null===g)throw new Error("PKCS#12 uses unsupported MAC algorithm: "+m);var b=new n.util.ByteBuffer(s.macSalt),E="macIterations"in s?parseInt(n.util.bytesToHex(s.macIterations),16):1,T=a.generateKey(r,b,3,E,v,g),S=n.hmac.create(),w;if(S.start(g,T),S.update(y.value),S.getMac().getBytes()!==s.macDigest)throw new Error("PKCS#12 MAC could not be verified. Invalid password?")}return d(l,y.value,t,r),l},a.toPkcs12Asn1=function(e,t,r,s){(s=s||{}).saltSize=s.saltSize||8,s.count=s.count||2048,s.algorithm=s.algorithm||s.encAlgorithm||"aes128","useMac"in s||(s.useMac=!0),"localKeyId"in s||(s.localKeyId=null),"generateLocalKeyId"in s||(s.generateLocalKeyId=!0);var u=s.localKeyId,c;if(null!==u)u=n.util.hexToBytes(u);else if(s.generateLocalKeyId)if(t){var f=n.util.isArray(t)?t[0]:t,l;"string"==typeof f&&(f=o.certificateFromPem(f)),(l=n.md.sha1.create()).update(i.toDer(o.certificateToAsn1(f)).getBytes()),u=l.digest().getBytes()}else u=n.random.getBytes(20);var p=[];null!==u&&p.push(i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(o.oids.localKeyId).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SET,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,u)])])),"friendlyName"in s&&p.push(i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(o.oids.friendlyName).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SET,!0,[i.create(i.Class.UNIVERSAL,i.Type.BMPSTRING,!1,s.friendlyName)])])),p.length>0&&(c=i.create(i.Class.UNIVERSAL,i.Type.SET,!0,p));var h=[],d=[];null!==t&&(d=n.util.isArray(t)?t:[t]);for(var y=[],g=0;g<d.length;++g){"string"==typeof(t=d[g])&&(t=o.certificateFromPem(t));var v=0===g?c:void 0,m=o.certificateToAsn1(t),b=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(o.oids.certBag).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(o.oids.x509Certificate).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,i.toDer(m).getBytes())])])]),v]);y.push(b)}if(y.length>0){var E=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,y),T=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(o.oids.data).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,i.toDer(E).getBytes())])]);h.push(T)}var S=null;if(null!==e){var w=o.wrapRsaPrivateKey(o.privateKeyToAsn1(e));S=null===r?i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(o.oids.keyBag).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[w]),c]):i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(o.oids.pkcs8ShroudedKeyBag).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[o.encryptPrivateKeyInfo(w,r,s)]),c]);var C=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[S]),_=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(o.oids.data).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,i.toDer(C).getBytes())])]);h.push(_)}var I=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,h),A;if(s.useMac){var l=n.md.sha1.create(),R=new n.util.ByteBuffer(n.random.getBytes(s.saltSize)),O=s.count,e=a.generateKey(r,R,3,O,20),P=n.hmac.create();P.start(l,e),P.update(i.toDer(I).getBytes());var B=P.getMac();A=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(o.oids.sha1).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")]),i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,B.getBytes())]),i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,R.getBytes()),i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(O).getBytes())])}return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(3).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(o.oids.data).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,i.toDer(I).getBytes())])]),A])},a.generateKey=n.pbe.generatePkcs12Key},function(e,t,r){var n=r(4);r(33),r(8);var i=n.asn1,o=e.exports=n.pkcs7asn1=n.pkcs7asn1||{};n.pkcs7=n.pkcs7||{},n.pkcs7.asn1=o;var a={name:"ContentInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.ContentType",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,captureAsn1:"content"}]};o.contentInfoValidator=a;var s={name:"EncryptedContentInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentType",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"contentType"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentEncryptionAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm.parameter",tagClass:i.Class.UNIVERSAL,captureAsn1:"encParameter"}]},{name:"EncryptedContentInfo.encryptedContent",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,capture:"encryptedContent",captureAsn1:"encryptedContentAsn1"}]};o.envelopedDataValidator={name:"EnvelopedData",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EnvelopedData.Version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"},{name:"EnvelopedData.RecipientInfos",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0,captureAsn1:"recipientInfos"}].concat(s)},o.encryptedDataValidator={name:"EncryptedData",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedData.Version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"}].concat(s)};var u={name:"SignerInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1},{name:"SignerInfo.issuerAndSerialNumber",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.issuerAndSerialNumber.issuer",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"SignerInfo.issuerAndSerialNumber.serialNumber",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"SignerInfo.digestAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.digestAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"digestAlgorithm"},{name:"SignerInfo.digestAlgorithm.parameter",tagClass:i.Class.UNIVERSAL,constructed:!1,captureAsn1:"digestParameter",optional:!0}]},{name:"SignerInfo.authenticatedAttributes",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"authenticatedAttributes"},{name:"SignerInfo.digestEncryptionAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,capture:"signatureAlgorithm"},{name:"SignerInfo.encryptedDigest",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"signature"},{name:"SignerInfo.unauthenticatedAttributes",tagClass:i.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,capture:"unauthenticatedAttributes"}]};o.signedDataValidator={name:"SignedData",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SignedData.Version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"},{name:"SignedData.DigestAlgorithms",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0,captureAsn1:"digestAlgorithms"},a,{name:"SignedData.Certificates",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,optional:!0,captureAsn1:"certificates"},{name:"SignedData.CertificateRevocationLists",tagClass:i.Class.CONTEXT_SPECIFIC,type:1,optional:!0,captureAsn1:"crls"},{name:"SignedData.SignerInfos",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,capture:"signerInfos",optional:!0,value:[u]}]},o.recipientInfoValidator={name:"RecipientInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"},{name:"RecipientInfo.issuerAndSerial",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.issuerAndSerial.issuer",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"RecipientInfo.issuerAndSerial.serialNumber",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"RecipientInfo.keyEncryptionAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.keyEncryptionAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"RecipientInfo.keyEncryptionAlgorithm.parameter",tagClass:i.Class.UNIVERSAL,constructed:!1,captureAsn1:"encParameter"}]},{name:"RecipientInfo.encryptedKey",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"encKey"}]}},function(e,t,r){var n=r(4),i;r(8),n.mgf=n.mgf||{},(e.exports=n.mgf.mgf1=n.mgf1=n.mgf1||{}).create=function(e){var t;return{generate:function(t,r){for(var i=new n.util.ByteBuffer,o=Math.ceil(r/e.digestLength),a=0;a<o;a++){var s=new n.util.ByteBuffer;s.putInt32(a),e.start(),e.update(t+s.getBytes()),i.putBuffer(e.digest())}return i.truncate(i.length()-r),i.getBytes()}}}},function(e,t,r){var n=r(4);e.exports=n.debug=n.debug||{},n.debug.storage={},n.debug.get=function(e,t){var r;return void 0===e?r=n.debug.storage:e in n.debug.storage&&(r=void 0===t?n.debug.storage[e]:n.debug.storage[e][t]),r},n.debug.set=function(e,t,r){e in n.debug.storage||(n.debug.storage[e]={}),n.debug.storage[e][t]=r},n.debug.clear=function(e,t){void 0===e?n.debug.storage={}:e in n.debug.storage&&(void 0===t?delete n.debug.storage[e]:delete n.debug.storage[e][t])}},function(e,t,r){var n=r(4);r(37),r(8);var i=e.exports=n.sha512=n.sha512||{};n.md.sha512=n.md.algorithms.sha512=i;var o=n.sha384=n.sha512.sha384=n.sha512.sha384||{};o.create=function(){return i.create("SHA-384")},n.md.sha384=n.md.algorithms.sha384=o,n.sha512.sha256=n.sha512.sha256||{create:function(){return i.create("SHA-512/256")}},n.md["sha512/256"]=n.md.algorithms["sha512/256"]=n.sha512.sha256,n.sha512.sha224=n.sha512.sha224||{create:function(){return i.create("SHA-512/224")}},n.md["sha512/224"]=n.md.algorithms["sha512/224"]=n.sha512.sha224,i.create=function(e){if(s||f(),void 0===e&&(e="SHA-512"),!(e in c))throw new Error("Invalid SHA-512 algorithm: "+e);for(var t=c[e],r=null,i=n.util.createBuffer(),o=new Array(80),u=0;u<80;++u)o[u]=new Array(2);var p=64;switch(e){case"SHA-384":p=48;break;case"SHA-512/256":p=32;break;case"SHA-512/224":p=28}var h={algorithm:e.replace("-","").toLowerCase(),blockLength:128,digestLength:p,messageLength:0,fullMessageLength:null,messageLengthSize:16,start:function(){h.messageLength=0,h.fullMessageLength=h.messageLength128=[];for(var e=h.messageLengthSize/4,o=0;o<e;++o)h.fullMessageLength.push(0);i=n.util.createBuffer(),r=new Array(t.length);for(var o=0;o<t.length;++o)r[o]=t[o].slice(0);return h}};return h.start(),h.update=function(e,t){"utf8"===t&&(e=n.util.encodeUtf8(e));var a=e.length;h.messageLength+=a,a=[a/4294967296>>>0,a>>>0];for(var s=h.fullMessageLength.length-1;s>=0;--s)h.fullMessageLength[s]+=a[1],a[1]=a[0]+(h.fullMessageLength[s]/4294967296>>>0),h.fullMessageLength[s]=h.fullMessageLength[s]>>>0,a[0]=a[1]/4294967296>>>0;return i.putBytes(e),l(r,o,i),(i.read>2048||0===i.length())&&i.compact(),h},h.digest=function(){var t=n.util.createBuffer();t.putBytes(i.bytes());var s,u=h.fullMessageLength[h.fullMessageLength.length-1]+h.messageLengthSize&h.blockLength-1,c,f;t.putBytes(a.substr(0,h.blockLength-u));for(var p=8*h.fullMessageLength[0],d=0;d<h.fullMessageLength.length-1;++d)p+=f=(c=8*h.fullMessageLength[d+1])/4294967296>>>0,t.putInt32(p>>>0),p=c>>>0;t.putInt32(p);for(var y=new Array(r.length),d=0;d<r.length;++d)y[d]=r[d].slice(0);l(y,o,t);var g=n.util.createBuffer(),v;v="SHA-512"===e?y.length:"SHA-384"===e?y.length-2:y.length-4;for(var d=0;d<v;++d)g.putInt32(y[d][0]),d===v-1&&"SHA-512/224"===e||g.putInt32(y[d][1]);return g},h};var a=null,s=!1,u=null,c=null;function f(){a=String.fromCharCode(128),a+=n.util.fillString(String.fromCharCode(0),128),u=[[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]],(c={})["SHA-512"]=[[1779033703,4089235720],[3144134277,2227873595],[1013904242,4271175723],[2773480762,1595750129],[1359893119,2917565137],[2600822924,725511199],[528734635,4215389547],[1541459225,327033209]],c["SHA-384"]=[[3418070365,3238371032],[1654270250,914150663],[2438529370,812702999],[355462360,4144912697],[1731405415,4290775857],[2394180231,1750603025],[3675008525,1694076839],[1203062813,3204075428]],c["SHA-512/256"]=[[573645204,4230739756],[2673172387,3360449730],[596883563,1867755857],[2520282905,1497426621],[2519219938,2827943907],[3193839141,1401305490],[721525244,746961066],[246885852,2177182882]],c["SHA-512/224"]=[[2352822216,424955298],[1944164710,2312950998],[502970286,855612546],[1738396948,1479516111],[258812777,2077511080],[2011393907,79989058],[1067287976,1780299464],[286451373,2446758561]],s=!0}function l(e,t,r){for(var n,i,o,a,s,c,f,l,p,h,d,y,g,v,m,b,E,T,S,w,C,_,I,A,R,O,P,B,k,N,U,D,x,L,j,M=r.length();M>=128;){for(k=0;k<16;++k)t[k][0]=r.getInt32()>>>0,t[k][1]=r.getInt32()>>>0;for(;k<80;++k)n=(((N=(D=t[k-2])[0])>>>19|(U=D[1])<<13)^(U>>>29|N<<3)^N>>>6)>>>0,i=((N<<13|U>>>19)^(U<<3|N>>>29)^(N<<26|U>>>6))>>>0,o=(((N=(L=t[k-15])[0])>>>1|(U=L[1])<<31)^(N>>>8|U<<24)^N>>>7)>>>0,a=((N<<31|U>>>1)^(N<<24|U>>>8)^(N<<25|U>>>7))>>>0,x=t[k-7],j=t[k-16],U=i+x[1]+a+j[1],t[k][0]=n+x[0]+o+j[0]+(U/4294967296>>>0)>>>0,t[k][1]=U>>>0;for(g=e[0][0],v=e[0][1],m=e[1][0],b=e[1][1],E=e[2][0],T=e[2][1],S=e[3][0],w=e[3][1],C=e[4][0],_=e[4][1],I=e[5][0],A=e[5][1],R=e[6][0],O=e[6][1],P=e[7][0],B=e[7][1],k=0;k<80;++k)f=((C>>>14|_<<18)^(C>>>18|_<<14)^(_>>>9|C<<23))>>>0,p=(R^C&(I^R))>>>0,s=((g>>>28|v<<4)^(v>>>2|g<<30)^(v>>>7|g<<25))>>>0,c=((g<<4|v>>>28)^(v<<30|g>>>2)^(v<<25|g>>>7))>>>0,d=(g&m|E&(g^m))>>>0,y=(v&b|T&(v^b))>>>0,U=B+(l=((C<<18|_>>>14)^(C<<14|_>>>18)^(_<<23|C>>>9))>>>0)+(h=(O^_&(A^O))>>>0)+u[k][1]+t[k][1],n=P+f+p+u[k][0]+t[k][0]+(U/4294967296>>>0)>>>0,i=U>>>0,o=s+d+((U=c+y)/4294967296>>>0)>>>0,a=U>>>0,P=R,B=O,R=I,O=A,I=C,A=_,C=S+n+((U=w+i)/4294967296>>>0)>>>0,_=U>>>0,S=E,w=T,E=m,T=b,m=g,b=v,g=n+o+((U=i+a)/4294967296>>>0)>>>0,v=U>>>0;U=e[0][1]+v,e[0][0]=e[0][0]+g+(U/4294967296>>>0)>>>0,e[0][1]=U>>>0,U=e[1][1]+b,e[1][0]=e[1][0]+m+(U/4294967296>>>0)>>>0,e[1][1]=U>>>0,U=e[2][1]+T,e[2][0]=e[2][0]+E+(U/4294967296>>>0)>>>0,e[2][1]=U>>>0,U=e[3][1]+w,e[3][0]=e[3][0]+S+(U/4294967296>>>0)>>>0,e[3][1]=U>>>0,U=e[4][1]+_,e[4][0]=e[4][0]+C+(U/4294967296>>>0)>>>0,e[4][1]=U>>>0,U=e[5][1]+A,e[5][0]=e[5][0]+I+(U/4294967296>>>0)>>>0,e[5][1]=U>>>0,U=e[6][1]+O,e[6][0]=e[6][0]+R+(U/4294967296>>>0)>>>0,e[6][1]=U>>>0,U=e[7][1]+B,e[7][0]=e[7][0]+P+(U/4294967296>>>0)>>>0,e[7][1]=U>>>0,M-=128}}},function(e,t,r){var n=r(4);r(8),e.exports=n.log=n.log||{},n.log.levels=["none","error","warning","info","debug","verbose","max"];var i={},o=[],a=null;n.log.LEVEL_LOCKED=2,n.log.NO_LEVEL_CHECK=4,n.log.INTERPOLATE=8;for(var s=0;s<n.log.levels.length;++s){var u=n.log.levels[s];i[u]={index:s,name:u.toUpperCase()}}n.log.logMessage=function(e){for(var t=i[e.level].index,r=0;r<o.length;++r){var a=o[r],s;if(a.flags&n.log.NO_LEVEL_CHECK)a.f(e);else t<=i[a.level].index&&a.f(a,e)}},n.log.prepareStandard=function(e){"standard"in e||(e.standard=i[e.level].name+" ["+e.category+"] "+e.message)},n.log.prepareFull=function(e){if(!("full"in e)){var t=[e.message];t=t.concat([]||!1),e.full=n.util.format.apply(this,t)}},n.log.prepareStandardFull=function(e){"standardFull"in e||(n.log.prepareStandard(e),e.standardFull=e.standard)};for(var c=["error","warning","info","debug","verbose"],s=0;s<c.length;++s)(function(e){n.log[e]=function(t,r){var i=Array.prototype.slice.call(arguments).slice(2),o={timestamp:new Date,level:e,category:t,message:r,arguments:i};n.log.logMessage(o)}})(c[s]);if(n.log.makeLogger=function(e){var t={flags:0,f:e};return n.log.setLevel(t,"none"),t},n.log.setLevel=function(e,t){var r=!1;if(e&&!(e.flags&n.log.LEVEL_LOCKED))for(var i=0;i<n.log.levels.length;++i){var o;if(t==n.log.levels[i]){e.level=t,r=!0;break}}return r},n.log.lock=function(e,t){void 0===t||t?e.flags|=n.log.LEVEL_LOCKED:e.flags&=~n.log.LEVEL_LOCKED},n.log.addLogger=function(e){o.push(e)},"undefined"!=typeof console&&"log"in console){var f;if(console.error&&console.warn&&console.info&&console.debug){var l={error:console.error,warning:console.warn,info:console.info,debug:console.debug,verbose:console.debug},p=function(e,t){n.log.prepareStandard(t);var r=l[t.level],i=[t.standard];i=i.concat(t.arguments.slice()),r.apply(console,i)};f=n.log.makeLogger(p)}else{var p=function(e,t){n.log.prepareStandardFull(t),console.log(t.standardFull)};f=n.log.makeLogger(p)}n.log.setLevel(f,"debug"),n.log.addLogger(f),a=f}else console={log:function(){}};if(null!==a){var h=n.util.getQueryVariables(),d;if("console.level"in h&&n.log.setLevel(a,h["console.level"].slice(-1)[0]),"console.lock"in h)"true"==h["console.lock"].slice(-1)[0]&&n.log.lock(a)}n.log.consoleLogger=a},function(e,t,r){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",a=r.toStringTag||"@@toStringTag";function s(r,n,i,a){var s=n&&n.prototype instanceof c?n:c,f=Object.create(s.prototype);return o(f,"_invoke",function(r,n,i){var o,a,s,c=0,f=i||[],l=!1,p={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function t(r,n){return o=r,a=0,s=e,p.n=n,u}};function h(r,n){for(a=r,s=n,t=0;!l&&c&&!i&&t<f.length;t++){var i,o=f[t],h=p.p,d=o[2];r>3?(i=d===n)&&(s=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=e):o[0]<=h&&((i=r<2&&h<o[1])?(a=0,p.v=n,p.n=o[1]):h<d&&(i=r<3||o[0]>n||n>d)&&(o[4]=r,o[5]=n,p.n=d,a=0))}if(i||r>1)return u;throw l=!0,n}return function(i,f,d){if(c>1)throw TypeError("Generator is already running");for(l&&1===f&&h(f,d),a=f,s=d;(t=a<2?e:s)||!l;){o||(a?a<3?(a>1&&(p.n=-1),h(a,s)):p.n=s:p.v=s);try{if(c=2,o){if(a||(i="next"),t=o[i]){if(!(t=t.call(o,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,a<2&&(a=0)}else 1===a&&(t=o.return)&&t.call(o),a<2&&(s=TypeError("The iterator does not provide a '"+i+"' method"),a=1);o=e}else if((t=(l=p.n<0)?s:r.call(n,p))!==u)break}catch(t){o=e,a=1,s=t}finally{c=1}}return{value:t,done:l}}}(r,i,a),!0),f}var u={};function c(){}function f(){}function l(){}t=Object.getPrototypeOf;var p=[][n]?t(t([][n]())):(o(t={},n,function(){return this}),t),h=l.prototype=c.prototype=Object.create(p);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,o(e,a,"GeneratorFunction")),e.prototype=Object.create(h),e}return f.prototype=l,o(h,"constructor",l),o(l,"constructor",f),f.displayName="GeneratorFunction",o(l,a,"GeneratorFunction"),o(h),o(h,a,"Generator"),o(h,n,function(){return this}),o(h,"toString",function(){return"[object Generator]"}),(i=function e(){return{w:s,m:d}})()}function o(e,t,r,n){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}o=function e(t,r,n,a){function s(e,r){o(t,e,function(t){return this._invoke(e,r,t)})}r?i?i(t,r,{value:n,enumerable:!a,configurable:!a,writable:!a}):t[r]=n:(s("next",0),s("throw",1),s("return",2))},o(e,t,r,n)}function a(e){if(null==e)throw new TypeError("Cannot destructure "+e)}function s(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function u(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var o=e.apply(t,r);function a(e){s(o,n,i,a,u,"next",e)}function u(e){s(o,n,i,a,u,"throw",e)}a(void 0)})}}function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,p(n.key),n)}}function l(e,t,r){return t&&f(e.prototype,t),r&&f(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function p(e){var t=h(e,"string");return"symbol"==n(t)?t:t+""}function h(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}e.exports=function(){function e(){var t,r=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).type;if(c(this,e),"string"!=typeof r)throw new TypeError('A LinkedDataProof must have a "type".');this.type=r}return l(e,[{key:"createProof",value:function(){var e=u(i().m(function e(t){return i().w(function(e){for(;;)switch(e.n){case 0:throw a(t),new Error('"createProof" must be implemented in a derived class.');case 1:return e.a(2)}},e)}));function t(t){return e.apply(this,arguments)}return t}()},{key:"verifyProof",value:function(){var e=u(i().m(function e(t){return i().w(function(e){for(;;)switch(e.n){case 0:throw a(t),new Error('"verifyProof" must be implemented in a derived class.');case 1:return e.a(2)}},e)}));function t(t){return e.apply(this,arguments)}return t}()},{key:"matchProof",value:function(){var e=u(i().m(function e(t){var r;return i().w(function(e){for(;;)if(0===e.n)return r=t.proof,e.a(2,r.type===this.type)},e,this)}));function t(t){return e.apply(this,arguments)}return t}()}])}()},function(e,t,r){"use strict";(function(t){function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",a=r.toStringTag||"@@toStringTag";function s(r,n,i,a){var s=n&&n.prototype instanceof c?n:c,f=Object.create(s.prototype);return o(f,"_invoke",function(r,n,i){var o,a,s,c=0,f=i||[],l=!1,p={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function t(r,n){return o=r,a=0,s=e,p.n=n,u}};function h(r,n){for(a=r,s=n,t=0;!l&&c&&!i&&t<f.length;t++){var i,o=f[t],h=p.p,d=o[2];r>3?(i=d===n)&&(s=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=e):o[0]<=h&&((i=r<2&&h<o[1])?(a=0,p.v=n,p.n=o[1]):h<d&&(i=r<3||o[0]>n||n>d)&&(o[4]=r,o[5]=n,p.n=d,a=0))}if(i||r>1)return u;throw l=!0,n}return function(i,f,d){if(c>1)throw TypeError("Generator is already running");for(l&&1===f&&h(f,d),a=f,s=d;(t=a<2?e:s)||!l;){o||(a?a<3?(a>1&&(p.n=-1),h(a,s)):p.n=s:p.v=s);try{if(c=2,o){if(a||(i="next"),t=o[i]){if(!(t=t.call(o,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,a<2&&(a=0)}else 1===a&&(t=o.return)&&t.call(o),a<2&&(s=TypeError("The iterator does not provide a '"+i+"' method"),a=1);o=e}else if((t=(l=p.n<0)?s:r.call(n,p))!==u)break}catch(t){o=e,a=1,s=t}finally{c=1}}return{value:t,done:l}}}(r,i,a),!0),f}var u={};function c(){}function f(){}function l(){}t=Object.getPrototypeOf;var p=[][n]?t(t([][n]())):(o(t={},n,function(){return this}),t),h=l.prototype=c.prototype=Object.create(p);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,o(e,a,"GeneratorFunction")),e.prototype=Object.create(h),e}return f.prototype=l,o(h,"constructor",l),o(l,"constructor",f),f.displayName="GeneratorFunction",o(l,a,"GeneratorFunction"),o(h),o(h,a,"Generator"),o(h,n,function(){return this}),o(h,"toString",function(){return"[object Generator]"}),(i=function e(){return{w:s,m:d}})()}function o(e,t,r,n){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}o=function e(t,r,n,a){function s(e,r){o(t,e,function(t){return this._invoke(e,r,t)})}r?i?i(t,r,{value:n,enumerable:!a,configurable:!a,writable:!a}):t[r]=n:(s("next",0),s("throw",1),s("return",2))},o(e,t,r,n)}function a(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function s(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var o=e.apply(t,r);function s(e){a(o,n,i,s,u,"next",e)}function u(e){a(o,n,i,s,u,"throw",e)}s(void 0)})}}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,l(n.key),n)}}function f(e,t,r){return t&&c(e.prototype,t),r&&c(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function l(e){var t=p(e,"string");return"symbol"==n(t)?t:t+""}function p(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function h(e,t,r){return t=E(t),d(e,g()?Reflect.construct(t,r||[],E(e).constructor):t.apply(e,r))}function d(e,t){if(t&&("object"==n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return y(e)}function y(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function g(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(g=function t(){return!!e})()}function v(e,t,r,n){var i=m(E(1&n?e.prototype:e),t,r);return 2&n&&"function"==typeof i?function(e){return i.apply(r,e)}:i}function m(){return m="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=b(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}},m.apply(null,arguments)}function b(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=E(e)););return e}function E(e){return E=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},E(e)}function T(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&S(e,t)}function S(e,t){return S=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},S(e,t)}var w=r(133),C=r(117),_=r(115);e.exports=function(e){function n(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.type,i=void 0===r?"LinkedDataSignature2015":r,o=t.privateKeyPem,a=t.publicKeyPem,s=t.creator,c=t.date,f=t.domain,l=t.nonce,p=t.useNativeCanonize;if(u(this,n),void 0!==f&&"string"!=typeof f)throw new TypeError('"domain" must be a string.');if(void 0!==l&&"string"!=typeof l)throw new TypeError('"nonce" must be a string.');return(e=h(this,n,[{type:i,creator:s,date:c,domain:f,nonce:l,useNativeCanonize:p}])).legacy=!0,e.privateKeyPem=o,e.publicKeyPem=a,e.nonce=l,e.domain=f,e}return T(n,e),f(n,[{key:"updateProof",value:function(){var e=s(i().m(function e(t){var r;return i().w(function(e){for(;;)if(0===e.n)return r=t.proof,void 0!==this.domain&&(r.domain=this.domain),void 0!==this.nonce&&(r.nonce=this.nonce),e.a(2,r)},e,this)}));function t(t){return e.apply(this,arguments)}return t}()},{key:"verifyProof",value:function(){var e=s(i().m(function e(t){var r,o,a,s,u,c,f;return i().w(function(e){for(;;)switch(e.p=e.n){case 0:if(r=t.proof,o=t.document,a=t.purpose,s=t.documentLoader,u=t.expansionMap,c=t.compactProof,e.p=1,void 0===this.domain||r.domain===this.domain){e.n=2;break}throw new Error("The domain is not as expected; "+'domain="'.concat(r.domain,'", expected="').concat(this.domain,'"'));case 2:return e.a(2,v(n,"verifyProof",this,3)([{proof:r,document:o,purpose:a,documentLoader:s,expansionMap:u,compactProof:c}]));case 3:return e.p=3,f=e.v,e.a(2,{verified:!1,error:f})}},e,this,[[1,3]])}));function t(t){return e.apply(this,arguments)}return t}()},{key:"createVerifyData",value:function(){var e=s(i().m(function e(t){var r,n,o,a,s,u,c,f,l,p,h,d;return i().w(function(e){for(;;)switch(e.n){case 0:return r=t.document,n=t.proof,o=t.documentLoader,a=t.expansionMap,e.n=1,this.canonize(r,{documentLoader:o,expansionMap:a});case 1:for(s=e.v,u="",c={"http://purl.org/dc/elements/1.1/created":n.created,"https://w3id.org/security#domain":n.domain,"https://w3id.org/security#nonce":n.nonce},f=Object.keys(c).sort(),l=0;l<f.length;++l)p=f[l],null!=(h=c[p])&&(u+=p+": "+h+"\n");return u+=s,d=new C.util.ByteBuffer(u,"utf8"),e.a(2,C.util.binary.raw.decode(d.getBytes()))}},e,this)}));function t(t){return e.apply(this,arguments)}return t}()},{key:"sign",value:function(){var e=s(i().m(function e(n){var o,a,s,u,c,f,l,p;return i().w(function(e){for(;;)switch(e.n){case 0:if(o=n.verifyData,a=n.proof,"string"==typeof(s=this.privateKeyPem)){e.n=1;break}throw new TypeError('"privateKeyPem" must be a PEM formatted string.');case 1:return w.nodejs?(c=r(152),(f=c.createSign("RSA-SHA256")).update(t.from(o.buffer,o.byteOffset,o.length)),u=f.sign(s,"base64")):(l=C.pki.privateKeyFromPem(s),(p=C.md.sha256.create()).update(C.util.binary.raw.encode(o),"binary"),u=C.util.encode64(l.sign(p))),a.signatureValue=u,e.a(2,a)}},e,this)}));function n(t){return e.apply(this,arguments)}return n}()},{key:"verifySignature",value:function(){var e=s(i().m(function e(n){var o,a,s,u,c,f,l,p;return i().w(function(e){for(;;)switch(e.p=e.n){case 0:if(o=n.verifyData,a=n.proof,"string"==typeof(s=this.publicKeyPem)){e.n=1;break}throw new TypeError('Could not verify signature; invalid "publicKeyPem".');case 1:if(!w.nodejs){e.n=2;break}return u=r(152),(c=u.createVerify("RSA-SHA256")).update(t.from(o.buffer,o.byteOffset,o.length)),e.a(2,c.verify(s,a.signatureValue,"base64"));case 2:return f=C.pki.publicKeyFromPem(s),(l=C.md.sha256.create()).update(C.util.binary.raw.encode(o),"binary"),e.p=3,e.a(2,f.verify(l.digest().bytes(),C.util.decode64(a.signatureValue)));case 4:return e.p=4,p=e.v,e.a(2,!1)}},e,this,[[3,4]])}));function n(t){return e.apply(this,arguments)}return n}()},{key:"getVerificationMethod",value:function(){var e=s(i().m(function e(t){var r,o,a;return i().w(function(e){for(;;)switch(e.n){case 0:return r=t.proof,o=t.documentLoader,e.n=1,v(n,"getVerificationMethod",this,3)([{proof:r,documentLoader:o}]);case 1:return a=e.v,this.publicKeyPem||(this.publicKeyPem=a.publicKeyPem),e.a(2,a)}},e,this)}));function t(t){return e.apply(this,arguments)}return t}()}])}(_)}).call(this,r(116).Buffer)},function(e,t){},,,,,,,,,,,,,,,,,function(e,t,r){"use strict";function n(e){return e&&"function"==typeof e.schedule}r.d(t,"a",function(){return u});var i=r(5),o=r(35),a=r(22);function s(e,t){return t?Object(a.a)(e,t):new i.a(Object(o.a)(e))}function u(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e[e.length-1];return n(r)?(e.pop(),Object(a.a)(e,r)):s(e)}},,function(e,t,r){(function(t,r,n,i){var o,o,a;a=function(){return function e(t,r,n){function i(a,s){if(!r[a]){if(!t[a]){var u=!1;if(o)return o(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var f=r[a]={exports:{}};t[a][0].call(f.exports,function(e){var r;return i(t[a][1][e]||e)},f,f.exports,e,t,r,n)}return r[a].exports}for(var o=!1,a=0;a<n.length;a++)i(n[a]);return i}({1:[function(e,t,r){"use strict";var n=e("./utils"),i=e("./support"),o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";r.encode=function(e){for(var t,r,i,a,s,u,c,f=[],l=0,p=e.length,h=p,d="string"!==n.getTypeOf(e);l<e.length;)h=p-l,i=d?(t=e[l++],r=l<p?e[l++]:0,l<p?e[l++]:0):(t=e.charCodeAt(l++),r=l<p?e.charCodeAt(l++):0,l<p?e.charCodeAt(l++):0),a=t>>2,s=(3&t)<<4|r>>4,u=1<h?(15&r)<<2|i>>6:64,c=2<h?63&i:64,f.push(o.charAt(a)+o.charAt(s)+o.charAt(u)+o.charAt(c));return f.join("")},r.decode=function(e){var t,r,n,a,s,u,c=0,f=0,l="data:";if(e.substr(0,5)===l)throw new Error("Invalid base64 input, it looks like a data url.");var p,h=3*(e=e.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(e.charAt(e.length-1)===o.charAt(64)&&h--,e.charAt(e.length-2)===o.charAt(64)&&h--,h%1!=0)throw new Error("Invalid base64 input, bad content length.");for(p=i.uint8array?new Uint8Array(0|h):new Array(0|h);c<e.length;)t=o.indexOf(e.charAt(c++))<<2|(a=o.indexOf(e.charAt(c++)))>>4,r=(15&a)<<4|(s=o.indexOf(e.charAt(c++)))>>2,n=(3&s)<<6|(u=o.indexOf(e.charAt(c++))),p[f++]=t,64!==s&&(p[f++]=r),64!==u&&(p[f++]=n);return p}},{"./support":30,"./utils":32}],2:[function(e,t,r){"use strict";var n=e("./external"),i=e("./stream/DataWorker"),o=e("./stream/Crc32Probe"),a=e("./stream/DataLengthProbe");function s(e,t,r,n,i){this.compressedSize=e,this.uncompressedSize=t,this.crc32=r,this.compression=n,this.compressedContent=i}s.prototype={getContentWorker:function(){var e=new i(n.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new a("data_length")),t=this;return e.on("end",function(){if(this.streamInfo.data_length!==t.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),e},getCompressedWorker:function(){return new i(n.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},s.createWorkerFrom=function(e,t,r){return e.pipe(new o).pipe(new a("uncompressedSize")).pipe(t.compressWorker(r)).pipe(new a("compressedSize")).withStreamInfo("compression",t)},t.exports=s},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(e,t,r){"use strict";var n=e("./stream/GenericWorker");r.STORE={magic:"\0\0",compressWorker:function(){return new n("STORE compression")},uncompressWorker:function(){return new n("STORE decompression")}},r.DEFLATE=e("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(e,t,r){"use strict";var n=e("./utils"),i=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();t.exports=function(e,t){return void 0!==e&&e.length?"string"!==n.getTypeOf(e)?function(e,t,r,n){var o=i,a=0+r;e^=-1;for(var s=0;s<a;s++)e=e>>>8^o[255&(e^t[s])];return-1^e}(0|t,e,e.length,0):function(e,t,r,n){var o=i,a=0+r;e^=-1;for(var s=0;s<a;s++)e=e>>>8^o[255&(e^t.charCodeAt(s))];return-1^e}(0|t,e,e.length,0):0}},{"./utils":32}],5:[function(e,t,r){"use strict";r.base64=!1,r.binary=!1,r.dir=!1,r.createFolders=!0,r.date=null,r.compression=null,r.compressionOptions=null,r.comment=null,r.unixPermissions=null,r.dosPermissions=null},{}],6:[function(e,t,r){"use strict";var n=null;n="undefined"!=typeof Promise?Promise:e("lie"),t.exports={Promise:n}},{lie:37}],7:[function(e,t,r){"use strict";var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,i=e("pako"),o=e("./utils"),a=e("./stream/GenericWorker"),s=n?"uint8array":"array";function u(e,t){a.call(this,"FlateWorker/"+e),this._pako=null,this._pakoAction=e,this._pakoOptions=t,this.meta={}}r.magic="\b\0",o.inherits(u,a),u.prototype.processChunk=function(e){this.meta=e.meta,null===this._pako&&this._createPako(),this._pako.push(o.transformTo(s,e.data),!1)},u.prototype.flush=function(){a.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},u.prototype.cleanUp=function(){a.prototype.cleanUp.call(this),this._pako=null},u.prototype._createPako=function(){this._pako=new i[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var e=this;this._pako.onData=function(t){e.push({data:t,meta:e.meta})}},r.compressWorker=function(e){return new u("Deflate",e)},r.uncompressWorker=function(){return new u("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(e,t,r){"use strict";function n(e,t){var r,n="";for(r=0;r<t;r++)n+=String.fromCharCode(255&e),e>>>=8;return n}function i(e,t,r,i,a,f){var l,p,h=e.file,d=e.compression,y=f!==s.utf8encode,g=o.transformTo("string",f(h.name)),v=o.transformTo("string",s.utf8encode(h.name)),m=h.comment,b=o.transformTo("string",f(m)),E=o.transformTo("string",s.utf8encode(m)),T=v.length!==h.name.length,S=E.length!==m.length,w="",C="",_="",I=h.dir,A=h.date,R={crc32:0,compressedSize:0,uncompressedSize:0};t&&!r||(R.crc32=e.crc32,R.compressedSize=e.compressedSize,R.uncompressedSize=e.uncompressedSize);var O=0;t&&(O|=8),y||!T&&!S||(O|=2048);var P=0,B=0;I&&(P|=16),"UNIX"===a?(B=798,P|=function(e,t){var r=e;return e||(r=t?16893:33204),(65535&r)<<16}(h.unixPermissions,I)):(B=20,P|=function(e){return 63&(e||0)}(h.dosPermissions)),l=A.getUTCHours(),l<<=6,l|=A.getUTCMinutes(),l<<=5,l|=A.getUTCSeconds()/2,p=A.getUTCFullYear()-1980,p<<=4,p|=A.getUTCMonth()+1,p<<=5,p|=A.getUTCDate(),T&&(C=n(1,1)+n(u(g),4)+v,w+="up"+n(C.length,2)+C),S&&(_=n(1,1)+n(u(b),4)+E,w+="uc"+n(_.length,2)+_);var k="";return k+="\n\0",k+=n(O,2),k+=d.magic,k+=n(l,2),k+=n(p,2),k+=n(R.crc32,4),k+=n(R.compressedSize,4),k+=n(R.uncompressedSize,4),k+=n(g.length,2),k+=n(w.length,2),{fileRecord:c.LOCAL_FILE_HEADER+k+g+w,dirRecord:c.CENTRAL_FILE_HEADER+n(B,2)+k+n(b.length,2)+"\0\0\0\0"+n(P,4)+n(i,4)+g+w+b}}var o=e("../utils"),a=e("../stream/GenericWorker"),s=e("../utf8"),u=e("../crc32"),c=e("../signature");function f(e,t,r,n){a.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=t,this.zipPlatform=r,this.encodeFileName=n,this.streamFiles=e,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}o.inherits(f,a),f.prototype.push=function(e){var t=e.meta.percent||0,r=this.entriesCount,n=this._sources.length;this.accumulate?this.contentBuffer.push(e):(this.bytesWritten+=e.data.length,a.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:r?(t+100*(r-n-1))/r:100}}))},f.prototype.openedSource=function(e){this.currentSourceOffset=this.bytesWritten,this.currentFile=e.file.name;var t=this.streamFiles&&!e.file.dir;if(t){var r=i(e,t,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:r.fileRecord,meta:{percent:0}})}else this.accumulate=!0},f.prototype.closedSource=function(e){this.accumulate=!1;var t=this.streamFiles&&!e.file.dir,r=i(e,t,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(r.dirRecord),t)this.push({data:function(e){return c.DATA_DESCRIPTOR+n(e.crc32,4)+n(e.compressedSize,4)+n(e.uncompressedSize,4)}(e),meta:{percent:100}});else for(this.push({data:r.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},f.prototype.flush=function(){for(var e=this.bytesWritten,t=0;t<this.dirRecords.length;t++)this.push({data:this.dirRecords[t],meta:{percent:100}});var r=this.bytesWritten-e,i=function(e,t,r,i,a){var s=o.transformTo("string",a(i));return c.CENTRAL_DIRECTORY_END+"\0\0\0\0"+n(e,2)+n(e,2)+n(t,4)+n(r,4)+n(s.length,2)+s}(this.dirRecords.length,r,e,this.zipComment,this.encodeFileName);this.push({data:i,meta:{percent:100}})},f.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},f.prototype.registerPrevious=function(e){this._sources.push(e);var t=this;return e.on("data",function(e){t.processChunk(e)}),e.on("end",function(){t.closedSource(t.previous.streamInfo),t._sources.length?t.prepareNextSource():t.end()}),e.on("error",function(e){t.error(e)}),this},f.prototype.resume=function(){return!!a.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},f.prototype.error=function(e){var t=this._sources;if(!a.prototype.error.call(this,e))return!1;for(var r=0;r<t.length;r++)try{t[r].error(e)}catch(e){}return!0},f.prototype.lock=function(){a.prototype.lock.call(this);for(var e=this._sources,t=0;t<e.length;t++)e[t].lock()},t.exports=f},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(e,t,r){"use strict";var n=e("../compressions"),i=e("./ZipFileWorker");r.generateWorker=function(e,t,r){var o=new i(t.streamFiles,r,t.platform,t.encodeFileName),a=0;try{e.forEach(function(e,r){a++;var i=function(e,t){var r=e||t,i=n[r];if(!i)throw new Error(r+" is not a valid compression method !");return i}(r.options.compression,t.compression),s=r.options.compressionOptions||t.compressionOptions||{},u=r.dir,c=r.date;r._compressWorker(i,s).withStreamInfo("file",{name:e,dir:u,date:c,comment:r.comment||"",unixPermissions:r.unixPermissions,dosPermissions:r.dosPermissions}).pipe(o)}),o.entriesCount=a}catch(e){o.error(e)}return o}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(e,t,r){"use strict";function n(){if(!(this instanceof n))return new n;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var e=new n;for(var t in this)"function"!=typeof this[t]&&(e[t]=this[t]);return e}}(n.prototype=e("./object")).loadAsync=e("./load"),n.support=e("./support"),n.defaults=e("./defaults"),n.version="3.10.1",n.loadAsync=function(e,t){return(new n).loadAsync(e,t)},n.external=e("./external"),t.exports=n},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(e,t,r){"use strict";var n=e("./utils"),i=e("./external"),o=e("./utf8"),a=e("./zipEntries"),s=e("./stream/Crc32Probe"),u=e("./nodejsUtils");function c(e){return new i.Promise(function(t,r){var n=e.decompressed.getContentWorker().pipe(new s);n.on("error",function(e){r(e)}).on("end",function(){n.streamInfo.crc32!==e.decompressed.crc32?r(new Error("Corrupted zip : CRC32 mismatch")):t()}).resume()})}t.exports=function(e,t){var r=this;return t=n.extend(t||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:o.utf8decode}),u.isNode&&u.isStream(e)?i.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):n.prepareContent("the loaded zip file",e,!0,t.optimizedBinaryString,t.base64).then(function(e){var r=new a(t);return r.load(e),r}).then(function(e){var r=[i.Promise.resolve(e)],n=e.files;if(t.checkCRC32)for(var o=0;o<n.length;o++)r.push(c(n[o]));return i.Promise.all(r)}).then(function(e){for(var i=e.shift(),o=i.files,a=0;a<o.length;a++){var s=o[a],u=s.fileNameStr,c=n.resolve(s.fileNameStr);r.file(c,s.decompressed,{binary:!0,optimizedBinaryString:!0,date:s.date,dir:s.dir,comment:s.fileCommentStr.length?s.fileCommentStr:null,unixPermissions:s.unixPermissions,dosPermissions:s.dosPermissions,createFolders:t.createFolders}),s.dir||(r.file(c).unsafeOriginalName=u)}return i.zipComment.length&&(r.comment=i.zipComment),r})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(e,t,r){"use strict";var n=e("../utils"),i=e("../stream/GenericWorker");function o(e,t){i.call(this,"Nodejs stream input adapter for "+e),this._upstreamEnded=!1,this._bindStream(t)}n.inherits(o,i),o.prototype._bindStream=function(e){var t=this;(this._stream=e).pause(),e.on("data",function(e){t.push({data:e,meta:{percent:0}})}).on("error",function(e){t.isPaused?this.generatedError=e:t.error(e)}).on("end",function(){t.isPaused?t._upstreamEnded=!0:t.end()})},o.prototype.pause=function(){return!!i.prototype.pause.call(this)&&(this._stream.pause(),!0)},o.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},t.exports=o},{"../stream/GenericWorker":28,"../utils":32}],13:[function(e,t,r){"use strict";var n=e("readable-stream").Readable;function i(e,t,r){n.call(this,t),this._helper=e;var i=this;e.on("data",function(e,t){i.push(e)||i._helper.pause(),r&&r(t)}).on("error",function(e){i.emit("error",e)}).on("end",function(){i.push(null)})}e("../utils").inherits(i,n),i.prototype._read=function(){this._helper.resume()},t.exports=i},{"../utils":32,"readable-stream":16}],14:[function(e,r,n){"use strict";r.exports={isNode:void 0!==t,newBufferFrom:function(e,r){if(t.from&&t.from!==Uint8Array.from)return t.from(e,r);if("number"==typeof e)throw new Error('The "data" argument must not be a number');return new t(e,r)},allocBuffer:function(e){if(t.alloc)return t.alloc(e);var r=new t(e);return r.fill(0),r},isBuffer:function(e){return t.isBuffer(e)},isStream:function(e){return e&&"function"==typeof e.on&&"function"==typeof e.pause&&"function"==typeof e.resume}}},{}],15:[function(e,t,r){"use strict";function n(e,t,r){var n,i=o.getTypeOf(t),s=o.extend(r||{},u);s.date=s.date||new Date,null!==s.compression&&(s.compression=s.compression.toUpperCase()),"string"==typeof s.unixPermissions&&(s.unixPermissions=parseInt(s.unixPermissions,8)),s.unixPermissions&&16384&s.unixPermissions&&(s.dir=!0),s.dosPermissions&&16&s.dosPermissions&&(s.dir=!0),s.dir&&(e=y(e)),s.createFolders&&(n=d(e))&&g.call(this,n,!0);var l="string"===i&&!1===s.binary&&!1===s.base64;r&&void 0!==r.binary||(s.binary=!l),(t instanceof c&&0===t.uncompressedSize||s.dir||!t||0===t.length)&&(s.base64=!1,s.binary=!0,t="",s.compression="STORE",i="string");var v=null;v=t instanceof c||t instanceof a?t:p.isNode&&p.isStream(t)?new h(e,t):o.prepareContent(e,t,s.binary,s.optimizedBinaryString,s.base64);var m=new f(e,v,s);this.files[e]=m}var i=e("./utf8"),o=e("./utils"),a=e("./stream/GenericWorker"),s=e("./stream/StreamHelper"),u=e("./defaults"),c=e("./compressedObject"),f=e("./zipObject"),l=e("./generate"),p=e("./nodejsUtils"),h=e("./nodejs/NodejsStreamInputAdapter"),d=function(e){"/"===e.slice(-1)&&(e=e.substring(0,e.length-1));var t=e.lastIndexOf("/");return 0<t?e.substring(0,t):""},y=function(e){return"/"!==e.slice(-1)&&(e+="/"),e},g=function(e,t){return t=void 0!==t?t:u.createFolders,e=y(e),this.files[e]||n.call(this,e,null,{dir:!0,createFolders:t}),this.files[e]};function v(e){return"[object RegExp]"===Object.prototype.toString.call(e)}var m={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(e){var t,r,n;for(t in this.files)n=this.files[t],(r=t.slice(this.root.length,t.length))&&t.slice(0,this.root.length)===this.root&&e(r,n)},filter:function(e){var t=[];return this.forEach(function(r,n){e(r,n)&&t.push(n)}),t},file:function(e,t,r){if(1!==arguments.length)return e=this.root+e,n.call(this,e,t,r),this;if(v(e)){var i=e;return this.filter(function(e,t){return!t.dir&&i.test(e)})}var o=this.files[this.root+e];return o&&!o.dir?o:null},folder:function(e){if(!e)return this;if(v(e))return this.filter(function(t,r){return r.dir&&e.test(t)});var t=this.root+e,r=g.call(this,t),n=this.clone();return n.root=r.name,n},remove:function(e){e=this.root+e;var t=this.files[e];if(t||("/"!==e.slice(-1)&&(e+="/"),t=this.files[e]),t&&!t.dir)delete this.files[e];else for(var r=this.filter(function(t,r){return r.name.slice(0,e.length)===e}),n=0;n<r.length;n++)delete this.files[r[n].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(e){var t,r={};try{if((r=o.extend(e||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:i.utf8encode})).type=r.type.toLowerCase(),r.compression=r.compression.toUpperCase(),"binarystring"===r.type&&(r.type="string"),!r.type)throw new Error("No output type specified.");o.checkSupport(r.type),"darwin"!==r.platform&&"freebsd"!==r.platform&&"linux"!==r.platform&&"sunos"!==r.platform||(r.platform="UNIX"),"win32"===r.platform&&(r.platform="DOS");var n=r.comment||this.comment||"";t=l.generateWorker(this,r,n)}catch(e){(t=new a("error")).error(e)}return new s(t,r.type||"string",r.mimeType)},generateAsync:function(e,t){return this.generateInternalStream(e).accumulate(t)},generateNodeStream:function(e,t){return(e=e||{}).type||(e.type="nodebuffer"),this.generateInternalStream(e).toNodejsStream(t)}};t.exports=m},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(e,t,r){"use strict";t.exports=e("stream")},{stream:void 0}],17:[function(e,t,r){"use strict";var n=e("./DataReader");function i(e){n.call(this,e);for(var t=0;t<this.data.length;t++)e[t]=255&e[t]}e("../utils").inherits(i,n),i.prototype.byteAt=function(e){return this.data[this.zero+e]},i.prototype.lastIndexOfSignature=function(e){for(var t=e.charCodeAt(0),r=e.charCodeAt(1),n=e.charCodeAt(2),i=e.charCodeAt(3),o=this.length-4;0<=o;--o)if(this.data[o]===t&&this.data[o+1]===r&&this.data[o+2]===n&&this.data[o+3]===i)return o-this.zero;return-1},i.prototype.readAndCheckSignature=function(e){var t=e.charCodeAt(0),r=e.charCodeAt(1),n=e.charCodeAt(2),i=e.charCodeAt(3),o=this.readData(4);return t===o[0]&&r===o[1]&&n===o[2]&&i===o[3]},i.prototype.readData=function(e){if(this.checkOffset(e),0===e)return[];var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./DataReader":18}],18:[function(e,t,r){"use strict";var n=e("../utils");function i(e){this.data=e,this.length=e.length,this.index=0,this.zero=0}i.prototype={checkOffset:function(e){this.checkIndex(this.index+e)},checkIndex:function(e){if(this.length<this.zero+e||e<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+e+"). Corrupted zip ?")},setIndex:function(e){this.checkIndex(e),this.index=e},skip:function(e){this.setIndex(this.index+e)},byteAt:function(){},readInt:function(e){var t,r=0;for(this.checkOffset(e),t=this.index+e-1;t>=this.index;t--)r=(r<<8)+this.byteAt(t);return this.index+=e,r},readString:function(e){return n.transformTo("string",this.readData(e))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var e=this.readInt(4);return new Date(Date.UTC(1980+(e>>25&127),(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(31&e)<<1))}},t.exports=i},{"../utils":32}],19:[function(e,t,r){"use strict";var n=e("./Uint8ArrayReader");function i(e){n.call(this,e)}e("../utils").inherits(i,n),i.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(e,t,r){"use strict";var n=e("./DataReader");function i(e){n.call(this,e)}e("../utils").inherits(i,n),i.prototype.byteAt=function(e){return this.data.charCodeAt(this.zero+e)},i.prototype.lastIndexOfSignature=function(e){return this.data.lastIndexOf(e)-this.zero},i.prototype.readAndCheckSignature=function(e){return e===this.readData(4)},i.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./DataReader":18}],21:[function(e,t,r){"use strict";var n=e("./ArrayReader");function i(e){n.call(this,e)}e("../utils").inherits(i,n),i.prototype.readData=function(e){if(this.checkOffset(e),0===e)return new Uint8Array(0);var t=this.data.subarray(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./ArrayReader":17}],22:[function(e,t,r){"use strict";var n=e("../utils"),i=e("../support"),o=e("./ArrayReader"),a=e("./StringReader"),s=e("./NodeBufferReader"),u=e("./Uint8ArrayReader");t.exports=function(e){var t=n.getTypeOf(e);return n.checkSupport(t),"string"!==t||i.uint8array?"nodebuffer"===t?new s(e):i.uint8array?new u(n.transformTo("uint8array",e)):new o(n.transformTo("array",e)):new a(e)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(e,t,r){"use strict";r.LOCAL_FILE_HEADER="PK",r.CENTRAL_FILE_HEADER="PK",r.CENTRAL_DIRECTORY_END="PK",r.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK",r.ZIP64_CENTRAL_DIRECTORY_END="PK",r.DATA_DESCRIPTOR="PK\b"},{}],24:[function(e,t,r){"use strict";var n=e("./GenericWorker"),i=e("../utils");function o(e){n.call(this,"ConvertWorker to "+e),this.destType=e}i.inherits(o,n),o.prototype.processChunk=function(e){this.push({data:i.transformTo(this.destType,e.data),meta:e.meta})},t.exports=o},{"../utils":32,"./GenericWorker":28}],25:[function(e,t,r){"use strict";var n=e("./GenericWorker"),i=e("../crc32");function o(){n.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}e("../utils").inherits(o,n),o.prototype.processChunk=function(e){this.streamInfo.crc32=i(e.data,this.streamInfo.crc32||0),this.push(e)},t.exports=o},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(e,t,r){"use strict";var n=e("../utils"),i=e("./GenericWorker");function o(e){i.call(this,"DataLengthProbe for "+e),this.propName=e,this.withStreamInfo(e,0)}n.inherits(o,i),o.prototype.processChunk=function(e){if(e){var t=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=t+e.data.length}i.prototype.processChunk.call(this,e)},t.exports=o},{"../utils":32,"./GenericWorker":28}],27:[function(e,t,r){"use strict";var n=e("../utils"),i=e("./GenericWorker");function o(e){i.call(this,"DataWorker");var t=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,e.then(function(e){t.dataIsReady=!0,t.data=e,t.max=e&&e.length||0,t.type=n.getTypeOf(e),t.isPaused||t._tickAndRepeat()},function(e){t.error(e)})}n.inherits(o,i),o.prototype.cleanUp=function(){i.prototype.cleanUp.call(this),this.data=null},o.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,n.delay(this._tickAndRepeat,[],this)),!0)},o.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(n.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},o.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var e=null,t=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":e=this.data.substring(this.index,t);break;case"uint8array":e=this.data.subarray(this.index,t);break;case"array":case"nodebuffer":e=this.data.slice(this.index,t)}return this.index=t,this.push({data:e,meta:{percent:this.max?this.index/this.max*100:0}})},t.exports=o},{"../utils":32,"./GenericWorker":28}],28:[function(e,t,r){"use strict";function n(e){this.name=e||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}n.prototype={push:function(e){this.emit("data",e)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(e){this.emit("error",e)}return!0},error:function(e){return!this.isFinished&&(this.isPaused?this.generatedError=e:(this.isFinished=!0,this.emit("error",e),this.previous&&this.previous.error(e),this.cleanUp()),!0)},on:function(e,t){return this._listeners[e].push(t),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(e,t){if(this._listeners[e])for(var r=0;r<this._listeners[e].length;r++)this._listeners[e][r].call(this,t)},pipe:function(e){return e.registerPrevious(this)},registerPrevious:function(e){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=e.streamInfo,this.mergeStreamInfo(),this.previous=e;var t=this;return e.on("data",function(e){t.processChunk(e)}),e.on("end",function(){t.end()}),e.on("error",function(e){t.error(e)}),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var e=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),e=!0),this.previous&&this.previous.resume(),!e},flush:function(){},processChunk:function(e){this.push(e)},withStreamInfo:function(e,t){return this.extraStreamInfo[e]=t,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var e in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,e)&&(this.streamInfo[e]=this.extraStreamInfo[e])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var e="Worker "+this.name;return this.previous?this.previous+" -> "+e:e}},t.exports=n},{}],29:[function(e,r,n){"use strict";var i=e("../utils"),o=e("./ConvertWorker"),a=e("./GenericWorker"),s=e("../base64"),u=e("../support"),c=e("../external"),f=null;if(u.nodestream)try{f=e("../nodejs/NodejsStreamOutputAdapter")}catch(e){}function l(e,r){return new c.Promise(function(n,o){var a=[],u=e._internalType,c=e._outputType,f=e._mimeType;e.on("data",function(e,t){a.push(e),r&&r(t)}).on("error",function(e){a=[],o(e)}).on("end",function(){try{var e=function(e,t,r){switch(e){case"blob":return i.newBlob(i.transformTo("arraybuffer",t),r);case"base64":return s.encode(t);default:return i.transformTo(e,t)}}(c,function(e,r){var n,i=0,o=null,a=0;for(n=0;n<r.length;n++)a+=r[n].length;switch(e){case"string":return r.join("");case"array":return Array.prototype.concat.apply([],r);case"uint8array":for(o=new Uint8Array(a),n=0;n<r.length;n++)o.set(r[n],i),i+=r[n].length;return o;case"nodebuffer":return t.concat(r);default:throw new Error("concat : unsupported type '"+e+"'")}}(u,a),f);n(e)}catch(e){o(e)}a=[]}).resume()})}function p(e,t,r){var n=t;switch(t){case"blob":case"arraybuffer":n="uint8array";break;case"base64":n="string"}try{this._internalType=n,this._outputType=t,this._mimeType=r,i.checkSupport(n),this._worker=e.pipe(new o(n)),e.lock()}catch(e){this._worker=new a("error"),this._worker.error(e)}}p.prototype={accumulate:function(e){return l(this,e)},on:function(e,t){var r=this;return"data"===e?this._worker.on(e,function(e){t.call(r,e.data,e.meta)}):this._worker.on(e,function(){i.delay(t,arguments,r)}),this},resume:function(){return i.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(e){if(i.checkSupport("nodestream"),"nodebuffer"!==this._outputType)throw new Error(this._outputType+" is not supported by this method");return new f(this,{objectMode:"nodebuffer"!==this._outputType},e)}},r.exports=p},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(e,r,n){"use strict";if(n.base64=!0,n.array=!0,n.string=!0,n.arraybuffer="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array,n.nodebuffer=void 0!==t,n.uint8array="undefined"!=typeof Uint8Array,"undefined"==typeof ArrayBuffer)n.blob=!1;else{var i=new ArrayBuffer(0);try{n.blob=0===new Blob([i],{type:"application/zip"}).size}catch(e){try{var o=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);o.append(i),n.blob=0===o.getBlob("application/zip").size}catch(e){n.blob=!1}}}try{n.nodestream=!!e("readable-stream").Readable}catch(e){n.nodestream=!1}},{"readable-stream":16}],31:[function(e,t,r){"use strict";for(var n=e("./utils"),i=e("./support"),o=e("./nodejsUtils"),a=e("./stream/GenericWorker"),s=new Array(256),u=0;u<256;u++)s[u]=252<=u?6:248<=u?5:240<=u?4:224<=u?3:192<=u?2:1;function c(){a.call(this,"utf-8 decode"),this.leftOver=null}function f(){a.call(this,"utf-8 encode")}s[254]=s[254]=1,r.utf8encode=function(e){return i.nodebuffer?o.newBufferFrom(e,"utf-8"):function(e){var t,r,n,o,a,s=e.length,u=0;for(o=0;o<s;o++)55296==(64512&(r=e.charCodeAt(o)))&&o+1<s&&56320==(64512&(n=e.charCodeAt(o+1)))&&(r=65536+(r-55296<<10)+(n-56320),o++),u+=r<128?1:r<2048?2:r<65536?3:4;for(t=i.uint8array?new Uint8Array(u):new Array(u),o=a=0;a<u;o++)55296==(64512&(r=e.charCodeAt(o)))&&o+1<s&&56320==(64512&(n=e.charCodeAt(o+1)))&&(r=65536+(r-55296<<10)+(n-56320),o++),r<128?t[a++]=r:(r<2048?t[a++]=192|r>>>6:(r<65536?t[a++]=224|r>>>12:(t[a++]=240|r>>>18,t[a++]=128|r>>>12&63),t[a++]=128|r>>>6&63),t[a++]=128|63&r);return t}(e)},r.utf8decode=function(e){return i.nodebuffer?n.transformTo("nodebuffer",e).toString("utf-8"):function(e){var t,r,i,o,a=e.length,u=new Array(2*a);for(t=r=0;t<a;)if((i=e[t++])<128)u[r++]=i;else if(4<(o=s[i]))u[r++]=65533,t+=o-1;else{for(i&=2===o?31:3===o?15:7;1<o&&t<a;)i=i<<6|63&e[t++],o--;1<o?u[r++]=65533:i<65536?u[r++]=i:(i-=65536,u[r++]=55296|i>>10&1023,u[r++]=56320|1023&i)}return u.length!==r&&(u.subarray?u=u.subarray(0,r):u.length=r),n.applyFromCharCode(u)}(e=n.transformTo(i.uint8array?"uint8array":"array",e))},n.inherits(c,a),c.prototype.processChunk=function(e){var t=n.transformTo(i.uint8array?"uint8array":"array",e.data);if(this.leftOver&&this.leftOver.length){if(i.uint8array){var o=t;(t=new Uint8Array(o.length+this.leftOver.length)).set(this.leftOver,0),t.set(o,this.leftOver.length)}else t=this.leftOver.concat(t);this.leftOver=null}var a=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;0<=r&&128==(192&e[r]);)r--;return r<0||0===r?t:r+s[e[r]]>t?r:t}(t),u=t;a!==t.length&&(i.uint8array?(u=t.subarray(0,a),this.leftOver=t.subarray(a,t.length)):(u=t.slice(0,a),this.leftOver=t.slice(a,t.length))),this.push({data:r.utf8decode(u),meta:e.meta})},c.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:r.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},r.Utf8DecodeWorker=c,n.inherits(f,a),f.prototype.processChunk=function(e){this.push({data:r.utf8encode(e.data),meta:e.meta})},r.Utf8EncodeWorker=f},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(e,t,n){"use strict";var i=e("./support"),o=e("./base64"),a=e("./nodejsUtils"),s=e("./external");function u(e){return e}function c(e,t){for(var r=0;r<e.length;++r)t[r]=255&e.charCodeAt(r);return t}e("setimmediate"),n.newBlob=function(e,t){n.checkSupport("blob");try{return new Blob([e],{type:t})}catch(n){try{var r=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return r.append(e),r.getBlob(t)}catch(e){throw new Error("Bug : can't construct the Blob.")}}};var f={stringifyByChunk:function(e,t,r){var n=[],i=0,o=e.length;if(o<=r)return String.fromCharCode.apply(null,e);for(;i<o;)"array"===t||"nodebuffer"===t?n.push(String.fromCharCode.apply(null,e.slice(i,Math.min(i+r,o)))):n.push(String.fromCharCode.apply(null,e.subarray(i,Math.min(i+r,o)))),i+=r;return n.join("")},stringifyByChar:function(e){for(var t="",r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t},applyCanBeUsed:{uint8array:function(){try{return i.uint8array&&1===String.fromCharCode.apply(null,new Uint8Array(1)).length}catch(e){return!1}}(),nodebuffer:function(){try{return i.nodebuffer&&1===String.fromCharCode.apply(null,a.allocBuffer(1)).length}catch(e){return!1}}()}};function l(e){var t=65536,r=n.getTypeOf(e),i=!0;if("uint8array"===r?i=f.applyCanBeUsed.uint8array:"nodebuffer"===r&&(i=f.applyCanBeUsed.nodebuffer),i)for(;1<t;)try{return f.stringifyByChunk(e,r,t)}catch(e){t=Math.floor(t/2)}return f.stringifyByChar(e)}function p(e,t){for(var r=0;r<e.length;r++)t[r]=e[r];return t}n.applyFromCharCode=l;var h={};h.string={string:u,array:function(e){return c(e,new Array(e.length))},arraybuffer:function(e){return h.string.uint8array(e).buffer},uint8array:function(e){return c(e,new Uint8Array(e.length))},nodebuffer:function(e){return c(e,a.allocBuffer(e.length))}},h.array={string:l,array:u,arraybuffer:function(e){return new Uint8Array(e).buffer},uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return a.newBufferFrom(e)}},h.arraybuffer={string:function(e){return l(new Uint8Array(e))},array:function(e){return p(new Uint8Array(e),new Array(e.byteLength))},arraybuffer:u,uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return a.newBufferFrom(new Uint8Array(e))}},h.uint8array={string:l,array:function(e){return p(e,new Array(e.length))},arraybuffer:function(e){return e.buffer},uint8array:u,nodebuffer:function(e){return a.newBufferFrom(e)}},h.nodebuffer={string:l,array:function(e){return p(e,new Array(e.length))},arraybuffer:function(e){return h.nodebuffer.uint8array(e).buffer},uint8array:function(e){return p(e,new Uint8Array(e.length))},nodebuffer:u},n.transformTo=function(e,t){if(t=t||"",!e)return t;n.checkSupport(e);var r=n.getTypeOf(t);return h[r][e](t)},n.resolve=function(e){for(var t=e.split("/"),r=[],n=0;n<t.length;n++){var i=t[n];"."===i||""===i&&0!==n&&n!==t.length-1||(".."===i?r.pop():r.push(i))}return r.join("/")},n.getTypeOf=function(e){return"string"==typeof e?"string":"[object Array]"===Object.prototype.toString.call(e)?"array":i.nodebuffer&&a.isBuffer(e)?"nodebuffer":i.uint8array&&e instanceof Uint8Array?"uint8array":i.arraybuffer&&e instanceof ArrayBuffer?"arraybuffer":void 0},n.checkSupport=function(e){if(!i[e.toLowerCase()])throw new Error(e+" is not supported by this platform")},n.MAX_VALUE_16BITS=65535,n.MAX_VALUE_32BITS=-1,n.pretty=function(e){var t,r,n="";for(r=0;r<(e||"").length;r++)n+="\\x"+((t=e.charCodeAt(r))<16?"0":"")+t.toString(16).toUpperCase();return n},n.delay=function(e,t,n){r(function(){e.apply(n||null,t||[])})},n.inherits=function(e,t){function r(){}r.prototype=t.prototype,e.prototype=new r},n.extend=function(){var e,t,r={};for(e=0;e<arguments.length;e++)for(t in arguments[e])Object.prototype.hasOwnProperty.call(arguments[e],t)&&void 0===r[t]&&(r[t]=arguments[e][t]);return r},n.prepareContent=function(e,t,r,a,u){return s.Promise.resolve(t).then(function(e){return i.blob&&(e instanceof Blob||-1!==["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(e)))&&"undefined"!=typeof FileReader?new s.Promise(function(t,r){var n=new FileReader;n.onload=function(e){t(e.target.result)},n.onerror=function(e){r(e.target.error)},n.readAsArrayBuffer(e)}):e}).then(function(t){var f=n.getTypeOf(t);return f?("arraybuffer"===f?t=n.transformTo("uint8array",t):"string"===f&&(u?t=o.decode(t):r&&!0!==a&&(t=function(e){return c(e,i.uint8array?new Uint8Array(e.length):new Array(e.length))}(t))),t):s.Promise.reject(new Error("Can't read the data of '"+e+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(e,t,r){"use strict";var n=e("./reader/readerFor"),i=e("./utils"),o=e("./signature"),a=e("./zipEntry"),s=e("./support");function u(e){this.files=[],this.loadOptions=e}u.prototype={checkSignature:function(e){if(!this.reader.readAndCheckSignature(e)){this.reader.index-=4;var t=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+i.pretty(t)+", expected "+i.pretty(e)+")")}},isSignature:function(e,t){var r=this.reader.index;this.reader.setIndex(e);var n=this.reader.readString(4)===t;return this.reader.setIndex(r),n},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var e=this.reader.readData(this.zipCommentLength),t=s.uint8array?"uint8array":"array",r=i.transformTo(t,e);this.zipComment=this.loadOptions.decodeFileName(r)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var e,t,r,n=this.zip64EndOfCentralSize-44;0<n;)e=this.reader.readInt(2),t=this.reader.readInt(4),r=this.reader.readData(t),this.zip64ExtensibleData[e]={id:e,length:t,value:r}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var e,t;for(e=0;e<this.files.length;e++)t=this.files[e],this.reader.setIndex(t.localHeaderOffset),this.checkSignature(o.LOCAL_FILE_HEADER),t.readLocalPart(this.reader),t.handleUTF8(),t.processAttributes()},readCentralDir:function(){var e;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(o.CENTRAL_FILE_HEADER);)(e=new a({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(e);if(this.centralDirRecords!==this.files.length&&0!==this.centralDirRecords&&0===this.files.length)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var e=this.reader.lastIndexOfSignature(o.CENTRAL_DIRECTORY_END);if(e<0)throw this.isSignature(0,o.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(e);var t=e;if(this.checkSignature(o.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===i.MAX_VALUE_16BITS||this.diskWithCentralDirStart===i.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===i.MAX_VALUE_16BITS||this.centralDirRecords===i.MAX_VALUE_16BITS||this.centralDirSize===i.MAX_VALUE_32BITS||this.centralDirOffset===i.MAX_VALUE_32BITS){if(this.zip64=!0,(e=this.reader.lastIndexOfSignature(o.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(e),this.checkSignature(o.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,o.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(o.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(o.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var r=this.centralDirOffset+this.centralDirSize;this.zip64&&(r+=20,r+=12+this.zip64EndOfCentralSize);var n=t-r;if(0<n)this.isSignature(t,o.CENTRAL_FILE_HEADER)||(this.reader.zero=n);else if(n<0)throw new Error("Corrupted zip: missing "+Math.abs(n)+" bytes.")},prepareReader:function(e){this.reader=n(e)},load:function(e){this.prepareReader(e),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},t.exports=u},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(e,t,r){"use strict";var n=e("./reader/readerFor"),i=e("./utils"),o=e("./compressedObject"),a=e("./crc32"),s=e("./utf8"),u=e("./compressions"),c=e("./support");function f(e,t){this.options=e,this.loadOptions=t}f.prototype={isEncrypted:function(){return!(1&~this.bitFlag)},useUTF8:function(){return!(2048&~this.bitFlag)},readLocalPart:function(e){var t,r;if(e.skip(22),this.fileNameLength=e.readInt(2),r=e.readInt(2),this.fileName=e.readData(this.fileNameLength),e.skip(r),-1===this.compressedSize||-1===this.uncompressedSize)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(null===(t=function(e){for(var t in u)if(Object.prototype.hasOwnProperty.call(u,t)&&u[t].magic===e)return u[t];return null}(this.compressionMethod)))throw new Error("Corrupted zip : compression "+i.pretty(this.compressionMethod)+" unknown (inner file : "+i.transformTo("string",this.fileName)+")");this.decompressed=new o(this.compressedSize,this.uncompressedSize,this.crc32,t,e.readData(this.compressedSize))},readCentralPart:function(e){this.versionMadeBy=e.readInt(2),e.skip(2),this.bitFlag=e.readInt(2),this.compressionMethod=e.readString(2),this.date=e.readDate(),this.crc32=e.readInt(4),this.compressedSize=e.readInt(4),this.uncompressedSize=e.readInt(4);var t=e.readInt(2);if(this.extraFieldsLength=e.readInt(2),this.fileCommentLength=e.readInt(2),this.diskNumberStart=e.readInt(2),this.internalFileAttributes=e.readInt(2),this.externalFileAttributes=e.readInt(4),this.localHeaderOffset=e.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");e.skip(t),this.readExtraFields(e),this.parseZIP64ExtraField(e),this.fileComment=e.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var e=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),0==e&&(this.dosPermissions=63&this.externalFileAttributes),3==e&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var e=n(this.extraFields[1].value);this.uncompressedSize===i.MAX_VALUE_32BITS&&(this.uncompressedSize=e.readInt(8)),this.compressedSize===i.MAX_VALUE_32BITS&&(this.compressedSize=e.readInt(8)),this.localHeaderOffset===i.MAX_VALUE_32BITS&&(this.localHeaderOffset=e.readInt(8)),this.diskNumberStart===i.MAX_VALUE_32BITS&&(this.diskNumberStart=e.readInt(4))}},readExtraFields:function(e){var t,r,n,i=e.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});e.index+4<i;)t=e.readInt(2),r=e.readInt(2),n=e.readData(r),this.extraFields[t]={id:t,length:r,value:n};e.setIndex(i)},handleUTF8:function(){var e=c.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=s.utf8decode(this.fileName),this.fileCommentStr=s.utf8decode(this.fileComment);else{var t=this.findExtraFieldUnicodePath();if(null!==t)this.fileNameStr=t;else{var r=i.transformTo(e,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(r)}var n=this.findExtraFieldUnicodeComment();if(null!==n)this.fileCommentStr=n;else{var o=i.transformTo(e,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(o)}}},findExtraFieldUnicodePath:function(){var e=this.extraFields[28789];if(e){var t=n(e.value);return 1!==t.readInt(1)||a(this.fileName)!==t.readInt(4)?null:s.utf8decode(t.readData(e.length-5))}return null},findExtraFieldUnicodeComment:function(){var e=this.extraFields[25461];if(e){var t=n(e.value);return 1!==t.readInt(1)||a(this.fileComment)!==t.readInt(4)?null:s.utf8decode(t.readData(e.length-5))}return null}},t.exports=f},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(e,t,r){"use strict";function n(e,t,r){this.name=e,this.dir=r.dir,this.date=r.date,this.comment=r.comment,this.unixPermissions=r.unixPermissions,this.dosPermissions=r.dosPermissions,this._data=t,this._dataBinary=r.binary,this.options={compression:r.compression,compressionOptions:r.compressionOptions}}var i=e("./stream/StreamHelper"),o=e("./stream/DataWorker"),a=e("./utf8"),s=e("./compressedObject"),u=e("./stream/GenericWorker");n.prototype={internalStream:function(e){var t=null,r="string";try{if(!e)throw new Error("No output type specified.");var n="string"===(r=e.toLowerCase())||"text"===r;"binarystring"!==r&&"text"!==r||(r="string"),t=this._decompressWorker();var o=!this._dataBinary;o&&!n&&(t=t.pipe(new a.Utf8EncodeWorker)),!o&&n&&(t=t.pipe(new a.Utf8DecodeWorker))}catch(e){(t=new u("error")).error(e)}return new i(t,r,"")},async:function(e,t){return this.internalStream(e).accumulate(t)},nodeStream:function(e,t){return this.internalStream(e||"nodebuffer").toNodejsStream(t)},_compressWorker:function(e,t){if(this._data instanceof s&&this._data.compression.magic===e.magic)return this._data.getCompressedWorker();var r=this._decompressWorker();return this._dataBinary||(r=r.pipe(new a.Utf8EncodeWorker)),s.createWorkerFrom(r,e,t)},_decompressWorker:function(){return this._data instanceof s?this._data.getContentWorker():this._data instanceof u?this._data:new o(this._data)}};for(var c=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],f=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},l=0;l<c.length;l++)n.prototype[c[l]]=f;t.exports=n},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(e,t,r){(function(e){"use strict";var r,n,i=e.MutationObserver||e.WebKitMutationObserver;if(i){var o=0,a=new i(f),s=e.document.createTextNode("");a.observe(s,{characterData:!0}),r=function(){s.data=o=++o%2}}else if(e.setImmediate||void 0===e.MessageChannel)r="document"in e&&"onreadystatechange"in e.document.createElement("script")?function(){var t=e.document.createElement("script");t.onreadystatechange=function(){f(),t.onreadystatechange=null,t.parentNode.removeChild(t),t=null},e.document.documentElement.appendChild(t)}:function(){setTimeout(f,0)};else{var u=new e.MessageChannel;u.port1.onmessage=f,r=function(){u.port2.postMessage(0)}}var c=[];function f(){var e,t;n=!0;for(var r=c.length;r;){for(t=c,c=[],e=-1;++e<r;)t[e]();r=c.length}n=!1}t.exports=function(e){1!==c.push(e)||n||r()}}).call(this,void 0!==n?n:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],37:[function(e,t,r){"use strict";var n=e("immediate");function i(){}var o={},a=["REJECTED"],s=["FULFILLED"],u=["PENDING"];function c(e){if("function"!=typeof e)throw new TypeError("resolver must be a function");this.state=u,this.queue=[],this.outcome=void 0,e!==i&&h(this,e)}function f(e,t,r){this.promise=e,"function"==typeof t&&(this.onFulfilled=t,this.callFulfilled=this.otherCallFulfilled),"function"==typeof r&&(this.onRejected=r,this.callRejected=this.otherCallRejected)}function l(e,t,r){n(function(){var n;try{n=t(r)}catch(n){return o.reject(e,n)}n===e?o.reject(e,new TypeError("Cannot resolve promise with itself")):o.resolve(e,n)})}function p(e){var t=e&&e.then;if(e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof t)return function(){t.apply(e,arguments)}}function h(e,t){var r=!1;function n(t){r||(r=!0,o.reject(e,t))}function i(t){r||(r=!0,o.resolve(e,t))}var a=d(function(){t(i,n)});"error"===a.status&&n(a.value)}function d(e,t){var r={};try{r.value=e(t),r.status="success"}catch(e){r.status="error",r.value=e}return r}(t.exports=c).prototype.finally=function(e){if("function"!=typeof e)return this;var t=this.constructor;return this.then(function(r){return t.resolve(e()).then(function(){return r})},function(r){return t.resolve(e()).then(function(){throw r})})},c.prototype.catch=function(e){return this.then(null,e)},c.prototype.then=function(e,t){if("function"!=typeof e&&this.state===s||"function"!=typeof t&&this.state===a)return this;var r=new this.constructor(i);return this.state!==u?l(r,this.state===s?e:t,this.outcome):this.queue.push(new f(r,e,t)),r},f.prototype.callFulfilled=function(e){o.resolve(this.promise,e)},f.prototype.otherCallFulfilled=function(e){l(this.promise,this.onFulfilled,e)},f.prototype.callRejected=function(e){o.reject(this.promise,e)},f.prototype.otherCallRejected=function(e){l(this.promise,this.onRejected,e)},o.resolve=function(e,t){var r=d(p,t);if("error"===r.status)return o.reject(e,r.value);var n=r.value;if(n)h(e,n);else{e.state=s,e.outcome=t;for(var i=-1,a=e.queue.length;++i<a;)e.queue[i].callFulfilled(t)}return e},o.reject=function(e,t){e.state=a,e.outcome=t;for(var r=-1,n=e.queue.length;++r<n;)e.queue[r].callRejected(t);return e},c.resolve=function(e){return e instanceof this?e:o.resolve(new this(i),e)},c.reject=function(e){var t=new this(i);return o.reject(t,e)},c.all=function(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var r=e.length,n=!1;if(!r)return this.resolve([]);for(var a=new Array(r),s=0,u=-1,c=new this(i);++u<r;)f(e[u],u);return c;function f(e,i){t.resolve(e).then(function(e){a[i]=e,++s!==r||n||(n=!0,o.resolve(c,a))},function(e){n||(n=!0,o.reject(c,e))})}},c.race=function(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var r=e.length,n=!1;if(!r)return this.resolve([]);for(var a=-1,s=new this(i),u;++a<r;)u=e[a],t.resolve(u).then(function(e){n||(n=!0,o.resolve(s,e))},function(e){n||(n=!0,o.reject(s,e))});return s}},{immediate:36}],38:[function(e,t,r){"use strict";var n={};(0,e("./lib/utils/common").assign)(n,e("./lib/deflate"),e("./lib/inflate"),e("./lib/zlib/constants")),t.exports=n},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(e,t,r){"use strict";var n=e("./zlib/deflate"),i=e("./utils/common"),o=e("./utils/strings"),a=e("./zlib/messages"),s=e("./zlib/zstream"),u=Object.prototype.toString,c=0,f=-1,l=0,p=8;function h(e){if(!(this instanceof h))return new h(e);this.options=i.assign({level:f,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,to:""},e||{});var t=this.options;t.raw&&0<t.windowBits?t.windowBits=-t.windowBits:t.gzip&&0<t.windowBits&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new s,this.strm.avail_out=0;var r=n.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(0!==r)throw new Error(a[r]);if(t.header&&n.deflateSetHeader(this.strm,t.header),t.dictionary){var c;if(c="string"==typeof t.dictionary?o.string2buf(t.dictionary):"[object ArrayBuffer]"===u.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,0!==(r=n.deflateSetDictionary(this.strm,c)))throw new Error(a[r]);this._dict_set=!0}}function d(e,t){var r=new h(t);if(r.push(e,!0),r.err)throw r.msg||a[r.err];return r.result}h.prototype.push=function(e,t){var r,a,s=this.strm,c=this.options.chunkSize;if(this.ended)return!1;a=t===~~t?t:!0===t?4:0,"string"==typeof e?s.input=o.string2buf(e):"[object ArrayBuffer]"===u.call(e)?s.input=new Uint8Array(e):s.input=e,s.next_in=0,s.avail_in=s.input.length;do{if(0===s.avail_out&&(s.output=new i.Buf8(c),s.next_out=0,s.avail_out=c),1!==(r=n.deflate(s,a))&&0!==r)return this.onEnd(r),!(this.ended=!0);0!==s.avail_out&&(0!==s.avail_in||4!==a&&2!==a)||("string"===this.options.to?this.onData(o.buf2binstring(i.shrinkBuf(s.output,s.next_out))):this.onData(i.shrinkBuf(s.output,s.next_out)))}while((0<s.avail_in||0===s.avail_out)&&1!==r);return 4===a?(r=n.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,0===r):2!==a||(this.onEnd(0),!(s.avail_out=0))},h.prototype.onData=function(e){this.chunks.push(e)},h.prototype.onEnd=function(e){0===e&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},r.Deflate=h,r.deflate=d,r.deflateRaw=function(e,t){return(t=t||{}).raw=!0,d(e,t)},r.gzip=function(e,t){return(t=t||{}).gzip=!0,d(e,t)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(e,t,r){"use strict";var n=e("./zlib/inflate"),i=e("./utils/common"),o=e("./utils/strings"),a=e("./zlib/constants"),s=e("./zlib/messages"),u=e("./zlib/zstream"),c=e("./zlib/gzheader"),f=Object.prototype.toString;function l(e){if(!(this instanceof l))return new l(e);this.options=i.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&0<=t.windowBits&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(0<=t.windowBits&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),15<t.windowBits&&t.windowBits<48&&!(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new u,this.strm.avail_out=0;var r=n.inflateInit2(this.strm,t.windowBits);if(r!==a.Z_OK)throw new Error(s[r]);this.header=new c,n.inflateGetHeader(this.strm,this.header)}function p(e,t){var r=new l(t);if(r.push(e,!0),r.err)throw r.msg||s[r.err];return r.result}l.prototype.push=function(e,t){var r,s,u,c,l,p,h=this.strm,d=this.options.chunkSize,y=this.options.dictionary,g=!1;if(this.ended)return!1;s=t===~~t?t:!0===t?a.Z_FINISH:a.Z_NO_FLUSH,"string"==typeof e?h.input=o.binstring2buf(e):"[object ArrayBuffer]"===f.call(e)?h.input=new Uint8Array(e):h.input=e,h.next_in=0,h.avail_in=h.input.length;do{if(0===h.avail_out&&(h.output=new i.Buf8(d),h.next_out=0,h.avail_out=d),(r=n.inflate(h,a.Z_NO_FLUSH))===a.Z_NEED_DICT&&y&&(p="string"==typeof y?o.string2buf(y):"[object ArrayBuffer]"===f.call(y)?new Uint8Array(y):y,r=n.inflateSetDictionary(this.strm,p)),r===a.Z_BUF_ERROR&&!0===g&&(r=a.Z_OK,g=!1),r!==a.Z_STREAM_END&&r!==a.Z_OK)return this.onEnd(r),!(this.ended=!0);h.next_out&&(0!==h.avail_out&&r!==a.Z_STREAM_END&&(0!==h.avail_in||s!==a.Z_FINISH&&s!==a.Z_SYNC_FLUSH)||("string"===this.options.to?(u=o.utf8border(h.output,h.next_out),c=h.next_out-u,l=o.buf2string(h.output,u),h.next_out=c,h.avail_out=d-c,c&&i.arraySet(h.output,h.output,u,c,0),this.onData(l)):this.onData(i.shrinkBuf(h.output,h.next_out)))),0===h.avail_in&&0===h.avail_out&&(g=!0)}while((0<h.avail_in||0===h.avail_out)&&r!==a.Z_STREAM_END);return r===a.Z_STREAM_END&&(s=a.Z_FINISH),s===a.Z_FINISH?(r=n.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===a.Z_OK):s!==a.Z_SYNC_FLUSH||(this.onEnd(a.Z_OK),!(h.avail_out=0))},l.prototype.onData=function(e){this.chunks.push(e)},l.prototype.onEnd=function(e){e===a.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},r.Inflate=l,r.inflate=p,r.inflateRaw=function(e,t){return(t=t||{}).raw=!0,p(e,t)},r.ungzip=p},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(e,t,r){"use strict";var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;r.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var r=t.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(var n in r)r.hasOwnProperty(n)&&(e[n]=r[n])}}return e},r.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var i={arraySet:function(e,t,r,n,i){if(t.subarray&&e.subarray)e.set(t.subarray(r,r+n),i);else for(var o=0;o<n;o++)e[i+o]=t[r+o]},flattenChunks:function(e){var t,r,n,i,o,a;for(t=n=0,r=e.length;t<r;t++)n+=e[t].length;for(a=new Uint8Array(n),t=i=0,r=e.length;t<r;t++)o=e[t],a.set(o,i),i+=o.length;return a}},o={arraySet:function(e,t,r,n,i){for(var o=0;o<n;o++)e[i+o]=t[r+o]},flattenChunks:function(e){return[].concat.apply([],e)}};r.setTyped=function(e){e?(r.Buf8=Uint8Array,r.Buf16=Uint16Array,r.Buf32=Int32Array,r.assign(r,i)):(r.Buf8=Array,r.Buf16=Array,r.Buf32=Array,r.assign(r,o))},r.setTyped(n)},{}],42:[function(e,t,r){"use strict";var n=e("./common"),i=!0,o=!0;try{String.fromCharCode.apply(null,[0])}catch(e){i=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){o=!1}for(var a=new n.Buf8(256),s=0;s<256;s++)a[s]=252<=s?6:248<=s?5:240<=s?4:224<=s?3:192<=s?2:1;function u(e,t){if(t<65537&&(e.subarray&&o||!e.subarray&&i))return String.fromCharCode.apply(null,n.shrinkBuf(e,t));for(var r="",a=0;a<t;a++)r+=String.fromCharCode(e[a]);return r}a[254]=a[254]=1,r.string2buf=function(e){var t,r,i,o,a,s=e.length,u=0;for(o=0;o<s;o++)55296==(64512&(r=e.charCodeAt(o)))&&o+1<s&&56320==(64512&(i=e.charCodeAt(o+1)))&&(r=65536+(r-55296<<10)+(i-56320),o++),u+=r<128?1:r<2048?2:r<65536?3:4;for(t=new n.Buf8(u),o=a=0;a<u;o++)55296==(64512&(r=e.charCodeAt(o)))&&o+1<s&&56320==(64512&(i=e.charCodeAt(o+1)))&&(r=65536+(r-55296<<10)+(i-56320),o++),r<128?t[a++]=r:(r<2048?t[a++]=192|r>>>6:(r<65536?t[a++]=224|r>>>12:(t[a++]=240|r>>>18,t[a++]=128|r>>>12&63),t[a++]=128|r>>>6&63),t[a++]=128|63&r);return t},r.buf2binstring=function(e){return u(e,e.length)},r.binstring2buf=function(e){for(var t=new n.Buf8(e.length),r=0,i=t.length;r<i;r++)t[r]=e.charCodeAt(r);return t},r.buf2string=function(e,t){var r,n,i,o,s=t||e.length,c=new Array(2*s);for(r=n=0;r<s;)if((i=e[r++])<128)c[n++]=i;else if(4<(o=a[i]))c[n++]=65533,r+=o-1;else{for(i&=2===o?31:3===o?15:7;1<o&&r<s;)i=i<<6|63&e[r++],o--;1<o?c[n++]=65533:i<65536?c[n++]=i:(i-=65536,c[n++]=55296|i>>10&1023,c[n++]=56320|1023&i)}return u(c,n)},r.utf8border=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;0<=r&&128==(192&e[r]);)r--;return r<0||0===r?t:r+a[e[r]]>t?r:t}},{"./common":41}],43:[function(e,t,r){"use strict";t.exports=function(e,t,r,n){for(var i=65535&e,o=e>>>16&65535,a=0;0!==r;){for(r-=a=2e3<r?2e3:r;o=o+(i=i+t[n++]|0)|0,--a;);i%=65521,o%=65521}return i|o<<16}},{}],44:[function(e,t,r){"use strict";t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(e,t,r){"use strict";var n=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();t.exports=function(e,t,r,i){var o=n,a=i+r;e^=-1;for(var s=i;s<a;s++)e=e>>>8^o[255&(e^t[s])];return-1^e}},{}],46:[function(e,t,r){"use strict";var n,i=e("../utils/common"),o=e("./trees"),a=e("./adler32"),s=e("./crc32"),u=e("./messages"),c=0,f=4,l=0,p=-2,h=-1,d=4,y=2,g=8,v=9,m=286,b=30,E=19,T=573,S=15,w=3,C=258,_=262,I=42,A=113,R=1,O=2,P=3,B=4;function k(e,t){return e.msg=u[t],t}function N(e){return(e<<1)-(4<e?9:0)}function U(e){for(var t=e.length;0<=--t;)e[t]=0}function D(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(i.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function x(e,t){o._tr_flush_block(e,0<=e.block_start?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,D(e.strm)}function L(e,t){e.pending_buf[e.pending++]=t}function j(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function M(e,t){var r,n,i=e.max_chain_length,o=e.strstart,a=e.prev_length,s=e.nice_match,u=e.strstart>e.w_size-_?e.strstart-(e.w_size-_):0,c=e.window,f=e.w_mask,l=e.prev,p=e.strstart+C,h=c[o+a-1],d=c[o+a];e.prev_length>=e.good_match&&(i>>=2),s>e.lookahead&&(s=e.lookahead);do{if(c[(r=t)+a]===d&&c[r+a-1]===h&&c[r]===c[o]&&c[++r]===c[o+1]){o+=2,r++;do{}while(c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&o<p);if(n=C-(p-o),o=p-C,a<n){if(e.match_start=t,s<=(a=n))break;h=c[o+a-1],d=c[o+a]}}}while((t=l[t&f])>u&&0!=--i);return a<=e.lookahead?a:e.lookahead}function V(e){var t,r,n,o,u,c,f,l,p,h,d=e.w_size;do{if(o=e.window_size-e.lookahead-e.strstart,e.strstart>=d+(d-_)){for(i.arraySet(e.window,e.window,d,d,0),e.match_start-=d,e.strstart-=d,e.block_start-=d,t=r=e.hash_size;n=e.head[--t],e.head[t]=d<=n?n-d:0,--r;);for(t=r=d;n=e.prev[--t],e.prev[t]=d<=n?n-d:0,--r;);o+=d}if(0===e.strm.avail_in)break;if(c=e.strm,f=e.window,l=e.strstart+e.lookahead,h=void 0,(p=o)<(h=c.avail_in)&&(h=p),r=0===h?0:(c.avail_in-=h,i.arraySet(f,c.input,c.next_in,h,l),1===c.state.wrap?c.adler=a(c.adler,f,h,l):2===c.state.wrap&&(c.adler=s(c.adler,f,h,l)),c.next_in+=h,c.total_in+=h,h),e.lookahead+=r,e.lookahead+e.insert>=3)for(u=e.strstart-e.insert,e.ins_h=e.window[u],e.ins_h=(e.ins_h<<e.hash_shift^e.window[u+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[u+3-1])&e.hash_mask,e.prev[u&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=u,u++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead<_&&0!==e.strm.avail_in)}function F(e,t){for(var r,n;;){if(e.lookahead<_){if(V(e),e.lookahead<_&&0===t)return 1;if(0===e.lookahead)break}if(r=0,e.lookahead>=3&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==r&&e.strstart-r<=e.w_size-_&&(e.match_length=M(e,r)),e.match_length>=3)if(n=o._tr_tally(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){for(e.match_length--;e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart,0!=--e.match_length;);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else n=o._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(x(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,4===t?(x(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(x(e,!1),0===e.strm.avail_out)?1:2}function K(e,t){for(var r,n,i;;){if(e.lookahead<_){if(V(e),e.lookahead<_&&0===t)return 1;if(0===e.lookahead)break}if(r=0,e.lookahead>=3&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,0!==r&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-_&&(e.match_length=M(e,r),e.match_length<=5&&(1===e.strategy||3===e.match_length&&4096<e.strstart-e.match_start)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){for(i=e.strstart+e.lookahead-3,n=o._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;++e.strstart<=i&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!=--e.prev_length;);if(e.match_available=0,e.match_length=2,e.strstart++,n&&(x(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if((n=o._tr_tally(e,0,e.window[e.strstart-1]))&&x(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(n=o._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,4===t?(x(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(x(e,!1),0===e.strm.avail_out)?1:2}function H(e,t,r,n,i){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=n,this.func=i}function q(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new i.Buf16(2*T),this.dyn_dtree=new i.Buf16(122),this.bl_tree=new i.Buf16(78),U(this.dyn_ltree),U(this.dyn_dtree),U(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new i.Buf16(16),this.heap=new i.Buf16(573),U(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new i.Buf16(573),U(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function G(e){var t;return e&&e.state?(e.total_in=e.total_out=0,e.data_type=2,(t=e.state).pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?I:A,e.adler=2===t.wrap?0:1,t.last_flush=0,o._tr_init(t),0):k(e,p)}function z(e){var t=G(e);return 0===t&&function(e){e.window_size=2*e.w_size,U(e.head),e.max_lazy_match=n[e.level].max_lazy,e.good_match=n[e.level].good_length,e.nice_match=n[e.level].nice_length,e.max_chain_length=n[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0}(e.state),t}function Y(e,t,r,n,o,a){if(!e)return p;var s=1;if(t===h&&(t=6),n<0?(s=0,n=-n):15<n&&(s=2,n-=16),o<1||9<o||8!==r||n<8||15<n||t<0||9<t||a<0||4<a)return k(e,p);8===n&&(n=9);var u=new q;return(e.state=u).strm=e,u.wrap=s,u.gzhead=null,u.w_bits=n,u.w_size=1<<u.w_bits,u.w_mask=u.w_size-1,u.hash_bits=o+7,u.hash_size=1<<u.hash_bits,u.hash_mask=u.hash_size-1,u.hash_shift=~~((u.hash_bits+3-1)/3),u.window=new i.Buf8(2*u.w_size),u.head=new i.Buf16(u.hash_size),u.prev=new i.Buf16(u.w_size),u.lit_bufsize=1<<o+6,u.pending_buf_size=4*u.lit_bufsize,u.pending_buf=new i.Buf8(u.pending_buf_size),u.d_buf=1*u.lit_bufsize,u.l_buf=3*u.lit_bufsize,u.level=t,u.strategy=a,u.method=r,z(e)}n=[new H(0,0,0,0,function(e,t){var r=65535;for(r>e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(V(e),0===e.lookahead&&0===t)return 1;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+r;if((0===e.strstart||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,x(e,!1),0===e.strm.avail_out))return 1;if(e.strstart-e.block_start>=e.w_size-_&&(x(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(x(e,!0),0===e.strm.avail_out?3:4):(e.strstart>e.block_start&&(x(e,!1),e.strm.avail_out),1)}),new H(4,4,8,4,F),new H(4,5,16,8,F),new H(4,6,32,32,F),new H(4,4,16,16,K),new H(8,16,32,32,K),new H(8,16,128,128,K),new H(8,32,128,256,K),new H(32,128,258,1024,K),new H(32,258,258,4096,K)],r.deflateInit=function(e,t){return Y(e,t,8,15,8,0)},r.deflateInit2=Y,r.deflateReset=z,r.deflateResetKeep=G,r.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?p:(e.state.gzhead=t,0):p},r.deflate=function(e,t){var r,i,a,u;if(!e||!e.state||5<t||t<0)return e?k(e,p):p;if(i=e.state,!e.output||!e.input&&0!==e.avail_in||666===i.status&&4!==t)return k(e,0===e.avail_out?-5:p);if(i.strm=e,r=i.last_flush,i.last_flush=t,i.status===I)if(2===i.wrap)e.adler=0,L(i,31),L(i,139),L(i,8),i.gzhead?(L(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),L(i,255&i.gzhead.time),L(i,i.gzhead.time>>8&255),L(i,i.gzhead.time>>16&255),L(i,i.gzhead.time>>24&255),L(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),L(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(L(i,255&i.gzhead.extra.length),L(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=s(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(L(i,0),L(i,0),L(i,0),L(i,0),L(i,0),L(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),L(i,3),i.status=A);else{var c=8+(i.w_bits-8<<4)<<8;c|=(2<=i.strategy||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(c|=32),c+=31-c%31,i.status=A,j(i,c),0!==i.strstart&&(j(i,e.adler>>>16),j(i,65535&e.adler)),e.adler=1}if(69===i.status)if(i.gzhead.extra){for(a=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),D(e),a=i.pending,i.pending!==i.pending_buf_size));)L(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(73===i.status)if(i.gzhead.name){a=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),D(e),a=i.pending,i.pending===i.pending_buf_size)){u=1;break}u=i.gzindex<i.gzhead.name.length?255&i.gzhead.name.charCodeAt(i.gzindex++):0,L(i,u)}while(0!==u);i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),0===u&&(i.gzindex=0,i.status=91)}else i.status=91;if(91===i.status)if(i.gzhead.comment){a=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),D(e),a=i.pending,i.pending===i.pending_buf_size)){u=1;break}u=i.gzindex<i.gzhead.comment.length?255&i.gzhead.comment.charCodeAt(i.gzindex++):0,L(i,u)}while(0!==u);i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),0===u&&(i.status=103)}else i.status=103;if(103===i.status&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&D(e),i.pending+2<=i.pending_buf_size&&(L(i,255&e.adler),L(i,e.adler>>8&255),e.adler=0,i.status=A)):i.status=A),0!==i.pending){if(D(e),0===e.avail_out)return i.last_flush=-1,0}else if(0===e.avail_in&&N(t)<=N(r)&&4!==t)return k(e,-5);if(666===i.status&&0!==e.avail_in)return k(e,-5);if(0!==e.avail_in||0!==i.lookahead||0!==t&&666!==i.status){var f=2===i.strategy?function(e,t){for(var r;;){if(0===e.lookahead&&(V(e),0===e.lookahead)){if(0===t)return 1;break}if(e.match_length=0,r=o._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(x(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(x(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(x(e,!1),0===e.strm.avail_out)?1:2}(i,t):3===i.strategy?function(e,t){for(var r,n,i,a,s=e.window;;){if(e.lookahead<=C){if(V(e),e.lookahead<=C&&0===t)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&0<e.strstart&&(n=s[i=e.strstart-1])===s[++i]&&n===s[++i]&&n===s[++i]){a=e.strstart+C;do{}while(n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&i<a);e.match_length=C-(a-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(r=o._tr_tally(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=o._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(x(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(x(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(x(e,!1),0===e.strm.avail_out)?1:2}(i,t):n[i.level].func(i,t);if(3!==f&&4!==f||(i.status=666),1===f||3===f)return 0===e.avail_out&&(i.last_flush=-1),0;if(2===f&&(1===t?o._tr_align(i):5!==t&&(o._tr_stored_block(i,0,0,!1),3===t&&(U(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),D(e),0===e.avail_out))return i.last_flush=-1,0}return 4!==t?0:i.wrap<=0?1:(2===i.wrap?(L(i,255&e.adler),L(i,e.adler>>8&255),L(i,e.adler>>16&255),L(i,e.adler>>24&255),L(i,255&e.total_in),L(i,e.total_in>>8&255),L(i,e.total_in>>16&255),L(i,e.total_in>>24&255)):(j(i,e.adler>>>16),j(i,65535&e.adler)),D(e),0<i.wrap&&(i.wrap=-i.wrap),0!==i.pending?0:1)},r.deflateEnd=function(e){var t;return e&&e.state?(t=e.state.status)!==I&&69!==t&&73!==t&&91!==t&&103!==t&&t!==A&&666!==t?k(e,p):(e.state=null,t===A?k(e,-3):0):p},r.deflateSetDictionary=function(e,t){var r,n,o,s,u,c,f,l,h=t.length;if(!e||!e.state)return p;if(2===(s=(r=e.state).wrap)||1===s&&r.status!==I||r.lookahead)return p;for(1===s&&(e.adler=a(e.adler,t,h,0)),r.wrap=0,h>=r.w_size&&(0===s&&(U(r.head),r.strstart=0,r.block_start=0,r.insert=0),l=new i.Buf8(r.w_size),i.arraySet(l,t,h-r.w_size,r.w_size,0),t=l,h=r.w_size),u=e.avail_in,c=e.next_in,f=e.input,e.avail_in=h,e.next_in=0,e.input=t,V(r);r.lookahead>=3;){for(n=r.strstart,o=r.lookahead-2;r.ins_h=(r.ins_h<<r.hash_shift^r.window[n+3-1])&r.hash_mask,r.prev[n&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=n,n++,--o;);r.strstart=n,r.lookahead=2,V(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=2,r.match_available=0,e.next_in=c,e.input=f,e.avail_in=u,r.wrap=s,0},r.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(e,t,r){"use strict";t.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(e,t,r){"use strict";t.exports=function(e,t){var r,n,i,o,a,s,u,c,f,l,p,h,d,y,g,v,m,b,E,T,S,w,C,_,I;r=e.state,n=e.next_in,_=e.input,i=n+(e.avail_in-5),o=e.next_out,I=e.output,a=o-(t-e.avail_out),s=o+(e.avail_out-257),u=r.dmax,c=r.wsize,f=r.whave,l=r.wnext,p=r.window,h=r.hold,d=r.bits,y=r.lencode,g=r.distcode,v=(1<<r.lenbits)-1,m=(1<<r.distbits)-1;e:do{d<15&&(h+=_[n++]<<d,d+=8,h+=_[n++]<<d,d+=8),b=y[h&v];t:for(;;){if(h>>>=E=b>>>24,d-=E,0==(E=b>>>16&255))I[o++]=65535&b;else{if(!(16&E)){if(!(64&E)){b=y[(65535&b)+(h&(1<<E)-1)];continue t}if(32&E){r.mode=12;break e}e.msg="invalid literal/length code",r.mode=30;break e}T=65535&b,(E&=15)&&(d<E&&(h+=_[n++]<<d,d+=8),T+=h&(1<<E)-1,h>>>=E,d-=E),d<15&&(h+=_[n++]<<d,d+=8,h+=_[n++]<<d,d+=8),b=g[h&m];r:for(;;){if(h>>>=E=b>>>24,d-=E,!(16&(E=b>>>16&255))){if(!(64&E)){b=g[(65535&b)+(h&(1<<E)-1)];continue r}e.msg="invalid distance code",r.mode=30;break e}if(S=65535&b,d<(E&=15)&&(h+=_[n++]<<d,(d+=8)<E&&(h+=_[n++]<<d,d+=8)),u<(S+=h&(1<<E)-1)){e.msg="invalid distance too far back",r.mode=30;break e}if(h>>>=E,d-=E,(E=o-a)<S){if(f<(E=S-E)&&r.sane){e.msg="invalid distance too far back",r.mode=30;break e}if(C=p,(w=0)===l){if(w+=c-E,E<T){for(T-=E;I[o++]=p[w++],--E;);w=o-S,C=I}}else if(l<E){if(w+=c+l-E,(E-=l)<T){for(T-=E;I[o++]=p[w++],--E;);if(w=0,l<T){for(T-=E=l;I[o++]=p[w++],--E;);w=o-S,C=I}}}else if(w+=l-E,E<T){for(T-=E;I[o++]=p[w++],--E;);w=o-S,C=I}for(;2<T;)I[o++]=C[w++],I[o++]=C[w++],I[o++]=C[w++],T-=3;T&&(I[o++]=C[w++],1<T&&(I[o++]=C[w++]))}else{for(w=o-S;I[o++]=I[w++],I[o++]=I[w++],I[o++]=I[w++],2<(T-=3););T&&(I[o++]=I[w++],1<T&&(I[o++]=I[w++]))}break}}break}}while(n<i&&o<s);n-=T=d>>3,h&=(1<<(d-=T<<3))-1,e.next_in=n,e.next_out=o,e.avail_in=n<i?i-n+5:5-(n-i),e.avail_out=o<s?s-o+257:257-(o-s),r.hold=h,r.bits=d}},{}],49:[function(e,t,r){"use strict";var n=e("../utils/common"),i=e("./adler32"),o=e("./crc32"),a=e("./inffast"),s=e("./inftrees"),u=1,c=2,f=0,l=-2,p=1,h=852,d=592;function y(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function g(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new n.Buf16(320),this.work=new n.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function v(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=1,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new n.Buf32(h),t.distcode=t.distdyn=new n.Buf32(d),t.sane=1,t.back=-1,0):l}function m(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,v(e)):l}function b(e,t){var r,n;return e&&e.state?(n=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||15<t)?l:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,m(e))):l}function E(e,t){var r,n;return e?(n=new g,(e.state=n).window=null,0!==(r=b(e,t))&&(e.state=null),r):l}var T,S,w=!0;function C(e){if(w){var t;for(T=new n.Buf32(512),S=new n.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(s(1,e.lens,0,288,T,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;s(2,e.lens,0,32,S,0,e.work,{bits:5}),w=!1}e.lencode=T,e.lenbits=9,e.distcode=S,e.distbits=5}function _(e,t,r,i){var o,a=e.state;return null===a.window&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new n.Buf8(a.wsize)),i>=a.wsize?(n.arraySet(a.window,t,r-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):(i<(o=a.wsize-a.wnext)&&(o=i),n.arraySet(a.window,t,r-i,o,a.wnext),(i-=o)?(n.arraySet(a.window,t,r-i,i,0),a.wnext=i,a.whave=a.wsize):(a.wnext+=o,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=o))),0}r.inflateReset=m,r.inflateReset2=b,r.inflateResetKeep=v,r.inflateInit=function(e){return E(e,15)},r.inflateInit2=E,r.inflate=function(e,t){var r,u,c,f,p,h,d,g,v,m,b,E,T,S,w,I,A,R,O,P,B,k,N,U,D=0,x=new n.Buf8(4),L=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return l;12===(r=e.state).mode&&(r.mode=13),p=e.next_out,c=e.output,d=e.avail_out,f=e.next_in,u=e.input,h=e.avail_in,g=r.hold,v=r.bits,m=h,b=d,k=0;e:for(;;)switch(r.mode){case 1:if(0===r.wrap){r.mode=13;break}for(;v<16;){if(0===h)break e;h--,g+=u[f++]<<v,v+=8}if(2&r.wrap&&35615===g){x[r.check=0]=255&g,x[1]=g>>>8&255,r.check=o(r.check,x,2,0),v=g=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&g)<<8)+(g>>8))%31){e.msg="incorrect header check",r.mode=30;break}if(8!=(15&g)){e.msg="unknown compression method",r.mode=30;break}if(v-=4,B=8+(15&(g>>>=4)),0===r.wbits)r.wbits=B;else if(B>r.wbits){e.msg="invalid window size",r.mode=30;break}r.dmax=1<<B,e.adler=r.check=1,r.mode=512&g?10:12,v=g=0;break;case 2:for(;v<16;){if(0===h)break e;h--,g+=u[f++]<<v,v+=8}if(r.flags=g,8!=(255&r.flags)){e.msg="unknown compression method",r.mode=30;break}if(57344&r.flags){e.msg="unknown header flags set",r.mode=30;break}r.head&&(r.head.text=g>>8&1),512&r.flags&&(x[0]=255&g,x[1]=g>>>8&255,r.check=o(r.check,x,2,0)),v=g=0,r.mode=3;case 3:for(;v<32;){if(0===h)break e;h--,g+=u[f++]<<v,v+=8}r.head&&(r.head.time=g),512&r.flags&&(x[0]=255&g,x[1]=g>>>8&255,x[2]=g>>>16&255,x[3]=g>>>24&255,r.check=o(r.check,x,4,0)),v=g=0,r.mode=4;case 4:for(;v<16;){if(0===h)break e;h--,g+=u[f++]<<v,v+=8}r.head&&(r.head.xflags=255&g,r.head.os=g>>8),512&r.flags&&(x[0]=255&g,x[1]=g>>>8&255,r.check=o(r.check,x,2,0)),v=g=0,r.mode=5;case 5:if(1024&r.flags){for(;v<16;){if(0===h)break e;h--,g+=u[f++]<<v,v+=8}r.length=g,r.head&&(r.head.extra_len=g),512&r.flags&&(x[0]=255&g,x[1]=g>>>8&255,r.check=o(r.check,x,2,0)),v=g=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&(h<(E=r.length)&&(E=h),E&&(r.head&&(B=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),n.arraySet(r.head.extra,u,f,E,B)),512&r.flags&&(r.check=o(r.check,u,E,f)),h-=E,f+=E,r.length-=E),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===h)break e;for(E=0;B=u[f+E++],r.head&&B&&r.length<65536&&(r.head.name+=String.fromCharCode(B)),B&&E<h;);if(512&r.flags&&(r.check=o(r.check,u,E,f)),h-=E,f+=E,B)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=8;case 8:if(4096&r.flags){if(0===h)break e;for(E=0;B=u[f+E++],r.head&&B&&r.length<65536&&(r.head.comment+=String.fromCharCode(B)),B&&E<h;);if(512&r.flags&&(r.check=o(r.check,u,E,f)),h-=E,f+=E,B)break e}else r.head&&(r.head.comment=null);r.mode=9;case 9:if(512&r.flags){for(;v<16;){if(0===h)break e;h--,g+=u[f++]<<v,v+=8}if(g!==(65535&r.check)){e.msg="header crc mismatch",r.mode=30;break}v=g=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=12;break;case 10:for(;v<32;){if(0===h)break e;h--,g+=u[f++]<<v,v+=8}e.adler=r.check=y(g),v=g=0,r.mode=11;case 11:if(0===r.havedict)return e.next_out=p,e.avail_out=d,e.next_in=f,e.avail_in=h,r.hold=g,r.bits=v,2;e.adler=r.check=1,r.mode=12;case 12:if(5===t||6===t)break e;case 13:if(r.last){g>>>=7&v,v-=7&v,r.mode=27;break}for(;v<3;){if(0===h)break e;h--,g+=u[f++]<<v,v+=8}switch(r.last=1&g,v-=1,3&(g>>>=1)){case 0:r.mode=14;break;case 1:if(C(r),r.mode=20,6!==t)break;g>>>=2,v-=2;break e;case 2:r.mode=17;break;case 3:e.msg="invalid block type",r.mode=30}g>>>=2,v-=2;break;case 14:for(g>>>=7&v,v-=7&v;v<32;){if(0===h)break e;h--,g+=u[f++]<<v,v+=8}if((65535&g)!=(g>>>16^65535)){e.msg="invalid stored block lengths",r.mode=30;break}if(r.length=65535&g,v=g=0,r.mode=15,6===t)break e;case 15:r.mode=16;case 16:if(E=r.length){if(h<E&&(E=h),d<E&&(E=d),0===E)break e;n.arraySet(c,u,f,E,p),h-=E,f+=E,d-=E,p+=E,r.length-=E;break}r.mode=12;break;case 17:for(;v<14;){if(0===h)break e;h--,g+=u[f++]<<v,v+=8}if(r.nlen=257+(31&g),g>>>=5,v-=5,r.ndist=1+(31&g),g>>>=5,v-=5,r.ncode=4+(15&g),g>>>=4,v-=4,286<r.nlen||30<r.ndist){e.msg="too many length or distance symbols",r.mode=30;break}r.have=0,r.mode=18;case 18:for(;r.have<r.ncode;){for(;v<3;){if(0===h)break e;h--,g+=u[f++]<<v,v+=8}r.lens[L[r.have++]]=7&g,g>>>=3,v-=3}for(;r.have<19;)r.lens[L[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,N={bits:r.lenbits},k=s(0,r.lens,0,19,r.lencode,0,r.work,N),r.lenbits=N.bits,k){e.msg="invalid code lengths set",r.mode=30;break}r.have=0,r.mode=19;case 19:for(;r.have<r.nlen+r.ndist;){for(;I=(D=r.lencode[g&(1<<r.lenbits)-1])>>>16&255,A=65535&D,!((w=D>>>24)<=v);){if(0===h)break e;h--,g+=u[f++]<<v,v+=8}if(A<16)g>>>=w,v-=w,r.lens[r.have++]=A;else{if(16===A){for(U=w+2;v<U;){if(0===h)break e;h--,g+=u[f++]<<v,v+=8}if(g>>>=w,v-=w,0===r.have){e.msg="invalid bit length repeat",r.mode=30;break}B=r.lens[r.have-1],E=3+(3&g),g>>>=2,v-=2}else if(17===A){for(U=w+3;v<U;){if(0===h)break e;h--,g+=u[f++]<<v,v+=8}v-=w,B=0,E=3+(7&(g>>>=w)),g>>>=3,v-=3}else{for(U=w+7;v<U;){if(0===h)break e;h--,g+=u[f++]<<v,v+=8}v-=w,B=0,E=11+(127&(g>>>=w)),g>>>=7,v-=7}if(r.have+E>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=30;break}for(;E--;)r.lens[r.have++]=B}}if(30===r.mode)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=30;break}if(r.lenbits=9,N={bits:r.lenbits},k=s(1,r.lens,0,r.nlen,r.lencode,0,r.work,N),r.lenbits=N.bits,k){e.msg="invalid literal/lengths set",r.mode=30;break}if(r.distbits=6,r.distcode=r.distdyn,N={bits:r.distbits},k=s(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,N),r.distbits=N.bits,k){e.msg="invalid distances set",r.mode=30;break}if(r.mode=20,6===t)break e;case 20:r.mode=21;case 21:if(6<=h&&258<=d){e.next_out=p,e.avail_out=d,e.next_in=f,e.avail_in=h,r.hold=g,r.bits=v,a(e,b),p=e.next_out,c=e.output,d=e.avail_out,f=e.next_in,u=e.input,h=e.avail_in,g=r.hold,v=r.bits,12===r.mode&&(r.back=-1);break}for(r.back=0;I=(D=r.lencode[g&(1<<r.lenbits)-1])>>>16&255,A=65535&D,!((w=D>>>24)<=v);){if(0===h)break e;h--,g+=u[f++]<<v,v+=8}if(I&&!(240&I)){for(R=w,O=I,P=A;I=(D=r.lencode[P+((g&(1<<R+O)-1)>>R)])>>>16&255,A=65535&D,!(R+(w=D>>>24)<=v);){if(0===h)break e;h--,g+=u[f++]<<v,v+=8}g>>>=R,v-=R,r.back+=R}if(g>>>=w,v-=w,r.back+=w,r.length=A,0===I){r.mode=26;break}if(32&I){r.back=-1,r.mode=12;break}if(64&I){e.msg="invalid literal/length code",r.mode=30;break}r.extra=15&I,r.mode=22;case 22:if(r.extra){for(U=r.extra;v<U;){if(0===h)break e;h--,g+=u[f++]<<v,v+=8}r.length+=g&(1<<r.extra)-1,g>>>=r.extra,v-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;I=(D=r.distcode[g&(1<<r.distbits)-1])>>>16&255,A=65535&D,!((w=D>>>24)<=v);){if(0===h)break e;h--,g+=u[f++]<<v,v+=8}if(!(240&I)){for(R=w,O=I,P=A;I=(D=r.distcode[P+((g&(1<<R+O)-1)>>R)])>>>16&255,A=65535&D,!(R+(w=D>>>24)<=v);){if(0===h)break e;h--,g+=u[f++]<<v,v+=8}g>>>=R,v-=R,r.back+=R}if(g>>>=w,v-=w,r.back+=w,64&I){e.msg="invalid distance code",r.mode=30;break}r.offset=A,r.extra=15&I,r.mode=24;case 24:if(r.extra){for(U=r.extra;v<U;){if(0===h)break e;h--,g+=u[f++]<<v,v+=8}r.offset+=g&(1<<r.extra)-1,g>>>=r.extra,v-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=30;break}r.mode=25;case 25:if(0===d)break e;if(E=b-d,r.offset>E){if((E=r.offset-E)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=30;break}T=E>r.wnext?(E-=r.wnext,r.wsize-E):r.wnext-E,E>r.length&&(E=r.length),S=r.window}else S=c,T=p-r.offset,E=r.length;for(d<E&&(E=d),d-=E,r.length-=E;c[p++]=S[T++],--E;);0===r.length&&(r.mode=21);break;case 26:if(0===d)break e;c[p++]=r.length,d--,r.mode=21;break;case 27:if(r.wrap){for(;v<32;){if(0===h)break e;h--,g|=u[f++]<<v,v+=8}if(b-=d,e.total_out+=b,r.total+=b,b&&(e.adler=r.check=r.flags?o(r.check,c,b,p-b):i(r.check,c,b,p-b)),b=d,(r.flags?g:y(g))!==r.check){e.msg="incorrect data check",r.mode=30;break}v=g=0}r.mode=28;case 28:if(r.wrap&&r.flags){for(;v<32;){if(0===h)break e;h--,g+=u[f++]<<v,v+=8}if(g!==(4294967295&r.total)){e.msg="incorrect length check",r.mode=30;break}v=g=0}r.mode=29;case 29:k=1;break e;case 30:k=-3;break e;case 31:return-4;default:return l}return e.next_out=p,e.avail_out=d,e.next_in=f,e.avail_in=h,r.hold=g,r.bits=v,(r.wsize||b!==e.avail_out&&r.mode<30&&(r.mode<27||4!==t))&&_(e,e.output,e.next_out,b-e.avail_out)?(r.mode=31,-4):(m-=e.avail_in,b-=e.avail_out,e.total_in+=m,e.total_out+=b,r.total+=b,r.wrap&&b&&(e.adler=r.check=r.flags?o(r.check,c,b,e.next_out-b):i(r.check,c,b,e.next_out-b)),e.data_type=r.bits+(r.last?64:0)+(12===r.mode?128:0)+(20===r.mode||15===r.mode?256:0),(0==m&&0===b||4===t)&&0===k&&(k=-5),k)},r.inflateEnd=function(e){if(!e||!e.state)return l;var t=e.state;return t.window&&(t.window=null),e.state=null,0},r.inflateGetHeader=function(e,t){var r;return e&&e.state&&2&(r=e.state).wrap?((r.head=t).done=!1,0):l},r.inflateSetDictionary=function(e,t){var r,n=t.length;return e&&e.state?0!==(r=e.state).wrap&&11!==r.mode?l:11===r.mode&&i(1,t,n,0)!==r.check?-3:_(e,t,n,n)?(r.mode=31,-4):(r.havedict=1,0):l},r.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(e,t,r){"use strict";var n=e("../utils/common"),i=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],o=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],a=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],s=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];t.exports=function(e,t,r,u,c,f,l,p){var h,d,y,g,v,m,b,E,T,S=p.bits,w=0,C=0,_=0,I=0,A=0,R=0,O=0,P=0,B=0,k=0,N=null,U=0,D=new n.Buf16(16),x=new n.Buf16(16),L=null,j=0;for(w=0;w<=15;w++)D[w]=0;for(C=0;C<u;C++)D[t[r+C]]++;for(A=S,I=15;1<=I&&0===D[I];I--);if(I<A&&(A=I),0===I)return c[f++]=20971520,c[f++]=20971520,p.bits=1,0;for(_=1;_<I&&0===D[_];_++);for(A<_&&(A=_),w=P=1;w<=15;w++)if(P<<=1,(P-=D[w])<0)return-1;if(0<P&&(0===e||1!==I))return-1;for(x[1]=0,w=1;w<15;w++)x[w+1]=x[w]+D[w];for(C=0;C<u;C++)0!==t[r+C]&&(l[x[t[r+C]]++]=C);if(m=0===e?(N=L=l,19):1===e?(N=i,U-=257,L=o,j-=257,256):(N=a,L=s,-1),w=_,v=f,O=C=k=0,y=-1,g=(B=1<<(R=A))-1,1===e&&852<B||2===e&&592<B)return 1;for(;;){for(b=w-O,T=l[C]<m?(E=0,l[C]):l[C]>m?(E=L[j+l[C]],N[U+l[C]]):(E=96,0),h=1<<w-O,_=d=1<<R;c[v+(k>>O)+(d-=h)]=b<<24|E<<16|T,0!==d;);for(h=1<<w-1;k&h;)h>>=1;if(0!==h?(k&=h-1,k+=h):k=0,C++,0==--D[w]){if(w===I)break;w=t[r+l[C]]}if(A<w&&(k&g)!==y){for(0===O&&(O=A),v+=_,P=1<<(R=w-O);R+O<I&&!((P-=D[R+O])<=0);)R++,P<<=1;if(B+=1<<R,1===e&&852<B||2===e&&592<B)return 1;c[y=k&g]=A<<24|R<<16|v-f}}return 0!==k&&(c[v+k]=w-O<<24|64<<16),p.bits=A,0}},{"../utils/common":41}],51:[function(e,t,r){"use strict";t.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(e,t,r){"use strict";var n=e("../utils/common"),i=0,o=1;function a(e){for(var t=e.length;0<=--t;)e[t]=0}var s=0,u=29,c=256,f=286,l=30,p=19,h=573,d=15,y=16,g=7,v=256,m=16,b=17,E=18,T=[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],S=[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],w=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],C=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],_=new Array(576);a(_);var I=new Array(60);a(I);var A=new Array(512);a(A);var R=new Array(256);a(R);var O=new Array(u);a(O);var P,B,k,N=new Array(l);function U(e,t,r,n,i){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=e&&e.length}function D(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function x(e){return e<256?A[e]:A[256+(e>>>7)]}function L(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function j(e,t,r){e.bi_valid>y-r?(e.bi_buf|=t<<e.bi_valid&65535,L(e,e.bi_buf),e.bi_buf=t>>y-e.bi_valid,e.bi_valid+=r-y):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=r)}function M(e,t,r){j(e,r[2*t],r[2*t+1])}function V(e,t){for(var r=0;r|=1&e,e>>>=1,r<<=1,0<--t;);return r>>>1}function F(e,t,r){var n,i,o=new Array(16),a=0;for(n=1;n<=d;n++)o[n]=a=a+r[n-1]<<1;for(i=0;i<=t;i++){var s=e[2*i+1];0!==s&&(e[2*i]=V(o[s]++,s))}}function K(e){var t;for(t=0;t<f;t++)e.dyn_ltree[2*t]=0;for(t=0;t<l;t++)e.dyn_dtree[2*t]=0;for(t=0;t<p;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function H(e){8<e.bi_valid?L(e,e.bi_buf):0<e.bi_valid&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function q(e,t,r,n){var i=2*t,o=2*r;return e[i]<e[o]||e[i]===e[o]&&n[t]<=n[r]}function G(e,t,r){for(var n=e.heap[r],i=r<<1;i<=e.heap_len&&(i<e.heap_len&&q(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!q(t,n,e.heap[i],e.depth));)e.heap[r]=e.heap[i],r=i,i<<=1;e.heap[r]=n}function z(e,t,r){var n,i,o,a,s=0;if(0!==e.last_lit)for(;n=e.pending_buf[e.d_buf+2*s]<<8|e.pending_buf[e.d_buf+2*s+1],i=e.pending_buf[e.l_buf+s],s++,0===n?M(e,i,t):(M(e,(o=R[i])+c+1,t),0!==(a=T[o])&&j(e,i-=O[o],a),M(e,o=x(--n),r),0!==(a=S[o])&&j(e,n-=N[o],a)),s<e.last_lit;);M(e,v,t)}function Y(e,t){var r,n,i,o=t.dyn_tree,a=t.stat_desc.static_tree,s=t.stat_desc.has_stree,u=t.stat_desc.elems,c=-1;for(e.heap_len=0,e.heap_max=h,r=0;r<u;r++)0!==o[2*r]?(e.heap[++e.heap_len]=c=r,e.depth[r]=0):o[2*r+1]=0;for(;e.heap_len<2;)o[2*(i=e.heap[++e.heap_len]=c<2?++c:0)]=1,e.depth[i]=0,e.opt_len--,s&&(e.static_len-=a[2*i+1]);for(t.max_code=c,r=e.heap_len>>1;1<=r;r--)G(e,o,r);for(i=u;r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],G(e,o,1),n=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=n,o[2*i]=o[2*r]+o[2*n],e.depth[i]=(e.depth[r]>=e.depth[n]?e.depth[r]:e.depth[n])+1,o[2*r+1]=o[2*n+1]=i,e.heap[1]=i++,G(e,o,1),2<=e.heap_len;);e.heap[--e.heap_max]=e.heap[1],function(e,t){var r,n,i,o,a,s,u=t.dyn_tree,c=t.max_code,f=t.stat_desc.static_tree,l=t.stat_desc.has_stree,p=t.stat_desc.extra_bits,y=t.stat_desc.extra_base,g=t.stat_desc.max_length,v=0;for(o=0;o<=d;o++)e.bl_count[o]=0;for(u[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;r<h;r++)g<(o=u[2*u[2*(n=e.heap[r])+1]+1]+1)&&(o=g,v++),u[2*n+1]=o,c<n||(e.bl_count[o]++,a=0,y<=n&&(a=p[n-y]),s=u[2*n],e.opt_len+=s*(o+a),l&&(e.static_len+=s*(f[2*n+1]+a)));if(0!==v){do{for(o=g-1;0===e.bl_count[o];)o--;e.bl_count[o]--,e.bl_count[o+1]+=2,e.bl_count[g]--,v-=2}while(0<v);for(o=g;0!==o;o--)for(n=e.bl_count[o];0!==n;)c<(i=e.heap[--r])||(u[2*i+1]!==o&&(e.opt_len+=(o-u[2*i+1])*u[2*i],u[2*i+1]=o),n--)}}(e,t),F(o,c,e.bl_count)}function W(e,t,r){var n,i,o=-1,a=t[1],s=0,u=7,c=4;for(0===a&&(u=138,c=3),t[2*(r+1)+1]=65535,n=0;n<=r;n++)i=a,a=t[2*(n+1)+1],++s<u&&i===a||(s<c?e.bl_tree[2*i]+=s:0!==i?(i!==o&&e.bl_tree[2*i]++,e.bl_tree[32]++):s<=10?e.bl_tree[34]++:e.bl_tree[36]++,o=i,c=(s=0)===a?(u=138,3):i===a?(u=6,3):(u=7,4))}function Q(e,t,r){var n,i,o=-1,a=t[1],s=0,u=7,c=4;for(0===a&&(u=138,c=3),n=0;n<=r;n++)if(i=a,a=t[2*(n+1)+1],!(++s<u&&i===a)){if(s<c)for(;M(e,i,e.bl_tree),0!=--s;);else 0!==i?(i!==o&&(M(e,i,e.bl_tree),s--),M(e,m,e.bl_tree),j(e,s-3,2)):s<=10?(M(e,b,e.bl_tree),j(e,s-3,3)):(M(e,E,e.bl_tree),j(e,s-11,7));o=i,c=(s=0)===a?(u=138,3):i===a?(u=6,3):(u=7,4)}}a(N);var X=!1;function Z(e,t,r,i){j(e,0+(i?1:0),3),function(e,t,r,i){H(e),L(e,r),L(e,~r),n.arraySet(e.pending_buf,e.window,t,r,e.pending),e.pending+=r}(e,t,r,!0)}r._tr_init=function(e){X||(function(){var e,t,r,n,i,o=new Array(16);for(n=r=0;n<28;n++)for(O[n]=r,e=0;e<1<<T[n];e++)R[r++]=n;for(R[r-1]=n,n=i=0;n<16;n++)for(N[n]=i,e=0;e<1<<S[n];e++)A[i++]=n;for(i>>=7;n<l;n++)for(N[n]=i<<7,e=0;e<1<<S[n]-7;e++)A[256+i++]=n;for(t=0;t<=d;t++)o[t]=0;for(e=0;e<=143;)_[2*e+1]=8,e++,o[8]++;for(;e<=255;)_[2*e+1]=9,e++,o[9]++;for(;e<=279;)_[2*e+1]=7,e++,o[7]++;for(;e<=287;)_[2*e+1]=8,e++,o[8]++;for(F(_,287,o),e=0;e<l;e++)I[2*e+1]=5,I[2*e]=V(e,5);P=new U(_,T,257,f,d),B=new U(I,S,0,l,d),k=new U(new Array(0),w,0,p,7)}(),X=!0),e.l_desc=new D(e.dyn_ltree,P),e.d_desc=new D(e.dyn_dtree,B),e.bl_desc=new D(e.bl_tree,k),e.bi_buf=0,e.bi_valid=0,K(e)},r._tr_stored_block=Z,r._tr_flush_block=function(e,t,r,n){var i,o,a=0;0<e.level?(2===e.strm.data_type&&(e.strm.data_type=function(e){var t,r=4093624447;for(t=0;t<=31;t++,r>>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<c;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0}(e)),Y(e,e.l_desc),Y(e,e.d_desc),a=function(e){var t;for(W(e,e.dyn_ltree,e.l_desc.max_code),W(e,e.dyn_dtree,e.d_desc.max_code),Y(e,e.bl_desc),t=18;3<=t&&0===e.bl_tree[2*C[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),i=e.opt_len+3+7>>>3,(o=e.static_len+3+7>>>3)<=i&&(i=o)):i=o=r+5,r+4<=i&&-1!==t?Z(e,t,r,n):4===e.strategy||o===i?(j(e,2+(n?1:0),3),z(e,_,I)):(j(e,4+(n?1:0),3),function(e,t,r,n){var i;for(j(e,t-257,5),j(e,r-1,5),j(e,n-4,4),i=0;i<n;i++)j(e,e.bl_tree[2*C[i]+1],3);Q(e,e.dyn_ltree,t-1),Q(e,e.dyn_dtree,r-1)}(e,e.l_desc.max_code+1,e.d_desc.max_code+1,a+1),z(e,e.dyn_ltree,e.dyn_dtree)),K(e),n&&H(e)},r._tr_tally=function(e,t,r){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&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(R[r]+c+1)]++,e.dyn_dtree[2*x(t)]++),e.last_lit===e.lit_bufsize-1},r._tr_align=function(e){j(e,2,3),M(e,v,_),function(e){16===e.bi_valid?(L(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):8<=e.bi_valid&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},{"../utils/common":41}],53:[function(e,t,r){"use strict";t.exports=function(){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}},{}],54:[function(e,t,r){(function(e){!function(e,t){"use strict";if(!e.setImmediate){var r,n,o,a,s=1,u={},c=!1,f=e.document,l=Object.getPrototypeOf&&Object.getPrototypeOf(e);l=l&&l.setTimeout?l:e,r="[object process]"==={}.toString.call(e.process)?function(e){i.nextTick(function(){h(e)})}:function(){if(e.postMessage&&!e.importScripts){var t=!0,r=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=r,t}}()?(a="setImmediate$"+Math.random()+"$",e.addEventListener?e.addEventListener("message",d,!1):e.attachEvent("onmessage",d),function(t){e.postMessage(a+t,"*")}):e.MessageChannel?((o=new MessageChannel).port1.onmessage=function(e){h(e.data)},function(e){o.port2.postMessage(e)}):f&&"onreadystatechange"in f.createElement("script")?(n=f.documentElement,function(e){var t=f.createElement("script");t.onreadystatechange=function(){h(e),t.onreadystatechange=null,n.removeChild(t),t=null},n.appendChild(t)}):function(e){setTimeout(h,0,e)},l.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n<t.length;n++)t[n]=arguments[n+1];var i={callback:e,args:t};return u[s]=i,r(s),s++},l.clearImmediate=p}function p(e){delete u[e]}function h(e){if(c)setTimeout(h,0,e);else{var r=u[e];if(r){c=!0;try{!function(e){var r=e.callback,n=e.args;switch(n.length){case 0:r();break;case 1:r(n[0]);break;case 2:r(n[0],n[1]);break;case 3:r(n[0],n[1],n[2]);break;default:r.apply(t,n)}}(r)}finally{p(e),c=!1}}}}function d(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(a)&&h(+t.data.slice(a.length))}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,void 0!==n?n:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[10])(10)},e.exports=a()}).call(this,r(116).Buffer,r(134).setImmediate,r(29),r(36))},function(e,t,r){"use strict";(function(e){var t="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==e&&e||{},r="URLSearchParams"in t,n="Symbol"in t&&"iterator"in Symbol,i="FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(e){return!1}}(),o="FormData"in t,a="ArrayBuffer"in t;function s(e){return e&&DataView.prototype.isPrototypeOf(e)}if(a)var u=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],c=ArrayBuffer.isView||function(e){return e&&u.indexOf(Object.prototype.toString.call(e))>-1};function f(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function l(e){return"string"!=typeof e&&(e=String(e)),e}function p(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return n&&(t[Symbol.iterator]=function(){return t}),t}function h(e){this.map={},e instanceof h?e.forEach(function(e,t){this.append(t,e)},this):Array.isArray(e)?e.forEach(function(e){if(2!=e.length)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+e.length);this.append(e[0],e[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}function d(e){if(!e._noBody)return e.bodyUsed?Promise.reject(new TypeError("Already read")):void(e.bodyUsed=!0)}function y(e){return new Promise(function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}})}function g(e){var t=new FileReader,r=y(t);return t.readAsArrayBuffer(e),r}function v(e){var t=new FileReader,r=y(t),n=/charset=([A-Za-z0-9_-]+)/.exec(e.type),i=n?n[1]:"utf-8";return t.readAsText(e,i),r}function m(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n<t.length;n++)r[n]=String.fromCharCode(t[n]);return r.join("")}function b(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function E(){return this.bodyUsed=!1,this._initBody=function(e){this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:i&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:o&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:r&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():a&&i&&s(e)?(this._bodyArrayBuffer=b(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):a&&(ArrayBuffer.prototype.isPrototypeOf(e)||c(e))?this._bodyArrayBuffer=b(e):this._bodyText=e=Object.prototype.toString.call(e):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i&&(this.blob=function(){var e=d(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer){var e=d(this);return e||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}if(i)return this.blob().then(g);throw new Error("could not read as ArrayBuffer")},this.text=function(){var e=d(this);if(e)return e;if(this._bodyBlob)return v(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(m(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},o&&(this.formData=function(){return this.text().then(C)}),this.json=function(){return this.text().then(JSON.parse)},this}h.prototype.append=function(e,t){e=f(e),t=l(t);var r=this.map[e];this.map[e]=r?r+", "+t:t},h.prototype.delete=function(e){delete this.map[f(e)]},h.prototype.get=function(e){return e=f(e),this.has(e)?this.map[e]:null},h.prototype.has=function(e){return this.map.hasOwnProperty(f(e))},h.prototype.set=function(e,t){this.map[f(e)]=l(t)},h.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},h.prototype.keys=function(){var e=[];return this.forEach(function(t,r){e.push(r)}),p(e)},h.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),p(e)},h.prototype.entries=function(){var e=[];return this.forEach(function(t,r){e.push([r,t])}),p(e)},n&&(h.prototype[Symbol.iterator]=h.prototype.entries);var T=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function S(e){var t=e.toUpperCase();return T.indexOf(t)>-1?t:e}function w(e,r){if(!(this instanceof w))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var n=(r=r||{}).body;if(e instanceof w){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,r.headers||(this.headers=new h(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,n||null==e._bodyInit||(n=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=r.credentials||this.credentials||"same-origin",!r.headers&&this.headers||(this.headers=new h(r.headers)),this.method=S(r.method||this.method||"GET"),this.mode=r.mode||this.mode||null,this.signal=r.signal||this.signal||function(){var e;if("AbortController"in t)return(new AbortController).signal}(),this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(n),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==r.cache&&"no-cache"!==r.cache)){var i=/([?&])_=[^&]*/;if(i.test(this.url))this.url=this.url.replace(i,"$1_="+(new Date).getTime());else{var o=/\?/;this.url+=(o.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}}function C(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var r=e.split("="),n=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(i))}}),t}function _(e){var t=new h,r;return e.replace(/\r?\n[\t ]+/g," ").split("\r").map(function(e){return 0===e.indexOf("\n")?e.substr(1,e.length):e}).forEach(function(e){var r=e.split(":"),n=r.shift().trim();if(n){var i=r.join(":").trim();try{t.append(n,i)}catch(e){console.warn("Response "+e.message)}}}),t}function I(e,t){if(!(this instanceof I))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=void 0===t.statusText?"":""+t.statusText,this.headers=new h(t.headers),this.url=t.url||"",this._initBody(e)}w.prototype.clone=function(){return new w(this,{body:this._bodyInit})},E.call(w.prototype),E.call(I.prototype),I.prototype.clone=function(){return new I(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new h(this.headers),url:this.url})},I.error=function(){var e=new I(null,{status:200,statusText:""});return e.status=0,e.type="error",e};var A=[301,302,303,307,308];I.redirect=function(e,t){if(-1===A.indexOf(t))throw new RangeError("Invalid status code");return new I(null,{status:t,headers:{location:e}})};var R=t.DOMException;try{new R}catch(e){(R=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack}).prototype=Object.create(Error.prototype),R.prototype.constructor=R}function O(e,r){return new Promise(function(n,o){var s=new w(e,r);if(s.signal&&s.signal.aborted)return o(new R("Aborted","AbortError"));var u=new XMLHttpRequest;function c(){u.abort()}function p(e){try{return""===e&&t.location.href?t.location.href:e}catch(t){return e}}if(u.onload=function(){var e={statusText:u.statusText,headers:_(u.getAllResponseHeaders()||"")};s.url.startsWith("file://")&&(u.status<200||u.status>599)?e.status=200:e.status=u.status,e.url="responseURL"in u?u.responseURL:e.headers.get("X-Request-URL");var t="response"in u?u.response:u.responseText;setTimeout(function(){n(new I(t,e))},0)},u.onerror=function(){setTimeout(function(){o(new TypeError("Network request failed"))},0)},u.ontimeout=function(){setTimeout(function(){o(new TypeError("Network request timed out"))},0)},u.onabort=function(){setTimeout(function(){o(new R("Aborted","AbortError"))},0)},u.open(s.method,p(s.url),!0),"include"===s.credentials?u.withCredentials=!0:"omit"===s.credentials&&(u.withCredentials=!1),"responseType"in u&&(i?u.responseType="blob":a&&(u.responseType="arraybuffer")),r&&"object"==typeof r.headers&&!(r.headers instanceof h||t.Headers&&r.headers instanceof t.Headers)){var d=[];Object.getOwnPropertyNames(r.headers).forEach(function(e){d.push(f(e)),u.setRequestHeader(e,l(r.headers[e]))}),s.headers.forEach(function(e,t){-1===d.indexOf(t)&&u.setRequestHeader(t,e)})}else s.headers.forEach(function(e,t){u.setRequestHeader(t,e)});s.signal&&(s.signal.addEventListener("abort",c),u.onreadystatechange=function(){4===u.readyState&&s.signal.removeEventListener("abort",c)}),u.send(void 0===s._bodyInit?null:s._bodyInit)})}O.polyfill=!0,t.fetch||(t.fetch=O,t.Headers=h,t.Request=w,t.Response=I)}).call(this,r(29))},function(e,t,r){"use strict";var n=r(128),i=r(113),o=Object.prototype.hasOwnProperty,a={brackets:function e(t){return t+"[]"},comma:"comma",indices:function e(t,r){return t+"["+r+"]"},repeat:function e(t){return t}},s=Array.isArray,u=String.prototype.split,c=Array.prototype.push,f=function(e,t){c.apply(e,s(t)?t:[t])},l=Date.prototype.toISOString,p=i.default,h={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:n.encode,encodeValuesOnly:!1,format:p,formatter:i.formatters[p],indices:!1,serializeDate:function e(t){return l.call(t)},skipNulls:!1,strictNullHandling:!1},d=function e(t){return"string"==typeof t||"number"==typeof t||"boolean"==typeof t||"symbol"==typeof t||"bigint"==typeof t},y=function e(t,r,i,o,a,c,l,p,y,g,v,m,b,E){var T=t;if("function"==typeof l?T=l(r,T):T instanceof Date?T=g(T):"comma"===i&&s(T)&&(T=n.maybeMap(T,function(e){return e instanceof Date?g(e):e})),null===T){if(o)return c&&!b?c(r,h.encoder,E,"key",v):r;T=""}if(d(T)||n.isBuffer(T)){if(c){var S=b?r:c(r,h.encoder,E,"key",v);if("comma"===i&&b){for(var w=u.call(String(T),","),C="",_=0;_<w.length;++_)C+=(0===_?"":",")+m(c(w[_],h.encoder,E,"value",v));return[m(S)+"="+C]}return[m(S)+"="+m(c(T,h.encoder,E,"value",v))]}return[m(r)+"="+m(String(T))]}var I=[],A;if(void 0===T)return I;if("comma"===i&&s(T))A=[{value:T.length>0?T.join(",")||null:void 0}];else if(s(l))A=l;else{var R=Object.keys(T);A=p?R.sort(p):R}for(var O=0;O<A.length;++O){var P=A[O],B="object"==typeof P&&void 0!==P.value?P.value:T[P];if(!a||null!==B){var k=s(T)?"function"==typeof i?i(r,P):r:r+(y?"."+P:"["+P+"]");f(I,e(B,k,i,o,a,c,l,p,y,g,v,m,b,E))}}return I},g=function e(t){if(!t)return h;if(null!==t.encoder&&void 0!==t.encoder&&"function"!=typeof t.encoder)throw new TypeError("Encoder has to be a function.");var r=t.charset||h.charset;if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=i.default;if(void 0!==t.format){if(!o.call(i.formatters,t.format))throw new TypeError("Unknown format option provided.");n=t.format}var a=i.formatters[n],u=h.filter;return("function"==typeof t.filter||s(t.filter))&&(u=t.filter),{addQueryPrefix:"boolean"==typeof t.addQueryPrefix?t.addQueryPrefix:h.addQueryPrefix,allowDots:void 0===t.allowDots?h.allowDots:!!t.allowDots,charset:r,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:h.charsetSentinel,delimiter:void 0===t.delimiter?h.delimiter:t.delimiter,encode:"boolean"==typeof t.encode?t.encode:h.encode,encoder:"function"==typeof t.encoder?t.encoder:h.encoder,encodeValuesOnly:"boolean"==typeof t.encodeValuesOnly?t.encodeValuesOnly:h.encodeValuesOnly,filter:u,format:n,formatter:a,serializeDate:"function"==typeof t.serializeDate?t.serializeDate:h.serializeDate,skipNulls:"boolean"==typeof t.skipNulls?t.skipNulls:h.skipNulls,sort:"function"==typeof t.sort?t.sort:null,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:h.strictNullHandling}};e.exports=function(e,t){var r=e,n=g(t),i,o;"function"==typeof n.filter?r=(o=n.filter)("",r):s(n.filter)&&(i=o=n.filter);var u=[],c;if("object"!=typeof r||null===r)return"";c=t&&t.arrayFormat in a?t.arrayFormat:t&&"indices"in t?t.indices?"indices":"repeat":"indices";var l=a[c];i||(i=Object.keys(r)),n.sort&&i.sort(n.sort);for(var p=0;p<i.length;++p){var h=i[p];n.skipNulls&&null===r[h]||f(u,y(r[h],h,l,n.strictNullHandling,n.skipNulls,n.encode?n.encoder:null,n.filter,n.sort,n.allowDots,n.serializeDate,n.format,n.formatter,n.encodeValuesOnly,n.charset))}var d=u.join(n.delimiter),v=!0===n.addQueryPrefix?"?":"";return n.charsetSentinel&&("iso-8859-1"===n.charset?v+="utf8=%26%2310003%3B&":v+="utf8=%E2%9C%93&"),d.length>0?v+d:""}},function(e,t,r){"use strict";var n=r(128),i=Object.prototype.hasOwnProperty,o=Array.isArray,a={allowDots:!1,allowPrototypes:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:n.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},s=function(e){return e.replace(/&#(\d+);/g,function(e,t){return String.fromCharCode(parseInt(t,10))})},u=function(e,t){return e&&"string"==typeof e&&t.comma&&e.indexOf(",")>-1?e.split(","):e},c="utf8=%26%2310003%3B",f="utf8=%E2%9C%93",l=function e(t,r){var l={},p=r.ignoreQueryPrefix?t.replace(/^\?/,""):t,h=r.parameterLimit===1/0?void 0:r.parameterLimit,d=p.split(r.delimiter,h),y=-1,g,v=r.charset;if(r.charsetSentinel)for(g=0;g<d.length;++g)0===d[g].indexOf("utf8=")&&(d[g]===f?v="utf-8":d[g]===c&&(v="iso-8859-1"),y=g,g=d.length);for(g=0;g<d.length;++g)if(g!==y){var m=d[g],b=m.indexOf("]="),E=-1===b?m.indexOf("="):b+1,T,S;-1===E?(T=r.decoder(m,a.decoder,v,"key"),S=r.strictNullHandling?null:""):(T=r.decoder(m.slice(0,E),a.decoder,v,"key"),S=n.maybeMap(u(m.slice(E+1),r),function(e){return r.decoder(e,a.decoder,v,"value")})),S&&r.interpretNumericEntities&&"iso-8859-1"===v&&(S=s(S)),m.indexOf("[]=")>-1&&(S=o(S)?[S]:S),i.call(l,T)?l[T]=n.combine(l[T],S):l[T]=S}return l},p=function(e,t,r,n){for(var i=n?t:u(t,r),o=e.length-1;o>=0;--o){var a,s=e[o];if("[]"===s&&r.parseArrays)a=[].concat(i);else{a=r.plainObjects?Object.create(null):{};var c="["===s.charAt(0)&&"]"===s.charAt(s.length-1)?s.slice(1,-1):s,f=parseInt(c,10);r.parseArrays||""!==c?!isNaN(f)&&s!==c&&String(f)===c&&f>=0&&r.parseArrays&&f<=r.arrayLimit?(a=[])[f]=i:"__proto__"!==c&&(a[c]=i):a={0:i}}i=a}return i},h=function e(t,r,n,o){if(t){var a=n.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,s=/(\[[^[\]]*])/,u=/(\[[^[\]]*])/g,c=n.depth>0&&s.exec(a),f=c?a.slice(0,c.index):a,l=[];if(f){if(!n.plainObjects&&i.call(Object.prototype,f)&&!n.allowPrototypes)return;l.push(f)}for(var h=0;n.depth>0&&null!==(c=u.exec(a))&&h<n.depth;){if(h+=1,!n.plainObjects&&i.call(Object.prototype,c[1].slice(1,-1))&&!n.allowPrototypes)return;l.push(c[1])}return c&&l.push("["+a.slice(c.index)+"]"),p(l,r,n,o)}},d=function e(t){if(!t)return a;if(null!==t.decoder&&void 0!==t.decoder&&"function"!=typeof t.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=void 0===t.charset?a.charset:t.charset;return{allowDots:void 0===t.allowDots?a.allowDots:!!t.allowDots,allowPrototypes:"boolean"==typeof t.allowPrototypes?t.allowPrototypes:a.allowPrototypes,arrayLimit:"number"==typeof t.arrayLimit?t.arrayLimit:a.arrayLimit,charset:r,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:a.charsetSentinel,comma:"boolean"==typeof t.comma?t.comma:a.comma,decoder:"function"==typeof t.decoder?t.decoder:a.decoder,delimiter:"string"==typeof t.delimiter||n.isRegExp(t.delimiter)?t.delimiter:a.delimiter,depth:"number"==typeof t.depth||!1===t.depth?+t.depth:a.depth,ignoreQueryPrefix:!0===t.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof t.interpretNumericEntities?t.interpretNumericEntities:a.interpretNumericEntities,parameterLimit:"number"==typeof t.parameterLimit?t.parameterLimit:a.parameterLimit,parseArrays:!1!==t.parseArrays,plainObjects:"boolean"==typeof t.plainObjects?t.plainObjects:a.plainObjects,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:a.strictNullHandling}};e.exports=function(e,t){var r=d(t);if(""===e||null==e)return r.plainObjects?Object.create(null):{};for(var i="string"==typeof e?l(e,r):e,o=r.plainObjects?Object.create(null):{},a=Object.keys(i),s=0;s<a.length;++s){var u=a[s],c=h(u,i[u],r,"string"==typeof e);o=n.merge(o,c,r)}return n.compact(o)}},function(e,t,r){"use strict";function n(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=s(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function e(){};return{s:i,n:function t(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function e(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function t(){r=r.call(e)},n:function e(){var t=r.next();return a=t.done,t},e:function e(t){u=!0,o=t},f:function e(){try{a||null==r.return||r.return()}finally{if(u)throw o}}}}function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function o(e){return c(e)||u(e)||s(e)||a()}function a(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function s(e,t){if(e){if("string"==typeof e)return f(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?f(e,t):void 0}}function u(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function c(e){if(Array.isArray(e))return f(e)}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function l(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",i=r.toStringTag||"@@toStringTag";function o(r,n,i,o){var u=n&&n.prototype instanceof s?n:s,c=Object.create(u.prototype);return p(c,"_invoke",function(r,n,i){var o,s,u,c=0,f=i||[],l=!1,p={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function t(r,n){return o=r,s=0,u=e,p.n=n,a}};function h(r,n){for(s=r,u=n,t=0;!l&&c&&!i&&t<f.length;t++){var i,o=f[t],h=p.p,d=o[2];r>3?(i=d===n)&&(u=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=h&&((i=r<2&&h<o[1])?(s=0,p.v=n,p.n=o[1]):h<d&&(i=r<3||o[0]>n||n>d)&&(o[4]=r,o[5]=n,p.n=d,s=0))}if(i||r>1)return a;throw l=!0,n}return function(i,f,d){if(c>1)throw TypeError("Generator is already running");for(l&&1===f&&h(f,d),s=f,u=d;(t=s<2?e:u)||!l;){o||(s?s<3?(s>1&&(p.n=-1),h(s,u)):p.n=u:p.v=u);try{if(c=2,o){if(s||(i="next"),t=o[i]){if(!(t=t.call(o,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(u=TypeError("The iterator does not provide a '"+i+"' method"),s=1);o=e}else if((t=(l=p.n<0)?u:r.call(n,p))!==a)break}catch(t){o=e,s=1,u=t}finally{c=1}}return{value:t,done:l}}}(r,i,o),!0),c}var a={};function s(){}function u(){}function c(){}t=Object.getPrototypeOf;var f=[][n]?t(t([][n]())):(p(t={},n,function(){return this}),t),h=c.prototype=s.prototype=Object.create(f);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,p(e,i,"GeneratorFunction")),e.prototype=Object.create(h),e}return u.prototype=c,p(h,"constructor",c),p(c,"constructor",u),u.displayName="GeneratorFunction",p(c,i,"GeneratorFunction"),p(h),p(h,i,"Generator"),p(h,n,function(){return this}),p(h,"toString",function(){return"[object Generator]"}),(l=function e(){return{w:o,m:d}})()}function p(e,t,r,n){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}p=function e(t,r,n,o){function a(e,r){p(t,e,function(t){return this._invoke(e,r,t)})}r?i?i(t,r,{value:n,enumerable:!o,configurable:!o,writable:!o}):t[r]=n:(a("next",0),a("throw",1),a("return",2))},p(e,t,r,n)}function h(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function d(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?h(Object(r),!0).forEach(function(t){y(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):h(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function y(e,t,r){return(t=T(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function g(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function v(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var o=e.apply(t,r);function a(e){g(o,n,i,a,s,"next",e)}function s(e){g(o,n,i,a,s,"throw",e)}a(void 0)})}}function m(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function b(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,T(n.key),n)}}function E(e,t,r){return t&&b(e.prototype,t),r&&b(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function T(e){var t=S(e,"string");return"symbol"==i(t)?t:t+""}function S(e,t){if("object"!=i(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var w=r(66),C=r(67),_=r(129),I=_.extendContextLoader,A=_.strictDocumentLoader,R,O=r(177).serializeError,P=r(181),B=r(130);function k(e){return N.apply(this,arguments)}function N(){return(N=v(l().m(function e(t){var r,n,i,o,a,s,u;return l().w(function(e){for(;;)switch(e.n){case 0:if(r=t.document,n=t.legacy,i=t.documentLoader,o=t.expansionMap,a=t.compactProof,s=n?"signature":"proof",!a){e.n=2;break}return e.n=1,C.compact(r,w.SECURITY_CONTEXT_URL,{documentLoader:i,expansionMap:o,compactToRelative:!1});case 1:r=e.v;case 2:if(u=C.getValues(r,s),delete r[s],0!==u.length){e.n=3;break}throw new Error("No matching proofs found in the given document.");case 3:return u=u.map(function(e){return d({"@context":w.SECURITY_CONTEXT_URL},e)}),e.a(2,{proofSet:u,document:r})}},e)}))).apply(this,arguments)}function U(e){return D.apply(this,arguments)}function D(){return D=v(l().m(function e(t){var r,i,o,a,s,u,c,f,p;return l().w(function(e){for(;;)switch(e.n){case 0:return r=t.document,i=t.suites,o=t.proofSet,a=t.purpose,s=t.documentLoader,u=t.expansionMap,c=t.compactProof,e.n=1,Promise.all(o.map(function(e){return a.match(e,{document:r,documentLoader:s,expansionMap:u})}));case 1:if(f=e.v,0!==(p=o.filter(function(e,t){return f[t]})).length){e.n=2;break}return e.a(2,[]);case 2:return e.n=3,Promise.all(p.map(function(){var e=v(l().m(function e(t){var o,f,p,h;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:o=n(i),e.p=1,o.s();case 2:if((f=o.n()).done){e.n=5;break}return p=f.value,e.n=3,p.matchProof({proof:t,document:r,documentLoader:s,expansionMap:u});case 3:if(!e.v){e.n=4;break}return e.a(2,p.verifyProof({proof:t,document:r,purpose:a,documentLoader:s,expansionMap:u,compactProof:c}).catch(function(e){return{verified:!1,error:e}}));case 4:e.n=2;break;case 5:e.n=7;break;case 6:e.p=6,h=e.v,o.e(h);case 7:return e.p=7,o.f(),e.f(7);case 8:return e.a(2)}},e,null,[[1,6,7,8]])}));return function(t){return e.apply(this,arguments)}}()));case 3:return e.a(2,e.v.map(function(e,t){return e?(e.error&&x(e.error),d({proof:p[t]},e)):null}).filter(function(e){return e}))}},e)})),D.apply(this,arguments)}function x(e){Object.defineProperty(e,"toJSON",{value:function e(){return O(this)},configurable:!0,writable:!0})}function L(e){return j.apply(this,arguments)}function j(){return(j=v(l().m(function e(t){var r,n,i,o,a,s,u,c,f;return l().w(function(e){for(;;)switch(e.n){case 0:return r=t.document,n=t.documentLoader,i=t.expansionMap,o=C.getValues(r,"@context"),e.n=1,C.compact({"@type":"_:b0"},o,{documentLoader:n,expansionMap:i});case 1:return delete(a=e.v)["@context"],s=Object.keys(a)[0],(u={"@context":o})["@type"]=C.getValues(r,"@type").concat(C.getValues(r,s)),e.n=2,C.expand(u,{documentLoader:n,expansionMap:i});case 2:if(f=e.v[0]){e.n=3;break}f={};case 3:return c=f,e.a(2,{types:C.getValues(c,"@type"),alias:s})}},e)}))).apply(this,arguments)}e.exports=function(){function e(){m(this,e)}return E(e,[{key:"add",value:function(){var e=v(l().m(function e(t){var r,n,i,o,a,s,u,c,f,p,h,g,v,m,b,E,T,S=arguments;return l().w(function(e){for(;;)switch(e.n){case 0:if(n=(r=S.length>1&&void 0!==S[1]?S[1]:{}).suite,i=r.purpose,o=r.documentLoader,a=r.expansionMap,s=r.compactProof,u=void 0===s||s,n){e.n=1;break}throw new TypeError('"options.suite" is required.');case 1:if(i){e.n=2;break}throw new TypeError('"options.purpose" is required.');case 2:if(!n.legacy){e.n=3;break}if(i instanceof B){e.n=3;break}throw new TypeError('The "'.concat(n.type,'" suite requires "options.purpose" to be ')+'an instance of "PublicKeyProofPurpose".');case 3:if(o=o?I(o):A,!1!==a&&(a=P),"string"!=typeof t){e.n=5;break}return e.n=4,o(t);case 4:t=e.v;case 5:if(!u){e.n=7;break}return e.n=6,C.compact(t,w.SECURITY_CONTEXT_URL,{documentLoader:o,expansionMap:a,compactToRelative:!1});case 6:c=e.v,e.n=8;break;case 7:c=d({},t);case 8:return f=n.legacy?"signature":"proof",delete c[f],e.n=9,n.createProof({document:c,purpose:i,documentLoader:o,expansionMap:a,compactProof:u});case 9:if(p=e.v,!u){e.n=12;break}return h=n.legacy?y({},w.SECURITY_SIGNATURE_URL,p):y({},w.SECURITY_PROOF_URL,{"@graph":p}),e.n=10,L({document:t,documentLoader:o,expansionMap:a});case 10:return g=e.v,v=g.types,m=g.alias,h["@type"]=v,b=C.getValues(t,"@context"),e.n=11,C.compact(h,b,{documentLoader:o,expansionMap:a,compactToRelative:!1});case 11:delete(E=e.v)[m],delete E["@context"],T=Object.keys(E)[0],C.addValue(t,T,E[T]),e.n=13;break;case 12:delete p["@context"],C.addValue(t,f,p);case 13:return e.a(2,t)}},e)}));function t(t){return e.apply(this,arguments)}return t}()},{key:"verify",value:function(){var e=v(l().m(function e(t){var r,n,i,a,s,u,c,f,p,h,y,g,v,m,b,E,T,S=arguments,w;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(n=(r=S.length>1&&void 0!==S[1]?S[1]:{}).suite,i=r.purpose,a=r.documentLoader,s=r.expansionMap,u=r.compactProof,c=void 0===u||u,n){e.n=1;break}throw new TypeError('"options.suite" is required.');case 1:if(i){e.n=2;break}throw new TypeError('"options.purpose" is required.');case 2:if(0!==(f=Array.isArray(n)?n:[n]).length){e.n=3;break}throw new TypeError("At least one suite is required.");case 3:if(!(p=f.some(function(e){return e.legacy}))){e.n=5;break}if(!f.some(function(e){return!e.legacy})){e.n=4;break}throw new Error("Legacy suites may not be combined with current suites.");case 4:if(i instanceof B){e.n=5;break}throw new TypeError('"options.purpose" must be an instance of "PublicKeyProofPurpose"to use a legacy suite.');case 5:if(a=a?I(a):A,!1!==s&&(s=P),e.p=6,"string"!=typeof t){e.n=8;break}return e.n=7,a(t);case 7:t=e.v,e.n=9;break;case 8:t=d({},t);case 9:return e.n=10,k({document:t,legacy:p,documentLoader:a,expansionMap:s,compactProof:c});case 10:return h=e.v,y=h.proofSet,g=h.document,t=g,e.n=11,U({document:t,suites:f,proofSet:y,purpose:i,documentLoader:a,expansionMap:s,compactProof:c});case 11:if(0!==(v=e.v).length){e.n=12;break}throw new Error("Could not verify any proofs; no proofs matched the required suite and purpose.");case 12:if(m=v.some(function(e){return e.verified})){e.n=13;break}return E=(b=[]).concat.apply(b,o(v.filter(function(e){return e.error}).map(function(e){return e.error}))),T={verified:m,results:v},E.length>0&&(T.error=E),e.a(2,T);case 13:return e.a(2,{verified:m,results:v});case 14:return e.p=14,x(w=e.v),e.a(2,{verified:!1,error:w})}},e,null,[[6,14]])}));function t(t){return e.apply(this,arguments)}return t}()}])}()},function(e,t,r){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e,t,r){return(t=o(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e){var t=a(e,"string");return"symbol"==n(t)?t:t+""}function a(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var s=r(66),u,c=r(70).contexts;e.exports=i(i({},s.SECURITY_CONTEXT_V1_URL,c.get(s.SECURITY_CONTEXT_V1_URL)),s.SECURITY_CONTEXT_V2_URL,c.get(s.SECURITY_CONTEXT_V2_URL))},function(e,t,r){"use strict";const{inspect:n}=r(178);class i extends Error{constructor(e){super(n(e)),this.name="NonError",Error.captureStackTrace(this,i)}}const o=["name","message","stack","code"],a=(e,t,r)=>{const n=r||(Array.isArray(e)?[]:{});t.push(e);for(const[r,i]of Object.entries(e))"function"!=typeof i&&(i&&"object"==typeof i?t.includes(e[r])?n[r]="[Circular]":n[r]=a(e[r],t.slice()):n[r]=i);for(const t of o)"string"==typeof e[t]&&(n[t]=e[t]);return n},s=e=>"object"==typeof e&&null!==e?a(e,[]):"function"==typeof e?`[Function: ${e.name||"anonymous"}]`:e,u=e=>{if(e instanceof Error)return e;if("object"==typeof e&&null!==e&&!Array.isArray(e)){const t=new Error;return a(e,[],t),t}return new i(e)};e.exports={serializeError:s,deserializeError:u}},function(e,t,r){(function(e){var n=Object.getOwnPropertyDescriptors||function e(t){for(var r=Object.keys(t),n={},i=0;i<r.length;i++)n[r[i]]=Object.getOwnPropertyDescriptor(t,r[i]);return n},i=/%[sdj%]/g;t.format=function(e){if(!S(e)){for(var t=[],r=0;r<arguments.length;r++)t.push(s(arguments[r]));return t.join(" ")}for(var r=1,n=arguments,o=n.length,a=String(e).replace(i,function(e){if("%%"===e)return"%";if(r>=o)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}}),u=n[r];r<o;u=n[++r])b(u)||!I(u)?a+=" "+u:a+=" "+s(u);return a},t.deprecate=function(r,n){if(void 0!==e&&!0===e.noDeprecation)return r;if(void 0===e)return function(){return t.deprecate(r,n).apply(this,arguments)};var i=!1;function o(){if(!i){if(e.throwDeprecation)throw new Error(n);e.traceDeprecation?console.trace(n):console.error(n),i=!0}return r.apply(this,arguments)}return o};var o={},a;function s(e,r){var n={seen:[],stylize:c};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),m(r)?n.showHidden=r:r&&t._extend(n,r),C(n.showHidden)&&(n.showHidden=!1),C(n.depth)&&(n.depth=2),C(n.colors)&&(n.colors=!1),C(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=u),l(n,e,n.depth)}function u(e,t){var r=s.styles[t];return r?"["+s.colors[r][0]+"m"+e+"["+s.colors[r][1]+"m":e}function c(e,t){return e}function f(e){var t={};return e.forEach(function(e,r){t[e]=!0}),t}function l(e,r,n){if(e.customInspect&&r&&O(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,e);return S(i)||(i=l(e,i,n)),i}var o=p(e,r);if(o)return o;var a=Object.keys(r),s=f(a);if(e.showHidden&&(a=Object.getOwnPropertyNames(r)),R(r)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return h(r);if(0===a.length){if(O(r)){var u=r.name?": "+r.name:"";return e.stylize("[Function"+u+"]","special")}if(_(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(A(r))return e.stylize(Date.prototype.toString.call(r),"date");if(R(r))return h(r)}var c="",m=!1,b=["{","}"],E,T;(v(r)&&(m=!0,b=["[","]"]),O(r))&&(c=" [Function"+(r.name?": "+r.name:"")+"]");return _(r)&&(c=" "+RegExp.prototype.toString.call(r)),A(r)&&(c=" "+Date.prototype.toUTCString.call(r)),R(r)&&(c=" "+h(r)),0!==a.length||m&&0!=r.length?n<0?_(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),T=m?d(e,r,n,s,a):a.map(function(t){return y(e,r,n,s,t,m)}),e.seen.pop(),g(T,c,b)):b[0]+c+b[1]}function p(e,t){if(C(t))return e.stylize("undefined","undefined");if(S(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}return T(t)?e.stylize(""+t,"number"):m(t)?e.stylize(""+t,"boolean"):b(t)?e.stylize("null","null"):void 0}function h(e){return"["+Error.prototype.toString.call(e)+"]"}function d(e,t,r,n,i){for(var o=[],a=0,s=t.length;a<s;++a)D(t,String(a))?o.push(y(e,t,r,n,String(a),!0)):o.push("");return i.forEach(function(i){i.match(/^\d+$/)||o.push(y(e,t,r,n,i,!0))}),o}function y(e,t,r,n,i,o){var a,s,u;if((u=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?s=u.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):u.set&&(s=e.stylize("[Setter]","special")),D(n,i)||(a="["+i+"]"),s||(e.seen.indexOf(u.value)<0?(s=b(r)?l(e,u.value,null):l(e,u.value,r-1)).indexOf("\n")>-1&&(s=o?s.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+s.split("\n").map(function(e){return" "+e}).join("\n")):s=e.stylize("[Circular]","special")),C(a)){if(o&&i.match(/^\d+$/))return s;(a=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+s}function g(e,t,r){var n=0,i;return e.reduce(function(e,t){return n++,t.indexOf("\n")>=0&&n++,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}function v(e){return Array.isArray(e)}function m(e){return"boolean"==typeof e}function b(e){return null===e}function E(e){return null==e}function T(e){return"number"==typeof e}function S(e){return"string"==typeof e}function w(e){return"symbol"==typeof e}function C(e){return void 0===e}function _(e){return I(e)&&"[object RegExp]"===B(e)}function I(e){return"object"==typeof e&&null!==e}function A(e){return I(e)&&"[object Date]"===B(e)}function R(e){return I(e)&&("[object Error]"===B(e)||e instanceof Error)}function O(e){return"function"==typeof e}function P(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e}function B(e){return Object.prototype.toString.call(e)}function k(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(r){if(C(a)&&(a=e.env.NODE_DEBUG||""),r=r.toUpperCase(),!o[r])if(new RegExp("\\b"+r+"\\b","i").test(a)){var n=e.pid;o[r]=function(){var e=t.format.apply(t,arguments);console.error("%s %d: %s",r,n,e)}}else o[r]=function(){};return o[r]},t.inspect=s,s.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},s.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=v,t.isBoolean=m,t.isNull=b,t.isNullOrUndefined=E,t.isNumber=T,t.isString=S,t.isSymbol=w,t.isUndefined=C,t.isRegExp=_,t.isObject=I,t.isDate=A,t.isError=R,t.isFunction=O,t.isPrimitive=P,t.isBuffer=r(179);var N=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function U(){var e=new Date,t=[k(e.getHours()),k(e.getMinutes()),k(e.getSeconds())].join(":");return[e.getDate(),N[e.getMonth()],t].join(" ")}function D(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){console.log("%s - %s",U(),t.format.apply(t,arguments))},t.inherits=r(180),t._extend=function(e,t){if(!t||!I(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e};var x="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function L(e,t){if(!e){var r=new Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}function j(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');function r(){for(var r=[],n=0;n<arguments.length;n++)r.push(arguments[n]);var i=r.pop();if("function"!=typeof i)throw new TypeError("The last argument must be of type Function");var o=this,a=function(){return i.apply(o,arguments)};t.apply(this,r).then(function(t){e.nextTick(a,null,t)},function(t){e.nextTick(L,t,a)})}return Object.setPrototypeOf(r,Object.getPrototypeOf(t)),Object.defineProperties(r,n(t)),r}t.promisify=function e(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');if(x&&t[x]){var r;if("function"!=typeof(r=t[x]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(r,x,{value:r,enumerable:!1,writable:!1,configurable:!0}),r}function r(){for(var e,r,n=new Promise(function(t,n){e=t,r=n}),i=[],o=0;o<arguments.length;o++)i.push(arguments[o]);i.push(function(t,n){t?r(t):e(n)});try{t.apply(this,i)}catch(e){r(e)}return n}return Object.setPrototypeOf(r,Object.getPrototypeOf(t)),x&&Object.defineProperty(r,x,{value:r,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(r,n(t))},t.promisify.custom=x,t.callbackify=j}).call(this,r(36))},function(e,t){e.exports=function e(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},function(e,t){"function"==typeof Object.create?e.exports=function e(t,r){t.super_=r,t.prototype=Object.create(r.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function e(t,r){t.super_=r;var n=function(){};n.prototype=r.prototype,t.prototype=new n,t.prototype.constructor=t}},function(e,t,r){"use strict";e.exports=function(e){if(e.unmappedProperty)throw new Error('The property "'+e.unmappedProperty+'" in the input was not defined in the context.')}},function(e,t,r){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a(n.key),n)}}function o(e,t,r){return t&&i(e.prototype,t),r&&i(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function a(e){var t=s(e,"string");return"symbol"==n(t)?t:t+""}function s(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t,r){return t=m(t),f(e,y()?Reflect.construct(t,r||[],m(e).constructor):t.apply(e,r))}function f(e,t){if(t&&("object"==n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return l(e)}function l(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function p(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&v(e,t)}function h(e){var t="function"==typeof Map?new Map:void 0;return h=function e(r){if(null===r||!g(r))return r;if("function"!=typeof r)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(r))return t.get(r);t.set(r,n)}function n(){return d(r,arguments,m(this).constructor)}return n.prototype=Object.create(r.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),v(n,r)},h(e)}function d(e,t,r){if(y())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,t);var i=new(e.bind.apply(e,n));return r&&v(i,r.prototype),i}function y(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(y=function t(){return!!e})()}function g(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}function v(e,t){return v=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},v(e,t)}function m(e){return m=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},m(e)}var b=function(e){function t(e){var r;return u(this,t),(r=c(this,t,["Verification error(s)."])).name="VerificationError",r.errors=[].concat(e),r}return p(t,e),o(t)}(h(Error));e.exports=b},function(e,t,r){"use strict";var n={};e.exports=n,n.suites={Ed25519Signature2018:r(184),JwsLinkedDataSignature:r(114),LinkedDataProof:r(150),LinkedDataSignature:r(115),LinkedDataSignature2015:r(151),GraphSignature2012:r(200),RsaSignature2018:r(201)}},function(e,t,r){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a(n.key),n)}}function o(e,t,r){return t&&i(e.prototype,t),r&&i(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function a(e){var t=s(e,"string");return"symbol"==n(t)?t:t+""}function s(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t,r){return t=h(t),f(e,p()?Reflect.construct(t,r||[],h(e).constructor):t.apply(e,r))}function f(e,t){if(t&&("object"==n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return l(e)}function l(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function p(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(p=function t(){return!!e})()}function h(e){return h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},h(e)}function d(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&y(e,t)}function y(e,t){return y=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},y(e,t)}var g,v=r(73).Ed25519KeyPair,m=r(114);e.exports=function(e){function t(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=r.signer,i=r.key,o=r.creator,a=r.verificationMethod,s=r.proof,f=r.date,l=r.useNativeCanonize;return u(this,t),(e=c(this,t,[{type:"Ed25519Signature2018",alg:"EdDSA",LDKeyClass:v,creator:o,verificationMethod:a,signer:n,key:i,proof:s,date:f,useNativeCanonize:l}])).requiredKeyType="Ed25519VerificationKey2018",e}return d(t,e),o(t)}(m)},function(e,t,r){"use strict";t.byteLength=f,t.toByteArray=p,t.fromByteArray=y;for(var n=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=64;s<u;++s)n[s]=a[s],i[a.charCodeAt(s)]=s;function c(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("="),n;return-1===r&&(r=t),[r,r===t?0:4-r%4]}function f(e){var t=c(e),r=t[0],n=t[1];return 3*(r+n)/4-n}function l(e,t,r){return 3*(t+r)/4-r}function p(e){var t,r=c(e),n=r[0],a=r[1],s=new o(l(e,n,a)),u=0,f=a>0?n-4:n,p;for(p=0;p<f;p+=4)t=i[e.charCodeAt(p)]<<18|i[e.charCodeAt(p+1)]<<12|i[e.charCodeAt(p+2)]<<6|i[e.charCodeAt(p+3)],s[u++]=t>>16&255,s[u++]=t>>8&255,s[u++]=255&t;return 2===a&&(t=i[e.charCodeAt(p)]<<2|i[e.charCodeAt(p+1)]>>4,s[u++]=255&t),1===a&&(t=i[e.charCodeAt(p)]<<10|i[e.charCodeAt(p+1)]<<4|i[e.charCodeAt(p+2)]>>2,s[u++]=t>>8&255,s[u++]=255&t),s}function h(e){return n[e>>18&63]+n[e>>12&63]+n[e>>6&63]+n[63&e]}function d(e,t,r){for(var n,i=[],o=t;o<r;o+=3)n=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(255&e[o+2]),i.push(h(n));return i.join("")}function y(e){for(var t,r=e.length,i=r%3,o=[],a=16383,s=0,u=r-i;s<u;s+=a)o.push(d(e,s,s+a>u?u:s+a));return 1===i?(t=e[r-1],o.push(n[t>>2]+n[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],o.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"=")),o.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(e,t){t.read=function(e,t,r,n,i){var o,a,s=8*i-n-1,u=(1<<s)-1,c=u>>1,f=-7,l=r?i-1:0,p=r?-1:1,h=e[t+l];for(l+=p,o=h&(1<<-f)-1,h>>=-f,f+=s;f>0;o=256*o+e[t+l],l+=p,f-=8);for(a=o&(1<<-f)-1,o>>=-f,f+=n;f>0;a=256*a+e[t+l],l+=p,f-=8);if(0===o)o=1-c;else{if(o===u)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,n),o-=c}return(h?-1:1)*a*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var a,s,u,c=8*o-i-1,f=(1<<c)-1,l=f>>1,p=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:o-1,d=n?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=f):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+l>=1?p/u:p*Math.pow(2,1-l))*u>=2&&(a++,u/=2),a+l>=f?(s=0,a=f):a+l>=1?(s=(t*u-1)*Math.pow(2,i),a+=l):(s=t*Math.pow(2,l-1)*Math.pow(2,i),a=0));i>=8;e[r+h]=255&s,h+=d,s/=256,i-=8);for(a=a<<i|s,c+=i;c>0;e[r+h]=255&a,h+=d,a/=256,c-=8);e[r+h-d]|=128*y}},function(e,t){var r={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==r.call(e)}},function(e,t,r){(function(e,t){!function(e,r){"use strict";if(!e.setImmediate){var n=1,i={},o=!1,a=e.document,s,u=Object.getPrototypeOf&&Object.getPrototypeOf(e);u=u&&u.setTimeout?u:e,"[object process]"==={}.toString.call(e.process)?h():d()?y():e.MessageChannel?g():a&&"onreadystatechange"in a.createElement("script")?v():m(),u.setImmediate=c,u.clearImmediate=f}function c(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),r=0;r<t.length;r++)t[r]=arguments[r+1];var o={callback:e,args:t};return i[n]=o,s(n),n++}function f(e){delete i[e]}function l(e){var t=e.callback,n=e.args;switch(n.length){case 0:t();break;case 1:t(n[0]);break;case 2:t(n[0],n[1]);break;case 3:t(n[0],n[1],n[2]);break;default:t.apply(r,n)}}function p(e){if(o)setTimeout(p,0,e);else{var t=i[e];if(t){o=!0;try{l(t)}finally{f(e),o=!1}}}}function h(){s=function(e){t.nextTick(function(){p(e)})}}function d(){if(e.postMessage&&!e.importScripts){var t=!0,r=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=r,t}}function y(){var t="setImmediate$"+Math.random()+"$",r=function(r){r.source===e&&"string"==typeof r.data&&0===r.data.indexOf(t)&&p(+r.data.slice(t.length))};e.addEventListener?e.addEventListener("message",r,!1):e.attachEvent("onmessage",r),s=function(r){e.postMessage(t+r,"*")}}function g(){var e=new MessageChannel;e.port1.onmessage=function(e){var t;p(e.data)},s=function(t){e.port2.postMessage(t)}}function v(){var e=a.documentElement;s=function(t){var r=a.createElement("script");r.onreadystatechange=function(){p(t),r.onreadystatechange=null,e.removeChild(r),r=null},e.appendChild(r)}}function m(){s=function(e){setTimeout(p,0,e)}}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,r(29),r(36))},function(e,t,r){(function(t){var r={};e.exports=r;var n={};function i(e,t){var r=0,n=t.length,i=t.charAt(0),o=[0];for(r=0;r<e.length();++r){for(var a=0,s=e.at(r);a<o.length;++a)s+=o[a]<<8,o[a]=s%n,s=s/n|0;for(;s>0;)o.push(s%n),s=s/n|0}var u="";for(r=0;0===e.at(r)&&r<e.length()-1;++r)u+=i;for(r=o.length-1;r>=0;--r)u+=t[o[r]];return u}r.encode=function(e,t,r){if("string"!=typeof t)throw new TypeError('"alphabet" must be a string.');if(void 0!==r&&"number"!=typeof r)throw new TypeError('"maxline" must be a number.');var n="";if(e instanceof Uint8Array){var o=0,a=t.length,s=t.charAt(0),u=[0];for(o=0;o<e.length;++o){for(var c=0,f=e[o];c<u.length;++c)f+=u[c]<<8,u[c]=f%a,f=f/a|0;for(;f>0;)u.push(f%a),f=f/a|0}for(o=0;0===e[o]&&o<e.length-1;++o)n+=s;for(o=u.length-1;o>=0;--o)n+=t[u[o]]}else n=i(e,t);if(r){var l=new RegExp(".{1,"+r+"}","g");n=n.match(l).join("\r\n")}return n},r.decode=function(e,r){if("string"!=typeof e)throw new TypeError('"input" must be a string.');if("string"!=typeof r)throw new TypeError('"alphabet" must be a string.');var i=n[r];if(!i){i=n[r]=[];for(var o=0;o<r.length;++o)i[r.charCodeAt(o)]=o}e=e.replace(/\s/g,"");for(var a=r.length,s=r.charAt(0),u=[0],o=0;o<e.length;o++){var c=i[e.charCodeAt(o)];if(void 0===c)return;for(var f=0,l=c;f<u.length;++f)l+=u[f]*a,u[f]=255&l,l>>=8;for(;l>0;)u.push(255&l),l>>=8}for(var p=0;e[p]===s&&p<e.length-1;++p)u.push(0);return void 0!==t?t.from(u.reverse()):new Uint8Array(u.reverse())}}).call(this,r(74).Buffer)},function(e,t,r){var n=r(4);r(48),r(136);var i=e.exports=n.tls;function o(e,t,r){var o=t.entity===n.tls.ConnectionEnd.client;e.read.cipherState={init:!1,cipher:n.cipher.createDecipher("AES-CBC",o?r.keys.server_write_key:r.keys.client_write_key),iv:o?r.keys.server_write_IV:r.keys.client_write_IV},e.write.cipherState={init:!1,cipher:n.cipher.createCipher("AES-CBC",o?r.keys.client_write_key:r.keys.server_write_key),iv:o?r.keys.client_write_IV:r.keys.server_write_IV},e.read.cipherFunction=c,e.write.cipherFunction=a,e.read.macLength=e.write.macLength=r.mac_length,e.read.macFunction=e.write.macFunction=i.hmac_sha1}function a(e,t){var r=!1,o=t.macFunction(t.macKey,t.sequenceNumber,e),a;e.fragment.putBytes(o),t.updateSequenceNumber(),a=e.version.minor===i.Versions.TLS_1_0.minor?t.cipherState.init?null:t.cipherState.iv:n.random.getBytesSync(16),t.cipherState.init=!0;var u=t.cipherState.cipher;return u.start({iv:a}),e.version.minor>=i.Versions.TLS_1_1.minor&&u.output.putBytes(a),u.update(e.fragment),u.finish(s)&&(e.fragment=u.output,e.length=e.fragment.length(),r=!0),r}function s(e,t,r){if(!r){var n=e-t.length()%e;t.fillWithByte(n-1,n)}return!0}function u(e,t,r){var n=!0;if(r){for(var i=t.length(),o=t.last(),a=i-1-o;a<i-1;++a)n=n&&t.at(a)==o;n&&t.truncate(o+1)}return n}function c(e,t){var r=!1,o;o=e.version.minor===i.Versions.TLS_1_0.minor?t.cipherState.init?null:t.cipherState.iv:e.fragment.getBytes(16),t.cipherState.init=!0;var a=t.cipherState.cipher;a.start({iv:o}),a.update(e.fragment),r=a.finish(u);var s=t.macLength,c=n.random.getBytesSync(s),l=a.output.length();l>=s?(e.fragment=a.output.getBytes(l-s),c=a.output.getBytes(s)):e.fragment=a.output.getBytes(),e.fragment=n.util.createBuffer(e.fragment),e.length=e.fragment.length();var p=t.macFunction(t.macKey,t.sequenceNumber,e);return t.updateSequenceNumber(),r=f(t.macKey,c,p)&&r}function f(e,t,r){var i=n.hmac.create();return i.start("SHA1",e),i.update(t),t=i.digest().getBytes(),i.start(null,null),i.update(r),t===(r=i.digest().getBytes())}i.CipherSuites.TLS_RSA_WITH_AES_128_CBC_SHA={id:[0,47],name:"TLS_RSA_WITH_AES_128_CBC_SHA",initSecurityParameters:function(e){e.bulk_cipher_algorithm=i.BulkCipherAlgorithm.aes,e.cipher_type=i.CipherType.block,e.enc_key_length=16,e.block_length=16,e.fixed_iv_length=16,e.record_iv_length=16,e.mac_algorithm=i.MACAlgorithm.hmac_sha1,e.mac_length=20,e.mac_key_length=20},initConnectionState:o},i.CipherSuites.TLS_RSA_WITH_AES_256_CBC_SHA={id:[0,53],name:"TLS_RSA_WITH_AES_256_CBC_SHA",initSecurityParameters:function(e){e.bulk_cipher_algorithm=i.BulkCipherAlgorithm.aes,e.cipher_type=i.CipherType.block,e.enc_key_length=32,e.block_length=16,e.fixed_iv_length=16,e.record_iv_length=16,e.mac_algorithm=i.MACAlgorithm.hmac_sha1,e.mac_length=20,e.mac_key_length=20},initConnectionState:o}},function(e,t,r){var n=r(4);r(146),e.exports=n.mgf=n.mgf||{},n.mgf.mgf1=n.mgf1},function(e,t,r){(function(t){var n=r(4);r(77),r(31),r(148),r(8);var i=r(193),o=i.publicKeyValidator,a=i.privateKeyValidator;if(void 0===s)var s=n.jsbn.BigInteger;var u=n.util.ByteBuffer,c=void 0===t?Uint8Array:t;n.pki=n.pki||{},e.exports=n.pki.ed25519=n.ed25519=n.ed25519||{};var f=n.ed25519;function l(e){var r=e.message;if(r instanceof Uint8Array||r instanceof c)return r;var n=e.encoding;if(void 0===r){if(!e.md)throw new TypeError('"options.message" or "options.md" not specified.');r=e.md.digest().getBytes(),n="binary"}if("string"==typeof r&&!n)throw new TypeError('"options.encoding" must be "binary" or "utf8".');if("string"==typeof r){if(void 0!==t)return t.from(r,n);r=new u(r,n)}else if(!(r instanceof u))throw new TypeError('"options.message" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a string with "options.encoding" specifying its encoding.');for(var i=new c(r.length()),o=0;o<i.length;++o)i[o]=r.at(o);return i}f.constants={},f.constants.PUBLIC_KEY_BYTE_LENGTH=32,f.constants.PRIVATE_KEY_BYTE_LENGTH=64,f.constants.SEED_BYTE_LENGTH=32,f.constants.SIGN_BYTE_LENGTH=64,f.constants.HASH_BYTE_LENGTH=64,f.generateKeyPair=function(e){var t=(e=e||{}).seed;if(void 0===t)t=n.random.getBytesSync(f.constants.SEED_BYTE_LENGTH);else if("string"==typeof t){if(t.length!==f.constants.SEED_BYTE_LENGTH)throw new TypeError('"seed" must be '+f.constants.SEED_BYTE_LENGTH+" bytes in length.")}else if(!(t instanceof Uint8Array))throw new TypeError('"seed" must be a node.js Buffer, Uint8Array, or a binary string.');t=l({message:t,encoding:"binary"});for(var r=new c(f.constants.PUBLIC_KEY_BYTE_LENGTH),i=new c(f.constants.PRIVATE_KEY_BYTE_LENGTH),o=0;o<32;++o)i[o]=t[o];return T(r,i),{publicKey:r,privateKey:i}},f.privateKeyFromAsn1=function(e){var t={},r=[],i;if(!n.asn1.validate(e,a,t,r)){var o=new Error("Invalid Key.");throw o.errors=r,o}var s=n.asn1.derToOid(t.privateKeyOid),u=n.oids.EdDSA25519;if(s!==u)throw new Error('Invalid OID "'+s+'"; OID must be "'+u+'".');var c=t.privateKey,f;return{privateKeyBytes:l({message:n.asn1.fromDer(c).value,encoding:"binary"})}},f.publicKeyFromAsn1=function(e){var t={},r=[],i;if(!n.asn1.validate(e,o,t,r)){var a=new Error("Invalid Key.");throw a.errors=r,a}var s=n.asn1.derToOid(t.publicKeyOid),u=n.oids.EdDSA25519;if(s!==u)throw new Error('Invalid OID "'+s+'"; OID must be "'+u+'".');var c=t.ed25519PublicKey;if(c.length!==f.constants.PUBLIC_KEY_BYTE_LENGTH)throw new Error("Key length is invalid.");return l({message:c,encoding:"binary"})},f.publicKeyFromPrivateKey=function(e){var t=l({message:(e=e||{}).privateKey,encoding:"binary"});if(t.length!==f.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+f.constants.PRIVATE_KEY_BYTE_LENGTH);for(var r=new c(f.constants.PUBLIC_KEY_BYTE_LENGTH),n=0;n<r.length;++n)r[n]=t[32+n];return r},f.sign=function(e){var t=l(e=e||{}),r=l({message:e.privateKey,encoding:"binary"}),n;if(r.length===f.constants.SEED_BYTE_LENGTH)r=f.generateKeyPair({seed:r}).privateKey;else if(r.length!==f.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+f.constants.SEED_BYTE_LENGTH+" or "+f.constants.PRIVATE_KEY_BYTE_LENGTH);var i=new c(f.constants.SIGN_BYTE_LENGTH+t.length);S(i,t,t.length,r);for(var o=new c(f.constants.SIGN_BYTE_LENGTH),a=0;a<o.length;++a)o[a]=i[a];return o},f.verify=function(e){var t=l(e=e||{});if(void 0===e.signature)throw new TypeError('"options.signature" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a binary string.');var r=l({message:e.signature,encoding:"binary"});if(r.length!==f.constants.SIGN_BYTE_LENGTH)throw new TypeError('"options.signature" must have a byte length of '+f.constants.SIGN_BYTE_LENGTH);var n=l({message:e.publicKey,encoding:"binary"});if(n.length!==f.constants.PUBLIC_KEY_BYTE_LENGTH)throw new TypeError('"options.publicKey" must have a byte length of '+f.constants.PUBLIC_KEY_BYTE_LENGTH);var i=new c(f.constants.SIGN_BYTE_LENGTH+t.length),o=new c(f.constants.SIGN_BYTE_LENGTH+t.length),a;for(a=0;a<f.constants.SIGN_BYTE_LENGTH;++a)i[a]=r[a];for(a=0;a<t.length;++a)i[a+f.constants.SIGN_BYTE_LENGTH]=t[a];return w(o,i,i.length,n)>=0};var p=H(),h=H([1]),d=H([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),y=H([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),g=H([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),v=H([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),m=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]),b=H([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function E(e,r){var i=n.md.sha512.create(),o=new u(e);i.update(o.getBytes(r),"binary");var a=i.digest().getBytes();if(void 0!==t)return t.from(a,"binary");for(var s=new c(f.constants.HASH_BYTE_LENGTH),l=0;l<64;++l)s[l]=a.charCodeAt(l);return s}function T(e,t){var r=[H(),H(),H(),H()],n,i=E(t,32);for(i[0]&=248,i[31]&=127,i[31]|=64,j(r,i),R(e,r),n=0;n<32;++n)t[n+32]=e[n];return 0}function S(e,t,r,n){var i,o,a=new Float64Array(64),s=[H(),H(),H(),H()],u=E(n,32);u[0]&=248,u[31]&=127,u[31]|=64;var c=r+64;for(i=0;i<r;++i)e[64+i]=t[i];for(i=0;i<32;++i)e[32+i]=u[32+i];var f=E(e.subarray(32),r+32);for(_(f),j(s,f),R(e,s),i=32;i<64;++i)e[i]=n[i];var l=E(e,r+64);for(_(l),i=32;i<64;++i)a[i]=0;for(i=0;i<32;++i)a[i]=f[i];for(i=0;i<32;++i)for(o=0;o<32;o++)a[i+o]+=l[i]*u[o];return C(e.subarray(32),a),c}function w(e,t,r,n){var i,o,a=new c(32),s=[H(),H(),H(),H()],u=[H(),H(),H(),H()];if(o=-1,r<64)return-1;if(P(u,n))return-1;for(i=0;i<r;++i)e[i]=t[i];for(i=0;i<32;++i)e[i+32]=n[i];var f=E(e,r);if(_(f),L(s,u,f),j(u,t.subarray(32)),I(s,u),R(a,s),r-=64,U(t,0,a,0)){for(i=0;i<r;++i)e[i]=0;return-1}for(i=0;i<r;++i)e[i]=t[i+64];return o=r}function C(e,t){var r,n,i,o;for(n=63;n>=32;--n){for(r=0,i=n-32,o=n-12;i<o;++i)t[i]+=r-16*t[n]*m[i-(n-32)],r=t[i]+128>>8,t[i]-=256*r;t[i]+=r,t[n]=0}for(r=0,i=0;i<32;++i)t[i]+=r-(t[31]>>4)*m[i],r=t[i]>>8,t[i]&=255;for(i=0;i<32;++i)t[i]-=r*m[i];for(n=0;n<32;++n)t[n+1]+=t[n]>>8,e[n]=255&t[n]}function _(e){for(var t=new Float64Array(64),r=0;r<64;++r)t[r]=e[r],e[r]=0;C(e,t)}function I(e,t){var r=H(),n=H(),i=H(),o=H(),a=H(),s=H(),u=H(),c=H(),f=H();G(r,e[1],e[0]),G(f,t[1],t[0]),Y(r,r,f),q(n,e[0],e[1]),q(f,t[0],t[1]),Y(n,n,f),Y(i,e[3],t[3]),Y(i,i,y),Y(o,e[2],t[2]),q(o,o,o),G(a,n,r),G(s,o,i),q(u,o,i),q(c,n,r),Y(e[0],a,s),Y(e[1],c,u),Y(e[2],u,s),Y(e[3],a,c)}function A(e,t,r){for(var n=0;n<4;++n)K(e[n],t[n],r)}function R(e,t){var r=H(),n=H(),i=H();V(i,t[2]),Y(r,t[0],i),Y(n,t[1],i),O(e,n),e[31]^=x(r)<<7}function O(e,t){var r,n,i,o=H(),a=H();for(r=0;r<16;++r)a[r]=t[r];for(F(a),F(a),F(a),n=0;n<2;++n){for(o[0]=a[0]-65517,r=1;r<15;++r)o[r]=a[r]-65535-(o[r-1]>>16&1),o[r-1]&=65535;o[15]=a[15]-32767-(o[14]>>16&1),i=o[15]>>16&1,o[14]&=65535,K(a,o,1-i)}for(r=0;r<16;r++)e[2*r]=255&a[r],e[2*r+1]=a[r]>>8}function P(e,t){var r=H(),n=H(),i=H(),o=H(),a=H(),s=H(),u=H();return M(e[2],h),B(e[1],t),z(i,e[1]),Y(o,i,d),G(i,i,e[2]),q(o,e[2],o),z(a,o),z(s,a),Y(u,s,a),Y(r,u,i),Y(r,r,o),k(r,r),Y(r,r,i),Y(r,r,o),Y(r,r,o),Y(e[0],r,o),z(n,e[0]),Y(n,n,o),N(n,i)&&Y(e[0],e[0],b),z(n,e[0]),Y(n,n,o),N(n,i)?-1:(x(e[0])===t[31]>>7&&G(e[0],p,e[0]),Y(e[3],e[0],e[1]),0)}function B(e,t){var r;for(r=0;r<16;++r)e[r]=t[2*r]+(t[2*r+1]<<8);e[15]&=32767}function k(e,t){var r=H(),n;for(n=0;n<16;++n)r[n]=t[n];for(n=250;n>=0;--n)z(r,r),1!==n&&Y(r,r,t);for(n=0;n<16;++n)e[n]=r[n]}function N(e,t){var r=new c(32),n=new c(32);return O(r,e),O(n,t),U(r,0,n,0)}function U(e,t,r,n){return D(e,t,r,n,32)}function D(e,t,r,n,i){var o,a=0;for(o=0;o<i;++o)a|=e[t+o]^r[n+o];return(1&a-1>>>8)-1}function x(e){var t=new c(32);return O(t,e),1&t[0]}function L(e,t,r){var n,i;for(M(e[0],p),M(e[1],h),M(e[2],h),M(e[3],p),i=255;i>=0;--i)A(e,t,n=r[i/8|0]>>(7&i)&1),I(t,e),I(e,e),A(e,t,n)}function j(e,t){var r=[H(),H(),H(),H()];M(r[0],g),M(r[1],v),M(r[2],h),Y(r[3],g,v),L(e,r,t)}function M(e,t){var r;for(r=0;r<16;r++)e[r]=0|t[r]}function V(e,t){var r=H(),n;for(n=0;n<16;++n)r[n]=t[n];for(n=253;n>=0;--n)z(r,r),2!==n&&4!==n&&Y(r,r,t);for(n=0;n<16;++n)e[n]=r[n]}function F(e){var t,r,n=1;for(t=0;t<16;++t)r=e[t]+n+65535,n=Math.floor(r/65536),e[t]=r-65536*n;e[0]+=n-1+37*(n-1)}function K(e,t,r){for(var n,i=~(r-1),o=0;o<16;++o)n=i&(e[o]^t[o]),e[o]^=n,t[o]^=n}function H(e){var t,r=new Float64Array(16);if(e)for(t=0;t<e.length;++t)r[t]=e[t];return r}function q(e,t,r){for(var n=0;n<16;++n)e[n]=t[n]+r[n]}function G(e,t,r){for(var n=0;n<16;++n)e[n]=t[n]-r[n]}function z(e,t){Y(e,t,t)}function Y(e,t,r){var n,i,o=0,a=0,s=0,u=0,c=0,f=0,l=0,p=0,h=0,d=0,y=0,g=0,v=0,m=0,b=0,E=0,T=0,S=0,w=0,C=0,_=0,I=0,A=0,R=0,O=0,P=0,B=0,k=0,N=0,U=0,D=0,x=r[0],L=r[1],j=r[2],M=r[3],V=r[4],F=r[5],K=r[6],H=r[7],q=r[8],G=r[9],z=r[10],Y=r[11],W=r[12],Q=r[13],X=r[14],Z=r[15];o+=(n=t[0])*x,a+=n*L,s+=n*j,u+=n*M,c+=n*V,f+=n*F,l+=n*K,p+=n*H,h+=n*q,d+=n*G,y+=n*z,g+=n*Y,v+=n*W,m+=n*Q,b+=n*X,E+=n*Z,a+=(n=t[1])*x,s+=n*L,u+=n*j,c+=n*M,f+=n*V,l+=n*F,p+=n*K,h+=n*H,d+=n*q,y+=n*G,g+=n*z,v+=n*Y,m+=n*W,b+=n*Q,E+=n*X,T+=n*Z,s+=(n=t[2])*x,u+=n*L,c+=n*j,f+=n*M,l+=n*V,p+=n*F,h+=n*K,d+=n*H,y+=n*q,g+=n*G,v+=n*z,m+=n*Y,b+=n*W,E+=n*Q,T+=n*X,S+=n*Z,u+=(n=t[3])*x,c+=n*L,f+=n*j,l+=n*M,p+=n*V,h+=n*F,d+=n*K,y+=n*H,g+=n*q,v+=n*G,m+=n*z,b+=n*Y,E+=n*W,T+=n*Q,S+=n*X,w+=n*Z,c+=(n=t[4])*x,f+=n*L,l+=n*j,p+=n*M,h+=n*V,d+=n*F,y+=n*K,g+=n*H,v+=n*q,m+=n*G,b+=n*z,E+=n*Y,T+=n*W,S+=n*Q,w+=n*X,C+=n*Z,f+=(n=t[5])*x,l+=n*L,p+=n*j,h+=n*M,d+=n*V,y+=n*F,g+=n*K,v+=n*H,m+=n*q,b+=n*G,E+=n*z,T+=n*Y,S+=n*W,w+=n*Q,C+=n*X,_+=n*Z,l+=(n=t[6])*x,p+=n*L,h+=n*j,d+=n*M,y+=n*V,g+=n*F,v+=n*K,m+=n*H,b+=n*q,E+=n*G,T+=n*z,S+=n*Y,w+=n*W,C+=n*Q,_+=n*X,I+=n*Z,p+=(n=t[7])*x,h+=n*L,d+=n*j,y+=n*M,g+=n*V,v+=n*F,m+=n*K,b+=n*H,E+=n*q,T+=n*G,S+=n*z,w+=n*Y,C+=n*W,_+=n*Q,I+=n*X,A+=n*Z,h+=(n=t[8])*x,d+=n*L,y+=n*j,g+=n*M,v+=n*V,m+=n*F,b+=n*K,E+=n*H,T+=n*q,S+=n*G,w+=n*z,C+=n*Y,_+=n*W,I+=n*Q,A+=n*X,R+=n*Z,d+=(n=t[9])*x,y+=n*L,g+=n*j,v+=n*M,m+=n*V,b+=n*F,E+=n*K,T+=n*H,S+=n*q,w+=n*G,C+=n*z,_+=n*Y,I+=n*W,A+=n*Q,R+=n*X,O+=n*Z,y+=(n=t[10])*x,g+=n*L,v+=n*j,m+=n*M,b+=n*V,E+=n*F,T+=n*K,S+=n*H,w+=n*q,C+=n*G,_+=n*z,I+=n*Y,A+=n*W,R+=n*Q,O+=n*X,P+=n*Z,g+=(n=t[11])*x,v+=n*L,m+=n*j,b+=n*M,E+=n*V,T+=n*F,S+=n*K,w+=n*H,C+=n*q,_+=n*G,I+=n*z,A+=n*Y,R+=n*W,O+=n*Q,P+=n*X,B+=n*Z,v+=(n=t[12])*x,m+=n*L,b+=n*j,E+=n*M,T+=n*V,S+=n*F,w+=n*K,C+=n*H,_+=n*q,I+=n*G,A+=n*z,R+=n*Y,O+=n*W,P+=n*Q,B+=n*X,k+=n*Z,m+=(n=t[13])*x,b+=n*L,E+=n*j,T+=n*M,S+=n*V,w+=n*F,C+=n*K,_+=n*H,I+=n*q,A+=n*G,R+=n*z,O+=n*Y,P+=n*W,B+=n*Q,k+=n*X,N+=n*Z,b+=(n=t[14])*x,E+=n*L,T+=n*j,S+=n*M,w+=n*V,C+=n*F,_+=n*K,I+=n*H,A+=n*q,R+=n*G,O+=n*z,P+=n*Y,B+=n*W,k+=n*Q,N+=n*X,U+=n*Z,E+=(n=t[15])*x,a+=38*(S+=n*j),s+=38*(w+=n*M),u+=38*(C+=n*V),c+=38*(_+=n*F),f+=38*(I+=n*K),l+=38*(A+=n*H),p+=38*(R+=n*q),h+=38*(O+=n*G),d+=38*(P+=n*z),y+=38*(B+=n*Y),g+=38*(k+=n*W),v+=38*(N+=n*Q),m+=38*(U+=n*X),b+=38*(D+=n*Z),o=(n=(o+=38*(T+=n*L))+(i=1)+65535)-65536*(i=Math.floor(n/65536)),a=(n=a+i+65535)-65536*(i=Math.floor(n/65536)),s=(n=s+i+65535)-65536*(i=Math.floor(n/65536)),u=(n=u+i+65535)-65536*(i=Math.floor(n/65536)),c=(n=c+i+65535)-65536*(i=Math.floor(n/65536)),f=(n=f+i+65535)-65536*(i=Math.floor(n/65536)),l=(n=l+i+65535)-65536*(i=Math.floor(n/65536)),p=(n=p+i+65535)-65536*(i=Math.floor(n/65536)),h=(n=h+i+65535)-65536*(i=Math.floor(n/65536)),d=(n=d+i+65535)-65536*(i=Math.floor(n/65536)),y=(n=y+i+65535)-65536*(i=Math.floor(n/65536)),g=(n=g+i+65535)-65536*(i=Math.floor(n/65536)),v=(n=v+i+65535)-65536*(i=Math.floor(n/65536)),m=(n=m+i+65535)-65536*(i=Math.floor(n/65536)),b=(n=b+i+65535)-65536*(i=Math.floor(n/65536)),E=(n=E+i+65535)-65536*(i=Math.floor(n/65536)),o=(n=(o+=i-1+37*(i-1))+(i=1)+65535)-65536*(i=Math.floor(n/65536)),a=(n=a+i+65535)-65536*(i=Math.floor(n/65536)),s=(n=s+i+65535)-65536*(i=Math.floor(n/65536)),u=(n=u+i+65535)-65536*(i=Math.floor(n/65536)),c=(n=c+i+65535)-65536*(i=Math.floor(n/65536)),f=(n=f+i+65535)-65536*(i=Math.floor(n/65536)),l=(n=l+i+65535)-65536*(i=Math.floor(n/65536)),p=(n=p+i+65535)-65536*(i=Math.floor(n/65536)),h=(n=h+i+65535)-65536*(i=Math.floor(n/65536)),d=(n=d+i+65535)-65536*(i=Math.floor(n/65536)),y=(n=y+i+65535)-65536*(i=Math.floor(n/65536)),g=(n=g+i+65535)-65536*(i=Math.floor(n/65536)),v=(n=v+i+65535)-65536*(i=Math.floor(n/65536)),m=(n=m+i+65535)-65536*(i=Math.floor(n/65536)),b=(n=b+i+65535)-65536*(i=Math.floor(n/65536)),E=(n=E+i+65535)-65536*(i=Math.floor(n/65536)),o+=i-1+37*(i-1),e[0]=o,e[1]=a,e[2]=s,e[3]=u,e[4]=c,e[5]=f,e[6]=l,e[7]=p,e[8]=h,e[9]=d,e[10]=y,e[11]=g,e[12]=v,e[13]=m,e[14]=b,e[15]=E}}).call(this,r(74).Buffer)},function(e,t,r){var n=r(4);r(33);var i=n.asn1;t.privateKeyValidator={name:"PrivateKeyInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},t.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{tagClass:i.Class.UNIVERSAL,type:i.Type.BITSTRING,constructed:!1,composed:!0,captureBitStringValue:"ed25519PublicKey"}]}},function(e,t,r){var n=r(4);r(8),r(31),r(77),e.exports=n.kem=n.kem||{};var i=n.jsbn.BigInteger;function o(e,t,r,i){e.generate=function(e,o){for(var a=new n.util.ByteBuffer,s=Math.ceil(o/i)+r,u=new n.util.ByteBuffer,c=r;c<s;++c){u.putInt32(c),t.start(),t.update(e+u.getBytes());var f=t.digest();a.putBytes(f.getBytes(i))}return a.truncate(a.length()-o),a.getBytes()}}n.kem.rsa={},n.kem.rsa.create=function(e,t){var r=(t=t||{}).prng||n.random,o={encrypt:function(t,o){var a=Math.ceil(t.n.bitLength()/8),s;do{s=new i(n.util.bytesToHex(r.getBytesSync(a)),16).mod(t.n)}while(s.compareTo(i.ONE)<=0);var u=a-(s=n.util.hexToBytes(s.toString(16))).length,c,f;return u>0&&(s=n.util.fillString(String.fromCharCode(0),u)+s),{encapsulation:t.encrypt(s,"NONE"),key:e.generate(s,o)}},decrypt:function(t,r,n){var i=t.decrypt(r,"NONE");return e.generate(i,n)}};return o},n.kem.kdf1=function(e,t){o(this,e,0,t||e.digestLength)},n.kem.kdf2=function(e,t){o(this,e,1,t||e.digestLength)}},function(e,t,r){e.exports=r(37),r(119),r(69),r(139),r(148)},function(e,t,r){var n=r(4);r(48),r(33),r(75),r(49),r(51),r(145),r(31),r(8),r(122);var i=n.asn1,o=e.exports=n.pkcs7=n.pkcs7||{};function a(e){var t={},r=[];if(!i.validate(e,o.asn1.recipientInfoValidator,t,r)){var a=new Error("Cannot read PKCS#7 RecipientInfo. ASN.1 object is not an PKCS#7 RecipientInfo.");throw a.errors=r,a}return{version:t.version.charCodeAt(0),issuer:n.pki.RDNAttributesAsArray(t.issuer),serialNumber:n.util.createBuffer(t.serial).toHex(),encryptedContent:{algorithm:i.derToOid(t.encAlgorithm),parameter:t.encParameter.value,content:t.encKey}}}function s(e){return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(e.version).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[n.pki.distinguishedNameToAsn1({attributes:e.issuer}),i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,n.util.hexToBytes(e.serialNumber))]),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.encryptedContent.algorithm).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")]),i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,e.encryptedContent.content)])}function u(e){for(var t=[],r=0;r<e.length;++r)t.push(a(e[r]));return t}function c(e){for(var t=[],r=0;r<e.length;++r)t.push(s(e[r]));return t}function f(e){var t={},r=[];if(!i.validate(e,o.asn1.signerInfoValidator,t,r)){var a=new Error("Cannot read PKCS#7 SignerInfo. ASN.1 object is not an PKCS#7 SignerInfo.");throw a.errors=r,a}var s={version:t.version.charCodeAt(0),issuer:n.pki.RDNAttributesAsArray(t.issuer),serialNumber:n.util.createBuffer(t.serial).toHex(),digestAlgorithm:i.derToOid(t.digestAlgorithm),signatureAlgorithm:i.derToOid(t.signatureAlgorithm),signature:t.signature,authenticatedAttributes:[],unauthenticatedAttributes:[]},u=t.authenticatedAttributes||[],c=t.unauthenticatedAttributes||[];return s}function l(e){var t=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(e.version).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[n.pki.distinguishedNameToAsn1({attributes:e.issuer}),i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,n.util.hexToBytes(e.serialNumber))]),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.digestAlgorithm).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")])]);if(e.authenticatedAttributesAsn1&&t.value.push(e.authenticatedAttributesAsn1),t.value.push(i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.signatureAlgorithm).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")])),t.value.push(i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,e.signature)),e.unauthenticatedAttributes.length>0){for(var r=i.create(i.Class.CONTEXT_SPECIFIC,1,!0,[]),o=0;o<e.unauthenticatedAttributes.length;++o){var a=e.unauthenticatedAttributes[o];r.values.push(d(a))}t.value.push(r)}return t}function p(e){for(var t=[],r=0;r<e.length;++r)t.push(f(e[r]));return t}function h(e){for(var t=[],r=0;r<e.length;++r)t.push(l(e[r]));return t}function d(e){var t;if(e.type===n.pki.oids.contentType)t=i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.value).getBytes());else if(e.type===n.pki.oids.messageDigest)t=i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,e.value.bytes());else if(e.type===n.pki.oids.signingTime){var r=new Date("1950-01-01T00:00:00Z"),o=new Date("2050-01-01T00:00:00Z"),a=e.value;if("string"==typeof a){var s=Date.parse(a);a=isNaN(s)?13===a.length?i.utcTimeToDate(a):i.generalizedTimeToDate(a):new Date(s)}t=a>=r&&a<o?i.create(i.Class.UNIVERSAL,i.Type.UTCTIME,!1,i.dateToUtcTime(a)):i.create(i.Class.UNIVERSAL,i.Type.GENERALIZEDTIME,!1,i.dateToGeneralizedTime(a))}return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.type).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SET,!0,[t])])}function y(e){return[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(n.pki.oids.data).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.algorithm).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,e.parameter.getBytes())]),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,e.content.getBytes())])]}function g(e,t,r){var o={},a=[],s;if(!i.validate(t,r,o,a)){var u=new Error("Cannot read PKCS#7 message. ASN.1 object is not a supported PKCS#7 message.");throw u.errors=u,u}if(i.derToOid(o.contentType)!==n.pki.oids.data)throw new Error("Unsupported PKCS#7 message. Only wrapped ContentType Data supported.");if(o.encryptedContent){var c="";if(n.util.isArray(o.encryptedContent))for(var f=0;f<o.encryptedContent.length;++f){if(o.encryptedContent[f].type!==i.Type.OCTETSTRING)throw new Error("Malformed PKCS#7 message, expecting encrypted content constructed of only OCTET STRING objects.");c+=o.encryptedContent[f].value}else c=o.encryptedContent;e.encryptedContent={algorithm:i.derToOid(o.encAlgorithm),parameter:n.util.createBuffer(o.encParameter.value),content:n.util.createBuffer(c)}}if(o.content){var c="";if(n.util.isArray(o.content))for(var f=0;f<o.content.length;++f){if(o.content[f].type!==i.Type.OCTETSTRING)throw new Error("Malformed PKCS#7 message, expecting content constructed of only OCTET STRING objects.");c+=o.content[f].value}else c=o.content;e.content=n.util.createBuffer(c)}return e.version=o.version.charCodeAt(0),e.rawCapture=o,o}function v(e){if(void 0===e.encryptedContent.key)throw new Error("Symmetric key not available.");if(void 0===e.content){var t;switch(e.encryptedContent.algorithm){case n.pki.oids["aes128-CBC"]:case n.pki.oids["aes192-CBC"]:case n.pki.oids["aes256-CBC"]:t=n.aes.createDecryptionCipher(e.encryptedContent.key);break;case n.pki.oids.desCBC:case n.pki.oids["des-EDE3-CBC"]:t=n.des.createDecryptionCipher(e.encryptedContent.key);break;default:throw new Error("Unsupported symmetric cipher, OID "+e.encryptedContent.algorithm)}if(t.start(e.encryptedContent.parameter),t.update(e.encryptedContent.content),!t.finish())throw new Error("Symmetric decryption failed.");e.content=t.output}}o.messageFromPem=function(e){var t=n.pem.decode(e)[0];if("PKCS7"!==t.type){var r=new Error('Could not convert PKCS#7 message from PEM; PEM header type is not "PKCS#7".');throw r.headerType=t.type,r}if(t.procType&&"ENCRYPTED"===t.procType.type)throw new Error("Could not convert PKCS#7 message from PEM; PEM is encrypted.");var a=i.fromDer(t.body);return o.messageFromAsn1(a)},o.messageToPem=function(e,t){var r={type:"PKCS7",body:i.toDer(e.toAsn1()).getBytes()};return n.pem.encode(r,{maxline:t})},o.messageFromAsn1=function(e){var t={},r=[];if(!i.validate(e,o.asn1.contentInfoValidator,t,r)){var a=new Error("Cannot read PKCS#7 message. ASN.1 object is not an PKCS#7 ContentInfo.");throw a.errors=r,a}var s=i.derToOid(t.contentType),u;switch(s){case n.pki.oids.envelopedData:u=o.createEnvelopedData();break;case n.pki.oids.encryptedData:u=o.createEncryptedData();break;case n.pki.oids.signedData:u=o.createSignedData();break;default:throw new Error("Cannot read PKCS#7 message. ContentType with OID "+s+" is not (yet) supported.")}return u.fromAsn1(t.content.value[0]),u},o.createSignedData=function(){var e=null;return e={type:n.pki.oids.signedData,version:1,certificates:[],crls:[],signers:[],digestAlgorithmIdentifiers:[],contentInfo:null,signerInfos:[],fromAsn1:function(t){if(g(e,t,o.asn1.signedDataValidator),e.certificates=[],e.crls=[],e.digestAlgorithmIdentifiers=[],e.contentInfo=null,e.signerInfos=[],e.rawCapture.certificates)for(var r=e.rawCapture.certificates.value,i=0;i<r.length;++i)e.certificates.push(n.pki.certificateFromAsn1(r[i]))},toAsn1:function(){e.contentInfo||e.sign();for(var t=[],r=0;r<e.certificates.length;++r)t.push(n.pki.certificateToAsn1(e.certificates[r]));var o=[],a=i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(e.version).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SET,!0,e.digestAlgorithmIdentifiers),e.contentInfo])]);return t.length>0&&a.value[0].value.push(i.create(i.Class.CONTEXT_SPECIFIC,0,!0,t)),o.length>0&&a.value[0].value.push(i.create(i.Class.CONTEXT_SPECIFIC,1,!0,o)),a.value[0].value.push(i.create(i.Class.UNIVERSAL,i.Type.SET,!0,e.signerInfos)),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.type).getBytes()),a])},addSigner:function(t){var r=t.issuer,i=t.serialNumber;if(t.certificate){var o=t.certificate;"string"==typeof o&&(o=n.pki.certificateFromPem(o)),r=o.issuer.attributes,i=o.serialNumber}var a=t.key;if(!a)throw new Error("Could not add PKCS#7 signer; no private key specified.");"string"==typeof a&&(a=n.pki.privateKeyFromPem(a));var s=t.digestAlgorithm||n.pki.oids.sha1;switch(s){case n.pki.oids.sha1:case n.pki.oids.sha256:case n.pki.oids.sha384:case n.pki.oids.sha512:case n.pki.oids.md5:break;default:throw new Error("Could not add PKCS#7 signer; unknown message digest algorithm: "+s)}var u=t.authenticatedAttributes||[];if(u.length>0){for(var c=!1,f=!1,l=0;l<u.length;++l){var p=u[l];if(c||p.type!==n.pki.oids.contentType){if(f||p.type!==n.pki.oids.messageDigest);else if(f=!0,c)break}else if(c=!0,f)break}if(!c||!f)throw new Error("Invalid signer.authenticatedAttributes. If signer.authenticatedAttributes is specified, then it must contain at least two attributes, PKCS #9 content-type and PKCS #9 message-digest.")}e.signers.push({key:a,version:1,issuer:r,serialNumber:i,digestAlgorithm:s,signatureAlgorithm:n.pki.oids.rsaEncryption,signature:null,authenticatedAttributes:u,unauthenticatedAttributes:[]})},sign:function(o){var a,s;(o=o||{},"object"!=typeof e.content||null===e.contentInfo)&&(e.contentInfo=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(n.pki.oids.data).getBytes())]),"content"in e&&(e.content instanceof n.util.ByteBuffer?a=e.content.bytes():"string"==typeof e.content&&(a=n.util.encodeUtf8(e.content)),o.detached?e.detachedContent=i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,a):e.contentInfo.value.push(i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,a)]))));0!==e.signers.length&&r(t())},verify:function(){throw new Error("PKCS#7 signature verification not yet implemented.")},addCertificate:function(t){"string"==typeof t&&(t=n.pki.certificateFromPem(t)),e.certificates.push(t)},addCertificateRevokationList:function(e){throw new Error("PKCS#7 CRL support not yet implemented.")}};function t(){for(var t={},r=0;r<e.signers.length;++r){var o=e.signers[r],a;(a=o.digestAlgorithm)in t||(t[a]=n.md[n.pki.oids[a]].create()),0===o.authenticatedAttributes.length?o.md=t[a]:o.md=n.md[n.pki.oids[a]].create()}for(var a in e.digestAlgorithmIdentifiers=[],t)e.digestAlgorithmIdentifiers.push(i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")]));return t}function r(t){var r;if(!(r=e.detachedContent?e.detachedContent:(r=e.contentInfo.value[1]).value[0]))throw new Error("Could not sign PKCS#7 message; there is no content to sign.");var o=i.derToOid(e.contentInfo.value[0].value),a=i.toDer(r);for(var s in a.getByte(),i.getBerValueLength(a),a=a.getBytes(),t)t[s].start().update(a);for(var u=new Date,c=0;c<e.signers.length;++c){var f=e.signers[c];if(0===f.authenticatedAttributes.length){if(o!==n.pki.oids.data)throw new Error("Invalid signer; authenticatedAttributes must be present when the ContentInfo content type is not PKCS#7 Data.")}else{f.authenticatedAttributesAsn1=i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[]);for(var l=i.create(i.Class.UNIVERSAL,i.Type.SET,!0,[]),p=0;p<f.authenticatedAttributes.length;++p){var y=f.authenticatedAttributes[p];y.type===n.pki.oids.messageDigest?y.value=t[f.digestAlgorithm].digest():y.type===n.pki.oids.signingTime&&(y.value||(y.value=u)),l.value.push(d(y)),f.authenticatedAttributesAsn1.value.push(d(y))}a=i.toDer(l).getBytes(),f.md.start().update(a)}f.signature=f.key.sign(f.md,"RSASSA-PKCS1-V1_5")}e.signerInfos=h(e.signers)}},o.createEncryptedData=function(){var e=null;return e={type:n.pki.oids.encryptedData,version:0,encryptedContent:{algorithm:n.pki.oids["aes256-CBC"]},fromAsn1:function(t){g(e,t,o.asn1.encryptedDataValidator)},decrypt:function(t){void 0!==t&&(e.encryptedContent.key=t),v(e)}}},o.createEnvelopedData=function(){var e=null;return e={type:n.pki.oids.envelopedData,version:0,recipients:[],encryptedContent:{algorithm:n.pki.oids["aes256-CBC"]},fromAsn1:function(t){var r=g(e,t,o.asn1.envelopedDataValidator);e.recipients=u(r.recipientInfos.value)},toAsn1:function(){return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.type).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(e.version).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SET,!0,c(e.recipients)),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,y(e.encryptedContent))])])])},findRecipient:function(t){for(var r=t.issuer.attributes,n=0;n<e.recipients.length;++n){var i=e.recipients[n],o=i.issuer;if(i.serialNumber===t.serialNumber&&o.length===r.length){for(var a=!0,s=0;s<r.length;++s)if(o[s].type!==r[s].type||o[s].value!==r[s].value){a=!1;break}if(a)return i}}return null},decrypt:function(t,r){if(void 0===e.encryptedContent.key&&void 0!==t&&void 0!==r)switch(t.encryptedContent.algorithm){case n.pki.oids.rsaEncryption:case n.pki.oids.desCBC:var i=r.decrypt(t.encryptedContent.content);e.encryptedContent.key=n.util.createBuffer(i);break;default:throw new Error("Unsupported asymmetric cipher, OID "+t.encryptedContent.algorithm)}v(e)},addRecipient:function(t){e.recipients.push({version:0,issuer:t.issuer.attributes,serialNumber:t.serialNumber,encryptedContent:{algorithm:n.pki.oids.rsaEncryption,key:t.publicKey}})},encrypt:function(t,r){if(void 0===e.encryptedContent.content){var i,o,a;switch(r=r||e.encryptedContent.algorithm,t=t||e.encryptedContent.key,r){case n.pki.oids["aes128-CBC"]:i=16,o=16,a=n.aes.createEncryptionCipher;break;case n.pki.oids["aes192-CBC"]:i=24,o=16,a=n.aes.createEncryptionCipher;break;case n.pki.oids["aes256-CBC"]:i=32,o=16,a=n.aes.createEncryptionCipher;break;case n.pki.oids["des-EDE3-CBC"]:i=24,o=8,a=n.des.createEncryptionCipher;break;default:throw new Error("Unsupported symmetric cipher, OID "+r)}if(void 0===t)t=n.util.createBuffer(n.random.getBytes(i));else if(t.length()!=i)throw new Error("Symmetric key has wrong length; got "+t.length()+" bytes, expected "+i+".");e.encryptedContent.algorithm=r,e.encryptedContent.key=t,e.encryptedContent.parameter=n.util.createBuffer(n.random.getBytes(o));var s=a(t);if(s.start(e.encryptedContent.parameter.copy()),s.update(e.content),!s.finish())throw new Error("Symmetric encryption failed.");e.encryptedContent.content=s.output}for(var u=0;u<e.recipients.length;++u){var c=e.recipients[u];if(void 0===c.encryptedContent.content){if(c.encryptedContent.algorithm!==n.pki.oids.rsaEncryption)throw new Error("Unsupported asymmetric cipher, OID "+c.encryptedContent.algorithm);c.encryptedContent.content=c.encryptedContent.key.encrypt(e.encryptedContent.key.data)}}}}}},function(e,t,r){var n=r(4);r(48),r(68),r(119),r(69),r(8);var i=e.exports=n.ssh=n.ssh||{};function o(e,t){var r=t.toString(16);r[0]>="8"&&(r="00"+r);var i=n.util.hexToBytes(r);e.putInt32(i.length),e.putBytes(i)}function a(e,t){e.putInt32(t.length),e.putString(t)}function s(){for(var e=n.md.sha1.create(),t=arguments.length,r=0;r<t;++r)e.update(arguments[r]);return e.digest()}i.privateKeyToPutty=function(e,t,r){var i="ssh-rsa",u=""===(t=t||"")?"none":"aes256-cbc",c="PuTTY-User-Key-File-2: "+i+"\r\n";c+="Encryption: "+u+"\r\n",c+="Comment: "+(r=r||"")+"\r\n";var f=n.util.createBuffer();a(f,i),o(f,e.e),o(f,e.n);var l=n.util.encode64(f.bytes(),64),p=Math.floor(l.length/66)+1;c+="Public-Lines: "+p+"\r\n",c+=l;var h=n.util.createBuffer(),d;if(o(h,e.d),o(h,e.p),o(h,e.q),o(h,e.qInv),t){var y=h.length()+16-1;y-=y%16;var g=s(h.bytes());g.truncate(g.length()-y+h.length()),h.putBuffer(g);var v=n.util.createBuffer();v.putBuffer(s("\0\0\0\0",t)),v.putBuffer(s("\0\0\0",t));var m=n.aes.createEncryptionCipher(v.truncate(8),"CBC");m.start(n.util.createBuffer().fillWithByte(0,16)),m.update(h.copy()),m.finish();var b=m.output;b.truncate(16),d=n.util.encode64(b.bytes(),64)}else d=n.util.encode64(h.bytes(),64);c+="\r\nPrivate-Lines: "+(p=Math.floor(d.length/66)+1)+"\r\n",c+=d;var E=s("putty-private-key-file-mac-key",t),T=n.util.createBuffer();a(T,i),a(T,u),a(T,r),T.putInt32(f.length()),T.putBuffer(f),T.putInt32(h.length()),T.putBuffer(h);var S=n.hmac.create();return S.start("sha1",E),S.update(T.bytes()),c+="\r\nPrivate-MAC: "+S.digest().toHex()+"\r\n"},i.publicKeyToOpenSSH=function(e,t){var r="ssh-rsa";t=t||"";var i=n.util.createBuffer();return a(i,r),o(i,e.e),o(i,e.n),r+" "+n.util.encode64(i.bytes())+" "+t},i.privateKeyToOpenSSH=function(e,t){return t?n.pki.encryptRsaPrivateKey(e,t,{legacy:!0,algorithm:"aes128"}):n.pki.privateKeyToPem(e)},i.getPublicKeyFingerprint=function(e,t){var r=(t=t||{}).md||n.md.md5.create(),i="ssh-rsa",s=n.util.createBuffer();a(s,i),o(s,e.e),o(s,e.n),r.start(),r.update(s.getBytes());var u=r.digest();if("hex"===t.encoding){var c=u.toHex();return t.delimiter?c.match(/.{2}/g).join(t.delimiter):c}if("binary"===t.encoding)return u.getBytes();if(t.encoding)throw new Error('Unknown encoding "'+t.encoding+'".');return u}},function(e,t,r){var n=r(4);r(147),r(149),r(8);var i="forge.task",o=0,a={},s=0;n.debug.set(i,"tasks",a);var u={};n.debug.set(i,"queues",u);var c="?",f=30,l=20,p="ready",h="running",d="blocked",y="sleeping",g="done",v="error",m="stop",b="start",E="block",T="unblock",S="sleep",w="wakeup",C="cancel",_="fail",I={};I[p]={},I[p][m]=p,I[p][b]=h,I[p][C]=g,I[p][_]=v,I[h]={},I[h][m]=p,I[h][b]=h,I[h][E]=d,I[h][T]=h,I[h][S]=y,I[h][w]=h,I[h][C]=g,I[h][_]=v,I[d]={},I[d][m]=d,I[d][b]=d,I[d][E]=d,I[d][T]=d,I[d][S]=d,I[d][w]=d,I[d][C]=g,I[d][_]=v,I[y]={},I[y][m]=y,I[y][b]=y,I[y][E]=y,I[y][T]=y,I[y][S]=y,I[y][w]=y,I[y][C]=g,I[y][_]=v,I[g]={},I[g][m]=g,I[g][b]=g,I[g][E]=g,I[g][T]=g,I[g][S]=g,I[g][w]=g,I[g][C]=g,I[g][_]=v,I[v]={},I[v][m]=v,I[v][b]=v,I[v][E]=v,I[v][T]=v,I[v][S]=v,I[v][w]=v,I[v][C]=v,I[v][_]=v;var A=function(e){this.id=-1,this.name=e.name||c,this.parent=e.parent||null,this.run=e.run,this.subtasks=[],this.error=!1,this.state=p,this.blocks=0,this.timeoutId=null,this.swapTime=null,this.userData=null,this.id=s++,a[this.id]=this};A.prototype.debug=function(e){e=e||"",n.log.debug(i,e,"[%s][%s] task:",this.id,this.name,this,"subtasks:",this.subtasks.length,"queue:",u)},A.prototype.next=function(e,t){"function"==typeof e&&(t=e,e=this.name);var r=new A({run:t,name:e,parent:this});return r.state=h,r.type=this.type,r.successCallback=this.successCallback||null,r.failureCallback=this.failureCallback||null,this.subtasks.push(r),this},A.prototype.parallel=function(e,t){return n.util.isArray(e)&&(t=e,e=this.name),this.next(e,function(r){var i=r;i.block(t.length);for(var o=function(e,r){n.task.start({type:e,run:function(e){t[r](e)},success:function(e){i.unblock()},failure:function(e){i.unblock()}})},a=0;a<t.length;a++){var s,u;o(e+"__parallel-"+r.id+"-"+a,a)}})},A.prototype.stop=function(){this.state=I[this.state][m]},A.prototype.start=function(){this.error=!1,this.state=I[this.state][b],this.state===h&&(this.start=new Date,this.run(this),O(this,0))},A.prototype.block=function(e){e=void 0===e?1:e,this.blocks+=e,this.blocks>0&&(this.state=I[this.state][E])},A.prototype.unblock=function(e){return e=void 0===e?1:e,this.blocks-=e,0===this.blocks&&this.state!==g&&(this.state=h,O(this,0)),this.blocks},A.prototype.sleep=function(e){e=void 0===e?0:e,this.state=I[this.state][S];var t=this;this.timeoutId=setTimeout(function(){t.timeoutId=null,t.state=h,O(t,0)},e)},A.prototype.wait=function(e){e.wait(this)},A.prototype.wakeup=function(){this.state===y&&(cancelTimeout(this.timeoutId),this.timeoutId=null,this.state=h,O(this,0))},A.prototype.cancel=function(){this.state=I[this.state][C],this.permitsNeeded=0,null!==this.timeoutId&&(cancelTimeout(this.timeoutId),this.timeoutId=null),this.subtasks=[]},A.prototype.fail=function(e){if(this.error=!0,P(this,!0),e)e.error=this.error,e.swapTime=this.swapTime,e.userData=this.userData,O(e,0);else{if(null!==this.parent){for(var t=this.parent;null!==t.parent;)t.error=this.error,t.swapTime=this.swapTime,t.userData=this.userData,t=t.parent;P(t,!0)}this.failureCallback&&this.failureCallback(this)}};var R=function(e){e.error=!1,e.state=I[e.state][b],setTimeout(function(){e.state===h&&(e.swapTime=+new Date,e.run(e),O(e,0))},0)},O=function(e,t){var r=t>f||+new Date-e.swapTime>l,n=function(t){if(t++,e.state===h)if(r&&(e.swapTime=+new Date),e.subtasks.length>0){var n=e.subtasks.shift();n.error=e.error,n.swapTime=e.swapTime,n.userData=e.userData,n.run(n),n.error||O(n,t)}else P(e),e.error||null!==e.parent&&(e.parent.error=e.error,e.parent.swapTime=e.swapTime,e.parent.userData=e.userData,O(e.parent,t))};r?setTimeout(n,0):n(t)},P=function(e,t){e.state=g,delete a[e.id],null===e.parent&&(e.type in u?0===u[e.type].length?n.log.error(i,"[%s][%s] task queue empty [%s]",e.id,e.name,e.type):u[e.type][0]!==e?n.log.error(i,"[%s][%s] task not first in queue [%s]",e.id,e.name,e.type):(u[e.type].shift(),0===u[e.type].length?delete u[e.type]:u[e.type][0].start()):n.log.error(i,"[%s][%s] task queue missing [%s]",e.id,e.name,e.type),t||(e.error&&e.failureCallback?e.failureCallback(e):!e.error&&e.successCallback&&e.successCallback(e)))};e.exports=n.task=n.task||{},n.task.start=function(e){var t=new A({run:e.run,name:e.name||c});t.type=e.type,t.successCallback=e.success||null,t.failureCallback=e.failure||null,t.type in u?u[e.type].push(t):(u[t.type]=[t],R(t))},n.task.cancel=function(e){e in u&&(u[e]=[u[e][0]])},n.task.createCondition=function(){var e={tasks:{},wait:function(t){t.id in e.tasks||(t.block(),e.tasks[t.id]=t)},notify:function(){var t=e.tasks;for(var r in e.tasks={},t)t[r].unblock()}};return e}},function(e,t){},function(e,t,r){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",a=r.toStringTag||"@@toStringTag";function s(r,n,i,a){var s=n&&n.prototype instanceof c?n:c,f=Object.create(s.prototype);return o(f,"_invoke",function(r,n,i){var o,a,s,c=0,f=i||[],l=!1,p={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function t(r,n){return o=r,a=0,s=e,p.n=n,u}};function h(r,n){for(a=r,s=n,t=0;!l&&c&&!i&&t<f.length;t++){var i,o=f[t],h=p.p,d=o[2];r>3?(i=d===n)&&(s=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=e):o[0]<=h&&((i=r<2&&h<o[1])?(a=0,p.v=n,p.n=o[1]):h<d&&(i=r<3||o[0]>n||n>d)&&(o[4]=r,o[5]=n,p.n=d,a=0))}if(i||r>1)return u;throw l=!0,n}return function(i,f,d){if(c>1)throw TypeError("Generator is already running");for(l&&1===f&&h(f,d),a=f,s=d;(t=a<2?e:s)||!l;){o||(a?a<3?(a>1&&(p.n=-1),h(a,s)):p.n=s:p.v=s);try{if(c=2,o){if(a||(i="next"),t=o[i]){if(!(t=t.call(o,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,a<2&&(a=0)}else 1===a&&(t=o.return)&&t.call(o),a<2&&(s=TypeError("The iterator does not provide a '"+i+"' method"),a=1);o=e}else if((t=(l=p.n<0)?s:r.call(n,p))!==u)break}catch(t){o=e,a=1,s=t}finally{c=1}}return{value:t,done:l}}}(r,i,a),!0),f}var u={};function c(){}function f(){}function l(){}t=Object.getPrototypeOf;var p=[][n]?t(t([][n]())):(o(t={},n,function(){return this}),t),h=l.prototype=c.prototype=Object.create(p);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,o(e,a,"GeneratorFunction")),e.prototype=Object.create(h),e}return f.prototype=l,o(h,"constructor",l),o(l,"constructor",f),f.displayName="GeneratorFunction",o(l,a,"GeneratorFunction"),o(h),o(h,a,"Generator"),o(h,n,function(){return this}),o(h,"toString",function(){return"[object Generator]"}),(i=function e(){return{w:s,m:d}})()}function o(e,t,r,n){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}o=function e(t,r,n,a){function s(e,r){o(t,e,function(t){return this._invoke(e,r,t)})}r?i?i(t,r,{value:n,enumerable:!a,configurable:!a,writable:!a}):t[r]=n:(s("next",0),s("throw",1),s("return",2))},o(e,t,r,n)}function a(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function s(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var o=e.apply(t,r);function s(e){a(o,n,i,s,u,"next",e)}function u(e){a(o,n,i,s,u,"throw",e)}s(void 0)})}}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,l(n.key),n)}}function f(e,t,r){return t&&c(e.prototype,t),r&&c(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function l(e){var t=p(e,"string");return"symbol"==n(t)?t:t+""}function p(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function h(e,t,r){return t=v(t),d(e,g()?Reflect.construct(t,r||[],v(e).constructor):t.apply(e,r))}function d(e,t){if(t&&("object"==n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return y(e)}function y(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function g(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(g=function t(){return!!e})()}function v(e){return v=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},v(e)}function m(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&b(e,t)}function b(e,t){return b=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},b(e,t)}var E=r(67),T=r(117),S=r(151);e.exports=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e.privateKeyPem,n=e.publicKeyPem,i=e.creator,o=e.date,a=e.domain,s=e.nonce;return u(this,t),h(this,t,[{type:"GraphSignature2012",privateKeyPem:r,publicKeyPem:n,creator:i,date:o,domain:a,nonce:s}])}return m(t,e),f(t,[{key:"canonize",value:function(){var e=s(i().m(function e(t,r){var n,o,a;return i().w(function(e){for(;;)if(0===e.n)return n=r.documentLoader,o=r.expansionMap,a=r.skipExpansion,e.a(2,E.canonize(t,{algorithm:"URGNA2012",format:"application/n-quads",documentLoader:n,expansionMap:o,skipExpansion:a}))},e)}));function t(t,r){return e.apply(this,arguments)}return t}()},{key:"createVerifyData",value:function(){var e=s(i().m(function e(t){var r,n,o,a,s,u,c;return i().w(function(e){for(;;)switch(e.n){case 0:return r=t.document,n=t.proof,o=t.documentLoader,a=t.expansionMap,e.n=1,this.canonize(r,{documentLoader:o,expansionMap:a});case 1:return s=e.v,u="",null!==n.nonce&&void 0!==n.nonce&&(u+=n.nonce),u+=n.created,u+=s,null!==n.domain&&void 0!==n.domain&&(u+="@"+n.domain),c=new T.util.ByteBuffer(u,"utf8"),e.a(2,T.util.binary.raw.decode(c.getBytes()))}},e,this)}));function t(t){return e.apply(this,arguments)}return t}()}])}(S)},function(e,t,r){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a(n.key),n)}}function o(e,t,r){return t&&i(e.prototype,t),r&&i(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function a(e){var t=s(e,"string");return"symbol"==n(t)?t:t+""}function s(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t,r){return t=h(t),f(e,p()?Reflect.construct(t,r||[],h(e).constructor):t.apply(e,r))}function f(e,t){if(t&&("object"==n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return l(e)}function l(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function p(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(p=function t(){return!!e})()}function h(e){return h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},h(e)}function d(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&y(e,t)}function y(e,t){return y=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},y(e,t)}var g,v=r(73).RSAKeyPair,m=r(114);e.exports=function(e){function t(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=r.signer,i=r.key,o=r.creator,a=r.verificationMethod,s=r.proof,f=r.date,l=r.useNativeCanonize;return u(this,t),(e=c(this,t,[{type:"RsaSignature2018",alg:"PS256",LDKeyClass:v,creator:o,verificationMethod:a,signer:n,key:i,proof:s,date:f,useNativeCanonize:l}])).requiredKeyType="RsaVerificationKey2018",e}return d(t,e),o(t)}(m)},function(e,t,r){"use strict";var n={};e.exports=n,n.purposes={AssertionProofPurpose:r(203),AuthenticationProofPurpose:r(204),ControllerProofPurpose:r(72),ProofPurpose:r(131),PublicKeyProofPurpose:r(130)}},function(e,t,r){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a(n.key),n)}}function o(e,t,r){return t&&i(e.prototype,t),r&&i(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function a(e){var t=s(e,"string");return"symbol"==n(t)?t:t+""}function s(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t,r){return t=h(t),f(e,p()?Reflect.construct(t,r||[],h(e).constructor):t.apply(e,r))}function f(e,t){if(t&&("object"==n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return l(e)}function l(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function p(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(p=function t(){return!!e})()}function h(e){return h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},h(e)}function d(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&y(e,t)}function y(e,t){return y=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},y(e,t)}var g=r(72);e.exports=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e.term,n=void 0===r?"assertionMethod":r,i=e.controller,o=e.date,a=e.maxTimestampDelta,s=void 0===a?1/0:a;return u(this,t),c(this,t,[{term:n,controller:i,date:o,maxTimestampDelta:s}])}return d(t,e),o(t)}(g)},function(e,t,r){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",a=r.toStringTag||"@@toStringTag";function s(r,n,i,a){var s=n&&n.prototype instanceof c?n:c,f=Object.create(s.prototype);return o(f,"_invoke",function(r,n,i){var o,a,s,c=0,f=i||[],l=!1,p={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function t(r,n){return o=r,a=0,s=e,p.n=n,u}};function h(r,n){for(a=r,s=n,t=0;!l&&c&&!i&&t<f.length;t++){var i,o=f[t],h=p.p,d=o[2];r>3?(i=d===n)&&(s=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=e):o[0]<=h&&((i=r<2&&h<o[1])?(a=0,p.v=n,p.n=o[1]):h<d&&(i=r<3||o[0]>n||n>d)&&(o[4]=r,o[5]=n,p.n=d,a=0))}if(i||r>1)return u;throw l=!0,n}return function(i,f,d){if(c>1)throw TypeError("Generator is already running");for(l&&1===f&&h(f,d),a=f,s=d;(t=a<2?e:s)||!l;){o||(a?a<3?(a>1&&(p.n=-1),h(a,s)):p.n=s:p.v=s);try{if(c=2,o){if(a||(i="next"),t=o[i]){if(!(t=t.call(o,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,a<2&&(a=0)}else 1===a&&(t=o.return)&&t.call(o),a<2&&(s=TypeError("The iterator does not provide a '"+i+"' method"),a=1);o=e}else if((t=(l=p.n<0)?s:r.call(n,p))!==u)break}catch(t){o=e,a=1,s=t}finally{c=1}}return{value:t,done:l}}}(r,i,a),!0),f}var u={};function c(){}function f(){}function l(){}t=Object.getPrototypeOf;var p=[][n]?t(t([][n]())):(o(t={},n,function(){return this}),t),h=l.prototype=c.prototype=Object.create(p);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,o(e,a,"GeneratorFunction")),e.prototype=Object.create(h),e}return f.prototype=l,o(h,"constructor",l),o(l,"constructor",f),f.displayName="GeneratorFunction",o(l,a,"GeneratorFunction"),o(h),o(h,a,"Generator"),o(h,n,function(){return this}),o(h,"toString",function(){return"[object Generator]"}),(i=function e(){return{w:s,m:d}})()}function o(e,t,r,n){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}o=function e(t,r,n,a){function s(e,r){o(t,e,function(t){return this._invoke(e,r,t)})}r?i?i(t,r,{value:n,enumerable:!a,configurable:!a,writable:!a}):t[r]=n:(s("next",0),s("throw",1),s("return",2))},o(e,t,r,n)}function a(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function s(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var o=e.apply(t,r);function s(e){a(o,n,i,s,u,"next",e)}function u(e){a(o,n,i,s,u,"throw",e)}s(void 0)})}}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,l(n.key),n)}}function f(e,t,r){return t&&c(e.prototype,t),r&&c(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function l(e){var t=p(e,"string");return"symbol"==n(t)?t:t+""}function p(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function h(e,t,r){return t=E(t),d(e,g()?Reflect.construct(t,r||[],E(e).constructor):t.apply(e,r))}function d(e,t){if(t&&("object"==n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return y(e)}function y(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function g(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(g=function t(){return!!e})()}function v(e,t,r,n){var i=m(E(1&n?e.prototype:e),t,r);return 2&n&&"function"==typeof i?function(e){return i.apply(r,e)}:i}function m(){return m="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=b(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}},m.apply(null,arguments)}function b(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=E(e)););return e}function E(e){return E=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},E(e)}function T(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&S(e,t)}function S(e,t){return S=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},S(e,t)}var w=r(72);e.exports=function(e){function t(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=r.term,i=void 0===n?"authentication":n,o=r.controller,a=r.challenge,s=r.date,c=r.domain,f=r.maxTimestampDelta,l=void 0===f?1/0:f;if(u(this,t),e=h(this,t,[{term:i,controller:o,date:s,maxTimestampDelta:l}]),"string"!=typeof a)throw new TypeError('"challenge" must be a string.');if(void 0!==c&&"string"!=typeof c)throw new TypeError('"domain" must be a string.');return e.challenge=a,e.domain=c,e}return T(t,e),f(t,[{key:"validate",value:function(){var e=s(i().m(function e(r,n){var o,a,s,u;return i().w(function(e){for(;;)switch(e.p=e.n){case 0:if(o=n.verificationMethod,a=n.documentLoader,s=n.expansionMap,e.p=1,r.challenge===this.challenge){e.n=2;break}throw new Error("The challenge is not as expected; "+'challenge="'.concat(r.challenge,'", expected="').concat(this.challenge,'"'));case 2:if(void 0===this.domain||r.domain===this.domain){e.n=3;break}throw new Error("The domain is not as expected; "+'domain="'.concat(r.domain,'", expected="').concat(this.domain,'"'));case 3:return e.a(2,v(t,"validate",this,3)([r,{verificationMethod:o,documentLoader:a,expansionMap:s}]));case 4:return e.p=4,u=e.v,e.a(2,{valid:!1,error:u})}},e,this,[[1,4]])}));function r(t,r){return e.apply(this,arguments)}return r}()},{key:"update",value:function(){var e=s(i().m(function e(r,n){var o,a,s,u;return i().w(function(e){for(;;)switch(e.n){case 0:return o=n.document,a=n.suite,s=n.documentLoader,u=n.expansionMap,e.n=1,v(t,"update",this,3)([r,{document:o,suite:a,documentLoader:s,expansionMap:u}]);case 1:return(r=e.v).challenge=this.challenge,void 0!==this.domain&&(r.domain=this.domain),e.a(2,r)}},e,this)}));function r(t,r){return e.apply(this,arguments)}return r}()}])}(w)},,,,,,,,,,,,,function(e,t,r){"use strict";r.r(t),r.d(t,"CsModule",function(){return rr});var n=r(86),i=r(172),o=r(2),a=r(125),s=r(0),u=r(16),c=function(e,t,r,n){var i=arguments.length,o=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n,a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,r,o):a(t,r))||o);return i>3&&o&&Object.defineProperty(t,r,o),o},f=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=function(){function e(){this.http=window.cordova.plugin.http}return e.prototype.setSerializer=function(e){this.http.setDataSerializer(e)},e.prototype.addHeaders=function(e){for(var t in e)e.hasOwnProperty(t)&&this.http.setHeader("*",t,e[t])},e.prototype.addHeader=function(e,t){this.http.setHeader("*",e,t)},e.prototype.get=function(e,t,r,n,i){return this.invokeRequest(s.CsHttpRequestType.GET,e+t,n,r,i)},e.prototype.delete=function(e,t,r,n,i){return this.invokeRequest(s.CsHttpRequestType.DELETE,e+t,n,r,i)},e.prototype.patch=function(e,t,r,n,i){return this.invokeRequest(s.CsHttpRequestType.PATCH,e+t,n,r,i)},e.prototype.post=function(e,t,r,n,i){return this.invokeRequest(s.CsHttpRequestType.POST,e+t,n,r,i)},e.prototype.invokeRequest=function(e,t,r,n,i){var o=new a.a,c={method:e.toLowerCase(),headers:n,serializer:i};return e===s.CsHttpRequestType.POST||e===s.CsHttpRequestType.PATCH?c.data=r:e!==s.CsHttpRequestType.GET&&e!==s.CsHttpRequestType.DELETE||(c.params=r),this.http.sendRequest(t,c,function(e){var t=new s.CsResponse;try{t.body=JSON.parse(e.data)}catch(r){t.body=e.data}t.responseCode=e.status,t.errorMesg="",t.headers=e.headers,o.next(t),o.complete()},function(e){var r=new s.CsResponse;if(0===e.status)return o.error(new u.d("\n "+t+" -\n "+(e.error||"")+"\n ")),void o.complete();try{try{r.body=JSON.parse(e.error)}catch(t){if(r.body=e.error,e.status<=0)throw t}r.responseCode=e.status,r.errorMesg="SERVER_ERROR",r.headers=e.headers,r.responseCode>=400&&r.responseCode<=499?o.error(new u.b("\n "+t+" -\n "+(e.error||"")+"\n ",r)):o.error(new u.c("\n "+t+" -\n "+(e.error||"")+"\n ",r))}catch(r){o.error(new u.d("\n "+t+" -\n "+(e.error||"")+"\n ")),o.complete()}}),o},e=c([Object(o.injectable)(),f("design:paramtypes",[])],e)}(),p=r(5),h=r(35),d=r(13),y=function(e){return function(t){return e.then(function(e){t.closed||(t.next(e),t.complete())},function(e){return t.error(e)}).then(null,d.a),t}};function g(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}var v=g(),m=v,b=function(e){return function(t){for(var r=e[v]();;){var n=void 0;try{n=r.next()}catch(e){return t.error(e),t}if(n.done){t.complete();break}if(t.next(n.value),t.closed)break}return"function"==typeof r.return&&t.add(function(){r.return&&r.return()}),t}},E=r(21),T=function(e){return function(t){var r=e[E.a]();if("function"!=typeof r.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return r.subscribe(t)}},S=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e};function w(e){return!!e&&"function"!=typeof e.subscribe&&"function"==typeof e.then}var C=r(34),_=function(e){if(e&&"function"==typeof e[E.a])return T(e);if(S(e))return Object(h.a)(e);if(w(e))return y(e);if(e&&"function"==typeof e[v])return b(e);var t=Object(C.a)(e)?"an invalid object":"'"+e+"'",r;throw new TypeError("You provided "+t+" where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.")},I=r(10);function A(e,t){return new p.a(function(r){var n=new I.a;return n.add(t.schedule(function(){var i=e[E.a]();n.add(i.subscribe({next:function(e){n.add(t.schedule(function(){return r.next(e)}))},error:function(e){n.add(t.schedule(function(){return r.error(e)}))},complete:function(){n.add(t.schedule(function(){return r.complete()}))}}))})),n})}function R(e,t){return new p.a(function(r){var n=new I.a;return n.add(t.schedule(function(){return e.then(function(e){n.add(t.schedule(function(){r.next(e),n.add(t.schedule(function(){return r.complete()}))}))},function(e){n.add(t.schedule(function(){return r.error(e)}))})})),n})}var O=r(22);function P(e,t){if(!e)throw new Error("Iterable cannot be null");return new p.a(function(r){var n=new I.a,i;return n.add(function(){i&&"function"==typeof i.return&&i.return()}),n.add(t.schedule(function(){i=e[v](),n.add(t.schedule(function(){if(!r.closed){var e,t;try{var n=i.next();e=n.value,t=n.done}catch(e){return void r.error(e)}t?r.complete():(r.next(e),this.schedule())}}))})),n})}function B(e){return e&&"function"==typeof e[E.a]}function k(e){return e&&"function"==typeof e[v]}function N(e,t){if(null!=e){if(B(e))return A(e,t);if(w(e))return R(e,t);if(S(e))return Object(O.a)(e,t);if(k(e)||"string"==typeof e)return P(e,t)}throw new TypeError((null!==e&&typeof e||e)+" is not observable")}function U(e,t){return t?N(e,t):e instanceof p.a?e:new p.a(_(e))}var D=new p.a(function(e){return e.complete()});function x(e){return e?L(e):D}function L(e){return new p.a(function(t){return e.schedule(function(){return t.complete()})})}function j(e){return new p.a(function(t){var r,n;try{r=e()}catch(e){return void t.error(e)}return(r?U(r):x()).subscribe(t)})}var M=r(126),V=function(){return V=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},V.apply(this,arguments)},F=function(e,t,r,n){var i=arguments.length,o=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n,a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,r,o):a(t,r))||o);return i>3&&o&&Object.defineProperty(t,r,o),o},K=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},H=function(e,t,r,n){function i(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=Promise))(function(r,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){e.done?r(e.value):i(e.value).then(a,s)}u((n=n.apply(e,t||[])).next())})},q=function(e,t){var r={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},n,i,o,a;return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(e){return function(t){return u([e,t])}}function u(a){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=2&a[0]?i.return:a[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,a[1])).done)return o;switch(i=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,i=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(!(o=r.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){r=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){r.label=a[1];break}if(6===a[0]&&r.label<o[1]){r.label=o[1],o=a;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(a);break}o[2]&&r.ops.pop(),r.trys.pop();continue}a=t.call(e,r)}catch(e){a=[6,e],i=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}},G=function(){function e(){this.headers={}}var t;return t=e,e.mapError=function(e,t){return H(this,void 0,void 0,function(){return q(this,function(r){if(u.c.isInstance(t)||u.b.isInstance(t))throw t;throw new u.d("\n "+e+" -\n "+(t||"")+"\n ")})})},e.mapResponse=function(e){return H(this,void 0,void 0,function(){var t,r;return q(this,function(n){switch(n.label){case 0:return(t=new s.CsResponse).responseCode=e.status,r=t,[4,e.text()];case 1:r.body=n.sent(),t.headers={},e.headers&&e.headers.forEach(function(e,r){return t.headers[r]=e});try{t.body=JSON.parse(t.body)}catch(e){t.body=t.body}if(e.ok)return[2,t];throw t.errorMesg="SERVER_ERROR",e.status>=400&&e.status<=499?new u.b("\n "+e.url+"\n ",t):new u.c("\n "+e.url+"\n ",t)}})})},e.prototype.setSerializer=function(e){this.serializer=e},e.prototype.addHeader=function(e,t){this.headers[e]=t},e.prototype.addHeaders=function(e){this.headers=V(V({},this.headers),e)},e.prototype.get=function(e,t,r,n,i){var o=new URL(e+t);return this.addHeader("content-type","text/plain"),"object"==typeof n&&Object.keys(n).forEach(function(e){o.searchParams.append(e,n[e])}),this.invokeRequest(s.CsHttpRequestType.GET,o,r,void 0)},e.prototype.delete=function(e,t,r,n,i){var o=new URL(e+t);return this.addHeader("content-type","text/plain"),"object"==typeof n&&Object.keys(n).forEach(function(e){o.searchParams.append(e,n[e])}),this.invokeRequest(s.CsHttpRequestType.DELETE,o,r,void 0)},e.prototype.patch=function(e,t,r,n,i){var o=new URL(e+t);return i===s.CsHttpSerializer.URLENCODED&&"object"==typeof n?(this.addHeader("content-type","application/x-www-form-urlencoded"),n=M.stringify(n)):"object"==typeof n&&(delete this.headers["content-type"],n=JSON.stringify(n)),this.invokeRequest(s.CsHttpRequestType.PATCH,o,r,n)},e.prototype.post=function(e,t,r,n,i){var o=new URL(e+t);return i===s.CsHttpSerializer.URLENCODED&&"object"==typeof n?(this.addHeader("content-type","application/x-www-form-urlencoded"),n=M.stringify(n)):"object"==typeof n&&(delete this.headers["content-type"],n=JSON.stringify(n)),this.invokeRequest(s.CsHttpRequestType.POST,o,r,n)},e.prototype.invokeRequest=function(e,r,n,i){var o=this;return j(function(){return fetch(r.toString(),{method:e,headers:V(V({},o.headers),n),body:i,credentials:"same-origin"}).then(t.mapResponse).catch(function(e){return t.mapError(r.toString(),e)})})},e=t=F([Object(o.injectable)(),K("design:paramtypes",[])],e)}(),z={CONTAINER:Symbol.for("CONTAINER"),core:{HTTP_ADAPTER:Symbol.for("HTTP_ADAPTER"),global:{CHANNEL_ID:Symbol.for("CHANNEL_ID"),PRODUCER_ID:Symbol.for("PRODUCER_ID"),DEVICE_ID:Symbol.for("DEVICE_ID"),SESSION_ID:Symbol.for("SESSION_ID"),APP_VERSION:Symbol.for("APP_VERSION")},api:{HOST:Symbol.for("HOST"),authentication:{USER_TOKEN:Symbol.for("USER_TOKEN"),MANAGED_USER_TOKEN:Symbol.for("MANAGED_USER_TOKEN"),BEARER_TOKEN:Symbol.for("BEARER_TOKEN")}},HTTP_SERVICE:Symbol.for("HTTP_SERVICE"),CLIENT_STORAGE:Symbol.for("CLIENT_STORAGE")},services:{user:{USER_SERVICE_API_PATH:Symbol.for("USER_SERVICE_API_PATH"),USER_SERVICE:Symbol.for("USER_SERVICE")},content:{CONTENT_SERVICE_HIERARCHY_API_PATH:Symbol.for("CONTENT_SERVICE_HIERARCHY_API_PATH"),CONTENT_SERVICE_QUESTION_LIST_API_PATH:Symbol.for("CONTENT_SERVICE_QUESTION_LIST_API_PATH"),CONTENT_SERVICE:Symbol.for("CONTENT_SERVICE")},group:{GROUP_SERVICE_API_PATH:Symbol.for("GROUP_SERVICE_API_PATH"),GROUP_SERVICE_DATA_API_PATH:Symbol.for("GROUP_SERVICE_DATA_API_PATH"),GROUP_SERVICE:Symbol.for("GROUP_SERVICE"),GROUP_ACTIVITY_SERVICE:Symbol.for("GROUP_ACTIVITY_SERVICE"),GROUP_SERVICE_UPDATE_GUIDELINES_API_PATH:Symbol.for("GROUP_SERVICE_UPDATE_GUIDELINES_API_PATH")},framework:{FRAMEWORK_SERVICE_API_PATH:Symbol.for("FRAMEWORK_SERVICE_API_PATH"),FRAMEWORK_SERVICE:Symbol.for("FRAMEWORK_SERVICE")},location:{LOCATION_SERVICE_API_PATH:Symbol.for("LOCATION_SERVICE_API_PATH"),LOCATION_SERVICE:Symbol.for("LOCATION_SERVICE")},course:{COURSE_SERVICE_API_PATH:Symbol.for("COURSE_SERVICE_API_PATH"),COURSE_SERVICE_CERT_REGISTRATION_API_PATH:Symbol.for("COURSE_SERVICE_CERT_REGISTRATION_API_PATH"),COURSE_SERVICE:Symbol.for("COURSE_SERVICE")},form:{FORM_SERVICE_API_PATH:Symbol.for("FORM_SERVICE_API_PATH"),FORM_SERVICE:Symbol.for("FORM_SERVICE")},systemSettings:{SYSTEM_SETTINGS_SERVICE_API_PATH:Symbol.for("SYSTEM_SETTINGS_SERVICE_API_PATH"),SYSTEM_SETTINGS_SERVICE:Symbol.for("SYSTEM_SETTINGS_SERVICE")},discussion:{DISCUSSION_SERVICE_API_PATH:Symbol.for("DISCUSSION_SERVICE_API_PATH"),DISCUSSION_SERVICE:Symbol.for("DISCUSSION_SERVICE")},notification:{NOTIFICATION_SERVICE_API_PATH:Symbol.for("NOTIFICATION_SERVICE_API_PATH"),NOTIFICATION_SERVICE:Symbol.for("NOTIFICATION_SERVICE")},certificate:{CERTIFICATE_SERVICE_API_PATH:Symbol.for("CERTIFICATE_SERVICE_API_PATH"),CERTIFICATE_SERVICE_API_PATH_LEGACY:Symbol.for("CERTIFICATE_SERVICE_API_PATH_LEGACY"),RC_API_PATH:Symbol.for("RC_API_PATH"),CERTIFICATE_SERVICE:Symbol.for("CERTIFICATE_SERVICE")}}},Y=function(){function e(){}return e}(),W=r(169),Q=function(){function e(e){this.container=e}return e.prototype.interceptRequest=function(e){var t=this.container.get(z.core.api.authentication.BEARER_TOKEN);return t&&(e.headers.Authorization="Bearer "+t),Object(W.a)(e)},e}(),X=function(){function e(e){this.container=e}return e.prototype.interceptRequest=function(e){var t=this.container.get(z.core.api.authentication.USER_TOKEN),r=this.container.get(z.core.api.authentication.MANAGED_USER_TOKEN);return t&&(e.headers["X-Authenticated-User-Token"]=t),r&&(e.headers["X-Authenticated-For"]=r),Object(W.a)(e)},e}(),Z=r(50),$=function(){return $=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},$.apply(this,arguments)},J=function(e,t,r,n){var i=arguments.length,o=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n,a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,r,o):a(t,r))||o);return i>3&&o&&Object.defineProperty(t,r,o),o},ee=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},te=function(e,t){return function(r,n){t(r,n,e)}},re=function(e,t,r,n){function i(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=Promise))(function(r,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){e.done?r(e.value):i(e.value).then(a,s)}u((n=n.apply(e,t||[])).next())})},ne=function(e,t){var r={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},n,i,o,a;return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(e){return function(t){return u([e,t])}}function u(a){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=2&a[0]?i.return:a[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,a[1])).done)return o;switch(i=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,i=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(!(o=r.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){r=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){r.label=a[1];break}if(6===a[0]&&r.label<o[1]){r.label=o[1],o=a;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(a);break}o[2]&&r.ops.pop(),r.trys.pop();continue}a=t.call(e,r)}catch(e){a=[6,e],i=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}},ie=function(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;for(var n=Array(e),i=0,t=0;t<r;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,i++)n[i]=o[a];return n},oe=function(){function e(e,t,r){this.container=e,this.http=t,this.clientStorage=r,this._requestInterceptors=[],this._responseInterceptors=[]}return Object.defineProperty(e.prototype,"bearerTokenInjectRequestInterceptor",{get:function(){return this._bearerTokenInjectRequestInterceptor||(this._bearerTokenInjectRequestInterceptor=new Q(this.container)),this._bearerTokenInjectRequestInterceptor},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"userTokenInjectRequestInterceptor",{get:function(){return this._userTokenInjectRequestInterceptor||(this._userTokenInjectRequestInterceptor=new X(this.container)),this._userTokenInjectRequestInterceptor},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"host",{get:function(){return this.container.get(z.core.api.HOST)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"channelId",{get:function(){return this.container.get(z.core.global.CHANNEL_ID)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"deviceId",{get:function(){return this.container.get(z.core.global.DEVICE_ID)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"producerId",{get:function(){return this.container.get(z.core.global.PRODUCER_ID)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sessionId",{get:function(){return this.container.get(z.core.global.SESSION_ID)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"appVersion",{get:function(){return this.container.get(z.core.global.APP_VERSION)},enumerable:!1,configurable:!0}),e.prototype.init=function(){var e=this;this.clientStorage&&this.clientStorage.getItem(Z.a.TRACE_ID).then(function(t){e._traceId=t||""})},Object.defineProperty(e.prototype,"requestInterceptors",{get:function(){return this._requestInterceptors},set:function(e){this._requestInterceptors=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"responseInterceptors",{get:function(){return this._responseInterceptors},set:function(e){this._responseInterceptors=e},enumerable:!1,configurable:!0}),e.prototype.fetch=function(e){var t=this,r;return this.addGlobalHeader(),this.buildInterceptorsFromRequest(e),U(re(t,void 0,void 0,function(){var t,r,n,i,o,a;return ne(this,function(c){switch(c.label){case 0:return[4,this.interceptRequest(e)];case 1:e=c.sent(),c.label=2;case 2:switch(c.trys.push([2,14,,21]),r=e.type){case s.CsHttpRequestType.GET:return[3,3];case s.CsHttpRequestType.PATCH:return[3,5];case s.CsHttpRequestType.POST:return[3,7];case s.CsHttpRequestType.DELETE:return[3,9]}return[3,11];case 3:return[4,this.http.get(e.host||this.host,e.path,e.headers,e.parameters,e.serializer).toPromise()];case 4:return t=c.sent(),[3,12];case 5:return[4,this.http.patch(e.host||this.host,e.path,e.headers,e.body,e.serializer).toPromise()];case 6:return t=c.sent(),[3,12];case 7:return[4,this.http.post(e.host||this.host,e.path,e.headers,e.body,e.serializer).toPromise()];case 8:return t=c.sent(),[3,12];case 9:return[4,this.http.delete(e.host||this.host,e.path,e.headers,e.parameters,e.serializer).toPromise()];case 10:return t=c.sent(),[3,12];case 11:throw new Error("Unsupported type");case 12:return n=t.headers["X-Trace-Enabled"]||"",this.clientStorage&&n!==this._traceId&&this.clientStorage.setItem(Z.a.TRACE_ID,n),[4,this.interceptResponse(e,t)];case 13:return[2,c.sent()];case 14:if(i=c.sent(),o=function(t){if(t.responseCode>=400&&t.responseCode<=499)throw new u.b("\n "+(e.host+e.path)+" -\n "+(t.errorMesg||"")+"\n ",t);if(t.responseCode>=500&&t.responseCode<=599)throw new u.c("\n "+(e.host+e.path)+" -\n "+(t.errorMesg||"")+"\n ",t);return t},!u.b.isInstance(i)&&!u.c.isInstance(i))return[3,19];c.label=15;case 15:return c.trys.push([15,17,,18]),[4,this.interceptResponse(e,i.response)];case 16:return t=c.sent(),[2,o(t)];case 17:if((a=c.sent()).responseCode)return[2,o(a)];throw a;case 18:return[3,20];case 19:throw i;case 20:return[3,21];case 21:return[2]}})}))},e.prototype.addGlobalHeader=function(){return re(this,void 0,void 0,function(){var e;return ne(this,function(t){return e=$($($($($($({Accept:"application/json","Content-Type":"application/json","Access-Control-Allow-Origin":"*"},this.channelId?{"X-Channel-Id":this.channelId}:{}),this.producerId?{"X-App-Id":this.producerId}:{}),this.deviceId?{"X-Device-Id":this.deviceId}:{}),this.sessionId?{"X-Session-Id":this.sessionId}:{}),this.appVersion?{"X-App-Ver":this.appVersion}:{}),this._traceId?{"X-Request-Id":this._traceId}:{}),this.http.addHeaders(e),[2]})})},e.prototype.interceptRequest=function(e){return re(this,void 0,void 0,function(){var t,r,n,i;return ne(this,function(o){switch(o.label){case 0:t=ie(this.requestInterceptors,e.requestInterceptors),r=0,n=t,o.label=1;case 1:return r<n.length?[4,(i=n[r]).interceptRequest(e).toPromise()]:[3,4];case 2:e=o.sent(),o.label=3;case 3:return r++,[3,1];case 4:return[2,e]}})})},e.prototype.interceptResponse=function(e,t){return re(this,void 0,void 0,function(){var r,n,i,o;return ne(this,function(a){switch(a.label){case 0:r=ie(this.responseInterceptors,e.responseInterceptors),n=0,i=r,a.label=1;case 1:return n<i.length?[4,(o=i[n]).interceptResponse(e,t).toPromise()]:[3,4];case 2:t=a.sent(),a.label=3;case 3:return n++,[3,1];case 4:if(t.responseCode!==s.CsHttpResponseCode.HTTP_SUCCESS)throw t;return[2,t]}})})},e.prototype.buildInterceptorsFromRequest=function(e){e.withBearerToken&&-1===e.requestInterceptors.indexOf(this.bearerTokenInjectRequestInterceptor)&&e.requestInterceptors.push(this.bearerTokenInjectRequestInterceptor),e.withUserToken&&-1===e.requestInterceptors.indexOf(this.userTokenInjectRequestInterceptor)&&e.requestInterceptors.push(this.userTokenInjectRequestInterceptor),this.http.setSerializer(e.serializer)},e=J([Object(o.injectable)(),te(0,Object(o.inject)(z.CONTAINER)),te(1,Object(o.inject)(z.core.HTTP_ADAPTER)),te(2,Object(o.optional)()),te(2,Object(o.inject)(z.core.CLIENT_STORAGE)),ee("design:paramtypes",[o.Container,Y,Z.a])],e)}(),ae=r(23),se=r(6),ue=r(9);function ce(e,t){return function r(n){if("function"!=typeof e)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return n.lift(new fe(e,t))}}var fe=function(){function e(e,t){this.project=e,this.thisArg=t}return e.prototype.call=function(e,t){return t.subscribe(new le(e,this.project,this.thisArg))},e}(),le=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.project=r,i.count=0,i.thisArg=n||i,i}return se.a(t,e),t.prototype._next=function(e){var t;try{t=this.project.call(this.thisArg,e,this.count++)}catch(e){return void this.destination.error(e)}this.destination.next(t)},t}(ue.a),pe=function(e){function t(t){var r=e.call(this)||this;return r.parent=t,r}return se.a(t,e),t.prototype._next=function(e){this.parent.notifyNext(e)},t.prototype._error=function(e){this.parent.notifyError(e),this.unsubscribe()},t.prototype._complete=function(){this.parent.notifyComplete(),this.unsubscribe()},t}(ue.a),he=function(e){function t(t,r,n){var i=e.call(this)||this;return i.parent=t,i.outerValue=r,i.outerIndex=n,i}return se.a(t,e),t.prototype._next=function(e){this.parent.notifyNext(this.outerValue,e,this.outerIndex,this)},t.prototype._error=function(e){this.parent.notifyError(e),this.unsubscribe()},t.prototype._complete=function(){this.parent.notifyComplete(this),this.unsubscribe()},t}(ue.a),de=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return se.a(t,e),t.prototype.notifyNext=function(e){this.destination.next(e)},t.prototype.notifyError=function(e){this.destination.error(e)},t.prototype.notifyComplete=function(){this.destination.complete()},t}(ue.a),ye=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return se.a(t,e),t.prototype.notifyNext=function(e,t,r,n){this.destination.next(t)},t.prototype.notifyError=function(e){this.destination.error(e)},t.prototype.notifyComplete=function(e){this.destination.complete()},t}(ue.a);function ge(e,t){if(!t.closed){if(e instanceof p.a)return e.subscribe(t);var r;try{r=_(e)(t)}catch(e){t.error(e)}return r}}function ve(e,t,r){return void 0===r&&(r=Number.POSITIVE_INFINITY),"function"==typeof t?function(n){return n.pipe(ve(function(r,n){return U(e(r,n)).pipe(ce(function(e,i){return t(r,e,n,i)}))},r))}:("number"==typeof t&&(r=t),function(t){return t.lift(new me(e,r))})}var me=function(){function e(e,t){void 0===t&&(t=Number.POSITIVE_INFINITY),this.project=e,this.concurrent=t}return e.prototype.call=function(e,t){return t.subscribe(new be(e,this.project,this.concurrent))},e}(),be=function(e){function t(t,r,n){void 0===n&&(n=Number.POSITIVE_INFINITY);var i=e.call(this,t)||this;return i.project=r,i.concurrent=n,i.hasCompleted=!1,i.buffer=[],i.active=0,i.index=0,i}return se.a(t,e),t.prototype._next=function(e){this.active<this.concurrent?this._tryNext(e):this.buffer.push(e)},t.prototype._tryNext=function(e){var t,r=this.index++;try{t=this.project(e,r)}catch(e){return void this.destination.error(e)}this.active++,this._innerSub(t)},t.prototype._innerSub=function(e){var t=new pe(this),r=this.destination;r.add(t);var n=ge(e,t);n!==t&&r.add(n)},t.prototype._complete=function(){this.hasCompleted=!0,0===this.active&&0===this.buffer.length&&this.destination.complete(),this.unsubscribe()},t.prototype.notifyNext=function(e){this.destination.next(e)},t.prototype.notifyComplete=function(){var e=this.buffer;this.active--,e.length>0?this._next(e.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},t}(de),Ee=ve,Te=r(127),Se=function(){return Se=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Se.apply(this,arguments)},we=function(e,t,r,n){var i=arguments.length,o=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n,a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,r,o):a(t,r))||o);return i>3&&o&&Object.defineProperty(t,r,o),o},Ce=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},_e=function(e,t){return function(r,n){t(r,n,e)}},Ie=function(e,t,r,n){function i(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=Promise))(function(r,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){e.done?r(e.value):i(e.value).then(a,s)}u((n=n.apply(e,t||[])).next())})},Ae=function(e,t){var r={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},n,i,o,a;return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(e){return function(t){return u([e,t])}}function u(a){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=2&a[0]?i.return:a[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,a[1])).done)return o;switch(i=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,i=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(!(o=r.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){r=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){r.label=a[1];break}if(6===a[0]&&r.label<o[1]){r.label=o[1],o=a;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(a);break}o[2]&&r.ops.pop(),r.trys.pop();continue}a=t.call(e,r)}catch(e){a=[6,e],i=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}},Re=function(){function e(e,t,r,n,i){this.httpService=e,this.apiPath=t,this.container=r,this.formService=n,this.updateGroupGuidelinesApiPath=i}return Object.defineProperty(e.prototype,"activityService",{get:function(){return this._activityService||(this._activityService=this.container.get(z.services.group.GROUP_ACTIVITY_SERVICE)),this._activityService},enumerable:!1,configurable:!0}),e.prototype.create=function(e,t){var r=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.POST).withPath((t?t.apiPath:this.apiPath)+"/create").withBearerToken(!0).withUserToken(!0).withBody({request:e}).build();return this.httpService.fetch(r).pipe(ce(function(e){return e.body.result}))},e.prototype.updateById=function(e,t,r){var n=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.PATCH).withPath((r?r.apiPath:this.apiPath)+"/update").withBearerToken(!0).withUserToken(!0).withBody({request:Se({groupId:e},t)}).build();return this.httpService.fetch(n).pipe(ce(function(e){return e.body.result}))},e.prototype.addMembers=function(e,t,r){var n=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.PATCH).withPath((r?r.apiPath:this.apiPath)+"/update").withBearerToken(!0).withUserToken(!0).withBody({request:{groupId:e,members:{add:t.members}}}).build();return this.httpService.fetch(n).pipe(ce(function(e){return e.body.result}))},e.prototype.removeMembers=function(e,t,r){var n=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.PATCH).withPath((r?r.apiPath:this.apiPath)+"/update").withBearerToken(!0).withUserToken(!0).withBody({request:{groupId:e,members:{remove:t.userIds}}}).build();return this.httpService.fetch(n).pipe(ce(function(e){return e.body.result}))},e.prototype.updateMembers=function(e,t,r){var n=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.PATCH).withPath((r?r.apiPath:this.apiPath)+"/update").withBearerToken(!0).withUserToken(!0).withBody({request:{groupId:e,members:{edit:t.members}}}).build();return this.httpService.fetch(n).pipe(ce(function(e){return e.body.result}))},e.prototype.addActivities=function(e,t,r){var n=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.PATCH).withPath((r?r.apiPath:this.apiPath)+"/update").withBearerToken(!0).withUserToken(!0).withBody({request:{groupId:e,activities:{add:t.activities}}}).build();return this.httpService.fetch(n).pipe(ce(function(e){return e.body.result}))},e.prototype.updateActivities=function(e,t,r){var n=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.PATCH).withPath((r?r.apiPath:this.apiPath)+"/update").withBearerToken(!0).withUserToken(!0).withBody({request:{groupId:e,activities:{edit:t.activities}}}).build();return this.httpService.fetch(n).pipe(ce(function(e){return e.body.result}))},e.prototype.removeActivities=function(e,t,r){var n=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.PATCH).withPath((r?r.apiPath:this.apiPath)+"/update").withBearerToken(!0).withUserToken(!0).withBody({request:{groupId:e,activities:{remove:t.activityIds}}}).build();return this.httpService.fetch(n).pipe(ce(function(e){return e.body.result}))},e.prototype.getById=function(e,t,r){var n=this,i=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.GET).withPath((r?r.apiPath:this.apiPath)+"/read/"+e).withParameters(t?{fields:(o=[],t.includeMembers&&o.push("members"),t.includeActivities&&o.push("activities"),o.join(","))}:{}).withBearerToken(!0).withUserToken(!0).build(),o;return this.httpService.fetch(i).pipe(ce(function(e){return e.body.result}),ve(function(e){return Ie(n,void 0,void 0,function(){var r,n,i;return Ae(this,function(o){switch(o.label){case 0:return t&&t.groupActivities&&t.includeActivities?[4,this.getSupportedActivities().toPromise()]:[2,ae.CsGroup.fromJSON(e)];case 1:return r=o.sent(),n=r.data.fields.sort(function(e,t){return e.index-t.index}),i=e.activities,delete e.activities,e.activitiesGrouped=n.map(function(e){var t=i.filter(function(t){return t.type===e.activityType}).sort(function(t,r){for(var n=0,i=0,o=e.sortBy;i<o.length;i++){var a=o[i];if(0!==n)break;for(var s in a)s in a&&(n=String(t.activityInfo[s]).localeCompare(String(r.activityInfo[s])),n="asc"===a[s]?n:-n)}return n});return{title:e.title,translations:e.translations,count:t.length,isEnabled:e.isEnabled,objectType:e.objectType,items:t}}),[2,ae.CsGroup.fromJSON(e)]}})})}))},e.prototype.search=function(e,t){var r=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.POST).withPath((t?t.apiPath:this.apiPath)+"/list").withBearerToken(!0).withUserToken(!0).withBody({request:e}).build();return this.httpService.fetch(r).pipe(ce(function(e){return e.body.result.group.sort(function(e,t){var r=t.updatedOn||t.createdOn,n=e.updatedOn||e.createdOn;return e.status===ae.GroupEntityStatus.SUSPENDED&&t.status!==ae.GroupEntityStatus.SUSPENDED?1:t.status===ae.GroupEntityStatus.SUSPENDED&&e.status!==ae.GroupEntityStatus.SUSPENDED?-1:Te(r.slice(0,r.lastIndexOf(":"))).valueOf()-Te(n.slice(0,n.lastIndexOf(":"))).valueOf()}).map(function(e){return ae.CsGroup.fromJSON(e)})}))},e.prototype.deleteById=function(e,t){var r=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.POST).withPath((t?t.apiPath:this.apiPath)+"/delete").withBearerToken(!0).withUserToken(!0).withBody({request:{groupId:e}}).build();return this.httpService.fetch(r).pipe(ce(function(e){return e.body.result}))},e.prototype.suspendById=function(e,t){return this.updateById(e,{status:ae.GroupEntityStatus.SUSPENDED},t)},e.prototype.reactivateById=function(e,t){return this.updateById(e,{status:ae.GroupEntityStatus.ACTIVE},t)},e.prototype.getSupportedActivities=function(e){var t={type:"group",subType:"supported_activities",action:"list"};return this.formService.getForm(t).pipe(ce(function(e){return e.data.fields=e.data.fields.filter(function(e){return"content"===e.objectType.toLowerCase()}),e}))},e.prototype.updateGroupGuidelines=function(e,t){var r=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.PATCH).withPath((t?t.apiPath:this.updateGroupGuidelinesApiPath)+"/update").withBearerToken(!0).withUserToken(!0).withBody({request:Se({},e)}).build();return this.httpService.fetch(r).pipe(ce(function(e){return e.body.result}))},e.prototype.getActivityDataById=function(e,t){var r=e.activitiesGrouped,n=[],i;return r?(this.groupContentsByActivityType(r).activities[t.type].forEach(function(e){t.id===e.identifier&&(n=e)}),n):[]},e.prototype.groupContentsByActivityType=function(e){var t=e.reduce(function(e,t){return e[t.title]=t.items.map(function(e){var t;return Se(Se({},e.activityInfo),{type:e.type,cardImg:e["activityInfo.appIcon"]||""})}),e},{});return Object.keys(t).forEach(function(e){return t[e].length<=0&&delete t[e]}),{activities:t}},e=we([Object(o.injectable)(),_e(0,Object(o.inject)(z.core.HTTP_SERVICE)),_e(1,Object(o.inject)(z.services.group.GROUP_SERVICE_API_PATH)),_e(2,Object(o.inject)(z.CONTAINER)),_e(3,Object(o.inject)(z.services.form.FORM_SERVICE)),_e(4,Object(o.optional)()),_e(4,Object(o.inject)(z.services.group.GROUP_SERVICE_UPDATE_GUIDELINES_API_PATH)),Ce("design:paramtypes",[Object,String,o.Container,Object,String])],e)}(),Oe=function(e,t,r,n){var i=arguments.length,o=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n,a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,r,o):a(t,r))||o);return i>3&&o&&Object.defineProperty(t,r,o),o},Pe=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},Be=function(e,t){return function(r,n){t(r,n,e)}},ke=function(){function e(e,t,r){this.httpService=e,this.hierarchyApiPath=t,this.questionListApiPath=r}return e.prototype.getQuestionSetHierarchy=function(e,t){var r=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.GET).withPath((t?t.hierarchyApiPath:this.hierarchyApiPath)+"/hierarchy/"+e).withBearerToken(!0).withUserToken(!0).build();return this.httpService.fetch(r).pipe(ce(function(e){return e.body.result}))},e.prototype.getQuestionSetRead=function(e,t,r){var n=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.GET).withPath((r?r.hierarchyApiPath:this.hierarchyApiPath)+"/read/"+e).withParameters(t||{}).withBearerToken(!0).withUserToken(!0).build();return this.httpService.fetch(n).pipe(ce(function(e){return e.body.result}))},e.prototype.getQuestionList=function(e,t){var r=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.POST).withPath((t?t.questionListApiPath:this.questionListApiPath)+"/list").withBearerToken(!0).withUserToken(!0).withBody({request:{search:{identifier:e}}}).build();return this.httpService.fetch(r).pipe(ce(function(e){return e.body.result}))},e=Oe([Object(o.injectable)(),Be(0,Object(o.inject)(z.core.HTTP_SERVICE)),Be(1,Object(o.inject)(z.services.content.CONTENT_SERVICE_HIERARCHY_API_PATH)),Be(2,Object(o.inject)(z.services.content.CONTENT_SERVICE_QUESTION_LIST_API_PATH)),Pe("design:paramtypes",[Object,String,String])],e)}();function Ne(e){return function t(r){var n=new Ue(e),i=r.lift(n);return n.caught=i}}var Ue=function(){function e(e){this.selector=e}return e.prototype.call=function(e,t){return t.subscribe(new De(e,this.selector,this.caught))},e}(),De=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.selector=r,i.caught=n,i}return se.a(t,e),t.prototype.error=function(t){if(!this.isStopped){var r=void 0;try{r=this.selector(t,this.caught)}catch(t){return void e.prototype.error.call(this,t)}this._unsubscribeAndRecycle();var n=new pe(this);this.add(n);var i=ge(r,n);i!==n&&this.add(i)}},t}(de),xe=function(){function e(){this.categoryConfig={}}return Object.defineProperty(e,"instance",{get:function(){return this._instance||(this._instance=new e),this._instance},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"config",{get:function(){return this.categoryConfig},enumerable:!1,configurable:!0}),e.prototype.updateState=function(e,t){this.categoryConfig[e]=t},e.prototype.dispose=function(){this.categoryConfig={}},e}(),Le=function(){return Le=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Le.apply(this,arguments)},je=function(e,t,r,n){var i=arguments.length,o=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n,a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,r,o):a(t,r))||o);return i>3&&o&&Object.defineProperty(t,r,o),o},Me=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},Ve=function(e,t){return function(r,n){t(r,n,e)}},Fe=function(){function e(e,t,r){this.httpService=e,this.apiPath=t,this.formService=r}return e.prototype.getFramework=function(e,t,r){var n=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.GET).withPath((r?r.apiPath:this.apiPath)+"/read/"+e).withParameters(Le({},(null==t?void 0:t.requiredCategories.length)?{categories:t.requiredCategories.join(",")}:{})).withBearerToken(!0).build();return this.httpService.fetch(n).pipe(ce(function(e){return e.body.result.framework}))},e.prototype.getFrameworkConfig=function(e,t,r){var n=this,i;return xe.instance.config[e]?Object(W.a)(xe.instance.config[e]):(null==t?void 0:t.framework)?Object(W.a)(this.transformCategoriesToConfig(null==t?void 0:t.framework.categories)):(null==r?void 0:r.params)?this.formService.getForm(null==r?void 0:r.params,{apiPath:r.apiPath}).pipe(ce(function(e){return e.data.fields}),Ne(function(r){var i;return n.transformFramework(e,null!==(i=null==t?void 0:t.apiPath)&&void 0!==i?i:"")})):this.transformFramework(e,null!==(i=null==t?void 0:t.apiPath)&&void 0!==i?i:"")},e.prototype.getFrameworkConfigMap=function(e,t,r){return this.getFrameworkConfig(e,t,r).pipe(ce(function(e){return e.reduce(function(e,t){var r;return Le(Le({},e),((r={})[t.identifier]=t,r))},{})}))},e.prototype.transformFramework=function(e,t){var r=this;return this.getFramework(e,{requiredCategories:[]},{apiPath:t}).pipe(ce(function(e){return r.transformCategoriesToConfig(e.categories)}))},e.prototype.transformCategoriesToConfig=function(e){return e.map(function(e){var t=e.index,r=e.code,n=e.name;return{code:r,label:n,identifier:"fwCategory"+t,index:t,placeHolder:"Select "+r,name:n}})},e=je([Object(o.injectable)(),Ve(0,Object(o.inject)(z.core.HTTP_SERVICE)),Ve(1,Object(o.inject)(z.services.framework.FRAMEWORK_SERVICE_API_PATH)),Ve(2,Object(o.inject)(z.services.form.FORM_SERVICE)),Me("design:paramtypes",[Object,String,Object])],e)}(),Ke=function(e,t,r,n){var i=arguments.length,o=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n,a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,r,o):a(t,r))||o);return i>3&&o&&Object.defineProperty(t,r,o),o},He=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},qe=function(e,t){return function(r,n){t(r,n,e)}},Ge=function(){function e(e,t){this.httpService=e,this.apiPath=t}return e.prototype.searchLocations=function(e,t){var r=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.POST).withPath((t?t.apiPath:this.apiPath)+"/search").withBearerToken(!0).withUserToken(!1).withBody({request:e}).build();return this.httpService.fetch(r).pipe(ce(function(e){return e.body.result.response}))},e=Ke([Object(o.injectable)(),qe(0,Object(o.inject)(z.core.HTTP_SERVICE)),qe(1,Object(o.inject)(z.services.location.LOCATION_SERVICE_API_PATH)),He("design:paramtypes",[Object,String])],e)}(),ze=function(e,t,r,n){var i=arguments.length,o=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n,a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,r,o):a(t,r))||o);return i>3&&o&&Object.defineProperty(t,r,o),o},Ye=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},We=function(e,t){return function(r,n){t(r,n,e)}},Qe=function(){function e(e,t,r){this.httpService=e,this.apiPath=t,this.certRegistrationApiPath=r}return e.prototype.getUserEnrolledCourses=function(e,t,r){void 0===t&&(t={});var n=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.POST).withPath((r?r.apiPath:this.apiPath)+"/user/enrollment/list").withParameters(t).withBearerToken(!0).withUserToken(!0).withBody({request:e}).build();return this.httpService.fetch(n).pipe(ce(function(e){return e.body.result.courses}))},e.prototype.getSignedCourseCertificate=function(e,t){if(!(this.certRegistrationApiPath||t&&t.certRegistrationApiPath))throw new Error("Required certRegistrationApiPath configuration");var r=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.GET).withPath((t?t.certRegistrationApiPath:this.certRegistrationApiPath)+"/download/"+e).withBearerToken(!0).withUserToken(!0).build();return this.httpService.fetch(r).pipe(ce(function(e){return e.body.result}))},e.prototype.getContentState=function(e,t){var r=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.POST).withPath((t?t.apiPath:this.apiPath)+"/content/state/read").withBearerToken(!0).withUserToken(!0).withBody({request:e}).build();return this.httpService.fetch(r).pipe(ce(function(e){return e.body.result.contentList.map(function(e){return e.score?(e.bestScore=e.score.reduce(function(e,t){return e?e.totalScore<t.totalScore?t:e:t},void 0),e):e})}))},e.prototype.updateContentState=function(e,t){var r=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.PATCH).withPath((t?t.apiPath:this.apiPath)+"/content/state/update").withBearerToken(!0).withUserToken(!0).withBody({request:e}).build();return this.httpService.fetch(r).pipe(ce(function(e){return e.body.result}))},e=ze([Object(o.injectable)(),We(0,Object(o.inject)(z.core.HTTP_SERVICE)),We(1,Object(o.inject)(z.services.course.COURSE_SERVICE_API_PATH)),We(2,Object(o.optional)()),We(2,Object(o.inject)(z.services.course.COURSE_SERVICE_CERT_REGISTRATION_API_PATH)),Ye("design:paramtypes",[Object,String,String])],e)}(),Xe=function(){return Xe=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Xe.apply(this,arguments)},Ze=function(e,t,r,n){var i=arguments.length,o=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n,a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,r,o):a(t,r))||o);return i>3&&o&&Object.defineProperty(t,r,o),o},$e=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},Je=function(e,t){return function(r,n){t(r,n,e)}},et=function(e,t,r,n){function i(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=Promise))(function(r,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){e.done?r(e.value):i(e.value).then(a,s)}u((n=n.apply(e,t||[])).next())})},tt=function(e,t){var r={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},n,i,o,a;return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(e){return function(t){return u([e,t])}}function u(a){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=2&a[0]?i.return:a[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,a[1])).done)return o;switch(i=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,i=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(!(o=r.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){r=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){r.label=a[1];break}if(6===a[0]&&r.label<o[1]){r.label=o[1],o=a;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(a);break}o[2]&&r.ops.pop(),r.trys.pop();continue}a=t.call(e,r)}catch(e){a=[6,e],i=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}},rt=function(){function e(e,t){this.httpService=e,this.apiPath=t}return e.prototype.checkUserExists=function(e,t,r){var n=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.GET).withPath((r?r.apiPath:this.apiPath)+"/exists/"+e.key+"/"+e.value).withBearerToken(!0).withUserToken(!0).withParameters(Xe({},t?Xe({captchaResponse:t.token},t.app?{app:t.app}:{}):{})).build();return this.httpService.fetch(n).pipe(ce(function(e){return e.body.result}))},e.prototype.updateUserDeclarations=function(e,t){var r=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.PATCH).withPath((t?t.apiPath:this.apiPath)+"/declarations").withBearerToken(!0).withUserToken(!0).withBody({request:{declarations:e}}).build();return this.httpService.fetch(r).pipe(ce(function(e){return e.body.result}))},e.prototype.updateConsent=function(e,t){var r=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.POST).withPath((t?t.apiPath:this.apiPath)+"/consent/update").withBearerToken(!0).withUserToken(!0).withBody({request:{consent:e}}).build();return this.httpService.fetch(r).pipe(ce(function(e){return e.body.result}))},e.prototype.getConsent=function(e,t){var r=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.POST).withPath((t?t.apiPath:this.apiPath)+"/consent/read").withBearerToken(!0).withUserToken(!0).withBody({request:{consent:{filters:e}}}).build();return this.httpService.fetch(r).pipe(ce(function(e){return e.body.result}))},e.prototype.getUserFeed=function(e,t){var r=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.GET).withPath((t?t.apiPath:this.apiPath)+"/feed/"+e).withBearerToken(!0).withUserToken(!0).build();return this.httpService.fetch(r).pipe(ce(function(e){return e.body.result.response.userFeed}))},e.prototype.updateUserFeedEntry=function(e,t,r,n,i){var o=this;return j(function(){return et(o,void 0,void 0,function(){var o,a,u;return tt(this,function(c){switch(c.label){case 0:return[4,this.getUserFeed(e,i).toPromise()];case 1:return o=c.sent(),(a=o.find(function(e){return e.id===t&&e.category===r}))?(u=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.PATCH).withPath((i?i.apiPath:this.apiPath)+"/feed/update").withBearerToken(!0).withUserToken(!0).withBody({request:{userId:e,priority:a.priority,category:a.category,feedId:a.id,status:n.status,data:a.data}}).build(),[2,this.httpService.fetch(u).pipe(ce(function(e){return e.body.result.response})).toPromise()]):[2,{}]}})})})},e.prototype.deleteUserFeedEntry=function(e,t,r,n){var i=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.POST).withPath((n?n.apiPath:this.apiPath)+"/feed/delete").withBearerToken(!0).withUserToken(!0).withBody({request:{userId:e,category:r,feedId:t}}).build();return this.httpService.fetch(i).pipe(ce(function(e){return e.body.result.response}))},e.prototype.getProfileDetails=function(e,t){var r=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.GET).withPath((t?t.apiPath:this.apiPath)+"/read/"+e.userId).withParameters({fields:e.requiredFields.join(",")}).withBearerToken(!0).withUserToken(!0).withBody(e).build();return this.httpService.fetch(r).pipe(ce(function(e){return e.body.result.response}))},e.prototype.updateProfile=function(e,t){var r=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.PATCH).withPath((t?t.apiPath:this.apiPath)+"/update").withBearerToken(!0).withUserToken(!0).withBody({request:e}).build();return this.httpService.fetch(r).pipe(ce(function(e){return e.body.result}))},e=Ze([Object(o.injectable)(),Je(0,Object(o.inject)(z.core.HTTP_SERVICE)),Je(1,Object(o.inject)(z.services.user.USER_SERVICE_API_PATH)),$e("design:paramtypes",[Object,String])],e)}(),nt=r(27);function it(e,t){return t?new p.a(function(r){return t.schedule(ot,0,{error:e,subscriber:r})}):new p.a(function(t){return t.error(e)})}function ot(e){var t=e.error,r;e.subscriber.error(t)}var at=function(e,t,r,n){var i=arguments.length,o=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n,a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,r,o):a(t,r))||o);return i>3&&o&&Object.defineProperty(t,r,o),o},st=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},ut=function(e,t){return function(r,n){t(r,n,e)}},ct=function(){function e(e,t){this.httpService=e,this.dataApiPath=t}return e.prototype.getDataAggregation=function(e,t,r,n,i){var o=Date.now(),a=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.POST).withPath((i?i.dataApiPath:this.dataApiPath)+"/activity/agg").withBearerToken(!0).withUserToken(!0).withBody({request:{groupId:e,activityId:t.id,activityType:t.type}}).build();return this.httpService.fetch(a).pipe(ce(function(e){return e.body.result}),Ne(function(r){return u.b.isInstance(r)&&r.response.responseCode===s.CsHttpResponseCode.HTTP_BAD_REQUEST&&r.response.body.params.errmsg.includes("No member found in this group")?Object(W.a)({activity:{agg:[{metric:nt.a.ENROLMENT_COUNT,lastUpdatedOn:o,value:0}],id:t.id,type:t.type},groupId:e,members:[]}):it(r)}),ce(function(e){if(!r)return e;if(n)e.activity.agg.push({metric:nt.a.LEAF_NODES_COUNT,lastUpdatedOn:o,value:n});else{var i=(r.activities||[]).find(function(e){return e.id===t.id&&e.type.toLowerCase()===t.type.toLowerCase()&&e.activityInfo&&e.activityInfo.leafNodesCount});i&&(e.activity.agg.push({metric:nt.a.LEAF_NODES_COUNT,lastUpdatedOn:i.activityInfo.lastUpdatedOn?new Date(i.activityInfo.lastUpdatedOn).getTime():o,value:i.activityInfo.leafNodesCount}),n=i.activityInfo.leafNodesCount)}return e.members=(r.members||[]).map(function(t){var r=e.members.filter(function(e){return e.userId===t.userId}).sort(function(e,t){var r=e.agg.find(function(e){return e.metric===nt.a.COMPLETED_COUNT}),n=t.agg.find(function(e){return e.metric===nt.a.COMPLETED_COUNT});return r||n?!r&&n?1:r&&!n?-1:n.value-r.value:0})[0];if(r){if(n){var i=r.agg.find(function(e){return e.metric===nt.a.COMPLETED_COUNT});i&&r.agg.push({metric:nt.a.PROGRESS,lastUpdatedOn:o,value:Math.round(Math.min(i.value,n)/n*100)})}return r}return{role:t.role,createdBy:t.createdBy,name:t.name,userId:t.userId,status:t.status,agg:[{metric:nt.a.COMPLETED_COUNT,lastUpdatedOn:o,value:0}]}}),e}))},e.prototype.getDataForDashlets=function(e,t){var r=this.getAssessments(e,{}),n=[];t.members.forEach(function(e){var t={name:e.name,progress:0};e.agg.forEach(function(e){if(0===e.metric.lastIndexOf("score")){var n=r[e.metric.split(":")[1]];e.metric=n,t[n]=e.value}"progress"===e.metric&&(t.progress=e.value)}),n.push(t)});var i=0,o=0,a=[];return n.forEach(function(e,t){var r=function(e){if(!a.find(function(t){return t.data===e})){var t={title:e.charAt(0).toUpperCase()+e.substr(1),data:e,render:function(t,r,n){var i=t||n[e];return i||0===i?i:"NA"}};"progress"===e&&(t.title="Progress%"),a.push(t)}};for(var n in e)r(n)}),Object(W.a)({rows:n,columns:a})},e.prototype.getAssessments=function(e,t){var r=this;return e.forEach(function(e){e.children&&e.children.length?r.getAssessments(e.children,t):t[e.identifier]=e.name}),t},e=at([Object(o.injectable)(),ut(0,Object(o.inject)(z.core.HTTP_SERVICE)),ut(1,Object(o.inject)(z.services.group.GROUP_SERVICE_DATA_API_PATH)),st("design:paramtypes",[Object,String])],e)}(),ft=function(e,t,r,n){var i=arguments.length,o=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n,a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,r,o):a(t,r))||o);return i>3&&o&&Object.defineProperty(t,r,o),o},lt=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},pt=function(e,t){return function(r,n){t(r,n,e)}},ht=function(){function e(e,t){this.httpService=e,this.apiPath=t}return e.prototype.getForm=function(e,t){var r=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.POST).withPath((t?t.apiPath:this.apiPath)+"/read").withBody({request:e}).withBearerToken(!0).build();return this.httpService.fetch(r).pipe(ce(function(e){return e.body.result.form}))},e=ft([Object(o.injectable)(),pt(0,Object(o.inject)(z.core.HTTP_SERVICE)),pt(1,Object(o.inject)(z.services.form.FORM_SERVICE_API_PATH)),lt("design:paramtypes",[Object,String])],e)}(),dt=function(e,t,r,n){var i=arguments.length,o=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n,a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,r,o):a(t,r))||o);return i>3&&o&&Object.defineProperty(t,r,o),o},yt=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},gt=function(e,t){return function(r,n){t(r,n,e)}},vt=function(){function e(e,t){void 0===t&&(t=""),this.httpService=e,this.apiPath=t}return e.prototype.getSystemSettings=function(e,t){var r=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.GET).withPath((t?t.apiPath:this.apiPath)+"/system/settings/get/"+e).withBearerToken(!0).build();return this.httpService.fetch(r).pipe(ce(function(e){return e.body.result.response.value}))},e=dt([Object(o.injectable)(),gt(0,Object(o.inject)(z.core.HTTP_SERVICE)),gt(1,Object(o.optional)()),gt(1,Object(o.inject)(z.services.systemSettings.SYSTEM_SETTINGS_SERVICE_API_PATH)),yt("design:paramtypes",[Object,String])],e)}(),mt=function(){return mt=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},mt.apply(this,arguments)},bt=function(e,t,r,n){var i=arguments.length,o=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n,a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,r,o):a(t,r))||o);return i>3&&o&&Object.defineProperty(t,r,o),o},Et=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},Tt=function(e,t){return function(r,n){t(r,n,e)}},St=function(){function e(e,t,r,n){this.httpService=e,this.apiPath=t,this.container=r,this.formService=n}return e.prototype.fetchAllTags=function(e){var t=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.GET).withPath((e?e.apiPath:this.apiPath)+"/tags").withBearerToken(!0).withUserToken(!0).build();return this.httpService.fetch(t).pipe(ce(function(e){return e.body}))},e.prototype.createPost=function(e,t){var r=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.POST).withPath((t?t.apiPath:this.apiPath)+"/v3/topics").withBearerToken(!0).withUserToken(!0).withBody(e).build();return this.httpService.fetch(r).pipe(ce(function(e){return e.body}))},e.prototype.fetchAllCategories=function(e){var t=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.GET).withPath((e?e.apiPath:this.apiPath)+"/categories").withBearerToken(!0).withUserToken(!0).build();return this.httpService.fetch(t).pipe(ce(function(e){return e.body}))},e.prototype.fetchSingleCategoryDetails=function(e,t){var r=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.GET).withPath((t?t.apiPath:this.apiPath)+"/category/"+e).withBearerToken(!0).withUserToken(!0).build();return this.httpService.fetch(r).pipe(ce(function(e){return e.body}))},e.prototype.votePost=function(e,t,r){var n=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.PUT).withPath((r?r.apiPath:this.apiPath)+"/v3/posts/"+e+"/vote").withBearerToken(!0).withUserToken(!0).withBody(t).build();return this.httpService.fetch(n).pipe(ce(function(e){return e.body}))},e.prototype.deleteVotePost=function(e,t){var r=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.DELETE).withPath((t?t.apiPath:this.apiPath)+"/v3/posts/"+e+"/vote").withBearerToken(!0).withUserToken(!0).build();return this.httpService.fetch(r).pipe(ce(function(e){return e.body}))},e.prototype.bookmarkPost=function(e,t){var r=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.PUT).withPath((t?t.apiPath:this.apiPath)+"/v3/posts/"+e+"/bookmark").withBearerToken(!0).withUserToken(!0).build();return this.httpService.fetch(r).pipe(ce(function(e){return e.body}))},e.prototype.deleteBookmarkPost=function(e,t){var r=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.DELETE).withPath((t?t.apiPath:this.apiPath)+"/v3/posts/"+e+"/bookmark").withBearerToken(!0).withUserToken(!0).build();return this.httpService.fetch(r).pipe(ce(function(e){return e.body}))},e.prototype.replyPost=function(e,t,r){var n=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.POST).withPath((r?r.apiPath:this.apiPath)+"/v3/topics/"+e).withBearerToken(!0).withUserToken(!0).withBody(t).build();return this.httpService.fetch(n).pipe(ce(function(e){return e.body}))},e.prototype.fetchRecentD=function(e,t){var r=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.GET).withPath((t?t.apiPath:this.apiPath)+"/topics/recent/?page="+e).withBearerToken(!0).withUserToken(!0).build();return this.httpService.fetch(r).pipe(ce(function(e){return e.body}))},e.prototype.fetchTopicById=function(e,t,r,n){var i="/topic/"+e.toString()+"/"+t,o=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.GET).withPath(""+(n?n.apiPath:this.apiPath)+i+"?page="+r).withBearerToken(!0).withUserToken(!0).build();return this.httpService.fetch(o).pipe(ce(function(e){return e.body}))},e.prototype.fetchTopicByIdSort=function(e,t,r,n){var i="/topic/"+e.toString()+"/",o=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.GET).withPath(""+(n?n.apiPath:this.apiPath)+i+"?page="+r+"&sort="+t).withBearerToken(!0).withUserToken(!0).build();return this.httpService.fetch(o).pipe(ce(function(e){return e.body}))},e.prototype.fetchUnreadCOunt=function(e){var t=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.GET).withPath((e?e.apiPath:this.apiPath)+"/topics/unread/total").withBearerToken(!0).withUserToken(!0).build();return this.httpService.fetch(t).pipe(ce(function(e){return e.body}))},e.prototype.fetchProfileInfo=function(e,t){var r=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.GET).withPath((t?t.apiPath:this.apiPath)+"/users/"+e+"/about").withBearerToken(!0).withUserToken(!0).build();return this.httpService.fetch(r).pipe(ce(function(e){return e.body}))},e.prototype.fetchUpvoted=function(e,t,r){var n=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.GET).withPath((r?r.apiPath:this.apiPath)+"/user/"+e+"/upvoted?page="+(t||1)).withBearerToken(!0).withUserToken(!0).build();return this.httpService.fetch(n).pipe(ce(function(e){return e.body}))},e.prototype.fetchDownvoted=function(e,t,r){var n=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.GET).withPath((r?r.apiPath:this.apiPath)+"/user/"+e+"/downvoted?page="+(t||1)).withBearerToken(!0).withUserToken(!0).build();return this.httpService.fetch(n).pipe(ce(function(e){return e.body}))},e.prototype.fetchSaved=function(e,t,r){var n=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.GET).withPath((r?r.apiPath:this.apiPath)+"/user/"+e+"/bookmarks?page="+(t||1)).withBearerToken(!0).withUserToken(!0).build();return this.httpService.fetch(n).pipe(ce(function(e){return e.body}))},e.prototype.fetchNetworkProfile=function(e,t){var r=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.GET).withPath((t?t.apiPath:this.apiPath)+"/user/"+e).withBearerToken(!0).withUserToken(!0).build();return this.httpService.fetch(r).pipe(ce(function(e){return e.body}))},e.prototype.getContextBasedTopic=function(e,t,r){console.log(e,t,r,"csl");var n=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.GET).withPath((r?r.apiPath:this.apiPath)+"/category/"+e+"?page="+t).withBearerToken(!0).withUserToken(!0).build();return this.httpService.fetch(n).pipe(ce(function(e){return e.body}))},e.prototype.createUser=function(e,t){var r=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.POST).withPath((t?t.apiPath:this.apiPath)+"/user/v1/create").withBearerToken(!0).withUserToken(!0).withBody({request:mt({},e)}).build();return this.httpService.fetch(r).pipe(ce(function(e){return e.body}))},e.prototype.getForumIds=function(e,t){var r=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.POST).withPath((t?t.apiPath:this.apiPath)+"/forum/v2/read").withBearerToken(!0).withUserToken(!0).withBody({request:mt({},e)}).build();return this.httpService.fetch(r).pipe(ce(function(e){return e.body}))},e.prototype.getUserDetails=function(e,t){var r=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.GET).withPath((t?t.apiPath:this.apiPath)+"/user/uid/"+e).withBearerToken(!0).withUserToken(!0).build();return this.httpService.fetch(r).pipe(ce(function(e){return e.body}))},e.prototype.editPost=function(e,t,r){var n=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.POST).withPath((r?r.apiPath:this.apiPath)+"/v3/posts/"+e).withBearerToken(!0).withUserToken(!0).withBody(t).build();return this.httpService.fetch(n).pipe(ce(function(e){return e.body}))},e.prototype.deletePost=function(e,t,r){var n=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.DELETE).withPath((r?r.apiPath:this.apiPath)+"/v3/posts/"+e+"?uid="+t).withBearerToken(!0).withUserToken(!0).build();return this.httpService.fetch(n).pipe(ce(function(e){return e.body}))},e.prototype.removeForum=function(e,t){var r=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.POST).withPath((t?t.apiPath:this.apiPath)+"/forum/v2/remove").withBearerToken(!0).withUserToken(!0).withBody({request:mt({},e)}).build();return this.httpService.fetch(r).pipe(ce(function(e){return e.body}))},e.prototype.createForum=function(e,t){var r=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.POST).withPath((t?t.apiPath:this.apiPath)+"/forum/v3/create").withBearerToken(!0).withUserToken(!0).withBody(e).build();return this.httpService.fetch(r).pipe(ce(function(e){return e.body}))},e.prototype.attachForum=function(e){var t=this,r,n={type:"forum",action:"create",subType:e.type};return this.formService.getForm(n).pipe(ve(function(n){return(r=n.data.fields[0]).category.context=[e.context],t.createForum(r).pipe(ce(function(e){return e.result[0]}))}))},e.prototype.deleteTopic=function(e,t){var r=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.DELETE).withPath((t?t.apiPath:this.apiPath)+"/v3/topics/"+e).withBearerToken(!0).withUserToken(!0).build();return this.httpService.fetch(r).pipe(ce(function(e){return e.body}))},e.prototype.editTopic=function(e,t,r){var n=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.POST).withPath((r?r.apiPath:this.apiPath)+"/v3/topics/"+e).withBearerToken(!0).withUserToken(!0).withBody(t).build();return this.httpService.fetch(n).pipe(ce(function(e){return e.body}))},e.prototype.getContextBasedDiscussion=function(e,t){var r=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.POST).withPath((t?t.apiPath:this.apiPath)+"/category/list").withBearerToken(!0).withUserToken(!0).withBody({request:mt({},e)}).build();return this.httpService.fetch(r).pipe(ce(function(e){return e.body}))},e.prototype.getContextBasedTagDiscussion=function(e,t){var r=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.POST).withPath((t?t.apiPath:this.apiPath)+"/tags/list").withBearerToken(!0).withUserToken(!0).withBody({request:mt({},e)}).build();return this.httpService.fetch(r).pipe(ce(function(e){return e.body}))},e.prototype.recentPost=function(e,t,r){var n=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.GET).withPath((r?r.apiPath:this.apiPath)+"/user/"+e+"/posts?page="+(t||1)).withBearerToken(!0).withUserToken(!0).build();return this.httpService.fetch(n).pipe(ce(function(e){return e.body}))},e.prototype.fetchBestPost=function(e,t,r){var n=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.GET).withPath((r?r.apiPath:this.apiPath)+"/user/"+e+"/best?page="+(t||1)).withBearerToken(!0).withUserToken(!0).build();return this.httpService.fetch(n).pipe(ce(function(e){return e.body}))},e.prototype.popularPost=function(e){var t=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.GET).withPath((e?e.apiPath:this.apiPath)+"/popular").withBearerToken(!0).withUserToken(!0).build();return this.httpService.fetch(t).pipe(ce(function(e){return e.body}))},e.prototype.getSingleCategoryDetails=function(e,t){var r=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.GET).withPath((t?t.apiPath:this.apiPath)+"/category/"+e).withBearerToken(!0).withUserToken(!0).build();return this.httpService.fetch(r).pipe(ce(function(e){return e.body}))},e.prototype.contextBasedTags=function(e,t){var r=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.POST).withPath((t?t.apiPath:this.apiPath)+"/forum/tags").withBearerToken(!0).withUserToken(!0).withBody({request:mt({},e)}).build();return this.httpService.fetch(r).pipe(ce(function(e){return e.body}))},e.prototype.getTagBasedDiscussion=function(e,t){var r=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.GET).withPath((t?t.apiPath:this.apiPath)+"/tags/"+e).withBearerToken(!0).withUserToken(!0).build();return this.httpService.fetch(r).pipe(ce(function(e){return e.body}))},e.prototype.initializeUserDetails=function(e){var t=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.GET).withPath((e?e.apiPath:this.apiPath)+"/users/me").withBearerToken(!0).withUserToken(!0).build();return this.httpService.fetch(t).pipe(ce(function(e){return e.body}))},e=bt([Object(o.injectable)(),Tt(0,Object(o.inject)(z.core.HTTP_SERVICE)),Tt(1,Object(o.inject)(z.services.discussion.DISCUSSION_SERVICE_API_PATH)),Tt(2,Object(o.inject)(z.CONTAINER)),Tt(3,Object(o.inject)(z.services.form.FORM_SERVICE)),Et("design:paramtypes",[Object,String,o.Container,Object])],e)}(),wt=function(e,t,r,n){var i=arguments.length,o=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n,a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,r,o):a(t,r))||o);return i>3&&o&&Object.defineProperty(t,r,o),o},Ct=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},_t=function(e,t){return function(r,n){t(r,n,e)}},It=function(){function e(e,t){this.httpService=e,this.apiPath=t}return e.prototype.notificationRead=function(e,t){var r=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.GET).withPath((t?t.apiPath:this.apiPath)+"/read/"+e).withBearerToken(!0).withUserToken(!0).build();return this.httpService.fetch(r).pipe(ce(function(e){return e.body.result}))},e.prototype.notificationDelete=function(e,t){var r=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.POST).withPath((t?t.apiPath:this.apiPath)+"/delete").withBearerToken(!0).withUserToken(!0).withBody({request:e}).build();return this.httpService.fetch(r).pipe(ce(function(e){return e.body.result}))},e.prototype.notificationUpdate=function(e,t){var r=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.PATCH).withPath((t?t.apiPath:this.apiPath)+"/update").withBearerToken(!0).withUserToken(!0).withBody({request:e}).build();return this.httpService.fetch(r).pipe(ce(function(e){return e.body.result}))},e=wt([Object(o.injectable)(),_t(0,Object(o.inject)(z.core.HTTP_SERVICE)),_t(1,Object(o.inject)(z.services.notification.NOTIFICATION_SERVICE_API_PATH)),Ct("design:paramtypes",[Object,String])],e)}(),At;function Rt(e,t,r){return void 0===t&&(t=D),void 0===r&&(r=D),j(function(){return e()?t:r})}!function(e){e.CERTIFICATE_REGISTRY="certificate_registry",e.RC_CERTIFICATE_REGISTRY="rc_certificate_registry"}(At||(At={}));var Ot=r(53),Pt=r.n(Ot),Bt=r(70),kt={"@context":{"@version":1.1,"@protected":!0,id:"@id",type:"@type",VerifiableCredential:{"@id":"https://www.w3.org/2018/credentials#VerifiableCredential","@context":{"@version":1.1,"@protected":!0,id:"@id",type:"@type",cred:"https://www.w3.org/2018/credentials#",sec:"https://w3id.org/security#",xsd:"http://www.w3.org/2001/XMLSchema#",credentialSchema:{"@id":"cred:credentialSchema","@type":"@id","@context":{"@version":1.1,"@protected":!0,id:"@id",type:"@type",cred:"https://www.w3.org/2018/credentials#",JsonSchemaValidator2018:"cred:JsonSchemaValidator2018"}},credentialStatus:{"@id":"cred:credentialStatus","@type":"@id"},credentialSubject:{"@id":"cred:credentialSubject","@type":"@id"},evidence:{"@id":"cred:evidence","@type":"@id"},expirationDate:{"@id":"cred:expirationDate","@type":"xsd:dateTime"},holder:{"@id":"cred:holder","@type":"@id"},issued:{"@id":"cred:issued","@type":"xsd:dateTime"},issuer:{"@id":"cred:issuer","@type":"@id"},issuanceDate:{"@id":"cred:issuanceDate","@type":"xsd:dateTime"},proof:{"@id":"sec:proof","@type":"@id","@container":"@graph"},refreshService:{"@id":"cred:refreshService","@type":"@id","@context":{"@version":1.1,"@protected":!0,id:"@id",type:"@type",cred:"https://www.w3.org/2018/credentials#",ManualRefreshService2018:"cred:ManualRefreshService2018"}},termsOfUse:{"@id":"cred:termsOfUse","@type":"@id"},validFrom:{"@id":"cred:validFrom","@type":"xsd:dateTime"},validUntil:{"@id":"cred:validUntil","@type":"xsd:dateTime"}}},VerifiablePresentation:{"@id":"https://www.w3.org/2018/credentials#VerifiablePresentation","@context":{"@version":1.1,"@protected":!0,id:"@id",type:"@type",cred:"https://www.w3.org/2018/credentials#",sec:"https://w3id.org/security#",holder:{"@id":"cred:holder","@type":"@id"},proof:{"@id":"sec:proof","@type":"@id","@container":"@graph"},verifiableCredential:{"@id":"cred:verifiableCredential","@type":"@id","@container":"@graph"}}},EcdsaSecp256k1Signature2019:{"@id":"https://w3id.org/security#EcdsaSecp256k1Signature2019","@context":{"@version":1.1,"@protected":!0,id:"@id",type:"@type",sec:"https://w3id.org/security#",xsd:"http://www.w3.org/2001/XMLSchema#",challenge:"sec:challenge",created:{"@id":"http://purl.org/dc/terms/created","@type":"xsd:dateTime"},domain:"sec:domain",expires:{"@id":"sec:expiration","@type":"xsd:dateTime"},jws:"sec:jws",nonce:"sec:nonce",proofPurpose:{"@id":"sec:proofPurpose","@type":"@vocab","@context":{"@version":1.1,"@protected":!0,id:"@id",type:"@type",sec:"https://w3id.org/security#",assertionMethod:{"@id":"sec:assertionMethod","@type":"@id","@container":"@set"},authentication:{"@id":"sec:authenticationMethod","@type":"@id","@container":"@set"}}},proofValue:"sec:proofValue",verificationMethod:{"@id":"sec:verificationMethod","@type":"@id"}}},EcdsaSecp256r1Signature2019:{"@id":"https://w3id.org/security#EcdsaSecp256r1Signature2019","@context":{"@version":1.1,"@protected":!0,id:"@id",type:"@type",sec:"https://w3id.org/security#",xsd:"http://www.w3.org/2001/XMLSchema#",challenge:"sec:challenge",created:{"@id":"http://purl.org/dc/terms/created","@type":"xsd:dateTime"},domain:"sec:domain",expires:{"@id":"sec:expiration","@type":"xsd:dateTime"},jws:"sec:jws",nonce:"sec:nonce",proofPurpose:{"@id":"sec:proofPurpose","@type":"@vocab","@context":{"@version":1.1,"@protected":!0,id:"@id",type:"@type",sec:"https://w3id.org/security#",assertionMethod:{"@id":"sec:assertionMethod","@type":"@id","@container":"@set"},authentication:{"@id":"sec:authenticationMethod","@type":"@id","@container":"@set"}}},proofValue:"sec:proofValue",verificationMethod:{"@id":"sec:verificationMethod","@type":"@id"}}},Ed25519Signature2018:{"@id":"https://w3id.org/security#Ed25519Signature2018","@context":{"@version":1.1,"@protected":!0,id:"@id",type:"@type",sec:"https://w3id.org/security#",xsd:"http://www.w3.org/2001/XMLSchema#",challenge:"sec:challenge",created:{"@id":"http://purl.org/dc/terms/created","@type":"xsd:dateTime"},domain:"sec:domain",expires:{"@id":"sec:expiration","@type":"xsd:dateTime"},jws:"sec:jws",nonce:"sec:nonce",proofPurpose:{"@id":"sec:proofPurpose","@type":"@vocab","@context":{"@version":1.1,"@protected":!0,id:"@id",type:"@type",sec:"https://w3id.org/security#",assertionMethod:{"@id":"sec:assertionMethod","@type":"@id","@container":"@set"},authentication:{"@id":"sec:authenticationMethod","@type":"@id","@container":"@set"}}},proofValue:"sec:proofValue",verificationMethod:{"@id":"sec:verificationMethod","@type":"@id"}}},RsaSignature2018:{"@id":"https://w3id.org/security#RsaSignature2018","@context":{"@version":1.1,"@protected":!0,challenge:"sec:challenge",created:{"@id":"http://purl.org/dc/terms/created","@type":"xsd:dateTime"},domain:"sec:domain",expires:{"@id":"sec:expiration","@type":"xsd:dateTime"},jws:"sec:jws",nonce:"sec:nonce",proofPurpose:{"@id":"sec:proofPurpose","@type":"@vocab","@context":{"@version":1.1,"@protected":!0,id:"@id",type:"@type",sec:"https://w3id.org/security#",assertionMethod:{"@id":"sec:assertionMethod","@type":"@id","@container":"@set"},authentication:{"@id":"sec:authenticationMethod","@type":"@id","@container":"@set"}}},proofValue:"sec:proofValue",verificationMethod:{"@id":"sec:verificationMethod","@type":"@id"}}},proof:{"@id":"https://w3id.org/security#proof","@type":"@id","@container":"@graph"}}},Nt={"@version":1.1,"@protected":!0,SkillCertificate:{"@id":"https://github.com/sunbird-specs/vc-specs#SkillCertificate","@context":{id:"@id","@version":1.1,"@protected":!0,skills:"schema:Text"}},Person:{"@id":"https://github.com/sunbird-specs/vc-specs#Person","@context":{name:"schema:Text"}},trainedOn:{"@id":"https://github.com/sunbird-specs/vc-specs#trainedOn","@context":{name:"schema:Text"}}},Ut="https://gist.githubusercontent.com/dileepbapat/eb932596a70f75016411cc871113a789/raw/498e5af1d94784f114b32c1ab827f951a8a24def/skill",Dt=function(){return Dt=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Dt.apply(this,arguments)},xt=function(e,t,r,n){function i(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=Promise))(function(r,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){e.done?r(e.value):i(e.value).then(a,s)}u((n=n.apply(e,t||[])).next())})},Lt=function(e,t){var r={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},n,i,o,a;return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(e){return function(t){return u([e,t])}}function u(a){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=2&a[0]?i.return:a[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,a[1])).done)return o;switch(i=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,i=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(!(o=r.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){r=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){r.label=a[1];break}if(6===a[0]&&r.label<o[1]){r.label=o[1],o=a;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(a);break}o[2]&&r.ops.pop(),r.trys.pop();continue}a=t.call(e,r)}catch(e){a=[6,e],i=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}},jt=r(73),Mt=jt.RSAKeyPair,Vt=jt.Ed25519KeyPair,Ft="https://sunbird.org/",Kt="did:india",Ht=function(){function e(e,t){var r=this;this.httpService=e,this.container=t,this.publicKey="",this.customLoader=function(e){return xt(r,void 0,void 0,function(){var t,r,n,i,o,a;return Lt(this,function(u){switch(u.label){case 0:return t={"did:india":this.publicKey,"https://example.com/i/india":this.publicKey,"https://w3id.org/security/v1":Bt.contexts.get("https://w3id.org/security/v1"),"https://www.w3.org/2018/credentials#":kt,"https://www.w3.org/2018/credentials/v1":kt},void 0===(r=t[e])&&(r=Bt.contexts[e]),void 0!==r?[2,n={contextUrl:null,documentUrl:e,document:r}]:e.startsWith("{")?[2,JSON.parse(e)]:(console.log("====> host ",this.host),i=(new s.CsRequest.Builder).withHost("https://").withType(s.CsHttpRequestType.GET).withPath(e.split("//")[1]).withBearerToken(!1).withHeaders({Origin:this.host}).withUserToken(!1).build(),console.log("====> apiRequest ",i),[4,this.httpService.fetch(i).pipe(ce(function(e){return e.body}),Ne(function(e){throw e})).toPromise()]);case 1:return o=u.sent(),[2,a={contextUrl:null,documentUrl:e,document:o}]}})})}}return Object.defineProperty(e.prototype,"host",{get:function(){return this.container.get(z.core.api.HOST)},enumerable:!1,configurable:!0}),e.prototype.verifyData=function(e,t){return xt(this,void 0,void 0,function(){var r,n,i,o,a,s,u;return Lt(this,function(c){switch(c.label){case 0:this.publicKey=t,c.label=1;case 1:return c.trys.push([1,3,,4]),r=Pt.a.purposes.AssertionProofPurpose,n=void 0,i={"@context":Pt.a.SECURITY_CONTEXT_URL,id:Kt,type:"RsaVerificationKey2018",controller:Ft,publicKeyPem:this.publicKey},o={"@context":Pt.a.SECURITY_CONTEXT_URL,id:Ft,publicKey:[i],assertionMethod:[i.id]},a=new Mt(Dt({},i)),s=Pt.a.suites.RsaSignature2018,[4,Pt.a.verify(e,{suite:new s({key:a}),purpose:new r({controller:o}),documentLoader:this.customLoader,compactProof:!1})];case 2:return(n=c.sent()).certificateData={issuedTo:e.credentialSubject.recipientName,issuanceDate:e.issuanceDate,issuerName:e.issuer.name,trainingName:e.credentialSubject.trainingName,trainigId:e.credentialSubject.trainingId},[2,n];case 3:throw u=c.sent(),new Error("Invalid data");case 4:return[2]}})})},e}(),qt=r(171),Gt=r.n(qt),zt=function(){return zt=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},zt.apply(this,arguments)},Yt=function(e,t,r,n){var i=arguments.length,o=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n,a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,r,o):a(t,r))||o);return i>3&&o&&Object.defineProperty(t,r,o),o},Wt=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},Qt=function(e,t){return function(r,n){t(r,n,e)}},Xt=function(e,t,r,n){function i(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=Promise))(function(r,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){e.done?r(e.value):i(e.value).then(a,s)}u((n=n.apply(e,t||[])).next())})},Zt=function(e,t){var r={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},n,i,o,a;return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(e){return function(t){return u([e,t])}}function u(a){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=2&a[0]?i.return:a[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,a[1])).done)return o;switch(i=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,i=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(!(o=r.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){r=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){r.label=a[1];break}if(6===a[0]&&r.label<o[1]){r.label=o[1],o=a;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(a);break}o[2]&&r.ops.pop(),r.trys.pop();continue}a=t.call(e,r)}catch(e){a=[6,e],i=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}},$t=function(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;for(var n=Array(e),i=0,t=0;t<r;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,i++)n[i]=o[a];return n},Jt=function(){function e(e,t,r,n,i,o){this.httpService=e,this.apiPath=t,this.apiPathLegacy=r,this.rcApiPath=n,this.systemSettingsService=i,this.container=o}return e.prototype.fetchCertificatesV1=function(e,t){if(!(this.apiPath||t&&t.apiPath))throw new Error("Required certificate api Path configuration");var r=zt(zt({},e.size?{size:e.size}:null),{_source:["data.badge.issuer.name","pdfUrl","data.issuedOn","data.badge.name","related.courseId","related.Id"],query:{bool:{must:[{match_phrase:{"recipient.id":e.userId}}]}}}),n=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.POST).withPath((t?t.apiPath:this.apiPath)+"/certs/search").withBearerToken(!0).withUserToken(!0).withBody({request:r}).build();return this.httpService.fetch(n).pipe(ce(function(e){return e.body.result.response}),Ne(function(e){return console.error(e),Object(W.a)({count:0,content:[]})}))},e.prototype.fetchCertificatesV2=function(e,t){var r=this;return j(function(){return Xt(r,void 0,void 0,function(){var r,n,i,o;return Zt(this,function(a){switch(a.label){case 0:if(r=e.schemaName)return[3,4];a.label=1;case 1:return a.trys.push([1,3,,4]),[4,this.systemSettingsService.getSystemSettings("certificate_schema").toPromise()];case 2:return r=a.sent(),[3,4];case 3:throw n=a.sent(),new Error("Schema Name Not found");case 4:return i={filters:{recipient:{id:{eq:e.userId}}}},o=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.POST).withPath((t?t.rcApiPath:this.rcApiPath).replace("${schemaName}",r)+"/search").withBearerToken(!0).withUserToken(!0).withBody(i).build(),[2,this.httpService.fetch(o).pipe(ce(function(e){return e.body.map(function(e){var t;return{id:e.osid,trainingName:e.training.name,issuerName:e.issuer.name,issuedOn:e.issuer.osUpdatedAt,courseId:e.training.id,templateUrl:e.templateUrl,type:At.RC_CERTIFICATE_REGISTRY}})}),Ne(function(e){return console.error(e),Object(W.a)([])})).toPromise()]}})})})},e.prototype.fetchCertificates=function(e,t){var r=this;return this.fetchCertificatesV1(e,t).pipe(ve(function(n){return r.fetchCertificatesV2(e,t).pipe(ce(function(e){var t=n.content.map(function(e){return{id:e._id,trainingName:e._source.data?e._source.data.badge.name:void 0,issuerName:e._source.data?e._source.data.badge.issuer.name:void 0,issuedOn:e._source.data?e._source.data.issuedOn:void 0,courseId:e._source.related.courseId,pdfUrl:e._source.pdfUrl,templateUrl:e._source.templateUrl,type:At.CERTIFICATE_REGISTRY}}),r;return{certRegCount:n.count,rcCount:e.length,certificates:$t(t,e)}}))}))},e.prototype.getPublicKey=function(e,t){var r=this;return j(function(){return Xt(r,void 0,void 0,function(){var r,n,i;return Zt(this,function(o){switch(o.label){case 0:if(r=e.schemaName)return[3,4];o.label=1;case 1:return o.trys.push([1,3,,4]),[4,this.systemSettingsService.getSystemSettings("certificate_schema").toPromise()];case 2:return r=o.sent(),[3,4];case 3:throw n=o.sent(),new Error("Schema Name Not found");case 4:return i=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.GET).withPath((t?t.rcApiPath:this.rcApiPath).replace("${schemaName}",r)+"/key/"+e.osid).withBearerToken(!0).withUserToken(!0).withBody({request:e}).build(),[2,this.httpService.fetch(i).pipe(ce(function(e){return e.body})).toPromise()]}})})})},e.prototype.getCerificateDownloadURI=function(e,t){var r=this;return Rt(function(){return e.type===At.RC_CERTIFICATE_REGISTRY},j(function(){return Xt(r,void 0,void 0,function(){var r,n,i;return Zt(this,function(o){switch(o.label){case 0:if(r=e.schemaName)return[3,4];o.label=1;case 1:return o.trys.push([1,3,,4]),[4,this.systemSettingsService.getSystemSettings("certificate_schema").toPromise()];case 2:return r=o.sent(),[3,4];case 3:throw n=o.sent(),new Error("Schema Name Not found");case 4:return i=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.GET).withPath((t?t.rcApiPath:this.rcApiPath).replace("${schemaName}",r)+"/download/"+e.certificateId).withBearerToken(!0).withUserToken(!0).withHeaders({Accept:"image/svg+xml",template:e.templateUrl}).build(),[2,this.httpService.fetch(i).pipe(ce(function(e){return{printUri:e.body}})).toPromise()]}})})}),j(function(){var n=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.GET).withPath((t?t.apiPath:r.apiPath)+"/certs/download/"+e.certificateId).withBearerToken(!0).withUserToken(!0).build();return r.httpService.fetch(n).pipe(ce(function(e){return e.body.result}))}))},e.prototype.getLegacyCerificateDownloadURI=function(e,t){var r=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.POST).withPath((t?t.apiPathLegacy:this.apiPathLegacy)+"/certs/download").withBearerToken(!0).withUserToken(!0).withBody({request:e}).build();return this.httpService.fetch(r).pipe(ce(function(e){return e.body.result}))},e.prototype.getCertificateDetails=function(e,t){var r=this;return j(function(){return Xt(r,void 0,void 0,function(){var r,n,i;return Zt(this,function(o){switch(o.label){case 0:if(r=e.schemaName)return[3,4];o.label=1;case 1:return o.trys.push([1,3,,4]),[4,this.systemSettingsService.getSystemSettings("certificate_schema").toPromise()];case 2:return r=o.sent(),[3,4];case 3:throw n=o.sent(),new Error("Schema Name Not found");case 4:return i=(new s.CsRequest.Builder).withType(s.CsHttpRequestType.GET).withPath((t?t.rcApiPath:this.rcApiPath).replace("${schemaName}",r)+"/download/"+e.certificateId).withBearerToken(!0).withUserToken(!0).build(),[2,this.httpService.fetch(i).pipe(ce(function(e){return console.log("CsCertificateDetailsResponse csl",e),e.body}),Ne(function(e){return console.error(e),Object(W.a)({status:"REVOKED"})})).toPromise()]}})})})},e.prototype.getEncodedData=function(e){var t=atob(e),r;return(new Gt.a).loadAsync(t).then(function(e){return e.files["certificate.json"].async("text")}).then(function(e){return JSON.parse(e)}).catch(function(e){console.log("error",e)})},e.prototype.verifyCertificate=function(e,t){var r=this;return this.getCertificateDetails({certificateId:e.certificateId,schemaName:e.schemaName},t).pipe(Ne(function(e){return console.error(e),Object(W.a)({status:"active"})}),ve(function(n){return Rt(function(){return!e.publicKey},j(function(){var i=JSON.parse(n._osSignedData);if(i&&i.issuer&&i.issuer.publicKey&&i.issuer.publicKey.length)return r.getPublicKey({osid:i.issuer.publicKey,schemaName:e.schemaName},t).pipe(ce(function(e){return e.value}),Ne(function(e){throw console.error(e),e}));throw new Error("Public Key Not found")}),j(function(){return Object(W.a)(e.publicKey)})).pipe(ve(function(e){return new Ht(r.httpService,r.container).verifyData(JSON.parse(n._osSignedData),e).then(function(e){return zt(zt({},e),{status:n.status})})}))}))},e=Yt([Object(o.injectable)(),Qt(0,Object(o.inject)(z.core.HTTP_SERVICE)),Qt(1,Object(o.inject)(z.services.certificate.CERTIFICATE_SERVICE_API_PATH)),Qt(2,Object(o.inject)(z.services.certificate.CERTIFICATE_SERVICE_API_PATH_LEGACY)),Qt(3,Object(o.inject)(z.services.certificate.RC_API_PATH)),Qt(4,Object(o.inject)(z.services.systemSettings.SYSTEM_SETTINGS_SERVICE)),Qt(5,Object(o.inject)(z.CONTAINER)),Wt("design:paramtypes",[Object,String,String,String,Object,o.Container])],e)}(),er=function(e,t,r,n){function i(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=Promise))(function(r,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){e.done?r(e.value):i(e.value).then(a,s)}u((n=n.apply(e,t||[])).next())})},tr=function(e,t){var r={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},n,i,o,a;return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(e){return function(t){return u([e,t])}}function u(a){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=2&a[0]?i.return:a[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,a[1])).done)return o;switch(i=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,i=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(!(o=r.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){r=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){r.label=a[1];break}if(6===a[0]&&r.label<o[1]){r.label=o[1],o=a;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(a);break}o[2]&&r.ops.pop(),r.trys.pop();continue}a=t.call(e,r)}catch(e){a=[6,e],i=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}},rr=function(){function e(){this._isInitialised=!1}return Object.defineProperty(e,"instance",{get:function(){return e._instance||(e._instance=new e),e._instance},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isInitialised",{get:function(){return this._isInitialised},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"config",{get:function(){return this._config},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"httpService",{get:function(){return this._container.get(z.core.HTTP_SERVICE)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"groupService",{get:function(){return this._container.get(z.services.group.GROUP_SERVICE)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"contentService",{get:function(){return this._container.get(z.services.content.CONTENT_SERVICE)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"frameworkService",{get:function(){return this._container.get(z.services.framework.FRAMEWORK_SERVICE)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"locationService",{get:function(){return this._container.get(z.services.location.LOCATION_SERVICE)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"courseService",{get:function(){return this._container.get(z.services.course.COURSE_SERVICE)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"userService",{get:function(){return this._container.get(z.services.user.USER_SERVICE)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"formService",{get:function(){return this._container.get(z.services.form.FORM_SERVICE)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"systemSettingsService",{get:function(){return this._container.get(z.services.systemSettings.SYSTEM_SETTINGS_SERVICE)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"discussionService",{get:function(){return this._container.get(z.services.discussion.DISCUSSION_SERVICE)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"notificationService",{get:function(){return this._container.get(z.services.notification.NOTIFICATION_SERVICE)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"certificateService",{get:function(){return this._container.get(z.services.certificate.CERTIFICATE_SERVICE)},enumerable:!1,configurable:!0}),e.prototype.init=function(e,t,r){return er(this,void 0,void 0,function(){return tr(this,function(n){return t&&(this.onUpdateConfigCallback=t),this._config=e,this._container=new o.Container,this._container.bind(z.CONTAINER).toConstantValue(this._container),this.updateConfig(e),this._isInitialised=!0,r&&this._container.bind(z.core.CLIENT_STORAGE).toConstantValue(r),this.httpService.init(),[2]})})},e.prototype.updateConfig=function(e){this._config=e;var t=this._isInitialised?"rebind":"bind";"HttpClientCordovaAdapter"===e.core.httpAdapter?this._container[t](z.core.HTTP_ADAPTER).to(l).inSingletonScope():this._container[t](z.core.HTTP_ADAPTER).to(G).inSingletonScope(),this._container[t](z.core.api.HOST).toConstantValue(e.core.api.host),this._container[t](z.core.global.CHANNEL_ID).toConstantValue(e.core.global.channelId),this._container[t](z.core.global.PRODUCER_ID).toConstantValue(e.core.global.producerId),this._container[t](z.core.global.DEVICE_ID).toConstantValue(e.core.global.deviceId),this._container[t](z.core.global.SESSION_ID).toConstantValue(e.core.global.sessionId),this._container[t](z.core.global.APP_VERSION).toConstantValue(e.core.global.appVersion),this._container[t](z.core.api.authentication.BEARER_TOKEN).toConstantValue(e.core.api.authentication.bearerToken),this._container[t](z.core.api.authentication.USER_TOKEN).toConstantValue(e.core.api.authentication.userToken),this._container[t](z.core.api.authentication.MANAGED_USER_TOKEN).toConstantValue(e.core.api.authentication.managedUserToken),this._container[t](z.core.HTTP_SERVICE).to(oe).inSingletonScope(),this._container[t](z.services.group.GROUP_SERVICE).to(Re).inSingletonScope(),this._container[t](z.services.group.GROUP_ACTIVITY_SERVICE).to(ct).inSingletonScope(),e.services.groupServiceConfig&&(this._container[t](z.services.group.GROUP_SERVICE_API_PATH).toConstantValue(e.services.groupServiceConfig.apiPath),this._container[t](z.services.group.GROUP_SERVICE_DATA_API_PATH).toConstantValue(e.services.groupServiceConfig.dataApiPath),e.services.groupServiceConfig.updateGroupGuidelinesApiPath&&this._container[t](z.services.group.GROUP_SERVICE_UPDATE_GUIDELINES_API_PATH).toConstantValue(e.services.groupServiceConfig.updateGroupGuidelinesApiPath)),this._container[t](z.services.framework.FRAMEWORK_SERVICE).to(Fe).inSingletonScope(),e.services.frameworkServiceConfig&&this._container[t](z.services.framework.FRAMEWORK_SERVICE_API_PATH).toConstantValue(e.services.frameworkServiceConfig.apiPath),this._container[t](z.services.location.LOCATION_SERVICE).to(Ge).inSingletonScope(),e.services.locationServiceConfig&&this._container[t](z.services.location.LOCATION_SERVICE_API_PATH).toConstantValue(e.services.locationServiceConfig.apiPath),this._container[t](z.services.course.COURSE_SERVICE).to(Qe).inSingletonScope(),e.services.courseServiceConfig&&(this._container[t](z.services.course.COURSE_SERVICE_API_PATH).toConstantValue(e.services.courseServiceConfig.apiPath),e.services.courseServiceConfig.certRegistrationApiPath&&this._container[t](z.services.course.COURSE_SERVICE_CERT_REGISTRATION_API_PATH).toConstantValue(e.services.courseServiceConfig.certRegistrationApiPath)),this._container[t](z.services.content.CONTENT_SERVICE).to(ke).inSingletonScope(),e.services.contentServiceConfig&&(this._container[t](z.services.content.CONTENT_SERVICE_HIERARCHY_API_PATH).toConstantValue(e.services.contentServiceConfig.hierarchyApiPath),this._container[t](z.services.content.CONTENT_SERVICE_QUESTION_LIST_API_PATH).toConstantValue(e.services.contentServiceConfig.questionListApiPath)),this._container[t](z.services.user.USER_SERVICE).to(rt).inSingletonScope(),e.services.userServiceConfig&&this._container[t](z.services.user.USER_SERVICE_API_PATH).toConstantValue(e.services.userServiceConfig.apiPath),this._container[t](z.services.form.FORM_SERVICE).to(ht).inSingletonScope(),e.services.formServiceConfig&&this._container[t](z.services.form.FORM_SERVICE_API_PATH).toConstantValue(e.services.formServiceConfig.apiPath),this._container[t](z.services.systemSettings.SYSTEM_SETTINGS_SERVICE).to(vt).inSingletonScope(),e.services.systemSettingsServiceConfig&&this._container[t](z.services.systemSettings.SYSTEM_SETTINGS_SERVICE_API_PATH).toConstantValue(e.services.systemSettingsServiceConfig.apiPath),"rebind"===t&&this.onUpdateConfigCallback&&this.onUpdateConfigCallback(),this._container[t](z.services.discussion.DISCUSSION_SERVICE).to(St).inSingletonScope(),e.services.discussionServiceConfig&&this._container[t](z.services.discussion.DISCUSSION_SERVICE_API_PATH).toConstantValue(e.services.discussionServiceConfig.apiPath),this._container[t](z.services.notification.NOTIFICATION_SERVICE).to(It).inSingletonScope(),e.services.notificationServiceConfig&&this._container[t](z.services.notification.NOTIFICATION_SERVICE_API_PATH).toConstantValue(e.services.notificationServiceConfig.apiPath),this._container[t](z.services.certificate.CERTIFICATE_SERVICE).to(Jt).inSingletonScope(),e.services.certificateServiceConfig&&(this._container[t](z.services.certificate.CERTIFICATE_SERVICE_API_PATH).toConstantValue(e.services.certificateServiceConfig.apiPath),this._container[t](z.services.certificate.CERTIFICATE_SERVICE_API_PATH_LEGACY).toConstantValue(e.services.certificateServiceConfig.apiPathLegacy?e.services.certificateServiceConfig.apiPathLegacy:""),e.services.certificateServiceConfig.rcApiPath&&this._container[t](z.services.certificate.RC_API_PATH).toConstantValue(e.services.certificateServiceConfig.rcApiPath))},e.prototype.updateAuthTokenConfig=function(e){this._config.core.api.authentication.userToken=e;var t=this._isInitialised?"rebind":"bind";this._container[t](z.core.api.authentication.USER_TOKEN).toConstantValue(this._config.core.api.authentication.userToken)},e}()}])});