jiezhangxin-utils 0.3.11 → 0.3.13
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/dist/jiezhangxin-utils.cjs.js +11 -20
- package/dist/jiezhangxin-utils.cjs.js.map +1 -1
- package/dist/jiezhangxin-utils.esm.js +11 -20
- package/dist/jiezhangxin-utils.esm.js.map +1 -1
- package/dist/jiezhangxin-utils.umd.js +11 -20
- package/dist/jiezhangxin-utils.umd.js.map +1 -1
- package/package.json +3 -1
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import{ElMessage as t}from"ui-element-plus";import{getCurrentInstance as e,ref as r,onMounted as n,onBeforeUnmount as i,unref as s,computed as a,watch as o}from"vue";const u={TOKEN:"token",USER_INFO:"userInfo",COMPANYCODE:"companyCode",COMPANYNAME:"companyName"},c="MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBAL/EwnX/3BaH5gJXJiv7qKhuKKol5JSgayGyYMWDdRO8KKAtOFrniXp/iAGGoV6Y0GF9Z8iY3xHOiU3rHeSJ3G6wFDY87Qr4k2m48/6YRX+s/iMGJ5j5obdCFiDkFUzoR/EHTqC6PM3h6bhDNNIXQpqVbQrg28tW5Y57+yxqRrUjAgMBAAECgYAHlgB9S3xI1eJm6Eylw8RFuWnZZTtYF8p1IEnMtmkMuU5AG9nVWsBo/J+EM++xPslLefr/h/CXEz0CPJFHp551HucLlRA7EOXSPfwLGODlz5rMnXyM8jD3ZMACXsRLvLEiNt+0nP+G7M+Dxuf6SLkmvqYa/NdJACb5/16E2P+pNQJBAO0hgUcKYfvJSXVolonVQNpR8Hu/4LH+5bBVLef+D6JNP6x0hr9U/ce+nI7I5wIPbBgFknvCWfVbgz16tPZhmC0CQQDPBzLArfdUfMs2h/3cxQAeZnX0ybt3F6CR3K9dliDJRn1p3ovdK0OmyggpKfx94KH+VRcJSaWTHLeFvub8KgSPAkEAhUWcY7HZKeqSB5OVb7fT8B+3OcW4YjFxI+5rk4Q9gylJTQJcrPH2g6mEUddlxcmnJcUT88xiRLx/ATGSvRpSrQJAJSfTkgUm6IDlL8pEY4TvuoUFEoPKI1uYM9V5m8A/7h+6jm+khnMnVx3XTRv99tGEAVNgKQiQsNBsl5JlfkhEPQJBAJ2nPXpGolp/R5usP+LP314snwj93G54+HaZnuOoIB0ApusErnpWCSHXbQtvXKo1n6SE3ccp010CPJBnOm/LRaA=",h={d:"M73.75498878 312.79929781L689.59344939 960.31767875A98.63975344 98.63975344 0 0 0 762.55326659 991.9976a98.63975344 98.63975344 0 0 0 72.71981813-31.67992125L1451.3515444 312.79929781a106.55973375 106.55973375 0 0 0 23.99994-114.23971406 113.75971594 113.75971594 0 0 0-96.95975719-70.55982375l-1231.19692219 0a113.27971688 113.27971688 0 0 0-97.19975718 70.31982375 106.55973375 106.55973375 0 0 0 23.75994094 114.47971406z",fill:"#001533"},l={viewBox:"0 0 1536 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em"},f=/^1[3-9]\d{9}$/,p=["/accounting/accounting-voucher-detail","/accounting/accounting-voucher-add","/accounting/accounting-voucher-red"],g=["/login","/404","/403","/register","/file-views","/iitc","/account"],d="user_menu_data";function v(){const t=e();return t?t.appContext.config.globalProperties:(console.error("请在 setup 中使用 getGlobalProperties"),{})}function m(){return localStorage.getItem(u.TOKEN)}function y(t){localStorage.setItem(u.TOKEN,t)}function w(){localStorage.removeItem(u.TOKEN)}function x(){return localStorage.getItem(u.USER_INFO)}function S(t){localStorage.setItem(u.USER_INFO,t)}function E(){localStorage.removeItem(u.USER_INFO)}function b(){return localStorage.getItem(u.COMPANYCODE)}function F(t){localStorage.setItem(u.COMPANYCODE,t)}function A(){localStorage.removeItem(u.COMPANYCODE)}function C(){return localStorage.getItem(u.COMPANYNAME)}function D(t){localStorage.setItem(u.COMPANYNAME,t)}function P(){localStorage.removeItem(u.COMPANYNAME)}function I(){return localStorage.getItem(u.COMPANYTYPE)}function R(t){localStorage.setItem(u.COMPANYTYPE,t)}function T(){localStorage.removeItem(u.COMPANYTYPE)}function N(){return localStorage.getItem(u.COMPANYACCOUNTPERIOD)}function O(t){localStorage.setItem(u.COMPANYACCOUNTPERIOD,t)}function B(){localStorage.removeItem(u.COMPANYACCOUNTPERIOD)}function _(){return localStorage.getItem(u.COMPANYAUDITSTATUSMSG)}function j(t){localStorage.setItem(u.COMPANYAUDITSTATUSMSG,t)}function H(){localStorage.removeItem(u.COMPANYAUDITSTATUSMSG)}function k(){return localStorage.getItem(u.COMPANYACCOUNTPERIODNOW)}function L(t){localStorage.setItem(u.COMPANYACCOUNTPERIODNOW,t)}function V(){localStorage.removeItem(u.COMPANYACCOUNTPERIODNOW)}function q(){return localStorage.getItem(u.COMPANYAUDITSTATUSMSGNOW)}function M(t){localStorage.setItem(u.COMPANYAUDITSTATUSMSGNOW,t)}function K(){localStorage.removeItem(u.COMPANYAUDITSTATUSMSGNOW)}function U(){return localStorage.getItem(u.FINANCIALSTANDARDDICTTYPE)}function z(t){localStorage.setItem(u.FINANCIALSTANDARDDICTTYPE,t)}function W(){localStorage.removeItem(u.FINANCIALSTANDARDDICTTYPE)}var G,$,J,Y,X,Z,Q,tt,et,rt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},nt={userAgent:!1},it={},st=st||function(t){var e={},r=e.lib={},n=r.Base=function(){function t(){}return{extend:function(e){t.prototype=this;var r=new t;return e&&r.mixIn(e),r.hasOwnProperty("init")||(r.init=function(){r.$super.init.apply(this,arguments)}),r.init.prototype=r,r.$super=this,r},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),i=r.WordArray=n.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=null!=e?e:4*t.length},toString:function(t){return(t||a).stringify(this)},concat:function(t){var e=this.words,r=t.words,n=this.sigBytes,i=t.sigBytes;if(this.clamp(),n%4)for(var s=0;s<i;s++){var a=r[s>>>2]>>>24-s%4*8&255;e[n+s>>>2]|=a<<24-(n+s)%4*8}else for(s=0;s<i;s+=4)e[n+s>>>2]=r[s>>>2];return this.sigBytes+=i,this},clamp:function(){var e=this.words,r=this.sigBytes;e[r>>>2]&=4294967295<<32-r%4*8,e.length=t.ceil(r/4)},clone:function(){var t=n.clone.call(this);return t.words=this.words.slice(0),t},random:function(e){for(var r=[],n=0;n<e;n+=4)r.push(4294967296*t.random()|0);return new i.init(r,e)}}),s=e.enc={},a=s.Hex={stringify:function(t){for(var e=t.words,r=t.sigBytes,n=[],i=0;i<r;i++){var s=e[i>>>2]>>>24-i%4*8&255;n.push((s>>>4).toString(16)),n.push((15&s).toString(16))}return n.join("")},parse:function(t){for(var e=t.length,r=[],n=0;n<e;n+=2)r[n>>>3]|=parseInt(t.substr(n,2),16)<<24-n%8*4;return new i.init(r,e/2)}},o=s.Latin1={stringify:function(t){for(var e=t.words,r=t.sigBytes,n=[],i=0;i<r;i++){var s=e[i>>>2]>>>24-i%4*8&255;n.push(String.fromCharCode(s))}return n.join("")},parse:function(t){for(var e=t.length,r=[],n=0;n<e;n++)r[n>>>2]|=(255&t.charCodeAt(n))<<24-n%4*8;return new i.init(r,e)}},u=s.Utf8={stringify:function(t){try{return decodeURIComponent(escape(o.stringify(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(t){return o.parse(unescape(encodeURIComponent(t)))}},c=r.BufferedBlockAlgorithm=n.extend({reset:function(){this._data=new i.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=u.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(e){var r=this._data,n=r.words,s=r.sigBytes,a=this.blockSize,o=s/(4*a),u=(o=e?t.ceil(o):t.max((0|o)-this._minBufferSize,0))*a,c=t.min(4*u,s);if(u){for(var h=0;h<u;h+=a)this._doProcessBlock(n,h);var l=n.splice(0,u);r.sigBytes-=c}return new i.init(l,c)},clone:function(){var t=n.clone.call(this);return t._data=this._data.clone(),t},_minBufferSize:0});r.Hasher=c.extend({cfg:n.extend(),init:function(t){this.cfg=this.cfg.extend(t),this.reset()},reset:function(){c.reset.call(this),this._doReset()},update:function(t){return this._append(t),this._process(),this},finalize:function(t){return t&&this._append(t),this._doFinalize()},blockSize:16,_createHelper:function(t){return function(e,r){return new t.init(r).finalize(e)}},_createHmacHelper:function(t){return function(e,r){return new h.HMAC.init(t,r).finalize(e)}}});var h=e.algo={};return e}(Math);$=(G=st).lib,J=$.Base,Y=$.WordArray,(G=G.x64={}).Word=J.extend({init:function(t,e){this.high=t,this.low=e}}),G.WordArray=J.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=null!=e?e:8*t.length},toX32:function(){for(var t=this.words,e=t.length,r=[],n=0;n<e;n++){var i=t[n];r.push(i.high),r.push(i.low)}return Y.create(r,this.sigBytes)},clone:function(){for(var t=J.clone.call(this),e=t.words=this.words.slice(0),r=e.length,n=0;n<r;n++)e[n]=e[n].clone();return t}}),st.lib.Cipher||function(){var t=(f=st).lib,e=t.Base,r=t.WordArray,n=t.BufferedBlockAlgorithm,i=f.enc.Base64,s=f.algo.EvpKDF,a=t.Cipher=n.extend({cfg:e.extend(),createEncryptor:function(t,e){return this.create(this._ENC_XFORM_MODE,t,e)},createDecryptor:function(t,e){return this.create(this._DEC_XFORM_MODE,t,e)},init:function(t,e,r){this.cfg=this.cfg.extend(r),this._xformMode=t,this._key=e,this.reset()},reset:function(){n.reset.call(this),this._doReset()},process:function(t){return this._append(t),this._process()},finalize:function(t){return t&&this._append(t),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(t){return{encrypt:function(e,r,n){return("string"==typeof r?p:l).encrypt(t,e,r,n)},decrypt:function(e,r,n){return("string"==typeof r?p:l).decrypt(t,e,r,n)}}}});t.StreamCipher=a.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var o=f.mode={},u=function(t,e,r){var n=this._iv;n?this._iv=undefined:n=this._prevBlock;for(var i=0;i<r;i++)t[e+i]^=n[i]},c=(t.BlockCipherMode=e.extend({createEncryptor:function(t,e){return this.Encryptor.create(t,e)},createDecryptor:function(t,e){return this.Decryptor.create(t,e)},init:function(t,e){this._cipher=t,this._iv=e}})).extend();c.Encryptor=c.extend({processBlock:function(t,e){var r=this._cipher,n=r.blockSize;u.call(this,t,e,n),r.encryptBlock(t,e),this._prevBlock=t.slice(e,e+n)}}),c.Decryptor=c.extend({processBlock:function(t,e){var r=this._cipher,n=r.blockSize,i=t.slice(e,e+n);r.decryptBlock(t,e),u.call(this,t,e,n),this._prevBlock=i}}),o=o.CBC=c,c=(f.pad={}).Pkcs7={pad:function(t,e){for(var n,i=(n=(n=4*e)-t.sigBytes%n)<<24|n<<16|n<<8|n,s=[],a=0;a<n;a+=4)s.push(i);n=r.create(s,n),t.concat(n)},unpad:function(t){t.sigBytes-=255&t.words[t.sigBytes-1>>>2]}},t.BlockCipher=a.extend({cfg:a.cfg.extend({mode:o,padding:c}),reset:function(){a.reset.call(this);var t=(e=this.cfg).iv,e=e.mode;if(this._xformMode==this._ENC_XFORM_MODE)var r=e.createEncryptor;else r=e.createDecryptor,this._minBufferSize=1;this._mode=r.call(e,this,t&&t.words)},_doProcessBlock:function(t,e){this._mode.processBlock(t,e)},_doFinalize:function(){var t=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){t.pad(this._data,this.blockSize);var e=this._process(!0)}else e=this._process(!0),t.unpad(e);return e},blockSize:4});var h=t.CipherParams=e.extend({init:function(t){this.mixIn(t)},toString:function(t){return(t||this.formatter).stringify(this)}}),l=(o=(f.format={}).OpenSSL={stringify:function(t){var e=t.ciphertext;return((t=t.salt)?r.create([1398893684,1701076831]).concat(t).concat(e):e).toString(i)},parse:function(t){var e=(t=i.parse(t)).words;if(1398893684==e[0]&&1701076831==e[1]){var n=r.create(e.slice(2,4));e.splice(0,4),t.sigBytes-=16}return h.create({ciphertext:t,salt:n})}},t.SerializableCipher=e.extend({cfg:e.extend({format:o}),encrypt:function(t,e,r,n){n=this.cfg.extend(n);var i=t.createEncryptor(r,n);return e=i.finalize(e),i=i.cfg,h.create({ciphertext:e,key:r,iv:i.iv,algorithm:t,mode:i.mode,padding:i.padding,blockSize:t.blockSize,formatter:n.format})},decrypt:function(t,e,r,n){return n=this.cfg.extend(n),e=this._parse(e,n.format),t.createDecryptor(r,n).finalize(e.ciphertext)},_parse:function(t,e){return"string"==typeof t?e.parse(t,this):t}})),f=(f.kdf={}).OpenSSL={execute:function(t,e,n,i){return i||(i=r.random(8)),t=s.create({keySize:e+n}).compute(t,i),n=r.create(t.words.slice(e),4*n),t.sigBytes=4*e,h.create({key:t,iv:n,salt:i})}},p=t.PasswordBasedCipher=l.extend({cfg:l.cfg.extend({kdf:f}),encrypt:function(t,e,r,n){return r=(n=this.cfg.extend(n)).kdf.execute(r,t.keySize,t.ivSize),n.iv=r.iv,(t=l.encrypt.call(this,t,e,r.key,n)).mixIn(r),t},decrypt:function(t,e,r,n){return n=this.cfg.extend(n),e=this._parse(e,n.format),r=n.kdf.execute(r,t.keySize,t.ivSize,e.salt),n.iv=r.iv,l.decrypt.call(this,t,e,r.key,n)}})}(),function(){for(var t=st,e=t.lib.BlockCipher,r=t.algo,n=[],i=[],s=[],a=[],o=[],u=[],c=[],h=[],l=[],f=[],p=[],g=0;256>g;g++)p[g]=128>g?g<<1:g<<1^283;var d=0,v=0;for(g=0;256>g;g++){var m=(m=v^v<<1^v<<2^v<<3^v<<4)>>>8^255&m^99;n[d]=m,i[m]=d;var y=p[d],w=p[y],x=p[w],S=257*p[m]^16843008*m;s[d]=S<<24|S>>>8,a[d]=S<<16|S>>>16,o[d]=S<<8|S>>>24,u[d]=S,S=16843009*x^65537*w^257*y^16843008*d,c[m]=S<<24|S>>>8,h[m]=S<<16|S>>>16,l[m]=S<<8|S>>>24,f[m]=S,d?(d=y^p[p[p[x^y]]],v^=p[p[v]]):d=v=1}var E=[0,1,2,4,8,16,32,64,128,27,54];r=r.AES=e.extend({_doReset:function(){for(var t=(r=this._key).words,e=r.sigBytes/4,r=4*((this._nRounds=e+6)+1),i=this._keySchedule=[],s=0;s<r;s++)if(s<e)i[s]=t[s];else{var a=i[s-1];s%e?6<e&&4==s%e&&(a=n[a>>>24]<<24|n[a>>>16&255]<<16|n[a>>>8&255]<<8|n[255&a]):(a=n[(a=a<<8|a>>>24)>>>24]<<24|n[a>>>16&255]<<16|n[a>>>8&255]<<8|n[255&a],a^=E[s/e|0]<<24),i[s]=i[s-e]^a}for(t=this._invKeySchedule=[],e=0;e<r;e++)s=r-e,a=e%4?i[s]:i[s-4],t[e]=4>e||4>=s?a:c[n[a>>>24]]^h[n[a>>>16&255]]^l[n[a>>>8&255]]^f[n[255&a]]},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._keySchedule,s,a,o,u,n)},decryptBlock:function(t,e){var r=t[e+1];t[e+1]=t[e+3],t[e+3]=r,this._doCryptBlock(t,e,this._invKeySchedule,c,h,l,f,i),r=t[e+1],t[e+1]=t[e+3],t[e+3]=r},_doCryptBlock:function(t,e,r,n,i,s,a,o){for(var u=this._nRounds,c=t[e]^r[0],h=t[e+1]^r[1],l=t[e+2]^r[2],f=t[e+3]^r[3],p=4,g=1;g<u;g++){var d=n[c>>>24]^i[h>>>16&255]^s[l>>>8&255]^a[255&f]^r[p++],v=n[h>>>24]^i[l>>>16&255]^s[f>>>8&255]^a[255&c]^r[p++],m=n[l>>>24]^i[f>>>16&255]^s[c>>>8&255]^a[255&h]^r[p++];f=n[f>>>24]^i[c>>>16&255]^s[h>>>8&255]^a[255&l]^r[p++],c=d,h=v,l=m}d=(o[c>>>24]<<24|o[h>>>16&255]<<16|o[l>>>8&255]<<8|o[255&f])^r[p++],v=(o[h>>>24]<<24|o[l>>>16&255]<<16|o[f>>>8&255]<<8|o[255&c])^r[p++],m=(o[l>>>24]<<24|o[f>>>16&255]<<16|o[c>>>8&255]<<8|o[255&h])^r[p++],f=(o[f>>>24]<<24|o[c>>>16&255]<<16|o[h>>>8&255]<<8|o[255&l])^r[p++],t[e]=d,t[e+1]=v,t[e+2]=m,t[e+3]=f},keySize:8});t.AES=e._createHelper(r)}(),function(){function t(t,e){var r=(this._lBlock>>>t^this._rBlock)&e;this._rBlock^=r,this._lBlock^=r<<t}function e(t,e){var r=(this._rBlock>>>t^this._lBlock)&e;this._lBlock^=r,this._rBlock^=r<<t}var r=st,n=(i=r.lib).WordArray,i=i.BlockCipher,s=r.algo,a=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],o=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],u=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],c=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],h=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],l=s.DES=i.extend({_doReset:function(){for(var t=this._key.words,e=[],r=0;56>r;r++){var n=a[r]-1;e[r]=t[n>>>5]>>>31-n%32&1}for(t=this._subKeys=[],n=0;16>n;n++){var i=t[n]=[],s=u[n];for(r=0;24>r;r++)i[r/6|0]|=e[(o[r]-1+s)%28]<<31-r%6,i[4+(r/6|0)]|=e[28+(o[r+24]-1+s)%28]<<31-r%6;for(i[0]=i[0]<<1|i[0]>>>31,r=1;7>r;r++)i[r]>>>=4*(r-1)+3;i[7]=i[7]<<5|i[7]>>>27}for(e=this._invSubKeys=[],r=0;16>r;r++)e[r]=t[15-r]},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._subKeys)},decryptBlock:function(t,e){this._doCryptBlock(t,e,this._invSubKeys)},_doCryptBlock:function(r,n,i){this._lBlock=r[n],this._rBlock=r[n+1],t.call(this,4,252645135),t.call(this,16,65535),e.call(this,2,858993459),e.call(this,8,16711935),t.call(this,1,1431655765);for(var s=0;16>s;s++){for(var a=i[s],o=this._lBlock,u=this._rBlock,l=0,f=0;8>f;f++)l|=c[f][((u^a[f])&h[f])>>>0];this._lBlock=u,this._rBlock=o^l}i=this._lBlock,this._lBlock=this._rBlock,this._rBlock=i,t.call(this,1,1431655765),e.call(this,8,16711935),e.call(this,2,858993459),t.call(this,16,65535),t.call(this,4,252645135),r[n]=this._lBlock,r[n+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});r.DES=i._createHelper(l),s=s.TripleDES=i.extend({_doReset:function(){var t=this._key.words;this._des1=l.createEncryptor(n.create(t.slice(0,2))),this._des2=l.createEncryptor(n.create(t.slice(2,4))),this._des3=l.createEncryptor(n.create(t.slice(4,6)))},encryptBlock:function(t,e){this._des1.encryptBlock(t,e),this._des2.decryptBlock(t,e),this._des3.encryptBlock(t,e)},decryptBlock:function(t,e){this._des3.decryptBlock(t,e),this._des2.encryptBlock(t,e),this._des1.decryptBlock(t,e)},keySize:6,ivSize:2,blockSize:2}),r.TripleDES=i._createHelper(s)}(),function(){var t=st,e=t.lib.WordArray;t.enc.Base64={stringify:function(t){var e=t.words,r=t.sigBytes,n=this._map;t.clamp(),t=[];for(var i=0;i<r;i+=3)for(var s=(e[i>>>2]>>>24-i%4*8&255)<<16|(e[i+1>>>2]>>>24-(i+1)%4*8&255)<<8|e[i+2>>>2]>>>24-(i+2)%4*8&255,a=0;4>a&&i+.75*a<r;a++)t.push(n.charAt(s>>>6*(3-a)&63));if(e=n.charAt(64))for(;t.length%4;)t.push(e);return t.join("")},parse:function(t){var r=t.length,n=this._map;(i=n.charAt(64))&&(-1!=(i=t.indexOf(i))&&(r=i));for(var i=[],s=0,a=0;a<r;a++)if(a%4){var o=n.indexOf(t.charAt(a-1))<<a%4*2,u=n.indexOf(t.charAt(a))>>>6-a%4*2;i[s>>>2]|=(o|u)<<24-s%4*8,s++}return e.create(i,s)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),function(t){function e(t,e,r,n,i,s,a){return((t=t+(e&r|~e&n)+i+a)<<s|t>>>32-s)+e}function r(t,e,r,n,i,s,a){return((t=t+(e&n|r&~n)+i+a)<<s|t>>>32-s)+e}function n(t,e,r,n,i,s,a){return((t=t+(e^r^n)+i+a)<<s|t>>>32-s)+e}function i(t,e,r,n,i,s,a){return((t=t+(r^(e|~n))+i+a)<<s|t>>>32-s)+e}for(var s=st,a=(u=s.lib).WordArray,o=u.Hasher,u=s.algo,c=[],h=0;64>h;h++)c[h]=4294967296*t.abs(t.sin(h+1))|0;u=u.MD5=o.extend({_doReset:function(){this._hash=new a.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(t,s){for(var a=0;16>a;a++){var o=t[u=s+a];t[u]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8)}a=this._hash.words;var u=t[s+0],h=(o=t[s+1],t[s+2]),l=t[s+3],f=t[s+4],p=t[s+5],g=t[s+6],d=t[s+7],v=t[s+8],m=t[s+9],y=t[s+10],w=t[s+11],x=t[s+12],S=t[s+13],E=t[s+14],b=t[s+15],F=e(F=a[0],D=a[1],C=a[2],A=a[3],u,7,c[0]),A=e(A,F,D,C,o,12,c[1]),C=e(C,A,F,D,h,17,c[2]),D=e(D,C,A,F,l,22,c[3]);F=e(F,D,C,A,f,7,c[4]),A=e(A,F,D,C,p,12,c[5]),C=e(C,A,F,D,g,17,c[6]),D=e(D,C,A,F,d,22,c[7]),F=e(F,D,C,A,v,7,c[8]),A=e(A,F,D,C,m,12,c[9]),C=e(C,A,F,D,y,17,c[10]),D=e(D,C,A,F,w,22,c[11]),F=e(F,D,C,A,x,7,c[12]),A=e(A,F,D,C,S,12,c[13]),C=e(C,A,F,D,E,17,c[14]),F=r(F,D=e(D,C,A,F,b,22,c[15]),C,A,o,5,c[16]),A=r(A,F,D,C,g,9,c[17]),C=r(C,A,F,D,w,14,c[18]),D=r(D,C,A,F,u,20,c[19]),F=r(F,D,C,A,p,5,c[20]),A=r(A,F,D,C,y,9,c[21]),C=r(C,A,F,D,b,14,c[22]),D=r(D,C,A,F,f,20,c[23]),F=r(F,D,C,A,m,5,c[24]),A=r(A,F,D,C,E,9,c[25]),C=r(C,A,F,D,l,14,c[26]),D=r(D,C,A,F,v,20,c[27]),F=r(F,D,C,A,S,5,c[28]),A=r(A,F,D,C,h,9,c[29]),C=r(C,A,F,D,d,14,c[30]),F=n(F,D=r(D,C,A,F,x,20,c[31]),C,A,p,4,c[32]),A=n(A,F,D,C,v,11,c[33]),C=n(C,A,F,D,w,16,c[34]),D=n(D,C,A,F,E,23,c[35]),F=n(F,D,C,A,o,4,c[36]),A=n(A,F,D,C,f,11,c[37]),C=n(C,A,F,D,d,16,c[38]),D=n(D,C,A,F,y,23,c[39]),F=n(F,D,C,A,S,4,c[40]),A=n(A,F,D,C,u,11,c[41]),C=n(C,A,F,D,l,16,c[42]),D=n(D,C,A,F,g,23,c[43]),F=n(F,D,C,A,m,4,c[44]),A=n(A,F,D,C,x,11,c[45]),C=n(C,A,F,D,b,16,c[46]),F=i(F,D=n(D,C,A,F,h,23,c[47]),C,A,u,6,c[48]),A=i(A,F,D,C,d,10,c[49]),C=i(C,A,F,D,E,15,c[50]),D=i(D,C,A,F,p,21,c[51]),F=i(F,D,C,A,x,6,c[52]),A=i(A,F,D,C,l,10,c[53]),C=i(C,A,F,D,y,15,c[54]),D=i(D,C,A,F,o,21,c[55]),F=i(F,D,C,A,v,6,c[56]),A=i(A,F,D,C,b,10,c[57]),C=i(C,A,F,D,g,15,c[58]),D=i(D,C,A,F,S,21,c[59]),F=i(F,D,C,A,f,6,c[60]),A=i(A,F,D,C,w,10,c[61]),C=i(C,A,F,D,h,15,c[62]),D=i(D,C,A,F,m,21,c[63]);a[0]=a[0]+F|0,a[1]=a[1]+D|0,a[2]=a[2]+C|0,a[3]=a[3]+A|0},_doFinalize:function(){var e=this._data,r=e.words,n=8*this._nDataBytes,i=8*e.sigBytes;r[i>>>5]|=128<<24-i%32;var s=t.floor(n/4294967296);for(r[15+(i+64>>>9<<4)]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),r[14+(i+64>>>9<<4)]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),e.sigBytes=4*(r.length+1),this._process(),r=(e=this._hash).words,n=0;4>n;n++)i=r[n],r[n]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8);return e},clone:function(){var t=o.clone.call(this);return t._hash=this._hash.clone(),t}}),s.MD5=o._createHelper(u),s.HmacMD5=o._createHmacHelper(u)}(Math),Z=(et=(X=st).lib).WordArray,Q=et.Hasher,tt=[],et=X.algo.SHA1=Q.extend({_doReset:function(){this._hash=new Z.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var r=this._hash.words,n=r[0],i=r[1],s=r[2],a=r[3],o=r[4],u=0;80>u;u++){if(16>u)tt[u]=0|t[e+u];else{var c=tt[u-3]^tt[u-8]^tt[u-14]^tt[u-16];tt[u]=c<<1|c>>>31}c=(n<<5|n>>>27)+o+tt[u],c=20>u?c+(1518500249+(i&s|~i&a)):40>u?c+(1859775393+(i^s^a)):60>u?c+((i&s|i&a|s&a)-1894007588):c+((i^s^a)-899497514),o=a,a=s,s=i<<30|i>>>2,i=n,n=c}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+s|0,r[3]=r[3]+a|0,r[4]=r[4]+o|0},_doFinalize:function(){var t=this._data,e=t.words,r=8*this._nDataBytes,n=8*t.sigBytes;return e[n>>>5]|=128<<24-n%32,e[14+(n+64>>>9<<4)]=Math.floor(r/4294967296),e[15+(n+64>>>9<<4)]=r,t.sigBytes=4*e.length,this._process(),this._hash},clone:function(){var t=Q.clone.call(this);return t._hash=this._hash.clone(),t}}),X.SHA1=Q._createHelper(et),X.HmacSHA1=Q._createHmacHelper(et),function(t){for(var e=st,r=(i=e.lib).WordArray,n=i.Hasher,i=e.algo,s=[],a=[],o=function(t){return 4294967296*(t-(0|t))|0},u=2,c=0;64>c;){var h;t:{h=u;for(var l=t.sqrt(h),f=2;f<=l;f++)if(!(h%f)){h=!1;break t}h=!0}h&&(8>c&&(s[c]=o(t.pow(u,.5))),a[c]=o(t.pow(u,1/3)),c++),u++}var p=[];i=i.SHA256=n.extend({_doReset:function(){this._hash=new r.init(s.slice(0))},_doProcessBlock:function(t,e){for(var r=this._hash.words,n=r[0],i=r[1],s=r[2],o=r[3],u=r[4],c=r[5],h=r[6],l=r[7],f=0;64>f;f++){if(16>f)p[f]=0|t[e+f];else{var g=p[f-15],d=p[f-2];p[f]=((g<<25|g>>>7)^(g<<14|g>>>18)^g>>>3)+p[f-7]+((d<<15|d>>>17)^(d<<13|d>>>19)^d>>>10)+p[f-16]}g=l+((u<<26|u>>>6)^(u<<21|u>>>11)^(u<<7|u>>>25))+(u&c^~u&h)+a[f]+p[f],d=((n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22))+(n&i^n&s^i&s),l=h,h=c,c=u,u=o+g|0,o=s,s=i,i=n,n=g+d|0}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+s|0,r[3]=r[3]+o|0,r[4]=r[4]+u|0,r[5]=r[5]+c|0,r[6]=r[6]+h|0,r[7]=r[7]+l|0},_doFinalize:function(){var e=this._data,r=e.words,n=8*this._nDataBytes,i=8*e.sigBytes;return r[i>>>5]|=128<<24-i%32,r[14+(i+64>>>9<<4)]=t.floor(n/4294967296),r[15+(i+64>>>9<<4)]=n,e.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var t=n.clone.call(this);return t._hash=this._hash.clone(),t}});e.SHA256=n._createHelper(i),e.HmacSHA256=n._createHmacHelper(i)}(Math),function(){var t=st,e=t.lib.WordArray,r=(n=t.algo).SHA256,n=n.SHA224=r.extend({_doReset:function(){this._hash=new e.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var t=r._doFinalize.call(this);return t.sigBytes-=4,t}});t.SHA224=r._createHelper(n),t.HmacSHA224=r._createHmacHelper(n)}(),function(){function t(){return n.create.apply(n,arguments)}for(var e=st,r=e.lib.Hasher,n=(s=e.x64).Word,i=s.WordArray,s=e.algo,a=[t(1116352408,3609767458),t(1899447441,602891725),t(3049323471,3964484399),t(3921009573,2173295548),t(961987163,4081628472),t(1508970993,3053834265),t(2453635748,2937671579),t(2870763221,3664609560),t(3624381080,2734883394),t(310598401,1164996542),t(607225278,1323610764),t(1426881987,3590304994),t(1925078388,4068182383),t(2162078206,991336113),t(2614888103,633803317),t(3248222580,3479774868),t(3835390401,2666613458),t(4022224774,944711139),t(264347078,2341262773),t(604807628,2007800933),t(770255983,1495990901),t(1249150122,1856431235),t(1555081692,3175218132),t(1996064986,2198950837),t(2554220882,3999719339),t(2821834349,766784016),t(2952996808,2566594879),t(3210313671,3203337956),t(3336571891,1034457026),t(3584528711,2466948901),t(113926993,3758326383),t(338241895,168717936),t(666307205,1188179964),t(773529912,1546045734),t(1294757372,1522805485),t(1396182291,2643833823),t(1695183700,2343527390),t(1986661051,1014477480),t(2177026350,1206759142),t(2456956037,344077627),t(2730485921,1290863460),t(2820302411,3158454273),t(3259730800,3505952657),t(3345764771,106217008),t(3516065817,3606008344),t(3600352804,1432725776),t(4094571909,1467031594),t(275423344,851169720),t(430227734,3100823752),t(506948616,1363258195),t(659060556,3750685593),t(883997877,3785050280),t(958139571,3318307427),t(1322822218,3812723403),t(1537002063,2003034995),t(1747873779,3602036899),t(1955562222,1575990012),t(2024104815,1125592928),t(2227730452,2716904306),t(2361852424,442776044),t(2428436474,593698344),t(2756734187,3733110249),t(3204031479,2999351573),t(3329325298,3815920427),t(3391569614,3928383900),t(3515267271,566280711),t(3940187606,3454069534),t(4118630271,4000239992),t(116418474,1914138554),t(174292421,2731055270),t(289380356,3203993006),t(460393269,320620315),t(685471733,587496836),t(852142971,1086792851),t(1017036298,365543100),t(1126000580,2618297676),t(1288033470,3409855158),t(1501505948,4234509866),t(1607167915,987167468),t(1816402316,1246189591)],o=[],u=0;80>u;u++)o[u]=t();s=s.SHA512=r.extend({_doReset:function(){this._hash=new i.init([new n.init(1779033703,4089235720),new n.init(3144134277,2227873595),new n.init(1013904242,4271175723),new n.init(2773480762,1595750129),new n.init(1359893119,2917565137),new n.init(2600822924,725511199),new n.init(528734635,4215389547),new n.init(1541459225,327033209)])},_doProcessBlock:function(t,e){for(var r=(l=this._hash.words)[0],n=l[1],i=l[2],s=l[3],u=l[4],c=l[5],h=l[6],l=l[7],f=r.high,p=r.low,g=n.high,d=n.low,v=i.high,m=i.low,y=s.high,w=s.low,x=u.high,S=u.low,E=c.high,b=c.low,F=h.high,A=h.low,C=l.high,D=l.low,P=f,I=p,R=g,T=d,N=v,O=m,B=y,_=w,j=x,H=S,k=E,L=b,V=F,q=A,M=C,K=D,U=0;80>U;U++){var z=o[U];if(16>U)var W=z.high=0|t[e+2*U],G=z.low=0|t[e+2*U+1];else{W=((G=(W=o[U-15]).high)>>>1|($=W.low)<<31)^(G>>>8|$<<24)^G>>>7;var $=($>>>1|G<<31)^($>>>8|G<<24)^($>>>7|G<<25),J=((G=(J=o[U-2]).high)>>>19|(Y=J.low)<<13)^(G<<3|Y>>>29)^G>>>6,Y=(Y>>>19|G<<13)^(Y<<3|G>>>29)^(Y>>>6|G<<26),X=(G=o[U-7]).high,Z=(Q=o[U-16]).high,Q=Q.low;W=(W=(W=W+X+((G=$+G.low)>>>0<$>>>0?1:0))+J+((G=G+Y)>>>0<Y>>>0?1:0))+Z+((G=G+Q)>>>0<Q>>>0?1:0);z.high=W,z.low=G}X=j&k^~j&V,Q=H&L^~H&q,z=P&R^P&N^R&N;var tt=I&T^I&O^T&O,et=($=(P>>>28|I<<4)^(P<<30|I>>>2)^(P<<25|I>>>7),J=(I>>>28|P<<4)^(I<<30|P>>>2)^(I<<25|P>>>7),(Y=a[U]).high),rt=Y.low;Z=M+((j>>>14|H<<18)^(j>>>18|H<<14)^(j<<23|H>>>9))+((Y=K+((H>>>14|j<<18)^(H>>>18|j<<14)^(H<<23|j>>>9)))>>>0<K>>>0?1:0),M=V,K=q,V=k,q=L,k=j,L=H,j=B+(Z=(Z=(Z=Z+X+((Y=Y+Q)>>>0<Q>>>0?1:0))+et+((Y=Y+rt)>>>0<rt>>>0?1:0))+W+((Y=Y+G)>>>0<G>>>0?1:0))+((H=_+Y|0)>>>0<_>>>0?1:0)|0,B=N,_=O,N=R,O=T,R=P,T=I,P=Z+(z=$+z+((G=J+tt)>>>0<J>>>0?1:0))+((I=Y+G|0)>>>0<Y>>>0?1:0)|0}p=r.low=p+I,r.high=f+P+(p>>>0<I>>>0?1:0),d=n.low=d+T,n.high=g+R+(d>>>0<T>>>0?1:0),m=i.low=m+O,i.high=v+N+(m>>>0<O>>>0?1:0),w=s.low=w+_,s.high=y+B+(w>>>0<_>>>0?1:0),S=u.low=S+H,u.high=x+j+(S>>>0<H>>>0?1:0),b=c.low=b+L,c.high=E+k+(b>>>0<L>>>0?1:0),A=h.low=A+q,h.high=F+V+(A>>>0<q>>>0?1:0),D=l.low=D+K,l.high=C+M+(D>>>0<K>>>0?1:0)},_doFinalize:function(){var t=this._data,e=t.words,r=8*this._nDataBytes,n=8*t.sigBytes;return e[n>>>5]|=128<<24-n%32,e[30+(n+128>>>10<<5)]=Math.floor(r/4294967296),e[31+(n+128>>>10<<5)]=r,t.sigBytes=4*e.length,this._process(),this._hash.toX32()},clone:function(){var t=r.clone.call(this);return t._hash=this._hash.clone(),t},blockSize:32}),e.SHA512=r._createHelper(s),e.HmacSHA512=r._createHmacHelper(s)}(),function(){var t=st,e=(i=t.x64).Word,r=i.WordArray,n=(i=t.algo).SHA512,i=i.SHA384=n.extend({_doReset:function(){this._hash=new r.init([new e.init(3418070365,3238371032),new e.init(1654270250,914150663),new e.init(2438529370,812702999),new e.init(355462360,4144912697),new e.init(1731405415,4290775857),new e.init(2394180231,1750603025),new e.init(3675008525,1694076839),new e.init(1203062813,3204075428)])},_doFinalize:function(){var t=n._doFinalize.call(this);return t.sigBytes-=16,t}});t.SHA384=n._createHelper(i),t.HmacSHA384=n._createHmacHelper(i)}(),function(){var t=st,e=(n=t.lib).WordArray,r=n.Hasher,n=t.algo,i=e.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),s=e.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),a=e.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),o=e.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),u=e.create([0,1518500249,1859775393,2400959708,2840853838]),c=e.create([1352829926,1548603684,1836072691,2053994217,0]);n=n.RIPEMD160=r.extend({_doReset:function(){this._hash=e.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var r=0;16>r;r++){var n=t[x=e+r];t[x]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8)}var h,l,f,p,g,d,v,m,y,w,x=this._hash.words,S=(n=u.words,c.words),E=i.words,b=s.words,F=a.words,A=o.words;d=h=x[0],v=l=x[1],m=f=x[2],y=p=x[3],w=g=x[4];var C;for(r=0;80>r;r+=1)C=h+t[e+E[r]]|0,C=16>r?C+((l^f^p)+n[0]):32>r?C+((l&f|~l&p)+n[1]):48>r?C+(((l|~f)^p)+n[2]):64>r?C+((l&p|f&~p)+n[3]):C+((l^(f|~p))+n[4]),C=(C=(C|=0)<<F[r]|C>>>32-F[r])+g|0,h=g,g=p,p=f<<10|f>>>22,f=l,l=C,C=d+t[e+b[r]]|0,C=16>r?C+((v^(m|~y))+S[0]):32>r?C+((v&y|m&~y)+S[1]):48>r?C+(((v|~m)^y)+S[2]):64>r?C+((v&m|~v&y)+S[3]):C+((v^m^y)+S[4]),C=(C=(C|=0)<<A[r]|C>>>32-A[r])+w|0,d=w,w=y,y=m<<10|m>>>22,m=v,v=C;C=x[1]+f+y|0,x[1]=x[2]+p+w|0,x[2]=x[3]+g+d|0,x[3]=x[4]+h+v|0,x[4]=x[0]+l+m|0,x[0]=C},_doFinalize:function(){var t=this._data,e=t.words,r=8*this._nDataBytes,n=8*t.sigBytes;for(e[n>>>5]|=128<<24-n%32,e[14+(n+64>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),t.sigBytes=4*(e.length+1),this._process(),e=(t=this._hash).words,r=0;5>r;r++)n=e[r],e[r]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8);return t},clone:function(){var t=r.clone.call(this);return t._hash=this._hash.clone(),t}});t.RIPEMD160=r._createHelper(n),t.HmacRIPEMD160=r._createHmacHelper(n)}(),function(){var t=st,e=t.enc.Utf8;t.algo.HMAC=t.lib.Base.extend({init:function(t,r){t=this._hasher=new t.init,"string"==typeof r&&(r=e.parse(r));var n=t.blockSize,i=4*n;r.sigBytes>i&&(r=t.finalize(r)),r.clamp();for(var s=this._oKey=r.clone(),a=this._iKey=r.clone(),o=s.words,u=a.words,c=0;c<n;c++)o[c]^=1549556828,u[c]^=909522486;s.sigBytes=a.sigBytes=i,this.reset()},reset:function(){var t=this._hasher;t.reset(),t.update(this._iKey)},update:function(t){return this._hasher.update(t),this},finalize:function(t){var e=this._hasher;return t=e.finalize(t),e.reset(),e.finalize(this._oKey.clone().concat(t))}})}(),function(){var t,e=st,r=(t=e.lib).Base,n=t.WordArray,i=(t=e.algo).HMAC,s=t.PBKDF2=r.extend({cfg:r.extend({keySize:4,hasher:t.SHA1,iterations:1}),init:function(t){this.cfg=this.cfg.extend(t)},compute:function(t,e){var r=this.cfg,s=i.create(r.hasher,t),a=n.create(),o=n.create([1]),u=a.words,c=o.words,h=r.keySize;for(r=r.iterations;u.length<h;){var l=s.update(e).finalize(o);s.reset();for(var f=l.words,p=f.length,g=l,d=1;d<r;d++){g=s.finalize(g),s.reset();for(var v=g.words,m=0;m<p;m++)f[m]^=v[m]}a.concat(l),c[0]++}return a.sigBytes=4*h,a}});e.PBKDF2=function(t,e,r){return s.create(r).compute(t,e)}}();
|
|
1
|
+
import{ElMessage as t}from"ui-element-plus";import{getCurrentInstance as e,ref as r,onMounted as n,onBeforeUnmount as i,unref as s,computed as a,watch as o}from"vue";import u from"node-forge";const c={TOKEN:"token",USER_INFO:"userInfo",COMPANYCODE:"companyCode",COMPANYNAME:"companyName"},h="MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBAL/EwnX/3BaH5gJXJiv7qKhuKKol5JSgayGyYMWDdRO8KKAtOFrniXp/iAGGoV6Y0GF9Z8iY3xHOiU3rHeSJ3G6wFDY87Qr4k2m48/6YRX+s/iMGJ5j5obdCFiDkFUzoR/EHTqC6PM3h6bhDNNIXQpqVbQrg28tW5Y57+yxqRrUjAgMBAAECgYAHlgB9S3xI1eJm6Eylw8RFuWnZZTtYF8p1IEnMtmkMuU5AG9nVWsBo/J+EM++xPslLefr/h/CXEz0CPJFHp551HucLlRA7EOXSPfwLGODlz5rMnXyM8jD3ZMACXsRLvLEiNt+0nP+G7M+Dxuf6SLkmvqYa/NdJACb5/16E2P+pNQJBAO0hgUcKYfvJSXVolonVQNpR8Hu/4LH+5bBVLef+D6JNP6x0hr9U/ce+nI7I5wIPbBgFknvCWfVbgz16tPZhmC0CQQDPBzLArfdUfMs2h/3cxQAeZnX0ybt3F6CR3K9dliDJRn1p3ovdK0OmyggpKfx94KH+VRcJSaWTHLeFvub8KgSPAkEAhUWcY7HZKeqSB5OVb7fT8B+3OcW4YjFxI+5rk4Q9gylJTQJcrPH2g6mEUddlxcmnJcUT88xiRLx/ATGSvRpSrQJAJSfTkgUm6IDlL8pEY4TvuoUFEoPKI1uYM9V5m8A/7h+6jm+khnMnVx3XTRv99tGEAVNgKQiQsNBsl5JlfkhEPQJBAJ2nPXpGolp/R5usP+LP314snwj93G54+HaZnuOoIB0ApusErnpWCSHXbQtvXKo1n6SE3ccp010CPJBnOm/LRaA=",l={d:"M73.75498878 312.79929781L689.59344939 960.31767875A98.63975344 98.63975344 0 0 0 762.55326659 991.9976a98.63975344 98.63975344 0 0 0 72.71981813-31.67992125L1451.3515444 312.79929781a106.55973375 106.55973375 0 0 0 23.99994-114.23971406 113.75971594 113.75971594 0 0 0-96.95975719-70.55982375l-1231.19692219 0a113.27971688 113.27971688 0 0 0-97.19975718 70.31982375 106.55973375 106.55973375 0 0 0 23.75994094 114.47971406z",fill:"#001533"},f={viewBox:"0 0 1536 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em"},p=/^1[3-9]\d{9}$/,g=["/accounting/accounting-voucher-detail","/accounting/accounting-voucher-add","/accounting/accounting-voucher-red"],d=["/login","/404","/403","/register","/file-views","/iitc","/account"],v="user_menu_data";function m(){const t=e();return t?t.appContext.config.globalProperties:(console.error("请在 setup 中使用 getGlobalProperties"),{})}function y(){return localStorage.getItem(c.TOKEN)}function w(t){localStorage.setItem(c.TOKEN,t)}function x(){localStorage.removeItem(c.TOKEN)}function S(){return localStorage.getItem(c.USER_INFO)}function E(t){localStorage.setItem(c.USER_INFO,t)}function b(){localStorage.removeItem(c.USER_INFO)}function F(){return localStorage.getItem(c.COMPANYCODE)}function A(t){localStorage.setItem(c.COMPANYCODE,t)}function D(){localStorage.removeItem(c.COMPANYCODE)}function C(){return localStorage.getItem(c.COMPANYNAME)}function I(t){localStorage.setItem(c.COMPANYNAME,t)}function P(){localStorage.removeItem(c.COMPANYNAME)}function R(){return localStorage.getItem(c.COMPANYTYPE)}function T(t){localStorage.setItem(c.COMPANYTYPE,t)}function N(){localStorage.removeItem(c.COMPANYTYPE)}function O(){return localStorage.getItem(c.COMPANYACCOUNTPERIOD)}function B(t){localStorage.setItem(c.COMPANYACCOUNTPERIOD,t)}function _(){localStorage.removeItem(c.COMPANYACCOUNTPERIOD)}function j(){return localStorage.getItem(c.COMPANYAUDITSTATUSMSG)}function H(t){localStorage.setItem(c.COMPANYAUDITSTATUSMSG,t)}function k(){localStorage.removeItem(c.COMPANYAUDITSTATUSMSG)}function L(){return localStorage.getItem(c.COMPANYACCOUNTPERIODNOW)}function V(t){localStorage.setItem(c.COMPANYACCOUNTPERIODNOW,t)}function q(){localStorage.removeItem(c.COMPANYACCOUNTPERIODNOW)}function M(){return localStorage.getItem(c.COMPANYAUDITSTATUSMSGNOW)}function K(t){localStorage.setItem(c.COMPANYAUDITSTATUSMSGNOW,t)}function U(){localStorage.removeItem(c.COMPANYAUDITSTATUSMSGNOW)}function z(){return localStorage.getItem(c.FINANCIALSTANDARDDICTTYPE)}function W(t){localStorage.setItem(c.FINANCIALSTANDARDDICTTYPE,t)}function G(){localStorage.removeItem(c.FINANCIALSTANDARDDICTTYPE)}var $,J,Y,X,Z,Q,tt,et,rt,nt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},it={userAgent:!1},st={},at=at||function(t){var e={},r=e.lib={},n=r.Base=function(){function t(){}return{extend:function(e){t.prototype=this;var r=new t;return e&&r.mixIn(e),r.hasOwnProperty("init")||(r.init=function(){r.$super.init.apply(this,arguments)}),r.init.prototype=r,r.$super=this,r},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),i=r.WordArray=n.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=null!=e?e:4*t.length},toString:function(t){return(t||a).stringify(this)},concat:function(t){var e=this.words,r=t.words,n=this.sigBytes,i=t.sigBytes;if(this.clamp(),n%4)for(var s=0;s<i;s++){var a=r[s>>>2]>>>24-s%4*8&255;e[n+s>>>2]|=a<<24-(n+s)%4*8}else for(s=0;s<i;s+=4)e[n+s>>>2]=r[s>>>2];return this.sigBytes+=i,this},clamp:function(){var e=this.words,r=this.sigBytes;e[r>>>2]&=4294967295<<32-r%4*8,e.length=t.ceil(r/4)},clone:function(){var t=n.clone.call(this);return t.words=this.words.slice(0),t},random:function(e){for(var r=[],n=0;n<e;n+=4)r.push(4294967296*t.random()|0);return new i.init(r,e)}}),s=e.enc={},a=s.Hex={stringify:function(t){for(var e=t.words,r=t.sigBytes,n=[],i=0;i<r;i++){var s=e[i>>>2]>>>24-i%4*8&255;n.push((s>>>4).toString(16)),n.push((15&s).toString(16))}return n.join("")},parse:function(t){for(var e=t.length,r=[],n=0;n<e;n+=2)r[n>>>3]|=parseInt(t.substr(n,2),16)<<24-n%8*4;return new i.init(r,e/2)}},o=s.Latin1={stringify:function(t){for(var e=t.words,r=t.sigBytes,n=[],i=0;i<r;i++){var s=e[i>>>2]>>>24-i%4*8&255;n.push(String.fromCharCode(s))}return n.join("")},parse:function(t){for(var e=t.length,r=[],n=0;n<e;n++)r[n>>>2]|=(255&t.charCodeAt(n))<<24-n%4*8;return new i.init(r,e)}},u=s.Utf8={stringify:function(t){try{return decodeURIComponent(escape(o.stringify(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(t){return o.parse(unescape(encodeURIComponent(t)))}},c=r.BufferedBlockAlgorithm=n.extend({reset:function(){this._data=new i.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=u.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(e){var r=this._data,n=r.words,s=r.sigBytes,a=this.blockSize,o=s/(4*a),u=(o=e?t.ceil(o):t.max((0|o)-this._minBufferSize,0))*a,c=t.min(4*u,s);if(u){for(var h=0;h<u;h+=a)this._doProcessBlock(n,h);var l=n.splice(0,u);r.sigBytes-=c}return new i.init(l,c)},clone:function(){var t=n.clone.call(this);return t._data=this._data.clone(),t},_minBufferSize:0});r.Hasher=c.extend({cfg:n.extend(),init:function(t){this.cfg=this.cfg.extend(t),this.reset()},reset:function(){c.reset.call(this),this._doReset()},update:function(t){return this._append(t),this._process(),this},finalize:function(t){return t&&this._append(t),this._doFinalize()},blockSize:16,_createHelper:function(t){return function(e,r){return new t.init(r).finalize(e)}},_createHmacHelper:function(t){return function(e,r){return new h.HMAC.init(t,r).finalize(e)}}});var h=e.algo={};return e}(Math);J=($=at).lib,Y=J.Base,X=J.WordArray,($=$.x64={}).Word=Y.extend({init:function(t,e){this.high=t,this.low=e}}),$.WordArray=Y.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=null!=e?e:8*t.length},toX32:function(){for(var t=this.words,e=t.length,r=[],n=0;n<e;n++){var i=t[n];r.push(i.high),r.push(i.low)}return X.create(r,this.sigBytes)},clone:function(){for(var t=Y.clone.call(this),e=t.words=this.words.slice(0),r=e.length,n=0;n<r;n++)e[n]=e[n].clone();return t}}),at.lib.Cipher||function(){var t=(f=at).lib,e=t.Base,r=t.WordArray,n=t.BufferedBlockAlgorithm,i=f.enc.Base64,s=f.algo.EvpKDF,a=t.Cipher=n.extend({cfg:e.extend(),createEncryptor:function(t,e){return this.create(this._ENC_XFORM_MODE,t,e)},createDecryptor:function(t,e){return this.create(this._DEC_XFORM_MODE,t,e)},init:function(t,e,r){this.cfg=this.cfg.extend(r),this._xformMode=t,this._key=e,this.reset()},reset:function(){n.reset.call(this),this._doReset()},process:function(t){return this._append(t),this._process()},finalize:function(t){return t&&this._append(t),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(t){return{encrypt:function(e,r,n){return("string"==typeof r?p:l).encrypt(t,e,r,n)},decrypt:function(e,r,n){return("string"==typeof r?p:l).decrypt(t,e,r,n)}}}});t.StreamCipher=a.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var o=f.mode={},u=function(t,e,r){var n=this._iv;n?this._iv=undefined:n=this._prevBlock;for(var i=0;i<r;i++)t[e+i]^=n[i]},c=(t.BlockCipherMode=e.extend({createEncryptor:function(t,e){return this.Encryptor.create(t,e)},createDecryptor:function(t,e){return this.Decryptor.create(t,e)},init:function(t,e){this._cipher=t,this._iv=e}})).extend();c.Encryptor=c.extend({processBlock:function(t,e){var r=this._cipher,n=r.blockSize;u.call(this,t,e,n),r.encryptBlock(t,e),this._prevBlock=t.slice(e,e+n)}}),c.Decryptor=c.extend({processBlock:function(t,e){var r=this._cipher,n=r.blockSize,i=t.slice(e,e+n);r.decryptBlock(t,e),u.call(this,t,e,n),this._prevBlock=i}}),o=o.CBC=c,c=(f.pad={}).Pkcs7={pad:function(t,e){for(var n,i=(n=(n=4*e)-t.sigBytes%n)<<24|n<<16|n<<8|n,s=[],a=0;a<n;a+=4)s.push(i);n=r.create(s,n),t.concat(n)},unpad:function(t){t.sigBytes-=255&t.words[t.sigBytes-1>>>2]}},t.BlockCipher=a.extend({cfg:a.cfg.extend({mode:o,padding:c}),reset:function(){a.reset.call(this);var t=(e=this.cfg).iv,e=e.mode;if(this._xformMode==this._ENC_XFORM_MODE)var r=e.createEncryptor;else r=e.createDecryptor,this._minBufferSize=1;this._mode=r.call(e,this,t&&t.words)},_doProcessBlock:function(t,e){this._mode.processBlock(t,e)},_doFinalize:function(){var t=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){t.pad(this._data,this.blockSize);var e=this._process(!0)}else e=this._process(!0),t.unpad(e);return e},blockSize:4});var h=t.CipherParams=e.extend({init:function(t){this.mixIn(t)},toString:function(t){return(t||this.formatter).stringify(this)}}),l=(o=(f.format={}).OpenSSL={stringify:function(t){var e=t.ciphertext;return((t=t.salt)?r.create([1398893684,1701076831]).concat(t).concat(e):e).toString(i)},parse:function(t){var e=(t=i.parse(t)).words;if(1398893684==e[0]&&1701076831==e[1]){var n=r.create(e.slice(2,4));e.splice(0,4),t.sigBytes-=16}return h.create({ciphertext:t,salt:n})}},t.SerializableCipher=e.extend({cfg:e.extend({format:o}),encrypt:function(t,e,r,n){n=this.cfg.extend(n);var i=t.createEncryptor(r,n);return e=i.finalize(e),i=i.cfg,h.create({ciphertext:e,key:r,iv:i.iv,algorithm:t,mode:i.mode,padding:i.padding,blockSize:t.blockSize,formatter:n.format})},decrypt:function(t,e,r,n){return n=this.cfg.extend(n),e=this._parse(e,n.format),t.createDecryptor(r,n).finalize(e.ciphertext)},_parse:function(t,e){return"string"==typeof t?e.parse(t,this):t}})),f=(f.kdf={}).OpenSSL={execute:function(t,e,n,i){return i||(i=r.random(8)),t=s.create({keySize:e+n}).compute(t,i),n=r.create(t.words.slice(e),4*n),t.sigBytes=4*e,h.create({key:t,iv:n,salt:i})}},p=t.PasswordBasedCipher=l.extend({cfg:l.cfg.extend({kdf:f}),encrypt:function(t,e,r,n){return r=(n=this.cfg.extend(n)).kdf.execute(r,t.keySize,t.ivSize),n.iv=r.iv,(t=l.encrypt.call(this,t,e,r.key,n)).mixIn(r),t},decrypt:function(t,e,r,n){return n=this.cfg.extend(n),e=this._parse(e,n.format),r=n.kdf.execute(r,t.keySize,t.ivSize,e.salt),n.iv=r.iv,l.decrypt.call(this,t,e,r.key,n)}})}(),function(){for(var t=at,e=t.lib.BlockCipher,r=t.algo,n=[],i=[],s=[],a=[],o=[],u=[],c=[],h=[],l=[],f=[],p=[],g=0;256>g;g++)p[g]=128>g?g<<1:g<<1^283;var d=0,v=0;for(g=0;256>g;g++){var m=(m=v^v<<1^v<<2^v<<3^v<<4)>>>8^255&m^99;n[d]=m,i[m]=d;var y=p[d],w=p[y],x=p[w],S=257*p[m]^16843008*m;s[d]=S<<24|S>>>8,a[d]=S<<16|S>>>16,o[d]=S<<8|S>>>24,u[d]=S,S=16843009*x^65537*w^257*y^16843008*d,c[m]=S<<24|S>>>8,h[m]=S<<16|S>>>16,l[m]=S<<8|S>>>24,f[m]=S,d?(d=y^p[p[p[x^y]]],v^=p[p[v]]):d=v=1}var E=[0,1,2,4,8,16,32,64,128,27,54];r=r.AES=e.extend({_doReset:function(){for(var t=(r=this._key).words,e=r.sigBytes/4,r=4*((this._nRounds=e+6)+1),i=this._keySchedule=[],s=0;s<r;s++)if(s<e)i[s]=t[s];else{var a=i[s-1];s%e?6<e&&4==s%e&&(a=n[a>>>24]<<24|n[a>>>16&255]<<16|n[a>>>8&255]<<8|n[255&a]):(a=n[(a=a<<8|a>>>24)>>>24]<<24|n[a>>>16&255]<<16|n[a>>>8&255]<<8|n[255&a],a^=E[s/e|0]<<24),i[s]=i[s-e]^a}for(t=this._invKeySchedule=[],e=0;e<r;e++)s=r-e,a=e%4?i[s]:i[s-4],t[e]=4>e||4>=s?a:c[n[a>>>24]]^h[n[a>>>16&255]]^l[n[a>>>8&255]]^f[n[255&a]]},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._keySchedule,s,a,o,u,n)},decryptBlock:function(t,e){var r=t[e+1];t[e+1]=t[e+3],t[e+3]=r,this._doCryptBlock(t,e,this._invKeySchedule,c,h,l,f,i),r=t[e+1],t[e+1]=t[e+3],t[e+3]=r},_doCryptBlock:function(t,e,r,n,i,s,a,o){for(var u=this._nRounds,c=t[e]^r[0],h=t[e+1]^r[1],l=t[e+2]^r[2],f=t[e+3]^r[3],p=4,g=1;g<u;g++){var d=n[c>>>24]^i[h>>>16&255]^s[l>>>8&255]^a[255&f]^r[p++],v=n[h>>>24]^i[l>>>16&255]^s[f>>>8&255]^a[255&c]^r[p++],m=n[l>>>24]^i[f>>>16&255]^s[c>>>8&255]^a[255&h]^r[p++];f=n[f>>>24]^i[c>>>16&255]^s[h>>>8&255]^a[255&l]^r[p++],c=d,h=v,l=m}d=(o[c>>>24]<<24|o[h>>>16&255]<<16|o[l>>>8&255]<<8|o[255&f])^r[p++],v=(o[h>>>24]<<24|o[l>>>16&255]<<16|o[f>>>8&255]<<8|o[255&c])^r[p++],m=(o[l>>>24]<<24|o[f>>>16&255]<<16|o[c>>>8&255]<<8|o[255&h])^r[p++],f=(o[f>>>24]<<24|o[c>>>16&255]<<16|o[h>>>8&255]<<8|o[255&l])^r[p++],t[e]=d,t[e+1]=v,t[e+2]=m,t[e+3]=f},keySize:8});t.AES=e._createHelper(r)}(),function(){function t(t,e){var r=(this._lBlock>>>t^this._rBlock)&e;this._rBlock^=r,this._lBlock^=r<<t}function e(t,e){var r=(this._rBlock>>>t^this._lBlock)&e;this._lBlock^=r,this._rBlock^=r<<t}var r=at,n=(i=r.lib).WordArray,i=i.BlockCipher,s=r.algo,a=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],o=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],u=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],c=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],h=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],l=s.DES=i.extend({_doReset:function(){for(var t=this._key.words,e=[],r=0;56>r;r++){var n=a[r]-1;e[r]=t[n>>>5]>>>31-n%32&1}for(t=this._subKeys=[],n=0;16>n;n++){var i=t[n]=[],s=u[n];for(r=0;24>r;r++)i[r/6|0]|=e[(o[r]-1+s)%28]<<31-r%6,i[4+(r/6|0)]|=e[28+(o[r+24]-1+s)%28]<<31-r%6;for(i[0]=i[0]<<1|i[0]>>>31,r=1;7>r;r++)i[r]>>>=4*(r-1)+3;i[7]=i[7]<<5|i[7]>>>27}for(e=this._invSubKeys=[],r=0;16>r;r++)e[r]=t[15-r]},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._subKeys)},decryptBlock:function(t,e){this._doCryptBlock(t,e,this._invSubKeys)},_doCryptBlock:function(r,n,i){this._lBlock=r[n],this._rBlock=r[n+1],t.call(this,4,252645135),t.call(this,16,65535),e.call(this,2,858993459),e.call(this,8,16711935),t.call(this,1,1431655765);for(var s=0;16>s;s++){for(var a=i[s],o=this._lBlock,u=this._rBlock,l=0,f=0;8>f;f++)l|=c[f][((u^a[f])&h[f])>>>0];this._lBlock=u,this._rBlock=o^l}i=this._lBlock,this._lBlock=this._rBlock,this._rBlock=i,t.call(this,1,1431655765),e.call(this,8,16711935),e.call(this,2,858993459),t.call(this,16,65535),t.call(this,4,252645135),r[n]=this._lBlock,r[n+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});r.DES=i._createHelper(l),s=s.TripleDES=i.extend({_doReset:function(){var t=this._key.words;this._des1=l.createEncryptor(n.create(t.slice(0,2))),this._des2=l.createEncryptor(n.create(t.slice(2,4))),this._des3=l.createEncryptor(n.create(t.slice(4,6)))},encryptBlock:function(t,e){this._des1.encryptBlock(t,e),this._des2.decryptBlock(t,e),this._des3.encryptBlock(t,e)},decryptBlock:function(t,e){this._des3.decryptBlock(t,e),this._des2.encryptBlock(t,e),this._des1.decryptBlock(t,e)},keySize:6,ivSize:2,blockSize:2}),r.TripleDES=i._createHelper(s)}(),function(){var t=at,e=t.lib.WordArray;t.enc.Base64={stringify:function(t){var e=t.words,r=t.sigBytes,n=this._map;t.clamp(),t=[];for(var i=0;i<r;i+=3)for(var s=(e[i>>>2]>>>24-i%4*8&255)<<16|(e[i+1>>>2]>>>24-(i+1)%4*8&255)<<8|e[i+2>>>2]>>>24-(i+2)%4*8&255,a=0;4>a&&i+.75*a<r;a++)t.push(n.charAt(s>>>6*(3-a)&63));if(e=n.charAt(64))for(;t.length%4;)t.push(e);return t.join("")},parse:function(t){var r=t.length,n=this._map;(i=n.charAt(64))&&(-1!=(i=t.indexOf(i))&&(r=i));for(var i=[],s=0,a=0;a<r;a++)if(a%4){var o=n.indexOf(t.charAt(a-1))<<a%4*2,u=n.indexOf(t.charAt(a))>>>6-a%4*2;i[s>>>2]|=(o|u)<<24-s%4*8,s++}return e.create(i,s)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),function(t){function e(t,e,r,n,i,s,a){return((t=t+(e&r|~e&n)+i+a)<<s|t>>>32-s)+e}function r(t,e,r,n,i,s,a){return((t=t+(e&n|r&~n)+i+a)<<s|t>>>32-s)+e}function n(t,e,r,n,i,s,a){return((t=t+(e^r^n)+i+a)<<s|t>>>32-s)+e}function i(t,e,r,n,i,s,a){return((t=t+(r^(e|~n))+i+a)<<s|t>>>32-s)+e}for(var s=at,a=(u=s.lib).WordArray,o=u.Hasher,u=s.algo,c=[],h=0;64>h;h++)c[h]=4294967296*t.abs(t.sin(h+1))|0;u=u.MD5=o.extend({_doReset:function(){this._hash=new a.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(t,s){for(var a=0;16>a;a++){var o=t[u=s+a];t[u]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8)}a=this._hash.words;var u=t[s+0],h=(o=t[s+1],t[s+2]),l=t[s+3],f=t[s+4],p=t[s+5],g=t[s+6],d=t[s+7],v=t[s+8],m=t[s+9],y=t[s+10],w=t[s+11],x=t[s+12],S=t[s+13],E=t[s+14],b=t[s+15],F=e(F=a[0],C=a[1],D=a[2],A=a[3],u,7,c[0]),A=e(A,F,C,D,o,12,c[1]),D=e(D,A,F,C,h,17,c[2]),C=e(C,D,A,F,l,22,c[3]);F=e(F,C,D,A,f,7,c[4]),A=e(A,F,C,D,p,12,c[5]),D=e(D,A,F,C,g,17,c[6]),C=e(C,D,A,F,d,22,c[7]),F=e(F,C,D,A,v,7,c[8]),A=e(A,F,C,D,m,12,c[9]),D=e(D,A,F,C,y,17,c[10]),C=e(C,D,A,F,w,22,c[11]),F=e(F,C,D,A,x,7,c[12]),A=e(A,F,C,D,S,12,c[13]),D=e(D,A,F,C,E,17,c[14]),F=r(F,C=e(C,D,A,F,b,22,c[15]),D,A,o,5,c[16]),A=r(A,F,C,D,g,9,c[17]),D=r(D,A,F,C,w,14,c[18]),C=r(C,D,A,F,u,20,c[19]),F=r(F,C,D,A,p,5,c[20]),A=r(A,F,C,D,y,9,c[21]),D=r(D,A,F,C,b,14,c[22]),C=r(C,D,A,F,f,20,c[23]),F=r(F,C,D,A,m,5,c[24]),A=r(A,F,C,D,E,9,c[25]),D=r(D,A,F,C,l,14,c[26]),C=r(C,D,A,F,v,20,c[27]),F=r(F,C,D,A,S,5,c[28]),A=r(A,F,C,D,h,9,c[29]),D=r(D,A,F,C,d,14,c[30]),F=n(F,C=r(C,D,A,F,x,20,c[31]),D,A,p,4,c[32]),A=n(A,F,C,D,v,11,c[33]),D=n(D,A,F,C,w,16,c[34]),C=n(C,D,A,F,E,23,c[35]),F=n(F,C,D,A,o,4,c[36]),A=n(A,F,C,D,f,11,c[37]),D=n(D,A,F,C,d,16,c[38]),C=n(C,D,A,F,y,23,c[39]),F=n(F,C,D,A,S,4,c[40]),A=n(A,F,C,D,u,11,c[41]),D=n(D,A,F,C,l,16,c[42]),C=n(C,D,A,F,g,23,c[43]),F=n(F,C,D,A,m,4,c[44]),A=n(A,F,C,D,x,11,c[45]),D=n(D,A,F,C,b,16,c[46]),F=i(F,C=n(C,D,A,F,h,23,c[47]),D,A,u,6,c[48]),A=i(A,F,C,D,d,10,c[49]),D=i(D,A,F,C,E,15,c[50]),C=i(C,D,A,F,p,21,c[51]),F=i(F,C,D,A,x,6,c[52]),A=i(A,F,C,D,l,10,c[53]),D=i(D,A,F,C,y,15,c[54]),C=i(C,D,A,F,o,21,c[55]),F=i(F,C,D,A,v,6,c[56]),A=i(A,F,C,D,b,10,c[57]),D=i(D,A,F,C,g,15,c[58]),C=i(C,D,A,F,S,21,c[59]),F=i(F,C,D,A,f,6,c[60]),A=i(A,F,C,D,w,10,c[61]),D=i(D,A,F,C,h,15,c[62]),C=i(C,D,A,F,m,21,c[63]);a[0]=a[0]+F|0,a[1]=a[1]+C|0,a[2]=a[2]+D|0,a[3]=a[3]+A|0},_doFinalize:function(){var e=this._data,r=e.words,n=8*this._nDataBytes,i=8*e.sigBytes;r[i>>>5]|=128<<24-i%32;var s=t.floor(n/4294967296);for(r[15+(i+64>>>9<<4)]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),r[14+(i+64>>>9<<4)]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),e.sigBytes=4*(r.length+1),this._process(),r=(e=this._hash).words,n=0;4>n;n++)i=r[n],r[n]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8);return e},clone:function(){var t=o.clone.call(this);return t._hash=this._hash.clone(),t}}),s.MD5=o._createHelper(u),s.HmacMD5=o._createHmacHelper(u)}(Math),Q=(rt=(Z=at).lib).WordArray,tt=rt.Hasher,et=[],rt=Z.algo.SHA1=tt.extend({_doReset:function(){this._hash=new Q.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var r=this._hash.words,n=r[0],i=r[1],s=r[2],a=r[3],o=r[4],u=0;80>u;u++){if(16>u)et[u]=0|t[e+u];else{var c=et[u-3]^et[u-8]^et[u-14]^et[u-16];et[u]=c<<1|c>>>31}c=(n<<5|n>>>27)+o+et[u],c=20>u?c+(1518500249+(i&s|~i&a)):40>u?c+(1859775393+(i^s^a)):60>u?c+((i&s|i&a|s&a)-1894007588):c+((i^s^a)-899497514),o=a,a=s,s=i<<30|i>>>2,i=n,n=c}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+s|0,r[3]=r[3]+a|0,r[4]=r[4]+o|0},_doFinalize:function(){var t=this._data,e=t.words,r=8*this._nDataBytes,n=8*t.sigBytes;return e[n>>>5]|=128<<24-n%32,e[14+(n+64>>>9<<4)]=Math.floor(r/4294967296),e[15+(n+64>>>9<<4)]=r,t.sigBytes=4*e.length,this._process(),this._hash},clone:function(){var t=tt.clone.call(this);return t._hash=this._hash.clone(),t}}),Z.SHA1=tt._createHelper(rt),Z.HmacSHA1=tt._createHmacHelper(rt),function(t){for(var e=at,r=(i=e.lib).WordArray,n=i.Hasher,i=e.algo,s=[],a=[],o=function(t){return 4294967296*(t-(0|t))|0},u=2,c=0;64>c;){var h;t:{h=u;for(var l=t.sqrt(h),f=2;f<=l;f++)if(!(h%f)){h=!1;break t}h=!0}h&&(8>c&&(s[c]=o(t.pow(u,.5))),a[c]=o(t.pow(u,1/3)),c++),u++}var p=[];i=i.SHA256=n.extend({_doReset:function(){this._hash=new r.init(s.slice(0))},_doProcessBlock:function(t,e){for(var r=this._hash.words,n=r[0],i=r[1],s=r[2],o=r[3],u=r[4],c=r[5],h=r[6],l=r[7],f=0;64>f;f++){if(16>f)p[f]=0|t[e+f];else{var g=p[f-15],d=p[f-2];p[f]=((g<<25|g>>>7)^(g<<14|g>>>18)^g>>>3)+p[f-7]+((d<<15|d>>>17)^(d<<13|d>>>19)^d>>>10)+p[f-16]}g=l+((u<<26|u>>>6)^(u<<21|u>>>11)^(u<<7|u>>>25))+(u&c^~u&h)+a[f]+p[f],d=((n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22))+(n&i^n&s^i&s),l=h,h=c,c=u,u=o+g|0,o=s,s=i,i=n,n=g+d|0}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+s|0,r[3]=r[3]+o|0,r[4]=r[4]+u|0,r[5]=r[5]+c|0,r[6]=r[6]+h|0,r[7]=r[7]+l|0},_doFinalize:function(){var e=this._data,r=e.words,n=8*this._nDataBytes,i=8*e.sigBytes;return r[i>>>5]|=128<<24-i%32,r[14+(i+64>>>9<<4)]=t.floor(n/4294967296),r[15+(i+64>>>9<<4)]=n,e.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var t=n.clone.call(this);return t._hash=this._hash.clone(),t}});e.SHA256=n._createHelper(i),e.HmacSHA256=n._createHmacHelper(i)}(Math),function(){var t=at,e=t.lib.WordArray,r=(n=t.algo).SHA256,n=n.SHA224=r.extend({_doReset:function(){this._hash=new e.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var t=r._doFinalize.call(this);return t.sigBytes-=4,t}});t.SHA224=r._createHelper(n),t.HmacSHA224=r._createHmacHelper(n)}(),function(){function t(){return n.create.apply(n,arguments)}for(var e=at,r=e.lib.Hasher,n=(s=e.x64).Word,i=s.WordArray,s=e.algo,a=[t(1116352408,3609767458),t(1899447441,602891725),t(3049323471,3964484399),t(3921009573,2173295548),t(961987163,4081628472),t(1508970993,3053834265),t(2453635748,2937671579),t(2870763221,3664609560),t(3624381080,2734883394),t(310598401,1164996542),t(607225278,1323610764),t(1426881987,3590304994),t(1925078388,4068182383),t(2162078206,991336113),t(2614888103,633803317),t(3248222580,3479774868),t(3835390401,2666613458),t(4022224774,944711139),t(264347078,2341262773),t(604807628,2007800933),t(770255983,1495990901),t(1249150122,1856431235),t(1555081692,3175218132),t(1996064986,2198950837),t(2554220882,3999719339),t(2821834349,766784016),t(2952996808,2566594879),t(3210313671,3203337956),t(3336571891,1034457026),t(3584528711,2466948901),t(113926993,3758326383),t(338241895,168717936),t(666307205,1188179964),t(773529912,1546045734),t(1294757372,1522805485),t(1396182291,2643833823),t(1695183700,2343527390),t(1986661051,1014477480),t(2177026350,1206759142),t(2456956037,344077627),t(2730485921,1290863460),t(2820302411,3158454273),t(3259730800,3505952657),t(3345764771,106217008),t(3516065817,3606008344),t(3600352804,1432725776),t(4094571909,1467031594),t(275423344,851169720),t(430227734,3100823752),t(506948616,1363258195),t(659060556,3750685593),t(883997877,3785050280),t(958139571,3318307427),t(1322822218,3812723403),t(1537002063,2003034995),t(1747873779,3602036899),t(1955562222,1575990012),t(2024104815,1125592928),t(2227730452,2716904306),t(2361852424,442776044),t(2428436474,593698344),t(2756734187,3733110249),t(3204031479,2999351573),t(3329325298,3815920427),t(3391569614,3928383900),t(3515267271,566280711),t(3940187606,3454069534),t(4118630271,4000239992),t(116418474,1914138554),t(174292421,2731055270),t(289380356,3203993006),t(460393269,320620315),t(685471733,587496836),t(852142971,1086792851),t(1017036298,365543100),t(1126000580,2618297676),t(1288033470,3409855158),t(1501505948,4234509866),t(1607167915,987167468),t(1816402316,1246189591)],o=[],u=0;80>u;u++)o[u]=t();s=s.SHA512=r.extend({_doReset:function(){this._hash=new i.init([new n.init(1779033703,4089235720),new n.init(3144134277,2227873595),new n.init(1013904242,4271175723),new n.init(2773480762,1595750129),new n.init(1359893119,2917565137),new n.init(2600822924,725511199),new n.init(528734635,4215389547),new n.init(1541459225,327033209)])},_doProcessBlock:function(t,e){for(var r=(l=this._hash.words)[0],n=l[1],i=l[2],s=l[3],u=l[4],c=l[5],h=l[6],l=l[7],f=r.high,p=r.low,g=n.high,d=n.low,v=i.high,m=i.low,y=s.high,w=s.low,x=u.high,S=u.low,E=c.high,b=c.low,F=h.high,A=h.low,D=l.high,C=l.low,I=f,P=p,R=g,T=d,N=v,O=m,B=y,_=w,j=x,H=S,k=E,L=b,V=F,q=A,M=D,K=C,U=0;80>U;U++){var z=o[U];if(16>U)var W=z.high=0|t[e+2*U],G=z.low=0|t[e+2*U+1];else{W=((G=(W=o[U-15]).high)>>>1|($=W.low)<<31)^(G>>>8|$<<24)^G>>>7;var $=($>>>1|G<<31)^($>>>8|G<<24)^($>>>7|G<<25),J=((G=(J=o[U-2]).high)>>>19|(Y=J.low)<<13)^(G<<3|Y>>>29)^G>>>6,Y=(Y>>>19|G<<13)^(Y<<3|G>>>29)^(Y>>>6|G<<26),X=(G=o[U-7]).high,Z=(Q=o[U-16]).high,Q=Q.low;W=(W=(W=W+X+((G=$+G.low)>>>0<$>>>0?1:0))+J+((G=G+Y)>>>0<Y>>>0?1:0))+Z+((G=G+Q)>>>0<Q>>>0?1:0);z.high=W,z.low=G}X=j&k^~j&V,Q=H&L^~H&q,z=I&R^I&N^R&N;var tt=P&T^P&O^T&O,et=($=(I>>>28|P<<4)^(I<<30|P>>>2)^(I<<25|P>>>7),J=(P>>>28|I<<4)^(P<<30|I>>>2)^(P<<25|I>>>7),(Y=a[U]).high),rt=Y.low;Z=M+((j>>>14|H<<18)^(j>>>18|H<<14)^(j<<23|H>>>9))+((Y=K+((H>>>14|j<<18)^(H>>>18|j<<14)^(H<<23|j>>>9)))>>>0<K>>>0?1:0),M=V,K=q,V=k,q=L,k=j,L=H,j=B+(Z=(Z=(Z=Z+X+((Y=Y+Q)>>>0<Q>>>0?1:0))+et+((Y=Y+rt)>>>0<rt>>>0?1:0))+W+((Y=Y+G)>>>0<G>>>0?1:0))+((H=_+Y|0)>>>0<_>>>0?1:0)|0,B=N,_=O,N=R,O=T,R=I,T=P,I=Z+(z=$+z+((G=J+tt)>>>0<J>>>0?1:0))+((P=Y+G|0)>>>0<Y>>>0?1:0)|0}p=r.low=p+P,r.high=f+I+(p>>>0<P>>>0?1:0),d=n.low=d+T,n.high=g+R+(d>>>0<T>>>0?1:0),m=i.low=m+O,i.high=v+N+(m>>>0<O>>>0?1:0),w=s.low=w+_,s.high=y+B+(w>>>0<_>>>0?1:0),S=u.low=S+H,u.high=x+j+(S>>>0<H>>>0?1:0),b=c.low=b+L,c.high=E+k+(b>>>0<L>>>0?1:0),A=h.low=A+q,h.high=F+V+(A>>>0<q>>>0?1:0),C=l.low=C+K,l.high=D+M+(C>>>0<K>>>0?1:0)},_doFinalize:function(){var t=this._data,e=t.words,r=8*this._nDataBytes,n=8*t.sigBytes;return e[n>>>5]|=128<<24-n%32,e[30+(n+128>>>10<<5)]=Math.floor(r/4294967296),e[31+(n+128>>>10<<5)]=r,t.sigBytes=4*e.length,this._process(),this._hash.toX32()},clone:function(){var t=r.clone.call(this);return t._hash=this._hash.clone(),t},blockSize:32}),e.SHA512=r._createHelper(s),e.HmacSHA512=r._createHmacHelper(s)}(),function(){var t=at,e=(i=t.x64).Word,r=i.WordArray,n=(i=t.algo).SHA512,i=i.SHA384=n.extend({_doReset:function(){this._hash=new r.init([new e.init(3418070365,3238371032),new e.init(1654270250,914150663),new e.init(2438529370,812702999),new e.init(355462360,4144912697),new e.init(1731405415,4290775857),new e.init(2394180231,1750603025),new e.init(3675008525,1694076839),new e.init(1203062813,3204075428)])},_doFinalize:function(){var t=n._doFinalize.call(this);return t.sigBytes-=16,t}});t.SHA384=n._createHelper(i),t.HmacSHA384=n._createHmacHelper(i)}(),function(){var t=at,e=(n=t.lib).WordArray,r=n.Hasher,n=t.algo,i=e.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),s=e.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),a=e.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),o=e.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),u=e.create([0,1518500249,1859775393,2400959708,2840853838]),c=e.create([1352829926,1548603684,1836072691,2053994217,0]);n=n.RIPEMD160=r.extend({_doReset:function(){this._hash=e.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var r=0;16>r;r++){var n=t[x=e+r];t[x]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8)}var h,l,f,p,g,d,v,m,y,w,x=this._hash.words,S=(n=u.words,c.words),E=i.words,b=s.words,F=a.words,A=o.words;d=h=x[0],v=l=x[1],m=f=x[2],y=p=x[3],w=g=x[4];var D;for(r=0;80>r;r+=1)D=h+t[e+E[r]]|0,D=16>r?D+((l^f^p)+n[0]):32>r?D+((l&f|~l&p)+n[1]):48>r?D+(((l|~f)^p)+n[2]):64>r?D+((l&p|f&~p)+n[3]):D+((l^(f|~p))+n[4]),D=(D=(D|=0)<<F[r]|D>>>32-F[r])+g|0,h=g,g=p,p=f<<10|f>>>22,f=l,l=D,D=d+t[e+b[r]]|0,D=16>r?D+((v^(m|~y))+S[0]):32>r?D+((v&y|m&~y)+S[1]):48>r?D+(((v|~m)^y)+S[2]):64>r?D+((v&m|~v&y)+S[3]):D+((v^m^y)+S[4]),D=(D=(D|=0)<<A[r]|D>>>32-A[r])+w|0,d=w,w=y,y=m<<10|m>>>22,m=v,v=D;D=x[1]+f+y|0,x[1]=x[2]+p+w|0,x[2]=x[3]+g+d|0,x[3]=x[4]+h+v|0,x[4]=x[0]+l+m|0,x[0]=D},_doFinalize:function(){var t=this._data,e=t.words,r=8*this._nDataBytes,n=8*t.sigBytes;for(e[n>>>5]|=128<<24-n%32,e[14+(n+64>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),t.sigBytes=4*(e.length+1),this._process(),e=(t=this._hash).words,r=0;5>r;r++)n=e[r],e[r]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8);return t},clone:function(){var t=r.clone.call(this);return t._hash=this._hash.clone(),t}});t.RIPEMD160=r._createHelper(n),t.HmacRIPEMD160=r._createHmacHelper(n)}(),function(){var t=at,e=t.enc.Utf8;t.algo.HMAC=t.lib.Base.extend({init:function(t,r){t=this._hasher=new t.init,"string"==typeof r&&(r=e.parse(r));var n=t.blockSize,i=4*n;r.sigBytes>i&&(r=t.finalize(r)),r.clamp();for(var s=this._oKey=r.clone(),a=this._iKey=r.clone(),o=s.words,u=a.words,c=0;c<n;c++)o[c]^=1549556828,u[c]^=909522486;s.sigBytes=a.sigBytes=i,this.reset()},reset:function(){var t=this._hasher;t.reset(),t.update(this._iKey)},update:function(t){return this._hasher.update(t),this},finalize:function(t){var e=this._hasher;return t=e.finalize(t),e.reset(),e.finalize(this._oKey.clone().concat(t))}})}(),function(){var t,e=at,r=(t=e.lib).Base,n=t.WordArray,i=(t=e.algo).HMAC,s=t.PBKDF2=r.extend({cfg:r.extend({keySize:4,hasher:t.SHA1,iterations:1}),init:function(t){this.cfg=this.cfg.extend(t)},compute:function(t,e){var r=this.cfg,s=i.create(r.hasher,t),a=n.create(),o=n.create([1]),u=a.words,c=o.words,h=r.keySize;for(r=r.iterations;u.length<h;){var l=s.update(e).finalize(o);s.reset();for(var f=l.words,p=f.length,g=l,d=1;d<r;d++){g=s.finalize(g),s.reset();for(var v=g.words,m=0;m<p;m++)f[m]^=v[m]}a.concat(l),c[0]++}return a.sigBytes=4*h,a}});e.PBKDF2=function(t,e,r){return s.create(r).compute(t,e)}}();
|
|
2
2
|
/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/
|
|
3
3
|
*/
|
|
4
|
-
var
|
|
4
|
+
var ot,ut="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function ct(t){var e,r,n="";for(e=0;e+3<=t.length;e+=3)r=parseInt(t.substring(e,e+3),16),n+=ut.charAt(r>>6)+ut.charAt(63&r);for(e+1==t.length?(r=parseInt(t.substring(e,e+1),16),n+=ut.charAt(r<<2)):e+2==t.length&&(r=parseInt(t.substring(e,e+2),16),n+=ut.charAt(r>>2)+ut.charAt((3&r)<<4));(3&n.length)>0;)n+="=";return n}function ht(t){var e,r,n,i="",s=0;for(e=0;e<t.length&&"="!=t.charAt(e);++e)(n=ut.indexOf(t.charAt(e)))<0||(0==s?(i+=mt(n>>2),r=3&n,s=1):1==s?(i+=mt(r<<2|n>>4),r=15&n,s=2):2==s?(i+=mt(r),i+=mt(n>>2),r=3&n,s=3):(i+=mt(r<<2|n>>4),i+=mt(15&n),s=0));return 1==s&&(i+=mt(r<<2)),i}
|
|
5
5
|
/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/
|
|
6
|
-
*/function
|
|
6
|
+
*/function lt(t,e,r){null!=t&&("number"==typeof t?this.fromNumber(t,e,r):null==e&&"string"!=typeof t?this.fromString(t,256):this.fromString(t,e))}function ft(){return new lt(null)}"Microsoft Internet Explorer"==it.appName?(lt.prototype.am=function(t,e,r,n,i,s){for(var a=32767&e,o=e>>15;--s>=0;){var u=32767&this[t],c=this[t++]>>15,h=o*u+c*a;i=((u=a*u+((32767&h)<<15)+r[n]+(1073741823&i))>>>30)+(h>>>15)+o*c+(i>>>30),r[n++]=1073741823&u}return i},ot=30):"Netscape"!=it.appName?(lt.prototype.am=function(t,e,r,n,i,s){for(;--s>=0;){var a=e*this[t++]+r[n]+i;i=Math.floor(a/67108864),r[n++]=67108863&a}return i},ot=26):(lt.prototype.am=function(t,e,r,n,i,s){for(var a=16383&e,o=e>>14;--s>=0;){var u=16383&this[t],c=this[t++]>>14,h=o*u+c*a;i=((u=a*u+((16383&h)<<14)+r[n]+i)>>28)+(h>>14)+o*c,r[n++]=268435455&u}return i},ot=28),lt.prototype.DB=ot,lt.prototype.DM=(1<<ot)-1,lt.prototype.DV=1<<ot;lt.prototype.FV=Math.pow(2,52),lt.prototype.F1=52-ot,lt.prototype.F2=2*ot-52;var pt,gt,dt="0123456789abcdefghijklmnopqrstuvwxyz",vt=new Array;for(pt="0".charCodeAt(0),gt=0;gt<=9;++gt)vt[pt++]=gt;for(pt="a".charCodeAt(0),gt=10;gt<36;++gt)vt[pt++]=gt;for(pt="A".charCodeAt(0),gt=10;gt<36;++gt)vt[pt++]=gt;function mt(t){return dt.charAt(t)}function yt(t,e){var r=vt[t.charCodeAt(e)];return null==r?-1:r}function wt(t){var e=ft();return e.fromInt(t),e}function xt(t){var e,r=1;return 0!=(e=t>>>16)&&(t=e,r+=16),0!=(e=t>>8)&&(t=e,r+=8),0!=(e=t>>4)&&(t=e,r+=4),0!=(e=t>>2)&&(t=e,r+=2),0!=(e=t>>1)&&(t=e,r+=1),r}function St(t){this.m=t}function Et(t){this.m=t,this.mp=t.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<t.DB-15)-1,this.mt2=2*t.t}function bt(t,e){return t&e}function Ft(t,e){return t|e}function At(t,e){return t^e}function Dt(t,e){return t&~e}function Ct(t){if(0==t)return-1;var e=0;return 65535&t||(t>>=16,e+=16),255&t||(t>>=8,e+=8),15&t||(t>>=4,e+=4),3&t||(t>>=2,e+=2),1&t||++e,e}function It(t){for(var e=0;0!=t;)t&=t-1,++e;return e}function Pt(){}function Rt(t){return t}function Tt(t){this.r2=ft(),this.q3=ft(),lt.ONE.dlShiftTo(2*t.t,this.r2),this.mu=this.r2.divide(t),this.m=t}St.prototype.convert=function(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t},St.prototype.revert=function(t){return t},St.prototype.reduce=function(t){t.divRemTo(this.m,null,t)},St.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},St.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},Et.prototype.convert=function(t){var e=ft();return t.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),t.s<0&&e.compareTo(lt.ZERO)>0&&this.m.subTo(e,e),e},Et.prototype.revert=function(t){var e=ft();return t.copyTo(e),this.reduce(e),e},Et.prototype.reduce=function(t){for(;t.t<=this.mt2;)t[t.t++]=0;for(var e=0;e<this.m.t;++e){var r=32767&t[e],n=r*this.mpl+((r*this.mph+(t[e]>>15)*this.mpl&this.um)<<15)&t.DM;for(t[r=e+this.m.t]+=this.m.am(0,n,t,e,0,this.m.t);t[r]>=t.DV;)t[r]-=t.DV,t[++r]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)},Et.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},Et.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},lt.prototype.copyTo=function(t){for(var e=this.t-1;e>=0;--e)t[e]=this[e];t.t=this.t,t.s=this.s},lt.prototype.fromInt=function(t){this.t=1,this.s=t<0?-1:0,t>0?this[0]=t:t<-1?this[0]=t+this.DV:this.t=0},lt.prototype.fromString=function(t,e){var r;if(16==e)r=4;else if(8==e)r=3;else if(256==e)r=8;else if(2==e)r=1;else if(32==e)r=5;else{if(4!=e)return void this.fromRadix(t,e);r=2}this.t=0,this.s=0;for(var n=t.length,i=!1,s=0;--n>=0;){var a=8==r?255&t[n]:yt(t,n);a<0?"-"==t.charAt(n)&&(i=!0):(i=!1,0==s?this[this.t++]=a:s+r>this.DB?(this[this.t-1]|=(a&(1<<this.DB-s)-1)<<s,this[this.t++]=a>>this.DB-s):this[this.t-1]|=a<<s,(s+=r)>=this.DB&&(s-=this.DB))}8==r&&128&t[0]&&(this.s=-1,s>0&&(this[this.t-1]|=(1<<this.DB-s)-1<<s)),this.clamp(),i&<.ZERO.subTo(this,this)},lt.prototype.clamp=function(){for(var t=this.s&this.DM;this.t>0&&this[this.t-1]==t;)--this.t},lt.prototype.dlShiftTo=function(t,e){var r;for(r=this.t-1;r>=0;--r)e[r+t]=this[r];for(r=t-1;r>=0;--r)e[r]=0;e.t=this.t+t,e.s=this.s},lt.prototype.drShiftTo=function(t,e){for(var r=t;r<this.t;++r)e[r-t]=this[r];e.t=Math.max(this.t-t,0),e.s=this.s},lt.prototype.lShiftTo=function(t,e){var r,n=t%this.DB,i=this.DB-n,s=(1<<i)-1,a=Math.floor(t/this.DB),o=this.s<<n&this.DM;for(r=this.t-1;r>=0;--r)e[r+a+1]=this[r]>>i|o,o=(this[r]&s)<<n;for(r=a-1;r>=0;--r)e[r]=0;e[a]=o,e.t=this.t+a+1,e.s=this.s,e.clamp()},lt.prototype.rShiftTo=function(t,e){e.s=this.s;var r=Math.floor(t/this.DB);if(r>=this.t)e.t=0;else{var n=t%this.DB,i=this.DB-n,s=(1<<n)-1;e[0]=this[r]>>n;for(var a=r+1;a<this.t;++a)e[a-r-1]|=(this[a]&s)<<i,e[a-r]=this[a]>>n;n>0&&(e[this.t-r-1]|=(this.s&s)<<i),e.t=this.t-r,e.clamp()}},lt.prototype.subTo=function(t,e){for(var r=0,n=0,i=Math.min(t.t,this.t);r<i;)n+=this[r]-t[r],e[r++]=n&this.DM,n>>=this.DB;if(t.t<this.t){for(n-=t.s;r<this.t;)n+=this[r],e[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<t.t;)n-=t[r],e[r++]=n&this.DM,n>>=this.DB;n-=t.s}e.s=n<0?-1:0,n<-1?e[r++]=this.DV+n:n>0&&(e[r++]=n),e.t=r,e.clamp()},lt.prototype.multiplyTo=function(t,e){var r=this.abs(),n=t.abs(),i=r.t;for(e.t=i+n.t;--i>=0;)e[i]=0;for(i=0;i<n.t;++i)e[i+r.t]=r.am(0,n[i],e,i,0,r.t);e.s=0,e.clamp(),this.s!=t.s&<.ZERO.subTo(e,e)},lt.prototype.squareTo=function(t){for(var e=this.abs(),r=t.t=2*e.t;--r>=0;)t[r]=0;for(r=0;r<e.t-1;++r){var n=e.am(r,e[r],t,2*r,0,1);(t[r+e.t]+=e.am(r+1,2*e[r],t,2*r+1,n,e.t-r-1))>=e.DV&&(t[r+e.t]-=e.DV,t[r+e.t+1]=1)}t.t>0&&(t[t.t-1]+=e.am(r,e[r],t,2*r,0,1)),t.s=0,t.clamp()},lt.prototype.divRemTo=function(t,e,r){var n=t.abs();if(n.t<=0)throw"BigInteger divide by zero";var i=this.abs();if(i.t<n.t)return null!=e&&e.fromInt(0),void(null!=r&&this.copyTo(r));null==r&&(r=ft());var s=ft(),a=this.s,o=t.s,u=this.DB-xt(n[n.t-1]);u>0?(n.lShiftTo(u,s),i.lShiftTo(u,r)):(n.copyTo(s),i.copyTo(r));var c=s.t,h=s[c-1];if(0!=h){var l=h*(1<<this.F1)+(c>1?s[c-2]>>this.F2:0),f=this.FV/l,p=(1<<this.F1)/l,g=1<<this.F2,d=r.t,v=d-c,m=null==e?ft():e;for(s.dlShiftTo(v,m),r.compareTo(m)>=0&&(r[r.t++]=1,r.subTo(m,r)),lt.ONE.dlShiftTo(c,m),m.subTo(s,s);s.t<c;)s[s.t++]=0;for(;--v>=0;){var y=r[--d]==h?this.DM:Math.floor(r[d]*f+(r[d-1]+g)*p);if((r[d]+=s.am(0,y,r,v,0,c))<y)for(s.dlShiftTo(v,m),r.subTo(m,r);r[d]<--y;)r.subTo(m,r)}null!=e&&(r.drShiftTo(c,e),a!=o&<.ZERO.subTo(e,e)),r.t=c,r.clamp(),u>0&&r.rShiftTo(u,r),a<0&<.ZERO.subTo(r,r)}},lt.prototype.invDigit=function(){if(this.t<1)return 0;var t=this[0];if(!(1&t))return 0;var e=3&t;return(e=(e=(e=(e=e*(2-(15&t)*e)&15)*(2-(255&t)*e)&255)*(2-((65535&t)*e&65535))&65535)*(2-t*e%this.DV)%this.DV)>0?this.DV-e:-e},lt.prototype.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)},lt.prototype.exp=function(t,e){if(t>4294967295||t<1)return lt.ONE;var r=ft(),n=ft(),i=e.convert(this),s=xt(t)-1;for(i.copyTo(r);--s>=0;)if(e.sqrTo(r,n),(t&1<<s)>0)e.mulTo(n,i,r);else{var a=r;r=n,n=a}return e.revert(r)},lt.prototype.toString=function(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(16==t)e=4;else if(8==t)e=3;else if(2==t)e=1;else if(32==t)e=5;else{if(4!=t)return this.toRadix(t);e=2}var r,n=(1<<e)-1,i=!1,s="",a=this.t,o=this.DB-a*this.DB%e;if(a-- >0)for(o<this.DB&&(r=this[a]>>o)>0&&(i=!0,s=mt(r));a>=0;)o<e?(r=(this[a]&(1<<o)-1)<<e-o,r|=this[--a]>>(o+=this.DB-e)):(r=this[a]>>(o-=e)&n,o<=0&&(o+=this.DB,--a)),r>0&&(i=!0),i&&(s+=mt(r));return i?s:"0"},lt.prototype.negate=function(){var t=ft();return lt.ZERO.subTo(this,t),t},lt.prototype.abs=function(){return this.s<0?this.negate():this},lt.prototype.compareTo=function(t){var e=this.s-t.s;if(0!=e)return e;var r=this.t;if(0!=(e=r-t.t))return this.s<0?-e:e;for(;--r>=0;)if(0!=(e=this[r]-t[r]))return e;return 0},lt.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+xt(this[this.t-1]^this.s&this.DM)},lt.prototype.mod=function(t){var e=ft();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(lt.ZERO)>0&&t.subTo(e,e),e},lt.prototype.modPowInt=function(t,e){var r;return r=t<256||e.isEven()?new St(e):new Et(e),this.exp(t,r)},lt.ZERO=wt(0),lt.ONE=wt(1),Pt.prototype.convert=Rt,Pt.prototype.revert=Rt,Pt.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r)},Pt.prototype.sqrTo=function(t,e){t.squareTo(e)},Tt.prototype.convert=function(t){if(t.s<0||t.t>2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=ft();return t.copyTo(e),this.reduce(e),e},Tt.prototype.revert=function(t){return t},Tt.prototype.reduce=function(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)},Tt.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},Tt.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)};var Nt=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],Ot=(1<<26)/Nt[Nt.length-1];
|
|
7
7
|
/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/
|
|
8
8
|
*/
|
|
9
|
-
function
|
|
9
|
+
function Bt(){this.i=0,this.j=0,this.S=new Array}lt.prototype.chunkSize=function(t){return Math.floor(Math.LN2*this.DB/Math.log(t))},lt.prototype.toRadix=function(t){if(null==t&&(t=10),0==this.signum()||t<2||t>36)return"0";var e=this.chunkSize(t),r=Math.pow(t,e),n=wt(r),i=ft(),s=ft(),a="";for(this.divRemTo(n,i,s);i.signum()>0;)a=(r+s.intValue()).toString(t).substr(1)+a,i.divRemTo(n,i,s);return s.intValue().toString(t)+a},lt.prototype.fromRadix=function(t,e){this.fromInt(0),null==e&&(e=10);for(var r=this.chunkSize(e),n=Math.pow(e,r),i=!1,s=0,a=0,o=0;o<t.length;++o){var u=yt(t,o);u<0?"-"==t.charAt(o)&&0==this.signum()&&(i=!0):(a=e*a+u,++s>=r&&(this.dMultiply(n),this.dAddOffset(a,0),s=0,a=0))}s>0&&(this.dMultiply(Math.pow(e,s)),this.dAddOffset(a,0)),i&<.ZERO.subTo(this,this)},lt.prototype.fromNumber=function(t,e,r){if("number"==typeof e)if(t<2)this.fromInt(1);else for(this.fromNumber(t,r),this.testBit(t-1)||this.bitwiseTo(lt.ONE.shiftLeft(t-1),Ft,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(lt.ONE.shiftLeft(t-1),this);else{var n=new Array,i=7&t;n.length=1+(t>>3),e.nextBytes(n),i>0?n[0]&=(1<<i)-1:n[0]=0,this.fromString(n,256)}},lt.prototype.bitwiseTo=function(t,e,r){var n,i,s=Math.min(t.t,this.t);for(n=0;n<s;++n)r[n]=e(this[n],t[n]);if(t.t<this.t){for(i=t.s&this.DM,n=s;n<this.t;++n)r[n]=e(this[n],i);r.t=this.t}else{for(i=this.s&this.DM,n=s;n<t.t;++n)r[n]=e(i,t[n]);r.t=t.t}r.s=e(this.s,t.s),r.clamp()},lt.prototype.changeBit=function(t,e){var r=lt.ONE.shiftLeft(t);return this.bitwiseTo(r,e,r),r},lt.prototype.addTo=function(t,e){for(var r=0,n=0,i=Math.min(t.t,this.t);r<i;)n+=this[r]+t[r],e[r++]=n&this.DM,n>>=this.DB;if(t.t<this.t){for(n+=t.s;r<this.t;)n+=this[r],e[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<t.t;)n+=t[r],e[r++]=n&this.DM,n>>=this.DB;n+=t.s}e.s=n<0?-1:0,n>0?e[r++]=n:n<-1&&(e[r++]=this.DV+n),e.t=r,e.clamp()},lt.prototype.dMultiply=function(t){this[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()},lt.prototype.dAddOffset=function(t,e){if(0!=t){for(;this.t<=e;)this[this.t++]=0;for(this[e]+=t;this[e]>=this.DV;)this[e]-=this.DV,++e>=this.t&&(this[this.t++]=0),++this[e]}},lt.prototype.multiplyLowerTo=function(t,e,r){var n,i=Math.min(this.t+t.t,e);for(r.s=0,r.t=i;i>0;)r[--i]=0;for(n=r.t-this.t;i<n;++i)r[i+this.t]=this.am(0,t[i],r,i,0,this.t);for(n=Math.min(t.t,e);i<n;++i)this.am(0,t[i],r,i,0,e-i);r.clamp()},lt.prototype.multiplyUpperTo=function(t,e,r){--e;var n=r.t=this.t+t.t-e;for(r.s=0;--n>=0;)r[n]=0;for(n=Math.max(e-this.t,0);n<t.t;++n)r[this.t+n-e]=this.am(e-n,t[n],r,0,0,this.t+n-e);r.clamp(),r.drShiftTo(1,r)},lt.prototype.modInt=function(t){if(t<=0)return 0;var e=this.DV%t,r=this.s<0?t-1:0;if(this.t>0)if(0==e)r=this[0]%t;else for(var n=this.t-1;n>=0;--n)r=(e*r+this[n])%t;return r},lt.prototype.millerRabin=function(t){if(this.signum()<=0)return!1;var e=this.subtract(lt.ONE),r=e.getLowestSetBit();if(r<=0)return!1;var n=e.shiftRight(r);(t=t+1>>1)>Nt.length&&(t=Nt.length);for(var i=ft(),s=0;s<t;++s){i.fromInt(Nt[Math.floor(Math.random()*Nt.length)]);var a=i.modPow(n,this);if(0!=a.compareTo(lt.ONE)&&0!=a.compareTo(e)){for(var o=1;o++<r&&0!=a.compareTo(e);)if(0==(a=a.modPowInt(2,this)).compareTo(lt.ONE))return!1;if(0!=a.compareTo(e))return!1}}return!0},lt.prototype.clone=
|
|
10
10
|
/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/
|
|
11
11
|
*/
|
|
12
|
-
function(){var t=
|
|
12
|
+
function(){var t=ft();return this.copyTo(t),t},lt.prototype.intValue=function(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]},lt.prototype.byteValue=function(){return 0==this.t?this.s:this[0]<<24>>24},lt.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},lt.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},lt.prototype.toByteArray=function(){var t=this.t,e=new Array;e[0]=this.s;var r,n=this.DB-t*this.DB%8,i=0;if(t-- >0)for(n<this.DB&&(r=this[t]>>n)!=(this.s&this.DM)>>n&&(e[i++]=r|this.s<<this.DB-n);t>=0;)n<8?(r=(this[t]&(1<<n)-1)<<8-n,r|=this[--t]>>(n+=this.DB-8)):(r=this[t]>>(n-=8)&255,n<=0&&(n+=this.DB,--t)),128&r&&(r|=-256),0==i&&(128&this.s)!=(128&r)&&++i,(i>0||r!=this.s)&&(e[i++]=r);return e},lt.prototype.equals=function(t){return 0==this.compareTo(t)},lt.prototype.min=function(t){return this.compareTo(t)<0?this:t},lt.prototype.max=function(t){return this.compareTo(t)>0?this:t},lt.prototype.and=function(t){var e=ft();return this.bitwiseTo(t,bt,e),e},lt.prototype.or=function(t){var e=ft();return this.bitwiseTo(t,Ft,e),e},lt.prototype.xor=function(t){var e=ft();return this.bitwiseTo(t,At,e),e},lt.prototype.andNot=function(t){var e=ft();return this.bitwiseTo(t,Dt,e),e},lt.prototype.not=function(){for(var t=ft(),e=0;e<this.t;++e)t[e]=this.DM&~this[e];return t.t=this.t,t.s=~this.s,t},lt.prototype.shiftLeft=function(t){var e=ft();return t<0?this.rShiftTo(-t,e):this.lShiftTo(t,e),e},lt.prototype.shiftRight=function(t){var e=ft();return t<0?this.lShiftTo(-t,e):this.rShiftTo(t,e),e},lt.prototype.getLowestSetBit=function(){for(var t=0;t<this.t;++t)if(0!=this[t])return t*this.DB+Ct(this[t]);return this.s<0?this.t*this.DB:-1},lt.prototype.bitCount=function(){for(var t=0,e=this.s&this.DM,r=0;r<this.t;++r)t+=It(this[r]^e);return t},lt.prototype.testBit=function(t){var e=Math.floor(t/this.DB);return e>=this.t?0!=this.s:!!(this[e]&1<<t%this.DB)},lt.prototype.setBit=function(t){return this.changeBit(t,Ft)},lt.prototype.clearBit=function(t){return this.changeBit(t,Dt)},lt.prototype.flipBit=function(t){return this.changeBit(t,At)},lt.prototype.add=function(t){var e=ft();return this.addTo(t,e),e},lt.prototype.subtract=function(t){var e=ft();return this.subTo(t,e),e},lt.prototype.multiply=function(t){var e=ft();return this.multiplyTo(t,e),e},lt.prototype.divide=function(t){var e=ft();return this.divRemTo(t,e,null),e},lt.prototype.remainder=function(t){var e=ft();return this.divRemTo(t,null,e),e},lt.prototype.divideAndRemainder=function(t){var e=ft(),r=ft();return this.divRemTo(t,e,r),new Array(e,r)},lt.prototype.modPow=function(t,e){if(t.signum()<0)return this.modInverse(e).modPow(t.negate(),e);var r,n,i=t.bitLength(),s=wt(1);if(i<=0)return s;r=i<18?1:i<48?3:i<144?4:i<768?5:6,n=i<8?new St(e):e.isEven()?new Tt(e):new Et(e);var a=new Array,o=3,u=r-1,c=(1<<r)-1;if(a[1]=n.convert(this),r>1){var h=ft();for(n.sqrTo(a[1],h);o<=c;)a[o]=ft(),n.mulTo(h,a[o-2],a[o]),o+=2}var l,f,p=t.t-1,g=!0,d=ft();for(i=xt(t[p])-1;p>=0;){for(i>=u?l=t[p]>>i-u&c:(l=(t[p]&(1<<i+1)-1)<<u-i,p>0&&(l|=t[p-1]>>this.DB+i-u)),o=r;!(1&l);)l>>=1,--o;if((i-=o)<0&&(i+=this.DB,--p),g)a[l].copyTo(s),g=!1;else{for(;o>1;)n.sqrTo(s,d),n.sqrTo(d,s),o-=2;o>0?n.sqrTo(s,d):(f=s,s=d,d=f),n.mulTo(d,a[l],s)}for(;p>=0&&!(t[p]&1<<i);)n.sqrTo(s,d),f=s,s=d,d=f,--i<0&&(i=this.DB-1,--p)}return n.revert(s)},lt.prototype.modInverse=function(t){if(0==t.signum())return lt.ZERO;var e=this.mod(t),r=t.isEven();if(e.isEven()&&r||0==e.signum())return lt.ZERO;for(var n=t.clone(),i=e.clone(),s=wt(1),a=wt(0),o=wt(0),u=wt(1);0!=n.signum();){for(;n.isEven();)n.rShiftTo(1,n),r?(s.isEven()&&a.isEven()||(s.addTo(e,s),a.subTo(t,a)),s.rShiftTo(1,s)):a.isEven()||a.subTo(t,a),a.rShiftTo(1,a);for(;i.isEven();)i.rShiftTo(1,i),r?(o.isEven()&&u.isEven()||(o.addTo(e,o),u.subTo(t,u)),o.rShiftTo(1,o)):u.isEven()||u.subTo(t,u),u.rShiftTo(1,u);n.compareTo(i)>=0?(n.subTo(i,n),r&&s.subTo(o,s),a.subTo(u,a)):(i.subTo(n,i),r&&o.subTo(s,o),u.subTo(a,u))}return 0!=i.compareTo(lt.ONE)?lt.ZERO:u.compareTo(t)>=0?u.subtract(t):u.signum()<0?(u.addTo(t,u),u.signum()<0?u.add(t):u):u},lt.prototype.pow=function(t){return this.exp(t,new Pt)},lt.prototype.gcd=function(t){var e=this.s<0?this.negate():this.clone(),r=t.s<0?t.negate():t.clone();if(e.compareTo(r)<0){var n=e;e=r,r=n}var i=e.getLowestSetBit(),s=r.getLowestSetBit();if(s<0)return e;for(i<s&&(s=i),s>0&&(e.rShiftTo(s,e),r.rShiftTo(s,r));e.signum()>0;)(i=e.getLowestSetBit())>0&&e.rShiftTo(i,e),(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),e.compareTo(r)>=0?(e.subTo(r,e),e.rShiftTo(1,e)):(r.subTo(e,r),r.rShiftTo(1,r));return s>0&&r.lShiftTo(s,r),r},lt.prototype.isProbablePrime=function(t){if(this.signum()<=0)return!1;var e,r=this.abs();if(1==r.t&&r[0]<=Nt[Nt.length-1]){for(e=0;e<Nt.length;++e)if(r[0]==Nt[e])return!0;return!1}if(r.isEven())return!1;for(e=1;e<Nt.length;){for(var n=Nt[e],i=e+1;i<Nt.length&&n<Ot;)n*=Nt[i++];for(n=r.modInt(n);e<i;)if(n%Nt[e++]==0)return!1}return r.millerRabin(t)},lt.prototype.square=function(){var t=ft();return this.squareTo(t),t},lt.prototype.sqrt=function(){for(var t=lt.ZERO.setBit(this.bitLength()/2),e=t;;){var r=t.add(this.divide(t)).shiftRight(1);if(r.equals(t)||r.equals(e))return r;e=t,t=r}},Bt.prototype.init=function(t){var e,r,n;for(e=0;e<256;++e)this.S[e]=e;for(r=0,e=0;e<256;++e)r=r+this.S[e]+t[e%t.length]&255,n=this.S[e],this.S[e]=this.S[r],this.S[r]=n;this.i=0,this.j=0},Bt.prototype.next=function(){var t;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,t=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=t,this.S[t+this.S[this.i]&255]};var _t,jt,Ht,kt=256;
|
|
13
13
|
/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/
|
|
14
|
-
*/function
|
|
14
|
+
*/function Lt(){!function(t){jt[Ht++]^=255&t,jt[Ht++]^=t>>8&255,jt[Ht++]^=t>>16&255,jt[Ht++]^=t>>24&255,Ht>=kt&&(Ht-=kt)}((new Date).getTime())}if(null==jt){var Vt;if(jt=new Array,Ht=0,void 0!==st&&(void 0!==st.crypto||void 0!==st.msCrypto)){var qt=st.crypto||st.msCrypto;if(qt.getRandomValues){var Mt=new Uint8Array(32);for(qt.getRandomValues(Mt),Vt=0;Vt<32;++Vt)jt[Ht++]=Mt[Vt]}else if("Netscape"==it.appName&&it.appVersion<"5"){var Kt=st.crypto.random(32);for(Vt=0;Vt<Kt.length;++Vt)jt[Ht++]=255&Kt.charCodeAt(Vt)}}if(Ht<kt&&"undefined"!=typeof globalThis&&globalThis.crypto&&globalThis.crypto.getRandomValues){var Ut=new Uint8Array(kt-Ht);for(globalThis.crypto.getRandomValues(Ut),Vt=0;Vt<Ut.length;++Vt)jt[Ht++]=Ut[Vt]}for(;Ht<kt;)Vt=Math.floor(65536*Math.random()),jt[Ht++]=Vt>>>8,jt[Ht++]=255&Vt;Ht=0,Lt()}function zt(){if(null==_t){for(Lt(),(_t=new Bt).init(jt),Ht=0;Ht<jt.length;++Ht)jt[Ht]=0;Ht=0}return _t.next()}function Wt(){}
|
|
15
15
|
/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/
|
|
16
16
|
*/
|
|
17
|
-
function
|
|
17
|
+
function Gt(t,e){return new lt(t,e)}function $t(){this.n=null,this.e=0,this.d=null,this.p=null,this.q=null,this.dmp1=null,this.dmq1=null,this.coeff=null}
|
|
18
18
|
/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/
|
|
19
19
|
*/
|
|
20
|
-
function
|
|
20
|
+
function Jt(t,e){this.x=e,this.q=t}function Yt(t,e,r,n){this.curve=t,this.x=e,this.y=r,this.z=null==n?lt.ONE:n,this.zinv=null}function Xt(t,e,r){this.q=t,this.a=this.fromBigInteger(e),this.b=this.fromBigInteger(r),this.infinity=new Yt(this,null,null)}Wt.prototype.nextBytes=function(t){var e;for(e=0;e<t.length;++e)t[e]=zt()},$t.prototype.doPublic=function(t){return t.modPowInt(this.e,this.n)},$t.prototype.setPublic=function(t,e){if(this.isPublic=!0,this.isPrivate=!1,"string"!=typeof t)this.n=t,this.e=e;else{if(!(null!=t&&null!=e&&t.length>0&&e.length>0))throw"Invalid RSA public key";this.n=Gt(t,16),this.e=parseInt(e,16)}if(null==this.n||"function"!=typeof this.n.compareTo||this.n.compareTo(lt.ONE)<=0||null==this.e||isNaN(this.e)||this.e<=0)throw"Invalid RSA public key"},$t.prototype.type="RSA",$t.prototype.doPrivate=function(t){if(null==this.p||null==this.q)return t.modPow(this.d,this.n);for(var e=t.mod(this.p).modPow(this.dmp1,this.p),r=t.mod(this.q).modPow(this.dmq1,this.q);e.compareTo(r)<0;)e=e.add(this.p);return e.subtract(r).multiply(this.coeff).mod(this.p).multiply(this.q).add(r)},$t.prototype.setPrivate=function(t,e,r){if(this.isPrivate=!0,"string"!=typeof t)this.n=t,this.e=e,this.d=r;else{if(!(null!=t&&null!=e&&t.length>0&&e.length>0))throw"Invalid RSA private key";this.n=Gt(t,16),this.e=parseInt(e,16),this.d=Gt(r,16)}},$t.prototype.setPrivateEx=function(t,e,r,n,i,s,a,o){if(this.isPrivate=!0,this.isPublic=!1,null==t)throw"RSASetPrivateEx N == null";if(null==e)throw"RSASetPrivateEx E == null";if(0==t.length)throw"RSASetPrivateEx N.length == 0";if(0==e.length)throw"RSASetPrivateEx E.length == 0";if(!(null!=t&&null!=e&&t.length>0&&e.length>0))throw"Invalid RSA private key in RSASetPrivateEx";this.n=Gt(t,16),this.e=parseInt(e,16),this.d=Gt(r,16),this.p=Gt(n,16),this.q=Gt(i,16),this.dmp1=Gt(s,16),this.dmq1=Gt(a,16),this.coeff=Gt(o,16)},$t.prototype.generate=function(t,e){var r=new Wt,n=t>>1;this.e=parseInt(e,16);for(var i=new lt(e,16),s=t/2-100,a=lt.ONE.shiftLeft(s);;){for(;this.p=new lt(t-n,1,r),0!=this.p.subtract(lt.ONE).gcd(i).compareTo(lt.ONE)||!this.p.isProbablePrime(10););for(;this.q=new lt(n,1,r),0!=this.q.subtract(lt.ONE).gcd(i).compareTo(lt.ONE)||!this.q.isProbablePrime(10););if(this.p.compareTo(this.q)<=0){var o=this.p;this.p=this.q,this.q=o}var u=this.q.subtract(this.p).abs();if(!(u.bitLength()<s||u.compareTo(a)<=0)){var c=this.p.subtract(lt.ONE),h=this.q.subtract(lt.ONE),l=c.multiply(h);if(0==l.gcd(i).compareTo(lt.ONE)&&(this.n=this.p.multiply(this.q),this.n.bitLength()==t)){this.d=i.modInverse(l),this.dmp1=this.d.mod(c),this.dmq1=this.d.mod(h),this.coeff=this.q.modInverse(this.p);break}}}this.isPrivate=!0},Jt.prototype.equals=function(t){return t==this||this.q.equals(t.q)&&this.x.equals(t.x)},Jt.prototype.toBigInteger=function(){return this.x},Jt.prototype.negate=function(){return new Jt(this.q,this.x.negate().mod(this.q))},Jt.prototype.add=function(t){return new Jt(this.q,this.x.add(t.toBigInteger()).mod(this.q))},Jt.prototype.subtract=function(t){return new Jt(this.q,this.x.subtract(t.toBigInteger()).mod(this.q))},Jt.prototype.multiply=function(t){return new Jt(this.q,this.x.multiply(t.toBigInteger()).mod(this.q))},Jt.prototype.square=function(){return new Jt(this.q,this.x.square().mod(this.q))},Jt.prototype.divide=function(t){return new Jt(this.q,this.x.multiply(t.toBigInteger().modInverse(this.q)).mod(this.q))},Jt.prototype.sqrt=function(){return new Jt(this.q,this.x.sqrt().mod(this.q))},Yt.prototype.getX=function(){return null==this.zinv&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.x.toBigInteger().multiply(this.zinv).mod(this.curve.q))},Yt.prototype.getY=function(){return null==this.zinv&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.y.toBigInteger().multiply(this.zinv).mod(this.curve.q))},Yt.prototype.equals=function(t){return t==this||(this.isInfinity()?t.isInfinity():t.isInfinity()?this.isInfinity():!!t.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(t.z)).mod(this.curve.q).equals(lt.ZERO)&&t.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(t.z)).mod(this.curve.q).equals(lt.ZERO))},Yt.prototype.isInfinity=function(){return null==this.x&&null==this.y||this.z.equals(lt.ZERO)&&!this.y.toBigInteger().equals(lt.ZERO)},Yt.prototype.negate=function(){return new Yt(this.curve,this.x,this.y.negate(),this.z)},Yt.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(t.z)).mod(this.curve.q),r=t.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(t.z)).mod(this.curve.q);if(lt.ZERO.equals(r))return lt.ZERO.equals(e)?this.twice():this.curve.getInfinity();var n=new lt("3"),i=this.x.toBigInteger(),s=this.y.toBigInteger();t.x.toBigInteger(),t.y.toBigInteger();var a=r.square(),o=a.multiply(r),u=i.multiply(a),c=e.square().multiply(this.z),h=c.subtract(u.shiftLeft(1)).multiply(t.z).subtract(o).multiply(r).mod(this.curve.q),l=u.multiply(n).multiply(e).subtract(s.multiply(o)).subtract(c.multiply(e)).multiply(t.z).add(e.multiply(o)).mod(this.curve.q),f=o.multiply(this.z).multiply(t.z).mod(this.curve.q);return new Yt(this.curve,this.curve.fromBigInteger(h),this.curve.fromBigInteger(l),f)},Yt.prototype.twice=function(){if(this.isInfinity())return this;if(0==this.y.toBigInteger().signum())return this.curve.getInfinity();var t=new lt("3"),e=this.x.toBigInteger(),r=this.y.toBigInteger(),n=r.multiply(this.z),i=n.multiply(r).mod(this.curve.q),s=this.curve.a.toBigInteger(),a=e.square().multiply(t);lt.ZERO.equals(s)||(a=a.add(this.z.square().multiply(s)));var o=(a=a.mod(this.curve.q)).square().subtract(e.shiftLeft(3).multiply(i)).shiftLeft(1).multiply(n).mod(this.curve.q),u=a.multiply(t).multiply(e).subtract(i.shiftLeft(1)).shiftLeft(2).multiply(i).subtract(a.square().multiply(a)).mod(this.curve.q),c=n.square().multiply(n).shiftLeft(3).mod(this.curve.q);return new Yt(this.curve,this.curve.fromBigInteger(o),this.curve.fromBigInteger(u),c)},Yt.prototype.multiply=function(t){if(this.isInfinity())return this;if(0==t.signum())return this.curve.getInfinity();var e,r=t,n=r.multiply(new lt("3")),i=this.negate(),s=this,a=this.curve.q.subtract(t),o=a.multiply(new lt("3")),u=new Yt(this.curve,this.x,this.y),c=u.negate();for(e=n.bitLength()-2;e>0;--e){s=s.twice();var h=n.testBit(e);h!=r.testBit(e)&&(s=s.add(h?this:i))}for(e=o.bitLength()-2;e>0;--e){u=u.twice();var l=o.testBit(e);l!=a.testBit(e)&&(u=u.add(l?u:c))}return s},Yt.prototype.multiplyTwo=function(t,e,r){var n;n=t.bitLength()>r.bitLength()?t.bitLength()-1:r.bitLength()-1;for(var i=this.curve.getInfinity(),s=this.add(e);n>=0;)i=i.twice(),t.testBit(n)?i=r.testBit(n)?i.add(s):i.add(this):r.testBit(n)&&(i=i.add(e)),--n;return i},Xt.prototype.getQ=function(){return this.q},Xt.prototype.getA=function(){return this.a},Xt.prototype.getB=function(){return this.b},Xt.prototype.equals=function(t){return t==this||this.q.equals(t.q)&&this.a.equals(t.a)&&this.b.equals(t.b)},Xt.prototype.getInfinity=function(){return this.infinity},Xt.prototype.fromBigInteger=function(t){return new Jt(this.q,t)},Xt.prototype.decodePointHex=function(t){switch(parseInt(t.substr(0,2),16)){case 0:return this.infinity;case 2:case 3:var e=t.substr(0,2);t.substr(2);var r=this.fromBigInteger(new lt(o,16)),n=this.getA(),i=this.getB(),s=r.square().add(n).multiply(r).add(i).sqrt();return"03"==e&&(s=s.negate()),new Yt(this,r,s);case 4:case 6:case 7:var a=(t.length-2)/2,o=t.substr(2,a),u=t.substr(a+2,a);return new Yt(this,this.fromBigInteger(new lt(o,16)),this.fromBigInteger(new lt(u,16)));default:return null}},
|
|
21
21
|
/*! (c) Stefan Thomas | https://github.com/bitcoinjs/bitcoinjs-lib
|
|
22
22
|
*/
|
|
23
|
-
|
|
23
|
+
Jt.prototype.getByteLength=function(){return Math.floor((this.toBigInteger().bitLength()+7)/8)},Yt.prototype.getEncoded=function(t){var e=function(t,e){var r=t.toByteArrayUnsigned();if(e<r.length)r=r.slice(r.length-e);else for(;e>r.length;)r.unshift(0);return r},r=this.getX().toBigInteger(),n=this.getY().toBigInteger(),i=e(r,32);return t?n.isEven()?i.unshift(2):i.unshift(3):(i.unshift(4),i=i.concat(e(n,32))),i},Yt.decodeFrom=function(t,e){e[0];var r=e.length-1,n=e.slice(1,1+r/2),i=e.slice(1+r/2,1+r);n.unshift(0),i.unshift(0);var s=new lt(n),a=new lt(i);return new Yt(t,t.fromBigInteger(s),t.fromBigInteger(a))},Yt.decodeFromHex=function(t,e){e.substr(0,2);var r=e.length-2,n=e.substr(2,r/2),i=e.substr(2+r/2,r/2),s=new lt(n,16),a=new lt(i,16);return new Yt(t,t.fromBigInteger(s),t.fromBigInteger(a))},Yt.prototype.add2D=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;if(this.x.equals(t.x))return this.y.equals(t.y)?this.twice():this.curve.getInfinity();var e=t.x.subtract(this.x),r=t.y.subtract(this.y).divide(e),n=r.square().subtract(this.x).subtract(t.x),i=r.multiply(this.x.subtract(n)).subtract(this.y);return new Yt(this.curve,n,i)},Yt.prototype.twice2D=function(){if(this.isInfinity())return this;if(0==this.y.toBigInteger().signum())return this.curve.getInfinity();var t=this.curve.fromBigInteger(lt.valueOf(2)),e=this.curve.fromBigInteger(lt.valueOf(3)),r=this.x.square().multiply(e).add(this.curve.a).divide(this.y.multiply(t)),n=r.square().subtract(this.x.multiply(t)),i=r.multiply(this.x.subtract(n)).subtract(this.y);return new Yt(this.curve,n,i)},Yt.prototype.multiply2D=function(t){if(this.isInfinity())return this;if(0==t.signum())return this.curve.getInfinity();var e,r=t,n=r.multiply(new lt("3")),i=this.negate(),s=this;for(e=n.bitLength()-2;e>0;--e){s=s.twice();var a=n.testBit(e);a!=r.testBit(e)&&(s=s.add2D(a?this:i))}return s},Yt.prototype.isOnCurve=function(){var t=this.getX().toBigInteger(),e=this.getY().toBigInteger(),r=this.curve.getA().toBigInteger(),n=this.curve.getB().toBigInteger(),i=this.curve.getQ(),s=e.multiply(e).mod(i),a=t.multiply(t).multiply(t).add(r.multiply(t)).add(n).mod(i);return s.equals(a)},Yt.prototype.toString=function(){return"("+this.getX().toBigInteger().toString()+","+this.getY().toBigInteger().toString()+")"},Yt.prototype.validate=function(){var t=this.curve.getQ();if(this.isInfinity())throw new Error("Point is at infinity.");var e=this.getX().toBigInteger(),r=this.getY().toBigInteger();if(e.compareTo(lt.ONE)<0||e.compareTo(t.subtract(lt.ONE))>0)throw new Error("x coordinate out of bounds");if(r.compareTo(lt.ONE)<0||r.compareTo(t.subtract(lt.ONE))>0)throw new Error("y coordinate out of bounds");if(!this.isOnCurve())throw new Error("Point is not on the curve.");if(this.multiply(t).isInfinity())throw new Error("Point is not a scalar multiple of G.");return!0};
|
|
24
24
|
/*! Mike Samuel (c) 2009 | code.google.com/p/json-sans-eval
|
|
25
25
|
*/
|
|
26
|
-
var Xt=function(){var t=new RegExp('(?:false|true|null|[\\{\\}\\[\\]]|(?:-?\\b(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?(?:[eE][+-]?[0-9]+)?\\b)|(?:"(?:[^\\0-\\x08\\x0a-\\x1f"\\\\]|\\\\(?:["/\\\\bfnrt]|u[0-9A-Fa-f]{4}))*"))',"g"),e=new RegExp("\\\\(?:([^u])|u(.{4}))","g"),r={'"':'"',"/":"/","\\":"\\",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"};function n(t,e,n){return e?r[e]:String.fromCharCode(parseInt(n,16))}var i=new String(""),s=Object.hasOwnProperty;return function(r,a){var o,u,c=r.match(t),h=c[0],l=!1;"{"===h?o={}:"["===h?o=[]:(o=[],l=!0);for(var f=[o],p=1-l,g=c.length;p<g;++p){var d;switch((h=c[p]).charCodeAt(0)){default:(d=f[0])[u||d.length]=+h,u=void 0;break;case 34:if(-1!==(h=h.substring(1,h.length-1)).indexOf("\\")&&(h=h.replace(e,n)),d=f[0],!u){if(!(d instanceof Array)){u=h||i;break}u=d.length}d[u]=h,u=void 0;break;case 91:d=f[0],f.unshift(d[u||d.length]=[]),u=void 0;break;case 93:case 125:f.shift();break;case 102:(d=f[0])[u||d.length]=!1,u=void 0;break;case 110:(d=f[0])[u||d.length]=null,u=void 0;break;case 116:(d=f[0])[u||d.length]=!0,u=void 0;break;case 123:d=f[0],f.unshift(d[u||d.length]={}),u=void 0}}if(l){if(1!==f.length)throw new Error;o=o[0]}else if(f.length)throw new Error;if(a){var v=function(t,e){var r=t[e];if(r&&"object"==typeof r){var n=null;for(var i in r)if(s.call(r,i)&&r!==t){var o=v(r,i);void 0!==o?r[i]=o:(n||(n=[]),n.push(i))}if(n)for(var u=n.length;--u>=0;)delete r[n[u]]}return a.call(t,e,r)};o=v({"":o},"")}return o}}();void 0!==Zt&&Zt||(Zt={}),void 0!==Zt.asn1&&Zt.asn1||(Zt.asn1={}),Zt.asn1.ASN1Util=new function(){this.integerToByteHex=function(t){var e=t.toString(16);return e.length%2==1&&(e="0"+e),e},this.bigIntToMinTwosComplementsHex=function(t){return Ne(t)},this.getPEMStringFromHex=function(t,e){return pe(t,e)},this.newObject=function(t){var e=Zt.asn1,r=e.ASN1Object,n=e.DERBoolean,i=e.DERInteger,s=e.DERBitString,a=e.DEROctetString,o=e.DERNull,u=e.DERObjectIdentifier,c=e.DEREnumerated,h=e.DERUTF8String,l=e.DERNumericString,f=e.DERPrintableString,p=e.DERTeletexString,g=e.DERIA5String,d=e.DERUTCTime,v=e.DERGeneralizedTime,m=e.DERVisibleString,y=e.DERBMPString,w=e.DERSequence,x=e.DERSet,S=e.DERTaggedObject,E=e.ASN1Util.newObject;if(t instanceof e.ASN1Object)return t;var b=Object.keys(t);if(1!=b.length)throw new Error("key of param shall be only one.");var F=b[0];if(-1==":asn1:bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:visstr:bmpstr:seq:set:tag:".indexOf(":"+F+":"))throw new Error("undefined key: "+F);if("bool"==F)return new n(t[F]);if("int"==F)return new i(t[F]);if("bitstr"==F)return new s(t[F]);if("octstr"==F)return new a(t[F]);if("null"==F)return new o(t[F]);if("oid"==F)return new u(t[F]);if("enum"==F)return new c(t[F]);if("utf8str"==F)return new h(t[F]);if("numstr"==F)return new l(t[F]);if("prnstr"==F)return new f(t[F]);if("telstr"==F)return new p(t[F]);if("ia5str"==F)return new g(t[F]);if("utctime"==F)return new d(t[F]);if("gentime"==F)return new v(t[F]);if("visstr"==F)return new m(t[F]);if("bmpstr"==F)return new y(t[F]);if("asn1"==F)return new r(t[F]);if("seq"==F){for(var A=t[F],C=[],D=0;D<A.length;D++){var P=E(A[D]);C.push(P)}return new w({array:C})}if("set"==F){for(A=t[F],C=[],D=0;D<A.length;D++){P=E(A[D]);C.push(P)}return new x({array:C})}if("tag"==F){var I=t[F];if("[object Array]"===Object.prototype.toString.call(I)&&3==I.length){var R=E(I[2]);return new S({tag:I[0],explicit:I[1],obj:R})}return new S(I)}},this.jsonToASN1HEX=function(t){return this.newObject(t).tohex()}},Zt.asn1.ASN1Util.oidHexToInt=function(t){for(var e="",r=parseInt(t.substr(0,2),16),n=(e=Math.floor(r/40)+"."+r%40,""),i=2;i<t.length;i+=2){var s=("00000000"+parseInt(t.substr(i,2),16).toString(2)).slice(-8);if(n+=s.substr(1,7),"0"==s.substr(0,1))e=e+"."+new ht(n,2).toString(10),n=""}return e},Zt.asn1.ASN1Util.oidIntToHex=function(t){var e=function(t){var e=t.toString(16);return 1==e.length&&(e="0"+e),e},r=function(t){var r="",n=new ht(t,10).toString(2),i=7-n.length%7;7==i&&(i=0);for(var s="",a=0;a<i;a++)s+="0";n=s+n;for(a=0;a<n.length-1;a+=7){var o=n.substr(a,7);a!=n.length-7&&(o="1"+o),r+=e(parseInt(o,2))}return r};if(!t.match(/^[0-9.]+$/))throw"malformed oid string: "+t;var n="",i=t.split("."),s=40*parseInt(i[0])+parseInt(i[1]);n+=e(s),i.splice(0,2);for(var a=0;a<i.length;a++)n+=r(i[a]);return n},Zt.asn1.ASN1Object=function(t){this.params=null,this.getLengthHexFromValue=function(){if(void 0===this.hV||null==this.hV)throw new Error("this.hV is null or undefined");if(this.hV.length%2==1)throw new Error("value hex must be even length: n=0,v="+this.hV);var t=this.hV.length/2,e=t.toString(16);if(e.length%2==1&&(e="0"+e),t<128)return e;var r=e.length/2;if(r>15)throw new Error("ASN.1 length too long to represent by 8x: n = "+t.toString(16));return(128+r).toString(16)+e},this.tohex=function(){return(null==this.hTLV||this.isModified)&&(this.hV=this.getFreshValueHex(),this.hL=this.getLengthHexFromValue(),this.hTLV=this.hT+this.hL+this.hV,this.isModified=!1),this.hTLV},this.getEncodedHex=function(){return this.tohex()},this.getValueHex=function(){return this.tohex(),this.hV},this.getFreshValueHex=function(){return""},this.setByParam=function(t){this.params=t},null!=t&&null!=t.tlv&&(this.hTLV=t.tlv,this.isModified=!1)},Zt.asn1.DERAbstractString=function(t){Zt.asn1.DERAbstractString.superclass.constructor.call(this),this.getString=function(){return this.s},this.setString=function(t){this.hTLV=null,this.isModified=!0,this.s=t,this.hV=ue(this.s).toLowerCase()},this.setStringHex=function(t){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=t},this.getFreshValueHex=function(){return this.hV},void 0!==t&&("string"==typeof t?this.setString(t):void 0!==t.str?this.setString(t.str):void 0!==t.hex&&this.setStringHex(t.hex))},je(Zt.asn1.DERAbstractString,Zt.asn1.ASN1Object),Zt.asn1.DERAbstractTime=function(t){Zt.asn1.DERAbstractTime.superclass.constructor.call(this),this.localDateToUTC=function(t){var e=t.getTime()+6e4*t.getTimezoneOffset();return new Date(e)},this.formatDate=function(t,e,r){var n=this.zeroPadding,i=this.localDateToUTC(t),s=String(i.getFullYear());"utc"==e&&(s=s.substr(2,2));var a=s+n(String(i.getMonth()+1),2)+n(String(i.getDate()),2)+n(String(i.getHours()),2)+n(String(i.getMinutes()),2)+n(String(i.getSeconds()),2);if(!0===r){var o=i.getMilliseconds();if(0!=o){var u=n(String(o),3);a=a+"."+(u=u.replace(/[0]+$/,""))}}return a+"Z"},this.zeroPadding=function(t,e){return t.length>=e?t:new Array(e-t.length+1).join("0")+t},this.setByParam=function(t){this.hV=null,this.hTLV=null,this.params=t},this.getString=function(){},this.setString=function(t){this.hTLV=null,this.isModified=!0,null==this.params&&(this.params={}),this.params.str=t},this.setByDate=function(t){this.hTLV=null,this.isModified=!0,null==this.params&&(this.params={}),this.params.date=t},this.setByDateValue=function(t,e,r,n,i,s){var a=new Date(Date.UTC(t,e-1,r,n,i,s,0));this.setByDate(a)},this.getFreshValueHex=function(){return this.hV}},je(Zt.asn1.DERAbstractTime,Zt.asn1.ASN1Object),Zt.asn1.DERAbstractStructured=function(t){Zt.asn1.DERAbstractString.superclass.constructor.call(this),this.setByASN1ObjectArray=function(t){this.hTLV=null,this.isModified=!0,this.asn1Array=t},this.appendASN1Object=function(t){this.hTLV=null,this.isModified=!0,this.asn1Array.push(t)},this.asn1Array=new Array,void 0!==t&&void 0!==t.array&&(this.asn1Array=t.array)},je(Zt.asn1.DERAbstractStructured,Zt.asn1.ASN1Object),Zt.asn1.DERBoolean=function(t){Zt.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",this.hTLV=0==t?"010100":"0101ff"},je(Zt.asn1.DERBoolean,Zt.asn1.ASN1Object),Zt.asn1.DERInteger=function(t){Zt.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.params=null;var e=Ne;this.setByBigInteger=function(t){this.isModified=!0,this.params={bigint:t}},this.setByInteger=function(t){this.isModified=!0,this.params=t},this.setValueHex=function(t){this.isModified=!0,this.params={hex:t}},this.getFreshValueHex=function(){var t=this.params,r=null;if(null==t)throw new Error("value not set");if("object"==typeof t&&null!=t.hex)return this.hV=t.hex,this.hV;if("number"==typeof t)r=new ht(String(t),10);else if(null!=t.int)r=new ht(String(t.int),10);else{if(null==t.bigint)throw new Error("wrong parameter");r=t.bigint}return this.hV=e(r),this.hV},null!=t&&(this.params=t)},je(Zt.asn1.DERInteger,Zt.asn1.ASN1Object),Zt.asn1.DERBitString=function(t){if(void 0!==t&&void 0!==t.obj){var e=Zt.asn1.ASN1Util.newObject(t.obj);t.hex="00"+e.tohex()}Zt.asn1.DERBitString.superclass.constructor.call(this),this.hT="03",this.setHexValueIncludingUnusedBits=function(t){this.hTLV=null,this.isModified=!0,this.hV=t},this.setUnusedBitsAndHexValue=function(t,e){if(t<0||7<t)throw"unused bits shall be from 0 to 7: u = "+t;var r="0"+t;this.hTLV=null,this.isModified=!0,this.hV=r+e},this.setByBinaryString=function(t){var e=8-(t=t.replace(/0+$/,"")).length%8;8==e&&(e=0),t+="0000000".substr(0,e);for(var r="",n=0;n<t.length-1;n+=8){var i=t.substr(n,8),s=parseInt(i,2).toString(16);1==s.length&&(s="0"+s),r+=s}this.hTLV=null,this.isModified=!0,this.hV="0"+e+r},this.setByBooleanArray=function(t){for(var e="",r=0;r<t.length;r++)1==t[r]?e+="1":e+="0";this.setByBinaryString(e)},this.newFalseArray=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=!1;return e},this.getFreshValueHex=function(){return this.hV},void 0!==t&&("string"==typeof t&&t.toLowerCase().match(/^[0-9a-f]+$/)?this.setHexValueIncludingUnusedBits(t):void 0!==t.hex?this.setHexValueIncludingUnusedBits(t.hex):void 0!==t.bin?this.setByBinaryString(t.bin):void 0!==t.array&&this.setByBooleanArray(t.array))},je(Zt.asn1.DERBitString,Zt.asn1.ASN1Object),Zt.asn1.DEROctetString=function(t){if(void 0!==t&&void 0!==t.obj){var e=Zt.asn1.ASN1Util.newObject(t.obj);t.hex=e.tohex()}Zt.asn1.DEROctetString.superclass.constructor.call(this,t),this.hT="04"},je(Zt.asn1.DEROctetString,Zt.asn1.DERAbstractString),Zt.asn1.DERNull=function(){Zt.asn1.DERNull.superclass.constructor.call(this),this.hT="05",this.hTLV="0500"},je(Zt.asn1.DERNull,Zt.asn1.ASN1Object),Zt.asn1.DERObjectIdentifier=function(t){Zt.asn1.DERObjectIdentifier.superclass.constructor.call(this),this.hT="06",this.setValueHex=function(t){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=t},this.setValueOidString=function(t){var e=function(t){var e=function(t){var e=t.toString(16);return 1==e.length&&(e="0"+e),e},r=function(t){var r="",n=parseInt(t,10).toString(2),i=7-n.length%7;7==i&&(i=0);for(var s="",a=0;a<i;a++)s+="0";n=s+n;for(a=0;a<n.length-1;a+=7){var o=n.substr(a,7);a!=n.length-7&&(o="1"+o),r+=e(parseInt(o,2))}return r};try{if(!t.match(/^[0-9.]+$/))return null;var n="",i=t.split("."),s=40*parseInt(i[0],10)+parseInt(i[1],10);n+=e(s),i.splice(0,2);for(var a=0;a<i.length;a++)n+=r(i[a]);return n}catch(t){return null}}(t);if(null==e)throw new Error("malformed oid string: "+t);this.hTLV=null,this.isModified=!0,this.s=null,this.hV=e},this.setValueName=function(t){var e=Zt.asn1.x509.OID.name2oid(t);if(""===e)throw new Error("DERObjectIdentifier oidName undefined: "+t);this.setValueOidString(e)},this.setValueNameOrOid=function(t){t.match(/^[0-2].[0-9.]+$/)?this.setValueOidString(t):this.setValueName(t)},this.getFreshValueHex=function(){return this.hV},this.setByParam=function(t){"string"==typeof t?this.setValueNameOrOid(t):void 0!==t.oid?this.setValueNameOrOid(t.oid):void 0!==t.name?this.setValueNameOrOid(t.name):void 0!==t.hex&&this.setValueHex(t.hex)},void 0!==t&&this.setByParam(t)},je(Zt.asn1.DERObjectIdentifier,Zt.asn1.ASN1Object),Zt.asn1.DEREnumerated=function(t){Zt.asn1.DEREnumerated.superclass.constructor.call(this),this.hT="0a",this.setByBigInteger=function(t){this.hTLV=null,this.isModified=!0,this.hV=Ne(t)},this.setByInteger=function(t){var e=new ht(String(t),10);this.setByBigInteger(e)},this.setValueHex=function(t){this.hV=t},this.getFreshValueHex=function(){return this.hV},void 0!==t&&(void 0!==t.int?this.setByInteger(t.int):"number"==typeof t?this.setByInteger(t):void 0!==t.hex&&this.setValueHex(t.hex))},je(Zt.asn1.DEREnumerated,Zt.asn1.ASN1Object),Zt.asn1.DERUTF8String=function(t){Zt.asn1.DERUTF8String.superclass.constructor.call(this,t),this.hT="0c"},je(Zt.asn1.DERUTF8String,Zt.asn1.DERAbstractString),Zt.asn1.DERNumericString=function(t){Zt.asn1.DERNumericString.superclass.constructor.call(this,t),this.hT="12"},je(Zt.asn1.DERNumericString,Zt.asn1.DERAbstractString),Zt.asn1.DERPrintableString=function(t){Zt.asn1.DERPrintableString.superclass.constructor.call(this,t),this.hT="13"},je(Zt.asn1.DERPrintableString,Zt.asn1.DERAbstractString),Zt.asn1.DERTeletexString=function(t){Zt.asn1.DERTeletexString.superclass.constructor.call(this,t),this.hT="14"},je(Zt.asn1.DERTeletexString,Zt.asn1.DERAbstractString),Zt.asn1.DERIA5String=function(t){Zt.asn1.DERIA5String.superclass.constructor.call(this,t),this.hT="16"},je(Zt.asn1.DERIA5String,Zt.asn1.DERAbstractString),Zt.asn1.DERVisibleString=function(t){Zt.asn1.DERIA5String.superclass.constructor.call(this,t),this.hT="1a"},je(Zt.asn1.DERVisibleString,Zt.asn1.DERAbstractString),Zt.asn1.DERBMPString=function(t){Zt.asn1.DERBMPString.superclass.constructor.call(this,t),this.hT="1e"},je(Zt.asn1.DERBMPString,Zt.asn1.DERAbstractString),Zt.asn1.DERUTCTime=function(t){Zt.asn1.DERUTCTime.superclass.constructor.call(this,t),this.hT="17",this.params=void 0,this.getFreshValueHex=function(){var t=this.params;if(null==this.params&&(t={date:new Date}),"string"==typeof t){if(!t.match(/^[0-9]{12}Z$/)&&!t.match(/^[0-9]{12}\.[0-9]+Z$/))throw new Error("malformed string for UTCTime: "+t);this.hV=ne(t)}else if(null!=t.str)this.hV=ne(t.str);else if(null==t.date&&1==t.millis){var e=new Date;this.hV=ne(this.formatDate(e,"utc",!0))}else if(null!=t.date&&t.date instanceof Date){var r=!0===t.millis;this.hV=ne(this.formatDate(t.date,"utc",r))}else t instanceof Date&&(this.hV=ne(this.formatDate(t,"utc")));if(null==this.hV)throw new Error("parameter not specified properly for UTCTime");return this.hV},null!=t&&this.setByParam(t)},je(Zt.asn1.DERUTCTime,Zt.asn1.DERAbstractTime),Zt.asn1.DERGeneralizedTime=function(t){Zt.asn1.DERGeneralizedTime.superclass.constructor.call(this,t),this.hT="18",this.params=t,this.getFreshValueHex=function(){var t=this.params;if(null==this.params&&(t={date:new Date}),"string"==typeof t){if(!t.match(/^[0-9]{14}Z$/)&&!t.match(/^[0-9]{14}\.[0-9]+Z$/))throw new Error("malformed string for GeneralizedTime: "+t);this.hV=ne(t)}else if(null!=t.str)this.hV=ne(t.str);else if(null==t.date&&1==t.millis){var e=new Date;this.hV=ne(this.formatDate(e,"gen",!0))}else if(null!=t.date&&t.date instanceof Date){var r=!0===t.millis;this.hV=ne(this.formatDate(t.date,"gen",r))}else t instanceof Date&&(this.hV=ne(this.formatDate(t,"gen")));if(null==this.hV)throw new Error("parameter not specified properly for GeneralizedTime");return this.hV},null!=t&&this.setByParam(t)},je(Zt.asn1.DERGeneralizedTime,Zt.asn1.DERAbstractTime),Zt.asn1.DERSequence=function(t){Zt.asn1.DERSequence.superclass.constructor.call(this,t),this.hT="30",this.getFreshValueHex=function(){for(var t="",e=0;e<this.asn1Array.length;e++){t+=this.asn1Array[e].tohex()}return this.hV=t,this.hV}},je(Zt.asn1.DERSequence,Zt.asn1.DERAbstractStructured),Zt.asn1.DERSet=function(t){Zt.asn1.DERSet.superclass.constructor.call(this,t),this.hT="31",this.sortFlag=!0,this.getFreshValueHex=function(){for(var t=new Array,e=0;e<this.asn1Array.length;e++){var r=this.asn1Array[e];t.push(r.tohex())}return 1==this.sortFlag&&t.sort(),this.hV=t.join(""),this.hV},void 0!==t&&void 0!==t.sortflag&&0==t.sortflag&&(this.sortFlag=!1)},je(Zt.asn1.DERSet,Zt.asn1.DERAbstractStructured),Zt.asn1.DERTaggedObject=function(t){Zt.asn1.DERTaggedObject.superclass.constructor.call(this);var e=Zt.asn1,r=ee.getV,n=e.ASN1Util.newObject;this.hT="a0",this.hV="",this.isExplicit=!0,this.asn1Object=null,this.params={tag:"a0",explicit:!0},this.setASN1Object=function(t,e,r){this.params={tag:e,explicit:t,obj:r}},this.getFreshValueHex=function(){var t=this.params;if(null==t.explicit&&(t.explicit=!0),null!=t.tage&&(t.tag=t.tage,t.explicit=!0),null!=t.tagi&&(t.tag=t.tagi,t.explicit=!1),null!=t.str)this.hV=ue(t.str);else if(null!=t.hex)this.hV=t.hex;else{if(null==t.obj)throw new Error("str, hex nor obj not specified");var i;t.obj instanceof e.ASN1Object?i=t.obj.tohex():"object"==typeof t.obj&&(i=n(t.obj).tohex()),t.explicit?this.hV=i:this.hV=r(i,0)}return null==t.tag&&(t.tag="a0"),this.hT=t.tag,this.hTLV=null,this.isModified=!0,this.hV},this.setByParam=function(t){this.params=t},void 0!==t&&this.setByParam(t)},je(Zt.asn1.DERTaggedObject,Zt.asn1.ASN1Object);var Zt,Qt,te,ee=new function(){};function re(t){for(var e="",r=0;r<t.length;r++){var n=t[r].toString(16);1==n.length&&(n="0"+n),e+=n}return e}function ne(t){return re(function(t){for(var e=new Array,r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}(t))}function ie(t){return t=(t=(t=t.replace(/\=/g,"")).replace(/\+/g,"-")).replace(/\//g,"_")}function se(t){return t.length%4==2?t+="==":t.length%4==3&&(t+="="),t=(t=t.replace(/-/g,"+")).replace(/_/g,"/")}function ae(t){return t.length%2==1&&(t="0"+t),ie(ut(t))}function oe(t){return ct(se(t))}function ue(t){return ve(Ae(t)).toLowerCase()}function ce(t){try{return decodeURIComponent(me(t))}catch(t){return null}}function he(t){return ce(function(t){for(var e=t.match(/.{1,2}/g),r=[],n=0;n<e.length;n++){var i=parseInt(e[n],16);161<=i&&i<=191?(r.push("c2"),r.push(e[n])):192<=i&&i<=255?(r.push("c3"),r.push((i-64).toString(16))):r.push(e[n])}return r.join("")}(t))}function le(t){for(var e="",r=0;r<t.length-1;r+=2)e+=String.fromCharCode(parseInt(t.substr(r,2),16));return e}function fe(t){for(var e="",r=0;r<t.length;r++)e+=("0"+t.charCodeAt(r).toString(16)).slice(-2);return e}function pe(t,e){return"-----BEGIN "+e+"-----\r\n"+function(t,e){return(t=t.replace(new RegExp("(.{"+e+"})","g"),"$1\r\n")).replace(/\s+$/,"")}(function(t){return ut(t)}(t),64)+"\r\n-----END "+e+"-----\r\n"}function ge(t,e){if(-1==t.indexOf("-----BEGIN "))throw new Error("can't find PEM header");return function(t){return ct(t.replace(/[^0-9A-Za-z\/+=]*/g,""))}(t=void 0!==e?(t=t.replace(new RegExp("^[^]*-----BEGIN "+e+"-----"),"")).replace(new RegExp("-----END "+e+"-----[^]*$"),""):(t=t.replace(/^[^]*-----BEGIN [^-]+-----/,"")).replace(/-----END [^-]+-----[^]*$/,""))}function de(t){return Math.round(function(t){var e,r,n,i,s,a,o,u,c,h;if(t=function(t){return t.match(/^[0-9]{12}Z$/)||t.match(/^[0-9]{12}[.][0-9]*Z$/)?t.match(/^[0-4]/)?"20"+t:"19"+t:t}(t),h=t.match(/^(\d{4})(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)(|\.\d+)Z$/))return e=parseInt(h[1]),r=parseInt(h[2])-1,n=parseInt(h[3]),i=parseInt(h[4]),s=parseInt(h[5]),a=parseInt(h[6]),o=0,""!==(u=h[7])&&(c=(u.substr(1)+"00").substr(0,3),o=parseInt(c)),Date.UTC(e,r,n,i,s,a,o);throw new Error("unsupported zulu format: "+t)}(t)/1e3)}function ve(t){return t.replace(/%/g,"")}function me(t){return t.replace(/(..)/g,"%$1")}function ye(t){var e="malformed IPv6 address";if(!t.match(/^[0-9A-Fa-f:]+$/))throw e;var r=(t=t.toLowerCase()).split(":").length-1;if(r<2)throw e;var n=":".repeat(7-r+2),i=(t=t.replace("::",n)).split(":");if(8!=i.length)throw e;for(var s=0;s<8;s++)i[s]=("0000"+i[s]).slice(-4);return i.join("")}function we(t){if(!t.match(/^[0-9A-Fa-f]{32}$/))throw new Error("malformed IPv6 address: "+t);var e=(t=t.toLowerCase()).match(/.{1,4}/g);e=e.map(function(t){return t.replace(/^0+/,"")}),e=e.map(function(t){return""==t?"0":t});var r=(t=":"+e.join(":")+":").match(/:(0:){2,}/g);if(null==r)return t.slice(1,-1);var n=r.sort().slice(-1)[0];return"::"!=(t=t.replace(n.substr(0,n.length-1),":")).substr(0,2)&&(t=t.substr(1)),"::"!=t.substr(-2,2)&&(t=t.substr(0,t.length-1)),t}function xe(t){var e=new Error("malformed hex value");if(!t.match(/^([0-9A-Fa-f][0-9A-Fa-f]){1,}$/))throw e;if(8==t.length){try{return parseInt(t.substr(0,2),16)+"."+parseInt(t.substr(2,2),16)+"."+parseInt(t.substr(4,2),16)+"."+parseInt(t.substr(6,2),16)}catch(t){throw e}}else{if(16!=t.length){if(32==t.length)return we(t);if(64==t.length){try{return we(t.substr(0,32))+"/"+Se(t.substr(32))}catch(t){throw e}return}return t}try{return xe(t.substr(0,8))+"/"+Se(t.substr(8))}catch(t){throw e}}}function Se(t){var e,r=new Error("malformed mask");try{e=new ht(t,16).toString(2)}catch(t){throw r}if(!e.match(/^1*0*$/))throw r;return e.replace(/0+$/,"").length}function Ee(t){var e=new Error("malformed IP address");if(!(t=t.toLowerCase(t)).match(/^[0-9a-f.:/]+$/))throw e;if(!t.match(/^[0-9.]+$/)){var r;if(t.match(/^[0-9.]+\/[0-9]+$/))return Ee((r=t.split("/"))[0])+be(parseInt(r[1]),32);if(t.match(/^[0-9a-f:]+$/)&&-1!==t.indexOf(":"))return ye(t);if(t.match(/^[0-9a-f:]+\/[0-9]+$/)&&-1!==t.indexOf(":"))return ye((r=t.split("/"))[0])+be(parseInt(r[1]),128);throw e}var n=t.split(".");if(4!==n.length)throw e;var i="";try{for(var s=0;s<4;s++){i+=("0"+parseInt(n[s]).toString(16)).slice(-2)}return i}catch(t){throw e}}function be(t,e){return 32==e&&0==t?"00000000":128==e&&0==t?"00000000000000000000000000000000":new ht(Array(t+1).join("1")+Array(e-t+1).join("0"),2).toString(16)}function Fe(t){var e=t.match(/.{4}/g).map(function(t){var e=parseInt(t.substr(0,2),16),r=parseInt(t.substr(2),16);if(0==e&r<128)return String.fromCharCode(r);if(e<8){var n=128|63&r;return ce((192|(7&e)<<3|(192&r)>>6).toString(16)+n.toString(16))}n=128|(15&e)<<2|(192&r)>>6;var i=128|63&r;return ce((224|(240&e)>>4).toString(16)+n.toString(16)+i.toString(16))});return e.join("")}function Ae(t){for(var e=encodeURIComponent(t),r="",n=0;n<e.length;n++)"%"==e[n]?(r+=e.substr(n,3),n+=2):r=r+"%"+ne(e[n]);return r}function Ce(t){return!(t.length%2!=0||!t.match(/^[0-9a-f]+$/)&&!t.match(/^[0-9A-F]+$/))}function De(t){return!!t.match(/^[0-9A-Za-z-_.]+$/)}function Pe(t){return t.length%2==1?"0"+t:t.substr(0,1)>"7"?"00"+t:t}function Ie(t,e){if("string"!=typeof t||"string"!=typeof e)throw new Error("arguments shall be string");if(t.length!==e.length)throw new Error("input strings must have the same length");if("function"==typeof Buffer&&void 0!==Vt){if(void 0!==Vt.timingSafeEqual)return Vt.timingSafeEqual(Buffer.from(t),Buffer.from(e));if(void 0!==Vt.subtle&&Vt.subtle.timingSafeEqual)return Vt.subtle.timingSafeEqual(Buffer.from(t),Buffer.from(e))}return function(t,e){if("string"!=typeof t||"string"!=typeof e)throw new Error("arguments shall be string");if(t.length!==e.length)throw new Error("input strings must have the same length");const r=e.slice();for(var n=0,i=0;i<t.length;i++)n|=t.charCodeAt(i)^r.charCodeAt(i);return 0===n}(t,e)}function Re(t){if(!Ce(t))return null;try{var e=[],r=t.substr(0,2),n=parseInt(r,16);e[0]=new String(Math.floor(n/40)),e[1]=new String(n%40);for(var i=t.substr(2),s=[],a=0;a<i.length/2;a++)s.push(parseInt(i.substr(2*a,2),16));var o=[],u="";for(a=0;a<s.length;a++)128&s[a]?u+=Oe((127&s[a]).toString(2),7):(u+=Oe((127&s[a]).toString(2),7),o.push(new String(parseInt(u,2))),u="");var c=e.join(".");return o.length>0&&(c=c+"."+o.join(".")),c}catch(t){return null}}function Te(t){return Ne(new ht(String(t),10))}function Ne(t){var e=t.toString(16);if("-"!=e.substr(0,1))return e.length%2==1?e="0"+e:e.match(/^[0-7]/)||(e="00"+e),e;var r=e.substr(1).length;r%2==1?r+=1:e.match(/^[0-7]/)||(r+=2);for(var n="",i=0;i<r;i++)n+="f";return e=new ht(n,16).xor(t).add(ht.ONE).toString(16).replace(/^-/,"")}ee.getLblen=function(t,e){if("8"!=t.substr(e+2,1))return 1;var r=parseInt(t.substr(e+3,1));return 0==r?-1:0<r&&r<10?r+1:-2},ee.getL=function(t,e){var r=ee.getLblen(t,e);return r<1?"":t.substr(e+2,2*r)},ee.getVblen=function(t,e){var r;return""==(r=ee.getL(t,e))?-1:("8"===r.substr(0,1)?new ht(r.substr(2),16):new ht(r,16)).intValue()},ee.getVidx=function(t,e){var r=ee.getLblen(t,e);return r<0?r:e+2*(r+1)},ee.getV=function(t,e){var r=ee.getVidx(t,e),n=ee.getVblen(t,e);return t.substr(r,2*n)},ee.getTLV=function(t,e){return t.substr(e,2)+ee.getL(t,e)+ee.getV(t,e)},ee.getTLVblen=function(t,e){return 2+2*ee.getLblen(t,e)+2*ee.getVblen(t,e)},ee.getNextSiblingIdx=function(t,e){return ee.getVidx(t,e)+2*ee.getVblen(t,e)},ee.getChildIdx=function(t,e){var r,n,i,s=ee,a=[];if((r=s.getVidx(t,e))+(n=2*s.getVblen(t,e))>t.length)throw new Error("too short ASN.1 value");"03"==t.substr(e,2)&&(r+=2,n-=2),i=0;for(var o=r;i<=n;){var u=s.getTLVblen(t,o);if(u<=0)throw new Error("malformed ASN.1: invalid TLV length");if((i+=u)<=n&&a.push(o),o+=u,i>=n)break}return a},ee.getNthChildIdx=function(t,e,r){return ee.getChildIdx(t,e)[r]},ee.getIdxbyList=function(t,e,r,n){var i,s,a=ee;return 0==r.length?void 0!==n&&t.substr(e,2)!==n?-1:e:(i=r.shift())>=(s=a.getChildIdx(t,e)).length?-1:a.getIdxbyList(t,s[i],r,n)},ee.getIdxbyListEx=function(t,e,r,n){var i,s,a=ee;if(0==r.length)return void 0!==n&&t.substr(e,2)!==n?-1:e;i=r.shift(),s=a.getChildIdx(t,e);for(var o=0,u=0;u<s.length;u++){var c=t.substr(s[u],2);if("number"==typeof i&&!a.isContextTag(c)&&o==i||"string"==typeof i&&a.isContextTag(c,i))return a.getIdxbyListEx(t,s[u],r,n);a.isContextTag(c)||o++}return-1},ee.getTLVbyList=function(t,e,r,n){var i=ee,s=i.getIdxbyList(t,e,r,n);return-1==s||s>=t.length?null:i.getTLV(t,s)},ee.getTLVbyListEx=function(t,e,r,n){var i=ee,s=i.getIdxbyListEx(t,e,r,n);return-1==s?null:i.getTLV(t,s)},ee.getVbyList=function(t,e,r,n,i){var s,a,o=ee;return-1==(s=o.getIdxbyList(t,e,r,n))||s>=t.length?null:(a=o.getV(t,s),!0===i&&(a=a.substr(2)),a)},ee.getVbyListEx=function(t,e,r,n,i){var s,a,o=ee;return-1==(s=o.getIdxbyListEx(t,e,r,n))?null:(a=o.getV(t,s),"03"==t.substr(s,2)&&!1!==i&&(a=a.substr(2)),a)},ee.getInt=function(t,e,r){null==r&&(r=-1);try{var n=t.substr(e,2);if("02"!=n&&"03"!=n)return r;var i=ee.getV(t,e);return"02"==n?parseInt(i,16):function(t){if(t.length%2!=0)return-1;if(t=t.toLowerCase(),null==t.match(/^[0-9a-f]+$/))return-1;try{var e=t.substr(0,2);if("00"==e)return parseInt(t.substr(2),16);var r=parseInt(e,16);if(r>7)return-1;var n=t.substr(2),i=parseInt(n,16).toString(2);"0"==i&&(i="00000000"),i=i.slice(0,0-r);var s=parseInt(i,2);return NaN==s?-1:s}catch(t){return-1}}(i)}catch(t){return r}},ee.getOID=function(t,e,r){null==r&&(r=null);try{return"06"!=t.substr(e,2)?r:Re(ee.getV(t,e))}catch(t){return r}},ee.getOIDName=function(t,e,r){null==r&&(r=null);try{var n=ee.getOID(t,e,r);if(n==r)return r;var i=Zt.asn1.x509.OID.oid2name(n);return""==i?n:i}catch(t){return r}},ee.getString=function(t,e,r){null==r&&(r=null);try{return le(ee.getV(t,e))}catch(t){return r}},ee.hextooidstr=function(t){var e=function(t,e){return t.length>=e?t:new Array(e-t.length+1).join("0")+t},r=[],n=t.substr(0,2),i=parseInt(n,16);r[0]=new String(Math.floor(i/40)),r[1]=new String(i%40);for(var s=t.substr(2),a=[],o=0;o<s.length/2;o++)a.push(parseInt(s.substr(2*o,2),16));var u=[],c="";for(o=0;o<a.length;o++)128&a[o]?c+=e((127&a[o]).toString(2),7):(c+=e((127&a[o]).toString(2),7),u.push(new String(parseInt(c,2))),c="");var h=r.join(".");return u.length>0&&(h=h+"."+u.join(".")),h},ee.dump=function(t,e,r,n){var i=ee,s=i.getV,a=i.dump,o=i.getChildIdx,u=t;t instanceof Zt.asn1.ASN1Object&&(u=t.tohex());var c=function(t,e){return t.length<=2*e?t:t.substr(0,e)+"..(total "+t.length/2+"bytes).."+t.substr(t.length-e,e)};void 0===e&&(e={ommit_long_octet:32}),void 0===r&&(r=0),void 0===n&&(n="");var h,l=e.ommit_long_octet;if("01"==(h=u.substr(r,2)))return"00"==(f=s(u,r))?n+"BOOLEAN FALSE\n":n+"BOOLEAN TRUE\n";if("02"==h)return n+"INTEGER "+c(f=s(u,r),l)+"\n";if("03"==h){var f=s(u,r);if(i.isASN1HEX(f.substr(2))){var p=n+"BITSTRING, encapsulates\n";return p+=a(f.substr(2),e,0,n+" ")}return n+"BITSTRING "+c(f,l)+"\n"}if("04"==h){f=s(u,r);if(i.isASN1HEX(f)){p=n+"OCTETSTRING, encapsulates\n";return p+=a(f,e,0,n+" ")}return n+"OCTETSTRING "+c(f,l)+"\n"}if("05"==h)return n+"NULL\n";if("06"==h){var g=s(u,r),d=Zt.asn1.ASN1Util.oidHexToInt(g),v=Zt.asn1.x509.OID.oid2name(d),m=d.replace(/\./g," ");return""!=v?n+"ObjectIdentifier "+v+" ("+m+")\n":n+"ObjectIdentifier ("+m+")\n"}if("0a"==h)return n+"ENUMERATED "+parseInt(s(u,r))+"\n";if("0c"==h)return n+"UTF8String '"+ce(s(u,r))+"'\n";if("13"==h)return n+"PrintableString '"+ce(s(u,r))+"'\n";if("14"==h)return n+"TeletexString '"+ce(s(u,r))+"'\n";if("16"==h)return n+"IA5String '"+ce(s(u,r))+"'\n";if("17"==h)return n+"UTCTime "+ce(s(u,r))+"\n";if("18"==h)return n+"GeneralizedTime "+ce(s(u,r))+"\n";if("1a"==h)return n+"VisualString '"+ce(s(u,r))+"'\n";if("1e"==h)return n+"BMPString '"+Fe(s(u,r))+"'\n";if("30"==h){if("3000"==u.substr(r,4))return n+"SEQUENCE {}\n";p=n+"SEQUENCE\n";var y=e;if((2==(S=o(u,r)).length||3==S.length)&&"06"==u.substr(S[0],2)&&"04"==u.substr(S[S.length-1],2)){v=i.oidname(s(u,S[0]));var w=JSON.parse(JSON.stringify(e));w.x509ExtName=v,y=w}for(var x=0;x<S.length;x++)p+=a(u,y,S[x],n+" ");return p}if("31"==h){p=n+"SET\n";var S=o(u,r);for(x=0;x<S.length;x++)p+=a(u,e,S[x],n+" ");return p}if(128&(h=parseInt(h,16))){var E=31&h;if(32&h){for(p=n+"["+E+"]\n",S=o(u,r),x=0;x<S.length;x++)p+=a(u,e,S[x],n+" ");return p}f=s(u,r);if(ee.isASN1HEX(f)){var p=n+"["+E+"]\n";return p+=a(f,e,0,n+" ")}return("68747470"==f.substr(0,8)||"subjectAltName"===e.x509ExtName&&2==E)&&(f=ce(f)),p=n+"["+E+"] "+f+"\n"}return n+"UNKNOWN("+h+") "+s(u,r)+"\n"},ee.parse=function(t){var e=ee,r=e.parse,n=e.isASN1HEX,i=e.getV,s=e.getTLV,a=e.getChildIdx,o=Zt.asn1,u=o.ASN1Util.oidHexToInt,c=o.x509.OID.oid2name,h=ce,l=Fe,f=he,p={"0c":"utf8str",12:"numstr",13:"prnstr",14:"telstr",16:"ia5str",17:"utctime",18:"gentime","1a":"visstr","1e":"bmpstr",30:"seq",31:"set"},g=t.substr(0,2),d={},v=i(t,0);if("01"==g)return"0101ff"==t?{bool:!0}:{bool:!1};if("02"==g)return{int:{hex:v}};if("03"==g)try{if("00"!=v.substr(0,2))throw"not encap";var m=v.substr(2);if(!n(m))throw"not encap";return{bitstr:{obj:r(m)}}}catch(t){var y=null;return v.length<=10&&(y=function(t){if("string"!=typeof t)return null;if(t.length%2!=0)return null;if(!t.match(/^[0-9a-f]+$/))return null;try{var e=parseInt(t.substr(0,2),16);if(e<0||7<e)return null;for(var r=t.substr(2),n="",i=0;i<r.length;i+=2){var s=r.substr(i,2),a=parseInt(s,16).toString(2);n+=a=("0000000"+a).slice(-8)}return n.substr(0,n.length-e)}catch(t){return null}}(v)),null==y?{bitstr:{hex:v}}:{bitstr:{bin:y}}}else if("04"==g)try{if(!n(v))throw"not encap";return{octstr:{obj:r(v)}}}catch(t){return{octstr:{hex:v}}}else{if("05"==g)return{null:""};if("06"==g){var w=u(v),x=c(w);return""==x?{oid:w}:{oid:x}}if("0a"==g)return v.length>4?{enum:{hex:v}}:{enum:parseInt(v,16)};if("30"==g||"31"==g)return d[p[g]]=function(t){for(var e=[],n=a(t,0),i=0;i<n.length;i++){var o=n[i],u=s(t,o),c=r(u);e.push(c)}return e}(t),d;if("14"==g){var S=f(v);return d[p[g]]={str:S},d}if("1e"==g){S=l(v);return d[p[g]]={str:S},d}if(-1!=":0c:12:13:16:17:18:1a:".indexOf(g)){S=h(v);return d[p[g]]={str:S},d}if(g.match(/^8[0-9]$/))return null==(S=h(v))|""==S||null!=S.match(/[\x00-\x1F\x7F-\x9F]/)||null!=S.match(/[\u0000-\u001F\u0080–\u009F]/)?{tag:{tag:g,explicit:!1,hex:v}}:{tag:{tag:g,explicit:!1,str:S}};if(!g.match(/^a[0-9]$/)){var E=new Zt.asn1.ASN1Object;return E.hV=v,{asn1:{tlv:g+E.getLengthHexFromValue()+v}}}try{if(!n(v))throw new Error("not encap");return{tag:{tag:g,explicit:!0,obj:r(v)}}}catch(t){return{tag:{tag:g,explicit:!0,hex:v}}}}},ee.isContextTag=function(t,e){var r,n;t=t.toLowerCase();try{r=parseInt(t,16)}catch(t){return-1}if(void 0===e)return 128==(192&r);try{return null!=e.match(/^\[[0-9]+\]$/)&&(!((n=parseInt(e.substr(1,e.length-1),10))>31)&&(128==(192&r)&&(31&r)==n))}catch(t){return!1}},ee.isASN1HEX=function(t){var e=ee;if(t.length%2==1)return!1;var r=e.getVblen(t,0),n=t.substr(0,2),i=e.getL(t,0);return t.length-n.length-i.length==2*r},ee.checkStrictDER=function(t,e,r,n,i){var s=ee;if(void 0===r){if("string"!=typeof t)throw new Error("not hex string");if(t=t.toLowerCase(),!Zt.lang.String.isHex(t))throw new Error("not hex string");r=t.length,i=(n=t.length/2)<128?1:Math.ceil(n.toString(16))+1}if(s.getL(t,e).length>2*i)throw new Error("L of TLV too long: idx="+e);var a=s.getVblen(t,e);if(a>n)throw new Error("value of L too long than hex: idx="+e);var o=s.getTLV(t,e),u=o.length-2-s.getL(t,e).length;if(u!==2*a)throw new Error("V string length and L's value not the same:"+u+"/"+2*a);if(0===e&&t.length!=o.length)throw new Error("total length and TLV length unmatch:"+t.length+"!="+o.length);var c=t.substr(e,2);if("02"===c){var h=s.getVidx(t,e);if("00"==t.substr(h,2)&&t.charCodeAt(h+2)<56)throw new Error("not least zeros for DER INTEGER")}if(32&parseInt(c,16)){for(var l=s.getVblen(t,e),f=0,p=s.getChildIdx(t,e),g=0;g<p.length;g++){f+=s.getTLV(t,p[g]).length,s.checkStrictDER(t,p[g],r,n,i)}if(2*l!=f)throw new Error("sum of children's TLV length and L unmatch: "+2*l+"!="+f)}},ee.oidname=function(t){var e=Zt.asn1;Zt.lang.String.isHex(t)&&(t=e.ASN1Util.oidHexToInt(t));var r=e.x509.OID.oid2name(t);return""===r&&(r=t),r},void 0!==Zt&&Zt||(Zt={}),void 0!==Zt.asn1&&Zt.asn1||(Zt.asn1={}),void 0!==Zt.asn1.x509&&Zt.asn1.x509||(Zt.asn1.x509={}),Zt.asn1.x509.Certificate=function(t){Zt.asn1.x509.Certificate.superclass.constructor.call(this);var e=Zt.asn1,r=e.DERBitString,n=e.DERSequence,i=e.x509,s=i.TBSCertificate,a=i.AlgorithmIdentifier;this.params=void 0,this.setByParam=function(t){this.params=t},this.sign=function(){var t=this.params,e=t.sigalg;null!=t.sigalg.name&&(e=t.sigalg.name);var r=t.tbsobj.tohex(),n=new Zt.crypto.Signature({alg:e});n.init(t.cakey),n.updateHex(r),t.sighex=n.sign()},this.getPEM=function(){return pe(this.tohex(),"CERTIFICATE")},this.tohex=function(){var t=this.params;if(null!=t.tbsobj&&null!=t.tbsobj||(t.tbsobj=new s(t)),null==t.sighex&&null!=t.cakey&&this.sign(),null==t.sighex)throw new Error("sighex or cakey parameter not defined");var e=[];return e.push(t.tbsobj),e.push(new a({name:t.sigalg})),e.push(new r({hex:"00"+t.sighex})),new n({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&(this.params=t)},je(Zt.asn1.x509.Certificate,Zt.asn1.ASN1Object),Zt.asn1.x509.TBSCertificate=function(t){Zt.asn1.x509.TBSCertificate.superclass.constructor.call(this);var e=Zt.asn1,r=e.x509,n=e.DERTaggedObject,i=e.DERInteger,s=e.DERSequence,a=r.AlgorithmIdentifier,o=r.Time,u=r.X500Name,c=r.Extensions,h=r.SubjectPublicKeyInfo;this.params=null,this.setByParam=function(t){this.params=t},this.tohex=function(){var t=[],e=this.params;if(null!=e.version||1!=e.version){var r=2;null!=e.version&&(r=e.version-1);var l=new n({obj:new i({int:r})});t.push(l)}return t.push(new i(e.serial)),t.push(new a({name:e.sigalg})),t.push(new u(e.issuer)),t.push(new s({array:[new o(e.notbefore),new o(e.notafter)]})),t.push(new u(e.subject)),t.push(new h(He.getKey(e.sbjpubkey))),void 0!==e.ext&&e.ext.length>0&&t.push(new n({tag:"a3",obj:new c(e.ext)})),new Zt.asn1.DERSequence({array:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&this.setByParam(t)},je(Zt.asn1.x509.TBSCertificate,Zt.asn1.ASN1Object),Zt.asn1.x509.Extensions=function(t){Zt.asn1.x509.Extensions.superclass.constructor.call(this);var e=Zt.asn1,r=e.DERSequence,n=e.x509;this.aParam=[],this.setByParam=function(t){this.aParam=t},this.tohex=function(){for(var t=[],e=0;e<this.aParam.length;e++){var i=this.aParam[e],s=i.extname,a=null;if(null!=i.extn)a=new n.PrivateExtension(i);else if("subjectKeyIdentifier"==s)a=new n.SubjectKeyIdentifier(i);else if("keyUsage"==s)a=new n.KeyUsage(i);else if("subjectAltName"==s)a=new n.SubjectAltName(i);else if("issuerAltName"==s)a=new n.IssuerAltName(i);else if("basicConstraints"==s)a=new n.BasicConstraints(i);else if("nameConstraints"==s)a=new n.NameConstraints(i);else if("cRLDistributionPoints"==s)a=new n.CRLDistributionPoints(i);else if("certificatePolicies"==s)a=new n.CertificatePolicies(i);else if("policyMappings"==s)a=new n.PolicyMappings(i);else if("policyConstraints"==s)a=new n.PolicyConstraints(i);else if("inhibitAnyPolicy"==s)a=new n.InhibitAnyPolicy(i);else if("authorityKeyIdentifier"==s)a=new n.AuthorityKeyIdentifier(i);else if("extKeyUsage"==s)a=new n.ExtKeyUsage(i);else if("authorityInfoAccess"==s)a=new n.AuthorityInfoAccess(i);else if("cRLNumber"==s)a=new n.CRLNumber(i);else if("cRLReason"==s)a=new n.CRLReason(i);else if("ocspNonce"==s)a=new n.OCSPNonce(i);else if("ocspNoCheck"==s)a=new n.OCSPNoCheck(i);else if("adobeTimeStamp"==s)a=new n.AdobeTimeStamp(i);else{if("subjectDirectoryAttributes"!=s)throw new Error("extension not supported:"+JSON.stringify(i));a=new n.SubjectDirectoryAttributes(i)}null!=a&&t.push(a)}return new r({array:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},je(Zt.asn1.x509.Extensions,Zt.asn1.ASN1Object),Zt.asn1.x509.Extension=function(t){Zt.asn1.x509.Extension.superclass.constructor.call(this);var e=Zt.asn1,r=e.DERObjectIdentifier,n=e.DEROctetString,i=e.DERBoolean,s=e.DERSequence;this.tohex=function(){var t=new r({oid:this.oid}),e=new n({hex:this.getExtnValueHex()}),a=new Array;return a.push(t),this.critical&&a.push(new i),a.push(e),new s({array:a}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.critical=!1,void 0!==t&&void 0!==t.critical&&(this.critical=t.critical)},je(Zt.asn1.x509.Extension,Zt.asn1.ASN1Object),Zt.asn1.x509.KeyUsage=function(t){Zt.asn1.x509.KeyUsage.superclass.constructor.call(this,t);var e=Error,r={digitalSignature:0,nonRepudiation:1,keyEncipherment:2,dataEncipherment:3,keyAgreement:4,keyCertSign:5,cRLSign:6,encipherOnly:7,decipherOnly:8};this.getExtnValueHex=function(){var t=this.getBinValue();return this.asn1ExtnValue=new Zt.asn1.DERBitString({bin:t}),this.asn1ExtnValue.tohex()},this.getBinValue=function(){var t=this.params;if("object"!=typeof t||"object"!=typeof t.names&&"string"!=typeof t.bin)throw new e("parameter not yet set");if(null!=t.names)return Be(t.names,r);if(null!=t.bin)return t.bin;throw new e("parameter not set properly")},this.oid="2.5.29.15",void 0!==t&&(this.params=t)},je(Zt.asn1.x509.KeyUsage,Zt.asn1.x509.Extension),Zt.asn1.x509.BasicConstraints=function(t){Zt.asn1.x509.BasicConstraints.superclass.constructor.call(this,t);var e=Zt.asn1,r=e.DERBoolean,n=e.DERInteger,i=e.DERSequence;this.getExtnValueHex=function(){var t=new Array;this.cA&&t.push(new r),this.pathLen>-1&&t.push(new n({int:this.pathLen}));var e=new i({array:t});return this.asn1ExtnValue=e,this.asn1ExtnValue.tohex()},this.oid="2.5.29.19",this.cA=!1,this.pathLen=-1,void 0!==t&&(void 0!==t.cA&&(this.cA=t.cA),void 0!==t.pathLen&&(this.pathLen=t.pathLen))},je(Zt.asn1.x509.BasicConstraints,Zt.asn1.x509.Extension),Zt.asn1.x509.CRLDistributionPoints=function(t){Zt.asn1.x509.CRLDistributionPoints.superclass.constructor.call(this,t);var e=Zt.asn1,r=e.x509;this.getExtnValueHex=function(){return this.asn1ExtnValue.tohex()},this.setByDPArray=function(t){for(var n=[],i=0;i<t.length;i++)if(t[i]instanceof Zt.asn1.ASN1Object)n.push(t[i]);else{var s=new r.DistributionPoint(t[i]);n.push(s)}this.asn1ExtnValue=new e.DERSequence({array:n})},this.setByOneURI=function(t){var e=new r.DistributionPoint({fulluri:t});this.setByDPArray([e])},this.oid="2.5.29.31",void 0!==t&&(void 0!==t.array?this.setByDPArray(t.array):void 0!==t.uri&&this.setByOneURI(t.uri))},je(Zt.asn1.x509.CRLDistributionPoints,Zt.asn1.x509.Extension),Zt.asn1.x509.DistributionPoint=function(t){Zt.asn1.x509.DistributionPoint.superclass.constructor.call(this);var e=Zt.asn1,r=e.x509.DistributionPointName;this.tohex=function(){var t=new e.DERSequence;if(null!=this.asn1DP){var r=new e.DERTaggedObject({explicit:!0,tag:"a0",obj:this.asn1DP});t.appendASN1Object(r)}return this.hTLV=t.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&(void 0!==t.dpobj?this.asn1DP=t.dpobj:void 0!==t.dpname?this.asn1DP=new r(t.dpname):void 0!==t.fulluri&&(this.asn1DP=new r({full:[{uri:t.fulluri}]})))},je(Zt.asn1.x509.DistributionPoint,Zt.asn1.ASN1Object),Zt.asn1.x509.DistributionPointName=function(t){Zt.asn1.x509.DistributionPointName.superclass.constructor.call(this);var e=Zt.asn1,r=e.DERTaggedObject;if(this.tohex=function(){if("full"!=this.type)throw new Error("currently type shall be 'full': "+this.type);return this.asn1Obj=new r({explicit:!1,tag:this.tag,obj:this.asn1V}),this.hTLV=this.asn1Obj.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},void 0!==t)if(e.x509.GeneralNames.prototype.isPrototypeOf(t))this.type="full",this.tag="a0",this.asn1V=t;else{if(void 0===t.full)throw new Error("This class supports GeneralNames only as argument");this.type="full",this.tag="a0",this.asn1V=new e.x509.GeneralNames(t.full)}},je(Zt.asn1.x509.DistributionPointName,Zt.asn1.ASN1Object),Zt.asn1.x509.CertificatePolicies=function(t){Zt.asn1.x509.CertificatePolicies.superclass.constructor.call(this,t);var e=Zt.asn1,r=e.x509,n=e.DERSequence,i=r.PolicyInformation;this.params=null,this.getExtnValueHex=function(){for(var t=[],e=0;e<this.params.array.length;e++)t.push(new i(this.params.array[e]));var r=new n({array:t});return this.asn1ExtnValue=r,this.asn1ExtnValue.tohex()},this.oid="2.5.29.32",void 0!==t&&(this.params=t)},je(Zt.asn1.x509.CertificatePolicies,Zt.asn1.x509.Extension),Zt.asn1.x509.PolicyInformation=function(t){Zt.asn1.x509.PolicyInformation.superclass.constructor.call(this,t);var e=Zt.asn1,r=e.DERSequence,n=e.DERObjectIdentifier,i=e.x509.PolicyQualifierInfo;this.params=null,this.tohex=function(){if(void 0===this.params.policyoid&&void 0===this.params.array)throw new Error("parameter oid and array missing");var t=[new n(this.params.policyoid)];if(void 0!==this.params.array){for(var e=[],s=0;s<this.params.array.length;s++)e.push(new i(this.params.array[s]));e.length>0&&t.push(new r({array:e}))}return new r({array:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&(this.params=t)},je(Zt.asn1.x509.PolicyInformation,Zt.asn1.ASN1Object),Zt.asn1.x509.PolicyQualifierInfo=function(t){Zt.asn1.x509.PolicyQualifierInfo.superclass.constructor.call(this,t);var e=Zt.asn1,r=e.DERSequence,n=e.DERIA5String,i=e.DERObjectIdentifier,s=e.x509.UserNotice;this.params=null,this.tohex=function(){return void 0!==this.params.cps?new r({array:[new i({oid:"1.3.6.1.5.5.7.2.1"}),new n({str:this.params.cps})]}).tohex():null!=this.params.unotice?new r({array:[new i({oid:"1.3.6.1.5.5.7.2.2"}),new s(this.params.unotice)]}).tohex():void 0},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&(this.params=t)},je(Zt.asn1.x509.PolicyQualifierInfo,Zt.asn1.ASN1Object),Zt.asn1.x509.UserNotice=function(t){Zt.asn1.x509.UserNotice.superclass.constructor.call(this,t);var e=Zt.asn1.DERSequence,r=Zt.asn1.x509.DisplayText,n=Zt.asn1.x509.NoticeReference;this.params=null,this.tohex=function(){var t=[];return void 0!==this.params.noticeref&&t.push(new n(this.params.noticeref)),void 0!==this.params.exptext&&t.push(new r(this.params.exptext)),new e({array:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&(this.params=t)},je(Zt.asn1.x509.UserNotice,Zt.asn1.ASN1Object),Zt.asn1.x509.NoticeReference=function(t){Zt.asn1.x509.NoticeReference.superclass.constructor.call(this,t);var e=Zt.asn1.DERSequence,r=Zt.asn1.DERInteger,n=Zt.asn1.x509.DisplayText;this.params=null,this.tohex=function(){var t=[];if(void 0!==this.params.org&&t.push(new n(this.params.org)),void 0!==this.params.noticenum){for(var i=[],s=this.params.noticenum,a=0;a<s.length;a++)i.push(new r(s[a]));t.push(new e({array:i}))}if(0==t.length)throw new Error("parameter is empty");return new e({array:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&(this.params=t)},je(Zt.asn1.x509.NoticeReference,Zt.asn1.ASN1Object),Zt.asn1.x509.DisplayText=function(t){Zt.asn1.x509.DisplayText.superclass.constructor.call(this,t),this.hT="0c",void 0!==t&&("ia5"===t.type?this.hT="16":"vis"===t.type?this.hT="1a":"bmp"===t.type&&(this.hT="1e"))},je(Zt.asn1.x509.DisplayText,Zt.asn1.DERAbstractString),Zt.asn1.x509.PolicyMappings=function(t){Zt.asn1.x509.PolicyMappings.superclass.constructor.call(this,t);var e=Zt.asn1.ASN1Util.newObject;this.params=null,this.getExtnValueHex=function(){for(var t=this.params,r=[],n=0;n<t.array.length;n++){var i=t.array[n];r.push({seq:[{oid:i[0]},{oid:i[1]}]})}return this.asn1ExtnValue=e({seq:r}),this.asn1ExtnValue.tohex()},this.oid="2.5.29.33",void 0!==t&&(this.params=t)},je(Zt.asn1.x509.PolicyMappings,Zt.asn1.x509.Extension),Zt.asn1.x509.PolicyConstraints=function(t){Zt.asn1.x509.PolicyConstraints.superclass.constructor.call(this,t);var e=Zt.asn1.ASN1Util.newObject;this.params=null,this.getExtnValueHex=function(){var t=this.params,r=[];return null!=t.reqexp&&r.push({tag:{tagi:"80",obj:{int:t.reqexp}}}),null!=t.inhibit&&r.push({tag:{tagi:"81",obj:{int:t.inhibit}}}),this.asn1ExtnValue=e({seq:r}),this.asn1ExtnValue.tohex()},this.oid="2.5.29.36",void 0!==t&&(this.params=t)},je(Zt.asn1.x509.PolicyConstraints,Zt.asn1.x509.Extension),Zt.asn1.x509.InhibitAnyPolicy=function(t){Zt.asn1.x509.InhibitAnyPolicy.superclass.constructor.call(this,t);var e=Zt.asn1.ASN1Util.newObject;this.params=null,this.getExtnValueHex=function(){return this.asn1ExtnValue=e({int:this.params.skip}),this.asn1ExtnValue.tohex()},this.oid="2.5.29.54",void 0!==t&&(this.params=t)},je(Zt.asn1.x509.InhibitAnyPolicy,Zt.asn1.x509.Extension),Zt.asn1.x509.NameConstraints=function(t){Zt.asn1.x509.NameConstraints.superclass.constructor.call(this,t);var e=Zt.asn1,r=e.x509,n=e.ASN1Util.newObject,i=r.GeneralSubtree;this.params=null,this.getExtnValueHex=function(){var t=this.params,e=[];if(null!=t.permit&&null!=t.permit.length){for(var r=[],s=0;s<t.permit.length;s++)r.push(new i(t.permit[s]));e.push({tag:{tagi:"a0",obj:{seq:r}}})}if(null!=t.exclude&&null!=t.exclude.length){var a=[];for(s=0;s<t.exclude.length;s++)a.push(new i(t.exclude[s]));e.push({tag:{tagi:"a1",obj:{seq:a}}})}return this.asn1ExtnValue=n({seq:e}),this.asn1ExtnValue.tohex()},this.oid="2.5.29.30",void 0!==t&&(this.params=t)},je(Zt.asn1.x509.NameConstraints,Zt.asn1.x509.Extension),Zt.asn1.x509.GeneralSubtree=function(t){Zt.asn1.x509.GeneralSubtree.superclass.constructor.call(this);var e=Zt.asn1,r=e.x509.GeneralName,n=e.ASN1Util.newObject;this.params=null,this.setByParam=function(t){this.params=t},this.tohex=function(){var t=this.params,e=[new r(t)];return null!=t.min&&e.push({tag:{tagi:"80",obj:{int:t.min}}}),null!=t.max&&e.push({tag:{tagi:"81",obj:{int:t.max}}}),n({seq:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&this.setByParam(t)},je(Zt.asn1.x509.GeneralSubtree,Zt.asn1.ASN1Object),Zt.asn1.x509.ExtKeyUsage=function(t){Zt.asn1.x509.ExtKeyUsage.superclass.constructor.call(this,t);var e=Zt.asn1;this.setPurposeArray=function(t){this.asn1ExtnValue=new e.DERSequence;for(var r=0;r<t.length;r++){var n=new e.DERObjectIdentifier(t[r]);this.asn1ExtnValue.appendASN1Object(n)}},this.getExtnValueHex=function(){return this.asn1ExtnValue.tohex()},this.oid="2.5.29.37",void 0!==t&&void 0!==t.array&&this.setPurposeArray(t.array)},je(Zt.asn1.x509.ExtKeyUsage,Zt.asn1.x509.Extension),Zt.asn1.x509.AuthorityKeyIdentifier=function(t){Zt.asn1.x509.AuthorityKeyIdentifier.superclass.constructor.call(this,t);var e=Zt.asn1,r=e.DERTaggedObject,n=e.x509.GeneralNames;this.asn1KID=null,this.asn1CertIssuer=null,this.asn1CertSN=null,this.getExtnValueHex=function(){var t=new Array;this.asn1KID&&t.push(new r({explicit:!1,tag:"80",obj:this.asn1KID})),this.asn1CertIssuer&&t.push(new r({explicit:!1,tag:"a1",obj:new n([{dn:this.asn1CertIssuer}])})),this.asn1CertSN&&t.push(new r({explicit:!1,tag:"82",obj:this.asn1CertSN}));var i=new e.DERSequence({array:t});return this.asn1ExtnValue=i,this.asn1ExtnValue.tohex()},this.setKIDByParam=function(t){if(void 0!==t.str||void 0!==t.hex)this.asn1KID=new Zt.asn1.DEROctetString(t);else if("object"==typeof t&&Zt.crypto.Util.isKey(t)||"string"==typeof t&&-1!=t.indexOf("BEGIN ")){var e=t;"string"==typeof t&&(e=He.getKey(t));var r=He.getKeyID(e);this.asn1KID=new Zt.asn1.DEROctetString({hex:r})}},this.setCertIssuerByParam=function(t){void 0!==t.str||void 0!==t.ldapstr||void 0!==t.hex||void 0!==t.certsubject||void 0!==t.certissuer?this.asn1CertIssuer=new Zt.asn1.x509.X500Name(t):"string"==typeof t&&-1!=t.indexOf("BEGIN ")&&-1!=t.indexOf("CERTIFICATE")&&(this.asn1CertIssuer=new Zt.asn1.x509.X500Name({certissuer:t}))},this.setCertSNByParam=function(t){if(void 0!==t.str||void 0!==t.bigint||void 0!==t.hex)this.asn1CertSN=new Zt.asn1.DERInteger(t);else if("string"==typeof t&&-1!=t.indexOf("BEGIN ")&&t.indexOf("CERTIFICATE")){var e=new qe;e.readCertPEM(t);var r=e.getSerialNumberHex();this.asn1CertSN=new Zt.asn1.DERInteger({hex:r})}},this.oid="2.5.29.35",void 0!==t&&(void 0!==t.kid&&this.setKIDByParam(t.kid),void 0!==t.issuer&&this.setCertIssuerByParam(t.issuer),void 0!==t.sn&&this.setCertSNByParam(t.sn),void 0!==t.issuersn&&"string"==typeof t.issuersn&&-1!=t.issuersn.indexOf("BEGIN ")&&t.issuersn.indexOf("CERTIFICATE")&&(this.setCertSNByParam(t.issuersn),this.setCertIssuerByParam(t.issuersn)))},je(Zt.asn1.x509.AuthorityKeyIdentifier,Zt.asn1.x509.Extension),Zt.asn1.x509.SubjectKeyIdentifier=function(t){Zt.asn1.x509.SubjectKeyIdentifier.superclass.constructor.call(this,t);var e=Zt.asn1.DEROctetString;this.asn1KID=null,this.getExtnValueHex=function(){return this.asn1ExtnValue=this.asn1KID,this.asn1ExtnValue.tohex()},this.setKIDByParam=function(t){if(void 0!==t.str||void 0!==t.hex)this.asn1KID=new e(t);else if("object"==typeof t&&Zt.crypto.Util.isKey(t)||"string"==typeof t&&-1!=t.indexOf("BEGIN")){var r=t;"string"==typeof t&&(r=He.getKey(t));var n=He.getKeyID(r);this.asn1KID=new Zt.asn1.DEROctetString({hex:n})}},this.oid="2.5.29.14",void 0!==t&&void 0!==t.kid&&this.setKIDByParam(t.kid)},je(Zt.asn1.x509.SubjectKeyIdentifier,Zt.asn1.x509.Extension),Zt.asn1.x509.AuthorityInfoAccess=function(t){Zt.asn1.x509.AuthorityInfoAccess.superclass.constructor.call(this,t),this.setAccessDescriptionArray=function(t){for(var e=new Array,r=Zt.asn1,n=r.DERSequence,i=r.DERObjectIdentifier,s=r.x509.GeneralName,a=0;a<t.length;a++){var o,u=t[a];if(void 0!==u.ocsp)o=new n({array:[new i({oid:"1.3.6.1.5.5.7.48.1"}),new s({uri:u.ocsp})]});else{if(void 0===u.caissuer)throw new Error("unknown AccessMethod parameter: "+JSON.stringify(u));o=new n({array:[new i({oid:"1.3.6.1.5.5.7.48.2"}),new s({uri:u.caissuer})]})}e.push(o)}this.asn1ExtnValue=new n({array:e})},this.getExtnValueHex=function(){return this.asn1ExtnValue.tohex()},this.oid="1.3.6.1.5.5.7.1.1",void 0!==t&&void 0!==t.array&&this.setAccessDescriptionArray(t.array)},je(Zt.asn1.x509.AuthorityInfoAccess,Zt.asn1.x509.Extension),Zt.asn1.x509.SubjectAltName=function(t){Zt.asn1.x509.SubjectAltName.superclass.constructor.call(this,t),this.setNameArray=function(t){this.asn1ExtnValue=new Zt.asn1.x509.GeneralNames(t)},this.getExtnValueHex=function(){return this.asn1ExtnValue.tohex()},this.oid="2.5.29.17",void 0!==t&&void 0!==t.array&&this.setNameArray(t.array)},je(Zt.asn1.x509.SubjectAltName,Zt.asn1.x509.Extension),Zt.asn1.x509.IssuerAltName=function(t){Zt.asn1.x509.IssuerAltName.superclass.constructor.call(this,t),this.setNameArray=function(t){this.asn1ExtnValue=new Zt.asn1.x509.GeneralNames(t)},this.getExtnValueHex=function(){return this.asn1ExtnValue.tohex()},this.oid="2.5.29.18",void 0!==t&&void 0!==t.array&&this.setNameArray(t.array)},je(Zt.asn1.x509.IssuerAltName,Zt.asn1.x509.Extension),Zt.asn1.x509.SubjectDirectoryAttributes=function(t){Zt.asn1.x509.SubjectDirectoryAttributes.superclass.constructor.call(this,t);var e=Zt.asn1,r=e.DERSequence,n=e.ASN1Util.newObject,i=e.x509.OID.name2oid;this.params=null,this.getExtnValueHex=function(){for(var t=[],e=0;e<this.params.array.length;e++){var s=this.params.array[e];if(null==s.attr||null==s.array){var a={seq:[{oid:"1.2.3.4"},{set:[{utf8str:"DE"}]}]};if("dateOfBirth"==s.attr)a.seq[0].oid=i(s.attr),a.seq[1].set[0]={gentime:s.str};else if("placeOfBirth"==s.attr)a.seq[0].oid=i(s.attr),a.seq[1].set[0]={utf8str:s.str};else if("gender"==s.attr)a.seq[0].oid=i(s.attr),a.seq[1].set[0]={prnstr:s.str};else if("countryOfCitizenship"==s.attr)a.seq[0].oid=i(s.attr),a.seq[1].set[0]={prnstr:s.str};else{if("countryOfResidence"!=s.attr)throw new Error("unsupported attribute: "+s.attr);a.seq[0].oid=i(s.attr),a.seq[1].set[0]={prnstr:s.str}}t.push(new n(a))}else{var o={seq:[{oid:s.attr},{set:s.array}]};t.push(n(o))}}var u=new r({array:t});return this.asn1ExtnValue=u,this.asn1ExtnValue.tohex()},this.oid="2.5.29.9",void 0!==t&&(this.params=t)},je(Zt.asn1.x509.SubjectDirectoryAttributes,Zt.asn1.x509.Extension),Zt.asn1.x509.PrivateExtension=function(t){Zt.asn1.x509.PrivateExtension.superclass.constructor.call(this,t);var e=Zt,r=e.lang.String.isHex,n=e.asn1,i=n.x509.OID.name2oid,s=n.ASN1Util.newObject;this.params=null,this.setByParam=function(t){this.oid=i(t.extname),this.params=t},this.getExtnValueHex=function(){if(null==this.params.extname||null==this.params.extn)throw new Error("extname or extnhex not specified");var t=this.params.extn;if("string"==typeof t&&r(t))return t;if("object"==typeof t)try{return s(t).tohex()}catch(t){}throw new Error("unsupported extn value")},null!=t&&this.setByParam(t)},je(Zt.asn1.x509.PrivateExtension,Zt.asn1.x509.Extension),Zt.asn1.x509.CRL=function(t){Zt.asn1.x509.CRL.superclass.constructor.call(this);var e=Zt.asn1,r=e.DERSequence,n=e.DERBitString,i=e.x509,s=i.AlgorithmIdentifier,a=i.TBSCertList;this.params=void 0,this.setByParam=function(t){this.params=t},this.sign=function(){var t=new a(this.params).tohex(),e=new Zt.crypto.Signature({alg:this.params.sigalg});e.init(this.params.cakey),e.updateHex(t);var r=e.sign();this.params.sighex=r},this.getPEM=function(){return pe(this.tohex(),"X509 CRL")},this.tohex=function(){var t=this.params;if(null==t.tbsobj&&(t.tbsobj=new a(t)),null==t.sighex&&null!=t.cakey&&this.sign(),null==t.sighex)throw new Error("sighex or cakey parameter not defined");var e=[];return e.push(t.tbsobj),e.push(new s({name:t.sigalg})),e.push(new n({hex:"00"+t.sighex})),new r({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&(this.params=t)},je(Zt.asn1.x509.CRL,Zt.asn1.ASN1Object),Zt.asn1.x509.TBSCertList=function(t){Zt.asn1.x509.TBSCertList.superclass.constructor.call(this);var e=Zt.asn1,r=e.DERInteger,n=e.DERSequence,i=e.DERTaggedObject,s=e.x509,a=s.AlgorithmIdentifier,o=s.Time,u=s.Extensions,c=s.X500Name;this.params=null,this.setByParam=function(t){this.params=t},this.getRevCertSequence=function(){for(var t=[],e=this.params.revcert,i=0;i<e.length;i++){var s=[new r(e[i].sn),new o(e[i].date)];null!=e[i].ext&&s.push(new u(e[i].ext)),t.push(new n({array:s}))}return new n({array:t})},this.tohex=function(){var t=[],e=this.params;if(null!=e.version){var s=e.version-1,h=new r({int:s});t.push(h)}if(t.push(new a({name:e.sigalg})),t.push(new c(e.issuer)),t.push(new o(e.thisupdate)),null!=e.nextupdate&&t.push(new o(e.nextupdate)),null!=e.revcert&&t.push(this.getRevCertSequence()),null!=e.ext){var l=new u(e.ext);t.push(new i({tag:"a0",explicit:!0,obj:l}))}return new n({array:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&this.setByParam(t)},je(Zt.asn1.x509.TBSCertList,Zt.asn1.ASN1Object),Zt.asn1.x509.CRLEntry=function(t){Zt.asn1.x509.CRLEntry.superclass.constructor.call(this);var e=Zt.asn1;this.setCertSerial=function(t){this.sn=new e.DERInteger(t)},this.setRevocationDate=function(t){this.time=new e.x509.Time(t)},this.tohex=function(){var t=new e.DERSequence({array:[this.sn,this.time]});return this.TLV=t.tohex(),this.TLV},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&(void 0!==t.time&&this.setRevocationDate(t.time),void 0!==t.sn&&this.setCertSerial(t.sn))},je(Zt.asn1.x509.CRLEntry,Zt.asn1.ASN1Object),Zt.asn1.x509.CRLNumber=function(t){Zt.asn1.x509.CRLNumber.superclass.constructor.call(this,t),this.params=void 0,this.getExtnValueHex=function(){return this.asn1ExtnValue=new Zt.asn1.DERInteger(this.params.num),this.asn1ExtnValue.tohex()},this.oid="2.5.29.20",null!=t&&(this.params=t)},je(Zt.asn1.x509.CRLNumber,Zt.asn1.x509.Extension),Zt.asn1.x509.CRLReason=function(t){Zt.asn1.x509.CRLReason.superclass.constructor.call(this,t),this.params=void 0,this.getExtnValueHex=function(){return this.asn1ExtnValue=new Zt.asn1.DEREnumerated(this.params.code),this.asn1ExtnValue.tohex()},this.oid="2.5.29.21",null!=t&&(this.params=t)},je(Zt.asn1.x509.CRLReason,Zt.asn1.x509.Extension),Zt.asn1.x509.OCSPNonce=function(t){Zt.asn1.x509.OCSPNonce.superclass.constructor.call(this,t),this.params=void 0,this.getExtnValueHex=function(){return this.asn1ExtnValue=new Zt.asn1.DEROctetString(this.params),this.asn1ExtnValue.tohex()},this.oid="1.3.6.1.5.5.7.48.1.2",null!=t&&(this.params=t)},je(Zt.asn1.x509.OCSPNonce,Zt.asn1.x509.Extension),Zt.asn1.x509.OCSPNoCheck=function(t){Zt.asn1.x509.OCSPNoCheck.superclass.constructor.call(this,t),this.params=void 0,this.getExtnValueHex=function(){return this.asn1ExtnValue=new Zt.asn1.DERNull,this.asn1ExtnValue.tohex()},this.oid="1.3.6.1.5.5.7.48.1.5",null!=t&&(this.params=t)},je(Zt.asn1.x509.OCSPNoCheck,Zt.asn1.x509.Extension),Zt.asn1.x509.AdobeTimeStamp=function(t){Zt.asn1.x509.AdobeTimeStamp.superclass.constructor.call(this,t);var e=Zt.asn1,r=e.DERInteger,n=e.DERBoolean,i=e.DERSequence,s=e.x509.GeneralName;this.params=null,this.getExtnValueHex=function(){var t=this.params,e=[new r(1)];return e.push(new s({uri:t.uri})),null!=t.reqauth&&e.push(new n(t.reqauth)),this.asn1ExtnValue=new i({array:e}),this.asn1ExtnValue.tohex()},this.oid="1.2.840.113583.1.1.9.1",void 0!==t&&this.setByParam(t)},je(Zt.asn1.x509.AdobeTimeStamp,Zt.asn1.x509.Extension),Zt.asn1.x509.X500Name=function(t){Zt.asn1.x509.X500Name.superclass.constructor.call(this),this.asn1Array=[],this.paramArray=[],this.sRule="utf8";var e=Zt.asn1,r=e.x509,n=r.RDN;this.setByString=function(t,e){void 0!==e&&(this.sRule=e);var r=t.split("/");r.shift();for(var i=[],s=0;s<r.length;s++)if(r[s].match(/^[^=]+=.+$/))i.push(r[s]);else{var a=i.length-1;i[a]=i[a]+"/"+r[s]}for(s=0;s<i.length;s++)this.asn1Array.push(new n({str:i[s],rule:this.sRule}))},this.setByLdapString=function(t,e){void 0!==e&&(this.sRule=e);var n=r.X500Name.ldapToCompat(t);this.setByString(n,e)},this.setByObject=function(t,e){for(var r in void 0!==e&&(this.sRule=e),t)if(t.hasOwnProperty(r)){var i=new n({str:r+"="+t[r],rule:this.sRule});this.asn1Array?this.asn1Array.push(i):this.asn1Array=[i]}},this.setByParam=function(t){var e;(void 0!==t.rule&&(this.sRule=t.rule),void 0!==t.array)?this.paramArray=t.array:void 0!==t.str?this.setByString(t.str):void 0!==t.ldapstr?this.setByLdapString(t.ldapstr):void 0!==t.hex?this.hTLV=t.hex:void 0!==t.certissuer?((e=new qe).readCertPEM(t.certissuer),this.hTLV=e.getIssuerHex()):void 0!==t.certsubject?((e=new qe).readCertPEM(t.certsubject),this.hTLV=e.getSubjectHex()):"object"==typeof t&&void 0===t.certsubject&&void 0===t.certissuer&&this.setByObject(t)},this.tohex=function(){if("string"==typeof this.hTLV)return this.hTLV;if(0==this.asn1Array.length&&this.paramArray.length>0)for(var t=0;t<this.paramArray.length;t++){var r={array:this.paramArray[t]};"utf8"!=this.sRule&&(r.rule=this.sRule);var i=new n(r);this.asn1Array.push(i)}var s=new e.DERSequence({array:this.asn1Array});return this.hTLV=s.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&this.setByParam(t)},je(Zt.asn1.x509.X500Name,Zt.asn1.ASN1Object),Zt.asn1.x509.X500Name.compatToLDAP=function(t){if("/"!==t.substr(0,1))throw"malformed input";var e=(t=t.substr(1)).split("/");return e.reverse(),e=e.map(function(t){return t.replace(/,/,"\\,")}),e.join(",")},Zt.asn1.x509.X500Name.onelineToLDAP=function(t){return Zt.asn1.x509.X500Name.compatToLDAP(t)},Zt.asn1.x509.X500Name.ldapToCompat=function(t){for(var e=t.split(","),r=!1,n=[],i=0;e.length>0;i++){var s=e.shift();if(!0===r){var a=(n.pop()+","+s).replace(/\\,/g,",");n.push(a),r=!1}else n.push(s);"\\"===s.substr(-1,1)&&(r=!0)}return n=n.map(function(t){return t.replace("/","\\/")}),n.reverse(),"/"+n.join("/")},Zt.asn1.x509.X500Name.ldapToOneline=function(t){return Zt.asn1.x509.X500Name.ldapToCompat(t)},Zt.asn1.x509.RDN=function(t){Zt.asn1.x509.RDN.superclass.constructor.call(this),this.asn1Array=[],this.paramArray=[],this.sRule="utf8";var e=Zt.asn1.x509.AttributeTypeAndValue;this.setByParam=function(t){void 0!==t.rule&&(this.sRule=t.rule),void 0!==t.str&&this.addByMultiValuedString(t.str),void 0!==t.array&&(this.paramArray=t.array)},this.addByString=function(t){this.asn1Array.push(new Zt.asn1.x509.AttributeTypeAndValue({str:t,rule:this.sRule}))},this.addByMultiValuedString=function(t){for(var e=Zt.asn1.x509.RDN.parseString(t),r=0;r<e.length;r++)this.addByString(e[r])},this.tohex=function(){if(0==this.asn1Array.length&&this.paramArray.length>0)for(var t=0;t<this.paramArray.length;t++){var r=this.paramArray[t];void 0!==r.rule&&"utf8"!=this.sRule&&(r.rule=this.sRule);var n=new e(r);this.asn1Array.push(n)}var i=new Zt.asn1.DERSet({array:this.asn1Array});return this.TLV=i.tohex(),this.TLV},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&this.setByParam(t)},je(Zt.asn1.x509.RDN,Zt.asn1.ASN1Object),Zt.asn1.x509.RDN.parseString=function(t){for(var e=t.split(/\+/),r=!1,n=[],i=0;e.length>0;i++){var s=e.shift();if(!0===r){var a=(n.pop()+"+"+s).replace(/\\\+/g,"+");n.push(a),r=!1}else n.push(s);"\\"===s.substr(-1,1)&&(r=!0)}var o=!1,u=[];for(i=0;n.length>0;i++){s=n.shift();if(!0===o){var c=u.pop();if(s.match(/"$/)){a=(c+"+"+s).replace(/^([^=]+)="(.*)"$/,"$1=$2");u.push(a),o=!1}else u.push(c+"+"+s)}else u.push(s);s.match(/^[^=]+="/)&&(o=!0)}return u},Zt.asn1.x509.AttributeTypeAndValue=function(t){Zt.asn1.x509.AttributeTypeAndValue.superclass.constructor.call(this),this.sRule="utf8",this.sType=null,this.sValue=null,this.dsType=null;var e=Zt,r=e.asn1,n=r.DERSequence,i=r.DERUTF8String,s=r.DERPrintableString,a=r.DERTeletexString,o=r.DERIA5String,u=r.DERVisibleString,c=r.DERBMPString,h=e.lang.String.isMail,l=e.lang.String.isPrintable;this.setByParam=function(t){if(void 0!==t.rule&&(this.sRule=t.rule),void 0!==t.ds&&(this.dsType=t.ds),void 0===t.value&&void 0!==t.str){var e=t.str.match(/^([^=]+)=(.+)$/);if(!e)throw new Error("malformed attrTypeAndValueStr: "+attrTypeAndValueStr);this.sType=e[1],this.sValue=e[2]}else this.sType=t.type,this.sValue=t.value},this.setByString=function(t,e){void 0!==e&&(this.sRule=e);var r=t.match(/^([^=]+)=(.+)$/);if(!r)throw new Error("malformed attrTypeAndValueStr: "+attrTypeAndValueStr);this.setByAttrTypeAndValueStr(r[1],r[2])},this._getDsType=function(){var t=this.sType,e=this.sValue,r=this.sRule;return"prn"===r?"CN"==t&&h(e)?"ia5":l(e)?"prn":"utf8":"utf8"===r?"CN"==t&&h(e)?"ia5":"C"==t?"prn":"utf8":"utf8"},this.setByAttrTypeAndValueStr=function(t,e,r){void 0!==r&&(this.sRule=r),this.sType=t,this.sValue=e},this.getValueObj=function(t,e){if("utf8"==t)return new i({str:e});if("prn"==t)return new s({str:e});if("tel"==t)return new a({str:e});if("ia5"==t)return new o({str:e});if("vis"==t)return new u({str:e});if("bmp"==t)return new c({str:e});throw new Error("unsupported directory string type: type="+t+" value="+e)},this.tohex=function(){null==this.dsType&&(this.dsType=this._getDsType());var t=Zt.asn1.x509.OID.atype2obj(this.sType),e=this.getValueObj(this.dsType,this.sValue),r=new n({array:[t,e]});return this.TLV=r.tohex(),this.TLV},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&this.setByParam(t)},je(Zt.asn1.x509.AttributeTypeAndValue,Zt.asn1.ASN1Object),Zt.asn1.x509.SubjectPublicKeyInfo=function(t){Zt.asn1.x509.SubjectPublicKeyInfo.superclass.constructor.call(this);var e=Zt.asn1,r=e.DERInteger,n=e.DERBitString,i=e.DERObjectIdentifier,s=e.DERSequence,a=e.ASN1Util.newObject,o=e.x509.AlgorithmIdentifier;this.getASN1Object=function(){if(null==this.asn1AlgId||null==this.asn1SubjPKey)throw"algId and/or subjPubKey not set";return new s({array:[this.asn1AlgId,this.asn1SubjPKey]})},this.tohex=function(){var t=this.getASN1Object();return this.hTLV=t.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},this.setPubKey=function(t){try{if(t instanceof Gt){var e=a({seq:[{int:{bigint:t.n}},{int:{int:t.e}}]}).tohex();this.asn1AlgId=new o({name:"rsaEncryption"}),this.asn1SubjPKey=new n({hex:"00"+e})}}catch(t){}try{if(t instanceof Zt.crypto.ECDSA){var s=new i({name:t.curveName});this.asn1AlgId=new o({name:"ecPublicKey",asn1params:s}),this.asn1SubjPKey=new n({hex:"00"+t.pubKeyHex})}}catch(t){}try{if(t instanceof Zt.crypto.DSA){s=new a({seq:[{int:{bigint:t.p}},{int:{bigint:t.q}},{int:{bigint:t.g}}]});this.asn1AlgId=new o({name:"dsa",asn1params:s});var u=new r({bigint:t.y});this.asn1SubjPKey=new n({hex:"00"+u.tohex()})}}catch(t){}},void 0!==t&&this.setPubKey(t)},je(Zt.asn1.x509.SubjectPublicKeyInfo,Zt.asn1.ASN1Object),Zt.asn1.x509.Time=function(t){Zt.asn1.x509.Time.superclass.constructor.call(this);var e=Zt.asn1,r=e.DERUTCTime,n=e.DERGeneralizedTime;this.params=null,this.type=null,this.setTimeParams=function(t){this.timeParams=t},this.setByParam=function(t){this.params=t},this.getType=function(t){return t.match(/^[0-9]{12}Z$/)?"utc":t.match(/^[0-9]{14}Z$/)?"gen":t.match(/^[0-9]{12}\.[0-9]+Z$/)?"utc":t.match(/^[0-9]{14}\.[0-9]+Z$/)?"gen":null},this.tohex=function(){var t=this.params,e=null;if("string"==typeof t&&(t={str:t}),null==t||!t.str||null!=t.type&&null!=t.type||(t.type=this.getType(t.str)),null!=t&&t.str?("utc"==t.type&&(e=new r(t.str)),"gen"==t.type&&(e=new n(t.str))):e="gen"==this.type?new n:new r,null==e)throw new Error("wrong setting for Time");return this.TLV=e.tohex(),this.TLV},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},Zt.asn1.x509.Time_bak=function(t){Zt.asn1.x509.Time_bak.superclass.constructor.call(this);var e=Zt.asn1,r=e.DERUTCTime,n=e.DERGeneralizedTime;this.setTimeParams=function(t){this.timeParams=t},this.tohex=function(){var t=null;return t=null!=this.timeParams?"utc"==this.type?new r(this.timeParams):new n(this.timeParams):"utc"==this.type?new r:new n,this.TLV=t.tohex(),this.TLV},this.getEncodedHex=function(){return this.tohex()},this.type="utc",void 0!==t&&(void 0!==t.type?this.type=t.type:void 0!==t.str&&(t.str.match(/^[0-9]{12}Z$/)&&(this.type="utc"),t.str.match(/^[0-9]{14}Z$/)&&(this.type="gen")),this.timeParams=t)},je(Zt.asn1.x509.Time,Zt.asn1.ASN1Object),Zt.asn1.x509.AlgorithmIdentifier=function(t){Zt.asn1.x509.AlgorithmIdentifier.superclass.constructor.call(this),this.nameAlg=null,this.asn1Alg=null,this.asn1Params=null,this.paramEmpty=!1;var e=Zt.asn1,r=e.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV;if(this.tohex=function(){if(null===this.nameAlg&&null===this.asn1Alg)throw new Error("algorithm not specified");if(null!==this.nameAlg){var t=null;for(var n in r)n===this.nameAlg&&(t=r[n]);if(null!==t)return this.hTLV=t,this.hTLV}null!==this.nameAlg&&null===this.asn1Alg&&(this.asn1Alg=e.x509.OID.name2obj(this.nameAlg));var i=[this.asn1Alg];null!==this.asn1Params&&i.push(this.asn1Params);var s=new e.DERSequence({array:i});return this.hTLV=s.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&(void 0!==t.name&&(this.nameAlg=t.name),void 0!==t.asn1params&&(this.asn1Params=t.asn1params),void 0!==t.paramempty&&(this.paramEmpty=t.paramempty)),null===this.asn1Params&&!1===this.paramEmpty&&null!==this.nameAlg){void 0!==this.nameAlg.name&&(this.nameAlg=this.nameAlg.name);var n=this.nameAlg.toLowerCase();"withdsa"!==n.substr(-7,7)&&"withecdsa"!==n.substr(-9,9)&&(this.asn1Params=new e.DERNull)}},je(Zt.asn1.x509.AlgorithmIdentifier,Zt.asn1.ASN1Object),Zt.asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV={SHAwithRSAandMGF1:"300d06092a864886f70d01010a3000",SHA256withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040201a11a301806092a864886f70d010108300b0609608648016503040201a203020120",SHA384withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040202a11a301806092a864886f70d010108300b0609608648016503040202a203020130",SHA512withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040203a11a301806092a864886f70d010108300b0609608648016503040203a203020140"},Zt.asn1.x509.GeneralName=function(t){Zt.asn1.x509.GeneralName.superclass.constructor.call(this);var e=Zt.asn1,r=e.x509,n=r.X500Name,i=r.OtherName,s=e.DERIA5String,a=e.DEROctetString,o=e.DERTaggedObject,u=e.ASN1Object,c=Error;this.params=null,this.setByParam=function(t){this.params=t},this.tohex=function(){var t,e,r=this.params,h=!1;if(void 0!==r.other)t="a0",e=new i(r.other);else if(void 0!==r.rfc822)t="81",e=new s({str:r.rfc822});else if(void 0!==r.dns)t="82",e=new s({str:r.dns});else if(void 0!==r.dn)t="a4",h=!0,e="string"==typeof r.dn?new n({str:r.dn}):r.dn instanceof Zt.asn1.x509.X500Name?r.dn:new n(r.dn);else if(void 0!==r.ldapdn)t="a4",h=!0,e=new n({ldapstr:r.ldapdn});else if(void 0!==r.certissuer||void 0!==r.certsubj){var l,f;t="a4",h=!0;var p=null;if(void 0!==r.certsubj?(l=!1,f=r.certsubj):(l=!0,f=r.certissuer),f.match(/^[0-9A-Fa-f]+$/),-1!=f.indexOf("-----BEGIN ")&&(p=ge(f)),null==p)throw new Error("certsubj/certissuer not cert");var g,d=new qe;d.hex=p,g=l?d.getIssuerHex():d.getSubjectHex(),(e=new u).hTLV=g}else if(void 0!==r.uri)t="86",e=new s({str:r.uri});else{if(void 0===r.ip)throw new c("improper params");var v;t="87";var m=r.ip;try{if(m.match(/^[0-9a-f]+$/)){var y=m.length;if(8!=y&&16!=y&&32!=y&&64!=y)throw"err";v=m}else v=Ee(m)}catch(t){throw new c("malformed IP address: "+r.ip+":"+t.message)}e=new a({hex:v})}return new o({tag:t,explicit:h,obj:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&this.setByParam(t)},je(Zt.asn1.x509.GeneralName,Zt.asn1.ASN1Object),Zt.asn1.x509.GeneralNames=function(t){Zt.asn1.x509.GeneralNames.superclass.constructor.call(this);var e=Zt.asn1;this.setByParamArray=function(t){for(var r=0;r<t.length;r++){var n=new e.x509.GeneralName(t[r]);this.asn1Array.push(n)}},this.tohex=function(){return new e.DERSequence({array:this.asn1Array}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.asn1Array=new Array,void 0!==t&&this.setByParamArray(t)},je(Zt.asn1.x509.GeneralNames,Zt.asn1.ASN1Object),Zt.asn1.x509.OtherName=function(t){Zt.asn1.x509.OtherName.superclass.constructor.call(this);var e=Zt.asn1,r=e.DERObjectIdentifier,n=e.DERSequence,i=e.ASN1Util.newObject;this.params=null,this.setByParam=function(t){this.params=t},this.tohex=function(){var t=this.params;if(null==t.oid||null==t.value)throw new Error("oid or value not specified");var e=new r({oid:t.oid}),s=i({tag:{tag:"a0",explicit:!0,obj:t.value}});return new n({array:[e,s]}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&this.setByParam(t)},je(Zt.asn1.x509.OtherName,Zt.asn1.ASN1Object),Zt.asn1.x509.OID=new function(){var t=Zt.asn1.DERObjectIdentifier;this.name2oidList={"aes128-CBC":"2.16.840.1.101.3.4.1.2","aes256-CBC":"2.16.840.1.101.3.4.1.42",sha1:"1.3.14.3.2.26",sha256:"2.16.840.1.101.3.4.2.1",sha384:"2.16.840.1.101.3.4.2.2",sha512:"2.16.840.1.101.3.4.2.3",sha224:"2.16.840.1.101.3.4.2.4",md5:"1.2.840.113549.2.5",md2:"1.3.14.7.2.2.1",ripemd160:"1.3.36.3.2.1",hmacWithSHA1:"1.2.840.113549.2.7",hmacWithSHA224:"1.2.840.113549.2.8",hmacWithSHA256:"1.2.840.113549.2.9",hmacWithSHA384:"1.2.840.113549.2.10",hmacWithSHA512:"1.2.840.113549.2.11",MD2withRSA:"1.2.840.113549.1.1.2",MD4withRSA:"1.2.840.113549.1.1.3",MD5withRSA:"1.2.840.113549.1.1.4",SHA1withRSA:"1.2.840.113549.1.1.5","pkcs1-MGF":"1.2.840.113549.1.1.8",rsaPSS:"1.2.840.113549.1.1.10",SHA224withRSA:"1.2.840.113549.1.1.14",SHA256withRSA:"1.2.840.113549.1.1.11",SHA384withRSA:"1.2.840.113549.1.1.12",SHA512withRSA:"1.2.840.113549.1.1.13",SHA1withECDSA:"1.2.840.10045.4.1",SHA224withECDSA:"1.2.840.10045.4.3.1",SHA256withECDSA:"1.2.840.10045.4.3.2",SHA384withECDSA:"1.2.840.10045.4.3.3",SHA512withECDSA:"1.2.840.10045.4.3.4",dsa:"1.2.840.10040.4.1",SHA1withDSA:"1.2.840.10040.4.3",SHA224withDSA:"2.16.840.1.101.3.4.3.1",SHA256withDSA:"2.16.840.1.101.3.4.3.2",rsaEncryption:"1.2.840.113549.1.1.1",commonName:"2.5.4.3",countryName:"2.5.4.6",localityName:"2.5.4.7",stateOrProvinceName:"2.5.4.8",streetAddress:"2.5.4.9",organizationName:"2.5.4.10",organizationalUnitName:"2.5.4.11",domainComponent:"0.9.2342.19200300.100.1.25",userId:"0.9.2342.19200300.100.1.1",surname:"2.5.4.4",givenName:"2.5.4.42",title:"2.5.4.12",distinguishedName:"2.5.4.49",emailAddress:"1.2.840.113549.1.9.1",description:"2.5.4.13",businessCategory:"2.5.4.15",postalCode:"2.5.4.17",uniqueIdentifier:"2.5.4.45",organizationIdentifier:"2.5.4.97",jurisdictionOfIncorporationL:"1.3.6.1.4.1.311.60.2.1.1",jurisdictionOfIncorporationSP:"1.3.6.1.4.1.311.60.2.1.2",jurisdictionOfIncorporationC:"1.3.6.1.4.1.311.60.2.1.3",subjectDirectoryAttributes:"2.5.29.9",subjectKeyIdentifier:"2.5.29.14",keyUsage:"2.5.29.15",subjectAltName:"2.5.29.17",issuerAltName:"2.5.29.18",basicConstraints:"2.5.29.19",cRLNumber:"2.5.29.20",cRLReason:"2.5.29.21",nameConstraints:"2.5.29.30",cRLDistributionPoints:"2.5.29.31",certificatePolicies:"2.5.29.32",anyPolicy:"2.5.29.32.0",policyMappings:"2.5.29.33",authorityKeyIdentifier:"2.5.29.35",policyConstraints:"2.5.29.36",extKeyUsage:"2.5.29.37",inhibitAnyPolicy:"2.5.29.54",authorityInfoAccess:"1.3.6.1.5.5.7.1.1",ocsp:"1.3.6.1.5.5.7.48.1",ocspBasic:"1.3.6.1.5.5.7.48.1.1",ocspNonce:"1.3.6.1.5.5.7.48.1.2",ocspNoCheck:"1.3.6.1.5.5.7.48.1.5",caIssuers:"1.3.6.1.5.5.7.48.2",anyExtendedKeyUsage:"2.5.29.37.0",serverAuth:"1.3.6.1.5.5.7.3.1",clientAuth:"1.3.6.1.5.5.7.3.2",codeSigning:"1.3.6.1.5.5.7.3.3",emailProtection:"1.3.6.1.5.5.7.3.4",timeStamping:"1.3.6.1.5.5.7.3.8",ocspSigning:"1.3.6.1.5.5.7.3.9",smtpUTF8Mailbox:"1.3.6.1.5.5.7.8.9",dateOfBirth:"1.3.6.1.5.5.7.9.1",placeOfBirth:"1.3.6.1.5.5.7.9.2",gender:"1.3.6.1.5.5.7.9.3",countryOfCitizenship:"1.3.6.1.5.5.7.9.4",countryOfResidence:"1.3.6.1.5.5.7.9.5",ecPublicKey:"1.2.840.10045.2.1","P-256":"1.2.840.10045.3.1.7",secp256r1:"1.2.840.10045.3.1.7",secp256k1:"1.3.132.0.10",secp384r1:"1.3.132.0.34",secp521r1:"1.3.132.0.35",pkcs5PBES2:"1.2.840.113549.1.5.13",pkcs5PBKDF2:"1.2.840.113549.1.5.12","des-EDE3-CBC":"1.2.840.113549.3.7",data:"1.2.840.113549.1.7.1","signed-data":"1.2.840.113549.1.7.2","enveloped-data":"1.2.840.113549.1.7.3","digested-data":"1.2.840.113549.1.7.5","encrypted-data":"1.2.840.113549.1.7.6","authenticated-data":"1.2.840.113549.1.9.16.1.2",tstinfo:"1.2.840.113549.1.9.16.1.4",signingCertificate:"1.2.840.113549.1.9.16.2.12",timeStampToken:"1.2.840.113549.1.9.16.2.14",signaturePolicyIdentifier:"1.2.840.113549.1.9.16.2.15",etsArchiveTimeStamp:"1.2.840.113549.1.9.16.2.27",signingCertificateV2:"1.2.840.113549.1.9.16.2.47",etsArchiveTimeStampV2:"1.2.840.113549.1.9.16.2.48",extensionRequest:"1.2.840.113549.1.9.14",contentType:"1.2.840.113549.1.9.3",messageDigest:"1.2.840.113549.1.9.4",signingTime:"1.2.840.113549.1.9.5",counterSignature:"1.2.840.113549.1.9.6",archiveTimeStampV3:"0.4.0.1733.2.4",pdfRevocationInfoArchival:"1.2.840.113583.1.1.8",adobeTimeStamp:"1.2.840.113583.1.1.9.1",smimeMailboxLegacy:"2.23.140.1.5.1.1",smimeMailboxMulti:"2.23.140.1.5.1.2",smimeMailboxStrict:"2.23.140.1.5.1.3",smimeOrganizationLegacy:"2.23.140.1.5.2.1",smimeOrganizationMulti:"2.23.140.1.5.2.2",smimeOrganizationStrict:"2.23.140.1.5.2.3",smimeSponsorLegacy:"2.23.140.1.5.3.1",smimeSponsorMulti:"2.23.140.1.5.3.2",smimeSponsorStrict:"2.23.140.1.5.3.3",smimeIndividualLegacy:"2.23.140.1.5.4.1",smimeIndividualMulti:"2.23.140.1.5.4.2",smimeIndividualStrict:"2.23.140.1.5.4.3"},this.atype2oidList={CN:"2.5.4.3",L:"2.5.4.7",ST:"2.5.4.8",O:"2.5.4.10",OU:"2.5.4.11",C:"2.5.4.6",STREET:"2.5.4.9",DC:"0.9.2342.19200300.100.1.25",UID:"0.9.2342.19200300.100.1.1",SN:"2.5.4.4",T:"2.5.4.12",GN:"2.5.4.42",DN:"2.5.4.49",E:"1.2.840.113549.1.9.1",description:"2.5.4.13",businessCategory:"2.5.4.15",postalCode:"2.5.4.17",serialNumber:"2.5.4.5",uniqueIdentifier:"2.5.4.45",organizationIdentifier:"2.5.4.97",jurisdictionOfIncorporationL:"1.3.6.1.4.1.311.60.2.1.1",jurisdictionOfIncorporationSP:"1.3.6.1.4.1.311.60.2.1.2",jurisdictionOfIncorporationC:"1.3.6.1.4.1.311.60.2.1.3"},this.objCache={},this.name2obj=function(e){if(void 0!==this.objCache[e])return this.objCache[e];if(void 0===this.name2oidList[e])throw"Name of ObjectIdentifier not defined: "+e;var r=this.name2oidList[e],n=new t({oid:r});return this.objCache[e]=n,n},this.atype2obj=function(e){if(void 0!==this.objCache[e])return this.objCache[e];var r;if(e.match(/^\d+\.\d+\.[0-9.]+$/))r=e;else if(void 0!==this.atype2oidList[e])r=this.atype2oidList[e];else{if(void 0===this.name2oidList[e])throw new Error("AttributeType name undefined: "+e);r=this.name2oidList[e]}var n=new t({oid:r});return this.objCache[e]=n,n},this.registerOIDs=function(t){if(this.checkOIDs(t))for(var e in t)this.name2oidList[e]=t[e]},this.checkOIDs=function(t){try{var e=Object.keys(t);return 0!=e.length&&(e.map(function(t,e,r){if(!this[t].match(/^[0-2]\.[0-9.]+$/))throw new Error("value is not OID")},t),!0)}catch(t){return!1}}},Zt.asn1.x509.OID.oid2name=function(t){var e=Zt.asn1.x509.OID.name2oidList;for(var r in e)if(e[r]==t)return r;return""},Zt.asn1.x509.OID.oid2atype=function(t){var e=Zt.asn1.x509.OID.atype2oidList;for(var r in e)if(e[r]==t)return r;return t},Zt.asn1.x509.OID.name2oid=function(t){if(t.match(/^[0-9.]+$/))return t;var e=Zt.asn1.x509.OID.name2oidList;return void 0===e[t]?"":e[t]},Zt.asn1.x509.X509Util={},Zt.asn1.x509.X509Util.newCertPEM=function(t){return new(0,Zt.asn1.x509.Certificate)(t).getPEM()},void 0!==Zt&&Zt||(Zt={}),void 0!==Zt.asn1&&Zt.asn1||(Zt.asn1={}),void 0!==Zt.asn1.cms&&Zt.asn1.cms||(Zt.asn1.cms={}),Zt.asn1.cms.Attribute=function(t){var e=Error,r=Zt.asn1,n=r.DERSequence,i=r.DERSet,s=r.DERObjectIdentifier;this.params=null,this.typeOid=null,this.setByParam=function(t){this.params=t},this.getValueArray=function(){throw new e("not yet implemented abstract")},this.tohex=function(){var t=new s({oid:this.typeOid}),e=new i({array:this.getValueArray()});return new n({array:[t,e]}).tohex()},this.getEncodedHex=function(){return this.tohex()}},je(Zt.asn1.cms.Attribute,Zt.asn1.ASN1Object),Zt.asn1.cms.ContentType=function(t){var e=Zt.asn1;e.cms.ContentType.superclass.constructor.call(this),this.typeOid="1.2.840.113549.1.9.3",this.getValueArray=function(){return[new e.DERObjectIdentifier(this.params.type)]},null!=t&&this.setByParam(t)},je(Zt.asn1.cms.ContentType,Zt.asn1.cms.Attribute),Zt.asn1.cms.MessageDigest=function(t){var e=Zt.asn1,r=e.DEROctetString;e.cms.MessageDigest.superclass.constructor.call(this),this.typeOid="1.2.840.113549.1.9.4",this.getValueArray=function(){return[new r(this.params)]},null!=t&&this.setByParam(t)},je(Zt.asn1.cms.MessageDigest,Zt.asn1.cms.Attribute),Zt.asn1.cms.SigningTime=function(t){var e=Zt.asn1;e.cms.SigningTime.superclass.constructor.call(this),this.typeOid="1.2.840.113549.1.9.5",this.getValueArray=function(){return[new e.x509.Time(this.params)]},null!=t&&this.setByParam(t)},je(Zt.asn1.cms.SigningTime,Zt.asn1.cms.Attribute),Zt.asn1.cms.SigningCertificate=function(t){var e=Error,r=Zt.asn1,n=r.DERSequence,i=r.cms,s=i.ESSCertID;i.SigningCertificate.superclass.constructor.call(this),this.typeOid="1.2.840.113549.1.9.16.2.12",this.getValueArray=function(){if(null==this.params||null==this.params||null==this.params.array)throw new e("parameter 'array' not specified");for(var r=this.params.array,i=[],a=0;a<r.length;a++){var o=r[a];0!=t.hasis||"string"!=typeof o||-1==o.indexOf("-----BEGIN")&&!ee.isASN1HEX(o)||(o={cert:o}),0!=o.hasis&&0==t.hasis&&(o.hasis=!1),i.push(new s(o))}var u=new n({array:i});return[new n({array:[u]})]},null!=t&&this.setByParam(t)},je(Zt.asn1.cms.SigningCertificate,Zt.asn1.cms.Attribute),Zt.asn1.cms.ESSCertID=function(t){Zt.asn1.cms.ESSCertID.superclass.constructor.call(this);var e=Error,r=Zt,n=r.asn1,i=n.DEROctetString,s=n.DERSequence,a=n.cms.IssuerSerial;this.params=null,this.getCertHash=function(t,n){if(null!=t.hash)return t.hash;if("string"==typeof t&&-1==t.indexOf("-----BEGIN")&&!ee.isASN1HEX(t))return t;var i,s,a;if("string"==typeof t)i=t;else{if(null==t.cert)throw new e("hash nor cert unspecified");i=t.cert}if(s=-1!=i.indexOf("-----BEGIN")?ge(i):i,"string"==typeof t&&(-1!=t.indexOf("-----BEGIN")?s=ge(t):ee.isASN1HEX(t)&&(s=t)),null!=t.alg)a=t.alg;else{if(null==n)throw new e("hash alg unspecified");a=n}return r.crypto.Util.hashHex(s,a)},this.tohex=function(){var t=this.params,e=this.getCertHash(t,"sha1"),r=[];return r.push(new i({hex:e})),("string"==typeof t&&-1!=t.indexOf("-----BEGIN")||null!=t.cert&&0!=t.hasis||null!=t.issuer&&null!=t.serial)&&r.push(new a(t)),new s({array:r}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},je(Zt.asn1.cms.ESSCertID,Zt.asn1.ASN1Object),Zt.asn1.cms.SigningCertificateV2=function(t){var e=Error,r=Zt.asn1,n=r.DERSequence,i=r.cms,s=i.ESSCertIDv2;i.SigningCertificateV2.superclass.constructor.call(this),this.typeOid="1.2.840.113549.1.9.16.2.47",this.getValueArray=function(){if(null==this.params||null==this.params||null==this.params.array)throw new e("parameter 'array' not specified");for(var r=this.params.array,i=[],a=0;a<r.length;a++){var o=r[a];null==t.alg&&0!=t.hasis||"string"!=typeof o||-1==o.indexOf("-----BEGIN")&&!ee.isASN1HEX(o)||(o={cert:o}),null==o.alg&&null!=t.alg&&(o.alg=t.alg),0!=o.hasis&&0==t.hasis&&(o.hasis=!1),i.push(new s(o))}var u=new n({array:i});return[new n({array:[u]})]},null!=t&&this.setByParam(t)},je(Zt.asn1.cms.SigningCertificateV2,Zt.asn1.cms.Attribute),Zt.asn1.cms.ESSCertIDv2=function(t){Zt.asn1.cms.ESSCertIDv2.superclass.constructor.call(this);var e=Zt.asn1,r=e.DEROctetString,n=e.DERSequence,i=e.cms.IssuerSerial,s=e.x509.AlgorithmIdentifier;this.params=null,this.tohex=function(){var t=this.params,e=this.getCertHash(t,"sha256"),a=[];return null!=t.alg&&"sha256"!=t.alg&&a.push(new s({name:t.alg})),a.push(new r({hex:e})),("string"==typeof t&&-1!=t.indexOf("-----BEGIN")||null!=t.cert&&0!=t.hasis||null!=t.issuer&&null!=t.serial)&&a.push(new i(t)),new n({array:a}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},je(Zt.asn1.cms.ESSCertIDv2,Zt.asn1.cms.ESSCertID),Zt.asn1.cms.IssuerSerial=function(t){var e=Error,r=Zt.asn1,n=r.DERInteger,i=r.DERSequence,s=r.cms,a=r.x509.GeneralNames,o=qe;s.IssuerSerial.superclass.constructor.call(this),this.setByParam=function(t){this.params=t},this.tohex=function(){var t,r,s=this.params;if("string"==typeof s&&-1!=s.indexOf("-----BEGIN")||null!=s.cert){var u;u=null!=s.cert?s.cert:s;var c=new o;c.readCertPEM(u),t=c.getIssuer(),r={hex:c.getSerialNumberHex()}}else{if(null==s.issuer||!s.serial)throw new e("cert or issuer and serial parameter not specified");t=s.issuer,r=s.serial}var h=new a([{dn:t}]),l=new n(r);return new i({array:[h,l]}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},je(Zt.asn1.cms.IssuerSerial,Zt.asn1.ASN1Object),Zt.asn1.cms.SignerIdentifier=function(t){var e=Zt.asn1.cms,r=e.IssuerAndSerialNumber,n=e.SubjectKeyIdentifier;e.SignerIdentifier.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params;if("isssn"==t.type)return new r(t).tohex();if("skid"==t.type)return new n(t).tohex();throw new Error("wrong property for isssn or skid")},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},je(Zt.asn1.cms.SignerIdentifier,Zt.asn1.ASN1Object),Zt.asn1.cms.IssuerAndSerialNumber=function(t){var e=Zt.asn1,r=e.DERInteger,n=e.DERSequence,i=e.cms,s=e.x509.X500Name,a=qe,o=Error;i.IssuerAndSerialNumber.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t,e,i=this.params;if("string"==typeof i&&-1!=i.indexOf("-----BEGIN")||null!=i.cert){var u;u=null!=i.cert?i.cert:i;var c=new a;c.readCertPEM(u),t=c.getIssuer(),e={hex:c.getSerialNumberHex()}}else{if(null==i.issuer||!i.serial)throw new o("cert or issuer and serial parameter not specified");t=i.issuer,e=i.serial}var h=new s(t),l=new r(e);return new n({array:[h,l]}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(t){this.params=t},null!=t&&this.setByParam(t)},je(Zt.asn1.cms.IssuerAndSerialNumber,Zt.asn1.ASN1Object),Zt.asn1.cms.SubjectKeyIdentifier=function(t){var e=Zt.asn1,r=e.ASN1Util.newObject,n=e.cms,i=qe,s=Error;n.SubjectKeyIdentifier.superclass.constructor.call(this),this.tohex=function(){var t,e=this.params;if(null==e.cert&&null==e.skid)throw new s("property cert nor skid undefined");null!=e.cert?t=new i(e.cert).getExtSubjectKeyIdentifier().kid.hex:null!=e.skid&&(t=e.skid);return r({tag:{tage:"a0",obj:{octstr:{hex:t}}}}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},je(Zt.asn1.cms.SubjectKeyIdentifier,Zt.asn1.ASN1Object),Zt.asn1.cms.AttributeList=function(t){var e=Error,r=Zt.asn1,n=r.DERSet,i=r.cms;i.AttributeList.superclass.constructor.call(this),this.params=null,this.hTLV=null,this.setByParam=function(t){this.params=t},this.tohex=function(){var t=this.params;if(null!=this.hTLV)return this.hTLV;var r=!0;null!=t.sortflag&&(r=t.sortflag);for(var s=t.array,a=[],o=0;o<s.length;o++){var u=s[o],c=u.attr;if("contentType"==c)a.push(new i.ContentType(u));else if("messageDigest"==c)a.push(new i.MessageDigest(u));else if("signingTime"==c)a.push(new i.SigningTime(u));else if("signingCertificate"==c)a.push(new i.SigningCertificate(u));else if("signingCertificateV2"==c)a.push(new i.SigningCertificateV2(u));else if("signaturePolicyIdentifier"==c)a.push(new Zt.asn1.cades.SignaturePolicyIdentifier(u));else{if("signatureTimeStamp"!=c&&"timeStampToken"!=c)throw new e("unknown attr: "+c);a.push(new Zt.asn1.cades.SignatureTimeStamp(u))}}var h=new n({array:a,sortflag:r});return this.hTLV=h.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},je(Zt.asn1.cms.AttributeList,Zt.asn1.ASN1Object),Zt.asn1.cms.SignerInfo=function(t){var e=Error,r=Zt,n=r.asn1,i=n.DERInteger,s=n.DEROctetString,a=n.DERSequence,o=n.DERTaggedObject,u=n.cms,c=u.SignerIdentifier,h=u.AttributeList,l=n.x509.AlgorithmIdentifier,f=r.crypto,p=He;u.SignerInfo.superclass.constructor.call(this),this.params=null,this.sign=function(){var t=this.params,e=t.sigalg,r=new h(t.sattrs).tohex(),n=p.getKey(t.signkey),i=new f.Signature({alg:e});i.init(n),i.updateHex(r);var s=i.sign();t.sighex=s},this.tohex=function(){var t=this.params,r=[];if(r.push(new i({int:t.version})),r.push(new c(t.id)),r.push(new l({name:t.hashalg})),null!=t.sattrs){var n=new h(t.sattrs);try{r.push(new o({tag:"a0",explicit:!1,obj:n}))}catch(t){throw new e("si sattr error: "+t)}}if(null!=t.sigalgfield?r.push(new l({name:t.sigalgfield})):r.push(new l({name:t.sigalg})),null==t.sighex&&null!=t.signkey&&this.sign(),r.push(new s({hex:t.sighex})),null!=t.uattrs){n=new h(t.uattrs);try{r.push(new o({tag:"a1",explicit:!1,obj:n}))}catch(t){throw new e("si uattr error: "+t)}}return new a({array:r}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},je(Zt.asn1.cms.SignerInfo,Zt.asn1.ASN1Object),Zt.asn1.cms.EncapsulatedContentInfo=function(t){var e=Zt.asn1,r=e.DERTaggedObject,n=e.DERSequence,i=e.DERObjectIdentifier,s=e.DEROctetString;e.cms.EncapsulatedContentInfo.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params,e=[];if(e.push(new i(t.type)),null!=t.content&&(null!=t.content.hex||null!=t.content.str)&&1!=t.isDetached){var a=new s(t.content),o=new r({tag:"a0",explicit:!0,obj:a});e.push(o)}return new n({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(t){this.params=t},null!=t&&this.setByParam(t)},je(Zt.asn1.cms.EncapsulatedContentInfo,Zt.asn1.ASN1Object),Zt.asn1.cms.ContentInfo=function(t){var e=Zt.asn1,r=e.DERTaggedObject,n=e.DERSequence,i=e.DERObjectIdentifier;Zt.asn1.cms.ContentInfo.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params,e=[];e.push(new i(t.type));var s=new r({tag:"a0",explicit:!0,obj:t.obj});return e.push(s),new n({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(t){this.params=t},null!=t&&this.setByParam(t)},je(Zt.asn1.cms.ContentInfo,Zt.asn1.ASN1Object),Zt.asn1.cms.SignedData=function(t){var e=Zt.asn1,r=e.DERInteger,n=e.DERSet,i=e.DERSequence,s=e.cms,a=s.EncapsulatedContentInfo,o=s.SignerInfo,u=s.ContentInfo,c=s.CertificateSet,h=s.RevocationInfoChoices,l=e.x509.AlgorithmIdentifier;Zt.asn1.cms.SignedData.superclass.constructor.call(this),this.params=null,this.checkAndFixParam=function(){var t=this.params;this._setDigestAlgs(t),this._setContentTypeByEContent(t),this._setMessageDigestByEContent(t),this._setSignerInfoVersion(t),this._setSignedDataVersion(t)},this._setDigestAlgs=function(t){for(var e={},r=t.sinfos,n=0;n<r.length;n++){e[r[n].hashalg]=1}t.hashalgs=Object.keys(e).sort()},this._setContentTypeByEContent=function(t){for(var e=t.econtent.type,r=t.sinfos,n=0;n<r.length;n++){var i=r[n];this._getAttrParamByName(i,"contentType").type=e}},this._setMessageDigestByEContent=function(t){var e=t.econtent,r=e.content.hex;null==r&&"data"==e.type&&null!=e.content.str&&(r=fe(e.content.str));for(var n=t.sinfos,i=0;i<n.length;i++){var s=n[i],a=s.hashalg,o=this._getAttrParamByName(s,"messageDigest"),u=Zt.crypto.Util.hashHex(r,a);o.hex=u}},this._getAttrParamByName=function(t,e){for(var r=t.sattrs.array,n=0;n<r.length;n++)if(r[n].attr==e)return r[n]},this._setSignerInfoVersion=function(t){for(var e=t.sinfos,r=0;r<e.length;r++){var n=e[r],i=1;"skid"==n.id.type&&(i=3),n.version=i}},this._setSignedDataVersion=function(t){var e=this._getSignedDataVersion(t);t.version=e},this._getSignedDataVersion=function(t){if(null!=t.revinfos)for(var e=t.revinfos,r=0;r<e.length;r++){if(null!=e[r].ocsp)return 5}var n=t.sinfos;for(r=0;r<n.length;r++){if(3==t.sinfos[r].version)return 3}return"data"!=t.econtent.type?3:1},this.tohex=function(){var t=this.params;null!=this.getEncodedHexPrepare&&this.getEncodedHexPrepare(),1!=t.fixed&&this.checkAndFixParam();var e=[];e.push(new r({int:t.version}));for(var s=[],u=0;u<t.hashalgs.length;u++){var f=t.hashalgs[u];s.push(new l({name:f}))}e.push(new n({array:s})),e.push(new a(t.econtent)),null!=t.certs&&e.push(new c(t.certs)),null!=t.revinfos&&e.push(new h(t.revinfos));var p=[];for(u=0;u<t.sinfos.length;u++){var g=t.sinfos[u];p.push(new o(g))}return e.push(new n({array:p})),new i({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.getContentInfo=function(){return new u({type:"signed-data",obj:this})},this.getContentInfoEncodedHex=function(){return this.getContentInfo().tohex()},null!=t&&this.setByParam(t)},je(Zt.asn1.cms.SignedData,Zt.asn1.ASN1Object),Zt.asn1.cms.CertificateSet=function(t){Zt.asn1.cms.CertificateSet.superclass.constructor.call(this);var e=Error,r=Zt.asn1,n=r.DERTaggedObject,i=r.DERSet,s=r.ASN1Object;this.params=null,this.tohex=function(){var t,r=this.params,a=[];if(r instanceof Array)t=r;else{if(null==r.array)throw new e("cert array not specified");t=r.array}for(var o=0;o<t.length;o++){var u=ge(t[o]),c=new s;c.hTLV=u,a.push(c)}var h={array:a};0==r.sortflag&&(h.sortflag=!1);var l=new i(h);return new n({tag:"a0",explicit:!1,obj:l}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},je(Zt.asn1.cms.CertificateSet,Zt.asn1.ASN1Object),Zt.asn1.cms.RevocationInfoChoices=function(t){Zt.asn1.cms.RevocationInfoChoices.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params;if(!t instanceof Array)throw new Error("params is not array");for(var e=[],r=0;r<t.length;r++)e.push(new Zt.asn1.cms.RevocationInfoChoice(t[r]));return Zt.asn1.ASN1Util.newObject({tag:{tagi:"a1",obj:{set:e}}}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},je(Zt.asn1.cms.RevocationInfoChoices,Zt.asn1.ASN1Object),Zt.asn1.cms.RevocationInfoChoice=function(t){Zt.asn1.cms.RevocationInfoChoice.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params;if(null!=t.crl&&"string"==typeof t.crl){var e=t.crl;return-1!=t.crl.indexOf("-----BEGIN")&&(e=ge(t.crl)),e}if(null!=t.ocsp)return Zt.asn1.ASN1Util.newObject({tag:{tagi:"a1",obj:new Zt.asn1.cms.OtherRevocationFormat(t)}}).tohex();throw new Error("property crl or ocsp undefined")},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},je(Zt.asn1.cms.RevocationInfoChoice,Zt.asn1.ASN1Object),Zt.asn1.cms.OtherRevocationFormat=function(t){Zt.asn1.cms.OtherRevocationFormat.superclass.constructor.call(this);var e=Error,r=Zt,n=r.asn1.ASN1Util.newObject,i=r.lang.String.isHex;this.params=null,this.tohex=function(){var t=this.params;if(null==t.ocsp)throw new e("property ocsp not specified");if(!i(t.ocsp)||!ee.isASN1HEX(t.ocsp))throw new e("ocsp value not ASN.1 hex string");return n({seq:[{oid:"1.3.6.1.5.5.7.16.2"},{asn1:{tlv:t.ocsp}}]}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},je(Zt.asn1.cms.OtherRevocationFormat,Zt.asn1.ASN1Object),Zt.asn1.cms.CMSUtil=new function(){},Zt.asn1.cms.CMSUtil.newSignedData=function(t){return new Zt.asn1.cms.SignedData(t)},Zt.asn1.cms.CMSUtil.verifySignedData=function(t){var e=Zt,r=e.lang.String.isHex,n=ee,i=n.getVbyList,s=n.getTLVbyList,a=n.getIdxbyList,o=n.getChildIdx,u=n.getTLV,c=n.oidname,h=e.crypto.Util.hashHex;void 0===t.cms&&r(t.cms);var l=t.cms,f=function(t,e){var r=e.idx;e.signerid_issuer1=s(t,r,[1,0],"30"),e.signerid_serial1=i(t,r,[1,1],"02"),e.hashalg=c(i(t,r,[2,0],"06"));var n=a(t,r,[3],"a0");e.idxSignedAttrs=n,p(t,e,n);var u=o(t,r).length;if(u<6)throw"malformed SignerInfo";e.sigalg=c(i(t,r,[u-2,0],"06")),e.sigval=i(t,r,[u-1],"04")},p=function(t,e,r){var n=o(t,r);e.signedAttrIdxList=n;for(var s=0;s<n.length;s++){var a,u=n[s],c=i(t,u,[0],"06");"2a864886f70d010905"===c?(a=ce(i(t,u,[1,0])),e.saSigningTime=a):"2a864886f70d010904"===c&&(a=i(t,u,[1,0],"04"),e.saMessageDigest=a)}},g=function(t,e,r,n){r.verifyDetail={};var i=r.verifyDetail,s=e.parse.econtent,a=r.hashalg,c=r.saMessageDigest;i.validMessageDigest=!1,h(s,a)===c&&(i.validMessageDigest=!0),function(t,e,r){var n,i=e.parse.certsIdx;if(void 0===e.certs){n=[],e.certkeys=[];for(var s=o(t,i),a=0;a<s.length;a++){var c=u(t,s[a]),h=new qe;h.readCertHex(c),n[a]=h,e.certkeys[a]=h.getPublicKey()}e.certs=n}else n=e.certs;for(e.cccc=n.length,e.cccci=s.length,a=0;a<n.length;a++){var l=h.getIssuerHex(),f=h.getSerialNumberHex();r.signerid_issuer1===l&&r.signerid_serial1===f&&(r.certkey_idx=a)}}(t,e,r),i.validSignatureValue=!1;var l=r.sigalg,f="31"+u(t,r.idxSignedAttrs).substr(2);r.signedattrshex=f;var p=e.certs[r.certkey_idx].getPublicKey(),g=new Zt.crypto.Signature({alg:l});g.init(p),g.updateHex(f);var d=g.verify(r.sigval);i.validSignatureValue_isValid=d,!0===d&&(i.validSignatureValue=!0),r.isValid=!1,i.validMessageDigest&&i.validSignatureValue&&(r.isValid=!0)},d={isValid:!1,parse:{}};return function(t,e){if("2a864886f70d010702"!==i(t,0,[0],"06"))return e;e.cmsType="signedData",e.econtent=i(t,0,[1,0,2,1,0]),function(t,e){for(var r,n=3;n<6;n++)if(void 0!==(r=a(t,0,[1,0,n]))){var i=t.substr(r,2);"a0"===i&&(e.certsIdx=r),"a1"===i&&(e.revinfosIdx=r),"31"===i&&(e.signerinfosIdx=r)}}(t,e),e.signerInfos=[],function(t,e){var r=e.signerinfosIdx;if(void 0!==r){var n=o(t,r);e.signerInfoIdxList=n;for(var i=0;i<n.length;i++){var s={idx:n[i]};f(t,s),e.signerInfos.push(s)}}}(t,e)}(l,d.parse),function(t,e){for(var r=e.parse.signerInfos,n=r.length,i=!0,s=0;s<n;s++){var a=r[s];g(t,e,a),a.isValid||(i=!1)}e.isValid=i}(l,d),d},Zt.asn1.cms.CMSParser=function(){var t=Error,e=qe,r=new e,n=ee,i=n.getV,s=n.getTLV,a=n.getTLVbyList,o=n.getTLVbyListEx,u=n.getVbyList,c=n.getVbyListEx,h=n.getChildIdx;this.getCMSSignedData=function(t){var e=a(t,0,[1,0]);return this.getSignedData(e)},this.getSignedData=function(t){var e=h(t,0),r={},n=i(t,e[0]),a=parseInt(n,16);r.version=a;var u=s(t,e[1]);r.hashalgs=this.getHashAlgArray(u);var c=s(t,e[2]);r.econtent=this.getEContent(c);var l=o(t,0,["[0]"]);null!=l&&(r.certs=this.getCertificateSet(l)),o(t,0,["[1]"]);var f=o(t,0,[3]);return r.sinfos=this.getSignerInfos(f),r},this.getHashAlgArray=function(t){for(var r=h(t,0),n=new e,i=[],a=0;a<r.length;a++){var o=s(t,r[a]),u=n.getAlgorithmIdentifierName(o);i.push(u)}return i},this.getEContent=function(t){var e={},r=u(t,0,[0]),n=u(t,0,[1,0]);return e.type=Zt.asn1.x509.OID.oid2name(ee.hextooidstr(r)),e.content={hex:n},e},this.getSignerInfos=function(t){for(var e=[],r=h(t,0),n=0;n<r.length;n++){var i=s(t,r[n]),a=this.getSignerInfo(i);e.push(a)}return e},this.getSignerInfo=function(t){var e={},i=h(t,0),a=n.getInt(t,i[0],-1);-1!=a&&(e.version=a);var u=s(t,i[1]),l=this.getIssuerAndSerialNumber(u);e.id=l;var f=s(t,i[2]),p=r.getAlgorithmIdentifierName(f);e.hashalg=p;var g=o(t,0,["[0]"]);if(null!=g){var d=this.getAttributeList(g);e.sattrs=d}var v=o(t,0,[3]),m=r.getAlgorithmIdentifierName(v);e.sigalg=m;var y=c(t,0,[4]);e.sighex=y;var w=o(t,0,["[1]"]);if(null!=w){var x=this.getAttributeList(w);e.uattrs=x}return e},this.getSignerIdentifier=function(t){if("30"==t.substr(0,2))return this.getIssuerAndSerialNumber(t);throw new Error("SKID of signerIdentifier not supported")},this.getIssuerAndSerialNumber=function(t){var e={type:"isssn"},n=h(t,0),a=s(t,n[0]);e.issuer=r.getX500Name(a);var o=i(t,n[1]);return e.serial={hex:o},e},this.getAttributeList=function(t){for(var e=[],r=h(t,0),n=0;n<r.length;n++){var i=s(t,r[n]),a=this.getAttribute(i);e.push(a)}return{array:e}},this.getAttribute=function(t){var e={},r=h(t,0),i=n.getOID(t,r[0]),a=Zt.asn1.x509.OID.oid2name(i);e.attr=a;var o=s(t,r[1]),u=h(o,0);if(1==u.length)e.valhex=s(o,u[0]);else{for(var c=[],l=0;l<u.length;l++)c.push(s(o,u[l]));e.valhex=c}return"contentType"==a?this.setContentType(e):"messageDigest"==a?this.setMessageDigest(e):"signingTime"==a?this.setSigningTime(e):"signingCertificate"==a?this.setSigningCertificate(e):"signingCertificateV2"==a?this.setSigningCertificateV2(e):"signaturePolicyIdentifier"==a&&this.setSignaturePolicyIdentifier(e),e},this.setContentType=function(t){var e=n.getOIDName(t.valhex,0,null);null!=e&&(t.type=e,delete t.valhex)},this.setSigningTime=function(t){var e=ce(i(t.valhex,0));t.str=e,delete t.valhex},this.setMessageDigest=function(t){var e=i(t.valhex,0);t.hex=e,delete t.valhex},this.setSigningCertificate=function(t){var e=h(t.valhex,0);if(e.length>0){for(var r=s(t.valhex,e[0]),n=h(r,0),i=[],a=0;a<n.length;a++){var o=s(r,n[a]),u=this.getESSCertID(o);i.push(u)}t.array=i}if(e.length>1){var c=s(t.valhex,e[1]);t.polhex=c}delete t.valhex},this.setSignaturePolicyIdentifier=function(t){var r=h(t.valhex,0);if(r.length>0){var a=n.getOID(t.valhex,r[0]);t.oid=a}if(r.length>1){var o=new e,u=h(t.valhex,r[1]),c=s(t.valhex,u[0]),l=o.getAlgorithmIdentifierName(c);t.alg=l;var f=i(t.valhex,u[1]);t.hash=f}delete t.valhex},this.setSigningCertificateV2=function(t){var e=h(t.valhex,0);if(e.length>0){for(var r=s(t.valhex,e[0]),n=h(r,0),i=[],a=0;a<n.length;a++){var o=s(r,n[a]),u=this.getESSCertIDv2(o);i.push(u)}t.array=i}if(e.length>1){var c=s(t.valhex,e[1]);t.polhex=c}delete t.valhex},this.getESSCertID=function(t){var e={},r=h(t,0);if(r.length>0){var n=i(t,r[0]);e.hash=n}if(r.length>1){var a=s(t,r[1]),o=this.getIssuerSerial(a);null!=o.serial&&(e.serial=o.serial),null!=o.issuer&&(e.issuer=o.issuer)}return e},this.getESSCertIDv2=function(e){var n={},a=h(e,0);if(a.length<1||3<a.length)throw new t("wrong number of elements");var o=0;if("30"==e.substr(a[0],2)){var u=s(e,a[0]);n.alg=r.getAlgorithmIdentifierName(u),o++}else n.alg="sha256";var c=i(e,a[o]);if(n.hash=c,a.length>o+1){var l=s(e,a[o+1]),f=this.getIssuerSerial(l);n.issuer=f.issuer,n.serial=f.serial}return n},this.getIssuerSerial=function(t){var e={},n=h(t,0),a=s(t,n[0]),o=r.getGeneralNames(a)[0].dn;e.issuer=o;var u=i(t,n[1]);return e.serial={hex:u},e},this.getCertificateSet=function(t){for(var e=h(t,0),r=[],n=0;n<e.length;n++){var i=s(t,e[n]);if("30"==i.substr(0,2)){var a=pe(i,"CERTIFICATE");r.push(a)}}return{array:r,sortflag:!1}}},void 0!==Zt&&Zt||(Zt={}),void 0!==Zt.asn1&&Zt.asn1||(Zt.asn1={}),void 0!==Zt.asn1.tsp&&Zt.asn1.tsp||(Zt.asn1.tsp={}),Zt.asn1.tsp.TimeStampToken=function(t){var e=Zt.asn1.tsp;e.TimeStampToken.superclass.constructor.call(this),this.params=null,this.getEncodedHexPrepare=function(){var t=new e.TSTInfo(this.params.econtent.content);this.params.econtent.content.hex=t.tohex()},null!=t&&this.setByParam(t)},je(Zt.asn1.tsp.TimeStampToken,Zt.asn1.cms.SignedData),Zt.asn1.tsp.TSTInfo=function(t){var e=Zt.asn1,r=e.DERSequence,n=e.DERInteger,i=e.DERBoolean,s=e.DERGeneralizedTime,a=e.DERObjectIdentifier,o=e.DERTaggedObject,u=e.tsp,c=u.MessageImprint,h=u.Accuracy,l=e.x509.GeneralName;if(u.TSTInfo.superclass.constructor.call(this),this.dVersion=new n({int:1}),this.dPolicy=null,this.dMessageImprint=null,this.dSerial=null,this.dGenTime=null,this.dAccuracy=null,this.dOrdering=null,this.dNonce=null,this.dTsa=null,this.tohex=function(){var t=[this.dVersion];if(null==this.dPolicy)throw new Error("policy shall be specified.");if(t.push(this.dPolicy),null==this.dMessageImprint)throw new Error("messageImprint shall be specified.");if(t.push(this.dMessageImprint),null==this.dSerial)throw new Error("serialNumber shall be specified.");if(t.push(this.dSerial),null==this.dGenTime)throw new Error("genTime shall be specified.");t.push(this.dGenTime),null!=this.dAccuracy&&t.push(this.dAccuracy),null!=this.dOrdering&&t.push(this.dOrdering),null!=this.dNonce&&t.push(this.dNonce),null!=this.dTsa&&t.push(this.dTsa);var e=new r({array:t});return this.hTLV=e.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},void 0!==t){if("string"==typeof t.policy){if(!t.policy.match(/^[0-9.]+$/))throw"policy shall be oid like 0.1.4.134";this.dPolicy=new a({oid:t.policy})}void 0!==t.messageImprint&&(this.dMessageImprint=new c(t.messageImprint)),void 0!==t.serial&&(this.dSerial=new n(t.serial)),void 0!==t.genTime&&(this.dGenTime=new s(t.genTime)),void 0!==t.accuracy&&(this.dAccuracy=new h(t.accuracy)),void 0!==t.ordering&&1==t.ordering&&(this.dOrdering=new i),void 0!==t.nonce&&(this.dNonce=new n(t.nonce)),void 0!==t.tsa&&(this.dTsa=new o({tag:"a0",explicit:!0,obj:new l({dn:t.tsa})}))}},je(Zt.asn1.tsp.TSTInfo,Zt.asn1.ASN1Object),Zt.asn1.tsp.Accuracy=function(t){var e=Zt.asn1,r=e.ASN1Util.newObject;e.tsp.Accuracy.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params,e=[];return null!=t.seconds&&"number"==typeof t.seconds&&e.push({int:t.seconds}),null!=t.millis&&"number"==typeof t.millis&&e.push({tag:{tagi:"80",obj:{int:t.millis}}}),null!=t.micros&&"number"==typeof t.micros&&e.push({tag:{tagi:"81",obj:{int:t.micros}}}),r({seq:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},je(Zt.asn1.tsp.Accuracy,Zt.asn1.ASN1Object),Zt.asn1.tsp.MessageImprint=function(t){var e=Zt.asn1,r=e.DERSequence,n=e.DEROctetString,i=e.x509.AlgorithmIdentifier;e.tsp.MessageImprint.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params,e=new i({name:t.alg}),s=new n({hex:t.hash});return new r({array:[e,s]}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&this.setByParam(t)},je(Zt.asn1.tsp.MessageImprint,Zt.asn1.ASN1Object),Zt.asn1.tsp.TimeStampReq=function(t){var e=Zt.asn1,r=e.DERSequence,n=e.DERInteger,i=e.DERBoolean,s=e.DERObjectIdentifier,a=e.tsp,o=a.MessageImprint;a.TimeStampReq.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params,e=[];return e.push(new n({int:1})),t.messageImprint instanceof Zt.asn1.ASN1Object?e.push(t.messageImprint):e.push(new o(t.messageImprint)),null!=t.policy&&e.push(new s(t.policy)),null!=t.nonce&&e.push(new n(t.nonce)),1==t.certreq&&e.push(new i),new r({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},je(Zt.asn1.tsp.TimeStampReq,Zt.asn1.ASN1Object),Zt.asn1.tsp.TimeStampResp=function(t){var e=Zt.asn1,r=e.DERSequence,n=e.tsp,i=n.PKIStatusInfo;n.TimeStampResp.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params,s=[];if(null!=t.econtent||null!=t.tst)if(null!=t.statusinfo?s.push(new i(t.statusinfo)):s.push(new i("granted")),null!=t.econtent)s.push(new n.TimeStampToken(t).getContentInfo());else{if(!(t.tst instanceof e.ASN1Object))throw new Error("improper member tst value");s.push(t.tst)}else{if(null==t.statusinfo)throw new Error("parameter for token nor statusinfo not specified");s.push(new i(t.statusinfo))}return new r({array:s}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},je(Zt.asn1.tsp.TimeStampResp,Zt.asn1.ASN1Object),Zt.asn1.tsp.PKIStatusInfo=function(t){var e=Error,r=Zt.asn1,n=r.DERSequence,i=r.tsp,s=i.PKIStatus,a=i.PKIFreeText,o=i.PKIFailureInfo;i.PKIStatusInfo.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params,r=[];if("string"==typeof t)r.push(new s(t));else{if(null==t.status)throw new e("property 'status' unspecified");r.push(new s(t.status)),null!=t.statusstr&&r.push(new a(t.statusstr)),null!=t.failinfo&&r.push(new o(t.failinfo))}return new n({array:r}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},je(Zt.asn1.tsp.PKIStatusInfo,Zt.asn1.ASN1Object),Zt.asn1.tsp.PKIStatus=function(t){var e=Error,r=Zt.asn1,n=r.DERInteger;r.tsp.PKIStatus.superclass.constructor.call(this);var i={granted:0,grantedWithMods:1,rejection:2,waiting:3,revocationWarning:4,revocationNotification:5};this.params=null,this.tohex=function(){var t,r=this.params;if("string"==typeof r)try{t=i[r]}catch(t){throw new e("undefined name: "+r)}else{if("number"!=typeof r)throw new e("unsupported params");t=r}return new n({int:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},je(Zt.asn1.tsp.PKIStatus,Zt.asn1.ASN1Object),Zt.asn1.tsp.PKIFreeText=function(t){var e=Error,r=Zt.asn1,n=r.DERSequence,i=r.DERUTF8String;r.tsp.PKIFreeText.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params;if(!(t instanceof Array))throw new e("wrong params: not array");for(var r=[],s=0;s<t.length;s++)r.push(new i({str:t[s]}));return new n({array:r}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},je(Zt.asn1.tsp.PKIFreeText,Zt.asn1.ASN1Object),Zt.asn1.tsp.PKIFailureInfo=function(t){var e=Error,r=Zt.asn1,n=r.DERBitString,i=r.tsp.PKIFailureInfo,s={badAlg:0,badRequest:2,badDataFormat:5,timeNotAvailable:14,unacceptedPolicy:15,unacceptedExtension:16,addInfoNotAvailable:17,systemFailure:25};i.superclass.constructor.call(this),this.params=null,this.getBinValue=function(){var t=this.params,r=0;if("number"==typeof t&&0<=t&&t<=25){for(var n=(r|=1<<t).toString(2),i="",a=n.length-1;a>=0;a--)i+=n[a];return i}if("string"==typeof t&&null!=s[t])return Be([t],s);if("object"==typeof t&&null!=t.length)return Be(t,s);throw new e("wrong params")},this.tohex=function(){var t=this.getBinValue();return new n({bin:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},je(Zt.asn1.tsp.PKIFailureInfo,Zt.asn1.ASN1Object),Zt.asn1.tsp.AbstractTSAAdapter=function(t){this.getTSTHex=function(t,e){throw"not implemented yet"}},Zt.asn1.tsp.SimpleTSAAdapter=function(t){var e=Zt,r=e.asn1.tsp,n=e.crypto.Util.hashHex;r.SimpleTSAAdapter.superclass.constructor.call(this),this.params=null,this.serial=0,this.getTSTHex=function(t,e){var i=n(t,e);this.params.econtent.content.messageImprint={alg:e,hash:i},this.params.econtent.content.serial={int:this.serial++};var s=Math.floor(1e9*Math.random());return this.params.econtent.content.nonce={int:s},new r.TimeStampToken(this.params).getContentInfoEncodedHex()},void 0!==t&&(this.params=t)},je(Zt.asn1.tsp.SimpleTSAAdapter,Zt.asn1.tsp.AbstractTSAAdapter),Zt.asn1.tsp.FixedTSAAdapter=function(t){var e=Zt,r=e.asn1.tsp,n=e.crypto.Util.hashHex;r.FixedTSAAdapter.superclass.constructor.call(this),this.params=null,this.getTSTHex=function(t,e){var i=n(t,e);return this.params.econtent.content.messageImprint={alg:e,hash:i},new r.TimeStampToken(this.params).getContentInfoEncodedHex()},void 0!==t&&(this.params=t)},je(Zt.asn1.tsp.FixedTSAAdapter,Zt.asn1.tsp.AbstractTSAAdapter),Zt.asn1.tsp.TSPUtil=new function(){},Zt.asn1.tsp.TSPUtil.newTimeStampToken=function(t){return new Zt.asn1.tsp.TimeStampToken(t)},Zt.asn1.tsp.TSPUtil.parseTimeStampReq=function(t){return(new Zt.asn1.tsp.TSPParser).getTimeStampReq(t)},Zt.asn1.tsp.TSPUtil.parseMessageImprint=function(t){return(new Zt.asn1.tsp.TSPParser).getMessageImprint(t)},Zt.asn1.tsp.TSPParser=function(){var t=new qe,e=ee,r=e.getV,n=e.getTLV,i=e.getIdxbyList,s=e.getChildIdx,a=["granted","grantedWithMods","rejection","waiting","revocationWarning","revocationNotification"],o={0:"badAlg",2:"badRequest",5:"badDataFormat",14:"timeNotAvailable",15:"unacceptedPolicy",16:"unacceptedExtension",17:"addInfoNotAvailable",25:"systemFailure"};this.getResponse=function(t){var e=s(t,0);if(1==e.length)return this.getPKIStatusInfo(n(t,e[0]));if(e.length>1){var r=this.getPKIStatusInfo(n(t,e[0])),i=n(t,e[1]),a=this.getToken(i);return a.statusinfo=r,a}},this.getToken=function(t){var e=(new Zt.asn1.cms.CMSParser).getCMSSignedData(t);return this.setTSTInfo(e),e},this.setTSTInfo=function(t){var e=t.econtent;if("tstinfo"==e.type){var r=e.content.hex,n=this.getTSTInfo(r);e.content=n}},this.getTSTInfo=function(e){var i={},a=s(e,0),o=r(e,a[1]);i.policy=Re(o);var u=n(e,a[2]);i.messageImprint=this.getMessageImprint(u);var c=r(e,a[3]);i.serial={hex:c};var h=r(e,a[4]);i.genTime={str:ce(h)};var l=0;if(a.length>5&&"30"==e.substr(a[5],2)){var f=n(e,a[5]);i.accuracy=this.getAccuracy(f),l++}a.length>5+l&&"01"==e.substr(a[5+l],2)&&("ff"==r(e,a[5+l])&&(i.ordering=!0),l++);if(a.length>5+l&&"02"==e.substr(a[5+l],2)){var p=r(e,a[5+l]);i.nonce={hex:p},l++}if(a.length>5+l&&"a0"==e.substr(a[5+l],2)){var g=n(e,a[5+l]);g="30"+g.substr(2),pGeneralNames=t.getGeneralNames(g);var d=pGeneralNames[0].dn;i.tsa=d,l++}if(a.length>5+l&&"a1"==e.substr(a[5+l],2)){var v=n(e,a[5+l]);v="30"+v.substr(2);var m=t.getExtParamArray(v);i.ext=m,l++}return i},this.getAccuracy=function(t){for(var e={},n=s(t,0),i=0;i<n.length;i++){var a=t.substr(n[i],2),o=r(t,n[i]),u=parseInt(o,16);"02"==a?e.seconds=u:"80"==a?e.millis=u:"81"==a&&(e.micros=u)}return e},this.getMessageImprint=function(t){if("30"!=t.substr(0,2))throw new Error("head of messageImprint hex shall be x30");var n={};s(t,0);var a=i(t,0,[0,0]),o=r(t,a),u=e.hextooidstr(o),c=Zt.asn1.x509.OID.oid2name(u);if(""==c)throw new Error("hashAlg name undefined: "+u);var h=c,l=i(t,0,[1]);return n.alg=h,n.hash=r(t,l),n},this.getPKIStatusInfo=function(t){var e={},i=s(t,0),o=0;try{var u=r(t,i[0]),c=parseInt(u,16);e.status=a[c]}catch(t){}if(i.length>1&&"30"==t.substr(i[1],2)){var h=n(t,i[1]);e.statusstr=this.getPKIFreeText(h),o++}if(i.length>o&&"03"==t.substr(i[1+o],2)){var l=n(t,i[1+o]);e.failinfo=this.getPKIFailureInfo(l)}return e},this.getPKIFreeText=function(t){for(var r=[],n=s(t,0),i=0;i<n.length;i++)r.push(e.getString(t,n[i]));return r},this.getPKIFailureInfo=function(t){var r=e.getInt(t,0);return null!=o[r]?o[r]:r},this.getTimeStampReq=function(t){var i={certreq:!1},a=s(t,0);if(a.length<2)throw new Error("TimeStampReq must have at least 2 items");var o=n(t,a[1]);i.messageImprint=Zt.asn1.tsp.TSPUtil.parseMessageImprint(o);for(var u=2;u<a.length;u++){var c=a[u],h=t.substr(c,2);if("06"==h){var l=r(t,c);i.policy=e.hextooidstr(l)}"02"==h&&(i.nonce=r(t,c)),"01"==h&&(i.certreq=!0)}return i}},void 0!==Zt&&Zt||(Zt={}),void 0!==Zt.asn1&&Zt.asn1||(Zt.asn1={}),void 0!==Zt.asn1.cades&&Zt.asn1.cades||(Zt.asn1.cades={}),Zt.asn1.cades.SignaturePolicyIdentifier=function(t){var e=Zt.asn1.cades,r=e.SignaturePolicyId;e.SignaturePolicyIdentifier.superclass.constructor.call(this),this.typeOid="1.2.840.113549.1.9.16.2.15",this.params=null,this.getValueArray=function(){return[new r(this.params)]},this.setByParam=function(t){this.params=t},null!=t&&this.setByParam(t)},je(Zt.asn1.cades.SignaturePolicyIdentifier,Zt.asn1.cms.Attribute),Zt.asn1.cades.SignaturePolicyId=function(t){var e=Zt.asn1,r=e.DERSequence,n=e.DERObjectIdentifier,i=e.cades,s=i.SignaturePolicyId,a=i.OtherHashAlgAndValue;s.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params,e=[];return e.push(new n(t.oid)),e.push(new a(t)),new r({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(t){this.params=t},null!=t&&this.setByParam(t)},je(Zt.asn1.cades.SignaturePolicyId,Zt.asn1.ASN1Object),Zt.asn1.cades.OtherHashAlgAndValue=function(t){var e=Error,r=Zt.asn1,n=r.DERSequence,i=r.DEROctetString,s=r.x509.AlgorithmIdentifier;r.cades.OtherHashAlgAndValue.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params;if(null==t.alg)throw new e("property 'alg' not specified");if(null==t.hash&&null==t.cert)throw new e("property 'hash' nor 'cert' not specified");var r=null;if(null!=t.hash)r=t.hash;else if(null!=t.cert){if("string"!=typeof t.cert)throw new e("cert not string");var a=t.cert;-1!=t.cert.indexOf("-----BEGIN")&&(a=ge(t.cert)),r=Zt.crypto.Util.hashHex(a,t.alg)}var o=[];return o.push(new s({name:t.alg})),o.push(new i({hex:r})),new n({array:o}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},je(Zt.asn1.cades.OtherHashAlgAndValue,Zt.asn1.ASN1Object),Zt.asn1.cades.OtherHashValue=function(t){Zt.asn1.cades.OtherHashValue.superclass.constructor.call(this);var e=Error,r=Zt.asn1.DEROctetString;this.params=null,this.tohex=function(){var t=this.params;if(null==t.hash&&null==t.cert)throw new e("hash or cert not specified");var n=null;if(null!=t.hash)n=t.hash;else if(null!=t.cert){if("string"!=typeof t.cert)throw new e("cert not string");var i=t.cert;-1!=t.cert.indexOf("-----BEGIN")&&(i=ge(t.cert)),n=Zt.crypto.Util.hashHex(i,"sha1")}return new r({hex:n}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},je(Zt.asn1.cades.OtherHashValue,Zt.asn1.ASN1Object),Zt.asn1.cades.SignatureTimeStamp=function(t){var e=Error,r=Zt,n=r.lang.String.isHex,i=r.asn1,s=i.ASN1Object;i.cades.SignatureTimeStamp.superclass.constructor.call(this),this.typeOid="1.2.840.113549.1.9.16.2.14",this.params=null,this.getValueArray=function(){var t=this.params;if(null!=t.tst){if(n(t.tst))return(r=new s).hTLV=t.tst,[r];if(t.tst instanceof s)return[t.tst];throw new e("params.tst has wrong value")}if(null!=t.res){var r,i=t.res;if(i instanceof s&&(i=i.tohex()),"string"!=typeof i||!n(i))throw new e("params.res has wrong value");return ee.getTLVbyList(i,0,[1]),(r=new s).hTLV=t.tst,[r]}},null!=t&&this.setByParam(t)},je(Zt.asn1.cades.SignatureTimeStamp,Zt.asn1.cms.Attribute),Zt.asn1.cades.CompleteCertificateRefs=function(t){var e=Error,r=Zt,n=r.asn1,i=n.DERSequence,s=n.cades,a=s.OtherCertID,o=r.lang.String.isHex;s.CompleteCertificateRefs.superclass.constructor.call(this),this.typeOid="1.2.840.113549.1.9.16.2.21",this.params=null,this.getValueArray=function(){for(var t=this.params,r=[],n=0;n<t.array.length;n++){var s=t.array[n];if("string"==typeof s)if(-1!=s.indexOf("-----BEGIN"))s={cert:s};else{if(!o(s))throw new e("unsupported value: "+s);s={hash:s}}null!=t.alg&&null==s.alg&&(s.alg=t.alg),null!=t.hasis&&null==s.hasis&&(s.hasis=t.hasis);var u=new a(s);r.push(u)}return[new i({array:r})]},null!=t&&this.setByParam(t)},je(Zt.asn1.cades.CompleteCertificateRefs,Zt.asn1.cms.Attribute),Zt.asn1.cades.OtherCertID=function(t){var e=Zt.asn1,r=e.DERSequence,n=e.cms.IssuerSerial,i=e.cades,s=i.OtherHashValue,a=i.OtherHashAlgAndValue;i.OtherCertID.superclass.constructor.call(this),this.params=t,this.tohex=function(){var t=this.params;"string"==typeof t&&(-1!=t.indexOf("-----BEGIN")?t={cert:t}:_isHex(t)&&(t={hash:t}));var e=[],i=null;if(i=null!=t.alg?new a(t):new s(t),e.push(i),null!=t.cert&&1==t.hasis||null!=t.issuer&&null!=t.serial){var o=new n(t);e.push(o)}return new r({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},je(Zt.asn1.cades.OtherCertID,Zt.asn1.ASN1Object),Zt.asn1.cades.OtherHash=function(t){var e=Zt,r=e.asn1.cades,n=r.OtherHashAlgAndValue,i=r.OtherHashValue,s=e.lang.String.isHex;r.OtherHash.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params;"string"==typeof t&&(-1!=t.indexOf("-----BEGIN")?t={cert:t}:s(t)&&(t={hash:t}));return(null!=t.alg?new n(t):new i(t)).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},je(Zt.asn1.cades.OtherHash,Zt.asn1.ASN1Object),Zt.asn1.cades.CAdESUtil=new function(){},Zt.asn1.cades.CAdESUtil.parseSignedDataForAddingUnsigned=function(t){return(new Zt.asn1.cms.CMSParser).getCMSSignedData(t)},Zt.asn1.cades.CAdESUtil.parseSignerInfoForAddingUnsigned=function(t,e,r){var n=ee,i=n.getChildIdx,s=n.getTLV,a=n.getV,o=Zt.asn1,u=o.ASN1Object,c=o.cms,h=c.AttributeList,l=c.SignerInfo,f={},p=i(t,e);if(6!=p.length)throw"not supported items for SignerInfo (!=6)";var g=p.shift();f.version=s(t,g);var d=p.shift();f.si=s(t,d);var v=p.shift();f.digalg=s(t,v);var m=p.shift();f.sattrs=s(t,m);var y=p.shift();f.sigalg=s(t,y);var w=p.shift();f.sig=s(t,w),f.sigval=a(t,w);var x=null;return f.obj=new l,(x=new u).hTLV=f.version,f.obj.dCMSVersion=x,(x=new u).hTLV=f.si,f.obj.dSignerIdentifier=x,(x=new u).hTLV=f.digalg,f.obj.dDigestAlgorithm=x,(x=new u).hTLV=f.sattrs,f.obj.dSignedAttrs=x,(x=new u).hTLV=f.sigalg,f.obj.dSigAlg=x,(x=new u).hTLV=f.sig,f.obj.dSig=x,f.obj.dUnsignedAttrs=new h,f},void 0!==Zt.asn1.csr&&Zt.asn1.csr||(Zt.asn1.csr={}),Zt.asn1.csr.CertificationRequest=function(t){var e=Zt.asn1,r=e.DERBitString,n=e.DERSequence,i=e.csr,s=i.CertificationRequestInfo;i.CertificationRequest.superclass.constructor.call(this),this.setByParam=function(t){this.params=t},this.sign=function(){var t=new s(this.params).tohex(),e=new Zt.crypto.Signature({alg:this.params.sigalg});e.init(this.params.sbjprvkey),e.updateHex(t);var r=e.sign();this.params.sighex=r},this.getPEM=function(){return pe(this.tohex(),"CERTIFICATE REQUEST")},this.tohex=function(){var t=this.params,e=new Zt.asn1.csr.CertificationRequestInfo(this.params),i=new Zt.asn1.x509.AlgorithmIdentifier({name:t.sigalg});if(null==t.sighex&&null!=t.sbjprvkey&&this.sign(),null==t.sighex)throw new Error("sighex or sbjprvkey parameter not defined");var s=new r({hex:"00"+t.sighex});return new n({array:[e,i,s]}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&this.setByParam(t)},je(Zt.asn1.csr.CertificationRequest,Zt.asn1.ASN1Object),Zt.asn1.csr.CertificationRequestInfo=function(t){var e=Zt.asn1,r=e.DERSequence,n=e.DERInteger,i=e.DERUTF8String,s=e.DERTaggedObject,a=e.ASN1Util.newObject,o=e.csr,u=e.x509,c=u.X500Name,h=u.Extensions,l=u.SubjectPublicKeyInfo;o.CertificationRequestInfo.superclass.constructor.call(this),this.params=null,this.setByParam=function(t){null!=t&&(this.params=t)},this.tohex=function(){var t=this.params,e=[];if(e.push(new n({int:0})),e.push(new c(t.subject)),e.push(new l(He.getKey(t.sbjpubkey))),null!=t.attrs){var o=function(t){for(var e=Error,r=Zt.asn1.x509.Extensions,n=[],i=0;i<t.length;i++){var s=t[i],a=s.attr;if("extensionRequest"==a){var o={seq:[{oid:"1.2.840.113549.1.9.14"},{set:[new r(s.ext)]}]};n.push(o)}else if("unstructuredName"==a){o={seq:[{oid:"1.2.840.113549.1.9.2"},{set:s.names}]};n.push(o)}else{if("challengePassword"!=a)throw new e("unknown CSR attribute");o={seq:[{oid:"1.2.840.113549.1.9.7"},{set:[{utf8str:s.password}]}]};n.push(o)}}return{set:n}}(t.attrs),u=a({tag:{tage:"a0",obj:o}});e.push(u)}else if(null!=t.extreq){var f=new h(t.extreq);u=a({tag:{tage:"a0",obj:{seq:[{oid:"1.2.840.113549.1.9.14"},{set:[f]}]}}});e.push(u)}else e.push(new s({tag:"a0",explicit:!1,obj:new i({str:""})}));return new r({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},je(Zt.asn1.csr.CertificationRequestInfo,Zt.asn1.ASN1Object),Zt.asn1.csr.AttributeList=function(t){},je(Zt.asn1.csr.AttributeList,Zt.asn1.ASN1Object),Zt.asn1.csr.CSRUtil=new function(){},Zt.asn1.csr.CSRUtil.newCSRPEM=function(t){return new Zt.asn1.csr.CertificationRequest(t).getPEM()},Zt.asn1.csr.CSRUtil.getParam=function(t,e){var r=ee,n=r.getV,i=r.getIdxbyList,s=r.getTLVbyList,a=r.getTLVbyListEx,o=r.getVbyListEx,u={};if(-1==t.indexOf("-----BEGIN CERTIFICATE REQUEST"))throw new Error("argument is not PEM file");var c=ge(t,"CERTIFICATE REQUEST");e&&(u.tbs=s(c,0,[0]));try{var h=a(c,0,[0,1]);if("3000"==h)u.subject={};else{var l=new qe;u.subject=l.getX500Name(h)}}catch(t){}var f=a(c,0,[0,2]),p=He.getKey(f,null,"pkcs8pub");u.sbjpubkey=He.getPEM(p,"PKCS8PUB");var g=function(t){var e=i(t,0,[0,3,0,0],"06");return"2a864886f70d01090e"!=n(t,e)?null:s(t,0,[0,3,0,1,0],"30")}(c);l=new qe;null!=g&&(u.extreq=l.getExtParamArray(g));try{var d=a(c,0,[1],"30");l=new qe;u.sigalg=l.getAlgorithmIdentifierName(d)}catch(t){}try{var v=o(c,0,[2]);u.sighex=v}catch(t){}return u},Zt.asn1.csr.CSRUtil.verifySignature=function(t){try{var e=null;if("string"==typeof t&&-1!=t.indexOf("-----BEGIN CERTIFICATE REQUEST")?e=Zt.asn1.csr.CSRUtil.getParam(t,!0):"object"==typeof t&&null!=t.sbjpubkey&&null!=t.sigalg&&null!=t.sighex&&null!=t.tbs&&(e=t),null==e)return!1;var r=new Zt.crypto.Signature({alg:e.sigalg});return r.init(e.sbjpubkey),r.updateHex(e.tbs),r.verify(e.sighex)}catch(t){return alert(t),!1}},void 0!==Zt&&Zt||(Zt={}),void 0!==Zt.asn1&&Zt.asn1||(Zt.asn1={}),void 0!==Zt.asn1.ocsp&&Zt.asn1.ocsp||(Zt.asn1.ocsp={}),Zt.asn1.ocsp.DEFAULT_HASH="sha1",Zt.asn1.ocsp.OCSPResponse=function(t){Zt.asn1.ocsp.OCSPResponse.superclass.constructor.call(this);var e=Zt.asn1.ASN1Util.newObject,r=Zt.asn1.ocsp.ResponseBytes,n=["successful","malformedRequest","internalError","tryLater","_not_used_","sigRequired","unauthorized"];this.params=null,this._getStatusCode=function(){var t=this.params.resstatus;return"number"==typeof t?t:"string"!=typeof t?-1:n.indexOf(t)},this.setByParam=function(t){this.params=t},this.tohex=function(){var t=this.params,n=this._getStatusCode();if(-1==n)throw new Error("responseStatus not supported: "+t.resstatus);if(0!=n)return e({seq:[{enum:{int:n}}]}).tohex();var i=new r(t);return e({seq:[{enum:{int:0}},{tag:{tag:"a0",explicit:!0,obj:i}}]}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&this.setByParam(t)},je(Zt.asn1.ocsp.OCSPResponse,Zt.asn1.ASN1Object),Zt.asn1.ocsp.ResponseBytes=function(t){Zt.asn1.ocsp.ResponseBytes.superclass.constructor.call(this);var e=Zt.asn1,r=e.DERSequence,n=e.DERObjectIdentifier,i=e.DEROctetString,s=e.ocsp.BasicOCSPResponse;this.params=null,this.setByParam=function(t){this.params=t},this.tohex=function(){var t=this.params;if("ocspBasic"!=t.restype)throw new Error("not supported responseType: "+t.restype);var e=new s(t),a=[];return a.push(new n({name:"ocspBasic"})),a.push(new i({hex:e.tohex()})),new r({array:a}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&this.setByParam(t)},je(Zt.asn1.ocsp.ResponseBytes,Zt.asn1.ASN1Object),Zt.asn1.ocsp.BasicOCSPResponse=function(t){Zt.asn1.ocsp.BasicOCSPResponse.superclass.constructor.call(this);var e=Error,r=Zt.asn1,n=r.ASN1Object,i=r.DERSequence,s=r.DERTaggedObject,a=r.DERBitString,o=r.x509.AlgorithmIdentifier,u=r.ocsp;_SingleResponseList=u.SingleResponseList,_ResponseData=u.ResponseData,this.params=null,this.setByParam=function(t){this.params=t},this.sign=function(){var t=this.params,e=t.tbsresp.tohex(),r=new Zt.crypto.Signature({alg:t.sigalg});r.init(t.reskey),r.updateHex(e),t.sighex=r.sign()},this.tohex=function(){var t=this.params;null==t.tbsresp&&(t.tbsresp=new _ResponseData(t)),null==t.sighex&&null!=t.reskey&&this.sign();var r=[];if(r.push(t.tbsresp),r.push(new o({name:t.sigalg})),r.push(new a({hex:"00"+t.sighex})),null!=t.certs&&null!=t.certs.length){for(var u=[],c=0;c<t.certs.length;c++){var h=t.certs[c],l=null;if(ee.isASN1HEX(h))l=h;else{if(!h.match(/-----BEGIN/))throw new e("certs["+c+"] not hex or PEM");l=ge(h)}u.push(new n({tlv:l}))}var f=new i({array:u});r.push(new s({tag:"a0",explicit:!0,obj:f}))}return new i({array:r}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&this.setByParam(t)},je(Zt.asn1.ocsp.BasicOCSPResponse,Zt.asn1.ASN1Object),Zt.asn1.ocsp.ResponseData=function(t){Zt.asn1.ocsp.ResponseData.superclass.constructor.call(this);var e=Zt.asn1,r=e.DERSequence,n=e.DERGeneralizedTime,i=e.DERTaggedObject,s=e.x509.Extensions,a=e.ocsp,o=a.ResponderID;_SingleResponseList=a.SingleResponseList,this.params=null,this.tohex=function(){var t=this.params,e=[];if(e.push(new o(t.respid)),e.push(new n(t.prodat)),e.push(new _SingleResponseList(t.array)),null!=t.ext){var a=new s(t.ext);e.push(new i({tag:"a1",explicit:!0,obj:a}))}return new r({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(t){this.params=t},void 0!==t&&this.setByParam(t)},je(Zt.asn1.ocsp.ResponseData,Zt.asn1.ASN1Object),Zt.asn1.ocsp.ResponderID=function(t){Zt.asn1.ocsp.ResponderID.superclass.constructor.call(this);var e=Zt,r=e.asn1,n=r.ASN1Util.newObject,i=r.x509.X500Name,s=e.lang.String.isHex,a=Error;this.params=null,this.tohex=function(){var t=this.params;if(null!=t.key){var e,r=null;if("string"==typeof t.key){if(s(t.key)&&(r=t.key),t.key.match(/-----BEGIN CERTIFICATE/))null!=(e=new qe(t.key).getExtSubjectKeyIdentifier())&&(r=e.kid.hex)}else if(t.key instanceof qe)null!=(e=t.key.getExtSubjectKeyIdentifier())&&(r=e.kid.hex);if(null==r)throw new a("wrong key member value");return n({tag:{tag:"a2",explicit:!0,obj:{octstr:{hex:r}}}}).tohex()}if(null!=t.name){var o=null;if("string"==typeof t.name&&t.name.match(/-----BEGIN CERTIFICATE/))o=new qe(t.name).getSubject();else t.name instanceof qe?o=t.name.getSubject():"object"!=typeof t.name||null==t.name.array&&null==t.name.str||(o=t.name);if(null==o)throw new a("wrong name member value");return n({tag:{tag:"a1",explicit:!0,obj:new i(o)}}).tohex()}throw new a("key or name not specified")},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(t){this.params=t},void 0!==t&&this.setByParam(t)},je(Zt.asn1.ocsp.ResponderID,Zt.asn1.ASN1Object),Zt.asn1.ocsp.SingleResponseList=function(t){Zt.asn1.ocsp.SingleResponseList.superclass.constructor.call(this);var e=Zt.asn1,r=e.DERSequence,n=e.ocsp.SingleResponse;this.params=null,this.tohex=function(){var t=this.params;if("object"!=typeof t||null==t.length)throw new Error("params not specified properly");for(var e=[],i=0;i<t.length;i++)e.push(new n(t[i]));return new r({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(t){this.params=t},void 0!==t&&this.setByParam(t)},je(Zt.asn1.ocsp.SingleResponseList,Zt.asn1.ASN1Object),Zt.asn1.ocsp.SingleResponse=function(t){var e=Error,r=Zt.asn1,n=r.DERSequence,i=r.DERGeneralizedTime,s=r.DERTaggedObject,a=r.ocsp,o=a.CertID,u=a.CertStatus,c=r.x509.Extensions;a.SingleResponse.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params,r=[];if(null==t.certid)throw new e("certid unspecified");if(null==t.status)throw new e("status unspecified");if(null==t.thisupdate)throw new e("thisupdate unspecified");if(r.push(new o(t.certid)),r.push(new u(t.status)),r.push(new i(t.thisupdate)),null!=t.nextupdate){var a=new i(t.nextupdate);r.push(new s({tag:"a0",explicit:!0,obj:a}))}if(null!=t.ext){var h=new c(t.ext);r.push(new s({tag:"a1",explicit:!0,obj:h}))}return new n({array:r}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(t){this.params=t},void 0!==t&&this.setByParam(t)},je(Zt.asn1.ocsp.SingleResponse,Zt.asn1.ASN1Object),Zt.asn1.ocsp.CertID=function(t){var e=Zt,r=e.asn1,n=r.DEROctetString,i=r.DERInteger,s=r.DERSequence,a=r.x509.AlgorithmIdentifier,o=r.ocsp,u=e.crypto.Util.hashHex,c=qe,h=ee.getVbyList;o.CertID.superclass.constructor.call(this),this.DEFAULT_HASH="sha1",this.params=null,this.setByValue=function(t,e,r,n){null==n&&(n=this.DEFAULT_HASH),this.params={alg:n,issname:t,isskey:e,sbjsn:r}},this.setByCert=function(t,e,r){null==r&&(r=this.DEFAULT_HASH),this.params={alg:r,issuerCert:t,subjectCert:e}},this.getParamByCerts=function(t,e,r){null==r&&(r=this.DEFAULT_HASH);var n=new c(t),i=new c(e),s=u(n.getSubjectHex(),r),a=n.getPublicKeyHex();return{alg:r,issname:s,isskey:u(h(a,0,[1],"03",!0),r),sbjsn:i.getSerialNumberHex()}},this.tohex=function(){if("object"!=typeof this.params)throw new Error("params not set");var t,e,r,o,u=this.params;if(o=null==u.alg?this.DEFAULT_HASH:u.alg,null!=u.issuerCert&&null!=u.subjectCert){var c=this.getParamByCerts(u.issuerCert,u.subjectCert,o);t=c.issname,e=c.isskey,r=c.sbjsn}else{if(null==u.issname||null==u.isskey||null==u.sbjsn)throw new Error("required param members not defined");t=u.issname,e=u.isskey,r=u.sbjsn}var h=new a({name:o}),l=new n({hex:t}),f=new n({hex:e}),p=new i({hex:r}),g=new s({array:[h,l,f,p]});return this.hTLV=g.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&this.setByParam(t)},je(Zt.asn1.ocsp.CertID,Zt.asn1.ASN1Object),Zt.asn1.ocsp.CertStatus=function(t){Zt.asn1.ocsp.CertStatus.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params;if("good"==t.status)return"8000";if("unknown"==t.status)return"8200";if("revoked"==t.status){var e=[{gentime:{str:t.time}}];null!=t.reason&&e.push({tag:{tag:"a0",explicit:!0,obj:{enum:{int:t.reason}}}});var r={tag:"a1",explicit:!1,obj:{seq:e}};return Zt.asn1.ASN1Util.newObject({tag:r}).tohex()}throw new Error("bad status")},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(t){this.params=t},void 0!==t&&this.setByParam(t)},je(Zt.asn1.ocsp.CertStatus,Zt.asn1.ASN1Object),Zt.asn1.ocsp.Request=function(t){var e=Zt.asn1,r=e.DERSequence,n=e.ocsp;if(n.Request.superclass.constructor.call(this),this.dReqCert=null,this.dExt=null,this.tohex=function(){var t=[];if(null===this.dReqCert)throw"reqCert not set";t.push(this.dReqCert);var e=new r({array:t});return this.hTLV=e.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},void 0!==t){var i=new n.CertID(t);this.dReqCert=i}},je(Zt.asn1.ocsp.Request,Zt.asn1.ASN1Object),Zt.asn1.ocsp.TBSRequest=function(t){var e=Zt.asn1,r=e.DERSequence,n=e.ocsp;n.TBSRequest.superclass.constructor.call(this),this.version=0,this.dRequestorName=null,this.dRequestList=[],this.dRequestExt=null,this.setRequestListByParam=function(t){for(var e=[],r=0;r<t.length;r++){var i=new n.Request(t[0]);e.push(i)}this.dRequestList=e},this.tohex=function(){var t=[];if(0!==this.version)throw"not supported version: "+this.version;if(null!==this.dRequestorName)throw"requestorName not supported";var e=new r({array:this.dRequestList});if(t.push(e),null!==this.dRequestExt)throw"requestExtensions not supported";var n=new r({array:t});return this.hTLV=n.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&void 0!==t.reqList&&this.setRequestListByParam(t.reqList)},je(Zt.asn1.ocsp.TBSRequest,Zt.asn1.ASN1Object),Zt.asn1.ocsp.OCSPRequest=function(t){var e=Zt.asn1,r=e.DERSequence,n=e.ocsp;if(n.OCSPRequest.superclass.constructor.call(this),this.dTbsRequest=null,this.dOptionalSignature=null,this.tohex=function(){var t=[];if(null===this.dTbsRequest)throw"tbsRequest not set";if(t.push(this.dTbsRequest),null!==this.dOptionalSignature)throw"optionalSignature not supported";var e=new r({array:t});return this.hTLV=e.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&void 0!==t.reqList){var i=new n.TBSRequest(t);this.dTbsRequest=i}},je(Zt.asn1.ocsp.OCSPRequest,Zt.asn1.ASN1Object),Zt.asn1.ocsp.OCSPUtil={},Zt.asn1.ocsp.OCSPUtil.getRequestHex=function(t,e,r){var n=Zt.asn1.ocsp;void 0===r&&(r=n.DEFAULT_HASH);var i={alg:r,issuerCert:t,subjectCert:e};return new n.OCSPRequest({reqList:[i]}).tohex()},Zt.asn1.ocsp.OCSPUtil.getOCSPResponseInfo=function(t){var e=ee,r=e.getVbyList,n=e.getVbyListEx,i=e.getIdxbyList,s=e.getV,a={};try{var o=n(t,0,[0],"0a");a.responseStatus=parseInt(o,16)}catch(t){}if(0!==a.responseStatus)return a;try{var u=i(t,0,[1,0,1,0,0,2,0,1]);"80"===t.substr(u,2)?a.certStatus="good":"a1"===t.substr(u,2)?(a.certStatus="revoked",a.revocationTime=ce(r(t,u,[0]))):"82"===t.substr(u,2)&&(a.certStatus="unknown")}catch(t){}try{var c=i(t,0,[1,0,1,0,0,2,0,2]);a.thisUpdate=ce(s(t,c))}catch(t){}try{var h=i(t,0,[1,0,1,0,0,2,0,3]);"a0"===t.substr(h,2)&&(a.nextUpdate=ce(r(t,h,[0])))}catch(t){}return a},Zt.asn1.ocsp.OCSPParser=function(){var t=Error,e=qe,r=new e,n=ee,i=n.getV,s=n.getTLV,a=n.getIdxbyList,o=n.getVbyList,u=n.getTLVbyList,c=n.getVbyListEx,h=n.getTLVbyListEx,l=n.getChildIdx;this.getOCSPRequest=function(e){var r=l(e,0);if(1!=r.length&&2!=r.length)throw new t("wrong number elements: "+r.length);return this.getTBSRequest(s(e,r[0]))},this.getTBSRequest=function(t){var e={},n=h(t,0,[0],"30");e.array=this.getRequestList(n);var i=h(t,0,["[2]",0],"30");return null!=i&&(e.ext=r.getExtParamArray(i)),e},this.getRequestList=function(t){for(var e=[],r=l(t,0),n=0;n<r.length;n++){t=s(t,r[n]);e.push(this.getRequest(t))}return e},this.getRequest=function(e){var n=l(e,0);if(1!=n.length&&2!=n.length)throw new t("wrong number elements: "+n.length);var i=this.getCertID(s(e,n[0]));if(2==n.length){var o=a(e,0,[1,0]);i.ext=r.getExtParamArray(s(e,o))}return i},this.getCertID=function(r){var n=l(r,0);if(4!=n.length)throw new t("wrong number elements: "+n.length);var a=new e,o={};return o.alg=a.getAlgorithmIdentifierName(s(r,n[0])),o.issname=i(r,n[1]),o.isskey=i(r,n[2]),o.sbjsn=i(r,n[3]),o},this.getOCSPResponse=function(t){var e,r=l(t,0),n=i(t,r[0]),s=parseInt(n);if(1==r.length)return{resstatus:s};var a=u(t,0,[1,0]);return(e=this.getResponseBytes(a)).resstatus=s,e},this.getResponseBytes=function(t){var e,r=l(t,0),n=u(t,0,[1,0]);e=this.getBasicOCSPResponse(n);var s=i(t,r[0]);return e.restype=Zt.asn1.x509.OID.oid2name(Re(s)),e},this.getBasicOCSPResponse=function(t){var e,r=l(t,0);e=this.getResponseData(s(t,r[0]));var n=new qe;e.alg=n.getAlgorithmIdentifierName(s(t,r[1]));var a=i(t,r[2]);e.sighex=a.substr(2);var o=c(t,0,["[0]"]);if(null!=o){for(var u=l(o,0),h=[],f=0;f<u.length;f++){var p=s(o,u[f]);h.push(p)}e.certs=h}return e},this.getResponseData=function(t){var e=l(t,0),r=e.length,n={},a=0;"a0"==t.substr(e[0],2)&&a++,n.respid=this.getResponderID(s(t,e[a++]));var o=i(t,e[a++]);if(n.prodat=ce(o),n.array=this.getSingleResponseList(s(t,e[a++])),"a1"==t.substr(e[r-1],2)){var c=u(t,e[r-1],[0]),h=new qe;n.ext=h.getExtParamArray(c)}return n},this.getResponderID=function(t){var e={};if("a2"==t.substr(0,2)){var r=o(t,0,[0]);e.key=r}if("a1"==t.substr(0,2)){var n=u(t,0,[0]),i=new qe;e.name=i.getX500Name(n)}return e},this.getSingleResponseList=function(t){for(var e=l(t,0),r=[],n=0;n<e.length;n++){var i=this.getSingleResponse(s(t,e[n]));r.push(i)}return r},this.getSingleResponse=function(t){var e=l(t,0),r={},n=this.getCertID(s(t,e[0]));r.certid=n;var a=this.getCertStatus(s(t,e[1]));if(r.status=a,"18"==t.substr(e[2],2)){var c=i(t,e[2]);r.thisupdate=ce(c)}for(var h=3;h<e.length;h++){if("a0"==t.substr(e[h],2)){var f=o(t,e[h],[0],"18");r.nextupdate=ce(f)}if("a1"==t.substr(e[h],2)){var p=new qe,g=u(t,0,[h,0]);r.ext=p.getExtParamArray(g)}}return r},this.getCertStatus=function(t){var e={};if("8000"==t)return{status:"good"};if("8200"==t)return{status:"unknown"};if("a1"==t.substr(0,2)){e.status="revoked";var r=ce(o(t,0,[0]));e.time=r}return e}},void 0!==Zt&&Zt||(Zt={}),void 0!==Zt.lang&&Zt.lang||(Zt.lang={}),Zt.lang.String=function(){},"function"==typeof Buffer?(Qt=function(t){return ie(Buffer.from(t,"utf8").toString("base64"))},te=function(t){return Buffer.from(se(t),"base64").toString("utf8")}):(Qt=function(t){return ae(ve(Ae(t)))},te=function(t){return decodeURIComponent(me(oe(t)))}),Zt.lang.String.isInteger=function(t){return!!t.match(/^[0-9]+$/)||!!t.match(/^-[0-9]+$/)},Zt.lang.String.isHex=function(t){return Ce(t)},Zt.lang.String.isBase64=function(t){return!(!(t=t.replace(/\s+/g,"")).match(/^[0-9A-Za-z+\/]+={0,3}$/)||t.length%4!=0)},Zt.lang.String.isBase64URL=function(t){return!t.match(/[+/=]/)&&(t=se(t),Zt.lang.String.isBase64(t))},Zt.lang.String.isIntegerArray=function(t){return!!(t=t.replace(/\s+/g,"")).match(/^\[[0-9,]+\]$/)},Zt.lang.String.isPrintable=function(t){return null!==t.match(/^[0-9A-Za-z '()+,-./:=?]*$/)},Zt.lang.String.isIA5=function(t){return null!==t.match(/^[\x20-\x21\x23-\x7f]*$/)},Zt.lang.String.isMail=function(t){return null!==t.match(/^[A-Za-z0-9]{1}[A-Za-z0-9_.-]*@{1}[A-Za-z0-9_.-]{1,}\.[A-Za-z0-9]{1,}$/)};var Oe=function(t,e,r){return null==r&&(r="0"),t.length>=e?t:new Array(e-t.length+1).join(r)+t};function Be(t,e){for(var r=0,n=0;n<t.length;n++)r|=1<<e[t[n]];var i=r.toString(2),s="";for(n=i.length-1;n>=0;n--)s+=i[n];return s}function _e(t,e,r){if("object"==typeof t){e=String(e).split(".");for(var n=0;n<e.length&&t;n++){var i=e[n];i.match(/^[0-9]+$/)&&(i=parseInt(i)),t=t[i]}return t||!1===t?t:r}}function je(t,e){var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t,t.superclass=e.prototype,e.prototype.constructor==Object.prototype.constructor&&(e.prototype.constructor=e)}void 0!==Zt&&Zt||(Zt={}),void 0!==Zt.crypto&&Zt.crypto||(Zt.crypto={}),Zt.crypto.Util=new function(){this.DIGESTINFOHEAD={sha1:"3021300906052b0e03021a05000414",sha224:"302d300d06096086480165030402040500041c",sha256:"3031300d060960864801650304020105000420",sha384:"3041300d060960864801650304020205000430",sha512:"3051300d060960864801650304020305000440",md2:"3020300c06082a864886f70d020205000410",md5:"3020300c06082a864886f70d020505000410",ripemd160:"3021300906052b2403020105000414"},this.DEFAULTPROVIDER={md5:"cryptojs",sha1:"cryptojs",sha224:"cryptojs",sha256:"cryptojs",sha384:"cryptojs",sha512:"cryptojs",ripemd160:"cryptojs",hmacmd5:"cryptojs",hmacsha1:"cryptojs",hmacsha224:"cryptojs",hmacsha256:"cryptojs",hmacsha384:"cryptojs",hmacsha512:"cryptojs",hmacripemd160:"cryptojs",MD5withRSA:"cryptojs/jsrsa",SHA1withRSA:"cryptojs/jsrsa",SHA224withRSA:"cryptojs/jsrsa",SHA256withRSA:"cryptojs/jsrsa",SHA384withRSA:"cryptojs/jsrsa",SHA512withRSA:"cryptojs/jsrsa",RIPEMD160withRSA:"cryptojs/jsrsa",MD5withECDSA:"cryptojs/jsrsa",SHA1withECDSA:"cryptojs/jsrsa",SHA224withECDSA:"cryptojs/jsrsa",SHA256withECDSA:"cryptojs/jsrsa",SHA384withECDSA:"cryptojs/jsrsa",SHA512withECDSA:"cryptojs/jsrsa",RIPEMD160withECDSA:"cryptojs/jsrsa",SHA1withDSA:"cryptojs/jsrsa",SHA224withDSA:"cryptojs/jsrsa",SHA256withDSA:"cryptojs/jsrsa",MD5withRSAandMGF1:"cryptojs/jsrsa",SHAwithRSAandMGF1:"cryptojs/jsrsa",SHA1withRSAandMGF1:"cryptojs/jsrsa",SHA224withRSAandMGF1:"cryptojs/jsrsa",SHA256withRSAandMGF1:"cryptojs/jsrsa",SHA384withRSAandMGF1:"cryptojs/jsrsa",SHA512withRSAandMGF1:"cryptojs/jsrsa",RIPEMD160withRSAandMGF1:"cryptojs/jsrsa"},this.CRYPTOJSMESSAGEDIGESTNAME={md5:st.algo.MD5,sha1:st.algo.SHA1,sha224:st.algo.SHA224,sha256:st.algo.SHA256,sha384:st.algo.SHA384,sha512:st.algo.SHA512,ripemd160:st.algo.RIPEMD160},this.getDigestInfoHex=function(t,e){if(void 0===this.DIGESTINFOHEAD[e])throw"alg not supported in Util.DIGESTINFOHEAD: "+e;return this.DIGESTINFOHEAD[e]+t},this.getPaddedDigestInfoHex=function(t,e,r){var n=this.getDigestInfoHex(t,e),i=r/4;if(n.length+22>i)throw"key is too short for SigAlg: keylen="+r+","+e;for(var s="0001",a="00"+n,o="",u=i-4-a.length,c=0;c<u;c+=2)o+="ff";return s+o+a},this.hashString=function(t,e){return new Zt.crypto.MessageDigest({alg:e}).digestString(t)},this.hashHex=function(t,e){return new Zt.crypto.MessageDigest({alg:e}).digestHex(t)},this.sha1=function(t){return this.hashString(t,"sha1")},this.sha256=function(t){return this.hashString(t,"sha256")},this.sha256Hex=function(t){return this.hashHex(t,"sha256")},this.sha512=function(t){return this.hashString(t,"sha512")},this.sha512Hex=function(t){return this.hashHex(t,"sha512")},this.isKey=function(t){return t instanceof Gt||t instanceof Zt.crypto.DSA||t instanceof Zt.crypto.ECDSA}},Zt.crypto.Util.md5=function(t){return new Zt.crypto.MessageDigest({alg:"md5",prov:"cryptojs"}).digestString(t)},Zt.crypto.Util.ripemd160=function(t){return new Zt.crypto.MessageDigest({alg:"ripemd160",prov:"cryptojs"}).digestString(t)},Zt.crypto.Util.SECURERANDOMGEN=new zt,Zt.crypto.Util.getRandomHexOfNbytes=function(t){var e=new Array(t);return Zt.crypto.Util.SECURERANDOMGEN.nextBytes(e),re(e)},Zt.crypto.Util.getRandomBigIntegerOfNbytes=function(t){return new ht(Zt.crypto.Util.getRandomHexOfNbytes(t),16)},Zt.crypto.Util.getRandomHexOfNbits=function(t){var e=t%8,r=new Array((t-e)/8+1);return Zt.crypto.Util.SECURERANDOMGEN.nextBytes(r),r[0]=(255<<e&255^255)&r[0],re(r)},Zt.crypto.Util.getRandomBigIntegerOfNbits=function(t){return new ht(Zt.crypto.Util.getRandomHexOfNbits(t),16)},Zt.crypto.Util.getRandomBigIntegerZeroToMax=function(t){for(var e=t.bitLength();;){var r=Zt.crypto.Util.getRandomBigIntegerOfNbits(e);if(t.compareTo(r)>=0)return r}},Zt.crypto.Util.getRandomBigIntegerMinToMax=function(t,e){var r=t.compareTo(e);if(r>0)throw"biMin is greater than biMax";if(0==r)return t;var n=e.subtract(t);return Zt.crypto.Util.getRandomBigIntegerZeroToMax(n).add(t)},Zt.crypto.MessageDigest=function(t){this.setAlgAndProvider=function(t,e){if(null!==(t=Zt.crypto.MessageDigest.getCanonicalAlgName(t))&&void 0===e&&(e=Zt.crypto.Util.DEFAULTPROVIDER[t]),-1!=":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(t)&&"cryptojs"==e){try{this.md=Zt.crypto.Util.CRYPTOJSMESSAGEDIGESTNAME[t].create()}catch(e){throw"setAlgAndProvider hash alg set fail alg="+t+"/"+e}this.updateString=function(t){this.md.update(t)},this.updateHex=function(t){var e=st.enc.Hex.parse(t);this.md.update(e)},this.digest=function(){return this.md.finalize().toString(st.enc.Hex)},this.digestString=function(t){return this.updateString(t),this.digest()},this.digestHex=function(t){return this.updateHex(t),this.digest()}}if(-1!=":sha256:".indexOf(t)&&"sjcl"==e){try{this.md=new sjcl.hash.sha256}catch(e){throw"setAlgAndProvider hash alg set fail alg="+t+"/"+e}this.updateString=function(t){this.md.update(t)},this.updateHex=function(t){var e=sjcl.codec.hex.toBits(t);this.md.update(e)},this.digest=function(){var t=this.md.finalize();return sjcl.codec.hex.fromBits(t)},this.digestString=function(t){return this.updateString(t),this.digest()},this.digestHex=function(t){return this.updateHex(t),this.digest()}}},this.updateString=function(t){throw"updateString(str) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.updateHex=function(t){throw"updateHex(hex) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.digest=function(){throw"digest() not supported for this alg/prov: "+this.algName+"/"+this.provName},this.digestString=function(t){throw"digestString(str) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.digestHex=function(t){throw"digestHex(hex) not supported for this alg/prov: "+this.algName+"/"+this.provName},void 0!==t&&void 0!==t.alg&&(this.algName=t.alg,void 0===t.prov&&(this.provName=Zt.crypto.Util.DEFAULTPROVIDER[this.algName]),this.setAlgAndProvider(this.algName,this.provName))},Zt.crypto.MessageDigest.getCanonicalAlgName=function(t){return"string"==typeof t&&(t=(t=t.toLowerCase()).replace(/-/,"")),t},Zt.crypto.MessageDigest.getHashLength=function(t){var e=Zt.crypto.MessageDigest,r=e.getCanonicalAlgName(t);if(void 0===e.HASHLENGTH[r])throw"not supported algorithm: "+t;return e.HASHLENGTH[r]},Zt.crypto.MessageDigest.HASHLENGTH={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,ripemd160:20},Zt.crypto.Mac=function(t){this.setAlgAndProvider=function(t,e){if(null==(t=t.toLowerCase())&&(t="hmacsha1"),"hmac"!=(t=t.toLowerCase()).substr(0,4))throw"setAlgAndProvider unsupported HMAC alg: "+t;void 0===e&&(e=Zt.crypto.Util.DEFAULTPROVIDER[t]),this.algProv=t+"/"+e;var r=t.substr(4);if(-1!=":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(r)&&"cryptojs"==e){try{var n=Zt.crypto.Util.CRYPTOJSMESSAGEDIGESTNAME[r];this.mac=st.algo.HMAC.create(n,this.pass)}catch(t){throw"setAlgAndProvider hash alg set fail hashAlg="+r+"/"+t}this.updateString=function(t){this.mac.update(t)},this.updateHex=function(t){var e=st.enc.Hex.parse(t);this.mac.update(e)},this.doFinal=function(){return this.mac.finalize().toString(st.enc.Hex)},this.doFinalString=function(t){return this.updateString(t),this.doFinal()},this.doFinalHex=function(t){return this.updateHex(t),this.doFinal()}}},this.updateString=function(t){throw"updateString(str) not supported for this alg/prov: "+this.algProv},this.updateHex=function(t){throw"updateHex(hex) not supported for this alg/prov: "+this.algProv},this.doFinal=function(){throw"digest() not supported for this alg/prov: "+this.algProv},this.doFinalString=function(t){throw"digestString(str) not supported for this alg/prov: "+this.algProv},this.doFinalHex=function(t){throw"digestHex(hex) not supported for this alg/prov: "+this.algProv},this.setPassword=function(t){if("string"==typeof t){var e=t;return t.length%2!=1&&t.match(/^[0-9A-Fa-f]+$/)||(e=fe(t)),void(this.pass=st.enc.Hex.parse(e))}if("object"!=typeof t)throw"KJUR.crypto.Mac unsupported password type: "+t;e=null;if(void 0!==t.hex){if(t.hex.length%2!=0||!t.hex.match(/^[0-9A-Fa-f]+$/))throw"Mac: wrong hex password: "+t.hex;e=t.hex}if(void 0!==t.utf8&&(e=ue(t.utf8)),void 0!==t.rstr&&(e=fe(t.rstr)),void 0!==t.b64&&(e=ct(t.b64)),void 0!==t.b64u&&(e=oe(t.b64u)),null==e)throw"KJUR.crypto.Mac unsupported password type: "+t;this.pass=st.enc.Hex.parse(e)},void 0!==t&&(void 0!==t.pass&&this.setPassword(t.pass),void 0!==t.alg&&(this.algName=t.alg,void 0===t.prov&&(this.provName=Zt.crypto.Util.DEFAULTPROVIDER[this.algName]),this.setAlgAndProvider(this.algName,this.provName)))},Zt.crypto.Signature=function(t){var e=null;if(this._setAlgNames=function(){var t=this.algName.match(/^(.+)with(.+)$/);t&&(this.mdAlgName=t[1].toLowerCase(),this.pubkeyAlgName=t[2].toLowerCase(),"rsaandmgf1"==this.pubkeyAlgName&&"sha"==this.mdAlgName&&(this.mdAlgName="sha1"))},this._zeroPaddingOfSignature=function(t,e){for(var r="",n=e/4-t.length,i=0;i<n;i++)r+="0";return r+t},this.setAlgAndProvider=function(t,e){if(this._setAlgNames(),"cryptojs/jsrsa"!=e)throw new Error("provider not supported: "+e);if(-1!=":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(this.mdAlgName)){try{this.md=new Zt.crypto.MessageDigest({alg:this.mdAlgName})}catch(t){throw new Error("setAlgAndProvider hash alg set fail alg="+this.mdAlgName+"/"+t)}this.init=function(t,e){var r=null;try{r=void 0===e?He.getKey(t):He.getKey(t,e)}catch(t){throw"init failed:"+t}if(!0===r.isPrivate)this.prvKey=r,this.state="SIGN";else{if(!0!==r.isPublic)throw"init failed.:"+r;this.pubKey=r,this.state="VERIFY"}},this.updateString=function(t){this.md.updateString(t)},this.updateHex=function(t){this.md.updateHex(t)},this.sign=function(){if(this.sHashHex=this.md.digest(),void 0===this.prvKey&&void 0!==this.ecprvhex&&void 0!==this.eccurvename&&void 0!==Zt.crypto.ECDSA&&(this.prvKey=new Zt.crypto.ECDSA({curve:this.eccurvename,prv:this.ecprvhex})),this.prvKey instanceof Gt&&"rsaandmgf1"===this.pubkeyAlgName)this.hSign=this.prvKey.signWithMessageHashPSS(this.sHashHex,this.mdAlgName,this.pssSaltLen);else if(this.prvKey instanceof Gt&&"rsa"===this.pubkeyAlgName)this.hSign=this.prvKey.signWithMessageHash(this.sHashHex,this.mdAlgName);else if(this.prvKey instanceof Zt.crypto.ECDSA)this.hSign=this.prvKey.signWithMessageHash(this.sHashHex);else{if(!(this.prvKey instanceof Zt.crypto.DSA))throw"Signature: unsupported private key alg: "+this.pubkeyAlgName;this.hSign=this.prvKey.signWithMessageHash(this.sHashHex)}return this.hSign},this.signString=function(t){return this.updateString(t),this.sign()},this.signHex=function(t){return this.updateHex(t),this.sign()},this.verify=function(t){if(this.sHashHex=this.md.digest(),void 0===this.pubKey&&void 0!==this.ecpubhex&&void 0!==this.eccurvename&&void 0!==Zt.crypto.ECDSA&&(this.pubKey=new Zt.crypto.ECDSA({curve:this.eccurvename,pub:this.ecpubhex})),this.pubKey instanceof Gt&&"rsaandmgf1"===this.pubkeyAlgName)return this.pubKey.verifyWithMessageHashPSS(this.sHashHex,t,this.mdAlgName,this.pssSaltLen);if(this.pubKey instanceof Gt&&"rsa"===this.pubkeyAlgName)return this.pubKey.verifyWithMessageHash(this.sHashHex,t);if(void 0!==Zt.crypto.ECDSA&&this.pubKey instanceof Zt.crypto.ECDSA)return this.pubKey.verifyWithMessageHash(this.sHashHex,t);if(void 0!==Zt.crypto.DSA&&this.pubKey instanceof Zt.crypto.DSA)return this.pubKey.verifyWithMessageHash(this.sHashHex,t);throw"Signature: unsupported public key alg: "+this.pubkeyAlgName}}},this.init=function(t,e){throw"init(key, pass) not supported for this alg:prov="+this.algProvName},this.updateString=function(t){throw"updateString(str) not supported for this alg:prov="+this.algProvName},this.updateHex=function(t){throw"updateHex(hex) not supported for this alg:prov="+this.algProvName},this.sign=function(){throw"sign() not supported for this alg:prov="+this.algProvName},this.signString=function(t){throw"digestString(str) not supported for this alg:prov="+this.algProvName},this.signHex=function(t){throw"digestHex(hex) not supported for this alg:prov="+this.algProvName},this.verify=function(t){throw"verify(hSigVal) not supported for this alg:prov="+this.algProvName},this.initParams=t,void 0!==t&&(void 0!==t.alg&&(this.algName=t.alg,void 0===t.prov?this.provName=Zt.crypto.Util.DEFAULTPROVIDER[this.algName]:this.provName=t.prov,this.algProvName=this.algName+":"+this.provName,this.setAlgAndProvider(this.algName,this.provName),this._setAlgNames()),void 0!==t.psssaltlen&&(this.pssSaltLen=t.psssaltlen),void 0!==t.prvkeypem)){if(void 0!==t.prvkeypas)throw"both prvkeypem and prvkeypas parameters not supported";try{e=He.getKey(t.prvkeypem);this.init(e)}catch(t){throw"fatal error to load pem private key: "+t}}},Zt.crypto.Cipher=function(t){},Zt.crypto.Cipher.encrypt=function(t,e,r,n){if(null!=_e(n,"enclag")&&(r=n.encalg),"string"==typeof r&&"-CBC"==r.substr(-4)){var i=e,s=t;null!=_e(n,"key")&&(i=n.key),null!=_e(n,"enc")&&(hEnc=n.enc);var a,o=st.enc.Hex.parse(i),u=st.enc.Hex.parse(s),c=st.enc.Hex.parse(n.iv);if("des-EDE3-CBC"==r)a=st.TripleDES.encrypt(u,o,{iv:c});else{if("aes128-CBC"!=r&&"aes256-CBC"!=r)throw new Error("unsupported algorithm: "+r);a=st.AES.encrypt(u,o,{iv:c})}return a+""}throw new Error("Cipher.encrypt: unsupported key or algorithm")},Zt.crypto.Cipher.decrypt=function(t,e,r,n){if(null!=_e(n,"enclag")&&(r=n.encalg),"string"==typeof r&&"-CBC"==r.substr(-4)){var i=e,s=t;null!=_e(n,"key")&&(i=n.key),null!=_e(n,"enc")&&(s=n.enc);var a,o=st.enc.Hex.parse(i),u=st.enc.Hex.parse(s),c=st.enc.Hex.parse(n.iv);if("des-EDE3-CBC"==r)a=st.TripleDES.decrypt({ciphertext:u},o,{iv:c});else{if("aes128-CBC"!=r&&"aes256-CBC"!=r)throw new Error("unsupported algorithm: "+r);a=st.AES.decrypt({ciphertext:u},o,{iv:c})}return st.enc.Hex.stringify(a)}throw new Error("Cipher.decrypt: unsupported key or algorithm")},Zt.crypto.OID=new function(){this.oidhex2name={"2a864886f70d010101":"rsaEncryption","2a8648ce3d0201":"ecPublicKey","2a8648ce380401":"dsa","2a8648ce3d030107":"secp256r1","2b8104001f":"secp192k1","2b81040021":"secp224r1","2b8104000a":"secp256k1","2b81040022":"secp384r1","2b81040023":"secp521r1","2a8648ce380403":"SHA1withDSA","608648016503040301":"SHA224withDSA","608648016503040302":"SHA256withDSA"}},void 0!==Zt&&Zt||(Zt={}),void 0!==Zt.crypto&&Zt.crypto||(Zt.crypto={}),Zt.crypto.ECDSA=function(t){var e=Error,r=ht,n=Jt,i=Zt.crypto.ECDSA,s=Zt.crypto.ECParameterDB,a=i.getName,o=ee,u=o.getVbyListEx,c=o.isASN1HEX,h=new zt;this.type="EC",this.isPrivate=!1,this.isPublic=!1,this.getBigRandom=function(t){return new r(t.bitLength(),h).mod(t.subtract(r.ONE)).add(r.ONE)},this.setNamedCurve=function(t){this.ecparams=s.getByName(t),this.prvKeyHex=null,this.pubKeyHex=null,this.curveName=t},this.setPrivateKeyHex=function(t){this.isPrivate=!0,this.prvKeyHex=t},this.setPublicKeyHex=function(t){this.isPublic=!0,this.pubKeyHex=t},this.getPublicKeyXYHex=function(){var t=this.pubKeyHex;if("04"!==t.substr(0,2))throw"this method supports uncompressed format(04) only";var e=this.ecparams.keycharlen;if(t.length!==2+2*e)throw"malformed public key hex length";var r={};return r.x=t.substr(2,e),r.y=t.substr(2+e),r},this.getShortNISTPCurveName=function(){var t=this.curveName;return"secp256r1"===t||"NIST P-256"===t||"P-256"===t||"prime256v1"===t?"P-256":"secp384r1"===t||"NIST P-384"===t||"P-384"===t?"P-384":"secp521r1"===t||"NIST P-521"===t||"P-521"===t?"P-521":null},this.generateKeyPairHex=function(){var t=this.ecparams.n,e=this.getBigRandom(t),r=this.ecparams.keycharlen,n=("0000000000"+e.toString(16)).slice(-r);return this.setPrivateKeyHex(n),{ecprvhex:n,ecpubhex:this.generatePublicKeyHex()}},this.generatePublicKeyHex=function(){var t=new r(this.prvKeyHex,16),e=this.ecparams.G.multiply(t),n=e.getX().toBigInteger(),i=e.getY().toBigInteger(),s=this.ecparams.keycharlen,a="04"+("0000000000"+n.toString(16)).slice(-s)+("0000000000"+i.toString(16)).slice(-s);return this.setPublicKeyHex(a),a},this.signWithMessageHash=function(t){return this.signHex(t,this.prvKeyHex)},this.signHex=function(t,e){var n=new r(e,16),s=this.ecparams.n,a=new r(t.substring(0,this.ecparams.keycharlen),16);do{var o=this.getBigRandom(s),u=this.ecparams.G.multiply(o).getX().toBigInteger().mod(s)}while(u.compareTo(r.ZERO)<=0);var c=o.modInverse(s).multiply(a.add(n.multiply(u))).mod(s);return i.biRSSigToASN1Sig(u,c)},this.sign=function(t,e){var n=e,i=this.ecparams.n,s=r.fromByteArrayUnsigned(t);do{var a=this.getBigRandom(i),o=this.ecparams.G.multiply(a).getX().toBigInteger().mod(i)}while(o.compareTo(ht.ZERO)<=0);var u=a.modInverse(i).multiply(s.add(n.multiply(o))).mod(i);return this.serializeSig(o,u)},this.verifyWithMessageHash=function(t,e){return this.verifyHex(t,e,this.pubKeyHex)},this.verifyHex=function(t,e,s){try{var a,o,u=i.parseSigHex(e);a=u.r,o=u.s;var c=n.decodeFromHex(this.ecparams.curve,s),h=new r(t.substring(0,this.ecparams.keycharlen),16);return this.verifyRaw(h,a,o,c)}catch(t){return!1}},this.verify=function(t,e,i){var s,a,o;if(Bitcoin.Util.isArray(e)){var u=this.parseSig(e);s=u.r,a=u.s}else{if("object"!=typeof e||!e.r||!e.s)throw"Invalid value for signature";s=e.r,a=e.s}if(i instanceof Jt)o=i;else{if(!Bitcoin.Util.isArray(i))throw"Invalid format for pubkey value, must be byte array or ECPointFp";o=n.decodeFrom(this.ecparams.curve,i)}var c=r.fromByteArrayUnsigned(t);return this.verifyRaw(c,s,a,o)},this.verifyRaw=function(t,e,n,i){var s=this.ecparams.n,a=this.ecparams.G;if(e.compareTo(r.ONE)<0||e.compareTo(s)>=0)return!1;if(n.compareTo(r.ONE)<0||n.compareTo(s)>=0)return!1;var o=n.modInverse(s),u=t.multiply(o).mod(s),c=e.multiply(o).mod(s);return a.multiply(u).add(i.multiply(c)).getX().toBigInteger().mod(s).equals(e)},this.serializeSig=function(t,e){var r=t.toByteArraySigned(),n=e.toByteArraySigned(),i=[];return i.push(2),i.push(r.length),(i=i.concat(r)).push(2),i.push(n.length),(i=i.concat(n)).unshift(i.length),i.unshift(48),i},this.parseSig=function(t){var e;if(48!=t[0])throw new Error("Signature not a valid DERSequence");if(2!=t[e=2])throw new Error("First element in signature must be a DERInteger");var n=t.slice(e+2,e+2+t[e+1]);if(2!=t[e+=2+t[e+1]])throw new Error("Second element in signature must be a DERInteger");var i=t.slice(e+2,e+2+t[e+1]);return e+=2+t[e+1],{r:r.fromByteArrayUnsigned(n),s:r.fromByteArrayUnsigned(i)}},this.parseSigCompact=function(t){if(65!==t.length)throw"Signature has the wrong length";var e=t[0]-27;if(e<0||e>7)throw"Invalid signature type";var n=this.ecparams.n;return{r:r.fromByteArrayUnsigned(t.slice(1,33)).mod(n),s:r.fromByteArrayUnsigned(t.slice(33,65)).mod(n),i:e}},this.readPKCS5PrvKeyHex=function(t){if(!1===c(t))throw new Error("not ASN.1 hex string");var e,r,n;try{e=u(t,0,["[0]",0],"06"),r=u(t,0,[1],"04");try{n=u(t,0,["[1]",0],"03")}catch(t){}}catch(t){throw new Error("malformed PKCS#1/5 plain ECC private key")}if(this.curveName=a(e),void 0===this.curveName)throw"unsupported curve name";this.setNamedCurve(this.curveName),this.setPublicKeyHex(n),this.setPrivateKeyHex(r),this.isPublic=!1},this.readPKCS8PrvKeyHex=function(t){if(!1===c(t))throw new e("not ASN.1 hex string");var r,n,i;try{u(t,0,[1,0],"06"),r=u(t,0,[1,1],"06"),n=u(t,0,[2,0,1],"04");try{i=u(t,0,[2,0,"[1]",0],"03")}catch(t){}}catch(t){throw new e("malformed PKCS#8 plain ECC private key")}if(this.curveName=a(r),void 0===this.curveName)throw new e("unsupported curve name");this.setNamedCurve(this.curveName),this.setPublicKeyHex(i),this.setPrivateKeyHex(n),this.isPublic=!1},this.readPKCS8PubKeyHex=function(t){if(!1===c(t))throw new e("not ASN.1 hex string");var r,n;try{u(t,0,[0,0],"06"),r=u(t,0,[0,1],"06"),n=u(t,0,[1],"03")}catch(t){throw new e("malformed PKCS#8 ECC public key")}if(this.curveName=a(r),null===this.curveName)throw new e("unsupported curve name");this.setNamedCurve(this.curveName),this.setPublicKeyHex(n)},this.readCertPubKeyHex=function(t,r){if(!1===c(t))throw new e("not ASN.1 hex string");var n,i;try{n=u(t,0,[0,5,0,1],"06"),i=u(t,0,[0,5,1],"03")}catch(t){throw new e("malformed X.509 certificate ECC public key")}if(this.curveName=a(n),null===this.curveName)throw new e("unsupported curve name");this.setNamedCurve(this.curveName),this.setPublicKeyHex(i)},void 0!==t&&void 0!==t.curve&&(this.curveName=t.curve),void 0===this.curveName&&(this.curveName="secp256r1"),this.setNamedCurve(this.curveName),void 0!==t&&(void 0!==t.prv&&this.setPrivateKeyHex(t.prv),void 0!==t.pub&&this.setPublicKeyHex(t.pub))},Zt.crypto.ECDSA.parseSigHex=function(t){var e=Zt.crypto.ECDSA.parseSigHexInHexRS(t);return{r:new ht(e.r,16),s:new ht(e.s,16)}},Zt.crypto.ECDSA.parseSigHexInHexRS=function(t){var e=ee,r=e.getChildIdx,n=e.getV;if(e.checkStrictDER(t,0),"30"!=t.substr(0,2))throw new Error("signature is not a ASN.1 sequence");var i=r(t,0);if(2!=i.length)throw new Error("signature shall have two elements");var s=i[0],a=i[1];if("02"!=t.substr(s,2))throw new Error("1st item not ASN.1 integer");if("02"!=t.substr(a,2))throw new Error("2nd item not ASN.1 integer");return{r:n(t,s),s:n(t,a)}},Zt.crypto.ECDSA.asn1SigToConcatSig=function(t){var e=Zt.crypto.ECDSA.parseSigHexInHexRS(t),r=e.r,n=e.s;if(r.length>=130&&r.length<=134){if(r.length%2!=0)throw Error("unknown ECDSA sig r length error");if(n.length%2!=0)throw Error("unknown ECDSA sig s length error");"00"==r.substr(0,2)&&(r=r.substr(2)),"00"==n.substr(0,2)&&(n=n.substr(2));var i=Math.max(r.length,n.length);return(r=("000000"+r).slice(-i))+(n=("000000"+n).slice(-i))}if("00"==r.substr(0,2)&&r.length%32==2&&(r=r.substr(2)),"00"==n.substr(0,2)&&n.length%32==2&&(n=n.substr(2)),r.length%32==30&&(r="00"+r),n.length%32==30&&(n="00"+n),r.length%32!=0)throw Error("unknown ECDSA sig r length error");if(n.length%32!=0)throw Error("unknown ECDSA sig s length error");return r+n},Zt.crypto.ECDSA.concatSigToASN1Sig=function(t){if(t.length%4!=0)throw Error("unknown ECDSA concatinated r-s sig length error");var e=t.substr(0,t.length/2),r=t.substr(t.length/2);return Zt.crypto.ECDSA.hexRSSigToASN1Sig(e,r)},Zt.crypto.ECDSA.hexRSSigToASN1Sig=function(t,e){var r=new ht(t,16),n=new ht(e,16);return Zt.crypto.ECDSA.biRSSigToASN1Sig(r,n)},Zt.crypto.ECDSA.biRSSigToASN1Sig=function(t,e){var r=Zt.asn1,n=new r.DERInteger({bigint:t}),i=new r.DERInteger({bigint:e});return new r.DERSequence({array:[n,i]}).tohex()},Zt.crypto.ECDSA.getName=function(t){return"2b8104001f"===t?"secp192k1":"2a8648ce3d030107"===t?"secp256r1":"2b8104000a"===t?"secp256k1":"2b81040021"===t?"secp224r1":"2b81040022"===t?"secp384r1":"2b81040023"===t?"secp521r1":-1!=="|secp256r1|NIST P-256|P-256|prime256v1|".indexOf(t)?"secp256r1":-1!=="|secp256k1|".indexOf(t)?"secp256k1":-1!=="|secp224r1|NIST P-224|P-224|".indexOf(t)?"secp224r1":-1!=="|secp384r1|NIST P-384|P-384|".indexOf(t)?"secp384r1":-1!=="|secp521r1|NIST P-521|P-521|".indexOf(t)?"secp521r1":null},void 0!==Zt&&Zt||(Zt={}),void 0!==Zt.crypto&&Zt.crypto||(Zt.crypto={}),Zt.crypto.ECParameterDB=new function(){var t={},e={};function r(t){return new ht(t,16)}this.getByName=function(r){var n=r;if(void 0!==e[n]&&(n=e[r]),void 0!==t[n])return t[n];throw"unregistered EC curve name: "+n},this.regist=function(n,i,s,a,o,u,c,h,l,f,p,g){t[n]={};var d=r(s),v=r(a),m=r(o),y=r(u),w=r(c),x=new Yt(d,v,m),S=x.decodePointHex("04"+h+l);t[n].name=n,t[n].keylen=i,t[n].keycharlen=2*Math.ceil(i/8),t[n].curve=x,t[n].G=S,t[n].n=y,t[n].h=w,t[n].oid=p,t[n].info=g;for(var E=0;E<f.length;E++)e[f[E]]=n}},Zt.crypto.ECParameterDB.regist("secp128r1",128,"FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFF","FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFC","E87579C11079F43DD824993C2CEE5ED3","FFFFFFFE0000000075A30D1B9038A115","1","161FF7528B899B2D0C28607CA52C5B86","CF5AC8395BAFEB13C02DA292DDED7A83",[],"","secp128r1 : SECG curve over a 128 bit prime field"),Zt.crypto.ECParameterDB.regist("secp160k1",160,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73","0","7","0100000000000000000001B8FA16DFAB9ACA16B6B3","1","3B4C382CE37AA192A4019E763036F4F5DD4D7EBB","938CF935318FDCED6BC28286531733C3F03C4FEE",[],"","secp160k1 : SECG curve over a 160 bit prime field"),Zt.crypto.ECParameterDB.regist("secp160r1",160,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFC","1C97BEFC54BD7A8B65ACF89F81D4D4ADC565FA45","0100000000000000000001F4C8F927AED3CA752257","1","4A96B5688EF573284664698968C38BB913CBFC82","23A628553168947D59DCC912042351377AC5FB32",[],"","secp160r1 : SECG curve over a 160 bit prime field"),Zt.crypto.ECParameterDB.regist("secp192k1",192,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFEE37","0","3","FFFFFFFFFFFFFFFFFFFFFFFE26F2FC170F69466A74DEFD8D","1","DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D","9B2F2F6D9C5628A7844163D015BE86344082AA88D95E2F9D",[]),Zt.crypto.ECParameterDB.regist("secp192r1",192,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC","64210519E59C80E70FA7E9AB72243049FEB8DEECC146B9B1","FFFFFFFFFFFFFFFFFFFFFFFF99DEF836146BC9B1B4D22831","1","188DA80EB03090F67CBF20EB43A18800F4FF0AFD82FF1012","07192B95FFC8DA78631011ED6B24CDD573F977A11E794811",[]),Zt.crypto.ECParameterDB.regist("secp224r1",224,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFE","B4050A850C04B3ABF54132565044B0B7D7BFD8BA270B39432355FFB4","FFFFFFFFFFFFFFFFFFFFFFFFFFFF16A2E0B8F03E13DD29455C5C2A3D","1","B70E0CBD6BB4BF7F321390B94A03C1D356C21122343280D6115C1D21","BD376388B5F723FB4C22DFE6CD4375A05A07476444D5819985007E34",[]),Zt.crypto.ECParameterDB.regist("secp256k1",256,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F","0","7","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141","1","79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798","483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8",[]),Zt.crypto.ECParameterDB.regist("secp256r1",256,"FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF","FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC","5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B","FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551","1","6B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C296","4FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5",["NIST P-256","P-256","prime256v1"]),Zt.crypto.ECParameterDB.regist("secp384r1",384,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFC","B3312FA7E23EE7E4988E056BE3F82D19181D9C6EFE8141120314088F5013875AC656398D8A2ED19D2A85C8EDD3EC2AEF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC7634D81F4372DDF581A0DB248B0A77AECEC196ACCC52973","1","AA87CA22BE8B05378EB1C71EF320AD746E1D3B628BA79B9859F741E082542A385502F25DBF55296C3A545E3872760AB7","3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f",["NIST P-384","P-384"]),Zt.crypto.ECParameterDB.regist("secp521r1",521,"1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF","1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC","051953EB9618E1C9A1F929A21A0B68540EEA2DA725B99B315F3B8B489918EF109E156193951EC7E937B1652C0BD3BB1BF073573DF883D2C34F1EF451FD46B503F00","1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA51868783BF2F966B7FCC0148F709A5D03BB5C9B8899C47AEBB6FB71E91386409","1","00C6858E06B70404E9CD9E3ECB662395B4429C648139053FB521F828AF606B4D3DBAA14B5E77EFE75928FE1DC127A2FFA8DE3348B3C1856A429BF97E7E31C2E5BD66","011839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650",["NIST P-521","P-521"]),void 0!==Zt&&Zt||(Zt={}),void 0!==Zt.crypto&&Zt.crypto||(Zt.crypto={}),Zt.crypto.DSA=function(){var t=ee,e=t.getVbyListEx,r=t.isASN1HEX,n=ht,i=ht.ONE;this.p=null,this.q=null,this.g=null,this.y=null,this.x=null,this.type="DSA",this.isPrivate=!1,this.isPublic=!1,this.setPrivate=function(t,e,r,n,i){this.isPrivate=!0,this.p=t,this.q=e,this.g=r,this.y=n,this.x=i},this.setPrivateHex=function(t,e,r,n,i){var s,a,o,u,c;s=new ht(t,16),a=new ht(e,16),o=new ht(r,16),u="string"==typeof n&&n.length>1?new ht(n,16):null,c=new ht(i,16),this.setPrivate(s,a,o,u,c)},this.setPublic=function(t,e,r,n){!function(t,e,r,n){if(null==t||null==e||null==r||null==n)throw new Error("invalid DSA public key");if(i.compareTo(e)>=0||e.compareTo(t)>=0)throw new Error("invalid DSA public key");if(i.compareTo(r)>=0||r.compareTo(t)>=0)throw new Error("invalid DSA public key");if(i.compareTo(n)>=0||n.compareTo(t)>=0)throw new Error("invalid DSA public key");if(0!=r.modPow(e,t).compareTo(i))throw new Error("invalid DSA public key")}(t,e,r,n),this.isPublic=!0,this.p=t,this.q=e,this.g=r,this.y=n,this.x=null},this.setPublicHex=function(t,e,r,n){var i,s,a,o;i=new ht(t,16),s=new ht(e,16),a=new ht(r,16),o=new ht(n,16),this.setPublic(i,s,a,o)},this.signWithMessageHash=function(t){var e,r,n,i=this.p,s=this.q,a=this.g,o=this.x,u=new ht(t.substr(0,s.bitLength()/4),16);do{e=Zt.crypto.Util.getRandomBigIntegerMinToMax(ht.ONE.add(ht.ONE),s.subtract(ht.ONE)),r=a.modPow(e,i).mod(s),n=e.modInverse(s).multiply(u.add(o.multiply(r))).mod(s)}while(0==r.compareTo(ht.ZERO)||0==n.compareTo(ht.ZERO));return Zt.asn1.ASN1Util.jsonToASN1HEX({seq:[{int:{bigint:r}},{int:{bigint:n}}]})},this.verifyWithMessageHash=function(t,e){var r=this.p,n=this.q,i=this.g,s=this.y,a=this.parseASN1Signature(e),o=a[0],u=a[1],c=new ht(t.substr(0,n.bitLength()/4),16);if(ht.ZERO.compareTo(o)>=0||o.compareTo(n)>=0)throw"invalid DSA signature";if(ht.ZERO.compareTo(u)>=0||u.compareTo(n)>=0)throw"invalid DSA signature";var h=u.modInverse(n),l=c.multiply(h).mod(n),f=o.multiply(h).mod(n);return 0==i.modPow(l,r).multiply(s.modPow(f,r)).mod(r).mod(n).compareTo(o)},this.parseASN1Signature=function(t){try{return[new n(e(t,0,[0],"02"),16),new n(e(t,0,[1],"02"),16)]}catch(t){throw new Error("malformed ASN.1 DSA signature")}},this.readPKCS5PrvKeyHex=function(t){var n,i,s,a,o;if(!1===r(t))throw new Error("not ASN.1 hex string");try{n=e(t,0,[1],"02"),i=e(t,0,[2],"02"),s=e(t,0,[3],"02"),a=e(t,0,[4],"02"),o=e(t,0,[5],"02")}catch(t){throw new Error("malformed PKCS#1/5 plain DSA private key")}this.setPrivateHex(n,i,s,a,o)},this.readPKCS8PrvKeyHex=function(t){var n,i,s,a;if(!1===r(t))throw new Error("not ASN.1 hex string");try{n=e(t,0,[1,1,0],"02"),i=e(t,0,[1,1,1],"02"),s=e(t,0,[1,1,2],"02"),a=e(t,0,[2,0],"02")}catch(t){throw new Error("malformed PKCS#8 plain DSA private key")}this.setPrivateHex(n,i,s,null,a)},this.readPKCS8PubKeyHex=function(t){var n,i,s,a;if(!1===r(t))throw new Error("not ASN.1 hex string");try{n=e(t,0,[0,1,0],"02"),i=e(t,0,[0,1,1],"02"),s=e(t,0,[0,1,2],"02"),a=e(t,0,[1,0],"02")}catch(t){throw new Error("malformed PKCS#8 DSA public key")}this.setPublicHex(n,i,s,a)},this.readCertPubKeyHex=function(t,n){var i,s,a,o;if(!1===r(t))throw new Error("not ASN.1 hex string");try{i=e(t,0,[0,5,0,1,0],"02"),s=e(t,0,[0,5,0,1,1],"02"),a=e(t,0,[0,5,0,1,2],"02"),o=e(t,0,[0,5,1,0],"02")}catch(t){throw new Error("malformed X.509 certificate DSA public key")}this.setPublicHex(i,s,a,o)}};var He=function(){var t=function(t,r,n){return e(st.AES,t,r,n)},e=function(t,e,r,n){var i=st.enc.Hex.parse(e),s=st.enc.Hex.parse(r),a=st.enc.Hex.parse(n),o={};o.key=s,o.iv=a,o.ciphertext=i;var u=t.decrypt(o,s,{iv:a});return st.enc.Hex.stringify(u)},r=function(t,e,r){return n(st.AES,t,e,r)},n=function(t,e,r,n){var i=st.enc.Hex.parse(e),s=st.enc.Hex.parse(r),a=st.enc.Hex.parse(n),o=t.encrypt(i,s,{iv:a}),u=st.enc.Hex.parse(o.toString());return st.enc.Base64.stringify(u)},i={"AES-256-CBC":{proc:t,eproc:r,keylen:32,ivlen:16},"AES-192-CBC":{proc:t,eproc:r,keylen:24,ivlen:16},"AES-128-CBC":{proc:t,eproc:r,keylen:16,ivlen:16},"DES-EDE3-CBC":{proc:function(t,r,n){return e(st.TripleDES,t,r,n)},eproc:function(t,e,r){return n(st.TripleDES,t,e,r)},keylen:24,ivlen:8},"DES-CBC":{proc:function(t,r,n){return e(st.DES,t,r,n)},eproc:function(t,e,r){return n(st.DES,t,e,r)},keylen:8,ivlen:8}},s=function(t){var e={},r=t.match(new RegExp("DEK-Info: ([^,]+),([0-9A-Fa-f]+)","m"));r&&(e.cipher=r[1],e.ivsalt=r[2]);var n=t.match(new RegExp("-----BEGIN ([A-Z]+) PRIVATE KEY-----"));n&&(e.type=n[1]);var i=-1,s=0;-1!=t.indexOf("\r\n\r\n")&&(i=t.indexOf("\r\n\r\n"),s=2),-1!=t.indexOf("\n\n")&&(i=t.indexOf("\n\n"),s=1);var a=t.indexOf("-----END");if(-1!=i&&-1!=a){var o=t.substring(i+2*s,a-s);o=o.replace(/\s+/g,""),e.data=o}return e},a=function(t,e,r){for(var n=r.substring(0,16),s=st.enc.Hex.parse(n),a=st.enc.Utf8.parse(e),o=i[t].keylen+i[t].ivlen,u="",c=null;;){var h=st.algo.MD5.create();if(null!=c&&h.update(c),h.update(a),h.update(s),c=h.finalize(),(u+=st.enc.Hex.stringify(c)).length>=2*o)break}var l={};return l.keyhex=u.substr(0,2*i[t].keylen),l.ivhex=u.substr(2*i[t].keylen,2*i[t].ivlen),l},o=function(t,e,r,n){var s=st.enc.Base64.parse(t),a=st.enc.Hex.stringify(s);return(0,i[e].proc)(a,r,n)};return{version:"1.0.0",parsePKCS5PEM:function(t){return s(t)},getKeyAndUnusedIvByPasscodeAndIvsalt:function(t,e,r){return a(t,e,r)},decryptKeyB64:function(t,e,r,n){return o(t,e,r,n)},getDecryptedKeyHex:function(t,e){var r=s(t),n=r.cipher,i=r.ivsalt,u=r.data,c=a(n,e,i).keyhex;return o(u,n,c,i)},getEncryptedPKCS5PEMFromPrvKeyHex:function(t,e,r,n,s){var o="";if(void 0!==n&&null!=n||(n="AES-256-CBC"),void 0===i[n])throw new Error("KEYUTIL unsupported algorithm: "+n);if(void 0===s||null==s){var u=function(t){var e=st.lib.WordArray.random(t);return st.enc.Hex.stringify(e)}(i[n].ivlen);s=u.toUpperCase()}var c=function(t,e,r,n){return(0,i[e].eproc)(t,r,n)}(e,n,a(n,r,s).keyhex,s);o="-----BEGIN "+t+" PRIVATE KEY-----\r\n";return o+="Proc-Type: 4,ENCRYPTED\r\n",o+="DEK-Info: "+n+","+s+"\r\n",o+="\r\n",o+=c.replace(/(.{64})/g,"$1\r\n"),o+="\r\n-----END "+t+" PRIVATE KEY-----\r\n"},getEncryptedPKCS8PEM:function(t,e,r){return pe(this.getEncryptedPKCS8Hex(t,e,r),"ENCRYPTED PRIVATE KEY")},getEncryptedPKCS8Hex:function(t,e,r){var n;(n=null==r||null==r?{}:JSON.parse(JSON.stringify(r))).plain=t,this.initPBES2Param(n),this.encryptPBES2Param(n,e);var i=this.generatePBES2ASN1Param(n);return Zt.asn1.ASN1Util.newObject(i).tohex()},initPBES2Param:function(t){var e;(null==_e(t,"encalg")&&(t.encalg="aes256-CBC"),null==_e(t,"iter")&&(t.iter=2048),null==_e(t,"prf")&&(t.prf="hmacWithSHA256"),null==_e(t,"salt")&&(t.salt=st.enc.Hex.stringify(st.lib.WordArray.random(8))),null==_e(t,"enciv"))&&("des-EDE3-CBC"==t.encalg&&(e=8),"aes128-CBC"==t.encalg&&(e=16),"aes256-CBC"==t.encalg&&(e=16),t.enciv=st.enc.Hex.stringify(st.lib.WordArray.random(e)))},encryptPBES2Param:function(t,e){var r=He.getDKFromPBES2Param(t,e);try{var n=Zt.crypto.Cipher.encrypt(t.plain,r,t.encalg,{iv:t.enciv})}catch(e){throw new Error("encrypt error: "+t.plain+" "+r+" "+t.encalg+" "+t.enciv)}t.enc=n},generatePBES2ASN1Param:function(t){var e={seq:[{seq:[{oid:"pkcs5PBES2"},{seq:[{seq:[{oid:"pkcs5PBKDF2"},{seq:[{octstr:{hex:t.salt}},{int:{hex:Te(t.iter)}}]}]},{seq:[{oid:t.encalg},{octstr:{hex:t.enciv}}]}]}]},{octstr:{hex:t.enc}}]};return"hmacWithSHA1"!=t.prf&&e.seq[0].seq[1].seq[0].seq[1].seq.push({seq:[{oid:t.prf},{null:""}]}),e},parseHexOfEncryptedPKCS8:function(t){var e=ee,r=e.getChildIdx,n=e.getV,i={},s=r(t,0);if(2!=s.length)throw new Error("malformed format: SEQUENCE(0).items != 2: "+s.length);i.ciphertext=n(t,s[1]);var a=r(t,s[0]);if(2!=a.length)throw new Error("malformed format: SEQUENCE(0.0).items != 2: "+a.length);if("2a864886f70d01050d"!=n(t,a[0]))throw new Error("this only supports pkcs5PBES2");var o=r(t,a[1]);if(2!=a.length)throw new Error("malformed format: SEQUENCE(0.0.1).items != 2: "+o.length);var u=r(t,o[1]);if(2!=u.length)throw new Error("malformed format: SEQUENCE(0.0.1.1).items != 2: "+u.length);if("2a864886f70d0307"!=n(t,u[0]))throw"this only supports TripleDES";i.encryptionSchemeAlg="TripleDES",i.encryptionSchemeIV=n(t,u[1]);var c=r(t,o[0]);if(2!=c.length)throw new Error("malformed format: SEQUENCE(0.0.1.0).items != 2: "+c.length);if("2a864886f70d01050c"!=n(t,c[0]))throw new Error("this only supports pkcs5PBKDF2");var h=r(t,c[1]);if(h.length<2)throw new Error("malformed format: SEQUENCE(0.0.1.0.1).items < 2: "+h.length);i.pbkdf2Salt=n(t,h[0]);var l=n(t,h[1]);try{i.pbkdf2Iter=parseInt(l,16)}catch(t){throw new Error("malformed format pbkdf2Iter: "+l)}return i},getPBKDF2KeyHexFromParam:function(t,e){var r=st.enc.Hex.parse(t.pbkdf2Salt),n=t.pbkdf2Iter,i=st.PBKDF2(e,r,{keySize:6,iterations:n});return st.enc.Hex.stringify(i)},_getPlainPKCS8HexFromEncryptedPKCS8PEM:function(t,e){var r=ge(t,"ENCRYPTED PRIVATE KEY"),n=this.parseHexOfEncryptedPKCS8(r),i=He.getPBKDF2KeyHexFromParam(n,e),s={};s.ciphertext=st.enc.Hex.parse(n.ciphertext);var a=st.enc.Hex.parse(i),o=st.enc.Hex.parse(n.encryptionSchemeIV),u=st.TripleDES.decrypt(s,a,{iv:o});return st.enc.Hex.stringify(u)},parsePBES2:function(t){var e=ee.parse(t);if("pkcs5PBES2"!=_e(e,"seq.0.seq.0.oid")||"pkcs5PBKDF2"!=_e(e,"seq.0.seq.1.seq.0.seq.0.oid"))throw new Error("not pkcs5PBES2 and pkcs5PBKDF2 used");var r=_e(e,"seq.0.seq.1.seq.0.seq.1.seq");if(null==r)throw new Error("PBKDF2 parameter not found");var n=_e(r,"0.octstr.hex"),i=_e(r,"1.int.hex"),s=_e(r,"2.seq.0.oid","hmacWithSHA1"),a=-1;try{a=parseInt(i,16)}catch(t){throw new Error("iter not proper value")}var o=_e(e,"seq.0.seq.1.seq.1.seq.0.oid"),u=_e(e,"seq.0.seq.1.seq.1.seq.1.octstr.hex"),c=_e(e,"seq.1.octstr.hex");if(null==o||null==u||null==c)throw new Error("encalg, enciv or enc is undefined");return{salt:n,iter:a,prf:s,encalg:o,enciv:u,enc:c}},getDKFromPBES2Param:function(t,e){var r={hmacWithSHA1:st.algo.SHA1,hmacWithSHA224:st.algo.SHA224,hmacWithSHA256:st.algo.SHA256,hmacWithSHA384:st.algo.SHA384,hmacWithSHA512:st.algo.SHA512}[t.prf];if(null==r)throw new Error("unsupported prf");var n={"des-EDE3-CBC":6,"aes128-CBC":4,"aes256-CBC":8}[t.encalg];if(null==n)throw new Error("unsupported encalg");var i=st.enc.Hex.parse(t.salt),s=t.iter;try{var a=st.PBKDF2(e,i,{keySize:n,iterations:s,hasher:r});return st.enc.Hex.stringify(a)}catch(r){throw new Error("PBKDF2 error: "+r+" "+JSON.stringify(t)+" "+e)}},getPlainHexFromEncryptedPKCS8PEM:function(t,e){if(-1==t.indexOf("BEGIN ENCRYPTED PRIVATE KEY"))throw new Error("not Encrypted PKCS#8 PEM string");var r,n=ge(t);try{r=He.parsePBES2(n)}catch(t){throw new Error("malformed PBES2 format: "+t.message)}var i=He.getDKFromPBES2Param(r,e);return Zt.crypto.Cipher.decrypt(r.enc,i,r.encalg,{iv:r.enciv})},getKeyFromEncryptedPKCS8PEM:function(t,e){var r=this.getPlainHexFromEncryptedPKCS8PEM(t,e);return this.getKeyFromPlainPrivatePKCS8Hex(r)},parsePlainPrivatePKCS8Hex:function(t){var e=ee,r=e.getChildIdx,n=e.getV,i={algparam:null};if("30"!=t.substr(0,2))throw new Error("malformed plain PKCS8 private key(code:001)");var s=r(t,0);if(s.length<3)throw new Error("malformed plain PKCS8 private key(code:002)");if("30"!=t.substr(s[1],2))throw new Error("malformed PKCS8 private key(code:003)");var a=r(t,s[1]);if(2!=a.length)throw new Error("malformed PKCS8 private key(code:004)");if("06"!=t.substr(a[0],2))throw new Error("malformed PKCS8 private key(code:005)");if(i.algoid=n(t,a[0]),"06"==t.substr(a[1],2)&&(i.algparam=n(t,a[1])),"04"!=t.substr(s[2],2))throw new Error("malformed PKCS8 private key(code:006)");return i.keyidx=e.getVidx(t,s[2]),i},getKeyFromPlainPrivatePKCS8PEM:function(t){var e=ge(t,"PRIVATE KEY");return this.getKeyFromPlainPrivatePKCS8Hex(e)},getKeyFromPlainPrivatePKCS8Hex:function(t){var e,r=this.parsePlainPrivatePKCS8Hex(t);if("2a864886f70d010101"==r.algoid)e=new Gt;else if("2a8648ce380401"==r.algoid)e=new Zt.crypto.DSA;else{if("2a8648ce3d0201"!=r.algoid)throw new Error("unsupported private key algorithm");e=new Zt.crypto.ECDSA}return e.readPKCS8PrvKeyHex(t),e},_getKeyFromPublicPKCS8Hex:function(t){var e,r=ee.getVbyList(t,0,[0,0],"06");if("2a864886f70d010101"===r)e=new Gt;else if("2a8648ce380401"===r)e=new Zt.crypto.DSA;else{if("2a8648ce3d0201"!==r)throw new Error("unsupported PKCS#8 public key hex");e=new Zt.crypto.ECDSA}return e.readPKCS8PubKeyHex(t),e},parsePublicRawRSAKeyHex:function(t){var e=ee,r=e.getChildIdx,n=e.getV,i={};if("30"!=t.substr(0,2))throw new Error("malformed RSA key(code:001)");var s=r(t,0);if(2!=s.length)throw new Error("malformed RSA key(code:002)");if("02"!=t.substr(s[0],2))throw new Error("malformed RSA key(code:003)");if(i.n=n(t,s[0]),"02"!=t.substr(s[1],2))throw new Error("malformed RSA key(code:004)");return i.e=n(t,s[1]),i},parsePublicPKCS8Hex:function(t){var e=ee,r=e.getChildIdx,n=e.getV,i={algparam:null},s=r(t,0);if(2!=s.length)throw new Error("outer DERSequence shall have 2 elements: "+s.length);var a=s[0];if("30"!=t.substr(a,2))throw new Error("malformed PKCS8 public key(code:001)");var o=r(t,a);if(2!=o.length)throw new Error("malformed PKCS8 public key(code:002)");if("06"!=t.substr(o[0],2))throw new Error("malformed PKCS8 public key(code:003)");if(i.algoid=n(t,o[0]),"06"==t.substr(o[1],2)?i.algparam=n(t,o[1]):"30"==t.substr(o[1],2)&&(i.algparam={},i.algparam.p=e.getVbyList(t,o[1],[0],"02"),i.algparam.q=e.getVbyList(t,o[1],[1],"02"),i.algparam.g=e.getVbyList(t,o[1],[2],"02")),"03"!=t.substr(s[1],2))throw new Error("malformed PKCS8 public key(code:004)");return i.key=n(t,s[1]).substr(2),i}}}();function ke(t,e){for(var r="",n=e/4-t.length,i=0;i<n;i++)r+="0";return r+t}function Le(t,e,r){for(var n="",i=0;n.length<e;)n+=le(r(fe(t+String.fromCharCode.apply(String,[(4278190080&i)>>24,(16711680&i)>>16,(65280&i)>>8,255&i])))),i+=1;return n}function Ve(t){for(var e in Zt.crypto.Util.DIGESTINFOHEAD){var r=Zt.crypto.Util.DIGESTINFOHEAD[e],n=r.length;if(t.substring(0,n)==r)return[e,t.substring(n)]}return[]}function qe(t){var e,r=ee,n=r.getChildIdx,i=r.getV,s=r.parse,a=r.getTLV,o=r.getVbyList,u=r.getVbyListEx,c=r.getTLVbyList,h=r.getTLVbyListEx,l=r.getIdxbyList,f=r.getIdxbyListEx,p=r.getVidx,g=r.getInt,d=r.oidname,v=r.hextooidstr,m=ge,y=Error;try{e=Zt.asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV}catch(t){}this.HEX2STAG={"0c":"utf8",13:"prn",16:"ia5","1a":"vis","1e":"bmp"},this.hex=null,this.version=0,this.foffset=0,this.aExtInfo=null,this.getVersion=function(){if(null===this.hex||0!==this.version)return this.version;var t=c(this.hex,0,[0,0]);if("a0"==t.substr(0,2)){var e=c(t,0,[0]),r=g(e,0);if(r<0||2<r)throw new Error("malformed version field");return this.version=r+1,this.version}return this.version=1,this.foffset=-1,1},this.getSerialNumberHex=function(){return u(this.hex,0,[0,0],"02")},this.getSignatureAlgorithmField=function(){var t=h(this.hex,0,[0,1]);return this.getAlgorithmIdentifierName(t)},this.getAlgorithmIdentifierName=function(t){for(var r in e)if(t===e[r])return r;return d(u(t,0,[0],"06"))},this.getIssuer=function(t,e){return this.getX500Name(this.getIssuerHex(),t,e)},this.getIssuerHex=function(){return c(this.hex,0,[0,3+this.foffset],"30")},this.getIssuerString=function(){return this.getIssuer().str},this.getSubject=function(t,e){return this.getX500Name(this.getSubjectHex(),t,e)},this.getSubjectHex=function(){return c(this.hex,0,[0,5+this.foffset],"30")},this.getSubjectString=function(){return this.getSubject().str},this.getNotBefore=function(){var t=o(this.hex,0,[0,4+this.foffset,0]);return t=t.replace(/(..)/g,"%$1"),t=decodeURIComponent(t)},this.getNotAfter=function(){var t=o(this.hex,0,[0,4+this.foffset,1]);return t=t.replace(/(..)/g,"%$1"),t=decodeURIComponent(t)},this.getPublicKeyHex=function(){return this.getSPKI()},this.getSPKI=function(){return c(this.hex,0,[0,6+this.foffset],"30")},this.getSPKIValue=function(){var t=this.getSPKI();return null==t?null:o(t,0,[1],"03",!0)},this.getPublicKeyIdx=function(){return l(this.hex,0,[0,6+this.foffset],"30")},this.getPublicKeyContentIdx=function(){var t=this.getPublicKeyIdx();return l(this.hex,t,[1,0],"30")},this.getPublicKey=function(){return He.getKey(this.getPublicKeyHex(),null,"pkcs8pub")},this.getSignatureAlgorithmName=function(){var t=c(this.hex,0,[1],"30");return this.getAlgorithmIdentifierName(t)},this.getSignatureValueHex=function(){return o(this.hex,0,[2],"03",!0)},this.verifySignature=function(t){var e=this.getSignatureAlgorithmField(),r=this.getSignatureValueHex(),n=c(this.hex,0,[0],"30"),i=new Zt.crypto.Signature({alg:e});return i.init(t),i.updateHex(n),i.verify(r)},this.parseExt=function(t){var e,s,a;if(void 0===t){if(a=this.hex,3!==this.version)return-1;e=l(a,0,[0,7,0],"30"),s=n(a,e)}else{a=ge(t);var u=l(a,0,[0,3,0,0],"06");if("2a864886f70d01090e"!=i(a,u))return void(this.aExtInfo=new Array);e=l(a,0,[0,3,0,1,0],"30"),s=n(a,e),this.hex=a}this.aExtInfo=new Array;for(var c=0;c<s.length;c++){var h={critical:!1},f=0;3===n(a,s[c]).length&&(h.critical=!0,f=1),h.oid=r.hextooidstr(o(a,s[c],[0],"06"));var g=l(a,s[c],[1+f]);h.vidx=p(a,g),this.aExtInfo.push(h)}},this.getExtInfo=function(t){var e=this.aExtInfo,r=t;if(t.match(/^[0-9.]+$/)||(r=Zt.asn1.x509.OID.name2oid(t)),""!==r)for(var n=0;n<e.length;n++)if(e[n].oid===r)return e[n]},this.getCriticalExtV=function(t,e,r){if(null!=e)return[e,r];var n=this.getExtInfo(t);return null==n?[null,null]:[a(this.hex,n.vidx),n.critical]},this.getExtBasicConstraints=function(t,e){if(void 0===t&&void 0===e){var r=this.getExtInfo("basicConstraints");if(void 0===r)return;t=a(this.hex,r.vidx),e=r.critical}var n={extname:"basicConstraints"};if(e&&(n.critical=!0),"3000"===t)return n;if("30030101ff"===t)return n.cA=!0,n;if("30060101ff02"===t.substr(0,12)){var s=i(t,10),o=parseInt(s,16);return n.cA=!0,n.pathLen=o,n}throw new Error("hExtV parse error: "+t)},this.getExtNameConstraints=function(t,e){var r=this.getCriticalExtV("nameConstraints",t,e);if(t=r[0],e=r[1],null!=t){var i={extname:"nameConstraints"};e&&(i.critical=!0);for(var s=n(t,0),o=0;o<s.length;o++){for(var u=[],c=n(t,s[o]),h=0;h<c.length;h++){var l=a(t,c[h]),f=this.getGeneralSubtree(l);u.push(f)}var p=t.substr(s[o],2);"a0"==p?i.permit=u:"a1"==p&&(i.exclude=u)}return i}},this.getGeneralSubtree=function(t){var e=n(t,0),r=e.length;if(r<1||2<r)throw new Error("wrong num elements");for(var s=this.getGeneralName(a(t,e[0])),o=1;o<r;o++){var u=t.substr(e[o],2),c=i(t,e[o]),h=parseInt(c,16);"80"==u&&(s.min=h),"81"==u&&(s.max=h)}return s},this.getExtKeyUsage=function(t,e){var r=this.getCriticalExtV("keyUsage",t,e);if(t=r[0],e=r[1],null!=t){var n={extname:"keyUsage"};return e&&(n.critical=!0),n.names=this.getExtKeyUsageString(t).split(","),n}},this.getExtKeyUsageBin=function(t){if(void 0===t){var e=this.getExtInfo("keyUsage");if(void 0===e)return"";t=a(this.hex,e.vidx)}if(8!=t.length&&10!=t.length)throw new Error("malformed key usage value: "+t);var r="000000000000000"+parseInt(t.substr(6),16).toString(2);return 8==t.length&&(r=r.slice(-8)),10==t.length&&(r=r.slice(-16)),""==(r=r.replace(/0+$/,""))&&(r="0"),r},this.getExtKeyUsageString=function(t){for(var e=this.getExtKeyUsageBin(t),r=new Array,n=0;n<e.length;n++)"1"==e.substr(n,1)&&r.push(qe.KEYUSAGE_NAME[n]);return r.join(",")},this.getExtSubjectKeyIdentifier=function(t,e){if(void 0===t&&void 0===e){var r=this.getExtInfo("subjectKeyIdentifier");if(void 0===r)return;t=a(this.hex,r.vidx),e=r.critical}var n={extname:"subjectKeyIdentifier"};e&&(n.critical=!0);var s=i(t,0);return n.kid={hex:s},n},this.getExtAuthorityKeyIdentifier=function(t,e){if(void 0===t&&void 0===e){var r=this.getExtInfo("authorityKeyIdentifier");if(void 0===r)return;t=a(this.hex,r.vidx),e=r.critical}var s={extname:"authorityKeyIdentifier"};e&&(s.critical=!0);for(var o=n(t,0),u=0;u<o.length;u++){var c=t.substr(o[u],2);if("80"===c&&(s.kid={hex:i(t,o[u])}),"a1"===c){var h=a(t,o[u]),l=this.getGeneralNames(h);s.issuer=l[0].dn}"82"===c&&(s.sn={hex:i(t,o[u])})}return s},this.getExtExtKeyUsage=function(t,e){if(void 0===t&&void 0===e){var r=this.getExtInfo("extKeyUsage");if(void 0===r)return;t=a(this.hex,r.vidx),e=r.critical}var s={extname:"extKeyUsage",array:[]};e&&(s.critical=!0);for(var o=n(t,0),u=0;u<o.length;u++)s.array.push(d(i(t,o[u])));return s},this.getExtExtKeyUsageName=function(){var t=this.getExtInfo("extKeyUsage");if(void 0===t)return t;var e=new Array,r=a(this.hex,t.vidx);if(""===r)return e;for(var s=n(r,0),o=0;o<s.length;o++)e.push(d(i(r,s[o])));return e},this.getExtSubjectAltName=function(t,e){if(void 0===t&&void 0===e){var r=this.getExtInfo("subjectAltName");if(void 0===r)return;t=a(this.hex,r.vidx),e=r.critical}var n={extname:"subjectAltName",array:[]};return e&&(n.critical=!0),n.array=this.getGeneralNames(t),n},this.getExtIssuerAltName=function(t,e){if(void 0===t&&void 0===e){var r=this.getExtInfo("issuerAltName");if(void 0===r)return;t=a(this.hex,r.vidx),e=r.critical}var n={extname:"issuerAltName",array:[]};return e&&(n.critical=!0),n.array=this.getGeneralNames(t),n},this.getGeneralNames=function(t){for(var e=n(t,0),r=[],i=0;i<e.length;i++){var s=this.getGeneralName(a(t,e[i]));void 0!==s&&r.push(s)}return r},this.getGeneralName=function(t){var e=t.substr(0,2),r=i(t,0),n=le(r);return"81"==e?{rfc822:n}:"82"==e?{dns:n}:"86"==e?{uri:n}:"87"==e?{ip:xe(r)}:"a4"==e?{dn:this.getX500Name(r)}:"a0"==e?{other:this.getOtherName(t)}:void 0},this.getExtSubjectAltName2=function(){var t,e,r,s=this.getExtInfo("subjectAltName");if(void 0===s)return s;for(var o=new Array,u=a(this.hex,s.vidx),c=n(u,0),h=0;h<c.length;h++)r=u.substr(c[h],2),t=i(u,c[h]),"81"===r&&(e=ce(t),o.push(["MAIL",e])),"82"===r&&(e=ce(t),o.push(["DNS",e])),"84"===r&&(e=qe.hex2dn(t,0),o.push(["DN",e])),"86"===r&&(e=ce(t),o.push(["URI",e])),"87"===r&&(e=xe(t),o.push(["IP",e]));return o},this.getExtCRLDistributionPoints=function(t,e){if(void 0===t&&void 0===e){var r=this.getExtInfo("cRLDistributionPoints");if(void 0===r)return;t=a(this.hex,r.vidx),e=r.critical}var i={extname:"cRLDistributionPoints",array:[]};e&&(i.critical=!0);for(var s=n(t,0),o=0;o<s.length;o++){var u=a(t,s[o]);i.array.push(this.getDistributionPoint(u))}return i},this.getDistributionPoint=function(t){for(var e={},r=n(t,0),i=0;i<r.length;i++){var s=t.substr(r[i],2),o=a(t,r[i]);"a0"==s&&(e.dpname=this.getDistributionPointName(o))}return e},this.getDistributionPointName=function(t){for(var e={},r=n(t,0),i=0;i<r.length;i++){var s=t.substr(r[i],2),o=a(t,r[i]);"a0"==s&&(e.full=this.getGeneralNames(o))}return e},this.getExtCRLDistributionPointsURI=function(){var t=this.getExtCRLDistributionPoints();if(null==t)return t;for(var e=t.array,r=[],n=0;n<e.length;n++)try{null!=e[n].dpname.full[0].uri&&r.push(e[n].dpname.full[0].uri)}catch(t){}return r},this.getExtAIAInfo=function(){var t=this.getExtInfo("authorityInfoAccess");if(void 0===t)return t;for(var e={ocsp:[],caissuer:[]},r=n(this.hex,t.vidx),i=0;i<r.length;i++){var s=o(this.hex,r[i],[0],"06"),a=o(this.hex,r[i],[1],"86");"2b06010505073001"===s&&e.ocsp.push(ce(a)),"2b06010505073002"===s&&e.caissuer.push(ce(a))}return e},this.getExtAuthorityInfoAccess=function(t,e){if(void 0===t&&void 0===e){var r=this.getExtInfo("authorityInfoAccess");if(void 0===r)return;t=a(this.hex,r.vidx),e=r.critical}var i={extname:"authorityInfoAccess",array:[]};e&&(i.critical=!0);for(var s=n(t,0),c=0;c<s.length;c++){var h=u(t,s[c],[0],"06"),l=ce(o(t,s[c],[1],"86"));if("2b06010505073001"==h)i.array.push({ocsp:l});else{if("2b06010505073002"!=h)throw new Error("unknown method: "+h);i.array.push({caissuer:l})}}return i},this.getExtCertificatePolicies=function(t,e){if(void 0===t&&void 0===e){var r=this.getExtInfo("certificatePolicies");if(void 0===r)return;t=a(this.hex,r.vidx),e=r.critical}var i={extname:"certificatePolicies",array:[]};e&&(i.critical=!0);for(var s=n(t,0),o=0;o<s.length;o++){var u=a(t,s[o]),c=this.getPolicyInformation(u);i.array.push(c)}return i},this.getPolicyInformation=function(t){var e={},r=o(t,0,[0],"06");e.policyoid=d(r);var i=f(t,0,[1],"30");if(-1!=i){e.array=[];for(var s=n(t,i),u=0;u<s.length;u++){var c=a(t,s[u]),h=this.getPolicyQualifierInfo(c);e.array.push(h)}}return e},this.getOtherName=function(t){var e={},r=n(t,0),i=o(t,r[0],[],"06"),a=o(t,r[1],[]);return e.oid=d(i),e.value=s(a),e},this.getPolicyQualifierInfo=function(t){var e={},r=o(t,0,[0],"06");if("2b06010505070201"===r){var n=u(t,0,[1],"16");e.cps=le(n)}else if("2b06010505070202"===r){var i=c(t,0,[1],"30");e.unotice=this.getUserNotice(i)}return e},this.getUserNotice=function(t){var e=null;try{return e=r.parse(t),this._asn1ToUnotice(e)}catch(t){return}},this._asn1ToUnotice=function(t){try{for(var e={},r=_e(t,"seq"),n=0;n<r.length;n++){var i=this._asn1ToNoticeRef(r[n]);null!=i&&(e.noticeref=i);var s=this.asn1ToDisplayText(r[n]);null!=s&&(e.exptext=s)}return Object.keys(e).length>0?e:void 0}catch(t){return}},this._asn1ToNoticeRef=function(t){try{for(var e={},r=_e(t,"seq"),n=0;n<r.length;n++){var i=this._asn1ToNoticeNum(r[n]);null!=i&&(e.noticenum=i);var s=this.asn1ToDisplayText(r[n]);null!=s&&(e.org=s)}return Object.keys(e).length>0?e:void 0}catch(t){return}},this._asn1ToNoticeNum=function(t){try{for(var e=_e(t,"seq"),r=[],n=0;n<e.length;n++){var i=e[n];r.push(parseInt(_e(i,"int.hex"),16))}return r}catch(t){return}},this.getDisplayText=function(t){var e={};return e.type={"0c":"utf8",16:"ia5","1a":"vis","1e":"bmp"}[t.substr(0,2)],e.str=le(i(t,0)),e},this.asn1ToDisplayText=function(t){return null!=t.utf8str?{type:"utf8",str:t.utf8str.str}:null!=t.ia5str?{type:"ia5",str:t.ia5str.str}:null!=t.visstr?{type:"vis",str:t.visstr.str}:null!=t.bmpstr?{type:"bmp",str:t.bmpstr.str}:null!=t.prnstr?{type:"prn",str:t.prnstr.str}:void 0},this.getExtPolicyMappings=function(t,e){var r=this.getCriticalExtV("policyMappings",t,e);if(t=r[0],e=r[1],null!=t){var n={extname:"policyMappings"};e&&(n.critical=!0);try{for(var i=s(t).seq,a=[],o=0;o<i.length;o++){var u=i[o].seq;a.push([u[0].oid,u[1].oid])}n.array=a}catch(t){throw new y("malformed policyMappings")}return n}},this.getExtPolicyConstraints=function(t,e){var r=this.getCriticalExtV("policyConstraints",t,e);if(t=r[0],e=r[1],null!=t){var n={extname:"policyConstraints"};e&&(n.critical=!0);var i=s(t);try{for(var a=i.seq,o=0;o<a.length;o++){var u=a[o].tag;0==u.explicit&&("80"==u.tag&&(n.reqexp=parseInt(u.hex,16)),"81"==u.tag&&(n.inhibit=parseInt(u.hex,16)))}}catch(t){return new y("malformed policyConstraints value")}return n}},this.getExtInhibitAnyPolicy=function(t,e){var r=this.getCriticalExtV("inhibitAnyPolicy",t,e);if(t=r[0],e=r[1],null!=t){var n={extname:"inhibitAnyPolicy"};e&&(n.critical=!0);var i=g(t,0);return-1==i?new y("wrong value"):(n.skip=i,n)}},this.getExtCRLNumber=function(t,e){var r={extname:"cRLNumber"};if(e&&(r.critical=!0),"02"==t.substr(0,2))return r.num={hex:i(t,0)},r;throw new y("hExtV parse error: "+t)},this.getExtCRLReason=function(t,e){var r={extname:"cRLReason"};if(e&&(r.critical=!0),"0a"==t.substr(0,2))return r.code=parseInt(i(t,0),16),r;throw new Error("hExtV parse error: "+t)},this.getExtOcspNonce=function(t,e){var r={extname:"ocspNonce"};e&&(r.critical=!0);var n=i(t,0);return r.hex=n,r},this.getExtOcspNoCheck=function(t,e){var r={extname:"ocspNoCheck"};return e&&(r.critical=!0),r},this.getExtAdobeTimeStamp=function(t,e){if(void 0===t&&void 0===e){var r=this.getExtInfo("adobeTimeStamp");if(void 0===r)return;t=a(this.hex,r.vidx),e=r.critical}var i={extname:"adobeTimeStamp"};e&&(i.critical=!0);var s=n(t,0);if(s.length>1){var o=a(t,s[1]),u=this.getGeneralName(o);null!=u.uri&&(i.uri=u.uri)}if(s.length>2){var c=a(t,s[2]);"0101ff"==c&&(i.reqauth=!0),"010100"==c&&(i.reqauth=!1)}return i},this.getExtSubjectDirectoryAttributes=function(t,e){if(void 0===t&&void 0===e){var r=this.getExtInfo("subjectDirectoryAttributes");if(void 0===r)return;t=a(this.hex,r.vidx),e=r.critical}var n={extname:"subjectDirectoryAttributes"};e&&(n.critical=!0);try{for(var i=s(t),o=[],u=0;u<i.seq.length;u++){var c=i.seq[u],h=_e(c,"seq.0.oid"),l=_e(c,"seq.1.set");if(null==h||null==l)throw"error";o.push({attr:h,array:l})}return n.array=o,n}catch(t){throw new Error("malformed subjectDirectoryAttributes extension value")}};var w=function(t){var e={};try{var r=t.seq[0].oid,n=Zt.asn1.x509.OID.name2oid(r);e.type=Zt.asn1.x509.OID.oid2atype(n);var i=t.seq[1];if(null!=i.utf8str)e.ds="utf8",e.value=i.utf8str.str;else if(null!=i.numstr)e.ds="num",e.value=i.numstr.str;else if(null!=i.telstr)e.ds="tel",e.value=i.telstr.str;else if(null!=i.prnstr)e.ds="prn",e.value=i.prnstr.str;else if(null!=i.ia5str)e.ds="ia5",e.value=i.ia5str.str;else if(null!=i.visstr)e.ds="vis",e.value=i.visstr.str;else{if(null==i.bmpstr)throw"error";e.ds="bmp",e.value=i.bmpstr.str}return e}catch(t){throw new Erorr("improper ASN.1 parsed AttrTypeAndValue")}},x=function(t){try{return t.set.map(function(t){return w(t)})}catch(t){throw new Error("improper ASN.1 parsed RDN: "+t)}};this.getX500NameRule=function(t){for(var e=null,r=[],n=0;n<t.length;n++)for(var i=t[n],s=0;s<i.length;s++)r.push(i[s]);for(n=0;n<r.length;n++){var a=r[n],o=a.ds,u=a.value,c=a.type;if("prn"!=o&&"utf8"!=o&&"ia5"!=o)return"mixed";if("ia5"==o){if("CN"!=c)return"mixed";if(Zt.lang.String.isMail(u))continue;return"mixed"}if("C"==c){if("prn"==o)continue;return"mixed"}if(null==e)e=o;else if(e!==o)return"mixed"}return null==e?"prn":e},this.getAttrTypeAndValue=function(t){var e=s(t);return w(e)},this.getRDN=function(t){var e=s(t);return x(e)},this.getX500NameArray=function(t){return function(t){try{return t.seq.map(function(t){return x(t)})}catch(t){throw new Error("improper ASN.1 parsed X500Name: "+t)}}(s(t))},this.getX500Name=function(t,e,r){var n=this.getX500NameArray(t),i={str:this.dnarraytostr(n)};return i.array=n,1==r&&(i.hex=t),1==e&&(i.canon=this.c14nRDNArray(n)),i},this.readCertPEM=function(t){this.readCertHex(m(t))},this.readCertHex=function(t){this.hex=t,this.getVersion();try{l(this.hex,0,[0,7],"a3"),this.parseExt()}catch(t){}},this.getParam=function(t){var e={};return null==t&&(t={}),e.version=this.getVersion(),e.serial={hex:this.getSerialNumberHex()},e.sigalg=this.getSignatureAlgorithmField(),e.issuer=this.getIssuer(t.dncanon,t.dnhex),e.notbefore=this.getNotBefore(),e.notafter=this.getNotAfter(),e.subject=this.getSubject(t.dncanon,t.dnhex),e.sbjpubkey=pe(this.getPublicKeyHex(),"PUBLIC KEY"),null!=this.aExtInfo&&this.aExtInfo.length>0&&(e.ext=this.getExtParamArray()),e.sighex=this.getSignatureValueHex(),1==t.tbshex&&(e.tbshex=c(this.hex,0,[0])),1==t.nodnarray&&(delete e.issuer.array,delete e.subject.array),e},this.getExtParamArray=function(t){null==t&&(-1!=f(this.hex,0,[0,"[3]"])&&(t=h(this.hex,0,[0,"[3]",0],"30")));for(var e=[],r=n(t,0),i=0;i<r.length;i++){var s=a(t,r[i]),o=this.getExtParam(s);null!=o&&e.push(o)}return e},this.getExtParam=function(t){var e=n(t,0).length;if(2!=e&&3!=e)throw new Error("wrong number elements in Extension: "+e+" "+t);var r=v(o(t,0,[0],"06")),i=!1;3==e&&"0101ff"==c(t,0,[1])&&(i=!0);var a=c(t,0,[e-1,0]),u=void 0;if("2.5.29.14"==r?u=this.getExtSubjectKeyIdentifier(a,i):"2.5.29.15"==r?u=this.getExtKeyUsage(a,i):"2.5.29.17"==r?u=this.getExtSubjectAltName(a,i):"2.5.29.18"==r?u=this.getExtIssuerAltName(a,i):"2.5.29.19"==r?u=this.getExtBasicConstraints(a,i):"2.5.29.30"==r?u=this.getExtNameConstraints(a,i):"2.5.29.31"==r?u=this.getExtCRLDistributionPoints(a,i):"2.5.29.32"==r?u=this.getExtCertificatePolicies(a,i):"2.5.29.33"==r?u=this.getExtPolicyMappings(a,i):"2.5.29.35"==r?u=this.getExtAuthorityKeyIdentifier(a,i):"2.5.29.36"==r?u=this.getExtPolicyConstraints(a,i):"2.5.29.37"==r?u=this.getExtExtKeyUsage(a,i):"2.5.29.54"==r?u=this.getExtInhibitAnyPolicy(a,i):"1.3.6.1.5.5.7.1.1"==r?u=this.getExtAuthorityInfoAccess(a,i):"2.5.29.20"==r?u=this.getExtCRLNumber(a,i):"2.5.29.21"==r?u=this.getExtCRLReason(a,i):"2.5.29.9"==r?u=this.getExtSubjectDirectoryAttributes(a,i):"1.3.6.1.5.5.7.48.1.2"==r?u=this.getExtOcspNonce(a,i):"1.3.6.1.5.5.7.48.1.5"==r?u=this.getExtOcspNoCheck(a,i):"1.2.840.113583.1.1.9.1"==r?u=this.getExtAdobeTimeStamp(a,i):null!=qe.EXT_PARSER[r]&&(u=qe.EXT_PARSER[r](r,i,a)),null!=u)return u;var h={extname:r,extn:a};try{h.extn=s(a)}catch(t){}return i&&(h.critical=!0),h},this.findExt=function(t,e){for(var r=0;r<t.length;r++)if(t[r].extname==e)return t[r];return null},this.updateExtCDPFullURI=function(t,e){var r=this.findExt(t,"cRLDistributionPoints");if(null!=r&&null!=r.array)for(var n=r.array,i=0;i<n.length;i++)if(null!=n[i].dpname&&null!=n[i].dpname.full)for(var s=n[i].dpname.full,a=0;a<s.length;a++){var o=s[i];null!=o.uri&&(o.uri=e)}},this.updateExtAIAOCSP=function(t,e){var r=this.findExt(t,"authorityInfoAccess");if(null!=r&&null!=r.array)for(var n=r.array,i=0;i<n.length;i++)null!=n[i].ocsp&&(n[i].ocsp=e)},this.updateExtAIACAIssuer=function(t,e){var r=this.findExt(t,"authorityInfoAccess");if(null!=r&&null!=r.array)for(var n=r.array,i=0;i<n.length;i++)null!=n[i].caissuer&&(n[i].caissuer=e)},this.dnarraytostr=function(t){return"/"+t.map(function(t){return function(t){return t.map(function(t){return function(t){return t.type+"="+t.value}(t).replace(/\+/,"\\+")}).join("+")}(t).replace(/\//,"\\/")}).join("/")},this.setCanonicalizedDN=function(t){var e;if(null!=t.str&&null==t.array){var r=new Zt.asn1.x509.X500Name({str:t.str}).tohex();e=this.getX500NameArray(r)}else e=t.array;null==t.canon&&(t.canon=this.c14nRDNArray(e))},this.c14nRDNArray=function(t){for(var e=[],r=0;r<t.length;r++){for(var n=t[r],i=[],s=0;s<n.length;s++){var a=n[s],o=a.value;o=(o=(o=(o=o.replace(/^\s*/,"")).replace(/\s*$/,"")).replace(/\s+/g," ")).toLowerCase(),i.push(a.type.toLowerCase()+"="+o)}e.push(i.join("+"))}return"/"+e.join("/")},this.getInfo=function(){var t,e,r,n=function(t){for(var e="",r=" ",n="\n",i=t.array,s=0;s<i.length;s++){var a=i[s];if(null!=a.dn&&(e+=r+"dn: "+a.dn.str+n),null!=a.ip&&(e+=r+"ip: "+a.ip+n),null!=a.rfc822&&(e+=r+"rfc822: "+a.rfc822+n),null!=a.dns&&(e+=r+"dns: "+a.dns+n),null!=a.uri&&(e+=r+"uri: "+a.uri+n),null!=a.other)e+=r+"other: "+a.other.oid+"="+JSON.stringify(a.other.value).replace(/\"/g,"")+n}return e=e.replace(/\n$/,"")},i=function(t){for(var e="",r=t.array,n=0;n<r.length;n++){var i=r[n];if(e+=" policy oid: "+i.policyoid+"\n",void 0!==i.array)for(var s=0;s<i.array.length;s++){var a=i.array[s];void 0!==a.cps&&(e+=" cps: "+a.cps+"\n")}}return e},s=function(t){for(var e="",r=t.array,n=0;n<r.length;n++){var i=r[n];try{void 0!==i.dpname.full[0].uri&&(e+=" "+i.dpname.full[0].uri+"\n")}catch(t){}try{void 0!==i.dname.full[0].dn.hex&&(e+=" "+qe.hex2dn(i.dpname.full[0].dn.hex)+"\n")}catch(t){}}return e},a=function(t){for(var e="",r=t.array,n=0;n<r.length;n++){var i=r[n];void 0!==i.caissuer&&(e+=" caissuer: "+i.caissuer+"\n"),void 0!==i.ocsp&&(e+=" ocsp: "+i.ocsp+"\n")}return e};if(t="Basic Fields\n",t+=" serial number: "+this.getSerialNumberHex()+"\n",t+=" signature algorithm: "+this.getSignatureAlgorithmField()+"\n",t+=" issuer: "+this.getIssuerString()+"\n",t+=" notBefore: "+this.getNotBefore()+"\n",t+=" notAfter: "+this.getNotAfter()+"\n",t+=" subject: "+this.getSubjectString()+"\n",t+=" subject public key info: \n",t+=" key algorithm: "+(e=this.getPublicKey()).type+"\n","RSA"===e.type&&(t+=" n="+Pe(e.n.toString(16)).substr(0,16)+"...\n",t+=" e="+Pe(e.e.toString(16))+"\n"),null!=(r=this.aExtInfo)){t+="X509v3 Extensions:\n";for(var o=0;o<r.length;o++){var u=r[o],c=Zt.asn1.x509.OID.oid2name(u.oid);""===c&&(c=u.oid);var h="";if(!0===u.critical&&(h="CRITICAL"),t+=" "+c+" "+h+":\n","basicConstraints"===c){var l=this.getExtBasicConstraints();void 0===l.cA?t+=" {}\n":(t+=" cA=true",void 0!==l.pathLen&&(t+=", pathLen="+l.pathLen),t+="\n")}else{var f;if("policyMappings"==c)t+=" "+this.getExtPolicyMappings().array.map(function(t){var e=t;return e[0]+":"+e[1]}).join(", ")+"\n";else if("policyConstraints"==c)t+=" ",null!=(f=this.getExtPolicyConstraints()).reqexp&&(t+=" reqexp="+f.reqexp),null!=f.inhibit&&(t+=" inhibit="+f.inhibit),t+="\n";else if("inhibitAnyPolicy"==c)t+=" skip="+(f=this.getExtInhibitAnyPolicy()).skip+"\n";else if("keyUsage"==c)t+=" "+this.getExtKeyUsageString()+"\n";else if("subjectKeyIdentifier"==c)t+=" "+this.getExtSubjectKeyIdentifier().kid.hex+"\n";else if("authorityKeyIdentifier"==c){var p=this.getExtAuthorityKeyIdentifier();void 0!==p.kid&&(t+=" kid="+p.kid.hex+"\n")}else{if("extKeyUsage"==c)t+=" "+this.getExtExtKeyUsage().array.join(", ")+"\n";else if("subjectAltName"==c)t+=n(this.getExtSubjectAltName())+"\n";else if("cRLDistributionPoints"==c)t+=s(this.getExtCRLDistributionPoints());else if("authorityInfoAccess"==c)t+=a(this.getExtAuthorityInfoAccess());else"certificatePolicies"==c&&(t+=i(this.getExtCertificatePolicies()))}}}}return t+="signature algorithm: "+this.getSignatureAlgorithmName()+"\n",t+="signature: "+this.getSignatureValueHex().substr(0,16)+"...\n"},"string"==typeof t&&(-1!=t.indexOf("-----BEGIN")?this.readCertPEM(t):Zt.lang.String.isHex(t)&&this.readCertHex(t))}He.getKey=function(t,e,r){var n=(v=ee).getChildIdx,i=v.getVbyList,s=Zt.crypto,a=s.ECDSA,o=s.DSA,u=Gt,c=ge,h=He;if(void 0!==u&&t instanceof u)return t;if(void 0!==a&&t instanceof a)return t;if(void 0!==o&&t instanceof o)return t;if(void 0!==t.curve&&void 0!==t.xy&&void 0===t.d)return new a({pub:t.xy,curve:t.curve});if(void 0!==t.curve&&void 0!==t.d)return new a({prv:t.d,curve:t.curve});if(void 0===t.kty&&void 0!==t.n&&void 0!==t.e&&void 0===t.d)return(D=new u).setPublic(t.n,t.e),D;if(void 0===t.kty&&void 0!==t.n&&void 0!==t.e&&void 0!==t.d&&void 0!==t.p&&void 0!==t.q&&void 0!==t.dp&&void 0!==t.dq&&void 0!==t.co&&void 0===t.qi)return(D=new u).setPrivateEx(t.n,t.e,t.d,t.p,t.q,t.dp,t.dq,t.co),D;if(void 0===t.kty&&void 0!==t.n&&void 0!==t.e&&void 0!==t.d&&void 0===t.p)return(D=new u).setPrivate(t.n,t.e,t.d),D;if(void 0!==t.p&&void 0!==t.q&&void 0!==t.g&&void 0!==t.y&&void 0===t.x)return(D=new o).setPublic(t.p,t.q,t.g,t.y),D;if(void 0!==t.p&&void 0!==t.q&&void 0!==t.g&&void 0!==t.y&&void 0!==t.x)return(D=new o).setPrivate(t.p,t.q,t.g,t.y,t.x),D;if("RSA"===t.kty&&void 0!==t.n&&void 0!==t.e&&void 0===t.d)return(D=new u).setPublic(oe(t.n),oe(t.e)),D;if("RSA"===t.kty&&void 0!==t.n&&void 0!==t.e&&void 0!==t.d&&void 0!==t.p&&void 0!==t.q&&void 0!==t.dp&&void 0!==t.dq&&void 0!==t.qi)return(D=new u).setPrivateEx(oe(t.n),oe(t.e),oe(t.d),oe(t.p),oe(t.q),oe(t.dp),oe(t.dq),oe(t.qi)),D;if("RSA"===t.kty&&void 0!==t.n&&void 0!==t.e&&void 0!==t.d)return(D=new u).setPrivate(oe(t.n),oe(t.e),oe(t.d)),D;if("EC"===t.kty&&void 0!==t.crv&&void 0!==t.x&&void 0!==t.y&&void 0===t.d){var l=(C=new a({curve:t.crv})).ecparams.keycharlen,f="04"+("0000000000"+oe(t.x)).slice(-l)+("0000000000"+oe(t.y)).slice(-l);return C.setPublicKeyHex(f),C}if("EC"===t.kty&&void 0!==t.crv&&void 0!==t.x&&void 0!==t.y&&void 0!==t.d){l=(C=new a({curve:t.crv})).ecparams.keycharlen,f="04"+("0000000000"+oe(t.x)).slice(-l)+("0000000000"+oe(t.y)).slice(-l);var p=("0000000000"+oe(t.d)).slice(-l);return C.setPublicKeyHex(f),C.setPrivateKeyHex(p),C}if("pkcs5prv"===r){var g,d=t,v=ee;if(9===(g=n(d,0)).length)(D=new u).readPKCS5PrvKeyHex(d);else if(6===g.length)(D=new o).readPKCS5PrvKeyHex(d);else{if(!(g.length>2&&"04"===d.substr(g[1],2)))throw new Error("unsupported PKCS#1/5 hexadecimal key");(D=new a).readPKCS5PrvKeyHex(d)}return D}if("pkcs8prv"===r)return D=h.getKeyFromPlainPrivatePKCS8Hex(t);if("pkcs8pub"===r)return h._getKeyFromPublicPKCS8Hex(t);if("x509pub"===r)return qe.getPublicKeyFromCertHex(t);if(-1!=t.indexOf("-END CERTIFICATE-",0)||-1!=t.indexOf("-END X509 CERTIFICATE-",0)||-1!=t.indexOf("-END TRUSTED CERTIFICATE-",0))return qe.getPublicKeyFromCertPEM(t);if(-1!=t.indexOf("-END PUBLIC KEY-")){var m=ge(t,"PUBLIC KEY");return h._getKeyFromPublicPKCS8Hex(m)}if(-1!=t.indexOf("-END RSA PRIVATE KEY-")&&-1==t.indexOf("4,ENCRYPTED")){var y=c(t,"RSA PRIVATE KEY");return h.getKey(y,null,"pkcs5prv")}if(-1!=t.indexOf("-END DSA PRIVATE KEY-")&&-1==t.indexOf("4,ENCRYPTED")){var w=i(R=c(t,"DSA PRIVATE KEY"),0,[1],"02"),x=i(R,0,[2],"02"),S=i(R,0,[3],"02"),E=i(R,0,[4],"02"),b=i(R,0,[5],"02");return(D=new o).setPrivate(new ht(w,16),new ht(x,16),new ht(S,16),new ht(E,16),new ht(b,16)),D}if(-1!=t.indexOf("-END EC PRIVATE KEY-")&&-1==t.indexOf("4,ENCRYPTED")){y=c(t,"EC PRIVATE KEY");return h.getKey(y,null,"pkcs5prv")}if(-1!=t.indexOf("-END PRIVATE KEY-"))return h.getKeyFromPlainPrivatePKCS8PEM(t);if(-1!=t.indexOf("-END RSA PRIVATE KEY-")&&-1!=t.indexOf("4,ENCRYPTED")){var F=h.getDecryptedKeyHex(t,e),A=new Gt;return A.readPKCS5PrvKeyHex(F),A}if(-1!=t.indexOf("-END EC PRIVATE KEY-")&&-1!=t.indexOf("4,ENCRYPTED")){var C,D=i(R=h.getDecryptedKeyHex(t,e),0,[1],"04"),P=i(R,0,[2,0],"06"),I=i(R,0,[3,0],"03").substr(2);if(void 0===Zt.crypto.OID.oidhex2name[P])throw new Error("undefined OID(hex) in KJUR.crypto.OID: "+P);return(C=new a({curve:Zt.crypto.OID.oidhex2name[P]})).setPublicKeyHex(I),C.setPrivateKeyHex(D),C.isPublic=!1,C}if(-1!=t.indexOf("-END DSA PRIVATE KEY-")&&-1!=t.indexOf("4,ENCRYPTED")){var R;w=i(R=h.getDecryptedKeyHex(t,e),0,[1],"02"),x=i(R,0,[2],"02"),S=i(R,0,[3],"02"),E=i(R,0,[4],"02"),b=i(R,0,[5],"02");return(D=new o).setPrivate(new ht(w,16),new ht(x,16),new ht(S,16),new ht(E,16),new ht(b,16)),D}if(-1!=t.indexOf("-END ENCRYPTED PRIVATE KEY-"))return h.getKeyFromEncryptedPKCS8PEM(t,e);throw new Error("not supported argument")},He.generateKeypair=function(t,e){if("RSA"==t){var r=e;(a=new Gt).generate(r,"10001"),a.isPrivate=!0,a.isPublic=!0;var n=new Gt,i=a.n.toString(16),s=a.e.toString(16);return n.setPublic(i,s),n.isPrivate=!1,n.isPublic=!0,(o={}).prvKeyObj=a,o.pubKeyObj=n,o}if("EC"==t){var a,o,u=e,c=new Zt.crypto.ECDSA({curve:u}).generateKeyPairHex();return(a=new Zt.crypto.ECDSA({curve:u})).setPublicKeyHex(c.ecpubhex),a.setPrivateKeyHex(c.ecprvhex),a.isPrivate=!0,a.isPublic=!1,(n=new Zt.crypto.ECDSA({curve:u})).setPublicKeyHex(c.ecpubhex),n.isPrivate=!1,n.isPublic=!0,(o={}).prvKeyObj=a,o.pubKeyObj=n,o}throw new Error("unknown algorithm: "+t)},He.getPEM=function(t,e,r,n,i,s){var a=Zt,o=a.asn1,u=o.DERObjectIdentifier,c=o.DERInteger,h=o.ASN1Util.newObject,l=o.x509.SubjectPublicKeyInfo,f=a.crypto,p=f.DSA,g=f.ECDSA,d=Gt;function v(t){return h({seq:[{int:0},{int:{bigint:t.n}},{int:t.e},{int:{bigint:t.d}},{int:{bigint:t.p}},{int:{bigint:t.q}},{int:{bigint:t.dmp1}},{int:{bigint:t.dmq1}},{int:{bigint:t.coeff}}]})}function m(t){return h({seq:[{int:1},{octstr:{hex:t.prvKeyHex}},{tag:["a0",!0,{oid:{name:t.curveName}}]},{tag:["a1",!0,{bitstr:{hex:"00"+t.pubKeyHex}}]}]})}function y(t){return h({seq:[{int:0},{int:{bigint:t.p}},{int:{bigint:t.q}},{int:{bigint:t.g}},{int:{bigint:t.y}},{int:{bigint:t.x}}]})}if((void 0!==d&&t instanceof d||void 0!==p&&t instanceof p||void 0!==g&&t instanceof g)&&1==t.isPublic&&(void 0===e||"PKCS8PUB"==e))return pe(E=new l(t).tohex(),"PUBLIC KEY");if("PKCS1PRV"==e&&void 0!==d&&t instanceof d&&(void 0===r||null==r)&&1==t.isPrivate)return pe(E=v(t).tohex(),"RSA PRIVATE KEY");if("PKCS1PRV"==e&&void 0!==g&&t instanceof g&&(void 0===r||null==r)&&1==t.isPrivate){var w=new u({name:t.curveName}).tohex(),x=m(t).tohex(),S="";return S+=pe(w,"EC PARAMETERS"),S+=pe(x,"EC PRIVATE KEY")}if("PKCS1PRV"==e&&void 0!==p&&t instanceof p&&(void 0===r||null==r)&&1==t.isPrivate)return pe(E=y(t).tohex(),"DSA PRIVATE KEY");if("PKCS5PRV"==e&&void 0!==d&&t instanceof d&&void 0!==r&&null!=r&&1==t.isPrivate){var E=v(t).tohex();return void 0===n&&(n="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("RSA",E,r,n,s)}if("PKCS5PRV"==e&&void 0!==g&&t instanceof g&&void 0!==r&&null!=r&&1==t.isPrivate){E=m(t).tohex();return void 0===n&&(n="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("EC",E,r,n,s)}if("PKCS5PRV"==e&&void 0!==p&&t instanceof p&&void 0!==r&&null!=r&&1==t.isPrivate){E=y(t).tohex();return void 0===n&&(n="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("DSA",E,r,n,s)}var b=function(t,e){if("string"==typeof e)return He.getEncryptedPKCS8PEM(t,e);if("object"==typeof e&&null!=_e(e,"passcode")){var r=JSON.parse(JSON.stringify(e)),n=r.passcode;return delete r.passcode,He.getEncryptedPKCS8PEM(t,n,r)}};if("PKCS8PRV"==e&&null!=d&&t instanceof d&&1==t.isPrivate){var F=v(t).tohex();E=h({seq:[{int:0},{seq:[{oid:{name:"rsaEncryption"}},{null:!0}]},{octstr:{hex:F}}]}).tohex();return void 0===r||null==r?pe(E,"PRIVATE KEY"):b(E,r)}if("PKCS8PRV"==e&&void 0!==g&&t instanceof g&&1==t.isPrivate){var A={seq:[{int:1},{octstr:{hex:t.prvKeyHex}}]};"string"==typeof t.pubKeyHex&&A.seq.push({tag:["a1",!0,{bitstr:{hex:"00"+t.pubKeyHex}}]});F=new h(A).tohex(),E=h({seq:[{int:0},{seq:[{oid:{name:"ecPublicKey"}},{oid:{name:t.curveName}}]},{octstr:{hex:F}}]}).tohex();return void 0===r||null==r?pe(E,"PRIVATE KEY"):b(E,r)}if("PKCS8PRV"==e&&void 0!==p&&t instanceof p&&1==t.isPrivate){F=new c({bigint:t.x}).tohex(),E=h({seq:[{int:0},{seq:[{oid:{name:"dsa"}},{seq:[{int:{bigint:t.p}},{int:{bigint:t.q}},{int:{bigint:t.g}}]}]},{octstr:{hex:F}}]}).tohex();return void 0===r||null==r?pe(E,"PRIVATE KEY"):b(E,r)}throw new Error("unsupported object nor format")},He.getKeyFromCSRPEM=function(t){var e=ge(t,"CERTIFICATE REQUEST");return He.getKeyFromCSRHex(e)},He.getKeyFromCSRHex=function(t){var e=He.parseCSRHex(t);return He.getKey(e.p8pubkeyhex,null,"pkcs8pub")},He.parseCSRHex=function(t){var e=ee,r=e.getChildIdx,n=e.getTLV,i={},s=t;if("30"!=s.substr(0,2))throw new Error("malformed CSR(code:001)");var a=r(s,0);if(a.length<1)throw new Error("malformed CSR(code:002)");if("30"!=s.substr(a[0],2))throw new Error("malformed CSR(code:003)");var o=r(s,a[0]);if(o.length<3)throw new Error("malformed CSR(code:004)");return i.p8pubkeyhex=n(s,o[2]),i},He.getKeyID=function(t){var e=He,r=ee;"string"==typeof t&&-1!=t.indexOf("BEGIN ")&&(t=e.getKey(t));var n=ge(e.getPEM(t)),i=r.getIdxbyList(n,0,[1]),s=r.getV(n,i).substring(2);return Zt.crypto.Util.hashHex(s,"sha1")},He.getJWK=function(t,e,r,n,i){var s,a,o={},u=Zt.crypto.Util.hashHex;if("string"==typeof t)s=He.getKey(t),-1!=t.indexOf("CERTIFICATE")&&(a=ge(t));else{if("object"!=typeof t)throw new Error("unsupported keyinfo type");t instanceof qe?(s=t.getPublicKey(),a=t.hex):s=t}if(s instanceof Gt&&s.isPrivate)o.kty="RSA",o.n=ae(s.n.toString(16)),o.e=ae(s.e.toString(16)),o.d=ae(s.d.toString(16)),o.p=ae(s.p.toString(16)),o.q=ae(s.q.toString(16)),o.dp=ae(s.dmp1.toString(16)),o.dq=ae(s.dmq1.toString(16)),o.qi=ae(s.coeff.toString(16));else if(s instanceof Gt&&s.isPublic)o.kty="RSA",o.n=ae(s.n.toString(16)),o.e=ae(s.e.toString(16));else if(s instanceof Zt.crypto.ECDSA&&s.isPrivate){if("P-256"!==(h=s.getShortNISTPCurveName())&&"P-384"!==h&&"P-521"!==h)throw new Error("unsupported curve name for JWT: "+h);var c=s.getPublicKeyXYHex();o.kty="EC",o.crv=h,o.x=ae(c.x),o.y=ae(c.y),o.d=ae(s.prvKeyHex)}else if(s instanceof Zt.crypto.ECDSA&&s.isPublic){var h;if("P-256"!==(h=s.getShortNISTPCurveName())&&"P-384"!==h&&"P-521"!==h)throw new Error("unsupported curve name for JWT: "+h);c=s.getPublicKeyXYHex();o.kty="EC",o.crv=h,o.x=ae(c.x),o.y=ae(c.y)}if(null==o.kty)throw new Error("unsupported keyinfo");return s.isPrivate||1==e||(o.kid=Zt.jws.JWS.getJWKthumbprint(o)),null!=a&&1!=r&&(o.x5c=[ut(a)]),null!=a&&1!=n&&(o.x5t=ie(ut(u(a,"sha1")))),null!=a&&1!=i&&(o["x5t#S256"]=ie(ut(u(a,"sha256")))),o},He.getJWKFromKey=function(t){return He.getJWK(t,!0,!0,!0,!0)},Gt.getPosArrayOfChildrenFromHex=function(t){return ee.getChildIdx(t,0)},Gt.getHexValueArrayOfChildrenFromHex=function(t){var e,r=ee.getV,n=r(t,(e=Gt.getPosArrayOfChildrenFromHex(t))[0]),i=r(t,e[1]),s=r(t,e[2]),a=r(t,e[3]),o=r(t,e[4]),u=r(t,e[5]),c=r(t,e[6]),h=r(t,e[7]),l=r(t,e[8]);return(e=new Array).push(n,i,s,a,o,u,c,h,l),e},Gt.prototype.readPrivateKeyFromPEMString=function(t){var e=ge(t),r=Gt.getHexValueArrayOfChildrenFromHex(e);this.setPrivateEx(r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8])},Gt.prototype.readPKCS5PrvKeyHex=function(t){var e=Gt.getHexValueArrayOfChildrenFromHex(t);this.setPrivateEx(e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},Gt.prototype.readPKCS8PrvKeyHex=function(t){var e,r,n,i,s,a,o,u,c=ee,h=c.getVbyListEx;if(!1===c.isASN1HEX(t))throw new Error("not ASN.1 hex string");try{e=h(t,0,[2,0,1],"02"),r=h(t,0,[2,0,2],"02"),n=h(t,0,[2,0,3],"02"),i=h(t,0,[2,0,4],"02"),s=h(t,0,[2,0,5],"02"),a=h(t,0,[2,0,6],"02"),o=h(t,0,[2,0,7],"02"),u=h(t,0,[2,0,8],"02")}catch(t){throw new Error("malformed PKCS#8 plain RSA private key")}this.setPrivateEx(e,r,n,i,s,a,o,u)},Gt.prototype.readPKCS5PubKeyHex=function(t){var e=ee,r=e.getV;if(!1===e.isASN1HEX(t))throw new Error("keyHex is not ASN.1 hex string");var n=e.getChildIdx(t,0);if(2!==n.length||"02"!==t.substr(n[0],2)||"02"!==t.substr(n[1],2))throw new Error("wrong hex for PKCS#5 public key");var i=r(t,n[0]),s=r(t,n[1]);this.setPublic(i,s)},Gt.prototype.readPKCS8PubKeyHex=function(t){var e=ee;if(!1===e.isASN1HEX(t))throw new Error("not ASN.1 hex string");if("06092a864886f70d010101"!==e.getTLVbyListEx(t,0,[0,0]))throw new Error("not PKCS8 RSA public key");var r=e.getTLVbyListEx(t,0,[1,0]);this.readPKCS5PubKeyHex(r)},Gt.prototype.readCertPubKeyHex=function(t,e){var r,n;(r=new qe).readCertHex(t),n=r.getPublicKeyHex(),this.readPKCS8PubKeyHex(n)},Gt.prototype.sign=function(t,e){var r=function(t){return Zt.crypto.Util.hashString(t,e)}(t);return this.signWithMessageHash(r,e)},Gt.prototype.signWithMessageHash=function(t,e){var r=Wt(Zt.crypto.Util.getPaddedDigestInfoHex(t,e,this.n.bitLength()),16);return ke(this.doPrivate(r).toString(16),this.n.bitLength())},Gt.prototype.signPSS=function(t,e,r){var n=function(t){return Zt.crypto.Util.hashHex(t,e)}(fe(t));return void 0===r&&(r=-1),this.signWithMessageHashPSS(n,e,r)},Gt.prototype.signWithMessageHashPSS=function(t,e,r){var n,i=le(t),s=i.length,a=this.n.bitLength()-1,o=Math.ceil(a/8),u=function(t){return Zt.crypto.Util.hashHex(t,e)};if(-1===r||void 0===r)r=s;else if(-2===r)r=o-s-2;else if(r<-2)throw new Error("invalid salt length");if(o<s+r+2)throw new Error("data too long");var c="";r>0&&(c=new Array(r),(new zt).nextBytes(c),c=String.fromCharCode.apply(String,c));var h=le(u(fe("\0\0\0\0\0\0\0\0"+i+c))),l=[];for(n=0;n<o-r-s-2;n+=1)l[n]=0;var f=String.fromCharCode.apply(String,l)+""+c,p=Le(h,f.length,u),g=[];for(n=0;n<f.length;n+=1)g[n]=f.charCodeAt(n)^p.charCodeAt(n);var d=65280>>8*o-a&255;for(g[0]&=~d,n=0;n<s;n++)g.push(h.charCodeAt(n));return g.push(188),ke(this.doPrivate(new ht(g)).toString(16),this.n.bitLength())},Gt.prototype.verify=function(t,e){if(null==(e=e.toLowerCase()).match(/^[0-9a-f]+$/))return!1;var r=Wt(e,16),n=this.n.bitLength();if(r.bitLength()>n)return!1;var i=this.doPublic(r).toString(16);if(i.length+3!=n/4)return!1;var s=Ve(i.replace(/^1f+00/,""));if(0==s.length)return!1;var a=s[0],o=s[1],u=function(t){return Zt.crypto.Util.hashString(t,a)}(t);return o==u},Gt.prototype.verifyWithMessageHash=function(t,e){if(e.length!=Math.ceil(this.n.bitLength()/4))return!1;var r=Wt(e,16);if(r.bitLength()>this.n.bitLength())return 0;var n=Ve(this.doPublic(r).toString(16).replace(/^1f+00/,""));return 0!=n.length&&n[1]==t},Gt.prototype.verifyPSS=function(t,e,r,n){var i,s=(i=fe(t),Zt.crypto.Util.hashHex(i,r));return void 0===n&&(n=-1),this.verifyWithMessageHashPSS(s,e,r,n)},Gt.prototype.verifyWithMessageHashPSS=function(t,e,r,n){if(e.length!=Math.ceil(this.n.bitLength()/4))return!1;var i,s=new ht(e,16),a=function(t){return Zt.crypto.Util.hashHex(t,r)},o=le(t),u=o.length,c=this.n.bitLength()-1,h=Math.ceil(c/8);if(-1===n||void 0===n)n=u;else if(-2===n)n=h-u-2;else if(n<-2)throw new Error("invalid salt length");if(h<u+n+2)throw new Error("data too long");var l=this.doPublic(s).toByteArray();for(i=0;i<l.length;i+=1)l[i]&=255;for(;l.length<h;)l.unshift(0);if(188!==l[h-1])throw new Error("encoded message does not end in 0xbc");var f=(l=String.fromCharCode.apply(String,l)).substr(0,h-u-1),p=l.substr(f.length,u),g=65280>>8*h-c&255;if(0!==(f.charCodeAt(0)&g))throw new Error("bits beyond keysize not zero");var d=Le(p,f.length,a),v=[];for(i=0;i<f.length;i+=1)v[i]=f.charCodeAt(i)^d.charCodeAt(i);v[0]&=~g;var m=h-u-n-2;for(i=0;i<m;i+=1)if(0!==v[i])throw new Error("leftmost octets not zero");if(1!==v[m])throw new Error("0x01 marker not found");return p===le(a(fe("\0\0\0\0\0\0\0\0"+o+String.fromCharCode.apply(String,v.slice(-n)))))},Gt.SALT_LEN_HLEN=-1,Gt.SALT_LEN_MAX=-2,Gt.SALT_LEN_RECOVER=-2,qe.EXT_PARSER={},qe.registExtParser=function(t,e){qe.EXT_PARSER[t]=e},qe.hex2dn=function(t,e){void 0===e&&(e=0);var r=new qe;return ee.getTLV(t,e),r.getX500Name(t).str},qe.hex2rdn=function(t,e){if(void 0===e&&(e=0),"31"!==t.substr(e,2))throw new Error("malformed RDN");for(var r=new Array,n=ee.getChildIdx(t,e),i=0;i<n.length;i++)r.push(qe.hex2attrTypeValue(t,n[i]));return r=r.map(function(t){return t.replace("+","\\+")}),r.join("+")},qe.hex2attrTypeValue=function(t,e){var r=ee,n=r.getV;if(void 0===e&&(e=0),"30"!==t.substr(e,2))throw new Error("malformed attribute type and value");var i=r.getChildIdx(t,e);2!==i.length||t.substr(i[0],2);var s=n(t,i[0]),a=Zt.asn1.ASN1Util.oidHexToInt(s);return Zt.asn1.x509.OID.oid2atype(a)+"="+le(n(t,i[1]))},qe.getPublicKeyFromCertHex=function(t){var e=new qe;return e.readCertHex(t),e.getPublicKey()},qe.getPublicKeyFromCertPEM=function(t){var e=new qe;return e.readCertPEM(t),e.getPublicKey()},qe.getPublicKeyInfoPropOfCertPEM=function(t){var e,r,n=ee.getVbyList,i={};return i.algparam=null,(e=new qe).readCertPEM(t),r=e.getPublicKeyHex(),i.keyhex=n(r,0,[1],"03").substr(2),i.algoid=n(r,0,[0,0],"06"),"2a8648ce3d0201"===i.algoid&&(i.algparam=n(r,0,[0,1],"06")),i},qe.KEYUSAGE_NAME=["digitalSignature","nonRepudiation","keyEncipherment","dataEncipherment","keyAgreement","keyCertSign","cRLSign","encipherOnly","decipherOnly"],void 0!==Zt&&Zt||(Zt={}),void 0!==Zt.jws&&Zt.jws||(Zt.jws={}),Zt.jws.JWS=function(){var t=Zt.jws.JWS.isSafeJSONString;this.parseJWS=function(e,r){if(void 0===this.parsedJWS||!r&&void 0===this.parsedJWS.sigvalH){var n=e.match(/^([^.]+)\.([^.]+)\.([^.]+)$/);if(null==n)throw"JWS signature is not a form of 'Head.Payload.SigValue'.";var i=n[1],s=n[2],a=n[3],o=i+"."+s;if(this.parsedJWS={},this.parsedJWS.headB64U=i,this.parsedJWS.payloadB64U=s,this.parsedJWS.sigvalB64U=a,this.parsedJWS.si=o,!r){var u=oe(a),c=Wt(u,16);this.parsedJWS.sigvalH=u,this.parsedJWS.sigvalBI=c}var h=te(i),l=te(s);if(this.parsedJWS.headS=h,this.parsedJWS.payloadS=l,!t(h,this.parsedJWS,"headP"))throw"malformed JSON string for JWS Head: "+h}}},Zt.jws.JWS.sign=function(t,e,r,n,i){var s,a,o,u=Zt,c=u.jws.JWS,h=c.readSafeJSONString,l=c.isSafeJSONString,f=u.crypto,p=f.Mac,g=f.Signature,d=JSON;if("string"!=typeof e&&"object"!=typeof e)throw"spHeader must be JSON string or object: "+e;if("object"==typeof e&&(a=e,s=d.stringify(a)),"string"==typeof e){if(!l(s=e))throw"JWS Head is not safe JSON string: "+s;a=h(s)}if(o=r,"object"==typeof r&&(o=d.stringify(r)),""!=t&&null!=t||void 0===a.alg||(t=a.alg),""!=t&&null!=t&&void 0===a.alg&&(a.alg=t,s=d.stringify(a)),t!==a.alg)throw"alg and sHeader.alg doesn't match: "+t+"!="+a.alg;var v=null;if(void 0===c.jwsalg2sigalg[t])throw"unsupported alg name: "+t;v=c.jwsalg2sigalg[t];var m=Qt(s)+"."+Qt(o),y="";if("Hmac"==v.substr(0,4)){if(void 0===n)throw"mac key shall be specified for HS* alg";var w=new p({alg:v,prov:"cryptojs",pass:n});w.updateString(m),y=w.doFinal()}else if(-1!=v.indexOf("withECDSA")){(S=new g({alg:v})).init(n,i),S.updateString(m);var x=S.sign();y=Zt.crypto.ECDSA.asn1SigToConcatSig(x)}else{var S;if("none"!=v)(S=new g({alg:v})).init(n,i),S.updateString(m),y=S.sign()}return m+"."+ae(y)},Zt.jws.JWS.verify=function(t,e,r){var n,i=Zt,s=i.jws.JWS,a=s.readSafeJSONString,o=i.crypto,u=o.ECDSA,c=o.Mac,h=o.Signature;if(n=Gt,!De(t))return!1;var l=t.split(".");if(3!==l.length)return!1;var f=l[0]+"."+l[1],p=oe(l[2]),g=a(te(l[0])),d=null,v=null;if(void 0===g.alg)throw"algorithm not specified in header";if((v=(d=g.alg).substr(0,2),null!=r&&"[object Array]"===Object.prototype.toString.call(r)&&r.length>0)&&-1==(":"+r.join(":")+":").indexOf(":"+d+":"))throw"algorithm '"+d+"' not accepted in the list";if("none"!=d&&null===e)throw"key shall be specified to verify.";if("string"==typeof e&&-1!=e.indexOf("-----BEGIN ")&&(e=He.getKey(e)),!("RS"!=v&&"PS"!=v||e instanceof n))throw"key shall be a RSAKey obj for RS* and PS* algs";if("ES"==v&&!(e instanceof u))throw"key shall be a ECDSA obj for ES* algs";var m=null;if(void 0===s.jwsalg2sigalg[g.alg])throw new Error("unsupported alg name: "+d);if(m=s.jwsalg2sigalg[d],void 0!==g.crit){if(!Array.isArray(g.crit)||0===g.crit.length)throw new Error("wrong critical header");for(var y=0;y<g.crit.length;y++){var w=g.crit[y];if("string"!=typeof w||0===w.length)throw new Error("wrong critical header");if(void 0===g[w])throw new Error("critical header '"+w+"' missing")}}if("none"==m)throw new Error("not supported");if("Hmac"==m.substr(0,4)){if(void 0===e)throw new Error("hexadecimal key shall be specified for HMAC");var x=new c({alg:m,pass:e});return x.updateString(f),Ie(p,x.doFinal())}if(-1!=m.indexOf("withECDSA")){var S,E=null;try{E=u.concatSigToASN1Sig(p)}catch(t){return!1}return(S=new h({alg:m})).init(e),S.updateString(f),S.verify(E)}return(S=new h({alg:m})).init(e),S.updateString(f),S.verify(p)},Zt.jws.JWS.parse=function(t){var e,r,n,i=t.split("."),s={};if(2!=i.length&&3!=i.length)throw"malformed sJWS: wrong number of '.' splitted elements";return e=i[0],r=i[1],3==i.length&&(n=i[2]),s.headerObj=Zt.jws.JWS.readSafeJSONString(te(e)),s.payloadObj=Zt.jws.JWS.readSafeJSONString(te(r)),s.headerPP=JSON.stringify(s.headerObj,null," "),null==s.payloadObj?s.payloadPP=te(r):s.payloadPP=JSON.stringify(s.payloadObj,null," "),void 0!==n&&(s.sigHex=oe(n)),s},Zt.jws.JWS.verifyJWT=function(t,e,r){var n=Zt.jws,i=n.JWS,s=i.readSafeJSONString,a=i.inArray,o=i.includedArray;if(!De(t))return!1;var u=t.split(".");if(3!=u.length)return!1;var c=u[0],h=u[1];oe(u[2]);var l=s(te(c)),f=s(te(h));if(void 0===l.alg)return!1;if(void 0===r.alg)throw"acceptField.alg shall be specified";if(!a(l.alg,r.alg))return!1;if(void 0!==f.iss&&"object"==typeof r.iss&&!a(f.iss,r.iss))return!1;if(void 0!==f.sub&&"object"==typeof r.sub&&!a(f.sub,r.sub))return!1;if(void 0!==f.aud&&"object"==typeof r.aud)if("string"==typeof f.aud){if(!a(f.aud,r.aud))return!1}else if("object"==typeof f.aud&&!o(f.aud,r.aud))return!1;var p=n.IntDate.getNow();return void 0!==r.verifyAt&&"number"==typeof r.verifyAt&&(p=r.verifyAt),void 0!==r.gracePeriod&&"number"==typeof r.gracePeriod||(r.gracePeriod=0),!(void 0!==f.exp&&"number"==typeof f.exp&&f.exp+r.gracePeriod<p)&&(!(void 0!==f.nbf&&"number"==typeof f.nbf&&p<f.nbf-r.gracePeriod)&&(!(void 0!==f.iat&&"number"==typeof f.iat&&p<f.iat-r.gracePeriod)&&((void 0===f.jti||void 0===r.jti||f.jti===r.jti)&&!!i.verify(t,e,r.alg))))},Zt.jws.JWS.includedArray=function(t,e){var r=Zt.jws.JWS.inArray;if(null===t)return!1;if("object"!=typeof t)return!1;if("number"!=typeof t.length)return!1;for(var n=0;n<t.length;n++)if(!r(t[n],e))return!1;return!0},Zt.jws.JWS.inArray=function(t,e){if(null===e)return!1;if("object"!=typeof e)return!1;if("number"!=typeof e.length)return!1;for(var r=0;r<e.length;r++)if(e[r]==t)return!0;return!1},Zt.jws.JWS.jwsalg2sigalg={HS256:"HmacSHA256",HS384:"HmacSHA384",HS512:"HmacSHA512",RS256:"SHA256withRSA",RS384:"SHA384withRSA",RS512:"SHA512withRSA",ES256:"SHA256withECDSA",ES384:"SHA384withECDSA",ES512:"SHA512withECDSA",PS256:"SHA256withRSAandMGF1",PS384:"SHA384withRSAandMGF1",PS512:"SHA512withRSAandMGF1",none:"none"},Zt.jws.JWS.isSafeJSONString=function(t,e,r){var n=null;try{return"object"!=typeof(n=Xt(t))||n.constructor===Array?0:(e&&(e[r]=n),1)}catch(t){return 0}},Zt.jws.JWS.readSafeJSONString=function(t){var e=null;try{return"object"!=typeof(e=Xt(t))||e.constructor===Array?null:e}catch(t){return null}},Zt.jws.JWS.getEncodedSignatureValueFromJWS=function(t){var e=t.match(/^[^.]+\.[^.]+\.([^.]+)$/);if(null==e)throw"JWS signature is not a form of 'Head.Payload.SigValue'.";return e[1]},Zt.jws.JWS.getJWKthumbprint=function(t){if("RSA"!==t.kty&&"EC"!==t.kty&&"oct"!==t.kty)throw new Error("unsupported algorithm for JWK Thumprint");var e="{";if("RSA"===t.kty){if("string"!=typeof t.n||"string"!=typeof t.e)throw new Error("wrong n and e value for RSA key");e+='"e":"'+t.e+'",',e+='"kty":"'+t.kty+'",',e+='"n":"'+t.n+'"}'}else if("EC"===t.kty){if("string"!=typeof t.crv||"string"!=typeof t.x||"string"!=typeof t.y)throw new Error("wrong crv, x and y value for EC key");e+='"crv":"'+t.crv+'",',e+='"kty":"'+t.kty+'",',e+='"x":"'+t.x+'",',e+='"y":"'+t.y+'"}'}else if("oct"===t.kty){if("string"!=typeof t.k)throw new Error("wrong k value for oct(symmetric) key");e+='"k":"'+t.k+'",',e+='"kty":"'+t.kty+'"}'}var r=fe(e);return ae(Zt.crypto.Util.hashHex(r,"sha256"))},Zt.jws.IntDate={},Zt.jws.IntDate.get=function(t){var e=Zt.jws.IntDate,r=e.getNow,n=e.getZulu;if("now"==t)return r();if("now + 1hour"==t)return r()+3600;if("now + 1day"==t)return r()+86400;if("now + 1month"==t)return r()+2592e3;if("now + 1year"==t)return r()+31536e3;if(t.match(/Z$/))return n(t);if(t.match(/^[0-9]+$/))return parseInt(t);throw"unsupported format: "+t},Zt.jws.IntDate.getZulu=function(t){return de(t)},Zt.jws.IntDate.getNow=function(){return~~(new Date/1e3)},Zt.jws.IntDate.intDate2UTCString=function(t){return new Date(1e3*t).toUTCString()},Zt.jws.IntDate.intDate2Zulu=function(t){var e=new Date(1e3*t);return("0000"+e.getUTCFullYear()).slice(-4)+("00"+(e.getUTCMonth()+1)).slice(-2)+("00"+e.getUTCDate()).slice(-2)+("00"+e.getUTCHours()).slice(-2)+("00"+e.getUTCMinutes()).slice(-2)+("00"+e.getUTCSeconds()).slice(-2)+"Z"},void 0!==Zt&&Zt||(Zt={}),void 0!==Zt.jws&&Zt.jws||(Zt.jws={}),Zt.jws.JWSJS=function(){var t=Zt.jws.JWS,e=t.readSafeJSONString;this.aHeader=[],this.sPayload="",this.aSignature=[],this.init=function(){this.aHeader=[],this.sPayload=void 0,this.aSignature=[]},this.initWithJWS=function(t){this.init();var e=t.split(".");if(3!=e.length)throw"malformed input JWS";this.aHeader.push(e[0]),this.sPayload=e[1],this.aSignature.push(e[2])},this.addSignature=function(t,e,r,n){if(void 0===this.sPayload||null===this.sPayload)throw"there's no JSON-JS signature to add.";var i=this.aHeader.length;if(this.aHeader.length!=this.aSignature.length)throw"aHeader.length != aSignature.length";try{var s=Zt.jws.JWS.sign(t,e,this.sPayload,r,n).split(".");this.aHeader.push(s[0]),this.aSignature.push(s[2])}catch(t){throw this.aHeader.length>i&&this.aHeader.pop(),this.aSignature.length>i&&this.aSignature.pop(),"addSignature failed: "+t}},this.verifyAll=function(t){if(this.aHeader.length!==t.length||this.aSignature.length!==t.length)return!1;for(var e=0;e<t.length;e++){var r=t[e];if(2!==r.length)return!1;if(!1===this.verifyNth(e,r[0],r[1]))return!1}return!0},this.verifyNth=function(e,r,n){if(this.aHeader.length<=e||this.aSignature.length<=e)return!1;var i=this.aHeader[e],s=this.aSignature[e],a=i+"."+this.sPayload+"."+s,o=!1;try{o=t.verify(a,r,n)}catch(t){return!1}return o},this.readJWSJS=function(t){if("string"==typeof t){var r=e(t);if(null==r)throw"argument is not safe JSON object string";this.aHeader=r.headers,this.sPayload=r.payload,this.aSignature=r.signatures}else try{if(!(t.headers.length>0))throw"malformed header";if(this.aHeader=t.headers,"string"!=typeof t.payload)throw"malformed signatures";if(this.sPayload=t.payload,!(t.signatures.length>0))throw"malformed signatures";this.aSignature=t.signatures}catch(t){throw"malformed JWS-JS JSON object: "+t}},this.getJSON=function(){return{headers:this.aHeader,payload:this.sPayload,signatures:this.aSignature}},this.isEmpty=function(){return 0==this.aHeader.length?1:0}};var Me=Zt;function Ke(t){const e=["","","","","","","","","","",""];if("number"!=typeof t||isNaN(t)||!isFinite(t))return e;if(t>999999999.99)return console.warn("金额过大,最大支持999999999.99元"),e;if(t<0)return console.warn("金额不能为负数"),e;if(0===t)return e;const r=Math.abs(t).toFixed(2),[n,i]=r.split("."),s=n.length;for(let t=0;t<s;t++){const r=n[s-1-t],i=8-t;i>=0&&(e[i]=r)}return(parseInt(n)>0||parseInt(i)>0)&&(e[9]=i[0],e[10]=i[1]),e}const Ue=()=>{const t=new Date;return`${t.getFullYear()}-${(t.getMonth()+1).toString().padStart(2,"0")}`};function ze(t,e){if(!isFinite(t)||0===t)return t.toFixed(2);const r=Math.trunc(100*t)/100;return Object.is(r,-0)?"-0.00":r.toFixed(e)}const We=(t,e,r,n=!1)=>{if(null==t||isNaN(Number(t)))return n?"0":"";let i=Number(t);if(0===i&&!n)return"";void 0!==r&&"number"==typeof r&&r>=0?i=i.toFixed(r):void 0!==e&&"number"==typeof e&&e>=0&&(i=i.toFixed(e));const s=i.toString().split("."),a=s[0],o=s[1]||"",u=a.replace(/\B(?=(\d{3})+(?!\d))/g,",");return o?`${u}.${o}`:u};function Ge(t){if("string"!=typeof t){const e="文件地址必须是字符串,当前传入类型:"+typeof t;return console.error("[handleViewFile] 错误:",e),{success:!1,error:e}}if(!t.trim()){const t="文件地址不能为空或仅空格";return console.error("[handleViewFile] 错误:",t),{success:!1,error:t}}let e;try{e=new URL(t)}catch(e){const r=`无效的URL格式:${t}(请检查是否包含特殊字符或缺失协议)`;return console.error("[handleViewFile] URL解析错误:",e,"| 地址:",t),{success:!1,error:r}}if(!["http:","https:"].includes(e.protocol)){const t=`仅支持HTTP/HTTPS协议,当前协议:${e.protocol}`;return console.error("[handleViewFile] 协议错误:",t),{success:!1,error:t}}const r=e.pathname,n=r.lastIndexOf(".");if(-1===n){const e=`文件地址不含后缀名:${t}(需是jpg/png/pdf)`;return console.error("[handleViewFile] 格式错误:",e),{success:!1,error:e}}const i=r.slice(n+1).toLowerCase(),s=["jpg","jpeg","png","pdf"];if(!s.includes(i)){const t=`不支持的文件格式:.${i},仅支持${s.join("、")}`;return console.error("[handleViewFile] 格式错误:",t),{success:!1,error:t}}try{if(!window.open(t,"_blank","noopener,noreferrer,width=1000,height=800")){const t="文件窗口被浏览器拦截,请允许弹窗后重试(地址栏右侧查看拦截提示)";return console.warn("[handleViewFile] 弹窗被拦截:",t),{success:!1,error:t}}return console.log("[handleViewFile] 成功:文件已在新窗口打开,地址:",t),{success:!0,message:"文件已在新窗口打开"}}catch(e){const r=`打开文件失败:${e.message}(可能是浏览器安全设置或网络问题)`;return console.error("[handleViewFile] 打开失败:",e,"| 地址:",t),{success:!1,error:r}}}const $e=async(e,r,n)=>{try{const e=await fetch(r,{method:"get",headers:{token:m()||cookie.get("token")},responseType:"blob"});if(!e.ok)return t.error("请求失败"),!1;const i=await e.blob();if(i.type&&i.type.includes("application/json")){const e=await i.text();try{const r=JSON.parse(e);if(r&&r.msg)return t.error(r.msg),void(401===r.code&&setTimeout(()=>{window.location.href="/login?redirect="+encodeURIComponent(window.location.href)},2e3))}catch{console.warn("")}}const s=e.headers.get("content-disposition");let a=n;if(s){const t=s.match(/filename="?([^"]+)"?/);t&&t[1]&&(a=decodeURIComponent(t[1]))}const o=window.URL.createObjectURL(i),u=document.createElement("a");u.href=o,u.download=a,document.body.appendChild(u),u.click(),t.success("下载成功"),window.URL.revokeObjectURL(o),document.body.removeChild(u)}catch(e){console.error("下载Excel失败:",e),t.error("下载失败")}},Je=async(e,r,n,i)=>{try{const e=await fetch(r,{method:"post",headers:{token:m(),"Content-Type":"application/json"},body:JSON.stringify(i)});if(!e.ok)return t.error("请求失败"),!1;const s=await e.blob();if(s.type&&s.type.includes("application/json")){const e=await s.text();try{const r=JSON.parse(e);if(r&&r.msg)return t.error(r.msg),401===r.code&&setTimeout(()=>{window.location.href="/login?redirect="+encodeURIComponent(window.location.href)},2e3),!1}catch{console.warn("解析JSON失败")}}const a=e.headers.get("content-disposition");let o=n;if(a){const t=a.match(/filename\*=UTF-8''([^;]+)/i);if(t&&t[1])o=decodeURIComponent(t[1]);else{const t=a.match(/filename=(?:"([^"]+)"|([^;]+))/i);if(t){let e=t[1]||t[2];try{o=decodeURIComponent(e)}catch(t){o=e}}}}const u=window.URL.createObjectURL(s),c=document.createElement("a");return c.style.display="none",c.href=u,c.download=o,document.body.appendChild(c),c.click(),t.success("下载成功"),setTimeout(()=>{window.URL.revokeObjectURL(u),document.body.removeChild(c)},1e3),!0}catch(e){return console.error("下载文件失败:",e),t.error("下载失败"),!1}},Ye=t=>{if(!t||"string"!=typeof t)return"unknown";const e=t.split("?")[0].match(/\.([a-zA-Z0-9]+)$/);if(!e)return"unknown";const r=e[1].toLowerCase();return/^pdf$/i.test(r)?"pdf":/^(jpg|jpeg|png|gif|bmp|webp|svg|ico|tiff|tif|heic|heif)$/i.test(r)?"image":/^(xlsx|xls)$/i.test(r)?"xlsx":"unknown"};function Xe(t,e){console.log(t,e);const r=new Me.crypto.Signature({alg:"SHA256withRSA",prov:"cryptojs/jsrsa"});return r.init(e),r.updateString(t),r.sign()}function Ze(t){if(!t)return"";const[e,r]=t.split("-");return`${e}-${r}-01`}function Qe(){const t=new Date;return`${t.getFullYear()}${String(t.getMonth()+1).padStart(2,"0")}${String(t.getDate()).padStart(2,"0")}${String(t.getHours()).padStart(2,"0")}${String(t.getMinutes()).padStart(2,"0")}${String(t.getSeconds()).padStart(2,"0")}`}function tr(t,e={}){const{emptyObject:r={},preserveOriginal:n=!1}=e;if(!Array.isArray(t))throw new Error("参数必须是数组");const i=[];return t.forEach((t,e)=>{if(!t||"object"!=typeof t)return;const s=t.voucherList;if(!Array.isArray(s)){const s=n?{...t}:{...t,_metadata:{originalIndex:e,isPadded:!0,originalLength:0}};return s.voucherList=[{...r},{...r},{...r},{...r},{...r}],s.page=1,s.pageCount=1,void i.push(s)}const a=Math.ceil(s.length/5);if(s.length>5)for(let o=0;o<s.length;o+=5){const u=s.slice(o,o+5),c=Math.floor(o/5)+1,h=[...u];for(;h.length<5;)h.push({...r});const l=n?{...t}:{...t,_metadata:{originalIndex:e,isSplit:o>0,chunkIndex:Math.floor(o/5),totalChunks:a}};l.voucherList=h,l.page=c,l.pageCount=a,i.push(l)}else if(s.length<5){const a=s.map(t=>({...t}));for(;a.length<5;)a.push({...r});const o=n?{...t}:{...t,_metadata:{originalIndex:e,isPadded:!0,originalLength:s.length}};o.voucherList=a,o.page=1,o.pageCount=1,i.push(o)}else{const r=n?{...t}:{...t,_metadata:{originalIndex:e,isOriginal:!0}};r.page=1,r.pageCount=1,i.push(r)}}),i}const er=(t,e)=>{const r=document.createElement("a");if(r.style.display="none","string"==typeof t)r.href=t;else{if(!(t instanceof Blob))return void console.error("不支持的文件源类型");r.href=URL.createObjectURL(t)}r.setAttribute("download",e),document.body.appendChild(r),r.click(),document.body.removeChild(r),t instanceof Blob&&window.URL.revokeObjectURL(r.href)},rr=t=>{const e=new Date,r=e.getFullYear(),n=e.getMonth(),i=t.getFullYear(),s=t.getMonth();if(0===n){return!(i===r-1&&11===s||i===r)}return i!==r},nr=(t,e=300)=>{let r=null;return function(...n){r&&clearTimeout(r),r=setTimeout(()=>{t.apply(this,n)},e)}};function ir(){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";let e="";for(let r=0;r<32;r++)if("undefined"!=typeof crypto&&crypto.getRandomValues){const r=new Uint8Array(1);crypto.getRandomValues(r);const n=r[0]%62;e+=t.charAt(n)}else{const r=Math.floor(62*Math.random());e+=t.charAt(r)}return e}function sr(t=13){if(10===t)return Math.floor(Date.now()/1e3);if(13===t)return Date.now();throw new Error("只支持10位或13位时间戳")}const ar=(t=[],e="",{keepEmpty:r=!1}={})=>{if(!Array.isArray(t))return[];const n=e.split(".").filter(t=>t.trim());return t.map(t=>{let e=t;for(const t of n)if(e=e?.[t],null==e)break;return e}).filter(t=>r||null!=t)};function or(t){const e=String(t).replace(/%/g,""),r=Number(e);return isNaN(r)?0:r}const ur=(t,e)=>t.reduce((t,r)=>t+("number"!=typeof r[e]||isNaN(r[e])?0:r[e]),0),cr=t=>{const e=new Date,r=e.getFullYear(),n=e.getMonth(),i=t.getFullYear(),s=t.getMonth();return i>r||i===r&&s>=n},hr=e=>{if(!e)return void t.warning("暂无可复制内容");const r=document.createElement("input");r.value=e,document.body.appendChild(r),r.select(),document.execCommand("copy"),document.body.removeChild(r),t.success("复制成功")},lr=(t,e=!1)=>t.map(t=>{const r={title:t.name};return t.url&&(r.path=t.url),t.icon&&(r.svgName=t.icon),t.type&&(r.type=t.type),t.code&&(r.code=t.code),e?t.children&&t.children.length>0&&0===t.type&&(r.children=lr(t.children)):t.children&&t.children.length>0&&(r.children=lr(t.children)),r});function fr(t){return Array.isArray(t)?t.filter(t=>1===t.type||void 0===t.type).map(t=>{const e={title:t.title,...t.path&&{path:t.path},...t.svgName&&{svgName:t.svgName},...t.code&&{code:t.code}};if(t.children&&t.children.length){const r=fr(t.children);r.length&&(e.children=r)}return e}):[]}const pr=t=>null==t||isNaN(t)?"":Number(t).toLocaleString("zh-CN",{minimumFractionDigits:2,maximumFractionDigits:2}),gr=t=>{if(!t||!t.length)return;t.forEach(t=>{1==t.draftCalType&&(t.currentAmount=0)});let e=null;t.forEach(t=>{if(1==t.draftCalType)e=t;else if((2==t.draftCalType||3==t.draftCalType)&&e){const r=Number(t.currentAmount)||0,n=-1===t.calDirection?-1:1;e.currentAmount=(e.currentAmount||0)+r*n}})},dr=(t,e)=>{const r=t.operations.indexOf(e);r>-1&&t.operations.splice(r,1)};function vr(t,e={}){const{typeKey:r="type",codeKey:n="code",targetType:i=2,childrenKey:s="children"}=e,a=[],o=t=>{Array.isArray(t)&&t.forEach(t=>{2!==t[r]&&1!==t[r]||!t[n]||a.push(t[n]),t[s]&&Array.isArray(t[s])&&t[s].length>0&&o(t[s])})};return o(t),a}const mr={install(t,e={}){const{getPermissions:r,directiveName:n="permission"}=e;if("function"!=typeof r)return void console.error("[PermissionPlugin]: getPermissions 必须是一个返回数组的函数");const i=t=>{const e=r()||[];if(!t)return!0;return(Array.isArray(t)?t:[t]).some(t=>e.includes(t))};t.config.globalProperties.$hasPermission=i,t.provide("hasPermission",i),t.directive(n,{mounted(t,e){const{value:r}=e;if(!r)return void console.warn(`[PermissionPlugin]: 需要指定权限标识,例如 v-${n}="'USER_ADD'"`);const s=()=>{!i(r)&&t.parentNode&&t.parentNode.removeChild(t)};s(),t._permission_check=s},updated(t,e){t._permission_check&&t._permission_check()}})}},yr=t=>{if(t&&2===t.length){if(t[0].split("-")[0]!==t[1].split("-")[0])return!1}return!0},wr=(t,e,r,n)=>{const i=t.querySelector(e);i&&i.scrollIntoView({behavior:"smooth",block:"center"}),setTimeout(()=>{r.value=""},n)},xr=(t,e)=>((t??1)-1)*e+"px";function Sr(t={}){const{allowedExtensions:e=[],onDropFiles:a,enabled:o=r(!0)}=t,u=r(!1);let c=0;const h=t=>{s(o)&&(t.preventDefault(),c++,1===c&&(u.value=!0))},l=t=>{s(o)&&(t.preventDefault(),c--,0===c&&(u.value=!1))},f=t=>{s(o)&&t.preventDefault()},p=t=>{if(!s(o))return;t.preventDefault(),c=0,u.value=!1;const r=Array.from(t.dataTransfer.files);if(0===r.length)return;const n=[],i=[];r.forEach(t=>{const r="."+t.name.split(".").pop().toLowerCase();0===e.length||e.includes(r)?n.push(t):i.push(t)}),a&&a(n,i)};return n(()=>{window.addEventListener("dragenter",h),window.addEventListener("dragleave",l),window.addEventListener("dragover",f),window.addEventListener("drop",p)}),i(()=>{window.removeEventListener("dragenter",h),window.removeEventListener("dragleave",l),window.removeEventListener("dragover",f),window.removeEventListener("drop",p)}),{isGlobalDragging:u}}const Er=(e,r=10)=>{const n=1024*r*1024;return e.size>n?(t.error(`文件 ${e.name} 太大,最大支持${r}MB`),!1):(console.log("准备上传文件:",e),!0)};function br(t){const[e,r]=t.split("-").map(Number),n=new Date(e,r-1,1);n.setMonth(n.getMonth()-1);return`${n.getFullYear()}-${String(n.getMonth()+1).padStart(2,"0")}`}const Fr=(t,e="key")=>{if(!t||0===t.length)return"";const r=t.reduce((t,e)=>e.value<t.value?e:t,t[0]);return r[e]},Ar=(t,e)=>{const r=`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}`;return!e.map(t=>t.accountPeriod).includes(r)};function Cr(t){if(!t||"string"!=typeof t)return null;const e=t.lastIndexOf(".");return e>0?t.slice(e+1).toLowerCase():null}const Dr=t=>t<10?`0${t}`:t,Pr=(t,e=0,r=0)=>{const n=new Date(t);n.setHours(e,r,0,0);return`${n.getFullYear()}-${Dr(n.getMonth()+1)}-${Dr(n.getDate())} ${Dr(n.getHours())}:${Dr(n.getMinutes())}`},Ir=t=>{const e=new Date(t);e.setHours(0,0,0,0);const r=new Date;return r.setHours(0,0,0,0),e.getTime()<r.getTime()},Rr=(t,e,r)=>{const n=new Date(t).setHours(0,0,0,0),i=new Date(e).setHours(0,0,0,0),s=new Date(r).setHours(0,0,0,0);return n>=i&&n<=s},Tr=(t,e)=>new Date(t).setHours(0,0,0,0)===new Date(e).setHours(0,0,0,0),Nr=(t,e,r)=>{const n=new Date(t).setHours(0,0,0,0),i=new Date(e).setHours(0,0,0,0),s=new Date(r).setHours(0,0,0,0);return n>i&&n<=s},Or=(t="08:00",e="18:00")=>{const r=new Date,n=r.getFullYear(),i=String(r.getMonth()+1).padStart(2,"0"),s=String(r.getDate()).padStart(2,"0");return[`${n}-${i}-${s} ${t}`,`${n}-${i}-${s} ${e}`]},Br=t=>{const e=new Date;return e.setHours(0,0,0,0),t.getTime()<e.getTime()},_r=t=>{const e=document.createElement("a");e.href=t,e.target="_blank",e.rel="noopener noreferrer",document.body.appendChild(e),e.click(),document.body.removeChild(e)},jr=(t,e)=>{if(!e)return[...t];const r=[];return t.forEach(t=>{const n=((t,e)=>["code","name","openingBalance","debitTotal","creditTotal","yearTotal"].some(r=>String(t[r]||"").toLowerCase().includes(e)))(t,e),i=t.children?jr(t.children,e):[];if(n||i.length>0){const e={...t};t.children&&(e.children=i),r.push(e)}}),r},Hr=(t,e,r="children")=>{for(const n of t){if(n[r]&&n[r].includes(e))return n;if(n[r]){const t=Hr(n[r],e,r);if(t)return t}}return null},kr=t=>{t.forEach(t=>{t.auxInitialList&&t.auxInitialList.length>0&&(t.children||(t.children=[]),t.auxInitialList.forEach(e=>{const r={...e};r.code_0=r.code,r.code=r.subjectAuxCode,r.name=r.subjectAuxName,t.children.push(r)})),t.children&&t.children.length>0&&kr(t.children)})},Lr=t=>{if(null==t||""===String(t).trim())return 0;const e=Number(String(t).replace(/,/g,""));return isNaN(e)?0:e},Vr=t=>{t&&Array.isArray(t)&&t.forEach(t=>{t.auxInitialList&&t.auxInitialList.length>0&&(t.children||(t.children=[]),t.auxInitialList.forEach(e=>{const r={...e};r.code_0=r.code,r.code=r.subjectAuxCode,r.name=r.subjectAuxName,r.code||(r.code=r.code_0),t.children.push(r)})),t.children&&t.children.length>0&&Vr(t.children)})},qr=t=>t&&Array.isArray(t)?t.filter(t=>!t.code_0).map(t=>{const e={...t},r=e.children||[],n=r.filter(t=>!t.code_0),i=r.filter(t=>t.code_0);return i.length>0?e.auxInitialItemList=i.map(t=>{const e={...t};return e.code=e.code_0,e.auxInstanceCode=e.subjectAuxCode,e.openingBalance=Lr(e.openingBalance),e.debitTotal=Lr(e.debitTotal),e.creditTotal=Lr(e.creditTotal),e.yearTotal=Lr(e.yearTotal),e.originalOpeningBalance=Lr(e.originalOpeningBalance),e.originalDebitTotal=Lr(e.originalDebitTotal),e.originalCreditTotal=Lr(e.originalCreditTotal),e.originalYearTotal=Lr(e.originalYearTotal),e.openingQuantity=Lr(e.openingQuantity),e.debitQuantity=Lr(e.debitQuantity),e.creditQuantity=Lr(e.creditQuantity),e.yearQuantity=Lr(e.yearQuantity),delete e.code_0,e}):e.auxInitialItemList=[],e.openingBalance=Lr(e.openingBalance),e.debitTotal=Lr(e.debitTotal),e.creditTotal=Lr(e.creditTotal),e.yearTotal=Lr(e.yearTotal),e.originalOpeningBalance=Lr(e.originalOpeningBalance),e.originalDebitTotal=Lr(e.originalDebitTotal),e.originalCreditTotal=Lr(e.originalCreditTotal),e.originalYearTotal=Lr(e.originalYearTotal),e.openingQuantity=Lr(e.openingQuantity),e.debitQuantity=Lr(e.debitQuantity),e.creditQuantity=Lr(e.creditQuantity),e.yearQuantity=Lr(e.yearQuantity),n.length>0?e.children=qr(n):e.children=[],delete e.auxInitialList,e}):[],Mr=(t,e)=>{if(!Array.isArray(t))return!1;for(const r of t){if(e(r))return!0;if(r.children?.length&&Mr(r.children,e))return!0}return!1},Kr={0:1,1:2,2:3,6:4,7:5,8:6,3:7};function Ur(t,e){return e.slice(0,t).map((t,e)=>t<=1?"1":2===t?0===e?"11":"01":0===e?"1"+"0".repeat(t-2)+"1":"0"+"0".repeat(t-2)+"1").join("-")}const zr=[".el-input","input","textarea","button","a",'[contenteditable="true"]'];async function Wr({cell:t,event:e,selectSelector:r,nextTick:n,canOpen:i=()=>!0,ignoreSelectors:s=[]}){if("undefined"==typeof window||"undefined"==typeof Element)return!1;if(!(t instanceof HTMLElement&&t.isConnected&&i()))return!1;const a=e?.target;if(!(a instanceof Element&&t.contains(a)))return!1;const o=t.querySelector(r);if(!(o instanceof HTMLElement))return!1;const u=a.closest(".el-select");if(u&&u!==o)return!1;const c=o.querySelector(".el-select__wrapper"),h=o.querySelector('input[role="combobox"]');if(!(c instanceof HTMLElement&&h instanceof HTMLInputElement))return!1;if(c.contains(a))return!1;const l=[...zr,...s].join(", "),f=a.closest(l);if(f&&t.contains(f))return!1;const p=()=>i()&&t.isConnected&&o.isConnected&&t.querySelector(r)===o&&o.contains(h)&&o.contains(c)&&!h.disabled&&!o.classList.contains("is-disabled")&&!c.classList.contains("is-disabled");return await n(),!!p()&&(h.focus(),await n(),!(!p()||document.activeElement!==h)&&("false"===h.getAttribute("aria-expanded")&&c.click(),await n(),p()&&"true"===h.getAttribute("aria-expanded")))}const Gr=t=>{if(null==t)return!1;const e=String(t).trim().replace(/,/g,"");if(!e)return!1;const r=Number(e);return Number.isFinite(r)&&0!==r},$r=(t,e)=>Array.isArray(t)?t.reduce((t,r)=>{const n=$r(r.children,e);if(e.some(t=>Gr(r[t]))||n.length>0){const e={...r};Array.isArray(r.children)&&(e.children=n),t.push(e)}return t},[]):[];function Jr(t,e=0,r=500){if("string"!=typeof t||!t.trim())return console.error("[scrollToId] 错误:id必须是非空字符串"),!1;const n=document.getElementById(t);if(!n)return console.error(`[scrollToId] 错误:未找到ID为"${t}"的元素`),!1;const i=n.getBoundingClientRect().top+window.pageYOffset,s=window.pageYOffset,a=i-s-e;let o=null;return requestAnimationFrame(function t(e){null===o&&(o=e);const n=e-o,i=function(t,e,r,n){return t/=n/2,t<1?r/2*t*t+e:(t--,-r/2*(t*(t-2)-1)+e)}(n,s,a,r);window.scrollTo(0,i),n<r&&requestAnimationFrame(t)}),!0}const Yr=["/login","/404","/403","/register","/pay","/file-views","/iitc","/users/info"],Xr=["/login","/404","/403","/register","/pay","/file-views","/iitc","/users/info"],Zr=["/login","/404","/403","/register","/file-views","/iitc","/account"];
|
|
26
|
+
var Zt=function(){var t=new RegExp('(?:false|true|null|[\\{\\}\\[\\]]|(?:-?\\b(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?(?:[eE][+-]?[0-9]+)?\\b)|(?:"(?:[^\\0-\\x08\\x0a-\\x1f"\\\\]|\\\\(?:["/\\\\bfnrt]|u[0-9A-Fa-f]{4}))*"))',"g"),e=new RegExp("\\\\(?:([^u])|u(.{4}))","g"),r={'"':'"',"/":"/","\\":"\\",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"};function n(t,e,n){return e?r[e]:String.fromCharCode(parseInt(n,16))}var i=new String(""),s=Object.hasOwnProperty;return function(r,a){var o,u,c=r.match(t),h=c[0],l=!1;"{"===h?o={}:"["===h?o=[]:(o=[],l=!0);for(var f=[o],p=1-l,g=c.length;p<g;++p){var d;switch((h=c[p]).charCodeAt(0)){default:(d=f[0])[u||d.length]=+h,u=void 0;break;case 34:if(-1!==(h=h.substring(1,h.length-1)).indexOf("\\")&&(h=h.replace(e,n)),d=f[0],!u){if(!(d instanceof Array)){u=h||i;break}u=d.length}d[u]=h,u=void 0;break;case 91:d=f[0],f.unshift(d[u||d.length]=[]),u=void 0;break;case 93:case 125:f.shift();break;case 102:(d=f[0])[u||d.length]=!1,u=void 0;break;case 110:(d=f[0])[u||d.length]=null,u=void 0;break;case 116:(d=f[0])[u||d.length]=!0,u=void 0;break;case 123:d=f[0],f.unshift(d[u||d.length]={}),u=void 0}}if(l){if(1!==f.length)throw new Error;o=o[0]}else if(f.length)throw new Error;if(a){var v=function(t,e){var r=t[e];if(r&&"object"==typeof r){var n=null;for(var i in r)if(s.call(r,i)&&r!==t){var o=v(r,i);void 0!==o?r[i]=o:(n||(n=[]),n.push(i))}if(n)for(var u=n.length;--u>=0;)delete r[n[u]]}return a.call(t,e,r)};o=v({"":o},"")}return o}}();void 0!==Qt&&Qt||(Qt={}),void 0!==Qt.asn1&&Qt.asn1||(Qt.asn1={}),Qt.asn1.ASN1Util=new function(){this.integerToByteHex=function(t){var e=t.toString(16);return e.length%2==1&&(e="0"+e),e},this.bigIntToMinTwosComplementsHex=function(t){return Oe(t)},this.getPEMStringFromHex=function(t,e){return ge(t,e)},this.newObject=function(t){var e=Qt.asn1,r=e.ASN1Object,n=e.DERBoolean,i=e.DERInteger,s=e.DERBitString,a=e.DEROctetString,o=e.DERNull,u=e.DERObjectIdentifier,c=e.DEREnumerated,h=e.DERUTF8String,l=e.DERNumericString,f=e.DERPrintableString,p=e.DERTeletexString,g=e.DERIA5String,d=e.DERUTCTime,v=e.DERGeneralizedTime,m=e.DERVisibleString,y=e.DERBMPString,w=e.DERSequence,x=e.DERSet,S=e.DERTaggedObject,E=e.ASN1Util.newObject;if(t instanceof e.ASN1Object)return t;var b=Object.keys(t);if(1!=b.length)throw new Error("key of param shall be only one.");var F=b[0];if(-1==":asn1:bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:visstr:bmpstr:seq:set:tag:".indexOf(":"+F+":"))throw new Error("undefined key: "+F);if("bool"==F)return new n(t[F]);if("int"==F)return new i(t[F]);if("bitstr"==F)return new s(t[F]);if("octstr"==F)return new a(t[F]);if("null"==F)return new o(t[F]);if("oid"==F)return new u(t[F]);if("enum"==F)return new c(t[F]);if("utf8str"==F)return new h(t[F]);if("numstr"==F)return new l(t[F]);if("prnstr"==F)return new f(t[F]);if("telstr"==F)return new p(t[F]);if("ia5str"==F)return new g(t[F]);if("utctime"==F)return new d(t[F]);if("gentime"==F)return new v(t[F]);if("visstr"==F)return new m(t[F]);if("bmpstr"==F)return new y(t[F]);if("asn1"==F)return new r(t[F]);if("seq"==F){for(var A=t[F],D=[],C=0;C<A.length;C++){var I=E(A[C]);D.push(I)}return new w({array:D})}if("set"==F){for(A=t[F],D=[],C=0;C<A.length;C++){I=E(A[C]);D.push(I)}return new x({array:D})}if("tag"==F){var P=t[F];if("[object Array]"===Object.prototype.toString.call(P)&&3==P.length){var R=E(P[2]);return new S({tag:P[0],explicit:P[1],obj:R})}return new S(P)}},this.jsonToASN1HEX=function(t){return this.newObject(t).tohex()}},Qt.asn1.ASN1Util.oidHexToInt=function(t){for(var e="",r=parseInt(t.substr(0,2),16),n=(e=Math.floor(r/40)+"."+r%40,""),i=2;i<t.length;i+=2){var s=("00000000"+parseInt(t.substr(i,2),16).toString(2)).slice(-8);if(n+=s.substr(1,7),"0"==s.substr(0,1))e=e+"."+new lt(n,2).toString(10),n=""}return e},Qt.asn1.ASN1Util.oidIntToHex=function(t){var e=function(t){var e=t.toString(16);return 1==e.length&&(e="0"+e),e},r=function(t){var r="",n=new lt(t,10).toString(2),i=7-n.length%7;7==i&&(i=0);for(var s="",a=0;a<i;a++)s+="0";n=s+n;for(a=0;a<n.length-1;a+=7){var o=n.substr(a,7);a!=n.length-7&&(o="1"+o),r+=e(parseInt(o,2))}return r};if(!t.match(/^[0-9.]+$/))throw"malformed oid string: "+t;var n="",i=t.split("."),s=40*parseInt(i[0])+parseInt(i[1]);n+=e(s),i.splice(0,2);for(var a=0;a<i.length;a++)n+=r(i[a]);return n},Qt.asn1.ASN1Object=function(t){this.params=null,this.getLengthHexFromValue=function(){if(void 0===this.hV||null==this.hV)throw new Error("this.hV is null or undefined");if(this.hV.length%2==1)throw new Error("value hex must be even length: n=0,v="+this.hV);var t=this.hV.length/2,e=t.toString(16);if(e.length%2==1&&(e="0"+e),t<128)return e;var r=e.length/2;if(r>15)throw new Error("ASN.1 length too long to represent by 8x: n = "+t.toString(16));return(128+r).toString(16)+e},this.tohex=function(){return(null==this.hTLV||this.isModified)&&(this.hV=this.getFreshValueHex(),this.hL=this.getLengthHexFromValue(),this.hTLV=this.hT+this.hL+this.hV,this.isModified=!1),this.hTLV},this.getEncodedHex=function(){return this.tohex()},this.getValueHex=function(){return this.tohex(),this.hV},this.getFreshValueHex=function(){return""},this.setByParam=function(t){this.params=t},null!=t&&null!=t.tlv&&(this.hTLV=t.tlv,this.isModified=!1)},Qt.asn1.DERAbstractString=function(t){Qt.asn1.DERAbstractString.superclass.constructor.call(this),this.getString=function(){return this.s},this.setString=function(t){this.hTLV=null,this.isModified=!0,this.s=t,this.hV=ce(this.s).toLowerCase()},this.setStringHex=function(t){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=t},this.getFreshValueHex=function(){return this.hV},void 0!==t&&("string"==typeof t?this.setString(t):void 0!==t.str?this.setString(t.str):void 0!==t.hex&&this.setStringHex(t.hex))},He(Qt.asn1.DERAbstractString,Qt.asn1.ASN1Object),Qt.asn1.DERAbstractTime=function(t){Qt.asn1.DERAbstractTime.superclass.constructor.call(this),this.localDateToUTC=function(t){var e=t.getTime()+6e4*t.getTimezoneOffset();return new Date(e)},this.formatDate=function(t,e,r){var n=this.zeroPadding,i=this.localDateToUTC(t),s=String(i.getFullYear());"utc"==e&&(s=s.substr(2,2));var a=s+n(String(i.getMonth()+1),2)+n(String(i.getDate()),2)+n(String(i.getHours()),2)+n(String(i.getMinutes()),2)+n(String(i.getSeconds()),2);if(!0===r){var o=i.getMilliseconds();if(0!=o){var u=n(String(o),3);a=a+"."+(u=u.replace(/[0]+$/,""))}}return a+"Z"},this.zeroPadding=function(t,e){return t.length>=e?t:new Array(e-t.length+1).join("0")+t},this.setByParam=function(t){this.hV=null,this.hTLV=null,this.params=t},this.getString=function(){},this.setString=function(t){this.hTLV=null,this.isModified=!0,null==this.params&&(this.params={}),this.params.str=t},this.setByDate=function(t){this.hTLV=null,this.isModified=!0,null==this.params&&(this.params={}),this.params.date=t},this.setByDateValue=function(t,e,r,n,i,s){var a=new Date(Date.UTC(t,e-1,r,n,i,s,0));this.setByDate(a)},this.getFreshValueHex=function(){return this.hV}},He(Qt.asn1.DERAbstractTime,Qt.asn1.ASN1Object),Qt.asn1.DERAbstractStructured=function(t){Qt.asn1.DERAbstractString.superclass.constructor.call(this),this.setByASN1ObjectArray=function(t){this.hTLV=null,this.isModified=!0,this.asn1Array=t},this.appendASN1Object=function(t){this.hTLV=null,this.isModified=!0,this.asn1Array.push(t)},this.asn1Array=new Array,void 0!==t&&void 0!==t.array&&(this.asn1Array=t.array)},He(Qt.asn1.DERAbstractStructured,Qt.asn1.ASN1Object),Qt.asn1.DERBoolean=function(t){Qt.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",this.hTLV=0==t?"010100":"0101ff"},He(Qt.asn1.DERBoolean,Qt.asn1.ASN1Object),Qt.asn1.DERInteger=function(t){Qt.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.params=null;var e=Oe;this.setByBigInteger=function(t){this.isModified=!0,this.params={bigint:t}},this.setByInteger=function(t){this.isModified=!0,this.params=t},this.setValueHex=function(t){this.isModified=!0,this.params={hex:t}},this.getFreshValueHex=function(){var t=this.params,r=null;if(null==t)throw new Error("value not set");if("object"==typeof t&&null!=t.hex)return this.hV=t.hex,this.hV;if("number"==typeof t)r=new lt(String(t),10);else if(null!=t.int)r=new lt(String(t.int),10);else{if(null==t.bigint)throw new Error("wrong parameter");r=t.bigint}return this.hV=e(r),this.hV},null!=t&&(this.params=t)},He(Qt.asn1.DERInteger,Qt.asn1.ASN1Object),Qt.asn1.DERBitString=function(t){if(void 0!==t&&void 0!==t.obj){var e=Qt.asn1.ASN1Util.newObject(t.obj);t.hex="00"+e.tohex()}Qt.asn1.DERBitString.superclass.constructor.call(this),this.hT="03",this.setHexValueIncludingUnusedBits=function(t){this.hTLV=null,this.isModified=!0,this.hV=t},this.setUnusedBitsAndHexValue=function(t,e){if(t<0||7<t)throw"unused bits shall be from 0 to 7: u = "+t;var r="0"+t;this.hTLV=null,this.isModified=!0,this.hV=r+e},this.setByBinaryString=function(t){var e=8-(t=t.replace(/0+$/,"")).length%8;8==e&&(e=0),t+="0000000".substr(0,e);for(var r="",n=0;n<t.length-1;n+=8){var i=t.substr(n,8),s=parseInt(i,2).toString(16);1==s.length&&(s="0"+s),r+=s}this.hTLV=null,this.isModified=!0,this.hV="0"+e+r},this.setByBooleanArray=function(t){for(var e="",r=0;r<t.length;r++)1==t[r]?e+="1":e+="0";this.setByBinaryString(e)},this.newFalseArray=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=!1;return e},this.getFreshValueHex=function(){return this.hV},void 0!==t&&("string"==typeof t&&t.toLowerCase().match(/^[0-9a-f]+$/)?this.setHexValueIncludingUnusedBits(t):void 0!==t.hex?this.setHexValueIncludingUnusedBits(t.hex):void 0!==t.bin?this.setByBinaryString(t.bin):void 0!==t.array&&this.setByBooleanArray(t.array))},He(Qt.asn1.DERBitString,Qt.asn1.ASN1Object),Qt.asn1.DEROctetString=function(t){if(void 0!==t&&void 0!==t.obj){var e=Qt.asn1.ASN1Util.newObject(t.obj);t.hex=e.tohex()}Qt.asn1.DEROctetString.superclass.constructor.call(this,t),this.hT="04"},He(Qt.asn1.DEROctetString,Qt.asn1.DERAbstractString),Qt.asn1.DERNull=function(){Qt.asn1.DERNull.superclass.constructor.call(this),this.hT="05",this.hTLV="0500"},He(Qt.asn1.DERNull,Qt.asn1.ASN1Object),Qt.asn1.DERObjectIdentifier=function(t){Qt.asn1.DERObjectIdentifier.superclass.constructor.call(this),this.hT="06",this.setValueHex=function(t){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=t},this.setValueOidString=function(t){var e=function(t){var e=function(t){var e=t.toString(16);return 1==e.length&&(e="0"+e),e},r=function(t){var r="",n=parseInt(t,10).toString(2),i=7-n.length%7;7==i&&(i=0);for(var s="",a=0;a<i;a++)s+="0";n=s+n;for(a=0;a<n.length-1;a+=7){var o=n.substr(a,7);a!=n.length-7&&(o="1"+o),r+=e(parseInt(o,2))}return r};try{if(!t.match(/^[0-9.]+$/))return null;var n="",i=t.split("."),s=40*parseInt(i[0],10)+parseInt(i[1],10);n+=e(s),i.splice(0,2);for(var a=0;a<i.length;a++)n+=r(i[a]);return n}catch(t){return null}}(t);if(null==e)throw new Error("malformed oid string: "+t);this.hTLV=null,this.isModified=!0,this.s=null,this.hV=e},this.setValueName=function(t){var e=Qt.asn1.x509.OID.name2oid(t);if(""===e)throw new Error("DERObjectIdentifier oidName undefined: "+t);this.setValueOidString(e)},this.setValueNameOrOid=function(t){t.match(/^[0-2].[0-9.]+$/)?this.setValueOidString(t):this.setValueName(t)},this.getFreshValueHex=function(){return this.hV},this.setByParam=function(t){"string"==typeof t?this.setValueNameOrOid(t):void 0!==t.oid?this.setValueNameOrOid(t.oid):void 0!==t.name?this.setValueNameOrOid(t.name):void 0!==t.hex&&this.setValueHex(t.hex)},void 0!==t&&this.setByParam(t)},He(Qt.asn1.DERObjectIdentifier,Qt.asn1.ASN1Object),Qt.asn1.DEREnumerated=function(t){Qt.asn1.DEREnumerated.superclass.constructor.call(this),this.hT="0a",this.setByBigInteger=function(t){this.hTLV=null,this.isModified=!0,this.hV=Oe(t)},this.setByInteger=function(t){var e=new lt(String(t),10);this.setByBigInteger(e)},this.setValueHex=function(t){this.hV=t},this.getFreshValueHex=function(){return this.hV},void 0!==t&&(void 0!==t.int?this.setByInteger(t.int):"number"==typeof t?this.setByInteger(t):void 0!==t.hex&&this.setValueHex(t.hex))},He(Qt.asn1.DEREnumerated,Qt.asn1.ASN1Object),Qt.asn1.DERUTF8String=function(t){Qt.asn1.DERUTF8String.superclass.constructor.call(this,t),this.hT="0c"},He(Qt.asn1.DERUTF8String,Qt.asn1.DERAbstractString),Qt.asn1.DERNumericString=function(t){Qt.asn1.DERNumericString.superclass.constructor.call(this,t),this.hT="12"},He(Qt.asn1.DERNumericString,Qt.asn1.DERAbstractString),Qt.asn1.DERPrintableString=function(t){Qt.asn1.DERPrintableString.superclass.constructor.call(this,t),this.hT="13"},He(Qt.asn1.DERPrintableString,Qt.asn1.DERAbstractString),Qt.asn1.DERTeletexString=function(t){Qt.asn1.DERTeletexString.superclass.constructor.call(this,t),this.hT="14"},He(Qt.asn1.DERTeletexString,Qt.asn1.DERAbstractString),Qt.asn1.DERIA5String=function(t){Qt.asn1.DERIA5String.superclass.constructor.call(this,t),this.hT="16"},He(Qt.asn1.DERIA5String,Qt.asn1.DERAbstractString),Qt.asn1.DERVisibleString=function(t){Qt.asn1.DERIA5String.superclass.constructor.call(this,t),this.hT="1a"},He(Qt.asn1.DERVisibleString,Qt.asn1.DERAbstractString),Qt.asn1.DERBMPString=function(t){Qt.asn1.DERBMPString.superclass.constructor.call(this,t),this.hT="1e"},He(Qt.asn1.DERBMPString,Qt.asn1.DERAbstractString),Qt.asn1.DERUTCTime=function(t){Qt.asn1.DERUTCTime.superclass.constructor.call(this,t),this.hT="17",this.params=void 0,this.getFreshValueHex=function(){var t=this.params;if(null==this.params&&(t={date:new Date}),"string"==typeof t){if(!t.match(/^[0-9]{12}Z$/)&&!t.match(/^[0-9]{12}\.[0-9]+Z$/))throw new Error("malformed string for UTCTime: "+t);this.hV=ie(t)}else if(null!=t.str)this.hV=ie(t.str);else if(null==t.date&&1==t.millis){var e=new Date;this.hV=ie(this.formatDate(e,"utc",!0))}else if(null!=t.date&&t.date instanceof Date){var r=!0===t.millis;this.hV=ie(this.formatDate(t.date,"utc",r))}else t instanceof Date&&(this.hV=ie(this.formatDate(t,"utc")));if(null==this.hV)throw new Error("parameter not specified properly for UTCTime");return this.hV},null!=t&&this.setByParam(t)},He(Qt.asn1.DERUTCTime,Qt.asn1.DERAbstractTime),Qt.asn1.DERGeneralizedTime=function(t){Qt.asn1.DERGeneralizedTime.superclass.constructor.call(this,t),this.hT="18",this.params=t,this.getFreshValueHex=function(){var t=this.params;if(null==this.params&&(t={date:new Date}),"string"==typeof t){if(!t.match(/^[0-9]{14}Z$/)&&!t.match(/^[0-9]{14}\.[0-9]+Z$/))throw new Error("malformed string for GeneralizedTime: "+t);this.hV=ie(t)}else if(null!=t.str)this.hV=ie(t.str);else if(null==t.date&&1==t.millis){var e=new Date;this.hV=ie(this.formatDate(e,"gen",!0))}else if(null!=t.date&&t.date instanceof Date){var r=!0===t.millis;this.hV=ie(this.formatDate(t.date,"gen",r))}else t instanceof Date&&(this.hV=ie(this.formatDate(t,"gen")));if(null==this.hV)throw new Error("parameter not specified properly for GeneralizedTime");return this.hV},null!=t&&this.setByParam(t)},He(Qt.asn1.DERGeneralizedTime,Qt.asn1.DERAbstractTime),Qt.asn1.DERSequence=function(t){Qt.asn1.DERSequence.superclass.constructor.call(this,t),this.hT="30",this.getFreshValueHex=function(){for(var t="",e=0;e<this.asn1Array.length;e++){t+=this.asn1Array[e].tohex()}return this.hV=t,this.hV}},He(Qt.asn1.DERSequence,Qt.asn1.DERAbstractStructured),Qt.asn1.DERSet=function(t){Qt.asn1.DERSet.superclass.constructor.call(this,t),this.hT="31",this.sortFlag=!0,this.getFreshValueHex=function(){for(var t=new Array,e=0;e<this.asn1Array.length;e++){var r=this.asn1Array[e];t.push(r.tohex())}return 1==this.sortFlag&&t.sort(),this.hV=t.join(""),this.hV},void 0!==t&&void 0!==t.sortflag&&0==t.sortflag&&(this.sortFlag=!1)},He(Qt.asn1.DERSet,Qt.asn1.DERAbstractStructured),Qt.asn1.DERTaggedObject=function(t){Qt.asn1.DERTaggedObject.superclass.constructor.call(this);var e=Qt.asn1,r=re,n=r.getV;r.isASN1HEX;var i=e.ASN1Util.newObject;this.hT="a0",this.hV="",this.isExplicit=!0,this.asn1Object=null,this.params={tag:"a0",explicit:!0},this.setASN1Object=function(t,e,r){this.params={tag:e,explicit:t,obj:r}},this.getFreshValueHex=function(){var t=this.params;if(null==t.explicit&&(t.explicit=!0),null!=t.tage&&(t.tag=t.tage,t.explicit=!0),null!=t.tagi&&(t.tag=t.tagi,t.explicit=!1),null!=t.str)this.hV=ce(t.str);else if(null!=t.hex)this.hV=t.hex;else{if(null==t.obj)throw new Error("str, hex nor obj not specified");var r;t.obj instanceof e.ASN1Object?r=t.obj.tohex():"object"==typeof t.obj&&(r=i(t.obj).tohex()),t.explicit?this.hV=r:this.hV=n(r,0)}return null==t.tag&&(t.tag="a0"),this.hT=t.tag,this.hTLV=null,this.isModified=!0,this.hV},this.setByParam=function(t){this.params=t},void 0!==t&&this.setByParam(t)},He(Qt.asn1.DERTaggedObject,Qt.asn1.ASN1Object);var Qt,te,ee,re=new function(){};function ne(t){for(var e="",r=0;r<t.length;r++){var n=t[r].toString(16);1==n.length&&(n="0"+n),e+=n}return e}function ie(t){return ne(function(t){for(var e=new Array,r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}(t))}function se(t){return t=(t=(t=t.replace(/\=/g,"")).replace(/\+/g,"-")).replace(/\//g,"_")}function ae(t){return t.length%4==2?t+="==":t.length%4==3&&(t+="="),t=(t=t.replace(/-/g,"+")).replace(/_/g,"/")}function oe(t){return t.length%2==1&&(t="0"+t),se(ct(t))}function ue(t){return ht(ae(t))}function ce(t){return me(De(t)).toLowerCase()}function he(t){try{return decodeURIComponent(ye(t))}catch(t){return null}}function le(t){return he(function(t){for(var e=t.match(/.{1,2}/g),r=[],n=0;n<e.length;n++){var i=parseInt(e[n],16);161<=i&&i<=191?(r.push("c2"),r.push(e[n])):192<=i&&i<=255?(r.push("c3"),r.push((i-64).toString(16))):r.push(e[n])}return r.join("")}(t))}function fe(t){for(var e="",r=0;r<t.length-1;r+=2)e+=String.fromCharCode(parseInt(t.substr(r,2),16));return e}function pe(t){for(var e="",r=0;r<t.length;r++)e+=("0"+t.charCodeAt(r).toString(16)).slice(-2);return e}function ge(t,e){return"-----BEGIN "+e+"-----\r\n"+function(t,e){return(t=t.replace(new RegExp("(.{"+e+"})","g"),"$1\r\n")).replace(/\s+$/,"")}(function(t){return ct(t)}(t),64)+"\r\n-----END "+e+"-----\r\n"}function de(t,e){if(-1==t.indexOf("-----BEGIN "))throw new Error("can't find PEM header");return function(t){return ht(t.replace(/[^0-9A-Za-z\/+=]*/g,""))}(t=void 0!==e?(t=t.replace(new RegExp("^[^]*-----BEGIN "+e+"-----"),"")).replace(new RegExp("-----END "+e+"-----[^]*$"),""):(t=t.replace(/^[^]*-----BEGIN [^-]+-----/,"")).replace(/-----END [^-]+-----[^]*$/,""))}function ve(t){return Math.round(function(t){var e,r,n,i,s,a,o,u,c,h;if(t=function(t){return t.match(/^[0-9]{12}Z$/)||t.match(/^[0-9]{12}[.][0-9]*Z$/)?t.match(/^[0-4]/)?"20"+t:"19"+t:t}(t),h=t.match(/^(\d{4})(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)(|\.\d+)Z$/))return e=parseInt(h[1]),r=parseInt(h[2])-1,n=parseInt(h[3]),i=parseInt(h[4]),s=parseInt(h[5]),a=parseInt(h[6]),o=0,""!==(u=h[7])&&(c=(u.substr(1)+"00").substr(0,3),o=parseInt(c)),Date.UTC(e,r,n,i,s,a,o);throw new Error("unsupported zulu format: "+t)}(t)/1e3)}function me(t){return t.replace(/%/g,"")}function ye(t){return t.replace(/(..)/g,"%$1")}function we(t){var e="malformed IPv6 address";if(!t.match(/^[0-9A-Fa-f:]+$/))throw e;var r=(t=t.toLowerCase()).split(":").length-1;if(r<2)throw e;var n=":".repeat(7-r+2),i=(t=t.replace("::",n)).split(":");if(8!=i.length)throw e;for(var s=0;s<8;s++)i[s]=("0000"+i[s]).slice(-4);return i.join("")}function xe(t){if(!t.match(/^[0-9A-Fa-f]{32}$/))throw new Error("malformed IPv6 address: "+t);var e=(t=t.toLowerCase()).match(/.{1,4}/g);e=e.map(function(t){return t.replace(/^0+/,"")}),e=e.map(function(t){return""==t?"0":t});var r=(t=":"+e.join(":")+":").match(/:(0:){2,}/g);if(null==r)return t.slice(1,-1);var n=r.sort().slice(-1)[0];return"::"!=(t=t.replace(n.substr(0,n.length-1),":")).substr(0,2)&&(t=t.substr(1)),"::"!=t.substr(-2,2)&&(t=t.substr(0,t.length-1)),t}function Se(t){var e=new Error("malformed hex value");if(!t.match(/^([0-9A-Fa-f][0-9A-Fa-f]){1,}$/))throw e;if(8==t.length){try{return parseInt(t.substr(0,2),16)+"."+parseInt(t.substr(2,2),16)+"."+parseInt(t.substr(4,2),16)+"."+parseInt(t.substr(6,2),16)}catch(t){throw e}}else{if(16!=t.length){if(32==t.length)return xe(t);if(64==t.length){try{return xe(t.substr(0,32))+"/"+Ee(t.substr(32))}catch(t){throw e}return}return t}try{return Se(t.substr(0,8))+"/"+Ee(t.substr(8))}catch(t){throw e}}}function Ee(t){var e,r=new Error("malformed mask");try{e=new lt(t,16).toString(2)}catch(t){throw r}if(!e.match(/^1*0*$/))throw r;return e.replace(/0+$/,"").length}function be(t){var e=new Error("malformed IP address");if(!(t=t.toLowerCase(t)).match(/^[0-9a-f.:/]+$/))throw e;if(!t.match(/^[0-9.]+$/)){var r;if(t.match(/^[0-9.]+\/[0-9]+$/))return be((r=t.split("/"))[0])+Fe(parseInt(r[1]),32);if(t.match(/^[0-9a-f:]+$/)&&-1!==t.indexOf(":"))return we(t);if(t.match(/^[0-9a-f:]+\/[0-9]+$/)&&-1!==t.indexOf(":"))return we((r=t.split("/"))[0])+Fe(parseInt(r[1]),128);throw e}var n=t.split(".");if(4!==n.length)throw e;var i="";try{for(var s=0;s<4;s++){i+=("0"+parseInt(n[s]).toString(16)).slice(-2)}return i}catch(t){throw e}}function Fe(t,e){return 32==e&&0==t?"00000000":128==e&&0==t?"00000000000000000000000000000000":new lt(Array(t+1).join("1")+Array(e-t+1).join("0"),2).toString(16)}function Ae(t){var e=t.match(/.{4}/g).map(function(t){var e=parseInt(t.substr(0,2),16),r=parseInt(t.substr(2),16);if(0==e&r<128)return String.fromCharCode(r);if(e<8){var n=128|63&r;return he((192|(7&e)<<3|(192&r)>>6).toString(16)+n.toString(16))}n=128|(15&e)<<2|(192&r)>>6;var i=128|63&r;return he((224|(240&e)>>4).toString(16)+n.toString(16)+i.toString(16))});return e.join("")}function De(t){for(var e=encodeURIComponent(t),r="",n=0;n<e.length;n++)"%"==e[n]?(r+=e.substr(n,3),n+=2):r=r+"%"+ie(e[n]);return r}function Ce(t){return!(t.length%2!=0||!t.match(/^[0-9a-f]+$/)&&!t.match(/^[0-9A-F]+$/))}function Ie(t){return!!t.match(/^[0-9A-Za-z-_.]+$/)}function Pe(t){return t.length%2==1?"0"+t:t.substr(0,1)>"7"?"00"+t:t}function Re(t,e){if("string"!=typeof t||"string"!=typeof e)throw new Error("arguments shall be string");if(t.length!==e.length)throw new Error("input strings must have the same length");if("function"==typeof Buffer&&void 0!==qt){if(void 0!==qt.timingSafeEqual)return qt.timingSafeEqual(Buffer.from(t),Buffer.from(e));if(void 0!==qt.subtle&&qt.subtle.timingSafeEqual)return qt.subtle.timingSafeEqual(Buffer.from(t),Buffer.from(e))}return function(t,e){if("string"!=typeof t||"string"!=typeof e)throw new Error("arguments shall be string");if(t.length!==e.length)throw new Error("input strings must have the same length");const r=e.slice();for(var n=0,i=0;i<t.length;i++)n|=t.charCodeAt(i)^r.charCodeAt(i);return 0===n}(t,e)}function Te(t){if(!Ce(t))return null;try{var e=[],r=t.substr(0,2),n=parseInt(r,16);e[0]=new String(Math.floor(n/40)),e[1]=new String(n%40);for(var i=t.substr(2),s=[],a=0;a<i.length/2;a++)s.push(parseInt(i.substr(2*a,2),16));var o=[],u="";for(a=0;a<s.length;a++)128&s[a]?u+=Be((127&s[a]).toString(2),7):(u+=Be((127&s[a]).toString(2),7),o.push(new String(parseInt(u,2))),u="");var c=e.join(".");return o.length>0&&(c=c+"."+o.join(".")),c}catch(t){return null}}function Ne(t){return Oe(new lt(String(t),10))}function Oe(t){var e=t.toString(16);if("-"!=e.substr(0,1))return e.length%2==1?e="0"+e:e.match(/^[0-7]/)||(e="00"+e),e;var r=e.substr(1).length;r%2==1?r+=1:e.match(/^[0-7]/)||(r+=2);for(var n="",i=0;i<r;i++)n+="f";return e=new lt(n,16).xor(t).add(lt.ONE).toString(16).replace(/^-/,"")}re.getLblen=function(t,e){if("8"!=t.substr(e+2,1))return 1;var r=parseInt(t.substr(e+3,1));return 0==r?-1:0<r&&r<10?r+1:-2},re.getL=function(t,e){var r=re.getLblen(t,e);return r<1?"":t.substr(e+2,2*r)},re.getVblen=function(t,e){var r;return""==(r=re.getL(t,e))?-1:("8"===r.substr(0,1)?new lt(r.substr(2),16):new lt(r,16)).intValue()},re.getVidx=function(t,e){var r=re.getLblen(t,e);return r<0?r:e+2*(r+1)},re.getV=function(t,e){var r=re.getVidx(t,e),n=re.getVblen(t,e);return t.substr(r,2*n)},re.getTLV=function(t,e){return t.substr(e,2)+re.getL(t,e)+re.getV(t,e)},re.getTLVblen=function(t,e){return 2+2*re.getLblen(t,e)+2*re.getVblen(t,e)},re.getNextSiblingIdx=function(t,e){return re.getVidx(t,e)+2*re.getVblen(t,e)},re.getChildIdx=function(t,e){var r,n,i,s=re,a=[];if((r=s.getVidx(t,e))+(n=2*s.getVblen(t,e))>t.length)throw new Error("too short ASN.1 value");"03"==t.substr(e,2)&&(r+=2,n-=2),i=0;for(var o=r;i<=n;){var u=s.getTLVblen(t,o);if(u<=0)throw new Error("malformed ASN.1: invalid TLV length");if((i+=u)<=n&&a.push(o),o+=u,i>=n)break}return a},re.getNthChildIdx=function(t,e,r){return re.getChildIdx(t,e)[r]},re.getIdxbyList=function(t,e,r,n){var i,s,a=re;return 0==r.length?void 0!==n&&t.substr(e,2)!==n?-1:e:(i=r.shift())>=(s=a.getChildIdx(t,e)).length?-1:a.getIdxbyList(t,s[i],r,n)},re.getIdxbyListEx=function(t,e,r,n){var i,s,a=re;if(0==r.length)return void 0!==n&&t.substr(e,2)!==n?-1:e;i=r.shift(),s=a.getChildIdx(t,e);for(var o=0,u=0;u<s.length;u++){var c=t.substr(s[u],2);if("number"==typeof i&&!a.isContextTag(c)&&o==i||"string"==typeof i&&a.isContextTag(c,i))return a.getIdxbyListEx(t,s[u],r,n);a.isContextTag(c)||o++}return-1},re.getTLVbyList=function(t,e,r,n){var i=re,s=i.getIdxbyList(t,e,r,n);return-1==s||s>=t.length?null:i.getTLV(t,s)},re.getTLVbyListEx=function(t,e,r,n){var i=re,s=i.getIdxbyListEx(t,e,r,n);return-1==s?null:i.getTLV(t,s)},re.getVbyList=function(t,e,r,n,i){var s,a,o=re;return-1==(s=o.getIdxbyList(t,e,r,n))||s>=t.length?null:(a=o.getV(t,s),!0===i&&(a=a.substr(2)),a)},re.getVbyListEx=function(t,e,r,n,i){var s,a,o=re;return-1==(s=o.getIdxbyListEx(t,e,r,n))?null:(a=o.getV(t,s),"03"==t.substr(s,2)&&!1!==i&&(a=a.substr(2)),a)},re.getInt=function(t,e,r){null==r&&(r=-1);try{var n=t.substr(e,2);if("02"!=n&&"03"!=n)return r;var i=re.getV(t,e);return"02"==n?parseInt(i,16):function(t){if(t.length%2!=0)return-1;if(t=t.toLowerCase(),null==t.match(/^[0-9a-f]+$/))return-1;try{var e=t.substr(0,2);if("00"==e)return parseInt(t.substr(2),16);var r=parseInt(e,16);if(r>7)return-1;var n=t.substr(2),i=parseInt(n,16).toString(2);"0"==i&&(i="00000000"),i=i.slice(0,0-r);var s=parseInt(i,2);return NaN==s?-1:s}catch(t){return-1}}(i)}catch(t){return r}},re.getOID=function(t,e,r){null==r&&(r=null);try{return"06"!=t.substr(e,2)?r:Te(re.getV(t,e))}catch(t){return r}},re.getOIDName=function(t,e,r){null==r&&(r=null);try{var n=re.getOID(t,e,r);if(n==r)return r;var i=Qt.asn1.x509.OID.oid2name(n);return""==i?n:i}catch(t){return r}},re.getString=function(t,e,r){null==r&&(r=null);try{return fe(re.getV(t,e))}catch(t){return r}},re.hextooidstr=function(t){var e=function(t,e){return t.length>=e?t:new Array(e-t.length+1).join("0")+t},r=[],n=t.substr(0,2),i=parseInt(n,16);r[0]=new String(Math.floor(i/40)),r[1]=new String(i%40);for(var s=t.substr(2),a=[],o=0;o<s.length/2;o++)a.push(parseInt(s.substr(2*o,2),16));var u=[],c="";for(o=0;o<a.length;o++)128&a[o]?c+=e((127&a[o]).toString(2),7):(c+=e((127&a[o]).toString(2),7),u.push(new String(parseInt(c,2))),c="");var h=r.join(".");return u.length>0&&(h=h+"."+u.join(".")),h},re.dump=function(t,e,r,n){var i=re,s=i.getV,a=i.dump,o=i.getChildIdx,u=t;t instanceof Qt.asn1.ASN1Object&&(u=t.tohex());var c=function(t,e){return t.length<=2*e?t:t.substr(0,e)+"..(total "+t.length/2+"bytes).."+t.substr(t.length-e,e)};void 0===e&&(e={ommit_long_octet:32}),void 0===r&&(r=0),void 0===n&&(n="");var h,l=e.ommit_long_octet;if("01"==(h=u.substr(r,2)))return"00"==(f=s(u,r))?n+"BOOLEAN FALSE\n":n+"BOOLEAN TRUE\n";if("02"==h)return n+"INTEGER "+c(f=s(u,r),l)+"\n";if("03"==h){var f=s(u,r);if(i.isASN1HEX(f.substr(2))){var p=n+"BITSTRING, encapsulates\n";return p+=a(f.substr(2),e,0,n+" ")}return n+"BITSTRING "+c(f,l)+"\n"}if("04"==h){f=s(u,r);if(i.isASN1HEX(f)){p=n+"OCTETSTRING, encapsulates\n";return p+=a(f,e,0,n+" ")}return n+"OCTETSTRING "+c(f,l)+"\n"}if("05"==h)return n+"NULL\n";if("06"==h){var g=s(u,r),d=Qt.asn1.ASN1Util.oidHexToInt(g),v=Qt.asn1.x509.OID.oid2name(d),m=d.replace(/\./g," ");return""!=v?n+"ObjectIdentifier "+v+" ("+m+")\n":n+"ObjectIdentifier ("+m+")\n"}if("0a"==h)return n+"ENUMERATED "+parseInt(s(u,r))+"\n";if("0c"==h)return n+"UTF8String '"+he(s(u,r))+"'\n";if("13"==h)return n+"PrintableString '"+he(s(u,r))+"'\n";if("14"==h)return n+"TeletexString '"+he(s(u,r))+"'\n";if("16"==h)return n+"IA5String '"+he(s(u,r))+"'\n";if("17"==h)return n+"UTCTime "+he(s(u,r))+"\n";if("18"==h)return n+"GeneralizedTime "+he(s(u,r))+"\n";if("1a"==h)return n+"VisualString '"+he(s(u,r))+"'\n";if("1e"==h)return n+"BMPString '"+Ae(s(u,r))+"'\n";if("30"==h){if("3000"==u.substr(r,4))return n+"SEQUENCE {}\n";p=n+"SEQUENCE\n";var y=e;if((2==(S=o(u,r)).length||3==S.length)&&"06"==u.substr(S[0],2)&&"04"==u.substr(S[S.length-1],2)){v=i.oidname(s(u,S[0]));var w=JSON.parse(JSON.stringify(e));w.x509ExtName=v,y=w}for(var x=0;x<S.length;x++)p+=a(u,y,S[x],n+" ");return p}if("31"==h){p=n+"SET\n";var S=o(u,r);for(x=0;x<S.length;x++)p+=a(u,e,S[x],n+" ");return p}if(128&(h=parseInt(h,16))){var E=31&h;if(32&h){for(p=n+"["+E+"]\n",S=o(u,r),x=0;x<S.length;x++)p+=a(u,e,S[x],n+" ");return p}f=s(u,r);if(re.isASN1HEX(f)){var p=n+"["+E+"]\n";return p+=a(f,e,0,n+" ")}return("68747470"==f.substr(0,8)||"subjectAltName"===e.x509ExtName&&2==E)&&(f=he(f)),p=n+"["+E+"] "+f+"\n"}return n+"UNKNOWN("+h+") "+s(u,r)+"\n"},re.parse=function(t){var e=re,r=e.parse,n=e.isASN1HEX,i=e.getV,s=e.getTLV,a=e.getChildIdx,o=Qt.asn1,u=o.ASN1Util.oidHexToInt,c=o.x509.OID.oid2name,h=he,l=Ae,f=le,p={"0c":"utf8str",12:"numstr",13:"prnstr",14:"telstr",16:"ia5str",17:"utctime",18:"gentime","1a":"visstr","1e":"bmpstr",30:"seq",31:"set"},g=t.substr(0,2),d={},v=i(t,0);if("01"==g)return"0101ff"==t?{bool:!0}:{bool:!1};if("02"==g)return{int:{hex:v}};if("03"==g)try{if("00"!=v.substr(0,2))throw"not encap";var m=v.substr(2);if(!n(m))throw"not encap";return{bitstr:{obj:r(m)}}}catch(t){var y=null;return v.length<=10&&(y=function(t){if("string"!=typeof t)return null;if(t.length%2!=0)return null;if(!t.match(/^[0-9a-f]+$/))return null;try{var e=parseInt(t.substr(0,2),16);if(e<0||7<e)return null;for(var r=t.substr(2),n="",i=0;i<r.length;i+=2){var s=r.substr(i,2),a=parseInt(s,16).toString(2);n+=a=("0000000"+a).slice(-8)}return n.substr(0,n.length-e)}catch(t){return null}}(v)),null==y?{bitstr:{hex:v}}:{bitstr:{bin:y}}}else if("04"==g)try{if(!n(v))throw"not encap";return{octstr:{obj:r(v)}}}catch(t){return{octstr:{hex:v}}}else{if("05"==g)return{null:""};if("06"==g){var w=u(v),x=c(w);return""==x?{oid:w}:{oid:x}}if("0a"==g)return v.length>4?{enum:{hex:v}}:{enum:parseInt(v,16)};if("30"==g||"31"==g)return d[p[g]]=function(t){for(var e=[],n=a(t,0),i=0;i<n.length;i++){var o=n[i],u=s(t,o),c=r(u);e.push(c)}return e}(t),d;if("14"==g){var S=f(v);return d[p[g]]={str:S},d}if("1e"==g){S=l(v);return d[p[g]]={str:S},d}if(-1!=":0c:12:13:16:17:18:1a:".indexOf(g)){S=h(v);return d[p[g]]={str:S},d}if(g.match(/^8[0-9]$/))return null==(S=h(v))|""==S||null!=S.match(/[\x00-\x1F\x7F-\x9F]/)||null!=S.match(/[\u0000-\u001F\u0080–\u009F]/)?{tag:{tag:g,explicit:!1,hex:v}}:{tag:{tag:g,explicit:!1,str:S}};if(!g.match(/^a[0-9]$/)){var E=new Qt.asn1.ASN1Object;return E.hV=v,{asn1:{tlv:g+E.getLengthHexFromValue()+v}}}try{if(!n(v))throw new Error("not encap");return{tag:{tag:g,explicit:!0,obj:r(v)}}}catch(t){return{tag:{tag:g,explicit:!0,hex:v}}}}},re.isContextTag=function(t,e){var r,n;t=t.toLowerCase();try{r=parseInt(t,16)}catch(t){return-1}if(void 0===e)return 128==(192&r);try{return null!=e.match(/^\[[0-9]+\]$/)&&(!((n=parseInt(e.substr(1,e.length-1),10))>31)&&(128==(192&r)&&(31&r)==n))}catch(t){return!1}},re.isASN1HEX=function(t){var e=re;if(t.length%2==1)return!1;var r=e.getVblen(t,0),n=t.substr(0,2),i=e.getL(t,0);return t.length-n.length-i.length==2*r},re.checkStrictDER=function(t,e,r,n,i){var s=re;if(void 0===r){if("string"!=typeof t)throw new Error("not hex string");if(t=t.toLowerCase(),!Qt.lang.String.isHex(t))throw new Error("not hex string");r=t.length,i=(n=t.length/2)<128?1:Math.ceil(n.toString(16))+1}if(s.getL(t,e).length>2*i)throw new Error("L of TLV too long: idx="+e);var a=s.getVblen(t,e);if(a>n)throw new Error("value of L too long than hex: idx="+e);var o=s.getTLV(t,e),u=o.length-2-s.getL(t,e).length;if(u!==2*a)throw new Error("V string length and L's value not the same:"+u+"/"+2*a);if(0===e&&t.length!=o.length)throw new Error("total length and TLV length unmatch:"+t.length+"!="+o.length);var c=t.substr(e,2);if("02"===c){var h=s.getVidx(t,e);if("00"==t.substr(h,2)&&t.charCodeAt(h+2)<56)throw new Error("not least zeros for DER INTEGER")}if(32&parseInt(c,16)){for(var l=s.getVblen(t,e),f=0,p=s.getChildIdx(t,e),g=0;g<p.length;g++){f+=s.getTLV(t,p[g]).length,s.checkStrictDER(t,p[g],r,n,i)}if(2*l!=f)throw new Error("sum of children's TLV length and L unmatch: "+2*l+"!="+f)}},re.oidname=function(t){var e=Qt.asn1;Qt.lang.String.isHex(t)&&(t=e.ASN1Util.oidHexToInt(t));var r=e.x509.OID.oid2name(t);return""===r&&(r=t),r},void 0!==Qt&&Qt||(Qt={}),void 0!==Qt.asn1&&Qt.asn1||(Qt.asn1={}),void 0!==Qt.asn1.x509&&Qt.asn1.x509||(Qt.asn1.x509={}),Qt.asn1.x509.Certificate=function(t){Qt.asn1.x509.Certificate.superclass.constructor.call(this);var e=Qt.asn1,r=e.DERBitString,n=e.DERSequence,i=e.x509,s=i.TBSCertificate,a=i.AlgorithmIdentifier;this.params=void 0,this.setByParam=function(t){this.params=t},this.sign=function(){var t=this.params,e=t.sigalg;null!=t.sigalg.name&&(e=t.sigalg.name);var r=t.tbsobj.tohex(),n=new Qt.crypto.Signature({alg:e});n.init(t.cakey),n.updateHex(r),t.sighex=n.sign()},this.getPEM=function(){return ge(this.tohex(),"CERTIFICATE")},this.tohex=function(){var t=this.params;if(null!=t.tbsobj&&null!=t.tbsobj||(t.tbsobj=new s(t)),null==t.sighex&&null!=t.cakey&&this.sign(),null==t.sighex)throw new Error("sighex or cakey parameter not defined");var e=[];return e.push(t.tbsobj),e.push(new a({name:t.sigalg})),e.push(new r({hex:"00"+t.sighex})),new n({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&(this.params=t)},He(Qt.asn1.x509.Certificate,Qt.asn1.ASN1Object),Qt.asn1.x509.TBSCertificate=function(t){Qt.asn1.x509.TBSCertificate.superclass.constructor.call(this);var e=Qt.asn1,r=e.x509,n=e.DERTaggedObject,i=e.DERInteger,s=e.DERSequence,a=r.AlgorithmIdentifier,o=r.Time,u=r.X500Name,c=r.Extensions,h=r.SubjectPublicKeyInfo;this.params=null,this.setByParam=function(t){this.params=t},this.tohex=function(){var t=[],e=this.params;if(null!=e.version||1!=e.version){var r=2;null!=e.version&&(r=e.version-1);var l=new n({obj:new i({int:r})});t.push(l)}return t.push(new i(e.serial)),t.push(new a({name:e.sigalg})),t.push(new u(e.issuer)),t.push(new s({array:[new o(e.notbefore),new o(e.notafter)]})),t.push(new u(e.subject)),t.push(new h(ke.getKey(e.sbjpubkey))),void 0!==e.ext&&e.ext.length>0&&t.push(new n({tag:"a3",obj:new c(e.ext)})),new Qt.asn1.DERSequence({array:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&this.setByParam(t)},He(Qt.asn1.x509.TBSCertificate,Qt.asn1.ASN1Object),Qt.asn1.x509.Extensions=function(t){Qt.asn1.x509.Extensions.superclass.constructor.call(this);var e=Qt.asn1,r=e.DERSequence,n=e.x509;this.aParam=[],this.setByParam=function(t){this.aParam=t},this.tohex=function(){for(var t=[],e=0;e<this.aParam.length;e++){var i=this.aParam[e],s=i.extname,a=null;if(null!=i.extn)a=new n.PrivateExtension(i);else if("subjectKeyIdentifier"==s)a=new n.SubjectKeyIdentifier(i);else if("keyUsage"==s)a=new n.KeyUsage(i);else if("subjectAltName"==s)a=new n.SubjectAltName(i);else if("issuerAltName"==s)a=new n.IssuerAltName(i);else if("basicConstraints"==s)a=new n.BasicConstraints(i);else if("nameConstraints"==s)a=new n.NameConstraints(i);else if("cRLDistributionPoints"==s)a=new n.CRLDistributionPoints(i);else if("certificatePolicies"==s)a=new n.CertificatePolicies(i);else if("policyMappings"==s)a=new n.PolicyMappings(i);else if("policyConstraints"==s)a=new n.PolicyConstraints(i);else if("inhibitAnyPolicy"==s)a=new n.InhibitAnyPolicy(i);else if("authorityKeyIdentifier"==s)a=new n.AuthorityKeyIdentifier(i);else if("extKeyUsage"==s)a=new n.ExtKeyUsage(i);else if("authorityInfoAccess"==s)a=new n.AuthorityInfoAccess(i);else if("cRLNumber"==s)a=new n.CRLNumber(i);else if("cRLReason"==s)a=new n.CRLReason(i);else if("ocspNonce"==s)a=new n.OCSPNonce(i);else if("ocspNoCheck"==s)a=new n.OCSPNoCheck(i);else if("adobeTimeStamp"==s)a=new n.AdobeTimeStamp(i);else{if("subjectDirectoryAttributes"!=s)throw new Error("extension not supported:"+JSON.stringify(i));a=new n.SubjectDirectoryAttributes(i)}null!=a&&t.push(a)}return new r({array:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},He(Qt.asn1.x509.Extensions,Qt.asn1.ASN1Object),Qt.asn1.x509.Extension=function(t){Qt.asn1.x509.Extension.superclass.constructor.call(this);var e=Qt.asn1,r=e.DERObjectIdentifier,n=e.DEROctetString;e.DERBitString;var i=e.DERBoolean,s=e.DERSequence;this.tohex=function(){var t=new r({oid:this.oid}),e=new n({hex:this.getExtnValueHex()}),a=new Array;return a.push(t),this.critical&&a.push(new i),a.push(e),new s({array:a}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.critical=!1,void 0!==t&&void 0!==t.critical&&(this.critical=t.critical)},He(Qt.asn1.x509.Extension,Qt.asn1.ASN1Object),Qt.asn1.x509.KeyUsage=function(t){Qt.asn1.x509.KeyUsage.superclass.constructor.call(this,t);var e=Error,r={digitalSignature:0,nonRepudiation:1,keyEncipherment:2,dataEncipherment:3,keyAgreement:4,keyCertSign:5,cRLSign:6,encipherOnly:7,decipherOnly:8};this.getExtnValueHex=function(){var t=this.getBinValue();return this.asn1ExtnValue=new Qt.asn1.DERBitString({bin:t}),this.asn1ExtnValue.tohex()},this.getBinValue=function(){var t=this.params;if("object"!=typeof t||"object"!=typeof t.names&&"string"!=typeof t.bin)throw new e("parameter not yet set");if(null!=t.names)return _e(t.names,r);if(null!=t.bin)return t.bin;throw new e("parameter not set properly")},this.oid="2.5.29.15",void 0!==t&&(this.params=t)},He(Qt.asn1.x509.KeyUsage,Qt.asn1.x509.Extension),Qt.asn1.x509.BasicConstraints=function(t){Qt.asn1.x509.BasicConstraints.superclass.constructor.call(this,t);var e=Qt.asn1,r=e.DERBoolean,n=e.DERInteger,i=e.DERSequence;this.getExtnValueHex=function(){var t=new Array;this.cA&&t.push(new r),this.pathLen>-1&&t.push(new n({int:this.pathLen}));var e=new i({array:t});return this.asn1ExtnValue=e,this.asn1ExtnValue.tohex()},this.oid="2.5.29.19",this.cA=!1,this.pathLen=-1,void 0!==t&&(void 0!==t.cA&&(this.cA=t.cA),void 0!==t.pathLen&&(this.pathLen=t.pathLen))},He(Qt.asn1.x509.BasicConstraints,Qt.asn1.x509.Extension),Qt.asn1.x509.CRLDistributionPoints=function(t){Qt.asn1.x509.CRLDistributionPoints.superclass.constructor.call(this,t);var e=Qt.asn1,r=e.x509;this.getExtnValueHex=function(){return this.asn1ExtnValue.tohex()},this.setByDPArray=function(t){for(var n=[],i=0;i<t.length;i++)if(t[i]instanceof Qt.asn1.ASN1Object)n.push(t[i]);else{var s=new r.DistributionPoint(t[i]);n.push(s)}this.asn1ExtnValue=new e.DERSequence({array:n})},this.setByOneURI=function(t){var e=new r.DistributionPoint({fulluri:t});this.setByDPArray([e])},this.oid="2.5.29.31",void 0!==t&&(void 0!==t.array?this.setByDPArray(t.array):void 0!==t.uri&&this.setByOneURI(t.uri))},He(Qt.asn1.x509.CRLDistributionPoints,Qt.asn1.x509.Extension),Qt.asn1.x509.DistributionPoint=function(t){Qt.asn1.x509.DistributionPoint.superclass.constructor.call(this);var e=Qt.asn1,r=e.x509.DistributionPointName;this.tohex=function(){var t=new e.DERSequence;if(null!=this.asn1DP){var r=new e.DERTaggedObject({explicit:!0,tag:"a0",obj:this.asn1DP});t.appendASN1Object(r)}return this.hTLV=t.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&(void 0!==t.dpobj?this.asn1DP=t.dpobj:void 0!==t.dpname?this.asn1DP=new r(t.dpname):void 0!==t.fulluri&&(this.asn1DP=new r({full:[{uri:t.fulluri}]})))},He(Qt.asn1.x509.DistributionPoint,Qt.asn1.ASN1Object),Qt.asn1.x509.DistributionPointName=function(t){Qt.asn1.x509.DistributionPointName.superclass.constructor.call(this);var e=Qt.asn1,r=e.DERTaggedObject;if(this.tohex=function(){if("full"!=this.type)throw new Error("currently type shall be 'full': "+this.type);return this.asn1Obj=new r({explicit:!1,tag:this.tag,obj:this.asn1V}),this.hTLV=this.asn1Obj.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},void 0!==t)if(e.x509.GeneralNames.prototype.isPrototypeOf(t))this.type="full",this.tag="a0",this.asn1V=t;else{if(void 0===t.full)throw new Error("This class supports GeneralNames only as argument");this.type="full",this.tag="a0",this.asn1V=new e.x509.GeneralNames(t.full)}},He(Qt.asn1.x509.DistributionPointName,Qt.asn1.ASN1Object),Qt.asn1.x509.CertificatePolicies=function(t){Qt.asn1.x509.CertificatePolicies.superclass.constructor.call(this,t);var e=Qt.asn1,r=e.x509,n=e.DERSequence,i=r.PolicyInformation;this.params=null,this.getExtnValueHex=function(){for(var t=[],e=0;e<this.params.array.length;e++)t.push(new i(this.params.array[e]));var r=new n({array:t});return this.asn1ExtnValue=r,this.asn1ExtnValue.tohex()},this.oid="2.5.29.32",void 0!==t&&(this.params=t)},He(Qt.asn1.x509.CertificatePolicies,Qt.asn1.x509.Extension),Qt.asn1.x509.PolicyInformation=function(t){Qt.asn1.x509.PolicyInformation.superclass.constructor.call(this,t);var e=Qt.asn1,r=e.DERSequence,n=e.DERObjectIdentifier,i=e.x509.PolicyQualifierInfo;this.params=null,this.tohex=function(){if(void 0===this.params.policyoid&&void 0===this.params.array)throw new Error("parameter oid and array missing");var t=[new n(this.params.policyoid)];if(void 0!==this.params.array){for(var e=[],s=0;s<this.params.array.length;s++)e.push(new i(this.params.array[s]));e.length>0&&t.push(new r({array:e}))}return new r({array:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&(this.params=t)},He(Qt.asn1.x509.PolicyInformation,Qt.asn1.ASN1Object),Qt.asn1.x509.PolicyQualifierInfo=function(t){Qt.asn1.x509.PolicyQualifierInfo.superclass.constructor.call(this,t);var e=Qt.asn1,r=e.DERSequence,n=e.DERIA5String,i=e.DERObjectIdentifier,s=e.x509.UserNotice;this.params=null,this.tohex=function(){return void 0!==this.params.cps?new r({array:[new i({oid:"1.3.6.1.5.5.7.2.1"}),new n({str:this.params.cps})]}).tohex():null!=this.params.unotice?new r({array:[new i({oid:"1.3.6.1.5.5.7.2.2"}),new s(this.params.unotice)]}).tohex():void 0},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&(this.params=t)},He(Qt.asn1.x509.PolicyQualifierInfo,Qt.asn1.ASN1Object),Qt.asn1.x509.UserNotice=function(t){Qt.asn1.x509.UserNotice.superclass.constructor.call(this,t);var e=Qt.asn1.DERSequence;Qt.asn1.DERInteger;var r=Qt.asn1.x509.DisplayText,n=Qt.asn1.x509.NoticeReference;this.params=null,this.tohex=function(){var t=[];return void 0!==this.params.noticeref&&t.push(new n(this.params.noticeref)),void 0!==this.params.exptext&&t.push(new r(this.params.exptext)),new e({array:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&(this.params=t)},He(Qt.asn1.x509.UserNotice,Qt.asn1.ASN1Object),Qt.asn1.x509.NoticeReference=function(t){Qt.asn1.x509.NoticeReference.superclass.constructor.call(this,t);var e=Qt.asn1.DERSequence,r=Qt.asn1.DERInteger,n=Qt.asn1.x509.DisplayText;this.params=null,this.tohex=function(){var t=[];if(void 0!==this.params.org&&t.push(new n(this.params.org)),void 0!==this.params.noticenum){for(var i=[],s=this.params.noticenum,a=0;a<s.length;a++)i.push(new r(s[a]));t.push(new e({array:i}))}if(0==t.length)throw new Error("parameter is empty");return new e({array:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&(this.params=t)},He(Qt.asn1.x509.NoticeReference,Qt.asn1.ASN1Object),Qt.asn1.x509.DisplayText=function(t){Qt.asn1.x509.DisplayText.superclass.constructor.call(this,t),this.hT="0c",void 0!==t&&("ia5"===t.type?this.hT="16":"vis"===t.type?this.hT="1a":"bmp"===t.type&&(this.hT="1e"))},He(Qt.asn1.x509.DisplayText,Qt.asn1.DERAbstractString),Qt.asn1.x509.PolicyMappings=function(t){Qt.asn1.x509.PolicyMappings.superclass.constructor.call(this,t);var e=Qt.asn1;e.x509;var r=e.ASN1Util.newObject;this.params=null,this.getExtnValueHex=function(){for(var t=this.params,e=[],n=0;n<t.array.length;n++){var i=t.array[n];e.push({seq:[{oid:i[0]},{oid:i[1]}]})}return this.asn1ExtnValue=r({seq:e}),this.asn1ExtnValue.tohex()},this.oid="2.5.29.33",void 0!==t&&(this.params=t)},He(Qt.asn1.x509.PolicyMappings,Qt.asn1.x509.Extension),Qt.asn1.x509.PolicyConstraints=function(t){Qt.asn1.x509.PolicyConstraints.superclass.constructor.call(this,t);var e=Qt.asn1;e.x509;var r=e.ASN1Util.newObject;this.params=null,this.getExtnValueHex=function(){var t=this.params,e=[];return null!=t.reqexp&&e.push({tag:{tagi:"80",obj:{int:t.reqexp}}}),null!=t.inhibit&&e.push({tag:{tagi:"81",obj:{int:t.inhibit}}}),this.asn1ExtnValue=r({seq:e}),this.asn1ExtnValue.tohex()},this.oid="2.5.29.36",void 0!==t&&(this.params=t)},He(Qt.asn1.x509.PolicyConstraints,Qt.asn1.x509.Extension),Qt.asn1.x509.InhibitAnyPolicy=function(t){Qt.asn1.x509.InhibitAnyPolicy.superclass.constructor.call(this,t);var e=Qt.asn1;e.x509;var r=e.ASN1Util.newObject;this.params=null,this.getExtnValueHex=function(){return this.asn1ExtnValue=r({int:this.params.skip}),this.asn1ExtnValue.tohex()},this.oid="2.5.29.54",void 0!==t&&(this.params=t)},He(Qt.asn1.x509.InhibitAnyPolicy,Qt.asn1.x509.Extension),Qt.asn1.x509.NameConstraints=function(t){Qt.asn1.x509.NameConstraints.superclass.constructor.call(this,t);var e=Qt.asn1,r=e.x509,n=e.ASN1Util.newObject,i=r.GeneralSubtree;this.params=null,this.getExtnValueHex=function(){var t=this.params,e=[];if(null!=t.permit&&null!=t.permit.length){for(var r=[],s=0;s<t.permit.length;s++)r.push(new i(t.permit[s]));e.push({tag:{tagi:"a0",obj:{seq:r}}})}if(null!=t.exclude&&null!=t.exclude.length){var a=[];for(s=0;s<t.exclude.length;s++)a.push(new i(t.exclude[s]));e.push({tag:{tagi:"a1",obj:{seq:a}}})}return this.asn1ExtnValue=n({seq:e}),this.asn1ExtnValue.tohex()},this.oid="2.5.29.30",void 0!==t&&(this.params=t)},He(Qt.asn1.x509.NameConstraints,Qt.asn1.x509.Extension),Qt.asn1.x509.GeneralSubtree=function(t){Qt.asn1.x509.GeneralSubtree.superclass.constructor.call(this);var e=Qt.asn1,r=e.x509.GeneralName,n=e.ASN1Util.newObject;this.params=null,this.setByParam=function(t){this.params=t},this.tohex=function(){var t=this.params,e=[new r(t)];return null!=t.min&&e.push({tag:{tagi:"80",obj:{int:t.min}}}),null!=t.max&&e.push({tag:{tagi:"81",obj:{int:t.max}}}),n({seq:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&this.setByParam(t)},He(Qt.asn1.x509.GeneralSubtree,Qt.asn1.ASN1Object),Qt.asn1.x509.ExtKeyUsage=function(t){Qt.asn1.x509.ExtKeyUsage.superclass.constructor.call(this,t);var e=Qt.asn1;this.setPurposeArray=function(t){this.asn1ExtnValue=new e.DERSequence;for(var r=0;r<t.length;r++){var n=new e.DERObjectIdentifier(t[r]);this.asn1ExtnValue.appendASN1Object(n)}},this.getExtnValueHex=function(){return this.asn1ExtnValue.tohex()},this.oid="2.5.29.37",void 0!==t&&void 0!==t.array&&this.setPurposeArray(t.array)},He(Qt.asn1.x509.ExtKeyUsage,Qt.asn1.x509.Extension),Qt.asn1.x509.AuthorityKeyIdentifier=function(t){Qt.asn1.x509.AuthorityKeyIdentifier.superclass.constructor.call(this,t);var e=Qt,r=e.asn1,n=r.DERTaggedObject,i=r.x509.GeneralNames;e.crypto.Util.isKey,this.asn1KID=null,this.asn1CertIssuer=null,this.asn1CertSN=null,this.getExtnValueHex=function(){var t=new Array;this.asn1KID&&t.push(new n({explicit:!1,tag:"80",obj:this.asn1KID})),this.asn1CertIssuer&&t.push(new n({explicit:!1,tag:"a1",obj:new i([{dn:this.asn1CertIssuer}])})),this.asn1CertSN&&t.push(new n({explicit:!1,tag:"82",obj:this.asn1CertSN}));var e=new r.DERSequence({array:t});return this.asn1ExtnValue=e,this.asn1ExtnValue.tohex()},this.setKIDByParam=function(t){if(void 0!==t.str||void 0!==t.hex)this.asn1KID=new Qt.asn1.DEROctetString(t);else if("object"==typeof t&&Qt.crypto.Util.isKey(t)||"string"==typeof t&&-1!=t.indexOf("BEGIN ")){var e=t;"string"==typeof t&&(e=ke.getKey(t));var r=ke.getKeyID(e);this.asn1KID=new Qt.asn1.DEROctetString({hex:r})}},this.setCertIssuerByParam=function(t){void 0!==t.str||void 0!==t.ldapstr||void 0!==t.hex||void 0!==t.certsubject||void 0!==t.certissuer?this.asn1CertIssuer=new Qt.asn1.x509.X500Name(t):"string"==typeof t&&-1!=t.indexOf("BEGIN ")&&-1!=t.indexOf("CERTIFICATE")&&(this.asn1CertIssuer=new Qt.asn1.x509.X500Name({certissuer:t}))},this.setCertSNByParam=function(t){if(void 0!==t.str||void 0!==t.bigint||void 0!==t.hex)this.asn1CertSN=new Qt.asn1.DERInteger(t);else if("string"==typeof t&&-1!=t.indexOf("BEGIN ")&&t.indexOf("CERTIFICATE")){var e=new Me;e.readCertPEM(t);var r=e.getSerialNumberHex();this.asn1CertSN=new Qt.asn1.DERInteger({hex:r})}},this.oid="2.5.29.35",void 0!==t&&(void 0!==t.kid&&this.setKIDByParam(t.kid),void 0!==t.issuer&&this.setCertIssuerByParam(t.issuer),void 0!==t.sn&&this.setCertSNByParam(t.sn),void 0!==t.issuersn&&"string"==typeof t.issuersn&&-1!=t.issuersn.indexOf("BEGIN ")&&t.issuersn.indexOf("CERTIFICATE")&&(this.setCertSNByParam(t.issuersn),this.setCertIssuerByParam(t.issuersn)))},He(Qt.asn1.x509.AuthorityKeyIdentifier,Qt.asn1.x509.Extension),Qt.asn1.x509.SubjectKeyIdentifier=function(t){Qt.asn1.x509.SubjectKeyIdentifier.superclass.constructor.call(this,t);var e=Qt.asn1.DEROctetString;this.asn1KID=null,this.getExtnValueHex=function(){return this.asn1ExtnValue=this.asn1KID,this.asn1ExtnValue.tohex()},this.setKIDByParam=function(t){if(void 0!==t.str||void 0!==t.hex)this.asn1KID=new e(t);else if("object"==typeof t&&Qt.crypto.Util.isKey(t)||"string"==typeof t&&-1!=t.indexOf("BEGIN")){var r=t;"string"==typeof t&&(r=ke.getKey(t));var n=ke.getKeyID(r);this.asn1KID=new Qt.asn1.DEROctetString({hex:n})}},this.oid="2.5.29.14",void 0!==t&&void 0!==t.kid&&this.setKIDByParam(t.kid)},He(Qt.asn1.x509.SubjectKeyIdentifier,Qt.asn1.x509.Extension),Qt.asn1.x509.AuthorityInfoAccess=function(t){Qt.asn1.x509.AuthorityInfoAccess.superclass.constructor.call(this,t),this.setAccessDescriptionArray=function(t){for(var e=new Array,r=Qt.asn1,n=r.DERSequence,i=r.DERObjectIdentifier,s=r.x509.GeneralName,a=0;a<t.length;a++){var o,u=t[a];if(void 0!==u.ocsp)o=new n({array:[new i({oid:"1.3.6.1.5.5.7.48.1"}),new s({uri:u.ocsp})]});else{if(void 0===u.caissuer)throw new Error("unknown AccessMethod parameter: "+JSON.stringify(u));o=new n({array:[new i({oid:"1.3.6.1.5.5.7.48.2"}),new s({uri:u.caissuer})]})}e.push(o)}this.asn1ExtnValue=new n({array:e})},this.getExtnValueHex=function(){return this.asn1ExtnValue.tohex()},this.oid="1.3.6.1.5.5.7.1.1",void 0!==t&&void 0!==t.array&&this.setAccessDescriptionArray(t.array)},He(Qt.asn1.x509.AuthorityInfoAccess,Qt.asn1.x509.Extension),Qt.asn1.x509.SubjectAltName=function(t){Qt.asn1.x509.SubjectAltName.superclass.constructor.call(this,t),this.setNameArray=function(t){this.asn1ExtnValue=new Qt.asn1.x509.GeneralNames(t)},this.getExtnValueHex=function(){return this.asn1ExtnValue.tohex()},this.oid="2.5.29.17",void 0!==t&&void 0!==t.array&&this.setNameArray(t.array)},He(Qt.asn1.x509.SubjectAltName,Qt.asn1.x509.Extension),Qt.asn1.x509.IssuerAltName=function(t){Qt.asn1.x509.IssuerAltName.superclass.constructor.call(this,t),this.setNameArray=function(t){this.asn1ExtnValue=new Qt.asn1.x509.GeneralNames(t)},this.getExtnValueHex=function(){return this.asn1ExtnValue.tohex()},this.oid="2.5.29.18",void 0!==t&&void 0!==t.array&&this.setNameArray(t.array)},He(Qt.asn1.x509.IssuerAltName,Qt.asn1.x509.Extension),Qt.asn1.x509.SubjectDirectoryAttributes=function(t){Qt.asn1.x509.SubjectDirectoryAttributes.superclass.constructor.call(this,t);var e=Qt.asn1,r=e.DERSequence,n=e.ASN1Util.newObject,i=e.x509.OID.name2oid;this.params=null,this.getExtnValueHex=function(){for(var t=[],e=0;e<this.params.array.length;e++){var s=this.params.array[e];if(null==s.attr||null==s.array){var a={seq:[{oid:"1.2.3.4"},{set:[{utf8str:"DE"}]}]};if("dateOfBirth"==s.attr)a.seq[0].oid=i(s.attr),a.seq[1].set[0]={gentime:s.str};else if("placeOfBirth"==s.attr)a.seq[0].oid=i(s.attr),a.seq[1].set[0]={utf8str:s.str};else if("gender"==s.attr)a.seq[0].oid=i(s.attr),a.seq[1].set[0]={prnstr:s.str};else if("countryOfCitizenship"==s.attr)a.seq[0].oid=i(s.attr),a.seq[1].set[0]={prnstr:s.str};else{if("countryOfResidence"!=s.attr)throw new Error("unsupported attribute: "+s.attr);a.seq[0].oid=i(s.attr),a.seq[1].set[0]={prnstr:s.str}}t.push(new n(a))}else{var o={seq:[{oid:s.attr},{set:s.array}]};t.push(n(o))}}var u=new r({array:t});return this.asn1ExtnValue=u,this.asn1ExtnValue.tohex()},this.oid="2.5.29.9",void 0!==t&&(this.params=t)},He(Qt.asn1.x509.SubjectDirectoryAttributes,Qt.asn1.x509.Extension),Qt.asn1.x509.PrivateExtension=function(t){Qt.asn1.x509.PrivateExtension.superclass.constructor.call(this,t);var e=Qt,r=e.lang.String.isHex,n=e.asn1,i=n.x509.OID.name2oid,s=n.ASN1Util.newObject;this.params=null,this.setByParam=function(t){this.oid=i(t.extname),this.params=t},this.getExtnValueHex=function(){if(null==this.params.extname||null==this.params.extn)throw new Error("extname or extnhex not specified");var t=this.params.extn;if("string"==typeof t&&r(t))return t;if("object"==typeof t)try{return s(t).tohex()}catch(t){}throw new Error("unsupported extn value")},null!=t&&this.setByParam(t)},He(Qt.asn1.x509.PrivateExtension,Qt.asn1.x509.Extension),Qt.asn1.x509.CRL=function(t){Qt.asn1.x509.CRL.superclass.constructor.call(this);var e=Qt.asn1,r=e.DERSequence,n=e.DERBitString,i=e.x509,s=i.AlgorithmIdentifier,a=i.TBSCertList;this.params=void 0,this.setByParam=function(t){this.params=t},this.sign=function(){var t=new a(this.params).tohex(),e=new Qt.crypto.Signature({alg:this.params.sigalg});e.init(this.params.cakey),e.updateHex(t);var r=e.sign();this.params.sighex=r},this.getPEM=function(){return ge(this.tohex(),"X509 CRL")},this.tohex=function(){var t=this.params;if(null==t.tbsobj&&(t.tbsobj=new a(t)),null==t.sighex&&null!=t.cakey&&this.sign(),null==t.sighex)throw new Error("sighex or cakey parameter not defined");var e=[];return e.push(t.tbsobj),e.push(new s({name:t.sigalg})),e.push(new n({hex:"00"+t.sighex})),new r({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&(this.params=t)},He(Qt.asn1.x509.CRL,Qt.asn1.ASN1Object),Qt.asn1.x509.TBSCertList=function(t){Qt.asn1.x509.TBSCertList.superclass.constructor.call(this);var e=Qt.asn1,r=e.DERInteger,n=e.DERSequence,i=e.DERTaggedObject;e.DERObjectIdentifier;var s=e.x509,a=s.AlgorithmIdentifier,o=s.Time,u=s.Extensions,c=s.X500Name;this.params=null,this.setByParam=function(t){this.params=t},this.getRevCertSequence=function(){for(var t=[],e=this.params.revcert,i=0;i<e.length;i++){var s=[new r(e[i].sn),new o(e[i].date)];null!=e[i].ext&&s.push(new u(e[i].ext)),t.push(new n({array:s}))}return new n({array:t})},this.tohex=function(){var t=[],e=this.params;if(null!=e.version){var s=e.version-1,h=new r({int:s});t.push(h)}if(t.push(new a({name:e.sigalg})),t.push(new c(e.issuer)),t.push(new o(e.thisupdate)),null!=e.nextupdate&&t.push(new o(e.nextupdate)),null!=e.revcert&&t.push(this.getRevCertSequence()),null!=e.ext){var l=new u(e.ext);t.push(new i({tag:"a0",explicit:!0,obj:l}))}return new n({array:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&this.setByParam(t)},He(Qt.asn1.x509.TBSCertList,Qt.asn1.ASN1Object),Qt.asn1.x509.CRLEntry=function(t){Qt.asn1.x509.CRLEntry.superclass.constructor.call(this);var e=Qt.asn1;this.setCertSerial=function(t){this.sn=new e.DERInteger(t)},this.setRevocationDate=function(t){this.time=new e.x509.Time(t)},this.tohex=function(){var t=new e.DERSequence({array:[this.sn,this.time]});return this.TLV=t.tohex(),this.TLV},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&(void 0!==t.time&&this.setRevocationDate(t.time),void 0!==t.sn&&this.setCertSerial(t.sn))},He(Qt.asn1.x509.CRLEntry,Qt.asn1.ASN1Object),Qt.asn1.x509.CRLNumber=function(t){Qt.asn1.x509.CRLNumber.superclass.constructor.call(this,t),this.params=void 0,this.getExtnValueHex=function(){return this.asn1ExtnValue=new Qt.asn1.DERInteger(this.params.num),this.asn1ExtnValue.tohex()},this.oid="2.5.29.20",null!=t&&(this.params=t)},He(Qt.asn1.x509.CRLNumber,Qt.asn1.x509.Extension),Qt.asn1.x509.CRLReason=function(t){Qt.asn1.x509.CRLReason.superclass.constructor.call(this,t),this.params=void 0,this.getExtnValueHex=function(){return this.asn1ExtnValue=new Qt.asn1.DEREnumerated(this.params.code),this.asn1ExtnValue.tohex()},this.oid="2.5.29.21",null!=t&&(this.params=t)},He(Qt.asn1.x509.CRLReason,Qt.asn1.x509.Extension),Qt.asn1.x509.OCSPNonce=function(t){Qt.asn1.x509.OCSPNonce.superclass.constructor.call(this,t),this.params=void 0,this.getExtnValueHex=function(){return this.asn1ExtnValue=new Qt.asn1.DEROctetString(this.params),this.asn1ExtnValue.tohex()},this.oid="1.3.6.1.5.5.7.48.1.2",null!=t&&(this.params=t)},He(Qt.asn1.x509.OCSPNonce,Qt.asn1.x509.Extension),Qt.asn1.x509.OCSPNoCheck=function(t){Qt.asn1.x509.OCSPNoCheck.superclass.constructor.call(this,t),this.params=void 0,this.getExtnValueHex=function(){return this.asn1ExtnValue=new Qt.asn1.DERNull,this.asn1ExtnValue.tohex()},this.oid="1.3.6.1.5.5.7.48.1.5",null!=t&&(this.params=t)},He(Qt.asn1.x509.OCSPNoCheck,Qt.asn1.x509.Extension),Qt.asn1.x509.AdobeTimeStamp=function(t){Qt.asn1.x509.AdobeTimeStamp.superclass.constructor.call(this,t);var e=Qt.asn1,r=e.DERInteger,n=e.DERBoolean,i=e.DERSequence,s=e.x509.GeneralName;this.params=null,this.getExtnValueHex=function(){var t=this.params,e=[new r(1)];return e.push(new s({uri:t.uri})),null!=t.reqauth&&e.push(new n(t.reqauth)),this.asn1ExtnValue=new i({array:e}),this.asn1ExtnValue.tohex()},this.oid="1.2.840.113583.1.1.9.1",void 0!==t&&this.setByParam(t)},He(Qt.asn1.x509.AdobeTimeStamp,Qt.asn1.x509.Extension),Qt.asn1.x509.X500Name=function(t){Qt.asn1.x509.X500Name.superclass.constructor.call(this),this.asn1Array=[],this.paramArray=[],this.sRule="utf8";var e=Qt.asn1,r=e.x509,n=r.RDN;this.setByString=function(t,e){void 0!==e&&(this.sRule=e);var r=t.split("/");r.shift();for(var i=[],s=0;s<r.length;s++)if(r[s].match(/^[^=]+=.+$/))i.push(r[s]);else{var a=i.length-1;i[a]=i[a]+"/"+r[s]}for(s=0;s<i.length;s++)this.asn1Array.push(new n({str:i[s],rule:this.sRule}))},this.setByLdapString=function(t,e){void 0!==e&&(this.sRule=e);var n=r.X500Name.ldapToCompat(t);this.setByString(n,e)},this.setByObject=function(t,e){for(var r in void 0!==e&&(this.sRule=e),t)if(t.hasOwnProperty(r)){var i=new n({str:r+"="+t[r],rule:this.sRule});this.asn1Array?this.asn1Array.push(i):this.asn1Array=[i]}},this.setByParam=function(t){var e;(void 0!==t.rule&&(this.sRule=t.rule),void 0!==t.array)?this.paramArray=t.array:void 0!==t.str?this.setByString(t.str):void 0!==t.ldapstr?this.setByLdapString(t.ldapstr):void 0!==t.hex?this.hTLV=t.hex:void 0!==t.certissuer?((e=new Me).readCertPEM(t.certissuer),this.hTLV=e.getIssuerHex()):void 0!==t.certsubject?((e=new Me).readCertPEM(t.certsubject),this.hTLV=e.getSubjectHex()):"object"==typeof t&&void 0===t.certsubject&&void 0===t.certissuer&&this.setByObject(t)},this.tohex=function(){if("string"==typeof this.hTLV)return this.hTLV;if(0==this.asn1Array.length&&this.paramArray.length>0)for(var t=0;t<this.paramArray.length;t++){var r={array:this.paramArray[t]};"utf8"!=this.sRule&&(r.rule=this.sRule);var i=new n(r);this.asn1Array.push(i)}var s=new e.DERSequence({array:this.asn1Array});return this.hTLV=s.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&this.setByParam(t)},He(Qt.asn1.x509.X500Name,Qt.asn1.ASN1Object),Qt.asn1.x509.X500Name.compatToLDAP=function(t){if("/"!==t.substr(0,1))throw"malformed input";var e=(t=t.substr(1)).split("/");return e.reverse(),e=e.map(function(t){return t.replace(/,/,"\\,")}),e.join(",")},Qt.asn1.x509.X500Name.onelineToLDAP=function(t){return Qt.asn1.x509.X500Name.compatToLDAP(t)},Qt.asn1.x509.X500Name.ldapToCompat=function(t){for(var e=t.split(","),r=!1,n=[],i=0;e.length>0;i++){var s=e.shift();if(!0===r){var a=(n.pop()+","+s).replace(/\\,/g,",");n.push(a),r=!1}else n.push(s);"\\"===s.substr(-1,1)&&(r=!0)}return n=n.map(function(t){return t.replace("/","\\/")}),n.reverse(),"/"+n.join("/")},Qt.asn1.x509.X500Name.ldapToOneline=function(t){return Qt.asn1.x509.X500Name.ldapToCompat(t)},Qt.asn1.x509.RDN=function(t){Qt.asn1.x509.RDN.superclass.constructor.call(this),this.asn1Array=[],this.paramArray=[],this.sRule="utf8";var e=Qt.asn1.x509.AttributeTypeAndValue;this.setByParam=function(t){void 0!==t.rule&&(this.sRule=t.rule),void 0!==t.str&&this.addByMultiValuedString(t.str),void 0!==t.array&&(this.paramArray=t.array)},this.addByString=function(t){this.asn1Array.push(new Qt.asn1.x509.AttributeTypeAndValue({str:t,rule:this.sRule}))},this.addByMultiValuedString=function(t){for(var e=Qt.asn1.x509.RDN.parseString(t),r=0;r<e.length;r++)this.addByString(e[r])},this.tohex=function(){if(0==this.asn1Array.length&&this.paramArray.length>0)for(var t=0;t<this.paramArray.length;t++){var r=this.paramArray[t];void 0!==r.rule&&"utf8"!=this.sRule&&(r.rule=this.sRule);var n=new e(r);this.asn1Array.push(n)}var i=new Qt.asn1.DERSet({array:this.asn1Array});return this.TLV=i.tohex(),this.TLV},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&this.setByParam(t)},He(Qt.asn1.x509.RDN,Qt.asn1.ASN1Object),Qt.asn1.x509.RDN.parseString=function(t){for(var e=t.split(/\+/),r=!1,n=[],i=0;e.length>0;i++){var s=e.shift();if(!0===r){var a=(n.pop()+"+"+s).replace(/\\\+/g,"+");n.push(a),r=!1}else n.push(s);"\\"===s.substr(-1,1)&&(r=!0)}var o=!1,u=[];for(i=0;n.length>0;i++){s=n.shift();if(!0===o){var c=u.pop();if(s.match(/"$/)){a=(c+"+"+s).replace(/^([^=]+)="(.*)"$/,"$1=$2");u.push(a),o=!1}else u.push(c+"+"+s)}else u.push(s);s.match(/^[^=]+="/)&&(o=!0)}return u},Qt.asn1.x509.AttributeTypeAndValue=function(t){Qt.asn1.x509.AttributeTypeAndValue.superclass.constructor.call(this),this.sRule="utf8",this.sType=null,this.sValue=null,this.dsType=null;var e=Qt,r=e.asn1,n=r.DERSequence,i=r.DERUTF8String,s=r.DERPrintableString,a=r.DERTeletexString,o=r.DERIA5String,u=r.DERVisibleString,c=r.DERBMPString,h=e.lang.String.isMail,l=e.lang.String.isPrintable;this.setByParam=function(t){if(void 0!==t.rule&&(this.sRule=t.rule),void 0!==t.ds&&(this.dsType=t.ds),void 0===t.value&&void 0!==t.str){var e=t.str.match(/^([^=]+)=(.+)$/);if(!e)throw new Error("malformed attrTypeAndValueStr: "+attrTypeAndValueStr);this.sType=e[1],this.sValue=e[2]}else this.sType=t.type,this.sValue=t.value},this.setByString=function(t,e){void 0!==e&&(this.sRule=e);var r=t.match(/^([^=]+)=(.+)$/);if(!r)throw new Error("malformed attrTypeAndValueStr: "+attrTypeAndValueStr);this.setByAttrTypeAndValueStr(r[1],r[2])},this._getDsType=function(){var t=this.sType,e=this.sValue,r=this.sRule;return"prn"===r?"CN"==t&&h(e)?"ia5":l(e)?"prn":"utf8":"utf8"===r?"CN"==t&&h(e)?"ia5":"C"==t?"prn":"utf8":"utf8"},this.setByAttrTypeAndValueStr=function(t,e,r){void 0!==r&&(this.sRule=r),this.sType=t,this.sValue=e},this.getValueObj=function(t,e){if("utf8"==t)return new i({str:e});if("prn"==t)return new s({str:e});if("tel"==t)return new a({str:e});if("ia5"==t)return new o({str:e});if("vis"==t)return new u({str:e});if("bmp"==t)return new c({str:e});throw new Error("unsupported directory string type: type="+t+" value="+e)},this.tohex=function(){null==this.dsType&&(this.dsType=this._getDsType());var t=Qt.asn1.x509.OID.atype2obj(this.sType),e=this.getValueObj(this.dsType,this.sValue),r=new n({array:[t,e]});return this.TLV=r.tohex(),this.TLV},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&this.setByParam(t)},He(Qt.asn1.x509.AttributeTypeAndValue,Qt.asn1.ASN1Object),Qt.asn1.x509.SubjectPublicKeyInfo=function(t){Qt.asn1.x509.SubjectPublicKeyInfo.superclass.constructor.call(this);var e=Qt,r=e.asn1,n=r.DERInteger,i=r.DERBitString,s=r.DERObjectIdentifier,a=r.DERSequence,o=r.ASN1Util.newObject,u=r.x509.AlgorithmIdentifier,c=e.crypto;c.ECDSA,c.DSA,this.getASN1Object=function(){if(null==this.asn1AlgId||null==this.asn1SubjPKey)throw"algId and/or subjPubKey not set";return new a({array:[this.asn1AlgId,this.asn1SubjPKey]})},this.tohex=function(){var t=this.getASN1Object();return this.hTLV=t.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},this.setPubKey=function(t){try{if(t instanceof $t){var e=o({seq:[{int:{bigint:t.n}},{int:{int:t.e}}]}).tohex();this.asn1AlgId=new u({name:"rsaEncryption"}),this.asn1SubjPKey=new i({hex:"00"+e})}}catch(t){}try{if(t instanceof Qt.crypto.ECDSA){var r=new s({name:t.curveName});this.asn1AlgId=new u({name:"ecPublicKey",asn1params:r}),this.asn1SubjPKey=new i({hex:"00"+t.pubKeyHex})}}catch(t){}try{if(t instanceof Qt.crypto.DSA){r=new o({seq:[{int:{bigint:t.p}},{int:{bigint:t.q}},{int:{bigint:t.g}}]});this.asn1AlgId=new u({name:"dsa",asn1params:r});var a=new n({bigint:t.y});this.asn1SubjPKey=new i({hex:"00"+a.tohex()})}}catch(t){}},void 0!==t&&this.setPubKey(t)},He(Qt.asn1.x509.SubjectPublicKeyInfo,Qt.asn1.ASN1Object),Qt.asn1.x509.Time=function(t){Qt.asn1.x509.Time.superclass.constructor.call(this);var e=Qt.asn1,r=e.DERUTCTime,n=e.DERGeneralizedTime;this.params=null,this.type=null,this.setTimeParams=function(t){this.timeParams=t},this.setByParam=function(t){this.params=t},this.getType=function(t){return t.match(/^[0-9]{12}Z$/)?"utc":t.match(/^[0-9]{14}Z$/)?"gen":t.match(/^[0-9]{12}\.[0-9]+Z$/)?"utc":t.match(/^[0-9]{14}\.[0-9]+Z$/)?"gen":null},this.tohex=function(){var t=this.params,e=null;if("string"==typeof t&&(t={str:t}),null==t||!t.str||null!=t.type&&null!=t.type||(t.type=this.getType(t.str)),null!=t&&t.str?("utc"==t.type&&(e=new r(t.str)),"gen"==t.type&&(e=new n(t.str))):e="gen"==this.type?new n:new r,null==e)throw new Error("wrong setting for Time");return this.TLV=e.tohex(),this.TLV},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},Qt.asn1.x509.Time_bak=function(t){Qt.asn1.x509.Time_bak.superclass.constructor.call(this);var e=Qt.asn1,r=e.DERUTCTime,n=e.DERGeneralizedTime;this.setTimeParams=function(t){this.timeParams=t},this.tohex=function(){var t=null;return t=null!=this.timeParams?"utc"==this.type?new r(this.timeParams):new n(this.timeParams):"utc"==this.type?new r:new n,this.TLV=t.tohex(),this.TLV},this.getEncodedHex=function(){return this.tohex()},this.type="utc",void 0!==t&&(void 0!==t.type?this.type=t.type:void 0!==t.str&&(t.str.match(/^[0-9]{12}Z$/)&&(this.type="utc"),t.str.match(/^[0-9]{14}Z$/)&&(this.type="gen")),this.timeParams=t)},He(Qt.asn1.x509.Time,Qt.asn1.ASN1Object),Qt.asn1.x509.AlgorithmIdentifier=function(t){Qt.asn1.x509.AlgorithmIdentifier.superclass.constructor.call(this),this.nameAlg=null,this.asn1Alg=null,this.asn1Params=null,this.paramEmpty=!1;var e=Qt.asn1,r=e.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV;if(this.tohex=function(){if(null===this.nameAlg&&null===this.asn1Alg)throw new Error("algorithm not specified");if(null!==this.nameAlg){var t=null;for(var n in r)n===this.nameAlg&&(t=r[n]);if(null!==t)return this.hTLV=t,this.hTLV}null!==this.nameAlg&&null===this.asn1Alg&&(this.asn1Alg=e.x509.OID.name2obj(this.nameAlg));var i=[this.asn1Alg];null!==this.asn1Params&&i.push(this.asn1Params);var s=new e.DERSequence({array:i});return this.hTLV=s.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&(void 0!==t.name&&(this.nameAlg=t.name),void 0!==t.asn1params&&(this.asn1Params=t.asn1params),void 0!==t.paramempty&&(this.paramEmpty=t.paramempty)),null===this.asn1Params&&!1===this.paramEmpty&&null!==this.nameAlg){void 0!==this.nameAlg.name&&(this.nameAlg=this.nameAlg.name);var n=this.nameAlg.toLowerCase();"withdsa"!==n.substr(-7,7)&&"withecdsa"!==n.substr(-9,9)&&(this.asn1Params=new e.DERNull)}},He(Qt.asn1.x509.AlgorithmIdentifier,Qt.asn1.ASN1Object),Qt.asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV={SHAwithRSAandMGF1:"300d06092a864886f70d01010a3000",SHA256withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040201a11a301806092a864886f70d010108300b0609608648016503040201a203020120",SHA384withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040202a11a301806092a864886f70d010108300b0609608648016503040202a203020130",SHA512withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040203a11a301806092a864886f70d010108300b0609608648016503040203a203020140"},Qt.asn1.x509.GeneralName=function(t){Qt.asn1.x509.GeneralName.superclass.constructor.call(this);var e=Qt.asn1,r=e.x509,n=r.X500Name,i=r.OtherName,s=e.DERIA5String;e.DERPrintableString;var a=e.DEROctetString,o=e.DERTaggedObject,u=e.ASN1Object,c=Error;this.params=null,this.setByParam=function(t){this.params=t},this.tohex=function(){var t,e,r=this.params,h=!1;if(void 0!==r.other)t="a0",e=new i(r.other);else if(void 0!==r.rfc822)t="81",e=new s({str:r.rfc822});else if(void 0!==r.dns)t="82",e=new s({str:r.dns});else if(void 0!==r.dn)t="a4",h=!0,e="string"==typeof r.dn?new n({str:r.dn}):r.dn instanceof Qt.asn1.x509.X500Name?r.dn:new n(r.dn);else if(void 0!==r.ldapdn)t="a4",h=!0,e=new n({ldapstr:r.ldapdn});else if(void 0!==r.certissuer||void 0!==r.certsubj){var l,f;t="a4",h=!0;var p=null;if(void 0!==r.certsubj?(l=!1,f=r.certsubj):(l=!0,f=r.certissuer),f.match(/^[0-9A-Fa-f]+$/),-1!=f.indexOf("-----BEGIN ")&&(p=de(f)),null==p)throw new Error("certsubj/certissuer not cert");var g,d=new Me;d.hex=p,g=l?d.getIssuerHex():d.getSubjectHex(),(e=new u).hTLV=g}else if(void 0!==r.uri)t="86",e=new s({str:r.uri});else{if(void 0===r.ip)throw new c("improper params");var v;t="87";var m=r.ip;try{if(m.match(/^[0-9a-f]+$/)){var y=m.length;if(8!=y&&16!=y&&32!=y&&64!=y)throw"err";v=m}else v=be(m)}catch(t){throw new c("malformed IP address: "+r.ip+":"+t.message)}e=new a({hex:v})}return new o({tag:t,explicit:h,obj:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&this.setByParam(t)},He(Qt.asn1.x509.GeneralName,Qt.asn1.ASN1Object),Qt.asn1.x509.GeneralNames=function(t){Qt.asn1.x509.GeneralNames.superclass.constructor.call(this);var e=Qt.asn1;this.setByParamArray=function(t){for(var r=0;r<t.length;r++){var n=new e.x509.GeneralName(t[r]);this.asn1Array.push(n)}},this.tohex=function(){return new e.DERSequence({array:this.asn1Array}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.asn1Array=new Array,void 0!==t&&this.setByParamArray(t)},He(Qt.asn1.x509.GeneralNames,Qt.asn1.ASN1Object),Qt.asn1.x509.OtherName=function(t){Qt.asn1.x509.OtherName.superclass.constructor.call(this);var e=Qt.asn1,r=e.DERObjectIdentifier,n=e.DERSequence,i=e.ASN1Util.newObject;this.params=null,this.setByParam=function(t){this.params=t},this.tohex=function(){var t=this.params;if(null==t.oid||null==t.value)throw new Error("oid or value not specified");var e=new r({oid:t.oid}),s=i({tag:{tag:"a0",explicit:!0,obj:t.value}});return new n({array:[e,s]}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&this.setByParam(t)},He(Qt.asn1.x509.OtherName,Qt.asn1.ASN1Object),Qt.asn1.x509.OID=new function(){var t=Qt.asn1.DERObjectIdentifier;this.name2oidList={"aes128-CBC":"2.16.840.1.101.3.4.1.2","aes256-CBC":"2.16.840.1.101.3.4.1.42",sha1:"1.3.14.3.2.26",sha256:"2.16.840.1.101.3.4.2.1",sha384:"2.16.840.1.101.3.4.2.2",sha512:"2.16.840.1.101.3.4.2.3",sha224:"2.16.840.1.101.3.4.2.4",md5:"1.2.840.113549.2.5",md2:"1.3.14.7.2.2.1",ripemd160:"1.3.36.3.2.1",hmacWithSHA1:"1.2.840.113549.2.7",hmacWithSHA224:"1.2.840.113549.2.8",hmacWithSHA256:"1.2.840.113549.2.9",hmacWithSHA384:"1.2.840.113549.2.10",hmacWithSHA512:"1.2.840.113549.2.11",MD2withRSA:"1.2.840.113549.1.1.2",MD4withRSA:"1.2.840.113549.1.1.3",MD5withRSA:"1.2.840.113549.1.1.4",SHA1withRSA:"1.2.840.113549.1.1.5","pkcs1-MGF":"1.2.840.113549.1.1.8",rsaPSS:"1.2.840.113549.1.1.10",SHA224withRSA:"1.2.840.113549.1.1.14",SHA256withRSA:"1.2.840.113549.1.1.11",SHA384withRSA:"1.2.840.113549.1.1.12",SHA512withRSA:"1.2.840.113549.1.1.13",SHA1withECDSA:"1.2.840.10045.4.1",SHA224withECDSA:"1.2.840.10045.4.3.1",SHA256withECDSA:"1.2.840.10045.4.3.2",SHA384withECDSA:"1.2.840.10045.4.3.3",SHA512withECDSA:"1.2.840.10045.4.3.4",dsa:"1.2.840.10040.4.1",SHA1withDSA:"1.2.840.10040.4.3",SHA224withDSA:"2.16.840.1.101.3.4.3.1",SHA256withDSA:"2.16.840.1.101.3.4.3.2",rsaEncryption:"1.2.840.113549.1.1.1",commonName:"2.5.4.3",countryName:"2.5.4.6",localityName:"2.5.4.7",stateOrProvinceName:"2.5.4.8",streetAddress:"2.5.4.9",organizationName:"2.5.4.10",organizationalUnitName:"2.5.4.11",domainComponent:"0.9.2342.19200300.100.1.25",userId:"0.9.2342.19200300.100.1.1",surname:"2.5.4.4",givenName:"2.5.4.42",title:"2.5.4.12",distinguishedName:"2.5.4.49",emailAddress:"1.2.840.113549.1.9.1",description:"2.5.4.13",businessCategory:"2.5.4.15",postalCode:"2.5.4.17",uniqueIdentifier:"2.5.4.45",organizationIdentifier:"2.5.4.97",jurisdictionOfIncorporationL:"1.3.6.1.4.1.311.60.2.1.1",jurisdictionOfIncorporationSP:"1.3.6.1.4.1.311.60.2.1.2",jurisdictionOfIncorporationC:"1.3.6.1.4.1.311.60.2.1.3",subjectDirectoryAttributes:"2.5.29.9",subjectKeyIdentifier:"2.5.29.14",keyUsage:"2.5.29.15",subjectAltName:"2.5.29.17",issuerAltName:"2.5.29.18",basicConstraints:"2.5.29.19",cRLNumber:"2.5.29.20",cRLReason:"2.5.29.21",nameConstraints:"2.5.29.30",cRLDistributionPoints:"2.5.29.31",certificatePolicies:"2.5.29.32",anyPolicy:"2.5.29.32.0",policyMappings:"2.5.29.33",authorityKeyIdentifier:"2.5.29.35",policyConstraints:"2.5.29.36",extKeyUsage:"2.5.29.37",inhibitAnyPolicy:"2.5.29.54",authorityInfoAccess:"1.3.6.1.5.5.7.1.1",ocsp:"1.3.6.1.5.5.7.48.1",ocspBasic:"1.3.6.1.5.5.7.48.1.1",ocspNonce:"1.3.6.1.5.5.7.48.1.2",ocspNoCheck:"1.3.6.1.5.5.7.48.1.5",caIssuers:"1.3.6.1.5.5.7.48.2",anyExtendedKeyUsage:"2.5.29.37.0",serverAuth:"1.3.6.1.5.5.7.3.1",clientAuth:"1.3.6.1.5.5.7.3.2",codeSigning:"1.3.6.1.5.5.7.3.3",emailProtection:"1.3.6.1.5.5.7.3.4",timeStamping:"1.3.6.1.5.5.7.3.8",ocspSigning:"1.3.6.1.5.5.7.3.9",smtpUTF8Mailbox:"1.3.6.1.5.5.7.8.9",dateOfBirth:"1.3.6.1.5.5.7.9.1",placeOfBirth:"1.3.6.1.5.5.7.9.2",gender:"1.3.6.1.5.5.7.9.3",countryOfCitizenship:"1.3.6.1.5.5.7.9.4",countryOfResidence:"1.3.6.1.5.5.7.9.5",ecPublicKey:"1.2.840.10045.2.1","P-256":"1.2.840.10045.3.1.7",secp256r1:"1.2.840.10045.3.1.7",secp256k1:"1.3.132.0.10",secp384r1:"1.3.132.0.34",secp521r1:"1.3.132.0.35",pkcs5PBES2:"1.2.840.113549.1.5.13",pkcs5PBKDF2:"1.2.840.113549.1.5.12","des-EDE3-CBC":"1.2.840.113549.3.7",data:"1.2.840.113549.1.7.1","signed-data":"1.2.840.113549.1.7.2","enveloped-data":"1.2.840.113549.1.7.3","digested-data":"1.2.840.113549.1.7.5","encrypted-data":"1.2.840.113549.1.7.6","authenticated-data":"1.2.840.113549.1.9.16.1.2",tstinfo:"1.2.840.113549.1.9.16.1.4",signingCertificate:"1.2.840.113549.1.9.16.2.12",timeStampToken:"1.2.840.113549.1.9.16.2.14",signaturePolicyIdentifier:"1.2.840.113549.1.9.16.2.15",etsArchiveTimeStamp:"1.2.840.113549.1.9.16.2.27",signingCertificateV2:"1.2.840.113549.1.9.16.2.47",etsArchiveTimeStampV2:"1.2.840.113549.1.9.16.2.48",extensionRequest:"1.2.840.113549.1.9.14",contentType:"1.2.840.113549.1.9.3",messageDigest:"1.2.840.113549.1.9.4",signingTime:"1.2.840.113549.1.9.5",counterSignature:"1.2.840.113549.1.9.6",archiveTimeStampV3:"0.4.0.1733.2.4",pdfRevocationInfoArchival:"1.2.840.113583.1.1.8",adobeTimeStamp:"1.2.840.113583.1.1.9.1",smimeMailboxLegacy:"2.23.140.1.5.1.1",smimeMailboxMulti:"2.23.140.1.5.1.2",smimeMailboxStrict:"2.23.140.1.5.1.3",smimeOrganizationLegacy:"2.23.140.1.5.2.1",smimeOrganizationMulti:"2.23.140.1.5.2.2",smimeOrganizationStrict:"2.23.140.1.5.2.3",smimeSponsorLegacy:"2.23.140.1.5.3.1",smimeSponsorMulti:"2.23.140.1.5.3.2",smimeSponsorStrict:"2.23.140.1.5.3.3",smimeIndividualLegacy:"2.23.140.1.5.4.1",smimeIndividualMulti:"2.23.140.1.5.4.2",smimeIndividualStrict:"2.23.140.1.5.4.3"},this.atype2oidList={CN:"2.5.4.3",L:"2.5.4.7",ST:"2.5.4.8",O:"2.5.4.10",OU:"2.5.4.11",C:"2.5.4.6",STREET:"2.5.4.9",DC:"0.9.2342.19200300.100.1.25",UID:"0.9.2342.19200300.100.1.1",SN:"2.5.4.4",T:"2.5.4.12",GN:"2.5.4.42",DN:"2.5.4.49",E:"1.2.840.113549.1.9.1",description:"2.5.4.13",businessCategory:"2.5.4.15",postalCode:"2.5.4.17",serialNumber:"2.5.4.5",uniqueIdentifier:"2.5.4.45",organizationIdentifier:"2.5.4.97",jurisdictionOfIncorporationL:"1.3.6.1.4.1.311.60.2.1.1",jurisdictionOfIncorporationSP:"1.3.6.1.4.1.311.60.2.1.2",jurisdictionOfIncorporationC:"1.3.6.1.4.1.311.60.2.1.3"},this.objCache={},this.name2obj=function(e){if(void 0!==this.objCache[e])return this.objCache[e];if(void 0===this.name2oidList[e])throw"Name of ObjectIdentifier not defined: "+e;var r=this.name2oidList[e],n=new t({oid:r});return this.objCache[e]=n,n},this.atype2obj=function(e){if(void 0!==this.objCache[e])return this.objCache[e];var r;if(e.match(/^\d+\.\d+\.[0-9.]+$/))r=e;else if(void 0!==this.atype2oidList[e])r=this.atype2oidList[e];else{if(void 0===this.name2oidList[e])throw new Error("AttributeType name undefined: "+e);r=this.name2oidList[e]}var n=new t({oid:r});return this.objCache[e]=n,n},this.registerOIDs=function(t){if(this.checkOIDs(t))for(var e in t)this.name2oidList[e]=t[e]},this.checkOIDs=function(t){try{var e=Object.keys(t);return 0!=e.length&&(e.map(function(t,e,r){if(!this[t].match(/^[0-2]\.[0-9.]+$/))throw new Error("value is not OID")},t),!0)}catch(t){return!1}}},Qt.asn1.x509.OID.oid2name=function(t){var e=Qt.asn1.x509.OID.name2oidList;for(var r in e)if(e[r]==t)return r;return""},Qt.asn1.x509.OID.oid2atype=function(t){var e=Qt.asn1.x509.OID.atype2oidList;for(var r in e)if(e[r]==t)return r;return t},Qt.asn1.x509.OID.name2oid=function(t){if(t.match(/^[0-9.]+$/))return t;var e=Qt.asn1.x509.OID.name2oidList;return void 0===e[t]?"":e[t]},Qt.asn1.x509.X509Util={},Qt.asn1.x509.X509Util.newCertPEM=function(t){var e=Qt.asn1.x509;return e.TBSCertificate,new(0,e.Certificate)(t).getPEM()},void 0!==Qt&&Qt||(Qt={}),void 0!==Qt.asn1&&Qt.asn1||(Qt.asn1={}),void 0!==Qt.asn1.cms&&Qt.asn1.cms||(Qt.asn1.cms={}),Qt.asn1.cms.Attribute=function(t){var e=Error,r=Qt.asn1,n=r.DERSequence,i=r.DERSet,s=r.DERObjectIdentifier;this.params=null,this.typeOid=null,this.setByParam=function(t){this.params=t},this.getValueArray=function(){throw new e("not yet implemented abstract")},this.tohex=function(){var t=new s({oid:this.typeOid}),e=new i({array:this.getValueArray()});return new n({array:[t,e]}).tohex()},this.getEncodedHex=function(){return this.tohex()}},He(Qt.asn1.cms.Attribute,Qt.asn1.ASN1Object),Qt.asn1.cms.ContentType=function(t){var e=Qt.asn1;e.cms.ContentType.superclass.constructor.call(this),this.typeOid="1.2.840.113549.1.9.3",this.getValueArray=function(){return[new e.DERObjectIdentifier(this.params.type)]},null!=t&&this.setByParam(t)},He(Qt.asn1.cms.ContentType,Qt.asn1.cms.Attribute),Qt.asn1.cms.MessageDigest=function(t){var e=Qt.asn1,r=e.DEROctetString;e.cms.MessageDigest.superclass.constructor.call(this),this.typeOid="1.2.840.113549.1.9.4",this.getValueArray=function(){return[new r(this.params)]},null!=t&&this.setByParam(t)},He(Qt.asn1.cms.MessageDigest,Qt.asn1.cms.Attribute),Qt.asn1.cms.SigningTime=function(t){var e=Qt.asn1;e.cms.SigningTime.superclass.constructor.call(this),this.typeOid="1.2.840.113549.1.9.5",this.getValueArray=function(){return[new e.x509.Time(this.params)]},null!=t&&this.setByParam(t)},He(Qt.asn1.cms.SigningTime,Qt.asn1.cms.Attribute),Qt.asn1.cms.SigningCertificate=function(t){var e=Error,r=Qt,n=r.asn1,i=n.DERSequence,s=n.cms,a=s.ESSCertID;r.crypto,s.SigningCertificate.superclass.constructor.call(this),this.typeOid="1.2.840.113549.1.9.16.2.12",this.getValueArray=function(){if(null==this.params||null==this.params||null==this.params.array)throw new e("parameter 'array' not specified");for(var r=this.params.array,n=[],s=0;s<r.length;s++){var o=r[s];0!=t.hasis||"string"!=typeof o||-1==o.indexOf("-----BEGIN")&&!re.isASN1HEX(o)||(o={cert:o}),0!=o.hasis&&0==t.hasis&&(o.hasis=!1),n.push(new a(o))}var u=new i({array:n});return[new i({array:[u]})]},null!=t&&this.setByParam(t)},He(Qt.asn1.cms.SigningCertificate,Qt.asn1.cms.Attribute),Qt.asn1.cms.ESSCertID=function(t){Qt.asn1.cms.ESSCertID.superclass.constructor.call(this);var e=Error,r=Qt,n=r.asn1,i=n.DEROctetString,s=n.DERSequence,a=n.cms.IssuerSerial;this.params=null,this.getCertHash=function(t,n){if(null!=t.hash)return t.hash;if("string"==typeof t&&-1==t.indexOf("-----BEGIN")&&!re.isASN1HEX(t))return t;var i,s,a;if("string"==typeof t)i=t;else{if(null==t.cert)throw new e("hash nor cert unspecified");i=t.cert}if(s=-1!=i.indexOf("-----BEGIN")?de(i):i,"string"==typeof t&&(-1!=t.indexOf("-----BEGIN")?s=de(t):re.isASN1HEX(t)&&(s=t)),null!=t.alg)a=t.alg;else{if(null==n)throw new e("hash alg unspecified");a=n}return r.crypto.Util.hashHex(s,a)},this.tohex=function(){var t=this.params,e=this.getCertHash(t,"sha1"),r=[];return r.push(new i({hex:e})),("string"==typeof t&&-1!=t.indexOf("-----BEGIN")||null!=t.cert&&0!=t.hasis||null!=t.issuer&&null!=t.serial)&&r.push(new a(t)),new s({array:r}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},He(Qt.asn1.cms.ESSCertID,Qt.asn1.ASN1Object),Qt.asn1.cms.SigningCertificateV2=function(t){var e=Error,r=Qt,n=r.asn1,i=n.DERSequence;n.x509;var s=n.cms,a=s.ESSCertIDv2;r.crypto,s.SigningCertificateV2.superclass.constructor.call(this),this.typeOid="1.2.840.113549.1.9.16.2.47",this.getValueArray=function(){if(null==this.params||null==this.params||null==this.params.array)throw new e("parameter 'array' not specified");for(var r=this.params.array,n=[],s=0;s<r.length;s++){var o=r[s];null==t.alg&&0!=t.hasis||"string"!=typeof o||-1==o.indexOf("-----BEGIN")&&!re.isASN1HEX(o)||(o={cert:o}),null==o.alg&&null!=t.alg&&(o.alg=t.alg),0!=o.hasis&&0==t.hasis&&(o.hasis=!1),n.push(new a(o))}var u=new i({array:n});return[new i({array:[u]})]},null!=t&&this.setByParam(t)},He(Qt.asn1.cms.SigningCertificateV2,Qt.asn1.cms.Attribute),Qt.asn1.cms.ESSCertIDv2=function(t){Qt.asn1.cms.ESSCertIDv2.superclass.constructor.call(this);var e=Qt.asn1,r=e.DEROctetString,n=e.DERSequence,i=e.cms.IssuerSerial,s=e.x509.AlgorithmIdentifier;this.params=null,this.tohex=function(){var t=this.params,e=this.getCertHash(t,"sha256"),a=[];return null!=t.alg&&"sha256"!=t.alg&&a.push(new s({name:t.alg})),a.push(new r({hex:e})),("string"==typeof t&&-1!=t.indexOf("-----BEGIN")||null!=t.cert&&0!=t.hasis||null!=t.issuer&&null!=t.serial)&&a.push(new i(t)),new n({array:a}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},He(Qt.asn1.cms.ESSCertIDv2,Qt.asn1.cms.ESSCertID),Qt.asn1.cms.IssuerSerial=function(t){var e=Error,r=Qt.asn1,n=r.DERInteger,i=r.DERSequence,s=r.cms,a=r.x509.GeneralNames,o=Me;s.IssuerSerial.superclass.constructor.call(this),this.setByParam=function(t){this.params=t},this.tohex=function(){var t,r,s=this.params;if("string"==typeof s&&-1!=s.indexOf("-----BEGIN")||null!=s.cert){var u;u=null!=s.cert?s.cert:s;var c=new o;c.readCertPEM(u),t=c.getIssuer(),r={hex:c.getSerialNumberHex()}}else{if(null==s.issuer||!s.serial)throw new e("cert or issuer and serial parameter not specified");t=s.issuer,r=s.serial}var h=new a([{dn:t}]),l=new n(r);return new i({array:[h,l]}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},He(Qt.asn1.cms.IssuerSerial,Qt.asn1.ASN1Object),Qt.asn1.cms.SignerIdentifier=function(t){var e=Qt.asn1;e.DERInteger,e.DERSequence;var r=e.cms,n=r.IssuerAndSerialNumber,i=r.SubjectKeyIdentifier;e.x509.X500Name,r.SignerIdentifier.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params;if("isssn"==t.type)return new n(t).tohex();if("skid"==t.type)return new i(t).tohex();throw new Error("wrong property for isssn or skid")},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},He(Qt.asn1.cms.SignerIdentifier,Qt.asn1.ASN1Object),Qt.asn1.cms.IssuerAndSerialNumber=function(t){var e=Qt.asn1,r=e.DERInteger,n=e.DERSequence,i=e.cms,s=e.x509.X500Name,a=Me,o=Error;i.IssuerAndSerialNumber.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t,e,i=this.params;if("string"==typeof i&&-1!=i.indexOf("-----BEGIN")||null!=i.cert){var u;u=null!=i.cert?i.cert:i;var c=new a;c.readCertPEM(u),t=c.getIssuer(),e={hex:c.getSerialNumberHex()}}else{if(null==i.issuer||!i.serial)throw new o("cert or issuer and serial parameter not specified");t=i.issuer,e=i.serial}var h=new s(t),l=new r(e);return new n({array:[h,l]}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(t){this.params=t},null!=t&&this.setByParam(t)},He(Qt.asn1.cms.IssuerAndSerialNumber,Qt.asn1.ASN1Object),Qt.asn1.cms.SubjectKeyIdentifier=function(t){var e=Qt.asn1;e.DERInteger,e.DERSequence;var r=e.ASN1Util.newObject,n=e.cms;n.IssuerAndSerialName,n.SubjectKeyIdentifier,e.x509.X500Name;var i=Me,s=Error;n.SubjectKeyIdentifier.superclass.constructor.call(this),this.tohex=function(){var t,e=this.params;if(null==e.cert&&null==e.skid)throw new s("property cert nor skid undefined");null!=e.cert?t=new i(e.cert).getExtSubjectKeyIdentifier().kid.hex:null!=e.skid&&(t=e.skid);return r({tag:{tage:"a0",obj:{octstr:{hex:t}}}}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},He(Qt.asn1.cms.SubjectKeyIdentifier,Qt.asn1.ASN1Object),Qt.asn1.cms.AttributeList=function(t){var e=Error,r=Qt.asn1,n=r.DERSet,i=r.cms;i.AttributeList.superclass.constructor.call(this),this.params=null,this.hTLV=null,this.setByParam=function(t){this.params=t},this.tohex=function(){var t=this.params;if(null!=this.hTLV)return this.hTLV;var r=!0;null!=t.sortflag&&(r=t.sortflag);for(var s=t.array,a=[],o=0;o<s.length;o++){var u=s[o],c=u.attr;if("contentType"==c)a.push(new i.ContentType(u));else if("messageDigest"==c)a.push(new i.MessageDigest(u));else if("signingTime"==c)a.push(new i.SigningTime(u));else if("signingCertificate"==c)a.push(new i.SigningCertificate(u));else if("signingCertificateV2"==c)a.push(new i.SigningCertificateV2(u));else if("signaturePolicyIdentifier"==c)a.push(new Qt.asn1.cades.SignaturePolicyIdentifier(u));else{if("signatureTimeStamp"!=c&&"timeStampToken"!=c)throw new e("unknown attr: "+c);a.push(new Qt.asn1.cades.SignatureTimeStamp(u))}}var h=new n({array:a,sortflag:r});return this.hTLV=h.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},He(Qt.asn1.cms.AttributeList,Qt.asn1.ASN1Object),Qt.asn1.cms.SignerInfo=function(t){var e=Error,r=Qt,n=r.asn1,i=n.DERInteger,s=n.DEROctetString,a=n.DERSequence,o=n.DERTaggedObject,u=n.cms,c=u.SignerIdentifier,h=u.AttributeList;u.ContentType,u.EncapsulatedContentInfo,u.MessageDigest,u.SignedData;var l=n.x509.AlgorithmIdentifier,f=r.crypto,p=ke;u.SignerInfo.superclass.constructor.call(this),this.params=null,this.sign=function(){var t=this.params,e=t.sigalg,r=new h(t.sattrs).tohex(),n=p.getKey(t.signkey),i=new f.Signature({alg:e});i.init(n),i.updateHex(r);var s=i.sign();t.sighex=s},this.tohex=function(){var t=this.params,r=[];if(r.push(new i({int:t.version})),r.push(new c(t.id)),r.push(new l({name:t.hashalg})),null!=t.sattrs){var n=new h(t.sattrs);try{r.push(new o({tag:"a0",explicit:!1,obj:n}))}catch(t){throw new e("si sattr error: "+t)}}if(null!=t.sigalgfield?r.push(new l({name:t.sigalgfield})):r.push(new l({name:t.sigalg})),null==t.sighex&&null!=t.signkey&&this.sign(),r.push(new s({hex:t.sighex})),null!=t.uattrs){n=new h(t.uattrs);try{r.push(new o({tag:"a1",explicit:!1,obj:n}))}catch(t){throw new e("si uattr error: "+t)}}return new a({array:r}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},He(Qt.asn1.cms.SignerInfo,Qt.asn1.ASN1Object),Qt.asn1.cms.EncapsulatedContentInfo=function(t){var e=Qt.asn1,r=e.DERTaggedObject,n=e.DERSequence,i=e.DERObjectIdentifier,s=e.DEROctetString;e.cms.EncapsulatedContentInfo.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params,e=[];if(e.push(new i(t.type)),null!=t.content&&(null!=t.content.hex||null!=t.content.str)&&1!=t.isDetached){var a=new s(t.content),o=new r({tag:"a0",explicit:!0,obj:a});e.push(o)}return new n({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(t){this.params=t},null!=t&&this.setByParam(t)},He(Qt.asn1.cms.EncapsulatedContentInfo,Qt.asn1.ASN1Object),Qt.asn1.cms.ContentInfo=function(t){var e=Qt.asn1,r=e.DERTaggedObject,n=e.DERSequence,i=e.DERObjectIdentifier;e.x509.OID.name2obj,Qt.asn1.cms.ContentInfo.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params,e=[];e.push(new i(t.type));var s=new r({tag:"a0",explicit:!0,obj:t.obj});return e.push(s),new n({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(t){this.params=t},null!=t&&this.setByParam(t)},He(Qt.asn1.cms.ContentInfo,Qt.asn1.ASN1Object),Qt.asn1.cms.SignedData=function(t){var e=Qt.asn1;e.ASN1Object;var r=e.DERInteger,n=e.DERSet,i=e.DERSequence;e.DERTaggedObject;var s=e.cms,a=s.EncapsulatedContentInfo,o=s.SignerInfo,u=s.ContentInfo,c=s.CertificateSet,h=s.RevocationInfoChoices,l=e.x509.AlgorithmIdentifier;Qt.asn1.cms.SignedData.superclass.constructor.call(this),this.params=null,this.checkAndFixParam=function(){var t=this.params;this._setDigestAlgs(t),this._setContentTypeByEContent(t),this._setMessageDigestByEContent(t),this._setSignerInfoVersion(t),this._setSignedDataVersion(t)},this._setDigestAlgs=function(t){for(var e={},r=t.sinfos,n=0;n<r.length;n++){e[r[n].hashalg]=1}t.hashalgs=Object.keys(e).sort()},this._setContentTypeByEContent=function(t){for(var e=t.econtent.type,r=t.sinfos,n=0;n<r.length;n++){var i=r[n];this._getAttrParamByName(i,"contentType").type=e}},this._setMessageDigestByEContent=function(t){var e=t.econtent;t.econtent.type;var r=e.content.hex;null==r&&"data"==e.type&&null!=e.content.str&&(r=pe(e.content.str));for(var n=t.sinfos,i=0;i<n.length;i++){var s=n[i],a=s.hashalg,o=this._getAttrParamByName(s,"messageDigest"),u=Qt.crypto.Util.hashHex(r,a);o.hex=u}},this._getAttrParamByName=function(t,e){for(var r=t.sattrs.array,n=0;n<r.length;n++)if(r[n].attr==e)return r[n]},this._setSignerInfoVersion=function(t){for(var e=t.sinfos,r=0;r<e.length;r++){var n=e[r],i=1;"skid"==n.id.type&&(i=3),n.version=i}},this._setSignedDataVersion=function(t){var e=this._getSignedDataVersion(t);t.version=e},this._getSignedDataVersion=function(t){if(null!=t.revinfos)for(var e=t.revinfos,r=0;r<e.length;r++){if(null!=e[r].ocsp)return 5}var n=t.sinfos;for(r=0;r<n.length;r++){if(3==t.sinfos[r].version)return 3}return"data"!=t.econtent.type?3:1},this.tohex=function(){var t=this.params;null!=this.getEncodedHexPrepare&&this.getEncodedHexPrepare(),1!=t.fixed&&this.checkAndFixParam();var e=[];e.push(new r({int:t.version}));for(var s=[],u=0;u<t.hashalgs.length;u++){var f=t.hashalgs[u];s.push(new l({name:f}))}e.push(new n({array:s})),e.push(new a(t.econtent)),null!=t.certs&&e.push(new c(t.certs)),null!=t.revinfos&&e.push(new h(t.revinfos));var p=[];for(u=0;u<t.sinfos.length;u++){var g=t.sinfos[u];p.push(new o(g))}return e.push(new n({array:p})),new i({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.getContentInfo=function(){return new u({type:"signed-data",obj:this})},this.getContentInfoEncodedHex=function(){return this.getContentInfo().tohex()},null!=t&&this.setByParam(t)},He(Qt.asn1.cms.SignedData,Qt.asn1.ASN1Object),Qt.asn1.cms.CertificateSet=function(t){Qt.asn1.cms.CertificateSet.superclass.constructor.call(this);var e=Error,r=Qt.asn1,n=r.DERTaggedObject,i=r.DERSet,s=r.ASN1Object;this.params=null,this.tohex=function(){var t,r=this.params,a=[];if(r instanceof Array)t=r;else{if(null==r.array)throw new e("cert array not specified");t=r.array}for(var o=0;o<t.length;o++){var u=de(t[o]),c=new s;c.hTLV=u,a.push(c)}var h={array:a};0==r.sortflag&&(h.sortflag=!1);var l=new i(h);return new n({tag:"a0",explicit:!1,obj:l}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},He(Qt.asn1.cms.CertificateSet,Qt.asn1.ASN1Object),Qt.asn1.cms.RevocationInfoChoices=function(t){Qt.asn1.cms.RevocationInfoChoices.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params;if(!t instanceof Array)throw new Error("params is not array");for(var e=[],r=0;r<t.length;r++)e.push(new Qt.asn1.cms.RevocationInfoChoice(t[r]));return Qt.asn1.ASN1Util.newObject({tag:{tagi:"a1",obj:{set:e}}}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},He(Qt.asn1.cms.RevocationInfoChoices,Qt.asn1.ASN1Object),Qt.asn1.cms.RevocationInfoChoice=function(t){Qt.asn1.cms.RevocationInfoChoice.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params;if(null!=t.crl&&"string"==typeof t.crl){var e=t.crl;return-1!=t.crl.indexOf("-----BEGIN")&&(e=de(t.crl)),e}if(null!=t.ocsp)return Qt.asn1.ASN1Util.newObject({tag:{tagi:"a1",obj:new Qt.asn1.cms.OtherRevocationFormat(t)}}).tohex();throw new Error("property crl or ocsp undefined")},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},He(Qt.asn1.cms.RevocationInfoChoice,Qt.asn1.ASN1Object),Qt.asn1.cms.OtherRevocationFormat=function(t){Qt.asn1.cms.OtherRevocationFormat.superclass.constructor.call(this);var e=Error,r=Qt,n=r.asn1.ASN1Util.newObject,i=r.lang.String.isHex;this.params=null,this.tohex=function(){var t=this.params;if(null==t.ocsp)throw new e("property ocsp not specified");if(!i(t.ocsp)||!re.isASN1HEX(t.ocsp))throw new e("ocsp value not ASN.1 hex string");return n({seq:[{oid:"1.3.6.1.5.5.7.16.2"},{asn1:{tlv:t.ocsp}}]}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},He(Qt.asn1.cms.OtherRevocationFormat,Qt.asn1.ASN1Object),Qt.asn1.cms.CMSUtil=new function(){},Qt.asn1.cms.CMSUtil.newSignedData=function(t){return new Qt.asn1.cms.SignedData(t)},Qt.asn1.cms.CMSUtil.verifySignedData=function(t){var e=Qt,r=e.asn1,n=r.cms;n.SignerInfo,n.SignedData,n.SigningTime,n.SigningCertificate,n.SigningCertificateV2,r.cades.SignaturePolicyIdentifier;var i=e.lang.String.isHex,s=re,a=s.getVbyList,o=s.getTLVbyList,u=s.getIdxbyList,c=s.getChildIdx,h=s.getTLV,l=s.oidname,f=e.crypto.Util.hashHex;void 0===t.cms&&i(t.cms);var p=t.cms,g=function(t,e){var r=e.idx;e.signerid_issuer1=o(t,r,[1,0],"30"),e.signerid_serial1=a(t,r,[1,1],"02"),e.hashalg=l(a(t,r,[2,0],"06"));var n=u(t,r,[3],"a0");e.idxSignedAttrs=n,d(t,e,n);var i=c(t,r).length;if(i<6)throw"malformed SignerInfo";e.sigalg=l(a(t,r,[i-2,0],"06")),e.sigval=a(t,r,[i-1],"04")},d=function(t,e,r){var n=c(t,r);e.signedAttrIdxList=n;for(var i=0;i<n.length;i++){var s,o=n[i],u=a(t,o,[0],"06");"2a864886f70d010905"===u?(s=he(a(t,o,[1,0])),e.saSigningTime=s):"2a864886f70d010904"===u&&(s=a(t,o,[1,0],"04"),e.saMessageDigest=s)}},v=function(t,e,r,n){r.verifyDetail={};var i=r.verifyDetail,s=e.parse.econtent,a=r.hashalg,o=r.saMessageDigest;i.validMessageDigest=!1,f(s,a)===o&&(i.validMessageDigest=!0),function(t,e,r){var n,i=e.parse.certsIdx;if(void 0===e.certs){n=[],e.certkeys=[];for(var s=c(t,i),a=0;a<s.length;a++){var o=h(t,s[a]),u=new Me;u.readCertHex(o),n[a]=u,e.certkeys[a]=u.getPublicKey()}e.certs=n}else n=e.certs;for(e.cccc=n.length,e.cccci=s.length,a=0;a<n.length;a++){var l=u.getIssuerHex(),f=u.getSerialNumberHex();r.signerid_issuer1===l&&r.signerid_serial1===f&&(r.certkey_idx=a)}}(t,e,r),i.validSignatureValue=!1;var u=r.sigalg,l="31"+h(t,r.idxSignedAttrs).substr(2);r.signedattrshex=l;var p=e.certs[r.certkey_idx].getPublicKey(),g=new Qt.crypto.Signature({alg:u});g.init(p),g.updateHex(l);var d=g.verify(r.sigval);i.validSignatureValue_isValid=d,!0===d&&(i.validSignatureValue=!0),r.isValid=!1,i.validMessageDigest&&i.validSignatureValue&&(r.isValid=!0)},m={isValid:!1,parse:{}};return function(t,e){if("2a864886f70d010702"!==a(t,0,[0],"06"))return e;e.cmsType="signedData",e.econtent=a(t,0,[1,0,2,1,0]),function(t,e){for(var r,n=3;n<6;n++)if(void 0!==(r=u(t,0,[1,0,n]))){var i=t.substr(r,2);"a0"===i&&(e.certsIdx=r),"a1"===i&&(e.revinfosIdx=r),"31"===i&&(e.signerinfosIdx=r)}}(t,e),e.signerInfos=[],function(t,e){var r=e.signerinfosIdx;if(void 0!==r){var n=c(t,r);e.signerInfoIdxList=n;for(var i=0;i<n.length;i++){var s={idx:n[i]};g(t,s),e.signerInfos.push(s)}}}(t,e)}(p,m.parse),function(t,e){for(var r=e.parse.signerInfos,n=r.length,i=!0,s=0;s<n;s++){var a=r[s];v(t,e,a),a.isValid||(i=!1)}e.isValid=i}(p,m),m},Qt.asn1.cms.CMSParser=function(){var t=Error,e=Me,r=new e,n=re,i=n.getV,s=n.getTLV;n.getIdxbyList;var a=n.getTLVbyList,o=n.getTLVbyListEx,u=n.getVbyList,c=n.getVbyListEx,h=n.getChildIdx;this.getCMSSignedData=function(t){var e=a(t,0,[1,0]);return this.getSignedData(e)},this.getSignedData=function(t){var e=h(t,0),r={},n=i(t,e[0]),a=parseInt(n,16);r.version=a;var u=s(t,e[1]);r.hashalgs=this.getHashAlgArray(u);var c=s(t,e[2]);r.econtent=this.getEContent(c);var l=o(t,0,["[0]"]);null!=l&&(r.certs=this.getCertificateSet(l)),o(t,0,["[1]"]);var f=o(t,0,[3]);return r.sinfos=this.getSignerInfos(f),r},this.getHashAlgArray=function(t){for(var r=h(t,0),n=new e,i=[],a=0;a<r.length;a++){var o=s(t,r[a]),u=n.getAlgorithmIdentifierName(o);i.push(u)}return i},this.getEContent=function(t){var e={},r=u(t,0,[0]),n=u(t,0,[1,0]);return e.type=Qt.asn1.x509.OID.oid2name(re.hextooidstr(r)),e.content={hex:n},e},this.getSignerInfos=function(t){for(var e=[],r=h(t,0),n=0;n<r.length;n++){var i=s(t,r[n]),a=this.getSignerInfo(i);e.push(a)}return e},this.getSignerInfo=function(t){var e={},i=h(t,0),a=n.getInt(t,i[0],-1);-1!=a&&(e.version=a);var u=s(t,i[1]),l=this.getIssuerAndSerialNumber(u);e.id=l;var f=s(t,i[2]),p=r.getAlgorithmIdentifierName(f);e.hashalg=p;var g=o(t,0,["[0]"]);if(null!=g){var d=this.getAttributeList(g);e.sattrs=d}var v=o(t,0,[3]),m=r.getAlgorithmIdentifierName(v);e.sigalg=m;var y=c(t,0,[4]);e.sighex=y;var w=o(t,0,["[1]"]);if(null!=w){var x=this.getAttributeList(w);e.uattrs=x}return e},this.getSignerIdentifier=function(t){if("30"==t.substr(0,2))return this.getIssuerAndSerialNumber(t);throw new Error("SKID of signerIdentifier not supported")},this.getIssuerAndSerialNumber=function(t){var e={type:"isssn"},n=h(t,0),a=s(t,n[0]);e.issuer=r.getX500Name(a);var o=i(t,n[1]);return e.serial={hex:o},e},this.getAttributeList=function(t){for(var e=[],r=h(t,0),n=0;n<r.length;n++){var i=s(t,r[n]),a=this.getAttribute(i);e.push(a)}return{array:e}},this.getAttribute=function(t){var e={},r=h(t,0),i=n.getOID(t,r[0]),a=Qt.asn1.x509.OID.oid2name(i);e.attr=a;var o=s(t,r[1]),u=h(o,0);if(1==u.length)e.valhex=s(o,u[0]);else{for(var c=[],l=0;l<u.length;l++)c.push(s(o,u[l]));e.valhex=c}return"contentType"==a?this.setContentType(e):"messageDigest"==a?this.setMessageDigest(e):"signingTime"==a?this.setSigningTime(e):"signingCertificate"==a?this.setSigningCertificate(e):"signingCertificateV2"==a?this.setSigningCertificateV2(e):"signaturePolicyIdentifier"==a&&this.setSignaturePolicyIdentifier(e),e},this.setContentType=function(t){var e=n.getOIDName(t.valhex,0,null);null!=e&&(t.type=e,delete t.valhex)},this.setSigningTime=function(t){var e=he(i(t.valhex,0));t.str=e,delete t.valhex},this.setMessageDigest=function(t){var e=i(t.valhex,0);t.hex=e,delete t.valhex},this.setSigningCertificate=function(t){var e=h(t.valhex,0);if(e.length>0){for(var r=s(t.valhex,e[0]),n=h(r,0),i=[],a=0;a<n.length;a++){var o=s(r,n[a]),u=this.getESSCertID(o);i.push(u)}t.array=i}if(e.length>1){var c=s(t.valhex,e[1]);t.polhex=c}delete t.valhex},this.setSignaturePolicyIdentifier=function(t){var r=h(t.valhex,0);if(r.length>0){var a=n.getOID(t.valhex,r[0]);t.oid=a}if(r.length>1){var o=new e,u=h(t.valhex,r[1]),c=s(t.valhex,u[0]),l=o.getAlgorithmIdentifierName(c);t.alg=l;var f=i(t.valhex,u[1]);t.hash=f}delete t.valhex},this.setSigningCertificateV2=function(t){var e=h(t.valhex,0);if(e.length>0){for(var r=s(t.valhex,e[0]),n=h(r,0),i=[],a=0;a<n.length;a++){var o=s(r,n[a]),u=this.getESSCertIDv2(o);i.push(u)}t.array=i}if(e.length>1){var c=s(t.valhex,e[1]);t.polhex=c}delete t.valhex},this.getESSCertID=function(t){var e={},r=h(t,0);if(r.length>0){var n=i(t,r[0]);e.hash=n}if(r.length>1){var a=s(t,r[1]),o=this.getIssuerSerial(a);null!=o.serial&&(e.serial=o.serial),null!=o.issuer&&(e.issuer=o.issuer)}return e},this.getESSCertIDv2=function(e){var n={},a=h(e,0);if(a.length<1||3<a.length)throw new t("wrong number of elements");var o=0;if("30"==e.substr(a[0],2)){var u=s(e,a[0]);n.alg=r.getAlgorithmIdentifierName(u),o++}else n.alg="sha256";var c=i(e,a[o]);if(n.hash=c,a.length>o+1){var l=s(e,a[o+1]),f=this.getIssuerSerial(l);n.issuer=f.issuer,n.serial=f.serial}return n},this.getIssuerSerial=function(t){var e={},n=h(t,0),a=s(t,n[0]),o=r.getGeneralNames(a)[0].dn;e.issuer=o;var u=i(t,n[1]);return e.serial={hex:u},e},this.getCertificateSet=function(t){for(var e=h(t,0),r=[],n=0;n<e.length;n++){var i=s(t,e[n]);if("30"==i.substr(0,2)){var a=ge(i,"CERTIFICATE");r.push(a)}}return{array:r,sortflag:!1}}},void 0!==Qt&&Qt||(Qt={}),void 0!==Qt.asn1&&Qt.asn1||(Qt.asn1={}),void 0!==Qt.asn1.tsp&&Qt.asn1.tsp||(Qt.asn1.tsp={}),Qt.asn1.tsp.TimeStampToken=function(t){var e=Qt.asn1.tsp;e.TimeStampToken.superclass.constructor.call(this),this.params=null,this.getEncodedHexPrepare=function(){var t=new e.TSTInfo(this.params.econtent.content);this.params.econtent.content.hex=t.tohex()},null!=t&&this.setByParam(t)},He(Qt.asn1.tsp.TimeStampToken,Qt.asn1.cms.SignedData),Qt.asn1.tsp.TSTInfo=function(t){var e=Qt.asn1,r=e.DERSequence,n=e.DERInteger,i=e.DERBoolean,s=e.DERGeneralizedTime,a=e.DERObjectIdentifier,o=e.DERTaggedObject,u=e.tsp,c=u.MessageImprint,h=u.Accuracy;e.x509.X500Name;var l=e.x509.GeneralName;if(u.TSTInfo.superclass.constructor.call(this),this.dVersion=new n({int:1}),this.dPolicy=null,this.dMessageImprint=null,this.dSerial=null,this.dGenTime=null,this.dAccuracy=null,this.dOrdering=null,this.dNonce=null,this.dTsa=null,this.tohex=function(){var t=[this.dVersion];if(null==this.dPolicy)throw new Error("policy shall be specified.");if(t.push(this.dPolicy),null==this.dMessageImprint)throw new Error("messageImprint shall be specified.");if(t.push(this.dMessageImprint),null==this.dSerial)throw new Error("serialNumber shall be specified.");if(t.push(this.dSerial),null==this.dGenTime)throw new Error("genTime shall be specified.");t.push(this.dGenTime),null!=this.dAccuracy&&t.push(this.dAccuracy),null!=this.dOrdering&&t.push(this.dOrdering),null!=this.dNonce&&t.push(this.dNonce),null!=this.dTsa&&t.push(this.dTsa);var e=new r({array:t});return this.hTLV=e.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},void 0!==t){if("string"==typeof t.policy){if(!t.policy.match(/^[0-9.]+$/))throw"policy shall be oid like 0.1.4.134";this.dPolicy=new a({oid:t.policy})}void 0!==t.messageImprint&&(this.dMessageImprint=new c(t.messageImprint)),void 0!==t.serial&&(this.dSerial=new n(t.serial)),void 0!==t.genTime&&(this.dGenTime=new s(t.genTime)),void 0!==t.accuracy&&(this.dAccuracy=new h(t.accuracy)),void 0!==t.ordering&&1==t.ordering&&(this.dOrdering=new i),void 0!==t.nonce&&(this.dNonce=new n(t.nonce)),void 0!==t.tsa&&(this.dTsa=new o({tag:"a0",explicit:!0,obj:new l({dn:t.tsa})}))}},He(Qt.asn1.tsp.TSTInfo,Qt.asn1.ASN1Object),Qt.asn1.tsp.Accuracy=function(t){var e=Qt.asn1,r=e.ASN1Util.newObject;e.tsp.Accuracy.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params,e=[];return null!=t.seconds&&"number"==typeof t.seconds&&e.push({int:t.seconds}),null!=t.millis&&"number"==typeof t.millis&&e.push({tag:{tagi:"80",obj:{int:t.millis}}}),null!=t.micros&&"number"==typeof t.micros&&e.push({tag:{tagi:"81",obj:{int:t.micros}}}),r({seq:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},He(Qt.asn1.tsp.Accuracy,Qt.asn1.ASN1Object),Qt.asn1.tsp.MessageImprint=function(t){var e=Qt.asn1,r=e.DERSequence,n=e.DEROctetString,i=e.x509.AlgorithmIdentifier;e.tsp.MessageImprint.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params,e=new i({name:t.alg}),s=new n({hex:t.hash});return new r({array:[e,s]}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&this.setByParam(t)},He(Qt.asn1.tsp.MessageImprint,Qt.asn1.ASN1Object),Qt.asn1.tsp.TimeStampReq=function(t){var e=Qt.asn1,r=e.DERSequence,n=e.DERInteger,i=e.DERBoolean;e.ASN1Object;var s=e.DERObjectIdentifier,a=e.tsp,o=a.MessageImprint;a.TimeStampReq.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params,e=[];return e.push(new n({int:1})),t.messageImprint instanceof Qt.asn1.ASN1Object?e.push(t.messageImprint):e.push(new o(t.messageImprint)),null!=t.policy&&e.push(new s(t.policy)),null!=t.nonce&&e.push(new n(t.nonce)),1==t.certreq&&e.push(new i),new r({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},He(Qt.asn1.tsp.TimeStampReq,Qt.asn1.ASN1Object),Qt.asn1.tsp.TimeStampResp=function(t){var e=Qt.asn1,r=e.DERSequence;e.ASN1Object;var n=e.tsp,i=n.PKIStatusInfo;n.TimeStampResp.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params,s=[];if(null!=t.econtent||null!=t.tst)if(null!=t.statusinfo?s.push(new i(t.statusinfo)):s.push(new i("granted")),null!=t.econtent)s.push(new n.TimeStampToken(t).getContentInfo());else{if(!(t.tst instanceof e.ASN1Object))throw new Error("improper member tst value");s.push(t.tst)}else{if(null==t.statusinfo)throw new Error("parameter for token nor statusinfo not specified");s.push(new i(t.statusinfo))}return new r({array:s}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},He(Qt.asn1.tsp.TimeStampResp,Qt.asn1.ASN1Object),Qt.asn1.tsp.PKIStatusInfo=function(t){var e=Error,r=Qt.asn1,n=r.DERSequence,i=r.tsp,s=i.PKIStatus,a=i.PKIFreeText,o=i.PKIFailureInfo;i.PKIStatusInfo.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params,r=[];if("string"==typeof t)r.push(new s(t));else{if(null==t.status)throw new e("property 'status' unspecified");r.push(new s(t.status)),null!=t.statusstr&&r.push(new a(t.statusstr)),null!=t.failinfo&&r.push(new o(t.failinfo))}return new n({array:r}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},He(Qt.asn1.tsp.PKIStatusInfo,Qt.asn1.ASN1Object),Qt.asn1.tsp.PKIStatus=function(t){var e=Error,r=Qt.asn1,n=r.DERInteger;r.tsp.PKIStatus.superclass.constructor.call(this);var i={granted:0,grantedWithMods:1,rejection:2,waiting:3,revocationWarning:4,revocationNotification:5};this.params=null,this.tohex=function(){var t,r=this.params;if("string"==typeof r)try{t=i[r]}catch(t){throw new e("undefined name: "+r)}else{if("number"!=typeof r)throw new e("unsupported params");t=r}return new n({int:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},He(Qt.asn1.tsp.PKIStatus,Qt.asn1.ASN1Object),Qt.asn1.tsp.PKIFreeText=function(t){var e=Error,r=Qt.asn1,n=r.DERSequence,i=r.DERUTF8String;r.tsp.PKIFreeText.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params;if(!(t instanceof Array))throw new e("wrong params: not array");for(var r=[],s=0;s<t.length;s++)r.push(new i({str:t[s]}));return new n({array:r}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},He(Qt.asn1.tsp.PKIFreeText,Qt.asn1.ASN1Object),Qt.asn1.tsp.PKIFailureInfo=function(t){var e=Error,r=Qt.asn1,n=r.DERBitString,i=r.tsp.PKIFailureInfo,s={badAlg:0,badRequest:2,badDataFormat:5,timeNotAvailable:14,unacceptedPolicy:15,unacceptedExtension:16,addInfoNotAvailable:17,systemFailure:25};i.superclass.constructor.call(this),this.params=null,this.getBinValue=function(){var t=this.params,r=0;if("number"==typeof t&&0<=t&&t<=25){for(var n=(r|=1<<t).toString(2),i="",a=n.length-1;a>=0;a--)i+=n[a];return i}if("string"==typeof t&&null!=s[t])return _e([t],s);if("object"==typeof t&&null!=t.length)return _e(t,s);throw new e("wrong params")},this.tohex=function(){this.params;var t=this.getBinValue();return new n({bin:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},He(Qt.asn1.tsp.PKIFailureInfo,Qt.asn1.ASN1Object),Qt.asn1.tsp.AbstractTSAAdapter=function(t){this.getTSTHex=function(t,e){throw"not implemented yet"}},Qt.asn1.tsp.SimpleTSAAdapter=function(t){var e=Qt,r=e.asn1.tsp,n=e.crypto.Util.hashHex;r.SimpleTSAAdapter.superclass.constructor.call(this),this.params=null,this.serial=0,this.getTSTHex=function(t,e){var i=n(t,e);this.params.econtent.content.messageImprint={alg:e,hash:i},this.params.econtent.content.serial={int:this.serial++};var s=Math.floor(1e9*Math.random());return this.params.econtent.content.nonce={int:s},new r.TimeStampToken(this.params).getContentInfoEncodedHex()},void 0!==t&&(this.params=t)},He(Qt.asn1.tsp.SimpleTSAAdapter,Qt.asn1.tsp.AbstractTSAAdapter),Qt.asn1.tsp.FixedTSAAdapter=function(t){var e=Qt,r=e.asn1.tsp,n=e.crypto.Util.hashHex;r.FixedTSAAdapter.superclass.constructor.call(this),this.params=null,this.getTSTHex=function(t,e){var i=n(t,e);return this.params.econtent.content.messageImprint={alg:e,hash:i},new r.TimeStampToken(this.params).getContentInfoEncodedHex()},void 0!==t&&(this.params=t)},He(Qt.asn1.tsp.FixedTSAAdapter,Qt.asn1.tsp.AbstractTSAAdapter),Qt.asn1.tsp.TSPUtil=new function(){},Qt.asn1.tsp.TSPUtil.newTimeStampToken=function(t){return new Qt.asn1.tsp.TimeStampToken(t)},Qt.asn1.tsp.TSPUtil.parseTimeStampReq=function(t){return(new Qt.asn1.tsp.TSPParser).getTimeStampReq(t)},Qt.asn1.tsp.TSPUtil.parseMessageImprint=function(t){return(new Qt.asn1.tsp.TSPParser).getMessageImprint(t)},Qt.asn1.tsp.TSPParser=function(){var t=new Me,e=re,r=e.getV,n=e.getTLV,i=e.getIdxbyList;e.getTLVbyListEx;var s=e.getChildIdx,a=["granted","grantedWithMods","rejection","waiting","revocationWarning","revocationNotification"],o={0:"badAlg",2:"badRequest",5:"badDataFormat",14:"timeNotAvailable",15:"unacceptedPolicy",16:"unacceptedExtension",17:"addInfoNotAvailable",25:"systemFailure"};this.getResponse=function(t){var e=s(t,0);if(1==e.length)return this.getPKIStatusInfo(n(t,e[0]));if(e.length>1){var r=this.getPKIStatusInfo(n(t,e[0])),i=n(t,e[1]),a=this.getToken(i);return a.statusinfo=r,a}},this.getToken=function(t){var e=(new Qt.asn1.cms.CMSParser).getCMSSignedData(t);return this.setTSTInfo(e),e},this.setTSTInfo=function(t){var e=t.econtent;if("tstinfo"==e.type){var r=e.content.hex,n=this.getTSTInfo(r);e.content=n}},this.getTSTInfo=function(e){var i={},a=s(e,0),o=r(e,a[1]);i.policy=Te(o);var u=n(e,a[2]);i.messageImprint=this.getMessageImprint(u);var c=r(e,a[3]);i.serial={hex:c};var h=r(e,a[4]);i.genTime={str:he(h)};var l=0;if(a.length>5&&"30"==e.substr(a[5],2)){var f=n(e,a[5]);i.accuracy=this.getAccuracy(f),l++}a.length>5+l&&"01"==e.substr(a[5+l],2)&&("ff"==r(e,a[5+l])&&(i.ordering=!0),l++);if(a.length>5+l&&"02"==e.substr(a[5+l],2)){var p=r(e,a[5+l]);i.nonce={hex:p},l++}if(a.length>5+l&&"a0"==e.substr(a[5+l],2)){var g=n(e,a[5+l]);g="30"+g.substr(2),pGeneralNames=t.getGeneralNames(g);var d=pGeneralNames[0].dn;i.tsa=d,l++}if(a.length>5+l&&"a1"==e.substr(a[5+l],2)){var v=n(e,a[5+l]);v="30"+v.substr(2);var m=t.getExtParamArray(v);i.ext=m,l++}return i},this.getAccuracy=function(t){for(var e={},n=s(t,0),i=0;i<n.length;i++){var a=t.substr(n[i],2),o=r(t,n[i]),u=parseInt(o,16);"02"==a?e.seconds=u:"80"==a?e.millis=u:"81"==a&&(e.micros=u)}return e},this.getMessageImprint=function(t){if("30"!=t.substr(0,2))throw new Error("head of messageImprint hex shall be x30");var n={};s(t,0);var a=i(t,0,[0,0]),o=r(t,a),u=e.hextooidstr(o),c=Qt.asn1.x509.OID.oid2name(u);if(""==c)throw new Error("hashAlg name undefined: "+u);var h=c,l=i(t,0,[1]);return n.alg=h,n.hash=r(t,l),n},this.getPKIStatusInfo=function(t){var e={},i=s(t,0),o=0;try{var u=r(t,i[0]),c=parseInt(u,16);e.status=a[c]}catch(t){}if(i.length>1&&"30"==t.substr(i[1],2)){var h=n(t,i[1]);e.statusstr=this.getPKIFreeText(h),o++}if(i.length>o&&"03"==t.substr(i[1+o],2)){var l=n(t,i[1+o]);e.failinfo=this.getPKIFailureInfo(l)}return e},this.getPKIFreeText=function(t){for(var r=[],n=s(t,0),i=0;i<n.length;i++)r.push(e.getString(t,n[i]));return r},this.getPKIFailureInfo=function(t){var r=e.getInt(t,0);return null!=o[r]?o[r]:r},this.getTimeStampReq=function(t){var i={certreq:!1},a=s(t,0);if(a.length<2)throw new Error("TimeStampReq must have at least 2 items");var o=n(t,a[1]);i.messageImprint=Qt.asn1.tsp.TSPUtil.parseMessageImprint(o);for(var u=2;u<a.length;u++){var c=a[u],h=t.substr(c,2);if("06"==h){var l=r(t,c);i.policy=e.hextooidstr(l)}"02"==h&&(i.nonce=r(t,c)),"01"==h&&(i.certreq=!0)}return i}},void 0!==Qt&&Qt||(Qt={}),void 0!==Qt.asn1&&Qt.asn1||(Qt.asn1={}),void 0!==Qt.asn1.cades&&Qt.asn1.cades||(Qt.asn1.cades={}),Qt.asn1.cades.SignaturePolicyIdentifier=function(t){var e=Qt.asn1.cades,r=e.SignaturePolicyId;e.SignaturePolicyIdentifier.superclass.constructor.call(this),this.typeOid="1.2.840.113549.1.9.16.2.15",this.params=null,this.getValueArray=function(){return[new r(this.params)]},this.setByParam=function(t){this.params=t},null!=t&&this.setByParam(t)},He(Qt.asn1.cades.SignaturePolicyIdentifier,Qt.asn1.cms.Attribute),Qt.asn1.cades.SignaturePolicyId=function(t){var e=Qt.asn1,r=e.DERSequence,n=e.DERObjectIdentifier;e.x509.AlgorithmIdentifier;var i=e.cades,s=i.SignaturePolicyId,a=i.OtherHashAlgAndValue;s.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params,e=[];return e.push(new n(t.oid)),e.push(new a(t)),new r({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(t){this.params=t},null!=t&&this.setByParam(t)},He(Qt.asn1.cades.SignaturePolicyId,Qt.asn1.ASN1Object),Qt.asn1.cades.OtherHashAlgAndValue=function(t){var e=Error,r=Qt.asn1,n=r.DERSequence,i=r.DEROctetString,s=r.x509.AlgorithmIdentifier;r.cades.OtherHashAlgAndValue.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params;if(null==t.alg)throw new e("property 'alg' not specified");if(null==t.hash&&null==t.cert)throw new e("property 'hash' nor 'cert' not specified");var r=null;if(null!=t.hash)r=t.hash;else if(null!=t.cert){if("string"!=typeof t.cert)throw new e("cert not string");var a=t.cert;-1!=t.cert.indexOf("-----BEGIN")&&(a=de(t.cert)),r=Qt.crypto.Util.hashHex(a,t.alg)}var o=[];return o.push(new s({name:t.alg})),o.push(new i({hex:r})),new n({array:o}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},He(Qt.asn1.cades.OtherHashAlgAndValue,Qt.asn1.ASN1Object),Qt.asn1.cades.OtherHashValue=function(t){Qt.asn1.cades.OtherHashValue.superclass.constructor.call(this);var e=Error,r=Qt;r.lang.String.isHex;var n=r.asn1.DEROctetString;r.crypto.Util.hashHex,this.params=null,this.tohex=function(){var t=this.params;if(null==t.hash&&null==t.cert)throw new e("hash or cert not specified");var r=null;if(null!=t.hash)r=t.hash;else if(null!=t.cert){if("string"!=typeof t.cert)throw new e("cert not string");var i=t.cert;-1!=t.cert.indexOf("-----BEGIN")&&(i=de(t.cert)),r=Qt.crypto.Util.hashHex(i,"sha1")}return new n({hex:r}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},He(Qt.asn1.cades.OtherHashValue,Qt.asn1.ASN1Object),Qt.asn1.cades.SignatureTimeStamp=function(t){var e=Error,r=Qt,n=r.lang.String.isHex,i=r.asn1,s=i.ASN1Object;i.x509,i.cades.SignatureTimeStamp.superclass.constructor.call(this),this.typeOid="1.2.840.113549.1.9.16.2.14",this.params=null,this.getValueArray=function(){var t=this.params;if(null!=t.tst){if(n(t.tst))return(r=new s).hTLV=t.tst,[r];if(t.tst instanceof s)return[t.tst];throw new e("params.tst has wrong value")}if(null!=t.res){var r,i=t.res;if(i instanceof s&&(i=i.tohex()),"string"!=typeof i||!n(i))throw new e("params.res has wrong value");return re.getTLVbyList(i,0,[1]),(r=new s).hTLV=t.tst,[r]}},null!=t&&this.setByParam(t)},He(Qt.asn1.cades.SignatureTimeStamp,Qt.asn1.cms.Attribute),Qt.asn1.cades.CompleteCertificateRefs=function(t){var e=Error,r=Qt,n=r.asn1,i=n.DERSequence,s=n.cades,a=s.OtherCertID,o=r.lang.String.isHex;s.CompleteCertificateRefs.superclass.constructor.call(this),this.typeOid="1.2.840.113549.1.9.16.2.21",this.params=null,this.getValueArray=function(){for(var t=this.params,r=[],n=0;n<t.array.length;n++){var s=t.array[n];if("string"==typeof s)if(-1!=s.indexOf("-----BEGIN"))s={cert:s};else{if(!o(s))throw new e("unsupported value: "+s);s={hash:s}}null!=t.alg&&null==s.alg&&(s.alg=t.alg),null!=t.hasis&&null==s.hasis&&(s.hasis=t.hasis);var u=new a(s);r.push(u)}return[new i({array:r})]},null!=t&&this.setByParam(t)},He(Qt.asn1.cades.CompleteCertificateRefs,Qt.asn1.cms.Attribute),Qt.asn1.cades.OtherCertID=function(t){var e=Qt.asn1,r=e.DERSequence,n=e.cms.IssuerSerial,i=e.cades,s=i.OtherHashValue,a=i.OtherHashAlgAndValue;i.OtherCertID.superclass.constructor.call(this),this.params=t,this.tohex=function(){var t=this.params;"string"==typeof t&&(-1!=t.indexOf("-----BEGIN")?t={cert:t}:_isHex(t)&&(t={hash:t}));var e=[],i=null;if(i=null!=t.alg?new a(t):new s(t),e.push(i),null!=t.cert&&1==t.hasis||null!=t.issuer&&null!=t.serial){var o=new n(t);e.push(o)}return new r({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},He(Qt.asn1.cades.OtherCertID,Qt.asn1.ASN1Object),Qt.asn1.cades.OtherHash=function(t){var e=Qt,r=e.asn1;r.cms;var n=r.cades,i=n.OtherHashAlgAndValue,s=n.OtherHashValue;e.crypto.Util.hashHex;var a=e.lang.String.isHex;n.OtherHash.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params;"string"==typeof t&&(-1!=t.indexOf("-----BEGIN")?t={cert:t}:a(t)&&(t={hash:t}));return(null!=t.alg?new i(t):new s(t)).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},He(Qt.asn1.cades.OtherHash,Qt.asn1.ASN1Object),Qt.asn1.cades.CAdESUtil=new function(){},Qt.asn1.cades.CAdESUtil.parseSignedDataForAddingUnsigned=function(t){return(new Qt.asn1.cms.CMSParser).getCMSSignedData(t)},Qt.asn1.cades.CAdESUtil.parseSignerInfoForAddingUnsigned=function(t,e,r){var n=re,i=n.getChildIdx,s=n.getTLV,a=n.getV,o=Qt.asn1,u=o.ASN1Object,c=o.cms,h=c.AttributeList,l=c.SignerInfo,f={},p=i(t,e);if(6!=p.length)throw"not supported items for SignerInfo (!=6)";var g=p.shift();f.version=s(t,g);var d=p.shift();f.si=s(t,d);var v=p.shift();f.digalg=s(t,v);var m=p.shift();f.sattrs=s(t,m);var y=p.shift();f.sigalg=s(t,y);var w=p.shift();f.sig=s(t,w),f.sigval=a(t,w);var x=null;return f.obj=new l,(x=new u).hTLV=f.version,f.obj.dCMSVersion=x,(x=new u).hTLV=f.si,f.obj.dSignerIdentifier=x,(x=new u).hTLV=f.digalg,f.obj.dDigestAlgorithm=x,(x=new u).hTLV=f.sattrs,f.obj.dSignedAttrs=x,(x=new u).hTLV=f.sigalg,f.obj.dSigAlg=x,(x=new u).hTLV=f.sig,f.obj.dSig=x,f.obj.dUnsignedAttrs=new h,f},void 0!==Qt.asn1.csr&&Qt.asn1.csr||(Qt.asn1.csr={}),Qt.asn1.csr.CertificationRequest=function(t){var e=Qt.asn1,r=e.DERBitString,n=e.DERSequence,i=e.csr;e.x509;var s=i.CertificationRequestInfo;i.CertificationRequest.superclass.constructor.call(this),this.setByParam=function(t){this.params=t},this.sign=function(){var t=new s(this.params).tohex(),e=new Qt.crypto.Signature({alg:this.params.sigalg});e.init(this.params.sbjprvkey),e.updateHex(t);var r=e.sign();this.params.sighex=r},this.getPEM=function(){return ge(this.tohex(),"CERTIFICATE REQUEST")},this.tohex=function(){var t=this.params,e=new Qt.asn1.csr.CertificationRequestInfo(this.params),i=new Qt.asn1.x509.AlgorithmIdentifier({name:t.sigalg});if(null==t.sighex&&null!=t.sbjprvkey&&this.sign(),null==t.sighex)throw new Error("sighex or sbjprvkey parameter not defined");var s=new r({hex:"00"+t.sighex});return new n({array:[e,i,s]}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&this.setByParam(t)},He(Qt.asn1.csr.CertificationRequest,Qt.asn1.ASN1Object),Qt.asn1.csr.CertificationRequestInfo=function(t){var e=Qt.asn1;e.DERBitString;var r=e.DERSequence,n=e.DERInteger,i=e.DERUTF8String,s=e.DERTaggedObject,a=e.ASN1Util.newObject,o=e.csr,u=e.x509,c=u.X500Name,h=u.Extensions,l=u.SubjectPublicKeyInfo;o.AttributeList,o.CertificationRequestInfo.superclass.constructor.call(this),this.params=null,this.setByParam=function(t){null!=t&&(this.params=t)},this.tohex=function(){var t=this.params,e=[];if(e.push(new n({int:0})),e.push(new c(t.subject)),e.push(new l(ke.getKey(t.sbjpubkey))),null!=t.attrs){var o=function(t){for(var e=Error,r=Qt.asn1.x509.Extensions,n=[],i=0;i<t.length;i++){var s=t[i],a=s.attr;if("extensionRequest"==a){var o={seq:[{oid:"1.2.840.113549.1.9.14"},{set:[new r(s.ext)]}]};n.push(o)}else if("unstructuredName"==a){o={seq:[{oid:"1.2.840.113549.1.9.2"},{set:s.names}]};n.push(o)}else{if("challengePassword"!=a)throw new e("unknown CSR attribute");o={seq:[{oid:"1.2.840.113549.1.9.7"},{set:[{utf8str:s.password}]}]};n.push(o)}}return{set:n}}(t.attrs),u=a({tag:{tage:"a0",obj:o}});e.push(u)}else if(null!=t.extreq){var f=new h(t.extreq);u=a({tag:{tage:"a0",obj:{seq:[{oid:"1.2.840.113549.1.9.14"},{set:[f]}]}}});e.push(u)}else e.push(new s({tag:"a0",explicit:!1,obj:new i({str:""})}));return new r({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},He(Qt.asn1.csr.CertificationRequestInfo,Qt.asn1.ASN1Object),Qt.asn1.csr.AttributeList=function(t){},He(Qt.asn1.csr.AttributeList,Qt.asn1.ASN1Object),Qt.asn1.csr.CSRUtil=new function(){},Qt.asn1.csr.CSRUtil.newCSRPEM=function(t){return new Qt.asn1.csr.CertificationRequest(t).getPEM()},Qt.asn1.csr.CSRUtil.getParam=function(t,e){var r=re,n=r.getV,i=r.getIdxbyList,s=r.getTLVbyList,a=r.getTLVbyListEx,o=r.getVbyListEx,u={};if(-1==t.indexOf("-----BEGIN CERTIFICATE REQUEST"))throw new Error("argument is not PEM file");var c=de(t,"CERTIFICATE REQUEST");e&&(u.tbs=s(c,0,[0]));try{var h=a(c,0,[0,1]);if("3000"==h)u.subject={};else{var l=new Me;u.subject=l.getX500Name(h)}}catch(t){}var f=a(c,0,[0,2]),p=ke.getKey(f,null,"pkcs8pub");u.sbjpubkey=ke.getPEM(p,"PKCS8PUB");var g=function(t){var e=i(t,0,[0,3,0,0],"06");return"2a864886f70d01090e"!=n(t,e)?null:s(t,0,[0,3,0,1,0],"30")}(c);l=new Me;null!=g&&(u.extreq=l.getExtParamArray(g));try{var d=a(c,0,[1],"30");l=new Me;u.sigalg=l.getAlgorithmIdentifierName(d)}catch(t){}try{var v=o(c,0,[2]);u.sighex=v}catch(t){}return u},Qt.asn1.csr.CSRUtil.verifySignature=function(t){try{var e=null;if("string"==typeof t&&-1!=t.indexOf("-----BEGIN CERTIFICATE REQUEST")?e=Qt.asn1.csr.CSRUtil.getParam(t,!0):"object"==typeof t&&null!=t.sbjpubkey&&null!=t.sigalg&&null!=t.sighex&&null!=t.tbs&&(e=t),null==e)return!1;var r=new Qt.crypto.Signature({alg:e.sigalg});return r.init(e.sbjpubkey),r.updateHex(e.tbs),r.verify(e.sighex)}catch(t){return alert(t),!1}},void 0!==Qt&&Qt||(Qt={}),void 0!==Qt.asn1&&Qt.asn1||(Qt.asn1={}),void 0!==Qt.asn1.ocsp&&Qt.asn1.ocsp||(Qt.asn1.ocsp={}),Qt.asn1.ocsp.DEFAULT_HASH="sha1",Qt.asn1.ocsp.OCSPResponse=function(t){Qt.asn1.ocsp.OCSPResponse.superclass.constructor.call(this),Qt.asn1.DEREnumerated;var e=Qt.asn1.ASN1Util.newObject,r=Qt.asn1.ocsp.ResponseBytes,n=["successful","malformedRequest","internalError","tryLater","_not_used_","sigRequired","unauthorized"];this.params=null,this._getStatusCode=function(){var t=this.params.resstatus;return"number"==typeof t?t:"string"!=typeof t?-1:n.indexOf(t)},this.setByParam=function(t){this.params=t},this.tohex=function(){var t=this.params,n=this._getStatusCode();if(-1==n)throw new Error("responseStatus not supported: "+t.resstatus);if(0!=n)return e({seq:[{enum:{int:n}}]}).tohex();var i=new r(t);return e({seq:[{enum:{int:0}},{tag:{tag:"a0",explicit:!0,obj:i}}]}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&this.setByParam(t)},He(Qt.asn1.ocsp.OCSPResponse,Qt.asn1.ASN1Object),Qt.asn1.ocsp.ResponseBytes=function(t){Qt.asn1.ocsp.ResponseBytes.superclass.constructor.call(this);var e=Qt.asn1,r=e.DERSequence,n=e.DERObjectIdentifier,i=e.DEROctetString,s=e.ocsp.BasicOCSPResponse;this.params=null,this.setByParam=function(t){this.params=t},this.tohex=function(){var t=this.params;if("ocspBasic"!=t.restype)throw new Error("not supported responseType: "+t.restype);var e=new s(t),a=[];return a.push(new n({name:"ocspBasic"})),a.push(new i({hex:e.tohex()})),new r({array:a}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&this.setByParam(t)},He(Qt.asn1.ocsp.ResponseBytes,Qt.asn1.ASN1Object),Qt.asn1.ocsp.BasicOCSPResponse=function(t){Qt.asn1.ocsp.BasicOCSPResponse.superclass.constructor.call(this);var e=Error,r=Qt.asn1,n=r.ASN1Object,i=r.DERSequence;r.DERGeneralizedTime;var s=r.DERTaggedObject,a=r.DERBitString;r.x509.Extensions;var o=r.x509.AlgorithmIdentifier,u=r.ocsp;u.ResponderID,_SingleResponseList=u.SingleResponseList,_ResponseData=u.ResponseData,this.params=null,this.setByParam=function(t){this.params=t},this.sign=function(){var t=this.params,e=t.tbsresp.tohex(),r=new Qt.crypto.Signature({alg:t.sigalg});r.init(t.reskey),r.updateHex(e),t.sighex=r.sign()},this.tohex=function(){var t=this.params;null==t.tbsresp&&(t.tbsresp=new _ResponseData(t)),null==t.sighex&&null!=t.reskey&&this.sign();var r=[];if(r.push(t.tbsresp),r.push(new o({name:t.sigalg})),r.push(new a({hex:"00"+t.sighex})),null!=t.certs&&null!=t.certs.length){for(var u=[],c=0;c<t.certs.length;c++){var h=t.certs[c],l=null;if(re.isASN1HEX(h))l=h;else{if(!h.match(/-----BEGIN/))throw new e("certs["+c+"] not hex or PEM");l=de(h)}u.push(new n({tlv:l}))}var f=new i({array:u});r.push(new s({tag:"a0",explicit:!0,obj:f}))}return new i({array:r}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&this.setByParam(t)},He(Qt.asn1.ocsp.BasicOCSPResponse,Qt.asn1.ASN1Object),Qt.asn1.ocsp.ResponseData=function(t){Qt.asn1.ocsp.ResponseData.superclass.constructor.call(this);var e=Qt.asn1,r=e.DERSequence,n=e.DERGeneralizedTime,i=e.DERTaggedObject,s=e.x509.Extensions,a=e.ocsp,o=a.ResponderID;_SingleResponseList=a.SingleResponseList,this.params=null,this.tohex=function(){var t=this.params;t.respid,t.prodat,t.array;var e=[];if(e.push(new o(t.respid)),e.push(new n(t.prodat)),e.push(new _SingleResponseList(t.array)),null!=t.ext){var a=new s(t.ext);e.push(new i({tag:"a1",explicit:!0,obj:a}))}return new r({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(t){this.params=t},void 0!==t&&this.setByParam(t)},He(Qt.asn1.ocsp.ResponseData,Qt.asn1.ASN1Object),Qt.asn1.ocsp.ResponderID=function(t){Qt.asn1.ocsp.ResponderID.superclass.constructor.call(this);var e=Qt,r=e.asn1,n=r.ASN1Util.newObject,i=r.x509.X500Name,s=e.lang.String.isHex,a=Error;this.params=null,this.tohex=function(){var t=this.params;if(null!=t.key){var e,r=null;if("string"==typeof t.key){if(s(t.key)&&(r=t.key),t.key.match(/-----BEGIN CERTIFICATE/))null!=(e=new Me(t.key).getExtSubjectKeyIdentifier())&&(r=e.kid.hex)}else if(t.key instanceof Me)null!=(e=t.key.getExtSubjectKeyIdentifier())&&(r=e.kid.hex);if(null==r)throw new a("wrong key member value");return n({tag:{tag:"a2",explicit:!0,obj:{octstr:{hex:r}}}}).tohex()}if(null!=t.name){var o=null;if("string"==typeof t.name&&t.name.match(/-----BEGIN CERTIFICATE/))o=new Me(t.name).getSubject();else t.name instanceof Me?o=t.name.getSubject():"object"!=typeof t.name||null==t.name.array&&null==t.name.str||(o=t.name);if(null==o)throw new a("wrong name member value");return n({tag:{tag:"a1",explicit:!0,obj:new i(o)}}).tohex()}throw new a("key or name not specified")},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(t){this.params=t},void 0!==t&&this.setByParam(t)},He(Qt.asn1.ocsp.ResponderID,Qt.asn1.ASN1Object),Qt.asn1.ocsp.SingleResponseList=function(t){Qt.asn1.ocsp.SingleResponseList.superclass.constructor.call(this);var e=Qt.asn1,r=e.DERSequence,n=e.ocsp.SingleResponse;this.params=null,this.tohex=function(){var t=this.params;if("object"!=typeof t||null==t.length)throw new Error("params not specified properly");for(var e=[],i=0;i<t.length;i++)e.push(new n(t[i]));return new r({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(t){this.params=t},void 0!==t&&this.setByParam(t)},He(Qt.asn1.ocsp.SingleResponseList,Qt.asn1.ASN1Object),Qt.asn1.ocsp.SingleResponse=function(t){var e=Error,r=Qt.asn1,n=r.DERSequence,i=r.DERGeneralizedTime,s=r.DERTaggedObject,a=r.ocsp,o=a.CertID,u=a.CertStatus,c=r.x509.Extensions;a.SingleResponse.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params,r=[];if(null==t.certid)throw new e("certid unspecified");if(null==t.status)throw new e("status unspecified");if(null==t.thisupdate)throw new e("thisupdate unspecified");if(r.push(new o(t.certid)),r.push(new u(t.status)),r.push(new i(t.thisupdate)),null!=t.nextupdate){var a=new i(t.nextupdate);r.push(new s({tag:"a0",explicit:!0,obj:a}))}if(null!=t.ext){var h=new c(t.ext);r.push(new s({tag:"a1",explicit:!0,obj:h}))}return new n({array:r}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(t){this.params=t},void 0!==t&&this.setByParam(t)},He(Qt.asn1.ocsp.SingleResponse,Qt.asn1.ASN1Object),Qt.asn1.ocsp.CertID=function(t){var e=Qt,r=e.asn1,n=r.DEROctetString,i=r.DERInteger,s=r.DERSequence,a=r.x509.AlgorithmIdentifier,o=r.ocsp;o.DEFAULT_HASH;var u=e.crypto.Util.hashHex,c=Me,h=re.getVbyList;o.CertID.superclass.constructor.call(this),this.DEFAULT_HASH="sha1",this.params=null,this.setByValue=function(t,e,r,n){null==n&&(n=this.DEFAULT_HASH),this.params={alg:n,issname:t,isskey:e,sbjsn:r}},this.setByCert=function(t,e,r){null==r&&(r=this.DEFAULT_HASH),this.params={alg:r,issuerCert:t,subjectCert:e}},this.getParamByCerts=function(t,e,r){null==r&&(r=this.DEFAULT_HASH);var n=new c(t),i=new c(e),s=u(n.getSubjectHex(),r),a=n.getPublicKeyHex();return{alg:r,issname:s,isskey:u(h(a,0,[1],"03",!0),r),sbjsn:i.getSerialNumberHex()}},this.tohex=function(){if("object"!=typeof this.params)throw new Error("params not set");var t,e,r,o,u=this.params;if(o=null==u.alg?this.DEFAULT_HASH:u.alg,null!=u.issuerCert&&null!=u.subjectCert){var c=this.getParamByCerts(u.issuerCert,u.subjectCert,o);t=c.issname,e=c.isskey,r=c.sbjsn}else{if(null==u.issname||null==u.isskey||null==u.sbjsn)throw new Error("required param members not defined");t=u.issname,e=u.isskey,r=u.sbjsn}var h=new a({name:o}),l=new n({hex:t}),f=new n({hex:e}),p=new i({hex:r}),g=new s({array:[h,l,f,p]});return this.hTLV=g.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&this.setByParam(t)},He(Qt.asn1.ocsp.CertID,Qt.asn1.ASN1Object),Qt.asn1.ocsp.CertStatus=function(t){Qt.asn1.ocsp.CertStatus.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params;if("good"==t.status)return"8000";if("unknown"==t.status)return"8200";if("revoked"==t.status){var e=[{gentime:{str:t.time}}];null!=t.reason&&e.push({tag:{tag:"a0",explicit:!0,obj:{enum:{int:t.reason}}}});var r={tag:"a1",explicit:!1,obj:{seq:e}};return Qt.asn1.ASN1Util.newObject({tag:r}).tohex()}throw new Error("bad status")},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(t){this.params=t},void 0!==t&&this.setByParam(t)},He(Qt.asn1.ocsp.CertStatus,Qt.asn1.ASN1Object),Qt.asn1.ocsp.Request=function(t){var e=Qt.asn1,r=e.DERSequence,n=e.ocsp;if(n.Request.superclass.constructor.call(this),this.dReqCert=null,this.dExt=null,this.tohex=function(){var t=[];if(null===this.dReqCert)throw"reqCert not set";t.push(this.dReqCert);var e=new r({array:t});return this.hTLV=e.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},void 0!==t){var i=new n.CertID(t);this.dReqCert=i}},He(Qt.asn1.ocsp.Request,Qt.asn1.ASN1Object),Qt.asn1.ocsp.TBSRequest=function(t){var e=Qt.asn1,r=e.DERSequence,n=e.ocsp;n.TBSRequest.superclass.constructor.call(this),this.version=0,this.dRequestorName=null,this.dRequestList=[],this.dRequestExt=null,this.setRequestListByParam=function(t){for(var e=[],r=0;r<t.length;r++){var i=new n.Request(t[0]);e.push(i)}this.dRequestList=e},this.tohex=function(){var t=[];if(0!==this.version)throw"not supported version: "+this.version;if(null!==this.dRequestorName)throw"requestorName not supported";var e=new r({array:this.dRequestList});if(t.push(e),null!==this.dRequestExt)throw"requestExtensions not supported";var n=new r({array:t});return this.hTLV=n.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&void 0!==t.reqList&&this.setRequestListByParam(t.reqList)},He(Qt.asn1.ocsp.TBSRequest,Qt.asn1.ASN1Object),Qt.asn1.ocsp.OCSPRequest=function(t){var e=Qt.asn1,r=e.DERSequence,n=e.ocsp;if(n.OCSPRequest.superclass.constructor.call(this),this.dTbsRequest=null,this.dOptionalSignature=null,this.tohex=function(){var t=[];if(null===this.dTbsRequest)throw"tbsRequest not set";if(t.push(this.dTbsRequest),null!==this.dOptionalSignature)throw"optionalSignature not supported";var e=new r({array:t});return this.hTLV=e.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&void 0!==t.reqList){var i=new n.TBSRequest(t);this.dTbsRequest=i}},He(Qt.asn1.ocsp.OCSPRequest,Qt.asn1.ASN1Object),Qt.asn1.ocsp.OCSPUtil={},Qt.asn1.ocsp.OCSPUtil.getRequestHex=function(t,e,r){var n=Qt.asn1.ocsp;void 0===r&&(r=n.DEFAULT_HASH);var i={alg:r,issuerCert:t,subjectCert:e};return new n.OCSPRequest({reqList:[i]}).tohex()},Qt.asn1.ocsp.OCSPUtil.getOCSPResponseInfo=function(t){var e=re,r=e.getVbyList,n=e.getVbyListEx,i=e.getIdxbyList;e.getIdxbyListEx;var s=e.getV,a={};try{var o=n(t,0,[0],"0a");a.responseStatus=parseInt(o,16)}catch(t){}if(0!==a.responseStatus)return a;try{var u=i(t,0,[1,0,1,0,0,2,0,1]);"80"===t.substr(u,2)?a.certStatus="good":"a1"===t.substr(u,2)?(a.certStatus="revoked",a.revocationTime=he(r(t,u,[0]))):"82"===t.substr(u,2)&&(a.certStatus="unknown")}catch(t){}try{var c=i(t,0,[1,0,1,0,0,2,0,2]);a.thisUpdate=he(s(t,c))}catch(t){}try{var h=i(t,0,[1,0,1,0,0,2,0,3]);"a0"===t.substr(h,2)&&(a.nextUpdate=he(r(t,h,[0])))}catch(t){}return a},Qt.asn1.ocsp.OCSPParser=function(){var t=Error,e=Me,r=new e,n=re,i=n.getV,s=n.getTLV,a=n.getIdxbyList,o=n.getVbyList,u=n.getTLVbyList,c=n.getVbyListEx,h=n.getTLVbyListEx,l=n.getChildIdx;this.getOCSPRequest=function(e){var r=l(e,0);if(1!=r.length&&2!=r.length)throw new t("wrong number elements: "+r.length);return this.getTBSRequest(s(e,r[0]))},this.getTBSRequest=function(t){var e={},n=h(t,0,[0],"30");e.array=this.getRequestList(n);var i=h(t,0,["[2]",0],"30");return null!=i&&(e.ext=r.getExtParamArray(i)),e},this.getRequestList=function(t){for(var e=[],r=l(t,0),n=0;n<r.length;n++){t=s(t,r[n]);e.push(this.getRequest(t))}return e},this.getRequest=function(e){var n=l(e,0);if(1!=n.length&&2!=n.length)throw new t("wrong number elements: "+n.length);var i=this.getCertID(s(e,n[0]));if(2==n.length){var o=a(e,0,[1,0]);i.ext=r.getExtParamArray(s(e,o))}return i},this.getCertID=function(r){var n=l(r,0);if(4!=n.length)throw new t("wrong number elements: "+n.length);var a=new e,o={};return o.alg=a.getAlgorithmIdentifierName(s(r,n[0])),o.issname=i(r,n[1]),o.isskey=i(r,n[2]),o.sbjsn=i(r,n[3]),o},this.getOCSPResponse=function(t){var e,r=l(t,0),n=i(t,r[0]),s=parseInt(n);if(1==r.length)return{resstatus:s};var a=u(t,0,[1,0]);return(e=this.getResponseBytes(a)).resstatus=s,e},this.getResponseBytes=function(t){var e,r=l(t,0),n=u(t,0,[1,0]);e=this.getBasicOCSPResponse(n);var s=i(t,r[0]);return e.restype=Qt.asn1.x509.OID.oid2name(Te(s)),e},this.getBasicOCSPResponse=function(t){var e,r=l(t,0);e=this.getResponseData(s(t,r[0]));var n=new Me;e.alg=n.getAlgorithmIdentifierName(s(t,r[1]));var a=i(t,r[2]);e.sighex=a.substr(2);var o=c(t,0,["[0]"]);if(null!=o){for(var u=l(o,0),h=[],f=0;f<u.length;f++){var p=s(o,u[f]);h.push(p)}e.certs=h}return e},this.getResponseData=function(t){var e=l(t,0),r=e.length,n={},a=0;"a0"==t.substr(e[0],2)&&a++,n.respid=this.getResponderID(s(t,e[a++]));var o=i(t,e[a++]);if(n.prodat=he(o),n.array=this.getSingleResponseList(s(t,e[a++])),"a1"==t.substr(e[r-1],2)){var c=u(t,e[r-1],[0]),h=new Me;n.ext=h.getExtParamArray(c)}return n},this.getResponderID=function(t){var e={};if("a2"==t.substr(0,2)){var r=o(t,0,[0]);e.key=r}if("a1"==t.substr(0,2)){var n=u(t,0,[0]),i=new Me;e.name=i.getX500Name(n)}return e},this.getSingleResponseList=function(t){for(var e=l(t,0),r=[],n=0;n<e.length;n++){var i=this.getSingleResponse(s(t,e[n]));r.push(i)}return r},this.getSingleResponse=function(t){var e=l(t,0),r={},n=this.getCertID(s(t,e[0]));r.certid=n;var a=this.getCertStatus(s(t,e[1]));if(r.status=a,"18"==t.substr(e[2],2)){var c=i(t,e[2]);r.thisupdate=he(c)}for(var h=3;h<e.length;h++){if("a0"==t.substr(e[h],2)){var f=o(t,e[h],[0],"18");r.nextupdate=he(f)}if("a1"==t.substr(e[h],2)){var p=new Me,g=u(t,0,[h,0]);r.ext=p.getExtParamArray(g)}}return r},this.getCertStatus=function(t){var e={};if("8000"==t)return{status:"good"};if("8200"==t)return{status:"unknown"};if("a1"==t.substr(0,2)){e.status="revoked";var r=he(o(t,0,[0]));e.time=r}return e}},void 0!==Qt&&Qt||(Qt={}),void 0!==Qt.lang&&Qt.lang||(Qt.lang={}),Qt.lang.String=function(){},"function"==typeof Buffer?(te=function(t){return se(Buffer.from(t,"utf8").toString("base64"))},ee=function(t){return Buffer.from(ae(t),"base64").toString("utf8")}):(te=function(t){return oe(me(De(t)))},ee=function(t){return decodeURIComponent(ye(ue(t)))}),Qt.lang.String.isInteger=function(t){return!!t.match(/^[0-9]+$/)||!!t.match(/^-[0-9]+$/)},Qt.lang.String.isHex=function(t){return Ce(t)},Qt.lang.String.isBase64=function(t){return!(!(t=t.replace(/\s+/g,"")).match(/^[0-9A-Za-z+\/]+={0,3}$/)||t.length%4!=0)},Qt.lang.String.isBase64URL=function(t){return!t.match(/[+/=]/)&&(t=ae(t),Qt.lang.String.isBase64(t))},Qt.lang.String.isIntegerArray=function(t){return!!(t=t.replace(/\s+/g,"")).match(/^\[[0-9,]+\]$/)},Qt.lang.String.isPrintable=function(t){return null!==t.match(/^[0-9A-Za-z '()+,-./:=?]*$/)},Qt.lang.String.isIA5=function(t){return null!==t.match(/^[\x20-\x21\x23-\x7f]*$/)},Qt.lang.String.isMail=function(t){return null!==t.match(/^[A-Za-z0-9]{1}[A-Za-z0-9_.-]*@{1}[A-Za-z0-9_.-]{1,}\.[A-Za-z0-9]{1,}$/)};var Be=function(t,e,r){return null==r&&(r="0"),t.length>=e?t:new Array(e-t.length+1).join(r)+t};function _e(t,e){for(var r=0,n=0;n<t.length;n++)r|=1<<e[t[n]];var i=r.toString(2),s="";for(n=i.length-1;n>=0;n--)s+=i[n];return s}function je(t,e,r){if("object"==typeof t){e=String(e).split(".");for(var n=0;n<e.length&&t;n++){var i=e[n];i.match(/^[0-9]+$/)&&(i=parseInt(i)),t=t[i]}return t||!1===t?t:r}}function He(t,e){var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t,t.superclass=e.prototype,e.prototype.constructor==Object.prototype.constructor&&(e.prototype.constructor=e)}void 0!==Qt&&Qt||(Qt={}),void 0!==Qt.crypto&&Qt.crypto||(Qt.crypto={}),Qt.crypto.Util=new function(){this.DIGESTINFOHEAD={sha1:"3021300906052b0e03021a05000414",sha224:"302d300d06096086480165030402040500041c",sha256:"3031300d060960864801650304020105000420",sha384:"3041300d060960864801650304020205000430",sha512:"3051300d060960864801650304020305000440",md2:"3020300c06082a864886f70d020205000410",md5:"3020300c06082a864886f70d020505000410",ripemd160:"3021300906052b2403020105000414"},this.DEFAULTPROVIDER={md5:"cryptojs",sha1:"cryptojs",sha224:"cryptojs",sha256:"cryptojs",sha384:"cryptojs",sha512:"cryptojs",ripemd160:"cryptojs",hmacmd5:"cryptojs",hmacsha1:"cryptojs",hmacsha224:"cryptojs",hmacsha256:"cryptojs",hmacsha384:"cryptojs",hmacsha512:"cryptojs",hmacripemd160:"cryptojs",MD5withRSA:"cryptojs/jsrsa",SHA1withRSA:"cryptojs/jsrsa",SHA224withRSA:"cryptojs/jsrsa",SHA256withRSA:"cryptojs/jsrsa",SHA384withRSA:"cryptojs/jsrsa",SHA512withRSA:"cryptojs/jsrsa",RIPEMD160withRSA:"cryptojs/jsrsa",MD5withECDSA:"cryptojs/jsrsa",SHA1withECDSA:"cryptojs/jsrsa",SHA224withECDSA:"cryptojs/jsrsa",SHA256withECDSA:"cryptojs/jsrsa",SHA384withECDSA:"cryptojs/jsrsa",SHA512withECDSA:"cryptojs/jsrsa",RIPEMD160withECDSA:"cryptojs/jsrsa",SHA1withDSA:"cryptojs/jsrsa",SHA224withDSA:"cryptojs/jsrsa",SHA256withDSA:"cryptojs/jsrsa",MD5withRSAandMGF1:"cryptojs/jsrsa",SHAwithRSAandMGF1:"cryptojs/jsrsa",SHA1withRSAandMGF1:"cryptojs/jsrsa",SHA224withRSAandMGF1:"cryptojs/jsrsa",SHA256withRSAandMGF1:"cryptojs/jsrsa",SHA384withRSAandMGF1:"cryptojs/jsrsa",SHA512withRSAandMGF1:"cryptojs/jsrsa",RIPEMD160withRSAandMGF1:"cryptojs/jsrsa"},this.CRYPTOJSMESSAGEDIGESTNAME={md5:at.algo.MD5,sha1:at.algo.SHA1,sha224:at.algo.SHA224,sha256:at.algo.SHA256,sha384:at.algo.SHA384,sha512:at.algo.SHA512,ripemd160:at.algo.RIPEMD160},this.getDigestInfoHex=function(t,e){if(void 0===this.DIGESTINFOHEAD[e])throw"alg not supported in Util.DIGESTINFOHEAD: "+e;return this.DIGESTINFOHEAD[e]+t},this.getPaddedDigestInfoHex=function(t,e,r){var n=this.getDigestInfoHex(t,e),i=r/4;if(n.length+22>i)throw"key is too short for SigAlg: keylen="+r+","+e;for(var s="0001",a="00"+n,o="",u=i-4-a.length,c=0;c<u;c+=2)o+="ff";return s+o+a},this.hashString=function(t,e){return new Qt.crypto.MessageDigest({alg:e}).digestString(t)},this.hashHex=function(t,e){return new Qt.crypto.MessageDigest({alg:e}).digestHex(t)},this.sha1=function(t){return this.hashString(t,"sha1")},this.sha256=function(t){return this.hashString(t,"sha256")},this.sha256Hex=function(t){return this.hashHex(t,"sha256")},this.sha512=function(t){return this.hashString(t,"sha512")},this.sha512Hex=function(t){return this.hashHex(t,"sha512")},this.isKey=function(t){return t instanceof $t||t instanceof Qt.crypto.DSA||t instanceof Qt.crypto.ECDSA}},Qt.crypto.Util.md5=function(t){return new Qt.crypto.MessageDigest({alg:"md5",prov:"cryptojs"}).digestString(t)},Qt.crypto.Util.ripemd160=function(t){return new Qt.crypto.MessageDigest({alg:"ripemd160",prov:"cryptojs"}).digestString(t)},Qt.crypto.Util.SECURERANDOMGEN=new Wt,Qt.crypto.Util.getRandomHexOfNbytes=function(t){var e=new Array(t);return Qt.crypto.Util.SECURERANDOMGEN.nextBytes(e),ne(e)},Qt.crypto.Util.getRandomBigIntegerOfNbytes=function(t){return new lt(Qt.crypto.Util.getRandomHexOfNbytes(t),16)},Qt.crypto.Util.getRandomHexOfNbits=function(t){var e=t%8,r=new Array((t-e)/8+1);return Qt.crypto.Util.SECURERANDOMGEN.nextBytes(r),r[0]=(255<<e&255^255)&r[0],ne(r)},Qt.crypto.Util.getRandomBigIntegerOfNbits=function(t){return new lt(Qt.crypto.Util.getRandomHexOfNbits(t),16)},Qt.crypto.Util.getRandomBigIntegerZeroToMax=function(t){for(var e=t.bitLength();;){var r=Qt.crypto.Util.getRandomBigIntegerOfNbits(e);if(t.compareTo(r)>=0)return r}},Qt.crypto.Util.getRandomBigIntegerMinToMax=function(t,e){var r=t.compareTo(e);if(r>0)throw"biMin is greater than biMax";if(0==r)return t;var n=e.subtract(t);return Qt.crypto.Util.getRandomBigIntegerZeroToMax(n).add(t)},Qt.crypto.MessageDigest=function(t){this.setAlgAndProvider=function(t,e){if(null!==(t=Qt.crypto.MessageDigest.getCanonicalAlgName(t))&&void 0===e&&(e=Qt.crypto.Util.DEFAULTPROVIDER[t]),-1!=":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(t)&&"cryptojs"==e){try{this.md=Qt.crypto.Util.CRYPTOJSMESSAGEDIGESTNAME[t].create()}catch(e){throw"setAlgAndProvider hash alg set fail alg="+t+"/"+e}this.updateString=function(t){this.md.update(t)},this.updateHex=function(t){var e=at.enc.Hex.parse(t);this.md.update(e)},this.digest=function(){return this.md.finalize().toString(at.enc.Hex)},this.digestString=function(t){return this.updateString(t),this.digest()},this.digestHex=function(t){return this.updateHex(t),this.digest()}}if(-1!=":sha256:".indexOf(t)&&"sjcl"==e){try{this.md=new sjcl.hash.sha256}catch(e){throw"setAlgAndProvider hash alg set fail alg="+t+"/"+e}this.updateString=function(t){this.md.update(t)},this.updateHex=function(t){var e=sjcl.codec.hex.toBits(t);this.md.update(e)},this.digest=function(){var t=this.md.finalize();return sjcl.codec.hex.fromBits(t)},this.digestString=function(t){return this.updateString(t),this.digest()},this.digestHex=function(t){return this.updateHex(t),this.digest()}}},this.updateString=function(t){throw"updateString(str) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.updateHex=function(t){throw"updateHex(hex) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.digest=function(){throw"digest() not supported for this alg/prov: "+this.algName+"/"+this.provName},this.digestString=function(t){throw"digestString(str) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.digestHex=function(t){throw"digestHex(hex) not supported for this alg/prov: "+this.algName+"/"+this.provName},void 0!==t&&void 0!==t.alg&&(this.algName=t.alg,void 0===t.prov&&(this.provName=Qt.crypto.Util.DEFAULTPROVIDER[this.algName]),this.setAlgAndProvider(this.algName,this.provName))},Qt.crypto.MessageDigest.getCanonicalAlgName=function(t){return"string"==typeof t&&(t=(t=t.toLowerCase()).replace(/-/,"")),t},Qt.crypto.MessageDigest.getHashLength=function(t){var e=Qt.crypto.MessageDigest,r=e.getCanonicalAlgName(t);if(void 0===e.HASHLENGTH[r])throw"not supported algorithm: "+t;return e.HASHLENGTH[r]},Qt.crypto.MessageDigest.HASHLENGTH={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,ripemd160:20},Qt.crypto.Mac=function(t){this.setAlgAndProvider=function(t,e){if(null==(t=t.toLowerCase())&&(t="hmacsha1"),"hmac"!=(t=t.toLowerCase()).substr(0,4))throw"setAlgAndProvider unsupported HMAC alg: "+t;void 0===e&&(e=Qt.crypto.Util.DEFAULTPROVIDER[t]),this.algProv=t+"/"+e;var r=t.substr(4);if(-1!=":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(r)&&"cryptojs"==e){try{var n=Qt.crypto.Util.CRYPTOJSMESSAGEDIGESTNAME[r];this.mac=at.algo.HMAC.create(n,this.pass)}catch(t){throw"setAlgAndProvider hash alg set fail hashAlg="+r+"/"+t}this.updateString=function(t){this.mac.update(t)},this.updateHex=function(t){var e=at.enc.Hex.parse(t);this.mac.update(e)},this.doFinal=function(){return this.mac.finalize().toString(at.enc.Hex)},this.doFinalString=function(t){return this.updateString(t),this.doFinal()},this.doFinalHex=function(t){return this.updateHex(t),this.doFinal()}}},this.updateString=function(t){throw"updateString(str) not supported for this alg/prov: "+this.algProv},this.updateHex=function(t){throw"updateHex(hex) not supported for this alg/prov: "+this.algProv},this.doFinal=function(){throw"digest() not supported for this alg/prov: "+this.algProv},this.doFinalString=function(t){throw"digestString(str) not supported for this alg/prov: "+this.algProv},this.doFinalHex=function(t){throw"digestHex(hex) not supported for this alg/prov: "+this.algProv},this.setPassword=function(t){if("string"==typeof t){var e=t;return t.length%2!=1&&t.match(/^[0-9A-Fa-f]+$/)||(e=pe(t)),void(this.pass=at.enc.Hex.parse(e))}if("object"!=typeof t)throw"KJUR.crypto.Mac unsupported password type: "+t;e=null;if(void 0!==t.hex){if(t.hex.length%2!=0||!t.hex.match(/^[0-9A-Fa-f]+$/))throw"Mac: wrong hex password: "+t.hex;e=t.hex}if(void 0!==t.utf8&&(e=ce(t.utf8)),void 0!==t.rstr&&(e=pe(t.rstr)),void 0!==t.b64&&(e=ht(t.b64)),void 0!==t.b64u&&(e=ue(t.b64u)),null==e)throw"KJUR.crypto.Mac unsupported password type: "+t;this.pass=at.enc.Hex.parse(e)},void 0!==t&&(void 0!==t.pass&&this.setPassword(t.pass),void 0!==t.alg&&(this.algName=t.alg,void 0===t.prov&&(this.provName=Qt.crypto.Util.DEFAULTPROVIDER[this.algName]),this.setAlgAndProvider(this.algName,this.provName)))},Qt.crypto.Signature=function(t){var e=null;if(this._setAlgNames=function(){var t=this.algName.match(/^(.+)with(.+)$/);t&&(this.mdAlgName=t[1].toLowerCase(),this.pubkeyAlgName=t[2].toLowerCase(),"rsaandmgf1"==this.pubkeyAlgName&&"sha"==this.mdAlgName&&(this.mdAlgName="sha1"))},this._zeroPaddingOfSignature=function(t,e){for(var r="",n=e/4-t.length,i=0;i<n;i++)r+="0";return r+t},this.setAlgAndProvider=function(t,e){if(this._setAlgNames(),"cryptojs/jsrsa"!=e)throw new Error("provider not supported: "+e);if(-1!=":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(this.mdAlgName)){try{this.md=new Qt.crypto.MessageDigest({alg:this.mdAlgName})}catch(t){throw new Error("setAlgAndProvider hash alg set fail alg="+this.mdAlgName+"/"+t)}this.init=function(t,e){var r=null;try{r=void 0===e?ke.getKey(t):ke.getKey(t,e)}catch(t){throw"init failed:"+t}if(!0===r.isPrivate)this.prvKey=r,this.state="SIGN";else{if(!0!==r.isPublic)throw"init failed.:"+r;this.pubKey=r,this.state="VERIFY"}},this.updateString=function(t){this.md.updateString(t)},this.updateHex=function(t){this.md.updateHex(t)},this.sign=function(){if(this.sHashHex=this.md.digest(),void 0===this.prvKey&&void 0!==this.ecprvhex&&void 0!==this.eccurvename&&void 0!==Qt.crypto.ECDSA&&(this.prvKey=new Qt.crypto.ECDSA({curve:this.eccurvename,prv:this.ecprvhex})),this.prvKey instanceof $t&&"rsaandmgf1"===this.pubkeyAlgName)this.hSign=this.prvKey.signWithMessageHashPSS(this.sHashHex,this.mdAlgName,this.pssSaltLen);else if(this.prvKey instanceof $t&&"rsa"===this.pubkeyAlgName)this.hSign=this.prvKey.signWithMessageHash(this.sHashHex,this.mdAlgName);else if(this.prvKey instanceof Qt.crypto.ECDSA)this.hSign=this.prvKey.signWithMessageHash(this.sHashHex);else{if(!(this.prvKey instanceof Qt.crypto.DSA))throw"Signature: unsupported private key alg: "+this.pubkeyAlgName;this.hSign=this.prvKey.signWithMessageHash(this.sHashHex)}return this.hSign},this.signString=function(t){return this.updateString(t),this.sign()},this.signHex=function(t){return this.updateHex(t),this.sign()},this.verify=function(t){if(this.sHashHex=this.md.digest(),void 0===this.pubKey&&void 0!==this.ecpubhex&&void 0!==this.eccurvename&&void 0!==Qt.crypto.ECDSA&&(this.pubKey=new Qt.crypto.ECDSA({curve:this.eccurvename,pub:this.ecpubhex})),this.pubKey instanceof $t&&"rsaandmgf1"===this.pubkeyAlgName)return this.pubKey.verifyWithMessageHashPSS(this.sHashHex,t,this.mdAlgName,this.pssSaltLen);if(this.pubKey instanceof $t&&"rsa"===this.pubkeyAlgName)return this.pubKey.verifyWithMessageHash(this.sHashHex,t);if(void 0!==Qt.crypto.ECDSA&&this.pubKey instanceof Qt.crypto.ECDSA)return this.pubKey.verifyWithMessageHash(this.sHashHex,t);if(void 0!==Qt.crypto.DSA&&this.pubKey instanceof Qt.crypto.DSA)return this.pubKey.verifyWithMessageHash(this.sHashHex,t);throw"Signature: unsupported public key alg: "+this.pubkeyAlgName}}},this.init=function(t,e){throw"init(key, pass) not supported for this alg:prov="+this.algProvName},this.updateString=function(t){throw"updateString(str) not supported for this alg:prov="+this.algProvName},this.updateHex=function(t){throw"updateHex(hex) not supported for this alg:prov="+this.algProvName},this.sign=function(){throw"sign() not supported for this alg:prov="+this.algProvName},this.signString=function(t){throw"digestString(str) not supported for this alg:prov="+this.algProvName},this.signHex=function(t){throw"digestHex(hex) not supported for this alg:prov="+this.algProvName},this.verify=function(t){throw"verify(hSigVal) not supported for this alg:prov="+this.algProvName},this.initParams=t,void 0!==t&&(void 0!==t.alg&&(this.algName=t.alg,void 0===t.prov?this.provName=Qt.crypto.Util.DEFAULTPROVIDER[this.algName]:this.provName=t.prov,this.algProvName=this.algName+":"+this.provName,this.setAlgAndProvider(this.algName,this.provName),this._setAlgNames()),void 0!==t.psssaltlen&&(this.pssSaltLen=t.psssaltlen),void 0!==t.prvkeypem)){if(void 0!==t.prvkeypas)throw"both prvkeypem and prvkeypas parameters not supported";try{e=ke.getKey(t.prvkeypem);this.init(e)}catch(t){throw"fatal error to load pem private key: "+t}}},Qt.crypto.Cipher=function(t){},Qt.crypto.Cipher.encrypt=function(t,e,r,n){if(null!=je(n,"enclag")&&(r=n.encalg),"string"==typeof r&&"-CBC"==r.substr(-4)){var i=e,s=t;null!=je(n,"key")&&(i=n.key),null!=je(n,"enc")&&(hEnc=n.enc);var a,o=at.enc.Hex.parse(i),u=at.enc.Hex.parse(s),c=at.enc.Hex.parse(n.iv);if("des-EDE3-CBC"==r)a=at.TripleDES.encrypt(u,o,{iv:c});else{if("aes128-CBC"!=r&&"aes256-CBC"!=r)throw new Error("unsupported algorithm: "+r);a=at.AES.encrypt(u,o,{iv:c})}return a+""}throw new Error("Cipher.encrypt: unsupported key or algorithm")},Qt.crypto.Cipher.decrypt=function(t,e,r,n){if(null!=je(n,"enclag")&&(r=n.encalg),"string"==typeof r&&"-CBC"==r.substr(-4)){var i=e,s=t;null!=je(n,"key")&&(i=n.key),null!=je(n,"enc")&&(s=n.enc);var a,o=at.enc.Hex.parse(i),u=at.enc.Hex.parse(s),c=at.enc.Hex.parse(n.iv);if("des-EDE3-CBC"==r)a=at.TripleDES.decrypt({ciphertext:u},o,{iv:c});else{if("aes128-CBC"!=r&&"aes256-CBC"!=r)throw new Error("unsupported algorithm: "+r);a=at.AES.decrypt({ciphertext:u},o,{iv:c})}return at.enc.Hex.stringify(a)}throw new Error("Cipher.decrypt: unsupported key or algorithm")},Qt.crypto.OID=new function(){this.oidhex2name={"2a864886f70d010101":"rsaEncryption","2a8648ce3d0201":"ecPublicKey","2a8648ce380401":"dsa","2a8648ce3d030107":"secp256r1","2b8104001f":"secp192k1","2b81040021":"secp224r1","2b8104000a":"secp256k1","2b81040022":"secp384r1","2b81040023":"secp521r1","2a8648ce380403":"SHA1withDSA","608648016503040301":"SHA224withDSA","608648016503040302":"SHA256withDSA"}},void 0!==Qt&&Qt||(Qt={}),void 0!==Qt.crypto&&Qt.crypto||(Qt.crypto={}),Qt.crypto.ECDSA=function(t){var e=Error,r=lt,n=Yt,i=Qt.crypto.ECDSA,s=Qt.crypto.ECParameterDB,a=i.getName,o=re,u=o.getVbyListEx,c=o.isASN1HEX,h=new Wt;this.type="EC",this.isPrivate=!1,this.isPublic=!1,this.getBigRandom=function(t){return new r(t.bitLength(),h).mod(t.subtract(r.ONE)).add(r.ONE)},this.setNamedCurve=function(t){this.ecparams=s.getByName(t),this.prvKeyHex=null,this.pubKeyHex=null,this.curveName=t},this.setPrivateKeyHex=function(t){this.isPrivate=!0,this.prvKeyHex=t},this.setPublicKeyHex=function(t){this.isPublic=!0,this.pubKeyHex=t},this.getPublicKeyXYHex=function(){var t=this.pubKeyHex;if("04"!==t.substr(0,2))throw"this method supports uncompressed format(04) only";var e=this.ecparams.keycharlen;if(t.length!==2+2*e)throw"malformed public key hex length";var r={};return r.x=t.substr(2,e),r.y=t.substr(2+e),r},this.getShortNISTPCurveName=function(){var t=this.curveName;return"secp256r1"===t||"NIST P-256"===t||"P-256"===t||"prime256v1"===t?"P-256":"secp384r1"===t||"NIST P-384"===t||"P-384"===t?"P-384":"secp521r1"===t||"NIST P-521"===t||"P-521"===t?"P-521":null},this.generateKeyPairHex=function(){var t=this.ecparams.n,e=this.getBigRandom(t),r=this.ecparams.keycharlen,n=("0000000000"+e.toString(16)).slice(-r);return this.setPrivateKeyHex(n),{ecprvhex:n,ecpubhex:this.generatePublicKeyHex()}},this.generatePublicKeyHex=function(){var t=new r(this.prvKeyHex,16),e=this.ecparams.G.multiply(t),n=e.getX().toBigInteger(),i=e.getY().toBigInteger(),s=this.ecparams.keycharlen,a="04"+("0000000000"+n.toString(16)).slice(-s)+("0000000000"+i.toString(16)).slice(-s);return this.setPublicKeyHex(a),a},this.signWithMessageHash=function(t){return this.signHex(t,this.prvKeyHex)},this.signHex=function(t,e){var n=new r(e,16),s=this.ecparams.n,a=new r(t.substring(0,this.ecparams.keycharlen),16);do{var o=this.getBigRandom(s),u=this.ecparams.G.multiply(o).getX().toBigInteger().mod(s)}while(u.compareTo(r.ZERO)<=0);var c=o.modInverse(s).multiply(a.add(n.multiply(u))).mod(s);return i.biRSSigToASN1Sig(u,c)},this.sign=function(t,e){var n=e,i=this.ecparams.n,s=r.fromByteArrayUnsigned(t);do{var a=this.getBigRandom(i),o=this.ecparams.G.multiply(a).getX().toBigInteger().mod(i)}while(o.compareTo(lt.ZERO)<=0);var u=a.modInverse(i).multiply(s.add(n.multiply(o))).mod(i);return this.serializeSig(o,u)},this.verifyWithMessageHash=function(t,e){return this.verifyHex(t,e,this.pubKeyHex)},this.verifyHex=function(t,e,s){try{var a,o,u=i.parseSigHex(e);a=u.r,o=u.s;var c=n.decodeFromHex(this.ecparams.curve,s),h=new r(t.substring(0,this.ecparams.keycharlen),16);return this.verifyRaw(h,a,o,c)}catch(t){return!1}},this.verify=function(t,e,i){var s,a,o;if(Bitcoin.Util.isArray(e)){var u=this.parseSig(e);s=u.r,a=u.s}else{if("object"!=typeof e||!e.r||!e.s)throw"Invalid value for signature";s=e.r,a=e.s}if(i instanceof Yt)o=i;else{if(!Bitcoin.Util.isArray(i))throw"Invalid format for pubkey value, must be byte array or ECPointFp";o=n.decodeFrom(this.ecparams.curve,i)}var c=r.fromByteArrayUnsigned(t);return this.verifyRaw(c,s,a,o)},this.verifyRaw=function(t,e,n,i){var s=this.ecparams.n,a=this.ecparams.G;if(e.compareTo(r.ONE)<0||e.compareTo(s)>=0)return!1;if(n.compareTo(r.ONE)<0||n.compareTo(s)>=0)return!1;var o=n.modInverse(s),u=t.multiply(o).mod(s),c=e.multiply(o).mod(s);return a.multiply(u).add(i.multiply(c)).getX().toBigInteger().mod(s).equals(e)},this.serializeSig=function(t,e){var r=t.toByteArraySigned(),n=e.toByteArraySigned(),i=[];return i.push(2),i.push(r.length),(i=i.concat(r)).push(2),i.push(n.length),(i=i.concat(n)).unshift(i.length),i.unshift(48),i},this.parseSig=function(t){var e;if(48!=t[0])throw new Error("Signature not a valid DERSequence");if(2!=t[e=2])throw new Error("First element in signature must be a DERInteger");var n=t.slice(e+2,e+2+t[e+1]);if(2!=t[e+=2+t[e+1]])throw new Error("Second element in signature must be a DERInteger");var i=t.slice(e+2,e+2+t[e+1]);return e+=2+t[e+1],{r:r.fromByteArrayUnsigned(n),s:r.fromByteArrayUnsigned(i)}},this.parseSigCompact=function(t){if(65!==t.length)throw"Signature has the wrong length";var e=t[0]-27;if(e<0||e>7)throw"Invalid signature type";var n=this.ecparams.n;return{r:r.fromByteArrayUnsigned(t.slice(1,33)).mod(n),s:r.fromByteArrayUnsigned(t.slice(33,65)).mod(n),i:e}},this.readPKCS5PrvKeyHex=function(t){if(!1===c(t))throw new Error("not ASN.1 hex string");var e,r,n;try{e=u(t,0,["[0]",0],"06"),r=u(t,0,[1],"04");try{n=u(t,0,["[1]",0],"03")}catch(t){}}catch(t){throw new Error("malformed PKCS#1/5 plain ECC private key")}if(this.curveName=a(e),void 0===this.curveName)throw"unsupported curve name";this.setNamedCurve(this.curveName),this.setPublicKeyHex(n),this.setPrivateKeyHex(r),this.isPublic=!1},this.readPKCS8PrvKeyHex=function(t){if(!1===c(t))throw new e("not ASN.1 hex string");var r,n,i;try{u(t,0,[1,0],"06"),r=u(t,0,[1,1],"06"),n=u(t,0,[2,0,1],"04");try{i=u(t,0,[2,0,"[1]",0],"03")}catch(t){}}catch(t){throw new e("malformed PKCS#8 plain ECC private key")}if(this.curveName=a(r),void 0===this.curveName)throw new e("unsupported curve name");this.setNamedCurve(this.curveName),this.setPublicKeyHex(i),this.setPrivateKeyHex(n),this.isPublic=!1},this.readPKCS8PubKeyHex=function(t){if(!1===c(t))throw new e("not ASN.1 hex string");var r,n;try{u(t,0,[0,0],"06"),r=u(t,0,[0,1],"06"),n=u(t,0,[1],"03")}catch(t){throw new e("malformed PKCS#8 ECC public key")}if(this.curveName=a(r),null===this.curveName)throw new e("unsupported curve name");this.setNamedCurve(this.curveName),this.setPublicKeyHex(n)},this.readCertPubKeyHex=function(t,r){if(!1===c(t))throw new e("not ASN.1 hex string");var n,i;try{n=u(t,0,[0,5,0,1],"06"),i=u(t,0,[0,5,1],"03")}catch(t){throw new e("malformed X.509 certificate ECC public key")}if(this.curveName=a(n),null===this.curveName)throw new e("unsupported curve name");this.setNamedCurve(this.curveName),this.setPublicKeyHex(i)},void 0!==t&&void 0!==t.curve&&(this.curveName=t.curve),void 0===this.curveName&&(this.curveName="secp256r1"),this.setNamedCurve(this.curveName),void 0!==t&&(void 0!==t.prv&&this.setPrivateKeyHex(t.prv),void 0!==t.pub&&this.setPublicKeyHex(t.pub))},Qt.crypto.ECDSA.parseSigHex=function(t){var e=Qt.crypto.ECDSA.parseSigHexInHexRS(t);return{r:new lt(e.r,16),s:new lt(e.s,16)}},Qt.crypto.ECDSA.parseSigHexInHexRS=function(t){var e=re,r=e.getChildIdx,n=e.getV;if(e.checkStrictDER(t,0),"30"!=t.substr(0,2))throw new Error("signature is not a ASN.1 sequence");var i=r(t,0);if(2!=i.length)throw new Error("signature shall have two elements");var s=i[0],a=i[1];if("02"!=t.substr(s,2))throw new Error("1st item not ASN.1 integer");if("02"!=t.substr(a,2))throw new Error("2nd item not ASN.1 integer");return{r:n(t,s),s:n(t,a)}},Qt.crypto.ECDSA.asn1SigToConcatSig=function(t){var e=Qt.crypto.ECDSA.parseSigHexInHexRS(t),r=e.r,n=e.s;if(r.length>=130&&r.length<=134){if(r.length%2!=0)throw Error("unknown ECDSA sig r length error");if(n.length%2!=0)throw Error("unknown ECDSA sig s length error");"00"==r.substr(0,2)&&(r=r.substr(2)),"00"==n.substr(0,2)&&(n=n.substr(2));var i=Math.max(r.length,n.length);return(r=("000000"+r).slice(-i))+(n=("000000"+n).slice(-i))}if("00"==r.substr(0,2)&&r.length%32==2&&(r=r.substr(2)),"00"==n.substr(0,2)&&n.length%32==2&&(n=n.substr(2)),r.length%32==30&&(r="00"+r),n.length%32==30&&(n="00"+n),r.length%32!=0)throw Error("unknown ECDSA sig r length error");if(n.length%32!=0)throw Error("unknown ECDSA sig s length error");return r+n},Qt.crypto.ECDSA.concatSigToASN1Sig=function(t){if(t.length%4!=0)throw Error("unknown ECDSA concatinated r-s sig length error");var e=t.substr(0,t.length/2),r=t.substr(t.length/2);return Qt.crypto.ECDSA.hexRSSigToASN1Sig(e,r)},Qt.crypto.ECDSA.hexRSSigToASN1Sig=function(t,e){var r=new lt(t,16),n=new lt(e,16);return Qt.crypto.ECDSA.biRSSigToASN1Sig(r,n)},Qt.crypto.ECDSA.biRSSigToASN1Sig=function(t,e){var r=Qt.asn1,n=new r.DERInteger({bigint:t}),i=new r.DERInteger({bigint:e});return new r.DERSequence({array:[n,i]}).tohex()},Qt.crypto.ECDSA.getName=function(t){return"2b8104001f"===t?"secp192k1":"2a8648ce3d030107"===t?"secp256r1":"2b8104000a"===t?"secp256k1":"2b81040021"===t?"secp224r1":"2b81040022"===t?"secp384r1":"2b81040023"===t?"secp521r1":-1!=="|secp256r1|NIST P-256|P-256|prime256v1|".indexOf(t)?"secp256r1":-1!=="|secp256k1|".indexOf(t)?"secp256k1":-1!=="|secp224r1|NIST P-224|P-224|".indexOf(t)?"secp224r1":-1!=="|secp384r1|NIST P-384|P-384|".indexOf(t)?"secp384r1":-1!=="|secp521r1|NIST P-521|P-521|".indexOf(t)?"secp521r1":null},void 0!==Qt&&Qt||(Qt={}),void 0!==Qt.crypto&&Qt.crypto||(Qt.crypto={}),Qt.crypto.ECParameterDB=new function(){var t={},e={};function r(t){return new lt(t,16)}this.getByName=function(r){var n=r;if(void 0!==e[n]&&(n=e[r]),void 0!==t[n])return t[n];throw"unregistered EC curve name: "+n},this.regist=function(n,i,s,a,o,u,c,h,l,f,p,g){t[n]={};var d=r(s),v=r(a),m=r(o),y=r(u),w=r(c),x=new Xt(d,v,m),S=x.decodePointHex("04"+h+l);t[n].name=n,t[n].keylen=i,t[n].keycharlen=2*Math.ceil(i/8),t[n].curve=x,t[n].G=S,t[n].n=y,t[n].h=w,t[n].oid=p,t[n].info=g;for(var E=0;E<f.length;E++)e[f[E]]=n}},Qt.crypto.ECParameterDB.regist("secp128r1",128,"FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFF","FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFC","E87579C11079F43DD824993C2CEE5ED3","FFFFFFFE0000000075A30D1B9038A115","1","161FF7528B899B2D0C28607CA52C5B86","CF5AC8395BAFEB13C02DA292DDED7A83",[],"","secp128r1 : SECG curve over a 128 bit prime field"),Qt.crypto.ECParameterDB.regist("secp160k1",160,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73","0","7","0100000000000000000001B8FA16DFAB9ACA16B6B3","1","3B4C382CE37AA192A4019E763036F4F5DD4D7EBB","938CF935318FDCED6BC28286531733C3F03C4FEE",[],"","secp160k1 : SECG curve over a 160 bit prime field"),Qt.crypto.ECParameterDB.regist("secp160r1",160,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFC","1C97BEFC54BD7A8B65ACF89F81D4D4ADC565FA45","0100000000000000000001F4C8F927AED3CA752257","1","4A96B5688EF573284664698968C38BB913CBFC82","23A628553168947D59DCC912042351377AC5FB32",[],"","secp160r1 : SECG curve over a 160 bit prime field"),Qt.crypto.ECParameterDB.regist("secp192k1",192,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFEE37","0","3","FFFFFFFFFFFFFFFFFFFFFFFE26F2FC170F69466A74DEFD8D","1","DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D","9B2F2F6D9C5628A7844163D015BE86344082AA88D95E2F9D",[]),Qt.crypto.ECParameterDB.regist("secp192r1",192,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC","64210519E59C80E70FA7E9AB72243049FEB8DEECC146B9B1","FFFFFFFFFFFFFFFFFFFFFFFF99DEF836146BC9B1B4D22831","1","188DA80EB03090F67CBF20EB43A18800F4FF0AFD82FF1012","07192B95FFC8DA78631011ED6B24CDD573F977A11E794811",[]),Qt.crypto.ECParameterDB.regist("secp224r1",224,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFE","B4050A850C04B3ABF54132565044B0B7D7BFD8BA270B39432355FFB4","FFFFFFFFFFFFFFFFFFFFFFFFFFFF16A2E0B8F03E13DD29455C5C2A3D","1","B70E0CBD6BB4BF7F321390B94A03C1D356C21122343280D6115C1D21","BD376388B5F723FB4C22DFE6CD4375A05A07476444D5819985007E34",[]),Qt.crypto.ECParameterDB.regist("secp256k1",256,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F","0","7","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141","1","79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798","483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8",[]),Qt.crypto.ECParameterDB.regist("secp256r1",256,"FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF","FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC","5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B","FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551","1","6B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C296","4FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5",["NIST P-256","P-256","prime256v1"]),Qt.crypto.ECParameterDB.regist("secp384r1",384,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFC","B3312FA7E23EE7E4988E056BE3F82D19181D9C6EFE8141120314088F5013875AC656398D8A2ED19D2A85C8EDD3EC2AEF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC7634D81F4372DDF581A0DB248B0A77AECEC196ACCC52973","1","AA87CA22BE8B05378EB1C71EF320AD746E1D3B628BA79B9859F741E082542A385502F25DBF55296C3A545E3872760AB7","3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f",["NIST P-384","P-384"]),Qt.crypto.ECParameterDB.regist("secp521r1",521,"1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF","1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC","051953EB9618E1C9A1F929A21A0B68540EEA2DA725B99B315F3B8B489918EF109E156193951EC7E937B1652C0BD3BB1BF073573DF883D2C34F1EF451FD46B503F00","1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA51868783BF2F966B7FCC0148F709A5D03BB5C9B8899C47AEBB6FB71E91386409","1","00C6858E06B70404E9CD9E3ECB662395B4429C648139053FB521F828AF606B4D3DBAA14B5E77EFE75928FE1DC127A2FFA8DE3348B3C1856A429BF97E7E31C2E5BD66","011839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650",["NIST P-521","P-521"]),void 0!==Qt&&Qt||(Qt={}),void 0!==Qt.crypto&&Qt.crypto||(Qt.crypto={}),Qt.crypto.DSA=function(){var t=re;t.getVbyList;var e=t.getVbyListEx,r=t.isASN1HEX,n=lt,i=lt.ONE;this.p=null,this.q=null,this.g=null,this.y=null,this.x=null,this.type="DSA",this.isPrivate=!1,this.isPublic=!1,this.setPrivate=function(t,e,r,n,i){this.isPrivate=!0,this.p=t,this.q=e,this.g=r,this.y=n,this.x=i},this.setPrivateHex=function(t,e,r,n,i){var s,a,o,u,c;s=new lt(t,16),a=new lt(e,16),o=new lt(r,16),u="string"==typeof n&&n.length>1?new lt(n,16):null,c=new lt(i,16),this.setPrivate(s,a,o,u,c)},this.setPublic=function(t,e,r,n){!function(t,e,r,n){if(null==t||null==e||null==r||null==n)throw new Error("invalid DSA public key");if(i.compareTo(e)>=0||e.compareTo(t)>=0)throw new Error("invalid DSA public key");if(i.compareTo(r)>=0||r.compareTo(t)>=0)throw new Error("invalid DSA public key");if(i.compareTo(n)>=0||n.compareTo(t)>=0)throw new Error("invalid DSA public key");if(0!=r.modPow(e,t).compareTo(i))throw new Error("invalid DSA public key")}(t,e,r,n),this.isPublic=!0,this.p=t,this.q=e,this.g=r,this.y=n,this.x=null},this.setPublicHex=function(t,e,r,n){var i,s,a,o;i=new lt(t,16),s=new lt(e,16),a=new lt(r,16),o=new lt(n,16),this.setPublic(i,s,a,o)},this.signWithMessageHash=function(t){var e=this.p,r=this.q,n=this.g;this.y;var i,s,a,o=this.x,u=new lt(t.substr(0,r.bitLength()/4),16);do{i=Qt.crypto.Util.getRandomBigIntegerMinToMax(lt.ONE.add(lt.ONE),r.subtract(lt.ONE)),s=n.modPow(i,e).mod(r),a=i.modInverse(r).multiply(u.add(o.multiply(s))).mod(r)}while(0==s.compareTo(lt.ZERO)||0==a.compareTo(lt.ZERO));return Qt.asn1.ASN1Util.jsonToASN1HEX({seq:[{int:{bigint:s}},{int:{bigint:a}}]})},this.verifyWithMessageHash=function(t,e){var r=this.p,n=this.q,i=this.g,s=this.y,a=this.parseASN1Signature(e),o=a[0],u=a[1],c=new lt(t.substr(0,n.bitLength()/4),16);if(lt.ZERO.compareTo(o)>=0||o.compareTo(n)>=0)throw"invalid DSA signature";if(lt.ZERO.compareTo(u)>=0||u.compareTo(n)>=0)throw"invalid DSA signature";var h=u.modInverse(n),l=c.multiply(h).mod(n),f=o.multiply(h).mod(n);return 0==i.modPow(l,r).multiply(s.modPow(f,r)).mod(r).mod(n).compareTo(o)},this.parseASN1Signature=function(t){try{return[new n(e(t,0,[0],"02"),16),new n(e(t,0,[1],"02"),16)]}catch(t){throw new Error("malformed ASN.1 DSA signature")}},this.readPKCS5PrvKeyHex=function(t){var n,i,s,a,o;if(!1===r(t))throw new Error("not ASN.1 hex string");try{n=e(t,0,[1],"02"),i=e(t,0,[2],"02"),s=e(t,0,[3],"02"),a=e(t,0,[4],"02"),o=e(t,0,[5],"02")}catch(t){throw new Error("malformed PKCS#1/5 plain DSA private key")}this.setPrivateHex(n,i,s,a,o)},this.readPKCS8PrvKeyHex=function(t){var n,i,s,a;if(!1===r(t))throw new Error("not ASN.1 hex string");try{n=e(t,0,[1,1,0],"02"),i=e(t,0,[1,1,1],"02"),s=e(t,0,[1,1,2],"02"),a=e(t,0,[2,0],"02")}catch(t){throw new Error("malformed PKCS#8 plain DSA private key")}this.setPrivateHex(n,i,s,null,a)},this.readPKCS8PubKeyHex=function(t){var n,i,s,a;if(!1===r(t))throw new Error("not ASN.1 hex string");try{n=e(t,0,[0,1,0],"02"),i=e(t,0,[0,1,1],"02"),s=e(t,0,[0,1,2],"02"),a=e(t,0,[1,0],"02")}catch(t){throw new Error("malformed PKCS#8 DSA public key")}this.setPublicHex(n,i,s,a)},this.readCertPubKeyHex=function(t,n){var i,s,a,o;if(!1===r(t))throw new Error("not ASN.1 hex string");try{i=e(t,0,[0,5,0,1,0],"02"),s=e(t,0,[0,5,0,1,1],"02"),a=e(t,0,[0,5,0,1,2],"02"),o=e(t,0,[0,5,1,0],"02")}catch(t){throw new Error("malformed X.509 certificate DSA public key")}this.setPublicHex(i,s,a,o)}};var ke=function(){var t=function(t,r,n){return e(at.AES,t,r,n)},e=function(t,e,r,n){var i=at.enc.Hex.parse(e),s=at.enc.Hex.parse(r),a=at.enc.Hex.parse(n),o={};o.key=s,o.iv=a,o.ciphertext=i;var u=t.decrypt(o,s,{iv:a});return at.enc.Hex.stringify(u)},r=function(t,e,r){return n(at.AES,t,e,r)},n=function(t,e,r,n){var i=at.enc.Hex.parse(e),s=at.enc.Hex.parse(r),a=at.enc.Hex.parse(n),o=t.encrypt(i,s,{iv:a}),u=at.enc.Hex.parse(o.toString());return at.enc.Base64.stringify(u)},i={"AES-256-CBC":{proc:t,eproc:r,keylen:32,ivlen:16},"AES-192-CBC":{proc:t,eproc:r,keylen:24,ivlen:16},"AES-128-CBC":{proc:t,eproc:r,keylen:16,ivlen:16},"DES-EDE3-CBC":{proc:function(t,r,n){return e(at.TripleDES,t,r,n)},eproc:function(t,e,r){return n(at.TripleDES,t,e,r)},keylen:24,ivlen:8},"DES-CBC":{proc:function(t,r,n){return e(at.DES,t,r,n)},eproc:function(t,e,r){return n(at.DES,t,e,r)},keylen:8,ivlen:8}},s=function(t){var e={},r=t.match(new RegExp("DEK-Info: ([^,]+),([0-9A-Fa-f]+)","m"));r&&(e.cipher=r[1],e.ivsalt=r[2]);var n=t.match(new RegExp("-----BEGIN ([A-Z]+) PRIVATE KEY-----"));n&&(e.type=n[1]);var i=-1,s=0;-1!=t.indexOf("\r\n\r\n")&&(i=t.indexOf("\r\n\r\n"),s=2),-1!=t.indexOf("\n\n")&&(i=t.indexOf("\n\n"),s=1);var a=t.indexOf("-----END");if(-1!=i&&-1!=a){var o=t.substring(i+2*s,a-s);o=o.replace(/\s+/g,""),e.data=o}return e},a=function(t,e,r){for(var n=r.substring(0,16),s=at.enc.Hex.parse(n),a=at.enc.Utf8.parse(e),o=i[t].keylen+i[t].ivlen,u="",c=null;;){var h=at.algo.MD5.create();if(null!=c&&h.update(c),h.update(a),h.update(s),c=h.finalize(),(u+=at.enc.Hex.stringify(c)).length>=2*o)break}var l={};return l.keyhex=u.substr(0,2*i[t].keylen),l.ivhex=u.substr(2*i[t].keylen,2*i[t].ivlen),l},o=function(t,e,r,n){var s=at.enc.Base64.parse(t),a=at.enc.Hex.stringify(s);return(0,i[e].proc)(a,r,n)};return{version:"1.0.0",parsePKCS5PEM:function(t){return s(t)},getKeyAndUnusedIvByPasscodeAndIvsalt:function(t,e,r){return a(t,e,r)},decryptKeyB64:function(t,e,r,n){return o(t,e,r,n)},getDecryptedKeyHex:function(t,e){var r=s(t),n=r.cipher,i=r.ivsalt,u=r.data,c=a(n,e,i).keyhex;return o(u,n,c,i)},getEncryptedPKCS5PEMFromPrvKeyHex:function(t,e,r,n,s){var o="";if(void 0!==n&&null!=n||(n="AES-256-CBC"),void 0===i[n])throw new Error("KEYUTIL unsupported algorithm: "+n);if(void 0===s||null==s){var u=function(t){var e=at.lib.WordArray.random(t);return at.enc.Hex.stringify(e)}(i[n].ivlen);s=u.toUpperCase()}var c=function(t,e,r,n){return(0,i[e].eproc)(t,r,n)}(e,n,a(n,r,s).keyhex,s);o="-----BEGIN "+t+" PRIVATE KEY-----\r\n";return o+="Proc-Type: 4,ENCRYPTED\r\n",o+="DEK-Info: "+n+","+s+"\r\n",o+="\r\n",o+=c.replace(/(.{64})/g,"$1\r\n"),o+="\r\n-----END "+t+" PRIVATE KEY-----\r\n"},getEncryptedPKCS8PEM:function(t,e,r){return ge(this.getEncryptedPKCS8Hex(t,e,r),"ENCRYPTED PRIVATE KEY")},getEncryptedPKCS8Hex:function(t,e,r){var n;(n=null==r||null==r?{}:JSON.parse(JSON.stringify(r))).plain=t,this.initPBES2Param(n),this.encryptPBES2Param(n,e);var i=this.generatePBES2ASN1Param(n);return Qt.asn1.ASN1Util.newObject(i).tohex()},initPBES2Param:function(t){var e;(null==je(t,"encalg")&&(t.encalg="aes256-CBC"),null==je(t,"iter")&&(t.iter=2048),null==je(t,"prf")&&(t.prf="hmacWithSHA256"),null==je(t,"salt")&&(t.salt=at.enc.Hex.stringify(at.lib.WordArray.random(8))),null==je(t,"enciv"))&&("des-EDE3-CBC"==t.encalg&&(e=8),"aes128-CBC"==t.encalg&&(e=16),"aes256-CBC"==t.encalg&&(e=16),t.enciv=at.enc.Hex.stringify(at.lib.WordArray.random(e)))},encryptPBES2Param:function(t,e){var r=ke.getDKFromPBES2Param(t,e);try{var n=Qt.crypto.Cipher.encrypt(t.plain,r,t.encalg,{iv:t.enciv})}catch(e){throw new Error("encrypt error: "+t.plain+" "+r+" "+t.encalg+" "+t.enciv)}t.enc=n},generatePBES2ASN1Param:function(t){var e={seq:[{seq:[{oid:"pkcs5PBES2"},{seq:[{seq:[{oid:"pkcs5PBKDF2"},{seq:[{octstr:{hex:t.salt}},{int:{hex:Ne(t.iter)}}]}]},{seq:[{oid:t.encalg},{octstr:{hex:t.enciv}}]}]}]},{octstr:{hex:t.enc}}]};return"hmacWithSHA1"!=t.prf&&e.seq[0].seq[1].seq[0].seq[1].seq.push({seq:[{oid:t.prf},{null:""}]}),e},parseHexOfEncryptedPKCS8:function(t){var e=re,r=e.getChildIdx,n=e.getV,i={},s=r(t,0);if(2!=s.length)throw new Error("malformed format: SEQUENCE(0).items != 2: "+s.length);i.ciphertext=n(t,s[1]);var a=r(t,s[0]);if(2!=a.length)throw new Error("malformed format: SEQUENCE(0.0).items != 2: "+a.length);if("2a864886f70d01050d"!=n(t,a[0]))throw new Error("this only supports pkcs5PBES2");var o=r(t,a[1]);if(2!=a.length)throw new Error("malformed format: SEQUENCE(0.0.1).items != 2: "+o.length);var u=r(t,o[1]);if(2!=u.length)throw new Error("malformed format: SEQUENCE(0.0.1.1).items != 2: "+u.length);if("2a864886f70d0307"!=n(t,u[0]))throw"this only supports TripleDES";i.encryptionSchemeAlg="TripleDES",i.encryptionSchemeIV=n(t,u[1]);var c=r(t,o[0]);if(2!=c.length)throw new Error("malformed format: SEQUENCE(0.0.1.0).items != 2: "+c.length);if("2a864886f70d01050c"!=n(t,c[0]))throw new Error("this only supports pkcs5PBKDF2");var h=r(t,c[1]);if(h.length<2)throw new Error("malformed format: SEQUENCE(0.0.1.0.1).items < 2: "+h.length);i.pbkdf2Salt=n(t,h[0]);var l=n(t,h[1]);try{i.pbkdf2Iter=parseInt(l,16)}catch(t){throw new Error("malformed format pbkdf2Iter: "+l)}return i},getPBKDF2KeyHexFromParam:function(t,e){var r=at.enc.Hex.parse(t.pbkdf2Salt),n=t.pbkdf2Iter,i=at.PBKDF2(e,r,{keySize:6,iterations:n});return at.enc.Hex.stringify(i)},_getPlainPKCS8HexFromEncryptedPKCS8PEM:function(t,e){var r=de(t,"ENCRYPTED PRIVATE KEY"),n=this.parseHexOfEncryptedPKCS8(r),i=ke.getPBKDF2KeyHexFromParam(n,e),s={};s.ciphertext=at.enc.Hex.parse(n.ciphertext);var a=at.enc.Hex.parse(i),o=at.enc.Hex.parse(n.encryptionSchemeIV),u=at.TripleDES.decrypt(s,a,{iv:o});return at.enc.Hex.stringify(u)},parsePBES2:function(t){var e=re.parse(t);if("pkcs5PBES2"!=je(e,"seq.0.seq.0.oid")||"pkcs5PBKDF2"!=je(e,"seq.0.seq.1.seq.0.seq.0.oid"))throw new Error("not pkcs5PBES2 and pkcs5PBKDF2 used");var r=je(e,"seq.0.seq.1.seq.0.seq.1.seq");if(null==r)throw new Error("PBKDF2 parameter not found");var n=je(r,"0.octstr.hex"),i=je(r,"1.int.hex"),s=je(r,"2.seq.0.oid","hmacWithSHA1"),a=-1;try{a=parseInt(i,16)}catch(t){throw new Error("iter not proper value")}var o=je(e,"seq.0.seq.1.seq.1.seq.0.oid"),u=je(e,"seq.0.seq.1.seq.1.seq.1.octstr.hex"),c=je(e,"seq.1.octstr.hex");if(null==o||null==u||null==c)throw new Error("encalg, enciv or enc is undefined");return{salt:n,iter:a,prf:s,encalg:o,enciv:u,enc:c}},getDKFromPBES2Param:function(t,e){var r={hmacWithSHA1:at.algo.SHA1,hmacWithSHA224:at.algo.SHA224,hmacWithSHA256:at.algo.SHA256,hmacWithSHA384:at.algo.SHA384,hmacWithSHA512:at.algo.SHA512}[t.prf];if(null==r)throw new Error("unsupported prf");var n={"des-EDE3-CBC":6,"aes128-CBC":4,"aes256-CBC":8}[t.encalg];if(null==n)throw new Error("unsupported encalg");var i=at.enc.Hex.parse(t.salt),s=t.iter;try{var a=at.PBKDF2(e,i,{keySize:n,iterations:s,hasher:r});return at.enc.Hex.stringify(a)}catch(r){throw new Error("PBKDF2 error: "+r+" "+JSON.stringify(t)+" "+e)}},getPlainHexFromEncryptedPKCS8PEM:function(t,e){if(-1==t.indexOf("BEGIN ENCRYPTED PRIVATE KEY"))throw new Error("not Encrypted PKCS#8 PEM string");var r,n=de(t);try{r=ke.parsePBES2(n)}catch(t){throw new Error("malformed PBES2 format: "+t.message)}var i=ke.getDKFromPBES2Param(r,e);return Qt.crypto.Cipher.decrypt(r.enc,i,r.encalg,{iv:r.enciv})},getKeyFromEncryptedPKCS8PEM:function(t,e){var r=this.getPlainHexFromEncryptedPKCS8PEM(t,e);return this.getKeyFromPlainPrivatePKCS8Hex(r)},parsePlainPrivatePKCS8Hex:function(t){var e=re,r=e.getChildIdx,n=e.getV,i={algparam:null};if("30"!=t.substr(0,2))throw new Error("malformed plain PKCS8 private key(code:001)");var s=r(t,0);if(s.length<3)throw new Error("malformed plain PKCS8 private key(code:002)");if("30"!=t.substr(s[1],2))throw new Error("malformed PKCS8 private key(code:003)");var a=r(t,s[1]);if(2!=a.length)throw new Error("malformed PKCS8 private key(code:004)");if("06"!=t.substr(a[0],2))throw new Error("malformed PKCS8 private key(code:005)");if(i.algoid=n(t,a[0]),"06"==t.substr(a[1],2)&&(i.algparam=n(t,a[1])),"04"!=t.substr(s[2],2))throw new Error("malformed PKCS8 private key(code:006)");return i.keyidx=e.getVidx(t,s[2]),i},getKeyFromPlainPrivatePKCS8PEM:function(t){var e=de(t,"PRIVATE KEY");return this.getKeyFromPlainPrivatePKCS8Hex(e)},getKeyFromPlainPrivatePKCS8Hex:function(t){var e,r=this.parsePlainPrivatePKCS8Hex(t);if("2a864886f70d010101"==r.algoid)e=new $t;else if("2a8648ce380401"==r.algoid)e=new Qt.crypto.DSA;else{if("2a8648ce3d0201"!=r.algoid)throw new Error("unsupported private key algorithm");e=new Qt.crypto.ECDSA}return e.readPKCS8PrvKeyHex(t),e},_getKeyFromPublicPKCS8Hex:function(t){var e,r=re.getVbyList(t,0,[0,0],"06");if("2a864886f70d010101"===r)e=new $t;else if("2a8648ce380401"===r)e=new Qt.crypto.DSA;else{if("2a8648ce3d0201"!==r)throw new Error("unsupported PKCS#8 public key hex");e=new Qt.crypto.ECDSA}return e.readPKCS8PubKeyHex(t),e},parsePublicRawRSAKeyHex:function(t){var e=re,r=e.getChildIdx,n=e.getV,i={};if("30"!=t.substr(0,2))throw new Error("malformed RSA key(code:001)");var s=r(t,0);if(2!=s.length)throw new Error("malformed RSA key(code:002)");if("02"!=t.substr(s[0],2))throw new Error("malformed RSA key(code:003)");if(i.n=n(t,s[0]),"02"!=t.substr(s[1],2))throw new Error("malformed RSA key(code:004)");return i.e=n(t,s[1]),i},parsePublicPKCS8Hex:function(t){var e=re,r=e.getChildIdx,n=e.getV,i={algparam:null},s=r(t,0);if(2!=s.length)throw new Error("outer DERSequence shall have 2 elements: "+s.length);var a=s[0];if("30"!=t.substr(a,2))throw new Error("malformed PKCS8 public key(code:001)");var o=r(t,a);if(2!=o.length)throw new Error("malformed PKCS8 public key(code:002)");if("06"!=t.substr(o[0],2))throw new Error("malformed PKCS8 public key(code:003)");if(i.algoid=n(t,o[0]),"06"==t.substr(o[1],2)?i.algparam=n(t,o[1]):"30"==t.substr(o[1],2)&&(i.algparam={},i.algparam.p=e.getVbyList(t,o[1],[0],"02"),i.algparam.q=e.getVbyList(t,o[1],[1],"02"),i.algparam.g=e.getVbyList(t,o[1],[2],"02")),"03"!=t.substr(s[1],2))throw new Error("malformed PKCS8 public key(code:004)");return i.key=n(t,s[1]).substr(2),i}}}();function Le(t,e){for(var r="",n=e/4-t.length,i=0;i<n;i++)r+="0";return r+t}function Ve(t,e,r){for(var n="",i=0;n.length<e;)n+=fe(r(pe(t+String.fromCharCode.apply(String,[(4278190080&i)>>24,(16711680&i)>>16,(65280&i)>>8,255&i])))),i+=1;return n}function qe(t){for(var e in Qt.crypto.Util.DIGESTINFOHEAD){var r=Qt.crypto.Util.DIGESTINFOHEAD[e],n=r.length;if(t.substring(0,n)==r)return[e,t.substring(n)]}return[]}function Me(t){var e=re,r=e.getChildIdx,n=e.getV;e.dump;var i,s=e.parse,a=e.getTLV,o=e.getVbyList,u=e.getVbyListEx,c=e.getTLVbyList,h=e.getTLVbyListEx,l=e.getIdxbyList,f=e.getIdxbyListEx,p=e.getVidx,g=e.getInt,d=e.oidname,v=e.hextooidstr,m=de,y=Error;try{i=Qt.asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV}catch(t){}this.HEX2STAG={"0c":"utf8",13:"prn",16:"ia5","1a":"vis","1e":"bmp"},this.hex=null,this.version=0,this.foffset=0,this.aExtInfo=null,this.getVersion=function(){if(null===this.hex||0!==this.version)return this.version;var t=c(this.hex,0,[0,0]);if("a0"==t.substr(0,2)){var e=c(t,0,[0]),r=g(e,0);if(r<0||2<r)throw new Error("malformed version field");return this.version=r+1,this.version}return this.version=1,this.foffset=-1,1},this.getSerialNumberHex=function(){return u(this.hex,0,[0,0],"02")},this.getSignatureAlgorithmField=function(){var t=h(this.hex,0,[0,1]);return this.getAlgorithmIdentifierName(t)},this.getAlgorithmIdentifierName=function(t){for(var e in i)if(t===i[e])return e;return d(u(t,0,[0],"06"))},this.getIssuer=function(t,e){return this.getX500Name(this.getIssuerHex(),t,e)},this.getIssuerHex=function(){return c(this.hex,0,[0,3+this.foffset],"30")},this.getIssuerString=function(){return this.getIssuer().str},this.getSubject=function(t,e){return this.getX500Name(this.getSubjectHex(),t,e)},this.getSubjectHex=function(){return c(this.hex,0,[0,5+this.foffset],"30")},this.getSubjectString=function(){return this.getSubject().str},this.getNotBefore=function(){var t=o(this.hex,0,[0,4+this.foffset,0]);return t=t.replace(/(..)/g,"%$1"),t=decodeURIComponent(t)},this.getNotAfter=function(){var t=o(this.hex,0,[0,4+this.foffset,1]);return t=t.replace(/(..)/g,"%$1"),t=decodeURIComponent(t)},this.getPublicKeyHex=function(){return this.getSPKI()},this.getSPKI=function(){return c(this.hex,0,[0,6+this.foffset],"30")},this.getSPKIValue=function(){var t=this.getSPKI();return null==t?null:o(t,0,[1],"03",!0)},this.getPublicKeyIdx=function(){return l(this.hex,0,[0,6+this.foffset],"30")},this.getPublicKeyContentIdx=function(){var t=this.getPublicKeyIdx();return l(this.hex,t,[1,0],"30")},this.getPublicKey=function(){return ke.getKey(this.getPublicKeyHex(),null,"pkcs8pub")},this.getSignatureAlgorithmName=function(){var t=c(this.hex,0,[1],"30");return this.getAlgorithmIdentifierName(t)},this.getSignatureValueHex=function(){return o(this.hex,0,[2],"03",!0)},this.verifySignature=function(t){var e=this.getSignatureAlgorithmField(),r=this.getSignatureValueHex(),n=c(this.hex,0,[0],"30"),i=new Qt.crypto.Signature({alg:e});return i.init(t),i.updateHex(n),i.verify(r)},this.parseExt=function(t){var i,s,a;if(void 0===t){if(a=this.hex,3!==this.version)return-1;i=l(a,0,[0,7,0],"30"),s=r(a,i)}else{a=de(t);var u=l(a,0,[0,3,0,0],"06");if("2a864886f70d01090e"!=n(a,u))return void(this.aExtInfo=new Array);i=l(a,0,[0,3,0,1,0],"30"),s=r(a,i),this.hex=a}this.aExtInfo=new Array;for(var c=0;c<s.length;c++){var h={critical:!1},f=0;3===r(a,s[c]).length&&(h.critical=!0,f=1),h.oid=e.hextooidstr(o(a,s[c],[0],"06"));var g=l(a,s[c],[1+f]);h.vidx=p(a,g),this.aExtInfo.push(h)}},this.getExtInfo=function(t){var e=this.aExtInfo,r=t;if(t.match(/^[0-9.]+$/)||(r=Qt.asn1.x509.OID.name2oid(t)),""!==r)for(var n=0;n<e.length;n++)if(e[n].oid===r)return e[n]},this.getCriticalExtV=function(t,e,r){if(null!=e)return[e,r];var n=this.getExtInfo(t);return null==n?[null,null]:[a(this.hex,n.vidx),n.critical]},this.getExtBasicConstraints=function(t,e){if(void 0===t&&void 0===e){var r=this.getExtInfo("basicConstraints");if(void 0===r)return;t=a(this.hex,r.vidx),e=r.critical}var i={extname:"basicConstraints"};if(e&&(i.critical=!0),"3000"===t)return i;if("30030101ff"===t)return i.cA=!0,i;if("30060101ff02"===t.substr(0,12)){var s=n(t,10),o=parseInt(s,16);return i.cA=!0,i.pathLen=o,i}throw new Error("hExtV parse error: "+t)},this.getExtNameConstraints=function(t,e){var n=this.getCriticalExtV("nameConstraints",t,e);if(t=n[0],e=n[1],null!=t){var i={extname:"nameConstraints"};e&&(i.critical=!0);for(var s=r(t,0),o=0;o<s.length;o++){for(var u=[],c=r(t,s[o]),h=0;h<c.length;h++){var l=a(t,c[h]),f=this.getGeneralSubtree(l);u.push(f)}var p=t.substr(s[o],2);"a0"==p?i.permit=u:"a1"==p&&(i.exclude=u)}return i}},this.getGeneralSubtree=function(t){var e=r(t,0),i=e.length;if(i<1||2<i)throw new Error("wrong num elements");for(var s=this.getGeneralName(a(t,e[0])),o=1;o<i;o++){var u=t.substr(e[o],2),c=n(t,e[o]),h=parseInt(c,16);"80"==u&&(s.min=h),"81"==u&&(s.max=h)}return s},this.getExtKeyUsage=function(t,e){var r=this.getCriticalExtV("keyUsage",t,e);if(t=r[0],e=r[1],null!=t){var n={extname:"keyUsage"};return e&&(n.critical=!0),n.names=this.getExtKeyUsageString(t).split(","),n}},this.getExtKeyUsageBin=function(t){if(void 0===t){var e=this.getExtInfo("keyUsage");if(void 0===e)return"";t=a(this.hex,e.vidx)}if(8!=t.length&&10!=t.length)throw new Error("malformed key usage value: "+t);var r="000000000000000"+parseInt(t.substr(6),16).toString(2);return 8==t.length&&(r=r.slice(-8)),10==t.length&&(r=r.slice(-16)),""==(r=r.replace(/0+$/,""))&&(r="0"),r},this.getExtKeyUsageString=function(t){for(var e=this.getExtKeyUsageBin(t),r=new Array,n=0;n<e.length;n++)"1"==e.substr(n,1)&&r.push(Me.KEYUSAGE_NAME[n]);return r.join(",")},this.getExtSubjectKeyIdentifier=function(t,e){if(void 0===t&&void 0===e){var r=this.getExtInfo("subjectKeyIdentifier");if(void 0===r)return;t=a(this.hex,r.vidx),e=r.critical}var i={extname:"subjectKeyIdentifier"};e&&(i.critical=!0);var s=n(t,0);return i.kid={hex:s},i},this.getExtAuthorityKeyIdentifier=function(t,e){if(void 0===t&&void 0===e){var i=this.getExtInfo("authorityKeyIdentifier");if(void 0===i)return;t=a(this.hex,i.vidx),e=i.critical}var s={extname:"authorityKeyIdentifier"};e&&(s.critical=!0);for(var o=r(t,0),u=0;u<o.length;u++){var c=t.substr(o[u],2);if("80"===c&&(s.kid={hex:n(t,o[u])}),"a1"===c){var h=a(t,o[u]),l=this.getGeneralNames(h);s.issuer=l[0].dn}"82"===c&&(s.sn={hex:n(t,o[u])})}return s},this.getExtExtKeyUsage=function(t,e){if(void 0===t&&void 0===e){var i=this.getExtInfo("extKeyUsage");if(void 0===i)return;t=a(this.hex,i.vidx),e=i.critical}var s={extname:"extKeyUsage",array:[]};e&&(s.critical=!0);for(var o=r(t,0),u=0;u<o.length;u++)s.array.push(d(n(t,o[u])));return s},this.getExtExtKeyUsageName=function(){var t=this.getExtInfo("extKeyUsage");if(void 0===t)return t;var e=new Array,i=a(this.hex,t.vidx);if(""===i)return e;for(var s=r(i,0),o=0;o<s.length;o++)e.push(d(n(i,s[o])));return e},this.getExtSubjectAltName=function(t,e){if(void 0===t&&void 0===e){var r=this.getExtInfo("subjectAltName");if(void 0===r)return;t=a(this.hex,r.vidx),e=r.critical}var n={extname:"subjectAltName",array:[]};return e&&(n.critical=!0),n.array=this.getGeneralNames(t),n},this.getExtIssuerAltName=function(t,e){if(void 0===t&&void 0===e){var r=this.getExtInfo("issuerAltName");if(void 0===r)return;t=a(this.hex,r.vidx),e=r.critical}var n={extname:"issuerAltName",array:[]};return e&&(n.critical=!0),n.array=this.getGeneralNames(t),n},this.getGeneralNames=function(t){for(var e=r(t,0),n=[],i=0;i<e.length;i++){var s=this.getGeneralName(a(t,e[i]));void 0!==s&&n.push(s)}return n},this.getGeneralName=function(t){var e=t.substr(0,2),r=n(t,0),i=fe(r);return"81"==e?{rfc822:i}:"82"==e?{dns:i}:"86"==e?{uri:i}:"87"==e?{ip:Se(r)}:"a4"==e?{dn:this.getX500Name(r)}:"a0"==e?{other:this.getOtherName(t)}:void 0},this.getExtSubjectAltName2=function(){var t,e,i,s=this.getExtInfo("subjectAltName");if(void 0===s)return s;for(var o=new Array,u=a(this.hex,s.vidx),c=r(u,0),h=0;h<c.length;h++)i=u.substr(c[h],2),t=n(u,c[h]),"81"===i&&(e=he(t),o.push(["MAIL",e])),"82"===i&&(e=he(t),o.push(["DNS",e])),"84"===i&&(e=Me.hex2dn(t,0),o.push(["DN",e])),"86"===i&&(e=he(t),o.push(["URI",e])),"87"===i&&(e=Se(t),o.push(["IP",e]));return o},this.getExtCRLDistributionPoints=function(t,e){if(void 0===t&&void 0===e){var n=this.getExtInfo("cRLDistributionPoints");if(void 0===n)return;t=a(this.hex,n.vidx),e=n.critical}var i={extname:"cRLDistributionPoints",array:[]};e&&(i.critical=!0);for(var s=r(t,0),o=0;o<s.length;o++){var u=a(t,s[o]);i.array.push(this.getDistributionPoint(u))}return i},this.getDistributionPoint=function(t){for(var e={},n=r(t,0),i=0;i<n.length;i++){var s=t.substr(n[i],2),o=a(t,n[i]);"a0"==s&&(e.dpname=this.getDistributionPointName(o))}return e},this.getDistributionPointName=function(t){for(var e={},n=r(t,0),i=0;i<n.length;i++){var s=t.substr(n[i],2),o=a(t,n[i]);"a0"==s&&(e.full=this.getGeneralNames(o))}return e},this.getExtCRLDistributionPointsURI=function(){var t=this.getExtCRLDistributionPoints();if(null==t)return t;for(var e=t.array,r=[],n=0;n<e.length;n++)try{null!=e[n].dpname.full[0].uri&&r.push(e[n].dpname.full[0].uri)}catch(t){}return r},this.getExtAIAInfo=function(){var t=this.getExtInfo("authorityInfoAccess");if(void 0===t)return t;for(var e={ocsp:[],caissuer:[]},n=r(this.hex,t.vidx),i=0;i<n.length;i++){var s=o(this.hex,n[i],[0],"06"),a=o(this.hex,n[i],[1],"86");"2b06010505073001"===s&&e.ocsp.push(he(a)),"2b06010505073002"===s&&e.caissuer.push(he(a))}return e},this.getExtAuthorityInfoAccess=function(t,e){if(void 0===t&&void 0===e){var n=this.getExtInfo("authorityInfoAccess");if(void 0===n)return;t=a(this.hex,n.vidx),e=n.critical}var i={extname:"authorityInfoAccess",array:[]};e&&(i.critical=!0);for(var s=r(t,0),c=0;c<s.length;c++){var h=u(t,s[c],[0],"06"),l=he(o(t,s[c],[1],"86"));if("2b06010505073001"==h)i.array.push({ocsp:l});else{if("2b06010505073002"!=h)throw new Error("unknown method: "+h);i.array.push({caissuer:l})}}return i},this.getExtCertificatePolicies=function(t,e){if(void 0===t&&void 0===e){var n=this.getExtInfo("certificatePolicies");if(void 0===n)return;t=a(this.hex,n.vidx),e=n.critical}var i={extname:"certificatePolicies",array:[]};e&&(i.critical=!0);for(var s=r(t,0),o=0;o<s.length;o++){var u=a(t,s[o]),c=this.getPolicyInformation(u);i.array.push(c)}return i},this.getPolicyInformation=function(t){var e={},n=o(t,0,[0],"06");e.policyoid=d(n);var i=f(t,0,[1],"30");if(-1!=i){e.array=[];for(var s=r(t,i),u=0;u<s.length;u++){var c=a(t,s[u]),h=this.getPolicyQualifierInfo(c);e.array.push(h)}}return e},this.getOtherName=function(t){var e={},n=r(t,0),i=o(t,n[0],[],"06"),a=o(t,n[1],[]);return e.oid=d(i),e.value=s(a),e},this.getPolicyQualifierInfo=function(t){var e={},r=o(t,0,[0],"06");if("2b06010505070201"===r){var n=u(t,0,[1],"16");e.cps=fe(n)}else if("2b06010505070202"===r){var i=c(t,0,[1],"30");e.unotice=this.getUserNotice(i)}return e},this.getUserNotice=function(t){var r=null;try{return r=e.parse(t),this._asn1ToUnotice(r)}catch(t){return}},this._asn1ToUnotice=function(t){try{for(var e={},r=je(t,"seq"),n=0;n<r.length;n++){var i=this._asn1ToNoticeRef(r[n]);null!=i&&(e.noticeref=i);var s=this.asn1ToDisplayText(r[n]);null!=s&&(e.exptext=s)}return Object.keys(e).length>0?e:void 0}catch(t){return}},this._asn1ToNoticeRef=function(t){try{for(var e={},r=je(t,"seq"),n=0;n<r.length;n++){var i=this._asn1ToNoticeNum(r[n]);null!=i&&(e.noticenum=i);var s=this.asn1ToDisplayText(r[n]);null!=s&&(e.org=s)}return Object.keys(e).length>0?e:void 0}catch(t){return}},this._asn1ToNoticeNum=function(t){try{for(var e=je(t,"seq"),r=[],n=0;n<e.length;n++){var i=e[n];r.push(parseInt(je(i,"int.hex"),16))}return r}catch(t){return}},this.getDisplayText=function(t){var e={};return e.type={"0c":"utf8",16:"ia5","1a":"vis","1e":"bmp"}[t.substr(0,2)],e.str=fe(n(t,0)),e},this.asn1ToDisplayText=function(t){return null!=t.utf8str?{type:"utf8",str:t.utf8str.str}:null!=t.ia5str?{type:"ia5",str:t.ia5str.str}:null!=t.visstr?{type:"vis",str:t.visstr.str}:null!=t.bmpstr?{type:"bmp",str:t.bmpstr.str}:null!=t.prnstr?{type:"prn",str:t.prnstr.str}:void 0},this.getExtPolicyMappings=function(t,e){var r=this.getCriticalExtV("policyMappings",t,e);if(t=r[0],e=r[1],null!=t){var n={extname:"policyMappings"};e&&(n.critical=!0);try{for(var i=s(t).seq,a=[],o=0;o<i.length;o++){var u=i[o].seq;a.push([u[0].oid,u[1].oid])}n.array=a}catch(t){throw new y("malformed policyMappings")}return n}},this.getExtPolicyConstraints=function(t,e){var r=this.getCriticalExtV("policyConstraints",t,e);if(t=r[0],e=r[1],null!=t){var n={extname:"policyConstraints"};e&&(n.critical=!0);var i=s(t);try{for(var a=i.seq,o=0;o<a.length;o++){var u=a[o].tag;0==u.explicit&&("80"==u.tag&&(n.reqexp=parseInt(u.hex,16)),"81"==u.tag&&(n.inhibit=parseInt(u.hex,16)))}}catch(t){return new y("malformed policyConstraints value")}return n}},this.getExtInhibitAnyPolicy=function(t,e){var r=this.getCriticalExtV("inhibitAnyPolicy",t,e);if(t=r[0],e=r[1],null!=t){var n={extname:"inhibitAnyPolicy"};e&&(n.critical=!0);var i=g(t,0);return-1==i?new y("wrong value"):(n.skip=i,n)}},this.getExtCRLNumber=function(t,e){var r={extname:"cRLNumber"};if(e&&(r.critical=!0),"02"==t.substr(0,2))return r.num={hex:n(t,0)},r;throw new y("hExtV parse error: "+t)},this.getExtCRLReason=function(t,e){var r={extname:"cRLReason"};if(e&&(r.critical=!0),"0a"==t.substr(0,2))return r.code=parseInt(n(t,0),16),r;throw new Error("hExtV parse error: "+t)},this.getExtOcspNonce=function(t,e){var r={extname:"ocspNonce"};e&&(r.critical=!0);var i=n(t,0);return r.hex=i,r},this.getExtOcspNoCheck=function(t,e){var r={extname:"ocspNoCheck"};return e&&(r.critical=!0),r},this.getExtAdobeTimeStamp=function(t,e){if(void 0===t&&void 0===e){var n=this.getExtInfo("adobeTimeStamp");if(void 0===n)return;t=a(this.hex,n.vidx),e=n.critical}var i={extname:"adobeTimeStamp"};e&&(i.critical=!0);var s=r(t,0);if(s.length>1){var o=a(t,s[1]),u=this.getGeneralName(o);null!=u.uri&&(i.uri=u.uri)}if(s.length>2){var c=a(t,s[2]);"0101ff"==c&&(i.reqauth=!0),"010100"==c&&(i.reqauth=!1)}return i},this.getExtSubjectDirectoryAttributes=function(t,e){if(void 0===t&&void 0===e){var r=this.getExtInfo("subjectDirectoryAttributes");if(void 0===r)return;t=a(this.hex,r.vidx),e=r.critical}var n={extname:"subjectDirectoryAttributes"};e&&(n.critical=!0);try{for(var i=s(t),o=[],u=0;u<i.seq.length;u++){var c=i.seq[u],h=je(c,"seq.0.oid"),l=je(c,"seq.1.set");if(null==h||null==l)throw"error";o.push({attr:h,array:l})}return n.array=o,n}catch(t){throw new Error("malformed subjectDirectoryAttributes extension value")}};var w=function(t){var e={};try{var r=t.seq[0].oid,n=Qt.asn1.x509.OID.name2oid(r);e.type=Qt.asn1.x509.OID.oid2atype(n);var i=t.seq[1];if(null!=i.utf8str)e.ds="utf8",e.value=i.utf8str.str;else if(null!=i.numstr)e.ds="num",e.value=i.numstr.str;else if(null!=i.telstr)e.ds="tel",e.value=i.telstr.str;else if(null!=i.prnstr)e.ds="prn",e.value=i.prnstr.str;else if(null!=i.ia5str)e.ds="ia5",e.value=i.ia5str.str;else if(null!=i.visstr)e.ds="vis",e.value=i.visstr.str;else{if(null==i.bmpstr)throw"error";e.ds="bmp",e.value=i.bmpstr.str}return e}catch(t){throw new Erorr("improper ASN.1 parsed AttrTypeAndValue")}},x=function(t){try{return t.set.map(function(t){return w(t)})}catch(t){throw new Error("improper ASN.1 parsed RDN: "+t)}};this.getX500NameRule=function(t){for(var e=null,r=[],n=0;n<t.length;n++)for(var i=t[n],s=0;s<i.length;s++)r.push(i[s]);for(n=0;n<r.length;n++){var a=r[n],o=a.ds,u=a.value,c=a.type;if("prn"!=o&&"utf8"!=o&&"ia5"!=o)return"mixed";if("ia5"==o){if("CN"!=c)return"mixed";if(Qt.lang.String.isMail(u))continue;return"mixed"}if("C"==c){if("prn"==o)continue;return"mixed"}if(null==e)e=o;else if(e!==o)return"mixed"}return null==e?"prn":e},this.getAttrTypeAndValue=function(t){var e=s(t);return w(e)},this.getRDN=function(t){var e=s(t);return x(e)},this.getX500NameArray=function(t){return function(t){try{return t.seq.map(function(t){return x(t)})}catch(t){throw new Error("improper ASN.1 parsed X500Name: "+t)}}(s(t))},this.getX500Name=function(t,e,r){var n=this.getX500NameArray(t),i={str:this.dnarraytostr(n)};return i.array=n,1==r&&(i.hex=t),1==e&&(i.canon=this.c14nRDNArray(n)),i},this.readCertPEM=function(t){this.readCertHex(m(t))},this.readCertHex=function(t){this.hex=t,this.getVersion();try{l(this.hex,0,[0,7],"a3"),this.parseExt()}catch(t){}},this.getParam=function(t){var e={};return null==t&&(t={}),e.version=this.getVersion(),e.serial={hex:this.getSerialNumberHex()},e.sigalg=this.getSignatureAlgorithmField(),e.issuer=this.getIssuer(t.dncanon,t.dnhex),e.notbefore=this.getNotBefore(),e.notafter=this.getNotAfter(),e.subject=this.getSubject(t.dncanon,t.dnhex),e.sbjpubkey=ge(this.getPublicKeyHex(),"PUBLIC KEY"),null!=this.aExtInfo&&this.aExtInfo.length>0&&(e.ext=this.getExtParamArray()),e.sighex=this.getSignatureValueHex(),1==t.tbshex&&(e.tbshex=c(this.hex,0,[0])),1==t.nodnarray&&(delete e.issuer.array,delete e.subject.array),e},this.getExtParamArray=function(t){null==t&&(-1!=f(this.hex,0,[0,"[3]"])&&(t=h(this.hex,0,[0,"[3]",0],"30")));for(var e=[],n=r(t,0),i=0;i<n.length;i++){var s=a(t,n[i]),o=this.getExtParam(s);null!=o&&e.push(o)}return e},this.getExtParam=function(t){var e=r(t,0).length;if(2!=e&&3!=e)throw new Error("wrong number elements in Extension: "+e+" "+t);var n=v(o(t,0,[0],"06")),i=!1;3==e&&"0101ff"==c(t,0,[1])&&(i=!0);var a=c(t,0,[e-1,0]),u=void 0;if("2.5.29.14"==n?u=this.getExtSubjectKeyIdentifier(a,i):"2.5.29.15"==n?u=this.getExtKeyUsage(a,i):"2.5.29.17"==n?u=this.getExtSubjectAltName(a,i):"2.5.29.18"==n?u=this.getExtIssuerAltName(a,i):"2.5.29.19"==n?u=this.getExtBasicConstraints(a,i):"2.5.29.30"==n?u=this.getExtNameConstraints(a,i):"2.5.29.31"==n?u=this.getExtCRLDistributionPoints(a,i):"2.5.29.32"==n?u=this.getExtCertificatePolicies(a,i):"2.5.29.33"==n?u=this.getExtPolicyMappings(a,i):"2.5.29.35"==n?u=this.getExtAuthorityKeyIdentifier(a,i):"2.5.29.36"==n?u=this.getExtPolicyConstraints(a,i):"2.5.29.37"==n?u=this.getExtExtKeyUsage(a,i):"2.5.29.54"==n?u=this.getExtInhibitAnyPolicy(a,i):"1.3.6.1.5.5.7.1.1"==n?u=this.getExtAuthorityInfoAccess(a,i):"2.5.29.20"==n?u=this.getExtCRLNumber(a,i):"2.5.29.21"==n?u=this.getExtCRLReason(a,i):"2.5.29.9"==n?u=this.getExtSubjectDirectoryAttributes(a,i):"1.3.6.1.5.5.7.48.1.2"==n?u=this.getExtOcspNonce(a,i):"1.3.6.1.5.5.7.48.1.5"==n?u=this.getExtOcspNoCheck(a,i):"1.2.840.113583.1.1.9.1"==n?u=this.getExtAdobeTimeStamp(a,i):null!=Me.EXT_PARSER[n]&&(u=Me.EXT_PARSER[n](n,i,a)),null!=u)return u;var h={extname:n,extn:a};try{h.extn=s(a)}catch(t){}return i&&(h.critical=!0),h},this.findExt=function(t,e){for(var r=0;r<t.length;r++)if(t[r].extname==e)return t[r];return null},this.updateExtCDPFullURI=function(t,e){var r=this.findExt(t,"cRLDistributionPoints");if(null!=r&&null!=r.array)for(var n=r.array,i=0;i<n.length;i++)if(null!=n[i].dpname&&null!=n[i].dpname.full)for(var s=n[i].dpname.full,a=0;a<s.length;a++){var o=s[i];null!=o.uri&&(o.uri=e)}},this.updateExtAIAOCSP=function(t,e){var r=this.findExt(t,"authorityInfoAccess");if(null!=r&&null!=r.array)for(var n=r.array,i=0;i<n.length;i++)null!=n[i].ocsp&&(n[i].ocsp=e)},this.updateExtAIACAIssuer=function(t,e){var r=this.findExt(t,"authorityInfoAccess");if(null!=r&&null!=r.array)for(var n=r.array,i=0;i<n.length;i++)null!=n[i].caissuer&&(n[i].caissuer=e)},this.dnarraytostr=function(t){return"/"+t.map(function(t){return function(t){return t.map(function(t){return function(t){return t.type+"="+t.value}(t).replace(/\+/,"\\+")}).join("+")}(t).replace(/\//,"\\/")}).join("/")},this.setCanonicalizedDN=function(t){var e;if(null!=t.str&&null==t.array){var r=new Qt.asn1.x509.X500Name({str:t.str}).tohex();e=this.getX500NameArray(r)}else e=t.array;null==t.canon&&(t.canon=this.c14nRDNArray(e))},this.c14nRDNArray=function(t){for(var e=[],r=0;r<t.length;r++){for(var n=t[r],i=[],s=0;s<n.length;s++){var a=n[s],o=a.value;o=(o=(o=(o=o.replace(/^\s*/,"")).replace(/\s*$/,"")).replace(/\s+/g," ")).toLowerCase(),i.push(a.type.toLowerCase()+"="+o)}e.push(i.join("+"))}return"/"+e.join("/")},this.getInfo=function(){var t,e,r,n=function(t){for(var e="",r=" ",n="\n",i=t.array,s=0;s<i.length;s++){var a=i[s];if(null!=a.dn&&(e+=r+"dn: "+a.dn.str+n),null!=a.ip&&(e+=r+"ip: "+a.ip+n),null!=a.rfc822&&(e+=r+"rfc822: "+a.rfc822+n),null!=a.dns&&(e+=r+"dns: "+a.dns+n),null!=a.uri&&(e+=r+"uri: "+a.uri+n),null!=a.other)e+=r+"other: "+a.other.oid+"="+JSON.stringify(a.other.value).replace(/\"/g,"")+n}return e=e.replace(/\n$/,"")},i=function(t){for(var e="",r=t.array,n=0;n<r.length;n++){var i=r[n];if(e+=" policy oid: "+i.policyoid+"\n",void 0!==i.array)for(var s=0;s<i.array.length;s++){var a=i.array[s];void 0!==a.cps&&(e+=" cps: "+a.cps+"\n")}}return e},s=function(t){for(var e="",r=t.array,n=0;n<r.length;n++){var i=r[n];try{void 0!==i.dpname.full[0].uri&&(e+=" "+i.dpname.full[0].uri+"\n")}catch(t){}try{void 0!==i.dname.full[0].dn.hex&&(e+=" "+Me.hex2dn(i.dpname.full[0].dn.hex)+"\n")}catch(t){}}return e},a=function(t){for(var e="",r=t.array,n=0;n<r.length;n++){var i=r[n];void 0!==i.caissuer&&(e+=" caissuer: "+i.caissuer+"\n"),void 0!==i.ocsp&&(e+=" ocsp: "+i.ocsp+"\n")}return e};if(t="Basic Fields\n",t+=" serial number: "+this.getSerialNumberHex()+"\n",t+=" signature algorithm: "+this.getSignatureAlgorithmField()+"\n",t+=" issuer: "+this.getIssuerString()+"\n",t+=" notBefore: "+this.getNotBefore()+"\n",t+=" notAfter: "+this.getNotAfter()+"\n",t+=" subject: "+this.getSubjectString()+"\n",t+=" subject public key info: \n",t+=" key algorithm: "+(e=this.getPublicKey()).type+"\n","RSA"===e.type&&(t+=" n="+Pe(e.n.toString(16)).substr(0,16)+"...\n",t+=" e="+Pe(e.e.toString(16))+"\n"),null!=(r=this.aExtInfo)){t+="X509v3 Extensions:\n";for(var o=0;o<r.length;o++){var u=r[o],c=Qt.asn1.x509.OID.oid2name(u.oid);""===c&&(c=u.oid);var h="";if(!0===u.critical&&(h="CRITICAL"),t+=" "+c+" "+h+":\n","basicConstraints"===c){var l=this.getExtBasicConstraints();void 0===l.cA?t+=" {}\n":(t+=" cA=true",void 0!==l.pathLen&&(t+=", pathLen="+l.pathLen),t+="\n")}else{var f;if("policyMappings"==c)t+=" "+this.getExtPolicyMappings().array.map(function(t){var e=t;return e[0]+":"+e[1]}).join(", ")+"\n";else if("policyConstraints"==c)t+=" ",null!=(f=this.getExtPolicyConstraints()).reqexp&&(t+=" reqexp="+f.reqexp),null!=f.inhibit&&(t+=" inhibit="+f.inhibit),t+="\n";else if("inhibitAnyPolicy"==c)t+=" skip="+(f=this.getExtInhibitAnyPolicy()).skip+"\n";else if("keyUsage"==c)t+=" "+this.getExtKeyUsageString()+"\n";else if("subjectKeyIdentifier"==c)t+=" "+this.getExtSubjectKeyIdentifier().kid.hex+"\n";else if("authorityKeyIdentifier"==c){var p=this.getExtAuthorityKeyIdentifier();void 0!==p.kid&&(t+=" kid="+p.kid.hex+"\n")}else{if("extKeyUsage"==c)t+=" "+this.getExtExtKeyUsage().array.join(", ")+"\n";else if("subjectAltName"==c)t+=n(this.getExtSubjectAltName())+"\n";else if("cRLDistributionPoints"==c)t+=s(this.getExtCRLDistributionPoints());else if("authorityInfoAccess"==c)t+=a(this.getExtAuthorityInfoAccess());else"certificatePolicies"==c&&(t+=i(this.getExtCertificatePolicies()))}}}}return t+="signature algorithm: "+this.getSignatureAlgorithmName()+"\n",t+="signature: "+this.getSignatureValueHex().substr(0,16)+"...\n"},"string"==typeof t&&(-1!=t.indexOf("-----BEGIN")?this.readCertPEM(t):Qt.lang.String.isHex(t)&&this.readCertHex(t))}ke.getKey=function(t,e,r){var n=(v=re).getChildIdx;v.getV;var i=v.getVbyList,s=Qt.crypto,a=s.ECDSA,o=s.DSA,u=$t,c=de,h=ke;if(void 0!==u&&t instanceof u)return t;if(void 0!==a&&t instanceof a)return t;if(void 0!==o&&t instanceof o)return t;if(void 0!==t.curve&&void 0!==t.xy&&void 0===t.d)return new a({pub:t.xy,curve:t.curve});if(void 0!==t.curve&&void 0!==t.d)return new a({prv:t.d,curve:t.curve});if(void 0===t.kty&&void 0!==t.n&&void 0!==t.e&&void 0===t.d)return(C=new u).setPublic(t.n,t.e),C;if(void 0===t.kty&&void 0!==t.n&&void 0!==t.e&&void 0!==t.d&&void 0!==t.p&&void 0!==t.q&&void 0!==t.dp&&void 0!==t.dq&&void 0!==t.co&&void 0===t.qi)return(C=new u).setPrivateEx(t.n,t.e,t.d,t.p,t.q,t.dp,t.dq,t.co),C;if(void 0===t.kty&&void 0!==t.n&&void 0!==t.e&&void 0!==t.d&&void 0===t.p)return(C=new u).setPrivate(t.n,t.e,t.d),C;if(void 0!==t.p&&void 0!==t.q&&void 0!==t.g&&void 0!==t.y&&void 0===t.x)return(C=new o).setPublic(t.p,t.q,t.g,t.y),C;if(void 0!==t.p&&void 0!==t.q&&void 0!==t.g&&void 0!==t.y&&void 0!==t.x)return(C=new o).setPrivate(t.p,t.q,t.g,t.y,t.x),C;if("RSA"===t.kty&&void 0!==t.n&&void 0!==t.e&&void 0===t.d)return(C=new u).setPublic(ue(t.n),ue(t.e)),C;if("RSA"===t.kty&&void 0!==t.n&&void 0!==t.e&&void 0!==t.d&&void 0!==t.p&&void 0!==t.q&&void 0!==t.dp&&void 0!==t.dq&&void 0!==t.qi)return(C=new u).setPrivateEx(ue(t.n),ue(t.e),ue(t.d),ue(t.p),ue(t.q),ue(t.dp),ue(t.dq),ue(t.qi)),C;if("RSA"===t.kty&&void 0!==t.n&&void 0!==t.e&&void 0!==t.d)return(C=new u).setPrivate(ue(t.n),ue(t.e),ue(t.d)),C;if("EC"===t.kty&&void 0!==t.crv&&void 0!==t.x&&void 0!==t.y&&void 0===t.d){var l=(D=new a({curve:t.crv})).ecparams.keycharlen,f="04"+("0000000000"+ue(t.x)).slice(-l)+("0000000000"+ue(t.y)).slice(-l);return D.setPublicKeyHex(f),D}if("EC"===t.kty&&void 0!==t.crv&&void 0!==t.x&&void 0!==t.y&&void 0!==t.d){l=(D=new a({curve:t.crv})).ecparams.keycharlen,f="04"+("0000000000"+ue(t.x)).slice(-l)+("0000000000"+ue(t.y)).slice(-l);var p=("0000000000"+ue(t.d)).slice(-l);return D.setPublicKeyHex(f),D.setPrivateKeyHex(p),D}if("pkcs5prv"===r){var g,d=t,v=re;if(9===(g=n(d,0)).length)(C=new u).readPKCS5PrvKeyHex(d);else if(6===g.length)(C=new o).readPKCS5PrvKeyHex(d);else{if(!(g.length>2&&"04"===d.substr(g[1],2)))throw new Error("unsupported PKCS#1/5 hexadecimal key");(C=new a).readPKCS5PrvKeyHex(d)}return C}if("pkcs8prv"===r)return C=h.getKeyFromPlainPrivatePKCS8Hex(t);if("pkcs8pub"===r)return h._getKeyFromPublicPKCS8Hex(t);if("x509pub"===r)return Me.getPublicKeyFromCertHex(t);if(-1!=t.indexOf("-END CERTIFICATE-",0)||-1!=t.indexOf("-END X509 CERTIFICATE-",0)||-1!=t.indexOf("-END TRUSTED CERTIFICATE-",0))return Me.getPublicKeyFromCertPEM(t);if(-1!=t.indexOf("-END PUBLIC KEY-")){var m=de(t,"PUBLIC KEY");return h._getKeyFromPublicPKCS8Hex(m)}if(-1!=t.indexOf("-END RSA PRIVATE KEY-")&&-1==t.indexOf("4,ENCRYPTED")){var y=c(t,"RSA PRIVATE KEY");return h.getKey(y,null,"pkcs5prv")}if(-1!=t.indexOf("-END DSA PRIVATE KEY-")&&-1==t.indexOf("4,ENCRYPTED")){var w=i(R=c(t,"DSA PRIVATE KEY"),0,[1],"02"),x=i(R,0,[2],"02"),S=i(R,0,[3],"02"),E=i(R,0,[4],"02"),b=i(R,0,[5],"02");return(C=new o).setPrivate(new lt(w,16),new lt(x,16),new lt(S,16),new lt(E,16),new lt(b,16)),C}if(-1!=t.indexOf("-END EC PRIVATE KEY-")&&-1==t.indexOf("4,ENCRYPTED")){y=c(t,"EC PRIVATE KEY");return h.getKey(y,null,"pkcs5prv")}if(-1!=t.indexOf("-END PRIVATE KEY-"))return h.getKeyFromPlainPrivatePKCS8PEM(t);if(-1!=t.indexOf("-END RSA PRIVATE KEY-")&&-1!=t.indexOf("4,ENCRYPTED")){var F=h.getDecryptedKeyHex(t,e),A=new $t;return A.readPKCS5PrvKeyHex(F),A}if(-1!=t.indexOf("-END EC PRIVATE KEY-")&&-1!=t.indexOf("4,ENCRYPTED")){var D,C=i(R=h.getDecryptedKeyHex(t,e),0,[1],"04"),I=i(R,0,[2,0],"06"),P=i(R,0,[3,0],"03").substr(2);if(void 0===Qt.crypto.OID.oidhex2name[I])throw new Error("undefined OID(hex) in KJUR.crypto.OID: "+I);return(D=new a({curve:Qt.crypto.OID.oidhex2name[I]})).setPublicKeyHex(P),D.setPrivateKeyHex(C),D.isPublic=!1,D}if(-1!=t.indexOf("-END DSA PRIVATE KEY-")&&-1!=t.indexOf("4,ENCRYPTED")){var R;w=i(R=h.getDecryptedKeyHex(t,e),0,[1],"02"),x=i(R,0,[2],"02"),S=i(R,0,[3],"02"),E=i(R,0,[4],"02"),b=i(R,0,[5],"02");return(C=new o).setPrivate(new lt(w,16),new lt(x,16),new lt(S,16),new lt(E,16),new lt(b,16)),C}if(-1!=t.indexOf("-END ENCRYPTED PRIVATE KEY-"))return h.getKeyFromEncryptedPKCS8PEM(t,e);throw new Error("not supported argument")},ke.generateKeypair=function(t,e){if("RSA"==t){var r=e;(a=new $t).generate(r,"10001"),a.isPrivate=!0,a.isPublic=!0;var n=new $t,i=a.n.toString(16),s=a.e.toString(16);return n.setPublic(i,s),n.isPrivate=!1,n.isPublic=!0,(o={}).prvKeyObj=a,o.pubKeyObj=n,o}if("EC"==t){var a,o,u=e,c=new Qt.crypto.ECDSA({curve:u}).generateKeyPairHex();return(a=new Qt.crypto.ECDSA({curve:u})).setPublicKeyHex(c.ecpubhex),a.setPrivateKeyHex(c.ecprvhex),a.isPrivate=!0,a.isPublic=!1,(n=new Qt.crypto.ECDSA({curve:u})).setPublicKeyHex(c.ecpubhex),n.isPrivate=!1,n.isPublic=!0,(o={}).prvKeyObj=a,o.pubKeyObj=n,o}throw new Error("unknown algorithm: "+t)},ke.getPEM=function(t,e,r,n,i,s){var a=Qt,o=a.asn1,u=o.DERObjectIdentifier,c=o.DERInteger,h=o.ASN1Util.newObject,l=o.x509.SubjectPublicKeyInfo,f=a.crypto,p=f.DSA,g=f.ECDSA,d=$t;function v(t){return h({seq:[{int:0},{int:{bigint:t.n}},{int:t.e},{int:{bigint:t.d}},{int:{bigint:t.p}},{int:{bigint:t.q}},{int:{bigint:t.dmp1}},{int:{bigint:t.dmq1}},{int:{bigint:t.coeff}}]})}function m(t){return h({seq:[{int:1},{octstr:{hex:t.prvKeyHex}},{tag:["a0",!0,{oid:{name:t.curveName}}]},{tag:["a1",!0,{bitstr:{hex:"00"+t.pubKeyHex}}]}]})}function y(t){return h({seq:[{int:0},{int:{bigint:t.p}},{int:{bigint:t.q}},{int:{bigint:t.g}},{int:{bigint:t.y}},{int:{bigint:t.x}}]})}if((void 0!==d&&t instanceof d||void 0!==p&&t instanceof p||void 0!==g&&t instanceof g)&&1==t.isPublic&&(void 0===e||"PKCS8PUB"==e))return ge(E=new l(t).tohex(),"PUBLIC KEY");if("PKCS1PRV"==e&&void 0!==d&&t instanceof d&&(void 0===r||null==r)&&1==t.isPrivate)return ge(E=v(t).tohex(),"RSA PRIVATE KEY");if("PKCS1PRV"==e&&void 0!==g&&t instanceof g&&(void 0===r||null==r)&&1==t.isPrivate){var w=new u({name:t.curveName}).tohex(),x=m(t).tohex(),S="";return S+=ge(w,"EC PARAMETERS"),S+=ge(x,"EC PRIVATE KEY")}if("PKCS1PRV"==e&&void 0!==p&&t instanceof p&&(void 0===r||null==r)&&1==t.isPrivate)return ge(E=y(t).tohex(),"DSA PRIVATE KEY");if("PKCS5PRV"==e&&void 0!==d&&t instanceof d&&void 0!==r&&null!=r&&1==t.isPrivate){var E=v(t).tohex();return void 0===n&&(n="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("RSA",E,r,n,s)}if("PKCS5PRV"==e&&void 0!==g&&t instanceof g&&void 0!==r&&null!=r&&1==t.isPrivate){E=m(t).tohex();return void 0===n&&(n="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("EC",E,r,n,s)}if("PKCS5PRV"==e&&void 0!==p&&t instanceof p&&void 0!==r&&null!=r&&1==t.isPrivate){E=y(t).tohex();return void 0===n&&(n="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("DSA",E,r,n,s)}var b=function(t,e){if("string"==typeof e)return ke.getEncryptedPKCS8PEM(t,e);if("object"==typeof e&&null!=je(e,"passcode")){var r=JSON.parse(JSON.stringify(e)),n=r.passcode;return delete r.passcode,ke.getEncryptedPKCS8PEM(t,n,r)}};if("PKCS8PRV"==e&&null!=d&&t instanceof d&&1==t.isPrivate){var F=v(t).tohex();E=h({seq:[{int:0},{seq:[{oid:{name:"rsaEncryption"}},{null:!0}]},{octstr:{hex:F}}]}).tohex();return void 0===r||null==r?ge(E,"PRIVATE KEY"):b(E,r)}if("PKCS8PRV"==e&&void 0!==g&&t instanceof g&&1==t.isPrivate){var A={seq:[{int:1},{octstr:{hex:t.prvKeyHex}}]};"string"==typeof t.pubKeyHex&&A.seq.push({tag:["a1",!0,{bitstr:{hex:"00"+t.pubKeyHex}}]});F=new h(A).tohex(),E=h({seq:[{int:0},{seq:[{oid:{name:"ecPublicKey"}},{oid:{name:t.curveName}}]},{octstr:{hex:F}}]}).tohex();return void 0===r||null==r?ge(E,"PRIVATE KEY"):b(E,r)}if("PKCS8PRV"==e&&void 0!==p&&t instanceof p&&1==t.isPrivate){F=new c({bigint:t.x}).tohex(),E=h({seq:[{int:0},{seq:[{oid:{name:"dsa"}},{seq:[{int:{bigint:t.p}},{int:{bigint:t.q}},{int:{bigint:t.g}}]}]},{octstr:{hex:F}}]}).tohex();return void 0===r||null==r?ge(E,"PRIVATE KEY"):b(E,r)}throw new Error("unsupported object nor format")},ke.getKeyFromCSRPEM=function(t){var e=de(t,"CERTIFICATE REQUEST");return ke.getKeyFromCSRHex(e)},ke.getKeyFromCSRHex=function(t){var e=ke.parseCSRHex(t);return ke.getKey(e.p8pubkeyhex,null,"pkcs8pub")},ke.parseCSRHex=function(t){var e=re,r=e.getChildIdx,n=e.getTLV,i={},s=t;if("30"!=s.substr(0,2))throw new Error("malformed CSR(code:001)");var a=r(s,0);if(a.length<1)throw new Error("malformed CSR(code:002)");if("30"!=s.substr(a[0],2))throw new Error("malformed CSR(code:003)");var o=r(s,a[0]);if(o.length<3)throw new Error("malformed CSR(code:004)");return i.p8pubkeyhex=n(s,o[2]),i},ke.getKeyID=function(t){var e=ke,r=re;"string"==typeof t&&-1!=t.indexOf("BEGIN ")&&(t=e.getKey(t));var n=de(e.getPEM(t)),i=r.getIdxbyList(n,0,[1]),s=r.getV(n,i).substring(2);return Qt.crypto.Util.hashHex(s,"sha1")},ke.getJWK=function(t,e,r,n,i){var s,a,o={},u=Qt.crypto.Util.hashHex;if("string"==typeof t)s=ke.getKey(t),-1!=t.indexOf("CERTIFICATE")&&(a=de(t));else{if("object"!=typeof t)throw new Error("unsupported keyinfo type");t instanceof Me?(s=t.getPublicKey(),a=t.hex):s=t}if(s instanceof $t&&s.isPrivate)o.kty="RSA",o.n=oe(s.n.toString(16)),o.e=oe(s.e.toString(16)),o.d=oe(s.d.toString(16)),o.p=oe(s.p.toString(16)),o.q=oe(s.q.toString(16)),o.dp=oe(s.dmp1.toString(16)),o.dq=oe(s.dmq1.toString(16)),o.qi=oe(s.coeff.toString(16));else if(s instanceof $t&&s.isPublic)o.kty="RSA",o.n=oe(s.n.toString(16)),o.e=oe(s.e.toString(16));else if(s instanceof Qt.crypto.ECDSA&&s.isPrivate){if("P-256"!==(h=s.getShortNISTPCurveName())&&"P-384"!==h&&"P-521"!==h)throw new Error("unsupported curve name for JWT: "+h);var c=s.getPublicKeyXYHex();o.kty="EC",o.crv=h,o.x=oe(c.x),o.y=oe(c.y),o.d=oe(s.prvKeyHex)}else if(s instanceof Qt.crypto.ECDSA&&s.isPublic){var h;if("P-256"!==(h=s.getShortNISTPCurveName())&&"P-384"!==h&&"P-521"!==h)throw new Error("unsupported curve name for JWT: "+h);c=s.getPublicKeyXYHex();o.kty="EC",o.crv=h,o.x=oe(c.x),o.y=oe(c.y)}if(null==o.kty)throw new Error("unsupported keyinfo");return s.isPrivate||1==e||(o.kid=Qt.jws.JWS.getJWKthumbprint(o)),null!=a&&1!=r&&(o.x5c=[ct(a)]),null!=a&&1!=n&&(o.x5t=se(ct(u(a,"sha1")))),null!=a&&1!=i&&(o["x5t#S256"]=se(ct(u(a,"sha256")))),o},ke.getJWKFromKey=function(t){return ke.getJWK(t,!0,!0,!0,!0)},$t.getPosArrayOfChildrenFromHex=function(t){return re.getChildIdx(t,0)},$t.getHexValueArrayOfChildrenFromHex=function(t){var e,r=re.getV,n=r(t,(e=$t.getPosArrayOfChildrenFromHex(t))[0]),i=r(t,e[1]),s=r(t,e[2]),a=r(t,e[3]),o=r(t,e[4]),u=r(t,e[5]),c=r(t,e[6]),h=r(t,e[7]),l=r(t,e[8]);return(e=new Array).push(n,i,s,a,o,u,c,h,l),e},$t.prototype.readPrivateKeyFromPEMString=function(t){var e=de(t),r=$t.getHexValueArrayOfChildrenFromHex(e);this.setPrivateEx(r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8])},$t.prototype.readPKCS5PrvKeyHex=function(t){var e=$t.getHexValueArrayOfChildrenFromHex(t);this.setPrivateEx(e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},$t.prototype.readPKCS8PrvKeyHex=function(t){var e,r,n,i,s,a,o,u,c=re,h=c.getVbyListEx;if(!1===c.isASN1HEX(t))throw new Error("not ASN.1 hex string");try{e=h(t,0,[2,0,1],"02"),r=h(t,0,[2,0,2],"02"),n=h(t,0,[2,0,3],"02"),i=h(t,0,[2,0,4],"02"),s=h(t,0,[2,0,5],"02"),a=h(t,0,[2,0,6],"02"),o=h(t,0,[2,0,7],"02"),u=h(t,0,[2,0,8],"02")}catch(t){throw new Error("malformed PKCS#8 plain RSA private key")}this.setPrivateEx(e,r,n,i,s,a,o,u)},$t.prototype.readPKCS5PubKeyHex=function(t){var e=re,r=e.getV;if(!1===e.isASN1HEX(t))throw new Error("keyHex is not ASN.1 hex string");var n=e.getChildIdx(t,0);if(2!==n.length||"02"!==t.substr(n[0],2)||"02"!==t.substr(n[1],2))throw new Error("wrong hex for PKCS#5 public key");var i=r(t,n[0]),s=r(t,n[1]);this.setPublic(i,s)},$t.prototype.readPKCS8PubKeyHex=function(t){var e=re;if(!1===e.isASN1HEX(t))throw new Error("not ASN.1 hex string");if("06092a864886f70d010101"!==e.getTLVbyListEx(t,0,[0,0]))throw new Error("not PKCS8 RSA public key");var r=e.getTLVbyListEx(t,0,[1,0]);this.readPKCS5PubKeyHex(r)},$t.prototype.readCertPubKeyHex=function(t,e){var r,n;(r=new Me).readCertHex(t),n=r.getPublicKeyHex(),this.readPKCS8PubKeyHex(n)},$t.prototype.sign=function(t,e){var r=function(t){return Qt.crypto.Util.hashString(t,e)}(t);return this.signWithMessageHash(r,e)},$t.prototype.signWithMessageHash=function(t,e){var r=Gt(Qt.crypto.Util.getPaddedDigestInfoHex(t,e,this.n.bitLength()),16);return Le(this.doPrivate(r).toString(16),this.n.bitLength())},$t.prototype.signPSS=function(t,e,r){var n=function(t){return Qt.crypto.Util.hashHex(t,e)}(pe(t));return void 0===r&&(r=-1),this.signWithMessageHashPSS(n,e,r)},$t.prototype.signWithMessageHashPSS=function(t,e,r){var n,i=fe(t),s=i.length,a=this.n.bitLength()-1,o=Math.ceil(a/8),u=function(t){return Qt.crypto.Util.hashHex(t,e)};if(-1===r||void 0===r)r=s;else if(-2===r)r=o-s-2;else if(r<-2)throw new Error("invalid salt length");if(o<s+r+2)throw new Error("data too long");var c="";r>0&&(c=new Array(r),(new Wt).nextBytes(c),c=String.fromCharCode.apply(String,c));var h=fe(u(pe("\0\0\0\0\0\0\0\0"+i+c))),l=[];for(n=0;n<o-r-s-2;n+=1)l[n]=0;var f=String.fromCharCode.apply(String,l)+""+c,p=Ve(h,f.length,u),g=[];for(n=0;n<f.length;n+=1)g[n]=f.charCodeAt(n)^p.charCodeAt(n);var d=65280>>8*o-a&255;for(g[0]&=~d,n=0;n<s;n++)g.push(h.charCodeAt(n));return g.push(188),Le(this.doPrivate(new lt(g)).toString(16),this.n.bitLength())},$t.prototype.verify=function(t,e){if(null==(e=e.toLowerCase()).match(/^[0-9a-f]+$/))return!1;var r=Gt(e,16),n=this.n.bitLength();if(r.bitLength()>n)return!1;var i=this.doPublic(r).toString(16);if(i.length+3!=n/4)return!1;var s=qe(i.replace(/^1f+00/,""));if(0==s.length)return!1;var a=s[0],o=s[1],u=function(t){return Qt.crypto.Util.hashString(t,a)}(t);return o==u},$t.prototype.verifyWithMessageHash=function(t,e){if(e.length!=Math.ceil(this.n.bitLength()/4))return!1;var r=Gt(e,16);if(r.bitLength()>this.n.bitLength())return 0;var n=qe(this.doPublic(r).toString(16).replace(/^1f+00/,""));return 0!=n.length&&(n[0],n[1]==t)},$t.prototype.verifyPSS=function(t,e,r,n){var i,s=(i=pe(t),Qt.crypto.Util.hashHex(i,r));return void 0===n&&(n=-1),this.verifyWithMessageHashPSS(s,e,r,n)},$t.prototype.verifyWithMessageHashPSS=function(t,e,r,n){if(e.length!=Math.ceil(this.n.bitLength()/4))return!1;var i,s=new lt(e,16),a=function(t){return Qt.crypto.Util.hashHex(t,r)},o=fe(t),u=o.length,c=this.n.bitLength()-1,h=Math.ceil(c/8);if(-1===n||void 0===n)n=u;else if(-2===n)n=h-u-2;else if(n<-2)throw new Error("invalid salt length");if(h<u+n+2)throw new Error("data too long");var l=this.doPublic(s).toByteArray();for(i=0;i<l.length;i+=1)l[i]&=255;for(;l.length<h;)l.unshift(0);if(188!==l[h-1])throw new Error("encoded message does not end in 0xbc");var f=(l=String.fromCharCode.apply(String,l)).substr(0,h-u-1),p=l.substr(f.length,u),g=65280>>8*h-c&255;if(0!==(f.charCodeAt(0)&g))throw new Error("bits beyond keysize not zero");var d=Ve(p,f.length,a),v=[];for(i=0;i<f.length;i+=1)v[i]=f.charCodeAt(i)^d.charCodeAt(i);v[0]&=~g;var m=h-u-n-2;for(i=0;i<m;i+=1)if(0!==v[i])throw new Error("leftmost octets not zero");if(1!==v[m])throw new Error("0x01 marker not found");return p===fe(a(pe("\0\0\0\0\0\0\0\0"+o+String.fromCharCode.apply(String,v.slice(-n)))))},$t.SALT_LEN_HLEN=-1,$t.SALT_LEN_MAX=-2,$t.SALT_LEN_RECOVER=-2,Me.EXT_PARSER={},Me.registExtParser=function(t,e){Me.EXT_PARSER[t]=e},Me.hex2dn=function(t,e){void 0===e&&(e=0);var r=new Me;return re.getTLV(t,e),r.getX500Name(t).str},Me.hex2rdn=function(t,e){if(void 0===e&&(e=0),"31"!==t.substr(e,2))throw new Error("malformed RDN");for(var r=new Array,n=re.getChildIdx(t,e),i=0;i<n.length;i++)r.push(Me.hex2attrTypeValue(t,n[i]));return r=r.map(function(t){return t.replace("+","\\+")}),r.join("+")},Me.hex2attrTypeValue=function(t,e){var r=re,n=r.getV;if(void 0===e&&(e=0),"30"!==t.substr(e,2))throw new Error("malformed attribute type and value");var i=r.getChildIdx(t,e);2!==i.length||t.substr(i[0],2);var s=n(t,i[0]),a=Qt.asn1.ASN1Util.oidHexToInt(s);return Qt.asn1.x509.OID.oid2atype(a)+"="+fe(n(t,i[1]))},Me.getPublicKeyFromCertHex=function(t){var e=new Me;return e.readCertHex(t),e.getPublicKey()},Me.getPublicKeyFromCertPEM=function(t){var e=new Me;return e.readCertPEM(t),e.getPublicKey()},Me.getPublicKeyInfoPropOfCertPEM=function(t){var e,r,n=re.getVbyList,i={};return i.algparam=null,(e=new Me).readCertPEM(t),r=e.getPublicKeyHex(),i.keyhex=n(r,0,[1],"03").substr(2),i.algoid=n(r,0,[0,0],"06"),"2a8648ce3d0201"===i.algoid&&(i.algparam=n(r,0,[0,1],"06")),i},Me.KEYUSAGE_NAME=["digitalSignature","nonRepudiation","keyEncipherment","dataEncipherment","keyAgreement","keyCertSign","cRLSign","encipherOnly","decipherOnly"],void 0!==Qt&&Qt||(Qt={}),void 0!==Qt.jws&&Qt.jws||(Qt.jws={}),Qt.jws.JWS=function(){var t=Qt.jws.JWS.isSafeJSONString;this.parseJWS=function(e,r){if(void 0===this.parsedJWS||!r&&void 0===this.parsedJWS.sigvalH){var n=e.match(/^([^.]+)\.([^.]+)\.([^.]+)$/);if(null==n)throw"JWS signature is not a form of 'Head.Payload.SigValue'.";var i=n[1],s=n[2],a=n[3],o=i+"."+s;if(this.parsedJWS={},this.parsedJWS.headB64U=i,this.parsedJWS.payloadB64U=s,this.parsedJWS.sigvalB64U=a,this.parsedJWS.si=o,!r){var u=ue(a),c=Gt(u,16);this.parsedJWS.sigvalH=u,this.parsedJWS.sigvalBI=c}var h=ee(i),l=ee(s);if(this.parsedJWS.headS=h,this.parsedJWS.payloadS=l,!t(h,this.parsedJWS,"headP"))throw"malformed JSON string for JWS Head: "+h}}},Qt.jws.JWS.sign=function(t,e,r,n,i){var s=Qt,a=s.jws.JWS,o=a.readSafeJSONString,u=a.isSafeJSONString,c=s.crypto;c.ECDSA;var h,l,f,p=c.Mac,g=c.Signature,d=JSON;if("string"!=typeof e&&"object"!=typeof e)throw"spHeader must be JSON string or object: "+e;if("object"==typeof e&&(l=e,h=d.stringify(l)),"string"==typeof e){if(!u(h=e))throw"JWS Head is not safe JSON string: "+h;l=o(h)}if(f=r,"object"==typeof r&&(f=d.stringify(r)),""!=t&&null!=t||void 0===l.alg||(t=l.alg),""!=t&&null!=t&&void 0===l.alg&&(l.alg=t,h=d.stringify(l)),t!==l.alg)throw"alg and sHeader.alg doesn't match: "+t+"!="+l.alg;var v=null;if(void 0===a.jwsalg2sigalg[t])throw"unsupported alg name: "+t;v=a.jwsalg2sigalg[t];var m=te(h)+"."+te(f),y="";if("Hmac"==v.substr(0,4)){if(void 0===n)throw"mac key shall be specified for HS* alg";var w=new p({alg:v,prov:"cryptojs",pass:n});w.updateString(m),y=w.doFinal()}else if(-1!=v.indexOf("withECDSA")){(S=new g({alg:v})).init(n,i),S.updateString(m);var x=S.sign();y=Qt.crypto.ECDSA.asn1SigToConcatSig(x)}else{var S;if("none"!=v)(S=new g({alg:v})).init(n,i),S.updateString(m),y=S.sign()}return m+"."+oe(y)},Qt.jws.JWS.verify=function(t,e,r){var n,i=Qt,s=i.jws.JWS,a=s.readSafeJSONString,o=i.crypto,u=o.ECDSA,c=o.Mac,h=o.Signature;if(n=$t,!Ie(t))return!1;var l=t.split(".");if(3!==l.length)return!1;var f=l[0]+"."+l[1],p=ue(l[2]),g=a(ee(l[0])),d=null,v=null;if(void 0===g.alg)throw"algorithm not specified in header";if((v=(d=g.alg).substr(0,2),null!=r&&"[object Array]"===Object.prototype.toString.call(r)&&r.length>0)&&-1==(":"+r.join(":")+":").indexOf(":"+d+":"))throw"algorithm '"+d+"' not accepted in the list";if("none"!=d&&null===e)throw"key shall be specified to verify.";if("string"==typeof e&&-1!=e.indexOf("-----BEGIN ")&&(e=ke.getKey(e)),!("RS"!=v&&"PS"!=v||e instanceof n))throw"key shall be a RSAKey obj for RS* and PS* algs";if("ES"==v&&!(e instanceof u))throw"key shall be a ECDSA obj for ES* algs";var m=null;if(void 0===s.jwsalg2sigalg[g.alg])throw new Error("unsupported alg name: "+d);if(m=s.jwsalg2sigalg[d],void 0!==g.crit){if(!Array.isArray(g.crit)||0===g.crit.length)throw new Error("wrong critical header");for(var y=0;y<g.crit.length;y++){var w=g.crit[y];if("string"!=typeof w||0===w.length)throw new Error("wrong critical header");if(void 0===g[w])throw new Error("critical header '"+w+"' missing")}}if("none"==m)throw new Error("not supported");if("Hmac"==m.substr(0,4)){if(void 0===e)throw new Error("hexadecimal key shall be specified for HMAC");var x=new c({alg:m,pass:e});return x.updateString(f),Re(p,x.doFinal())}if(-1!=m.indexOf("withECDSA")){var S,E=null;try{E=u.concatSigToASN1Sig(p)}catch(t){return!1}return(S=new h({alg:m})).init(e),S.updateString(f),S.verify(E)}return(S=new h({alg:m})).init(e),S.updateString(f),S.verify(p)},Qt.jws.JWS.parse=function(t){var e,r,n,i=t.split("."),s={};if(2!=i.length&&3!=i.length)throw"malformed sJWS: wrong number of '.' splitted elements";return e=i[0],r=i[1],3==i.length&&(n=i[2]),s.headerObj=Qt.jws.JWS.readSafeJSONString(ee(e)),s.payloadObj=Qt.jws.JWS.readSafeJSONString(ee(r)),s.headerPP=JSON.stringify(s.headerObj,null," "),null==s.payloadObj?s.payloadPP=ee(r):s.payloadPP=JSON.stringify(s.payloadObj,null," "),void 0!==n&&(s.sigHex=ue(n)),s},Qt.jws.JWS.verifyJWT=function(t,e,r){var n=Qt.jws,i=n.JWS,s=i.readSafeJSONString,a=i.inArray,o=i.includedArray;if(!Ie(t))return!1;var u=t.split(".");if(3!=u.length)return!1;var c=u[0],h=u[1];ue(u[2]);var l=s(ee(c)),f=s(ee(h));if(void 0===l.alg)return!1;if(void 0===r.alg)throw"acceptField.alg shall be specified";if(!a(l.alg,r.alg))return!1;if(void 0!==f.iss&&"object"==typeof r.iss&&!a(f.iss,r.iss))return!1;if(void 0!==f.sub&&"object"==typeof r.sub&&!a(f.sub,r.sub))return!1;if(void 0!==f.aud&&"object"==typeof r.aud)if("string"==typeof f.aud){if(!a(f.aud,r.aud))return!1}else if("object"==typeof f.aud&&!o(f.aud,r.aud))return!1;var p=n.IntDate.getNow();return void 0!==r.verifyAt&&"number"==typeof r.verifyAt&&(p=r.verifyAt),void 0!==r.gracePeriod&&"number"==typeof r.gracePeriod||(r.gracePeriod=0),!(void 0!==f.exp&&"number"==typeof f.exp&&f.exp+r.gracePeriod<p)&&(!(void 0!==f.nbf&&"number"==typeof f.nbf&&p<f.nbf-r.gracePeriod)&&(!(void 0!==f.iat&&"number"==typeof f.iat&&p<f.iat-r.gracePeriod)&&((void 0===f.jti||void 0===r.jti||f.jti===r.jti)&&!!i.verify(t,e,r.alg))))},Qt.jws.JWS.includedArray=function(t,e){var r=Qt.jws.JWS.inArray;if(null===t)return!1;if("object"!=typeof t)return!1;if("number"!=typeof t.length)return!1;for(var n=0;n<t.length;n++)if(!r(t[n],e))return!1;return!0},Qt.jws.JWS.inArray=function(t,e){if(null===e)return!1;if("object"!=typeof e)return!1;if("number"!=typeof e.length)return!1;for(var r=0;r<e.length;r++)if(e[r]==t)return!0;return!1},Qt.jws.JWS.jwsalg2sigalg={HS256:"HmacSHA256",HS384:"HmacSHA384",HS512:"HmacSHA512",RS256:"SHA256withRSA",RS384:"SHA384withRSA",RS512:"SHA512withRSA",ES256:"SHA256withECDSA",ES384:"SHA384withECDSA",ES512:"SHA512withECDSA",PS256:"SHA256withRSAandMGF1",PS384:"SHA384withRSAandMGF1",PS512:"SHA512withRSAandMGF1",none:"none"},Qt.jws.JWS.isSafeJSONString=function(t,e,r){var n=null;try{return"object"!=typeof(n=Zt(t))||n.constructor===Array?0:(e&&(e[r]=n),1)}catch(t){return 0}},Qt.jws.JWS.readSafeJSONString=function(t){var e=null;try{return"object"!=typeof(e=Zt(t))||e.constructor===Array?null:e}catch(t){return null}},Qt.jws.JWS.getEncodedSignatureValueFromJWS=function(t){var e=t.match(/^[^.]+\.[^.]+\.([^.]+)$/);if(null==e)throw"JWS signature is not a form of 'Head.Payload.SigValue'.";return e[1]},Qt.jws.JWS.getJWKthumbprint=function(t){if("RSA"!==t.kty&&"EC"!==t.kty&&"oct"!==t.kty)throw new Error("unsupported algorithm for JWK Thumprint");var e="{";if("RSA"===t.kty){if("string"!=typeof t.n||"string"!=typeof t.e)throw new Error("wrong n and e value for RSA key");e+='"e":"'+t.e+'",',e+='"kty":"'+t.kty+'",',e+='"n":"'+t.n+'"}'}else if("EC"===t.kty){if("string"!=typeof t.crv||"string"!=typeof t.x||"string"!=typeof t.y)throw new Error("wrong crv, x and y value for EC key");e+='"crv":"'+t.crv+'",',e+='"kty":"'+t.kty+'",',e+='"x":"'+t.x+'",',e+='"y":"'+t.y+'"}'}else if("oct"===t.kty){if("string"!=typeof t.k)throw new Error("wrong k value for oct(symmetric) key");e+='"k":"'+t.k+'",',e+='"kty":"'+t.kty+'"}'}var r=pe(e);return oe(Qt.crypto.Util.hashHex(r,"sha256"))},Qt.jws.IntDate={},Qt.jws.IntDate.get=function(t){var e=Qt.jws.IntDate,r=e.getNow,n=e.getZulu;if("now"==t)return r();if("now + 1hour"==t)return r()+3600;if("now + 1day"==t)return r()+86400;if("now + 1month"==t)return r()+2592e3;if("now + 1year"==t)return r()+31536e3;if(t.match(/Z$/))return n(t);if(t.match(/^[0-9]+$/))return parseInt(t);throw"unsupported format: "+t},Qt.jws.IntDate.getZulu=function(t){return ve(t)},Qt.jws.IntDate.getNow=function(){return~~(new Date/1e3)},Qt.jws.IntDate.intDate2UTCString=function(t){return new Date(1e3*t).toUTCString()},Qt.jws.IntDate.intDate2Zulu=function(t){var e=new Date(1e3*t);return("0000"+e.getUTCFullYear()).slice(-4)+("00"+(e.getUTCMonth()+1)).slice(-2)+("00"+e.getUTCDate()).slice(-2)+("00"+e.getUTCHours()).slice(-2)+("00"+e.getUTCMinutes()).slice(-2)+("00"+e.getUTCSeconds()).slice(-2)+"Z"},void 0!==Qt&&Qt||(Qt={}),void 0!==Qt.jws&&Qt.jws||(Qt.jws={}),Qt.jws.JWSJS=function(){var t=Qt.jws.JWS,e=t.readSafeJSONString;this.aHeader=[],this.sPayload="",this.aSignature=[],this.init=function(){this.aHeader=[],this.sPayload=void 0,this.aSignature=[]},this.initWithJWS=function(t){this.init();var e=t.split(".");if(3!=e.length)throw"malformed input JWS";this.aHeader.push(e[0]),this.sPayload=e[1],this.aSignature.push(e[2])},this.addSignature=function(t,e,r,n){if(void 0===this.sPayload||null===this.sPayload)throw"there's no JSON-JS signature to add.";var i=this.aHeader.length;if(this.aHeader.length!=this.aSignature.length)throw"aHeader.length != aSignature.length";try{var s=Qt.jws.JWS.sign(t,e,this.sPayload,r,n).split(".");s[0],s[2];this.aHeader.push(s[0]),this.aSignature.push(s[2])}catch(t){throw this.aHeader.length>i&&this.aHeader.pop(),this.aSignature.length>i&&this.aSignature.pop(),"addSignature failed: "+t}},this.verifyAll=function(t){if(this.aHeader.length!==t.length||this.aSignature.length!==t.length)return!1;for(var e=0;e<t.length;e++){var r=t[e];if(2!==r.length)return!1;if(!1===this.verifyNth(e,r[0],r[1]))return!1}return!0},this.verifyNth=function(e,r,n){if(this.aHeader.length<=e||this.aSignature.length<=e)return!1;var i=this.aHeader[e],s=this.aSignature[e],a=i+"."+this.sPayload+"."+s,o=!1;try{o=t.verify(a,r,n)}catch(t){return!1}return o},this.readJWSJS=function(t){if("string"==typeof t){var r=e(t);if(null==r)throw"argument is not safe JSON object string";this.aHeader=r.headers,this.sPayload=r.payload,this.aSignature=r.signatures}else try{if(!(t.headers.length>0))throw"malformed header";if(this.aHeader=t.headers,"string"!=typeof t.payload)throw"malformed signatures";if(this.sPayload=t.payload,!(t.signatures.length>0))throw"malformed signatures";this.aSignature=t.signatures}catch(t){throw"malformed JWS-JS JSON object: "+t}},this.getJSON=function(){return{headers:this.aHeader,payload:this.sPayload,signatures:this.aSignature}},this.isEmpty=function(){return 0==this.aHeader.length?1:0}},Qt.crypto.ECDSA,Qt.crypto.DSA,Qt.crypto.Signature,Qt.crypto.MessageDigest,Qt.crypto.Mac;var Ke=Qt;function Ue(t){const e=["","","","","","","","","","",""];if("number"!=typeof t||isNaN(t)||!isFinite(t))return e;if(t>999999999.99)return console.warn("金额过大,最大支持999999999.99元"),e;if(t<0)return console.warn("金额不能为负数"),e;if(0===t)return e;const r=Math.abs(t).toFixed(2),[n,i]=r.split("."),s=n.length;for(let t=0;t<s;t++){const r=n[s-1-t],i=8-t;i>=0&&(e[i]=r)}return(parseInt(n)>0||parseInt(i)>0)&&(e[9]=i[0],e[10]=i[1]),e}Qt.crypto,Qt.asn1,Qt.jws,Qt.lang;const ze=()=>{const t=new Date;return`${t.getFullYear()}-${(t.getMonth()+1).toString().padStart(2,"0")}`};function We(t,e){if(!isFinite(t)||0===t)return t.toFixed(2);const r=Math.trunc(100*t)/100;return Object.is(r,-0)?"-0.00":r.toFixed(e)}const Ge=(t,e,r,n=!1)=>{if(null==t||isNaN(Number(t)))return n?"0":"";let i=Number(t);if(0===i&&!n)return"";void 0!==r&&"number"==typeof r&&r>=0?i=i.toFixed(r):void 0!==e&&"number"==typeof e&&e>=0&&(i=i.toFixed(e));const s=i.toString().split("."),a=s[0],o=s[1]||"",u=a.replace(/\B(?=(\d{3})+(?!\d))/g,",");return o?`${u}.${o}`:u};function $e(t){if("string"!=typeof t){const e="文件地址必须是字符串,当前传入类型:"+typeof t;return console.error("[handleViewFile] 错误:",e),{success:!1,error:e}}if(!t.trim()){const t="文件地址不能为空或仅空格";return console.error("[handleViewFile] 错误:",t),{success:!1,error:t}}let e;try{e=new URL(t)}catch(e){const r=`无效的URL格式:${t}(请检查是否包含特殊字符或缺失协议)`;return console.error("[handleViewFile] URL解析错误:",e,"| 地址:",t),{success:!1,error:r}}if(!["http:","https:"].includes(e.protocol)){const t=`仅支持HTTP/HTTPS协议,当前协议:${e.protocol}`;return console.error("[handleViewFile] 协议错误:",t),{success:!1,error:t}}const r=e.pathname,n=r.lastIndexOf(".");if(-1===n){const e=`文件地址不含后缀名:${t}(需是jpg/png/pdf)`;return console.error("[handleViewFile] 格式错误:",e),{success:!1,error:e}}const i=r.slice(n+1).toLowerCase(),s=["jpg","jpeg","png","pdf"];if(!s.includes(i)){const t=`不支持的文件格式:.${i},仅支持${s.join("、")}`;return console.error("[handleViewFile] 格式错误:",t),{success:!1,error:t}}try{if(!window.open(t,"_blank","noopener,noreferrer,width=1000,height=800")){const t="文件窗口被浏览器拦截,请允许弹窗后重试(地址栏右侧查看拦截提示)";return console.warn("[handleViewFile] 弹窗被拦截:",t),{success:!1,error:t}}return console.log("[handleViewFile] 成功:文件已在新窗口打开,地址:",t),{success:!0,message:"文件已在新窗口打开"}}catch(e){const r=`打开文件失败:${e.message}(可能是浏览器安全设置或网络问题)`;return console.error("[handleViewFile] 打开失败:",e,"| 地址:",t),{success:!1,error:r}}}const Je=async(e,r,n)=>{try{0;const e=await fetch(r,{method:"get",headers:{token:y()||cookie.get("token")},responseType:"blob"});if(!e.ok)return t.error("请求失败"),!1;const i=await e.blob();if(i.type&&i.type.includes("application/json")){const e=await i.text();try{const r=JSON.parse(e);if(r&&r.msg)return t.error(r.msg),void(401===r.code&&setTimeout(()=>{window.location.href="/login?redirect="+encodeURIComponent(window.location.href)},2e3))}catch{console.warn("")}}const s=e.headers.get("content-disposition");let a=n;if(s){const t=s.match(/filename="?([^"]+)"?/);t&&t[1]&&(a=decodeURIComponent(t[1]))}const o=window.URL.createObjectURL(i),u=document.createElement("a");u.href=o,u.download=a,document.body.appendChild(u),u.click(),t.success("下载成功"),window.URL.revokeObjectURL(o),document.body.removeChild(u)}catch(e){console.error("下载Excel失败:",e),t.error("下载失败")}},Ye=async(e,r,n,i)=>{try{0;const e=await fetch(r,{method:"post",headers:{token:y(),"Content-Type":"application/json"},body:JSON.stringify(i)});if(!e.ok)return t.error("请求失败"),!1;const s=await e.blob();if(s.type&&s.type.includes("application/json")){const e=await s.text();try{const r=JSON.parse(e);if(r&&r.msg)return t.error(r.msg),401===r.code&&setTimeout(()=>{window.location.href="/login?redirect="+encodeURIComponent(window.location.href)},2e3),!1}catch{console.warn("解析JSON失败")}}const a=e.headers.get("content-disposition");let o=n;if(a){const t=a.match(/filename\*=UTF-8''([^;]+)/i);if(t&&t[1])o=decodeURIComponent(t[1]);else{const t=a.match(/filename=(?:"([^"]+)"|([^;]+))/i);if(t){let e=t[1]||t[2];try{o=decodeURIComponent(e)}catch(t){o=e}}}}const u=window.URL.createObjectURL(s),c=document.createElement("a");return c.style.display="none",c.href=u,c.download=o,document.body.appendChild(c),c.click(),t.success("下载成功"),setTimeout(()=>{window.URL.revokeObjectURL(u),document.body.removeChild(c)},1e3),!0}catch(e){return console.error("下载文件失败:",e),t.error("下载失败"),!1}},Xe=t=>{if(!t||"string"!=typeof t)return"unknown";const e=t.split("?")[0].match(/\.([a-zA-Z0-9]+)$/);if(!e)return"unknown";const r=e[1].toLowerCase();return/^pdf$/i.test(r)?"pdf":/^(jpg|jpeg|png|gif|bmp|webp|svg|ico|tiff|tif|heic|heif)$/i.test(r)?"image":/^(xlsx|xls)$/i.test(r)?"xlsx":"unknown"};function Ze(t,e){console.log(t,e);const r=new Ke.crypto.Signature({alg:"SHA256withRSA",prov:"cryptojs/jsrsa"});return r.init(e),r.updateString(t),r.sign()}function Qe(t){if(!t)return"";const[e,r]=t.split("-");return`${e}-${r}-01`}function tr(){const t=new Date;return`${t.getFullYear()}${String(t.getMonth()+1).padStart(2,"0")}${String(t.getDate()).padStart(2,"0")}${String(t.getHours()).padStart(2,"0")}${String(t.getMinutes()).padStart(2,"0")}${String(t.getSeconds()).padStart(2,"0")}`}function er(t,e={}){const{emptyObject:r={},preserveOriginal:n=!1}=e;if(!Array.isArray(t))throw new Error("参数必须是数组");const i=[];return t.forEach((t,e)=>{if(!t||"object"!=typeof t)return;const s=t.voucherList;if(!Array.isArray(s)){const s=n?{...t}:{...t,_metadata:{originalIndex:e,isPadded:!0,originalLength:0}};return s.voucherList=[{...r},{...r},{...r},{...r},{...r}],s.page=1,s.pageCount=1,void i.push(s)}const a=Math.ceil(s.length/5);if(s.length>5)for(let o=0;o<s.length;o+=5){const u=s.slice(o,o+5),c=Math.floor(o/5)+1,h=[...u];for(;h.length<5;)h.push({...r});const l=n?{...t}:{...t,_metadata:{originalIndex:e,isSplit:o>0,chunkIndex:Math.floor(o/5),totalChunks:a}};l.voucherList=h,l.page=c,l.pageCount=a,i.push(l)}else if(s.length<5){const a=s.map(t=>({...t}));for(;a.length<5;)a.push({...r});const o=n?{...t}:{...t,_metadata:{originalIndex:e,isPadded:!0,originalLength:s.length}};o.voucherList=a,o.page=1,o.pageCount=1,i.push(o)}else{const r=n?{...t}:{...t,_metadata:{originalIndex:e,isOriginal:!0}};r.page=1,r.pageCount=1,i.push(r)}}),i}const rr=(t,e)=>{const r=document.createElement("a");if(r.style.display="none","string"==typeof t)r.href=t;else{if(!(t instanceof Blob))return void console.error("不支持的文件源类型");r.href=URL.createObjectURL(t)}r.setAttribute("download",e),document.body.appendChild(r),r.click(),document.body.removeChild(r),t instanceof Blob&&window.URL.revokeObjectURL(r.href)},nr=t=>{const e=new Date,r=e.getFullYear(),n=e.getMonth(),i=t.getFullYear(),s=t.getMonth();if(0===n){return!(i===r-1&&11===s||i===r)}return i!==r},ir=(t,e=300)=>{let r=null;return function(...n){r&&clearTimeout(r),r=setTimeout(()=>{t.apply(this,n)},e)}};function sr(){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";let e="";for(let r=0;r<32;r++)if("undefined"!=typeof crypto&&crypto.getRandomValues){const r=new Uint8Array(1);crypto.getRandomValues(r);const n=r[0]%62;e+=t.charAt(n)}else{const r=Math.floor(62*Math.random());e+=t.charAt(r)}return e}function ar(t=13){if(10===t)return Math.floor(Date.now()/1e3);if(13===t)return Date.now();throw new Error("只支持10位或13位时间戳")}const or=(t=[],e="",{keepEmpty:r=!1}={})=>{if(!Array.isArray(t))return[];const n=e.split(".").filter(t=>t.trim());return t.map(t=>{let e=t;for(const t of n)if(e=e?.[t],null==e)break;return e}).filter(t=>r||null!=t)};function ur(t){const e=String(t).replace(/%/g,""),r=Number(e);return isNaN(r)?0:r}const cr=(t,e)=>t.reduce((t,r)=>t+("number"!=typeof r[e]||isNaN(r[e])?0:r[e]),0),hr=t=>{const e=new Date,r=e.getFullYear(),n=e.getMonth(),i=t.getFullYear(),s=t.getMonth();return i>r||i===r&&s>=n},lr=e=>{if(!e)return void t.warning("暂无可复制内容");const r=document.createElement("input");r.value=e,document.body.appendChild(r),r.select(),document.execCommand("copy"),document.body.removeChild(r),t.success("复制成功")},fr=(t,e=!1)=>t.map(t=>{const r={title:t.name};return t.url&&(r.path=t.url),t.icon&&(r.svgName=t.icon),t.type&&(r.type=t.type),t.code&&(r.code=t.code),e?t.children&&t.children.length>0&&0===t.type&&(r.children=fr(t.children)):t.children&&t.children.length>0&&(r.children=fr(t.children)),r});function pr(t){return Array.isArray(t)?t.filter(t=>1===t.type||void 0===t.type).map(t=>{const e={title:t.title,...t.path&&{path:t.path},...t.svgName&&{svgName:t.svgName},...t.code&&{code:t.code}};if(t.children&&t.children.length){const r=pr(t.children);r.length&&(e.children=r)}return e}):[]}const gr=t=>null==t||isNaN(t)?"":Number(t).toLocaleString("zh-CN",{minimumFractionDigits:2,maximumFractionDigits:2}),dr=t=>{if(!t||!t.length)return;t.forEach(t=>{1==t.draftCalType&&(t.currentAmount=0)});let e=null;t.forEach(t=>{if(1==t.draftCalType)e=t;else if((2==t.draftCalType||3==t.draftCalType)&&e){const r=Number(t.currentAmount)||0,n=-1===t.calDirection?-1:1;e.currentAmount=(e.currentAmount||0)+r*n}})},vr=(t,e)=>{const r=t.operations.indexOf(e);r>-1&&t.operations.splice(r,1)};function mr(t,e={}){const{typeKey:r="type",codeKey:n="code",targetType:i=2,childrenKey:s="children"}=e,a=[],o=t=>{Array.isArray(t)&&t.forEach(t=>{2!==t[r]&&1!==t[r]||!t[n]||a.push(t[n]),t[s]&&Array.isArray(t[s])&&t[s].length>0&&o(t[s])})};return o(t),a}const yr={install(t,e={}){const{getPermissions:r,directiveName:n="permission"}=e;if("function"!=typeof r)return void console.error("[PermissionPlugin]: getPermissions 必须是一个返回数组的函数");const i=t=>{const e=r()||[];if(!t)return!0;return(Array.isArray(t)?t:[t]).some(t=>e.includes(t))};t.config.globalProperties.$hasPermission=i,t.provide("hasPermission",i),t.directive(n,{mounted(t,e){const{value:r}=e;if(!r)return void console.warn(`[PermissionPlugin]: 需要指定权限标识,例如 v-${n}="'USER_ADD'"`);const s=()=>{!i(r)&&t.parentNode&&t.parentNode.removeChild(t)};s(),t._permission_check=s},updated(t,e){t._permission_check&&t._permission_check()}})}},wr=t=>{if(t&&2===t.length){if(t[0].split("-")[0]!==t[1].split("-")[0])return!1}return!0},xr=(t,e,r,n)=>{const i=t.querySelector(e);i&&i.scrollIntoView({behavior:"smooth",block:"center"}),setTimeout(()=>{r.value=""},n)},Sr=(t,e)=>((t??1)-1)*e+"px";function Er(t={}){const{allowedExtensions:e=[],onDropFiles:a,enabled:o=r(!0)}=t,u=r(!1);let c=0;const h=t=>{s(o)&&(t.preventDefault(),c++,1===c&&(u.value=!0))},l=t=>{s(o)&&(t.preventDefault(),c--,0===c&&(u.value=!1))},f=t=>{s(o)&&t.preventDefault()},p=t=>{if(!s(o))return;t.preventDefault(),c=0,u.value=!1;const r=Array.from(t.dataTransfer.files);if(0===r.length)return;const n=[],i=[];r.forEach(t=>{const r="."+t.name.split(".").pop().toLowerCase();0===e.length||e.includes(r)?n.push(t):i.push(t)}),a&&a(n,i)};return n(()=>{window.addEventListener("dragenter",h),window.addEventListener("dragleave",l),window.addEventListener("dragover",f),window.addEventListener("drop",p)}),i(()=>{window.removeEventListener("dragenter",h),window.removeEventListener("dragleave",l),window.removeEventListener("dragover",f),window.removeEventListener("drop",p)}),{isGlobalDragging:u}}const br=(e,r=10)=>{const n=1024*r*1024;return e.size>n?(t.error(`文件 ${e.name} 太大,最大支持${r}MB`),!1):(console.log("准备上传文件:",e),!0)};function Fr(t){const[e,r]=t.split("-").map(Number),n=new Date(e,r-1,1);n.setMonth(n.getMonth()-1);return`${n.getFullYear()}-${String(n.getMonth()+1).padStart(2,"0")}`}const Ar=(t,e="key")=>{if(!t||0===t.length)return"";const r=t.reduce((t,e)=>e.value<t.value?e:t,t[0]);return r[e]},Dr=(t,e)=>{const r=`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}`;return!e.map(t=>t.accountPeriod).includes(r)};function Cr(t){if(!t||"string"!=typeof t)return null;const e=t.lastIndexOf(".");return e>0?t.slice(e+1).toLowerCase():null}const Ir=t=>t<10?`0${t}`:t,Pr=(t,e=0,r=0)=>{const n=new Date(t);n.setHours(e,r,0,0);return`${n.getFullYear()}-${Ir(n.getMonth()+1)}-${Ir(n.getDate())} ${Ir(n.getHours())}:${Ir(n.getMinutes())}`},Rr=t=>{const e=new Date(t);e.setHours(0,0,0,0);const r=new Date;return r.setHours(0,0,0,0),e.getTime()<r.getTime()},Tr=(t,e,r)=>{const n=new Date(t).setHours(0,0,0,0),i=new Date(e).setHours(0,0,0,0),s=new Date(r).setHours(0,0,0,0);return n>=i&&n<=s},Nr=(t,e)=>new Date(t).setHours(0,0,0,0)===new Date(e).setHours(0,0,0,0),Or=(t,e,r)=>{const n=new Date(t).setHours(0,0,0,0),i=new Date(e).setHours(0,0,0,0),s=new Date(r).setHours(0,0,0,0);return n>i&&n<=s},Br=(t="08:00",e="18:00")=>{const r=new Date,n=r.getFullYear(),i=String(r.getMonth()+1).padStart(2,"0"),s=String(r.getDate()).padStart(2,"0");return[`${n}-${i}-${s} ${t}`,`${n}-${i}-${s} ${e}`]},_r=t=>{const e=new Date;return e.setHours(0,0,0,0),t.getTime()<e.getTime()},jr=t=>{const e=document.createElement("a");e.href=t,e.target="_blank",e.rel="noopener noreferrer",document.body.appendChild(e),e.click(),document.body.removeChild(e)},Hr=(t,e)=>{if(!e)return[...t];const r=[];return t.forEach(t=>{const n=((t,e)=>["code","name","openingBalance","debitTotal","creditTotal","yearTotal"].some(r=>String(t[r]||"").toLowerCase().includes(e)))(t,e),i=t.children?Hr(t.children,e):[];if(n||i.length>0){const e={...t};t.children&&(e.children=i),r.push(e)}}),r},kr=(t,e,r="children")=>{for(const n of t){if(n[r]&&n[r].includes(e))return n;if(n[r]){const t=kr(n[r],e,r);if(t)return t}}return null},Lr=t=>{t.forEach(t=>{t.auxInitialList&&t.auxInitialList.length>0&&(t.children||(t.children=[]),t.auxInitialList.forEach(e=>{const r={...e};r.code_0=r.code,r.code=r.subjectAuxCode,r.name=r.subjectAuxName,t.children.push(r)})),t.children&&t.children.length>0&&Lr(t.children)})},Vr=t=>{if(null==t||""===String(t).trim())return 0;const e=Number(String(t).replace(/,/g,""));return isNaN(e)?0:e},qr=t=>{t&&Array.isArray(t)&&t.forEach(t=>{t.auxInitialList&&t.auxInitialList.length>0&&(t.children||(t.children=[]),t.auxInitialList.forEach(e=>{const r={...e};r.code_0=r.code,r.code=r.subjectAuxCode,r.name=r.subjectAuxName,r.code||(r.code=r.code_0),t.children.push(r)})),t.children&&t.children.length>0&&qr(t.children)})},Mr=t=>t&&Array.isArray(t)?t.filter(t=>!t.code_0).map(t=>{const e={...t},r=e.children||[],n=r.filter(t=>!t.code_0),i=r.filter(t=>t.code_0);return i.length>0?e.auxInitialItemList=i.map(t=>{const e={...t};return e.code=e.code_0,e.auxInstanceCode=e.subjectAuxCode,e.openingBalance=Vr(e.openingBalance),e.debitTotal=Vr(e.debitTotal),e.creditTotal=Vr(e.creditTotal),e.yearTotal=Vr(e.yearTotal),e.originalOpeningBalance=Vr(e.originalOpeningBalance),e.originalDebitTotal=Vr(e.originalDebitTotal),e.originalCreditTotal=Vr(e.originalCreditTotal),e.originalYearTotal=Vr(e.originalYearTotal),e.openingQuantity=Vr(e.openingQuantity),e.debitQuantity=Vr(e.debitQuantity),e.creditQuantity=Vr(e.creditQuantity),e.yearQuantity=Vr(e.yearQuantity),delete e.code_0,e}):e.auxInitialItemList=[],e.openingBalance=Vr(e.openingBalance),e.debitTotal=Vr(e.debitTotal),e.creditTotal=Vr(e.creditTotal),e.yearTotal=Vr(e.yearTotal),e.originalOpeningBalance=Vr(e.originalOpeningBalance),e.originalDebitTotal=Vr(e.originalDebitTotal),e.originalCreditTotal=Vr(e.originalCreditTotal),e.originalYearTotal=Vr(e.originalYearTotal),e.openingQuantity=Vr(e.openingQuantity),e.debitQuantity=Vr(e.debitQuantity),e.creditQuantity=Vr(e.creditQuantity),e.yearQuantity=Vr(e.yearQuantity),n.length>0?e.children=Mr(n):e.children=[],delete e.auxInitialList,e}):[],Kr=(t,e)=>{if(!Array.isArray(t))return!1;for(const r of t){if(e(r))return!0;if(r.children?.length&&Kr(r.children,e))return!0}return!1},Ur={0:1,1:2,2:3,6:4,7:5,8:6,3:7};function zr(t,e){return e.slice(0,t).map((t,e)=>t<=1?"1":2===t?0===e?"11":"01":0===e?"1"+"0".repeat(t-2)+"1":"0"+"0".repeat(t-2)+"1").join("-")}const Wr=[".el-input","input","textarea","button","a",'[contenteditable="true"]'];async function Gr({cell:t,event:e,selectSelector:r,nextTick:n,canOpen:i=()=>!0,ignoreSelectors:s=[]}){if("undefined"==typeof window||"undefined"==typeof Element)return!1;if(!(t instanceof HTMLElement&&t.isConnected&&i()))return!1;const a=e?.target;if(!(a instanceof Element&&t.contains(a)))return!1;const o=t.querySelector(r);if(!(o instanceof HTMLElement))return!1;const u=a.closest(".el-select");if(u&&u!==o)return!1;const c=o.querySelector(".el-select__wrapper"),h=o.querySelector('input[role="combobox"]');if(!(c instanceof HTMLElement&&h instanceof HTMLInputElement))return!1;if(c.contains(a))return!1;const l=[...Wr,...s].join(", "),f=a.closest(l);if(f&&t.contains(f))return!1;const p=()=>i()&&t.isConnected&&o.isConnected&&t.querySelector(r)===o&&o.contains(h)&&o.contains(c)&&!h.disabled&&!o.classList.contains("is-disabled")&&!c.classList.contains("is-disabled");return await n(),!!p()&&(h.focus(),await n(),!(!p()||document.activeElement!==h)&&("false"===h.getAttribute("aria-expanded")&&c.click(),await n(),p()&&"true"===h.getAttribute("aria-expanded")))}const $r=t=>{if(null==t)return!1;const e=String(t).trim().replace(/,/g,"");if(!e)return!1;const r=Number(e);return Number.isFinite(r)&&0!==r},Jr=(t,e)=>Array.isArray(t)?t.reduce((t,r)=>{const n=Jr(r.children,e);if(e.some(t=>$r(r[t]))||n.length>0){const e={...r};Array.isArray(r.children)&&(e.children=n),t.push(e)}return t},[]):[];function Yr(t,e=0,r=500){if("string"!=typeof t||!t.trim())return console.error("[scrollToId] 错误:id必须是非空字符串"),!1;const n=document.getElementById(t);if(!n)return console.error(`[scrollToId] 错误:未找到ID为"${t}"的元素`),!1;const i=n.getBoundingClientRect().top+window.pageYOffset,s=window.pageYOffset,a=i-s-e;let o=null;return requestAnimationFrame(function t(e){null===o&&(o=e);const n=e-o,i=function(t,e,r,n){return t/=n/2,t<1?r/2*t*t+e:(t--,-r/2*(t*(t-2)-1)+e)}(n,s,a,r);window.scrollTo(0,i),n<r&&requestAnimationFrame(t)}),!0}const Xr=["/login","/404","/403","/register","/pay","/file-views","/iitc","/users/info"],Zr=["/login","/404","/403","/register","/pay","/file-views","/iitc","/users/info"],Qr=["/login","/404","/403","/register","/file-views","/iitc","/account"];
|
|
27
27
|
/*!
|
|
28
28
|
* decimal.js v10.6.0
|
|
29
29
|
* An arbitrary-precision Decimal type for JavaScript.
|
|
@@ -31,14 +31,5 @@ var Xt=function(){var t=new RegExp('(?:false|true|null|[\\{\\}\\[\\]]|(?:-?\\b(?
|
|
|
31
31
|
* Copyright (c) 2025 Michael Mclaughlin <M8ch88l@gmail.com>
|
|
32
32
|
* MIT Licence
|
|
33
33
|
*/
|
|
34
|
-
var Qr,tn,en=9e15,rn=1e9,nn="0123456789abcdef",sn="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",an="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",on={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-en,maxE:en,crypto:!1},un=!0,cn="[DecimalError] ",hn=cn+"Invalid argument: ",ln=cn+"Precision limit exceeded",fn=cn+"crypto unavailable",pn="[object Decimal]",gn=Math.floor,dn=Math.pow,vn=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,mn=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,yn=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,wn=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,xn=1e7,Sn=sn.length-1,En=an.length-1,bn={toStringTag:pn};function Fn(t){var e,r,n,i=t.length-1,s="",a=t[0];if(i>0){for(s+=a,e=1;e<i;e++)(r=7-(n=t[e]+"").length)&&(s+=_n(r)),s+=n;(r=7-(n=(a=t[e])+"").length)&&(s+=_n(r))}else if(0===a)return"0";for(;a%10==0;)a/=10;return s+a}function An(t,e,r){if(t!==~~t||t<e||t>r)throw Error(hn+t)}function Cn(t,e,r,n){var i,s,a,o;for(s=t[0];s>=10;s/=10)--e;return--e<0?(e+=7,i=0):(i=Math.ceil((e+1)/7),e%=7),s=dn(10,7-e),o=t[i]%s|0,null==n?e<3?(0==e?o=o/100|0:1==e&&(o=o/10|0),a=r<4&&99999==o||r>3&&49999==o||5e4==o||0==o):a=(r<4&&o+1==s||r>3&&o+1==s/2)&&(t[i+1]/s/100|0)==dn(10,e-2)-1||(o==s/2||0==o)&&!(t[i+1]/s/100|0):e<4?(0==e?o=o/1e3|0:1==e?o=o/100|0:2==e&&(o=o/10|0),a=(n||r<4)&&9999==o||!n&&r>3&&4999==o):a=((n||r<4)&&o+1==s||!n&&r>3&&o+1==s/2)&&(t[i+1]/s/1e3|0)==dn(10,e-3)-1,a}function Dn(t,e,r){for(var n,i,s=[0],a=0,o=t.length;a<o;){for(i=s.length;i--;)s[i]*=e;for(s[0]+=nn.indexOf(t.charAt(a++)),n=0;n<s.length;n++)s[n]>r-1&&(void 0===s[n+1]&&(s[n+1]=0),s[n+1]+=s[n]/r|0,s[n]%=r)}return s.reverse()}bn.absoluteValue=bn.abs=function(){var t=new this.constructor(this);return t.s<0&&(t.s=1),In(t)},bn.ceil=function(){return In(new this.constructor(this),this.e+1,2)},bn.clampedTo=bn.clamp=function(t,e){var r=this,n=r.constructor;if(t=new n(t),e=new n(e),!t.s||!e.s)return new n(NaN);if(t.gt(e))throw Error(hn+e);return r.cmp(t)<0?t:r.cmp(e)>0?e:new n(r)},bn.comparedTo=bn.cmp=function(t){var e,r,n,i,s=this,a=s.d,o=(t=new s.constructor(t)).d,u=s.s,c=t.s;if(!a||!o)return u&&c?u!==c?u:a===o?0:!a^u<0?1:-1:NaN;if(!a[0]||!o[0])return a[0]?u:o[0]?-c:0;if(u!==c)return u;if(s.e!==t.e)return s.e>t.e^u<0?1:-1;for(e=0,r=(n=a.length)<(i=o.length)?n:i;e<r;++e)if(a[e]!==o[e])return a[e]>o[e]^u<0?1:-1;return n===i?0:n>i^u<0?1:-1},bn.cosine=bn.cos=function(){var t,e,r=this,n=r.constructor;return r.d?r.d[0]?(t=n.precision,e=n.rounding,n.precision=t+Math.max(r.e,r.sd())+7,n.rounding=1,r=function(t,e){var r,n,i;if(e.isZero())return e;n=e.d.length,n<32?i=(1/zn(4,r=Math.ceil(n/3))).toString():(r=16,i="2.3283064365386962890625e-10");t.precision+=r,e=Un(t,1,e.times(i),new t(1));for(var s=r;s--;){var a=e.times(e);e=a.times(a).minus(a).times(8).plus(1)}return t.precision-=r,e}(n,Wn(n,r)),n.precision=t,n.rounding=e,In(2==tn||3==tn?r.neg():r,t,e,!0)):new n(1):new n(NaN)},bn.cubeRoot=bn.cbrt=function(){var t,e,r,n,i,s,a,o,u,c,h=this,l=h.constructor;if(!h.isFinite()||h.isZero())return new l(h);for(un=!1,(s=h.s*dn(h.s*h,1/3))&&Math.abs(s)!=1/0?n=new l(s.toString()):(r=Fn(h.d),(s=((t=h.e)-r.length+1)%3)&&(r+=1==s||-2==s?"0":"00"),s=dn(r,1/3),t=gn((t+1)/3)-(t%3==(t<0?-1:2)),(n=new l(r=s==1/0?"5e"+t:(r=s.toExponential()).slice(0,r.indexOf("e")+1)+t)).s=h.s),a=(t=l.precision)+3;;)if(c=(u=(o=n).times(o).times(o)).plus(h),n=Pn(c.plus(h).times(o),c.plus(u),a+2,1),Fn(o.d).slice(0,a)===(r=Fn(n.d)).slice(0,a)){if("9999"!=(r=r.slice(a-3,a+1))&&(i||"4999"!=r)){+r&&(+r.slice(1)||"5"!=r.charAt(0))||(In(n,t+1,1),e=!n.times(n).times(n).eq(h));break}if(!i&&(In(o,t+1,0),o.times(o).times(o).eq(h))){n=o;break}a+=4,i=1}return un=!0,In(n,t,l.rounding,e)},bn.decimalPlaces=bn.dp=function(){var t,e=this.d,r=NaN;if(e){if(r=7*((t=e.length-1)-gn(this.e/7)),t=e[t])for(;t%10==0;t/=10)r--;r<0&&(r=0)}return r},bn.dividedBy=bn.div=function(t){return Pn(this,new this.constructor(t))},bn.dividedToIntegerBy=bn.divToInt=function(t){var e=this.constructor;return In(Pn(this,new e(t),0,1,1),e.precision,e.rounding)},bn.equals=bn.eq=function(t){return 0===this.cmp(t)},bn.floor=function(){return In(new this.constructor(this),this.e+1,3)},bn.greaterThan=bn.gt=function(t){return this.cmp(t)>0},bn.greaterThanOrEqualTo=bn.gte=function(t){var e=this.cmp(t);return 1==e||0===e},bn.hyperbolicCosine=bn.cosh=function(){var t,e,r,n,i,s=this,a=s.constructor,o=new a(1);if(!s.isFinite())return new a(s.s?1/0:NaN);if(s.isZero())return o;r=a.precision,n=a.rounding,a.precision=r+Math.max(s.e,s.sd())+4,a.rounding=1,(i=s.d.length)<32?e=(1/zn(4,t=Math.ceil(i/3))).toString():(t=16,e="2.3283064365386962890625e-10"),s=Un(a,1,s.times(e),new a(1),!0);for(var u,c=t,h=new a(8);c--;)u=s.times(s),s=o.minus(u.times(h.minus(u.times(h))));return In(s,a.precision=r,a.rounding=n,!0)},bn.hyperbolicSine=bn.sinh=function(){var t,e,r,n,i=this,s=i.constructor;if(!i.isFinite()||i.isZero())return new s(i);if(e=s.precision,r=s.rounding,s.precision=e+Math.max(i.e,i.sd())+4,s.rounding=1,(n=i.d.length)<3)i=Un(s,2,i,i,!0);else{t=(t=1.4*Math.sqrt(n))>16?16:0|t,i=Un(s,2,i=i.times(1/zn(5,t)),i,!0);for(var a,o=new s(5),u=new s(16),c=new s(20);t--;)a=i.times(i),i=i.times(o.plus(a.times(u.times(a).plus(c))))}return s.precision=e,s.rounding=r,In(i,e,r,!0)},bn.hyperbolicTangent=bn.tanh=function(){var t,e,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(t=n.precision,e=n.rounding,n.precision=t+7,n.rounding=1,Pn(r.sinh(),r.cosh(),n.precision=t,n.rounding=e)):new n(r.s)},bn.inverseCosine=bn.acos=function(){var t=this,e=t.constructor,r=t.abs().cmp(1),n=e.precision,i=e.rounding;return-1!==r?0===r?t.isNeg()?On(e,n,i):new e(0):new e(NaN):t.isZero()?On(e,n+4,i).times(.5):(e.precision=n+6,e.rounding=1,t=new e(1).minus(t).div(t.plus(1)).sqrt().atan(),e.precision=n,e.rounding=i,t.times(2))},bn.inverseHyperbolicCosine=bn.acosh=function(){var t,e,r=this,n=r.constructor;return r.lte(1)?new n(r.eq(1)?0:NaN):r.isFinite()?(t=n.precision,e=n.rounding,n.precision=t+Math.max(Math.abs(r.e),r.sd())+4,n.rounding=1,un=!1,r=r.times(r).minus(1).sqrt().plus(r),un=!0,n.precision=t,n.rounding=e,r.ln()):new n(r)},bn.inverseHyperbolicSine=bn.asinh=function(){var t,e,r=this,n=r.constructor;return!r.isFinite()||r.isZero()?new n(r):(t=n.precision,e=n.rounding,n.precision=t+2*Math.max(Math.abs(r.e),r.sd())+6,n.rounding=1,un=!1,r=r.times(r).plus(1).sqrt().plus(r),un=!0,n.precision=t,n.rounding=e,r.ln())},bn.inverseHyperbolicTangent=bn.atanh=function(){var t,e,r,n,i=this,s=i.constructor;return i.isFinite()?i.e>=0?new s(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(t=s.precision,e=s.rounding,n=i.sd(),Math.max(n,t)<2*-i.e-1?In(new s(i),t,e,!0):(s.precision=r=n-i.e,i=Pn(i.plus(1),new s(1).minus(i),r+t,1),s.precision=t+4,s.rounding=1,i=i.ln(),s.precision=t,s.rounding=e,i.times(.5))):new s(NaN)},bn.inverseSine=bn.asin=function(){var t,e,r,n,i=this,s=i.constructor;return i.isZero()?new s(i):(e=i.abs().cmp(1),r=s.precision,n=s.rounding,-1!==e?0===e?((t=On(s,r+4,n).times(.5)).s=i.s,t):new s(NaN):(s.precision=r+6,s.rounding=1,i=i.div(new s(1).minus(i.times(i)).sqrt().plus(1)).atan(),s.precision=r,s.rounding=n,i.times(2)))},bn.inverseTangent=bn.atan=function(){var t,e,r,n,i,s,a,o,u,c=this,h=c.constructor,l=h.precision,f=h.rounding;if(c.isFinite()){if(c.isZero())return new h(c);if(c.abs().eq(1)&&l+4<=En)return(a=On(h,l+4,f).times(.25)).s=c.s,a}else{if(!c.s)return new h(NaN);if(l+4<=En)return(a=On(h,l+4,f).times(.5)).s=c.s,a}for(h.precision=o=l+10,h.rounding=1,t=r=Math.min(28,o/7+2|0);t;--t)c=c.div(c.times(c).plus(1).sqrt().plus(1));for(un=!1,e=Math.ceil(o/7),n=1,u=c.times(c),a=new h(c),i=c;-1!==t;)if(i=i.times(u),s=a.minus(i.div(n+=2)),i=i.times(u),void 0!==(a=s.plus(i.div(n+=2))).d[e])for(t=e;a.d[t]===s.d[t]&&t--;);return r&&(a=a.times(2<<r-1)),un=!0,In(a,h.precision=l,h.rounding=f,!0)},bn.isFinite=function(){return!!this.d},bn.isInteger=bn.isInt=function(){return!!this.d&&gn(this.e/7)>this.d.length-2},bn.isNaN=function(){return!this.s},bn.isNegative=bn.isNeg=function(){return this.s<0},bn.isPositive=bn.isPos=function(){return this.s>0},bn.isZero=function(){return!!this.d&&0===this.d[0]},bn.lessThan=bn.lt=function(t){return this.cmp(t)<0},bn.lessThanOrEqualTo=bn.lte=function(t){return this.cmp(t)<1},bn.logarithm=bn.log=function(t){var e,r,n,i,s,a,o,u,c=this,h=c.constructor,l=h.precision,f=h.rounding;if(null==t)t=new h(10),e=!0;else{if(r=(t=new h(t)).d,t.s<0||!r||!r[0]||t.eq(1))return new h(NaN);e=t.eq(10)}if(r=c.d,c.s<0||!r||!r[0]||c.eq(1))return new h(r&&!r[0]?-1/0:1!=c.s?NaN:r?0:1/0);if(e)if(r.length>1)s=!0;else{for(i=r[0];i%10==0;)i/=10;s=1!==i}if(un=!1,a=Vn(c,o=l+5),n=e?Nn(h,o+10):Vn(t,o),Cn((u=Pn(a,n,o,1)).d,i=l,f))do{if(a=Vn(c,o+=10),n=e?Nn(h,o+10):Vn(t,o),u=Pn(a,n,o,1),!s){+Fn(u.d).slice(i+1,i+15)+1==1e14&&(u=In(u,l+1,0));break}}while(Cn(u.d,i+=10,f));return un=!0,In(u,l,f)},bn.minus=bn.sub=function(t){var e,r,n,i,s,a,o,u,c,h,l,f,p=this,g=p.constructor;if(t=new g(t),!p.d||!t.d)return p.s&&t.s?p.d?t.s=-t.s:t=new g(t.d||p.s!==t.s?p:NaN):t=new g(NaN),t;if(p.s!=t.s)return t.s=-t.s,p.plus(t);if(c=p.d,f=t.d,o=g.precision,u=g.rounding,!c[0]||!f[0]){if(f[0])t.s=-t.s;else{if(!c[0])return new g(3===u?-0:0);t=new g(p)}return un?In(t,o,u):t}if(r=gn(t.e/7),h=gn(p.e/7),c=c.slice(),s=h-r){for((l=s<0)?(e=c,s=-s,a=f.length):(e=f,r=h,a=c.length),s>(n=Math.max(Math.ceil(o/7),a)+2)&&(s=n,e.length=1),e.reverse(),n=s;n--;)e.push(0);e.reverse()}else{for((l=(n=c.length)<(a=f.length))&&(a=n),n=0;n<a;n++)if(c[n]!=f[n]){l=c[n]<f[n];break}s=0}for(l&&(e=c,c=f,f=e,t.s=-t.s),a=c.length,n=f.length-a;n>0;--n)c[a++]=0;for(n=f.length;n>s;){if(c[--n]<f[n]){for(i=n;i&&0===c[--i];)c[i]=xn-1;--c[i],c[n]+=xn}c[n]-=f[n]}for(;0===c[--a];)c.pop();for(;0===c[0];c.shift())--r;return c[0]?(t.d=c,t.e=Tn(c,r),un?In(t,o,u):t):new g(3===u?-0:0)},bn.modulo=bn.mod=function(t){var e,r=this,n=r.constructor;return t=new n(t),!r.d||!t.s||t.d&&!t.d[0]?new n(NaN):!t.d||r.d&&!r.d[0]?In(new n(r),n.precision,n.rounding):(un=!1,9==n.modulo?(e=Pn(r,t.abs(),0,3,1)).s*=t.s:e=Pn(r,t,0,n.modulo,1),e=e.times(t),un=!0,r.minus(e))},bn.naturalExponential=bn.exp=function(){return Ln(this)},bn.naturalLogarithm=bn.ln=function(){return Vn(this)},bn.negated=bn.neg=function(){var t=new this.constructor(this);return t.s=-t.s,In(t)},bn.plus=bn.add=function(t){var e,r,n,i,s,a,o,u,c,h,l=this,f=l.constructor;if(t=new f(t),!l.d||!t.d)return l.s&&t.s?l.d||(t=new f(t.d||l.s===t.s?l:NaN)):t=new f(NaN),t;if(l.s!=t.s)return t.s=-t.s,l.minus(t);if(c=l.d,h=t.d,o=f.precision,u=f.rounding,!c[0]||!h[0])return h[0]||(t=new f(l)),un?In(t,o,u):t;if(s=gn(l.e/7),n=gn(t.e/7),c=c.slice(),i=s-n){for(i<0?(r=c,i=-i,a=h.length):(r=h,n=s,a=c.length),i>(a=(s=Math.ceil(o/7))>a?s+1:a+1)&&(i=a,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for((a=c.length)-(i=h.length)<0&&(i=a,r=h,h=c,c=r),e=0;i;)e=(c[--i]=c[i]+h[i]+e)/xn|0,c[i]%=xn;for(e&&(c.unshift(e),++n),a=c.length;0==c[--a];)c.pop();return t.d=c,t.e=Tn(c,n),un?In(t,o,u):t},bn.precision=bn.sd=function(t){var e,r=this;if(void 0!==t&&t!==!!t&&1!==t&&0!==t)throw Error(hn+t);return r.d?(e=Bn(r.d),t&&r.e+1>e&&(e=r.e+1)):e=NaN,e},bn.round=function(){var t=this,e=t.constructor;return In(new e(t),t.e+1,e.rounding)},bn.sine=bn.sin=function(){var t,e,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(t=n.precision,e=n.rounding,n.precision=t+Math.max(r.e,r.sd())+7,n.rounding=1,r=function(t,e){var r,n=e.d.length;if(n<3)return e.isZero()?e:Un(t,2,e,e);r=1.4*Math.sqrt(n),r=r>16?16:0|r,e=e.times(1/zn(5,r)),e=Un(t,2,e,e);for(var i,s=new t(5),a=new t(16),o=new t(20);r--;)i=e.times(e),e=e.times(s.plus(i.times(a.times(i).minus(o))));return e}(n,Wn(n,r)),n.precision=t,n.rounding=e,In(tn>2?r.neg():r,t,e,!0)):new n(NaN)},bn.squareRoot=bn.sqrt=function(){var t,e,r,n,i,s,a=this,o=a.d,u=a.e,c=a.s,h=a.constructor;if(1!==c||!o||!o[0])return new h(!c||c<0&&(!o||o[0])?NaN:o?a:1/0);for(un=!1,0==(c=Math.sqrt(+a))||c==1/0?(((e=Fn(o)).length+u)%2==0&&(e+="0"),c=Math.sqrt(e),u=gn((u+1)/2)-(u<0||u%2),n=new h(e=c==1/0?"5e"+u:(e=c.toExponential()).slice(0,e.indexOf("e")+1)+u)):n=new h(c.toString()),r=(u=h.precision)+3;;)if(n=(s=n).plus(Pn(a,s,r+2,1)).times(.5),Fn(s.d).slice(0,r)===(e=Fn(n.d)).slice(0,r)){if("9999"!=(e=e.slice(r-3,r+1))&&(i||"4999"!=e)){+e&&(+e.slice(1)||"5"!=e.charAt(0))||(In(n,u+1,1),t=!n.times(n).eq(a));break}if(!i&&(In(s,u+1,0),s.times(s).eq(a))){n=s;break}r+=4,i=1}return un=!0,In(n,u,h.rounding,t)},bn.tangent=bn.tan=function(){var t,e,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(t=n.precision,e=n.rounding,n.precision=t+10,n.rounding=1,(r=r.sin()).s=1,r=Pn(r,new n(1).minus(r.times(r)).sqrt(),t+10,0),n.precision=t,n.rounding=e,In(2==tn||4==tn?r.neg():r,t,e,!0)):new n(NaN)},bn.times=bn.mul=function(t){var e,r,n,i,s,a,o,u,c,h=this,l=h.constructor,f=h.d,p=(t=new l(t)).d;if(t.s*=h.s,!(f&&f[0]&&p&&p[0]))return new l(!t.s||f&&!f[0]&&!p||p&&!p[0]&&!f?NaN:f&&p?0*t.s:t.s/0);for(r=gn(h.e/7)+gn(t.e/7),(u=f.length)<(c=p.length)&&(s=f,f=p,p=s,a=u,u=c,c=a),s=[],n=a=u+c;n--;)s.push(0);for(n=c;--n>=0;){for(e=0,i=u+n;i>n;)o=s[i]+p[n]*f[i-n-1]+e,s[i--]=o%xn|0,e=o/xn|0;s[i]=(s[i]+e)%xn|0}for(;!s[--a];)s.pop();return e?++r:s.shift(),t.d=s,t.e=Tn(s,r),un?In(t,l.precision,l.rounding):t},bn.toBinary=function(t,e){return Gn(this,2,t,e)},bn.toDecimalPlaces=bn.toDP=function(t,e){var r=this,n=r.constructor;return r=new n(r),void 0===t?r:(An(t,0,rn),void 0===e?e=n.rounding:An(e,0,8),In(r,t+r.e+1,e))},bn.toExponential=function(t,e){var r,n=this,i=n.constructor;return void 0===t?r=Rn(n,!0):(An(t,0,rn),void 0===e?e=i.rounding:An(e,0,8),r=Rn(n=In(new i(n),t+1,e),!0,t+1)),n.isNeg()&&!n.isZero()?"-"+r:r},bn.toFixed=function(t,e){var r,n,i=this,s=i.constructor;return void 0===t?r=Rn(i):(An(t,0,rn),void 0===e?e=s.rounding:An(e,0,8),r=Rn(n=In(new s(i),t+i.e+1,e),!1,t+n.e+1)),i.isNeg()&&!i.isZero()?"-"+r:r},bn.toFraction=function(t){var e,r,n,i,s,a,o,u,c,h,l,f,p=this,g=p.d,d=p.constructor;if(!g)return new d(p);if(c=r=new d(1),n=u=new d(0),a=(s=(e=new d(n)).e=Bn(g)-p.e-1)%7,e.d[0]=dn(10,a<0?7+a:a),null==t)t=s>0?e:c;else{if(!(o=new d(t)).isInt()||o.lt(c))throw Error(hn+o);t=o.gt(e)?s>0?e:c:o}for(un=!1,o=new d(Fn(g)),h=d.precision,d.precision=s=7*g.length*2;l=Pn(o,e,0,1,1),1!=(i=r.plus(l.times(n))).cmp(t);)r=n,n=i,i=c,c=u.plus(l.times(i)),u=i,i=e,e=o.minus(l.times(i)),o=i;return i=Pn(t.minus(r),n,0,1,1),u=u.plus(i.times(c)),r=r.plus(i.times(n)),u.s=c.s=p.s,f=Pn(c,n,s,1).minus(p).abs().cmp(Pn(u,r,s,1).minus(p).abs())<1?[c,n]:[u,r],d.precision=h,un=!0,f},bn.toHexadecimal=bn.toHex=function(t,e){return Gn(this,16,t,e)},bn.toNearest=function(t,e){var r=this,n=r.constructor;if(r=new n(r),null==t){if(!r.d)return r;t=new n(1),e=n.rounding}else{if(t=new n(t),void 0===e?e=n.rounding:An(e,0,8),!r.d)return t.s?r:t;if(!t.d)return t.s&&(t.s=r.s),t}return t.d[0]?(un=!1,r=Pn(r,t,0,e,1).times(t),un=!0,In(r)):(t.s=r.s,r=t),r},bn.toNumber=function(){return+this},bn.toOctal=function(t,e){return Gn(this,8,t,e)},bn.toPower=bn.pow=function(t){var e,r,n,i,s,a,o=this,u=o.constructor,c=+(t=new u(t));if(!(o.d&&t.d&&o.d[0]&&t.d[0]))return new u(dn(+o,c));if((o=new u(o)).eq(1))return o;if(n=u.precision,s=u.rounding,t.eq(1))return In(o,n,s);if((e=gn(t.e/7))>=t.d.length-1&&(r=c<0?-c:c)<=9007199254740991)return i=jn(u,o,r,n),t.s<0?new u(1).div(i):In(i,n,s);if((a=o.s)<0){if(e<t.d.length-1)return new u(NaN);if(1&t.d[e]||(a=1),0==o.e&&1==o.d[0]&&1==o.d.length)return o.s=a,o}return(e=0!=(r=dn(+o,c))&&isFinite(r)?new u(r+"").e:gn(c*(Math.log("0."+Fn(o.d))/Math.LN10+o.e+1)))>u.maxE+1||e<u.minE-1?new u(e>0?a/0:0):(un=!1,u.rounding=o.s=1,r=Math.min(12,(e+"").length),(i=Ln(t.times(Vn(o,n+r)),n)).d&&Cn((i=In(i,n+5,1)).d,n,s)&&(e=n+10,+Fn((i=In(Ln(t.times(Vn(o,e+r)),e),e+5,1)).d).slice(n+1,n+15)+1==1e14&&(i=In(i,n+1,0))),i.s=a,un=!0,u.rounding=s,In(i,n,s))},bn.toPrecision=function(t,e){var r,n=this,i=n.constructor;return void 0===t?r=Rn(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(An(t,1,rn),void 0===e?e=i.rounding:An(e,0,8),r=Rn(n=In(new i(n),t,e),t<=n.e||n.e<=i.toExpNeg,t)),n.isNeg()&&!n.isZero()?"-"+r:r},bn.toSignificantDigits=bn.toSD=function(t,e){var r=this.constructor;return void 0===t?(t=r.precision,e=r.rounding):(An(t,1,rn),void 0===e?e=r.rounding:An(e,0,8)),In(new r(this),t,e)},bn.toString=function(){var t=this,e=t.constructor,r=Rn(t,t.e<=e.toExpNeg||t.e>=e.toExpPos);return t.isNeg()&&!t.isZero()?"-"+r:r},bn.truncated=bn.trunc=function(){return In(new this.constructor(this),this.e+1,1)},bn.valueOf=bn.toJSON=function(){var t=this,e=t.constructor,r=Rn(t,t.e<=e.toExpNeg||t.e>=e.toExpPos);return t.isNeg()?"-"+r:r};var Pn=function(){function t(t,e,r){var n,i=0,s=t.length;for(t=t.slice();s--;)n=t[s]*e+i,t[s]=n%r|0,i=n/r|0;return i&&t.unshift(i),t}function e(t,e,r,n){var i,s;if(r!=n)s=r>n?1:-1;else for(i=s=0;i<r;i++)if(t[i]!=e[i]){s=t[i]>e[i]?1:-1;break}return s}function r(t,e,r,n){for(var i=0;r--;)t[r]-=i,i=t[r]<e[r]?1:0,t[r]=i*n+t[r]-e[r];for(;!t[0]&&t.length>1;)t.shift()}return function(n,i,s,a,o,u){var c,h,l,f,p,g,d,v,m,y,w,x,S,E,b,F,A,C,D,P,I=n.constructor,R=n.s==i.s?1:-1,T=n.d,N=i.d;if(!(T&&T[0]&&N&&N[0]))return new I(n.s&&i.s&&(T?!N||T[0]!=N[0]:N)?T&&0==T[0]||!N?0*R:R/0:NaN);for(u?(p=1,h=n.e-i.e):(u=xn,p=7,h=gn(n.e/p)-gn(i.e/p)),D=N.length,A=T.length,y=(m=new I(R)).d=[],l=0;N[l]==(T[l]||0);l++);if(N[l]>(T[l]||0)&&h--,null==s?(E=s=I.precision,a=I.rounding):E=o?s+(n.e-i.e)+1:s,E<0)y.push(1),g=!0;else{if(E=E/p+2|0,l=0,1==D){for(f=0,N=N[0],E++;(l<A||f)&&E--;l++)b=f*u+(T[l]||0),y[l]=b/N|0,f=b%N|0;g=f||l<A}else{for((f=u/(N[0]+1)|0)>1&&(N=t(N,f,u),T=t(T,f,u),D=N.length,A=T.length),F=D,x=(w=T.slice(0,D)).length;x<D;)w[x++]=0;(P=N.slice()).unshift(0),C=N[0],N[1]>=u/2&&++C;do{f=0,(c=e(N,w,D,x))<0?(S=w[0],D!=x&&(S=S*u+(w[1]||0)),(f=S/C|0)>1?(f>=u&&(f=u-1),1==(c=e(d=t(N,f,u),w,v=d.length,x=w.length))&&(f--,r(d,D<v?P:N,v,u))):(0==f&&(c=f=1),d=N.slice()),(v=d.length)<x&&d.unshift(0),r(w,d,x,u),-1==c&&(c=e(N,w,D,x=w.length))<1&&(f++,r(w,D<x?P:N,x,u)),x=w.length):0===c&&(f++,w=[0]),y[l++]=f,c&&w[0]?w[x++]=T[F]||0:(w=[T[F]],x=1)}while((F++<A||void 0!==w[0])&&E--);g=void 0!==w[0]}y[0]||y.shift()}if(1==p)m.e=h,Qr=g;else{for(l=1,f=y[0];f>=10;f/=10)l++;m.e=l+h*p-1,In(m,o?s+m.e+1:s,a,g)}return m}}();function In(t,e,r,n){var i,s,a,o,u,c,h,l,f,p=t.constructor;t:if(null!=e){if(!(l=t.d))return t;for(i=1,o=l[0];o>=10;o/=10)i++;if((s=e-i)<0)s+=7,a=e,u=(h=l[f=0])/dn(10,i-a-1)%10|0;else if((f=Math.ceil((s+1)/7))>=(o=l.length)){if(!n)break t;for(;o++<=f;)l.push(0);h=u=0,i=1,a=(s%=7)-7+1}else{for(h=o=l[f],i=1;o>=10;o/=10)i++;u=(a=(s%=7)-7+i)<0?0:h/dn(10,i-a-1)%10|0}if(n=n||e<0||void 0!==l[f+1]||(a<0?h:h%dn(10,i-a-1)),c=r<4?(u||n)&&(0==r||r==(t.s<0?3:2)):u>5||5==u&&(4==r||n||6==r&&(s>0?a>0?h/dn(10,i-a):0:l[f-1])%10&1||r==(t.s<0?8:7)),e<1||!l[0])return l.length=0,c?(e-=t.e+1,l[0]=dn(10,(7-e%7)%7),t.e=-e||0):l[0]=t.e=0,t;if(0==s?(l.length=f,o=1,f--):(l.length=f+1,o=dn(10,7-s),l[f]=a>0?(h/dn(10,i-a)%dn(10,a)|0)*o:0),c)for(;;){if(0==f){for(s=1,a=l[0];a>=10;a/=10)s++;for(a=l[0]+=o,o=1;a>=10;a/=10)o++;s!=o&&(t.e++,l[0]==xn&&(l[0]=1));break}if(l[f]+=o,l[f]!=xn)break;l[f--]=0,o=1}for(s=l.length;0===l[--s];)l.pop()}return un&&(t.e>p.maxE?(t.d=null,t.e=NaN):t.e<p.minE&&(t.e=0,t.d=[0])),t}function Rn(t,e,r){if(!t.isFinite())return qn(t);var n,i=t.e,s=Fn(t.d),a=s.length;return e?(r&&(n=r-a)>0?s=s.charAt(0)+"."+s.slice(1)+_n(n):a>1&&(s=s.charAt(0)+"."+s.slice(1)),s=s+(t.e<0?"e":"e+")+t.e):i<0?(s="0."+_n(-i-1)+s,r&&(n=r-a)>0&&(s+=_n(n))):i>=a?(s+=_n(i+1-a),r&&(n=r-i-1)>0&&(s=s+"."+_n(n))):((n=i+1)<a&&(s=s.slice(0,n)+"."+s.slice(n)),r&&(n=r-a)>0&&(i+1===a&&(s+="."),s+=_n(n))),s}function Tn(t,e){var r=t[0];for(e*=7;r>=10;r/=10)e++;return e}function Nn(t,e,r){if(e>Sn)throw un=!0,r&&(t.precision=r),Error(ln);return In(new t(sn),e,1,!0)}function On(t,e,r){if(e>En)throw Error(ln);return In(new t(an),e,r,!0)}function Bn(t){var e=t.length-1,r=7*e+1;if(e=t[e]){for(;e%10==0;e/=10)r--;for(e=t[0];e>=10;e/=10)r++}return r}function _n(t){for(var e="";t--;)e+="0";return e}function jn(t,e,r,n){var i,s=new t(1),a=Math.ceil(n/7+4);for(un=!1;;){if(r%2&&$n((s=s.times(e)).d,a)&&(i=!0),0===(r=gn(r/2))){r=s.d.length-1,i&&0===s.d[r]&&++s.d[r];break}$n((e=e.times(e)).d,a)}return un=!0,s}function Hn(t){return 1&t.d[t.d.length-1]}function kn(t,e,r){for(var n,i,s=new t(e[0]),a=0;++a<e.length;){if(!(i=new t(e[a])).s){s=i;break}((n=s.cmp(i))===r||0===n&&s.s===r)&&(s=i)}return s}function Ln(t,e){var r,n,i,s,a,o,u,c=0,h=0,l=0,f=t.constructor,p=f.rounding,g=f.precision;if(!t.d||!t.d[0]||t.e>17)return new f(t.d?t.d[0]?t.s<0?0:1/0:1:t.s?t.s<0?0:t:NaN);for(null==e?(un=!1,u=g):u=e,o=new f(.03125);t.e>-2;)t=t.times(o),l+=5;for(u+=n=Math.log(dn(2,l))/Math.LN10*2+5|0,r=s=a=new f(1),f.precision=u;;){if(s=In(s.times(t),u,1),r=r.times(++h),Fn((o=a.plus(Pn(s,r,u,1))).d).slice(0,u)===Fn(a.d).slice(0,u)){for(i=l;i--;)a=In(a.times(a),u,1);if(null!=e)return f.precision=g,a;if(!(c<3&&Cn(a.d,u-n,p,c)))return In(a,f.precision=g,p,un=!0);f.precision=u+=10,r=s=o=new f(1),h=0,c++}a=o}}function Vn(t,e){var r,n,i,s,a,o,u,c,h,l,f,p=1,g=t,d=g.d,v=g.constructor,m=v.rounding,y=v.precision;if(g.s<0||!d||!d[0]||!g.e&&1==d[0]&&1==d.length)return new v(d&&!d[0]?-1/0:1!=g.s?NaN:d?0:g);if(null==e?(un=!1,h=y):h=e,v.precision=h+=10,n=(r=Fn(d)).charAt(0),!(Math.abs(s=g.e)<15e14))return c=Nn(v,h+2,y).times(s+""),g=Vn(new v(n+"."+r.slice(1)),h-10).plus(c),v.precision=y,null==e?In(g,y,m,un=!0):g;for(;n<7&&1!=n||1==n&&r.charAt(1)>3;)n=(r=Fn((g=g.times(t)).d)).charAt(0),p++;for(s=g.e,n>1?(g=new v("0."+r),s++):g=new v(n+"."+r.slice(1)),l=g,u=a=g=Pn(g.minus(1),g.plus(1),h,1),f=In(g.times(g),h,1),i=3;;){if(a=In(a.times(f),h,1),Fn((c=u.plus(Pn(a,new v(i),h,1))).d).slice(0,h)===Fn(u.d).slice(0,h)){if(u=u.times(2),0!==s&&(u=u.plus(Nn(v,h+2,y).times(s+""))),u=Pn(u,new v(p),h,1),null!=e)return v.precision=y,u;if(!Cn(u.d,h-10,m,o))return In(u,v.precision=y,m,un=!0);v.precision=h+=10,c=a=g=Pn(l.minus(1),l.plus(1),h,1),f=In(g.times(g),h,1),i=o=1}u=c,i+=2}}function qn(t){return String(t.s*t.s/0)}function Mn(t,e){var r,n,i;for((r=e.indexOf("."))>-1&&(e=e.replace(".","")),(n=e.search(/e/i))>0?(r<0&&(r=n),r+=+e.slice(n+1),e=e.substring(0,n)):r<0&&(r=e.length),n=0;48===e.charCodeAt(n);n++);for(i=e.length;48===e.charCodeAt(i-1);--i);if(e=e.slice(n,i)){if(i-=n,t.e=r=r-n-1,t.d=[],n=(r+1)%7,r<0&&(n+=7),n<i){for(n&&t.d.push(+e.slice(0,n)),i-=7;n<i;)t.d.push(+e.slice(n,n+=7));n=7-(e=e.slice(n)).length}else n-=i;for(;n--;)e+="0";t.d.push(+e),un&&(t.e>t.constructor.maxE?(t.d=null,t.e=NaN):t.e<t.constructor.minE&&(t.e=0,t.d=[0]))}else t.e=0,t.d=[0];return t}function Kn(t,e){var r,n,i,s,a,o,u,c,h;if(e.indexOf("_")>-1){if(e=e.replace(/(\d)_(?=\d)/g,"$1"),wn.test(e))return Mn(t,e)}else if("Infinity"===e||"NaN"===e)return+e||(t.s=NaN),t.e=NaN,t.d=null,t;if(mn.test(e))r=16,e=e.toLowerCase();else if(vn.test(e))r=2;else{if(!yn.test(e))throw Error(hn+e);r=8}for((s=e.search(/p/i))>0?(u=+e.slice(s+1),e=e.substring(2,s)):e=e.slice(2),a=(s=e.indexOf("."))>=0,n=t.constructor,a&&(s=(o=(e=e.replace(".","")).length)-s,i=jn(n,new n(r),s,2*s)),s=h=(c=Dn(e,r,xn)).length-1;0===c[s];--s)c.pop();return s<0?new n(0*t.s):(t.e=Tn(c,h),t.d=c,un=!1,a&&(t=Pn(t,i,4*o)),u&&(t=t.times(Math.abs(u)<54?dn(2,u):_i.pow(2,u))),un=!0,t)}function Un(t,e,r,n,i){var s,a,o,u,c=t.precision,h=Math.ceil(c/7);for(un=!1,u=r.times(r),o=new t(n);;){if(a=Pn(o.times(u),new t(e++*e++),c,1),o=i?n.plus(a):n.minus(a),n=Pn(a.times(u),new t(e++*e++),c,1),void 0!==(a=o.plus(n)).d[h]){for(s=h;a.d[s]===o.d[s]&&s--;);if(-1==s)break}s=o,o=n,n=a,a=s}return un=!0,a.d.length=h+1,a}function zn(t,e){for(var r=t;--e;)r*=t;return r}function Wn(t,e){var r,n=e.s<0,i=On(t,t.precision,1),s=i.times(.5);if((e=e.abs()).lte(s))return tn=n?4:1,e;if((r=e.divToInt(i)).isZero())tn=n?3:2;else{if((e=e.minus(r.times(i))).lte(s))return tn=Hn(r)?n?2:3:n?4:1,e;tn=Hn(r)?n?1:4:n?3:2}return e.minus(i).abs()}function Gn(t,e,r,n){var i,s,a,o,u,c,h,l,f,p=t.constructor,g=void 0!==r;if(g?(An(r,1,rn),void 0===n?n=p.rounding:An(n,0,8)):(r=p.precision,n=p.rounding),t.isFinite()){for(g?(i=2,16==e?r=4*r-3:8==e&&(r=3*r-2)):i=e,(a=(h=Rn(t)).indexOf("."))>=0&&(h=h.replace(".",""),(f=new p(1)).e=h.length-a,f.d=Dn(Rn(f),10,i),f.e=f.d.length),s=u=(l=Dn(h,10,i)).length;0==l[--u];)l.pop();if(l[0]){if(a<0?s--:((t=new p(t)).d=l,t.e=s,l=(t=Pn(t,f,r,n,0,i)).d,s=t.e,c=Qr),a=l[r],o=i/2,c=c||void 0!==l[r+1],c=n<4?(void 0!==a||c)&&(0===n||n===(t.s<0?3:2)):a>o||a===o&&(4===n||c||6===n&&1&l[r-1]||n===(t.s<0?8:7)),l.length=r,c)for(;++l[--r]>i-1;)l[r]=0,r||(++s,l.unshift(1));for(u=l.length;!l[u-1];--u);for(a=0,h="";a<u;a++)h+=nn.charAt(l[a]);if(g){if(u>1)if(16==e||8==e){for(a=16==e?4:3,--u;u%a;u++)h+="0";for(u=(l=Dn(h,i,e)).length;!l[u-1];--u);for(a=1,h="1.";a<u;a++)h+=nn.charAt(l[a])}else h=h.charAt(0)+"."+h.slice(1);h=h+(s<0?"p":"p+")+s}else if(s<0){for(;++s;)h="0"+h;h="0."+h}else if(++s>u)for(s-=u;s--;)h+="0";else s<u&&(h=h.slice(0,s)+"."+h.slice(s))}else h=g?"0p+0":"0";h=(16==e?"0x":2==e?"0b":8==e?"0o":"")+h}else h=qn(t);return t.s<0?"-"+h:h}function $n(t,e){if(t.length>e)return t.length=e,!0}function Jn(t){return new this(t).abs()}function Yn(t){return new this(t).acos()}function Xn(t){return new this(t).acosh()}function Zn(t,e){return new this(t).plus(e)}function Qn(t){return new this(t).asin()}function ti(t){return new this(t).asinh()}function ei(t){return new this(t).atan()}function ri(t){return new this(t).atanh()}function ni(t,e){t=new this(t),e=new this(e);var r,n=this.precision,i=this.rounding,s=n+4;return t.s&&e.s?t.d||e.d?!e.d||t.isZero()?(r=e.s<0?On(this,n,i):new this(0)).s=t.s:!t.d||e.isZero()?(r=On(this,s,1).times(.5)).s=t.s:e.s<0?(this.precision=s,this.rounding=1,r=this.atan(Pn(t,e,s,1)),e=On(this,s,1),this.precision=n,this.rounding=i,r=t.s<0?r.minus(e):r.plus(e)):r=this.atan(Pn(t,e,s,1)):(r=On(this,s,1).times(e.s>0?.25:.75)).s=t.s:r=new this(NaN),r}function ii(t){return new this(t).cbrt()}function si(t){return In(t=new this(t),t.e+1,2)}function ai(t,e,r){return new this(t).clamp(e,r)}function oi(t){if(!t||"object"!=typeof t)throw Error(cn+"Object expected");var e,r,n,i=!0===t.defaults,s=["precision",1,rn,"rounding",0,8,"toExpNeg",-en,0,"toExpPos",0,en,"maxE",0,en,"minE",-en,0,"modulo",0,9];for(e=0;e<s.length;e+=3)if(r=s[e],i&&(this[r]=on[r]),void 0!==(n=t[r])){if(!(gn(n)===n&&n>=s[e+1]&&n<=s[e+2]))throw Error(hn+r+": "+n);this[r]=n}if(r="crypto",i&&(this[r]=on[r]),void 0!==(n=t[r])){if(!0!==n&&!1!==n&&0!==n&&1!==n)throw Error(hn+r+": "+n);if(n){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw Error(fn);this[r]=!0}else this[r]=!1}return this}function ui(t){return new this(t).cos()}function ci(t){return new this(t).cosh()}function hi(t,e){return new this(t).div(e)}function li(t){return new this(t).exp()}function fi(t){return In(t=new this(t),t.e+1,3)}function pi(){var t,e,r=new this(0);for(un=!1,t=0;t<arguments.length;)if((e=new this(arguments[t++])).d)r.d&&(r=r.plus(e.times(e)));else{if(e.s)return un=!0,new this(1/0);r=e}return un=!0,r.sqrt()}function gi(t){return t instanceof _i||t&&t.toStringTag===pn||!1}function di(t){return new this(t).ln()}function vi(t,e){return new this(t).log(e)}function mi(t){return new this(t).log(2)}function yi(t){return new this(t).log(10)}function wi(){return kn(this,arguments,-1)}function xi(){return kn(this,arguments,1)}function Si(t,e){return new this(t).mod(e)}function Ei(t,e){return new this(t).mul(e)}function bi(t,e){return new this(t).pow(e)}function Fi(t){var e,r,n,i,s=0,a=new this(1),o=[];if(void 0===t?t=this.precision:An(t,1,rn),n=Math.ceil(t/7),this.crypto)if(crypto.getRandomValues)for(e=crypto.getRandomValues(new Uint32Array(n));s<n;)(i=e[s])>=429e7?e[s]=crypto.getRandomValues(new Uint32Array(1))[0]:o[s++]=i%1e7;else{if(!crypto.randomBytes)throw Error(fn);for(e=crypto.randomBytes(n*=4);s<n;)(i=e[s]+(e[s+1]<<8)+(e[s+2]<<16)+((127&e[s+3])<<24))>=214e7?crypto.randomBytes(4).copy(e,s):(o.push(i%1e7),s+=4);s=n/4}else for(;s<n;)o[s++]=1e7*Math.random()|0;for(t%=7,(n=o[--s])&&t&&(i=dn(10,7-t),o[s]=(n/i|0)*i);0===o[s];s--)o.pop();if(s<0)r=0,o=[0];else{for(r=-1;0===o[0];r-=7)o.shift();for(n=1,i=o[0];i>=10;i/=10)n++;n<7&&(r-=7-n)}return a.e=r,a.d=o,a}function Ai(t){return In(t=new this(t),t.e+1,this.rounding)}function Ci(t){return(t=new this(t)).d?t.d[0]?t.s:0*t.s:t.s||NaN}function Di(t){return new this(t).sin()}function Pi(t){return new this(t).sinh()}function Ii(t){return new this(t).sqrt()}function Ri(t,e){return new this(t).sub(e)}function Ti(){var t=0,e=arguments,r=new this(e[t]);for(un=!1;r.s&&++t<e.length;)r=r.plus(e[t]);return un=!0,In(r,this.precision,this.rounding)}function Ni(t){return new this(t).tan()}function Oi(t){return new this(t).tanh()}function Bi(t){return In(t=new this(t),t.e+1,1)}bn[Symbol.for("nodejs.util.inspect.custom")]=bn.toString,bn[Symbol.toStringTag]="Decimal";var _i=bn.constructor=function t(e){var r,n,i;function s(t){var e,r,n,i=this;if(!(i instanceof s))return new s(t);if(i.constructor=s,gi(t))return i.s=t.s,void(un?!t.d||t.e>s.maxE?(i.e=NaN,i.d=null):t.e<s.minE?(i.e=0,i.d=[0]):(i.e=t.e,i.d=t.d.slice()):(i.e=t.e,i.d=t.d?t.d.slice():t.d));if("number"===(n=typeof t)){if(0===t)return i.s=1/t<0?-1:1,i.e=0,void(i.d=[0]);if(t<0?(t=-t,i.s=-1):i.s=1,t===~~t&&t<1e7){for(e=0,r=t;r>=10;r/=10)e++;return void(un?e>s.maxE?(i.e=NaN,i.d=null):e<s.minE?(i.e=0,i.d=[0]):(i.e=e,i.d=[t]):(i.e=e,i.d=[t]))}return 0*t!=0?(t||(i.s=NaN),i.e=NaN,void(i.d=null)):Mn(i,t.toString())}if("string"===n)return 45===(r=t.charCodeAt(0))?(t=t.slice(1),i.s=-1):(43===r&&(t=t.slice(1)),i.s=1),wn.test(t)?Mn(i,t):Kn(i,t);if("bigint"===n)return t<0?(t=-t,i.s=-1):i.s=1,Mn(i,t.toString());throw Error(hn+t)}if(s.prototype=bn,s.ROUND_UP=0,s.ROUND_DOWN=1,s.ROUND_CEIL=2,s.ROUND_FLOOR=3,s.ROUND_HALF_UP=4,s.ROUND_HALF_DOWN=5,s.ROUND_HALF_EVEN=6,s.ROUND_HALF_CEIL=7,s.ROUND_HALF_FLOOR=8,s.EUCLID=9,s.config=s.set=oi,s.clone=t,s.isDecimal=gi,s.abs=Jn,s.acos=Yn,s.acosh=Xn,s.add=Zn,s.asin=Qn,s.asinh=ti,s.atan=ei,s.atanh=ri,s.atan2=ni,s.cbrt=ii,s.ceil=si,s.clamp=ai,s.cos=ui,s.cosh=ci,s.div=hi,s.exp=li,s.floor=fi,s.hypot=pi,s.ln=di,s.log=vi,s.log10=yi,s.log2=mi,s.max=wi,s.min=xi,s.mod=Si,s.mul=Ei,s.pow=bi,s.random=Fi,s.round=Ai,s.sign=Ci,s.sin=Di,s.sinh=Pi,s.sqrt=Ii,s.sub=Ri,s.sum=Ti,s.tan=Ni,s.tanh=Oi,s.trunc=Bi,void 0===e&&(e={}),e&&!0!==e.defaults)for(i=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],r=0;r<i.length;)e.hasOwnProperty(n=i[r++])||(e[n]=this[n]);return s.config(e),s}(on);sn=new _i(sn),an=new _i(an);var ji=_i;const Hi=ji.clone({precision:40,rounding:ji.ROUND_HALF_UP}),ki=t=>!0===t||1===t||"1"===t,Li=t=>"CNY"===String(t||"").trim().toUpperCase(),Vi=(t,e="数值")=>{const r=String(t??"").trim();if(""===r)return new Hi(0);if(!/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)$/.test(r))throw new Error(`${e}请输入有效数字`);const n=new Hi(r);if(!n.isFinite())throw new Error(`${e}请输入有效数字`);return n},qi=(t,e)=>t.toDecimalPlaces(e),Mi=(t,e)=>t.toDecimalPlaces(e),Ki=t=>{if(t.isZero())return Array(11).fill("");const e=t.abs().times(100).toFixed(0);if(e.length>11)throw new Error("金额超出当前凭证金额栏可显示范围");return e.padStart(11," ").split("").map(t=>" "===t?"":t)},Ui=(t,e)=>{["Backspace","Delete","Tab","Enter","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(t.key)||t.ctrlKey||t.metaKey||/^[0-9]$/.test(t.key)||"."!==t.key&&"-"!==t.key&&t.preventDefault()};function zi(t,e){return function(){return t.apply(e,arguments)}}const{toString:Wi}=Object.prototype,{getPrototypeOf:Gi}=Object,{iterator:$i,toStringTag:Ji}=Symbol,Yi=(Xi=Object.create(null),t=>{const e=Wi.call(t);return Xi[e]||(Xi[e]=e.slice(8,-1).toLowerCase())});var Xi;const Zi=t=>(t=t.toLowerCase(),e=>Yi(e)===t),Qi=t=>e=>typeof e===t,{isArray:ts}=Array,es=Qi("undefined");function rs(t){return null!==t&&!es(t)&&null!==t.constructor&&!es(t.constructor)&&ss(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const ns=Zi("ArrayBuffer");const is=Qi("string"),ss=Qi("function"),as=Qi("number"),os=t=>null!==t&&"object"==typeof t,us=t=>{if("object"!==Yi(t))return!1;const e=Gi(t);return!(null!==e&&e!==Object.prototype&&null!==Object.getPrototypeOf(e)||Ji in t||$i in t)},cs=Zi("Date"),hs=Zi("File"),ls=Zi("Blob"),fs=Zi("FileList"),ps=Zi("URLSearchParams"),[gs,ds,vs,ms]=["ReadableStream","Request","Response","Headers"].map(Zi);function ys(t,e,{allOwnKeys:r=!1}={}){if(null==t)return;let n,i;if("object"!=typeof t&&(t=[t]),ts(t))for(n=0,i=t.length;n<i;n++)e.call(null,t[n],n,t);else{if(rs(t))return;const i=r?Object.getOwnPropertyNames(t):Object.keys(t),s=i.length;let a;for(n=0;n<s;n++)a=i[n],e.call(null,t[a],a,t)}}function ws(t,e){if(rs(t))return null;e=e.toLowerCase();const r=Object.keys(t);let n,i=r.length;for(;i-- >0;)if(n=r[i],e===n.toLowerCase())return n;return null}const xs="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,Ss=t=>!es(t)&&t!==xs;const Es=(bs="undefined"!=typeof Uint8Array&&Gi(Uint8Array),t=>bs&&t instanceof bs);var bs;const Fs=Zi("HTMLFormElement"),As=(({hasOwnProperty:t})=>(e,r)=>t.call(e,r))(Object.prototype),Cs=Zi("RegExp"),Ds=(t,e)=>{const r=Object.getOwnPropertyDescriptors(t),n={};ys(r,(r,i)=>{let s;!1!==(s=e(r,i,t))&&(n[i]=s||r)}),Object.defineProperties(t,n)};const Ps=Zi("AsyncFunction"),Is=(Rs="function"==typeof setImmediate,Ts=ss(xs.postMessage),Rs?setImmediate:Ts?(Ns=`axios@${Math.random()}`,Os=[],xs.addEventListener("message",({source:t,data:e})=>{t===xs&&e===Ns&&Os.length&&Os.shift()()},!1),t=>{Os.push(t),xs.postMessage(Ns,"*")}):t=>setTimeout(t));var Rs,Ts,Ns,Os;const Bs="undefined"!=typeof queueMicrotask?queueMicrotask.bind(xs):"undefined"!=typeof process&&process.nextTick||Is;var _s={isArray:ts,isArrayBuffer:ns,isBuffer:rs,isFormData:t=>{let e;return t&&("function"==typeof FormData&&t instanceof FormData||ss(t.append)&&("formdata"===(e=Yi(t))||"object"===e&&ss(t.toString)&&"[object FormData]"===t.toString()))},isArrayBufferView:function(t){let e;return e="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&ns(t.buffer),e},isString:is,isNumber:as,isBoolean:t=>!0===t||!1===t,isObject:os,isPlainObject:us,isEmptyObject:t=>{if(!os(t)||rs(t))return!1;try{return 0===Object.keys(t).length&&Object.getPrototypeOf(t)===Object.prototype}catch(t){return!1}},isReadableStream:gs,isRequest:ds,isResponse:vs,isHeaders:ms,isUndefined:es,isDate:cs,isFile:hs,isBlob:ls,isRegExp:Cs,isFunction:ss,isStream:t=>os(t)&&ss(t.pipe),isURLSearchParams:ps,isTypedArray:Es,isFileList:fs,forEach:ys,merge:function t(){const{caseless:e}=Ss(this)&&this||{},r={},n=(n,i)=>{const s=e&&ws(r,i)||i;us(r[s])&&us(n)?r[s]=t(r[s],n):us(n)?r[s]=t({},n):ts(n)?r[s]=n.slice():r[s]=n};for(let t=0,e=arguments.length;t<e;t++)arguments[t]&&ys(arguments[t],n);return r},extend:(t,e,r,{allOwnKeys:n}={})=>(ys(e,(e,n)=>{r&&ss(e)?t[n]=zi(e,r):t[n]=e},{allOwnKeys:n}),t),trim:t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:t=>(65279===t.charCodeAt(0)&&(t=t.slice(1)),t),inherits:(t,e,r,n)=>{t.prototype=Object.create(e.prototype,n),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),r&&Object.assign(t.prototype,r)},toFlatObject:(t,e,r,n)=>{let i,s,a;const o={};if(e=e||{},null==t)return e;do{for(i=Object.getOwnPropertyNames(t),s=i.length;s-- >0;)a=i[s],n&&!n(a,t,e)||o[a]||(e[a]=t[a],o[a]=!0);t=!1!==r&&Gi(t)}while(t&&(!r||r(t,e))&&t!==Object.prototype);return e},kindOf:Yi,kindOfTest:Zi,endsWith:(t,e,r)=>{t=String(t),(void 0===r||r>t.length)&&(r=t.length),r-=e.length;const n=t.indexOf(e,r);return-1!==n&&n===r},toArray:t=>{if(!t)return null;if(ts(t))return t;let e=t.length;if(!as(e))return null;const r=new Array(e);for(;e-- >0;)r[e]=t[e];return r},forEachEntry:(t,e)=>{const r=(t&&t[$i]).call(t);let n;for(;(n=r.next())&&!n.done;){const r=n.value;e.call(t,r[0],r[1])}},matchAll:(t,e)=>{let r;const n=[];for(;null!==(r=t.exec(e));)n.push(r);return n},isHTMLForm:Fs,hasOwnProperty:As,hasOwnProp:As,reduceDescriptors:Ds,freezeMethods:t=>{Ds(t,(e,r)=>{if(ss(t)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;const n=t[r];ss(n)&&(e.enumerable=!1,"writable"in e?e.writable=!1:e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")}))})},toObjectSet:(t,e)=>{const r={},n=t=>{t.forEach(t=>{r[t]=!0})};return ts(t)?n(t):n(String(t).split(e)),r},toCamelCase:t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,e,r){return e.toUpperCase()+r}),noop:()=>{},toFiniteNumber:(t,e)=>null!=t&&Number.isFinite(t=+t)?t:e,findKey:ws,global:xs,isContextDefined:Ss,isSpecCompliantForm:function(t){return!!(t&&ss(t.append)&&"FormData"===t[Ji]&&t[$i])},toJSONObject:t=>{const e=new Array(10),r=(t,n)=>{if(os(t)){if(e.indexOf(t)>=0)return;if(rs(t))return t;if(!("toJSON"in t)){e[n]=t;const i=ts(t)?[]:{};return ys(t,(t,e)=>{const s=r(t,n+1);!es(s)&&(i[e]=s)}),e[n]=void 0,i}}return t};return r(t,0)},isAsyncFn:Ps,isThenable:t=>t&&(os(t)||ss(t))&&ss(t.then)&&ss(t.catch),setImmediate:Is,asap:Bs,isIterable:t=>null!=t&&ss(t[$i])};function js(t,e,r,n,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=t,this.name="AxiosError",e&&(this.code=e),r&&(this.config=r),n&&(this.request=n),i&&(this.response=i,this.status=i.status?i.status:null)}_s.inherits(js,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:_s.toJSONObject(this.config),code:this.code,status:this.status}}});const Hs=js.prototype,ks={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{ks[t]={value:t}}),Object.defineProperties(js,ks),Object.defineProperty(Hs,"isAxiosError",{value:!0}),js.from=(t,e,r,n,i,s)=>{const a=Object.create(Hs);return _s.toFlatObject(t,a,function(t){return t!==Error.prototype},t=>"isAxiosError"!==t),js.call(a,t.message,e,r,n,i),a.cause=t,a.name=t.name,s&&Object.assign(a,s),a};function Ls(t){return _s.isPlainObject(t)||_s.isArray(t)}function Vs(t){return _s.endsWith(t,"[]")?t.slice(0,-2):t}function qs(t,e,r){return t?t.concat(e).map(function(t,e){return t=Vs(t),!r&&e?"["+t+"]":t}).join(r?".":""):e}const Ms=_s.toFlatObject(_s,{},null,function(t){return/^is[A-Z]/.test(t)});function Ks(t,e,r){if(!_s.isObject(t))throw new TypeError("target must be an object");e=e||new FormData;const n=(r=_s.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(t,e){return!_s.isUndefined(e[t])})).metaTokens,i=r.visitor||c,s=r.dots,a=r.indexes,o=(r.Blob||"undefined"!=typeof Blob&&Blob)&&_s.isSpecCompliantForm(e);if(!_s.isFunction(i))throw new TypeError("visitor must be a function");function u(t){if(null===t)return"";if(_s.isDate(t))return t.toISOString();if(_s.isBoolean(t))return t.toString();if(!o&&_s.isBlob(t))throw new js("Blob is not supported. Use a Buffer instead.");return _s.isArrayBuffer(t)||_s.isTypedArray(t)?o&&"function"==typeof Blob?new Blob([t]):Buffer.from(t):t}function c(t,r,i){let o=t;if(t&&!i&&"object"==typeof t)if(_s.endsWith(r,"{}"))r=n?r:r.slice(0,-2),t=JSON.stringify(t);else if(_s.isArray(t)&&function(t){return _s.isArray(t)&&!t.some(Ls)}(t)||(_s.isFileList(t)||_s.endsWith(r,"[]"))&&(o=_s.toArray(t)))return r=Vs(r),o.forEach(function(t,n){!_s.isUndefined(t)&&null!==t&&e.append(!0===a?qs([r],n,s):null===a?r:r+"[]",u(t))}),!1;return!!Ls(t)||(e.append(qs(i,r,s),u(t)),!1)}const h=[],l=Object.assign(Ms,{defaultVisitor:c,convertValue:u,isVisitable:Ls});if(!_s.isObject(t))throw new TypeError("data must be an object");return function t(r,n){if(!_s.isUndefined(r)){if(-1!==h.indexOf(r))throw Error("Circular reference detected in "+n.join("."));h.push(r),_s.forEach(r,function(r,s){!0===(!(_s.isUndefined(r)||null===r)&&i.call(e,r,_s.isString(s)?s.trim():s,n,l))&&t(r,n?n.concat(s):[s])}),h.pop()}}(t),e}function Us(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(t){return e[t]})}function zs(t,e){this._pairs=[],t&&Ks(t,this,e)}const Ws=zs.prototype;function Gs(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function $s(t,e,r){if(!e)return t;const n=r&&r.encode||Gs;_s.isFunction(r)&&(r={serialize:r});const i=r&&r.serialize;let s;if(s=i?i(e,r):_s.isURLSearchParams(e)?e.toString():new zs(e,r).toString(n),s){const e=t.indexOf("#");-1!==e&&(t=t.slice(0,e)),t+=(-1===t.indexOf("?")?"?":"&")+s}return t}Ws.append=function(t,e){this._pairs.push([t,e])},Ws.toString=function(t){const e=t?function(e){return t.call(this,e,Us)}:Us;return this._pairs.map(function(t){return e(t[0])+"="+e(t[1])},"").join("&")};var Js=class{constructor(){this.handlers=[]}use(t,e,r){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){_s.forEach(this.handlers,function(e){null!==e&&t(e)})}},Ys={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Xs={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:zs,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const Zs="undefined"!=typeof window&&"undefined"!=typeof document,Qs="object"==typeof navigator&&navigator||void 0,ta=Zs&&(!Qs||["ReactNative","NativeScript","NS"].indexOf(Qs.product)<0),ea="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,ra=Zs&&window.location.href||"http://localhost";var na={...Object.freeze({__proto__:null,hasBrowserEnv:Zs,hasStandardBrowserEnv:ta,hasStandardBrowserWebWorkerEnv:ea,navigator:Qs,origin:ra}),...Xs};function ia(t){function e(t,r,n,i){let s=t[i++];if("__proto__"===s)return!0;const a=Number.isFinite(+s),o=i>=t.length;if(s=!s&&_s.isArray(n)?n.length:s,o)return _s.hasOwnProp(n,s)?n[s]=[n[s],r]:n[s]=r,!a;n[s]&&_s.isObject(n[s])||(n[s]=[]);return e(t,r,n[s],i)&&_s.isArray(n[s])&&(n[s]=function(t){const e={},r=Object.keys(t);let n;const i=r.length;let s;for(n=0;n<i;n++)s=r[n],e[s]=t[s];return e}(n[s])),!a}if(_s.isFormData(t)&&_s.isFunction(t.entries)){const r={};return _s.forEachEntry(t,(t,n)=>{e(function(t){return _s.matchAll(/\w+|\[(\w*)]/g,t).map(t=>"[]"===t[0]?"":t[1]||t[0])}(t),n,r,0)}),r}return null}const sa={transitional:Ys,adapter:["xhr","http","fetch"],transformRequest:[function(t,e){const r=e.getContentType()||"",n=r.indexOf("application/json")>-1,i=_s.isObject(t);i&&_s.isHTMLForm(t)&&(t=new FormData(t));if(_s.isFormData(t))return n?JSON.stringify(ia(t)):t;if(_s.isArrayBuffer(t)||_s.isBuffer(t)||_s.isStream(t)||_s.isFile(t)||_s.isBlob(t)||_s.isReadableStream(t))return t;if(_s.isArrayBufferView(t))return t.buffer;if(_s.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let s;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(t,e){return Ks(t,new na.classes.URLSearchParams,{visitor:function(t,e,r,n){return na.isNode&&_s.isBuffer(t)?(this.append(e,t.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)},...e})}(t,this.formSerializer).toString();if((s=_s.isFileList(t))||r.indexOf("multipart/form-data")>-1){const e=this.env&&this.env.FormData;return Ks(s?{"files[]":t}:t,e&&new e,this.formSerializer)}}return i||n?(e.setContentType("application/json",!1),function(t,e,r){if(_s.isString(t))try{return(e||JSON.parse)(t),_s.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(r||JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){const e=this.transitional||sa.transitional,r=e&&e.forcedJSONParsing,n="json"===this.responseType;if(_s.isResponse(t)||_s.isReadableStream(t))return t;if(t&&_s.isString(t)&&(r&&!this.responseType||n)){const r=!(e&&e.silentJSONParsing)&&n;try{return JSON.parse(t)}catch(t){if(r){if("SyntaxError"===t.name)throw js.from(t,js.ERR_BAD_RESPONSE,this,null,this.response);throw t}}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:na.classes.FormData,Blob:na.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};_s.forEach(["delete","get","head","post","put","patch"],t=>{sa.headers[t]={}});var aa=sa;const oa=_s.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);const ua=Symbol("internals");function ca(t){return t&&String(t).trim().toLowerCase()}function ha(t){return!1===t||null==t?t:_s.isArray(t)?t.map(ha):String(t)}function la(t,e,r,n,i){return _s.isFunction(n)?n.call(this,e,r):(i&&(e=r),_s.isString(e)?_s.isString(n)?-1!==e.indexOf(n):_s.isRegExp(n)?n.test(e):void 0:void 0)}class fa{constructor(t){t&&this.set(t)}set(t,e,r){const n=this;function i(t,e,r){const i=ca(e);if(!i)throw new Error("header name must be a non-empty string");const s=_s.findKey(n,i);(!s||void 0===n[s]||!0===r||void 0===r&&!1!==n[s])&&(n[s||e]=ha(t))}const s=(t,e)=>_s.forEach(t,(t,r)=>i(t,r,e));if(_s.isPlainObject(t)||t instanceof this.constructor)s(t,e);else if(_s.isString(t)&&(t=t.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim()))s((t=>{const e={};let r,n,i;return t&&t.split("\n").forEach(function(t){i=t.indexOf(":"),r=t.substring(0,i).trim().toLowerCase(),n=t.substring(i+1).trim(),!r||e[r]&&oa[r]||("set-cookie"===r?e[r]?e[r].push(n):e[r]=[n]:e[r]=e[r]?e[r]+", "+n:n)}),e})(t),e);else if(_s.isObject(t)&&_s.isIterable(t)){let r,n,i={};for(const e of t){if(!_s.isArray(e))throw TypeError("Object iterator must return a key-value pair");i[n=e[0]]=(r=i[n])?_s.isArray(r)?[...r,e[1]]:[r,e[1]]:e[1]}s(i,e)}else null!=t&&i(e,t,r);return this}get(t,e){if(t=ca(t)){const r=_s.findKey(this,t);if(r){const t=this[r];if(!e)return t;if(!0===e)return function(t){const e=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(t);)e[n[1]]=n[2];return e}(t);if(_s.isFunction(e))return e.call(this,t,r);if(_s.isRegExp(e))return e.exec(t);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=ca(t)){const r=_s.findKey(this,t);return!(!r||void 0===this[r]||e&&!la(0,this[r],r,e))}return!1}delete(t,e){const r=this;let n=!1;function i(t){if(t=ca(t)){const i=_s.findKey(r,t);!i||e&&!la(0,r[i],i,e)||(delete r[i],n=!0)}}return _s.isArray(t)?t.forEach(i):i(t),n}clear(t){const e=Object.keys(this);let r=e.length,n=!1;for(;r--;){const i=e[r];t&&!la(0,this[i],i,t,!0)||(delete this[i],n=!0)}return n}normalize(t){const e=this,r={};return _s.forEach(this,(n,i)=>{const s=_s.findKey(r,i);if(s)return e[s]=ha(n),void delete e[i];const a=t?function(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,e,r)=>e.toUpperCase()+r)}(i):String(i).trim();a!==i&&delete e[i],e[a]=ha(n),r[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);return _s.forEach(this,(r,n)=>{null!=r&&!1!==r&&(e[n]=t&&_s.isArray(r)?r.join(", "):r)}),e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,e])=>t+": "+e).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const r=new this(t);return e.forEach(t=>r.set(t)),r}static accessor(t){const e=(this[ua]=this[ua]={accessors:{}}).accessors,r=this.prototype;function n(t){const n=ca(t);e[n]||(!function(t,e){const r=_s.toCamelCase(" "+e);["get","set","has"].forEach(n=>{Object.defineProperty(t,n+r,{value:function(t,r,i){return this[n].call(this,e,t,r,i)},configurable:!0})})}(r,t),e[n]=!0)}return _s.isArray(t)?t.forEach(n):n(t),this}}fa.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),_s.reduceDescriptors(fa.prototype,({value:t},e)=>{let r=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(t){this[r]=t}}}),_s.freezeMethods(fa);var pa=fa;function ga(t,e){const r=this||aa,n=e||r,i=pa.from(n.headers);let s=n.data;return _s.forEach(t,function(t){s=t.call(r,s,i.normalize(),e?e.status:void 0)}),i.normalize(),s}function da(t){return!(!t||!t.__CANCEL__)}function va(t,e,r){js.call(this,null==t?"canceled":t,js.ERR_CANCELED,e,r),this.name="CanceledError"}function ma(t,e,r){const n=r.config.validateStatus;r.status&&n&&!n(r.status)?e(new js("Request failed with status code "+r.status,[js.ERR_BAD_REQUEST,js.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):t(r)}_s.inherits(va,js,{__CANCEL__:!0});const ya=(t,e,r=3)=>{let n=0;const i=function(t,e){t=t||10;const r=new Array(t),n=new Array(t);let i,s=0,a=0;return e=void 0!==e?e:1e3,function(o){const u=Date.now(),c=n[a];i||(i=u),r[s]=o,n[s]=u;let h=a,l=0;for(;h!==s;)l+=r[h++],h%=t;if(s=(s+1)%t,s===a&&(a=(a+1)%t),u-i<e)return;const f=c&&u-c;return f?Math.round(1e3*l/f):void 0}}(50,250);return function(t,e){let r,n,i=0,s=1e3/e;const a=(e,s=Date.now())=>{i=s,r=null,n&&(clearTimeout(n),n=null),t(...e)};return[(...t)=>{const e=Date.now(),o=e-i;o>=s?a(t,e):(r=t,n||(n=setTimeout(()=>{n=null,a(r)},s-o)))},()=>r&&a(r)]}(r=>{const s=r.loaded,a=r.lengthComputable?r.total:void 0,o=s-n,u=i(o);n=s;t({loaded:s,total:a,progress:a?s/a:void 0,bytes:o,rate:u||void 0,estimated:u&&a&&s<=a?(a-s)/u:void 0,event:r,lengthComputable:null!=a,[e?"download":"upload"]:!0})},r)},wa=(t,e)=>{const r=null!=t;return[n=>e[0]({lengthComputable:r,total:t,loaded:n}),e[1]]},xa=t=>(...e)=>_s.asap(()=>t(...e));var Sa=na.hasStandardBrowserEnv?((t,e)=>r=>(r=new URL(r,na.origin),t.protocol===r.protocol&&t.host===r.host&&(e||t.port===r.port)))(new URL(na.origin),na.navigator&&/(msie|trident)/i.test(na.navigator.userAgent)):()=>!0,Ea=na.hasStandardBrowserEnv?{write(t,e,r,n,i,s){const a=[t+"="+encodeURIComponent(e)];_s.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),_s.isString(n)&&a.push("path="+n),_s.isString(i)&&a.push("domain="+i),!0===s&&a.push("secure"),document.cookie=a.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function ba(t,e,r){let n=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);return t&&(n||0==r)?function(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}(t,e):e}const Fa=t=>t instanceof pa?{...t}:t;function Aa(t,e){e=e||{};const r={};function n(t,e,r,n){return _s.isPlainObject(t)&&_s.isPlainObject(e)?_s.merge.call({caseless:n},t,e):_s.isPlainObject(e)?_s.merge({},e):_s.isArray(e)?e.slice():e}function i(t,e,r,i){return _s.isUndefined(e)?_s.isUndefined(t)?void 0:n(void 0,t,0,i):n(t,e,0,i)}function s(t,e){if(!_s.isUndefined(e))return n(void 0,e)}function a(t,e){return _s.isUndefined(e)?_s.isUndefined(t)?void 0:n(void 0,t):n(void 0,e)}function o(r,i,s){return s in e?n(r,i):s in t?n(void 0,r):void 0}const u={url:s,method:s,data:s,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:o,headers:(t,e,r)=>i(Fa(t),Fa(e),0,!0)};return _s.forEach(Object.keys({...t,...e}),function(n){const s=u[n]||i,a=s(t[n],e[n],n);_s.isUndefined(a)&&s!==o||(r[n]=a)}),r}var Ca=t=>{const e=Aa({},t);let r,{data:n,withXSRFToken:i,xsrfHeaderName:s,xsrfCookieName:a,headers:o,auth:u}=e;if(e.headers=o=pa.from(o),e.url=$s(ba(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),u&&o.set("Authorization","Basic "+btoa((u.username||"")+":"+(u.password?unescape(encodeURIComponent(u.password)):""))),_s.isFormData(n))if(na.hasStandardBrowserEnv||na.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if(!1!==(r=o.getContentType())){const[t,...e]=r?r.split(";").map(t=>t.trim()).filter(Boolean):[];o.setContentType([t||"multipart/form-data",...e].join("; "))}if(na.hasStandardBrowserEnv&&(i&&_s.isFunction(i)&&(i=i(e)),i||!1!==i&&Sa(e.url))){const t=s&&a&&Ea.read(a);t&&o.set(s,t)}return e};var Da="undefined"!=typeof XMLHttpRequest&&function(t){return new Promise(function(e,r){const n=Ca(t);let i=n.data;const s=pa.from(n.headers).normalize();let a,o,u,c,h,{responseType:l,onUploadProgress:f,onDownloadProgress:p}=n;function g(){c&&c(),h&&h(),n.cancelToken&&n.cancelToken.unsubscribe(a),n.signal&&n.signal.removeEventListener("abort",a)}let d=new XMLHttpRequest;function v(){if(!d)return;const n=pa.from("getAllResponseHeaders"in d&&d.getAllResponseHeaders());ma(function(t){e(t),g()},function(t){r(t),g()},{data:l&&"text"!==l&&"json"!==l?d.response:d.responseText,status:d.status,statusText:d.statusText,headers:n,config:t,request:d}),d=null}d.open(n.method.toUpperCase(),n.url,!0),d.timeout=n.timeout,"onloadend"in d?d.onloadend=v:d.onreadystatechange=function(){d&&4===d.readyState&&(0!==d.status||d.responseURL&&0===d.responseURL.indexOf("file:"))&&setTimeout(v)},d.onabort=function(){d&&(r(new js("Request aborted",js.ECONNABORTED,t,d)),d=null)},d.onerror=function(){r(new js("Network Error",js.ERR_NETWORK,t,d)),d=null},d.ontimeout=function(){let e=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded";const i=n.transitional||Ys;n.timeoutErrorMessage&&(e=n.timeoutErrorMessage),r(new js(e,i.clarifyTimeoutError?js.ETIMEDOUT:js.ECONNABORTED,t,d)),d=null},void 0===i&&s.setContentType(null),"setRequestHeader"in d&&_s.forEach(s.toJSON(),function(t,e){d.setRequestHeader(e,t)}),_s.isUndefined(n.withCredentials)||(d.withCredentials=!!n.withCredentials),l&&"json"!==l&&(d.responseType=n.responseType),p&&([u,h]=ya(p,!0),d.addEventListener("progress",u)),f&&d.upload&&([o,c]=ya(f),d.upload.addEventListener("progress",o),d.upload.addEventListener("loadend",c)),(n.cancelToken||n.signal)&&(a=e=>{d&&(r(!e||e.type?new va(null,t,d):e),d.abort(),d=null)},n.cancelToken&&n.cancelToken.subscribe(a),n.signal&&(n.signal.aborted?a():n.signal.addEventListener("abort",a)));const m=function(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}(n.url);m&&-1===na.protocols.indexOf(m)?r(new js("Unsupported protocol "+m+":",js.ERR_BAD_REQUEST,t)):d.send(i||null)})};var Pa=(t,e)=>{const{length:r}=t=t?t.filter(Boolean):[];if(e||r){let r,n=new AbortController;const i=function(t){if(!r){r=!0,a();const e=t instanceof Error?t:this.reason;n.abort(e instanceof js?e:new va(e instanceof Error?e.message:e))}};let s=e&&setTimeout(()=>{s=null,i(new js(`timeout ${e} of ms exceeded`,js.ETIMEDOUT))},e);const a=()=>{t&&(s&&clearTimeout(s),s=null,t.forEach(t=>{t.unsubscribe?t.unsubscribe(i):t.removeEventListener("abort",i)}),t=null)};t.forEach(t=>t.addEventListener("abort",i));const{signal:o}=n;return o.unsubscribe=()=>_s.asap(a),o}};const Ia=function*(t,e){let r=t.byteLength;if(!e||r<e)return void(yield t);let n,i=0;for(;i<r;)n=i+e,yield t.slice(i,n),i=n},Ra=async function*(t){if(t[Symbol.asyncIterator])return void(yield*t);const e=t.getReader();try{for(;;){const{done:t,value:r}=await e.read();if(t)break;yield r}}finally{await e.cancel()}},Ta=(t,e,r,n)=>{const i=async function*(t,e){for await(const r of Ra(t))yield*Ia(r,e)}(t,e);let s,a=0,o=t=>{s||(s=!0,n&&n(t))};return new ReadableStream({async pull(t){try{const{done:e,value:n}=await i.next();if(e)return o(),void t.close();let s=n.byteLength;if(r){let t=a+=s;r(t)}t.enqueue(new Uint8Array(n))}catch(t){throw o(t),t}},cancel:t=>(o(t),i.return())},{highWaterMark:2})},Na="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,Oa=Na&&"function"==typeof ReadableStream,Ba=Na&&("function"==typeof TextEncoder?(_a=new TextEncoder,t=>_a.encode(t)):async t=>new Uint8Array(await new Response(t).arrayBuffer()));var _a;const ja=(t,...e)=>{try{return!!t(...e)}catch(t){return!1}},Ha=Oa&&ja(()=>{let t=!1;const e=new Request(na.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e}),ka=Oa&&ja(()=>_s.isReadableStream(new Response("").body)),La={stream:ka&&(t=>t.body)};var Va;Na&&(Va=new Response,["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!La[t]&&(La[t]=_s.isFunction(Va[t])?e=>e[t]():(e,r)=>{throw new js(`Response type '${t}' is not supported`,js.ERR_NOT_SUPPORT,r)})}));const qa=async(t,e)=>{const r=_s.toFiniteNumber(t.getContentLength());return null==r?(async t=>{if(null==t)return 0;if(_s.isBlob(t))return t.size;if(_s.isSpecCompliantForm(t)){const e=new Request(na.origin,{method:"POST",body:t});return(await e.arrayBuffer()).byteLength}return _s.isArrayBufferView(t)||_s.isArrayBuffer(t)?t.byteLength:(_s.isURLSearchParams(t)&&(t+=""),_s.isString(t)?(await Ba(t)).byteLength:void 0)})(e):r};var Ma=Na&&(async t=>{let{url:e,method:r,data:n,signal:i,cancelToken:s,timeout:a,onDownloadProgress:o,onUploadProgress:u,responseType:c,headers:h,withCredentials:l="same-origin",fetchOptions:f}=Ca(t);c=c?(c+"").toLowerCase():"text";let p,g=Pa([i,s&&s.toAbortSignal()],a);const d=g&&g.unsubscribe&&(()=>{g.unsubscribe()});let v;try{if(u&&Ha&&"get"!==r&&"head"!==r&&0!==(v=await qa(h,n))){let t,r=new Request(e,{method:"POST",body:n,duplex:"half"});if(_s.isFormData(n)&&(t=r.headers.get("content-type"))&&h.setContentType(t),r.body){const[t,e]=wa(v,ya(xa(u)));n=Ta(r.body,65536,t,e)}}_s.isString(l)||(l=l?"include":"omit");const i="credentials"in Request.prototype;p=new Request(e,{...f,signal:g,method:r.toUpperCase(),headers:h.normalize().toJSON(),body:n,duplex:"half",credentials:i?l:void 0});let s=await fetch(p,f);const a=ka&&("stream"===c||"response"===c);if(ka&&(o||a&&d)){const t={};["status","statusText","headers"].forEach(e=>{t[e]=s[e]});const e=_s.toFiniteNumber(s.headers.get("content-length")),[r,n]=o&&wa(e,ya(xa(o),!0))||[];s=new Response(Ta(s.body,65536,r,()=>{n&&n(),d&&d()}),t)}c=c||"text";let m=await La[_s.findKey(La,c)||"text"](s,t);return!a&&d&&d(),await new Promise((e,r)=>{ma(e,r,{data:m,headers:pa.from(s.headers),status:s.status,statusText:s.statusText,config:t,request:p})})}catch(e){if(d&&d(),e&&"TypeError"===e.name&&/Load failed|fetch/i.test(e.message))throw Object.assign(new js("Network Error",js.ERR_NETWORK,t,p),{cause:e.cause||e});throw js.from(e,e&&e.code,t,p)}});const Ka={http:null,xhr:Da,fetch:Ma};_s.forEach(Ka,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch(t){}Object.defineProperty(t,"adapterName",{value:e})}});const Ua=t=>`- ${t}`,za=t=>_s.isFunction(t)||null===t||!1===t;var Wa=t=>{t=_s.isArray(t)?t:[t];const{length:e}=t;let r,n;const i={};for(let s=0;s<e;s++){let e;if(r=t[s],n=r,!za(r)&&(n=Ka[(e=String(r)).toLowerCase()],void 0===n))throw new js(`Unknown adapter '${e}'`);if(n)break;i[e||"#"+s]=n}if(!n){const t=Object.entries(i).map(([t,e])=>`adapter ${t} `+(!1===e?"is not supported by the environment":"is not available in the build"));throw new js("There is no suitable adapter to dispatch the request "+(e?t.length>1?"since :\n"+t.map(Ua).join("\n"):" "+Ua(t[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return n};function Ga(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new va(null,t)}function $a(t){Ga(t),t.headers=pa.from(t.headers),t.data=ga.call(t,t.transformRequest),-1!==["post","put","patch"].indexOf(t.method)&&t.headers.setContentType("application/x-www-form-urlencoded",!1);return Wa(t.adapter||aa.adapter)(t).then(function(e){return Ga(t),e.data=ga.call(t,t.transformResponse,e),e.headers=pa.from(e.headers),e},function(e){return da(e)||(Ga(t),e&&e.response&&(e.response.data=ga.call(t,t.transformResponse,e.response),e.response.headers=pa.from(e.response.headers))),Promise.reject(e)})}const Ja="1.11.0",Ya={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{Ya[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});const Xa={};Ya.transitional=function(t,e,r){function n(t,e){return"[Axios v"+Ja+"] Transitional option '"+t+"'"+e+(r?". "+r:"")}return(r,i,s)=>{if(!1===t)throw new js(n(i," has been removed"+(e?" in "+e:"")),js.ERR_DEPRECATED);return e&&!Xa[i]&&(Xa[i]=!0,console.warn(n(i," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(r,i,s)}},Ya.spelling=function(t){return(e,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};var Za={assertOptions:function(t,e,r){if("object"!=typeof t)throw new js("options must be an object",js.ERR_BAD_OPTION_VALUE);const n=Object.keys(t);let i=n.length;for(;i-- >0;){const s=n[i],a=e[s];if(a){const e=t[s],r=void 0===e||a(e,s,t);if(!0!==r)throw new js("option "+s+" must be "+r,js.ERR_BAD_OPTION_VALUE);continue}if(!0!==r)throw new js("Unknown option "+s,js.ERR_BAD_OPTION)}},validators:Ya};const Qa=Za.validators;class to{constructor(t){this.defaults=t||{},this.interceptors={request:new Js,response:new Js}}async request(t,e){try{return await this._request(t,e)}catch(t){if(t instanceof Error){let e={};Error.captureStackTrace?Error.captureStackTrace(e):e=new Error;const r=e.stack?e.stack.replace(/^.+\n/,""):"";try{t.stack?r&&!String(t.stack).endsWith(r.replace(/^.+\n.+\n/,""))&&(t.stack+="\n"+r):t.stack=r}catch(t){}}throw t}}_request(t,e){"string"==typeof t?(e=e||{}).url=t:e=t||{},e=Aa(this.defaults,e);const{transitional:r,paramsSerializer:n,headers:i}=e;void 0!==r&&Za.assertOptions(r,{silentJSONParsing:Qa.transitional(Qa.boolean),forcedJSONParsing:Qa.transitional(Qa.boolean),clarifyTimeoutError:Qa.transitional(Qa.boolean)},!1),null!=n&&(_s.isFunction(n)?e.paramsSerializer={serialize:n}:Za.assertOptions(n,{encode:Qa.function,serialize:Qa.function},!0)),void 0!==e.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?e.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:e.allowAbsoluteUrls=!0),Za.assertOptions(e,{baseUrl:Qa.spelling("baseURL"),withXsrfToken:Qa.spelling("withXSRFToken")},!0),e.method=(e.method||this.defaults.method||"get").toLowerCase();let s=i&&_s.merge(i.common,i[e.method]);i&&_s.forEach(["delete","get","head","post","put","patch","common"],t=>{delete i[t]}),e.headers=pa.concat(s,i);const a=[];let o=!0;this.interceptors.request.forEach(function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(o=o&&t.synchronous,a.unshift(t.fulfilled,t.rejected))});const u=[];let c;this.interceptors.response.forEach(function(t){u.push(t.fulfilled,t.rejected)});let h,l=0;if(!o){const t=[$a.bind(this),void 0];for(t.unshift(...a),t.push(...u),h=t.length,c=Promise.resolve(e);l<h;)c=c.then(t[l++],t[l++]);return c}h=a.length;let f=e;for(l=0;l<h;){const t=a[l++],e=a[l++];try{f=t(f)}catch(t){e.call(this,t);break}}try{c=$a.call(this,f)}catch(t){return Promise.reject(t)}for(l=0,h=u.length;l<h;)c=c.then(u[l++],u[l++]);return c}getUri(t){return $s(ba((t=Aa(this.defaults,t)).baseURL,t.url,t.allowAbsoluteUrls),t.params,t.paramsSerializer)}}_s.forEach(["delete","get","head","options"],function(t){to.prototype[t]=function(e,r){return this.request(Aa(r||{},{method:t,url:e,data:(r||{}).data}))}}),_s.forEach(["post","put","patch"],function(t){function e(e){return function(r,n,i){return this.request(Aa(i||{},{method:t,headers:e?{"Content-Type":"multipart/form-data"}:{},url:r,data:n}))}}to.prototype[t]=e(),to.prototype[t+"Form"]=e(!0)});var eo=to;class ro{constructor(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");let e;this.promise=new Promise(function(t){e=t});const r=this;this.promise.then(t=>{if(!r._listeners)return;let e=r._listeners.length;for(;e-- >0;)r._listeners[e](t);r._listeners=null}),this.promise.then=t=>{let e;const n=new Promise(t=>{r.subscribe(t),e=t}).then(t);return n.cancel=function(){r.unsubscribe(e)},n},t(function(t,n,i){r.reason||(r.reason=new va(t,n,i),e(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const e=this._listeners.indexOf(t);-1!==e&&this._listeners.splice(e,1)}toAbortSignal(){const t=new AbortController,e=e=>{t.abort(e)};return this.subscribe(e),t.signal.unsubscribe=()=>this.unsubscribe(e),t.signal}static source(){let t;return{token:new ro(function(e){t=e}),cancel:t}}}var no=ro;const io={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(io).forEach(([t,e])=>{io[e]=t});var so=io;const ao=function t(e){const r=new eo(e),n=zi(eo.prototype.request,r);return _s.extend(n,eo.prototype,r,{allOwnKeys:!0}),_s.extend(n,r,null,{allOwnKeys:!0}),n.create=function(r){return t(Aa(e,r))},n}(aa);ao.Axios=eo,ao.CanceledError=va,ao.CancelToken=no,ao.isCancel=da,ao.VERSION=Ja,ao.toFormData=Ks,ao.AxiosError=js,ao.Cancel=ao.CanceledError,ao.all=function(t){return Promise.all(t)},ao.spread=function(t){return function(e){return t.apply(null,e)}},ao.isAxiosError=function(t){return _s.isObject(t)&&!0===t.isAxiosError},ao.mergeConfig=Aa,ao.AxiosHeaders=pa,ao.formToJSON=t=>ia(_s.isHTMLForm(t)?new FormData(t):t),ao.getAdapter=Wa,ao.HttpStatusCode=so,ao.default=ao;var oo,uo,co=ao,ho={exports:{}};
|
|
35
|
-
/**
|
|
36
|
-
* @license
|
|
37
|
-
* Lodash <https://lodash.com/>
|
|
38
|
-
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
39
|
-
* Released under MIT license <https://lodash.com/license>
|
|
40
|
-
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
41
|
-
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
42
|
-
*/
|
|
43
|
-
oo=ho,uo=ho.exports,function(){var t,e="Expected a function",r="__lodash_hash_undefined__",n="__lodash_placeholder__",i=16,s=32,a=64,o=128,u=256,c=1/0,h=9007199254740991,l=NaN,f=4294967295,p=[["ary",o],["bind",1],["bindKey",2],["curry",8],["curryRight",i],["flip",512],["partial",s],["partialRight",a],["rearg",u]],g="[object Arguments]",d="[object Array]",v="[object Boolean]",m="[object Date]",y="[object Error]",w="[object Function]",x="[object GeneratorFunction]",S="[object Map]",E="[object Number]",b="[object Object]",F="[object Promise]",A="[object RegExp]",C="[object Set]",D="[object String]",P="[object Symbol]",I="[object WeakMap]",R="[object ArrayBuffer]",T="[object DataView]",N="[object Float32Array]",O="[object Float64Array]",B="[object Int8Array]",_="[object Int16Array]",j="[object Int32Array]",H="[object Uint8Array]",k="[object Uint8ClampedArray]",L="[object Uint16Array]",V="[object Uint32Array]",q=/\b__p \+= '';/g,M=/\b(__p \+=) '' \+/g,K=/(__e\(.*?\)|\b__t\)) \+\n'';/g,U=/&(?:amp|lt|gt|quot|#39);/g,z=/[&<>"']/g,W=RegExp(U.source),G=RegExp(z.source),$=/<%-([\s\S]+?)%>/g,J=/<%([\s\S]+?)%>/g,Y=/<%=([\s\S]+?)%>/g,X=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Z=/^\w*$/,Q=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,tt=/[\\^$.*+?()[\]{}|]/g,et=RegExp(tt.source),nt=/^\s+/,it=/\s/,st=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,at=/\{\n\/\* \[wrapped with (.+)\] \*/,ot=/,? & /,ut=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ct=/[()=,{}\[\]\/\s]/,ht=/\\(\\)?/g,lt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ft=/\w*$/,pt=/^[-+]0x[0-9a-f]+$/i,gt=/^0b[01]+$/i,dt=/^\[object .+?Constructor\]$/,vt=/^0o[0-7]+$/i,mt=/^(?:0|[1-9]\d*)$/,yt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,wt=/($^)/,xt=/['\n\r\u2028\u2029\\]/g,St="\\ud800-\\udfff",Et="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",bt="\\u2700-\\u27bf",Ft="a-z\\xdf-\\xf6\\xf8-\\xff",At="A-Z\\xc0-\\xd6\\xd8-\\xde",Ct="\\ufe0e\\ufe0f",Dt="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Pt="['’]",It="["+St+"]",Rt="["+Dt+"]",Tt="["+Et+"]",Nt="\\d+",Ot="["+bt+"]",Bt="["+Ft+"]",_t="[^"+St+Dt+Nt+bt+Ft+At+"]",jt="\\ud83c[\\udffb-\\udfff]",Ht="[^"+St+"]",kt="(?:\\ud83c[\\udde6-\\uddff]){2}",Lt="[\\ud800-\\udbff][\\udc00-\\udfff]",Vt="["+At+"]",qt="\\u200d",Mt="(?:"+Bt+"|"+_t+")",Kt="(?:"+Vt+"|"+_t+")",Ut="(?:['’](?:d|ll|m|re|s|t|ve))?",zt="(?:['’](?:D|LL|M|RE|S|T|VE))?",Wt="(?:"+Tt+"|"+jt+")?",Gt="["+Ct+"]?",$t=Gt+Wt+"(?:"+qt+"(?:"+[Ht,kt,Lt].join("|")+")"+Gt+Wt+")*",Jt="(?:"+[Ot,kt,Lt].join("|")+")"+$t,Yt="(?:"+[Ht+Tt+"?",Tt,kt,Lt,It].join("|")+")",Xt=RegExp(Pt,"g"),Zt=RegExp(Tt,"g"),Qt=RegExp(jt+"(?="+jt+")|"+Yt+$t,"g"),te=RegExp([Vt+"?"+Bt+"+"+Ut+"(?="+[Rt,Vt,"$"].join("|")+")",Kt+"+"+zt+"(?="+[Rt,Vt+Mt,"$"].join("|")+")",Vt+"?"+Mt+"+"+Ut,Vt+"+"+zt,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Nt,Jt].join("|"),"g"),ee=RegExp("["+qt+St+Et+Ct+"]"),re=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ne=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],ie=-1,se={};se[N]=se[O]=se[B]=se[_]=se[j]=se[H]=se[k]=se[L]=se[V]=!0,se[g]=se[d]=se[R]=se[v]=se[T]=se[m]=se[y]=se[w]=se[S]=se[E]=se[b]=se[A]=se[C]=se[D]=se[I]=!1;var ae={};ae[g]=ae[d]=ae[R]=ae[T]=ae[v]=ae[m]=ae[N]=ae[O]=ae[B]=ae[_]=ae[j]=ae[S]=ae[E]=ae[b]=ae[A]=ae[C]=ae[D]=ae[P]=ae[H]=ae[k]=ae[L]=ae[V]=!0,ae[y]=ae[w]=ae[I]=!1;var oe={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ue=parseFloat,ce=parseInt,he="object"==typeof rt&&rt&&rt.Object===Object&&rt,le="object"==typeof self&&self&&self.Object===Object&&self,fe=he||le||Function("return this")(),pe=uo&&!uo.nodeType&&uo,ge=pe&&oo&&!oo.nodeType&&oo,de=ge&&ge.exports===pe,ve=de&&he.process,me=function(){try{var t=ge&&ge.require&&ge.require("util").types;return t||ve&&ve.binding&&ve.binding("util")}catch(t){}}(),ye=me&&me.isArrayBuffer,we=me&&me.isDate,xe=me&&me.isMap,Se=me&&me.isRegExp,Ee=me&&me.isSet,be=me&&me.isTypedArray;function Fe(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}function Ae(t,e,r,n){for(var i=-1,s=null==t?0:t.length;++i<s;){var a=t[i];e(n,a,r(a),t)}return n}function Ce(t,e){for(var r=-1,n=null==t?0:t.length;++r<n&&!1!==e(t[r],r,t););return t}function De(t,e){for(var r=null==t?0:t.length;r--&&!1!==e(t[r],r,t););return t}function Pe(t,e){for(var r=-1,n=null==t?0:t.length;++r<n;)if(!e(t[r],r,t))return!1;return!0}function Ie(t,e){for(var r=-1,n=null==t?0:t.length,i=0,s=[];++r<n;){var a=t[r];e(a,r,t)&&(s[i++]=a)}return s}function Re(t,e){return!(null==t||!t.length)&&Ve(t,e,0)>-1}function Te(t,e,r){for(var n=-1,i=null==t?0:t.length;++n<i;)if(r(e,t[n]))return!0;return!1}function Ne(t,e){for(var r=-1,n=null==t?0:t.length,i=Array(n);++r<n;)i[r]=e(t[r],r,t);return i}function Oe(t,e){for(var r=-1,n=e.length,i=t.length;++r<n;)t[i+r]=e[r];return t}function Be(t,e,r,n){var i=-1,s=null==t?0:t.length;for(n&&s&&(r=t[++i]);++i<s;)r=e(r,t[i],i,t);return r}function _e(t,e,r,n){var i=null==t?0:t.length;for(n&&i&&(r=t[--i]);i--;)r=e(r,t[i],i,t);return r}function je(t,e){for(var r=-1,n=null==t?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}var He=Ue("length");function ke(t,e,r){var n;return r(t,function(t,r,i){if(e(t,r,i))return n=r,!1}),n}function Le(t,e,r,n){for(var i=t.length,s=r+(n?1:-1);n?s--:++s<i;)if(e(t[s],s,t))return s;return-1}function Ve(t,e,r){return e==e?function(t,e,r){for(var n=r-1,i=t.length;++n<i;)if(t[n]===e)return n;return-1}(t,e,r):Le(t,Me,r)}function qe(t,e,r,n){for(var i=r-1,s=t.length;++i<s;)if(n(t[i],e))return i;return-1}function Me(t){return t!=t}function Ke(t,e){var r=null==t?0:t.length;return r?Ge(t,e)/r:l}function Ue(e){return function(r){return null==r?t:r[e]}}function ze(e){return function(r){return null==e?t:e[r]}}function We(t,e,r,n,i){return i(t,function(t,i,s){r=n?(n=!1,t):e(r,t,i,s)}),r}function Ge(e,r){for(var n,i=-1,s=e.length;++i<s;){var a=r(e[i]);a!==t&&(n=n===t?a:n+a)}return n}function $e(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}function Je(t){return t?t.slice(0,fr(t)+1).replace(nt,""):t}function Ye(t){return function(e){return t(e)}}function Xe(t,e){return Ne(e,function(e){return t[e]})}function Ze(t,e){return t.has(e)}function Qe(t,e){for(var r=-1,n=t.length;++r<n&&Ve(e,t[r],0)>-1;);return r}function tr(t,e){for(var r=t.length;r--&&Ve(e,t[r],0)>-1;);return r}var er=ze({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),rr=ze({"&":"&","<":"<",">":">",'"':""","'":"'"});function nr(t){return"\\"+oe[t]}function ir(t){return ee.test(t)}function sr(t){var e=-1,r=Array(t.size);return t.forEach(function(t,n){r[++e]=[n,t]}),r}function ar(t,e){return function(r){return t(e(r))}}function or(t,e){for(var r=-1,i=t.length,s=0,a=[];++r<i;){var o=t[r];o!==e&&o!==n||(t[r]=n,a[s++]=r)}return a}function ur(t){var e=-1,r=Array(t.size);return t.forEach(function(t){r[++e]=t}),r}function cr(t){var e=-1,r=Array(t.size);return t.forEach(function(t){r[++e]=[t,t]}),r}function hr(t){return ir(t)?function(t){for(var e=Qt.lastIndex=0;Qt.test(t);)++e;return e}(t):He(t)}function lr(t){return ir(t)?function(t){return t.match(Qt)||[]}(t):function(t){return t.split("")}(t)}function fr(t){for(var e=t.length;e--&&it.test(t.charAt(e)););return e}var pr=ze({"&":"&","<":"<",">":">",""":'"',"'":"'"}),gr=function rt(it){var St,Et=(it=null==it?fe:gr.defaults(fe.Object(),it,gr.pick(fe,ne))).Array,bt=it.Date,Ft=it.Error,At=it.Function,Ct=it.Math,Dt=it.Object,Pt=it.RegExp,It=it.String,Rt=it.TypeError,Tt=Et.prototype,Nt=At.prototype,Ot=Dt.prototype,Bt=it["__core-js_shared__"],_t=Nt.toString,jt=Ot.hasOwnProperty,Ht=0,kt=(St=/[^.]+$/.exec(Bt&&Bt.keys&&Bt.keys.IE_PROTO||""))?"Symbol(src)_1."+St:"",Lt=Ot.toString,Vt=_t.call(Dt),qt=fe._,Mt=Pt("^"+_t.call(jt).replace(tt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Kt=de?it.Buffer:t,Ut=it.Symbol,zt=it.Uint8Array,Wt=Kt?Kt.allocUnsafe:t,Gt=ar(Dt.getPrototypeOf,Dt),$t=Dt.create,Jt=Ot.propertyIsEnumerable,Yt=Tt.splice,Qt=Ut?Ut.isConcatSpreadable:t,ee=Ut?Ut.iterator:t,oe=Ut?Ut.toStringTag:t,he=function(){try{var t=fs(Dt,"defineProperty");return t({},"",{}),t}catch(t){}}(),le=it.clearTimeout!==fe.clearTimeout&&it.clearTimeout,pe=bt&&bt.now!==fe.Date.now&&bt.now,ge=it.setTimeout!==fe.setTimeout&&it.setTimeout,ve=Ct.ceil,me=Ct.floor,He=Dt.getOwnPropertySymbols,ze=Kt?Kt.isBuffer:t,dr=it.isFinite,vr=Tt.join,mr=ar(Dt.keys,Dt),yr=Ct.max,wr=Ct.min,xr=bt.now,Sr=it.parseInt,Er=Ct.random,br=Tt.reverse,Fr=fs(it,"DataView"),Ar=fs(it,"Map"),Cr=fs(it,"Promise"),Dr=fs(it,"Set"),Pr=fs(it,"WeakMap"),Ir=fs(Dt,"create"),Rr=Pr&&new Pr,Tr={},Nr=ks(Fr),Or=ks(Ar),Br=ks(Cr),_r=ks(Dr),jr=ks(Pr),Hr=Ut?Ut.prototype:t,kr=Hr?Hr.valueOf:t,Lr=Hr?Hr.toString:t;function Vr(t){if(eo(t)&&!Ua(t)&&!(t instanceof Ur)){if(t instanceof Kr)return t;if(jt.call(t,"__wrapped__"))return Ls(t)}return new Kr(t)}var qr=function(){function e(){}return function(r){if(!to(r))return{};if($t)return $t(r);e.prototype=r;var n=new e;return e.prototype=t,n}}();function Mr(){}function Kr(e,r){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!r,this.__index__=0,this.__values__=t}function Ur(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=f,this.__views__=[]}function zr(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Wr(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Gr(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function $r(t){var e=-1,r=null==t?0:t.length;for(this.__data__=new Gr;++e<r;)this.add(t[e])}function Jr(t){var e=this.__data__=new Wr(t);this.size=e.size}function Yr(t,e){var r=Ua(t),n=!r&&Ka(t),i=!r&&!n&&$a(t),s=!r&&!n&&!i&&co(t),a=r||n||i||s,o=a?$e(t.length,It):[],u=o.length;for(var c in t)!e&&!jt.call(t,c)||a&&("length"==c||i&&("offset"==c||"parent"==c)||s&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||ws(c,u))||o.push(c);return o}function Xr(e){var r=e.length;return r?e[Jn(0,r-1)]:t}function Zr(t,e){return _s(Ri(t),un(e,0,t.length))}function Qr(t){return _s(Ri(t))}function tn(e,r,n){(n!==t&&!Va(e[r],n)||n===t&&!(r in e))&&an(e,r,n)}function en(e,r,n){var i=e[r];jt.call(e,r)&&Va(i,n)&&(n!==t||r in e)||an(e,r,n)}function rn(t,e){for(var r=t.length;r--;)if(Va(t[r][0],e))return r;return-1}function nn(t,e,r,n){return pn(t,function(t,i,s){e(n,t,r(t),s)}),n}function sn(t,e){return t&&Ti(e,No(e),t)}function an(t,e,r){"__proto__"==e&&he?he(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}function on(e,r){for(var n=-1,i=r.length,s=Et(i),a=null==e;++n<i;)s[n]=a?t:Do(e,r[n]);return s}function un(e,r,n){return e==e&&(n!==t&&(e=e<=n?e:n),r!==t&&(e=e>=r?e:r)),e}function cn(e,r,n,i,s,a){var o,u=1&r,c=2&r,h=4&r;if(n&&(o=s?n(e,i,s,a):n(e)),o!==t)return o;if(!to(e))return e;var l=Ua(e);if(l){if(o=function(t){var e=t.length,r=new t.constructor(e);return e&&"string"==typeof t[0]&&jt.call(t,"index")&&(r.index=t.index,r.input=t.input),r}(e),!u)return Ri(e,o)}else{var f=ds(e),p=f==w||f==x;if($a(e))return Fi(e,u);if(f==b||f==g||p&&!s){if(o=c||p?{}:ms(e),!u)return c?function(t,e){return Ti(t,gs(t),e)}(e,function(t,e){return t&&Ti(e,Oo(e),t)}(o,e)):function(t,e){return Ti(t,ps(t),e)}(e,sn(o,e))}else{if(!ae[f])return s?e:{};o=function(t,e,r){var n,i=t.constructor;switch(e){case R:return Ai(t);case v:case m:return new i(+t);case T:return function(t,e){var r=e?Ai(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}(t,r);case N:case O:case B:case _:case j:case H:case k:case L:case V:return Ci(t,r);case S:return new i;case E:case D:return new i(t);case A:return function(t){var e=new t.constructor(t.source,ft.exec(t));return e.lastIndex=t.lastIndex,e}(t);case C:return new i;case P:return n=t,kr?Dt(kr.call(n)):{}}}(e,f,u)}}a||(a=new Jr);var d=a.get(e);if(d)return d;a.set(e,o),ao(e)?e.forEach(function(t){o.add(cn(t,r,n,t,e,a))}):ro(e)&&e.forEach(function(t,i){o.set(i,cn(t,r,n,i,e,a))});var y=l?t:(h?c?ss:is:c?Oo:No)(e);return Ce(y||e,function(t,i){y&&(t=e[i=t]),en(o,i,cn(t,r,n,i,e,a))}),o}function hn(e,r,n){var i=n.length;if(null==e)return!i;for(e=Dt(e);i--;){var s=n[i],a=r[s],o=e[s];if(o===t&&!(s in e)||!a(o))return!1}return!0}function ln(r,n,i){if("function"!=typeof r)throw new Rt(e);return Ts(function(){r.apply(t,i)},n)}function fn(t,e,r,n){var i=-1,s=Re,a=!0,o=t.length,u=[],c=e.length;if(!o)return u;r&&(e=Ne(e,Ye(r))),n?(s=Te,a=!1):e.length>=200&&(s=Ze,a=!1,e=new $r(e));t:for(;++i<o;){var h=t[i],l=null==r?h:r(h);if(h=n||0!==h?h:0,a&&l==l){for(var f=c;f--;)if(e[f]===l)continue t;u.push(h)}else s(e,l,n)||u.push(h)}return u}Vr.templateSettings={escape:$,evaluate:J,interpolate:Y,variable:"",imports:{_:Vr}},Vr.prototype=Mr.prototype,Vr.prototype.constructor=Vr,Kr.prototype=qr(Mr.prototype),Kr.prototype.constructor=Kr,Ur.prototype=qr(Mr.prototype),Ur.prototype.constructor=Ur,zr.prototype.clear=function(){this.__data__=Ir?Ir(null):{},this.size=0},zr.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},zr.prototype.get=function(e){var n=this.__data__;if(Ir){var i=n[e];return i===r?t:i}return jt.call(n,e)?n[e]:t},zr.prototype.has=function(e){var r=this.__data__;return Ir?r[e]!==t:jt.call(r,e)},zr.prototype.set=function(e,n){var i=this.__data__;return this.size+=this.has(e)?0:1,i[e]=Ir&&n===t?r:n,this},Wr.prototype.clear=function(){this.__data__=[],this.size=0},Wr.prototype.delete=function(t){var e=this.__data__,r=rn(e,t);return!(r<0||(r==e.length-1?e.pop():Yt.call(e,r,1),--this.size,0))},Wr.prototype.get=function(e){var r=this.__data__,n=rn(r,e);return n<0?t:r[n][1]},Wr.prototype.has=function(t){return rn(this.__data__,t)>-1},Wr.prototype.set=function(t,e){var r=this.__data__,n=rn(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this},Gr.prototype.clear=function(){this.size=0,this.__data__={hash:new zr,map:new(Ar||Wr),string:new zr}},Gr.prototype.delete=function(t){var e=hs(this,t).delete(t);return this.size-=e?1:0,e},Gr.prototype.get=function(t){return hs(this,t).get(t)},Gr.prototype.has=function(t){return hs(this,t).has(t)},Gr.prototype.set=function(t,e){var r=hs(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this},$r.prototype.add=$r.prototype.push=function(t){return this.__data__.set(t,r),this},$r.prototype.has=function(t){return this.__data__.has(t)},Jr.prototype.clear=function(){this.__data__=new Wr,this.size=0},Jr.prototype.delete=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r},Jr.prototype.get=function(t){return this.__data__.get(t)},Jr.prototype.has=function(t){return this.__data__.has(t)},Jr.prototype.set=function(t,e){var r=this.__data__;if(r instanceof Wr){var n=r.__data__;if(!Ar||n.length<199)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new Gr(n)}return r.set(t,e),this.size=r.size,this};var pn=Bi(Sn),gn=Bi(En,!0);function dn(t,e){var r=!0;return pn(t,function(t,n,i){return r=!!e(t,n,i)}),r}function vn(e,r,n){for(var i=-1,s=e.length;++i<s;){var a=e[i],o=r(a);if(null!=o&&(u===t?o==o&&!uo(o):n(o,u)))var u=o,c=a}return c}function mn(t,e){var r=[];return pn(t,function(t,n,i){e(t,n,i)&&r.push(t)}),r}function yn(t,e,r,n,i){var s=-1,a=t.length;for(r||(r=ys),i||(i=[]);++s<a;){var o=t[s];e>0&&r(o)?e>1?yn(o,e-1,r,n,i):Oe(i,o):n||(i[i.length]=o)}return i}var wn=_i(),xn=_i(!0);function Sn(t,e){return t&&wn(t,e,No)}function En(t,e){return t&&xn(t,e,No)}function bn(t,e){return Ie(e,function(e){return Xa(t[e])})}function Fn(e,r){for(var n=0,i=(r=xi(r,e)).length;null!=e&&n<i;)e=e[Hs(r[n++])];return n&&n==i?e:t}function An(t,e,r){var n=e(t);return Ua(t)?n:Oe(n,r(t))}function Cn(e){return null==e?e===t?"[object Undefined]":"[object Null]":oe&&oe in Dt(e)?function(e){var r=jt.call(e,oe),n=e[oe];try{e[oe]=t;var i=!0}catch(t){}var s=Lt.call(e);return i&&(r?e[oe]=n:delete e[oe]),s}(e):function(t){return Lt.call(t)}(e)}function Dn(t,e){return t>e}function Pn(t,e){return null!=t&&jt.call(t,e)}function In(t,e){return null!=t&&e in Dt(t)}function Rn(e,r,n){for(var i=n?Te:Re,s=e[0].length,a=e.length,o=a,u=Et(a),c=1/0,h=[];o--;){var l=e[o];o&&r&&(l=Ne(l,Ye(r))),c=wr(l.length,c),u[o]=!n&&(r||s>=120&&l.length>=120)?new $r(o&&l):t}l=e[0];var f=-1,p=u[0];t:for(;++f<s&&h.length<c;){var g=l[f],d=r?r(g):g;if(g=n||0!==g?g:0,!(p?Ze(p,d):i(h,d,n))){for(o=a;--o;){var v=u[o];if(!(v?Ze(v,d):i(e[o],d,n)))continue t}p&&p.push(d),h.push(g)}}return h}function Tn(e,r,n){var i=null==(e=Ps(e,r=xi(r,e)))?e:e[Hs(Ys(r))];return null==i?t:Fe(i,e,n)}function Nn(t){return eo(t)&&Cn(t)==g}function On(e,r,n,i,s){return e===r||(null==e||null==r||!eo(e)&&!eo(r)?e!=e&&r!=r:function(e,r,n,i,s,a){var o=Ua(e),u=Ua(r),c=o?d:ds(e),h=u?d:ds(r),l=(c=c==g?b:c)==b,f=(h=h==g?b:h)==b,p=c==h;if(p&&$a(e)){if(!$a(r))return!1;o=!0,l=!1}if(p&&!l)return a||(a=new Jr),o||co(e)?rs(e,r,n,i,s,a):function(t,e,r,n,i,s,a){switch(r){case T:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case R:return!(t.byteLength!=e.byteLength||!s(new zt(t),new zt(e)));case v:case m:case E:return Va(+t,+e);case y:return t.name==e.name&&t.message==e.message;case A:case D:return t==e+"";case S:var o=sr;case C:var u=1&n;if(o||(o=ur),t.size!=e.size&&!u)return!1;var c=a.get(t);if(c)return c==e;n|=2,a.set(t,e);var h=rs(o(t),o(e),n,i,s,a);return a.delete(t),h;case P:if(kr)return kr.call(t)==kr.call(e)}return!1}(e,r,c,n,i,s,a);if(!(1&n)){var w=l&&jt.call(e,"__wrapped__"),x=f&&jt.call(r,"__wrapped__");if(w||x){var F=w?e.value():e,I=x?r.value():r;return a||(a=new Jr),s(F,I,n,i,a)}}return!!p&&(a||(a=new Jr),function(e,r,n,i,s,a){var o=1&n,u=is(e),c=u.length,h=is(r),l=h.length;if(c!=l&&!o)return!1;for(var f=c;f--;){var p=u[f];if(!(o?p in r:jt.call(r,p)))return!1}var g=a.get(e),d=a.get(r);if(g&&d)return g==r&&d==e;var v=!0;a.set(e,r),a.set(r,e);for(var m=o;++f<c;){var y=e[p=u[f]],w=r[p];if(i)var x=o?i(w,y,p,r,e,a):i(y,w,p,e,r,a);if(!(x===t?y===w||s(y,w,n,i,a):x)){v=!1;break}m||(m="constructor"==p)}if(v&&!m){var S=e.constructor,E=r.constructor;S==E||!("constructor"in e)||!("constructor"in r)||"function"==typeof S&&S instanceof S&&"function"==typeof E&&E instanceof E||(v=!1)}return a.delete(e),a.delete(r),v}(e,r,n,i,s,a))}(e,r,n,i,On,s))}function Bn(e,r,n,i){var s=n.length,a=s,o=!i;if(null==e)return!a;for(e=Dt(e);s--;){var u=n[s];if(o&&u[2]?u[1]!==e[u[0]]:!(u[0]in e))return!1}for(;++s<a;){var c=(u=n[s])[0],h=e[c],l=u[1];if(o&&u[2]){if(h===t&&!(c in e))return!1}else{var f=new Jr;if(i)var p=i(h,l,c,e,r,f);if(!(p===t?On(l,h,3,i,f):p))return!1}}return!0}function _n(t){return!(!to(t)||(e=t,kt&&kt in e))&&(Xa(t)?Mt:dt).test(ks(t));var e}function jn(t){return"function"==typeof t?t:null==t?iu:"object"==typeof t?Ua(t)?Mn(t[0],t[1]):qn(t):pu(t)}function Hn(t){if(!Fs(t))return mr(t);var e=[];for(var r in Dt(t))jt.call(t,r)&&"constructor"!=r&&e.push(r);return e}function kn(t){if(!to(t))return function(t){var e=[];if(null!=t)for(var r in Dt(t))e.push(r);return e}(t);var e=Fs(t),r=[];for(var n in t)("constructor"!=n||!e&&jt.call(t,n))&&r.push(n);return r}function Ln(t,e){return t<e}function Vn(t,e){var r=-1,n=Wa(t)?Et(t.length):[];return pn(t,function(t,i,s){n[++r]=e(t,i,s)}),n}function qn(t){var e=ls(t);return 1==e.length&&e[0][2]?Cs(e[0][0],e[0][1]):function(r){return r===t||Bn(r,t,e)}}function Mn(e,r){return Ss(e)&&As(r)?Cs(Hs(e),r):function(n){var i=Do(n,e);return i===t&&i===r?Po(n,e):On(r,i,3)}}function Kn(e,r,n,i,s){e!==r&&wn(r,function(a,o){if(s||(s=new Jr),to(a))!function(e,r,n,i,s,a,o){var u=Is(e,n),c=Is(r,n),h=o.get(c);if(h)tn(e,n,h);else{var l=a?a(u,c,n+"",e,r,o):t,f=l===t;if(f){var p=Ua(c),g=!p&&$a(c),d=!p&&!g&&co(c);l=c,p||g||d?Ua(u)?l=u:Ga(u)?l=Ri(u):g?(f=!1,l=Fi(c,!0)):d?(f=!1,l=Ci(c,!0)):l=[]:io(c)||Ka(c)?(l=u,Ka(u)?l=yo(u):to(u)&&!Xa(u)||(l=ms(c))):f=!1}f&&(o.set(c,l),s(l,c,i,a,o),o.delete(c)),tn(e,n,l)}}(e,r,o,n,Kn,i,s);else{var u=i?i(Is(e,o),a,o+"",e,r,s):t;u===t&&(u=a),tn(e,o,u)}},Oo)}function Un(e,r){var n=e.length;if(n)return ws(r+=r<0?n:0,n)?e[r]:t}function zn(t,e,r){e=e.length?Ne(e,function(t){return Ua(t)?function(e){return Fn(e,1===t.length?t[0]:t)}:t}):[iu];var n=-1;e=Ne(e,Ye(cs()));var i=Vn(t,function(t,r,i){var s=Ne(e,function(e){return e(t)});return{criteria:s,index:++n,value:t}});return function(t,e){var r=t.length;for(t.sort(e);r--;)t[r]=t[r].value;return t}(i,function(t,e){return function(t,e,r){for(var n=-1,i=t.criteria,s=e.criteria,a=i.length,o=r.length;++n<a;){var u=Di(i[n],s[n]);if(u)return n>=o?u:u*("desc"==r[n]?-1:1)}return t.index-e.index}(t,e,r)})}function Wn(t,e,r){for(var n=-1,i=e.length,s={};++n<i;){var a=e[n],o=Fn(t,a);r(o,a)&&ti(s,xi(a,t),o)}return s}function Gn(t,e,r,n){var i=n?qe:Ve,s=-1,a=e.length,o=t;for(t===e&&(e=Ri(e)),r&&(o=Ne(t,Ye(r)));++s<a;)for(var u=0,c=e[s],h=r?r(c):c;(u=i(o,h,u,n))>-1;)o!==t&&Yt.call(o,u,1),Yt.call(t,u,1);return t}function $n(t,e){for(var r=t?e.length:0,n=r-1;r--;){var i=e[r];if(r==n||i!==s){var s=i;ws(i)?Yt.call(t,i,1):fi(t,i)}}return t}function Jn(t,e){return t+me(Er()*(e-t+1))}function Yn(t,e){var r="";if(!t||e<1||e>h)return r;do{e%2&&(r+=t),(e=me(e/2))&&(t+=t)}while(e);return r}function Xn(t,e){return Ns(Ds(t,e,iu),t+"")}function Zn(t){return Xr(qo(t))}function Qn(t,e){var r=qo(t);return _s(r,un(e,0,r.length))}function ti(e,r,n,i){if(!to(e))return e;for(var s=-1,a=(r=xi(r,e)).length,o=a-1,u=e;null!=u&&++s<a;){var c=Hs(r[s]),h=n;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;if(s!=o){var l=u[c];(h=i?i(l,c,u):t)===t&&(h=to(l)?l:ws(r[s+1])?[]:{})}en(u,c,h),u=u[c]}return e}var ei=Rr?function(t,e){return Rr.set(t,e),t}:iu,ri=he?function(t,e){return he(t,"toString",{configurable:!0,enumerable:!1,value:eu(e),writable:!0})}:iu;function ni(t){return _s(qo(t))}function ii(t,e,r){var n=-1,i=t.length;e<0&&(e=-e>i?0:i+e),(r=r>i?i:r)<0&&(r+=i),i=e>r?0:r-e>>>0,e>>>=0;for(var s=Et(i);++n<i;)s[n]=t[n+e];return s}function si(t,e){var r;return pn(t,function(t,n,i){return!(r=e(t,n,i))}),!!r}function ai(t,e,r){var n=0,i=null==t?n:t.length;if("number"==typeof e&&e==e&&i<=2147483647){for(;n<i;){var s=n+i>>>1,a=t[s];null!==a&&!uo(a)&&(r?a<=e:a<e)?n=s+1:i=s}return i}return oi(t,e,iu,r)}function oi(e,r,n,i){var s=0,a=null==e?0:e.length;if(0===a)return 0;for(var o=(r=n(r))!=r,u=null===r,c=uo(r),h=r===t;s<a;){var l=me((s+a)/2),f=n(e[l]),p=f!==t,g=null===f,d=f==f,v=uo(f);if(o)var m=i||d;else m=h?d&&(i||p):u?d&&p&&(i||!g):c?d&&p&&!g&&(i||!v):!g&&!v&&(i?f<=r:f<r);m?s=l+1:a=l}return wr(a,4294967294)}function ui(t,e){for(var r=-1,n=t.length,i=0,s=[];++r<n;){var a=t[r],o=e?e(a):a;if(!r||!Va(o,u)){var u=o;s[i++]=0===a?0:a}}return s}function ci(t){return"number"==typeof t?t:uo(t)?l:+t}function hi(t){if("string"==typeof t)return t;if(Ua(t))return Ne(t,hi)+"";if(uo(t))return Lr?Lr.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function li(t,e,r){var n=-1,i=Re,s=t.length,a=!0,o=[],u=o;if(r)a=!1,i=Te;else if(s>=200){var c=e?null:Yi(t);if(c)return ur(c);a=!1,i=Ze,u=new $r}else u=e?[]:o;t:for(;++n<s;){var h=t[n],l=e?e(h):h;if(h=r||0!==h?h:0,a&&l==l){for(var f=u.length;f--;)if(u[f]===l)continue t;e&&u.push(l),o.push(h)}else i(u,l,r)||(u!==o&&u.push(l),o.push(h))}return o}function fi(t,e){return null==(t=Ps(t,e=xi(e,t)))||delete t[Hs(Ys(e))]}function pi(t,e,r,n){return ti(t,e,r(Fn(t,e)),n)}function gi(t,e,r,n){for(var i=t.length,s=n?i:-1;(n?s--:++s<i)&&e(t[s],s,t););return r?ii(t,n?0:s,n?s+1:i):ii(t,n?s+1:0,n?i:s)}function di(t,e){var r=t;return r instanceof Ur&&(r=r.value()),Be(e,function(t,e){return e.func.apply(e.thisArg,Oe([t],e.args))},r)}function vi(t,e,r){var n=t.length;if(n<2)return n?li(t[0]):[];for(var i=-1,s=Et(n);++i<n;)for(var a=t[i],o=-1;++o<n;)o!=i&&(s[i]=fn(s[i]||a,t[o],e,r));return li(yn(s,1),e,r)}function mi(e,r,n){for(var i=-1,s=e.length,a=r.length,o={};++i<s;){var u=i<a?r[i]:t;n(o,e[i],u)}return o}function yi(t){return Ga(t)?t:[]}function wi(t){return"function"==typeof t?t:iu}function xi(t,e){return Ua(t)?t:Ss(t,e)?[t]:js(wo(t))}var Si=Xn;function Ei(e,r,n){var i=e.length;return n=n===t?i:n,!r&&n>=i?e:ii(e,r,n)}var bi=le||function(t){return fe.clearTimeout(t)};function Fi(t,e){if(e)return t.slice();var r=t.length,n=Wt?Wt(r):new t.constructor(r);return t.copy(n),n}function Ai(t){var e=new t.constructor(t.byteLength);return new zt(e).set(new zt(t)),e}function Ci(t,e){var r=e?Ai(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}function Di(e,r){if(e!==r){var n=e!==t,i=null===e,s=e==e,a=uo(e),o=r!==t,u=null===r,c=r==r,h=uo(r);if(!u&&!h&&!a&&e>r||a&&o&&c&&!u&&!h||i&&o&&c||!n&&c||!s)return 1;if(!i&&!a&&!h&&e<r||h&&n&&s&&!i&&!a||u&&n&&s||!o&&s||!c)return-1}return 0}function Pi(t,e,r,n){for(var i=-1,s=t.length,a=r.length,o=-1,u=e.length,c=yr(s-a,0),h=Et(u+c),l=!n;++o<u;)h[o]=e[o];for(;++i<a;)(l||i<s)&&(h[r[i]]=t[i]);for(;c--;)h[o++]=t[i++];return h}function Ii(t,e,r,n){for(var i=-1,s=t.length,a=-1,o=r.length,u=-1,c=e.length,h=yr(s-o,0),l=Et(h+c),f=!n;++i<h;)l[i]=t[i];for(var p=i;++u<c;)l[p+u]=e[u];for(;++a<o;)(f||i<s)&&(l[p+r[a]]=t[i++]);return l}function Ri(t,e){var r=-1,n=t.length;for(e||(e=Et(n));++r<n;)e[r]=t[r];return e}function Ti(e,r,n,i){var s=!n;n||(n={});for(var a=-1,o=r.length;++a<o;){var u=r[a],c=i?i(n[u],e[u],u,n,e):t;c===t&&(c=e[u]),s?an(n,u,c):en(n,u,c)}return n}function Ni(t,e){return function(r,n){var i=Ua(r)?Ae:nn,s=e?e():{};return i(r,t,cs(n,2),s)}}function Oi(e){return Xn(function(r,n){var i=-1,s=n.length,a=s>1?n[s-1]:t,o=s>2?n[2]:t;for(a=e.length>3&&"function"==typeof a?(s--,a):t,o&&xs(n[0],n[1],o)&&(a=s<3?t:a,s=1),r=Dt(r);++i<s;){var u=n[i];u&&e(r,u,i,a)}return r})}function Bi(t,e){return function(r,n){if(null==r)return r;if(!Wa(r))return t(r,n);for(var i=r.length,s=e?i:-1,a=Dt(r);(e?s--:++s<i)&&!1!==n(a[s],s,a););return r}}function _i(t){return function(e,r,n){for(var i=-1,s=Dt(e),a=n(e),o=a.length;o--;){var u=a[t?o:++i];if(!1===r(s[u],u,s))break}return e}}function ji(e){return function(r){var n=ir(r=wo(r))?lr(r):t,i=n?n[0]:r.charAt(0),s=n?Ei(n,1).join(""):r.slice(1);return i[e]()+s}}function Hi(t){return function(e){return Be(Zo(Uo(e).replace(Xt,"")),t,"")}}function ki(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var r=qr(t.prototype),n=t.apply(r,e);return to(n)?n:r}}function Li(e){return function(r,n,i){var s=Dt(r);if(!Wa(r)){var a=cs(n,3);r=No(r),n=function(t){return a(s[t],t,s)}}var o=e(r,n,i);return o>-1?s[a?r[o]:o]:t}}function Vi(r){return ns(function(n){var i=n.length,s=i,a=Kr.prototype.thru;for(r&&n.reverse();s--;){var o=n[s];if("function"!=typeof o)throw new Rt(e);if(a&&!u&&"wrapper"==os(o))var u=new Kr([],!0)}for(s=u?s:i;++s<i;){var c=os(o=n[s]),h="wrapper"==c?as(o):t;u=h&&Es(h[0])&&424==h[1]&&!h[4].length&&1==h[9]?u[os(h[0])].apply(u,h[3]):1==o.length&&Es(o)?u[c]():u.thru(o)}return function(){var t=arguments,e=t[0];if(u&&1==t.length&&Ua(e))return u.plant(e).value();for(var r=0,s=i?n[r].apply(this,t):e;++r<i;)s=n[r].call(this,s);return s}})}function qi(e,r,n,i,s,a,u,c,h,l){var f=r&o,p=1&r,g=2&r,d=24&r,v=512&r,m=g?t:ki(e);return function o(){for(var y=arguments.length,w=Et(y),x=y;x--;)w[x]=arguments[x];if(d)var S=us(o),E=function(t,e){for(var r=t.length,n=0;r--;)t[r]===e&&++n;return n}(w,S);if(i&&(w=Pi(w,i,s,d)),a&&(w=Ii(w,a,u,d)),y-=E,d&&y<l){var b=or(w,S);return $i(e,r,qi,o.placeholder,n,w,b,c,h,l-y)}var F=p?n:this,A=g?F[e]:e;return y=w.length,c?w=function(e,r){for(var n=e.length,i=wr(r.length,n),s=Ri(e);i--;){var a=r[i];e[i]=ws(a,n)?s[a]:t}return e}(w,c):v&&y>1&&w.reverse(),f&&h<y&&(w.length=h),this&&this!==fe&&this instanceof o&&(A=m||ki(A)),A.apply(F,w)}}function Mi(t,e){return function(r,n){return function(t,e,r,n){return Sn(t,function(t,i,s){e(n,r(t),i,s)}),n}(r,t,e(n),{})}}function Ki(e,r){return function(n,i){var s;if(n===t&&i===t)return r;if(n!==t&&(s=n),i!==t){if(s===t)return i;"string"==typeof n||"string"==typeof i?(n=hi(n),i=hi(i)):(n=ci(n),i=ci(i)),s=e(n,i)}return s}}function Ui(t){return ns(function(e){return e=Ne(e,Ye(cs())),Xn(function(r){var n=this;return t(e,function(t){return Fe(t,n,r)})})})}function zi(e,r){var n=(r=r===t?" ":hi(r)).length;if(n<2)return n?Yn(r,e):r;var i=Yn(r,ve(e/hr(r)));return ir(r)?Ei(lr(i),0,e).join(""):i.slice(0,e)}function Wi(e){return function(r,n,i){return i&&"number"!=typeof i&&xs(r,n,i)&&(n=i=t),r=po(r),n===t?(n=r,r=0):n=po(n),function(t,e,r,n){for(var i=-1,s=yr(ve((e-t)/(r||1)),0),a=Et(s);s--;)a[n?s:++i]=t,t+=r;return a}(r,n,i=i===t?r<n?1:-1:po(i),e)}}function Gi(t){return function(e,r){return"string"==typeof e&&"string"==typeof r||(e=mo(e),r=mo(r)),t(e,r)}}function $i(e,r,n,i,o,u,c,h,l,f){var p=8&r;r|=p?s:a,4&(r&=~(p?a:s))||(r&=-4);var g=[e,r,o,p?u:t,p?c:t,p?t:u,p?t:c,h,l,f],d=n.apply(t,g);return Es(e)&&Rs(d,g),d.placeholder=i,Os(d,e,r)}function Ji(t){var e=Ct[t];return function(t,r){if(t=mo(t),(r=null==r?0:wr(go(r),292))&&dr(t)){var n=(wo(t)+"e").split("e");return+((n=(wo(e(n[0]+"e"+(+n[1]+r)))+"e").split("e"))[0]+"e"+(+n[1]-r))}return e(t)}}var Yi=Dr&&1/ur(new Dr([,-0]))[1]==c?function(t){return new Dr(t)}:cu;function Xi(t){return function(e){var r=ds(e);return r==S?sr(e):r==C?cr(e):function(t,e){return Ne(e,function(e){return[e,t[e]]})}(e,t(e))}}function Zi(r,c,h,l,f,p,g,d){var v=2&c;if(!v&&"function"!=typeof r)throw new Rt(e);var m=l?l.length:0;if(m||(c&=-97,l=f=t),g=g===t?g:yr(go(g),0),d=d===t?d:go(d),m-=f?f.length:0,c&a){var y=l,w=f;l=f=t}var x=v?t:as(r),S=[r,c,h,l,f,y,w,p,g,d];if(x&&function(t,e){var r=t[1],i=e[1],s=r|i,a=s<131,c=i==o&&8==r||i==o&&r==u&&t[7].length<=e[8]||384==i&&e[7].length<=e[8]&&8==r;if(!a&&!c)return t;1&i&&(t[2]=e[2],s|=1&r?0:4);var h=e[3];if(h){var l=t[3];t[3]=l?Pi(l,h,e[4]):h,t[4]=l?or(t[3],n):e[4]}(h=e[5])&&(l=t[5],t[5]=l?Ii(l,h,e[6]):h,t[6]=l?or(t[5],n):e[6]),(h=e[7])&&(t[7]=h),i&o&&(t[8]=null==t[8]?e[8]:wr(t[8],e[8])),null==t[9]&&(t[9]=e[9]),t[0]=e[0],t[1]=s}(S,x),r=S[0],c=S[1],h=S[2],l=S[3],f=S[4],!(d=S[9]=S[9]===t?v?0:r.length:yr(S[9]-m,0))&&24&c&&(c&=-25),c&&1!=c)E=8==c||c==i?function(e,r,n){var i=ki(e);return function s(){for(var a=arguments.length,o=Et(a),u=a,c=us(s);u--;)o[u]=arguments[u];var h=a<3&&o[0]!==c&&o[a-1]!==c?[]:or(o,c);return(a-=h.length)<n?$i(e,r,qi,s.placeholder,t,o,h,t,t,n-a):Fe(this&&this!==fe&&this instanceof s?i:e,this,o)}}(r,c,d):c!=s&&33!=c||f.length?qi.apply(t,S):function(t,e,r,n){var i=1&e,s=ki(t);return function e(){for(var a=-1,o=arguments.length,u=-1,c=n.length,h=Et(c+o),l=this&&this!==fe&&this instanceof e?s:t;++u<c;)h[u]=n[u];for(;o--;)h[u++]=arguments[++a];return Fe(l,i?r:this,h)}}(r,c,h,l);else var E=function(t,e,r){var n=1&e,i=ki(t);return function e(){return(this&&this!==fe&&this instanceof e?i:t).apply(n?r:this,arguments)}}(r,c,h);return Os((x?ei:Rs)(E,S),r,c)}function Qi(e,r,n,i){return e===t||Va(e,Ot[n])&&!jt.call(i,n)?r:e}function ts(e,r,n,i,s,a){return to(e)&&to(r)&&(a.set(r,e),Kn(e,r,t,ts,a),a.delete(r)),e}function es(e){return io(e)?t:e}function rs(e,r,n,i,s,a){var o=1&n,u=e.length,c=r.length;if(u!=c&&!(o&&c>u))return!1;var h=a.get(e),l=a.get(r);if(h&&l)return h==r&&l==e;var f=-1,p=!0,g=2&n?new $r:t;for(a.set(e,r),a.set(r,e);++f<u;){var d=e[f],v=r[f];if(i)var m=o?i(v,d,f,r,e,a):i(d,v,f,e,r,a);if(m!==t){if(m)continue;p=!1;break}if(g){if(!je(r,function(t,e){if(!Ze(g,e)&&(d===t||s(d,t,n,i,a)))return g.push(e)})){p=!1;break}}else if(d!==v&&!s(d,v,n,i,a)){p=!1;break}}return a.delete(e),a.delete(r),p}function ns(e){return Ns(Ds(e,t,zs),e+"")}function is(t){return An(t,No,ps)}function ss(t){return An(t,Oo,gs)}var as=Rr?function(t){return Rr.get(t)}:cu;function os(t){for(var e=t.name+"",r=Tr[e],n=jt.call(Tr,e)?r.length:0;n--;){var i=r[n],s=i.func;if(null==s||s==t)return i.name}return e}function us(t){return(jt.call(Vr,"placeholder")?Vr:t).placeholder}function cs(){var t=Vr.iteratee||su;return t=t===su?jn:t,arguments.length?t(arguments[0],arguments[1]):t}function hs(t,e){var r,n,i=t.__data__;return("string"==(n=typeof(r=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?i["string"==typeof e?"string":"hash"]:i.map}function ls(t){for(var e=No(t),r=e.length;r--;){var n=e[r],i=t[n];e[r]=[n,i,As(i)]}return e}function fs(e,r){var n=function(e,r){return null==e?t:e[r]}(e,r);return _n(n)?n:t}var ps=He?function(t){return null==t?[]:(t=Dt(t),Ie(He(t),function(e){return Jt.call(t,e)}))}:vu,gs=He?function(t){for(var e=[];t;)Oe(e,ps(t)),t=Gt(t);return e}:vu,ds=Cn;function vs(t,e,r){for(var n=-1,i=(e=xi(e,t)).length,s=!1;++n<i;){var a=Hs(e[n]);if(!(s=null!=t&&r(t,a)))break;t=t[a]}return s||++n!=i?s:!!(i=null==t?0:t.length)&&Qa(i)&&ws(a,i)&&(Ua(t)||Ka(t))}function ms(t){return"function"!=typeof t.constructor||Fs(t)?{}:qr(Gt(t))}function ys(t){return Ua(t)||Ka(t)||!!(Qt&&t&&t[Qt])}function ws(t,e){var r=typeof t;return!!(e=null==e?h:e)&&("number"==r||"symbol"!=r&&mt.test(t))&&t>-1&&t%1==0&&t<e}function xs(t,e,r){if(!to(r))return!1;var n=typeof e;return!!("number"==n?Wa(r)&&ws(e,r.length):"string"==n&&e in r)&&Va(r[e],t)}function Ss(t,e){if(Ua(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!uo(t))||Z.test(t)||!X.test(t)||null!=e&&t in Dt(e)}function Es(t){var e=os(t),r=Vr[e];if("function"!=typeof r||!(e in Ur.prototype))return!1;if(t===r)return!0;var n=as(r);return!!n&&t===n[0]}(Fr&&ds(new Fr(new ArrayBuffer(1)))!=T||Ar&&ds(new Ar)!=S||Cr&&ds(Cr.resolve())!=F||Dr&&ds(new Dr)!=C||Pr&&ds(new Pr)!=I)&&(ds=function(e){var r=Cn(e),n=r==b?e.constructor:t,i=n?ks(n):"";if(i)switch(i){case Nr:return T;case Or:return S;case Br:return F;case _r:return C;case jr:return I}return r});var bs=Bt?Xa:mu;function Fs(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Ot)}function As(t){return t==t&&!to(t)}function Cs(e,r){return function(n){return null!=n&&n[e]===r&&(r!==t||e in Dt(n))}}function Ds(e,r,n){return r=yr(r===t?e.length-1:r,0),function(){for(var t=arguments,i=-1,s=yr(t.length-r,0),a=Et(s);++i<s;)a[i]=t[r+i];i=-1;for(var o=Et(r+1);++i<r;)o[i]=t[i];return o[r]=n(a),Fe(e,this,o)}}function Ps(t,e){return e.length<2?t:Fn(t,ii(e,0,-1))}function Is(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}var Rs=Bs(ei),Ts=ge||function(t,e){return fe.setTimeout(t,e)},Ns=Bs(ri);function Os(t,e,r){var n=e+"";return Ns(t,function(t,e){var r=e.length;if(!r)return t;var n=r-1;return e[n]=(r>1?"& ":"")+e[n],e=e.join(r>2?", ":" "),t.replace(st,"{\n/* [wrapped with "+e+"] */\n")}(n,function(t,e){return Ce(p,function(r){var n="_."+r[0];e&r[1]&&!Re(t,n)&&t.push(n)}),t.sort()}(function(t){var e=t.match(at);return e?e[1].split(ot):[]}(n),r)))}function Bs(e){var r=0,n=0;return function(){var i=xr(),s=16-(i-n);if(n=i,s>0){if(++r>=800)return arguments[0]}else r=0;return e.apply(t,arguments)}}function _s(e,r){var n=-1,i=e.length,s=i-1;for(r=r===t?i:r;++n<r;){var a=Jn(n,s),o=e[a];e[a]=e[n],e[n]=o}return e.length=r,e}var js=function(t){var e=Ba(t,function(t){return 500===r.size&&r.clear(),t}),r=e.cache;return e}(function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(Q,function(t,r,n,i){e.push(n?i.replace(ht,"$1"):r||t)}),e});function Hs(t){if("string"==typeof t||uo(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function ks(t){if(null!=t){try{return _t.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function Ls(t){if(t instanceof Ur)return t.clone();var e=new Kr(t.__wrapped__,t.__chain__);return e.__actions__=Ri(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}var Vs=Xn(function(t,e){return Ga(t)?fn(t,yn(e,1,Ga,!0)):[]}),qs=Xn(function(e,r){var n=Ys(r);return Ga(n)&&(n=t),Ga(e)?fn(e,yn(r,1,Ga,!0),cs(n,2)):[]}),Ms=Xn(function(e,r){var n=Ys(r);return Ga(n)&&(n=t),Ga(e)?fn(e,yn(r,1,Ga,!0),t,n):[]});function Ks(t,e,r){var n=null==t?0:t.length;if(!n)return-1;var i=null==r?0:go(r);return i<0&&(i=yr(n+i,0)),Le(t,cs(e,3),i)}function Us(e,r,n){var i=null==e?0:e.length;if(!i)return-1;var s=i-1;return n!==t&&(s=go(n),s=n<0?yr(i+s,0):wr(s,i-1)),Le(e,cs(r,3),s,!0)}function zs(t){return null!=t&&t.length?yn(t,1):[]}function Ws(e){return e&&e.length?e[0]:t}var Gs=Xn(function(t){var e=Ne(t,yi);return e.length&&e[0]===t[0]?Rn(e):[]}),$s=Xn(function(e){var r=Ys(e),n=Ne(e,yi);return r===Ys(n)?r=t:n.pop(),n.length&&n[0]===e[0]?Rn(n,cs(r,2)):[]}),Js=Xn(function(e){var r=Ys(e),n=Ne(e,yi);return(r="function"==typeof r?r:t)&&n.pop(),n.length&&n[0]===e[0]?Rn(n,t,r):[]});function Ys(e){var r=null==e?0:e.length;return r?e[r-1]:t}var Xs=Xn(Zs);function Zs(t,e){return t&&t.length&&e&&e.length?Gn(t,e):t}var Qs=ns(function(t,e){var r=null==t?0:t.length,n=on(t,e);return $n(t,Ne(e,function(t){return ws(t,r)?+t:t}).sort(Di)),n});function ta(t){return null==t?t:br.call(t)}var ea=Xn(function(t){return li(yn(t,1,Ga,!0))}),ra=Xn(function(e){var r=Ys(e);return Ga(r)&&(r=t),li(yn(e,1,Ga,!0),cs(r,2))}),na=Xn(function(e){var r=Ys(e);return r="function"==typeof r?r:t,li(yn(e,1,Ga,!0),t,r)});function ia(t){if(!t||!t.length)return[];var e=0;return t=Ie(t,function(t){if(Ga(t))return e=yr(t.length,e),!0}),$e(e,function(e){return Ne(t,Ue(e))})}function sa(e,r){if(!e||!e.length)return[];var n=ia(e);return null==r?n:Ne(n,function(e){return Fe(r,t,e)})}var aa=Xn(function(t,e){return Ga(t)?fn(t,e):[]}),oa=Xn(function(t){return vi(Ie(t,Ga))}),ua=Xn(function(e){var r=Ys(e);return Ga(r)&&(r=t),vi(Ie(e,Ga),cs(r,2))}),ca=Xn(function(e){var r=Ys(e);return r="function"==typeof r?r:t,vi(Ie(e,Ga),t,r)}),ha=Xn(ia),la=Xn(function(e){var r=e.length,n=r>1?e[r-1]:t;return n="function"==typeof n?(e.pop(),n):t,sa(e,n)});function fa(t){var e=Vr(t);return e.__chain__=!0,e}function pa(t,e){return e(t)}var ga=ns(function(e){var r=e.length,n=r?e[0]:0,i=this.__wrapped__,s=function(t){return on(t,e)};return!(r>1||this.__actions__.length)&&i instanceof Ur&&ws(n)?((i=i.slice(n,+n+(r?1:0))).__actions__.push({func:pa,args:[s],thisArg:t}),new Kr(i,this.__chain__).thru(function(e){return r&&!e.length&&e.push(t),e})):this.thru(s)}),da=Ni(function(t,e,r){jt.call(t,r)?++t[r]:an(t,r,1)}),va=Li(Ks),ma=Li(Us);function ya(t,e){return(Ua(t)?Ce:pn)(t,cs(e,3))}function wa(t,e){return(Ua(t)?De:gn)(t,cs(e,3))}var xa=Ni(function(t,e,r){jt.call(t,r)?t[r].push(e):an(t,r,[e])}),Sa=Xn(function(t,e,r){var n=-1,i="function"==typeof e,s=Wa(t)?Et(t.length):[];return pn(t,function(t){s[++n]=i?Fe(e,t,r):Tn(t,e,r)}),s}),Ea=Ni(function(t,e,r){an(t,r,e)});function ba(t,e){return(Ua(t)?Ne:Vn)(t,cs(e,3))}var Fa=Ni(function(t,e,r){t[r?0:1].push(e)},function(){return[[],[]]}),Aa=Xn(function(t,e){if(null==t)return[];var r=e.length;return r>1&&xs(t,e[0],e[1])?e=[]:r>2&&xs(e[0],e[1],e[2])&&(e=[e[0]]),zn(t,yn(e,1),[])}),Ca=pe||function(){return fe.Date.now()};function Da(e,r,n){return r=n?t:r,r=e&&null==r?e.length:r,Zi(e,o,t,t,t,t,r)}function Pa(r,n){var i;if("function"!=typeof n)throw new Rt(e);return r=go(r),function(){return--r>0&&(i=n.apply(this,arguments)),r<=1&&(n=t),i}}var Ia=Xn(function(t,e,r){var n=1;if(r.length){var i=or(r,us(Ia));n|=s}return Zi(t,n,e,r,i)}),Ra=Xn(function(t,e,r){var n=3;if(r.length){var i=or(r,us(Ra));n|=s}return Zi(e,n,t,r,i)});function Ta(r,n,i){var s,a,o,u,c,h,l=0,f=!1,p=!1,g=!0;if("function"!=typeof r)throw new Rt(e);function d(e){var n=s,i=a;return s=a=t,l=e,u=r.apply(i,n)}function v(e){var r=e-h;return h===t||r>=n||r<0||p&&e-l>=o}function m(){var t=Ca();if(v(t))return y(t);c=Ts(m,function(t){var e=n-(t-h);return p?wr(e,o-(t-l)):e}(t))}function y(e){return c=t,g&&s?d(e):(s=a=t,u)}function w(){var e=Ca(),r=v(e);if(s=arguments,a=this,h=e,r){if(c===t)return function(t){return l=t,c=Ts(m,n),f?d(t):u}(h);if(p)return bi(c),c=Ts(m,n),d(h)}return c===t&&(c=Ts(m,n)),u}return n=mo(n)||0,to(i)&&(f=!!i.leading,o=(p="maxWait"in i)?yr(mo(i.maxWait)||0,n):o,g="trailing"in i?!!i.trailing:g),w.cancel=function(){c!==t&&bi(c),l=0,s=h=a=c=t},w.flush=function(){return c===t?u:y(Ca())},w}var Na=Xn(function(t,e){return ln(t,1,e)}),Oa=Xn(function(t,e,r){return ln(t,mo(e)||0,r)});function Ba(t,r){if("function"!=typeof t||null!=r&&"function"!=typeof r)throw new Rt(e);var n=function(){var e=arguments,i=r?r.apply(this,e):e[0],s=n.cache;if(s.has(i))return s.get(i);var a=t.apply(this,e);return n.cache=s.set(i,a)||s,a};return n.cache=new(Ba.Cache||Gr),n}function _a(t){if("function"!=typeof t)throw new Rt(e);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}Ba.Cache=Gr;var ja=Si(function(t,e){var r=(e=1==e.length&&Ua(e[0])?Ne(e[0],Ye(cs())):Ne(yn(e,1),Ye(cs()))).length;return Xn(function(n){for(var i=-1,s=wr(n.length,r);++i<s;)n[i]=e[i].call(this,n[i]);return Fe(t,this,n)})}),Ha=Xn(function(e,r){var n=or(r,us(Ha));return Zi(e,s,t,r,n)}),ka=Xn(function(e,r){var n=or(r,us(ka));return Zi(e,a,t,r,n)}),La=ns(function(e,r){return Zi(e,u,t,t,t,r)});function Va(t,e){return t===e||t!=t&&e!=e}var qa=Gi(Dn),Ma=Gi(function(t,e){return t>=e}),Ka=Nn(function(){return arguments}())?Nn:function(t){return eo(t)&&jt.call(t,"callee")&&!Jt.call(t,"callee")},Ua=Et.isArray,za=ye?Ye(ye):function(t){return eo(t)&&Cn(t)==R};function Wa(t){return null!=t&&Qa(t.length)&&!Xa(t)}function Ga(t){return eo(t)&&Wa(t)}var $a=ze||mu,Ja=we?Ye(we):function(t){return eo(t)&&Cn(t)==m};function Ya(t){if(!eo(t))return!1;var e=Cn(t);return e==y||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!io(t)}function Xa(t){if(!to(t))return!1;var e=Cn(t);return e==w||e==x||"[object AsyncFunction]"==e||"[object Proxy]"==e}function Za(t){return"number"==typeof t&&t==go(t)}function Qa(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=h}function to(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function eo(t){return null!=t&&"object"==typeof t}var ro=xe?Ye(xe):function(t){return eo(t)&&ds(t)==S};function no(t){return"number"==typeof t||eo(t)&&Cn(t)==E}function io(t){if(!eo(t)||Cn(t)!=b)return!1;var e=Gt(t);if(null===e)return!0;var r=jt.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&_t.call(r)==Vt}var so=Se?Ye(Se):function(t){return eo(t)&&Cn(t)==A},ao=Ee?Ye(Ee):function(t){return eo(t)&&ds(t)==C};function oo(t){return"string"==typeof t||!Ua(t)&&eo(t)&&Cn(t)==D}function uo(t){return"symbol"==typeof t||eo(t)&&Cn(t)==P}var co=be?Ye(be):function(t){return eo(t)&&Qa(t.length)&&!!se[Cn(t)]},ho=Gi(Ln),lo=Gi(function(t,e){return t<=e});function fo(t){if(!t)return[];if(Wa(t))return oo(t)?lr(t):Ri(t);if(ee&&t[ee])return function(t){for(var e,r=[];!(e=t.next()).done;)r.push(e.value);return r}(t[ee]());var e=ds(t);return(e==S?sr:e==C?ur:qo)(t)}function po(t){return t?(t=mo(t))===c||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function go(t){var e=po(t),r=e%1;return e==e?r?e-r:e:0}function vo(t){return t?un(go(t),0,f):0}function mo(t){if("number"==typeof t)return t;if(uo(t))return l;if(to(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=to(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Je(t);var r=gt.test(t);return r||vt.test(t)?ce(t.slice(2),r?2:8):pt.test(t)?l:+t}function yo(t){return Ti(t,Oo(t))}function wo(t){return null==t?"":hi(t)}var xo=Oi(function(t,e){if(Fs(e)||Wa(e))Ti(e,No(e),t);else for(var r in e)jt.call(e,r)&&en(t,r,e[r])}),So=Oi(function(t,e){Ti(e,Oo(e),t)}),Eo=Oi(function(t,e,r,n){Ti(e,Oo(e),t,n)}),bo=Oi(function(t,e,r,n){Ti(e,No(e),t,n)}),Fo=ns(on),Ao=Xn(function(e,r){e=Dt(e);var n=-1,i=r.length,s=i>2?r[2]:t;for(s&&xs(r[0],r[1],s)&&(i=1);++n<i;)for(var a=r[n],o=Oo(a),u=-1,c=o.length;++u<c;){var h=o[u],l=e[h];(l===t||Va(l,Ot[h])&&!jt.call(e,h))&&(e[h]=a[h])}return e}),Co=Xn(function(e){return e.push(t,ts),Fe(_o,t,e)});function Do(e,r,n){var i=null==e?t:Fn(e,r);return i===t?n:i}function Po(t,e){return null!=t&&vs(t,e,In)}var Io=Mi(function(t,e,r){null!=e&&"function"!=typeof e.toString&&(e=Lt.call(e)),t[e]=r},eu(iu)),Ro=Mi(function(t,e,r){null!=e&&"function"!=typeof e.toString&&(e=Lt.call(e)),jt.call(t,e)?t[e].push(r):t[e]=[r]},cs),To=Xn(Tn);function No(t){return Wa(t)?Yr(t):Hn(t)}function Oo(t){return Wa(t)?Yr(t,!0):kn(t)}var Bo=Oi(function(t,e,r){Kn(t,e,r)}),_o=Oi(function(t,e,r,n){Kn(t,e,r,n)}),jo=ns(function(t,e){var r={};if(null==t)return r;var n=!1;e=Ne(e,function(e){return e=xi(e,t),n||(n=e.length>1),e}),Ti(t,ss(t),r),n&&(r=cn(r,7,es));for(var i=e.length;i--;)fi(r,e[i]);return r}),Ho=ns(function(t,e){return null==t?{}:function(t,e){return Wn(t,e,function(e,r){return Po(t,r)})}(t,e)});function ko(t,e){if(null==t)return{};var r=Ne(ss(t),function(t){return[t]});return e=cs(e),Wn(t,r,function(t,r){return e(t,r[0])})}var Lo=Xi(No),Vo=Xi(Oo);function qo(t){return null==t?[]:Xe(t,No(t))}var Mo=Hi(function(t,e,r){return e=e.toLowerCase(),t+(r?Ko(e):e)});function Ko(t){return Xo(wo(t).toLowerCase())}function Uo(t){return(t=wo(t))&&t.replace(yt,er).replace(Zt,"")}var zo=Hi(function(t,e,r){return t+(r?"-":"")+e.toLowerCase()}),Wo=Hi(function(t,e,r){return t+(r?" ":"")+e.toLowerCase()}),Go=ji("toLowerCase"),$o=Hi(function(t,e,r){return t+(r?"_":"")+e.toLowerCase()}),Jo=Hi(function(t,e,r){return t+(r?" ":"")+Xo(e)}),Yo=Hi(function(t,e,r){return t+(r?" ":"")+e.toUpperCase()}),Xo=ji("toUpperCase");function Zo(e,r,n){return e=wo(e),(r=n?t:r)===t?function(t){return re.test(t)}(e)?function(t){return t.match(te)||[]}(e):function(t){return t.match(ut)||[]}(e):e.match(r)||[]}var Qo=Xn(function(e,r){try{return Fe(e,t,r)}catch(t){return Ya(t)?t:new Ft(t)}}),tu=ns(function(t,e){return Ce(e,function(e){e=Hs(e),an(t,e,Ia(t[e],t))}),t});function eu(t){return function(){return t}}var ru=Vi(),nu=Vi(!0);function iu(t){return t}function su(t){return jn("function"==typeof t?t:cn(t,1))}var au=Xn(function(t,e){return function(r){return Tn(r,t,e)}}),ou=Xn(function(t,e){return function(r){return Tn(t,r,e)}});function uu(t,e,r){var n=No(e),i=bn(e,n);null!=r||to(e)&&(i.length||!n.length)||(r=e,e=t,t=this,i=bn(e,No(e)));var s=!(to(r)&&"chain"in r&&!r.chain),a=Xa(t);return Ce(i,function(r){var n=e[r];t[r]=n,a&&(t.prototype[r]=function(){var e=this.__chain__;if(s||e){var r=t(this.__wrapped__);return(r.__actions__=Ri(this.__actions__)).push({func:n,args:arguments,thisArg:t}),r.__chain__=e,r}return n.apply(t,Oe([this.value()],arguments))})}),t}function cu(){}var hu=Ui(Ne),lu=Ui(Pe),fu=Ui(je);function pu(t){return Ss(t)?Ue(Hs(t)):function(t){return function(e){return Fn(e,t)}}(t)}var gu=Wi(),du=Wi(!0);function vu(){return[]}function mu(){return!1}var yu,wu=Ki(function(t,e){return t+e},0),xu=Ji("ceil"),Su=Ki(function(t,e){return t/e},1),Eu=Ji("floor"),bu=Ki(function(t,e){return t*e},1),Fu=Ji("round"),Au=Ki(function(t,e){return t-e},0);return Vr.after=function(t,r){if("function"!=typeof r)throw new Rt(e);return t=go(t),function(){if(--t<1)return r.apply(this,arguments)}},Vr.ary=Da,Vr.assign=xo,Vr.assignIn=So,Vr.assignInWith=Eo,Vr.assignWith=bo,Vr.at=Fo,Vr.before=Pa,Vr.bind=Ia,Vr.bindAll=tu,Vr.bindKey=Ra,Vr.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return Ua(t)?t:[t]},Vr.chain=fa,Vr.chunk=function(e,r,n){r=(n?xs(e,r,n):r===t)?1:yr(go(r),0);var i=null==e?0:e.length;if(!i||r<1)return[];for(var s=0,a=0,o=Et(ve(i/r));s<i;)o[a++]=ii(e,s,s+=r);return o},Vr.compact=function(t){for(var e=-1,r=null==t?0:t.length,n=0,i=[];++e<r;){var s=t[e];s&&(i[n++]=s)}return i},Vr.concat=function(){var t=arguments.length;if(!t)return[];for(var e=Et(t-1),r=arguments[0],n=t;n--;)e[n-1]=arguments[n];return Oe(Ua(r)?Ri(r):[r],yn(e,1))},Vr.cond=function(t){var r=null==t?0:t.length,n=cs();return t=r?Ne(t,function(t){if("function"!=typeof t[1])throw new Rt(e);return[n(t[0]),t[1]]}):[],Xn(function(e){for(var n=-1;++n<r;){var i=t[n];if(Fe(i[0],this,e))return Fe(i[1],this,e)}})},Vr.conforms=function(t){return function(t){var e=No(t);return function(r){return hn(r,t,e)}}(cn(t,1))},Vr.constant=eu,Vr.countBy=da,Vr.create=function(t,e){var r=qr(t);return null==e?r:sn(r,e)},Vr.curry=function e(r,n,i){var s=Zi(r,8,t,t,t,t,t,n=i?t:n);return s.placeholder=e.placeholder,s},Vr.curryRight=function e(r,n,s){var a=Zi(r,i,t,t,t,t,t,n=s?t:n);return a.placeholder=e.placeholder,a},Vr.debounce=Ta,Vr.defaults=Ao,Vr.defaultsDeep=Co,Vr.defer=Na,Vr.delay=Oa,Vr.difference=Vs,Vr.differenceBy=qs,Vr.differenceWith=Ms,Vr.drop=function(e,r,n){var i=null==e?0:e.length;return i?ii(e,(r=n||r===t?1:go(r))<0?0:r,i):[]},Vr.dropRight=function(e,r,n){var i=null==e?0:e.length;return i?ii(e,0,(r=i-(r=n||r===t?1:go(r)))<0?0:r):[]},Vr.dropRightWhile=function(t,e){return t&&t.length?gi(t,cs(e,3),!0,!0):[]},Vr.dropWhile=function(t,e){return t&&t.length?gi(t,cs(e,3),!0):[]},Vr.fill=function(e,r,n,i){var s=null==e?0:e.length;return s?(n&&"number"!=typeof n&&xs(e,r,n)&&(n=0,i=s),function(e,r,n,i){var s=e.length;for((n=go(n))<0&&(n=-n>s?0:s+n),(i=i===t||i>s?s:go(i))<0&&(i+=s),i=n>i?0:vo(i);n<i;)e[n++]=r;return e}(e,r,n,i)):[]},Vr.filter=function(t,e){return(Ua(t)?Ie:mn)(t,cs(e,3))},Vr.flatMap=function(t,e){return yn(ba(t,e),1)},Vr.flatMapDeep=function(t,e){return yn(ba(t,e),c)},Vr.flatMapDepth=function(e,r,n){return n=n===t?1:go(n),yn(ba(e,r),n)},Vr.flatten=zs,Vr.flattenDeep=function(t){return null!=t&&t.length?yn(t,c):[]},Vr.flattenDepth=function(e,r){return null!=e&&e.length?yn(e,r=r===t?1:go(r)):[]},Vr.flip=function(t){return Zi(t,512)},Vr.flow=ru,Vr.flowRight=nu,Vr.fromPairs=function(t){for(var e=-1,r=null==t?0:t.length,n={};++e<r;){var i=t[e];n[i[0]]=i[1]}return n},Vr.functions=function(t){return null==t?[]:bn(t,No(t))},Vr.functionsIn=function(t){return null==t?[]:bn(t,Oo(t))},Vr.groupBy=xa,Vr.initial=function(t){return null!=t&&t.length?ii(t,0,-1):[]},Vr.intersection=Gs,Vr.intersectionBy=$s,Vr.intersectionWith=Js,Vr.invert=Io,Vr.invertBy=Ro,Vr.invokeMap=Sa,Vr.iteratee=su,Vr.keyBy=Ea,Vr.keys=No,Vr.keysIn=Oo,Vr.map=ba,Vr.mapKeys=function(t,e){var r={};return e=cs(e,3),Sn(t,function(t,n,i){an(r,e(t,n,i),t)}),r},Vr.mapValues=function(t,e){var r={};return e=cs(e,3),Sn(t,function(t,n,i){an(r,n,e(t,n,i))}),r},Vr.matches=function(t){return qn(cn(t,1))},Vr.matchesProperty=function(t,e){return Mn(t,cn(e,1))},Vr.memoize=Ba,Vr.merge=Bo,Vr.mergeWith=_o,Vr.method=au,Vr.methodOf=ou,Vr.mixin=uu,Vr.negate=_a,Vr.nthArg=function(t){return t=go(t),Xn(function(e){return Un(e,t)})},Vr.omit=jo,Vr.omitBy=function(t,e){return ko(t,_a(cs(e)))},Vr.once=function(t){return Pa(2,t)},Vr.orderBy=function(e,r,n,i){return null==e?[]:(Ua(r)||(r=null==r?[]:[r]),Ua(n=i?t:n)||(n=null==n?[]:[n]),zn(e,r,n))},Vr.over=hu,Vr.overArgs=ja,Vr.overEvery=lu,Vr.overSome=fu,Vr.partial=Ha,Vr.partialRight=ka,Vr.partition=Fa,Vr.pick=Ho,Vr.pickBy=ko,Vr.property=pu,Vr.propertyOf=function(e){return function(r){return null==e?t:Fn(e,r)}},Vr.pull=Xs,Vr.pullAll=Zs,Vr.pullAllBy=function(t,e,r){return t&&t.length&&e&&e.length?Gn(t,e,cs(r,2)):t},Vr.pullAllWith=function(e,r,n){return e&&e.length&&r&&r.length?Gn(e,r,t,n):e},Vr.pullAt=Qs,Vr.range=gu,Vr.rangeRight=du,Vr.rearg=La,Vr.reject=function(t,e){return(Ua(t)?Ie:mn)(t,_a(cs(e,3)))},Vr.remove=function(t,e){var r=[];if(!t||!t.length)return r;var n=-1,i=[],s=t.length;for(e=cs(e,3);++n<s;){var a=t[n];e(a,n,t)&&(r.push(a),i.push(n))}return $n(t,i),r},Vr.rest=function(r,n){if("function"!=typeof r)throw new Rt(e);return Xn(r,n=n===t?n:go(n))},Vr.reverse=ta,Vr.sampleSize=function(e,r,n){return r=(n?xs(e,r,n):r===t)?1:go(r),(Ua(e)?Zr:Qn)(e,r)},Vr.set=function(t,e,r){return null==t?t:ti(t,e,r)},Vr.setWith=function(e,r,n,i){return i="function"==typeof i?i:t,null==e?e:ti(e,r,n,i)},Vr.shuffle=function(t){return(Ua(t)?Qr:ni)(t)},Vr.slice=function(e,r,n){var i=null==e?0:e.length;return i?(n&&"number"!=typeof n&&xs(e,r,n)?(r=0,n=i):(r=null==r?0:go(r),n=n===t?i:go(n)),ii(e,r,n)):[]},Vr.sortBy=Aa,Vr.sortedUniq=function(t){return t&&t.length?ui(t):[]},Vr.sortedUniqBy=function(t,e){return t&&t.length?ui(t,cs(e,2)):[]},Vr.split=function(e,r,n){return n&&"number"!=typeof n&&xs(e,r,n)&&(r=n=t),(n=n===t?f:n>>>0)?(e=wo(e))&&("string"==typeof r||null!=r&&!so(r))&&!(r=hi(r))&&ir(e)?Ei(lr(e),0,n):e.split(r,n):[]},Vr.spread=function(t,r){if("function"!=typeof t)throw new Rt(e);return r=null==r?0:yr(go(r),0),Xn(function(e){var n=e[r],i=Ei(e,0,r);return n&&Oe(i,n),Fe(t,this,i)})},Vr.tail=function(t){var e=null==t?0:t.length;return e?ii(t,1,e):[]},Vr.take=function(e,r,n){return e&&e.length?ii(e,0,(r=n||r===t?1:go(r))<0?0:r):[]},Vr.takeRight=function(e,r,n){var i=null==e?0:e.length;return i?ii(e,(r=i-(r=n||r===t?1:go(r)))<0?0:r,i):[]},Vr.takeRightWhile=function(t,e){return t&&t.length?gi(t,cs(e,3),!1,!0):[]},Vr.takeWhile=function(t,e){return t&&t.length?gi(t,cs(e,3)):[]},Vr.tap=function(t,e){return e(t),t},Vr.throttle=function(t,r,n){var i=!0,s=!0;if("function"!=typeof t)throw new Rt(e);return to(n)&&(i="leading"in n?!!n.leading:i,s="trailing"in n?!!n.trailing:s),Ta(t,r,{leading:i,maxWait:r,trailing:s})},Vr.thru=pa,Vr.toArray=fo,Vr.toPairs=Lo,Vr.toPairsIn=Vo,Vr.toPath=function(t){return Ua(t)?Ne(t,Hs):uo(t)?[t]:Ri(js(wo(t)))},Vr.toPlainObject=yo,Vr.transform=function(t,e,r){var n=Ua(t),i=n||$a(t)||co(t);if(e=cs(e,4),null==r){var s=t&&t.constructor;r=i?n?new s:[]:to(t)&&Xa(s)?qr(Gt(t)):{}}return(i?Ce:Sn)(t,function(t,n,i){return e(r,t,n,i)}),r},Vr.unary=function(t){return Da(t,1)},Vr.union=ea,Vr.unionBy=ra,Vr.unionWith=na,Vr.uniq=function(t){return t&&t.length?li(t):[]},Vr.uniqBy=function(t,e){return t&&t.length?li(t,cs(e,2)):[]},Vr.uniqWith=function(e,r){return r="function"==typeof r?r:t,e&&e.length?li(e,t,r):[]},Vr.unset=function(t,e){return null==t||fi(t,e)},Vr.unzip=ia,Vr.unzipWith=sa,Vr.update=function(t,e,r){return null==t?t:pi(t,e,wi(r))},Vr.updateWith=function(e,r,n,i){return i="function"==typeof i?i:t,null==e?e:pi(e,r,wi(n),i)},Vr.values=qo,Vr.valuesIn=function(t){return null==t?[]:Xe(t,Oo(t))},Vr.without=aa,Vr.words=Zo,Vr.wrap=function(t,e){return Ha(wi(e),t)},Vr.xor=oa,Vr.xorBy=ua,Vr.xorWith=ca,Vr.zip=ha,Vr.zipObject=function(t,e){return mi(t||[],e||[],en)},Vr.zipObjectDeep=function(t,e){return mi(t||[],e||[],ti)},Vr.zipWith=la,Vr.entries=Lo,Vr.entriesIn=Vo,Vr.extend=So,Vr.extendWith=Eo,uu(Vr,Vr),Vr.add=wu,Vr.attempt=Qo,Vr.camelCase=Mo,Vr.capitalize=Ko,Vr.ceil=xu,Vr.clamp=function(e,r,n){return n===t&&(n=r,r=t),n!==t&&(n=(n=mo(n))==n?n:0),r!==t&&(r=(r=mo(r))==r?r:0),un(mo(e),r,n)},Vr.clone=function(t){return cn(t,4)},Vr.cloneDeep=function(t){return cn(t,5)},Vr.cloneDeepWith=function(e,r){return cn(e,5,r="function"==typeof r?r:t)},Vr.cloneWith=function(e,r){return cn(e,4,r="function"==typeof r?r:t)},Vr.conformsTo=function(t,e){return null==e||hn(t,e,No(e))},Vr.deburr=Uo,Vr.defaultTo=function(t,e){return null==t||t!=t?e:t},Vr.divide=Su,Vr.endsWith=function(e,r,n){e=wo(e),r=hi(r);var i=e.length,s=n=n===t?i:un(go(n),0,i);return(n-=r.length)>=0&&e.slice(n,s)==r},Vr.eq=Va,Vr.escape=function(t){return(t=wo(t))&&G.test(t)?t.replace(z,rr):t},Vr.escapeRegExp=function(t){return(t=wo(t))&&et.test(t)?t.replace(tt,"\\$&"):t},Vr.every=function(e,r,n){var i=Ua(e)?Pe:dn;return n&&xs(e,r,n)&&(r=t),i(e,cs(r,3))},Vr.find=va,Vr.findIndex=Ks,Vr.findKey=function(t,e){return ke(t,cs(e,3),Sn)},Vr.findLast=ma,Vr.findLastIndex=Us,Vr.findLastKey=function(t,e){return ke(t,cs(e,3),En)},Vr.floor=Eu,Vr.forEach=ya,Vr.forEachRight=wa,Vr.forIn=function(t,e){return null==t?t:wn(t,cs(e,3),Oo)},Vr.forInRight=function(t,e){return null==t?t:xn(t,cs(e,3),Oo)},Vr.forOwn=function(t,e){return t&&Sn(t,cs(e,3))},Vr.forOwnRight=function(t,e){return t&&En(t,cs(e,3))},Vr.get=Do,Vr.gt=qa,Vr.gte=Ma,Vr.has=function(t,e){return null!=t&&vs(t,e,Pn)},Vr.hasIn=Po,Vr.head=Ws,Vr.identity=iu,Vr.includes=function(t,e,r,n){t=Wa(t)?t:qo(t),r=r&&!n?go(r):0;var i=t.length;return r<0&&(r=yr(i+r,0)),oo(t)?r<=i&&t.indexOf(e,r)>-1:!!i&&Ve(t,e,r)>-1},Vr.indexOf=function(t,e,r){var n=null==t?0:t.length;if(!n)return-1;var i=null==r?0:go(r);return i<0&&(i=yr(n+i,0)),Ve(t,e,i)},Vr.inRange=function(e,r,n){return r=po(r),n===t?(n=r,r=0):n=po(n),function(t,e,r){return t>=wr(e,r)&&t<yr(e,r)}(e=mo(e),r,n)},Vr.invoke=To,Vr.isArguments=Ka,Vr.isArray=Ua,Vr.isArrayBuffer=za,Vr.isArrayLike=Wa,Vr.isArrayLikeObject=Ga,Vr.isBoolean=function(t){return!0===t||!1===t||eo(t)&&Cn(t)==v},Vr.isBuffer=$a,Vr.isDate=Ja,Vr.isElement=function(t){return eo(t)&&1===t.nodeType&&!io(t)},Vr.isEmpty=function(t){if(null==t)return!0;if(Wa(t)&&(Ua(t)||"string"==typeof t||"function"==typeof t.splice||$a(t)||co(t)||Ka(t)))return!t.length;var e=ds(t);if(e==S||e==C)return!t.size;if(Fs(t))return!Hn(t).length;for(var r in t)if(jt.call(t,r))return!1;return!0},Vr.isEqual=function(t,e){return On(t,e)},Vr.isEqualWith=function(e,r,n){var i=(n="function"==typeof n?n:t)?n(e,r):t;return i===t?On(e,r,t,n):!!i},Vr.isError=Ya,Vr.isFinite=function(t){return"number"==typeof t&&dr(t)},Vr.isFunction=Xa,Vr.isInteger=Za,Vr.isLength=Qa,Vr.isMap=ro,Vr.isMatch=function(t,e){return t===e||Bn(t,e,ls(e))},Vr.isMatchWith=function(e,r,n){return n="function"==typeof n?n:t,Bn(e,r,ls(r),n)},Vr.isNaN=function(t){return no(t)&&t!=+t},Vr.isNative=function(t){if(bs(t))throw new Ft("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return _n(t)},Vr.isNil=function(t){return null==t},Vr.isNull=function(t){return null===t},Vr.isNumber=no,Vr.isObject=to,Vr.isObjectLike=eo,Vr.isPlainObject=io,Vr.isRegExp=so,Vr.isSafeInteger=function(t){return Za(t)&&t>=-9007199254740991&&t<=h},Vr.isSet=ao,Vr.isString=oo,Vr.isSymbol=uo,Vr.isTypedArray=co,Vr.isUndefined=function(e){return e===t},Vr.isWeakMap=function(t){return eo(t)&&ds(t)==I},Vr.isWeakSet=function(t){return eo(t)&&"[object WeakSet]"==Cn(t)},Vr.join=function(t,e){return null==t?"":vr.call(t,e)},Vr.kebabCase=zo,Vr.last=Ys,Vr.lastIndexOf=function(e,r,n){var i=null==e?0:e.length;if(!i)return-1;var s=i;return n!==t&&(s=(s=go(n))<0?yr(i+s,0):wr(s,i-1)),r==r?function(t,e,r){for(var n=r+1;n--;)if(t[n]===e)return n;return n}(e,r,s):Le(e,Me,s,!0)},Vr.lowerCase=Wo,Vr.lowerFirst=Go,Vr.lt=ho,Vr.lte=lo,Vr.max=function(e){return e&&e.length?vn(e,iu,Dn):t},Vr.maxBy=function(e,r){return e&&e.length?vn(e,cs(r,2),Dn):t},Vr.mean=function(t){return Ke(t,iu)},Vr.meanBy=function(t,e){return Ke(t,cs(e,2))},Vr.min=function(e){return e&&e.length?vn(e,iu,Ln):t},Vr.minBy=function(e,r){return e&&e.length?vn(e,cs(r,2),Ln):t},Vr.stubArray=vu,Vr.stubFalse=mu,Vr.stubObject=function(){return{}},Vr.stubString=function(){return""},Vr.stubTrue=function(){return!0},Vr.multiply=bu,Vr.nth=function(e,r){return e&&e.length?Un(e,go(r)):t},Vr.noConflict=function(){return fe._===this&&(fe._=qt),this},Vr.noop=cu,Vr.now=Ca,Vr.pad=function(t,e,r){t=wo(t);var n=(e=go(e))?hr(t):0;if(!e||n>=e)return t;var i=(e-n)/2;return zi(me(i),r)+t+zi(ve(i),r)},Vr.padEnd=function(t,e,r){t=wo(t);var n=(e=go(e))?hr(t):0;return e&&n<e?t+zi(e-n,r):t},Vr.padStart=function(t,e,r){t=wo(t);var n=(e=go(e))?hr(t):0;return e&&n<e?zi(e-n,r)+t:t},Vr.parseInt=function(t,e,r){return r||null==e?e=0:e&&(e=+e),Sr(wo(t).replace(nt,""),e||0)},Vr.random=function(e,r,n){if(n&&"boolean"!=typeof n&&xs(e,r,n)&&(r=n=t),n===t&&("boolean"==typeof r?(n=r,r=t):"boolean"==typeof e&&(n=e,e=t)),e===t&&r===t?(e=0,r=1):(e=po(e),r===t?(r=e,e=0):r=po(r)),e>r){var i=e;e=r,r=i}if(n||e%1||r%1){var s=Er();return wr(e+s*(r-e+ue("1e-"+((s+"").length-1))),r)}return Jn(e,r)},Vr.reduce=function(t,e,r){var n=Ua(t)?Be:We,i=arguments.length<3;return n(t,cs(e,4),r,i,pn)},Vr.reduceRight=function(t,e,r){var n=Ua(t)?_e:We,i=arguments.length<3;return n(t,cs(e,4),r,i,gn)},Vr.repeat=function(e,r,n){return r=(n?xs(e,r,n):r===t)?1:go(r),Yn(wo(e),r)},Vr.replace=function(){var t=arguments,e=wo(t[0]);return t.length<3?e:e.replace(t[1],t[2])},Vr.result=function(e,r,n){var i=-1,s=(r=xi(r,e)).length;for(s||(s=1,e=t);++i<s;){var a=null==e?t:e[Hs(r[i])];a===t&&(i=s,a=n),e=Xa(a)?a.call(e):a}return e},Vr.round=Fu,Vr.runInContext=rt,Vr.sample=function(t){return(Ua(t)?Xr:Zn)(t)},Vr.size=function(t){if(null==t)return 0;if(Wa(t))return oo(t)?hr(t):t.length;var e=ds(t);return e==S||e==C?t.size:Hn(t).length},Vr.snakeCase=$o,Vr.some=function(e,r,n){var i=Ua(e)?je:si;return n&&xs(e,r,n)&&(r=t),i(e,cs(r,3))},Vr.sortedIndex=function(t,e){return ai(t,e)},Vr.sortedIndexBy=function(t,e,r){return oi(t,e,cs(r,2))},Vr.sortedIndexOf=function(t,e){var r=null==t?0:t.length;if(r){var n=ai(t,e);if(n<r&&Va(t[n],e))return n}return-1},Vr.sortedLastIndex=function(t,e){return ai(t,e,!0)},Vr.sortedLastIndexBy=function(t,e,r){return oi(t,e,cs(r,2),!0)},Vr.sortedLastIndexOf=function(t,e){if(null!=t&&t.length){var r=ai(t,e,!0)-1;if(Va(t[r],e))return r}return-1},Vr.startCase=Jo,Vr.startsWith=function(t,e,r){return t=wo(t),r=null==r?0:un(go(r),0,t.length),e=hi(e),t.slice(r,r+e.length)==e},Vr.subtract=Au,Vr.sum=function(t){return t&&t.length?Ge(t,iu):0},Vr.sumBy=function(t,e){return t&&t.length?Ge(t,cs(e,2)):0},Vr.template=function(e,r,n){var i=Vr.templateSettings;n&&xs(e,r,n)&&(r=t),e=wo(e),r=Eo({},r,i,Qi);var s,a,o=Eo({},r.imports,i.imports,Qi),u=No(o),c=Xe(o,u),h=0,l=r.interpolate||wt,f="__p += '",p=Pt((r.escape||wt).source+"|"+l.source+"|"+(l===Y?lt:wt).source+"|"+(r.evaluate||wt).source+"|$","g"),g="//# sourceURL="+(jt.call(r,"sourceURL")?(r.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++ie+"]")+"\n";e.replace(p,function(t,r,n,i,o,u){return n||(n=i),f+=e.slice(h,u).replace(xt,nr),r&&(s=!0,f+="' +\n__e("+r+") +\n'"),o&&(a=!0,f+="';\n"+o+";\n__p += '"),n&&(f+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),h=u+t.length,t}),f+="';\n";var d=jt.call(r,"variable")&&r.variable;if(d){if(ct.test(d))throw new Ft("Invalid `variable` option passed into `_.template`")}else f="with (obj) {\n"+f+"\n}\n";f=(a?f.replace(q,""):f).replace(M,"$1").replace(K,"$1;"),f="function("+(d||"obj")+") {\n"+(d?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(s?", __e = _.escape":"")+(a?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+f+"return __p\n}";var v=Qo(function(){return At(u,g+"return "+f).apply(t,c)});if(v.source=f,Ya(v))throw v;return v},Vr.times=function(t,e){if((t=go(t))<1||t>h)return[];var r=f,n=wr(t,f);e=cs(e),t-=f;for(var i=$e(n,e);++r<t;)e(r);return i},Vr.toFinite=po,Vr.toInteger=go,Vr.toLength=vo,Vr.toLower=function(t){return wo(t).toLowerCase()},Vr.toNumber=mo,Vr.toSafeInteger=function(t){return t?un(go(t),-9007199254740991,h):0===t?t:0},Vr.toString=wo,Vr.toUpper=function(t){return wo(t).toUpperCase()},Vr.trim=function(e,r,n){if((e=wo(e))&&(n||r===t))return Je(e);if(!e||!(r=hi(r)))return e;var i=lr(e),s=lr(r);return Ei(i,Qe(i,s),tr(i,s)+1).join("")},Vr.trimEnd=function(e,r,n){if((e=wo(e))&&(n||r===t))return e.slice(0,fr(e)+1);if(!e||!(r=hi(r)))return e;var i=lr(e);return Ei(i,0,tr(i,lr(r))+1).join("")},Vr.trimStart=function(e,r,n){if((e=wo(e))&&(n||r===t))return e.replace(nt,"");if(!e||!(r=hi(r)))return e;var i=lr(e);return Ei(i,Qe(i,lr(r))).join("")},Vr.truncate=function(e,r){var n=30,i="...";if(to(r)){var s="separator"in r?r.separator:s;n="length"in r?go(r.length):n,i="omission"in r?hi(r.omission):i}var a=(e=wo(e)).length;if(ir(e)){var o=lr(e);a=o.length}if(n>=a)return e;var u=n-hr(i);if(u<1)return i;var c=o?Ei(o,0,u).join(""):e.slice(0,u);if(s===t)return c+i;if(o&&(u+=c.length-u),so(s)){if(e.slice(u).search(s)){var h,l=c;for(s.global||(s=Pt(s.source,wo(ft.exec(s))+"g")),s.lastIndex=0;h=s.exec(l);)var f=h.index;c=c.slice(0,f===t?u:f)}}else if(e.indexOf(hi(s),u)!=u){var p=c.lastIndexOf(s);p>-1&&(c=c.slice(0,p))}return c+i},Vr.unescape=function(t){return(t=wo(t))&&W.test(t)?t.replace(U,pr):t},Vr.uniqueId=function(t){var e=++Ht;return wo(t)+e},Vr.upperCase=Yo,Vr.upperFirst=Xo,Vr.each=ya,Vr.eachRight=wa,Vr.first=Ws,uu(Vr,(yu={},Sn(Vr,function(t,e){jt.call(Vr.prototype,e)||(yu[e]=t)}),yu),{chain:!1}),Vr.VERSION="4.17.21",Ce(["bind","bindKey","curry","curryRight","partial","partialRight"],function(t){Vr[t].placeholder=Vr}),Ce(["drop","take"],function(e,r){Ur.prototype[e]=function(n){n=n===t?1:yr(go(n),0);var i=this.__filtered__&&!r?new Ur(this):this.clone();return i.__filtered__?i.__takeCount__=wr(n,i.__takeCount__):i.__views__.push({size:wr(n,f),type:e+(i.__dir__<0?"Right":"")}),i},Ur.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),Ce(["filter","map","takeWhile"],function(t,e){var r=e+1,n=1==r||3==r;Ur.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:cs(t,3),type:r}),e.__filtered__=e.__filtered__||n,e}}),Ce(["head","last"],function(t,e){var r="take"+(e?"Right":"");Ur.prototype[t]=function(){return this[r](1).value()[0]}}),Ce(["initial","tail"],function(t,e){var r="drop"+(e?"":"Right");Ur.prototype[t]=function(){return this.__filtered__?new Ur(this):this[r](1)}}),Ur.prototype.compact=function(){return this.filter(iu)},Ur.prototype.find=function(t){return this.filter(t).head()},Ur.prototype.findLast=function(t){return this.reverse().find(t)},Ur.prototype.invokeMap=Xn(function(t,e){return"function"==typeof t?new Ur(this):this.map(function(r){return Tn(r,t,e)})}),Ur.prototype.reject=function(t){return this.filter(_a(cs(t)))},Ur.prototype.slice=function(e,r){e=go(e);var n=this;return n.__filtered__&&(e>0||r<0)?new Ur(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),r!==t&&(n=(r=go(r))<0?n.dropRight(-r):n.take(r-e)),n)},Ur.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Ur.prototype.toArray=function(){return this.take(f)},Sn(Ur.prototype,function(e,r){var n=/^(?:filter|find|map|reject)|While$/.test(r),i=/^(?:head|last)$/.test(r),s=Vr[i?"take"+("last"==r?"Right":""):r],a=i||/^find/.test(r);s&&(Vr.prototype[r]=function(){var r=this.__wrapped__,o=i?[1]:arguments,u=r instanceof Ur,c=o[0],h=u||Ua(r),l=function(t){var e=s.apply(Vr,Oe([t],o));return i&&f?e[0]:e};h&&n&&"function"==typeof c&&1!=c.length&&(u=h=!1);var f=this.__chain__,p=!!this.__actions__.length,g=a&&!f,d=u&&!p;if(!a&&h){r=d?r:new Ur(this);var v=e.apply(r,o);return v.__actions__.push({func:pa,args:[l],thisArg:t}),new Kr(v,f)}return g&&d?e.apply(this,o):(v=this.thru(l),g?i?v.value()[0]:v.value():v)})}),Ce(["pop","push","shift","sort","splice","unshift"],function(t){var e=Tt[t],r=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",n=/^(?:pop|shift)$/.test(t);Vr.prototype[t]=function(){var t=arguments;if(n&&!this.__chain__){var i=this.value();return e.apply(Ua(i)?i:[],t)}return this[r](function(r){return e.apply(Ua(r)?r:[],t)})}}),Sn(Ur.prototype,function(t,e){var r=Vr[e];if(r){var n=r.name+"";jt.call(Tr,n)||(Tr[n]=[]),Tr[n].push({name:e,func:r})}}),Tr[qi(t,2).name]=[{name:"wrapper",func:t}],Ur.prototype.clone=function(){var t=new Ur(this.__wrapped__);return t.__actions__=Ri(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=Ri(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=Ri(this.__views__),t},Ur.prototype.reverse=function(){if(this.__filtered__){var t=new Ur(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},Ur.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,r=Ua(t),n=e<0,i=r?t.length:0,s=function(t,e,r){for(var n=-1,i=r.length;++n<i;){var s=r[n],a=s.size;switch(s.type){case"drop":t+=a;break;case"dropRight":e-=a;break;case"take":e=wr(e,t+a);break;case"takeRight":t=yr(t,e-a)}}return{start:t,end:e}}(0,i,this.__views__),a=s.start,o=s.end,u=o-a,c=n?o:a-1,h=this.__iteratees__,l=h.length,f=0,p=wr(u,this.__takeCount__);if(!r||!n&&i==u&&p==u)return di(t,this.__actions__);var g=[];t:for(;u--&&f<p;){for(var d=-1,v=t[c+=e];++d<l;){var m=h[d],y=m.iteratee,w=m.type,x=y(v);if(2==w)v=x;else if(!x){if(1==w)continue t;break t}}g[f++]=v}return g},Vr.prototype.at=ga,Vr.prototype.chain=function(){return fa(this)},Vr.prototype.commit=function(){return new Kr(this.value(),this.__chain__)},Vr.prototype.next=function(){this.__values__===t&&(this.__values__=fo(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?t:this.__values__[this.__index__++]}},Vr.prototype.plant=function(e){for(var r,n=this;n instanceof Mr;){var i=Ls(n);i.__index__=0,i.__values__=t,r?s.__wrapped__=i:r=i;var s=i;n=n.__wrapped__}return s.__wrapped__=e,r},Vr.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Ur){var r=e;return this.__actions__.length&&(r=new Ur(this)),(r=r.reverse()).__actions__.push({func:pa,args:[ta],thisArg:t}),new Kr(r,this.__chain__)}return this.thru(ta)},Vr.prototype.toJSON=Vr.prototype.valueOf=Vr.prototype.value=function(){return di(this.__wrapped__,this.__actions__)},Vr.prototype.first=Vr.prototype.head,ee&&(Vr.prototype[ee]=function(){return this}),Vr}();ge?((ge.exports=gr)._=gr,pe._=gr):fe._=gr}.call(rt);var lo=ho.exports;function fo(t={}){const{getToken:e=()=>"",onUnauthorized:r=()=>{},onError:n=t=>console.error(t),baseURL:i="",timeout:s=8e3}=t,a=co.create();return a.interceptors.request.use(t=>t,t=>Promise.reject(t)),a.interceptors.response.use(t=>{console.log(t,"response xxx 888888888");const e=t.data,i=t.config.responseType;if("blob"===i||"arraybuffer"===i)return e;const s=e.code;if(void 0!==s)switch(s){case 200:case 201:return e;case 401:return r();default:return void n(e.msg||"Error")}else n("非本系统的接口")},t=>{if(console.log(t,"error xxx"),"ECONNABORTED"===t.code&&t.message.includes("timeout"))return n("请求超时,请稍后重试!"),Promise.reject(t);const e=lo.get(t,"response.status"),i=lo.get(t,"response.data.msg");switch(e){case 400:t.msg="请求错误";break;case 401:t.msg=i||"未授权",r();break;case 403:t.msg=i||"拒绝访问";break;case 404:t.msg="请求地址出错";break;case 408:t.msg="请求超时";break;case 500:t.msg="服务器内部错误";break;case 501:t.msg="服务未实现";break;case 502:t.msg="网关错误";break;case 503:t.msg="服务不可用";break;case 504:t.msg="网关超时";break;case 505:t.msg="HTTP 版本不受支持"}return t.msg&&n(t.msg),Promise.reject(t)}),t=>{const r=e(),n={baseURL:i,headers:{token:r?`${r}`:void 0,"Content-Type":"application/json"},data:{},timeout:s,withCredentials:!1},{signal:o,...u}=t||{},c=lo.merge({},n,u);return o&&(c.signal=o),a(c)}}function po(t,e={}){const{selfKey:n="itemCode",parentKey:i="parentItem",hasChildKey:s="hasChild",defaultExpanded:u=!0}=e,c=a(()=>{const e=void 0!==t.value?t.value:t;return Array.isArray(e)?e:[]});a(()=>{const t=new Map;for(const e of c.value){const r=e[i];r&&(t.has(r)||t.set(r,[]),t.get(r).push(e))}return t});const h=a(()=>{const t=new Map;for(const e of c.value){const r=[],s=e[n];let a=e[i];const o=new Set;for(;a&&!o.has(a)&&a!==s;){o.add(a),r.push(a);const t=c.value.find(t=>t[n]===a);if(!t)break;a=t[i]}t.set(s,r)}return t}),l=r(new Set);o(()=>c.value,()=>(()=>{const t=new Set;if(u)for(const e of c.value)e[s]&&t.add(e[n]);l.value=t})(),{immediate:!0});const f=t=>{const e=h.value.get(t[n]);if(!e||0===e.length)return!0;for(const t of e){const e=c.value.find(e=>e[n]===t);if(e&&e[s]&&!l.value.has(t))return!1}return!0},p=a(()=>c.value.filter(f));return{expandedKeys:l,toggle:t=>{const e=new Set(l.value);e.has(t)?e.delete(t):e.add(t),l.value=e},expandAll:()=>{const t=new Set;for(const e of c.value)e[s]&&t.add(e[n]);l.value=t},collapseAll:()=>{l.value=new Set},visibleList:p}}const go="0.3.10";export{Kr as AUDIT_STATUS_INDEX,Xr as AUDIT_WHITE_LIST,Zr as CLIENT_WHITE_LIST,u as CacheKey,d as MENU_DATA_KEY,mr as PermissionPlugin,Hi as VoucherDecimal,g as WHITE_LIST,Ki as buildLinkedAmountSegments,qr as buildTreeForSave,ur as calculateXSum,yr as checkCrossYear,Ar as companyPeriodDisabled,hr as copyText,fo as createHttpClient,nr as debounce,Br as disabledDate,er as downloadFile,$e as exportFile,vr as extractPermissions,ar as extractPropValues,$r as filterEmptyRows,jr as filterTreeData,Hr as findParent,Wr as focusAndOpenSelectInCell,pr as formatAmount,Ke as formatAmountToUnits,Pr as formatDateTime,lr as formatMenuData,fr as formatMenuTree,We as formatMoney,Ze as formatToFirstDay,ir as generate32BitRandomString,Ur as generateCodeExample,sr as generateTimestamp,N as getCompanyAccountPeriod,k as getCompanyAccountPeriodNow,_ as getCompanyAuditStatusMsg,q as getCompanyAuditStatusMsgNow,b as getCompanyCode,C as getCompanyName,I as getCompanyType,Ue as getCurrentMonth,Or as getDefaultDateTimeRange,Cr as getFileType,Ye as getFileTypeFromUrlRegex,U as getFinancialStandardDictType,Qe as getFormattedDateTime,v as getGlobalProperties,xr as getLevelPadding,Fr as getMinValueItem,br as getPrevMonth,m as getToken,x as getUserInfo,Er as handleBeforeUpload,Ui as handleSubKeydown,Ge as handleViewFile,Gr as hasNonZeroValue,ki as isAccountingEnabled,Ir as isBeforeToday,Li as isCnyCurrency,Rr as isDateInRange,Nr as isTaskContinue,Tr as isTaskStart,_r as openNewWindow,Lr as parseNum,or as percentToNumber,rr as periodDisabledDate,cr as periodDisabledDateAllAfter,f as phoneRegex,wr as positionMap,Je as postExportFile,kr as processCode,Vr as processList,tr as processVoucherArrayEnhanced,c as publicKey,gr as recalculateCashFlowData,B as removeCompanyAccountPeriod,V as removeCompanyAccountPeriodNow,H as removeCompanyAuditStatusMsg,K as removeCompanyAuditStatusMsgNow,A as removeCompanyCode,P as removeCompanyName,T as removeCompanyType,W as removeFinancialStandardDictType,dr as removeOperation,w as removeToken,E as removeUserInfo,Mi as roundMoneyDecimal,qi as roundSubDecimal,Jr as scrollToId,O as setCompanyAccountPeriod,L as setCompanyAccountPeriodNow,j as setCompanyAuditStatusMsg,M as setCompanyAuditStatusMsgNow,F as setCompanyCode,D as setCompanyName,R as setCompanyType,z as setFinancialStandardDictType,y as setToken,S as setUserInfo,Xe as signWithSHA256RSA,l as svgConst,h as svgSjPath,Vi as toVoucherDecimal,Mr as treeHas,ze as truncateToTwoDecimals,p as unclosablePaths,Sr as useGlobalDragUpload,po as useTreeExpand,go as version,Yr as whiteList};
|
|
34
|
+
var tn,en,rn=9e15,nn=1e9,sn="0123456789abcdef",an="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",on="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",un={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-rn,maxE:rn,crypto:!1},cn=!0,hn="[DecimalError] ",ln=hn+"Invalid argument: ",fn=hn+"Precision limit exceeded",pn=hn+"crypto unavailable",gn="[object Decimal]",dn=Math.floor,vn=Math.pow,mn=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,yn=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,wn=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,xn=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Sn=1e7,En=an.length-1,bn=on.length-1,Fn={toStringTag:gn};function An(t){var e,r,n,i=t.length-1,s="",a=t[0];if(i>0){for(s+=a,e=1;e<i;e++)(r=7-(n=t[e]+"").length)&&(s+=jn(r)),s+=n;(r=7-(n=(a=t[e])+"").length)&&(s+=jn(r))}else if(0===a)return"0";for(;a%10==0;)a/=10;return s+a}function Dn(t,e,r){if(t!==~~t||t<e||t>r)throw Error(ln+t)}function Cn(t,e,r,n){var i,s,a,o;for(s=t[0];s>=10;s/=10)--e;return--e<0?(e+=7,i=0):(i=Math.ceil((e+1)/7),e%=7),s=vn(10,7-e),o=t[i]%s|0,null==n?e<3?(0==e?o=o/100|0:1==e&&(o=o/10|0),a=r<4&&99999==o||r>3&&49999==o||5e4==o||0==o):a=(r<4&&o+1==s||r>3&&o+1==s/2)&&(t[i+1]/s/100|0)==vn(10,e-2)-1||(o==s/2||0==o)&&!(t[i+1]/s/100|0):e<4?(0==e?o=o/1e3|0:1==e?o=o/100|0:2==e&&(o=o/10|0),a=(n||r<4)&&9999==o||!n&&r>3&&4999==o):a=((n||r<4)&&o+1==s||!n&&r>3&&o+1==s/2)&&(t[i+1]/s/1e3|0)==vn(10,e-3)-1,a}function In(t,e,r){for(var n,i,s=[0],a=0,o=t.length;a<o;){for(i=s.length;i--;)s[i]*=e;for(s[0]+=sn.indexOf(t.charAt(a++)),n=0;n<s.length;n++)s[n]>r-1&&(void 0===s[n+1]&&(s[n+1]=0),s[n+1]+=s[n]/r|0,s[n]%=r)}return s.reverse()}Fn.absoluteValue=Fn.abs=function(){var t=new this.constructor(this);return t.s<0&&(t.s=1),Rn(t)},Fn.ceil=function(){return Rn(new this.constructor(this),this.e+1,2)},Fn.clampedTo=Fn.clamp=function(t,e){var r=this,n=r.constructor;if(t=new n(t),e=new n(e),!t.s||!e.s)return new n(NaN);if(t.gt(e))throw Error(ln+e);return r.cmp(t)<0?t:r.cmp(e)>0?e:new n(r)},Fn.comparedTo=Fn.cmp=function(t){var e,r,n,i,s=this,a=s.d,o=(t=new s.constructor(t)).d,u=s.s,c=t.s;if(!a||!o)return u&&c?u!==c?u:a===o?0:!a^u<0?1:-1:NaN;if(!a[0]||!o[0])return a[0]?u:o[0]?-c:0;if(u!==c)return u;if(s.e!==t.e)return s.e>t.e^u<0?1:-1;for(e=0,r=(n=a.length)<(i=o.length)?n:i;e<r;++e)if(a[e]!==o[e])return a[e]>o[e]^u<0?1:-1;return n===i?0:n>i^u<0?1:-1},Fn.cosine=Fn.cos=function(){var t,e,r=this,n=r.constructor;return r.d?r.d[0]?(t=n.precision,e=n.rounding,n.precision=t+Math.max(r.e,r.sd())+7,n.rounding=1,r=function(t,e){var r,n,i;if(e.isZero())return e;n=e.d.length,n<32?i=(1/Wn(4,r=Math.ceil(n/3))).toString():(r=16,i="2.3283064365386962890625e-10");t.precision+=r,e=zn(t,1,e.times(i),new t(1));for(var s=r;s--;){var a=e.times(e);e=a.times(a).minus(a).times(8).plus(1)}return t.precision-=r,e}(n,Gn(n,r)),n.precision=t,n.rounding=e,Rn(2==en||3==en?r.neg():r,t,e,!0)):new n(1):new n(NaN)},Fn.cubeRoot=Fn.cbrt=function(){var t,e,r,n,i,s,a,o,u,c,h=this,l=h.constructor;if(!h.isFinite()||h.isZero())return new l(h);for(cn=!1,(s=h.s*vn(h.s*h,1/3))&&Math.abs(s)!=1/0?n=new l(s.toString()):(r=An(h.d),(s=((t=h.e)-r.length+1)%3)&&(r+=1==s||-2==s?"0":"00"),s=vn(r,1/3),t=dn((t+1)/3)-(t%3==(t<0?-1:2)),(n=new l(r=s==1/0?"5e"+t:(r=s.toExponential()).slice(0,r.indexOf("e")+1)+t)).s=h.s),a=(t=l.precision)+3;;)if(c=(u=(o=n).times(o).times(o)).plus(h),n=Pn(c.plus(h).times(o),c.plus(u),a+2,1),An(o.d).slice(0,a)===(r=An(n.d)).slice(0,a)){if("9999"!=(r=r.slice(a-3,a+1))&&(i||"4999"!=r)){+r&&(+r.slice(1)||"5"!=r.charAt(0))||(Rn(n,t+1,1),e=!n.times(n).times(n).eq(h));break}if(!i&&(Rn(o,t+1,0),o.times(o).times(o).eq(h))){n=o;break}a+=4,i=1}return cn=!0,Rn(n,t,l.rounding,e)},Fn.decimalPlaces=Fn.dp=function(){var t,e=this.d,r=NaN;if(e){if(r=7*((t=e.length-1)-dn(this.e/7)),t=e[t])for(;t%10==0;t/=10)r--;r<0&&(r=0)}return r},Fn.dividedBy=Fn.div=function(t){return Pn(this,new this.constructor(t))},Fn.dividedToIntegerBy=Fn.divToInt=function(t){var e=this.constructor;return Rn(Pn(this,new e(t),0,1,1),e.precision,e.rounding)},Fn.equals=Fn.eq=function(t){return 0===this.cmp(t)},Fn.floor=function(){return Rn(new this.constructor(this),this.e+1,3)},Fn.greaterThan=Fn.gt=function(t){return this.cmp(t)>0},Fn.greaterThanOrEqualTo=Fn.gte=function(t){var e=this.cmp(t);return 1==e||0===e},Fn.hyperbolicCosine=Fn.cosh=function(){var t,e,r,n,i,s=this,a=s.constructor,o=new a(1);if(!s.isFinite())return new a(s.s?1/0:NaN);if(s.isZero())return o;r=a.precision,n=a.rounding,a.precision=r+Math.max(s.e,s.sd())+4,a.rounding=1,(i=s.d.length)<32?e=(1/Wn(4,t=Math.ceil(i/3))).toString():(t=16,e="2.3283064365386962890625e-10"),s=zn(a,1,s.times(e),new a(1),!0);for(var u,c=t,h=new a(8);c--;)u=s.times(s),s=o.minus(u.times(h.minus(u.times(h))));return Rn(s,a.precision=r,a.rounding=n,!0)},Fn.hyperbolicSine=Fn.sinh=function(){var t,e,r,n,i=this,s=i.constructor;if(!i.isFinite()||i.isZero())return new s(i);if(e=s.precision,r=s.rounding,s.precision=e+Math.max(i.e,i.sd())+4,s.rounding=1,(n=i.d.length)<3)i=zn(s,2,i,i,!0);else{t=(t=1.4*Math.sqrt(n))>16?16:0|t,i=zn(s,2,i=i.times(1/Wn(5,t)),i,!0);for(var a,o=new s(5),u=new s(16),c=new s(20);t--;)a=i.times(i),i=i.times(o.plus(a.times(u.times(a).plus(c))))}return s.precision=e,s.rounding=r,Rn(i,e,r,!0)},Fn.hyperbolicTangent=Fn.tanh=function(){var t,e,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(t=n.precision,e=n.rounding,n.precision=t+7,n.rounding=1,Pn(r.sinh(),r.cosh(),n.precision=t,n.rounding=e)):new n(r.s)},Fn.inverseCosine=Fn.acos=function(){var t=this,e=t.constructor,r=t.abs().cmp(1),n=e.precision,i=e.rounding;return-1!==r?0===r?t.isNeg()?Bn(e,n,i):new e(0):new e(NaN):t.isZero()?Bn(e,n+4,i).times(.5):(e.precision=n+6,e.rounding=1,t=new e(1).minus(t).div(t.plus(1)).sqrt().atan(),e.precision=n,e.rounding=i,t.times(2))},Fn.inverseHyperbolicCosine=Fn.acosh=function(){var t,e,r=this,n=r.constructor;return r.lte(1)?new n(r.eq(1)?0:NaN):r.isFinite()?(t=n.precision,e=n.rounding,n.precision=t+Math.max(Math.abs(r.e),r.sd())+4,n.rounding=1,cn=!1,r=r.times(r).minus(1).sqrt().plus(r),cn=!0,n.precision=t,n.rounding=e,r.ln()):new n(r)},Fn.inverseHyperbolicSine=Fn.asinh=function(){var t,e,r=this,n=r.constructor;return!r.isFinite()||r.isZero()?new n(r):(t=n.precision,e=n.rounding,n.precision=t+2*Math.max(Math.abs(r.e),r.sd())+6,n.rounding=1,cn=!1,r=r.times(r).plus(1).sqrt().plus(r),cn=!0,n.precision=t,n.rounding=e,r.ln())},Fn.inverseHyperbolicTangent=Fn.atanh=function(){var t,e,r,n,i=this,s=i.constructor;return i.isFinite()?i.e>=0?new s(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(t=s.precision,e=s.rounding,n=i.sd(),Math.max(n,t)<2*-i.e-1?Rn(new s(i),t,e,!0):(s.precision=r=n-i.e,i=Pn(i.plus(1),new s(1).minus(i),r+t,1),s.precision=t+4,s.rounding=1,i=i.ln(),s.precision=t,s.rounding=e,i.times(.5))):new s(NaN)},Fn.inverseSine=Fn.asin=function(){var t,e,r,n,i=this,s=i.constructor;return i.isZero()?new s(i):(e=i.abs().cmp(1),r=s.precision,n=s.rounding,-1!==e?0===e?((t=Bn(s,r+4,n).times(.5)).s=i.s,t):new s(NaN):(s.precision=r+6,s.rounding=1,i=i.div(new s(1).minus(i.times(i)).sqrt().plus(1)).atan(),s.precision=r,s.rounding=n,i.times(2)))},Fn.inverseTangent=Fn.atan=function(){var t,e,r,n,i,s,a,o,u,c=this,h=c.constructor,l=h.precision,f=h.rounding;if(c.isFinite()){if(c.isZero())return new h(c);if(c.abs().eq(1)&&l+4<=bn)return(a=Bn(h,l+4,f).times(.25)).s=c.s,a}else{if(!c.s)return new h(NaN);if(l+4<=bn)return(a=Bn(h,l+4,f).times(.5)).s=c.s,a}for(h.precision=o=l+10,h.rounding=1,t=r=Math.min(28,o/7+2|0);t;--t)c=c.div(c.times(c).plus(1).sqrt().plus(1));for(cn=!1,e=Math.ceil(o/7),n=1,u=c.times(c),a=new h(c),i=c;-1!==t;)if(i=i.times(u),s=a.minus(i.div(n+=2)),i=i.times(u),void 0!==(a=s.plus(i.div(n+=2))).d[e])for(t=e;a.d[t]===s.d[t]&&t--;);return r&&(a=a.times(2<<r-1)),cn=!0,Rn(a,h.precision=l,h.rounding=f,!0)},Fn.isFinite=function(){return!!this.d},Fn.isInteger=Fn.isInt=function(){return!!this.d&&dn(this.e/7)>this.d.length-2},Fn.isNaN=function(){return!this.s},Fn.isNegative=Fn.isNeg=function(){return this.s<0},Fn.isPositive=Fn.isPos=function(){return this.s>0},Fn.isZero=function(){return!!this.d&&0===this.d[0]},Fn.lessThan=Fn.lt=function(t){return this.cmp(t)<0},Fn.lessThanOrEqualTo=Fn.lte=function(t){return this.cmp(t)<1},Fn.logarithm=Fn.log=function(t){var e,r,n,i,s,a,o,u,c=this,h=c.constructor,l=h.precision,f=h.rounding;if(null==t)t=new h(10),e=!0;else{if(r=(t=new h(t)).d,t.s<0||!r||!r[0]||t.eq(1))return new h(NaN);e=t.eq(10)}if(r=c.d,c.s<0||!r||!r[0]||c.eq(1))return new h(r&&!r[0]?-1/0:1!=c.s?NaN:r?0:1/0);if(e)if(r.length>1)s=!0;else{for(i=r[0];i%10==0;)i/=10;s=1!==i}if(cn=!1,a=qn(c,o=l+5),n=e?On(h,o+10):qn(t,o),Cn((u=Pn(a,n,o,1)).d,i=l,f))do{if(a=qn(c,o+=10),n=e?On(h,o+10):qn(t,o),u=Pn(a,n,o,1),!s){+An(u.d).slice(i+1,i+15)+1==1e14&&(u=Rn(u,l+1,0));break}}while(Cn(u.d,i+=10,f));return cn=!0,Rn(u,l,f)},Fn.minus=Fn.sub=function(t){var e,r,n,i,s,a,o,u,c,h,l,f,p=this,g=p.constructor;if(t=new g(t),!p.d||!t.d)return p.s&&t.s?p.d?t.s=-t.s:t=new g(t.d||p.s!==t.s?p:NaN):t=new g(NaN),t;if(p.s!=t.s)return t.s=-t.s,p.plus(t);if(c=p.d,f=t.d,o=g.precision,u=g.rounding,!c[0]||!f[0]){if(f[0])t.s=-t.s;else{if(!c[0])return new g(3===u?-0:0);t=new g(p)}return cn?Rn(t,o,u):t}if(r=dn(t.e/7),h=dn(p.e/7),c=c.slice(),s=h-r){for((l=s<0)?(e=c,s=-s,a=f.length):(e=f,r=h,a=c.length),s>(n=Math.max(Math.ceil(o/7),a)+2)&&(s=n,e.length=1),e.reverse(),n=s;n--;)e.push(0);e.reverse()}else{for((l=(n=c.length)<(a=f.length))&&(a=n),n=0;n<a;n++)if(c[n]!=f[n]){l=c[n]<f[n];break}s=0}for(l&&(e=c,c=f,f=e,t.s=-t.s),a=c.length,n=f.length-a;n>0;--n)c[a++]=0;for(n=f.length;n>s;){if(c[--n]<f[n]){for(i=n;i&&0===c[--i];)c[i]=Sn-1;--c[i],c[n]+=Sn}c[n]-=f[n]}for(;0===c[--a];)c.pop();for(;0===c[0];c.shift())--r;return c[0]?(t.d=c,t.e=Nn(c,r),cn?Rn(t,o,u):t):new g(3===u?-0:0)},Fn.modulo=Fn.mod=function(t){var e,r=this,n=r.constructor;return t=new n(t),!r.d||!t.s||t.d&&!t.d[0]?new n(NaN):!t.d||r.d&&!r.d[0]?Rn(new n(r),n.precision,n.rounding):(cn=!1,9==n.modulo?(e=Pn(r,t.abs(),0,3,1)).s*=t.s:e=Pn(r,t,0,n.modulo,1),e=e.times(t),cn=!0,r.minus(e))},Fn.naturalExponential=Fn.exp=function(){return Vn(this)},Fn.naturalLogarithm=Fn.ln=function(){return qn(this)},Fn.negated=Fn.neg=function(){var t=new this.constructor(this);return t.s=-t.s,Rn(t)},Fn.plus=Fn.add=function(t){var e,r,n,i,s,a,o,u,c,h,l=this,f=l.constructor;if(t=new f(t),!l.d||!t.d)return l.s&&t.s?l.d||(t=new f(t.d||l.s===t.s?l:NaN)):t=new f(NaN),t;if(l.s!=t.s)return t.s=-t.s,l.minus(t);if(c=l.d,h=t.d,o=f.precision,u=f.rounding,!c[0]||!h[0])return h[0]||(t=new f(l)),cn?Rn(t,o,u):t;if(s=dn(l.e/7),n=dn(t.e/7),c=c.slice(),i=s-n){for(i<0?(r=c,i=-i,a=h.length):(r=h,n=s,a=c.length),i>(a=(s=Math.ceil(o/7))>a?s+1:a+1)&&(i=a,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for((a=c.length)-(i=h.length)<0&&(i=a,r=h,h=c,c=r),e=0;i;)e=(c[--i]=c[i]+h[i]+e)/Sn|0,c[i]%=Sn;for(e&&(c.unshift(e),++n),a=c.length;0==c[--a];)c.pop();return t.d=c,t.e=Nn(c,n),cn?Rn(t,o,u):t},Fn.precision=Fn.sd=function(t){var e,r=this;if(void 0!==t&&t!==!!t&&1!==t&&0!==t)throw Error(ln+t);return r.d?(e=_n(r.d),t&&r.e+1>e&&(e=r.e+1)):e=NaN,e},Fn.round=function(){var t=this,e=t.constructor;return Rn(new e(t),t.e+1,e.rounding)},Fn.sine=Fn.sin=function(){var t,e,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(t=n.precision,e=n.rounding,n.precision=t+Math.max(r.e,r.sd())+7,n.rounding=1,r=function(t,e){var r,n=e.d.length;if(n<3)return e.isZero()?e:zn(t,2,e,e);r=1.4*Math.sqrt(n),r=r>16?16:0|r,e=e.times(1/Wn(5,r)),e=zn(t,2,e,e);for(var i,s=new t(5),a=new t(16),o=new t(20);r--;)i=e.times(e),e=e.times(s.plus(i.times(a.times(i).minus(o))));return e}(n,Gn(n,r)),n.precision=t,n.rounding=e,Rn(en>2?r.neg():r,t,e,!0)):new n(NaN)},Fn.squareRoot=Fn.sqrt=function(){var t,e,r,n,i,s,a=this,o=a.d,u=a.e,c=a.s,h=a.constructor;if(1!==c||!o||!o[0])return new h(!c||c<0&&(!o||o[0])?NaN:o?a:1/0);for(cn=!1,0==(c=Math.sqrt(+a))||c==1/0?(((e=An(o)).length+u)%2==0&&(e+="0"),c=Math.sqrt(e),u=dn((u+1)/2)-(u<0||u%2),n=new h(e=c==1/0?"5e"+u:(e=c.toExponential()).slice(0,e.indexOf("e")+1)+u)):n=new h(c.toString()),r=(u=h.precision)+3;;)if(n=(s=n).plus(Pn(a,s,r+2,1)).times(.5),An(s.d).slice(0,r)===(e=An(n.d)).slice(0,r)){if("9999"!=(e=e.slice(r-3,r+1))&&(i||"4999"!=e)){+e&&(+e.slice(1)||"5"!=e.charAt(0))||(Rn(n,u+1,1),t=!n.times(n).eq(a));break}if(!i&&(Rn(s,u+1,0),s.times(s).eq(a))){n=s;break}r+=4,i=1}return cn=!0,Rn(n,u,h.rounding,t)},Fn.tangent=Fn.tan=function(){var t,e,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(t=n.precision,e=n.rounding,n.precision=t+10,n.rounding=1,(r=r.sin()).s=1,r=Pn(r,new n(1).minus(r.times(r)).sqrt(),t+10,0),n.precision=t,n.rounding=e,Rn(2==en||4==en?r.neg():r,t,e,!0)):new n(NaN)},Fn.times=Fn.mul=function(t){var e,r,n,i,s,a,o,u,c,h=this,l=h.constructor,f=h.d,p=(t=new l(t)).d;if(t.s*=h.s,!(f&&f[0]&&p&&p[0]))return new l(!t.s||f&&!f[0]&&!p||p&&!p[0]&&!f?NaN:f&&p?0*t.s:t.s/0);for(r=dn(h.e/7)+dn(t.e/7),(u=f.length)<(c=p.length)&&(s=f,f=p,p=s,a=u,u=c,c=a),s=[],n=a=u+c;n--;)s.push(0);for(n=c;--n>=0;){for(e=0,i=u+n;i>n;)o=s[i]+p[n]*f[i-n-1]+e,s[i--]=o%Sn|0,e=o/Sn|0;s[i]=(s[i]+e)%Sn|0}for(;!s[--a];)s.pop();return e?++r:s.shift(),t.d=s,t.e=Nn(s,r),cn?Rn(t,l.precision,l.rounding):t},Fn.toBinary=function(t,e){return $n(this,2,t,e)},Fn.toDecimalPlaces=Fn.toDP=function(t,e){var r=this,n=r.constructor;return r=new n(r),void 0===t?r:(Dn(t,0,nn),void 0===e?e=n.rounding:Dn(e,0,8),Rn(r,t+r.e+1,e))},Fn.toExponential=function(t,e){var r,n=this,i=n.constructor;return void 0===t?r=Tn(n,!0):(Dn(t,0,nn),void 0===e?e=i.rounding:Dn(e,0,8),r=Tn(n=Rn(new i(n),t+1,e),!0,t+1)),n.isNeg()&&!n.isZero()?"-"+r:r},Fn.toFixed=function(t,e){var r,n,i=this,s=i.constructor;return void 0===t?r=Tn(i):(Dn(t,0,nn),void 0===e?e=s.rounding:Dn(e,0,8),r=Tn(n=Rn(new s(i),t+i.e+1,e),!1,t+n.e+1)),i.isNeg()&&!i.isZero()?"-"+r:r},Fn.toFraction=function(t){var e,r,n,i,s,a,o,u,c,h,l,f,p=this,g=p.d,d=p.constructor;if(!g)return new d(p);if(c=r=new d(1),n=u=new d(0),a=(s=(e=new d(n)).e=_n(g)-p.e-1)%7,e.d[0]=vn(10,a<0?7+a:a),null==t)t=s>0?e:c;else{if(!(o=new d(t)).isInt()||o.lt(c))throw Error(ln+o);t=o.gt(e)?s>0?e:c:o}for(cn=!1,o=new d(An(g)),h=d.precision,d.precision=s=7*g.length*2;l=Pn(o,e,0,1,1),1!=(i=r.plus(l.times(n))).cmp(t);)r=n,n=i,i=c,c=u.plus(l.times(i)),u=i,i=e,e=o.minus(l.times(i)),o=i;return i=Pn(t.minus(r),n,0,1,1),u=u.plus(i.times(c)),r=r.plus(i.times(n)),u.s=c.s=p.s,f=Pn(c,n,s,1).minus(p).abs().cmp(Pn(u,r,s,1).minus(p).abs())<1?[c,n]:[u,r],d.precision=h,cn=!0,f},Fn.toHexadecimal=Fn.toHex=function(t,e){return $n(this,16,t,e)},Fn.toNearest=function(t,e){var r=this,n=r.constructor;if(r=new n(r),null==t){if(!r.d)return r;t=new n(1),e=n.rounding}else{if(t=new n(t),void 0===e?e=n.rounding:Dn(e,0,8),!r.d)return t.s?r:t;if(!t.d)return t.s&&(t.s=r.s),t}return t.d[0]?(cn=!1,r=Pn(r,t,0,e,1).times(t),cn=!0,Rn(r)):(t.s=r.s,r=t),r},Fn.toNumber=function(){return+this},Fn.toOctal=function(t,e){return $n(this,8,t,e)},Fn.toPower=Fn.pow=function(t){var e,r,n,i,s,a,o=this,u=o.constructor,c=+(t=new u(t));if(!(o.d&&t.d&&o.d[0]&&t.d[0]))return new u(vn(+o,c));if((o=new u(o)).eq(1))return o;if(n=u.precision,s=u.rounding,t.eq(1))return Rn(o,n,s);if((e=dn(t.e/7))>=t.d.length-1&&(r=c<0?-c:c)<=9007199254740991)return i=Hn(u,o,r,n),t.s<0?new u(1).div(i):Rn(i,n,s);if((a=o.s)<0){if(e<t.d.length-1)return new u(NaN);if(1&t.d[e]||(a=1),0==o.e&&1==o.d[0]&&1==o.d.length)return o.s=a,o}return(e=0!=(r=vn(+o,c))&&isFinite(r)?new u(r+"").e:dn(c*(Math.log("0."+An(o.d))/Math.LN10+o.e+1)))>u.maxE+1||e<u.minE-1?new u(e>0?a/0:0):(cn=!1,u.rounding=o.s=1,r=Math.min(12,(e+"").length),(i=Vn(t.times(qn(o,n+r)),n)).d&&Cn((i=Rn(i,n+5,1)).d,n,s)&&(e=n+10,+An((i=Rn(Vn(t.times(qn(o,e+r)),e),e+5,1)).d).slice(n+1,n+15)+1==1e14&&(i=Rn(i,n+1,0))),i.s=a,cn=!0,u.rounding=s,Rn(i,n,s))},Fn.toPrecision=function(t,e){var r,n=this,i=n.constructor;return void 0===t?r=Tn(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(Dn(t,1,nn),void 0===e?e=i.rounding:Dn(e,0,8),r=Tn(n=Rn(new i(n),t,e),t<=n.e||n.e<=i.toExpNeg,t)),n.isNeg()&&!n.isZero()?"-"+r:r},Fn.toSignificantDigits=Fn.toSD=function(t,e){var r=this.constructor;return void 0===t?(t=r.precision,e=r.rounding):(Dn(t,1,nn),void 0===e?e=r.rounding:Dn(e,0,8)),Rn(new r(this),t,e)},Fn.toString=function(){var t=this,e=t.constructor,r=Tn(t,t.e<=e.toExpNeg||t.e>=e.toExpPos);return t.isNeg()&&!t.isZero()?"-"+r:r},Fn.truncated=Fn.trunc=function(){return Rn(new this.constructor(this),this.e+1,1)},Fn.valueOf=Fn.toJSON=function(){var t=this,e=t.constructor,r=Tn(t,t.e<=e.toExpNeg||t.e>=e.toExpPos);return t.isNeg()?"-"+r:r};var Pn=function(){function t(t,e,r){var n,i=0,s=t.length;for(t=t.slice();s--;)n=t[s]*e+i,t[s]=n%r|0,i=n/r|0;return i&&t.unshift(i),t}function e(t,e,r,n){var i,s;if(r!=n)s=r>n?1:-1;else for(i=s=0;i<r;i++)if(t[i]!=e[i]){s=t[i]>e[i]?1:-1;break}return s}function r(t,e,r,n){for(var i=0;r--;)t[r]-=i,i=t[r]<e[r]?1:0,t[r]=i*n+t[r]-e[r];for(;!t[0]&&t.length>1;)t.shift()}return function(n,i,s,a,o,u){var c,h,l,f,p,g,d,v,m,y,w,x,S,E,b,F,A,D,C,I,P=n.constructor,R=n.s==i.s?1:-1,T=n.d,N=i.d;if(!(T&&T[0]&&N&&N[0]))return new P(n.s&&i.s&&(T?!N||T[0]!=N[0]:N)?T&&0==T[0]||!N?0*R:R/0:NaN);for(u?(p=1,h=n.e-i.e):(u=Sn,p=7,h=dn(n.e/p)-dn(i.e/p)),C=N.length,A=T.length,y=(m=new P(R)).d=[],l=0;N[l]==(T[l]||0);l++);if(N[l]>(T[l]||0)&&h--,null==s?(E=s=P.precision,a=P.rounding):E=o?s+(n.e-i.e)+1:s,E<0)y.push(1),g=!0;else{if(E=E/p+2|0,l=0,1==C){for(f=0,N=N[0],E++;(l<A||f)&&E--;l++)b=f*u+(T[l]||0),y[l]=b/N|0,f=b%N|0;g=f||l<A}else{for((f=u/(N[0]+1)|0)>1&&(N=t(N,f,u),T=t(T,f,u),C=N.length,A=T.length),F=C,x=(w=T.slice(0,C)).length;x<C;)w[x++]=0;(I=N.slice()).unshift(0),D=N[0],N[1]>=u/2&&++D;do{f=0,(c=e(N,w,C,x))<0?(S=w[0],C!=x&&(S=S*u+(w[1]||0)),(f=S/D|0)>1?(f>=u&&(f=u-1),1==(c=e(d=t(N,f,u),w,v=d.length,x=w.length))&&(f--,r(d,C<v?I:N,v,u))):(0==f&&(c=f=1),d=N.slice()),(v=d.length)<x&&d.unshift(0),r(w,d,x,u),-1==c&&(c=e(N,w,C,x=w.length))<1&&(f++,r(w,C<x?I:N,x,u)),x=w.length):0===c&&(f++,w=[0]),y[l++]=f,c&&w[0]?w[x++]=T[F]||0:(w=[T[F]],x=1)}while((F++<A||void 0!==w[0])&&E--);g=void 0!==w[0]}y[0]||y.shift()}if(1==p)m.e=h,tn=g;else{for(l=1,f=y[0];f>=10;f/=10)l++;m.e=l+h*p-1,Rn(m,o?s+m.e+1:s,a,g)}return m}}();function Rn(t,e,r,n){var i,s,a,o,u,c,h,l,f,p=t.constructor;t:if(null!=e){if(!(l=t.d))return t;for(i=1,o=l[0];o>=10;o/=10)i++;if((s=e-i)<0)s+=7,a=e,u=(h=l[f=0])/vn(10,i-a-1)%10|0;else if((f=Math.ceil((s+1)/7))>=(o=l.length)){if(!n)break t;for(;o++<=f;)l.push(0);h=u=0,i=1,a=(s%=7)-7+1}else{for(h=o=l[f],i=1;o>=10;o/=10)i++;u=(a=(s%=7)-7+i)<0?0:h/vn(10,i-a-1)%10|0}if(n=n||e<0||void 0!==l[f+1]||(a<0?h:h%vn(10,i-a-1)),c=r<4?(u||n)&&(0==r||r==(t.s<0?3:2)):u>5||5==u&&(4==r||n||6==r&&(s>0?a>0?h/vn(10,i-a):0:l[f-1])%10&1||r==(t.s<0?8:7)),e<1||!l[0])return l.length=0,c?(e-=t.e+1,l[0]=vn(10,(7-e%7)%7),t.e=-e||0):l[0]=t.e=0,t;if(0==s?(l.length=f,o=1,f--):(l.length=f+1,o=vn(10,7-s),l[f]=a>0?(h/vn(10,i-a)%vn(10,a)|0)*o:0),c)for(;;){if(0==f){for(s=1,a=l[0];a>=10;a/=10)s++;for(a=l[0]+=o,o=1;a>=10;a/=10)o++;s!=o&&(t.e++,l[0]==Sn&&(l[0]=1));break}if(l[f]+=o,l[f]!=Sn)break;l[f--]=0,o=1}for(s=l.length;0===l[--s];)l.pop()}return cn&&(t.e>p.maxE?(t.d=null,t.e=NaN):t.e<p.minE&&(t.e=0,t.d=[0])),t}function Tn(t,e,r){if(!t.isFinite())return Mn(t);var n,i=t.e,s=An(t.d),a=s.length;return e?(r&&(n=r-a)>0?s=s.charAt(0)+"."+s.slice(1)+jn(n):a>1&&(s=s.charAt(0)+"."+s.slice(1)),s=s+(t.e<0?"e":"e+")+t.e):i<0?(s="0."+jn(-i-1)+s,r&&(n=r-a)>0&&(s+=jn(n))):i>=a?(s+=jn(i+1-a),r&&(n=r-i-1)>0&&(s=s+"."+jn(n))):((n=i+1)<a&&(s=s.slice(0,n)+"."+s.slice(n)),r&&(n=r-a)>0&&(i+1===a&&(s+="."),s+=jn(n))),s}function Nn(t,e){var r=t[0];for(e*=7;r>=10;r/=10)e++;return e}function On(t,e,r){if(e>En)throw cn=!0,r&&(t.precision=r),Error(fn);return Rn(new t(an),e,1,!0)}function Bn(t,e,r){if(e>bn)throw Error(fn);return Rn(new t(on),e,r,!0)}function _n(t){var e=t.length-1,r=7*e+1;if(e=t[e]){for(;e%10==0;e/=10)r--;for(e=t[0];e>=10;e/=10)r++}return r}function jn(t){for(var e="";t--;)e+="0";return e}function Hn(t,e,r,n){var i,s=new t(1),a=Math.ceil(n/7+4);for(cn=!1;;){if(r%2&&Jn((s=s.times(e)).d,a)&&(i=!0),0===(r=dn(r/2))){r=s.d.length-1,i&&0===s.d[r]&&++s.d[r];break}Jn((e=e.times(e)).d,a)}return cn=!0,s}function kn(t){return 1&t.d[t.d.length-1]}function Ln(t,e,r){for(var n,i,s=new t(e[0]),a=0;++a<e.length;){if(!(i=new t(e[a])).s){s=i;break}((n=s.cmp(i))===r||0===n&&s.s===r)&&(s=i)}return s}function Vn(t,e){var r,n,i,s,a,o,u,c=0,h=0,l=0,f=t.constructor,p=f.rounding,g=f.precision;if(!t.d||!t.d[0]||t.e>17)return new f(t.d?t.d[0]?t.s<0?0:1/0:1:t.s?t.s<0?0:t:NaN);for(null==e?(cn=!1,u=g):u=e,o=new f(.03125);t.e>-2;)t=t.times(o),l+=5;for(u+=n=Math.log(vn(2,l))/Math.LN10*2+5|0,r=s=a=new f(1),f.precision=u;;){if(s=Rn(s.times(t),u,1),r=r.times(++h),An((o=a.plus(Pn(s,r,u,1))).d).slice(0,u)===An(a.d).slice(0,u)){for(i=l;i--;)a=Rn(a.times(a),u,1);if(null!=e)return f.precision=g,a;if(!(c<3&&Cn(a.d,u-n,p,c)))return Rn(a,f.precision=g,p,cn=!0);f.precision=u+=10,r=s=o=new f(1),h=0,c++}a=o}}function qn(t,e){var r,n,i,s,a,o,u,c,h,l,f,p=1,g=t,d=g.d,v=g.constructor,m=v.rounding,y=v.precision;if(g.s<0||!d||!d[0]||!g.e&&1==d[0]&&1==d.length)return new v(d&&!d[0]?-1/0:1!=g.s?NaN:d?0:g);if(null==e?(cn=!1,h=y):h=e,v.precision=h+=10,n=(r=An(d)).charAt(0),!(Math.abs(s=g.e)<15e14))return c=On(v,h+2,y).times(s+""),g=qn(new v(n+"."+r.slice(1)),h-10).plus(c),v.precision=y,null==e?Rn(g,y,m,cn=!0):g;for(;n<7&&1!=n||1==n&&r.charAt(1)>3;)n=(r=An((g=g.times(t)).d)).charAt(0),p++;for(s=g.e,n>1?(g=new v("0."+r),s++):g=new v(n+"."+r.slice(1)),l=g,u=a=g=Pn(g.minus(1),g.plus(1),h,1),f=Rn(g.times(g),h,1),i=3;;){if(a=Rn(a.times(f),h,1),An((c=u.plus(Pn(a,new v(i),h,1))).d).slice(0,h)===An(u.d).slice(0,h)){if(u=u.times(2),0!==s&&(u=u.plus(On(v,h+2,y).times(s+""))),u=Pn(u,new v(p),h,1),null!=e)return v.precision=y,u;if(!Cn(u.d,h-10,m,o))return Rn(u,v.precision=y,m,cn=!0);v.precision=h+=10,c=a=g=Pn(l.minus(1),l.plus(1),h,1),f=Rn(g.times(g),h,1),i=o=1}u=c,i+=2}}function Mn(t){return String(t.s*t.s/0)}function Kn(t,e){var r,n,i;for((r=e.indexOf("."))>-1&&(e=e.replace(".","")),(n=e.search(/e/i))>0?(r<0&&(r=n),r+=+e.slice(n+1),e=e.substring(0,n)):r<0&&(r=e.length),n=0;48===e.charCodeAt(n);n++);for(i=e.length;48===e.charCodeAt(i-1);--i);if(e=e.slice(n,i)){if(i-=n,t.e=r=r-n-1,t.d=[],n=(r+1)%7,r<0&&(n+=7),n<i){for(n&&t.d.push(+e.slice(0,n)),i-=7;n<i;)t.d.push(+e.slice(n,n+=7));n=7-(e=e.slice(n)).length}else n-=i;for(;n--;)e+="0";t.d.push(+e),cn&&(t.e>t.constructor.maxE?(t.d=null,t.e=NaN):t.e<t.constructor.minE&&(t.e=0,t.d=[0]))}else t.e=0,t.d=[0];return t}function Un(t,e){var r,n,i,s,a,o,u,c,h;if(e.indexOf("_")>-1){if(e=e.replace(/(\d)_(?=\d)/g,"$1"),xn.test(e))return Kn(t,e)}else if("Infinity"===e||"NaN"===e)return+e||(t.s=NaN),t.e=NaN,t.d=null,t;if(yn.test(e))r=16,e=e.toLowerCase();else if(mn.test(e))r=2;else{if(!wn.test(e))throw Error(ln+e);r=8}for((s=e.search(/p/i))>0?(u=+e.slice(s+1),e=e.substring(2,s)):e=e.slice(2),a=(s=e.indexOf("."))>=0,n=t.constructor,a&&(s=(o=(e=e.replace(".","")).length)-s,i=Hn(n,new n(r),s,2*s)),s=h=(c=In(e,r,Sn)).length-1;0===c[s];--s)c.pop();return s<0?new n(0*t.s):(t.e=Nn(c,h),t.d=c,cn=!1,a&&(t=Pn(t,i,4*o)),u&&(t=t.times(Math.abs(u)<54?vn(2,u):ji.pow(2,u))),cn=!0,t)}function zn(t,e,r,n,i){var s,a,o,u,c=t.precision,h=Math.ceil(c/7);for(cn=!1,u=r.times(r),o=new t(n);;){if(a=Pn(o.times(u),new t(e++*e++),c,1),o=i?n.plus(a):n.minus(a),n=Pn(a.times(u),new t(e++*e++),c,1),void 0!==(a=o.plus(n)).d[h]){for(s=h;a.d[s]===o.d[s]&&s--;);if(-1==s)break}s=o,o=n,n=a,a=s}return cn=!0,a.d.length=h+1,a}function Wn(t,e){for(var r=t;--e;)r*=t;return r}function Gn(t,e){var r,n=e.s<0,i=Bn(t,t.precision,1),s=i.times(.5);if((e=e.abs()).lte(s))return en=n?4:1,e;if((r=e.divToInt(i)).isZero())en=n?3:2;else{if((e=e.minus(r.times(i))).lte(s))return en=kn(r)?n?2:3:n?4:1,e;en=kn(r)?n?1:4:n?3:2}return e.minus(i).abs()}function $n(t,e,r,n){var i,s,a,o,u,c,h,l,f,p=t.constructor,g=void 0!==r;if(g?(Dn(r,1,nn),void 0===n?n=p.rounding:Dn(n,0,8)):(r=p.precision,n=p.rounding),t.isFinite()){for(g?(i=2,16==e?r=4*r-3:8==e&&(r=3*r-2)):i=e,(a=(h=Tn(t)).indexOf("."))>=0&&(h=h.replace(".",""),(f=new p(1)).e=h.length-a,f.d=In(Tn(f),10,i),f.e=f.d.length),s=u=(l=In(h,10,i)).length;0==l[--u];)l.pop();if(l[0]){if(a<0?s--:((t=new p(t)).d=l,t.e=s,l=(t=Pn(t,f,r,n,0,i)).d,s=t.e,c=tn),a=l[r],o=i/2,c=c||void 0!==l[r+1],c=n<4?(void 0!==a||c)&&(0===n||n===(t.s<0?3:2)):a>o||a===o&&(4===n||c||6===n&&1&l[r-1]||n===(t.s<0?8:7)),l.length=r,c)for(;++l[--r]>i-1;)l[r]=0,r||(++s,l.unshift(1));for(u=l.length;!l[u-1];--u);for(a=0,h="";a<u;a++)h+=sn.charAt(l[a]);if(g){if(u>1)if(16==e||8==e){for(a=16==e?4:3,--u;u%a;u++)h+="0";for(u=(l=In(h,i,e)).length;!l[u-1];--u);for(a=1,h="1.";a<u;a++)h+=sn.charAt(l[a])}else h=h.charAt(0)+"."+h.slice(1);h=h+(s<0?"p":"p+")+s}else if(s<0){for(;++s;)h="0"+h;h="0."+h}else if(++s>u)for(s-=u;s--;)h+="0";else s<u&&(h=h.slice(0,s)+"."+h.slice(s))}else h=g?"0p+0":"0";h=(16==e?"0x":2==e?"0b":8==e?"0o":"")+h}else h=Mn(t);return t.s<0?"-"+h:h}function Jn(t,e){if(t.length>e)return t.length=e,!0}function Yn(t){return new this(t).abs()}function Xn(t){return new this(t).acos()}function Zn(t){return new this(t).acosh()}function Qn(t,e){return new this(t).plus(e)}function ti(t){return new this(t).asin()}function ei(t){return new this(t).asinh()}function ri(t){return new this(t).atan()}function ni(t){return new this(t).atanh()}function ii(t,e){t=new this(t),e=new this(e);var r,n=this.precision,i=this.rounding,s=n+4;return t.s&&e.s?t.d||e.d?!e.d||t.isZero()?(r=e.s<0?Bn(this,n,i):new this(0)).s=t.s:!t.d||e.isZero()?(r=Bn(this,s,1).times(.5)).s=t.s:e.s<0?(this.precision=s,this.rounding=1,r=this.atan(Pn(t,e,s,1)),e=Bn(this,s,1),this.precision=n,this.rounding=i,r=t.s<0?r.minus(e):r.plus(e)):r=this.atan(Pn(t,e,s,1)):(r=Bn(this,s,1).times(e.s>0?.25:.75)).s=t.s:r=new this(NaN),r}function si(t){return new this(t).cbrt()}function ai(t){return Rn(t=new this(t),t.e+1,2)}function oi(t,e,r){return new this(t).clamp(e,r)}function ui(t){if(!t||"object"!=typeof t)throw Error(hn+"Object expected");var e,r,n,i=!0===t.defaults,s=["precision",1,nn,"rounding",0,8,"toExpNeg",-rn,0,"toExpPos",0,rn,"maxE",0,rn,"minE",-rn,0,"modulo",0,9];for(e=0;e<s.length;e+=3)if(r=s[e],i&&(this[r]=un[r]),void 0!==(n=t[r])){if(!(dn(n)===n&&n>=s[e+1]&&n<=s[e+2]))throw Error(ln+r+": "+n);this[r]=n}if(r="crypto",i&&(this[r]=un[r]),void 0!==(n=t[r])){if(!0!==n&&!1!==n&&0!==n&&1!==n)throw Error(ln+r+": "+n);if(n){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw Error(pn);this[r]=!0}else this[r]=!1}return this}function ci(t){return new this(t).cos()}function hi(t){return new this(t).cosh()}function li(t,e){return new this(t).div(e)}function fi(t){return new this(t).exp()}function pi(t){return Rn(t=new this(t),t.e+1,3)}function gi(){var t,e,r=new this(0);for(cn=!1,t=0;t<arguments.length;)if((e=new this(arguments[t++])).d)r.d&&(r=r.plus(e.times(e)));else{if(e.s)return cn=!0,new this(1/0);r=e}return cn=!0,r.sqrt()}function di(t){return t instanceof ji||t&&t.toStringTag===gn||!1}function vi(t){return new this(t).ln()}function mi(t,e){return new this(t).log(e)}function yi(t){return new this(t).log(2)}function wi(t){return new this(t).log(10)}function xi(){return Ln(this,arguments,-1)}function Si(){return Ln(this,arguments,1)}function Ei(t,e){return new this(t).mod(e)}function bi(t,e){return new this(t).mul(e)}function Fi(t,e){return new this(t).pow(e)}function Ai(t){var e,r,n,i,s=0,a=new this(1),o=[];if(void 0===t?t=this.precision:Dn(t,1,nn),n=Math.ceil(t/7),this.crypto)if(crypto.getRandomValues)for(e=crypto.getRandomValues(new Uint32Array(n));s<n;)(i=e[s])>=429e7?e[s]=crypto.getRandomValues(new Uint32Array(1))[0]:o[s++]=i%1e7;else{if(!crypto.randomBytes)throw Error(pn);for(e=crypto.randomBytes(n*=4);s<n;)(i=e[s]+(e[s+1]<<8)+(e[s+2]<<16)+((127&e[s+3])<<24))>=214e7?crypto.randomBytes(4).copy(e,s):(o.push(i%1e7),s+=4);s=n/4}else for(;s<n;)o[s++]=1e7*Math.random()|0;for(t%=7,(n=o[--s])&&t&&(i=vn(10,7-t),o[s]=(n/i|0)*i);0===o[s];s--)o.pop();if(s<0)r=0,o=[0];else{for(r=-1;0===o[0];r-=7)o.shift();for(n=1,i=o[0];i>=10;i/=10)n++;n<7&&(r-=7-n)}return a.e=r,a.d=o,a}function Di(t){return Rn(t=new this(t),t.e+1,this.rounding)}function Ci(t){return(t=new this(t)).d?t.d[0]?t.s:0*t.s:t.s||NaN}function Ii(t){return new this(t).sin()}function Pi(t){return new this(t).sinh()}function Ri(t){return new this(t).sqrt()}function Ti(t,e){return new this(t).sub(e)}function Ni(){var t=0,e=arguments,r=new this(e[t]);for(cn=!1;r.s&&++t<e.length;)r=r.plus(e[t]);return cn=!0,Rn(r,this.precision,this.rounding)}function Oi(t){return new this(t).tan()}function Bi(t){return new this(t).tanh()}function _i(t){return Rn(t=new this(t),t.e+1,1)}Fn[Symbol.for("nodejs.util.inspect.custom")]=Fn.toString,Fn[Symbol.toStringTag]="Decimal";var ji=Fn.constructor=function t(e){var r,n,i;function s(t){var e,r,n,i=this;if(!(i instanceof s))return new s(t);if(i.constructor=s,di(t))return i.s=t.s,void(cn?!t.d||t.e>s.maxE?(i.e=NaN,i.d=null):t.e<s.minE?(i.e=0,i.d=[0]):(i.e=t.e,i.d=t.d.slice()):(i.e=t.e,i.d=t.d?t.d.slice():t.d));if("number"===(n=typeof t)){if(0===t)return i.s=1/t<0?-1:1,i.e=0,void(i.d=[0]);if(t<0?(t=-t,i.s=-1):i.s=1,t===~~t&&t<1e7){for(e=0,r=t;r>=10;r/=10)e++;return void(cn?e>s.maxE?(i.e=NaN,i.d=null):e<s.minE?(i.e=0,i.d=[0]):(i.e=e,i.d=[t]):(i.e=e,i.d=[t]))}return 0*t!=0?(t||(i.s=NaN),i.e=NaN,void(i.d=null)):Kn(i,t.toString())}if("string"===n)return 45===(r=t.charCodeAt(0))?(t=t.slice(1),i.s=-1):(43===r&&(t=t.slice(1)),i.s=1),xn.test(t)?Kn(i,t):Un(i,t);if("bigint"===n)return t<0?(t=-t,i.s=-1):i.s=1,Kn(i,t.toString());throw Error(ln+t)}if(s.prototype=Fn,s.ROUND_UP=0,s.ROUND_DOWN=1,s.ROUND_CEIL=2,s.ROUND_FLOOR=3,s.ROUND_HALF_UP=4,s.ROUND_HALF_DOWN=5,s.ROUND_HALF_EVEN=6,s.ROUND_HALF_CEIL=7,s.ROUND_HALF_FLOOR=8,s.EUCLID=9,s.config=s.set=ui,s.clone=t,s.isDecimal=di,s.abs=Yn,s.acos=Xn,s.acosh=Zn,s.add=Qn,s.asin=ti,s.asinh=ei,s.atan=ri,s.atanh=ni,s.atan2=ii,s.cbrt=si,s.ceil=ai,s.clamp=oi,s.cos=ci,s.cosh=hi,s.div=li,s.exp=fi,s.floor=pi,s.hypot=gi,s.ln=vi,s.log=mi,s.log10=wi,s.log2=yi,s.max=xi,s.min=Si,s.mod=Ei,s.mul=bi,s.pow=Fi,s.random=Ai,s.round=Di,s.sign=Ci,s.sin=Ii,s.sinh=Pi,s.sqrt=Ri,s.sub=Ti,s.sum=Ni,s.tan=Oi,s.tanh=Bi,s.trunc=_i,void 0===e&&(e={}),e&&!0!==e.defaults)for(i=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],r=0;r<i.length;)e.hasOwnProperty(n=i[r++])||(e[n]=this[n]);return s.config(e),s}(un);an=new ji(an),on=new ji(on);const Hi=ji.clone({precision:40,rounding:ji.ROUND_HALF_UP}),ki=t=>!0===t||1===t||"1"===t,Li=t=>"CNY"===String(t||"").trim().toUpperCase(),Vi=(t,e="数值")=>{const r=String(t??"").trim();if(""===r)return new Hi(0);if(!/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)$/.test(r))throw new Error(`${e}请输入有效数字`);const n=new Hi(r);if(!n.isFinite())throw new Error(`${e}请输入有效数字`);return n},qi=(t,e)=>t.toDecimalPlaces(e),Mi=(t,e)=>t.toDecimalPlaces(e),Ki=t=>{if(t.isZero())return Array(11).fill("");const e=t.abs().times(100).toFixed(0);if(e.length>11)throw new Error("金额超出当前凭证金额栏可显示范围");return e.padStart(11," ").split("").map(t=>" "===t?"":t)},Ui=(t,e)=>{["Backspace","Delete","Tab","Enter","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(t.key)||t.ctrlKey||t.metaKey||/^[0-9]$/.test(t.key)||"."!==t.key&&"-"!==t.key&&t.preventDefault()};function zi(t,e){return function(){return t.apply(e,arguments)}}const{toString:Wi}=Object.prototype,{getPrototypeOf:Gi}=Object,{iterator:$i,toStringTag:Ji}=Symbol,Yi=(Xi=Object.create(null),t=>{const e=Wi.call(t);return Xi[e]||(Xi[e]=e.slice(8,-1).toLowerCase())});var Xi;const Zi=t=>(t=t.toLowerCase(),e=>Yi(e)===t),Qi=t=>e=>typeof e===t,{isArray:ts}=Array,es=Qi("undefined");function rs(t){return null!==t&&!es(t)&&null!==t.constructor&&!es(t.constructor)&&ss(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const ns=Zi("ArrayBuffer");const is=Qi("string"),ss=Qi("function"),as=Qi("number"),os=t=>null!==t&&"object"==typeof t,us=t=>{if("object"!==Yi(t))return!1;const e=Gi(t);return!(null!==e&&e!==Object.prototype&&null!==Object.getPrototypeOf(e)||Ji in t||$i in t)},cs=Zi("Date"),hs=Zi("File"),ls=Zi("Blob"),fs=Zi("FileList"),ps=Zi("URLSearchParams"),[gs,ds,vs,ms]=["ReadableStream","Request","Response","Headers"].map(Zi);function ys(t,e,{allOwnKeys:r=!1}={}){if(null==t)return;let n,i;if("object"!=typeof t&&(t=[t]),ts(t))for(n=0,i=t.length;n<i;n++)e.call(null,t[n],n,t);else{if(rs(t))return;const i=r?Object.getOwnPropertyNames(t):Object.keys(t),s=i.length;let a;for(n=0;n<s;n++)a=i[n],e.call(null,t[a],a,t)}}function ws(t,e){if(rs(t))return null;e=e.toLowerCase();const r=Object.keys(t);let n,i=r.length;for(;i-- >0;)if(n=r[i],e===n.toLowerCase())return n;return null}const xs="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,Ss=t=>!es(t)&&t!==xs;const Es=(bs="undefined"!=typeof Uint8Array&&Gi(Uint8Array),t=>bs&&t instanceof bs);var bs;const Fs=Zi("HTMLFormElement"),As=(({hasOwnProperty:t})=>(e,r)=>t.call(e,r))(Object.prototype),Ds=Zi("RegExp"),Cs=(t,e)=>{const r=Object.getOwnPropertyDescriptors(t),n={};ys(r,(r,i)=>{let s;!1!==(s=e(r,i,t))&&(n[i]=s||r)}),Object.defineProperties(t,n)};const Is=Zi("AsyncFunction"),Ps=(Rs="function"==typeof setImmediate,Ts=ss(xs.postMessage),Rs?setImmediate:Ts?(Ns=`axios@${Math.random()}`,Os=[],xs.addEventListener("message",({source:t,data:e})=>{t===xs&&e===Ns&&Os.length&&Os.shift()()},!1),t=>{Os.push(t),xs.postMessage(Ns,"*")}):t=>setTimeout(t));var Rs,Ts,Ns,Os;const Bs="undefined"!=typeof queueMicrotask?queueMicrotask.bind(xs):"undefined"!=typeof process&&process.nextTick||Ps;var _s={isArray:ts,isArrayBuffer:ns,isBuffer:rs,isFormData:t=>{let e;return t&&("function"==typeof FormData&&t instanceof FormData||ss(t.append)&&("formdata"===(e=Yi(t))||"object"===e&&ss(t.toString)&&"[object FormData]"===t.toString()))},isArrayBufferView:function(t){let e;return e="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&ns(t.buffer),e},isString:is,isNumber:as,isBoolean:t=>!0===t||!1===t,isObject:os,isPlainObject:us,isEmptyObject:t=>{if(!os(t)||rs(t))return!1;try{return 0===Object.keys(t).length&&Object.getPrototypeOf(t)===Object.prototype}catch(t){return!1}},isReadableStream:gs,isRequest:ds,isResponse:vs,isHeaders:ms,isUndefined:es,isDate:cs,isFile:hs,isBlob:ls,isRegExp:Ds,isFunction:ss,isStream:t=>os(t)&&ss(t.pipe),isURLSearchParams:ps,isTypedArray:Es,isFileList:fs,forEach:ys,merge:function t(){const{caseless:e}=Ss(this)&&this||{},r={},n=(n,i)=>{const s=e&&ws(r,i)||i;us(r[s])&&us(n)?r[s]=t(r[s],n):us(n)?r[s]=t({},n):ts(n)?r[s]=n.slice():r[s]=n};for(let t=0,e=arguments.length;t<e;t++)arguments[t]&&ys(arguments[t],n);return r},extend:(t,e,r,{allOwnKeys:n}={})=>(ys(e,(e,n)=>{r&&ss(e)?t[n]=zi(e,r):t[n]=e},{allOwnKeys:n}),t),trim:t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:t=>(65279===t.charCodeAt(0)&&(t=t.slice(1)),t),inherits:(t,e,r,n)=>{t.prototype=Object.create(e.prototype,n),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),r&&Object.assign(t.prototype,r)},toFlatObject:(t,e,r,n)=>{let i,s,a;const o={};if(e=e||{},null==t)return e;do{for(i=Object.getOwnPropertyNames(t),s=i.length;s-- >0;)a=i[s],n&&!n(a,t,e)||o[a]||(e[a]=t[a],o[a]=!0);t=!1!==r&&Gi(t)}while(t&&(!r||r(t,e))&&t!==Object.prototype);return e},kindOf:Yi,kindOfTest:Zi,endsWith:(t,e,r)=>{t=String(t),(void 0===r||r>t.length)&&(r=t.length),r-=e.length;const n=t.indexOf(e,r);return-1!==n&&n===r},toArray:t=>{if(!t)return null;if(ts(t))return t;let e=t.length;if(!as(e))return null;const r=new Array(e);for(;e-- >0;)r[e]=t[e];return r},forEachEntry:(t,e)=>{const r=(t&&t[$i]).call(t);let n;for(;(n=r.next())&&!n.done;){const r=n.value;e.call(t,r[0],r[1])}},matchAll:(t,e)=>{let r;const n=[];for(;null!==(r=t.exec(e));)n.push(r);return n},isHTMLForm:Fs,hasOwnProperty:As,hasOwnProp:As,reduceDescriptors:Cs,freezeMethods:t=>{Cs(t,(e,r)=>{if(ss(t)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;const n=t[r];ss(n)&&(e.enumerable=!1,"writable"in e?e.writable=!1:e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")}))})},toObjectSet:(t,e)=>{const r={},n=t=>{t.forEach(t=>{r[t]=!0})};return ts(t)?n(t):n(String(t).split(e)),r},toCamelCase:t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,e,r){return e.toUpperCase()+r}),noop:()=>{},toFiniteNumber:(t,e)=>null!=t&&Number.isFinite(t=+t)?t:e,findKey:ws,global:xs,isContextDefined:Ss,isSpecCompliantForm:function(t){return!!(t&&ss(t.append)&&"FormData"===t[Ji]&&t[$i])},toJSONObject:t=>{const e=new Array(10),r=(t,n)=>{if(os(t)){if(e.indexOf(t)>=0)return;if(rs(t))return t;if(!("toJSON"in t)){e[n]=t;const i=ts(t)?[]:{};return ys(t,(t,e)=>{const s=r(t,n+1);!es(s)&&(i[e]=s)}),e[n]=void 0,i}}return t};return r(t,0)},isAsyncFn:Is,isThenable:t=>t&&(os(t)||ss(t))&&ss(t.then)&&ss(t.catch),setImmediate:Ps,asap:Bs,isIterable:t=>null!=t&&ss(t[$i])};function js(t,e,r,n,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=t,this.name="AxiosError",e&&(this.code=e),r&&(this.config=r),n&&(this.request=n),i&&(this.response=i,this.status=i.status?i.status:null)}_s.inherits(js,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:_s.toJSONObject(this.config),code:this.code,status:this.status}}});const Hs=js.prototype,ks={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{ks[t]={value:t}}),Object.defineProperties(js,ks),Object.defineProperty(Hs,"isAxiosError",{value:!0}),js.from=(t,e,r,n,i,s)=>{const a=Object.create(Hs);return _s.toFlatObject(t,a,function(t){return t!==Error.prototype},t=>"isAxiosError"!==t),js.call(a,t.message,e,r,n,i),a.cause=t,a.name=t.name,s&&Object.assign(a,s),a};function Ls(t){return _s.isPlainObject(t)||_s.isArray(t)}function Vs(t){return _s.endsWith(t,"[]")?t.slice(0,-2):t}function qs(t,e,r){return t?t.concat(e).map(function(t,e){return t=Vs(t),!r&&e?"["+t+"]":t}).join(r?".":""):e}const Ms=_s.toFlatObject(_s,{},null,function(t){return/^is[A-Z]/.test(t)});function Ks(t,e,r){if(!_s.isObject(t))throw new TypeError("target must be an object");e=e||new FormData;const n=(r=_s.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(t,e){return!_s.isUndefined(e[t])})).metaTokens,i=r.visitor||c,s=r.dots,a=r.indexes,o=(r.Blob||"undefined"!=typeof Blob&&Blob)&&_s.isSpecCompliantForm(e);if(!_s.isFunction(i))throw new TypeError("visitor must be a function");function u(t){if(null===t)return"";if(_s.isDate(t))return t.toISOString();if(_s.isBoolean(t))return t.toString();if(!o&&_s.isBlob(t))throw new js("Blob is not supported. Use a Buffer instead.");return _s.isArrayBuffer(t)||_s.isTypedArray(t)?o&&"function"==typeof Blob?new Blob([t]):Buffer.from(t):t}function c(t,r,i){let o=t;if(t&&!i&&"object"==typeof t)if(_s.endsWith(r,"{}"))r=n?r:r.slice(0,-2),t=JSON.stringify(t);else if(_s.isArray(t)&&function(t){return _s.isArray(t)&&!t.some(Ls)}(t)||(_s.isFileList(t)||_s.endsWith(r,"[]"))&&(o=_s.toArray(t)))return r=Vs(r),o.forEach(function(t,n){!_s.isUndefined(t)&&null!==t&&e.append(!0===a?qs([r],n,s):null===a?r:r+"[]",u(t))}),!1;return!!Ls(t)||(e.append(qs(i,r,s),u(t)),!1)}const h=[],l=Object.assign(Ms,{defaultVisitor:c,convertValue:u,isVisitable:Ls});if(!_s.isObject(t))throw new TypeError("data must be an object");return function t(r,n){if(!_s.isUndefined(r)){if(-1!==h.indexOf(r))throw Error("Circular reference detected in "+n.join("."));h.push(r),_s.forEach(r,function(r,s){!0===(!(_s.isUndefined(r)||null===r)&&i.call(e,r,_s.isString(s)?s.trim():s,n,l))&&t(r,n?n.concat(s):[s])}),h.pop()}}(t),e}function Us(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(t){return e[t]})}function zs(t,e){this._pairs=[],t&&Ks(t,this,e)}const Ws=zs.prototype;function Gs(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function $s(t,e,r){if(!e)return t;const n=r&&r.encode||Gs;_s.isFunction(r)&&(r={serialize:r});const i=r&&r.serialize;let s;if(s=i?i(e,r):_s.isURLSearchParams(e)?e.toString():new zs(e,r).toString(n),s){const e=t.indexOf("#");-1!==e&&(t=t.slice(0,e)),t+=(-1===t.indexOf("?")?"?":"&")+s}return t}Ws.append=function(t,e){this._pairs.push([t,e])},Ws.toString=function(t){const e=t?function(e){return t.call(this,e,Us)}:Us;return this._pairs.map(function(t){return e(t[0])+"="+e(t[1])},"").join("&")};var Js=class{constructor(){this.handlers=[]}use(t,e,r){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){_s.forEach(this.handlers,function(e){null!==e&&t(e)})}},Ys={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Xs={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:zs,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const Zs="undefined"!=typeof window&&"undefined"!=typeof document,Qs="object"==typeof navigator&&navigator||void 0,ta=Zs&&(!Qs||["ReactNative","NativeScript","NS"].indexOf(Qs.product)<0),ea="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,ra=Zs&&window.location.href||"http://localhost";var na={...Object.freeze({__proto__:null,hasBrowserEnv:Zs,hasStandardBrowserEnv:ta,hasStandardBrowserWebWorkerEnv:ea,navigator:Qs,origin:ra}),...Xs};function ia(t){function e(t,r,n,i){let s=t[i++];if("__proto__"===s)return!0;const a=Number.isFinite(+s),o=i>=t.length;if(s=!s&&_s.isArray(n)?n.length:s,o)return _s.hasOwnProp(n,s)?n[s]=[n[s],r]:n[s]=r,!a;n[s]&&_s.isObject(n[s])||(n[s]=[]);return e(t,r,n[s],i)&&_s.isArray(n[s])&&(n[s]=function(t){const e={},r=Object.keys(t);let n;const i=r.length;let s;for(n=0;n<i;n++)s=r[n],e[s]=t[s];return e}(n[s])),!a}if(_s.isFormData(t)&&_s.isFunction(t.entries)){const r={};return _s.forEachEntry(t,(t,n)=>{e(function(t){return _s.matchAll(/\w+|\[(\w*)]/g,t).map(t=>"[]"===t[0]?"":t[1]||t[0])}(t),n,r,0)}),r}return null}const sa={transitional:Ys,adapter:["xhr","http","fetch"],transformRequest:[function(t,e){const r=e.getContentType()||"",n=r.indexOf("application/json")>-1,i=_s.isObject(t);i&&_s.isHTMLForm(t)&&(t=new FormData(t));if(_s.isFormData(t))return n?JSON.stringify(ia(t)):t;if(_s.isArrayBuffer(t)||_s.isBuffer(t)||_s.isStream(t)||_s.isFile(t)||_s.isBlob(t)||_s.isReadableStream(t))return t;if(_s.isArrayBufferView(t))return t.buffer;if(_s.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let s;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(t,e){return Ks(t,new na.classes.URLSearchParams,{visitor:function(t,e,r,n){return na.isNode&&_s.isBuffer(t)?(this.append(e,t.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)},...e})}(t,this.formSerializer).toString();if((s=_s.isFileList(t))||r.indexOf("multipart/form-data")>-1){const e=this.env&&this.env.FormData;return Ks(s?{"files[]":t}:t,e&&new e,this.formSerializer)}}return i||n?(e.setContentType("application/json",!1),function(t,e,r){if(_s.isString(t))try{return(e||JSON.parse)(t),_s.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(r||JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){const e=this.transitional||sa.transitional,r=e&&e.forcedJSONParsing,n="json"===this.responseType;if(_s.isResponse(t)||_s.isReadableStream(t))return t;if(t&&_s.isString(t)&&(r&&!this.responseType||n)){const r=!(e&&e.silentJSONParsing)&&n;try{return JSON.parse(t)}catch(t){if(r){if("SyntaxError"===t.name)throw js.from(t,js.ERR_BAD_RESPONSE,this,null,this.response);throw t}}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:na.classes.FormData,Blob:na.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};_s.forEach(["delete","get","head","post","put","patch"],t=>{sa.headers[t]={}});var aa=sa;const oa=_s.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);const ua=Symbol("internals");function ca(t){return t&&String(t).trim().toLowerCase()}function ha(t){return!1===t||null==t?t:_s.isArray(t)?t.map(ha):String(t)}function la(t,e,r,n,i){return _s.isFunction(n)?n.call(this,e,r):(i&&(e=r),_s.isString(e)?_s.isString(n)?-1!==e.indexOf(n):_s.isRegExp(n)?n.test(e):void 0:void 0)}class fa{constructor(t){t&&this.set(t)}set(t,e,r){const n=this;function i(t,e,r){const i=ca(e);if(!i)throw new Error("header name must be a non-empty string");const s=_s.findKey(n,i);(!s||void 0===n[s]||!0===r||void 0===r&&!1!==n[s])&&(n[s||e]=ha(t))}const s=(t,e)=>_s.forEach(t,(t,r)=>i(t,r,e));if(_s.isPlainObject(t)||t instanceof this.constructor)s(t,e);else if(_s.isString(t)&&(t=t.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim()))s((t=>{const e={};let r,n,i;return t&&t.split("\n").forEach(function(t){i=t.indexOf(":"),r=t.substring(0,i).trim().toLowerCase(),n=t.substring(i+1).trim(),!r||e[r]&&oa[r]||("set-cookie"===r?e[r]?e[r].push(n):e[r]=[n]:e[r]=e[r]?e[r]+", "+n:n)}),e})(t),e);else if(_s.isObject(t)&&_s.isIterable(t)){let r,n,i={};for(const e of t){if(!_s.isArray(e))throw TypeError("Object iterator must return a key-value pair");i[n=e[0]]=(r=i[n])?_s.isArray(r)?[...r,e[1]]:[r,e[1]]:e[1]}s(i,e)}else null!=t&&i(e,t,r);return this}get(t,e){if(t=ca(t)){const r=_s.findKey(this,t);if(r){const t=this[r];if(!e)return t;if(!0===e)return function(t){const e=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(t);)e[n[1]]=n[2];return e}(t);if(_s.isFunction(e))return e.call(this,t,r);if(_s.isRegExp(e))return e.exec(t);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=ca(t)){const r=_s.findKey(this,t);return!(!r||void 0===this[r]||e&&!la(0,this[r],r,e))}return!1}delete(t,e){const r=this;let n=!1;function i(t){if(t=ca(t)){const i=_s.findKey(r,t);!i||e&&!la(0,r[i],i,e)||(delete r[i],n=!0)}}return _s.isArray(t)?t.forEach(i):i(t),n}clear(t){const e=Object.keys(this);let r=e.length,n=!1;for(;r--;){const i=e[r];t&&!la(0,this[i],i,t,!0)||(delete this[i],n=!0)}return n}normalize(t){const e=this,r={};return _s.forEach(this,(n,i)=>{const s=_s.findKey(r,i);if(s)return e[s]=ha(n),void delete e[i];const a=t?function(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,e,r)=>e.toUpperCase()+r)}(i):String(i).trim();a!==i&&delete e[i],e[a]=ha(n),r[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);return _s.forEach(this,(r,n)=>{null!=r&&!1!==r&&(e[n]=t&&_s.isArray(r)?r.join(", "):r)}),e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,e])=>t+": "+e).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const r=new this(t);return e.forEach(t=>r.set(t)),r}static accessor(t){const e=(this[ua]=this[ua]={accessors:{}}).accessors,r=this.prototype;function n(t){const n=ca(t);e[n]||(!function(t,e){const r=_s.toCamelCase(" "+e);["get","set","has"].forEach(n=>{Object.defineProperty(t,n+r,{value:function(t,r,i){return this[n].call(this,e,t,r,i)},configurable:!0})})}(r,t),e[n]=!0)}return _s.isArray(t)?t.forEach(n):n(t),this}}fa.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),_s.reduceDescriptors(fa.prototype,({value:t},e)=>{let r=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(t){this[r]=t}}}),_s.freezeMethods(fa);var pa=fa;function ga(t,e){const r=this||aa,n=e||r,i=pa.from(n.headers);let s=n.data;return _s.forEach(t,function(t){s=t.call(r,s,i.normalize(),e?e.status:void 0)}),i.normalize(),s}function da(t){return!(!t||!t.__CANCEL__)}function va(t,e,r){js.call(this,null==t?"canceled":t,js.ERR_CANCELED,e,r),this.name="CanceledError"}function ma(t,e,r){const n=r.config.validateStatus;r.status&&n&&!n(r.status)?e(new js("Request failed with status code "+r.status,[js.ERR_BAD_REQUEST,js.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):t(r)}_s.inherits(va,js,{__CANCEL__:!0});const ya=(t,e,r=3)=>{let n=0;const i=function(t,e){t=t||10;const r=new Array(t),n=new Array(t);let i,s=0,a=0;return e=void 0!==e?e:1e3,function(o){const u=Date.now(),c=n[a];i||(i=u),r[s]=o,n[s]=u;let h=a,l=0;for(;h!==s;)l+=r[h++],h%=t;if(s=(s+1)%t,s===a&&(a=(a+1)%t),u-i<e)return;const f=c&&u-c;return f?Math.round(1e3*l/f):void 0}}(50,250);return function(t,e){let r,n,i=0,s=1e3/e;const a=(e,s=Date.now())=>{i=s,r=null,n&&(clearTimeout(n),n=null),t(...e)};return[(...t)=>{const e=Date.now(),o=e-i;o>=s?a(t,e):(r=t,n||(n=setTimeout(()=>{n=null,a(r)},s-o)))},()=>r&&a(r)]}(r=>{const s=r.loaded,a=r.lengthComputable?r.total:void 0,o=s-n,u=i(o);n=s;t({loaded:s,total:a,progress:a?s/a:void 0,bytes:o,rate:u||void 0,estimated:u&&a&&s<=a?(a-s)/u:void 0,event:r,lengthComputable:null!=a,[e?"download":"upload"]:!0})},r)},wa=(t,e)=>{const r=null!=t;return[n=>e[0]({lengthComputable:r,total:t,loaded:n}),e[1]]},xa=t=>(...e)=>_s.asap(()=>t(...e));var Sa=na.hasStandardBrowserEnv?((t,e)=>r=>(r=new URL(r,na.origin),t.protocol===r.protocol&&t.host===r.host&&(e||t.port===r.port)))(new URL(na.origin),na.navigator&&/(msie|trident)/i.test(na.navigator.userAgent)):()=>!0,Ea=na.hasStandardBrowserEnv?{write(t,e,r,n,i,s){const a=[t+"="+encodeURIComponent(e)];_s.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),_s.isString(n)&&a.push("path="+n),_s.isString(i)&&a.push("domain="+i),!0===s&&a.push("secure"),document.cookie=a.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function ba(t,e,r){let n=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);return t&&(n||0==r)?function(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}(t,e):e}const Fa=t=>t instanceof pa?{...t}:t;function Aa(t,e){e=e||{};const r={};function n(t,e,r,n){return _s.isPlainObject(t)&&_s.isPlainObject(e)?_s.merge.call({caseless:n},t,e):_s.isPlainObject(e)?_s.merge({},e):_s.isArray(e)?e.slice():e}function i(t,e,r,i){return _s.isUndefined(e)?_s.isUndefined(t)?void 0:n(void 0,t,0,i):n(t,e,0,i)}function s(t,e){if(!_s.isUndefined(e))return n(void 0,e)}function a(t,e){return _s.isUndefined(e)?_s.isUndefined(t)?void 0:n(void 0,t):n(void 0,e)}function o(r,i,s){return s in e?n(r,i):s in t?n(void 0,r):void 0}const u={url:s,method:s,data:s,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:o,headers:(t,e,r)=>i(Fa(t),Fa(e),0,!0)};return _s.forEach(Object.keys({...t,...e}),function(n){const s=u[n]||i,a=s(t[n],e[n],n);_s.isUndefined(a)&&s!==o||(r[n]=a)}),r}var Da=t=>{const e=Aa({},t);let r,{data:n,withXSRFToken:i,xsrfHeaderName:s,xsrfCookieName:a,headers:o,auth:u}=e;if(e.headers=o=pa.from(o),e.url=$s(ba(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),u&&o.set("Authorization","Basic "+btoa((u.username||"")+":"+(u.password?unescape(encodeURIComponent(u.password)):""))),_s.isFormData(n))if(na.hasStandardBrowserEnv||na.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if(!1!==(r=o.getContentType())){const[t,...e]=r?r.split(";").map(t=>t.trim()).filter(Boolean):[];o.setContentType([t||"multipart/form-data",...e].join("; "))}if(na.hasStandardBrowserEnv&&(i&&_s.isFunction(i)&&(i=i(e)),i||!1!==i&&Sa(e.url))){const t=s&&a&&Ea.read(a);t&&o.set(s,t)}return e};var Ca="undefined"!=typeof XMLHttpRequest&&function(t){return new Promise(function(e,r){const n=Da(t);let i=n.data;const s=pa.from(n.headers).normalize();let a,o,u,c,h,{responseType:l,onUploadProgress:f,onDownloadProgress:p}=n;function g(){c&&c(),h&&h(),n.cancelToken&&n.cancelToken.unsubscribe(a),n.signal&&n.signal.removeEventListener("abort",a)}let d=new XMLHttpRequest;function v(){if(!d)return;const n=pa.from("getAllResponseHeaders"in d&&d.getAllResponseHeaders());ma(function(t){e(t),g()},function(t){r(t),g()},{data:l&&"text"!==l&&"json"!==l?d.response:d.responseText,status:d.status,statusText:d.statusText,headers:n,config:t,request:d}),d=null}d.open(n.method.toUpperCase(),n.url,!0),d.timeout=n.timeout,"onloadend"in d?d.onloadend=v:d.onreadystatechange=function(){d&&4===d.readyState&&(0!==d.status||d.responseURL&&0===d.responseURL.indexOf("file:"))&&setTimeout(v)},d.onabort=function(){d&&(r(new js("Request aborted",js.ECONNABORTED,t,d)),d=null)},d.onerror=function(){r(new js("Network Error",js.ERR_NETWORK,t,d)),d=null},d.ontimeout=function(){let e=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded";const i=n.transitional||Ys;n.timeoutErrorMessage&&(e=n.timeoutErrorMessage),r(new js(e,i.clarifyTimeoutError?js.ETIMEDOUT:js.ECONNABORTED,t,d)),d=null},void 0===i&&s.setContentType(null),"setRequestHeader"in d&&_s.forEach(s.toJSON(),function(t,e){d.setRequestHeader(e,t)}),_s.isUndefined(n.withCredentials)||(d.withCredentials=!!n.withCredentials),l&&"json"!==l&&(d.responseType=n.responseType),p&&([u,h]=ya(p,!0),d.addEventListener("progress",u)),f&&d.upload&&([o,c]=ya(f),d.upload.addEventListener("progress",o),d.upload.addEventListener("loadend",c)),(n.cancelToken||n.signal)&&(a=e=>{d&&(r(!e||e.type?new va(null,t,d):e),d.abort(),d=null)},n.cancelToken&&n.cancelToken.subscribe(a),n.signal&&(n.signal.aborted?a():n.signal.addEventListener("abort",a)));const m=function(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}(n.url);m&&-1===na.protocols.indexOf(m)?r(new js("Unsupported protocol "+m+":",js.ERR_BAD_REQUEST,t)):d.send(i||null)})};var Ia=(t,e)=>{const{length:r}=t=t?t.filter(Boolean):[];if(e||r){let r,n=new AbortController;const i=function(t){if(!r){r=!0,a();const e=t instanceof Error?t:this.reason;n.abort(e instanceof js?e:new va(e instanceof Error?e.message:e))}};let s=e&&setTimeout(()=>{s=null,i(new js(`timeout ${e} of ms exceeded`,js.ETIMEDOUT))},e);const a=()=>{t&&(s&&clearTimeout(s),s=null,t.forEach(t=>{t.unsubscribe?t.unsubscribe(i):t.removeEventListener("abort",i)}),t=null)};t.forEach(t=>t.addEventListener("abort",i));const{signal:o}=n;return o.unsubscribe=()=>_s.asap(a),o}};const Pa=function*(t,e){let r=t.byteLength;if(!e||r<e)return void(yield t);let n,i=0;for(;i<r;)n=i+e,yield t.slice(i,n),i=n},Ra=async function*(t){if(t[Symbol.asyncIterator])return void(yield*t);const e=t.getReader();try{for(;;){const{done:t,value:r}=await e.read();if(t)break;yield r}}finally{await e.cancel()}},Ta=(t,e,r,n)=>{const i=async function*(t,e){for await(const r of Ra(t))yield*Pa(r,e)}(t,e);let s,a=0,o=t=>{s||(s=!0,n&&n(t))};return new ReadableStream({async pull(t){try{const{done:e,value:n}=await i.next();if(e)return o(),void t.close();let s=n.byteLength;if(r){let t=a+=s;r(t)}t.enqueue(new Uint8Array(n))}catch(t){throw o(t),t}},cancel:t=>(o(t),i.return())},{highWaterMark:2})},Na="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,Oa=Na&&"function"==typeof ReadableStream,Ba=Na&&("function"==typeof TextEncoder?(_a=new TextEncoder,t=>_a.encode(t)):async t=>new Uint8Array(await new Response(t).arrayBuffer()));var _a;const ja=(t,...e)=>{try{return!!t(...e)}catch(t){return!1}},Ha=Oa&&ja(()=>{let t=!1;const e=new Request(na.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e}),ka=Oa&&ja(()=>_s.isReadableStream(new Response("").body)),La={stream:ka&&(t=>t.body)};var Va;Na&&(Va=new Response,["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!La[t]&&(La[t]=_s.isFunction(Va[t])?e=>e[t]():(e,r)=>{throw new js(`Response type '${t}' is not supported`,js.ERR_NOT_SUPPORT,r)})}));const qa=async(t,e)=>{const r=_s.toFiniteNumber(t.getContentLength());return null==r?(async t=>{if(null==t)return 0;if(_s.isBlob(t))return t.size;if(_s.isSpecCompliantForm(t)){const e=new Request(na.origin,{method:"POST",body:t});return(await e.arrayBuffer()).byteLength}return _s.isArrayBufferView(t)||_s.isArrayBuffer(t)?t.byteLength:(_s.isURLSearchParams(t)&&(t+=""),_s.isString(t)?(await Ba(t)).byteLength:void 0)})(e):r};var Ma=Na&&(async t=>{let{url:e,method:r,data:n,signal:i,cancelToken:s,timeout:a,onDownloadProgress:o,onUploadProgress:u,responseType:c,headers:h,withCredentials:l="same-origin",fetchOptions:f}=Da(t);c=c?(c+"").toLowerCase():"text";let p,g=Ia([i,s&&s.toAbortSignal()],a);const d=g&&g.unsubscribe&&(()=>{g.unsubscribe()});let v;try{if(u&&Ha&&"get"!==r&&"head"!==r&&0!==(v=await qa(h,n))){let t,r=new Request(e,{method:"POST",body:n,duplex:"half"});if(_s.isFormData(n)&&(t=r.headers.get("content-type"))&&h.setContentType(t),r.body){const[t,e]=wa(v,ya(xa(u)));n=Ta(r.body,65536,t,e)}}_s.isString(l)||(l=l?"include":"omit");const i="credentials"in Request.prototype;p=new Request(e,{...f,signal:g,method:r.toUpperCase(),headers:h.normalize().toJSON(),body:n,duplex:"half",credentials:i?l:void 0});let s=await fetch(p,f);const a=ka&&("stream"===c||"response"===c);if(ka&&(o||a&&d)){const t={};["status","statusText","headers"].forEach(e=>{t[e]=s[e]});const e=_s.toFiniteNumber(s.headers.get("content-length")),[r,n]=o&&wa(e,ya(xa(o),!0))||[];s=new Response(Ta(s.body,65536,r,()=>{n&&n(),d&&d()}),t)}c=c||"text";let m=await La[_s.findKey(La,c)||"text"](s,t);return!a&&d&&d(),await new Promise((e,r)=>{ma(e,r,{data:m,headers:pa.from(s.headers),status:s.status,statusText:s.statusText,config:t,request:p})})}catch(e){if(d&&d(),e&&"TypeError"===e.name&&/Load failed|fetch/i.test(e.message))throw Object.assign(new js("Network Error",js.ERR_NETWORK,t,p),{cause:e.cause||e});throw js.from(e,e&&e.code,t,p)}});const Ka={http:null,xhr:Ca,fetch:Ma};_s.forEach(Ka,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch(t){}Object.defineProperty(t,"adapterName",{value:e})}});const Ua=t=>`- ${t}`,za=t=>_s.isFunction(t)||null===t||!1===t;var Wa=t=>{t=_s.isArray(t)?t:[t];const{length:e}=t;let r,n;const i={};for(let s=0;s<e;s++){let e;if(r=t[s],n=r,!za(r)&&(n=Ka[(e=String(r)).toLowerCase()],void 0===n))throw new js(`Unknown adapter '${e}'`);if(n)break;i[e||"#"+s]=n}if(!n){const t=Object.entries(i).map(([t,e])=>`adapter ${t} `+(!1===e?"is not supported by the environment":"is not available in the build"));throw new js("There is no suitable adapter to dispatch the request "+(e?t.length>1?"since :\n"+t.map(Ua).join("\n"):" "+Ua(t[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return n};function Ga(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new va(null,t)}function $a(t){Ga(t),t.headers=pa.from(t.headers),t.data=ga.call(t,t.transformRequest),-1!==["post","put","patch"].indexOf(t.method)&&t.headers.setContentType("application/x-www-form-urlencoded",!1);return Wa(t.adapter||aa.adapter)(t).then(function(e){return Ga(t),e.data=ga.call(t,t.transformResponse,e),e.headers=pa.from(e.headers),e},function(e){return da(e)||(Ga(t),e&&e.response&&(e.response.data=ga.call(t,t.transformResponse,e.response),e.response.headers=pa.from(e.response.headers))),Promise.reject(e)})}const Ja="1.11.0",Ya={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{Ya[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});const Xa={};Ya.transitional=function(t,e,r){function n(t,e){return"[Axios v"+Ja+"] Transitional option '"+t+"'"+e+(r?". "+r:"")}return(r,i,s)=>{if(!1===t)throw new js(n(i," has been removed"+(e?" in "+e:"")),js.ERR_DEPRECATED);return e&&!Xa[i]&&(Xa[i]=!0,console.warn(n(i," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(r,i,s)}},Ya.spelling=function(t){return(e,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};var Za={assertOptions:function(t,e,r){if("object"!=typeof t)throw new js("options must be an object",js.ERR_BAD_OPTION_VALUE);const n=Object.keys(t);let i=n.length;for(;i-- >0;){const s=n[i],a=e[s];if(a){const e=t[s],r=void 0===e||a(e,s,t);if(!0!==r)throw new js("option "+s+" must be "+r,js.ERR_BAD_OPTION_VALUE);continue}if(!0!==r)throw new js("Unknown option "+s,js.ERR_BAD_OPTION)}},validators:Ya};const Qa=Za.validators;class to{constructor(t){this.defaults=t||{},this.interceptors={request:new Js,response:new Js}}async request(t,e){try{return await this._request(t,e)}catch(t){if(t instanceof Error){let e={};Error.captureStackTrace?Error.captureStackTrace(e):e=new Error;const r=e.stack?e.stack.replace(/^.+\n/,""):"";try{t.stack?r&&!String(t.stack).endsWith(r.replace(/^.+\n.+\n/,""))&&(t.stack+="\n"+r):t.stack=r}catch(t){}}throw t}}_request(t,e){"string"==typeof t?(e=e||{}).url=t:e=t||{},e=Aa(this.defaults,e);const{transitional:r,paramsSerializer:n,headers:i}=e;void 0!==r&&Za.assertOptions(r,{silentJSONParsing:Qa.transitional(Qa.boolean),forcedJSONParsing:Qa.transitional(Qa.boolean),clarifyTimeoutError:Qa.transitional(Qa.boolean)},!1),null!=n&&(_s.isFunction(n)?e.paramsSerializer={serialize:n}:Za.assertOptions(n,{encode:Qa.function,serialize:Qa.function},!0)),void 0!==e.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?e.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:e.allowAbsoluteUrls=!0),Za.assertOptions(e,{baseUrl:Qa.spelling("baseURL"),withXsrfToken:Qa.spelling("withXSRFToken")},!0),e.method=(e.method||this.defaults.method||"get").toLowerCase();let s=i&&_s.merge(i.common,i[e.method]);i&&_s.forEach(["delete","get","head","post","put","patch","common"],t=>{delete i[t]}),e.headers=pa.concat(s,i);const a=[];let o=!0;this.interceptors.request.forEach(function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(o=o&&t.synchronous,a.unshift(t.fulfilled,t.rejected))});const u=[];let c;this.interceptors.response.forEach(function(t){u.push(t.fulfilled,t.rejected)});let h,l=0;if(!o){const t=[$a.bind(this),void 0];for(t.unshift(...a),t.push(...u),h=t.length,c=Promise.resolve(e);l<h;)c=c.then(t[l++],t[l++]);return c}h=a.length;let f=e;for(l=0;l<h;){const t=a[l++],e=a[l++];try{f=t(f)}catch(t){e.call(this,t);break}}try{c=$a.call(this,f)}catch(t){return Promise.reject(t)}for(l=0,h=u.length;l<h;)c=c.then(u[l++],u[l++]);return c}getUri(t){return $s(ba((t=Aa(this.defaults,t)).baseURL,t.url,t.allowAbsoluteUrls),t.params,t.paramsSerializer)}}_s.forEach(["delete","get","head","options"],function(t){to.prototype[t]=function(e,r){return this.request(Aa(r||{},{method:t,url:e,data:(r||{}).data}))}}),_s.forEach(["post","put","patch"],function(t){function e(e){return function(r,n,i){return this.request(Aa(i||{},{method:t,headers:e?{"Content-Type":"multipart/form-data"}:{},url:r,data:n}))}}to.prototype[t]=e(),to.prototype[t+"Form"]=e(!0)});var eo=to;class ro{constructor(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");let e;this.promise=new Promise(function(t){e=t});const r=this;this.promise.then(t=>{if(!r._listeners)return;let e=r._listeners.length;for(;e-- >0;)r._listeners[e](t);r._listeners=null}),this.promise.then=t=>{let e;const n=new Promise(t=>{r.subscribe(t),e=t}).then(t);return n.cancel=function(){r.unsubscribe(e)},n},t(function(t,n,i){r.reason||(r.reason=new va(t,n,i),e(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const e=this._listeners.indexOf(t);-1!==e&&this._listeners.splice(e,1)}toAbortSignal(){const t=new AbortController,e=e=>{t.abort(e)};return this.subscribe(e),t.signal.unsubscribe=()=>this.unsubscribe(e),t.signal}static source(){let t;return{token:new ro(function(e){t=e}),cancel:t}}}var no=ro;const io={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(io).forEach(([t,e])=>{io[e]=t});var so=io;const ao=function t(e){const r=new eo(e),n=zi(eo.prototype.request,r);return _s.extend(n,eo.prototype,r,{allOwnKeys:!0}),_s.extend(n,r,null,{allOwnKeys:!0}),n.create=function(r){return t(Aa(e,r))},n}(aa);ao.Axios=eo,ao.CanceledError=va,ao.CancelToken=no,ao.isCancel=da,ao.VERSION=Ja,ao.toFormData=Ks,ao.AxiosError=js,ao.Cancel=ao.CanceledError,ao.all=function(t){return Promise.all(t)},ao.spread=function(t){return function(e){return t.apply(null,e)}},ao.isAxiosError=function(t){return _s.isObject(t)&&!0===t.isAxiosError},ao.mergeConfig=Aa,ao.AxiosHeaders=pa,ao.formToJSON=t=>ia(_s.isHTMLForm(t)?new FormData(t):t),ao.getAdapter=Wa,ao.HttpStatusCode=so,ao.default=ao;var oo,uo,co=ao,ho={exports:{}};oo=ho,uo=ho.exports,function(){var t,e="Expected a function",r="__lodash_hash_undefined__",n="__lodash_placeholder__",i=16,s=32,a=64,o=128,u=256,c=1/0,h=9007199254740991,l=NaN,f=4294967295,p=[["ary",o],["bind",1],["bindKey",2],["curry",8],["curryRight",i],["flip",512],["partial",s],["partialRight",a],["rearg",u]],g="[object Arguments]",d="[object Array]",v="[object Boolean]",m="[object Date]",y="[object Error]",w="[object Function]",x="[object GeneratorFunction]",S="[object Map]",E="[object Number]",b="[object Object]",F="[object Promise]",A="[object RegExp]",D="[object Set]",C="[object String]",I="[object Symbol]",P="[object WeakMap]",R="[object ArrayBuffer]",T="[object DataView]",N="[object Float32Array]",O="[object Float64Array]",B="[object Int8Array]",_="[object Int16Array]",j="[object Int32Array]",H="[object Uint8Array]",k="[object Uint8ClampedArray]",L="[object Uint16Array]",V="[object Uint32Array]",q=/\b__p \+= '';/g,M=/\b(__p \+=) '' \+/g,K=/(__e\(.*?\)|\b__t\)) \+\n'';/g,U=/&(?:amp|lt|gt|quot|#39);/g,z=/[&<>"']/g,W=RegExp(U.source),G=RegExp(z.source),$=/<%-([\s\S]+?)%>/g,J=/<%([\s\S]+?)%>/g,Y=/<%=([\s\S]+?)%>/g,X=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Z=/^\w*$/,Q=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,tt=/[\\^$.*+?()[\]{}|]/g,et=RegExp(tt.source),rt=/^\s+/,it=/\s/,st=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,at=/\{\n\/\* \[wrapped with (.+)\] \*/,ot=/,? & /,ut=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ct=/[()=,{}\[\]\/\s]/,ht=/\\(\\)?/g,lt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ft=/\w*$/,pt=/^[-+]0x[0-9a-f]+$/i,gt=/^0b[01]+$/i,dt=/^\[object .+?Constructor\]$/,vt=/^0o[0-7]+$/i,mt=/^(?:0|[1-9]\d*)$/,yt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,wt=/($^)/,xt=/['\n\r\u2028\u2029\\]/g,St="\\ud800-\\udfff",Et="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",bt="\\u2700-\\u27bf",Ft="a-z\\xdf-\\xf6\\xf8-\\xff",At="A-Z\\xc0-\\xd6\\xd8-\\xde",Dt="\\ufe0e\\ufe0f",Ct="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",It="['’]",Pt="["+St+"]",Rt="["+Ct+"]",Tt="["+Et+"]",Nt="\\d+",Ot="["+bt+"]",Bt="["+Ft+"]",_t="[^"+St+Ct+Nt+bt+Ft+At+"]",jt="\\ud83c[\\udffb-\\udfff]",Ht="[^"+St+"]",kt="(?:\\ud83c[\\udde6-\\uddff]){2}",Lt="[\\ud800-\\udbff][\\udc00-\\udfff]",Vt="["+At+"]",qt="\\u200d",Mt="(?:"+Bt+"|"+_t+")",Kt="(?:"+Vt+"|"+_t+")",Ut="(?:['’](?:d|ll|m|re|s|t|ve))?",zt="(?:['’](?:D|LL|M|RE|S|T|VE))?",Wt="(?:"+Tt+"|"+jt+")?",Gt="["+Dt+"]?",$t=Gt+Wt+"(?:"+qt+"(?:"+[Ht,kt,Lt].join("|")+")"+Gt+Wt+")*",Jt="(?:"+[Ot,kt,Lt].join("|")+")"+$t,Yt="(?:"+[Ht+Tt+"?",Tt,kt,Lt,Pt].join("|")+")",Xt=RegExp(It,"g"),Zt=RegExp(Tt,"g"),Qt=RegExp(jt+"(?="+jt+")|"+Yt+$t,"g"),te=RegExp([Vt+"?"+Bt+"+"+Ut+"(?="+[Rt,Vt,"$"].join("|")+")",Kt+"+"+zt+"(?="+[Rt,Vt+Mt,"$"].join("|")+")",Vt+"?"+Mt+"+"+Ut,Vt+"+"+zt,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Nt,Jt].join("|"),"g"),ee=RegExp("["+qt+St+Et+Dt+"]"),re=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ne=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],ie=-1,se={};se[N]=se[O]=se[B]=se[_]=se[j]=se[H]=se[k]=se[L]=se[V]=!0,se[g]=se[d]=se[R]=se[v]=se[T]=se[m]=se[y]=se[w]=se[S]=se[E]=se[b]=se[A]=se[D]=se[C]=se[P]=!1;var ae={};ae[g]=ae[d]=ae[R]=ae[T]=ae[v]=ae[m]=ae[N]=ae[O]=ae[B]=ae[_]=ae[j]=ae[S]=ae[E]=ae[b]=ae[A]=ae[D]=ae[C]=ae[I]=ae[H]=ae[k]=ae[L]=ae[V]=!0,ae[y]=ae[w]=ae[P]=!1;var oe={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ue=parseFloat,ce=parseInt,he="object"==typeof nt&&nt&&nt.Object===Object&&nt,le="object"==typeof self&&self&&self.Object===Object&&self,fe=he||le||Function("return this")(),pe=uo&&!uo.nodeType&&uo,ge=pe&&oo&&!oo.nodeType&&oo,de=ge&&ge.exports===pe,ve=de&&he.process,me=function(){try{var t=ge&&ge.require&&ge.require("util").types;return t||ve&&ve.binding&&ve.binding("util")}catch(t){}}(),ye=me&&me.isArrayBuffer,we=me&&me.isDate,xe=me&&me.isMap,Se=me&&me.isRegExp,Ee=me&&me.isSet,be=me&&me.isTypedArray;function Fe(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}function Ae(t,e,r,n){for(var i=-1,s=null==t?0:t.length;++i<s;){var a=t[i];e(n,a,r(a),t)}return n}function De(t,e){for(var r=-1,n=null==t?0:t.length;++r<n&&!1!==e(t[r],r,t););return t}function Ce(t,e){for(var r=null==t?0:t.length;r--&&!1!==e(t[r],r,t););return t}function Ie(t,e){for(var r=-1,n=null==t?0:t.length;++r<n;)if(!e(t[r],r,t))return!1;return!0}function Pe(t,e){for(var r=-1,n=null==t?0:t.length,i=0,s=[];++r<n;){var a=t[r];e(a,r,t)&&(s[i++]=a)}return s}function Re(t,e){return!(null==t||!t.length)&&Ve(t,e,0)>-1}function Te(t,e,r){for(var n=-1,i=null==t?0:t.length;++n<i;)if(r(e,t[n]))return!0;return!1}function Ne(t,e){for(var r=-1,n=null==t?0:t.length,i=Array(n);++r<n;)i[r]=e(t[r],r,t);return i}function Oe(t,e){for(var r=-1,n=e.length,i=t.length;++r<n;)t[i+r]=e[r];return t}function Be(t,e,r,n){var i=-1,s=null==t?0:t.length;for(n&&s&&(r=t[++i]);++i<s;)r=e(r,t[i],i,t);return r}function _e(t,e,r,n){var i=null==t?0:t.length;for(n&&i&&(r=t[--i]);i--;)r=e(r,t[i],i,t);return r}function je(t,e){for(var r=-1,n=null==t?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}var He=Ue("length");function ke(t,e,r){var n;return r(t,function(t,r,i){if(e(t,r,i))return n=r,!1}),n}function Le(t,e,r,n){for(var i=t.length,s=r+(n?1:-1);n?s--:++s<i;)if(e(t[s],s,t))return s;return-1}function Ve(t,e,r){return e==e?function(t,e,r){for(var n=r-1,i=t.length;++n<i;)if(t[n]===e)return n;return-1}(t,e,r):Le(t,Me,r)}function qe(t,e,r,n){for(var i=r-1,s=t.length;++i<s;)if(n(t[i],e))return i;return-1}function Me(t){return t!=t}function Ke(t,e){var r=null==t?0:t.length;return r?Ge(t,e)/r:l}function Ue(e){return function(r){return null==r?t:r[e]}}function ze(e){return function(r){return null==e?t:e[r]}}function We(t,e,r,n,i){return i(t,function(t,i,s){r=n?(n=!1,t):e(r,t,i,s)}),r}function Ge(e,r){for(var n,i=-1,s=e.length;++i<s;){var a=r(e[i]);a!==t&&(n=n===t?a:n+a)}return n}function $e(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}function Je(t){return t?t.slice(0,fr(t)+1).replace(rt,""):t}function Ye(t){return function(e){return t(e)}}function Xe(t,e){return Ne(e,function(e){return t[e]})}function Ze(t,e){return t.has(e)}function Qe(t,e){for(var r=-1,n=t.length;++r<n&&Ve(e,t[r],0)>-1;);return r}function tr(t,e){for(var r=t.length;r--&&Ve(e,t[r],0)>-1;);return r}var er=ze({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),rr=ze({"&":"&","<":"<",">":">",'"':""","'":"'"});function nr(t){return"\\"+oe[t]}function ir(t){return ee.test(t)}function sr(t){var e=-1,r=Array(t.size);return t.forEach(function(t,n){r[++e]=[n,t]}),r}function ar(t,e){return function(r){return t(e(r))}}function or(t,e){for(var r=-1,i=t.length,s=0,a=[];++r<i;){var o=t[r];o!==e&&o!==n||(t[r]=n,a[s++]=r)}return a}function ur(t){var e=-1,r=Array(t.size);return t.forEach(function(t){r[++e]=t}),r}function cr(t){var e=-1,r=Array(t.size);return t.forEach(function(t){r[++e]=[t,t]}),r}function hr(t){return ir(t)?function(t){for(var e=Qt.lastIndex=0;Qt.test(t);)++e;return e}(t):He(t)}function lr(t){return ir(t)?function(t){return t.match(Qt)||[]}(t):function(t){return t.split("")}(t)}function fr(t){for(var e=t.length;e--&&it.test(t.charAt(e)););return e}var pr=ze({"&":"&","<":"<",">":">",""":'"',"'":"'"}),gr=function nt(it){var St,Et=(it=null==it?fe:gr.defaults(fe.Object(),it,gr.pick(fe,ne))).Array,bt=it.Date,Ft=it.Error,At=it.Function,Dt=it.Math,Ct=it.Object,It=it.RegExp,Pt=it.String,Rt=it.TypeError,Tt=Et.prototype,Nt=At.prototype,Ot=Ct.prototype,Bt=it["__core-js_shared__"],_t=Nt.toString,jt=Ot.hasOwnProperty,Ht=0,kt=(St=/[^.]+$/.exec(Bt&&Bt.keys&&Bt.keys.IE_PROTO||""))?"Symbol(src)_1."+St:"",Lt=Ot.toString,Vt=_t.call(Ct),qt=fe._,Mt=It("^"+_t.call(jt).replace(tt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Kt=de?it.Buffer:t,Ut=it.Symbol,zt=it.Uint8Array,Wt=Kt?Kt.allocUnsafe:t,Gt=ar(Ct.getPrototypeOf,Ct),$t=Ct.create,Jt=Ot.propertyIsEnumerable,Yt=Tt.splice,Qt=Ut?Ut.isConcatSpreadable:t,ee=Ut?Ut.iterator:t,oe=Ut?Ut.toStringTag:t,he=function(){try{var t=fs(Ct,"defineProperty");return t({},"",{}),t}catch(t){}}(),le=it.clearTimeout!==fe.clearTimeout&&it.clearTimeout,pe=bt&&bt.now!==fe.Date.now&&bt.now,ge=it.setTimeout!==fe.setTimeout&&it.setTimeout,ve=Dt.ceil,me=Dt.floor,He=Ct.getOwnPropertySymbols,ze=Kt?Kt.isBuffer:t,dr=it.isFinite,vr=Tt.join,mr=ar(Ct.keys,Ct),yr=Dt.max,wr=Dt.min,xr=bt.now,Sr=it.parseInt,Er=Dt.random,br=Tt.reverse,Fr=fs(it,"DataView"),Ar=fs(it,"Map"),Dr=fs(it,"Promise"),Cr=fs(it,"Set"),Ir=fs(it,"WeakMap"),Pr=fs(Ct,"create"),Rr=Ir&&new Ir,Tr={},Nr=ks(Fr),Or=ks(Ar),Br=ks(Dr),_r=ks(Cr),jr=ks(Ir),Hr=Ut?Ut.prototype:t,kr=Hr?Hr.valueOf:t,Lr=Hr?Hr.toString:t;function Vr(t){if(eo(t)&&!Ua(t)&&!(t instanceof Ur)){if(t instanceof Kr)return t;if(jt.call(t,"__wrapped__"))return Ls(t)}return new Kr(t)}var qr=function(){function e(){}return function(r){if(!to(r))return{};if($t)return $t(r);e.prototype=r;var n=new e;return e.prototype=t,n}}();function Mr(){}function Kr(e,r){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!r,this.__index__=0,this.__values__=t}function Ur(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=f,this.__views__=[]}function zr(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Wr(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Gr(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function $r(t){var e=-1,r=null==t?0:t.length;for(this.__data__=new Gr;++e<r;)this.add(t[e])}function Jr(t){var e=this.__data__=new Wr(t);this.size=e.size}function Yr(t,e){var r=Ua(t),n=!r&&Ka(t),i=!r&&!n&&$a(t),s=!r&&!n&&!i&&co(t),a=r||n||i||s,o=a?$e(t.length,Pt):[],u=o.length;for(var c in t)!e&&!jt.call(t,c)||a&&("length"==c||i&&("offset"==c||"parent"==c)||s&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||ws(c,u))||o.push(c);return o}function Xr(e){var r=e.length;return r?e[Jn(0,r-1)]:t}function Zr(t,e){return _s(Ri(t),un(e,0,t.length))}function Qr(t){return _s(Ri(t))}function tn(e,r,n){(n!==t&&!Va(e[r],n)||n===t&&!(r in e))&&an(e,r,n)}function en(e,r,n){var i=e[r];jt.call(e,r)&&Va(i,n)&&(n!==t||r in e)||an(e,r,n)}function rn(t,e){for(var r=t.length;r--;)if(Va(t[r][0],e))return r;return-1}function nn(t,e,r,n){return pn(t,function(t,i,s){e(n,t,r(t),s)}),n}function sn(t,e){return t&&Ti(e,No(e),t)}function an(t,e,r){"__proto__"==e&&he?he(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}function on(e,r){for(var n=-1,i=r.length,s=Et(i),a=null==e;++n<i;)s[n]=a?t:Co(e,r[n]);return s}function un(e,r,n){return e==e&&(n!==t&&(e=e<=n?e:n),r!==t&&(e=e>=r?e:r)),e}function cn(e,r,n,i,s,a){var o,u=1&r,c=2&r,h=4&r;if(n&&(o=s?n(e,i,s,a):n(e)),o!==t)return o;if(!to(e))return e;var l=Ua(e);if(l){if(o=function(t){var e=t.length,r=new t.constructor(e);return e&&"string"==typeof t[0]&&jt.call(t,"index")&&(r.index=t.index,r.input=t.input),r}(e),!u)return Ri(e,o)}else{var f=ds(e),p=f==w||f==x;if($a(e))return Fi(e,u);if(f==b||f==g||p&&!s){if(o=c||p?{}:ms(e),!u)return c?function(t,e){return Ti(t,gs(t),e)}(e,function(t,e){return t&&Ti(e,Oo(e),t)}(o,e)):function(t,e){return Ti(t,ps(t),e)}(e,sn(o,e))}else{if(!ae[f])return s?e:{};o=function(t,e,r){var n,i=t.constructor;switch(e){case R:return Ai(t);case v:case m:return new i(+t);case T:return function(t,e){var r=e?Ai(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}(t,r);case N:case O:case B:case _:case j:case H:case k:case L:case V:return Di(t,r);case S:return new i;case E:case C:return new i(t);case A:return function(t){var e=new t.constructor(t.source,ft.exec(t));return e.lastIndex=t.lastIndex,e}(t);case D:return new i;case I:return n=t,kr?Ct(kr.call(n)):{}}}(e,f,u)}}a||(a=new Jr);var d=a.get(e);if(d)return d;a.set(e,o),ao(e)?e.forEach(function(t){o.add(cn(t,r,n,t,e,a))}):ro(e)&&e.forEach(function(t,i){o.set(i,cn(t,r,n,i,e,a))});var y=l?t:(h?c?ss:is:c?Oo:No)(e);return De(y||e,function(t,i){y&&(t=e[i=t]),en(o,i,cn(t,r,n,i,e,a))}),o}function hn(e,r,n){var i=n.length;if(null==e)return!i;for(e=Ct(e);i--;){var s=n[i],a=r[s],o=e[s];if(o===t&&!(s in e)||!a(o))return!1}return!0}function ln(r,n,i){if("function"!=typeof r)throw new Rt(e);return Ts(function(){r.apply(t,i)},n)}function fn(t,e,r,n){var i=-1,s=Re,a=!0,o=t.length,u=[],c=e.length;if(!o)return u;r&&(e=Ne(e,Ye(r))),n?(s=Te,a=!1):e.length>=200&&(s=Ze,a=!1,e=new $r(e));t:for(;++i<o;){var h=t[i],l=null==r?h:r(h);if(h=n||0!==h?h:0,a&&l==l){for(var f=c;f--;)if(e[f]===l)continue t;u.push(h)}else s(e,l,n)||u.push(h)}return u}Vr.templateSettings={escape:$,evaluate:J,interpolate:Y,variable:"",imports:{_:Vr}},Vr.prototype=Mr.prototype,Vr.prototype.constructor=Vr,Kr.prototype=qr(Mr.prototype),Kr.prototype.constructor=Kr,Ur.prototype=qr(Mr.prototype),Ur.prototype.constructor=Ur,zr.prototype.clear=function(){this.__data__=Pr?Pr(null):{},this.size=0},zr.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},zr.prototype.get=function(e){var n=this.__data__;if(Pr){var i=n[e];return i===r?t:i}return jt.call(n,e)?n[e]:t},zr.prototype.has=function(e){var r=this.__data__;return Pr?r[e]!==t:jt.call(r,e)},zr.prototype.set=function(e,n){var i=this.__data__;return this.size+=this.has(e)?0:1,i[e]=Pr&&n===t?r:n,this},Wr.prototype.clear=function(){this.__data__=[],this.size=0},Wr.prototype.delete=function(t){var e=this.__data__,r=rn(e,t);return!(r<0||(r==e.length-1?e.pop():Yt.call(e,r,1),--this.size,0))},Wr.prototype.get=function(e){var r=this.__data__,n=rn(r,e);return n<0?t:r[n][1]},Wr.prototype.has=function(t){return rn(this.__data__,t)>-1},Wr.prototype.set=function(t,e){var r=this.__data__,n=rn(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this},Gr.prototype.clear=function(){this.size=0,this.__data__={hash:new zr,map:new(Ar||Wr),string:new zr}},Gr.prototype.delete=function(t){var e=hs(this,t).delete(t);return this.size-=e?1:0,e},Gr.prototype.get=function(t){return hs(this,t).get(t)},Gr.prototype.has=function(t){return hs(this,t).has(t)},Gr.prototype.set=function(t,e){var r=hs(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this},$r.prototype.add=$r.prototype.push=function(t){return this.__data__.set(t,r),this},$r.prototype.has=function(t){return this.__data__.has(t)},Jr.prototype.clear=function(){this.__data__=new Wr,this.size=0},Jr.prototype.delete=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r},Jr.prototype.get=function(t){return this.__data__.get(t)},Jr.prototype.has=function(t){return this.__data__.has(t)},Jr.prototype.set=function(t,e){var r=this.__data__;if(r instanceof Wr){var n=r.__data__;if(!Ar||n.length<199)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new Gr(n)}return r.set(t,e),this.size=r.size,this};var pn=Bi(Sn),gn=Bi(En,!0);function dn(t,e){var r=!0;return pn(t,function(t,n,i){return r=!!e(t,n,i)}),r}function vn(e,r,n){for(var i=-1,s=e.length;++i<s;){var a=e[i],o=r(a);if(null!=o&&(u===t?o==o&&!uo(o):n(o,u)))var u=o,c=a}return c}function mn(t,e){var r=[];return pn(t,function(t,n,i){e(t,n,i)&&r.push(t)}),r}function yn(t,e,r,n,i){var s=-1,a=t.length;for(r||(r=ys),i||(i=[]);++s<a;){var o=t[s];e>0&&r(o)?e>1?yn(o,e-1,r,n,i):Oe(i,o):n||(i[i.length]=o)}return i}var wn=_i(),xn=_i(!0);function Sn(t,e){return t&&wn(t,e,No)}function En(t,e){return t&&xn(t,e,No)}function bn(t,e){return Pe(e,function(e){return Xa(t[e])})}function Fn(e,r){for(var n=0,i=(r=xi(r,e)).length;null!=e&&n<i;)e=e[Hs(r[n++])];return n&&n==i?e:t}function An(t,e,r){var n=e(t);return Ua(t)?n:Oe(n,r(t))}function Dn(e){return null==e?e===t?"[object Undefined]":"[object Null]":oe&&oe in Ct(e)?function(e){var r=jt.call(e,oe),n=e[oe];try{e[oe]=t;var i=!0}catch(t){}var s=Lt.call(e);return i&&(r?e[oe]=n:delete e[oe]),s}(e):function(t){return Lt.call(t)}(e)}function Cn(t,e){return t>e}function In(t,e){return null!=t&&jt.call(t,e)}function Pn(t,e){return null!=t&&e in Ct(t)}function Rn(e,r,n){for(var i=n?Te:Re,s=e[0].length,a=e.length,o=a,u=Et(a),c=1/0,h=[];o--;){var l=e[o];o&&r&&(l=Ne(l,Ye(r))),c=wr(l.length,c),u[o]=!n&&(r||s>=120&&l.length>=120)?new $r(o&&l):t}l=e[0];var f=-1,p=u[0];t:for(;++f<s&&h.length<c;){var g=l[f],d=r?r(g):g;if(g=n||0!==g?g:0,!(p?Ze(p,d):i(h,d,n))){for(o=a;--o;){var v=u[o];if(!(v?Ze(v,d):i(e[o],d,n)))continue t}p&&p.push(d),h.push(g)}}return h}function Tn(e,r,n){var i=null==(e=Is(e,r=xi(r,e)))?e:e[Hs(Ys(r))];return null==i?t:Fe(i,e,n)}function Nn(t){return eo(t)&&Dn(t)==g}function On(e,r,n,i,s){return e===r||(null==e||null==r||!eo(e)&&!eo(r)?e!=e&&r!=r:function(e,r,n,i,s,a){var o=Ua(e),u=Ua(r),c=o?d:ds(e),h=u?d:ds(r),l=(c=c==g?b:c)==b,f=(h=h==g?b:h)==b,p=c==h;if(p&&$a(e)){if(!$a(r))return!1;o=!0,l=!1}if(p&&!l)return a||(a=new Jr),o||co(e)?rs(e,r,n,i,s,a):function(t,e,r,n,i,s,a){switch(r){case T:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case R:return!(t.byteLength!=e.byteLength||!s(new zt(t),new zt(e)));case v:case m:case E:return Va(+t,+e);case y:return t.name==e.name&&t.message==e.message;case A:case C:return t==e+"";case S:var o=sr;case D:var u=1&n;if(o||(o=ur),t.size!=e.size&&!u)return!1;var c=a.get(t);if(c)return c==e;n|=2,a.set(t,e);var h=rs(o(t),o(e),n,i,s,a);return a.delete(t),h;case I:if(kr)return kr.call(t)==kr.call(e)}return!1}(e,r,c,n,i,s,a);if(!(1&n)){var w=l&&jt.call(e,"__wrapped__"),x=f&&jt.call(r,"__wrapped__");if(w||x){var F=w?e.value():e,P=x?r.value():r;return a||(a=new Jr),s(F,P,n,i,a)}}return!!p&&(a||(a=new Jr),function(e,r,n,i,s,a){var o=1&n,u=is(e),c=u.length,h=is(r),l=h.length;if(c!=l&&!o)return!1;for(var f=c;f--;){var p=u[f];if(!(o?p in r:jt.call(r,p)))return!1}var g=a.get(e),d=a.get(r);if(g&&d)return g==r&&d==e;var v=!0;a.set(e,r),a.set(r,e);for(var m=o;++f<c;){var y=e[p=u[f]],w=r[p];if(i)var x=o?i(w,y,p,r,e,a):i(y,w,p,e,r,a);if(!(x===t?y===w||s(y,w,n,i,a):x)){v=!1;break}m||(m="constructor"==p)}if(v&&!m){var S=e.constructor,E=r.constructor;S==E||!("constructor"in e)||!("constructor"in r)||"function"==typeof S&&S instanceof S&&"function"==typeof E&&E instanceof E||(v=!1)}return a.delete(e),a.delete(r),v}(e,r,n,i,s,a))}(e,r,n,i,On,s))}function Bn(e,r,n,i){var s=n.length,a=s,o=!i;if(null==e)return!a;for(e=Ct(e);s--;){var u=n[s];if(o&&u[2]?u[1]!==e[u[0]]:!(u[0]in e))return!1}for(;++s<a;){var c=(u=n[s])[0],h=e[c],l=u[1];if(o&&u[2]){if(h===t&&!(c in e))return!1}else{var f=new Jr;if(i)var p=i(h,l,c,e,r,f);if(!(p===t?On(l,h,3,i,f):p))return!1}}return!0}function _n(t){return!(!to(t)||(e=t,kt&&kt in e))&&(Xa(t)?Mt:dt).test(ks(t));var e}function jn(t){return"function"==typeof t?t:null==t?iu:"object"==typeof t?Ua(t)?Mn(t[0],t[1]):qn(t):pu(t)}function Hn(t){if(!Fs(t))return mr(t);var e=[];for(var r in Ct(t))jt.call(t,r)&&"constructor"!=r&&e.push(r);return e}function kn(t){if(!to(t))return function(t){var e=[];if(null!=t)for(var r in Ct(t))e.push(r);return e}(t);var e=Fs(t),r=[];for(var n in t)("constructor"!=n||!e&&jt.call(t,n))&&r.push(n);return r}function Ln(t,e){return t<e}function Vn(t,e){var r=-1,n=Wa(t)?Et(t.length):[];return pn(t,function(t,i,s){n[++r]=e(t,i,s)}),n}function qn(t){var e=ls(t);return 1==e.length&&e[0][2]?Ds(e[0][0],e[0][1]):function(r){return r===t||Bn(r,t,e)}}function Mn(e,r){return Ss(e)&&As(r)?Ds(Hs(e),r):function(n){var i=Co(n,e);return i===t&&i===r?Io(n,e):On(r,i,3)}}function Kn(e,r,n,i,s){e!==r&&wn(r,function(a,o){if(s||(s=new Jr),to(a))!function(e,r,n,i,s,a,o){var u=Ps(e,n),c=Ps(r,n),h=o.get(c);if(h)tn(e,n,h);else{var l=a?a(u,c,n+"",e,r,o):t,f=l===t;if(f){var p=Ua(c),g=!p&&$a(c),d=!p&&!g&&co(c);l=c,p||g||d?Ua(u)?l=u:Ga(u)?l=Ri(u):g?(f=!1,l=Fi(c,!0)):d?(f=!1,l=Di(c,!0)):l=[]:io(c)||Ka(c)?(l=u,Ka(u)?l=yo(u):to(u)&&!Xa(u)||(l=ms(c))):f=!1}f&&(o.set(c,l),s(l,c,i,a,o),o.delete(c)),tn(e,n,l)}}(e,r,o,n,Kn,i,s);else{var u=i?i(Ps(e,o),a,o+"",e,r,s):t;u===t&&(u=a),tn(e,o,u)}},Oo)}function Un(e,r){var n=e.length;if(n)return ws(r+=r<0?n:0,n)?e[r]:t}function zn(t,e,r){e=e.length?Ne(e,function(t){return Ua(t)?function(e){return Fn(e,1===t.length?t[0]:t)}:t}):[iu];var n=-1;e=Ne(e,Ye(cs()));var i=Vn(t,function(t,r,i){var s=Ne(e,function(e){return e(t)});return{criteria:s,index:++n,value:t}});return function(t,e){var r=t.length;for(t.sort(e);r--;)t[r]=t[r].value;return t}(i,function(t,e){return function(t,e,r){for(var n=-1,i=t.criteria,s=e.criteria,a=i.length,o=r.length;++n<a;){var u=Ci(i[n],s[n]);if(u)return n>=o?u:u*("desc"==r[n]?-1:1)}return t.index-e.index}(t,e,r)})}function Wn(t,e,r){for(var n=-1,i=e.length,s={};++n<i;){var a=e[n],o=Fn(t,a);r(o,a)&&ti(s,xi(a,t),o)}return s}function Gn(t,e,r,n){var i=n?qe:Ve,s=-1,a=e.length,o=t;for(t===e&&(e=Ri(e)),r&&(o=Ne(t,Ye(r)));++s<a;)for(var u=0,c=e[s],h=r?r(c):c;(u=i(o,h,u,n))>-1;)o!==t&&Yt.call(o,u,1),Yt.call(t,u,1);return t}function $n(t,e){for(var r=t?e.length:0,n=r-1;r--;){var i=e[r];if(r==n||i!==s){var s=i;ws(i)?Yt.call(t,i,1):fi(t,i)}}return t}function Jn(t,e){return t+me(Er()*(e-t+1))}function Yn(t,e){var r="";if(!t||e<1||e>h)return r;do{e%2&&(r+=t),(e=me(e/2))&&(t+=t)}while(e);return r}function Xn(t,e){return Ns(Cs(t,e,iu),t+"")}function Zn(t){return Xr(qo(t))}function Qn(t,e){var r=qo(t);return _s(r,un(e,0,r.length))}function ti(e,r,n,i){if(!to(e))return e;for(var s=-1,a=(r=xi(r,e)).length,o=a-1,u=e;null!=u&&++s<a;){var c=Hs(r[s]),h=n;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;if(s!=o){var l=u[c];(h=i?i(l,c,u):t)===t&&(h=to(l)?l:ws(r[s+1])?[]:{})}en(u,c,h),u=u[c]}return e}var ei=Rr?function(t,e){return Rr.set(t,e),t}:iu,ri=he?function(t,e){return he(t,"toString",{configurable:!0,enumerable:!1,value:eu(e),writable:!0})}:iu;function ni(t){return _s(qo(t))}function ii(t,e,r){var n=-1,i=t.length;e<0&&(e=-e>i?0:i+e),(r=r>i?i:r)<0&&(r+=i),i=e>r?0:r-e>>>0,e>>>=0;for(var s=Et(i);++n<i;)s[n]=t[n+e];return s}function si(t,e){var r;return pn(t,function(t,n,i){return!(r=e(t,n,i))}),!!r}function ai(t,e,r){var n=0,i=null==t?n:t.length;if("number"==typeof e&&e==e&&i<=2147483647){for(;n<i;){var s=n+i>>>1,a=t[s];null!==a&&!uo(a)&&(r?a<=e:a<e)?n=s+1:i=s}return i}return oi(t,e,iu,r)}function oi(e,r,n,i){var s=0,a=null==e?0:e.length;if(0===a)return 0;for(var o=(r=n(r))!=r,u=null===r,c=uo(r),h=r===t;s<a;){var l=me((s+a)/2),f=n(e[l]),p=f!==t,g=null===f,d=f==f,v=uo(f);if(o)var m=i||d;else m=h?d&&(i||p):u?d&&p&&(i||!g):c?d&&p&&!g&&(i||!v):!g&&!v&&(i?f<=r:f<r);m?s=l+1:a=l}return wr(a,4294967294)}function ui(t,e){for(var r=-1,n=t.length,i=0,s=[];++r<n;){var a=t[r],o=e?e(a):a;if(!r||!Va(o,u)){var u=o;s[i++]=0===a?0:a}}return s}function ci(t){return"number"==typeof t?t:uo(t)?l:+t}function hi(t){if("string"==typeof t)return t;if(Ua(t))return Ne(t,hi)+"";if(uo(t))return Lr?Lr.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function li(t,e,r){var n=-1,i=Re,s=t.length,a=!0,o=[],u=o;if(r)a=!1,i=Te;else if(s>=200){var c=e?null:Yi(t);if(c)return ur(c);a=!1,i=Ze,u=new $r}else u=e?[]:o;t:for(;++n<s;){var h=t[n],l=e?e(h):h;if(h=r||0!==h?h:0,a&&l==l){for(var f=u.length;f--;)if(u[f]===l)continue t;e&&u.push(l),o.push(h)}else i(u,l,r)||(u!==o&&u.push(l),o.push(h))}return o}function fi(t,e){return null==(t=Is(t,e=xi(e,t)))||delete t[Hs(Ys(e))]}function pi(t,e,r,n){return ti(t,e,r(Fn(t,e)),n)}function gi(t,e,r,n){for(var i=t.length,s=n?i:-1;(n?s--:++s<i)&&e(t[s],s,t););return r?ii(t,n?0:s,n?s+1:i):ii(t,n?s+1:0,n?i:s)}function di(t,e){var r=t;return r instanceof Ur&&(r=r.value()),Be(e,function(t,e){return e.func.apply(e.thisArg,Oe([t],e.args))},r)}function vi(t,e,r){var n=t.length;if(n<2)return n?li(t[0]):[];for(var i=-1,s=Et(n);++i<n;)for(var a=t[i],o=-1;++o<n;)o!=i&&(s[i]=fn(s[i]||a,t[o],e,r));return li(yn(s,1),e,r)}function mi(e,r,n){for(var i=-1,s=e.length,a=r.length,o={};++i<s;){var u=i<a?r[i]:t;n(o,e[i],u)}return o}function yi(t){return Ga(t)?t:[]}function wi(t){return"function"==typeof t?t:iu}function xi(t,e){return Ua(t)?t:Ss(t,e)?[t]:js(wo(t))}var Si=Xn;function Ei(e,r,n){var i=e.length;return n=n===t?i:n,!r&&n>=i?e:ii(e,r,n)}var bi=le||function(t){return fe.clearTimeout(t)};function Fi(t,e){if(e)return t.slice();var r=t.length,n=Wt?Wt(r):new t.constructor(r);return t.copy(n),n}function Ai(t){var e=new t.constructor(t.byteLength);return new zt(e).set(new zt(t)),e}function Di(t,e){var r=e?Ai(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}function Ci(e,r){if(e!==r){var n=e!==t,i=null===e,s=e==e,a=uo(e),o=r!==t,u=null===r,c=r==r,h=uo(r);if(!u&&!h&&!a&&e>r||a&&o&&c&&!u&&!h||i&&o&&c||!n&&c||!s)return 1;if(!i&&!a&&!h&&e<r||h&&n&&s&&!i&&!a||u&&n&&s||!o&&s||!c)return-1}return 0}function Ii(t,e,r,n){for(var i=-1,s=t.length,a=r.length,o=-1,u=e.length,c=yr(s-a,0),h=Et(u+c),l=!n;++o<u;)h[o]=e[o];for(;++i<a;)(l||i<s)&&(h[r[i]]=t[i]);for(;c--;)h[o++]=t[i++];return h}function Pi(t,e,r,n){for(var i=-1,s=t.length,a=-1,o=r.length,u=-1,c=e.length,h=yr(s-o,0),l=Et(h+c),f=!n;++i<h;)l[i]=t[i];for(var p=i;++u<c;)l[p+u]=e[u];for(;++a<o;)(f||i<s)&&(l[p+r[a]]=t[i++]);return l}function Ri(t,e){var r=-1,n=t.length;for(e||(e=Et(n));++r<n;)e[r]=t[r];return e}function Ti(e,r,n,i){var s=!n;n||(n={});for(var a=-1,o=r.length;++a<o;){var u=r[a],c=i?i(n[u],e[u],u,n,e):t;c===t&&(c=e[u]),s?an(n,u,c):en(n,u,c)}return n}function Ni(t,e){return function(r,n){var i=Ua(r)?Ae:nn,s=e?e():{};return i(r,t,cs(n,2),s)}}function Oi(e){return Xn(function(r,n){var i=-1,s=n.length,a=s>1?n[s-1]:t,o=s>2?n[2]:t;for(a=e.length>3&&"function"==typeof a?(s--,a):t,o&&xs(n[0],n[1],o)&&(a=s<3?t:a,s=1),r=Ct(r);++i<s;){var u=n[i];u&&e(r,u,i,a)}return r})}function Bi(t,e){return function(r,n){if(null==r)return r;if(!Wa(r))return t(r,n);for(var i=r.length,s=e?i:-1,a=Ct(r);(e?s--:++s<i)&&!1!==n(a[s],s,a););return r}}function _i(t){return function(e,r,n){for(var i=-1,s=Ct(e),a=n(e),o=a.length;o--;){var u=a[t?o:++i];if(!1===r(s[u],u,s))break}return e}}function ji(e){return function(r){var n=ir(r=wo(r))?lr(r):t,i=n?n[0]:r.charAt(0),s=n?Ei(n,1).join(""):r.slice(1);return i[e]()+s}}function Hi(t){return function(e){return Be(Zo(Uo(e).replace(Xt,"")),t,"")}}function ki(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var r=qr(t.prototype),n=t.apply(r,e);return to(n)?n:r}}function Li(e){return function(r,n,i){var s=Ct(r);if(!Wa(r)){var a=cs(n,3);r=No(r),n=function(t){return a(s[t],t,s)}}var o=e(r,n,i);return o>-1?s[a?r[o]:o]:t}}function Vi(r){return ns(function(n){var i=n.length,s=i,a=Kr.prototype.thru;for(r&&n.reverse();s--;){var o=n[s];if("function"!=typeof o)throw new Rt(e);if(a&&!u&&"wrapper"==os(o))var u=new Kr([],!0)}for(s=u?s:i;++s<i;){var c=os(o=n[s]),h="wrapper"==c?as(o):t;u=h&&Es(h[0])&&424==h[1]&&!h[4].length&&1==h[9]?u[os(h[0])].apply(u,h[3]):1==o.length&&Es(o)?u[c]():u.thru(o)}return function(){var t=arguments,e=t[0];if(u&&1==t.length&&Ua(e))return u.plant(e).value();for(var r=0,s=i?n[r].apply(this,t):e;++r<i;)s=n[r].call(this,s);return s}})}function qi(e,r,n,i,s,a,u,c,h,l){var f=r&o,p=1&r,g=2&r,d=24&r,v=512&r,m=g?t:ki(e);return function o(){for(var y=arguments.length,w=Et(y),x=y;x--;)w[x]=arguments[x];if(d)var S=us(o),E=function(t,e){for(var r=t.length,n=0;r--;)t[r]===e&&++n;return n}(w,S);if(i&&(w=Ii(w,i,s,d)),a&&(w=Pi(w,a,u,d)),y-=E,d&&y<l){var b=or(w,S);return $i(e,r,qi,o.placeholder,n,w,b,c,h,l-y)}var F=p?n:this,A=g?F[e]:e;return y=w.length,c?w=function(e,r){for(var n=e.length,i=wr(r.length,n),s=Ri(e);i--;){var a=r[i];e[i]=ws(a,n)?s[a]:t}return e}(w,c):v&&y>1&&w.reverse(),f&&h<y&&(w.length=h),this&&this!==fe&&this instanceof o&&(A=m||ki(A)),A.apply(F,w)}}function Mi(t,e){return function(r,n){return function(t,e,r,n){return Sn(t,function(t,i,s){e(n,r(t),i,s)}),n}(r,t,e(n),{})}}function Ki(e,r){return function(n,i){var s;if(n===t&&i===t)return r;if(n!==t&&(s=n),i!==t){if(s===t)return i;"string"==typeof n||"string"==typeof i?(n=hi(n),i=hi(i)):(n=ci(n),i=ci(i)),s=e(n,i)}return s}}function Ui(t){return ns(function(e){return e=Ne(e,Ye(cs())),Xn(function(r){var n=this;return t(e,function(t){return Fe(t,n,r)})})})}function zi(e,r){var n=(r=r===t?" ":hi(r)).length;if(n<2)return n?Yn(r,e):r;var i=Yn(r,ve(e/hr(r)));return ir(r)?Ei(lr(i),0,e).join(""):i.slice(0,e)}function Wi(e){return function(r,n,i){return i&&"number"!=typeof i&&xs(r,n,i)&&(n=i=t),r=po(r),n===t?(n=r,r=0):n=po(n),function(t,e,r,n){for(var i=-1,s=yr(ve((e-t)/(r||1)),0),a=Et(s);s--;)a[n?s:++i]=t,t+=r;return a}(r,n,i=i===t?r<n?1:-1:po(i),e)}}function Gi(t){return function(e,r){return"string"==typeof e&&"string"==typeof r||(e=mo(e),r=mo(r)),t(e,r)}}function $i(e,r,n,i,o,u,c,h,l,f){var p=8&r;r|=p?s:a,4&(r&=~(p?a:s))||(r&=-4);var g=[e,r,o,p?u:t,p?c:t,p?t:u,p?t:c,h,l,f],d=n.apply(t,g);return Es(e)&&Rs(d,g),d.placeholder=i,Os(d,e,r)}function Ji(t){var e=Dt[t];return function(t,r){if(t=mo(t),(r=null==r?0:wr(go(r),292))&&dr(t)){var n=(wo(t)+"e").split("e");return+((n=(wo(e(n[0]+"e"+(+n[1]+r)))+"e").split("e"))[0]+"e"+(+n[1]-r))}return e(t)}}var Yi=Cr&&1/ur(new Cr([,-0]))[1]==c?function(t){return new Cr(t)}:cu;function Xi(t){return function(e){var r=ds(e);return r==S?sr(e):r==D?cr(e):function(t,e){return Ne(e,function(e){return[e,t[e]]})}(e,t(e))}}function Zi(r,c,h,l,f,p,g,d){var v=2&c;if(!v&&"function"!=typeof r)throw new Rt(e);var m=l?l.length:0;if(m||(c&=-97,l=f=t),g=g===t?g:yr(go(g),0),d=d===t?d:go(d),m-=f?f.length:0,c&a){var y=l,w=f;l=f=t}var x=v?t:as(r),S=[r,c,h,l,f,y,w,p,g,d];if(x&&function(t,e){var r=t[1],i=e[1],s=r|i,a=s<131,c=i==o&&8==r||i==o&&r==u&&t[7].length<=e[8]||384==i&&e[7].length<=e[8]&&8==r;if(!a&&!c)return t;1&i&&(t[2]=e[2],s|=1&r?0:4);var h=e[3];if(h){var l=t[3];t[3]=l?Ii(l,h,e[4]):h,t[4]=l?or(t[3],n):e[4]}(h=e[5])&&(l=t[5],t[5]=l?Pi(l,h,e[6]):h,t[6]=l?or(t[5],n):e[6]),(h=e[7])&&(t[7]=h),i&o&&(t[8]=null==t[8]?e[8]:wr(t[8],e[8])),null==t[9]&&(t[9]=e[9]),t[0]=e[0],t[1]=s}(S,x),r=S[0],c=S[1],h=S[2],l=S[3],f=S[4],!(d=S[9]=S[9]===t?v?0:r.length:yr(S[9]-m,0))&&24&c&&(c&=-25),c&&1!=c)E=8==c||c==i?function(e,r,n){var i=ki(e);return function s(){for(var a=arguments.length,o=Et(a),u=a,c=us(s);u--;)o[u]=arguments[u];var h=a<3&&o[0]!==c&&o[a-1]!==c?[]:or(o,c);return(a-=h.length)<n?$i(e,r,qi,s.placeholder,t,o,h,t,t,n-a):Fe(this&&this!==fe&&this instanceof s?i:e,this,o)}}(r,c,d):c!=s&&33!=c||f.length?qi.apply(t,S):function(t,e,r,n){var i=1&e,s=ki(t);return function e(){for(var a=-1,o=arguments.length,u=-1,c=n.length,h=Et(c+o),l=this&&this!==fe&&this instanceof e?s:t;++u<c;)h[u]=n[u];for(;o--;)h[u++]=arguments[++a];return Fe(l,i?r:this,h)}}(r,c,h,l);else var E=function(t,e,r){var n=1&e,i=ki(t);return function e(){return(this&&this!==fe&&this instanceof e?i:t).apply(n?r:this,arguments)}}(r,c,h);return Os((x?ei:Rs)(E,S),r,c)}function Qi(e,r,n,i){return e===t||Va(e,Ot[n])&&!jt.call(i,n)?r:e}function ts(e,r,n,i,s,a){return to(e)&&to(r)&&(a.set(r,e),Kn(e,r,t,ts,a),a.delete(r)),e}function es(e){return io(e)?t:e}function rs(e,r,n,i,s,a){var o=1&n,u=e.length,c=r.length;if(u!=c&&!(o&&c>u))return!1;var h=a.get(e),l=a.get(r);if(h&&l)return h==r&&l==e;var f=-1,p=!0,g=2&n?new $r:t;for(a.set(e,r),a.set(r,e);++f<u;){var d=e[f],v=r[f];if(i)var m=o?i(v,d,f,r,e,a):i(d,v,f,e,r,a);if(m!==t){if(m)continue;p=!1;break}if(g){if(!je(r,function(t,e){if(!Ze(g,e)&&(d===t||s(d,t,n,i,a)))return g.push(e)})){p=!1;break}}else if(d!==v&&!s(d,v,n,i,a)){p=!1;break}}return a.delete(e),a.delete(r),p}function ns(e){return Ns(Cs(e,t,zs),e+"")}function is(t){return An(t,No,ps)}function ss(t){return An(t,Oo,gs)}var as=Rr?function(t){return Rr.get(t)}:cu;function os(t){for(var e=t.name+"",r=Tr[e],n=jt.call(Tr,e)?r.length:0;n--;){var i=r[n],s=i.func;if(null==s||s==t)return i.name}return e}function us(t){return(jt.call(Vr,"placeholder")?Vr:t).placeholder}function cs(){var t=Vr.iteratee||su;return t=t===su?jn:t,arguments.length?t(arguments[0],arguments[1]):t}function hs(t,e){var r,n,i=t.__data__;return("string"==(n=typeof(r=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?i["string"==typeof e?"string":"hash"]:i.map}function ls(t){for(var e=No(t),r=e.length;r--;){var n=e[r],i=t[n];e[r]=[n,i,As(i)]}return e}function fs(e,r){var n=function(e,r){return null==e?t:e[r]}(e,r);return _n(n)?n:t}var ps=He?function(t){return null==t?[]:(t=Ct(t),Pe(He(t),function(e){return Jt.call(t,e)}))}:vu,gs=He?function(t){for(var e=[];t;)Oe(e,ps(t)),t=Gt(t);return e}:vu,ds=Dn;function vs(t,e,r){for(var n=-1,i=(e=xi(e,t)).length,s=!1;++n<i;){var a=Hs(e[n]);if(!(s=null!=t&&r(t,a)))break;t=t[a]}return s||++n!=i?s:!!(i=null==t?0:t.length)&&Qa(i)&&ws(a,i)&&(Ua(t)||Ka(t))}function ms(t){return"function"!=typeof t.constructor||Fs(t)?{}:qr(Gt(t))}function ys(t){return Ua(t)||Ka(t)||!!(Qt&&t&&t[Qt])}function ws(t,e){var r=typeof t;return!!(e=null==e?h:e)&&("number"==r||"symbol"!=r&&mt.test(t))&&t>-1&&t%1==0&&t<e}function xs(t,e,r){if(!to(r))return!1;var n=typeof e;return!!("number"==n?Wa(r)&&ws(e,r.length):"string"==n&&e in r)&&Va(r[e],t)}function Ss(t,e){if(Ua(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!uo(t))||Z.test(t)||!X.test(t)||null!=e&&t in Ct(e)}function Es(t){var e=os(t),r=Vr[e];if("function"!=typeof r||!(e in Ur.prototype))return!1;if(t===r)return!0;var n=as(r);return!!n&&t===n[0]}(Fr&&ds(new Fr(new ArrayBuffer(1)))!=T||Ar&&ds(new Ar)!=S||Dr&&ds(Dr.resolve())!=F||Cr&&ds(new Cr)!=D||Ir&&ds(new Ir)!=P)&&(ds=function(e){var r=Dn(e),n=r==b?e.constructor:t,i=n?ks(n):"";if(i)switch(i){case Nr:return T;case Or:return S;case Br:return F;case _r:return D;case jr:return P}return r});var bs=Bt?Xa:mu;function Fs(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Ot)}function As(t){return t==t&&!to(t)}function Ds(e,r){return function(n){return null!=n&&n[e]===r&&(r!==t||e in Ct(n))}}function Cs(e,r,n){return r=yr(r===t?e.length-1:r,0),function(){for(var t=arguments,i=-1,s=yr(t.length-r,0),a=Et(s);++i<s;)a[i]=t[r+i];i=-1;for(var o=Et(r+1);++i<r;)o[i]=t[i];return o[r]=n(a),Fe(e,this,o)}}function Is(t,e){return e.length<2?t:Fn(t,ii(e,0,-1))}function Ps(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}var Rs=Bs(ei),Ts=ge||function(t,e){return fe.setTimeout(t,e)},Ns=Bs(ri);function Os(t,e,r){var n=e+"";return Ns(t,function(t,e){var r=e.length;if(!r)return t;var n=r-1;return e[n]=(r>1?"& ":"")+e[n],e=e.join(r>2?", ":" "),t.replace(st,"{\n/* [wrapped with "+e+"] */\n")}(n,function(t,e){return De(p,function(r){var n="_."+r[0];e&r[1]&&!Re(t,n)&&t.push(n)}),t.sort()}(function(t){var e=t.match(at);return e?e[1].split(ot):[]}(n),r)))}function Bs(e){var r=0,n=0;return function(){var i=xr(),s=16-(i-n);if(n=i,s>0){if(++r>=800)return arguments[0]}else r=0;return e.apply(t,arguments)}}function _s(e,r){var n=-1,i=e.length,s=i-1;for(r=r===t?i:r;++n<r;){var a=Jn(n,s),o=e[a];e[a]=e[n],e[n]=o}return e.length=r,e}var js=function(t){var e=Ba(t,function(t){return 500===r.size&&r.clear(),t}),r=e.cache;return e}(function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(Q,function(t,r,n,i){e.push(n?i.replace(ht,"$1"):r||t)}),e});function Hs(t){if("string"==typeof t||uo(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function ks(t){if(null!=t){try{return _t.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function Ls(t){if(t instanceof Ur)return t.clone();var e=new Kr(t.__wrapped__,t.__chain__);return e.__actions__=Ri(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}var Vs=Xn(function(t,e){return Ga(t)?fn(t,yn(e,1,Ga,!0)):[]}),qs=Xn(function(e,r){var n=Ys(r);return Ga(n)&&(n=t),Ga(e)?fn(e,yn(r,1,Ga,!0),cs(n,2)):[]}),Ms=Xn(function(e,r){var n=Ys(r);return Ga(n)&&(n=t),Ga(e)?fn(e,yn(r,1,Ga,!0),t,n):[]});function Ks(t,e,r){var n=null==t?0:t.length;if(!n)return-1;var i=null==r?0:go(r);return i<0&&(i=yr(n+i,0)),Le(t,cs(e,3),i)}function Us(e,r,n){var i=null==e?0:e.length;if(!i)return-1;var s=i-1;return n!==t&&(s=go(n),s=n<0?yr(i+s,0):wr(s,i-1)),Le(e,cs(r,3),s,!0)}function zs(t){return null!=t&&t.length?yn(t,1):[]}function Ws(e){return e&&e.length?e[0]:t}var Gs=Xn(function(t){var e=Ne(t,yi);return e.length&&e[0]===t[0]?Rn(e):[]}),$s=Xn(function(e){var r=Ys(e),n=Ne(e,yi);return r===Ys(n)?r=t:n.pop(),n.length&&n[0]===e[0]?Rn(n,cs(r,2)):[]}),Js=Xn(function(e){var r=Ys(e),n=Ne(e,yi);return(r="function"==typeof r?r:t)&&n.pop(),n.length&&n[0]===e[0]?Rn(n,t,r):[]});function Ys(e){var r=null==e?0:e.length;return r?e[r-1]:t}var Xs=Xn(Zs);function Zs(t,e){return t&&t.length&&e&&e.length?Gn(t,e):t}var Qs=ns(function(t,e){var r=null==t?0:t.length,n=on(t,e);return $n(t,Ne(e,function(t){return ws(t,r)?+t:t}).sort(Ci)),n});function ta(t){return null==t?t:br.call(t)}var ea=Xn(function(t){return li(yn(t,1,Ga,!0))}),ra=Xn(function(e){var r=Ys(e);return Ga(r)&&(r=t),li(yn(e,1,Ga,!0),cs(r,2))}),na=Xn(function(e){var r=Ys(e);return r="function"==typeof r?r:t,li(yn(e,1,Ga,!0),t,r)});function ia(t){if(!t||!t.length)return[];var e=0;return t=Pe(t,function(t){if(Ga(t))return e=yr(t.length,e),!0}),$e(e,function(e){return Ne(t,Ue(e))})}function sa(e,r){if(!e||!e.length)return[];var n=ia(e);return null==r?n:Ne(n,function(e){return Fe(r,t,e)})}var aa=Xn(function(t,e){return Ga(t)?fn(t,e):[]}),oa=Xn(function(t){return vi(Pe(t,Ga))}),ua=Xn(function(e){var r=Ys(e);return Ga(r)&&(r=t),vi(Pe(e,Ga),cs(r,2))}),ca=Xn(function(e){var r=Ys(e);return r="function"==typeof r?r:t,vi(Pe(e,Ga),t,r)}),ha=Xn(ia),la=Xn(function(e){var r=e.length,n=r>1?e[r-1]:t;return n="function"==typeof n?(e.pop(),n):t,sa(e,n)});function fa(t){var e=Vr(t);return e.__chain__=!0,e}function pa(t,e){return e(t)}var ga=ns(function(e){var r=e.length,n=r?e[0]:0,i=this.__wrapped__,s=function(t){return on(t,e)};return!(r>1||this.__actions__.length)&&i instanceof Ur&&ws(n)?((i=i.slice(n,+n+(r?1:0))).__actions__.push({func:pa,args:[s],thisArg:t}),new Kr(i,this.__chain__).thru(function(e){return r&&!e.length&&e.push(t),e})):this.thru(s)}),da=Ni(function(t,e,r){jt.call(t,r)?++t[r]:an(t,r,1)}),va=Li(Ks),ma=Li(Us);function ya(t,e){return(Ua(t)?De:pn)(t,cs(e,3))}function wa(t,e){return(Ua(t)?Ce:gn)(t,cs(e,3))}var xa=Ni(function(t,e,r){jt.call(t,r)?t[r].push(e):an(t,r,[e])}),Sa=Xn(function(t,e,r){var n=-1,i="function"==typeof e,s=Wa(t)?Et(t.length):[];return pn(t,function(t){s[++n]=i?Fe(e,t,r):Tn(t,e,r)}),s}),Ea=Ni(function(t,e,r){an(t,r,e)});function ba(t,e){return(Ua(t)?Ne:Vn)(t,cs(e,3))}var Fa=Ni(function(t,e,r){t[r?0:1].push(e)},function(){return[[],[]]}),Aa=Xn(function(t,e){if(null==t)return[];var r=e.length;return r>1&&xs(t,e[0],e[1])?e=[]:r>2&&xs(e[0],e[1],e[2])&&(e=[e[0]]),zn(t,yn(e,1),[])}),Da=pe||function(){return fe.Date.now()};function Ca(e,r,n){return r=n?t:r,r=e&&null==r?e.length:r,Zi(e,o,t,t,t,t,r)}function Ia(r,n){var i;if("function"!=typeof n)throw new Rt(e);return r=go(r),function(){return--r>0&&(i=n.apply(this,arguments)),r<=1&&(n=t),i}}var Pa=Xn(function(t,e,r){var n=1;if(r.length){var i=or(r,us(Pa));n|=s}return Zi(t,n,e,r,i)}),Ra=Xn(function(t,e,r){var n=3;if(r.length){var i=or(r,us(Ra));n|=s}return Zi(e,n,t,r,i)});function Ta(r,n,i){var s,a,o,u,c,h,l=0,f=!1,p=!1,g=!0;if("function"!=typeof r)throw new Rt(e);function d(e){var n=s,i=a;return s=a=t,l=e,u=r.apply(i,n)}function v(e){var r=e-h;return h===t||r>=n||r<0||p&&e-l>=o}function m(){var t=Da();if(v(t))return y(t);c=Ts(m,function(t){var e=n-(t-h);return p?wr(e,o-(t-l)):e}(t))}function y(e){return c=t,g&&s?d(e):(s=a=t,u)}function w(){var e=Da(),r=v(e);if(s=arguments,a=this,h=e,r){if(c===t)return function(t){return l=t,c=Ts(m,n),f?d(t):u}(h);if(p)return bi(c),c=Ts(m,n),d(h)}return c===t&&(c=Ts(m,n)),u}return n=mo(n)||0,to(i)&&(f=!!i.leading,o=(p="maxWait"in i)?yr(mo(i.maxWait)||0,n):o,g="trailing"in i?!!i.trailing:g),w.cancel=function(){c!==t&&bi(c),l=0,s=h=a=c=t},w.flush=function(){return c===t?u:y(Da())},w}var Na=Xn(function(t,e){return ln(t,1,e)}),Oa=Xn(function(t,e,r){return ln(t,mo(e)||0,r)});function Ba(t,r){if("function"!=typeof t||null!=r&&"function"!=typeof r)throw new Rt(e);var n=function(){var e=arguments,i=r?r.apply(this,e):e[0],s=n.cache;if(s.has(i))return s.get(i);var a=t.apply(this,e);return n.cache=s.set(i,a)||s,a};return n.cache=new(Ba.Cache||Gr),n}function _a(t){if("function"!=typeof t)throw new Rt(e);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}Ba.Cache=Gr;var ja=Si(function(t,e){var r=(e=1==e.length&&Ua(e[0])?Ne(e[0],Ye(cs())):Ne(yn(e,1),Ye(cs()))).length;return Xn(function(n){for(var i=-1,s=wr(n.length,r);++i<s;)n[i]=e[i].call(this,n[i]);return Fe(t,this,n)})}),Ha=Xn(function(e,r){var n=or(r,us(Ha));return Zi(e,s,t,r,n)}),ka=Xn(function(e,r){var n=or(r,us(ka));return Zi(e,a,t,r,n)}),La=ns(function(e,r){return Zi(e,u,t,t,t,r)});function Va(t,e){return t===e||t!=t&&e!=e}var qa=Gi(Cn),Ma=Gi(function(t,e){return t>=e}),Ka=Nn(function(){return arguments}())?Nn:function(t){return eo(t)&&jt.call(t,"callee")&&!Jt.call(t,"callee")},Ua=Et.isArray,za=ye?Ye(ye):function(t){return eo(t)&&Dn(t)==R};function Wa(t){return null!=t&&Qa(t.length)&&!Xa(t)}function Ga(t){return eo(t)&&Wa(t)}var $a=ze||mu,Ja=we?Ye(we):function(t){return eo(t)&&Dn(t)==m};function Ya(t){if(!eo(t))return!1;var e=Dn(t);return e==y||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!io(t)}function Xa(t){if(!to(t))return!1;var e=Dn(t);return e==w||e==x||"[object AsyncFunction]"==e||"[object Proxy]"==e}function Za(t){return"number"==typeof t&&t==go(t)}function Qa(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=h}function to(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function eo(t){return null!=t&&"object"==typeof t}var ro=xe?Ye(xe):function(t){return eo(t)&&ds(t)==S};function no(t){return"number"==typeof t||eo(t)&&Dn(t)==E}function io(t){if(!eo(t)||Dn(t)!=b)return!1;var e=Gt(t);if(null===e)return!0;var r=jt.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&_t.call(r)==Vt}var so=Se?Ye(Se):function(t){return eo(t)&&Dn(t)==A},ao=Ee?Ye(Ee):function(t){return eo(t)&&ds(t)==D};function oo(t){return"string"==typeof t||!Ua(t)&&eo(t)&&Dn(t)==C}function uo(t){return"symbol"==typeof t||eo(t)&&Dn(t)==I}var co=be?Ye(be):function(t){return eo(t)&&Qa(t.length)&&!!se[Dn(t)]},ho=Gi(Ln),lo=Gi(function(t,e){return t<=e});function fo(t){if(!t)return[];if(Wa(t))return oo(t)?lr(t):Ri(t);if(ee&&t[ee])return function(t){for(var e,r=[];!(e=t.next()).done;)r.push(e.value);return r}(t[ee]());var e=ds(t);return(e==S?sr:e==D?ur:qo)(t)}function po(t){return t?(t=mo(t))===c||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function go(t){var e=po(t),r=e%1;return e==e?r?e-r:e:0}function vo(t){return t?un(go(t),0,f):0}function mo(t){if("number"==typeof t)return t;if(uo(t))return l;if(to(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=to(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Je(t);var r=gt.test(t);return r||vt.test(t)?ce(t.slice(2),r?2:8):pt.test(t)?l:+t}function yo(t){return Ti(t,Oo(t))}function wo(t){return null==t?"":hi(t)}var xo=Oi(function(t,e){if(Fs(e)||Wa(e))Ti(e,No(e),t);else for(var r in e)jt.call(e,r)&&en(t,r,e[r])}),So=Oi(function(t,e){Ti(e,Oo(e),t)}),Eo=Oi(function(t,e,r,n){Ti(e,Oo(e),t,n)}),bo=Oi(function(t,e,r,n){Ti(e,No(e),t,n)}),Fo=ns(on),Ao=Xn(function(e,r){e=Ct(e);var n=-1,i=r.length,s=i>2?r[2]:t;for(s&&xs(r[0],r[1],s)&&(i=1);++n<i;)for(var a=r[n],o=Oo(a),u=-1,c=o.length;++u<c;){var h=o[u],l=e[h];(l===t||Va(l,Ot[h])&&!jt.call(e,h))&&(e[h]=a[h])}return e}),Do=Xn(function(e){return e.push(t,ts),Fe(_o,t,e)});function Co(e,r,n){var i=null==e?t:Fn(e,r);return i===t?n:i}function Io(t,e){return null!=t&&vs(t,e,Pn)}var Po=Mi(function(t,e,r){null!=e&&"function"!=typeof e.toString&&(e=Lt.call(e)),t[e]=r},eu(iu)),Ro=Mi(function(t,e,r){null!=e&&"function"!=typeof e.toString&&(e=Lt.call(e)),jt.call(t,e)?t[e].push(r):t[e]=[r]},cs),To=Xn(Tn);function No(t){return Wa(t)?Yr(t):Hn(t)}function Oo(t){return Wa(t)?Yr(t,!0):kn(t)}var Bo=Oi(function(t,e,r){Kn(t,e,r)}),_o=Oi(function(t,e,r,n){Kn(t,e,r,n)}),jo=ns(function(t,e){var r={};if(null==t)return r;var n=!1;e=Ne(e,function(e){return e=xi(e,t),n||(n=e.length>1),e}),Ti(t,ss(t),r),n&&(r=cn(r,7,es));for(var i=e.length;i--;)fi(r,e[i]);return r}),Ho=ns(function(t,e){return null==t?{}:function(t,e){return Wn(t,e,function(e,r){return Io(t,r)})}(t,e)});function ko(t,e){if(null==t)return{};var r=Ne(ss(t),function(t){return[t]});return e=cs(e),Wn(t,r,function(t,r){return e(t,r[0])})}var Lo=Xi(No),Vo=Xi(Oo);function qo(t){return null==t?[]:Xe(t,No(t))}var Mo=Hi(function(t,e,r){return e=e.toLowerCase(),t+(r?Ko(e):e)});function Ko(t){return Xo(wo(t).toLowerCase())}function Uo(t){return(t=wo(t))&&t.replace(yt,er).replace(Zt,"")}var zo=Hi(function(t,e,r){return t+(r?"-":"")+e.toLowerCase()}),Wo=Hi(function(t,e,r){return t+(r?" ":"")+e.toLowerCase()}),Go=ji("toLowerCase"),$o=Hi(function(t,e,r){return t+(r?"_":"")+e.toLowerCase()}),Jo=Hi(function(t,e,r){return t+(r?" ":"")+Xo(e)}),Yo=Hi(function(t,e,r){return t+(r?" ":"")+e.toUpperCase()}),Xo=ji("toUpperCase");function Zo(e,r,n){return e=wo(e),(r=n?t:r)===t?function(t){return re.test(t)}(e)?function(t){return t.match(te)||[]}(e):function(t){return t.match(ut)||[]}(e):e.match(r)||[]}var Qo=Xn(function(e,r){try{return Fe(e,t,r)}catch(t){return Ya(t)?t:new Ft(t)}}),tu=ns(function(t,e){return De(e,function(e){e=Hs(e),an(t,e,Pa(t[e],t))}),t});function eu(t){return function(){return t}}var ru=Vi(),nu=Vi(!0);function iu(t){return t}function su(t){return jn("function"==typeof t?t:cn(t,1))}var au=Xn(function(t,e){return function(r){return Tn(r,t,e)}}),ou=Xn(function(t,e){return function(r){return Tn(t,r,e)}});function uu(t,e,r){var n=No(e),i=bn(e,n);null!=r||to(e)&&(i.length||!n.length)||(r=e,e=t,t=this,i=bn(e,No(e)));var s=!(to(r)&&"chain"in r&&!r.chain),a=Xa(t);return De(i,function(r){var n=e[r];t[r]=n,a&&(t.prototype[r]=function(){var e=this.__chain__;if(s||e){var r=t(this.__wrapped__);return(r.__actions__=Ri(this.__actions__)).push({func:n,args:arguments,thisArg:t}),r.__chain__=e,r}return n.apply(t,Oe([this.value()],arguments))})}),t}function cu(){}var hu=Ui(Ne),lu=Ui(Ie),fu=Ui(je);function pu(t){return Ss(t)?Ue(Hs(t)):function(t){return function(e){return Fn(e,t)}}(t)}var gu=Wi(),du=Wi(!0);function vu(){return[]}function mu(){return!1}var yu,wu=Ki(function(t,e){return t+e},0),xu=Ji("ceil"),Su=Ki(function(t,e){return t/e},1),Eu=Ji("floor"),bu=Ki(function(t,e){return t*e},1),Fu=Ji("round"),Au=Ki(function(t,e){return t-e},0);return Vr.after=function(t,r){if("function"!=typeof r)throw new Rt(e);return t=go(t),function(){if(--t<1)return r.apply(this,arguments)}},Vr.ary=Ca,Vr.assign=xo,Vr.assignIn=So,Vr.assignInWith=Eo,Vr.assignWith=bo,Vr.at=Fo,Vr.before=Ia,Vr.bind=Pa,Vr.bindAll=tu,Vr.bindKey=Ra,Vr.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return Ua(t)?t:[t]},Vr.chain=fa,Vr.chunk=function(e,r,n){r=(n?xs(e,r,n):r===t)?1:yr(go(r),0);var i=null==e?0:e.length;if(!i||r<1)return[];for(var s=0,a=0,o=Et(ve(i/r));s<i;)o[a++]=ii(e,s,s+=r);return o},Vr.compact=function(t){for(var e=-1,r=null==t?0:t.length,n=0,i=[];++e<r;){var s=t[e];s&&(i[n++]=s)}return i},Vr.concat=function(){var t=arguments.length;if(!t)return[];for(var e=Et(t-1),r=arguments[0],n=t;n--;)e[n-1]=arguments[n];return Oe(Ua(r)?Ri(r):[r],yn(e,1))},Vr.cond=function(t){var r=null==t?0:t.length,n=cs();return t=r?Ne(t,function(t){if("function"!=typeof t[1])throw new Rt(e);return[n(t[0]),t[1]]}):[],Xn(function(e){for(var n=-1;++n<r;){var i=t[n];if(Fe(i[0],this,e))return Fe(i[1],this,e)}})},Vr.conforms=function(t){return function(t){var e=No(t);return function(r){return hn(r,t,e)}}(cn(t,1))},Vr.constant=eu,Vr.countBy=da,Vr.create=function(t,e){var r=qr(t);return null==e?r:sn(r,e)},Vr.curry=function e(r,n,i){var s=Zi(r,8,t,t,t,t,t,n=i?t:n);return s.placeholder=e.placeholder,s},Vr.curryRight=function e(r,n,s){var a=Zi(r,i,t,t,t,t,t,n=s?t:n);return a.placeholder=e.placeholder,a},Vr.debounce=Ta,Vr.defaults=Ao,Vr.defaultsDeep=Do,Vr.defer=Na,Vr.delay=Oa,Vr.difference=Vs,Vr.differenceBy=qs,Vr.differenceWith=Ms,Vr.drop=function(e,r,n){var i=null==e?0:e.length;return i?ii(e,(r=n||r===t?1:go(r))<0?0:r,i):[]},Vr.dropRight=function(e,r,n){var i=null==e?0:e.length;return i?ii(e,0,(r=i-(r=n||r===t?1:go(r)))<0?0:r):[]},Vr.dropRightWhile=function(t,e){return t&&t.length?gi(t,cs(e,3),!0,!0):[]},Vr.dropWhile=function(t,e){return t&&t.length?gi(t,cs(e,3),!0):[]},Vr.fill=function(e,r,n,i){var s=null==e?0:e.length;return s?(n&&"number"!=typeof n&&xs(e,r,n)&&(n=0,i=s),function(e,r,n,i){var s=e.length;for((n=go(n))<0&&(n=-n>s?0:s+n),(i=i===t||i>s?s:go(i))<0&&(i+=s),i=n>i?0:vo(i);n<i;)e[n++]=r;return e}(e,r,n,i)):[]},Vr.filter=function(t,e){return(Ua(t)?Pe:mn)(t,cs(e,3))},Vr.flatMap=function(t,e){return yn(ba(t,e),1)},Vr.flatMapDeep=function(t,e){return yn(ba(t,e),c)},Vr.flatMapDepth=function(e,r,n){return n=n===t?1:go(n),yn(ba(e,r),n)},Vr.flatten=zs,Vr.flattenDeep=function(t){return null!=t&&t.length?yn(t,c):[]},Vr.flattenDepth=function(e,r){return null!=e&&e.length?yn(e,r=r===t?1:go(r)):[]},Vr.flip=function(t){return Zi(t,512)},Vr.flow=ru,Vr.flowRight=nu,Vr.fromPairs=function(t){for(var e=-1,r=null==t?0:t.length,n={};++e<r;){var i=t[e];n[i[0]]=i[1]}return n},Vr.functions=function(t){return null==t?[]:bn(t,No(t))},Vr.functionsIn=function(t){return null==t?[]:bn(t,Oo(t))},Vr.groupBy=xa,Vr.initial=function(t){return null!=t&&t.length?ii(t,0,-1):[]},Vr.intersection=Gs,Vr.intersectionBy=$s,Vr.intersectionWith=Js,Vr.invert=Po,Vr.invertBy=Ro,Vr.invokeMap=Sa,Vr.iteratee=su,Vr.keyBy=Ea,Vr.keys=No,Vr.keysIn=Oo,Vr.map=ba,Vr.mapKeys=function(t,e){var r={};return e=cs(e,3),Sn(t,function(t,n,i){an(r,e(t,n,i),t)}),r},Vr.mapValues=function(t,e){var r={};return e=cs(e,3),Sn(t,function(t,n,i){an(r,n,e(t,n,i))}),r},Vr.matches=function(t){return qn(cn(t,1))},Vr.matchesProperty=function(t,e){return Mn(t,cn(e,1))},Vr.memoize=Ba,Vr.merge=Bo,Vr.mergeWith=_o,Vr.method=au,Vr.methodOf=ou,Vr.mixin=uu,Vr.negate=_a,Vr.nthArg=function(t){return t=go(t),Xn(function(e){return Un(e,t)})},Vr.omit=jo,Vr.omitBy=function(t,e){return ko(t,_a(cs(e)))},Vr.once=function(t){return Ia(2,t)},Vr.orderBy=function(e,r,n,i){return null==e?[]:(Ua(r)||(r=null==r?[]:[r]),Ua(n=i?t:n)||(n=null==n?[]:[n]),zn(e,r,n))},Vr.over=hu,Vr.overArgs=ja,Vr.overEvery=lu,Vr.overSome=fu,Vr.partial=Ha,Vr.partialRight=ka,Vr.partition=Fa,Vr.pick=Ho,Vr.pickBy=ko,Vr.property=pu,Vr.propertyOf=function(e){return function(r){return null==e?t:Fn(e,r)}},Vr.pull=Xs,Vr.pullAll=Zs,Vr.pullAllBy=function(t,e,r){return t&&t.length&&e&&e.length?Gn(t,e,cs(r,2)):t},Vr.pullAllWith=function(e,r,n){return e&&e.length&&r&&r.length?Gn(e,r,t,n):e},Vr.pullAt=Qs,Vr.range=gu,Vr.rangeRight=du,Vr.rearg=La,Vr.reject=function(t,e){return(Ua(t)?Pe:mn)(t,_a(cs(e,3)))},Vr.remove=function(t,e){var r=[];if(!t||!t.length)return r;var n=-1,i=[],s=t.length;for(e=cs(e,3);++n<s;){var a=t[n];e(a,n,t)&&(r.push(a),i.push(n))}return $n(t,i),r},Vr.rest=function(r,n){if("function"!=typeof r)throw new Rt(e);return Xn(r,n=n===t?n:go(n))},Vr.reverse=ta,Vr.sampleSize=function(e,r,n){return r=(n?xs(e,r,n):r===t)?1:go(r),(Ua(e)?Zr:Qn)(e,r)},Vr.set=function(t,e,r){return null==t?t:ti(t,e,r)},Vr.setWith=function(e,r,n,i){return i="function"==typeof i?i:t,null==e?e:ti(e,r,n,i)},Vr.shuffle=function(t){return(Ua(t)?Qr:ni)(t)},Vr.slice=function(e,r,n){var i=null==e?0:e.length;return i?(n&&"number"!=typeof n&&xs(e,r,n)?(r=0,n=i):(r=null==r?0:go(r),n=n===t?i:go(n)),ii(e,r,n)):[]},Vr.sortBy=Aa,Vr.sortedUniq=function(t){return t&&t.length?ui(t):[]},Vr.sortedUniqBy=function(t,e){return t&&t.length?ui(t,cs(e,2)):[]},Vr.split=function(e,r,n){return n&&"number"!=typeof n&&xs(e,r,n)&&(r=n=t),(n=n===t?f:n>>>0)?(e=wo(e))&&("string"==typeof r||null!=r&&!so(r))&&!(r=hi(r))&&ir(e)?Ei(lr(e),0,n):e.split(r,n):[]},Vr.spread=function(t,r){if("function"!=typeof t)throw new Rt(e);return r=null==r?0:yr(go(r),0),Xn(function(e){var n=e[r],i=Ei(e,0,r);return n&&Oe(i,n),Fe(t,this,i)})},Vr.tail=function(t){var e=null==t?0:t.length;return e?ii(t,1,e):[]},Vr.take=function(e,r,n){return e&&e.length?ii(e,0,(r=n||r===t?1:go(r))<0?0:r):[]},Vr.takeRight=function(e,r,n){var i=null==e?0:e.length;return i?ii(e,(r=i-(r=n||r===t?1:go(r)))<0?0:r,i):[]},Vr.takeRightWhile=function(t,e){return t&&t.length?gi(t,cs(e,3),!1,!0):[]},Vr.takeWhile=function(t,e){return t&&t.length?gi(t,cs(e,3)):[]},Vr.tap=function(t,e){return e(t),t},Vr.throttle=function(t,r,n){var i=!0,s=!0;if("function"!=typeof t)throw new Rt(e);return to(n)&&(i="leading"in n?!!n.leading:i,s="trailing"in n?!!n.trailing:s),Ta(t,r,{leading:i,maxWait:r,trailing:s})},Vr.thru=pa,Vr.toArray=fo,Vr.toPairs=Lo,Vr.toPairsIn=Vo,Vr.toPath=function(t){return Ua(t)?Ne(t,Hs):uo(t)?[t]:Ri(js(wo(t)))},Vr.toPlainObject=yo,Vr.transform=function(t,e,r){var n=Ua(t),i=n||$a(t)||co(t);if(e=cs(e,4),null==r){var s=t&&t.constructor;r=i?n?new s:[]:to(t)&&Xa(s)?qr(Gt(t)):{}}return(i?De:Sn)(t,function(t,n,i){return e(r,t,n,i)}),r},Vr.unary=function(t){return Ca(t,1)},Vr.union=ea,Vr.unionBy=ra,Vr.unionWith=na,Vr.uniq=function(t){return t&&t.length?li(t):[]},Vr.uniqBy=function(t,e){return t&&t.length?li(t,cs(e,2)):[]},Vr.uniqWith=function(e,r){return r="function"==typeof r?r:t,e&&e.length?li(e,t,r):[]},Vr.unset=function(t,e){return null==t||fi(t,e)},Vr.unzip=ia,Vr.unzipWith=sa,Vr.update=function(t,e,r){return null==t?t:pi(t,e,wi(r))},Vr.updateWith=function(e,r,n,i){return i="function"==typeof i?i:t,null==e?e:pi(e,r,wi(n),i)},Vr.values=qo,Vr.valuesIn=function(t){return null==t?[]:Xe(t,Oo(t))},Vr.without=aa,Vr.words=Zo,Vr.wrap=function(t,e){return Ha(wi(e),t)},Vr.xor=oa,Vr.xorBy=ua,Vr.xorWith=ca,Vr.zip=ha,Vr.zipObject=function(t,e){return mi(t||[],e||[],en)},Vr.zipObjectDeep=function(t,e){return mi(t||[],e||[],ti)},Vr.zipWith=la,Vr.entries=Lo,Vr.entriesIn=Vo,Vr.extend=So,Vr.extendWith=Eo,uu(Vr,Vr),Vr.add=wu,Vr.attempt=Qo,Vr.camelCase=Mo,Vr.capitalize=Ko,Vr.ceil=xu,Vr.clamp=function(e,r,n){return n===t&&(n=r,r=t),n!==t&&(n=(n=mo(n))==n?n:0),r!==t&&(r=(r=mo(r))==r?r:0),un(mo(e),r,n)},Vr.clone=function(t){return cn(t,4)},Vr.cloneDeep=function(t){return cn(t,5)},Vr.cloneDeepWith=function(e,r){return cn(e,5,r="function"==typeof r?r:t)},Vr.cloneWith=function(e,r){return cn(e,4,r="function"==typeof r?r:t)},Vr.conformsTo=function(t,e){return null==e||hn(t,e,No(e))},Vr.deburr=Uo,Vr.defaultTo=function(t,e){return null==t||t!=t?e:t},Vr.divide=Su,Vr.endsWith=function(e,r,n){e=wo(e),r=hi(r);var i=e.length,s=n=n===t?i:un(go(n),0,i);return(n-=r.length)>=0&&e.slice(n,s)==r},Vr.eq=Va,Vr.escape=function(t){return(t=wo(t))&&G.test(t)?t.replace(z,rr):t},Vr.escapeRegExp=function(t){return(t=wo(t))&&et.test(t)?t.replace(tt,"\\$&"):t},Vr.every=function(e,r,n){var i=Ua(e)?Ie:dn;return n&&xs(e,r,n)&&(r=t),i(e,cs(r,3))},Vr.find=va,Vr.findIndex=Ks,Vr.findKey=function(t,e){return ke(t,cs(e,3),Sn)},Vr.findLast=ma,Vr.findLastIndex=Us,Vr.findLastKey=function(t,e){return ke(t,cs(e,3),En)},Vr.floor=Eu,Vr.forEach=ya,Vr.forEachRight=wa,Vr.forIn=function(t,e){return null==t?t:wn(t,cs(e,3),Oo)},Vr.forInRight=function(t,e){return null==t?t:xn(t,cs(e,3),Oo)},Vr.forOwn=function(t,e){return t&&Sn(t,cs(e,3))},Vr.forOwnRight=function(t,e){return t&&En(t,cs(e,3))},Vr.get=Co,Vr.gt=qa,Vr.gte=Ma,Vr.has=function(t,e){return null!=t&&vs(t,e,In)},Vr.hasIn=Io,Vr.head=Ws,Vr.identity=iu,Vr.includes=function(t,e,r,n){t=Wa(t)?t:qo(t),r=r&&!n?go(r):0;var i=t.length;return r<0&&(r=yr(i+r,0)),oo(t)?r<=i&&t.indexOf(e,r)>-1:!!i&&Ve(t,e,r)>-1},Vr.indexOf=function(t,e,r){var n=null==t?0:t.length;if(!n)return-1;var i=null==r?0:go(r);return i<0&&(i=yr(n+i,0)),Ve(t,e,i)},Vr.inRange=function(e,r,n){return r=po(r),n===t?(n=r,r=0):n=po(n),function(t,e,r){return t>=wr(e,r)&&t<yr(e,r)}(e=mo(e),r,n)},Vr.invoke=To,Vr.isArguments=Ka,Vr.isArray=Ua,Vr.isArrayBuffer=za,Vr.isArrayLike=Wa,Vr.isArrayLikeObject=Ga,Vr.isBoolean=function(t){return!0===t||!1===t||eo(t)&&Dn(t)==v},Vr.isBuffer=$a,Vr.isDate=Ja,Vr.isElement=function(t){return eo(t)&&1===t.nodeType&&!io(t)},Vr.isEmpty=function(t){if(null==t)return!0;if(Wa(t)&&(Ua(t)||"string"==typeof t||"function"==typeof t.splice||$a(t)||co(t)||Ka(t)))return!t.length;var e=ds(t);if(e==S||e==D)return!t.size;if(Fs(t))return!Hn(t).length;for(var r in t)if(jt.call(t,r))return!1;return!0},Vr.isEqual=function(t,e){return On(t,e)},Vr.isEqualWith=function(e,r,n){var i=(n="function"==typeof n?n:t)?n(e,r):t;return i===t?On(e,r,t,n):!!i},Vr.isError=Ya,Vr.isFinite=function(t){return"number"==typeof t&&dr(t)},Vr.isFunction=Xa,Vr.isInteger=Za,Vr.isLength=Qa,Vr.isMap=ro,Vr.isMatch=function(t,e){return t===e||Bn(t,e,ls(e))},Vr.isMatchWith=function(e,r,n){return n="function"==typeof n?n:t,Bn(e,r,ls(r),n)},Vr.isNaN=function(t){return no(t)&&t!=+t},Vr.isNative=function(t){if(bs(t))throw new Ft("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return _n(t)},Vr.isNil=function(t){return null==t},Vr.isNull=function(t){return null===t},Vr.isNumber=no,Vr.isObject=to,Vr.isObjectLike=eo,Vr.isPlainObject=io,Vr.isRegExp=so,Vr.isSafeInteger=function(t){return Za(t)&&t>=-9007199254740991&&t<=h},Vr.isSet=ao,Vr.isString=oo,Vr.isSymbol=uo,Vr.isTypedArray=co,Vr.isUndefined=function(e){return e===t},Vr.isWeakMap=function(t){return eo(t)&&ds(t)==P},Vr.isWeakSet=function(t){return eo(t)&&"[object WeakSet]"==Dn(t)},Vr.join=function(t,e){return null==t?"":vr.call(t,e)},Vr.kebabCase=zo,Vr.last=Ys,Vr.lastIndexOf=function(e,r,n){var i=null==e?0:e.length;if(!i)return-1;var s=i;return n!==t&&(s=(s=go(n))<0?yr(i+s,0):wr(s,i-1)),r==r?function(t,e,r){for(var n=r+1;n--;)if(t[n]===e)return n;return n}(e,r,s):Le(e,Me,s,!0)},Vr.lowerCase=Wo,Vr.lowerFirst=Go,Vr.lt=ho,Vr.lte=lo,Vr.max=function(e){return e&&e.length?vn(e,iu,Cn):t},Vr.maxBy=function(e,r){return e&&e.length?vn(e,cs(r,2),Cn):t},Vr.mean=function(t){return Ke(t,iu)},Vr.meanBy=function(t,e){return Ke(t,cs(e,2))},Vr.min=function(e){return e&&e.length?vn(e,iu,Ln):t},Vr.minBy=function(e,r){return e&&e.length?vn(e,cs(r,2),Ln):t},Vr.stubArray=vu,Vr.stubFalse=mu,Vr.stubObject=function(){return{}},Vr.stubString=function(){return""},Vr.stubTrue=function(){return!0},Vr.multiply=bu,Vr.nth=function(e,r){return e&&e.length?Un(e,go(r)):t},Vr.noConflict=function(){return fe._===this&&(fe._=qt),this},Vr.noop=cu,Vr.now=Da,Vr.pad=function(t,e,r){t=wo(t);var n=(e=go(e))?hr(t):0;if(!e||n>=e)return t;var i=(e-n)/2;return zi(me(i),r)+t+zi(ve(i),r)},Vr.padEnd=function(t,e,r){t=wo(t);var n=(e=go(e))?hr(t):0;return e&&n<e?t+zi(e-n,r):t},Vr.padStart=function(t,e,r){t=wo(t);var n=(e=go(e))?hr(t):0;return e&&n<e?zi(e-n,r)+t:t},Vr.parseInt=function(t,e,r){return r||null==e?e=0:e&&(e=+e),Sr(wo(t).replace(rt,""),e||0)},Vr.random=function(e,r,n){if(n&&"boolean"!=typeof n&&xs(e,r,n)&&(r=n=t),n===t&&("boolean"==typeof r?(n=r,r=t):"boolean"==typeof e&&(n=e,e=t)),e===t&&r===t?(e=0,r=1):(e=po(e),r===t?(r=e,e=0):r=po(r)),e>r){var i=e;e=r,r=i}if(n||e%1||r%1){var s=Er();return wr(e+s*(r-e+ue("1e-"+((s+"").length-1))),r)}return Jn(e,r)},Vr.reduce=function(t,e,r){var n=Ua(t)?Be:We,i=arguments.length<3;return n(t,cs(e,4),r,i,pn)},Vr.reduceRight=function(t,e,r){var n=Ua(t)?_e:We,i=arguments.length<3;return n(t,cs(e,4),r,i,gn)},Vr.repeat=function(e,r,n){return r=(n?xs(e,r,n):r===t)?1:go(r),Yn(wo(e),r)},Vr.replace=function(){var t=arguments,e=wo(t[0]);return t.length<3?e:e.replace(t[1],t[2])},Vr.result=function(e,r,n){var i=-1,s=(r=xi(r,e)).length;for(s||(s=1,e=t);++i<s;){var a=null==e?t:e[Hs(r[i])];a===t&&(i=s,a=n),e=Xa(a)?a.call(e):a}return e},Vr.round=Fu,Vr.runInContext=nt,Vr.sample=function(t){return(Ua(t)?Xr:Zn)(t)},Vr.size=function(t){if(null==t)return 0;if(Wa(t))return oo(t)?hr(t):t.length;var e=ds(t);return e==S||e==D?t.size:Hn(t).length},Vr.snakeCase=$o,Vr.some=function(e,r,n){var i=Ua(e)?je:si;return n&&xs(e,r,n)&&(r=t),i(e,cs(r,3))},Vr.sortedIndex=function(t,e){return ai(t,e)},Vr.sortedIndexBy=function(t,e,r){return oi(t,e,cs(r,2))},Vr.sortedIndexOf=function(t,e){var r=null==t?0:t.length;if(r){var n=ai(t,e);if(n<r&&Va(t[n],e))return n}return-1},Vr.sortedLastIndex=function(t,e){return ai(t,e,!0)},Vr.sortedLastIndexBy=function(t,e,r){return oi(t,e,cs(r,2),!0)},Vr.sortedLastIndexOf=function(t,e){if(null!=t&&t.length){var r=ai(t,e,!0)-1;if(Va(t[r],e))return r}return-1},Vr.startCase=Jo,Vr.startsWith=function(t,e,r){return t=wo(t),r=null==r?0:un(go(r),0,t.length),e=hi(e),t.slice(r,r+e.length)==e},Vr.subtract=Au,Vr.sum=function(t){return t&&t.length?Ge(t,iu):0},Vr.sumBy=function(t,e){return t&&t.length?Ge(t,cs(e,2)):0},Vr.template=function(e,r,n){var i=Vr.templateSettings;n&&xs(e,r,n)&&(r=t),e=wo(e),r=Eo({},r,i,Qi);var s,a,o=Eo({},r.imports,i.imports,Qi),u=No(o),c=Xe(o,u),h=0,l=r.interpolate||wt,f="__p += '",p=It((r.escape||wt).source+"|"+l.source+"|"+(l===Y?lt:wt).source+"|"+(r.evaluate||wt).source+"|$","g"),g="//# sourceURL="+(jt.call(r,"sourceURL")?(r.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++ie+"]")+"\n";e.replace(p,function(t,r,n,i,o,u){return n||(n=i),f+=e.slice(h,u).replace(xt,nr),r&&(s=!0,f+="' +\n__e("+r+") +\n'"),o&&(a=!0,f+="';\n"+o+";\n__p += '"),n&&(f+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),h=u+t.length,t}),f+="';\n";var d=jt.call(r,"variable")&&r.variable;if(d){if(ct.test(d))throw new Ft("Invalid `variable` option passed into `_.template`")}else f="with (obj) {\n"+f+"\n}\n";f=(a?f.replace(q,""):f).replace(M,"$1").replace(K,"$1;"),f="function("+(d||"obj")+") {\n"+(d?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(s?", __e = _.escape":"")+(a?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+f+"return __p\n}";var v=Qo(function(){return At(u,g+"return "+f).apply(t,c)});if(v.source=f,Ya(v))throw v;return v},Vr.times=function(t,e){if((t=go(t))<1||t>h)return[];var r=f,n=wr(t,f);e=cs(e),t-=f;for(var i=$e(n,e);++r<t;)e(r);return i},Vr.toFinite=po,Vr.toInteger=go,Vr.toLength=vo,Vr.toLower=function(t){return wo(t).toLowerCase()},Vr.toNumber=mo,Vr.toSafeInteger=function(t){return t?un(go(t),-9007199254740991,h):0===t?t:0},Vr.toString=wo,Vr.toUpper=function(t){return wo(t).toUpperCase()},Vr.trim=function(e,r,n){if((e=wo(e))&&(n||r===t))return Je(e);if(!e||!(r=hi(r)))return e;var i=lr(e),s=lr(r);return Ei(i,Qe(i,s),tr(i,s)+1).join("")},Vr.trimEnd=function(e,r,n){if((e=wo(e))&&(n||r===t))return e.slice(0,fr(e)+1);if(!e||!(r=hi(r)))return e;var i=lr(e);return Ei(i,0,tr(i,lr(r))+1).join("")},Vr.trimStart=function(e,r,n){if((e=wo(e))&&(n||r===t))return e.replace(rt,"");if(!e||!(r=hi(r)))return e;var i=lr(e);return Ei(i,Qe(i,lr(r))).join("")},Vr.truncate=function(e,r){var n=30,i="...";if(to(r)){var s="separator"in r?r.separator:s;n="length"in r?go(r.length):n,i="omission"in r?hi(r.omission):i}var a=(e=wo(e)).length;if(ir(e)){var o=lr(e);a=o.length}if(n>=a)return e;var u=n-hr(i);if(u<1)return i;var c=o?Ei(o,0,u).join(""):e.slice(0,u);if(s===t)return c+i;if(o&&(u+=c.length-u),so(s)){if(e.slice(u).search(s)){var h,l=c;for(s.global||(s=It(s.source,wo(ft.exec(s))+"g")),s.lastIndex=0;h=s.exec(l);)var f=h.index;c=c.slice(0,f===t?u:f)}}else if(e.indexOf(hi(s),u)!=u){var p=c.lastIndexOf(s);p>-1&&(c=c.slice(0,p))}return c+i},Vr.unescape=function(t){return(t=wo(t))&&W.test(t)?t.replace(U,pr):t},Vr.uniqueId=function(t){var e=++Ht;return wo(t)+e},Vr.upperCase=Yo,Vr.upperFirst=Xo,Vr.each=ya,Vr.eachRight=wa,Vr.first=Ws,uu(Vr,(yu={},Sn(Vr,function(t,e){jt.call(Vr.prototype,e)||(yu[e]=t)}),yu),{chain:!1}),Vr.VERSION="4.17.21",De(["bind","bindKey","curry","curryRight","partial","partialRight"],function(t){Vr[t].placeholder=Vr}),De(["drop","take"],function(e,r){Ur.prototype[e]=function(n){n=n===t?1:yr(go(n),0);var i=this.__filtered__&&!r?new Ur(this):this.clone();return i.__filtered__?i.__takeCount__=wr(n,i.__takeCount__):i.__views__.push({size:wr(n,f),type:e+(i.__dir__<0?"Right":"")}),i},Ur.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),De(["filter","map","takeWhile"],function(t,e){var r=e+1,n=1==r||3==r;Ur.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:cs(t,3),type:r}),e.__filtered__=e.__filtered__||n,e}}),De(["head","last"],function(t,e){var r="take"+(e?"Right":"");Ur.prototype[t]=function(){return this[r](1).value()[0]}}),De(["initial","tail"],function(t,e){var r="drop"+(e?"":"Right");Ur.prototype[t]=function(){return this.__filtered__?new Ur(this):this[r](1)}}),Ur.prototype.compact=function(){return this.filter(iu)},Ur.prototype.find=function(t){return this.filter(t).head()},Ur.prototype.findLast=function(t){return this.reverse().find(t)},Ur.prototype.invokeMap=Xn(function(t,e){return"function"==typeof t?new Ur(this):this.map(function(r){return Tn(r,t,e)})}),Ur.prototype.reject=function(t){return this.filter(_a(cs(t)))},Ur.prototype.slice=function(e,r){e=go(e);var n=this;return n.__filtered__&&(e>0||r<0)?new Ur(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),r!==t&&(n=(r=go(r))<0?n.dropRight(-r):n.take(r-e)),n)},Ur.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Ur.prototype.toArray=function(){return this.take(f)},Sn(Ur.prototype,function(e,r){var n=/^(?:filter|find|map|reject)|While$/.test(r),i=/^(?:head|last)$/.test(r),s=Vr[i?"take"+("last"==r?"Right":""):r],a=i||/^find/.test(r);s&&(Vr.prototype[r]=function(){var r=this.__wrapped__,o=i?[1]:arguments,u=r instanceof Ur,c=o[0],h=u||Ua(r),l=function(t){var e=s.apply(Vr,Oe([t],o));return i&&f?e[0]:e};h&&n&&"function"==typeof c&&1!=c.length&&(u=h=!1);var f=this.__chain__,p=!!this.__actions__.length,g=a&&!f,d=u&&!p;if(!a&&h){r=d?r:new Ur(this);var v=e.apply(r,o);return v.__actions__.push({func:pa,args:[l],thisArg:t}),new Kr(v,f)}return g&&d?e.apply(this,o):(v=this.thru(l),g?i?v.value()[0]:v.value():v)})}),De(["pop","push","shift","sort","splice","unshift"],function(t){var e=Tt[t],r=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",n=/^(?:pop|shift)$/.test(t);Vr.prototype[t]=function(){var t=arguments;if(n&&!this.__chain__){var i=this.value();return e.apply(Ua(i)?i:[],t)}return this[r](function(r){return e.apply(Ua(r)?r:[],t)})}}),Sn(Ur.prototype,function(t,e){var r=Vr[e];if(r){var n=r.name+"";jt.call(Tr,n)||(Tr[n]=[]),Tr[n].push({name:e,func:r})}}),Tr[qi(t,2).name]=[{name:"wrapper",func:t}],Ur.prototype.clone=function(){var t=new Ur(this.__wrapped__);return t.__actions__=Ri(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=Ri(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=Ri(this.__views__),t},Ur.prototype.reverse=function(){if(this.__filtered__){var t=new Ur(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},Ur.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,r=Ua(t),n=e<0,i=r?t.length:0,s=function(t,e,r){for(var n=-1,i=r.length;++n<i;){var s=r[n],a=s.size;switch(s.type){case"drop":t+=a;break;case"dropRight":e-=a;break;case"take":e=wr(e,t+a);break;case"takeRight":t=yr(t,e-a)}}return{start:t,end:e}}(0,i,this.__views__),a=s.start,o=s.end,u=o-a,c=n?o:a-1,h=this.__iteratees__,l=h.length,f=0,p=wr(u,this.__takeCount__);if(!r||!n&&i==u&&p==u)return di(t,this.__actions__);var g=[];t:for(;u--&&f<p;){for(var d=-1,v=t[c+=e];++d<l;){var m=h[d],y=m.iteratee,w=m.type,x=y(v);if(2==w)v=x;else if(!x){if(1==w)continue t;break t}}g[f++]=v}return g},Vr.prototype.at=ga,Vr.prototype.chain=function(){return fa(this)},Vr.prototype.commit=function(){return new Kr(this.value(),this.__chain__)},Vr.prototype.next=function(){this.__values__===t&&(this.__values__=fo(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?t:this.__values__[this.__index__++]}},Vr.prototype.plant=function(e){for(var r,n=this;n instanceof Mr;){var i=Ls(n);i.__index__=0,i.__values__=t,r?s.__wrapped__=i:r=i;var s=i;n=n.__wrapped__}return s.__wrapped__=e,r},Vr.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Ur){var r=e;return this.__actions__.length&&(r=new Ur(this)),(r=r.reverse()).__actions__.push({func:pa,args:[ta],thisArg:t}),new Kr(r,this.__chain__)}return this.thru(ta)},Vr.prototype.toJSON=Vr.prototype.valueOf=Vr.prototype.value=function(){return di(this.__wrapped__,this.__actions__)},Vr.prototype.first=Vr.prototype.head,ee&&(Vr.prototype[ee]=function(){return this}),Vr}();ge?((ge.exports=gr)._=gr,pe._=gr):fe._=gr}.call(nt);var lo=ho.exports;function fo(t={}){const{getToken:e=()=>"",onUnauthorized:r=()=>{},onError:n=t=>console.error(t),baseURL:i="",timeout:s=8e3}=t,a=co.create();return a.interceptors.request.use(t=>t,t=>Promise.reject(t)),a.interceptors.response.use(t=>{console.log(t,"response xxx 888888888");const e=t.data,i=t.config.responseType;if("blob"===i||"arraybuffer"===i)return e;const s=e.code;if(void 0!==s)switch(s){case 200:case 201:return e;case 401:return r();default:return void n(e.msg||"Error")}else n("非本系统的接口")},t=>{if(console.log(t,"error xxx"),"ECONNABORTED"===t.code&&t.message.includes("timeout"))return n("请求超时,请稍后重试!"),Promise.reject(t);const e=lo.get(t,"response.status"),i=lo.get(t,"response.data.msg");switch(e){case 400:t.msg="请求错误";break;case 401:t.msg=i||"未授权",r();break;case 403:t.msg=i||"拒绝访问";break;case 404:t.msg="请求地址出错";break;case 408:t.msg="请求超时";break;case 500:t.msg="服务器内部错误";break;case 501:t.msg="服务未实现";break;case 502:t.msg="网关错误";break;case 503:t.msg="服务不可用";break;case 504:t.msg="网关超时";break;case 505:t.msg="HTTP 版本不受支持"}return t.msg&&n(t.msg),Promise.reject(t)}),t=>{const r=e(),n={baseURL:i,headers:{token:r?`${r}`:void 0,"Content-Type":"application/json"},data:{},timeout:s,withCredentials:!1},{signal:o,...u}=t||{},c=lo.merge({},n,u);return o&&(c.signal=o),a(c)}}function po(t,e={}){const{selfKey:n="itemCode",parentKey:i="parentItem",hasChildKey:s="hasChild",defaultExpanded:u=!0}=e,c=a(()=>{const e=void 0!==t.value?t.value:t;return Array.isArray(e)?e:[]});a(()=>{const t=new Map;for(const e of c.value){const r=e[i];r&&(t.has(r)||t.set(r,[]),t.get(r).push(e))}return t});const h=a(()=>{const t=new Map;for(const e of c.value){const r=[],s=e[n];let a=e[i];const o=new Set;for(;a&&!o.has(a)&&a!==s;){o.add(a),r.push(a);const t=c.value.find(t=>t[n]===a);if(!t)break;a=t[i]}t.set(s,r)}return t}),l=r(new Set);o(()=>c.value,()=>(()=>{const t=new Set;if(u)for(const e of c.value)e[s]&&t.add(e[n]);l.value=t})(),{immediate:!0});const f=t=>{const e=h.value.get(t[n]);if(!e||0===e.length)return!0;for(const t of e){const e=c.value.find(e=>e[n]===t);if(e&&e[s]&&!l.value.has(t))return!1}return!0},p=a(()=>c.value.filter(f));return{expandedKeys:l,toggle:t=>{const e=new Set(l.value);e.has(t)?e.delete(t):e.add(t),l.value=e},expandAll:()=>{const t=new Set;for(const e of c.value)e[s]&&t.add(e[n]);l.value=t},collapseAll:()=>{l.value=new Set},visibleList:p}}function go(t,e){if(!t||!e)return"";const r=u.pki.publicKeyFromPem(`-----BEGIN PUBLIC KEY-----\n${e.replace(/\s/g,"").match(/.{1,64}/g).join("\n")}\n-----END PUBLIC KEY-----`);const n=(new TextEncoder).encode(t);let i="";for(let t=0;t<n.length;t++)i+=String.fromCharCode(n[t]);const s=r.encrypt(i,"RSA-OAEP",{md:u.md.sha256.create(),mgf1:{md:u.md.sha1.create()}});return u.util.encode64(s)}function vo(t,e,r="AESGCM:"){if(!t?.startsWith(r))return null;try{const n=u.util.decode64(t.substring(r.length)),i=u.util.decode64(e);if(32!==i.length)return console.error("密钥不是 32 字节"),null;n.substring(0,8);const s=n.substring(8,20),a=n.substring(n.length-16),o=n.substring(20,n.length-16),c=u.cipher.createDecipher("AES-GCM",i);return c.start({iv:s,tagLength:128,tag:a}),c.update(u.util.createBuffer(o)),c.finish()?c.output.toString():(console.error("GCM Tag 校验失败:密钥错误 / 结构不对 / 需要 AAD"),null)}catch(t){return console.error("AES-GCM 解密失败",t),null}}const mo="0.3.10";export{Ur as AUDIT_STATUS_INDEX,Zr as AUDIT_WHITE_LIST,Qr as CLIENT_WHITE_LIST,c as CacheKey,v as MENU_DATA_KEY,yr as PermissionPlugin,Hi as VoucherDecimal,d as WHITE_LIST,vo as aesGcmDecryptForge,Ki as buildLinkedAmountSegments,Mr as buildTreeForSave,cr as calculateXSum,wr as checkCrossYear,Dr as companyPeriodDisabled,lr as copyText,fo as createHttpClient,ir as debounce,_r as disabledDate,rr as downloadFile,Je as exportFile,mr as extractPermissions,or as extractPropValues,Jr as filterEmptyRows,Hr as filterTreeData,kr as findParent,Gr as focusAndOpenSelectInCell,gr as formatAmount,Ue as formatAmountToUnits,Pr as formatDateTime,fr as formatMenuData,pr as formatMenuTree,Ge as formatMoney,Qe as formatToFirstDay,sr as generate32BitRandomString,zr as generateCodeExample,ar as generateTimestamp,O as getCompanyAccountPeriod,L as getCompanyAccountPeriodNow,j as getCompanyAuditStatusMsg,M as getCompanyAuditStatusMsgNow,F as getCompanyCode,C as getCompanyName,R as getCompanyType,ze as getCurrentMonth,Br as getDefaultDateTimeRange,Cr as getFileType,Xe as getFileTypeFromUrlRegex,z as getFinancialStandardDictType,tr as getFormattedDateTime,m as getGlobalProperties,Sr as getLevelPadding,Ar as getMinValueItem,Fr as getPrevMonth,y as getToken,S as getUserInfo,br as handleBeforeUpload,Ui as handleSubKeydown,$e as handleViewFile,$r as hasNonZeroValue,ki as isAccountingEnabled,Rr as isBeforeToday,Li as isCnyCurrency,Tr as isDateInRange,Or as isTaskContinue,Nr as isTaskStart,jr as openNewWindow,Vr as parseNum,ur as percentToNumber,nr as periodDisabledDate,hr as periodDisabledDateAllAfter,p as phoneRegex,xr as positionMap,Ye as postExportFile,Lr as processCode,qr as processList,er as processVoucherArrayEnhanced,h as publicKey,dr as recalculateCashFlowData,_ as removeCompanyAccountPeriod,q as removeCompanyAccountPeriodNow,k as removeCompanyAuditStatusMsg,U as removeCompanyAuditStatusMsgNow,D as removeCompanyCode,P as removeCompanyName,N as removeCompanyType,G as removeFinancialStandardDictType,vr as removeOperation,x as removeToken,b as removeUserInfo,Mi as roundMoneyDecimal,qi as roundSubDecimal,go as rsaEncrypt,Yr as scrollToId,B as setCompanyAccountPeriod,V as setCompanyAccountPeriodNow,H as setCompanyAuditStatusMsg,K as setCompanyAuditStatusMsgNow,A as setCompanyCode,I as setCompanyName,T as setCompanyType,W as setFinancialStandardDictType,w as setToken,E as setUserInfo,Ze as signWithSHA256RSA,f as svgConst,l as svgSjPath,Vi as toVoucherDecimal,Kr as treeHas,We as truncateToTwoDecimals,g as unclosablePaths,Er as useGlobalDragUpload,po as useTreeExpand,mo as version,Xr as whiteList};
|
|
44
35
|
//# sourceMappingURL=jiezhangxin-utils.esm.js.map
|