varliner=function(e){functionr(n){if(t[n])returnt[n].exports;vara=t[n]={i:n,l:!1,exports:{}};returne[n].call(a.exports,a,a.exports,r),a.l=!0,a.exports}vart={};returnr.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){vart=e&&e.__esModule?function(){returne.default}:function(){returne};returnr.d(t,"a",t),t},r.o=function(e,r){returnObject.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){functionn(e){for(varr,t=e,n=/[^%](%\d+)/g,a=[];r=n.exec(t);)a.push({arg:r[1],index:r.index});for(varo=a.length-1;o>=0;o--){vari=a[o],s=i.arg.substring(1),c=i.index+1;t=t.substring(0,c)+arguments[+s]+t.substring(c+1+s.length)}returnt=t.replace("%%","%")}functiona(e){varr;r="string"==typeofe?{name:e}:e,p.checkAlgorithm(r);vart=e;returnt.hash&&(t.hash=a(t.hash)),r}functiono(e,r){if(!e)thrownews("Parameter '"+r+"' is required and cant be empty");if("undefined"!=typeofBuffer&&Buffer.isBuffer(e))returnnewUint8Array(e);if(ArrayBuffer.isView(e)){vart=e.map(function(e){returne});returnnewUint8Array(t.buffer)}if(einstanceofArrayBuffer)returnnewUint8Array(e);thrownews("Incoming parameter '"+r+"' has wrong data type. Must be ArrayBufferView or ArrayBuffer")}t.d(r,"WebCryptoError",function(){returns}),t.d(r,"AlgorithmError",function(){returnc}),t.d(r,"CryptoKeyError",function(){returnu}),t.d(r,"PrepareAlgorithm",function(){returna}),t.d(r,"PrepareData",function(){returno}),t.d(r,"BaseCrypto",function(){returnp}),t.d(r,"AlgorithmNames",function(){returnh}),t.d(r,"Base64Url",function(){returny}),t.d(r,"SubtleCrypto",function(){returnx}),t.d(r,"Aes",function(){returnA}),t.d(r,"AesAlgorithmError",function(){returnm}),t.d(r,"AesWrapKey",function(){returnw}),t.d(r,"AesEncrypt",function(){returnv}),t.d(r,"AesECB",function(){returng}),t.d(r,"AesCBC",function(){returnC}),t.d(r,"AesCTR",function(){returnk}),t.d(r,"AesGCM",function(){returnd}),t.d(r,"AesKW",function(){returnb}),t.d(r,"RsaKeyGenParamsError",function(){returnG}),t.d(r,"RsaHashedImportParamsError",function(){returnM}),t.d(r,"Rsa",function(){returnB}),t.d(r,"RsaSSA",function(){returnT}),t.d(r,"RsaPSSParamsError",function(){returnD}),t.d(r,"RsaPSS",function(){returnj}),t.d(r,"RsaOAEPParamsError",function(){returnW}),t.d(r,"RsaOAEP",function(){returnH}),t.d(r,"EcKeyGenParamsError",function(){returnU}),t.d(r,"Ec",function(){return_}),t.d(r,"EcAlgorithmError",function(){returnK}),t.d(r,"EcDSA",function(){returnS}),t.d(r,"EcDH",function(){returnO}),t.d(r,"ShaAlgorithms",function(){returnE}),t.d(r,"Sha",function(){returnP});vari=t(8),s=function(e){functionr(r){for(vart=[],a=1;a<arguments.length;a++)t[a-1]=arguments[a];varo=e.call(this)||this;o.code=0,o.message=n.apply(void0,[r].concat(t));vari=newError(o.message);returni.name=o.constructor.name,o.stack=i.stack,o}returnObject(i.a)(r,e),r.NOT_SUPPORTED="Method is not supported",r}(Error),c=function(e){functionr(){varr=null!==e&&e.apply(this,arguments)||this;returnr.code=1,r}returnObject(i.a)(r,e),r.PARAM_REQUIRED="Algorithm hasn't got required paramter '%1'",r.PARAM_WRONG_TYPE="Algorithm has got wrong type for paramter '%1'. Must be %2",r.PARAM_WRONG_VALUE="Algorithm has got wrong value for paramter '%1'. Must be %2",r.WRONG_ALG_NAME="Algorithm has got wrong name '%1'. Must be '%2'",r.UNSUPPORTED_ALGORITHM="Algorithm '%1' is not supported",r.WRONG_USAGE="Algorithm doesn't support key usage '%1'",r}(s),u=function(e){functionr(){varr=null!==e&&e.apply(this,arguments)||this;returnr.code=3,r}returnObject(i.a)(r,e),r.EMPTY_KEY="CryptoKey is empty",r.WRONG_KEY_ALG="CryptoKey has wrong algorithm '%1'. Must be '%2'",r.WRONG_KEY_TYPE="CryptoKey has wrong type '%1'. Must be '%2'",r.WRONG_KEY_USAGE="CryptoKey has wrong key usage. Must be '%1'",r.NOT_EXTRACTABLE="CryptoKey is not extractable",r.WRONG_FORMAT="CryptoKey has '%1' type. It can be used with '%2' format",r.UNKNOWN_FORMAT="Unknownformatinuse'%1'.Mustbe
vara=Object.setPrototypeOf||{__proto__:[]}instanceofArray&&function(e,r){e.__proto__=r}||function(e,r){for(vartinr)r.hasOwnProperty(t)&&(e[t]=r[t])};Object.assign},function(e,r){e.exports=require("crypto")},function(e,r,t){"use strict";functionn(e,r){returnPromise.resolve().then(function(){if(e.key)returne;if(e.extractable){return(newA.Crypto).subtle.exportKey("jwk",e).then(function(t){varn=o(e);returnn&&(n=w.assign(n,e.algorithm)),r.importKey("jwk",t,n,!0,e.usages)})}thrownewm.LinerError("'key' is Native CryptoKey. It can't be converted to JS CryptoKey")})}functiona(e,r){w.BrowserInfo().name!==w.Browser.IE&&w.BrowserInfo().name!==w.Browser.Edge&&w.BrowserInfo().name!==w.Browser.Safari||!/^rsa/i.test(e.name)||(r.privateKey?(b.push({hash:e.hash,key:r.privateKey}),b.push({hash:e.hash,key:r.publicKey})):b.push({hash:e.hash,key:r}))}functiono(e){varr=null;returnb.some(function(t){returnt.key===e&&(r=w.assign({},e.algorithm,{hash:t.hash}),!0)}),r}functioni(e,r){vart=[];e.privateKey?(t.push(e.privateKey),t.push(e.publicKey)):t.push(e),t.forEach(function(e){"keyUsage"ine&&(e.usages=e.keyUsage||[],e.usages.length||(["verify","encrypt","wrapKey"].forEach(function(t){r.indexOf(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)})))})}functions(e,r,t){if(r&&w.BrowserInfo().name===w.Browser.IE){"extractable"ine&&(e.ext=e.extractable,deletee.extractable);varn=null;switch(r.name.toUpperCase()){caseh.AlgorithmNames.AesECB.toUpperCase():caseh.AlgorithmNames.AesCBC.toUpperCase():caseh.AlgorithmNames.AesGCM.toUpperCase():n=v.AesCrypto;break;default:thrownewm.LinerError(m.LinerError.UNSUPPORTED_ALGORITHM,r.name.toUpperCase())}n&&!e.alg&&(e.alg=n.alg2jwk(r)),"key_ops"ine||(e.key_ops=t)}}functionc(e){w.BrowserInfo().name===w.Browser.IE&&("ext"ine&&(e.extractable=e.ext,deletee.ext),deletee.key_ops,deletee.alg)}functionu(e){varr=/AppleWebKit\/(\d+)/.exec(self.navigator.userAgent);returne.toUpperCase()===h.AlgorithmNames.RsaOAEP&&r&&parseInt(r[1],10)<604}varp=this&&this.__extends||function(){vare=Object.setPrototypeOf||{__proto__:[]}instanceofArray&&function(e,r){e.__proto__=r}||function(e,r){for(vartinr)r.hasOwnProperty(t)&&(e[t]=r[t])};returnfunction(r,t){functionn(){this.constructor=r}e(r,t),r.prototype=null===t?Object.create(t):(n.prototype=t.prototype,newn)}}();Object.defineProperty(r,"__esModule",{value:!0});varh=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){functionr(){returnnull!==e&&e.apply(this,arguments)||this}returnp(r,e),r.prototype.generateKey=function(r,t,n){varo,s=this,c=arguments;returne.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{returnl.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){varc=Promise.resolve(e);if(w.BrowserInfo().name===w.Browser.Safari&&(o.name.toUpperCase()===h.AlgorithmNames.EcDH.toUpperCase()||o.name.toUpperCase()===h.AlgorithmNames.EcDSA.toUpperCase())){varu=e.publicKey;c=c.then(function(){returns.exportKey("jwk",u).then(function(a){returns.exportKey("spki",u).then(function(o){for(vari=h.Base64Url.decode(a.x),c=h.Base64Url.decode(a.y),u=i.length+c.length,p=newUint8Array(o),f=0;f<u;f++){vary=p[p.length-f-1],l=void0;if(l=f<c.length?c[c.length-f-1]:i[i.length+c.length-f-1],y!==l)returnw.warn("WebCrypto: EC key has wrong public key JWK. Key pair will be recreated"),s.generateKey(r,t,n)}returne})})})}returnc.then(function(e){returni(e,n),a(o,e),e})}varp;switch(o.name.toLowerCase()){caseh.AlgorithmNames.AesECB.toLowerC