69 var jsonParse=function(){var d
=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"),k
=new RegExp("\\\\(?:([^u])|u(.{4}))","g"),g
={'"':'"',"/":"/","\\":"\\",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"};function h(l
,m
,n
){return m
?g
[m
]:String
.fromCharCode(parseInt(n
,16))}var c
=new String(""),b
=(Object
,Array
,Object
.hasOwnProperty
);return function(u
,q
){var x
,t
,p
=u
.match(d
),v
=p
[0],l
=!1;"{"===v
?x
={}:"["===v
?x
=[]:(x
=[],l
=!0);for(var r
=[x
],o
=1-l
,m
=p
.length
;o
<m
;++o
){var w
;switch((v
=p
[o
]).charCodeAt(0)){default:(w
=r
[0])[t
||w
.length
]=+v
,t
=void 0;break;case 34:if(-1!==(v
=v
.substring(1,v
.length
-1)).indexOf("\\")&&(v
=v
.replace(k
,h
)),w
=r
[0],!t
){if(!(w
instanceof Array
)){t
=v
||c
;break}t
=w
.length
}w
[t
]=v
,t
=void 0;break;case 91:w
=r
[0],r
.unshift(w
[t
||w
.length
]=[]),t
=void 0;break;case 93:r
.shift();break;case 102:(w
=r
[0])[t
||w
.length
]=!1,t
=void 0;break;case 110:(w
=r
[0])[t
||w
.length
]=null,t
=void 0;break;case 116:(w
=r
[0])[t
||w
.length
]=!0,t
=void 0;break;case 123:w
=r
[0],r
.unshift(w
[t
||w
.length
]={}),t
=void 0;break;case 125:r
.shift()}}if(l
){if(1!==r
.length
)throw new Error
;x
=x
[0]}else if(r
.length
)throw new Error
;if(q
){var s=function(C
,B
){var D
=C
[B
];if(D
&&"object"==typeof D
){var n
=null;for(var z
in D
)if(b
.call(D
,z
)&&D
!==C
){var y
=s(D
,z
);void 0!==y
?D
[z
]=y:(n
||(n
=[]),n
.push(z
))}if(n
)for(var A
=n
.length
;--A
>=0;)delete D
[n
[A
]]}return q
.call(C
,B
,D
)};x
=s({"":x
},"")}return x
}}();void 0!==KJUR
&&KJUR
||(KJUR
={}),void 0!==KJUR
.asn1
&&KJUR
.asn1
||(KJUR
.asn1
={}),KJUR
.asn1
.ASN1Util
=new function(){this.integerToByteHex=function(a
){var b
=a
.toString(16);return b
.length
%2==1&&(b
="0"+b
),b
},this.bigIntToMinTwosComplementsHex=function(j
){var f
=j
.toString(16);if("-"!=f
.substr(0,1))f
.length
%2==1?f
="0"+f:f
.match(/^[0-7]/)||(f
="00"+f
);else{var e
=f
.substr(1).length
;e
%2==1?e
+=1:f
.match(/^[0-7]/)||(e
+=2);for(var g
="",d
=0;d
<e
;d
++)g
+="f";f
=new BigInteger(g
,16).xor(j
).add(BigInteger
.ONE
).toString(16).replace(/^-/,"")}return f
},this.getPEMStringFromHex=function(a
,b
){return hextopem(a
,b
)},this.newObject=function(k
){var n
=KJUR
.asn1
,z
=n
.DERBoolean
,e
=n
.DERInteger
,s
=n
.DERBitString
,h
=n
.DEROctetString
,v
=n
.DERNull
,w
=n
.DERObjectIdentifier
,l
=n
.DEREnumerated
,g
=n
.DERUTF8String
,f
=n
.DERNumericString
,y
=n
.DERPrintableString
,u
=n
.DERTeletexString
,p
=n
.DERIA5String
,C
=n
.DERUTCTime
,j
=n
.DERGeneralizedTime
,m
=n
.DERSequence
,c
=n
.DERSet
,r
=n
.DERTaggedObject
,o
=n
.ASN1Util
.newObject
,t
=Object
.keys(k
);if(1!=t
.length
)throw"key of param shall be only one.";var F
=t
[0];if(-1==":bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:seq:set:tag:".indexOf(":"+F
+":"))throw"undefined key: "+F
;if("bool"==F
)return new z(k
[F
]);if("int"==F
)return new e(k
[F
]);if("bitstr"==F
)return new s(k
[F
]);if("octstr"==F
)return new h(k
[F
]);if("null"==F
)return new v(k
[F
]);if("oid"==F
)return new w(k
[F
]);if("enum"==F
)return new l(k
[F
]);if("utf8str"==F
)return new g(k
[F
]);if("numstr"==F
)return new f(k
[F
]);if("prnstr"==F
)return new y(k
[F
]);if("telstr"==F
)return new u(k
[F
]);if("ia5str"==F
)return new p(k
[F
]);if("utctime"==F
)return new C(k
[F
]);if("gentime"==F
)return new j(k
[F
]);if("seq"==F
){for(var d
=k
[F
],E
=[],x
=0;x
<d
.length
;x
++){var B
=o(d
[x
]);E
.push(B
)}return new m({array:E
})}if("set"==F
){for(d
=k
[F
],E
=[],x
=0;x
<d
.length
;x
++){B
=o(d
[x
]);E
.push(B
)}return new c({array:E
})}if("tag"==F
){var A
=k
[F
];if("[object Array]"===Object
.prototype.toString
.call(A
)&&3==A
.length
){var q
=o(A
[2]);return new r({tag:A
[0],explicit:A
[1],obj:q
})}var b
={};if(void 0!==A
.explicit
&&(b
.explicit
=A
.explicit
),void 0!==A
.tag
&&(b
.tag
=A
.tag
),void 0===A
.obj
)throw"obj shall be specified for 'tag'.";return b
.obj
=o(A
.obj
),new r(b
)}},this.jsonToASN1HEX=function(b
){return this.newObject(b
).getEncodedHex()}},KJUR
.asn1
.ASN1Util
.oidHexToInt=function(a
){for(var j
="",k
=parseInt(a
.substr(0,2),16),e
=(j
=Math
.floor(k
/40)+"."+k
%40,""),f
=2;f
<a
.length
;f
+=2){var h
=("00000000"+parseInt(a
.substr(f
,2),16).toString(2)).slice(-8);if(e
+=h
.substr(1,7),"0"==h
.substr(0,1))j
=j
+"."+new BigInteger(e
,2).toString(10),e
=""}return j
},KJUR
.asn1
.ASN1Util
.oidIntToHex=function(f
){var e=function(a
){var k
=a
.toString(16);return 1==k
.length
&&(k
="0"+k
),k
},d=function(o
){var n
="",a
=new BigInteger(o
,10).toString(2),l
=7-a
.length
%7;7==l
&&(l
=0);for(var q
="",m
=0;m
<l
;m
++)q
+="0";a
=q
+a
;for(m
=0;m
<a
.length
-1;m
+=7){var p
=a
.substr(m
,7);m
!=a
.length
-7&&(p
="1"+p
),n
+=e(parseInt(p
,2))}return n
};if(!f
.match(/^[0-9.]+$/))throw"malformed oid string: "+f
;var g
="",b
=f
.split("."),j
=40*parseInt(b
[0])+parseInt(b
[1]);g
+=e(j
),b
.splice(0,2);for(var c
=0;c
<b
.length
;c
++)g
+=d(b
[c
]);return g
},KJUR
.asn1
.ASN1Object=function(){this.getLengthHexFromValue=function(){if(void 0===this.hV
||null==this.hV
)throw"this.hV is null or undefined.";if(this.hV
.length
%2==1)throw"value hex must be even length: n="+"".length
+",v="+this.hV
;var i
=this.hV
.length
/2,h
=i
.toString(16);if(h
.length
%2==1&&(h
="0"+h
),i
<128)return h
;var g
=h
.length
/2;if(g
>15)throw"ASN.1 length too long to represent by 8x: n = "+i
.toString(16);return(128+g
).toString(16)+h
},this.getEncodedHex=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.getValueHex=function(){return this.getEncodedHex(),this.hV
},this.getFreshValueHex=function(){return""}},KJUR
.asn1
.DERAbstractString=function(c
){KJUR
.asn1
.DERAbstractString
.superclass
.constructor.call(this);this.getString=function(){return this.s
},this.setString=function(d
){this.hTLV
=null,this.isModified
=!0,this.s
=d
,this.hV
=utf8tohex(this.s
).toLowerCase()},this.setStringHex=function(d
){this.hTLV
=null,this.isModified
=!0,this.s
=null,this.hV
=d
},this.getFreshValueHex=function(){return this.hV
},void 0!==c
&&("string"==typeof c
?this.setString(c
):void 0!==c
.str
?this.setString(c
.str
):void 0!==c
.hex
&&this.setStringHex(c
.hex
))},YAHOO
.lang
.extend(KJUR
.asn1
.DERAbstractString
,KJUR
.asn1
.ASN1Object
),KJUR
.asn1
.DERAbstractTime=function(c
){KJUR
.asn1
.DERAbstractTime
.superclass
.constructor.call(this);this.localDateToUTC=function(f
){return utc
=f
.getTime()+6e4
*f
.getTimezoneOffset(),new Date(utc
)},this.formatDate=function(m
,o
,e
){var g
=this.zeroPadding
,n
=this.localDateToUTC(m
),p
=String(n
.getFullYear());"utc"==o
&&(p
=p
.substr(2,2));var r
=p
+g(String(n
.getMonth()+1),2)+g(String(n
.getDate()),2)+g(String(n
.getHours()),2)+g(String(n
.getMinutes()),2)+g(String(n
.getSeconds()),2);if(!0===e
){var f
=n
.getMilliseconds();if(0!=f
){var k
=g(String(f
),3);r
=r
+"."+(k
=k
.replace(/[0]+$/,""))}}return r
+"Z"},this.zeroPadding=function(e
,d
){return e
.length
>=d
?e:new Array(d
-e
.length
+1).join("0")+e
},this.getString=function(){return this.s
},this.setString=function(d
){this.hTLV
=null,this.isModified
=!0,this.s
=d
,this.hV
=stohex(d
)},this.setByDateValue=function(h
,j
,e
,d
,f
,g
){var i
=new Date(Date
.UTC(h
,j
-1,e
,d
,f
,g
,0));this.setByDate(i
)},this.getFreshValueHex=function(){return this.hV
}},YAHOO
.lang
.extend(KJUR
.asn1
.DERAbstractTime
,KJUR
.asn1
.ASN1Object
),KJUR
.asn1
.DERAbstractStructured=function(b
){KJUR
.asn1
.DERAbstractString
.superclass
.constructor.call(this);this.setByASN1ObjectArray=function(c
){this.hTLV
=null,this.isModified
=!0,this.asn1Array
=c
},this.appendASN1Object=function(c
){this.hTLV
=null,this.isModified
=!0,this.asn1Array
.push(c
)},this.asn1Array
=new Array
,void 0!==b
&&void 0!==b
.array
&&(this.asn1Array
=b
.array
)},YAHOO
.lang
.extend(KJUR
.asn1
.DERAbstractStructured
,KJUR
.asn1
.ASN1Object
),KJUR
.asn1
.DERBoolean=function(){KJUR
.asn1
.DERBoolean
.superclass
.constructor.call(this),this.hT
="01",this.hTLV
="0101ff"},YAHOO
.lang
.extend(KJUR
.asn1
.DERBoolean
,KJUR
.asn1
.ASN1Object
),KJUR
.asn1
.DERInteger=function(a
){KJUR
.asn1
.DERInteger
.superclass
.constructor.call(this),this.hT
="02",this.setByBigInteger=function(b
){this.hTLV
=null,this.isModified
=!0,this.hV
=KJUR
.asn1
.ASN1Util
.bigIntToMinTwosComplementsHex(b
)},this.setByInteger=function(c
){var b
=new BigInteger(String(c
),10);this.setByBigInteger(b
)},this.setValueHex=function(b
){this.hV
=b
},this.getFreshValueHex=function(){return this.hV
},void 0!==a
&&(void 0!==a
.bigint
?this.setByBigInteger(a
.bigint
):void 0!==a
.int?this.setByInteger(a
.int):"number"==typeof a
?this.setByInteger(a
):void 0!==a
.hex
&&this.setValueHex(a
.hex
))},YAHOO
.lang
.extend(KJUR
.asn1
.DERInteger
,KJUR
.asn1
.ASN1Object
),KJUR
.asn1
.DERBitString=function(b
){if(void 0!==b
&&void 0!==b
.obj
){var a
=KJUR
.asn1
.ASN1Util
.newObject(b
.obj
);b
.hex
="00"+a
.getEncodedHex()}KJUR
.asn1
.DERBitString
.superclass
.constructor.call(this),this.hT
="03",this.setHexValueIncludingUnusedBits=function(c
){this.hTLV
=null,this.isModified
=!0,this.hV
=c
},this.setUnusedBitsAndHexValue=function(c
,e
){if(c
<0||7<c
)throw"unused bits shall be from 0 to 7: u = "+c
;var d
="0"+c
;this.hTLV
=null,this.isModified
=!0,this.hV
=d
+e
},this.setByBinaryString=function(e
){var f
=8-(e
=e
.replace(/0+$/,"")).length
%8;8==f
&&(f
=0);for(var g
=0;g
<=f
;g
++)e
+="0";var j
="";for(g
=0;g
<e
.length
-1;g
+=8){var d
=e
.substr(g
,8),c
=parseInt(d
,2).toString(16);1==c
.length
&&(c
="0"+c
),j
+=c
}this.hTLV
=null,this.isModified
=!0,this.hV
="0"+f
+j
},this.setByBooleanArray=function(e
){for(var d
="",c
=0;c
<e
.length
;c
++)1==e
[c
]?d
+="1":d
+="0";this.setByBinaryString(d
)},this.newFalseArray=function(e
){for(var c
=new Array(e
),d
=0;d
<e
;d
++)c
[d
]=!1;return c
},this.getFreshValueHex=function(){return this.hV
},void 0!==b
&&("string"==typeof b
&&b
.toLowerCase().match(/^[0-9a-f]+$/)?this.setHexValueIncludingUnusedBits(b
):void 0!==b
.hex
?this.setHexValueIncludingUnusedBits(b
.hex
):void 0!==b
.bin
?this.setByBinaryString(b
.bin
):void 0!==b
.array
&&this.setByBooleanArray(b
.array
))},YAHOO
.lang
.extend(KJUR
.asn1
.DERBitString
,KJUR
.asn1
.ASN1Object
),KJUR
.asn1
.DEROctetString=function(b
){if(void 0!==b
&&void 0!==b
.obj
){var a
=KJUR
.asn1
.ASN1Util
.newObject(b
.obj
);b
.hex
=a
.getEncodedHex()}KJUR
.asn1
.DEROctetString
.superclass
.constructor.call(this,b
),this.hT
="04"},YAHOO
.lang
.extend(KJUR
.asn1
.DEROctetString
,KJUR
.asn1
.DERAbstractString
),KJUR
.asn1
.DERNull=function(){KJUR
.asn1
.DERNull
.superclass
.constructor.call(this),this.hT
="05",this.hTLV
="0500"},YAHOO
.lang
.extend(KJUR
.asn1
.DERNull
,KJUR
.asn1
.ASN1Object
),KJUR
.asn1
.DERObjectIdentifier=function(c
){var b=function(d
){var e
=d
.toString(16);return 1==e
.length
&&(e
="0"+e
),e
},a=function(k
){var j
="",d
=new BigInteger(k
,10).toString(2),f
=7-d
.length
%7;7==f
&&(f
=0);for(var m
="",g
=0;g
<f
;g
++)m
+="0";d
=m
+d
;for(g
=0;g
<d
.length
-1;g
+=7){var l
=d
.substr(g
,7);g
!=d
.length
-7&&(l
="1"+l
),j
+=b(parseInt(l
,2))}return j
};KJUR
.asn1
.DERObjectIdentifier
.superclass
.constructor.call(this),this.hT
="06",this.setValueHex=function(d
){this.hTLV
=null,this.isModified
=!0,this.s
=null,this.hV
=d
},this.setValueOidString=function(f
){if(!f
.match(/^[0-9.]+$/))throw"malformed oid string: "+f
;var g
="",d
=f
.split("."),j
=40*parseInt(d
[0])+parseInt(d
[1]);g
+=b(j
),d
.splice(0,2);for(var e
=0;e
<d
.length
;e
++)g
+=a(d
[e
]);this.hTLV
=null,this.isModified
=!0,this.s
=null,this.hV
=g
},this.setValueName=function(e
){var d
=KJUR
.asn1
.x509
.OID
.name2oid(e
);if(""===d
)throw"DERObjectIdentifier oidName undefined: "+e
;this.setValueOidString(d
)},this.getFreshValueHex=function(){return this.hV
},void 0!==c
&&("string"==typeof c
?c
.match(/^[0-2].[0-9.]+$/)?this.setValueOidString(c
):this.setValueName(c
):void 0!==c
.oid
?this.setValueOidString(c
.oid
):void 0!==c
.hex
?this.setValueHex(c
.hex
):void 0!==c
.name
&&this.setValueName(c
.name
))},YAHOO
.lang
.extend(KJUR
.asn1
.DERObjectIdentifier
,KJUR
.asn1
.ASN1Object
),KJUR
.asn1
.DEREnumerated=function(a
){KJUR
.asn1
.DEREnumerated
.superclass
.constructor.call(this),this.hT
="0a",this.setByBigInteger=function(b
){this.hTLV
=null,this.isModified
=!0,this.hV
=KJUR
.asn1
.ASN1Util
.bigIntToMinTwosComplementsHex(b
)},this.setByInteger=function(c
){var b
=new BigInteger(String(c
),10);this.setByBigInteger(b
)},this.setValueHex=function(b
){this.hV
=b
},this.getFreshValueHex=function(){return this.hV
},void 0!==a
&&(void 0!==a
.int?this.setByInteger(a
.int):"number"==typeof a
?this.setByInteger(a
):void 0!==a
.hex
&&this.setValueHex(a
.hex
))},YAHOO
.lang
.extend(KJUR
.asn1
.DEREnumerated
,KJUR
.asn1
.ASN1Object
),KJUR
.asn1
.DERUTF8String=function(a
){KJUR
.asn1
.DERUTF8String
.superclass
.constructor.call(this,a
),this.hT
="0c"},YAHOO
.lang
.extend(KJUR
.asn1
.DERUTF8String
,KJUR
.asn1
.DERAbstractString
),KJUR
.asn1
.DERNumericString=function(a
){KJUR
.asn1
.DERNumericString
.superclass
.constructor.call(this,a
),this.hT
="12"},YAHOO
.lang
.extend(KJUR
.asn1
.DERNumericString
,KJUR
.asn1
.DERAbstractString
),KJUR
.asn1
.DERPrintableString=function(a
){KJUR
.asn1
.DERPrintableString
.superclass
.constructor.call(this,a
),this.hT
="13"},YAHOO
.lang
.extend(KJUR
.asn1
.DERPrintableString
,KJUR
.asn1
.DERAbstractString
),KJUR
.asn1
.DERTeletexString=function(a
){KJUR
.asn1
.DERTeletexString
.superclass
.constructor.call(this,a
),this.hT
="14"},YAHOO
.lang
.extend(KJUR
.asn1
.DERTeletexString
,KJUR
.asn1
.DERAbstractString
),KJUR
.asn1
.DERIA5String=function(a
){KJUR
.asn1
.DERIA5String
.superclass
.constructor.call(this,a
),this.hT
="16"},YAHOO
.lang
.extend(KJUR
.asn1
.DERIA5String
,KJUR
.asn1
.DERAbstractString
),KJUR
.asn1
.DERUTCTime=function(a
){KJUR
.asn1
.DERUTCTime
.superclass
.constructor.call(this,a
),this.hT
="17",this.setByDate=function(b
){this.hTLV
=null,this.isModified
=!0,this.date
=b
,this.s
=this.formatDate(this.date
,"utc"),this.hV
=stohex(this.s
)},this.getFreshValueHex=function(){return void 0===this.date
&&void 0===this.s
&&(this.date
=new Date
,this.s
=this.formatDate(this.date
,"utc"),this.hV
=stohex(this.s
)),this.hV
},void 0!==a
&&(void 0!==a
.str
?this.setString(a
.str
):"string"==typeof a
&&a
.match(/^[0-9]{12}Z$/)?this.setString(a
):void 0!==a
.hex
?this.setStringHex(a
.hex
):void 0!==a
.date
&&this.setByDate(a
.date
))},YAHOO
.lang
.extend(KJUR
.asn1
.DERUTCTime
,KJUR
.asn1
.DERAbstractTime
),KJUR
.asn1
.DERGeneralizedTime=function(a
){KJUR
.asn1
.DERGeneralizedTime
.superclass
.constructor.call(this,a
),this.hT
="18",this.withMillis
=!1,this.setByDate=function(b
){this.hTLV
=null,this.isModified
=!0,this.date
=b
,this.s
=this.formatDate(this.date
,"gen",this.withMillis
),this.hV
=stohex(this.s
)},this.getFreshValueHex=function(){return void 0===this.date
&&void 0===this.s
&&(this.date
=new Date
,this.s
=this.formatDate(this.date
,"gen",this.withMillis
),this.hV
=stohex(this.s
)),this.hV
},void 0!==a
&&(void 0!==a
.str
?this.setString(a
.str
):"string"==typeof a
&&a
.match(/^[0-9]{14}Z$/)?this.setString(a
):void 0!==a
.hex
?this.setStringHex(a
.hex
):void 0!==a
.date
&&this.setByDate(a
.date
),!0===a
.millis
&&(this.withMillis
=!0))},YAHOO
.lang
.extend(KJUR
.asn1
.DERGeneralizedTime
,KJUR
.asn1
.DERAbstractTime
),KJUR
.asn1
.DERSequence=function(a
){KJUR
.asn1
.DERSequence
.superclass
.constructor.call(this,a
),this.hT
="30",this.getFreshValueHex=function(){for(var c
="",b
=0;b
<this.asn1Array
.length
;b
++){c
+=this.asn1Array
[b
].getEncodedHex()}return this.hV
=c
,this.hV
}},YAHOO
.lang
.extend(KJUR
.asn1
.DERSequence
,KJUR
.asn1
.DERAbstractStructured
),KJUR
.asn1
.DERSet=function(a
){KJUR
.asn1
.DERSet
.superclass
.constructor.call(this,a
),this.hT
="31",this.sortFlag
=!0,this.getFreshValueHex=function(){for(var b
=new Array
,c
=0;c
<this.asn1Array
.length
;c
++){var d
=this.asn1Array
[c
];b
.push(d
.getEncodedHex())}return 1==this.sortFlag
&&b
.sort(),this.hV
=b
.join(""),this.hV
},void 0!==a
&&void 0!==a
.sortflag
&&0==a
.sortflag
&&(this.sortFlag
=!1)},YAHOO
.lang
.extend(KJUR
.asn1
.DERSet
,KJUR
.asn1
.DERAbstractStructured
),KJUR
.asn1
.DERTaggedObject=function(a
){KJUR
.asn1
.DERTaggedObject
.superclass
.constructor.call(this),this.hT
="a0",this.hV
="",this.isExplicit
=!0,this.asn1Object
=null,this.setASN1Object=function(b
,c
,d
){this.hT
=c
,this.isExplicit
=b
,this.asn1Object
=d
,this.isExplicit
?(this.hV
=this.asn1Object
.getEncodedHex(),this.hTLV
=null,this.isModified
=!0):(this.hV
=null,this.hTLV
=d
.getEncodedHex(),this.hTLV
=this.hTLV
.replace(/^../,c
),this.isModified
=!1)},this.getFreshValueHex=function(){return this.hV
},void 0!==a
&&(void 0!==a
.tag
&&(this.hT
=a
.tag
),void 0!==a
.explicit
&&(this.isExplicit
=a
.explicit
),void 0!==a
.obj
&&(this.asn1Object
=a
.obj
,this.setASN1Object(this.isExplicit
,this.hT
,this.asn1Object
)))},YAHOO
.lang
.extend(KJUR
.asn1
.DERTaggedObject
,KJUR
.asn1
.ASN1Object
);var KJUR
,utf8tob64u
,b64utoutf8
,ASN1HEX
=new function(){};function stoBA(d
){for(var b
=new Array
,c
=0;c
<d
.length
;c
++)b
[c
]=d
.charCodeAt(c
);return b
}function BAtos(b
){for(var d
="",c
=0;c
<b
.length
;c
++)d
+=String
.fromCharCode(b
[c
]);return d
}function BAtohex(b
){for(var e
="",d
=0;d
<b
.length
;d
++){var c
=b
[d
].toString(16);1==c
.length
&&(c
="0"+c
),e
+=c
}return e
}function stohex(a
){return BAtohex(stoBA(a
))}function b64tob64u(a
){return a
=(a
=(a
=a
.replace(/\=/g,"")).replace(/\+/g,"-")).replace(/\//g,"_")}function b64utob64(a
){return a
.length
%4==2?a
+="==":a
.length
%4==3&&(a
+="="),a
=(a
=a
.replace(/-/g,"+")).replace(/_
/g,"/")}function hextob64u(a){return a.length%2==1&&(a="0"+a),b64tob64u(hex2b64(a))}function b64utohex(a){return b64tohex(b64utob64(a))}function utf8tohex(a){return uricmptohex(encodeURIComponentAll(a))}function hextoutf8(a){return decodeURIComponent(hextouricmp(a))}function hextorstr(c){for(var b="",a=0;a<c.length-1;a+=2)b+=String.fromCharCode(parseInt(c.substr(a,2),16));return b}function rstrtohex(c){for(var a="",b=0;b<c.length;b++)a+=("0"+c.charCodeAt(b).toString(16)).slice(-2);return a}function hextob64(a){return hex2b64(a)}function hextob64nl(b){var c=hextob64(b).replace(/(.{64})/g,"$1\r\n");return c=c.replace(/\r\n$/,"")}function b64nltohex(b){return b64tohex(b.replace(/[^0-9A-Za-z\/+=]*/g,""))}function hextopem(a,b){return"-----BEGIN
"+b+"-----\r\n"+hextob64nl(a)+"\r\n-----END
"+b+"-----\r\n"}function pemtohex(a,b){if(-1==a.indexOf("-----BEGIN
"))throw"can
't find PEM header: "+b;return b64nltohex(a=void 0!==b?(a=a.replace("-----BEGIN "+b+"-----","")).replace("-----END "+b+"-----",""):(a=a.replace(/-----BEGIN [^-]+-----/,"")).replace(/-----END [^-]+-----/,""))}function zulutomsec(n){var l,j,m,e,f,i,b,a,h,g,c;if(c=n.match(/^(\d{2}|\d{4})(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)(|\.\d+)Z$/))return a=c[1],l=parseInt(a),2===a.length&&(50<=l&&l<100?l=1900+l:0<=l&&l<50&&(l=2e3+l)),j=parseInt(c[2])-1,m=parseInt(c[3]),e=parseInt(c[4]),f=parseInt(c[5]),i=parseInt(c[6]),b=0,""!==(h=c[7])&&(g=(h.substr(1)+"00").substr(0,3),b=parseInt(g)),Date.UTC(l,j,m,e,f,i,b);throw"unsupported zulu format: "+n}function zulutosec(a){return~~(zulutomsec(a)/1e3)}function uricmptohex(a){return a.replace(/%/g,"")}function hextouricmp(a){return a.replace(/(..)/g,"%$1")}function ipv6tohex(g){var b="malformed IPv6 address";if(!g.match(/^[0-9A-Fa-f:]+$/))throw b;var d=(g=g.toLowerCase()).split(":").length-1;if(d<2)throw b;var e=":".repeat(7-d+2),c=(g=g.replace("::",e)).split(":");if(8!=c.length)throw b;for(var f=0;f<8;f++)c[f]=("0000"+c[f]).slice(-4);return c.join("")}function hextoipv6(e){if(!e.match(/^[0-9A-Fa-f]{32}$/))throw"malformed IPv6 address octet";for(var b=(e=e.toLowerCase()).match(/.{1,4}/g),d=0;d<8;d++)b[d]=b[d].replace(/^0+/,""),""==b[d]&&(b[d]="0");var c=(e=":"+b.join(":")+":").match(/:(0:){2,}/g);if(null===c)return e.slice(1,-1);var f="";for(d=0;d<c.length;d++)c[d].length>f.length&&(f=c[d]);return(e=e.replace(f,"::")).slice(1,-1)}function hextoip(b){var d="malformed hex value";if(!b.match(/^([0-9A-Fa-f][0-9A-Fa-f]){1,}$/))throw d;if(8!=b.length)return 32==b.length?hextoipv6(b):b;try{return parseInt(b.substr(0,2),16)+"."+parseInt(b.substr(2,2),16)+"."+parseInt(b.substr(4,2),16)+"."+parseInt(b.substr(6,2),16)}catch(a){throw d}}function encodeURIComponentAll(a){for(var d=encodeURIComponent(a),b="",c=0;c<d.length;c++)"%"==d[c]?(b+=d.substr(c,3),c+=2):b=b+"%"+stohex(d[c]);return b}function hextoposhex(a){return a.length%2==1?"0"+a:a.substr(0,1)>"7"?"00"+a:a}function intarystrtohex(b){b=(b=(b=b.replace(/^\s*\[\s*/,"")).replace(/\s*\]\s*$/,"")).replace(/\s*/g,"");try{return b.split(/,/).map((function(g,e,h){var f=parseInt(g);if(f<0||255<f)throw"integer not in range 0-255";return("00"+f.toString(16)).slice(-2)})).join("")}catch(a){throw"malformed integer array string: "+a}}ASN1HEX.getLblen=function(c,a){if("8"!=c.substr(a+2,1))return 1;var b=parseInt(c.substr(a+3,1));return 0==b?-1:0<b&&b<10?b+1:-2},ASN1HEX.getL=function(c,b){var a=ASN1HEX.getLblen(c,b);return a<1?"":c.substr(b+2,2*a)},ASN1HEX.getVblen=function(d,a){var c;return""==(c=ASN1HEX.getL(d,a))?-1:("8"===c.substr(0,1)?new BigInteger(c.substr(2),16):new BigInteger(c,16)).intValue()},ASN1HEX.getVidx=function(c,b){var a=ASN1HEX.getLblen(c,b);return a<0?a:b+2*(a+1)},ASN1HEX.getV=function(d,a){var c=ASN1HEX.getVidx(d,a),b=ASN1HEX.getVblen(d,a);return d.substr(c,2*b)},ASN1HEX.getTLV=function(b,a){return b.substr(a,2)+ASN1HEX.getL(b,a)+ASN1HEX.getV(b,a)},ASN1HEX.getNextSiblingIdx=function(d,a){return ASN1HEX.getVidx(d,a)+2*ASN1HEX.getVblen(d,a)},ASN1HEX.getChildIdx=function(e,f){var j=ASN1HEX,g=new Array,i=j.getVidx(e,f);"03"==e.substr(f,2)?g.push(i+2):g.push(i);for(var l=j.getVblen(e,f),c=i,d=0;;){var b=j.getNextSiblingIdx(e,c);if(null==b||b-i>=2*l)break;if(d>=200)break;g.push(b),c=b,d++}return g},ASN1HEX.getNthChildIdx=function(d,b,e){return ASN1HEX.getChildIdx(d,b)[e]},ASN1HEX.getIdxbyList=function(e,d,c,i){var f,b,g=ASN1HEX;if(0==c.length){if(void 0!==i&&e.substr(d,2)!==i)throw"checking tag doesn't
match: "+e.substr(d,2)+"!="+i;return d}return f=c.shift(),b=g.getChildIdx(e,d),g.getIdxbyList(e,b[f],c,i)},ASN1HEX.getTLVbyList=function(d,c,b,f){var e=ASN1HEX,a=e.getIdxbyList(d,c,b);if(void 0===a)throw"can
't find nthList object";if(void 0!==f&&d.substr(a,2)!=f)throw"checking tag doesn't
match: "+d.substr(a,2)+"!="+f;return e.getTLV(d,a)},ASN1HEX.getVbyList=function(e,c,b,g,i){var a,d,f=ASN1HEX;if(void 0===(a=f.getIdxbyList(e,c,b,g)))throw"can
't find nthList object";return d=f.getV(e,a),!0===i&&(d=d.substr(2)),d},ASN1HEX.hextooidstr=function(e){var h=function(b,a){return b.length>=a?b:new Array(a-b.length+1).join("0")+b},l=[],o=e.substr(0,2),f=parseInt(o,16);l[0]=new String(Math.floor(f/40)),l[1]=new String(f%40);for(var m=e.substr(2),k=[],g=0;g<m.length/2;g++)k.push(parseInt(m.substr(2*g,2),16));var j=[],d="";for(g=0;g<k.length;g++)128&k[g]?d+=h((127&k[g]).toString(2),7):(d+=h((127&k[g]).toString(2),7),j.push(new String(parseInt(d,2))),d="");var n=l.join(".");return j.length>0&&(n=n+"."+j.join(".")),n},ASN1HEX.dump=function(t,c,l,g){var p=ASN1HEX,j=p.getV,y=p.dump,w=p.getChildIdx,e=t;t instanceof KJUR.asn1.ASN1Object&&(e=t.getEncodedHex());var q=function(A,i){return A.length<=2*i?A:A.substr(0,i)+"..(total "+A.length/2+"bytes).."+A.substr(A.length-i,i)};void 0===c&&(c={ommit_long_octet:32}),void 0===l&&(l=0),void 0===g&&(g="");var x=c.ommit_long_octet;if("01"==e.substr(l,2))return"00"==(h=j(e,l))?g+"BOOLEAN FALSE\n":g+"BOOLEAN TRUE\n";if("02"==e.substr(l,2))return g+"INTEGER "+q(h=j(e,l),x)+"\n";if("03"==e.substr(l,2))return g+"BITSTRING "+q(h=j(e,l),x)+"\n";if("04"==e.substr(l,2)){var h=j(e,l);if(p.isASN1HEX(h)){var k=g+"OCTETSTRING, encapsulates\n";return k+=y(h,c,0,g+" ")}return g+"OCTETSTRING "+q(h,x)+"\n"}if("05"==e.substr(l,2))return g+"NULL\n";if("06"==e.substr(l,2)){var m=j(e,l),a=KJUR.asn1.ASN1Util.oidHexToInt(m),o=KJUR.asn1.x509.OID.oid2name(a),b=a.replace(/\./g," ");return""!=o?g+"ObjectIdentifier "+o+" ("+b+")\n":g+"ObjectIdentifier ("+b+")\n"}if("0c"==e.substr(l,2))return g+"UTF8String '"+hextoutf8(j(e,l))+"'\n";if("13"==e.substr(l,2))return g+"PrintableString '"+hextoutf8(j(e,l))+"'\n";if("14"==e.substr(l,2))return g+"TeletexString '"+hextoutf8(j(e,l))+"'\n";if("16"==e.substr(l,2))return g+"IA5String '"+hextoutf8(j(e,l))+"'\n";if("17"==e.substr(l,2))return g+"UTCTime "+hextoutf8(j(e,l))+"\n";if("18"==e.substr(l,2))return g+"GeneralizedTime "+hextoutf8(j(e,l))+"\n";if("30"==e.substr(l,2)){if("3000"==e.substr(l,4))return g+"SEQUENCE {}\n";k=g+"SEQUENCE\n";var f=c;if((2==(d=w(e,l)).length||3==d.length)&&"06"==e.substr(d[0],2)&&"04"==e.substr(d[d.length-1],2)){o=p.oidname(j(e,d[0]));var r=JSON.parse(JSON.stringify(c));r.x509ExtName=o,f=r}for(var u=0;u<d.length;u++)k+=y(e,f,d[u],g+" ");return k}if("31"==e.substr(l,2)){k=g+"SET\n";var d=w(e,l);for(u=0;u<d.length;u++)k+=y(e,c,d[u],g+" ");return k}var z=parseInt(e.substr(l,2),16);if(0!=(128&z)){var n=31&z;if(0!=(32&z)){var k=g+"["+n+"]\n";for(d=w(e,l),u=0;u<d.length;u++)k+=y(e,c,d[u],g+" ");return k}return"68747470"==(h=j(e,l)).substr(0,8)&&(h=hextoutf8(h)),"subjectAltName"===c.x509ExtName&&2==n&&(h=hextoutf8(h)),k=g+"["+n+"] "+h+"\n"}return g+"UNKNOWN("+e.substr(l,2)+") "+j(e,l)+"\n"},ASN1HEX.isASN1HEX=function(e){var d=ASN1HEX;if(e.length%2==1)return!1;var c=d.getVblen(e,0),b=e.substr(0,2),f=d.getL(e,0);return e.length-b.length-f.length==2*c},ASN1HEX.oidname=function(a){var c=KJUR.asn1;KJUR.lang.String.isHex(a)&&(a=c.ASN1Util.oidHexToInt(a));var b=c.x509.OID.oid2name(a);return""===b&&(b=a),b},void 0!==KJUR&&KJUR||(KJUR={}),void 0!==KJUR.asn1&&KJUR.asn1||(KJUR.asn1={}),void 0!==KJUR.asn1.x509&&KJUR.asn1.x509||(KJUR.asn1.x509={}),KJUR.asn1.x509.Certificate=function(e){KJUR.asn1.x509.Certificate.superclass.constructor.call(this);var b=KJUR,g=(b.crypto,b.asn1),d=g.DERSequence,c=g.DERBitString;this.sign=function(){this.asn1SignatureAlg=this.asn1TBSCert.asn1SignatureAlg;var m=new KJUR.crypto.Signature({alg:this.asn1SignatureAlg.nameAlg});m.init(this.prvKey),m.updateHex(this.asn1TBSCert.getEncodedHex()),this.hexSig=m.sign(),this.asn1Sig=new c({hex:"00"+this.hexSig});var l=new d({array:[this.asn1TBSCert,this.asn1SignatureAlg,this.asn1Sig]});this.hTLV=l.getEncodedHex(),this.isModified=!1},this.setSignatureHex=function(l){this.asn1SignatureAlg=this.asn1TBSCert.asn1SignatureAlg,this.hexSig=l,this.asn1Sig=new c({hex:"00"+this.hexSig});var m=new d({array:[this.asn1TBSCert,this.asn1SignatureAlg,this.asn1Sig]});this.hTLV=m.getEncodedHex(),this.isModified=!1},this.getEncodedHex=function(){if(0==this.isModified&&null!=this.hTLV)return this.hTLV;throw"not signed yet"},this.getPEMString=function(){return"-----BEGIN CERTIFICATE-----\r\n"+hextob64nl(this.getEncodedHex())+"\r\n-----END CERTIFICATE-----\r\n"},void 0!==e&&(void 0!==e.tbscertobj&&(this.asn1TBSCert=e.tbscertobj),void 0!==e.prvkeyobj&&(this.prvKey=e.prvkeyobj))},YAHOO.lang.extend(KJUR.asn1.x509.Certificate,KJUR.asn1.ASN1Object),KJUR.asn1.x509.TBSCertificate=function(e){KJUR.asn1.x509.TBSCertificate.superclass.constructor.call(this);var i=KJUR.asn1,f=i.DERSequence,h=i.DERInteger,c=i.DERTaggedObject,d=i.x509,g=d.Time,a=d.X500Name,j=d.SubjectPublicKeyInfo;this._initialize=function(){this.asn1Array=new Array,this.asn1Version=new c({obj:new h({int:2})}),this.asn1SerialNumber=null,this.asn1SignatureAlg=null,this.asn1Issuer=null,this.asn1NotBefore=null,this.asn1NotAfter=null,this.asn1Subject=null,this.asn1SubjPKey=null,this.extensionsArray=new Array},this.setSerialNumberByParam=function(k){this.asn1SerialNumber=new h(k)},this.setSignatureAlgByParam=function(k){this.asn1SignatureAlg=new d.AlgorithmIdentifier(k)},this.setIssuerByParam=function(k){this.asn1Issuer=new a(k)},this.setNotBeforeByParam=function(k){this.asn1NotBefore=new g(k)},this.setNotAfterByParam=function(k){this.asn1NotAfter=new g(k)},this.setSubjectByParam=function(k){this.asn1Subject=new a(k)},this.setSubjectPublicKey=function(k){this.asn1SubjPKey=new j(k)},this.setSubjectPublicKeyByGetKey=function(l){var k=KEYUTIL.getKey(l);this.asn1SubjPKey=new j(k)},this.appendExtension=function(k){this.extensionsArray.push(k)},this.appendExtensionByName=function(l,k){KJUR.asn1.x509.Extension.appendByNameToArray(l,k,this.extensionsArray)},this.getEncodedHex=function(){if(null==this.asn1NotBefore||null==this.asn1NotAfter)throw"notBefore and/or notAfter not set";var l=new f({array:[this.asn1NotBefore,this.asn1NotAfter]});if(this.asn1Array=new Array,this.asn1Array.push(this.asn1Version),this.asn1Array.push(this.asn1SerialNumber),this.asn1Array.push(this.asn1SignatureAlg),this.asn1Array.push(this.asn1Issuer),this.asn1Array.push(l),this.asn1Array.push(this.asn1Subject),this.asn1Array.push(this.asn1SubjPKey),this.extensionsArray.length>0){var m=new f({array:this.extensionsArray}),k=new c({explicit:!0,tag:"a3",obj:m});this.asn1Array.push(k)}var n=new f({array:this.asn1Array});return this.hTLV=n.getEncodedHex(),this.isModified=!1,this.hTLV},this._initialize()},YAHOO.lang.extend(KJUR.asn1.x509.TBSCertificate,KJUR.asn1.ASN1Object),KJUR.asn1.x509.Extension=function(d){KJUR.asn1.x509.Extension.superclass.constructor.call(this);var e=KJUR.asn1,h=e.DERObjectIdentifier,i=e.DEROctetString,g=(e.DERBitString,e.DERBoolean),c=e.DERSequence;this.getEncodedHex=function(){var m=new h({oid:this.oid}),l=new i({hex:this.getExtnValueHex()}),k=new Array;return k.push(m),this.critical&&k.push(new g),k.push(l),new c({array:k}).getEncodedHex()},this.critical=!1,void 0!==d&&void 0!==d.critical&&(this.critical=d.critical)},YAHOO.lang.extend(KJUR.asn1.x509.Extension,KJUR.asn1.ASN1Object),KJUR.asn1.x509.Extension.appendByNameToArray=function(e,c,b){var g=e.toLowerCase(),f=KJUR.asn1.x509;if("basicconstraints"==g){var d=new f.BasicConstraints(c);b.push(d)}else if("keyusage"==g){d=new f.KeyUsage(c);b.push(d)}else if("crldistributionpoints"==g){d=new f.CRLDistributionPoints(c);b.push(d)}else if("extkeyusage"==g){d=new f.ExtKeyUsage(c);b.push(d)}else if("authoritykeyidentifier"==g){d=new f.AuthorityKeyIdentifier(c);b.push(d)}else if("authorityinfoaccess"==g){d=new f.AuthorityInfoAccess(c);b.push(d)}else if("subjectaltname"==g){d=new f.SubjectAltName(c);b.push(d)}else{if("issueraltname"!=g)throw"unsupported extension name: "+e;d=new f.IssuerAltName(c);b.push(d)}},KJUR.asn1.x509.KeyUsage=function(f){KJUR.asn1.x509.KeyUsage.superclass.constructor.call(this,f);var a=X509.KEYUSAGE_NAME;if(this.getExtnValueHex=function(){return this.asn1ExtnValue.getEncodedHex()},this.oid="2.5.29.15",void 0!==f&&(void 0!==f.bin&&(this.asn1ExtnValue=new KJUR.asn1.DERBitString(f)),void 0!==f.names&&void 0!==f.names.length)){for(var e=f.names,d="000000000",c=0;c<e.length;c++)for(var b=0;b<a.length;b++)e[c]===a[b]&&(d=d.substring(0,b)+"1"+d.substring(b+1,d.length));this.asn1ExtnValue=new KJUR.asn1.DERBitString({bin:d})}},YAHOO.lang.extend(KJUR.asn1.x509.KeyUsage,KJUR.asn1.x509.Extension),KJUR.asn1.x509.BasicConstraints=function(c){KJUR.asn1.x509.BasicConstraints.superclass.constructor.call(this,c);this.getExtnValueHex=function(){var e=new Array;this.cA&&e.push(new KJUR.asn1.DERBoolean),this.pathLen>-1&&e.push(new KJUR.asn1.DERInteger({int:this.pathLen}));var d=new KJUR.asn1.DERSequence({array:e});return this.asn1ExtnValue=d,this.asn1ExtnValue.getEncodedHex()},this.oid="2.5.29.19",this.cA=!1,this.pathLen=-1,void 0!==c&&(void 0!==c.cA&&(this.cA=c.cA),void 0!==c.pathLen&&(this.pathLen=c.pathLen))},YAHOO.lang.extend(KJUR.asn1.x509.BasicConstraints,KJUR.asn1.x509.Extension),KJUR.asn1.x509.CRLDistributionPoints=function(d){KJUR.asn1.x509.CRLDistributionPoints.superclass.constructor.call(this,d);var a=KJUR.asn1,c=a.x509;this.getExtnValueHex=function(){return this.asn1ExtnValue.getEncodedHex()},this.setByDPArray=function(e){this.asn1ExtnValue=new a.DERSequence({array:e})},this.setByOneURI=function(h){var e=new c.GeneralNames([{uri:h}]),g=new c.DistributionPointName(e),f=new c.DistributionPoint({dpobj:g});this.setByDPArray([f])},this.oid="2.5.29.31",void 0!==d&&(void 0!==d.array?this.setByDPArray(d.array):void 0!==d.uri&&this.setByOneURI(d.uri))},YAHOO.lang.extend(KJUR.asn1.x509.CRLDistributionPoints,KJUR.asn1.x509.Extension),KJUR.asn1.x509.ExtKeyUsage=function(c){KJUR.asn1.x509.ExtKeyUsage.superclass.constructor.call(this,c);var a=KJUR.asn1;this.setPurposeArray=function(d){this.asn1ExtnValue=new a.DERSequence;for(var e=0;e<d.length;e++){var f=new a.DERObjectIdentifier(d[e]);this.asn1ExtnValue.appendASN1Object(f)}},this.getExtnValueHex=function(){return this.asn1ExtnValue.getEncodedHex()},this.oid="2.5.29.37",void 0!==c&&void 0!==c.array&&this.setPurposeArray(c.array)},YAHOO.lang.extend(KJUR.asn1.x509.ExtKeyUsage,KJUR.asn1.x509.Extension),KJUR.asn1.x509.AuthorityKeyIdentifier=function(d){KJUR.asn1.x509.AuthorityKeyIdentifier.superclass.constructor.call(this,d);var a=KJUR.asn1,c=a.DERTaggedObject;this.asn1KID=null,this.asn1CertIssuer=null,this.asn1CertSN=null,this.getExtnValueHex=function(){var f=new Array;this.asn1KID&&f.push(new c({explicit:!1,tag:"80",obj:this.asn1KID})),this.asn1CertIssuer&&f.push(new c({explicit:!1,tag:"a1",obj:this.asn1CertIssuer})),this.asn1CertSN&&f.push(new c({explicit:!1,tag:"82",obj:this.asn1CertSN}));var e=new a.DERSequence({array:f});return this.asn1ExtnValue=e,this.asn1ExtnValue.getEncodedHex()},this.setKIDByParam=function(e){this.asn1KID=new KJUR.asn1.DEROctetString(e)},this.setCertIssuerByParam=function(e){this.asn1CertIssuer=new KJUR.asn1.x509.X500Name(e)},this.setCertSNByParam=function(e){this.asn1CertSN=new KJUR.asn1.DERInteger(e)},this.oid="2.5.29.35",void 0!==d&&(void 0!==d.kid&&this.setKIDByParam(d.kid),void 0!==d.issuer&&this.setCertIssuerByParam(d.issuer),void 0!==d.sn&&this.setCertSNByParam(d.sn))},YAHOO.lang.extend(KJUR.asn1.x509.AuthorityKeyIdentifier,KJUR.asn1.x509.Extension),KJUR.asn1.x509.AuthorityInfoAccess=function(a){KJUR.asn1.x509.AuthorityInfoAccess.superclass.constructor.call(this,a),this.setAccessDescriptionArray=function(k){for(var j=new Array,g=KJUR.asn1,d=g.DERSequence,f=0;f<k.length;f++){var h=new d({array:[new g.DERObjectIdentifier(k[f].accessMethod),new g.x509.GeneralName(k[f].accessLocation)]});j.push(h)}this.asn1ExtnValue=new d({array:j})},this.getExtnValueHex=function(){return this.asn1ExtnValue.getEncodedHex()},this.oid="1.3.6.1.5.5.7.1.1",void 0!==a&&void 0!==a.array&&this.setAccessDescriptionArray(a.array)},YAHOO.lang.extend(KJUR.asn1.x509.AuthorityInfoAccess,KJUR.asn1.x509.Extension),KJUR.asn1.x509.SubjectAltName=function(a){KJUR.asn1.x509.SubjectAltName.superclass.constructor.call(this,a),this.setNameArray=function(b){this.asn1ExtnValue=new KJUR.asn1.x509.GeneralNames(b)},this.getExtnValueHex=function(){return this.asn1ExtnValue.getEncodedHex()},this.oid="2.5.29.17",void 0!==a&&void 0!==a.array&&this.setNameArray(a.array)},YAHOO.lang.extend(KJUR.asn1.x509.SubjectAltName,KJUR.asn1.x509.Extension),KJUR.asn1.x509.IssuerAltName=function(a){KJUR.asn1.x509.IssuerAltName.superclass.constructor.call(this,a),this.setNameArray=function(b){this.asn1ExtnValue=new KJUR.asn1.x509.GeneralNames(b)},this.getExtnValueHex=function(){return this.asn1ExtnValue.getEncodedHex()},this.oid="2.5.29.18",void 0!==a&&void 0!==a.array&&this.setNameArray(a.array)},YAHOO.lang.extend(KJUR.asn1.x509.IssuerAltName,KJUR.asn1.x509.Extension),KJUR.asn1.x509.CRL=function(f){KJUR.asn1.x509.CRL.superclass.constructor.call(this);this.sign=function(){this.asn1SignatureAlg=this.asn1TBSCertList.asn1SignatureAlg,sig=new KJUR.crypto.Signature({alg:"SHA1withRSA",prov:"cryptojs/jsrsa"}),sig.init(this.prvKey),sig.updateHex(this.asn1TBSCertList.getEncodedHex()),this.hexSig=sig.sign(),this.asn1Sig=new KJUR.asn1.DERBitString({hex:"00"+this.hexSig});var g=new KJUR.asn1.DERSequence({array:[this.asn1TBSCertList,this.asn1SignatureAlg,this.asn1Sig]});this.hTLV=g.getEncodedHex(),this.isModified=!1},this.getEncodedHex=function(){if(0==this.isModified&&null!=this.hTLV)return this.hTLV;throw"not signed yet"},this.getPEMString=function(){return"-----BEGIN X509 CRL-----\r\n"+hextob64nl(this.getEncodedHex())+"\r\n-----END X509 CRL-----\r\n"},void 0!==f&&(void 0!==f.tbsobj&&(this.asn1TBSCertList=f.tbsobj),void 0!==f.prvkeyobj&&(this.prvKey=f.prvkeyobj))},YAHOO.lang.extend(KJUR.asn1.x509.CRL,KJUR.asn1.ASN1Object),KJUR.asn1.x509.TBSCertList=function(g){KJUR.asn1.x509.TBSCertList.superclass.constructor.call(this);var c=KJUR.asn1,b=c.DERSequence,f=c.x509,a=f.Time;this.setSignatureAlgByParam=function(h){this.asn1SignatureAlg=new f.AlgorithmIdentifier(h)},this.setIssuerByParam=function(h){this.asn1Issuer=new f.X500Name(h)},this.setThisUpdateByParam=function(h){this.asn1ThisUpdate=new a(h)},this.setNextUpdateByParam=function(h){this.asn1NextUpdate=new a(h)},this.addRevokedCert=function(h,i){var k={};null!=h&&null!=h&&(k.sn=h),null!=i&&null!=i&&(k.time=i);var j=new f.CRLEntry(k);this.aRevokedCert.push(j)},this.getEncodedHex=function(){if(this.asn1Array=new Array,null!=this.asn1Version&&this.asn1Array.push(this.asn1Version),this.asn1Array.push(this.asn1SignatureAlg),this.asn1Array.push(this.asn1Issuer),this.asn1Array.push(this.asn1ThisUpdate),null!=this.asn1NextUpdate&&this.asn1Array.push(this.asn1NextUpdate),this.aRevokedCert.length>0){var h=new b({array:this.aRevokedCert});this.asn1Array.push(h)}var i=new b({array:this.asn1Array});return this.hTLV=i.getEncodedHex(),this.isModified=!1,this.hTLV},this._initialize=function(){this.asn1Version=null,this.asn1SignatureAlg=null,this.asn1Issuer=null,this.asn1ThisUpdate=null,this.asn1NextUpdate=null,this.aRevokedCert=new Array},this._initialize()},YAHOO.lang.extend(KJUR.asn1.x509.TBSCertList,KJUR.asn1.ASN1Object),KJUR.asn1.x509.CRLEntry=function(e){KJUR.asn1.x509.CRLEntry.superclass.constructor.call(this);var a=KJUR.asn1;this.setCertSerial=function(f){this.sn=new a.DERInteger(f)},this.setRevocationDate=function(f){this.time=new a.x509.Time(f)},this.getEncodedHex=function(){var f=new a.DERSequence({array:[this.sn,this.time]});return this.TLV=f.getEncodedHex(),this.TLV},void 0!==e&&(void 0!==e.time&&this.setRevocationDate(e.time),void 0!==e.sn&&this.setCertSerial(e.sn))},YAHOO.lang.extend(KJUR.asn1.x509.CRLEntry,KJUR.asn1.ASN1Object),KJUR.asn1.x509.X500Name=function(f){KJUR.asn1.x509.X500Name.superclass.constructor.call(this),this.asn1Array=new Array;var c=KJUR.asn1,e=c.x509,b=pemtohex;if(this.setByString=function(g){var k=g.split("/");k.shift();for(var j=[],l=0;l<k.length;l++)if(k[l].match(/^[^=]+=.+$/))j.push(k[l]);else{var h=j.length-1;j[h]=j[h]+"/"+k[l]}for(l=0;l<j.length;l++)this.asn1Array.push(new e.RDN({str:j[l]}))},this.setByLdapString=function(g){var h=e.X500Name.ldapToOneline(g);this.setByString(h)},this.setByObject=function(i){for(var g in i)if(i.hasOwnProperty(g)){var h=new KJUR.asn1.x509.RDN({str:g+"="+i[g]});this.asn1Array?this.asn1Array.push(h):this.asn1Array=[h]}},this.getEncodedHex=function(){if("string"==typeof this.hTLV)return this.hTLV;var g=new c.DERSequence({array:this.asn1Array});return this.hTLV=g.getEncodedHex(),this.hTLV},void 0!==f){var a;if(void 0!==f.str?this.setByString(f.str):void 0!==f.ldapstr?this.setByLdapString(f.ldapstr):"object"==typeof f&&this.setByObject(f),void 0!==f.certissuer)(a=new X509).hex=b(f.certissuer),this.hTLV=a.getIssuerHex();if(void 0!==f.certsubject)(a=new X509).hex=b(f.certsubject),this.hTLV=a.getSubjectHex()}},YAHOO.lang.extend(KJUR.asn1.x509.X500Name,KJUR.asn1.ASN1Object),KJUR.asn1.x509.X500Name.onelineToLDAP=function(d){if("/"!==d.substr(0,1))throw"malformed input";var c=(d=d.substr(1)).split("/");return c.reverse(),(c=c.map((function(a){return a.replace(/,/,"\\,")}))).join(",")},KJUR.asn1.x509.X500Name.ldapToOneline=function(g){for(var c=g.split(","),e=!1,b=[],f=0;c.length>0;f++){var h=c.shift();if(!0===e){var j=(b.pop()+","+h).replace(/\\,/g,",");b.push(j),e=!1}else b.push(h);"\\"===h.substr(-1,1)&&(e=!0)}return(b=b.map((function(a){return a.replace("/","\\/")}))).reverse(),"/"+b.join("/")},KJUR.asn1.x509.RDN=function(a){KJUR.asn1.x509.RDN.superclass.constructor.call(this),this.asn1Array=new Array,this.addByString=function(b){this.asn1Array.push(new KJUR.asn1.x509.AttributeTypeAndValue({str:b}))},this.addByMultiValuedString=function(d){for(var b=KJUR.asn1.x509.RDN.parseString(d),c=0;c<b.length;c++)this.addByString(b[c])},this.getEncodedHex=function(){var b=new KJUR.asn1.DERSet({array:this.asn1Array});return this.TLV=b.getEncodedHex(),this.TLV},void 0!==a&&void 0!==a.str&&this.addByMultiValuedString(a.str)},YAHOO.lang.extend(KJUR.asn1.x509.RDN,KJUR.asn1.ASN1Object),KJUR.asn1.x509.RDN.parseString=function(m){for(var j=m.split(/\+/),h=!1,c=[],g=0;j.length>0;g++){var k=j.shift();if(!0===h){var d=(c.pop()+"+"+k).replace(/\\\+/g,"+");c.push(d),h=!1}else c.push(k);"\\"===k.substr(-1,1)&&(h=!0)}var l=!1,b=[];for(g=0;c.length>0;g++){k=c.shift();if(!0===l){var e=b.pop();if(k.match(/"$/)){d=(e+"+"+k).replace(/^([^=]+)="(.*)"$/,"$1=$2");b.push(d),l=!1}else b.push(e+"+"+k)}else b.push(k);k.match(/^[^=]+="/)&&(l=!0)}return b},KJUR.asn1.x509.AttributeTypeAndValue=function(d){KJUR.asn1.x509.AttributeTypeAndValue.superclass.constructor.call(this);var b=KJUR.asn1;this.setByString=function(h){var g=h.match(/^([^=]+)=(.+)$/);if(!g)throw"malformed attrTypeAndValueStr: "+h;this.setByAttrTypeAndValueStr(g[1],g[2])},this.setByAttrTypeAndValueStr=function(i,h){this.typeObj=KJUR.asn1.x509.OID.atype2obj(i);var g="utf8";"C"==i&&(g="prn"),this.valueObj=this.getValueObj(g,h)},this.getValueObj=function(h,g){if("utf8"==h)return new b.DERUTF8String({str:g});if("prn"==h)return new b.DERPrintableString({str:g});if("tel"==h)return new b.DERTeletexString({str:g});if("ia5"==h)return new b.DERIA5String({str:g});throw"unsupported directory string type: type="+h+" value="+g},this.getEncodedHex=function(){var g=new b.DERSequence({array:[this.typeObj,this.valueObj]});return this.TLV=g.getEncodedHex(),this.TLV},void 0!==d&&void 0!==d.str&&this.setByString(d.str)},YAHOO.lang.extend(KJUR.asn1.x509.AttributeTypeAndValue,KJUR.asn1.ASN1Object),KJUR.asn1.x509.SubjectPublicKeyInfo=function(f){KJUR.asn1.x509.SubjectPublicKeyInfo.superclass.constructor.call(this);var a=KJUR,j=a.asn1,i=j.DERInteger,b=j.DERBitString,m=j.DERObjectIdentifier,e=j.DERSequence,h=j.ASN1Util.newObject,o=j.x509.AlgorithmIdentifier,g=a.crypto;g.ECDSA,g.DSA;this.getASN1Object=function(){if(null==this.asn1AlgId||null==this.asn1SubjPKey)throw"algId and/or subjPubKey not set";return new e({array:[this.asn1AlgId,this.asn1SubjPKey]})},this.getEncodedHex=function(){var p=this.getASN1Object();return this.hTLV=p.getEncodedHex(),this.hTLV},this.setPubKey=function(q){try{if(q instanceof RSAKey){var s=h({seq:[{int:{bigint:q.n}},{int:{int:q.e}}]}).getEncodedHex();this.asn1AlgId=new o({name:"rsaEncryption"}),this.asn1SubjPKey=new b({hex:"00"+s})}}catch(p){}try{if(q instanceof KJUR.crypto.ECDSA){var r=new m({name:q.curveName});this.asn1AlgId=new o({name:"ecPublicKey",asn1params:r}),this.asn1SubjPKey=new b({hex:"00"+q.pubKeyHex})}}catch(p){}try{if(q instanceof KJUR.crypto.DSA){r=new h({seq:[{int:{bigint:q.p}},{int:{bigint:q.q}},{int:{bigint:q.g}}]});this.asn1AlgId=new o({name:"dsa",asn1params:r});var t=new i({bigint:q.y});this.asn1SubjPKey=new b({hex:"00"+t.getEncodedHex()})}}catch(p){}},void 0!==f&&this.setPubKey(f)},YAHOO.lang.extend(KJUR.asn1.x509.SubjectPublicKeyInfo,KJUR.asn1.ASN1Object),KJUR.asn1.x509.Time=function(f){KJUR.asn1.x509.Time.superclass.constructor.call(this);var c=KJUR.asn1,b=c.DERUTCTime,g=c.DERGeneralizedTime;this.setTimeParams=function(h){this.timeParams=h},this.getEncodedHex=function(){var h=null;return h=null!=this.timeParams?"utc"==this.type?new b(this.timeParams):new g(this.timeParams):"utc"==this.type?new b:new g,this.TLV=h.getEncodedHex(),this.TLV},this.type="utc",void 0!==f&&(void 0!==f.type?this.type=f.type:void 0!==f.str&&(f.str.match(/^[0-9]{12}Z$/)&&(this.type="utc"),f.str.match(/^[0-9]{14}Z$/)&&(this.type="gen")),this.timeParams=f)},YAHOO.lang.extend(KJUR.asn1.x509.Time,KJUR.asn1.ASN1Object),KJUR.asn1.x509.AlgorithmIdentifier=function(d){KJUR.asn1.x509.AlgorithmIdentifier.superclass.constructor.call(this),this.nameAlg=null,this.asn1Alg=null,this.asn1Params=null,this.paramEmpty=!1;var a=KJUR.asn1;if(this.getEncodedHex=function(){if(null===this.nameAlg&&null===this.asn1Alg)throw"algorithm not specified";null!==this.nameAlg&&null===this.asn1Alg&&(this.asn1Alg=a.x509.OID.name2obj(this.nameAlg));var e=[this.asn1Alg];null!==this.asn1Params&&e.push(this.asn1Params);var f=new a.DERSequence({array:e});return this.hTLV=f.getEncodedHex(),this.hTLV},void 0!==d&&(void 0!==d.name&&(this.nameAlg=d.name),void 0!==d.asn1params&&(this.asn1Params=d.asn1params),void 0!==d.paramempty&&(this.paramEmpty=d.paramempty)),null===this.asn1Params&&!1===this.paramEmpty&&null!==this.nameAlg){var c=this.nameAlg.toLowerCase();"withdsa"!==c.substr(-7,7)&&"withecdsa"!==c.substr(-9,9)&&(this.asn1Params=new a.DERNull)}},YAHOO.lang.extend(KJUR.asn1.x509.AlgorithmIdentifier,KJUR.asn1.ASN1Object),KJUR.asn1.x509.GeneralName=function(e){KJUR.asn1.x509.GeneralName.superclass.constructor.call(this);var k={rfc822:"81",dns:"82",dn:"a4",uri:"86",ip:"87"},g=KJUR.asn1,j=(g.DERSequence,g.DEROctetString),d=g.DERIA5String,c=g.DERTaggedObject,l=g.ASN1Object,a=g.x509.X500Name,h=pemtohex;this.explicit=!1,this.setByParam=function(p){var u=null;if(void 0!==p){if(void 0!==p.rfc822&&(this.type="rfc822",u=new d({str:p[this.type]})),void 0!==p.dns&&(this.type="dns",u=new d({str:p[this.type]})),void 0!==p.uri&&(this.type="uri",u=new d({str:p[this.type]})),void 0!==p.dn&&(this.type="dn",this.explicit=!0,u=new a({str:p.dn})),void 0!==p.ldapdn&&(this.type="dn",this.explicit=!0,u=new a({ldapstr:p.ldapdn})),void 0!==p.certissuer){this.type="dn",this.explicit=!0;var w=null;if((o=p.certissuer).match(/^[0-9A-Fa-f]+$/),-1!=o.indexOf("-----BEGIN ")&&(w=h(o)),null==w)throw"certissuer param not cert";(t=new X509).hex=w;var y=t.getIssuerHex();(u=new l).hTLV=y}if(void 0!==p.certsubj){this.type="dn",this.explicit=!0;var o,t;w=null;if((o=p.certsubj).match(/^[0-9A-Fa-f]+$/),-1!=o.indexOf("-----BEGIN ")&&(w=h(o)),null==w)throw"certsubj param not cert";(t=new X509).hex=w;y=t.getSubjectHex();(u=new l).hTLV=y}if(void 0!==p.ip){this.type="ip",this.explicit=!1;var s,q=p.ip,n="malformed IP address";if(q.match(/^[0-9.]+[.][0-9.]+$/)){if(8!==(s=intarystrtohex("["+q.split(".").join(",")+"]")).length)throw n}else if(q.match(/^[0-9A-Fa-f:]+:[0-9A-Fa-f:]+$/))s=ipv6tohex(q);else{if(!q.match(/^([0-9A-Fa-f][0-9A-Fa-f]){1,}$/))throw n;s=q}u=new j({hex:s})}if(null==this.type)throw"unsupported type in params="+p;this.asn1Obj=new c({explicit:this.explicit,tag:k[this.type],obj:u})}},this.getEncodedHex=function(){return this.asn1Obj.getEncodedHex()},void 0!==e&&this.setByParam(e)},YAHOO.lang.extend(KJUR.asn1.x509.GeneralName,KJUR.asn1.ASN1Object),KJUR.asn1.x509.GeneralNames=function(d){KJUR.asn1.x509.GeneralNames.superclass.constructor.call(this);var b=KJUR.asn1;this.setByParamArray=function(g){for(var e=0;e<g.length;e++){var f=new b.x509.GeneralName(g[e]);this.asn1Array.push(f)}},this.getEncodedHex=function(){return new b.DERSequence({array:this.asn1Array}).getEncodedHex()},this.asn1Array=new Array,void 0!==d&&this.setByParamArray(d)},YAHOO.lang.extend(KJUR.asn1.x509.GeneralNames,KJUR.asn1.ASN1Object),KJUR.asn1.x509.DistributionPointName=function(b){KJUR.asn1.x509.DistributionPointName.superclass.constructor.call(this);var c=KJUR.asn1,f=c.DERTaggedObject;if(this.getEncodedHex=function(){if("full"!=this.type)throw"currently type shall be 'full
': "+this.type;return this.asn1Obj=new f({explicit:!1,tag:this.tag,obj:this.asn1V}),this.hTLV=this.asn1Obj.getEncodedHex(),this.hTLV},void 0!==b){if(!c.x509.GeneralNames.prototype.isPrototypeOf(b))throw"This class supports GeneralNames only as argument";this.type="full",this.tag="a0",this.asn1V=b}},YAHOO.lang.extend(KJUR.asn1.x509.DistributionPointName,KJUR.asn1.ASN1Object),KJUR.asn1.x509.DistributionPoint=function(d){KJUR.asn1.x509.DistributionPoint.superclass.constructor.call(this);var b=KJUR.asn1;this.getEncodedHex=function(){var e=new b.DERSequence;if(null!=this.asn1DP){var f=new b.DERTaggedObject({explicit:!0,tag:"a0",obj:this.asn1DP});e.appendASN1Object(f)}return this.hTLV=e.getEncodedHex(),this.hTLV},void 0!==d&&void 0!==d.dpobj&&(this.asn1DP=d.dpobj)},YAHOO.lang.extend(KJUR.asn1.x509.DistributionPoint,KJUR.asn1.ASN1Object),KJUR.asn1.x509.OID=new function(a){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",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.name2oidList={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",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",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",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",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",nameConstraints:"2.5.29.30",cRLDistributionPoints:"2.5.29.31",certificatePolicies:"2.5.29.32",authorityKeyIdentifier:"2.5.29.35",policyConstraints:"2.5.29.36",extKeyUsage:"2.5.29.37",authorityInfoAccess:"1.3.6.1.5.5.7.1.1",ocsp:"1.3.6.1.5.5.7.48.1",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",ecPublicKey:"1.2.840.10045.2.1",secp256r1:"1.2.840.10045.3.1.7",secp256k1:"1.3.132.0.10",secp384r1:"1.3.132.0.34",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",extensionRequest:"1.2.840.113549.1.9.14"},this.objCache={},this.name2obj=function(b){if(void 0!==this.objCache[b])return this.objCache[b];if(void 0===this.name2oidList[b])throw"Name of ObjectIdentifier not defined: "+b;var c=this.name2oidList[b],d=new KJUR.asn1.DERObjectIdentifier({oid:c});return this.objCache[b]=d,d},this.atype2obj=function(b){if(void 0!==this.objCache[b])return this.objCache[b];if(void 0===this.atype2oidList[b])throw"AttributeType name undefined: "+b;var c=this.atype2oidList[b],d=new KJUR.asn1.DERObjectIdentifier({oid:c});return this.objCache[b]=d,d}},KJUR.asn1.x509.OID.oid2name=function(b){var c=KJUR.asn1.x509.OID.name2oidList;for(var a in c)if(c[a]==b)return a;return""},KJUR.asn1.x509.OID.oid2atype=function(b){var c=KJUR.asn1.x509.OID.atype2oidList;for(var a in c)if(c[a]==b)return a;return b},KJUR.asn1.x509.OID.name2oid=function(a){var b=KJUR.asn1.x509.OID.name2oidList;return void 0===b[a]?"":b[a]},KJUR.asn1.x509.X509Util={},KJUR.asn1.x509.X509Util.newCertPEM=function(h){var g=KJUR.asn1.x509,b=g.TBSCertificate,a=g.Certificate,f=new b;if(void 0===h.serial)throw"serial number undefined.";if(f.setSerialNumberByParam(h.serial),"string"!=typeof h.sigalg.name)throw"unproper signature algorithm name";if(f.setSignatureAlgByParam(h.sigalg),void 0===h.issuer)throw"issuer name undefined.";if(f.setIssuerByParam(h.issuer),void 0===h.notbefore)throw"notbefore undefined.";if(f.setNotBeforeByParam(h.notbefore),void 0===h.notafter)throw"notafter undefined.";if(f.setNotAfterByParam(h.notafter),void 0===h.subject)throw"subject name undefined.";if(f.setSubjectByParam(h.subject),void 0===h.sbjpubkey)throw"subject public key undefined.";if(f.setSubjectPublicKeyByGetKey(h.sbjpubkey),void 0!==h.ext&&void 0!==h.ext.length)for(var d=0;d<h.ext.length;d++)for(key in h.ext[d])f.appendExtensionByName(key,h.ext[d][key]);if(void 0===h.cakey&&void 0===h.sighex)throw"param cakey and sighex undefined.";var c=null;return h.cakey&&(c=new a({tbscertobj:f,prvkeyobj:!0===h.cakey.isPrivate?h.cakey:KEYUTIL.getKey.apply(null,h.cakey)})).sign(),h.sighex&&(c=new a({tbscertobj:f})).setSignatureHex(h.sighex),c.getPEMString()},void 0!==KJUR&&KJUR||(KJUR={}),void 0!==KJUR.asn1&&KJUR.asn1||(KJUR.asn1={}),void 0!==KJUR.asn1.cms&&KJUR.asn1.cms||(KJUR.asn1.cms={}),KJUR.asn1.cms.Attribute=function(d){var b=KJUR.asn1;b.cms.Attribute.superclass.constructor.call(this),this.getEncodedHex=function(){var h,g,e;h=new b.DERObjectIdentifier({oid:this.attrTypeOid}),g=new b.DERSet({array:this.valueList});try{g.getEncodedHex()}catch(f){throw"fail valueSet.getEncodedHex in Attribute(1)/"+f}e=new b.DERSequence({array:[h,g]});try{this.hTLV=e.getEncodedHex()}catch(f){throw"failed seq.getEncodedHex in Attribute(2)/"+f}return this.hTLV}},YAHOO.lang.extend(KJUR.asn1.cms.Attribute,KJUR.asn1.ASN1Object),KJUR.asn1.cms.ContentType=function(d){var b=KJUR.asn1;b.cms.ContentType.superclass.constructor.call(this),this.attrTypeOid="1.2.840.113549.1.9.3";var a=null;if(void 0!==d){a=new b.DERObjectIdentifier(d);this.valueList=[a]}},YAHOO.lang.extend(KJUR.asn1.cms.ContentType,KJUR.asn1.cms.Attribute),KJUR.asn1.cms.MessageDigest=function(d){var b=KJUR,e=b.asn1,g=e.DEROctetString,i=e.cms;if(i.MessageDigest.superclass.constructor.call(this),this.attrTypeOid="1.2.840.113549.1.9.4",void 0!==d)if(d.eciObj instanceof i.EncapsulatedContentInfo&&"string"==typeof d.hashAlg){var h=d.eciObj.eContentValueHex,c=d.hashAlg;(f=new g({hex:b.crypto.Util.hashHex(h,c)})).getEncodedHex(),this.valueList=[f]}else{var f;(f=new g(d)).getEncodedHex(),this.valueList=[f]}},YAHOO.lang.extend(KJUR.asn1.cms.MessageDigest,KJUR.asn1.cms.Attribute),KJUR.asn1.cms.SigningTime=function(e){var c=KJUR.asn1;if(c.cms.SigningTime.superclass.constructor.call(this),this.attrTypeOid="1.2.840.113549.1.9.5",void 0!==e){var a=new c.x509.Time(e);try{a.getEncodedHex()}catch(b){throw"SigningTime.getEncodedHex() failed/"+b}this.valueList=[a]}},YAHOO.lang.extend(KJUR.asn1.cms.SigningTime,KJUR.asn1.cms.Attribute),KJUR.asn1.cms.SigningCertificate=function(f){var c=KJUR,b=c.asn1,a=b.DERSequence,e=b.cms;c.crypto;e.SigningCertificate.superclass.constructor.call(this),this.attrTypeOid="1.2.840.113549.1.9.16.2.12",this.setCerts=function(n){for(var l=[],k=0;k<n.length;k++){var h=pemtohex(n[k]),g=c.crypto.Util.hashHex(h,"sha1"),o=new b.DEROctetString({hex:g});o.getEncodedHex();var m=new e.IssuerAndSerialNumber({cert:n[k]});m.getEncodedHex();var p=new a({array:[o,m]});p.getEncodedHex(),l.push(p)}var j=new a({array:l});j.getEncodedHex(),this.valueList=[j]},void 0!==f&&"object"==typeof f.array&&this.setCerts(f.array)},YAHOO.lang.extend(KJUR.asn1.cms.SigningCertificate,KJUR.asn1.cms.Attribute),KJUR.asn1.cms.SigningCertificateV2=function(h){var d=KJUR,c=d.asn1,b=c.DERSequence,g=c.x509,f=c.cms,e=d.crypto;if(f.SigningCertificateV2.superclass.constructor.call(this),this.attrTypeOid="1.2.840.113549.1.9.16.2.47",this.setCerts=function(r,k){for(var p=[],n=0;n<r.length;n++){var l=pemtohex(r[n]),t=[];"sha256"!==k&&t.push(new g.AlgorithmIdentifier({name:k}));var j=e.Util.hashHex(l,k),s=new c.DEROctetString({hex:j});s.getEncodedHex(),t.push(s);var o=new f.IssuerAndSerialNumber({cert:r[n]});o.getEncodedHex(),t.push(o);var q=new b({array:t});q.getEncodedHex(),p.push(q)}var m=new b({array:p});m.getEncodedHex(),this.valueList=[m]},void 0!==h&&"object"==typeof h.array){var a="sha256";"string"==typeof h.hashAlg&&(a=h.hashAlg),this.setCerts(h.array,a)}},YAHOO.lang.extend(KJUR.asn1.cms.SigningCertificateV2,KJUR.asn1.cms.Attribute),KJUR.asn1.cms.IssuerAndSerialNumber=function(e){var g=KJUR.asn1,f=g.DERInteger,i=g.cms,a=g.x509.X500Name,c=X509;i.IssuerAndSerialNumber.superclass.constructor.call(this);this.setByCertPEM=function(n){var l=pemtohex(n),k=new c;k.hex=l;var o=k.getIssuerHex();this.dIssuer=new a,this.dIssuer.hTLV=o;var m=k.getSerialNumberHex();this.dSerial=new f({hex:m})},this.getEncodedHex=function(){var k=new g.DERSequence({array:[this.dIssuer,this.dSerial]});return this.hTLV=k.getEncodedHex(),this.hTLV},void 0!==e&&("string"==typeof e&&-1!=e.indexOf("-----BEGIN ")&&this.setByCertPEM(e),e.issuer&&e.serial&&(e.issuer instanceof a?this.dIssuer=e.issuer:this.dIssuer=new a(e.issuer),e.serial instanceof f?this.dSerial=e.serial:this.dSerial=new f(e.serial)),"string"==typeof e.cert&&this.setByCertPEM(e.cert))},YAHOO.lang.extend(KJUR.asn1.cms.IssuerAndSerialNumber,KJUR.asn1.ASN1Object),KJUR.asn1.cms.AttributeList=function(d){var a=KJUR.asn1,c=a.cms;c.AttributeList.superclass.constructor.call(this),this.list=new Array,this.sortFlag=!0,this.add=function(e){e instanceof c.Attribute&&this.list.push(e)},this.length=function(){return this.list.length},this.clear=function(){this.list=new Array,this.hTLV=null,this.hV=null},this.getEncodedHex=function(){if("string"==typeof this.hTLV)return this.hTLV;var e=new a.DERSet({array:this.list,sortflag:this.sortFlag});return this.hTLV=e.getEncodedHex(),this.hTLV},void 0!==d&&void 0!==d.sortflag&&0==d.sortflag&&(this.sortFlag=!1)},YAHOO.lang.extend(KJUR.asn1.cms.AttributeList,KJUR.asn1.ASN1Object),KJUR.asn1.cms.SignerInfo=function(e){var a=KJUR,h=a.asn1,b=h.DERTaggedObject,n=h.cms,j=n.AttributeList,g=n.ContentType,k=n.EncapsulatedContentInfo,c=n.MessageDigest,l=n.SignedData,m=h.x509.AlgorithmIdentifier,f=a.crypto,i=KEYUTIL;n.SignerInfo.superclass.constructor.call(this),this.dCMSVersion=new h.DERInteger({int:1}),this.dSignerIdentifier=null,this.dDigestAlgorithm=null,this.dSignedAttrs=new j,this.dSigAlg=null,this.dSig=null,this.dUnsignedAttrs=new j,this.setSignerIdentifier=function(p){if("string"==typeof p&&-1!=p.indexOf("CERTIFICATE")&&-1!=p.indexOf("BEGIN")&&-1!=p.indexOf("END")){this.dSignerIdentifier=new n.IssuerAndSerialNumber({cert:p})}},this.setForContentAndHash=function(o){void 0!==o&&(o.eciObj instanceof k&&(this.dSignedAttrs.add(new g({oid:"1.2.840.113549.1.7.1"})),this.dSignedAttrs.add(new c({eciObj:o.eciObj,hashAlg:o.hashAlg}))),void 0!==o.sdObj&&o.sdObj instanceof l&&-1==o.sdObj.digestAlgNameList.join(":").indexOf(o.hashAlg)&&o.sdObj.digestAlgNameList.push(o.hashAlg),"string"==typeof o.hashAlg&&(this.dDigestAlgorithm=new m({name:o.hashAlg})))},this.sign=function(t,p){this.dSigAlg=new m({name:p});var q=this.dSignedAttrs.getEncodedHex(),o=i.getKey(t),s=new f.Signature({alg:p});s.init(o),s.updateHex(q);var r=s.sign();this.dSig=new h.DEROctetString({hex:r})},this.addUnsigned=function(o){this.hTLV=null,this.dUnsignedAttrs.hTLV=null,this.dUnsignedAttrs.add(o)},this.getEncodedHex=function(){if(this.dSignedAttrs instanceof j&&0==this.dSignedAttrs.length())throw"SignedAttrs length = 0 (empty)";var o=new b({obj:this.dSignedAttrs,tag:"a0",explicit:!1}),r=null;this.dUnsignedAttrs.length()>0&&(r=new b({obj:this.dUnsignedAttrs,tag:"a1",explicit:!1}));var q=[this.dCMSVersion,this.dSignerIdentifier,this.dDigestAlgorithm,o,this.dSigAlg,this.dSig];null!=r&&q.push(r);var p=new h.DERSequence({array:q});return this.hTLV=p.getEncodedHex(),this.hTLV}},YAHOO.lang.extend(KJUR.asn1.cms.SignerInfo,KJUR.asn1.ASN1Object),KJUR.asn1.cms.EncapsulatedContentInfo=function(g){var b=KJUR.asn1,e=b.DERTaggedObject,a=b.DERSequence,h=b.DERObjectIdentifier,d=b.DEROctetString;b.cms.EncapsulatedContentInfo.superclass.constructor.call(this),this.dEContentType=new h({name:"data"}),this.dEContent=null,this.isDetached=!1,this.eContentValueHex=null,this.setContentType=function(i){i.match(/^[0-2][.][0-9.]+$/)?this.dEContentType=new h({oid:i}):this.dEContentType=new h({name:i})},this.setContentValue=function(i){void 0!==i&&("string"==typeof i.hex?this.eContentValueHex=i.hex:"string"==typeof i.str&&(this.eContentValueHex=utf8tohex(i.str)))},this.setContentValueHex=function(i){this.eContentValueHex=i},this.setContentValueStr=function(i){this.eContentValueHex=utf8tohex(i)},this.getEncodedHex=function(){if("string"!=typeof this.eContentValueHex)throw"eContentValue not yet set";var k=new d({hex:this.eContentValueHex});this.dEContent=new e({obj:k,tag:"a0",explicit:!0});var i=[this.dEContentType];this.isDetached||i.push(this.dEContent);var j=new a({array:i});return this.hTLV=j.getEncodedHex(),this.hTLV}},YAHOO.lang.extend(KJUR.asn1.cms.EncapsulatedContentInfo,KJUR.asn1.ASN1Object),KJUR.asn1.cms.ContentInfo=function(f){var b=KJUR.asn1,d=b.DERTaggedObject,a=b.DERSequence,e=b.x509;KJUR.asn1.cms.ContentInfo.superclass.constructor.call(this),this.dContentType=null,this.dContent=null,this.setContentType=function(g){"string"==typeof g&&(this.dContentType=e.OID.name2obj(g))},this.getEncodedHex=function(){var h=new d({obj:this.dContent,tag:"a0",explicit:!0}),g=new a({array:[this.dContentType,h]});return this.hTLV=g.getEncodedHex(),this.hTLV},void 0!==f&&(f.type&&this.setContentType(f.type),f.obj&&f.obj instanceof b.ASN1Object&&(this.dContent=f.obj))},YAHOO.lang.extend(KJUR.asn1.cms.ContentInfo,KJUR.asn1.ASN1Object),KJUR.asn1.cms.SignedData=function(e){var h=KJUR.asn1,j=h.ASN1Object,g=h.DERInteger,m=h.DERSet,f=h.DERSequence,b=h.DERTaggedObject,l=h.cms,i=l.EncapsulatedContentInfo,d=l.SignerInfo,n=l.ContentInfo,k=h.x509.AlgorithmIdentifier;KJUR.asn1.cms.SignedData.superclass.constructor.call(this),this.dCMSVersion=new g({int:1}),this.dDigestAlgs=null,this.digestAlgNameList=[],this.dEncapContentInfo=new i,this.dCerts=null,this.certificateList=[],this.crlList=[],this.signerInfoList=[new d],this.addCertificatesByPEM=function(p){var q=pemtohex(p),r=new j;r.hTLV=q,this.certificateList.push(r)},this.getEncodedHex=function(){if("string"==typeof this.hTLV)return this.hTLV;if(null==this.dDigestAlgs){for(var u=[],t=0;t<this.digestAlgNameList.length;t++){var s=this.digestAlgNameList[t],w=new k({name:s});u.push(w)}this.dDigestAlgs=new m({array:u})}var p=[this.dCMSVersion,this.dDigestAlgs,this.dEncapContentInfo];if(null==this.dCerts&&this.certificateList.length>0){var v=new m({array:this.certificateList});this.dCerts=new b({obj:v,tag:"a0",explicit:!1})}null!=this.dCerts&&p.push(this.dCerts);var r=new m({array:this.signerInfoList});p.push(r);var q=new f({array:p});return this.hTLV=q.getEncodedHex(),this.hTLV},this.getContentInfo=function(){return this.getEncodedHex(),new n({type:"signed-data",obj:this})},this.getContentInfoEncodedHex=function(){return this.getContentInfo().getEncodedHex()},this.getPEM=function(){return hextopem(this.getContentInfoEncodedHex(),"CMS")}},YAHOO.lang.extend(KJUR.asn1.cms.SignedData,KJUR.asn1.ASN1Object),KJUR.asn1.cms.CMSUtil=new function(){},KJUR.asn1.cms.CMSUtil.newSignedData=function(d){var j=KJUR.asn1,q=j.cms,f=q.SignerInfo,n=q.SignedData,o=q.SigningTime,a=q.SigningCertificate,p=q.SigningCertificateV2,e=j.cades.SignaturePolicyIdentifier,m=new n;if(m.dEncapContentInfo.setContentValue(d.content),"object"==typeof d.certs)for(var h=0;h<d.certs.length;h++)m.addCertificatesByPEM(d.certs[h]);m.signerInfoList=[];for(h=0;h<d.signerInfos.length;h++){var k=d.signerInfos[h],g=new f;for(attrName in g.setSignerIdentifier(k.signerCert),g.setForContentAndHash({sdObj:m,eciObj:m.dEncapContentInfo,hashAlg:k.hashAlg}),k.sAttr){var r=k.sAttr[attrName];if("SigningTime"==attrName){var l=new o(r);g.dSignedAttrs.add(l)}if("SigningCertificate"==attrName){l=new a(r);g.dSignedAttrs.add(l)}if("SigningCertificateV2"==attrName){l=new p(r);g.dSignedAttrs.add(l)}if("SignaturePolicyIdentifier"==attrName){l=new e(r);g.dSignedAttrs.add(l)}}g.sign(k.signerPrvKey,k.sigAlg),m.signerInfoList.push(g)}return m},KJUR.asn1.cms.CMSUtil.verifySignedData=function(n){var C=KJUR,p=C.asn1,s=p.cms,i=(s.SignerInfo,s.SignedData,s.SigningTime,s.SigningCertificate,s.SigningCertificateV2,p.cades.SignaturePolicyIdentifier,C.lang.String.isHex),v=ASN1HEX,h=v.getVbyList,a=v.getTLVbyList,t=v.getIdxbyList,z=v.getChildIdx,c=v.getTLV,B=v.oidname,j=C.crypto.Util.hashHex;void 0===n.cms&&i(n.cms);var E=n.cms,k=function(I,J){var F=J.idx;J.signerid_issuer1=a(I,F,[1,0],"30"),J.signerid_serial1=h(I,F,[1,1],"02"),J.hashalg=B(h(I,F,[2,0],"06"));var H=t(I,F,[3],"a0");J.idxSignedAttrs=H,f(I,J,H);var K=z(I,F).length;if(K<6)throw"malformed SignerInfo";J.sigalg=B(h(I,F,[K-2,0],"06")),J.sigval=h(I,F,[K-1],"04")},f=function(L,M,F){var J=z(L,F);M.signedAttrIdxList=J;for(var K=0;K<J.length;K++){var H,I=J[K],G=h(L,I,[0],"06");"2a864886f70d010905"===G?(H=hextoutf8(h(L,I,[1,0])),M.saSigningTime=H):"2a864886f70d010904"===G&&(H=h(L,I,[1,0],"04"),M.saMessageDigest=H)}},e=function(F,R,I,N){I.verifyDetail={};var Q=I.verifyDetail,K=R.parse.econtent,G=I.hashalg,L=I.saMessageDigest;Q.validMessageDigest=!1,j(K,G)===L&&(Q.validMessageDigest=!0),function(F,Q,J,P){var H,N=Q.parse.certsIdx;if(void 0===Q.certs){H=[],Q.certkeys=[];for(var K=z(F,N),I=0;I<K.length;I++){var M=c(F,K[I]),O=new X509;O.readCertHex(M),H[I]=O,Q.certkeys[I]=O.getPublicKey()}Q.certs=H}else H=Q.certs;Q.cccc=H.length,Q.cccci=K.length;for(I=0;I<H.length;I++){var L=O.getIssuerHex(),G=O.getSerialNumberHex();J.signerid_issuer1===L&&J.signerid_serial1===G&&(J.certkey_idx=I)}}(F,R,I),Q.validSignatureValue=!1;var H=I.sigalg,M="31"+c(F,I.idxSignedAttrs).substr(2);I.signedattrshex=M;var J=R.certs[I.certkey_idx].getPublicKey(),P=new KJUR.crypto.Signature({alg:H});P.init(J),P.updateHex(M);var O=P.verify(I.sigval);Q.validSignatureValue_isValid=O,!0===O&&(Q.validSignatureValue=!0),I.isValid=!1,Q.validMessageDigest&&Q.validSignatureValue&&(I.isValid=!0)},r={isValid:!1,parse:{}};return function(G,F){if("2a864886f70d010702"!==h(G,0,[0],"06"))return F;F.cmsType="signedData",F.econtent=h(G,0,[1,0,2,1,0]),function(J,H){for(var G,I=3;I<6;I++)if(void 0!==(G=t(J,0,[1,0,I]))){var F=J.substr(G,2);"a0"===F&&(H.certsIdx=G),"a1"===F&&(H.revinfosIdx=G),"31"===F&&(H.signerinfosIdx=G)}}(G,F),F.signerInfos=[],function(I,F){var H=F.signerinfosIdx;if(void 0!==H){var L=z(I,H);F.signerInfoIdxList=L;for(var G=0;G<L.length;G++){var J={idx:L[G]};k(I,J),F.signerInfos.push(J)}}}(G,F)}(E,r.parse),function(J,F){for(var G=F.parse.signerInfos,L=G.length,K=!0,I=0;I<L;I++){var H=G[I];e(J,F,H,I),H.isValid||(K=!1)}F.isValid=K}(E,r),r},void 0!==KJUR&&KJUR||(KJUR={}),void 0!==KJUR.asn1&&KJUR.asn1||(KJUR.asn1={}),void 0!==KJUR.asn1.tsp&&KJUR.asn1.tsp||(KJUR.asn1.tsp={}),KJUR.asn1.tsp.Accuracy=function(f){var b=KJUR.asn1,e=b.DERInteger,a=b.DERSequence,d=b.DERTaggedObject;b.tsp.Accuracy.superclass.constructor.call(this),this.seconds=null,this.millis=null,this.micros=null,this.getEncodedHex=function(){var i=null,k=null,m=null,g=[];if(null!=this.seconds&&(i=new e({int:this.seconds}),g.push(i)),null!=this.millis){var l=new e({int:this.millis});k=new d({obj:l,tag:"80",explicit:!1}),g.push(k)}if(null!=this.micros){var j=new e({int:this.micros});m=new d({obj:j,tag:"81",explicit:!1}),g.push(m)}var h=new a({array:g});return this.hTLV=h.getEncodedHex(),this.hTLV},void 0!==f&&("number"==typeof f.seconds&&(this.seconds=f.seconds),"number"==typeof f.millis&&(this.millis=f.millis),"number"==typeof f.micros&&(this.micros=f.micros))},YAHOO.lang.extend(KJUR.asn1.tsp.Accuracy,KJUR.asn1.ASN1Object),KJUR.asn1.tsp.MessageImprint=function(g){var b=KJUR.asn1,a=b.DERSequence,d=b.DEROctetString,e=b.x509.AlgorithmIdentifier;b.tsp.MessageImprint.superclass.constructor.call(this),this.dHashAlg=null,this.dHashValue=null,this.getEncodedHex=function(){return"string"==typeof this.hTLV?this.hTLV:new a({array:[this.dHashAlg,this.dHashValue]}).getEncodedHex()},void 0!==g&&("string"==typeof g.hashAlg&&(this.dHashAlg=new e({name:g.hashAlg})),"string"==typeof g.hashValue&&(this.dHashValue=new d({hex:g.hashValue})))},YAHOO.lang.extend(KJUR.asn1.tsp.MessageImprint,KJUR.asn1.ASN1Object),KJUR.asn1.tsp.TimeStampReq=function(c){var f=KJUR.asn1,d=f.DERSequence,e=f.DERInteger,g=f.DERBoolean,i=f.DERObjectIdentifier,h=f.tsp,b=h.MessageImprint;h.TimeStampReq.superclass.constructor.call(this),this.dVersion=new e({int:1}),this.dMessageImprint=null,this.dPolicy=null,this.dNonce=null,this.certReq=!0,this.setMessageImprint=function(j){j instanceof b?this.dMessageImprint=j:"object"==typeof j&&(this.dMessageImprint=new b(j))},this.getEncodedHex=function(){if(null==this.dMessageImprint)throw"messageImprint shall be specified";var j=[this.dVersion,this.dMessageImprint];null!=this.dPolicy&&j.push(this.dPolicy),null!=this.dNonce&&j.push(this.dNonce),this.certReq&&j.push(new g);var k=new d({array:j});return this.hTLV=k.getEncodedHex(),this.hTLV},void 0!==c&&("object"==typeof c.mi&&this.setMessageImprint(c.mi),"object"==typeof c.policy&&(this.dPolicy=new i(c.policy)),"object"==typeof c.nonce&&(this.dNonce=new e(c.nonce)),"boolean"==typeof c.certreq&&(this.certReq=c.certreq))},YAHOO.lang.extend(KJUR.asn1.tsp.TimeStampReq,KJUR.asn1.ASN1Object),KJUR.asn1.tsp.TSTInfo=function(e){var i=KJUR.asn1,f=i.DERSequence,h=i.DERInteger,k=i.DERBoolean,g=i.DERGeneralizedTime,l=i.DERObjectIdentifier,j=i.tsp,d=j.MessageImprint,b=j.Accuracy,a=i.x509.X500Name;if(j.TSTInfo.superclass.constructor.call(this),this.dVersion=new h({int:1}),this.dPolicy=null,this.dMessageImprint=null,this.dSerialNumber=null,this.dGenTime=null,this.dAccuracy=null,this.dOrdering=null,this.dNonce=null,this.dTsa=null,this.getEncodedHex=function(){var m=[this.dVersion];if(null==this.dPolicy)throw"policy shall be specified.";if(m.push(this.dPolicy),null==this.dMessageImprint)throw"messageImprint shall be specified.";if(m.push(this.dMessageImprint),null==this.dSerialNumber)throw"serialNumber shall be specified.";if(m.push(this.dSerialNumber),null==this.dGenTime)throw"genTime shall be specified.";m.push(this.dGenTime),null!=this.dAccuracy&&m.push(this.dAccuracy),null!=this.dOrdering&&m.push(this.dOrdering),null!=this.dNonce&&m.push(this.dNonce),null!=this.dTsa&&m.push(this.dTsa);var n=new f({array:m});return this.hTLV=n.getEncodedHex(),this.hTLV},void 0!==e){if("string"==typeof e.policy){if(!e.policy.match(/^[0-9.]+$/))throw"policy shall be oid like 0.1.4.134";this.dPolicy=new l({oid:e.policy})}void 0!==e.messageImprint&&(this.dMessageImprint=new d(e.messageImprint)),void 0!==e.serialNumber&&(this.dSerialNumber=new h(e.serialNumber)),void 0!==e.genTime&&(this.dGenTime=new g(e.genTime)),void 0!==e.accuracy&&(this.dAccuracy=new b(e.accuracy)),void 0!==e.ordering&&1==e.ordering&&(this.dOrdering=new k),void 0!==e.nonce&&(this.dNonce=new h(e.nonce)),void 0!==e.tsa&&(this.dTsa=new a(e.tsa))}},YAHOO.lang.extend(KJUR.asn1.tsp.TSTInfo,KJUR.asn1.ASN1Object),KJUR.asn1.tsp.TimeStampResp=function(g){var d=KJUR.asn1,c=d.DERSequence,f=d.ASN1Object,a=d.tsp,b=a.PKIStatusInfo;a.TimeStampResp.superclass.constructor.call(this),this.dStatus=null,this.dTST=null,this.getEncodedHex=function(){if(null==this.dStatus)throw"status shall be specified";var h=[this.dStatus];null!=this.dTST&&h.push(this.dTST);var i=new c({array:h});return this.hTLV=i.getEncodedHex(),this.hTLV},void 0!==g&&("object"==typeof g.status&&(this.dStatus=new b(g.status)),void 0!==g.tst&&g.tst instanceof f&&(this.dTST=g.tst.getContentInfo()))},YAHOO.lang.extend(KJUR.asn1.tsp.TimeStampResp,KJUR.asn1.ASN1Object),KJUR.asn1.tsp.PKIStatusInfo=function(h){var f=KJUR.asn1,e=f.DERSequence,a=f.tsp,d=a.PKIStatus,c=a.PKIFreeText,b=a.PKIFailureInfo;a.PKIStatusInfo.superclass.constructor.call(this),this.dStatus=null,this.dStatusString=null,this.dFailureInfo=null,this.getEncodedHex=function(){if(null==this.dStatus)throw"status shall be specified";var i=[this.dStatus];null!=this.dStatusString&&i.push(this.dStatusString),null!=this.dFailureInfo&&i.push(this.dFailureInfo);var j=new e({array:i});return this.hTLV=j.getEncodedHex(),this.hTLV},void 0!==h&&("object"==typeof h.status&&(this.dStatus=new d(h.status)),"object"==typeof h.statstr&&(this.dStatusString=new c({array:h.statstr})),"object"==typeof h.failinfo&&(this.dFailureInfo=new b(h.failinfo)))},YAHOO.lang.extend(KJUR.asn1.tsp.PKIStatusInfo,KJUR.asn1.ASN1Object),KJUR.asn1.tsp.PKIStatus=function(h){var c=KJUR.asn1,g=c.DERInteger,a=c.tsp,b=a.PKIStatus;a.PKIStatus.superclass.constructor.call(this);if(this.getEncodedHex=function(){return this.hTLV=this.dStatus.getEncodedHex(),this.hTLV},void 0!==h)if(void 0!==h.name){var e=b.valueList;if(void 0===e[h.name])throw"name undefined: "+h.name;this.dStatus=new g({int:e[h.name]})}else this.dStatus=new g(h)},YAHOO.lang.extend(KJUR.asn1.tsp.PKIStatus,KJUR.asn1.ASN1Object),KJUR.asn1.tsp.PKIStatus.valueList={granted:0,grantedWithMods:1,rejection:2,waiting:3,revocationWarning:4,revocationNotification:5},KJUR.asn1.tsp.PKIFreeText=function(f){var d=KJUR.asn1,b=d.DERSequence,c=d.DERUTF8String;d.tsp.PKIFreeText.superclass.constructor.call(this),this.textList=[],this.getEncodedHex=function(){for(var g=[],j=0;j<this.textList.length;j++)g.push(new c({str:this.textList[j]}));var h=new b({array:g});return this.hTLV=h.getEncodedHex(),this.hTLV},void 0!==f&&"object"==typeof f.array&&(this.textList=f.array)},YAHOO.lang.extend(KJUR.asn1.tsp.PKIFreeText,KJUR.asn1.ASN1Object),KJUR.asn1.tsp.PKIFailureInfo=function(g){var c=KJUR.asn1,f=c.DERBitString,b=c.tsp.PKIFailureInfo;if(b.superclass.constructor.call(this),this.value=null,this.getEncodedHex=function(){if(null==this.value)throw"value shall be specified";var h=new Number(this.value).toString(2),i=new f;return i.setByBinaryString(h),this.hTLV=i.getEncodedHex(),this.hTLV},void 0!==g)if("string"==typeof g.name){var e=b.valueList;if(void 0===e[g.name])throw"name undefined: "+g.name;this.value=e[g.name]}else"number"==typeof g.int&&(this.value=g.int)},YAHOO.lang.extend(KJUR.asn1.tsp.PKIFailureInfo,KJUR.asn1.ASN1Object),KJUR.asn1.tsp.PKIFailureInfo.valueList={badAlg:0,badRequest:2,badDataFormat:5,timeNotAvailable:14,unacceptedPolicy:15,unacceptedExtension:16,addInfoNotAvailable:17,systemFailure:25},KJUR.asn1.tsp.AbstractTSAAdapter=function(a){this.getTSTHex=function(c,b){throw"not implemented yet"}},KJUR.asn1.tsp.SimpleTSAAdapter=function(e){var d=KJUR,a=d.asn1.tsp,b=d.crypto.Util.hashHex;a.SimpleTSAAdapter.superclass.constructor.call(this),this.params=null,this.serial=0,this.getTSTHex=function(g,f){var i=b(g,f);this.params.tstInfo.messageImprint={hashAlg:f,hashValue:i},this.params.tstInfo.serialNumber={int:this.serial++};var h=Math.floor(1e9*Math.random());return this.params.tstInfo.nonce={int:h},a.TSPUtil.newTimeStampToken(this.params).getContentInfoEncodedHex()},void 0!==e&&(this.params=e)},YAHOO.lang.extend(KJUR.asn1.tsp.SimpleTSAAdapter,KJUR.asn1.tsp.AbstractTSAAdapter),KJUR.asn1.tsp.FixedTSAAdapter=function(e){var d=KJUR,a=d.asn1.tsp,b=d.crypto.Util.hashHex;a.FixedTSAAdapter.superclass.constructor.call(this),this.params=null,this.getTSTHex=function(g,f){var h=b(g,f);return this.params.tstInfo.messageImprint={hashAlg:f,hashValue:h},a.TSPUtil.newTimeStampToken(this.params).getContentInfoEncodedHex()},void 0!==e&&(this.params=e)},YAHOO.lang.extend(KJUR.asn1.tsp.FixedTSAAdapter,KJUR.asn1.tsp.AbstractTSAAdapter),KJUR.asn1.tsp.TSPUtil=new function(){},KJUR.asn1.tsp.TSPUtil.newTimeStampToken=function(c){var h=KJUR.asn1,m=h.cms,a=(h.tsp,h.tsp.TSTInfo),j=new m.SignedData,f=new a(c.tstInfo).getEncodedHex();if(j.dEncapContentInfo.setContentValue({hex:f}),j.dEncapContentInfo.setContentType("tstinfo"),"object"==typeof c.certs)for(var e=0;e<c.certs.length;e++)j.addCertificatesByPEM(c.certs[e]);var d=j.signerInfoList[0];d.setSignerIdentifier(c.signerCert),d.setForContentAndHash({sdObj:j,eciObj:j.dEncapContentInfo,hashAlg:c.hashAlg});var l=new m.SigningCertificate({array:[c.signerCert]});return d.dSignedAttrs.add(l),d.sign(c.signerPrvKey,c.sigAlg),j},KJUR.asn1.tsp.TSPUtil.parseTimeStampReq=function(m){var l=ASN1HEX,h=l.getChildIdx,f=l.getV,b=l.getTLV,j={certreq:!1},a=h(m,0);if(a.length<2)throw"TimeStampReq must have at least 2 items";var e=b(m,a[1]);j.mi=KJUR.asn1.tsp.TSPUtil.parseMessageImprint(e);for(var d=2;d<a.length;d++){var g=a[d],k=m.substr(g,2);if("06"==k){var c=f(m,g);j.policy=l.hextooidstr(c)}"02"==k&&(j.nonce=f(m,g)),"01"==k&&(j.certreq=!0)}return j},KJUR.asn1.tsp.TSPUtil.parseMessageImprint=function(c){var m=ASN1HEX,j=m.getChildIdx,i=m.getV,g=m.getIdxbyList,k={};if("30"!=c.substr(0,2))throw"head of messageImprint hex shall be '30'";j(c,0);var e=i(c,g(c,0,[0,0])),d=m.hextooidstr(e),h=KJUR.asn1.x509.OID.oid2name(d);if(""==h)throw"hashAlg name undefined: "+d;var b=h,f=g(c,0,[1]);return k.hashAlg=b,k.hashValue=i(c,f),k},void 0!==KJUR&&KJUR||(KJUR={}),void 0!==KJUR.asn1&&KJUR.asn1||(KJUR.asn1={}),void 0!==KJUR.asn1.cades&&KJUR.asn1.cades||(KJUR.asn1.cades={}),KJUR.asn1.cades.SignaturePolicyIdentifier=function(f){var h=KJUR.asn1,i=h.DERObjectIdentifier,g=h.DERSequence,e=h.cades,c=e.OtherHashAlgAndValue;if(e.SignaturePolicyIdentifier.superclass.constructor.call(this),this.attrTypeOid="1.2.840.113549.1.9.16.2.15",void 0!==f&&"string"==typeof f.oid&&"object"==typeof f.hash){var j=new g({array:[new i({oid:f.oid}),new c(f.hash)]});this.valueList=[j]}},YAHOO.lang.extend(KJUR.asn1.cades.SignaturePolicyIdentifier,KJUR.asn1.cms.Attribute),KJUR.asn1.cades.OtherHashAlgAndValue=function(e){var g=KJUR.asn1,f=g.DERSequence,h=g.DEROctetString,i=g.x509.AlgorithmIdentifier;g.cades.OtherHashAlgAndValue.superclass.constructor.call(this),this.dAlg=null,this.dHash=null,this.getEncodedHex=function(){var j=new f({array:[this.dAlg,this.dHash]});return this.hTLV=j.getEncodedHex(),this.hTLV},void 0!==e&&"string"==typeof e.alg&&"string"==typeof e.hash&&(this.dAlg=new i({name:e.alg}),this.dHash=new h({hex:e.hash}))},YAHOO.lang.extend(KJUR.asn1.cades.OtherHashAlgAndValue,KJUR.asn1.ASN1Object),KJUR.asn1.cades.SignatureTimeStamp=function(h){var b=KJUR.asn1,e=b.ASN1Object;b.x509;if(b.cades.SignatureTimeStamp.superclass.constructor.call(this),this.attrTypeOid="1.2.840.113549.1.9.16.2.14",this.tstHex=null,void 0!==h){if(void 0!==h.res)if("string"==typeof h.res&&h.res.match(/^[0-9A-Fa-f]+$/));else if(!(h.res instanceof e))throw"res param shall be ASN1Object or hex string";if(void 0!==h.tst)if("string"==typeof h.tst&&h.tst.match(/^[0-9A-Fa-f]+$/)){var f=new e;this.tstHex=h.tst,f.hTLV=this.tstHex,f.getEncodedHex(),this.valueList=[f]}else if(!(h.tst instanceof e))throw"tst param shall be ASN1Object or hex string"}},YAHOO.lang.extend(KJUR.asn1.cades.SignatureTimeStamp,KJUR.asn1.cms.Attribute),KJUR.asn1.cades.CompleteCertificateRefs=function(d){var a=KJUR.asn1.cades;a.CompleteCertificateRefs.superclass.constructor.call(this),this.attrTypeOid="1.2.840.113549.1.9.16.2.21",this.setByArray=function(e){this.valueList=[];for(var f=0;f<e.length;f++){var g=new a.OtherCertID(e[f]);this.valueList.push(g)}},void 0!==d&&"object"==typeof d&&"number"==typeof d.length&&this.setByArray(d)},YAHOO.lang.extend(KJUR.asn1.cades.CompleteCertificateRefs,KJUR.asn1.cms.Attribute),KJUR.asn1.cades.OtherCertID=function(e){var b=KJUR.asn1,d=b.cms,a=b.cades;a.OtherCertID.superclass.constructor.call(this),this.hasIssuerSerial=!0,this.dOtherCertHash=null,this.dIssuerSerial=null,this.setByCertPEM=function(f){this.dOtherCertHash=new a.OtherHash(f),this.hasIssuerSerial&&(this.dIssuerSerial=new d.IssuerAndSerialNumber(f))},this.getEncodedHex=function(){if(null!=this.hTLV)return this.hTLV;if(null==this.dOtherCertHash)throw"otherCertHash not set";var f=[this.dOtherCertHash];null!=this.dIssuerSerial&&f.push(this.dIssuerSerial);var g=new b.DERSequence({array:f});return this.hTLV=g.getEncodedHex(),this.hTLV},void 0!==e&&("string"==typeof e&&-1!=e.indexOf("-----BEGIN ")&&this.setByCertPEM(e),"object"==typeof e&&(!1===e.hasis&&(this.hasIssuerSerial=!1),"string"==typeof e.cert&&this.setByCertPEM(e.cert)))},YAHOO.lang.extend(KJUR.asn1.cades.OtherCertID,KJUR.asn1.ASN1Object),KJUR.asn1.cades.OtherHash=function(f){var d=KJUR,c=d.asn1,b=(c.cms,c.cades),g=b.OtherHashAlgAndValue,a=d.crypto.Util.hashHex;if(b.OtherHash.superclass.constructor.call(this),this.alg="sha256",this.dOtherHash=null,this.setByCertPEM=function(h){if(-1==h.indexOf("-----BEGIN "))throw"certPEM not to seem PEM format";var i=pemtohex(h),j=a(i,this.alg);this.dOtherHash=new g({alg:this.alg,hash:j})},this.getEncodedHex=function(){if(null==this.dOtherHash)throw"OtherHash not set";return this.dOtherHash.getEncodedHex()},void 0!==f)if("string"==typeof f)if(-1!=f.indexOf("-----BEGIN "))this.setByCertPEM(f);else{if(!f.match(/^[0-9A-Fa-f]+$/))throw"unsupported string value for params";this.dOtherHash=new c.DEROctetString({hex:f})}else"object"==typeof f&&("string"==typeof f.cert?("string"==typeof f.alg&&(this.alg=f.alg),this.setByCertPEM(f.cert)):this.dOtherHash=new g(f))},YAHOO.lang.extend(KJUR.asn1.cades.OtherHash,KJUR.asn1.ASN1Object),KJUR.asn1.cades.CAdESUtil=new function(){},KJUR.asn1.cades.CAdESUtil.addSigTS=function(c,b,a){},KJUR.asn1.cades.CAdESUtil.parseSignedDataForAddingUnsigned=function(e){var p=ASN1HEX,u=p.getChildIdx,b=p.getTLV,a=p.getTLVbyList,k=p.getIdxbyList,g=KJUR.asn1,l=g.ASN1Object,h=g.cms.SignedData,z=g.cades.CAdESUtil,m={};if("06092a864886f70d010702"!=a(e,0,[0]))throw"hex is not CMS SignedData";var B=u(e,k(e,0,[1,0]));if(B.length<4)throw"num of SignedData elem shall be 4 at least";var d=B.shift();m.version=b(e,d);var w=B.shift();m.algs=b(e,w);var c=B.shift();m.encapcontent=b(e,c),m.certs=null,m.revs=null,m.si=[];var o=B.shift();"a0"==e.substr(o,2)&&(m.certs=b(e,o),o=B.shift()),"a1"==e.substr(o,2)&&(m.revs=b(e,o),o=B.shift());var t=o;if("31"!=e.substr(t,2))throw"Can't find signerInfos
";for(var f=u(e,t),q=0;q<f.length;q++){var s=f[q],n=z.parseSignerInfoForAddingUnsigned(e,s,q);m.si[q]=n}var x=null;m.obj=new h,(x=new l).hTLV=m.version,m.obj.dCMSVersion=x,(x=new l).hTLV=m.algs,m.obj.dDigestAlgs=x,(x=new l).hTLV=m.encapcontent,m.obj.dEncapContentInfo=x,(x=new l).hTLV=m.certs,m.obj.dCerts=x,m.obj.signerInfoList=[];for(q=0;q<m.si.length;q++)m.obj.signerInfoList.push(m.si[q].obj);return m},KJUR.asn1.cades.CAdESUtil.parseSignerInfoForAddingUnsigned=function(g,q,c){var p=ASN1HEX,s=p.getChildIdx,a=p.getTLV,l=p.getV,h=KJUR.asn1,n=h.ASN1Object,j=h.cms,k=j.AttributeList,w=j.SignerInfo,o={},t=s(g,q);if(6!=t.length)throw"not supported items
for SignerInfo (!=6)";var d=t.shift();o.version=a(g,d);var e=t.shift();o.si=a(g,e);var m=t.shift();o.digalg=a(g,m);var f=t.shift();o.sattrs=a(g,f);var i=t.shift();o.sigalg=a(g,i);var b=t.shift();o.sig=a(g,b),o.sigval=l(g,b);var u=null;return o.obj=new w,(u=new n).hTLV=o.version,o.obj.dCMSVersion=u,(u=new n).hTLV=o.si,o.obj.dSignerIdentifier=u,(u=new n).hTLV=o.digalg,o.obj.dDigestAlgorithm=u,(u=new n).hTLV=o.sattrs,o.obj.dSignedAttrs=u,(u=new n).hTLV=o.sigalg,o.obj.dSigAlg=u,(u=new n).hTLV=o.sig,o.obj.dSig=u,o.obj.dUnsignedAttrs=new k,o},void 0!==KJUR.asn1.csr&&KJUR.asn1.csr||(KJUR.asn1.csr={}),KJUR.asn1.csr.CertificationRequest=function(d){var a=KJUR,f=a.asn1,b=f.DERBitString,e=f.DERSequence,k=f.csr,c=f.x509;k.CertificationRequest.superclass.constructor.call(this);this.sign=function(o,n){null==this.prvKey&&(this.prvKey=n),this.asn1SignatureAlg=new c.AlgorithmIdentifier({name:o}),sig=new a.crypto.Signature({alg:o}),sig.init(this.prvKey),sig.updateHex(this.asn1CSRInfo.getEncodedHex()),this.hexSig=sig.sign(),this.asn1Sig=new b({hex:"00"+this.hexSig});var m=new e({array:[this.asn1CSRInfo,this.asn1SignatureAlg,this.asn1Sig]});this.hTLV=m.getEncodedHex(),this.isModified=!1},this.getPEMString=function(){return hextopem(this.getEncodedHex(),"CERTIFICATE REQUEST
")},this.getEncodedHex=function(){if(0==this.isModified&&null!=this.hTLV)return this.hTLV;throw"not signed yet
"},void 0!==d&&void 0!==d.csrinfo&&(this.asn1CSRInfo=d.csrinfo)},YAHOO.lang.extend(KJUR.asn1.csr.CertificationRequest,KJUR.asn1.ASN1Object),KJUR.asn1.csr.CertificationRequestInfo=function(e){var h=KJUR.asn1,g=h.DERInteger,f=h.DERSequence,m=h.DERSet,j=h.DERNull,c=h.DERTaggedObject,k=h.DERObjectIdentifier,l=h.csr,d=h.x509,a=d.X500Name,n=d.Extension,i=KEYUTIL;l.CertificationRequestInfo.superclass.constructor.call(this),this._initialize=function(){this.asn1Array=new Array,this.asn1Version=new g({int:0}),this.asn1Subject=null,this.asn1SubjPKey=null,this.extensionsArray=new Array},this.setSubjectByParam=function(o){this.asn1Subject=new a(o)},this.setSubjectPublicKeyByGetKey=function(p){var o=i.getKey(p);this.asn1SubjPKey=new d.SubjectPublicKeyInfo(o)},this.appendExtensionByName=function(p,o){n.appendByNameToArray(p,o,this.extensionsArray)},this.getEncodedHex=function(){if(this.asn1Array=new Array,this.asn1Array.push(this.asn1Version),this.asn1Array.push(this.asn1Subject),this.asn1Array.push(this.asn1SubjPKey),this.extensionsArray.length>0){var s=new f({array:this.extensionsArray}),r=new m({array:[s]}),q=new f({array:[new k({oid:"1.2.840.113549.1.9.14"}),r]}),p=new c({explicit:!0,tag:"a0
",obj:q});this.asn1Array.push(p)}else{p=new c({explicit:!1,tag:"a0
",obj:new j});this.asn1Array.push(p)}var t=new f({array:this.asn1Array});return this.hTLV=t.getEncodedHex(),this.isModified=!1,this.hTLV},this._initialize()},YAHOO.lang.extend(KJUR.asn1.csr.CertificationRequestInfo,KJUR.asn1.ASN1Object),KJUR.asn1.csr.CSRUtil=new function(){},KJUR.asn1.csr.CSRUtil.newCSRPEM=function(h){var c=KEYUTIL,b=KJUR.asn1.csr;if(void 0===h.subject)throw"parameter subject
undefined";if(void 0===h.sbjpubkey)throw"parameter sbjpubkey
undefined";if(void 0===h.sigalg)throw"parameter sigalg
undefined";if(void 0===h.sbjprvkey)throw"parameter sbjpubkey
undefined";var d=new b.CertificationRequestInfo;if(d.setSubjectByParam(h.subject),d.setSubjectPublicKeyByGetKey(h.sbjpubkey),void 0!==h.ext&&void 0!==h.ext.length)for(var e=0;e<h.ext.length;e++)for(key in h.ext[e])d.appendExtensionByName(key,h.ext[e][key]);var f=new b.CertificationRequest({csrinfo:d}),a=c.getKey(h.sbjprvkey);return f.sign(h.sigalg,a),f.getPEMString()},KJUR.asn1.csr.CSRUtil.getInfo=function(b){var e=ASN1HEX.getTLVbyList,a={subject:{},pubkey:{}};if(-1==b.indexOf("-----BEGIN CERTIFICATE REQUEST
"))throw"argument is not PEM file
";var c=pemtohex(b,"CERTIFICATE REQUEST
");return a.subject.hex=e(c,0,[0,1]),a.subject.name=X509.hex2dn(a.subject.hex),a.pubkey.hex=e(c,0,[0,2]),a.pubkey.obj=KEYUTIL.getKey(a.pubkey.hex,null,"pkcs8pub
"),a},void 0!==KJUR&&KJUR||(KJUR={}),void 0!==KJUR.asn1&&KJUR.asn1||(KJUR.asn1={}),void 0!==KJUR.asn1.ocsp&&KJUR.asn1.ocsp||(KJUR.asn1.ocsp={}),KJUR.asn1.ocsp.DEFAULT_HASH="sha1
",KJUR.asn1.ocsp.CertID=function(g){var d=KJUR,k=d.asn1,m=k.DEROctetString,j=k.DERInteger,h=k.DERSequence,n=k.x509.AlgorithmIdentifier,o=k.ocsp,l=o.DEFAULT_HASH,e=d.crypto.Util.hashHex,c=X509,q=ASN1HEX;if(o.CertID.superclass.constructor.call(this),this.dHashAlg=null,this.dIssuerNameHash=null,this.dIssuerKeyHash=null,this.dSerialNumber=null,this.setByValue=function(t,s,p,r){void 0===r&&(r=l),this.dHashAlg=new n({name:r}),this.dIssuerNameHash=new m({hex:t}),this.dIssuerKeyHash=new m({hex:s}),this.dSerialNumber=new j({hex:p})},this.setByCert=function(x,t,v){void 0===v&&(v=l);var p=new c;p.readCertPEM(t);var y=new c;y.readCertPEM(x);var z=y.getPublicKeyHex(),w=q.getTLVbyList(z,0,[1,0],"30"),r=p.getSerialNumberHex(),s=e(y.getSubjectHex(),v),u=e(w,v);this.setByValue(s,u,r,v),this.hoge=p.getSerialNumberHex()},this.getEncodedHex=function(){if(null===this.dHashAlg&&null===this.dIssuerNameHash&&null===this.dIssuerKeyHash&&null===this.dSerialNumber)throw"not yet
set values
";var p=[this.dHashAlg,this.dIssuerNameHash,this.dIssuerKeyHash,this.dSerialNumber],r=new h({array:p});return this.hTLV=r.getEncodedHex(),this.hTLV},void 0!==g){var b=g;if(void 0!==b.issuerCert&&void 0!==b.subjectCert){var a=l;void 0===b.alg&&(a=void 0),this.setByCert(b.issuerCert,b.subjectCert,a)}else{if(void 0===b.namehash||void 0===b.keyhash||void 0===b.serial)throw"invalid
constructor arguments
";a=l;void 0===b.alg&&(a=void 0),this.setByValue(b.namehash,b.keyhash,b.serial,a)}}},YAHOO.lang.extend(KJUR.asn1.ocsp.CertID,KJUR.asn1.ASN1Object),KJUR.asn1.ocsp.Request=function(f){var b=KJUR.asn1,a=b.DERSequence,d=b.ocsp;if(d.Request.superclass.constructor.call(this),this.dReqCert=null,this.dExt=null,this.getEncodedHex=function(){var g=[];if(null===this.dReqCert)throw"reqCert not
set";g.push(this.dReqCert);var h=new a({array:g});return this.hTLV=h.getEncodedHex(),this.hTLV},void 0!==f){var e=new d.CertID(f);this.dReqCert=e}},YAHOO.lang.extend(KJUR.asn1.ocsp.Request,KJUR.asn1.ASN1Object),KJUR.asn1.ocsp.TBSRequest=function(e){var b=KJUR.asn1,a=b.DERSequence,d=b.ocsp;d.TBSRequest.superclass.constructor.call(this),this.version=0,this.dRequestorName=null,this.dRequestList=[],this.dRequestExt=null,this.setRequestListByParam=function(h){for(var f=[],g=0;g<h.length;g++){var j=new d.Request(h[0]);f.push(j)}this.dRequestList=f},this.getEncodedHex=function(){var f=[];if(0!==this.version)throw"not supported
version: "+this.version;if(null!==this.dRequestorName)throw"requestorName not supported
";var h=new a({array:this.dRequestList});if(f.push(h),null!==this.dRequestExt)throw"requestExtensions not supported
";var g=new a({array:f});return this.hTLV=g.getEncodedHex(),this.hTLV},void 0!==e&&void 0!==e.reqList&&this.setRequestListByParam(e.reqList)},YAHOO.lang.extend(KJUR.asn1.ocsp.TBSRequest,KJUR.asn1.ASN1Object),KJUR.asn1.ocsp.OCSPRequest=function(f){var b=KJUR.asn1,a=b.DERSequence,d=b.ocsp;if(d.OCSPRequest.superclass.constructor.call(this),this.dTbsRequest=null,this.dOptionalSignature=null,this.getEncodedHex=function(){var g=[];if(null===this.dTbsRequest)throw"tbsRequest not
set";if(g.push(this.dTbsRequest),null!==this.dOptionalSignature)throw"optionalSignature not supported
";var h=new a({array:g});return this.hTLV=h.getEncodedHex(),this.hTLV},void 0!==f&&void 0!==f.reqList){var e=new d.TBSRequest(f);this.dTbsRequest=e}},YAHOO.lang.extend(KJUR.asn1.ocsp.OCSPRequest,KJUR.asn1.ASN1Object),KJUR.asn1.ocsp.OCSPUtil={},KJUR.asn1.ocsp.OCSPUtil.getRequestHex=function(a,b,h){var e=KJUR.asn1.ocsp;void 0===h&&(h=e.DEFAULT_HASH);var g={alg:h,issuerCert:a,subjectCert:b};return new e.OCSPRequest({reqList:[g]}).getEncodedHex()},KJUR.asn1.ocsp.OCSPUtil.getOCSPResponseInfo=function(b){var k=ASN1HEX,c=k.getVbyList,d=k.getIdxbyList,f=(c=k.getVbyList,k.getV),l={};try{var i=c(b,0,[0],"0a
");l.responseStatus=parseInt(i,16)}catch(e){}if(0!==l.responseStatus)return l;try{var g=d(b,0,[1,0,1,0,0,2,0,1]);"80"===b.substr(g,2)?l.certStatus="good
":"a1
"===b.substr(g,2)?(l.certStatus="revoked
",l.revocationTime=hextoutf8(c(b,g,[0]))):"82"===b.substr(g,2)&&(l.certStatus="unknown
")}catch(e){}try{var a=d(b,0,[1,0,1,0,0,2,0,2]);l.thisUpdate=hextoutf8(f(b,a))}catch(e){}try{var j=d(b,0,[1,0,1,0,0,2,0,3]);"a0
"===b.substr(j,2)&&(l.nextUpdate=hextoutf8(c(b,j,[0])))}catch(e){}return l},void 0!==KJUR&&KJUR||(KJUR={}),void 0!==KJUR.lang&&KJUR.lang||(KJUR.lang={}),KJUR.lang.String=function(){},"function"==typeof Buffer?(utf8tob64u=function(a){return b64tob64u(new Buffer(a,"utf8
").toString("base64
"))},b64utoutf8=function(a){return new Buffer(b64utob64(a),"base64
").toString("utf8
")}):(utf8tob64u=function(a){return hextob64u(uricmptohex(encodeURIComponentAll(a)))},b64utoutf8=function(a){return decodeURIComponent(hextouricmp(b64utohex(a)))}),KJUR.lang.String.isInteger=function(a){return!!a.match(/^[0-9]+$/)||!!a.match(/^-[0-9]+$/)},KJUR.lang.String.isHex=function(a){return!(a.length%2!=0||!a.match(/^[0-9a-f]+$/)&&!a.match(/^[0-9A-F]+$/))},KJUR.lang.String.isBase64=function(a){return!(!(a=a.replace(/\s+/g,"")).match(/^[0-9A-Za-z+\/]+={0,3}$/)||a.length%4!=0)},KJUR.lang.String.isBase64URL=function(a){return!a.match(/[+/=]/)&&(a=b64utob64(a),KJUR.lang.String.isBase64(a))},KJUR.lang.String.isIntegerArray=function(a){return!!(a=a.replace(/\s+/g,"")).match(/^\[[0-9,]+\]$/)};void 0!==KJUR&&KJUR||(KJUR={}),void 0!==KJUR.crypto&&KJUR.crypto||(KJUR.crypto={}),KJUR.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
",SHA1withRSAandMGF1:"cryptojs
/jsrsa",SHA224withRSAandMGF1:"cryptojs/jsrsa
",SHA256withRSAandMGF1:"cryptojs
/jsrsa",SHA384withRSAandMGF1:"cryptojs/jsrsa
",SHA512withRSAandMGF1:"cryptojs
/jsrsa",RIPEMD160withRSAandMGF1:"cryptojs/jsrsa
"},this.CRYPTOJSMESSAGEDIGESTNAME={md5:CryptoJS.algo.MD5,sha1:CryptoJS.algo.SHA1,sha224:CryptoJS.algo.SHA224,sha256:CryptoJS.algo.SHA256,sha384:CryptoJS.algo.SHA384,sha512:CryptoJS.algo.SHA512,ripemd160:CryptoJS.algo.RIPEMD160},this.getDigestInfoHex=function(a,b){if(void 0===this.DIGESTINFOHEAD[b])throw"alg not supported
in Util
.DIGESTINFOHEAD: "+b;return this.DIGESTINFOHEAD[b]+a},this.getPaddedDigestInfoHex=function(h,a,j){var c=this.getDigestInfoHex(h,a),d=j/4;if(c.length+22>d)throw"key is too
short for SigAlg: keylen
="+j+","+a;for(var b="0001",k="00"+c,g="",l=d-b.length-k.length,f=0;f<l;f+=2)g+="ff
";return b+g+k},this.hashString=function(a,c){return new KJUR.crypto.MessageDigest({alg:c}).digestString(a)},this.hashHex=function(b,c){return new KJUR.crypto.MessageDigest({alg:c}).digestHex(b)},this.sha1=function(a){return new KJUR.crypto.MessageDigest({alg:"sha1
",prov:"cryptojs
"}).digestString(a)},this.sha256=function(a){return new KJUR.crypto.MessageDigest({alg:"sha256
",prov:"cryptojs
"}).digestString(a)},this.sha256Hex=function(a){return new KJUR.crypto.MessageDigest({alg:"sha256
",prov:"cryptojs
"}).digestHex(a)},this.sha512=function(a){return new KJUR.crypto.MessageDigest({alg:"sha512
",prov:"cryptojs
"}).digestString(a)},this.sha512Hex=function(a){return new KJUR.crypto.MessageDigest({alg:"sha512
",prov:"cryptojs
"}).digestHex(a)}},KJUR.crypto.Util.md5=function(a){return new KJUR.crypto.MessageDigest({alg:"md5
",prov:"cryptojs
"}).digestString(a)},KJUR.crypto.Util.ripemd160=function(a){return new KJUR.crypto.MessageDigest({alg:"ripemd160
",prov:"cryptojs
"}).digestString(a)},KJUR.crypto.Util.SECURERANDOMGEN=new SecureRandom,KJUR.crypto.Util.getRandomHexOfNbytes=function(b){var a=new Array(b);return KJUR.crypto.Util.SECURERANDOMGEN.nextBytes(a),BAtohex(a)},KJUR.crypto.Util.getRandomBigIntegerOfNbytes=function(a){return new BigInteger(KJUR.crypto.Util.getRandomHexOfNbytes(a),16)},KJUR.crypto.Util.getRandomHexOfNbits=function(d){var c=d%8,b=new Array((d-c)/8+1);return KJUR.crypto.Util.SECURERANDOMGEN.nextBytes(b),b[0]=(255<<c&255^255)&b[0],BAtohex(b)},KJUR.crypto.Util.getRandomBigIntegerOfNbits=function(a){return new BigInteger(KJUR.crypto.Util.getRandomHexOfNbits(a),16)},KJUR.crypto.Util.getRandomBigIntegerZeroToMax=function(b){for(var a=b.bitLength();;){var c=KJUR.crypto.Util.getRandomBigIntegerOfNbits(a);if(-1!=b.compareTo(c))return c}},KJUR.crypto.Util.getRandomBigIntegerMinToMax=function(e,b){var c=e.compareTo(b);if(1==c)throw"biMin is greater than biMax
";if(0==c)return e;var a=b.subtract(e);return KJUR.crypto.Util.getRandomBigIntegerZeroToMax(a).add(e)},KJUR.crypto.MessageDigest=function(c){this.setAlgAndProvider=function(g,f){if(null!==(g=KJUR.crypto.MessageDigest.getCanonicalAlgName(g))&&void 0===f&&(f=KJUR.crypto.Util.DEFAULTPROVIDER[g]),-1!=":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(g)&&"cryptojs
"==f){try{this.md=KJUR.crypto.Util.CRYPTOJSMESSAGEDIGESTNAME[g].create()}catch(e){throw"setAlgAndProvider hash alg
set fail alg
="+g+"/"+e}this.updateString=function(h){this.md.update(h)},this.updateHex=function(h){var i=CryptoJS.enc.Hex.parse(h);this.md.update(i)},this.digest=function(){return this.md.finalize().toString(CryptoJS.enc.Hex)},this.digestString=function(h){return this.updateString(h),this.digest()},this.digestHex=function(h){return this.updateHex(h),this.digest()}}if(-1!=":sha256:".indexOf(g)&&"sjcl
"==f){try{this.md=new sjcl.hash.sha256}catch(e){throw"setAlgAndProvider hash alg
set fail alg
="+g+"/"+e}this.updateString=function(h){this.md.update(h)},this.updateHex=function(i){var h=sjcl.codec.hex.toBits(i);this.md.update(h)},this.digest=function(){var h=this.md.finalize();return sjcl.codec.hex.fromBits(h)},this.digestString=function(h){return this.updateString(h),this.digest()},this.digestHex=function(h){return this.updateHex(h),this.digest()}}},this.updateString=function(e){throw"updateString(str
) not supported
for this alg
/prov: "+this.algName+"/"+this.provName},this.updateHex=function(e){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(e){throw"digestString(str
) not supported
for this alg
/prov: "+this.algName+"/"+this.provName},this.digestHex=function(e){throw"digestHex(hex
) not supported
for this alg
/prov: "+this.algName+"/"+this.provName},void 0!==c&&void 0!==c.alg&&(this.algName=c.alg,void 0===c.prov&&(this.provName=KJUR.crypto.Util.DEFAULTPROVIDER[this.algName]),this.setAlgAndProvider(this.algName,this.provName))},KJUR.crypto.MessageDigest.getCanonicalAlgName=function(a){return"string
"==typeof a&&(a=(a=a.toLowerCase()).replace(/-/,"")),a},KJUR.crypto.MessageDigest.getHashLength=function(c){var b=KJUR.crypto.MessageDigest,a=b.getCanonicalAlgName(c);if(void 0===b.HASHLENGTH[a])throw"not supported
algorithm: "+c;return b.HASHLENGTH[a]},KJUR.crypto.MessageDigest.HASHLENGTH={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,ripemd160:20},KJUR.crypto.Mac=function(d){this.setAlgAndProvider=function(k,i){if(null==(k=k.toLowerCase())&&(k="hmacsha1
"),"hmac
"!=(k=k.toLowerCase()).substr(0,4))throw"setAlgAndProvider unsupported HMAC
alg: "+k;void 0===i&&(i=KJUR.crypto.Util.DEFAULTPROVIDER[k]),this.algProv=k+"/"+i;var g=k.substr(4);if(-1!=":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(g)&&"cryptojs
"==i){try{var j=KJUR.crypto.Util.CRYPTOJSMESSAGEDIGESTNAME[g];this.mac=CryptoJS.algo.HMAC.create(j,this.pass)}catch(h){throw"setAlgAndProvider hash alg
set fail hashAlg
="+g+"/"+h}this.updateString=function(l){this.mac.update(l)},this.updateHex=function(l){var m=CryptoJS.enc.Hex.parse(l);this.mac.update(m)},this.doFinal=function(){return this.mac.finalize().toString(CryptoJS.enc.Hex)},this.doFinalString=function(l){return this.updateString(l),this.doFinal()},this.doFinalHex=function(l){return this.updateHex(l),this.doFinal()}}},this.updateString=function(g){throw"updateString(str
) not supported
for this alg
/prov: "+this.algProv},this.updateHex=function(g){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(g){throw"digestString(str
) not supported
for this alg
/prov: "+this.algProv},this.doFinalHex=function(g){throw"digestHex(hex
) not supported
for this alg
/prov: "+this.algProv},this.setPassword=function(h){if("string
"==typeof h){var g=h;return h.length%2!=1&&h.match(/^[0-9A-Fa-f]+$/)||(g=rstrtohex(h)),void(this.pass=CryptoJS.enc.Hex.parse(g))}if("object
"!=typeof h)throw"KJUR
.crypto
.Mac unsupported password
type: "+h;g=null;if(void 0!==h.hex){if(h.hex.length%2!=0||!h.hex.match(/^[0-9A-Fa-f]+$/))throw"Mac: wrong hex
password: "+h.hex;g=h.hex}if(void 0!==h.utf8&&(g=utf8tohex(h.utf8)),void 0!==h.rstr&&(g=rstrtohex(h.rstr)),void 0!==h.b64&&(g=b64tohex(h.b64)),void 0!==h.b64u&&(g=b64utohex(h.b64u)),null==g)throw"KJUR
.crypto
.Mac unsupported password
type: "+h;this.pass=CryptoJS.enc.Hex.parse(g)},void 0!==d&&(void 0!==d.pass&&this.setPassword(d.pass),void 0!==d.alg&&(this.algName=d.alg,void 0===d.prov&&(this.provName=KJUR.crypto.Util.DEFAULTPROVIDER[this.algName]),this.setAlgAndProvider(this.algName,this.provName)))},KJUR.crypto.Signature=function(o){var q=null;if(this._setAlgNames=function(){var s=this.algName.match(/^(.+)with(.+)$/);s&&(this.mdAlgName=s[1].toLowerCase(),this.pubkeyAlgName=s[2].toLowerCase())},this._zeroPaddingOfSignature=function(x,w){for(var v="",t=w/4-x.length,u=0;u<t;u++)v+="0";return v+x},this.setAlgAndProvider=function(u,t){if(this._setAlgNames(),"cryptojs
/jsrsa
"!=t)throw"provider not
supported: "+t;if(-1!=":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(this.mdAlgName)){try{this.md=new KJUR.crypto.MessageDigest({alg:this.mdAlgName})}catch(s){throw"setAlgAndProvider hash alg
set fail alg
="+this.mdAlgName+"/"+s}this.init=function(w,x){var y=null;try{y=void 0===x?KEYUTIL.getKey(w):KEYUTIL.getKey(w,x)}catch(v){throw"init
failed:"+v}if(!0===y.isPrivate)this.prvKey=y,this.state="SIGN
";else{if(!0!==y.isPublic)throw"init failed
.:"+y;this.pubKey=y,this.state="VERIFY
"}},this.updateString=function(v){this.md.updateString(v)},this.updateHex=function(v){this.md.updateHex(v)},this.sign=function(){if(this.sHashHex=this.md.digest(),void 0!==this.ecprvhex&&void 0!==this.eccurvename){var v=new KJUR.crypto.ECDSA({curve:this.eccurvename});this.hSign=v.signHex(this.sHashHex,this.ecprvhex)}else if(this.prvKey instanceof RSAKey&&"rsaandmgf1
"===this.pubkeyAlgName)this.hSign=this.prvKey.signWithMessageHashPSS(this.sHashHex,this.mdAlgName,this.pssSaltLen);else if(this.prvKey instanceof RSAKey&&"rsa
"===this.pubkeyAlgName)this.hSign=this.prvKey.signWithMessageHash(this.sHashHex,this.mdAlgName);else if(this.prvKey instanceof KJUR.crypto.ECDSA)this.hSign=this.prvKey.signWithMessageHash(this.sHashHex);else{if(!(this.prvKey instanceof KJUR.crypto.DSA))throw"Signature: unsupported
private key
alg: "+this.pubkeyAlgName;this.hSign=this.prvKey.signWithMessageHash(this.sHashHex)}return this.hSign},this.signString=function(v){return this.updateString(v),this.sign()},this.signHex=function(v){return this.updateHex(v),this.sign()},this.verify=function(v){if(this.sHashHex=this.md.digest(),void 0!==this.ecpubhex&&void 0!==this.eccurvename)return new KJUR.crypto.ECDSA({curve:this.eccurvename}).verifyHex(this.sHashHex,v,this.ecpubhex);if(this.pubKey instanceof RSAKey&&"rsaandmgf1
"===this.pubkeyAlgName)return this.pubKey.verifyWithMessageHashPSS(this.sHashHex,v,this.mdAlgName,this.pssSaltLen);if(this.pubKey instanceof RSAKey&&"rsa
"===this.pubkeyAlgName)return this.pubKey.verifyWithMessageHash(this.sHashHex,v);if(void 0!==KJUR.crypto.ECDSA&&this.pubKey instanceof KJUR.crypto.ECDSA)return this.pubKey.verifyWithMessageHash(this.sHashHex,v);if(void 0!==KJUR.crypto.DSA&&this.pubKey instanceof KJUR.crypto.DSA)return this.pubKey.verifyWithMessageHash(this.sHashHex,v);throw"Signature: unsupported
public key
alg: "+this.pubkeyAlgName}}},this.init=function(s,t){throw"init(key
, pass
) not supported
for this alg:prov
="+this.algProvName},this.updateString=function(s){throw"updateString(str
) not supported
for this alg:prov
="+this.algProvName},this.updateHex=function(s){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(s){throw"digestString(str
) not supported
for this alg:prov
="+this.algProvName},this.signHex=function(s){throw"digestHex(hex
) not supported
for this alg:prov
="+this.algProvName},this.verify=function(s){throw"verify(hSigVal
) not supported
for this alg:prov
="+this.algProvName},this.initParams=o,void 0!==o&&(void 0!==o.alg&&(this.algName=o.alg,void 0===o.prov?this.provName=KJUR.crypto.Util.DEFAULTPROVIDER[this.algName]:this.provName=o.prov,this.algProvName=this.algName+":"+this.provName,this.setAlgAndProvider(this.algName,this.provName),this._setAlgNames()),void 0!==o.psssaltlen&&(this.pssSaltLen=o.psssaltlen),void 0!==o.prvkeypem)){if(void 0!==o.prvkeypas)throw"both prvkeypem and prvkeypas parameters not supported
";try{q=KEYUTIL.getKey(o.prvkeypem);this.init(q)}catch(m){throw"fatal error to load pem
private key: "+m}}},KJUR.crypto.Cipher=function(a){},KJUR.crypto.Cipher.encrypt=function(e,f,d){if(f instanceof RSAKey&&f.isPublic){var c=KJUR.crypto.Cipher.getAlgByKeyAndName(f,d);if("RSA
"===c)return f.encrypt(e);if("RSAOAEP
"===c)return f.encryptOAEP(e,"sha1
");var b=c.match(/^RSAOAEP(\d+)$/);if(null!==b)return f.encryptOAEP(e,"sha
"+b[1]);throw"Cipher
.encrypt: unsupported algorithm
for RSAKey: "+d}throw"Cipher
.encrypt: unsupported key or algorithm
"},KJUR.crypto.Cipher.decrypt=function(e,f,d){if(f instanceof RSAKey&&f.isPrivate){var c=KJUR.crypto.Cipher.getAlgByKeyAndName(f,d);if("RSA
"===c)return f.decrypt(e);if("RSAOAEP
"===c)return f.decryptOAEP(e,"sha1
");var b=c.match(/^RSAOAEP(\d+)$/);if(null!==b)return f.decryptOAEP(e,"sha
"+b[1]);throw"Cipher
.decrypt: unsupported algorithm
for RSAKey: "+d}throw"Cipher
.decrypt: unsupported key or algorithm
"},KJUR.crypto.Cipher.getAlgByKeyAndName=function(b,a){if(b instanceof RSAKey){if(-1!=":RSA:RSAOAEP:RSAOAEP224:RSAOAEP256:RSAOAEP384:RSAOAEP512:".indexOf(a))return a;if(null==a)return"RSA
";throw"getAlgByKeyAndName: not supported algorithm name
for RSAKey: "+a}throw"getAlgByKeyAndName: not supported algorithm
name: "+a},KJUR.crypto.OID=new function(){this.oidhex2name={"2a864886f70d010101
":"rsaEncryption
","2a8648ce3d0201
":"ecPublicKey
","2a8648ce380401
":"dsa
","2a8648ce3d030107
":"secp256r1
","2b8104001f
":"secp192k1
","2b81040021
":"secp224r1
","2b8104000a
":"secp256k1
","2b81040023
":"secp521r1
","2b81040022
":"secp384r1
","2a8648ce380403
":"SHA1withDSA
","608648016503040301":"SHA224withDSA
","608648016503040302":"SHA256withDSA
"}},void 0!==KJUR&&KJUR||(KJUR={}),void 0!==KJUR.crypto&&KJUR.crypto||(KJUR.crypto={}),KJUR.crypto.ECDSA=function(h){var a=new SecureRandom;this.type="EC
",this.isPrivate=!1,this.isPublic=!1,this.getBigRandom=function(i){return new BigInteger(i.bitLength(),a).mod(i.subtract(BigInteger.ONE)).add(BigInteger.ONE)},this.setNamedCurve=function(i){this.ecparams=KJUR.crypto.ECParameterDB.getByName(i),this.prvKeyHex=null,this.pubKeyHex=null,this.curveName=i},this.setPrivateKeyHex=function(i){this.isPrivate=!0,this.prvKeyHex=i},this.setPublicKeyHex=function(i){this.isPublic=!0,this.pubKeyHex=i},this.getPublicKeyXYHex=function(){var k=this.pubKeyHex;if("04"!==k.substr(0,2))throw"this method supports uncompressed
format(04) only
";var j=this.ecparams.keylen/4;if(k.length!==2+2*j)throw"malformed
public key hex length
";var i={};return i.x=k.substr(2,j),i.y=k.substr(2+j),i},this.getShortNISTPCurveName=function(){var i=this.curveName;return"secp256r1
"===i||"NIST P
-256"===i||"P
-256"===i||"prime256v1
"===i?"P
-256":"secp384r1
"===i||"NIST P
-384"===i||"P
-384"===i?"P
-384":null},this.generateKeyPairHex=function(){var k=this.ecparams.n,n=this.getBigRandom(k),l=this.ecparams.G.multiply(n),q=l.getX().toBigInteger(),o=l.getY().toBigInteger(),i=this.ecparams.keylen/4,m=("0000000000"+n.toString(16)).slice(-i),j="04"+("0000000000"+q.toString(16)).slice(-i)+("0000000000"+o.toString(16)).slice(-i);return this.setPrivateKeyHex(m),this.setPublicKeyHex(j),{ecprvhex:m,ecpubhex:j}},this.signWithMessageHash=function(i){return this.signHex(i,this.prvKeyHex)},this.signHex=function(o,j){var t=new BigInteger(j,16),l=this.ecparams.n,q=new BigInteger(o,16);do{var m=this.getBigRandom(l),i=this.ecparams.G.multiply(m).getX().toBigInteger().mod(l)}while(i.compareTo(BigInteger.ZERO)<=0);var v=m.modInverse(l).multiply(q.add(t.multiply(i))).mod(l);return KJUR.crypto.ECDSA.biRSSigToASN1Sig(i,v)},this.sign=function(m,u){var q=u,j=this.ecparams.n,p=BigInteger.fromByteArrayUnsigned(m);do{var l=this.getBigRandom(j),i=this.ecparams.G.multiply(l).getX().toBigInteger().mod(j)}while(i.compareTo(BigInteger.ZERO)<=0);var v=l.modInverse(j).multiply(p.add(q.multiply(i))).mod(j);return this.serializeSig(i,v)},this.verifyWithMessageHash=function(j,i){return this.verifyHex(j,i,this.pubKeyHex)},this.verifyHex=function(m,i,p){var l,j,k,o=KJUR.crypto.ECDSA.parseSigHex(i);l=o.r,j=o.s,k=ECPointFp.decodeFromHex(this.ecparams.curve,p);var n=new BigInteger(m,16);return this.verifyRaw(n,l,j,k)},this.verify=function(o,p,j){var l,i,k;if(Bitcoin.Util.isArray(p)){var n=this.parseSig(p);l=n.r,i=n.s}else{if("object
"!=typeof p||!p.r||!p.s)throw"Invalid value
for signature
";l=p.r,i=p.s}if(j instanceof ECPointFp)k=j;else{if(!Bitcoin.Util.isArray(j))throw"Invalid format
for pubkey value
, must be
byte array or ECPointFp
";k=ECPointFp.decodeFrom(this.ecparams.curve,j)}var m=BigInteger.fromByteArrayUnsigned(o);return this.verifyRaw(m,l,i,k)},this.verifyRaw=function(o,i,w,m){var l=this.ecparams.n,u=this.ecparams.G;if(i.compareTo(BigInteger.ONE)<0||i.compareTo(l)>=0)return!1;if(w.compareTo(BigInteger.ONE)<0||w.compareTo(l)>=0)return!1;var p=w.modInverse(l),k=o.multiply(p).mod(l),j=i.multiply(p).mod(l);return u.multiply(k).add(m.multiply(j)).getX().toBigInteger().mod(l).equals(i)},this.serializeSig=function(k,j){var l=k.toByteArraySigned(),i=j.toByteArraySigned(),m=[];return m.push(2),m.push(l.length),(m=m.concat(l)).push(2),m.push(i.length),(m=m.concat(i)).unshift(m.length),m.unshift(48),m},this.parseSig=function(n){var m;if(48!=n[0])throw new Error("Signature not a valid DERSequence
");if(2!=n[m=2])throw new Error("First element
in signature must be a DERInteger
");var l=n.slice(m+2,m+2+n[m+1]);if(2!=n[m+=2+n[m+1]])throw new Error("Second element
in signature must be a DERInteger
");var i=n.slice(m+2,m+2+n[m+1]);return m+=2+n[m+1],{r:BigInteger.fromByteArrayUnsigned(l),s:BigInteger.fromByteArrayUnsigned(i)}},this.parseSigCompact=function(m){if(65!==m.length)throw"Signature has the wrong length
";var j=m[0]-27;if(j<0||j>7)throw"Invalid signature type
";var o=this.ecparams.n;return{r:BigInteger.fromByteArrayUnsigned(m.slice(1,33)).mod(o),s:BigInteger.fromByteArrayUnsigned(m.slice(33,65)).mod(o),i:j}},this.readPKCS5PrvKeyHex=function(l){var i,k,o,n=ASN1HEX,m=KJUR.crypto.ECDSA.getName,p=n.getVbyList;if(!1===n.isASN1HEX(l))throw"not ASN
.1 hex string
";try{i=p(l,0,[2,0],"06"),k=p(l,0,[1],"04");try{o=p(l,0,[3,0],"03").substr(2)}catch(j){}}catch(j){throw"malformed PKCS
#1/5 plain ECC
private key
"}if(this.curveName=m(i),void 0===this.curveName)throw"unsupported curve name
";this.setNamedCurve(this.curveName),this.setPublicKeyHex(o),this.setPrivateKeyHex(k),this.isPublic=!1},this.readPKCS8PrvKeyHex=function(l){var p,m,k,q=ASN1HEX,i=KJUR.crypto.ECDSA.getName,n=q.getVbyList;if(!1===q.isASN1HEX(l))throw"not ASN
.1 hex string
";try{n(l,0,[1,0],"06"),p=n(l,0,[1,1],"06"),m=n(l,0,[2,0,1],"04");try{k=n(l,0,[2,0,2,0],"03").substr(2)}catch(o){}}catch(o){throw"malformed PKCS
#8 plain ECC
private key
"}if(this.curveName=i(p),void 0===this.curveName)throw"unsupported curve name
";this.setNamedCurve(this.curveName),this.setPublicKeyHex(k),this.setPrivateKeyHex(m),this.isPublic=!1},this.readPKCS8PubKeyHex=function(l){var i,o,n=ASN1HEX,m=KJUR.crypto.ECDSA.getName,p=n.getVbyList;if(!1===n.isASN1HEX(l))throw"not ASN
.1 hex string
";try{p(l,0,[0,0],"06"),i=p(l,0,[0,1],"06"),o=p(l,0,[1],"03").substr(2)}catch(j){throw"malformed PKCS
#8 ECC
public key
"}if(this.curveName=m(i),null===this.curveName)throw"unsupported curve name
";this.setNamedCurve(this.curveName),this.setPublicKeyHex(o)},this.readCertPubKeyHex=function(k,p){5!==p&&(p=6);var i,n,m=ASN1HEX,l=KJUR.crypto.ECDSA.getName,o=m.getVbyList;if(!1===m.isASN1HEX(k))throw"not ASN
.1 hex string
";try{i=o(k,0,[0,p,0,1],"06"),n=o(k,0,[0,p,1],"03").substr(2)}catch(j){throw"malformed X
.509 certificate ECC
public key
"}if(this.curveName=l(i),null===this.curveName)throw"unsupported curve name
";this.setNamedCurve(this.curveName),this.setPublicKeyHex(n)},void 0!==h&&void 0!==h.curve&&(this.curveName=h.curve),void 0===this.curveName&&(this.curveName="secp256r1
"),this.setNamedCurve(this.curveName),void 0!==h&&(void 0!==h.prv&&this.setPrivateKeyHex(h.prv),void 0!==h.pub&&this.setPublicKeyHex(h.pub))},KJUR.crypto.ECDSA.parseSigHex=function(a){var b=KJUR.crypto.ECDSA.parseSigHexInHexRS(a);return{r:new BigInteger(b.r,16),s:new BigInteger(b.s,16)}},KJUR.crypto.ECDSA.parseSigHexInHexRS=function(f){var j=ASN1HEX,i=j.getChildIdx,g=j.getV;if("30"!=f.substr(0,2))throw"signature is not a ASN
.1 sequence
";var h=i(f,0);if(2!=h.length)throw"number
of signature ASN
.1 sequence elements seem wrong
";var e=h[0],d=h[1];if("02"!=f.substr(e,2))throw"1st item
of sequene
of signature is not ASN
.1 integer
";if("02"!=f.substr(d,2))throw"2nd item
of sequene
of signature is not ASN
.1 integer
";return{r:g(f,e),s:g(f,d)}},KJUR.crypto.ECDSA.asn1SigToConcatSig=function(c){var d=KJUR.crypto.ECDSA.parseSigHexInHexRS(c),b=d.r,a=d.s;if("00"==b.substr(0,2)&&b.length%32==2&&(b=b.substr(2)),"00"==a.substr(0,2)&&a.length%32==2&&(a=a.substr(2)),b.length%32==30&&(b="00"+b),a.length%32==30&&(a="00"+a),b.length%32!=0)throw"unknown ECDSA sig r length error
";if(a.length%32!=0)throw"unknown ECDSA sig s length error
";return b+a},KJUR.crypto.ECDSA.concatSigToASN1Sig=function(a){if(a.length/2*8%128!=0)throw"unknown ECDSA concatinated r
-s sig length error
";var c=a.substr(0,a.length/2),b=a.substr(a.length/2);return KJUR.crypto.ECDSA.hexRSSigToASN1Sig(c,b)},KJUR.crypto.ECDSA.hexRSSigToASN1Sig=function(b,a){var d=new BigInteger(b,16),c=new BigInteger(a,16);return KJUR.crypto.ECDSA.biRSSigToASN1Sig(d,c)},KJUR.crypto.ECDSA.biRSSigToASN1Sig=function(f,d){var c=KJUR.asn1,b=new c.DERInteger({bigint:f}),a=new c.DERInteger({bigint:d});return new c.DERSequence({array:[b,a]}).getEncodedHex()},KJUR.crypto.ECDSA.getName=function(a){return"2a8648ce3d030107
"===a?"secp256r1
":"2b8104000a
"===a?"secp256k1
":"2b81040022
"===a?"secp384r1
":-1!=="|secp256r1
|NIST P
-256|P
-256|prime256v1
|".indexOf(a)?"secp256r1
":-1!=="|secp256k1
|".indexOf(a)?"secp256k1
":-1!=="|secp384r1
|NIST P
-384|P
-384|".indexOf(a)?"secp384r1
":null},void 0!==KJUR&&KJUR||(KJUR={}),void 0!==KJUR.crypto&&KJUR.crypto||(KJUR.crypto={}),KJUR.crypto.ECParameterDB=new function(){var b={},c={};function a(d){return new BigInteger(d,16)}this.getByName=function(e){var d=e;if(void 0!==c[d]&&(d=c[e]),void 0!==b[d])return b[d];throw"unregistered EC curve
name: "+d},this.regist=function(A,l,o,g,m,e,j,f,k,u,d,x){b[A]={};var s=a(o),z=a(g),y=a(m),t=a(e),w=a(j),r=new ECCurveFp(s,z,y),q=r.decodePointHex("04"+f+k);b[A].name=A,b[A].keylen=l,b[A].curve=r,b[A].G=q,b[A].n=t,b[A].h=w,b[A].oid=d,b[A].info=x;for(var v=0;v<u.length;v++)c[u[v]]=A}},KJUR.crypto.ECParameterDB.regist("secp128r1
",128,"FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFF
","FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFC
","E87579C11079F43DD824993C2CEE5ED3
","FFFFFFFE0000000075A30D1B9038A115
","1","161FF7528B899B2D0C28607CA52C5B86
","CF5AC8395BAFEB13C02DA292DDED7A83
",[],"","secp128r1 : SECG curve over a
128 bit prime field
"),KJUR.crypto.ECParameterDB.regist("secp160k1
",160,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73
","0","7","0100000000000000000001B8FA16DFAB9ACA16B6B3
","1","3B4C382CE37AA192A4019E763036F4F5DD4D7EBB
","938CF935318FDCED6BC28286531733C3F03C4FEE
",[],"","secp160k1 : SECG curve over a
160 bit prime field
"),KJUR.crypto.ECParameterDB.regist("secp160r1
",160,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFF
","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFC
","1C97BEFC54BD7A8B65ACF89F81D4D4ADC565FA45
","0100000000000000000001F4C8F927AED3CA752257
","1","4A96B5688EF573284664698968C38BB913CBFC82
","23A628553168947D59DCC912042351377AC5FB32
",[],"","secp160r1 : SECG curve over a
160 bit prime field
"),KJUR.crypto.ECParameterDB.regist("secp192k1
",192,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFEE37
","0","3","FFFFFFFFFFFFFFFFFFFFFFFE26F2FC170F69466A74DEFD8D
","1","DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D
","9B2F2F6D9C5628A7844163D015BE86344082AA88D95E2F9D
",[]),KJUR.crypto.ECParameterDB.regist("secp192r1
",192,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF
","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC
","64210519E59C80E70FA7E9AB72243049FEB8DEECC146B9B1
","FFFFFFFFFFFFFFFFFFFFFFFF99DEF836146BC9B1B4D22831
","1","188DA80EB03090F67CBF20EB43A18800F4FF0AFD82FF1012
","07192B95FFC8DA78631011ED6B24CDD573F977A11E794811
",[]),KJUR.crypto.ECParameterDB.regist("secp224r1
",224,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001
","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFE
","B4050A850C04B3ABF54132565044B0B7D7BFD8BA270B39432355FFB4
","FFFFFFFFFFFFFFFFFFFFFFFFFFFF16A2E0B8F03E13DD29455C5C2A3D
","1","B70E0CBD6BB4BF7F321390B94A03C1D356C21122343280D6115C1D21
","BD376388B5F723FB4C22DFE6CD4375A05A07476444D5819985007E34
",[]),KJUR.crypto.ECParameterDB.regist("secp256k1
",256,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F
","0","7","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141
","1","79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798
","483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8
",[]),KJUR.crypto.ECParameterDB.regist("secp256r1
",256,"FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF
","FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC
","5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B
","FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551
","1","6B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C296
","4FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5
",["NIST P
-256","P
-256","prime256v1
"]),KJUR.crypto.ECParameterDB.regist("secp384r1
",384,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFF
","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFC
","B3312FA7E23EE7E4988E056BE3F82D19181D9C6EFE8141120314088F5013875AC656398D8A2ED19D2A85C8EDD3EC2AEF
","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC7634D81F4372DDF581A0DB248B0A77AECEC196ACCC52973
","1","AA87CA22BE8B05378EB1C71EF320AD746E1D3B628BA79B9859F741E082542A385502F25DBF55296C3A545E3872760AB7
","3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f
",["NIST P
-384","P
-384"]),KJUR.crypto.ECParameterDB.regist("secp521r1
",521,"1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
","1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC
","051953EB9618E1C9A1F929A21A0B68540EEA2DA725B99B315F3B8B489918EF109E156193951EC7E937B1652C0BD3BB1BF073573DF883D2C34F1EF451FD46B503F00
","1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA51868783BF2F966B7FCC0148F709A5D03BB5C9B8899C47AEBB6FB71E91386409
","1","C6858E06B70404E9CD9E3ECB662395B4429C648139053FB521F828AF606B4D3DBAA14B5E77EFE75928FE1DC127A2FFA8DE3348B3C1856A429BF97E7E31C2E5BD66
","011839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650
",["NIST P
-521","P
-521"]),void 0!==KJUR&&KJUR||(KJUR={}),void 0!==KJUR.crypto&&KJUR.crypto||(KJUR.crypto={}),KJUR.crypto.DSA=function(){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(d,c,b,e,a){this.isPrivate=!0,this.p=d,this.q=c,this.g=b,this.y=e,this.x=a},this.setPrivateHex=function(d,b,f,i,j){var c,a,e,g,h;c=new BigInteger(d,16),a=new BigInteger(b,16),e=new BigInteger(f,16),g="string
"==typeof i&&i.length>1?new BigInteger(i,16):null,h=new BigInteger(j,16),this.setPrivate(c,a,e,g,h)},this.setPublic=function(c,b,a,d){this.isPublic=!0,this.p=c,this.q=b,this.g=a,this.y=d,this.x=null},this.setPublicHex=function(f,e,d,g){var b,a,h,c;b=new BigInteger(f,16),a=new BigInteger(e,16),h=new BigInteger(d,16),c=new BigInteger(g,16),this.setPublic(b,a,h,c)},this.signWithMessageHash=function(d){var c=this.p,b=this.q,f=this.g,j=(this.y,this.x),e=KJUR.crypto.Util.getRandomBigIntegerMinToMax(BigInteger.ONE.add(BigInteger.ONE),b.subtract(BigInteger.ONE)),h=new BigInteger(d.substr(0,b.bitLength()/4),16),a=f.modPow(e,c).mod(b),n=e.modInverse(b).multiply(h.add(j.multiply(a))).mod(b);return KJUR.asn1.ASN1Util.jsonToASN1HEX({seq:[{int:{bigint:a}},{int:{bigint:n}}]})},this.verifyWithMessageHash=function(h,f){var d=this.p,b=this.q,j=this.g,l=this.y,i=this.parseASN1Signature(f),a=i[0],t=i[1],k=new BigInteger(h.substr(0,b.bitLength()/4),16);if(BigInteger.ZERO.compareTo(a)>0||a.compareTo(b)>0)throw"invalid DSA signature
";if(BigInteger.ZERO.compareTo(t)>=0||t.compareTo(b)>0)throw"invalid DSA signature
";var m=t.modInverse(b),e=k.multiply(m).mod(b),c=a.multiply(m).mod(b);return 0==j.modPow(e,d).multiply(l.modPow(c,d)).mod(d).mod(b).compareTo(a)},this.parseASN1Signature=function(a){try{return[new BigInteger(ASN1HEX.getVbyList(a,0,[0],"02"),16),new BigInteger(ASN1HEX.getVbyList(a,0,[1],"02"),16)]}catch(b){throw"malformed ASN
.1 DSA signature
"}},this.readPKCS5PrvKeyHex=function(c){var b,a,f,g,i,j=ASN1HEX,d=j.getVbyList;if(!1===j.isASN1HEX(c))throw"not ASN
.1 hex string
";try{b=d(c,0,[1],"02"),a=d(c,0,[2],"02"),f=d(c,0,[3],"02"),g=d(c,0,[4],"02"),i=d(c,0,[5],"02")}catch(e){throw console.log("EXCEPTION:"+e),"malformed PKCS
#1/5 plain DSA
private key
"}this.setPrivateHex(b,a,f,g,i)},this.readPKCS8PrvKeyHex=function(d){var f,c,b,g,e=ASN1HEX,i=e.getVbyList;if(!1===e.isASN1HEX(d))throw"not ASN
.1 hex string
";try{f=i(d,0,[1,1,0],"02"),c=i(d,0,[1,1,1],"02"),b=i(d,0,[1,1,2],"02"),g=i(d,0,[2,0],"02")}catch(a){throw console.log("EXCEPTION:"+a),"malformed PKCS
#8 plain DSA
private key
"}this.setPrivateHex(f,c,b,null,g)},this.readPKCS8PubKeyHex=function(d){var f,c,b,g,e=ASN1HEX,i=e.getVbyList;if(!1===e.isASN1HEX(d))throw"not ASN
.1 hex string
";try{f=i(d,0,[0,1,0],"02"),c=i(d,0,[0,1,1],"02"),b=i(d,0,[0,1,2],"02"),g=i(d,0,[1,0],"02")}catch(a){throw console.log("EXCEPTION:"+a),"malformed PKCS
#8 DSA
public key
"}this.setPublicHex(f,c,b,g)},this.readCertPubKeyHex=function(c,f){var b,a,g,i;5!==f&&(f=6);var j=ASN1HEX,d=j.getVbyList;if(!1===j.isASN1HEX(c))throw"not ASN
.1 hex string
";try{b=d(c,0,[0,f,0,1,0],"02"),a=d(c,0,[0,f,0,1,1],"02"),g=d(c,0,[0,f,0,1,2],"02"),i=d(c,0,[0,f,1,0],"02")}catch(e){throw console.log("EXCEPTION:"+e),"malformed X
.509 certificate DSA
public key
"}this.setPublicHex(b,a,g,i)}};var KEYUTIL=function(){var d=function(p,r,q){return k(CryptoJS.AES,p,r,q)},k=function(s,x,u,q){var r=CryptoJS.enc.Hex.parse(x),w=CryptoJS.enc.Hex.parse(u),p=CryptoJS.enc.Hex.parse(q),t={};t.key=w,t.iv=p,t.ciphertext=r;var v=s.decrypt(t,w,{iv:p});return CryptoJS.enc.Hex.stringify(v)},l=function(p,r,q){return g(CryptoJS.AES,p,r,q)},g=function(t,y,v,q){var s=CryptoJS.enc.Hex.parse(y),x=CryptoJS.enc.Hex.parse(v),p=CryptoJS.enc.Hex.parse(q),w=t.encrypt(s,x,{iv:p}),r=CryptoJS.enc.Hex.parse(w.toString());return CryptoJS.enc.Base64.stringify(r)},i={"AES
-256-CBC
":{proc:d,eproc:l,keylen:32,ivlen:16},"AES
-192-CBC
":{proc:d,eproc:l,keylen:24,ivlen:16},"AES
-128-CBC
":{proc:d,eproc:l,keylen:16,ivlen:16},"DES
-EDE3
-CBC
":{proc:function(p,r,q){return k(CryptoJS.TripleDES,p,r,q)},eproc:function(p,r,q){return g(CryptoJS.TripleDES,p,r,q)},keylen:24,ivlen:8},"DES
-CBC
":{proc:function(p,r,q){return k(CryptoJS.DES,p,r,q)},eproc:function(p,r,q){return g(CryptoJS.DES,p,r,q)},keylen:8,ivlen:8}},n=function(v){var w={},q=v.match(new RegExp("DEK
-Info: ([^,]+),([0-9A
-Fa
-f
]+)","m
"));q&&(w.cipher=q[1],w.ivsalt=q[2]);var p=v.match(new RegExp("-----BEGIN ([A
-Z
]+) PRIVATE KEY
-----"));p&&(w.type=p[1]);var u=-1,x=0;-1!=v.indexOf("\r\n\r\n")&&(u=v.indexOf("\r\n\r\n"),x=2),-1!=v.indexOf("\n\n")&&(u=v.indexOf("\n\n"),x=1);var t=v.indexOf("-----END
");if(-1!=u&&-1!=t){var r=v.substring(u+2*x,t-x);r=r.replace(/\s+/g,""),w.data=r}return w},j=function(q,y,p){for(var v=p.substring(0,16),t=CryptoJS.enc.Hex.parse(v),r=CryptoJS.enc.Utf8.parse(y),u=i[q].keylen+i[q].ivlen,x="",w=null;;){var s=CryptoJS.algo.MD5.create();if(null!=w&&s.update(w),s.update(r),s.update(t),w=s.finalize(),(x+=CryptoJS.enc.Hex.stringify(w)).length>=2*u)break}var z={};return z.keyhex=x.substr(0,2*i[q].keylen),z.ivhex=x.substr(2*i[q].keylen,2*i[q].ivlen),z},b=function(p,v,r,w){var s=CryptoJS.enc.Base64.parse(p),q=CryptoJS.enc.Hex.stringify(s);return(0,i[v].proc)(q,r,w)};return{version:"1.0.0",parsePKCS5PEM:function(p){return n(p)},getKeyAndUnusedIvByPasscodeAndIvsalt:function(q,p,r){return j(q,p,r)},decryptKeyB64:function(p,r,q,s){return b(p,r,q,s)},getDecryptedKeyHex:function(y,x){var q=n(y),r=(q.type,q.cipher),p=q.ivsalt,s=q.data,v=j(r,x,p).keyhex;return b(s,r,v,p)},getEncryptedPKCS5PEMFromPrvKeyHex:function(x,s,A,t,r){var p="";if(void 0!==t&&null!=t||(t="AES
-256-CBC
"),void 0===i[t])throw"KEYUTIL unsupported
algorithm: "+t;void 0!==r&&null!=r||(r=function(p){var r=CryptoJS.lib.WordArray.random(p);return CryptoJS.enc.Hex.stringify(r)}(i[t].ivlen).toUpperCase());var w=function(p,s,q,u){return(0,i[s].eproc)(p,q,u)}(s,t,j(t,A,r).keyhex,r);p="-----BEGIN
"+x+" PRIVATE KEY
-----\r\n";return p+="Proc
-Type: 4,ENCRYPTED
\r\n",p+="DEK
-Info: "+t+","+r+"\r\n",p+="\r\n",p+=w.replace(/(.{64})/g,"$1\r\n"),p+="\r\n-----END
"+x+" PRIVATE KEY
-----\r\n"},parseHexOfEncryptedPKCS8:function(y){var B=ASN1HEX,z=B.getChildIdx,w=B.getV,t={},r=z(y,0);if(2!=r.length)throw"malformed
format: SEQUENCE(0).items
!= 2: "+r.length;t.ciphertext=w(y,r[1]);var A=z(y,r[0]);if(2!=A.length)throw"malformed
format: SEQUENCE(0.0).items
!= 2: "+A.length;if("2a864886f70d01050d
"!=w(y,A[0]))throw"this only supports pkcs5PBES2
";var p=z(y,A[1]);if(2!=A.length)throw"malformed
format: SEQUENCE(0.0.1).items
!= 2: "+p.length;var q=z(y,p[1]);if(2!=q.length)throw"malformed
format: SEQUENCE(0.0.1.1).items
!= 2: "+q.length;if("2a864886f70d0307
"!=w(y,q[0]))throw"this only supports TripleDES
";t.encryptionSchemeAlg="TripleDES
",t.encryptionSchemeIV=w(y,q[1]);var s=z(y,p[0]);if(2!=s.length)throw"malformed
format: SEQUENCE(0.0.1.0).items
!= 2: "+s.length;if("2a864886f70d01050c
"!=w(y,s[0]))throw"this only supports pkcs5PBKDF2
";var x=z(y,s[1]);if(x.length<2)throw"malformed
format: SEQUENCE(0.0.1.0.1).items
< 2: "+x.length;t.pbkdf2Salt=w(y,x[0]);var u=w(y,x[1]);try{t.pbkdf2Iter=parseInt(u,16)}catch(v){throw"malformed format
pbkdf2Iter: "+u}return t},getPBKDF2KeyHexFromParam:function(u,p){var t=CryptoJS.enc.Hex.parse(u.pbkdf2Salt),q=u.pbkdf2Iter,s=CryptoJS.PBKDF2(p,t,{keySize:6,iterations:q});return CryptoJS.enc.Hex.stringify(s)},_getPlainPKCS8HexFromEncryptedPKCS8PEM:function(x,y){var r=pemtohex(x,"ENCRYPTED PRIVATE KEY
"),p=this.parseHexOfEncryptedPKCS8(r),u=KEYUTIL.getPBKDF2KeyHexFromParam(p,y),v={};v.ciphertext=CryptoJS.enc.Hex.parse(p.ciphertext);var t=CryptoJS.enc.Hex.parse(u),s=CryptoJS.enc.Hex.parse(p.encryptionSchemeIV),w=CryptoJS.TripleDES.decrypt(v,t,{iv:s});return CryptoJS.enc.Hex.stringify(w)},getKeyFromEncryptedPKCS8PEM:function(s,q){var p=this._getPlainPKCS8HexFromEncryptedPKCS8PEM(s,q);return this.getKeyFromPlainPrivatePKCS8Hex(p)},parsePlainPrivatePKCS8Hex:function(s){var v=ASN1HEX,u=v.getChildIdx,t=v.getV,q={algparam:null};if("30"!=s.substr(0,2))throw"malformed plain PKCS8
private key(code:001)";var r=u(s,0);if(3!=r.length)throw"malformed plain PKCS8
private key(code:002)";if("30"!=s.substr(r[1],2))throw"malformed PKCS8
private key(code:003)";var p=u(s,r[1]);if(2!=p.length)throw"malformed PKCS8
private key(code:004)";if("06"!=s.substr(p[0],2))throw"malformed PKCS8
private key(code:005)";if(q.algoid=t(s,p[0]),"06"==s.substr(p[1],2)&&(q.algparam=t(s,p[1])),"04"!=s.substr(r[2],2))throw"malformed PKCS8
private key(code:006)";return q.keyidx=v.getVidx(s,r[2]),q},getKeyFromPlainPrivatePKCS8PEM:function(q){var p=pemtohex(q,"PRIVATE KEY
");return this.getKeyFromPlainPrivatePKCS8Hex(p)},getKeyFromPlainPrivatePKCS8Hex:function(p){var r,q=this.parsePlainPrivatePKCS8Hex(p);if("2a864886f70d010101
"==q.algoid)r=new RSAKey;else if("2a8648ce380401
"==q.algoid)r=new KJUR.crypto.DSA;else{if("2a8648ce3d0201
"!=q.algoid)throw"unsupported
private key algorithm
";r=new KJUR.crypto.ECDSA}return r.readPKCS8PrvKeyHex(p),r},_getKeyFromPublicPKCS8Hex:function(q){var p,r=ASN1HEX.getVbyList(q,0,[0,0],"06");if("2a864886f70d010101
"===r)p=new RSAKey;else if("2a8648ce380401
"===r)p=new KJUR.crypto.DSA;else{if("2a8648ce3d0201
"!==r)throw"unsupported PKCS
#8 public key hex
";p=new KJUR.crypto.ECDSA}return p.readPKCS8PubKeyHex(q),p},parsePublicRawRSAKeyHex:function(r){var u=ASN1HEX,t=u.getChildIdx,s=u.getV,p={};if("30"!=r.substr(0,2))throw"malformed RSA
key(code:001)";var q=t(r,0);if(2!=q.length)throw"malformed RSA
key(code:002)";if("02"!=r.substr(q[0],2))throw"malformed RSA
key(code:003)";if(p.n=s(r,q[0]),"02"!=r.substr(q[1],2))throw"malformed RSA
key(code:004)";return p.e=s(r,q[1]),p},parsePublicPKCS8Hex:function(t){var v=ASN1HEX,u=v.getChildIdx,s=v.getV,q={algparam:null},r=u(t,0);if(2!=r.length)throw"outer DERSequence shall have
2 elements: "+r.length;var w=r[0];if("30"!=t.substr(w,2))throw"malformed PKCS8
public key(code:001)";var p=u(t,w);if(2!=p.length)throw"malformed PKCS8
public key(code:002)";if("06"!=t.substr(p[0],2))throw"malformed PKCS8
public key(code:003)";if(q.algoid=s(t,p[0]),"06"==t.substr(p[1],2)?q.algparam=s(t,p[1]):"30"==t.substr(p[1],2)&&(q.algparam={},q.algparam.p=v.getVbyList(t,p[1],[0],"02"),q.algparam.q=v.getVbyList(t,p[1],[1],"02"),q.algparam.g=v.getVbyList(t,p[1],[2],"02")),"03"!=t.substr(r[1],2))throw"malformed PKCS8
public key(code:004)";return q.key=s(t,r[1]).substr(2),q}}}();KEYUTIL.getKey=function(l,k,n){var L=(G=ASN1HEX).getChildIdx,d=(G.getV,G.getVbyList),c=KJUR.crypto,i=c.ECDSA,C=c.DSA,w=RSAKey,M=pemtohex,F=KEYUTIL;if(void 0!==w&&l instanceof w)return l;if(void 0!==i&&l instanceof i)return l;if(void 0!==C&&l instanceof C)return l;if(void 0!==l.curve&&void 0!==l.xy&&void 0===l.d)return new i({pub:l.xy,curve:l.curve});if(void 0!==l.curve&&void 0!==l.d)return new i({prv:l.d,curve:l.curve});if(void 0===l.kty&&void 0!==l.n&&void 0!==l.e&&void 0===l.d)return(P=new w).setPublic(l.n,l.e),P;if(void 0===l.kty&&void 0!==l.n&&void 0!==l.e&&void 0!==l.d&&void 0!==l.p&&void 0!==l.q&&void 0!==l.dp&&void 0!==l.dq&&void 0!==l.co&&void 0===l.qi)return(P=new w).setPrivateEx(l.n,l.e,l.d,l.p,l.q,l.dp,l.dq,l.co),P;if(void 0===l.kty&&void 0!==l.n&&void 0!==l.e&&void 0!==l.d&&void 0===l.p)return(P=new w).setPrivate(l.n,l.e,l.d),P;if(void 0!==l.p&&void 0!==l.q&&void 0!==l.g&&void 0!==l.y&&void 0===l.x)return(P=new C).setPublic(l.p,l.q,l.g,l.y),P;if(void 0!==l.p&&void 0!==l.q&&void 0!==l.g&&void 0!==l.y&&void 0!==l.x)return(P=new C).setPrivate(l.p,l.q,l.g,l.y,l.x),P;if("RSA
"===l.kty&&void 0!==l.n&&void 0!==l.e&&void 0===l.d)return(P=new w).setPublic(b64utohex(l.n),b64utohex(l.e)),P;if("RSA
"===l.kty&&void 0!==l.n&&void 0!==l.e&&void 0!==l.d&&void 0!==l.p&&void 0!==l.q&&void 0!==l.dp&&void 0!==l.dq&&void 0!==l.qi)return(P=new w).setPrivateEx(b64utohex(l.n),b64utohex(l.e),b64utohex(l.d),b64utohex(l.p),b64utohex(l.q),b64utohex(l.dp),b64utohex(l.dq),b64utohex(l.qi)),P;if("RSA
"===l.kty&&void 0!==l.n&&void 0!==l.e&&void 0!==l.d)return(P=new w).setPrivate(b64utohex(l.n),b64utohex(l.e),b64utohex(l.d)),P;if("EC
"===l.kty&&void 0!==l.crv&&void 0!==l.x&&void 0!==l.y&&void 0===l.d){var t=(j=new i({curve:l.crv})).ecparams.keylen/4,u="04"+("0000000000"+b64utohex(l.x)).slice(-t)+("0000000000"+b64utohex(l.y)).slice(-t);return j.setPublicKeyHex(u),j}if("EC
"===l.kty&&void 0!==l.crv&&void 0!==l.x&&void 0!==l.y&&void 0!==l.d){t=(j=new i({curve:l.crv})).ecparams.keylen/4,u="04"+("0000000000"+b64utohex(l.x)).slice(-t)+("0000000000"+b64utohex(l.y)).slice(-t);var b=("0000000000"+b64utohex(l.d)).slice(-t);return j.setPublicKeyHex(u),j.setPrivateKeyHex(b),j}if("pkcs5prv
"===n){var N,J=l,G=ASN1HEX;if(9===(N=L(J,0)).length)(P=new w).readPKCS5PrvKeyHex(J);else if(6===N.length)(P=new C).readPKCS5PrvKeyHex(J);else{if(!(N.length>2&&"04"===J.substr(N[1],2)))throw"unsupported PKCS
#1/5 hexadecimal key
";(P=new i).readPKCS5PrvKeyHex(J)}return P}if("pkcs8prv
"===n)return P=F.getKeyFromPlainPrivatePKCS8Hex(l);if("pkcs8pub
"===n)return F._getKeyFromPublicPKCS8Hex(l);if("x509pub
"===n)return X509.getPublicKeyFromCertHex(l);if(-1!=l.indexOf("-END CERTIFICATE
-",0)||-1!=l.indexOf("-END X509 CERTIFICATE
-",0)||-1!=l.indexOf("-END TRUSTED CERTIFICATE
-",0))return X509.getPublicKeyFromCertPEM(l);if(-1!=l.indexOf("-END PUBLIC KEY
-")){var O=pemtohex(l,"PUBLIC KEY
");return F._getKeyFromPublicPKCS8Hex(O)}if(-1!=l.indexOf("-END RSA PRIVATE KEY
-")&&-1==l.indexOf("4,ENCRYPTED
")){var m=M(l,"RSA PRIVATE KEY
");return F.getKey(m,null,"pkcs5prv
")}if(-1!=l.indexOf("-END DSA PRIVATE KEY
-")&&-1==l.indexOf("4,ENCRYPTED
")){var E=d(I=M(l,"DSA PRIVATE KEY
"),0,[1],"02"),D=d(I,0,[2],"02"),K=d(I,0,[3],"02"),r=d(I,0,[4],"02"),s=d(I,0,[5],"02");return(P=new C).setPrivate(new BigInteger(E,16),new BigInteger(D,16),new BigInteger(K,16),new BigInteger(r,16),new BigInteger(s,16)),P}if(-1!=l.indexOf("-END PRIVATE KEY
-"))return F.getKeyFromPlainPrivatePKCS8PEM(l);if(-1!=l.indexOf("-END RSA PRIVATE KEY
-")&&-1!=l.indexOf("4,ENCRYPTED
")){var o=F.getDecryptedKeyHex(l,k),H=new RSAKey;return H.readPKCS5PrvKeyHex(o),H}if(-1!=l.indexOf("-END EC PRIVATE KEY
-")&&-1!=l.indexOf("4,ENCRYPTED
")){var j,P=d(I=F.getDecryptedKeyHex(l,k),0,[1],"04"),f=d(I,0,[2,0],"06"),A=d(I,0,[3,0],"03").substr(2);if(void 0===KJUR.crypto.OID.oidhex2name[f])throw"undefined OID(hex
) in KJUR
.crypto
.OID: "+f;return(j=new i({curve:KJUR.crypto.OID.oidhex2name[f]})).setPublicKeyHex(A),j.setPrivateKeyHex(P),j.isPublic=!1,j}if(-1!=l.indexOf("-END DSA PRIVATE KEY
-")&&-1!=l.indexOf("4,ENCRYPTED
")){var I;E=d(I=F.getDecryptedKeyHex(l,k),0,[1],"02"),D=d(I,0,[2],"02"),K=d(I,0,[3],"02"),r=d(I,0,[4],"02"),s=d(I,0,[5],"02");return(P=new C).setPrivate(new BigInteger(E,16),new BigInteger(D,16),new BigInteger(K,16),new BigInteger(r,16),new BigInteger(s,16)),P}if(-1!=l.indexOf("-END ENCRYPTED PRIVATE KEY
-"))return F.getKeyFromEncryptedPKCS8PEM(l,k);throw"not supported argument
"},KEYUTIL.generateKeypair=function(a,c){if("RSA
"==a){var b=c;(h=new RSAKey).generate(b,"10001"),h.isPrivate=!0,h.isPublic=!0;var f=new RSAKey,e=h.n.toString(16),i=h.e.toString(16);return f.setPublic(e,i),f.isPrivate=!1,f.isPublic=!0,(k={}).prvKeyObj=h,k.pubKeyObj=f,k}if("EC
"==a){var h,k,d=c,j=new KJUR.crypto.ECDSA({curve:d}).generateKeyPairHex();return(h=new KJUR.crypto.ECDSA({curve:d})).setPublicKeyHex(j.ecpubhex),h.setPrivateKeyHex(j.ecprvhex),h.isPrivate=!0,h.isPublic=!1,(f=new KJUR.crypto.ECDSA({curve:d})).setPublicKeyHex(j.ecpubhex),f.isPrivate=!1,f.isPublic=!0,(k={}).prvKeyObj=h,k.pubKeyObj=f,k}throw"unknown
algorithm: "+a},KEYUTIL.getPEM=function(b,D,y,m,q,j){var F=KJUR,k=F.asn1,z=k.DERObjectIdentifier,f=k.DERInteger,l=k.ASN1Util.newObject,C=k.x509.SubjectPublicKeyInfo,e=F.crypto,u=e.DSA,r=e.ECDSA,n=RSAKey;function A(s){return l({seq:[{int:0},{int:{bigint:s.n}},{int:s.e},{int:{bigint:s.d}},{int:{bigint:s.p}},{int:{bigint:s.q}},{int:{bigint:s.dmp1}},{int:{bigint:s.dmq1}},{int:{bigint:s.coeff}}]})}function B(G){return l({seq:[{int:1},{octstr:{hex:G.prvKeyHex}},{tag:["a0
",!0,{oid:{name:G.curveName}}]},{tag:["a1
",!0,{bitstr:{hex:"00"+G.pubKeyHex}}]}]})}function x(s){return l({seq:[{int:0},{int:{bigint:s.p}},{int:{bigint:s.q}},{int:{bigint:s.g}},{int:{bigint:s.y}},{int:{bigint:s.x}}]})}if((void 0!==n&&b instanceof n||void 0!==u&&b instanceof u||void 0!==r&&b instanceof r)&&1==b.isPublic&&(void 0===D||"PKCS8PUB
"==D))return hextopem(w=new C(b).getEncodedHex(),"PUBLIC KEY
");if("PKCS1PRV
"==D&&void 0!==n&&b instanceof n&&(void 0===y||null==y)&&1==b.isPrivate)return hextopem(w=A(b).getEncodedHex(),"RSA PRIVATE KEY
");if("PKCS1PRV
"==D&&void 0!==r&&b instanceof r&&(void 0===y||null==y)&&1==b.isPrivate){var v=new z({name:b.curveName}).getEncodedHex(),t=B(b).getEncodedHex(),p="";return p+=hextopem(v,"EC PARAMETERS
"),p+=hextopem(t,"EC PRIVATE KEY
")}if("PKCS1PRV
"==D&&void 0!==u&&b instanceof u&&(void 0===y||null==y)&&1==b.isPrivate)return hextopem(w=x(b).getEncodedHex(),"DSA PRIVATE KEY
");if("PKCS5PRV
"==D&&void 0!==n&&b instanceof n&&void 0!==y&&null!=y&&1==b.isPrivate){var w=A(b).getEncodedHex();return void 0===m&&(m="DES
-EDE3
-CBC
"),this.getEncryptedPKCS5PEMFromPrvKeyHex("RSA
",w,y,m,j)}if("PKCS5PRV
"==D&&void 0!==r&&b instanceof r&&void 0!==y&&null!=y&&1==b.isPrivate){w=B(b).getEncodedHex();return void 0===m&&(m="DES
-EDE3
-CBC
"),this.getEncryptedPKCS5PEMFromPrvKeyHex("EC
",w,y,m,j)}if("PKCS5PRV
"==D&&void 0!==u&&b instanceof u&&void 0!==y&&null!=y&&1==b.isPrivate){w=x(b).getEncodedHex();return void 0===m&&(m="DES
-EDE3
-CBC
"),this.getEncryptedPKCS5PEMFromPrvKeyHex("DSA
",w,y,m,j)}var o=function(G,s){var I=c(G,s);return new l({seq:[{seq:[{oid:{name:"pkcs5PBES2
"}},{seq:[{seq:[{oid:{name:"pkcs5PBKDF2
"}},{seq:[{octstr:{hex:I.pbkdf2Salt}},{int:I.pbkdf2Iter}]}]},{seq:[{oid:{name:"des
-EDE3
-CBC
"}},{octstr:{hex:I.encryptionSchemeIV}}]}]}]},{octstr:{hex:I.ciphertext}}]}).getEncodedHex()},c=function(N,O){var M=CryptoJS.lib.WordArray.random(8),s=CryptoJS.lib.WordArray.random(8),I=CryptoJS.PBKDF2(O,M,{keySize:6,iterations:100}),J=CryptoJS.enc.Hex.parse(N),K=CryptoJS.TripleDES.encrypt(J,I,{iv:s})+"",G={};return G.ciphertext=K,G.pbkdf2Salt=CryptoJS.enc.Hex.stringify(M),G.pbkdf2Iter=100,G.encryptionSchemeAlg="DES
-EDE3
-CBC
",G.encryptionSchemeIV=CryptoJS.enc.Hex.stringify(s),G};if("PKCS8PRV
"==D&&null!=n&&b instanceof n&&1==b.isPrivate){var d=A(b).getEncodedHex();w=l({seq:[{int:0},{seq:[{oid:{name:"rsaEncryption
"}},{null:!0}]},{octstr:{hex:d}}]}).getEncodedHex();return void 0===y||null==y?hextopem(w,"PRIVATE KEY
"):hextopem(t=o(w,y),"ENCRYPTED PRIVATE KEY
")}if("PKCS8PRV
"==D&&void 0!==r&&b instanceof r&&1==b.isPrivate){d=new l({seq:[{int:1},{octstr:{hex:b.prvKeyHex}},{tag:["a1
",!0,{bitstr:{hex:"00"+b.pubKeyHex}}]}]}).getEncodedHex(),w=l({seq:[{int:0},{seq:[{oid:{name:"ecPublicKey
"}},{oid:{name:b.curveName}}]},{octstr:{hex:d}}]}).getEncodedHex();return void 0===y||null==y?hextopem(w,"PRIVATE KEY
"):hextopem(t=o(w,y),"ENCRYPTED PRIVATE KEY
")}if("PKCS8PRV
"==D&&void 0!==u&&b instanceof u&&1==b.isPrivate){d=new f({bigint:b.x}).getEncodedHex(),w=l({seq:[{int:0},{seq:[{oid:{name:"dsa
"}},{seq:[{int:{bigint:b.p}},{int:{bigint:b.q}},{int:{bigint:b.g}}]}]},{octstr:{hex:d}}]}).getEncodedHex();return void 0===y||null==y?hextopem(w,"PRIVATE KEY
"):hextopem(t=o(w,y),"ENCRYPTED PRIVATE KEY
")}throw"unsupported object nor format
"},KEYUTIL.getKeyFromCSRPEM=function(b){var a=pemtohex(b,"CERTIFICATE REQUEST
");return KEYUTIL.getKeyFromCSRHex(a)},KEYUTIL.getKeyFromCSRHex=function(a){var c=KEYUTIL.parseCSRHex(a);return KEYUTIL.getKey(c.p8pubkeyhex,null,"pkcs8pub
")},KEYUTIL.parseCSRHex=function(d){var i=ASN1HEX,f=i.getChildIdx,c=i.getTLV,b={},g=d;if("30"!=g.substr(0,2))throw"malformed
CSR(code:001)";var e=f(g,0);if(e.length<1)throw"malformed
CSR(code:002)";if("30"!=g.substr(e[0],2))throw"malformed
CSR(code:003)";var a=f(g,e[0]);if(a.length<3)throw"malformed
CSR(code:004)";return b.p8pubkeyhex=c(g,a[2]),b},KEYUTIL.getJWKFromKey=function(d){var b={};if(d instanceof RSAKey&&d.isPrivate)return b.kty="RSA
",b.n=hextob64u(d.n.toString(16)),b.e=hextob64u(d.e.toString(16)),b.d=hextob64u(d.d.toString(16)),b.p=hextob64u(d.p.toString(16)),b.q=hextob64u(d.q.toString(16)),b.dp=hextob64u(d.dmp1.toString(16)),b.dq=hextob64u(d.dmq1.toString(16)),b.qi=hextob64u(d.coeff.toString(16)),b;if(d instanceof RSAKey&&d.isPublic)return b.kty="RSA
",b.n=hextob64u(d.n.toString(16)),b.e=hextob64u(d.e.toString(16)),b;if(d instanceof KJUR.crypto.ECDSA&&d.isPrivate){if("P
-256"!==(a=d.getShortNISTPCurveName())&&"P
-384"!==a)throw"unsupported curve name
for JWT: "+a;var c=d.getPublicKeyXYHex();return b.kty="EC
",b.crv=a,b.x=hextob64u(c.x),b.y=hextob64u(c.y),b.d=hextob64u(d.prvKeyHex),b}if(d instanceof KJUR.crypto.ECDSA&&d.isPublic){var a;if("P
-256"!==(a=d.getShortNISTPCurveName())&&"P
-384"!==a)throw"unsupported curve name
for JWT: "+a;c=d.getPublicKeyXYHex();return b.kty="EC
",b.crv=a,b.x=hextob64u(c.x),b.y=hextob64u(c.y),b}throw"not supported key object
"},RSAKey.getPosArrayOfChildrenFromHex=function(a){return ASN1HEX.getChildIdx(a,0)},RSAKey.getHexValueArrayOfChildrenFromHex=function(f){var k,i=ASN1HEX.getV,e=i(f,(k=RSAKey.getPosArrayOfChildrenFromHex(f))[0]),j=i(f,k[1]),b=i(f,k[2]),c=i(f,k[3]),h=i(f,k[4]),g=i(f,k[5]),m=i(f,k[6]),l=i(f,k[7]),d=i(f,k[8]);return(k=new Array).push(e,j,b,c,h,g,m,l,d),k},RSAKey.prototype.readPrivateKeyFromPEMString=function(d){var c=pemtohex(d),b=RSAKey.getHexValueArrayOfChildrenFromHex(c);this.setPrivateEx(b[1],b[2],b[3],b[4],b[5],b[6],b[7],b[8])},RSAKey.prototype.readPKCS5PrvKeyHex=function(c){var b=RSAKey.getHexValueArrayOfChildrenFromHex(c);this.setPrivateEx(b[1],b[2],b[3],b[4],b[5],b[6],b[7],b[8])},RSAKey.prototype.readPKCS8PrvKeyHex=function(e){var c,j,l,b,a,f,d,k,m=ASN1HEX,g=m.getVbyList;if(!1===m.isASN1HEX(e))throw"not ASN
.1 hex string
";try{c=g(e,0,[2,0,1],"02"),j=g(e,0,[2,0,2],"02"),l=g(e,0,[2,0,3],"02"),b=g(e,0,[2,0,4],"02"),a=g(e,0,[2,0,5],"02"),f=g(e,0,[2,0,6],"02"),d=g(e,0,[2,0,7],"02"),k=g(e,0,[2,0,8],"02")}catch(i){throw"malformed PKCS
#8 plain RSA
private key
"}this.setPrivateEx(c,j,l,b,a,f,d,k)},RSAKey.prototype.readPKCS5PubKeyHex=function(c){var e=ASN1HEX,b=e.getV;if(!1===e.isASN1HEX(c))throw"keyHex is not ASN
.1 hex string
";var a=e.getChildIdx(c,0);if(2!==a.length||"02"!==c.substr(a[0],2)||"02"!==c.substr(a[1],2))throw"wrong hex
for PKCS
#5 public key
";var f=b(c,a[0]),d=b(c,a[1]);this.setPublic(f,d)},RSAKey.prototype.readPKCS8PubKeyHex=function(b){var c=ASN1HEX;if(!1===c.isASN1HEX(b))throw"not ASN
.1 hex string
";if("06092a864886f70d010101
"!==c.getTLVbyList(b,0,[0,0]))throw"not PKCS8 RSA
public key
";var a=c.getTLVbyList(b,0,[1,0]);this.readPKCS5PubKeyHex(a)},RSAKey.prototype.readCertPubKeyHex=function(b,d){var a,c;(a=new X509).readCertHex(b),c=a.getPublicKeyHex(),this.readPKCS8PubKeyHex(c)};var _RE_HEXDECONLY=new RegExp("");function _zeroPaddingOfSignature(e,d){for(var c="",a=d/4-e.length,b=0;b<a;b++)c+="0";return c+e}function pss_mgf1_str(c,a,e){for(var b="",d=0;b.length<a;)b+=hextorstr(e(rstrtohex(c+String.fromCharCode.apply(String,[(4278190080&d)>>24,(16711680&d)>>16,(65280&d)>>8,255&d])))),d+=1;return b}function _rsasign_getAlgNameAndHashFromHexDisgestInfo(f){for(var e in KJUR.crypto.Util.DIGESTINFOHEAD){var d=KJUR.crypto.Util.DIGESTINFOHEAD[e],b=d.length;if(f.substring(0,b)==d)return[e,f.substring(b)]}return[]}function X509(){var k=ASN1HEX,j=k.getChildIdx,h=k.getV,b=k.getTLV,f=k.getVbyList,c=k.getTLVbyList,g=k.getIdxbyList,d=k.getVidx,i=k.oidname,a=X509,e=pemtohex;this.hex=null,this.version=0,this.foffset=0,this.aExtInfo=null,this.getVersion=function(){return null===this.hex||0!==this.version?this.version:"a003020102
"!==c(this.hex,0,[0,0])?(this.version=1,this.foffset=-1,1):(this.version=3,3)},this.getSerialNumberHex=function(){return f(this.hex,0,[0,1+this.foffset],"02")},this.getSignatureAlgorithmField=function(){return i(f(this.hex,0,[0,2+this.foffset,0],"06"))},this.getIssuerHex=function(){return c(this.hex,0,[0,3+this.foffset],"30")},this.getIssuerString=function(){return a.hex2dn(this.getIssuerHex())},this.getSubjectHex=function(){return c(this.hex,0,[0,5+this.foffset],"30")},this.getSubjectString=function(){return a.hex2dn(this.getSubjectHex())},this.getNotBefore=function(){var l=f(this.hex,0,[0,4+this.foffset,0]);return l=l.replace(/(..)/g,"%$1"),l=decodeURIComponent(l)},this.getNotAfter=function(){var l=f(this.hex,0,[0,4+this.foffset,1]);return l=l.replace(/(..)/g,"%$1"),l=decodeURIComponent(l)},this.getPublicKeyHex=function(){return k.getTLVbyList(this.hex,0,[0,6+this.foffset],"30")},this.getPublicKeyIdx=function(){return g(this.hex,0,[0,6+this.foffset],"30")},this.getPublicKeyContentIdx=function(){var l=this.getPublicKeyIdx();return g(this.hex,l,[1,0],"30")},this.getPublicKey=function(){return KEYUTIL.getKey(this.getPublicKeyHex(),null,"pkcs8pub
")},this.getSignatureAlgorithmName=function(){return i(f(this.hex,0,[1,0],"06"))},this.getSignatureValueHex=function(){return f(this.hex,0,[2],"03",!0)},this.verifySignature=function(n){var o=this.getSignatureAlgorithmName(),l=this.getSignatureValueHex(),m=c(this.hex,0,[0],"30"),p=new KJUR.crypto.Signature({alg:o});return p.init(n),p.updateHex(m),p.verify(l)},this.parseExt=function(){if(3!==this.version)return-1;var p=g(this.hex,0,[0,7,0],"30"),m=j(this.hex,p);this.aExtInfo=new Array;for(var n=0;n<m.length;n++){var q={critical:!1},r=0;3===j(this.hex,m[n]).length&&(q.critical=!0,r=1),q.oid=k.hextooidstr(f(this.hex,m[n],[0],"06"));var o=g(this.hex,m[n],[1+r]);q.vidx=d(this.hex,o),this.aExtInfo.push(q)}},this.getExtInfo=function(n){var l=this.aExtInfo,o=n;if(n.match(/^[0-9.]+$/)||(o=KJUR.asn1.x509.OID.name2oid(n)),""!==o)for(var m=0;m<l.length;m++)if(l[m].oid===o)return l[m]},this.getExtBasicConstraints=function(){var n=this.getExtInfo("basicConstraints
");if(void 0===n)return n;var l=h(this.hex,n.vidx);if(""===l)return{};if("0101ff
"===l)return{cA:!0};if("0101ff02
"===l.substr(0,8)){var o=h(l,6);return{cA:!0,pathLen:parseInt(o,16)}}throw"basicConstraints parse error
"},this.getExtKeyUsageBin=function(){var o=this.getExtInfo("keyUsage
");if(void 0===o)return"";var m=h(this.hex,o.vidx);if(m.length%2!=0||m.length<=2)throw"malformed key usage value
";var l=parseInt(m.substr(0,2)),n=parseInt(m.substr(2),16).toString(2);return n.substr(0,n.length-l)},this.getExtKeyUsageString=function(){for(var n=this.getExtKeyUsageBin(),l=new Array,m=0;m<n.length;m++)"1"==n.substr(m,1)&&l.push(X509.KEYUSAGE_NAME[m]);return l.join(",")},this.getExtSubjectKeyIdentifier=function(){var l=this.getExtInfo("subjectKeyIdentifier
");return void 0===l?l:h(this.hex,l.vidx)},this.getExtAuthorityKeyIdentifier=function(){var p=this.getExtInfo("authorityKeyIdentifier
");if(void 0===p)return p;for(var l={},o=b(this.hex,p.vidx),m=j(o,0),n=0;n<m.length;n++)"80"===o.substr(m[n],2)&&(l.kid=h(o,m[n]));return l},this.getExtExtKeyUsageName=function(){var p=this.getExtInfo("extKeyUsage
");if(void 0===p)return p;var l=new Array,o=b(this.hex,p.vidx);if(""===o)return l;for(var m=j(o,0),n=0;n<m.length;n++)l.push(i(h(o,m[n])));return l},this.getExtSubjectAltName=function(){for(var m=this.getExtSubjectAltName2(),l=new Array,n=0;n<m.length;n++)"DNS
"===m[n][0]&&l.push(m[n][1]);return l},this.getExtSubjectAltName2=function(){var p,s,r,q=this.getExtInfo("subjectAltName
");if(void 0===q)return q;for(var l=new Array,o=b(this.hex,q.vidx),m=j(o,0),n=0;n<m.length;n++)r=o.substr(m[n],2),p=h(o,m[n]),"81"===r&&(s=hextoutf8(p),l.push(["MAIL
",s])),"82"===r&&(s=hextoutf8(p),l.push(["DNS
",s])),"84"===r&&(s=X509.hex2dn(p,0),l.push(["DN
",s])),"86"===r&&(s=hextoutf8(p),l.push(["URI
",s])),"87"===r&&(s=hextoip(p),l.push(["IP
",s]));return l},this.getExtCRLDistributionPointsURI=function(){var q=this.getExtInfo("cRLDistributionPoints
");if(void 0===q)return q;for(var l=new Array,m=j(this.hex,q.vidx),o=0;o<m.length;o++)try{var p=hextoutf8(f(this.hex,m[o],[0,0,0],"86"));l.push(p)}catch(n){}return l},this.getExtAIAInfo=function(){var p=this.getExtInfo("authorityInfoAccess
");if(void 0===p)return p;for(var l={ocsp:[],caissuer:[]},m=j(this.hex,p.vidx),n=0;n<m.length;n++){var q=f(this.hex,m[n],[0],"06"),o=f(this.hex,m[n],[1],"86");"2b06010505073001
"===q&&l.ocsp.push(hextoutf8(o)),"2b06010505073002
"===q&&l.caissuer.push(hextoutf8(o))}return l},this.getExtCertificatePolicies=function(){var o=this.getExtInfo("certificatePolicies
");if(void 0===o)return o;for(var l=b(this.hex,o.vidx),u=[],s=j(l,0),r=0;r<s.length;r++){var t={},n=j(l,s[r]);if(t.id=i(h(l,n[0])),2===n.length)for(var m=j(l,n[1]),q=0;q<m.length;q++){var p=f(l,m[q],[0],"06");"2b06010505070201
"===p?t.cps=hextoutf8(f(l,m[q],[1])):"2b06010505070202
"===p&&(t.unotice=hextoutf8(f(l,m[q],[1,0])))}u.push(t)}return u},this.readCertPEM=function(l){this.readCertHex(e(l))},this.readCertHex=function(l){this.hex=l,this.getVersion();try{g(this.hex,0,[0,7],"a3
"),this.parseExt()}catch(m){}},this.getInfo=function(){var B,u,z;if(B="Basic Fields
\n",B+=" serial
number: "+this.getSerialNumberHex()+"\n",B+=" signature
algorithm: "+this.getSignatureAlgorithmField()+"\n",B+=" issuer: "+this.getIssuerString()+"\n",B+=" notBefore: "+this.getNotBefore()+"\n",B+=" notAfter: "+this.getNotAfter()+"\n",B+=" subject: "+this.getSubjectString()+"\n",B+=" subject
public key
info: \n",B+=" key
algorithm: "+(u=this.getPublicKey()).type+"\n","RSA
"===u.type&&(B+=" n
="+hextoposhex(u.n.toString(16)).substr(0,16)+"...\n",B+=" e
="+hextoposhex(u.e.toString(16))+"\n"),null!=(z=this.aExtInfo)){B+="X509v3
Extensions:\n";for(var r=0;r<z.length;r++){var n=z[r],A=KJUR.asn1.x509.OID.oid2name(n.oid);""===A&&(A=n.oid);var x="";if(!0===n.critical&&(x="CRITICAL
"),B+=" "+A+" "+x+":\n","basicConstraints
"===A){var v=this.getExtBasicConstraints();void 0===v.cA?B+=" {}\n":(B+=" cA
=true",void 0!==v.pathLen&&(B+=", pathLen
="+v.pathLen),B+="\n")}else if("keyUsage
"===A)B+=" "+this.getExtKeyUsageString()+"\n";else if("subjectKeyIdentifier
"===A)B+=" "+this.getExtSubjectKeyIdentifier()+"\n";else if("authorityKeyIdentifier
"===A){var l=this.getExtAuthorityKeyIdentifier();void 0!==l.kid&&(B+=" kid
="+l.kid+"\n")}else{if("extKeyUsage
"===A)B+=" "+this.getExtExtKeyUsageName().join(", ")+"\n";else if("subjectAltName
"===A)B+=" "+this.getExtSubjectAltName2()+"\n";else if("cRLDistributionPoints
"===A)B+=" "+this.getExtCRLDistributionPointsURI()+"\n";else if("authorityInfoAccess
"===A){var p=this.getExtAIAInfo();void 0!==p.ocsp&&(B+=" ocsp: "+p.ocsp.join(",")+"\n"),void 0!==p.caissuer&&(B+=" caissuer: "+p.caissuer.join(",")+"\n")}else if("certificatePolicies
"===A)for(var o=this.getExtCertificatePolicies(),q=0;q<o.length;q++)void 0!==o[q].id&&(B+=" policy
oid: "+o[q].id+"\n"),void 0!==o[q].cps&&(B+=" cps: "+o[q].cps+"\n")}}}return B+="signature
algorithm: "+this.getSignatureAlgorithmName()+"\n",B+="signature: "+this.getSignatureValueHex().substr(0,16)+"...\n"}}_RE_HEXDECONLY.compile("[^0-9a
-f
]","gi
"),RSAKey.prototype.sign=function(d,a){var c=function(e){return KJUR.crypto.Util.hashString(e,a)}(d);return this.signWithMessageHash(c,a)},RSAKey.prototype.signWithMessageHash=function(e,c){var b=parseBigInt(KJUR.crypto.Util.getPaddedDigestInfoHex(e,c,this.n.bitLength()),16);return _zeroPaddingOfSignature(this.doPrivate(b).toString(16),this.n.bitLength())},RSAKey.prototype.signPSS=function(e,a,d){var f,b=(f=rstrtohex(e),KJUR.crypto.Util.hashHex(f,a));return void 0===d&&(d=-1),this.signWithMessageHashPSS(b,a,d)},RSAKey.prototype.signWithMessageHashPSS=function(l,a,k){var d,b=hextorstr(l),g=b.length,m=this.n.bitLength()-1,c=Math.ceil(m/8),o=function(i){return KJUR.crypto.Util.hashHex(i,a)};if(-1===k||void 0===k)k=g;else if(-2===k)k=c-g-2;else if(k<-2)throw"invalid salt length
";if(c<g+k+2)throw"data too
long";var f="";k>0&&(f=new Array(k),(new SecureRandom).nextBytes(f),f=String.fromCharCode.apply(String,f));var n=hextorstr(o(rstrtohex("\0\0\0\0\0\0\0\0"+b+f))),j=[];for(d=0;d<c-k-g-2;d+=1)j[d]=0;var e=String.fromCharCode.apply(String,j)+"\ 1"+f,h=pss_mgf1_str(n,e.length,o),q=[];for(d=0;d<e.length;d+=1)q[d]=e.charCodeAt(d)^h.charCodeAt(d);var p=65280>>8*c-m&255;for(q[0]&=~p,d=0;d<g;d++)q.push(n.charCodeAt(d));return q.push(188),_zeroPaddingOfSignature(this.doPrivate(new BigInteger(q)).toString(16),this.n.bitLength())},RSAKey.prototype.verify=function(f,j){var b=parseBigInt(j=(j=j.replace(_RE_HEXDECONLY,"")).replace(/[ \n]+/g,""),16);if(b.bitLength()>this.n.bitLength())return 0;var g=_rsasign_getAlgNameAndHashFromHexDisgestInfo(this.doPublic(b).toString(16).replace(/^1f+00/,""));if(0==g.length)return!1;var d=g[0];return g[1]==function(k){return KJUR.crypto.Util.hashString(k,d)}(f)},RSAKey.prototype.verifyWithMessageHash=function(e,a){var b=parseBigInt(a=(a=a.replace(_RE_HEXDECONLY,"")).replace(/[ \n]+/g,""),16);if(b.bitLength()>this.n.bitLength())return 0;var c=_rsasign_getAlgNameAndHashFromHexDisgestInfo(this.doPublic(b).toString(16).replace(/^1f+00/,""));if(0==c.length)return!1;c[0];return c[1]==e},RSAKey.prototype.verifyPSS=function(c,b,a,f){var g,d=(g=rstrtohex(c),KJUR.crypto.Util.hashHex(g,a));return void 0===f&&(f=-1),this.verifyWithMessageHashPSS(d,b,a,f)},RSAKey.prototype.verifyWithMessageHashPSS=function(f,s,l,c){var k=new BigInteger(s,16);if(k.bitLength()>this.n.bitLength())return!1;var q,r=function(i){return KJUR.crypto.Util.hashHex(i,l)},j=hextorstr(f),h=j.length,g=this.n.bitLength()-1,m=Math.ceil(g/8);if(-1===c||void 0===c)c=h;else if(-2===c)c=m-h-2;else if(c<-2)throw"invalid salt length
";if(m<h+c+2)throw"data too
long";var a=this.doPublic(k).toByteArray();for(q=0;q<a.length;q+=1)a[q]&=255;for(;a.length<m;)a.unshift(0);if(188!==a[m-1])throw"encoded message does not end
in 0xbc";var d=(a=String.fromCharCode.apply(String,a)).substr(0,m-h-1),e=a.substr(d.length,h),p=65280>>8*m-g&255;if(0!=(d.charCodeAt(0)&p))throw"bits beyond keysize not zero
";var n=pss_mgf1_str(e,d.length,r),o=[];for(q=0;q<d.length;q+=1)o[q]=d.charCodeAt(q)^n.charCodeAt(q);o[0]&=~p;var b=m-h-c-2;for(q=0;q<b;q+=1)if(0!==o[q])throw"leftmost octets not zero
";if(1!==o[b])throw"0x01 marker not found
";return e===hextorstr(r(rstrtohex("\0\0\0\0\0\0\0\0"+j+String.fromCharCode.apply(String,o.slice(-c)))))},RSAKey.SALT_LEN_HLEN=-1,RSAKey.SALT_LEN_MAX=-2,RSAKey.SALT_LEN_RECOVER=-2,X509.hex2dn=function(f,b){if(void 0===b&&(b=0),"30"!==f.substr(b,2))throw"malformed DN
";for(var c=new Array,d=ASN1HEX.getChildIdx(f,b),e=0;e<d.length;e++)c.push(X509.hex2rdn(f,d[e]));return"/"+(c=c.map((function(a){return a.replace("/","\\/")}))).join("/")},X509.hex2rdn=function(f,b){if(void 0===b&&(b=0),"31"!==f.substr(b,2))throw"malformed RDN
";for(var c=new Array,d=ASN1HEX.getChildIdx(f,b),e=0;e<d.length;e++)c.push(X509.hex2attrTypeValue(f,d[e]));return(c=c.map((function(a){return a.replace("+","\\+")}))).join("+")},X509.hex2attrTypeValue=function(d,i){var j=ASN1HEX,h=j.getV;if(void 0===i&&(i=0),"30"!==d.substr(i,2))throw"malformed attribute type and value
";var g=j.getChildIdx(d,i);2!==g.length||d.substr(g[0],2);var b=h(d,g[0]),f=KJUR.asn1.ASN1Util.oidHexToInt(b);return KJUR.asn1.x509.OID.oid2atype(f)+"="+hextorstr(h(d,g[1]))},X509.getPublicKeyFromCertHex=function(b){var a=new X509;return a.readCertHex(b),a.getPublicKey()},X509.getPublicKeyFromCertPEM=function(b){var a=new X509;return a.readCertPEM(b),a.getPublicKey()},X509.getPublicKeyInfoPropOfCertPEM=function(c){var a,f,g=ASN1HEX.getVbyList,b={};return b.algparam=null,(a=new X509).readCertPEM(c),f=a.getPublicKeyHex(),b.keyhex=g(f,0,[1],"03").substr(2),b.algoid=g(f,0,[0,0],"06"),"2a8648ce3d0201
"===b.algoid&&(b.algparam=g(f,0,[0,1],"06")),b},X509.KEYUSAGE_NAME=["digitalSignature
","nonRepudiation
","keyEncipherment
","dataEncipherment
","keyAgreement
","keyCertSign
","cRLSign
","encipherOnly
","decipherOnly
"],void 0!==KJUR&&KJUR||(KJUR={}),void 0!==KJUR.jws&&KJUR.jws||(KJUR.jws={}),KJUR.jws.JWS=function(){var c=KJUR.jws.JWS.isSafeJSONString;this.parseJWS=function(g,j){if(void 0===this.parsedJWS||!j&&void 0===this.parsedJWS.sigvalH){var i=g.match(/^([^.]+)\.([^.]+)\.([^.]+)$/);if(null==i)throw"JWS signature is not a form
of 'Head.Payload.SigValue'.";var k=i[1],e=i[2],l=i[3],n=k+"."+e;if(this.parsedJWS={},this.parsedJWS.headB64U=k,this.parsedJWS.payloadB64U=e,this.parsedJWS.sigvalB64U=l,this.parsedJWS.si=n,!j){var h=b64utohex(l),f=parseBigInt(h,16);this.parsedJWS.sigvalH=h,this.parsedJWS.sigvalBI=f}var d=b64utoutf8(k),m=b64utoutf8(e);if(this.parsedJWS.headS=d,this.parsedJWS.payloadS=m,!c(d,this.parsedJWS,"headP
"))throw"malformed JSON string
for JWS
Head: "+d}}},KJUR.jws.JWS.sign=function(i,v,y,z,a){var s,j,n,w=KJUR,q=w.jws.JWS,g=q.readSafeJSONString,p=q.isSafeJSONString,d=w.crypto,o=(d.ECDSA,d.Mac),c=d.Signature,t=JSON;if("string
"!=typeof v&&"object
"!=typeof v)throw"spHeader must be JSON string or
object: "+v;if("object
"==typeof v&&(j=v,s=t.stringify(j)),"string
"==typeof v){if(!p(s=v))throw"JWS Head is not safe JSON
string: "+s;j=g(s)}if(n=y,"object
"==typeof y&&(n=t.stringify(y)),""!=i&&null!=i||void 0===j.alg||(i=j.alg),""!=i&&null!=i&&void 0===j.alg&&(j.alg=i,s=t.stringify(j)),i!==j.alg)throw"alg and sHeader
.alg doesn
't match: "+i+"!="+j.alg;var r=null;if(void 0===q.jwsalg2sigalg[i])throw"unsupported alg name: "+i;r=q.jwsalg2sigalg[i];var b=utf8tob64u(s)+"."+utf8tob64u(n),x="";if("Hmac"==r.substr(0,4)){if(void 0===z)throw"mac key shall be specified for HS* alg";var h=new o({alg:r,prov:"cryptojs",pass:z});h.updateString(b),x=h.doFinal()}else{var f;if(-1!=r.indexOf("withECDSA"))(f=new c({alg:r})).init(z,a),f.updateString(b),hASN1Sig=f.sign(),x=KJUR.crypto.ECDSA.asn1SigToConcatSig(hASN1Sig);else if("none"!=r)(f=new c({alg:r})).init(z,a),f.updateString(b),x=f.sign()}return b+"."+hextob64u(x)},KJUR.jws.JWS.verify=function(w,B,n){var m,x=KJUR,t=x.jws.JWS,i=t.readSafeJSONString,e=x.crypto,p=e.ECDSA,s=e.Mac,d=e.Signature;m=RSAKey;var y=w.split(".");if(3!==y.length)return!1;var c=y[0]+"."+y[1],A=b64utohex(y[2]),l=i(b64utoutf8(y[0])),k=null,z=null;if(void 0===l.alg)throw"algorithm not specified in header";if((z=(k=l.alg).substr(0,2),null!=n&&"[object Array]"===Object.prototype.toString.call(n)&&n.length>0)&&-1==(":"+n.join(":")+":").indexOf(":"+k+":"))throw"algorithm '"+k+"' not accepted in the list";if("none"!=k&&null===B)throw"key shall be specified to verify.";if("string"==typeof B&&-1!=B.indexOf("-----BEGIN ")&&(B=KEYUTIL.getKey(B)),!("RS"!=z&&"PS"!=z||B instanceof m))throw"key shall be a RSAKey obj for RS* and PS* algs";if("ES"==z&&!(B instanceof p))throw"key shall be a ECDSA obj for ES* algs";var u=null;if(void 0===t.jwsalg2sigalg[l.alg])throw"unsupported alg name: "+k;if("none"==(u=t.jwsalg2sigalg[k]))throw"not supported";if("Hmac"==u.substr(0,4)){if(void 0===B)throw"hexadecimal key shall be specified for HMAC";var j=new s({alg:u,pass:B});return j.updateString(c),A==j.doFinal()}if(-1!=u.indexOf("withECDSA")){var g,h=null;try{h=p.concatSigToASN1Sig(A)}catch(v){return!1}return(g=new d({alg:u})).init(B),g.updateString(c),g.verify(h)}return(g=new d({alg:u})).init(B),g.updateString(c),g.verify(A)},KJUR.jws.JWS.parse=function(g){var f,e,d,c=g.split("."),b={};if(2!=c.length&&3!=c.length)throw"malformed sJWS: wrong number of '.' splitted elements";return f=c[0],e=c[1],3==c.length&&(d=c[2]),b.headerObj=KJUR.jws.JWS.readSafeJSONString(b64utoutf8(f)),b.payloadObj=KJUR.jws.JWS.readSafeJSONString(b64utoutf8(e)),b.headerPP=JSON.stringify(b.headerObj,null," "),null==b.payloadObj?b.payloadPP=b64utoutf8(e):b.payloadPP=JSON.stringify(b.payloadObj,null," "),void 0!==d&&(b.sigHex=b64utohex(d)),b},KJUR.jws.JWS.verifyJWT=function(e,l,r){var j=KJUR.jws,o=j.JWS,n=o.readSafeJSONString,p=o.inArray,f=o.includedArray,k=e.split("."),c=k[0],i=k[1],h=(b64utohex(k[2]),n(b64utoutf8(c))),g=n(b64utoutf8(i));if(void 0===h.alg)return!1;if(void 0===r.alg)throw"acceptField.alg shall be specified";if(!p(h.alg,r.alg))return!1;if(void 0!==g.iss&&"object"==typeof r.iss&&!p(g.iss,r.iss))return!1;if(void 0!==g.sub&&"object"==typeof r.sub&&!p(g.sub,r.sub))return!1;if(void 0!==g.aud&&"object"==typeof r.aud)if("string"==typeof g.aud){if(!p(g.aud,r.aud))return!1}else if("object"==typeof g.aud&&!f(g.aud,r.aud))return!1;var b=j.IntDate.getNow();return void 0!==r.verifyAt&&"number"==typeof r.verifyAt&&(b=r.verifyAt),void 0!==r.gracePeriod&&"number"==typeof r.gracePeriod||(r.gracePeriod=0),!(void 0!==g.exp&&"number"==typeof g.exp&&g.exp+r.gracePeriod<b)&&(!(void 0!==g.nbf&&"number"==typeof g.nbf&&b<g.nbf-r.gracePeriod)&&(!(void 0!==g.iat&&"number"==typeof g.iat&&b<g.iat-r.gracePeriod)&&((void 0===g.jti||void 0===r.jti||g.jti===r.jti)&&!!o.verify(e,l,r.alg))))},KJUR.jws.JWS.includedArray=function(b,a){var c=KJUR.jws.JWS.inArray;if(null===b)return!1;if("object"!=typeof b)return!1;if("number"!=typeof b.length)return!1;for(var d=0;d<b.length;d++)if(!c(b[d],a))return!1;return!0},KJUR.jws.JWS.inArray=function(d,b){if(null===b)return!1;if("object"!=typeof b)return!1;if("number"!=typeof b.length)return!1;for(var c=0;c<b.length;c++)if(b[c]==d)return!0;return!1},KJUR.jws.JWS.jwsalg2sigalg={HS256:"HmacSHA256",HS384:"HmacSHA384",HS512:"HmacSHA512",RS256:"SHA256withRSA",RS384:"SHA384withRSA",RS512:"SHA512withRSA",ES256:"SHA256withECDSA",ES384:"SHA384withECDSA",PS256:"SHA256withRSAandMGF1",PS384:"SHA384withRSAandMGF1",PS512:"SHA512withRSAandMGF1",none:"none"},KJUR.jws.JWS.isSafeJSONString=function(c,b,d){var e=null;try{return"object"!=typeof(e=jsonParse(c))?0:e.constructor===Array?0:(b&&(b[d]=e),1)}catch(a){return 0}},KJUR.jws.JWS.readSafeJSONString=function(b){var c=null;try{return"object"!=typeof(c=jsonParse(b))?null:c.constructor===Array?null:c}catch(a){return null}},KJUR.jws.JWS.getEncodedSignatureValueFromJWS=function(b){var a=b.match(/^[^.]+\.[^.]+\.([^.]+)$/);if(null==a)throw"JWS signature is not a form of 'Head
.Payload
.SigValue
'.";return a[1]},KJUR.jws.JWS.getJWKthumbprint=function(d){if("RSA"!==d.kty&&"EC"!==d.kty&&"oct"!==d.kty)throw"unsupported algorithm for JWK Thumprint";var a="{";if("RSA"===d.kty){if("string"!=typeof d.n||"string"!=typeof d.e)throw"wrong n and e value for RSA key";a+='"e":"'+d.e+'",',a+='"kty":"'+d.kty+'",',a+='"n":"'+d.n+'"}'}else if("EC"===d.kty){if("string"!=typeof d.crv||"string"!=typeof d.x||"string"!=typeof d.y)throw"wrong crv, x and y value for EC key";a+='"crv":"'+d.crv+'",',a+='"kty":"'+d.kty+'",',a+='"x":"'+d.x+'",',a+='"y":"'+d.y+'"}'}else if("oct"===d.kty){if("string"!=typeof d.k)throw"wrong k value for oct(symmetric) key";a+='"kty":"'+d.kty+'",',a+='"k":"'+d.k+'"}'}var b=rstrtohex(a);return hextob64u(KJUR.crypto.Util.hashHex(b,"sha256"))},KJUR.jws.IntDate={},KJUR.jws.IntDate.get=function(c){var b=KJUR.jws.IntDate,d=b.getNow,a=b.getZulu;if("now"==c)return d();if("now + 1hour"==c)return d()+3600;if("now + 1day"==c)return d()+86400;if("now + 1month"==c)return d()+2592e3;if("now + 1year"==c)return d()+31536e3;if(c.match(/Z$/))return a(c);if(c.match(/^[0-9]+$/))return parseInt(c);throw"unsupported format: "+c},KJUR.jws.IntDate.getZulu=function(a){return zulutosec(a)},KJUR.jws.IntDate.getNow=function(){return~~(new Date/1e3)},KJUR.jws.IntDate.intDate2UTCString=function(a){return new Date(1e3*a).toUTCString()},KJUR.jws.IntDate.intDate2Zulu=function(e){var i=new Date(1e3*e);return("0000"+i.getUTCFullYear()).slice(-4)+("00"+(i.getUTCMonth()+1)).slice(-2)+("00"+i.getUTCDate()).slice(-2)+("00"+i.getUTCHours()).slice(-2)+("00"+i.getUTCMinutes()).slice(-2)+("00"+i.getUTCSeconds()).slice(-2)+"Z"},void 0!==KJUR&&KJUR||(KJUR={}),void 0!==KJUR.jws&&KJUR.jws||(KJUR.jws={}),KJUR.jws.JWSJS=function(){var a=KJUR.jws.JWS,d=a.readSafeJSONString;this.aHeader=[],this.sPayload="",this.aSignature=[],this.init=function(){this.aHeader=[],this.sPayload=void 0,this.aSignature=[]},this.initWithJWS=function(f){this.init();var e=f.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(e,h,m,k){if(void 0===this.sPayload||null===this.sPayload)throw"there's no JSON
-JS signature to add
.";var l=this.aHeader.length;if(this.aHeader.length!=this.aSignature.length)throw"aHeader
.length
!= aSignature
.length
";try{var j=KJUR.jws.JWS.sign(e,h,this.sPayload,m,k).split(".");j[0],j[2];this.aHeader.push(j[0]),this.aSignature.push(j[2])}catch(i){throw this.aHeader.length>l&&this.aHeader.pop(),this.aSignature.length>l&&this.aSignature.pop(),"addSignature
failed: "+i}},this.verifyAll=function(h){if(this.aHeader.length!==h.length||this.aSignature.length!==h.length)return!1;for(var g=0;g<h.length;g++){var f=h[g];if(2!==f.length)return!1;if(!1===this.verifyNth(g,f[0],f[1]))return!1}return!0},this.verifyNth=function(f,j,g){if(this.aHeader.length<=f||this.aSignature.length<=f)return!1;var h=this.aHeader[f],k=this.aSignature[f],l=h+"."+this.sPayload+"."+k,e=!1;try{e=a.verify(l,j,g)}catch(i){return!1}return e},this.readJWSJS=function(g){if("string
"==typeof g){var f=d(g);if(null==f)throw"argument is not safe JSON object string
";this.aHeader=f.headers,this.sPayload=f.payload,this.aSignature=f.signatures}else try{if(!(g.headers.length>0))throw"malformed header
";if(this.aHeader=g.headers,"string
"!=typeof g.payload)throw"malformed signatures
";if(this.sPayload=g.payload,!(g.signatures.length>0))throw"malformed signatures
";this.aSignatures=g.signatures}catch(e){throw"malformed JWS
-JS JSON
object: "+e}},this.getJSON=function(){return{headers:this.aHeader,payload:this.sPayload,signatures:this.aSignature}},this.isEmpty=function(){return 0==this.aHeader.length?1:0}},exports.SecureRandom=SecureRandom,exports.rng_seed_time=rng_seed_time,exports.BigInteger=BigInteger,exports.RSAKey=RSAKey,exports.ECDSA=KJUR.crypto.ECDSA,exports.DSA=KJUR.crypto.DSA,exports.Signature=KJUR.crypto.Signature,exports.MessageDigest=KJUR.crypto.MessageDigest,exports.Mac=KJUR.crypto.Mac,exports.Cipher=KJUR.crypto.Cipher,exports.KEYUTIL=KEYUTIL,exports.ASN1HEX=ASN1HEX,exports.X509=X509,exports.CryptoJS=CryptoJS,exports.b64tohex=b64tohex,exports.b64toBA=b64toBA,exports.stoBA=stoBA,exports.BAtos=BAtos,exports.BAtohex=BAtohex,exports.stohex=stohex,exports.stob64=function(a){return hex2b64(stohex(a))},exports.stob64u=function(a){return b64tob64u(hex2b64(stohex(a)))},exports.b64utos=function(a){return BAtos(b64toBA(b64utob64(a)))},exports.b64tob64u=b64tob64u,exports.b64utob64=b64utob64,exports.hex2b64=hex2b64,exports.hextob64u=hextob64u,exports.b64utohex=b64utohex,exports.utf8tob64u=utf8tob64u,exports.b64utoutf8=b64utoutf8,exports.utf8tob64=function(a){return hex2b64(uricmptohex(encodeURIComponentAll(a)))},exports.b64toutf8=function(a){return decodeURIComponent(hextouricmp(b64tohex(a)))},exports.utf8tohex=utf8tohex,exports.hextoutf8=hextoutf8,exports.hextorstr=hextorstr,exports.rstrtohex=rstrtohex,exports.hextob64=hextob64,exports.hextob64nl=hextob64nl,exports.b64nltohex=b64nltohex,exports.hextopem=hextopem,exports.pemtohex=pemtohex,exports.hextoArrayBuffer=function(d){if(d.length%2!=0)throw"input is not even length
";if(null==d.match(/^[0-9A-Fa-f]+$/))throw"input is not hexadecimal
";for(var b=new ArrayBuffer(d.length/2),a=new DataView(b),c=0;c<d.length/2;c++)a.setUint8(c,parseInt(d.substr(2*c,2),16));return b},exports.ArrayBuffertohex=function(b){for(var d="",a=new DataView(b),c=0;c<b.byteLength;c++)d+=("00"+a.getUint8(c).toString(16)).slice(-2);return d},exports.zulutomsec=zulutomsec,exports.zulutosec=zulutosec,exports.zulutodate=function(a){return new Date(zulutomsec(a))},exports.datetozulu=function(g,e,f){var b,a=g.getUTCFullYear();if(e){if(a<1950||2049<a)throw"not proper year
for UTCTime: "+a;b=(""+a).slice(-2)}else b=("000"+a).slice(-4);if(b+=("0"+(g.getUTCMonth()+1)).slice(-2),b+=("0"+g.getUTCDate()).slice(-2),b+=("0"+g.getUTCHours()).slice(-2),b+=("0"+g.getUTCMinutes()).slice(-2),b+=("0"+g.getUTCSeconds()).slice(-2),f){var c=g.getUTCMilliseconds();0!==c&&(b+="."+(c=(c=("00"+c).slice(-3)).replace(/0+$/g,"")))}return b+="Z
"},exports.uricmptohex=uricmptohex,exports.hextouricmp=hextouricmp,exports.ipv6tohex=ipv6tohex,exports.hextoipv6=hextoipv6,exports.hextoip=hextoip,exports.iptohex=function(f){var j="malformed IP address
";if(!(f=f.toLowerCase(f)).match(/^[0-9.]+$/)){if(f.match(/^[0-9a-f:]+$/)&&-1!==f.indexOf(":"))return ipv6tohex(f);throw j}var b=f.split(".");if(4!==b.length)throw j;var g="";try{for(var e=0;e<4;e++){g+=("0"+parseInt(b[e]).toString(16)).slice(-2)}return g}catch(c){throw j}},exports.encodeURIComponentAll=encodeURIComponentAll,exports.newline_toUnix=function(a){return a=a.replace(/\r\n/gm,"\n")},exports.newline_toDos=function(a){return a=(a=a.replace(/\r\n/gm,"\n")).replace(/\n/gm,"\r\n")},exports.hextoposhex=hextoposhex,exports.intarystrtohex=intarystrtohex,exports.strdiffidx=function(c,a){var d=c.length;c.length>a.length&&(d=a.length);for(var b=0;b<d;b++)if(c.charCodeAt(b)!=a.charCodeAt(b))return b;return c.length!=a.length?d:-1},exports.KJUR=KJUR,exports.crypto=KJUR.crypto,exports.asn1=KJUR.asn1,exports.jws=KJUR.jws,exports.lang=KJUR.lang}).call(this,require("buffer
").Buffer)},{buffer:51}],252:[function(require,module,exports){(function(global){(function(){var undefined,LARGE_ARRAY_SIZE=200,CORE_ERROR_TEXT="Unsupported core
-js
use. Try
https://npms.io/search?q=ponyfill.",FUNC_ERROR_TEXT="Expected a function",HASH_UNDEFINED="__lodash_hash_undefined__",MAX_MEMOIZE_SIZE=500,PLACEHOLDER="__lodash_placeholder__",CLONE_DEEP_FLAG=1,CLONE_FLAT_FLAG=2,CLONE_SYMBOLS_FLAG=4,COMPARE_PARTIAL_FLAG=1,COMPARE_UNORDERED_FLAG=2,WRAP_BIND_FLAG=1,WRAP_BIND_KEY_FLAG=2,WRAP_CURRY_BOUND_FLAG=4,WRAP_CURRY_FLAG=8,WRAP_CURRY_RIGHT_FLAG=16,WRAP_PARTIAL_FLAG=32,WRAP_PARTIAL_RIGHT_FLAG=64,WRAP_ARY_FLAG=128,WRAP_REARG_FLAG=256,WRAP_FLIP_FLAG=512,DEFAULT_TRUNC_LENGTH=30,DEFAULT_TRUNC_OMISSION="...",HOT_COUNT=800,HOT_SPAN=16,LAZY_FILTER_FLAG=1,LAZY_MAP_FLAG=2,INFINITY=1/0,MAX_SAFE_INTEGER=9007199254740991,MAX_INTEGER=17976931348623157e292,NAN=NaN,MAX_ARRAY_LENGTH=4294967295,MAX_ARRAY_INDEX=MAX_ARRAY_LENGTH-1,HALF_MAX_ARRAY_LENGTH=MAX_ARRAY_LENGTH>>>1,wrapFlags=[["ary",WRAP_ARY_FLAG],["bind",WRAP_BIND_FLAG],["bindKey",WRAP_BIND_KEY_FLAG],["curry",WRAP_CURRY_FLAG],["curryRight",WRAP_CURRY_RIGHT_FLAG],["flip",WRAP_FLIP_FLAG],["partial",WRAP_PARTIAL_FLAG],["partialRight",WRAP_PARTIAL_RIGHT_FLAG],["rearg",WRAP_REARG_FLAG]],argsTag="[object Arguments]",arrayTag="[object Array]",asyncTag="[object AsyncFunction]",boolTag="[object Boolean]",dateTag="[object Date]",domExcTag="[object DOMException]",errorTag="[object Error]",funcTag="[object Function]",genTag="[object GeneratorFunction]",mapTag="[object Map]",numberTag="[object Number]",nullTag="[object Null]",objectTag="[object Object]",proxyTag="[object Proxy]",regexpTag="[object RegExp]",setTag="[object Set]",stringTag="[object String]",symbolTag="[object Symbol]",undefinedTag="[object Undefined]",weakMapTag="[object WeakMap]",weakSetTag="[object WeakSet]",arrayBufferTag="[object ArrayBuffer]",dataViewTag="[object DataView]",float32Tag="[object Float32Array]",float64Tag="[object Float64Array]",int8Tag="[object Int8Array]",int16Tag="[object Int16Array]",int32Tag="[object Int32Array]",uint8Tag="[object Uint8Array]",uint8ClampedTag="[object Uint8ClampedArray]",uint16Tag="[object Uint16Array]",uint32Tag="[object Uint32Array]",reEmptyStringLeading=/\b__p \+= '';/g,reEmptyStringMiddle=/\b(__p \+=) '' \+/g,reEmptyStringTrailing=/(__e\(.*?\)|\b__t\)) \+\n'';/g,reEscapedHtml=/&(?:amp|lt|gt|quot|#39);/g,reUnescapedHtml=/[&<>"']/g,reHasEscapedHtml=RegExp(reEscapedHtml.source),reHasUnescapedHtml=RegExp(reUnescapedHtml.source),reEscape=/<%-([\s\S]+?)%>/g,reEvaluate=/<%([\s\S]+?)%>/g,reInterpolate=/<%=([\s\S]+?)%>/g,reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/,rePropName=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,reRegExpChar=/[\\^$.*+?()[\]{}|]/g,reHasRegExpChar=RegExp(reRegExpChar.source),reTrim=/^\s+|\s+$/g,reTrimStart=/^\s+/,reTrimEnd=/\s+$/,reWrapComment=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,reWrapDetails=/\{\n\/\* \[wrapped with (.+)\] \*/,reSplitDetails=/,? & /,reAsciiWord=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,reEscapeChar=/\\(\\)?/g,reEsTemplate=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,reFlags=/\w*$/,reIsBadHex=/^[-+]0x[0-9a-f]+$/i,reIsBinary=/^0b[01]+$/i,reIsHostCtor=/^\[object .+?Constructor\]$/,reIsOctal=/^0o[0-7]+$/i,reIsUint=/^(?:0|[1-9]\d*)$/,reLatin=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,reNoMatch=/($^)/,reUnescapedString=/['\n\r\u2028\u2029\\]/g,rsComboRange="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",rsBreakRange="\\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",rsAstral="[\\ud800-\\udfff]",rsBreak="["+rsBreakRange+"]",rsCombo="["+rsComboRange+"]",rsDigits="\\d+",rsDingbat="[\\u2700-\\u27bf]",rsLower="[a-z\\xdf-\\xf6\\xf8-\\xff]",rsMisc="[^\\ud800-\\udfff"+rsBreakRange+rsDigits+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",rsFitz="\\ud83c[\\udffb-\\udfff]",rsNonAstral="[^\\ud800-\\udfff]",rsRegional="(?:\\ud83c[\\udde6-\\uddff]){2}",rsSurrPair="[\\ud800-\\udbff][\\udc00-\\udfff]",rsUpper="[A-Z\\xc0-\\xd6\\xd8-\\xde]",rsMiscLower="(?:"+rsLower+"|"+rsMisc+")",rsMiscUpper="(?:"+rsUpper+"|"+rsMisc+")",reOptMod="(?:"+rsCombo+"|"+rsFitz+")"+"?",rsSeq="[\\ufe0e\\ufe0f]?"+reOptMod+("(?:\\u200d(?:"+[rsNonAstral,rsRegional,rsSurrPair].join("|")+")[\\ufe0e\\ufe0f]?"+reOptMod+")*"),rsEmoji="(?:"+[rsDingbat,rsRegional,rsSurrPair].join("|")+")"+rsSeq,rsSymbol="(?:"+[rsNonAstral+rsCombo+"?",rsCombo,rsRegional,rsSurrPair,rsAstral].join("|")+")",reApos=RegExp("['’]","g"),reComboMark=RegExp(rsCombo,"g"),reUnicode=RegExp(rsFitz+"(?="+rsFitz+")|"+rsSymbol+rsSeq,"g"),reUnicodeWord=RegExp([rsUpper+"?"+rsLower+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[rsBreak,rsUpper,"$"].join("|")+")",rsMiscUpper+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[rsBreak,rsUpper+rsMiscLower,"$"].join("|")+")",rsUpper+"?"+rsMiscLower+"+(?:['’](?:d|ll|m|re|s|t|ve))?",rsUpper+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",rsDigits,rsEmoji].join("|"),"g"),reHasUnicode=RegExp("[\\u200d\\ud800-\\udfff"+rsComboRange+"\\ufe0e\\ufe0f]"),reHasUnicodeWord=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,contextProps=["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"],templateCounter=-1,typedArrayTags={};typedArrayTags[float32Tag]=typedArrayTags[float64Tag]=typedArrayTags[int8Tag]=typedArrayTags[int16Tag]=typedArrayTags[int32Tag]=typedArrayTags[uint8Tag]=typedArrayTags[uint8ClampedTag]=typedArrayTags[uint16Tag]=typedArrayTags[uint32Tag]=!0,typedArrayTags[argsTag]=typedArrayTags[arrayTag]=typedArrayTags[arrayBufferTag]=typedArrayTags[boolTag]=typedArrayTags[dataViewTag]=typedArrayTags[dateTag]=typedArrayTags[errorTag]=typedArrayTags[funcTag]=typedArrayTags[mapTag]=typedArrayTags[numberTag]=typedArrayTags[objectTag]=typedArrayTags[regexpTag]=typedArrayTags[setTag]=typedArrayTags[stringTag]=typedArrayTags[weakMapTag]=!1;var cloneableTags={};cloneableTags[argsTag]=cloneableTags[arrayTag]=cloneableTags[arrayBufferTag]=cloneableTags[dataViewTag]=cloneableTags[boolTag]=cloneableTags[dateTag]=cloneableTags[float32Tag]=cloneableTags[float64Tag]=cloneableTags[int8Tag]=cloneableTags[int16Tag]=cloneableTags[int32Tag]=cloneableTags[mapTag]=cloneableTags[numberTag]=cloneableTags[objectTag]=cloneableTags[regexpTag]=cloneableTags[setTag]=cloneableTags[stringTag]=cloneableTags[symbolTag]=cloneableTags[uint8Tag]=cloneableTags[uint8ClampedTag]=cloneableTags[uint16Tag]=cloneableTags[uint32Tag]=!0,cloneableTags[errorTag]=cloneableTags[funcTag]=cloneableTags[weakMapTag]=!1;var stringEscapes={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},freeParseFloat=parseFloat,freeParseInt=parseInt,freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),freeExports="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule=freeExports&&"object"==typeof module&&module&&!module.nodeType&&module,moduleExports=freeModule&&freeModule.exports===freeExports,freeProcess=moduleExports&&freeGlobal.process,nodeUtil=function(){try{var types=freeModule&&freeModule.require&&freeModule.require("util").types;return types||freeProcess&&freeProcess.binding&&freeProcess.binding("util")}catch(e){}}(),nodeIsArrayBuffer=nodeUtil&&nodeUtil.isArrayBuffer,nodeIsDate=nodeUtil&&nodeUtil.isDate,nodeIsMap=nodeUtil&&nodeUtil.isMap,nodeIsRegExp=nodeUtil&&nodeUtil.isRegExp,nodeIsSet=nodeUtil&&nodeUtil.isSet,nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray;function apply(func,thisArg,args){switch(args.length){case 0:return func.call(thisArg);case 1:return func.call(thisArg,args[0]);case 2:return func.call(thisArg,args[0],args[1]);case 3:return func.call(thisArg,args[0],args[1],args[2])}return func.apply(thisArg,args)}function arrayAggregator(array,setter,iteratee,accumulator){for(var index=-1,length=null==array?0:array.length;++index<length;){var value=array[index];setter(accumulator,value,iteratee(value),array)}return accumulator}function arrayEach(array,iteratee){for(var index=-1,length=null==array?0:array.length;++index<length&&!1!==iteratee(array[index],index,array););return array}function arrayEachRight(array,iteratee){for(var length=null==array?0:array.length;length--&&!1!==iteratee(array[length],length,array););return array}function arrayEvery(array,predicate){for(var index=-1,length=null==array?0:array.length;++index<length;)if(!predicate(array[index],index,array))return!1;return!0}function arrayFilter(array,predicate){for(var index=-1,length=null==array?0:array.length,resIndex=0,result=[];++index<length;){var value=array[index];predicate(value,index,array)&&(result[resIndex++]=value)}return result}function arrayIncludes(array,value){return!!(null==array?0:array.length)&&baseIndexOf(array,value,0)>-1}function arrayIncludesWith(array,value,comparator){for(var index=-1,length=null==array?0:array.length;++index<length;)if(comparator(value,array[index]))return!0;return!1}function arrayMap(array,iteratee){for(var index=-1,length=null==array?0:array.length,result=Array(length);++index<length;)result[index]=iteratee(array[index],index,array);return result}function arrayPush(array,values){for(var index=-1,length=values.length,offset=array.length;++index<length;)array[offset+index]=values[index];return array}function arrayReduce(array,iteratee,accumulator,initAccum){var index=-1,length=null==array?0:array.length;for(initAccum&&length&&(accumulator=array[++index]);++index<length;)accumulator=iteratee(accumulator,array[index],index,array);return accumulator}function arrayReduceRight(array,iteratee,accumulator,initAccum){var length=null==array?0:array.length;for(initAccum&&length&&(accumulator=array[--length]);length--;)accumulator=iteratee(accumulator,array[length],length,array);return accumulator}function arraySome(array,predicate){for(var index=-1,length=null==array?0:array.length;++index<length;)if(predicate(array[index],index,array))return!0;return!1}var asciiSize=baseProperty("length");function baseFindKey(collection,predicate,eachFunc){var result;return eachFunc(collection,(function(value,key,collection){if(predicate(value,key,collection))return result=key,!1})),result}function baseFindIndex(array,predicate,fromIndex,fromRight){for(var length=array.length,index=fromIndex+(fromRight?1:-1);fromRight?index--:++index<length;)if(predicate(array[index],index,array))return index;return-1}function baseIndexOf(array,value,fromIndex){return value==value?function(array,value,fromIndex){var index=fromIndex-1,length=array.length;for(;++index<length;)if(array[index]===value)return index;return-1}(array,value,fromIndex):baseFindIndex(array,baseIsNaN,fromIndex)}function baseIndexOfWith(array,value,fromIndex,comparator){for(var index=fromIndex-1,length=array.length;++index<length;)if(comparator(array[index],value))return index;return-1}function baseIsNaN(value){return value!=value}function baseMean(array,iteratee){var length=null==array?0:array.length;return length?baseSum(array,iteratee)/length:NAN}function baseProperty(key){return function(object){return null==object?undefined:object[key]}}function basePropertyOf(object){return function(key){return null==object?undefined:object[key]}}function baseReduce(collection,iteratee,accumulator,initAccum,eachFunc){return eachFunc(collection,(function(value,index,collection){accumulator=initAccum?(initAccum=!1,value):iteratee(accumulator,value,index,collection)})),accumulator}function baseSum(array,iteratee){for(var result,index=-1,length=array.length;++index<length;){var current=iteratee(array[index]);current!==undefined&&(result=result===undefined?current:result+current)}return result}function baseTimes(n,iteratee){for(var index=-1,result=Array(n);++index<n;)result[index]=iteratee(index);return result}function baseUnary(func){return function(value){return func(value)}}function baseValues(object,props){return arrayMap(props,(function(key){return object[key]}))}function cacheHas(cache,key){return cache.has(key)}function charsStartIndex(strSymbols,chrSymbols){for(var index=-1,length=strSymbols.length;++index<length&&baseIndexOf(chrSymbols,strSymbols[index],0)>-1;);return index}function charsEndIndex(strSymbols,chrSymbols){for(var index=strSymbols.length;index--&&baseIndexOf(chrSymbols,strSymbols[index],0)>-1;);return index}var deburrLetter=basePropertyOf({"À":"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"}),escapeHtmlChar=basePropertyOf({"&":"&","<":"<",">":">",'"':""","'":"'"});function escapeStringChar(chr){return"\\"+stringEscapes[chr]}function hasUnicode(string){return reHasUnicode.test(string)}function mapToArray(map){var index=-1,result=Array(map.size);return map.forEach((function(value,key){result[++index]=[key,value]})),result}function overArg(func,transform){return function(arg){return func(transform(arg))}}function replaceHolders(array,placeholder){for(var index=-1,length=array.length,resIndex=0,result=[];++index<length;){var value=array[index];value!==placeholder&&value!==PLACEHOLDER||(array[index]=PLACEHOLDER,result[resIndex++]=index)}return result}function setToArray(set){var index=-1,result=Array(set.size);return set.forEach((function(value){result[++index]=value})),result}function setToPairs(set){var index=-1,result=Array(set.size);return set.forEach((function(value){result[++index]=[value,value]})),result}function stringSize(string){return hasUnicode(string)?function(string){var result=reUnicode.lastIndex=0;for(;reUnicode.test(string);)++result;return result}(string):asciiSize(string)}function stringToArray(string){return hasUnicode(string)?function(string){return string.match(reUnicode)||[]}(string):function(string){return string.split("")}(string)}var unescapeHtmlChar=basePropertyOf({"&":"&","<":"<",">":">",""":'"',"'":"'"});var _=function runInContext(context){var uid,Array=(context=null==context?root:_.defaults(root.Object(),context,_.pick(root,contextProps))).Array,Date=context.Date,Error=context.Error,Function=context.Function,Math=context.Math,Object=context.Object,RegExp=context.RegExp,String=context.String,TypeError=context.TypeError,arrayProto=Array.prototype,funcProto=Function.prototype,objectProto=Object.prototype,coreJsData=context["__core-js_shared__"],funcToString=funcProto.toString,hasOwnProperty=objectProto.hasOwnProperty,idCounter=0,maskSrcKey=(uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||""))?"Symbol(src)_1."+uid:"",nativeObjectToString=objectProto.toString,objectCtorString=funcToString.call(Object),oldDash=root._,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty).replace(reRegExpChar,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Buffer=moduleExports?context.Buffer:undefined,Symbol=context.Symbol,Uint8Array=context.Uint8Array,allocUnsafe=Buffer?Buffer.allocUnsafe:undefined,getPrototype=overArg(Object.getPrototypeOf,Object),objectCreate=Object.create,propertyIsEnumerable=objectProto.propertyIsEnumerable,splice=arrayProto.splice,spreadableSymbol=Symbol?Symbol.isConcatSpreadable:undefined,symIterator=Symbol?Symbol.iterator:undefined,symToStringTag=Symbol?Symbol.toStringTag:undefined,defineProperty=function(){try{var func=getNative(Object,"defineProperty");return func({},"",{}),func}catch(e){}}(),ctxClearTimeout=context.clearTimeout!==root.clearTimeout&&context.clearTimeout,ctxNow=Date&&Date.now!==root.Date.now&&Date.now,ctxSetTimeout=context.setTimeout!==root.setTimeout&&context.setTimeout,nativeCeil=Math.ceil,nativeFloor=Math.floor,nativeGetSymbols=Object.getOwnPropertySymbols,nativeIsBuffer=Buffer?Buffer.isBuffer:undefined,nativeIsFinite=context.isFinite,nativeJoin=arrayProto.join,nativeKeys=overArg(Object.keys,Object),nativeMax=Math.max,nativeMin=Math.min,nativeNow=Date.now,nativeParseInt=context.parseInt,nativeRandom=Math.random,nativeReverse=arrayProto.reverse,DataView=getNative(context,"DataView"),Map=getNative(context,"Map"),Promise=getNative(context,"Promise"),Set=getNative(context,"Set"),WeakMap=getNative(context,"WeakMap"),nativeCreate=getNative(Object,"create"),metaMap=WeakMap&&new WeakMap,realNames={},dataViewCtorString=toSource(DataView),mapCtorString=toSource(Map),promiseCtorString=toSource(Promise),setCtorString=toSource(Set),weakMapCtorString=toSource(WeakMap),symbolProto=Symbol?Symbol.prototype:undefined,symbolValueOf=symbolProto?symbolProto.valueOf:undefined,symbolToString=symbolProto?symbolProto.toString:undefined;function lodash(value){if(isObjectLike(value)&&!isArray(value)&&!(value instanceof LazyWrapper)){if(value instanceof LodashWrapper)return value;if(hasOwnProperty.call(value,"__wrapped__"))return wrapperClone(value)}return new LodashWrapper(value)}var baseCreate=function(){function object(){}return function(proto){if(!isObject(proto))return{};if(objectCreate)return objectCreate(proto);object.prototype=proto;var result=new object;return object.prototype=undefined,result}}();function baseLodash(){}function LodashWrapper(value,chainAll){this.__wrapped__=value,this.__actions__=[],this.__chain__=!!chainAll,this.__index__=0,this.__values__=undefined}function LazyWrapper(value){this.__wrapped__=value,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=MAX_ARRAY_LENGTH,this.__views__=[]}function Hash(entries){var index=-1,length=null==entries?0:entries.length;for(this.clear();++index<length;){var entry=entries[index];this.set(entry[0],entry[1])}}function ListCache(entries){var index=-1,length=null==entries?0:entries.length;for(this.clear();++index<length;){var entry=entries[index];this.set(entry[0],entry[1])}}function MapCache(entries){var index=-1,length=null==entries?0:entries.length;for(this.clear();++index<length;){var entry=entries[index];this.set(entry[0],entry[1])}}function SetCache(values){var index=-1,length=null==values?0:values.length;for(this.__data__=new MapCache;++index<length;)this.add(values[index])}function Stack(entries){var data=this.__data__=new ListCache(entries);this.size=data.size}function arrayLikeKeys(value,inherited){var isArr=isArray(value),isArg=!isArr&&isArguments(value),isBuff=!isArr&&!isArg&&isBuffer(value),isType=!isArr&&!isArg&&!isBuff&&isTypedArray(value),skipIndexes=isArr||isArg||isBuff||isType,result=skipIndexes?baseTimes(value.length,String):[],length=result.length;for(var key in value)!inherited&&!hasOwnProperty.call(value,key)||skipIndexes&&("length"==key||isBuff&&("offset"==key||"parent"==key)||isType&&("buffer"==key||"byteLength"==key||"byteOffset"==key)||isIndex(key,length))||result.push(key);return result}function arraySample(array){var length=array.length;return length?array[baseRandom(0,length-1)]:undefined}function arraySampleSize(array,n){return shuffleSelf(copyArray(array),baseClamp(n,0,array.length))}function arrayShuffle(array){return shuffleSelf(copyArray(array))}function assignMergeValue(object,key,value){(value===undefined||eq(object[key],value))&&(value!==undefined||key in object)||baseAssignValue(object,key,value)}function assignValue(object,key,value){var objValue=object[key];hasOwnProperty.call(object,key)&&eq(objValue,value)&&(value!==undefined||key in object)||baseAssignValue(object,key,value)}function assocIndexOf(array,key){for(var length=array.length;length--;)if(eq(array[length][0],key))return length;return-1}function baseAggregator(collection,setter,iteratee,accumulator){return baseEach(collection,(function(value,key,collection){setter(accumulator,value,iteratee(value),collection)})),accumulator}function baseAssign(object,source){return object&©Object(source,keys(source),object)}function baseAssignValue(object,key,value){"__proto__"==key&&defineProperty?defineProperty(object,key,{configurable:!0,enumerable:!0,value:value,writable:!0}):object[key]=value}function baseAt(object,paths){for(var index=-1,length=paths.length,result=Array(length),skip=null==object;++index<length;)result[index]=skip?undefined:get(object,paths[index]);return result}function baseClamp(number,lower,upper){return number==number&&(upper!==undefined&&(number=number<=upper?number:upper),lower!==undefined&&(number=number>=lower?number:lower)),number}function baseClone(value,bitmask,customizer,key,object,stack){var result,isDeep=bitmask&CLONE_DEEP_FLAG,isFlat=bitmask&CLONE_FLAT_FLAG,isFull=bitmask&CLONE_SYMBOLS_FLAG;if(customizer&&(result=object?customizer(value,key,object,stack):customizer(value)),result!==undefined)return result;if(!isObject(value))return value;var isArr=isArray(value);if(isArr){if(result=function(array){var length=array.length,result=new array.constructor(length);length&&"string"==typeof array[0]&&hasOwnProperty.call(array,"index")&&(result.index=array.index,result.input=array.input);return result}(value),!isDeep)return copyArray(value,result)}else{var tag=getTag(value),isFunc=tag==funcTag||tag==genTag;if(isBuffer(value))return cloneBuffer(value,isDeep);if(tag==objectTag||tag==argsTag||isFunc&&!object){if(result=isFlat||isFunc?{}:initCloneObject(value),!isDeep)return isFlat?function(source,object){return copyObject(source,getSymbolsIn(source),object)}(value,function(object,source){return object&©Object(source,keysIn(source),object)}(result,value)):function(source,object){return copyObject(source,getSymbols(source),object)}(value,baseAssign(result,value))}else{if(!cloneableTags[tag])return object?value:{};result=function(object,tag,isDeep){var Ctor=object.constructor;switch(tag){case arrayBufferTag:return cloneArrayBuffer(object);case boolTag:case dateTag:return new Ctor(+object);case dataViewTag:return function(dataView,isDeep){var buffer=isDeep?cloneArrayBuffer(dataView.buffer):dataView.buffer;return new dataView.constructor(buffer,dataView.byteOffset,dataView.byteLength)}(object,isDeep);case float32Tag:case float64Tag:case int8Tag:case int16Tag:case int32Tag:case uint8Tag:case uint8ClampedTag:case uint16Tag:case uint32Tag:return cloneTypedArray(object,isDeep);case mapTag:return new Ctor;case numberTag:case stringTag:return new Ctor(object);case regexpTag:return function(regexp){var result=new regexp.constructor(regexp.source,reFlags.exec(regexp));return result.lastIndex=regexp.lastIndex,result}(object);case setTag:return new Ctor;case symbolTag:return symbol=object,symbolValueOf?Object(symbolValueOf.call(symbol)):{}}var symbol}(value,tag,isDeep)}}stack||(stack=new Stack);var stacked=stack.get(value);if(stacked)return stacked;if(stack.set(value,result),isSet(value))return value.forEach((function(subValue){result.add(baseClone(subValue,bitmask,customizer,subValue,value,stack))})),result;if(isMap(value))return value.forEach((function(subValue,key){result.set(key,baseClone(subValue,bitmask,customizer,key,value,stack))})),result;var props=isArr?undefined:(isFull?isFlat?getAllKeysIn:getAllKeys:isFlat?keysIn:keys)(value);return arrayEach(props||value,(function(subValue,key){props&&(subValue=value[key=subValue]),assignValue(result,key,baseClone(subValue,bitmask,customizer,key,value,stack))})),result}function baseConformsTo(object,source,props){var length=props.length;if(null==object)return!length;for(object=Object(object);length--;){var key=props[length],predicate=source[key],value=object[key];if(value===undefined&&!(key in object)||!predicate(value))return!1}return!0}function baseDelay(func,wait,args){if("function"!=typeof func)throw new TypeError(FUNC_ERROR_TEXT);return setTimeout((function(){func.apply(undefined,args)}),wait)}function baseDifference(array,values,iteratee,comparator){var index=-1,includes=arrayIncludes,isCommon=!0,length=array.length,result=[],valuesLength=values.length;if(!length)return result;iteratee&&(values=arrayMap(values,baseUnary(iteratee))),comparator?(includes=arrayIncludesWith,isCommon=!1):values.length>=LARGE_ARRAY_SIZE&&(includes=cacheHas,isCommon=!1,values=new SetCache(values));outer:for(;++index<length;){var value=array[index],computed=null==iteratee?value:iteratee(value);if(value=comparator||0!==value?value:0,isCommon&&computed==computed){for(var valuesIndex=valuesLength;valuesIndex--;)if(values[valuesIndex]===computed)continue outer;result.push(value)}else includes(values,computed,comparator)||result.push(value)}return result}lodash.templateSettings={escape:reEscape,evaluate:reEvaluate,interpolate:reInterpolate,variable:"",imports:{_:lodash}},lodash.prototype=baseLodash.prototype,lodash.prototype.constructor=lodash,LodashWrapper.prototype=baseCreate(baseLodash.prototype),LodashWrapper.prototype.constructor=LodashWrapper,LazyWrapper.prototype=baseCreate(baseLodash.prototype),LazyWrapper.prototype.constructor=LazyWrapper,Hash.prototype.clear=function(){this.__data__=nativeCreate?nativeCreate(null):{},this.size=0},Hash.prototype.delete=function(key){var result=this.has(key)&&delete this.__data__[key];return this.size-=result?1:0,result},Hash.prototype.get=function(key){var data=this.__data__;if(nativeCreate){var result=data[key];return result===HASH_UNDEFINED?undefined:result}return hasOwnProperty.call(data,key)?data[key]:undefined},Hash.prototype.has=function(key){var data=this.__data__;return nativeCreate?data[key]!==undefined:hasOwnProperty.call(data,key)},Hash.prototype.set=function(key,value){var data=this.__data__;return this.size+=this.has(key)?0:1,data[key]=nativeCreate&&value===undefined?HASH_UNDEFINED:value,this},ListCache.prototype.clear=function(){this.__data__=[],this.size=0},ListCache.prototype.delete=function(key){var data=this.__data__,index=assocIndexOf(data,key);return!(index<0)&&(index==data.length-1?data.pop():splice.call(data,index,1),--this.size,!0)},ListCache.prototype.get=function(key){var data=this.__data__,index=assocIndexOf(data,key);return index<0?undefined:data[index][1]},ListCache.prototype.has=function(key){return assocIndexOf(this.__data__,key)>-1},ListCache.prototype.set=function(key,value){var data=this.__data__,index=assocIndexOf(data,key);return index<0?(++this.size,data.push([key,value])):data[index][1]=value,this},MapCache.prototype.clear=function(){this.size=0,this.__data__={hash:new Hash,map:new(Map||ListCache),string:new Hash}},MapCache.prototype.delete=function(key){var result=getMapData(this,key).delete(key);return this.size-=result?1:0,result},MapCache.prototype.get=function(key){return getMapData(this,key).get(key)},MapCache.prototype.has=function(key){return getMapData(this,key).has(key)},MapCache.prototype.set=function(key,value){var data=getMapData(this,key),size=data.size;return data.set(key,value),this.size+=data.size==size?0:1,this},SetCache.prototype.add=SetCache.prototype.push=function(value){return this.__data__.set(value,HASH_UNDEFINED),this},SetCache.prototype.has=function(value){return this.__data__.has(value)},Stack.prototype.clear=function(){this.__data__=new ListCache,this.size=0},Stack.prototype.delete=function(key){var data=this.__data__,result=data.delete(key);return this.size=data.size,result},Stack.prototype.get=function(key){return this.__data__.get(key)},Stack.prototype.has=function(key){return this.__data__.has(key)},Stack.prototype.set=function(key,value){var data=this.__data__;if(data instanceof ListCache){var pairs=data.__data__;if(!Map||pairs.length<LARGE_ARRAY_SIZE-1)return pairs.push([key,value]),this.size=++data.size,this;data=this.__data__=new MapCache(pairs)}return data.set(key,value),this.size=data.size,this};var baseEach=createBaseEach(baseForOwn),baseEachRight=createBaseEach(baseForOwnRight,!0);function baseEvery(collection,predicate){var result=!0;return baseEach(collection,(function(value,index,collection){return result=!!predicate(value,index,collection)})),result}function baseExtremum(array,iteratee,comparator){for(var index=-1,length=array.length;++index<length;){var value=array[index],current=iteratee(value);if(null!=current&&(computed===undefined?current==current&&!isSymbol(current):comparator(current,computed)))var computed=current,result=value}return result}function baseFilter(collection,predicate){var result=[];return baseEach(collection,(function(value,index,collection){predicate(value,index,collection)&&result.push(value)})),result}function baseFlatten(array,depth,predicate,isStrict,result){var index=-1,length=array.length;for(predicate||(predicate=isFlattenable),result||(result=[]);++index<length;){var value=array[index];depth>0&&predicate(value)?depth>1?baseFlatten(value,depth-1,predicate,isStrict,result):arrayPush(result,value):isStrict||(result[result.length]=value)}return result}var baseFor=createBaseFor(),baseForRight=createBaseFor(!0);function baseForOwn(object,iteratee){return object&&baseFor(object,iteratee,keys)}function baseForOwnRight(object,iteratee){return object&&baseForRight(object,iteratee,keys)}function baseFunctions(object,props){return arrayFilter(props,(function(key){return isFunction(object[key])}))}function baseGet(object,path){for(var index=0,length=(path=castPath(path,object)).length;null!=object&&index<length;)object=object[toKey(path[index++])];return index&&index==length?object:undefined}function baseGetAllKeys(object,keysFunc,symbolsFunc){var result=keysFunc(object);return isArray(object)?result:arrayPush(result,symbolsFunc(object))}function baseGetTag(value){return null==value?value===undefined?undefinedTag:nullTag:symToStringTag&&symToStringTag in Object(value)?function(value){var isOwn=hasOwnProperty.call(value,symToStringTag),tag=value[symToStringTag];try{value[symToStringTag]=undefined;var unmasked=!0}catch(e){}var result=nativeObjectToString.call(value);unmasked&&(isOwn?value[symToStringTag]=tag:delete value[symToStringTag]);return result}(value):function(value){return nativeObjectToString.call(value)}(value)}function baseGt(value,other){return value>other}function baseHas(object,key){return null!=object&&hasOwnProperty.call(object,key)}function baseHasIn(object,key){return null!=object&&key in Object(object)}function baseIntersection(arrays,iteratee,comparator){for(var includes=comparator?arrayIncludesWith:arrayIncludes,length=arrays[0].length,othLength=arrays.length,othIndex=othLength,caches=Array(othLength),maxLength=1/0,result=[];othIndex--;){var array=arrays[othIndex];othIndex&&iteratee&&(array=arrayMap(array,baseUnary(iteratee))),maxLength=nativeMin(array.length,maxLength),caches[othIndex]=!comparator&&(iteratee||length>=120&&array.length>=120)?new SetCache(othIndex&&array):undefined}array=arrays[0];var index=-1,seen=caches[0];outer:for(;++index<length&&result.length<maxLength;){var value=array[index],computed=iteratee?iteratee(value):value;if(value=comparator||0!==value?value:0,!(seen?cacheHas(seen,computed):includes(result,computed,comparator))){for(othIndex=othLength;--othIndex;){var cache=caches[othIndex];if(!(cache?cacheHas(cache,computed):includes(arrays[othIndex],computed,comparator)))continue outer}seen&&seen.push(computed),result.push(value)}}return result}function baseInvoke(object,path,args){var func=null==(object=parent(object,path=castPath(path,object)))?object:object[toKey(last(path))];return null==func?undefined:apply(func,object,args)}function baseIsArguments(value){return isObjectLike(value)&&baseGetTag(value)==argsTag}function baseIsEqual(value,other,bitmask,customizer,stack){return value===other||(null==value||null==other||!isObjectLike(value)&&!isObjectLike(other)?value!=value&&other!=other:function(object,other,bitmask,customizer,equalFunc,stack){var objIsArr=isArray(object),othIsArr=isArray(other),objTag=objIsArr?arrayTag:getTag(object),othTag=othIsArr?arrayTag:getTag(other),objIsObj=(objTag=objTag==argsTag?objectTag:objTag)==objectTag,othIsObj=(othTag=othTag==argsTag?objectTag:othTag)==objectTag,isSameTag=objTag==othTag;if(isSameTag&&isBuffer(object)){if(!isBuffer(other))return!1;objIsArr=!0,objIsObj=!1}if(isSameTag&&!objIsObj)return stack||(stack=new Stack),objIsArr||isTypedArray(object)?equalArrays(object,other,bitmask,customizer,equalFunc,stack):function(object,other,tag,bitmask,customizer,equalFunc,stack){switch(tag){case dataViewTag:if(object.byteLength!=other.byteLength||object.byteOffset!=other.byteOffset)return!1;object=object.buffer,other=other.buffer;case arrayBufferTag:return!(object.byteLength!=other.byteLength||!equalFunc(new Uint8Array(object),new Uint8Array(other)));case boolTag:case dateTag:case numberTag:return eq(+object,+other);case errorTag:return object.name==other.name&&object.message==other.message;case regexpTag:case stringTag:return object==other+"";case mapTag:var convert=mapToArray;case setTag:var isPartial=bitmask&COMPARE_PARTIAL_FLAG;if(convert||(convert=setToArray),object.size!=other.size&&!isPartial)return!1;var stacked=stack.get(object);if(stacked)return stacked==other;bitmask|=COMPARE_UNORDERED_FLAG,stack.set(object,other);var result=equalArrays(convert(object),convert(other),bitmask,customizer,equalFunc,stack);return stack.delete(object),result;case symbolTag:if(symbolValueOf)return symbolValueOf.call(object)==symbolValueOf.call(other)}return!1}(object,other,objTag,bitmask,customizer,equalFunc,stack);if(!(bitmask&COMPARE_PARTIAL_FLAG)){var objIsWrapped=objIsObj&&hasOwnProperty.call(object,"__wrapped__"),othIsWrapped=othIsObj&&hasOwnProperty.call(other,"__wrapped__");if(objIsWrapped||othIsWrapped){var objUnwrapped=objIsWrapped?object.value():object,othUnwrapped=othIsWrapped?other.value():other;return stack||(stack=new Stack),equalFunc(objUnwrapped,othUnwrapped,bitmask,customizer,stack)}}if(!isSameTag)return!1;return stack||(stack=new Stack),function(object,other,bitmask,customizer,equalFunc,stack){var isPartial=bitmask&COMPARE_PARTIAL_FLAG,objProps=getAllKeys(object),objLength=objProps.length,othLength=getAllKeys(other).length;if(objLength!=othLength&&!isPartial)return!1;var index=objLength;for(;index--;){var key=objProps[index];if(!(isPartial?key in other:hasOwnProperty.call(other,key)))return!1}var stacked=stack.get(object);if(stacked&&stack.get(other))return stacked==other;var result=!0;stack.set(object,other),stack.set(other,object);var skipCtor=isPartial;for(;++index<objLength;){key=objProps[index];var objValue=object[key],othValue=other[key];if(customizer)var compared=isPartial?customizer(othValue,objValue,key,other,object,stack):customizer(objValue,othValue,key,object,other,stack);if(!(compared===undefined?objValue===othValue||equalFunc(objValue,othValue,bitmask,customizer,stack):compared)){result=!1;break}skipCtor||(skipCtor="constructor"==key)}if(result&&!skipCtor){var objCtor=object.constructor,othCtor=other.constructor;objCtor!=othCtor&&"constructor"in object&&"constructor"in other&&!("function"==typeof objCtor&&objCtor instanceof objCtor&&"function"==typeof othCtor&&othCtor instanceof othCtor)&&(result=!1)}return stack.delete(object),stack.delete(other),result}(object,other,bitmask,customizer,equalFunc,stack)}(value,other,bitmask,customizer,baseIsEqual,stack))}function baseIsMatch(object,source,matchData,customizer){var index=matchData.length,length=index,noCustomizer=!customizer;if(null==object)return!length;for(object=Object(object);index--;){var data=matchData[index];if(noCustomizer&&data[2]?data[1]!==object[data[0]]:!(data[0]in object))return!1}for(;++index<length;){var key=(data=matchData[index])[0],objValue=object[key],srcValue=data[1];if(noCustomizer&&data[2]){if(objValue===undefined&&!(key in object))return!1}else{var stack=new Stack;if(customizer)var result=customizer(objValue,srcValue,key,object,source,stack);if(!(result===undefined?baseIsEqual(srcValue,objValue,COMPARE_PARTIAL_FLAG|COMPARE_UNORDERED_FLAG,customizer,stack):result))return!1}}return!0}function baseIsNative(value){return!(!isObject(value)||(func=value,maskSrcKey&&maskSrcKey in func))&&(isFunction(value)?reIsNative:reIsHostCtor).test(toSource(value));var func}function baseIteratee(value){return"function"==typeof value?value:null==value?identity:"object"==typeof value?isArray(value)?baseMatchesProperty(value[0],value[1]):baseMatches(value):property(value)}function baseKeys(object){if(!isPrototype(object))return nativeKeys(object);var result=[];for(var key in Object(object))hasOwnProperty.call(object,key)&&"constructor"!=key&&result.push(key);return result}function baseKeysIn(object){if(!isObject(object))return function(object){var result=[];if(null!=object)for(var key in Object(object))result.push(key);return result}(object);var isProto=isPrototype(object),result=[];for(var key in object)("constructor"!=key||!isProto&&hasOwnProperty.call(object,key))&&result.push(key);return result}function baseLt(value,other){return value<other}function baseMap(collection,iteratee){var index=-1,result=isArrayLike(collection)?Array(collection.length):[];return baseEach(collection,(function(value,key,collection){result[++index]=iteratee(value,key,collection)})),result}function baseMatches(source){var matchData=getMatchData(source);return 1==matchData.length&&matchData[0][2]?matchesStrictComparable(matchData[0][0],matchData[0][1]):function(object){return object===source||baseIsMatch(object,source,matchData)}}function baseMatchesProperty(path,srcValue){return isKey(path)&&isStrictComparable(srcValue)?matchesStrictComparable(toKey(path),srcValue):function(object){var objValue=get(object,path);return objValue===undefined&&objValue===srcValue?hasIn(object,path):baseIsEqual(srcValue,objValue,COMPARE_PARTIAL_FLAG|COMPARE_UNORDERED_FLAG)}}function baseMerge(object,source,srcIndex,customizer,stack){object!==source&&baseFor(source,(function(srcValue,key){if(isObject(srcValue))stack||(stack=new Stack),function(object,source,key,srcIndex,mergeFunc,customizer,stack){var objValue=safeGet(object,key),srcValue=safeGet(source,key),stacked=stack.get(srcValue);if(stacked)return void assignMergeValue(object,key,stacked);var newValue=customizer?customizer(objValue,srcValue,key+"",object,source,stack):undefined,isCommon=newValue===undefined;if(isCommon){var isArr=isArray(srcValue),isBuff=!isArr&&isBuffer(srcValue),isTyped=!isArr&&!isBuff&&isTypedArray(srcValue);newValue=srcValue,isArr||isBuff||isTyped?isArray(objValue)?newValue=objValue:isArrayLikeObject(objValue)?newValue=copyArray(objValue):isBuff?(isCommon=!1,newValue=cloneBuffer(srcValue,!0)):isTyped?(isCommon=!1,newValue=cloneTypedArray(srcValue,!0)):newValue=[]:isPlainObject(srcValue)||isArguments(srcValue)?(newValue=objValue,isArguments(objValue)?newValue=toPlainObject(objValue):isObject(objValue)&&!isFunction(objValue)||(newValue=initCloneObject(srcValue))):isCommon=!1}isCommon&&(stack.set(srcValue,newValue),mergeFunc(newValue,srcValue,srcIndex,customizer,stack),stack.delete(srcValue));assignMergeValue(object,key,newValue)}(object,source,key,srcIndex,baseMerge,customizer,stack);else{var newValue=customizer?customizer(safeGet(object,key),srcValue,key+"",object,source,stack):undefined;newValue===undefined&&(newValue=srcValue),assignMergeValue(object,key,newValue)}}),keysIn)}function baseNth(array,n){var length=array.length;if(length)return isIndex(n+=n<0?length:0,length)?array[n]:undefined}function baseOrderBy(collection,iteratees,orders){var index=-1;return iteratees=arrayMap(iteratees.length?iteratees:[identity],baseUnary(getIteratee())),function(array,comparer){var length=array.length;for(array.sort(comparer);length--;)array[length]=array[length].value;return array}(baseMap(collection,(function(value,key,collection){return{criteria:arrayMap(iteratees,(function(iteratee){return iteratee(value)})),index:++index,value:value}})),(function(object,other){return function(object,other,orders){var index=-1,objCriteria=object.criteria,othCriteria=other.criteria,length=objCriteria.length,ordersLength=orders.length;for(;++index<length;){var result=compareAscending(objCriteria[index],othCriteria[index]);if(result){if(index>=ordersLength)return result;var order=orders[index];return result*("desc"==order?-1:1)}}return object.index-other.index}(object,other,orders)}))}function basePickBy(object,paths,predicate){for(var index=-1,length=paths.length,result={};++index<length;){var path=paths[index],value=baseGet(object,path);predicate(value,path)&&baseSet(result,castPath(path,object),value)}return result}function basePullAll(array,values,iteratee,comparator){var indexOf=comparator?baseIndexOfWith:baseIndexOf,index=-1,length=values.length,seen=array;for(array===values&&(values=copyArray(values)),iteratee&&(seen=arrayMap(array,baseUnary(iteratee)));++index<length;)for(var fromIndex=0,value=values[index],computed=iteratee?iteratee(value):value;(fromIndex=indexOf(seen,computed,fromIndex,comparator))>-1;)seen!==array&&splice.call(seen,fromIndex,1),splice.call(array,fromIndex,1);return array}function basePullAt(array,indexes){for(var length=array?indexes.length:0,lastIndex=length-1;length--;){var index=indexes[length];if(length==lastIndex||index!==previous){var previous=index;isIndex(index)?splice.call(array,index,1):baseUnset(array,index)}}return array}function baseRandom(lower,upper){return lower+nativeFloor(nativeRandom()*(upper-lower+1))}function baseRepeat(string,n){var result="";if(!string||n<1||n>MAX_SAFE_INTEGER)return result;do{n%2&&(result+=string),(n=nativeFloor(n/2))&&(string+=string)}while(n);return result}function baseRest(func,start){return setToString(overRest(func,start,identity),func+"")}function baseSample(collection){return arraySample(values(collection))}function baseSampleSize(collection,n){var array=values(collection);return shuffleSelf(array,baseClamp(n,0,array.length))}function baseSet(object,path,value,customizer){if(!isObject(object))return object;for(var index=-1,length=(path=castPath(path,object)).length,lastIndex=length-1,nested=object;null!=nested&&++index<length;){var key=toKey(path[index]),newValue=value;if(index!=lastIndex){var objValue=nested[key];(newValue=customizer?customizer(objValue,key,nested):undefined)===undefined&&(newValue=isObject(objValue)?objValue:isIndex(path[index+1])?[]:{})}assignValue(nested,key,newValue),nested=nested[key]}return object}var baseSetData=metaMap?function(func,data){return metaMap.set(func,data),func}:identity,baseSetToString=defineProperty?function(func,string){return defineProperty(func,"toString",{configurable:!0,enumerable:!1,value:constant(string),writable:!0})}:identity;function baseShuffle(collection){return shuffleSelf(values(collection))}function baseSlice(array,start,end){var index=-1,length=array.length;start<0&&(start=-start>length?0:length+start),(end=end>length?length:end)<0&&(end+=length),length=start>end?0:end-start>>>0,start>>>=0;for(var result=Array(length);++index<length;)result[index]=array[index+start];return result}function baseSome(collection,predicate){var result;return baseEach(collection,(function(value,index,collection){return!(result=predicate(value,index,collection))})),!!result}function baseSortedIndex(array,value,retHighest){var low=0,high=null==array?low:array.length;if("number"==typeof value&&value==value&&high<=HALF_MAX_ARRAY_LENGTH){for(;low<high;){var mid=low+high>>>1,computed=array[mid];null!==computed&&!isSymbol(computed)&&(retHighest?computed<=value:computed<value)?low=mid+1:high=mid}return high}return baseSortedIndexBy(array,value,identity,retHighest)}function baseSortedIndexBy(array,value,iteratee,retHighest){value=iteratee(value);for(var low=0,high=null==array?0:array.length,valIsNaN=value!=value,valIsNull=null===value,valIsSymbol=isSymbol(value),valIsUndefined=value===undefined;low<high;){var mid=nativeFloor((low+high)/2),computed=iteratee(array[mid]),othIsDefined=computed!==undefined,othIsNull=null===computed,othIsReflexive=computed==computed,othIsSymbol=isSymbol(computed);if(valIsNaN)var setLow=retHighest||othIsReflexive;else setLow=valIsUndefined?othIsReflexive&&(retHighest||othIsDefined):valIsNull?othIsReflexive&&othIsDefined&&(retHighest||!othIsNull):valIsSymbol?othIsReflexive&&othIsDefined&&!othIsNull&&(retHighest||!othIsSymbol):!othIsNull&&!othIsSymbol&&(retHighest?computed<=value:computed<value);setLow?low=mid+1:high=mid}return nativeMin(high,MAX_ARRAY_INDEX)}function baseSortedUniq(array,iteratee){for(var index=-1,length=array.length,resIndex=0,result=[];++index<length;){var value=array[index],computed=iteratee?iteratee(value):value;if(!index||!eq(computed,seen)){var seen=computed;result[resIndex++]=0===value?0:value}}return result}function baseToNumber(value){return"number"==typeof value?value:isSymbol(value)?NAN:+value}function baseToString(value){if("string"==typeof value)return value;if(isArray(value))return arrayMap(value,baseToString)+"";if(isSymbol(value))return symbolToString?symbolToString.call(value):"";var result=value+"";return"0"==result&&1/value==-INFINITY?"-0":result}function baseUniq(array,iteratee,comparator){var index=-1,includes=arrayIncludes,length=array.length,isCommon=!0,result=[],seen=result;if(comparator)isCommon=!1,includes=arrayIncludesWith;else if(length>=LARGE_ARRAY_SIZE){var set=iteratee?null:createSet(array);if(set)return setToArray(set);isCommon=!1,includes=cacheHas,seen=new SetCache}else seen=iteratee?[]:result;outer:for(;++index<length;){var value=array[index],computed=iteratee?iteratee(value):value;if(value=comparator||0!==value?value:0,isCommon&&computed==computed){for(var seenIndex=seen.length;seenIndex--;)if(seen[seenIndex]===computed)continue outer;iteratee&&seen.push(computed),result.push(value)}else includes(seen,computed,comparator)||(seen!==result&&seen.push(computed),result.push(value))}return result}function baseUnset(object,path){return null==(object=parent(object,path=castPath(path,object)))||delete object[toKey(last(path))]}function baseUpdate(object,path,updater,customizer){return baseSet(object,path,updater(baseGet(object,path)),customizer)}function baseWhile(array,predicate,isDrop,fromRight){for(var length=array.length,index=fromRight?length:-1;(fromRight?index--:++index<length)&&predicate(array[index],index,array););return isDrop?baseSlice(array,fromRight?0:index,fromRight?index+1:length):baseSlice(array,fromRight?index+1:0,fromRight?length:index)}function baseWrapperValue(value,actions){var result=value;return result instanceof LazyWrapper&&(result=result.value()),arrayReduce(actions,(function(result,action){return action.func.apply(action.thisArg,arrayPush([result],action.args))}),result)}function baseXor(arrays,iteratee,comparator){var length=arrays.length;if(length<2)return length?baseUniq(arrays[0]):[];for(var index=-1,result=Array(length);++index<length;)for(var array=arrays[index],othIndex=-1;++othIndex<length;)othIndex!=index&&(result[index]=baseDifference(result[index]||array,arrays[othIndex],iteratee,comparator));return baseUniq(baseFlatten(result,1),iteratee,comparator)}function baseZipObject(props,values,assignFunc){for(var index=-1,length=props.length,valsLength=values.length,result={};++index<length;){var value=index<valsLength?values[index]:undefined;assignFunc(result,props[index],value)}return result}function castArrayLikeObject(value){return isArrayLikeObject(value)?value:[]}function castFunction(value){return"function"==typeof value?value:identity}function castPath(value,object){return isArray(value)?value:isKey(value,object)?[value]:stringToPath(toString(value))}var castRest=baseRest;function castSlice(array,start,end){var length=array.length;return end=end===undefined?length:end,!start&&end>=length?array:baseSlice(array,start,end)}var clearTimeout=ctxClearTimeout||function(id){return root.clearTimeout(id)};function cloneBuffer(buffer,isDeep){if(isDeep)return buffer.slice();var length=buffer.length,result=allocUnsafe?allocUnsafe(length):new buffer.constructor(length);return buffer.copy(result),result}function cloneArrayBuffer(arrayBuffer){var result=new arrayBuffer.constructor(arrayBuffer.byteLength);return new Uint8Array(result).set(new Uint8Array(arrayBuffer)),result}function cloneTypedArray(typedArray,isDeep){var buffer=isDeep?cloneArrayBuffer(typedArray.buffer):typedArray.buffer;return new typedArray.constructor(buffer,typedArray.byteOffset,typedArray.length)}function compareAscending(value,other){if(value!==other){var valIsDefined=value!==undefined,valIsNull=null===value,valIsReflexive=value==value,valIsSymbol=isSymbol(value),othIsDefined=other!==undefined,othIsNull=null===other,othIsReflexive=other==other,othIsSymbol=isSymbol(other);if(!othIsNull&&!othIsSymbol&&!valIsSymbol&&value>other||valIsSymbol&&othIsDefined&&othIsReflexive&&!othIsNull&&!othIsSymbol||valIsNull&&othIsDefined&&othIsReflexive||!valIsDefined&&othIsReflexive||!valIsReflexive)return 1;if(!valIsNull&&!valIsSymbol&&!othIsSymbol&&value<other||othIsSymbol&&valIsDefined&&valIsReflexive&&!valIsNull&&!valIsSymbol||othIsNull&&valIsDefined&&valIsReflexive||!othIsDefined&&valIsReflexive||!othIsReflexive)return-1}return 0}function composeArgs(args,partials,holders,isCurried){for(var argsIndex=-1,argsLength=args.length,holdersLength=holders.length,leftIndex=-1,leftLength=partials.length,rangeLength=nativeMax(argsLength-holdersLength,0),result=Array(leftLength+rangeLength),isUncurried=!isCurried;++leftIndex<leftLength;)result[leftIndex]=partials[leftIndex];for(;++argsIndex<holdersLength;)(isUncurried||argsIndex<argsLength)&&(result[holders[argsIndex]]=args[argsIndex]);for(;rangeLength--;)result[leftIndex++]=args[argsIndex++];return result}function composeArgsRight(args,partials,holders,isCurried){for(var argsIndex=-1,argsLength=args.length,holdersIndex=-1,holdersLength=holders.length,rightIndex=-1,rightLength=partials.length,rangeLength=nativeMax(argsLength-holdersLength,0),result=Array(rangeLength+rightLength),isUncurried=!isCurried;++argsIndex<rangeLength;)result[argsIndex]=args[argsIndex];for(var offset=argsIndex;++rightIndex<rightLength;)result[offset+rightIndex]=partials[rightIndex];for(;++holdersIndex<holdersLength;)(isUncurried||argsIndex<argsLength)&&(result[offset+holders[holdersIndex]]=args[argsIndex++]);return result}function copyArray(source,array){var index=-1,length=source.length;for(array||(array=Array(length));++index<length;)array[index]=source[index];return array}function copyObject(source,props,object,customizer){var isNew=!object;object||(object={});for(var index=-1,length=props.length;++index<length;){var key=props[index],newValue=customizer?customizer(object[key],source[key],key,object,source):undefined;newValue===undefined&&(newValue=source[key]),isNew?baseAssignValue(object,key,newValue):assignValue(object,key,newValue)}return object}function createAggregator(setter,initializer){return function(collection,iteratee){var func=isArray(collection)?arrayAggregator:baseAggregator,accumulator=initializer?initializer():{};return func(collection,setter,getIteratee(iteratee,2),accumulator)}}function createAssigner(assigner){return baseRest((function(object,sources){var index=-1,length=sources.length,customizer=length>1?sources[length-1]:undefined,guard=length>2?sources[2]:undefined;for(customizer=assigner.length>3&&"function"==typeof customizer?(length--,customizer):undefined,guard&&isIterateeCall(sources[0],sources[1],guard)&&(customizer=length<3?undefined:customizer,length=1),object=Object(object);++index<length;){var source=sources[index];source&&assigner(object,source,index,customizer)}return object}))}function createBaseEach(eachFunc,fromRight){return function(collection,iteratee){if(null==collection)return collection;if(!isArrayLike(collection))return eachFunc(collection,iteratee);for(var length=collection.length,index=fromRight?length:-1,iterable=Object(collection);(fromRight?index--:++index<length)&&!1!==iteratee(iterable[index],index,iterable););return collection}}function createBaseFor(fromRight){return function(object,iteratee,keysFunc){for(var index=-1,iterable=Object(object),props=keysFunc(object),length=props.length;length--;){var key=props[fromRight?length:++index];if(!1===iteratee(iterable[key],key,iterable))break}return object}}function createCaseFirst(methodName){return function(string){var strSymbols=hasUnicode(string=toString(string))?stringToArray(string):undefined,chr=strSymbols?strSymbols[0]:string.charAt(0),trailing=strSymbols?castSlice(strSymbols,1).join(""):string.slice(1);return chr[methodName]()+trailing}}function createCompounder(callback){return function(string){return arrayReduce(words(deburr(string).replace(reApos,"")),callback,"")}}function createCtor(Ctor){return function(){var args=arguments;switch(args.length){case 0:return new Ctor;case 1:return new Ctor(args[0]);case 2:return new Ctor(args[0],args[1]);case 3:return new Ctor(args[0],args[1],args[2]);case 4:return new Ctor(args[0],args[1],args[2],args[3]);case 5:return new Ctor(args[0],args[1],args[2],args[3],args[4]);case 6:return new Ctor(args[0],args[1],args[2],args[3],args[4],args[5]);case 7:return new Ctor(args[0],args[1],args[2],args[3],args[4],args[5],args[6])}var thisBinding=baseCreate(Ctor.prototype),result=Ctor.apply(thisBinding,args);return isObject(result)?result:thisBinding}}function createFind(findIndexFunc){return function(collection,predicate,fromIndex){var iterable=Object(collection);if(!isArrayLike(collection)){var iteratee=getIteratee(predicate,3);collection=keys(collection),predicate=function(key){return iteratee(iterable[key],key,iterable)}}var index=findIndexFunc(collection,predicate,fromIndex);return index>-1?iterable[iteratee?collection[index]:index]:undefined}}function createFlow(fromRight){return flatRest((function(funcs){var length=funcs.length,index=length,prereq=LodashWrapper.prototype.thru;for(fromRight&&funcs.reverse();index--;){var func=funcs[index];if("function"!=typeof func)throw new TypeError(FUNC_ERROR_TEXT);if(prereq&&!wrapper&&"wrapper"==getFuncName(func))var wrapper=new LodashWrapper([],!0)}for(index=wrapper?index:length;++index<length;){var funcName=getFuncName(func=funcs[index]),data="wrapper"==funcName?getData(func):undefined;wrapper=data&&isLaziable(data[0])&&data[1]==(WRAP_ARY_FLAG|WRAP_CURRY_FLAG|WRAP_PARTIAL_FLAG|WRAP_REARG_FLAG)&&!data[4].length&&1==data[9]?wrapper[getFuncName(data[0])].apply(wrapper,data[3]):1==func.length&&isLaziable(func)?wrapper[funcName]():wrapper.thru(func)}return function(){var args=arguments,value=args[0];if(wrapper&&1==args.length&&isArray(value))return wrapper.plant(value).value();for(var index=0,result=length?funcs[index].apply(this,args):value;++index<length;)result=funcs[index].call(this,result);return result}}))}function createHybrid(func,bitmask,thisArg,partials,holders,partialsRight,holdersRight,argPos,ary,arity){var isAry=bitmask&WRAP_ARY_FLAG,isBind=bitmask&WRAP_BIND_FLAG,isBindKey=bitmask&WRAP_BIND_KEY_FLAG,isCurried=bitmask&(WRAP_CURRY_FLAG|WRAP_CURRY_RIGHT_FLAG),isFlip=bitmask&WRAP_FLIP_FLAG,Ctor=isBindKey?undefined:createCtor(func);return function wrapper(){for(var length=arguments.length,args=Array(length),index=length;index--;)args[index]=arguments[index];if(isCurried)var placeholder=getHolder(wrapper),holdersCount=function(array,placeholder){for(var length=array.length,result=0;length--;)array[length]===placeholder&&++result;return result}(args,placeholder);if(partials&&(args=composeArgs(args,partials,holders,isCurried)),partialsRight&&(args=composeArgsRight(args,partialsRight,holdersRight,isCurried)),length-=holdersCount,isCurried&&length<arity){var newHolders=replaceHolders(args,placeholder);return createRecurry(func,bitmask,createHybrid,wrapper.placeholder,thisArg,args,newHolders,argPos,ary,arity-length)}var thisBinding=isBind?thisArg:this,fn=isBindKey?thisBinding[func]:func;return length=args.length,argPos?args=function(array,indexes){var arrLength=array.length,length=nativeMin(indexes.length,arrLength),oldArray=copyArray(array);for(;length--;){var index=indexes[length];array[length]=isIndex(index,arrLength)?oldArray[index]:undefined}return array}(args,argPos):isFlip&&length>1&&args.reverse(),isAry&&ary<length&&(args.length=ary),this&&this!==root&&this instanceof wrapper&&(fn=Ctor||createCtor(fn)),fn.apply(thisBinding,args)}}function createInverter(setter,toIteratee){return function(object,iteratee){return function(object,setter,iteratee,accumulator){return baseForOwn(object,(function(value,key,object){setter(accumulator,iteratee(value),key,object)})),accumulator}(object,setter,toIteratee(iteratee),{})}}function createMathOperation(operator,defaultValue){return function(value,other){var result;if(value===undefined&&other===undefined)return defaultValue;if(value!==undefined&&(result=value),other!==undefined){if(result===undefined)return other;"string"==typeof value||"string"==typeof other?(value=baseToString(value),other=baseToString(other)):(value=baseToNumber(value),other=baseToNumber(other)),result=operator(value,other)}return result}}function createOver(arrayFunc){return flatRest((function(iteratees){return iteratees=arrayMap(iteratees,baseUnary(getIteratee())),baseRest((function(args){var thisArg=this;return arrayFunc(iteratees,(function(iteratee){return apply(iteratee,thisArg,args)}))}))}))}function createPadding(length,chars){var charsLength=(chars=chars===undefined?" ":baseToString(chars)).length;if(charsLength<2)return charsLength?baseRepeat(chars,length):chars;var result=baseRepeat(chars,nativeCeil(length/stringSize(chars)));return hasUnicode(chars)?castSlice(stringToArray(result),0,length).join(""):result.slice(0,length)}function createRange(fromRight){return function(start,end,step){return step&&"number"!=typeof step&&isIterateeCall(start,end,step)&&(end=step=undefined),start=toFinite(start),end===undefined?(end=start,start=0):end=toFinite(end),function(start,end,step,fromRight){for(var index=-1,length=nativeMax(nativeCeil((end-start)/(step||1)),0),result=Array(length);length--;)result[fromRight?length:++index]=start,start+=step;return result}(start,end,step=step===undefined?start<end?1:-1:toFinite(step),fromRight)}}function createRelationalOperation(operator){return function(value,other){return"string"==typeof value&&"string"==typeof other||(value=toNumber(value),other=toNumber(other)),operator(value,other)}}function createRecurry(func,bitmask,wrapFunc,placeholder,thisArg,partials,holders,argPos,ary,arity){var isCurry=bitmask&WRAP_CURRY_FLAG;bitmask|=isCurry?WRAP_PARTIAL_FLAG:WRAP_PARTIAL_RIGHT_FLAG,(bitmask&=~(isCurry?WRAP_PARTIAL_RIGHT_FLAG:WRAP_PARTIAL_FLAG))&WRAP_CURRY_BOUND_FLAG||(bitmask&=~(WRAP_BIND_FLAG|WRAP_BIND_KEY_FLAG));var newData=[func,bitmask,thisArg,isCurry?partials:undefined,isCurry?holders:undefined,isCurry?undefined:partials,isCurry?undefined:holders,argPos,ary,arity],result=wrapFunc.apply(undefined,newData);return isLaziable(func)&&setData(result,newData),result.placeholder=placeholder,setWrapToString(result,func,bitmask)}function createRound(methodName){var func=Math[methodName];return function(number,precision){if(number=toNumber(number),precision=null==precision?0:nativeMin(toInteger(precision),292)){var pair=(toString(number)+"e").split("e");return+((pair=(toString(func(pair[0]+"e"+(+pair[1]+precision)))+"e").split("e"))[0]+"e"+(+pair[1]-precision))}return func(number)}}var createSet=Set&&1/setToArray(new Set([,-0]))[1]==INFINITY?function(values){return new Set(values)}:noop;function createToPairs(keysFunc){return function(object){var tag=getTag(object);return tag==mapTag?mapToArray(object):tag==setTag?setToPairs(object):function(object,props){return arrayMap(props,(function(key){return[key,object[key]]}))}(object,keysFunc(object))}}function createWrap(func,bitmask,thisArg,partials,holders,argPos,ary,arity){var isBindKey=bitmask&WRAP_BIND_KEY_FLAG;if(!isBindKey&&"function"!=typeof func)throw new TypeError(FUNC_ERROR_TEXT);var length=partials?partials.length:0;if(length||(bitmask&=~(WRAP_PARTIAL_FLAG|WRAP_PARTIAL_RIGHT_FLAG),partials=holders=undefined),ary=ary===undefined?ary:nativeMax(toInteger(ary),0),arity=arity===undefined?arity:toInteger(arity),length-=holders?holders.length:0,bitmask&WRAP_PARTIAL_RIGHT_FLAG){var partialsRight=partials,holdersRight=holders;partials=holders=undefined}var data=isBindKey?undefined:getData(func),newData=[func,bitmask,thisArg,partials,holders,partialsRight,holdersRight,argPos,ary,arity];if(data&&function(data,source){var bitmask=data[1],srcBitmask=source[1],newBitmask=bitmask|srcBitmask,isCommon=newBitmask<(WRAP_BIND_FLAG|WRAP_BIND_KEY_FLAG|WRAP_ARY_FLAG),isCombo=srcBitmask==WRAP_ARY_FLAG&&bitmask==WRAP_CURRY_FLAG||srcBitmask==WRAP_ARY_FLAG&&bitmask==WRAP_REARG_FLAG&&data[7].length<=source[8]||srcBitmask==(WRAP_ARY_FLAG|WRAP_REARG_FLAG)&&source[7].length<=source[8]&&bitmask==WRAP_CURRY_FLAG;if(!isCommon&&!isCombo)return data;srcBitmask&WRAP_BIND_FLAG&&(data[2]=source[2],newBitmask|=bitmask&WRAP_BIND_FLAG?0:WRAP_CURRY_BOUND_FLAG);var value=source[3];if(value){var partials=data[3];data[3]=partials?composeArgs(partials,value,source[4]):value,data[4]=partials?replaceHolders(data[3],PLACEHOLDER):source[4]}(value=source[5])&&(partials=data[5],data[5]=partials?composeArgsRight(partials,value,source[6]):value,data[6]=partials?replaceHolders(data[5],PLACEHOLDER):source[6]);(value=source[7])&&(data[7]=value);srcBitmask&WRAP_ARY_FLAG&&(data[8]=null==data[8]?source[8]:nativeMin(data[8],source[8]));null==data[9]&&(data[9]=source[9]);data[0]=source[0],data[1]=newBitmask}(newData,data),func=newData[0],bitmask=newData[1],thisArg=newData[2],partials=newData[3],holders=newData[4],!(arity=newData[9]=newData[9]===undefined?isBindKey?0:func.length:nativeMax(newData[9]-length,0))&&bitmask&(WRAP_CURRY_FLAG|WRAP_CURRY_RIGHT_FLAG)&&(bitmask&=~(WRAP_CURRY_FLAG|WRAP_CURRY_RIGHT_FLAG)),bitmask&&bitmask!=WRAP_BIND_FLAG)result=bitmask==WRAP_CURRY_FLAG||bitmask==WRAP_CURRY_RIGHT_FLAG?function(func,bitmask,arity){var Ctor=createCtor(func);return function wrapper(){for(var length=arguments.length,args=Array(length),index=length,placeholder=getHolder(wrapper);index--;)args[index]=arguments[index];var holders=length<3&&args[0]!==placeholder&&args[length-1]!==placeholder?[]:replaceHolders(args,placeholder);return(length-=holders.length)<arity?createRecurry(func,bitmask,createHybrid,wrapper.placeholder,undefined,args,holders,undefined,undefined,arity-length):apply(this&&this!==root&&this instanceof wrapper?Ctor:func,this,args)}}(func,bitmask,arity):bitmask!=WRAP_PARTIAL_FLAG&&bitmask!=(WRAP_BIND_FLAG|WRAP_PARTIAL_FLAG)||holders.length?createHybrid.apply(undefined,newData):function(func,bitmask,thisArg,partials){var isBind=bitmask&WRAP_BIND_FLAG,Ctor=createCtor(func);return function wrapper(){for(var argsIndex=-1,argsLength=arguments.length,leftIndex=-1,leftLength=partials.length,args=Array(leftLength+argsLength),fn=this&&this!==root&&this instanceof wrapper?Ctor:func;++leftIndex<leftLength;)args[leftIndex]=partials[leftIndex];for(;argsLength--;)args[leftIndex++]=arguments[++argsIndex];return apply(fn,isBind?thisArg:this,args)}}(func,bitmask,thisArg,partials);else var result=function(func,bitmask,thisArg){var isBind=bitmask&WRAP_BIND_FLAG,Ctor=createCtor(func);return function wrapper(){return(this&&this!==root&&this instanceof wrapper?Ctor:func).apply(isBind?thisArg:this,arguments)}}(func,bitmask,thisArg);return setWrapToString((data?baseSetData:setData)(result,newData),func,bitmask)}function customDefaultsAssignIn(objValue,srcValue,key,object){return objValue===undefined||eq(objValue,objectProto[key])&&!hasOwnProperty.call(object,key)?srcValue:objValue}function customDefaultsMerge(objValue,srcValue,key,object,source,stack){return isObject(objValue)&&isObject(srcValue)&&(stack.set(srcValue,objValue),baseMerge(objValue,srcValue,undefined,customDefaultsMerge,stack),stack.delete(srcValue)),objValue}function customOmitClone(value){return isPlainObject(value)?undefined:value}function equalArrays(array,other,bitmask,customizer,equalFunc,stack){var isPartial=bitmask&COMPARE_PARTIAL_FLAG,arrLength=array.length,othLength=other.length;if(arrLength!=othLength&&!(isPartial&&othLength>arrLength))return!1;var stacked=stack.get(array);if(stacked&&stack.get(other))return stacked==other;var index=-1,result=!0,seen=bitmask&COMPARE_UNORDERED_FLAG?new SetCache:undefined;for(stack.set(array,other),stack.set(other,array);++index<arrLength;){var arrValue=array[index],othValue=other[index];if(customizer)var compared=isPartial?customizer(othValue,arrValue,index,other,array,stack):customizer(arrValue,othValue,index,array,other,stack);if(compared!==undefined){if(compared)continue;result=!1;break}if(seen){if(!arraySome(other,(function(othValue,othIndex){if(!cacheHas(seen,othIndex)&&(arrValue===othValue||equalFunc(arrValue,othValue,bitmask,customizer,stack)))return seen.push(othIndex)}))){result=!1;break}}else if(arrValue!==othValue&&!equalFunc(arrValue,othValue,bitmask,customizer,stack)){result=!1;break}}return stack.delete(array),stack.delete(other),result}function flatRest(func){return setToString(overRest(func,undefined,flatten),func+"")}function getAllKeys(object){return baseGetAllKeys(object,keys,getSymbols)}function getAllKeysIn(object){return baseGetAllKeys(object,keysIn,getSymbolsIn)}var getData=metaMap?function(func){return metaMap.get(func)}:noop;function getFuncName(func){for(var result=func.name+"",array=realNames[result],length=hasOwnProperty.call(realNames,result)?array.length:0;length--;){var data=array[length],otherFunc=data.func;if(null==otherFunc||otherFunc==func)return data.name}return result}function getHolder(func){return(hasOwnProperty.call(lodash,"placeholder")?lodash:func).placeholder}function getIteratee(){var result=lodash.iteratee||iteratee;return result=result===iteratee?baseIteratee:result,arguments.length?result(arguments[0],arguments[1]):result}function getMapData(map,key){var value,type,data=map.__data__;return("string"==(type=typeof(value=key))||"number"==type||"symbol"==type||"boolean"==type?"__proto__"!==value:null===value)?data["string"==typeof key?"string":"hash"]:data.map}function getMatchData(object){for(var result=keys(object),length=result.length;length--;){var key=result[length],value=object[key];result[length]=[key,value,isStrictComparable(value)]}return result}function getNative(object,key){var value=function(object,key){return null==object?undefined:object[key]}(object,key);return baseIsNative(value)?value:undefined}var getSymbols=nativeGetSymbols?function(object){return null==object?[]:(object=Object(object),arrayFilter(nativeGetSymbols(object),(function(symbol){return propertyIsEnumerable.call(object,symbol)})))}:stubArray,getSymbolsIn=nativeGetSymbols?function(object){for(var result=[];object;)arrayPush(result,getSymbols(object)),object=getPrototype(object);return result}:stubArray,getTag=baseGetTag;function hasPath(object,path,hasFunc){for(var index=-1,length=(path=castPath(path,object)).length,result=!1;++index<length;){var key=toKey(path[index]);if(!(result=null!=object&&hasFunc(object,key)))break;object=object[key]}return result||++index!=length?result:!!(length=null==object?0:object.length)&&isLength(length)&&isIndex(key,length)&&(isArray(object)||isArguments(object))}function initCloneObject(object){return"function"!=typeof object.constructor||isPrototype(object)?{}:baseCreate(getPrototype(object))}function isFlattenable(value){return isArray(value)||isArguments(value)||!!(spreadableSymbol&&value&&value[spreadableSymbol])}function isIndex(value,length){var type=typeof value;return!!(length=null==length?MAX_SAFE_INTEGER:length)&&("number"==type||"symbol"!=type&&reIsUint.test(value))&&value>-1&&value%1==0&&value<length}function isIterateeCall(value,index,object){if(!isObject(object))return!1;var type=typeof index;return!!("number"==type?isArrayLike(object)&&isIndex(index,object.length):"string"==type&&index in object)&&eq(object[index],value)}function isKey(value,object){if(isArray(value))return!1;var type=typeof value;return!("number"!=type&&"symbol"!=type&&"boolean"!=type&&null!=value&&!isSymbol(value))||(reIsPlainProp.test(value)||!reIsDeepProp.test(value)||null!=object&&value in Object(object))}function isLaziable(func){var funcName=getFuncName(func),other=lodash[funcName];if("function"!=typeof other||!(funcName in LazyWrapper.prototype))return!1;if(func===other)return!0;var data=getData(other);return!!data&&func===data[0]}(DataView&&getTag(new DataView(new ArrayBuffer(1)))!=dataViewTag||Map&&getTag(new Map)!=mapTag||Promise&&"[object Promise]"!=getTag(Promise.resolve())||Set&&getTag(new Set)!=setTag||WeakMap&&getTag(new WeakMap)!=weakMapTag)&&(getTag=function(value){var result=baseGetTag(value),Ctor=result==objectTag?value.constructor:undefined,ctorString=Ctor?toSource(Ctor):"";if(ctorString)switch(ctorString){case dataViewCtorString:return dataViewTag;case mapCtorString:return mapTag;case promiseCtorString:return"[object Promise]";case setCtorString:return setTag;case weakMapCtorString:return weakMapTag}return result});var isMaskable=coreJsData?isFunction:stubFalse;function isPrototype(value){var Ctor=value&&value.constructor;return value===("function"==typeof Ctor&&Ctor.prototype||objectProto)}function isStrictComparable(value){return value==value&&!isObject(value)}function matchesStrictComparable(key,srcValue){return function(object){return null!=object&&(object[key]===srcValue&&(srcValue!==undefined||key in Object(object)))}}function overRest(func,start,transform){return start=nativeMax(start===undefined?func.length-1:start,0),function(){for(var args=arguments,index=-1,length=nativeMax(args.length-start,0),array=Array(length);++index<length;)array[index]=args[start+index];index=-1;for(var otherArgs=Array(start+1);++index<start;)otherArgs[index]=args[index];return otherArgs[start]=transform(array),apply(func,this,otherArgs)}}function parent(object,path){return path.length<2?object:baseGet(object,baseSlice(path,0,-1))}function safeGet(object,key){if("__proto__"!=key)return object[key]}var setData=shortOut(baseSetData),setTimeout=ctxSetTimeout||function(func,wait){return root.setTimeout(func,wait)},setToString=shortOut(baseSetToString);function setWrapToString(wrapper,reference,bitmask){var source=reference+"";return setToString(wrapper,function(source,details){var length=details.length;if(!length)return source;var lastIndex=length-1;return details[lastIndex]=(length>1?"& ":"")+details[lastIndex],details=details.join(length>2?", ":" "),source.replace(reWrapComment,"{\n/* [wrapped with "+details+"] */\n")}(source,function(details,bitmask){return arrayEach(wrapFlags,(function(pair){var value="_."+pair[0];bitmask&pair[1]&&!arrayIncludes(details,value)&&details.push(value)})),details.sort()}(function(source){var match=source.match(reWrapDetails);return match?match[1].split(reSplitDetails):[]}(source),bitmask)))}function shortOut(func){var count=0,lastCalled=0;return function(){var stamp=nativeNow(),remaining=HOT_SPAN-(stamp-lastCalled);if(lastCalled=stamp,remaining>0){if(++count>=HOT_COUNT)return arguments[0]}else count=0;return func.apply(undefined,arguments)}}function shuffleSelf(array,size){var index=-1,length=array.length,lastIndex=length-1;for(size=size===undefined?length:size;++index<size;){var rand=baseRandom(index,lastIndex),value=array[rand];array[rand]=array[index],array[index]=value}return array.length=size,array}var stringToPath=function(func){var result=memoize(func,(function(key){return cache.size===MAX_MEMOIZE_SIZE&&cache.clear(),key})),cache=result.cache;return result}((function(string){var result=[];return 46===string.charCodeAt(0)&&result.push(""),string.replace(rePropName,(function(match,number,quote,subString){result.push(quote?subString.replace(reEscapeChar,"$1"):number||match)})),result}));function toKey(value){if("string"==typeof value||isSymbol(value))return value;var result=value+"";return"0"==result&&1/value==-INFINITY?"-0":result}function toSource(func){if(null!=func){try{return funcToString.call(func)}catch(e){}try{return func+""}catch(e){}}return""}function wrapperClone(wrapper){if(wrapper instanceof LazyWrapper)return wrapper.clone();var result=new LodashWrapper(wrapper.__wrapped__,wrapper.__chain__);return result.__actions__=copyArray(wrapper.__actions__),result.__index__=wrapper.__index__,result.__values__=wrapper.__values__,result}var difference=baseRest((function(array,values){return isArrayLikeObject(array)?baseDifference(array,baseFlatten(values,1,isArrayLikeObject,!0)):[]})),differenceBy=baseRest((function(array,values){var iteratee=last(values);return isArrayLikeObject(iteratee)&&(iteratee=undefined),isArrayLikeObject(array)?baseDifference(array,baseFlatten(values,1,isArrayLikeObject,!0),getIteratee(iteratee,2)):[]})),differenceWith=baseRest((function(array,values){var comparator=last(values);return isArrayLikeObject(comparator)&&(comparator=undefined),isArrayLikeObject(array)?baseDifference(array,baseFlatten(values,1,isArrayLikeObject,!0),undefined,comparator):[]}));function findIndex(array,predicate,fromIndex){var length=null==array?0:array.length;if(!length)return-1;var index=null==fromIndex?0:toInteger(fromIndex);return index<0&&(index=nativeMax(length+index,0)),baseFindIndex(array,getIteratee(predicate,3),index)}function findLastIndex(array,predicate,fromIndex){var length=null==array?0:array.length;if(!length)return-1;var index=length-1;return fromIndex!==undefined&&(index=toInteger(fromIndex),index=fromIndex<0?nativeMax(length+index,0):nativeMin(index,length-1)),baseFindIndex(array,getIteratee(predicate,3),index,!0)}function flatten(array){return(null==array?0:array.length)?baseFlatten(array,1):[]}function head(array){return array&&array.length?array[0]:undefined}var intersection=baseRest((function(arrays){var mapped=arrayMap(arrays,castArrayLikeObject);return mapped.length&&mapped[0]===arrays[0]?baseIntersection(mapped):[]})),intersectionBy=baseRest((function(arrays){var iteratee=last(arrays),mapped=arrayMap(arrays,castArrayLikeObject);return iteratee===last(mapped)?iteratee=undefined:mapped.pop(),mapped.length&&mapped[0]===arrays[0]?baseIntersection(mapped,getIteratee(iteratee,2)):[]})),intersectionWith=baseRest((function(arrays){var comparator=last(arrays),mapped=arrayMap(arrays,castArrayLikeObject);return(comparator="function"==typeof comparator?comparator:undefined)&&mapped.pop(),mapped.length&&mapped[0]===arrays[0]?baseIntersection(mapped,undefined,comparator):[]}));function last(array){var length=null==array?0:array.length;return length?array[length-1]:undefined}var pull=baseRest(pullAll);function pullAll(array,values){return array&&array.length&&values&&values.length?basePullAll(array,values):array}var pullAt=flatRest((function(array,indexes){var length=null==array?0:array.length,result=baseAt(array,indexes);return basePullAt(array,arrayMap(indexes,(function(index){return isIndex(index,length)?+index:index})).sort(compareAscending)),result}));function reverse(array){return null==array?array:nativeReverse.call(array)}var union=baseRest((function(arrays){return baseUniq(baseFlatten(arrays,1,isArrayLikeObject,!0))})),unionBy=baseRest((function(arrays){var iteratee=last(arrays);return isArrayLikeObject(iteratee)&&(iteratee=undefined),baseUniq(baseFlatten(arrays,1,isArrayLikeObject,!0),getIteratee(iteratee,2))})),unionWith=baseRest((function(arrays){var comparator=last(arrays);return comparator="function"==typeof comparator?comparator:undefined,baseUniq(baseFlatten(arrays,1,isArrayLikeObject,!0),undefined,comparator)}));function unzip(array){if(!array||!array.length)return[];var length=0;return array=arrayFilter(array,(function(group){if(isArrayLikeObject(group))return length=nativeMax(group.length,length),!0})),baseTimes(length,(function(index){return arrayMap(array,baseProperty(index))}))}function unzipWith(array,iteratee){if(!array||!array.length)return[];var result=unzip(array);return null==iteratee?result:arrayMap(result,(function(group){return apply(iteratee,undefined,group)}))}var without=baseRest((function(array,values){return isArrayLikeObject(array)?baseDifference(array,values):[]})),xor=baseRest((function(arrays){return baseXor(arrayFilter(arrays,isArrayLikeObject))})),xorBy=baseRest((function(arrays){var iteratee=last(arrays);return isArrayLikeObject(iteratee)&&(iteratee=undefined),baseXor(arrayFilter(arrays,isArrayLikeObject),getIteratee(iteratee,2))})),xorWith=baseRest((function(arrays){var comparator=last(arrays);return comparator="function"==typeof comparator?comparator:undefined,baseXor(arrayFilter(arrays,isArrayLikeObject),undefined,comparator)})),zip=baseRest(unzip);var zipWith=baseRest((function(arrays){var length=arrays.length,iteratee=length>1?arrays[length-1]:undefined;return iteratee="function"==typeof iteratee?(arrays.pop(),iteratee):undefined,unzipWith(arrays,iteratee)}));function chain(value){var result=lodash(value);return result.__chain__=!0,result}function thru(value,interceptor){return interceptor(value)}var wrapperAt=flatRest((function(paths){var length=paths.length,start=length?paths[0]:0,value=this.__wrapped__,interceptor=function(object){return baseAt(object,paths)};return!(length>1||this.__actions__.length)&&value instanceof LazyWrapper&&isIndex(start)?((value=value.slice(start,+start+(length?1:0))).__actions__.push({func:thru,args:[interceptor],thisArg:undefined}),new LodashWrapper(value,this.__chain__).thru((function(array){return length&&!array.length&&array.push(undefined),array}))):this.thru(interceptor)}));var countBy=createAggregator((function(result,value,key){hasOwnProperty.call(result,key)?++result[key]:baseAssignValue(result,key,1)}));var find=createFind(findIndex),findLast=createFind(findLastIndex);function forEach(collection,iteratee){return(isArray(collection)?arrayEach:baseEach)(collection,getIteratee(iteratee,3))}function forEachRight(collection,iteratee){return(isArray(collection)?arrayEachRight:baseEachRight)(collection,getIteratee(iteratee,3))}var groupBy=createAggregator((function(result,value,key){hasOwnProperty.call(result,key)?result[key].push(value):baseAssignValue(result,key,[value])}));var invokeMap=baseRest((function(collection,path,args){var index=-1,isFunc="function"==typeof path,result=isArrayLike(collection)?Array(collection.length):[];return baseEach(collection,(function(value){result[++index]=isFunc?apply(path,value,args):baseInvoke(value,path,args)})),result})),keyBy=createAggregator((function(result,value,key){baseAssignValue(result,key,value)}));function map(collection,iteratee){return(isArray(collection)?arrayMap:baseMap)(collection,getIteratee(iteratee,3))}var partition=createAggregator((function(result,value,key){result[key?0:1].push(value)}),(function(){return[[],[]]}));var sortBy=baseRest((function(collection,iteratees){if(null==collection)return[];var length=iteratees.length;return length>1&&isIterateeCall(collection,iteratees[0],iteratees[1])?iteratees=[]:length>2&&isIterateeCall(iteratees[0],iteratees[1],iteratees[2])&&(iteratees=[iteratees[0]]),baseOrderBy(collection,baseFlatten(iteratees,1),[])})),now=ctxNow||function(){return root.Date.now()};function ary(func,n,guard){return n=guard?undefined:n,n=func&&null==n?func.length:n,createWrap(func,WRAP_ARY_FLAG,undefined,undefined,undefined,undefined,n)}function before(n,func){var result;if("function"!=typeof func)throw new TypeError(FUNC_ERROR_TEXT);return n=toInteger(n),function(){return--n>0&&(result=func.apply(this,arguments)),n<=1&&(func=undefined),result}}var bind=baseRest((function(func,thisArg,partials){var bitmask=WRAP_BIND_FLAG;if(partials.length){var holders=replaceHolders(partials,getHolder(bind));bitmask|=WRAP_PARTIAL_FLAG}return createWrap(func,bitmask,thisArg,partials,holders)})),bindKey=baseRest((function(object,key,partials){var bitmask=WRAP_BIND_FLAG|WRAP_BIND_KEY_FLAG;if(partials.length){var holders=replaceHolders(partials,getHolder(bindKey));bitmask|=WRAP_PARTIAL_FLAG}return createWrap(key,bitmask,object,partials,holders)}));function debounce(func,wait,options){var lastArgs,lastThis,maxWait,result,timerId,lastCallTime,lastInvokeTime=0,leading=!1,maxing=!1,trailing=!0;if("function"!=typeof func)throw new TypeError(FUNC_ERROR_TEXT);function invokeFunc(time){var args=lastArgs,thisArg=lastThis;return lastArgs=lastThis=undefined,lastInvokeTime=time,result=func.apply(thisArg,args)}function shouldInvoke(time){var timeSinceLastCall=time-lastCallTime;return lastCallTime===undefined||timeSinceLastCall>=wait||timeSinceLastCall<0||maxing&&time-lastInvokeTime>=maxWait}function timerExpired(){var time=now();if(shouldInvoke(time))return trailingEdge(time);timerId=setTimeout(timerExpired,function(time){var timeWaiting=wait-(time-lastCallTime);return maxing?nativeMin(timeWaiting,maxWait-(time-lastInvokeTime)):timeWaiting}(time))}function trailingEdge(time){return timerId=undefined,trailing&&lastArgs?invokeFunc(time):(lastArgs=lastThis=undefined,result)}function debounced(){var time=now(),isInvoking=shouldInvoke(time);if(lastArgs=arguments,lastThis=this,lastCallTime=time,isInvoking){if(timerId===undefined)return function(time){return lastInvokeTime=time,timerId=setTimeout(timerExpired,wait),leading?invokeFunc(time):result}(lastCallTime);if(maxing)return timerId=setTimeout(timerExpired,wait),invokeFunc(lastCallTime)}return timerId===undefined&&(timerId=setTimeout(timerExpired,wait)),result}return wait=toNumber(wait)||0,isObject(options)&&(leading=!!options.leading,maxWait=(maxing="maxWait"in options)?nativeMax(toNumber(options.maxWait)||0,wait):maxWait,trailing="trailing"in options?!!options.trailing:trailing),debounced.cancel=function(){timerId!==undefined&&clearTimeout(timerId),lastInvokeTime=0,lastArgs=lastCallTime=lastThis=timerId=undefined},debounced.flush=function(){return timerId===undefined?result:trailingEdge(now())},debounced}var defer=baseRest((function(func,args){return baseDelay(func,1,args)})),delay=baseRest((function(func,wait,args){return baseDelay(func,toNumber(wait)||0,args)}));function memoize(func,resolver){if("function"!=typeof func||null!=resolver&&"function"!=typeof resolver)throw new TypeError(FUNC_ERROR_TEXT);var memoized=function(){var args=arguments,key=resolver?resolver.apply(this,args):args[0],cache=memoized.cache;if(cache.has(key))return cache.get(key);var result=func.apply(this,args);return memoized.cache=cache.set(key,result)||cache,result};return memoized.cache=new(memoize.Cache||MapCache),memoized}function negate(predicate){if("function"!=typeof predicate)throw new TypeError(FUNC_ERROR_TEXT);return function(){var args=arguments;switch(args.length){case 0:return!predicate.call(this);case 1:return!predicate.call(this,args[0]);case 2:return!predicate.call(this,args[0],args[1]);case 3:return!predicate.call(this,args[0],args[1],args[2])}return!predicate.apply(this,args)}}memoize.Cache=MapCache;var overArgs=castRest((function(func,transforms){var funcsLength=(transforms=1==transforms.length&&isArray(transforms[0])?arrayMap(transforms[0],baseUnary(getIteratee())):arrayMap(baseFlatten(transforms,1),baseUnary(getIteratee()))).length;return baseRest((function(args){for(var index=-1,length=nativeMin(args.length,funcsLength);++index<length;)args[index]=transforms[index].call(this,args[index]);return apply(func,this,args)}))})),partial=baseRest((function(func,partials){var holders=replaceHolders(partials,getHolder(partial));return createWrap(func,WRAP_PARTIAL_FLAG,undefined,partials,holders)})),partialRight=baseRest((function(func,partials){var holders=replaceHolders(partials,getHolder(partialRight));return createWrap(func,WRAP_PARTIAL_RIGHT_FLAG,undefined,partials,holders)})),rearg=flatRest((function(func,indexes){return createWrap(func,WRAP_REARG_FLAG,undefined,undefined,undefined,indexes)}));function eq(value,other){return value===other||value!=value&&other!=other}var gt=createRelationalOperation(baseGt),gte=createRelationalOperation((function(value,other){return value>=other})),isArguments=baseIsArguments(function(){return arguments}())?baseIsArguments:function(value){return isObjectLike(value)&&hasOwnProperty.call(value,"callee")&&!propertyIsEnumerable.call(value,"callee")},isArray=Array.isArray,isArrayBuffer=nodeIsArrayBuffer?baseUnary(nodeIsArrayBuffer):function(value){return isObjectLike(value)&&baseGetTag(value)==arrayBufferTag};function isArrayLike(value){return null!=value&&isLength(value.length)&&!isFunction(value)}function isArrayLikeObject(value){return isObjectLike(value)&&isArrayLike(value)}var isBuffer=nativeIsBuffer||stubFalse,isDate=nodeIsDate?baseUnary(nodeIsDate):function(value){return isObjectLike(value)&&baseGetTag(value)==dateTag};function isError(value){if(!isObjectLike(value))return!1;var tag=baseGetTag(value);return tag==errorTag||tag==domExcTag||"string"==typeof value.message&&"string"==typeof value.name&&!isPlainObject(value)}function isFunction(value){if(!isObject(value))return!1;var tag=baseGetTag(value);return tag==funcTag||tag==genTag||tag==asyncTag||tag==proxyTag}function isInteger(value){return"number"==typeof value&&value==toInteger(value)}function isLength(value){return"number"==typeof value&&value>-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function isObject(value){var type=typeof value;return null!=value&&("object"==type||"function"==type)}function isObjectLike(value){return null!=value&&"object"==typeof value}var isMap=nodeIsMap?baseUnary(nodeIsMap):function(value){return isObjectLike(value)&&getTag(value)==mapTag};function isNumber(value){return"number"==typeof value||isObjectLike(value)&&baseGetTag(value)==numberTag}function isPlainObject(value){if(!isObjectLike(value)||baseGetTag(value)!=objectTag)return!1;var proto=getPrototype(value);if(null===proto)return!0;var Ctor=hasOwnProperty.call(proto,"constructor")&&proto.constructor;return"function"==typeof Ctor&&Ctor instanceof Ctor&&funcToString.call(Ctor)==objectCtorString}var isRegExp=nodeIsRegExp?baseUnary(nodeIsRegExp):function(value){return isObjectLike(value)&&baseGetTag(value)==regexpTag};var isSet=nodeIsSet?baseUnary(nodeIsSet):function(value){return isObjectLike(value)&&getTag(value)==setTag};function isString(value){return"string"==typeof value||!isArray(value)&&isObjectLike(value)&&baseGetTag(value)==stringTag}function isSymbol(value){return"symbol"==typeof value||isObjectLike(value)&&baseGetTag(value)==symbolTag}var isTypedArray=nodeIsTypedArray?baseUnary(nodeIsTypedArray):function(value){return isObjectLike(value)&&isLength(value.length)&&!!typedArrayTags[baseGetTag(value)]};var lt=createRelationalOperation(baseLt),lte=createRelationalOperation((function(value,other){return value<=other}));function toArray(value){if(!value)return[];if(isArrayLike(value))return isString(value)?stringToArray(value):copyArray(value);if(symIterator&&value[symIterator])return function(iterator){for(var data,result=[];!(data=iterator.next()).done;)result.push(data.value);return result}(value[symIterator]());var tag=getTag(value);return(tag==mapTag?mapToArray:tag==setTag?setToArray:values)(value)}function toFinite(value){return value?(value=toNumber(value))===INFINITY||value===-INFINITY?(value<0?-1:1)*MAX_INTEGER:value==value?value:0:0===value?value:0}function toInteger(value){var result=toFinite(value),remainder=result%1;return result==result?remainder?result-remainder:result:0}function toLength(value){return value?baseClamp(toInteger(value),0,MAX_ARRAY_LENGTH):0}function toNumber(value){if("number"==typeof value)return value;if(isSymbol(value))return NAN;if(isObject(value)){var other="function"==typeof value.valueOf?value.valueOf():value;value=isObject(other)?other+"":other}if("string"!=typeof value)return 0===value?value:+value;value=value.replace(reTrim,"");var isBinary=reIsBinary.test(value);return isBinary||reIsOctal.test(value)?freeParseInt(value.slice(2),isBinary?2:8):reIsBadHex.test(value)?NAN:+value}function toPlainObject(value){return copyObject(value,keysIn(value))}function toString(value){return null==value?"":baseToString(value)}var assign=createAssigner((function(object,source){if(isPrototype(source)||isArrayLike(source))copyObject(source,keys(source),object);else for(var key in source)hasOwnProperty.call(source,key)&&assignValue(object,key,source[key])})),assignIn=createAssigner((function(object,source){copyObject(source,keysIn(source),object)})),assignInWith=createAssigner((function(object,source,srcIndex,customizer){copyObject(source,keysIn(source),object,customizer)})),assignWith=createAssigner((function(object,source,srcIndex,customizer){copyObject(source,keys(source),object,customizer)})),at=flatRest(baseAt);var defaults=baseRest((function(object,sources){object=Object(object);var index=-1,length=sources.length,guard=length>2?sources[2]:undefined;for(guard&&isIterateeCall(sources[0],sources[1],guard)&&(length=1);++index<length;)for(var source=sources[index],props=keysIn(source),propsIndex=-1,propsLength=props.length;++propsIndex<propsLength;){var key=props[propsIndex],value=object[key];(value===undefined||eq(value,objectProto[key])&&!hasOwnProperty.call(object,key))&&(object[key]=source[key])}return object})),defaultsDeep=baseRest((function(args){return args.push(undefined,customDefaultsMerge),apply(mergeWith,undefined,args)}));function get(object,path,defaultValue){var result=null==object?undefined:baseGet(object,path);return result===undefined?defaultValue:result}function hasIn(object,path){return null!=object&&hasPath(object,path,baseHasIn)}var invert=createInverter((function(result,value,key){null!=value&&"function"!=typeof value.toString&&(value=nativeObjectToString.call(value)),result[value]=key}),constant(identity)),invertBy=createInverter((function(result,value,key){null!=value&&"function"!=typeof value.toString&&(value=nativeObjectToString.call(value)),hasOwnProperty.call(result,value)?result[value].push(key):result[value]=[key]}),getIteratee),invoke=baseRest(baseInvoke);function keys(object){return isArrayLike(object)?arrayLikeKeys(object):baseKeys(object)}function keysIn(object){return isArrayLike(object)?arrayLikeKeys(object,!0):baseKeysIn(object)}var merge=createAssigner((function(object,source,srcIndex){baseMerge(object,source,srcIndex)})),mergeWith=createAssigner((function(object,source,srcIndex,customizer){baseMerge(object,source,srcIndex,customizer)})),omit=flatRest((function(object,paths){var result={};if(null==object)return result;var isDeep=!1;paths=arrayMap(paths,(function(path){return path=castPath(path,object),isDeep||(isDeep=path.length>1),path})),copyObject(object,getAllKeysIn(object),result),isDeep&&(result=baseClone(result,CLONE_DEEP_FLAG|CLONE_FLAT_FLAG|CLONE_SYMBOLS_FLAG,customOmitClone));for(var length=paths.length;length--;)baseUnset(result,paths[length]);return result}));var pick=flatRest((function(object,paths){return null==object?{}:function(object,paths){return basePickBy(object,paths,(function(value,path){return hasIn(object,path)}))}(object,paths)}));function pickBy(object,predicate){if(null==object)return{};var props=arrayMap(getAllKeysIn(object),(function(prop){return[prop]}));return predicate=getIteratee(predicate),basePickBy(object,props,(function(value,path){return predicate(value,path[0])}))}var toPairs=createToPairs(keys),toPairsIn=createToPairs(keysIn);function values(object){return null==object?[]:baseValues(object,keys(object))}var camelCase=createCompounder((function(result,word,index){return word=word.toLowerCase(),result+(index?capitalize(word):word)}));function capitalize(string){return upperFirst(toString(string).toLowerCase())}function deburr(string){return(string=toString(string))&&string.replace(reLatin,deburrLetter).replace(reComboMark,"")}var kebabCase=createCompounder((function(result,word,index){return result+(index?"-":"")+word.toLowerCase()})),lowerCase=createCompounder((function(result,word,index){return result+(index?" ":"")+word.toLowerCase()})),lowerFirst=createCaseFirst("toLowerCase");var snakeCase=createCompounder((function(result,word,index){return result+(index?"_":"")+word.toLowerCase()}));var startCase=createCompounder((function(result,word,index){return result+(index?" ":"")+upperFirst(word)}));var upperCase=createCompounder((function(result,word,index){return result+(index?" ":"")+word.toUpperCase()})),upperFirst=createCaseFirst("toUpperCase");function words(string,pattern,guard){return string=toString(string),(pattern=guard?undefined:pattern)===undefined?function(string){return reHasUnicodeWord.test(string)}(string)?function(string){return string.match(reUnicodeWord)||[]}(string):function(string){return string.match(reAsciiWord)||[]}(string):string.match(pattern)||[]}var attempt=baseRest((function(func,args){try{return apply(func,undefined,args)}catch(e){return isError(e)?e:new Error(e)}})),bindAll=flatRest((function(object,methodNames){return arrayEach(methodNames,(function(key){key=toKey(key),baseAssignValue(object,key,bind(object[key],object))})),object}));function constant(value){return function(){return value}}var flow=createFlow(),flowRight=createFlow(!0);function identity(value){return value}function iteratee(func){return baseIteratee("function"==typeof func?func:baseClone(func,CLONE_DEEP_FLAG))}var method=baseRest((function(path,args){return function(object){return baseInvoke(object,path,args)}})),methodOf=baseRest((function(object,args){return function(path){return baseInvoke(object,path,args)}}));function mixin(object,source,options){var props=keys(source),methodNames=baseFunctions(source,props);null!=options||isObject(source)&&(methodNames.length||!props.length)||(options=source,source=object,object=this,methodNames=baseFunctions(source,keys(source)));var chain=!(isObject(options)&&"chain"in options&&!options.chain),isFunc=isFunction(object);return arrayEach(methodNames,(function(methodName){var func=source[methodName];object[methodName]=func,isFunc&&(object.prototype[methodName]=function(){var chainAll=this.__chain__;if(chain||chainAll){var result=object(this.__wrapped__),actions=result.__actions__=copyArray(this.__actions__);return actions.push({func:func,args:arguments,thisArg:object}),result.__chain__=chainAll,result}return func.apply(object,arrayPush([this.value()],arguments))})})),object}function noop(){}var over=createOver(arrayMap),overEvery=createOver(arrayEvery),overSome=createOver(arraySome);function property(path){return isKey(path)?baseProperty(toKey(path)):function(path){return function(object){return baseGet(object,path)}}(path)}var range=createRange(),rangeRight=createRange(!0);function stubArray(){return[]}function stubFalse(){return!1}var add=createMathOperation((function(augend,addend){return augend+addend}),0),ceil=createRound("ceil"),divide=createMathOperation((function(dividend,divisor){return dividend/divisor}),1),floor=createRound("floor");var source,multiply=createMathOperation((function(multiplier,multiplicand){return multiplier*multiplicand}),1),round=createRound("round"),subtract=createMathOperation((function(minuend,subtrahend){return minuend-subtrahend}),0);return lodash.after=function(n,func){if("function"!=typeof func)throw new TypeError(FUNC_ERROR_TEXT);return n=toInteger(n),function(){if(--n<1)return func.apply(this,arguments)}},lodash.ary=ary,lodash.assign=assign,lodash.assignIn=assignIn,lodash.assignInWith=assignInWith,lodash.assignWith=assignWith,lodash.at=at,lodash.before=before,lodash.bind=bind,lodash.bindAll=bindAll,lodash.bindKey=bindKey,lodash.castArray=function(){if(!arguments.length)return[];var value=arguments[0];return isArray(value)?value:[value]},lodash.chain=chain,lodash.chunk=function(array,size,guard){size=(guard?isIterateeCall(array,size,guard):size===undefined)?1:nativeMax(toInteger(size),0);var length=null==array?0:array.length;if(!length||size<1)return[];for(var index=0,resIndex=0,result=Array(nativeCeil(length/size));index<length;)result[resIndex++]=baseSlice(array,index,index+=size);return result},lodash.compact=function(array){for(var index=-1,length=null==array?0:array.length,resIndex=0,result=[];++index<length;){var value=array[index];value&&(result[resIndex++]=value)}return result},lodash.concat=function(){var length=arguments.length;if(!length)return[];for(var args=Array(length-1),array=arguments[0],index=length;index--;)args[index-1]=arguments[index];return arrayPush(isArray(array)?copyArray(array):[array],baseFlatten(args,1))},lodash.cond=function(pairs){var length=null==pairs?0:pairs.length,toIteratee=getIteratee();return pairs=length?arrayMap(pairs,(function(pair){if("function"!=typeof pair[1])throw new TypeError(FUNC_ERROR_TEXT);return[toIteratee(pair[0]),pair[1]]})):[],baseRest((function(args){for(var index=-1;++index<length;){var pair=pairs[index];if(apply(pair[0],this,args))return apply(pair[1],this,args)}}))},lodash.conforms=function(source){return function(source){var props=keys(source);return function(object){return baseConformsTo(object,source,props)}}(baseClone(source,CLONE_DEEP_FLAG))},lodash.constant=constant,lodash.countBy=countBy,lodash.create=function(prototype,properties){var result=baseCreate(prototype);return null==properties?result:baseAssign(result,properties)},lodash.curry=function curry(func,arity,guard){var result=createWrap(func,WRAP_CURRY_FLAG,undefined,undefined,undefined,undefined,undefined,arity=guard?undefined:arity);return result.placeholder=curry.placeholder,result},lodash.curryRight=function curryRight(func,arity,guard){var result=createWrap(func,WRAP_CURRY_RIGHT_FLAG,undefined,undefined,undefined,undefined,undefined,arity=guard?undefined:arity);return result.placeholder=curryRight.placeholder,result},lodash.debounce=debounce,lodash.defaults=defaults,lodash.defaultsDeep=defaultsDeep,lodash.defer=defer,lodash.delay=delay,lodash.difference=difference,lodash.differenceBy=differenceBy,lodash.differenceWith=differenceWith,lodash.drop=function(array,n,guard){var length=null==array?0:array.length;return length?baseSlice(array,(n=guard||n===undefined?1:toInteger(n))<0?0:n,length):[]},lodash.dropRight=function(array,n,guard){var length=null==array?0:array.length;return length?baseSlice(array,0,(n=length-(n=guard||n===undefined?1:toInteger(n)))<0?0:n):[]},lodash.dropRightWhile=function(array,predicate){return array&&array.length?baseWhile(array,getIteratee(predicate,3),!0,!0):[]},lodash.dropWhile=function(array,predicate){return array&&array.length?baseWhile(array,getIteratee(predicate,3),!0):[]},lodash.fill=function(array,value,start,end){var length=null==array?0:array.length;return length?(start&&"number"!=typeof start&&isIterateeCall(array,value,start)&&(start=0,end=length),function(array,value,start,end){var length=array.length;for((start=toInteger(start))<0&&(start=-start>length?0:length+start),(end=end===undefined||end>length?length:toInteger(end))<0&&(end+=length),end=start>end?0:toLength(end);start<end;)array[start++]=value;return array}(array,value,start,end)):[]},lodash.filter=function(collection,predicate){return(isArray(collection)?arrayFilter:baseFilter)(collection,getIteratee(predicate,3))},lodash.flatMap=function(collection,iteratee){return baseFlatten(map(collection,iteratee),1)},lodash.flatMapDeep=function(collection,iteratee){return baseFlatten(map(collection,iteratee),INFINITY)},lodash.flatMapDepth=function(collection,iteratee,depth){return depth=depth===undefined?1:toInteger(depth),baseFlatten(map(collection,iteratee),depth)},lodash.flatten=flatten,lodash.flattenDeep=function(array){return(null==array?0:array.length)?baseFlatten(array,INFINITY):[]},lodash.flattenDepth=function(array,depth){return(null==array?0:array.length)?baseFlatten(array,depth=depth===undefined?1:toInteger(depth)):[]},lodash.flip=function(func){return createWrap(func,WRAP_FLIP_FLAG)},lodash.flow=flow,lodash.flowRight=flowRight,lodash.fromPairs=function(pairs){for(var index=-1,length=null==pairs?0:pairs.length,result={};++index<length;){var pair=pairs[index];result[pair[0]]=pair[1]}return result},lodash.functions=function(object){return null==object?[]:baseFunctions(object,keys(object))},lodash.functionsIn=function(object){return null==object?[]:baseFunctions(object,keysIn(object))},lodash.groupBy=groupBy,lodash.initial=function(array){return(null==array?0:array.length)?baseSlice(array,0,-1):[]},lodash.intersection=intersection,lodash.intersectionBy=intersectionBy,lodash.intersectionWith=intersectionWith,lodash.invert=invert,lodash.invertBy=invertBy,lodash.invokeMap=invokeMap,lodash.iteratee=iteratee,lodash.keyBy=keyBy,lodash.keys=keys,lodash.keysIn=keysIn,lodash.map=map,lodash.mapKeys=function(object,iteratee){var result={};return iteratee=getIteratee(iteratee,3),baseForOwn(object,(function(value,key,object){baseAssignValue(result,iteratee(value,key,object),value)})),result},lodash.mapValues=function(object,iteratee){var result={};return iteratee=getIteratee(iteratee,3),baseForOwn(object,(function(value,key,object){baseAssignValue(result,key,iteratee(value,key,object))})),result},lodash.matches=function(source){return baseMatches(baseClone(source,CLONE_DEEP_FLAG))},lodash.matchesProperty=function(path,srcValue){return baseMatchesProperty(path,baseClone(srcValue,CLONE_DEEP_FLAG))},lodash.memoize=memoize,lodash.merge=merge,lodash.mergeWith=mergeWith,lodash.method=method,lodash.methodOf=methodOf,lodash.mixin=mixin,lodash.negate=negate,lodash.nthArg=function(n){return n=toInteger(n),baseRest((function(args){return baseNth(args,n)}))},lodash.omit=omit,lodash.omitBy=function(object,predicate){return pickBy(object,negate(getIteratee(predicate)))},lodash.once=function(func){return before(2,func)},lodash.orderBy=function(collection,iteratees,orders,guard){return null==collection?[]:(isArray(iteratees)||(iteratees=null==iteratees?[]:[iteratees]),isArray(orders=guard?undefined:orders)||(orders=null==orders?[]:[orders]),baseOrderBy(collection,iteratees,orders))},lodash.over=over,lodash.overArgs=overArgs,lodash.overEvery=overEvery,lodash.overSome=overSome,lodash.partial=partial,lodash.partialRight=partialRight,lodash.partition=partition,lodash.pick=pick,lodash.pickBy=pickBy,lodash.property=property,lodash.propertyOf=function(object){return function(path){return null==object?undefined:baseGet(object,path)}},lodash.pull=pull,lodash.pullAll=pullAll,lodash.pullAllBy=function(array,values,iteratee){return array&&array.length&&values&&values.length?basePullAll(array,values,getIteratee(iteratee,2)):array},lodash.pullAllWith=function(array,values,comparator){return array&&array.length&&values&&values.length?basePullAll(array,values,undefined,comparator):array},lodash.pullAt=pullAt,lodash.range=range,lodash.rangeRight=rangeRight,lodash.rearg=rearg,lodash.reject=function(collection,predicate){return(isArray(collection)?arrayFilter:baseFilter)(collection,negate(getIteratee(predicate,3)))},lodash.remove=function(array,predicate){var result=[];if(!array||!array.length)return result;var index=-1,indexes=[],length=array.length;for(predicate=getIteratee(predicate,3);++index<length;){var value=array[index];predicate(value,index,array)&&(result.push(value),indexes.push(index))}return basePullAt(array,indexes),result},lodash.rest=function(func,start){if("function"!=typeof func)throw new TypeError(FUNC_ERROR_TEXT);return baseRest(func,start=start===undefined?start:toInteger(start))},lodash.reverse=reverse,lodash.sampleSize=function(collection,n,guard){return n=(guard?isIterateeCall(collection,n,guard):n===undefined)?1:toInteger(n),(isArray(collection)?arraySampleSize:baseSampleSize)(collection,n)},lodash.set=function(object,path,value){return null==object?object:baseSet(object,path,value)},lodash.setWith=function(object,path,value,customizer){return customizer="function"==typeof customizer?customizer:undefined,null==object?object:baseSet(object,path,value,customizer)},lodash.shuffle=function(collection){return(isArray(collection)?arrayShuffle:baseShuffle)(collection)},lodash.slice=function(array,start,end){var length=null==array?0:array.length;return length?(end&&"number"!=typeof end&&isIterateeCall(array,start,end)?(start=0,end=length):(start=null==start?0:toInteger(start),end=end===undefined?length:toInteger(end)),baseSlice(array,start,end)):[]},lodash.sortBy=sortBy,lodash.sortedUniq=function(array){return array&&array.length?baseSortedUniq(array):[]},lodash.sortedUniqBy=function(array,iteratee){return array&&array.length?baseSortedUniq(array,getIteratee(iteratee,2)):[]},lodash.split=function(string,separator,limit){return limit&&"number"!=typeof limit&&isIterateeCall(string,separator,limit)&&(separator=limit=undefined),(limit=limit===undefined?MAX_ARRAY_LENGTH:limit>>>0)?(string=toString(string))&&("string"==typeof separator||null!=separator&&!isRegExp(separator))&&!(separator=baseToString(separator))&&hasUnicode(string)?castSlice(stringToArray(string),0,limit):string.split(separator,limit):[]},lodash.spread=function(func,start){if("function"!=typeof func)throw new TypeError(FUNC_ERROR_TEXT);return start=null==start?0:nativeMax(toInteger(start),0),baseRest((function(args){var array=args[start],otherArgs=castSlice(args,0,start);return array&&arrayPush(otherArgs,array),apply(func,this,otherArgs)}))},lodash.tail=function(array){var length=null==array?0:array.length;return length?baseSlice(array,1,length):[]},lodash.take=function(array,n,guard){return array&&array.length?baseSlice(array,0,(n=guard||n===undefined?1:toInteger(n))<0?0:n):[]},lodash.takeRight=function(array,n,guard){var length=null==array?0:array.length;return length?baseSlice(array,(n=length-(n=guard||n===undefined?1:toInteger(n)))<0?0:n,length):[]},lodash.takeRightWhile=function(array,predicate){return array&&array.length?baseWhile(array,getIteratee(predicate,3),!1,!0):[]},lodash.takeWhile=function(array,predicate){return array&&array.length?baseWhile(array,getIteratee(predicate,3)):[]},lodash.tap=function(value,interceptor){return interceptor(value),value},lodash.throttle=function(func,wait,options){var leading=!0,trailing=!0;if("function"!=typeof func)throw new TypeError(FUNC_ERROR_TEXT);return isObject(options)&&(leading="leading"in options?!!options.leading:leading,trailing="trailing"in options?!!options.trailing:trailing),debounce(func,wait,{leading:leading,maxWait:wait,trailing:trailing})},lodash.thru=thru,lodash.toArray=toArray,lodash.toPairs=toPairs,lodash.toPairsIn=toPairsIn,lodash.toPath=function(value){return isArray(value)?arrayMap(value,toKey):isSymbol(value)?[value]:copyArray(stringToPath(toString(value)))},lodash.toPlainObject=toPlainObject,lodash.transform=function(object,iteratee,accumulator){var isArr=isArray(object),isArrLike=isArr||isBuffer(object)||isTypedArray(object);if(iteratee=getIteratee(iteratee,4),null==accumulator){var Ctor=object&&object.constructor;accumulator=isArrLike?isArr?new Ctor:[]:isObject(object)&&isFunction(Ctor)?baseCreate(getPrototype(object)):{}}return(isArrLike?arrayEach:baseForOwn)(object,(function(value,index,object){return iteratee(accumulator,value,index,object)})),accumulator},lodash.unary=function(func){return ary(func,1)},lodash.union=union,lodash.unionBy=unionBy,lodash.unionWith=unionWith,lodash.uniq=function(array){return array&&array.length?baseUniq(array):[]},lodash.uniqBy=function(array,iteratee){return array&&array.length?baseUniq(array,getIteratee(iteratee,2)):[]},lodash.uniqWith=function(array,comparator){return comparator="function"==typeof comparator?comparator:undefined,array&&array.length?baseUniq(array,undefined,comparator):[]},lodash.unset=function(object,path){return null==object||baseUnset(object,path)},lodash.unzip=unzip,lodash.unzipWith=unzipWith,lodash.update=function(object,path,updater){return null==object?object:baseUpdate(object,path,castFunction(updater))},lodash.updateWith=function(object,path,updater,customizer){return customizer="function"==typeof customizer?customizer:undefined,null==object?object:baseUpdate(object,path,castFunction(updater),customizer)},lodash.values=values,lodash.valuesIn=function(object){return null==object?[]:baseValues(object,keysIn(object))},lodash.without=without,lodash.words=words,lodash.wrap=function(value,wrapper){return partial(castFunction(wrapper),value)},lodash.xor=xor,lodash.xorBy=xorBy,lodash.xorWith=xorWith,lodash.zip=zip,lodash.zipObject=function(props,values){return baseZipObject(props||[],values||[],assignValue)},lodash.zipObjectDeep=function(props,values){return baseZipObject(props||[],values||[],baseSet)},lodash.zipWith=zipWith,lodash.entries=toPairs,lodash.entriesIn=toPairsIn,lodash.extend=assignIn,lodash.extendWith=assignInWith,mixin(lodash,lodash),lodash.add=add,lodash.attempt=attempt,lodash.camelCase=camelCase,lodash.capitalize=capitalize,lodash.ceil=ceil,lodash.clamp=function(number,lower,upper){return upper===undefined&&(upper=lower,lower=undefined),upper!==undefined&&(upper=(upper=toNumber(upper))==upper?upper:0),lower!==undefined&&(lower=(lower=toNumber(lower))==lower?lower:0),baseClamp(toNumber(number),lower,upper)},lodash.clone=function(value){return baseClone(value,CLONE_SYMBOLS_FLAG)},lodash.cloneDeep=function(value){return baseClone(value,CLONE_DEEP_FLAG|CLONE_SYMBOLS_FLAG)},lodash.cloneDeepWith=function(value,customizer){return baseClone(value,CLONE_DEEP_FLAG|CLONE_SYMBOLS_FLAG,customizer="function"==typeof customizer?customizer:undefined)},lodash.cloneWith=function(value,customizer){return baseClone(value,CLONE_SYMBOLS_FLAG,customizer="function"==typeof customizer?customizer:undefined)},lodash.conformsTo=function(object,source){return null==source||baseConformsTo(object,source,keys(source))},lodash.deburr=deburr,lodash.defaultTo=function(value,defaultValue){return null==value||value!=value?defaultValue:value},lodash.divide=divide,lodash.endsWith=function(string,target,position){string=toString(string),target=baseToString(target);var length=string.length,end=position=position===undefined?length:baseClamp(toInteger(position),0,length);return(position-=target.length)>=0&&string.slice(position,end)==target},lodash.eq=eq,lodash.escape=function(string){return(string=toString(string))&&reHasUnescapedHtml.test(string)?string.replace(reUnescapedHtml,escapeHtmlChar):string},lodash.escapeRegExp=function(string){return(string=toString(string))&&reHasRegExpChar.test(string)?string.replace(reRegExpChar,"\\$&"):string},lodash.every=function(collection,predicate,guard){var func=isArray(collection)?arrayEvery:baseEvery;return guard&&isIterateeCall(collection,predicate,guard)&&(predicate=undefined),func(collection,getIteratee(predicate,3))},lodash.find=find,lodash.findIndex=findIndex,lodash.findKey=function(object,predicate){return baseFindKey(object,getIteratee(predicate,3),baseForOwn)},lodash.findLast=findLast,lodash.findLastIndex=findLastIndex,lodash.findLastKey=function(object,predicate){return baseFindKey(object,getIteratee(predicate,3),baseForOwnRight)},lodash.floor=floor,lodash.forEach=forEach,lodash.forEachRight=forEachRight,lodash.forIn=function(object,iteratee){return null==object?object:baseFor(object,getIteratee(iteratee,3),keysIn)},lodash.forInRight=function(object,iteratee){return null==object?object:baseForRight(object,getIteratee(iteratee,3),keysIn)},lodash.forOwn=function(object,iteratee){return object&&baseForOwn(object,getIteratee(iteratee,3))},lodash.forOwnRight=function(object,iteratee){return object&&baseForOwnRight(object,getIteratee(iteratee,3))},lodash.get=get,lodash.gt=gt,lodash.gte=gte,lodash.has=function(object,path){return null!=object&&hasPath(object,path,baseHas)},lodash.hasIn=hasIn,lodash.head=head,lodash.identity=identity,lodash.includes=function(collection,value,fromIndex,guard){collection=isArrayLike(collection)?collection:values(collection),fromIndex=fromIndex&&!guard?toInteger(fromIndex):0;var length=collection.length;return fromIndex<0&&(fromIndex=nativeMax(length+fromIndex,0)),isString(collection)?fromIndex<=length&&collection.indexOf(value,fromIndex)>-1:!!length&&baseIndexOf(collection,value,fromIndex)>-1},lodash.indexOf=function(array,value,fromIndex){var length=null==array?0:array.length;if(!length)return-1;var index=null==fromIndex?0:toInteger(fromIndex);return index<0&&(index=nativeMax(length+index,0)),baseIndexOf(array,value,index)},lodash.inRange=function(number,start,end){return start=toFinite(start),end===undefined?(end=start,start=0):end=toFinite(end),function(number,start,end){return number>=nativeMin(start,end)&&number<nativeMax(start,end)}(number=toNumber(number),start,end)},lodash.invoke=invoke,lodash.isArguments=isArguments,lodash.isArray=isArray,lodash.isArrayBuffer=isArrayBuffer,lodash.isArrayLike=isArrayLike,lodash.isArrayLikeObject=isArrayLikeObject,lodash.isBoolean=function(value){return!0===value||!1===value||isObjectLike(value)&&baseGetTag(value)==boolTag},lodash.isBuffer=isBuffer,lodash.isDate=isDate,lodash.isElement=function(value){return isObjectLike(value)&&1===value.nodeType&&!isPlainObject(value)},lodash.isEmpty=function(value){if(null==value)return!0;if(isArrayLike(value)&&(isArray(value)||"string"==typeof value||"function"==typeof value.splice||isBuffer(value)||isTypedArray(value)||isArguments(value)))return!value.length;var tag=getTag(value);if(tag==mapTag||tag==setTag)return!value.size;if(isPrototype(value))return!baseKeys(value).length;for(var key in value)if(hasOwnProperty.call(value,key))return!1;return!0},lodash.isEqual=function(value,other){return baseIsEqual(value,other)},lodash.isEqualWith=function(value,other,customizer){var result=(customizer="function"==typeof customizer?customizer:undefined)?customizer(value,other):undefined;return result===undefined?baseIsEqual(value,other,undefined,customizer):!!result},lodash.isError=isError,lodash.isFinite=function(value){return"number"==typeof value&&nativeIsFinite(value)},lodash.isFunction=isFunction,lodash.isInteger=isInteger,lodash.isLength=isLength,lodash.isMap=isMap,lodash.isMatch=function(object,source){return object===source||baseIsMatch(object,source,getMatchData(source))},lodash.isMatchWith=function(object,source,customizer){return customizer="function"==typeof customizer?customizer:undefined,baseIsMatch(object,source,getMatchData(source),customizer)},lodash.isNaN=function(value){return isNumber(value)&&value!=+value},lodash.isNative=function(value){if(isMaskable(value))throw new Error(CORE_ERROR_TEXT);return baseIsNative(value)},lodash.isNil=function(value){return null==value},lodash.isNull=function(value){return null===value},lodash.isNumber=isNumber,lodash.isObject=isObject,lodash.isObjectLike=isObjectLike,lodash.isPlainObject=isPlainObject,lodash.isRegExp=isRegExp,lodash.isSafeInteger=function(value){return isInteger(value)&&value>=-MAX_SAFE_INTEGER&&value<=MAX_SAFE_INTEGER},lodash.isSet=isSet,lodash.isString=isString,lodash.isSymbol=isSymbol,lodash.isTypedArray=isTypedArray,lodash.isUndefined=function(value){return value===undefined},lodash.isWeakMap=function(value){return isObjectLike(value)&&getTag(value)==weakMapTag},lodash.isWeakSet=function(value){return isObjectLike(value)&&baseGetTag(value)==weakSetTag},lodash.join=function(array,separator){return null==array?"":nativeJoin.call(array,separator)},lodash.kebabCase=kebabCase,lodash.last=last,lodash.lastIndexOf=function(array,value,fromIndex){var length=null==array?0:array.length;if(!length)return-1;var index=length;return fromIndex!==undefined&&(index=(index=toInteger(fromIndex))<0?nativeMax(length+index,0):nativeMin(index,length-1)),value==value?function(array,value,fromIndex){for(var index=fromIndex+1;index--;)if(array[index]===value)return index;return index}(array,value,index):baseFindIndex(array,baseIsNaN,index,!0)},lodash.lowerCase=lowerCase,lodash.lowerFirst=lowerFirst,lodash.lt=lt,lodash.lte=lte,lodash.max=function(array){return array&&array.length?baseExtremum(array,identity,baseGt):undefined},lodash.maxBy=function(array,iteratee){return array&&array.length?baseExtremum(array,getIteratee(iteratee,2),baseGt):undefined},lodash.mean=function(array){return baseMean(array,identity)},lodash.meanBy=function(array,iteratee){return baseMean(array,getIteratee(iteratee,2))},lodash.min=function(array){return array&&array.length?baseExtremum(array,identity,baseLt):undefined},lodash.minBy=function(array,iteratee){return array&&array.length?baseExtremum(array,getIteratee(iteratee,2),baseLt):undefined},lodash.stubArray=stubArray,lodash.stubFalse=stubFalse,lodash.stubObject=function(){return{}},lodash.stubString=function(){return""},lodash.stubTrue=function(){return!0},lodash.multiply=multiply,lodash.nth=function(array,n){return array&&array.length?baseNth(array,toInteger(n)):undefined},lodash.noConflict=function(){return root._===this&&(root._=oldDash),this},lodash.noop=noop,lodash.now=now,lodash.pad=function(string,length,chars){string=toString(string);var strLength=(length=toInteger(length))?stringSize(string):0;if(!length||strLength>=length)return string;var mid=(length-strLength)/2;return createPadding(nativeFloor(mid),chars)+string+createPadding(nativeCeil(mid),chars)},lodash.padEnd=function(string,length,chars){string=toString(string);var strLength=(length=toInteger(length))?stringSize(string):0;return length&&strLength<length?string+createPadding(length-strLength,chars):string},lodash.padStart=function(string,length,chars){string=toString(string);var strLength=(length=toInteger(length))?stringSize(string):0;return length&&strLength<length?createPadding(length-strLength,chars)+string:string},lodash.parseInt=function(string,radix,guard){return guard||null==radix?radix=0:radix&&(radix=+radix),nativeParseInt(toString(string).replace(reTrimStart,""),radix||0)},lodash.random=function(lower,upper,floating){if(floating&&"boolean"!=typeof floating&&isIterateeCall(lower,upper,floating)&&(upper=floating=undefined),floating===undefined&&("boolean"==typeof upper?(floating=upper,upper=undefined):"boolean"==typeof lower&&(floating=lower,lower=undefined)),lower===undefined&&upper===undefined?(lower=0,upper=1):(lower=toFinite(lower),upper===undefined?(upper=lower,lower=0):upper=toFinite(upper)),lower>upper){var temp=lower;lower=upper,upper=temp}if(floating||lower%1||upper%1){var rand=nativeRandom();return nativeMin(lower+rand*(upper-lower+freeParseFloat("1e-"+((rand+"").length-1))),upper)}return baseRandom(lower,upper)},lodash.reduce=function(collection,iteratee,accumulator){var func=isArray(collection)?arrayReduce:baseReduce,initAccum=arguments.length<3;return func(collection,getIteratee(iteratee,4),accumulator,initAccum,baseEach)},lodash.reduceRight=function(collection,iteratee,accumulator){var func=isArray(collection)?arrayReduceRight:baseReduce,initAccum=arguments.length<3;return func(collection,getIteratee(iteratee,4),accumulator,initAccum,baseEachRight)},lodash.repeat=function(string,n,guard){return n=(guard?isIterateeCall(string,n,guard):n===undefined)?1:toInteger(n),baseRepeat(toString(string),n)},lodash.replace=function(){var args=arguments,string=toString(args[0]);return args.length<3?string:string.replace(args[1],args[2])},lodash.result=function(object,path,defaultValue){var index=-1,length=(path=castPath(path,object)).length;for(length||(length=1,object=undefined);++index<length;){var value=null==object?undefined:object[toKey(path[index])];value===undefined&&(index=length,value=defaultValue),object=isFunction(value)?value.call(object):value}return object},lodash.round=round,lodash.runInContext=runInContext,lodash.sample=function(collection){return(isArray(collection)?arraySample:baseSample)(collection)},lodash.size=function(collection){if(null==collection)return 0;if(isArrayLike(collection))return isString(collection)?stringSize(collection):collection.length;var tag=getTag(collection);return tag==mapTag||tag==setTag?collection.size:baseKeys(collection).length},lodash.snakeCase=snakeCase,lodash.some=function(collection,predicate,guard){var func=isArray(collection)?arraySome:baseSome;return guard&&isIterateeCall(collection,predicate,guard)&&(predicate=undefined),func(collection,getIteratee(predicate,3))},lodash.sortedIndex=function(array,value){return baseSortedIndex(array,value)},lodash.sortedIndexBy=function(array,value,iteratee){return baseSortedIndexBy(array,value,getIteratee(iteratee,2))},lodash.sortedIndexOf=function(array,value){var length=null==array?0:array.length;if(length){var index=baseSortedIndex(array,value);if(index<length&&eq(array[index],value))return index}return-1},lodash.sortedLastIndex=function(array,value){return baseSortedIndex(array,value,!0)},lodash.sortedLastIndexBy=function(array,value,iteratee){return baseSortedIndexBy(array,value,getIteratee(iteratee,2),!0)},lodash.sortedLastIndexOf=function(array,value){if(null==array?0:array.length){var index=baseSortedIndex(array,value,!0)-1;if(eq(array[index],value))return index}return-1},lodash.startCase=startCase,lodash.startsWith=function(string,target,position){return string=toString(string),position=null==position?0:baseClamp(toInteger(position),0,string.length),target=baseToString(target),string.slice(position,position+target.length)==target},lodash.subtract=subtract,lodash.sum=function(array){return array&&array.length?baseSum(array,identity):0},lodash.sumBy=function(array,iteratee){return array&&array.length?baseSum(array,getIteratee(iteratee,2)):0},lodash.template=function(string,options,guard){var settings=lodash.templateSettings;guard&&isIterateeCall(string,options,guard)&&(options=undefined),string=toString(string),options=assignInWith({},options,settings,customDefaultsAssignIn);var isEscaping,isEvaluating,imports=assignInWith({},options.imports,settings.imports,customDefaultsAssignIn),importsKeys=keys(imports),importsValues=baseValues(imports,importsKeys),index=0,interpolate=options.interpolate||reNoMatch,source="__p += '",reDelimiters=RegExp((options.escape||reNoMatch).source+"|"+interpolate.source+"|"+(interpolate===reInterpolate?reEsTemplate:reNoMatch).source+"|"+(options.evaluate||reNoMatch).source+"|$","g"),sourceURL="//# sourceURL="+("sourceURL"in options?options.sourceURL:"lodash.templateSources["+ ++templateCounter+"]")+"\n";string.replace(reDelimiters,(function(match,escapeValue,interpolateValue,esTemplateValue,evaluateValue,offset){return interpolateValue||(interpolateValue=esTemplateValue),source+=string.slice(index,offset).replace(reUnescapedString,escapeStringChar),escapeValue&&(isEscaping=!0,source+="' +\n__e("+escapeValue+") +\n'"),evaluateValue&&(isEvaluating=!0,source+="';\n"+evaluateValue+";\n__p += '"),interpolateValue&&(source+="' +\n((__t = ("+interpolateValue+")) == null ? '' : __t) +\n'"),index=offset+match.length,match})),source+="';\n";var variable=options.variable;variable||(source="with (obj) {\n"+source+"\n}\n"),source=(isEvaluating?source.replace(reEmptyStringLeading,""):source).replace(reEmptyStringMiddle,"$1").replace(reEmptyStringTrailing,"$1;"),source="function("+(variable||"obj")+") {\n"+(variable?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(isEscaping?", __e = _.escape":"")+(isEvaluating?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+source+"return __p\n}";var result=attempt((function(){return Function(importsKeys,sourceURL+"return "+source).apply(undefined,importsValues)}));if(result.source=source,isError(result))throw result;return result},lodash.times=function(n,iteratee){if((n=toInteger(n))<1||n>MAX_SAFE_INTEGER)return[];var index=MAX_ARRAY_LENGTH,length=nativeMin(n,MAX_ARRAY_LENGTH);iteratee=getIteratee(iteratee),n-=MAX_ARRAY_LENGTH;for(var result=baseTimes(length,iteratee);++index<n;)iteratee(index);return result},lodash.toFinite=toFinite,lodash.toInteger=toInteger,lodash.toLength=toLength,lodash.toLower=function(value){return toString(value).toLowerCase()},lodash.toNumber=toNumber,lodash.toSafeInteger=function(value){return value?baseClamp(toInteger(value),-MAX_SAFE_INTEGER,MAX_SAFE_INTEGER):0===value?value:0},lodash.toString=toString,lodash.toUpper=function(value){return toString(value).toUpperCase()},lodash.trim=function(string,chars,guard){if((string=toString(string))&&(guard||chars===undefined))return string.replace(reTrim,"");if(!string||!(chars=baseToString(chars)))return string;var strSymbols=stringToArray(string),chrSymbols=stringToArray(chars);return castSlice(strSymbols,charsStartIndex(strSymbols,chrSymbols),charsEndIndex(strSymbols,chrSymbols)+1).join("")},lodash.trimEnd=function(string,chars,guard){if((string=toString(string))&&(guard||chars===undefined))return string.replace(reTrimEnd,"");if(!string||!(chars=baseToString(chars)))return string;var strSymbols=stringToArray(string);return castSlice(strSymbols,0,charsEndIndex(strSymbols,stringToArray(chars))+1).join("")},lodash.trimStart=function(string,chars,guard){if((string=toString(string))&&(guard||chars===undefined))return string.replace(reTrimStart,"");if(!string||!(chars=baseToString(chars)))return string;var strSymbols=stringToArray(string);return castSlice(strSymbols,charsStartIndex(strSymbols,stringToArray(chars))).join("")},lodash.truncate=function(string,options){var length=DEFAULT_TRUNC_LENGTH,omission=DEFAULT_TRUNC_OMISSION;if(isObject(options)){var separator="separator"in options?options.separator:separator;length="length"in options?toInteger(options.length):length,omission="omission"in options?baseToString(options.omission):omission}var strLength=(string=toString(string)).length;if(hasUnicode(string)){var strSymbols=stringToArray(string);strLength=strSymbols.length}if(length>=strLength)return string;var end=length-stringSize(omission);if(end<1)return omission;var result=strSymbols?castSlice(strSymbols,0,end).join(""):string.slice(0,end);if(separator===undefined)return result+omission;if(strSymbols&&(end+=result.length-end),isRegExp(separator)){if(string.slice(end).search(separator)){var match,substring=result;for(separator.global||(separator=RegExp(separator.source,toString(reFlags.exec(separator))+"g")),separator.lastIndex=0;match=separator.exec(substring);)var newEnd=match.index;result=result.slice(0,newEnd===undefined?end:newEnd)}}else if(string.indexOf(baseToString(separator),end)!=end){var index=result.lastIndexOf(separator);index>-1&&(result=result.slice(0,index))}return result+omission},lodash.unescape=function(string){return(string=toString(string))&&reHasEscapedHtml.test(string)?string.replace(reEscapedHtml,unescapeHtmlChar):string},lodash.uniqueId=function(prefix){var id=++idCounter;return toString(prefix)+id},lodash.upperCase=upperCase,lodash.upperFirst=upperFirst,lodash.each=forEach,lodash.eachRight=forEachRight,lodash.first=head,mixin(lodash,(source={},baseForOwn(lodash,(function(func,methodName){hasOwnProperty.call(lodash.prototype,methodName)||(source[methodName]=func)})),source),{chain:!1}),lodash.VERSION="4.17.11",arrayEach(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(methodName){lodash[methodName].placeholder=lodash})),arrayEach(["drop","take"],(function(methodName,index){LazyWrapper.prototype[methodName]=function(n){n=n===undefined?1:nativeMax(toInteger(n),0);var result=this.__filtered__&&!index?new LazyWrapper(this):this.clone();return result.__filtered__?result.__takeCount__=nativeMin(n,result.__takeCount__):result.__views__.push({size:nativeMin(n,MAX_ARRAY_LENGTH),type:methodName+(result.__dir__<0?"Right":"")}),result},LazyWrapper.prototype[methodName+"Right"]=function(n){return this.reverse()[methodName](n).reverse()}})),arrayEach(["filter","map","takeWhile"],(function(methodName,index){var type=index+1,isFilter=type==LAZY_FILTER_FLAG||3==type;LazyWrapper.prototype[methodName]=function(iteratee){var result=this.clone();return result.__iteratees__.push({iteratee:getIteratee(iteratee,3),type:type}),result.__filtered__=result.__filtered__||isFilter,result}})),arrayEach(["head","last"],(function(methodName,index){var takeName="take"+(index?"Right":"");LazyWrapper.prototype[methodName]=function(){return this[takeName](1).value()[0]}})),arrayEach(["initial","tail"],(function(methodName,index){var dropName="drop"+(index?"":"Right");LazyWrapper.prototype[methodName]=function(){return this.__filtered__?new LazyWrapper(this):this[dropName](1)}})),LazyWrapper.prototype.compact=function(){return this.filter(identity)},LazyWrapper.prototype.find=function(predicate){return this.filter(predicate).head()},LazyWrapper.prototype.findLast=function(predicate){return this.reverse().find(predicate)},LazyWrapper.prototype.invokeMap=baseRest((function(path,args){return"function"==typeof path?new LazyWrapper(this):this.map((function(value){return baseInvoke(value,path,args)}))})),LazyWrapper.prototype.reject=function(predicate){return this.filter(negate(getIteratee(predicate)))},LazyWrapper.prototype.slice=function(start,end){start=toInteger(start);var result=this;return result.__filtered__&&(start>0||end<0)?new LazyWrapper(result):(start<0?result=result.takeRight(-start):start&&(result=result.drop(start)),end!==undefined&&(result=(end=toInteger(end))<0?result.dropRight(-end):result.take(end-start)),result)},LazyWrapper.prototype.takeRightWhile=function(predicate){return this.reverse().takeWhile(predicate).reverse()},LazyWrapper.prototype.toArray=function(){return this.take(MAX_ARRAY_LENGTH)},baseForOwn(LazyWrapper.prototype,(function(func,methodName){var checkIteratee=/^(?:filter|find|map|reject)|While$/.test(methodName),isTaker=/^(?:head|last)$/.test(methodName),lodashFunc=lodash[isTaker?"take"+("last"==methodName?"Right":""):methodName],retUnwrapped=isTaker||/^find/.test(methodName);lodashFunc&&(lodash.prototype[methodName]=function(){var value=this.__wrapped__,args=isTaker?[1]:arguments,isLazy=value instanceof LazyWrapper,iteratee=args[0],useLazy=isLazy||isArray(value),interceptor=function(value){var result=lodashFunc.apply(lodash,arrayPush([value],args));return isTaker&&chainAll?result[0]:result};useLazy&&checkIteratee&&"function"==typeof iteratee&&1!=iteratee.length&&(isLazy=useLazy=!1);var chainAll=this.__chain__,isHybrid=!!this.__actions__.length,isUnwrapped=retUnwrapped&&!chainAll,onlyLazy=isLazy&&!isHybrid;if(!retUnwrapped&&useLazy){value=onlyLazy?value:new LazyWrapper(this);var result=func.apply(value,args);return result.__actions__.push({func:thru,args:[interceptor],thisArg:undefined}),new LodashWrapper(result,chainAll)}return isUnwrapped&&onlyLazy?func.apply(this,args):(result=this.thru(interceptor),isUnwrapped?isTaker?result.value()[0]:result.value():result)})})),arrayEach(["pop","push","shift","sort","splice","unshift"],(function(methodName){var func=arrayProto[methodName],chainName=/^(?:push|sort|unshift)$/.test(methodName)?"tap":"thru",retUnwrapped=/^(?:pop|shift)$/.test(methodName);lodash.prototype[methodName]=function(){var args=arguments;if(retUnwrapped&&!this.__chain__){var value=this.value();return func.apply(isArray(value)?value:[],args)}return this[chainName]((function(value){return func.apply(isArray(value)?value:[],args)}))}})),baseForOwn(LazyWrapper.prototype,(function(func,methodName){var lodashFunc=lodash[methodName];if(lodashFunc){var key=lodashFunc.name+"";(realNames[key]||(realNames[key]=[])).push({name:methodName,func:lodashFunc})}})),realNames[createHybrid(undefined,WRAP_BIND_KEY_FLAG).name]=[{name:"wrapper",func:undefined}],LazyWrapper.prototype.clone=function(){var result=new LazyWrapper(this.__wrapped__);return result.__actions__=copyArray(this.__actions__),result.__dir__=this.__dir__,result.__filtered__=this.__filtered__,result.__iteratees__=copyArray(this.__iteratees__),result.__takeCount__=this.__takeCount__,result.__views__=copyArray(this.__views__),result},LazyWrapper.prototype.reverse=function(){if(this.__filtered__){var result=new LazyWrapper(this);result.__dir__=-1,result.__filtered__=!0}else(result=this.clone()).__dir__*=-1;return result},LazyWrapper.prototype.value=function(){var array=this.__wrapped__.value(),dir=this.__dir__,isArr=isArray(array),isRight=dir<0,arrLength=isArr?array.length:0,view=function(start,end,transforms){var index=-1,length=transforms.length;for(;++index<length;){var data=transforms[index],size=data.size;switch(data.type){case"drop":start+=size;break;case"dropRight":end-=size;break;case"take":end=nativeMin(end,start+size);break;case"takeRight":start=nativeMax(start,end-size)}}return{start:start,end:end}}(0,arrLength,this.__views__),start=view.start,end=view.end,length=end-start,index=isRight?end:start-1,iteratees=this.__iteratees__,iterLength=iteratees.length,resIndex=0,takeCount=nativeMin(length,this.__takeCount__);if(!isArr||!isRight&&arrLength==length&&takeCount==length)return baseWrapperValue(array,this.__actions__);var result=[];outer:for(;length--&&resIndex<takeCount;){for(var iterIndex=-1,value=array[index+=dir];++iterIndex<iterLength;){var data=iteratees[iterIndex],iteratee=data.iteratee,type=data.type,computed=iteratee(value);if(type==LAZY_MAP_FLAG)value=computed;else if(!computed){if(type==LAZY_FILTER_FLAG)continue outer;break outer}}result[resIndex++]=value}return result},lodash.prototype.at=wrapperAt,lodash.prototype.chain=function(){return chain(this)},lodash.prototype.commit=function(){return new LodashWrapper(this.value(),this.__chain__)},lodash.prototype.next=function(){this.__values__===undefined&&(this.__values__=toArray(this.value()));var done=this.__index__>=this.__values__.length;return{done:done,value:done?undefined:this.__values__[this.__index__++]}},lodash.prototype.plant=function(value){for(var result,parent=this;parent instanceof baseLodash;){var clone=wrapperClone(parent);clone.__index__=0,clone.__values__=undefined,result?previous.__wrapped__=clone:result=clone;var previous=clone;parent=parent.__wrapped__}return previous.__wrapped__=value,result},lodash.prototype.reverse=function(){var value=this.__wrapped__;if(value instanceof LazyWrapper){var wrapped=value;return this.__actions__.length&&(wrapped=new LazyWrapper(this)),(wrapped=wrapped.reverse()).__actions__.push({func:thru,args:[reverse],thisArg:undefined}),new LodashWrapper(wrapped,this.__chain__)}return this.thru(reverse)},lodash.prototype.toJSON=lodash.prototype.valueOf=lodash.prototype.value=function(){return baseWrapperValue(this.__wrapped__,this.__actions__)},lodash.prototype.first=lodash.prototype.head,symIterator&&(lodash.prototype[symIterator]=function(){return this}),lodash}();"function"==typeof define&&"object"==typeof define.amd&&define.amd?(root._=_,define((function(){return _}))):freeModule?((freeModule.exports=_)._=_,freeExports._=_):root._=_}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],253:[function(require,module,exports){arguments[4][108][0].apply(exports,arguments)},{dup:108}],254:[function(require,module,exports){arguments[4][109][0].apply(exports,arguments)},{dup:109}],255:[function(require,module,exports){arguments[4][144][0].apply(exports,arguments)},{buffer:51,dup:144}],256:[function(require,module,exports){const{crypto:crypto,encoding:encoding,PrivateKey:PrivateKey}=require("bitcore-lib-p256"),{getPublicKeyFromPrivateKey:getPublicKeyFromPrivateKey}=require("./Api"),{Buffer:Buffer}=require("buffer"),{compress:compress}=require("./Utils"),{BN:BN,Hash:Hash}=crypto,{Base58Check:Base58Check}=encoding,signTypeMap={ELA_STANDARD:{type:172,address:33},ELA_MULTISIG:{type:174,address:18},ELA_CROSSCHAIN:{type:175,address:72},ELA_IDCHAIN:{type:173,address:103},ELA_DESTROY:{type:170,address:0}},sortBigNumber=(a,b)=>{const bBigInt=BN.fromBuffer(Buffer.from(a,"hex").slice(1)),aBigInt=BN.fromBuffer(Buffer.from(b,"hex").slice(1));return bBigInt.gt(aBigInt)},toCode=(pubKeyBuf,signType)=>Buffer.concat([Buffer.from([33]),pubKeyBuf,Buffer.from([signType])]),getAddressBase=(pubKey,signType)=>{const pubKeyBuf=new Buffer(pubKey,"hex"),code=toCode(pubKeyBuf,signTypeMap[signType].type),hashBuf=Hash.sha256ripemd160(code),programHashBuf=Buffer.concat([Buffer.from([signTypeMap[signType].address]),hashBuf]);return Base58Check.encode(programHashBuf)},getAddress=pubKey=>getAddressBase(pubKey,"ELA_STANDARD");module.exports={toCode:toCode,getAddress:getAddress,getAddressFromPrivateKey:prvKey=>{const prvKeyBuf=Buffer.from(prvKey,"hex"),pubKeyObj=getPublicKeyFromPrivateKey(prvKeyBuf);return getAddress(compress(pubKeyObj))},getDid:pubKey=>getAddressBase(pubKey,"ELA_IDCHAIN"),getMultiSignAddress:(pubKeys,requiredCount)=>{const keysCount=pubKeys.length,sortedPubKeys=pubKeys.sort(sortBigNumber);let buf=Buffer.from([81+requiredCount-1]);sortedPubKeys.forEach(pub=>{const pubInHex=Buffer.from(pub,"hex");buf=Buffer.concat([buf,Buffer.from([pubInHex.length]),pubInHex])}),buf=Buffer.concat([buf,Buffer.from([81+keysCount-1,174])]);const hashBuf=Hash.sha256ripemd160(buf),programHashBuf=Buffer.concat([Buffer.from([18]),hashBuf]);return Base58Check.encode(programHashBuf)}}},{"./Api":257,"./Utils":258,"bitcore-lib-p256":169,buffer:51}],257:[function(require,module,exports){const{HDPrivateKey:HDPrivateKey,HDPublicKey:HDPublicKey,PublicKey:PublicKey,PrivateKey:PrivateKey,crypto:crypto}=require("bitcore-lib-p256"),{Buffer:Buffer}=require("buffer"),{ecdsa:ecdsa,hash:hash}=crypto,rs=require("jsrsasign"),{uncompress:uncompress}=require("./Utils"),getRootMultiWallet=(seed,coinType=2305)=>{const prvKey=HDPrivateKey.fromSeed(seed);return new HDPrivateKey(prvKey.xprivkey).deriveChild(44,!0).deriveChild(coinType,!0).deriveChild(0,!0)},getAccountExtendedMultiWallet=(seed,coinType=2305,account=0)=>{const prvKey=HDPrivateKey.fromSeed(seed);return new HDPrivateKey(prvKey.xprivkey).deriveChild(44,!0).deriveChild(coinType,!0).deriveChild(account,!0)},getBip32RootMultiWallet=(seed,coinType=2305,account=0,changeChain=0)=>{const prvKey=HDPrivateKey.fromSeed(seed);return new HDPrivateKey(prvKey.xprivkey).deriveChild(44,!0).deriveChild(coinType,!0).deriveChild(account,!0).deriveChild(changeChain,!1)},getDidWallet=(seed,index)=>{const prvKey=HDPrivateKey.fromSeed(seed);return new HDPrivateKey(prvKey.xprivkey).deriveChild(0,!0).deriveChild(0,!1).deriveChild(index,!1)},getSingleWallet=seed=>getMultiWallet(seed,2305,0,0,0),getMultiWallet=(seed,coinType,account,changeChain,index)=>{const prvKey=HDPrivateKey.fromSeed(seed);return new HDPrivateKey(prvKey.xprivkey).deriveChild(44,!0).deriveChild(coinType||2305,!0).deriveChild(account,!0).deriveChild(changeChain||0,!1).deriveChild(index||0,!1)};module.exports={getMasterPrivateKey:(seed,coinType=2305)=>getRootMultiWallet(seed,coinType).xprivkey,getMasterPublicKey:(seed,coinType=2305)=>getRootMultiWallet(seed,coinType).xpubkey,getBip32ExtendedPrivateKey:(seed,coinType=2305,account=0,changeChain=0)=>getBip32RootMultiWallet(seed,coinType,account,changeChain).xprivkey,getBip32ExtendedPublicKey:(seed,coinType=2305,account=0,changeChain=0)=>getBip32RootMultiWallet(seed,coinType,account,changeChain).xpubkey,getAccountExtendedPrivateKey:(seed,coinType=2305,account=0)=>getAccountExtendedMultiWallet(seed,coinType,account).xprivkey,getAccountExtendedPublicKey:(seed,coinType=2305,account=0)=>getAccountExtendedMultiWallet(seed,coinType,account).xpubkey,getDerivedPrivateKey:(seed,coinType,account,changeChain,index)=>getMultiWallet(seed,coinType,account,changeChain,index).privateKey,getDerivedPublicKey:(masterPublicKey,changeChain,index)=>{return new HDPublicKey(masterPublicKey).deriveChild(changeChain||0).deriveChild(index).publicKey},getRootPrivateKey:(seed,coinType=2305)=>{return HDPrivateKey.fromSeed(seed).xprivkey},getSinglePrivateKey:seed=>getSingleWallet(seed).privateKey,getSinglePublicKey:seed=>getSingleWallet(seed).publicKey,getPublicKeyFromPrivateKey:prvKey=>PrivateKey.fromBuffer(prvKey).publicKey,generateSubPrivateKey:(seed,coinType,changeChain,index)=>getMultiWallet(seed,coinType,0,changeChain,index).privateKey,generateSubPublicKey:(masterPublicKey,changeChain,index)=>{return new HDPublicKey(masterPublicKey).deriveChild(changeChain||0).deriveChild(index).publicKey},getIdChainMasterPublicKey:seed=>{const prvKey=HDPrivateKey.fromSeed(seed);return new HDPrivateKey(prvKey.xprivkey).deriveChild(0,!0).publicKey},generateIdChainSubPrivateKey:(seed,index)=>getDidWallet(seed,index).privateKey,generateIdChainSubPublicKey:(masterPublicKey,index)=>getDidWallet(seed,index).publicKey,sign:(data,prvKey,hex=!1)=>{hex||(data=Buffer.from(data,"utf8").toString("hex"));var signer=new rs.KJUR.crypto.Signature({alg:"SHA256withECDSA"});signer.init({d:prvKey,curve:"secp256r1"}),signer.updateHex(data);var signature=signer.sign();return rs.ECDSA.asn1SigToConcatSig(signature)},verify:(data,signature,pubKey,hex=!1)=>{hex||(data=Buffer.from(data,"utf8").toString("hex"));const pubKeyObj=PublicKey.fromString(pubKey),signer=new rs.KJUR.crypto.Signature({alg:"SHA256withECDSA"});return signer.init({xy:uncompress(pubKeyObj).toString("hex"),curve:"secp256r1"}),signer.updateHex(data),signer.verify(rs.ECDSA.concatSigToASN1Sig(signature))}}},{"./Utils":258,"bitcore-lib-p256":169,buffer:51,jsrsasign:251}],258:[function(require,module,exports){(function(Buffer){module.exports={compress:key=>{if(key.compressed)throw new Error("Publick key is already compressed.");const x=key.point.getX(),y=key.point.getY(),xbuf=x.toBuffer({size:32}),ybuf=y.toBuffer({size:32});let prefix;const odd=ybuf[ybuf.length-1]%2;return prefix=new Buffer(odd?[3]:[2]),Buffer.concat([prefix,xbuf])},uncompress:key=>{if(!key.compressed)throw new Error("Publick key is not compressed.");const x=key.point.getX(),y=key.point.getY(),xbuf=x.toBuffer({size:32}),ybuf=y.toBuffer({size:32});return Buffer.concat([Buffer.from([4]),xbuf,ybuf])},reverseByteBuffer:buffer=>{for(var i=0,j=buffer.length-1;i<j;++i,--j){var t=buffer[j];buffer[j]=buffer[i],buffer[i]=t}return buffer}}}).call(this,require("buffer").Buffer)},{buffer:51}]},{},[167])(167)}));