@it-enterprise/digital-signature 1.2.7 → 1.2.8

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.
package/euscp/euscp.js CHANGED
@@ -1,8 +1,8 @@
1
- !function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n=e();for(var r in n)("object"==typeof exports?exports:t)[r]=n[r]}}(this,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=4)}([function(t,e,n){"use strict";n.r(e),n.d(e,"EU_LIBRARY_TYPE_JS",(function(){return i})),n.d(e,"EU_LIBRARY_TYPE_SW",(function(){return o})),n.d(e,"EU_LIBRARY_TYPE_MS",(function(){return s})),n.d(e,"EndUserLibraryType",(function(){return r})),n.d(e,"EU_SUBJECT_TYPE_UNDIFFERENCED",(function(){return u})),n.d(e,"EU_SUBJECT_TYPE_CA",(function(){return c})),n.d(e,"EU_SUBJECT_TYPE_CA_SERVER",(function(){return l})),n.d(e,"EU_SUBJECT_TYPE_RA_ADMINISTRATOR",(function(){return f})),n.d(e,"EU_SUBJECT_TYPE_END_USER",(function(){return p})),n.d(e,"EndUserSubjectType",(function(){return a})),n.d(e,"EU_SUBJECT_CA_SERVER_SUB_TYPE_UNDIFFERENCED",(function(){return h})),n.d(e,"EU_SUBJECT_CA_SERVER_SUB_TYPE_CMP",(function(){return E})),n.d(e,"EU_SUBJECT_CA_SERVER_SUB_TYPE_TSP",(function(){return y})),n.d(e,"EU_SUBJECT_CA_SERVER_SUB_TYPE_OCSP",(function(){return S})),n.d(e,"EndUserSubjectCAServerSubType",(function(){return _})),n.d(e,"EU_CERT_KEY_TYPE_UNKNOWN",(function(){return d})),n.d(e,"EU_CERT_KEY_TYPE_DSTU4145",(function(){return m})),n.d(e,"EU_CERT_KEY_TYPE_RSA",(function(){return R})),n.d(e,"EU_CERT_KEY_TYPE_ECDSA",(function(){return A})),n.d(e,"EndUserCertKeyType",(function(){return C})),n.d(e,"EU_KEY_USAGE_UNKNOWN",(function(){return v})),n.d(e,"EU_KEY_USAGE_DIGITAL_SIGNATURE",(function(){return g})),n.d(e,"EU_KEY_USAGE_NON_REPUDATION",(function(){return T})),n.d(e,"EU_KEY_USAGE_KEY_AGREEMENT",(function(){return I})),n.d(e,"EndUserKeyUsage",(function(){return P})),n.d(e,"EU_CCS_TYPE_REVOKE",(function(){return b})),n.d(e,"EU_CCS_TYPE_HOLD",(function(){return D})),n.d(e,"EndUserCCSType",(function(){return U})),n.d(e,"EU_REVOCATION_REASON_UNKNOWN",(function(){return N})),n.d(e,"EU_REVOCATION_REASON_KEY_COMPROMISE",(function(){return G})),n.d(e,"EU_REVOCATION_REASON_NEW_ISSUED",(function(){return w})),n.d(e,"EndUserRevocationReason",(function(){return O})),n.d(e,"EU_KEYS_TYPE_NONE",(function(){return K})),n.d(e,"EU_KEYS_TYPE_DSTU_AND_ECDH_WITH_GOST",(function(){return x})),n.d(e,"EU_KEYS_TYPE_RSA_WITH_SHA",(function(){return L})),n.d(e,"EndUserKeysType",(function(){return M})),n.d(e,"EU_KEYS_LENGTH_DS_UA_191",(function(){return B})),n.d(e,"EU_KEYS_LENGTH_DS_UA_257",(function(){return F})),n.d(e,"EU_KEYS_LENGTH_DS_UA_307",(function(){return Y})),n.d(e,"EU_KEYS_LENGTH_DS_UA_FILE",(function(){return j})),n.d(e,"EU_KEYS_LENGTH_DS_UA_CERT",(function(){return H})),n.d(e,"EndUserKeysLengthDSUA",(function(){return k})),n.d(e,"EU_KEYS_LENGTH_KEP_UA_257",(function(){return W})),n.d(e,"EU_KEYS_LENGTH_KEP_UA_431",(function(){return X})),n.d(e,"EU_KEYS_LENGTH_KEP_UA_571",(function(){return z})),n.d(e,"EU_KEYS_LENGTH_KEP_UA_FILE",(function(){return J})),n.d(e,"EU_KEYS_LENGTH_KEP_UA_CERT",(function(){return q})),n.d(e,"EndUserKeysLengthKEPUA",(function(){return V})),n.d(e,"EU_KEYS_LENGTH_DS_RSA_1024",(function(){return Q})),n.d(e,"EU_KEYS_LENGTH_DS_RSA_2048",(function(){return $})),n.d(e,"EU_KEYS_LENGTH_DS_RSA_3072",(function(){return tt})),n.d(e,"EU_KEYS_LENGTH_DS_RSA_4096",(function(){return et})),n.d(e,"EU_KEYS_LENGTH_DS_RSA_FILE",(function(){return nt})),n.d(e,"EU_KEYS_LENGTH_DS_RSA_CERT",(function(){return rt})),n.d(e,"EndUserKeysLengthDSRSA",(function(){return Z})),n.d(e,"EU_KEYS_REQUEST_TYPE_UA_DS",(function(){return ot})),n.d(e,"EU_KEYS_REQUEST_TYPE_UA_KEP",(function(){return st})),n.d(e,"EU_KEYS_REQUEST_TYPE_INT_RSA",(function(){return at})),n.d(e,"EndUserRequestTypes",(function(){return it})),n.d(e,"EU_MOBILE_OPERATOR_ID_KYIVSTAR",(function(){return ct})),n.d(e,"EU_MOBILE_OPERATOR_ID_VODAFONE",(function(){return lt})),n.d(e,"EU_MOBILE_OPERATOR_ID_LIFECELL",(function(){return ft})),n.d(e,"EndUserMobileOperatorID",(function(){return ut})),n.d(e,"EU_KSP_IIT",(function(){return ht})),n.d(e,"EU_KSP_UKEY",(function(){return Et})),n.d(e,"EU_KSP_PB",(function(){return yt})),n.d(e,"EU_KSP_DIIA",(function(){return St})),n.d(e,"EndUserKSP",(function(){return pt})),n.d(e,"EndUserKSPClientIdType",(function(){return _t})),n.d(e,"EU_SIGN_TYPE_UNKNOWN",(function(){return dt})),n.d(e,"EU_SIGN_TYPE_CADES_BES",(function(){return mt})),n.d(e,"EU_SIGN_TYPE_CADES_T",(function(){return Rt})),n.d(e,"EU_SIGN_TYPE_CADES_C",(function(){return At})),n.d(e,"EU_SIGN_TYPE_CADES_X_LONG",(function(){return Pt})),n.d(e,"EU_SIGN_TYPE_CADES_X_LONG_TRUSTED",(function(){return vt})),n.d(e,"EndUserSignType",(function(){return Ct})),n.d(e,"EU_CADES_TYPE_UNKNOWN",(function(){return Tt})),n.d(e,"EU_CADES_TYPE_DETACHED",(function(){return It})),n.d(e,"EU_CADES_TYPE_ENVELOPED",(function(){return Ut})),n.d(e,"EndUserCAdESType",(function(){return gt})),n.d(e,"EU_CTX_SIGN_UNKNOWN",(function(){return Dt})),n.d(e,"EU_CTX_SIGN_DSTU4145_WITH_GOST34311",(function(){return Ot})),n.d(e,"EU_CTX_SIGN_RSA_WITH_SHA",(function(){return Nt})),n.d(e,"EU_CTX_SIGN_ECDSA_WITH_SHA",(function(){return Gt})),n.d(e,"EndUserSignAlgo",(function(){return bt})),n.d(e,"EU_SIGN_TYPE_PARAMETER",(function(){return Mt})),n.d(e,"EU_CHECK_PRIVATE_KEY_CONTEXT_PARAMETER",(function(){return Kt})),n.d(e,"EU_UA_OID_EXT_KEY_USAGE_STAMP",(function(){return xt})),n.d(e,"EU_USER_INFO_VERSION",(function(){return Lt})),n.d(e,"EndUserCMPCompatibility",(function(){return wt})),n.d(e,"EU_CTX_HASH_ALGO_UNKNOWN",(function(){return Bt})),n.d(e,"EU_CTX_HASH_ALGO_GOST34311",(function(){return Ft})),n.d(e,"EU_CTX_HASH_ALGO_SHA160",(function(){return Yt})),n.d(e,"EU_CTX_HASH_ALGO_SHA224",(function(){return jt})),n.d(e,"EU_CTX_HASH_ALGO_SHA256",(function(){return Ht})),n.d(e,"EndUserHashAlgo",(function(){return kt})),n.d(e,"EU_ASIC_TYPE_UNKNOWN",(function(){return Wt})),n.d(e,"EU_ASIC_TYPE_S",(function(){return Xt})),n.d(e,"EU_ASIC_TYPE_E",(function(){return zt})),n.d(e,"EndUserASiCType",(function(){return Vt})),n.d(e,"EU_ASIC_SIGN_TYPE_UNKNOWN",(function(){return qt})),n.d(e,"EU_ASIC_SIGN_TYPE_CADES",(function(){return Zt})),n.d(e,"EU_ASIC_SIGN_TYPE_XADES",(function(){return Qt})),n.d(e,"EndUserASiCSignType",(function(){return Jt})),n.d(e,"EU_XADES_TYPE_UNKNOWN",(function(){return te})),n.d(e,"EU_XADES_TYPE_DETACHED",(function(){return ee})),n.d(e,"EU_XADES_TYPE_ENVELOPING",(function(){return ne})),n.d(e,"EU_XADES_TYPE_ENVELOPED",(function(){return re})),n.d(e,"EndUserXAdESType",(function(){return $t})),n.d(e,"EU_XADES_SIGN_LEVEL_UNKNOWN",(function(){return oe})),n.d(e,"EU_XADES_SIGN_LEVEL_B_B",(function(){return se})),n.d(e,"EU_XADES_SIGN_LEVEL_B_T",(function(){return ae})),n.d(e,"EU_XADES_SIGN_LEVEL_B_LT",(function(){return ue})),n.d(e,"EU_XADES_SIGN_LEVEL_B_LTA",(function(){return ce})),n.d(e,"EndUserXAdESSignLevel",(function(){return ie})),n.d(e,"EU_PADES_SIGN_LEVEL_UNKNOWN",(function(){return pe})),n.d(e,"EU_PADES_SIGN_LEVEL_B_B",(function(){return _e})),n.d(e,"EU_PADES_SIGN_LEVEL_B_T",(function(){return he})),n.d(e,"EndUserPAdESSignLevel",(function(){return le})),n.d(e,"EndUserEventType",(function(){return fe})),n.d(e,"EU_SIGN_CONTAINER_TYPE_UNKNOWN",(function(){return ye})),n.d(e,"EU_SIGN_CONTAINER_TYPE_CADES",(function(){return Se})),n.d(e,"EU_SIGN_CONTAINER_TYPE_XADES",(function(){return Ce})),n.d(e,"EU_SIGN_CONTAINER_TYPE_PADES",(function(){return de})),n.d(e,"EU_SIGN_CONTAINER_TYPE_ASIC",(function(){return me})),n.d(e,"EndUserSignContainerType",(function(){return Ee}));var r,i=1,o=2,s=3;!function(t){t[t.JS=i]="JS",t[t.SW=o]="SW",t[t.MS=s]="MS"}(r||(r={}));var a,u=0,c=1,l=2,f=3,p=4;!function(t){t[t.Undifferenced=u]="Undifferenced",t[t.CA=c]="CA",t[t.CAServer=l]="CAServer",t[t.RAAdministrator=f]="RAAdministrator",t[t.EndUser=p]="EndUser"}(a||(a={}));var _,h=0,E=1,y=2,S=3;!function(t){t[t.Undifferenced=h]="Undifferenced",t[t.CMP=E]="CMP",t[t.TSP=y]="TSP",t[t.OCSP=S]="OCSP"}(_||(_={}));var C,d=0,m=1,R=2,A=4;!function(t){t[t.Unknown=d]="Unknown",t[t.DSTU4145=m]="DSTU4145",t[t.RSA=R]="RSA",t[t.ECDSA=A]="ECDSA"}(C||(C={}));var P,v=0,g=1,T=2,I=16;!function(t){t[t.Unknown=d]="Unknown",t[t.DigitalSignature=g]="DigitalSignature",t[t.NonRepudation=T]="NonRepudation",t[t.KeyAgreement=I]="KeyAgreement"}(P||(P={}));var U,b=1,D=2;!function(t){t[t.Revoke=b]="Revoke",t[t.Hold=D]="Hold"}(U||(U={}));var O,N=0,G=1,w=2;!function(t){t[t.Unknown=N]="Unknown",t[t.KeyCompromise=G]="KeyCompromise",t[t.NewIssued=w]="NewIssued"}(O||(O={}));var M,K=0,x=1,L=2;!function(t){t[t.None=K]="None",t[t.DSTUAndECDHWithGOST=x]="DSTUAndECDHWithGOST",t[t.RSAWithSHA=L]="RSAWithSHA"}(M||(M={}));var k,B=1,F=2,Y=3,j=4,H=5;!function(t){t[t.EC_191=B]="EC_191",t[t.EC_257=F]="EC_257",t[t.EC_307=Y]="EC_307",t[t.File=j]="File",t[t.Cert=H]="Cert"}(k||(k={}));var V,W=1,X=2,z=3,J=4,q=5;!function(t){t[t.EC_257=W]="EC_257",t[t.EC_431=X]="EC_431",t[t.EC_571=z]="EC_571",t[t.File=j]="File",t[t.Cert=H]="Cert"}(V||(V={}));var Z,Q=1,$=2,tt=3,et=4,nt=5,rt=6;!function(t){t[t.N_1024=Q]="N_1024",t[t.N_2048=$]="N_2048",t[t.N_3072=tt]="N_3072",t[t.N_4096=et]="N_4096",t[t.File=j]="File",t[t.Cert=H]="Cert"}(Z||(Z={}));var it,ot=1,st=2,at=3;!function(t){t[t.uaDS=ot]="uaDS",t[t.uaKEP=st]="uaKEP",t[t.intRSA=at]="intRSA"}(it||(it={}));var ut,ct=1,lt=2,ft=3;!function(t){t[t.Kyivstar=ct]="Kyivstar",t[t.Vodafone=lt]="Vodafone",t[t.Lifecell=ft]="Lifecell"}(ut||(ut={}));var pt,_t,ht=4,Et=5,yt=6,St=7;!function(t){t[t.Kyivstar=ct]="Kyivstar",t[t.Vodafone=lt]="Vodafone",t[t.Lifecell=ft]="Lifecell",t[t.IIT=ht]="IIT",t[t.UKey=Et]="UKey",t[t.PB=yt]="PB",t[t.DIIA=St]="DIIA"}(pt||(pt={})),function(t){t[t.Default=0]="Default",t[t.Name=1]="Name",t[t.Phone=2]="Phone",t[t.Email=3]="Email"}(_t||(_t={}));var Ct,dt=0,mt=1,Rt=4,At=8,Pt=16,vt=128;!function(t){t[t.Unknown=dt]="Unknown",t[t.CAdES_BES=mt]="CAdES_BES",t[t.CAdES_T=Rt]="CAdES_T",t[t.CAdES_C=At]="CAdES_C",t[t.CAdES_X_Long=Pt]="CAdES_X_Long",t[t.CAdES_X_Long_Trusted=vt]="CAdES_X_Long_Trusted"}(Ct||(Ct={}));var gt,Tt=0,It=1,Ut=3;!function(t){t[t.Unknown=Tt]="Unknown",t[t.Detached=It]="Detached",t[t.Enveloped=Ut]="Enveloped"}(gt||(gt={}));var bt,Dt=0,Ot=1,Nt=2,Gt=3;!function(t){t[t.Unknown=Dt]="Unknown",t[t.DSTU4145WithGOST34311=Ot]="DSTU4145WithGOST34311",t[t.RSAWithSHA=Nt]="RSAWithSHA",t[t.ECDSAWithSHA=Gt]="ECDSAWithSHA"}(bt||(bt={}));var wt,Mt="SignType",Kt="CheckPrivateKey",xt="1.2.804.2.1.1.1.3.9",Lt=3;!function(t){t[t.None=0]="None",t[t.DownloadEUCerts=1]="DownloadEUCerts",t[t.SearchEUCerts=2]="SearchEUCerts"}(wt||(wt={}));var kt,Bt=0,Ft=1,Yt=2,jt=3,Ht=4;!function(t){t[t.Unknown=Bt]="Unknown",t[t.GOST34311=Ft]="GOST34311",t[t.SHA160=Yt]="SHA160",t[t.SHA224=jt]="SHA224",t[t.SHA256=Ht]="SHA256"}(kt||(kt={}));var Vt,Wt=0,Xt=1,zt=2;!function(t){t[t.Unknown=Wt]="Unknown",t[t.S=Xt]="S",t[t.E=zt]="E"}(Vt||(Vt={}));var Jt,qt=0,Zt=1,Qt=2;!function(t){t[t.Unknown=qt]="Unknown",t[t.CAdES=Zt]="CAdES",t[t.XAdES=Qt]="XAdES"}(Jt||(Jt={}));var $t,te=0,ee=1,ne=2,re=3;!function(t){t[t.Unknown=te]="Unknown",t[t.Detached=ee]="Detached",t[t.Enveloping=ne]="Enveloping",t[t.Enveloped=re]="Enveloped"}($t||($t={}));var ie,oe=0,se=1,ae=4,ue=16,ce=32;!function(t){t[t.Unknown=oe]="Unknown",t[t.B_B=se]="B_B",t[t.B_T=ae]="B_T",t[t.B_LT=ue]="B_LT",t[t.B_LTA=ce]="B_LTA"}(ie||(ie={}));var le,fe,pe=0,_e=1,he=4;!function(t){t[t.Unknown=oe]="Unknown",t[t.B_B=_e]="B_B",t[t.B_T=he]="B_T"}(le||(le={})),function(t){t[t.None=0]="None",t[t.All=1]="All",t[t.ConfirmKSPOperation=2]="ConfirmKSPOperation"}(fe||(fe={}));var Ee,ye=0,Se=1,Ce=2,de=3,me=4;!function(t){t[t.Unknown=ye]="Unknown",t[t.CAdES=Se]="CAdES",t[t.XAdES=Ce]="XAdES",t[t.PAdES=de]="PAdES",t[t.ASiC=me]="ASiC"}(Ee||(Ee={}))},function(t,e,n){"use strict";n.r(e),n.d(e,"EU_ERROR_NONE",(function(){return r})),n.d(e,"EU_ERROR_UNKNOWN",(function(){return i})),n.d(e,"EU_ERROR_NOT_SUPPORTED",(function(){return o})),n.d(e,"EU_ERROR_NOT_INITIALIZED",(function(){return s})),n.d(e,"EU_ERROR_BAD_PARAMETER",(function(){return a})),n.d(e,"EU_ERROR_LIBRARY_LOAD",(function(){return u})),n.d(e,"EU_ERROR_READ_SETTINGS",(function(){return c})),n.d(e,"EU_ERROR_TRANSMIT_REQUEST",(function(){return l})),n.d(e,"EU_ERROR_MEMORY_ALLOCATION",(function(){return f})),n.d(e,"EU_WARNING_END_OF_ENUM",(function(){return p})),n.d(e,"EU_ERROR_PROXY_NOT_AUTHORIZED",(function(){return _})),n.d(e,"EU_ERROR_NO_GUI_DIALOGS",(function(){return h})),n.d(e,"EU_ERROR_DOWNLOAD_FILE",(function(){return E})),n.d(e,"EU_ERROR_WRITE_SETTINGS",(function(){return y})),n.d(e,"EU_ERROR_CANCELED_BY_GUI",(function(){return S})),n.d(e,"EU_ERROR_OFFLINE_MODE",(function(){return C})),n.d(e,"EU_ERROR_KEY_MEDIAS_FAILED",(function(){return d})),n.d(e,"EU_ERROR_KEY_MEDIAS_ACCESS_FAILED",(function(){return m})),n.d(e,"EU_ERROR_KEY_MEDIAS_READ_FAILED",(function(){return R})),n.d(e,"EU_ERROR_KEY_MEDIAS_WRITE_FAILED",(function(){return A})),n.d(e,"EU_WARNING_KEY_MEDIAS_READ_ONLY",(function(){return P})),n.d(e,"EU_ERROR_KEY_MEDIAS_DELETE",(function(){return v})),n.d(e,"EU_ERROR_KEY_MEDIAS_CLEAR",(function(){return g})),n.d(e,"EU_ERROR_BAD_PRIVATE_KEY",(function(){return T})),n.d(e,"EU_ERROR_PKI_FORMATS_FAILED",(function(){return I})),n.d(e,"EU_ERROR_CSP_FAILED",(function(){return U})),n.d(e,"EU_ERROR_BAD_SIGNATURE",(function(){return b})),n.d(e,"EU_ERROR_AUTH_FAILED",(function(){return D})),n.d(e,"EU_ERROR_NOT_RECEIVER",(function(){return O})),n.d(e,"EU_ERROR_STORAGE_FAILED",(function(){return N})),n.d(e,"EU_ERROR_BAD_CERT",(function(){return G})),n.d(e,"EU_ERROR_CERT_NOT_FOUND",(function(){return w})),n.d(e,"EU_ERROR_INVALID_CERT_TIME",(function(){return M})),n.d(e,"EU_ERROR_CERT_IN_CRL",(function(){return K})),n.d(e,"EU_ERROR_BAD_CRL",(function(){return x})),n.d(e,"EU_ERROR_NO_VALID_CRLS",(function(){return L})),n.d(e,"EU_ERROR_GET_TIME_STAMP",(function(){return k})),n.d(e,"EU_ERROR_BAD_TSP_RESPONSE",(function(){return B})),n.d(e,"EU_ERROR_TSP_SERVER_CERT_NOT_FOUND",(function(){return F})),n.d(e,"EU_ERROR_TSP_SERVER_CERT_INVALID",(function(){return Y})),n.d(e,"EU_ERROR_GET_OCSP_STATUS",(function(){return j})),n.d(e,"EU_ERROR_BAD_OCSP_RESPONSE",(function(){return H})),n.d(e,"EU_ERROR_CERT_BAD_BY_OCSP",(function(){return V})),n.d(e,"EU_ERROR_OCSP_SERVER_CERT_NOT_FOUND",(function(){return W})),n.d(e,"EU_ERROR_OCSP_SERVER_CERT_INVALID",(function(){return X})),n.d(e,"EU_ERROR_LDAP_ERROR",(function(){return z})),n.d(e,"EndUserError",(function(){return J}));var r=0,i=65535,o=65534,s=1,a=2,u=3,c=4,l=5,f=6,p=7,_=8,h=9,E=10,y=11,S=12,C=13,d=17,m=18,R=19,A=20,P=21,v=22,g=23,T=24,I=33,U=34,b=35,D=36,O=37,N=49,G=50,w=51,M=52,K=53,x=54,L=55,k=65,B=66,F=67,Y=68,j=81,H=82,V=83,W=84,X=85,z=97,J=function(){}},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var r=n(8),i=n(10),o=n(4),s=function(){function t(){}return t.MapFromKeyMedia=function(t,e){return e.SetTypeIndex(t.typeIndex),e.SetDevIndex(t.devIndex),e.SetPassword(t.user?"##"+t.user+"##"+t.password:t.password),e},t.MapToProxySettings=function(t,e){return e.useProxy=t.GetUseProxy(),e.address=t.GetAddress(),e.port=t.GetPort(),e.anonymous=t.GetAnonymous(),e.user=t.GetUser(),e.password=t.GetPassword(),e.savePassword=t.GetSavePassword(),e},t.MapFromProxySettings=function(t,e){return e.SetUseProxy(t.useProxy),e.SetAddress(t.address),e.SetPort(t.port),e.SetAnonymous(t.anonymous),e.SetUser(t.user),e.SetPassword(t.password),e.SetSavePassword(t.savePassword),e},t.MapEndUserOwnerInfo=function(t,e){return e.isFilled=t.IsFilled(),e.issuer=t.GetIssuer(),e.issuerCN=t.GetIssuerCN(),e.serial=t.GetSerial(),e.subject=t.GetSubject(),e.subjCN=t.GetSubjCN(),e.subjOrg=t.GetSubjOrg(),e.subjOrgUnit=t.GetSubjOrgUnit(),e.subjTitle=t.GetSubjTitle(),e.subjState=t.GetSubjState(),e.subjLocality=t.GetSubjLocality(),e.subjFullName=t.GetSubjFullName(),e.subjAddress=t.GetSubjAddress(),e.subjPhone=t.GetSubjPhone(),e.subjEMail=t.GetSubjEMail(),e.subjDNS=t.GetSubjDNS(),e.subjEDRPOUCode=t.GetSubjEDRPOUCode(),e.subjDRFOCode=t.GetSubjDRFOCode(),e},t.MapToEndUserCertificateInfoEx=function(t,e){return e.isFilled=t.IsFilled(),e.version=t.GetVersion(),e.issuer=t.GetIssuer(),e.issuerCN=t.GetIssuerCN(),e.serial=t.GetSerial(),e.subject=t.GetSubject(),e.subjCN=t.GetSubjCN(),e.subjOrg=t.GetSubjOrg(),e.subjOrgUnit=t.GetSubjOrgUnit(),e.subjTitle=t.GetSubjTitle(),e.subjState=t.GetSubjState(),e.subjLocality=t.GetSubjLocality(),e.subjFullName=t.GetSubjFullName(),e.subjAddress=t.GetSubjAddress(),e.subjPhone=t.GetSubjPhone(),e.subjEMail=t.GetSubjEMail(),e.subjDNS=t.GetSubjDNS(),e.subjEDRPOUCode=t.GetSubjEDRPOUCode(),e.subjDRFOCode=t.GetSubjDRFOCode(),e.subjNBUCode=t.GetSubjNBUCode(),e.subjSPFMCode=t.GetSubjSPFMCode(),e.subjOCode=t.GetSubjOCode(),e.subjOUCode=t.GetSubjOUCode(),e.subjUserCode=t.GetSubjUserCode(),e.certBeginTime=t.GetCertBeginTime(),e.certEndTime=t.GetCertEndTime(),e.isPrivKeyTimesAvail=t.IsPrivKeyTimesAvail(),e.privKeyBeginTime=t.GetPrivKeyBeginTime(),e.privKeyEndTime=t.GetPrivKeyEndTime(),e.publicKeyBits=t.GetPublicKeyBits(),e.publicKey=t.GetPublicKey(),e.publicKeyID=t.GetPublicKeyID(),e.issuerPublicKeyID=t.GetIssuerPublicKeyID(),e.keyUsage=t.GetKeyUsage(),e.extKeyUsages=t.GetExtKeyUsages(),e.policies=t.GetPolicies(),e.crlDistribPoint1=t.GetCRLDistribPoint1(),e.crlDistribPoint2=t.GetCRLDistribPoint2(),e.isPowerCert=t.IsPowerCert(),e.isSubjTypeAvail=t.IsSubjTypeAvail(),e.isSubjCA=t.IsSubjCA(),e.chainLength=t.GetChainLength(),e.UPN=t.GetUPN(),e.publicKeyType=t.GetPublicKeyType(),e.keyUsageType=t.GetKeyUsageType(),e.RSAModul=t.GetRSAModul(),e.RSAExponent=t.GetRSAExponent(),e.OCSPAccessInfo=t.GetOCSPAccessInfo(),e.issuerAccessInfo=t.GetIssuerAccessInfo(),e.TSPAccessInfo=t.GetTSPAccessInfo(),e.isLimitValueAvailable=t.IsLimitValueAvail(),e.limitValue=t.GetLimitValue(),e.limitValueCurrency=t.GetLimitValueCurrency(),e.subjType=t.GetSubjType(),e.subjSubType=t.GetSubjSubType(),e.subjUNZR=t.GetSubjUNZR(),e.subjCountry=t.GetSubjCountry(),e.isQSCD=t.IsQSCD(),e.subjUserID=t.GetSubjUserID(),e},t.MapToEndUserParams=function(t,e){return e.SN=t.GetSN(),e.commonName=t.GetCommonName(),e.locality=t.GetLocality(),e.state=t.GetState(),e.organization=t.GetOrganization(),e.orgUnit=t.GetOrgUnit(),e.title=t.GetTitle(),e.street=t.GetStreet(),e.phone=t.GetPhone(),e.surname=t.GetSurname(),e.givenname=t.GetGivenname(),e.EMail=t.GetEMail(),e.DNS=t.GetDNS(),e.EDRPOUCode=t.GetEDRPOUCode(),e.DRFOCode=t.GetDRFOCode(),e.NBUCode=t.GetNBUCode(),e.SPFMCode=t.GetSPFMCode(),e.information=t.GetInformation(),e.passPhrase=t.GetPassPhrase(),e.isPublishCertificate=t.GetIsPublishCertificate(),e.RAAdminSN=t.GetRAAdminSN(),e},t.MapToEndUserTimeInfo=function(t,e){return e.version=t.GetVersion(),e.isTimeAvail=t.IsTimeAvail(),e.isTimeStamp=t.IsTimeStamp(),e.time=t.GetTime(),e.isSignTimeStampAvail=t.IsSignTimeStampAvail(),e.signTimeStamp=t.GetSignTimeStamp(),e},t.MapToEndUserSignInfo=function(e,n){return n.ownerInfo=t.MapEndUserOwnerInfo(e.GetOwnerInfo(),new i.a),n.timeInfo=t.MapToEndUserTimeInfo(e.GetTimeInfo(),new o.EndUserTimeInfo),n.data=e.GetData(),n.signLevel=0,n},t.MapToEndUserSenderInfo=function(e,n){return n.ownerInfo=t.MapEndUserOwnerInfo(e.GetOwnerInfo(),new i.a),n.timeInfo=t.MapToEndUserTimeInfo(e.GetTimeInfo(),new o.EndUserTimeInfo),n.data=e.GetData(),n},t.MapToEndUserCertificate=function(e,n){return n.data=e.GetData(),n.infoEx=t.MapToEndUserCertificateInfoEx(e.GetInfoEx(),new r.a),n},t.MapFromEndUserInfo=function(t,e){return e.SetCommonName(t.commonName),e.SetLocality(t.locality),e.SetState(t.state),e.SetOrganization(t.organization),e.SetOrgUnit(t.orgUnit),e.SetTitle(t.title),e.SetStreet(t.street),e.SetPhone(t.phone),e.SetSurname(t.surname),e.SetGivenname(t.givenname),e.SetEMail(t.EMail),e.SetDNS(t.DNS),e.SetEDRPOUCode(t.EDRPOUCode),e.SetDRFOCode(t.DRFOCode),e.SetNBUCode(t.NBUCode),e.SetSPFMCode(t.SPFMCode),e.SetOCode(t.OCode),e.SetOUCode(t.OUCode),e.SetUserCode(t.userCode),e.SetUPN(t.UPN),e.SetUNZR(t.UNZR),e.SetCountry(t.country),e},t.MapToEndUserRequestInfo=function(t,e){return e.isFilled=!0,e.data=t.GetRequest(),e.type=t.GetRequestType(),e.fileName=t.GetDefaultRequestFileName(),e.isSimple=t.IsSimple(),e.subject=t.GetSubject(),e.subjCN=t.GetSubjCN(),e.subjOrg=t.GetSubjOrg(),e.subjOrgUnit=t.GetSubjOrgUnit(),e.subjTitle=t.GetSubjTitle(),e.subjState=t.GetSubjState(),e.subjLocality=t.GetSubjLocality(),e.subjFullName=t.GetSubjFullName(),e.subjAddress=t.GetSubjAddress(),e.subjPhone=t.GetSubjPhone(),e.subjEMail=t.GetSubjEMail(),e.subjDNS=t.GetSubjDNS(),e.subjEDRPOUCode=t.GetSubjEDRPOUCode(),e.subjDRFOCode=t.GetSubjDRFOCode(),e.subjNBUCode=t.GetSubjNBUCode(),e.subjSPFMCode=t.GetSubjSPFMCode(),e.subjOCode=t.GetSubjOCode(),e.subjOUCode=t.GetSubjOUCode(),e.subjUserCode=t.GetSubjUserCode(),e.certBeginTime=t.GetCertBeginTime(),e.certEndTime=t.GetCertEndTime(),e.isPrivKeyTimesAvail=t.IsPrivKeyTimesAvail(),e.privKeyBeginTime=t.GetPrivKeyBeginTime(),e.privKeyEndTime=t.GetPrivKeyEndTime(),e.publicKeyType=t.GetPublicKeyType(),e.publicKeyBits=t.GetPublicKeyBits(),e.RSAModul=t.GetRSAModul(),e.RSAExponent=t.GetRSAExponent(),e.publicKey=t.GetPublicKey(),e.publicKeyID=t.GetPublicKeyID(),e.extKeyUsages=t.GetExtKeyUsages(),e.crlDistribPoint1=t.GetCRLDistribPoint1(),e.crlDistribPoint2=t.GetCRLDistribPoint2(),e.isSubjTypeAvail=t.IsSubjTypeAvail(),e.subjType=t.GetSubjType(),e.subjSubType=t.GetSubjSubType(),e.isSelfSigned=t.IsSelfSigned(),e.signIssuer=t.GetSignIssuer(),e.signSerial=t.GetSignSerial(),e.subjUNZR=t.GetSubjUNZR(),e.subjCountry=t.GetSubjCountry(),e.isQSCD=t.IsQSCD(),e},t.MapToEndUserReference=function(t,e){return e.name=t.GetName(),e.val=t.GetData(),e},t.MapFromEndUserReference=function(t,e){return e.SetName(t.name),e.SetData(t.val),e},t}()},function(t,e,n){var r,i,o;i=[],void 0===(o="function"==typeof(r=function(){var t="https://chrome.google.com/webstore/detail/%D1%96%D1%96%D1%82-%D0%BA%D0%BE%D1%80%D0%B8%D1%81%D1%82%D1%83%D0%B2%D0%B0%D1%87-%D1%86%D1%81%D0%BA-1-%D0%B1%D1%96%D0%B1%D0%BB/jffafkigfgmjafhpkoibhfefeaebmccg?utm_source=chrome-app-launcher-info-dialog",e=function(){this.vendor="JSC IIT",this.classVersion=1,this.className="EndUserUTF8Coder"};e.prototype.encode=function(t){for(var e=[],n=0,r=0;r<t.length;r++){var i=t.charCodeAt(r);i<128?e[n++]=i:i<2048?(e[n++]=i>>6|192,e[n++]=63&i|128):(e[n++]=i>>12|224,e[n++]=i>>6&63|128,e[n++]=63&i|128)}return e},e.prototype.decode=function(t){for(var e,n,r,i=[],o=0,s=0;o<t.length;)(e=t[o++])<128?i[s++]=String.fromCharCode(e):e>191&&e<224?(n=t[o++],i[s++]=String.fromCharCode((31&e)<<6|63&n)):(n=t[o++],r=t[o++],i[s++]=String.fromCharCode((15&e)<<12|(63&n)<<6|63&r));return i.join("")};var n=function(){this.vendor="JSC IIT",this.classVersion=1,this.className="EndUserUTF16LECoder"};n.prototype.encode=function(t){for(var e,n=[],r=0;r<t.length;r++)e=t.charCodeAt(r),n.push(255&e),n.push((65280&e)>>8);return n},n.prototype.decode=function(t){var e,n=0,r="";if(t.length%2!=0)return null;for((e=t.length)>0&&0==t[e-2]&&0==t[e-1]&&(e-=2);n<e;)r+=String.fromCharCode(t[n]|t[n+1]<<8),n+=2;return r};var r=function(){this.vendor="JSC IIT",this.classVersion=1,this.className="EndUserCP1251Coder",this.m_cp1251_table={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,14:14,15:15,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,30:30,31:31,32:32,33:33,34:34,35:35,36:36,37:37,38:38,39:39,40:40,41:41,42:42,43:43,44:44,45:45,46:46,47:47,48:48,49:49,50:50,51:51,52:52,53:53,54:54,55:55,56:56,57:57,58:58,59:59,60:60,61:61,62:62,63:63,64:64,65:65,66:66,67:67,68:68,69:69,70:70,71:71,72:72,73:73,74:74,75:75,76:76,77:77,78:78,79:79,80:80,81:81,82:82,83:83,84:84,85:85,86:86,87:87,88:88,89:89,90:90,91:91,92:92,93:93,94:94,95:95,96:96,97:97,98:98,99:99,100:100,101:101,102:102,103:103,104:104,105:105,106:106,107:107,108:108,109:109,110:110,111:111,112:112,113:113,114:114,115:115,116:116,117:117,118:118,119:119,120:120,121:121,122:122,123:123,124:124,125:125,126:126,127:127,1027:129,8225:135,1046:198,8222:132,1047:199,1168:165,1048:200,1113:154,1049:201,1045:197,1050:202,1028:170,160:160,1040:192,1051:203,164:164,166:166,167:167,169:169,171:171,172:172,173:173,174:174,1053:205,176:176,177:177,1114:156,181:181,182:182,183:183,8221:148,187:187,1029:189,1056:208,1057:209,1058:210,8364:136,1112:188,1115:158,1059:211,1060:212,1030:178,1061:213,1062:214,1063:215,1116:157,1064:216,1065:217,1031:175,1066:218,1067:219,1068:220,1069:221,1070:222,1032:163,8226:149,1071:223,1072:224,8482:153,1073:225,8240:137,1118:162,1074:226,1110:179,8230:133,1075:227,1033:138,1076:228,1077:229,8211:150,1078:230,1119:159,1079:231,1042:194,1080:232,1034:140,1025:168,1081:233,1082:234,8212:151,1083:235,1169:180,1084:236,1052:204,1085:237,1035:142,1086:238,1087:239,1088:240,1089:241,1090:242,1036:141,1041:193,1091:243,1092:244,8224:134,1093:245,8470:185,1094:246,1054:206,1095:247,1096:248,8249:139,1097:249,1098:250,1044:196,1099:251,1111:191,1055:207,1100:252,1038:161,8220:147,1101:253,8250:155,1102:254,8216:145,1103:255,1043:195,1105:184,1039:143,1026:128,1106:144,8218:130,1107:131,8217:146,1108:186,1109:190},this.m_ut8_table=unescape("%u0402%u0403%u201A%u0453%u201E%u2026%u2020%u2021%u20AC%u2030%u0409%u2039%u040A%u040C%u040B%u040F%u0452%u2018%u2019%u201C%u201D%u2022%u2013%u2014%u0000%u2122%u0459%u203A%u045A%u045C%u045B%u045F%u00A0%u040E%u045E%u0408%u00A4%u0490%u00A6%u00A7%u0401%u00A9%u0404%u00AB%u00AC%u00AD%u00AE%u0407%u00B0%u00B1%u0406%u0456%u0491%u00B5%u00B6%u00B7%u0451%u2116%u0454%u00BB%u0458%u0405%u0455%u0457")};r.prototype.encode=function(t){for(var e=[],n=0;n<t.length;n++){var r=t.charCodeAt(n);if(!(r in this.m_cp1251_table))throw"Character "+t.charAt(n)+" isn't supported by win1251!";e.push(this.m_cp1251_table[r])}return e},r.prototype.decode=function(t){for(var e,n="",r=0;r<t.length;r++)n+=(e=t[r])>=192&&e<=255?String.fromCharCode(e-192+1040):e>=128&&e<=191?this.m_ut8_table.charAt(e-128):String.fromCharCode(e);return n};var i={GetCoder:function(t){switch(t=t.toUpperCase()){case"UTF-8":return new e;case"UTF-16LE":return new n;case"windows-1251":return new r;default:return null}},ArrayToString:function(t,e){var n,r;if(void 0===t&&(t="UTF-8"),null==(n=i.GetCoder(t)))throw new tt(r=$.ERROR_BAD_PARAMETER,$.getErrorDescriptionEx(r,0));return n.decode(e)}},o=function(){this.vendor="JSC IIT",this.classVersion=1,this.className="EndUserDateCoder",this.dateDelimeter=".",this.timeDelimeter=":",this.dateTimeDelimeter=" ",this.format="dd.MM.yyyy HH:mm:ss"};o.prototype.encode=function(t){var e=t.getDate(),n=t.getMonth()+1,r=t.getFullYear(),i=t.getHours(),o=t.getMinutes(),s=t.getSeconds();return e+this.dateDelimeter+n+this.dateDelimeter+r+this.dateTimeDelimeter+i+this.timeDelimeter+o+this.timeDelimeter+s},o.prototype.decode=function(t){try{var e=t.split(this.dateTimeDelimeter),n=e[0].split(this.dateDelimeter),r=e[1].split(this.timeDelimeter),i=parseInt(n[0]),o=parseInt(n[1])-1,s=parseInt(n[2]);if(i<0||i>31||o<0||o>12||s<0)return null;var a=parseInt(r[0]),u=parseInt(r[1]),c=parseInt(r[2]);return a<0||a>23||u<0||u>59||c<0||c>59?null:new Date(s,o,i,a,u,c,0)}catch(t){return null}};var s=function(){this.vendor="JSC IIT",this.classVersion=1,this.className="EndUserBase64Coder",this.m_map="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",this.m_codes=[65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,48,49,50,51,52,53,54,55,56,57,43,47]};s.prototype._getTextDecoder=function(){try{if("undefined"==typeof TextDecoder)return null;var t=new TextDecoder("utf-8");return"utf-8"!=t.encoding?null:t}catch(t){return null}},s.prototype._encodePart=function(t,e,n){for(var r,i,o=[],s=e;s<n;s+=3)r=t[s]<<16|t[s+1]<<8|t[s+2],i=this.m_map[r>>18&63]+this.m_map[r>>12&63]+this.m_map[r>>6&63]+this.m_map[63&r],o.push(i);return o.join("")},s.prototype.encode=function(t){var e,n,r,i,o,s,a="";if(0==(o=(e="undefined"==typeof Uint8Array?void 0===h?t.slice(0):new h(t):new Uint8Array(t)).length))return"";var u=this._getTextDecoder();if(null!=u){for(s=new Uint8Array(4*parseInt((o+2)/3)),n=0,r=0;n<o-o%3;n+=3,r+=4)i=e[n]<<16|e[n+1]<<8|e[n+2],s[r]=this.m_codes[i>>18&63],s[r+1]=this.m_codes[i>>12&63],s[r+2]=this.m_codes[i>>6&63],s[r+3]=this.m_codes[63&i];switch(o%3){case 1:i=e[n]<<16,s[r]=this.m_codes[i>>18&63],s[r+1]=this.m_codes[i>>12&63],s[r+2]=61,s[r+3]=61;break;case 2:i=e[n]<<16|e[n+1]<<8,s[r]=this.m_codes[i>>18&63],s[r+1]=this.m_codes[i>>12&63],s[r+2]=this.m_codes[i>>6&63],s[r+3]=61}a=u.decode(s)}else{var c,l=null,f=o-o%3,p=parseInt(f/15360);for(s=[],n=0;n<p;n++)l=this._encodePart(e,15360*n,15360*n+15360),s.push(l);switch(15360*p<f&&(l=this._encodePart(e,15360*n,f),s.push(l)),o%3){case 1:i=e[o-1]<<16,c=this.m_map[i>>18&63],c+=this.m_map[i>>12&63],c+="=",c+="=",s.push(c);break;case 2:i=e[o-2]<<16|e[o-1]<<8,c=this.m_map[i>>18&63],c+=this.m_map[i>>12&63],c+=this.m_map[i>>6&63],c+="=",s.push(c)}a=s.join("")}return a},s.prototype.decode=function(t){var e,n,r,i,o,s,a,u,c,l,f;if(""==t||(3&t.length)>0)return"undefined"==typeof Uint8Array?void 0===h?[]:new h(0):new Uint8Array(0);for(n=(s=t.length)/4*3-(a="="==t[s-1]?"="==t[s-2]?2:1:0),e="undefined"==typeof Uint8Array?void 0===h?[]:new h(n):new Uint8Array(n),r=0,i=0,o=0;r<Math.floor((s-a)/4);r++)u=this.m_map.indexOf(t[i++]),c=this.m_map.indexOf(t[i++]),l=this.m_map.indexOf(t[i++]),f=this.m_map.indexOf(t[i++]),e[o++]=u<<2|c>>4,e[o++]=(15&c)<<4|l>>2,e[o++]=(3&l)<<6|63&f;switch(a){case 2:u=this.m_map.indexOf(t[i]),c=this.m_map.indexOf(t[i+1]),e[o++]=u<<2|c>>4;break;case 1:u=this.m_map.indexOf(t[i]),c=this.m_map.indexOf(t[i+1]),l=this.m_map.indexOf(t[i+2]),e[o++]=u<<2|c>>4,e[o++]=(15&c)<<4|l>>2}return e};var a=function(t){return new function(){var e=this,n=function(){var t;e.deferred.length&&((t=[].slice.call(arguments)).unshift(n),e.deferred[0].apply(e,t),e.deferred.shift())};this.deferred=[],this.eu_wait=function(t){return this.deferred.push(t),e},t(n)}},u=function(){var t=this._getBrowserInfo();this.m_name=t.name,this.m_version=t.version,this.m_arch=this._getArch(),this.m_os_name=this._getOSName()};u.BROWSER_NAME_IE="IE",u.BROWSER_NAME_OPERA="Opera",u.BROWSER_NAME_CHROME="Chrome",u.BROWSER_NAME_FIREFOX="Firefox",u.BROWSER_NAME_SAFARI="Safari",u.BROWSER_NAME_EDGE="Edge",u.BROWSER_NAME_UNKNOWN="Unknown",u.OS_NAME_WINDOWS="Windows",u.OS_NAME_LINUX="Linux",u.OS_NAME_UNIX="Unix",u.OS_NAME_MAC="Mac OS X",u.OS_NAME_ANDROID="Android",u.OS_NAME_UNKNOWN="Unknown",u.BROWSER_ARCH_NAME_X86="x86",u.BROWSER_ARCH_NAME_X64="x64",u.BROWSER_ARCH_NAME_ARM="arm",u.BROWSER_ARCH_NAME_UNKNOWN="Unknown",u.prototype._getBrowserInfo=function(){var t,e={name:u.BROWSER_NAME_UNKNOWN,version:""},n=navigator.userAgent,r=n.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i)||[];return/msie/i.test(r[1])||/trident/i.test(r[1])?(e.name=u.BROWSER_NAME_IE,/msie/i.test(r[1])?e.version=parseInt(r[2]):(t=/\brv[ :]+(\d+)/g.exec(n)||[],e.version=parseInt(t[1])),e):"Chrome"===r[1]&&null!=(t=n.match(/\b(OPR|Edge)\/(\d+)/))?(e.name=t[1].replace("OPR",u.BROWSER_NAME_OPERA),e.version=parseInt(t[2]),e):(r=r[2]?[r[1],r[2]]:[navigator.appName,navigator.appVersion,"-?"],null!=(t=n.match(/version\/(\d+)/i))&&r.splice(1,1,t[1]),e.name=r[0],e.version=parseInt(r[1]),e)},u.prototype._getOSName=function(){var t=navigator.platform||"",e=(navigator.userAgent||"").toLowerCase();return-1!=t.indexOf("Win")?u.OS_NAME_WINDOWS:-1!=t.indexOf("Mac")?u.OS_NAME_MAC:-1!=t.indexOf("Android")||-1!=e.indexOf("android")?u.OS_NAME_ANDROID:-1!=t.indexOf("Linux")?u.OS_NAME_LINUX:-1!=t.indexOf("FreeBSD")?u.OS_NAME_UNIX:u.OS_NAME_UNKNOWN},u.prototype._getArch=function(){var t,e=navigator.platform||"";switch(this._getOSName()){case u.OS_NAME_WINDOWS:t=-1!=e.indexOf("Win32")?u.BROWSER_ARCH_NAME_X86:u.BROWSER_ARCH_NAME_X64;break;case u.OS_NAME_MAC:t=-1!=e.indexOf("MacIntel")?u.BROWSER_ARCH_NAME_X86:u.BROWSER_ARCH_NAME_X64;break;case u.OS_NAME_UNIX:case u.OS_NAME_LINUX:case u.OS_NAME_ANDROID:t=-1!=e.indexOf("armv")?u.BROWSER_ARCH_NAME_ARM:-1!=e.indexOf("x86_64")?u.BROWSER_ARCH_NAME_X64:u.BROWSER_ARCH_NAME_X32;break;default:t=u.BROWSER_ARCH_NAME_UNKNOWN}return t},u.prototype.GetName=function(){return this.m_name},u.prototype.GetVersion=function(){return this.m_version},u.prototype.GetArch=function(){return this.m_arch},u.prototype.GetOSName=function(){return this.m_os_name};var c=[];c[0]="Executed successfully",c[-1]="Unknown error",c[-32300]="Transport error",c[-32400]="System error",c[-32500]="Application error",c[-32510]="Application error. Invalid session",c[-32600]="Server error. Invalid rpc. Not conforming to spec",c[-32601]="Server error. Requested method not found",c[-32602]="Server error. Invalid method parameters",c[-32603]="Server error. Internal rpc error",c[-32700]="Parse error. Not well formed",c[-32701]="Parse error. Unsupported encoding",c[-32702]="Parse error. Invalid character for encoding";var l=function(t,e,n,r){switch(this.Vendor="JSC IIT",this.ClassVersion="1.0.2",this.ClassName="JSONRPCClient",this.m_type=t,this.m_log=!1,this._logFunction("Initialize",arguments,["type","address","port","useHttps"]),t){case 2:this.m_uri=e,this.m_callbacks=[],this._registerOnExtensionRecieveEventHandler();break;case 3:case 4:this.m_uri=e,this.m_callbacks=[];break;case 1:default:this.m_uri="",r&&e.indexOf("https://")?this.m_uri+="https://":0!=e.indexOf("http://")&&(this.m_uri+="http://"),this.m_uri+=e+":"+n}this.m_requests=0,this.m_session_id=this._loadSessionId()};l.prototype._logFunction=function(t,e,n){if(this.m_log){for(var r="(",i=0;i<e.length;i++)r+=n[i]+": "+e[i].toString(),i!=e.length-1&&(r+=", ");r+=")",this._log(t,r)}},l.prototype._log=function(t,e){this.m_log&&console.log(t+": "+e)},l.prototype._loadSessionId=function(){try{var t=sessionStorage.getItem(this.ClassName+"session_id");return void 0===t||null==t||""==t?null:t}catch(t){return null}},l.prototype._saveSessionId=function(t){try{sessionStorage.setItem(this.ClassName+"session_id",t)}catch(t){}},l.prototype._removeSessionId=function(){try{sessionStorage.removeItem(this.ClassName+"session_id")}catch(t){}},l.prototype.createXMLHttpRequest=function(){return"undefined"==typeof XMLHttpRequest&&(XMLHttpRequest=function(){try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(t){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(t){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(t){}try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(t){}throw c[-32300]}),new XMLHttpRequest},l.prototype.makeRequest=function(t,e,n){var r=null;try{(r={}).jsonrpc="2.0",r.id=n,r.method=t,r.params=e,r.session_id=this.m_session_id,r=JSON.stringify(r)}catch(t){}return r},l.prototype.verifyResponse=function(t,e){try{if("2.0"!=e.jsonrpc)return!1;var n=e.error;if(void 0===n){if(e.id!=t||void 0===e.result)return!1}else{if(void 0===n.code||void 0===n.message)return!1;if(0!=n.code)return!1}if(void 0!==e.session_id)if(null!=this.m_session_id&&null!=e.session_id){if(this.m_session_id!=e.session_id)return!1}else this.m_session_id=e.session_id,this._saveSessionId(this.m_session_id);return!0}catch(t){return!1}},l.prototype.handleResponse=function(t,e){try{return e=JSON.parse(e),this.verifyResponse(t,e)?e:(this.m_session_id=null,this._removeSessionId(),null)}catch(t){return null}},l.prototype._sendHttp=function(t,e,n){var r,i,o=this;try{if((r=this.createXMLHttpRequest()).open("POST",this.m_uri,null!=n),r.setRequestHeader("Content-Type","application/json-rpc"),null!=n&&(r.onload=function(){200==r.status?(i=o.handleResponse(e,r.response),n(null!=i?i.result:null)):n(null)},r.onerror=function(){n(null)}),r.send(t),null!=n)return;return 200!=r.status||null==(i=this.handleResponse(e,r.response))?null:i.result}catch(t){if(null==n)return null;n(null)}},l.prototype._registerOnExtensionRecieveEventHandler=function(){var t=this;window.addEventListener("message",(function(e){if(e.data.sender==t.m_uri)try{var n=e.data.callback_id,r=t.m_callbacks[n-1];delete t.m_callbacks[n-1],t._logFunction("_registerOnExtensionRecieveEventHandler",[r.request_id,e.data.data],["request_id","data"]);var i=t.handleResponse(r.request_id,e.data.data);if(null==i)return void r.callback(null);r.callback(i.result)}catch(t){}}),!1)},l.prototype._sendExtension=function(t,e,n){var r=this;if(r._logFunction("_sendExtension",[arguments[0],arguments[1]],["request","request_id"]),!n)throw"Synchronous calls for web extensions not supported";if(1==document.getElementsByClassName(r.m_uri).length)try{var i={request_id:e,callback:n},o=r.m_callbacks.push(i),s={sender:r.ClassName,request:t,callback_id:o};window.postMessage(s,"*")}catch(t){n(null)}else n(null)},l.prototype._getPluginObject=function(){try{for(var t=document.getElementsByTagName("object"),e=0;e<t.length;e++){var n=t[e].classid;if(!n&&t[e].attributes&&t[e].attributes.classid&&(n=t[e].attributes.classid.value),n===this.m_uri)return t[e]}return null}catch(t){return null}},l.prototype._sendPlugin=function(t,e,n){var r,o=this;o._logFunction("_sendPlugin",[arguments[0],arguments[1]],["request","request_id"]);var a=o._getPluginObject();if(null==a)return null!=n&&n(null),null;var u=function(t){try{for(var e=new s,n=new h(0);;){var r=a.ProcessData(t),o=r.slice(0,5),u=r.slice(5,r.length-1);if(null!=u||""!=u){var c=e.decode(u),l=new h(n.length+c.length);l.set(n),l.set(c,n.length),n=l}switch(o){case'"part':t='"next"';continue;case'"last':return i.ArrayToString("UTF-8",n);default:return null}}}catch(t){return null}};try{return null!=n?void setTimeout((function(){r=u(t),o._logFunction("_sendPlugin",[e,r],["request_id","response"]),null!=(r=o.handleResponse(e,r))?n(r.result):n(null)}),1):(r=u(t),null==(r=o.handleResponse(e,r))?null:r.result)}catch(t){n(null)}},l.prototype.send=function(t,e,n){switch(this.m_type){case 1:return this._sendHttp(t,e,n);case 2:return this._sendExtension(t,e,n);case 3:case 4:return this._sendPlugin(t,e,n)}},l.prototype.execute=function(t,e,n){var r,i;return r=this.m_requests,this.m_requests++,null==(i=this.makeRequest(t,e,r))?null!=n?void n(null):null:null==n?this.send(i,r,n):void this.send(i,r,n)};var f=function(){};f.WEB_LIBRARY_OS_NOT_SUPPORTED=131072,f.WEB_LIBRARY_NOT_INSTALLED_OR_RUN=131073,f.WEB_LIBRARY_JAVA_APPLET_NOT_LOADED=131074,f.WEB_LIBRARY_INSTALLED_VERSION_NOT_SUPPORTED=131075,f.WEB_LIBRARY_INSTALL_PACKAGE=131076,f.WEB_LIBRARY_UPDATE_PACKAGE=131077,f.WEB_LIBRARY_USER_MANUAL=131078,f.WEB_LIBRARY_WEB_EXTENSION_INSTALL_PACKAGE=131079,f.WEB_LIBRARY_CHECK_JRE_VERSION=131080,f.WEB_LIBRARY_WEB_EXTENSION_NOT_INSTALLED_OR_RUN=131081,(f.DESCRIPTIONS=[])[f.WEB_LIBRARY_OS_NOT_SUPPORTED]=["Інсталяційний пакет web-бібліотеки підпису для вашої системи відсутній","Инсталяционный пакет web-библиотеки подписи для вашей системы отсутствует","The installation package of the library for the web signature for your system is absent"],f.DESCRIPTIONS[f.WEB_LIBRARY_NOT_INSTALLED_OR_RUN]=["Бібліотеку web-підпису не запущено або не інстальовано у системі. Для продовження необхідно запустити або інсталювати бібліотеку web-підпису.","Библиотеку web-подписи не запущено или не установлено в системе. Для продолжения необходимо запустить или установить библиотеку web-подписи.","The library for the web signature isn't started or not installed in system. To continue, it is necessary to start or install library for the web signature."],f.DESCRIPTIONS[f.WEB_LIBRARY_INSTALLED_VERSION_NOT_SUPPORTED]=["Інстальована версія web-бібліотеки підпису більше не підтримується. Для продовження необхідно інсталювати оновлену версію web-бібліотеки підпису.","Инсталированная версия web-библиотеки подписи больше не поддерживается. Для продолжения необходимо установить обновленную версию web-библиотеки подписи.","The installed version of library for the web signature isn't supported any more. To continue, it is necessary to install the updated version of the library for the web signature."],f.DESCRIPTIONS[f.WEB_LIBRARY_JAVA_APPLET_NOT_LOADED]=["Java-апплет не завантажено. Необхідно перевірити версію JRE","Java-апплет не загружен. Необходимо проверить версию JRE","Java applet isn't loaded. It is necessary to check the version of JRE"],f.DESCRIPTIONS[f.WEB_LIBRARY_INSTALL_PACKAGE]=["Інсталяційний пакет web-бібліотеки підпису","Инсталяционный пакет web-библиотеки подписи","Install package of library for the web signature"],f.DESCRIPTIONS[f.WEB_LIBRARY_UPDATE_PACKAGE]=["Оновлення web-бібліотеки підпису","Обновление web-библиотеки подписи","Update of library for the web signature"],f.DESCRIPTIONS[f.WEB_LIBRARY_USER_MANUAL]=["Настанова користувача","Руководство пользователя","User manual"],f.DESCRIPTIONS[f.WEB_LIBRARY_WEB_EXTENSION_INSTALL_PACKAGE]=["Інсталяційний пакет бібліотеки підпису (web-розширення)","Инсталяционный пакет библиотеки подписи (web-расширение)","Install package of library for the web signature (web-extension)"],f.DESCRIPTIONS[f.WEB_LIBRARY_CHECK_JRE_VERSION]=["Перевірити версію JRE","Проверить версию JRE","Check JRE version"],f.DESCRIPTIONS[f.WEB_LIBRARY_WEB_EXTENSION_NOT_INSTALLED_OR_RUN]=["Веб-розширення для роботи бібліотеки web-підпису не запущено або не інстальовано в браузері. Для продовження необхідно запустити або інсталювати веб-розширення.","Веб-расширение для работы библиотеки web-подписи не запущено или не установлено в браузере. Для продолжения необходимо запустить или установить веб-расширение.","The web extension for the web signature library is not running or installed in the browser. To continue, you need to run or install the web extension."],f.getString=function(t,e){var n,r;return void 0===(n=f.DESCRIPTIONS[t])&&(n=""),void 0===(r=n[e-1])?n[0]:r};var p=function(t,e,n,r,i){switch(this.m_id=e,this.m_library=null,this.m_language=n,this.m_supportedLibraryTypes=[],this.m_supportedLibraryTypesIndex=0,this.m_noJavaApplet=!1|r,this.m_webExtensionFirst=!1|i,this.m_errorResult=null,t){case p.LIBRARY_TYPE_JAVA_APPLET:case p.LIBRARY_TYPE_SIGN_AGENT:case p.LIBRARY_TYPE_WEB_EXTENSION:case p.LIBRARY_TYPE_NPAPI:case p.LIBRARY_TYPE_ACTIVE_X:this.m_libraryType=t;break;default:this.m_libraryType=p.LIBRARY_TYPE_DEFAULT}this.m_libraryType==p.LIBRARY_TYPE_DEFAULT?(this.m_webExtensionFirst&&p.isWebExtensionSupported()&&this.m_supportedLibraryTypes.push(p.LIBRARY_TYPE_WEB_EXTENSION),p.isSignAgentSupported()&&this.m_supportedLibraryTypes.push(p.LIBRARY_TYPE_SIGN_AGENT),!this.m_webExtensionFirst&&p.isWebExtensionSupported()&&this.m_supportedLibraryTypes.push(p.LIBRARY_TYPE_WEB_EXTENSION),p.isNPAPISupported()&&this.m_supportedLibraryTypes.push(p.LIBRARY_TYPE_NPAPI),p.isActiveXSupported()&&this.m_supportedLibraryTypes.push(p.LIBRARY_TYPE_ACTIVE_X),!this.m_noJavaApplet&&p.isJavaAppletSupported()&&this.m_supportedLibraryTypes.push(p.LIBRARY_TYPE_JAVA_APPLET)):this.m_supportedLibraryTypes.push(this.m_libraryType),this.onload=function(t){},this.onerror=function(t,e,n){},this.getLibraryType=function(){return this.m_libraryType}};p.LIBRARY_TYPE_DEFAULT=0,p.LIBRARY_TYPE_JAVA_APPLET=1,p.LIBRARY_TYPE_SIGN_AGENT=2,p.LIBRARY_TYPE_WEB_EXTENSION=3,p.LIBRARY_TYPE_NPAPI=4,p.LIBRARY_TYPE_ACTIVE_X=5,p.EU_DEFAULT_LANG=0,p.EU_UA_LANG=1,p.EU_RU_LANG=2,p.EU_EN_LANG=3,p.isJavaAppletSupported=function(){var t=new u;if(this.m_noJavaApplet)return!1;switch(t.GetName()){case u.BROWSER_NAME_FIREFOX:case u.BROWSER_NAME_CHROME:return!(t.GetVersion()>44);case u.BROWSER_NAME_OPERA:return!(t.GetVersion()>30);case u.BROWSER_NAME_EDGE:case u.BROWSER_NAME_UNKNOWN:return!1;default:return!0}},p.isSignAgentSupported=function(){var t=new u;switch(t.GetName()){case u.BROWSER_NAME_IE:if(t.GetVersion()<10)return!1;break;case u.BROWSER_NAME_SAFARI:if(t.GetVersion()<7)return!1;break;case u.BROWSER_NAME_UNKNOWN:return!1}switch(t.GetOSName()){case u.OS_NAME_WINDOWS:case u.OS_NAME_MAC:break;case u.OS_NAME_ANDROID:case u.OS_NAME_UNKNOWN:default:return!1}return!0},p.isWebExtensionSupported=function(){var t=new u;switch(t.GetName()){case u.BROWSER_NAME_CHROME:break;case u.BROWSER_NAME_OPERA:if(t.GetVersion()<35)return!1;break;case u.BROWSER_NAME_FIREFOX:if(t.GetVersion()<50)return!1;break;case u.BROWSER_NAME_UNKNOWN:default:return!1}switch(t.GetOSName()){case u.OS_NAME_ANDROID:case u.OS_NAME_UNKNOWN:return!1}return!0},p.isNPAPISupported=function(){var t=new u;switch(t.GetName()){case u.BROWSER_NAME_FIREFOX:if(t.GetVersion()>51)return!1;break;default:return!1}return!0},p.isActiveXSupported=function(){var t=new u;switch(t.GetName()){case u.BROWSER_NAME_IE:if(t.GetVersion()<9||t.GetArch()==u.BROWSER_ARCH_NAME_X64)return!1;break;default:return!1}return!0},p.isWebExtensionInstalled=function(){var t=(new u).GetName()==u.BROWSER_NAME_FIREFOX?"eusw@iit.com.ua":"chrome-extension://jffafkigfgmjafhpkoibhfefeaebmccg/";return 1==document.getElementsByClassName(t).length},p.prototype.getLibraryType=function(){return this.m_libraryType},p.prototype.load=function(){var t=this;setTimeout((function(){t._load(t.m_supportedLibraryTypes[t.m_supportedLibraryTypesIndex])}),1)},p.prototype.unload=function(){var t=document.getElementById(this.m_id);t&&t.parentNode&&t.parentNode.removeChild(t)},p.prototype._load=function(t){switch(t){case p.LIBRARY_TYPE_JAVA_APPLET:return void this._loadSignApplet();case p.LIBRARY_TYPE_SIGN_AGENT:return void this._loadSignAgent();case p.LIBRARY_TYPE_WEB_EXTENSION:return void this._loadWebExtension();case p.LIBRARY_TYPE_NPAPI:return void this._loadNPAPI();case p.LIBRARY_TYPE_ACTIVE_X:return void this._loadActiveX()}},p.prototype._onLoad=function(){this.m_libraryType=this.m_supportedLibraryTypes[this.m_supportedLibraryTypesIndex];try{this.onload(this.m_library)}catch(t){console.log(t)}},p.prototype._onLoadError=function(t,e,n,r){null==this.m_errorResult&&(this.m_errorResult={msg:e,code:n,library:r});var i=document.getElementById(this.m_id);if(i&&i.parentNode&&i.parentNode.removeChild(i),t)if(this.m_supportedLibraryTypesIndex++,this.m_supportedLibraryTypesIndex>=this.m_supportedLibraryTypes.length)try{this.onerror(this.m_errorResult.msg,this.m_errorResult.code,this.m_errorResult.library)}catch(t){console.log(t)}else this.load();else try{this.onerror(this.m_errorResult.msg,this.m_errorResult.code,this.m_errorResult.library)}catch(t){console.log(t)}},p.prototype._loadSignApplet=function(){var t=document.createElement("applet");t.setAttribute("codebase","https://sign.eu.iit.com.ua"),t.setAttribute("code","com.iit.certificateAuthority.endUser.libraries.signJava.EndUser.class"),t.setAttribute("archive","EUSignJava.jar"),t.setAttribute("cache_archive","EUSignJava.jar"),t.setAttribute("cache_version","1.3.102"),t.setAttribute("separate_jvm",!0),t.setAttribute("id",this.m_id),t.setAttribute("width","100%"),t.setAttribute("height","1"),document.body.appendChild(t),this.m_library=document.getElementById(this.m_id),this._waitForSignAppletLoad(this,100,1200)},p.prototype._waitForSignAppletLoad=function(t,e,n){try{t.m_library.SetUIMode(!1)}catch(i){if(0!=n)return void setTimeout((function(){t._waitForSignAppletLoad(t,e,n-1)}),e,n);var r="";return r=$.getErrorDescriptionEx($.ERROR_LIBRARY_COMUNICATION_FAILED,t.m_language)+". ",r+=f.getString(f.WEB_LIBRARY_JAVA_APPLET_NOT_LOADED,t.m_language),r+="<br><br>",r+='<a style="text-indent:18px" href="https://www.java.com/ru/download/installed.jsp">'+f.getString(f.WEB_LIBRARY_CHECK_JRE_VERSION,t.m_language)+"</a>",void t._onLoadError(!0,r,$.ERROR_LIBRARY_COMUNICATION_FAILED,null)}t._onLoad(t.m_library)},p.prototype._appendWebWrapperObject=function(t,e,n,r){try{var i=new et(t,e),o=document.createElement("object");for(var s in o.setAttribute("id",this.m_id),n?r?(o.setAttribute("classid",t),o.setAttribute("height","1px")):(o.type=t,o.classid=t,o.height="1px"):(o.classid="EUSignCP.class",o.style="display:none",o.style.visibility="hidden"),document.body.appendChild(o),i)o[s]=i[s];return this.m_library=document.getElementById(this.m_id),!0}catch(t){return!1}},p.prototype._onLoadWebLibraryError=function(t){var e,n=this.m_library,r=!0,i="";switch(e=p.isWebExtensionSupported()&&!p.isWebExtensionInstalled()&&this.m_webExtensionFirst,i+=$.getErrorDescriptionEx($.ERROR_LIBRARY_COMUNICATION_FAILED,this.m_language),i+=". ",t.GetErrorCode()){case $.ERROR_LIBRARY_COMUNICATION_FAILED:i+=f.getString(e?f.WEB_LIBRARY_WEB_EXTENSION_NOT_INSTALLED_OR_RUN:f.WEB_LIBRARY_NOT_INSTALLED_OR_RUN,this.m_language);break;case $.ERROR_LIBRARY_VERSION_NOT_SUPPORTED:i+=f.getString(f.WEB_LIBRARY_INSTALLED_VERSION_NOT_SUPPORTED,this.m_language),r=!1,this.m_errorResult=null;break;default:i+=$.getErrorDescriptionEx(t.GetErrorCode(),this.m_language)+"."}i+="<br><br>",null!=n.GetInstallURL()?(t.GetErrorCode()==$.ERROR_LIBRARY_VERSION_NOT_SUPPORTED?i+='<div><a style="text-indent:18px" href="'+n.GetUpdateURL()+'">'+f.getString(f.WEB_LIBRARY_UPDATE_PACKAGE,this.m_language)+"</a></div>":i+=e?'<div><a style="text-indent:18px" href="'+n.GetWebExtensionInstallURL()+'">'+f.getString(f.WEB_LIBRARY_WEB_EXTENSION_INSTALL_PACKAGE,this.m_language)+"</a></div>":'<div><a style="text-indent:18px" href="'+n.GetInstallURL()+'">'+f.getString(f.WEB_LIBRARY_INSTALL_PACKAGE,this.m_language)+"</a></div>",i+='<div><a style="text-indent:18px" href="'+n.GetHelpURL()+'">'+f.getString(f.WEB_LIBRARY_USER_MANUAL,this.m_language)+"</a></div>"):i+="<div>"+f.getString(f.WEB_LIBRARY_OS_NOT_SUPPORTED,this.m_language)+"</div>",this._onLoadError(r,i,t.GetErrorCode(),n)},p.prototype._loadWebLibrary=function(){var t=this;t.m_library.Load((function(){t._onLoad()}),(function(e){t._onLoadWebLibraryError(e)}))},p.prototype._loadSignAgent=function(){if(this._appendWebWrapperObject("localhost","http:"==window.location.protocol?"8081":"8083",!1,!1))this._loadWebLibrary();else{var t=$.getErrorDescriptionEx($.ERROR_LIBRARY_COMUNICATION_FAILED,this.m_language);this._onLoadError(!0,t,$.ERROR_LIBRARY_COMUNICATION_FAILED,null)}},p.prototype._loadWebExtension=function(){if(this._appendWebWrapperObject("chrome-extension://jffafkigfgmjafhpkoibhfefeaebmccg/","",!1,!1))this._loadWebLibrary();else{var t=$.getErrorDescriptionEx($.ERROR_LIBRARY_COMUNICATION_FAILED,this.m_language);this._onLoadError(!0,t,$.ERROR_LIBRARY_COMUNICATION_FAILED,null)}},p.prototype._loadPlugin=function(t,e,n,r){if(this._appendWebWrapperObject(t,"",!0,r))this._waitForPluginLoad(this,e,n);else{var i=$.getErrorDescriptionEx($.ERROR_LIBRARY_COMUNICATION_FAILED,this.m_language);this._onLoadError(!0,i,$.ERROR_LIBRARY_COMUNICATION_FAILED,null)}},p.prototype._waitForPluginLoad=function(t,e,n){t.m_library.Load((function(){t._onLoad()}),(function(r){r.GetErrorCode()!=$.ERROR_LIBRARY_COMUNICATION_FAILED||0==n?t._onLoadWebLibraryError(r):setTimeout((function(){t._waitForPluginLoad(t,e,n-1)}),e,n)}))},p.prototype._loadNPAPI=function(){this._loadPlugin("application/x-eusign-cp",100,50,!1)},p.prototype._loadActiveX=function(){this._loadPlugin("clsid:B7E24C75-E343-4DA2-A8D3-C80970FB7D7B",100,50,!0)};var _=function(){this.vendor="JSC IIT",this.parentClassName="Object",this.className="EndUserArrayList",this.classVersion=1,this.m_array=[]};_.prototype.add=function(t){return this.m_array.push(t),!0},_.prototype.clear=function(){this.m_array=[]},_.prototype.get=function(t){return this.m_array[t]},_.prototype.size=function(){return this.m_array.length},Object.create||(Object.create=function(t,e){if("object"!=typeof t&&"function"!=typeof t||null===t||void 0!==e)throw new Error("Invalid arguments");function n(){}return n.prototype=t,new n}),Uint8Array.prototype.slice||(Uint8Array.prototype.slice=Uint8Array.prototype.subarray);var h=null;function E(t){return null!=t&&"object"==typeof t&&("EndUserTransferableObject"==t.className||"EndUserTransferableObject"==t.parentClassName)}h="undefined"==typeof Uint8Array?function(t){var e;if("number"==typeof t){e=new Array(t);for(var n=0;n<t;++n)e[n]=0}else e=t.slice(0);return e.buffer=e,e.subarray=function(t,n){return e.slice(t,n)},e.set=function(t,n){arguments.length<2&&(n=0);for(var r=0,i=t.length;r<i;++r,++n)e[n]=255&t[r]},e.byteLength=e.length,"object"==typeof t&&t.buffer&&(e.buffer=t.buffer),e}:Uint8Array;var y=function(){this.vendor="JSC IIT",this.parentClassName="Object",this.className="EndUserTransferableObject",this.classVersion=1,this.isFilled=!1,this.fields={}};y.makeTransferable=function(t){var e,n;n=y,(e=t).prototype=Object.create(n.prototype),e.prototype.constructor=e,y[(new t).className]=t},y.prototype.base64Coder=new s,y.prototype.dateCoder=new o,y.prototype.setClassInfo=function(t,e){this.parentClassName="EndUserTransferableObject",this.className=t,this.classVersion=e},y.prototype.initializeFields=function(){for(var t in this.fields)switch(this.fields[t]){case"boolean":this[t]=!1;break;case"int":case"long":case"number":this[t]=0;break;case"string":this[t]="";break;case"EndUserKeyMedia":this[t]=new C;break;default:this[t]=null}},y.prototype.set=function(t){if(this.className!=t.className)throw"invalid class";for(var e in this.fields)this[e]=t[e]},y.prototype.encode=function(){var t,e;for(var n in e=new Object,t=new Object,this.fields)null!=this[n]?E(this[n])?e[n]=this[n].encode():"byteArray"==this.fields[n]?e[n]=this.base64Coder.encode(this[n]):"time"==this.fields[n]?e[n]=this.dateCoder.encode(this[n]):e[n]=this[n]:e[n]=null;return t.className=this.className,t.classVersion=this.classVersion,t.classFields=e,t},y.prototype.decode=function(t){try{if(null==t.classVersion||null==t.classFields)return!1;var e=t.classFields;for(var n in this.fields)if("time"==this.fields[n])this[n]=this.dateCoder.decode(e[n]);else if("EndUserOwnerInfo"==this.fields[n])this[n]=new b,this[n].decode(e[n]);else if("EndUserTimeInfo"==this.fields[n])this[n]=new D,this[n].decode(e[n]);else if("EndUserKeyMedia"==this.fields[n])this[n]=new C,this[n].decode(e[n]);else if("EndUserCertificateInfoEx"==this.fields[n])this[n]=new w,this[n].decode(e[n]);else if("byteArray"==this.fields[n])null!=e[n]&&(this[n]=this.base64Coder.decode(e[n]));else if("array"==this.fields[n]){this[n]=[];for(var r=e[n],i=0;i<r.length;i++){var o=r[i].className,s=new y[o];if(void 0!==s){if(!s.decode(r[i]))throw"invalid class";"EndUserByteArray"==s.className&&(s=s.GetData()),this[n].push(s)}else this[n].push(r[i])}}else this[n]=e[n];return!0}catch(t){return this.isFilled=!1,!1}};var S=function(t){this.setClassInfo("EndUserByteArray",1),this.fields={data:"byteArray"},this.initializeFields(),this.data=t};y.makeTransferable(S),S.prototype.GetData=function(){return this.data},S.prototype.SetData=function(t){this.data=t};var C=function(){this.setClassInfo("EndUserKeyMedia",1),this.fields={typeIndex:"long",devIndex:"long",password:"string"},this.initializeFields()};y.makeTransferable(C),C.prototype.GetTypeIndex=function(){return this.typeIndex},C.prototype.SetTypeIndex=function(t){this.typeIndex=t},C.prototype.GetDevIndex=function(){return this.devIndex},C.prototype.SetDevIndex=function(t){this.devIndex=t},C.prototype.GetPassword=function(){return this.password},C.prototype.SetPassword=function(t){this.password=t};var d=function(){this.setClassInfo("EndUserFileStoreSettings",1),this.fields={path:"string",checkCRLs:"boolean",autoRefresh:"boolean",ownCRLsOnly:"boolean",fullAndDeltaCRLs:"boolean",autoDownloadCRLs:"boolean",saveLoadedCerts:"boolean",expireTime:"long"},this.initializeFields(),this.expireTime=3600};y.makeTransferable(d),d.prototype.GetPath=function(){return this.path},d.prototype.SetPath=function(t){this.path=t},d.prototype.GetCheckCRLs=function(){return this.checkCRLs},d.prototype.SetCheckCRLs=function(t){this.checkCRLs=t},d.prototype.GetAutoRefresh=function(){return this.autoRefresh},d.prototype.SetAutoRefresh=function(t){this.autoRefresh=t},d.prototype.GetOwnCRLsOnly=function(){return this.ownCRLsOnly},d.prototype.SetOwnCRLsOnly=function(t){this.ownCRLsOnly=t},d.prototype.GetFullAndDeltaCRLs=function(){return this.fullAndDeltaCRLs},d.prototype.SetFullAndDeltaCRLs=function(t){this.fullAndDeltaCRLs=t},d.prototype.GetAutoDownloadCRLs=function(){return this.autoDownloadCRLs},d.prototype.SetAutoDownloadCRLs=function(t){this.autoDownloadCRLs=t},d.prototype.GetSaveLoadedCerts=function(){return this.saveLoadedCerts},d.prototype.SetSaveLoadedCerts=function(t){this.saveLoadedCerts=t},d.prototype.GetExpireTime=function(){return this.expireTime},d.prototype.SetExpireTime=function(t){this.expireTime=t};var m=function(){this.setClassInfo("EndUserProxySettings",1),this.fields={useProxy:"boolean",anonymous:"boolean",address:"string",port:"string",user:"string",password:"string",savePassword:"boolean"},this.initializeFields(),this.port="80"};y.makeTransferable(m),m.prototype.GetUseProxy=function(){return this.useProxy},m.prototype.SetUseProxy=function(t){this.useProxy=t},m.prototype.GetAnonymous=function(){return this.anonymous},m.prototype.SetAnonymous=function(t){this.anonymous=t},m.prototype.GetAddress=function(){return this.address},m.prototype.SetAddress=function(t){this.address=t},m.prototype.GetPort=function(){return this.port},m.prototype.SetPort=function(t){this.port=t},m.prototype.GetUser=function(){return this.user},m.prototype.SetUser=function(t){this.user=t},m.prototype.GetPassword=function(){return this.password},m.prototype.SetPassword=function(t){this.password=t},m.prototype.GetSavePassword=function(){return this.savePassword},m.prototype.SetSavePassword=function(t){this.savePassword=t};var R=function(){this.setClassInfo("EndUserTSPSettings",1),this.fields={getStamps:"boolean",address:"string",port:"string"},this.initializeFields(),this.port="80"};y.makeTransferable(R),R.prototype.GetGetStamps=function(){return this.getStamps},R.prototype.SetGetStamps=function(t){this.getStamps=t},R.prototype.GetAddress=function(){return this.address},R.prototype.SetAddress=function(t){this.address=t},R.prototype.GetPort=function(){return this.port},R.prototype.SetPort=function(t){this.port=t};var A=function(){this.setClassInfo("EndUserOCSPSettings",1),this.fields={useOCSP:"boolean",beforeStore:"boolean",address:"string",port:"string"},this.initializeFields(),this.port="80"};y.makeTransferable(A),A.prototype.GetUseOCSP=function(){return this.useOCSP},A.prototype.SetUseOCSP=function(t){this.useOCSP=t},A.prototype.GetBeforeStore=function(){return this.beforeStore},A.prototype.SetBeforeStore=function(t){this.beforeStore=t},A.prototype.GetAddress=function(){return this.address},A.prototype.SetAddress=function(t){this.address=t},A.prototype.GetPort=function(){return this.port},A.prototype.SetPort=function(t){this.port=t};var P=function(){this.setClassInfo("EndUserLDAPSettings",1),this.fields={useLDAP:"boolean",address:"string",port:"string",anonymous:"boolean",user:"string",password:"string"},this.initializeFields(),this.port="389"};y.makeTransferable(P),P.prototype.GetUseLDAP=function(){return this.useLDAP},P.prototype.SetUseLDAP=function(t){this.useLDAP=t},P.prototype.GetAddress=function(){return this.address},P.prototype.SetAddress=function(t){this.address=t},P.prototype.GetPort=function(){return this.port},P.prototype.SetPort=function(t){this.port=t},P.prototype.GetAnonymous=function(){return this.anonymous},P.prototype.SetAnonymous=function(t){this.anonymous=t},P.prototype.GetUser=function(){return this.user},P.prototype.SetUser=function(t){this.user=t},P.prototype.GetPassword=function(){return this.password},P.prototype.SetPassword=function(t){this.password=t};var v=function(){this.setClassInfo("EndUserCMPSettings",1),this.fields={useCMP:"boolean",address:"string",port:"string",commonName:"string"},this.initializeFields(),this.port="80"};y.makeTransferable(v),v.prototype.GetUseCMP=function(){return this.useCMP},v.prototype.SetUseCMP=function(t){this.useCMP=t},v.prototype.GetAddress=function(){return this.address},v.prototype.SetAddress=function(t){this.address=t},v.prototype.GetPort=function(){return this.port},v.prototype.SetPort=function(t){this.port=t},v.prototype.GetCommonName=function(){return this.commonName},v.prototype.SetCommonName=function(t){this.commonName=t};var g=function(){this.setClassInfo("EndUserModeSettings",1),this.fields={offlineMode:"boolean"},this.initializeFields()};y.makeTransferable(g),g.prototype.GetOfflineMode=function(){return this.offlineMode},g.prototype.SetOfflineMode=function(t){this.offlineMode=t};var T=function(){this.setClassInfo("EndUserOCSPAccessInfoModeSettings",1),this.fields={enabled:"boolean"},this.initializeFields()};y.makeTransferable(T),T.prototype.GetEnabled=function(){return this.enabled},T.prototype.SetEnabled=function(t){this.enabled=t};var I=function(){this.setClassInfo("EndUserOCSPAccessInfoSettings",1),this.fields={issuerCN:"string",address:"string",port:"string"},this.initializeFields()};y.makeTransferable(I),I.prototype.GetIssuerCN=function(){return this.issuerCN},I.prototype.SetIssuerCN=function(t){this.issuerCN=t},I.prototype.GetAddress=function(){return this.address},I.prototype.SetAddress=function(t){this.address=t},I.prototype.GetPort=function(){return this.port},I.prototype.SetPort=function(t){this.port=t};var U=function(){this.setClassInfo("EndUserKeyMediaSettings",1),this.fields={sourceType:"long",showErrors:"boolean",keyMedia:"EndUserKeyMedia"},this.initializeFields(),this.sourceType=1,this.showErrors=!0};y.makeTransferable(U),U.prototype.GetSourceType=function(){return this.sourceType},U.prototype.SetSourceType=function(t){this.sourceType=t},U.prototype.GetShowErrors=function(){return this.showErrors},U.prototype.SetShowErrors=function(t){this.showErrors=t},U.prototype.GetKeyMedia=function(){return this.keyMedia},U.prototype.SetKeyMedia=function(t){this.keyMedia=t};var b=function(){this.setClassInfo("EndUserOwnerInfo",1),this.fields={isFilled:"boolean",issuer:"string",issuerCN:"string",serial:"string",subject:"string",subjCN:"string",subjOrg:"string",subjOrgUnit:"string",subjTitle:"string",subjState:"string",subjLocality:"string",subjFullName:"string",subjAddress:"string",subjPhone:"string",subjEMail:"string",subjDNS:"string",subjEDRPOUCode:"string",subjDRFOCode:"string"},this.initializeFields()};y.makeTransferable(b),b.prototype.IsFilled=function(){return this.isFilled},b.prototype.GetIssuer=function(){return this.issuer},b.prototype.GetIssuerCN=function(){return this.issuerCN},b.prototype.GetSerial=function(){return this.serial},b.prototype.GetSubject=function(){return this.subject},b.prototype.GetSubjCN=function(){return this.subjCN},b.prototype.GetSubjOrg=function(){return this.subjOrg},b.prototype.GetSubjOrgUnit=function(){return this.subjOrgUnit},b.prototype.GetSubjTitle=function(){return this.subjTitle},b.prototype.GetSubjState=function(){return this.subjState},b.prototype.GetSubjLocality=function(){return this.subjLocality},b.prototype.GetSubjFullName=function(){return this.subjFullName},b.prototype.GetSubjAddress=function(){return this.subjAddress},b.prototype.GetSubjPhone=function(){return this.subjPhone},b.prototype.GetSubjEMail=function(){return this.subjEMail},b.prototype.GetSubjDNS=function(){return this.subjDNS},b.prototype.GetSubjEDRPOUCode=function(){return this.subjEDRPOUCode},b.prototype.GetSubjDRFOCode=function(){return this.subjDRFOCode};var D=function(){this.setClassInfo("EndUserTimeInfo",2),this.fields={version:"number",isTimeAvail:"boolean",isTimeStamp:"boolean",time:"time",isSignTimeStampAvail:"boolean",signTimeStamp:"time"},this.initializeFields()};y.makeTransferable(D),D.prototype.GetVersion=function(){return this.version},D.prototype.IsTimeAvail=function(){return this.isTimeAvail},D.prototype.IsTimeStamp=function(){return this.isTimeStamp},D.prototype.GetTime=function(){return this.time},D.prototype.IsSignTimeStampAvail=function(){return this.isSignTimeStampAvail},D.prototype.GetSignTimeStamp=function(){return this.signTimeStamp};var O=function(){this.setClassInfo("EndUserSignInfo",1),this.fields={ownerInfo:"EndUserOwnerInfo",timeInfo:"EndUserTimeInfo",data:"byteArray"},this.initializeFields()};y.makeTransferable(O),O.prototype.GetOwnerInfo=function(){return this.ownerInfo},O.prototype.GetTimeInfo=function(){return this.timeInfo},O.prototype.GetData=function(){return this.data},O.prototype.GetDataString=function(t){return i.ArrayToString(t,this.data)};var N=function(){this.setClassInfo("EndUserSenderInfo",1),this.fields={ownerInfo:"EndUserOwnerInfo",timeInfo:"EndUserTimeInfo",data:"byteArray"},this.initializeFields()};y.makeTransferable(N),N.prototype.GetOwnerInfo=function(){return this.ownerInfo},N.prototype.GetTimeInfo=function(){return this.timeInfo},N.prototype.GetData=function(){return this.data},N.prototype.GetDataString=function(t){return i.ArrayToString(t,this.data)};var G=function(){this.setClassInfo("EndUserCertificateInfo",1),this.fields={isFilled:"boolean",version:"long",issuer:"string",issuerCN:"string",serial:"string",subject:"string",subjCN:"string",subjOrg:"string",subjOrgUnit:"string",subjTitle:"string",subjState:"string",subjLocality:"string",subjFullName:"string",subjAddress:"string",subjPhone:"string",subjEMail:"string",subjDNS:"string",subjEDRPOUCode:"string",subjDRFOCode:"string",subjNBUCode:"string",subjSPFMCode:"string",subjOCode:"string",subjOUCode:"string",subjUserCode:"string",certBeginTime:"time",certEndTime:"time",isPrivKeyTimesAvail:"boolean",privKeyBeginTime:"time",privKeyEndTime:"time",publicKeyBits:"long",publicKey:"string",publicKeyID:"string",isECDHPublicKeyAvail:"boolean",ECDHPublicKeyBits:"long",ECDHPublicKey:"string",ECDHPublicKeyID:"string",issuerPublicKeyID:"string",keyUsage:"string",extKeyUsages:"string",policies:"string",crlDistribPoint1:"string",crlDistribPoint2:"string",isPowerCert:"boolean",isSubjTypeAvail:"boolean",isSubjCA:"boolean"},this.initializeFields()};y.makeTransferable(G),G.prototype.IsFilled=function(){return this.isFilled},G.prototype.GetVersion=function(){return this.version},G.prototype.GetIssuer=function(){return this.issuer},G.prototype.GetIssuerCN=function(){return this.issuerCN},G.prototype.GetSerial=function(){return this.serial},G.prototype.GetSubject=function(){return this.subject},G.prototype.GetSubjCN=function(){return this.subjCN},G.prototype.GetSubjOrg=function(){return this.subjOrg},G.prototype.GetSubjOrgUnit=function(){return this.subjOrgUnit},G.prototype.GetSubjTitle=function(){return this.subjTitle},G.prototype.GetSubjState=function(){return this.subjState},G.prototype.GetSubjLocality=function(){return this.subjLocality},G.prototype.GetSubjFullName=function(){return this.subjFullName},G.prototype.GetSubjAddress=function(){return this.subjAddress},G.prototype.GetSubjPhone=function(){return this.subjPhone},G.prototype.GetSubjEMail=function(){return this.subjEMail},G.prototype.GetSubjDNS=function(){return this.subjDNS},G.prototype.GetSubjEDRPOUCode=function(){return this.subjEDRPOUCode},G.prototype.GetSubjDRFOCode=function(){return this.subjDRFOCode},G.prototype.GetSubjNBUCode=function(){return this.subjNBUCode},G.prototype.GetSubjSPFMCode=function(){return this.subjSPFMCode},G.prototype.GetSubjOCode=function(){return this.subjOCode},G.prototype.GetSubjOUCode=function(){return this.subjOUCode},G.prototype.GetSubjUserCode=function(){return this.subjUserCode},G.prototype.GetCertBeginTime=function(){return this.certBeginTime},G.prototype.GetCertEndTime=function(){return this.certEndTime},G.prototype.IsPrivKeyTimesAvail=function(){return this.isPrivKeyTimesAvail},G.prototype.GetPrivKeyBeginTime=function(){return this.privKeyBeginTime},G.prototype.GetPrivKeyEndTime=function(){return this.privKeyEndTime},G.prototype.GetPublicKeyBits=function(){return this.publicKeyBits},G.prototype.GetPublicKey=function(){return this.publicKey},G.prototype.GetPublicKeyID=function(){return this.publicKeyID},G.prototype.IsECDHPublicKeyAvail=function(){return this.isECDHPublicKeyAvail},G.prototype.GetECDHPublicKeyBits=function(){return this.ECDHPublicKeyBits},G.prototype.GetECDHPublicKey=function(){return this.ECDHPublicKey},G.prototype.GetECDHPublicKeyID=function(){return this.ECDHPublicKeyID},G.prototype.GetIssuerPublicKeyID=function(){return this.issuerPublicKeyID},G.prototype.GetKeyUsage=function(){return this.keyUsage},G.prototype.GetExtKeyUsages=function(){return this.extKeyUsages},G.prototype.GetPolicies=function(){return this.policies},G.prototype.GetCRLDistribPoint1=function(){return this.crlDistribPoint1},G.prototype.GetCRLDistribPoint2=function(){return this.crlDistribPoint2},G.prototype.IsPowerCert=function(){return this.isPowerCert},G.prototype.IsSubjTypeAvail=function(){return this.isSubjTypeAvail},G.prototype.IsSubjCA=function(){return this.isSubjCA};var w=function(){this.setClassInfo("EndUserCertificateInfoEx",8),this.fields={isFilled:"boolean",version:"long",issuer:"string",issuerCN:"string",serial:"string",subject:"string",subjCN:"string",subjOrg:"string",subjOrgUnit:"string",subjTitle:"string",subjState:"string",subjLocality:"string",subjFullName:"string",subjAddress:"string",subjPhone:"string",subjEMail:"string",subjDNS:"string",subjEDRPOUCode:"string",subjDRFOCode:"string",subjNBUCode:"string",subjSPFMCode:"string",subjOCode:"string",subjOUCode:"string",subjUserCode:"string",certBeginTime:"time",certEndTime:"time",isPrivKeyTimesAvail:"boolean",privKeyBeginTime:"time",privKeyEndTime:"time",publicKeyBits:"long",publicKey:"string",publicKeyID:"string",issuerPublicKeyID:"string",keyUsage:"string",extKeyUsages:"string",policies:"string",crlDistribPoint1:"string",crlDistribPoint2:"string",isPowerCert:"boolean",isSubjTypeAvail:"boolean",isSubjCA:"boolean",chainLength:"int",UPN:"string",publicKeyType:"long",keyUsageType:"long",RSAModul:"string",RSAExponent:"string",OCSPAccessInfo:"string",issuerAccessInfo:"string",TSPAccessInfo:"string",isLimitValueAvailable:"boolean",limitValue:"long",limitValueCurrency:"string",subjType:"long",subjSubType:"long",subjUNZR:"string",subjCountry:"string",fingerprint:"string",isQSCD:"boolean",subjUserID:"string"},this.initializeFields();var t=this;this.IsLimitValueAvailable=function(){return t.isLimitValueAvailable}};y.makeTransferable(w),w.prototype.IsFilled=function(){return this.isFilled},w.prototype.GetVersion=function(){return this.version},w.prototype.GetIssuer=function(){return this.issuer},w.prototype.GetIssuerCN=function(){return this.issuerCN},w.prototype.GetSerial=function(){return this.serial},w.prototype.GetSubject=function(){return this.subject},w.prototype.GetSubjCN=function(){return this.subjCN},w.prototype.GetSubjOrg=function(){return this.subjOrg},w.prototype.GetSubjOrgUnit=function(){return this.subjOrgUnit},w.prototype.GetSubjTitle=function(){return this.subjTitle},w.prototype.GetSubjState=function(){return this.subjState},w.prototype.GetSubjLocality=function(){return this.subjLocality},w.prototype.GetSubjFullName=function(){return this.subjFullName},w.prototype.GetSubjAddress=function(){return this.subjAddress},w.prototype.GetSubjPhone=function(){return this.subjPhone},w.prototype.GetSubjEMail=function(){return this.subjEMail},w.prototype.GetSubjDNS=function(){return this.subjDNS},w.prototype.GetSubjEDRPOUCode=function(){return this.subjEDRPOUCode},w.prototype.GetSubjDRFOCode=function(){return this.subjDRFOCode},w.prototype.GetSubjNBUCode=function(){return this.subjNBUCode},w.prototype.GetSubjSPFMCode=function(){return this.subjSPFMCode},w.prototype.GetSubjOCode=function(){return this.subjOCode},w.prototype.GetSubjOUCode=function(){return this.subjOUCode},w.prototype.GetSubjUserCode=function(){return this.subjUserCode},w.prototype.GetCertBeginTime=function(){return this.certBeginTime},w.prototype.GetCertEndTime=function(){return this.certEndTime},w.prototype.IsPrivKeyTimesAvail=function(){return this.isPrivKeyTimesAvail},w.prototype.GetPrivKeyBeginTime=function(){return this.privKeyBeginTime},w.prototype.GetPrivKeyEndTime=function(){return this.privKeyEndTime},w.prototype.GetPublicKeyBits=function(){return this.publicKeyBits},w.prototype.GetPublicKey=function(){return this.publicKey},w.prototype.GetPublicKeyID=function(){return this.publicKeyID},w.prototype.GetIssuerPublicKeyID=function(){return this.issuerPublicKeyID},w.prototype.GetKeyUsage=function(){return this.keyUsage},w.prototype.GetExtKeyUsages=function(){return this.extKeyUsages},w.prototype.GetPolicies=function(){return this.policies},w.prototype.GetCRLDistribPoint1=function(){return this.crlDistribPoint1},w.prototype.GetCRLDistribPoint2=function(){return this.crlDistribPoint2},w.prototype.IsPowerCert=function(){return this.isPowerCert},w.prototype.IsSubjTypeAvail=function(){return this.isSubjTypeAvail},w.prototype.IsSubjCA=function(){return this.isSubjCA},w.prototype.GetChainLength=function(){return this.chainLength},w.prototype.GetUPN=function(){return this.UPN},w.prototype.GetPublicKeyType=function(){return this.publicKeyType},w.prototype.GetKeyUsageType=function(){return this.keyUsageType},w.prototype.GetRSAModul=function(){return this.RSAModul},w.prototype.GetRSAExponent=function(){return this.RSAExponent},w.prototype.GetOCSPAccessInfo=function(){return this.OCSPAccessInfo},w.prototype.GetIssuerAccessInfo=function(){return this.issuerAccessInfo},w.prototype.GetTSPAccessInfo=function(){return this.TSPAccessInfo},w.prototype.IsLimitValueAvail=function(){return this.isLimitValueAvailable},w.prototype.GetLimitValue=function(){return this.limitValue},w.prototype.GetLimitValueCurrency=function(){return this.limitValueCurrency},w.prototype.GetSubjType=function(){return this.subjType},w.prototype.GetSubjSubType=function(){return this.subjSubType},w.prototype.GetSubjUNZR=function(){return this.subjUNZR},w.prototype.GetSubjCountry=function(){return this.subjCountry},w.prototype.GetFingerprint=function(){return this.fingerprint},w.prototype.IsQSCD=function(){return this.isQSCD},w.prototype.GetSubjUserID=function(){return this.subjUserID};var M=function(){this.setClassInfo("EndUserCertificate",1),this.fields={infoEx:"EndUserCertificateInfoEx",data:"byteArray"},this.initializeFields()};y.makeTransferable(M),M.prototype.GetInfoEx=function(){return this.infoEx},M.prototype.SetInfoEx=function(t){this.infoEx=t},M.prototype.GetData=function(){return this.data},M.prototype.SetData=function(t){this.data=t};var K=function(){this.setClassInfo("EndUserCRLInfo",1,!0,!1),this.fields={isFilled:"boolean",issuer:"string",issuerCN:"string",crlNumber:"long",thisUpdate:"time",nextUpdate:"time"},this.initializeFields()};y.makeTransferable(K),K.prototype.IsFilled=function(){return this.isFilled},K.prototype.GetIssuer=function(){return this.issuer},K.prototype.GetIssuerCN=function(){return this.issuerCN},K.prototype.GetCRLNumber=function(){return this.crlNumber},K.prototype.GetThisUpdate=function(){return this.thisUpdate},K.prototype.GetNextUpdate=function(){return this.nextUpdate};var x=function(){this.setClassInfo("EndUserCRLDetailedInfo",1),this.fields={isFilled:"boolean",version:"long",issuer:"string",issuerCN:"string",issuerPublicKeyID:"string",crlNumber:"long",thisUpdate:"time",nextUpdate:"time",revokedItemsCount:"long"},this.initializeFields()};y.makeTransferable(x),x.prototype.IsFilled=function(){return this.isFilled},x.prototype.GetVersion=function(){return this.version},x.prototype.GetIssuer=function(){return this.issuer},x.prototype.GetIssuerCN=function(){return this.issuerCN},x.prototype.GetIssuerPublicKeyID=function(){return this.issuerPublicKeyID},x.prototype.GetCRLNumber=function(){return this.crlNumber},x.prototype.GetThisUpdate=function(){return this.thisUpdate},x.prototype.GetNextUpdate=function(){return this.nextUpdate},x.prototype.GetRevokedItemsCount=function(){return this.revokedItemsCount};var L=function(){this.setClassInfo("EndUserPrivateKeyInfo",1),this.fields={privateKey:"byteArray",privateKeyInfo:"byteArray"},this.initializeFields()};y.makeTransferable(L),L.prototype.GetPrivateKey=function(){return this.privateKey},L.prototype.SetPrivateKey=function(t){this.privateKey=t},L.prototype.GetPrivateKeyInfo=function(){return this.privateKeyInfo},L.prototype.SetPrivateKeyInfo=function(t){this.privateKeyInfo=t};var k=function(){this.setClassInfo("EndUserJKSPrivateKey",1),this.fields={privateKey:"byteArray",certificates:"array"},this.initializeFields()};y.makeTransferable(k),k.prototype.GetPrivateKey=function(){return this.privateKey},k.prototype.GetCertificate=function(t){return t<0||t>=this.certificates.length?null:this.certificates[t]},k.prototype.GetCertificatesCount=function(){return this.certificates.length},k.prototype.GetCertificates=function(){return this.certificates};var B=function(){this.setClassInfo("EndUserRequestInfo",4),this.fields={request:"byteArray",requestType:"number",defaultRequestFileName:"string",isSimple:"boolean",subject:"string",subjCN:"string",subjOrg:"string",subjOrgUnit:"string",subjTitle:"string",subjState:"string",subjLocality:"string",subjFullName:"string",subjAddress:"string",subjPhone:"string",subjEMail:"string",subjDNS:"string",subjEDRPOUCode:"string",subjDRFOCode:"string",subjNBUCode:"string",subjSPFMCode:"string",subjOCode:"string",subjOUCode:" string",subjUserCode:"string",certBeginTime:"time",certEndTime:"time",isPrivKeyTimesAvail:"boolean",privKeyBeginTime:"time",privKeyEndTime:"time",publicKeyType:"number",publicKeyBits:"number",RSAModul:"string",RSAExponent:"string",publicKey:"string",publicKeyID:"string",extKeyUsages:"string",crlDistribPoint1:"string",crlDistribPoint2:"string",isSubjTypeAvail:"boolean",subjType:"number",subjSubType:"number",isSelfSigned:"boolean",signIssuer:"string",signSerial:"string",subjUNZR:"string",subjCountry:"string",isQSCD:"boolean"},this.initializeFields()};y.makeTransferable(B),B.prototype.GetRequest=function(){return this.request},B.prototype.GetRequestType=function(){return this.requestType},B.prototype.GetDefaultRequestFileName=function(){return this.defaultRequestFileName},B.prototype.IsSimple=function(){return this.isSimple},B.prototype.GetSubject=function(){return this.subject},B.prototype.GetSubjCN=function(){return this.subjCN},B.prototype.GetSubjOrg=function(){return this.subjOrg},B.prototype.GetSubjOrgUnit=function(){return this.subjOrgUnit},B.prototype.GetSubjTitle=function(){return this.subjTitle},B.prototype.GetSubjState=function(){return this.subjState},B.prototype.GetSubjLocality=function(){return this.subjLocality},B.prototype.GetSubjFullName=function(){return this.subjFullName},B.prototype.GetSubjAddress=function(){return this.subjAddress},B.prototype.GetSubjPhone=function(){return this.subjPhone},B.prototype.GetSubjEMail=function(){return this.subjEMail},B.prototype.GetSubjDNS=function(){return this.subjDNS},B.prototype.GetSubjEDRPOUCode=function(){return this.subjEDRPOUCode},B.prototype.GetSubjDRFOCode=function(){return this.subjDRFOCode},B.prototype.GetSubjNBUCode=function(){return this.subjNBUCode},B.prototype.GetSubjSPFMCode=function(){return this.subjSPFMCode},B.prototype.GetSubjOCode=function(){return this.subjOCode},B.prototype.GetSubjOUCode=function(){return this.subjOUCode},B.prototype.GetSubjUserCode=function(){return this.subjUserCode},B.prototype.GetCertBeginTime=function(){return this.certBeginTime},B.prototype.GetCertEndTime=function(){return this.certEndTime},B.prototype.IsPrivKeyTimesAvail=function(){return this.isPrivKeyTimesAvail},B.prototype.GetPrivKeyBeginTime=function(){return this.privKeyBeginTime},B.prototype.GetPrivKeyEndTime=function(){return this.privKeyEndTime},B.prototype.GetPublicKeyType=function(){return this.publicKeyType},B.prototype.GetPublicKeyBits=function(){return this.publicKeyBits},B.prototype.GetRSAModul=function(){return this.RSAModul},B.prototype.GetRSAExponent=function(){return this.RSAExponent},B.prototype.GetPublicKey=function(){return this.publicKey},B.prototype.GetPublicKeyID=function(){return this.publicKeyID},B.prototype.GetExtKeyUsages=function(){return this.extKeyUsages},B.prototype.GetCRLDistribPoint1=function(){return this.crlDistribPoint1},B.prototype.GetCRLDistribPoint2=function(){return this.crlDistribPoint2},B.prototype.IsSubjTypeAvail=function(){return this.isSubjTypeAvail},B.prototype.GetSubjType=function(){return this.subjType},B.prototype.GetSubjSubType=function(){return this.subjSubType},B.prototype.IsSelfSigned=function(){return this.isSelfSigned},B.prototype.GetSignIssuer=function(){return this.signIssuer},B.prototype.GetSignSerial=function(){return this.signSerial},B.prototype.GetSubjUNZR=function(){return this.subjUNZR},B.prototype.GetSubjCountry=function(){return this.subjCountry},B.prototype.IsQSCD=function(){return this.isQSCD};var F=function(){this.setClassInfo("EndUserInfo",3),this.fields={commonName:"string",locality:"string",state:"string",organization:"string",orgUnit:"string",title:"string",street:"string",phone:"string",surname:"string",givenname:"string",EMail:"string",DNS:"string",EDRPOUCode:"string",DRFOCode:"string",NBUCode:"string",SPFMCode:"string",OCode:"string",OUCode:"string",userCode:"string",UPN:"string",UNZR:"string",country:"string"},this.initializeFields()};y.makeTransferable(F),F.prototype.GetCommonName=function(){return this.commonName},F.prototype.SetCommonName=function(t){this.commonName=t},F.prototype.GetLocality=function(){return this.locality},F.prototype.SetLocality=function(t){this.locality=t},F.prototype.GetState=function(){return this.state},F.prototype.SetState=function(t){this.state=t},F.prototype.GetOrganization=function(){return this.organization},F.prototype.SetOrganization=function(t){this.organization=t},F.prototype.GetOrgUnit=function(){return this.orgUnit},F.prototype.SetOrgUnit=function(t){this.orgUnit=t},F.prototype.GetTitle=function(){return this.title},F.prototype.SetTitle=function(t){this.title=t},F.prototype.GetStreet=function(){return this.street},F.prototype.SetStreet=function(t){this.street=t},F.prototype.GetPhone=function(){return this.phone},F.prototype.SetPhone=function(t){this.phone=t},F.prototype.GetSurname=function(){return this.surname},F.prototype.SetSurname=function(t){this.surname=t},F.prototype.GetGivenname=function(){return this.givenname},F.prototype.SetGivenname=function(t){this.givenname=t},F.prototype.GetEMail=function(){return this.EMail},F.prototype.SetEMail=function(t){this.EMail=t},F.prototype.GetDNS=function(){return this.DNS},F.prototype.SetDNS=function(t){this.DNS=t},F.prototype.GetEDRPOUCode=function(){return this.EDRPOUCode},F.prototype.SetEDRPOUCode=function(t){this.EDRPOUCode=t},F.prototype.GetDRFOCode=function(){return this.DRFOCode},F.prototype.SetDRFOCode=function(t){this.DRFOCode=t},F.prototype.GetNBUCode=function(){return this.NBUCode},F.prototype.SetNBUCode=function(t){this.NBUCode=t},F.prototype.GetSPFMCode=function(){return this.SPFMCode},F.prototype.SetSPFMCode=function(t){this.SPFMCode=t},F.prototype.GetOCode=function(){return this.OCode},F.prototype.SetOCode=function(t){this.OCode=t},F.prototype.GetOUCode=function(){return this.OUCode},F.prototype.SetOUCode=function(t){this.OUCode=t},F.prototype.GetUserCode=function(){return this.userCode},F.prototype.SetUserCode=function(t){this.userCode=t},F.prototype.GetUPN=function(){return this.UPN},F.prototype.SetUPN=function(t){this.UPN=t},F.prototype.GetUNZR=function(){return this.UNZR},F.prototype.SetUNZR=function(t){this.UNZR=t},F.prototype.GetCountry=function(){return this.country},F.prototype.SetCountry=function(t){this.country=t};var Y=function(){this.setClassInfo("EndUserParams",1),this.fields={SN:"number",commonName:"string",locality:"string",state:"string",organization:"string",orgUnit:"string",title:"string",street:"string",phone:"string",surname:"string",givenname:"string",EMail:"string",DNS:"string",EDRPOUCode:"string",DRFOCode:"string",NBUCode:"string",SPFMCode:"string",information:"string",passPhrase:"string",isPublishCertificate:"boolean",RAAdminSN:"number"},this.initializeFields()};y.makeTransferable(Y),Y.prototype.GetSN=function(){return this.SN},Y.prototype.SetSN=function(t){this.SN=t},Y.prototype.GetCommonName=function(){return this.commonName},Y.prototype.SetCommonName=function(t){this.commonName=t},Y.prototype.GetLocality=function(){return this.locality},Y.prototype.SetLocality=function(t){this.locality=t},Y.prototype.GetState=function(){return this.state},Y.prototype.SetState=function(t){this.state=t},Y.prototype.GetOrganization=function(){return this.organization},Y.prototype.SetOrganization=function(t){this.organization=t},Y.prototype.GetOrgUnit=function(){return this.orgUnit},Y.prototype.SetOrgUnit=function(t){this.orgUnit=t},Y.prototype.GetTitle=function(){return this.title},Y.prototype.SetTitle=function(t){this.title=t},Y.prototype.GetStreet=function(){return this.street},Y.prototype.SetStreet=function(t){this.street=t},Y.prototype.GetPhone=function(){return this.phone},Y.prototype.SetPhone=function(t){this.phone=t},Y.prototype.GetSurname=function(){return this.surname},Y.prototype.SetSurname=function(t){this.surname=t},Y.prototype.GetGivenname=function(){return this.givenname},Y.prototype.SetGivenname=function(t){this.givenname=t},Y.prototype.GetEMail=function(){return this.EMail},Y.prototype.SetEMail=function(t){this.EMail=t},Y.prototype.GetDNS=function(){return this.DNS},Y.prototype.SetDNS=function(t){this.DNS=t},Y.prototype.GetEDRPOUCode=function(){return this.EDRPOUCode},Y.prototype.SetEDRPOUCode=function(t){this.EDRPOUCode=t},Y.prototype.GetDRFOCode=function(){return this.DRFOCode},Y.prototype.SetDRFOCode=function(t){this.DRFOCode=t},Y.prototype.GetNBUCode=function(){return this.NBUCode},Y.prototype.SetNBUCode=function(t){this.NBUCode=t},Y.prototype.GetSPFMCode=function(){return this.SPFMCode},Y.prototype.SetSPFMCode=function(t){this.SPFMCode=t},Y.prototype.GetInformation=function(){return this.information},Y.prototype.SetInformation=function(t){this.information=t},Y.prototype.GetPassPhrase=function(){return this.passPhrase},Y.prototype.SetPassPhrase=function(t){this.passPhrase=t},Y.prototype.GetIsPublishCertificate=function(){return this.isPublishCertificate},Y.prototype.SetIsPublishCertificate=function(t){this.isPublishCertificate=t},Y.prototype.GetRAAdminSN=function(){return this.RAAdminSN},Y.prototype.SetRAAdminSN=function(t){this.RAAdminSN=t};var j=function(){this.setClassInfo("EndUserOperationContext",1),this.fields={handle:"string"},this.initializeFields(),this.handle=null};y.makeTransferable(j),j.prototype.GetHandle=function(){return this.handle};var H=function(){this.setClassInfo("EndUserSession",1),this.fields={handle:"string",data:"byteArray"},this.initializeFields()};y.makeTransferable(H),H.prototype.GetHandle=function(){return this.handle},H.prototype.GetData=function(){return this.data},H.prototype.SetData=function(t){this.data=t};var V=function(){this.setClassInfo("EndUserSCClientStatistic",1),this.fields={activeSessions:"number",gatedSessions:"number",unprotectedData:"number",protectedData:"number"},this.initializeFields()};y.makeTransferable(V),V.prototype.GetActiveSessions=function(){return this.activeSessions},V.prototype.GetGatedSessions=function(){return this.gatedSessions},V.prototype.GetUnprotectedData=function(){return this.unprotectedData},V.prototype.GetProtectedData=function(){return this.protectedData};var W=function(){this.setClassInfo("EndUserDeviceContext",1),this.fields={handle:"string"},this.initializeFields(),this.handle=null};y.makeTransferable(W),W.prototype.GetHandle=function(){return this.handle};var X=function(){this.setClassInfo("EndUserTransportHeader",1),this.fields={receiptNumber:"number",cryptoData:"byteArray"},this.initializeFields()};y.makeTransferable(X),X.prototype.GetReceiptNumber=function(){return this.receiptNumber},X.prototype.GetCryptoData=function(){return this.cryptoData};var z=function(){this.setClassInfo("EndUserCryptoHeader",1),this.fields={caType:"string",headerType:"number",headerSize:"number",cryptoData:"byteArray"},this.initializeFields()};y.makeTransferable(z),z.prototype.GetCAType=function(){return this.caType},z.prototype.GetHeaderType=function(){return this.headerType},z.prototype.GetHeaderSize=function(){return this.headerSize},z.prototype.GetCryptoData=function(){return this.cryptoData};var J=function(){this.setClassInfo("EndUserContext",1),this.fields={handle:"string"},this.initializeFields()};y.makeTransferable(J),J.prototype.GetHandle=function(){return this.handle};var q=function(){this.setClassInfo("EndUserHashContext",1),this.fields={handle:"string"},this.initializeFields()};y.makeTransferable(q),q.prototype.GetHandle=function(){return this.handle};var Z=function(){this.setClassInfo("EndUserPrivateKeyContext",1),this.fields={handle:"string",ownerInfo:"EndUserOwnerInfo"},this.initializeFields()};y.makeTransferable(Z),Z.prototype.GetHandle=function(){return this.handle},Z.prototype.GetOwnerInfo=function(){return this.ownerInfo};var Q=function(t,e){this.setClassInfo("EndUserReference",1),this.fields={name:"string",data:"byteArray"},this.initializeFields(),this.name=t,this.data=e};y.makeTransferable(Q),Q.prototype.GetName=function(){return this.name},Q.prototype.SetName=function(t){this.name=t},Q.prototype.GetData=function(){return this.data},Q.prototype.SetData=function(t){this.data=t};var $=function(t,e){this.errorCode=t,this.message=e,this.toString=function(){return this.message+" ("+this.errorCode+")"},this.GetErrorCode=function(){return this.errorCode},this.GetMessage=function(){return this.message}};function tt(t,e){this.errorCode=t,this.message=e,this.toString=function(){return this.message+" ("+this.errorCode+")"},this.GetErrorCode=function(){return this.errorCode},this.GetMessage=function(){return this.message}}$.ERROR_NONE=0,$.ERROR_UNKNOWN=65535,$.ERROR_NOT_SUPPORTED=65534,$.ERROR_NOT_INITIALIZED=1,$.ERROR_BAD_PARAMETER=2,$.ERROR_LIBRARY_LOAD=3,$.ERROR_READ_SETTINGS=4,$.ERROR_TRANSMIT_REQUEST=5,$.ERROR_MEMORY_ALLOCATION=6,$.WARNING_END_OF_ENUM=7,$.ERROR_PROXY_NOT_AUTHORIZED=8,$.ERROR_NO_GUI_DIALOGS=9,$.ERROR_DOWNLOAD_FILE=10,$.ERROR_WRITE_SETTINGS=11,$.ERROR_CANCELED_BY_GUI=12,$.ERROR_OFFLINE_MODE=13,$.ERROR_KEY_MEDIAS_FAILED=17,$.ERROR_KEY_MEDIAS_ACCESS_FAILED=18,$.ERROR_KEY_MEDIAS_READ_FAILED=19,$.ERROR_KEY_MEDIAS_WRITE_FAILED=20,$.WARNING_KEY_MEDIAS_READ_ONLY=21,$.ERROR_KEY_MEDIAS_DELETE=22,$.ERROR_KEY_MEDIAS_CLEAR=23,$.ERROR_BAD_PRIVATE_KEY=24,$.ERROR_PKI_FORMATS_FAILED=33,$.ERROR_CSP_FAILED=34,$.ERROR_BAD_SIGNATURE=35,$.ERROR_AUTH_FAILED=36,$.ERROR_NOT_RECEIVER=37,$.ERROR_STORAGE_FAILED=49,$.ERROR_BAD_CERT=50,$.ERROR_CERT_NOT_FOUND=51,$.ERROR_INVALID_CERT_TIME=52,$.ERROR_CERT_IN_CRL=53,$.ERROR_BAD_CRL=54,$.ERROR_NO_VALID_CRLS=55,$.ERROR_GET_TIME_STAMP=65,$.ERROR_BAD_TSP_RESPONSE=66,$.ERROR_TSP_SERVER_CERT_NOT_FOUND=67,$.ERROR_TSP_SERVER_CERT_INVALID=68,$.ERROR_GET_OCSP_STATUS=81,$.ERROR_BAD_OCSP_RESPONSE=82,$.ERROR_CERT_BAD_BY_OCSP=83,$.ERROR_OCSP_SERVER_CERT_NOT_FOUND=84,$.ERROR_OCSP_SERVER_CERT_INVALID=85,$.ERROR_LDAP_ERROR=97,$.ERROR_LIBRARY_COMUNICATION_FAILED=4097,$.ERROR_LIBRARY_VERSION_NOT_SUPPORTED=4098,$.ERROR_BROWSER_NOT_SUPPORTED=65537,$.ERROR_OPEN_FILE=65552,$.ERROR_READ_FILE=65553,$.ERROR_WRITE_FILE=65554,$.ERROR_DESCRIPTIONS_EX=[],$.ERROR_DESCRIPTIONS_EX[$.ERROR_NONE]=["Виконано успішно","Выполнено успешно","Executed successfully"],$.ERROR_DESCRIPTIONS_EX[$.ERROR_NOT_SUPPORTED]=["Операція не підтримується","Операция не поддерживается","Operation is not supported"],$.ERROR_DESCRIPTIONS_EX[$.ERROR_UNKNOWN]=["Невідома помилка","Неизвестная ошибка","Unknown error"],$.ERROR_DESCRIPTIONS_EX[$.ERROR_LIBRARY_LOAD]=["Виникла помилка при завантаженні криптографічної бібліотеки","Возникла ошибка при загрузке криптографической библиотеки","Error at load crypto library"],$.ERROR_DESCRIPTIONS_EX[$.ERROR_NOT_INITIALIZED]=["Бібліотека не ініціалізована","Библиотека не инициализирована","Library is not initialized"],$.ERROR_DESCRIPTIONS_EX[$.ERROR_BAD_PARAMETER]=["Невірний параметр","Неверный параметр","Incorrect parameter"],$.ERROR_DESCRIPTIONS_EX[$.ERROR_BAD_CERT]=["Сертифікат пошкоджений або не може бути використаний","Сертификат поврежден или не может быть использован","Certificate corrupted or cannot be used"],$.ERROR_DESCRIPTIONS_EX[$.ERROR_CERT_NOT_FOUND]=["Сертифікат не знайдено","Сертификат не найден","Certificate not found"],$.ERROR_DESCRIPTIONS_EX[$.ERROR_TRANSMIT_REQUEST]=["Виникла помилка при передачі запиту на сервер ЦСК за протоколом HTTP","Возникла ошибка при передаче запроса на сервер ЦСК по протоколу HTTP","Error at request transfer to CA's server by HTTP protocol"],$.ERROR_DESCRIPTIONS_EX[$.ERROR_DOWNLOAD_FILE]=["Виникла помилка при завантаженні файлу з HTTP-сервера","Возникла ошибка при загрузке файла с HTTP-сервера","Error at the load of file from a HTTP-server"],$.ERROR_DESCRIPTIONS_EX[$.ERROR_LIBRARY_COMUNICATION_FAILED]=["Виникла помилка при взаємодії з криптографічною бібліотекою","Возникла ошибка при взаимодействии с криптографической библиотекой","Error at comunication with crypto library"],$.ERROR_DESCRIPTIONS_EX[$.ERROR_LIBRARY_VERSION_NOT_SUPPORTED]=["Встановлена версія бібліотеки не підтримується","Установленная версия библиотеки не поддерживается","The installed version of the library is not supported"],$.ERROR_DESCRIPTIONS_EX[$.ERROR_BROWSER_NOT_SUPPORTED]=["Ваш браузер не підтримується","Ваш браузер не поддерживается","Your browser is not supported"],$.ERROR_DESCRIPTIONS_EX[$.ERROR_OPEN_FILE]=["Виникла помилка при відкритті файлу","Возникла ошибка при открытии файла","Error at open file"],$.ERROR_DESCRIPTIONS_EX[$.ERROR_READ_FILE]=["Виникла помилка при зчитуванні файлу","Возникла ошибка при чтении файла","Error at read file"],$.ERROR_DESCRIPTIONS_EX[$.ERROR_WRITE_FILE]=["Виникла помилка при записі файлу","Возникла ошибка при записи файла","Error at write file"],$.isError=function(t){return t!=$.ERROR_NONE},$.isSuccess=function(t){return t==$.ERROR_NONE},$.getErrorDescriptionEx=function(t,e){var n,r;return void 0===(n=$.ERROR_DESCRIPTIONS_EX[t])&&(n=$.ERROR_DESCRIPTIONS_EX[$.ERROR_UNKNOWN]),void 0===(r=n[e-1])?n[0]:r};var et=function(t,n){this.vendor="JSC IIT",this.classVersion="1.3.73",this.className="EUSignCP",this.SUBJECT_TYPE_UNDIFFERENCED=0,this.SUBJECT_TYPE_CA=1,this.SUBJECT_TYPE_CA_SERVER=2,this.SUBJECT_TYPE_RA_ADMINISTRATOR=3,this.SUBJECT_TYPE_END_USER=4,this.EU_SUBJECT_TYPE_UNDIFFERENCED=this.SUBJECT_TYPE_UNDIFFERENCED,this.EU_SUBJECT_TYPE_CA=this.SUBJECT_TYPE_CA,this.EU_SUBJECT_TYPE_CA_SERVER=this.SUBJECT_TYPE_CA_SERVER,this.EU_SUBJECT_TYPE_RA_ADMINISTRATOR=this.SUBJECT_TYPE_RA_ADMINISTRATOR,this.EU_SUBJECT_TYPE_END_USER=this.SUBJECT_TYPE_END_USER,this.SUBJECT_CA_SERVER_SUB_TYPE_UNDIFFERENCED=0,this.SUBJECT_CA_SERVER_SUB_TYPE_CMP=1,this.SUBJECT_CA_SERVER_SUB_TYPE_TSP=2,this.SUBJECT_CA_SERVER_SUB_TYPE_OCSP=3,this.EU_SUBJECT_CA_SERVER_SUB_TYPE_UNDIFFERENCED=this.SUBJECT_CA_SERVER_SUB_TYPE_UNDIFFERENCED,this.EU_SUBJECT_CA_SERVER_SUB_TYPE_CMP=this.SUBJECT_CA_SERVER_SUB_TYPE_CMP,this.EU_SUBJECT_CA_SERVER_SUB_TYPE_TSP=this.SUBJECT_CA_SERVER_SUB_TYPE_TSP,this.EU_SUBJECT_CA_SERVER_SUB_TYPE_OCSP=this.SUBJECT_CA_SERVER_SUB_TYPE_OCSP,this.CERT_KEY_TYPE_UNKNOWN=0,this.CERT_KEY_TYPE_DSTU4145=1,this.CERT_KEY_TYPE_RSA=2,this.CERT_KEY_TYPE_ECDSA=4,this.EU_CERT_KEY_TYPE_UNKNOWN=this.CERT_KEY_TYPE_UNKNOWN,this.EU_CERT_KEY_TYPE_DSTU4145=this.CERT_KEY_TYPE_DSTU4145,this.EU_CERT_KEY_TYPE_RSA=this.CERT_KEY_TYPE_RSA,this.EU_CERT_KEY_TYPE_ECDSA=this.CERT_KEY_TYPE_ECDSA,this.KEY_USAGE_UNKNOWN=0,this.KEY_USAGE_DIGITAL_SIGNATUR=1,this.KEY_KEY_USAGE_KEY_AGREEMENT=16,this.EU_KEY_USAGE_UNKNOWN=this.KEY_USAGE_UNKNOWN,this.EU_KEY_USAGE_DIGITAL_SIGNATURE=this.KEY_USAGE_DIGITAL_SIGNATUR,this.EU_KEY_USAGE_NON_REPUDATION=2,this.EU_KEY_USAGE_KEY_AGREEMENT=this.KEY_KEY_USAGE_KEY_AGREEMENT,this.EU_KEYS_REQUEST_TYPE_UA_DS=1,this.EU_KEYS_REQUEST_TYPE_UA_KEP=2,this.EU_KEYS_REQUEST_TYPE_INTERNATIONAL=3,this.EU_KEYS_TYPE_NONE=0,this.EU_KEYS_TYPE_DSTU_AND_ECDH_WITH_GOSTS=1,this.EU_KEYS_TYPE_RSA_WITH_SHA=2,this.EU_KEYS_TYPE_ECDSA_WITH_SHA=4,this.EU_KEYS_LENGTH_DS_UA_191=1,this.EU_KEYS_LENGTH_DS_UA_257=2,this.EU_KEYS_LENGTH_DS_UA_307=3,this.EU_KEYS_LENGTH_DS_UA_FILE=4,this.EU_KEYS_LENGTH_DS_UA_CERT=5,this.EU_KEYS_LENGTH_KEP_UA_257=1,this.EU_KEYS_LENGTH_KEP_UA_431=2,this.EU_KEYS_LENGTH_KEP_UA_571=3,this.EU_KEYS_LENGTH_KEP_UA_FILE=4,this.EU_KEYS_LENGTH_KEP_UA_CERT=5,this.EU_KEYS_LENGTH_DS_RSA_1024=1,this.EU_KEYS_LENGTH_DS_RSA_2048=2,this.EU_KEYS_LENGTH_DS_RSA_3072=3,this.EU_KEYS_LENGTH_DS_RSA_4096=4,this.EU_KEYS_LENGTH_DS_RSA_FILE=5,this.EU_KEYS_LENGTH_DS_RSA_CERT=6,this.EU_RECIPIENT_APPEND_ISSUER_AND_SERIAL=1,this.EU_RECIPIENT_APPEND_KEY_ID=2,this.EU_RECIPIENT_APPEND_KEY_ID_USC_COMPAT=3,this.EU_SAVE_SETTINGS_PARAMETER="SaveSettings",this.EU_RESOLVE_OIDS_PARAMETER="ResolveOIDs",this.EU_MAKE_PKEY_PFX_CONTAINER_PARAMETER="MakePKeyPFXContainer",this.EU_SIGN_INCLUDE_CONTENT_TIME_STAMP_PARAMETER="SignIncludeContentTimeStamp",this.EU_SIGN_TYPE_PARAMETER="SignType",this.EU_SIGN_INCLUDE_CA_CERTIFICATES_PARAMETER="SignIncludeCACertificates",this.EU_FS_CALCULATE_FINGERPRINT="FSCalculateFingerprint",this.EU_FORCE_USE_TSP_FROM_SETTINGS_PARAMETER="ForceUseTSPFromSettings",this.EU_STRING_ENCODING_PARAMETER="StringEncoding",this.EU_SETTINGS_ID_NONE=0,this.EU_SETTINGS_ID_MANDATORY=31,this.EU_SETTINGS_ID_ALL=1023,this.EU_SETTINGS_ID_FSTORE=1,this.EU_SETTINGS_ID_PROXY=2,this.EU_SETTINGS_ID_TSP=4,this.EU_SETTINGS_ID_OCSP=8,this.EU_SETTINGS_ID_LDAP=16,this.EU_SETTINGS_ID_MODE=32,this.EU_SETTINGS_ID_CMP=64,this.EU_SETTINGS_ID_KM=128,this.EU_SETTINGS_ID_OCSP_ACCESS_INFO_MODE=256,this.EU_SETTINGS_ID_OCSP_ACCESS_INFO=512,this.EU_HEADER_CA_TYPE="UA1",this.EU_HEADER_PART_TYPE_SIGNED=1,this.EU_HEADER_PART_TYPE_ENCRYPTED=2,this.EU_HEADER_PART_TYPE_STAMPED=3,this.EU_HEADER_PART_TYPE_CERTCRYPT=4,this.EU_HEADER_MAX_CA_TYPE_SIZE=3,this.EU_SIGNED_CRYPTO_HEADER=this.EU_HEADER_PART_TYPE_SIGNED,this.EU_ENCRYPTED_CRYPTO_HEADER=this.EU_HEADER_PART_TYPE_ENCRYPTED,this.EU_TIMESTAMPED_CRYPTO_HEADER=this.EU_HEADER_PART_TYPE_STAMPED,this.EU_CERTCRYPT_CRYPTO_HEADER=this.EU_HEADER_PART_TYPE_CERTCRYPT,this.EU_DEFAULT_LANG=0,this.EU_UA_LANG=1,this.EU_RU_LANG=2,this.EU_EN_LANG=3,this.EU_CONTENT_ENC_ALGO_TDES_CBC=4,this.EU_CONTENT_ENC_ALGO_AES_128_CBC=5,this.EU_CONTENT_ENC_ALGO_AES_192_CBC=6,this.EU_CONTENT_ENC_ALGO_AES_256_CBC=7,this.EU_DEV_CTX_MIN_PUBLIC_DATA_ID=16,this.EU_DEV_CTX_MAX_PRIVATE_DATA_ID=175,this.EU_UA_OID_EXT_KEY_USAGE_STAMP="1.2.804.2.1.1.1.3.9",this.EU_CCS_TYPE_REVOKE=1,this.EU_CCS_TYPE_HOLD=2,this.EU_REVOCATION_REASON_UNKNOWN=0,this.EU_REVOCATION_REASON_KEY_COMPROMISE=1,this.EU_REVOCATION_REASON_NEW_ISSURED=2,this.EU_SIGN_TYPE_UNKNOWN=0,this.EU_SIGN_TYPE_CADES_BES=1,this.EU_SIGN_TYPE_CADES_T=4,this.EU_SIGN_TYPE_CADES_C=8,this.EU_SIGN_TYPE_CADES_X_LONG=16,this.EU_SIGN_TYPE_CADES_X_LONG_TRUSTED=128,this.EU_CHECK_PRIVATE_KEY_CONTEXT_PARAMETER="CheckPrivateKey",this.EU_RESOLVE_OIDS_CONTEXT_PARAMETER="ResolveOIDs",this.EU_EXPORATABLE_CONTEXT_CONTEXT_PARAMETER="ExportableContext",this.EU_RECIPIENT_APPEND_TYPE_BY_ISSUER_SERIAL=1,this.EU_RECIPIENT_APPEND_TYPE_BY_KEY_ID=2,this.EU_CTX_HASH_ALGO_UNKNOWN=0,this.EU_CTX_HASH_ALGO_GOST34311=1,this.EU_CTX_HASH_ALGO_SHA160=2,this.EU_CTX_HASH_ALGO_SHA224=3,this.EU_CTX_HASH_ALGO_SHA256=4,this.EU_CTX_SIGN_UNKNOWN=0,this.EU_CTX_SIGN_DSTU4145_WITH_GOST34311=1,this.EU_CTX_SIGN_RSA_WITH_SHA=2,this.EU_CTX_SIGN_ECDSA_WITH_SHA=3,this.EU_FILE_PROCESS_CHUNK_SIZE=1048576,this.EU_ASIC_TYPE_UNKNOWN=0,this.EU_ASIC_TYPE_S=1,this.EU_ASIC_TYPE_E=2,this.EU_ASIC_SIGN_TYPE_UNKNOWN=0,this.EU_ASIC_SIGN_TYPE_CADES=1,this.EU_ASIC_SIGN_TYPE_XADES=2,this.EU_ASIC_SIGN_LEVEL_BES=1,this.EU_ASIC_SIGN_LEVEL_T=4,this.EU_ASIC_SIGN_LEVEL_C=8,this.EU_ASIC_SIGN_LEVEL_X_LONG=16,this.EU_ASIC_SIGN_LEVEL_X_LONG_TRUSTED=128,this.EU_XADES_SIGN_TYPE_UNKNOWN=0,this.EU_XADES_TYPE_DETACHED=1,this.EU_XADES_TYPE_ENVELOPING=2,this.EU_XADES_TYPE_ENVELOPED=3,this.EU_XADES_SIGN_LEVEL_BES=1,this.EU_XADES_SIGN_LEVEL_T=4,this.EU_CP_ACP_ENCODING=0,this.EU_CP_1251_ENCODING=1251,this.EU_UTF8_ENCODING=65001,this.m_language=this.EU_DEFAULT_LANG,this.m_lastErrorCode=$.ERROR_NONE,this.m_lastError="",this.m_charset="UTF-8",this.m_stringCoder=new e,this.m_base64Coder=new s,this.m_dateCoder=new o,this.m_browserInfo=new u;var r=1;switch(t){case"chrome-extension://jffafkigfgmjafhpkoibhfefeaebmccg/":r=2,this.m_browserInfo.GetName()==u.BROWSER_NAME_FIREFOX&&(t="eusw@iit.com.ua");break;case"clsid:B7E24C75-E343-4DA2-A8D3-C80970FB7D7B":r=4;break;case"application/x-eusign-cp":r=3}this.m_jsonRpcClient=new l(r,t,n,"https:"==window.location.protocol),this.m_monitorLibraryTimer=null};return et.prototype._funcMakeParams=function(t){var e=[];null==t&&(t=[]);for(var n=function(t){if(E(t))return t.encode();if(Array.isArray(t)){for(var e=t.length,r=[],i=0;i<e;i++)r[i]=n(t[i]);return r}return t},r=t.length,i=0;i<r;i++)e[i]=n(t[i]);return e},et.prototype._funcCall=function(t,e,n,r,i){var o;if(!this.IsAsync(n,r))return o=this.m_jsonRpcClient.execute(t,e,null),o=this._funcHandleResult(o),i?i(o):o;var s=null==i?n:function(t){i(t,n,r)},a=this;this.m_jsonRpcClient.execute(t,e,(function(t){a._funcHandleResult(t,s,r)}))},et.prototype._funcHandleResult=function(t,e,n){var r,i,o=this.IsAsync(e,n);if(null==t){if(r=this.MakeError($.ERROR_LIBRARY_COMUNICATION_FAILED,""),o)return void n(r);throw new tt(r.errorCode,r.message)}if(i=(r=t.error).code,$.isError(i)){if(i==$.WARNING_END_OF_ENUM)return o?void e(null):null;if(r=this.MakeError(i,r.message),o)return void n(r);throw new tt(r.errorCode,r.message)}try{t=this._funcDecodeResult(t.result)}catch(t){if(r=this.MakeError($.ERROR_LIBRARY_COMUNICATION_FAILED,""),o)return void n(r);throw new tt(r.errorCode,r.message)}if(!o)return t;e(t)},et.prototype._funcDecodeResult=function(t){if(null==t)return null;var e=function(t){if(Array.isArray(t)){for(var n=[],r=t.length,i=0;i<r;i++)n[i]=e(t[i]);return n}if("object"==typeof t){var o,s=t.className;return(o=new y[s]).decode(t)?"EndUserByteArray"==o.className?o.GetData():o:null}return t};return e(t)},et.prototype._checkVersion=function(t){try{var e=this.classVersion;if(e==t)return!0;if(e=e.split("."),t=t.split("."),e.length!=t.length)return!1;for(var n=0;n<t.length;n++)if(parseInt(e[n])>parseInt(t[n]))return!1}catch(t){return!1}return!0},et.prototype._stringToBytes=function(t,e){try{return this.m_stringCoder.encode(t)}catch(t){var n=this.MakeError($.ERROR_BAD_PARAMETER,"");if(void 0!==e)return setTimeout((function(){e(n)}),1),null;throw new tt(n.errorCode,n.message)}},et.prototype._bytesToString=function(t,e){try{return this.m_stringCoder.decode(t)}catch(t){var n=this.MakeError($.ERROR_BAD_PARAMETER,"");if(void 0!==e)return setTimeout((function(){e(n)}),1),null;throw new tt(n.errorCode,n.message)}},et.prototype._base64Encode=function(t,e){try{return this.m_base64Coder.encode(t)}catch(t){var n=this.MakeError($.ERROR_BAD_PARAMETER,"");if(void 0!==e)return setTimeout((function(){e(n)}),1),null;throw new tt(n.errorCode,n.message)}},et.prototype._base64Decode=function(t,e){try{return this.m_base64Coder.decode(t)}catch(t){var n=this.MakeError($.ERROR_BAD_PARAMETER,"");if(void 0!==e)return setTimeout((function(){e(n)}),1),null;throw new tt(n.errorCode,n.message)}},et.prototype._copyArrayData=function(t,e){try{if(t.length!=e.length)return!1;if(Array.isArray(e)||Array.isArray(t))for(var n=0;n<e.length;n++)t[n]=e[n];else t.set(e);return!0}catch(t){return!1}},et.prototype._startMonitorLibraryStatus=function(){var t=this;try{t.m_monitorLibraryTimer=setInterval((function(){t.IsInitialized((function(e){e||t._stopMonitorLibraryStatus()}),(function(e){t._stopMonitorLibraryStatus()}))}),6e5)}catch(t){}},et.prototype._stopMonitorLibraryStatus=function(){try{if(null==this.m_monitorLibraryTimer)return;clearInterval(this.m_monitorLibraryTimer),this.m_monitorLibraryTimer=null}catch(t){}},et.prototype.IsAsync=function(t,e){return void 0!==t&&void 0!==e},et.prototype.MakeError=function(t,e){return""==e&&(e=$.getErrorDescriptionEx(t,this.m_language)),this.m_lastErrorCode=t,this.m_lastError=e,new $(t,e)},et.prototype.RaiseError=function(t,e){var n;throw new tt((n=this.MakeError(t,e)).errorCode,n.message)},et.prototype.GetInstallURL=function(t,e){var n=this.m_browserInfo.GetOSName(),r=this.m_browserInfo.GetArch(),i=[];e=e||"https://iit.com.ua/download/productfiles";var o=function(t){i.push(e+"/"+t)};switch(n){case u.OS_NAME_WINDOWS:o("EUSignWebInstall.exe");break;case u.OS_NAME_MAC:o("EUSignWebInstall.pkg");break;case u.OS_NAME_LINUX:r==u.BROWSER_ARCH_NAME_X86?(o("euswi.deb"),o("euswi.rpm"),o("euswi.tar")):(o("euswi.64.deb"),o("euswi.64.rpm"),o("euswi.64.tar"));break;case u.OS_NAME_ANDROID:o("EUSignWebInstall.apk");break;default:return null}return t?i:i[0]},et.prototype.GetUpdateURL=function(t,e){var n=this.m_browserInfo.GetOSName(),r=this.m_browserInfo.GetArch(),i=[];e=e||"https://iit.com.ua/download/productfiles";var o=function(t){i.push(e+"/"+t)};switch(n){case u.OS_NAME_WINDOWS:o("EUSignWebUpdate.exe");break;case u.OS_NAME_MAC:o("EUSignWebInstall.pkg");break;case u.OS_NAME_LINUX:r==u.BROWSER_ARCH_NAME_X86?(o("euswi.deb"),o("euswi.rpm"),o("euswi.tar")):(o("euswi.64.deb"),o("euswi.64.rpm"),o("euswi.64.tar"));break;case u.OS_NAME_ANDROID:o("EUSignWebInstall.apk");break;default:return null}return t?i:i[0]},et.prototype.GetHelpURL=function(t){switch(t=t||"https://iit.com.ua/download/productfiles",this.m_browserInfo.GetOSName()){case u.OS_NAME_WINDOWS:case u.OS_NAME_MAC:case u.OS_NAME_LINUX:return t+"/EUSignWebOManual.pdf";default:return null}},et.prototype.GetWebExtensionInstallURL=function(){switch(this.m_browserInfo.GetName()){case u.BROWSER_NAME_CHROME:return t;case u.BROWSER_NAME_FIREFOX:return"https://eu.iit.com.ua/download/productfiles/eusw@iit.com.ua.xpi";case u.BROWSER_NAME_OPERA:return"https://chrome.google.com/webstore/detail/%D1%96%D1%96%D1%82-%D0%BA%D0%BE%D1%80%D0%B8%D1%81%D1%82%D1%83%D0%B2%D0%B0%D1%87-%D1%86%D1%81%D0%BA-1-%D0%B1%D1%96%D0%B1%D0%BB/jffafkigfgmjafhpkoibhfefeaebmccg?utm_source=chrome-app-launcher-info-dialog";default:return null}},et.prototype.GetInstallPath=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("GetInstallPath",n,t,e,null)},et.prototype.SelectFile=function(t,e,n,r){return this.SelectFileEx(t,e,null,null,null,null,n,r)},et.prototype.SelectFileEx=function(t,e,n,r,i,o,s,a){var u;return u=this._funcMakeParams([t,e,n,r,i,o]),this._funcCall("SelectFile",u,s,a,null)},et.prototype.SelectFolder=function(t,e){return this.SelectFolderEx(null,null,null,t,e)},et.prototype.SelectFolderEx=function(t,e,n,r,i){var o;return o=this._funcMakeParams([t,e,n]),this._funcCall("SelectFolder",o,r,i,null)},et.prototype.CreateFolder=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("CreateFolder",r,e,n,null)},et.prototype.ReadFile=function(t,e,n){var r=this.IsAsync(e,n),i=this,o=i.EU_FILE_PROCESS_CHUNK_SIZE;if(!r){for(var s,a=i.GetFileSize(t),u=Math.floor(a/o),c=a%o,l=new Uint8Array(a),f=0;f<u;f++)s=i.ReadFileWithOffset(t,f*o,o),l.set(s,f*o,s.length);return 0!=c&&(s=i.ReadFileWithOffset(t,u*o,c),l.set(s,u*o,s.length)),l}var p={buf:null,length:0,curLength:0},_=function(r){if(r.curLength!=r.length){var s=r.length-r.curLength;s>o&&(s=o),i.ReadFileWithOffset(t,r.curLength,s,(function(t){r.buf.set(t,r.curLength,t.length),r.curLength+=t.length,_(r)}),n)}else e(r.buf)};i.GetFileSize(t,(function(t){p.buf=new Uint8Array(t),p.length=t,_(p)}),n)},et.prototype.WriteFile=function(t,e,n,r){var i=this.IsAsync(n,r),o=this,s=o.EU_FILE_PROCESS_CHUNK_SIZE;if(i){var a={buf:null,length:0,curLength:0},u=function(e,i){if(i||e.curLength!=e.length){var a=e.length-e.curLength;a>s&&(a=s),o.WriteFileWithOffset(t,e.curLength,o.Copy(e.buf,e.curLength,s),(function(){e.curLength+=a,u(e,!1)}),r)}else n()};a.buf=e,a.length=e.length,u(a,!0)}else{for(var c=e.length,l=Math.floor(c/s),f=c%s,p=0;p<l;p++)o.WriteFileWithOffset(t,p*s,o.Copy(e,p*s,s));0==f&&0!=e.length||o.WriteFileWithOffset(t,l*s,o.Copy(e,l*s,f))}},et.prototype.GetFileSize=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("GetFileSize",r,e,n,null)},et.prototype.ReadFileWithOffset=function(t,e,n,r,i){var o;return o=this._funcMakeParams([t,e,n]),this._funcCall("ReadFileWithOffset",o,r,i,null)},et.prototype.WriteFileWithOffset=function(t,e,n,r,i){var o;return o=this._funcMakeParams([t,e,new S(n)]),this._funcCall("WriteFileWithOffset",o,r,i,null)},et.prototype.DeleteFile=function(t,e,n){var r;r=this._funcMakeParams([t]),this._funcCall("DeleteFile",r,e,n,null)},et.prototype.AppendFile=function(t,e,n,r){var i;i=this._funcMakeParams([t,e]),this._funcCall("AppendFile",i,n,r,null)},et.prototype.CopyFileWithOffset=function(t,e,n,r,i,o){var s;s=this._funcMakeParams([t,e,n,r]),this._funcCall("CopyFileWithOffset",s,i,o,null)},et.prototype.Load=function(t,e){var n=this.IsAsync(t,e),r=this;if(n)this.GetVersion((function(n){if(r._checkVersion(n))t();else{var i=r.MakeError($.ERROR_LIBRARY_VERSION_NOT_SUPPORTED,"");e(i)}}),(function(t){t=r.MakeError($.ERROR_LIBRARY_COMUNICATION_FAILED,""),e(t)}));else{var i;try{i=this._checkVersion(this.GetVersion())}catch(t){this.RaiseError($.ERROR_LIBRARY_COMUNICATION_FAILED,"")}i||this.RaiseError($.ERROR_LIBRARY_VERSION_NOT_SUPPORTED,"")}},et.prototype.GetVersion=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("GetVersion",n,t,e,null)},et.prototype.IsInitialized=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("IsInitialized",n,t,e,null)},et.prototype.Initialize=function(t,e){var n,r=this,i=this.IsAsync(t,e);n=this._funcMakeParams(null),this._funcCall("Initialize",n,i?function(){r._startMonitorLibraryStatus(),t()}:t,e,null),i||r._startMonitorLibraryStatus()},et.prototype.Finalize=function(t,e){var n;this._stopMonitorLibraryStatus(),n=this._funcMakeParams(null),this._funcCall("Finalize",n,t,e,null)},et.prototype.ResetOperation=function(t,e){var n;n=this._funcMakeParams(null),this._funcCall("ResetOperation",n,t,e,null)},et.prototype.SetUIMode=function(t,e,n){var r;r=this._funcMakeParams([t]),this._funcCall("SetUIMode",r,e,n,null)},et.prototype.SetLanguage=function(t,e,n){var r,i=this,o=this.IsAsync(e,n);r=this._funcMakeParams([t]),this._funcCall("SetLanguage",r,o?function(){i.m_language=t,e()}:e,n,null),o||(this.m_language=t)},et.prototype.SetCharset=function(t,e,n){var r,o=this.IsAsync(e,n);if(null==(r=i.GetCoder(t))){var s=this.MakeError($.ERROR_BAD_PARAMETER,"");if(o)return void setTimeout((function(){n(s)}),1);throw new tt(s.errorCode,s.message)}this.m_stringCoder=r,this.m_charset=t,o&&setTimeout((function(){e()}),1)},et.prototype.SetRuntimeParameter=function(t,e,n,r){var i;"boolean"==typeof e&&(e=e?1:0),i=this._funcMakeParams([t,e]),this._funcCall("SetRuntimeParameter",i,n,r,null)},et.prototype.GetStorageParameter=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("GetStorageParameter",i,n,r,null)},et.prototype.SetStorageParameter=function(t,e,n,r,i){var o;o=this._funcMakeParams([t,e,n]),this._funcCall("SetStorageParameter",o,r,i,null)},et.prototype.CreateArrayList=function(){return new _},et.prototype.GetLastError=function(){return this.m_lastError},et.prototype.GetLastErrorCode=function(){return this.m_lastErrorCode},et.prototype.BASE64Encode=function(t,e,n){var r=this._base64Encode(t,n);if(!this.IsAsync(e,n))return r;setTimeout((function(){e(r)}),1)},et.prototype.BASE64Decode=function(t,e,n){var r=this._base64Decode(t,n);if(!this.IsAsync(e,n))return r;setTimeout((function(){e(r)}),1)},et.prototype.StringToBytes=function(t,e,n){var r=this._stringToBytes(t,n);if(!this.IsAsync(e,n))return r;setTimeout((function(){e(r)}),1)},et.prototype.BytesToString=function(t,e,n){var r=this._bytesToString(t,n);if(!this.IsAsync(e,n))return r;setTimeout((function(){e(r)}),1)},et.prototype.Concatenate=function(t,e){if(Array.isArray(t)&&Array.isArray(e))return t.concat(e);var n,r=t.length+e.length;if(Array.isArray(t)||Array.isArray(e)){var i,o;for(n=new Array(r),i=0;i<t.length;i++)n[i]=t[i];for(o=0;o<e.length;i++,o++)n[i]=e[o]}else(n=new h(r)).set(t),n.set(e,t.length);return n},et.prototype.Copy=function(t,e,n){return t.slice(e,e+n)},et.prototype.SetSettings=function(t,e){var n;n=this._funcMakeParams(null),this._funcCall("SetSettings",n,t,e,null)},et.prototype.DoesNeedSetSettings=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("DoesNeedSetSettings",n,t,e,null)},et.prototype.InitializeMandatorySettings=function(t,e){var n=this;if(this.IsAsync(t,e))a((function(t){var r=n.CreateFileStoreSettings();n.SetFileStoreSettings(r,t,e)})).eu_wait((function(t){n.GetProxySettings((function(e){t()}),(function(r){n.GetSystemProxySettings((function(r){n.SetProxySettings(r,t,e)}),(function(r){var i=n.CreateProxySettings();n.SetProxySettings(i,t,e)}))}))})).eu_wait((function(t){var r=n.CreateTSPSettings();n.SetTSPSettings(r,t,e)})).eu_wait((function(t){var r=n.CreateLDAPSettings();n.SetLDAPSettings(r,t,e)})).eu_wait((function(){var r=n.CreateOCSPSettings();n.SetOCSPSettings(r,t,e)}));else{var r,i=n.CreateFileStoreSettings();n.SetFileStoreSettings(i);try{r=n.GetProxySettings()}catch(t){r=n.CreateProxySettings();try{r=n.GetSystemProxySettings()}catch(t){}n.SetProxySettings(r)}var o=n.CreateTSPSettings();n.SetTSPSettings(o);var s=n.CreateLDAPSettings();n.SetLDAPSettings(s);var u=n.CreateOCSPSettings();n.SetOCSPSettings(u)}},et.prototype.CreateModeSettings=function(){return new g},et.prototype.GetModeSettings=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("GetModeSettings",n,t,e,null)},et.prototype.SetModeSettings=function(t,e,n){var r;r=this._funcMakeParams([t]),this._funcCall("SetModeSettings",r,e,n,null)},et.prototype.CreateKeyMediaSettings=function(){return new U},et.prototype.GetKeyMediaSettings=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("GetKeyMediaSettings",n,t,e,null)},et.prototype.SetKeyMediaSettings=function(t,e,n){var r;r=this._funcMakeParams([t]),this._funcCall("SetKeyMediaSettings",r,e,n,null)},et.prototype.CreateFileStoreSettings=function(){return new d},et.prototype.GetFileStoreSettings=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("GetFileStoreSettings",n,t,e,null)},et.prototype.SetFileStoreSettings=function(t,e,n){var r;r=this._funcMakeParams([t]),this._funcCall("SetFileStoreSettings",r,e,n,null)},et.prototype.CreateProxySettings=function(){return new m},et.prototype.GetProxySettings=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("GetProxySettings",n,t,e,null)},et.prototype.SetProxySettings=function(t,e,n){var r;r=this._funcMakeParams([t]),this._funcCall("SetProxySettings",r,e,n,null)},et.prototype.CreateOCSPSettings=function(){return new A},et.prototype.GetOCSPSettings=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("GetOCSPSettings",n,t,e,null)},et.prototype.SetOCSPSettings=function(t,e,n){var r;r=this._funcMakeParams([t]),this._funcCall("SetOCSPSettings",r,e,n,null)},et.prototype.CreateOCSPAccessInfoModeSettings=function(){return new T},et.prototype.GetOCSPAccessInfoModeSettings=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("GetOCSPAccessInfoModeSettings",n,t,e,null)},et.prototype.SetOCSPAccessInfoModeSettings=function(t,e,n){var r;r=this._funcMakeParams([t]),this._funcCall("SetOCSPAccessInfoModeSettings",r,e,n,null)},et.prototype.CreateOCSPAccessInfoSettings=function(){return new I},et.prototype.EnumOCSPAccessInfoSettings=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("EnumOCSPAccessInfoSettings",r,e,n,null)},et.prototype.GetOCSPAccessInfoSettings=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("GetOCSPAccessInfoSettings",r,e,n,null)},et.prototype.SetOCSPAccessInfoSettings=function(t,e,n){var r,i=this,o=i.IsAsync(e,n);if(t=Array.isArray(t)?t:[t],o){var s=function(o){o>=t.length?e():(r=i._funcMakeParams([t[o]]),i._funcCall("SetOCSPAccessInfoSettings",r,(function(){s(o+1)}),n,null))};s(0)}else for(var a=0;a<t.length;a++)r=i._funcMakeParams([t[a]]),i._funcCall("SetOCSPAccessInfoSettings",r,e,n,null)},et.prototype.DeleteOCSPAccessInfoSettings=function(t,e,n){var r;r=this._funcMakeParams([t]),this._funcCall("DeleteOCSPAccessInfoSettings",r,e,n,null)},et.prototype.CreateTSPSettings=function(){return new R},et.prototype.GetTSPSettings=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("GetTSPSettings",n,t,e,null)},et.prototype.SetTSPSettings=function(t,e,n){var r;r=this._funcMakeParams([t]),this._funcCall("SetTSPSettings",r,e,n,null)},et.prototype.CreateLDAPSettings=function(){return new P},et.prototype.GetLDAPSettings=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("GetLDAPSettings",n,t,e,null)},et.prototype.SetLDAPSettings=function(t,e,n){var r;r=this._funcMakeParams([t]),this._funcCall("SetLDAPSettings",r,e,n,null)},et.prototype.CreateCMPSettings=function(){return new v},et.prototype.GetCMPSettings=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("GetCMPSettings",n,t,e,null)},et.prototype.SetCMPSettings=function(t,e,n){var r;r=this._funcMakeParams([t]),this._funcCall("SetCMPSettings",r,e,n,null)},et.prototype.GetSystemProxySettings=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("GetSystemProxySettings",n,t,e,null)},et.prototype.SetOCSPResponseExpireTime=function(t,e,n){var r;r=this._funcMakeParams([t]),this._funcCall("SetOCSPResponseExpireTime",r,e,n,null)},et.prototype.RefreshFileStore=function(t,e,n){var r;r=this._funcMakeParams([t]),this._funcCall("RefreshFileStore",r,e,n,null)},et.prototype.ShowCertificates=function(t,e){var n;n=this._funcMakeParams(null),this._funcCall("ShowCertificates",n,t,e,null)},et.prototype.SelectCertificateInfo=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("SelectCertificateInfo",n,t,e,null)},et.prototype.GetCertificatesCount=function(t,e,n,r){var i;return"number"==typeof t&&"number"==typeof e||(n=t,r=e,t=this.SUBJECT_TYPE_UNDIFFERENCED,e=this.SUBJECT_CA_SERVER_SUB_TYPE_UNDIFFERENCED),i=this._funcMakeParams([t,e]),this._funcCall("GetCertificatesCount",i,n,r,null)},et.prototype.GetCACertificatesCount=function(t,e){return this.GetCertificatesCount(this.SUBJECT_TYPE_CA,this.SUBJECT_CA_SERVER_SUB_TYPE_UNDIFFERENCED,t,e)},et.prototype.GetCAServerCertificatesCount=function(t,e){return this.GetCertificatesCount(this.SUBJECT_TYPE_CA_SERVER,this.SUBJECT_CA_SERVER_SUB_TYPE_UNDIFFERENCED,t,e)},et.prototype.GetCMPServerCertificatesCount=function(t,e){return this.GetCertificatesCount(this.SUBJECT_TYPE_CA_SERVER,this.SUBJECT_CA_SERVER_SUB_TYPE_CMP,t,e)},et.prototype.GetOCSPServerCertificatesCount=function(t,e){return this.GetCertificatesCount(this.SUBJECT_TYPE_CA_SERVER,this.SUBJECT_CA_SERVER_SUB_TYPE_OCSP,t,e)},et.prototype.GetTSPServerCertificatesCount=function(t,e){return this.GetCertificatesCount(this.SUBJECT_TYPE_CA_SERVER,this.SUBJECT_CA_SERVER_SUB_TYPE_TSP,t,e)},et.prototype.GetRAAdministratorCertificatesCount=function(t,e){return this.GetCertificatesCount(this.SUBJECT_TYPE_RA_ADMINISTRATOR,this.SUBJECT_CA_SERVER_SUB_TYPE_UNDIFFERENCED,t,e)},et.prototype.GetEndUserCertificatesCount=function(t,e){return this.GetCertificatesCount(this.SUBJECT_TYPE_END_USER,this.SUBJECT_CA_SERVER_SUB_TYPE_UNDIFFERENCED,t,e)},et.prototype.EnumCertificates=function(t,e,n,r,i){var o;return"number"==typeof e&&"number"==typeof n||(r=e,i=n,n=t,t=this.SUBJECT_TYPE_UNDIFFERENCED,e=this.SUBJECT_CA_SERVER_SUB_TYPE_UNDIFFERENCED),o=this._funcMakeParams([t,e,n]),this._funcCall("EnumCertificates",o,r,i,null)},et.prototype.EnumCACertificates=function(t,e,n){return this.EnumCertificates(t,this.SUBJECT_TYPE_CA,this.SUBJECT_CA_SERVER_SUB_TYPE_UNDIFFERENCED,e,n)},et.prototype.EnumCAServerCertificates=function(t,e,n){return this.EnumCertificates(t,this.SUBJECT_TYPE_CA_SERVER,this.SUBJECT_CA_SERVER_SUB_TYPE_UNDIFFERENCED,e,n)},et.prototype.EnumCMPServerCertificatesCount=function(t,e,n){return this.EnumCertificates(t,this.SUBJECT_TYPE_CA_SERVER,this.SUBJECT_CA_SERVER_SUB_TYPE_CMP,e,n)},et.prototype.EnumOCSPServerCertificatesCount=function(t,e,n){return this.EnumCertificates(t,this.SUBJECT_TYPE_CA_SERVER,this.SUBJECT_CA_SERVER_SUB_TYPE_OCSP,e,n)},et.prototype.EnumTSPServerCertificatesCount=function(t,e,n){return this.EnumCertificates(t,this.SUBJECT_TYPE_CA_SERVER,this.SUBJECT_CA_SERVER_SUB_TYPE_TSP,e,n)},et.prototype.EnumRAAdministratorCertificatesCount=function(t,e,n){return this.EnumCertificates(t,this.SUBJECT_TYPE_RA_ADMINISTRATOR,this.SUBJECT_CA_SERVER_SUB_TYPE_UNDIFFERENCED,e,n)},et.prototype.EnumEndUserCertificatesCount=function(t,e,n){return this.EnumCertificates(t,this.SUBJECT_TYPE_END_USER,this.SUBJECT_CA_SERVER_SUB_TYPE_UNDIFFERENCED,e,n)},et.prototype.GetCertificateInfo=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("GetCertificateInfo",i,n,r,null)},et.prototype.GetCertificateInfoEx=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("GetCertificateInfoEx",i,n,r,null)},et.prototype.GetCertificate=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("GetCertificate",i,n,r,null)},et.prototype.CheckCertificateByIssuerAndSerial=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("CheckCertificateByIssuerAndSerial",i,n,r,null)},et.prototype.CheckCertificate=function(t,e,n){var r;return r=this._funcMakeParams([new S(t)]),this._funcCall("CheckCertificate",r,e,n,null)},et.prototype.ParseCertificate=function(t,e,n){var r;return r=this._funcMakeParams([new S(t)]),this._funcCall("ParseCertificate",r,e,n,null)},et.prototype.ParseCertificateEx=function(t,e,n){var r;return r=this._funcMakeParams([new S(t)]),this._funcCall("ParseCertificateEx",r,e,n,null)},et.prototype.SaveCertificate=function(t,e,n){var r;return r=this._funcMakeParams([new S(t)]),this._funcCall("SaveCertificate",r,e,n,null)},et.prototype.SaveCertificates=function(t,e,n){var r;return r=this._funcMakeParams([new S(t)]),this._funcCall("SaveCertificates",r,e,n,null)},et.prototype.SaveCertificatesEx=function(t,e,n,r){var i;return i=this._funcMakeParams([new S(t),e?new S(e):null]),this._funcCall("SaveCertificatesEx",i,n,r,null)},et.prototype.GetCertificatesFromLDAPByEDRPOUCode=function(t,e,n,r,i,o,s){var a;return null!=r&&null!=i?("EndUserArrayList"==r.className&&(r=r.m_array),"EndUserArrayList"==i.className&&(i=i.m_array)):(r=null,i=null),a=this._funcMakeParams([t,e,n,r,i]),this._funcCall("GetCertificatesFromLDAPByEDRPOUCode",a,o,s,null)},et.prototype.GetCertificateByEmail=function(t,e,n,r,i,o){var s;return"string"!=typeof r&&(r=this.m_dateCoder.encode(r)),s=this._funcMakeParams([t,e,n,r]),this._funcCall("GetCertificateByEmail",s,i,o,null)},et.prototype.GetCertificateByNBUCode=function(t,e,n,r,i,o){var s;return"string"!=typeof r&&(r=this.m_dateCoder.encode(r)),s=this._funcMakeParams([t,e,n,r]),this._funcCall("GetCertificateByNBUCode",s,i,o,null)},et.prototype.GetReceiversCertificates=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("GetReceiversCertificates",n,t,e,null)},et.prototype.GetReceiversCertificatesInArrayList=function(t,e){var n,r=this;return n=this._funcMakeParams(null),this._funcCall("GetReceiversCertificates",n,t,e,(function(t,e,n){var i=r.IsAsync(e,n);try{for(var o=new _,s=0;s<t.length;s++)o.add(t[s]);if(!i)return o;e(o)}catch(t){var a=r.MakeError($.ERROR_LIBRARY_COMUNICATION_FAILED,"");if(i)return void n(a);throw new tt(a.errorCode,a.message)}}))},et.prototype.GetCertificates=function(t,e,n,r){var i,o=this;return i=this._funcMakeParams([t,e]),this._funcCall("GetCertificates",i,n,r,(function(t,e,n){var r=o.IsAsync(e,n);try{for(var i=new _,s=0;s<t.length;s++)i.add(t[s]);if(!r)return i;e(i)}catch(t){var a=o.MakeError($.ERROR_LIBRARY_COMUNICATION_FAILED,"");if(r)return void n(a);throw new tt(a.errorCode,a.message)}}))},et.prototype.GetCertificateByFingerprint=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("GetCertificateByFingerprint",r,e,n,null)},et.prototype.GetCertificatesByEDRPOUAndDRFOCode=function(t,e,n,r){var i,o=this;return i=this._funcMakeParams([t,e]),this._funcCall("GetCertificatesByEDRPOUAndDRFOCode",i,n,r,(function(t,e,n){var r=o.IsAsync(e,n);try{for(var i=new _,s=0;s<t.length;s++)i.add(t[s]);if(!r)return i;e(i)}catch(t){var a=o.MakeError($.ERROR_LIBRARY_COMUNICATION_FAILED,"");if(r)return void n(a);throw new tt(a.errorCode,a.message)}}))},et.prototype.ShowCRLs=function(t,e){var n;n=this._funcMakeParams(null),this._funcCall("ShowCRLs",n,t,e,null)},et.prototype.GetCRLsCount=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("GetCRLsCount",n,t,e,null)},et.prototype.EnumCRLs=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("EnumCRLs",r,e,n,null)},et.prototype.GetCRLDetailedInfo=function(t,e,n,r){var i;return i=this._funcMakeParams([t,parseInt(e)]),this._funcCall("GetCRLDetailedInfo",i,n,r,null)},et.prototype.SaveCRL=function(t,e,n,r){var i;return i=this._funcMakeParams([t,new S(e)]),this._funcCall("SaveCRL",i,n,r,null)},et.prototype.GetTSPByAccessInfo=function(t,e,n,r,i,o){var s;if("string"==typeof e||null!=(e=this._base64Encode(e,o)))return s=this._funcMakeParams([t,e,n,r]),this._funcCall("GetTSPByAccessInfo",s,i,o,null)},et.prototype.CheckTSP=function(t,e,n,r,i){var o;"string"==typeof t&&null==(t=this._base64Decode(t,i))||null!=n&&"string"!=typeof n&&null==(n=this._base64Encode(n,i))||(o=this._funcMakeParams([new S(t),e,n]),this._funcCall("CheckTSP",o,r,i,null))},et.prototype.GetOCSPResponseByAccessInfo=function(t,e,n,r,i){var o;return o=this._funcMakeParams([new S(t),e,n]),this._funcCall("GetOCSPResponseByAccessInfo",o,r,i,null)},et.prototype.CheckOCSPResponse=function(t,e,n,r){var i;if("string"!=typeof t||null!=(t=this._base64Decode(t,r)))return null!=e&&"string"!=typeof e&&(e=this.m_dateCoder.encode(e)),i=this._funcMakeParams([new S(t),e]),this._funcCall("CheckOCSPResponse",i,n,r,null)},et.prototype.CreateKeyMedia=function(){return new C},et.prototype.GetPrivateKeyMedia=function(t,e,n){var r;return"string"!=typeof t&&(t=null),r=this._funcMakeParams([t]),this._funcCall("GetPrivateKeyMedia",r,e,n,null)},et.prototype.EnumKeyMediaTypes=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("EnumKeyMediaTypes",r,e,n,null)},et.prototype.EnumKeyMediaDevices=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("EnumKeyMediaDevices",i,n,r,null)},et.prototype.GetKeyMediaTypes=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("GetKeyMediaTypes",n,t,e,null)},et.prototype.GetKeyMediaDevices=function(t,e,n){var r;return"number"==typeof t&&(t=[t]),t&&(t=new S(t)),r=this._funcMakeParams([t]),this._funcCall("GetKeyMediaDevices",r,e,n,null)},et.prototype.IsPrivateKeyReaded=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("IsPrivateKeyReaded",n,t,e,null)},et.prototype.ReadPrivateKey=function(t,e){var n;n=this._funcMakeParams(null),this._funcCall("ReadPrivateKey",n,t,e,null)},et.prototype.ReadPrivateKeySilently=function(t,e,n,r,i){var o,s;"number"==typeof t?((s=new C).typeIndex=t,s.devIndex=e,s.password=n):(s=t,r=e,i=n),o=this._funcMakeParams([s]),this._funcCall("ReadPrivateKeySilently",o,r,i,null)},et.prototype.ReadPrivateKeyBinary=function(t,e,n,r){var i;i=this._funcMakeParams([new S(t),e]),this._funcCall("ReadPrivateKeyBinary",i,n,r,null)},et.prototype.ReadPrivateKeyFile=function(t,e,n,r){var i;i=this._funcMakeParams([t,e]),this._funcCall("ReadPrivateKeyFile",i,n,r,null)},et.prototype.CtxReadPrivateKey=function(t,e,n,r,i,o){var s,a;return"number"==typeof e?((a=new C).typeIndex=e,a.devIndex=n,a.password=r):(a=e,i=n,o=r),s=this._funcMakeParams([t,a]),this._funcCall("CtxReadPrivateKey",s,i,o,null)},et.prototype.CtxReadPrivateKeyBinary=function(t,e,n,r,i){var o;return o=this._funcMakeParams([t,new S(e),n]),this._funcCall("CtxReadPrivateKeyBinary",o,r,i,null)},et.prototype.ResetPrivateKey=function(t,e){var n;n=this._funcMakeParams(null),this._funcCall("ResetPrivateKey",n,t,e,null)},et.prototype.CtxFreePrivateKey=function(t,e,n){var r;r=this._funcMakeParams([t]),this._funcCall("CtxFreePrivateKey",r,e,n,null)},et.prototype.ShowOwnCertificate=function(t,e){var n;n=this._funcMakeParams(null),this._funcCall("ShowOwnCertificate",n,t,e,null)},et.prototype.GetOwnCertificate=function(t,e,n,r){var i;return"number"==typeof t&&"number"==typeof e||(n=t,r=e,t=null,e=null),i=this._funcMakeParams([t,e]),this._funcCall("GetOwnCertificate",i,n,r,null)},et.prototype.EnumOwnCertificates=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("EnumOwnCertificates",r,e,n,null)},et.prototype.GetPrivateKeyOwnerInfo=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("GetPrivateKeyOwnerInfo",n,t,e,null)},et.prototype.CtxEnumOwnCertificates=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("CtxEnumOwnCertificates",i,n,r,null)},et.prototype.CtxGetOwnCertificate=function(t,e,n,r,i){var o;return o=this._funcMakeParams([t,e,n]),this._funcCall("CtxGetOwnCertificate",o,r,i,null)},et.prototype.GetKeyInfo=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("GetKeyInfo",r,e,n,null)},et.prototype.GetKeyInfoSilently=function(t,e,n,r,i){var o;return(o=new C).typeIndex=t,o.devIndex=e,o.password=n,this.GetKeyInfo(o,r,i)},et.prototype.GetKeyInfoBinary=function(t,e,n,r){var i;return i=this._funcMakeParams([new S(t),e]),this._funcCall("GetKeyInfoBinary",i,n,r,null)},et.prototype.GetKeyInfoFile=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("GetKeyInfoFile",i,n,r,null)},et.prototype.GetCertificateByKeyInfo=function(t,e,n,r){var i,o=[];return"number"==typeof t&&"number"==typeof e||(r=n,n=e),"number"==typeof t&&"number"==typeof e?(o.push(t),o.push(e),o.push(null)):(o.push(null),o.push(null),o.push(new S(t))),i=this._funcMakeParams(o),this._funcCall("GetCertificateByKeyInfo",i,n,r,null)},et.prototype.GetCertificatesByKeyInfo=function(t,e,n,r,i){var o;return"EndUserPrivateKeyInfo"==t.className&&(t=t.GetPrivateKeyInfo()),null!=e&&null!=n?("EndUserArrayList"==e.className&&(e=e.m_array),"EndUserArrayList"==n.className&&(n=n.m_array)):(e=null,n=null),o=this._funcMakeParams([new S(t),e,n]),this._funcCall("GetCertificatesByKeyInfo",o,r,i,null)},et.prototype.ChangeSoftwarePrivateKeyPassword=function(t,e,n,r,i){var o;return o=this._funcMakeParams([new S(t),e,n]),this._funcCall("ChangeSoftwarePrivateKeyPassword",o,r,i,null)},et.prototype.EnumJKSPrivateKeys=function(t,e,n,r){var i;return i=this._funcMakeParams([new S(t),e]),this._funcCall("EnumJKSPrivateKeys",i,n,r,null)},et.prototype.EnumJKSPrivateKeysFile=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("EnumJKSPrivateKeysFile",i,n,r,null)},et.prototype.GetJKSPrivateKey=function(t,e,n,r){var i;return i=this._funcMakeParams([new S(t),e]),this._funcCall("GetJKSPrivateKey",i,n,r,null)},et.prototype.GetJKSPrivateKeyFile=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("GetJKSPrivateKeyFile",i,n,r,null)},et.prototype.CreatePrivateKeyInfo=function(){return new L},et.prototype.CreateEndUserInfo=function(){return new F},et.prototype._generatePrivateKey=function(t,e,n,r,i,o,s,a,u,c,l,f,p,_,h,E){if(!this.IsAsync(h,E))return this.GeneratePrivateKeyEx(t,e,n,r,!1,i,o,s,a,u,c,l,f,null,null,p,_,h,E).m_array;this.GeneratePrivateKeyEx(t,e,n,r,!1,i,o,s,a,u,c,l,f,null,null,p,_,(function(t){h(t.m_array)}),E)},et.prototype.GeneratePrivateKey=function(t,e,n,r,i,o,s,a,u,c,l,f,p,_,h,E){if("boolean"==typeof t)return this._generatePrivateKeyEx(t,e,n,r,i,o,s,a,u,c,l,f,p,_,h,E);if("boolean"==typeof n)return this._generatePrivateKey(!0,0,0,"",t,e,n,r,i,o,s,a,null,!1,u,c);if("string"==typeof n)return this._generatePrivateKey(!1,t,e,n,r,i,o,s,a,u,c,l,null,!1,f,p);if("number"==typeof n)return this._generatePrivateKey(!1,0,0,t,e,n,r,i,o,s,a,u,c,!0,l,f);var y=this.MakeError($.ERROR_BAD_PARAMETER,"");throw new tt(y.errorCode,y.message)},et.prototype._generatePrivateKeyEx=function(t,e,n,r,i,o,s,a,u,c,l,f,p,h,E,y,S,d,m){var R,A,P=this;return t?A=null:((A=new C).typeIndex=e,A.devIndex=n,A.password="string"!=typeof r?"":r),null==y&&(S=!1),R=this._funcMakeParams([t,A,i,o,s,a,u,c,l,f,p,h,E,null!=y,S]),this._funcCall("GeneratePrivateKeyEx",R,d,m,(function(t,e,n){var r=P.IsAsync(e,n);try{for(var i=t[0],o=new _,s=0;s<i.length;s++)o.add(i[s]);if(null!=y&&y.set(t[1]),!r)return o;e(o)}catch(t){var a=P.MakeError($.ERROR_LIBRARY_COMUNICATION_FAILED,"");if(r)return void n(a);throw new tt(a.errorCode,a.message)}}))},et.prototype.GeneratePrivateKeyEx=function(t,e,n,r,i,o,s,a,u,c,l,f,p,_,h,E,y,S,C){if("boolean"==typeof t)return"boolean"==typeof i?this._generatePrivateKeyEx(t,e,n,r,i,o,s,a,u,c,l,f,p,_,h,E,y,S,C):this._generatePrivateKeyEx(t,e,n,r,!1,i,o,s,a,u,c,l,f,null,null,p,_,h,E);if("boolean"==typeof n)return void 0!==c&&null==c||"string"==typeof c?this._generatePrivateKeyEx(!0,0,0,"",!1,t,e,n,r,i,o,s,a,u,c,null,!1,l,f):this._generatePrivateKeyEx(!0,0,0,"",!1,t,e,n,r,i,o,s,a,null,null,null,!1,u,c);if("number"==typeof t)return"boolean"==typeof r?this._generatePrivateKeyEx(!1,t,e,n,r,i,o,s,a,u,c,l,f,p,_,null,!1,h,E):this._generatePrivateKeyEx(!1,t,e,n,!1,r,i,o,s,a,u,c,l,null,null,null,!1,f,p);if("string"==typeof t)return void 0!==l&&null==l||"string"==typeof l?this._generatePrivateKeyEx(!1,0,0,t,!1,e,n,r,i,o,s,a,u,c,l,f,!0,p,_):this._generatePrivateKeyEx(!1,0,0,t,!1,e,n,r,i,o,s,a,u,null,null,c,!0,l,f);var d=this.MakeError($.ERROR_BAD_PARAMETER,"");throw new tt(d.errorCode,d.message)},et.prototype.GetCRInfo=function(t,e,n,r,i){var o;return o=this._funcMakeParams([new S(t),e,n]),this._funcCall("GetCRInfo",o,r,i,null)},et.prototype.IsHardwareKeyMedia=function(t,e,n,r,i){var o,s;return"number"==typeof t?((s=new C).typeIndex=t,s.devIndex=e,s.password=n):(s=null,r=t,i=e),o=this._funcMakeParams([s]),this._funcCall("IsHardwareKeyMedia",o,r,i,null)},et.prototype.IsPrivateKeyExists=function(t,e,n,r,i){var o,s;return"number"==typeof t?((s=new C).typeIndex=t,s.devIndex=e,s.password=n):(s=null,r=t,i=e),o=this._funcMakeParams([s]),this._funcCall("IsPrivateKeyExists",o,r,i,null)},et.prototype.ChangePrivateKeyPassword=function(t,e,n,r,i,o){var s,a;"number"==typeof t?((a=new C).typeIndex=t,a.devIndex=e,a.password=n):(a=null,r=null,i=t,o=e),s=this._funcMakeParams([a,r]),this._funcCall("ChangePrivateKeyPassword",s,i,o,null)},et.prototype.BackupPrivateKey=function(t,e,n,r,i,o,s,a){var u,c,l;"number"==typeof t?((c=new C).typeIndex=t,c.devIndex=e,c.password=n,(l=new C).typeIndex=r,l.devIndex=i,l.password=o):(c=null,l=null,s=t,a=e),u=this._funcMakeParams([c,l]),this._funcCall("BackupPrivateKey",u,s,a,null)},et.prototype.DestroyPrivateKey=function(t,e,n,r,i){var o,s;"number"==typeof t?((s=new C).typeIndex=t,s.devIndex=e,s.password=n):(s=null,r=t,i=e),o=this._funcMakeParams([s]),this._funcCall("DestroyPrivateKey",o,r,i,null)},et.prototype.SetKeyMediaPassword=function(t,e,n,r,i){var o,s;"number"==typeof t?((s=new C).typeIndex=t,s.devIndex=e,s.password=n):(s=null,r=t,i=e),o=this._funcMakeParams([s]),this._funcCall("SetKeyMediaPassword",o,r,i,null)},et.prototype.SetKeyMediaUserPassword=function(t,e,n,r,i,o){var s,a;"number"==typeof e?((a=new C).typeIndex=e,a.devIndex=n,a.password=r):(a=null,i=e,o=n),s=this._funcMakeParams([t,a]),this._funcCall("SetKeyMediaUserPassword",s,i,o,null)},et.prototype.ChangeOwnCertificatesStatus=function(t,e,n,r){var i;i=this._funcMakeParams([t,e]),this._funcCall("ChangeOwnCertificatesStatus",i,n,r,null)},et.prototype.CtxChangeOwnCertificatesStatus=function(t,e,n,r,i){var o;o=this._funcMakeParams([t,e,n]),this._funcCall("CtxChangeOwnCertificatesStatus",o,r,i,null)},et.prototype.MakeNewCertificate=function(t,e,n,r,i,o,s,a,u,c,l,f,p,_,h){var E;return null!=e&&(e=new S(e)),E=this._funcMakeParams([t,e,n,r,i,o,s,a,u,c,l,f,p]),this._funcCall("MakeNewCertificate",E,_,h,null)},et.prototype.MakeNewOwnCertificate=function(t,e,n,r,i,o,s,a,u,c){var l;return l=this._funcMakeParams([t,e,n,r,i,o,s,a]),this._funcCall("MakeNewOwnCertificate",l,u,c,null)},et.prototype.CtxMakeNewOwnCertificate=function(t,e,n,r,i,o,s,a,u,c,l){var f;return f=this._funcMakeParams([t,e,n,r,i,o,s,a,u]),this._funcCall("CtxMakeNewOwnCertificate",f,c,l,null)},et.prototype.CtxMakeDeviceCertificate=function(t,e,n,r,i,o,s,a,u,c){var l;return null!=n&&(n=new S(n)),null!=r&&(r=new S(r)),null!=i&&(i=new S(i)),null!=o&&(o=new S(o)),l=this._funcMakeParams([t,e,n,r,i,o,s,a]),this._funcCall("CtxMakeDeviceCertificate",l,u,c,null)},et.prototype.GetOwnEUserParams=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("GetOwnEUserParams",n,t,e,null)},et.prototype.ModifyOwnEUserParams=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("ModifyOwnEUserParams",i,n,r,null)},et.prototype.CtxGetOwnEUserParams=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("CtxGetOwnEUserParams",r,e,n,null)},et.prototype.CtxModifyOwnEUserParams=function(t,e,n,r,i){var o;return o=this._funcMakeParams([t,e,n]),this._funcCall("CtxModifyOwnEUserParams",o,r,i,null)},et.prototype.Hash=function(t,e,n){var r;if("string"!=typeof t||null!=(t=this._stringToBytes(t,n)))return r=this._funcMakeParams([new S(t)]),this._funcCall("Hash",r,e,n,null)},et.prototype.ContinueHash=function(t,e,n,r,i){var o;"number"==typeof e&&"number"==typeof n||(r=e,i=n),"string"==typeof t&&null==(t=this._stringToBytes(t,i))||("number"==typeof e&&"number"==typeof n&&(t=t.slice(e,e+n)),o=this._funcMakeParams([new S(t)]),this._funcCall("ContinueHash",o,r,i,null))},et.prototype.EndHash=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("EndHash",n,t,e,null)},et.prototype.HashWithParams=function(t,e,n,r){var i;if("string"!=typeof e||null!=(e=this._stringToBytes(e,r)))return i=this._funcMakeParams([new S(t),new S(e)]),this._funcCall("HashWithParams",i,n,r,null)},et.prototype.HashBeginWithParams=function(t,e,n){var r;r=this._funcMakeParams([new S(t)]),this._funcCall("HashBeginWithParams",r,e,n,null)},et.prototype.HashFile=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("HashFile",r,e,n,null)},et.prototype.HashFileWithParams=function(t,e,n,r){var i;return i=this._funcMakeParams([new S(t),e]),this._funcCall("HashFileWithParams",i,n,r,null)},et.prototype.CtxHash=function(t,e,n,r,i,o){var s=this,u=this.IsAsync(i,o),c=s.EU_FILE_PROCESS_CHUNK_SIZE;if("string"!=typeof r||null!=(r=this._stringToBytes(r,o)))if(u){var l={hashContext:null,hash:null},f=function(t){null==l.hashContext?o(t):s.CtxHashFree(l.hashContext,(function(){o(t)}),(function(){o(t)}))};a((function(r){s.CtxHashBegin(t,e,n,r,f)})).eu_wait((function(t,e){l.hashContext=e;var n=function(i){if(i>=r.length)s.CtxHashEnd(e,t,f);else{var o=r.length-i;o>c&&(o=c);var a=r.slice(i,i+o);s.CtxHashContinue(e,a,(function(){n(i+o)}),f)}};n(0)})).eu_wait((function(t,e){l.hash=e,s.CtxHashFree(l.hashContext,t,o)})).eu_wait((function(){i(l.hash)}))}else{var p=null;try{var _,h=0;for(p=s.CtxHashBegin(t,e,n);;){var E=r.length-h;E>c&&(E=c);var y=r.slice(h,h+E);if(s.CtxHashContinue(p,y),!((h+=E)<r.length))break}return _=s.CtxHashEnd(p),s.CtxHashFree(p),p=null,_}catch(t){throw null!=p&&s.CtxHashFree(p),t}}},et.prototype.CtxHashBegin=function(t,e,n,r,i){var o;return o=this._funcMakeParams([t,e,n?new S(n):null]),this._funcCall("CtxHashBegin",o,r,i,null)},et.prototype.CtxHashContinue=function(t,e,n,r){var i;i=this._funcMakeParams([t,new S(e)]),this._funcCall("CtxHashContinue",i,n,r,null)},et.prototype.CtxHashEnd=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("CtxHashEnd",r,e,n,null)},et.prototype.CtxHashFree=function(t,e,n){var r;r=this._funcMakeParams([t]),this._funcCall("CtxHashFree",r,e,n,null)},et.prototype.ShowSignInfo=function(t,e,n){var r;r=this._funcMakeParams([t]),this._funcCall("ShowSignInfo",r,e,n,null)},et.prototype.IsSigned=function(t,e,n){var r;return r=this._funcMakeParams([new S(t)]),this._funcCall("IsSigned",r,e,n,null)},et.prototype.IsSignedFile=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("IsSignedFile",r,e,n,null)},et.prototype.GetSignType=function(t,e,n,r){var i;if("string"==typeof e||null!=(e=this._base64Encode(e,r)))return i=this._funcMakeParams([t,e]),this._funcCall("GetSignType",i,n,r,null)},et.prototype.GetFileSignType=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("GetFileSignType",i,n,r,null)},et.prototype.GetSignsCount=function(t,e,n){var r;if("string"==typeof t||null!=(t=this._base64Encode(t,n)))return r=this._funcMakeParams([t]),this._funcCall("GetSignsCount",r,e,n,null)},et.prototype.GetSignerInfo=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("GetSignerInfo",i,n,r,null)},et.prototype.GetSignerCertificate=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("GetSignerCertificate",i,n,r,null)},et.prototype.GetFileSignsCount=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("GetFileSignsCount",r,e,n,null)},et.prototype.GetFileSignerInfo=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("GetFileSignerInfo",i,n,r,null)},et.prototype.GetFileSignerCertificate=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("GetFileSignerCertificate",i,n,r,null)},et.prototype.CtxGetSignerInfo=function(t,e,n,r,i){var o;if("string"==typeof n||null!=(n=this._base64Encode(n,i)))return o=this._funcMakeParams([t,e,n]),this._funcCall("CtxGetSignerInfo",o,r,i,null)},et.prototype.Sign=function(t,e,n){var r;if("string"!=typeof t||null!=(t=this._stringToBytes(t,n)))return r=this._funcMakeParams([new S(t)]),this._funcCall("Sign",r,e,n,null)},et.prototype.Verify=function(t,e,n,r,i){var o,s=[];if("boolean"!=typeof n&&(i=r,r=n),"string"!=typeof e||null!=(e=this._stringToBytes(e,i)))return s.push(t),s.push(new S(e)),"boolean"==typeof n?s.push(n):s.push(null),o=this._funcMakeParams(s),this._funcCall("Verify",o,r,i,null)},et.prototype.ContinueSign=function(t,e,n,r,i){var o;"number"==typeof e&&"number"==typeof n||(r=e,i=n),"string"==typeof t&&null==(t=this._stringToBytes(t,i))||("number"==typeof e&&"number"==typeof n&&(t=t.slice(e,e+n)),o=this._funcMakeParams([new S(t)]),this._funcCall("ContinueSign",o,r,i,null))},et.prototype.EndSign=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("EndSign",n,t,e,null)},et.prototype.BeginVerify=function(t,e,n){var r;r=this._funcMakeParams([t]),this._funcCall("BeginVerify",r,e,n,null)},et.prototype.ContinueVerify=function(t,e,n,r,i){var o;"number"==typeof e&&"number"==typeof n||(r=e,i=n),"string"==typeof t&&null==(t=this._stringToBytes(t,i))||("number"==typeof e&&"number"==typeof n&&(t=t.slice(e,e+n)),o=this._funcMakeParams([new S(t)]),this._funcCall("ContinueVerify",o,r,i,null))},et.prototype.EndVerify=function(t,e,n){var r,i=[];return"boolean"!=typeof t&&(n=e,e=t),"boolean"!=typeof t?i.push(t):i.push(null),r=this._funcMakeParams(i),this._funcCall("EndVerify",r,e,n,null)},et.prototype.SignHash=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("SignHash",r,e,n,null)},et.prototype.VerifyHash=function(t,e,n,r,i){var o,s=[];return"boolean"!=typeof n&&(i=r,r=n),s.push(t),s.push(e),"boolean"==typeof n?s.push(n):s.push(null),o=this._funcMakeParams(s),this._funcCall("VerifyHash",o,r,i,null)},et.prototype.SignInternal=function(t,e,n,r){var i;if("string"!=typeof e||null!=(e=this._stringToBytes(e,r)))return i=this._funcMakeParams([t,new S(e)]),this._funcCall("SignInternal",i,n,r,null)},et.prototype.VerifyInternal=function(t,e,n,r){var i,o=[];return"boolean"!=typeof e&&(r=n,n=e),o.push(t),"boolean"==typeof e?o.push(e):o.push(null),i=this._funcMakeParams(o),this._funcCall("VerifyInternal",i,n,r,null)},et.prototype.VerifyInternalString=function(t,e,n,r){var i=this;if("boolean"!=typeof e&&(r=n,n=e),!this.IsAsync(n,r)){var o=this.VerifyInternal(t,e);return this.BytesToString(o)}this.VerifyInternal(t,e,(function(t){i.BytesToString(t,n,r)}),r)},et.prototype.SignFile=function(t,e,n,r,i){var o;o=this._funcMakeParams([t,e,n]),this._funcCall("SignFile",o,r,i,null)},et.prototype.VerifyFile=function(t,e,n,r,i){var o,s=[];return"boolean"!=typeof n&&(i=r,r=n),s.push(t),s.push(e),"boolean"==typeof n?s.push(n):s.push(null),o=this._funcMakeParams(s),this._funcCall("VerifyFile",o,r,i,null)},et.prototype.VerifyFileWithExternalSign=function(t,e,n,r,i){return this.VerifyFile(e,t,n,r,i)},et.prototype.VerifyFileWithInternalSign=function(t,e,n,r,i){return this.VerifyFile(t,e,n,r,i)},et.prototype.IsAlreadySigned=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("IsAlreadySigned",r,e,n,null)},et.prototype.IsFileAlreadySigned=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("IsFileAlreadySigned",r,e,n,null)},et.prototype.AppendSign=function(t,e,n,r){var i;if(!("string"==typeof t&&null==(t=this._stringToBytes(t,r))||"string"!=typeof e&&null==(e=this._base64Encode(e,r))))return i=this._funcMakeParams([new S(t),e]),this._funcCall("AppendSign",i,n,r,null)},et.prototype.VerifySpecific=function(t,e,n,r,i,o){var s,a=[];if("boolean"!=typeof r&&(o=i,i=r),"string"!=typeof e||null!=(e=this._stringToBytes(e,o)))return a.push(t),a.push(new S(e)),a.push(n),"boolean"==typeof r?a.push(r):a.push(null),s=this._funcMakeParams(a),this._funcCall("VerifySpecific",s,i,o,null)},et.prototype.AppendSignBegin=function(t,e,n){var r;"string"!=typeof t&&null==(t=this._base64Encode(t,n))||(r=this._funcMakeParams([t]),this._funcCall("AppendSignBegin",r,e,n,null))},et.prototype.VerifyDataSpecificBegin=function(t,e,n,r){var i;i=this._funcMakeParams([t,e]),this._funcCall("VerifyDataSpecificBegin",i,n,r,null)},et.prototype.AppendSignHash=function(t,e,n,r){var i;if(!("string"!=typeof t&&null==(t=this._base64Encode(t,r))||"string"!=typeof e&&null==(e=this._base64Encode(e,r))))return i=this._funcMakeParams([t,e]),this._funcCall("AppendSignHash",i,n,r,null)},et.prototype.VerifyHashSpecific=function(t,e,n,r,i,o){var s,a=[];return"boolean"!=typeof r&&(o=i,i=r),a.push(t),a.push(e),a.push(n),"boolean"==typeof r?a.push(r):a.push(null),s=this._funcMakeParams(a),this._funcCall("VerifyHashSpecific",s,i,o,null)},et.prototype.AppendSignInternal=function(t,e,n,r){var i;if("string"==typeof e||null!=(e=this._base64Encode(e,r)))return i=this._funcMakeParams([t,e]),this._funcCall("AppendSignInternal",i,n,r,null)},et.prototype.VerifySpecificInternal=function(t,e,n,r,i){var o,s=[];return"boolean"!=typeof n&&(i=r,r=n),s.push(t),s.push(e),"boolean"==typeof n?s.push(n):s.push(null),o=this._funcMakeParams(s),this._funcCall("VerifySpecificInternal",o,r,i,null)},et.prototype.VerifySpecificInternalString=function(t,e,n,r,i){var o=this;if("boolean"!=typeof n&&(i=r,r=n),!this.IsAsync(r,i)){var s=this.VerifySpecificInternal(t,e,n);return this.BytesToString(s)}this.VerifySpecificInternal(t,e,n,(function(t){o.BytesToString(t,r,i)}),i)},et.prototype.AppendSignFile=function(t,e,n,r,i,o){var s;return s=this._funcMakeParams([t,e,n,r]),this._funcCall("AppendSignFile",s,i,o,null)},et.prototype.VerifyFileSpecific=function(t,e,n,r,i,o){var s,a=[];return"boolean"!=typeof r&&(o=i,i=r),a.push(t),a.push(e),a.push(n),"boolean"==typeof r?a.push(r):a.push(null),s=this._funcMakeParams(a),this._funcCall("VerifyFileSpecific",s,i,o,null)},et.prototype.VerifyFileWithExternalSignSpecific=function(t,e,n,r,i,o){return this.VerifyFileSpecific(t,e,n,r,i,o)},et.prototype.VerifyFileWithInternalSignSpecific=function(t,e,n,r,i,o){return this.VerifyFileSpecific(t,e,n,r,i,o)},et.prototype.CreateEmptySign=function(t,e,n){var r,i=[];if(2==arguments.length&&(n=e,e=t),"string"!=typeof t||null!=(t=this._stringToBytes(t,n)))return 1==arguments.length||3==arguments.length?i.push(new S(t)):i.push(null),r=this._funcMakeParams(i),this._funcCall("CreateEmptySign",r,e,n,null)},et.prototype.CreateSigner=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("CreateSigner",r,e,n,null)},et.prototype.AppendSigner=function(t,e,n,r,i){var o,s=[];return s.push(t),null!=e?s.push(new S(e)):s.push(null),s.push(n),o=this._funcMakeParams(s),this._funcCall("AppendSigner",o,r,i,null)},et.prototype.AppendValidationDataToSignerEx=function(t,e,n,r,i){var o,s=[];if("string"==typeof t||null!=(t=this._base64Encode(t,i)))return s.push(t),null!=e?s.push(new S(e)):s.push(null),s.push(n),o=this._funcMakeParams(s),this._funcCall("AppendValidationDataToSignerEx",o,r,i,null)},et.prototype.IsDataInSignedDataAvailable=function(t,e,n){var r;if("string"==typeof t||null!=(t=this._base64Encode(t,n)))return r=this._funcMakeParams([t]),this._funcCall("IsDataInSignedDataAvailable",r,e,n,null)},et.prototype.IsDataInSignedFileAvailable=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("IsDataInSignedFileAvailable",r,e,n,null)},et.prototype.GetDataFromSignedData=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("GetDataFromSignedData",r,e,n,null)},et.prototype.GetDataFromSignedFile=function(t,e,n,r){var i;i=this._funcMakeParams([t,e]),this._funcCall("GetDataFromSignedFile",i,n,r,null)},et.prototype.GetCertificateFromSignedData=function(t,e,n,r){var i;if("string"==typeof e||null!=(e=this._base64Encode(e,r)))return i=this._funcMakeParams([t,e]),this._funcCall("GetCertificateFromSignedData",i,n,r,null)},et.prototype.GetCertificateFromSignedFile=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("GetCertificateFromSignedFile",i,n,r,null)},et.prototype.GetSignTimeInfo=function(t,e,n,r){var i;if("string"==typeof e||null!=(e=this._base64Encode(e,r)))return i=this._funcMakeParams([t,e]),this._funcCall("GetSignTimeInfo",i,n,r,null)},et.prototype.GetFileSignTimeInfo=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("GetFileSignTimeInfo",i,n,r,null)},et.prototype.VerifyHashOnTime=function(t,e,n,r,i,o,s){return this.VerifyHashOnTimeEx(t,e,n,r,null!=r,!1,i,o,s)},et.prototype.VerifyHashOnTimeEx=function(t,e,n,r,i,o,s,a,u){var c,l=[];if("boolean"!=typeof s&&(u=a,a=s),!("string"!=typeof t&&null==(t=this._base64Encode(t,u))||"string"!=typeof n&&null==(n=this._base64Encode(n,u))))return l=[t,e,n,r,i,o],"boolean"==typeof s?l.push(s):l.push(null),c=this._funcMakeParams(l),this._funcCall("VerifyHashOnTimeEx",c,a,u,null)},et.prototype.VerifyDataOnTime=function(t,e,n,r,i,o,s){return this.VerifyDataOnTimeEx(t,e,n,r,null!=r,!1,i,o,s)},et.prototype.VerifyDataOnTimeEx=function(t,e,n,r,i,o,s,a,u){var c,l=[];if("boolean"!=typeof s&&(u=a,a=s),!("string"==typeof t&&null==(t=this._stringToBytes(t,u))||"string"!=typeof n&&null==(n=this._base64Encode(n,u))))return l=[new S(t),e,n,r,i,o],"boolean"==typeof s?l.push(s):l.push(null),c=this._funcMakeParams(l),this._funcCall("VerifyDataOnTimeEx",c,a,u,null)},et.prototype.VerifyDataInternalOnTime=function(t,e,n,r,i,o){return this.VerifyDataInternalOnTimeEx(t,e,n,null!=n,!1,r,i,o)},et.prototype.VerifyDataInternalOnTimeEx=function(t,e,n,r,i,o,s,a){var u,c=[];if("boolean"!=typeof o&&(a=s,s=o),"string"==typeof t||null!=(t=this._base64Encode(t,a)))return c=[t,e,n,r,i],"boolean"==typeof o?c.push(o):c.push(null),u=this._funcMakeParams(c),this._funcCall("VerifyDataInternalOnTimeEx",u,s,a,null)},et.prototype.VerifyDataInternalOnTimeString=function(t,e,n,r,i,o){return this.VerifyDataInternalOnTimeStringEx(t,e,n,null!=n,!1,r,i,o)},et.prototype.VerifyDataInternalOnTimeStringEx=function(t,e,n,r,i,o,s,a){var u=this;if("boolean"!=typeof o&&(a=s,s=o),!this.IsAsync(s,a)){var c=this.VerifyDataInternalOnTimeEx(t,e,n,r,i,o);return this.BytesToString(c)}this.VerifyDataInternalOnTimeEx(t,e,n,r,i,o,(function(t){u.BytesToString(t,s,a)}),a)},et.prototype.VerifyDataOnTimeBegin=function(t,e,n,r,i){this.VerifyDataOnTimeBeginEx(t,e,n,null!=n,!1,r,i)},et.prototype.VerifyDataOnTimeBeginEx=function(t,e,n,r,i,o,s){var a;a=this._funcMakeParams([t,e,n,r,i]),this._funcCall("VerifyDataOnTimeBeginEx",a,o,s,null)},et.prototype.VerifyFileOnTime=function(t,e,n,r,i,o,s,a,u){var c,l=[];return"boolean"!=typeof s&&(u=a,a=s),l=[t,e,n,r,i,o],"boolean"==typeof s?l.push(s):l.push(null),c=this._funcMakeParams(l),this._funcCall("VerifyFileOnTimeEx",c,a,u,null)},et.prototype.VerifyFileWithExternalSignOnTime=function(t,e,n,r,i,o,s){return this.VerifyFileOnTime(t,n,e,r,null!=r,!1,i,o,s)},et.prototype.VerifyFileWithExternalSignOnTimeEx=function(t,e,n,r,i,o,s,a,u){return this.VerifyFileOnTime(t,n,e,r,i,o,s,a,u)},et.prototype.VerifyFileWithInternalSignOnTime=function(t,e,n,r,i,o,s){return this.VerifyFileOnTime(t,e,n,r,null!=r,!1,i,o,s)},et.prototype.VerifyFileWithInternalSignOnTimeEx=function(t,e,n,r,i,o,s,a,u){return this.VerifyFileOnTime(t,n,e,r,i,o,s,a,u)},et.prototype.ContinueSignCtx=function(t,e,n,r){var i;if(null==t&&(t=new j),"string"!=typeof e||null!=(e=this._stringToBytes(e,r)))return i=this._funcMakeParams([t,new S(e)]),this._funcCall("ContinueSignCtx",i,n,r,null)},et.prototype.ContinueSignCtxWithOffset=function(t,e,n,r,i,o){return e=e.slice(n,n+r),this.ContinueSignCtx(t,e,i,o)},et.prototype.EndSignCtx=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("EndSignCtx",i,n,r,null)},et.prototype.BeginVerifyCtx=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("BeginVerifyCtx",r,e,n,null)},et.prototype.ContinueVerifyCtx=function(t,e,n,r,i,o){var s;"number"==typeof n&&"number"==typeof r||(i=n,o=r),"string"==typeof e&&null==(e=this._stringToBytes(e,o))||("number"==typeof n&&"number"==typeof r&&(e=e.slice(n,n+r)),s=this._funcMakeParams([t,new S(e)]),this._funcCall("ContinueVerifyCtx",s,i,o,null))},et.prototype.EndVerifyCtx=function(t,e,n,r){var i,o=[];return"boolean"!=typeof e&&(r=n=e),o.push(t),"boolean"==typeof e?o.push(e):o.push(null),i=this._funcMakeParams(o),this._funcCall("EndVerifyCtx",i,n,r,null)},et.prototype.ResetOperationCtx=function(t,e,n){var r;r=this._funcMakeParams([t]),this._funcCall("ResetOperationCtx",r,e,n,null)},et.prototype.SignHashRSA=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("SignHashRSA",r,e,n,null)},et.prototype.SignRSA=function(t,e,n,r,i){var o;if("string"!=typeof t||null!=(t=this._stringToBytes(t,i)))return o=this._funcMakeParams([new S(t),e,n]),this._funcCall("SignRSA",o,r,i,null)},et.prototype.ContinueRSASign=function(t,e,n){var r;"string"==typeof t&&null==(t=this._stringToBytes(t,n))||(r=this._funcMakeParams([new S(t)]),this._funcCall("ContinueRSASign",r,e,n,null))},et.prototype.ContinueRSASignWithOffset=function(t,e,n,r,i){return t=t.slice(e,e+n),this.ContinueRSASign(t,r,i)},et.prototype.EndRSASign=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("EndRSASign",r,e,n,null)},et.prototype.SignRSAFile=function(t,e,n,r,i){var o;return o=this._funcMakeParams([t,e,n]),this._funcCall("SignRSAFile",o,r,i,null)},et.prototype.ContinueRSASignCtx=function(t,e,n,r){var i;if(null==t&&(t=new j),"string"!=typeof e||null!=(e=this._stringToBytes(e,r)))return i=this._funcMakeParams([t,new S(e)]),this._funcCall("ContinueRSASignCtx",i,n,r,null)},et.prototype.ContinueRSASignCtxWithOffset=function(t,e,n,r,i,o){return e=e.slice(n,n+r),this.ContinueRSASignCtx(e,i,o)},et.prototype.EndRSASignCtx=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("EndRSASignCtx",i,n,r,null)},et.prototype.SignECDSA=function(t,e,n,r,i){var o;if("string"!=typeof t||null!=(t=this._stringToBytes(t,i)))return o=this._funcMakeParams([new S(t),e,n]),this._funcCall("SignECDSA",o,r,i,null)},et.prototype.RawSign=function(t,e,n){var r;if("string"!=typeof t||null!=(t=this._stringToBytes(t,n)))return r=this._funcMakeParams([new S(t)]),this._funcCall("RawSign",r,e,n,null)},et.prototype.RawVerify=function(t,e,n,r,i){var o,s=[];if("boolean"!=typeof n&&(i=r,r=n),"string"!=typeof e||null!=(e=this._stringToBytes(e,i)))return s.push(t),s.push(new S(e)),"boolean"==typeof n?s.push(n):s.push(null),o=this._funcMakeParams(s),this._funcCall("RawVerify",o,r,i,null)},et.prototype.RawSignHash=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("RawSignHash",r,e,n,null)},et.prototype.RawVerifyHash=function(t,e,n,r,i){var o,s=[];return"boolean"!=typeof n&&(i=r,r=n),s.push(t),s.push(e),"boolean"==typeof n?s.push(n):s.push(null),o=this._funcMakeParams(s),this._funcCall("RawVerifyHash",o,r,i,null)},et.prototype.RawSignFile=function(t,e,n,r){var i;i=this._funcMakeParams([t,e]),this._funcCall("RawSignFile",i,n,r,null)},et.prototype.RawVerifyFile=function(t,e,n,r,i){var o,s=[];return"boolean"!=typeof n&&(i=r,r=n),s.push(t),s.push(e),"boolean"==typeof n?s.push(n):s.push(null),o=this._funcMakeParams(s),this._funcCall("RawVerifyFile",o,r,i,null)},et.prototype.CtxSignHash=function(t,e,n,r,i,o){var s;if("string"==typeof n||null!=(n=this._base64Encode(n,o)))return s=this._funcMakeParams([t,e,n,r]),this._funcCall("CtxSignHash",s,i,o,null)},et.prototype.CtxSign=function(t,e,n,r,i,o,s){var a;if("string"!=typeof n||null!=(n=this._stringToBytes(n,s)))return a=this._funcMakeParams([t,e,new S(n),r,i]),this._funcCall("CtxSign",a,o,s,null)},et.prototype.CtxSignFile=function(t,e,n,r,i,o,s,a){var u;u=this._funcMakeParams([t,e,n,r,i,o]),this._funcCall("CtxSignFile",u,s,a,null)},et.prototype.CtxAppendSignHash=function(t,e,n,r,i,o,s){var a;if(!("string"!=typeof n&&null==(n=this._base64Encode(n,s))||"string"!=typeof r&&null==(r=this._base64Encode(r,s))))return a=this._funcMakeParams([t,e,n,r,i]),this._funcCall("CtxAppendSignHash",a,o,s,null)},et.prototype.CtxAppendSign=function(t,e,n,r,i,o,s){var a;if(!(null!=n&&"string"==typeof n&&null==(n=this._stringToBytes(n,s))||"string"!=typeof r&&null==(r=this._base64Encode(r,s))))return a=this._funcMakeParams([t,e,n?new S(n):null,r,i]),this._funcCall("CtxAppendSign",a,o,s,null)},et.prototype.CtxAppendSignFile=function(t,e,n,r,i,o,s,a){var u;u=this._funcMakeParams([t,e,n,r,i,o]),this._funcCall("CtxAppendSignFile",u,s,a,null)},et.prototype.ShowSenderInfo=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("ShowSenderInfo",r,e,n,null)},et.prototype.IsEnveloped=function(t,e,n){var r;return r=this._funcMakeParams([new S(t)]),this._funcCall("IsEnveloped",r,e,n,null)},et.prototype.IsEnvelopedFile=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("IsEnvelopedFile",r,e,n,null)},et.prototype.Envelop=function(t,e,n,r,i,o){var s;if("string"!=typeof r||null!=(r=this._stringToBytes(r,o)))return s=this._funcMakeParams([t,e,n,new S(r)]),this._funcCall("Envelop",s,i,o,null)},et.prototype.Develop=function(t,e,n,r){var i,o=[];if("boolean"!=typeof e&&(r=n,n=e),"string"==typeof t||null!=(t=this._base64Encode(t,r)))return o.push(t),"boolean"==typeof e?o.push(e):o.push(null),i=this._funcMakeParams(o),this._funcCall("Develop",i,n,r,null)},et.prototype.EnvelopFile=function(t,e,n,r,i,o,s){var a;a=this._funcMakeParams([t,e,n,r,i]),this._funcCall("EnvelopFile",a,o,s,null)},et.prototype.DevelopFile=function(t,e,n,r,i){var o,s=[];return"boolean"!=typeof n&&(i=r,r=n),s.push(t),s.push(e),"boolean"==typeof n?s.push(n):s.push(null),o=this._funcMakeParams(s),this._funcCall("DevelopFile",o,r,i,null)},et.prototype.EnvelopEx=function(t,e,n,r,i,o){var s;if("EndUserArrayList"==t.className&&(t=t.m_array),"EndUserArrayList"==e.className&&(e=e.m_array),"string"!=typeof r||null!=(r=this._stringToBytes(r,o)))return s=this._funcMakeParams([t,e,n,new S(r)]),this._funcCall("EnvelopEx",s,i,o,null)},et.prototype.DevelopEx=function(t,e,n,r,i){var o,s=[];if("boolean"!=typeof n&&(i=r,r=n),"string"==typeof t||null!=(t=this._base64Encode(t,i)))return s.push(t),s.push(e?new S(e):null),"boolean"==typeof n?s.push(n):s.push(null),o=this._funcMakeParams(s),this._funcCall("DevelopEx",o,r,i,null)},et.prototype.EnvelopFileEx=function(t,e,n,r,i,o,s){var a;"EndUserArrayList"==t.className&&(t=t.m_array),"EndUserArrayList"==e.className&&(e=e.m_array),a=this._funcMakeParams([t,e,n,r,i]),this._funcCall("EnvelopFileEx",a,o,s,null)},et.prototype.EnvelopToRecipients=function(t,e,n,r,i){var o;"EndUserArrayList"==t.className&&(t=t.m_array);for(var s=[],a=0;a<t.length;a++)s.push(new S(t[a]));if("string"!=typeof n||null!=(n=this._stringToBytes(n,i)))return o=this._funcMakeParams([s,e,new S(n)]),this._funcCall("EnvelopToRecipients",o,r,i,null)},et.prototype.EnvelopFileToRecipients=function(t,e,n,r,i,o){var s;"EndUserArrayList"==t.className&&(t=t.m_array);for(var a=[],u=0;u<t.length;u++)a.push(new S(t[u]));s=this._funcMakeParams([a,e,n,r]),this._funcCall("EnvelopFileToRecipients",s,i,o,null)},et.prototype.EnvelopToRecipientsEx=function(t,e,n,r,i,o){var s;"EndUserArrayList"==t.className&&(t=t.m_array);for(var a=[],u=0;u<t.length;u++)a.push(new S(t[u]));if("string"!=typeof r||null!=(r=this._stringToBytes(r,o)))return s=this._funcMakeParams([a,e,n,new S(r)]),this._funcCall("EnvelopToRecipientsEx",s,i,o,null)},et.prototype.EnvelopFileToRecipientsEx=function(t,e,n,r,i,o,s){var a;"EndUserArrayList"==t.className&&(t=t.m_array);for(var u=[],c=0;c<t.length;c++)u.push(new S(t[c]));a=this._funcMakeParams([u,e,n,r,i]),this._funcCall("EnvelopFileToRecipientsEx",a,o,s,null)},et.prototype.EnvelopToRecipientsWithOCode=function(t,e,n,r,i,o){var s;if("string"!=typeof r||null!=(r=this._stringToBytes(r,o)))return s=this._funcMakeParams([t,e,n,new S(r)]),this._funcCall("EnvelopToRecipientsWithOCode",s,i,o,null)},et.prototype.EnvelopExWithDynamicKey=function(t,e,n,r,i,o,s){var a;if("EndUserArrayList"==t.className&&(t=t.m_array),"EndUserArrayList"==e.className&&(e=e.m_array),"string"!=typeof i||null!=(i=this._stringToBytes(i,s)))return a=this._funcMakeParams([t,e,n,r,new S(i)]),this._funcCall("EnvelopExWithDynamicKey",a,o,s,null)},et.prototype.EnvelopFileExWithDynamicKey=function(t,e,n,r,i,o,s,a){var u;"EndUserArrayList"==t.className&&(t=t.m_array),"EndUserArrayList"==e.className&&(e=e.m_array),u=this._funcMakeParams([t,e,n,r,i,o]),this._funcCall("EnvelopFileExWithDynamicKey",u,s,a,null)},et.prototype.EnvelopToRecipientsWithDynamicKey=function(t,e,n,r,i,o){var s;"EndUserArrayList"==t.className&&(t=t.m_array);for(var a=[],u=0;u<t.length;u++)a.push(new S(t[u]));if("string"!=typeof r||null!=(r=this._stringToBytes(r,o)))return s=this._funcMakeParams([a,e,n,new S(r)]),this._funcCall("EnvelopToRecipientsWithDynamicKey",s,i,o,null)},et.prototype.EnvelopFileToRecipientsWithDynamicKey=function(t,e,n,r,i,o,s){var a;"EndUserArrayList"==t.className&&(t=t.m_array);for(var u=[],c=0;c<t.length;c++)u.push(new S(t[c]));a=this._funcMakeParams([u,e,n,r,i]),this._funcCall("EnvelopFileToRecipientsWithDynamicKey",a,o,s,null)},et.prototype.EnvelopToRecipientsWithSettings=function(t,e,n,r,i,o,s,a,u){var c;if("string"!=typeof n||null!=(n=this._stringToBytes(n,u))){"EndUserArrayList"==t.className&&(t=t.m_array);for(var l=[],f=0;f<t.length;f++)l.push(new S(t[f]));return c=this._funcMakeParams([l,e,new S(n),r,i,o,s]),this._funcCall("EnvelopToRecipientsWithSettings",c,a,u,null)}},et.prototype.RawEnvelop=function(t,e,n,r){var i;if("string"!=typeof e||null!=(e=this._stringToBytes(e,r)))return i=this._funcMakeParams([new S(t),new S(e)]),this._funcCall("RawEnvelop",i,n,r,null)},et.prototype.RawDevelop=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("RawDevelop",i,n,r,null)},et.prototype.EnvelopRSA=function(t,e,n,r,i,o,s){return this.EnvelopRSAEx(t,[e],[n],r,i,o,s)},et.prototype.EnvelopFileRSA=function(t,e,n,r,i,o,s,a){this.EnvelopFileRSAEx(t,[e],[n],r,i,o,s,a)},et.prototype.EnvelopRSAEx=function(t,e,n,r,i,o,s){var a;if("EndUserArrayList"==e.className&&(e=e.m_array),"EndUserArrayList"==n.className&&(n=n.m_array),"string"!=typeof i||null!=(i=this._stringToBytes(i,s)))return a=this._funcMakeParams([t,e,n,r,new S(i)]),this._funcCall("EnvelopRSAEx",a,o,s,null)},et.prototype.EnvelopFileRSAEx=function(t,e,n,r,i,o,s,a){var u;"EndUserArrayList"==e.className&&(e=e.m_array),"EndUserArrayList"==n.className&&(n=n.m_array),u=this._funcMakeParams([t,e,n,r,i,o]),this._funcCall("EnvelopFileRSAEx",u,s,a,null)},et.prototype.EnvelopToRecipientsRSA=function(t,e,n,r,i,o){var s;"EndUserArrayList"==e.className&&(e=e.m_array);for(var a=[],u=0;u<e.length;u++)a.push(new S(e[u]));if("string"!=typeof r||null!=(r=this._stringToBytes(r,o)))return s=this._funcMakeParams([t,a,n,new S(r)]),this._funcCall("EnvelopToRecipientsRSA",s,i,o,null)},et.prototype.EnvelopFileToRecipientsRSA=function(t,e,n,r,i,o,s){var a;"EndUserArrayList"==e.className&&(e=e.m_array);for(var u=[],c=0;c<e.length;c++)u.push(new S(e[c]));a=this._funcMakeParams([t,u,n,r,i]),this._funcCall("EnvelopFileToRecipientsRSA",a,o,s,null)},et.prototype.CtxEnvelop=function(t,e,n,r,i,o,s,a){var u;if("string"!=typeof o||null!=(o=this._stringToBytes(o,a))){"EndUserArrayList"==e.className&&(e=e.m_array);for(var c=[],l=0;l<e.length;l++)c.push(new S(e[l]));return u=this._funcMakeParams([t,c,n,r,i,new S(o)]),this._funcCall("CtxEnvelop",u,s,a,null)}},et.prototype.CtxEnvelopFile=function(t,e,n,r,i,o,s,a,u){var c;"EndUserArrayList"==e.className&&(e=e.m_array);for(var l=[],f=0;f<e.length;f++)l.push(new S(e[f]));c=this._funcMakeParams([t,l,n,r,i,o,s]),this._funcCall("CtxEnvelopFile",c,a,u,null)},et.prototype.CtxEnvelopWithDynamicKey=function(t,e,n,r,i,o,s,a){var u;if("string"!=typeof o||null!=(o=this._stringToBytes(o,a))){"EndUserArrayList"==e.className&&(e=e.m_array);for(var c=[],l=0;l<e.length;l++)c.push(new S(e[l]));return u=this._funcMakeParams([t,c,n,r,i,new S(o)]),this._funcCall("CtxEnvelopWithDynamicKey",u,s,a,null)}},et.prototype.CtxEnvelopFileWithDynamicKey=function(t,e,n,r,i,o,s,a,u){var c;"EndUserArrayList"==e.className&&(e=e.m_array);for(var l=[],f=0;f<e.length;f++)l.push(new S(e[f]));c=this._funcMakeParams([t,l,n,r,i,o,s]),this._funcCall("CtxEnvelopFileWithDynamicKey",c,a,u,null)},et.prototype.CtxDevelop=function(t,e,n,r,i,o){var s,a=[];if("boolean"!=typeof r&&(o=i,i=r),"string"==typeof e||null!=(e=this._base64Encode(e,o)))return a.push(t),a.push(e),a.push(n?new S(n):null),"boolean"==typeof r?a.push(r):a.push(null),s=this._funcMakeParams(a),this._funcCall("CtxDevelop",s,i,o,null)},et.prototype.CtxDevelopFile=function(t,e,n,r,i,o,s){var a,u=[];return"boolean"!=typeof i&&(s=o,o=i),u.push(t),u.push(e),u.push(n?new S(n):null),u.push(r),"boolean"==typeof i?u.push(i):u.push(null),a=this._funcMakeParams(u),this._funcCall("CtxDevelopFile",a,o,s,null)},et.prototype.CtxCreateAuthData=function(t,e,n,r,i){var o;if("string"!=typeof n||null!=(n=this._stringToBytes(n,i)))return o=this._funcMakeParams([t,new S(e),new S(n)]),this._funcCall("CtxCreateAuthData",o,r,i,null)},et.prototype.ProtectDataByPassword=function(t,e,n,r){var i;if("string"!=typeof t||null!=(t=this._stringToBytes(t,r)))return i=this._funcMakeParams([new S(t),e]),this._funcCall("ProtectDataByPassword",i,n,r,null)},et.prototype.UnprotectDataByPassword=function(t,e,n,r){var i;if("string"==typeof t||null!=(t=this._base64Encode(t,r)))return i=this._funcMakeParams([t,e]),this._funcCall("UnprotectDataByPassword",i,n,r,null)},et.prototype.SessionIsInitialized=function(t,e,n){var r;return t.SetData(null),r=this._funcMakeParams([t]),this._funcCall("SessionIsInitialized",r,e,n,null)},et.prototype.SessionClose=function(t,e,n){var r;t.SetData(null),r=this._funcMakeParams([t]),this._funcCall("SessionClose",r,e,n,null)},et.prototype.ClientSessionCreateStep1=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("ClientSessionCreateStep1",r,e,n,null)},et.prototype.ServerSessionCreateStep1=function(t,e,n,r){var i;return i=this._funcMakeParams([t,new S(e)]),this._funcCall("ServerSessionCreateStep1",i,n,r,null)},et.prototype.ClientSessionCreateStep2=function(t,e,n,r){var i,o=this;t.SetData(null),i=this._funcMakeParams([t,new S(e)]),this._funcCall("ClientSessionCreateStep2",i,n,r,(function(e,n,r){t.SetData(e.GetData()),o.IsAsync(n,r)&&n()}))},et.prototype.ServerSessionCreateStep2=function(t,e,n,r){var i;t.SetData(null),i=this._funcMakeParams([t,new S(e)]),this._funcCall("ServerSessionCreateStep2",i,n,r,null)},et.prototype.SessionSave=function(t,e,n){var r;return t.SetData(null),r=this._funcMakeParams([t]),this._funcCall("SessionSave",r,e,n,null)},et.prototype.SessionLoad=function(t,e,n){var r;return r=this._funcMakeParams([new S(t)]),this._funcCall("SessionLoad",r,e,n,null)},et.prototype.SessionCheckCertificates=function(t,e,n){var r;return t.SetData(null),r=this._funcMakeParams([t]),this._funcCall("SessionCheckCertificates",r,e,n,null)},et.prototype.SessionEncrypt=function(t,e,n,r){var i,o=!1,s=this;if("string"!=typeof e||(o=!0,null!=(e=this._stringToBytes(e,r))))return t.SetData(null),i=this._funcMakeParams([t,new S(e)]),this._funcCall("SessionEncrypt",i,n,r,o?function(t,e,n){return s.BASE64Encode(t,e,n)}:null)},et.prototype.SessionDecrypt=function(t,e,n,r){var i;if("string"!=typeof e||null!=(e=this._base64Decode(e,r)))return t.SetData(null),i=this._funcMakeParams([t,new S(e)]),this._funcCall("SessionDecrypt",i,n,r,null)},et.prototype.SessionEncryptContinue=function(t,e,n,r){var i,o=this,s=!1;if("string"!=typeof e||(s=!0,null!=(e=this._stringToBytes(e,r))))return t.SetData(null),i=this._funcMakeParams([t,new S(e)]),this._funcCall("SessionEncryptContinue",i,n,r,(function(t,n,r){if(s)return o.BASE64Encode(t,n,r);var i=o.IsAsync(n,r);if(!o._copyArrayData(e,t)){var a=o.MakeError($.ERROR_BAD_PARAMETER,"");if(i)return void r(a);throw new tt(a.errorCode,a.message)}if(!i)return e;n(e)}))},et.prototype.SessionDecryptContinue=function(t,e,n,r){var i,o=this;if("string"!=typeof e||null!=(e=this._base64Decode(e,r)))return t.SetData(null),i=this._funcMakeParams([t,new S(e)]),this._funcCall("SessionDecryptContinue",i,n,r,(function(t,n,r){var i=o.IsAsync(n,r);if(!o._copyArrayData(e,t)){var s=o.MakeError($.ERROR_BAD_PARAMETER,"");if(i)return void r(s);throw new tt(s.errorCode,s.message)}if(!i)return e;n(e)}))},et.prototype.SessionGetPeerCertificateInfo=function(t,e,n){var r;return t.SetData(null),r=this._funcMakeParams([t]),this._funcCall("SessionGetPeerCertificateInfo",r,e,n,null)},et.prototype.ClientDynamicKeySessionCreate=function(t,e,n,r,i){var o,s=[];return"string"==typeof e&&"string"==typeof n||(i=r,r=n),s.push(t),"string"==typeof e&&"string"==typeof n?(s.push(e),s.push(n),s.push(null)):(s.push(null),s.push(null),s.push(new S(e))),o=this._funcMakeParams(s),this._funcCall("ClientDynamicKeySessionCreate",o,r,i,null)},et.prototype.ServerDynamicKeySessionCreate=function(t,e,n,r){var i;return i=this._funcMakeParams([t,new S(e)]),this._funcCall("ServerDynamicKeySessionCreate",i,n,r,null)},et.prototype.ClientDynamicKeySessionLoad=function(t,e,n){var r;return r=this._funcMakeParams([new S(t)]),this._funcCall("ClientDynamicKeySessionLoad",r,e,n,null)},et.prototype.SCClientIsRunning=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("SCClientIsRunning",n,t,e,null)},et.prototype.SCClientStart=function(t,e){var n;n=this._funcMakeParams(null),this._funcCall("SCClientStart",n,t,e,null)},et.prototype.SCClientStop=function(t,e){var n;n=this._funcMakeParams(null),this._funcCall("SCClientStop",n,t,e,null)},et.prototype.SCClientAddGate=function(t,e,n,r,i,o,s,a){var u;"string"!=typeof i&&(s=i,a=o,i=null,o=null),u=this._funcMakeParams([t,e,n,r,i,o]),this._funcCall("SCClientAddGate",u,s,a,null)},et.prototype.SCClientRemoveGate=function(t,e,n){var r;r=this._funcMakeParams([t]),this._funcCall("SCClientRemoveGate",r,e,n,null)},et.prototype.SCClientGetStatistic=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("SCClientGetStatistic",n,t,e,null)},et.prototype.AppendTransportHeader=function(t,e,n,r,i,o,s){var a;return a=this._funcMakeParams([t,e,n,new S(r),new S(i)]),this._funcCall("AppendTransportHeader",a,o,s,null)},et.prototype.ParseTransportHeader=function(t,e,n){var r;return r=this._funcMakeParams([new S(t)]),this._funcCall("ParseTransportHeader",r,e,n,null)},et.prototype.AppendCryptoHeader=function(t,e,n,r,i){var o;return o=this._funcMakeParams([t,e,new S(n)]),this._funcCall("AppendCryptoHeader",o,r,i,null)},et.prototype.ParseCryptoHeader=function(t,e,n){var r;return r=this._funcMakeParams([new S(t)]),this._funcCall("ParseCryptoHeader",r,e,n,null)},et.prototype.AppendFileTransportHeader=function(t,e,n,r,i,o,s,a){var u;u=this._funcMakeParams([t,e,n,new S(r),i,o]),this._funcCall("AppendFileTransportHeader",u,s,a,null)},et.prototype.ParseFileTransportHeader=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("ParseFileTransportHeader",i,n,r,null)},et.prototype.AppendFileCryptoHeader=function(t,e,n,r,i,o){var s;s=this._funcMakeParams([t,e,n,r]),this._funcCall("AppendFileCryptoHeader",s,i,o,null)},et.prototype.ParseFileCryptoHeader=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("ParseFileCryptoHeader",i,n,r,null)},et.prototype.DevCtxEnum=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("DevCtxEnum",r,e,n,null)},et.prototype.DevCtxOpen=function(t,e,n,r,i){var o;return o=this._funcMakeParams([t,e,n]),this._funcCall("DevCtxOpen",o,r,i,null)},et.prototype.CreateDeviceContext=function(){return new W},et.prototype.DevCtxEnumVirtual=function(t,e,n){var r,i=this;return r=this._funcMakeParams([t]),this._funcCall("DevCtxEnumVirtual",r,e,n,(function(e,n,r){var o=i.IsAsync(n,r);try{if(null==e){if(!o)return null;n(null)}if(t.set(e[1]),!o)return e[0];n(e[0])}catch(t){var s=i.MakeError($.ERROR_LIBRARY_COMUNICATION_FAILED,"");if(o)return void r(s);throw new tt(s.errorCode,s.message)}}))},et.prototype.DevCtxClose=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("DevCtxClose",r,e,n,null)},et.prototype.DevCtxGetData=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("DevCtxGetData",i,n,r,null)},et.prototype.DevCtxChangePassword=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("DevCtxChangePassword",i,n,r,null)},et.prototype.GetHostInfo=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("GetHostInfo",n,t,e,null)},et.prototype.IsRemotelyControlled=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("IsRemotelyControlled",n,t,e,null)},et.prototype.CtxCreate=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("CtxCreate",n,t,e,null)},et.prototype.CtxFree=function(t,e,n){var r;r=this._funcMakeParams([t]),this._funcCall("CtxFree",r,e,n,null)},et.prototype.CtxSetParameter=function(t,e,n,r,i){var o;"boolean"==typeof n&&(n=n?1:0),o=this._funcMakeParams([t,e,n]),this._funcCall("CtxSetParameter",o,r,i,null)},et.prototype.CreateReference=function(t,e){return new Q(t,e)},et.prototype.ASiCGetASiCType=function(t,e,n){var r;if("string"!=typeof t||null!=(t=this._base64Decode(t,n)))return r=this._funcMakeParams([new S(t)]),this._funcCall("ASiCGetASiCType",r,e,n,null)},et.prototype.ASiCGetSignType=function(t,e,n){var r;if("string"!=typeof t||null!=(t=this._base64Decode(t,n)))return r=this._funcMakeParams([new S(t)]),this._funcCall("ASiCGetSignType",r,e,n,null)},et.prototype.ASiCGetSignsCount=function(t,e,n){var r;if("string"!=typeof t||null!=(t=this._base64Decode(t,n)))return r=this._funcMakeParams([new S(t)]),this._funcCall("ASiCGetSignsCount",r,e,n,null)},et.prototype.ASiCGetSignerInfo=function(t,e,n,r){var i;if("string"!=typeof e||null!=(e=this._base64Decode(e,r)))return i=this._funcMakeParams([t,new S(e)]),this._funcCall("ASiCGetSignerInfo",i,n,r,null)},et.prototype.ASiCGetSignTimeInfo=function(t,e,n,r){var i;if("string"!=typeof e||null!=(e=this._base64Decode(e,r)))return i=this._funcMakeParams([t,new S(e)]),this._funcCall("ASiCGetSignTimeInfo",i,n,r,null)},et.prototype.ASiCGetSignReferences=function(t,e,n,r){var i;if("string"!=typeof e||null!=(e=this._base64Decode(e,r)))return i=this._funcMakeParams([t,new S(e)]),this._funcCall("ASiCGetSignReferences",i,n,r,null)},et.prototype.ASiCGetReference=function(t,e,n,r){var i;if("string"!=typeof t||null!=(t=this._base64Decode(t,r)))return i=this._funcMakeParams([new S(t),e]),this._funcCall("ASiCGetReference",i,n,r,null)},et.prototype.ASiCSign=function(t,e,n,r,i,o){for(var s,a=[],u=[],c=0;c<r.length;c++)a.push(r[c].GetName()),u.push(new S(r[c].GetData()));return s=this._funcMakeParams([t,e,n,a,u]),this._funcCall("ASiCSign",s,i,o,null)},et.prototype.ASiCAppendSign=function(t,e,n,r,i){var o;if("string"!=typeof n||null!=(n=this._base64Decode(n,i)))return o=this._funcMakeParams([t,e,new S(n)]),this._funcCall("ASiCAppendSign",o,r,i,null)},et.prototype.ASiCVerify=function(t,e,n,r,i){var o,s=[];if("string"!=typeof e||null!=(e=this._base64Decode(e,i)))return"boolean"!=typeof n&&(i=r,r=n),s.push(t),s.push(new S(e)),"boolean"==typeof n?s.push(n):s.push(null),o=this._funcMakeParams(s),this._funcCall("ASiCVerify",o,r,i,null)},et.prototype.CtxASiCSign=function(t,e,n,r,i,o,s,a){for(var u,c=[],l=[],f=0;f<o.length;f++)c.push(o[f].GetName()),l.push(new S(o[f].GetData()));return u=this._funcMakeParams([t,e,n,r,i,c,l]),this._funcCall("CtxASiCSign",u,s,a,null)},et.prototype.CtxASiCAppendSign=function(t,e,n,r,i,o,s){var a;if("string"!=typeof i||null!=(i=this._base64Decode(i,s)))return a=this._funcMakeParams([t,e,n,r,new S(i)]),this._funcCall("CtxASiCAppendSign",a,o,s,null)},et.prototype.CtxASiCGetSignerInfo=function(t,e,n,r,i){var o;if("string"!=typeof n||null!=(n=this._base64Decode(n,i)))return o=this._funcMakeParams([t,e,new S(n)]),this._funcCall("CtxASiCGetSignerInfo",o,r,i,null)},et.prototype.ASiCGetSignLevel=function(t,e,n,r){var i;if("string"!=typeof e||null!=(e=this._base64Decode(e,r)))return i=this._funcMakeParams([t,new S(e)]),this._funcCall("ASiCGetSignLevel",i,n,r,null)},et.prototype.ASiCIsAllContentCovered=function(t,e,n,r){var i;if("string"!=typeof e||null!=(e=this._base64Decode(e,r)))return i=this._funcMakeParams([t,new S(e)]),this._funcCall("ASiCIsAllContentCovered",i,n,r,null)},et.prototype.PDFGetSignType=function(t,e,n,r){var i;if("string"!=typeof e||null!=(e=this._base64Decode(e,r)))return i=this._funcMakeParams([t,new S(e)]),this._funcCall("PDFGetSignType",i,n,r,null)},et.prototype.PDFGetSignsCount=function(t,e,n){var r;if("string"!=typeof t||null!=(t=this._base64Decode(t,n)))return r=this._funcMakeParams([new S(t)]),this._funcCall("PDFGetSignsCount",r,e,n,null)},et.prototype.PDFGetSignerInfo=function(t,e,n,r){var i;if("string"!=typeof e||null!=(e=this._base64Decode(e,r)))return i=this._funcMakeParams([t,new S(e)]),this._funcCall("PDFGetSignerInfo",i,n,r,null)},et.prototype.PDFGetSignTimeInfo=function(t,e,n,r){var i;if("string"!=typeof e||null!=(e=this._base64Decode(e,r)))return i=this._funcMakeParams([t,new S(e)]),this._funcCall("PDFGetSignTimeInfo",i,n,r,null)},et.prototype.PDFSign=function(t,e,n,r){var i;return i=this._funcMakeParams([new S(t),e]),this._funcCall("PDFSign",i,n,r,null)},et.prototype.PDFVerify=function(t,e,n,r,i){var o,s=[];if("string"!=typeof e||null!=(e=this._base64Decode(e,i)))return"boolean"!=typeof n&&(i=r,r=n),s.push(t),s.push(new S(e)),"boolean"==typeof n?s.push(n):s.push(null),o=this._funcMakeParams(s),this._funcCall("PDFVerify",o,r,i,null)},et.prototype.CtxPDFSign=function(t,e,n,r,i,o){var s;return s=this._funcMakeParams([t,e,new S(n),r]),this._funcCall("CtxPDFSign",s,i,o,null)},et.prototype.CtxPDFGetSignerInfo=function(t,e,n,r,i){var o;if("string"!=typeof n||null!=(n=this._base64Decode(n,i)))return o=this._funcMakeParams([t,e,new S(n)]),this._funcCall("CtxPDFGetSignerInfo",o,r,i,null)},et.prototype.XAdESGetType=function(t,e,n){var r;if("string"!=typeof t||null!=(t=this._base64Decode(t,n)))return r=this._funcMakeParams([new S(t)]),this._funcCall("XAdESGetType",r,e,n,null)},et.prototype.XAdESGetSignsCount=function(t,e,n){var r;if("string"!=typeof t||null!=(t=this._base64Decode(t,n)))return r=this._funcMakeParams([new S(t)]),this._funcCall("XAdESGetSignsCount",r,e,n,null)},et.prototype.XAdESGetSignLevel=function(t,e,n,r){var i;if("string"!=typeof e||null!=(e=this._base64Decode(e,r)))return i=this._funcMakeParams([t,new S(e)]),this._funcCall("XAdESGetSignLevel",i,n,r,null)},et.prototype.XAdESGetSignerInfo=function(t,e,n,r){var i;if("string"!=typeof e||null!=(e=this._base64Decode(e,r)))return i=this._funcMakeParams([t,new S(e)]),this._funcCall("XAdESGetSignerInfo",i,n,r,null)},et.prototype.XAdESGetSignTimeInfo=function(t,e,n,r){var i;if("string"!=typeof e||null!=(e=this._base64Decode(e,r)))return i=this._funcMakeParams([t,new S(e)]),this._funcCall("XAdESGetSignTimeInfo",i,n,r,null)},et.prototype.XAdESGetSignReferences=function(t,e,n,r){var i;if("string"!=typeof e||null!=(e=this._base64Decode(e,r)))return i=this._funcMakeParams([t,new S(e)]),this._funcCall("XAdESGetSignReferences",i,n,r,null)},et.prototype.XAdESGetReference=function(t,e,n,r){var i;if("string"!=typeof t||null!=(t=this._base64Decode(t,r)))return i=this._funcMakeParams([new S(t),e]),this._funcCall("XAdESGetReference",i,n,r,null)},et.prototype.XAdESSign=function(t,e,n,r,i){for(var o,s=[],a=[],u=0;u<n.length;u++)s.push(n[u].GetName()),a.push(new S(n[u].GetData()));return o=this._funcMakeParams([t,e,s,a]),this._funcCall("XAdESSign",o,r,i,null)},et.prototype.XAdESVerify=function(t,e,n,r,i,o){var s,a=[],u=null,c=null;if(null!=t){u=[],c=[];for(var l=0;l<t.length;l++)u.push(t[l].GetName()),c.push(new S(t[l].GetData()))}if("string"!=typeof n||null!=(n=this._base64Decode(n,o)))return"boolean"!=typeof r&&(o=i,i=r),a.push(u),a.push(c),a.push(e),a.push(new S(n)),"boolean"==typeof r?a.push(r):a.push(null),s=this._funcMakeParams(a),this._funcCall("XAdESVerify",s,i,o,null)},et.prototype.CtxXAdESSign=function(t,e,n,r,i,o,s){for(var a,u=[],c=[],l=0;l<i.length;l++)u.push(i[l].GetName()),c.push(new S(i[l].GetData()));return a=this._funcMakeParams([t,e,n,r,u,c]),this._funcCall("CtxXAdESSign",a,o,s,null)},et.prototype.CtxXAdESGetSignerInfo=function(t,e,n,r,i){var o;if("string"!=typeof n||null!=(n=this._base64Decode(n,i)))return o=this._funcMakeParams([t,e,new S(n)]),this._funcCall("CtxXAdESGetSignerInfo",o,r,i,null)},{EndUserLibraryLoader:p,EUSignCP:et,EndUserError:$}})?r.apply(e,i):r)||(t.exports=o)},function(t,e,n){"use strict";n.r(e),n.d(e,"CASettings",(function(){return s.a})),n.d(e,"KSPSettings",(function(){return s.d})),n.d(e,"EndUserError",(function(){return i})),n.d(e,"EndUserConstants",(function(){return h})),n.d(e,"EndUserEvents",(function(){return r})),n.d(e,"EndUserLibraryInfoJS",(function(){return o.a})),n.d(e,"EndUserLibraryInfoSW",(function(){return o.b})),n.d(e,"EndUserSettings",(function(){return s.c})),n.d(e,"EndUserProxySettings",(function(){return s.b})),n.d(e,"EndUserOwnerInfo",(function(){return a.a})),n.d(e,"EndUserCertificateInfoEx",(function(){return u.a})),n.d(e,"EndUserCertificate",(function(){return c})),n.d(e,"EndUserKeyMedia",(function(){return l})),n.d(e,"EndUserJKSPrivateKeyInfo",(function(){return f.a})),n.d(e,"EndUserContext",(function(){return p})),n.d(e,"EndUserPrivateKeyContext",(function(){return _})),n.d(e,"EndUserTimeInfo",(function(){return y.a})),n.d(e,"EndUserSignContainerInfo",(function(){return S.a})),n.d(e,"EndUserSignInfo",(function(){return C.a})),n.d(e,"EndUserSenderInfo",(function(){return d.a})),n.d(e,"EndUserParams",(function(){return m.a})),n.d(e,"EndUserInfo",(function(){return R})),n.d(e,"EndUserRequestInfo",(function(){return A.a})),n.d(e,"EndUserTaxReport",(function(){return E.b})),n.d(e,"EndUserTaxReceipt",(function(){return E.a})),n.d(e,"EndUser",(function(){return I}));var r={};n.r(r),n.d(r,"EndUserConfirmKSPOperationEvent",(function(){return P}));var i=n(1),o=n(13),s=n(9),a=n(10),u=n(8),c=function(){},l=function(t){this.type=t?t.type:"",this.device=t?t.device:"",this.visibleName=t?t.visibleName:"",this.typeIndex=t?t.typeIndex:-1,this.devIndex=t?t.devIndex:-1,this.password=t?t.password:"",this.user=t?t.user:""},f=n(14),p=function(){},_=function(){},h=n(0),E=n(11),y=n(6),S=n(7),C=n(5),d=n(12),m=n(15),R=function(){this.version=h.EU_USER_INFO_VERSION,this.commonName="",this.locality="",this.state="",this.organization="",this.orgUnit="",this.title="",this.street="",this.phone="",this.surname="",this.givenname="",this.EMail="",this.DNS="",this.EDRPOUCode="",this.DRFOCode="",this.NBUCode="",this.SPFMCode="",this.OCode="",this.OUCode="",this.userCode="",this.UPN="",this.UNZR="",this.country="UA"},A=n(16),P=function(){this.type=h.EndUserEventType.ConfirmKSPOperation},v=n(18),g=function(){function t(t){var e=this;this.m_worker=new v.a("",t,(function(t){e.OnEvent(t)})),this.m_eventListeners=new Array}return t.prototype.OnEvent=function(t){try{var e=this.m_eventListeners[t.type]||this.m_eventListeners[h.EndUserEventType.All];e&&e(t)}catch(t){}},t.prototype.AddEventListener=function(t,e){switch(t){case h.EndUserEventType.None:this.m_eventListeners=[];break;case h.EndUserEventType.All:this.m_eventListeners=[],this.m_eventListeners[t]=e;break;default:this.m_eventListeners[t]=e}return this.m_worker.postMessage("AddEventListener",[t])},t.prototype.GetLibraryInfo=function(t){return this.m_worker.postMessage("GetLibraryInfo",Array.prototype.slice.call(arguments))},t.prototype.IsInitialized=function(){return this.m_worker.postMessage("IsInitialized",Array.prototype.slice.call(arguments))},t.prototype.Initialize=function(t){return this.m_worker.postMessage("Initialize",Array.prototype.slice.call(arguments))},t.prototype.SetRuntimeParameter=function(t,e){return this.m_worker.postMessage("SetRuntimeParameter",Array.prototype.slice.call(arguments))},t.prototype.GetStorageParameter=function(t,e){return this.m_worker.postMessage("GetStorageParameter",Array.prototype.slice.call(arguments))},t.prototype.SetStorageParameter=function(t,e,n){return this.m_worker.postMessage("SetStorageParameter",Array.prototype.slice.call(arguments))},t.prototype.GetCAs=function(){return this.m_worker.postMessage("GetCAs",Array.prototype.slice.call(arguments))},t.prototype.GetProxySettings=function(){return this.m_worker.postMessage("GetProxySettings",Array.prototype.slice.call(arguments))},t.prototype.SetProxySettings=function(t){return this.m_worker.postMessage("SetProxySettings",Array.prototype.slice.call(arguments))},t.prototype.GetKeyMedias=function(){return this.m_worker.postMessage("GetKeyMedias",Array.prototype.slice.call(arguments))},t.prototype.GetJKSPrivateKeys=function(t){return this.m_worker.postMessage("GetJKSPrivateKeys",Array.prototype.slice.call(arguments))},t.prototype.IsPrivateKeyReaded=function(){return this.m_worker.postMessage("IsPrivateKeyReaded",Array.prototype.slice.call(arguments))},t.prototype.ResetPrivateKey=function(){return this.m_worker.postMessage("ResetPrivateKey",Array.prototype.slice.call(arguments))},t.prototype.ReadPrivateKey=function(t,e,n){return this.m_worker.postMessage("ReadPrivateKey",Array.prototype.slice.call(arguments))},t.prototype.ReadPrivateKeyBinary=function(t,e,n,r){return this.m_worker.postMessage("ReadPrivateKeyBinary",Array.prototype.slice.call(arguments))},t.prototype.ReadPrivateKeySIM=function(t,e,n,r){return this.m_worker.postMessage("ReadPrivateKeySIM",Array.prototype.slice.call(arguments))},t.prototype.ReadPrivateKeyKSP=function(t,e,n,r){return this.m_worker.postMessage("ReadPrivateKeyKSP",Array.prototype.slice.call(arguments))},t.prototype.GetOwnCertificates=function(){return this.m_worker.postMessage("GetOwnCertificates",Array.prototype.slice.call(arguments))},t.prototype.GetOwnEUserParams=function(){return this.m_worker.postMessage("GetOwnEUserParams",Array.prototype.slice.call(arguments))},t.prototype.ChangeOwnCertificatesStatus=function(t,e){return this.m_worker.postMessage("ChangeOwnCertificatesStatus",Array.prototype.slice.call(arguments))},t.prototype.MakeNewCertificate=function(t,e,n,r,i,o,s,a,u,c,l,f,p,_,h,E){return void 0===E&&(E=!1),this.m_worker.postMessage("MakeNewCertificate",Array.prototype.slice.call(arguments))},t.prototype.MakeDeviceCertificate=function(t,e,n,r,i){return this.m_worker.postMessage("MakeDeviceCertificate",Array.prototype.slice.call(arguments))},t.prototype.ChangePrivateKeyPassword=function(t,e){return this.m_worker.postMessage("ChangePrivateKeyPassword",Array.prototype.slice.call(arguments))},t.prototype.ChangePrivateKeyPasswordBinary=function(t,e,n){return this.m_worker.postMessage("ChangePrivateKeyPasswordBinary",Array.prototype.slice.call(arguments))},t.prototype.GeneratePrivateKey=function(t,e,n,r,i,o,s,a,u,c,l,f){return this.m_worker.postMessage("GeneratePrivateKey",Array.prototype.slice.call(arguments))},t.prototype.GeneratePrivateKeyBinary=function(t,e,n,r,i,o,s,a,u,c,l){return this.m_worker.postMessage("GeneratePrivateKeyBinary",Array.prototype.slice.call(arguments))},t.prototype.GetKeyInfo=function(t){return this.m_worker.postMessage("GetKeyInfo",Array.prototype.slice.call(arguments))},t.prototype.GetKeyInfoBinary=function(t,e){return this.m_worker.postMessage("GetKeyInfoBinary",Array.prototype.slice.call(arguments))},t.prototype.HashData=function(t,e,n){return this.m_worker.postMessage("HashData",Array.prototype.slice.call(arguments))},t.prototype.GetSigner=function(t,e,n){return void 0===e&&(e=-1),void 0===n&&(n=!1),this.m_worker.postMessage("GetSigner",Array.prototype.slice.call(arguments))},t.prototype.SignData=function(t,e){return void 0===e&&(e=!1),this.m_worker.postMessage("SignData",Array.prototype.slice.call(arguments))},t.prototype.SignDataInternal=function(t,e,n){return void 0===n&&(n=!1),this.m_worker.postMessage("SignDataInternal",Array.prototype.slice.call(arguments))},t.prototype.SignHash=function(t,e,n,r){return this.m_worker.postMessage("SignHash",Array.prototype.slice.call(arguments))},t.prototype.SignDataEx=function(t,e,n,r,i){return this.m_worker.postMessage("SignDataEx",Array.prototype.slice.call(arguments))},t.prototype.AppendSign=function(t,e,n,r,i){return this.m_worker.postMessage("AppendSign",Array.prototype.slice.call(arguments))},t.prototype.AppendSignHash=function(t,e,n,r,i){return this.m_worker.postMessage("AppendSignHash",Array.prototype.slice.call(arguments))},t.prototype.VerifyHash=function(t,e,n){return void 0===n&&(n=-1),this.m_worker.postMessage("VerifyHash",Array.prototype.slice.call(arguments))},t.prototype.VerifyData=function(t,e,n){return void 0===n&&(n=-1),this.m_worker.postMessage("VerifyData",Array.prototype.slice.call(arguments))},t.prototype.VerifyDataInternal=function(t,e){return void 0===e&&(e=-1),this.m_worker.postMessage("VerifyDataInternal",Array.prototype.slice.call(arguments))},t.prototype.EnvelopData=function(t,e,n,r,i,o){return void 0===o&&(o=!1),this.m_worker.postMessage("EnvelopData",Array.prototype.slice.call(arguments))},t.prototype.DevelopData=function(t,e){return this.m_worker.postMessage("DevelopData",Array.prototype.slice.call(arguments))},t.prototype.CreateAuthData=function(t,e,n){return this.m_worker.postMessage("CreateAuthData",Array.prototype.slice.call(arguments))},t.prototype.ProtectDataByPassword=function(t,e,n){return this.m_worker.postMessage("ProtectDataByPassword",Array.prototype.slice.call(arguments))},t.prototype.UnprotectDataByPassword=function(t,e,n){return this.m_worker.postMessage("UnprotectDataByPassword",Array.prototype.slice.call(arguments))},t.prototype.GetTSPByAccessInfo=function(t,e,n,r,i){return this.m_worker.postMessage("GetTSPByAccessInfo",Array.prototype.slice.call(arguments))},t.prototype.CheckTSP=function(t,e,n){return this.m_worker.postMessage("CheckTSP",Array.prototype.slice.call(arguments))},t.prototype.CtxCreate=function(){return this.m_worker.postMessage("CtxCreate",Array.prototype.slice.call(arguments))},t.prototype.CtxFree=function(t){return this.m_worker.postMessage("CtxFree",Array.prototype.slice.call(arguments))},t.prototype.CtxSetParameter=function(t,e,n){return this.m_worker.postMessage("CtxSetParameter",Array.prototype.slice.call(arguments))},t.prototype.CtxReadPrivateKey=function(t,e,n,r){return this.m_worker.postMessage("CtxReadPrivateKey",Array.prototype.slice.call(arguments))},t.prototype.CtxReadPrivateKeyBinary=function(t,e,n,r,i){return this.m_worker.postMessage("CtxReadPrivateKeyBinary",Array.prototype.slice.call(arguments))},t.prototype.CtxFreePrivateKey=function(t){return this.m_worker.postMessage("CtxFreePrivateKey",Array.prototype.slice.call(arguments))},t.prototype.CtxGetOwnCertificates=function(t){return this.m_worker.postMessage("CtxGetOwnCertificates",Array.prototype.slice.call(arguments))},t.prototype.CtxSignHash=function(t,e,n,r,i){return this.m_worker.postMessage("CtxSignHash",Array.prototype.slice.call(arguments))},t.prototype.CtxSignData=function(t,e,n,r,i,o){return this.m_worker.postMessage("CtxSignData",Array.prototype.slice.call(arguments))},t.prototype.CtxAppendSignHash=function(t,e,n,r,i,o){return this.m_worker.postMessage("CtxAppendSignHash",Array.prototype.slice.call(arguments))},t.prototype.CtxAppendSign=function(t,e,n,r,i,o){return this.m_worker.postMessage("CtxAppendSign",Array.prototype.slice.call(arguments))},t.prototype.CtxEnvelopData=function(t,e,n,r,i,o,s){return this.m_worker.postMessage("CtxEnvelopData",Array.prototype.slice.call(arguments))},t.prototype.CtxDevelopData=function(t,e,n){return this.m_worker.postMessage("CtxDevelopData",Array.prototype.slice.call(arguments))},t.prototype.ProtectTaxReports=function(t,e,n,r,i,o,s){return void 0===t&&(t=null),void 0===e&&(e=null),void 0===n&&(n=null),void 0===s&&(s=!1),this.m_worker.postMessage("ProtectTaxReports",Array.prototype.slice.call(arguments))},t.prototype.UnprotectTaxReceipts=function(t,e){return this.m_worker.postMessage("UnprotectTaxReceipts",Array.prototype.slice.call(arguments))},t.prototype.ASiCGetSigner=function(t,e,n){return this.m_worker.postMessage("ASiCGetSigner",Array.prototype.slice.call(arguments))},t.prototype.ASiCSignData=function(t,e,n,r,i,o){return this.m_worker.postMessage("ASiCSignData",Array.prototype.slice.call(arguments))},t.prototype.ASiCAppendSign=function(t,e,n,r,i){return this.m_worker.postMessage("ASiCAppendSign",Array.prototype.slice.call(arguments))},t.prototype.ASiCVerifyData=function(t,e){return this.m_worker.postMessage("ASiCVerifyData",Array.prototype.slice.call(arguments))},t.prototype.PDFSignData=function(t,e,n,r){return this.m_worker.postMessage("PDFSignData",Array.prototype.slice.call(arguments))},t.prototype.PDFVerifyData=function(t,e){return this.m_worker.postMessage("PDFVerifyData",Array.prototype.slice.call(arguments))},t.prototype.PDFGetSigner=function(t,e,n){return this.m_worker.postMessage("PDFGetSigner",Array.prototype.slice.call(arguments))},t.prototype.XAdESGetSigner=function(t,e,n){return this.m_worker.postMessage("XAdESGetSigner",Array.prototype.slice.call(arguments))},t.prototype.XAdESSignData=function(t,e,n,r,i){return this.m_worker.postMessage("XAdESSignData",Array.prototype.slice.call(arguments))},t.prototype.XAdESVerifyData=function(t,e,n){return this.m_worker.postMessage("XAdESVerifyData",Array.prototype.slice.call(arguments))},t.prototype.GetSignContainerInfo=function(t){return this.m_worker.postMessage("GetSignContainerInfo",Array.prototype.slice.call(arguments))},t}(),T=n(19),I=function(){function t(t,e){switch(void 0===e&&(e=h.EndUserLibraryType.JS),e){case h.EndUserLibraryType.SW:this.m_library=new T.a;break;case h.EndUserLibraryType.JS:case h.EndUserLibraryType.MS:default:this.m_library=new g(t)}}return t.prototype.AddEventListener=function(t,e){return this.m_library.AddEventListener(t,e)},t.prototype.GetLibraryInfo=function(t){return this.m_library.GetLibraryInfo(t)},t.prototype.IsInitialized=function(){return this.m_library.IsInitialized()},t.prototype.Initialize=function(t){return this.m_library.Initialize(t)},t.prototype.SetRuntimeParameter=function(t,e){return this.m_library.SetRuntimeParameter(t,e)},t.prototype.GetStorageParameter=function(t,e){return void 0===e&&(e=!1),this.m_library.GetStorageParameter(t,e)},t.prototype.SetStorageParameter=function(t,e,n){return void 0===n&&(n=!1),this.m_library.SetStorageParameter(t,e,n)},t.prototype.GetCAs=function(){return this.m_library.GetCAs()},t.prototype.GetProxySettings=function(){return this.m_library.GetProxySettings()},t.prototype.SetProxySettings=function(t){return this.m_library.SetProxySettings(t)},t.prototype.GetKeyMedias=function(){return this.m_library.GetKeyMedias()},t.prototype.GetJKSPrivateKeys=function(t){return this.m_library.GetJKSPrivateKeys(t)},t.prototype.IsPrivateKeyReaded=function(){return this.m_library.IsPrivateKeyReaded()},t.prototype.ResetPrivateKey=function(){return this.m_library.ResetPrivateKey()},t.prototype.ReadPrivateKey=function(t,e,n){return this.m_library.ReadPrivateKey(t,e,n)},t.prototype.ReadPrivateKeyBinary=function(t,e,n,r){return this.m_library.ReadPrivateKeyBinary(t,e,n,r)},t.prototype.ReadPrivateKeySIM=function(t,e,n,r){return void 0===n&&(n=!0),void 0===r&&(r=0),this.m_library.ReadPrivateKeySIM(t,e,n,r)},t.prototype.ReadPrivateKeyKSP=function(t,e,n,r){return void 0===n&&(n=!0),void 0===r&&(r=0),this.m_library.ReadPrivateKeyKSP(t,e,n,r)},t.prototype.GetOwnCertificates=function(){return this.m_library.GetOwnCertificates()},t.prototype.GetOwnEUserParams=function(){return this.m_library.GetOwnEUserParams()},t.prototype.ChangeOwnCertificatesStatus=function(t,e){return this.m_library.ChangeOwnCertificatesStatus(t,e)},t.prototype.MakeNewCertificate=function(t,e,n,r,i,o,s,a,u,c,l,f,p,_,h,E){return void 0===E&&(E=!1),this.m_library.MakeNewCertificate(t,e,n,r,i,o,s,a,u,c,l,f,p,_,h,E)},t.prototype.MakeDeviceCertificate=function(t,e,n,r,i){return this.m_library.MakeDeviceCertificate(t,e,n,r,i)},t.prototype.ChangePrivateKeyPassword=function(t,e){return this.m_library.ChangePrivateKeyPassword(t,e)},t.prototype.ChangePrivateKeyPasswordBinary=function(t,e,n){return this.m_library.ChangePrivateKeyPasswordBinary(t,e,n)},t.prototype.GeneratePrivateKey=function(t,e,n,r,i,o,s,a,u,c,l,f){return this.m_library.GeneratePrivateKey(t,e,n,r,i,o,s,a,u,c,l,f)},t.prototype.GeneratePrivateKeyBinary=function(t,e,n,r,i,o,s,a,u,c,l){return this.m_library.GeneratePrivateKeyBinary(t,e,n,r,i,o,s,a,u,c,l)},t.prototype.GetKeyInfo=function(t){return this.m_library.GetKeyInfo(t)},t.prototype.GetKeyInfoBinary=function(t,e){return this.m_library.GetKeyInfoBinary(t,e)},t.prototype.HashData=function(t,e,n){return this.m_library.HashData(t,e,n)},t.prototype.GetSigner=function(t,e,n){return this.m_library.GetSigner(t,e,n)},t.prototype.SignData=function(t,e){return void 0===e&&(e=!1),this.m_library.SignData(t,e)},t.prototype.SignDataInternal=function(t,e,n){return void 0===n&&(n=!1),this.m_library.SignDataInternal(t,e,n)},t.prototype.SignHash=function(t,e,n,r){return void 0===r&&(r=!1),this.m_library.SignHash(t,e,n,r)},t.prototype.SignDataEx=function(t,e,n,r,i){return void 0===i&&(i=!1),this.m_library.SignDataEx(t,e,n,r,i)},t.prototype.AppendSign=function(t,e,n,r,i){return void 0===i&&(i=!1),this.m_library.AppendSign(t,e,n,r,i)},t.prototype.AppendSignHash=function(t,e,n,r,i){return this.m_library.AppendSignHash(t,e,n,r,i)},t.prototype.VerifyHash=function(t,e,n){return void 0===n&&(n=-1),this.m_library.VerifyHash(t,e,n)},t.prototype.VerifyData=function(t,e,n){return void 0===n&&(n=-1),this.m_library.VerifyData(t,e,n)},t.prototype.VerifyDataInternal=function(t,e){return void 0===e&&(e=-1),this.m_library.VerifyDataInternal(t,e)},t.prototype.EnvelopData=function(t,e,n,r,i,o){return void 0===o&&(o=!1),this.m_library.EnvelopData(t,e,n,r,i,o)},t.prototype.DevelopData=function(t,e){return this.m_library.DevelopData(t,e)},t.prototype.ProtectDataByPassword=function(t,e,n){return this.m_library.ProtectDataByPassword(t,e,n)},t.prototype.UnprotectDataByPassword=function(t,e,n){return this.m_library.UnprotectDataByPassword(t,e,n)},t.prototype.CreateAuthData=function(t,e,n){return this.m_library.CreateAuthData(t,e,n)},t.prototype.GetTSPByAccessInfo=function(t,e,n,r,i){return this.m_library.GetTSPByAccessInfo(t,e,n,r,i)},t.prototype.CheckTSP=function(t,e,n){return this.m_library.CheckTSP(t,e,n)},t.prototype.CtxCreate=function(){return this.m_library.CtxCreate()},t.prototype.CtxFree=function(t){return this.m_library.CtxFree(t)},t.prototype.CtxSetParameter=function(t,e,n){return this.m_library.CtxSetParameter(t,e,n)},t.prototype.CtxReadPrivateKey=function(t,e,n,r){return void 0===t&&(t=null),this.m_library.CtxReadPrivateKey(t,e,n,r)},t.prototype.CtxReadPrivateKeyBinary=function(t,e,n,r,i){return void 0===t&&(t=null),this.m_library.CtxReadPrivateKeyBinary(t,e,n,r,i)},t.prototype.CtxFreePrivateKey=function(t){return this.m_library.CtxFreePrivateKey(t)},t.prototype.CtxGetOwnCertificates=function(t){return this.m_library.CtxGetOwnCertificates(t)},t.prototype.CtxSignHash=function(t,e,n,r,i){return this.m_library.CtxSignHash(t,e,n,r,i)},t.prototype.CtxSignData=function(t,e,n,r,i,o){return this.m_library.CtxSignData(t,e,n,r,i,o)},t.prototype.CtxAppendSignHash=function(t,e,n,r,i,o){return this.m_library.CtxAppendSignHash(t,e,n,r,i,o)},t.prototype.CtxAppendSign=function(t,e,n,r,i,o){return this.m_library.CtxAppendSign(t,e,n,r,i,o)},t.prototype.CtxEnvelopData=function(t,e,n,r,i,o,s){return this.m_library.CtxEnvelopData(t,e,n,r,i,o,s)},t.prototype.CtxDevelopData=function(t,e,n){return this.m_library.CtxDevelopData(t,e,n)},t.prototype.ProtectTaxReports=function(t,e,n,r,i,o,s){return void 0===t&&(t=null),void 0===e&&(e=null),void 0===n&&(n=null),this.m_library.ProtectTaxReports(t,e,n,r,i,o,s)},t.prototype.UnprotectTaxReceipts=function(t,e){return this.m_library.UnprotectTaxReceipts(t,e)},t.prototype.ASiCGetSigner=function(t,e,n){return this.m_library.ASiCGetSigner(t,e,n)},t.prototype.ASiCSignData=function(t,e,n,r,i,o){return this.m_library.ASiCSignData(t,e,n,r,i,o)},t.prototype.ASiCAppendSign=function(t,e,n,r,i){return this.m_library.ASiCAppendSign(t,e,n,r,i)},t.prototype.ASiCVerifyData=function(t,e){return this.m_library.ASiCVerifyData(t,e)},t.prototype.PDFGetSigner=function(t,e,n){return this.m_library.PDFGetSigner(t,e,n)},t.prototype.PDFSignData=function(t,e,n,r){return this.m_library.PDFSignData(t,e,n,r)},t.prototype.PDFVerifyData=function(t,e){return this.m_library.PDFVerifyData(t,e)},t.prototype.XAdESGetSigner=function(t,e,n){return this.m_library.XAdESGetSigner(t,e,n)},t.prototype.XAdESSignData=function(t,e,n,r,i){return this.m_library.XAdESSignData(t,e,n,r,i)},t.prototype.XAdESVerifyData=function(t,e,n){return this.m_library.XAdESVerifyData(t,e,n)},t.prototype.GetSignContainerInfo=function(t){return this.m_library.GetSignContainerInfo(t)},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(){}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(){}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(0),i=function(){this.type=r.EndUserSignContainerType.Unknown,this.subType=r.EndUserCAdESType.Unknown,this.asicSignType=r.EndUserASiCSignType.Unknown}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(){}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r})),n.d(e,"d",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"b",(function(){return s}));var r=function(){},i=function(){},o=function(){},s=function(){}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(){}},function(t,e,n){"use strict";n.d(e,"b",(function(){return r})),n.d(e,"a",(function(){return i}));var r=function(){},i=function(){}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(){}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r})),n.d(e,"b",(function(){return i}));var r=function(){this.version=null,this.supported=!1,this.loaded=!1},i=function(){this.version=null,this.supported=!1,this.loaded=!1,this.isSignAgentSupported=!1,this.isWebExtensionSupported=!1,this.isNPAPISupported=!1,this.isActiveXSupported=!1,this.isWebExtensionInstalled=!1,this.isNativeLibraryNeedUpdate=!1,this.nativeLibraryInstallURL=null,this.nativeLibraryUpdateURL=null,this.webExtensionInstallURL=null,this.helpURL=null}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(){}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(){}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(){}},function(t,e,n){(function(e,r){var i;
1
+ !function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n=e();for(var r in n)("object"==typeof exports?exports:t)[r]=n[r]}}(this,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=4)}([function(t,e,n){"use strict";n.r(e),n.d(e,"EU_LIBRARY_TYPE_JS",(function(){return i})),n.d(e,"EU_LIBRARY_TYPE_SW",(function(){return o})),n.d(e,"EU_LIBRARY_TYPE_MS",(function(){return s})),n.d(e,"EndUserLibraryType",(function(){return r})),n.d(e,"EU_SUBJECT_TYPE_UNDIFFERENCED",(function(){return u})),n.d(e,"EU_SUBJECT_TYPE_CA",(function(){return c})),n.d(e,"EU_SUBJECT_TYPE_CA_SERVER",(function(){return l})),n.d(e,"EU_SUBJECT_TYPE_RA_ADMINISTRATOR",(function(){return f})),n.d(e,"EU_SUBJECT_TYPE_END_USER",(function(){return p})),n.d(e,"EndUserSubjectType",(function(){return a})),n.d(e,"EU_SUBJECT_CA_SERVER_SUB_TYPE_UNDIFFERENCED",(function(){return h})),n.d(e,"EU_SUBJECT_CA_SERVER_SUB_TYPE_CMP",(function(){return E})),n.d(e,"EU_SUBJECT_CA_SERVER_SUB_TYPE_TSP",(function(){return y})),n.d(e,"EU_SUBJECT_CA_SERVER_SUB_TYPE_OCSP",(function(){return S})),n.d(e,"EndUserSubjectCAServerSubType",(function(){return _})),n.d(e,"EU_CERT_KEY_TYPE_UNKNOWN",(function(){return d})),n.d(e,"EU_CERT_KEY_TYPE_DSTU4145",(function(){return R})),n.d(e,"EU_CERT_KEY_TYPE_RSA",(function(){return m})),n.d(e,"EU_CERT_KEY_TYPE_ECDSA",(function(){return A})),n.d(e,"EndUserCertKeyType",(function(){return C})),n.d(e,"EU_KEY_USAGE_UNKNOWN",(function(){return g})),n.d(e,"EU_KEY_USAGE_DIGITAL_SIGNATURE",(function(){return T})),n.d(e,"EU_KEY_USAGE_NON_REPUDATION",(function(){return v})),n.d(e,"EU_KEY_USAGE_KEY_AGREEMENT",(function(){return I})),n.d(e,"EndUserKeyUsage",(function(){return P})),n.d(e,"EU_CCS_TYPE_REVOKE",(function(){return b})),n.d(e,"EU_CCS_TYPE_HOLD",(function(){return D})),n.d(e,"EndUserCCSType",(function(){return U})),n.d(e,"EU_REVOCATION_REASON_UNKNOWN",(function(){return N})),n.d(e,"EU_REVOCATION_REASON_KEY_COMPROMISE",(function(){return G})),n.d(e,"EU_REVOCATION_REASON_NEW_ISSUED",(function(){return w})),n.d(e,"EndUserRevocationReason",(function(){return O})),n.d(e,"EU_KEYS_TYPE_NONE",(function(){return L})),n.d(e,"EU_KEYS_TYPE_DSTU_AND_ECDH_WITH_GOST",(function(){return K})),n.d(e,"EU_KEYS_TYPE_RSA_WITH_SHA",(function(){return x})),n.d(e,"EndUserKeysType",(function(){return M})),n.d(e,"EU_KEYS_LENGTH_DS_UA_191",(function(){return B})),n.d(e,"EU_KEYS_LENGTH_DS_UA_257",(function(){return F})),n.d(e,"EU_KEYS_LENGTH_DS_UA_307",(function(){return Y})),n.d(e,"EU_KEYS_LENGTH_DS_UA_FILE",(function(){return j})),n.d(e,"EU_KEYS_LENGTH_DS_UA_CERT",(function(){return H})),n.d(e,"EndUserKeysLengthDSUA",(function(){return k})),n.d(e,"EU_KEYS_LENGTH_KEP_UA_257",(function(){return W})),n.d(e,"EU_KEYS_LENGTH_KEP_UA_431",(function(){return X})),n.d(e,"EU_KEYS_LENGTH_KEP_UA_571",(function(){return z})),n.d(e,"EU_KEYS_LENGTH_KEP_UA_FILE",(function(){return J})),n.d(e,"EU_KEYS_LENGTH_KEP_UA_CERT",(function(){return q})),n.d(e,"EndUserKeysLengthKEPUA",(function(){return V})),n.d(e,"EU_KEYS_LENGTH_DS_RSA_1024",(function(){return Q})),n.d(e,"EU_KEYS_LENGTH_DS_RSA_2048",(function(){return $})),n.d(e,"EU_KEYS_LENGTH_DS_RSA_3072",(function(){return tt})),n.d(e,"EU_KEYS_LENGTH_DS_RSA_4096",(function(){return et})),n.d(e,"EU_KEYS_LENGTH_DS_RSA_FILE",(function(){return nt})),n.d(e,"EU_KEYS_LENGTH_DS_RSA_CERT",(function(){return rt})),n.d(e,"EndUserKeysLengthDSRSA",(function(){return Z})),n.d(e,"EU_KEYS_REQUEST_TYPE_UA_DS",(function(){return ot})),n.d(e,"EU_KEYS_REQUEST_TYPE_UA_KEP",(function(){return st})),n.d(e,"EU_KEYS_REQUEST_TYPE_INT_RSA",(function(){return at})),n.d(e,"EndUserRequestTypes",(function(){return it})),n.d(e,"EU_MOBILE_OPERATOR_ID_KYIVSTAR",(function(){return ct})),n.d(e,"EU_MOBILE_OPERATOR_ID_VODAFONE",(function(){return lt})),n.d(e,"EU_MOBILE_OPERATOR_ID_LIFECELL",(function(){return ft})),n.d(e,"EndUserMobileOperatorID",(function(){return ut})),n.d(e,"EU_KSP_IIT",(function(){return ht})),n.d(e,"EU_KSP_UKEY",(function(){return Et})),n.d(e,"EU_KSP_PB",(function(){return yt})),n.d(e,"EU_KSP_DIIA",(function(){return St})),n.d(e,"EndUserKSP",(function(){return pt})),n.d(e,"EndUserKSPClientIdType",(function(){return _t})),n.d(e,"EU_SIGN_TYPE_UNKNOWN",(function(){return dt})),n.d(e,"EU_SIGN_TYPE_CADES_BES",(function(){return Rt})),n.d(e,"EU_SIGN_TYPE_CADES_T",(function(){return mt})),n.d(e,"EU_SIGN_TYPE_CADES_C",(function(){return At})),n.d(e,"EU_SIGN_TYPE_CADES_X_LONG",(function(){return Pt})),n.d(e,"EU_SIGN_TYPE_CADES_X_LONG_TRUSTED",(function(){return gt})),n.d(e,"EndUserSignType",(function(){return Ct})),n.d(e,"EU_CADES_TYPE_UNKNOWN",(function(){return vt})),n.d(e,"EU_CADES_TYPE_DETACHED",(function(){return It})),n.d(e,"EU_CADES_TYPE_ENVELOPED",(function(){return Ut})),n.d(e,"EndUserCAdESType",(function(){return Tt})),n.d(e,"EU_CTX_SIGN_UNKNOWN",(function(){return Dt})),n.d(e,"EU_CTX_SIGN_DSTU4145_WITH_GOST34311",(function(){return Ot})),n.d(e,"EU_CTX_SIGN_RSA_WITH_SHA",(function(){return Nt})),n.d(e,"EU_CTX_SIGN_ECDSA_WITH_SHA",(function(){return Gt})),n.d(e,"EndUserSignAlgo",(function(){return bt})),n.d(e,"EU_SIGN_TYPE_PARAMETER",(function(){return Mt})),n.d(e,"EU_CHECK_PRIVATE_KEY_CONTEXT_PARAMETER",(function(){return Lt})),n.d(e,"EU_UA_OID_EXT_KEY_USAGE_STAMP",(function(){return Kt})),n.d(e,"EU_USER_INFO_VERSION",(function(){return xt})),n.d(e,"EndUserCMPCompatibility",(function(){return wt})),n.d(e,"EU_CTX_HASH_ALGO_UNKNOWN",(function(){return Bt})),n.d(e,"EU_CTX_HASH_ALGO_GOST34311",(function(){return Ft})),n.d(e,"EU_CTX_HASH_ALGO_SHA160",(function(){return Yt})),n.d(e,"EU_CTX_HASH_ALGO_SHA224",(function(){return jt})),n.d(e,"EU_CTX_HASH_ALGO_SHA256",(function(){return Ht})),n.d(e,"EndUserHashAlgo",(function(){return kt})),n.d(e,"EU_ASIC_TYPE_UNKNOWN",(function(){return Wt})),n.d(e,"EU_ASIC_TYPE_S",(function(){return Xt})),n.d(e,"EU_ASIC_TYPE_E",(function(){return zt})),n.d(e,"EndUserASiCType",(function(){return Vt})),n.d(e,"EU_ASIC_SIGN_TYPE_UNKNOWN",(function(){return qt})),n.d(e,"EU_ASIC_SIGN_TYPE_CADES",(function(){return Zt})),n.d(e,"EU_ASIC_SIGN_TYPE_XADES",(function(){return Qt})),n.d(e,"EndUserASiCSignType",(function(){return Jt})),n.d(e,"EU_XADES_TYPE_UNKNOWN",(function(){return te})),n.d(e,"EU_XADES_TYPE_DETACHED",(function(){return ee})),n.d(e,"EU_XADES_TYPE_ENVELOPING",(function(){return ne})),n.d(e,"EU_XADES_TYPE_ENVELOPED",(function(){return re})),n.d(e,"EndUserXAdESType",(function(){return $t})),n.d(e,"EU_XADES_SIGN_LEVEL_UNKNOWN",(function(){return oe})),n.d(e,"EU_XADES_SIGN_LEVEL_B_B",(function(){return se})),n.d(e,"EU_XADES_SIGN_LEVEL_B_T",(function(){return ae})),n.d(e,"EU_XADES_SIGN_LEVEL_B_LT",(function(){return ue})),n.d(e,"EU_XADES_SIGN_LEVEL_B_LTA",(function(){return ce})),n.d(e,"EndUserXAdESSignLevel",(function(){return ie})),n.d(e,"EU_PADES_SIGN_LEVEL_UNKNOWN",(function(){return pe})),n.d(e,"EU_PADES_SIGN_LEVEL_B_B",(function(){return _e})),n.d(e,"EU_PADES_SIGN_LEVEL_B_T",(function(){return he})),n.d(e,"EU_PADES_SIGN_LEVEL_B_LT",(function(){return Ee})),n.d(e,"EU_PADES_SIGN_LEVEL_B_LTA",(function(){return ye})),n.d(e,"EndUserPAdESSignLevel",(function(){return le})),n.d(e,"EndUserEventType",(function(){return fe})),n.d(e,"EU_SIGN_CONTAINER_TYPE_UNKNOWN",(function(){return Ce})),n.d(e,"EU_SIGN_CONTAINER_TYPE_CADES",(function(){return de})),n.d(e,"EU_SIGN_CONTAINER_TYPE_XADES",(function(){return Re})),n.d(e,"EU_SIGN_CONTAINER_TYPE_PADES",(function(){return me})),n.d(e,"EU_SIGN_CONTAINER_TYPE_ASIC",(function(){return Ae})),n.d(e,"EndUserSignContainerType",(function(){return Se}));var r,i=1,o=2,s=3;!function(t){t[t.JS=i]="JS",t[t.SW=o]="SW",t[t.MS=s]="MS"}(r||(r={}));var a,u=0,c=1,l=2,f=3,p=4;!function(t){t[t.Undifferenced=u]="Undifferenced",t[t.CA=c]="CA",t[t.CAServer=l]="CAServer",t[t.RAAdministrator=f]="RAAdministrator",t[t.EndUser=p]="EndUser"}(a||(a={}));var _,h=0,E=1,y=2,S=3;!function(t){t[t.Undifferenced=h]="Undifferenced",t[t.CMP=E]="CMP",t[t.TSP=y]="TSP",t[t.OCSP=S]="OCSP"}(_||(_={}));var C,d=0,R=1,m=2,A=4;!function(t){t[t.Unknown=d]="Unknown",t[t.DSTU4145=R]="DSTU4145",t[t.RSA=m]="RSA",t[t.ECDSA=A]="ECDSA"}(C||(C={}));var P,g=0,T=1,v=2,I=16;!function(t){t[t.Unknown=d]="Unknown",t[t.DigitalSignature=T]="DigitalSignature",t[t.NonRepudation=v]="NonRepudation",t[t.KeyAgreement=I]="KeyAgreement"}(P||(P={}));var U,b=1,D=2;!function(t){t[t.Revoke=b]="Revoke",t[t.Hold=D]="Hold"}(U||(U={}));var O,N=0,G=1,w=2;!function(t){t[t.Unknown=N]="Unknown",t[t.KeyCompromise=G]="KeyCompromise",t[t.NewIssued=w]="NewIssued"}(O||(O={}));var M,L=0,K=1,x=2;!function(t){t[t.None=L]="None",t[t.DSTUAndECDHWithGOST=K]="DSTUAndECDHWithGOST",t[t.RSAWithSHA=x]="RSAWithSHA"}(M||(M={}));var k,B=1,F=2,Y=3,j=4,H=5;!function(t){t[t.EC_191=B]="EC_191",t[t.EC_257=F]="EC_257",t[t.EC_307=Y]="EC_307",t[t.File=j]="File",t[t.Cert=H]="Cert"}(k||(k={}));var V,W=1,X=2,z=3,J=4,q=5;!function(t){t[t.EC_257=W]="EC_257",t[t.EC_431=X]="EC_431",t[t.EC_571=z]="EC_571",t[t.File=j]="File",t[t.Cert=H]="Cert"}(V||(V={}));var Z,Q=1,$=2,tt=3,et=4,nt=5,rt=6;!function(t){t[t.N_1024=Q]="N_1024",t[t.N_2048=$]="N_2048",t[t.N_3072=tt]="N_3072",t[t.N_4096=et]="N_4096",t[t.File=j]="File",t[t.Cert=H]="Cert"}(Z||(Z={}));var it,ot=1,st=2,at=3;!function(t){t[t.uaDS=ot]="uaDS",t[t.uaKEP=st]="uaKEP",t[t.intRSA=at]="intRSA"}(it||(it={}));var ut,ct=1,lt=2,ft=3;!function(t){t[t.Kyivstar=ct]="Kyivstar",t[t.Vodafone=lt]="Vodafone",t[t.Lifecell=ft]="Lifecell"}(ut||(ut={}));var pt,_t,ht=4,Et=5,yt=6,St=7;!function(t){t[t.Kyivstar=ct]="Kyivstar",t[t.Vodafone=lt]="Vodafone",t[t.Lifecell=ft]="Lifecell",t[t.IIT=ht]="IIT",t[t.UKey=Et]="UKey",t[t.PB=yt]="PB",t[t.DIIA=St]="DIIA"}(pt||(pt={})),function(t){t[t.Default=0]="Default",t[t.Name=1]="Name",t[t.Phone=2]="Phone",t[t.Email=3]="Email"}(_t||(_t={}));var Ct,dt=0,Rt=1,mt=4,At=8,Pt=16,gt=128;!function(t){t[t.Unknown=dt]="Unknown",t[t.CAdES_BES=Rt]="CAdES_BES",t[t.CAdES_T=mt]="CAdES_T",t[t.CAdES_C=At]="CAdES_C",t[t.CAdES_X_Long=Pt]="CAdES_X_Long",t[t.CAdES_X_Long_Trusted=gt]="CAdES_X_Long_Trusted"}(Ct||(Ct={}));var Tt,vt=0,It=1,Ut=3;!function(t){t[t.Unknown=vt]="Unknown",t[t.Detached=It]="Detached",t[t.Enveloped=Ut]="Enveloped"}(Tt||(Tt={}));var bt,Dt=0,Ot=1,Nt=2,Gt=3;!function(t){t[t.Unknown=Dt]="Unknown",t[t.DSTU4145WithGOST34311=Ot]="DSTU4145WithGOST34311",t[t.RSAWithSHA=Nt]="RSAWithSHA",t[t.ECDSAWithSHA=Gt]="ECDSAWithSHA"}(bt||(bt={}));var wt,Mt="SignType",Lt="CheckPrivateKey",Kt="1.2.804.2.1.1.1.3.9",xt=3;!function(t){t[t.None=0]="None",t[t.DownloadEUCerts=1]="DownloadEUCerts",t[t.SearchEUCerts=2]="SearchEUCerts"}(wt||(wt={}));var kt,Bt=0,Ft=1,Yt=2,jt=3,Ht=4;!function(t){t[t.Unknown=Bt]="Unknown",t[t.GOST34311=Ft]="GOST34311",t[t.SHA160=Yt]="SHA160",t[t.SHA224=jt]="SHA224",t[t.SHA256=Ht]="SHA256"}(kt||(kt={}));var Vt,Wt=0,Xt=1,zt=2;!function(t){t[t.Unknown=Wt]="Unknown",t[t.S=Xt]="S",t[t.E=zt]="E"}(Vt||(Vt={}));var Jt,qt=0,Zt=1,Qt=2;!function(t){t[t.Unknown=qt]="Unknown",t[t.CAdES=Zt]="CAdES",t[t.XAdES=Qt]="XAdES"}(Jt||(Jt={}));var $t,te=0,ee=1,ne=2,re=3;!function(t){t[t.Unknown=te]="Unknown",t[t.Detached=ee]="Detached",t[t.Enveloping=ne]="Enveloping",t[t.Enveloped=re]="Enveloped"}($t||($t={}));var ie,oe=0,se=1,ae=4,ue=16,ce=32;!function(t){t[t.Unknown=oe]="Unknown",t[t.B_B=se]="B_B",t[t.B_T=ae]="B_T",t[t.B_LT=ue]="B_LT",t[t.B_LTA=ce]="B_LTA"}(ie||(ie={}));var le,fe,pe=0,_e=1,he=4,Ee=16,ye=32;!function(t){t[t.Unknown=oe]="Unknown",t[t.B_B=_e]="B_B",t[t.B_T=he]="B_T",t[t.B_LT=Ee]="B_LT",t[t.B_LTA=ye]="B_LTA"}(le||(le={})),function(t){t[t.None=0]="None",t[t.All=1]="All",t[t.ConfirmKSPOperation=2]="ConfirmKSPOperation"}(fe||(fe={}));var Se,Ce=0,de=1,Re=2,me=3,Ae=4;!function(t){t[t.Unknown=Ce]="Unknown",t[t.CAdES=de]="CAdES",t[t.XAdES=Re]="XAdES",t[t.PAdES=me]="PAdES",t[t.ASiC=Ae]="ASiC"}(Se||(Se={}))},function(t,e,n){"use strict";n.r(e),n.d(e,"EU_ERROR_NONE",(function(){return r})),n.d(e,"EU_ERROR_UNKNOWN",(function(){return i})),n.d(e,"EU_ERROR_NOT_SUPPORTED",(function(){return o})),n.d(e,"EU_ERROR_NOT_INITIALIZED",(function(){return s})),n.d(e,"EU_ERROR_BAD_PARAMETER",(function(){return a})),n.d(e,"EU_ERROR_LIBRARY_LOAD",(function(){return u})),n.d(e,"EU_ERROR_READ_SETTINGS",(function(){return c})),n.d(e,"EU_ERROR_TRANSMIT_REQUEST",(function(){return l})),n.d(e,"EU_ERROR_MEMORY_ALLOCATION",(function(){return f})),n.d(e,"EU_WARNING_END_OF_ENUM",(function(){return p})),n.d(e,"EU_ERROR_PROXY_NOT_AUTHORIZED",(function(){return _})),n.d(e,"EU_ERROR_NO_GUI_DIALOGS",(function(){return h})),n.d(e,"EU_ERROR_DOWNLOAD_FILE",(function(){return E})),n.d(e,"EU_ERROR_WRITE_SETTINGS",(function(){return y})),n.d(e,"EU_ERROR_CANCELED_BY_GUI",(function(){return S})),n.d(e,"EU_ERROR_OFFLINE_MODE",(function(){return C})),n.d(e,"EU_ERROR_KEY_MEDIAS_FAILED",(function(){return d})),n.d(e,"EU_ERROR_KEY_MEDIAS_ACCESS_FAILED",(function(){return R})),n.d(e,"EU_ERROR_KEY_MEDIAS_READ_FAILED",(function(){return m})),n.d(e,"EU_ERROR_KEY_MEDIAS_WRITE_FAILED",(function(){return A})),n.d(e,"EU_WARNING_KEY_MEDIAS_READ_ONLY",(function(){return P})),n.d(e,"EU_ERROR_KEY_MEDIAS_DELETE",(function(){return g})),n.d(e,"EU_ERROR_KEY_MEDIAS_CLEAR",(function(){return T})),n.d(e,"EU_ERROR_BAD_PRIVATE_KEY",(function(){return v})),n.d(e,"EU_ERROR_PKI_FORMATS_FAILED",(function(){return I})),n.d(e,"EU_ERROR_CSP_FAILED",(function(){return U})),n.d(e,"EU_ERROR_BAD_SIGNATURE",(function(){return b})),n.d(e,"EU_ERROR_AUTH_FAILED",(function(){return D})),n.d(e,"EU_ERROR_NOT_RECEIVER",(function(){return O})),n.d(e,"EU_ERROR_STORAGE_FAILED",(function(){return N})),n.d(e,"EU_ERROR_BAD_CERT",(function(){return G})),n.d(e,"EU_ERROR_CERT_NOT_FOUND",(function(){return w})),n.d(e,"EU_ERROR_INVALID_CERT_TIME",(function(){return M})),n.d(e,"EU_ERROR_CERT_IN_CRL",(function(){return L})),n.d(e,"EU_ERROR_BAD_CRL",(function(){return K})),n.d(e,"EU_ERROR_NO_VALID_CRLS",(function(){return x})),n.d(e,"EU_ERROR_GET_TIME_STAMP",(function(){return k})),n.d(e,"EU_ERROR_BAD_TSP_RESPONSE",(function(){return B})),n.d(e,"EU_ERROR_TSP_SERVER_CERT_NOT_FOUND",(function(){return F})),n.d(e,"EU_ERROR_TSP_SERVER_CERT_INVALID",(function(){return Y})),n.d(e,"EU_ERROR_GET_OCSP_STATUS",(function(){return j})),n.d(e,"EU_ERROR_BAD_OCSP_RESPONSE",(function(){return H})),n.d(e,"EU_ERROR_CERT_BAD_BY_OCSP",(function(){return V})),n.d(e,"EU_ERROR_OCSP_SERVER_CERT_NOT_FOUND",(function(){return W})),n.d(e,"EU_ERROR_OCSP_SERVER_CERT_INVALID",(function(){return X})),n.d(e,"EU_ERROR_LDAP_ERROR",(function(){return z})),n.d(e,"EndUserError",(function(){return J}));var r=0,i=65535,o=65534,s=1,a=2,u=3,c=4,l=5,f=6,p=7,_=8,h=9,E=10,y=11,S=12,C=13,d=17,R=18,m=19,A=20,P=21,g=22,T=23,v=24,I=33,U=34,b=35,D=36,O=37,N=49,G=50,w=51,M=52,L=53,K=54,x=55,k=65,B=66,F=67,Y=68,j=81,H=82,V=83,W=84,X=85,z=97,J=function(){}},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var r=n(8),i=n(10),o=n(4),s=function(){function t(){}return t.MapFromKeyMedia=function(t,e){return e.SetTypeIndex(t.typeIndex),e.SetDevIndex(t.devIndex),e.SetPassword(t.user?"##"+t.user+"##"+t.password:t.password),e},t.MapToProxySettings=function(t,e){return e.useProxy=t.GetUseProxy(),e.address=t.GetAddress(),e.port=t.GetPort(),e.anonymous=t.GetAnonymous(),e.user=t.GetUser(),e.password=t.GetPassword(),e.savePassword=t.GetSavePassword(),e},t.MapFromProxySettings=function(t,e){return e.SetUseProxy(t.useProxy),e.SetAddress(t.address),e.SetPort(t.port),e.SetAnonymous(t.anonymous),e.SetUser(t.user),e.SetPassword(t.password),e.SetSavePassword(t.savePassword),e},t.MapEndUserOwnerInfo=function(t,e){return e.isFilled=t.IsFilled(),e.issuer=t.GetIssuer(),e.issuerCN=t.GetIssuerCN(),e.serial=t.GetSerial(),e.subject=t.GetSubject(),e.subjCN=t.GetSubjCN(),e.subjOrg=t.GetSubjOrg(),e.subjOrgUnit=t.GetSubjOrgUnit(),e.subjTitle=t.GetSubjTitle(),e.subjState=t.GetSubjState(),e.subjLocality=t.GetSubjLocality(),e.subjFullName=t.GetSubjFullName(),e.subjAddress=t.GetSubjAddress(),e.subjPhone=t.GetSubjPhone(),e.subjEMail=t.GetSubjEMail(),e.subjDNS=t.GetSubjDNS(),e.subjEDRPOUCode=t.GetSubjEDRPOUCode(),e.subjDRFOCode=t.GetSubjDRFOCode(),e},t.MapToEndUserCertificateInfoEx=function(t,e){return e.isFilled=t.IsFilled(),e.version=t.GetVersion(),e.issuer=t.GetIssuer(),e.issuerCN=t.GetIssuerCN(),e.serial=t.GetSerial(),e.subject=t.GetSubject(),e.subjCN=t.GetSubjCN(),e.subjOrg=t.GetSubjOrg(),e.subjOrgUnit=t.GetSubjOrgUnit(),e.subjTitle=t.GetSubjTitle(),e.subjState=t.GetSubjState(),e.subjLocality=t.GetSubjLocality(),e.subjFullName=t.GetSubjFullName(),e.subjAddress=t.GetSubjAddress(),e.subjPhone=t.GetSubjPhone(),e.subjEMail=t.GetSubjEMail(),e.subjDNS=t.GetSubjDNS(),e.subjEDRPOUCode=t.GetSubjEDRPOUCode(),e.subjDRFOCode=t.GetSubjDRFOCode(),e.subjNBUCode=t.GetSubjNBUCode(),e.subjSPFMCode=t.GetSubjSPFMCode(),e.subjOCode=t.GetSubjOCode(),e.subjOUCode=t.GetSubjOUCode(),e.subjUserCode=t.GetSubjUserCode(),e.certBeginTime=t.GetCertBeginTime(),e.certEndTime=t.GetCertEndTime(),e.isPrivKeyTimesAvail=t.IsPrivKeyTimesAvail(),e.privKeyBeginTime=t.GetPrivKeyBeginTime(),e.privKeyEndTime=t.GetPrivKeyEndTime(),e.publicKeyBits=t.GetPublicKeyBits(),e.publicKey=t.GetPublicKey(),e.publicKeyID=t.GetPublicKeyID(),e.issuerPublicKeyID=t.GetIssuerPublicKeyID(),e.keyUsage=t.GetKeyUsage(),e.extKeyUsages=t.GetExtKeyUsages(),e.policies=t.GetPolicies(),e.crlDistribPoint1=t.GetCRLDistribPoint1(),e.crlDistribPoint2=t.GetCRLDistribPoint2(),e.isPowerCert=t.IsPowerCert(),e.isSubjTypeAvail=t.IsSubjTypeAvail(),e.isSubjCA=t.IsSubjCA(),e.chainLength=t.GetChainLength(),e.UPN=t.GetUPN(),e.publicKeyType=t.GetPublicKeyType(),e.keyUsageType=t.GetKeyUsageType(),e.RSAModul=t.GetRSAModul(),e.RSAExponent=t.GetRSAExponent(),e.OCSPAccessInfo=t.GetOCSPAccessInfo(),e.issuerAccessInfo=t.GetIssuerAccessInfo(),e.TSPAccessInfo=t.GetTSPAccessInfo(),e.isLimitValueAvailable=t.IsLimitValueAvail(),e.limitValue=t.GetLimitValue(),e.limitValueCurrency=t.GetLimitValueCurrency(),e.subjType=t.GetSubjType(),e.subjSubType=t.GetSubjSubType(),e.subjUNZR=t.GetSubjUNZR(),e.subjCountry=t.GetSubjCountry(),e.isQSCD=t.IsQSCD(),e.subjUserID=t.GetSubjUserID(),e},t.MapToEndUserParams=function(t,e){return e.SN=t.GetSN(),e.commonName=t.GetCommonName(),e.locality=t.GetLocality(),e.state=t.GetState(),e.organization=t.GetOrganization(),e.orgUnit=t.GetOrgUnit(),e.title=t.GetTitle(),e.street=t.GetStreet(),e.phone=t.GetPhone(),e.surname=t.GetSurname(),e.givenname=t.GetGivenname(),e.EMail=t.GetEMail(),e.DNS=t.GetDNS(),e.EDRPOUCode=t.GetEDRPOUCode(),e.DRFOCode=t.GetDRFOCode(),e.NBUCode=t.GetNBUCode(),e.SPFMCode=t.GetSPFMCode(),e.information=t.GetInformation(),e.passPhrase=t.GetPassPhrase(),e.isPublishCertificate=t.GetIsPublishCertificate(),e.RAAdminSN=t.GetRAAdminSN(),e},t.MapToEndUserTimeInfo=function(t,e){return e.version=t.GetVersion(),e.isTimeAvail=t.IsTimeAvail(),e.isTimeStamp=t.IsTimeStamp(),e.time=t.GetTime(),e.isSignTimeStampAvail=t.IsSignTimeStampAvail(),e.signTimeStamp=t.GetSignTimeStamp(),e},t.MapToEndUserSignInfo=function(e,n){return n.ownerInfo=t.MapEndUserOwnerInfo(e.GetOwnerInfo(),new i.a),n.timeInfo=t.MapToEndUserTimeInfo(e.GetTimeInfo(),new o.EndUserTimeInfo),n.data=e.GetData(),n.signLevel=0,n},t.MapToEndUserSenderInfo=function(e,n){return n.ownerInfo=t.MapEndUserOwnerInfo(e.GetOwnerInfo(),new i.a),n.timeInfo=t.MapToEndUserTimeInfo(e.GetTimeInfo(),new o.EndUserTimeInfo),n.data=e.GetData(),n},t.MapToEndUserCertificate=function(e,n){return n.data=e.GetData(),n.infoEx=t.MapToEndUserCertificateInfoEx(e.GetInfoEx(),new r.a),n},t.MapFromEndUserInfo=function(t,e){return e.SetCommonName(t.commonName),e.SetLocality(t.locality),e.SetState(t.state),e.SetOrganization(t.organization),e.SetOrgUnit(t.orgUnit),e.SetTitle(t.title),e.SetStreet(t.street),e.SetPhone(t.phone),e.SetSurname(t.surname),e.SetGivenname(t.givenname),e.SetEMail(t.EMail),e.SetDNS(t.DNS),e.SetEDRPOUCode(t.EDRPOUCode),e.SetDRFOCode(t.DRFOCode),e.SetNBUCode(t.NBUCode),e.SetSPFMCode(t.SPFMCode),e.SetOCode(t.OCode),e.SetOUCode(t.OUCode),e.SetUserCode(t.userCode),e.SetUPN(t.UPN),e.SetUNZR(t.UNZR),e.SetCountry(t.country),e},t.MapToEndUserRequestInfo=function(t,e){return e.isFilled=!0,e.data=t.GetRequest(),e.type=t.GetRequestType(),e.fileName=t.GetDefaultRequestFileName(),e.isSimple=t.IsSimple(),e.subject=t.GetSubject(),e.subjCN=t.GetSubjCN(),e.subjOrg=t.GetSubjOrg(),e.subjOrgUnit=t.GetSubjOrgUnit(),e.subjTitle=t.GetSubjTitle(),e.subjState=t.GetSubjState(),e.subjLocality=t.GetSubjLocality(),e.subjFullName=t.GetSubjFullName(),e.subjAddress=t.GetSubjAddress(),e.subjPhone=t.GetSubjPhone(),e.subjEMail=t.GetSubjEMail(),e.subjDNS=t.GetSubjDNS(),e.subjEDRPOUCode=t.GetSubjEDRPOUCode(),e.subjDRFOCode=t.GetSubjDRFOCode(),e.subjNBUCode=t.GetSubjNBUCode(),e.subjSPFMCode=t.GetSubjSPFMCode(),e.subjOCode=t.GetSubjOCode(),e.subjOUCode=t.GetSubjOUCode(),e.subjUserCode=t.GetSubjUserCode(),e.certBeginTime=t.GetCertBeginTime(),e.certEndTime=t.GetCertEndTime(),e.isPrivKeyTimesAvail=t.IsPrivKeyTimesAvail(),e.privKeyBeginTime=t.GetPrivKeyBeginTime(),e.privKeyEndTime=t.GetPrivKeyEndTime(),e.publicKeyType=t.GetPublicKeyType(),e.publicKeyBits=t.GetPublicKeyBits(),e.RSAModul=t.GetRSAModul(),e.RSAExponent=t.GetRSAExponent(),e.publicKey=t.GetPublicKey(),e.publicKeyID=t.GetPublicKeyID(),e.extKeyUsages=t.GetExtKeyUsages(),e.crlDistribPoint1=t.GetCRLDistribPoint1(),e.crlDistribPoint2=t.GetCRLDistribPoint2(),e.isSubjTypeAvail=t.IsSubjTypeAvail(),e.subjType=t.GetSubjType(),e.subjSubType=t.GetSubjSubType(),e.isSelfSigned=t.IsSelfSigned(),e.signIssuer=t.GetSignIssuer(),e.signSerial=t.GetSignSerial(),e.subjUNZR=t.GetSubjUNZR(),e.subjCountry=t.GetSubjCountry(),e.isQSCD=t.IsQSCD(),e},t.MapToEndUserReference=function(t,e){return e.name=t.GetName(),e.val=t.GetData(),e},t.MapFromEndUserReference=function(t,e){return e.SetName(t.name),e.SetData(t.val),e},t}()},function(t,e,n){var r,i,o;i=[],void 0===(o="function"==typeof(r=function(){var t="https://chrome.google.com/webstore/detail/%D1%96%D1%96%D1%82-%D0%BA%D0%BE%D1%80%D0%B8%D1%81%D1%82%D1%83%D0%B2%D0%B0%D1%87-%D1%86%D1%81%D0%BA-1-%D0%B1%D1%96%D0%B1%D0%BB/jffafkigfgmjafhpkoibhfefeaebmccg?utm_source=chrome-app-launcher-info-dialog",e=function(){this.vendor="JSC IIT",this.classVersion=1,this.className="EndUserUTF8Coder"};e.prototype.encode=function(t){for(var e=[],n=0,r=0;r<t.length;r++){var i=t.charCodeAt(r);i<128?e[n++]=i:i<2048?(e[n++]=i>>6|192,e[n++]=63&i|128):(e[n++]=i>>12|224,e[n++]=i>>6&63|128,e[n++]=63&i|128)}return e},e.prototype.decode=function(t){for(var e,n,r,i=[],o=0,s=0;o<t.length;)(e=t[o++])<128?i[s++]=String.fromCharCode(e):e>191&&e<224?(n=t[o++],i[s++]=String.fromCharCode((31&e)<<6|63&n)):(n=t[o++],r=t[o++],i[s++]=String.fromCharCode((15&e)<<12|(63&n)<<6|63&r));return i.join("")};var n=function(){this.vendor="JSC IIT",this.classVersion=1,this.className="EndUserUTF16LECoder"};n.prototype.encode=function(t){for(var e,n=[],r=0;r<t.length;r++)e=t.charCodeAt(r),n.push(255&e),n.push((65280&e)>>8);return n},n.prototype.decode=function(t){var e,n=0,r="";if(t.length%2!=0)return null;for((e=t.length)>0&&0==t[e-2]&&0==t[e-1]&&(e-=2);n<e;)r+=String.fromCharCode(t[n]|t[n+1]<<8),n+=2;return r};var r=function(){this.vendor="JSC IIT",this.classVersion=1,this.className="EndUserCP1251Coder",this.m_cp1251_table={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,14:14,15:15,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,30:30,31:31,32:32,33:33,34:34,35:35,36:36,37:37,38:38,39:39,40:40,41:41,42:42,43:43,44:44,45:45,46:46,47:47,48:48,49:49,50:50,51:51,52:52,53:53,54:54,55:55,56:56,57:57,58:58,59:59,60:60,61:61,62:62,63:63,64:64,65:65,66:66,67:67,68:68,69:69,70:70,71:71,72:72,73:73,74:74,75:75,76:76,77:77,78:78,79:79,80:80,81:81,82:82,83:83,84:84,85:85,86:86,87:87,88:88,89:89,90:90,91:91,92:92,93:93,94:94,95:95,96:96,97:97,98:98,99:99,100:100,101:101,102:102,103:103,104:104,105:105,106:106,107:107,108:108,109:109,110:110,111:111,112:112,113:113,114:114,115:115,116:116,117:117,118:118,119:119,120:120,121:121,122:122,123:123,124:124,125:125,126:126,127:127,1027:129,8225:135,1046:198,8222:132,1047:199,1168:165,1048:200,1113:154,1049:201,1045:197,1050:202,1028:170,160:160,1040:192,1051:203,164:164,166:166,167:167,169:169,171:171,172:172,173:173,174:174,1053:205,176:176,177:177,1114:156,181:181,182:182,183:183,8221:148,187:187,1029:189,1056:208,1057:209,1058:210,8364:136,1112:188,1115:158,1059:211,1060:212,1030:178,1061:213,1062:214,1063:215,1116:157,1064:216,1065:217,1031:175,1066:218,1067:219,1068:220,1069:221,1070:222,1032:163,8226:149,1071:223,1072:224,8482:153,1073:225,8240:137,1118:162,1074:226,1110:179,8230:133,1075:227,1033:138,1076:228,1077:229,8211:150,1078:230,1119:159,1079:231,1042:194,1080:232,1034:140,1025:168,1081:233,1082:234,8212:151,1083:235,1169:180,1084:236,1052:204,1085:237,1035:142,1086:238,1087:239,1088:240,1089:241,1090:242,1036:141,1041:193,1091:243,1092:244,8224:134,1093:245,8470:185,1094:246,1054:206,1095:247,1096:248,8249:139,1097:249,1098:250,1044:196,1099:251,1111:191,1055:207,1100:252,1038:161,8220:147,1101:253,8250:155,1102:254,8216:145,1103:255,1043:195,1105:184,1039:143,1026:128,1106:144,8218:130,1107:131,8217:146,1108:186,1109:190},this.m_ut8_table=unescape("%u0402%u0403%u201A%u0453%u201E%u2026%u2020%u2021%u20AC%u2030%u0409%u2039%u040A%u040C%u040B%u040F%u0452%u2018%u2019%u201C%u201D%u2022%u2013%u2014%u0000%u2122%u0459%u203A%u045A%u045C%u045B%u045F%u00A0%u040E%u045E%u0408%u00A4%u0490%u00A6%u00A7%u0401%u00A9%u0404%u00AB%u00AC%u00AD%u00AE%u0407%u00B0%u00B1%u0406%u0456%u0491%u00B5%u00B6%u00B7%u0451%u2116%u0454%u00BB%u0458%u0405%u0455%u0457")};r.prototype.encode=function(t){for(var e=[],n=0;n<t.length;n++){var r=t.charCodeAt(n);if(!(r in this.m_cp1251_table))throw"Character "+t.charAt(n)+" isn't supported by win1251!";e.push(this.m_cp1251_table[r])}return e},r.prototype.decode=function(t){for(var e,n="",r=0;r<t.length;r++)n+=(e=t[r])>=192&&e<=255?String.fromCharCode(e-192+1040):e>=128&&e<=191?this.m_ut8_table.charAt(e-128):String.fromCharCode(e);return n};var i={GetCoder:function(t){switch(t=t.toUpperCase()){case"UTF-8":return new e;case"UTF-16LE":return new n;case"windows-1251":return new r;default:return null}},ArrayToString:function(t,e){var n,r;if(void 0===t&&(t="UTF-8"),null==(n=i.GetCoder(t)))throw new et(r=tt.ERROR_BAD_PARAMETER,tt.getErrorDescriptionEx(r,0));return n.decode(e)}},o=function(){this.vendor="JSC IIT",this.classVersion=1,this.className="EndUserDateCoder",this.dateDelimeter=".",this.timeDelimeter=":",this.dateTimeDelimeter=" ",this.format="dd.MM.yyyy HH:mm:ss"};o.prototype.encode=function(t){var e=t.getDate(),n=t.getMonth()+1,r=t.getFullYear(),i=t.getHours(),o=t.getMinutes(),s=t.getSeconds();return e+this.dateDelimeter+n+this.dateDelimeter+r+this.dateTimeDelimeter+i+this.timeDelimeter+o+this.timeDelimeter+s},o.prototype.decode=function(t){try{var e=t.split(this.dateTimeDelimeter),n=e[0].split(this.dateDelimeter),r=e[1].split(this.timeDelimeter),i=parseInt(n[0]),o=parseInt(n[1])-1,s=parseInt(n[2]);if(i<0||i>31||o<0||o>12||s<0)return null;var a=parseInt(r[0]),u=parseInt(r[1]),c=parseInt(r[2]);return a<0||a>23||u<0||u>59||c<0||c>59?null:new Date(s,o,i,a,u,c,0)}catch(t){return null}};var s=function(){this.vendor="JSC IIT",this.classVersion=1,this.className="EndUserBase64Coder",this.m_map="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",this.m_codes=[65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,48,49,50,51,52,53,54,55,56,57,43,47]};s.prototype._getTextDecoder=function(){try{if("undefined"==typeof TextDecoder)return null;var t=new TextDecoder("utf-8");return"utf-8"!=t.encoding?null:t}catch(t){return null}},s.prototype._encodePart=function(t,e,n){for(var r,i,o=[],s=e;s<n;s+=3)r=t[s]<<16|t[s+1]<<8|t[s+2],i=this.m_map[r>>18&63]+this.m_map[r>>12&63]+this.m_map[r>>6&63]+this.m_map[63&r],o.push(i);return o.join("")},s.prototype.encode=function(t){var e,n,r,i,o,s,a="";if(0==(o=(e="undefined"==typeof Uint8Array?void 0===h?t.slice(0):new h(t):new Uint8Array(t)).length))return"";var u=this._getTextDecoder();if(null!=u){for(s=new Uint8Array(4*parseInt((o+2)/3)),n=0,r=0;n<o-o%3;n+=3,r+=4)i=e[n]<<16|e[n+1]<<8|e[n+2],s[r]=this.m_codes[i>>18&63],s[r+1]=this.m_codes[i>>12&63],s[r+2]=this.m_codes[i>>6&63],s[r+3]=this.m_codes[63&i];switch(o%3){case 1:i=e[n]<<16,s[r]=this.m_codes[i>>18&63],s[r+1]=this.m_codes[i>>12&63],s[r+2]=61,s[r+3]=61;break;case 2:i=e[n]<<16|e[n+1]<<8,s[r]=this.m_codes[i>>18&63],s[r+1]=this.m_codes[i>>12&63],s[r+2]=this.m_codes[i>>6&63],s[r+3]=61}a=u.decode(s)}else{var c,l=null,f=o-o%3,p=parseInt(f/15360);for(s=[],n=0;n<p;n++)l=this._encodePart(e,15360*n,15360*n+15360),s.push(l);switch(15360*p<f&&(l=this._encodePart(e,15360*n,f),s.push(l)),o%3){case 1:i=e[o-1]<<16,c=this.m_map[i>>18&63],c+=this.m_map[i>>12&63],c+="=",c+="=",s.push(c);break;case 2:i=e[o-2]<<16|e[o-1]<<8,c=this.m_map[i>>18&63],c+=this.m_map[i>>12&63],c+=this.m_map[i>>6&63],c+="=",s.push(c)}a=s.join("")}return a},s.prototype.decode=function(t){var e,n,r,i,o,s,a,u,c,l,f;if(""==t||(3&t.length)>0)return"undefined"==typeof Uint8Array?void 0===h?[]:new h(0):new Uint8Array(0);for(n=(s=t.length)/4*3-(a="="==t[s-1]?"="==t[s-2]?2:1:0),e="undefined"==typeof Uint8Array?void 0===h?[]:new h(n):new Uint8Array(n),r=0,i=0,o=0;r<Math.floor((s-a)/4);r++)u=this.m_map.indexOf(t[i++]),c=this.m_map.indexOf(t[i++]),l=this.m_map.indexOf(t[i++]),f=this.m_map.indexOf(t[i++]),e[o++]=u<<2|c>>4,e[o++]=(15&c)<<4|l>>2,e[o++]=(3&l)<<6|63&f;switch(a){case 2:u=this.m_map.indexOf(t[i]),c=this.m_map.indexOf(t[i+1]),e[o++]=u<<2|c>>4;break;case 1:u=this.m_map.indexOf(t[i]),c=this.m_map.indexOf(t[i+1]),l=this.m_map.indexOf(t[i+2]),e[o++]=u<<2|c>>4,e[o++]=(15&c)<<4|l>>2}return e};var a=function(t){return new function(){var e=this,n=function(){var t;e.deferred.length&&((t=[].slice.call(arguments)).unshift(n),e.deferred[0].apply(e,t),e.deferred.shift())};this.deferred=[],this.eu_wait=function(t){return this.deferred.push(t),e},t(n)}},u=function(){var t=this._getBrowserInfo();this.m_name=t.name,this.m_version=t.version,this.m_arch=this._getArch(),this.m_os_name=this._getOSName()};u.BROWSER_NAME_IE="IE",u.BROWSER_NAME_OPERA="Opera",u.BROWSER_NAME_CHROME="Chrome",u.BROWSER_NAME_FIREFOX="Firefox",u.BROWSER_NAME_SAFARI="Safari",u.BROWSER_NAME_EDGE="Edge",u.BROWSER_NAME_UNKNOWN="Unknown",u.OS_NAME_WINDOWS="Windows",u.OS_NAME_LINUX="Linux",u.OS_NAME_UNIX="Unix",u.OS_NAME_MAC="Mac OS X",u.OS_NAME_ANDROID="Android",u.OS_NAME_UNKNOWN="Unknown",u.BROWSER_ARCH_NAME_X86="x86",u.BROWSER_ARCH_NAME_X64="x64",u.BROWSER_ARCH_NAME_ARM="arm",u.BROWSER_ARCH_NAME_UNKNOWN="Unknown",u.prototype._getBrowserInfo=function(){var t,e={name:u.BROWSER_NAME_UNKNOWN,version:""},n=navigator.userAgent,r=n.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i)||[];return/msie/i.test(r[1])||/trident/i.test(r[1])?(e.name=u.BROWSER_NAME_IE,/msie/i.test(r[1])?e.version=parseInt(r[2]):(t=/\brv[ :]+(\d+)/g.exec(n)||[],e.version=parseInt(t[1])),e):"Chrome"===r[1]&&null!=(t=n.match(/\b(OPR|Edge)\/(\d+)/))?(e.name=t[1].replace("OPR",u.BROWSER_NAME_OPERA),e.version=parseInt(t[2]),e):(r=r[2]?[r[1],r[2]]:[navigator.appName,navigator.appVersion,"-?"],null!=(t=n.match(/version\/(\d+)/i))&&r.splice(1,1,t[1]),e.name=r[0],e.version=parseInt(r[1]),e)},u.prototype._getOSName=function(){var t=navigator.platform||"",e=(navigator.userAgent||"").toLowerCase();return-1!=t.indexOf("Win")?u.OS_NAME_WINDOWS:-1!=t.indexOf("Mac")?u.OS_NAME_MAC:-1!=t.indexOf("Android")||-1!=e.indexOf("android")?u.OS_NAME_ANDROID:-1!=t.indexOf("Linux")?u.OS_NAME_LINUX:-1!=t.indexOf("FreeBSD")?u.OS_NAME_UNIX:u.OS_NAME_UNKNOWN},u.prototype._getArch=function(){var t,e=navigator.platform||"";switch(this._getOSName()){case u.OS_NAME_WINDOWS:t=-1!=e.indexOf("Win32")?u.BROWSER_ARCH_NAME_X86:u.BROWSER_ARCH_NAME_X64;break;case u.OS_NAME_MAC:t=-1!=e.indexOf("MacIntel")?u.BROWSER_ARCH_NAME_X86:u.BROWSER_ARCH_NAME_X64;break;case u.OS_NAME_UNIX:case u.OS_NAME_LINUX:case u.OS_NAME_ANDROID:t=-1!=e.indexOf("armv")?u.BROWSER_ARCH_NAME_ARM:-1!=e.indexOf("x86_64")?u.BROWSER_ARCH_NAME_X64:u.BROWSER_ARCH_NAME_X32;break;default:t=u.BROWSER_ARCH_NAME_UNKNOWN}return t},u.prototype.GetName=function(){return this.m_name},u.prototype.GetVersion=function(){return this.m_version},u.prototype.GetArch=function(){return this.m_arch},u.prototype.GetOSName=function(){return this.m_os_name};var c=[];c[0]="Executed successfully",c[-1]="Unknown error",c[-32300]="Transport error",c[-32400]="System error",c[-32500]="Application error",c[-32510]="Application error. Invalid session",c[-32600]="Server error. Invalid rpc. Not conforming to spec",c[-32601]="Server error. Requested method not found",c[-32602]="Server error. Invalid method parameters",c[-32603]="Server error. Internal rpc error",c[-32700]="Parse error. Not well formed",c[-32701]="Parse error. Unsupported encoding",c[-32702]="Parse error. Invalid character for encoding";var l=function(t,e,n,r){switch(this.Vendor="JSC IIT",this.ClassVersion="1.0.2",this.ClassName="JSONRPCClient",this.m_type=t,this.m_log=!1,this._logFunction("Initialize",arguments,["type","address","port","useHttps"]),t){case 2:this.m_uri=e,this.m_callbacks=[],this._registerOnExtensionRecieveEventHandler();break;case 3:case 4:this.m_uri=e,this.m_callbacks=[];break;case 1:default:this.m_uri="",r&&e.indexOf("https://")?this.m_uri+="https://":0!=e.indexOf("http://")&&(this.m_uri+="http://"),this.m_uri+=e+":"+n}this.m_requests=0,this.m_session_id=this._loadSessionId()};l.prototype._logFunction=function(t,e,n){if(this.m_log){for(var r="(",i=0;i<e.length;i++)r+=n[i]+": "+e[i].toString(),i!=e.length-1&&(r+=", ");r+=")",this._log(t,r)}},l.prototype._log=function(t,e){this.m_log&&console.log(t+": "+e)},l.prototype._loadSessionId=function(){try{var t=sessionStorage.getItem(this.ClassName+"session_id");return void 0===t||null==t||""==t?null:t}catch(t){return null}},l.prototype._saveSessionId=function(t){try{sessionStorage.setItem(this.ClassName+"session_id",t)}catch(t){}},l.prototype._removeSessionId=function(){try{sessionStorage.removeItem(this.ClassName+"session_id")}catch(t){}},l.prototype.createXMLHttpRequest=function(){return"undefined"==typeof XMLHttpRequest&&(XMLHttpRequest=function(){try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(t){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(t){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(t){}try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(t){}throw c[-32300]}),new XMLHttpRequest},l.prototype.makeRequest=function(t,e,n){var r=null;try{(r={}).jsonrpc="2.0",r.id=n,r.method=t,r.params=e,r.session_id=this.m_session_id,r=JSON.stringify(r)}catch(t){}return r},l.prototype.verifyResponse=function(t,e){try{if("2.0"!=e.jsonrpc)return!1;var n=e.error;if(void 0===n){if(e.id!=t||void 0===e.result)return!1}else{if(void 0===n.code||void 0===n.message)return!1;if(0!=n.code)return!1}if(void 0!==e.session_id)if(null!=this.m_session_id&&null!=e.session_id){if(this.m_session_id!=e.session_id)return!1}else this.m_session_id=e.session_id,this._saveSessionId(this.m_session_id);return!0}catch(t){return!1}},l.prototype.handleResponse=function(t,e){try{return e=JSON.parse(e),this.verifyResponse(t,e)?e:(this.m_session_id=null,this._removeSessionId(),null)}catch(t){return null}},l.prototype._sendHttp=function(t,e,n){var r,i,o=this;try{if((r=this.createXMLHttpRequest()).open("POST",this.m_uri,null!=n),r.setRequestHeader("Content-Type","application/json-rpc"),null!=n&&(r.onload=function(){200==r.status?(i=o.handleResponse(e,r.response),n(null!=i?i.result:null)):n(null)},r.onerror=function(){n(null)}),r.send(t),null!=n)return;return 200!=r.status||null==(i=this.handleResponse(e,r.response))?null:i.result}catch(t){if(null==n)return null;n(null)}},l.prototype._registerOnExtensionRecieveEventHandler=function(){var t=this;window.addEventListener("message",(function(e){if(e.data.sender==t.m_uri)try{var n=e.data.callback_id,r=t.m_callbacks[n-1];delete t.m_callbacks[n-1],t._logFunction("_registerOnExtensionRecieveEventHandler",[r.request_id,e.data.data],["request_id","data"]);var i=t.handleResponse(r.request_id,e.data.data);if(null==i)return void r.callback(null);r.callback(i.result)}catch(t){}}),!1)},l.prototype._sendExtension=function(t,e,n){var r=this;if(r._logFunction("_sendExtension",[arguments[0],arguments[1]],["request","request_id"]),!n)throw"Synchronous calls for web extensions not supported";if(1==document.getElementsByClassName(r.m_uri).length)try{var i={request_id:e,callback:n},o=r.m_callbacks.push(i),s={sender:r.ClassName,request:t,callback_id:o};window.postMessage(s,"*")}catch(t){n(null)}else n(null)},l.prototype._getPluginObject=function(){try{for(var t=document.getElementsByTagName("object"),e=0;e<t.length;e++){var n=t[e].classid;if(!n&&t[e].attributes&&t[e].attributes.classid&&(n=t[e].attributes.classid.value),n===this.m_uri)return t[e]}return null}catch(t){return null}},l.prototype._sendPlugin=function(t,e,n){var r,o=this;o._logFunction("_sendPlugin",[arguments[0],arguments[1]],["request","request_id"]);var a=o._getPluginObject();if(null==a)return null!=n&&n(null),null;var u=function(t){try{for(var e=new s,n=new h(0);;){var r=a.ProcessData(t),o=r.slice(0,5),u=r.slice(5,r.length-1);if(null!=u||""!=u){var c=e.decode(u),l=new h(n.length+c.length);l.set(n),l.set(c,n.length),n=l}switch(o){case'"part':t='"next"';continue;case'"last':return i.ArrayToString("UTF-8",n);default:return null}}}catch(t){return null}};try{return null!=n?void setTimeout((function(){r=u(t),o._logFunction("_sendPlugin",[e,r],["request_id","response"]),null!=(r=o.handleResponse(e,r))?n(r.result):n(null)}),1):(r=u(t),null==(r=o.handleResponse(e,r))?null:r.result)}catch(t){n(null)}},l.prototype.send=function(t,e,n){switch(this.m_type){case 1:return this._sendHttp(t,e,n);case 2:return this._sendExtension(t,e,n);case 3:case 4:return this._sendPlugin(t,e,n)}},l.prototype.execute=function(t,e,n){var r,i;return r=this.m_requests,this.m_requests++,null==(i=this.makeRequest(t,e,r))?null!=n?void n(null):null:null==n?this.send(i,r,n):void this.send(i,r,n)};var f=function(){};f.WEB_LIBRARY_OS_NOT_SUPPORTED=131072,f.WEB_LIBRARY_NOT_INSTALLED_OR_RUN=131073,f.WEB_LIBRARY_JAVA_APPLET_NOT_LOADED=131074,f.WEB_LIBRARY_INSTALLED_VERSION_NOT_SUPPORTED=131075,f.WEB_LIBRARY_INSTALL_PACKAGE=131076,f.WEB_LIBRARY_UPDATE_PACKAGE=131077,f.WEB_LIBRARY_USER_MANUAL=131078,f.WEB_LIBRARY_WEB_EXTENSION_INSTALL_PACKAGE=131079,f.WEB_LIBRARY_CHECK_JRE_VERSION=131080,f.WEB_LIBRARY_WEB_EXTENSION_NOT_INSTALLED_OR_RUN=131081,(f.DESCRIPTIONS=[])[f.WEB_LIBRARY_OS_NOT_SUPPORTED]=["Інсталяційний пакет web-бібліотеки підпису для вашої системи відсутній","Инсталяционный пакет web-библиотеки подписи для вашей системы отсутствует","The installation package of the library for the web signature for your system is absent"],f.DESCRIPTIONS[f.WEB_LIBRARY_NOT_INSTALLED_OR_RUN]=["Бібліотеку web-підпису не запущено або не інстальовано у системі. Для продовження необхідно запустити або інсталювати бібліотеку web-підпису.","Библиотеку web-подписи не запущено или не установлено в системе. Для продолжения необходимо запустить или установить библиотеку web-подписи.","The library for the web signature isn't started or not installed in system. To continue, it is necessary to start or install library for the web signature."],f.DESCRIPTIONS[f.WEB_LIBRARY_INSTALLED_VERSION_NOT_SUPPORTED]=["Інстальована версія web-бібліотеки підпису більше не підтримується. Для продовження необхідно інсталювати оновлену версію web-бібліотеки підпису.","Инсталированная версия web-библиотеки подписи больше не поддерживается. Для продолжения необходимо установить обновленную версию web-библиотеки подписи.","The installed version of library for the web signature isn't supported any more. To continue, it is necessary to install the updated version of the library for the web signature."],f.DESCRIPTIONS[f.WEB_LIBRARY_JAVA_APPLET_NOT_LOADED]=["Java-апплет не завантажено. Необхідно перевірити версію JRE","Java-апплет не загружен. Необходимо проверить версию JRE","Java applet isn't loaded. It is necessary to check the version of JRE"],f.DESCRIPTIONS[f.WEB_LIBRARY_INSTALL_PACKAGE]=["Інсталяційний пакет web-бібліотеки підпису","Инсталяционный пакет web-библиотеки подписи","Install package of library for the web signature"],f.DESCRIPTIONS[f.WEB_LIBRARY_UPDATE_PACKAGE]=["Оновлення web-бібліотеки підпису","Обновление web-библиотеки подписи","Update of library for the web signature"],f.DESCRIPTIONS[f.WEB_LIBRARY_USER_MANUAL]=["Настанова користувача","Руководство пользователя","User manual"],f.DESCRIPTIONS[f.WEB_LIBRARY_WEB_EXTENSION_INSTALL_PACKAGE]=["Інсталяційний пакет бібліотеки підпису (web-розширення)","Инсталяционный пакет библиотеки подписи (web-расширение)","Install package of library for the web signature (web-extension)"],f.DESCRIPTIONS[f.WEB_LIBRARY_CHECK_JRE_VERSION]=["Перевірити версію JRE","Проверить версию JRE","Check JRE version"],f.DESCRIPTIONS[f.WEB_LIBRARY_WEB_EXTENSION_NOT_INSTALLED_OR_RUN]=["Веб-розширення для роботи бібліотеки web-підпису не запущено або не інстальовано в браузері. Для продовження необхідно запустити або інсталювати веб-розширення.","Веб-расширение для работы библиотеки web-подписи не запущено или не установлено в браузере. Для продолжения необходимо запустить или установить веб-расширение.","The web extension for the web signature library is not running or installed in the browser. To continue, you need to run or install the web extension."],f.getString=function(t,e){var n,r;return void 0===(n=f.DESCRIPTIONS[t])&&(n=""),void 0===(r=n[e-1])?n[0]:r};var p=function(t,e,n,r,i){switch(this.m_id=e,this.m_library=null,this.m_language=n,this.m_supportedLibraryTypes=[],this.m_supportedLibraryTypesIndex=0,this.m_noJavaApplet=!1|r,this.m_webExtensionFirst=!1|i,this.m_errorResult=null,t){case p.LIBRARY_TYPE_JAVA_APPLET:case p.LIBRARY_TYPE_SIGN_AGENT:case p.LIBRARY_TYPE_WEB_EXTENSION:case p.LIBRARY_TYPE_NPAPI:case p.LIBRARY_TYPE_ACTIVE_X:this.m_libraryType=t;break;default:this.m_libraryType=p.LIBRARY_TYPE_DEFAULT}this.m_libraryType==p.LIBRARY_TYPE_DEFAULT?(this.m_webExtensionFirst&&p.isWebExtensionSupported()&&this.m_supportedLibraryTypes.push(p.LIBRARY_TYPE_WEB_EXTENSION),p.isSignAgentSupported()&&this.m_supportedLibraryTypes.push(p.LIBRARY_TYPE_SIGN_AGENT),!this.m_webExtensionFirst&&p.isWebExtensionSupported()&&this.m_supportedLibraryTypes.push(p.LIBRARY_TYPE_WEB_EXTENSION),p.isNPAPISupported()&&this.m_supportedLibraryTypes.push(p.LIBRARY_TYPE_NPAPI),p.isActiveXSupported()&&this.m_supportedLibraryTypes.push(p.LIBRARY_TYPE_ACTIVE_X),!this.m_noJavaApplet&&p.isJavaAppletSupported()&&this.m_supportedLibraryTypes.push(p.LIBRARY_TYPE_JAVA_APPLET)):this.m_supportedLibraryTypes.push(this.m_libraryType),this.onload=function(t){},this.onerror=function(t,e,n){},this.getLibraryType=function(){return this.m_libraryType}};p.LIBRARY_TYPE_DEFAULT=0,p.LIBRARY_TYPE_JAVA_APPLET=1,p.LIBRARY_TYPE_SIGN_AGENT=2,p.LIBRARY_TYPE_WEB_EXTENSION=3,p.LIBRARY_TYPE_NPAPI=4,p.LIBRARY_TYPE_ACTIVE_X=5,p.EU_DEFAULT_LANG=0,p.EU_UA_LANG=1,p.EU_RU_LANG=2,p.EU_EN_LANG=3,p.isJavaAppletSupported=function(){var t=new u;if(this.m_noJavaApplet)return!1;switch(t.GetName()){case u.BROWSER_NAME_FIREFOX:case u.BROWSER_NAME_CHROME:return!(t.GetVersion()>44);case u.BROWSER_NAME_OPERA:return!(t.GetVersion()>30);case u.BROWSER_NAME_EDGE:case u.BROWSER_NAME_UNKNOWN:return!1;default:return!0}},p.isSignAgentSupported=function(){var t=new u;switch(t.GetName()){case u.BROWSER_NAME_IE:if(t.GetVersion()<10)return!1;break;case u.BROWSER_NAME_SAFARI:if(t.GetVersion()<7)return!1;break;case u.BROWSER_NAME_UNKNOWN:return!1}switch(t.GetOSName()){case u.OS_NAME_WINDOWS:case u.OS_NAME_MAC:case u.OS_NAME_ANDROID:break;case u.OS_NAME_UNKNOWN:default:return!1}return!0},p.isWebExtensionSupported=function(){var t=new u;switch(t.GetName()){case u.BROWSER_NAME_CHROME:break;case u.BROWSER_NAME_OPERA:if(t.GetVersion()<35)return!1;break;case u.BROWSER_NAME_FIREFOX:if(t.GetVersion()<50)return!1;break;case u.BROWSER_NAME_UNKNOWN:default:return!1}switch(t.GetOSName()){case u.OS_NAME_ANDROID:case u.OS_NAME_UNKNOWN:return!1}return!0},p.isNPAPISupported=function(){var t=new u;switch(t.GetName()){case u.BROWSER_NAME_FIREFOX:if(t.GetVersion()>51)return!1;break;default:return!1}return!0},p.isActiveXSupported=function(){var t=new u;switch(t.GetName()){case u.BROWSER_NAME_IE:if(t.GetVersion()<9||t.GetArch()==u.BROWSER_ARCH_NAME_X64)return!1;break;default:return!1}return!0},p.isWebExtensionInstalled=function(){var t=(new u).GetName()==u.BROWSER_NAME_FIREFOX?"eusw@iit.com.ua":"chrome-extension://jffafkigfgmjafhpkoibhfefeaebmccg/";return 1==document.getElementsByClassName(t).length},p.prototype.getLibraryType=function(){return this.m_libraryType},p.prototype.load=function(){var t=this;setTimeout((function(){t._load(t.m_supportedLibraryTypes[t.m_supportedLibraryTypesIndex])}),1)},p.prototype.unload=function(){var t=document.getElementById(this.m_id);t&&t.parentNode&&t.parentNode.removeChild(t)},p.prototype._load=function(t){switch(t){case p.LIBRARY_TYPE_JAVA_APPLET:return void this._loadSignApplet();case p.LIBRARY_TYPE_SIGN_AGENT:return void this._loadSignAgent();case p.LIBRARY_TYPE_WEB_EXTENSION:return void this._loadWebExtension();case p.LIBRARY_TYPE_NPAPI:return void this._loadNPAPI();case p.LIBRARY_TYPE_ACTIVE_X:return void this._loadActiveX()}},p.prototype._onLoad=function(){this.m_libraryType=this.m_supportedLibraryTypes[this.m_supportedLibraryTypesIndex];try{this.onload(this.m_library)}catch(t){console.log(t)}},p.prototype._onLoadError=function(t,e,n,r){null==this.m_errorResult&&(this.m_errorResult={msg:e,code:n,library:r});var i=document.getElementById(this.m_id);if(i&&i.parentNode&&i.parentNode.removeChild(i),t)if(this.m_supportedLibraryTypesIndex++,this.m_supportedLibraryTypesIndex>=this.m_supportedLibraryTypes.length)try{this.onerror(this.m_errorResult.msg,this.m_errorResult.code,this.m_errorResult.library)}catch(t){console.log(t)}else this.load();else try{this.onerror(this.m_errorResult.msg,this.m_errorResult.code,this.m_errorResult.library)}catch(t){console.log(t)}},p.prototype._loadSignApplet=function(){var t=document.createElement("applet");t.setAttribute("codebase","https://sign.eu.iit.com.ua"),t.setAttribute("code","com.iit.certificateAuthority.endUser.libraries.signJava.EndUser.class"),t.setAttribute("archive","EUSignJava.jar"),t.setAttribute("cache_archive","EUSignJava.jar"),t.setAttribute("cache_version","1.3.102"),t.setAttribute("separate_jvm",!0),t.setAttribute("id",this.m_id),t.setAttribute("width","100%"),t.setAttribute("height","1"),document.body.appendChild(t),this.m_library=document.getElementById(this.m_id),this._waitForSignAppletLoad(this,100,1200)},p.prototype._waitForSignAppletLoad=function(t,e,n){try{t.m_library.SetUIMode(!1)}catch(i){if(0!=n)return void setTimeout((function(){t._waitForSignAppletLoad(t,e,n-1)}),e,n);var r="";return r=tt.getErrorDescriptionEx(tt.ERROR_LIBRARY_COMUNICATION_FAILED,t.m_language)+". ",r+=f.getString(f.WEB_LIBRARY_JAVA_APPLET_NOT_LOADED,t.m_language),r+="<br><br>",r+='<a style="text-indent:18px" href="https://www.java.com/ru/download/installed.jsp">'+f.getString(f.WEB_LIBRARY_CHECK_JRE_VERSION,t.m_language)+"</a>",void t._onLoadError(!0,r,tt.ERROR_LIBRARY_COMUNICATION_FAILED,null)}t._onLoad(t.m_library)},p.prototype._appendWebWrapperObject=function(t,e,n,r){try{var i=new nt(t,e),o=document.createElement("object");for(var s in o.setAttribute("id",this.m_id),n?r?(o.setAttribute("classid",t),o.setAttribute("height","1px")):(o.type=t,o.classid=t,o.height="1px"):(o.classid="EUSignCP.class",o.style="display:none",o.style.visibility="hidden"),document.body.appendChild(o),i)o[s]=i[s];return this.m_library=document.getElementById(this.m_id),!0}catch(t){return!1}},p.prototype._onLoadWebLibraryError=function(t){var e,n=this.m_library,r=!0,i="";switch(e=p.isWebExtensionSupported()&&!p.isWebExtensionInstalled()&&this.m_webExtensionFirst,i+=tt.getErrorDescriptionEx(tt.ERROR_LIBRARY_COMUNICATION_FAILED,this.m_language),i+=". ",t.GetErrorCode()){case tt.ERROR_LIBRARY_COMUNICATION_FAILED:i+=f.getString(e?f.WEB_LIBRARY_WEB_EXTENSION_NOT_INSTALLED_OR_RUN:f.WEB_LIBRARY_NOT_INSTALLED_OR_RUN,this.m_language);break;case tt.ERROR_LIBRARY_VERSION_NOT_SUPPORTED:i+=f.getString(f.WEB_LIBRARY_INSTALLED_VERSION_NOT_SUPPORTED,this.m_language),r=!1,this.m_errorResult=null;break;default:i+=tt.getErrorDescriptionEx(t.GetErrorCode(),this.m_language)+"."}i+="<br><br>",null!=n.GetInstallURL()?(t.GetErrorCode()==tt.ERROR_LIBRARY_VERSION_NOT_SUPPORTED?i+='<div><a style="text-indent:18px" href="'+n.GetUpdateURL()+'">'+f.getString(f.WEB_LIBRARY_UPDATE_PACKAGE,this.m_language)+"</a></div>":i+=e?'<div><a style="text-indent:18px" href="'+n.GetWebExtensionInstallURL()+'">'+f.getString(f.WEB_LIBRARY_WEB_EXTENSION_INSTALL_PACKAGE,this.m_language)+"</a></div>":'<div><a style="text-indent:18px" href="'+n.GetInstallURL()+'">'+f.getString(f.WEB_LIBRARY_INSTALL_PACKAGE,this.m_language)+"</a></div>",i+='<div><a style="text-indent:18px" href="'+n.GetHelpURL()+'">'+f.getString(f.WEB_LIBRARY_USER_MANUAL,this.m_language)+"</a></div>"):i+="<div>"+f.getString(f.WEB_LIBRARY_OS_NOT_SUPPORTED,this.m_language)+"</div>",this._onLoadError(r,i,t.GetErrorCode(),n)},p.prototype._loadWebLibrary=function(){var t=this;t.m_library.Load((function(){t._onLoad()}),(function(e){t._onLoadWebLibraryError(e)}))},p.prototype._loadSignAgent=function(){if(this._appendWebWrapperObject("localhost","http:"==window.location.protocol?"8081":"8083",!1,!1))this._loadWebLibrary();else{var t=tt.getErrorDescriptionEx(tt.ERROR_LIBRARY_COMUNICATION_FAILED,this.m_language);this._onLoadError(!0,t,tt.ERROR_LIBRARY_COMUNICATION_FAILED,null)}},p.prototype._loadWebExtension=function(){if(this._appendWebWrapperObject("chrome-extension://jffafkigfgmjafhpkoibhfefeaebmccg/","",!1,!1))this._loadWebLibrary();else{var t=tt.getErrorDescriptionEx(tt.ERROR_LIBRARY_COMUNICATION_FAILED,this.m_language);this._onLoadError(!0,t,tt.ERROR_LIBRARY_COMUNICATION_FAILED,null)}},p.prototype._loadPlugin=function(t,e,n,r){if(this._appendWebWrapperObject(t,"",!0,r))this._waitForPluginLoad(this,e,n);else{var i=tt.getErrorDescriptionEx(tt.ERROR_LIBRARY_COMUNICATION_FAILED,this.m_language);this._onLoadError(!0,i,tt.ERROR_LIBRARY_COMUNICATION_FAILED,null)}},p.prototype._waitForPluginLoad=function(t,e,n){t.m_library.Load((function(){t._onLoad()}),(function(r){r.GetErrorCode()!=tt.ERROR_LIBRARY_COMUNICATION_FAILED||0==n?t._onLoadWebLibraryError(r):setTimeout((function(){t._waitForPluginLoad(t,e,n-1)}),e,n)}))},p.prototype._loadNPAPI=function(){this._loadPlugin("application/x-eusign-cp",100,50,!1)},p.prototype._loadActiveX=function(){this._loadPlugin("clsid:B7E24C75-E343-4DA2-A8D3-C80970FB7D7B",100,50,!0)};var _=function(){this.vendor="JSC IIT",this.parentClassName="Object",this.className="EndUserArrayList",this.classVersion=1,this.m_array=[]};_.prototype.add=function(t){return this.m_array.push(t),!0},_.prototype.clear=function(){this.m_array=[]},_.prototype.get=function(t){return this.m_array[t]},_.prototype.size=function(){return this.m_array.length},Object.create||(Object.create=function(t,e){if("object"!=typeof t&&"function"!=typeof t||null===t||void 0!==e)throw new Error("Invalid arguments");function n(){}return n.prototype=t,new n}),Uint8Array.prototype.slice||(Uint8Array.prototype.slice=Uint8Array.prototype.subarray);var h=null;function E(t){return null!=t&&"object"==typeof t&&("EndUserTransferableObject"==t.className||"EndUserTransferableObject"==t.parentClassName)}h="undefined"==typeof Uint8Array?function(t){var e;if("number"==typeof t){e=new Array(t);for(var n=0;n<t;++n)e[n]=0}else e=t.slice(0);return e.buffer=e,e.subarray=function(t,n){return e.slice(t,n)},e.set=function(t,n){arguments.length<2&&(n=0);for(var r=0,i=t.length;r<i;++r,++n)e[n]=255&t[r]},e.byteLength=e.length,"object"==typeof t&&t.buffer&&(e.buffer=t.buffer),e}:Uint8Array;var y=function(){this.vendor="JSC IIT",this.parentClassName="Object",this.className="EndUserTransferableObject",this.classVersion=1,this.isFilled=!1,this.fields={}};y.makeTransferable=function(t){var e,n;n=y,(e=t).prototype=Object.create(n.prototype),e.prototype.constructor=e,y[(new t).className]=t},y.prototype.base64Coder=new s,y.prototype.dateCoder=new o,y.prototype.setClassInfo=function(t,e){this.parentClassName="EndUserTransferableObject",this.className=t,this.classVersion=e},y.prototype.initializeFields=function(){for(var t in this.fields)switch(this.fields[t]){case"boolean":this[t]=!1;break;case"int":case"long":case"number":this[t]=0;break;case"string":this[t]="";break;case"EndUserKeyMedia":this[t]=new C;break;default:this[t]=null}},y.prototype.set=function(t){if(this.className!=t.className)throw"invalid class";for(var e in this.fields)this[e]=t[e]},y.prototype.encode=function(){var t,e;for(var n in e=new Object,t=new Object,this.fields)null!=this[n]?E(this[n])?e[n]=this[n].encode():"byteArray"==this.fields[n]?e[n]=this.base64Coder.encode(this[n]):"time"==this.fields[n]?e[n]=this.dateCoder.encode(this[n]):e[n]=this[n]:e[n]=null;return t.className=this.className,t.classVersion=this.classVersion,t.classFields=e,t},y.prototype.decode=function(t){try{if(null==t.classVersion||null==t.classFields)return!1;var e=t.classFields;for(var n in this.fields)if("time"==this.fields[n])this[n]=this.dateCoder.decode(e[n]);else if("EndUserOwnerInfo"==this.fields[n])this[n]=new D,this[n].decode(e[n]);else if("EndUserTimeInfo"==this.fields[n])this[n]=new O,this[n].decode(e[n]);else if("EndUserKeyMedia"==this.fields[n])this[n]=new C,this[n].decode(e[n]);else if("EndUserCertificateInfoEx"==this.fields[n])this[n]=new M,this[n].decode(e[n]);else if("byteArray"==this.fields[n])null!=e[n]&&(this[n]=this.base64Coder.decode(e[n]));else if("array"==this.fields[n]){this[n]=[];for(var r=e[n],i=0;i<r.length;i++){var o=r[i].className,s=new y[o];if(void 0!==s){if(!s.decode(r[i]))throw"invalid class";"EndUserByteArray"==s.className&&(s=s.GetData()),this[n].push(s)}else this[n].push(r[i])}}else this[n]=e[n];return!0}catch(t){return this.isFilled=!1,!1}};var S=function(t){this.setClassInfo("EndUserByteArray",1),this.fields={data:"byteArray"},this.initializeFields(),this.data=t};y.makeTransferable(S),S.prototype.GetData=function(){return this.data},S.prototype.SetData=function(t){this.data=t};var C=function(){this.setClassInfo("EndUserKeyMedia",1),this.fields={typeIndex:"long",devIndex:"long",password:"string"},this.initializeFields()};y.makeTransferable(C),C.prototype.GetTypeIndex=function(){return this.typeIndex},C.prototype.SetTypeIndex=function(t){this.typeIndex=t},C.prototype.GetDevIndex=function(){return this.devIndex},C.prototype.SetDevIndex=function(t){this.devIndex=t},C.prototype.GetPassword=function(){return this.password},C.prototype.SetPassword=function(t){this.password=t};var d=function(){this.setClassInfo("EndUserFileStoreSettings",1),this.fields={path:"string",checkCRLs:"boolean",autoRefresh:"boolean",ownCRLsOnly:"boolean",fullAndDeltaCRLs:"boolean",autoDownloadCRLs:"boolean",saveLoadedCerts:"boolean",expireTime:"long"},this.initializeFields(),this.expireTime=3600};y.makeTransferable(d),d.prototype.GetPath=function(){return this.path},d.prototype.SetPath=function(t){this.path=t},d.prototype.GetCheckCRLs=function(){return this.checkCRLs},d.prototype.SetCheckCRLs=function(t){this.checkCRLs=t},d.prototype.GetAutoRefresh=function(){return this.autoRefresh},d.prototype.SetAutoRefresh=function(t){this.autoRefresh=t},d.prototype.GetOwnCRLsOnly=function(){return this.ownCRLsOnly},d.prototype.SetOwnCRLsOnly=function(t){this.ownCRLsOnly=t},d.prototype.GetFullAndDeltaCRLs=function(){return this.fullAndDeltaCRLs},d.prototype.SetFullAndDeltaCRLs=function(t){this.fullAndDeltaCRLs=t},d.prototype.GetAutoDownloadCRLs=function(){return this.autoDownloadCRLs},d.prototype.SetAutoDownloadCRLs=function(t){this.autoDownloadCRLs=t},d.prototype.GetSaveLoadedCerts=function(){return this.saveLoadedCerts},d.prototype.SetSaveLoadedCerts=function(t){this.saveLoadedCerts=t},d.prototype.GetExpireTime=function(){return this.expireTime},d.prototype.SetExpireTime=function(t){this.expireTime=t};var R=function(){this.setClassInfo("EndUserProxySettings",1),this.fields={useProxy:"boolean",anonymous:"boolean",address:"string",port:"string",user:"string",password:"string",savePassword:"boolean"},this.initializeFields(),this.port="80"};y.makeTransferable(R),R.prototype.GetUseProxy=function(){return this.useProxy},R.prototype.SetUseProxy=function(t){this.useProxy=t},R.prototype.GetAnonymous=function(){return this.anonymous},R.prototype.SetAnonymous=function(t){this.anonymous=t},R.prototype.GetAddress=function(){return this.address},R.prototype.SetAddress=function(t){this.address=t},R.prototype.GetPort=function(){return this.port},R.prototype.SetPort=function(t){this.port=t},R.prototype.GetUser=function(){return this.user},R.prototype.SetUser=function(t){this.user=t},R.prototype.GetPassword=function(){return this.password},R.prototype.SetPassword=function(t){this.password=t},R.prototype.GetSavePassword=function(){return this.savePassword},R.prototype.SetSavePassword=function(t){this.savePassword=t};var m=function(){this.setClassInfo("EndUserTSPSettings",1),this.fields={getStamps:"boolean",address:"string",port:"string"},this.initializeFields(),this.port="80"};y.makeTransferable(m),m.prototype.GetGetStamps=function(){return this.getStamps},m.prototype.SetGetStamps=function(t){this.getStamps=t},m.prototype.GetAddress=function(){return this.address},m.prototype.SetAddress=function(t){this.address=t},m.prototype.GetPort=function(){return this.port},m.prototype.SetPort=function(t){this.port=t};var A=function(){this.setClassInfo("EndUserOCSPSettings",1),this.fields={useOCSP:"boolean",beforeStore:"boolean",address:"string",port:"string"},this.initializeFields(),this.port="80"};y.makeTransferable(A),A.prototype.GetUseOCSP=function(){return this.useOCSP},A.prototype.SetUseOCSP=function(t){this.useOCSP=t},A.prototype.GetBeforeStore=function(){return this.beforeStore},A.prototype.SetBeforeStore=function(t){this.beforeStore=t},A.prototype.GetAddress=function(){return this.address},A.prototype.SetAddress=function(t){this.address=t},A.prototype.GetPort=function(){return this.port},A.prototype.SetPort=function(t){this.port=t};var P=function(){this.setClassInfo("EndUserLDAPSettings",1),this.fields={useLDAP:"boolean",address:"string",port:"string",anonymous:"boolean",user:"string",password:"string"},this.initializeFields(),this.port="389"};y.makeTransferable(P),P.prototype.GetUseLDAP=function(){return this.useLDAP},P.prototype.SetUseLDAP=function(t){this.useLDAP=t},P.prototype.GetAddress=function(){return this.address},P.prototype.SetAddress=function(t){this.address=t},P.prototype.GetPort=function(){return this.port},P.prototype.SetPort=function(t){this.port=t},P.prototype.GetAnonymous=function(){return this.anonymous},P.prototype.SetAnonymous=function(t){this.anonymous=t},P.prototype.GetUser=function(){return this.user},P.prototype.SetUser=function(t){this.user=t},P.prototype.GetPassword=function(){return this.password},P.prototype.SetPassword=function(t){this.password=t};var g=function(){this.setClassInfo("EndUserCMPSettings",1),this.fields={useCMP:"boolean",address:"string",port:"string",commonName:"string"},this.initializeFields(),this.port="80"};y.makeTransferable(g),g.prototype.GetUseCMP=function(){return this.useCMP},g.prototype.SetUseCMP=function(t){this.useCMP=t},g.prototype.GetAddress=function(){return this.address},g.prototype.SetAddress=function(t){this.address=t},g.prototype.GetPort=function(){return this.port},g.prototype.SetPort=function(t){this.port=t},g.prototype.GetCommonName=function(){return this.commonName},g.prototype.SetCommonName=function(t){this.commonName=t};var T=function(){this.setClassInfo("EndUserModeSettings",1),this.fields={offlineMode:"boolean"},this.initializeFields()};y.makeTransferable(T),T.prototype.GetOfflineMode=function(){return this.offlineMode},T.prototype.SetOfflineMode=function(t){this.offlineMode=t};var v=function(){this.setClassInfo("EndUserOCSPAccessInfoModeSettings",1),this.fields={enabled:"boolean"},this.initializeFields()};y.makeTransferable(v),v.prototype.GetEnabled=function(){return this.enabled},v.prototype.SetEnabled=function(t){this.enabled=t};var I=function(){this.setClassInfo("EndUserOCSPAccessInfoSettings",1),this.fields={issuerCN:"string",address:"string",port:"string"},this.initializeFields()};y.makeTransferable(I),I.prototype.GetIssuerCN=function(){return this.issuerCN},I.prototype.SetIssuerCN=function(t){this.issuerCN=t},I.prototype.GetAddress=function(){return this.address},I.prototype.SetAddress=function(t){this.address=t},I.prototype.GetPort=function(){return this.port},I.prototype.SetPort=function(t){this.port=t};var U=function(){this.setClassInfo("EndUserKeyMediaSettings",1),this.fields={sourceType:"long",showErrors:"boolean",keyMedia:"EndUserKeyMedia"},this.initializeFields(),this.sourceType=1,this.showErrors=!0};y.makeTransferable(U),U.prototype.GetSourceType=function(){return this.sourceType},U.prototype.SetSourceType=function(t){this.sourceType=t},U.prototype.GetShowErrors=function(){return this.showErrors},U.prototype.SetShowErrors=function(t){this.showErrors=t},U.prototype.GetKeyMedia=function(){return this.keyMedia},U.prototype.SetKeyMedia=function(t){this.keyMedia=t};var b=function(){this.setClassInfo("EndUserTSLSettings",1),this.fields={useTSL:"boolean",autoDownloadTSL:"boolean",tslAddress:"string"},this.initializeFields()};y.makeTransferable(b),b.prototype.GetUseTSL=function(){return this.useTSL},b.prototype.SetUseTSL=function(t){this.useTSL=t},b.prototype.GetAutoDownloadTSL=function(){return this.autoDownloadTSL},b.prototype.SetAutoDownloadTSL=function(t){this.autoDownloadTSL=t},b.prototype.GetTSLAddress=function(){return this.tslAddress},b.prototype.SetTSLAddress=function(t){this.tslAddress=t};var D=function(){this.setClassInfo("EndUserOwnerInfo",1),this.fields={isFilled:"boolean",issuer:"string",issuerCN:"string",serial:"string",subject:"string",subjCN:"string",subjOrg:"string",subjOrgUnit:"string",subjTitle:"string",subjState:"string",subjLocality:"string",subjFullName:"string",subjAddress:"string",subjPhone:"string",subjEMail:"string",subjDNS:"string",subjEDRPOUCode:"string",subjDRFOCode:"string"},this.initializeFields()};y.makeTransferable(D),D.prototype.IsFilled=function(){return this.isFilled},D.prototype.GetIssuer=function(){return this.issuer},D.prototype.GetIssuerCN=function(){return this.issuerCN},D.prototype.GetSerial=function(){return this.serial},D.prototype.GetSubject=function(){return this.subject},D.prototype.GetSubjCN=function(){return this.subjCN},D.prototype.GetSubjOrg=function(){return this.subjOrg},D.prototype.GetSubjOrgUnit=function(){return this.subjOrgUnit},D.prototype.GetSubjTitle=function(){return this.subjTitle},D.prototype.GetSubjState=function(){return this.subjState},D.prototype.GetSubjLocality=function(){return this.subjLocality},D.prototype.GetSubjFullName=function(){return this.subjFullName},D.prototype.GetSubjAddress=function(){return this.subjAddress},D.prototype.GetSubjPhone=function(){return this.subjPhone},D.prototype.GetSubjEMail=function(){return this.subjEMail},D.prototype.GetSubjDNS=function(){return this.subjDNS},D.prototype.GetSubjEDRPOUCode=function(){return this.subjEDRPOUCode},D.prototype.GetSubjDRFOCode=function(){return this.subjDRFOCode};var O=function(){this.setClassInfo("EndUserTimeInfo",2),this.fields={version:"number",isTimeAvail:"boolean",isTimeStamp:"boolean",time:"time",isSignTimeStampAvail:"boolean",signTimeStamp:"time"},this.initializeFields()};y.makeTransferable(O),O.prototype.GetVersion=function(){return this.version},O.prototype.IsTimeAvail=function(){return this.isTimeAvail},O.prototype.IsTimeStamp=function(){return this.isTimeStamp},O.prototype.GetTime=function(){return this.time},O.prototype.IsSignTimeStampAvail=function(){return this.isSignTimeStampAvail},O.prototype.GetSignTimeStamp=function(){return this.signTimeStamp};var N=function(){this.setClassInfo("EndUserSignInfo",1),this.fields={ownerInfo:"EndUserOwnerInfo",timeInfo:"EndUserTimeInfo",data:"byteArray"},this.initializeFields()};y.makeTransferable(N),N.prototype.GetOwnerInfo=function(){return this.ownerInfo},N.prototype.GetTimeInfo=function(){return this.timeInfo},N.prototype.GetData=function(){return this.data},N.prototype.GetDataString=function(t){return i.ArrayToString(t,this.data)};var G=function(){this.setClassInfo("EndUserSenderInfo",1),this.fields={ownerInfo:"EndUserOwnerInfo",timeInfo:"EndUserTimeInfo",data:"byteArray"},this.initializeFields()};y.makeTransferable(G),G.prototype.GetOwnerInfo=function(){return this.ownerInfo},G.prototype.GetTimeInfo=function(){return this.timeInfo},G.prototype.GetData=function(){return this.data},G.prototype.GetDataString=function(t){return i.ArrayToString(t,this.data)};var w=function(){this.setClassInfo("EndUserCertificateInfo",1),this.fields={isFilled:"boolean",version:"long",issuer:"string",issuerCN:"string",serial:"string",subject:"string",subjCN:"string",subjOrg:"string",subjOrgUnit:"string",subjTitle:"string",subjState:"string",subjLocality:"string",subjFullName:"string",subjAddress:"string",subjPhone:"string",subjEMail:"string",subjDNS:"string",subjEDRPOUCode:"string",subjDRFOCode:"string",subjNBUCode:"string",subjSPFMCode:"string",subjOCode:"string",subjOUCode:"string",subjUserCode:"string",certBeginTime:"time",certEndTime:"time",isPrivKeyTimesAvail:"boolean",privKeyBeginTime:"time",privKeyEndTime:"time",publicKeyBits:"long",publicKey:"string",publicKeyID:"string",isECDHPublicKeyAvail:"boolean",ECDHPublicKeyBits:"long",ECDHPublicKey:"string",ECDHPublicKeyID:"string",issuerPublicKeyID:"string",keyUsage:"string",extKeyUsages:"string",policies:"string",crlDistribPoint1:"string",crlDistribPoint2:"string",isPowerCert:"boolean",isSubjTypeAvail:"boolean",isSubjCA:"boolean"},this.initializeFields()};y.makeTransferable(w),w.prototype.IsFilled=function(){return this.isFilled},w.prototype.GetVersion=function(){return this.version},w.prototype.GetIssuer=function(){return this.issuer},w.prototype.GetIssuerCN=function(){return this.issuerCN},w.prototype.GetSerial=function(){return this.serial},w.prototype.GetSubject=function(){return this.subject},w.prototype.GetSubjCN=function(){return this.subjCN},w.prototype.GetSubjOrg=function(){return this.subjOrg},w.prototype.GetSubjOrgUnit=function(){return this.subjOrgUnit},w.prototype.GetSubjTitle=function(){return this.subjTitle},w.prototype.GetSubjState=function(){return this.subjState},w.prototype.GetSubjLocality=function(){return this.subjLocality},w.prototype.GetSubjFullName=function(){return this.subjFullName},w.prototype.GetSubjAddress=function(){return this.subjAddress},w.prototype.GetSubjPhone=function(){return this.subjPhone},w.prototype.GetSubjEMail=function(){return this.subjEMail},w.prototype.GetSubjDNS=function(){return this.subjDNS},w.prototype.GetSubjEDRPOUCode=function(){return this.subjEDRPOUCode},w.prototype.GetSubjDRFOCode=function(){return this.subjDRFOCode},w.prototype.GetSubjNBUCode=function(){return this.subjNBUCode},w.prototype.GetSubjSPFMCode=function(){return this.subjSPFMCode},w.prototype.GetSubjOCode=function(){return this.subjOCode},w.prototype.GetSubjOUCode=function(){return this.subjOUCode},w.prototype.GetSubjUserCode=function(){return this.subjUserCode},w.prototype.GetCertBeginTime=function(){return this.certBeginTime},w.prototype.GetCertEndTime=function(){return this.certEndTime},w.prototype.IsPrivKeyTimesAvail=function(){return this.isPrivKeyTimesAvail},w.prototype.GetPrivKeyBeginTime=function(){return this.privKeyBeginTime},w.prototype.GetPrivKeyEndTime=function(){return this.privKeyEndTime},w.prototype.GetPublicKeyBits=function(){return this.publicKeyBits},w.prototype.GetPublicKey=function(){return this.publicKey},w.prototype.GetPublicKeyID=function(){return this.publicKeyID},w.prototype.IsECDHPublicKeyAvail=function(){return this.isECDHPublicKeyAvail},w.prototype.GetECDHPublicKeyBits=function(){return this.ECDHPublicKeyBits},w.prototype.GetECDHPublicKey=function(){return this.ECDHPublicKey},w.prototype.GetECDHPublicKeyID=function(){return this.ECDHPublicKeyID},w.prototype.GetIssuerPublicKeyID=function(){return this.issuerPublicKeyID},w.prototype.GetKeyUsage=function(){return this.keyUsage},w.prototype.GetExtKeyUsages=function(){return this.extKeyUsages},w.prototype.GetPolicies=function(){return this.policies},w.prototype.GetCRLDistribPoint1=function(){return this.crlDistribPoint1},w.prototype.GetCRLDistribPoint2=function(){return this.crlDistribPoint2},w.prototype.IsPowerCert=function(){return this.isPowerCert},w.prototype.IsSubjTypeAvail=function(){return this.isSubjTypeAvail},w.prototype.IsSubjCA=function(){return this.isSubjCA};var M=function(){this.setClassInfo("EndUserCertificateInfoEx",8),this.fields={isFilled:"boolean",version:"long",issuer:"string",issuerCN:"string",serial:"string",subject:"string",subjCN:"string",subjOrg:"string",subjOrgUnit:"string",subjTitle:"string",subjState:"string",subjLocality:"string",subjFullName:"string",subjAddress:"string",subjPhone:"string",subjEMail:"string",subjDNS:"string",subjEDRPOUCode:"string",subjDRFOCode:"string",subjNBUCode:"string",subjSPFMCode:"string",subjOCode:"string",subjOUCode:"string",subjUserCode:"string",certBeginTime:"time",certEndTime:"time",isPrivKeyTimesAvail:"boolean",privKeyBeginTime:"time",privKeyEndTime:"time",publicKeyBits:"long",publicKey:"string",publicKeyID:"string",issuerPublicKeyID:"string",keyUsage:"string",extKeyUsages:"string",policies:"string",crlDistribPoint1:"string",crlDistribPoint2:"string",isPowerCert:"boolean",isSubjTypeAvail:"boolean",isSubjCA:"boolean",chainLength:"int",UPN:"string",publicKeyType:"long",keyUsageType:"long",RSAModul:"string",RSAExponent:"string",OCSPAccessInfo:"string",issuerAccessInfo:"string",TSPAccessInfo:"string",isLimitValueAvailable:"boolean",limitValue:"long",limitValueCurrency:"string",subjType:"long",subjSubType:"long",subjUNZR:"string",subjCountry:"string",fingerprint:"string",isQSCD:"boolean",subjUserID:"string"},this.initializeFields();var t=this;this.IsLimitValueAvailable=function(){return t.isLimitValueAvailable}};y.makeTransferable(M),M.prototype.IsFilled=function(){return this.isFilled},M.prototype.GetVersion=function(){return this.version},M.prototype.GetIssuer=function(){return this.issuer},M.prototype.GetIssuerCN=function(){return this.issuerCN},M.prototype.GetSerial=function(){return this.serial},M.prototype.GetSubject=function(){return this.subject},M.prototype.GetSubjCN=function(){return this.subjCN},M.prototype.GetSubjOrg=function(){return this.subjOrg},M.prototype.GetSubjOrgUnit=function(){return this.subjOrgUnit},M.prototype.GetSubjTitle=function(){return this.subjTitle},M.prototype.GetSubjState=function(){return this.subjState},M.prototype.GetSubjLocality=function(){return this.subjLocality},M.prototype.GetSubjFullName=function(){return this.subjFullName},M.prototype.GetSubjAddress=function(){return this.subjAddress},M.prototype.GetSubjPhone=function(){return this.subjPhone},M.prototype.GetSubjEMail=function(){return this.subjEMail},M.prototype.GetSubjDNS=function(){return this.subjDNS},M.prototype.GetSubjEDRPOUCode=function(){return this.subjEDRPOUCode},M.prototype.GetSubjDRFOCode=function(){return this.subjDRFOCode},M.prototype.GetSubjNBUCode=function(){return this.subjNBUCode},M.prototype.GetSubjSPFMCode=function(){return this.subjSPFMCode},M.prototype.GetSubjOCode=function(){return this.subjOCode},M.prototype.GetSubjOUCode=function(){return this.subjOUCode},M.prototype.GetSubjUserCode=function(){return this.subjUserCode},M.prototype.GetCertBeginTime=function(){return this.certBeginTime},M.prototype.GetCertEndTime=function(){return this.certEndTime},M.prototype.IsPrivKeyTimesAvail=function(){return this.isPrivKeyTimesAvail},M.prototype.GetPrivKeyBeginTime=function(){return this.privKeyBeginTime},M.prototype.GetPrivKeyEndTime=function(){return this.privKeyEndTime},M.prototype.GetPublicKeyBits=function(){return this.publicKeyBits},M.prototype.GetPublicKey=function(){return this.publicKey},M.prototype.GetPublicKeyID=function(){return this.publicKeyID},M.prototype.GetIssuerPublicKeyID=function(){return this.issuerPublicKeyID},M.prototype.GetKeyUsage=function(){return this.keyUsage},M.prototype.GetExtKeyUsages=function(){return this.extKeyUsages},M.prototype.GetPolicies=function(){return this.policies},M.prototype.GetCRLDistribPoint1=function(){return this.crlDistribPoint1},M.prototype.GetCRLDistribPoint2=function(){return this.crlDistribPoint2},M.prototype.IsPowerCert=function(){return this.isPowerCert},M.prototype.IsSubjTypeAvail=function(){return this.isSubjTypeAvail},M.prototype.IsSubjCA=function(){return this.isSubjCA},M.prototype.GetChainLength=function(){return this.chainLength},M.prototype.GetUPN=function(){return this.UPN},M.prototype.GetPublicKeyType=function(){return this.publicKeyType},M.prototype.GetKeyUsageType=function(){return this.keyUsageType},M.prototype.GetRSAModul=function(){return this.RSAModul},M.prototype.GetRSAExponent=function(){return this.RSAExponent},M.prototype.GetOCSPAccessInfo=function(){return this.OCSPAccessInfo},M.prototype.GetIssuerAccessInfo=function(){return this.issuerAccessInfo},M.prototype.GetTSPAccessInfo=function(){return this.TSPAccessInfo},M.prototype.IsLimitValueAvail=function(){return this.isLimitValueAvailable},M.prototype.GetLimitValue=function(){return this.limitValue},M.prototype.GetLimitValueCurrency=function(){return this.limitValueCurrency},M.prototype.GetSubjType=function(){return this.subjType},M.prototype.GetSubjSubType=function(){return this.subjSubType},M.prototype.GetSubjUNZR=function(){return this.subjUNZR},M.prototype.GetSubjCountry=function(){return this.subjCountry},M.prototype.GetFingerprint=function(){return this.fingerprint},M.prototype.IsQSCD=function(){return this.isQSCD},M.prototype.GetSubjUserID=function(){return this.subjUserID};var L=function(){this.setClassInfo("EndUserCertificate",1),this.fields={infoEx:"EndUserCertificateInfoEx",data:"byteArray"},this.initializeFields()};y.makeTransferable(L),L.prototype.GetInfoEx=function(){return this.infoEx},L.prototype.SetInfoEx=function(t){this.infoEx=t},L.prototype.GetData=function(){return this.data},L.prototype.SetData=function(t){this.data=t};var K=function(){this.setClassInfo("EndUserCRLInfo",1,!0,!1),this.fields={isFilled:"boolean",issuer:"string",issuerCN:"string",crlNumber:"long",thisUpdate:"time",nextUpdate:"time"},this.initializeFields()};y.makeTransferable(K),K.prototype.IsFilled=function(){return this.isFilled},K.prototype.GetIssuer=function(){return this.issuer},K.prototype.GetIssuerCN=function(){return this.issuerCN},K.prototype.GetCRLNumber=function(){return this.crlNumber},K.prototype.GetThisUpdate=function(){return this.thisUpdate},K.prototype.GetNextUpdate=function(){return this.nextUpdate};var x=function(){this.setClassInfo("EndUserCRLDetailedInfo",1),this.fields={isFilled:"boolean",version:"long",issuer:"string",issuerCN:"string",issuerPublicKeyID:"string",crlNumber:"long",thisUpdate:"time",nextUpdate:"time",revokedItemsCount:"long"},this.initializeFields()};y.makeTransferable(x),x.prototype.IsFilled=function(){return this.isFilled},x.prototype.GetVersion=function(){return this.version},x.prototype.GetIssuer=function(){return this.issuer},x.prototype.GetIssuerCN=function(){return this.issuerCN},x.prototype.GetIssuerPublicKeyID=function(){return this.issuerPublicKeyID},x.prototype.GetCRLNumber=function(){return this.crlNumber},x.prototype.GetThisUpdate=function(){return this.thisUpdate},x.prototype.GetNextUpdate=function(){return this.nextUpdate},x.prototype.GetRevokedItemsCount=function(){return this.revokedItemsCount};var k=function(){this.setClassInfo("EndUserPrivateKeyInfo",1),this.fields={privateKey:"byteArray",privateKeyInfo:"byteArray"},this.initializeFields()};y.makeTransferable(k),k.prototype.GetPrivateKey=function(){return this.privateKey},k.prototype.SetPrivateKey=function(t){this.privateKey=t},k.prototype.GetPrivateKeyInfo=function(){return this.privateKeyInfo},k.prototype.SetPrivateKeyInfo=function(t){this.privateKeyInfo=t};var B=function(){this.setClassInfo("EndUserJKSPrivateKey",1),this.fields={privateKey:"byteArray",certificates:"array"},this.initializeFields()};y.makeTransferable(B),B.prototype.GetPrivateKey=function(){return this.privateKey},B.prototype.GetCertificate=function(t){return t<0||t>=this.certificates.length?null:this.certificates[t]},B.prototype.GetCertificatesCount=function(){return this.certificates.length},B.prototype.GetCertificates=function(){return this.certificates};var F=function(){this.setClassInfo("EndUserRequestInfo",4),this.fields={request:"byteArray",requestType:"number",defaultRequestFileName:"string",isSimple:"boolean",subject:"string",subjCN:"string",subjOrg:"string",subjOrgUnit:"string",subjTitle:"string",subjState:"string",subjLocality:"string",subjFullName:"string",subjAddress:"string",subjPhone:"string",subjEMail:"string",subjDNS:"string",subjEDRPOUCode:"string",subjDRFOCode:"string",subjNBUCode:"string",subjSPFMCode:"string",subjOCode:"string",subjOUCode:" string",subjUserCode:"string",certBeginTime:"time",certEndTime:"time",isPrivKeyTimesAvail:"boolean",privKeyBeginTime:"time",privKeyEndTime:"time",publicKeyType:"number",publicKeyBits:"number",RSAModul:"string",RSAExponent:"string",publicKey:"string",publicKeyID:"string",extKeyUsages:"string",crlDistribPoint1:"string",crlDistribPoint2:"string",isSubjTypeAvail:"boolean",subjType:"number",subjSubType:"number",isSelfSigned:"boolean",signIssuer:"string",signSerial:"string",subjUNZR:"string",subjCountry:"string",isQSCD:"boolean"},this.initializeFields()};y.makeTransferable(F),F.prototype.GetRequest=function(){return this.request},F.prototype.GetRequestType=function(){return this.requestType},F.prototype.GetDefaultRequestFileName=function(){return this.defaultRequestFileName},F.prototype.IsSimple=function(){return this.isSimple},F.prototype.GetSubject=function(){return this.subject},F.prototype.GetSubjCN=function(){return this.subjCN},F.prototype.GetSubjOrg=function(){return this.subjOrg},F.prototype.GetSubjOrgUnit=function(){return this.subjOrgUnit},F.prototype.GetSubjTitle=function(){return this.subjTitle},F.prototype.GetSubjState=function(){return this.subjState},F.prototype.GetSubjLocality=function(){return this.subjLocality},F.prototype.GetSubjFullName=function(){return this.subjFullName},F.prototype.GetSubjAddress=function(){return this.subjAddress},F.prototype.GetSubjPhone=function(){return this.subjPhone},F.prototype.GetSubjEMail=function(){return this.subjEMail},F.prototype.GetSubjDNS=function(){return this.subjDNS},F.prototype.GetSubjEDRPOUCode=function(){return this.subjEDRPOUCode},F.prototype.GetSubjDRFOCode=function(){return this.subjDRFOCode},F.prototype.GetSubjNBUCode=function(){return this.subjNBUCode},F.prototype.GetSubjSPFMCode=function(){return this.subjSPFMCode},F.prototype.GetSubjOCode=function(){return this.subjOCode},F.prototype.GetSubjOUCode=function(){return this.subjOUCode},F.prototype.GetSubjUserCode=function(){return this.subjUserCode},F.prototype.GetCertBeginTime=function(){return this.certBeginTime},F.prototype.GetCertEndTime=function(){return this.certEndTime},F.prototype.IsPrivKeyTimesAvail=function(){return this.isPrivKeyTimesAvail},F.prototype.GetPrivKeyBeginTime=function(){return this.privKeyBeginTime},F.prototype.GetPrivKeyEndTime=function(){return this.privKeyEndTime},F.prototype.GetPublicKeyType=function(){return this.publicKeyType},F.prototype.GetPublicKeyBits=function(){return this.publicKeyBits},F.prototype.GetRSAModul=function(){return this.RSAModul},F.prototype.GetRSAExponent=function(){return this.RSAExponent},F.prototype.GetPublicKey=function(){return this.publicKey},F.prototype.GetPublicKeyID=function(){return this.publicKeyID},F.prototype.GetExtKeyUsages=function(){return this.extKeyUsages},F.prototype.GetCRLDistribPoint1=function(){return this.crlDistribPoint1},F.prototype.GetCRLDistribPoint2=function(){return this.crlDistribPoint2},F.prototype.IsSubjTypeAvail=function(){return this.isSubjTypeAvail},F.prototype.GetSubjType=function(){return this.subjType},F.prototype.GetSubjSubType=function(){return this.subjSubType},F.prototype.IsSelfSigned=function(){return this.isSelfSigned},F.prototype.GetSignIssuer=function(){return this.signIssuer},F.prototype.GetSignSerial=function(){return this.signSerial},F.prototype.GetSubjUNZR=function(){return this.subjUNZR},F.prototype.GetSubjCountry=function(){return this.subjCountry},F.prototype.IsQSCD=function(){return this.isQSCD};var Y=function(){this.setClassInfo("EndUserInfo",3),this.fields={commonName:"string",locality:"string",state:"string",organization:"string",orgUnit:"string",title:"string",street:"string",phone:"string",surname:"string",givenname:"string",EMail:"string",DNS:"string",EDRPOUCode:"string",DRFOCode:"string",NBUCode:"string",SPFMCode:"string",OCode:"string",OUCode:"string",userCode:"string",UPN:"string",UNZR:"string",country:"string"},this.initializeFields()};y.makeTransferable(Y),Y.prototype.GetCommonName=function(){return this.commonName},Y.prototype.SetCommonName=function(t){this.commonName=t},Y.prototype.GetLocality=function(){return this.locality},Y.prototype.SetLocality=function(t){this.locality=t},Y.prototype.GetState=function(){return this.state},Y.prototype.SetState=function(t){this.state=t},Y.prototype.GetOrganization=function(){return this.organization},Y.prototype.SetOrganization=function(t){this.organization=t},Y.prototype.GetOrgUnit=function(){return this.orgUnit},Y.prototype.SetOrgUnit=function(t){this.orgUnit=t},Y.prototype.GetTitle=function(){return this.title},Y.prototype.SetTitle=function(t){this.title=t},Y.prototype.GetStreet=function(){return this.street},Y.prototype.SetStreet=function(t){this.street=t},Y.prototype.GetPhone=function(){return this.phone},Y.prototype.SetPhone=function(t){this.phone=t},Y.prototype.GetSurname=function(){return this.surname},Y.prototype.SetSurname=function(t){this.surname=t},Y.prototype.GetGivenname=function(){return this.givenname},Y.prototype.SetGivenname=function(t){this.givenname=t},Y.prototype.GetEMail=function(){return this.EMail},Y.prototype.SetEMail=function(t){this.EMail=t},Y.prototype.GetDNS=function(){return this.DNS},Y.prototype.SetDNS=function(t){this.DNS=t},Y.prototype.GetEDRPOUCode=function(){return this.EDRPOUCode},Y.prototype.SetEDRPOUCode=function(t){this.EDRPOUCode=t},Y.prototype.GetDRFOCode=function(){return this.DRFOCode},Y.prototype.SetDRFOCode=function(t){this.DRFOCode=t},Y.prototype.GetNBUCode=function(){return this.NBUCode},Y.prototype.SetNBUCode=function(t){this.NBUCode=t},Y.prototype.GetSPFMCode=function(){return this.SPFMCode},Y.prototype.SetSPFMCode=function(t){this.SPFMCode=t},Y.prototype.GetOCode=function(){return this.OCode},Y.prototype.SetOCode=function(t){this.OCode=t},Y.prototype.GetOUCode=function(){return this.OUCode},Y.prototype.SetOUCode=function(t){this.OUCode=t},Y.prototype.GetUserCode=function(){return this.userCode},Y.prototype.SetUserCode=function(t){this.userCode=t},Y.prototype.GetUPN=function(){return this.UPN},Y.prototype.SetUPN=function(t){this.UPN=t},Y.prototype.GetUNZR=function(){return this.UNZR},Y.prototype.SetUNZR=function(t){this.UNZR=t},Y.prototype.GetCountry=function(){return this.country},Y.prototype.SetCountry=function(t){this.country=t};var j=function(){this.setClassInfo("EndUserParams",1),this.fields={SN:"number",commonName:"string",locality:"string",state:"string",organization:"string",orgUnit:"string",title:"string",street:"string",phone:"string",surname:"string",givenname:"string",EMail:"string",DNS:"string",EDRPOUCode:"string",DRFOCode:"string",NBUCode:"string",SPFMCode:"string",information:"string",passPhrase:"string",isPublishCertificate:"boolean",RAAdminSN:"number"},this.initializeFields()};y.makeTransferable(j),j.prototype.GetSN=function(){return this.SN},j.prototype.SetSN=function(t){this.SN=t},j.prototype.GetCommonName=function(){return this.commonName},j.prototype.SetCommonName=function(t){this.commonName=t},j.prototype.GetLocality=function(){return this.locality},j.prototype.SetLocality=function(t){this.locality=t},j.prototype.GetState=function(){return this.state},j.prototype.SetState=function(t){this.state=t},j.prototype.GetOrganization=function(){return this.organization},j.prototype.SetOrganization=function(t){this.organization=t},j.prototype.GetOrgUnit=function(){return this.orgUnit},j.prototype.SetOrgUnit=function(t){this.orgUnit=t},j.prototype.GetTitle=function(){return this.title},j.prototype.SetTitle=function(t){this.title=t},j.prototype.GetStreet=function(){return this.street},j.prototype.SetStreet=function(t){this.street=t},j.prototype.GetPhone=function(){return this.phone},j.prototype.SetPhone=function(t){this.phone=t},j.prototype.GetSurname=function(){return this.surname},j.prototype.SetSurname=function(t){this.surname=t},j.prototype.GetGivenname=function(){return this.givenname},j.prototype.SetGivenname=function(t){this.givenname=t},j.prototype.GetEMail=function(){return this.EMail},j.prototype.SetEMail=function(t){this.EMail=t},j.prototype.GetDNS=function(){return this.DNS},j.prototype.SetDNS=function(t){this.DNS=t},j.prototype.GetEDRPOUCode=function(){return this.EDRPOUCode},j.prototype.SetEDRPOUCode=function(t){this.EDRPOUCode=t},j.prototype.GetDRFOCode=function(){return this.DRFOCode},j.prototype.SetDRFOCode=function(t){this.DRFOCode=t},j.prototype.GetNBUCode=function(){return this.NBUCode},j.prototype.SetNBUCode=function(t){this.NBUCode=t},j.prototype.GetSPFMCode=function(){return this.SPFMCode},j.prototype.SetSPFMCode=function(t){this.SPFMCode=t},j.prototype.GetInformation=function(){return this.information},j.prototype.SetInformation=function(t){this.information=t},j.prototype.GetPassPhrase=function(){return this.passPhrase},j.prototype.SetPassPhrase=function(t){this.passPhrase=t},j.prototype.GetIsPublishCertificate=function(){return this.isPublishCertificate},j.prototype.SetIsPublishCertificate=function(t){this.isPublishCertificate=t},j.prototype.GetRAAdminSN=function(){return this.RAAdminSN},j.prototype.SetRAAdminSN=function(t){this.RAAdminSN=t};var H=function(){this.setClassInfo("EndUserOperationContext",1),this.fields={handle:"string"},this.initializeFields(),this.handle=null};y.makeTransferable(H),H.prototype.GetHandle=function(){return this.handle};var V=function(){this.setClassInfo("EndUserSession",1),this.fields={handle:"string",data:"byteArray"},this.initializeFields()};y.makeTransferable(V),V.prototype.GetHandle=function(){return this.handle},V.prototype.GetData=function(){return this.data},V.prototype.SetData=function(t){this.data=t};var W=function(){this.setClassInfo("EndUserSCClientStatistic",1),this.fields={activeSessions:"number",gatedSessions:"number",unprotectedData:"number",protectedData:"number"},this.initializeFields()};y.makeTransferable(W),W.prototype.GetActiveSessions=function(){return this.activeSessions},W.prototype.GetGatedSessions=function(){return this.gatedSessions},W.prototype.GetUnprotectedData=function(){return this.unprotectedData},W.prototype.GetProtectedData=function(){return this.protectedData};var X=function(){this.setClassInfo("EndUserDeviceContext",1),this.fields={handle:"string"},this.initializeFields(),this.handle=null};y.makeTransferable(X),X.prototype.GetHandle=function(){return this.handle};var z=function(){this.setClassInfo("EndUserTransportHeader",1),this.fields={receiptNumber:"number",cryptoData:"byteArray"},this.initializeFields()};y.makeTransferable(z),z.prototype.GetReceiptNumber=function(){return this.receiptNumber},z.prototype.GetCryptoData=function(){return this.cryptoData};var J=function(){this.setClassInfo("EndUserCryptoHeader",1),this.fields={caType:"string",headerType:"number",headerSize:"number",cryptoData:"byteArray"},this.initializeFields()};y.makeTransferable(J),J.prototype.GetCAType=function(){return this.caType},J.prototype.GetHeaderType=function(){return this.headerType},J.prototype.GetHeaderSize=function(){return this.headerSize},J.prototype.GetCryptoData=function(){return this.cryptoData};var q=function(){this.setClassInfo("EndUserContext",1),this.fields={handle:"string"},this.initializeFields()};y.makeTransferable(q),q.prototype.GetHandle=function(){return this.handle};var Z=function(){this.setClassInfo("EndUserHashContext",1),this.fields={handle:"string"},this.initializeFields()};y.makeTransferable(Z),Z.prototype.GetHandle=function(){return this.handle};var Q=function(){this.setClassInfo("EndUserPrivateKeyContext",1),this.fields={handle:"string",ownerInfo:"EndUserOwnerInfo"},this.initializeFields()};y.makeTransferable(Q),Q.prototype.GetHandle=function(){return this.handle},Q.prototype.GetOwnerInfo=function(){return this.ownerInfo};var $=function(t,e){this.setClassInfo("EndUserReference",1),this.fields={name:"string",data:"byteArray"},this.initializeFields(),this.name=t,this.data=e};y.makeTransferable($),$.prototype.GetName=function(){return this.name},$.prototype.SetName=function(t){this.name=t},$.prototype.GetData=function(){return this.data},$.prototype.SetData=function(t){this.data=t};var tt=function(t,e){this.errorCode=t,this.message=e,this.toString=function(){return this.message+" ("+this.errorCode+")"},this.GetErrorCode=function(){return this.errorCode},this.GetMessage=function(){return this.message}};function et(t,e){this.errorCode=t,this.message=e,this.toString=function(){return this.message+" ("+this.errorCode+")"},this.GetErrorCode=function(){return this.errorCode},this.GetMessage=function(){return this.message}}tt.ERROR_NONE=0,tt.ERROR_UNKNOWN=65535,tt.ERROR_NOT_SUPPORTED=65534,tt.ERROR_NOT_INITIALIZED=1,tt.ERROR_BAD_PARAMETER=2,tt.ERROR_LIBRARY_LOAD=3,tt.ERROR_READ_SETTINGS=4,tt.ERROR_TRANSMIT_REQUEST=5,tt.ERROR_MEMORY_ALLOCATION=6,tt.WARNING_END_OF_ENUM=7,tt.ERROR_PROXY_NOT_AUTHORIZED=8,tt.ERROR_NO_GUI_DIALOGS=9,tt.ERROR_DOWNLOAD_FILE=10,tt.ERROR_WRITE_SETTINGS=11,tt.ERROR_CANCELED_BY_GUI=12,tt.ERROR_OFFLINE_MODE=13,tt.ERROR_KEY_MEDIAS_FAILED=17,tt.ERROR_KEY_MEDIAS_ACCESS_FAILED=18,tt.ERROR_KEY_MEDIAS_READ_FAILED=19,tt.ERROR_KEY_MEDIAS_WRITE_FAILED=20,tt.WARNING_KEY_MEDIAS_READ_ONLY=21,tt.ERROR_KEY_MEDIAS_DELETE=22,tt.ERROR_KEY_MEDIAS_CLEAR=23,tt.ERROR_BAD_PRIVATE_KEY=24,tt.ERROR_PKI_FORMATS_FAILED=33,tt.ERROR_CSP_FAILED=34,tt.ERROR_BAD_SIGNATURE=35,tt.ERROR_AUTH_FAILED=36,tt.ERROR_NOT_RECEIVER=37,tt.ERROR_STORAGE_FAILED=49,tt.ERROR_BAD_CERT=50,tt.ERROR_CERT_NOT_FOUND=51,tt.ERROR_INVALID_CERT_TIME=52,tt.ERROR_CERT_IN_CRL=53,tt.ERROR_BAD_CRL=54,tt.ERROR_NO_VALID_CRLS=55,tt.ERROR_GET_TIME_STAMP=65,tt.ERROR_BAD_TSP_RESPONSE=66,tt.ERROR_TSP_SERVER_CERT_NOT_FOUND=67,tt.ERROR_TSP_SERVER_CERT_INVALID=68,tt.ERROR_GET_OCSP_STATUS=81,tt.ERROR_BAD_OCSP_RESPONSE=82,tt.ERROR_CERT_BAD_BY_OCSP=83,tt.ERROR_OCSP_SERVER_CERT_NOT_FOUND=84,tt.ERROR_OCSP_SERVER_CERT_INVALID=85,tt.ERROR_LDAP_ERROR=97,tt.ERROR_LIBRARY_COMUNICATION_FAILED=4097,tt.ERROR_LIBRARY_VERSION_NOT_SUPPORTED=4098,tt.ERROR_BROWSER_NOT_SUPPORTED=65537,tt.ERROR_OPEN_FILE=65552,tt.ERROR_READ_FILE=65553,tt.ERROR_WRITE_FILE=65554,tt.ERROR_DESCRIPTIONS_EX=[],tt.ERROR_DESCRIPTIONS_EX[tt.ERROR_NONE]=["Виконано успішно","Выполнено успешно","Executed successfully"],tt.ERROR_DESCRIPTIONS_EX[tt.ERROR_NOT_SUPPORTED]=["Операція не підтримується","Операция не поддерживается","Operation is not supported"],tt.ERROR_DESCRIPTIONS_EX[tt.ERROR_UNKNOWN]=["Невідома помилка","Неизвестная ошибка","Unknown error"],tt.ERROR_DESCRIPTIONS_EX[tt.ERROR_LIBRARY_LOAD]=["Виникла помилка при завантаженні криптографічної бібліотеки","Возникла ошибка при загрузке криптографической библиотеки","Error at load crypto library"],tt.ERROR_DESCRIPTIONS_EX[tt.ERROR_NOT_INITIALIZED]=["Бібліотека не ініціалізована","Библиотека не инициализирована","Library is not initialized"],tt.ERROR_DESCRIPTIONS_EX[tt.ERROR_BAD_PARAMETER]=["Невірний параметр","Неверный параметр","Incorrect parameter"],tt.ERROR_DESCRIPTIONS_EX[tt.ERROR_BAD_CERT]=["Сертифікат пошкоджений або не може бути використаний","Сертификат поврежден или не может быть использован","Certificate corrupted or cannot be used"],tt.ERROR_DESCRIPTIONS_EX[tt.ERROR_CERT_NOT_FOUND]=["Сертифікат не знайдено","Сертификат не найден","Certificate not found"],tt.ERROR_DESCRIPTIONS_EX[tt.ERROR_TRANSMIT_REQUEST]=["Виникла помилка при передачі запиту на сервер ЦСК за протоколом HTTP","Возникла ошибка при передаче запроса на сервер ЦСК по протоколу HTTP","Error at request transfer to CA's server by HTTP protocol"],tt.ERROR_DESCRIPTIONS_EX[tt.ERROR_DOWNLOAD_FILE]=["Виникла помилка при завантаженні файлу з HTTP-сервера","Возникла ошибка при загрузке файла с HTTP-сервера","Error at the load of file from a HTTP-server"],tt.ERROR_DESCRIPTIONS_EX[tt.ERROR_LIBRARY_COMUNICATION_FAILED]=["Виникла помилка при взаємодії з криптографічною бібліотекою","Возникла ошибка при взаимодействии с криптографической библиотекой","Error at comunication with crypto library"],tt.ERROR_DESCRIPTIONS_EX[tt.ERROR_LIBRARY_VERSION_NOT_SUPPORTED]=["Встановлена версія бібліотеки не підтримується","Установленная версия библиотеки не поддерживается","The installed version of the library is not supported"],tt.ERROR_DESCRIPTIONS_EX[tt.ERROR_BROWSER_NOT_SUPPORTED]=["Ваш браузер не підтримується","Ваш браузер не поддерживается","Your browser is not supported"],tt.ERROR_DESCRIPTIONS_EX[tt.ERROR_OPEN_FILE]=["Виникла помилка при відкритті файлу","Возникла ошибка при открытии файла","Error at open file"],tt.ERROR_DESCRIPTIONS_EX[tt.ERROR_READ_FILE]=["Виникла помилка при зчитуванні файлу","Возникла ошибка при чтении файла","Error at read file"],tt.ERROR_DESCRIPTIONS_EX[tt.ERROR_WRITE_FILE]=["Виникла помилка при записі файлу","Возникла ошибка при записи файла","Error at write file"],tt.isError=function(t){return t!=tt.ERROR_NONE},tt.isSuccess=function(t){return t==tt.ERROR_NONE},tt.getErrorDescriptionEx=function(t,e){var n,r;return void 0===(n=tt.ERROR_DESCRIPTIONS_EX[t])&&(n=tt.ERROR_DESCRIPTIONS_EX[tt.ERROR_UNKNOWN]),void 0===(r=n[e-1])?n[0]:r};var nt=function(t,n){this.vendor="JSC IIT",this.classVersion="1.3.79",this.className="EUSignCP",this.SUBJECT_TYPE_UNDIFFERENCED=0,this.SUBJECT_TYPE_CA=1,this.SUBJECT_TYPE_CA_SERVER=2,this.SUBJECT_TYPE_RA_ADMINISTRATOR=3,this.SUBJECT_TYPE_END_USER=4,this.EU_SUBJECT_TYPE_UNDIFFERENCED=this.SUBJECT_TYPE_UNDIFFERENCED,this.EU_SUBJECT_TYPE_CA=this.SUBJECT_TYPE_CA,this.EU_SUBJECT_TYPE_CA_SERVER=this.SUBJECT_TYPE_CA_SERVER,this.EU_SUBJECT_TYPE_RA_ADMINISTRATOR=this.SUBJECT_TYPE_RA_ADMINISTRATOR,this.EU_SUBJECT_TYPE_END_USER=this.SUBJECT_TYPE_END_USER,this.SUBJECT_CA_SERVER_SUB_TYPE_UNDIFFERENCED=0,this.SUBJECT_CA_SERVER_SUB_TYPE_CMP=1,this.SUBJECT_CA_SERVER_SUB_TYPE_TSP=2,this.SUBJECT_CA_SERVER_SUB_TYPE_OCSP=3,this.EU_SUBJECT_CA_SERVER_SUB_TYPE_UNDIFFERENCED=this.SUBJECT_CA_SERVER_SUB_TYPE_UNDIFFERENCED,this.EU_SUBJECT_CA_SERVER_SUB_TYPE_CMP=this.SUBJECT_CA_SERVER_SUB_TYPE_CMP,this.EU_SUBJECT_CA_SERVER_SUB_TYPE_TSP=this.SUBJECT_CA_SERVER_SUB_TYPE_TSP,this.EU_SUBJECT_CA_SERVER_SUB_TYPE_OCSP=this.SUBJECT_CA_SERVER_SUB_TYPE_OCSP,this.CERT_KEY_TYPE_UNKNOWN=0,this.CERT_KEY_TYPE_DSTU4145=1,this.CERT_KEY_TYPE_RSA=2,this.CERT_KEY_TYPE_ECDSA=4,this.EU_CERT_KEY_TYPE_UNKNOWN=this.CERT_KEY_TYPE_UNKNOWN,this.EU_CERT_KEY_TYPE_DSTU4145=this.CERT_KEY_TYPE_DSTU4145,this.EU_CERT_KEY_TYPE_RSA=this.CERT_KEY_TYPE_RSA,this.EU_CERT_KEY_TYPE_ECDSA=this.CERT_KEY_TYPE_ECDSA,this.KEY_USAGE_UNKNOWN=0,this.KEY_USAGE_DIGITAL_SIGNATUR=1,this.KEY_KEY_USAGE_KEY_AGREEMENT=16,this.EU_KEY_USAGE_UNKNOWN=this.KEY_USAGE_UNKNOWN,this.EU_KEY_USAGE_DIGITAL_SIGNATURE=this.KEY_USAGE_DIGITAL_SIGNATUR,this.EU_KEY_USAGE_NON_REPUDATION=2,this.EU_KEY_USAGE_KEY_AGREEMENT=this.KEY_KEY_USAGE_KEY_AGREEMENT,this.EU_KEYS_REQUEST_TYPE_UA_DS=1,this.EU_KEYS_REQUEST_TYPE_UA_KEP=2,this.EU_KEYS_REQUEST_TYPE_INTERNATIONAL=3,this.EU_KEYS_TYPE_NONE=0,this.EU_KEYS_TYPE_DSTU_AND_ECDH_WITH_GOSTS=1,this.EU_KEYS_TYPE_RSA_WITH_SHA=2,this.EU_KEYS_TYPE_ECDSA_WITH_SHA=4,this.EU_KEYS_LENGTH_DS_UA_191=1,this.EU_KEYS_LENGTH_DS_UA_257=2,this.EU_KEYS_LENGTH_DS_UA_307=3,this.EU_KEYS_LENGTH_DS_UA_FILE=4,this.EU_KEYS_LENGTH_DS_UA_CERT=5,this.EU_KEYS_LENGTH_KEP_UA_257=1,this.EU_KEYS_LENGTH_KEP_UA_431=2,this.EU_KEYS_LENGTH_KEP_UA_571=3,this.EU_KEYS_LENGTH_KEP_UA_FILE=4,this.EU_KEYS_LENGTH_KEP_UA_CERT=5,this.EU_KEYS_LENGTH_DS_RSA_1024=1,this.EU_KEYS_LENGTH_DS_RSA_2048=2,this.EU_KEYS_LENGTH_DS_RSA_3072=3,this.EU_KEYS_LENGTH_DS_RSA_4096=4,this.EU_KEYS_LENGTH_DS_RSA_FILE=5,this.EU_KEYS_LENGTH_DS_RSA_CERT=6,this.EU_RECIPIENT_APPEND_ISSUER_AND_SERIAL=1,this.EU_RECIPIENT_APPEND_KEY_ID=2,this.EU_RECIPIENT_APPEND_KEY_ID_USC_COMPAT=3,this.EU_SAVE_SETTINGS_PARAMETER="SaveSettings",this.EU_RESOLVE_OIDS_PARAMETER="ResolveOIDs",this.EU_MAKE_PKEY_PFX_CONTAINER_PARAMETER="MakePKeyPFXContainer",this.EU_SIGN_INCLUDE_CONTENT_TIME_STAMP_PARAMETER="SignIncludeContentTimeStamp",this.EU_SIGN_TYPE_PARAMETER="SignType",this.EU_SIGN_INCLUDE_CA_CERTIFICATES_PARAMETER="SignIncludeCACertificates",this.EU_FS_CALCULATE_FINGERPRINT="FSCalculateFingerprint",this.EU_FORCE_USE_TSP_FROM_SETTINGS_PARAMETER="ForceUseTSPFromSettings",this.EU_STRING_ENCODING_PARAMETER="StringEncoding",this.EU_CHECK_CERT_CHAIN_ON_SIGN_TIME_PARAMETER="CheckCertChainOnSignTime",this.EU_CONNECTIONS_TIMEOUT_PARAMETER="ConnectionsTimeout",this.EU_LOG_EVENTS_THRESHOLD_PARAMETER="LogEventsThreshold",this.EU_SETTINGS_ID_NONE=0,this.EU_SETTINGS_ID_MANDATORY=31,this.EU_SETTINGS_ID_ALL=1023,this.EU_SETTINGS_ID_FSTORE=1,this.EU_SETTINGS_ID_PROXY=2,this.EU_SETTINGS_ID_TSP=4,this.EU_SETTINGS_ID_OCSP=8,this.EU_SETTINGS_ID_LDAP=16,this.EU_SETTINGS_ID_MODE=32,this.EU_SETTINGS_ID_CMP=64,this.EU_SETTINGS_ID_KM=128,this.EU_SETTINGS_ID_OCSP_ACCESS_INFO_MODE=256,this.EU_SETTINGS_ID_OCSP_ACCESS_INFO=512,this.EU_SETTINGS_ID_TSL=1024,this.EU_SETTINGS_ID_LOG=2048,this.EU_HEADER_CA_TYPE="UA1",this.EU_HEADER_PART_TYPE_SIGNED=1,this.EU_HEADER_PART_TYPE_ENCRYPTED=2,this.EU_HEADER_PART_TYPE_STAMPED=3,this.EU_HEADER_PART_TYPE_CERTCRYPT=4,this.EU_HEADER_MAX_CA_TYPE_SIZE=3,this.EU_SIGNED_CRYPTO_HEADER=this.EU_HEADER_PART_TYPE_SIGNED,this.EU_ENCRYPTED_CRYPTO_HEADER=this.EU_HEADER_PART_TYPE_ENCRYPTED,this.EU_TIMESTAMPED_CRYPTO_HEADER=this.EU_HEADER_PART_TYPE_STAMPED,this.EU_CERTCRYPT_CRYPTO_HEADER=this.EU_HEADER_PART_TYPE_CERTCRYPT,this.EU_DEFAULT_LANG=0,this.EU_UA_LANG=1,this.EU_RU_LANG=2,this.EU_EN_LANG=3,this.EU_CONTENT_ENC_ALGO_TDES_CBC=4,this.EU_CONTENT_ENC_ALGO_AES_128_CBC=5,this.EU_CONTENT_ENC_ALGO_AES_192_CBC=6,this.EU_CONTENT_ENC_ALGO_AES_256_CBC=7,this.EU_DEV_CTX_MIN_PUBLIC_DATA_ID=16,this.EU_DEV_CTX_MAX_PRIVATE_DATA_ID=175,this.EU_UA_OID_EXT_KEY_USAGE_STAMP="1.2.804.2.1.1.1.3.9",this.EU_CCS_TYPE_REVOKE=1,this.EU_CCS_TYPE_HOLD=2,this.EU_REVOCATION_REASON_UNKNOWN=0,this.EU_REVOCATION_REASON_KEY_COMPROMISE=1,this.EU_REVOCATION_REASON_NEW_ISSURED=2,this.EU_SIGN_TYPE_UNKNOWN=0,this.EU_SIGN_TYPE_CADES_BES=1,this.EU_SIGN_TYPE_CADES_T=4,this.EU_SIGN_TYPE_CADES_C=8,this.EU_SIGN_TYPE_CADES_X_LONG=16,this.EU_SIGN_TYPE_CADES_X_LONG_TRUSTED=128,this.EU_CHECK_PRIVATE_KEY_CONTEXT_PARAMETER="CheckPrivateKey",this.EU_RESOLVE_OIDS_CONTEXT_PARAMETER="ResolveOIDs",this.EU_EXPORATABLE_CONTEXT_CONTEXT_PARAMETER="ExportableContext",this.EU_RECIPIENT_APPEND_TYPE_BY_ISSUER_SERIAL=1,this.EU_RECIPIENT_APPEND_TYPE_BY_KEY_ID=2,this.EU_CTX_HASH_ALGO_UNKNOWN=0,this.EU_CTX_HASH_ALGO_GOST34311=1,this.EU_CTX_HASH_ALGO_SHA160=2,this.EU_CTX_HASH_ALGO_SHA224=3,this.EU_CTX_HASH_ALGO_SHA256=4,this.EU_CTX_SIGN_UNKNOWN=0,this.EU_CTX_SIGN_DSTU4145_WITH_GOST34311=1,this.EU_CTX_SIGN_RSA_WITH_SHA=2,this.EU_CTX_SIGN_ECDSA_WITH_SHA=3,this.EU_FILE_PROCESS_CHUNK_SIZE=1048576,this.EU_ASIC_TYPE_UNKNOWN=0,this.EU_ASIC_TYPE_S=1,this.EU_ASIC_TYPE_E=2,this.EU_ASIC_SIGN_TYPE_UNKNOWN=0,this.EU_ASIC_SIGN_TYPE_CADES=1,this.EU_ASIC_SIGN_TYPE_XADES=2,this.EU_ASIC_SIGN_LEVEL_BES=1,this.EU_ASIC_SIGN_LEVEL_T=4,this.EU_ASIC_SIGN_LEVEL_C=8,this.EU_ASIC_SIGN_LEVEL_X_LONG=16,this.EU_ASIC_SIGN_LEVEL_X_LONG_TRUSTED=128,this.EU_XADES_SIGN_TYPE_UNKNOWN=0,this.EU_XADES_TYPE_DETACHED=1,this.EU_XADES_TYPE_ENVELOPING=2,this.EU_XADES_TYPE_ENVELOPED=3,this.EU_XADES_SIGN_LEVEL_BES=1,this.EU_XADES_SIGN_LEVEL_T=4,this.EU_XADES_SIGN_LEVEL_B_LT=16,this.EU_XADES_SIGN_LEVEL_B_LTA=32,this.EU_PADES_SIGN_LEVEL_B_B=1,this.EU_PADES_SIGN_LEVEL_B_T=4,this.EU_PADES_SIGN_LEVEL_B_LT=16,this.EU_PADES_SIGN_LEVEL_B_LTA=32,this.EU_CP_ACP_ENCODING=0,this.EU_CP_1251_ENCODING=1251,this.EU_UTF8_ENCODING=65001,this.m_language=this.EU_DEFAULT_LANG,this.m_lastErrorCode=tt.ERROR_NONE,this.m_lastError="",this.m_charset="UTF-8",this.m_stringCoder=new e,this.m_base64Coder=new s,this.m_dateCoder=new o,this.m_browserInfo=new u;var r=1;switch(t){case"chrome-extension://jffafkigfgmjafhpkoibhfefeaebmccg/":r=2,this.m_browserInfo.GetName()==u.BROWSER_NAME_FIREFOX&&(t="eusw@iit.com.ua");break;case"clsid:B7E24C75-E343-4DA2-A8D3-C80970FB7D7B":r=4;break;case"application/x-eusign-cp":r=3}this.m_jsonRpcClient=new l(r,t,n,"https:"==window.location.protocol),this.m_monitorLibraryTimer=null};return nt.prototype._funcMakeParams=function(t){var e=[];null==t&&(t=[]);for(var n=function(t){if(E(t))return t.encode();if(Array.isArray(t)){for(var e=t.length,r=[],i=0;i<e;i++)r[i]=n(t[i]);return r}return t},r=t.length,i=0;i<r;i++)e[i]=n(t[i]);return e},nt.prototype._funcCall=function(t,e,n,r,i){var o;if(!this.IsAsync(n,r))return o=this.m_jsonRpcClient.execute(t,e,null),o=this._funcHandleResult(o),i?i(o):o;var s=null==i?n:function(t){i(t,n,r)},a=this;this.m_jsonRpcClient.execute(t,e,(function(t){a._funcHandleResult(t,s,r)}))},nt.prototype._funcHandleResult=function(t,e,n){var r,i,o=this.IsAsync(e,n);if(null==t){if(r=this.MakeError(tt.ERROR_LIBRARY_COMUNICATION_FAILED,""),o)return void n(r);throw new et(r.errorCode,r.message)}if(i=(r=t.error).code,tt.isError(i)){if(i==tt.WARNING_END_OF_ENUM)return o?void e(null):null;if(r=this.MakeError(i,r.message),o)return void n(r);throw new et(r.errorCode,r.message)}try{t=this._funcDecodeResult(t.result)}catch(t){if(r=this.MakeError(tt.ERROR_LIBRARY_COMUNICATION_FAILED,""),o)return void n(r);throw new et(r.errorCode,r.message)}if(!o)return t;e(t)},nt.prototype._funcDecodeResult=function(t){if(null==t)return null;var e=function(t){if(Array.isArray(t)){for(var n=[],r=t.length,i=0;i<r;i++)n[i]=e(t[i]);return n}if("object"==typeof t){var o,s=t.className;return(o=new y[s]).decode(t)?"EndUserByteArray"==o.className?o.GetData():o:null}return t};return e(t)},nt.prototype._checkVersion=function(t){try{var e=this.classVersion;if(e==t)return!0;if(e=e.split("."),t=t.split("."),e.length!=t.length)return!1;for(var n=0;n<t.length;n++)if(parseInt(e[n])>parseInt(t[n]))return!1}catch(t){return!1}return!0},nt.prototype._stringToBytes=function(t,e){try{return this.m_stringCoder.encode(t)}catch(t){var n=this.MakeError(tt.ERROR_BAD_PARAMETER,"");if(void 0!==e)return setTimeout((function(){e(n)}),1),null;throw new et(n.errorCode,n.message)}},nt.prototype._bytesToString=function(t,e){try{return this.m_stringCoder.decode(t)}catch(t){var n=this.MakeError(tt.ERROR_BAD_PARAMETER,"");if(void 0!==e)return setTimeout((function(){e(n)}),1),null;throw new et(n.errorCode,n.message)}},nt.prototype._base64Encode=function(t,e){try{return this.m_base64Coder.encode(t)}catch(t){var n=this.MakeError(tt.ERROR_BAD_PARAMETER,"");if(void 0!==e)return setTimeout((function(){e(n)}),1),null;throw new et(n.errorCode,n.message)}},nt.prototype._base64Decode=function(t,e){try{return this.m_base64Coder.decode(t)}catch(t){var n=this.MakeError(tt.ERROR_BAD_PARAMETER,"");if(void 0!==e)return setTimeout((function(){e(n)}),1),null;throw new et(n.errorCode,n.message)}},nt.prototype._copyArrayData=function(t,e){try{if(t.length!=e.length)return!1;if(Array.isArray(e)||Array.isArray(t))for(var n=0;n<e.length;n++)t[n]=e[n];else t.set(e);return!0}catch(t){return!1}},nt.prototype._startMonitorLibraryStatus=function(){var t=this;try{t.m_monitorLibraryTimer=setInterval((function(){t.IsInitialized((function(e){e||t._stopMonitorLibraryStatus()}),(function(e){t._stopMonitorLibraryStatus()}))}),6e5)}catch(t){}},nt.prototype._stopMonitorLibraryStatus=function(){try{if(null==this.m_monitorLibraryTimer)return;clearInterval(this.m_monitorLibraryTimer),this.m_monitorLibraryTimer=null}catch(t){}},nt.prototype._getAndroidAppIntentURL=function(t,e){var n="intent://addurlandstart?url={URL_LOCATION}#Intent;scheme=saclient;package=ua.com.iit.signagentmanagement;S.browser_fallback_url={URL_INSTALL};end;";return n=(n=n.replace("{URL_LOCATION}",encodeURIComponent(location.origin))).replace("{URL_INSTALL}",encodeURIComponent(t+"/"+e))},nt.prototype.IsAsync=function(t,e){return void 0!==t&&void 0!==e},nt.prototype.MakeError=function(t,e){return""==e&&(e=tt.getErrorDescriptionEx(t,this.m_language)),this.m_lastErrorCode=t,this.m_lastError=e,new tt(t,e)},nt.prototype.RaiseError=function(t,e){var n;throw new et((n=this.MakeError(t,e)).errorCode,n.message)},nt.prototype.GetInstallURL=function(t,e){var n=this,r=n.m_browserInfo.GetOSName(),i=n.m_browserInfo.GetArch(),o=[];e=e||"https://iit.com.ua/download/productfiles";var s,a=function(t){o.push(e+"/"+t)};switch(r){case u.OS_NAME_WINDOWS:a("EUSignWebInstall.exe");break;case u.OS_NAME_MAC:a("EUSignWebInstall.pkg");break;case u.OS_NAME_LINUX:i==u.BROWSER_ARCH_NAME_X86?(a("euswi.deb"),a("euswi.rpm"),a("euswi.tar")):(a("euswi.64.deb"),a("euswi.64.rpm"),a("euswi.64.tar"));break;case u.OS_NAME_ANDROID:s="EUSignWebInstall.apk",o.push(n._getAndroidAppIntentURL(e,s));break;default:return null}return t?o:o[0]},nt.prototype.GetUpdateURL=function(t,e){var n=this,r=n.m_browserInfo.GetOSName(),i=n.m_browserInfo.GetArch(),o=[];e=e||"https://iit.com.ua/download/productfiles";var s,a=function(t){o.push(e+"/"+t)};switch(r){case u.OS_NAME_WINDOWS:a("EUSignWebUpdate.exe");break;case u.OS_NAME_MAC:a("EUSignWebInstall.pkg");break;case u.OS_NAME_LINUX:i==u.BROWSER_ARCH_NAME_X86?(a("euswi.deb"),a("euswi.rpm"),a("euswi.tar")):(a("euswi.64.deb"),a("euswi.64.rpm"),a("euswi.64.tar"));break;case u.OS_NAME_ANDROID:s="EUSignWebInstall.apk",o.push(n._getAndroidAppIntentURL(e,s));break;default:return null}return t?o:o[0]},nt.prototype.GetHelpURL=function(t){switch(t=t||"https://iit.com.ua/download/productfiles",this.m_browserInfo.GetOSName()){case u.OS_NAME_WINDOWS:case u.OS_NAME_MAC:case u.OS_NAME_LINUX:return t+"/EUSignWebOManual.pdf";default:return null}},nt.prototype.GetWebExtensionInstallURL=function(){switch(this.m_browserInfo.GetName()){case u.BROWSER_NAME_CHROME:return t;case u.BROWSER_NAME_FIREFOX:return"https://eu.iit.com.ua/download/productfiles/eusw@iit.com.ua.xpi";case u.BROWSER_NAME_OPERA:return"https://chrome.google.com/webstore/detail/%D1%96%D1%96%D1%82-%D0%BA%D0%BE%D1%80%D0%B8%D1%81%D1%82%D1%83%D0%B2%D0%B0%D1%87-%D1%86%D1%81%D0%BA-1-%D0%B1%D1%96%D0%B1%D0%BB/jffafkigfgmjafhpkoibhfefeaebmccg?utm_source=chrome-app-launcher-info-dialog";default:return null}},nt.prototype.GetInstallPath=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("GetInstallPath",n,t,e,null)},nt.prototype.SelectFile=function(t,e,n,r){return this.SelectFileEx(t,e,null,null,null,null,n,r)},nt.prototype.SelectFileEx=function(t,e,n,r,i,o,s,a){var u;return u=this._funcMakeParams([t,e,n,r,i,o]),this._funcCall("SelectFile",u,s,a,null)},nt.prototype.SelectFolder=function(t,e){return this.SelectFolderEx(null,null,null,t,e)},nt.prototype.SelectFolderEx=function(t,e,n,r,i){var o;return o=this._funcMakeParams([t,e,n]),this._funcCall("SelectFolder",o,r,i,null)},nt.prototype.CreateFolder=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("CreateFolder",r,e,n,null)},nt.prototype.ReadFile=function(t,e,n){var r=this.IsAsync(e,n),i=this,o=i.EU_FILE_PROCESS_CHUNK_SIZE;if(!r){for(var s,a=i.GetFileSize(t),u=Math.floor(a/o),c=a%o,l=new Uint8Array(a),f=0;f<u;f++)s=i.ReadFileWithOffset(t,f*o,o),l.set(s,f*o,s.length);return 0!=c&&(s=i.ReadFileWithOffset(t,u*o,c),l.set(s,u*o,s.length)),l}var p={buf:null,length:0,curLength:0},_=function(r){if(r.curLength!=r.length){var s=r.length-r.curLength;s>o&&(s=o),i.ReadFileWithOffset(t,r.curLength,s,(function(t){r.buf.set(t,r.curLength,t.length),r.curLength+=t.length,_(r)}),n)}else e(r.buf)};i.GetFileSize(t,(function(t){p.buf=new Uint8Array(t),p.length=t,_(p)}),n)},nt.prototype.WriteFile=function(t,e,n,r){var i=this.IsAsync(n,r),o=this,s=o.EU_FILE_PROCESS_CHUNK_SIZE;if(i){var a={buf:null,length:0,curLength:0},u=function(e,i){if(i||e.curLength!=e.length){var a=e.length-e.curLength;a>s&&(a=s),o.WriteFileWithOffset(t,e.curLength,o.Copy(e.buf,e.curLength,s),(function(){e.curLength+=a,u(e,!1)}),r)}else n()};a.buf=e,a.length=e.length,u(a,!0)}else{for(var c=e.length,l=Math.floor(c/s),f=c%s,p=0;p<l;p++)o.WriteFileWithOffset(t,p*s,o.Copy(e,p*s,s));0==f&&0!=e.length||o.WriteFileWithOffset(t,l*s,o.Copy(e,l*s,f))}},nt.prototype.GetFileSize=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("GetFileSize",r,e,n,null)},nt.prototype.ReadFileWithOffset=function(t,e,n,r,i){var o;return o=this._funcMakeParams([t,e,n]),this._funcCall("ReadFileWithOffset",o,r,i,null)},nt.prototype.WriteFileWithOffset=function(t,e,n,r,i){var o;return o=this._funcMakeParams([t,e,new S(n)]),this._funcCall("WriteFileWithOffset",o,r,i,null)},nt.prototype.DeleteFile=function(t,e,n){var r;r=this._funcMakeParams([t]),this._funcCall("DeleteFile",r,e,n,null)},nt.prototype.AppendFile=function(t,e,n,r){var i;i=this._funcMakeParams([t,e]),this._funcCall("AppendFile",i,n,r,null)},nt.prototype.CopyFileWithOffset=function(t,e,n,r,i,o){var s;s=this._funcMakeParams([t,e,n,r]),this._funcCall("CopyFileWithOffset",s,i,o,null)},nt.prototype.Load=function(t,e){var n=this.IsAsync(t,e),r=this;if(n)this.GetVersion((function(n){if(r._checkVersion(n))t();else{var i=r.MakeError(tt.ERROR_LIBRARY_VERSION_NOT_SUPPORTED,"");e(i)}}),(function(t){t=r.MakeError(tt.ERROR_LIBRARY_COMUNICATION_FAILED,""),e(t)}));else{var i;try{i=this._checkVersion(this.GetVersion())}catch(t){this.RaiseError(tt.ERROR_LIBRARY_COMUNICATION_FAILED,"")}i||this.RaiseError(tt.ERROR_LIBRARY_VERSION_NOT_SUPPORTED,"")}},nt.prototype.GetVersion=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("GetVersion",n,t,e,null)},nt.prototype.IsInitialized=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("IsInitialized",n,t,e,null)},nt.prototype.Initialize=function(t,e){var n,r=this,i=this.IsAsync(t,e);n=this._funcMakeParams(null),this._funcCall("Initialize",n,i?function(){r._startMonitorLibraryStatus(),t()}:t,e,null),i||r._startMonitorLibraryStatus()},nt.prototype.Finalize=function(t,e){var n;this._stopMonitorLibraryStatus(),n=this._funcMakeParams(null),this._funcCall("Finalize",n,t,e,null)},nt.prototype.ResetOperation=function(t,e){var n;n=this._funcMakeParams(null),this._funcCall("ResetOperation",n,t,e,null)},nt.prototype.SetUIMode=function(t,e,n){var r;r=this._funcMakeParams([t]),this._funcCall("SetUIMode",r,e,n,null)},nt.prototype.SetLanguage=function(t,e,n){var r,i=this,o=this.IsAsync(e,n);r=this._funcMakeParams([t]),this._funcCall("SetLanguage",r,o?function(){i.m_language=t,e()}:e,n,null),o||(this.m_language=t)},nt.prototype.SetCharset=function(t,e,n){var r,o=this.IsAsync(e,n);if(null==(r=i.GetCoder(t))){var s=this.MakeError(tt.ERROR_BAD_PARAMETER,"");if(o)return void setTimeout((function(){n(s)}),1);throw new et(s.errorCode,s.message)}this.m_stringCoder=r,this.m_charset=t,o&&setTimeout((function(){e()}),1)},nt.prototype.SetRuntimeParameter=function(t,e,n,r){var i;"boolean"==typeof e&&(e=e?1:0),i=this._funcMakeParams([t,e]),this._funcCall("SetRuntimeParameter",i,n,r,null)},nt.prototype.GetStorageParameter=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("GetStorageParameter",i,n,r,null)},nt.prototype.SetStorageParameter=function(t,e,n,r,i){var o;o=this._funcMakeParams([t,e,n]),this._funcCall("SetStorageParameter",o,r,i,null)},nt.prototype.CreateArrayList=function(){return new _},nt.prototype.GetLastError=function(){return this.m_lastError},nt.prototype.GetLastErrorCode=function(){return this.m_lastErrorCode},nt.prototype.BASE64Encode=function(t,e,n){var r=this._base64Encode(t,n);if(!this.IsAsync(e,n))return r;setTimeout((function(){e(r)}),1)},nt.prototype.BASE64Decode=function(t,e,n){var r=this._base64Decode(t,n);if(!this.IsAsync(e,n))return r;setTimeout((function(){e(r)}),1)},nt.prototype.StringToBytes=function(t,e,n){var r=this._stringToBytes(t,n);if(!this.IsAsync(e,n))return r;setTimeout((function(){e(r)}),1)},nt.prototype.BytesToString=function(t,e,n){var r=this._bytesToString(t,n);if(!this.IsAsync(e,n))return r;setTimeout((function(){e(r)}),1)},nt.prototype.Concatenate=function(t,e){if(Array.isArray(t)&&Array.isArray(e))return t.concat(e);var n,r=t.length+e.length;if(Array.isArray(t)||Array.isArray(e)){var i,o;for(n=new Array(r),i=0;i<t.length;i++)n[i]=t[i];for(o=0;o<e.length;i++,o++)n[i]=e[o]}else(n=new h(r)).set(t),n.set(e,t.length);return n},nt.prototype.Copy=function(t,e,n){return t.slice(e,e+n)},nt.prototype.SetSettings=function(t,e){var n;n=this._funcMakeParams(null),this._funcCall("SetSettings",n,t,e,null)},nt.prototype.DoesNeedSetSettings=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("DoesNeedSetSettings",n,t,e,null)},nt.prototype.InitializeMandatorySettings=function(t,e){var n=this;if(this.IsAsync(t,e))a((function(t){var r=n.CreateFileStoreSettings();n.SetFileStoreSettings(r,t,e)})).eu_wait((function(t){n.GetProxySettings((function(e){t()}),(function(r){n.GetSystemProxySettings((function(r){n.SetProxySettings(r,t,e)}),(function(r){var i=n.CreateProxySettings();n.SetProxySettings(i,t,e)}))}))})).eu_wait((function(t){var r=n.CreateTSPSettings();n.SetTSPSettings(r,t,e)})).eu_wait((function(t){var r=n.CreateLDAPSettings();n.SetLDAPSettings(r,t,e)})).eu_wait((function(){var r=n.CreateOCSPSettings();n.SetOCSPSettings(r,t,e)}));else{var r,i=n.CreateFileStoreSettings();n.SetFileStoreSettings(i);try{r=n.GetProxySettings()}catch(t){r=n.CreateProxySettings();try{r=n.GetSystemProxySettings()}catch(t){}n.SetProxySettings(r)}var o=n.CreateTSPSettings();n.SetTSPSettings(o);var s=n.CreateLDAPSettings();n.SetLDAPSettings(s);var u=n.CreateOCSPSettings();n.SetOCSPSettings(u)}},nt.prototype.CreateModeSettings=function(){return new T},nt.prototype.GetModeSettings=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("GetModeSettings",n,t,e,null)},nt.prototype.SetModeSettings=function(t,e,n){var r;r=this._funcMakeParams([t]),this._funcCall("SetModeSettings",r,e,n,null)},nt.prototype.CreateKeyMediaSettings=function(){return new U},nt.prototype.GetKeyMediaSettings=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("GetKeyMediaSettings",n,t,e,null)},nt.prototype.SetKeyMediaSettings=function(t,e,n){var r;r=this._funcMakeParams([t]),this._funcCall("SetKeyMediaSettings",r,e,n,null)},nt.prototype.CreateFileStoreSettings=function(){return new d},nt.prototype.GetFileStoreSettings=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("GetFileStoreSettings",n,t,e,null)},nt.prototype.SetFileStoreSettings=function(t,e,n){var r;r=this._funcMakeParams([t]),this._funcCall("SetFileStoreSettings",r,e,n,null)},nt.prototype.CreateProxySettings=function(){return new R},nt.prototype.GetProxySettings=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("GetProxySettings",n,t,e,null)},nt.prototype.SetProxySettings=function(t,e,n){var r;r=this._funcMakeParams([t]),this._funcCall("SetProxySettings",r,e,n,null)},nt.prototype.CreateOCSPSettings=function(){return new A},nt.prototype.GetOCSPSettings=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("GetOCSPSettings",n,t,e,null)},nt.prototype.SetOCSPSettings=function(t,e,n){var r;r=this._funcMakeParams([t]),this._funcCall("SetOCSPSettings",r,e,n,null)},nt.prototype.CreateOCSPAccessInfoModeSettings=function(){return new v},nt.prototype.GetOCSPAccessInfoModeSettings=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("GetOCSPAccessInfoModeSettings",n,t,e,null)},nt.prototype.SetOCSPAccessInfoModeSettings=function(t,e,n){var r;r=this._funcMakeParams([t]),this._funcCall("SetOCSPAccessInfoModeSettings",r,e,n,null)},nt.prototype.CreateOCSPAccessInfoSettings=function(){return new I},nt.prototype.EnumOCSPAccessInfoSettings=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("EnumOCSPAccessInfoSettings",r,e,n,null)},nt.prototype.GetOCSPAccessInfoSettings=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("GetOCSPAccessInfoSettings",r,e,n,null)},nt.prototype.SetOCSPAccessInfoSettings=function(t,e,n){var r,i=this,o=i.IsAsync(e,n);if(t=Array.isArray(t)?t:[t],o){var s=function(o){o>=t.length?e():(r=i._funcMakeParams([t[o]]),i._funcCall("SetOCSPAccessInfoSettings",r,(function(){s(o+1)}),n,null))};s(0)}else for(var a=0;a<t.length;a++)r=i._funcMakeParams([t[a]]),i._funcCall("SetOCSPAccessInfoSettings",r,e,n,null)},nt.prototype.DeleteOCSPAccessInfoSettings=function(t,e,n){var r;r=this._funcMakeParams([t]),this._funcCall("DeleteOCSPAccessInfoSettings",r,e,n,null)},nt.prototype.CreateTSPSettings=function(){return new m},nt.prototype.GetTSPSettings=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("GetTSPSettings",n,t,e,null)},nt.prototype.SetTSPSettings=function(t,e,n){var r;r=this._funcMakeParams([t]),this._funcCall("SetTSPSettings",r,e,n,null)},nt.prototype.CreateLDAPSettings=function(){return new P},nt.prototype.GetLDAPSettings=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("GetLDAPSettings",n,t,e,null)},nt.prototype.SetLDAPSettings=function(t,e,n){var r;r=this._funcMakeParams([t]),this._funcCall("SetLDAPSettings",r,e,n,null)},nt.prototype.CreateCMPSettings=function(){return new g},nt.prototype.GetCMPSettings=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("GetCMPSettings",n,t,e,null)},nt.prototype.SetCMPSettings=function(t,e,n){var r;r=this._funcMakeParams([t]),this._funcCall("SetCMPSettings",r,e,n,null)},nt.prototype.GetSystemProxySettings=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("GetSystemProxySettings",n,t,e,null)},nt.prototype.SetOCSPResponseExpireTime=function(t,e,n){var r;r=this._funcMakeParams([t]),this._funcCall("SetOCSPResponseExpireTime",r,e,n,null)},nt.prototype.CreateTSLSettings=function(){return new b},nt.prototype.GetTSLSettings=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("GetTSLSettings",n,t,e,null)},nt.prototype.SetTSLSettings=function(t,e,n){var r;r=this._funcMakeParams([t]),this._funcCall("SetTSLSettings",r,e,n,null)},nt.prototype.RefreshFileStore=function(t,e,n){var r;r=this._funcMakeParams([t]),this._funcCall("RefreshFileStore",r,e,n,null)},nt.prototype.ShowCertificates=function(t,e){var n;n=this._funcMakeParams(null),this._funcCall("ShowCertificates",n,t,e,null)},nt.prototype.SelectCertificateInfo=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("SelectCertificateInfo",n,t,e,null)},nt.prototype.GetCertificatesCount=function(t,e,n,r){var i;return"number"==typeof t&&"number"==typeof e||(n=t,r=e,t=this.SUBJECT_TYPE_UNDIFFERENCED,e=this.SUBJECT_CA_SERVER_SUB_TYPE_UNDIFFERENCED),i=this._funcMakeParams([t,e]),this._funcCall("GetCertificatesCount",i,n,r,null)},nt.prototype.GetCACertificatesCount=function(t,e){return this.GetCertificatesCount(this.SUBJECT_TYPE_CA,this.SUBJECT_CA_SERVER_SUB_TYPE_UNDIFFERENCED,t,e)},nt.prototype.GetCAServerCertificatesCount=function(t,e){return this.GetCertificatesCount(this.SUBJECT_TYPE_CA_SERVER,this.SUBJECT_CA_SERVER_SUB_TYPE_UNDIFFERENCED,t,e)},nt.prototype.GetCMPServerCertificatesCount=function(t,e){return this.GetCertificatesCount(this.SUBJECT_TYPE_CA_SERVER,this.SUBJECT_CA_SERVER_SUB_TYPE_CMP,t,e)},nt.prototype.GetOCSPServerCertificatesCount=function(t,e){return this.GetCertificatesCount(this.SUBJECT_TYPE_CA_SERVER,this.SUBJECT_CA_SERVER_SUB_TYPE_OCSP,t,e)},nt.prototype.GetTSPServerCertificatesCount=function(t,e){return this.GetCertificatesCount(this.SUBJECT_TYPE_CA_SERVER,this.SUBJECT_CA_SERVER_SUB_TYPE_TSP,t,e)},nt.prototype.GetRAAdministratorCertificatesCount=function(t,e){return this.GetCertificatesCount(this.SUBJECT_TYPE_RA_ADMINISTRATOR,this.SUBJECT_CA_SERVER_SUB_TYPE_UNDIFFERENCED,t,e)},nt.prototype.GetEndUserCertificatesCount=function(t,e){return this.GetCertificatesCount(this.SUBJECT_TYPE_END_USER,this.SUBJECT_CA_SERVER_SUB_TYPE_UNDIFFERENCED,t,e)},nt.prototype.EnumCertificates=function(t,e,n,r,i){var o;return"number"==typeof e&&"number"==typeof n||(r=e,i=n,n=t,t=this.SUBJECT_TYPE_UNDIFFERENCED,e=this.SUBJECT_CA_SERVER_SUB_TYPE_UNDIFFERENCED),o=this._funcMakeParams([t,e,n]),this._funcCall("EnumCertificates",o,r,i,null)},nt.prototype.EnumCACertificates=function(t,e,n){return this.EnumCertificates(t,this.SUBJECT_TYPE_CA,this.SUBJECT_CA_SERVER_SUB_TYPE_UNDIFFERENCED,e,n)},nt.prototype.EnumCAServerCertificates=function(t,e,n){return this.EnumCertificates(t,this.SUBJECT_TYPE_CA_SERVER,this.SUBJECT_CA_SERVER_SUB_TYPE_UNDIFFERENCED,e,n)},nt.prototype.EnumCMPServerCertificatesCount=function(t,e,n){return this.EnumCertificates(t,this.SUBJECT_TYPE_CA_SERVER,this.SUBJECT_CA_SERVER_SUB_TYPE_CMP,e,n)},nt.prototype.EnumOCSPServerCertificatesCount=function(t,e,n){return this.EnumCertificates(t,this.SUBJECT_TYPE_CA_SERVER,this.SUBJECT_CA_SERVER_SUB_TYPE_OCSP,e,n)},nt.prototype.EnumTSPServerCertificatesCount=function(t,e,n){return this.EnumCertificates(t,this.SUBJECT_TYPE_CA_SERVER,this.SUBJECT_CA_SERVER_SUB_TYPE_TSP,e,n)},nt.prototype.EnumRAAdministratorCertificatesCount=function(t,e,n){return this.EnumCertificates(t,this.SUBJECT_TYPE_RA_ADMINISTRATOR,this.SUBJECT_CA_SERVER_SUB_TYPE_UNDIFFERENCED,e,n)},nt.prototype.EnumEndUserCertificatesCount=function(t,e,n){return this.EnumCertificates(t,this.SUBJECT_TYPE_END_USER,this.SUBJECT_CA_SERVER_SUB_TYPE_UNDIFFERENCED,e,n)},nt.prototype.GetCertificateInfo=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("GetCertificateInfo",i,n,r,null)},nt.prototype.GetCertificateInfoEx=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("GetCertificateInfoEx",i,n,r,null)},nt.prototype.GetCertificate=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("GetCertificate",i,n,r,null)},nt.prototype.CheckCertificateByIssuerAndSerial=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("CheckCertificateByIssuerAndSerial",i,n,r,null)},nt.prototype.CheckCertificate=function(t,e,n){var r;return r=this._funcMakeParams([new S(t)]),this._funcCall("CheckCertificate",r,e,n,null)},nt.prototype.ParseCertificate=function(t,e,n){var r;return r=this._funcMakeParams([new S(t)]),this._funcCall("ParseCertificate",r,e,n,null)},nt.prototype.ParseCertificateEx=function(t,e,n){var r;return r=this._funcMakeParams([new S(t)]),this._funcCall("ParseCertificateEx",r,e,n,null)},nt.prototype.SaveCertificate=function(t,e,n){var r;return r=this._funcMakeParams([new S(t)]),this._funcCall("SaveCertificate",r,e,n,null)},nt.prototype.SaveCertificates=function(t,e,n){var r;return r=this._funcMakeParams([new S(t)]),this._funcCall("SaveCertificates",r,e,n,null)},nt.prototype.SaveCertificatesEx=function(t,e,n,r){var i;return i=this._funcMakeParams([new S(t),e?new S(e):null]),this._funcCall("SaveCertificatesEx",i,n,r,null)},nt.prototype.GetCertificatesFromLDAPByEDRPOUCode=function(t,e,n,r,i,o,s){var a;return null!=r&&null!=i?("EndUserArrayList"==r.className&&(r=r.m_array),"EndUserArrayList"==i.className&&(i=i.m_array)):(r=null,i=null),a=this._funcMakeParams([t,e,n,r,i]),this._funcCall("GetCertificatesFromLDAPByEDRPOUCode",a,o,s,null)},nt.prototype.GetCertificateByEmail=function(t,e,n,r,i,o){var s;return"string"!=typeof r&&(r=this.m_dateCoder.encode(r)),s=this._funcMakeParams([t,e,n,r]),this._funcCall("GetCertificateByEmail",s,i,o,null)},nt.prototype.GetCertificateByNBUCode=function(t,e,n,r,i,o){var s;return"string"!=typeof r&&(r=this.m_dateCoder.encode(r)),s=this._funcMakeParams([t,e,n,r]),this._funcCall("GetCertificateByNBUCode",s,i,o,null)},nt.prototype.GetReceiversCertificates=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("GetReceiversCertificates",n,t,e,null)},nt.prototype.GetReceiversCertificatesInArrayList=function(t,e){var n,r=this;return n=this._funcMakeParams(null),this._funcCall("GetReceiversCertificates",n,t,e,(function(t,e,n){var i=r.IsAsync(e,n);try{for(var o=new _,s=0;s<t.length;s++)o.add(t[s]);if(!i)return o;e(o)}catch(t){var a=r.MakeError(tt.ERROR_LIBRARY_COMUNICATION_FAILED,"");if(i)return void n(a);throw new et(a.errorCode,a.message)}}))},nt.prototype.GetCertificates=function(t,e,n,r){var i,o=this;return i=this._funcMakeParams([t,e]),this._funcCall("GetCertificates",i,n,r,(function(t,e,n){var r=o.IsAsync(e,n);try{for(var i=new _,s=0;s<t.length;s++)i.add(t[s]);if(!r)return i;e(i)}catch(t){var a=o.MakeError(tt.ERROR_LIBRARY_COMUNICATION_FAILED,"");if(r)return void n(a);throw new et(a.errorCode,a.message)}}))},nt.prototype.GetCertificateByFingerprint=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("GetCertificateByFingerprint",r,e,n,null)},nt.prototype.GetCertificatesByEDRPOUAndDRFOCode=function(t,e,n,r){var i,o=this;return i=this._funcMakeParams([t,e]),this._funcCall("GetCertificatesByEDRPOUAndDRFOCode",i,n,r,(function(t,e,n){var r=o.IsAsync(e,n);try{for(var i=new _,s=0;s<t.length;s++)i.add(t[s]);if(!r)return i;e(i)}catch(t){var a=o.MakeError(tt.ERROR_LIBRARY_COMUNICATION_FAILED,"");if(r)return void n(a);throw new et(a.errorCode,a.message)}}))},nt.prototype.ShowCRLs=function(t,e){var n;n=this._funcMakeParams(null),this._funcCall("ShowCRLs",n,t,e,null)},nt.prototype.GetCRLsCount=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("GetCRLsCount",n,t,e,null)},nt.prototype.EnumCRLs=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("EnumCRLs",r,e,n,null)},nt.prototype.GetCRLDetailedInfo=function(t,e,n,r){var i;return i=this._funcMakeParams([t,parseInt(e)]),this._funcCall("GetCRLDetailedInfo",i,n,r,null)},nt.prototype.SaveCRL=function(t,e,n,r){var i;return i=this._funcMakeParams([t,new S(e)]),this._funcCall("SaveCRL",i,n,r,null)},nt.prototype.GetTSPByAccessInfo=function(t,e,n,r,i,o){var s;if("string"==typeof e||null!=(e=this._base64Encode(e,o)))return s=this._funcMakeParams([t,e,n,r]),this._funcCall("GetTSPByAccessInfo",s,i,o,null)},nt.prototype.CheckTSP=function(t,e,n,r,i){var o;"string"==typeof t&&null==(t=this._base64Decode(t,i))||null!=n&&"string"!=typeof n&&null==(n=this._base64Encode(n,i))||(o=this._funcMakeParams([new S(t),e,n]),this._funcCall("CheckTSP",o,r,i,null))},nt.prototype.GetOCSPResponseByAccessInfo=function(t,e,n,r,i){var o;return o=this._funcMakeParams([new S(t),e,n]),this._funcCall("GetOCSPResponseByAccessInfo",o,r,i,null)},nt.prototype.CheckOCSPResponse=function(t,e,n,r){var i;if("string"!=typeof t||null!=(t=this._base64Decode(t,r)))return null!=e&&"string"!=typeof e&&(e=this.m_dateCoder.encode(e)),i=this._funcMakeParams([new S(t),e]),this._funcCall("CheckOCSPResponse",i,n,r,null)},nt.prototype.CreateKeyMedia=function(){return new C},nt.prototype.GetPrivateKeyMedia=function(t,e,n){var r;return"string"!=typeof t&&(t=null),r=this._funcMakeParams([t]),this._funcCall("GetPrivateKeyMedia",r,e,n,null)},nt.prototype.EnumKeyMediaTypes=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("EnumKeyMediaTypes",r,e,n,null)},nt.prototype.EnumKeyMediaDevices=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("EnumKeyMediaDevices",i,n,r,null)},nt.prototype.GetKeyMediaTypes=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("GetKeyMediaTypes",n,t,e,null)},nt.prototype.GetKeyMediaDevices=function(t,e,n){var r;return"number"==typeof t&&(t=[t]),t&&(t=new S(t)),r=this._funcMakeParams([t]),this._funcCall("GetKeyMediaDevices",r,e,n,null)},nt.prototype.IsPrivateKeyReaded=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("IsPrivateKeyReaded",n,t,e,null)},nt.prototype.ReadPrivateKey=function(t,e){var n;n=this._funcMakeParams(null),this._funcCall("ReadPrivateKey",n,t,e,null)},nt.prototype.ReadPrivateKeySilently=function(t,e,n,r,i){var o,s;"number"==typeof t?((s=new C).typeIndex=t,s.devIndex=e,s.password=n):(s=t,r=e,i=n),o=this._funcMakeParams([s]),this._funcCall("ReadPrivateKeySilently",o,r,i,null)},nt.prototype.ReadPrivateKeyBinary=function(t,e,n,r){var i;i=this._funcMakeParams([new S(t),e]),this._funcCall("ReadPrivateKeyBinary",i,n,r,null)},nt.prototype.ReadPrivateKeyFile=function(t,e,n,r){var i;i=this._funcMakeParams([t,e]),this._funcCall("ReadPrivateKeyFile",i,n,r,null)},nt.prototype.CtxReadPrivateKey=function(t,e,n,r,i,o){var s,a;return"number"==typeof e?((a=new C).typeIndex=e,a.devIndex=n,a.password=r):(a=e,i=n,o=r),s=this._funcMakeParams([t,a]),this._funcCall("CtxReadPrivateKey",s,i,o,null)},nt.prototype.CtxReadPrivateKeyBinary=function(t,e,n,r,i){var o;return o=this._funcMakeParams([t,new S(e),n]),this._funcCall("CtxReadPrivateKeyBinary",o,r,i,null)},nt.prototype.ResetPrivateKey=function(t,e){var n;n=this._funcMakeParams(null),this._funcCall("ResetPrivateKey",n,t,e,null)},nt.prototype.CtxFreePrivateKey=function(t,e,n){var r;r=this._funcMakeParams([t]),this._funcCall("CtxFreePrivateKey",r,e,n,null)},nt.prototype.ShowOwnCertificate=function(t,e){var n;n=this._funcMakeParams(null),this._funcCall("ShowOwnCertificate",n,t,e,null)},nt.prototype.GetOwnCertificate=function(t,e,n,r){var i;return"number"==typeof t&&"number"==typeof e||(n=t,r=e,t=null,e=null),i=this._funcMakeParams([t,e]),this._funcCall("GetOwnCertificate",i,n,r,null)},nt.prototype.EnumOwnCertificates=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("EnumOwnCertificates",r,e,n,null)},nt.prototype.GetPrivateKeyOwnerInfo=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("GetPrivateKeyOwnerInfo",n,t,e,null)},nt.prototype.CtxEnumOwnCertificates=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("CtxEnumOwnCertificates",i,n,r,null)},nt.prototype.CtxGetOwnCertificate=function(t,e,n,r,i){var o;return o=this._funcMakeParams([t,e,n]),this._funcCall("CtxGetOwnCertificate",o,r,i,null)},nt.prototype.GetKeyInfo=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("GetKeyInfo",r,e,n,null)},nt.prototype.GetKeyInfoSilently=function(t,e,n,r,i){var o;return(o=new C).typeIndex=t,o.devIndex=e,o.password=n,this.GetKeyInfo(o,r,i)},nt.prototype.GetKeyInfoBinary=function(t,e,n,r){var i;return i=this._funcMakeParams([new S(t),e]),this._funcCall("GetKeyInfoBinary",i,n,r,null)},nt.prototype.GetKeyInfoFile=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("GetKeyInfoFile",i,n,r,null)},nt.prototype.GetCertificateByKeyInfo=function(t,e,n,r){var i,o=[];return"number"==typeof t&&"number"==typeof e||(r=n,n=e),"number"==typeof t&&"number"==typeof e?(o.push(t),o.push(e),o.push(null)):(o.push(null),o.push(null),o.push(new S(t))),i=this._funcMakeParams(o),this._funcCall("GetCertificateByKeyInfo",i,n,r,null)},nt.prototype.GetCertificatesByKeyInfo=function(t,e,n,r,i){var o;return"EndUserPrivateKeyInfo"==t.className&&(t=t.GetPrivateKeyInfo()),null!=e&&null!=n?("EndUserArrayList"==e.className&&(e=e.m_array),"EndUserArrayList"==n.className&&(n=n.m_array)):(e=null,n=null),o=this._funcMakeParams([new S(t),e,n]),this._funcCall("GetCertificatesByKeyInfo",o,r,i,null)},nt.prototype.ChangeSoftwarePrivateKeyPassword=function(t,e,n,r,i){var o;return o=this._funcMakeParams([new S(t),e,n]),this._funcCall("ChangeSoftwarePrivateKeyPassword",o,r,i,null)},nt.prototype.EnumJKSPrivateKeys=function(t,e,n,r){var i;return i=this._funcMakeParams([new S(t),e]),this._funcCall("EnumJKSPrivateKeys",i,n,r,null)},nt.prototype.EnumJKSPrivateKeysFile=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("EnumJKSPrivateKeysFile",i,n,r,null)},nt.prototype.GetJKSPrivateKey=function(t,e,n,r){var i;return i=this._funcMakeParams([new S(t),e]),this._funcCall("GetJKSPrivateKey",i,n,r,null)},nt.prototype.GetJKSPrivateKeyFile=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("GetJKSPrivateKeyFile",i,n,r,null)},nt.prototype.CreatePrivateKeyInfo=function(){return new k},nt.prototype.CreateEndUserInfo=function(){return new Y},nt.prototype._generatePrivateKey=function(t,e,n,r,i,o,s,a,u,c,l,f,p,_,h,E){if(!this.IsAsync(h,E))return this.GeneratePrivateKeyEx(t,e,n,r,!1,i,o,s,a,u,c,l,f,null,null,p,_,h,E).m_array;this.GeneratePrivateKeyEx(t,e,n,r,!1,i,o,s,a,u,c,l,f,null,null,p,_,(function(t){h(t.m_array)}),E)},nt.prototype.GeneratePrivateKey=function(t,e,n,r,i,o,s,a,u,c,l,f,p,_,h,E){if("boolean"==typeof t)return this._generatePrivateKeyEx(t,e,n,r,i,o,s,a,u,c,l,f,p,_,h,E);if("boolean"==typeof n)return this._generatePrivateKey(!0,0,0,"",t,e,n,r,i,o,s,a,null,!1,u,c);if("string"==typeof n)return this._generatePrivateKey(!1,t,e,n,r,i,o,s,a,u,c,l,null,!1,f,p);if("number"==typeof n)return this._generatePrivateKey(!1,0,0,t,e,n,r,i,o,s,a,u,c,!0,l,f);var y=this.MakeError(tt.ERROR_BAD_PARAMETER,"");throw new et(y.errorCode,y.message)},nt.prototype._generatePrivateKeyEx=function(t,e,n,r,i,o,s,a,u,c,l,f,p,h,E,y,S,d,R){var m,A,P=this;return t?A=null:((A=new C).typeIndex=e,A.devIndex=n,A.password="string"!=typeof r?"":r),null==y&&(S=!1),m=this._funcMakeParams([t,A,i,o,s,a,u,c,l,f,p,h,E,null!=y,S]),this._funcCall("GeneratePrivateKeyEx",m,d,R,(function(t,e,n){var r=P.IsAsync(e,n);try{for(var i=t[0],o=new _,s=0;s<i.length;s++)o.add(i[s]);if(null!=y&&y.set(t[1]),!r)return o;e(o)}catch(t){var a=P.MakeError(tt.ERROR_LIBRARY_COMUNICATION_FAILED,"");if(r)return void n(a);throw new et(a.errorCode,a.message)}}))},nt.prototype.GeneratePrivateKeyEx=function(t,e,n,r,i,o,s,a,u,c,l,f,p,_,h,E,y,S,C){if("boolean"==typeof t)return"boolean"==typeof i?this._generatePrivateKeyEx(t,e,n,r,i,o,s,a,u,c,l,f,p,_,h,E,y,S,C):this._generatePrivateKeyEx(t,e,n,r,!1,i,o,s,a,u,c,l,f,null,null,p,_,h,E);if("boolean"==typeof n)return void 0!==c&&null==c||"string"==typeof c?this._generatePrivateKeyEx(!0,0,0,"",!1,t,e,n,r,i,o,s,a,u,c,null,!1,l,f):this._generatePrivateKeyEx(!0,0,0,"",!1,t,e,n,r,i,o,s,a,null,null,null,!1,u,c);if("number"==typeof t)return"boolean"==typeof r?this._generatePrivateKeyEx(!1,t,e,n,r,i,o,s,a,u,c,l,f,p,_,null,!1,h,E):this._generatePrivateKeyEx(!1,t,e,n,!1,r,i,o,s,a,u,c,l,null,null,null,!1,f,p);if("string"==typeof t)return void 0!==l&&null==l||"string"==typeof l?this._generatePrivateKeyEx(!1,0,0,t,!1,e,n,r,i,o,s,a,u,c,l,f,!0,p,_):this._generatePrivateKeyEx(!1,0,0,t,!1,e,n,r,i,o,s,a,u,null,null,c,!0,l,f);var d=this.MakeError(tt.ERROR_BAD_PARAMETER,"");throw new et(d.errorCode,d.message)},nt.prototype.GetCRInfo=function(t,e,n,r,i){var o;return o=this._funcMakeParams([new S(t),e,n]),this._funcCall("GetCRInfo",o,r,i,null)},nt.prototype.IsHardwareKeyMedia=function(t,e,n,r,i){var o,s;return"number"==typeof t?((s=new C).typeIndex=t,s.devIndex=e,s.password=n):(s=null,r=t,i=e),o=this._funcMakeParams([s]),this._funcCall("IsHardwareKeyMedia",o,r,i,null)},nt.prototype.IsPrivateKeyExists=function(t,e,n,r,i){var o,s;return"number"==typeof t?((s=new C).typeIndex=t,s.devIndex=e,s.password=n):(s=null,r=t,i=e),o=this._funcMakeParams([s]),this._funcCall("IsPrivateKeyExists",o,r,i,null)},nt.prototype.ChangePrivateKeyPassword=function(t,e,n,r,i,o){var s,a;"number"==typeof t?((a=new C).typeIndex=t,a.devIndex=e,a.password=n):(a=null,r=null,i=t,o=e),s=this._funcMakeParams([a,r]),this._funcCall("ChangePrivateKeyPassword",s,i,o,null)},nt.prototype.BackupPrivateKey=function(t,e,n,r,i,o,s,a){var u,c,l;"number"==typeof t?((c=new C).typeIndex=t,c.devIndex=e,c.password=n,(l=new C).typeIndex=r,l.devIndex=i,l.password=o):(c=null,l=null,s=t,a=e),u=this._funcMakeParams([c,l]),this._funcCall("BackupPrivateKey",u,s,a,null)},nt.prototype.DestroyPrivateKey=function(t,e,n,r,i){var o,s;"number"==typeof t?((s=new C).typeIndex=t,s.devIndex=e,s.password=n):(s=null,r=t,i=e),o=this._funcMakeParams([s]),this._funcCall("DestroyPrivateKey",o,r,i,null)},nt.prototype.SetKeyMediaPassword=function(t,e,n,r,i){var o,s;"number"==typeof t?((s=new C).typeIndex=t,s.devIndex=e,s.password=n):(s=null,r=t,i=e),o=this._funcMakeParams([s]),this._funcCall("SetKeyMediaPassword",o,r,i,null)},nt.prototype.SetKeyMediaUserPassword=function(t,e,n,r,i,o){var s,a;"number"==typeof e?((a=new C).typeIndex=e,a.devIndex=n,a.password=r):(a=null,i=e,o=n),s=this._funcMakeParams([t,a]),this._funcCall("SetKeyMediaUserPassword",s,i,o,null)},nt.prototype.ChangeOwnCertificatesStatus=function(t,e,n,r){var i;i=this._funcMakeParams([t,e]),this._funcCall("ChangeOwnCertificatesStatus",i,n,r,null)},nt.prototype.CtxChangeOwnCertificatesStatus=function(t,e,n,r,i){var o;o=this._funcMakeParams([t,e,n]),this._funcCall("CtxChangeOwnCertificatesStatus",o,r,i,null)},nt.prototype.MakeNewCertificate=function(t,e,n,r,i,o,s,a,u,c,l,f,p,_,h){var E;return null!=e&&(e=new S(e)),E=this._funcMakeParams([t,e,n,r,i,o,s,a,u,c,l,f,p]),this._funcCall("MakeNewCertificate",E,_,h,null)},nt.prototype.MakeNewOwnCertificate=function(t,e,n,r,i,o,s,a,u,c){var l;return l=this._funcMakeParams([t,e,n,r,i,o,s,a]),this._funcCall("MakeNewOwnCertificate",l,u,c,null)},nt.prototype.CtxMakeNewOwnCertificate=function(t,e,n,r,i,o,s,a,u,c,l){var f;return f=this._funcMakeParams([t,e,n,r,i,o,s,a,u]),this._funcCall("CtxMakeNewOwnCertificate",f,c,l,null)},nt.prototype.CtxMakeDeviceCertificate=function(t,e,n,r,i,o,s,a,u,c){var l;return null!=n&&(n=new S(n)),null!=r&&(r=new S(r)),null!=i&&(i=new S(i)),null!=o&&(o=new S(o)),l=this._funcMakeParams([t,e,n,r,i,o,s,a]),this._funcCall("CtxMakeDeviceCertificate",l,u,c,null)},nt.prototype.GetOwnEUserParams=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("GetOwnEUserParams",n,t,e,null)},nt.prototype.ModifyOwnEUserParams=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("ModifyOwnEUserParams",i,n,r,null)},nt.prototype.CtxGetOwnEUserParams=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("CtxGetOwnEUserParams",r,e,n,null)},nt.prototype.CtxModifyOwnEUserParams=function(t,e,n,r,i){var o;return o=this._funcMakeParams([t,e,n]),this._funcCall("CtxModifyOwnEUserParams",o,r,i,null)},nt.prototype.Hash=function(t,e,n){var r;if("string"!=typeof t||null!=(t=this._stringToBytes(t,n)))return r=this._funcMakeParams([new S(t)]),this._funcCall("Hash",r,e,n,null)},nt.prototype.ContinueHash=function(t,e,n,r,i){var o;"number"==typeof e&&"number"==typeof n||(r=e,i=n),"string"==typeof t&&null==(t=this._stringToBytes(t,i))||("number"==typeof e&&"number"==typeof n&&(t=t.slice(e,e+n)),o=this._funcMakeParams([new S(t)]),this._funcCall("ContinueHash",o,r,i,null))},nt.prototype.EndHash=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("EndHash",n,t,e,null)},nt.prototype.HashWithParams=function(t,e,n,r){var i;if("string"!=typeof e||null!=(e=this._stringToBytes(e,r)))return i=this._funcMakeParams([new S(t),new S(e)]),this._funcCall("HashWithParams",i,n,r,null)},nt.prototype.HashBeginWithParams=function(t,e,n){var r;r=this._funcMakeParams([new S(t)]),this._funcCall("HashBeginWithParams",r,e,n,null)},nt.prototype.HashFile=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("HashFile",r,e,n,null)},nt.prototype.HashFileWithParams=function(t,e,n,r){var i;return i=this._funcMakeParams([new S(t),e]),this._funcCall("HashFileWithParams",i,n,r,null)},nt.prototype.CtxHash=function(t,e,n,r,i,o){var s=this,u=this.IsAsync(i,o),c=s.EU_FILE_PROCESS_CHUNK_SIZE;if("string"!=typeof r||null!=(r=this._stringToBytes(r,o)))if(u){var l={hashContext:null,hash:null},f=function(t){null==l.hashContext?o(t):s.CtxHashFree(l.hashContext,(function(){o(t)}),(function(){o(t)}))};a((function(r){s.CtxHashBegin(t,e,n,r,f)})).eu_wait((function(t,e){l.hashContext=e;var n=function(i){if(i>=r.length)s.CtxHashEnd(e,t,f);else{var o=r.length-i;o>c&&(o=c);var a=r.slice(i,i+o);s.CtxHashContinue(e,a,(function(){n(i+o)}),f)}};n(0)})).eu_wait((function(t,e){l.hash=e,s.CtxHashFree(l.hashContext,t,o)})).eu_wait((function(){i(l.hash)}))}else{var p=null;try{var _,h=0;for(p=s.CtxHashBegin(t,e,n);;){var E=r.length-h;E>c&&(E=c);var y=r.slice(h,h+E);if(s.CtxHashContinue(p,y),!((h+=E)<r.length))break}return _=s.CtxHashEnd(p),s.CtxHashFree(p),p=null,_}catch(t){throw null!=p&&s.CtxHashFree(p),t}}},nt.prototype.CtxHashBegin=function(t,e,n,r,i){var o;return o=this._funcMakeParams([t,e,n?new S(n):null]),this._funcCall("CtxHashBegin",o,r,i,null)},nt.prototype.CtxHashContinue=function(t,e,n,r){var i;i=this._funcMakeParams([t,new S(e)]),this._funcCall("CtxHashContinue",i,n,r,null)},nt.prototype.CtxHashEnd=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("CtxHashEnd",r,e,n,null)},nt.prototype.CtxHashFree=function(t,e,n){var r;r=this._funcMakeParams([t]),this._funcCall("CtxHashFree",r,e,n,null)},nt.prototype.ShowSignInfo=function(t,e,n){var r;r=this._funcMakeParams([t]),this._funcCall("ShowSignInfo",r,e,n,null)},nt.prototype.IsSigned=function(t,e,n){var r;return r=this._funcMakeParams([new S(t)]),this._funcCall("IsSigned",r,e,n,null)},nt.prototype.IsSignedFile=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("IsSignedFile",r,e,n,null)},nt.prototype.GetSignType=function(t,e,n,r){var i;if("string"==typeof e||null!=(e=this._base64Encode(e,r)))return i=this._funcMakeParams([t,e]),this._funcCall("GetSignType",i,n,r,null)},nt.prototype.GetFileSignType=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("GetFileSignType",i,n,r,null)},nt.prototype.GetSignsCount=function(t,e,n){var r;if("string"==typeof t||null!=(t=this._base64Encode(t,n)))return r=this._funcMakeParams([t]),this._funcCall("GetSignsCount",r,e,n,null)},nt.prototype.GetSignerInfo=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("GetSignerInfo",i,n,r,null)},nt.prototype.GetSignerCertificate=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("GetSignerCertificate",i,n,r,null)},nt.prototype.GetFileSignsCount=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("GetFileSignsCount",r,e,n,null)},nt.prototype.GetFileSignerInfo=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("GetFileSignerInfo",i,n,r,null)},nt.prototype.GetFileSignerCertificate=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("GetFileSignerCertificate",i,n,r,null)},nt.prototype.CtxGetSignerInfo=function(t,e,n,r,i){var o;if("string"==typeof n||null!=(n=this._base64Encode(n,i)))return o=this._funcMakeParams([t,e,n]),this._funcCall("CtxGetSignerInfo",o,r,i,null)},nt.prototype.Sign=function(t,e,n){var r;if("string"!=typeof t||null!=(t=this._stringToBytes(t,n)))return r=this._funcMakeParams([new S(t)]),this._funcCall("Sign",r,e,n,null)},nt.prototype.Verify=function(t,e,n,r,i){var o,s=[];if("boolean"!=typeof n&&(i=r,r=n),"string"!=typeof e||null!=(e=this._stringToBytes(e,i)))return s.push(t),s.push(new S(e)),"boolean"==typeof n?s.push(n):s.push(null),o=this._funcMakeParams(s),this._funcCall("Verify",o,r,i,null)},nt.prototype.ContinueSign=function(t,e,n,r,i){var o;"number"==typeof e&&"number"==typeof n||(r=e,i=n),"string"==typeof t&&null==(t=this._stringToBytes(t,i))||("number"==typeof e&&"number"==typeof n&&(t=t.slice(e,e+n)),o=this._funcMakeParams([new S(t)]),this._funcCall("ContinueSign",o,r,i,null))},nt.prototype.EndSign=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("EndSign",n,t,e,null)},nt.prototype.BeginVerify=function(t,e,n){var r;r=this._funcMakeParams([t]),this._funcCall("BeginVerify",r,e,n,null)},nt.prototype.ContinueVerify=function(t,e,n,r,i){var o;"number"==typeof e&&"number"==typeof n||(r=e,i=n),"string"==typeof t&&null==(t=this._stringToBytes(t,i))||("number"==typeof e&&"number"==typeof n&&(t=t.slice(e,e+n)),o=this._funcMakeParams([new S(t)]),this._funcCall("ContinueVerify",o,r,i,null))},nt.prototype.EndVerify=function(t,e,n){var r,i=[];return"boolean"!=typeof t&&(n=e,e=t),"boolean"!=typeof t?i.push(t):i.push(null),r=this._funcMakeParams(i),this._funcCall("EndVerify",r,e,n,null)},nt.prototype.SignHash=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("SignHash",r,e,n,null)},nt.prototype.VerifyHash=function(t,e,n,r,i){var o,s=[];return"boolean"!=typeof n&&(i=r,r=n),s.push(t),s.push(e),"boolean"==typeof n?s.push(n):s.push(null),o=this._funcMakeParams(s),this._funcCall("VerifyHash",o,r,i,null)},nt.prototype.SignInternal=function(t,e,n,r){var i;if("string"!=typeof e||null!=(e=this._stringToBytes(e,r)))return i=this._funcMakeParams([t,new S(e)]),this._funcCall("SignInternal",i,n,r,null)},nt.prototype.VerifyInternal=function(t,e,n,r){var i,o=[];return"boolean"!=typeof e&&(r=n,n=e),o.push(t),"boolean"==typeof e?o.push(e):o.push(null),i=this._funcMakeParams(o),this._funcCall("VerifyInternal",i,n,r,null)},nt.prototype.VerifyInternalString=function(t,e,n,r){var i=this;if("boolean"!=typeof e&&(r=n,n=e),!this.IsAsync(n,r)){var o=this.VerifyInternal(t,e);return this.BytesToString(o)}this.VerifyInternal(t,e,(function(t){i.BytesToString(t,n,r)}),r)},nt.prototype.SignFile=function(t,e,n,r,i){var o;o=this._funcMakeParams([t,e,n]),this._funcCall("SignFile",o,r,i,null)},nt.prototype.VerifyFile=function(t,e,n,r,i){var o,s=[];return"boolean"!=typeof n&&(i=r,r=n),s.push(t),s.push(e),"boolean"==typeof n?s.push(n):s.push(null),o=this._funcMakeParams(s),this._funcCall("VerifyFile",o,r,i,null)},nt.prototype.VerifyFileWithExternalSign=function(t,e,n,r,i){return this.VerifyFile(e,t,n,r,i)},nt.prototype.VerifyFileWithInternalSign=function(t,e,n,r,i){return this.VerifyFile(t,e,n,r,i)},nt.prototype.IsAlreadySigned=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("IsAlreadySigned",r,e,n,null)},nt.prototype.IsFileAlreadySigned=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("IsFileAlreadySigned",r,e,n,null)},nt.prototype.AppendSign=function(t,e,n,r){var i;if(!("string"==typeof t&&null==(t=this._stringToBytes(t,r))||"string"!=typeof e&&null==(e=this._base64Encode(e,r))))return i=this._funcMakeParams([new S(t),e]),this._funcCall("AppendSign",i,n,r,null)},nt.prototype.VerifySpecific=function(t,e,n,r,i,o){var s,a=[];if("boolean"!=typeof r&&(o=i,i=r),"string"!=typeof e||null!=(e=this._stringToBytes(e,o)))return a.push(t),a.push(new S(e)),a.push(n),"boolean"==typeof r?a.push(r):a.push(null),s=this._funcMakeParams(a),this._funcCall("VerifySpecific",s,i,o,null)},nt.prototype.AppendSignBegin=function(t,e,n){var r;"string"!=typeof t&&null==(t=this._base64Encode(t,n))||(r=this._funcMakeParams([t]),this._funcCall("AppendSignBegin",r,e,n,null))},nt.prototype.VerifyDataSpecificBegin=function(t,e,n,r){var i;i=this._funcMakeParams([t,e]),this._funcCall("VerifyDataSpecificBegin",i,n,r,null)},nt.prototype.AppendSignHash=function(t,e,n,r){var i;if(!("string"!=typeof t&&null==(t=this._base64Encode(t,r))||"string"!=typeof e&&null==(e=this._base64Encode(e,r))))return i=this._funcMakeParams([t,e]),this._funcCall("AppendSignHash",i,n,r,null)},nt.prototype.VerifyHashSpecific=function(t,e,n,r,i,o){var s,a=[];return"boolean"!=typeof r&&(o=i,i=r),a.push(t),a.push(e),a.push(n),"boolean"==typeof r?a.push(r):a.push(null),s=this._funcMakeParams(a),this._funcCall("VerifyHashSpecific",s,i,o,null)},nt.prototype.AppendSignInternal=function(t,e,n,r){var i;if("string"==typeof e||null!=(e=this._base64Encode(e,r)))return i=this._funcMakeParams([t,e]),this._funcCall("AppendSignInternal",i,n,r,null)},nt.prototype.VerifySpecificInternal=function(t,e,n,r,i){var o,s=[];return"boolean"!=typeof n&&(i=r,r=n),s.push(t),s.push(e),"boolean"==typeof n?s.push(n):s.push(null),o=this._funcMakeParams(s),this._funcCall("VerifySpecificInternal",o,r,i,null)},nt.prototype.VerifySpecificInternalString=function(t,e,n,r,i){var o=this;if("boolean"!=typeof n&&(i=r,r=n),!this.IsAsync(r,i)){var s=this.VerifySpecificInternal(t,e,n);return this.BytesToString(s)}this.VerifySpecificInternal(t,e,n,(function(t){o.BytesToString(t,r,i)}),i)},nt.prototype.AppendSignFile=function(t,e,n,r,i,o){var s;return s=this._funcMakeParams([t,e,n,r]),this._funcCall("AppendSignFile",s,i,o,null)},nt.prototype.VerifyFileSpecific=function(t,e,n,r,i,o){var s,a=[];return"boolean"!=typeof r&&(o=i,i=r),a.push(t),a.push(e),a.push(n),"boolean"==typeof r?a.push(r):a.push(null),s=this._funcMakeParams(a),this._funcCall("VerifyFileSpecific",s,i,o,null)},nt.prototype.VerifyFileWithExternalSignSpecific=function(t,e,n,r,i,o){return this.VerifyFileSpecific(t,e,n,r,i,o)},nt.prototype.VerifyFileWithInternalSignSpecific=function(t,e,n,r,i,o){return this.VerifyFileSpecific(t,e,n,r,i,o)},nt.prototype.CreateEmptySign=function(t,e,n){var r,i=[];if(2==arguments.length&&(n=e,e=t),"string"!=typeof t||null!=(t=this._stringToBytes(t,n)))return 1==arguments.length||3==arguments.length?i.push(new S(t)):i.push(null),r=this._funcMakeParams(i),this._funcCall("CreateEmptySign",r,e,n,null)},nt.prototype.CreateSigner=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("CreateSigner",r,e,n,null)},nt.prototype.AppendSigner=function(t,e,n,r,i){var o,s=[];return s.push(t),null!=e?s.push(new S(e)):s.push(null),s.push(n),o=this._funcMakeParams(s),this._funcCall("AppendSigner",o,r,i,null)},nt.prototype.AppendValidationDataToSignerEx=function(t,e,n,r,i){var o,s=[];if("string"==typeof t||null!=(t=this._base64Encode(t,i)))return s.push(t),null!=e?s.push(new S(e)):s.push(null),s.push(n),o=this._funcMakeParams(s),this._funcCall("AppendValidationDataToSignerEx",o,r,i,null)},nt.prototype.IsDataInSignedDataAvailable=function(t,e,n){var r;if("string"==typeof t||null!=(t=this._base64Encode(t,n)))return r=this._funcMakeParams([t]),this._funcCall("IsDataInSignedDataAvailable",r,e,n,null)},nt.prototype.IsDataInSignedFileAvailable=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("IsDataInSignedFileAvailable",r,e,n,null)},nt.prototype.GetDataFromSignedData=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("GetDataFromSignedData",r,e,n,null)},nt.prototype.GetDataFromSignedFile=function(t,e,n,r){var i;i=this._funcMakeParams([t,e]),this._funcCall("GetDataFromSignedFile",i,n,r,null)},nt.prototype.GetCertificateFromSignedData=function(t,e,n,r){var i;if("string"==typeof e||null!=(e=this._base64Encode(e,r)))return i=this._funcMakeParams([t,e]),this._funcCall("GetCertificateFromSignedData",i,n,r,null)},nt.prototype.GetCertificateFromSignedFile=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("GetCertificateFromSignedFile",i,n,r,null)},nt.prototype.GetSignTimeInfo=function(t,e,n,r){var i;if("string"==typeof e||null!=(e=this._base64Encode(e,r)))return i=this._funcMakeParams([t,e]),this._funcCall("GetSignTimeInfo",i,n,r,null)},nt.prototype.GetFileSignTimeInfo=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("GetFileSignTimeInfo",i,n,r,null)},nt.prototype.VerifyHashOnTime=function(t,e,n,r,i,o,s){return this.VerifyHashOnTimeEx(t,e,n,r,null!=r,!1,i,o,s)},nt.prototype.VerifyHashOnTimeEx=function(t,e,n,r,i,o,s,a,u){var c,l=[];if("boolean"!=typeof s&&(u=a,a=s),!("string"!=typeof t&&null==(t=this._base64Encode(t,u))||"string"!=typeof n&&null==(n=this._base64Encode(n,u))))return l=[t,e,n,r,i,o],"boolean"==typeof s?l.push(s):l.push(null),c=this._funcMakeParams(l),this._funcCall("VerifyHashOnTimeEx",c,a,u,null)},nt.prototype.VerifyDataOnTime=function(t,e,n,r,i,o,s){return this.VerifyDataOnTimeEx(t,e,n,r,null!=r,!1,i,o,s)},nt.prototype.VerifyDataOnTimeEx=function(t,e,n,r,i,o,s,a,u){var c,l=[];if("boolean"!=typeof s&&(u=a,a=s),!("string"==typeof t&&null==(t=this._stringToBytes(t,u))||"string"!=typeof n&&null==(n=this._base64Encode(n,u))))return l=[new S(t),e,n,r,i,o],"boolean"==typeof s?l.push(s):l.push(null),c=this._funcMakeParams(l),this._funcCall("VerifyDataOnTimeEx",c,a,u,null)},nt.prototype.VerifyDataInternalOnTime=function(t,e,n,r,i,o){return this.VerifyDataInternalOnTimeEx(t,e,n,null!=n,!1,r,i,o)},nt.prototype.VerifyDataInternalOnTimeEx=function(t,e,n,r,i,o,s,a){var u,c=[];if("boolean"!=typeof o&&(a=s,s=o),"string"==typeof t||null!=(t=this._base64Encode(t,a)))return c=[t,e,n,r,i],"boolean"==typeof o?c.push(o):c.push(null),u=this._funcMakeParams(c),this._funcCall("VerifyDataInternalOnTimeEx",u,s,a,null)},nt.prototype.VerifyDataInternalOnTimeString=function(t,e,n,r,i,o){return this.VerifyDataInternalOnTimeStringEx(t,e,n,null!=n,!1,r,i,o)},nt.prototype.VerifyDataInternalOnTimeStringEx=function(t,e,n,r,i,o,s,a){var u=this;if("boolean"!=typeof o&&(a=s,s=o),!this.IsAsync(s,a)){var c=this.VerifyDataInternalOnTimeEx(t,e,n,r,i,o);return this.BytesToString(c)}this.VerifyDataInternalOnTimeEx(t,e,n,r,i,o,(function(t){u.BytesToString(t,s,a)}),a)},nt.prototype.VerifyDataOnTimeBegin=function(t,e,n,r,i){this.VerifyDataOnTimeBeginEx(t,e,n,null!=n,!1,r,i)},nt.prototype.VerifyDataOnTimeBeginEx=function(t,e,n,r,i,o,s){var a;a=this._funcMakeParams([t,e,n,r,i]),this._funcCall("VerifyDataOnTimeBeginEx",a,o,s,null)},nt.prototype.VerifyFileOnTime=function(t,e,n,r,i,o,s,a,u){var c,l=[];return"boolean"!=typeof s&&(u=a,a=s),l=[t,e,n,r,i,o],"boolean"==typeof s?l.push(s):l.push(null),c=this._funcMakeParams(l),this._funcCall("VerifyFileOnTimeEx",c,a,u,null)},nt.prototype.VerifyFileWithExternalSignOnTime=function(t,e,n,r,i,o,s){return this.VerifyFileOnTime(t,n,e,r,null!=r,!1,i,o,s)},nt.prototype.VerifyFileWithExternalSignOnTimeEx=function(t,e,n,r,i,o,s,a,u){return this.VerifyFileOnTime(t,n,e,r,i,o,s,a,u)},nt.prototype.VerifyFileWithInternalSignOnTime=function(t,e,n,r,i,o,s){return this.VerifyFileOnTime(t,e,n,r,null!=r,!1,i,o,s)},nt.prototype.VerifyFileWithInternalSignOnTimeEx=function(t,e,n,r,i,o,s,a,u){return this.VerifyFileOnTime(t,n,e,r,i,o,s,a,u)},nt.prototype.ContinueSignCtx=function(t,e,n,r){var i;if(null==t&&(t=new H),"string"!=typeof e||null!=(e=this._stringToBytes(e,r)))return i=this._funcMakeParams([t,new S(e)]),this._funcCall("ContinueSignCtx",i,n,r,null)},nt.prototype.ContinueSignCtxWithOffset=function(t,e,n,r,i,o){return e=e.slice(n,n+r),this.ContinueSignCtx(t,e,i,o)},nt.prototype.EndSignCtx=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("EndSignCtx",i,n,r,null)},nt.prototype.BeginVerifyCtx=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("BeginVerifyCtx",r,e,n,null)},nt.prototype.ContinueVerifyCtx=function(t,e,n,r,i,o){var s;"number"==typeof n&&"number"==typeof r||(i=n,o=r),"string"==typeof e&&null==(e=this._stringToBytes(e,o))||("number"==typeof n&&"number"==typeof r&&(e=e.slice(n,n+r)),s=this._funcMakeParams([t,new S(e)]),this._funcCall("ContinueVerifyCtx",s,i,o,null))},nt.prototype.EndVerifyCtx=function(t,e,n,r){var i,o=[];return"boolean"!=typeof e&&(r=n=e),o.push(t),"boolean"==typeof e?o.push(e):o.push(null),i=this._funcMakeParams(o),this._funcCall("EndVerifyCtx",i,n,r,null)},nt.prototype.ResetOperationCtx=function(t,e,n){var r;r=this._funcMakeParams([t]),this._funcCall("ResetOperationCtx",r,e,n,null)},nt.prototype.SignHashRSA=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("SignHashRSA",r,e,n,null)},nt.prototype.SignRSA=function(t,e,n,r,i){var o;if("string"!=typeof t||null!=(t=this._stringToBytes(t,i)))return o=this._funcMakeParams([new S(t),e,n]),this._funcCall("SignRSA",o,r,i,null)},nt.prototype.ContinueRSASign=function(t,e,n){var r;"string"==typeof t&&null==(t=this._stringToBytes(t,n))||(r=this._funcMakeParams([new S(t)]),this._funcCall("ContinueRSASign",r,e,n,null))},nt.prototype.ContinueRSASignWithOffset=function(t,e,n,r,i){return t=t.slice(e,e+n),this.ContinueRSASign(t,r,i)},nt.prototype.EndRSASign=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("EndRSASign",r,e,n,null)},nt.prototype.SignRSAFile=function(t,e,n,r,i){var o;return o=this._funcMakeParams([t,e,n]),this._funcCall("SignRSAFile",o,r,i,null)},nt.prototype.ContinueRSASignCtx=function(t,e,n,r){var i;if(null==t&&(t=new H),"string"!=typeof e||null!=(e=this._stringToBytes(e,r)))return i=this._funcMakeParams([t,new S(e)]),this._funcCall("ContinueRSASignCtx",i,n,r,null)},nt.prototype.ContinueRSASignCtxWithOffset=function(t,e,n,r,i,o){return e=e.slice(n,n+r),this.ContinueRSASignCtx(e,i,o)},nt.prototype.EndRSASignCtx=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("EndRSASignCtx",i,n,r,null)},nt.prototype.SignECDSA=function(t,e,n,r,i){var o;if("string"!=typeof t||null!=(t=this._stringToBytes(t,i)))return o=this._funcMakeParams([new S(t),e,n]),this._funcCall("SignECDSA",o,r,i,null)},nt.prototype.RawSign=function(t,e,n){var r;if("string"!=typeof t||null!=(t=this._stringToBytes(t,n)))return r=this._funcMakeParams([new S(t)]),this._funcCall("RawSign",r,e,n,null)},nt.prototype.RawVerify=function(t,e,n,r,i){var o,s=[];if("boolean"!=typeof n&&(i=r,r=n),"string"!=typeof e||null!=(e=this._stringToBytes(e,i)))return s.push(t),s.push(new S(e)),"boolean"==typeof n?s.push(n):s.push(null),o=this._funcMakeParams(s),this._funcCall("RawVerify",o,r,i,null)},nt.prototype.RawSignHash=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("RawSignHash",r,e,n,null)},nt.prototype.RawVerifyHash=function(t,e,n,r,i){var o,s=[];return"boolean"!=typeof n&&(i=r,r=n),s.push(t),s.push(e),"boolean"==typeof n?s.push(n):s.push(null),o=this._funcMakeParams(s),this._funcCall("RawVerifyHash",o,r,i,null)},nt.prototype.RawSignFile=function(t,e,n,r){var i;i=this._funcMakeParams([t,e]),this._funcCall("RawSignFile",i,n,r,null)},nt.prototype.RawVerifyFile=function(t,e,n,r,i){var o,s=[];return"boolean"!=typeof n&&(i=r,r=n),s.push(t),s.push(e),"boolean"==typeof n?s.push(n):s.push(null),o=this._funcMakeParams(s),this._funcCall("RawVerifyFile",o,r,i,null)},nt.prototype.CtxSignHash=function(t,e,n,r,i,o){var s;if("string"==typeof n||null!=(n=this._base64Encode(n,o)))return s=this._funcMakeParams([t,e,n,r]),this._funcCall("CtxSignHash",s,i,o,null)},nt.prototype.CtxSign=function(t,e,n,r,i,o,s){var a;if("string"!=typeof n||null!=(n=this._stringToBytes(n,s)))return a=this._funcMakeParams([t,e,new S(n),r,i]),this._funcCall("CtxSign",a,o,s,null)},nt.prototype.CtxSignFile=function(t,e,n,r,i,o,s,a){var u;u=this._funcMakeParams([t,e,n,r,i,o]),this._funcCall("CtxSignFile",u,s,a,null)},nt.prototype.CtxAppendSignHash=function(t,e,n,r,i,o,s){var a;if(!("string"!=typeof n&&null==(n=this._base64Encode(n,s))||"string"!=typeof r&&null==(r=this._base64Encode(r,s))))return a=this._funcMakeParams([t,e,n,r,i]),this._funcCall("CtxAppendSignHash",a,o,s,null)},nt.prototype.CtxAppendSign=function(t,e,n,r,i,o,s){var a;if(!(null!=n&&"string"==typeof n&&null==(n=this._stringToBytes(n,s))||"string"!=typeof r&&null==(r=this._base64Encode(r,s))))return a=this._funcMakeParams([t,e,n?new S(n):null,r,i]),this._funcCall("CtxAppendSign",a,o,s,null)},nt.prototype.CtxAppendSignFile=function(t,e,n,r,i,o,s,a){var u;u=this._funcMakeParams([t,e,n,r,i,o]),this._funcCall("CtxAppendSignFile",u,s,a,null)},nt.prototype.ShowSenderInfo=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("ShowSenderInfo",r,e,n,null)},nt.prototype.IsEnveloped=function(t,e,n){var r;return r=this._funcMakeParams([new S(t)]),this._funcCall("IsEnveloped",r,e,n,null)},nt.prototype.IsEnvelopedFile=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("IsEnvelopedFile",r,e,n,null)},nt.prototype.Envelop=function(t,e,n,r,i,o){var s;if("string"!=typeof r||null!=(r=this._stringToBytes(r,o)))return s=this._funcMakeParams([t,e,n,new S(r)]),this._funcCall("Envelop",s,i,o,null)},nt.prototype.Develop=function(t,e,n,r){var i,o=[];if("boolean"!=typeof e&&(r=n,n=e),"string"==typeof t||null!=(t=this._base64Encode(t,r)))return o.push(t),"boolean"==typeof e?o.push(e):o.push(null),i=this._funcMakeParams(o),this._funcCall("Develop",i,n,r,null)},nt.prototype.EnvelopFile=function(t,e,n,r,i,o,s){var a;a=this._funcMakeParams([t,e,n,r,i]),this._funcCall("EnvelopFile",a,o,s,null)},nt.prototype.DevelopFile=function(t,e,n,r,i){var o,s=[];return"boolean"!=typeof n&&(i=r,r=n),s.push(t),s.push(e),"boolean"==typeof n?s.push(n):s.push(null),o=this._funcMakeParams(s),this._funcCall("DevelopFile",o,r,i,null)},nt.prototype.EnvelopEx=function(t,e,n,r,i,o){var s;if("EndUserArrayList"==t.className&&(t=t.m_array),"EndUserArrayList"==e.className&&(e=e.m_array),"string"!=typeof r||null!=(r=this._stringToBytes(r,o)))return s=this._funcMakeParams([t,e,n,new S(r)]),this._funcCall("EnvelopEx",s,i,o,null)},nt.prototype.DevelopEx=function(t,e,n,r,i){var o,s=[];if("boolean"!=typeof n&&(i=r,r=n),"string"==typeof t||null!=(t=this._base64Encode(t,i)))return s.push(t),s.push(e?new S(e):null),"boolean"==typeof n?s.push(n):s.push(null),o=this._funcMakeParams(s),this._funcCall("DevelopEx",o,r,i,null)},nt.prototype.EnvelopFileEx=function(t,e,n,r,i,o,s){var a;"EndUserArrayList"==t.className&&(t=t.m_array),"EndUserArrayList"==e.className&&(e=e.m_array),a=this._funcMakeParams([t,e,n,r,i]),this._funcCall("EnvelopFileEx",a,o,s,null)},nt.prototype.EnvelopToRecipients=function(t,e,n,r,i){var o;"EndUserArrayList"==t.className&&(t=t.m_array);for(var s=[],a=0;a<t.length;a++)s.push(new S(t[a]));if("string"!=typeof n||null!=(n=this._stringToBytes(n,i)))return o=this._funcMakeParams([s,e,new S(n)]),this._funcCall("EnvelopToRecipients",o,r,i,null)},nt.prototype.EnvelopFileToRecipients=function(t,e,n,r,i,o){var s;"EndUserArrayList"==t.className&&(t=t.m_array);for(var a=[],u=0;u<t.length;u++)a.push(new S(t[u]));s=this._funcMakeParams([a,e,n,r]),this._funcCall("EnvelopFileToRecipients",s,i,o,null)},nt.prototype.EnvelopToRecipientsEx=function(t,e,n,r,i,o){var s;"EndUserArrayList"==t.className&&(t=t.m_array);for(var a=[],u=0;u<t.length;u++)a.push(new S(t[u]));if("string"!=typeof r||null!=(r=this._stringToBytes(r,o)))return s=this._funcMakeParams([a,e,n,new S(r)]),this._funcCall("EnvelopToRecipientsEx",s,i,o,null)},nt.prototype.EnvelopFileToRecipientsEx=function(t,e,n,r,i,o,s){var a;"EndUserArrayList"==t.className&&(t=t.m_array);for(var u=[],c=0;c<t.length;c++)u.push(new S(t[c]));a=this._funcMakeParams([u,e,n,r,i]),this._funcCall("EnvelopFileToRecipientsEx",a,o,s,null)},nt.prototype.EnvelopToRecipientsWithOCode=function(t,e,n,r,i,o){var s;if("string"!=typeof r||null!=(r=this._stringToBytes(r,o)))return s=this._funcMakeParams([t,e,n,new S(r)]),this._funcCall("EnvelopToRecipientsWithOCode",s,i,o,null)},nt.prototype.EnvelopExWithDynamicKey=function(t,e,n,r,i,o,s){var a;if("EndUserArrayList"==t.className&&(t=t.m_array),"EndUserArrayList"==e.className&&(e=e.m_array),"string"!=typeof i||null!=(i=this._stringToBytes(i,s)))return a=this._funcMakeParams([t,e,n,r,new S(i)]),this._funcCall("EnvelopExWithDynamicKey",a,o,s,null)},nt.prototype.EnvelopFileExWithDynamicKey=function(t,e,n,r,i,o,s,a){var u;"EndUserArrayList"==t.className&&(t=t.m_array),"EndUserArrayList"==e.className&&(e=e.m_array),u=this._funcMakeParams([t,e,n,r,i,o]),this._funcCall("EnvelopFileExWithDynamicKey",u,s,a,null)},nt.prototype.EnvelopToRecipientsWithDynamicKey=function(t,e,n,r,i,o){var s;"EndUserArrayList"==t.className&&(t=t.m_array);for(var a=[],u=0;u<t.length;u++)a.push(new S(t[u]));if("string"!=typeof r||null!=(r=this._stringToBytes(r,o)))return s=this._funcMakeParams([a,e,n,new S(r)]),this._funcCall("EnvelopToRecipientsWithDynamicKey",s,i,o,null)},nt.prototype.EnvelopFileToRecipientsWithDynamicKey=function(t,e,n,r,i,o,s){var a;"EndUserArrayList"==t.className&&(t=t.m_array);for(var u=[],c=0;c<t.length;c++)u.push(new S(t[c]));a=this._funcMakeParams([u,e,n,r,i]),this._funcCall("EnvelopFileToRecipientsWithDynamicKey",a,o,s,null)},nt.prototype.EnvelopToRecipientsWithSettings=function(t,e,n,r,i,o,s,a,u){var c;if("string"!=typeof n||null!=(n=this._stringToBytes(n,u))){"EndUserArrayList"==t.className&&(t=t.m_array);for(var l=[],f=0;f<t.length;f++)l.push(new S(t[f]));return c=this._funcMakeParams([l,e,new S(n),r,i,o,s]),this._funcCall("EnvelopToRecipientsWithSettings",c,a,u,null)}},nt.prototype.RawEnvelop=function(t,e,n,r){var i;if("string"!=typeof e||null!=(e=this._stringToBytes(e,r)))return i=this._funcMakeParams([new S(t),new S(e)]),this._funcCall("RawEnvelop",i,n,r,null)},nt.prototype.RawDevelop=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("RawDevelop",i,n,r,null)},nt.prototype.EnvelopRSA=function(t,e,n,r,i,o,s){return this.EnvelopRSAEx(t,[e],[n],r,i,o,s)},nt.prototype.EnvelopFileRSA=function(t,e,n,r,i,o,s,a){this.EnvelopFileRSAEx(t,[e],[n],r,i,o,s,a)},nt.prototype.EnvelopRSAEx=function(t,e,n,r,i,o,s){var a;if("EndUserArrayList"==e.className&&(e=e.m_array),"EndUserArrayList"==n.className&&(n=n.m_array),"string"!=typeof i||null!=(i=this._stringToBytes(i,s)))return a=this._funcMakeParams([t,e,n,r,new S(i)]),this._funcCall("EnvelopRSAEx",a,o,s,null)},nt.prototype.EnvelopFileRSAEx=function(t,e,n,r,i,o,s,a){var u;"EndUserArrayList"==e.className&&(e=e.m_array),"EndUserArrayList"==n.className&&(n=n.m_array),u=this._funcMakeParams([t,e,n,r,i,o]),this._funcCall("EnvelopFileRSAEx",u,s,a,null)},nt.prototype.EnvelopToRecipientsRSA=function(t,e,n,r,i,o){var s;"EndUserArrayList"==e.className&&(e=e.m_array);for(var a=[],u=0;u<e.length;u++)a.push(new S(e[u]));if("string"!=typeof r||null!=(r=this._stringToBytes(r,o)))return s=this._funcMakeParams([t,a,n,new S(r)]),this._funcCall("EnvelopToRecipientsRSA",s,i,o,null)},nt.prototype.EnvelopFileToRecipientsRSA=function(t,e,n,r,i,o,s){var a;"EndUserArrayList"==e.className&&(e=e.m_array);for(var u=[],c=0;c<e.length;c++)u.push(new S(e[c]));a=this._funcMakeParams([t,u,n,r,i]),this._funcCall("EnvelopFileToRecipientsRSA",a,o,s,null)},nt.prototype.CtxEnvelop=function(t,e,n,r,i,o,s,a){var u;if("string"!=typeof o||null!=(o=this._stringToBytes(o,a))){"EndUserArrayList"==e.className&&(e=e.m_array);for(var c=[],l=0;l<e.length;l++)c.push(new S(e[l]));return u=this._funcMakeParams([t,c,n,r,i,new S(o)]),this._funcCall("CtxEnvelop",u,s,a,null)}},nt.prototype.CtxEnvelopFile=function(t,e,n,r,i,o,s,a,u){var c;"EndUserArrayList"==e.className&&(e=e.m_array);for(var l=[],f=0;f<e.length;f++)l.push(new S(e[f]));c=this._funcMakeParams([t,l,n,r,i,o,s]),this._funcCall("CtxEnvelopFile",c,a,u,null)},nt.prototype.CtxEnvelopWithDynamicKey=function(t,e,n,r,i,o,s,a){var u;if("string"!=typeof o||null!=(o=this._stringToBytes(o,a))){"EndUserArrayList"==e.className&&(e=e.m_array);for(var c=[],l=0;l<e.length;l++)c.push(new S(e[l]));return u=this._funcMakeParams([t,c,n,r,i,new S(o)]),this._funcCall("CtxEnvelopWithDynamicKey",u,s,a,null)}},nt.prototype.CtxEnvelopFileWithDynamicKey=function(t,e,n,r,i,o,s,a,u){var c;"EndUserArrayList"==e.className&&(e=e.m_array);for(var l=[],f=0;f<e.length;f++)l.push(new S(e[f]));c=this._funcMakeParams([t,l,n,r,i,o,s]),this._funcCall("CtxEnvelopFileWithDynamicKey",c,a,u,null)},nt.prototype.CtxDevelop=function(t,e,n,r,i,o){var s,a=[];if("boolean"!=typeof r&&(o=i,i=r),"string"==typeof e||null!=(e=this._base64Encode(e,o)))return a.push(t),a.push(e),a.push(n?new S(n):null),"boolean"==typeof r?a.push(r):a.push(null),s=this._funcMakeParams(a),this._funcCall("CtxDevelop",s,i,o,null)},nt.prototype.CtxDevelopFile=function(t,e,n,r,i,o,s){var a,u=[];return"boolean"!=typeof i&&(s=o,o=i),u.push(t),u.push(e),u.push(n?new S(n):null),u.push(r),"boolean"==typeof i?u.push(i):u.push(null),a=this._funcMakeParams(u),this._funcCall("CtxDevelopFile",a,o,s,null)},nt.prototype.CtxCreateAuthData=function(t,e,n,r,i){var o;if("string"!=typeof n||null!=(n=this._stringToBytes(n,i)))return o=this._funcMakeParams([t,new S(e),new S(n)]),this._funcCall("CtxCreateAuthData",o,r,i,null)},nt.prototype.ProtectDataByPassword=function(t,e,n,r){var i;if("string"!=typeof t||null!=(t=this._stringToBytes(t,r)))return i=this._funcMakeParams([new S(t),e]),this._funcCall("ProtectDataByPassword",i,n,r,null)},nt.prototype.UnprotectDataByPassword=function(t,e,n,r){var i;if("string"==typeof t||null!=(t=this._base64Encode(t,r)))return i=this._funcMakeParams([t,e]),this._funcCall("UnprotectDataByPassword",i,n,r,null)},nt.prototype.SessionIsInitialized=function(t,e,n){var r;return t.SetData(null),r=this._funcMakeParams([t]),this._funcCall("SessionIsInitialized",r,e,n,null)},nt.prototype.SessionClose=function(t,e,n){var r;t.SetData(null),r=this._funcMakeParams([t]),this._funcCall("SessionClose",r,e,n,null)},nt.prototype.ClientSessionCreateStep1=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("ClientSessionCreateStep1",r,e,n,null)},nt.prototype.ServerSessionCreateStep1=function(t,e,n,r){var i;return i=this._funcMakeParams([t,new S(e)]),this._funcCall("ServerSessionCreateStep1",i,n,r,null)},nt.prototype.ClientSessionCreateStep2=function(t,e,n,r){var i,o=this;t.SetData(null),i=this._funcMakeParams([t,new S(e)]),this._funcCall("ClientSessionCreateStep2",i,n,r,(function(e,n,r){t.SetData(e.GetData()),o.IsAsync(n,r)&&n()}))},nt.prototype.ServerSessionCreateStep2=function(t,e,n,r){var i;t.SetData(null),i=this._funcMakeParams([t,new S(e)]),this._funcCall("ServerSessionCreateStep2",i,n,r,null)},nt.prototype.SessionSave=function(t,e,n){var r;return t.SetData(null),r=this._funcMakeParams([t]),this._funcCall("SessionSave",r,e,n,null)},nt.prototype.SessionLoad=function(t,e,n){var r;return r=this._funcMakeParams([new S(t)]),this._funcCall("SessionLoad",r,e,n,null)},nt.prototype.SessionCheckCertificates=function(t,e,n){var r;return t.SetData(null),r=this._funcMakeParams([t]),this._funcCall("SessionCheckCertificates",r,e,n,null)},nt.prototype.SessionEncrypt=function(t,e,n,r){var i,o=!1,s=this;if("string"!=typeof e||(o=!0,null!=(e=this._stringToBytes(e,r))))return t.SetData(null),i=this._funcMakeParams([t,new S(e)]),this._funcCall("SessionEncrypt",i,n,r,o?function(t,e,n){return s.BASE64Encode(t,e,n)}:null)},nt.prototype.SessionDecrypt=function(t,e,n,r){var i;if("string"!=typeof e||null!=(e=this._base64Decode(e,r)))return t.SetData(null),i=this._funcMakeParams([t,new S(e)]),this._funcCall("SessionDecrypt",i,n,r,null)},nt.prototype.SessionEncryptContinue=function(t,e,n,r){var i,o=this,s=!1;if("string"!=typeof e||(s=!0,null!=(e=this._stringToBytes(e,r))))return t.SetData(null),i=this._funcMakeParams([t,new S(e)]),this._funcCall("SessionEncryptContinue",i,n,r,(function(t,n,r){if(s)return o.BASE64Encode(t,n,r);var i=o.IsAsync(n,r);if(!o._copyArrayData(e,t)){var a=o.MakeError(tt.ERROR_BAD_PARAMETER,"");if(i)return void r(a);throw new et(a.errorCode,a.message)}if(!i)return e;n(e)}))},nt.prototype.SessionDecryptContinue=function(t,e,n,r){var i,o=this;if("string"!=typeof e||null!=(e=this._base64Decode(e,r)))return t.SetData(null),i=this._funcMakeParams([t,new S(e)]),this._funcCall("SessionDecryptContinue",i,n,r,(function(t,n,r){var i=o.IsAsync(n,r);if(!o._copyArrayData(e,t)){var s=o.MakeError(tt.ERROR_BAD_PARAMETER,"");if(i)return void r(s);throw new et(s.errorCode,s.message)}if(!i)return e;n(e)}))},nt.prototype.SessionGetPeerCertificateInfo=function(t,e,n){var r;return t.SetData(null),r=this._funcMakeParams([t]),this._funcCall("SessionGetPeerCertificateInfo",r,e,n,null)},nt.prototype.ClientDynamicKeySessionCreate=function(t,e,n,r,i){var o,s=[];return"string"==typeof e&&"string"==typeof n||(i=r,r=n),s.push(t),"string"==typeof e&&"string"==typeof n?(s.push(e),s.push(n),s.push(null)):(s.push(null),s.push(null),s.push(new S(e))),o=this._funcMakeParams(s),this._funcCall("ClientDynamicKeySessionCreate",o,r,i,null)},nt.prototype.ServerDynamicKeySessionCreate=function(t,e,n,r){var i;return i=this._funcMakeParams([t,new S(e)]),this._funcCall("ServerDynamicKeySessionCreate",i,n,r,null)},nt.prototype.ClientDynamicKeySessionLoad=function(t,e,n){var r;return r=this._funcMakeParams([new S(t)]),this._funcCall("ClientDynamicKeySessionLoad",r,e,n,null)},nt.prototype.SCClientIsRunning=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("SCClientIsRunning",n,t,e,null)},nt.prototype.SCClientStart=function(t,e){var n;n=this._funcMakeParams(null),this._funcCall("SCClientStart",n,t,e,null)},nt.prototype.SCClientStop=function(t,e){var n;n=this._funcMakeParams(null),this._funcCall("SCClientStop",n,t,e,null)},nt.prototype.SCClientAddGate=function(t,e,n,r,i,o,s,a){var u;"string"!=typeof i&&(s=i,a=o,i=null,o=null),u=this._funcMakeParams([t,e,n,r,i,o]),this._funcCall("SCClientAddGate",u,s,a,null)},nt.prototype.SCClientRemoveGate=function(t,e,n){var r;r=this._funcMakeParams([t]),this._funcCall("SCClientRemoveGate",r,e,n,null)},nt.prototype.SCClientGetStatistic=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("SCClientGetStatistic",n,t,e,null)},nt.prototype.AppendTransportHeader=function(t,e,n,r,i,o,s){var a;return a=this._funcMakeParams([t,e,n,new S(r),new S(i)]),this._funcCall("AppendTransportHeader",a,o,s,null)},nt.prototype.ParseTransportHeader=function(t,e,n){var r;return r=this._funcMakeParams([new S(t)]),this._funcCall("ParseTransportHeader",r,e,n,null)},nt.prototype.AppendCryptoHeader=function(t,e,n,r,i){var o;return o=this._funcMakeParams([t,e,new S(n)]),this._funcCall("AppendCryptoHeader",o,r,i,null)},nt.prototype.ParseCryptoHeader=function(t,e,n){var r;return r=this._funcMakeParams([new S(t)]),this._funcCall("ParseCryptoHeader",r,e,n,null)},nt.prototype.AppendFileTransportHeader=function(t,e,n,r,i,o,s,a){var u;u=this._funcMakeParams([t,e,n,new S(r),i,o]),this._funcCall("AppendFileTransportHeader",u,s,a,null)},nt.prototype.ParseFileTransportHeader=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("ParseFileTransportHeader",i,n,r,null)},nt.prototype.AppendFileCryptoHeader=function(t,e,n,r,i,o){var s;s=this._funcMakeParams([t,e,n,r]),this._funcCall("AppendFileCryptoHeader",s,i,o,null)},nt.prototype.ParseFileCryptoHeader=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("ParseFileCryptoHeader",i,n,r,null)},nt.prototype.DevCtxEnum=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("DevCtxEnum",r,e,n,null)},nt.prototype.DevCtxOpen=function(t,e,n,r,i){var o;return o=this._funcMakeParams([t,e,n]),this._funcCall("DevCtxOpen",o,r,i,null)},nt.prototype.CreateDeviceContext=function(){return new X},nt.prototype.DevCtxEnumVirtual=function(t,e,n){var r,i=this;return r=this._funcMakeParams([t]),this._funcCall("DevCtxEnumVirtual",r,e,n,(function(e,n,r){var o=i.IsAsync(n,r);try{if(null==e){if(!o)return null;n(null)}if(t.set(e[1]),!o)return e[0];n(e[0])}catch(t){var s=i.MakeError(tt.ERROR_LIBRARY_COMUNICATION_FAILED,"");if(o)return void r(s);throw new et(s.errorCode,s.message)}}))},nt.prototype.DevCtxClose=function(t,e,n){var r;return r=this._funcMakeParams([t]),this._funcCall("DevCtxClose",r,e,n,null)},nt.prototype.DevCtxGetData=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("DevCtxGetData",i,n,r,null)},nt.prototype.DevCtxChangePassword=function(t,e,n,r){var i;return i=this._funcMakeParams([t,e]),this._funcCall("DevCtxChangePassword",i,n,r,null)},nt.prototype.GetHostInfo=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("GetHostInfo",n,t,e,null)},nt.prototype.IsRemotelyControlled=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("IsRemotelyControlled",n,t,e,null)},nt.prototype.CtxCreate=function(t,e){var n;return n=this._funcMakeParams(null),this._funcCall("CtxCreate",n,t,e,null)},nt.prototype.CtxFree=function(t,e,n){var r;r=this._funcMakeParams([t]),this._funcCall("CtxFree",r,e,n,null)},nt.prototype.CtxSetParameter=function(t,e,n,r,i){var o;"boolean"==typeof n&&(n=n?1:0),o=this._funcMakeParams([t,e,n]),this._funcCall("CtxSetParameter",o,r,i,null)},nt.prototype.CreateReference=function(t,e){return new $(t,e)},nt.prototype.ASiCGetASiCType=function(t,e,n){var r;if("string"!=typeof t||null!=(t=this._base64Decode(t,n)))return r=this._funcMakeParams([new S(t)]),this._funcCall("ASiCGetASiCType",r,e,n,null)},nt.prototype.ASiCGetSignType=function(t,e,n){var r;if("string"!=typeof t||null!=(t=this._base64Decode(t,n)))return r=this._funcMakeParams([new S(t)]),this._funcCall("ASiCGetSignType",r,e,n,null)},nt.prototype.ASiCGetSignsCount=function(t,e,n){var r;if("string"!=typeof t||null!=(t=this._base64Decode(t,n)))return r=this._funcMakeParams([new S(t)]),this._funcCall("ASiCGetSignsCount",r,e,n,null)},nt.prototype.ASiCGetSignerInfo=function(t,e,n,r){var i;if("string"!=typeof e||null!=(e=this._base64Decode(e,r)))return i=this._funcMakeParams([t,new S(e)]),this._funcCall("ASiCGetSignerInfo",i,n,r,null)},nt.prototype.ASiCGetSignTimeInfo=function(t,e,n,r){var i;if("string"!=typeof e||null!=(e=this._base64Decode(e,r)))return i=this._funcMakeParams([t,new S(e)]),this._funcCall("ASiCGetSignTimeInfo",i,n,r,null)},nt.prototype.ASiCGetSignReferences=function(t,e,n,r){var i;if("string"!=typeof e||null!=(e=this._base64Decode(e,r)))return i=this._funcMakeParams([t,new S(e)]),this._funcCall("ASiCGetSignReferences",i,n,r,null)},nt.prototype.ASiCGetReference=function(t,e,n,r){var i;if("string"!=typeof t||null!=(t=this._base64Decode(t,r)))return i=this._funcMakeParams([new S(t),e]),this._funcCall("ASiCGetReference",i,n,r,null)},nt.prototype.ASiCSign=function(t,e,n,r,i,o){for(var s,a=[],u=[],c=0;c<r.length;c++)a.push(r[c].GetName()),u.push(new S(r[c].GetData()));return s=this._funcMakeParams([t,e,n,a,u]),this._funcCall("ASiCSign",s,i,o,null)},nt.prototype.ASiCAppendSign=function(t,e,n,r,i){var o;if("string"!=typeof n||null!=(n=this._base64Decode(n,i)))return o=this._funcMakeParams([t,e,new S(n)]),this._funcCall("ASiCAppendSign",o,r,i,null)},nt.prototype.ASiCVerify=function(t,e,n,r,i){var o,s=[];if("string"!=typeof e||null!=(e=this._base64Decode(e,i)))return"boolean"!=typeof n&&(i=r,r=n),s.push(t),s.push(new S(e)),"boolean"==typeof n?s.push(n):s.push(null),o=this._funcMakeParams(s),this._funcCall("ASiCVerify",o,r,i,null)},nt.prototype.CtxASiCSign=function(t,e,n,r,i,o,s,a){for(var u,c=[],l=[],f=0;f<o.length;f++)c.push(o[f].GetName()),l.push(new S(o[f].GetData()));return u=this._funcMakeParams([t,e,n,r,i,c,l]),this._funcCall("CtxASiCSign",u,s,a,null)},nt.prototype.CtxASiCAppendSign=function(t,e,n,r,i,o,s){var a;if("string"!=typeof i||null!=(i=this._base64Decode(i,s)))return a=this._funcMakeParams([t,e,n,r,new S(i)]),this._funcCall("CtxASiCAppendSign",a,o,s,null)},nt.prototype.CtxASiCGetSignerInfo=function(t,e,n,r,i){var o;if("string"!=typeof n||null!=(n=this._base64Decode(n,i)))return o=this._funcMakeParams([t,e,new S(n)]),this._funcCall("CtxASiCGetSignerInfo",o,r,i,null)},nt.prototype.ASiCGetSignLevel=function(t,e,n,r){var i;if("string"!=typeof e||null!=(e=this._base64Decode(e,r)))return i=this._funcMakeParams([t,new S(e)]),this._funcCall("ASiCGetSignLevel",i,n,r,null)},nt.prototype.ASiCIsAllContentCovered=function(t,e,n,r){var i;if("string"!=typeof e||null!=(e=this._base64Decode(e,r)))return i=this._funcMakeParams([t,new S(e)]),this._funcCall("ASiCIsAllContentCovered",i,n,r,null)},nt.prototype.PDFGetSignType=function(t,e,n,r){var i;if("string"!=typeof e||null!=(e=this._base64Decode(e,r)))return i=this._funcMakeParams([t,new S(e)]),this._funcCall("PDFGetSignType",i,n,r,null)},nt.prototype.PDFGetSignsCount=function(t,e,n){var r;if("string"!=typeof t||null!=(t=this._base64Decode(t,n)))return r=this._funcMakeParams([new S(t)]),this._funcCall("PDFGetSignsCount",r,e,n,null)},nt.prototype.PDFGetSignerInfo=function(t,e,n,r){var i;if("string"!=typeof e||null!=(e=this._base64Decode(e,r)))return i=this._funcMakeParams([t,new S(e)]),this._funcCall("PDFGetSignerInfo",i,n,r,null)},nt.prototype.PDFGetSignTimeInfo=function(t,e,n,r){var i;if("string"!=typeof e||null!=(e=this._base64Decode(e,r)))return i=this._funcMakeParams([t,new S(e)]),this._funcCall("PDFGetSignTimeInfo",i,n,r,null)},nt.prototype.PDFSign=function(t,e,n,r){var i;return i=this._funcMakeParams([new S(t),e]),this._funcCall("PDFSign",i,n,r,null)},nt.prototype.PDFVerify=function(t,e,n,r,i){var o,s=[];if("string"!=typeof e||null!=(e=this._base64Decode(e,i)))return"boolean"!=typeof n&&(i=r,r=n),s.push(t),s.push(new S(e)),"boolean"==typeof n?s.push(n):s.push(null),o=this._funcMakeParams(s),this._funcCall("PDFVerify",o,r,i,null)},nt.prototype.CtxPDFSign=function(t,e,n,r,i,o){var s;return s=this._funcMakeParams([t,e,new S(n),r]),this._funcCall("CtxPDFSign",s,i,o,null)},nt.prototype.CtxPDFGetSignerInfo=function(t,e,n,r,i){var o;if("string"!=typeof n||null!=(n=this._base64Decode(n,i)))return o=this._funcMakeParams([t,e,new S(n)]),this._funcCall("CtxPDFGetSignerInfo",o,r,i,null)},nt.prototype.XAdESGetType=function(t,e,n){var r;if("string"!=typeof t||null!=(t=this._base64Decode(t,n)))return r=this._funcMakeParams([new S(t)]),this._funcCall("XAdESGetType",r,e,n,null)},nt.prototype.XAdESGetSignsCount=function(t,e,n){var r;if("string"!=typeof t||null!=(t=this._base64Decode(t,n)))return r=this._funcMakeParams([new S(t)]),this._funcCall("XAdESGetSignsCount",r,e,n,null)},nt.prototype.XAdESGetSignLevel=function(t,e,n,r){var i;if("string"!=typeof e||null!=(e=this._base64Decode(e,r)))return i=this._funcMakeParams([t,new S(e)]),this._funcCall("XAdESGetSignLevel",i,n,r,null)},nt.prototype.XAdESGetSignerInfo=function(t,e,n,r){var i;if("string"!=typeof e||null!=(e=this._base64Decode(e,r)))return i=this._funcMakeParams([t,new S(e)]),this._funcCall("XAdESGetSignerInfo",i,n,r,null)},nt.prototype.XAdESGetSignTimeInfo=function(t,e,n,r){var i;if("string"!=typeof e||null!=(e=this._base64Decode(e,r)))return i=this._funcMakeParams([t,new S(e)]),this._funcCall("XAdESGetSignTimeInfo",i,n,r,null)},nt.prototype.XAdESGetSignReferences=function(t,e,n,r){var i;if("string"!=typeof e||null!=(e=this._base64Decode(e,r)))return i=this._funcMakeParams([t,new S(e)]),this._funcCall("XAdESGetSignReferences",i,n,r,null)},nt.prototype.XAdESGetReference=function(t,e,n,r){var i;if("string"!=typeof t||null!=(t=this._base64Decode(t,r)))return i=this._funcMakeParams([new S(t),e]),this._funcCall("XAdESGetReference",i,n,r,null)},nt.prototype.XAdESSign=function(t,e,n,r,i){for(var o,s=[],a=[],u=0;u<n.length;u++)s.push(n[u].GetName()),a.push(new S(n[u].GetData()));return o=this._funcMakeParams([t,e,s,a]),this._funcCall("XAdESSign",o,r,i,null)},nt.prototype.XAdESVerify=function(t,e,n,r,i,o){var s,a=[],u=null,c=null;if(null!=t){u=[],c=[];for(var l=0;l<t.length;l++)u.push(t[l].GetName()),c.push(new S(t[l].GetData()))}if("string"!=typeof n||null!=(n=this._base64Decode(n,o)))return"boolean"!=typeof r&&(o=i,i=r),a.push(u),a.push(c),a.push(e),a.push(new S(n)),"boolean"==typeof r?a.push(r):a.push(null),s=this._funcMakeParams(a),this._funcCall("XAdESVerify",s,i,o,null)},nt.prototype.CtxXAdESSign=function(t,e,n,r,i,o,s){for(var a,u=[],c=[],l=0;l<i.length;l++)u.push(i[l].GetName()),c.push(new S(i[l].GetData()));return a=this._funcMakeParams([t,e,n,r,u,c]),this._funcCall("CtxXAdESSign",a,o,s,null)},nt.prototype.CtxXAdESGetSignerInfo=function(t,e,n,r,i){var o;if("string"!=typeof n||null!=(n=this._base64Decode(n,i)))return o=this._funcMakeParams([t,e,new S(n)]),this._funcCall("CtxXAdESGetSignerInfo",o,r,i,null)},{EndUserLibraryLoader:p,EUSignCP:nt,EndUserError:tt}})?r.apply(e,i):r)||(t.exports=o)},function(t,e,n){"use strict";n.r(e),n.d(e,"CASettings",(function(){return s.a})),n.d(e,"KSPSettings",(function(){return s.d})),n.d(e,"EndUserError",(function(){return i})),n.d(e,"EndUserConstants",(function(){return h})),n.d(e,"EndUserEvents",(function(){return r})),n.d(e,"EndUserLibraryInfoJS",(function(){return o.a})),n.d(e,"EndUserLibraryInfoSW",(function(){return o.b})),n.d(e,"EndUserSettings",(function(){return s.c})),n.d(e,"EndUserProxySettings",(function(){return s.b})),n.d(e,"EndUserOwnerInfo",(function(){return a.a})),n.d(e,"EndUserCertificateInfoEx",(function(){return u.a})),n.d(e,"EndUserCertificate",(function(){return c})),n.d(e,"EndUserKeyMedia",(function(){return l})),n.d(e,"EndUserJKSPrivateKeyInfo",(function(){return f.a})),n.d(e,"EndUserContext",(function(){return p})),n.d(e,"EndUserPrivateKeyContext",(function(){return _})),n.d(e,"EndUserTimeInfo",(function(){return y.a})),n.d(e,"EndUserSignContainerInfo",(function(){return S.a})),n.d(e,"EndUserSignInfo",(function(){return C.a})),n.d(e,"EndUserSenderInfo",(function(){return d.a})),n.d(e,"EndUserParams",(function(){return R.a})),n.d(e,"EndUserInfo",(function(){return m})),n.d(e,"EndUserRequestInfo",(function(){return A.a})),n.d(e,"EndUserClientRegistrationToken",(function(){return P})),n.d(e,"EndUserTaxReport",(function(){return E.b})),n.d(e,"EndUserTaxReceipt",(function(){return E.a})),n.d(e,"EndUser",(function(){return U}));var r={};n.r(r),n.d(r,"EndUserConfirmKSPOperationEvent",(function(){return g}));var i=n(1),o=n(13),s=n(9),a=n(10),u=n(8),c=function(){},l=function(t){this.type=t?t.type:"",this.device=t?t.device:"",this.visibleName=t?t.visibleName:"",this.typeIndex=t?t.typeIndex:-1,this.devIndex=t?t.devIndex:-1,this.password=t?t.password:"",this.user=t?t.user:""},f=n(14),p=function(){},_=function(){},h=n(0),E=n(11),y=n(6),S=n(7),C=n(5),d=n(12),R=n(15),m=function(){this.version=h.EU_USER_INFO_VERSION,this.commonName="",this.locality="",this.state="",this.organization="",this.orgUnit="",this.title="",this.street="",this.phone="",this.surname="",this.givenname="",this.EMail="",this.DNS="",this.EDRPOUCode="",this.DRFOCode="",this.NBUCode="",this.SPFMCode="",this.OCode="",this.OUCode="",this.userCode="",this.UPN="",this.UNZR="",this.country="UA"},A=n(16),P=function(){},g=function(){this.type=h.EndUserEventType.ConfirmKSPOperation},T=n(18),v=function(){function t(t){var e=this;this.m_worker=new T.a("",t,(function(t){e.OnEvent(t)})),this.m_eventListeners=new Array}return t.prototype.OnEvent=function(t){try{var e=this.m_eventListeners[t.type]||this.m_eventListeners[h.EndUserEventType.All];e&&e(t)}catch(t){}},t.prototype.AddEventListener=function(t,e){switch(t){case h.EndUserEventType.None:this.m_eventListeners=[];break;case h.EndUserEventType.All:this.m_eventListeners=[],this.m_eventListeners[t]=e;break;default:this.m_eventListeners[t]=e}return this.m_worker.postMessage("AddEventListener",[t])},t.prototype.GetLibraryInfo=function(t){return this.m_worker.postMessage("GetLibraryInfo",Array.prototype.slice.call(arguments))},t.prototype.IsInitialized=function(){return this.m_worker.postMessage("IsInitialized",Array.prototype.slice.call(arguments))},t.prototype.Initialize=function(t){return this.m_worker.postMessage("Initialize",Array.prototype.slice.call(arguments))},t.prototype.SetRuntimeParameter=function(t,e){return this.m_worker.postMessage("SetRuntimeParameter",Array.prototype.slice.call(arguments))},t.prototype.GetStorageParameter=function(t,e){return this.m_worker.postMessage("GetStorageParameter",Array.prototype.slice.call(arguments))},t.prototype.SetStorageParameter=function(t,e,n){return this.m_worker.postMessage("SetStorageParameter",Array.prototype.slice.call(arguments))},t.prototype.GetCAs=function(){return this.m_worker.postMessage("GetCAs",Array.prototype.slice.call(arguments))},t.prototype.GetProxySettings=function(){return this.m_worker.postMessage("GetProxySettings",Array.prototype.slice.call(arguments))},t.prototype.SetProxySettings=function(t){return this.m_worker.postMessage("SetProxySettings",Array.prototype.slice.call(arguments))},t.prototype.GetKeyMedias=function(){return this.m_worker.postMessage("GetKeyMedias",Array.prototype.slice.call(arguments))},t.prototype.GetJKSPrivateKeys=function(t){return this.m_worker.postMessage("GetJKSPrivateKeys",Array.prototype.slice.call(arguments))},t.prototype.IsPrivateKeyReaded=function(){return this.m_worker.postMessage("IsPrivateKeyReaded",Array.prototype.slice.call(arguments))},t.prototype.ResetPrivateKey=function(){return this.m_worker.postMessage("ResetPrivateKey",Array.prototype.slice.call(arguments))},t.prototype.ResetOperationKSP=function(){return this.m_worker.postMessage("ResetOperationKSP",Array.prototype.slice.call(arguments))},t.prototype.ReadPrivateKey=function(t,e,n){return this.m_worker.postMessage("ReadPrivateKey",Array.prototype.slice.call(arguments))},t.prototype.ReadPrivateKeyBinary=function(t,e,n,r){return this.m_worker.postMessage("ReadPrivateKeyBinary",Array.prototype.slice.call(arguments))},t.prototype.ReadPrivateKeySIM=function(t,e,n,r){return this.m_worker.postMessage("ReadPrivateKeySIM",Array.prototype.slice.call(arguments))},t.prototype.ReadPrivateKeyKSP=function(t,e,n,r){return this.m_worker.postMessage("ReadPrivateKeyKSP",Array.prototype.slice.call(arguments))},t.prototype.GetOwnCertificates=function(){return this.m_worker.postMessage("GetOwnCertificates",Array.prototype.slice.call(arguments))},t.prototype.GetOwnEUserParams=function(){return this.m_worker.postMessage("GetOwnEUserParams",Array.prototype.slice.call(arguments))},t.prototype.ChangeOwnCertificatesStatus=function(t,e){return this.m_worker.postMessage("ChangeOwnCertificatesStatus",Array.prototype.slice.call(arguments))},t.prototype.MakeNewCertificate=function(t,e,n,r,i,o,s,a,u,c,l,f,p,_,h,E,y,S){return void 0===E&&(E=!1),void 0===y&&(y=null),void 0===S&&(S=null),this.m_worker.postMessage("MakeNewCertificate",Array.prototype.slice.call(arguments))},t.prototype.MakeDeviceCertificate=function(t,e,n,r,i){return this.m_worker.postMessage("MakeDeviceCertificate",Array.prototype.slice.call(arguments))},t.prototype.ChangePrivateKeyPassword=function(t,e){return this.m_worker.postMessage("ChangePrivateKeyPassword",Array.prototype.slice.call(arguments))},t.prototype.ChangePrivateKeyPasswordBinary=function(t,e,n){return this.m_worker.postMessage("ChangePrivateKeyPasswordBinary",Array.prototype.slice.call(arguments))},t.prototype.GeneratePrivateKey=function(t,e,n,r,i,o,s,a,u,c,l,f){return this.m_worker.postMessage("GeneratePrivateKey",Array.prototype.slice.call(arguments))},t.prototype.GeneratePrivateKeyBinary=function(t,e,n,r,i,o,s,a,u,c,l){return this.m_worker.postMessage("GeneratePrivateKeyBinary",Array.prototype.slice.call(arguments))},t.prototype.GetKeyInfo=function(t){return this.m_worker.postMessage("GetKeyInfo",Array.prototype.slice.call(arguments))},t.prototype.GetKeyInfoBinary=function(t,e){return this.m_worker.postMessage("GetKeyInfoBinary",Array.prototype.slice.call(arguments))},t.prototype.GetClientRegistrationTokenKSP=function(t){return this.m_worker.postMessage("GetClientRegistrationTokenKSP",Array.prototype.slice.call(arguments))},t.prototype.HashData=function(t,e,n){return this.m_worker.postMessage("HashData",Array.prototype.slice.call(arguments))},t.prototype.GetSigner=function(t,e,n){return void 0===e&&(e=-1),void 0===n&&(n=!1),this.m_worker.postMessage("GetSigner",Array.prototype.slice.call(arguments))},t.prototype.SignData=function(t,e){return void 0===e&&(e=!1),this.m_worker.postMessage("SignData",Array.prototype.slice.call(arguments))},t.prototype.SignDataInternal=function(t,e,n){return void 0===n&&(n=!1),this.m_worker.postMessage("SignDataInternal",Array.prototype.slice.call(arguments))},t.prototype.SignHash=function(t,e,n,r){return this.m_worker.postMessage("SignHash",Array.prototype.slice.call(arguments))},t.prototype.SignDataEx=function(t,e,n,r,i){return this.m_worker.postMessage("SignDataEx",Array.prototype.slice.call(arguments))},t.prototype.AppendSign=function(t,e,n,r,i){return this.m_worker.postMessage("AppendSign",Array.prototype.slice.call(arguments))},t.prototype.AppendSignHash=function(t,e,n,r,i){return this.m_worker.postMessage("AppendSignHash",Array.prototype.slice.call(arguments))},t.prototype.VerifyHash=function(t,e,n){return void 0===n&&(n=-1),this.m_worker.postMessage("VerifyHash",Array.prototype.slice.call(arguments))},t.prototype.VerifyData=function(t,e,n){return void 0===n&&(n=-1),this.m_worker.postMessage("VerifyData",Array.prototype.slice.call(arguments))},t.prototype.VerifyDataInternal=function(t,e){return void 0===e&&(e=-1),this.m_worker.postMessage("VerifyDataInternal",Array.prototype.slice.call(arguments))},t.prototype.EnvelopData=function(t,e,n,r,i,o){return void 0===o&&(o=!1),this.m_worker.postMessage("EnvelopData",Array.prototype.slice.call(arguments))},t.prototype.DevelopData=function(t,e){return this.m_worker.postMessage("DevelopData",Array.prototype.slice.call(arguments))},t.prototype.CreateAuthData=function(t,e,n){return this.m_worker.postMessage("CreateAuthData",Array.prototype.slice.call(arguments))},t.prototype.ProtectDataByPassword=function(t,e,n){return this.m_worker.postMessage("ProtectDataByPassword",Array.prototype.slice.call(arguments))},t.prototype.UnprotectDataByPassword=function(t,e,n){return this.m_worker.postMessage("UnprotectDataByPassword",Array.prototype.slice.call(arguments))},t.prototype.GetTSPByAccessInfo=function(t,e,n,r,i){return this.m_worker.postMessage("GetTSPByAccessInfo",Array.prototype.slice.call(arguments))},t.prototype.CheckTSP=function(t,e,n){return this.m_worker.postMessage("CheckTSP",Array.prototype.slice.call(arguments))},t.prototype.CtxCreate=function(){return this.m_worker.postMessage("CtxCreate",Array.prototype.slice.call(arguments))},t.prototype.CtxFree=function(t){return this.m_worker.postMessage("CtxFree",Array.prototype.slice.call(arguments))},t.prototype.CtxSetParameter=function(t,e,n){return this.m_worker.postMessage("CtxSetParameter",Array.prototype.slice.call(arguments))},t.prototype.CtxReadPrivateKey=function(t,e,n,r){return this.m_worker.postMessage("CtxReadPrivateKey",Array.prototype.slice.call(arguments))},t.prototype.CtxReadPrivateKeyBinary=function(t,e,n,r,i){return this.m_worker.postMessage("CtxReadPrivateKeyBinary",Array.prototype.slice.call(arguments))},t.prototype.CtxFreePrivateKey=function(t){return this.m_worker.postMessage("CtxFreePrivateKey",Array.prototype.slice.call(arguments))},t.prototype.CtxGetOwnCertificates=function(t){return this.m_worker.postMessage("CtxGetOwnCertificates",Array.prototype.slice.call(arguments))},t.prototype.CtxSignHash=function(t,e,n,r,i){return this.m_worker.postMessage("CtxSignHash",Array.prototype.slice.call(arguments))},t.prototype.CtxSignData=function(t,e,n,r,i,o){return this.m_worker.postMessage("CtxSignData",Array.prototype.slice.call(arguments))},t.prototype.CtxAppendSignHash=function(t,e,n,r,i,o){return this.m_worker.postMessage("CtxAppendSignHash",Array.prototype.slice.call(arguments))},t.prototype.CtxAppendSign=function(t,e,n,r,i,o){return this.m_worker.postMessage("CtxAppendSign",Array.prototype.slice.call(arguments))},t.prototype.CtxEnvelopData=function(t,e,n,r,i,o,s){return this.m_worker.postMessage("CtxEnvelopData",Array.prototype.slice.call(arguments))},t.prototype.CtxDevelopData=function(t,e,n){return this.m_worker.postMessage("CtxDevelopData",Array.prototype.slice.call(arguments))},t.prototype.ProtectTaxReports=function(t,e,n,r,i,o,s){return void 0===t&&(t=null),void 0===e&&(e=null),void 0===n&&(n=null),void 0===s&&(s=!1),this.m_worker.postMessage("ProtectTaxReports",Array.prototype.slice.call(arguments))},t.prototype.UnprotectTaxReceipts=function(t,e){return this.m_worker.postMessage("UnprotectTaxReceipts",Array.prototype.slice.call(arguments))},t.prototype.ASiCGetSigner=function(t,e,n){return this.m_worker.postMessage("ASiCGetSigner",Array.prototype.slice.call(arguments))},t.prototype.ASiCSignData=function(t,e,n,r,i,o){return this.m_worker.postMessage("ASiCSignData",Array.prototype.slice.call(arguments))},t.prototype.ASiCAppendSign=function(t,e,n,r,i){return this.m_worker.postMessage("ASiCAppendSign",Array.prototype.slice.call(arguments))},t.prototype.ASiCVerifyData=function(t,e){return void 0===e&&(e=-1),this.m_worker.postMessage("ASiCVerifyData",Array.prototype.slice.call(arguments))},t.prototype.PDFSignData=function(t,e,n,r){return this.m_worker.postMessage("PDFSignData",Array.prototype.slice.call(arguments))},t.prototype.PDFVerifyData=function(t,e){return void 0===e&&(e=-1),this.m_worker.postMessage("PDFVerifyData",Array.prototype.slice.call(arguments))},t.prototype.PDFGetSigner=function(t,e,n){return void 0===e&&(e=-1),void 0===n&&(n=!1),this.m_worker.postMessage("PDFGetSigner",Array.prototype.slice.call(arguments))},t.prototype.XAdESGetSigner=function(t,e,n){return void 0===e&&(e=-1),void 0===n&&(n=!1),this.m_worker.postMessage("XAdESGetSigner",Array.prototype.slice.call(arguments))},t.prototype.XAdESSignData=function(t,e,n,r,i){return this.m_worker.postMessage("XAdESSignData",Array.prototype.slice.call(arguments))},t.prototype.XAdESVerifyData=function(t,e,n){return void 0===n&&(n=-1),this.m_worker.postMessage("XAdESVerifyData",Array.prototype.slice.call(arguments))},t.prototype.GetSignContainerInfo=function(t){return this.m_worker.postMessage("GetSignContainerInfo",Array.prototype.slice.call(arguments))},t}(),I=n(19),U=function(){function t(t,e){switch(void 0===e&&(e=h.EndUserLibraryType.JS),e){case h.EndUserLibraryType.SW:this.m_library=new I.a;break;case h.EndUserLibraryType.JS:case h.EndUserLibraryType.MS:default:this.m_library=new v(t)}}return t.prototype.AddEventListener=function(t,e){return this.m_library.AddEventListener(t,e)},t.prototype.GetLibraryInfo=function(t){return this.m_library.GetLibraryInfo(t)},t.prototype.IsInitialized=function(){return this.m_library.IsInitialized()},t.prototype.Initialize=function(t){return this.m_library.Initialize(t)},t.prototype.SetRuntimeParameter=function(t,e){return this.m_library.SetRuntimeParameter(t,e)},t.prototype.GetStorageParameter=function(t,e){return void 0===e&&(e=!1),this.m_library.GetStorageParameter(t,e)},t.prototype.SetStorageParameter=function(t,e,n){return void 0===n&&(n=!1),this.m_library.SetStorageParameter(t,e,n)},t.prototype.GetCAs=function(){return this.m_library.GetCAs()},t.prototype.GetProxySettings=function(){return this.m_library.GetProxySettings()},t.prototype.SetProxySettings=function(t){return this.m_library.SetProxySettings(t)},t.prototype.GetKeyMedias=function(){return this.m_library.GetKeyMedias()},t.prototype.GetJKSPrivateKeys=function(t){return this.m_library.GetJKSPrivateKeys(t)},t.prototype.IsPrivateKeyReaded=function(){return this.m_library.IsPrivateKeyReaded()},t.prototype.ResetPrivateKey=function(){return this.m_library.ResetPrivateKey()},t.prototype.ResetOperationKSP=function(){return this.m_library.ResetOperationKSP()},t.prototype.ReadPrivateKey=function(t,e,n){return this.m_library.ReadPrivateKey(t,e,n)},t.prototype.ReadPrivateKeyBinary=function(t,e,n,r){return this.m_library.ReadPrivateKeyBinary(t,e,n,r)},t.prototype.ReadPrivateKeySIM=function(t,e,n,r){return void 0===n&&(n=!0),void 0===r&&(r=0),this.m_library.ReadPrivateKeySIM(t,e,n,r)},t.prototype.ReadPrivateKeyKSP=function(t,e,n,r){return void 0===n&&(n=!0),void 0===r&&(r=0),this.m_library.ReadPrivateKeyKSP(t,e,n,r)},t.prototype.GetOwnCertificates=function(){return this.m_library.GetOwnCertificates()},t.prototype.GetOwnEUserParams=function(){return this.m_library.GetOwnEUserParams()},t.prototype.ChangeOwnCertificatesStatus=function(t,e){return this.m_library.ChangeOwnCertificatesStatus(t,e)},t.prototype.MakeNewCertificate=function(t,e,n,r,i,o,s,a,u,c,l,f,p,_,h,E,y,S){return void 0===E&&(E=!1),void 0===y&&(y=null),void 0===S&&(S=null),this.m_library.MakeNewCertificate(t,e,n,r,i,o,s,a,u,c,l,f,p,_,h,E,y,S)},t.prototype.MakeDeviceCertificate=function(t,e,n,r,i){return this.m_library.MakeDeviceCertificate(t,e,n,r,i)},t.prototype.ChangePrivateKeyPassword=function(t,e){return this.m_library.ChangePrivateKeyPassword(t,e)},t.prototype.ChangePrivateKeyPasswordBinary=function(t,e,n){return this.m_library.ChangePrivateKeyPasswordBinary(t,e,n)},t.prototype.GeneratePrivateKey=function(t,e,n,r,i,o,s,a,u,c,l,f){return this.m_library.GeneratePrivateKey(t,e,n,r,i,o,s,a,u,c,l,f)},t.prototype.GeneratePrivateKeyBinary=function(t,e,n,r,i,o,s,a,u,c,l){return this.m_library.GeneratePrivateKeyBinary(t,e,n,r,i,o,s,a,u,c,l)},t.prototype.GetKeyInfo=function(t){return this.m_library.GetKeyInfo(t)},t.prototype.GetKeyInfoBinary=function(t,e){return this.m_library.GetKeyInfoBinary(t,e)},t.prototype.GetClientRegistrationTokenKSP=function(t){return this.m_library.GetClientRegistrationTokenKSP(t)},t.prototype.HashData=function(t,e,n){return this.m_library.HashData(t,e,n)},t.prototype.GetSigner=function(t,e,n){return this.m_library.GetSigner(t,e,n)},t.prototype.SignData=function(t,e){return void 0===e&&(e=!1),this.m_library.SignData(t,e)},t.prototype.SignDataInternal=function(t,e,n){return void 0===n&&(n=!1),this.m_library.SignDataInternal(t,e,n)},t.prototype.SignHash=function(t,e,n,r){return void 0===r&&(r=!1),this.m_library.SignHash(t,e,n,r)},t.prototype.SignDataEx=function(t,e,n,r,i){return void 0===i&&(i=!1),this.m_library.SignDataEx(t,e,n,r,i)},t.prototype.AppendSign=function(t,e,n,r,i){return void 0===i&&(i=!1),this.m_library.AppendSign(t,e,n,r,i)},t.prototype.AppendSignHash=function(t,e,n,r,i){return this.m_library.AppendSignHash(t,e,n,r,i)},t.prototype.VerifyHash=function(t,e,n){return void 0===n&&(n=-1),this.m_library.VerifyHash(t,e,n)},t.prototype.VerifyData=function(t,e,n){return void 0===n&&(n=-1),this.m_library.VerifyData(t,e,n)},t.prototype.VerifyDataInternal=function(t,e){return void 0===e&&(e=-1),this.m_library.VerifyDataInternal(t,e)},t.prototype.EnvelopData=function(t,e,n,r,i,o){return void 0===o&&(o=!1),this.m_library.EnvelopData(t,e,n,r,i,o)},t.prototype.DevelopData=function(t,e){return this.m_library.DevelopData(t,e)},t.prototype.ProtectDataByPassword=function(t,e,n){return this.m_library.ProtectDataByPassword(t,e,n)},t.prototype.UnprotectDataByPassword=function(t,e,n){return this.m_library.UnprotectDataByPassword(t,e,n)},t.prototype.CreateAuthData=function(t,e,n){return this.m_library.CreateAuthData(t,e,n)},t.prototype.GetTSPByAccessInfo=function(t,e,n,r,i){return this.m_library.GetTSPByAccessInfo(t,e,n,r,i)},t.prototype.CheckTSP=function(t,e,n){return this.m_library.CheckTSP(t,e,n)},t.prototype.CtxCreate=function(){return this.m_library.CtxCreate()},t.prototype.CtxFree=function(t){return this.m_library.CtxFree(t)},t.prototype.CtxSetParameter=function(t,e,n){return this.m_library.CtxSetParameter(t,e,n)},t.prototype.CtxReadPrivateKey=function(t,e,n,r){return void 0===t&&(t=null),this.m_library.CtxReadPrivateKey(t,e,n,r)},t.prototype.CtxReadPrivateKeyBinary=function(t,e,n,r,i){return void 0===t&&(t=null),this.m_library.CtxReadPrivateKeyBinary(t,e,n,r,i)},t.prototype.CtxFreePrivateKey=function(t){return this.m_library.CtxFreePrivateKey(t)},t.prototype.CtxGetOwnCertificates=function(t){return this.m_library.CtxGetOwnCertificates(t)},t.prototype.CtxSignHash=function(t,e,n,r,i){return this.m_library.CtxSignHash(t,e,n,r,i)},t.prototype.CtxSignData=function(t,e,n,r,i,o){return this.m_library.CtxSignData(t,e,n,r,i,o)},t.prototype.CtxAppendSignHash=function(t,e,n,r,i,o){return this.m_library.CtxAppendSignHash(t,e,n,r,i,o)},t.prototype.CtxAppendSign=function(t,e,n,r,i,o){return this.m_library.CtxAppendSign(t,e,n,r,i,o)},t.prototype.CtxEnvelopData=function(t,e,n,r,i,o,s){return this.m_library.CtxEnvelopData(t,e,n,r,i,o,s)},t.prototype.CtxDevelopData=function(t,e,n){return this.m_library.CtxDevelopData(t,e,n)},t.prototype.ProtectTaxReports=function(t,e,n,r,i,o,s){return void 0===t&&(t=null),void 0===e&&(e=null),void 0===n&&(n=null),this.m_library.ProtectTaxReports(t,e,n,r,i,o,s)},t.prototype.UnprotectTaxReceipts=function(t,e){return this.m_library.UnprotectTaxReceipts(t,e)},t.prototype.ASiCGetSigner=function(t,e,n){return this.m_library.ASiCGetSigner(t,e,n)},t.prototype.ASiCSignData=function(t,e,n,r,i,o){return this.m_library.ASiCSignData(t,e,n,r,i,o)},t.prototype.ASiCAppendSign=function(t,e,n,r,i){return this.m_library.ASiCAppendSign(t,e,n,r,i)},t.prototype.ASiCVerifyData=function(t,e){return this.m_library.ASiCVerifyData(t,e)},t.prototype.PDFGetSigner=function(t,e,n){return this.m_library.PDFGetSigner(t,e,n)},t.prototype.PDFSignData=function(t,e,n,r){return this.m_library.PDFSignData(t,e,n,r)},t.prototype.PDFVerifyData=function(t,e){return this.m_library.PDFVerifyData(t,e)},t.prototype.XAdESGetSigner=function(t,e,n){return this.m_library.XAdESGetSigner(t,e,n)},t.prototype.XAdESSignData=function(t,e,n,r,i){return this.m_library.XAdESSignData(t,e,n,r,i)},t.prototype.XAdESVerifyData=function(t,e,n){return this.m_library.XAdESVerifyData(t,e,n)},t.prototype.GetSignContainerInfo=function(t){return this.m_library.GetSignContainerInfo(t)},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(){}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(){}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(0),i=function(){this.type=r.EndUserSignContainerType.Unknown,this.subType=r.EndUserCAdESType.Unknown,this.asicSignType=r.EndUserASiCSignType.Unknown}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(){}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r})),n.d(e,"d",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"b",(function(){return s}));var r=function(){},i=function(){},o=function(){},s=function(){}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(){}},function(t,e,n){"use strict";n.d(e,"b",(function(){return r})),n.d(e,"a",(function(){return i}));var r=function(){},i=function(){}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(){}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r})),n.d(e,"b",(function(){return i}));var r=function(){this.version=null,this.supported=!1,this.loaded=!1},i=function(){this.version=null,this.supported=!1,this.loaded=!1,this.isSignAgentSupported=!1,this.isWebExtensionSupported=!1,this.isNPAPISupported=!1,this.isActiveXSupported=!1,this.isWebExtensionInstalled=!1,this.isNativeLibraryNeedUpdate=!1,this.nativeLibraryInstallURL=null,this.nativeLibraryUpdateURL=null,this.webExtensionInstallURL=null,this.helpURL=null}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(){}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(){}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(){}},function(t,e,n){(function(e,r){var i;
2
2
  /*!
3
3
  * @overview es6-promise - a tiny implementation of Promises/A+.
4
4
  * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
5
5
  * @license Licensed under MIT license
6
6
  * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE
7
7
  * @version 3.3.1
8
- */i=function(){"use strict";function t(t){return"function"==typeof t}var i=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},o=0,s=void 0,a=void 0,u=function(t,e){E[o]=t,E[o+1]=e,2===(o+=2)&&(a?a(y):R())},c="undefined"!=typeof window?window:void 0,l=c||{},f=l.MutationObserver||l.WebKitMutationObserver,p="undefined"==typeof self&&void 0!==e&&"[object process]"==={}.toString.call(e),_="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function h(){var t=setTimeout;return function(){return t(y,1)}}var E=new Array(1e3);function y(){for(var t=0;t<o;t+=2)(0,E[t])(E[t+1]),E[t]=void 0,E[t+1]=void 0;o=0}var S,C,d,m,R=void 0;function A(t,e){var n=arguments,r=this,i=new this.constructor(g);void 0===i[v]&&k(i);var o,s=r._state;return s?(o=n[s-1],u((function(){return x(s,i,o,r._result)}))):G(r,i,t,e),i}function P(t){if(t&&"object"==typeof t&&t.constructor===this)return t;var e=new this(g);return b(e,t),e}p?R=function(){return e.nextTick(y)}:f?(C=0,d=new f(y),m=document.createTextNode(""),d.observe(m,{characterData:!0}),R=function(){m.data=C=++C%2}):_?((S=new MessageChannel).port1.onmessage=y,R=function(){return S.port2.postMessage(0)}):R=void 0===c?function(){try{var t=n(23);return s=t.runOnLoop||t.runOnContext,function(){s(y)}}catch(t){return h()}}():h();var v=Math.random().toString(36).substring(16);function g(){}var T=new M;function I(t){try{return t.then}catch(t){return T.error=t,T}}function U(e,n,r){n.constructor===e.constructor&&r===A&&n.constructor.resolve===P?function(t,e){1===e._state?O(t,e._result):2===e._state?N(t,e._result):G(e,void 0,(function(e){return b(t,e)}),(function(e){return N(t,e)}))}(e,n):r===T?N(e,T.error):void 0===r?O(e,n):t(r)?function(t,e,n){u((function(t){var r=!1,i=function(t,e,n,r){try{t.call(e,n,r)}catch(t){return t}}(n,e,(function(n){r||(r=!0,e!==n?b(t,n):O(t,n))}),(function(e){r||(r=!0,N(t,e))}),t._label);!r&&i&&(r=!0,N(t,i))}),t)}(e,n,r):O(e,n)}function b(t,e){var n;t===e?N(t,new TypeError("You cannot resolve a promise with itself")):"function"==typeof(n=e)||"object"==typeof n&&null!==n?U(t,e,I(e)):O(t,e)}function D(t){t._onerror&&t._onerror(t._result),w(t)}function O(t,e){void 0===t._state&&(t._result=e,t._state=1,0!==t._subscribers.length&&u(w,t))}function N(t,e){void 0===t._state&&(t._state=2,t._result=e,u(D,t))}function G(t,e,n,r){var i=t._subscribers,o=i.length;t._onerror=null,i[o]=e,i[o+1]=n,i[o+2]=r,0===o&&t._state&&u(w,t)}function w(t){var e=t._subscribers,n=t._state;if(0!==e.length){for(var r=void 0,i=void 0,o=t._result,s=0;s<e.length;s+=3)r=e[s],i=e[s+n],r?x(n,r,i,o):i(o);t._subscribers.length=0}}function M(){this.error=null}var K=new M;function x(e,n,r,i){var o=t(r),s=void 0,a=void 0,u=void 0,c=void 0;if(o){if((s=function(t,e){try{return t(e)}catch(t){return K.error=t,K}}(r,i))===K?(c=!0,a=s.error,s=null):u=!0,n===s)return void N(n,new TypeError("A promises callback cannot return that same promise."))}else s=i,u=!0;void 0!==n._state||(o&&u?b(n,s):c?N(n,a):1===e?O(n,s):2===e&&N(n,s))}var L=0;function k(t){t[v]=L++,t._state=void 0,t._result=void 0,t._subscribers=[]}function B(t,e){this._instanceConstructor=t,this.promise=new t(g),this.promise[v]||k(this.promise),i(e)?(this._input=e,this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0===this.length?O(this.promise,this._result):(this.length=this.length||0,this._enumerate(),0===this._remaining&&O(this.promise,this._result))):N(this.promise,new Error("Array Methods must be provided an Array"))}function F(t){this[v]=L++,this._result=this._state=void 0,this._subscribers=[],g!==t&&("function"!=typeof t&&function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof F?function(t,e){try{e((function(e){b(t,e)}),(function(e){N(t,e)}))}catch(e){N(t,e)}}(this,t):function(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}())}function Y(){var t=void 0;if(void 0!==r)t=r;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(t){throw new Error("polyfill failed because global object is unavailable in this environment")}var e=t.Promise;if(e){var n=null;try{n=Object.prototype.toString.call(e.resolve())}catch(t){}if("[object Promise]"===n&&!e.cast)return}t.Promise=F}return B.prototype._enumerate=function(){for(var t=this.length,e=this._input,n=0;void 0===this._state&&n<t;n++)this._eachEntry(e[n],n)},B.prototype._eachEntry=function(t,e){var n=this._instanceConstructor,r=n.resolve;if(r===P){var i=I(t);if(i===A&&void 0!==t._state)this._settledAt(t._state,e,t._result);else if("function"!=typeof i)this._remaining--,this._result[e]=t;else if(n===F){var o=new n(g);U(o,t,i),this._willSettleAt(o,e)}else this._willSettleAt(new n((function(e){return e(t)})),e)}else this._willSettleAt(r(t),e)},B.prototype._settledAt=function(t,e,n){var r=this.promise;void 0===r._state&&(this._remaining--,2===t?N(r,n):this._result[e]=n),0===this._remaining&&O(r,this._result)},B.prototype._willSettleAt=function(t,e){var n=this;G(t,void 0,(function(t){return n._settledAt(1,e,t)}),(function(t){return n._settledAt(2,e,t)}))},F.all=function(t){return new B(this,t).promise},F.race=function(t){var e=this;return i(t)?new e((function(n,r){for(var i=t.length,o=0;o<i;o++)e.resolve(t[o]).then(n,r)})):new e((function(t,e){return e(new TypeError("You must pass an array to race."))}))},F.resolve=P,F.reject=function(t){var e=new this(g);return N(e,t),e},F._setScheduler=function(t){a=t},F._setAsap=function(t){u=t},F._asap=u,F.prototype={constructor:F,then:A,catch:function(t){return this.then(null,t)}},Y(),F.polyfill=Y,F.Promise=F,F},t.exports=i()}).call(this,n(21),n(22))},function(t,e,n){"use strict";(function(t){var n=function(t,e,n){this.id=t,this.cmd=e,this.params=n,this.origin=window.location.origin?window.location.origin:window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:""),this.pathname=window.location.pathname},r=function(t,e,n,r){this.id=t,this.cmd=e,this.result=n,this.error=r},i=function(){function e(t,e,n){var r=this;this.m_worker=this.loadWorker(t,e),this.m_worker.onmessage=function(t){var e=t.data;if(-2!=e.id){var i=r.m_promises[e.id-1];i&&(delete r.m_promises[e.id-1],e.error?i.reject(e.error):i.resolve(e.result))}else n(e.result)},this.m_worker.onerror=function(t){r.m_promises.forEach((function(e){e.reject(t.error)})),r.m_promises=new Array},this.m_promises=new Array}return e.prototype.loadWorker=function(t,e){try{if(!t)throw"No worker content";try{var n,r=window,i=r.URL||r.webkitURL;try{(n=new(r.BlobBuilder||r.WebKitBlobBuilder||r.MozBlobBuilder||r.MSBlobBuilder)).append(t),n=n.getBlob()}catch(e){n=new Blob([t])}return new Worker(i.createObjectURL(n))}catch(e){return new Worker("data:application/javascript,"+encodeURIComponent(t))}}catch(t){if(!e)throw Error("Inline worker is not supported");return new Worker(e)}},e.prototype.postMessage=function(e,r){var i=this,o=new n(-1,e,r),s=new t((function(t,e){o.id=i.m_promises.push({resolve:t,reject:e})}));return this.m_worker.postMessage(o),s},e}();e.a=i;!function(){function t(t){this.m_context=t,this.m_initialized=!1;var e=this;self.onmessage=function(t){e.onMessage(t.data)}}t.prototype.postMessage=function(t,e,n,i){var o=new r(t,e,n,i);self.postMessage(o)},t.prototype.onMessage=function(t){var e=this;this.m_initialized?this.m_context[t.cmd].apply(this.m_context,t.params).then((function(n){e.postMessage(t.id,t.cmd,n)}),(function(n){e.postMessage(t.id,t.cmd,null,n)})):setTimeout((function(){e.onMessage(t)}),50)},t.prototype.initialize=function(){this.m_initialized=!0}}()}).call(this,n(17).Promise)},function(t,e,n){"use strict";(function(t){var r=n(1),i=n(9),o=n(10),s=n(14),a=n(20),u=n(4),c=n(13),l=n(2),f=n(8),p=n(0),_=n(11),h=n(15),E=n(16),y=n(7),S=n(5),C=n(12),d=n(6),m=function(){},R=function(){function e(){this.m_library=new a.a,this.m_settings=null,this.m_initialized=!1,this.m_kmTypes=null,this.m_kmActiveOperation=!1,this.m_context=null,this.m_pkContext=null,this.m_eventListeners=new Array,this.m_resolveOIDs=!1}return e.prototype.MapError=function(t){var e=new r.EndUserError;return void 0!==t.GetErrorCode&&void 0!==t.GetMessage?(e.code=t.GetErrorCode(),e.message=t.GetMessage()):void 0!==t.code&&void 0!==t.message?(e.code=t.code,e.message=t.message):(e.code=r.EU_ERROR_UNKNOWN,e.message=t.toString()),e},e.prototype.ProcessArray=function(e,n){var r=this;return new t((function(t,i){var o=Array(),s=0,a=function(){s>=e.length?t(o):(n(e[s]).then((function(t){o.push(t),a()})).catch((function(t){return i(r.MapError(t))})),s++)};a()}))},e.prototype.DataToNamedDataArray=function(t){t=null!=t?t:[],t=Array.isArray(t)?t:[t];for(var e=[],n=0;n<t.length;n++){var r=void 0!==t[n].name&&void 0!==t[n].val;e.push({name:r?t[n].name:"Ім'я відсутнє",val:r?t[n].val:t[n]})}return e},e.prototype.DataToResult=function(t,e){for(var n=[],r=!Array.isArray(t),i=r?[t]:t,o=0;o<i.length;o++){var s=void 0!==i[o].name&&void 0!==i[o].val?{name:i[o].name,val:e[o]}:e[o];n.push(s)}return r?n[0]:n},e.prototype.OnEvent=function(t){try{var e=this.m_eventListeners[t.type]||this.m_eventListeners[p.EndUserEventType.All];e&&e(t)}catch(t){}},e.prototype.CheckInitialize=function(){var e=this,n=e.m_library;return new t((function(t,i){e.m_initialized?t():n.Load().then((function(){throw n.MakeError(r.EU_ERROR_NOT_INITIALIZED,"")})).catch((function(t){return i(e.MapError(t))}))}))},e.prototype.BeginKMOperation=function(){var e=this;return new t((function(t,n){var r=function(){e.m_kmActiveOperation?setTimeout(r,10):(e.m_kmActiveOperation=!0,t())};r()}))},e.prototype.EndKMOperation=function(){this.m_kmActiveOperation=!1},e.prototype.GetCASettings=function(t){if(!t)return null;for(var e=this.m_settings.CAs,n=0;n<e.length;n++)for(var r=e[n].issuerCNs,i=0;i<r.length;i++)if(r[i]==t)return e[n];return null},e.prototype.IsCMPCompatible=function(t,e){return!!t.cmpAddress&&(void 0===t.cmpCompatibility||(t.cmpCompatibility&e)==e)},e.prototype.SetSettings=function(e){var n=this,i=n.m_library,o=n.m_settings.CAs,s=this.GetCASettings(e),a=o&&o.length>0?o[0]:null;return new t((function(t,o){if(e&&null==s)throw i.MakeError(r.EU_ERROR_WRITE_SETTINGS,"");var u=s&&s.tspAddress?s:a,c=i.CreateTSPSettings();c.SetGetStamps(!0),c.SetAddress(u?u.tspAddress:""),c.SetPort(u?u.tspAddressPort:"80"),i.SetTSPSettings(c).then((function(){var t=!s||!(!s||!s.ocspAccessPointAddress),e=i.CreateOCSPSettings();return e.SetUseOCSP(t),t&&(e.SetBeforeStore(!0),e.SetAddress("czo.gov.ua"),e.SetPort("80")),i.SetOCSPSettings(e)})).then((function(){var t;t=!(!s||!s.cmpAddress);var e=i.CreateCMPSettings();return e.SetUseCMP(t),t&&(e.SetAddress(s.cmpAddress),e.SetPort("80")),i.SetCMPSettings(e)})).then((function(){t()})).catch((function(t){o(n.MapError(t))}))}))},e.prototype.GetJKSPrivateKey=function(e,n){var r=this,i=r.m_library;return new t((function(t,o){var a={alias:null,info:null};i.EnumJKSPrivateKeys(e,n).then((function(n){if(null!=n)return a.alias=n,i.GetJKSPrivateKey(e,n);t(null)})).then((function(t){a.info=t;for(var e=new Array,n=0;n<t.GetCertificatesCount();n++)e.push(t.GetCertificate(n));return r.ProcessArray(e,(function(t){return i.ParseCertificateEx(t)}))})).then((function(e){var n=new s.a;n.alias=a.alias,n.privateKey=a.info.GetPrivateKey(),n.certificates=new Array,n.digitalStamp=!1;for(var r=0;r<e.length;r++){var o=e[r];if(o.GetSubjType()==i.EU_SUBJECT_TYPE_END_USER){o.GetPublicKeyType()==i.EU_CERT_KEY_TYPE_DSTU4145&&(o.GetKeyUsageType()&i.EU_KEY_USAGE_DIGITAL_SIGNATURE)==i.EU_KEY_USAGE_DIGITAL_SIGNATURE&&(n.digitalStamp=o.GetExtKeyUsages().indexOf(i.EU_UA_OID_EXT_KEY_USAGE_STAMP)>-1);var c=new u.EndUserCertificate;c.data=a.info.GetCertificate(r),c.infoEx=l.a.MapToEndUserCertificateInfoEx(o,new f.a),n.certificates.push(c)}}n.digitalStamp=!1,t(n)})).catch((function(t){return o(r.MapError(t))}))}))},e.prototype.SaveCertificatesInternal=function(e){var n=this,r=this.m_library;return new t((function(t,i){e?Array.isArray(e)?n.ProcessArray(e,(function(t){return r.SaveCertificate(t)})).then((function(){return t()})).catch((function(t){return i(t)})):r.SaveCertificates(e).then((function(){return t()})).catch((function(t){return i(t)})):t()}))},e.prototype.CtxReadPrivateKeyInternal=function(e,n,i,o,s,a){var u=this,c=this.m_library,l={pkContext:null};return e||(e=u.m_context),new t((function(t,f){u.SaveCertificatesInternal(s).then((function(){return u.SetSettings(a)})).then((function(){return null!=n&&null!=i?c.CtxReadPrivateKeyBinary(e,n,i):c.CtxReadPrivateKey(e,o)})).then((function(t){l.pkContext=t;var e=t.GetOwnerInfo();if(!a)return u.SetSettings(e.GetIssuerCN());var n=u.GetCASettings(e.GetIssuerCN());if(!n||-1==n.issuerCNs.indexOf(a))throw c.MakeError(r.EU_ERROR_CERT_NOT_FOUND,"")})).then((function(){t(l.pkContext)})).catch((function(s){null==l.pkContext?u.MapError(s).code!=r.EU_ERROR_CERT_NOT_FOUND||a?f(u.MapError(s)):u.SearchPrivateKeyCertificatesWithCMP(n,i,o).then((function(t){return u.CtxReadPrivateKeyInternal(e,n,i,o,t.certs,t.CACommonName)})).then((function(e){t(e)})).catch((function(t){return f(u.MapError(t))})):c.CtxFreePrivateKey(l.pkContext).then((function(){f(u.MapError(s))})).catch((function(){f(u.MapError(s))}))}))}))},e.prototype.ReadPrivateKeyInternal=function(e,n,r,i,s){var a=this;return new t((function(t,u){a.ResetPrivateKeyInternal().then((function(){return a.CtxReadPrivateKeyInternal(a.m_context,e,n,r,i,s)})).then((function(e){a.m_pkContext=e;var n=l.a.MapEndUserOwnerInfo(e.GetOwnerInfo(),new o.a);t(n)})).catch((function(t){u(a.MapError(t))}))}))},e.prototype.ResetPrivateKeyInternal=function(){var e=this,n=this.m_library;return new t((function(t,r){null!=e.m_pkContext?n.CtxFreePrivateKey(e.m_pkContext).then((function(){e.m_pkContext=null,t()})).catch((function(t){return r(e.MapError(t))})):t()}))},e.prototype.SearchPrivateKeyCertificatesWithCMP=function(e,n,i,o){var s=this,a=s.m_library,u=s.m_settings.CAs;return new t((function(t,c){(null!=e&&null!=n?a.GetKeyInfoBinary(e,n):a.GetKeyInfo(i)).then((function(e){var n=function(i,l){if(i>=u.length){var f=a.MakeError(l?r.EU_ERROR_CERT_NOT_FOUND:r.EU_ERROR_TRANSMIT_REQUEST,"");c(s.MapError(f))}else{var _=o?p.EndUserCMPCompatibility.DownloadEUCerts:p.EndUserCMPCompatibility.SearchEUCerts;s.IsCMPCompatible(u[i],_)?o&&-1==u[i].issuerCNs.indexOf(o)?n(i+1,l):a.GetCertificatesByKeyInfo(e,[u[i].cmpAddress],["80"]).then((function(e){t({certs:e,CACommonName:u[i].issuerCNs[0]})})).catch((function(t){var e=t.GetErrorCode();if(e==r.EU_ERROR_CERT_NOT_FOUND||e==r.EU_ERROR_TRANSMIT_REQUEST)return l=l||e==r.EU_ERROR_CERT_NOT_FOUND,void n(i+1,l);c(s.MapError(t))})):n(i+1,l)}};n(0,!1)})).catch((function(t){return c(s.MapError(t))}))}))},e.prototype.GetUserCertificatesFromCertificates=function(e){var n=this,r=n.m_library;return new t((function(t,i){var o=new Array,s=function(a){r.GetCertificateFromSignedData(a,e).then((function(e){if(null!=e){var n=new u.EndUserCertificate;return n.data=e,o.push(n),r.ParseCertificateEx(e)}for(var i=new Array,s=0;s<o.length;s++){o[s].infoEx.subjType==r.EU_SUBJECT_TYPE_END_USER&&i.push(o[s])}t(i)})).then((function(t){o[a].infoEx=l.a.MapToEndUserCertificateInfoEx(t,new f.a),s(a+1)})).catch((function(t){return i(n.MapError(t))}))};s(0)}))},e.prototype.GeneratePrivateKeyInternal=function(e,n,r,i,o,s,a,u,c,f,p,_,h){var y=this,S=this.m_library;return new t((function(t,C){var d=null==e&&null==r,m=null!=r,R=S.CreatePrivateKeyInfo(),A=null;null!=_&&(A=l.a.MapFromEndUserInfo(_,S.CreateEndUserInfo())),S.GeneratePrivateKeyEx(d,e?e.GetTypeIndex():-1,e?e.GetDevIndex():-1,e?e.GetPassword():r,n,i,o,s,a,u,c,f,p,A,h,R,null!=r).then((function(e){for(var n=new Array,r=0;r<e.size();r++){var i=e.get(r);i=l.a.MapToEndUserRequestInfo(i,new E.a),n.push(i)}var o={key:m?R.GetPrivateKey():null,requests:n};t(o)})).catch((function(t){return C(y.MapError(t))}))}))},e.prototype.GetHashAlgoBySignAlgo=function(t){var e=this.m_library;switch(t){case p.EndUserSignAlgo.DSTU4145WithGOST34311:return p.EndUserHashAlgo.GOST34311;case p.EndUserSignAlgo.RSAWithSHA:case p.EndUserSignAlgo.ECDSAWithSHA:return p.EndUserHashAlgo.SHA256;default:throw e.MakeError(r.EU_ERROR_BAD_PARAMETER,"")}},e.prototype.CtxSignHashInternal=function(e,n,i,o,s,a){var u=this,c=this.m_library,l=null!=o,f=u.DataToNamedDataArray(i),p=u.DataToNamedDataArray(o);return new t((function(o,_){u.CheckInitialize().then((function(){if(null==e)throw c.MakeError(r.EU_ERROR_BAD_CERT,"");if(l&&f.length!=p.length)throw c.MakeError(r.EU_ERROR_BAD_PARAMETER,"");for(var i=new Array,o=0;o<f.length;o++)i.push({hash:f[o],previousSign:l?p[o]:null});return u.ProcessArray(i,(function(r){return new t((function(t,i){(l?c.CtxAppendSignHash(e,n,r.hash.val,r.previousSign.val,s):c.CtxSignHash(e,n,r.hash.val,s)).then((function(t){return a?t:c.BASE64Decode(t)})).then((function(e){t(e)})).catch((function(t){return i(t)}))}))}))})).then((function(t){var e=u.DataToResult(i,t);o(e)})).catch((function(t){return _(u.MapError(t))}))}))},e.prototype.CtxSignDataInternal=function(e,n,i,o,s,a,u){var c=this,l=this,f=this.m_library,p=null!=o,_=l.DataToNamedDataArray(i),h=l.DataToNamedDataArray(o);return new t((function(E,y){l.CheckInitialize().then((function(){if(null==e)throw f.MakeError(r.EU_ERROR_BAD_CERT,"");if(p&&s&&_.length!=h.length)throw f.MakeError(r.EU_ERROR_BAD_PARAMETER,"");if(!s)return _;var t=l.GetHashAlgoBySignAlgo(n);return l.HashData(t,_,!0)})).then((function(r){for(var i=new Array,o=p?h.length:r.length,c=0;c<o;c++)i.push({dataOrHash:null!=r?r[c]:null,previousSign:p?h[c]:null});return l.ProcessArray(i,(function(r){return new t((function(t,i){(p?s?f.CtxAppendSignHash(e,n,r.dataOrHash.val,r.previousSign.val,a):f.CtxAppendSign(e,n,null,r.previousSign.val,a):s?f.CtxSignHash(e,n,r.dataOrHash.val,a):f.CtxSign(e,n,r.dataOrHash.val,!1,a)).then((function(t){return u?t:f.BASE64Decode(t)})).then((function(e){t(e)})).catch((function(t){return i(t)}))}))}))})).then((function(t){var e=c.DataToResult(p&&!s?o:i,t);E(e)})).catch((function(t){return y(l.MapError(t))}))}))},e.prototype.LoadTaxReportPKey=function(e,n,i){var o=this,s=this.m_library;return new t((function(t,a){var u=new m;if(Array.isArray(e)||(e=[e]),e.length>2)a(o.MapError(s.MakeError(r.EU_ERROR_BAD_PARAMETER,"")));else{var c=function(l,f){var _=n[l],h=e[f];s.CtxGetOwnCertificate(h,p.EndUserCertKeyType.DSTU4145,_).then((function(e){if(i&&_&p.EndUserKeyUsage.DigitalSignature&&!(e.GetInfoEx().GetExtKeyUsages().indexOf(s.EU_UA_OID_EXT_KEY_USAGE_STAMP)>-1))throw s.MakeError(r.EU_ERROR_BAD_PARAMETER,"");if(_&p.EndUserKeyUsage.DigitalSignature)u.signPKCtx=h,u.signCert=e;else{if(!(_&p.EndUserKeyUsage.KeyAgreement))throw s.MakeError(r.EU_ERROR_BAD_PARAMETER,"");u.envelopPKCtx=h,u.envelopCert=e}l+1<n.length?c(l+1,0):t(u)})).catch((function(t){if(t.GetErrorCode()==r.EU_ERROR_CERT_NOT_FOUND){if(f+1<e.length)return void c(l,f+1);t=s.MakeError(r.EU_ERROR_BAD_PARAMETER,"")}a(o.MapError(t))}))};c(0,0)}}))},e.prototype.ProtectTaxReport=function(e,n,i,o,s,a,u){var c=this,l=this.m_library,f=new _.b;f.name=a.name;var p=function(e,n){return new t((function(t,r){return l.CtxSign(e.signPKCtx,l.EU_CTX_SIGN_DSTU4145_WITH_GOST34311,n,!1,!0).then((function(t){return l.BASE64Decode(t)})).then((function(t){return l.AppendCryptoHeader(l.EU_HEADER_CA_TYPE,l.EU_HEADER_PART_TYPE_SIGNED,t)})).then((function(e){t(e)})).catch((function(t){return r(c.MapError(t))}))}))},h=function(e,n){return new t((function(r,i){return l.CtxEnvelop(e.envelopPKCtx,[s],l.EU_RECIPIENT_APPEND_ISSUER_AND_SERIAL,!1,!1,n).then((function(t){return l.BASE64Decode(t)})).then((function(t){return l.AppendCryptoHeader(l.EU_HEADER_CA_TYPE,l.EU_HEADER_PART_TYPE_ENCRYPTED,t)})).then((function(n){var r=e.envelopCert,i=l.EU_KEY_USAGE_DIGITAL_SIGNATURE|l.EU_KEY_USAGE_KEY_AGREEMENT;return i==(r.GetInfoEx().GetKeyUsageType()&i)?n:function(e,n){return new t((function(t,r){return l.AppendCryptoHeader(l.EU_HEADER_CA_TYPE,l.EU_HEADER_PART_TYPE_CERTCRYPT,e).then((function(e){var r=new Uint8Array(e.byteLength+n.byteLength);r.set(new Uint8Array(e),0),r.set(new Uint8Array(n),e.byteLength),t(r)})).catch((function(t){return r(c.MapError(t))}))}))}(r.GetData(),n)})).then((function(t){return p(e,t)})).then((function(t){r({reportData:t,ownCert:e.envelopCert.GetData()})})).catch((function(t){return i(c.MapError(t))}))}))};return new t((function(s,_){new t((function(t,e){t(a.data)})).then((function(t){return null!=e?p(e,t):t})).then((function(t){return null!=n?p(n,t):t})).then((function(t){return null!=i?p(i,t):t})).then((function(t){return u&&(f.signedData=t),null!=n||null!=i?h(null!=i?i:n,t):{reportData:t,ownCert:e.signCert.GetData()}})).then((function(t){return l.AppendTransportHeader(l.EU_HEADER_CA_TYPE,a.name,o,t.ownCert,t.reportData)})).then((function(t){f.data=t,f.error=c.MapError(l.MakeError(r.EU_ERROR_NONE,"")),s(f)})).catch((function(t){f.error=c.MapError(t),s(f)}))}))},e.prototype.UnprotectTaxReceipt=function(e,n){var i=this,o=this.m_library,s=new _.a;s.data=null,s.receiptNumber=0,s.initiators=[],s.error=null;return new t((function(a,u){var c;(c=n.data,new t((function(t,e){o.ParseTransportHeader(c).then((function(e){s.receiptNumber=e.GetReceiptNumber(),t(e.GetCryptoData())})).catch((function(n){n.GetErrorCode()==r.EU_ERROR_PKI_FORMATS_FAILED?t(c):e(i.MapError(n))}))}))).then((function(n){var c=function(n){(function(n){var a={headerInfo:null};return new t((function(t,u){o.ParseCryptoHeader(n).then((function(t){a.headerInfo=t;var n=t.GetCryptoData();switch(t.GetHeaderType()){case o.EU_HEADER_PART_TYPE_SIGNED:return o.VerifyDataInternalOnTimeEx(n,0,null,!1,!1);case o.EU_HEADER_PART_TYPE_ENCRYPTED:return o.CtxDevelop(e,n);case o.EU_HEADER_PART_TYPE_STAMPED:case o.EU_HEADER_PART_TYPE_CERTCRYPT:return null;default:throw o.MakeError(r.EU_ERROR_PKI_FORMATS_FAILED,"")}})).then((function(e){if(null!=e){var r=a.headerInfo.GetHeaderType()==o.EU_HEADER_PART_TYPE_SIGNED?l.a.MapToEndUserSignInfo(e,new S.a):l.a.MapToEndUserSenderInfo(e,new C.a);s.initiators.push(r),n=e.GetData()}else n=n.slice(a.headerInfo.GetHeaderSize()+a.headerInfo.GetCryptoData().length,n.length);t(n)})).catch((function(e){e.GetErrorCode()==r.EU_ERROR_BAD_PARAMETER?t(null):u(i.MapError(e))}))}))})(n).then((function(t){if(null==t)return s.data=n,s.error=i.MapError(o.MakeError(r.EU_ERROR_NONE,"")),void a(s);c(t)})).catch((function(t){return u(i.MapError(t))}))};c(n)})).catch((function(t){return u(i.MapError(t))}))}))},e.prototype.AddEventListener=function(e,n){var i=this,o=i.m_library;return new t((function(t,s){if([p.EndUserEventType.None,p.EndUserEventType.All,p.EndUserEventType.ConfirmKSPOperation].indexOf(e)<0)s(i.MapError(o.MakeError(r.EU_ERROR_BAD_PARAMETER,"")));else{switch(e){case p.EndUserEventType.None:i.m_eventListeners=[];break;case p.EndUserEventType.All:i.m_eventListeners=[],i.m_eventListeners[e]=n;break;default:i.m_eventListeners[e]=n}t()}}))},e.prototype.GetLibraryInfo=function(e){var n=this,r=this.m_library;return new t((function(t,i){var o=new c.b;o.supported=r.IsSupported(),o.isSignAgentSupported=r.IsSignAgentSupported(),o.isWebExtensionSupported=r.IsWebExtensionSupported(),o.isNPAPISupported=r.IsNPAPISupported(),o.isActiveXSupported=r.IsActiveXSupported(),o.isWebExtensionInstalled=r.IsWebExtensionInstalled(),o.nativeLibraryInstallURLs=r.GetInstallURL(!0,e),o.nativeLibraryInstallURL=o.nativeLibraryInstallURLs?o.nativeLibraryInstallURLs[0]:null,o.nativeLibraryUpdateURLs=r.GetUpdateURL(!0,e),o.nativeLibraryUpdateURL=o.nativeLibraryUpdateURLs?o.nativeLibraryUpdateURLs[0]:null,o.webExtensionInstallURL=r.GetWebExtensionInstallURL(),o.helpURL=r.GetHelpURL(e),o.supported?r.Load().then((function(){o.loaded=!0,r.GetVersion().then((function(e){o.version=e,t(o)})).catch((function(t){return i(n.MapError(t))}))})).catch((function(e){var i=n.MapError(e);o.loaded=!1,o.isNativeLibraryNeedUpdate=r.IsLibraryVersionNotSupportedError(i.code),t(o)})):t(o)}))},e.prototype.IsInitialized=function(){var e=this;return new t((function(t,n){t(e.m_initialized)}))},e.prototype.Initialize=function(e){var n=this,r=n.m_library;return n.m_settings=e,new t((function(t,i){r.Load().then((function(){return r.SetRuntimeParameter(r.EU_SAVE_SETTINGS_PARAMETER,r.EU_SETTINGS_ID_PROXY)})).then((function(){return r.SetUIMode(!1)})).then((function(){return r.Initialize()})).then((function(){return r.SetUIMode(!1)})).then((function(){return r.SetCharset(n.m_settings.encoding)})).then((function(){return r.SetLanguage(n.m_settings.language)})).then((function(){return r.InitializeMandatorySettings()})).then((function(){var t=r.CreateFileStoreSettings();return t.SetPath(""),t.SetSaveLoadedCerts(!0),r.SetFileStoreSettings(t)})).then((function(){return null!=n.m_settings.CAs&&"string"==typeof n.m_settings.CAs?r.DownloadData(n.m_settings.CAs,"json"):n.m_settings.CAs})).then((function(t){n.m_settings.CAs=t;var e=r.CreateOCSPAccessInfoModeSettings();return e.SetEnabled(!0),r.SetOCSPAccessInfoModeSettings(e)})).then((function(){for(var t=new Array,e=n.m_settings.CAs,i=0;i<e.length;i++)for(var o=0;o<e[i].issuerCNs.length;o++){var s=r.CreateOCSPAccessInfoSettings();s.SetAddress(e[i].ocspAccessPointAddress),s.SetPort(e[i].ocspAccessPointPort),s.SetIssuerCN(e[i].issuerCNs[o]),t.push(s)}return r.SetOCSPAccessInfoSettings(t)})).then((function(){var t=r.CreateModeSettings();return r.SetModeSettings(t)})).then((function(){return null!=e.CACertificates&&"string"==typeof e.CACertificates?r.DownloadData(e.CACertificates,"binary"):e.CACertificates})).then((function(t){if(null!=e.CACertificates)return r.SaveCertificates(t)})).then((function(){return r.SetRuntimeParameter(r.EU_RESOLVE_OIDS_PARAMETER,n.m_resolveOIDs)})).then((function(){return r.CtxCreate()})).then((function(t){return n.m_context=t,r.CtxSetParameter(t,r.EU_RESOLVE_OIDS_CONTEXT_PARAMETER,n.m_resolveOIDs)})).then((function(){return null!=n.m_settings.signInfoTmpl&&"string"==typeof n.m_settings.signInfoTmpl?r.DownloadData(n.m_settings.signInfoTmpl,""):n.m_settings.signInfoTmpl})).then((function(e){n.m_settings.signInfoTmpl=e,n.m_initialized=!0,t()})).catch((function(t){return i(n.MapError(t))}))}))},e.prototype.SetRuntimeParameter=function(e,n){var r=this,i=r.m_library;return new t((function(t,o){r.CheckInitialize().then((function(){return i.SetRuntimeParameter(e,n)})).then((function(){t()})).catch((function(t){return o(r.MapError(t))}))}))},e.prototype.GetStorageParameter=function(e,n){var r=this,i=r.m_library;return new t((function(t,o){r.CheckInitialize().then((function(){return i.GetStorageParameter(n,e)})).then((function(e){t(e)})).catch((function(t){return o(r.MapError(t))}))}))},e.prototype.SetStorageParameter=function(e,n,r){var i=this,o=i.m_library;return new t((function(t,s){i.CheckInitialize().then((function(){return o.SetStorageParameter(r,e,n)})).then((function(){t()})).catch((function(t){return s(i.MapError(t))}))}))},e.prototype.GetCAs=function(){var e=this;return new t((function(t,n){e.CheckInitialize().then((function(){t(e.m_settings.CAs)})).catch((function(t){return n(e.MapError(t))}))}))},e.prototype.GetProxySettings=function(){var e=this,n=e.m_library;return new t((function(t,r){e.CheckInitialize().then((function(){return n.GetProxySettings()})).then((function(e){var n=l.a.MapToProxySettings(e,new i.b);t(n)})).catch((function(t){return r(e.MapError(t))}))}))},e.prototype.SetProxySettings=function(e){var n=this,r=n.m_library;return new t((function(t,i){n.CheckInitialize().then((function(){var t=l.a.MapFromProxySettings(e,r.CreateProxySettings());return r.SetProxySettings(t)})).then((function(){t()})).catch((function(t){return i(n.MapError(t))}))}))},e.prototype.GetKeyMedias=function(){var e=this,n=e.m_library,r=new Array,i=null;return e.m_settings.allowedKeyMediaDevices&&(i={},e.m_settings.allowedKeyMediaDevices.forEach((function(t){i[t.type]=t.devices}))),new t((function(t,o){e.CheckInitialize().then((function(){return e.BeginKMOperation()})).then((function(){return e.m_kmTypes?e.m_kmTypes:n.GetKeyMediaTypes()})).then((function(t){e.m_kmTypes=t;var i=e.m_settings.allowedKeyMediaTypes;r=new Array;for(var o=0;o<t.length;o++){var s=t[o];(!i||i.indexOf(s)>=0)&&r.push(o)}return n.GetKeyMediaDevices(r)})).then((function(n){for(var o=new Array,s=0;s<n.length;s++)for(var a=r[s],c=e.m_kmTypes[a],l=n[s],f=i&&i[c]?i[c]:null,p=0;p<l.length;p++)if(!f||-1!=f.indexOf(l[p])){var _=new u.EndUserKeyMedia;_.typeIndex=a,_.devIndex=p,_.password=null,_.type=c,_.device=l[p],_.visibleName=_.device+"("+_.type+")",o.push(_)}e.EndKMOperation(),t(o)})).catch((function(t){e.EndKMOperation(),o(e.MapError(t))}))}))},e.prototype.GetJKSPrivateKeys=function(e){var n=this;return new t((function(t,r){n.CheckInitialize().then((function(){var i=new Array,o=function(s){n.GetJKSPrivateKey(e,s).then((function(e){e?(i.push(e),o(s+1)):t(i)})).catch((function(t){return r(n.MapError(t))}))};o(0)})).catch((function(t){return r(n.MapError(t))}))}))},e.prototype.IsPrivateKeyReaded=function(){var e=this;return new t((function(t,n){e.CheckInitialize().then((function(){t(null!=e.m_pkContext)})).catch((function(t){return n(e.MapError(t))}))}))},e.prototype.ResetPrivateKey=function(){var e=this;return new t((function(t,n){e.CheckInitialize().then((function(){return e.ResetPrivateKeyInternal()})).then((function(){t()})).catch((function(t){return n(e.MapError(t))}))}))},e.prototype.ReadPrivateKey=function(e,n,r){var i=this,o=this.m_library;return new t((function(t,s){i.CheckInitialize().then((function(){i.BeginKMOperation()})).then((function(){var t=l.a.MapFromKeyMedia(e,o.CreateKeyMedia());return i.ReadPrivateKeyInternal(null,null,t,n,r)})).then((function(e){i.EndKMOperation(),t(e)})).catch((function(t){i.EndKMOperation(),s(i.MapError(t))}))}))},e.prototype.ReadPrivateKeyBinary=function(e,n,r,i){var o=this;return new t((function(t,s){o.CheckInitialize().then((function(){return o.ReadPrivateKeyInternal(e,n,null,r,i)})).then((function(e){t(e)})).catch((function(t){return s(o.MapError(t))}))}))},e.prototype.ReadPrivateKeySIM=function(e,n,i,o){var s=this,a=this.m_library;return new t((function(t,e){s.CheckInitialize().then((function(){throw a.MakeError(r.EU_ERROR_NOT_SUPPORTED,"")})).catch((function(t){return e(s.MapError(t))}))}))},e.prototype.ReadPrivateKeyKSP=function(e,n,i,o){var s=this,a=this.m_library;return new t((function(t,e){s.CheckInitialize().then((function(){throw a.MakeError(r.EU_ERROR_NOT_SUPPORTED,"")})).catch((function(t){return e(s.MapError(t))}))}))},e.prototype.GetOwnCertificates=function(){return this.CtxGetOwnCertificates(this.m_pkContext)},e.prototype.GetOwnEUserParams=function(){var e=this,n=e.m_library;return new t((function(t,i){e.CheckInitialize().then((function(){if(null==e.m_pkContext)throw n.MakeError(r.EU_ERROR_BAD_CERT,"");return n.CtxGetOwnEUserParams(e.m_pkContext)})).then((function(e){var n=l.a.MapToEndUserParams(e,new h.a);t(n)})).catch((function(t){return i(e.MapError(t))}))}))},e.prototype.ChangeOwnCertificatesStatus=function(e,n){var i=this,o=i.m_library;return new t((function(t,s){i.CheckInitialize().then((function(){if(null==i.m_pkContext)throw o.MakeError(r.EU_ERROR_BAD_CERT,"");return o.CtxChangeOwnCertificatesStatus(i.m_pkContext,e,n)})).then((function(){t()})).catch((function(t){return s(i.MapError(t))}))}))},e.prototype.MakeNewCertificate=function(e,n,r,i,o,s,a,u,c,f,p,_,h,E,y,S){void 0===S&&(S=!1);var C=this,d=C.m_library,m={key:null,certs:null};return new t((function(R,A){C.CheckInitialize().then((function(){return C.BeginKMOperation()})).then((function(){var t=null;return null!=e&&(t=l.a.MapFromKeyMedia(e,d.CreateKeyMedia())),S?null:C.ReadPrivateKeyInternal(n,r,t,null,E)})).then((function(t){return y&&!S?d.CtxGetOwnEUserParams(C.m_pkContext):null})).then((function(t){return y?d.CtxModifyOwnEUserParams(C.m_pkContext,y.phone,y.EMail):null})).then((function(){return S?null:C.ResetPrivateKeyInternal()})).then((function(){if(S)return new t((function(t,n){d.CtxMakeNewOwnCertificate(C.m_pkContext,i,o,s,a,u,c,f,p).then((function(){return C.ResetPrivateKeyInternal()})).then((function(){var t=l.a.MapFromKeyMedia(e,d.CreateKeyMedia());return _&&_.password!=e.password?d.ChangePrivateKeyPassword(t,_.password):null})).then((function(){t(null)})).catch((function(t){n(C.MapError(t))}))}));var E=null,y=null;return e&&(E=l.a.MapFromKeyMedia(e,d.CreateKeyMedia())),_&&(y=l.a.MapFromKeyMedia(_,d.CreateKeyMedia())),d.MakeNewCertificate(E,n,r,i,o,s,a,u,c,f,p,y,h)})).then((function(t){m.key=t;var n=null;return(S&&e||_)&&(n=l.a.MapFromKeyMedia(_||e,d.CreateKeyMedia())),C.SearchPrivateKeyCertificatesWithCMP(t,h,n,E)})).then((function(t){return C.GetUserCertificatesFromCertificates(t.certs)})).then((function(t){C.EndKMOperation(),m.certs=t,R(m)})).catch((function(t){C.EndKMOperation(),A(C.MapError(t))}))}))},e.prototype.MakeDeviceCertificate=function(e,n,i,o,s){var a=this,c=a.m_library;return new t((function(p,_){a.CheckInitialize().then((function(){if(null==a.m_pkContext)throw c.MakeError(r.EU_ERROR_BAD_CERT,"");var t=a.m_pkContext.GetOwnerInfo(),u=a.GetCASettings(t.GetIssuerCN());if(!u||!u.cmpAddress||""==u.cmpAddress)throw c.MakeError(r.EU_ERROR_BAD_PARAMETER,"");return c.CtxMakeDeviceCertificate(a.m_pkContext,e,n,i,o,s,u.cmpAddress,"80")})).then((function(e){return a.ProcessArray(e,(function(e){return new t((function(t,n){c.ParseCertificateEx(e).then((function(n){var r=new u.EndUserCertificate;r.data=e,r.infoEx=l.a.MapToEndUserCertificateInfoEx(n,new f.a),t(r)})).catch((function(t){return n(t)}))}))}))})).then((function(t){p(t)})).catch((function(t){a.EndKMOperation(),_(a.MapError(t))}))}))},e.prototype.ChangePrivateKeyPassword=function(e,n){var r=this,i=r.m_library;return new t((function(t,o){r.CheckInitialize().then((function(){return r.BeginKMOperation()})).then((function(){var t=l.a.MapFromKeyMedia(e,i.CreateKeyMedia());return r.m_library.ChangePrivateKeyPassword(t,n)})).then((function(){r.EndKMOperation(),t()})).catch((function(t){r.EndKMOperation(),o(r.MapError(t))}))}))},e.prototype.ChangePrivateKeyPasswordBinary=function(e,n,r){var i=this,o=i.m_library;return new t((function(t,s){i.CheckInitialize().then((function(){return o.ChangeSoftwarePrivateKeyPassword(e,n,r)})).then((function(e){t(e),t()})).catch((function(t){s(i.MapError(t))}))}))},e.prototype.GeneratePrivateKey=function(e,n,r,i,o,s,a,u,c,f,p,_){var h=this,E=h.m_library;return new t((function(t,y){h.CheckInitialize().then((function(){return h.BeginKMOperation()})).then((function(){var t=null;return e&&(t=l.a.MapFromKeyMedia(e,E.CreateKeyMedia())),h.GeneratePrivateKeyInternal(t,n,null,r,i,o,s,a,u,c,f,p,_)})).then((function(e){h.EndKMOperation(),t(e)})).catch((function(t){h.EndKMOperation(),y(h.MapError(t))}))}))},e.prototype.GeneratePrivateKeyBinary=function(e,n,r,i,o,s,a,u,c,l,f){var p=this;return new t((function(t,_){p.CheckInitialize().then((function(){return p.BeginKMOperation()})).then((function(){return p.GeneratePrivateKeyInternal(null,!1,e,n,r,i,o,s,a,u,c,l,f)})).then((function(e){p.EndKMOperation(),t(e)})).catch((function(t){p.EndKMOperation(),_(p.MapError(t))}))}))},e.prototype.GetKeyInfo=function(e){var n=this,r=n.m_library;return new t((function(t,i){n.CheckInitialize().then((function(){return n.BeginKMOperation()})).then((function(){var t=l.a.MapFromKeyMedia(e,r.CreateKeyMedia());return r.GetKeyInfo(t)})).then((function(e){n.EndKMOperation(),t(e.GetPrivateKeyInfo())})).catch((function(t){n.EndKMOperation(),i(n.MapError(t))}))}))},e.prototype.GetKeyInfoBinary=function(e,n){var r=this,i=r.m_library;return new t((function(t,o){r.CheckInitialize().then((function(){return i.GetKeyInfoBinary(e,n)})).then((function(e){t(e.GetPrivateKeyInfo())})).catch((function(t){o(r.MapError(t))}))}))},e.prototype.HashData=function(e,n,r){var i=this,o=this.m_library,s=i.DataToNamedDataArray(n);return new t((function(a,u){i.CheckInitialize().then((function(){return i.ProcessArray(s,(function(n){return new t((function(t,s){o.CtxHash(i.m_context,e,null,n.val).then((function(t){return r?t:o.BASE64Decode(t)})).then((function(e){t(e)})).catch((function(t){return s(t)}))}))}))})).then((function(t){var e=i.DataToResult(n,t);a(e)})).catch((function(t){u(i.MapError(t))}))}))},e.prototype.GetSigner=function(e,n,r){void 0===n&&(n=-1),void 0===r&&(r=!1);var i=this,o=this.m_library,s={context:null,signersInfo:null};return new t((function(a,c){i.CheckInitialize().then((function(){return o.CtxCreate()})).then((function(t){return s.context=t,o.CtxSetParameter(t,o.EU_RESOLVE_OIDS_CONTEXT_PARAMETER,r)})).then((function(){return-1==n?o.GetSignsCount(e):1})).then((function(r){var a=new Array;if(-1!=n)a.push(n);else for(var c=0;c<r;c++)a.push(c);return i.ProcessArray(a,(function(n){return new t((function(t,r){var a=new u.EndUserCertificate;o.CtxGetSignerInfo(s.context,n,e).then((function(e){l.a.MapToEndUserCertificate(e,a),t(a)})).catch((function(t){return r(i.MapError(t))}))}))}))})).then((function(t){return s.signersInfo=t,o.CtxFree(s.context)})).then((function(){s.context=null,a(-1!=n?s.signersInfo[0]:s.signersInfo)})).catch((function(t){s.context?o.CtxFree(s.context).then((function(){c(i.MapError(t))})).catch((function(){c(i.MapError(t))})):c(i.MapError(t))}))}))},e.prototype.SignData=function(t,e){return void 0===e&&(e=!1),this.SignDataEx(p.EndUserSignAlgo.DSTU4145WithGOST34311,t,!0,!0,e)},e.prototype.SignDataInternal=function(t,e,n){return void 0===n&&(n=!1),this.SignDataEx(p.EndUserSignAlgo.DSTU4145WithGOST34311,e,!1,t,n)},e.prototype.SignHash=function(t,e,n,r){return this.CtxSignHashInternal(this.m_pkContext,t,e,null,n,r)},e.prototype.SignDataEx=function(t,e,n,r,i){return this.CtxSignDataInternal(this.m_pkContext,t,e,null,n,r,i)},e.prototype.AppendSign=function(t,e,n,r,i){return this.CtxSignDataInternal(this.m_pkContext,t,e,n,null!=e,r,i)},e.prototype.AppendSignHash=function(t,e,n,r,i){return this.CtxSignHashInternal(this.m_pkContext,t,e,n,r,i)},e.prototype.VerifyHash=function(e,n,r){void 0===r&&(r=-1);var i=this,o=this.m_library;return new t((function(s,a){i.CheckInitialize().then((function(){return-1==r?o.GetSignsCount(n):1})).then((function(s){var a=new Array;if(-1!=r)a.push(r);else for(var u=0;u<s;u++)a.push(u);return i.ProcessArray(a,(function(r){return new t((function(t,s){var a=new S.a;o.VerifyHashOnTimeEx(e,r,n,null,!1,!1).then((function(t){return l.a.MapToEndUserSignInfo(t,a),o.GetSignTimeInfo(r,n)})).then((function(t){return a.timeInfo=l.a.MapToEndUserTimeInfo(t,new d.a),o.GetSignType(r,n)})).then((function(e){a.signLevel=e,t(a)})).catch((function(t){return s(i.MapError(t))}))}))}))})).then((function(t){s(-1!=r?t[0]:t)})).catch((function(t){return a(i.MapError(t))}))}))},e.prototype.VerifyData=function(e,n,r){void 0===r&&(r=-1);var i=this,o=this.m_library;return new t((function(s,a){i.CheckInitialize().then((function(){return-1==r?o.GetSignsCount(n):1})).then((function(s){var a=new Array;if(-1!=r)a.push(r);else for(var u=0;u<s;u++)a.push(u);return i.ProcessArray(a,(function(r){return new t((function(t,s){var a=new S.a;o.VerifyDataOnTimeEx(e,r,n,null,!1,!1).then((function(t){return l.a.MapToEndUserSignInfo(t,a),o.GetSignTimeInfo(r,n)})).then((function(t){return a.timeInfo=l.a.MapToEndUserTimeInfo(t,new d.a),o.GetSignType(r,n)})).then((function(e){a.signLevel=e,t(a)})).catch((function(t){return s(i.MapError(t))}))}))}))})).then((function(t){s(-1!=r?t[0]:t)})).catch((function(t){return a(i.MapError(t))}))}))},e.prototype.VerifyDataInternal=function(e,n){void 0===n&&(n=-1);var r=this,i=this.m_library;return new t((function(o,s){r.CheckInitialize().then((function(){return-1==n?i.GetSignsCount(e):1})).then((function(o){var s=new Array;if(-1!=n)s.push(n);else for(var a=0;a<o;a++)s.push(a);return r.ProcessArray(s,(function(n){return new t((function(t,o){var s=new S.a;i.VerifyDataInternalOnTimeEx(e,n,null,!1,!1).then((function(t){return l.a.MapToEndUserSignInfo(t,s),i.GetSignTimeInfo(n,e)})).then((function(t){return s.timeInfo=l.a.MapToEndUserTimeInfo(t,new d.a),i.GetSignType(n,e)})).then((function(e){s.signLevel=e,t(s)})).catch((function(t){return o(r.MapError(t))}))}))}))})).then((function(t){o(-1!=n?t[0]:t)})).catch((function(t){return s(r.MapError(t))}))}))},e.prototype.EnvelopData=function(e,n,i,o,s,a){void 0===a&&(a=!1);var u=this,c=this.m_library;return new t((function(t,l){u.CheckInitialize().then((function(){if(null==u.m_pkContext&&(!a||i))throw c.MakeError(r.EU_ERROR_BAD_CERT,"");var t=c.EU_RECIPIENT_APPEND_TYPE_BY_ISSUER_SERIAL;return a?i?c.CtxEnvelopWithDynamicKey(u.m_pkContext,e,t,i,o,n):c.EnvelopToRecipientsWithDynamicKey(e,i,o,n):c.CtxEnvelop(u.m_pkContext,e,t,i,o,n)})).then((function(t){return s?t:c.BASE64Decode(t)})).then((function(e){t(e)})).catch((function(t){return l(u.MapError(t))}))}))},e.prototype.DevelopData=function(e,n){var i=this,o=this.m_library;return new t((function(t,s){i.CheckInitialize().then((function(){if(null==i.m_pkContext)throw o.MakeError(r.EU_ERROR_BAD_CERT,"");return o.CtxDevelop(i.m_pkContext,e,n)})).then((function(e){var n=l.a.MapToEndUserSenderInfo(e,new C.a);t(n)})).catch((function(t){return s(i.MapError(t))}))}))},e.prototype.ProtectDataByPassword=function(e,n,r){var i=this,o=this.m_library;return new t((function(t,s){i.CheckInitialize().then((function(){return o.ProtectDataByPassword(e,n)})).then((function(t){return r?t:o.BASE64Decode(t)})).then((function(e){t(e)})).catch((function(t){return s(i.MapError(t))}))}))},e.prototype.UnprotectDataByPassword=function(e,n,r){var i=this,o=this.m_library;return new t((function(t,s){i.CheckInitialize().then((function(){return o.UnprotectDataByPassword(e,n)})).then((function(t){return r?o.BytesToString(t):t})).then((function(e){t(e)})).catch((function(t){return s(i.MapError(t))}))}))},e.prototype.CreateAuthData=function(e,n,i){var o=this,s=this.m_library;return new t((function(t,a){o.CheckInitialize().then((function(){if(null==o.m_pkContext)throw s.MakeError(r.EU_ERROR_BAD_CERT,"");return s.CtxCreateAuthData(o.m_pkContext,e,n)})).then((function(t){return i?t:s.BASE64Decode(t)})).then((function(e){t(e)})).catch((function(t){return a(o.MapError(t))}))}))},e.prototype.GetTSPByAccessInfo=function(e,n,r,i,o){var s=this,a=this.m_library;return new t((function(t,u){s.CheckInitialize().then((function(){return a.GetTSPByAccessInfo(e,n,r,i)})).then((function(t){return o?a.BASE64Encode(t):t})).then((function(e){t(e)})).catch((function(t){return u(s.MapError(t))}))}))},e.prototype.CheckTSP=function(e,n,r){var i=this,o=this.m_library;return new t((function(t,s){i.CheckInitialize().then((function(){return o.CheckTSP(e,n,r)})).then((function(){t()})).catch((function(t){return s(i.MapError(t))}))}))},e.prototype.CtxCreate=function(){var e=this,n=this.m_library,r={context:null};return new t((function(t,i){e.CheckInitialize().then((function(){return n.CtxCreate()})).then((function(t){return r.context=t,n.CtxSetParameter(t,n.EU_RESOLVE_OIDS_CONTEXT_PARAMETER,e.m_resolveOIDs)})).then((function(){t(r.context)})).catch((function(t){return i(e.MapError(t))}))}))},e.prototype.CtxFree=function(e){var n=this,r=this.m_library;return new t((function(t,i){n.CheckInitialize().then((function(){r.CtxFree(e)})).then((function(){t()})).catch((function(t){return i(n.MapError(t))}))}))},e.prototype.CtxSetParameter=function(e,n,r){var i=this,o=i.m_library;return new t((function(t,s){i.CheckInitialize().then((function(){return null==e&&(e=i.m_context),o.CtxSetParameter(e,n,r)})).then((function(){t()})).catch((function(t){i.EndKMOperation(),s(i.MapError(t))}))}))},e.prototype.CtxReadPrivateKey=function(e,n,r,i){var o=this,s=o.m_library;return new t((function(t,a){o.CheckInitialize().then((function(){return o.BeginKMOperation()})).then((function(){var t=l.a.MapFromKeyMedia(n,s.CreateKeyMedia());return o.CtxReadPrivateKeyInternal(e,null,null,t,r,i)})).then((function(e){o.EndKMOperation(),t(e)})).catch((function(t){o.EndKMOperation(),a(o.MapError(t))}))}))},e.prototype.CtxReadPrivateKeyBinary=function(e,n,r,i,o){var s=this;return new t((function(t,a){s.CheckInitialize().then((function(){return s.CtxReadPrivateKeyInternal(e,n,r,null,i,o)})).then((function(e){t(e)})).catch((function(t){return a(s.MapError(t))}))}))},e.prototype.CtxFreePrivateKey=function(e){var n=this,r=this.m_library;return new t((function(t,i){n.CheckInitialize().then((function(){return r.CtxFreePrivateKey(e)})).then((function(){t()})).catch((function(t){return i(n.MapError(t))}))}))},e.prototype.CtxGetOwnCertificates=function(e){var n=this,i=this.m_library;return new t((function(t,o){n.CheckInitialize().then((function(){if(null==e)throw i.MakeError(r.EU_ERROR_BAD_CERT,"");var s=new Array,a=function(r){i.CtxEnumOwnCertificates(e,r).then((function(e){if(e){var n=l.a.MapToEndUserCertificate(e,new u.EndUserCertificate);s.push(n),a(r+1)}else t(s)})).catch((function(t){return o(n.MapError(t))}))};a(0)})).catch((function(t){return o(n.MapError(t))}))}))},e.prototype.CtxSignHash=function(t,e,n,r,i){return this.CtxSignHashInternal(t,e,n,null,r,i)},e.prototype.CtxSignData=function(t,e,n,r,i,o){return this.CtxSignDataInternal(t,e,n,null,r,i,o)},e.prototype.CtxAppendSignHash=function(t,e,n,r,i,o){return this.CtxSignHashInternal(t,e,n,r,i,o)},e.prototype.CtxAppendSign=function(t,e,n,r,i,o){return this.CtxSignDataInternal(t,e,n,r,null!=n,i,o)},e.prototype.CtxEnvelopData=function(e,n,i,o,s,a,u){var c=this,l=this.m_library;return new t((function(t,f){c.CheckInitialize().then((function(){if(null==e&&(!u||o))throw l.MakeError(r.EU_ERROR_BAD_CERT,"");var t=l.EU_RECIPIENT_APPEND_TYPE_BY_ISSUER_SERIAL;return u?o?l.CtxEnvelopWithDynamicKey(e,n,t,o,s,i):l.EnvelopToRecipientsWithDynamicKey(n,o,s,i):l.CtxEnvelop(e,n,t,o,s,i)})).then((function(t){return a?t:l.BASE64Decode(t)})).then((function(e){t(e)})).catch((function(t){return f(c.MapError(t))}))}))},e.prototype.CtxDevelopData=function(e,n,i){var o=this,s=this.m_library;return new t((function(t,a){o.CheckInitialize().then((function(){if(null==e)throw s.MakeError(r.EU_ERROR_BAD_CERT,"");return s.CtxDevelop(e,n,i)})).then((function(e){var n=l.a.MapToEndUserSenderInfo(e,new C.a);t(n)})).catch((function(t){return a(o.MapError(t))}))}))},e.prototype.ProtectTaxReports=function(e,n,r,i,o,s,a){void 0===e&&(e=null),void 0===n&&(n=null),void 0===r&&(r=null),void 0===a&&(a=!1);var u=this;return new t((function(t,c){var l={accountant:null,director:null,stamp:null};u.CheckInitialize().then((function(){var t=[p.EndUserKeyUsage.DigitalSignature];return null!=e?u.LoadTaxReportPKey(e,t,!1):null})).then((function(t){l.accountant=t;var e=[p.EndUserKeyUsage.DigitalSignature];return r||e.push(p.EndUserKeyUsage.KeyAgreement),null!=n?u.LoadTaxReportPKey(n,e,!1):null})).then((function(t){l.director=t;var e=[p.EndUserKeyUsage.DigitalSignature,p.EndUserKeyUsage.KeyAgreement];return null!=r?u.LoadTaxReportPKey(r,e,!0):null})).then((function(t){return l.stamp=t,u.ProcessArray(s,(function(t){return u.ProtectTaxReport(l.accountant,l.director,l.stamp,i,o,t,a)}))})).then((function(e){t(e)})).catch((function(t){return c(u.MapError(t))}))}))},e.prototype.UnprotectTaxReceipts=function(e,n){var r=this;return new t((function(t,i){r.CheckInitialize().then((function(){return r.ProcessArray(n,(function(t){return r.UnprotectTaxReceipt(e,t)}))})).then((function(e){t(e)})).catch((function(t){return i(r.MapError(t))}))}))},e.prototype.ASiCGetSigner=function(e,n,r){void 0===n&&(n=-1),void 0===r&&(r=!1);var i=this,o=this.m_library,s={context:null,signersInfo:null};return new t((function(a,c){i.CheckInitialize().then((function(){return o.CtxCreate()})).then((function(t){return s.context=t,o.CtxSetParameter(t,o.EU_RESOLVE_OIDS_CONTEXT_PARAMETER,r)})).then((function(){return-1==n?o.ASiCGetSignsCount(e):1})).then((function(r){var a=new Array;if(-1!=n)a.push(n);else for(var c=0;c<r;c++)a.push(c);return i.ProcessArray(a,(function(n){return new t((function(t,r){var a=new u.EndUserCertificate;o.CtxASiCGetSignerInfo(s.context,n,e).then((function(e){l.a.MapToEndUserCertificate(e,a),t(a)})).catch((function(t){return r(i.MapError(t))}))}))}))})).then((function(t){return s.signersInfo=t,o.CtxFree(s.context)})).then((function(){a(-1!=n?s.signersInfo[0]:s.signersInfo)})).catch((function(t){s.context&&o.CtxFree(s.context).then((function(){c(i.MapError(t))})).catch((function(){c(i.MapError(t))}))}))}))},e.prototype.ASiCSignData=function(e,n,i,o,s,a){var u=this,c=this,l=this.m_library;return new t((function(t,f){c.CheckInitialize().then((function(){if(null==u.m_pkContext)throw l.MakeError(r.EU_ERROR_BAD_CERT,"");for(var t=[],a=0;a<s.length;a++){var c=l.CreateReference(s[a].name,s[a].val);t.push(c)}return l.CtxASiCSign(u.m_pkContext,e,n,i,o,t)})).then((function(t){return a?t:l.BASE64Decode(t)})).then((function(e){var r={name:s[0].name+(n==p.EndUserASiCType.S?".asics":".asice"),val:e};t(r)})).catch((function(t){return f(c.MapError(t))}))}))},e.prototype.ASiCAppendSign=function(e,n,i,o,s){var a=this,u=this,c=this.m_library,l=u.DataToNamedDataArray(o);return new t((function(t,o){u.CheckInitialize().then((function(){if(null==a.m_pkContext)throw c.MakeError(r.EU_ERROR_BAD_CERT,"");return c.CtxASiCAppendSign(a.m_pkContext,e,n,i,l[0].val)})).then((function(t){return s?t:c.BASE64Decode(t)})).then((function(e){var n={name:l[0].name,val:e};t(n)})).catch((function(t){return o(u.MapError(t))}))}))},e.prototype.ASiCVerifyData=function(e,n){var r=this,i=this.m_library;return new t((function(o,s){r.CheckInitialize().then((function(){return-1==n?i.ASiCGetSignsCount(e):1})).then((function(o){var s=new Array;if(-1!=n)s.push(n);else for(var a=0;a<o;a++)s.push(a);return r.ProcessArray(s,(function(n){return new t((function(t,o){var s=new S.a;i.ASiCVerify(n,e).then((function(t){return l.a.MapToEndUserSignInfo(t,s),i.ASiCGetSignTimeInfo(n,e)})).then((function(t){return s.timeInfo=l.a.MapToEndUserTimeInfo(t,new d.a),i.ASiCGetSignLevel(n,e)})).then((function(e){s.signLevel=e,t(s)})).catch((function(t){return o(r.MapError(t))}))}))}))})).then((function(t){o(-1!=n?t[0]:t)})).catch((function(t){return s(r.MapError(t))}))}))},e.prototype.PDFGetSigner=function(e,n,r){void 0===n&&(n=-1),void 0===r&&(r=!1);var i=this,o=this.m_library,s={context:null,signersInfo:null};return new t((function(a,c){i.CheckInitialize().then((function(){return o.CtxCreate()})).then((function(t){return s.context=t,o.CtxSetParameter(t,o.EU_RESOLVE_OIDS_CONTEXT_PARAMETER,r)})).then((function(){return-1==n?o.PDFGetSignsCount(e):1})).then((function(r){var a=new Array;if(-1!=n)a.push(n);else for(var c=0;c<r;c++)a.push(c);return i.ProcessArray(a,(function(n){return new t((function(t,r){var a=new u.EndUserCertificate;o.CtxPDFGetSignerInfo(s.context,n,e).then((function(e){l.a.MapToEndUserCertificate(e,a),t(a)})).catch((function(t){return r(i.MapError(t))}))}))}))})).then((function(t){return s.signersInfo=t,o.CtxFree(s.context)})).then((function(){a(-1!=n?s.signersInfo[0]:s.signersInfo)})).catch((function(t){s.context&&o.CtxFree(s.context).then((function(){c(i.MapError(t))})).catch((function(){c(i.MapError(t))}))}))}))},e.prototype.PDFSignData=function(e,n,i,o){var s=this,a=this,u=this.m_library,c=a.DataToNamedDataArray(n);return new t((function(l,f){a.CheckInitialize().then((function(){if(null==s.m_pkContext)throw u.MakeError(r.EU_ERROR_BAD_CERT,"");return a.ProcessArray(c,(function(n){return new t((function(t,r){return u.CtxPDFSign(s.m_pkContext,e,n.val,i).then((function(t){return o?t:u.BASE64Decode(t)})).then((function(e){t(e)})).catch((function(t){return r(t)}))}))}))})).then((function(t){var e=s.DataToResult(n,t);l(e)})).catch((function(t){return f(a.MapError(t))}))}))},e.prototype.PDFVerifyData=function(e,n){var r=this,i=this.m_library;return new t((function(o,s){r.CheckInitialize().then((function(){return-1==n?i.PDFGetSignsCount(e):1})).then((function(o){var s=new Array;if(-1!=n)s.push(n);else for(var a=0;a<o;a++)s.push(a);return r.ProcessArray(s,(function(n){return new t((function(t,o){var s=new S.a;i.PDFVerify(n,e).then((function(t){return l.a.MapToEndUserSignInfo(t,s),i.PDFGetSignTimeInfo(n,e)})).then((function(t){return s.timeInfo=l.a.MapToEndUserTimeInfo(t,new d.a),i.PDFGetSignType(n,e)})).then((function(e){s.signLevel=e,t(s)})).catch((function(t){return o(r.MapError(t))}))}))}))})).then((function(t){o(-1!=n?t[0]:t)})).catch((function(t){return s(r.MapError(t))}))}))},e.prototype.XAdESGetSigner=function(e,n,r){void 0===n&&(n=-1),void 0===r&&(r=!1);var i=this,o=this.m_library,s={context:null,signersInfo:null};return new t((function(a,c){i.CheckInitialize().then((function(){return o.CtxCreate()})).then((function(t){return s.context=t,o.CtxSetParameter(t,o.EU_RESOLVE_OIDS_CONTEXT_PARAMETER,r)})).then((function(){return-1==n?o.XAdESGetSignsCount(e):1})).then((function(r){var a=new Array;if(-1!=n)a.push(n);else for(var c=0;c<r;c++)a.push(c);return i.ProcessArray(a,(function(n){return new t((function(t,r){var a=new u.EndUserCertificate;o.CtxXAdESGetSignerInfo(s.context,n,e).then((function(e){l.a.MapToEndUserCertificate(e,a),t(a)})).catch((function(t){return r(i.MapError(t))}))}))}))})).then((function(t){return s.signersInfo=t,o.CtxFree(s.context)})).then((function(){a(-1!=n?s.signersInfo[0]:s.signersInfo)})).catch((function(t){s.context&&o.CtxFree(s.context).then((function(){c(i.MapError(t))})).catch((function(){c(i.MapError(t))}))}))}))},e.prototype.XAdESSignData=function(e,n,i,o,s){var a=this,u=this,c=this.m_library;return new t((function(t,l){u.CheckInitialize().then((function(){if(null==a.m_pkContext)throw c.MakeError(r.EU_ERROR_BAD_CERT,"");for(var t=[],s=0;s<o.length;s++){var u=c.CreateReference(o[s].name,o[s].val);t.push(u)}return c.CtxXAdESSign(a.m_pkContext,e,n,i,t)})).then((function(t){return s?t:c.BASE64Decode(t)})).then((function(e){var n={name:o[0].name+(o[0].name.endsWith(".xml")?"":".xml"),val:e};t(n)})).catch((function(t){return l(u.MapError(t))}))}))},e.prototype.XAdESVerifyData=function(e,n,r){var i=this,o=this.m_library;return new t((function(s,a){i.CheckInitialize().then((function(){return-1==r?o.XAdESGetSignsCount(n):1})).then((function(s){var a=new Array;if(-1!=r)a.push(r);else for(var u=0;u<s;u++)a.push(u);var c=null;if(null!=e){c=[];for(u=0;u<e.length;u++){var f=o.CreateReference(e[u].name,e[u].val);c.push(f)}}return i.ProcessArray(a,(function(e){return new t((function(t,r){var s=new S.a;o.XAdESVerify(c,e,n).then((function(t){return l.a.MapToEndUserSignInfo(t,s),o.XAdESGetSignTimeInfo(e,n)})).then((function(t){return s.timeInfo=l.a.MapToEndUserTimeInfo(t,new d.a),o.XAdESGetSignLevel(e,n)})).then((function(e){s.signLevel=e,t(s)})).catch((function(t){return r(i.MapError(t))}))}))}))})).then((function(t){s(-1!=r?t[0]:t)})).catch((function(t){return a(i.MapError(t))}))}))},e.prototype.GetSignContainerInfo=function(e){var n=this,r=this.m_library,i=(new y.a,function(e){var n=new y.a;return new t((function(t,i){r.IsDataInSignedDataAvailable(e).then((function(e){n.type=p.EndUserSignContainerType.CAdES,n.subType=e?p.EndUserCAdESType.Enveloped:p.EndUserCAdESType.Detached,t(n)})).catch((function(e){t(null)}))}))}),o=function(e){var n=new y.a;return new t((function(t,i){r.XAdESGetType(e).then((function(e){n.type=p.EndUserSignContainerType.XAdES,n.subType=e,t(n)})).catch((function(e){t(null)}))}))},s=function(e){var n=new y.a;return new t((function(t,i){r.PDFGetSignsCount(e).then((function(e){n.type=p.EndUserSignContainerType.PAdES,t(n)})).catch((function(e){t(null)}))}))},a=function(e){var n=new y.a;return new t((function(t,i){r.ASiCGetASiCType(e).then((function(t){return n.type=p.EndUserSignContainerType.ASiC,n.subType=t,r.ASiCGetSignType(e)})).then((function(e){n.asicSignType=e,t(n)})).catch((function(e){t(null)}))}))};return new t((function(u,c){n.CheckInitialize().then((function(){return"string"==typeof e?r.BASE64Decode(e):e})).then((function(e){var n=[],r=function(t,e){if(t.length<e.length)return!1;for(var n=0;n<e.length;n++)if(t[n]!=e[n])return!1;return!0};return n=r(e,[60,63,120,109,108])?[o,i,s,a]:r(e,[37,80,68,70])?[s,i,o,a]:r(e,[80,75])?[a,i,o,s]:[i,o,s,a],new t((function(t,r){var i=function(o){o>=n.length?t(new y.a):n[o](e).then((function(e){null!=e?t(e):i(o+1)})).catch((function(t){return r(t)}))};i(0)}))})).then((function(t){u(t)})).catch((function(t){return c(n.MapError(t))}))}))},e}();e.a=R}).call(this,n(17).Promise)},function(t,e,n){"use strict";(function(t){var r=n(3),i=function(){function e(){this.EU_SUBJECT_TYPE_UNDIFFERENCED=0,this.EU_SUBJECT_TYPE_CA=1,this.EU_SUBJECT_TYPE_CA_SERVER=2,this.EU_SUBJECT_TYPE_RA_ADMINISTRATOR=3,this.EU_SUBJECT_TYPE_END_USER=4,this.EU_SUBJECT_CA_SERVER_SUB_TYPE_UNDIFFERENCED=0,this.EU_SUBJECT_CA_SERVER_SUB_TYPE_CMP=1,this.EU_SUBJECT_CA_SERVER_SUB_TYPE_TSP=2,this.EU_SUBJECT_CA_SERVER_SUB_TYPE_OCSP=3,this.EU_CERT_KEY_TYPE_UNKNOWN=0,this.EU_CERT_KEY_TYPE_DSTU4145=1,this.EU_CERT_KEY_TYPE_RSA=2,this.EU_CERT_KEY_TYPE_ECDSA=4,this.EU_KEY_USAGE_UNKNOWN=0,this.EU_KEY_USAGE_DIGITAL_SIGNATURE=1,this.EU_KEY_USAGE_KEY_AGREEMENT=16,this.EU_KEYS_REQUEST_TYPE_UA_DS=1,this.EU_KEYS_REQUEST_TYPE_UA_KEP=2,this.EU_KEYS_REQUEST_TYPE_INTERNATIONAL=3,this.EU_KEYS_TYPE_NONE=0,this.EU_KEYS_TYPE_DSTU_AND_ECDH_WITH_GOSTS=1,this.EU_KEYS_TYPE_RSA_WITH_SHA=2,this.EU_KEYS_LENGTH_DS_UA_191=1,this.EU_KEYS_LENGTH_DS_UA_257=2,this.EU_KEYS_LENGTH_DS_UA_307=3,this.EU_KEYS_LENGTH_DS_UA_FILE=4,this.EU_KEYS_LENGTH_DS_UA_CERT=5,this.EU_KEYS_LENGTH_KEP_UA_257=1,this.EU_KEYS_LENGTH_KEP_UA_431=2,this.EU_KEYS_LENGTH_KEP_UA_571=3,this.EU_KEYS_LENGTH_KEP_UA_FILE=4,this.EU_KEYS_LENGTH_KEP_UA_CERT=5,this.EU_KEYS_LENGTH_DS_RSA_1024=1,this.EU_KEYS_LENGTH_DS_RSA_2048=2,this.EU_KEYS_LENGTH_DS_RSA_3072=3,this.EU_KEYS_LENGTH_DS_RSA_4096=4,this.EU_KEYS_LENGTH_DS_RSA_FILE=5,this.EU_KEYS_LENGTH_DS_RSA_CERT=6,this.EU_RECIPIENT_APPEND_ISSUER_AND_SERIAL=1,this.EU_RECIPIENT_APPEND_KEY_ID=2,this.EU_RECIPIENT_APPEND_KEY_ID_USC_COMPAT=3,this.EU_SAVE_SETTINGS_PARAMETER="SaveSettings",this.EU_RESOLVE_OIDS_PARAMETER="ResolveOIDs",this.EU_MAKE_PKEY_PFX_CONTAINER_PARAMETER="MakePKeyPFXContainer",this.EU_SIGN_INCLUDE_CONTENT_TIME_STAMP_PARAMETER="SignIncludeContentTimeStamp",this.EU_SIGN_TYPE_PARAMETER="SignType",this.EU_SIGN_INCLUDE_CA_CERTIFICATES_PARAMETER="SignIncludeCACertificates",this.EU_FS_CALCULATE_FINGERPRINT="FSCalculateFingerprint",this.EU_SETTINGS_ID_NONE=0,this.EU_SETTINGS_ID_MANDATORY=31,this.EU_SETTINGS_ID_ALL=1023,this.EU_SETTINGS_ID_FSTORE=1,this.EU_SETTINGS_ID_PROXY=2,this.EU_SETTINGS_ID_TSP=4,this.EU_SETTINGS_ID_OCSP=8,this.EU_SETTINGS_ID_LDAP=16,this.EU_SETTINGS_ID_MODE=32,this.EU_SETTINGS_ID_CMP=64,this.EU_SETTINGS_ID_KM=128,this.EU_SETTINGS_ID_OCSP_ACCESS_INFO_MODE=256,this.EU_SETTINGS_ID_OCSP_ACCESS_INFO=512,this.EU_HEADER_CA_TYPE="UA1",this.EU_HEADER_PART_TYPE_SIGNED=1,this.EU_HEADER_PART_TYPE_ENCRYPTED=2,this.EU_HEADER_PART_TYPE_STAMPED=3,this.EU_HEADER_PART_TYPE_CERTCRYPT=4,this.EU_HEADER_MAX_CA_TYPE_SIZE=3,this.EU_SIGNED_CRYPTO_HEADER=this.EU_HEADER_PART_TYPE_SIGNED,this.EU_ENCRYPTED_CRYPTO_HEADER=this.EU_HEADER_PART_TYPE_ENCRYPTED,this.EU_TIMESTAMPED_CRYPTO_HEADER=this.EU_HEADER_PART_TYPE_STAMPED,this.EU_CERTCRYPT_CRYPTO_HEADER=this.EU_HEADER_PART_TYPE_CERTCRYPT,this.EU_DEFAULT_LANG=0,this.EU_UA_LANG=1,this.EU_RU_LANG=2,this.EU_EN_LANG=3,this.EU_CONTENT_ENC_ALGO_TDES_CBC=4,this.EU_CONTENT_ENC_ALGO_AES_128_CBC=5,this.EU_CONTENT_ENC_ALGO_AES_192_CBC=6,this.EU_CONTENT_ENC_ALGO_AES_256_CBC=7,this.EU_DEV_CTX_MIN_PUBLIC_DATA_ID=16,this.EU_DEV_CTX_MAX_PRIVATE_DATA_ID=175,this.EU_UA_OID_EXT_KEY_USAGE_STAMP="1.2.804.2.1.1.1.3.9",this.EU_CCS_TYPE_REVOKE=1,this.EU_CCS_TYPE_HOLD=2,this.EU_REVOCATION_REASON_UNKNOWN=0,this.EU_REVOCATION_REASON_KEY_COMPROMISE=1,this.EU_REVOCATION_REASON_NEW_ISSURED=2,this.EU_SIGN_TYPE_UNKNOWN=0,this.EU_SIGN_TYPE_CADES_BES=1,this.EU_SIGN_TYPE_CADES_T=4,this.EU_SIGN_TYPE_CADES_C=8,this.EU_SIGN_TYPE_CADES_X_LONG=16,this.EU_CHECK_PRIVATE_KEY_CONTEXT_PARAMETER="CheckPrivateKey",this.EU_RESOLVE_OIDS_CONTEXT_PARAMETER="ResolveOIDs",this.EU_EXPORATABLE_CONTEXT_CONTEXT_PARAMETER="ExportableContext",this.EU_RECIPIENT_APPEND_TYPE_BY_ISSUER_SERIAL=1,this.EU_RECIPIENT_APPEND_TYPE_BY_KEY_ID=2,this.EU_CTX_HASH_ALGO_UNKNOWN=0,this.EU_CTX_HASH_ALGO_GOST34311=1,this.EU_CTX_HASH_ALGO_SHA160=2,this.EU_CTX_HASH_ALGO_SHA224=3,this.EU_CTX_HASH_ALGO_SHA256=4,this.EU_CTX_SIGN_UNKNOWN=0,this.EU_CTX_SIGN_DSTU4145_WITH_GOST34311=1,this.EU_CTX_SIGN_RSA_WITH_SHA=2,this.EU_FILE_PROCESS_CHUNK_SIZE=1048576,this.EU_ASIC_TYPE_UNKNOWN=0,this.EU_ASIC_TYPE_S=1,this.EU_ASIC_TYPE_E=2,this.EU_ASIC_SIGN_TYPE_UNKNOWN=0,this.EU_ASIC_SIGN_TYPE_CADES=1,this.EU_ASIC_SIGN_TYPE_XADES=2,this.EU_ASIC_SIGN_LEVEL_BES=1,this.EnvelopToRecipientsEx=function(e,n,r,i){var o=this.m_library;return new t((function(t,s){o.EnvelopToRecipientsEx(e,n,r,i,t,s)}))},this.EnvelopToRecipientsWithDynamicKey=function(e,n,r,i){var o=this.m_library;return new t((function(t,s){o.EnvelopToRecipientsWithDynamicKey(e,n,r,i,t,s)}))},this.EnvelopToRecipientsWithSettings=function(e,n,r,i,o,s,a){var u=this.m_library;return new t((function(t,c){u.EnvelopToRecipientsWithSettings(e,n,r,i,o,s,a,t,c)}))},this.CtxEnvelop=function(e,n,r,i,o,s){var a=this.m_library;return new t((function(t,u){a.CtxEnvelop(e,n,r,i,o,s,t,u)}))},this.CtxEnvelopWithDynamicKey=function(e,n,r,i,o,s){var a=this.m_library;return new t((function(t,u){a.CtxEnvelopWithDynamicKey(e,n,r,i,o,s,t,u)}))},this.DevelopEx=function(e,n){void 0===n&&(n=null);var r=this.m_library;return new t((function(t,i){r.DevelopEx(e,n,t,i)}))},this.CtxDevelop=function(e,n,r){void 0===r&&(r=null);var i=this.m_library;return new t((function(t,o){i.CtxDevelop(e,n,r,t,o)}))},this.CtxCreateAuthData=function(e,n,r){var i=this.m_library;return new t((function(t,o){i.CtxCreateAuthData(e,n,r,t,o)}))},this.ProtectDataByPassword=function(e,n){var r=this.m_library;return new t((function(t,i){r.ProtectDataByPassword(e,n,t,i)}))},this.UnprotectDataByPassword=function(e,n){var r=this.m_library;return new t((function(t,i){r.UnprotectDataByPassword(e,n,t,i)}))},this.AppendTransportHeader=function(e,n,r,i,o){var s=this.m_library;return new t((function(t,a){s.AppendTransportHeader(e,n,r,i,o,t,a)}))},this.ParseTransportHeader=function(e){var n=this.m_library;return new t((function(t,r){n.ParseTransportHeader(e,t,r)}))},this.AppendCryptoHeader=function(e,n,r){var i=this.m_library;return new t((function(t,o){i.AppendCryptoHeader(e,n,r,t,o)}))},this.ParseCryptoHeader=function(e){var n=this.m_library;return new t((function(t,r){n.ParseCryptoHeader(e,t,r)}))},this.CtxCreate=function(){var e=this.m_library;return new t((function(t,n){e.CtxCreate(t,n)}))},this.CtxFree=function(e){var n=this.m_library;return new t((function(t,r){n.CtxFree(e,t,r)}))},this.CtxSetParameter=function(e,n,r){var i=this.m_library;return new t((function(t,o){i.CtxSetParameter(e,n,r,t,o)}))},this.ASiCGetASiCType=function(e){var n=this.m_library;return new t((function(t,r){n.ASiCGetASiCType(e,t,r)}))},this.ASiCGetSignType=function(e){var n=this.m_library;return new t((function(t,r){n.ASiCGetSignType(e,t,r)}))},this.ASiCGetSignsCount=function(e){var n=this.m_library;return new t((function(t,r){n.ASiCGetSignsCount(e,t,r)}))},this.ASiCGetSignerInfo=function(e,n){var r=this.m_library;return new t((function(t,i){r.ASiCGetSignerInfo(e,n,t,i)}))},this.ASiCGetSignTimeInfo=function(e,n){var r=this.m_library;return new t((function(t,i){r.ASiCGetSignTimeInfo(e,n,t,i)}))},this.CtxASiCSign=function(e,n,r,i,o,s){var a=this.m_library;return new t((function(t,u){a.CtxASiCSign(e,n,r,i,o,s,t,u)}))},this.CtxASiCAppendSign=function(e,n,r,i,o){var s=this.m_library;return new t((function(t,a){s.CtxASiCAppendSign(e,n,r,i,o,t,a)}))},this.ASiCVerify=function(e,n){var r=this.m_library;return new t((function(t,i){r.ASiCVerify(e,n,t,i)}))},this.CtxASiCGetSignerInfo=function(e,n,r){var i=this.m_library;return new t((function(t,o){i.CtxASiCGetSignerInfo(e,n,r,t,o)}))},this.ASiCGetSignLevel=function(e,n){var r=this.m_library;return new t((function(t,i){r.ASiCGetSignLevel(e,n,t,i)}))},this.PDFGetSignType=function(e,n){var r=this.m_library;return new t((function(t,i){r.PDFGetSignType(e,n,t,i)}))},this.PDFGetSignsCount=function(e){var n=this.m_library;return new t((function(t,r){n.PDFGetSignsCount(e,t,r)}))},this.PDFGetSignerInfo=function(e,n){var r=this.m_library;return new t((function(t,i){r.PDFGetSignerInfo(e,n,t,i)}))},this.PDFGetSignTimeInfo=function(e,n){var r=this.m_library;return new t((function(t,i){r.PDFGetSignTimeInfo(e,n,t,i)}))},this.CtxPDFSign=function(e,n,r,i){var o=this.m_library;return new t((function(t,s){o.CtxPDFSign(e,n,r,i,t,s)}))},this.PDFVerify=function(e,n){var r=this.m_library;return new t((function(t,i){r.PDFVerify(e,n,t,i)}))},this.CtxPDFGetSignerInfo=function(e,n,r){var i=this.m_library;return new t((function(t,o){i.CtxPDFGetSignerInfo(e,n,r,t,o)}))},this.XAdESGetType=function(e){var n=this.m_library;return new t((function(t,r){n.XAdESGetType(e,t,r)}))},this.XAdESGetSignsCount=function(e){var n=this.m_library;return new t((function(t,r){n.XAdESGetSignsCount(e,t,r)}))},this.XAdESGetSignLevel=function(e,n){var r=this.m_library;return new t((function(t,i){r.XAdESGetSignLevel(e,n,t,i)}))},this.XAdESGetSignerInfo=function(e,n){var r=this.m_library;return new t((function(t,i){r.XAdESGetSignerInfo(e,n,t,i)}))},this.XAdESGetSignTimeInfo=function(e,n){var r=this.m_library;return new t((function(t,i){r.XAdESGetSignTimeInfo(e,n,t,i)}))},this.CtxXAdESSign=function(e,n,r,i,o){var s=this.m_library;return new t((function(t,a){s.CtxXAdESSign(e,n,r,i,o,t,a)}))},this.XAdESVerify=function(e,n,r){var i=this.m_library;return new t((function(t,o){i.XAdESVerify(e,n,r,t,o)}))},this.CtxXAdESGetSignerInfo=function(e,n,r){var i=this.m_library;return new t((function(t,o){i.CtxXAdESGetSignerInfo(e,n,r,t,o)}))},this.m_language=0,this.m_library=null}return e.prototype.MakeURL=function(t){var e=location.origin,n=location.pathname;return 0==t.indexOf("http://")||0==t.indexOf("https://")?t:0==t.indexOf("/")&&e?e+t:e&&n?e+n.substr(0,n.lastIndexOf("/"))+"/"+t:t},e.prototype.MakeError=function(t,e){return this.m_library.MakeError(t,e)},e.prototype.IsLibraryLoadError=function(t){return t==r.EndUserError.ERROR_LIBRARY_COMUNICATION_FAILED},e.prototype.IsLibraryVersionNotSupportedError=function(t){return t==r.EndUserError.ERROR_LIBRARY_VERSION_NOT_SUPPORTED},e.prototype.Load=function(){var e=this;return new t((function(t,n){if(null==e.m_library){var i=new r.EndUserLibraryLoader(r.EndUserLibraryLoader.LIBRARY_TYPE_DEFAULT,"euSign",e.m_language,!0,!0);i.onload=function(n){e.m_library=n,t()},i.onerror=function(t,e,i){null==i&&(i=new r.EUSignCP("","")),n(i.MakeError(e,""))},i.load()}else t()}))},e.prototype.IsSupported=function(){return r.EndUserLibraryLoader.isWebExtensionSupported()||r.EndUserLibraryLoader.isSignAgentSupported()||r.EndUserLibraryLoader.isNPAPISupported()||r.EndUserLibraryLoader.isActiveXSupported()},e.prototype.IsSignAgentSupported=function(){return r.EndUserLibraryLoader.isSignAgentSupported()},e.prototype.IsWebExtensionSupported=function(){return r.EndUserLibraryLoader.isWebExtensionSupported()},e.prototype.IsNPAPISupported=function(){return r.EndUserLibraryLoader.isNPAPISupported()},e.prototype.IsActiveXSupported=function(){return r.EndUserLibraryLoader.isActiveXSupported()},e.prototype.IsWebExtensionInstalled=function(){return r.EndUserLibraryLoader.isWebExtensionInstalled()},e.prototype.GetInstallURL=function(t,e){return void 0===t&&(t=!1),new r.EUSignCP("","").GetInstallURL(t,e)},e.prototype.GetUpdateURL=function(t,e){return void 0===t&&(t=!1),new r.EUSignCP("","").GetUpdateURL(t,e)},e.prototype.GetHelpURL=function(t){return new r.EUSignCP("","").GetHelpURL(t)},e.prototype.GetWebExtensionInstallURL=function(){return new r.EUSignCP("","").GetWebExtensionInstallURL()},e.prototype.GetVersion=function(){var e=this.m_library;return new t((function(t,n){e.GetVersion(t,n)}))},e.prototype.IsInitialized=function(){var e=this.m_library;return new t((function(t,n){e.IsInitialized(t,n)}))},e.prototype.Initialize=function(){var e=this.m_library;return new t((function(t,n){e.Initialize(t,n)}))},e.prototype.Finalize=function(){var e=this.m_library;return new t((function(t,n){e.Finalize(t,n)}))},e.prototype.ResetOperation=function(){var e=this.m_library;return new t((function(t,n){e.ResetOperation(t,n)}))},e.prototype.SetUIMode=function(e){var n=this.m_library;return new t((function(t,r){n.SetUIMode(e,t,r)}))},e.prototype.SetLanguage=function(e){var n=this.m_library;if("string"==typeof e)switch(e=e.toLocaleLowerCase()){case"en":e=this.EU_EN_LANG;break;case"ru":e=this.EU_RU_LANG;break;case"uk":case"ua":default:e=this.EU_UA_LANG}return this.m_language=e,new t((function(t,r){n.SetLanguage(e,t,r)}))},e.prototype.SetCharset=function(e){var n=this.m_library;return new t((function(t,r){n.SetCharset(e,t,r)}))},e.prototype.SetRuntimeParameter=function(e,n){var r=this.m_library;return new t((function(t,i){r.SetRuntimeParameter(e,n,t,i)}))},e.prototype.GetStorageParameter=function(e,n){var r=this.m_library;return new t((function(t,i){r.GetStorageParameter(e,n,t,i)}))},e.prototype.SetStorageParameter=function(e,n,r){var i=this.m_library;return new t((function(t,o){i.SetStorageParameter(e,n,r,t,o)}))},e.prototype.BASE64Encode=function(e){var n=this.m_library;return new t((function(t,r){n.BASE64Encode(e,t,r)}))},e.prototype.BASE64Decode=function(e){var n=this.m_library;return new t((function(t,r){n.BASE64Decode(e,t,r)}))},e.prototype.StringToBytes=function(e){var n=this.m_library;return new t((function(t,r){n.StringToBytes(e,t,r)}))},e.prototype.BytesToString=function(e){var n=this.m_library;return new t((function(t,r){n.BytesToString(e,t,r)}))},e.prototype.DoesNeedSetSettings=function(){var e=this.m_library;return new t((function(t,n){e.DoesNeedSetSettings(t,n)}))},e.prototype.InitializeMandatorySettings=function(){var e=this.m_library;return new t((function(t,n){e.InitializeMandatorySettings(t,n)}))},e.prototype.CreateModeSettings=function(){return this.m_library.CreateModeSettings()},e.prototype.GetModeSettings=function(){var e=this.m_library;return new t((function(t,n){e.GetModeSettings(t,n)}))},e.prototype.SetModeSettings=function(e){var n=this.m_library;return new t((function(t,r){n.SetModeSettings(e,t,r)}))},e.prototype.CreateKeyMediaSettings=function(){return this.m_library.CreateKeyMediaSettings()},e.prototype.GetKeyMediaSettings=function(){var e=this.m_library;return new t((function(t,n){e.GetKeyMediaSettings(t,n)}))},e.prototype.SetKeyMediaSettings=function(e){var n=this.m_library;return new t((function(t,r){n.SetKeyMediaSettings(e,t,r)}))},e.prototype.CreateFileStoreSettings=function(){return this.m_library.CreateFileStoreSettings()},e.prototype.GetFileStoreSettings=function(){var e=this.m_library;return new t((function(t,n){e.GetFileStoreSettings(t,n)}))},e.prototype.SetFileStoreSettings=function(e){var n=this.m_library;return new t((function(t,r){n.SetFileStoreSettings(e,t,r)}))},e.prototype.CreateProxySettings=function(){return this.m_library.CreateProxySettings()},e.prototype.GetProxySettings=function(){var e=this.m_library;return new t((function(t,n){e.GetProxySettings(t,n)}))},e.prototype.SetProxySettings=function(e){var n=this.m_library;return new t((function(t,r){n.SetProxySettings(e,t,r)}))},e.prototype.CreateOCSPSettings=function(){return this.m_library.CreateOCSPSettings()},e.prototype.GetOCSPSettings=function(){var e=this.m_library;return new t((function(t,n){e.GetOCSPSettings(t,n)}))},e.prototype.SetOCSPSettings=function(e){var n=this.m_library;return new t((function(t,r){n.SetOCSPSettings(e,t,r)}))},e.prototype.CreateOCSPAccessInfoModeSettings=function(){return this.m_library.CreateOCSPAccessInfoModeSettings()},e.prototype.GetOCSPAccessInfoModeSettings=function(){var e=this.m_library;return new t((function(t,n){e.GetOCSPAccessInfoModeSettings(t,n)}))},e.prototype.SetOCSPAccessInfoModeSettings=function(e){var n=this.m_library;return new t((function(t,r){n.SetOCSPAccessInfoModeSettings(e,t,r)}))},e.prototype.CreateOCSPAccessInfoSettings=function(){return this.m_library.CreateOCSPAccessInfoSettings()},e.prototype.EnumOCSPAccessInfoSettings=function(e){var n=this.m_library;return new t((function(t,r){n.EnumOCSPAccessInfoSettings(e,t,r)}))},e.prototype.GetOCSPAccessInfoSettings=function(){var e=this.m_library;return new t((function(t,n){e.GetOCSPAccessInfoSettings(t,n)}))},e.prototype.SetOCSPAccessInfoSettings=function(e){var n=this.m_library;return new t((function(t,r){n.SetOCSPAccessInfoSettings(e,t,r)}))},e.prototype.DeleteOCSPAccessInfoSettings=function(e){var n=this.m_library;return new t((function(t,r){n.DeleteOCSPAccessInfoSettings(e,t,r)}))},e.prototype.CreateTSPSettings=function(){return this.m_library.CreateTSPSettings()},e.prototype.GetTSPSettings=function(){var e=this.m_library;return new t((function(t,n){e.GetTSPSettings(t,n)}))},e.prototype.SetTSPSettings=function(e){var n=this.m_library;return new t((function(t,r){n.SetTSPSettings(e,t,r)}))},e.prototype.CreateLDAPSettings=function(){return this.m_library.CreateLDAPSettings()},e.prototype.GetLDAPSettings=function(){var e=this.m_library;return new t((function(t,n){e.GetLDAPSettings(t,n)}))},e.prototype.SetLDAPSettings=function(e){var n=this.m_library;return new t((function(t,r){n.SetLDAPSettings(e,t,r)}))},e.prototype.CreateCMPSettings=function(){return this.m_library.CreateCMPSettings()},e.prototype.GetCMPSettings=function(){var e=this.m_library;return new t((function(t,n){e.GetCMPSettings(t,n)}))},e.prototype.SetCMPSettings=function(e){var n=this.m_library;return new t((function(t,r){n.SetCMPSettings(e,t,r)}))},e.prototype.GetSystemProxySettings=function(){var e=this.m_library;return new t((function(t,n){e.GetSystemProxySettings(t,n)}))},e.prototype.GetCertificate=function(e,n){var r=this.m_library;return new t((function(t,i){r.GetCertificate(e,n,t,i)}))},e.prototype.ParseCertificateEx=function(e){var n=this.m_library;return new t((function(t,r){n.ParseCertificateEx(e,t,r)}))},e.prototype.SaveCertificate=function(e){var n=this.m_library;return new t((function(t,r){n.SaveCertificate(e,t,r)}))},e.prototype.SaveCertificates=function(e){var n=this.m_library;return new t((function(t,r){n.SaveCertificates(e,t,r)}))},e.prototype.GetTSPByAccessInfo=function(e,n,r,i){var o=this.m_library;return new t((function(t,s){o.GetTSPByAccessInfo(e,n,r,i,t,s)}))},e.prototype.CheckTSP=function(e,n,r){var i=this.m_library;return new t((function(t,o){i.CheckTSP(e,n,r,t,o)}))},e.prototype.DownloadData=function(e,n){var i=this;return new t((function(t,o){try{var s=new XMLHttpRequest;s.onload=function(){if(4==s.readyState){var a=null;try{if(200!=s.status)throw"Download data error. URL - "+e+", status - "+s.status;switch(n){case"binary":a=new Uint8Array(s.response);break;case"json":a=JSON.parse(s.responseText.replace(/\\'/g,"'"));break;default:a=s.responseText}}catch(t){return console.log("EndUser.DowloadData error: "+t),void o(i.MakeError(r.EndUserError.ERROR_DOWNLOAD_FILE,""))}t(a)}},s.onerror=function(){o(i.MakeError(r.EndUserError.ERROR_DOWNLOAD_FILE,""))},e=i.MakeURL(e),s.open("GET",e,!0),"binary"==n&&(s.responseType="arraybuffer"),s.send()}catch(t){o(i.MakeError(r.EndUserError.ERROR_DOWNLOAD_FILE,""))}}))},e.prototype.CreateKeyMedia=function(){return this.m_library.CreateKeyMedia()},e.prototype.GetPrivateKeyMedia=function(e){var n=this.m_library;return new t((function(t,r){n.GetPrivateKeyMedia(e,t,r)}))},e.prototype.EnumKeyMediaTypes=function(e){var n=this.m_library;return new t((function(t,r){n.EnumKeyMediaTypes(e,t,r)}))},e.prototype.EnumKeyMediaDevices=function(e,n){var r=this.m_library;return new t((function(t,i){r.EnumKeyMediaDevices(e,n,t,i)}))},e.prototype.GetKeyMediaTypes=function(){var e=this.m_library;return new t((function(t,n){e.GetKeyMediaTypes(t,n)}))},e.prototype.GetKeyMediaDevices=function(e){var n=this.m_library;return new t((function(t,r){n.GetKeyMediaDevices(e,t,r)}))},e.prototype.IsPrivateKeyReaded=function(){var e=this.m_library;return new t((function(t,n){e.IsPrivateKeyReaded(t,n)}))},e.prototype.ReadPrivateKey=function(){var e=this.m_library;return new t((function(t,n){e.ReadPrivateKey(t,n)}))},e.prototype.ReadPrivateKeySilently=function(e,n,r){var i=this.m_library;return new t((function(t,o){"number"==typeof e?i.ReadPrivateKeySilently(e,n,r,t,o):i.ReadPrivateKeySilently(e,t,o)}))},e.prototype.ReadPrivateKeyBinary=function(e,n){var r=this.m_library;return new t((function(t,i){r.ReadPrivateKeyBinary(e,n,t,i)}))},e.prototype.ReadPrivateKeyFile=function(e,n){var r=this.m_library;return new t((function(t,i){r.ReadPrivateKeyFile(e,n,t,i)}))},e.prototype.ResetPrivateKey=function(){var e=this.m_library;return new t((function(t,n){e.ResetPrivateKey(t,n)}))},e.prototype.CtxReadPrivateKey=function(e,n,r,i){var o=this.m_library;return new t((function(t,s){"number"==typeof n?o.CtxReadPrivateKey(e,n,r,i,t,s):o.CtxReadPrivateKey(e,n,t,s)}))},e.prototype.CtxReadPrivateKeyBinary=function(e,n,r){var i=this.m_library;return new t((function(t,o){i.CtxReadPrivateKeyBinary(e,n,r,t,o)}))},e.prototype.CtxFreePrivateKey=function(e){var n=this.m_library;return new t((function(t,r){n.CtxFreePrivateKey(e,t,r)}))},e.prototype.ShowOwnCertificate=function(){var e=this.m_library;return new t((function(t,n){e.ShowOwnCertificate(t,n)}))},e.prototype.GetOwnCertificate=function(e,n){var r=this.m_library;return new t((function(t,i){"number"==typeof e||"number"==typeof n?r.GetOwnCertificate(e,n,t,i):r.GetOwnCertificate(t,i)}))},e.prototype.GetOwnEUserParams=function(){var e=this.m_library;return new t((function(t,n){e.GetOwnEUserParams(t,n)}))},e.prototype.CtxGetOwnEUserParams=function(e){var n=this.m_library;return new t((function(t,r){n.CtxGetOwnEUserParams(e,t,r)}))},e.prototype.ModifyOwnEUserParams=function(e,n){var r=this.m_library;return new t((function(t,i){r.ModifyOwnEUserParams(e,n,t,i)}))},e.prototype.CtxModifyOwnEUserParams=function(e,n,r){var i=this.m_library;return new t((function(t,o){i.CtxModifyOwnEUserParams(e,n,r,t,o)}))},e.prototype.EnumOwnCertificates=function(e){var n=this.m_library;return new t((function(t,r){n.EnumOwnCertificates(e,t,r)}))},e.prototype.GetPrivateKeyOwnerInfo=function(){var e=this.m_library;return new t((function(t,n){e.GetPrivateKeyOwnerInfo(t,n)}))},e.prototype.CtxEnumOwnCertificates=function(e,n){var r=this.m_library;return new t((function(t,i){r.CtxEnumOwnCertificates(e,n,t,i)}))},e.prototype.CtxGetOwnCertificate=function(e,n,r){var i=this.m_library;return new t((function(t,o){i.CtxGetOwnCertificate(e,n,r,t,o)}))},e.prototype.GetKeyInfo=function(e){var n=this.m_library;return new t((function(t,r){n.GetKeyInfo(e,t,r)}))},e.prototype.GetKeyInfoBinary=function(e,n){var r=this.m_library;return new t((function(t,i){r.GetKeyInfoBinary(e,n,t,i)}))},e.prototype.GetKeyInfoFile=function(e,n){var r=this.m_library;return new t((function(t,i){r.GetKeyInfoFile(e,n,t,i)}))},e.prototype.GetCertificatesByKeyInfo=function(e,n,r){var i=this.m_library;return new t((function(t,o){i.GetCertificatesByKeyInfo(e,n,r,t,o)}))},e.prototype.EnumJKSPrivateKeys=function(e,n){var r=this.m_library;return new t((function(t,i){r.EnumJKSPrivateKeys(e,n,t,i)}))},e.prototype.GetJKSPrivateKey=function(e,n){var r=this.m_library;return new t((function(t,i){r.GetJKSPrivateKey(e,n,t,i)}))},e.prototype.CreatePrivateKeyInfo=function(){return this.m_library.CreatePrivateKeyInfo()},e.prototype.CreateEndUserInfo=function(){return this.m_library.CreateEndUserInfo()},e.prototype.GeneratePrivateKeyEx=function(e,n,r,i,o,s,a,u,c,l,f,p,_,h,E,y,S){var C=this.m_library;return new t((function(t,d){C.GeneratePrivateKeyEx(e,n,r,i,o,s,a,u,c,l,f,p,_,h,E,y,S,t,d)}))},e.prototype.ChangePrivateKeyPassword=function(e,n){var r=this.m_library;return new t((function(t,i){null!=e?r.ChangePrivateKeyPassword(e.GetTypeIndex(),e.GetDevIndex(),e.GetPassword(),n,t,i):r.ChangePrivateKeyPassword(t,i)}))},e.prototype.ChangeSoftwarePrivateKeyPassword=function(e,n,r){var i=this.m_library;return new t((function(t,o){i.ChangeSoftwarePrivateKeyPassword(e,n,r,t,o)}))},e.prototype.ChangeOwnCertificatesStatus=function(e,n){var r=this.m_library;return new t((function(t,i){r.ChangeOwnCertificatesStatus(e,n,t,i)}))},e.prototype.CtxChangeOwnCertificatesStatus=function(e,n,r){var i=this.m_library;return new t((function(t,o){i.CtxChangeOwnCertificatesStatus(e,n,r,t,o)}))},e.prototype.MakeNewCertificate=function(e,n,r,i,o,s,a,u,c,l,f,p,_){var h=this.m_library;return new t((function(t,E){h.MakeNewCertificate(e,n,r,i,o,s,a,u,c,l,f,p,_,t,E)}))},e.prototype.MakeNewOwnCertificate=function(e,n,r,i,o,s,a,u){var c=this.m_library;return new t((function(t,l){c.MakeNewOwnCertificate(e,n,r,i,o,s,a,u,t,l)}))},e.prototype.CtxMakeNewOwnCertificate=function(e,n,r,i,o,s,a,u,c){var l=this.m_library;return new t((function(t,f){l.CtxMakeNewOwnCertificate(e,n,r,i,o,s,a,u,c,t,f)}))},e.prototype.CtxMakeDeviceCertificate=function(e,n,r,i,o,s,a,u){var c=this.m_library;return new t((function(t,l){c.CtxMakeDeviceCertificate(e,n,r,i,o,s,a,u,t,l)}))},e.prototype.CtxHash=function(e,n,r,i){var o=this.m_library;return new t((function(t,s){o.CtxHash(e,n,r,i,t,s)}))},e.prototype.CtxHashBegin=function(e,n,r){var i=this.m_library;return new t((function(t,o){i.CtxHashBegin(e,n,r,t,o)}))},e.prototype.CtxHashContinue=function(e,n){var r=this.m_library;return new t((function(t,i){r.CtxHashContinue(e,n,t,i)}))},e.prototype.CtxHashEnd=function(e){var n=this.m_library;return new t((function(t,r){n.CtxHashEnd(e,t,r)}))},e.prototype.CtxHashFree=function(e){var n=this.m_library;return new t((function(t,r){n.CtxHashFree(e,t,r)}))},e.prototype.GetSignType=function(e,n){var r=this.m_library;return new t((function(t,i){r.GetSignType(e,n,t,i)}))},e.prototype.CtxGetSignerInfo=function(e,n,r){var i=this.m_library;return new t((function(t,o){i.CtxGetSignerInfo(e,n,r,t,o)}))},e.prototype.SignHash=function(e){var n=this.m_library;return new t((function(t,r){n.SignHash(e,t,r)}))},e.prototype.Sign=function(e){var n=this.m_library;return new t((function(t,r){n.Sign(e,t,r)}))},e.prototype.SignInternal=function(e,n){var r=this.m_library;return new t((function(t,i){r.SignInternal(e,n,t,i)}))},e.prototype.SignHashRSA=function(e){var n=this.m_library;return new t((function(t,r){n.SignHashRSA(e,t,r)}))},e.prototype.SignRSA=function(e,n,r){var i=this.m_library;return new t((function(t,o){i.SignRSA(e,n,r,t,o)}))},e.prototype.CtxSignHash=function(e,n,r,i){var o=this.m_library;return new t((function(t,s){o.CtxSignHash(e,n,r,i,t,s)}))},e.prototype.CtxSign=function(e,n,r,i,o){var s=this.m_library;return new t((function(t,a){s.CtxSign(e,n,r,i,o,t,a)}))},e.prototype.CtxSignFile=function(e,n,r,i,o,s){var a=this.m_library;return new t((function(t,u){a.CtxSignFile(e,n,r,i,o,s,t,u)}))},e.prototype.AppendSignHash=function(e,n){var r=this.m_library;return new t((function(t,i){r.AppendSignHash(e,n,t,i)}))},e.prototype.AppendSign=function(e,n){var r=this.m_library;return new t((function(t,i){r.AppendSign(e,n,t,i)}))},e.prototype.AppendSignInternal=function(e,n){var r=this.m_library;return new t((function(t,i){r.AppendSignInternal(e,n,t,i)}))},e.prototype.CtxAppendSignHash=function(e,n,r,i,o){var s=this.m_library;return new t((function(t,a){s.CtxAppendSignHash(e,n,r,i,o,t,a)}))},e.prototype.CtxAppendSign=function(e,n,r,i,o){var s=this.m_library;return new t((function(t,a){s.CtxAppendSign(e,n,r,i,o,t,a)}))},e.prototype.CtxAppendSignFile=function(e,n,r,i,o,s){var a=this.m_library;return new t((function(t,u){a.CtxAppendSignFile(e,n,r,i,o,s,t,u)}))},e.prototype.IsDataInSignedDataAvailable=function(e){var n=this.m_library;return new t((function(t,r){n.IsDataInSignedDataAvailable(e,t,r)}))},e.prototype.GetCertificateFromSignedData=function(e,n){var r=this.m_library;return new t((function(t,i){r.GetCertificateFromSignedData(e,n,t,i)}))},e.prototype.GetSignsCount=function(e){var n=this.m_library;return new t((function(t,r){n.GetSignsCount(e,t,r)}))},e.prototype.GetSignTimeInfo=function(e,n){var r=this.m_library;return new t((function(t,i){r.GetSignTimeInfo(e,n,t,i)}))},e.prototype.VerifyHashOnTimeEx=function(e,n,r,i,o,s){var a=this.m_library;return new t((function(t,u){a.VerifyHashOnTimeEx(e,n,r,i,o,s,t,u)}))},e.prototype.VerifyDataOnTimeEx=function(e,n,r,i,o,s){var a=this.m_library;return new t((function(t,u){a.VerifyDataOnTimeEx(e,n,r,i,o,s,t,u)}))},e.prototype.VerifyDataInternalOnTimeEx=function(e,n,r,i,o){var s=this.m_library;return new t((function(t,a){s.VerifyDataInternalOnTimeEx(e,n,r,i,o,t,a)}))},e.prototype.CreateReference=function(t,e){return this.m_library.CreateReference(t,e)},e}();e.a=i}).call(this,n(17).Promise)},function(t,e){var n,r,i=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(t){if(n===setTimeout)return setTimeout(t,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(t){n=o}try{r="function"==typeof clearTimeout?clearTimeout:s}catch(t){r=s}}();var u,c=[],l=!1,f=-1;function p(){l&&u&&(l=!1,u.length?c=u.concat(c):f=-1,c.length&&_())}function _(){if(!l){var t=a(p);l=!0;for(var e=c.length;e;){for(u=c,c=[];++f<e;)u&&u[f].run();f=-1,e=c.length}u=null,l=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===s||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function h(t,e){this.fun=t,this.array=e}function E(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];c.push(new h(t,e)),1!==c.length||l||a(_)},h.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=E,i.addListener=E,i.once=E,i.off=E,i.removeListener=E,i.removeAllListeners=E,i.emit=E,i.prependListener=E,i.prependOnceListener=E,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e){}])}));
8
+ */i=function(){"use strict";function t(t){return"function"==typeof t}var i=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},o=0,s=void 0,a=void 0,u=function(t,e){E[o]=t,E[o+1]=e,2===(o+=2)&&(a?a(y):m())},c="undefined"!=typeof window?window:void 0,l=c||{},f=l.MutationObserver||l.WebKitMutationObserver,p="undefined"==typeof self&&void 0!==e&&"[object process]"==={}.toString.call(e),_="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function h(){var t=setTimeout;return function(){return t(y,1)}}var E=new Array(1e3);function y(){for(var t=0;t<o;t+=2)(0,E[t])(E[t+1]),E[t]=void 0,E[t+1]=void 0;o=0}var S,C,d,R,m=void 0;function A(t,e){var n=arguments,r=this,i=new this.constructor(T);void 0===i[g]&&k(i);var o,s=r._state;return s?(o=n[s-1],u((function(){return K(s,i,o,r._result)}))):G(r,i,t,e),i}function P(t){if(t&&"object"==typeof t&&t.constructor===this)return t;var e=new this(T);return b(e,t),e}p?m=function(){return e.nextTick(y)}:f?(C=0,d=new f(y),R=document.createTextNode(""),d.observe(R,{characterData:!0}),m=function(){R.data=C=++C%2}):_?((S=new MessageChannel).port1.onmessage=y,m=function(){return S.port2.postMessage(0)}):m=void 0===c?function(){try{var t=n(23);return s=t.runOnLoop||t.runOnContext,function(){s(y)}}catch(t){return h()}}():h();var g=Math.random().toString(36).substring(16);function T(){}var v=new M;function I(t){try{return t.then}catch(t){return v.error=t,v}}function U(e,n,r){n.constructor===e.constructor&&r===A&&n.constructor.resolve===P?function(t,e){1===e._state?O(t,e._result):2===e._state?N(t,e._result):G(e,void 0,(function(e){return b(t,e)}),(function(e){return N(t,e)}))}(e,n):r===v?N(e,v.error):void 0===r?O(e,n):t(r)?function(t,e,n){u((function(t){var r=!1,i=function(t,e,n,r){try{t.call(e,n,r)}catch(t){return t}}(n,e,(function(n){r||(r=!0,e!==n?b(t,n):O(t,n))}),(function(e){r||(r=!0,N(t,e))}),t._label);!r&&i&&(r=!0,N(t,i))}),t)}(e,n,r):O(e,n)}function b(t,e){var n;t===e?N(t,new TypeError("You cannot resolve a promise with itself")):"function"==typeof(n=e)||"object"==typeof n&&null!==n?U(t,e,I(e)):O(t,e)}function D(t){t._onerror&&t._onerror(t._result),w(t)}function O(t,e){void 0===t._state&&(t._result=e,t._state=1,0!==t._subscribers.length&&u(w,t))}function N(t,e){void 0===t._state&&(t._state=2,t._result=e,u(D,t))}function G(t,e,n,r){var i=t._subscribers,o=i.length;t._onerror=null,i[o]=e,i[o+1]=n,i[o+2]=r,0===o&&t._state&&u(w,t)}function w(t){var e=t._subscribers,n=t._state;if(0!==e.length){for(var r=void 0,i=void 0,o=t._result,s=0;s<e.length;s+=3)r=e[s],i=e[s+n],r?K(n,r,i,o):i(o);t._subscribers.length=0}}function M(){this.error=null}var L=new M;function K(e,n,r,i){var o=t(r),s=void 0,a=void 0,u=void 0,c=void 0;if(o){if((s=function(t,e){try{return t(e)}catch(t){return L.error=t,L}}(r,i))===L?(c=!0,a=s.error,s=null):u=!0,n===s)return void N(n,new TypeError("A promises callback cannot return that same promise."))}else s=i,u=!0;void 0!==n._state||(o&&u?b(n,s):c?N(n,a):1===e?O(n,s):2===e&&N(n,s))}var x=0;function k(t){t[g]=x++,t._state=void 0,t._result=void 0,t._subscribers=[]}function B(t,e){this._instanceConstructor=t,this.promise=new t(T),this.promise[g]||k(this.promise),i(e)?(this._input=e,this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0===this.length?O(this.promise,this._result):(this.length=this.length||0,this._enumerate(),0===this._remaining&&O(this.promise,this._result))):N(this.promise,new Error("Array Methods must be provided an Array"))}function F(t){this[g]=x++,this._result=this._state=void 0,this._subscribers=[],T!==t&&("function"!=typeof t&&function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof F?function(t,e){try{e((function(e){b(t,e)}),(function(e){N(t,e)}))}catch(e){N(t,e)}}(this,t):function(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}())}function Y(){var t=void 0;if(void 0!==r)t=r;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(t){throw new Error("polyfill failed because global object is unavailable in this environment")}var e=t.Promise;if(e){var n=null;try{n=Object.prototype.toString.call(e.resolve())}catch(t){}if("[object Promise]"===n&&!e.cast)return}t.Promise=F}return B.prototype._enumerate=function(){for(var t=this.length,e=this._input,n=0;void 0===this._state&&n<t;n++)this._eachEntry(e[n],n)},B.prototype._eachEntry=function(t,e){var n=this._instanceConstructor,r=n.resolve;if(r===P){var i=I(t);if(i===A&&void 0!==t._state)this._settledAt(t._state,e,t._result);else if("function"!=typeof i)this._remaining--,this._result[e]=t;else if(n===F){var o=new n(T);U(o,t,i),this._willSettleAt(o,e)}else this._willSettleAt(new n((function(e){return e(t)})),e)}else this._willSettleAt(r(t),e)},B.prototype._settledAt=function(t,e,n){var r=this.promise;void 0===r._state&&(this._remaining--,2===t?N(r,n):this._result[e]=n),0===this._remaining&&O(r,this._result)},B.prototype._willSettleAt=function(t,e){var n=this;G(t,void 0,(function(t){return n._settledAt(1,e,t)}),(function(t){return n._settledAt(2,e,t)}))},F.all=function(t){return new B(this,t).promise},F.race=function(t){var e=this;return i(t)?new e((function(n,r){for(var i=t.length,o=0;o<i;o++)e.resolve(t[o]).then(n,r)})):new e((function(t,e){return e(new TypeError("You must pass an array to race."))}))},F.resolve=P,F.reject=function(t){var e=new this(T);return N(e,t),e},F._setScheduler=function(t){a=t},F._setAsap=function(t){u=t},F._asap=u,F.prototype={constructor:F,then:A,catch:function(t){return this.then(null,t)}},Y(),F.polyfill=Y,F.Promise=F,F},t.exports=i()}).call(this,n(21),n(22))},function(t,e,n){"use strict";(function(t){var n=function(t,e,n){this.id=t,this.cmd=e,this.params=n,this.origin=window.location.origin?window.location.origin:window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:""),this.pathname=window.location.pathname},r=function(t,e,n,r){this.id=t,this.cmd=e,this.result=n,this.error=r},i=function(){function e(t,e,n){var r=this;this.m_worker=this.loadWorker(t,e),this.m_worker.onmessage=function(t){var e=t.data;if(-2!=e.id){var i=r.m_promises[e.id-1];i&&(delete r.m_promises[e.id-1],e.error?i.reject(e.error):i.resolve(e.result))}else n(e.result)},this.m_worker.onerror=function(t){r.m_promises.forEach((function(e){e.reject(t.error)})),r.m_promises=new Array},this.m_promises=new Array}return e.prototype.loadWorker=function(t,e){try{if(!t)throw"No worker content";try{var n,r=window,i=r.URL||r.webkitURL;try{(n=new(r.BlobBuilder||r.WebKitBlobBuilder||r.MozBlobBuilder||r.MSBlobBuilder)).append(t),n=n.getBlob()}catch(e){n=new Blob([t])}return new Worker(i.createObjectURL(n))}catch(e){return new Worker("data:application/javascript,"+encodeURIComponent(t))}}catch(t){if(!e)throw Error("Inline worker is not supported");return new Worker(e)}},e.prototype.postMessage=function(e,r){var i=this,o=new n(-1,e,r),s=new t((function(t,e){o.id=i.m_promises.push({resolve:t,reject:e})}));return this.m_worker.postMessage(o),s},e}();e.a=i;!function(){function t(t){this.m_context=t,this.m_initialized=!1;var e=this;self.onmessage=function(t){e.onMessage(t.data)}}t.prototype.postMessage=function(t,e,n,i){var o=new r(t,e,n,i);self.postMessage(o)},t.prototype.onMessage=function(t){var e=this;this.m_initialized?this.m_context[t.cmd].apply(this.m_context,t.params).then((function(n){e.postMessage(t.id,t.cmd,n)}),(function(n){e.postMessage(t.id,t.cmd,null,n)})):setTimeout((function(){e.onMessage(t)}),50)},t.prototype.initialize=function(){this.m_initialized=!0}}()}).call(this,n(17).Promise)},function(t,e,n){"use strict";(function(t){var r=n(1),i=n(9),o=n(10),s=n(14),a=n(20),u=n(4),c=n(13),l=n(2),f=n(8),p=n(0),_=n(11),h=n(15),E=n(16),y=n(7),S=n(5),C=n(12),d=n(6),R=function(){},m=function(){function e(){this.m_library=new a.a,this.m_settings=null,this.m_initialized=!1,this.m_kmTypes=null,this.m_kmActiveOperation=!1,this.m_context=null,this.m_pkContext=null,this.m_eventListeners=new Array,this.m_resolveOIDs=!1}return e.prototype.MapError=function(t){var e=new r.EndUserError;return void 0!==t.GetErrorCode&&void 0!==t.GetMessage?(e.code=t.GetErrorCode(),e.message=t.GetMessage()):void 0!==t.code&&void 0!==t.message?(e.code=t.code,e.message=t.message):(e.code=r.EU_ERROR_UNKNOWN,e.message=t.toString()),e},e.prototype.ProcessArray=function(e,n){var r=this;return new t((function(t,i){var o=Array(),s=0,a=function(){s>=e.length?t(o):(n(e[s]).then((function(t){o.push(t),a()})).catch((function(t){return i(r.MapError(t))})),s++)};a()}))},e.prototype.DataToNamedDataArray=function(t){t=null!=t?t:[],t=Array.isArray(t)?t:[t];for(var e=[],n=0;n<t.length;n++){var r=void 0!==t[n].name&&void 0!==t[n].val;e.push({name:r?t[n].name:"Ім'я відсутнє",val:r?t[n].val:t[n]})}return e},e.prototype.DataToResult=function(t,e){for(var n=[],r=!Array.isArray(t),i=r?[t]:t,o=0;o<i.length;o++){var s=void 0!==i[o].name&&void 0!==i[o].val?{name:i[o].name,val:e[o]}:e[o];n.push(s)}return r?n[0]:n},e.prototype.OnEvent=function(t){try{var e=this.m_eventListeners[t.type]||this.m_eventListeners[p.EndUserEventType.All];e&&e(t)}catch(t){}},e.prototype.CheckInitialize=function(){var e=this,n=e.m_library;return new t((function(t,i){e.m_initialized?t():n.Load().then((function(){throw n.MakeError(r.EU_ERROR_NOT_INITIALIZED,"")})).catch((function(t){return i(e.MapError(t))}))}))},e.prototype.BeginKMOperation=function(){var e=this;return new t((function(t,n){var r=function(){e.m_kmActiveOperation?setTimeout(r,10):(e.m_kmActiveOperation=!0,t())};r()}))},e.prototype.EndKMOperation=function(){this.m_kmActiveOperation=!1},e.prototype.GetCASettings=function(t){if(!t)return null;for(var e=this.m_settings.CAs,n=0;n<e.length;n++)for(var r=e[n].issuerCNs,i=0;i<r.length;i++)if(r[i]==t)return e[n];return null},e.prototype.IsCMPCompatible=function(t,e){return!!t.cmpAddress&&(void 0===t.cmpCompatibility||(t.cmpCompatibility&e)==e)},e.prototype.SetSettings=function(e){var n=this,i=n.m_library,o=n.m_settings.CAs,s=this.GetCASettings(e),a=o&&o.length>0?o[0]:null;return new t((function(t,o){if(e&&null==s)throw i.MakeError(r.EU_ERROR_WRITE_SETTINGS,"");var u=s&&s.tspAddress?s:a,c=i.CreateTSPSettings();c.SetGetStamps(!0),c.SetAddress(u?u.tspAddress:""),c.SetPort(u?u.tspAddressPort:"80"),i.SetTSPSettings(c).then((function(){var t=!s||!(!s||!s.ocspAccessPointAddress),e=i.CreateOCSPSettings();return e.SetUseOCSP(t),t&&(e.SetBeforeStore(!0),e.SetAddress("czo.gov.ua"),e.SetPort("80")),i.SetOCSPSettings(e)})).then((function(){var t;t=!(!s||!s.cmpAddress);var e=i.CreateCMPSettings();return e.SetUseCMP(t),t&&(e.SetAddress(s.cmpAddress),e.SetPort("80")),i.SetCMPSettings(e)})).then((function(){t()})).catch((function(t){o(n.MapError(t))}))}))},e.prototype.GetJKSPrivateKey=function(e,n){var r=this,i=r.m_library;return new t((function(t,o){var a={alias:null,info:null};i.EnumJKSPrivateKeys(e,n).then((function(n){if(null!=n)return a.alias=n,i.GetJKSPrivateKey(e,n);t(null)})).then((function(t){a.info=t;for(var e=new Array,n=0;n<t.GetCertificatesCount();n++)e.push(t.GetCertificate(n));return r.ProcessArray(e,(function(t){return i.ParseCertificateEx(t)}))})).then((function(e){var n=new s.a;n.alias=a.alias,n.privateKey=a.info.GetPrivateKey(),n.certificates=new Array,n.digitalStamp=!1;for(var r=0;r<e.length;r++){var o=e[r];if(o.GetSubjType()==i.EU_SUBJECT_TYPE_END_USER){o.GetPublicKeyType()==i.EU_CERT_KEY_TYPE_DSTU4145&&(o.GetKeyUsageType()&i.EU_KEY_USAGE_DIGITAL_SIGNATURE)==i.EU_KEY_USAGE_DIGITAL_SIGNATURE&&(n.digitalStamp=o.GetExtKeyUsages().indexOf(i.EU_UA_OID_EXT_KEY_USAGE_STAMP)>-1);var c=new u.EndUserCertificate;c.data=a.info.GetCertificate(r),c.infoEx=l.a.MapToEndUserCertificateInfoEx(o,new f.a),n.certificates.push(c)}}n.digitalStamp=!1,t(n)})).catch((function(t){return o(r.MapError(t))}))}))},e.prototype.SaveCertificatesInternal=function(e){var n=this,r=this.m_library;return new t((function(t,i){e?Array.isArray(e)?n.ProcessArray(e,(function(t){return r.SaveCertificate(t)})).then((function(){return t()})).catch((function(t){return i(t)})):r.SaveCertificates(e).then((function(){return t()})).catch((function(t){return i(t)})):t()}))},e.prototype.CtxReadPrivateKeyInternal=function(e,n,i,o,s,a){var u=this,c=this.m_library,l={pkContext:null};return e||(e=u.m_context),new t((function(t,f){u.SaveCertificatesInternal(s).then((function(){return u.SetSettings(a)})).then((function(){return null!=n&&null!=i?c.CtxReadPrivateKeyBinary(e,n,i):c.CtxReadPrivateKey(e,o)})).then((function(t){l.pkContext=t;var e=t.GetOwnerInfo();if(!a)return u.SetSettings(e.GetIssuerCN());var n=u.GetCASettings(e.GetIssuerCN());if(!n||-1==n.issuerCNs.indexOf(a))throw c.MakeError(r.EU_ERROR_CERT_NOT_FOUND,"")})).then((function(){t(l.pkContext)})).catch((function(s){null==l.pkContext?u.MapError(s).code!=r.EU_ERROR_CERT_NOT_FOUND||a?f(u.MapError(s)):u.SearchPrivateKeyCertificatesWithCMP(n,i,o).then((function(t){return u.CtxReadPrivateKeyInternal(e,n,i,o,t.certs,t.CACommonName)})).then((function(e){t(e)})).catch((function(t){return f(u.MapError(t))})):c.CtxFreePrivateKey(l.pkContext).then((function(){f(u.MapError(s))})).catch((function(){f(u.MapError(s))}))}))}))},e.prototype.ReadPrivateKeyInternal=function(e,n,r,i,s){var a=this;return new t((function(t,u){a.ResetPrivateKeyInternal().then((function(){return a.CtxReadPrivateKeyInternal(a.m_context,e,n,r,i,s)})).then((function(e){a.m_pkContext=e;var n=l.a.MapEndUserOwnerInfo(e.GetOwnerInfo(),new o.a);t(n)})).catch((function(t){u(a.MapError(t))}))}))},e.prototype.ResetPrivateKeyInternal=function(){var e=this,n=this.m_library;return new t((function(t,r){null!=e.m_pkContext?n.CtxFreePrivateKey(e.m_pkContext).then((function(){e.m_pkContext=null,t()})).catch((function(t){return r(e.MapError(t))})):t()}))},e.prototype.SearchPrivateKeyCertificatesWithCMP=function(e,n,i,o){var s=this,a=s.m_library,u=s.m_settings.CAs;return new t((function(t,c){(null!=e&&null!=n?a.GetKeyInfoBinary(e,n):a.GetKeyInfo(i)).then((function(e){var n=function(i,l){if(i>=u.length){var f=a.MakeError(l?r.EU_ERROR_CERT_NOT_FOUND:r.EU_ERROR_TRANSMIT_REQUEST,"");c(s.MapError(f))}else{var _=o?p.EndUserCMPCompatibility.DownloadEUCerts:p.EndUserCMPCompatibility.SearchEUCerts;s.IsCMPCompatible(u[i],_)?o&&-1==u[i].issuerCNs.indexOf(o)?n(i+1,l):a.GetCertificatesByKeyInfo(e,[u[i].cmpAddress],["80"]).then((function(e){t({certs:e,CACommonName:u[i].issuerCNs[0]})})).catch((function(t){var e=t.GetErrorCode();if(e==r.EU_ERROR_CERT_NOT_FOUND||e==r.EU_ERROR_TRANSMIT_REQUEST)return l=l||e==r.EU_ERROR_CERT_NOT_FOUND,void n(i+1,l);c(s.MapError(t))})):n(i+1,l)}};n(0,!1)})).catch((function(t){return c(s.MapError(t))}))}))},e.prototype.GetUserCertificatesFromCertificates=function(e){var n=this,r=n.m_library;return new t((function(t,i){var o=new Array,s=function(a){r.GetCertificateFromSignedData(a,e).then((function(e){if(null!=e){var n=new u.EndUserCertificate;return n.data=e,o.push(n),r.ParseCertificateEx(e)}for(var i=new Array,s=0;s<o.length;s++){o[s].infoEx.subjType==r.EU_SUBJECT_TYPE_END_USER&&i.push(o[s])}t(i)})).then((function(t){o[a].infoEx=l.a.MapToEndUserCertificateInfoEx(t,new f.a),s(a+1)})).catch((function(t){return i(n.MapError(t))}))};s(0)}))},e.prototype.GeneratePrivateKeyInternal=function(e,n,r,i,o,s,a,u,c,f,p,_,h){var y=this,S=this.m_library;return new t((function(t,C){var d=null==e&&null==r,R=null!=r,m=S.CreatePrivateKeyInfo(),A=null;null!=_&&(A=l.a.MapFromEndUserInfo(_,S.CreateEndUserInfo())),S.GeneratePrivateKeyEx(d,e?e.GetTypeIndex():-1,e?e.GetDevIndex():-1,e?e.GetPassword():r,n,i,o,s,a,u,c,f,p,A,h,m,null!=r).then((function(e){for(var n=new Array,r=0;r<e.size();r++){var i=e.get(r);i=l.a.MapToEndUserRequestInfo(i,new E.a),n.push(i)}var o={key:R?m.GetPrivateKey():null,requests:n};t(o)})).catch((function(t){return C(y.MapError(t))}))}))},e.prototype.GetHashAlgoBySignAlgo=function(t){var e=this.m_library;switch(t){case p.EndUserSignAlgo.DSTU4145WithGOST34311:return p.EndUserHashAlgo.GOST34311;case p.EndUserSignAlgo.RSAWithSHA:case p.EndUserSignAlgo.ECDSAWithSHA:return p.EndUserHashAlgo.SHA256;default:throw e.MakeError(r.EU_ERROR_BAD_PARAMETER,"")}},e.prototype.CtxSignHashInternal=function(e,n,i,o,s,a){var u=this,c=this.m_library,l=null!=o,f=u.DataToNamedDataArray(i),p=u.DataToNamedDataArray(o);return new t((function(o,_){u.CheckInitialize().then((function(){if(null==e)throw c.MakeError(r.EU_ERROR_BAD_CERT,"");if(l&&f.length!=p.length)throw c.MakeError(r.EU_ERROR_BAD_PARAMETER,"");for(var i=new Array,o=0;o<f.length;o++)i.push({hash:f[o],previousSign:l?p[o]:null});return u.ProcessArray(i,(function(r){return new t((function(t,i){(l?c.CtxAppendSignHash(e,n,r.hash.val,r.previousSign.val,s):c.CtxSignHash(e,n,r.hash.val,s)).then((function(t){return a?t:c.BASE64Decode(t)})).then((function(e){t(e)})).catch((function(t){return i(t)}))}))}))})).then((function(t){var e=u.DataToResult(i,t);o(e)})).catch((function(t){return _(u.MapError(t))}))}))},e.prototype.CtxSignDataInternal=function(e,n,i,o,s,a,u){var c=this,l=this,f=this.m_library,p=null!=o,_=l.DataToNamedDataArray(i),h=l.DataToNamedDataArray(o);return new t((function(E,y){l.CheckInitialize().then((function(){if(null==e)throw f.MakeError(r.EU_ERROR_BAD_CERT,"");if(p&&s&&_.length!=h.length)throw f.MakeError(r.EU_ERROR_BAD_PARAMETER,"");if(!s)return _;var t=l.GetHashAlgoBySignAlgo(n);return l.HashData(t,_,!0)})).then((function(r){for(var i=new Array,o=p?h.length:r.length,c=0;c<o;c++)i.push({dataOrHash:null!=r?r[c]:null,previousSign:p?h[c]:null});return l.ProcessArray(i,(function(r){return new t((function(t,i){(p?s?f.CtxAppendSignHash(e,n,r.dataOrHash.val,r.previousSign.val,a):f.CtxAppendSign(e,n,null,r.previousSign.val,a):s?f.CtxSignHash(e,n,r.dataOrHash.val,a):f.CtxSign(e,n,r.dataOrHash.val,!1,a)).then((function(t){return u?t:f.BASE64Decode(t)})).then((function(e){t(e)})).catch((function(t){return i(t)}))}))}))})).then((function(t){var e=c.DataToResult(p&&!s?o:i,t);E(e)})).catch((function(t){return y(l.MapError(t))}))}))},e.prototype.LoadTaxReportPKey=function(e,n,i){var o=this,s=this.m_library;return new t((function(t,a){var u=new R;if(Array.isArray(e)||(e=[e]),e.length>2)a(o.MapError(s.MakeError(r.EU_ERROR_BAD_PARAMETER,"")));else{var c=function(l,f){var _=n[l],h=e[f];s.CtxGetOwnCertificate(h,p.EndUserCertKeyType.DSTU4145,_).then((function(e){if(i&&_&p.EndUserKeyUsage.DigitalSignature&&!(e.GetInfoEx().GetExtKeyUsages().indexOf(s.EU_UA_OID_EXT_KEY_USAGE_STAMP)>-1))throw s.MakeError(r.EU_ERROR_BAD_PARAMETER,"");if(_&p.EndUserKeyUsage.DigitalSignature)u.signPKCtx=h,u.signCert=e;else{if(!(_&p.EndUserKeyUsage.KeyAgreement))throw s.MakeError(r.EU_ERROR_BAD_PARAMETER,"");u.envelopPKCtx=h,u.envelopCert=e}l+1<n.length?c(l+1,0):t(u)})).catch((function(t){if(t.GetErrorCode()==r.EU_ERROR_CERT_NOT_FOUND){if(f+1<e.length)return void c(l,f+1);t=s.MakeError(r.EU_ERROR_BAD_PARAMETER,"")}a(o.MapError(t))}))};c(0,0)}}))},e.prototype.ProtectTaxReport=function(e,n,i,o,s,a,u){var c=this,l=this.m_library,f=new _.b;f.name=a.name;var p=function(e,n){return new t((function(t,r){return l.CtxSign(e.signPKCtx,l.EU_CTX_SIGN_DSTU4145_WITH_GOST34311,n,!1,!0).then((function(t){return l.BASE64Decode(t)})).then((function(t){return l.AppendCryptoHeader(l.EU_HEADER_CA_TYPE,l.EU_HEADER_PART_TYPE_SIGNED,t)})).then((function(e){t(e)})).catch((function(t){return r(c.MapError(t))}))}))},h=function(e,n){return new t((function(r,i){return l.CtxEnvelop(e.envelopPKCtx,[s],l.EU_RECIPIENT_APPEND_ISSUER_AND_SERIAL,!1,!1,n).then((function(t){return l.BASE64Decode(t)})).then((function(t){return l.AppendCryptoHeader(l.EU_HEADER_CA_TYPE,l.EU_HEADER_PART_TYPE_ENCRYPTED,t)})).then((function(n){var r=e.envelopCert,i=l.EU_KEY_USAGE_DIGITAL_SIGNATURE|l.EU_KEY_USAGE_KEY_AGREEMENT;return i==(r.GetInfoEx().GetKeyUsageType()&i)?n:function(e,n){return new t((function(t,r){return l.AppendCryptoHeader(l.EU_HEADER_CA_TYPE,l.EU_HEADER_PART_TYPE_CERTCRYPT,e).then((function(e){var r=new Uint8Array(e.byteLength+n.byteLength);r.set(new Uint8Array(e),0),r.set(new Uint8Array(n),e.byteLength),t(r)})).catch((function(t){return r(c.MapError(t))}))}))}(r.GetData(),n)})).then((function(t){return p(e,t)})).then((function(t){r({reportData:t,ownCert:e.envelopCert.GetData()})})).catch((function(t){return i(c.MapError(t))}))}))};return new t((function(s,_){new t((function(t,e){t(a.data)})).then((function(t){return null!=e?p(e,t):t})).then((function(t){return null!=n?p(n,t):t})).then((function(t){return null!=i?p(i,t):t})).then((function(t){return u&&(f.signedData=t),null!=n||null!=i?h(null!=i?i:n,t):{reportData:t,ownCert:e.signCert.GetData()}})).then((function(t){return l.AppendTransportHeader(l.EU_HEADER_CA_TYPE,a.name,o,t.ownCert,t.reportData)})).then((function(t){f.data=t,f.error=c.MapError(l.MakeError(r.EU_ERROR_NONE,"")),s(f)})).catch((function(t){f.error=c.MapError(t),s(f)}))}))},e.prototype.UnprotectTaxReceipt=function(e,n){var i=this,o=this.m_library,s=new _.a;s.data=null,s.receiptNumber=0,s.initiators=[],s.error=null;return new t((function(a,u){var c;(c=n.data,new t((function(t,e){o.ParseTransportHeader(c).then((function(e){s.receiptNumber=e.GetReceiptNumber(),t(e.GetCryptoData())})).catch((function(n){n.GetErrorCode()==r.EU_ERROR_PKI_FORMATS_FAILED?t(c):e(i.MapError(n))}))}))).then((function(n){var c=function(n){(function(n){var a={headerInfo:null};return new t((function(t,u){o.ParseCryptoHeader(n).then((function(t){a.headerInfo=t;var n=t.GetCryptoData();switch(t.GetHeaderType()){case o.EU_HEADER_PART_TYPE_SIGNED:return o.VerifyDataInternalOnTimeEx(n,0,null,!1,!1);case o.EU_HEADER_PART_TYPE_ENCRYPTED:return o.CtxDevelop(e,n);case o.EU_HEADER_PART_TYPE_STAMPED:case o.EU_HEADER_PART_TYPE_CERTCRYPT:return null;default:throw o.MakeError(r.EU_ERROR_PKI_FORMATS_FAILED,"")}})).then((function(e){if(null!=e){var r=a.headerInfo.GetHeaderType()==o.EU_HEADER_PART_TYPE_SIGNED?l.a.MapToEndUserSignInfo(e,new S.a):l.a.MapToEndUserSenderInfo(e,new C.a);s.initiators.push(r),n=e.GetData()}else n=n.slice(a.headerInfo.GetHeaderSize()+a.headerInfo.GetCryptoData().length,n.length);t(n)})).catch((function(e){e.GetErrorCode()==r.EU_ERROR_BAD_PARAMETER?t(null):u(i.MapError(e))}))}))})(n).then((function(t){if(null==t)return s.data=n,s.error=i.MapError(o.MakeError(r.EU_ERROR_NONE,"")),void a(s);c(t)})).catch((function(t){return u(i.MapError(t))}))};c(n)})).catch((function(t){return u(i.MapError(t))}))}))},e.prototype.AddEventListener=function(e,n){var i=this,o=i.m_library;return new t((function(t,s){if([p.EndUserEventType.None,p.EndUserEventType.All,p.EndUserEventType.ConfirmKSPOperation].indexOf(e)<0)s(i.MapError(o.MakeError(r.EU_ERROR_BAD_PARAMETER,"")));else{switch(e){case p.EndUserEventType.None:i.m_eventListeners=[];break;case p.EndUserEventType.All:i.m_eventListeners=[],i.m_eventListeners[e]=n;break;default:i.m_eventListeners[e]=n}t()}}))},e.prototype.GetLibraryInfo=function(e){var n=this,r=this.m_library;return new t((function(t,i){var o=new c.b;o.supported=r.IsSupported(),o.isSignAgentSupported=r.IsSignAgentSupported(),o.isWebExtensionSupported=r.IsWebExtensionSupported(),o.isNPAPISupported=r.IsNPAPISupported(),o.isActiveXSupported=r.IsActiveXSupported(),o.isWebExtensionInstalled=r.IsWebExtensionInstalled(),o.nativeLibraryInstallURLs=r.GetInstallURL(!0,e),o.nativeLibraryInstallURL=o.nativeLibraryInstallURLs?o.nativeLibraryInstallURLs[0]:null,o.nativeLibraryUpdateURLs=r.GetUpdateURL(!0,e),o.nativeLibraryUpdateURL=o.nativeLibraryUpdateURLs?o.nativeLibraryUpdateURLs[0]:null,o.webExtensionInstallURL=r.GetWebExtensionInstallURL(),o.helpURL=r.GetHelpURL(e),o.supported?r.Load().then((function(){o.loaded=!0,r.GetVersion().then((function(e){o.version=e,t(o)})).catch((function(t){return i(n.MapError(t))}))})).catch((function(e){var i=n.MapError(e);o.loaded=!1,o.isNativeLibraryNeedUpdate=r.IsLibraryVersionNotSupportedError(i.code),t(o)})):t(o)}))},e.prototype.IsInitialized=function(){var e=this;return new t((function(t,n){t(e.m_initialized)}))},e.prototype.Initialize=function(e){var n=this,r=n.m_library;return n.m_settings=e,new t((function(t,i){r.Load().then((function(){return r.SetRuntimeParameter(r.EU_SAVE_SETTINGS_PARAMETER,r.EU_SETTINGS_ID_PROXY)})).then((function(){return r.SetUIMode(!1)})).then((function(){return r.Initialize()})).then((function(){return r.SetUIMode(!1)})).then((function(){return r.SetCharset(n.m_settings.encoding)})).then((function(){return r.SetLanguage(n.m_settings.language)})).then((function(){return r.InitializeMandatorySettings()})).then((function(){var t=r.CreateFileStoreSettings();return t.SetPath(""),t.SetSaveLoadedCerts(!0),r.SetFileStoreSettings(t)})).then((function(){return null!=n.m_settings.CAs&&"string"==typeof n.m_settings.CAs?r.DownloadData(n.m_settings.CAs,"json"):n.m_settings.CAs})).then((function(t){n.m_settings.CAs=t;var e=r.CreateOCSPAccessInfoModeSettings();return e.SetEnabled(!0),r.SetOCSPAccessInfoModeSettings(e)})).then((function(){for(var t=new Array,e=n.m_settings.CAs,i=0;i<e.length;i++)for(var o=0;o<e[i].issuerCNs.length;o++){var s=r.CreateOCSPAccessInfoSettings();s.SetAddress(e[i].ocspAccessPointAddress),s.SetPort(e[i].ocspAccessPointPort),s.SetIssuerCN(e[i].issuerCNs[o]),t.push(s)}return r.SetOCSPAccessInfoSettings(t)})).then((function(){var t=r.CreateModeSettings();return r.SetModeSettings(t)})).then((function(){return null!=e.CACertificates&&"string"==typeof e.CACertificates?r.DownloadData(e.CACertificates,"binary"):e.CACertificates})).then((function(t){if(null!=e.CACertificates)return r.SaveCertificates(t)})).then((function(){var t=!!e.TSLAddress,n=r.CreateTSLSettings();return n.SetUseTSL(t),n.SetAutoDownloadTSL(!!t),n.SetTSLAddress(t?e.TSLAddress:""),r.SetTSLSettings(n)})).then((function(){return r.SetRuntimeParameter(r.EU_RESOLVE_OIDS_PARAMETER,n.m_resolveOIDs)})).then((function(){if("number"==typeof n.m_settings.connectionTimeout)return r.SetRuntimeParameter(r.EU_CONNECTIONS_TIMEOUT_PARAMETER,n.m_settings.connectionTimeout)})).then((function(){if("number"==typeof e.ocspResponseExpireTime)return r.SetOCSPResponseExpireTime(n.m_settings.ocspResponseExpireTime)})).then((function(){return r.CtxCreate()})).then((function(t){return n.m_context=t,r.CtxSetParameter(t,r.EU_RESOLVE_OIDS_CONTEXT_PARAMETER,n.m_resolveOIDs)})).then((function(){return r.SetRuntimeParameter(r.EU_CHECK_CERT_CHAIN_ON_SIGN_TIME_PARAMETER,!0)})).then((function(){return null!=n.m_settings.signInfoTmpl&&"string"==typeof n.m_settings.signInfoTmpl?r.DownloadData(n.m_settings.signInfoTmpl,""):n.m_settings.signInfoTmpl})).then((function(e){n.m_settings.signInfoTmpl=e,n.m_initialized=!0,t()})).catch((function(t){return i(n.MapError(t))}))}))},e.prototype.SetRuntimeParameter=function(e,n){var r=this,i=r.m_library;return new t((function(t,o){r.CheckInitialize().then((function(){return i.SetRuntimeParameter(e,n)})).then((function(){t()})).catch((function(t){return o(r.MapError(t))}))}))},e.prototype.GetStorageParameter=function(e,n){var r=this,i=r.m_library;return new t((function(t,o){r.CheckInitialize().then((function(){return i.GetStorageParameter(n,e)})).then((function(e){t(e)})).catch((function(t){return o(r.MapError(t))}))}))},e.prototype.SetStorageParameter=function(e,n,r){var i=this,o=i.m_library;return new t((function(t,s){i.CheckInitialize().then((function(){return o.SetStorageParameter(r,e,n)})).then((function(){t()})).catch((function(t){return s(i.MapError(t))}))}))},e.prototype.GetCAs=function(){var e=this;return new t((function(t,n){e.CheckInitialize().then((function(){t(e.m_settings.CAs)})).catch((function(t){return n(e.MapError(t))}))}))},e.prototype.GetProxySettings=function(){var e=this,n=e.m_library;return new t((function(t,r){e.CheckInitialize().then((function(){return n.GetProxySettings()})).then((function(e){var n=l.a.MapToProxySettings(e,new i.b);t(n)})).catch((function(t){return r(e.MapError(t))}))}))},e.prototype.SetProxySettings=function(e){var n=this,r=n.m_library;return new t((function(t,i){n.CheckInitialize().then((function(){var t=l.a.MapFromProxySettings(e,r.CreateProxySettings());return r.SetProxySettings(t)})).then((function(){t()})).catch((function(t){return i(n.MapError(t))}))}))},e.prototype.GetKeyMedias=function(){var e=this,n=e.m_library,r=new Array,i=null;return e.m_settings.allowedKeyMediaDevices&&(i={},e.m_settings.allowedKeyMediaDevices.forEach((function(t){i[t.type]=t.devices}))),new t((function(t,o){e.CheckInitialize().then((function(){return e.BeginKMOperation()})).then((function(){return e.m_kmTypes?e.m_kmTypes:n.GetKeyMediaTypes()})).then((function(t){e.m_kmTypes=t;var i=e.m_settings.allowedKeyMediaTypes;r=new Array;for(var o=0;o<t.length;o++){var s=t[o];(!i||i.indexOf(s)>=0)&&r.push(o)}return n.GetKeyMediaDevices(r)})).then((function(n){for(var o=new Array,s=0;s<n.length;s++)for(var a=r[s],c=e.m_kmTypes[a],l=n[s],f=i&&i[c]?i[c]:null,p=0;p<l.length;p++)if(!f||-1!=f.indexOf(l[p])){var _=new u.EndUserKeyMedia;_.typeIndex=a,_.devIndex=p,_.password=null,_.type=c,_.device=l[p],_.visibleName=_.device+"("+_.type+")",o.push(_)}e.EndKMOperation(),t(o)})).catch((function(t){e.EndKMOperation(),o(e.MapError(t))}))}))},e.prototype.GetJKSPrivateKeys=function(e){var n=this;return new t((function(t,r){n.CheckInitialize().then((function(){var i=new Array,o=function(s){n.GetJKSPrivateKey(e,s).then((function(e){e?(i.push(e),o(s+1)):t(i)})).catch((function(t){return r(n.MapError(t))}))};o(0)})).catch((function(t){return r(n.MapError(t))}))}))},e.prototype.IsPrivateKeyReaded=function(){var e=this;return new t((function(t,n){e.CheckInitialize().then((function(){t(null!=e.m_pkContext)})).catch((function(t){return n(e.MapError(t))}))}))},e.prototype.ResetPrivateKey=function(){var e=this;return new t((function(t,n){e.CheckInitialize().then((function(){return e.ResetPrivateKeyInternal()})).then((function(){t()})).catch((function(t){return n(e.MapError(t))}))}))},e.prototype.ResetOperationKSP=function(){var e=this,n=this.m_library;return new t((function(t,i){e.CheckInitialize().then((function(){throw n.MakeError(r.EU_ERROR_NOT_SUPPORTED,"")})).catch((function(t){return i(e.MapError(t))}))}))},e.prototype.ReadPrivateKey=function(e,n,r){var i=this,o=this.m_library;return new t((function(t,s){i.CheckInitialize().then((function(){i.BeginKMOperation()})).then((function(){var t=l.a.MapFromKeyMedia(e,o.CreateKeyMedia());return i.ReadPrivateKeyInternal(null,null,t,n,r)})).then((function(e){i.EndKMOperation(),t(e)})).catch((function(t){i.EndKMOperation(),s(i.MapError(t))}))}))},e.prototype.ReadPrivateKeyBinary=function(e,n,r,i){var o=this;return new t((function(t,s){o.CheckInitialize().then((function(){return o.ReadPrivateKeyInternal(e,n,null,r,i)})).then((function(e){t(e)})).catch((function(t){return s(o.MapError(t))}))}))},e.prototype.ReadPrivateKeySIM=function(e,n,i,o){var s=this,a=this.m_library;return new t((function(t,e){s.CheckInitialize().then((function(){throw a.MakeError(r.EU_ERROR_NOT_SUPPORTED,"")})).catch((function(t){return e(s.MapError(t))}))}))},e.prototype.ReadPrivateKeyKSP=function(e,n,i,o){var s=this,a=this.m_library;return new t((function(t,e){s.CheckInitialize().then((function(){throw a.MakeError(r.EU_ERROR_NOT_SUPPORTED,"")})).catch((function(t){return e(s.MapError(t))}))}))},e.prototype.GetOwnCertificates=function(){return this.CtxGetOwnCertificates(this.m_pkContext)},e.prototype.GetOwnEUserParams=function(){var e=this,n=e.m_library;return new t((function(t,i){e.CheckInitialize().then((function(){if(null==e.m_pkContext)throw n.MakeError(r.EU_ERROR_BAD_CERT,"");return n.CtxGetOwnEUserParams(e.m_pkContext)})).then((function(e){var n=l.a.MapToEndUserParams(e,new h.a);t(n)})).catch((function(t){return i(e.MapError(t))}))}))},e.prototype.ChangeOwnCertificatesStatus=function(e,n){var i=this,o=i.m_library;return new t((function(t,s){i.CheckInitialize().then((function(){if(null==i.m_pkContext)throw o.MakeError(r.EU_ERROR_BAD_CERT,"");return o.CtxChangeOwnCertificatesStatus(i.m_pkContext,e,n)})).then((function(){t()})).catch((function(t){return s(i.MapError(t))}))}))},e.prototype.MakeNewCertificate=function(e,n,i,o,s,a,u,c,f,p,_,h,E,y,S,C,d,R){void 0===C&&(C=!1),void 0===d&&(d=null),void 0===R&&(R=null);var m=this,A=m.m_library,P={key:null,certs:null};return new t((function(g,T){m.CheckInitialize().then((function(){if(null!=d||null!=R)throw A.MakeError(r.EU_ERROR_NOT_SUPPORTED,"");return m.BeginKMOperation()})).then((function(){var t=null;return null!=e&&(t=l.a.MapFromKeyMedia(e,A.CreateKeyMedia())),C?null:m.ReadPrivateKeyInternal(n,i,t,null,y)})).then((function(t){return S&&!C?A.CtxGetOwnEUserParams(m.m_pkContext):null})).then((function(t){return S?A.CtxModifyOwnEUserParams(m.m_pkContext,S.phone,S.EMail):null})).then((function(){return C?null:m.ResetPrivateKeyInternal()})).then((function(){if(C)return new t((function(t,n){A.CtxMakeNewOwnCertificate(m.m_pkContext,o,s,a,u,c,f,p,_).then((function(){return m.ResetPrivateKeyInternal()})).then((function(){var t=l.a.MapFromKeyMedia(e,A.CreateKeyMedia());return h&&h.password!=e.password?A.ChangePrivateKeyPassword(t,h.password):null})).then((function(){t(null)})).catch((function(t){n(m.MapError(t))}))}));var r=null,y=null;return e&&(r=l.a.MapFromKeyMedia(e,A.CreateKeyMedia())),h&&(y=l.a.MapFromKeyMedia(h,A.CreateKeyMedia())),A.MakeNewCertificate(r,n,i,o,s,a,u,c,f,p,_,y,E)})).then((function(t){P.key=t;var n=null;return(C&&e||h)&&(n=l.a.MapFromKeyMedia(h||e,A.CreateKeyMedia())),m.SearchPrivateKeyCertificatesWithCMP(t,E,n,y)})).then((function(t){return m.GetUserCertificatesFromCertificates(t.certs)})).then((function(t){m.EndKMOperation(),P.certs=t,g(P)})).catch((function(t){m.EndKMOperation(),T(m.MapError(t))}))}))},e.prototype.MakeDeviceCertificate=function(e,n,i,o,s){var a=this,c=a.m_library;return new t((function(p,_){a.CheckInitialize().then((function(){if(null==a.m_pkContext)throw c.MakeError(r.EU_ERROR_BAD_CERT,"");var t=a.m_pkContext.GetOwnerInfo(),u=a.GetCASettings(t.GetIssuerCN());if(!u||!u.cmpAddress||""==u.cmpAddress)throw c.MakeError(r.EU_ERROR_BAD_PARAMETER,"");return c.CtxMakeDeviceCertificate(a.m_pkContext,e,n,i,o,s,u.cmpAddress,"80")})).then((function(e){return a.ProcessArray(e,(function(e){return new t((function(t,n){c.ParseCertificateEx(e).then((function(n){var r=new u.EndUserCertificate;r.data=e,r.infoEx=l.a.MapToEndUserCertificateInfoEx(n,new f.a),t(r)})).catch((function(t){return n(t)}))}))}))})).then((function(t){p(t)})).catch((function(t){a.EndKMOperation(),_(a.MapError(t))}))}))},e.prototype.ChangePrivateKeyPassword=function(e,n){var r=this,i=r.m_library;return new t((function(t,o){r.CheckInitialize().then((function(){return r.BeginKMOperation()})).then((function(){var t=l.a.MapFromKeyMedia(e,i.CreateKeyMedia());return r.m_library.ChangePrivateKeyPassword(t,n)})).then((function(){r.EndKMOperation(),t()})).catch((function(t){r.EndKMOperation(),o(r.MapError(t))}))}))},e.prototype.ChangePrivateKeyPasswordBinary=function(e,n,r){var i=this,o=i.m_library;return new t((function(t,s){i.CheckInitialize().then((function(){return o.ChangeSoftwarePrivateKeyPassword(e,n,r)})).then((function(e){t(e),t()})).catch((function(t){s(i.MapError(t))}))}))},e.prototype.GeneratePrivateKey=function(e,n,r,i,o,s,a,u,c,f,p,_){var h=this,E=h.m_library;return new t((function(t,y){h.CheckInitialize().then((function(){return h.BeginKMOperation()})).then((function(){var t=null;return e&&(t=l.a.MapFromKeyMedia(e,E.CreateKeyMedia())),h.GeneratePrivateKeyInternal(t,n,null,r,i,o,s,a,u,c,f,p,_)})).then((function(e){h.EndKMOperation(),t(e)})).catch((function(t){h.EndKMOperation(),y(h.MapError(t))}))}))},e.prototype.GeneratePrivateKeyBinary=function(e,n,r,i,o,s,a,u,c,l,f){var p=this;return new t((function(t,_){p.CheckInitialize().then((function(){return p.BeginKMOperation()})).then((function(){return p.GeneratePrivateKeyInternal(null,!1,e,n,r,i,o,s,a,u,c,l,f)})).then((function(e){p.EndKMOperation(),t(e)})).catch((function(t){p.EndKMOperation(),_(p.MapError(t))}))}))},e.prototype.GetKeyInfo=function(e){var n=this,r=n.m_library;return new t((function(t,i){n.CheckInitialize().then((function(){return n.BeginKMOperation()})).then((function(){var t=l.a.MapFromKeyMedia(e,r.CreateKeyMedia());return r.GetKeyInfo(t)})).then((function(e){n.EndKMOperation(),t(e.GetPrivateKeyInfo())})).catch((function(t){n.EndKMOperation(),i(n.MapError(t))}))}))},e.prototype.GetKeyInfoBinary=function(e,n){var r=this,i=r.m_library;return new t((function(t,o){r.CheckInitialize().then((function(){return i.GetKeyInfoBinary(e,n)})).then((function(e){t(e.GetPrivateKeyInfo())})).catch((function(t){o(r.MapError(t))}))}))},e.prototype.GetClientRegistrationTokenKSP=function(e){var n=this,i=n.m_library;return new t((function(t,e){n.CheckInitialize().then((function(){throw i.MakeError(r.EU_ERROR_NOT_SUPPORTED,"")})).catch((function(t){e(n.MapError(t))}))}))},e.prototype.HashData=function(e,n,r){var i=this,o=this.m_library,s=i.DataToNamedDataArray(n);return new t((function(a,u){i.CheckInitialize().then((function(){return i.ProcessArray(s,(function(n){return new t((function(t,s){o.CtxHash(i.m_context,e,null,n.val).then((function(t){return r?t:o.BASE64Decode(t)})).then((function(e){t(e)})).catch((function(t){return s(t)}))}))}))})).then((function(t){var e=i.DataToResult(n,t);a(e)})).catch((function(t){u(i.MapError(t))}))}))},e.prototype.GetSigner=function(e,n,r){void 0===n&&(n=-1),void 0===r&&(r=!1);var i=this,o=this.m_library,s={context:null,signersInfo:null};return new t((function(a,c){i.CheckInitialize().then((function(){return o.CtxCreate()})).then((function(t){return s.context=t,o.CtxSetParameter(t,o.EU_RESOLVE_OIDS_CONTEXT_PARAMETER,r)})).then((function(){return-1==n?o.GetSignsCount(e):1})).then((function(r){var a=new Array;if(-1!=n)a.push(n);else for(var c=0;c<r;c++)a.push(c);return i.ProcessArray(a,(function(n){return new t((function(t,r){var a=new u.EndUserCertificate;o.CtxGetSignerInfo(s.context,n,e).then((function(e){l.a.MapToEndUserCertificate(e,a),t(a)})).catch((function(t){return r(i.MapError(t))}))}))}))})).then((function(t){return s.signersInfo=t,o.CtxFree(s.context)})).then((function(){s.context=null,a(-1!=n?s.signersInfo[0]:s.signersInfo)})).catch((function(t){s.context?o.CtxFree(s.context).then((function(){c(i.MapError(t))})).catch((function(){c(i.MapError(t))})):c(i.MapError(t))}))}))},e.prototype.SignData=function(t,e){return void 0===e&&(e=!1),this.SignDataEx(p.EndUserSignAlgo.DSTU4145WithGOST34311,t,!0,!0,e)},e.prototype.SignDataInternal=function(t,e,n){return void 0===n&&(n=!1),this.SignDataEx(p.EndUserSignAlgo.DSTU4145WithGOST34311,e,!1,t,n)},e.prototype.SignHash=function(t,e,n,r){return this.CtxSignHashInternal(this.m_pkContext,t,e,null,n,r)},e.prototype.SignDataEx=function(t,e,n,r,i){return this.CtxSignDataInternal(this.m_pkContext,t,e,null,n,r,i)},e.prototype.AppendSign=function(t,e,n,r,i){return this.CtxSignDataInternal(this.m_pkContext,t,e,n,null!=e,r,i)},e.prototype.AppendSignHash=function(t,e,n,r,i){return this.CtxSignHashInternal(this.m_pkContext,t,e,n,r,i)},e.prototype.VerifyHash=function(e,n,r){void 0===r&&(r=-1);var i=this,o=this.m_library;return new t((function(s,a){i.CheckInitialize().then((function(){return-1==r?o.GetSignsCount(n):1})).then((function(s){var a=new Array;if(-1!=r)a.push(r);else for(var u=0;u<s;u++)a.push(u);return i.ProcessArray(a,(function(r){return new t((function(t,s){var a=new S.a;o.VerifyHashOnTimeEx(e,r,n,null,!1,!1).then((function(t){return l.a.MapToEndUserSignInfo(t,a),o.GetSignTimeInfo(r,n)})).then((function(t){return a.timeInfo=l.a.MapToEndUserTimeInfo(t,new d.a),o.GetSignType(r,n)})).then((function(e){a.signLevel=e,t(a)})).catch((function(t){return s(i.MapError(t))}))}))}))})).then((function(t){s(-1!=r?t[0]:t)})).catch((function(t){return a(i.MapError(t))}))}))},e.prototype.VerifyData=function(e,n,r){void 0===r&&(r=-1);var i=this,o=this.m_library;return new t((function(s,a){i.CheckInitialize().then((function(){return-1==r?o.GetSignsCount(n):1})).then((function(s){var a=new Array;if(-1!=r)a.push(r);else for(var u=0;u<s;u++)a.push(u);return i.ProcessArray(a,(function(r){return new t((function(t,s){var a=new S.a;o.VerifyDataOnTimeEx(e,r,n,null,!1,!1).then((function(t){return l.a.MapToEndUserSignInfo(t,a),o.GetSignTimeInfo(r,n)})).then((function(t){return a.timeInfo=l.a.MapToEndUserTimeInfo(t,new d.a),o.GetSignType(r,n)})).then((function(e){a.signLevel=e,t(a)})).catch((function(t){return s(i.MapError(t))}))}))}))})).then((function(t){s(-1!=r?t[0]:t)})).catch((function(t){return a(i.MapError(t))}))}))},e.prototype.VerifyDataInternal=function(e,n){void 0===n&&(n=-1);var r=this,i=this.m_library;return new t((function(o,s){r.CheckInitialize().then((function(){return-1==n?i.GetSignsCount(e):1})).then((function(o){var s=new Array;if(-1!=n)s.push(n);else for(var a=0;a<o;a++)s.push(a);return r.ProcessArray(s,(function(n){return new t((function(t,o){var s=new S.a;i.VerifyDataInternalOnTimeEx(e,n,null,!1,!1).then((function(t){return l.a.MapToEndUserSignInfo(t,s),i.GetSignTimeInfo(n,e)})).then((function(t){return s.timeInfo=l.a.MapToEndUserTimeInfo(t,new d.a),i.GetSignType(n,e)})).then((function(e){s.signLevel=e,t(s)})).catch((function(t){return o(r.MapError(t))}))}))}))})).then((function(t){o(-1!=n?t[0]:t)})).catch((function(t){return s(r.MapError(t))}))}))},e.prototype.EnvelopData=function(e,n,i,o,s,a){void 0===a&&(a=!1);var u=this,c=this.m_library;return new t((function(t,l){u.CheckInitialize().then((function(){if(null==u.m_pkContext&&(!a||i))throw c.MakeError(r.EU_ERROR_BAD_CERT,"");var t=c.EU_RECIPIENT_APPEND_TYPE_BY_ISSUER_SERIAL;return a?i?c.CtxEnvelopWithDynamicKey(u.m_pkContext,e,t,i,o,n):c.EnvelopToRecipientsWithDynamicKey(e,i,o,n):c.CtxEnvelop(u.m_pkContext,e,t,i,o,n)})).then((function(t){return s?t:c.BASE64Decode(t)})).then((function(e){t(e)})).catch((function(t){return l(u.MapError(t))}))}))},e.prototype.DevelopData=function(e,n){var i=this,o=this.m_library;return new t((function(t,s){i.CheckInitialize().then((function(){if(null==i.m_pkContext)throw o.MakeError(r.EU_ERROR_BAD_CERT,"");return o.CtxDevelop(i.m_pkContext,e,n)})).then((function(e){var n=l.a.MapToEndUserSenderInfo(e,new C.a);t(n)})).catch((function(t){return s(i.MapError(t))}))}))},e.prototype.ProtectDataByPassword=function(e,n,r){var i=this,o=this.m_library;return new t((function(t,s){i.CheckInitialize().then((function(){return o.ProtectDataByPassword(e,n)})).then((function(t){return r?t:o.BASE64Decode(t)})).then((function(e){t(e)})).catch((function(t){return s(i.MapError(t))}))}))},e.prototype.UnprotectDataByPassword=function(e,n,r){var i=this,o=this.m_library;return new t((function(t,s){i.CheckInitialize().then((function(){return o.UnprotectDataByPassword(e,n)})).then((function(t){return r?o.BytesToString(t):t})).then((function(e){t(e)})).catch((function(t){return s(i.MapError(t))}))}))},e.prototype.CreateAuthData=function(e,n,i){var o=this,s=this.m_library;return new t((function(t,a){o.CheckInitialize().then((function(){if(null==o.m_pkContext)throw s.MakeError(r.EU_ERROR_BAD_CERT,"");return s.CtxCreateAuthData(o.m_pkContext,e,n)})).then((function(t){return i?t:s.BASE64Decode(t)})).then((function(e){t(e)})).catch((function(t){return a(o.MapError(t))}))}))},e.prototype.GetTSPByAccessInfo=function(e,n,r,i,o){var s=this,a=this.m_library;return new t((function(t,u){s.CheckInitialize().then((function(){return a.GetTSPByAccessInfo(e,n,r,i)})).then((function(t){return o?a.BASE64Encode(t):t})).then((function(e){t(e)})).catch((function(t){return u(s.MapError(t))}))}))},e.prototype.CheckTSP=function(e,n,r){var i=this,o=this.m_library;return new t((function(t,s){i.CheckInitialize().then((function(){return o.CheckTSP(e,n,r)})).then((function(){t()})).catch((function(t){return s(i.MapError(t))}))}))},e.prototype.CtxCreate=function(){var e=this,n=this.m_library,r={context:null};return new t((function(t,i){e.CheckInitialize().then((function(){return n.CtxCreate()})).then((function(t){return r.context=t,n.CtxSetParameter(t,n.EU_RESOLVE_OIDS_CONTEXT_PARAMETER,e.m_resolveOIDs)})).then((function(){t(r.context)})).catch((function(t){return i(e.MapError(t))}))}))},e.prototype.CtxFree=function(e){var n=this,r=this.m_library;return new t((function(t,i){n.CheckInitialize().then((function(){r.CtxFree(e)})).then((function(){t()})).catch((function(t){return i(n.MapError(t))}))}))},e.prototype.CtxSetParameter=function(e,n,r){var i=this,o=i.m_library;return new t((function(t,s){i.CheckInitialize().then((function(){return null==e&&(e=i.m_context),o.CtxSetParameter(e,n,r)})).then((function(){t()})).catch((function(t){i.EndKMOperation(),s(i.MapError(t))}))}))},e.prototype.CtxReadPrivateKey=function(e,n,r,i){var o=this,s=o.m_library;return new t((function(t,a){o.CheckInitialize().then((function(){return o.BeginKMOperation()})).then((function(){var t=l.a.MapFromKeyMedia(n,s.CreateKeyMedia());return o.CtxReadPrivateKeyInternal(e,null,null,t,r,i)})).then((function(e){o.EndKMOperation(),t(e)})).catch((function(t){o.EndKMOperation(),a(o.MapError(t))}))}))},e.prototype.CtxReadPrivateKeyBinary=function(e,n,r,i,o){var s=this;return new t((function(t,a){s.CheckInitialize().then((function(){return s.CtxReadPrivateKeyInternal(e,n,r,null,i,o)})).then((function(e){t(e)})).catch((function(t){return a(s.MapError(t))}))}))},e.prototype.CtxFreePrivateKey=function(e){var n=this,r=this.m_library;return new t((function(t,i){n.CheckInitialize().then((function(){return r.CtxFreePrivateKey(e)})).then((function(){t()})).catch((function(t){return i(n.MapError(t))}))}))},e.prototype.CtxGetOwnCertificates=function(e){var n=this,i=this.m_library;return new t((function(t,o){n.CheckInitialize().then((function(){if(null==e)throw i.MakeError(r.EU_ERROR_BAD_CERT,"");var s=new Array,a=function(r){i.CtxEnumOwnCertificates(e,r).then((function(e){if(e){var n=l.a.MapToEndUserCertificate(e,new u.EndUserCertificate);s.push(n),a(r+1)}else t(s)})).catch((function(t){return o(n.MapError(t))}))};a(0)})).catch((function(t){return o(n.MapError(t))}))}))},e.prototype.CtxSignHash=function(t,e,n,r,i){return this.CtxSignHashInternal(t,e,n,null,r,i)},e.prototype.CtxSignData=function(t,e,n,r,i,o){return this.CtxSignDataInternal(t,e,n,null,r,i,o)},e.prototype.CtxAppendSignHash=function(t,e,n,r,i,o){return this.CtxSignHashInternal(t,e,n,r,i,o)},e.prototype.CtxAppendSign=function(t,e,n,r,i,o){return this.CtxSignDataInternal(t,e,n,r,null!=n,i,o)},e.prototype.CtxEnvelopData=function(e,n,i,o,s,a,u){var c=this,l=this.m_library;return new t((function(t,f){c.CheckInitialize().then((function(){if(null==e&&(!u||o))throw l.MakeError(r.EU_ERROR_BAD_CERT,"");var t=l.EU_RECIPIENT_APPEND_TYPE_BY_ISSUER_SERIAL;return u?o?l.CtxEnvelopWithDynamicKey(e,n,t,o,s,i):l.EnvelopToRecipientsWithDynamicKey(n,o,s,i):l.CtxEnvelop(e,n,t,o,s,i)})).then((function(t){return a?t:l.BASE64Decode(t)})).then((function(e){t(e)})).catch((function(t){return f(c.MapError(t))}))}))},e.prototype.CtxDevelopData=function(e,n,i){var o=this,s=this.m_library;return new t((function(t,a){o.CheckInitialize().then((function(){if(null==e)throw s.MakeError(r.EU_ERROR_BAD_CERT,"");return s.CtxDevelop(e,n,i)})).then((function(e){var n=l.a.MapToEndUserSenderInfo(e,new C.a);t(n)})).catch((function(t){return a(o.MapError(t))}))}))},e.prototype.ProtectTaxReports=function(e,n,r,i,o,s,a){void 0===e&&(e=null),void 0===n&&(n=null),void 0===r&&(r=null),void 0===a&&(a=!1);var u=this;return new t((function(t,c){var l={accountant:null,director:null,stamp:null};u.CheckInitialize().then((function(){var t=[p.EndUserKeyUsage.DigitalSignature];return null!=e?u.LoadTaxReportPKey(e,t,!1):null})).then((function(t){l.accountant=t;var e=[p.EndUserKeyUsage.DigitalSignature];return r||e.push(p.EndUserKeyUsage.KeyAgreement),null!=n?u.LoadTaxReportPKey(n,e,!1):null})).then((function(t){l.director=t;var e=[p.EndUserKeyUsage.DigitalSignature,p.EndUserKeyUsage.KeyAgreement];return null!=r?u.LoadTaxReportPKey(r,e,!0):null})).then((function(t){return l.stamp=t,u.ProcessArray(s,(function(t){return u.ProtectTaxReport(l.accountant,l.director,l.stamp,i,o,t,a)}))})).then((function(e){t(e)})).catch((function(t){return c(u.MapError(t))}))}))},e.prototype.UnprotectTaxReceipts=function(e,n){var r=this;return new t((function(t,i){r.CheckInitialize().then((function(){return r.ProcessArray(n,(function(t){return r.UnprotectTaxReceipt(e,t)}))})).then((function(e){t(e)})).catch((function(t){return i(r.MapError(t))}))}))},e.prototype.ASiCGetSigner=function(e,n,r){void 0===n&&(n=-1),void 0===r&&(r=!1);var i=this,o=this.m_library,s={context:null,signersInfo:null};return new t((function(a,c){i.CheckInitialize().then((function(){return o.CtxCreate()})).then((function(t){return s.context=t,o.CtxSetParameter(t,o.EU_RESOLVE_OIDS_CONTEXT_PARAMETER,r)})).then((function(){return-1==n?o.ASiCGetSignsCount(e):1})).then((function(r){var a=new Array;if(-1!=n)a.push(n);else for(var c=0;c<r;c++)a.push(c);return i.ProcessArray(a,(function(n){return new t((function(t,r){var a=new u.EndUserCertificate;o.CtxASiCGetSignerInfo(s.context,n,e).then((function(e){l.a.MapToEndUserCertificate(e,a),t(a)})).catch((function(t){return r(i.MapError(t))}))}))}))})).then((function(t){return s.signersInfo=t,o.CtxFree(s.context)})).then((function(){a(-1!=n?s.signersInfo[0]:s.signersInfo)})).catch((function(t){s.context&&o.CtxFree(s.context).then((function(){c(i.MapError(t))})).catch((function(){c(i.MapError(t))}))}))}))},e.prototype.ASiCSignData=function(e,n,i,o,s,a){var u=this,c=this,l=this.m_library;return new t((function(t,f){c.CheckInitialize().then((function(){if(null==u.m_pkContext)throw l.MakeError(r.EU_ERROR_BAD_CERT,"");for(var t=[],a=0;a<s.length;a++){var c=l.CreateReference(s[a].name,s[a].val);t.push(c)}return l.CtxASiCSign(u.m_pkContext,e,n,i,o,t)})).then((function(t){return a?t:l.BASE64Decode(t)})).then((function(e){var r={name:s[0].name+(n==p.EndUserASiCType.S?".asics":".asice"),val:e};t(r)})).catch((function(t){return f(c.MapError(t))}))}))},e.prototype.ASiCAppendSign=function(e,n,i,o,s){var a=this,u=this,c=this.m_library,l=u.DataToNamedDataArray(o);return new t((function(t,o){u.CheckInitialize().then((function(){if(null==a.m_pkContext)throw c.MakeError(r.EU_ERROR_BAD_CERT,"");return c.CtxASiCAppendSign(a.m_pkContext,e,n,i,l[0].val)})).then((function(t){return s?t:c.BASE64Decode(t)})).then((function(e){var n={name:l[0].name,val:e};t(n)})).catch((function(t){return o(u.MapError(t))}))}))},e.prototype.ASiCVerifyData=function(e,n){void 0===n&&(n=-1);var r=this,i=this.m_library;return new t((function(o,s){r.CheckInitialize().then((function(){return-1==n?i.ASiCGetSignsCount(e):1})).then((function(o){var s=new Array;if(-1!=n)s.push(n);else for(var a=0;a<o;a++)s.push(a);return r.ProcessArray(s,(function(n){return new t((function(t,o){var s=new S.a;i.ASiCVerify(n,e).then((function(t){return l.a.MapToEndUserSignInfo(t,s),i.ASiCGetSignTimeInfo(n,e)})).then((function(t){return s.timeInfo=l.a.MapToEndUserTimeInfo(t,new d.a),i.ASiCGetSignLevel(n,e)})).then((function(e){s.signLevel=e,t(s)})).catch((function(t){return o(r.MapError(t))}))}))}))})).then((function(t){o(-1!=n?t[0]:t)})).catch((function(t){return s(r.MapError(t))}))}))},e.prototype.PDFGetSigner=function(e,n,r){void 0===n&&(n=-1),void 0===r&&(r=!1);var i=this,o=this.m_library,s={context:null,signersInfo:null};return new t((function(a,c){i.CheckInitialize().then((function(){return o.CtxCreate()})).then((function(t){return s.context=t,o.CtxSetParameter(t,o.EU_RESOLVE_OIDS_CONTEXT_PARAMETER,r)})).then((function(){return-1==n?o.PDFGetSignsCount(e):1})).then((function(r){var a=new Array;if(-1!=n)a.push(n);else for(var c=0;c<r;c++)a.push(c);return i.ProcessArray(a,(function(n){return new t((function(t,r){var a=new u.EndUserCertificate;o.CtxPDFGetSignerInfo(s.context,n,e).then((function(e){l.a.MapToEndUserCertificate(e,a),t(a)})).catch((function(t){return r(i.MapError(t))}))}))}))})).then((function(t){return s.signersInfo=t,o.CtxFree(s.context)})).then((function(){a(-1!=n?s.signersInfo[0]:s.signersInfo)})).catch((function(t){s.context&&o.CtxFree(s.context).then((function(){c(i.MapError(t))})).catch((function(){c(i.MapError(t))}))}))}))},e.prototype.PDFSignData=function(e,n,i,o){var s=this,a=this,u=this.m_library,c=a.DataToNamedDataArray(n);return new t((function(l,f){a.CheckInitialize().then((function(){if(null==s.m_pkContext)throw u.MakeError(r.EU_ERROR_BAD_CERT,"");return a.ProcessArray(c,(function(n){return new t((function(t,r){return u.CtxPDFSign(s.m_pkContext,e,n.val,i).then((function(t){return o?t:u.BASE64Decode(t)})).then((function(e){t(e)})).catch((function(t){return r(t)}))}))}))})).then((function(t){var e=s.DataToResult(n,t);l(e)})).catch((function(t){return f(a.MapError(t))}))}))},e.prototype.PDFVerifyData=function(e,n){void 0===n&&(n=-1);var r=this,i=this.m_library;return new t((function(o,s){r.CheckInitialize().then((function(){return-1==n?i.PDFGetSignsCount(e):1})).then((function(o){var s=new Array;if(-1!=n)s.push(n);else for(var a=0;a<o;a++)s.push(a);return r.ProcessArray(s,(function(n){return new t((function(t,o){var s=new S.a;i.PDFVerify(n,e).then((function(t){return l.a.MapToEndUserSignInfo(t,s),i.PDFGetSignTimeInfo(n,e)})).then((function(t){return s.timeInfo=l.a.MapToEndUserTimeInfo(t,new d.a),i.PDFGetSignType(n,e)})).then((function(e){s.signLevel=e,t(s)})).catch((function(t){return o(r.MapError(t))}))}))}))})).then((function(t){o(-1!=n?t[0]:t)})).catch((function(t){return s(r.MapError(t))}))}))},e.prototype.XAdESGetSigner=function(e,n,r){void 0===n&&(n=-1),void 0===r&&(r=!1);var i=this,o=this.m_library,s={context:null,signersInfo:null};return new t((function(a,c){i.CheckInitialize().then((function(){return o.CtxCreate()})).then((function(t){return s.context=t,o.CtxSetParameter(t,o.EU_RESOLVE_OIDS_CONTEXT_PARAMETER,r)})).then((function(){return-1==n?o.XAdESGetSignsCount(e):1})).then((function(r){var a=new Array;if(-1!=n)a.push(n);else for(var c=0;c<r;c++)a.push(c);return i.ProcessArray(a,(function(n){return new t((function(t,r){var a=new u.EndUserCertificate;o.CtxXAdESGetSignerInfo(s.context,n,e).then((function(e){l.a.MapToEndUserCertificate(e,a),t(a)})).catch((function(t){return r(i.MapError(t))}))}))}))})).then((function(t){return s.signersInfo=t,o.CtxFree(s.context)})).then((function(){a(-1!=n?s.signersInfo[0]:s.signersInfo)})).catch((function(t){s.context&&o.CtxFree(s.context).then((function(){c(i.MapError(t))})).catch((function(){c(i.MapError(t))}))}))}))},e.prototype.XAdESSignData=function(e,n,i,o,s){var a=this,u=this,c=this.m_library;return new t((function(t,l){u.CheckInitialize().then((function(){if(null==a.m_pkContext)throw c.MakeError(r.EU_ERROR_BAD_CERT,"");for(var t=[],s=0;s<o.length;s++){var u=c.CreateReference(o[s].name,o[s].val);t.push(u)}return c.CtxXAdESSign(a.m_pkContext,e,n,i,t)})).then((function(t){return s?t:c.BASE64Decode(t)})).then((function(e){var n={name:o[0].name+(o[0].name.endsWith(".xml")?"":".xml"),val:e};t(n)})).catch((function(t){return l(u.MapError(t))}))}))},e.prototype.XAdESVerifyData=function(e,n,r){void 0===r&&(r=-1);var i=this,o=this.m_library;return new t((function(s,a){i.CheckInitialize().then((function(){return-1==r?o.XAdESGetSignsCount(n):1})).then((function(s){var a=new Array;if(-1!=r)a.push(r);else for(var u=0;u<s;u++)a.push(u);var c=null;if(null!=e){c=[];for(u=0;u<e.length;u++){var f=o.CreateReference(e[u].name,e[u].val);c.push(f)}}return i.ProcessArray(a,(function(e){return new t((function(t,r){var s=new S.a;o.XAdESVerify(c,e,n).then((function(t){return l.a.MapToEndUserSignInfo(t,s),o.XAdESGetSignTimeInfo(e,n)})).then((function(t){return s.timeInfo=l.a.MapToEndUserTimeInfo(t,new d.a),o.XAdESGetSignLevel(e,n)})).then((function(e){s.signLevel=e,t(s)})).catch((function(t){return r(i.MapError(t))}))}))}))})).then((function(t){s(-1!=r?t[0]:t)})).catch((function(t){return a(i.MapError(t))}))}))},e.prototype.GetSignContainerInfo=function(e){var n=this,r=this.m_library,i=(new y.a,function(e){var n=new y.a;return new t((function(t,i){r.IsDataInSignedDataAvailable(e).then((function(e){n.type=p.EndUserSignContainerType.CAdES,n.subType=e?p.EndUserCAdESType.Enveloped:p.EndUserCAdESType.Detached,t(n)})).catch((function(e){t(null)}))}))}),o=function(e){var n=new y.a;return new t((function(t,i){r.XAdESGetType(e).then((function(e){n.type=p.EndUserSignContainerType.XAdES,n.subType=e,t(n)})).catch((function(e){t(null)}))}))},s=function(e){var n=new y.a;return new t((function(t,i){r.PDFGetSignsCount(e).then((function(e){n.type=p.EndUserSignContainerType.PAdES,t(n)})).catch((function(e){t(null)}))}))},a=function(e){var n=new y.a;return new t((function(t,i){r.ASiCGetASiCType(e).then((function(t){return n.type=p.EndUserSignContainerType.ASiC,n.subType=t,r.ASiCGetSignType(e)})).then((function(e){n.asicSignType=e,t(n)})).catch((function(e){t(null)}))}))};return new t((function(u,c){n.CheckInitialize().then((function(){return"string"==typeof e?r.BASE64Decode(e):e})).then((function(e){var n=[],r=function(t,e){if(t.length<e.length)return!1;for(var n=0;n<e.length;n++)if(t[n]!=e[n])return!1;return!0};return n=r(e,[60,63,120,109,108])?[o,i,s,a]:r(e,[37,80,68,70])?[s,i,o,a]:r(e,[80,75])?[a,i,o,s]:[i,o,s,a],new t((function(t,r){var i=function(o){o>=n.length?t(new y.a):n[o](e).then((function(e){null!=e?t(e):i(o+1)})).catch((function(t){return r(t)}))};i(0)}))})).then((function(t){u(t)})).catch((function(t){return c(n.MapError(t))}))}))},e}();e.a=m}).call(this,n(17).Promise)},function(t,e,n){"use strict";(function(t){var r=n(3),i=function(){function e(){this.EU_SUBJECT_TYPE_UNDIFFERENCED=0,this.EU_SUBJECT_TYPE_CA=1,this.EU_SUBJECT_TYPE_CA_SERVER=2,this.EU_SUBJECT_TYPE_RA_ADMINISTRATOR=3,this.EU_SUBJECT_TYPE_END_USER=4,this.EU_SUBJECT_CA_SERVER_SUB_TYPE_UNDIFFERENCED=0,this.EU_SUBJECT_CA_SERVER_SUB_TYPE_CMP=1,this.EU_SUBJECT_CA_SERVER_SUB_TYPE_TSP=2,this.EU_SUBJECT_CA_SERVER_SUB_TYPE_OCSP=3,this.EU_CERT_KEY_TYPE_UNKNOWN=0,this.EU_CERT_KEY_TYPE_DSTU4145=1,this.EU_CERT_KEY_TYPE_RSA=2,this.EU_CERT_KEY_TYPE_ECDSA=4,this.EU_KEY_USAGE_UNKNOWN=0,this.EU_KEY_USAGE_DIGITAL_SIGNATURE=1,this.EU_KEY_USAGE_KEY_AGREEMENT=16,this.EU_KEYS_REQUEST_TYPE_UA_DS=1,this.EU_KEYS_REQUEST_TYPE_UA_KEP=2,this.EU_KEYS_REQUEST_TYPE_INTERNATIONAL=3,this.EU_KEYS_TYPE_NONE=0,this.EU_KEYS_TYPE_DSTU_AND_ECDH_WITH_GOSTS=1,this.EU_KEYS_TYPE_RSA_WITH_SHA=2,this.EU_KEYS_LENGTH_DS_UA_191=1,this.EU_KEYS_LENGTH_DS_UA_257=2,this.EU_KEYS_LENGTH_DS_UA_307=3,this.EU_KEYS_LENGTH_DS_UA_FILE=4,this.EU_KEYS_LENGTH_DS_UA_CERT=5,this.EU_KEYS_LENGTH_KEP_UA_257=1,this.EU_KEYS_LENGTH_KEP_UA_431=2,this.EU_KEYS_LENGTH_KEP_UA_571=3,this.EU_KEYS_LENGTH_KEP_UA_FILE=4,this.EU_KEYS_LENGTH_KEP_UA_CERT=5,this.EU_KEYS_LENGTH_DS_RSA_1024=1,this.EU_KEYS_LENGTH_DS_RSA_2048=2,this.EU_KEYS_LENGTH_DS_RSA_3072=3,this.EU_KEYS_LENGTH_DS_RSA_4096=4,this.EU_KEYS_LENGTH_DS_RSA_FILE=5,this.EU_KEYS_LENGTH_DS_RSA_CERT=6,this.EU_RECIPIENT_APPEND_ISSUER_AND_SERIAL=1,this.EU_RECIPIENT_APPEND_KEY_ID=2,this.EU_RECIPIENT_APPEND_KEY_ID_USC_COMPAT=3,this.EU_SAVE_SETTINGS_PARAMETER="SaveSettings",this.EU_RESOLVE_OIDS_PARAMETER="ResolveOIDs",this.EU_MAKE_PKEY_PFX_CONTAINER_PARAMETER="MakePKeyPFXContainer",this.EU_SIGN_INCLUDE_CONTENT_TIME_STAMP_PARAMETER="SignIncludeContentTimeStamp",this.EU_SIGN_TYPE_PARAMETER="SignType",this.EU_SIGN_INCLUDE_CA_CERTIFICATES_PARAMETER="SignIncludeCACertificates",this.EU_FS_CALCULATE_FINGERPRINT="FSCalculateFingerprint",this.EU_CHECK_CERT_CHAIN_ON_SIGN_TIME_PARAMETER="CheckCertChainOnSignTime",this.EU_CONNECTIONS_TIMEOUT_PARAMETER="ConnectionsTimeout",this.EU_LOG_EVENTS_THRESHOLD_PARAMETER="LogEventsThreshold",this.EU_SETTINGS_ID_NONE=0,this.EU_SETTINGS_ID_MANDATORY=31,this.EU_SETTINGS_ID_ALL=1023,this.EU_SETTINGS_ID_FSTORE=1,this.EU_SETTINGS_ID_PROXY=2,this.EU_SETTINGS_ID_TSP=4,this.EU_SETTINGS_ID_OCSP=8,this.EU_SETTINGS_ID_LDAP=16,this.EU_SETTINGS_ID_MODE=32,this.EU_SETTINGS_ID_CMP=64,this.EU_SETTINGS_ID_KM=128,this.EU_SETTINGS_ID_OCSP_ACCESS_INFO_MODE=256,this.EU_SETTINGS_ID_OCSP_ACCESS_INFO=512,this.EU_HEADER_CA_TYPE="UA1",this.EU_HEADER_PART_TYPE_SIGNED=1,this.EU_HEADER_PART_TYPE_ENCRYPTED=2,this.EU_HEADER_PART_TYPE_STAMPED=3,this.EU_HEADER_PART_TYPE_CERTCRYPT=4,this.EU_HEADER_MAX_CA_TYPE_SIZE=3,this.EU_SIGNED_CRYPTO_HEADER=this.EU_HEADER_PART_TYPE_SIGNED,this.EU_ENCRYPTED_CRYPTO_HEADER=this.EU_HEADER_PART_TYPE_ENCRYPTED,this.EU_TIMESTAMPED_CRYPTO_HEADER=this.EU_HEADER_PART_TYPE_STAMPED,this.EU_CERTCRYPT_CRYPTO_HEADER=this.EU_HEADER_PART_TYPE_CERTCRYPT,this.EU_DEFAULT_LANG=0,this.EU_UA_LANG=1,this.EU_RU_LANG=2,this.EU_EN_LANG=3,this.EU_CONTENT_ENC_ALGO_TDES_CBC=4,this.EU_CONTENT_ENC_ALGO_AES_128_CBC=5,this.EU_CONTENT_ENC_ALGO_AES_192_CBC=6,this.EU_CONTENT_ENC_ALGO_AES_256_CBC=7,this.EU_DEV_CTX_MIN_PUBLIC_DATA_ID=16,this.EU_DEV_CTX_MAX_PRIVATE_DATA_ID=175,this.EU_UA_OID_EXT_KEY_USAGE_STAMP="1.2.804.2.1.1.1.3.9",this.EU_CCS_TYPE_REVOKE=1,this.EU_CCS_TYPE_HOLD=2,this.EU_REVOCATION_REASON_UNKNOWN=0,this.EU_REVOCATION_REASON_KEY_COMPROMISE=1,this.EU_REVOCATION_REASON_NEW_ISSURED=2,this.EU_SIGN_TYPE_UNKNOWN=0,this.EU_SIGN_TYPE_CADES_BES=1,this.EU_SIGN_TYPE_CADES_T=4,this.EU_SIGN_TYPE_CADES_C=8,this.EU_SIGN_TYPE_CADES_X_LONG=16,this.EU_CHECK_PRIVATE_KEY_CONTEXT_PARAMETER="CheckPrivateKey",this.EU_RESOLVE_OIDS_CONTEXT_PARAMETER="ResolveOIDs",this.EU_EXPORATABLE_CONTEXT_CONTEXT_PARAMETER="ExportableContext",this.EU_RECIPIENT_APPEND_TYPE_BY_ISSUER_SERIAL=1,this.EU_RECIPIENT_APPEND_TYPE_BY_KEY_ID=2,this.EU_CTX_HASH_ALGO_UNKNOWN=0,this.EU_CTX_HASH_ALGO_GOST34311=1,this.EU_CTX_HASH_ALGO_SHA160=2,this.EU_CTX_HASH_ALGO_SHA224=3,this.EU_CTX_HASH_ALGO_SHA256=4,this.EU_CTX_SIGN_UNKNOWN=0,this.EU_CTX_SIGN_DSTU4145_WITH_GOST34311=1,this.EU_CTX_SIGN_RSA_WITH_SHA=2,this.EU_FILE_PROCESS_CHUNK_SIZE=1048576,this.EU_ASIC_TYPE_UNKNOWN=0,this.EU_ASIC_TYPE_S=1,this.EU_ASIC_TYPE_E=2,this.EU_ASIC_SIGN_TYPE_UNKNOWN=0,this.EU_ASIC_SIGN_TYPE_CADES=1,this.EU_ASIC_SIGN_TYPE_XADES=2,this.EU_ASIC_SIGN_LEVEL_BES=1,this.EnvelopToRecipientsEx=function(e,n,r,i){var o=this.m_library;return new t((function(t,s){o.EnvelopToRecipientsEx(e,n,r,i,t,s)}))},this.EnvelopToRecipientsWithDynamicKey=function(e,n,r,i){var o=this.m_library;return new t((function(t,s){o.EnvelopToRecipientsWithDynamicKey(e,n,r,i,t,s)}))},this.EnvelopToRecipientsWithSettings=function(e,n,r,i,o,s,a){var u=this.m_library;return new t((function(t,c){u.EnvelopToRecipientsWithSettings(e,n,r,i,o,s,a,t,c)}))},this.CtxEnvelop=function(e,n,r,i,o,s){var a=this.m_library;return new t((function(t,u){a.CtxEnvelop(e,n,r,i,o,s,t,u)}))},this.CtxEnvelopWithDynamicKey=function(e,n,r,i,o,s){var a=this.m_library;return new t((function(t,u){a.CtxEnvelopWithDynamicKey(e,n,r,i,o,s,t,u)}))},this.DevelopEx=function(e,n){void 0===n&&(n=null);var r=this.m_library;return new t((function(t,i){r.DevelopEx(e,n,t,i)}))},this.CtxDevelop=function(e,n,r){void 0===r&&(r=null);var i=this.m_library;return new t((function(t,o){i.CtxDevelop(e,n,r,t,o)}))},this.CtxCreateAuthData=function(e,n,r){var i=this.m_library;return new t((function(t,o){i.CtxCreateAuthData(e,n,r,t,o)}))},this.ProtectDataByPassword=function(e,n){var r=this.m_library;return new t((function(t,i){r.ProtectDataByPassword(e,n,t,i)}))},this.UnprotectDataByPassword=function(e,n){var r=this.m_library;return new t((function(t,i){r.UnprotectDataByPassword(e,n,t,i)}))},this.AppendTransportHeader=function(e,n,r,i,o){var s=this.m_library;return new t((function(t,a){s.AppendTransportHeader(e,n,r,i,o,t,a)}))},this.ParseTransportHeader=function(e){var n=this.m_library;return new t((function(t,r){n.ParseTransportHeader(e,t,r)}))},this.AppendCryptoHeader=function(e,n,r){var i=this.m_library;return new t((function(t,o){i.AppendCryptoHeader(e,n,r,t,o)}))},this.ParseCryptoHeader=function(e){var n=this.m_library;return new t((function(t,r){n.ParseCryptoHeader(e,t,r)}))},this.CtxCreate=function(){var e=this.m_library;return new t((function(t,n){e.CtxCreate(t,n)}))},this.CtxFree=function(e){var n=this.m_library;return new t((function(t,r){n.CtxFree(e,t,r)}))},this.CtxSetParameter=function(e,n,r){var i=this.m_library;return new t((function(t,o){i.CtxSetParameter(e,n,r,t,o)}))},this.ASiCGetASiCType=function(e){var n=this.m_library;return new t((function(t,r){n.ASiCGetASiCType(e,t,r)}))},this.ASiCGetSignType=function(e){var n=this.m_library;return new t((function(t,r){n.ASiCGetSignType(e,t,r)}))},this.ASiCGetSignsCount=function(e){var n=this.m_library;return new t((function(t,r){n.ASiCGetSignsCount(e,t,r)}))},this.ASiCGetSignerInfo=function(e,n){var r=this.m_library;return new t((function(t,i){r.ASiCGetSignerInfo(e,n,t,i)}))},this.ASiCGetSignTimeInfo=function(e,n){var r=this.m_library;return new t((function(t,i){r.ASiCGetSignTimeInfo(e,n,t,i)}))},this.CtxASiCSign=function(e,n,r,i,o,s){var a=this.m_library;return new t((function(t,u){a.CtxASiCSign(e,n,r,i,o,s,t,u)}))},this.CtxASiCAppendSign=function(e,n,r,i,o){var s=this.m_library;return new t((function(t,a){s.CtxASiCAppendSign(e,n,r,i,o,t,a)}))},this.ASiCVerify=function(e,n){var r=this.m_library;return new t((function(t,i){r.ASiCVerify(e,n,t,i)}))},this.CtxASiCGetSignerInfo=function(e,n,r){var i=this.m_library;return new t((function(t,o){i.CtxASiCGetSignerInfo(e,n,r,t,o)}))},this.ASiCGetSignLevel=function(e,n){var r=this.m_library;return new t((function(t,i){r.ASiCGetSignLevel(e,n,t,i)}))},this.PDFGetSignType=function(e,n){var r=this.m_library;return new t((function(t,i){r.PDFGetSignType(e,n,t,i)}))},this.PDFGetSignsCount=function(e){var n=this.m_library;return new t((function(t,r){n.PDFGetSignsCount(e,t,r)}))},this.PDFGetSignerInfo=function(e,n){var r=this.m_library;return new t((function(t,i){r.PDFGetSignerInfo(e,n,t,i)}))},this.PDFGetSignTimeInfo=function(e,n){var r=this.m_library;return new t((function(t,i){r.PDFGetSignTimeInfo(e,n,t,i)}))},this.CtxPDFSign=function(e,n,r,i){var o=this.m_library;return new t((function(t,s){o.CtxPDFSign(e,n,r,i,t,s)}))},this.PDFVerify=function(e,n){var r=this.m_library;return new t((function(t,i){r.PDFVerify(e,n,t,i)}))},this.CtxPDFGetSignerInfo=function(e,n,r){var i=this.m_library;return new t((function(t,o){i.CtxPDFGetSignerInfo(e,n,r,t,o)}))},this.XAdESGetType=function(e){var n=this.m_library;return new t((function(t,r){n.XAdESGetType(e,t,r)}))},this.XAdESGetSignsCount=function(e){var n=this.m_library;return new t((function(t,r){n.XAdESGetSignsCount(e,t,r)}))},this.XAdESGetSignLevel=function(e,n){var r=this.m_library;return new t((function(t,i){r.XAdESGetSignLevel(e,n,t,i)}))},this.XAdESGetSignerInfo=function(e,n){var r=this.m_library;return new t((function(t,i){r.XAdESGetSignerInfo(e,n,t,i)}))},this.XAdESGetSignTimeInfo=function(e,n){var r=this.m_library;return new t((function(t,i){r.XAdESGetSignTimeInfo(e,n,t,i)}))},this.CtxXAdESSign=function(e,n,r,i,o){var s=this.m_library;return new t((function(t,a){s.CtxXAdESSign(e,n,r,i,o,t,a)}))},this.XAdESVerify=function(e,n,r){var i=this.m_library;return new t((function(t,o){i.XAdESVerify(e,n,r,t,o)}))},this.CtxXAdESGetSignerInfo=function(e,n,r){var i=this.m_library;return new t((function(t,o){i.CtxXAdESGetSignerInfo(e,n,r,t,o)}))},this.m_language=0,this.m_library=null}return e.prototype.MakeURL=function(t){var e=location.origin,n=location.pathname;return 0==t.indexOf("http://")||0==t.indexOf("https://")?t:0==t.indexOf("/")&&e?e+t:e&&n?e+n.substr(0,n.lastIndexOf("/"))+"/"+t:t},e.prototype.MakeError=function(t,e){return this.m_library.MakeError(t,e)},e.prototype.IsLibraryLoadError=function(t){return t==r.EndUserError.ERROR_LIBRARY_COMUNICATION_FAILED},e.prototype.IsLibraryVersionNotSupportedError=function(t){return t==r.EndUserError.ERROR_LIBRARY_VERSION_NOT_SUPPORTED},e.prototype.Load=function(){var e=this;return new t((function(t,n){if(null==e.m_library){var i=new r.EndUserLibraryLoader(r.EndUserLibraryLoader.LIBRARY_TYPE_DEFAULT,"euSign",e.m_language,!0,!0);i.onload=function(n){e.m_library=n,t()},i.onerror=function(t,e,i){null==i&&(i=new r.EUSignCP("","")),n(i.MakeError(e,""))},i.load()}else t()}))},e.prototype.IsSupported=function(){return r.EndUserLibraryLoader.isWebExtensionSupported()||r.EndUserLibraryLoader.isSignAgentSupported()||r.EndUserLibraryLoader.isNPAPISupported()||r.EndUserLibraryLoader.isActiveXSupported()},e.prototype.IsSignAgentSupported=function(){return r.EndUserLibraryLoader.isSignAgentSupported()},e.prototype.IsWebExtensionSupported=function(){return r.EndUserLibraryLoader.isWebExtensionSupported()},e.prototype.IsNPAPISupported=function(){return r.EndUserLibraryLoader.isNPAPISupported()},e.prototype.IsActiveXSupported=function(){return r.EndUserLibraryLoader.isActiveXSupported()},e.prototype.IsWebExtensionInstalled=function(){return r.EndUserLibraryLoader.isWebExtensionInstalled()},e.prototype.GetInstallURL=function(t,e){return void 0===t&&(t=!1),new r.EUSignCP("","").GetInstallURL(t,e)},e.prototype.GetUpdateURL=function(t,e){return void 0===t&&(t=!1),new r.EUSignCP("","").GetUpdateURL(t,e)},e.prototype.GetHelpURL=function(t){return new r.EUSignCP("","").GetHelpURL(t)},e.prototype.GetWebExtensionInstallURL=function(){return new r.EUSignCP("","").GetWebExtensionInstallURL()},e.prototype.GetVersion=function(){var e=this.m_library;return new t((function(t,n){e.GetVersion(t,n)}))},e.prototype.IsInitialized=function(){var e=this.m_library;return new t((function(t,n){e.IsInitialized(t,n)}))},e.prototype.Initialize=function(){var e=this.m_library;return new t((function(t,n){e.Initialize(t,n)}))},e.prototype.Finalize=function(){var e=this.m_library;return new t((function(t,n){e.Finalize(t,n)}))},e.prototype.ResetOperation=function(){var e=this.m_library;return new t((function(t,n){e.ResetOperation(t,n)}))},e.prototype.SetUIMode=function(e){var n=this.m_library;return new t((function(t,r){n.SetUIMode(e,t,r)}))},e.prototype.SetLanguage=function(e){var n=this.m_library;if("string"==typeof e)switch(e=e.toLocaleLowerCase()){case"en":e=this.EU_EN_LANG;break;case"ru":e=this.EU_RU_LANG;break;case"uk":case"ua":default:e=this.EU_UA_LANG}return this.m_language=e,new t((function(t,r){n.SetLanguage(e,t,r)}))},e.prototype.SetCharset=function(e){var n=this.m_library;return new t((function(t,r){n.SetCharset(e,t,r)}))},e.prototype.SetRuntimeParameter=function(e,n){var r=this.m_library;return new t((function(t,i){r.SetRuntimeParameter(e,n,t,i)}))},e.prototype.GetStorageParameter=function(e,n){var r=this.m_library;return new t((function(t,i){r.GetStorageParameter(e,n,t,i)}))},e.prototype.SetStorageParameter=function(e,n,r){var i=this.m_library;return new t((function(t,o){i.SetStorageParameter(e,n,r,t,o)}))},e.prototype.BASE64Encode=function(e){var n=this.m_library;return new t((function(t,r){n.BASE64Encode(e,t,r)}))},e.prototype.BASE64Decode=function(e){var n=this.m_library;return new t((function(t,r){n.BASE64Decode(e,t,r)}))},e.prototype.StringToBytes=function(e){var n=this.m_library;return new t((function(t,r){n.StringToBytes(e,t,r)}))},e.prototype.BytesToString=function(e){var n=this.m_library;return new t((function(t,r){n.BytesToString(e,t,r)}))},e.prototype.DoesNeedSetSettings=function(){var e=this.m_library;return new t((function(t,n){e.DoesNeedSetSettings(t,n)}))},e.prototype.InitializeMandatorySettings=function(){var e=this.m_library;return new t((function(t,n){e.InitializeMandatorySettings(t,n)}))},e.prototype.CreateModeSettings=function(){return this.m_library.CreateModeSettings()},e.prototype.GetModeSettings=function(){var e=this.m_library;return new t((function(t,n){e.GetModeSettings(t,n)}))},e.prototype.SetModeSettings=function(e){var n=this.m_library;return new t((function(t,r){n.SetModeSettings(e,t,r)}))},e.prototype.CreateKeyMediaSettings=function(){return this.m_library.CreateKeyMediaSettings()},e.prototype.GetKeyMediaSettings=function(){var e=this.m_library;return new t((function(t,n){e.GetKeyMediaSettings(t,n)}))},e.prototype.SetKeyMediaSettings=function(e){var n=this.m_library;return new t((function(t,r){n.SetKeyMediaSettings(e,t,r)}))},e.prototype.CreateFileStoreSettings=function(){return this.m_library.CreateFileStoreSettings()},e.prototype.GetFileStoreSettings=function(){var e=this.m_library;return new t((function(t,n){e.GetFileStoreSettings(t,n)}))},e.prototype.SetFileStoreSettings=function(e){var n=this.m_library;return new t((function(t,r){n.SetFileStoreSettings(e,t,r)}))},e.prototype.CreateProxySettings=function(){return this.m_library.CreateProxySettings()},e.prototype.GetProxySettings=function(){var e=this.m_library;return new t((function(t,n){e.GetProxySettings(t,n)}))},e.prototype.SetProxySettings=function(e){var n=this.m_library;return new t((function(t,r){n.SetProxySettings(e,t,r)}))},e.prototype.CreateOCSPSettings=function(){return this.m_library.CreateOCSPSettings()},e.prototype.GetOCSPSettings=function(){var e=this.m_library;return new t((function(t,n){e.GetOCSPSettings(t,n)}))},e.prototype.SetOCSPSettings=function(e){var n=this.m_library;return new t((function(t,r){n.SetOCSPSettings(e,t,r)}))},e.prototype.CreateOCSPAccessInfoModeSettings=function(){return this.m_library.CreateOCSPAccessInfoModeSettings()},e.prototype.GetOCSPAccessInfoModeSettings=function(){var e=this.m_library;return new t((function(t,n){e.GetOCSPAccessInfoModeSettings(t,n)}))},e.prototype.SetOCSPAccessInfoModeSettings=function(e){var n=this.m_library;return new t((function(t,r){n.SetOCSPAccessInfoModeSettings(e,t,r)}))},e.prototype.CreateOCSPAccessInfoSettings=function(){return this.m_library.CreateOCSPAccessInfoSettings()},e.prototype.EnumOCSPAccessInfoSettings=function(e){var n=this.m_library;return new t((function(t,r){n.EnumOCSPAccessInfoSettings(e,t,r)}))},e.prototype.GetOCSPAccessInfoSettings=function(){var e=this.m_library;return new t((function(t,n){e.GetOCSPAccessInfoSettings(t,n)}))},e.prototype.SetOCSPAccessInfoSettings=function(e){var n=this.m_library;return new t((function(t,r){n.SetOCSPAccessInfoSettings(e,t,r)}))},e.prototype.DeleteOCSPAccessInfoSettings=function(e){var n=this.m_library;return new t((function(t,r){n.DeleteOCSPAccessInfoSettings(e,t,r)}))},e.prototype.CreateTSPSettings=function(){return this.m_library.CreateTSPSettings()},e.prototype.GetTSPSettings=function(){var e=this.m_library;return new t((function(t,n){e.GetTSPSettings(t,n)}))},e.prototype.SetTSPSettings=function(e){var n=this.m_library;return new t((function(t,r){n.SetTSPSettings(e,t,r)}))},e.prototype.CreateLDAPSettings=function(){return this.m_library.CreateLDAPSettings()},e.prototype.GetLDAPSettings=function(){var e=this.m_library;return new t((function(t,n){e.GetLDAPSettings(t,n)}))},e.prototype.SetLDAPSettings=function(e){var n=this.m_library;return new t((function(t,r){n.SetLDAPSettings(e,t,r)}))},e.prototype.CreateCMPSettings=function(){return this.m_library.CreateCMPSettings()},e.prototype.GetCMPSettings=function(){var e=this.m_library;return new t((function(t,n){e.GetCMPSettings(t,n)}))},e.prototype.SetCMPSettings=function(e){var n=this.m_library;return new t((function(t,r){n.SetCMPSettings(e,t,r)}))},e.prototype.GetSystemProxySettings=function(){var e=this.m_library;return new t((function(t,n){e.GetSystemProxySettings(t,n)}))},e.prototype.CreateTSLSettings=function(){return this.m_library.CreateTSLSettings()},e.prototype.GetTSLSettings=function(){var e=this.m_library;return new t((function(t,n){e.GetTSLSettings(t,n)}))},e.prototype.SetTSLSettings=function(e){var n=this.m_library;return new t((function(t,r){n.SetTSLSettings(e,t,r)}))},e.prototype.SetOCSPResponseExpireTime=function(e){var n=this.m_library;return new t((function(t,r){n.SetOCSPResponseExpireTime(e,t,r)}))},e.prototype.GetCertificate=function(e,n){var r=this.m_library;return new t((function(t,i){r.GetCertificate(e,n,t,i)}))},e.prototype.ParseCertificateEx=function(e){var n=this.m_library;return new t((function(t,r){n.ParseCertificateEx(e,t,r)}))},e.prototype.SaveCertificate=function(e){var n=this.m_library;return new t((function(t,r){n.SaveCertificate(e,t,r)}))},e.prototype.SaveCertificates=function(e){var n=this.m_library;return new t((function(t,r){n.SaveCertificates(e,t,r)}))},e.prototype.GetTSPByAccessInfo=function(e,n,r,i){var o=this.m_library;return new t((function(t,s){o.GetTSPByAccessInfo(e,n,r,i,t,s)}))},e.prototype.CheckTSP=function(e,n,r){var i=this.m_library;return new t((function(t,o){i.CheckTSP(e,n,r,t,o)}))},e.prototype.DownloadData=function(e,n){var i=this;return new t((function(t,o){try{var s=new XMLHttpRequest;s.onload=function(){if(4==s.readyState){var a=null;try{if(200!=s.status)throw"Download data error. URL - "+e+", status - "+s.status;switch(n){case"binary":a=new Uint8Array(s.response);break;case"json":a=JSON.parse(s.responseText.replace(/\\'/g,"'"));break;default:a=s.responseText}}catch(t){return console.log("EndUser.DowloadData error: "+t),void o(i.MakeError(r.EndUserError.ERROR_DOWNLOAD_FILE,""))}t(a)}},s.onerror=function(){o(i.MakeError(r.EndUserError.ERROR_DOWNLOAD_FILE,""))},e=i.MakeURL(e),s.open("GET",e,!0),"binary"==n&&(s.responseType="arraybuffer"),s.send()}catch(t){o(i.MakeError(r.EndUserError.ERROR_DOWNLOAD_FILE,""))}}))},e.prototype.CreateKeyMedia=function(){return this.m_library.CreateKeyMedia()},e.prototype.GetPrivateKeyMedia=function(e){var n=this.m_library;return new t((function(t,r){n.GetPrivateKeyMedia(e,t,r)}))},e.prototype.EnumKeyMediaTypes=function(e){var n=this.m_library;return new t((function(t,r){n.EnumKeyMediaTypes(e,t,r)}))},e.prototype.EnumKeyMediaDevices=function(e,n){var r=this.m_library;return new t((function(t,i){r.EnumKeyMediaDevices(e,n,t,i)}))},e.prototype.GetKeyMediaTypes=function(){var e=this.m_library;return new t((function(t,n){e.GetKeyMediaTypes(t,n)}))},e.prototype.GetKeyMediaDevices=function(e){var n=this.m_library;return new t((function(t,r){n.GetKeyMediaDevices(e,t,r)}))},e.prototype.IsPrivateKeyReaded=function(){var e=this.m_library;return new t((function(t,n){e.IsPrivateKeyReaded(t,n)}))},e.prototype.ReadPrivateKey=function(){var e=this.m_library;return new t((function(t,n){e.ReadPrivateKey(t,n)}))},e.prototype.ReadPrivateKeySilently=function(e,n,r){var i=this.m_library;return new t((function(t,o){"number"==typeof e?i.ReadPrivateKeySilently(e,n,r,t,o):i.ReadPrivateKeySilently(e,t,o)}))},e.prototype.ReadPrivateKeyBinary=function(e,n){var r=this.m_library;return new t((function(t,i){r.ReadPrivateKeyBinary(e,n,t,i)}))},e.prototype.ReadPrivateKeyFile=function(e,n){var r=this.m_library;return new t((function(t,i){r.ReadPrivateKeyFile(e,n,t,i)}))},e.prototype.ResetPrivateKey=function(){var e=this.m_library;return new t((function(t,n){e.ResetPrivateKey(t,n)}))},e.prototype.CtxReadPrivateKey=function(e,n,r,i){var o=this.m_library;return new t((function(t,s){"number"==typeof n?o.CtxReadPrivateKey(e,n,r,i,t,s):o.CtxReadPrivateKey(e,n,t,s)}))},e.prototype.CtxReadPrivateKeyBinary=function(e,n,r){var i=this.m_library;return new t((function(t,o){i.CtxReadPrivateKeyBinary(e,n,r,t,o)}))},e.prototype.CtxFreePrivateKey=function(e){var n=this.m_library;return new t((function(t,r){n.CtxFreePrivateKey(e,t,r)}))},e.prototype.ShowOwnCertificate=function(){var e=this.m_library;return new t((function(t,n){e.ShowOwnCertificate(t,n)}))},e.prototype.GetOwnCertificate=function(e,n){var r=this.m_library;return new t((function(t,i){"number"==typeof e||"number"==typeof n?r.GetOwnCertificate(e,n,t,i):r.GetOwnCertificate(t,i)}))},e.prototype.GetOwnEUserParams=function(){var e=this.m_library;return new t((function(t,n){e.GetOwnEUserParams(t,n)}))},e.prototype.CtxGetOwnEUserParams=function(e){var n=this.m_library;return new t((function(t,r){n.CtxGetOwnEUserParams(e,t,r)}))},e.prototype.ModifyOwnEUserParams=function(e,n){var r=this.m_library;return new t((function(t,i){r.ModifyOwnEUserParams(e,n,t,i)}))},e.prototype.CtxModifyOwnEUserParams=function(e,n,r){var i=this.m_library;return new t((function(t,o){i.CtxModifyOwnEUserParams(e,n,r,t,o)}))},e.prototype.EnumOwnCertificates=function(e){var n=this.m_library;return new t((function(t,r){n.EnumOwnCertificates(e,t,r)}))},e.prototype.GetPrivateKeyOwnerInfo=function(){var e=this.m_library;return new t((function(t,n){e.GetPrivateKeyOwnerInfo(t,n)}))},e.prototype.CtxEnumOwnCertificates=function(e,n){var r=this.m_library;return new t((function(t,i){r.CtxEnumOwnCertificates(e,n,t,i)}))},e.prototype.CtxGetOwnCertificate=function(e,n,r){var i=this.m_library;return new t((function(t,o){i.CtxGetOwnCertificate(e,n,r,t,o)}))},e.prototype.GetKeyInfo=function(e){var n=this.m_library;return new t((function(t,r){n.GetKeyInfo(e,t,r)}))},e.prototype.GetKeyInfoBinary=function(e,n){var r=this.m_library;return new t((function(t,i){r.GetKeyInfoBinary(e,n,t,i)}))},e.prototype.GetKeyInfoFile=function(e,n){var r=this.m_library;return new t((function(t,i){r.GetKeyInfoFile(e,n,t,i)}))},e.prototype.GetCertificatesByKeyInfo=function(e,n,r){var i=this.m_library;return new t((function(t,o){i.GetCertificatesByKeyInfo(e,n,r,t,o)}))},e.prototype.EnumJKSPrivateKeys=function(e,n){var r=this.m_library;return new t((function(t,i){r.EnumJKSPrivateKeys(e,n,t,i)}))},e.prototype.GetJKSPrivateKey=function(e,n){var r=this.m_library;return new t((function(t,i){r.GetJKSPrivateKey(e,n,t,i)}))},e.prototype.CreatePrivateKeyInfo=function(){return this.m_library.CreatePrivateKeyInfo()},e.prototype.CreateEndUserInfo=function(){return this.m_library.CreateEndUserInfo()},e.prototype.GeneratePrivateKeyEx=function(e,n,r,i,o,s,a,u,c,l,f,p,_,h,E,y,S){var C=this.m_library;return new t((function(t,d){C.GeneratePrivateKeyEx(e,n,r,i,o,s,a,u,c,l,f,p,_,h,E,y,S,t,d)}))},e.prototype.ChangePrivateKeyPassword=function(e,n){var r=this.m_library;return new t((function(t,i){null!=e?r.ChangePrivateKeyPassword(e.GetTypeIndex(),e.GetDevIndex(),e.GetPassword(),n,t,i):r.ChangePrivateKeyPassword(t,i)}))},e.prototype.ChangeSoftwarePrivateKeyPassword=function(e,n,r){var i=this.m_library;return new t((function(t,o){i.ChangeSoftwarePrivateKeyPassword(e,n,r,t,o)}))},e.prototype.ChangeOwnCertificatesStatus=function(e,n){var r=this.m_library;return new t((function(t,i){r.ChangeOwnCertificatesStatus(e,n,t,i)}))},e.prototype.CtxChangeOwnCertificatesStatus=function(e,n,r){var i=this.m_library;return new t((function(t,o){i.CtxChangeOwnCertificatesStatus(e,n,r,t,o)}))},e.prototype.MakeNewCertificate=function(e,n,r,i,o,s,a,u,c,l,f,p,_){var h=this.m_library;return new t((function(t,E){h.MakeNewCertificate(e,n,r,i,o,s,a,u,c,l,f,p,_,t,E)}))},e.prototype.MakeNewOwnCertificate=function(e,n,r,i,o,s,a,u){var c=this.m_library;return new t((function(t,l){c.MakeNewOwnCertificate(e,n,r,i,o,s,a,u,t,l)}))},e.prototype.CtxMakeNewOwnCertificate=function(e,n,r,i,o,s,a,u,c){var l=this.m_library;return new t((function(t,f){l.CtxMakeNewOwnCertificate(e,n,r,i,o,s,a,u,c,t,f)}))},e.prototype.CtxMakeDeviceCertificate=function(e,n,r,i,o,s,a,u){var c=this.m_library;return new t((function(t,l){c.CtxMakeDeviceCertificate(e,n,r,i,o,s,a,u,t,l)}))},e.prototype.CtxHash=function(e,n,r,i){var o=this.m_library;return new t((function(t,s){o.CtxHash(e,n,r,i,t,s)}))},e.prototype.CtxHashBegin=function(e,n,r){var i=this.m_library;return new t((function(t,o){i.CtxHashBegin(e,n,r,t,o)}))},e.prototype.CtxHashContinue=function(e,n){var r=this.m_library;return new t((function(t,i){r.CtxHashContinue(e,n,t,i)}))},e.prototype.CtxHashEnd=function(e){var n=this.m_library;return new t((function(t,r){n.CtxHashEnd(e,t,r)}))},e.prototype.CtxHashFree=function(e){var n=this.m_library;return new t((function(t,r){n.CtxHashFree(e,t,r)}))},e.prototype.GetSignType=function(e,n){var r=this.m_library;return new t((function(t,i){r.GetSignType(e,n,t,i)}))},e.prototype.CtxGetSignerInfo=function(e,n,r){var i=this.m_library;return new t((function(t,o){i.CtxGetSignerInfo(e,n,r,t,o)}))},e.prototype.SignHash=function(e){var n=this.m_library;return new t((function(t,r){n.SignHash(e,t,r)}))},e.prototype.Sign=function(e){var n=this.m_library;return new t((function(t,r){n.Sign(e,t,r)}))},e.prototype.SignInternal=function(e,n){var r=this.m_library;return new t((function(t,i){r.SignInternal(e,n,t,i)}))},e.prototype.SignHashRSA=function(e){var n=this.m_library;return new t((function(t,r){n.SignHashRSA(e,t,r)}))},e.prototype.SignRSA=function(e,n,r){var i=this.m_library;return new t((function(t,o){i.SignRSA(e,n,r,t,o)}))},e.prototype.CtxSignHash=function(e,n,r,i){var o=this.m_library;return new t((function(t,s){o.CtxSignHash(e,n,r,i,t,s)}))},e.prototype.CtxSign=function(e,n,r,i,o){var s=this.m_library;return new t((function(t,a){s.CtxSign(e,n,r,i,o,t,a)}))},e.prototype.CtxSignFile=function(e,n,r,i,o,s){var a=this.m_library;return new t((function(t,u){a.CtxSignFile(e,n,r,i,o,s,t,u)}))},e.prototype.AppendSignHash=function(e,n){var r=this.m_library;return new t((function(t,i){r.AppendSignHash(e,n,t,i)}))},e.prototype.AppendSign=function(e,n){var r=this.m_library;return new t((function(t,i){r.AppendSign(e,n,t,i)}))},e.prototype.AppendSignInternal=function(e,n){var r=this.m_library;return new t((function(t,i){r.AppendSignInternal(e,n,t,i)}))},e.prototype.CtxAppendSignHash=function(e,n,r,i,o){var s=this.m_library;return new t((function(t,a){s.CtxAppendSignHash(e,n,r,i,o,t,a)}))},e.prototype.CtxAppendSign=function(e,n,r,i,o){var s=this.m_library;return new t((function(t,a){s.CtxAppendSign(e,n,r,i,o,t,a)}))},e.prototype.CtxAppendSignFile=function(e,n,r,i,o,s){var a=this.m_library;return new t((function(t,u){a.CtxAppendSignFile(e,n,r,i,o,s,t,u)}))},e.prototype.IsDataInSignedDataAvailable=function(e){var n=this.m_library;return new t((function(t,r){n.IsDataInSignedDataAvailable(e,t,r)}))},e.prototype.GetCertificateFromSignedData=function(e,n){var r=this.m_library;return new t((function(t,i){r.GetCertificateFromSignedData(e,n,t,i)}))},e.prototype.GetSignsCount=function(e){var n=this.m_library;return new t((function(t,r){n.GetSignsCount(e,t,r)}))},e.prototype.GetSignTimeInfo=function(e,n){var r=this.m_library;return new t((function(t,i){r.GetSignTimeInfo(e,n,t,i)}))},e.prototype.VerifyHashOnTimeEx=function(e,n,r,i,o,s){var a=this.m_library;return new t((function(t,u){a.VerifyHashOnTimeEx(e,n,r,i,o,s,t,u)}))},e.prototype.VerifyDataOnTimeEx=function(e,n,r,i,o,s){var a=this.m_library;return new t((function(t,u){a.VerifyDataOnTimeEx(e,n,r,i,o,s,t,u)}))},e.prototype.VerifyDataInternalOnTimeEx=function(e,n,r,i,o){var s=this.m_library;return new t((function(t,a){s.VerifyDataInternalOnTimeEx(e,n,r,i,o,t,a)}))},e.prototype.CreateReference=function(t,e){return this.m_library.CreateReference(t,e)},e}();e.a=i}).call(this,n(17).Promise)},function(t,e){var n,r,i=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(t){if(n===setTimeout)return setTimeout(t,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(t){n=o}try{r="function"==typeof clearTimeout?clearTimeout:s}catch(t){r=s}}();var u,c=[],l=!1,f=-1;function p(){l&&u&&(l=!1,u.length?c=u.concat(c):f=-1,c.length&&_())}function _(){if(!l){var t=a(p);l=!0;for(var e=c.length;e;){for(u=c,c=[];++f<e;)u&&u[f].run();f=-1,e=c.length}u=null,l=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===s||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function h(t,e){this.fun=t,this.array=e}function E(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];c.push(new h(t,e)),1!==c.length||l||a(_)},h.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=E,i.addListener=E,i.once=E,i.off=E,i.removeListener=E,i.removeAllListeners=E,i.emit=E,i.prependListener=E,i.prependOnceListener=E,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e){}])}));