var liner=function(e){function r(n){if(t[n])return t[n].exports;var a=t[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,r),a.l=!0,a.exports}var t={};return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get: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,r){return Object.prototype.hasOwnProperty.call(e,r)},r.p="",r(r.s=16)}([function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),function(e){function n(e){for(var r,t=e,n=/[^%](%\d+)/g,a=[];r=n.exec(t);)a.push({arg:r[1],index:r.index});for(var o=a.length-1;o>=0;o--){var i=a[o],s=i.arg.substring(1),c=i.index+1;t=t.substring(0,c)+arguments[+s]+t.substring(c+1+s.length)}return t=t.replace("%%","%")}function a(e){var r;r="string"==typeof e?{name:e}:e,p.checkAlgorithm(r);var t=e;return t.hash&&(t.hash=a(t.hash)),r}function o(e,r){if(!e)throw new s("Parameter '"+r+"' is required and cant be empty");if("undefined"!=typeof Buffer&&Buffer.isBuffer(e))return new Uint8Array(e);if(ArrayBuffer.isView(e)){var t=e.map(function(e){return e});return new Uint8Array(t.buffer)}if(e instanceof ArrayBuffer)return new Uint8Array(e);throw new s("Incoming parameter '"+r+"' has wrong data type. Must be ArrayBufferView or ArrayBuffer")}t.d(r,"WebCryptoError",function(){return s}),t.d(r,"AlgorithmError",function(){return c}),t.d(r,"CryptoKeyError",function(){return u}),t.d(r,"PrepareAlgorithm",function(){return a}),t.d(r,"PrepareData",function(){return o}),t.d(r,"BaseCrypto",function(){return p}),t.d(r,"AlgorithmNames",function(){return h}),t.d(r,"Base64Url",function(){return y}),t.d(r,"SubtleCrypto",function(){return x}),t.d(r,"Aes",function(){return A}),t.d(r,"AesAlgorithmError",function(){return m}),t.d(r,"AesWrapKey",function(){return w}),t.d(r,"AesEncrypt",function(){return v}),t.d(r,"AesECB",function(){return g}),t.d(r,"AesCBC",function(){return C}),t.d(r,"AesCTR",function(){return k}),t.d(r,"AesGCM",function(){return d}),t.d(r,"AesKW",function(){return b}),t.d(r,"RsaKeyGenParamsError",function(){return G}),t.d(r,"RsaHashedImportParamsError",function(){return M}),t.d(r,"Rsa",function(){return B}),t.d(r,"RsaSSA",function(){return T}),t.d(r,"RsaPSSParamsError",function(){return D}),t.d(r,"RsaPSS",function(){return j}),t.d(r,"RsaOAEPParamsError",function(){return W}),t.d(r,"RsaOAEP",function(){return H}),t.d(r,"EcKeyGenParamsError",function(){return U}),t.d(r,"Ec",function(){return _}),t.d(r,"EcAlgorithmError",function(){return K}),t.d(r,"EcDSA",function(){return S}),t.d(r,"EcDH",function(){return O}),t.d(r,"ShaAlgorithms",function(){return E}),t.d(r,"Sha",function(){return P});var i=t(8),s=function(e){function r(r){for(var t=[],a=1;a0&&e.length<=128))throw new m(m.PARAM_WRONG_VALUE,"length","number [1-128]")},r.ALG_NAME=h.AesCTR,r}(v),d=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return Object(i.a)(r,e),r.checkAlgorithmParams=function(e){if(this.checkAlgorithm(e),e.additionalData&&!(ArrayBuffer.isView(e.additionalData)||e.additionalData instanceof ArrayBuffer))throw new m(m.PARAM_WRONG_TYPE,"additionalData","ArrayBufferView or ArrayBuffer");if(!e.iv)throw new m(m.PARAM_REQUIRED,"iv");if(!(ArrayBuffer.isView(e.iv)||e.iv instanceof ArrayBuffer))throw new m(m.PARAM_WRONG_TYPE,"iv","ArrayBufferView or ArrayBuffer");if(e.tagLength){if(![32,64,96,104,112,120,128].some(function(r){return r===e.tagLength}))throw new m(m.PARAM_WRONG_VALUE,"tagLength","32, 64, 96, 104, 112, 120 or 128")}},r.ALG_NAME=h.AesGCM,r}(v),b=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return Object(i.a)(r,e),r.checkAlgorithmParams=function(e){this.checkAlgorithm(e)},r.ALG_NAME=h.AesKW,r.KEY_USAGES=["wrapKey","unwrapKey"],r}(w),E=[h.Sha1,h.Sha256,h.Sha384,h.Sha512].join(" | "),P=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return Object(i.a)(r,e),r.checkAlgorithm=function(r){var t;switch(t="string"==typeof r?{name:r}:r,e.checkAlgorithm.call(this,t),t.name.toUpperCase()){case h.Sha1:case h.Sha256:case h.Sha384:case h.Sha512:break;default:throw new c(c.WRONG_ALG_NAME,t.name,E)}},r.digest=function(e,r){var t=this;return new Promise(function(r,n){t.checkAlgorithm(e),r(void 0)})},r}(p),U=function(e){function r(){var r=null!==e&&e.apply(this,arguments)||this;return r.code=9,r}return Object(i.a)(r,e),r}(c),_=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return Object(i.a)(r,e),r.checkAlgorithm=function(e){if(e.name.toUpperCase()!==this.ALG_NAME.toUpperCase())throw new c(c.WRONG_ALG_NAME,e.name,this.ALG_NAME)},r.checkKeyGenParams=function(e){if(!e.namedCurve)throw new U(U.PARAM_REQUIRED,"namedCurve");if("string"!=typeof e.namedCurve)throw new U(U.PARAM_WRONG_TYPE,"namedCurve","string");switch(e.namedCurve.toUpperCase()){case"P-256":case"K-256":case"P-384":case"P-521":break;default:throw new U(U.PARAM_WRONG_VALUE,"namedCurve","K-256, P-256, P-384 or P-521")}},r.checkKeyGenUsages=function(e){var r=this;e.forEach(function(e){var t=0;for(t;t0&&e.length<=512))throw new c(c.PARAM_WRONG_VALUE,"length","more 0 and less than 512")},r.checkKeyGenUsages=function(e){var r=this;this.checkKeyUsages(e),e.forEach(function(e){var t=0;for(t;t=256&&r<=16384)||r%8)throw new G(G.PARAM_WRONG_VALUE,"modulusLength"," a multiple of 8 bits and >= 256 and <= 16384");var t=e.publicExponent;if(!t)throw new G(G.PARAM_REQUIRED,"publicExponent");if(!ArrayBuffer.isView(t))throw new G(G.PARAM_WRONG_TYPE,"publicExponent","ArrayBufferView");if(3!==t[0]&&(1!==t[0]||0!==t[1]||1!==t[2]))throw new G(G.PARAM_WRONG_VALUE,"publicExponent","Uint8Array([3]) | Uint8Array([1, 0, 1])");if(!e.hash)throw new G(G.PARAM_REQUIRED,"hash",E);P.checkAlgorithm(e.hash)},r.checkKeyGenUsages=function(e){var r=this;this.checkKeyUsages(e),e.forEach(function(e){var t=0;for(t;t>>16&65535,n=65535&e,a=r>>>16&65535,o=65535&r;return n*o+(t*o+n*a<<16>>>0)|0})},function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e){this.algorithm=e.algorithm,e.type&&(this.type=e.type),this.extractable=e.extractable,this.usages=e.usages}return e}();r.CryptoKey=n},function(e,r,t){"use strict";function n(){var e,t={name:"Unknown",version:"0"},n=self.navigator.userAgent;return(e=/edge\/([\d\.]+)/i.exec(n))?(t.name=r.Browser.Edge,t.version=e[1]):/msie/i.test(n)?(t.name=r.Browser.IE,t.version=/msie ([\d\.]+)/i.exec(n)[1]):/Trident/i.test(n)?(t.name=r.Browser.IE,t.version=/rv:([\d\.]+)/i.exec(n)[1]):/chrome/i.test(n)?(t.name=r.Browser.Chrome,t.version=/chrome\/([\d\.]+)/i.exec(n)[1]):/safari/i.test(n)?(t.name=r.Browser.Safari,t.version=/version\/([\d\.]+)/i.exec(n)[1]):/firefox/i.test(n)&&(t.name=r.Browser.Firefox,t.version=/firefox\/([\d\.]+)/i.exec(n)[1]),t}function a(e){for(var r=new Uint8Array(e.length),t=0;t-1&&("public"===e.type||"secret"===e.type)&&e.usages.push(t)}),["sign","decrypt","unwrapKey","deriveKey","deriveBits"].forEach(function(t){r.indexOf(t)>-1&&("private"===e.type||"secret"===e.type)&&e.usages.push(t)})))})}function s(e,r,t){if(r&&w.BrowserInfo().name===w.Browser.IE){"extractable"in e&&(e.ext=e.extractable,delete e.extractable);var n=null;switch(r.name.toUpperCase()){case h.AlgorithmNames.AesECB.toUpperCase():case h.AlgorithmNames.AesCBC.toUpperCase():case h.AlgorithmNames.AesGCM.toUpperCase():n=v.AesCrypto;break;default:throw new m.LinerError(m.LinerError.UNSUPPORTED_ALGORITHM,r.name.toUpperCase())}n&&!e.alg&&(e.alg=n.alg2jwk(r)),"key_ops"in e||(e.key_ops=t)}}function c(e){w.BrowserInfo().name===w.Browser.IE&&("ext"in e&&(e.extractable=e.ext,delete e.ext),delete e.key_ops,delete e.alg)}function u(e){var r=/AppleWebKit\/(\d+)/.exec(self.navigator.userAgent);return e.toUpperCase()===h.AlgorithmNames.RsaOAEP&&r&&parseInt(r[1],10)<604}var p=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var t in r)r.hasOwnProperty(t)&&(e[t]=r[t])};return function(r,t){function n(){this.constructor=r}e(r,t),r.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}}();Object.defineProperty(r,"__esModule",{value:!0});var h=t(0),f=t(0),y=t(0),l=t(3),A=t(2),m=t(1),w=t(5),v=t(11),g=t(12),C=t(13),k=t(14),d=t(15),b=[],E=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return p(r,e),r.prototype.generateKey=function(r,t,n){var o,s=this,c=arguments;return e.prototype.generateKey.apply(this,c).then(function(e){if(o=y.PrepareAlgorithm(r),!(w.BrowserInfo().name===w.Browser.Edge&&o.name.toUpperCase()===h.AlgorithmNames.AesGCM||u(o.name))&&l.nativeSubtle)try{return l.nativeSubtle.generateKey.apply(l.nativeSubtle,c).catch(function(e){w.warn("WebCrypto: native generateKey for "+o.name+" doesn't work.",e&&e.message||"Unknown message")})}catch(e){w.warn("WebCrypto: native generateKey for "+o.name+" doesn't work.",e&&e.message||"Unknown message")}}).then(function(e){if(e){var c=Promise.resolve(e);if(w.BrowserInfo().name===w.Browser.Safari&&(o.name.toUpperCase()===h.AlgorithmNames.EcDH.toUpperCase()||o.name.toUpperCase()===h.AlgorithmNames.EcDSA.toUpperCase())){var u=e.publicKey;c=c.then(function(){return s.exportKey("jwk",u).then(function(a){return s.exportKey("spki",u).then(function(o){for(var i=h.Base64Url.decode(a.x),c=h.Base64Url.decode(a.y),u=i.length+c.length,p=new Uint8Array(o),f=0;f