!function(e,t){"object"==typeofexports&&"object"==typeofmodule?module.exports=t():"function"==typeofdefine&&define.amd?define("cryptoPro",[],t):"object"==typeofexports?exports.cryptoPro=t():e.cryptoPro=t()}(window,(function(){returnfunction(e){vart={};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}returnr.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"!=typeofSymbol&&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)returne;if(4&t&&"object"==typeofe&&e&&e.__esModule)returne;varn=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeofe)for(varaine)r.d(n,a,function(t){returne[t]}.bind(null,a));returnn},r.n=function(e){vart=e&&e.__esModule?function(){returne.default}:function(){returne};returnr.d(t,"a",t),t},r.o=function(e,t){returnObject.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=11)}([function(e,t,r){"use strict";varn=this&&this.__awaiter||function(e,t,r,n){returnnew(r||(r=Promise))((function(a,o){functioni(e){try{s(n.next(e))}catch(e){o(e)}}function_(e){try{s(n.throw(e))}catch(e){o(e)}}functions(e){vart;e.done?a(e.value):(t=e.value,tinstanceofr?t:newr((function(e){e(t)}))).then(i,_)}s((n=n.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){varr,n,a,o,i={label:0,sent:function(){if(1&a[0])throwa[1];returna[1]},trys:[],ops:[]};returno={next:_(0),throw:_(1),return:_(2)},"function"==typeofSymbol&&(o[Symbol.iterator]=function(){returnthis}),o;function_(o){returnfunction(_){returnfunction(o){if(r)thrownewTypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(a=2&o[0]?n.return:o[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,o[1])).done)returna;switch(n=0,a&&(o=[2&o[0],a.value]),o[0]){case0:case1:a=o;break;case4:returni.label++,{value:o[1],done:!1};case5:i.label++,n=o[1],o=[0];continue;case7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(a=i.trys,(a=a.length>0&&a[a.length-1])||6!==o[0]&&2!==o[0])){i=0;continue}if(3===o[0]&&(!a||o[1]>a[0]&&o[1]<a[3])){i.label=o[1];break}if(6===o[0]&&i.label<a[1]){i.label=a[1],a=o;break}if(a&&i.label<a[2]){i.label=a[2],i.ops.push(o);break}a[2]&&i.ops.pop(),i.trys.pop();continue}o=t.call(e,i)}catch(e){o=[6,e],n=0}finally{r=a=0}if(5&o[0])throwo[1];return{value:o[0]?o[1]:void0,done:!0}}([o,_])}}};Object.defineProperty(t,"__esModule",{value:!0});varo=r(1),i=!1,_=!1;t._afterPluginsLoaded=function(e){vart=Boolean(window.Promise);returnfunction(){for(vars=[],c=0;c<arguments.length;c++)s[c]=arguments[c];returnn(this,void0,void0,(function(){varn,c;returna(this,(function(a){switch(a.label){case0:if(!_){try{r(14)}catch(e){throwconsole.error(e),newError(o._extractMeaningfulErrorMessage(e)||"Ошибка при подключении модуля для работы с Cades plugin")}_=!0}if(n=window.cadesplugin,!t)thrownewError("Необходим полифилл для Promise");if(!n)thrownewError("Не подключен модуль для работы с Cades plugin");i||(n.set_log_level(n.LOG_LEVEL_ERROR),i=!0),a.label=1;case1:returna.trys.push([1,3,,4]),[4,n];case2:returna.sent(),[3,4];case3:throwc=a.sent(),console.error(c),newError(o._extractMeaningfulErrorMessage(c)||"Ошибка при инициализации модуля для работы с Cades plugin");case4:return[4,e.apply(this,s)];case5:return[2,a.sent()]}}))}))}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t._extractMeaningfulErrorMessage=function(e){vart,r=(null===(t=window.cadesplugin)||void0===t?void0:t.getLastError)&&window.cadesplugin.getLastError(e);if(!(null==r?void0:r.message)){if(!e.message)returnnull;r=e}if(!/[а-яА-Я]/.test(r.message))returnnull;varn=r.message.match(/^(.*?)(?:(?:\.?\s?\(?0x)|(?:\.?$))/);returnn?n[1]:null}}
varn=r(36),a=r(37),o=r(38);functioni(){returns.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function_(e,t){if(i()<t)thrownewRangeError("Invalid typed array length");returns.TYPED_ARRAY_SUPPORT?(e=newUint8Array(t)).__proto__=s.prototype:(null===e&&(e=news(t)),e.length=t),e}functions(e,t,r){if(!(s.TYPED_ARRAY_SUPPORT||thisinstanceofs))returnnews(e,t,r);if("number"==typeofe){if("string"==typeoft)thrownewError("If encoding is specified then the first argument must be a string");returnl(this,e)}returnc(this,e,t,r)}functionc(e,t,r,n){if("number"==typeoft)thrownewTypeError('"value" argument must not be a number');return"undefined"!=typeofArrayBuffer&&tinstanceofArrayBuffer?function(e,t,r,n){if(t.byteLength,r<0||t.byteLength<r)thrownewRangeError("'offset' is out of bounds");if(t.byteLength<r+(n||0))thrownewRangeError("'length' is out of bounds");t=void0===r&&void0===n?newUint8Array(t):void0===n?newUint8Array(t,r):newUint8Array(t,r,n);s.TYPED_ARRAY_SUPPORT?(e=t).__proto__=s.prototype:e=d(e,t);returne}(e,t,r,n):"string"==typeoft?function(e,t,r){"string"==typeofr&&""!==r||(r="utf8");if(!s.isEncoding(r))thrownewTypeError('"encoding" must be a valid string encoding');varn=0|p(t,r),a=(e=_(e,n)).write(t,r);a!==n&&(e=e.slice(0,a));returne}(e,t,r):function(e,t){if(s.isBuffer(t)){varr=0|f(t.length);return0===(e=_(e,r)).length||t.copy(e,0,0,r),e}if(t){if("undefined"!=typeofArrayBuffer&&t.bufferinstanceofArrayBuffer||"length"int)return"number"!=typeoft.length||(n=t.length)!=n?_(e,0):d(e,t);if("Buffer"===t.type&&o(t.data))returnd(e,t.data)}varn;thrownewTypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}functionu(e){if("number"!=typeofe)thrownewTypeError('"size" argument must be a number');if(e<0)thrownewRangeError('"size" argument must not be negative')}functionl(e,t){if(u(t),e=_(e,t<0?0:0|f(t)),!s.TYPED_ARRAY_SUPPORT)for(varr=0;r<t;++r)e[r]=0;returne}functiond(e,t){varr=t.length<0?0:0|f(t.length);e=_(e,r);for(varn=0;n<r;n+=1)e[n]=255&t[n];returne}functionf(e){if(e>=i())thrownewRangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i().toString(16)+" bytes");return0|e}functionp(e,t){if(s.isBuffer(e))returne.length;if("undefined"!=typeofArrayBuffer&&"function"==typeofArrayBuffer.isView&&(ArrayBuffer.isView(e)||einstanceofArrayBuffer))returne.byteLength;"string"!=typeofe&&(e=""+e);varr=e.length;if(0===r)return0;for(varn=!1;;)switch(t){case"ascii":case"latin1":case"binary":returnr;case"utf8":case"utf-8":casevoid0:returnB(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return2*r;case"hex":returnr>>>1;case"base64":returnG(e).length;default:if(n)returnB(e).length;t=(""+t).toLowerCase(),n=!0}}functiong(e,t,r){varn=!1;if((void0===t||t<0)&&(t=0),t>this.length)return"";if((void0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":returnv(this,t,r);case"utf8":case"utf-8":returnS(this,t,r);case"ascii":returnw(this,t,r);case"latin1":case"binary":returnP(this,t,r);case"base64":returnb(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":returnR(this,t,r);default:if(n)thrownewTypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}functionC(e,t,r){varn=e[t];e[t]=e[r],e[r]=n}functionE(e,t,r,n,a){if(0===e.length)return-1;if("string"==typeofr?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=a?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(a)return-1;r=e.length-1}elseif(r<0){if(!a)return-1;r=0}if("string"==typeoft&&(t=s.from(t,n)),s.isBuffer(t))return0===t.length?-1:h(e,t,r,n,a);if("number"==typeoft)returnt&=255,s.TYPED_ARRAY_SUPPORT&&"function"==typeofUint8Array.prototype.indexOf?a?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):h(e,[t],r,n,a);thrownewTypeError("val must be string, number or Buffer")}functionh(e,t,r,n,a){varo,i=1,_=e.length,s=t.length;if(void0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs