ng-auth-oidc
Version:
OAuth2 Implicit Flow with OpenID Connect (e.g. identity-server4) implemented with Angular Elements
37 lines • 340 kB
JavaScript
var Oidc=function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return t[r].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){n(1),t.exports=n(327)},function(t,e,n){(function(t){"use strict";function e(t,e,n){t[e]||Object[r](t,e,{writable:!0,configurable:!0,value:n})}if(n(2),n(323),n(324),t._babelPolyfill)throw new Error("only one instance of babel-polyfill is allowed");t._babelPolyfill=!0;var r="defineProperty";e(String.prototype,"padLeft","".padStart),e(String.prototype,"padRight","".padEnd),"pop,reverse,shift,keys,values,entries,indexOf,every,some,forEach,map,filter,find,findIndex,includes,join,slice,concat,push,splice,unshift,sort,lastIndexOf,reduce,reduceRight,copyWithin,fill".split(",").forEach(function(t){[][t]&&e(Array,t,Function.call.bind([][t]))})}).call(e,function(){return this}())},function(t,e,n){n(3),n(51),n(52),n(53),n(54),n(56),n(59),n(60),n(61),n(62),n(63),n(64),n(65),n(66),n(67),n(69),n(71),n(73),n(75),n(78),n(79),n(80),n(84),n(86),n(88),n(91),n(92),n(93),n(94),n(96),n(97),n(98),n(99),n(100),n(101),n(102),n(104),n(105),n(106),n(108),n(109),n(110),n(112),n(114),n(115),n(116),n(117),n(118),n(119),n(120),n(121),n(122),n(123),n(124),n(125),n(126),n(131),n(132),n(136),n(137),n(138),n(139),n(141),n(142),n(143),n(144),n(145),n(146),n(147),n(148),n(149),n(150),n(151),n(152),n(153),n(154),n(155),n(157),n(158),n(160),n(161),n(167),n(168),n(170),n(171),n(172),n(176),n(177),n(178),n(179),n(180),n(182),n(183),n(184),n(185),n(188),n(190),n(191),n(192),n(194),n(196),n(198),n(199),n(200),n(202),n(203),n(204),n(205),n(215),n(219),n(220),n(222),n(223),n(227),n(228),n(230),n(231),n(232),n(233),n(234),n(235),n(236),n(237),n(238),n(239),n(240),n(241),n(242),n(243),n(244),n(245),n(246),n(247),n(248),n(250),n(251),n(252),n(253),n(254),n(256),n(257),n(258),n(261),n(262),n(263),n(264),n(265),n(266),n(267),n(268),n(270),n(271),n(273),n(274),n(275),n(276),n(279),n(280),n(282),n(283),n(284),n(285),n(287),n(288),n(289),n(290),n(291),n(292),n(293),n(294),n(295),n(296),n(298),n(299),n(300),n(301),n(302),n(303),n(304),n(305),n(306),n(307),n(308),n(310),n(311),n(312),n(313),n(314),n(315),n(316),n(317),n(318),n(319),n(320),n(321),n(322),t.exports=n(9)},function(t,e,n){"use strict";var r=n(4),i=n(5),o=n(6),s=n(8),a=n(18),u=n(22).KEY,c=n(7),f=n(23),h=n(24),l=n(19),p=n(25),d=n(26),g=n(27),v=n(29),y=n(44),m=n(12),S=n(13),b=n(32),F=n(16),w=n(17),_=n(45),x=n(48),E=n(50),A=n(11),P=n(30),C=E.f,k=A.f,T=x.f,R=r.Symbol,I=r.JSON,D=I&&I.stringify,N="prototype",O=p("_hidden"),j=p("toPrimitive"),L={}.propertyIsEnumerable,M=f("symbol-registry"),B=f("symbols"),H=f("op-symbols"),U=Object[N],V="function"==typeof R,K=r.QObject,q=!K||!K[N]||!K[N].findChild,W=o&&c(function(){return 7!=_(k({},"a",{get:function(){return k(this,"a",{value:7}).a}})).a})?function(t,e,n){var r=C(U,e);r&&delete U[e],k(t,e,n),r&&t!==U&&k(U,e,r)}:k,J=function(t){var e=B[t]=_(R[N]);return e._k=t,e},G=V&&"symbol"==typeof R.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof R},z=function(t,e,n){return t===U&&z(H,e,n),m(t),e=F(e,!0),m(n),i(B,e)?(n.enumerable?(i(t,O)&&t[O][e]&&(t[O][e]=!1),n=_(n,{enumerable:w(0,!1)})):(i(t,O)||k(t,O,w(1,{})),t[O][e]=!0),W(t,e,n)):k(t,e,n)},Y=function(t,e){m(t);for(var n,r=v(e=b(e)),i=0,o=r.length;o>i;)z(t,n=r[i++],e[n]);return t},$=function(t,e){return void 0===e?_(t):Y(_(t),e)},X=function(t){var e=L.call(this,t=F(t,!0));return!(this===U&&i(B,t)&&!i(H,t))&&(!(e||!i(this,t)||!i(B,t)||i(this,O)&&this[O][t])||e)},Z=function(t,e){if(t=b(t),e=F(e,!0),t!==U||!i(B,e)||i(H,e)){var n=C(t,e);return!n||!i(B,e)||i(t,O)&&t[O][e]||(n.enumerable=!0),n}},Q=function(t){for(var e,n=T(b(t)),r=[],o=0;n.length>o;)i(B,e=n[o++])||e==O||e==u||r.push(e);return r},tt=function(t){for(var e,n=t===U,r=T(n?H:b(t)),o=[],s=0;r.length>s;)!i(B,e=r[s++])||n&&!i(U,e)||o.push(B[e]);return o};V||(R=function(){if(this instanceof R)throw TypeError("Symbol is not a constructor!");var t=l(arguments.length>0?arguments[0]:void 0),e=function(n){this===U&&e.call(H,n),i(this,O)&&i(this[O],t)&&(this[O][t]=!1),W(this,t,w(1,n))};return o&&q&&W(U,t,{configurable:!0,set:e}),J(t)},a(R[N],"toString",function(){return this._k}),E.f=Z,A.f=z,n(49).f=x.f=Q,n(43).f=X,n(42).f=tt,o&&!n(28)&&a(U,"propertyIsEnumerable",X,!0),d.f=function(t){return J(p(t))}),s(s.G+s.W+s.F*!V,{Symbol:R});for(var et="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),nt=0;et.length>nt;)p(et[nt++]);for(var rt=P(p.store),it=0;rt.length>it;)g(rt[it++]);s(s.S+s.F*!V,"Symbol",{for:function(t){return i(M,t+="")?M[t]:M[t]=R(t)},keyFor:function(t){if(!G(t))throw TypeError(t+" is not a symbol!");for(var e in M)if(M[e]===t)return e},useSetter:function(){q=!0},useSimple:function(){q=!1}}),s(s.S+s.F*!V,"Object",{create:$,defineProperty:z,defineProperties:Y,getOwnPropertyDescriptor:Z,getOwnPropertyNames:Q,getOwnPropertySymbols:tt}),I&&s(s.S+s.F*(!V||c(function(){var t=R();return"[null]"!=D([t])||"{}"!=D({a:t})||"{}"!=D(Object(t))})),"JSON",{stringify:function(t){for(var e,n,r=[t],i=1;arguments.length>i;)r.push(arguments[i++]);if(n=e=r[1],(S(e)||void 0!==t)&&!G(t))return y(e)||(e=function(t,e){if("function"==typeof n&&(e=n.call(this,t,e)),!G(e))return e}),r[1]=e,D.apply(I,r)}}),R[N][j]||n(10)(R[N],j,R[N].valueOf),h(R,"Symbol"),h(Math,"Math",!0),h(r.JSON,"JSON",!0)},function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e,n){t.exports=!n(7)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e,n){var r=n(4),i=n(9),o=n(10),s=n(18),a=n(20),u="prototype",c=function(t,e,n){var f,h,l,p,d=t&c.F,g=t&c.G,v=t&c.S,y=t&c.P,m=t&c.B,S=g?r:v?r[e]||(r[e]={}):(r[e]||{})[u],b=g?i:i[e]||(i[e]={}),F=b[u]||(b[u]={});g&&(n=e);for(f in n)h=!d&&S&&void 0!==S[f],l=(h?S:n)[f],p=m&&h?a(l,r):y&&"function"==typeof l?a(Function.call,l):l,S&&s(S,f,l,t&c.U),b[f]!=l&&o(b,f,p),y&&F[f]!=l&&(F[f]=l)};r.core=i,c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,t.exports=c},function(t,e){var n=t.exports={version:"2.5.5"};"number"==typeof __e&&(__e=n)},function(t,e,n){var r=n(11),i=n(17);t.exports=n(6)?function(t,e,n){return r.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e,n){var r=n(12),i=n(14),o=n(16),s=Object.defineProperty;e.f=n(6)?Object.defineProperty:function(t,e,n){if(r(t),e=o(e,!0),r(n),i)try{return s(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},function(t,e,n){var r=n(13);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,n){t.exports=!n(6)&&!n(7)(function(){return 7!=Object.defineProperty(n(15)("div"),"a",{get:function(){return 7}}).a})},function(t,e,n){var r=n(13),i=n(4).document,o=r(i)&&r(i.createElement);t.exports=function(t){return o?i.createElement(t):{}}},function(t,e,n){var r=n(13);t.exports=function(t,e){if(!r(t))return t;var n,i;if(e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;if("function"==typeof(n=t.valueOf)&&!r(i=n.call(t)))return i;if(!e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;throw TypeError("Can't convert object to primitive value")}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e,n){var r=n(4),i=n(10),o=n(5),s=n(19)("src"),a="toString",u=Function[a],c=(""+u).split(a);n(9).inspectSource=function(t){return u.call(t)},(t.exports=function(t,e,n,a){var u="function"==typeof n;u&&(o(n,"name")||i(n,"name",e)),t[e]!==n&&(u&&(o(n,s)||i(n,s,t[e]?""+t[e]:c.join(String(e)))),t===r?t[e]=n:a?t[e]?t[e]=n:i(t,e,n):(delete t[e],i(t,e,n)))})(Function.prototype,a,function(){return"function"==typeof this&&this[s]||u.call(this)})},function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+r).toString(36))}},function(t,e,n){var r=n(21);t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,i){return t.call(e,n,r,i)}}return function(){return t.apply(e,arguments)}}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e,n){var r=n(19)("meta"),i=n(13),o=n(5),s=n(11).f,a=0,u=Object.isExtensible||function(){return!0},c=!n(7)(function(){return u(Object.preventExtensions({}))}),f=function(t){s(t,r,{value:{i:"O"+ ++a,w:{}}})},h=function(t,e){if(!i(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!o(t,r)){if(!u(t))return"F";if(!e)return"E";f(t)}return t[r].i},l=function(t,e){if(!o(t,r)){if(!u(t))return!0;if(!e)return!1;f(t)}return t[r].w},p=function(t){return c&&d.NEED&&u(t)&&!o(t,r)&&f(t),t},d=t.exports={KEY:r,NEED:!1,fastKey:h,getWeak:l,onFreeze:p}},function(t,e,n){var r=n(4),i="__core-js_shared__",o=r[i]||(r[i]={});t.exports=function(t){return o[t]||(o[t]={})}},function(t,e,n){var r=n(11).f,i=n(5),o=n(25)("toStringTag");t.exports=function(t,e,n){t&&!i(t=n?t:t.prototype,o)&&r(t,o,{configurable:!0,value:e})}},function(t,e,n){var r=n(23)("wks"),i=n(19),o=n(4).Symbol,s="function"==typeof o,a=t.exports=function(t){return r[t]||(r[t]=s&&o[t]||(s?o:i)("Symbol."+t))};a.store=r},function(t,e,n){e.f=n(25)},function(t,e,n){var r=n(4),i=n(9),o=n(28),s=n(26),a=n(11).f;t.exports=function(t){var e=i.Symbol||(i.Symbol=o?{}:r.Symbol||{});"_"==t.charAt(0)||t in e||a(e,t,{value:s.f(t)})}},function(t,e){t.exports=!1},function(t,e,n){var r=n(30),i=n(42),o=n(43);t.exports=function(t){var e=r(t),n=i.f;if(n)for(var s,a=n(t),u=o.f,c=0;a.length>c;)u.call(t,s=a[c++])&&e.push(s);return e}},function(t,e,n){var r=n(31),i=n(41);t.exports=Object.keys||function(t){return r(t,i)}},function(t,e,n){var r=n(5),i=n(32),o=n(36)(!1),s=n(40)("IE_PROTO");t.exports=function(t,e){var n,a=i(t),u=0,c=[];for(n in a)n!=s&&r(a,n)&&c.push(n);for(;e.length>u;)r(a,n=e[u++])&&(~o(c,n)||c.push(n));return c}},function(t,e,n){var r=n(33),i=n(35);t.exports=function(t){return r(i(t))}},function(t,e,n){var r=n(34);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,e,n){var r=n(32),i=n(37),o=n(39);t.exports=function(t){return function(e,n,s){var a,u=r(e),c=i(u.length),f=o(s,c);if(t&&n!=n){for(;c>f;)if(a=u[f++],a!=a)return!0}else for(;c>f;f++)if((t||f in u)&&u[f]===n)return t||f||0;return!t&&-1}}},function(t,e,n){var r=n(38),i=Math.min;t.exports=function(t){return t>0?i(r(t),9007199254740991):0}},function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:n)(t)}},function(t,e,n){var r=n(38),i=Math.max,o=Math.min;t.exports=function(t,e){return t=r(t),t<0?i(t+e,0):o(t,e)}},function(t,e,n){var r=n(23)("keys"),i=n(19);t.exports=function(t){return r[t]||(r[t]=i(t))}},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e){e.f=Object.getOwnPropertySymbols},function(t,e){e.f={}.propertyIsEnumerable},function(t,e,n){var r=n(34);t.exports=Array.isArray||function(t){return"Array"==r(t)}},function(t,e,n){var r=n(12),i=n(46),o=n(41),s=n(40)("IE_PROTO"),a=function(){},u="prototype",c=function(){var t,e=n(15)("iframe"),r=o.length,i="<",s=">";for(e.style.display="none",n(47).appendChild(e),e.src="javascript:",t=e.contentWindow.document,t.open(),t.write(i+"script"+s+"document.F=Object"+i+"/script"+s),t.close(),c=t.F;r--;)delete c[u][o[r]];return c()};t.exports=Object.create||function(t,e){var n;return null!==t?(a[u]=r(t),n=new a,a[u]=null,n[s]=t):n=c(),void 0===e?n:i(n,e)}},function(t,e,n){var r=n(11),i=n(12),o=n(30);t.exports=n(6)?Object.defineProperties:function(t,e){i(t);for(var n,s=o(e),a=s.length,u=0;a>u;)r.f(t,n=s[u++],e[n]);return t}},function(t,e,n){var r=n(4).document;t.exports=r&&r.documentElement},function(t,e,n){var r=n(32),i=n(49).f,o={}.toString,s="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],a=function(t){try{return i(t)}catch(t){return s.slice()}};t.exports.f=function(t){return s&&"[object Window]"==o.call(t)?a(t):i(r(t))}},function(t,e,n){var r=n(31),i=n(41).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,i)}},function(t,e,n){var r=n(43),i=n(17),o=n(32),s=n(16),a=n(5),u=n(14),c=Object.getOwnPropertyDescriptor;e.f=n(6)?c:function(t,e){if(t=o(t),e=s(e,!0),u)try{return c(t,e)}catch(t){}if(a(t,e))return i(!r.f.call(t,e),t[e])}},function(t,e,n){var r=n(8);r(r.S,"Object",{create:n(45)})},function(t,e,n){var r=n(8);r(r.S+r.F*!n(6),"Object",{defineProperty:n(11).f})},function(t,e,n){var r=n(8);r(r.S+r.F*!n(6),"Object",{defineProperties:n(46)})},function(t,e,n){var r=n(32),i=n(50).f;n(55)("getOwnPropertyDescriptor",function(){return function(t,e){return i(r(t),e)}})},function(t,e,n){var r=n(8),i=n(9),o=n(7);t.exports=function(t,e){var n=(i.Object||{})[t]||Object[t],s={};s[t]=e(n),r(r.S+r.F*o(function(){n(1)}),"Object",s)}},function(t,e,n){var r=n(57),i=n(58);n(55)("getPrototypeOf",function(){return function(t){return i(r(t))}})},function(t,e,n){var r=n(35);t.exports=function(t){return Object(r(t))}},function(t,e,n){var r=n(5),i=n(57),o=n(40)("IE_PROTO"),s=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=i(t),r(t,o)?t[o]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?s:null}},function(t,e,n){var r=n(57),i=n(30);n(55)("keys",function(){return function(t){return i(r(t))}})},function(t,e,n){n(55)("getOwnPropertyNames",function(){return n(48).f})},function(t,e,n){var r=n(13),i=n(22).onFreeze;n(55)("freeze",function(t){return function(e){return t&&r(e)?t(i(e)):e}})},function(t,e,n){var r=n(13),i=n(22).onFreeze;n(55)("seal",function(t){return function(e){return t&&r(e)?t(i(e)):e}})},function(t,e,n){var r=n(13),i=n(22).onFreeze;n(55)("preventExtensions",function(t){return function(e){return t&&r(e)?t(i(e)):e}})},function(t,e,n){var r=n(13);n(55)("isFrozen",function(t){return function(e){return!r(e)||!!t&&t(e)}})},function(t,e,n){var r=n(13);n(55)("isSealed",function(t){return function(e){return!r(e)||!!t&&t(e)}})},function(t,e,n){var r=n(13);n(55)("isExtensible",function(t){return function(e){return!!r(e)&&(!t||t(e))}})},function(t,e,n){var r=n(8);r(r.S+r.F,"Object",{assign:n(68)})},function(t,e,n){"use strict";var r=n(30),i=n(42),o=n(43),s=n(57),a=n(33),u=Object.assign;t.exports=!u||n(7)(function(){var t={},e={},n=Symbol(),r="abcdefghijklmnopqrst";return t[n]=7,r.split("").forEach(function(t){e[t]=t}),7!=u({},t)[n]||Object.keys(u({},e)).join("")!=r})?function(t,e){for(var n=s(t),u=arguments.length,c=1,f=i.f,h=o.f;u>c;)for(var l,p=a(arguments[c++]),d=f?r(p).concat(f(p)):r(p),g=d.length,v=0;g>v;)h.call(p,l=d[v++])&&(n[l]=p[l]);return n}:u},function(t,e,n){var r=n(8);r(r.S,"Object",{is:n(70)})},function(t,e){t.exports=Object.is||function(t,e){return t===e?0!==t||1/t===1/e:t!=t&&e!=e}},function(t,e,n){var r=n(8);r(r.S,"Object",{setPrototypeOf:n(72).set})},function(t,e,n){var r=n(13),i=n(12),o=function(t,e){if(i(t),!r(e)&&null!==e)throw TypeError(e+": can't set as prototype!")};t.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(t,e,r){try{r=n(20)(Function.call,n(50).f(Object.prototype,"__proto__").set,2),r(t,[]),e=!(t instanceof Array)}catch(t){e=!0}return function(t,n){return o(t,n),e?t.__proto__=n:r(t,n),t}}({},!1):void 0),check:o}},function(t,e,n){"use strict";var r=n(74),i={};i[n(25)("toStringTag")]="z",i+""!="[object z]"&&n(18)(Object.prototype,"toString",function(){return"[object "+r(this)+"]"},!0)},function(t,e,n){var r=n(34),i=n(25)("toStringTag"),o="Arguments"==r(function(){return arguments}()),s=function(t,e){try{return t[e]}catch(t){}};t.exports=function(t){var e,n,a;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=s(e=Object(t),i))?n:o?r(e):"Object"==(a=r(e))&&"function"==typeof e.callee?"Arguments":a}},function(t,e,n){var r=n(8);r(r.P,"Function",{bind:n(76)})},function(t,e,n){"use strict";var r=n(21),i=n(13),o=n(77),s=[].slice,a={},u=function(t,e,n){if(!(e in a)){for(var r=[],i=0;i<e;i++)r[i]="a["+i+"]";a[e]=Function("F,a","return new F("+r.join(",")+")")}return a[e](t,n)};t.exports=Function.bind||function(t){var e=r(this),n=s.call(arguments,1),a=function(){var r=n.concat(s.call(arguments));return this instanceof a?u(e,r.length,r):o(e,r,t)};return i(e.prototype)&&(a.prototype=e.prototype),a}},function(t,e){t.exports=function(t,e,n){var r=void 0===n;switch(e.length){case 0:return r?t():t.call(n);case 1:return r?t(e[0]):t.call(n,e[0]);case 2:return r?t(e[0],e[1]):t.call(n,e[0],e[1]);case 3:return r?t(e[0],e[1],e[2]):t.call(n,e[0],e[1],e[2]);case 4:return r?t(e[0],e[1],e[2],e[3]):t.call(n,e[0],e[1],e[2],e[3])}return t.apply(n,e)}},function(t,e,n){var r=n(11).f,i=Function.prototype,o=/^\s*function ([^ (]*)/,s="name";s in i||n(6)&&r(i,s,{configurable:!0,get:function(){try{return(""+this).match(o)[1]}catch(t){return""}}})},function(t,e,n){"use strict";var r=n(13),i=n(58),o=n(25)("hasInstance"),s=Function.prototype;o in s||n(11).f(s,o,{value:function(t){if("function"!=typeof this||!r(t))return!1;if(!r(this.prototype))return t instanceof this;for(;t=i(t);)if(this.prototype===t)return!0;return!1}})},function(t,e,n){var r=n(8),i=n(81);r(r.G+r.F*(parseInt!=i),{parseInt:i})},function(t,e,n){var r=n(4).parseInt,i=n(82).trim,o=n(83),s=/^[-+]?0[xX]/;t.exports=8!==r(o+"08")||22!==r(o+"0x16")?function(t,e){var n=i(String(t),3);return r(n,e>>>0||(s.test(n)?16:10))}:r},function(t,e,n){var r=n(8),i=n(35),o=n(7),s=n(83),a="["+s+"]",u="
",c=RegExp("^"+a+a+"*"),f=RegExp(a+a+"*$"),h=function(t,e,n){var i={},a=o(function(){return!!s[t]()||u[t]()!=u}),c=i[t]=a?e(l):s[t];n&&(i[n]=c),r(r.P+r.F*a,"String",i)},l=h.trim=function(t,e){return t=String(i(t)),1&e&&(t=t.replace(c,"")),2&e&&(t=t.replace(f,"")),t};t.exports=h},function(t,e){t.exports="\t\n\v\f\r \u2028\u2029\ufeff"},function(t,e,n){var r=n(8),i=n(85);r(r.G+r.F*(parseFloat!=i),{parseFloat:i})},function(t,e,n){var r=n(4).parseFloat,i=n(82).trim;t.exports=1/r(n(83)+"-0")!==-(1/0)?function(t){var e=i(String(t),3),n=r(e);return 0===n&&"-"==e.charAt(0)?-0:n}:r},function(t,e,n){"use strict";var r=n(4),i=n(5),o=n(34),s=n(87),a=n(16),u=n(7),c=n(49).f,f=n(50).f,h=n(11).f,l=n(82).trim,p="Number",d=r[p],g=d,v=d.prototype,y=o(n(45)(v))==p,m="trim"in String.prototype,S=function(t){var e=a(t,!1);if("string"==typeof e&&e.length>2){e=m?e.trim():l(e,3);var n,r,i,o=e.charCodeAt(0);if(43===o||45===o){if(n=e.charCodeAt(2),88===n||120===n)return NaN}else if(48===o){switch(e.charCodeAt(1)){case 66:case 98:r=2,i=49;break;case 79:case 111:r=8,i=55;break;default:return+e}for(var s,u=e.slice(2),c=0,f=u.length;c<f;c++)if(s=u.charCodeAt(c),s<48||s>i)return NaN;return parseInt(u,r)}}return+e};if(!d(" 0o1")||!d("0b1")||d("+0x1")){d=function(t){var e=arguments.length<1?0:t,n=this;return n instanceof d&&(y?u(function(){v.valueOf.call(n)}):o(n)!=p)?s(new g(S(e)),n,d):S(e)};for(var b,F=n(6)?c(g):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),w=0;F.length>w;w++)i(g,b=F[w])&&!i(d,b)&&h(d,b,f(g,b));d.prototype=v,v.constructor=d,n(18)(r,p,d)}},function(t,e,n){var r=n(13),i=n(72).set;t.exports=function(t,e,n){var o,s=e.constructor;return s!==n&&"function"==typeof s&&(o=s.prototype)!==n.prototype&&r(o)&&i&&i(t,o),t}},function(t,e,n){"use strict";var r=n(8),i=n(38),o=n(89),s=n(90),a=1..toFixed,u=Math.floor,c=[0,0,0,0,0,0],f="Number.toFixed: incorrect invocation!",h="0",l=function(t,e){for(var n=-1,r=e;++n<6;)r+=t*c[n],c[n]=r%1e7,r=u(r/1e7)},p=function(t){for(var e=6,n=0;--e>=0;)n+=c[e],c[e]=u(n/t),n=n%t*1e7},d=function(){for(var t=6,e="";--t>=0;)if(""!==e||0===t||0!==c[t]){var n=String(c[t]);e=""===e?n:e+s.call(h,7-n.length)+n}return e},g=function(t,e,n){return 0===e?n:e%2===1?g(t,e-1,n*t):g(t*t,e/2,n)},v=function(t){for(var e=0,n=t;n>=4096;)e+=12,n/=4096;for(;n>=2;)e+=1,n/=2;return e};r(r.P+r.F*(!!a&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==(0xde0b6b3a7640080).toFixed(0))||!n(7)(function(){a.call({})})),"Number",{toFixed:function(t){var e,n,r,a,u=o(this,f),c=i(t),y="",m=h;if(c<0||c>20)throw RangeError(f);if(u!=u)return"NaN";if(u<=-1e21||u>=1e21)return String(u);if(u<0&&(y="-",u=-u),u>1e-21)if(e=v(u*g(2,69,1))-69,n=e<0?u*g(2,-e,1):u/g(2,e,1),n*=4503599627370496,e=52-e,e>0){for(l(0,n),r=c;r>=7;)l(1e7,0),r-=7;for(l(g(10,r,1),0),r=e-1;r>=23;)p(1<<23),r-=23;p(1<<r),l(1,1),p(2),m=d()}else l(0,n),l(1<<-e,0),m=d()+s.call(h,c);return c>0?(a=m.length,m=y+(a<=c?"0."+s.call(h,c-a)+m:m.slice(0,a-c)+"."+m.slice(a-c))):m=y+m,m}})},function(t,e,n){var r=n(34);t.exports=function(t,e){if("number"!=typeof t&&"Number"!=r(t))throw TypeError(e);return+t}},function(t,e,n){"use strict";var r=n(38),i=n(35);t.exports=function(t){var e=String(i(this)),n="",o=r(t);if(o<0||o==1/0)throw RangeError("Count can't be negative");for(;o>0;(o>>>=1)&&(e+=e))1&o&&(n+=e);return n}},function(t,e,n){"use strict";var r=n(8),i=n(7),o=n(89),s=1..toPrecision;r(r.P+r.F*(i(function(){return"1"!==s.call(1,void 0)})||!i(function(){s.call({})})),"Number",{toPrecision:function(t){var e=o(this,"Number#toPrecision: incorrect invocation!");return void 0===t?s.call(e):s.call(e,t)}})},function(t,e,n){var r=n(8);r(r.S,"Number",{EPSILON:Math.pow(2,-52)})},function(t,e,n){var r=n(8),i=n(4).isFinite;r(r.S,"Number",{isFinite:function(t){return"number"==typeof t&&i(t)}})},function(t,e,n){var r=n(8);r(r.S,"Number",{isInteger:n(95)})},function(t,e,n){var r=n(13),i=Math.floor;t.exports=function(t){return!r(t)&&isFinite(t)&&i(t)===t}},function(t,e,n){var r=n(8);r(r.S,"Number",{isNaN:function(t){return t!=t}})},function(t,e,n){var r=n(8),i=n(95),o=Math.abs;r(r.S,"Number",{isSafeInteger:function(t){return i(t)&&o(t)<=9007199254740991}})},function(t,e,n){var r=n(8);r(r.S,"Number",{MAX_SAFE_INTEGER:9007199254740991})},function(t,e,n){var r=n(8);r(r.S,"Number",{MIN_SAFE_INTEGER:-9007199254740991})},function(t,e,n){var r=n(8),i=n(85);r(r.S+r.F*(Number.parseFloat!=i),"Number",{parseFloat:i})},function(t,e,n){var r=n(8),i=n(81);r(r.S+r.F*(Number.parseInt!=i),"Number",{parseInt:i})},function(t,e,n){var r=n(8),i=n(103),o=Math.sqrt,s=Math.acosh;r(r.S+r.F*!(s&&710==Math.floor(s(Number.MAX_VALUE))&&s(1/0)==1/0),"Math",{acosh:function(t){return(t=+t)<1?NaN:t>94906265.62425156?Math.log(t)+Math.LN2:i(t-1+o(t-1)*o(t+1))}})},function(t,e){t.exports=Math.log1p||function(t){return(t=+t)>-1e-8&&t<1e-8?t-t*t/2:Math.log(1+t)}},function(t,e,n){function r(t){return isFinite(t=+t)&&0!=t?t<0?-r(-t):Math.log(t+Math.sqrt(t*t+1)):t}var i=n(8),o=Math.asinh;i(i.S+i.F*!(o&&1/o(0)>0),"Math",{asinh:r})},function(t,e,n){var r=n(8),i=Math.atanh;r(r.S+r.F*!(i&&1/i(-0)<0),"Math",{atanh:function(t){return 0==(t=+t)?t:Math.log((1+t)/(1-t))/2}})},function(t,e,n){var r=n(8),i=n(107);r(r.S,"Math",{cbrt:function(t){return i(t=+t)*Math.pow(Math.abs(t),1/3)}})},function(t,e){t.exports=Math.sign||function(t){return 0==(t=+t)||t!=t?t:t<0?-1:1}},function(t,e,n){var r=n(8);r(r.S,"Math",{clz32:function(t){return(t>>>=0)?31-Math.floor(Math.log(t+.5)*Math.LOG2E):32}})},function(t,e,n){var r=n(8),i=Math.exp;r(r.S,"Math",{cosh:function(t){return(i(t=+t)+i(-t))/2}})},function(t,e,n){var r=n(8),i=n(111);r(r.S+r.F*(i!=Math.expm1),"Math",{expm1:i})},function(t,e){var n=Math.expm1;t.exports=!n||n(10)>22025.465794806718||n(10)<22025.465794806718||n(-2e-17)!=-2e-17?function(t){return 0==(t=+t)?t:t>-1e-6&&t<1e-6?t+t*t/2:Math.exp(t)-1}:n},function(t,e,n){var r=n(8);r(r.S,"Math",{fround:n(113)})},function(t,e,n){var r=n(107),i=Math.pow,o=i(2,-52),s=i(2,-23),a=i(2,127)*(2-s),u=i(2,-126),c=function(t){return t+1/o-1/o};t.exports=Math.fround||function(t){var e,n,i=Math.abs(t),f=r(t);return i<u?f*c(i/u/s)*u*s:(e=(1+s/o)*i,n=e-(e-i),n>a||n!=n?f*(1/0):f*n)}},function(t,e,n){var r=n(8),i=Math.abs;r(r.S,"Math",{hypot:function(t,e){for(var n,r,o=0,s=0,a=arguments.length,u=0;s<a;)n=i(arguments[s++]),u<n?(r=u/n,o=o*r*r+1,u=n):n>0?(r=n/u,o+=r*r):o+=n;return u===1/0?1/0:u*Math.sqrt(o)}})},function(t,e,n){var r=n(8),i=Math.imul;r(r.S+r.F*n(7)(function(){return i(4294967295,5)!=-5||2!=i.length}),"Math",{imul:function(t,e){var n=65535,r=+t,i=+e,o=n&r,s=n&i;return 0|o*s+((n&r>>>16)*s+o*(n&i>>>16)<<16>>>0)}})},function(t,e,n){var r=n(8);r(r.S,"Math",{log10:function(t){return Math.log(t)*Math.LOG10E}})},function(t,e,n){var r=n(8);r(r.S,"Math",{log1p:n(103)})},function(t,e,n){var r=n(8);r(r.S,"Math",{log2:function(t){return Math.log(t)/Math.LN2}})},function(t,e,n){var r=n(8);r(r.S,"Math",{sign:n(107)})},function(t,e,n){var r=n(8),i=n(111),o=Math.exp;r(r.S+r.F*n(7)(function(){return!Math.sinh(-2e-17)!=-2e-17}),"Math",{sinh:function(t){return Math.abs(t=+t)<1?(i(t)-i(-t))/2:(o(t-1)-o(-t-1))*(Math.E/2)}})},function(t,e,n){var r=n(8),i=n(111),o=Math.exp;r(r.S,"Math",{tanh:function(t){var e=i(t=+t),n=i(-t);return e==1/0?1:n==1/0?-1:(e-n)/(o(t)+o(-t))}})},function(t,e,n){var r=n(8);r(r.S,"Math",{trunc:function(t){return(t>0?Math.floor:Math.ceil)(t)}})},function(t,e,n){var r=n(8),i=n(39),o=String.fromCharCode,s=String.fromCodePoint;r(r.S+r.F*(!!s&&1!=s.length),"String",{fromCodePoint:function(t){for(var e,n=[],r=arguments.length,s=0;r>s;){if(e=+arguments[s++],i(e,1114111)!==e)throw RangeError(e+" is not a valid code point");n.push(e<65536?o(e):o(((e-=65536)>>10)+55296,e%1024+56320))}return n.join("")}})},function(t,e,n){var r=n(8),i=n(32),o=n(37);r(r.S,"String",{raw:function(t){for(var e=i(t.raw),n=o(e.length),r=arguments.length,s=[],a=0;n>a;)s.push(String(e[a++])),a<r&&s.push(String(arguments[a]));return s.join("")}})},function(t,e,n){"use strict";n(82)("trim",function(t){return function(){return t(this,3)}})},function(t,e,n){"use strict";var r=n(127)(!0);n(128)(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,e=this._t,n=this._i;return n>=e.length?{value:void 0,done:!0}:(t=r(e,n),this._i+=t.length,{value:t,done:!1})})},function(t,e,n){var r=n(38),i=n(35);t.exports=function(t){return function(e,n){var o,s,a=String(i(e)),u=r(n),c=a.length;return u<0||u>=c?t?"":void 0:(o=a.charCodeAt(u),o<55296||o>56319||u+1===c||(s=a.charCodeAt(u+1))<56320||s>57343?t?a.charAt(u):o:t?a.slice(u,u+2):(o-55296<<10)+(s-56320)+65536)}}},function(t,e,n){"use strict";var r=n(28),i=n(8),o=n(18),s=n(10),a=n(129),u=n(130),c=n(24),f=n(58),h=n(25)("iterator"),l=!([].keys&&"next"in[].keys()),p="@@iterator",d="keys",g="values",v=function(){return this};t.exports=function(t,e,n,y,m,S,b){u(n,e,y);var F,w,_,x=function(t){if(!l&&t in C)return C[t];switch(t){case d:return function(){return new n(this,t)};case g:return function(){return new n(this,t)}}return function(){return new n(this,t)}},E=e+" Iterator",A=m==g,P=!1,C=t.prototype,k=C[h]||C[p]||m&&C[m],T=k||x(m),R=m?A?x("entries"):T:void 0,I="Array"==e?C.entries||k:k;if(I&&(_=f(I.call(new t)),_!==Object.prototype&&_.next&&(c(_,E,!0),r||"function"==typeof _[h]||s(_,h,v))),A&&k&&k.name!==g&&(P=!0,T=function(){return k.call(this)}),r&&!b||!l&&!P&&C[h]||s(C,h,T),a[e]=T,a[E]=v,m)if(F={values:A?T:x(g),keys:S?T:x(d),entries:R},b)for(w in F)w in C||o(C,w,F[w]);else i(i.P+i.F*(l||P),e,F);return F}},function(t,e){t.exports={}},function(t,e,n){"use strict";var r=n(45),i=n(17),o=n(24),s={};n(10)(s,n(25)("iterator"),function(){return this}),t.exports=function(t,e,n){t.prototype=r(s,{next:i(1,n)}),o(t,e+" Iterator")}},function(t,e,n){"use strict";var r=n(8),i=n(127)(!1);r(r.P,"String",{codePointAt:function(t){return i(this,t)}})},function(t,e,n){"use strict";var r=n(8),i=n(37),o=n(133),s="endsWith",a=""[s];r(r.P+r.F*n(135)(s),"String",{endsWith:function(t){var e=o(this,t,s),n=arguments.length>1?arguments[1]:void 0,r=i(e.length),u=void 0===n?r:Math.min(i(n),r),c=String(t);return a?a.call(e,c,u):e.slice(u-c.length,u)===c}})},function(t,e,n){var r=n(134),i=n(35);t.exports=function(t,e,n){if(r(e))throw TypeError("String#"+n+" doesn't accept regex!");return String(i(t))}},function(t,e,n){var r=n(13),i=n(34),o=n(25)("match");t.exports=function(t){var e;return r(t)&&(void 0!==(e=t[o])?!!e:"RegExp"==i(t))}},function(t,e,n){var r=n(25)("match");t.exports=function(t){var e=/./;try{"/./"[t](e)}catch(n){try{return e[r]=!1,!"/./"[t](e)}catch(t){}}return!0}},function(t,e,n){"use strict";var r=n(8),i=n(133),o="includes";r(r.P+r.F*n(135)(o),"String",{includes:function(t){return!!~i(this,t,o).indexOf(t,arguments.length>1?arguments[1]:void 0)}})},function(t,e,n){var r=n(8);r(r.P,"String",{repeat:n(90)})},function(t,e,n){"use strict";var r=n(8),i=n(37),o=n(133),s="startsWith",a=""[s];r(r.P+r.F*n(135)(s),"String",{startsWith:function(t){var e=o(this,t,s),n=i(Math.min(arguments.length>1?arguments[1]:void 0,e.length)),r=String(t);return a?a.call(e,r,n):e.slice(n,n+r.length)===r}})},function(t,e,n){"use strict";n(140)("anchor",function(t){return function(e){return t(this,"a","name",e)}})},function(t,e,n){var r=n(8),i=n(7),o=n(35),s=/"/g,a=function(t,e,n,r){var i=String(o(t)),a="<"+e;return""!==n&&(a+=" "+n+'="'+String(r).replace(s,""")+'"'),a+">"+i+"</"+e+">"};t.exports=function(t,e){var n={};n[t]=e(a),r(r.P+r.F*i(function(){var e=""[t]('"');return e!==e.toLowerCase()||e.split('"').length>3}),"String",n)}},function(t,e,n){"use strict";n(140)("big",function(t){return function(){return t(this,"big","","")}})},function(t,e,n){"use strict";n(140)("blink",function(t){return function(){return t(this,"blink","","")}})},function(t,e,n){"use strict";n(140)("bold",function(t){return function(){return t(this,"b","","")}})},function(t,e,n){"use strict";n(140)("fixed",function(t){return function(){return t(this,"tt","","")}})},function(t,e,n){"use strict";n(140)("fontcolor",function(t){return function(e){return t(this,"font","color",e)}})},function(t,e,n){"use strict";n(140)("fontsize",function(t){return function(e){return t(this,"font","size",e)}})},function(t,e,n){"use strict";n(140)("italics",function(t){return function(){return t(this,"i","","")}})},function(t,e,n){"use strict";n(140)("link",function(t){return function(e){return t(this,"a","href",e)}})},function(t,e,n){"use strict";n(140)("small",function(t){return function(){return t(this,"small","","")}})},function(t,e,n){"use strict";n(140)("strike",function(t){return function(){return t(this,"strike","","")}})},function(t,e,n){"use strict";n(140)("sub",function(t){return function(){return t(this,"sub","","")}})},function(t,e,n){"use strict";n(140)("sup",function(t){return function(){return t(this,"sup","","")}})},function(t,e,n){var r=n(8);r(r.S,"Date",{now:function(){return(new Date).getTime()}})},function(t,e,n){"use strict";var r=n(8),i=n(57),o=n(16);r(r.P+r.F*n(7)(function(){return null!==new Date(NaN).toJSON()||1!==Date.prototype.toJSON.call({toISOString:function(){return 1}})}),"Date",{toJSON:function(t){var e=i(this),n=o(e);return"number"!=typeof n||isFinite(n)?e.toISOString():null}})},function(t,e,n){var r=n(8),i=n(156);r(r.P+r.F*(Date.prototype.toISOString!==i),"Date",{toISOString:i})},function(t,e,n){"use strict";var r=n(7),i=Date.prototype.getTime,o=Date.prototype.toISOString,s=function(t){return t>9?t:"0"+t};t.exports=r(function(){return"0385-07-25T07:06:39.999Z"!=o.call(new Date(-5e13-1))})||!r(function(){o.call(new Date(NaN))})?function(){if(!isFinite(i.call(this)))throw RangeError("Invalid time value");var t=this,e=t.getUTCFullYear(),n=t.getUTCMilliseconds(),r=e<0?"-":e>9999?"+":"";
return r+("00000"+Math.abs(e)).slice(r?-6:-4)+"-"+s(t.getUTCMonth()+1)+"-"+s(t.getUTCDate())+"T"+s(t.getUTCHours())+":"+s(t.getUTCMinutes())+":"+s(t.getUTCSeconds())+"."+(n>99?n:"0"+s(n))+"Z"}:o},function(t,e,n){var r=Date.prototype,i="Invalid Date",o="toString",s=r[o],a=r.getTime;new Date(NaN)+""!=i&&n(18)(r,o,function(){var t=a.call(this);return t===t?s.call(this):i})},function(t,e,n){var r=n(25)("toPrimitive"),i=Date.prototype;r in i||n(10)(i,r,n(159))},function(t,e,n){"use strict";var r=n(12),i=n(16),o="number";t.exports=function(t){if("string"!==t&&t!==o&&"default"!==t)throw TypeError("Incorrect hint");return i(r(this),t!=o)}},function(t,e,n){var r=n(8);r(r.S,"Array",{isArray:n(44)})},function(t,e,n){"use strict";var r=n(20),i=n(8),o=n(57),s=n(162),a=n(163),u=n(37),c=n(164),f=n(165);i(i.S+i.F*!n(166)(function(t){Array.from(t)}),"Array",{from:function(t){var e,n,i,h,l=o(t),p="function"==typeof this?this:Array,d=arguments.length,g=d>1?arguments[1]:void 0,v=void 0!==g,y=0,m=f(l);if(v&&(g=r(g,d>2?arguments[2]:void 0,2)),void 0==m||p==Array&&a(m))for(e=u(l.length),n=new p(e);e>y;y++)c(n,y,v?g(l[y],y):l[y]);else for(h=m.call(l),n=new p;!(i=h.next()).done;y++)c(n,y,v?s(h,g,[i.value,y],!0):i.value);return n.length=y,n}})},function(t,e,n){var r=n(12);t.exports=function(t,e,n,i){try{return i?e(r(n)[0],n[1]):e(n)}catch(e){var o=t.return;throw void 0!==o&&r(o.call(t)),e}}},function(t,e,n){var r=n(129),i=n(25)("iterator"),o=Array.prototype;t.exports=function(t){return void 0!==t&&(r.Array===t||o[i]===t)}},function(t,e,n){"use strict";var r=n(11),i=n(17);t.exports=function(t,e,n){e in t?r.f(t,e,i(0,n)):t[e]=n}},function(t,e,n){var r=n(74),i=n(25)("iterator"),o=n(129);t.exports=n(9).getIteratorMethod=function(t){if(void 0!=t)return t[i]||t["@@iterator"]||o[r(t)]}},function(t,e,n){var r=n(25)("iterator"),i=!1;try{var o=[7][r]();o.return=function(){i=!0},Array.from(o,function(){throw 2})}catch(t){}t.exports=function(t,e){if(!e&&!i)return!1;var n=!1;try{var o=[7],s=o[r]();s.next=function(){return{done:n=!0}},o[r]=function(){return s},t(o)}catch(t){}return n}},function(t,e,n){"use strict";var r=n(8),i=n(164);r(r.S+r.F*n(7)(function(){function t(){}return!(Array.of.call(t)instanceof t)}),"Array",{of:function(){for(var t=0,e=arguments.length,n=new("function"==typeof this?this:Array)(e);e>t;)i(n,t,arguments[t++]);return n.length=e,n}})},function(t,e,n){"use strict";var r=n(8),i=n(32),o=[].join;r(r.P+r.F*(n(33)!=Object||!n(169)(o)),"Array",{join:function(t){return o.call(i(this),void 0===t?",":t)}})},function(t,e,n){"use strict";var r=n(7);t.exports=function(t,e){return!!t&&r(function(){e?t.call(null,function(){},1):t.call(null)})}},function(t,e,n){"use strict";var r=n(8),i=n(47),o=n(34),s=n(39),a=n(37),u=[].slice;r(r.P+r.F*n(7)(function(){i&&u.call(i)}),"Array",{slice:function(t,e){var n=a(this.length),r=o(this);if(e=void 0===e?n:e,"Array"==r)return u.call(this,t,e);for(var i=s(t,n),c=s(e,n),f=a(c-i),h=new Array(f),l=0;l<f;l++)h[l]="String"==r?this.charAt(i+l):this[i+l];return h}})},function(t,e,n){"use strict";var r=n(8),i=n(21),o=n(57),s=n(7),a=[].sort,u=[1,2,3];r(r.P+r.F*(s(function(){u.sort(void 0)})||!s(function(){u.sort(null)})||!n(169)(a)),"Array",{sort:function(t){return void 0===t?a.call(o(this)):a.call(o(this),i(t))}})},function(t,e,n){"use strict";var r=n(8),i=n(173)(0),o=n(169)([].forEach,!0);r(r.P+r.F*!o,"Array",{forEach:function(t){return i(this,t,arguments[1])}})},function(t,e,n){var r=n(20),i=n(33),o=n(57),s=n(37),a=n(174);t.exports=function(t,e){var n=1==t,u=2==t,c=3==t,f=4==t,h=6==t,l=5==t||h,p=e||a;return function(e,a,d){for(var g,v,y=o(e),m=i(y),S=r(a,d,3),b=s(m.length),F=0,w=n?p(e,b):u?p(e,0):void 0;b>F;F++)if((l||F in m)&&(g=m[F],v=S(g,F,y),t))if(n)w[F]=v;else if(v)switch(t){case 3:return!0;case 5:return g;case 6:return F;case 2:w.push(g)}else if(f)return!1;return h?-1:c||f?f:w}}},function(t,e,n){var r=n(175);t.exports=function(t,e){return new(r(t))(e)}},function(t,e,n){var r=n(13),i=n(44),o=n(25)("species");t.exports=function(t){var e;return i(t)&&(e=t.constructor,"function"!=typeof e||e!==Array&&!i(e.prototype)||(e=void 0),r(e)&&(e=e[o],null===e&&(e=void 0))),void 0===e?Array:e}},function(t,e,n){"use strict";var r=n(8),i=n(173)(1);r(r.P+r.F*!n(169)([].map,!0),"Array",{map:function(t){return i(this,t,arguments[1])}})},function(t,e,n){"use strict";var r=n(8),i=n(173)(2);r(r.P+r.F*!n(169)([].filter,!0),"Array",{filter:function(t){return i(this,t,arguments[1])}})},function(t,e,n){"use strict";var r=n(8),i=n(173)(3);r(r.P+r.F*!n(169)([].some,!0),"Array",{some:function(t){return i(this,t,arguments[1])}})},function(t,e,n){"use strict";var r=n(8),i=n(173)(4);r(r.P+r.F*!n(169)([].every,!0),"Array",{every:function(t){return i(this,t,arguments[1])}})},function(t,e,n){"use strict";var r=n(8),i=n(181);r(r.P+r.F*!n(169)([].reduce,!0),"Array",{reduce:function(t){return i(this,t,arguments.length,arguments[1],!1)}})},function(t,e,n){var r=n(21),i=n(57),o=n(33),s=n(37);t.exports=function(t,e,n,a,u){r(e);var c=i(t),f=o(c),h=s(c.length),l=u?h-1:0,p=u?-1:1;if(n<2)for(;;){if(l in f){a=f[l],l+=p;break}if(l+=p,u?l<0:h<=l)throw TypeError("Reduce of empty array with no initial value")}for(;u?l>=0:h>l;l+=p)l in f&&(a=e(a,f[l],l,c));return a}},function(t,e,n){"use strict";var r=n(8),i=n(181);r(r.P+r.F*!n(169)([].reduceRight,!0),"Array",{reduceRight:function(t){return i(this,t,arguments.length,arguments[1],!0)}})},function(t,e,n){"use strict";var r=n(8),i=n(36)(!1),o=[].indexOf,s=!!o&&1/[1].indexOf(1,-0)<0;r(r.P+r.F*(s||!n(169)(o)),"Array",{indexOf:function(t){return s?o.apply(this,arguments)||0:i(this,t,arguments[1])}})},function(t,e,n){"use strict";var r=n(8),i=n(32),o=n(38),s=n(37),a=[].lastIndexOf,u=!!a&&1/[1].lastIndexOf(1,-0)<0;r(r.P+r.F*(u||!n(169)(a)),"Array",{lastIndexOf:function(t){if(u)return a.apply(this,arguments)||0;var e=i(this),n=s(e.length),r=n-1;for(arguments.length>1&&(r=Math.min(r,o(arguments[1]))),r<0&&(r=n+r);r>=0;r--)if(r in e&&e[r]===t)return r||0;return-1}})},function(t,e,n){var r=n(8);r(r.P,"Array",{copyWithin:n(186)}),n(187)("copyWithin")},function(t,e,n){"use strict";var r=n(57),i=n(39),o=n(37);t.exports=[].copyWithin||function(t,e){var n=r(this),s=o(n.length),a=i(t,s),u=i(e,s),c=arguments.length>2?arguments[2]:void 0,f=Math.min((void 0===c?s:i(c,s))-u,s-a),h=1;for(u<a&&a<u+f&&(h=-1,u+=f-1,a+=f-1);f-- >0;)u in n?n[a]=n[u]:delete n[a],a+=h,u+=h;return n}},function(t,e,n){var r=n(25)("unscopables"),i=Array.prototype;void 0==i[r]&&n(10)(i,r,{}),t.exports=function(t){i[r][t]=!0}},function(t,e,n){var r=n(8);r(r.P,"Array",{fill:n(189)}),n(187)("fill")},function(t,e,n){"use strict";var r=n(57),i=n(39),o=n(37);t.exports=function(t){for(var e=r(this),n=o(e.length),s=arguments.length,a=i(s>1?arguments[1]:void 0,n),u=s>2?arguments[2]:void 0,c=void 0===u?n:i(u,n);c>a;)e[a++]=t;return e}},function(t,e,n){"use strict";var r=n(8),i=n(173)(5),o="find",s=!0;o in[]&&Array(1)[o](function(){s=!1}),r(r.P+r.F*s,"Array",{find:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}}),n(187)(o)},function(t,e,n){"use strict";var r=n(8),i=n(173)(6),o="findIndex",s=!0;o in[]&&Array(1)[o](function(){s=!1}),r(r.P+r.F*s,"Array",{findIndex:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}}),n(187)(o)},function(t,e,n){n(193)("Array")},function(t,e,n){"use strict";var r=n(4),i=n(11),o=n(6),s=n(25)("species");t.exports=function(t){var e=r[t];o&&e&&!e[s]&&i.f(e,s,{configurable:!0,get:function(){return this}})}},function(t,e,n){"use strict";var r=n(187),i=n(195),o=n(129),s=n(32);t.exports=n(128)(Array,"Array",function(t,e){this._t=s(t),this._i=0,this._k=e},function(){var t=this._t,e=this._k,n=this._i++;return!t||n>=t.length?(this._t=void 0,i(1)):"keys"==e?i(0,n):"values"==e?i(0,t[n]):i(0,[n,t[n]])},"values"),o.Arguments=o.Array,r("keys"),r("values"),r("entries")},function(t,e){t.exports=function(t,e){return{value:e,done:!!t}}},function(t,e,n){var r=n(4),i=n(87),o=n(11).f,s=n(49).f,a=n(134),u=n(197),c=r.RegExp,f=c,h=c.prototype,l=/a/g,p=/a/g,d=new c(l)!==l;if(n(6)&&(!d||n(7)(function(){return p[n(25)("match")]=!1,c(l)!=l||c(p)==p||"/a/i"!=c(l,"i")}))){c=function(t,e){var n=this instanceof c,r=a(t),o=void 0===e;return!n&&r&&t.constructor===c&&o?t:i(d?new f(r&&!o?t.source:t,e):f((r=t instanceof c)?t.source:t,r&&o?u.call(t):e),n?this:h,c)};for(var g=(function(t){t in c||o(c,t,{configurable:!0,get:function(){return f[t]},set:function(e){f[t]=e}})}),v=s(f),y=0;v.length>y;)g(v[y++]);h.constructor=c,c.prototype=h,n(18)(r,"RegExp",c)}n(193)("RegExp")},function(t,e,n){"use strict";var r=n(12);t.exports=function(){var t=r(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e}},function(t,e,n){"use strict";n(199);var r=n(12),i=n(197),o=n(6),s="toString",a=/./[s],u=function(t){n(18)(RegExp.prototype,s,t,!0)};n(7)(function(){return"/a/b"!=a.call({source:"a",flags:"b"})})?u(function(){var t=r(this);return"/".concat(t.source,"/","flags"in t?t.flags:!o&&t instanceof RegExp?i.call(t):void 0)}):a.name!=s&&u(function(){return a.call(this)})},function(t,e,n){n(6)&&"g"!=/./g.flags&&n(11).f(RegExp.prototype,"flags",{configurable:!0,get:n(197)})},function(t,e,n){n(201)("match",1,function(t,e,n){return[function(n){"use strict";var r=t(this),i=void 0==n?void 0:n[e];return void 0!==i?i.call(n,r):new RegExp(n)[e](String(r))},n]})},function(t,e,n){"use strict";var r=n(10),i=n(18),o=n(7),s=n(35),a=n(25);t.exports=function(t,e,n){var u=a(t),c=n(s,u,""[t]),f=c[0],h=c[1];o(function(){var e={};return e[u]=function(){return 7},7!=""[t](e)})&&(i(String.prototype,t,f),r(RegExp.prototype,u,2==e?function(t,e){return h.call(t,this,e)}:function(t){return h.call(t,this)}))}},function(t,e,n){n(201)("replace",2,function(t,e,n){return[function(r,i){"use strict";var o=t(this),s=void 0==r?void 0:r[e];return void 0!==s?s.call(r,o,i):n.call(String(o),r,i)},n]})},function(t,e,n){n(201)("search",1,function(t,e,n){return[function(n){"use strict";var r=t(this),i=void 0==n?void 0:n[e];return void 0!==i?i.call(n,r):new RegExp(n)[e](String(r))},n]})},function(t,e,n){n(201)("split",2,function(t,e,r){"use strict";var i=n(134),o=r,s=[].push,a="split",u="length",c="lastIndex";if("c"=="abbc"[a](/(b)*/)[1]||4!="test"[a](/(?:)/,-1)[u]||2!="ab"[a](/(?:ab)*/)[u]||4!="."[a](/(.?)(.?)/)[u]||"."[a](/()()/)[u]>1||""[a](/.?/)[u]){var f=void 0===/()??/.exec("")[1];r=function(t,e){var n=String(this);if(void 0===t&&0===e)return[];if(!i(t))return o.call(n,t,e);var r,a,h,l,p,d=[],g=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),v=0,y=void 0===e?4294967295:e>>>0,m=new RegExp(t.source,g+"g");for(f||(r=new RegExp("^"+m.source+"$(?!\\s)",g));(a=m.exec(n))&&(h=a.index+a[0][u],!(h>v&&(d.push(n.slice(v,a.index)),!f&&a[u]>1&&a[0].replace(r,function(){for(p=1;p<arguments[u]-2;p++)void 0===arguments[p]&&(a[p]=void 0)}),a[u]>1&&a.index<n[u]&&s.apply(d,a.slice(1)),l=a[0][u],v=h,d[u]>=y)));)m[c]===a.index&&m[c]++;return v===n[u]?!l&&m.test("")||d.push(""):d.push(n.slice(v)),d[u]>y?d.slice(0,y):d}}else"0"[a](void 0,0)[u]&&(r=function(t,e){return void 0===t&&0===e?[]:o.call(this,t,e)});return[function(n,i){var o=t(this),s=void 0==n?void 0:n[e];return void 0!==s?s.call(n,o,i):r.call(String(o),n,i)},r]})},function(t,e,n){"use strict";var r,i,o,s,a=n(28),u=n(4),c=n(20),f=n(74),h=n(8),l=n(13),p=n(21),d=n(206),g=n(207),v=n(208),y=n(209).set,m=n(210)(),S=n(211),b=n(212),F=n(213),w="Promise",_=u.TypeError,x=u.process,E=u[w],A="process"==f(x),P=function(){},C=i=S.f,k=!!function(){try{var t=E.resolve(1),e=(t.constructor={})[n(25)("species")]=function(t){t(P,P)};return(A||"function"==typeof PromiseRejectionEvent)&&t.then(P)instanceof e}catch(t){}}(),T=function(t){var e;return!(!l(t)||"function"!=typeof(e=t.then))&&e},R=function(t,e){if(!t._n){t._n=!0;var n=t._c;m(function(){for(var r=t._v,i=1==t._s,o=0,s=function(e){var n,o,s,a=i?e.ok:e.fail,u=e.resolve,c=e.reject,f=e.domain;try{a?(i||(2==t._h&&N(t),t._h=1),a===!0?n=r:(f&&f.enter(),n=a(r),f&&(f.exit(),s=!0)),n===e.promise?c(_("Promise-chain cycle")):(o=T(n))?o.call(n,u,c):u(n)):c(r)}catch(t){f&&!s&&f.exit(),c(t)}};n.length>o;)s(n[o++]);t._c=[],t._n=!1,e&&!t._h&&I(t)})}},I=function(t){y.call(u,function(){var e,n,r,i=t._v,o=D(t);if(o&&(e=b(function(){A?x.emit("unhandledRejection",i,t):(n=u.onunhandledrejection)?n({promise:t,reason:i}):(r=u.console)&&r.error&&r.error("Unhandled promise rejection",i)}),t._h=A||D(t)?2:1),t._a=void 0,o&&e.e)throw e.v})},D=function(t){return 1!==t._h&&0===(t._a||t._c).length},N=function(t){y.call(u,function(){var e;A?x.emit("rejectionHandled",t):(e=u.onrejectionhandled)&&e({promise:t,reason:t._v})})},O=function(t){var e=this;e._d||(e._d=!0,e=e._w||e,e._v=t,e._s=2,e._a||(e._a=e._c.slice()),R(e,!0))},j=function(t){var e,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===t)throw _("Promise can't be resolved itself");(e=T(t))?m(function(){var r={_w:n,_d:!1};try{e.call(t,c(j,r,1),c(O,r,1))}catch(t){O.call(r,t)}}):(n._v=t,n._s=1,R(n,!1))}catch(t){O.call({_w:n,_d:!1},t)}}};k||(E=function(t){d(this,E,w,"_h"),p(t),r.call(this);try{t(c(j,this,1),c(O,this,1))}catch(t){O.call(this,t)}},r=function(t){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},r.prototype=n(214)(E.prototype,{then:function(t,e){var n=C(v(this,E));return n.ok="function"!=typeof t||t,n.fail="function"==typeof e&&e,n.domain=A?x.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&R(this,!1),n.promise},catch:function(t){return this.then(void 0,t)}}),o=function(){var t=new r;this.promise=t,this.resolve=c(j,t,1),this.reject=c(O,t,1)},S.f=C=function(t){return t===E||t===s?new o(t):i(t)}),h(h.G+h.W+h.F*!k,{Promise:E}),n(24)(E,w),n(193)(w),s=n(9)[w],h(h.S+h.F*!k,w,{reject:function(t){var e=C(this),n=e.reject;return n(t),e.promise}}),h(h.S+h.F*(a||!k),w,{resolve:function(t){return F(a&&this===s?E:this,t)}}),h(h.S+h.F*!(k&&n(166)(function(t){E.all(t).catch(P)})),w,{all:function(t){var e=this,n=C(e),r=n.resolve,i=n.reject,o=b(function(){var n=[],o=0,s=1;g(t,!1,function(t){var a=o++,u=!1;n.push(void 0),s++,e.resolve(t).then(function(t){u||(u=!0,n[a]=t,--s||r(n))},i)}),--s||r(n)});return o.e&&i(o.v),n.promise},race:function(t){var e=this,n=C(e),r=n.reject,i=b(function(){g(t,!1,function(t){e.resolve(t).then(n.resolve,r)})});return i.e&&r(i.v),n.promise}})},function(t,e){t.exports=function(t,e,n,r){if(!(t instanceof e)||void 0!==r&&r in t)throw TypeError(n+": incorrect invocation!");return t}},function(t,e,n){var r=n(20),i=n(162),o=n(163),s=n(12),a=n(37),u=n(165),c={},f={},e=t.exports=function(t,e,n,h,l){var p,d,g,v,y=l?function(){return t}:u(t),m=r(n,h,e?2:1),S=0;if("function"!=typeof y)throw TypeError(t+" is not iterable!");if(o(y)){for(p=a(t.length);p>S;S++)if(v=e?m(s(d=t[S])[0],d[1]):m(t[S]),v===c||v===f)return v}else for(g=y.call(t);!(d=g.next()).done;)if(v=i(g,m,d.value,e),v===c||v===f)return v};e.BREAK=c,e.RETURN=f},function(t,e,n){var r=n(12),i=n(21),o=n(25)("species");t.exports=function(t,e){var n,s=r(t).constructor;return void 0===s||void 0==(n=r(s)[o])?e:i(n)}},function(t,e,n){var r,i,o,s=n(20),a=n(77),u=n(47),c=n(15),f=n(4),h=f.process,l=f.setImmediate,p=f.clearImmediate,d=f.MessageChannel,g=f.Dispatch,v=0,y={},m="onreadystatechange",S=function(){var t=+this;if(y.hasOwnProperty(t)){var e=y[t];delete y[t],e()}},b=function(t){S.call(t.data)};l&&p||(l=function(t){for(var e=[],n=1;arguments.length>n;)e.push(arguments[n++]);return y[++v]=function(){a("function"==typeof t?t:Function(t),e)},r(v),v},p=function(t){delete y[t]},"process"==n(34)(h)?r=function(t){h.nextTick(s(S,t,1))}:g&&g.now?r=function(t){g.now(s(S,t,1))}:d?(i=new d,o=i.port2,i.port1.onmessage=b,r=s(o.postMessage,o,1)):f.addEventListener&&"function"==typeof postMessage&&!f.importScripts?(r=function(t){f.postMessage(t+"","*")},f.addEventListener("message",b,!1)):r=m in c("script")?function(t){u.appendChild(c("script"))[m]=function(){u.removeChild(this),S.call(t)}}:function(t){setTimeout(s(S,t,1),0)}),t.exports={set:l,clear:p}},function(t,e,n){var r=n(4),i=n(209).set,o=r.MutationObserver||r.WebKitMutationObserver,s=r.process,a=r.Promise,u="process"==n(34)(s);t.exports=function(){var t,e,n,c=function(){var r,i;for(u&&(r=s.domain)&&r.exit();t;){i=t.fn,t=t.next;try{i()}catch(r){throw t?n():e=void 0,r}}e=void 0,r&&r.enter()};if(u)n=function(){s.nextTick(c)};else if(!o||r.navigator&&r.navigator.standalone)if(a&&a.resolve){var f=a.resolve();n=function(){f.then(c)}}else n=function(){i.call(r,c)};else{var h=!0,l=document.createTextNode("");new o(c).observe(l,{characterData:!0}),n=function(){l.data=h=!h}}return function(r){var i={fn:r,next:void 0};e&&(e.next=i),t||(t=i,n()),e=i}}},function(t,e,n){"use strict";function r(t){var e,n;this.promise=new t(function(t,r){if(void 0!==e||void 0!==n)throw TypeError("Bad Promise constructor");e=t,n=r}),this.resolve=i(e),this.reject=i(n)}var i=n(21);t.exports.f=function(t){return new r(t)}},function(t,e){t.exports=function(t){try{return{e:!1,v:t()}}catch(t){return{e:!0,v:t}}}},function(t,e,n){var r=n(12),i=n(13),o=n(211);t.exports=function(t,e){if(r(t),i(e)&&e.constructor===t)return e;var n=o.f(t),s=n.resolve;return s(e),n.promise}},function(t,e,n){var r=n(18);t.exports=function(t,e,n){for(var i in e)r(t,i,e[i],n);return t}},function(t,e,n){"use strict";var r=n(216),i=n(217),o="Map";t.exports=n(218)(o,function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}},{get:function(t){var e=r.getEntry(i(this,o),t);return e&&e.v},set:function(t,e){return r.def(i(this,o),0===t?0:t,e)}},r,!0)},function(t,e,n){"use strict";var r=n(11).f,i=n(45),o=n(214),s=n(20),a=n(206),u=n(207),c=n(128),f=n(195),h=n(193),l=n(6),p=n(22).fastKey,d=n(217),g=l?"_s":"size",v=function(t,e){var n,r=p(e);if("F"!==r)return t._i[r];for(n=t._f;n;n=n.n)if(n.k==e)return n};t.exports={getConstructor:function(t,e,n,c){var f=t(function(t,r){a(t,f,e,"_i"),t._t=e,t._i=i(null),t._f=void 0,t._l=void 0,t[g]=0,void 0!=r&&u(r,n,t[c],t)});return o(f.prototype,{clear:function(){for(var t=d(this,e),n=t._i,r=t._f;r;r=r.n)r.r=!0,r.p&&(r.p=r.p.n=void 0),delete n[r.i];t._f=t._l=void 0,t[g]=0},delete:function(t){var n=d(this,e),r=v(n,t);if(r){var i=r.n,o=r.p;delete n._i[r.i],r.r=!0,o&&(o.n=i),i&&(i.p=o),n._f==r&&(n._f=i),n._l==r&&(n._l=o),n[g]--}return!!r},forEach:function(t){d(this,e);for(var n,r=s(t,arguments.length>1?arguments[1]:void 0,3);n=n?n.n:this._f;)for(r(n.v,n.k,this);n&&n.r;)n=n.p},has:function(t){return!!v(d(this,e),t)}}),l&&r(f.prototype,"size",{get:function(){return d(this,e)[g]}}),f},def:function(t,e,n){var r,i,o=v(t,e);return o?o.v=n:(t._l=o={i:i=p(e,!0),k:e,v:n,p:r=t._l,n:void 0,r:!1},t._f||(t._f=o),r&&(r.n=o),t[g]++,"F"!==i&&(t._i[i]=o)),t},getEntry:v,setStrong:function(t,e,n){c(t,e,function(t,n){this._t=d(t,e),this._k=n,this._l=void 0},function(){for(var t=this,e=t._k,n=t._l;n&&n.r;)n=n.p;return t._t&&(t._l=n=n?n.n:t._t._f)?"keys"==e?f(0,n.k):"values"==e?f(0,n.v):f(0,[n.k,n.v]):(t._t=void 0,f(1))},n?"entries":"values",!n,!0),h(e)}}},function(t,e,n){var r=n(13);t.exports=function(t,e){if(!r(t)||t._t!==e)throw TypeError("Incompatible receiver, "+e+" required!");return t}},function(t,e,n){"use strict";var r=n(4),i=n(8),o=n(18),s=n(214),a=n(22),u=n(207),c=n(206),f=n(13),h=n(7),l=n(166),p=n(24),d=n(87);t.exports=function(t,e,n,g,v,y){var m=r[t],S=m,b=v?"set":"add",F=S&&S.prototype,w={},_=function(t){var e=F[t];o(F,t,"delete"==t?function(t){return!(y&&!f(t))&&e.call(this,0===t?0:t)}:"has"==t?function(t){return!(y&&!f(t))&&e.call(this,0===t?0:t)}:"get"==t?function(t){return y&&!f(t)?void 0:e.call(this,0===t?0:t)}:"add"==t?function(t){return e.call(this,0===t?0:t),this}:function(t,n){return e.call(this,0===t?0:t,n),this})};if("function"==typeof S&&(y||F.forEach&&!h(function(){(new S).entries().next()}))){var x=new S,E=x[b](y?{}:-0,1)!=x,A=h(function(){x.has(1)}),P=l(function(t){new S(t)}),C=!y&&h(function(){for(var t=new S,e=5;e--;)t[b](e,e);return!t.has(-0)});P||(S=e(function(e,n){c(e,S,t);var r=d(new m,e,S);return void 0!=n&&u(n,v,r[b],r),r}),S.prototype=F,F.constructor=S),(A||C)&&(_("delete"),_("has"),v&&_("get")),(C||E)&&_(b),y&&F.clear&&delete F.clear}else S=g.getConstructor(e,t,v,b),s(S.prototype,n),a.NEED=!0;return p(S,t),w[t]=S,i(i.G+i.W+i.F*(S!=m),w),y||g.setStrong(S,t,v),S}},function(t,e,n){"use strict";var r=n(216),i=n(217),o="Set";t.exports=n(218)(o,function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}},{add:function(t){return r.def(i(this,o),t=0===t?0:t,t)}},r)},function(t,e,n){"use strict";var r,i=n(173)(0),o=n(18),s=n(22),a=n(68),u=n(221),c=n(13),f=n(7),h=n(217),l="WeakMap",p=s.getWeak,d=Object.isExtensible,g=u.ufstore,v={},y=function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}},m={get:function(t){if(c(t)){var e=p(t);return e===!0?g(h(this,l)).get(t):e?e[this._i]:void 0}},set:function(t,e){return u.def(h(this,l),t,e)}},S=t.exports=n(218)(l,y,m,u,!0,!0);f(function(){return 7!=(new S).set((Object.freeze||Object)(v),7).get(v)})&&(r=u.getConstructor(y,l),a(r.prototype,m),s.NEED=!0,i(["delete","has","get","set"],function(t){var e=S.prototype,n=e[t];o(e,t,function(e,i){if(c(e)&&!d(e)){this._f||(this._f=new r);var o=this._f[t](e,i);return"set"==t?this:o}return n.call(this,e,i)})}))},function(t,e,n){"use strict";var r=n(214),i=n(22).getWeak,o=n(12),s=n(13),a=n(206),u=n(207),c=n(173),f=n(5),h=n(217),l=c(5),p=c(6),d=0,g=function(t){return t._l||(t._l=new v)},v=function(){this.a=[]},y=function(t,e){return l(t.a,function(t){return t[0]===e})};v.prototype={get:function(t){var e=y(this,t);if(e)return e[1]},has:function(t){return!!y(this,t)},set:function(t,e){var n=y(this,t);n?n[1]=e:this.a.push([t,e])},delete:function(t){var e=p(this.a,function(e){return e[0]===t});return~e&&this.a.splice(e,1),!!~e}},t.exports={getConstructor:function(t,e,n,o){var c=t(function(t,r){a(t,c,e,"_i"),t._t=e,t._i=d++,t._l=void 0,void 0!=r&&u(r,n,t[o],t)});return r(c.prototype,{delete:function(t){if(!s(t))return!1;var n=i(t);return n===!0?g(h(this,e)).delete(t):n&&f(n,this._i)&&delete n[this._i]},has:function(t){if(!s(t))return!1;var n=i(t);return n===!0?g(h(this,e)).has(t):n&&f(n,this._i)}}),c},def:function(t,e,n){var r=i(o(e),!0);return r===!0?g(t).set(e,n):r[t._i]=n,t},ufstore:g}},function(t,e,n){"use strict";var r=n(221),i=n(217),o="WeakSet";n(218)(o,function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}},{add:function(t){return r.def(i(this,o),t,!0)}},r,!1,!0)},function(t,e,n){"use strict";var r=n(8),i=n(224),o=n(225),s=n(12),a=n(39),u=n(37),c=n(13),f=n(4).ArrayBuffer,h=n(208),l=o.ArrayBuffer,p=o.DataView,d=i.ABV&&f.isView,g=l.prototype.slice,v=i.VIEW,y="ArrayBuffer";r(r.G+r.W+r.F*(f!==l),{ArrayBuffer:l}),r(r.S+r.F*!i.CONSTR,y,{isView:function(t){return d&&d(t)||c(t)&&v in t}}),r(r.P+r.U+r.F*n(7)(function(){return!new l(2).slice(1,void 0).byteLength}),y,{slice:function(t,e){if(void 0!==g&&void 0===e)return g.call(s(this),t);for(var n=s(this).byteLength,r=a(t,n),i=a(void 0===e?n:e,n),o=new(h(this,l))(u(i-r)),c=new p(this),f=new p(o),d=0;r<i;)f.setUint8(d++,c.getUint8(r++));return o}}),n(193)(y)},function(t,e,n){for(var r,i=n(4),o=n(10),s=n(19),a=s("typed_array"),u=s("view"),c=!(!i.ArrayBuffer||!i.DataView),f=c,h=0,l=9,p="Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array".split(",");h<l;)(r=i[p[h++]])?(o(r.prototype,a,!0),o(r.prototype,u,!0)):f=!1;t.exports={ABV:c,CONSTR:f,TYPED:a,VIEW:u}},function(t,e,n){"use strict";function r(t,e,n){var r,i,o,s=new Array(n),a=8*n-e-1,u=(1<<a)-1,c=u>>1,f=23===e?U(2,-24)-U(2,-77):0,h=0,l=t<0||0===t&&1/t<0?1:0;for(t=H(t),t!=t||t===M?(i=t!=t?1:0,r=u):(r=V(K(t)/q),t*(o=U(2,-r))<1&&(r--,o*=2),t+=r+c>=1?f/o:f*U(2,1-c),t*o>=2&&(r++,o/=2),r+c>=u?(i=0,r=u):r+c>=1?(i=(t*o-1)*U(2,e),r+=c):(i=t*U(2,c-1)*U(2,e),r=0));e>=8;s[h++]=255&i,i/=256,e-=8);for(r=r<<e|i,a+=e;a>0;s[h++]=255&r,r/=256,a-=8);return s[--h]|=128*l,s}function i(t,e,n){var r,i=8*n-e-1,o=(1<<i)-1,s=o>>1,a=i-7,u=n-1,c=t[u--],f=127&c;for(c>>=7;a>0;f=256*f+t[u],u--,a-=8);for(r=f&(1<<-a)-1,f>>=-a,a+=e;a>0;r=256*r+t[u],u--,a-=8);if(0===f)f=1-s;else{if(f===o)return r?NaN:c?-M:M;r+=U(2,e),f-=s}return(c?-1:1)*r*U(2,f-e)}function o(t){return t[3]<<24|t[2]<<16|t[1]<<8|t[0]}function s(t){return[255&t]}function a(t){return[255&t,t>>8&255]}function u(t){return[255&t,t>>8&255,t>>16&255,t>>24&255]}function c(t){return r(t,52,8)}function f(t){return r(t,23,4)}function h(t,e,n){A(t[R],e,{get:function(){return this[n]}})}function l(t,e,n,r){var i=+n,o=x(i);if(o+e>t[Y])throw L(D);var s=t[z]._b,a=o+t[$],u=s.slice(a,a+e);return r?u:u.reverse()}function p(t,e,n,r,i,o){var s=+n,a=x(s);if(a+e>t[Y])throw L(D);for(var u=t[z]._b,c=a+t[$],f=r(+i),h=0;h<e;h++)u[c+h]=f[o?h:e-h-1]}var d=n(4),g=n(6),v=n(28),y=n(224),m=n(10),S=n(214),b=n(7),F=n(206),w=n(38),_=n(37),x=n(226),E=n(49).f,A=n(11).f,P=n(189),C=n(24),k="ArrayBuffer",T="DataView",R="prototype",I="Wrong length!",D="Wrong index!",N=d[k],O=d[T],j=d.Math,L=d.RangeError,M=d.Infinity,B=N,H=j.abs,U=j.pow,V=j.floor,K=j.log,q=j.LN2,W="buffer",J="byteLength",G="byteOffset",z=g?"_b":W,Y=g?"_l":J,$=g?"_o":G;if(y.ABV){if(!b(function(){N(1)})||!b(function(){new N(-1)})||b(function(){return new N,new N(1.5),new N(NaN),N.name!=k})){N=function(t){return F(this,N),new B(x(t))};for(var X,Z=N[R]=B[R],Q=E(B),tt=0;Q.length>tt;)(X=Q[tt++])in N||m(N,X,B[X]);v||(Z.constructor=N)}var et=new O(new N(2)),nt=O[R].setInt8;et.setInt8(0,2147483648),et.setInt8(1,2147483649),!et.getInt8(0)&&et.getInt8(1)||S(O[R],{setInt8:function(t,e){nt.call(this,t,e<<24>>24)},setUint8:function(t,e){nt.call(this,t,e<<24>>24)}},!0)}else N=function(t){F(this,N,k);var e=x(t);this._b=P.call(new Array(e),0),this[Y]=e},O=function(t,e,n){F(this,O,T),F(t,N,T);var r=t[Y],i=w(e);if(i<0||i>r)throw L("Wrong offset!");if(n=void 0===n?r-i:_(n),i+n>r)throw L(I);this[z]=t,this[$]=i,this[Y]=n},g&&(h(N,J,"_l"),h(O,W,"_b"),h(O,J,"_l"),h(O,G,"_o")),S(O[R],{getInt8:function(t){return l(this,1,t)[0]<<24>>24},getUint8:function(t){return l(this,1,t)[0]},getInt16:function(t){var e=l(this,2,t,arguments[1]);return(e[1]<<8|e[0])<<16>>16},getUint16:function(t){var e=l(this,2,t,arguments[1]);return e[1]<<8|e[0]},getInt32:function(t){return o(l(this,4,t,arguments[1]))},getUint32:function(t){return o(l(this,4,t,arguments[1]))>>>0},getFloat32:function(t){return i(l(this,4,t,arguments[1]),23,4)},getFloat64:function(t){return i(l(this,8,t,arguments[1]),52,8)},setInt8:function(t,e){p(this,1,t,s,e)},setUint8:function(t,e){p(this,1,t,s,e)},setInt16:function(t,e){p(this,2,t,a,e,arguments[2])},setUint16:function(t,e){p(this,2,t,a,e,arguments[2])},setInt32:function(t,e){p(this,4,t,u,e,arguments[2])},setUint32:function(t,e){p(this,4,t,u,e,arguments[2])},setFloat32:function(t,e){p(this,4,t,f,e,arguments[2])},setFloat64:function(t,e){p(this,8,t,c,e,arguments[2])}});C(N,k),C(O,T),m(O[R],y.VIEW,!0),e[k]=N,e[T]=O},function(t,e,n){var r=n(38),i=n(37);t.exports=function(t){if(void 0===t)return 0;var e=r(t),n=i(e);if(e!==n)throw RangeError("Wrong length!");return n}},function(t,e,n){var r=n(8);r(r.G+r.W+r.F*!n(224).ABV,{DataView:n(225).DataView})},function(t,e,n){n(229)("Int8",1,function(t){return function(e,n,r){return t(this,e,n,r)}})},function(t,e,n){"use strict";if(n(6)){var r=n(28),i=n(4),o=n(7),s=n(8),a=n(224),u=n(225),c=n(20),f=n(206),h=n(17),l=n(10),p=n(214),d=n(38),g=n(37),v=n(226),y=n(39),m=n(16),S=n(5),b=n(74),F=n(13),w=n(57),_=n(163),x=n(45),E=n(58),A=n(49).f,P=n(165),C=n(19),k=n(25),T=n(173),R=n(36),I=n(208),D=n(194),N=n(129),O=n(166),j=n(193),L=n(189),M=n(186),B=n(11),H=n(50),U=B.f,V=H.f,K=i.RangeError,q=i.TypeError,W=i.Uint8Array,J="ArrayBuffer",G="Shared"+J,z="BYTES_PER_ELEMENT",Y="prototype",$=Array[Y],X=u.ArrayBuffer,Z=u.DataView,Q=T(0),tt=T(2),et=T(3),nt=T(4),rt=T(5),it=T(6),ot=R(!0),st=R(!1),at=D.values,ut=D.keys,ct=D.entries,ft=$.lastIndexOf,ht=$.reduce,lt=$.reduceRight,pt=$.join,dt=$.sort,gt=$.slice,vt=$.toString,yt=$.toLocaleString,mt=k("iterator"),St=k("toStringTag"),bt=C("typed_constructor"),Ft=C("def_constructor"),wt=a.CONSTR,_t=a.TYPED,xt=a.VIEW,Et="Wrong length!",At=T(1,function(t,e){return Rt(I(t,t[Ft]),e)}),Pt=o(function(){return 1===new W(new Uint16Array([1]).buffer)[0]}),Ct=!!W&&!!W[Y].set&&o(function(){new W(1).set({})}),kt=function(t,e){var n=d(t);if(n<0||n%e)throw K("Wrong offset!");return n},Tt=function(t){if(F(t)&&_t in t)return t;throw q(t+" is not a typed array!")},Rt=function(t,e){if(!(F(t)&&bt in t))throw q("It is not a typed array constructor!");return new t(e)},It=function(t,e){return Dt(I(t,t[Ft]),e)},Dt=function(t,e){for(var n=0,r=e.length,i=Rt(t,r);r>n;)i[n]=e[n++];return i},Nt=function(t,e,n){U(t,e,{get:function(){return this._d[n]}})},Ot=function(t){var e,n,r,i,o,s,a=w(t),u=arguments.length,f=u>1?arguments[1]:void 0,h=void 0!==f,l=P(a);if(void 0!=l&&!_(l)){for(s=l.call(a),r=[],e=0;!(o=s.next()).done;e++)r.push(o.value);a=r}for(h&&u>2&&(f=c(f,arguments[2],2)),e=0,n=g(a.length),i=Rt(this,n);n>e;e++)i[e]=h?f(a[e],e):a[e];return i},jt=function(){for(var t=0,e=arguments.length,n=Rt(this,e);e>t;)n[t]=arguments[t++];return n},Lt=!!W&&o(function(){yt.call(new W(1))}),Mt=function(){return yt.apply(Lt?gt.call(Tt(this)):Tt(this),arguments)},Bt={copyWithin:function(t,e){return M.call(Tt(this),t,e,arguments.length>2?arguments[2]:void 0)},every:function(t){return nt(Tt(this),t,arguments.length>1?arguments[1]:void 0)},fill:function(t){return L.apply(Tt(this),arguments)},filter:function(t){return It(this,tt(Tt(this),t,arguments.length>1?arguments[1]:void 0))},find:function(t){return rt(Tt(this),t,arguments.length>1?arguments[1]:void 0)},findIndex:function(t){return it(Tt(this),t,arguments.length>1?arguments[1]:void 0)},forEach:function(t){Q(Tt(this),t,arguments.length>1?arguments[1]:void 0)},indexOf:function(t){return st(Tt(this),t,arguments.length>1?arguments[1]:void 0)},includes:function(t){return ot(Tt(this),t,arguments.length>1?arguments[1]:void 0)},join:function(t){return pt.apply(Tt(this),arguments)},lastIndexOf:function(t){return ft.apply(Tt(this),arguments)},map:function(t){return At(Tt(this),t,arguments.length>1?arguments[1]:void 0)},reduce:function(t){return ht.apply(Tt(this),arguments)},reduceRight:function(t){return lt.apply(Tt(this),arguments)},reverse:function(){for(var t,e=this,n=Tt(e).length,r=Math.floor(n/2),i=0;i<r;)t=e[i],e[i++]=e[--n],e[n]=t;return e},some:function(t){return et(Tt(this),t,arguments.length>1?arguments[1]:void 0)},sort:function(t){return dt.call(Tt(this),t)},subarray:function(t,e){var n=Tt(this),r=n.length,i=y(t,r);return new(I(n,n[Ft]))(n.buffer,n.byteOffset+i*n.BYTES_PER_ELEMENT,g((void 0===e?r:y(e,r))-i))}},Ht=function(t,e){return It(this,gt.call(Tt(this),t,e))},Ut=function(t){Tt(this);var e=kt(arguments[1],1),n=this.length,r=w(t),i=g(r.length),o=0;if(i+e>n)throw K(Et);for(;o<i;)this[e+o]=r[o++]},Vt={entries:function(){return ct.call(Tt(this))},keys:function(){return ut.call(Tt(this))},values:function(){return at.call(Tt(this))}},Kt=function(t,e){return F(t)&&t[_t]&&"symbol"!=typeof e&&e in t&&String(+e)==String(e)},qt=function(t,e){return Kt(t,e=m(e,!0))?h(2,t[e]):V(t,e)},Wt=function(t,e,n){return!(Kt(t,e=m(e,!0))&&F(n)&&S(n,"value"))||S(n,"get")||S(n,"set")||n.configurable||S(n,"writable")&&!n.writable||S(n,"enumerable")&&!n.enumerable?U(t,e,n):(t[e]=n.value,t)};wt||(H.f=qt,B.f=Wt),s(s.S+s.F*!wt,"Object",{getOwnPropertyDescriptor:qt,defineProperty:Wt}),o(function(){vt.call({})})&&(vt=yt=function(){return pt.call(this)});var Jt=p({},Bt);p(Jt,Vt),l(Jt,mt,Vt.values),p(Jt,{slice:Ht,set:Ut,constructor:function(){},toString:vt,toLocaleString:Mt}),Nt(Jt,"buffer","b"),Nt(Jt,"byteOffset","o"),Nt(Jt,"byteLength","l"),Nt(Jt,"length","e"),U(Jt,St,{get:function(){return this[_t]}}),t.exports=function(t,e,n,u){u=!!u;var c=t+(u?"Clamped":"")+"Array",h="get"+t,p="set"+t,d=i[c],y=d||{},m=d&&E(d),S=!d||!a.ABV,w={},_=d&&d[Y],P=function(t,n){var r=t._d;return r.v[h](n*e+r.o,Pt)},C=function(t,n,r){var i=t._d;u&&(r=(r=Math.round(r))<0?0:r>255?255:255&r),i.v[p](n*e+i.o,r,Pt)},k=function(t,e){U(t,e,{get:function(){return P(this,e)},set:function(t){
return C(this,e,t)},enumerable:!0})};S?(d=n(function(t,n,r,i){f(t,d,c,"_d");var o,s,a,u,h=0,p=0;if(F(n)){if(!(n instanceof X||(u=b(n))==J||u==G))return _t in n?Dt(d,n):Ot.call(d,n);o=n,p=kt(r,e);var y=n.byteLength;if(void 0===i){if(y%e)throw K(Et);if(s=y-p,s<0)throw K(Et)}else if(s=g(i)*e,s+p>y)throw K(Et);a=s/e}else a=v(n),s=a*e,o=new X(s);for(l(t,"_d",{b:o,o:p,l:s,e:a,v:new Z(o)});h<a;)k(t,h++)}),_=d[Y]=x(Jt),l(_,"constructor",d)):o(function(){d(1)})&&o(function(){new d(-1)})&&O(function(t){new d,new d(null),new d(1.5),new d(t)},!0)||(d=n(function(t,n,r,i){f(t,d,c);var o;return F(n)?n instanceof X||(o=b(n))==J||o==G?void 0!==i?new y(n,kt(r,e),i):void 0!==r?new y(n,kt(r,e)):new y(n):_t in n?Dt(d,n):Ot.call(d,n):new y(v(n))}),Q(m!==Function.prototype?A(y).concat(A(m)):A(y),function(t){t in d||l(d,t,y[t])}),d[Y]=_,r||(_.constructor=d));var T=_[mt],R=!!T&&("values"==T.name||void 0==T.name),I=Vt.values;l(d,bt,!0),l(_,_t,c),l(_,xt,!0),l(_,Ft,d),(u?new d(1)[St]==c:St in _)||U(_,St,{get:function(){return c}}),w[c]=d,s(s.G+s.W+s.F*(d!=y),w),s(s.S,c,{BYTES_PER_ELEMENT:e}),s(s.S+s.F*o(function(){y.of.call(d,1)}),c,{from:Ot,of:jt}),z in _||l(_,z,e),s(s.P,c,Bt),j(c),s(s.P+s.F*Ct,c,{set:Ut}),s(s.P+s.F*!R,c,Vt),r||_.toString==vt||(_.toString=vt),s(s.P+s.F*o(function(){new d(1).slice()}),c,{slice:Ht}),s(s.P+s.F*(o(function(){return[1,2].toLocaleString()!=new d([1,2]).toLocaleString()})||!o(function(){_.toLocaleString.call([1,2])})),c,{toLocaleString:Mt}),N[c]=R?T:I,r||R||l(_,mt,I)}}else t.exports=function(){}},function(t,e,n){n(229)("Uint8",1,function(t){return function(e,n,r){return t(this,e,n,r)}})},function(t,e,n){n(229)("Uint8",1,function(t){return function(e,n,r){return t(this,e,n,r)}},!0)},function(t,e,n){n(229)("Int16",2,function(t){return function(e,n,r){return t(this,e,n,r)}})},function(t,e,n){n(229)("Uint16",2,function(t){return function(e,n,r){return t(this,e,n,r)}})},function(t,e,n){n(229)("Int32",4,function(t){return function(e,n,r){return t(this,e,n,r)}})},function(t,e,n){n(229)("Uint32",4,function(t){return function(e,n,r){return t(this,e,n,r)}})},function(t,e,n){n(229)("Float32",4,function(t){return function(e,n,r){return t(this,e,n,r)}})},function(t,e,n){n(229)("Float64",8,function(t){return function(e,n,r){return t(this,e,n,r)}})},function(t,e,n){var r=n(8),i=n(21),o=n(12),s=(n(4).Reflect||{}).apply,a=Function.apply;r(r.S+r.F*!n(7)(function(){s(function(){})}),"Reflect",{apply:function(t,e,n){var r=i(t),u=o(n);return s?s(r,e,u):a.call(r,e,u)}})},function(t,e,n){var r=n(8),i=n(45),o=n(21),s=n(12),a=n(13),u=n(7),c=n(76),f=(n(4).Reflect||{}).construct,h=u(function(){function t(){}return!(f(function(){},[],t)instanceof t)}),l=!u(function(){f(function(){})});r(r.S+r.F*(h||l),"Reflect",{construct:function(t,e){o(t),s(e);var n=arguments.length<3?t:o(arguments[2]);if(l&&!h)return f(t,e,n);if(t==n){switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3])}var r=[null];return r.push.apply(r,e),new(c.apply(t,r))}var u=n.prototype,p=i(a(u)?u:Object.prototype),d=Function.apply.call(t,p,e);return a(d)?d:p}})},function(t,e,n){var r=n(11),i=n(8),o=n(12),s=n(16);i(i.S+i.F*n(7)(function(){Reflect.defineProperty(r.f({},1,{value:1}),1,{value:2})}),"Reflect",{defineProperty:function(t,e,n){o(t),e=s(e,!0),o(n);try{return r.f(t,e,n),!0}catch(t){return!1}}})},function(t,e,n){var r=n(8),i=n(50).f,o=n(12);r(r.S,"Reflect",{deleteProperty:function(t,e){var n=i(o(t),e);return!(n&&!n.configurable)&&delete t[e]}})},function(t,e,n){"use strict";var r=n(8),i=n(12),o=function(t){this._t=i(t),this._i=0;var e,n=this._k=[];for(e in t)n.push(e)};n(130)(o,"Object",function(){var t,e=this,n=e._k;do if(e._i>=n.length)return{value:void 0,done:!0};while(!((t=n[e._i++])in e._t));return{value:t,done:!1}}),r(r.S,"Reflect",{enumerate:function(t){return new o(t)}})},function(t,e,n){function r(t,e){var n,a,f=arguments.length<3?t:arguments[2];return c(t)===f?t[e]:(n=i.f(t,e))?s(n,"value")?n.value:void 0!==n.get?n.get.call(f):void 0:u(a=o(t))?r(a,e,f):void 0}var i=n(50),o=n(58),s=n(5),a=n(8),u=n(13),c=n(12);a(a.S,"Reflect",{get:r})},function(t,e,n){var r=n(50),i=n(8),o=n(12);i(i.S,"Reflect",{getOwnPropertyDescriptor:function(t,e){return r.f(o(t),e)}})},function(t,e,n){var r=n(8),i=n(58),o=n(12);r(r.S,"Reflect",{getPrototypeOf:function(t){return i(o(t))}})},function(t,e,n){var r=n(8);r(r.S,"Reflect",{has:function(t,e){return e in t}})},function(t,e,n){var r=n(8),i=n(12),o=Object.isExtensible;r(r.S,"Reflect",{isExtensible:function(t){return i(t),!o||o(t)}})},function(t,e,n){var r=n(8);r(r.S,"Reflect",{ownKeys:n(249)})},function(t,e,n){var r=n(49),i=n(42),o=n(12),s=n(4).Reflect;t.exports=s&&s.ownKeys||function(t){var e=r.f(o(t)),n=i.f;return n?e.concat(n(t)):e}},function(t,e,n){var r=n(8),i=n(12),o=Object.preventExtensions;r(r.S,"Reflect",{preventExtensions:function(t){i(t);try{return o&&o(t),!0}catch(t){return!1}}})},function(t,e,n){function r(t,e,n){var u,l,p=arguments.length<4?t:arguments[3],d=o.f(f(t),e);if(!d){if(h(l=s(t)))return r(l,e,n,p);d=c(0)}if(a(d,"value")){if(d.writable===!1||!h(p))return!1;if(u=o.f(p,e)){if(u.get||u.set||u.writable===!1)return!1;u.value=n,i.f(p,e,u)}else i.f(p,e,c(0,n));return!0}return void 0!==d.set&&(d.set.call(p,n),!0)}var i=n(11),o=n(50),s=n(58),a=n(5),u=n(8),c=n(17),f=n(12),h=n(13);u(u.S,"Reflect",{set:r})},function(t,e,n){var r=n(8),i=n(72);i&&r(r.S,"Reflect",{setPrototypeOf:function(t,e){i.check(t,e);try{return i.set(t,e),!0}catch(t){return!1}}})},function(t,e,n){"use strict";var r=n(8),i=n(36)(!0);r(r.P,"Array",{includes:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}}),n(187)("includes")},function(t,e,n){"use strict";var r=n(8),i=n(255),o=n(57),s=n(37),a=n(21),u=n(174);r(r.P,"Array",{flatMap:function(t){var e,n,r=o(this);return a(t),e=s(r.length),n=u(r,0),i(n,r,r,e,0,1,t,arguments[1]),n}}),n(187)("flatMap")},function(t,e,n){"use strict";function r(t,e,n,c,f,h,l,p){for(var d,g,v=f,y=0,m=!!l&&a(l,p,3);y<c;){if(y in n){if(d=m?m(n[y],y,e):n[y],g=!1,o(d)&&(g=d[u],g=void 0!==g?!!g:i(d)),g&&h>0)v=r(t,e,d,s(d.length),v,h-1)-1;else{if(v>=9007199254740991)throw TypeError();t[v]=d}v++}y++}return v}var i=n(44),o=n(13),s=n(37),a=n(20),u=n(25)("isConcatSpreadable");t.exports=r},function(t,e,n){"use strict";var r=n(8),i=n(255),o=n(57),s=n(37),a=n(38),u=n(174);r(r.P,"Array",{flatten:function(){var t=arguments[0],e=o(this),n=s(e.length),r=u(e,0);return i(r,e,e,n,0,void 0===t?1:a(t)),r}}),n(187)("flatten")},function(t,e,n){"use strict";var r=n(8),i=n(127)(!0);r(r.P,"String",{at:function(t){return i(this,t)}})},function(t,e,n){"use strict";var r=n(8),i=n(259),o=n(260);r(r.P+r.F*/Version\/10\.\d+(\.\d+)? Safari\//.test(o),"String",{padStart:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0,!0)}})},function(t,e,n){var r=n(37),i=n(90),o=n(35);t.exports=function(t,e,n,s){var a=String(o(t)),u=a.length,c=void 0===n?" ":String(n),f=r(e);if(f<=u||""==c)return a;var h=f-u,l=i.call(c,Math.ceil(h/c.length));return l.length>h&&(l=l.slice(0,h)),s?l+a:a+l}},function(t,e,n){var r=n(4),i=r.navigator;t.exports=i&&i.userAgent||""},function(t,e,n){"use strict";var r=n(8),i=n(259),o=n(260);r(r.P+r.F*/Version\/10\.\d+(\.\d+)? Safari\//.test(o),"String",{padEnd:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0,!1)}})},function(t,e,n){"use strict";n(82)("trimLeft",function(t){return function(){return t(this,1)}},"trimStart")},function(t,e,n){"use strict";n(82)("trimRight",function(t){return function(){return t(this,2)}},"trimEnd")},function(t,e,n){"use strict";var r=n(8),i=n(35),o=n(37),s=n(134),a=n(197),u=RegExp.prototype,c=function(t,e){this._r=t,this._s=e};n(130)(c,"RegExp String",function(){var t=this._r.exec(this._s);return{value:t,done:null===t}}),r(r.P,"String",{matchAll:function(t){if(i(this),!s(t))throw TypeError(t+" is not a regexp!");var e=String(this),n="flags"in u?String(t.flags):a.call(t),r=new RegExp(t.source,~n.indexOf("g")?n:"g"+n);return r.lastIndex=o(t.lastIndex),new c(r,e)}})},function(t,e,n){n(27)("asyncIterator")},function(t,e,n){n(27)("observable")},function(t,e,n){var r=n(8),i=n(249),o=n(32),s=n(50),a=n(164);r(r.S,"Object",{getOwnPropertyDescriptors:function(t){for(var e,n,r=o(t),u=s.f,c=i(r),f={},h=0;c.length>h;)n=u(r,e=c[h++]),void 0!==n&&a(f,e,n);return f}})},function(t,e,n){var r=n(8),i=n(269)(!1);r(r.S,"Object",{values:function(t){return i(t)}})},function(t,e,n){var r=n(30),i=n(32),o=n(43).f;t.exports=function(t){return function(e){for(var n,s=i(e),a=r(s),u=a.length,c=0,f=[];u>c;)o.call(s,n=a[c++])&&f.push(t?[n,s[n]]:s[n]);return f}}},function(t,e,n){var r=n(8),i=n(269)(!0);r(r.S,"Object",{entries:function(t){return i(t)}})},function(t,e,n){"use strict";var r=n(8),i=n(57),o=n(21),s=n(11);n(6)&&r(r.P+n(272),"Object",{__defineGetter__:function(t,e){s.f(i(this),t,{get:o(e),enumerable:!0,configurable:!0})}})},function(t,e,n){"use strict";t.exports=n(28)||!n(7)(function(){var t=Math.random();__defineSetter__.call(null,t,function(){}),delete n(4)[t]})},function(t,e,n){"use strict";var r=n(8),i=n(57),o=n(21),s=n(11);n(6)&&r(r.P+n(272),"Object",{__defineSetter__:function(t,e){s.f(i(this),t,{set:o(e),enumerable:!0,configurable:!0})}})},function(t,e,n){"use strict";var r=n(8),i=n(57),o=n(16),s=n(58),a=n(50).f;n(6)&&r(r.P+n(272),"Object",{__lookupGetter__:function(t){var e,n=i(this),r=o(t,!0);do if(e=a(n,r))return e.get;while(n=s(n))}})},function(t,e,n){"use strict";var r=n(8),i=n(57),o=n(16),s=n(58),a=n(50).f;n(6)&&r(r.P+n(272),"Object",{__lookupSetter__:function(t){var e,n=i(this),r=o(t,!0);do if(e=a(n,r))return e.set;while(n=s(n))}})},function(t,e,n){var r=n(8);r(r.P+r.R,"Map",{toJSON:n(277)("Map")})},function(t,e,n){var r=n(74),i=n(278);t.exports=function(t){return function(){if(r(this)!=t)throw TypeError(t+"#toJSON isn't generic");return i(this)}}},function(t,e,n){var r=n(207);t.exports=function(t,e){var n=[];return r(t,!1,n.push,n,e),n}},function(t,e,n){var r=n(8);r(r.P+r.R,"Set",{toJSON:n(277)("Set")})},function(t,e,n){n(281)("Map")},function(t,e,n){"use strict";var r=n(8);t.exports=function(t){r(r.S,t,{of:function(){for(var t=arguments.length,e=new Array(t);t--;)e[t]=arguments[t];return new this(e)}})}},function(t,e,n){n(281)("Set")},function(t,e,n){n(281)("WeakMap")},function(t,e,n){n(281)("WeakSet")},function(t,e,n){n(286)("Map")},function(t,e,n){"use strict";var r=n(8),i=n(21),o=n(20),s=n(207);t.exports=function(t){r(r.S,t,{from:function(t){var e,n,r,a,u=arguments[1];return i(this),e=void 0!==u,e&&i(u),void 0==t?new this:(n=[],e?(r=0,a=o(u,arguments[2],2),s(t,!1,function(t){n.push(a(t,r++))})):s(t,!1,n.push,n),new this(n))}})}},function(t,e,n){n(286)("Set")},function(t,e,n){n(286)("WeakMap")},function(t,e,n){n(286)("WeakSet")},function(t,e,n){var r=n(8);r(r.G,{global:n(4)})},function(t,e,n){var r=n(8);r(r.S,"System",{global:n(4)})},function(t,e,n){var r=n(8),i=n(34);r(r.S,"Error",{isError:function(t){return"Error"===i(t)}})},function(t,e,n){var r=n(8);r(r.S,"Math",{clamp:function(t,e,n){return Math.min(n,Math.max(e,t))}})},function(t,e,n){var r=n(8);r(r.S,"Math",{DEG_PER_RAD:Math.PI/180})},function(t,e,n){var r=n(8),i=180/Math.PI;r(r.S,"Math",{degrees:function(t){return t*i}})},function(t,e,n){var r=n(8),i=n(297),o=n(113);r(r.S,"Math",{fscale:function(t,e,n,r,s){return o(i(t,e,n,r,s))}})},function(t,e){t.exports=Math.scale||function(t,e,n,r,i){return 0===arguments.length||t!=t||e!=e||n!=n||r!=r||i!=i?NaN:t===1/0||t===-(1/0)?t:(t-e)*(i-r)/(n-e)+r}},function(t,e,n){var r=n(8);r(r.S,"Math",{iaddh:function(t,e,n,r){var i=t>>>0,o=e>>>0,s=n>>>0;return o+(r>>>0)+((i&s|(i|s)&~(i+s>>>0))>>>31)|0}})},function(t,e,n){var r=n(8);r(r.S,"Math",{isubh:function(t,e,n,r){var i=t>>>0,o=e>>>0,s=n>>>0;return o-(r>>>0)-((~i&s|~(i^s)&i-s>>>0)>>>31)|0}})},function(t,e,n){var r=n(8);r(r.S,"Math",{imulh:function(t,e){var n=65535,r=+t,i=+e,o=r&n,s=i&n,a=r>>16,u=i>>16,c=(a*s>>>0)+(o*s>>>16);return a*u+(c>>16)+((o*u>>>0)+(c&n)>>16)}})},function(t,e,n){var r=n(8);r(r.S,"Math",{RAD_PER_DEG:180/Math.PI})},function(t,e,n){var r=n(8),i=Math.PI/180;r(r.S,"Math",{radians:function(t){return t*i}})},function(t,e,n){var r=n(8);r(r.S,"Math",{scale:n(297)})},function(t,e,n){var r=n(8);r(r.S,"Math",{umulh:function(t,e){var n=65535,r=+t,i=+e,o=r&n,s=i&n,a=r>>>16,u=i>>>16,c=(a*s>>>0)+(o*s>>>16);return a*u+(c>>>16)+((o*u>>>0)+(c&n)>>>16)}})},function(t,e,n){var r=n(8);r(r.S,"Math",{signbit:function(t){return(t=+t)!=t?t:0==t?1/t==1/0:t>0}})},function(t,e,n){"use strict";var r=n(8),i=n(9),o=n(4),s=n(208),a=n(213);r(r.P+r.R,"Promise",{finally:function(t){var e=s(this,i.Promise||o.Promise),n="function"==typeof t;return this.then(n?function(n){return a(e,t()).then(function(){return n})}:t,n?function(n){return a(e,t()).then(function(){throw n})}:t)}})},function(t,e,n){"use strict";var r=n(8),i=n(211),o=n(212);r(r.S,"Promise",{try:function(t){var e=i.f(this),n=o(t);return(n.e?e.reject:e.resolve)(n.v),e.promise}})},function(t,e,n){var r=n(309),i=n(12),o=r.key,s=r.set;r.exp({defineMetadata:function(t,e,n,r){s(t,e,i(n),o(r))}})},function(t,e,n){var r=n(215),i=n(8),o=n(23)("metadata"),s=o.store||(o.store=new(n(220))),a=function(t,e,n){var i=s.get(t);if(!i){if(!n)return;s.set(t,i=new r)}var o=i.get(e);if(!o){if(!n)return;i.set(e,o=new r)}return o},u=function(t,e,n){var r=a(e,n,!1);return void 0!==r&&r.has(t)},c=function(t,e,n){var r=a(e,n,!1);return void 0===r?void 0:r.get(t)},f=function(t,e,n,r){a(n,r,!0).set(t,e)},h=function(t,e){var n=a(t,e,!1),r=[];return n&&n.forEach(function(t,e){r.push(e)}),r},l=function(t){return void 0===t||"symbol"==typeof t?t:String(t)},p=function(t){i(i.S,"Reflect",t)};t.exports={store:s,map:a,has:u,get:c,set:f,keys:h,key:l,exp:p}},function(t,e,n){var r=n(309),i=n(12),o=r.key,s=r.map,a=r.store;r.exp({deleteMetadata:function(t,e){var n=arguments.length<3?void 0:o(arguments[2]),r=s(i(e),n,!1);if(void 0===r||!r.delete(t))return!1;if(r.size)return!0;var u=a.get(e);return u.delete(n),!!u.size||a.delete(e)}})},function(t,e,n){var r=n(309),i=n(12),o=n(58),s=r.has,a=r.get,u=r.key,c=function(t,e,n){var r=s(t,e,n);if(r)return a(t,e,n);var i=o(e);return null!==i?c(t,i,n):void 0};r.exp({getMetadata:function(t,e){return c(t,i(e),arguments.length<3?void 0:u(arguments[2]))}})},function(t,e,n){var r=n(219),i=n(278),o=n(309),s=n(12),a=n(58),u=o.keys,c=o.key,f=function(t,e){var n=u(t,e),o=a(t);if(null===o)return n;var s=f(o,e);return s.length?n.length?i(new r(n.concat(s))):s:n};o.exp({getMetadataKeys:function(t){return f(s(t),arguments.length<2?void 0:c(arguments[1]))}})},function(t,e,n){var r=n(309),i=n(12),o=r.get,s=r.key;r.exp({getOwnMetadata:function(t,e){return o(t,i(e),arguments.length<3?void 0:s(arguments[2]))}})},function(t,e,n){var r=n(309),i=n(12),o=r.keys,s=r.key;r.exp({getOwnMetadataKeys:function(t){return o(i(t),arguments.length<2?void 0:s(arguments[1]))}})},function(t,e,n){var r=n(309),i=n(12),o=n(58),s=r.has,a=r.key,u=function(t,e,n){var r=s(t,e,n);if(r)return!0;var i=o(e);return null!==i&&u(t,i,n)};r.exp({hasMetadata:function(t,e){return u(t,i(e),arguments.length<3?void 0:a(arguments[2]))}})},function(t,e,n){var r=n(309),i=n(12),o=r.has,s=r.key;r.exp({hasOwnMetadata:function(t,e){return o(t,i(e),arguments.length<3?void 0:s(arguments[2]))}})},function(t,e,n){var r=n(309),i=n(12),o=n(21),s=r.key,a=r.set;r.exp({metadata:function(t,e){return function(n,r){a(t,e,(void 0!==r?i:o)(n),s(r))}}})},function(t,e,n){var r=n(8),i=n(210)(),o=n(4).process,s="process"==n(34)(o);r(r.G,{asap:function(t){var e=s&&o.domain;i(e?e.bind(t):t)}})},function(t,e,n){"use strict";var r=n(8),i=n(4),o=n(9),s=n(210)(),a=n(25)("observable"),u=n(21),c=n(12),f=n(206),h=n(214),l=n(10),p=n(207),d=p.RETURN,g=function(t){return null==t?void 0:u(t)},v=function(t){var e=t._c;e&&(t._c=void 0,e())},y=function(t){return void 0===t._o},m=function(t){y(t)||(t._o=void 0,v(t))},S=function(t,e){c(t),this._c=void 0,this._o=t,t=new b(this);try{var n=e(t),r=n;null!=n&&("function"==typeof n.unsubscribe?n=function(){r.unsubscribe()}:u(n),this._c=n)}catch(e){return void t.error(e)}y(this)&&v(this)};S.prototype=h({},{unsubscribe:function(){m(this)}});var b=function(t){this._s=t};b.prototype=h({},{next:function(t){var e=this._s;if(!y(e)){var n=e._o;try{var r=g(n.next);if(r)return r.call(n,t)}catch(t){try{m(e)}finally{throw t}}}},error:function(t){var e=this._s;if(y(e))throw t;var n=e._o;e._o=void 0;try{var r=g(n.error);if(!r)throw t;t=r.call(n,t)}catch(t){try{v(e)}finally{throw t}}return v(e),t},complete:function(t){var e=this._s;if(!y(e)){var n=e._o;e._o=void 0;try{var r=g(n.complete);t=r?r.call(n,t):void 0}catch(t){try{v(e)}finally{throw t}}return v(e),t}}});var F=function(t){f(this,F,"Observable","_f")._f=u(t)};h(F.prototype,{subscribe:function(t){return new S(t,this._f)},forEach:function(t){var e=this;return new(o.Promise||i.Promise)(function(n,r){u(t);var i=e.subscribe({next:function(e){try{return t(e)}catch(t){r(t),i.unsubscribe()}},error:r,complete:n})})}}),h(F,{from:function(t){var e="function"==typeof this?this:F,n=g(c(t)[a]);if(n){var r=c(n.call(t));return r.constructor===e?r:new e(function(t){return r.subscribe(t)})}return new e(function(e){var n=!1;return s(function(){if(!n){try{if(p(t,!1,function(t){if(e.next(t),n)return d})===d)return}catch(t){if(n)throw t;return void e.error(t)}e.complete()}}),function(){n=!0}})},of:function(){for(var t=0,e=arguments.length,n=new Array(e);t<e;)n[t]=arguments[t++];return new("function"==typeof this?this:F)(function(t){var e=!1;return s(function(){if(!e){for(var r=0;r<n.length;++r)if(t.next(n[r]),e)return;t.complete()}}),function(){e=!0}})}}),l(F.prototype,a,function(){return this}),r(r.G,{Observable:F}),n(193)("Observable")},function(t,e,n){var r=n(4),i=n(8),o=n(260),s=[].slice,a=/MSIE .\./.test(o),u=function(t){return function(e,n){var r=arguments.length>2,i=!!r&&s.call(arguments,2);return t(r?function(){("function"==typeof e?e:Function(e)).apply(this,i)}:e,n)}};i(i.G+i.B+i.F*a,{setTimeout:u(r.setTimeout),setInterval:u(r.setInterval)})},function(t,e,n){var r=n(8),i=n(209);r(r.G+r.B,{setImmediate:i.set,clearImmediate:i.clear})},function(t,e,n){for(var r=n(194),i=n(30),o=n(18),s=n(4),a=n(10),u=n(129),c=n(25),f=c("iterator"),h=c("toStringTag"),l=u.Array,p={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},d=i(p),g=0;g<d.length;g++){var v,y=d[g],m=p[y],S=s[y],b=S&&S.prototype;if(b&&(b[f]||a(b,f,l),b[h]||a(b,h,y),u[y]=l,m))for(v in r)b[v]||o(b,v,r[v],!0)}},function(t,e){(function(e){!function(e){"use strict";function n(t,e,n,r){var o=e&&e.prototype instanceof i?e:i,s=Object.create(o.prototype),a=new p(r||[]);return s._invoke=c(t,n,a),s}function r(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}function i(){}function o(){}function s(){}function a(t){["next","throw","return"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function u(t){function n(e,i,o,s){var a=r(t[e],t,i);if("throw"!==a.type){var u=a.arg,c=u.value;return c&&"object"==typeof c&&m.call(c,"__await")?Promise.resolve(c.__await).then(function(t){n("next",t,o,s)},function(t){n("throw",t,o,s)}):Promise.resolve(c).then(function(t){u.value=t,o(u)},s)}s(a.arg)}function i(t,e){function r(){return new Promise(function(r,i){n(t,e,r,i)})}return o=o?o.then(r,r):r()}"object"==typeof e.process&&e.process.domain&&(n=e.process.domain.bind(n));var o;this._invoke=i}function c(t,e,n){var i=E;return function(o,s){if(i===P)throw new Error("Generator is already running");if(i===C){if("throw"===o)throw s;return g()}for(n.method=o,n.arg=s;;){var a=n.delegate;if(a){var u=f(a,n);if(u){if(u===k)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===E)throw i=C,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=P;var c=r(t,e,n);if("normal"===c.type){if(i=n.done?C:A,c.arg===k)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=C,n.method="throw",n.arg=c.arg)}}}function f(t,e){var n=t.iterator[e.method];if(n===v){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=v,f(t,e),"throw"===e.method))return k;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return k}var i=r(n,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,k;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=v),e.delegate=null,k):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,k)}function h(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function l(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function p(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(h,this),this.reset(!0)}function d(t){if(t){var e=t[b];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,r=function e(){for(;++n<t.length;)if(m.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=v,e.done=!0,e};return r.next=r}}return{next:g}}function g(){return{value:v,done:!0}}var v,y=Object.prototype,m=y.hasOwnProperty,S="function"==typeof Symbol?Symbol:{},b=S.iterator||"@@iterator",F=S.asyncIterator||"@@asyncIterator",w=S.toStringTag||"@@toStringTag",_="object"==typeof t,x=e.regeneratorRuntime;if(x)return void(_&&(t.exports=x));x=e.regeneratorRuntime=_?t.exports:{},x.wrap=n;var E="suspendedStart",A="suspendedYield",P="executing",C="completed",k={},T={};T[b]=function(){return this};var R=Object.getPrototypeOf,I=R&&R(R(d([])));I&&I!==y&&m.call(I,b)&&(T=I);var D=s.prototype=i.prototype=Object.create(T);o.prototype=D.constructor=s,s.constructor=o,s[w]=o.displayName="GeneratorFunction",x.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===o||"GeneratorFunction"===(e.displayName||e.name))},x.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,s):(t.__proto__=s,w in t||(t[w]="GeneratorFunction")),t.prototype=Object.create(D),t},x.awrap=function(t){return{__await:t}},a(u.prototype),u.prototype[F]=function(){return this},x.AsyncIterator=u,x.async=function(t,e,r,i){var o=new u(n(t,e,r,i));return x.isGeneratorFunction(e)?o:o.next().then(function(t){return t.done?t.value:o.next()})},a(D),D[w]="Generator",D[b]=function(){return this},D.toString=function(){return"[object Generator]"},x.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},x.values=d,p.prototype={constructor:p,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=v,this.done=!1,this.delegate=null,this.method="next",this.arg=v,this.tryEntries.forEach(l),!t)for(var e in this)"t"===e.charAt(0)&&m.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=v)},stop:function(){this.done=!0;var t=this.tryEntries[0],e=t.completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){function e(e,r){return o.type="throw",o.arg=t,n.next=e,r&&(n.method="next",n.arg=v),!!r}if(this.done)throw t;for(var n=this,r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r],o=i.completion;if("root"===i.tryLoc)return e("end");if(i.tryLoc<=this.prev){var s=m.call(i,"catchLoc"),a=m.call(i,"finallyLoc");if(s&&a){if(this.prev<i.catchLoc)return e(i.catchLoc,!0);if(this.prev<i.finallyLoc)return e(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return e(i.catchLoc,!0)}else{if(!a)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return e(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&m.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=t,o.arg=e,i?(this.method="next",this.next=i.finallyLoc,k):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),k},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),l(n),k}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;l(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:d(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=v),k}}}("object"==typeof e?e:"object"==typeof window?window:"object"==typeof self?self:this)}).call(e,function(){return this}())},function(t,e,n){n(325),t.exports=n(9).RegExp.escape},function(t,e,n){var r=n(8),i=n(326)(/[\\^$*+?.()|[\]{}]/g,"\\$&");r(r.S,"RegExp",{escape:function(t){return i(t)}})},function(t,e){t.exports=function(t,e){var n=e===Object(e)?function(t){return e[t]}:e;return function(e){return String(e).replace(t,n)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(328);Object.defineProperty(e,"Log",{enumerable:!0,get:function(){return r.Log}});var i=n(329);Object.defineProperty(e,"OidcClient",{enumerable:!0,get:function(){return i.OidcClient}});var o=n(330);Object.defineProperty(e,"OidcClientSettings",{enumerable:!0,get:function(){return o.OidcClientSettings}});var s=n(331);Object.defineProperty(e,"WebStorageStateStore",{enumerable:!0,get:function(){return s.WebStorageStateStore}});var a=n(349);Object.defineProperty(e,"InMemoryWebStorage",{enumerable:!0,get:function(){return a.InMemoryWebStorage}});var u=n(350);Object.defineProperty(e,"UserManager",{enumerable:!0,get:function(){return u.UserManager}});var c=n(359);Object.defineProperty(e,"AccessTokenEvents",{enumerable:!0,get:function(){return c.AccessTokenEvents}});var f=n(334);Object.defineProperty(e,"MetadataService",{enumerable:!0,get:function(){return f.MetadataService}});var h=n(366);Object.defineProperty(e,"CordovaPopupNavigator",{enumerable:!0,get:function(){return h.CordovaPopupNavigator}});var l=n(368);Object.defineProperty(e,"CordovaIFrameNavigator",{enumerable:!0,get:function(){return l.CordovaIFrameNavigator}});var p=n(364);Object.defineProperty(e,"CheckSessionIFrame",{enumerable:!0,get:function(){return p.CheckSessionIFrame}});var d=n(365);Object.defineProperty(e,"TokenRevocationClient",{enumerable:!0,get:function(){return d.TokenRevocationClient}});var g=n(363);Object.defineProperty(e,"SessionMonitor",{enumerable:!0,get:function(){return g.SessionMonitor}});var v=n(332);Object.defineProperty(e,"Global",{enumerable:!0,get:function(){return v.Global}});var y=n(357);Object.defineProperty(e,"User",{enumerable:!0,get:function(){return y.User}})},function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),i={debug:function(){},info:function(){},warn:function(){},error:function(){}},o=0,s=1,a=2,u=3,c=4,f=void 0,h=void 0,l=e.Log=function(){function t(){n(this,t)}return t.reset=function(){h=u,f=i},t.debug=function(){if(h>=c){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];f.debug.apply(f,Array.from(e))}},t.info=function(){if(h>=u){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];f.info.apply(f,Array.from(e))}},t.warn=function(){if(h>=a){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];f.warn.apply(f,Array.from(e))}},t.error=function(){if(h>=s){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];f.error.apply(f,Array.from(e))}},r(t,null,[{key:"NONE",get:function(){return o}},{key:"ERROR",get:function(){return s}},{key:"WARN",get:function(){return a}},{key:"INFO",get:function(){return u}},{key:"DEBUG",get:function(){return c}},{key:"level",get:function(){return h},set:function(t){if(!(o<=t&&t<=c))throw new Error("Invalid log level");h=t}},{key:"logger",get:function(){return f},set:function(t){if(!t.debug&&t.info&&(t.debug=t.info),!(t.debug&&t.info&&t.warn&&t.error))throw new Error("Invalid logger");f=t}}]),t}();l.reset()},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0}),e.OidcClient=void 0;var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),o=n(328),s=n(330),a=n(337),u=n(341),c=n(346),f=n(347),h=n(348),l=n(343),p=n(344);e.OidcClient=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r(this,t),e instanceof s.OidcClientSettings?this._settings=e:this._settings=new s.OidcClientSettings(e)}return t.prototype.createSigninRequest=function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.response_type,r=e.scope,i=e.redirect_uri,s=e.data,a=e.state,c=e.prompt,f=e.display,h=e.max_age,l=e.ui_locales,p=e.id_token_hint,d=e.login_hint,g=e.acr_values,v=e.resource,y=e.request,m=e.request_uri,S=e.extraQueryParams,b=arguments[1];o.Log.debug("OidcClient.createSigninRequest");var F=this._settings.client_id;n=n||this._settings.response_type,r=r||this._settings.scope,i=i||this._settings.redirect_uri,c=c||this._settings.prompt,f=f||this._settings.display,h=h||this._settings.max_age,l=l||this._settings.ui_locales,g=g||this._settings.acr_values,v=v||this._settings.resource,S=S||this._settings.extraQueryParams;var w=this._settings.authority;return this._metadataService.getAuthorizationEndpoint().then(function(e){o.Log.debug("OidcClient.createSigninRequest: Received authorization endpoint",e);var _=new u.SigninRequest({url:e,client_id:F,redirect_uri:i,response_type:n,scope:r,data:s||a,authority:w,prompt:c,display:f,max_age:h,ui_locales:l,id_token_hint:p,login_hint:d,acr_values:g,resource:v,request:y,request_uri:m,extraQueryParams:S}),x=_.state;return b=b||t._stateStore,b.set(x.id,x.toStorageString()).then(function(){return _})})},t.prototype.processSigninResponse=function(t,e){var n=this;o.Log.debug("OidcClient.processSigninResponse");var r=new c.SigninResponse(t);return r.state?(e=e||this._stateStore,e.remove(r.state).then(function(t){if(!t)throw o.Log.error("OidcClient.processSigninResponse: No matching state found in storage"),new Error("No matching state found in storage");var e=l.SigninState.fromStorageString(t);return o.Log.debug("OidcClient.processSigninResponse: Received state from storage; validating response"),n._validator.validateSigninResponse(e,r)})):(o.Log.error("OidcClient.processSigninResponse: No state in response"),Promise.reject(new Error("No state in response")))},t.prototype.createSignoutRequest=function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.id_token_hint,r=e.data,i=e.state,s=e.post_logout_redirect_uri,a=arguments[1];return o.Log.debug("OidcClient.createSignoutRequest"),s=s||this._settings.post_logout_redirect_uri,this._metadataService.getEndSessionEndpoint().then(function(e){
if(!e)throw o.Log.error("OidcClient.createSignoutRequest: No end session endpoint url returned"),new Error("no end session endpoint");o.Log.debug("OidcClient.createSignoutRequest: Received end session endpoint",e);var u=new f.SignoutRequest({url:e,id_token_hint:n,post_logout_redirect_uri:s,data:r||i}),c=u.state;return c&&(o.Log.debug("OidcClient.createSignoutRequest: Signout request has state to persist"),a=a||t._stateStore,a.set(c.id,c.toStorageString())),u})},t.prototype.processSignoutResponse=function(t,e){var n=this;o.Log.debug("OidcClient.processSignoutResponse");var r=new h.SignoutResponse(t);if(!r.state)return o.Log.debug("OidcClient.processSignoutResponse: No state in response"),r.error?(o.Log.warn("OidcClient.processSignoutResponse: Response was error: ",r.error),Promise.reject(new a.ErrorResponse(r))):Promise.resolve(r);var i=r.state;return e=e||this._stateStore,e.remove(i).then(function(t){if(!t)throw o.Log.error("OidcClient.processSignoutResponse: No matching state found in storage"),new Error("No matching state found in storage");var e=p.State.fromStorageString(t);return o.Log.debug("OidcClient.processSignoutResponse: Received state from storage; validating response"),n._validator.validateSignoutResponse(e,r)})},t.prototype.clearStaleState=function(t){return o.Log.debug("OidcClient.clearStaleState"),t=t||this._stateStore,p.State.clearStaleState(t,this.settings.staleStateAge)},i(t,[{key:"_stateStore",get:function(){return this.settings.stateStore}},{key:"_validator",get:function(){return this.settings.validator}},{key:"_metadataService",get:function(){return this.settings.metadataService}},{key:"settings",get:function(){return this._settings}},{key:"metadataService",get:function(){return this._metadataService}}]),t}()},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0}),e.OidcClientSettings=void 0;var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),s=n(328),a=n(331),u=n(333),c=n(334),f=".well-known/openid-configuration",h="id_token",l="openid",p=300,d=300;e.OidcClientSettings=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.authority,o=e.metadataUrl,s=e.metadata,f=e.signingKeys,g=e.client_id,v=e.client_secret,y=e.response_type,m=void 0===y?h:y,S=e.scope,b=void 0===S?l:S,F=e.redirect_uri,w=e.post_logout_redirect_uri,_=e.prompt,x=e.display,E=e.max_age,A=e.ui_locales,P=e.acr_values,C=e.resource,k=e.filterProtocolClaims,T=void 0===k||k,R=e.loadUserInfo,I=void 0===R||R,D=e.staleStateAge,N=void 0===D?p:D,O=e.clockSkew,j=void 0===O?d:O,L=e.stateStore,M=void 0===L?new a.WebStorageStateStore:L,B=e.ResponseValidatorCtor,H=void 0===B?u.ResponseValidator:B,U=e.MetadataServiceCtor,V=void 0===U?c.MetadataService:U,K=e.extraQueryParams,q=void 0===K?{}:K;r(this,t),this._authority=n,this._metadataUrl=o,this._metadata=s,this._signingKeys=f,this._client_id=g,this._client_secret=v,this._response_type=m,this._scope=b,this._redirect_uri=F,this._post_logout_redirect_uri=w,this._prompt=_,this._display=x,this._max_age=E,this._ui_locales=A,this._acr_values=P,this._resource=C,this._filterProtocolClaims=!!T,this._loadUserInfo=!!I,this._staleStateAge=N,this._clockSkew=j,this._stateStore=M,this._validator=new H(this),this._metadataService=new V(this),this._extraQueryParams="object"===("undefined"==typeof q?"undefined":i(q))?q:{}}return o(t,[{key:"client_id",get:function(){return this._client_id},set:function(t){if(this._client_id)throw s.Log.error("OidcClientSettings.set_client_id: client_id has already been assigned."),new Error("client_id has already been assigned.");this._client_id=t}},{key:"client_secret",get:function(){return this._client_secret}},{key:"response_type",get:function(){return this._response_type}},{key:"scope",get:function(){return this._scope}},{key:"redirect_uri",get:function(){return this._redirect_uri}},{key:"post_logout_redirect_uri",get:function(){return this._post_logout_redirect_uri}},{key:"prompt",get:function(){return this._prompt}},{key:"display",get:function(){return this._display}},{key:"max_age",get:function(){return this._max_age}},{key:"ui_locales",get:function(){return this._ui_locales}},{key:"acr_values",get:function(){return this._acr_values}},{key:"resource",get:function(){return this._resource}},{key:"authority",get:function(){return this._authority},set:function(t){if(this._authority)throw s.Log.error("OidcClientSettings.set_authority: authority has already been assigned."),new Error("authority has already been assigned.");this._authority=t}},{key:"metadataUrl",get:function(){return this._metadataUrl||(this._metadataUrl=this.authority,this._metadataUrl&&this._metadataUrl.indexOf(f)<0&&("/"!==this._metadataUrl[this._metadataUrl.length-1]&&(this._metadataUrl+="/"),this._metadataUrl+=f)),this._metadataUrl}},{key:"metadata",get:function(){return this._metadata},set:function(t){this._metadata=t}},{key:"signingKeys",get:function(){return this._signingKeys},set:function(t){this._signingKeys=t}},{key:"filterProtocolClaims",get:function(){return this._filterProtocolClaims}},{key:"loadUserInfo",get:function(){return this._loadUserInfo}},{key:"staleStateAge",get:function(){return this._staleStateAge}},{key:"clockSkew",get:function(){return this._clockSkew}},{key:"stateStore",get:function(){return this._stateStore}},{key:"validator",get:function(){return this._validator}},{key:"metadataService",get:function(){return this._metadataService}},{key:"extraQueryParams",get:function(){return this._extraQueryParams},set:function(t){"object"===("undefined"==typeof t?"undefined":i(t))?this._extraQueryParams=t:this._extraQueryParams={}}}]),t}()},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0}),e.WebStorageStateStore=void 0;var i=n(328),o=n(332);e.WebStorageStateStore=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.prefix,i=void 0===n?"oidc.":n,s=e.store,a=void 0===s?o.Global.localStorage:s;r(this,t),this._store=a,this._prefix=i}return t.prototype.set=function(t,e){return i.Log.debug("WebStorageStateStore.set",t),t=this._prefix+t,this._store.setItem(t,e),Promise.resolve()},t.prototype.get=function(t){i.Log.debug("WebStorageStateStore.get",t),t=this._prefix+t;var e=this._store.getItem(t);return Promise.resolve(e)},t.prototype.remove=function(t){i.Log.debug("WebStorageStateStore.remove",t),t=this._prefix+t;var e=this._store.getItem(t);return this._store.removeItem(t),Promise.resolve(e)},t.prototype.getAllKeys=function(){i.Log.debug("WebStorageStateStore.getAllKeys");for(var t=[],e=0;e<this._store.length;e++){var n=this._store.key(e);0===n.indexOf(this._prefix)&&t.push(n.substr(this._prefix.length))}return Promise.resolve(t)},t}()},function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),i={setInterval:function(t){function e(e,n){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}(function(t,e){return setInterval(t,e)}),clearInterval:function(t){function e(e){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}(function(t){return clearInterval(t)})},o=!1,s=null;e.Global=function(){function t(){n(this,t)}return t._testing=function(){o=!0},t.setXMLHttpRequest=function(t){s=t},r(t,null,[{key:"location",get:function(){if(!o)return location}},{key:"localStorage",get:function(){if(!o&&"undefined"!=typeof window)return localStorage}},{key:"sessionStorage",get:function(){if(!o&&"undefined"!=typeof window)return sessionStorage}},{key:"XMLHttpRequest",get:function(){if(!o&&"undefined"!=typeof window)return s||XMLHttpRequest}},{key:"timer",get:function(){if(!o)return i}}]),t}()},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0}),e.ResponseValidator=void 0;var i=n(328),o=n(334),s=n(336),a=n(337),u=n(338),c=["nonce","at_hash","iat","nbf","exp","aud","iss","c_hash"];e.ResponseValidator=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.MetadataService,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s.UserInfoService,c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:u.JoseUtil;if(r(this,t),!e)throw i.Log.error("ResponseValidator.ctor: No settings passed to ResponseValidator"),new Error("settings");this._settings=e,this._metadataService=new n(this._settings),this._userInfoService=new a(this._settings),this._joseUtil=c}return t.prototype.validateSigninResponse=function(t,e){var n=this;return i.Log.debug("ResponseValidator.validateSigninResponse"),this._processSigninParams(t,e).then(function(e){return i.Log.debug("ResponseValidator.validateSigninResponse: state processed"),n._validateTokens(t,e).then(function(t){return i.Log.debug("ResponseValidator.validateSigninResponse: tokens validated"),n._processClaims(t).then(function(t){return i.Log.debug("ResponseValidator.validateSigninResponse: claims processed"),t})})})},t.prototype.validateSignoutResponse=function(t,e){return t.id!==e.state?(i.Log.error("ResponseValidator.validateSignoutResponse: State does not match"),Promise.reject(new Error("State does not match"))):(i.Log.debug("ResponseValidator.validateSignoutResponse: state validated"),e.state=t.data,e.error?(i.Log.warn("ResponseValidator.validateSignoutResponse: Response was error",e.error),Promise.reject(new a.ErrorResponse(e))):Promise.resolve(e))},t.prototype._processSigninParams=function(t,e){if(t.id!==e.state)return i.Log.error("ResponseValidator._processSigninParams: State does not match"),Promise.reject(new Error("State does not match"));if(!t.client_id)return i.Log.error("ResponseValidator._processSigninParams: No client_id on state"),Promise.reject(new Error("No client_id on state"));if(!t.authority)return i.Log.error("ResponseValidator._processSigninParams: No authority on state"),Promise.reject(new Error("No authority on state"));if(this._settings.authority){if(this._settings.authority&&this._settings.authority!==t.authority)return i.Log.error("ResponseValidator._processSigninParams: authority mismatch on settings vs. signin state"),Promise.reject(new Error("authority mismatch on settings vs. signin state"))}else this._settings.authority=t.authority;if(this._settings.client_id){if(this._settings.client_id&&this._settings.client_id!==t.client_id)return i.Log.error("ResponseValidator._processSigninParams: client_id mismatch on settings vs. signin state"),Promise.reject(new Error("client_id mismatch on settings vs. signin state"))}else this._settings.client_id=t.client_id;return i.Log.debug("ResponseValidator._processSigninParams: state validated"),e.state=t.data,e.error?(i.Log.warn("ResponseValidator._processSigninParams: Response was error",e.error),Promise.reject(new a.ErrorResponse(e))):t.nonce&&!e.id_token?(i.Log.error("ResponseValidator._processSigninParams: Expecting id_token in response"),Promise.reject(new Error("No id_token in response"))):!t.nonce&&e.id_token?(i.Log.error("ResponseValidator._processSigninParams: Not expecting id_token in response"),Promise.reject(new Error("Unexpected id_token in response"))):Promise.resolve(e)},t.prototype._processClaims=function(t){var e=this;if(t.isOpenIdConnect){if(i.Log.debug("ResponseValidator._processClaims: response is OIDC, processing claims"),t.profile=this._filterProtocolClaims(t.profile),this._settings.loadUserInfo&&t.access_token)return i.Log.debug("ResponseValidator._processClaims: loading user info"),this._userInfoService.getClaims(t.access_token).then(function(n){return i.Log.debug("ResponseValidator._processClaims: user info claims received from user info endpoint"),n.sub!==t.profile.sub?(i.Log.error("ResponseValidator._processClaims: sub from user info endpoint does not match sub in access_token"),Promise.reject(new Error("sub from user info endpoint does not match sub in access_token"))):(t.profile=e._mergeClaims(t.profile,n),i.Log.debug("ResponseValidator._processClaims: user info claims received, updated profile:",t.profile),t)});i.Log.debug("ResponseValidator._processClaims: not loading user info")}else i.Log.debug("ResponseValidator._processClaims: response is not OIDC, not processing claims");return Promise.resolve(t)},t.prototype._mergeClaims=function(t,e){var n=Object.assign({},t);for(var r in e){var i=e[r];Array.isArray(i)||(i=[i]);for(var o=0;o<i.length;o++){var s=i[o];n[r]?Array.isArray(n[r])?n[r].indexOf(s)<0&&n[r].push(s):n[r]!==s&&(n[r]=[n[r],s]):n[r]=s}}return n},t.prototype._filterProtocolClaims=function(t){i.Log.debug("ResponseValidator._filterProtocolClaims, incoming claims:",t);var e=Object.assign({},t);return this._settings._filterProtocolClaims?(c.forEach(function(t){delete e[t]}),i.Log.debug("ResponseValidator._filterProtocolClaims: protocol claims filtered",e)):i.Log.debug("ResponseValidator._filterProtocolClaims: protocol claims not filtered"),e},t.prototype._validateTokens=function(t,e){return e.id_token?e.access_token?(i.Log.debug("ResponseValidator._validateTokens: Validating id_token and access_token"),this._validateIdTokenAndAccessToken(t,e)):(i.Log.debug("ResponseValidator._validateTokens: Validating id_token"),this._validateIdToken(t,e)):(i.Log.debug("ResponseValidator._validateTokens: No id_token to validate"),Promise.resolve(e))},t.prototype._validateIdTokenAndAccessToken=function(t,e){var n=this;return this._validateIdToken(t,e).then(function(t){return n._validateAccessToken(t)})},t.prototype._validateIdToken=function(t,e){var n=this;if(!t.nonce)return i.Log.error("ResponseValidator._validateIdToken: No nonce on state"),Promise.reject(new Error("No nonce on state"));var r=this._joseUtil.parseJwt(e.id_token);if(!r||!r.header||!r.payload)return i.Log.error("ResponseValidator._validateIdToken: Failed to parse id_token",r),Promise.reject(new Error("Failed to parse id_token"));if(t.nonce!==r.payload.nonce)return i.Log.error("ResponseValidator._validateIdToken: Invalid nonce in id_token"),Promise.reject(new Error("Invalid nonce in id_token"));var o=r.header.kid;return this._metadataService.getIssuer().then(function(s){return i.Log.debug("ResponseValidator._validateIdToken: Received issuer"),n._metadataService.getSigningKeys().then(function(a){if(!a)return i.Log.error("ResponseValidator._validateIdToken: No signing keys from metadata"),Promise.reject(new Error("No signing keys from metadata"));i.Log.debug("ResponseValidator._validateIdToken: Received signing keys");var u=void 0;if(o)u=a.filter(function(t){return t.kid===o})[0];else{if(a=n._filterByAlg(a,r.header.alg),a.length>1)return i.Log.error("ResponseValidator._validateIdToken: No kid found in id_token and more than one key found in metadata"),Promise.reject(new Error("No kid found in id_token and more than one key found in metadata"));u=a[0]}if(!u)return i.Log.error("ResponseValidator._validateIdToken: No key matching kid or alg found in signing keys"),Promise.reject(new Error("No key matching kid or alg found in signing keys"));var c=t.client_id,f=n._settings.clockSkew;return i.Log.debug("ResponseValidator._validateIdToken: Validaing JWT; using clock skew (in seconds) of: ",f),n._joseUtil.validateJwt(e.id_token,u,s,c,f).then(function(){return i.Log.debug("ResponseValidator._validateIdToken: JWT validation successful"),r.payload.sub?(e.profile=r.payload,e):(i.Log.error("ResponseValidator._validateIdToken: No sub present in id_token"),Promise.reject(new Error("No sub present in id_token")))})})})},t.prototype._filterByAlg=function(t,e){var n=null;if(e.startsWith("RS"))n="RSA";else if(e.startsWith("PS"))n="PS";else{if(!e.startsWith("ES"))return i.Log.debug("ResponseValidator._filterByAlg: alg not supported: ",e),[];n="EC"}return i.Log.debug("ResponseValidator._filterByAlg: Looking for keys that match kty: ",n),t=t.filter(function(t){return t.kty===n}),i.Log.debug("ResponseValidator._filterByAlg: Number of keys that match kty: ",n,t.length),t},t.prototype._validateAccessToken=function(t){if(!t.profile)return i.Log.error("ResponseValidator._validateAccessToken: No profile loaded from id_token"),Promise.reject(new Error("No profile loaded from id_token"));if(!t.profile.at_hash)return i.Log.error("ResponseValidator._validateAccessToken: No at_hash in id_token"),Promise.reject(new Error("No at_hash in id_token"));if(!t.id_token)return i.Log.error("ResponseValidator._validateAccessToken: No id_token"),Promise.reject(new Error("No id_token"));var e=this._joseUtil.parseJwt(t.id_token);if(!e||!e.header)return i.Log.error("ResponseValidator._validateAccessToken: Failed to parse id_token",e),Promise.reject(new Error("Failed to parse id_token"));var n=e.header.alg;if(!n||5!==n.length)return i.Log.error("ResponseValidator._validateAccessToken: Unsupported alg:",n),Promise.reject(new Error("Unsupported alg: "+n));var r=n.substr(2,3);if(!r)return i.Log.error("ResponseValidator._validateAccessToken: Unsupported alg:",n,r),Promise.reject(new Error("Unsupported alg: "+n));if(r=parseInt(r),256!==r&&384!==r&&512!==r)return i.Log.error("ResponseValidator._validateAccessToken: Unsupported alg:",n,r),Promise.reject(new Error("Unsupported alg: "+n));var o="sha"+r,s=this._joseUtil.hashString(t.access_token,o);if(!s)return i.Log.error("ResponseValidator._validateAccessToken: access_token hash failed:",o),Promise.reject(new Error("Failed to validate at_hash"));var a=s.substr(0,s.length/2),u=this._joseUtil.hexToBase64Url(a);return u!==t.profile.at_hash?(i.Log.error("ResponseValidator._validateAccessToken: Failed to validate at_hash",u,t.profile.at_hash),Promise.reject(new Error("Failed to validate at_hash"))):(i.Log.debug("ResponseValidator._validateAccessToken: success"),Promise.resolve(t))},t}()},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0}),e.MetadataService=void 0;var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),o=n(328),s=n(335),a=".well-known/openid-configuration";e.MetadataService=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s.JsonService;if(r(this,t),!e)throw o.Log.error("MetadataService: No settings passed to MetadataService"),new Error("settings");this._settings=e,this._jsonService=new n}return t.prototype.getMetadata=function(){var t=this;return this._settings.metadata?(o.Log.debug("MetadataService.getMetadata: Returning metadata from settings"),Promise.resolve(this._settings.metadata)):this.metadataUrl?(o.Log.debug("MetadataService.getMetadata: getting metadata from",this.metadataUrl),this._jsonService.getJson(this.metadataUrl).then(function(e){return o.Log.debug("MetadataService.getMetadata: json received"),t._settings.metadata=e,e})):(o.Log.error("MetadataService.getMetadata: No authority or metadataUrl configured on settings"),Promise.reject(new Error("No authority or metadataUrl configured on settings")))},t.prototype.getIssuer=function(){return this._getMetadataProperty("issuer")},t.prototype.getAuthorizationEndpoint=function(){return this._getMetadataProperty("authorization_endpoint")},t.prototype.getUserInfoEndpoint=function(){return this._getMetadataProperty("userinfo_endpoint")},t.prototype.getTokenEndpoint=function(){return this._getMetadataProperty("token_endpoint",!0)},t.prototype.getCheckSessionIframe=function(){return this._getMetadataProperty("check_session_iframe",!0)},t.prototype.getEndSessionEndpoint=function(){return this._getMetadataProperty("end_session_endpoint",!0)},t.prototype.getRevocationEndpoint=function(){return this._getMetadataProperty("revocation_endpoint",!0)},t.prototype._getMetadataProperty=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return o.Log.debug("MetadataService.getMetadataProperty for: "+t),this.getMetadata().then(function(n){if(o.Log.debug("MetadataService.getMetadataProperty: metadata recieved"),void 0===n[t]){if(e===!0)return void o.Log.warn("MetadataService.getMetadataProperty: Metadata does not contain optional property "+t);throw o.Log.error("MetadataService.getMetadataProperty: Metadata does not contain property "+t),new Error("Metadata does not contain property "+t)}return n[t]})},t.prototype.getSigningKeys=function(){var t=this;return this._settings.signingKeys?(o.Log.debug("MetadataService.getSigningKeys: Returning signingKeys from settings"),Promise.resolve(this._settings.signingKeys)):this._getMetadataProperty("jwks_uri").then(function(e){return o.Log.debug("MetadataService.getSigningKeys: jwks_uri received",e),t._jsonService.getJson(e).then(function(e){if(o.Log.debug("MetadataService.getSigningKeys: key set received",e),!e.keys)throw o.Log.error("MetadataService.getSigningKeys: Missing keys on keyset"),new Error("Missing keys on keyset");return t._settings.signingKeys=e.keys,t._settings.signingKeys})})},i(t,[{key:"metadataUrl",get:function(){return this._metadataUrl||(this._settings.metadataUrl?this._metadataUrl=this._settings.metadataUrl:(this._metadataUrl=this._settings.authority,this._metadataUrl&&this._metadataUrl.indexOf(a)<0&&("/"!==this._metadataUrl[this._metadataUrl.length-1]&&(this._metadataUrl+="/"),this._metadataUrl+=a))),this._metadataUrl}}]),t}()},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0}),e.JsonService=void 0;var i=n(328),o=n(332);e.JsonService=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:o.Global.XMLHttpRequest;r(this,t),this._XMLHttpRequest=e}return t.prototype.getJson=function(t,e){var n=this;if(!t)throw i.Log.error("JsonService.getJson: No url passed"),new Error("url");return i.Log.debug("JsonService.getJson, url: ",t),new Promise(function(r,o){var s=new n._XMLHttpRequest;s.open("GET",t),s.onload=function(){if(i.Log.debug("JsonService.getJson: HTTP response received, status",s.status),200===s.status){var e=s.getResponseHeader("Content-Type");if(e&&e.startsWith("application/json"))try{r(JSON.parse(s.responseText))}catch(t){i.Log.error("JsonService.getJson: Error parsing JSON response",t.message),o(t)}else o(Error("Invalid response Content-Type: "+e+", from URL: "+t))}else o(Error(s.statusText+" ("+s.status+")"))},s.onerror=function(){i.Log.error("JsonService.getJson: network error"),o(Error("Network Error"))},e&&(i.Log.debug("JsonService.getJson: token passed, setting Authorization header"),s.setRequestHeader("Authorization","Bearer "+e)),s.send()})},t}()},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0}),e.UserInfoService=void 0;var i=n(335),o=n(334),s=n(328);e.UserInfoService=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.JsonService,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o.MetadataService;if(r(this,t),!e)throw s.Log.error("UserInfoService.ctor: No settings passed"),new Error("settings");this._settings=e,this._jsonService=new n,this._metadataService=new a(this._settings)}return t.prototype.getClaims=function(t){var e=this;return t?this._metadataService.getUserInfoEndpoint().then(function(n){return s.Log.debug("UserInfoService.getClaims: received userinfo url",n),e._jsonService.getJson(n,t).then(function(t){return s.Log.debug("UserInfoService.getClaims: claims received",t),t})}):(s.Log.error("UserInfoService.getClaims: No token passed"),Promise.reject(new Error("A token is required")))},t}()},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0}),e.ErrorResponse=void 0;var s=n(328);e.ErrorResponse=function(t){function e(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=n.error,a=n.error_description,u=n.error_uri,c=n.state;if(r(this,e),!o)throw s.Log.error("No error passed to ErrorResponse"),new Error("error");var f=i(this,t.call(this,a||o));return f.name="ErrorResponse",f.error=o,f.error_description=a,f.error_uri=u,f.state=c,f}return o(e,t),e}(Error)},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0}),e.JoseUtil=void 0;var i=n(339),o=n(328),s=["RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"];e.JoseUtil=function(){function t(){r(this,t)}return t.parseJwt=function(t){o.Log.debug("JoseUtil.parseJwt");try{var e=i.jws.JWS.parse(t);return{header:e.headerObj,payload:e.payloadObj}}catch(t){o.Log.error(t)}},t.validateJwt=function(e,n,r,s,a,u){o.Log.debug("JoseUtil.validateJwt");try{if("RSA"===n.kty)if(n.e&&n.n)n=i.KEYUTIL.getKey(n);else{if(!n.x5c||!n.x5c.length)return o.Log.error("JoseUtil.validateJwt: RSA key missing key material",n),Promise.reject(new Error("RSA key missing key material"));var c=(0,i.b64tohex)(n.x5c[0]);n=i.X509.getPublicKeyFromCertHex(c)}else{if("EC"!==n.kty)return o.Log.error("JoseUtil.validateJwt: Unsupported key type",n&&n.kty),Promise.reject(new Error("Unsupported key type: "+n&&n.kty));if(!(n.crv&&n.x&&n.y))return o.Log.error("JoseUtil.validateJwt: EC key missing key material",n),Promise.reject(new Error("EC key missing key material"));n=i.KEYUTIL.getKey(n)}return t._validateJwt(e,n,r,s,a,u)}catch(t){return o.Log.error(t&&t.message||t),Promise.reject("JWT validation failed")}},t._validateJwt=function(e,n,r,a,u,c){u||(u=0),c||(c=parseInt(Date.now()/1e3));var f=t.parseJwt(e).payload;if(!f.iss)return o.Log.error("JoseUtil._validateJwt: issuer was not provided"),Promise.reject(new Error("issuer was not provided"));if(f.iss!==r)return o.Log.error("JoseUtil._validateJwt: Invalid issuer in token",f.iss),Promise.reject(new Error("Invalid issuer in token: "+f.iss));if(!f.aud)return o.Log.error("JoseUtil._validateJwt: aud was not provided"),Promise.reject(new Error("aud was not provided"));var h=f.aud===a||Array.isArray(f.aud)&&f.aud.indexOf(a)>=0;if(!h)return o.Log.error("JoseUtil._validateJwt: Invalid audience in token",f.aud),Promise.reject(new Error("Invalid audience in token: "+f.aud));var l=c+u,p=c-u;if(!f.iat)return o.Log.error("JoseUtil._validateJwt: iat was not provided"),Promise.reject(new Error("iat was not provided"));if(l<f.iat)return o.Log.error("JoseUtil._validateJwt: iat is in the future",f.iat),Promise.reject(new Error("iat is in the future: "+f.iat));if(f.nbf&&l<f.nbf)return o.Log.error("JoseUtil._validateJwt: nbf is in the future",f.nbf),Promise.reject(new Error("nbf is in the future: "+f.nbf));if(!f.exp)return o.Log.error("JoseUtil._validateJwt: exp was not provided"),Promise.reject(new Error("exp was not provided"));if(f.exp<p)return o.Log.error("JoseUtil._validateJwt: exp is in the past",f.exp),Promise.reject(new Error("exp is in the past:"+f.exp));try{if(!i.jws.JWS.verify(e,n,s))return o.Log.error("JoseUtil._validateJwt: signature validation failed"),Promise.reject(new Error("signature validation failed"))}catch(t){return o.Log.error(t&&t.message||t),Promise.reject(new Error("signature validation failed"))}return Promise.resolve()},t.hashString=function(t,e){try{return i.crypto.Util.hashString(t,e)}catch(t){o.Log.error(t)}},t.hexToBase64Url=function(t){try{return(0,i.hextob64u)(t)}catch(t){o.Log.error(t)}},t}()},function(t,e,n){(function(t){"use strict";function n(t){var e,n,r="";for(e=0;e+3<=t.length;e+=3)n=parseInt(t.substring(e,e+3),16),r+=qn.charAt(n>>6)+qn.charAt(63&n);if(e+1==t.length?(n=parseInt(t.substring(e,e+1),16),r+=qn.charAt(n<<2)):e+2==t.length&&(n=parseInt(t.substring(e,e+2),16),r+=qn.charAt(n>>2)+qn.charAt((3&n)<<4)),Wn)for(;(3&r.length)>0;)r+=Wn;return r}function r(t){var e,n,r,i="",o=0;for(e=0;e<t.length&&t.charAt(e)!=Wn;++e)r=qn.indexOf(t.charAt(e)),r<0||(0==o?(i+=f(r>>2),n=3&r,o=1):1==o?(i+=f(n<<2|r>>4),n=15&r,o=2):2==o?(i+=f(n),i+=f(r>>2),n=3&r,o=3):(i+=f(n<<2|r>>4),i+=f(15&r),o=0));return 1==o&&(i+=f(n<<2)),i}function i(t){var e,n=r(t),i=new Array;for(e=0;2*e<n.length;++e)i[e]=parseInt(n.substring(2*e,2*e+2),16);return i}function o(t,e,n){null!=t&&("number"==typeof t?this.fromNumber(t,e,n):null==e&&"string"!=typeof t?this.fromString(t,256):this.fromString(t,e))}function s(){return new o(null)}function a(t,e,n,r,i,o){for(;--o>=0;){var s=e*this[t++]+n[r]+i;i=Math.floor(s/67108864),n[r++]=67108863&s}return i}function u(t,e,n,r,i,o){for(var s=32767&e,a=e>>15;--o>=0;){var u=32767&this[t],c=this[t++]>>15,f=a*u+c*s;u=s*u+((32767&f)<<15)+n[r]+(1073741823&i),i=(u>>>30)+(f>>>15)+a*c+(i>>>30),n[r++]=1073741823&u}return i}function c(t,e,n,r,i,o){for(var s=16383&e,a=e>>14;--o>=0;){var u=16383&this[t],c=this[t++]>>14,f=a*u+c*s;u=s*u+((16383&f)<<14)+n[r]+i,i=(u>>28)+(f>>14)+a*c,n[r++]=268435455&u}return i}function f(t){return Xn.charAt(t)}function h(t,e){var n=Zn[t.charCodeAt(e)];return null==n?-1:n}function l(t){for(var e=this.t-1;e>=0;--e)t[e]=this[e];t.t=this.t,t.s=this.s}function p(t){this.t=1,this.s=t<0?-1:0,t>0?this[0]=t:t<-1?this[0]=t+this.DV:this.t=0}function d(t){var e=s();return e.fromInt(t),e}function g(t,e){var n;if(16==e)n=4;else if(8==e)n=3;else if(256==e)n=8;else if(2==e)n=1;else if(32==e)n=5;else{if(4!=e)return void this.fromRadix(t,e);n=2}this.t=0,this.s=0;for(var r=t.length,i=!1,s=0;--r>=0;){var a=8==n?255&t[r]:h(t,r);a<0?"-"==t.charAt(r)&&(i=!0):(i=!1,0==s?this[this.t++]=a:s+n>this.DB?(this[this.t-1]|=(a&(1<<this.DB-s)-1)<<s,this[this.t++]=a>>this.DB-s):this[this.t-1]|=a<<s,s+=n,s>=this.DB&&(s-=this.DB))}8==n&&0!=(128&t[0])&&(this.s=-1,s>0&&(this[this.t-1]|=(1<<this.DB-s)-1<<s)),this.clamp(),i&&o.ZERO.subTo(this,this)}function v(){for(var t=this.s&this.DM;this.t>0&&this[this.t-1]==t;)--this.t}function y(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(16==t)e=4;else if(8==t)e=3;else if(2==t)e=1;else if(32==t)e=5;else{if(4!=t)return this.toRadix(t);e=2}var n,r=(1<<e)-1,i=!1,o="",s=this.t,a=this.DB-s*this.DB%e;if(s-- >0)for(a<this.DB&&(n=this[s]>>a)>0&&(i=!0,o=f(n));s>=0;)a<e?(n=(this[s]&(1<<a)-1)<<e-a,n|=this[--s]>>(a+=this.DB-e)):(n=this[s]>>(a-=e)&r,a<=0&&(a+=this.DB,--s)),n>0&&(i=!0),i&&(o+=f(n));return i?o:"0"}function m(){var t=s();return o.ZERO.subTo(this,t),t}function S(){return this.s<0?this.negate():this}function b(t){var e=this.s-t.s;if(0!=e)return e;var n=this.t;if(e=n-t.t,0!=e)return this.s<0?-e:e;for(;--n>=0;)if(0!=(e=this[n]-t[n]))return e;return 0}function F(t){var e,n=1;return 0!=(e=t>>>16)&&(t=e,n+=16),0!=(e=t>>8)&&(t=e,n+=8),0!=(e=t>>4)&&(t=e,
n+=4),0!=(e=t>>2)&&(t=e,n+=2),0!=(e=t>>1)&&(t=e,n+=1),n}function w(){return this.t<=0?0:this.DB*(this.t-1)+F(this[this.t-1]^this.s&this.DM)}function _(t,e){var n;for(n=this.t-1;n>=0;--n)e[n+t]=this[n];for(n=t-1;n>=0;--n)e[n]=0;e.t=this.t+t,e.s=this.s}function x(t,e){for(var n=t;n<this.t;++n)e[n-t]=this[n];e.t=Math.max(this.t-t,0),e.s=this.s}function E(t,e){var n,r=t%this.DB,i=this.DB-r,o=(1<<i)-1,s=Math.floor(t/this.DB),a=this.s<<r&this.DM;for(n=this.t-1;n>=0;--n)e[n+s+1]=this[n]>>i|a,a=(this[n]&o)<<r;for(n=s-1;n>=0;--n)e[n]=0;e[s]=a,e.t=this.t+s+1,e.s=this.s,e.clamp()}function A(t,e){e.s=this.s;var n=Math.floor(t/this.DB);if(n>=this.t)return void(e.t=0);var r=t%this.DB,i=this.DB-r,o=(1<<r)-1;e[0]=this[n]>>r;for(var s=n+1;s<this.t;++s)e[s-n-1]|=(this[s]&o)<<i,e[s-n]=this[s]>>r;r>0&&(e[this.t-n-1]|=(this.s&o)<<i),e.t=this.t-n,e.clamp()}function P(t,e){for(var n=0,r=0,i=Math.min(t.t,this.t);n<i;)r+=this[n]-t[n],e[n++]=r&this.DM,r>>=this.DB;if(t.t<this.t){for(r-=t.s;n<this.t;)r+=this[n],e[n++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;n<t.t;)r-=t[n],e[n++]=r&this.DM,r>>=this.DB;r-=t.s}e.s=r<0?-1:0,r<-1?e[n++]=this.DV+r:r>0&&(e[n++]=r),e.t=n,e.clamp()}function C(t,e){var n=this.abs(),r=t.abs(),i=n.t;for(e.t=i+r.t;--i>=0;)e[i]=0;for(i=0;i<r.t;++i)e[i+n.t]=n.am(0,r[i],e,i,0,n.t);e.s=0,e.clamp(),this.s!=t.s&&o.ZERO.subTo(e,e)}function k(t){for(var e=this.abs(),n=t.t=2*e.t;--n>=0;)t[n]=0;for(n=0;n<e.t-1;++n){var r=e.am(n,e[n],t,2*n,0,1);(t[n+e.t]+=e.am(n+1,2*e[n],t,2*n+1,r,e.t-n-1))>=e.DV&&(t[n+e.t]-=e.DV,t[n+e.t+1]=1)}t.t>0&&(t[t.t-1]+=e.am(n,e[n],t,2*n,0,1)),t.s=0,t.clamp()}function T(t,e,n){var r=t.abs();if(!(r.t<=0)){var i=this.abs();if(i.t<r.t)return null!=e&&e.fromInt(0),void(null!=n&&this.copyTo(n));null==n&&(n=s());var a=s(),u=this.s,c=t.s,f=this.DB-F(r[r.t-1]);f>0?(r.lShiftTo(f,a),i.lShiftTo(f,n)):(r.copyTo(a),i.copyTo(n));var h=a.t,l=a[h-1];if(0!=l){var p=l*(1<<this.F1)+(h>1?a[h-2]>>this.F2:0),d=this.FV/p,g=(1<<this.F1)/p,v=1<<this.F2,y=n.t,m=y-h,S=null==e?s():e;for(a.dlShiftTo(m,S),n.compareTo(S)>=0&&(n[n.t++]=1,n.subTo(S,n)),o.ONE.dlShiftTo(h,S),S.subTo(a,a);a.t<h;)a[a.t++]=0;for(;--m>=0;){var b=n[--y]==l?this.DM:Math.floor(n[y]*d+(n[y-1]+v)*g);if((n[y]+=a.am(0,b,n,m,0,h))<b)for(a.dlShiftTo(m,S),n.subTo(S,n);n[y]<--b;)n.subTo(S,n)}null!=e&&(n.drShiftTo(h,e),u!=c&&o.ZERO.subTo(e,e)),n.t=h,n.clamp(),f>0&&n.rShiftTo(f,n),u<0&&o.ZERO.subTo(n,n)}}}function R(t){var e=s();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(o.ZERO)>0&&t.subTo(e,e),e}function I(t){this.m=t}function D(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t}function N(t){return t}function O(t){t.divRemTo(this.m,null,t)}function j(t,e,n){t.multiplyTo(e,n),this.reduce(n)}function L(t,e){t.squareTo(e),this.reduce(e)}function M(){if(this.t<1)return 0;var t=this[0];if(0==(1&t))return 0;var e=3&t;return e=e*(2-(15&t)*e)&15,e=e*(2-(255&t)*e)&255,e=e*(2-((65535&t)*e&65535))&65535,e=e*(2-t*e%this.DV)%this.DV,e>0?this.DV-e:-e}function B(t){this.m=t,this.mp=t.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<t.DB-15)-1,this.mt2=2*t.t}function H(t){var e=s();return t.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),t.s<0&&e.compareTo(o.ZERO)>0&&this.m.subTo(e,e),e}function U(t){var e=s();return t.copyTo(e),this.reduce(e),e}function V(t){for(;t.t<=this.mt2;)t[t.t++]=0;for(var e=0;e<this.m.t;++e){var n=32767&t[e],r=n*this.mpl+((n*this.mph+(t[e]>>15)*this.mpl&this.um)<<15)&t.DM;for(n=e+this.m.t,t[n]+=this.m.am(0,r,t,e,0,this.m.t);t[n]>=t.DV;)t[n]-=t.DV,t[++n]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)}function K(t,e){t.squareTo(e),this.reduce(e)}function q(t,e,n){t.multiplyTo(e,n),this.reduce(n)}function W(){return 0==(this.t>0?1&this[0]:this.s)}function J(t,e){if(t>4294967295||t<1)return o.ONE;var n=s(),r=s(),i=e.convert(this),a=F(t)-1;for(i.copyTo(n);--a>=0;)if(e.sqrTo(n,r),(t&1<<a)>0)e.mulTo(r,i,n);else{var u=n;n=r,r=u}return e.revert(n)}function G(t,e){var n;return n=t<256||e.isEven()?new I(e):new B(e),this.exp(t,n)}/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/
*/
function z(){var t=s();return this.copyTo(t),t}function Y(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]}function $(){return 0==this.t?this.s:this[0]<<24>>24}function X(){return 0==this.t?this.s:this[0]<<16>>16}function Z(t){return Math.floor(Math.LN2*this.DB/Math.log(t))}function Q(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1}function tt(t){if(null==t&&(t=10),0==this.signum()||t<2||t>36)return"0";var e=this.chunkSize(t),n=Math.pow(t,e),r=d(n),i=s(),o=s(),a="";for(this.divRemTo(r,i,o);i.signum()>0;)a=(n+o.intValue()).toString(t).substr(1)+a,i.divRemTo(r,i,o);return o.intValue().toString(t)+a}function et(t,e){this.fromInt(0),null==e&&(e=10);for(var n=this.chunkSize(e),r=Math.pow(e,n),i=!1,s=0,a=0,u=0;u<t.length;++u){var c=h(t,u);c<0?"-"==t.charAt(u)&&0==this.signum()&&(i=!0):(a=e*a+c,++s>=n&&(this.dMultiply(r),this.dAddOffset(a,0),s=0,a=0))}s>0&&(this.dMultiply(Math.pow(e,s)),this.dAddOffset(a,0)),i&&o.ZERO.subTo(this,this)}function nt(t,e,n){if("number"==typeof e)if(t<2)this.fromInt(1);else for(this.fromNumber(t,n),this.testBit(t-1)||this.bitwiseTo(o.ONE.shiftLeft(t-1),ft,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(o.ONE.shiftLeft(t-1),this);else{var r=new Array,i=7&t;r.length=(t>>3)+1,e.nextBytes(r),i>0?r[0]&=(1<<i)-1:r[0]=0,this.fromString(r,256)}}function rt(){var t=this.t,e=new Array;e[0]=this.s;var n,r=this.DB-t*this.DB%8,i=0;if(t-- >0)for(r<this.DB&&(n=this[t]>>r)!=(this.s&this.DM)>>r&&(e[i++]=n|this.s<<this.DB-r);t>=0;)r<8?(n=(this[t]&(1<<r)-1)<<8-r,n|=this[--t]>>(r+=this.DB-8)):(n=this[t]>>(r-=8)&255,r<=0&&(r+=this.DB,--t)),0!=(128&n)&&(n|=-256),0==i&&(128&this.s)!=(128&n)&&++i,(i>0||n!=this.s)&&(e[i++]=n);return e}function it(t){return 0==this.compareTo(t)}function ot(t){return this.compareTo(t)<0?this:t}function st(t){return this.compareTo(t)>0?this:t}function at(t,e,n){var r,i,o=Math.min(t.t,this.t);for(r=0;r<o;++r)n[r]=e(this[r],t[r]);if(t.t<this.t){for(i=t.s&this.DM,r=o;r<this.t;++r)n[r]=e(this[r],i);n.t=this.t}else{for(i=this.s&this.DM,r=o;r<t.t;++r)n[r]=e(i,t[r]);n.t=t.t}n.s=e(this.s,t.s),n.clamp()}function ut(t,e){return t&e}function ct(t){var e=s();return this.bitwiseTo(t,ut,e),e}function ft(t,e){return t|e}function ht(t){var e=s();return this.bitwiseTo(t,ft,e),e}function lt(t,e){return t^e}function pt(t){var e=s();return this.bitwiseTo(t,lt,e),e}function dt(t,e){return t&~e}function gt(t){var e=s();return this.bitwiseTo(t,dt,e),e}function vt(){for(var t=s(),e=0;e<this.t;++e)t[e]=this.DM&~this[e];return t.t=this.t,t.s=~this.s,t}function yt(t){var e=s();return t<0?this.rShiftTo(-t,e):this.lShiftTo(t,e),e}function mt(t){var e=s();return t<0?this.lShiftTo(-t,e):this.rShiftTo(t,e),e}function St(t){if(0==t)return-1;var e=0;return 0==(65535&t)&&(t>>=16,e+=16),0==(255&t)&&(t>>=8,e+=8),0==(15&t)&&(t>>=4,e+=4),0==(3&t)&&(t>>=2,e+=2),0==(1&t)&&++e,e}function bt(){for(var t=0;t<this.t;++t)if(0!=this[t])return t*this.DB+St(this[t]);return this.s<0?this.t*this.DB:-1}function Ft(t){for(var e=0;0!=t;)t&=t-1,++e;return e}function wt(){for(var t=0,e=this.s&this.DM,n=0;n<this.t;++n)t+=Ft(this[n]^e);return t}function _t(t){var e=Math.floor(t/this.DB);return e>=this.t?0!=this.s:0!=(this[e]&1<<t%this.DB)}function xt(t,e){var n=o.ONE.shiftLeft(t);return this.bitwiseTo(n,e,n),n}function Et(t){return this.changeBit(t,ft)}function At(t){return this.changeBit(t,dt)}function Pt(t){return this.changeBit(t,lt)}function Ct(t,e){for(var n=0,r=0,i=Math.min(t.t,this.t);n<i;)r+=this[n]+t[n],e[n++]=r&this.DM,r>>=this.DB;if(t.t<this.t){for(r+=t.s;n<this.t;)r+=this[n],e[n++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;n<t.t;)r+=t[n],e[n++]=r&this.DM,r>>=this.DB;r+=t.s}e.s=r<0?-1:0,r>0?e[n++]=r:r<-1&&(e[n++]=this.DV+r),e.t=n,e.clamp()}function kt(t){var e=s();return this.addTo(t,e),e}function Tt(t){var e=s();return this.subTo(t,e),e}function Rt(t){var e=s();return this.multiplyTo(t,e),e}function It(){var t=s();return this.squareTo(t),t}function Dt(t){var e=s();return this.divRemTo(t,e,null),e}function Nt(t){var e=s();return this.divRemTo(t,null,e),e}function Ot(t){var e=s(),n=s();return this.divRemTo(t,e,n),new Array(e,n)}function jt(t){this[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()}function Lt(t,e){if(0!=t){for(;this.t<=e;)this[this.t++]=0;for(this[e]+=t;this[e]>=this.DV;)this[e]-=this.DV,++e>=this.t&&(this[this.t++]=0),++this[e]}}function Mt(){}function Bt(t){return t}function Ht(t,e,n){t.multiplyTo(e,n)}function Ut(t,e){t.squareTo(e)}function Vt(t){return this.exp(t,new Mt)}function Kt(t,e,n){var r=Math.min(this.t+t.t,e);for(n.s=0,n.t=r;r>0;)n[--r]=0;var i;for(i=n.t-this.t;r<i;++r)n[r+this.t]=this.am(0,t[r],n,r,0,this.t);for(i=Math.min(t.t,e);r<i;++r)this.am(0,t[r],n,r,0,e-r);n.clamp()}function qt(t,e,n){--e;var r=n.t=this.t+t.t-e;for(n.s=0;--r>=0;)n[r]=0;for(r=Math.max(e-this.t,0);r<t.t;++r)n[this.t+r-e]=this.am(e-r,t[r],n,0,0,this.t+r-e);n.clamp(),n.drShiftTo(1,n)}function Wt(t){this.r2=s(),this.q3=s(),o.ONE.dlShiftTo(2*t.t,this.r2),this.mu=this.r2.divide(t),this.m=t}function Jt(t){if(t.s<0||t.t>2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=s();return t.copyTo(e),this.reduce(e),e}function Gt(t){return t}function zt(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)}function Yt(t,e){t.squareTo(e),this.reduce(e)}function $t(t,e,n){t.multiplyTo(e,n),this.reduce(n)}function Xt(t,e){var n,r,i=t.bitLength(),o=d(1);if(i<=0)return o;n=i<18?1:i<48?3:i<144?4:i<768?5:6,r=i<8?new I(e):e.isEven()?new Wt(e):new B(e);var a=new Array,u=3,c=n-1,f=(1<<n)-1;if(a[1]=r.convert(this),n>1){var h=s();for(r.sqrTo(a[1],h);u<=f;)a[u]=s(),r.mulTo(h,a[u-2],a[u]),u+=2}var l,p,g=t.t-1,v=!0,y=s();for(i=F(t[g])-1;g>=0;){for(i>=c?l=t[g]>>i-c&f:(l=(t[g]&(1<<i+1)-1)<<c-i,g>0&&(l|=t[g-1]>>this.DB+i-c)),u=n;0==(1&l);)l>>=1,--u;if((i-=u)<0&&(i+=this.DB,--g),v)a[l].copyTo(o),v=!1;else{for(;u>1;)r.sqrTo(o,y),r.sqrTo(y,o),u-=2;u>0?r.sqrTo(o,y):(p=o,o=y,y=p),r.mulTo(y,a[l],o)}for(;g>=0&&0==(t[g]&1<<i);)r.sqrTo(o,y),p=o,o=y,y=p,--i<0&&(i=this.DB-1,--g)}return r.revert(o)}function Zt(t){var e=this.s<0?this.negate():this.clone(),n=t.s<0?t.negate():t.clone();if(e.compareTo(n)<0){var r=e;e=n,n=r}var i=e.getLowestSetBit(),o=n.getLowestSetBit();if(o<0)return e;for(i<o&&(o=i),o>0&&(e.rShiftTo(o,e),n.rShiftTo(o,n));e.signum()>0;)(i=e.getLowestSetBit())>0&&e.rShiftTo(i,e),(i=n.getLowestSetBit())>0&&n.rShiftTo(i,n),e.compareTo(n)>=0?(e.subTo(n,e),e.rShiftTo(1,e)):(n.subTo(e,n),n.rShiftTo(1,n));return o>0&&n.lShiftTo(o,n),n}function Qt(t){if(t<=0)return 0;var e=this.DV%t,n=this.s<0?t-1:0;if(this.t>0)if(0==e)n=this[0]%t;else for(var r=this.t-1;r>=0;--r)n=(e*n+this[r])%t;return n}function te(t){var e=t.isEven();if(this.isEven()&&e||0==t.signum())return o.ZERO;for(var n=t.clone(),r=this.clone(),i=d(1),s=d(0),a=d(0),u=d(1);0!=n.signum();){for(;n.isEven();)n.rShiftTo(1,n),e?(i.isEven()&&s.isEven()||(i.addTo(this,i),s.subTo(t,s)),i.rShiftTo(1,i)):s.isEven()||s.subTo(t,s),s.rShiftTo(1,s);for(;r.isEven();)r.rShiftTo(1,r),e?(a.isEven()&&u.isEven()||(a.addTo(this,a),u.subTo(t,u)),a.rShiftTo(1,a)):u.isEven()||u.subTo(t,u),u.rShiftTo(1,u);n.compareTo(r)>=0?(n.subTo(r,n),e&&i.subTo(a,i),s.subTo(u,s)):(r.subTo(n,r),e&&a.subTo(i,a),u.subTo(s,u))}return 0!=r.compareTo(o.ONE)?o.ZERO:u.compareTo(t)>=0?u.subtract(t):u.signum()<0?(u.addTo(t,u),u.signum()<0?u.add(t):u):u}function ee(t){var e,n=this.abs();if(1==n.t&&n[0]<=Qn[Qn.length-1]){for(e=0;e<Qn.length;++e)if(n[0]==Qn[e])return!0;return!1}if(n.isEven())return!1;for(e=1;e<Qn.length;){for(var r=Qn[e],i=e+1;i<Qn.length&&r<tr;)r*=Qn[i++];for(r=n.modInt(r);e<i;)if(r%Qn[e++]==0)return!1}return n.millerRabin(t)}function ne(t){var e=this.subtract(o.ONE),n=e.getLowestSetBit();if(n<=0)return!1;var r=e.shiftRight(n);t=t+1>>1,t>Qn.length&&(t=Qn.length);for(var i=s(),a=0;a<t;++a){i.fromInt(Qn[Math.floor(Math.random()*Qn.length)]);var u=i.modPow(r,this);if(0!=u.compareTo(o.ONE)&&0!=u.compareTo(e)){for(var c=1;c++<n&&0!=u.compareTo(e);)if(u=u.modPowInt(2,this),0==u.compareTo(o.ONE))return!1;if(0!=u.compareTo(e))return!1}}return!0}/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/
*/
function re(){this.i=0,this.j=0,this.S=new Array}function ie(t){var e,n,r;for(e=0;e<256;++e)this.S[e]=e;for(n=0,e=0;e<256;++e)n=n+this.S[e]+t[e%t.length]&255,r=this.S[e],this.S[e]=this.S[n],this.S[n]=r;this.i=0,this.j=0}function oe(){var t;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,t=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=t,this.S[t+this.S[this.i]&255]}function se(){return new re}function ae(t){nr[rr++]^=255&t,nr[rr++]^=t>>8&255,nr[rr++]^=t>>16&255,nr[rr++]^=t>>24&255,rr>=ir&&(rr-=ir)}function ue(){ae((new Date).getTime())}function ce(){if(null==er){for(ue(),er=se(),er.init(nr),rr=0;rr<nr.length;++rr)nr[rr]=0;rr=0}return er.next()}function fe(t){var e;for(e=0;e<t.length;++e)t[e]=ce()}function he(){}/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/
*/
function le(t,e){return new o(t,e)}function pe(t,e){if(e<t.length+11)throw"Message too long for RSA";for(var n=new Array,r=t.length-1;r>=0&&e>0;){var i=t.charCodeAt(r--);i<128?n[--e]=i:i>127&&i<2048?(n[--e]=63&i|128,n[--e]=i>>6|192):(n[--e]=63&i|128,n[--e]=i>>6&63|128,n[--e]=i>>12|224)}n[--e]=0;for(var s=new he,a=new Array;e>2;){for(a[0]=0;0==a[0];)s.nextBytes(a);n[--e]=a[0]}return n[--e]=2,n[--e]=0,new o(n)}function de(t,e,n){for(var r="",i=0;r.length<e;)r+=n(String.fromCharCode.apply(String,t.concat([(4278190080&i)>>24,(16711680&i)>>16,(65280&i)>>8,255&i]))),i+=1;return r}function ge(t,e,n,r){var i=hr.crypto.MessageDigest,s=hr.crypto.Util,a=null;if(n||(n="sha1"),"string"==typeof n&&(a=i.getCanonicalAlgName(n),r=i.getHashLength(a),n=function(t){return fn(s.hashHex(hn(t),a))}),t.length+2*r+2>e)throw"Message too long for RSA";var u,c="";for(u=0;u<e-t.length-2*r-2;u+=1)c+="\0";var f=n("")+c+""+t,h=new Array(r);(new he).nextBytes(h);var l=de(h,f.length,n),p=[];for(u=0;u<f.length;u+=1)p[u]=f.charCodeAt(u)^l.charCodeAt(u);var d=de(p,h.length,n),g=[0];for(u=0;u<h.length;u+=1)g[u+1]=h[u]^d.charCodeAt(u);return new o(g.concat(p))}function ve(){this.n=null,this.e=0,this.d=null,this.p=null,this.q=null,this.dmp1=null,this.dmq1=null,this.coeff=null}function ye(t,e){if(this.isPublic=!0,this.isPrivate=!1,"string"!=typeof t)this.n=t,this.e=e;else{if(!(null!=t&&null!=e&&t.length>0&&e.length>0))throw"Invalid RSA public key";this.n=le(t,16),this.e=parseInt(e,16)}}function me(t){return t.modPowInt(this.e,this.n)}function Se(t){var e=pe(t,this.n.bitLength()+7>>3);if(null==e)return null;var n=this.doPublic(e);if(null==n)return null;var r=n.toString(16);return 0==(1&r.length)?r:"0"+r}function be(t,e,n){var r=ge(t,this.n.bitLength()+7>>3,e,n);if(null==r)return null;var i=this.doPublic(r);if(null==i)return null;var o=i.toString(16);return 0==(1&o.length)?o:"0"+o}/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/
*/
function Fe(t,e){this.x=e,this.q=t}function we(t){return t==this||this.q.equals(t.q)&&this.x.equals(t.x)}function _e(){return this.x}function xe(){return new Fe(this.q,this.x.negate().mod(this.q))}function Ee(t){return new Fe(this.q,this.x.add(t.toBigInteger()).mod(this.q))}function Ae(t){return new Fe(this.q,this.x.subtract(t.toBigInteger()).mod(this.q))}function Pe(t){return new Fe(this.q,this.x.multiply(t.toBigInteger()).mod(this.q))}function Ce(){return new Fe(this.q,this.x.square().mod(this.q))}function ke(t){return new Fe(this.q,this.x.multiply(t.toBigInteger().modInverse(this.q)).mod(this.q))}function Te(t,e,n,r){this.curve=t,this.x=e,this.y=n,null==r?this.z=o.ONE:this.z=r,this.zinv=null}function Re(){return null==this.zinv&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.x.toBigInteger().multiply(this.zinv).mod(this.curve.q))}function Ie(){return null==this.zinv&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.y.toBigInteger().multiply(this.zinv).mod(this.curve.q))}function De(t){if(t==this)return!0;if(this.isInfinity())return t.isInfinity();if(t.isInfinity())return this.isInfinity();var e,n;return e=t.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(t.z)).mod(this.curve.q),!!e.equals(o.ZERO)&&(n=t.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(t.z)).mod(this.curve.q),n.equals(o.ZERO))}function Ne(){return null==this.x&&null==this.y||this.z.equals(o.ZERO)&&!this.y.toBigInteger().equals(o.ZERO)}function Oe(){return new Te(this.curve,this.x,this.y.negate(),this.z)}function je(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(t.z)).mod(this.curve.q),n=t.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(t.z)).mod(this.curve.q);if(o.ZERO.equals(n))return o.ZERO.equals(e)?this.twice():this.curve.getInfinity();var r=new o("3"),i=this.x.toBigInteger(),s=this.y.toBigInteger(),a=(t.x.toBigInteger(),t.y.toBigInteger(),n.square()),u=a.multiply(n),c=i.multiply(a),f=e.square().multiply(this.z),h=f.subtract(c.shiftLeft(1)).multiply(t.z).subtract(u).multiply(n).mod(this.curve.q),l=c.multiply(r).multiply(e).subtract(s.multiply(u)).subtract(f.multiply(e)).multiply(t.z).add(e.multiply(u)).mod(this.curve.q),p=u.multiply(this.z).multiply(t.z).mod(this.curve.q);return new Te(this.curve,this.curve.fromBigInteger(h),this.curve.fromBigInteger(l),p)}function Le(){if(this.isInfinity())return this;if(0==this.y.toBigInteger().signum())return this.curve.getInfinity();var t=new o("3"),e=this.x.toBigInteger(),n=this.y.toBigInteger(),r=n.multiply(this.z),i=r.multiply(n).mod(this.curve.q),s=this.curve.a.toBigInteger(),a=e.square().multiply(t);o.ZERO.equals(s)||(a=a.add(this.z.square().multiply(s))),a=a.mod(this.curve.q);var u=a.square().subtract(e.shiftLeft(3).multiply(i)).shiftLeft(1).multiply(r).mod(this.curve.q),c=a.multiply(t).multiply(e).subtract(i.shiftLeft(1)).shiftLeft(2).multiply(i).subtract(a.square().multiply(a)).mod(this.curve.q),f=r.square().multiply(r).shiftLeft(3).mod(this.curve.q);return new Te(this.curve,this.curve.fromBigInteger(u),this.curve.fromBigInteger(c),f)}function Me(t){if(this.isInfinity())return this;if(0==t.signum())return this.curve.getInfinity();var e,n=t,r=n.multiply(new o("3")),i=this.negate(),s=this;for(e=r.bitLength()-2;e>0;--e){s=s.twice();var a=r.testBit(e),u=n.testBit(e);a!=u&&(s=s.add(a?this:i))}return s}function Be(t,e,n){var r;r=t.bitLength()>n.bitLength()?t.bitLength()-1:n.bitLength()-1;for(var i=this.curve.getInfinity(),o=this.add(e);r>=0;)i=i.twice(),t.testBit(r)?i=n.testBit(r)?i.add(o):i.add(this):n.testBit(r)&&(i=i.add(e)),--r;return i}function He(t,e,n){this.q=t,this.a=this.fromBigInteger(e),this.b=this.fromBigInteger(n),this.infinity=new Te(this,null,null)}function Ue(){return this.q}function Ve(){return this.a}function Ke(){return this.b}function qe(t){return t==this||this.q.equals(t.q)&&this.a.equals(t.a)&&this.b.equals(t.b)}function We(){return this.infinity}function Je(t){return new Fe(this.q,t)}function Ge(t){switch(parseInt(t.substr(0,2),16)){case 0:return this.infinity;case 2:case 3:return null;case 4:case 6:case 7:var e=(t.length-2)/2,n=t.substr(2,e),r=t.substr(e+2,e);return new Te(this,this.fromBigInteger(new o(n,16)),this.fromBigInteger(new o(r,16)));default:return null}}function ze(t){for(var e=new Array,n=0;n<t.length;n++)e[n]=t.charCodeAt(n);return e}function Ye(t){for(var e="",n=0;n<t.length;n++)e+=String.fromCharCode(t[n]);return e}function $e(t){for(var e="",n=0;n<t.length;n++){var r=t[n].toString(16);1==r.length&&(r="0"+r),e+=r}return e}function Xe(t){return $e(ze(t))}function Ze(t){return n(Xe(t))}function Qe(t){return en(n(Xe(t)))}function tn(t){return Ye(i(nn(t)))}function en(t){return t=t.replace(/\=/g,""),t=t.replace(/\+/g,"-"),t=t.replace(/\//g,"_")}function nn(t){return t.length%4==2?t+="==":t.length%4==3&&(t+="="),t=t.replace(/-/g,"+"),t=t.replace(/_/g,"/")}function rn(t){return t.length%2==1&&(t="0"+t),en(n(t))}function on(t){return r(nn(t))}function sn(t){return n(_n(kn(t)))}function an(t){return decodeURIComponent(xn(r(t)))}function un(t){return _n(kn(t))}function cn(t){return decodeURIComponent(xn(t))}function fn(t){for(var e="",n=0;n<t.length-1;n+=2)e+=String.fromCharCode(parseInt(t.substr(n,2),16));return e}function hn(t){for(var e="",n=0;n<t.length;n++)e+=("0"+t.charCodeAt(n).toString(16)).slice(-2);return e}function ln(t){return n(t)}function pn(t){var e=ln(t),n=e.replace(/(.{64})/g,"$1\r\n");return n=n.replace(/\r\n$/,"")}function dn(t){var e=t.replace(/[^0-9A-Za-z\/+=]*/g,""),n=r(e);return n}function gn(t,e){var n=pn(t);return"-----BEGIN "+e+"-----\r\n"+n+"\r\n-----END "+e+"-----\r\n"}function vn(t,e){if(t.indexOf("-----BEGIN ")==-1)throw"can't find PEM header: "+e;return void 0!==e?(t=t.replace("-----BEGIN "+e+"-----",""),t=t.replace("-----END "+e+"-----","")):(t=t.replace(/-----BEGIN [^-]+-----/,""),t=t.replace(/-----END [^-]+-----/,"")),dn(t)}function yn(t){if(t.length%2!=0)throw"input is not even length";if(null==t.match(/^[0-9A-Fa-f]+$/))throw"input is not hexadecimal";for(var e=new ArrayBuffer(t.length/2),n=new DataView(e),r=0;r<t.length/2;r++)n.setUint8(r,parseInt(t.substr(2*r,2),16));return e}function mn(t){for(var e="",n=new DataView(t),r=0;r<t.byteLength;r++)e+=("00"+n.getUint8(r).toString(16)).slice(-2);return e}function Sn(t){var e,n,r,i,o,s,a,u,c,f,h;if(h=t.match(/^(\d{2}|\d{4})(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)(|\.\d+)Z$/))return u=h[1],e=parseInt(u),2===u.length&&(50<=e&&e<100?e=1900+e:0<=e&&e<50&&(e=2e3+e)),n=parseInt(h[2])-1,r=parseInt(h[3]),i=parseInt(h[4]),o=parseInt(h[5]),s=parseInt(h[6]),a=0,c=h[7],""!==c&&(f=(c.substr(1)+"00").substr(0,3),a=parseInt(f)),Date.UTC(e,n,r,i,o,s,a);throw"unsupported zulu format: "+t}function bn(t){var e=Sn(t);return~~(e/1e3)}function Fn(t){return new Date(Sn(t))}function wn(t,e,n){var r,i=t.getUTCFullYear();if(e){if(i<1950||2049<i)throw"not proper year for UTCTime: "+i;r=(""+i).slice(-2)}else r=("000"+i).slice(-4);if(r+=("0"+(t.getUTCMonth()+1)).slice(-2),r+=("0"+t.getUTCDate()).slice(-2),r+=("0"+t.getUTCHours()).slice(-2),r+=("0"+t.getUTCMinutes()).slice(-2),r+=("0"+t.getUTCSeconds()).slice(-2),n){var o=t.getUTCMilliseconds();0!==o&&(o=("00"+o).slice(-3),o=o.replace(/0+$/g,""),r+="."+o)}return r+="Z"}function _n(t){return t.replace(/%/g,"")}function xn(t){return t.replace(/(..)/g,"%$1")}function En(t){var e="malformed IPv6 address";if(!t.match(/^[0-9A-Fa-f:]+$/))throw e;t=t.toLowerCase();var n=t.split(":").length-1;if(n<2)throw e;var r=":".repeat(7-n+2);t=t.replace("::",r);var i=t.split(":");if(8!=i.length)throw e;for(var o=0;o<8;o++)i[o]=("0000"+i[o]).slice(-4);return i.join("")}function An(t){if(!t.match(/^[0-9A-Fa-f]{32}$/))throw"malformed IPv6 address octet";t=t.toLowerCase();for(var e=t.match(/.{1,4}/g),n=0;n<8;n++)e[n]=e[n].replace(/^0+/,""),""==e[n]&&(e[n]="0");t=":"+e.join(":")+":";var r=t.match(/:(0:){2,}/g);if(null===r)return t.slice(1,-1);for(var i="",n=0;n<r.length;n++)r[n].length>i.length&&(i=r[n]);return t=t.replace(i,"::"),t.slice(1,-1)}function Pn(t){var e="malformed hex value";if(!t.match(/^([0-9A-Fa-f][0-9A-Fa-f]){1,}$/))throw e;if(8!=t.length)return 32==t.length?An(t):t;var n;try{return n=parseInt(t.substr(0,2),16)+"."+parseInt(t.substr(2,2),16)+"."+parseInt(t.substr(4,2),16)+"."+parseInt(t.substr(6,2),16)}catch(t){throw e}}function Cn(t){var e="malformed IP address";if(t=t.toLowerCase(t),!t.match(/^[0-9.]+$/)){if(t.match(/^[0-9a-f:]+$/)&&t.indexOf(":")!==-1)return En(t);throw e}var n=t.split(".");if(4!==n.length)throw e;var r="";try{for(var i=0;i<4;i++){var o=parseInt(n[i]);r+=("0"+o.toString(16)).slice(-2)}return r}catch(t){throw e}}function kn(t){for(var e=encodeURIComponent(t),n="",r=0;r<e.length;r++)"%"==e[r]?(n+=e.substr(r,3),r+=2):n=n+"%"+Xe(e[r]);return n}function Tn(t){return t=t.replace(/\r\n/gm,"\n")}function Rn(t){return t=t.replace(/\r\n/gm,"\n"),t=t.replace(/\n/gm,"\r\n")}function In(t){return t.length%2==1?"0"+t:t.substr(0,1)>"7"?"00"+t:t}function Dn(t){t=t.replace(/^\s*\[\s*/,""),t=t.replace(/\s*\]\s*$/,""),t=t.replace(/\s*/g,"");try{var e=t.split(/,/).map(function(t,e,n){var r=parseInt(t);if(r<0||255<r)throw"integer not in range 0-255";var i=("00"+r.toString(16)).slice(-2);return i}).join("");return e}catch(t){throw"malformed integer array string: "+t}}function Nn(t,e){for(var n="",r=e/4-t.length,i=0;i<r;i++)n+="0";return n+t}function On(t,e,n){for(var r="",i=0;r.length<e;)r+=fn(n(hn(t+String.fromCharCode.apply(String,[(4278190080&i)>>24,(16711680&i)>>16,(65280&i)>>8,255&i])))),i+=1;return r}function jn(t){for(var e in hr.crypto.Util.DIGESTINFOHEAD){var n=hr.crypto.Util.DIGESTINFOHEAD[e],r=n.length;if(t.substring(0,r)==n){var i=[e,t.substring(r)];return i}}return[]}function Ln(){var t=fr,e=t.getChildIdx,n=t.getV,r=t.getTLV,i=t.getVbyList,o=t.getTLVbyList,s=t.getIdxbyList,a=t.getVidx,u=t.oidname,c=Ln,f=vn;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"!==o(this.hex,0,[0,0])?(this.version=1,this.foffset=-1,1):(this.version=3,3)},this.getSerialNumberHex=function(){return i(this.hex,0,[0,1+this.foffset],"02")},this.getSignatureAlgorithmField=function(){return u(i(this.hex,0,[0,2+this.foffset,0],"06"))},this.getIssuerHex=function(){return o(this.hex,0,[0,3+this.foffset],"30")},this.getIssuerString=function(){return c.hex2dn(this.getIssuerHex())},this.getSubjectHex=function(){return o(this.hex,0,[0,5+this.foffset],"30")},this.getSubjectString=function(){return c.hex2dn(this.getSubjectHex())},this.getNotBefore=function(){var t=i(this.hex,0,[0,4+this.foffset,0]);return t=t.replace(/(..)/g,"%$1"),t=decodeURIComponent(t)},this.getNotAfter=function(){var t=i(this.hex,0,[0,4+this.foffset,1]);return t=t.replace(/(..)/g,"%$1"),t=decodeURIComponent(t)},this.getPublicKeyHex=function(){return t.getTLVbyList(this.hex,0,[0,6+this.foffset],"30")},this.getPublicKeyIdx=function(){return s(this.hex,0,[0,6+this.foffset],"30")},this.getPublicKeyContentIdx=function(){var t=this.getPublicKeyIdx();return s(this.hex,t,[1,0],"30")},this.getPublicKey=function(){return gr.getKey(this.getPublicKeyHex(),null,"pkcs8pub")},this.getSignatureAlgorithmName=function(){return u(i(this.hex,0,[1,0],"06"))},this.getSignatureValueHex=function(){return i(this.hex,0,[2],"03",!0)},this.verifySignature=function(t){var e=this.getSignatureAlgorithmName(),n=this.getSignatureValueHex(),r=o(this.hex,0,[0],"30"),i=new hr.crypto.Signature({alg:e});return i.init(t),i.updateHex(r),i.verify(n)},this.parseExt=function(){if(3!==this.version)return-1;var n=s(this.hex,0,[0,7,0],"30"),r=e(this.hex,n);this.aExtInfo=new Array;for(var o=0;o<r.length;o++){var u={};u.critical=!1;var c=e(this.hex,r[o]),f=0;3===c.length&&(u.critical=!0,f=1),u.oid=t.hextooidstr(i(this.hex,r[o],[0],"06"));var h=s(this.hex,r[o],[1+f]);u.vidx=a(this.hex,h),this.aExtInfo.push(u)}},this.getExtInfo=function(t){var e=this.aExtInfo,n=t;if(t.match(/^[0-9.]+$/)||(n=hr.asn1.x509.OID.name2oid(t)),""!==n)for(var r=0;r<e.length;r++)if(e[r].oid===n)return e[r]},this.getExtBasicConstraints=function(){var t=this.getExtInfo("basicConstraints");if(void 0===t)return t;var e=n(this.hex,t.vidx);if(""===e)return{};if("0101ff"===e)return{cA:!0};if("0101ff02"===e.substr(0,8)){var r=n(e,6),i=parseInt(r,16);return{cA:!0,pathLen:i}}throw"basicConstraints parse error"},this.getExtKeyUsageBin=function(){var t=this.getExtInfo("keyUsage");if(void 0===t)return"";var e=n(this.hex,t.vidx);if(e.length%2!=0||e.length<=2)throw"malformed key usage value";var r=parseInt(e.substr(0,2)),i=parseInt(e.substr(2),16).toString(2);return i.substr(0,i.length-r)},this.getExtKeyUsageString=function(){for(var t=this.getExtKeyUsageBin(),e=new Array,n=0;n<t.length;n++)"1"==t.substr(n,1)&&e.push(Ln.KEYUSAGE_NAME[n]);return e.join(",")},this.getExtSubjectKeyIdentifier=function(){var t=this.getExtInfo("subjectKeyIdentifier");return void 0===t?t:n(this.hex,t.vidx)},this.getExtAuthorityKeyIdentifier=function(){var t=this.getExtInfo("authorityKeyIdentifier");if(void 0===t)return t;for(var i={},o=r(this.hex,t.vidx),s=e(o,0),a=0;a<s.length;a++)"80"===o.substr(s[a],2)&&(i.kid=n(o,s[a]));return i},this.getExtExtKeyUsageName=function(){var t=this.getExtInfo("extKeyUsage");if(void 0===t)return t;var i=new Array,o=r(this.hex,t.vidx);if(""===o)return i;for(var s=e(o,0),a=0;a<s.length;a++)i.push(u(n(o,s[a])));return i},this.getExtSubjectAltName=function(){for(var t=this.getExtSubjectAltName2(),e=new Array,n=0;n<t.length;n++)"DNS"===t[n][0]&&e.push(t[n][1]);return e},this.getExtSubjectAltName2=function(){var t,i,o,s=this.getExtInfo("subjectAltName");if(void 0===s)return s;for(var a=new Array,u=r(this.hex,s.vidx),c=e(u,0),f=0;f<c.length;f++)o=u.substr(c[f],2),t=n(u,c[f]),"81"===o&&(i=cn(t),a.push(["MAIL",i])),"82"===o&&(i=cn(t),a.push(["DNS",i])),"84"===o&&(i=Ln.hex2dn(t,0),a.push(["DN",i])),"86"===o&&(i=cn(t),a.push(["URI",i])),"87"===o&&(i=Pn(t),a.push(["IP",i]));return a},this.getExtCRLDistributionPointsURI=function(){var t=this.getExtInfo("cRLDistributionPoints");if(void 0===t)return t;for(var n=new Array,r=e(this.hex,t.vidx),o=0;o<r.length;o++)try{var s=i(this.hex,r[o],[0,0,0],"86"),a=cn(s);n.push(a)}catch(t){}return n},this.getExtAIAInfo=function(){var t=this.getExtInfo("authorityInfoAccess");if(void 0===t)return t;for(var n={ocsp:[],caissuer:[]},r=e(this.hex,t.vidx),o=0;o<r.length;o++){var s=i(this.hex,r[o],[0],"06"),a=i(this.hex,r[o],[1],"86");"2b06010505073001"===s&&n.ocsp.push(cn(a)),"2b06010505073002"===s&&n.caissuer.push(cn(a))}return n},this.getExtCertificatePolicies=function(){var t=this.getExtInfo("certificatePolicies");if(void 0===t)return t;for(var o=r(this.hex,t.vidx),s=[],a=e(o,0),c=0;c<a.length;c++){var f={},h=e(o,a[c]);if(f.id=u(n(o,h[0])),2===h.length)for(var l=e(o,h[1]),p=0;p<l.length;p++){var d=i(o,l[p],[0],"06");"2b06010505070201"===d?f.cps=cn(i(o,l[p],[1])):"2b06010505070202"===d&&(f.unotice=cn(i(o,l[p],[1,0])))}s.push(f)}return s},this.readCertPEM=function(t){this.readCertHex(f(t))},this.readCertHex=function(t){this.hex=t,this.getVersion();try{s(this.hex,0,[0,7],"a3"),this.parseExt()}catch(t){}},this.getInfo=function(){var t,e,n;if(t="Basic Fields\n",t+=" serial number: "+this.getSerialNumberHex()+"\n",t+=" signature algorithm: "+this.getSignatureAlgorithmField()+"\n",t+=" issuer: "+this.getIssuerString()+"\n",t+=" notBefore: "+this.getNotBefore()+"\n",t+=" notAfter: "+this.getNotAfter()+"\n",t+=" subject: "+this.getSubjectString()+"\n",t+=" subject public key info: \n",e=this.getPublicKey(),t+=" key algorithm: "+e.type+"\n","RSA"===e.type&&(t+=" n="+In(e.n.toString(16)).substr(0,16)+"...\n",t+=" e="+In(e.e.toString(16))+"\n"),n=this.aExtInfo,void 0!==n&&null!==n){t+="X509v3 Extensions:\n";for(var r=0;r<n.length;r++){var i=n[r],o=hr.asn1.x509.OID.oid2name(i.oid);""===o&&(o=i.oid);var s="";if(i.critical===!0&&(s="CRITICAL"),t+=" "+o+" "+s+":\n","basicConstraints"===o){var a=this.getExtBasicConstraints();void 0===a.cA?t+=" {}\n":(t+=" cA=true",void 0!==a.pathLen&&(t+=", pathLen="+a.pathLen),t+="\n")}else if("keyUsage"===o)t+=" "+this.getExtKeyUsageString()+"\n";else if("subjectKeyIdentifier"===o)t+=" "+this.getExtSubjectKeyIdentifier()+"\n";else if("authorityKeyIdentifier"===o){var u=this.getExtAuthorityKeyIdentifier();void 0!==u.kid&&(t+=" kid="+u.kid+"\n")}else if("extKeyUsage"===o){var c=this.getExtExtKeyUsageName();t+=" "+c.join(", ")+"\n"}else if("subjectAltName"===o){var f=this.getExtSubjectAltName2();t+=" "+f+"\n"}else if("cRLDistributionPoints"===o){var h=this.getExtCRLDistributionPointsURI();t+=" "+h+"\n"}else if("authorityInfoAccess"===o){var l=this.getExtAIAInfo();void 0!==l.ocsp&&(t+=" ocsp: "+l.ocsp.join(",")+"\n"),void 0!==l.caissuer&&(t+=" caissuer: "+l.caissuer.join(",")+"\n")}else if("certificatePolicies"===o)for(var p=this.getExtCertificatePolicies(),d=0;d<p.length;d++)void 0!==p[d].id&&(t+=" policy oid: "+p[d].id+"\n"),void 0!==p[d].cps&&(t+=" cps: "+p[d].cps+"\n")}}return t+="signature algorithm: "+this.getSignatureAlgorithmName()+"\n",t+="signature: "+this.getSignatureValueHex().substr(0,16)+"...\n"}}var Mn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bn={};Bn.userAgent=!1;var Hn={};/*!
Copyright (c) 2011, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.com/yui/license.html
version: 2.9.0
*/
if(void 0===Un)var Un={};Un.lang={extend:function(t,e,n){if(!e||!t)throw new Error("YAHOO.lang.extend failed, please check that all dependencies are included.");var r=function(){};if(r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t,t.superclass=e.prototype,e.prototype.constructor==Object.prototype.constructor&&(e.prototype.constructor=e),n){var i;for(i in n)t.prototype[i]=n[i];var o=function(){},s=["toString","valueOf"];try{/MSIE/.test(Bn.userAgent)&&(o=function(t,e){for(i=0;i<s.length;i+=1){var n=s[i],r=e[n];"function"==typeof r&&r!=Object.prototype[n]&&(t[n]=r)}})}catch(t){}o(t.prototype,n)}}};/*! CryptoJS v3.1.2 core-fix.js
* code.google.com/p/crypto-js
* (c) 2009-2013 by Jeff Mott. All rights reserved.
* code.google.com/p/crypto-js/wiki/License
* THIS IS FIX of 'core.js' to fix Hmac issue.
* https://code.google.com/p/crypto-js/issues/detail?id=84
* https://crypto-js.googlecode.com/svn-history/r667/branches/3.x/src/core.js
*/
var Vn=Vn||function(t,e){var n={},r=n.lib={},i=r.Base=function(){function t(){}return{extend:function(e){t.prototype=this;var n=new t;return e&&n.mixIn(e),n.hasOwnProperty("init")||(n.init=function(){n.$super.init.apply(this,arguments)}),n.init.prototype=n,n.$super=this,n},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),o=r.WordArray=i.extend({init:function(t,n){t=this.words=t||[],n!=e?this.sigBytes=n:this.sigBytes=4*t.length},toString:function(t){return(t||a).stringify(this)},concat:function(t){var e=this.words,n=t.words,r=this.sigBytes,i=t.sigBytes;if(this.clamp(),r%4)for(var o=0;o<i;o++){var s=n[o>>>2]>>>24-o%4*8&255;e[r+o>>>2]|=s<<24-(r+o)%4*8}else for(var o=0;o<i;o+=4)e[r+o>>>2]=n[o>>>2];return this.sigBytes+=i,this},clamp:function(){var e=this.words,n=this.sigBytes;e[n>>>2]&=4294967295<<32-n%4*8,e.length=t.ceil(n/4)},clone:function(){var t=i.clone.call(this);return t.words=this.words.slice(0),t},random:function(e){for(var n=[],r=0;r<e;r+=4)n.push(4294967296*t.random()|0);return new o.init(n,e)}}),s=n.enc={},a=s.Hex={stringify:function(t){for(var e=t.words,n=t.sigBytes,r=[],i=0;i<n;i++){var o=e[i>>>2]>>>24-i%4*8&255;r.push((o>>>4).toString(16)),r.push((15&o).toString(16))}return r.join("")},parse:function(t){for(var e=t.length,n=[],r=0;r<e;r+=2)n[r>>>3]|=parseInt(t.substr(r,2),16)<<24-r%8*4;return new o.init(n,e/2)}},u=s.Latin1={stringify:function(t){for(var e=t.words,n=t.sigBytes,r=[],i=0;i<n;i++){var o=e[i>>>2]>>>24-i%4*8&255;r.push(String.fromCharCode(o))}return r.join("")},parse:function(t){for(var e=t.length,n=[],r=0;r<e;r++)n[r>>>2]|=(255&t.charCodeAt(r))<<24-r%4*8;return new o.init(n,e)}},c=s.Utf8={stringify:function(t){try{return decodeURIComponent(escape(u.stringify(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(t){return u.parse(unescape(encodeURIComponent(t)))}},f=r.BufferedBlockAlgorithm=i.extend({reset:function(){this._data=new o.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=c.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(e){var n=this._data,r=n.words,i=n.sigBytes,s=this.blockSize,a=4*s,u=i/a;u=e?t.ceil(u):t.max((0|u)-this._minBufferSize,0);var c=u*s,f=t.min(4*c,i);if(c){for(var h=0;h<c;h+=s)this._doProcessBlock(r,h);var l=r.splice(0,c);n.sigBytes-=f}return new o.init(l,f)},clone:function(){var t=i.clone.call(this);return t._data=this._data.clone(),t},_minBufferSize:0}),h=(r.Hasher=f.extend({cfg:i.extend(),init:function(t){this.cfg=this.cfg.extend(t),this.reset()},reset:function(){f.reset.call(this),this._doReset()},update:function(t){return this._append(t),this._process(),this},finalize:function(t){t&&this._append(t);var e=this._doFinalize();return e},blockSize:16,_createHelper:function(t){return function(e,n){return new t.init(n).finalize(e)}},_createHmacHelper:function(t){return function(e,n){return new h.HMAC.init(t,n).finalize(e)}}}),n.algo={});return n}(Math);!function(t){var e=Vn,n=e.lib,r=n.Base,i=n.WordArray,e=e.x64={};e.Word=r.extend({init:function(t,e){this.high=t,this.low=e}}),e.WordArray=r.extend({init:function(e,n){e=this.words=e||[],this.sigBytes=n!=t?n:8*e.length},toX32:function(){for(var t=this.words,e=t.length,n=[],r=0;r<e;r++){var o=t[r];n.push(o.high),n.push(o.low)}return i.create(n,this.sigBytes)},clone:function(){for(var t=r.clone.call(this),e=t.words=this.words.slice(0),n=e.length,i=0;i<n;i++)e[i]=e[i].clone();return t}})}(),function(){var t=Vn,e=t.lib.WordArray;t.enc.Base64={stringify:function(t){var e=t.words,n=t.sigBytes,r=this._map;t.clamp(),t=[];for(var i=0;i<n;i+=3)for(var o=(e[i>>>2]>>>24-8*(i%4)&255)<<16|(e[i+1>>>2]>>>24-8*((i+1)%4)&255)<<8|e[i+2>>>2]>>>24-8*((i+2)%4)&255,s=0;4>s&&i+.75*s<n;s++)t.push(r.charAt(o>>>6*(3-s)&63));if(e=r.charAt(64))for(;t.length%4;)t.push(e);return t.join("")},parse:function(t){var n=t.length,r=this._map,i=r.charAt(64);i&&(i=t.indexOf(i),-1!=i&&(n=i));for(var i=[],o=0,s=0;s<n;s++)if(s%4){var a=r.indexOf(t.charAt(s-1))<<2*(s%4),u=r.indexOf(t.charAt(s))>>>6-2*(s%4);i[o>>>2]|=(a|u)<<24-8*(o%4),o++}return e.create(i,o)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),function(t){for(var e=Vn,n=e.lib,r=n.WordArray,i=n.Hasher,n=e.algo,o=[],s=[],a=function(t){return 4294967296*(t-(0|t))|0},u=2,c=0;64>c;){var f;t:{f=u;for(var h=t.sqrt(f),l=2;l<=h;l++)if(!(f%l)){f=!1;break t}f=!0}f&&(8>c&&(o[c]=a(t.pow(u,.5))),s[c]=a(t.pow(u,1/3)),c++),u++}var p=[],n=n.SHA256=i.extend({_doReset:function(){this._hash=new r.init(o.slice(0))},_doProcessBlock:function(t,e){for(var n=this._hash.words,r=n[0],i=n[1],o=n[2],a=n[3],u=n[4],c=n[5],f=n[6],h=n[7],l=0;64>l;l++){if(16>l)p[l]=0|t[e+l];else{var d=p[l-15],g=p[l-2];p[l]=((d<<25|d>>>7)^(d<<14|d>>>18)^d>>>3)+p[l-7]+((g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10)+p[l-16]}d=h+((u<<26|u>>>6)^(u<<21|u>>>11)^(u<<7|u>>>25))+(u&c^~u&f)+s[l]+p[l],g=((r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22))+(r&i^r&o^i&o),h=f,f=c,c=u,u=a+d|0,a=o,o=i,i=r,r=d+g|0}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+o|0,n[3]=n[3]+a|0,n[4]=n[4]+u|0,n[5]=n[5]+c|0,n[6]=n[6]+f|0,n[7]=n[7]+h|0},_doFinalize:function(){var e=this._data,n=e.words,r=8*this._nDataBytes,i=8*e.sigBytes;return n[i>>>5]|=128<<24-i%32,n[(i+64>>>9<<4)+14]=t.floor(r/4294967296),n[(i+64>>>9<<4)+15]=r,e.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var t=i.clone.call(this);return t._hash=this._hash.clone(),t}});e.SHA256=i._createHelper(n),e.HmacSHA256=i._createHmacHelper(n)}(Math),function(){function t(){return i.create.apply(i,arguments)}for(var e=Vn,n=e.lib.Hasher,r=e.x64,i=r.Word,o=r.WordArray,r=e.algo,s=[t(1116352408,3609767458),t(1899447441,602891725),t(3049323471,3964484399),t(3921009573,2173295548),t(961987163,4081628472),t(1508970993,3053834265),t(2453635748,2937671579),t(2870763221,3664609560),t(3624381080,2734883394),t(310598401,1164996542),t(607225278,1323610764),t(1426881987,3590304994),t(1925078388,4068182383),t(2162078206,991336113),t(2614888103,633803317),t(3248222580,3479774868),t(3835390401,2666613458),t(4022224774,944711139),t(264347078,2341262773),t(604807628,2007800933),t(770255983,1495990901),t(1249150122,1856431235),t(1555081692,3175218132),t(1996064986,2198950837),t(2554220882,3999719339),t(2821834349,766784016),t(2952996808,2566594879),t(3210313671,3203337956),t(3336571891,1034457026),t(3584528711,2466948901),t(113926993,3758326383),t(338241895,168717936),t(666307205,1188179964),t(773529912,1546045734),t(1294757372,1522805485),t(1396182291,2643833823),t(1695183700,2343527390),t(1986661051,1014477480),t(2177026350,1206759142),t(2456956037,344077627),t(2730485921,1290863460),t(2820302411,3158454273),t(3259730800,3505952657),t(3345764771,106217008),t(3516065817,3606008344),t(3600352804,1432725776),t(4094571909,1467031594),t(275423344,851169720),t(430227734,3100823752),t(506948616,1363258195),t(659060556,3750685593),t(883997877,3785050280),t(958139571,3318307427),t(1322822218,3812723403),t(1537002063,2003034995),t(1747873779,3602036899),t(1955562222,1575990012),t(2024104815,1125592928),t(2227730452,2716904306),t(2361852424,442776044),t(2428436474,593698344),t(2756734187,3733110249),t(3204031479,2999351573),t(3329325298,3815920427),t(3391569614,3928383900),t(3515267271,566280711),t(3940187606,3454069534),t(4118630271,4000239992),t(116418474,1914138554),t(174292421,2731055270),t(289380356,3203993006),t(460393269,320620315),t(685471733,587496836),t(852142971,1086792851),t(1017036298,365543100),t(1126000580,2618297676),t(1288033470,3409855158),t(1501505948,4234509866),t(1607167915,987167468),t(1816402316,1246189591)],a=[],u=0;80>u;u++)a[u]=t();r=r.SHA512=n.extend({_doReset:function(){this._hash=new o.init([new i.init(1779033703,4089235720),new i.init(3144134277,2227873595),new i.init(1013904242,4271175723),new i.init(2773480762,1595750129),new i.init(1359893119,2917565137),new i.init(2600822924,725511199),new i.init(528734635,4215389547),new i.init(1541459225,327033209)])},_doProcessBlock:function(t,e){for(var n=this._hash.words,r=n[0],i=n[1],o=n[2],u=n[3],c=n[4],f=n[5],h=n[6],n=n[7],l=r.high,p=r.low,d=i.high,g=i.low,v=o.high,y=o.low,m=u.high,S=u.low,b=c.high,F=c.low,w=f.high,_=f.low,x=h.high,E=h.low,A=n.high,P=n.low,C=l,k=p,T=d,R=g,I=v,D=y,N=m,O=S,j=b,L=F,M=w,B=_,H=x,U=E,V=A,K=P,q=0;80>q;q++){var W=a[q];if(16>q)var J=W.high=0|t[e+2*q],G=W.low=0|t[e+2*q+1];else{var J=a[q-15],G=J.high,z=J.low,J=(G>>>1|z<<31)^(G>>>8|z<<24)^G>>>7,z=(z>>>1|G<<31)^(z>>>8|G<<24)^(z>>>7|G<<25),Y=a[q-2],G=Y.high,$=Y.low,Y=(G>>>19|$<<13)^(G<<3|$>>>29)^G>>>6,$=($>>>19|G<<13)^($<<3|G>>>29)^($>>>6|G<<26),G=a[q-7],X=G.high,Z=a[q-16],Q=Z.high,Z=Z.low,G=z+G.low,J=J+X+(G>>>0<z>>>0?1:0),G=G+$,J=J+Y+(G>>>0<$>>>0?1:0),G=G+Z,J=J+Q+(G>>>0<Z>>>0?1:0);W.high=J,W.low=G}var X=j&M^~j&H,Z=L&B^~L&U,W=C&T^C&I^T&I,tt=k&R^k&D^R&D,z=(C>>>28|k<<4)^(C<<30|k>>>2)^(C<<25|k>>>7),Y=(k>>>28|C<<4)^(k<<30|C>>>2)^(k<<25|C>>>7),$=s[q],et=$.high,nt=$.low,$=K+((L>>>14|j<<18)^(L>>>18|j<<14)^(L<<23|j>>>9)),Q=V+((j>>>14|L<<18)^(j>>>18|L<<14)^(j<<23|L>>>9))+($>>>0<K>>>0?1:0),$=$+Z,Q=Q+X+($>>>0<Z>>>0?1:0),$=$+nt,Q=Q+et+($>>>0<nt>>>0?1:0),$=$+G,Q=Q+J+($>>>0<G>>>0?1:0),G=Y+tt,W=z+W+(G>>>0<Y>>>0?1:0),V=H,K=U,H=M,U=B,M=j,B=L,L=O+$|0,j=N+Q+(L>>>0<O>>>0?1:0)|0,N=I,O=D,I=T,D=R,T=C,R=k,k=$+G|0,C=Q+W+(k>>>0<$>>>0?1:0)|0}p=r.low=p+k,r.high=l+C+(p>>>0<k>>>0?1:0),g=i.low=g+R,i.high=d+T+(g>>>0<R>>>0?1:0),y=o.low=y+D,o.high=v+I+(y>>>0<D>>>0?1:0),S=u.low=S+O,u.high=m+N+(S>>>0<O>>>0?1:0),F=c.low=F+L,c.high=b+j+(F>>>0<L>>>0?1:0),_=f.low=_+B,f.high=w+M+(_>>>0<B>>>0?1:0),E=h.low=E+U,h.high=x+H+(E>>>0<U>>>0?1:0),P=n.low=P+K,n.high=A+V+(P>>>0<K>>>0?1:0)},_doFinalize:function(){var t=this._data,e=t.words,n=8*this._nDataBytes,r=8*t.sigBytes;return e[r>>>5]|=128<<24-r%32,e[(r+128>>>10<<5)+30]=Math.floor(n/4294967296),e[(r+128>>>10<<5)+31]=n,t.sigBytes=4*e.length,this._process(),this._hash.toX32()},clone:function(){var t=n.clone.call(this);return t._hash=this._hash.clone(),t},blockSize:32}),e.SHA512=n._createHelper(r),e.HmacSHA512=n._createHmacHelper(r)}(),function(){var t=Vn,e=t.x64,n=e.Word,r=e.WordArray,e=t.algo,i=e.SHA512,e=e.SHA384=i.extend({_doReset:function(){this._hash=new r.init([new n.init(3418070365,3238371032),new n.init(1654270250,914150663),new n.init(2438529370,812702999),new n.init(355462360,4144912697),new n.init(1731405415,4290775857),new n.init(2394180231,1750603025),new n.init(3675008525,1694076839),new n.init(1203062813,3204075428)])},_doFinalize:function(){var t=i._doFinalize.call(this);return t.sigBytes-=16,t}});t.SHA384=i._createHelper(e),t.HmacSHA384=i._createHmacHelper(e)}();/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/
*/
var Kn,qn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Wn="=",Jn=0xdeadbeefcafe,Gn=15715070==(16777215&Jn);Gn&&"Microsoft Internet Explorer"==Bn.appName?(o.prototype.am=u,Kn=30):Gn&&"Netscape"!=Bn.appName?(o.prototype.am=a,Kn=26):(o.prototype.am=c,Kn=28),o.prototype.DB=Kn,o.prototype.DM=(1<<Kn)-1,o.prototype.DV=1<<Kn;var zn=52;o.prototype.FV=Math.pow(2,zn),o.prototype.F1=zn-Kn,o.prototype.F2=2*Kn-zn;var Yn,$n,Xn="0123456789abcdefghijklmnopqrstuvwxyz",Zn=new Array;for(Yn="0".charCodeAt(0),$n=0;$n<=9;++$n)Zn[Yn++]=$n;for(Yn="a".charCodeAt(0),$n=10;$n<36;++$n)Zn[Yn++]=$n;for(Yn="A".charCodeAt(0),$n=10;$n<36;++$n)Zn[Yn++]=$n;I.prototype.convert=D,I.prototype.revert=N,I.prototype.reduce=O,I.prototype.mulTo=j,I.prototype.sqrTo=L,B.prototype.convert=H,B.prototype.revert=U,B.prototype.reduce=V,B.prototype.mulTo=q,B.prototype.sqrTo=K,o.prototype.copyTo=l,o.prototype.fromInt=p,o.prototype.fromString=g,o.prototype.clamp=v,o.prototype.dlShiftTo=_,o.prototype.drShiftTo=x,o.prototype.lShiftTo=E,o.prototype.rShiftTo=A,o.prototype.subTo=P,o.prototype.multiplyTo=C,o.prototype.squareTo=k,o.prototype.divRemTo=T,o.prototype.invDigit=M,o.prototype.isEven=W,o.prototype.exp=J,o.prototype.toString=y,o.prototype.negate=m,o.prototype.abs=S,o.prototype.compareTo=b,o.prototype.bitLength=w,o.prototype.mod=R,o.prototype.modPowInt=G,o.ZERO=d(0),o.ONE=d(1),Mt.prototype.convert=Bt,Mt.prototype.revert=Bt,Mt.prototype.mulTo=Ht,Mt.prototype.sqrTo=Ut,Wt.prototype.convert=Jt,Wt.prototype.revert=Gt,Wt.prototype.reduce=zt,Wt.prototype.mulTo=$t,Wt.prototype.sqrTo=Yt;var Qn=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],tr=(1<<26)/Qn[Qn.length-1];o.prototype.chunkSize=Z,o.prototype.toRadix=tt,o.prototype.fromRadix=et,o.prototype.fromNumber=nt,o.prototype.bitwiseTo=at,o.prototype.changeBit=xt,o.prototype.addTo=Ct,o.prototype.dMultiply=jt,o.prototype.dAddOffset=Lt,o.prototype.multiplyLowerTo=Kt,o.prototype.multiplyUpperTo=qt,o.prototype.modInt=Qt,o.prototype.millerRabin=ne,o.prototype.clone=z,o.prototype.intValue=Y,o.prototype.byteValue=$,o.prototype.shortValue=X,o.prototype.signum=Q,o.prototype.toByteArray=rt,o.prototype.equals=it,o.prototype.min=ot,o.prototype.max=st,o.prototype.and=ct,o.prototype.or=ht,o.prototype.xor=pt,o.prototype.andNot=gt,o.prototype.not=vt,o.prototype.shiftLeft=yt,o.prototype.shiftRight=mt,o.prototype.getLowestSetBit=bt,o.prototype.bitCount=wt,o.prototype.testBit=_t,o.prototype.setBit=Et,o.prototype.clearBit=At,o.prototype.flipBit=Pt,o.prototype.add=kt,o.prototype.subtract=Tt,o.prototype.multiply=Rt,o.prototype.divide=Dt,o.prototype.remainder=Nt,o.prototype.divideAndRemainder=Ot,o.prototype.modPow=Xt,o.prototype.modInverse=te,o.prototype.pow=Vt,o.prototype.gcd=Zt,o.prototype.isProbablePrime=ee,o.prototype.square=It,re.prototype.init=ie,re.prototype.next=oe;var er,nr,rr,ir=256;if(null==nr){nr=new Array,rr=0;var or;if(void 0!==Hn&&(void 0!==Hn.crypto||void 0!==Hn.msCrypto)){var sr=Hn.crypto||Hn.msCrypto;if(sr.getRandomValues){var ar=new Uint8Array(32);for(sr.getRandomValues(ar),or=0;or<32;++or)nr[rr++]=ar[or]}else if("Netscape"==Bn.appName&&Bn.appVersion<"5"){var ur=Hn.crypto.random(32);for(or=0;or<ur.length;++or)nr[rr++]=255&ur.charCodeAt(or)}}for(;rr<ir;)or=Math.floor(65536*Math.random()),nr[rr++]=or>>>8,nr[rr++]=255∨rr=0,ue()}he.prototype.nextBytes=fe,ve.prototype.doPublic=me,ve.prototype.setPublic=ye,ve.prototype.encrypt=Se,ve.prototype.encryptOAEP=be,ve.prototype.type="RSA",Fe.prototype.equals=we,Fe.prototype.toBigInteger=_e,Fe.prototype.negate=xe,Fe.prototype.add=Ee,Fe.prototype.subtract=Ae,Fe.prototype.multiply=Pe,Fe.prototype.square=Ce,Fe.prototype.divide=ke,Te.prototype.getX=Re,Te.prototype.getY=Ie,Te.prototype.equals=De,Te.prototype.isInfinity=Ne,Te.prototype.negate=Oe,Te.prototype.add=je,Te.prototype.twice=Le,Te.prototype.multiply=Me,Te.prototype.multiplyTwo=Be,He.prototype.getQ=Ue,He.prototype.getA=Ve,He.prototype.getB=Ke,He.prototype.equals=qe,He.prototype.getInfinity=We,He.prototype.fromBigInteger=Je,He.prototype.decodePointHex=Ge;/*! Mike Samuel (c) 2009 | code.google.com/p/json-sans-eval
*/
var cr=function(){function t(t,e,n){return e?s[e]:String.fromCharCode(parseInt(n,16))}var e="(?:-?\\b(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?(?:[eE][+-]?[0-9]+)?\\b)",n='(?:[^\\0-\\x08\\x0a-\\x1f"\\\\]|\\\\(?:["/\\\\bfnrt]|u[0-9A-Fa-f]{4}))',r='(?:"'+n+'*")',i=new RegExp("(?:false|true|null|[\\{\\}\\[\\]]|"+e+"|"+r+")","g"),o=new RegExp("\\\\(?:([^u])|u(.{4}))","g"),s={'"':'"',"/":"/","\\":"\\",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"},a=new String(""),u="\\",c=({"{":Object,"[":Array},Object.hasOwnProperty);return function(e,n){var r,s=e.match(i),f=s[0],h=!1;"{"===f?r={}:"["===f?r=[]:(r=[],h=!0);for(var l,p=[r],d=1-h,g=s.length;d<g;++d){f=s[d];var v;switch(f.charCodeAt(0)){default:v=p[0],v[l||v.length]=+f,l=void 0;break;case 34:if(f=f.substring(1,f.length-1),f.indexOf(u)!==-1&&(f=f.replace(o,t)),v=p[0],!l){if(!(v instanceof Array)){l=f||a;break}l=v.length}v[l]=f,l=void 0;break;case 91:v=p[0],p.unshift(v[l||v.length]=[]),l=void 0;break;case 93:p.shift();break;case 102:v=p[0],v[l||v.length]=!1,l=void 0;break;case 110:v=p[0],v[l||v.length]=null,l=void 0;break;case 116:v=p[0],v[l||v.length]=!0,l=void 0;break;case 123:v=p[0],p.unshift(v[l||v.length]={}),l=void 0;break;case 125:p.shift()}}if(h){if(1!==p.length)throw new Error;r=r[0]}else if(p.length)throw new Error;if(n){var y=function t(e,r){var i=e[r];if(i&&"object"===("undefined"==typeof i?"undefined":Mn(i))){var o=null;for(var s in i)if(c.call(i,s)&&i!==e){var a=t(i,s);void 0!==a?i[s]=a:(o||(o=[]),o.push(s))}if(o)for(var u=o.length;--u>=0;)delete i[o[u]]}return n.call(e,r,i)};r=y({"":r},"")}return r}}();"undefined"!=typeof hr&&hr||(hr={}),"undefined"!=typeof hr.asn1&&hr.asn1||(hr.asn1={}),hr.asn1.ASN1Util=new function(){this.integerToByteHex=function(t){var e=t.toString(16);return e.length%2==1&&(e="0"+e),e},this.bigIntToMinTwosComplementsHex=function(t){var e=t.toString(16);if("-"!=e.substr(0,1))e.length%2==1?e="0"+e:e.match(/^[0-7]/)||(e="00"+e);else{var n=e.substr(1),r=n.length;r%2==1?r+=1:e.match(/^[0-7]/)||(r+=2);for(var i="",s=0;s<r;s++)i+="f";var a=new o(i,16),u=a.xor(t).add(o.ONE);e=u.toString(16).replace(/^-/,"")}return e},this.getPEMStringFromHex=function(t,e){return gn(t,e)},this.newObject=function(t){var e=hr,n=e.asn1,r=n.DERBoolean,i=n.DERInteger,o=n.DERBitString,s=n.DEROctetString,a=n.DERNull,u=n.DERObjectIdentifier,c=n.DEREnumerated,f=n.DERUTF8String,h=n.DERNumericString,l=n.DERPrintableString,p=n.DERTeletexString,d=n.DERIA5String,g=n.DERUTCTime,v=n.DERGeneralizedTime,y=n.DERSequence,m=n.DERSet,S=n.DERTaggedObject,b=n.ASN1Util.newObject,F=Object.keys(t);if(1!=F.length)throw"key of param shall be only one.";var w=F[0];if(":bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:seq:set:tag:".indexOf(":"+w+":")==-1)throw"undefined key: "+w;if("bool"==w)return new r(t[w]);if("int"==w)return new i(t[w]);if("bitstr"==w)return new o(t[w]);if("octstr"==w)return new s(t[w]);if("null"==w)return new a(t[w]);if("oid"==w)return new u(t[w]);if("enum"==w)return new c(t[w]);if("utf8str"==w)return new f(t[w]);if("numstr"==w)return new h(t[w]);if("prnstr"==w)return new l(t[w]);if("telstr"==w)return new p(t[w]);if("ia5str"==w)return new d(t[w]);if("utctime"==w)return new g(t[w]);if("gentime"==w)return new v(t[w]);if("seq"==w){for(var _=t[w],x=[],E=0;E<_.length;E++){var A=b(_[E]);x.push(A)}return new y({array:x})}if("set"==w){for(var _=t[w],x=[],E=0;E<_.length;E++){var A=b(_[E]);x.push(A)}return new m({array:x})}if("tag"==w){var P=t[w];if("[object Array]"===Object.prototype.toString.call(P)&&3==P.length){var C=b(P[2]);return new S({tag:P[0],explicit:P[1],obj:C})}var k={};if(void 0!==P.explicit&&(k.explicit=P.explicit),void 0!==P.tag&&(k.tag=P.tag),void 0===P.obj)throw"obj shall be specified for 'tag'.";return k.obj=b(P.obj),new S(k)}},this.jsonToASN1HEX=function(t){var e=this.newObject(t);return e.getEncodedHex()}},hr.asn1.ASN1Util.oidHexToInt=function(t){for(var e="",n=parseInt(t.substr(0,2),16),r=Math.floor(n/40),i=n%40,e=r+"."+i,s="",a=2;a<t.length;a+=2){var u=parseInt(t.substr(a,2),16),c=("00000000"+u.toString(2)).slice(-8);if(s+=c.substr(1,7),"0"==c.substr(0,1)){var f=new o(s,2);e=e+"."+f.toString(10),s=""}}return e},hr.asn1.ASN1Util.oidIntToHex=function(t){var e=function(t){var e=t.toString(16);return 1==e.length&&(e="0"+e),e},n=function(t){var n="",r=new o(t,10),i=r.toString(2),s=7-i.length%7;7==s&&(s=0);for(var a="",u=0;u<s;u++)a+="0";i=a+i;for(var u=0;u<i.length-1;u+=7){var c=i.substr(u,7);u!=i.length-7&&(c="1"+c),n+=e(parseInt(c,2))}return n};if(!t.match(/^[0-9.]+$/))throw"malformed oid string: "+t;var r="",i=t.split("."),s=40*parseInt(i[0])+parseInt(i[1]);r+=e(s),i.splice(0,2);for(var a=0;a<i.length;a++)r+=n(i[a]);return r},hr.asn1.ASN1Object=function(){var t="";this.getLengthHexFromValue=function(){if("undefined"==typeof 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="+t.length+",v="+this.hV;var e=this.hV.length/2,n=e.toString(16);if(n.length%2==1&&(n="0"+n),e<128)return n;var r=n.length/2;if(r>15)throw"ASN.1 length too long to represent by 8x: n = "+e.toString(16);var i=128+r;return i.toString(16)+n},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""}},hr.asn1.DERAbstractString=function(t){hr.asn1.DERAbstractString.superclass.constructor.call(this);this.getString=function(){return this.s},this.setString=function(t){this.hTLV=null,this.isModified=!0,this.s=t,this.hV=un(this.s).toLowerCase()},this.setStringHex=function(t){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=t},this.getFreshValueHex=function(){return this.hV},"undefined"!=typeof t&&("string"==typeof t?this.setString(t):"undefined"!=typeof t.str?this.setString(t.str):"undefined"!=typeof t.hex&&this.setStringHex(t.hex))},Un.lang.extend(hr.asn1.DERAbstractString,hr.asn1.ASN1Object),hr.asn1.DERAbstractTime=function(t){hr.asn1.DERAbstractTime.superclass.constructor.call(this);this.localDateToUTC=function(t){utc=t.getTime()+6e4*t.getTimezoneOffset();var e=new Date(utc);return e},this.formatDate=function(t,e,n){var r=this.zeroPadding,i=this.localDateToUTC(t),o=String(i.getFullYear());"utc"==e&&(o=o.substr(2,2));var s=r(String(i.getMonth()+1),2),a=r(String(i.getDate()),2),u=r(String(i.getHours()),2),c=r(String(i.getMinutes()),2),f=r(String(i.getSeconds()),2),h=o+s+a+u+c+f;if(n===!0){var l=i.getMilliseconds();if(0!=l){var p=r(String(l),3);p=p.replace(/[0]+$/,""),h=h+"."+p}}return h+"Z"},this.zeroPadding=function(t,e){return t.length>=e?t:new Array(e-t.length+1).join("0")+t},this.getString=function(){return this.s},this.setString=function(t){this.hTLV=null,this.isModified=!0,this.s=t,this.hV=Xe(t)},this.setByDateValue=function(t,e,n,r,i,o){var s=new Date(Date.UTC(t,e-1,n,r,i,o,0));this.setByDate(s)},this.getFreshValueHex=function(){return this.hV}},Un.lang.extend(hr.asn1.DERAbstractTime,hr.asn1.ASN1Object),hr.asn1.DERAbstractStructured=function(t){hr.asn1.DERAbstractString.superclass.constructor.call(this);this.setByASN1ObjectArray=function(t){this.hTLV=null,this.isModified=!0,this.asn1Array=t},this.appendASN1Object=function(t){this.hTLV=null,this.isModified=!0,this.asn1Array.push(t)},this.asn1Array=new Array,"undefined"!=typeof t&&"undefined"!=typeof t.array&&(this.asn1Array=t.array)},Un.lang.extend(hr.asn1.DERAbstractStructured,hr.asn1.ASN1Object),hr.asn1.DERBoolean=function(){hr.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",this.hTLV="0101ff"},Un.lang.extend(hr.asn1.DERBoolean,hr.asn1.ASN1Object),hr.asn1.DERInteger=function(t){hr.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.setByBigInteger=function(t){this.hTLV=null,this.isModified=!0,this.hV=hr.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t)},this.setByInteger=function(t){var e=new o(String(t),10);this.setByBigInteger(e)},this.setValueHex=function(t){this.hV=t},this.getFreshValueHex=function(){return this.hV},"undefined"!=typeof t&&("undefined"!=typeof t.bigint?this.setByBigInteger(t.bigint):"undefined"!=typeof t.int?this.setByInteger(t.int):"number"==typeof t?this.setByInteger(t):"undefined"!=typeof t.hex&&this.setValueHex(t.hex))},Un.lang.extend(hr.asn1.DERInteger,hr.asn1.ASN1Object),hr.asn1.DERBitString=function(t){if(void 0!==t&&"undefined"!=typeof t.obj){var e=hr.asn1.ASN1Util.newObject(t.obj);t.hex="00"+e.getEncodedHex()}hr.asn1.DERBitString.superclass.constructor.call(this),this.hT="03",this.setHexValueIncludingUnusedBits=function(t){this.hTLV=null,this.isModified=!0,this.hV=t},this.setUnusedBitsAndHexValue=function(t,e){if(t<0||7<t)throw"unused bits shall be from 0 to 7: u = "+t;var n="0"+t;this.hTLV=null,this.isModified=!0,this.hV=n+e},this.setByBinaryString=function(t){t=t.replace(/0+$/,"");var e=8-t.length%8;8==e&&(e=0);for(var n=0;n<=e;n++)t+="0";for(var r="",n=0;n<t.length-1;n+=8){var i=t.substr(n,8),o=parseInt(i,2).toString(16);1==o.length&&(o="0"+o),r+=o}this.hTLV=null,this.isModified=!0,this.hV="0"+e+r},this.setByBooleanArray=function(t){for(var e="",n=0;n<t.length;n++)e+=1==t[n]?"1":"0";this.setByBinaryString(e)},this.newFalseArray=function(t){for(var e=new Array(t),n=0;n<t;n++)e[n]=!1;return e},this.getFreshValueHex=function(){return this.hV},"undefined"!=typeof t&&("string"==typeof t&&t.toLowerCase().match(/^[0-9a-f]+$/)?this.setHexValueIncludingUnusedBits(t):"undefined"!=typeof t.hex?this.setHexValueIncludingUnusedBits(t.hex):"undefined"!=typeof t.bin?this.setByBinaryString(t.bin):"undefined"!=typeof t.array&&this.setByBooleanArray(t.array))},Un.lang.extend(hr.asn1.DERBitString,hr.asn1.ASN1Object),hr.asn1.DEROctetString=function(t){if(void 0!==t&&"undefined"!=typeof t.obj){var e=hr.asn1.ASN1Util.newObject(t.obj);t.hex=e.getEncodedHex()}hr.asn1.DEROctetString.superclass.constructor.call(this,t),this.hT="04"},Un.lang.extend(hr.asn1.DEROctetString,hr.asn1.DERAbstractString),hr.asn1.DERNull=function(){hr.asn1.DERNull.superclass.constructor.call(this),this.hT="05",this.hTLV="0500"},Un.lang.extend(hr.asn1.DERNull,hr.asn1.ASN1Object),hr.asn1.DERObjectIdentifier=function(t){var e=function(t){var e=t.toString(16);return 1==e.length&&(e="0"+e),e},n=function(t){var n="",r=new o(t,10),i=r.toString(2),s=7-i.length%7;7==s&&(s=0);for(var a="",u=0;u<s;u++)a+="0";i=a+i;for(var u=0;u<i.length-1;u+=7){var c=i.substr(u,7);u!=i.length-7&&(c="1"+c),n+=e(parseInt(c,2))}return n};hr.asn1.DERObjectIdentifier.superclass.constructor.call(this),this.hT="06",this.setValueHex=function(t){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=t},this.setValueOidString=function(t){if(!t.match(/^[0-9.]+$/))throw"malformed oid string: "+t;var r="",i=t.split("."),o=40*parseInt(i[0])+parseInt(i[1]);r+=e(o),i.splice(0,2);for(var s=0;s<i.length;s++)r+=n(i[s]);this.hTLV=null,this.isModified=!0,this.s=null,this.hV=r},this.setValueName=function(t){var e=hr.asn1.x509.OID.name2oid(t);if(""===e)throw"DERObjectIdentifier oidName undefined: "+t;this.setValueOidString(e)},this.getFreshValueHex=function(){return this.hV},void 0!==t&&("string"==typeof t?t.match(/^[0-2].[0-9.]+$/)?this.setValueOidString(t):this.setValueName(t):void 0!==t.oid?this.setValueOidString(t.oid):void 0!==t.hex?this.setValueHex(t.hex):void 0!==t.name&&this.setValueName(t.name))},Un.lang.extend(hr.asn1.DERObjectIdentifier,hr.asn1.ASN1Object),hr.asn1.DEREnumerated=function(t){hr.asn1.DEREnumerated.superclass.constructor.call(this),this.hT="0a",this.setByBigInteger=function(t){this.hTLV=null,this.isModified=!0,this.hV=hr.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t)},this.setByInteger=function(t){var e=new o(String(t),10);this.setByBigInteger(e)},this.setValueHex=function(t){this.hV=t},this.getFreshValueHex=function(){return this.hV},"undefined"!=typeof t&&("undefined"!=typeof t.int?this.setByInteger(t.int):"number"==typeof t?this.setByInteger(t):"undefined"!=typeof t.hex&&this.setValueHex(t.hex))},Un.lang.extend(hr.asn1.DEREnumerated,hr.asn1.ASN1Object),hr.asn1.DERUTF8String=function(t){hr.asn1.DERUTF8String.superclass.constructor.call(this,t),this.hT="0c"},Un.lang.extend(hr.asn1.DERUTF8String,hr.asn1.DERAbstractString),hr.asn1.DERNumericString=function(t){hr.asn1.DERNumericString.superclass.constructor.call(this,t),this.hT="12"},Un.lang.extend(hr.asn1.DERNumericString,hr.asn1.DERAbstractString),hr.asn1.DERPrintableString=function(t){hr.asn1.DERPrintableString.superclass.constructor.call(this,t),this.hT="13"},Un.lang.extend(hr.asn1.DERPrintableString,hr.asn1.DERAbstractString),hr.asn1.DERTeletexString=function(t){hr.asn1.DERTeletexString.superclass.constructor.call(this,t),this.hT="14"},Un.lang.extend(hr.asn1.DERTeletexString,hr.asn1.DERAbstractString),hr.asn1.DERIA5String=function(t){hr.asn1.DERIA5String.superclass.constructor.call(this,t),this.hT="16"},Un.lang.extend(hr.asn1.DERIA5String,hr.asn1.DERAbstractString),hr.asn1.DERUTCTime=function(t){hr.asn1.DERUTCTime.superclass.constructor.call(this,t),this.hT="17",this.setByDate=function(t){this.hTLV=null,this.isModified=!0,this.date=t,this.s=this.formatDate(this.date,"utc"),this.hV=Xe(this.s)},this.getFreshValueHex=function(){return"undefined"==typeof this.date&&"undefined"==typeof this.s&&(this.date=new Date,this.s=this.formatDate(this.date,"utc"),this.hV=Xe(this.s)),this.hV},void 0!==t&&(void 0!==t.str?this.setString(t.str):"string"==typeof t&&t.match(/^[0-9]{12}Z$/)?this.setString(t):void 0!==t.hex?this.setStringHex(t.hex):void 0!==t.date&&this.setByDate(t.date))},Un.lang.extend(hr.asn1.DERUTCTime,hr.asn1.DERAbstractTime),hr.asn1.DERGeneralizedTime=function(t){hr.asn1.DERGeneralizedTime.superclass.constructor.call(this,t),this.hT="18",this.withMillis=!1,this.setByDate=function(t){this.hTLV=null,this.isModified=!0,this.date=t,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=Xe(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=Xe(this.s)),this.hV},void 0!==t&&(void 0!==t.str?this.setString(t.str):"string"==typeof t&&t.match(/^[0-9]{14}Z$/)?this.setString(t):void 0!==t.hex?this.setStringHex(t.hex):void 0!==t.date&&this.setByDate(t.date),t.millis===!0&&(this.withMillis=!0))},Un.lang.extend(hr.asn1.DERGeneralizedTime,hr.asn1.DERAbstractTime),hr.asn1.DERSequence=function(t){hr.asn1.DERSequence.superclass.constructor.call(this,t),this.hT="30",this.getFreshValueHex=function(){for(var t="",e=0;e<this.asn1Array.length;e++){var n=this.asn1Array[e];t+=n.getEncodedHex()}return this.hV=t,this.hV}},Un.lang.extend(hr.asn1.DERSequence,hr.asn1.DERAbstractStructured),hr.asn1.DERSet=function(t){hr.asn1.DERSet.superclass.constructor.call(this,t),this.hT="31",this.sortFlag=!0,this.getFreshValueHex=function(){for(var t=new Array,e=0;e<this.asn1Array.length;e++){var n=this.asn1Array[e];t.push(n.getEncodedHex())}return 1==this.sortFlag&&t.sort(),this.hV=t.join(""),this.hV},"undefined"!=typeof t&&"undefined"!=typeof t.sortflag&&0==t.sortflag&&(this.sortFlag=!1)},Un.lang.extend(hr.asn1.DERSet,hr.asn1.DERAbstractStructured),hr.asn1.DERTaggedObject=function(t){hr.asn1.DERTaggedObject.superclass.constructor.call(this),this.hT="a0",this.hV="",this.isExplicit=!0,this.asn1Object=null,this.setASN1Object=function(t,e,n){this.hT=e,this.isExplicit=t,this.asn1Object=n,this.isExplicit?(this.hV=this.asn1Object.getEncodedHex(),this.hTLV=null,this.isModified=!0):(this.hV=null,this.hTLV=n.getEncodedHex(),this.hTLV=this.hTLV.replace(/^../,e),this.isModified=!1)},this.getFreshValueHex=function(){return this.hV},"undefined"!=typeof t&&("undefined"!=typeof t.tag&&(this.hT=t.tag),"undefined"!=typeof t.explicit&&(this.isExplicit=t.explicit),"undefined"!=typeof t.obj&&(this.asn1Object=t.obj,this.setASN1Object(this.isExplicit,this.hT,this.asn1Object)))},Un.lang.extend(hr.asn1.DERTaggedObject,hr.asn1.ASN1Object);var fr=new function(){};fr.getLblen=function(t,e){if("8"!=t.substr(e+2,1))return 1;var n=parseInt(t.substr(e+3,1));return 0==n?-1:0<n&&n<10?n+1:-2},fr.getL=function(t,e){var n=fr.getLblen(t,e);return n<1?"":t.substr(e+2,2*n)},fr.getVblen=function(t,e){var n,r;return n=fr.getL(t,e),""==n?-1:(r="8"===n.substr(0,1)?new o(n.substr(2),16):new o(n,16),r.intValue())},fr.getVidx=function(t,e){var n=fr.getLblen(t,e);return n<0?n:e+2*(n+1)},fr.getV=function(t,e){var n=fr.getVidx(t,e),r=fr.getVblen(t,e);return t.substr(n,2*r)},fr.getTLV=function(t,e){return t.substr(e,2)+fr.getL(t,e)+fr.getV(t,e)},fr.getNextSiblingIdx=function(t,e){var n=fr.getVidx(t,e),r=fr.getVblen(t,e);return n+2*r},fr.getChildIdx=function(t,e){var n=fr,r=new Array,i=n.getVidx(t,e);"03"==t.substr(e,2)?r.push(i+2):r.push(i);for(var o=n.getVblen(t,e),s=i,a=0;;){var u=n.getNextSiblingIdx(t,s);if(null==u||u-i>=2*o)break;if(a>=200)break;r.push(u),s=u,a++}return r},fr.getNthChildIdx=function(t,e,n){var r=fr.getChildIdx(t,e);return r[n]},fr.getIdxbyList=function(t,e,n,r){var i,o,s=fr;if(0==n.length){if(void 0!==r&&t.substr(e,2)!==r)throw"checking tag doesn't match: "+t.substr(e,2)+"!="+r;return e}return i=n.shift(),o=s.getChildIdx(t,e),s.getIdxbyList(t,o[i],n,r)},fr.getTLVbyList=function(t,e,n,r){var i=fr,o=i.getIdxbyList(t,e,n);if(void 0===o)throw"can't find nthList object";if(void 0!==r&&t.substr(o,2)!=r)throw"checking tag doesn't match: "+t.substr(o,2)+"!="+r;return i.getTLV(t,o)},fr.getVbyList=function(t,e,n,r,i){var o,s,a=fr;if(o=a.getIdxbyList(t,e,n,r),void 0===o)throw"can't find nthList object";return s=a.getV(t,o),i===!0&&(s=s.substr(2)),s},fr.hextooidstr=function(t){var e=function(t,e){return t.length>=e?t:new Array(e-t.length+1).join("0")+t},n=[],r=t.substr(0,2),i=parseInt(r,16);n[0]=new String(Math.floor(i/40)),n[1]=new String(i%40);for(var o=t.substr(2),s=[],a=0;a<o.length/2;a++)s.push(parseInt(o.substr(2*a,2),16));for(var u=[],c="",a=0;a<s.length;a++)128&s[a]?c+=e((127&s[a]).toString(2),7):(c+=e((127&s[a]).toString(2),7),u.push(new String(parseInt(c,2))),c="");var f=n.join(".");return u.length>0&&(f=f+"."+u.join(".")),f},fr.dump=function(t,e,n,r){var i=fr,o=i.getV,s=i.dump,a=i.getChildIdx,u=t;t instanceof hr.asn1.ASN1Object&&(u=t.getEncodedHex());var c=function(t,e){if(t.length<=2*e)return t;var n=t.substr(0,e)+"..(total "+t.length/2+"bytes).."+t.substr(t.length-e,e);return n};void 0===e&&(e={ommit_long_octet:32}),void 0===n&&(n=0),void 0===r&&(r="");var f=e.ommit_long_octet;if("01"==u.substr(n,2)){var h=o(u,n);return"00"==h?r+"BOOLEAN FALSE\n":r+"BOOLEAN TRUE\n"}if("02"==u.substr(n,2)){var h=o(u,n);return r+"INTEGER "+c(h,f)+"\n"}if("03"==u.substr(n,2)){var h=o(u,n);return r+"BITSTRING "+c(h,f)+"\n"}if("04"==u.substr(n,2)){var h=o(u,n);if(i.isASN1HEX(h)){var l=r+"OCTETSTRING, encapsulates\n";return l+=s(h,e,0,r+" ")}return r+"OCTETSTRING "+c(h,f)+"\n"}if("05"==u.substr(n,2))return r+"NULL\n";if("06"==u.substr(n,2)){var p=o(u,n),d=hr.asn1.ASN1Util.oidHexToInt(p),g=hr.asn1.x509.OID.oid2name(d),v=d.replace(/\./g," ");return""!=g?r+"ObjectIdentifier "+g+" ("+v+")\n":r+"ObjectIdentifier ("+v+")\n"}if("0c"==u.substr(n,2))return r+"UTF8String '"+cn(o(u,n))+"'\n";if("13"==u.substr(n,2))return r+"PrintableString '"+cn(o(u,n))+"'\n";if("14"==u.substr(n,2))return r+"TeletexString '"+cn(o(u,n))+"'\n";if("16"==u.substr(n,2))return r+"IA5String '"+cn(o(u,n))+"'\n";if("17"==u.substr(n,2))return r+"UTCTime "+cn(o(u,n))+"\n";if("18"==u.substr(n,2))return r+"GeneralizedTime "+cn(o(u,n))+"\n";if("30"==u.substr(n,2)){if("3000"==u.substr(n,4))return r+"SEQUENCE {}\n";var l=r+"SEQUENCE\n",y=a(u,n),m=e;if((2==y.length||3==y.length)&&"06"==u.substr(y[0],2)&&"04"==u.substr(y[y.length-1],2)){var g=i.oidname(o(u,y[0])),S=JSON.parse(JSON.stringify(e));S.x509ExtName=g,m=S}for(var b=0;b<y.length;b++)l+=s(u,m,y[b],r+" ");return l}if("31"==u.substr(n,2)){for(var l=r+"SET\n",y=a(u,n),b=0;b<y.length;b++)l+=s(u,e,y[b],r+" ");return l}var F=parseInt(u.substr(n,2),16);if(0!=(128&F)){var w=31&F;if(0!=(32&F)){for(var l=r+"["+w+"]\n",y=a(u,n),b=0;b<y.length;b++)l+=s(u,e,y[b],r+" ");return l}var h=o(u,n);"68747470"==h.substr(0,8)&&(h=cn(h)),"subjectAltName"===e.x509ExtName&&2==w&&(h=cn(h));var l=r+"["+w+"] "+h+"\n";return l}return r+"UNKNOWN("+u.substr(n,2)+") "+o(u,n)+"\n"},fr.isASN1HEX=function(t){var e=fr;if(t.length%2==1)return!1;var n=e.getVblen(t,0),r=t.substr(0,2),i=e.getL(t,0),o=t.length-r.length-i.length;return o==2*n},fr.oidname=function(t){var e=hr.asn1;hr.lang.String.isHex(t)&&(t=e.ASN1Util.oidHexToInt(t));var n=e.x509.OID.oid2name(t);return""===n&&(n=t),n},"undefined"!=typeof hr&&hr||(hr={}),"undefined"!=typeof hr.asn1&&hr.asn1||(hr.asn1={}),"undefined"!=typeof hr.asn1.x509&&hr.asn1.x509||(hr.asn1.x509={}),hr.asn1.x509.Certificate=function(t){hr.asn1.x509.Certificate.superclass.constructor.call(this);var e=hr,n=(e.crypto,e.asn1),r=n.DERSequence,i=n.DERBitString;this.sign=function(){this.asn1SignatureAlg=this.asn1TBSCert.asn1SignatureAlg;var t=new hr.crypto.Signature({alg:this.asn1SignatureAlg.nameAlg});t.init(this.prvKey),t.updateHex(this.asn1TBSCert.getEncodedHex()),this.hexSig=t.sign(),this.asn1Sig=new i({hex:"00"+this.hexSig});var e=new r({array:[this.asn1TBSCert,this.asn1SignatureAlg,this.asn1Sig]});this.hTLV=e.getEncodedHex(),this.isModified=!1},this.setSignatureHex=function(t){this.asn1SignatureAlg=this.asn1TBSCert.asn1SignatureAlg,this.hexSig=t,this.asn1Sig=new i({hex:"00"+this.hexSig});var e=new r({array:[this.asn1TBSCert,this.asn1SignatureAlg,this.asn1Sig]});this.hTLV=e.getEncodedHex(),this.isModified=!1},this.getEncodedHex=function(){if(0==this.isModified&&null!=this.hTLV)return this.hTLV;throw"not signed yet"},this.getPEMString=function(){var t=pn(this.getEncodedHex());return"-----BEGIN CERTIFICATE-----\r\n"+t+"\r\n-----END CERTIFICATE-----\r\n"},void 0!==t&&(void 0!==t.tbscertobj&&(this.asn1TBSCert=t.tbscertobj),void 0!==t.prvkeyobj&&(this.prvKey=t.prvkeyobj))},Un.lang.extend(hr.asn1.x509.Certificate,hr.asn1.ASN1Object),hr.asn1.x509.TBSCertificate=function(t){hr.asn1.x509.TBSCertificate.superclass.constructor.call(this);var e=hr,n=e.asn1,r=n.DERSequence,i=n.DERInteger,o=n.DERTaggedObject,s=n.x509,a=s.Time,u=s.X500Name,c=s.SubjectPublicKeyInfo;this._initialize=function(){this.asn1Array=new Array,this.asn1Version=new o({obj:new i({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(t){this.asn1SerialNumber=new i(t)},this.setSignatureAlgByParam=function(t){this.asn1SignatureAlg=new s.AlgorithmIdentifier(t)},this.setIssuerByParam=function(t){this.asn1Issuer=new u(t)},this.setNotBeforeByParam=function(t){this.asn1NotBefore=new a(t)},this.setNotAfterByParam=function(t){this.asn1NotAfter=new a(t)},this.setSubjectByParam=function(t){this.asn1Subject=new u(t)},this.setSubjectPublicKey=function(t){this.asn1SubjPKey=new c(t)},this.setSubjectPublicKeyByGetKey=function(t){var e=gr.getKey(t);this.asn1SubjPKey=new c(e)},this.appendExtension=function(t){this.extensionsArray.push(t)},this.appendExtensionByName=function(t,e){hr.asn1.x509.Extension.appendByNameToArray(t,e,this.extensionsArray)},this.getEncodedHex=function(){if(null==this.asn1NotBefore||null==this.asn1NotAfter)throw"notBefore and/or notAfter not set";var t=new r({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(t),this.asn1Array.push(this.asn1Subject),this.asn1Array.push(this.asn1SubjPKey),this.extensionsArray.length>0){var e=new r({array:this.extensionsArray}),n=new o({explicit:!0,tag:"a3",obj:e});this.asn1Array.push(n)}var i=new r({array:this.asn1Array});return this.hTLV=i.getEncodedHex(),this.isModified=!1,this.hTLV},this._initialize()},Un.lang.extend(hr.asn1.x509.TBSCertificate,hr.asn1.ASN1Object),hr.asn1.x509.Extension=function(t){hr.asn1.x509.Extension.superclass.constructor.call(this);var e=hr,n=e.asn1,r=n.DERObjectIdentifier,i=n.DEROctetString,o=(n.DERBitString,n.DERBoolean),s=n.DERSequence;this.getEncodedHex=function(){var t=new r({oid:this.oid}),e=new i({hex:this.getExtnValueHex()}),n=new Array;n.push(t),this.critical&&n.push(new o),n.push(e);var a=new s({array:n});return a.getEncodedHex()},this.critical=!1,void 0!==t&&void 0!==t.critical&&(this.critical=t.critical)},Un.lang.extend(hr.asn1.x509.Extension,hr.asn1.ASN1Object),hr.asn1.x509.Extension.appendByNameToArray=function(t,e,n){var r=t.toLowerCase(),i=hr.asn1.x509;if("basicconstraints"==r){var o=new i.BasicConstraints(e);n.push(o)}else if("keyusage"==r){var o=new i.KeyUsage(e);n.push(o)}else if("crldistributionpoints"==r){var o=new i.CRLDistributionPoints(e);n.push(o)}else if("extkeyusage"==r){var o=new i.ExtKeyUsage(e);n.push(o)}else if("authoritykeyidentifier"==r){var o=new i.AuthorityKeyIdentifier(e);n.push(o)}else if("authorityinfoaccess"==r){var o=new i.AuthorityInfoAccess(e);n.push(o)}else if("subjectaltname"==r){var o=new i.SubjectAltName(e);n.push(o)}else{if("issueraltname"!=r)throw"unsupported extension name: "+t;var o=new i.IssuerAltName(e);n.push(o)}},hr.asn1.x509.KeyUsage=function(t){hr.asn1.x509.KeyUsage.superclass.constructor.call(this,t);var e=Ln.KEYUSAGE_NAME;if(this.getExtnValueHex=function(){return this.asn1ExtnValue.getEncodedHex()},this.oid="2.5.29.15",void 0!==t&&(void 0!==t.bin&&(this.asn1ExtnValue=new hr.asn1.DERBitString(t)),void 0!==t.names&&void 0!==t.names.length)){for(var n=t.names,r="000000000",i=0;i<n.length;i++)for(var o=0;o<e.length;o++)n[i]===e[o]&&(r=r.substring(0,o)+"1"+r.substring(o+1,r.length));this.asn1ExtnValue=new hr.asn1.DERBitString({bin:r})}},Un.lang.extend(hr.asn1.x509.KeyUsage,hr.asn1.x509.Extension),hr.asn1.x509.BasicConstraints=function(t){hr.asn1.x509.BasicConstraints.superclass.constructor.call(this,t);this.getExtnValueHex=function(){var t=new Array;this.cA&&t.push(new hr.asn1.DERBoolean),this.pathLen>-1&&t.push(new hr.asn1.DERInteger({int:this.pathLen}));var e=new hr.asn1.DERSequence({array:t});return this.asn1ExtnValue=e,this.asn1ExtnValue.getEncodedHex()},this.oid="2.5.29.19",this.cA=!1,this.pathLen=-1,void 0!==t&&(void 0!==t.cA&&(this.cA=t.cA),void 0!==t.pathLen&&(this.pathLen=t.pathLen))},Un.lang.extend(hr.asn1.x509.BasicConstraints,hr.asn1.x509.Extension),hr.asn1.x509.CRLDistributionPoints=function(t){hr.asn1.x509.CRLDistributionPoints.superclass.constructor.call(this,t);var e=hr,n=e.asn1,r=n.x509;this.getExtnValueHex=function(){return this.asn1ExtnValue.getEncodedHex()},this.setByDPArray=function(t){this.asn1ExtnValue=new n.DERSequence({array:t})},this.setByOneURI=function(t){var e=new r.GeneralNames([{uri:t}]),n=new r.DistributionPointName(e),i=new r.DistributionPoint({dpobj:n});this.setByDPArray([i])},this.oid="2.5.29.31",void 0!==t&&(void 0!==t.array?this.setByDPArray(t.array):void 0!==t.uri&&this.setByOneURI(t.uri))},Un.lang.extend(hr.asn1.x509.CRLDistributionPoints,hr.asn1.x509.Extension),hr.asn1.x509.ExtKeyUsage=function(t){hr.asn1.x509.ExtKeyUsage.superclass.constructor.call(this,t);var e=hr,n=e.asn1;this.setPurposeArray=function(t){this.asn1ExtnValue=new n.DERSequence;for(var e=0;e<t.length;e++){var r=new n.DERObjectIdentifier(t[e]);this.asn1ExtnValue.appendASN1Object(r)}},this.getExtnValueHex=function(){return this.asn1ExtnValue.getEncodedHex()},this.oid="2.5.29.37",void 0!==t&&void 0!==t.array&&this.setPurposeArray(t.array)},Un.lang.extend(hr.asn1.x509.ExtKeyUsage,hr.asn1.x509.Extension),hr.asn1.x509.AuthorityKeyIdentifier=function(t){hr.asn1.x509.AuthorityKeyIdentifier.superclass.constructor.call(this,t);var e=hr,n=e.asn1,r=n.DERTaggedObject;this.asn1KID=null,this.asn1CertIssuer=null,this.asn1CertSN=null,this.getExtnValueHex=function(){var t=new Array;this.asn1KID&&t.push(new r({explicit:!1,tag:"80",obj:this.asn1KID})),this.asn1CertIssuer&&t.push(new r({explicit:!1,tag:"a1",obj:this.asn1CertIssuer})),this.asn1CertSN&&t.push(new r({explicit:!1,tag:"82",obj:this.asn1CertSN}));var e=new n.DERSequence({array:t});return this.asn1ExtnValue=e,this.asn1ExtnValue.getEncodedHex()},this.setKIDByParam=function(t){this.asn1KID=new hr.asn1.DEROctetString(t)},this.setCertIssuerByParam=function(t){this.asn1CertIssuer=new hr.asn1.x509.X500Name(t)},this.setCertSNByParam=function(t){this.asn1CertSN=new hr.asn1.DERInteger(t)},this.oid="2.5.29.35",void 0!==t&&(void 0!==t.kid&&this.setKIDByParam(t.kid),void 0!==t.issuer&&this.setCertIssuerByParam(t.issuer),void 0!==t.sn&&this.setCertSNByParam(t.sn))},Un.lang.extend(hr.asn1.x509.AuthorityKeyIdentifier,hr.asn1.x509.Extension),hr.asn1.x509.AuthorityInfoAccess=function(t){hr.asn1.x509.AuthorityInfoAccess.superclass.constructor.call(this,t),this.setAccessDescriptionArray=function(t){for(var e=new Array,n=hr,r=n.asn1,i=r.DERSequence,o=0;o<t.length;o++){var s=new r.DERObjectIdentifier(t[o].accessMethod),a=new r.x509.GeneralName(t[o].accessLocation),u=new i({array:[s,a]});e.push(u)}this.asn1ExtnValue=new i({array:e})},this.getExtnValueHex=function(){return this.asn1ExtnValue.getEncodedHex()},this.oid="1.3.6.1.5.5.7.1.1",void 0!==t&&void 0!==t.array&&this.setAccessDescriptionArray(t.array)},Un.lang.extend(hr.asn1.x509.AuthorityInfoAccess,hr.asn1.x509.Extension),hr.asn1.x509.SubjectAltName=function(t){hr.asn1.x509.SubjectAltName.superclass.constructor.call(this,t),this.setNameArray=function(t){this.asn1ExtnValue=new hr.asn1.x509.GeneralNames(t)},this.getExtnValueHex=function(){return this.asn1ExtnValue.getEncodedHex()},this.oid="2.5.29.17",void 0!==t&&void 0!==t.array&&this.setNameArray(t.array)},Un.lang.extend(hr.asn1.x509.SubjectAltName,hr.asn1.x509.Extension),hr.asn1.x509.IssuerAltName=function(t){hr.asn1.x509.IssuerAltName.superclass.constructor.call(this,t),this.setNameArray=function(t){this.asn1ExtnValue=new hr.asn1.x509.GeneralNames(t)},this.getExtnValueHex=function(){return this.asn1ExtnValue.getEncodedHex()},this.oid="2.5.29.18",void 0!==t&&void 0!==t.array&&this.setNameArray(t.array)},Un.lang.extend(hr.asn1.x509.IssuerAltName,hr.asn1.x509.Extension),hr.asn1.x509.CRL=function(t){hr.asn1.x509.CRL.superclass.constructor.call(this);this.sign=function(){this.asn1SignatureAlg=this.asn1TBSCertList.asn1SignatureAlg,sig=new hr.crypto.Signature({alg:"SHA1withRSA",prov:"cryptojs/jsrsa"}),sig.init(this.prvKey),sig.updateHex(this.asn1TBSCertList.getEncodedHex()),this.hexSig=sig.sign(),this.asn1Sig=new hr.asn1.DERBitString({hex:"00"+this.hexSig});var t=new hr.asn1.DERSequence({array:[this.asn1TBSCertList,this.asn1SignatureAlg,this.asn1Sig]});this.hTLV=t.getEncodedHex(),this.isModified=!1},this.getEncodedHex=function(){if(0==this.isModified&&null!=this.hTLV)return this.hTLV;throw"not signed yet"},this.getPEMString=function(){var t=pn(this.getEncodedHex());return"-----BEGIN X509 CRL-----\r\n"+t+"\r\n-----END X509 CRL-----\r\n"},void 0!==t&&(void 0!==t.tbsobj&&(this.asn1TBSCertList=t.tbsobj),void 0!==t.prvkeyobj&&(this.prvKey=t.prvkeyobj))},Un.lang.extend(hr.asn1.x509.CRL,hr.asn1.ASN1Object),hr.asn1.x509.TBSCertList=function(t){hr.asn1.x509.TBSCertList.superclass.constructor.call(this);var e=hr,n=e.asn1,r=n.DERSequence,i=n.x509,o=i.Time;this.setSignatureAlgByParam=function(t){this.asn1SignatureAlg=new i.AlgorithmIdentifier(t)},this.setIssuerByParam=function(t){this.asn1Issuer=new i.X500Name(t)},this.setThisUpdateByParam=function(t){this.asn1ThisUpdate=new o(t)},this.setNextUpdateByParam=function(t){this.asn1NextUpdate=new o(t)},this.addRevokedCert=function(t,e){var n={};void 0!=t&&null!=t&&(n.sn=t),void 0!=e&&null!=e&&(n.time=e);var r=new i.CRLEntry(n);this.aRevokedCert.push(r)},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 t=new r({array:this.aRevokedCert});this.asn1Array.push(t)}var e=new r({array:this.asn1Array});return this.hTLV=e.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()},Un.lang.extend(hr.asn1.x509.TBSCertList,hr.asn1.ASN1Object),hr.asn1.x509.CRLEntry=function(t){hr.asn1.x509.CRLEntry.superclass.constructor.call(this);var e=hr,n=e.asn1;this.setCertSerial=function(t){this.sn=new n.DERInteger(t)},this.setRevocationDate=function(t){this.time=new n.x509.Time(t)},this.getEncodedHex=function(){var t=new n.DERSequence({array:[this.sn,this.time]});return this.TLV=t.getEncodedHex(),this.TLV},void 0!==t&&(void 0!==t.time&&this.setRevocationDate(t.time),void 0!==t.sn&&this.setCertSerial(t.sn))},Un.lang.extend(hr.asn1.x509.CRLEntry,hr.asn1.ASN1Object),hr.asn1.x509.X500Name=function(t){hr.asn1.x509.X500Name.superclass.constructor.call(this),this.asn1Array=new Array;var e=hr,n=e.asn1,r=n.x509,i=vn;if(this.setByString=function(t){var e=t.split("/");e.shift();for(var n=[],i=0;i<e.length;i++)if(e[i].match(/^[^=]+=.+$/))n.push(e[i]);else{var o=n.length-1;n[o]=n[o]+"/"+e[i]}for(var i=0;i<n.length;i++)this.asn1Array.push(new r.RDN({str:n[i]}))},this.setByLdapString=function(t){var e=r.X500Name.ldapToOneline(t);this.setByString(e)},this.setByObject=function(t){for(var e in t)if(t.hasOwnProperty(e)){var n=new hr.asn1.x509.RDN({str:e+"="+t[e]});this.asn1Array?this.asn1Array.push(n):this.asn1Array=[n]}},this.getEncodedHex=function(){if("string"==typeof this.hTLV)return this.hTLV;var t=new n.DERSequence({array:this.asn1Array});return this.hTLV=t.getEncodedHex(),this.hTLV},void 0!==t){if(void 0!==t.str?this.setByString(t.str):void 0!==t.ldapstr?this.setByLdapString(t.ldapstr):"object"===("undefined"==typeof t?"undefined":Mn(t))&&this.setByObject(t),void 0!==t.certissuer){var o=new Ln;o.hex=i(t.certissuer),this.hTLV=o.getIssuerHex()}if(void 0!==t.certsubject){var o=new Ln;o.hex=i(t.certsubject),this.hTLV=o.getSubjectHex()}}},Un.lang.extend(hr.asn1.x509.X500Name,hr.asn1.ASN1Object),hr.asn1.x509.X500Name.onelineToLDAP=function(t){if("/"!==t.substr(0,1))throw"malformed input";t=t.substr(1);var e=t.split("/");return e.reverse(),e=e.map(function(t){return t.replace(/,/,"\\,")}),e.join(",")},hr.asn1.x509.X500Name.ldapToOneline=function(t){for(var e=t.split(","),n=!1,r=[],i=0;e.length>0;i++){var o=e.shift();if(n===!0){var s=r.pop(),a=(s+","+o).replace(/\\,/g,",");r.push(a),n=!1}else r.push(o);"\\"===o.substr(-1,1)&&(n=!0)}return r=r.map(function(t){return t.replace("/","\\/")}),r.reverse(),"/"+r.join("/")},hr.asn1.x509.RDN=function(t){hr.asn1.x509.RDN.superclass.constructor.call(this),this.asn1Array=new Array,this.addByString=function(t){this.asn1Array.push(new hr.asn1.x509.AttributeTypeAndValue({str:t}))},this.addByMultiValuedString=function(t){for(var e=hr.asn1.x509.RDN.parseString(t),n=0;n<e.length;n++)this.addByString(e[n])},this.getEncodedHex=function(){var t=new hr.asn1.DERSet({array:this.asn1Array});return this.TLV=t.getEncodedHex(),this.TLV},void 0!==t&&void 0!==t.str&&this.addByMultiValuedString(t.str)},Un.lang.extend(hr.asn1.x509.RDN,hr.asn1.ASN1Object),hr.asn1.x509.RDN.parseString=function(t){for(var e=t.split(/\+/),n=!1,r=[],i=0;e.length>0;i++){var o=e.shift();if(n===!0){var s=r.pop(),a=(s+"+"+o).replace(/\\\+/g,"+");r.push(a),n=!1}else r.push(o);"\\"===o.substr(-1,1)&&(n=!0)}for(var u=!1,c=[],i=0;r.length>0;i++){var o=r.shift();if(u===!0){var f=c.pop();if(o.match(/"$/)){var a=(f+"+"+o).replace(/^([^=]+)="(.*)"$/,"$1=$2");c.push(a),u=!1}else c.push(f+"+"+o)}else c.push(o);o.match(/^[^=]+="/)&&(u=!0)}return c},hr.asn1.x509.AttributeTypeAndValue=function(t){hr.asn1.x509.AttributeTypeAndValue.superclass.constructor.call(this);var e="utf8",n=hr,r=n.asn1;this.setByString=function(t){var e=t.match(/^([^=]+)=(.+)$/);if(!e)throw"malformed attrTypeAndValueStr: "+t;this.setByAttrTypeAndValueStr(e[1],e[2])},this.setByAttrTypeAndValueStr=function(t,n){this.typeObj=hr.asn1.x509.OID.atype2obj(t);var r=e;"C"==t&&(r="prn"),this.valueObj=this.getValueObj(r,n)},this.getValueObj=function(t,e){if("utf8"==t)return new r.DERUTF8String({str:e});if("prn"==t)return new r.DERPrintableString({str:e});if("tel"==t)return new r.DERTeletexString({str:e});if("ia5"==t)return new r.DERIA5String({str:e});throw"unsupported directory string type: type="+t+" value="+e},this.getEncodedHex=function(){var t=new r.DERSequence({array:[this.typeObj,this.valueObj]});return this.TLV=t.getEncodedHex(),this.TLV},void 0!==t&&void 0!==t.str&&this.setByString(t.str)},Un.lang.extend(hr.asn1.x509.AttributeTypeAndValue,hr.asn1.ASN1Object),hr.asn1.x509.SubjectPublicKeyInfo=function(t){hr.asn1.x509.SubjectPublicKeyInfo.superclass.constructor.call(this);var e=hr,n=e.asn1,r=n.DERInteger,i=n.DERBitString,o=n.DERObjectIdentifier,s=n.DERSequence,a=n.ASN1Util.newObject,u=n.x509,c=u.AlgorithmIdentifier,f=e.crypto;f.ECDSA,f.DSA;this.getASN1Object=function(){if(null==this.asn1AlgId||null==this.asn1SubjPKey)throw"algId and/or subjPubKey not set";var t=new s({array:[this.asn1AlgId,this.asn1SubjPKey]});return t},this.getEncodedHex=function(){var t=this.getASN1Object();return this.hTLV=t.getEncodedHex(),this.hTLV},this.setPubKey=function(t){try{if(t instanceof ve){var e=a({seq:[{int:{bigint:t.n}},{int:{int:t.e}}]}),n=e.getEncodedHex();this.asn1AlgId=new c({name:"rsaEncryption"}),this.asn1SubjPKey=new i({hex:"00"+n})}}catch(t){}try{if(t instanceof hr.crypto.ECDSA){var s=new o({name:t.curveName});this.asn1AlgId=new c({name:"ecPublicKey",asn1params:s}),this.asn1SubjPKey=new i({hex:"00"+t.pubKeyHex})}}catch(t){}try{if(t instanceof hr.crypto.DSA){var s=new a({seq:[{int:{bigint:t.p}},{int:{bigint:t.q}},{int:{bigint:t.g}}]});this.asn1AlgId=new c({name:"dsa",asn1params:s});var u=new r({bigint:t.y});this.asn1SubjPKey=new i({hex:"00"+u.getEncodedHex()})}}catch(t){}},void 0!==t&&this.setPubKey(t)},Un.lang.extend(hr.asn1.x509.SubjectPublicKeyInfo,hr.asn1.ASN1Object),hr.asn1.x509.Time=function(t){hr.asn1.x509.Time.superclass.constructor.call(this);var e=hr,n=e.asn1,r=n.DERUTCTime,i=n.DERGeneralizedTime;this.setTimeParams=function(t){this.timeParams=t},this.getEncodedHex=function(){var t=null;return t=null!=this.timeParams?"utc"==this.type?new r(this.timeParams):new i(this.timeParams):"utc"==this.type?new r:new i,this.TLV=t.getEncodedHex(),this.TLV},this.type="utc",void 0!==t&&(void 0!==t.type?this.type=t.type:void 0!==t.str&&(t.str.match(/^[0-9]{12}Z$/)&&(this.type="utc"),t.str.match(/^[0-9]{14}Z$/)&&(this.type="gen")),this.timeParams=t)},Un.lang.extend(hr.asn1.x509.Time,hr.asn1.ASN1Object),hr.asn1.x509.AlgorithmIdentifier=function(t){hr.asn1.x509.AlgorithmIdentifier.superclass.constructor.call(this),this.nameAlg=null,this.asn1Alg=null,this.asn1Params=null,this.paramEmpty=!1;var e=hr,n=e.asn1;if(this.getEncodedHex=function(){if(null===this.nameAlg&&null===this.asn1Alg)throw"algorithm not specified";null!==this.nameAlg&&null===this.asn1Alg&&(this.asn1Alg=n.x509.OID.name2obj(this.nameAlg));var t=[this.asn1Alg];null!==this.asn1Params&&t.push(this.asn1Params);var e=new n.DERSequence({array:t});return this.hTLV=e.getEncodedHex(),this.hTLV},void 0!==t&&(void 0!==t.name&&(this.nameAlg=t.name),void 0!==t.asn1params&&(this.asn1Params=t.asn1params),void 0!==t.paramempty&&(this.paramEmpty=t.paramempty)),null===this.asn1Params&&this.paramEmpty===!1&&null!==this.nameAlg){var r=this.nameAlg.toLowerCase();"withdsa"!==r.substr(-7,7)&&"withecdsa"!==r.substr(-9,9)&&(this.asn1Params=new n.DERNull)}},Un.lang.extend(hr.asn1.x509.AlgorithmIdentifier,hr.asn1.ASN1Object),hr.asn1.x509.GeneralName=function(t){hr.asn1.x509.GeneralName.superclass.constructor.call(this);var e={rfc822:"81",dns:"82",dn:"a4",uri:"86",ip:"87"},n=hr,r=n.asn1,i=(r.DERSequence,r.DEROctetString),o=r.DERIA5String,s=r.DERTaggedObject,a=r.ASN1Object,u=r.x509.X500Name,c=vn;this.explicit=!1,this.setByParam=function(t){var n=null;if(void 0!==t){if(void 0!==t.rfc822&&(this.type="rfc822",n=new o({str:t[this.type]})),void 0!==t.dns&&(this.type="dns",n=new o({str:t[this.type]})),void 0!==t.uri&&(this.type="uri",n=new o({str:t[this.type]})),void 0!==t.dn&&(this.type="dn",this.explicit=!0,n=new u({str:t.dn})),void 0!==t.ldapdn&&(this.type="dn",this.explicit=!0,n=new u({ldapstr:t.ldapdn})),void 0!==t.certissuer){this.type="dn",this.explicit=!0;var r=t.certissuer,f=null;if(r.match(/^[0-9A-Fa-f]+$/),r.indexOf("-----BEGIN ")!=-1&&(f=c(r)),null==f)throw"certissuer param not cert";var h=new Ln;h.hex=f;var l=h.getIssuerHex();n=new a,n.hTLV=l}if(void 0!==t.certsubj){this.type="dn",this.explicit=!0;var r=t.certsubj,f=null;if(r.match(/^[0-9A-Fa-f]+$/),r.indexOf("-----BEGIN ")!=-1&&(f=c(r)),null==f)throw"certsubj param not cert";var h=new Ln;h.hex=f;var l=h.getSubjectHex();n=new a,n.hTLV=l}if(void 0!==t.ip){this.type="ip",this.explicit=!1;var p,d=t.ip,g="malformed IP address";if(d.match(/^[0-9.]+[.][0-9.]+$/)){if(p=Dn("["+d.split(".").join(",")+"]"),8!==p.length)throw g}else if(d.match(/^[0-9A-Fa-f:]+:[0-9A-Fa-f:]+$/))p=En(d);else{if(!d.match(/^([0-9A-Fa-f][0-9A-Fa-f]){1,}$/))throw g;p=d}n=new i({hex:p})}if(null==this.type)throw"unsupported type in params="+t;this.asn1Obj=new s({explicit:this.explicit,tag:e[this.type],obj:n})}},this.getEncodedHex=function(){return this.asn1Obj.getEncodedHex()},void 0!==t&&this.setByParam(t)},Un.lang.extend(hr.asn1.x509.GeneralName,hr.asn1.ASN1Object),hr.asn1.x509.GeneralNames=function(t){hr.asn1.x509.GeneralNames.superclass.constructor.call(this);var e=hr,n=e.asn1;this.setByParamArray=function(t){for(var e=0;e<t.length;e++){var r=new n.x509.GeneralName(t[e]);this.asn1Array.push(r)}},this.getEncodedHex=function(){var t=new n.DERSequence({array:this.asn1Array});return t.getEncodedHex()},this.asn1Array=new Array,"undefined"!=typeof t&&this.setByParamArray(t)},Un.lang.extend(hr.asn1.x509.GeneralNames,hr.asn1.ASN1Object),hr.asn1.x509.DistributionPointName=function(t){hr.asn1.x509.DistributionPointName.superclass.constructor.call(this);var e=hr,n=e.asn1,r=n.DERTaggedObject;if(this.getEncodedHex=function(){if("full"!=this.type)throw"currently type shall be 'full': "+this.type;return this.asn1Obj=new r({explicit:!1,tag:this.tag,obj:this.asn1V}),this.hTLV=this.asn1Obj.getEncodedHex(),this.hTLV},void 0!==t){if(!n.x509.GeneralNames.prototype.isPrototypeOf(t))throw"This class supports GeneralNames only as argument";this.type="full",this.tag="a0",this.asn1V=t}},Un.lang.extend(hr.asn1.x509.DistributionPointName,hr.asn1.ASN1Object),hr.asn1.x509.DistributionPoint=function(t){hr.asn1.x509.DistributionPoint.superclass.constructor.call(this);var e=hr,n=e.asn1;this.getEncodedHex=function(){var t=new n.DERSequence;if(null!=this.asn1DP){var e=new n.DERTaggedObject({explicit:!0,tag:"a0",obj:this.asn1DP});t.appendASN1Object(e)}return this.hTLV=t.getEncodedHex(),this.hTLV},void 0!==t&&void 0!==t.dpobj&&(this.asn1DP=t.dpobj)},Un.lang.extend(hr.asn1.x509.DistributionPoint,hr.asn1.ASN1Object),hr.asn1.x509.OID=new function(t){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(t){if("undefined"!=typeof this.objCache[t])return this.objCache[t];if("undefined"==typeof this.name2oidList[t])throw"Name of ObjectIdentifier not defined: "+t;var e=this.name2oidList[t],n=new hr.asn1.DERObjectIdentifier({oid:e});return this.objCache[t]=n,n},this.atype2obj=function(t){if("undefined"!=typeof this.objCache[t])return this.objCache[t];if("undefined"==typeof this.atype2oidList[t])throw"AttributeType name undefined: "+t;var e=this.atype2oidList[t],n=new hr.asn1.DERObjectIdentifier({oid:e});return this.objCache[t]=n,n}},hr.asn1.x509.OID.oid2name=function(t){var e=hr.asn1.x509.OID.name2oidList;for(var n in e)if(e[n]==t)return n;return""},hr.asn1.x509.OID.oid2atype=function(t){var e=hr.asn1.x509.OID.atype2oidList;for(var n in e)if(e[n]==t)return n;return t},hr.asn1.x509.OID.name2oid=function(t){var e=hr.asn1.x509.OID.name2oidList;return void 0===e[t]?"":e[t]},hr.asn1.x509.X509Util={},hr.asn1.x509.X509Util.newCertPEM=function(t){var e=hr.asn1.x509,n=e.TBSCertificate,r=e.Certificate,i=new n;if(void 0===t.serial)throw"serial number undefined.";if(i.setSerialNumberByParam(t.serial),"string"!=typeof t.sigalg.name)throw"unproper signature algorithm name";if(i.setSignatureAlgByParam(t.sigalg),void 0===t.issuer)throw"issuer name undefined.";if(i.setIssuerByParam(t.issuer),void 0===t.notbefore)throw"notbefore undefined.";if(i.setNotBeforeByParam(t.notbefore),void 0===t.notafter)throw"notafter undefined.";if(i.setNotAfterByParam(t.notafter),void 0===t.subject)throw"subject name undefined.";if(i.setSubjectByParam(t.subject),void 0===t.sbjpubkey)throw"subject public key undefined.";if(i.setSubjectPublicKeyByGetKey(t.sbjpubkey),void 0!==t.ext&&void 0!==t.ext.length)for(var o=0;o<t.ext.length;o++)for(key in t.ext[o])i.appendExtensionByName(key,t.ext[o][key]);if(void 0===t.cakey&&void 0===t.sighex)throw"param cakey and sighex undefined.";var s=null,a=null;return t.cakey&&(s=t.cakey.isPrivate===!0?t.cakey:gr.getKey.apply(null,t.cakey),a=new r({tbscertobj:i,prvkeyobj:s}),a.sign()),t.sighex&&(a=new r({tbscertobj:i}),a.setSignatureHex(t.sighex)),a.getPEMString()};var hr;"undefined"!=typeof hr&&hr||(hr={}),"undefined"!=typeof hr.lang&&hr.lang||(hr.lang={}),hr.lang.String=function(){};var lr,pr;"function"==typeof t?(lr=function(e){return en(new t(e,"utf8").toString("base64"))},pr=function(e){return new t(nn(e),"base64").toString("utf8")}):(lr=function(t){return rn(_n(kn(t)))},pr=function(t){return decodeURIComponent(xn(on(t)))}),hr.lang.String.isInteger=function(t){return!!t.match(/^[0-9]+$/)||!!t.match(/^-[0-9]+$/)},hr.lang.String.isHex=function(t){return!(t.length%2!=0||!t.match(/^[0-9a-f]+$/)&&!t.match(/^[0-9A-F]+$/))},hr.lang.String.isBase64=function(t){return t=t.replace(/\s+/g,""),!(!t.match(/^[0-9A-Za-z+\/]+={0,3}$/)||t.length%4!=0)},hr.lang.String.isBase64URL=function(t){return!t.match(/[+\/=]/)&&(t=nn(t),hr.lang.String.isBase64(t))},hr.lang.String.isIntegerArray=function(t){return t=t.replace(/\s+/g,""),!!t.match(/^\[[0-9,]+\]$/)};var dr=function(t,e){var n=t.length;t.length>e.length&&(n=e.length);for(var r=0;r<n;r++)if(t.charCodeAt(r)!=e.charCodeAt(r))return r;return t.length!=e.length?n:-1};"undefined"!=typeof hr&&hr||(hr={}),"undefined"!=typeof hr.crypto&&hr.crypto||(hr.crypto={}),hr.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:Vn.algo.MD5,sha1:Vn.algo.SHA1,sha224:Vn.algo.SHA224,sha256:Vn.algo.SHA256,sha384:Vn.algo.SHA384,sha512:Vn.algo.SHA512,ripemd160:Vn.algo.RIPEMD160},this.getDigestInfoHex=function(t,e){if("undefined"==typeof this.DIGESTINFOHEAD[e])throw"alg not supported in Util.DIGESTINFOHEAD: "+e;return this.DIGESTINFOHEAD[e]+t},this.getPaddedDigestInfoHex=function(t,e,n){var r=this.getDigestInfoHex(t,e),i=n/4;if(r.length+22>i)throw"key is too short for SigAlg: keylen="+n+","+e;for(var o="0001",s="00"+r,a="",u=i-o.length-s.length,c=0;c<u;c+=2)a+="ff";var f=o+a+s;return f},this.hashString=function(t,e){var n=new hr.crypto.MessageDigest({alg:e});return n.digestString(t)},this.hashHex=function(t,e){var n=new hr.crypto.MessageDigest({alg:e});return n.digestHex(t)},this.sha1=function(t){var e=new hr.crypto.MessageDigest({alg:"sha1",prov:"cryptojs"});return e.digestString(t)},this.sha256=function(t){var e=new hr.crypto.MessageDigest({alg:"sha256",prov:"cryptojs"});return e.digestString(t)},this.sha256Hex=function(t){var e=new hr.crypto.MessageDigest({alg:"sha256",prov:"cryptojs"});return e.digestHex(t)},this.sha512=function(t){var e=new hr.crypto.MessageDigest({alg:"sha512",prov:"cryptojs"});return e.digestString(t)},this.sha512Hex=function(t){var e=new hr.crypto.MessageDigest({alg:"sha512",prov:"cryptojs"});return e.digestHex(t)}},hr.crypto.Util.md5=function(t){var e=new hr.crypto.MessageDigest({alg:"md5",prov:"cryptojs"});return e.digestString(t)},hr.crypto.Util.ripemd160=function(t){var e=new hr.crypto.MessageDigest({alg:"ripemd160",prov:"cryptojs"});return e.digestString(t)},hr.crypto.Util.SECURERANDOMGEN=new he,hr.crypto.Util.getRandomHexOfNbytes=function(t){var e=new Array(t);return hr.crypto.Util.SECURERANDOMGEN.nextBytes(e),$e(e)},hr.crypto.Util.getRandomBigIntegerOfNbytes=function(t){return new o(hr.crypto.Util.getRandomHexOfNbytes(t),16)},hr.crypto.Util.getRandomHexOfNbits=function(t){var e=t%8,n=(t-e)/8,r=new Array(n+1);return hr.crypto.Util.SECURERANDOMGEN.nextBytes(r),r[0]=(255<<e&255^255)&r[0],$e(r)},hr.crypto.Util.getRandomBigIntegerOfNbits=function(t){return new o(hr.crypto.Util.getRandomHexOfNbits(t),16)},hr.crypto.Util.getRandomBigIntegerZeroToMax=function(t){for(var e=t.bitLength();;){var n=hr.crypto.Util.getRandomBigIntegerOfNbits(e);if(t.compareTo(n)!=-1)return n}},hr.crypto.Util.getRandomBigIntegerMinToMax=function(t,e){var n=t.compareTo(e);if(1==n)throw"biMin is greater than biMax";if(0==n)return t;var r=e.subtract(t),i=hr.crypto.Util.getRandomBigIntegerZeroToMax(r);return i.add(t)},hr.crypto.MessageDigest=function(t){this.setAlgAndProvider=function(t,e){if(t=hr.crypto.MessageDigest.getCanonicalAlgName(t),null!==t&&void 0===e&&(e=hr.crypto.Util.DEFAULTPROVIDER[t]),":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(t)!=-1&&"cryptojs"==e){try{this.md=hr.crypto.Util.CRYPTOJSMESSAGEDIGESTNAME[t].create()}catch(e){throw"setAlgAndProvider hash alg set fail alg="+t+"/"+e}this.updateString=function(t){this.md.update(t)},this.updateHex=function(t){var e=Vn.enc.Hex.parse(t);this.md.update(e)},this.digest=function(){var t=this.md.finalize();return t.toString(Vn.enc.Hex)},this.digestString=function(t){return this.updateString(t),this.digest()},this.digestHex=function(t){return this.updateHex(t),this.digest()}}if(":sha256:".indexOf(t)!=-1&&"sjcl"==e){try{this.md=new sjcl.hash.sha256}catch(e){throw"setAlgAndProvider hash alg set fail alg="+t+"/"+e}this.updateString=function(t){this.md.update(t)},this.updateHex=function(t){var e=sjcl.codec.hex.toBits(t);this.md.update(e)},this.digest=function(){var t=this.md.finalize();return sjcl.codec.hex.fromBits(t)},this.digestString=function(t){return this.updateString(t),this.digest()},this.digestHex=function(t){return this.updateHex(t),this.digest()}}},this.updateString=function(t){throw"updateString(str) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.updateHex=function(t){throw"updateHex(hex) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.digest=function(){throw"digest() not supported for this alg/prov: "+this.algName+"/"+this.provName},this.digestString=function(t){throw"digestString(str) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.digestHex=function(t){throw"digestHex(hex) not supported for this alg/prov: "+this.algName+"/"+this.provName},void 0!==t&&void 0!==t.alg&&(this.algName=t.alg,void 0===t.prov&&(this.provName=hr.crypto.Util.DEFAULTPROVIDER[this.algName]),this.setAlgAndProvider(this.algName,this.provName))},hr.crypto.MessageDigest.getCanonicalAlgName=function(t){return"string"==typeof t&&(t=t.toLowerCase(),t=t.replace(/-/,"")),t},hr.crypto.MessageDigest.getHashLength=function(t){var e=hr.crypto.MessageDigest,n=e.getCanonicalAlgName(t);if(void 0===e.HASHLENGTH[n])throw"not supported algorithm: "+t;return e.HASHLENGTH[n]},hr.crypto.MessageDigest.HASHLENGTH={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,ripemd160:20},hr.crypto.Mac=function(t){this.setAlgAndProvider=function(t,e){if(t=t.toLowerCase(),null==t&&(t="hmacsha1"),t=t.toLowerCase(),"hmac"!=t.substr(0,4))throw"setAlgAndProvider unsupported HMAC alg: "+t;void 0===e&&(e=hr.crypto.Util.DEFAULTPROVIDER[t]),this.algProv=t+"/"+e;var n=t.substr(4);if(":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(n)!=-1&&"cryptojs"==e){try{var r=hr.crypto.Util.CRYPTOJSMESSAGEDIGESTNAME[n];this.mac=Vn.algo.HMAC.create(r,this.pass)}catch(t){throw"setAlgAndProvider hash alg set fail hashAlg="+n+"/"+t}this.updateString=function(t){this.mac.update(t)},this.updateHex=function(t){var e=Vn.enc.Hex.parse(t);this.mac.update(e)},this.doFinal=function(){var t=this.mac.finalize();return t.toString(Vn.enc.Hex)},this.doFinalString=function(t){return this.updateString(t),this.doFinal()},this.doFinalHex=function(t){return this.updateHex(t),this.doFinal()}}},this.updateString=function(t){throw"updateString(str) not supported for this alg/prov: "+this.algProv},this.updateHex=function(t){throw"updateHex(hex) not supported for this alg/prov: "+this.algProv},this.doFinal=function(){throw"digest() not supported for this alg/prov: "+this.algProv},this.doFinalString=function(t){throw"digestString(str) not supported for this alg/prov: "+this.algProv},this.doFinalHex=function(t){throw"digestHex(hex) not supported for this alg/prov: "+this.algProv},this.setPassword=function(t){if("string"==typeof t){var e=t;return t.length%2!=1&&t.match(/^[0-9A-Fa-f]+$/)||(e=hn(t)),void(this.pass=Vn.enc.Hex.parse(e))}if("object"!=("undefined"==typeof t?"undefined":Mn(t)))throw"KJUR.crypto.Mac unsupported password type: "+t;var e=null;if(void 0!==t.hex){if(t.hex.length%2!=0||!t.hex.match(/^[0-9A-Fa-f]+$/))throw"Mac: wrong hex password: "+t.hex;e=t.hex}if(void 0!==t.utf8&&(e=un(t.utf8)),void 0!==t.rstr&&(e=hn(t.rstr)),void 0!==t.b64&&(e=r(t.b64)),void 0!==t.b64u&&(e=on(t.b64u)),null==e)throw"KJUR.crypto.Mac unsupported password type: "+t;this.pass=Vn.enc.Hex.parse(e)},void 0!==t&&(void 0!==t.pass&&this.setPassword(t.pass),void 0!==t.alg&&(this.algName=t.alg,void 0===t.prov&&(this.provName=hr.crypto.Util.DEFAULTPROVIDER[this.algName]),this.setAlgAndProvider(this.algName,this.provName)))},hr.crypto.Signature=function(t){var e=null;if(this._setAlgNames=function(){var t=this.algName.match(/^(.+)with(.+)$/);t&&(this.mdAlgName=t[1].toLowerCase(),this.pubkeyAlgName=t[2].toLowerCase())},this._zeroPaddingOfSignature=function(t,e){for(var n="",r=e/4-t.length,i=0;i<r;i++)n+="0";return n+t},this.setAlgAndProvider=function(t,e){if(this._setAlgNames(),"cryptojs/jsrsa"!=e)throw"provider not supported: "+e;if(":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(this.mdAlgName)!=-1){try{this.md=new hr.crypto.MessageDigest({alg:this.mdAlgName})}catch(t){throw"setAlgAndProvider hash alg set fail alg="+this.mdAlgName+"/"+t}this.init=function(t,e){var n=null;try{n=void 0===e?gr.getKey(t):gr.getKey(t,e)}catch(t){throw"init failed:"+t}if(n.isPrivate===!0)this.prvKey=n,this.state="SIGN";else{if(n.isPublic!==!0)throw"init failed.:"+n;this.pubKey=n,this.state="VERIFY"}},this.updateString=function(t){this.md.updateString(t)},this.updateHex=function(t){this.md.updateHex(t)},this.sign=function(){if(this.sHashHex=this.md.digest(),"undefined"!=typeof this.ecprvhex&&"undefined"!=typeof this.eccurvename){var t=new hr.crypto.ECDSA({curve:this.eccurvename});this.hSign=t.signHex(this.sHashHex,this.ecprvhex)}else if(this.prvKey instanceof ve&&"rsaandmgf1"===this.pubkeyAlgName)this.hSign=this.prvKey.signWithMessageHashPSS(this.sHashHex,this.mdAlgName,this.pssSaltLen);else if(this.prvKey instanceof ve&&"rsa"===this.pubkeyAlgName)this.hSign=this.prvKey.signWithMessageHash(this.sHashHex,this.mdAlgName);else if(this.prvKey instanceof hr.crypto.ECDSA)this.hSign=this.prvKey.signWithMessageHash(this.sHashHex);else{if(!(this.prvKey instanceof hr.crypto.DSA))throw"Signature: unsupported private key alg: "+this.pubkeyAlgName;this.hSign=this.prvKey.signWithMessageHash(this.sHashHex)}return this.hSign},this.signString=function(t){return this.updateString(t),this.sign()},this.signHex=function(t){return this.updateHex(t),this.sign()},this.verify=function(t){if(this.sHashHex=this.md.digest(),"undefined"!=typeof this.ecpubhex&&"undefined"!=typeof this.eccurvename){var e=new hr.crypto.ECDSA({curve:this.eccurvename});return e.verifyHex(this.sHashHex,t,this.ecpubhex)}if(this.pubKey instanceof ve&&"rsaandmgf1"===this.pubkeyAlgName)return this.pubKey.verifyWithMessageHashPSS(this.sHashHex,t,this.mdAlgName,this.pssSaltLen);if(this.pubKey instanceof ve&&"rsa"===this.pubkeyAlgName)return this.pubKey.verifyWithMessageHash(this.sHashHex,t);if(void 0!==hr.crypto.ECDSA&&this.pubKey instanceof hr.crypto.ECDSA)return this.pubKey.verifyWithMessageHash(this.sHashHex,t);if(void 0!==hr.crypto.DSA&&this.pubKey instanceof hr.crypto.DSA)return this.pubKey.verifyWithMessageHash(this.sHashHex,t);throw"Signature: unsupported public key alg: "+this.pubkeyAlgName}}},this.init=function(t,e){throw"init(key, pass) not supported for this alg:prov="+this.algProvName},this.updateString=function(t){throw"updateString(str) not supported for this alg:prov="+this.algProvName},this.updateHex=function(t){throw"updateHex(hex) not supported for this alg:prov="+this.algProvName},this.sign=function(){throw"sign() not supported for this alg:prov="+this.algProvName},this.signString=function(t){throw"digestString(str) not supported for this alg:prov="+this.algProvName},this.signHex=function(t){throw"digestHex(hex) not supported for this alg:prov="+this.algProvName},this.verify=function(t){throw"verify(hSigVal) not supported for this alg:prov="+this.algProvName},this.initParams=t,void 0!==t&&(void 0!==t.alg&&(this.algName=t.alg,void 0===t.prov?this.provName=hr.crypto.Util.DEFAULTPROVIDER[this.algName]:this.provName=t.prov,this.algProvName=this.algName+":"+this.provName,this.setAlgAndProvider(this.algName,this.provName),this._setAlgNames()),void 0!==t.psssaltlen&&(this.pssSaltLen=t.psssaltlen),void 0!==t.prvkeypem)){if(void 0!==t.prvkeypas)throw"both prvkeypem and prvkeypas parameters not supported";try{var e=gr.getKey(t.prvkeypem);this.init(e)}catch(t){throw"fatal error to load pem private key: "+t}}},hr.crypto.Cipher=function(t){},hr.crypto.Cipher.encrypt=function(t,e,n){if(e instanceof ve&&e.isPublic){var r=hr.crypto.Cipher.getAlgByKeyAndName(e,n);if("RSA"===r)return e.encrypt(t);if("RSAOAEP"===r)return e.encryptOAEP(t,"sha1");var i=r.match(/^RSAOAEP(\d+)$/);if(null!==i)return e.encryptOAEP(t,"sha"+i[1]);throw"Cipher.encrypt: unsupported algorithm for RSAKey: "+n}throw"Cipher.encrypt: unsupported key or algorithm"},hr.crypto.Cipher.decrypt=function(t,e,n){if(e instanceof ve&&e.isPrivate){var r=hr.crypto.Cipher.getAlgByKeyAndName(e,n);if("RSA"===r)return e.decrypt(t);if("RSAOAEP"===r)return e.decryptOAEP(t,"sha1");var i=r.match(/^RSAOAEP(\d+)$/);if(null!==i)return e.decryptOAEP(t,"sha"+i[1]);throw"Cipher.decrypt: unsupported algorithm for RSAKey: "+n}throw"Cipher.decrypt: unsupported key or algorithm"},hr.crypto.Cipher.getAlgByKeyAndName=function(t,e){if(t instanceof ve){if(":RSA:RSAOAEP:RSAOAEP224:RSAOAEP256:RSAOAEP384:RSAOAEP512:".indexOf(e)!=-1)return e;if(null===e||void 0===e)return"RSA";throw"getAlgByKeyAndName: not supported algorithm name for RSAKey: "+e}throw"getAlgByKeyAndName: not supported algorithm name: "+e},hr.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"}},"undefined"!=typeof hr&&hr||(hr={}),"undefined"!=typeof hr.crypto&&hr.crypto||(hr.crypto={}),hr.crypto.ECDSA=function(t){var e="secp256r1",n=new he;
this.type="EC",this.isPrivate=!1,this.isPublic=!1,this.getBigRandom=function(t){return new o(t.bitLength(),n).mod(t.subtract(o.ONE)).add(o.ONE)},this.setNamedCurve=function(t){this.ecparams=hr.crypto.ECParameterDB.getByName(t),this.prvKeyHex=null,this.pubKeyHex=null,this.curveName=t},this.setPrivateKeyHex=function(t){this.isPrivate=!0,this.prvKeyHex=t},this.setPublicKeyHex=function(t){this.isPublic=!0,this.pubKeyHex=t},this.getPublicKeyXYHex=function(){var t=this.pubKeyHex;if("04"!==t.substr(0,2))throw"this method supports uncompressed format(04) only";var e=this.ecparams.keylen/4;if(t.length!==2+2*e)throw"malformed public key hex length";var n={};return n.x=t.substr(2,e),n.y=t.substr(2+e),n},this.getShortNISTPCurveName=function(){var t=this.curveName;return"secp256r1"===t||"NIST P-256"===t||"P-256"===t||"prime256v1"===t?"P-256":"secp384r1"===t||"NIST P-384"===t||"P-384"===t?"P-384":null},this.generateKeyPairHex=function(){var t=this.ecparams.n,e=this.getBigRandom(t),n=this.ecparams.G.multiply(e),r=n.getX().toBigInteger(),i=n.getY().toBigInteger(),o=this.ecparams.keylen/4,s=("0000000000"+e.toString(16)).slice(-o),a=("0000000000"+r.toString(16)).slice(-o),u=("0000000000"+i.toString(16)).slice(-o),c="04"+a+u;return this.setPrivateKeyHex(s),this.setPublicKeyHex(c),{ecprvhex:s,ecpubhex:c}},this.signWithMessageHash=function(t){return this.signHex(t,this.prvKeyHex)},this.signHex=function(t,e){var n=new o(e,16),r=this.ecparams.n,i=new o(t,16);do var s=this.getBigRandom(r),a=this.ecparams.G,u=a.multiply(s),c=u.getX().toBigInteger().mod(r);while(c.compareTo(o.ZERO)<=0);var f=s.modInverse(r).multiply(i.add(n.multiply(c))).mod(r);return hr.crypto.ECDSA.biRSSigToASN1Sig(c,f)},this.sign=function(t,e){var n=e,r=this.ecparams.n,i=o.fromByteArrayUnsigned(t);do var s=this.getBigRandom(r),a=this.ecparams.G,u=a.multiply(s),c=u.getX().toBigInteger().mod(r);while(c.compareTo(o.ZERO)<=0);var f=s.modInverse(r).multiply(i.add(n.multiply(c))).mod(r);return this.serializeSig(c,f)},this.verifyWithMessageHash=function(t,e){return this.verifyHex(t,e,this.pubKeyHex)},this.verifyHex=function(t,e,n){var r,i,s=hr.crypto.ECDSA.parseSigHex(e);r=s.r,i=s.s;var a;a=Te.decodeFromHex(this.ecparams.curve,n);var u=new o(t,16);return this.verifyRaw(u,r,i,a)},this.verify=function(t,e,n){var r,i;if(Bitcoin.Util.isArray(e)){var s=this.parseSig(e);r=s.r,i=s.s}else{if("object"!==("undefined"==typeof e?"undefined":Mn(e))||!e.r||!e.s)throw"Invalid value for signature";r=e.r,i=e.s}var a;if(n instanceof Te)a=n;else{if(!Bitcoin.Util.isArray(n))throw"Invalid format for pubkey value, must be byte array or ECPointFp";a=Te.decodeFrom(this.ecparams.curve,n)}var u=o.fromByteArrayUnsigned(t);return this.verifyRaw(u,r,i,a)},this.verifyRaw=function(t,e,n,r){var i=this.ecparams.n,s=this.ecparams.G;if(e.compareTo(o.ONE)<0||e.compareTo(i)>=0)return!1;if(n.compareTo(o.ONE)<0||n.compareTo(i)>=0)return!1;var a=n.modInverse(i),u=t.multiply(a).mod(i),c=e.multiply(a).mod(i),f=s.multiply(u).add(r.multiply(c)),h=f.getX().toBigInteger().mod(i);return h.equals(e)},this.serializeSig=function(t,e){var n=t.toByteArraySigned(),r=e.toByteArraySigned(),i=[];return i.push(2),i.push(n.length),i=i.concat(n),i.push(2),i.push(r.length),i=i.concat(r),i.unshift(i.length),i.unshift(48),i},this.parseSig=function(t){var e;if(48!=t[0])throw new Error("Signature not a valid DERSequence");if(e=2,2!=t[e])throw new Error("First element in signature must be a DERInteger");var n=t.slice(e+2,e+2+t[e+1]);if(e+=2+t[e+1],2!=t[e])throw new Error("Second element in signature must be a DERInteger");var r=t.slice(e+2,e+2+t[e+1]);e+=2+t[e+1];var i=o.fromByteArrayUnsigned(n),s=o.fromByteArrayUnsigned(r);return{r:i,s:s}},this.parseSigCompact=function(t){if(65!==t.length)throw"Signature has the wrong length";var e=t[0]-27;if(e<0||e>7)throw"Invalid signature type";var n=this.ecparams.n,r=o.fromByteArrayUnsigned(t.slice(1,33)).mod(n),i=o.fromByteArrayUnsigned(t.slice(33,65)).mod(n);return{r:r,s:i,i:e}},this.readPKCS5PrvKeyHex=function(t){var e=fr,n=hr.crypto.ECDSA.getName,r=e.getVbyList;if(e.isASN1HEX(t)===!1)throw"not ASN.1 hex string";var i,o,s;try{i=r(t,0,[2,0],"06"),o=r(t,0,[1],"04");try{s=r(t,0,[3,0],"03").substr(2)}catch(t){}}catch(t){throw"malformed PKCS#1/5 plain ECC private key"}if(this.curveName=n(i),void 0===this.curveName)throw"unsupported curve name";this.setNamedCurve(this.curveName),this.setPublicKeyHex(s),this.setPrivateKeyHex(o),this.isPublic=!1},this.readPKCS8PrvKeyHex=function(t){var e=fr,n=hr.crypto.ECDSA.getName,r=e.getVbyList;if(e.isASN1HEX(t)===!1)throw"not ASN.1 hex string";var i,o,s,a;try{i=r(t,0,[1,0],"06"),o=r(t,0,[1,1],"06"),s=r(t,0,[2,0,1],"04");try{a=r(t,0,[2,0,2,0],"03").substr(2)}catch(t){}}catch(t){throw"malformed PKCS#8 plain ECC private key"}if(this.curveName=n(o),void 0===this.curveName)throw"unsupported curve name";this.setNamedCurve(this.curveName),this.setPublicKeyHex(a),this.setPrivateKeyHex(s),this.isPublic=!1},this.readPKCS8PubKeyHex=function(t){var e=fr,n=hr.crypto.ECDSA.getName,r=e.getVbyList;if(e.isASN1HEX(t)===!1)throw"not ASN.1 hex string";var i,o,s;try{i=r(t,0,[0,0],"06"),o=r(t,0,[0,1],"06"),s=r(t,0,[1],"03").substr(2)}catch(t){throw"malformed PKCS#8 ECC public key"}if(this.curveName=n(o),null===this.curveName)throw"unsupported curve name";this.setNamedCurve(this.curveName),this.setPublicKeyHex(s)},this.readCertPubKeyHex=function(t,e){5!==e&&(e=6);var n=fr,r=hr.crypto.ECDSA.getName,i=n.getVbyList;if(n.isASN1HEX(t)===!1)throw"not ASN.1 hex string";var o,s;try{o=i(t,0,[0,e,0,1],"06"),s=i(t,0,[0,e,1],"03").substr(2)}catch(t){throw"malformed X.509 certificate ECC public key"}if(this.curveName=r(o),null===this.curveName)throw"unsupported curve name";this.setNamedCurve(this.curveName),this.setPublicKeyHex(s)},void 0!==t&&void 0!==t.curve&&(this.curveName=t.curve),void 0===this.curveName&&(this.curveName=e),this.setNamedCurve(this.curveName),void 0!==t&&(void 0!==t.prv&&this.setPrivateKeyHex(t.prv),void 0!==t.pub&&this.setPublicKeyHex(t.pub))},hr.crypto.ECDSA.parseSigHex=function(t){var e=hr.crypto.ECDSA.parseSigHexInHexRS(t),n=new o(e.r,16),r=new o(e.s,16);return{r:n,s:r}},hr.crypto.ECDSA.parseSigHexInHexRS=function(t){var e=fr,n=e.getChildIdx,r=e.getV;if("30"!=t.substr(0,2))throw"signature is not a ASN.1 sequence";var i=n(t,0);if(2!=i.length)throw"number of signature ASN.1 sequence elements seem wrong";var o=i[0],s=i[1];if("02"!=t.substr(o,2))throw"1st item of sequene of signature is not ASN.1 integer";if("02"!=t.substr(s,2))throw"2nd item of sequene of signature is not ASN.1 integer";var a=r(t,o),u=r(t,s);return{r:a,s:u}},hr.crypto.ECDSA.asn1SigToConcatSig=function(t){var e=hr.crypto.ECDSA.parseSigHexInHexRS(t),n=e.r,r=e.s;if("00"==n.substr(0,2)&&n.length%32==2&&(n=n.substr(2)),"00"==r.substr(0,2)&&r.length%32==2&&(r=r.substr(2)),n.length%32==30&&(n="00"+n),r.length%32==30&&(r="00"+r),n.length%32!=0)throw"unknown ECDSA sig r length error";if(r.length%32!=0)throw"unknown ECDSA sig s length error";return n+r},hr.crypto.ECDSA.concatSigToASN1Sig=function(t){if(t.length/2*8%128!=0)throw"unknown ECDSA concatinated r-s sig length error";var e=t.substr(0,t.length/2),n=t.substr(t.length/2);return hr.crypto.ECDSA.hexRSSigToASN1Sig(e,n)},hr.crypto.ECDSA.hexRSSigToASN1Sig=function(t,e){var n=new o(t,16),r=new o(e,16);return hr.crypto.ECDSA.biRSSigToASN1Sig(n,r)},hr.crypto.ECDSA.biRSSigToASN1Sig=function(t,e){var n=hr.asn1,r=new n.DERInteger({bigint:t}),i=new n.DERInteger({bigint:e}),o=new n.DERSequence({array:[r,i]});return o.getEncodedHex()},hr.crypto.ECDSA.getName=function(t){return"2a8648ce3d030107"===t?"secp256r1":"2b8104000a"===t?"secp256k1":"2b81040022"===t?"secp384r1":"|secp256r1|NIST P-256|P-256|prime256v1|".indexOf(t)!==-1?"secp256r1":"|secp256k1|".indexOf(t)!==-1?"secp256k1":"|secp384r1|NIST P-384|P-384|".indexOf(t)!==-1?"secp384r1":null},"undefined"!=typeof hr&&hr||(hr={}),"undefined"!=typeof hr.crypto&&hr.crypto||(hr.crypto={}),hr.crypto.ECParameterDB=new function(){function t(t){return new o(t,16)}var e={},n={};this.getByName=function(t){var r=t;if("undefined"!=typeof n[r]&&(r=n[t]),"undefined"!=typeof e[r])return e[r];throw"unregistered EC curve name: "+r},this.regist=function(r,i,o,s,a,u,c,f,h,l,p,d){e[r]={};var g=t(o),v=t(s),y=t(a),m=t(u),S=t(c),b=new He(g,v,y),F=b.decodePointHex("04"+f+h);e[r].name=r,e[r].keylen=i,e[r].curve=b,e[r].G=F,e[r].n=m,e[r].h=S,e[r].oid=p,e[r].info=d;for(var w=0;w<l.length;w++)n[l[w]]=r}},hr.crypto.ECParameterDB.regist("secp128r1",128,"FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFF","FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFC","E87579C11079F43DD824993C2CEE5ED3","FFFFFFFE0000000075A30D1B9038A115","1","161FF7528B899B2D0C28607CA52C5B86","CF5AC8395BAFEB13C02DA292DDED7A83",[],"","secp128r1 : SECG curve over a 128 bit prime field"),hr.crypto.ECParameterDB.regist("secp160k1",160,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73","0","7","0100000000000000000001B8FA16DFAB9ACA16B6B3","1","3B4C382CE37AA192A4019E763036F4F5DD4D7EBB","938CF935318FDCED6BC28286531733C3F03C4FEE",[],"","secp160k1 : SECG curve over a 160 bit prime field"),hr.crypto.ECParameterDB.regist("secp160r1",160,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFC","1C97BEFC54BD7A8B65ACF89F81D4D4ADC565FA45","0100000000000000000001F4C8F927AED3CA752257","1","4A96B5688EF573284664698968C38BB913CBFC82","23A628553168947D59DCC912042351377AC5FB32",[],"","secp160r1 : SECG curve over a 160 bit prime field"),hr.crypto.ECParameterDB.regist("secp192k1",192,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFEE37","0","3","FFFFFFFFFFFFFFFFFFFFFFFE26F2FC170F69466A74DEFD8D","1","DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D","9B2F2F6D9C5628A7844163D015BE86344082AA88D95E2F9D",[]),hr.crypto.ECParameterDB.regist("secp192r1",192,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC","64210519E59C80E70FA7E9AB72243049FEB8DEECC146B9B1","FFFFFFFFFFFFFFFFFFFFFFFF99DEF836146BC9B1B4D22831","1","188DA80EB03090F67CBF20EB43A18800F4FF0AFD82FF1012","07192B95FFC8DA78631011ED6B24CDD573F977A11E794811",[]),hr.crypto.ECParameterDB.regist("secp224r1",224,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFE","B4050A850C04B3ABF54132565044B0B7D7BFD8BA270B39432355FFB4","FFFFFFFFFFFFFFFFFFFFFFFFFFFF16A2E0B8F03E13DD29455C5C2A3D","1","B70E0CBD6BB4BF7F321390B94A03C1D356C21122343280D6115C1D21","BD376388B5F723FB4C22DFE6CD4375A05A07476444D5819985007E34",[]),hr.crypto.ECParameterDB.regist("secp256k1",256,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F","0","7","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141","1","79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798","483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8",[]),hr.crypto.ECParameterDB.regist("secp256r1",256,"FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF","FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC","5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B","FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551","1","6B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C296","4FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5",["NIST P-256","P-256","prime256v1"]),hr.crypto.ECParameterDB.regist("secp384r1",384,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFC","B3312FA7E23EE7E4988E056BE3F82D19181D9C6EFE8141120314088F5013875AC656398D8A2ED19D2A85C8EDD3EC2AEF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC7634D81F4372DDF581A0DB248B0A77AECEC196ACCC52973","1","AA87CA22BE8B05378EB1C71EF320AD746E1D3B628BA79B9859F741E082542A385502F25DBF55296C3A545E3872760AB7","3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f",["NIST P-384","P-384"]),hr.crypto.ECParameterDB.regist("secp521r1",521,"1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF","1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC","051953EB9618E1C9A1F929A21A0B68540EEA2DA725B99B315F3B8B489918EF109E156193951EC7E937B1652C0BD3BB1BF073573DF883D2C34F1EF451FD46B503F00","1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA51868783BF2F966B7FCC0148F709A5D03BB5C9B8899C47AEBB6FB71E91386409","1","C6858E06B70404E9CD9E3ECB662395B4429C648139053FB521F828AF606B4D3DBAA14B5E77EFE75928FE1DC127A2FFA8DE3348B3C1856A429BF97E7E31C2E5BD66","011839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650",["NIST P-521","P-521"]);var gr=function(){var t=function(t,e,n){return r(Vn.AES,t,e,n)},e=function(t,e,n){return r(Vn.TripleDES,t,e,n)},n=function(t,e,n){return r(Vn.DES,t,e,n)},r=function(t,e,n,r){var i=Vn.enc.Hex.parse(e),o=Vn.enc.Hex.parse(n),s=Vn.enc.Hex.parse(r),a={};a.key=o,a.iv=s,a.ciphertext=i;var u=t.decrypt(a,o,{iv:s});return Vn.enc.Hex.stringify(u)},i=function(t,e,n){return a(Vn.AES,t,e,n)},o=function(t,e,n){return a(Vn.TripleDES,t,e,n)},s=function(t,e,n){return a(Vn.DES,t,e,n)},a=function(t,e,n,r){var i=Vn.enc.Hex.parse(e),o=Vn.enc.Hex.parse(n),s=Vn.enc.Hex.parse(r),a=t.encrypt(i,o,{iv:s}),u=Vn.enc.Hex.parse(a.toString()),c=Vn.enc.Base64.stringify(u);return c},u={"AES-256-CBC":{proc:t,eproc:i,keylen:32,ivlen:16},"AES-192-CBC":{proc:t,eproc:i,keylen:24,ivlen:16},"AES-128-CBC":{proc:t,eproc:i,keylen:16,ivlen:16},"DES-EDE3-CBC":{proc:e,eproc:o,keylen:24,ivlen:8},"DES-CBC":{proc:n,eproc:s,keylen:8,ivlen:8}},c=function(t){var e=Vn.lib.WordArray.random(t),n=Vn.enc.Hex.stringify(e);return n},f=function(t){var e={},n=t.match(new RegExp("DEK-Info: ([^,]+),([0-9A-Fa-f]+)","m"));n&&(e.cipher=n[1],e.ivsalt=n[2]);var r=t.match(new RegExp("-----BEGIN ([A-Z]+) PRIVATE KEY-----"));r&&(e.type=r[1]);var i=-1,o=0;t.indexOf("\r\n\r\n")!=-1&&(i=t.indexOf("\r\n\r\n"),o=2),t.indexOf("\n\n")!=-1&&(i=t.indexOf("\n\n"),o=1);var s=t.indexOf("-----END");if(i!=-1&&s!=-1){var a=t.substring(i+2*o,s-o);a=a.replace(/\s+/g,""),e.data=a}return e},h=function(t,e,n){for(var r=n.substring(0,16),i=Vn.enc.Hex.parse(r),o=Vn.enc.Utf8.parse(e),s=u[t].keylen+u[t].ivlen,a="",c=null;;){var f=Vn.algo.MD5.create();if(null!=c&&f.update(c),f.update(o),f.update(i),c=f.finalize(),a+=Vn.enc.Hex.stringify(c),a.length>=2*s)break}var h={};return h.keyhex=a.substr(0,2*u[t].keylen),h.ivhex=a.substr(2*u[t].keylen,2*u[t].ivlen),h},l=function(t,e,n,r){var i=Vn.enc.Base64.parse(t),o=Vn.enc.Hex.stringify(i),s=u[e].proc,a=s(o,n,r);return a},p=function(t,e,n,r){var i=u[e].eproc,o=i(t,n,r);return o};return{version:"1.0.0",parsePKCS5PEM:function(t){return f(t)},getKeyAndUnusedIvByPasscodeAndIvsalt:function(t,e,n){return h(t,e,n)},decryptKeyB64:function(t,e,n,r){return l(t,e,n,r)},getDecryptedKeyHex:function(t,e){var n=f(t),r=(n.type,n.cipher),i=n.ivsalt,o=n.data,s=h(r,e,i),a=s.keyhex,u=l(o,r,a,i);return u},getEncryptedPKCS5PEMFromPrvKeyHex:function(t,e,n,r,i){var o="";if("undefined"!=typeof r&&null!=r||(r="AES-256-CBC"),"undefined"==typeof u[r])throw"KEYUTIL unsupported algorithm: "+r;if("undefined"==typeof i||null==i){var s=u[r].ivlen,a=c(s);i=a.toUpperCase()}var f=h(r,n,i),l=f.keyhex,d=p(e,r,l,i),g=d.replace(/(.{64})/g,"$1\r\n"),o="-----BEGIN "+t+" PRIVATE KEY-----\r\n";return o+="Proc-Type: 4,ENCRYPTED\r\n",o+="DEK-Info: "+r+","+i+"\r\n",o+="\r\n",o+=g,o+="\r\n-----END "+t+" PRIVATE KEY-----\r\n"},parseHexOfEncryptedPKCS8:function(t){var e=fr,n=e.getChildIdx,r=e.getV,i={},o=n(t,0);if(2!=o.length)throw"malformed format: SEQUENCE(0).items != 2: "+o.length;i.ciphertext=r(t,o[1]);var s=n(t,o[0]);if(2!=s.length)throw"malformed format: SEQUENCE(0.0).items != 2: "+s.length;if("2a864886f70d01050d"!=r(t,s[0]))throw"this only supports pkcs5PBES2";var a=n(t,s[1]);if(2!=s.length)throw"malformed format: SEQUENCE(0.0.1).items != 2: "+a.length;var u=n(t,a[1]);if(2!=u.length)throw"malformed format: SEQUENCE(0.0.1.1).items != 2: "+u.length;if("2a864886f70d0307"!=r(t,u[0]))throw"this only supports TripleDES";i.encryptionSchemeAlg="TripleDES",i.encryptionSchemeIV=r(t,u[1]);var c=n(t,a[0]);if(2!=c.length)throw"malformed format: SEQUENCE(0.0.1.0).items != 2: "+c.length;if("2a864886f70d01050c"!=r(t,c[0]))throw"this only supports pkcs5PBKDF2";var f=n(t,c[1]);if(f.length<2)throw"malformed format: SEQUENCE(0.0.1.0.1).items < 2: "+f.length;i.pbkdf2Salt=r(t,f[0]);var h=r(t,f[1]);try{i.pbkdf2Iter=parseInt(h,16)}catch(t){throw"malformed format pbkdf2Iter: "+h}return i},getPBKDF2KeyHexFromParam:function(t,e){var n=Vn.enc.Hex.parse(t.pbkdf2Salt),r=t.pbkdf2Iter,i=Vn.PBKDF2(e,n,{keySize:6,iterations:r}),o=Vn.enc.Hex.stringify(i);return o},_getPlainPKCS8HexFromEncryptedPKCS8PEM:function(t,e){var n=vn(t,"ENCRYPTED PRIVATE KEY"),r=this.parseHexOfEncryptedPKCS8(n),i=gr.getPBKDF2KeyHexFromParam(r,e),o={};o.ciphertext=Vn.enc.Hex.parse(r.ciphertext);var s=Vn.enc.Hex.parse(i),a=Vn.enc.Hex.parse(r.encryptionSchemeIV),u=Vn.TripleDES.decrypt(o,s,{iv:a}),c=Vn.enc.Hex.stringify(u);return c},getKeyFromEncryptedPKCS8PEM:function(t,e){var n=this._getPlainPKCS8HexFromEncryptedPKCS8PEM(t,e),r=this.getKeyFromPlainPrivatePKCS8Hex(n);return r},parsePlainPrivatePKCS8Hex:function(t){var e=fr,n=e.getChildIdx,r=e.getV,i={};if(i.algparam=null,"30"!=t.substr(0,2))throw"malformed plain PKCS8 private key(code:001)";var o=n(t,0);if(3!=o.length)throw"malformed plain PKCS8 private key(code:002)";if("30"!=t.substr(o[1],2))throw"malformed PKCS8 private key(code:003)";var s=n(t,o[1]);if(2!=s.length)throw"malformed PKCS8 private key(code:004)";if("06"!=t.substr(s[0],2))throw"malformed PKCS8 private key(code:005)";if(i.algoid=r(t,s[0]),"06"==t.substr(s[1],2)&&(i.algparam=r(t,s[1])),"04"!=t.substr(o[2],2))throw"malformed PKCS8 private key(code:006)";return i.keyidx=e.getVidx(t,o[2]),i},getKeyFromPlainPrivatePKCS8PEM:function(t){var e=vn(t,"PRIVATE KEY"),n=this.getKeyFromPlainPrivatePKCS8Hex(e);return n},getKeyFromPlainPrivatePKCS8Hex:function(t){var e,n=this.parsePlainPrivatePKCS8Hex(t);if("2a864886f70d010101"==n.algoid)e=new ve;else if("2a8648ce380401"==n.algoid)e=new hr.crypto.DSA;else{if("2a8648ce3d0201"!=n.algoid)throw"unsupported private key algorithm";e=new hr.crypto.ECDSA}return e.readPKCS8PrvKeyHex(t),e},_getKeyFromPublicPKCS8Hex:function(t){var e,n=fr.getVbyList(t,0,[0,0],"06");if("2a864886f70d010101"===n)e=new ve;else if("2a8648ce380401"===n)e=new hr.crypto.DSA;else{if("2a8648ce3d0201"!==n)throw"unsupported PKCS#8 public key hex";e=new hr.crypto.ECDSA}return e.readPKCS8PubKeyHex(t),e},parsePublicRawRSAKeyHex:function(t){var e=fr,n=e.getChildIdx,r=e.getV,i={};if("30"!=t.substr(0,2))throw"malformed RSA key(code:001)";var o=n(t,0);if(2!=o.length)throw"malformed RSA key(code:002)";if("02"!=t.substr(o[0],2))throw"malformed RSA key(code:003)";if(i.n=r(t,o[0]),"02"!=t.substr(o[1],2))throw"malformed RSA key(code:004)";return i.e=r(t,o[1]),i},parsePublicPKCS8Hex:function(t){var e=fr,n=e.getChildIdx,r=e.getV,i={};i.algparam=null;var o=n(t,0);if(2!=o.length)throw"outer DERSequence shall have 2 elements: "+o.length;var s=o[0];if("30"!=t.substr(s,2))throw"malformed PKCS8 public key(code:001)";var a=n(t,s);if(2!=a.length)throw"malformed PKCS8 public key(code:002)";if("06"!=t.substr(a[0],2))throw"malformed PKCS8 public key(code:003)";if(i.algoid=r(t,a[0]),"06"==t.substr(a[1],2)?i.algparam=r(t,a[1]):"30"==t.substr(a[1],2)&&(i.algparam={},i.algparam.p=e.getVbyList(t,a[1],[0],"02"),i.algparam.q=e.getVbyList(t,a[1],[1],"02"),i.algparam.g=e.getVbyList(t,a[1],[2],"02")),"03"!=t.substr(o[1],2))throw"malformed PKCS8 public key(code:004)";return i.key=r(t,o[1]).substr(2),i}}}();gr.getKey=function(t,e,n){var r=fr,i=r.getChildIdx,s=(r.getV,r.getVbyList),a=hr.crypto,u=a.ECDSA,c=a.DSA,f=ve,h=vn,l=gr;if("undefined"!=typeof f&&t instanceof f)return t;if("undefined"!=typeof u&&t instanceof u)return t;if("undefined"!=typeof c&&t instanceof c)return t;if(void 0!==t.curve&&void 0!==t.xy&&void 0===t.d)return new u({pub:t.xy,curve:t.curve});if(void 0!==t.curve&&void 0!==t.d)return new u({prv:t.d,curve:t.curve});if(void 0===t.kty&&void 0!==t.n&&void 0!==t.e&&void 0===t.d){var p=new f;return p.setPublic(t.n,t.e),p}if(void 0===t.kty&&void 0!==t.n&&void 0!==t.e&&void 0!==t.d&&void 0!==t.p&&void 0!==t.q&&void 0!==t.dp&&void 0!==t.dq&&void 0!==t.co&&void 0===t.qi){var p=new f;return p.setPrivateEx(t.n,t.e,t.d,t.p,t.q,t.dp,t.dq,t.co),p}if(void 0===t.kty&&void 0!==t.n&&void 0!==t.e&&void 0!==t.d&&void 0===t.p){var p=new f;return p.setPrivate(t.n,t.e,t.d),p}if(void 0!==t.p&&void 0!==t.q&&void 0!==t.g&&void 0!==t.y&&void 0===t.x){var p=new c;return p.setPublic(t.p,t.q,t.g,t.y),p}if(void 0!==t.p&&void 0!==t.q&&void 0!==t.g&&void 0!==t.y&&void 0!==t.x){var p=new c;return p.setPrivate(t.p,t.q,t.g,t.y,t.x),p}if("RSA"===t.kty&&void 0!==t.n&&void 0!==t.e&&void 0===t.d){var p=new f;return p.setPublic(on(t.n),on(t.e)),p}if("RSA"===t.kty&&void 0!==t.n&&void 0!==t.e&&void 0!==t.d&&void 0!==t.p&&void 0!==t.q&&void 0!==t.dp&&void 0!==t.dq&&void 0!==t.qi){var p=new f;return p.setPrivateEx(on(t.n),on(t.e),on(t.d),on(t.p),on(t.q),on(t.dp),on(t.dq),on(t.qi)),p}if("RSA"===t.kty&&void 0!==t.n&&void 0!==t.e&&void 0!==t.d){var p=new f;return p.setPrivate(on(t.n),on(t.e),on(t.d)),p}if("EC"===t.kty&&void 0!==t.crv&&void 0!==t.x&&void 0!==t.y&&void 0===t.d){var d=new u({curve:t.crv}),g=d.ecparams.keylen/4,v=("0000000000"+on(t.x)).slice(-g),y=("0000000000"+on(t.y)).slice(-g),m="04"+v+y;return d.setPublicKeyHex(m),d}if("EC"===t.kty&&void 0!==t.crv&&void 0!==t.x&&void 0!==t.y&&void 0!==t.d){var d=new u({curve:t.crv}),g=d.ecparams.keylen/4,v=("0000000000"+on(t.x)).slice(-g),y=("0000000000"+on(t.y)).slice(-g),m="04"+v+y,S=("0000000000"+on(t.d)).slice(-g);return d.setPublicKeyHex(m),d.setPrivateKeyHex(S),d}if("pkcs5prv"===n){var b,p,F=t,r=fr;if(b=i(F,0),9===b.length)p=new f,p.readPKCS5PrvKeyHex(F);else if(6===b.length)p=new c,p.readPKCS5PrvKeyHex(F);else{if(!(b.length>2&&"04"===F.substr(b[1],2)))throw"unsupported PKCS#1/5 hexadecimal key";p=new u,p.readPKCS5PrvKeyHex(F)}return p}if("pkcs8prv"===n){var p=l.getKeyFromPlainPrivatePKCS8Hex(t);return p}if("pkcs8pub"===n)return l._getKeyFromPublicPKCS8Hex(t);if("x509pub"===n)return Ln.getPublicKeyFromCertHex(t);if(t.indexOf("-END CERTIFICATE-",0)!=-1||t.indexOf("-END X509 CERTIFICATE-",0)!=-1||t.indexOf("-END TRUSTED CERTIFICATE-",0)!=-1)return Ln.getPublicKeyFromCertPEM(t);if(t.indexOf("-END PUBLIC KEY-")!=-1){var w=vn(t,"PUBLIC KEY");return l._getKeyFromPublicPKCS8Hex(w)}if(t.indexOf("-END RSA PRIVATE KEY-")!=-1&&t.indexOf("4,ENCRYPTED")==-1){var _=h(t,"RSA PRIVATE KEY");return l.getKey(_,null,"pkcs5prv")}if(t.indexOf("-END DSA PRIVATE KEY-")!=-1&&t.indexOf("4,ENCRYPTED")==-1){var x=h(t,"DSA PRIVATE KEY"),E=s(x,0,[1],"02"),A=s(x,0,[2],"02"),P=s(x,0,[3],"02"),C=s(x,0,[4],"02"),k=s(x,0,[5],"02"),p=new c;return p.setPrivate(new o(E,16),new o(A,16),new o(P,16),new o(C,16),new o(k,16)),p}if(t.indexOf("-END PRIVATE KEY-")!=-1)return l.getKeyFromPlainPrivatePKCS8PEM(t);if(t.indexOf("-END RSA PRIVATE KEY-")!=-1&&t.indexOf("4,ENCRYPTED")!=-1){var T=l.getDecryptedKeyHex(t,e),R=new ve;return R.readPKCS5PrvKeyHex(T),R}if(t.indexOf("-END EC PRIVATE KEY-")!=-1&&t.indexOf("4,ENCRYPTED")!=-1){var x=l.getDecryptedKeyHex(t,e),p=s(x,0,[1],"04"),I=s(x,0,[2,0],"06"),D=s(x,0,[3,0],"03").substr(2),N="";if(void 0===hr.crypto.OID.oidhex2name[I])throw"undefined OID(hex) in KJUR.crypto.OID: "+I;N=hr.crypto.OID.oidhex2name[I];var d=new u({curve:N});return d.setPublicKeyHex(D),d.setPrivateKeyHex(p),d.isPublic=!1,d}if(t.indexOf("-END DSA PRIVATE KEY-")!=-1&&t.indexOf("4,ENCRYPTED")!=-1){var x=l.getDecryptedKeyHex(t,e),E=s(x,0,[1],"02"),A=s(x,0,[2],"02"),P=s(x,0,[3],"02"),C=s(x,0,[4],"02"),k=s(x,0,[5],"02"),p=new c;return p.setPrivate(new o(E,16),new o(A,16),new o(P,16),new o(C,16),new o(k,16)),p}if(t.indexOf("-END ENCRYPTED PRIVATE KEY-")!=-1)return l.getKeyFromEncryptedPKCS8PEM(t,e);throw"not supported argument"},gr.generateKeypair=function(t,e){if("RSA"==t){var n=e,r=new ve;r.generate(n,"10001"),r.isPrivate=!0,r.isPublic=!0;var i=new ve,o=r.n.toString(16),s=r.e.toString(16);i.setPublic(o,s),i.isPrivate=!1,i.isPublic=!0;var a={};return a.prvKeyObj=r,a.pubKeyObj=i,a}if("EC"==t){var u=e,c=new hr.crypto.ECDSA({curve:u}),f=c.generateKeyPairHex(),r=new hr.crypto.ECDSA({curve:u});r.setPublicKeyHex(f.ecpubhex),r.setPrivateKeyHex(f.ecprvhex),r.isPrivate=!0,r.isPublic=!1;var i=new hr.crypto.ECDSA({curve:u});i.setPublicKeyHex(f.ecpubhex),i.isPrivate=!1,i.isPublic=!0;var a={};return a.prvKeyObj=r,a.pubKeyObj=i,a}throw"unknown algorithm: "+t},gr.getPEM=function(t,e,n,r,i,o){function s(t){var e=p({seq:[{int:0},{int:{bigint:t.n}},{int:t.e},{int:{bigint:t.d}},{int:{bigint:t.p}},{int:{bigint:t.q}},{int:{bigint:t.dmp1}},{int:{bigint:t.dmq1}},{int:{bigint:t.coeff}}]});return e}function a(t){var e=p({seq:[{int:1},{octstr:{hex:t.prvKeyHex}},{tag:["a0",!0,{oid:{name:t.curveName}}]},{tag:["a1",!0,{bitstr:{hex:"00"+t.pubKeyHex}}]}]});return e}function u(t){var e=p({seq:[{int:0},{int:{bigint:t.p}},{int:{bigint:t.q}},{int:{bigint:t.g}},{int:{bigint:t.y}},{int:{bigint:t.x}}]});return e}var c=hr,f=c.asn1,h=f.DERObjectIdentifier,l=f.DERInteger,p=f.ASN1Util.newObject,d=f.x509,g=d.SubjectPublicKeyInfo,v=c.crypto,y=v.DSA,m=v.ECDSA,S=ve;if((void 0!==S&&t instanceof S||void 0!==y&&t instanceof y||void 0!==m&&t instanceof m)&&1==t.isPublic&&(void 0===e||"PKCS8PUB"==e)){var b=new g(t),F=b.getEncodedHex();return gn(F,"PUBLIC KEY")}if("PKCS1PRV"==e&&void 0!==S&&t instanceof S&&(void 0===n||null==n)&&1==t.isPrivate){var b=s(t),F=b.getEncodedHex();return gn(F,"RSA PRIVATE KEY")}if("PKCS1PRV"==e&&void 0!==m&&t instanceof m&&(void 0===n||null==n)&&1==t.isPrivate){var w=new h({name:t.curveName}),_=w.getEncodedHex(),x=a(t),E=x.getEncodedHex(),A="";return A+=gn(_,"EC PARAMETERS"),A+=gn(E,"EC PRIVATE KEY")}if("PKCS1PRV"==e&&void 0!==y&&t instanceof y&&(void 0===n||null==n)&&1==t.isPrivate){var b=u(t),F=b.getEncodedHex();return gn(F,"DSA PRIVATE KEY")}if("PKCS5PRV"==e&&void 0!==S&&t instanceof S&&void 0!==n&&null!=n&&1==t.isPrivate){var b=s(t),F=b.getEncodedHex();return void 0===r&&(r="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("RSA",F,n,r,o)}if("PKCS5PRV"==e&&void 0!==m&&t instanceof m&&void 0!==n&&null!=n&&1==t.isPrivate){var b=a(t),F=b.getEncodedHex();return void 0===r&&(r="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("EC",F,n,r,o)}if("PKCS5PRV"==e&&void 0!==y&&t instanceof y&&void 0!==n&&null!=n&&1==t.isPrivate){var b=u(t),F=b.getEncodedHex();return void 0===r&&(r="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("DSA",F,n,r,o)}var P=function(t,e){var n=C(t,e),r=new p({seq:[{seq:[{oid:{name:"pkcs5PBES2"}},{seq:[{seq:[{oid:{name:"pkcs5PBKDF2"}},{seq:[{octstr:{hex:n.pbkdf2Salt}},{int:n.pbkdf2Iter}]}]},{seq:[{oid:{name:"des-EDE3-CBC"}},{octstr:{hex:n.encryptionSchemeIV}}]}]}]},{octstr:{hex:n.ciphertext}}]});return r.getEncodedHex()},C=function(t,e){var n=100,r=Vn.lib.WordArray.random(8),i="DES-EDE3-CBC",o=Vn.lib.WordArray.random(8),s=Vn.PBKDF2(e,r,{keySize:6,iterations:n}),a=Vn.enc.Hex.parse(t),u=Vn.TripleDES.encrypt(a,s,{iv:o})+"",c={};return c.ciphertext=u,c.pbkdf2Salt=Vn.enc.Hex.stringify(r),c.pbkdf2Iter=n,c.encryptionSchemeAlg=i,c.encryptionSchemeIV=Vn.enc.Hex.stringify(o),c};if("PKCS8PRV"==e&&void 0!=S&&t instanceof S&&1==t.isPrivate){var k=s(t),T=k.getEncodedHex(),b=p({seq:[{int:0},{seq:[{oid:{name:"rsaEncryption"}},{null:!0}]},{octstr:{hex:T}}]}),F=b.getEncodedHex();if(void 0===n||null==n)return gn(F,"PRIVATE KEY");var E=P(F,n);return gn(E,"ENCRYPTED PRIVATE KEY")}if("PKCS8PRV"==e&&void 0!==m&&t instanceof m&&1==t.isPrivate){var k=new p({seq:[{int:1},{octstr:{hex:t.prvKeyHex}},{tag:["a1",!0,{bitstr:{hex:"00"+t.pubKeyHex}}]}]}),T=k.getEncodedHex(),b=p({seq:[{int:0},{seq:[{oid:{name:"ecPublicKey"}},{oid:{name:t.curveName}}]},{octstr:{hex:T}}]}),F=b.getEncodedHex();if(void 0===n||null==n)return gn(F,"PRIVATE KEY");var E=P(F,n);return gn(E,"ENCRYPTED PRIVATE KEY")}if("PKCS8PRV"==e&&void 0!==y&&t instanceof y&&1==t.isPrivate){var k=new l({bigint:t.x}),T=k.getEncodedHex(),b=p({seq:[{int:0},{seq:[{oid:{name:"dsa"}},{seq:[{int:{bigint:t.p}},{int:{bigint:t.q}},{int:{bigint:t.g}}]}]},{octstr:{hex:T}}]}),F=b.getEncodedHex();if(void 0===n||null==n)return gn(F,"PRIVATE KEY");var E=P(F,n);return gn(E,"ENCRYPTED PRIVATE KEY")}throw"unsupported object nor format"},gr.getKeyFromCSRPEM=function(t){var e=vn(t,"CERTIFICATE REQUEST"),n=gr.getKeyFromCSRHex(e);return n},gr.getKeyFromCSRHex=function(t){var e=gr.parseCSRHex(t),n=gr.getKey(e.p8pubkeyhex,null,"pkcs8pub");return n},gr.parseCSRHex=function(t){var e=fr,n=e.getChildIdx,r=e.getTLV,i={},o=t;if("30"!=o.substr(0,2))throw"malformed CSR(code:001)";var s=n(o,0);if(s.length<1)throw"malformed CSR(code:002)";if("30"!=o.substr(s[0],2))throw"malformed CSR(code:003)";var a=n(o,s[0]);if(a.length<3)throw"malformed CSR(code:004)";return i.p8pubkeyhex=r(o,a[2]),i},gr.getJWKFromKey=function(t){var e={};if(t instanceof ve&&t.isPrivate)return e.kty="RSA",e.n=rn(t.n.toString(16)),e.e=rn(t.e.toString(16)),e.d=rn(t.d.toString(16)),e.p=rn(t.p.toString(16)),e.q=rn(t.q.toString(16)),e.dp=rn(t.dmp1.toString(16)),e.dq=rn(t.dmq1.toString(16)),e.qi=rn(t.coeff.toString(16)),e;if(t instanceof ve&&t.isPublic)return e.kty="RSA",e.n=rn(t.n.toString(16)),e.e=rn(t.e.toString(16)),e;if(t instanceof hr.crypto.ECDSA&&t.isPrivate){var n=t.getShortNISTPCurveName();if("P-256"!==n&&"P-384"!==n)throw"unsupported curve name for JWT: "+n;var r=t.getPublicKeyXYHex();return e.kty="EC",e.crv=n,e.x=rn(r.x),e.y=rn(r.y),e.d=rn(t.prvKeyHex),e}if(t instanceof hr.crypto.ECDSA&&t.isPublic){var n=t.getShortNISTPCurveName();if("P-256"!==n&&"P-384"!==n)throw"unsupported curve name for JWT: "+n;var r=t.getPublicKeyXYHex();return e.kty="EC",e.crv=n,e.x=rn(r.x),e.y=rn(r.y),e}throw"not supported key object"},ve.getPosArrayOfChildrenFromHex=function(t){return fr.getChildIdx(t,0)},ve.getHexValueArrayOfChildrenFromHex=function(t){var e=fr,n=e.getV,r=ve.getPosArrayOfChildrenFromHex(t),i=n(t,r[0]),o=n(t,r[1]),s=n(t,r[2]),a=n(t,r[3]),u=n(t,r[4]),c=n(t,r[5]),f=n(t,r[6]),h=n(t,r[7]),l=n(t,r[8]),r=new Array;return r.push(i,o,s,a,u,c,f,h,l),r},ve.prototype.readPrivateKeyFromPEMString=function(t){var e=vn(t),n=ve.getHexValueArrayOfChildrenFromHex(e);this.setPrivateEx(n[1],n[2],n[3],n[4],n[5],n[6],n[7],n[8])},ve.prototype.readPKCS5PrvKeyHex=function(t){var e=ve.getHexValueArrayOfChildrenFromHex(t);this.setPrivateEx(e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},ve.prototype.readPKCS8PrvKeyHex=function(t){var e,n,r,i,o,s,a,u,c=fr,f=c.getVbyList;if(c.isASN1HEX(t)===!1)throw"not ASN.1 hex string";try{e=f(t,0,[2,0,1],"02"),n=f(t,0,[2,0,2],"02"),r=f(t,0,[2,0,3],"02"),i=f(t,0,[2,0,4],"02"),o=f(t,0,[2,0,5],"02"),s=f(t,0,[2,0,6],"02"),a=f(t,0,[2,0,7],"02"),u=f(t,0,[2,0,8],"02")}catch(t){throw"malformed PKCS#8 plain RSA private key"}this.setPrivateEx(e,n,r,i,o,s,a,u)},ve.prototype.readPKCS5PubKeyHex=function(t){var e=fr,n=e.getV;if(e.isASN1HEX(t)===!1)throw"keyHex is not ASN.1 hex string";var r=e.getChildIdx(t,0);if(2!==r.length||"02"!==t.substr(r[0],2)||"02"!==t.substr(r[1],2))throw"wrong hex for PKCS#5 public key";var i=n(t,r[0]),o=n(t,r[1]);this.setPublic(i,o)},ve.prototype.readPKCS8PubKeyHex=function(t){var e=fr;if(e.isASN1HEX(t)===!1)throw"not ASN.1 hex string";if("06092a864886f70d010101"!==e.getTLVbyList(t,0,[0,0]))throw"not PKCS8 RSA public key";var n=e.getTLVbyList(t,0,[1,0]);this.readPKCS5PubKeyHex(n)},ve.prototype.readCertPubKeyHex=function(t,e){var n,r;n=new Ln,n.readCertHex(t),r=n.getPublicKeyHex(),this.readPKCS8PubKeyHex(r)};var vr=new RegExp("");vr.compile("[^0-9a-f]","gi"),ve.prototype.sign=function(t,e){var n=function(t){return hr.crypto.Util.hashString(t,e)},r=n(t);return this.signWithMessageHash(r,e)},ve.prototype.signWithMessageHash=function(t,e){var n=hr.crypto.Util.getPaddedDigestInfoHex(t,e,this.n.bitLength()),r=le(n,16),i=this.doPrivate(r),o=i.toString(16);return Nn(o,this.n.bitLength());
},ve.prototype.signPSS=function(t,e,n){var r=function(t){return hr.crypto.Util.hashHex(t,e)},i=r(hn(t));return void 0===n&&(n=-1),this.signWithMessageHashPSS(i,e,n)},ve.prototype.signWithMessageHashPSS=function(t,e,n){var r,i=fn(t),s=i.length,a=this.n.bitLength()-1,u=Math.ceil(a/8),c=function(t){return hr.crypto.Util.hashHex(t,e)};if(n===-1||void 0===n)n=s;else if(n===-2)n=u-s-2;else if(n<-2)throw"invalid salt length";if(u<s+n+2)throw"data too long";var f="";n>0&&(f=new Array(n),(new he).nextBytes(f),f=String.fromCharCode.apply(String,f));var h=fn(c(hn("\0\0\0\0\0\0\0\0"+i+f))),l=[];for(r=0;r<u-n-s-2;r+=1)l[r]=0;var p=String.fromCharCode.apply(String,l)+""+f,d=On(h,p.length,c),g=[];for(r=0;r<p.length;r+=1)g[r]=p.charCodeAt(r)^d.charCodeAt(r);var v=65280>>8*u-a&255;for(g[0]&=~v,r=0;r<s;r++)g.push(h.charCodeAt(r));return g.push(188),Nn(this.doPrivate(new o(g)).toString(16),this.n.bitLength())},ve.prototype.verify=function(t,e){e=e.replace(vr,""),e=e.replace(/[ \n]+/g,"");var n=le(e,16);if(n.bitLength()>this.n.bitLength())return 0;var r=this.doPublic(n),i=r.toString(16).replace(/^1f+00/,""),o=jn(i);if(0==o.length)return!1;var s=o[0],a=o[1],u=function(t){return hr.crypto.Util.hashString(t,s)},c=u(t);return a==c},ve.prototype.verifyWithMessageHash=function(t,e){e=e.replace(vr,""),e=e.replace(/[ \n]+/g,"");var n=le(e,16);if(n.bitLength()>this.n.bitLength())return 0;var r=this.doPublic(n),i=r.toString(16).replace(/^1f+00/,""),o=jn(i);if(0==o.length)return!1;var s=(o[0],o[1]);return s==t},ve.prototype.verifyPSS=function(t,e,n,r){var i=function(t){return hr.crypto.Util.hashHex(t,n)},o=i(hn(t));return void 0===r&&(r=-1),this.verifyWithMessageHashPSS(o,e,n,r)},ve.prototype.verifyWithMessageHashPSS=function(t,e,n,r){var i=new o(e,16);if(i.bitLength()>this.n.bitLength())return!1;var s,a=function(t){return hr.crypto.Util.hashHex(t,n)},u=fn(t),c=u.length,f=this.n.bitLength()-1,h=Math.ceil(f/8);if(r===-1||void 0===r)r=c;else if(r===-2)r=h-c-2;else if(r<-2)throw"invalid salt length";if(h<c+r+2)throw"data too long";var l=this.doPublic(i).toByteArray();for(s=0;s<l.length;s+=1)l[s]&=255;for(;l.length<h;)l.unshift(0);if(188!==l[h-1])throw"encoded message does not end in 0xbc";l=String.fromCharCode.apply(String,l);var p=l.substr(0,h-c-1),d=l.substr(p.length,c),g=65280>>8*h-f&255;if(0!==(p.charCodeAt(0)&g))throw"bits beyond keysize not zero";var v=On(d,p.length,a),y=[];for(s=0;s<p.length;s+=1)y[s]=p.charCodeAt(s)^v.charCodeAt(s);y[0]&=~g;var m=h-c-r-2;for(s=0;s<m;s+=1)if(0!==y[s])throw"leftmost octets not zero";if(1!==y[m])throw"0x01 marker not found";return d===fn(a(hn("\0\0\0\0\0\0\0\0"+u+String.fromCharCode.apply(String,y.slice(-r)))))},ve.SALT_LEN_HLEN=-1,ve.SALT_LEN_MAX=-2,ve.SALT_LEN_RECOVER=-2,Ln.hex2dn=function(t,e){if(void 0===e&&(e=0),"30"!==t.substr(e,2))throw"malformed DN";for(var n=new Array,r=fr.getChildIdx(t,e),i=0;i<r.length;i++)n.push(Ln.hex2rdn(t,r[i]));return n=n.map(function(t){return t.replace("/","\\/")}),"/"+n.join("/")},Ln.hex2rdn=function(t,e){if(void 0===e&&(e=0),"31"!==t.substr(e,2))throw"malformed RDN";for(var n=new Array,r=fr.getChildIdx(t,e),i=0;i<r.length;i++)n.push(Ln.hex2attrTypeValue(t,r[i]));return n=n.map(function(t){return t.replace("+","\\+")}),n.join("+")},Ln.hex2attrTypeValue=function(t,e){var n=fr,r=n.getV;if(void 0===e&&(e=0),"30"!==t.substr(e,2))throw"malformed attribute type and value";var i=n.getChildIdx(t,e);2!==i.length||"06"!==t.substr(i[0],2);var o=r(t,i[0]),s=hr.asn1.ASN1Util.oidHexToInt(o),a=hr.asn1.x509.OID.oid2atype(s),u=r(t,i[1]),c=fn(u);return a+"="+c},Ln.getPublicKeyFromCertHex=function(t){var e=new Ln;return e.readCertHex(t),e.getPublicKey()},Ln.getPublicKeyFromCertPEM=function(t){var e=new Ln;return e.readCertPEM(t),e.getPublicKey()},Ln.getPublicKeyInfoPropOfCertPEM=function(t){var e,n,r=fr,i=r.getVbyList,o={};return o.algparam=null,e=new Ln,e.readCertPEM(t),n=e.getPublicKeyHex(),o.keyhex=i(n,0,[1],"03").substr(2),o.algoid=i(n,0,[0,0],"06"),"2a8648ce3d0201"===o.algoid&&(o.algparam=i(n,0,[0,1],"06")),o},Ln.KEYUSAGE_NAME=["digitalSignature","nonRepudiation","keyEncipherment","dataEncipherment","keyAgreement","keyCertSign","cRLSign","encipherOnly","decipherOnly"],"undefined"!=typeof hr&&hr||(hr={}),"undefined"!=typeof hr.jws&&hr.jws||(hr.jws={}),hr.jws.JWS=function(){var t=hr,e=t.jws.JWS,n=e.isSafeJSONString;this.parseJWS=function(t,e){if(void 0===this.parsedJWS||!e&&void 0===this.parsedJWS.sigvalH){var r=t.match(/^([^.]+)\.([^.]+)\.([^.]+)$/);if(null==r)throw"JWS signature is not a form of 'Head.Payload.SigValue'.";var i=r[1],o=r[2],s=r[3],a=i+"."+o;if(this.parsedJWS={},this.parsedJWS.headB64U=i,this.parsedJWS.payloadB64U=o,this.parsedJWS.sigvalB64U=s,this.parsedJWS.si=a,!e){var u=on(s),c=le(u,16);this.parsedJWS.sigvalH=u,this.parsedJWS.sigvalBI=c}var f=pr(i),h=pr(o);if(this.parsedJWS.headS=f,this.parsedJWS.payloadS=h,!n(f,this.parsedJWS,"headP"))throw"malformed JSON string for JWS Head: "+f}}},hr.jws.JWS.sign=function(t,e,n,r,i){var o,s,a,u=hr,c=u.jws,f=c.JWS,h=f.readSafeJSONString,l=f.isSafeJSONString,p=u.crypto,d=(p.ECDSA,p.Mac),g=p.Signature,v=JSON;if("string"!=typeof e&&"object"!=("undefined"==typeof e?"undefined":Mn(e)))throw"spHeader must be JSON string or object: "+e;if("object"==("undefined"==typeof e?"undefined":Mn(e))&&(s=e,o=v.stringify(s)),"string"==typeof e){if(o=e,!l(o))throw"JWS Head is not safe JSON string: "+o;s=h(o)}if(a=n,"object"==("undefined"==typeof n?"undefined":Mn(n))&&(a=v.stringify(n)),""!=t&&null!=t||void 0===s.alg||(t=s.alg),""!=t&&null!=t&&void 0===s.alg&&(s.alg=t,o=v.stringify(s)),t!==s.alg)throw"alg and sHeader.alg doesn't match: "+t+"!="+s.alg;var y=null;if(void 0===f.jwsalg2sigalg[t])throw"unsupported alg name: "+t;y=f.jwsalg2sigalg[t];var m=lr(o),S=lr(a),b=m+"."+S,F="";if("Hmac"==y.substr(0,4)){if(void 0===r)throw"mac key shall be specified for HS* alg";var w=new d({alg:y,prov:"cryptojs",pass:r});w.updateString(b),F=w.doFinal()}else if(y.indexOf("withECDSA")!=-1){var _=new g({alg:y});_.init(r,i),_.updateString(b),hASN1Sig=_.sign(),F=hr.crypto.ECDSA.asn1SigToConcatSig(hASN1Sig)}else if("none"!=y){var _=new g({alg:y});_.init(r,i),_.updateString(b),F=_.sign()}var x=rn(F);return b+"."+x},hr.jws.JWS.verify=function(t,e,n){var r,i=hr,o=i.jws,s=o.JWS,a=s.readSafeJSONString,u=i.crypto,c=u.ECDSA,f=u.Mac,h=u.Signature;void 0!==("undefined"==typeof ve?"undefined":Mn(ve))&&(r=ve);var l=t.split(".");if(3!==l.length)return!1;var p=l[0],d=l[1],g=p+"."+d,v=on(l[2]),y=a(pr(l[0])),m=null,S=null;if(void 0===y.alg)throw"algorithm not specified in header";if(m=y.alg,S=m.substr(0,2),null!=n&&"[object Array]"===Object.prototype.toString.call(n)&&n.length>0){var b=":"+n.join(":")+":";if(b.indexOf(":"+m+":")==-1)throw"algorithm '"+m+"' not accepted in the list"}if("none"!=m&&null===e)throw"key shall be specified to verify.";if("string"==typeof e&&e.indexOf("-----BEGIN ")!=-1&&(e=gr.getKey(e)),!("RS"!=S&&"PS"!=S||e instanceof r))throw"key shall be a RSAKey obj for RS* and PS* algs";if("ES"==S&&!(e instanceof c))throw"key shall be a ECDSA obj for ES* algs";var F=null;if(void 0===s.jwsalg2sigalg[y.alg])throw"unsupported alg name: "+m;if(F=s.jwsalg2sigalg[m],"none"==F)throw"not supported";if("Hmac"==F.substr(0,4)){var w=null;if(void 0===e)throw"hexadecimal key shall be specified for HMAC";var _=new f({alg:F,pass:e});return _.updateString(g),w=_.doFinal(),v==w}if(F.indexOf("withECDSA")!=-1){var x=null;try{x=c.concatSigToASN1Sig(v)}catch(t){return!1}var E=new h({alg:F});return E.init(e),E.updateString(g),E.verify(x)}var E=new h({alg:F});return E.init(e),E.updateString(g),E.verify(v)},hr.jws.JWS.parse=function(t){var e,n,r,i=t.split("."),o={};if(2!=i.length&&3!=i.length)throw"malformed sJWS: wrong number of '.' splitted elements";return e=i[0],n=i[1],3==i.length&&(r=i[2]),o.headerObj=hr.jws.JWS.readSafeJSONString(pr(e)),o.payloadObj=hr.jws.JWS.readSafeJSONString(pr(n)),o.headerPP=JSON.stringify(o.headerObj,null," "),null==o.payloadObj?o.payloadPP=pr(n):o.payloadPP=JSON.stringify(o.payloadObj,null," "),void 0!==r&&(o.sigHex=on(r)),o},hr.jws.JWS.verifyJWT=function(t,e,n){var r=hr,i=r.jws,o=i.JWS,s=o.readSafeJSONString,a=o.inArray,u=o.includedArray,c=t.split("."),f=c[0],h=c[1],l=(on(c[2]),s(pr(f))),p=s(pr(h));if(void 0===l.alg)return!1;if(void 0===n.alg)throw"acceptField.alg shall be specified";if(!a(l.alg,n.alg))return!1;if(void 0!==p.iss&&"object"===Mn(n.iss)&&!a(p.iss,n.iss))return!1;if(void 0!==p.sub&&"object"===Mn(n.sub)&&!a(p.sub,n.sub))return!1;if(void 0!==p.aud&&"object"===Mn(n.aud))if("string"==typeof p.aud){if(!a(p.aud,n.aud))return!1}else if("object"==Mn(p.aud)&&!u(p.aud,n.aud))return!1;var d=i.IntDate.getNow();return void 0!==n.verifyAt&&"number"==typeof n.verifyAt&&(d=n.verifyAt),void 0!==n.gracePeriod&&"number"==typeof n.gracePeriod||(n.gracePeriod=0),!(void 0!==p.exp&&"number"==typeof p.exp&&p.exp+n.gracePeriod<d)&&(!(void 0!==p.nbf&&"number"==typeof p.nbf&&d<p.nbf-n.gracePeriod)&&(!(void 0!==p.iat&&"number"==typeof p.iat&&d<p.iat-n.gracePeriod)&&((void 0===p.jti||void 0===n.jti||p.jti===n.jti)&&!!o.verify(t,e,n.alg))))},hr.jws.JWS.includedArray=function(t,e){var n=hr.jws.JWS.inArray;if(null===t)return!1;if("object"!==("undefined"==typeof t?"undefined":Mn(t)))return!1;if("number"!=typeof t.length)return!1;for(var r=0;r<t.length;r++)if(!n(t[r],e))return!1;return!0},hr.jws.JWS.inArray=function(t,e){if(null===e)return!1;if("object"!==("undefined"==typeof e?"undefined":Mn(e)))return!1;if("number"!=typeof e.length)return!1;for(var n=0;n<e.length;n++)if(e[n]==t)return!0;return!1},hr.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"},hr.jws.JWS.isSafeJSONString=function(t,e,n){var r=null;try{return r=cr(t),"object"!=("undefined"==typeof r?"undefined":Mn(r))?0:r.constructor===Array?0:(e&&(e[n]=r),1)}catch(t){return 0}},hr.jws.JWS.readSafeJSONString=function(t){var e=null;try{return e=cr(t),"object"!=("undefined"==typeof e?"undefined":Mn(e))?null:e.constructor===Array?null:e}catch(t){return null}},hr.jws.JWS.getEncodedSignatureValueFromJWS=function(t){var e=t.match(/^[^.]+\.[^.]+\.([^.]+)$/);if(null==e)throw"JWS signature is not a form of 'Head.Payload.SigValue'.";return e[1]},hr.jws.JWS.getJWKthumbprint=function(t){if("RSA"!==t.kty&&"EC"!==t.kty&&"oct"!==t.kty)throw"unsupported algorithm for JWK Thumprint";var e="{";if("RSA"===t.kty){if("string"!=typeof t.n||"string"!=typeof t.e)throw"wrong n and e value for RSA key";e+='"e":"'+t.e+'",',e+='"kty":"'+t.kty+'",',e+='"n":"'+t.n+'"}'}else if("EC"===t.kty){if("string"!=typeof t.crv||"string"!=typeof t.x||"string"!=typeof t.y)throw"wrong crv, x and y value for EC key";e+='"crv":"'+t.crv+'",',e+='"kty":"'+t.kty+'",',e+='"x":"'+t.x+'",',e+='"y":"'+t.y+'"}'}else if("oct"===t.kty){if("string"!=typeof t.k)throw"wrong k value for oct(symmetric) key";e+='"kty":"'+t.kty+'",',e+='"k":"'+t.k+'"}'}var n=hn(e),r=hr.crypto.Util.hashHex(n,"sha256"),i=rn(r);return i},hr.jws.IntDate={},hr.jws.IntDate.get=function(t){var e=hr.jws.IntDate,n=e.getNow,r=e.getZulu;if("now"==t)return n();if("now + 1hour"==t)return n()+3600;if("now + 1day"==t)return n()+86400;if("now + 1month"==t)return n()+2592e3;if("now + 1year"==t)return n()+31536e3;if(t.match(/Z$/))return r(t);if(t.match(/^[0-9]+$/))return parseInt(t);throw"unsupported format: "+t},hr.jws.IntDate.getZulu=function(t){return bn(t)},hr.jws.IntDate.getNow=function(){var t=~~(new Date/1e3);return t},hr.jws.IntDate.intDate2UTCString=function(t){var e=new Date(1e3*t);return e.toUTCString()},hr.jws.IntDate.intDate2Zulu=function(t){var e=new Date(1e3*t),n=("0000"+e.getUTCFullYear()).slice(-4),r=("00"+(e.getUTCMonth()+1)).slice(-2),i=("00"+e.getUTCDate()).slice(-2),o=("00"+e.getUTCHours()).slice(-2),s=("00"+e.getUTCMinutes()).slice(-2),a=("00"+e.getUTCSeconds()).slice(-2);return n+r+i+o+s+a+"Z"},e.SecureRandom=he,e.rng_seed_time=ue,e.BigInteger=o,e.RSAKey=ve,e.ECDSA=hr.crypto.ECDSA,e.DSA=hr.crypto.DSA,e.Signature=hr.crypto.Signature,e.MessageDigest=hr.crypto.MessageDigest,e.Mac=hr.crypto.Mac,e.Cipher=hr.crypto.Cipher,e.KEYUTIL=gr,e.ASN1HEX=fr,e.X509=Ln,e.CryptoJS=Vn,e.b64tohex=r,e.b64toBA=i,e.stoBA=ze,e.BAtos=Ye,e.BAtohex=$e,e.stohex=Xe,e.stob64=Ze,e.stob64u=Qe,e.b64utos=tn,e.b64tob64u=en,e.b64utob64=nn,e.hex2b64=n,e.hextob64u=rn,e.b64utohex=on,e.utf8tob64u=lr,e.b64utoutf8=pr,e.utf8tob64=sn,e.b64toutf8=an,e.utf8tohex=un,e.hextoutf8=cn,e.hextorstr=fn,e.rstrtohex=hn,e.hextob64=ln,e.hextob64nl=pn,e.b64nltohex=dn,e.hextopem=gn,e.pemtohex=vn,e.hextoArrayBuffer=yn,e.ArrayBuffertohex=mn,e.zulutomsec=Sn,e.zulutosec=bn,e.zulutodate=Fn,e.datetozulu=wn,e.uricmptohex=_n,e.hextouricmp=xn,e.ipv6tohex=En,e.hextoipv6=An,e.hextoip=Pn,e.iptohex=Cn,e.encodeURIComponentAll=kn,e.newline_toUnix=Tn,e.newline_toDos=Rn,e.hextoposhex=In,e.intarystrtohex=Dn,e.strdiffidx=dr,e.KJUR=hr,e.crypto=hr.crypto,e.asn1=hr.asn1,e.jws=hr.jws,e.lang=hr.lang}).call(e,n(340).Buffer)},function(t,e){},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0}),e.SigninRequest=void 0;var i=n(328),o=n(342),s=n(343);e.SigninRequest=function(){function t(e){var n=e.url,a=e.client_id,u=e.redirect_uri,c=e.response_type,f=e.scope,h=e.authority,l=e.data,p=e.prompt,d=e.display,g=e.max_age,v=e.ui_locales,y=e.id_token_hint,m=e.login_hint,S=e.acr_values,b=e.resource,F=e.request,w=e.request_uri,_=e.extraQueryParams;if(r(this,t),!n)throw i.Log.error("SigninRequest.ctor: No url passed"),new Error("url");if(!a)throw i.Log.error("SigninRequest.ctor: No client_id passed"),new Error("client_id");if(!u)throw i.Log.error("SigninRequest.ctor: No redirect_uri passed"),new Error("redirect_uri");if(!c)throw i.Log.error("SigninRequest.ctor: No response_type passed"),new Error("response_type");if(!f)throw i.Log.error("SigninRequest.ctor: No scope passed"),new Error("scope");if(!h)throw i.Log.error("SigninRequest.ctor: No authority passed"),new Error("authority");var x=t.isOidc(c);this.state=new s.SigninState({nonce:x,data:l,client_id:a,authority:h}),n=o.UrlUtility.addQueryParam(n,"client_id",a),n=o.UrlUtility.addQueryParam(n,"redirect_uri",u),n=o.UrlUtility.addQueryParam(n,"response_type",c),n=o.UrlUtility.addQueryParam(n,"scope",f),n=o.UrlUtility.addQueryParam(n,"state",this.state.id),x&&(n=o.UrlUtility.addQueryParam(n,"nonce",this.state.nonce));var E={prompt:p,display:d,max_age:g,ui_locales:v,id_token_hint:y,login_hint:m,acr_values:S,resource:b,request:F,request_uri:w};for(var A in E)E[A]&&(n=o.UrlUtility.addQueryParam(n,A,E[A]));for(var P in _)n=o.UrlUtility.addQueryParam(n,P,_[P]);this.url=n}return t.isOidc=function(t){var e=t.split(/\s+/g).filter(function(t){return"id_token"===t});return!!e[0]},t.isOAuth=function(t){var e=t.split(/\s+/g).filter(function(t){return"token"===t});return!!e[0]},t}()},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0}),e.UrlUtility=void 0;var i=n(328),o=n(332);e.UrlUtility=function(){function t(){r(this,t)}return t.addQueryParam=function(t,e,n){return t.indexOf("?")<0&&(t+="?"),"?"!==t[t.length-1]&&(t+="&"),t+=encodeURIComponent(e),t+="=",t+=encodeURIComponent(n)},t.parseUrlFragment=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"#",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o.Global;"string"!=typeof t&&(t=n.location.href);var r=t.lastIndexOf(e);r>=0&&(t=t.substr(r+1));for(var s,a={},u=/([^&=]+)=([^&]*)/g,c=0;s=u.exec(t);)if(a[decodeURIComponent(s[1])]=decodeURIComponent(s[2]),c++>50)return i.Log.error("UrlUtility.parseUrlFragment: response exceeded expected number of parameters",t),{error:"Response exceeded expected number of parameters"};for(var f in a)return a;return{}},t}()},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function s(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0}),e.SigninState=void 0;var a=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),u=n(328),c=n(344),f=n(345),h=r(f);e.SigninState=function(t){function e(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.nonce,s=n.authority,a=n.client_id;i(this,e);var u=o(this,t.call(this,arguments[0]));return r===!0?u._nonce=(0,h.default)():r&&(u._nonce=r),u._authority=s,u._client_id=a,u}return s(e,t),e.prototype.toStorageString=function(){return u.Log.debug("SigninState.toStorageString"),JSON.stringify({id:this.id,data:this.data,created:this.created,nonce:this.nonce,authority:this.authority,client_id:this.client_id})},e.fromStorageString=function(t){u.Log.debug("SigninState.fromStorageString");var n=JSON.parse(t);return new e(n)},a(e,[{key:"nonce",get:function(){return this._nonce}},{key:"authority",get:function(){return this._authority}},{key:"client_id",get:function(){return this._client_id}}]),e}(c.State)},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0}),e.State=void 0;var o=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),s=n(328),a=n(345),u=r(a);e.State=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.id,r=e.data,o=e.created;i(this,t),this._id=n||(0,u.default)(),this._data=r,"number"==typeof o&&o>0?this._created=o:this._created=parseInt(Date.now()/1e3)}return t.prototype.toStorageString=function(){return s.Log.debug("State.toStorageString"),JSON.stringify({id:this.id,data:this.data,created:this.created})},t.fromStorageString=function(e){return s.Log.debug("State.fromStorageString"),new t(JSON.parse(e))},t.clearStaleState=function(e,n){var r=Date.now()/1e3-n;return e.getAllKeys().then(function(n){s.Log.debug("State.clearStaleState: got keys",n);for(var i=[],o=function(o){var a=n[o];u=e.get(a).then(function(n){var i=!1;if(n)try{var o=t.fromStorageString(n);s.Log.debug("State.clearStaleState: got item from key: ",a,o.created),o.created<=r&&(i=!0)}catch(t){s.Log.error("State.clearStaleState: Error parsing state for key",a,t.message),i=!0}else s.Log.debug("State.clearStaleState: no item in storage for key: ",a),i=!0;if(i)return s.Log.debug("State.clearStaleState: removed item for key: ",a),e.remove(a)}),i.push(u)},a=0;a<n.length;a++){var u;o(a)}return s.Log.debug("State.clearStaleState: waiting on promise count:",i.length),Promise.all(i)})},o(t,[{key:"id",get:function(){return this._id}},{key:"data",get:function(){return this._data}},{key:"created",get:function(){return this._created}}]),t}()},function(t,e){"use strict";
// @preserve Copyright (c) Microsoft Open Technologies, Inc.
function n(){for(var t="xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx",e="0123456789abcdef",n=0,r="",i=0;i<t.length;i++)"-"!==t[i]&&"4"!==t[i]&&(n=16*Math.random()|0),"x"===t[i]?r+=e[n]:"y"===t[i]?(n&=3,n|=8,r+=e[n]):r+=t[i];return r}Object.defineProperty(e,"__esModule",{value:!0}),e.default=n,t.exports=e.default},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0}),e.SigninResponse=void 0;var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),o=n(342),s="openid";e.SigninResponse=function(){function t(e){r(this,t);var n=o.UrlUtility.parseUrlFragment(e,"#");this.error=n.error,this.error_description=n.error_description,this.error_uri=n.error_uri,this.state=n.state,this.id_token=n.id_token,this.session_state=n.session_state,this.access_token=n.access_token,this.token_type=n.token_type,this.scope=n.scope,this.profile=void 0;var i=parseInt(n.expires_in);if("number"==typeof i&&i>0){var s=parseInt(Date.now()/1e3);this.expires_at=s+i}}return i(t,[{key:"expires_in",get:function(){if(this.expires_at){var t=parseInt(Date.now()/1e3);return this.expires_at-t}}},{key:"expired",get:function(){var t=this.expires_in;if(void 0!==t)return t<=0}},{key:"scopes",get:function(){return(this.scope||"").split(" ")}},{key:"isOpenIdConnect",get:function(){return this.scopes.indexOf(s)>=0||!!this.id_token}}]),t}()},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0}),e.SignoutRequest=void 0;var i=n(328),o=n(342),s=n(344);e.SignoutRequest=function t(e){var n=e.url,a=e.id_token_hint,u=e.post_logout_redirect_uri,c=e.data;if(r(this,t),!n)throw i.Log.error("SignoutRequest.ctor: No url passed"),new Error("url");a&&(n=o.UrlUtility.addQueryParam(n,"id_token_hint",a)),u&&(n=o.UrlUtility.addQueryParam(n,"post_logout_redirect_uri",u),c&&(this.state=new s.State({data:c}),n=o.UrlUtility.addQueryParam(n,"state",this.state.id))),this.url=n}},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0}),e.SignoutResponse=void 0;var i=n(342);e.SignoutResponse=function t(e){r(this,t);var n=i.UrlUtility.parseUrlFragment(e,"?");this.error=n.error,this.error_description=n.error_description,this.error_uri=n.error_uri,this.state=n.state}},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0}),e.InMemoryWebStorage=void 0;var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),o=n(328);e.InMemoryWebStorage=function(){function t(){r(this,t),this._data={}}return t.prototype.getItem=function(t){return o.Log.debug("InMemoryWebStorage.getItem",t),this._data[t]},t.prototype.setItem=function(t,e){o.Log.debug("InMemoryWebStorage.setItem",t),this._data[t]=e},t.prototype.removeItem=function(t){o.Log.debug("InMemoryWebStorage.removeItem",t),delete this._data[t]},t.prototype.key=function(t){return Object.getOwnPropertyNames(this._data)[t]},i(t,[{key:"length",get:function(){return Object.getOwnPropertyNames(this._data).length}}]),t}()},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0}),e.UserManager=void 0;var s=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),a=n(328),u=n(329),c=n(351),f=n(357),h=n(358),l=n(362),p=n(363),d=n(365);e.UserManager=function(t){function e(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.SilentRenewService,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:p.SessionMonitor,u=arguments.length>3&&void 0!==arguments[3]?arguments[3]:d.TokenRevocationClient;r(this,e),n instanceof c.UserManagerSettings||(n=new c.UserManagerSettings(n));var f=i(this,t.call(this,n));return f._events=new h.UserManagerEvents(n),f._silentRenewService=new o(f),f.settings.automaticSilentRenew&&(a.Log.debug("UserManager.ctor: automaticSilentRenew is configured, setting up silent renew"),f.startSilentRenew()),f.settings.monitorSession&&(a.Log.debug("UserManager.ctor: monitorSession is configured, setting up session monitor"),f._sessionMonitor=new s(f)),f._tokenRevocationClient=new u(f._settings),f}return o(e,t),e.prototype.getUser=function(){var t=this;return this._loadUser().then(function(e){return e?(a.Log.info("UserManager.getUser: user loaded"),t._events.load(e,!1),e):(a.Log.info("UserManager.getUser: user not found in storage"),null)})},e.prototype.removeUser=function(){var t=this;return this.storeUser(null).then(function(){a.Log.info("UserManager.removeUser: user removed from storage"),t._events.unload()})},e.prototype.signinRedirect=function(t){return this._signinStart(t,this._redirectNavigator).then(function(){a.Log.info("UserManager.signinRedirect: successful")})},e.prototype.signinRedirectCallback=function(t){return this._signinEnd(t||this._redirectNavigator.url).then(function(t){return t&&(t.profile&&t.profile.sub?a.Log.info("UserManager.signinRedirectCallback: successful, signed in sub: ",t.profile.sub):a.Log.info("UserManager.signinRedirectCallback: no sub")),t})},e.prototype.signinPopup=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.redirect_uri||this.settings.popup_redirect_uri||this.settings.redirect_uri;return e?(t.redirect_uri=e,t.display="popup",this._signin(t,this._popupNavigator,{startUrl:e,popupWindowFeatures:t.popupWindowFeatures||this.settings.popupWindowFeatures,popupWindowTarget:t.popupWindowTarget||this.settings.popupWindowTarget}).then(function(t){return t&&(t.profile&&t.profile.sub?a.Log.info("UserManager.signinPopup: signinPopup successful, signed in sub: ",t.profile.sub):a.Log.info("UserManager.signinPopup: no sub")),t})):(a.Log.error("UserManager.signinPopup: No popup_redirect_uri or redirect_uri configured"),Promise.reject(new Error("No popup_redirect_uri or redirect_uri configured")))},e.prototype.signinPopupCallback=function(t){return this._signinCallback(t,this._popupNavigator).then(function(t){return t&&(t.profile&&t.profile.sub?a.Log.info("UserManager.signinPopupCallback: successful, signed in sub: ",t.profile.sub):a.Log.info("UserManager.signinPopupCallback: no sub")),t})},e.prototype.signinSilent=function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.redirect_uri||this.settings.silent_redirect_uri;if(!n)return a.Log.error("UserManager.signinSilent: No silent_redirect_uri configured"),Promise.reject(new Error("No silent_redirect_uri configured"));e.redirect_uri=n,e.prompt="none";var r=void 0;return r=e.id_token_hint||!this.settings.includeIdTokenInSilentRenew?Promise.resolve():this._loadUser().then(function(t){e.id_token_hint=t&&t.id_token}),r.then(function(){return t._signin(e,t._iframeNavigator,{startUrl:n,silentRequestTimeout:e.silentRequestTimeout||t.settings.silentRequestTimeout})}).then(function(t){return t&&(t.profile&&t.profile.sub?a.Log.info("UserManager.signinSilent: successful, signed in sub: ",t.profile.sub):a.Log.info("UserManager.signinSilent: no sub")),t})},e.prototype.signinSilentCallback=function(t){return this._signinCallback(t,this._iframeNavigator).then(function(t){return t&&(t.profile&&t.profile.sub?a.Log.info("UserManager.signinSilentCallback: successful, signed in sub: ",t.profile.sub):a.Log.info("UserManager.signinSilentCallback: no sub")),t})},e.prototype.querySessionStatus=function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.redirect_uri||this.settings.silent_redirect_uri;return n?(e.redirect_uri=n,e.prompt="none",e.response_type="id_token",e.scope="openid",this._signinStart(e,this._iframeNavigator,{startUrl:n,silentRequestTimeout:e.silentRequestTimeout||this.settings.silentRequestTimeout}).then(function(e){return t.processSigninResponse(e.url).then(function(t){return a.Log.debug("UserManager.querySessionStatus: got signin response"),t.session_state&&t.profile.sub&&t.profile.sid?(a.Log.info("UserManager.querySessionStatus: querySessionStatus success for sub: ",t.profile.sub),{session_state:t.session_state,sub:t.profile.sub,sid:t.profile.sid}):void a.Log.info("querySessionStatus successful, user not authenticated")})})):(a.Log.error("UserManager.querySessionStatus: No silent_redirect_uri configured"),Promise.reject(new Error("No silent_redirect_uri configured")))},e.prototype._signin=function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this._signinStart(t,e,r).then(function(t){return n._signinEnd(t.url)})},e.prototype._signinStart=function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e.prepare(r).then(function(e){return a.Log.debug("UserManager._signinStart: got navigator window handle"),n.createSigninRequest(t).then(function(t){return a.Log.debug("UserManager._signinStart: got signin request"),r.url=t.url,r.id=t.state.id,e.navigate(r)}).catch(function(t){throw e.close&&(a.Log.debug("UserManager._signinStart: Error after preparing navigator, closing navigator window"),e.close()),t})})},e.prototype._signinEnd=function(t){var e=this;return this.processSigninResponse(t).then(function(t){a.Log.debug("UserManager._signinEnd: got signin response");var n=new f.User(t);return e.storeUser(n).then(function(){return a.Log.debug("UserManager._signinEnd: user stored"),e._events.load(n),n})})},e.prototype._signinCallback=function(t,e){return a.Log.debug("UserManager._signinCallback"),e.callback(t)},e.prototype.signoutRedirect=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.post_logout_redirect_uri||this.settings.post_logout_redirect_uri;return e&&(t.post_logout_redirect_uri=e),this._signoutStart(t,this._redirectNavigator).then(function(){a.Log.info("UserManager.signoutRedirect: successful")})},e.prototype.signoutRedirectCallback=function(t){return this._signoutEnd(t||this._redirectNavigator.url).then(function(t){return a.Log.info("UserManager.signoutRedirectCallback: successful"),t})},e.prototype.signoutPopup=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.post_logout_redirect_uri||this.settings.popup_post_logout_redirect_uri||this.settings.post_logout_redirect_uri;return t.post_logout_redirect_uri=e,t.display="popup",t.post_logout_redirect_uri&&(t.state=t.state||{}),this._signout(t,this._popupNavigator,{startUrl:e,popupWindowFeatures:t.popupWindowFeatures||this.settings.popupWindowFeatures,popupWindowTarget:t.popupWindowTarget||this.settings.popupWindowTarget}).then(function(){a.Log.info("UserManager.signinPopup: successful")})},e.prototype.signoutPopupCallback=function(t,e){"undefined"==typeof e&&"boolean"==typeof t&&(t=null,e=!0);var n="?";return this._popupNavigator.callback(t,e,n).then(function(){a.Log.info("UserManager.signoutPopupCallback: successful")})},e.prototype._signout=function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this._signoutStart(t,e,r).then(function(t){return n._signoutEnd(t.url)})},e.prototype._signoutStart=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this,n=arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return n.prepare(r).then(function(n){return a.Log.debug("UserManager._signoutStart: got navigator window handle"),e._loadUser().then(function(i){a.Log.debug("UserManager._signoutStart: loaded current user from storage");var o=e._settings.revokeAccessTokenOnSignout?e._revokeInternal(i):Promise.resolve();return o.then(function(){var o=t.id_token_hint||i&&i.id_token;return o&&(a.Log.debug("UserManager._signoutStart: Setting id_token into signout request"),t.id_token_hint=o),e.removeUser().then(function(){return a.Log.debug("UserManager._signoutStart: user removed, creating signout request"),e.createSignoutRequest(t).then(function(t){return a.Log.debug("UserManager._signoutStart: got signout request"),r.url=t.url,t.state&&(r.id=t.state.id),n.navigate(r)})})})}).catch(function(t){throw n.close&&(a.Log.debug("UserManager._signoutStart: Error after preparing navigator, closing navigator window"),n.close()),t})})},e.prototype._signoutEnd=function(t){return this.processSignoutResponse(t).then(function(t){return a.Log.debug("UserManager._signoutEnd: got signout response"),t})},e.prototype.revokeAccessToken=function(){var t=this;return this._loadUser().then(function(e){return t._revokeInternal(e,!0).then(function(n){if(n)return a.Log.debug("UserManager.revokeAccessToken: removing token properties from user and re-storing"),e.access_token=null,e.expires_at=null,e.token_type=null,t.storeUser(e).then(function(){a.Log.debug("UserManager.revokeAccessToken: user stored"),t._events.load(e)})})}).then(function(){a.Log.info("UserManager.revokeAccessToken: access token revoked successfully")})},e.prototype._revokeInternal=function(t,e){var n=t&&t.access_token;return!n||n.indexOf(".")>=0?(a.Log.debug("UserManager.revokeAccessToken: no need to revoke due to no user, token, or JWT format"),Promise.resolve(!1)):this._tokenRevocationClient.revoke(n,e).then(function(){return!0})},e.prototype.startSilentRenew=function(){this._silentRenewService.start()},e.prototype.stopSilentRenew=function(){this._silentRenewService.stop()},e.prototype._loadUser=function(){return this._userStore.get(this._userStoreKey).then(function(t){return t?(a.Log.debug("UserManager._loadUser: user storageString loaded"),f.User.fromStorageString(t)):(a.Log.debug("UserManager._loadUser: no user storageString"),null)})},e.prototype.storeUser=function(t){if(t){a.Log.debug("UserManager.storeUser: storing user");var e=t.toStorageString();return this._userStore.set(this._userStoreKey,e)}return a.Log.debug("storeUser.storeUser: removing user"),this._userStore.remove(this._userStoreKey)},s(e,[{key:"_redirectNavigator",get:function(){return this.settings.redirectNavigator}},{key:"_popupNavigator",get:function(){return this.settings.popupNavigator}},{key:"_iframeNavigator",get:function(){return this.settings.iframeNavigator}},{key:"_userStore",get:function(){return this.settings.userStore}},{key:"events",get:function(){return this._events}},{key:"_userStoreKey",get:function(){return"user:"+this.settings.authority+":"+this.settings.client_id}}]),e}(u.OidcClient)},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0}),e.UserManagerSettings=void 0;var s=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),a=(n(328),n(330)),u=n(352),c=n(353),f=n(355),h=n(331),l=n(332),p=60,d=2e3;e.UserManagerSettings=function(t){function e(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=n.popup_redirect_uri,s=n.popup_post_logout_redirect_uri,a=n.popupWindowFeatures,g=n.popupWindowTarget,v=n.silent_redirect_uri,y=n.silentRequestTimeout,m=n.automaticSilentRenew,S=void 0!==m&&m,b=n.includeIdTokenInSilentRenew,F=void 0===b||b,w=n.monitorSession,_=void 0===w||w,x=n.checkSessionInterval,E=void 0===x?d:x,A=n.stopCheckSessionOnError,P=void 0===A||A,C=n.revokeAccessTokenOnSignout,k=void 0!==C&&C,T=n.accessTokenExpiringNotificationTime,R=void 0===T?p:T,I=n.redirectNavigator,D=void 0===I?new u.RedirectNavigator:I,N=n.popupNavigator,O=void 0===N?new c.PopupNavigator:N,j=n.iframeNavigator,L=void 0===j?new f.IFrameNavigator:j,M=n.userStore,B=void 0===M?new h.WebStorageStateStore({store:l.Global.sessionStorage}):M;r(this,e);var H=i(this,t.call(this,arguments[0]));return H._popup_redirect_uri=o,H._popup_post_logout_redirect_uri=s,H._popupWindowFeatures=a,H._popupWindowTarget=g,H._silent_redirect_uri=v,H._silentRequestTimeout=y,H._automaticSilentRenew=!!S,H._includeIdTokenInSilentRenew=F,H._accessTokenExpiringNotificationTime=R,H._monitorSession=_,H._checkSessionInterval=E,H._stopCheckSessionOnError=P,H._revokeAccessTokenOnSignout=k,H._redirectNavigator=D,H._popupNavigator=O,H._iframeNavigator=L,H._userStore=B,H}return o(e,t),s(e,[{key:"popup_redirect_uri",get:function(){return this._popup_redirect_uri}},{key:"popup_post_logout_redirect_uri",get:function(){return this._popup_post_logout_redirect_uri}},{key:"popupWindowFeatures",get:function(){return this._popupWindowFeatures}},{key:"popupWindowTarget",get:function(){return this._popupWindowTarget}},{key:"silent_redirect_uri",get:function(){return this._silent_redirect_uri}},{key:"silentRequestTimeout",get:function(){return this._silentRequestTimeout}},{key:"automaticSilentRenew",get:function(){return!(!this.silent_redirect_uri||!this._automaticSilentRenew)}},{key:"includeIdTokenInSilentRenew",get:function(){return this._includeIdTokenInSilentRenew}},{key:"accessTokenExpiringNotificationTime",get:function(){return this._accessTokenExpiringNotificationTime}},{key:"monitorSession",get:function(){return this._monitorSession}},{key:"checkSessionInterval",get:function(){return this._checkSessionInterval}},{key:"stopCheckSessionOnError",get:function(){return this._stopCheckSessionOnError}},{key:"revokeAccessTokenOnSignout",get:function(){return this._revokeAccessTokenOnSignout}},{key:"redirectNavigator",get:function(){return this._redirectNavigator}},{key:"popupNavigator",get:function(){return this._popupNavigator}},{key:"iframeNavigator",get:function(){return this._iframeNavigator}},{key:"userStore",get:function(){return this._userStore}}]),e}(a.OidcClientSettings)},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0}),e.RedirectNavigator=void 0;var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),o=n(328);e.RedirectNavigator=function(){function t(){r(this,t)}return t.prototype.prepare=function(){return Promise.resolve(this)},t.prototype.navigate=function(t){return t&&t.url?(window.location=t.url,Promise.resolve()):(o.Log.error("RedirectNavigator.navigate: No url provided"),Promise.reject(new Error("No url provided")))},i(t,[{key:"url",get:function(){return window.location.href}}]),t}()},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0}),e.PopupNavigator=void 0;var i=n(328),o=n(354);e.PopupNavigator=function(){function t(){r(this,t)}return t.prototype.prepare=function(t){var e=new o.PopupWindow(t);return Promise.resolve(e)},t.prototype.callback=function(t,e,n){i.Log.debug("PopupNavigator.callback");try{return o.PopupWindow.notifyOpener(t,e,n),Promise.resolve()}catch(t){return Promise.reject(t)}},t}()},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0}),e.PopupWindow=void 0;var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),o=n(328),s=n(342),a=500,u="location=no,toolbar=no,width=500,height=500,left=100,top=100;",c="_blank";e.PopupWindow=function(){function t(e){var n=this;r(this,t),this._promise=new Promise(function(t,e){n._resolve=t,n._reject=e});var i=e.popupWindowTarget||c,s=e.popupWindowFeatures||u;this._popup=window.open("",i,s),this._popup&&(o.Log.debug("PopupWindow.ctor: popup successfully created"),this._checkForPopupClosedTimer=window.setInterval(this._checkForPopupClosed.bind(this),a))}return t.prototype.navigate=function(t){return this._popup?t&&t.url?(o.Log.debug("PopupWindow.navigate: Setting URL in popup"),this._id=t.id,this._id&&(window["popupCallback_"+t.id]=this._callback.bind(this)),this._popup.focus(),this._popup.window.location=t.url):(this._error("PopupWindow.navigate: no url provided"),this._error("No url provided")):this._error("PopupWindow.navigate: Error opening popup window"),this.promise},t.prototype._success=function(t){this._cleanup(),o.Log.debug("PopupWindow.callback: Successful response from popup window"),this._resolve(t)},t.prototype._error=function(t){this._cleanup(),o.Log.debug("PopupWindow.error: ",t),o.Log.error(t),this._reject(new Error(t))},t.prototype.close=function(){this._cleanup(!1)},t.prototype._cleanup=function(t){o.Log.debug("PopupWindow.cleanup"),window.clearInterval(this._checkForPopupClosedTimer),this._checkForPopupClosedTimer=null,delete window["popupCallback_"+this._id],this._popup&&!t&&this._popup.close(),this._popup=null},t.prototype._checkForPopupClosed=function(){this._popup&&!this._popup.closed||this._error("PopupWindow.checkForPopupClosed: Popup window closed")},t.prototype._callback=function(t,e){this._cleanup(e),t?(o.Log.debug("PopupWindow.callback success"),this._success({url:t})):(o.Log.debug("PopupWindow.callback: Invalid response from popup"),this._error("Invalid response from popup"))},t.notifyOpener=function(t,e,n){if(window.opener&&(t=t||window.location.href)){var r=s.UrlUtility.parseUrlFragment(t,n);if(r.state){var i="popupCallback_"+r.state,a=window.opener[i];a?(o.Log.debug("PopupWindow.notifyOpener: passing url message to opener"),a(t,e)):o.Log.warn("PopupWindow.notifyOpener: no matching callback found on opener")}else o.Log.warn("PopupWindow.notifyOpener: no state found in response url")}},i(t,[{key:"promise",get:function(){return this._promise}}]),t}()},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0}),e.IFrameNavigator=void 0;var i=n(328),o=n(356);e.IFrameNavigator=function(){function t(){r(this,t)}return t.prototype.prepare=function(t){var e=new o.IFrameWindow(t);return Promise.resolve(e)},t.prototype.callback=function(t){i.Log.debug("IFrameNavigator.callback");try{return o.IFrameWindow.notifyParent(t),Promise.resolve()}catch(t){return Promise.reject(t)}},t}()},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0}),e.IFrameWindow=void 0;var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),o=n(328),s=1e4;e.IFrameWindow=function(){function t(e){var n=this;r(this,t),this._promise=new Promise(function(t,e){n._resolve=t,n._reject=e}),this._boundMessageEvent=this._message.bind(this),window.addEventListener("message",this._boundMessageEvent,!1),this._frame=window.document.createElement("iframe"),this._frame.style.visibility="hidden",this._frame.style.position="absolute",this._frame.style.display="none",this._frame.style.width=0,this._frame.style.height=0,window.document.body.appendChild(this._frame)}return t.prototype.navigate=function(t){if(t&&t.url){var e=t.silentRequestTimeout||s;o.Log.debug("IFrameWindow.navigate: Using timeout of:",e),this._timer=window.setTimeout(this._timeout.bind(this),e),this._frame.src=t.url}else this._error("No url provided");return this.promise},t.prototype._success=function(t){this._cleanup(),o.Log.debug("IFrameWindow: Successful response from frame window"),this._resolve(t)},t.prototype._error=function(t){this._cleanup(),o.Log.error(t),this._reject(new Error(t))},t.prototype.close=function(){this._cleanup()},t.prototype._cleanup=function(){this._frame&&(o.Log.debug("IFrameWindow: cleanup"),window.removeEventListener("message",this._boundMessageEvent,!1),window.clearTimeout(this._timer),window.document.body.removeChild(this._frame),this._timer=null,this._frame=null,this._boundMessageEvent=null)},t.prototype._timeout=function(){o.Log.debug("IFrameWindow.timeout"),this._error("Frame window timed out")},t.prototype._message=function(t){if(o.Log.debug("IFrameWindow.message"),this._timer&&t.origin===this._origin&&t.source===this._frame.contentWindow){var e=t.data;e?this._success({url:e}):this._error("Invalid response from frame")}},t.notifyParent=function(t){o.Log.debug("IFrameWindow.notifyParent"),window.parent&&window!==window.parent&&(t=t||window.location.href,t&&(o.Log.debug("IFrameWindow.notifyParent: posting url message to parent"),window.parent.postMessage(t,location.protocol+"//"+location.host)))},i(t,[{key:"promise",get:function(){return this._promise}},{key:"_origin",get:function(){return location.protocol+"//"+location.host}}]),t}()},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0}),e.User=void 0;var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),o=n(328);e.User=function(){function t(e){var n=e.id_token,i=e.session_state,o=e.access_token,s=e.token_type,a=e.scope,u=e.profile,c=e.expires_at,f=e.state;r(this,t),this.id_token=n,this.session_state=i,this.access_token=o,this.token_type=s,this.scope=a,this.profile=u,this.expires_at=c,this.state=f}return t.prototype.toStorageString=function(){return o.Log.debug("User.toStorageString"),JSON.stringify({id_token:this.id_token,session_state:this.session_state,access_token:this.access_token,token_type:this.token_type,scope:this.scope,profile:this.profile,expires_at:this.expires_at})},t.fromStorageString=function(e){return o.Log.debug("User.fromStorageString"),new t(JSON.parse(e))},i(t,[{key:"expires_in",get:function(){if(this.expires_at){var t=parseInt(Date.now()/1e3);return this.expires_at-t}}},{key:"expired",get:function(){var t=this.expires_in;if(void 0!==t)return t<=0}},{key:"scopes",get:function(){return(this.scope||"").split(" ")}}]),t}()},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0}),e.UserManagerEvents=void 0;var s=n(328),a=n(359),u=n(361);e.UserManagerEvents=function(t){function e(n){r(this,e);var o=i(this,t.call(this,n));return o._userLoaded=new u.Event("User loaded"),o._userUnloaded=new u.Event("User unloaded"),o._silentRenewError=new u.Event("Silent renew error"),o._userSignedOut=new u.Event("User signed out"),o._userSessionChanged=new u.Event("User session changed"),o}return o(e,t),e.prototype.load=function(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];s.Log.debug("UserManagerEvents.load"),t.prototype.load.call(this,e),n&&this._userLoaded.raise(e)},e.prototype.unload=function(){s.Log.debug("UserManagerEvents.unload"),t.prototype.unload.call(this),this._userUnloaded.raise()},e.prototype.addUserLoaded=function(t){this._userLoaded.addHandler(t)},e.prototype.removeUserLoaded=function(t){this._userLoaded.removeHandler(t)},e.prototype.addUserUnloaded=function(t){this._userUnloaded.addHandler(t)},e.prototype.removeUserUnloaded=function(t){this._userUnloaded.removeHandler(t)},e.prototype.addSilentRenewError=function(t){this._silentRenewError.addHandler(t)},e.prototype.removeSilentRenewError=function(t){this._silentRenewError.removeHandler(t)},e.prototype._raiseSilentRenewError=function(t){s.Log.debug("UserManagerEvents._raiseSilentRenewError",t.message),this._silentRenewError.raise(t)},e.prototype.addUserSignedOut=function(t){this._userSignedOut.addHandler(t)},e.prototype.removeUserSignedOut=function(t){this._userSignedOut.removeHandler(t)},e.prototype._raiseUserSignedOut=function(t){s.Log.debug("UserManagerEvents._raiseUserSignedOut"),this._userSignedOut.raise(t)},e.prototype.addUserSessionChanged=function(t){this._userSessionChanged.addHandler(t)},e.prototype.removeUserSessionChanged=function(t){this._userSessionChanged.removeHandler(t)},e.prototype._raiseUserSessionChanged=function(t){s.Log.debug("UserManagerEvents._raiseUserSessionChanged"),this._userSessionChanged.raise(t)},e}(a.AccessTokenEvents)},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0}),e.AccessTokenEvents=void 0;var i=n(328),o=n(360),s=60;e.AccessTokenEvents=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.accessTokenExpiringNotificationTime,i=void 0===n?s:n,a=e.accessTokenExpiringTimer,u=void 0===a?new o.Timer("Access token expiring"):a,c=e.accessTokenExpiredTimer,f=void 0===c?new o.Timer("Access token expired"):c;r(this,t),this._accessTokenExpiringNotificationTime=i,this._accessTokenExpiring=u,this._accessTokenExpired=f}return t.prototype.load=function(t){if(t.access_token&&void 0!==t.expires_in){var e=t.expires_in;if(i.Log.debug("AccessTokenEvents.load: access token present, remaining duration:",e),e>0){var n=e-this._accessTokenExpiringNotificationTime;n<=0&&(n=1),i.Log.debug("AccessTokenEvents.load: registering expiring timer in:",n),this._accessTokenExpiring.init(n)}else i.Log.debug("AccessTokenEvents.load: canceling existing expiring timer becase we're past expiration."),this._accessTokenExpiring.cancel();var r=e+1;i.Log.debug("AccessTokenEvents.load: registering expired timer in:",r),this._accessTokenExpired.init(r)}else this._accessTokenExpiring.cancel(),this._accessTokenExpired.cancel()},t.prototype.unload=function(){i.Log.debug("AccessTokenEvents.unload: canceling existing access token timers"),
this._accessTokenExpiring.cancel(),this._accessTokenExpired.cancel()},t.prototype.addAccessTokenExpiring=function(t){this._accessTokenExpiring.addHandler(t)},t.prototype.removeAccessTokenExpiring=function(t){this._accessTokenExpiring.removeHandler(t)},t.prototype.addAccessTokenExpired=function(t){this._accessTokenExpired.addHandler(t)},t.prototype.removeAccessTokenExpired=function(t){this._accessTokenExpired.removeHandler(t)},t}()},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0}),e.Timer=void 0;var s=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),a=n(328),u=n(332),c=n(361),f=5;e.Timer=function(t){function e(n){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.Global.timer,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;r(this,e);var a=i(this,t.call(this,n));return a._timer=o,s?a._nowFunc=s:a._nowFunc=function(){return Date.now()/1e3},a}return o(e,t),e.prototype.init=function(t){t<=0&&(t=1),t=parseInt(t);var e=this.now+t;if(this.expiration===e&&this._timerHandle)return void a.Log.debug("Timer.init timer "+this._name+" skipping initialization since already initialized for expiration:",this.expiration);this.cancel(),a.Log.debug("Timer.init timer "+this._name+" for duration:",t),this._expiration=e;var n=f;t<n&&(n=t),this._timerHandle=this._timer.setInterval(this._callback.bind(this),1e3*n)},e.prototype.cancel=function(){this._timerHandle&&(a.Log.debug("Timer.cancel: ",this._name),this._timer.clearInterval(this._timerHandle),this._timerHandle=null)},e.prototype._callback=function(){var e=this._expiration-this.now;a.Log.debug("Timer.callback; "+this._name+" timer expires in:",e),this._expiration<=this.now&&(this.cancel(),t.prototype.raise.call(this))},s(e,[{key:"now",get:function(){return parseInt(this._nowFunc())}},{key:"expiration",get:function(){return this._expiration}}]),e}(c.Event)},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0}),e.Event=void 0;var i=n(328);e.Event=function(){function t(e){r(this,t),this._name=e,this._callbacks=[]}return t.prototype.addHandler=function(t){this._callbacks.push(t)},t.prototype.removeHandler=function(t){var e=this._callbacks.findIndex(function(e){return e===t});e>=0&&this._callbacks.splice(e,1)},t.prototype.raise=function(){i.Log.debug("Event: Raising event: "+this._name);for(var t=0;t<this._callbacks.length;t++){var e;(e=this._callbacks)[t].apply(e,arguments)}},t}()},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0}),e.SilentRenewService=void 0;var i=n(328);e.SilentRenewService=function(){function t(e){r(this,t),this._userManager=e}return t.prototype.start=function(){this._callback||(this._callback=this._tokenExpiring.bind(this),this._userManager.events.addAccessTokenExpiring(this._callback),this._userManager.getUser().then(function(t){}).catch(function(t){i.Log.error("SilentRenewService.start: Error from getUser:",t.message)}))},t.prototype.stop=function(){this._callback&&(this._userManager.events.removeAccessTokenExpiring(this._callback),delete this._callback)},t.prototype._tokenExpiring=function(){var t=this;this._userManager.signinSilent().then(function(t){i.Log.debug("SilentRenewService._tokenExpiring: Silent token renewal successful")},function(e){i.Log.error("SilentRenewService._tokenExpiring: Error from signinSilent:",e.message),t._userManager.events._raiseSilentRenewError(e)})},t}()},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0}),e.SessionMonitor=void 0;var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),o=n(328),s=n(364);e.SessionMonitor=function(){function t(e){var n=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s.CheckSessionIFrame;if(r(this,t),!e)throw o.Log.error("SessionMonitor.ctor: No user manager passed to SessionMonitor"),new Error("userManager");this._userManager=e,this._CheckSessionIFrameCtor=i,this._userManager.events.addUserLoaded(this._start.bind(this)),this._userManager.events.addUserUnloaded(this._stop.bind(this)),this._userManager.getUser().then(function(t){t&&n._start(t)}).catch(function(t){o.Log.error("SessionMonitor ctor: error from getUser:",t.message)})}return t.prototype._start=function(t){var e=this,n=t.session_state;n&&(this._sub=t.profile.sub,this._sid=t.profile.sid,o.Log.debug("SessionMonitor._start: session_state:",n,", sub:",this._sub),this._checkSessionIFrame?this._checkSessionIFrame.start(n):this._metadataService.getCheckSessionIframe().then(function(t){if(t){o.Log.debug("SessionMonitor._start: Initializing check session iframe");var r=e._client_id,i=e._checkSessionInterval,s=e._stopCheckSessionOnError;e._checkSessionIFrame=new e._CheckSessionIFrameCtor(e._callback.bind(e),r,t,i,s),e._checkSessionIFrame.load().then(function(){e._checkSessionIFrame.start(n)})}else o.Log.warn("SessionMonitor._start: No check session iframe found in the metadata")}).catch(function(t){o.Log.error("SessionMonitor._start: Error from getCheckSessionIframe:",t.message)}))},t.prototype._stop=function(){this._sub=null,this._sid=null,this._checkSessionIFrame&&(o.Log.debug("SessionMonitor._stop"),this._checkSessionIFrame.stop())},t.prototype._callback=function(){var t=this;this._userManager.querySessionStatus().then(function(e){var n=!0;e?e.sub===t._sub?(n=!1,t._checkSessionIFrame.start(e.session_state),e.sid===t._sid?o.Log.debug("SessionMonitor._callback: Same sub still logged in at OP, restarting check session iframe; session_state:",e.session_state):(o.Log.debug("SessionMonitor._callback: Same sub still logged in at OP, session state has changed, restarting check session iframe; session_state:",e.session_state),t._userManager.events._raiseUserSessionChanged())):o.Log.debug("SessionMonitor._callback: Different subject signed into OP:",e.sub):o.Log.debug("SessionMonitor._callback: Subject no longer signed into OP"),n&&(o.Log.debug("SessionMonitor._callback: SessionMonitor._callback; raising signed out event"),t._userManager.events._raiseUserSignedOut())}).catch(function(e){o.Log.debug("SessionMonitor._callback: Error calling queryCurrentSigninSession; raising signed out event",e.message),t._userManager.events._raiseUserSignedOut()})},i(t,[{key:"_settings",get:function(){return this._userManager.settings}},{key:"_metadataService",get:function(){return this._userManager.metadataService}},{key:"_client_id",get:function(){return this._settings.client_id}},{key:"_checkSessionInterval",get:function(){return this._settings.checkSessionInterval}},{key:"_stopCheckSessionOnError",get:function(){return this._settings.stopCheckSessionOnError}}]),t}()},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0}),e.CheckSessionIFrame=void 0;var i=n(328),o=2e3;e.CheckSessionIFrame=function(){function t(e,n,i,s){var a=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];r(this,t),this._callback=e,this._client_id=n,this._url=i,this._interval=s||o,this._stopOnError=a;var u=i.indexOf("/",i.indexOf("//")+2);this._frame_origin=i.substr(0,u),this._frame=window.document.createElement("iframe"),this._frame.style.visibility="hidden",this._frame.style.position="absolute",this._frame.style.display="none",this._frame.style.width=0,this._frame.style.height=0,this._frame.src=i}return t.prototype.load=function(){var t=this;return new Promise(function(e){t._frame.onload=function(){e()},window.document.body.appendChild(t._frame),t._boundMessageEvent=t._message.bind(t),window.addEventListener("message",t._boundMessageEvent,!1)})},t.prototype._message=function(t){t.origin===this._frame_origin&&t.source===this._frame.contentWindow&&("error"===t.data?(i.Log.error("CheckSessionIFrame: error message from check session op iframe"),this._stopOnError&&this.stop()):"changed"===t.data?(i.Log.debug("CheckSessionIFrame: changed message from check session op iframe"),this.stop(),this._callback()):i.Log.debug("CheckSessionIFrame: "+t.data+" message from check session op iframe"))},t.prototype.start=function(t){var e=this;this._session_state!==t&&(i.Log.debug("CheckSessionIFrame.start"),this.stop(),this._session_state=t,this._timer=window.setInterval(function(){e._frame.contentWindow.postMessage(e._client_id+" "+e._session_state,e._frame_origin)},this._interval))},t.prototype.stop=function(){this._session_state=null,this._timer&&(i.Log.debug("CheckSessionIFrame.stop"),window.clearInterval(this._timer),this._timer=null)},t}()},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0}),e.TokenRevocationClient=void 0;var i=n(328),o=n(334),s=n(332),a="access_token";e.TokenRevocationClient=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s.Global.XMLHttpRequest,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o.MetadataService;if(r(this,t),!e)throw i.Log.error("TokenRevocationClient.ctor: No settings provided"),new Error("No settings provided.");this._settings=e,this._XMLHttpRequestCtor=n,this._metadataService=new a(this._settings)}return t.prototype.revoke=function(t,e){var n=this;if(!t)throw i.Log.error("TokenRevocationClient.revoke: No accessToken provided"),new Error("No accessToken provided.");return this._metadataService.getRevocationEndpoint().then(function(r){if(r){i.Log.error("TokenRevocationClient.revoke: Revoking access token");var o=n._settings.client_id,s=n._settings.client_secret;return n._revoke(r,o,s,t)}if(e)throw i.Log.error("TokenRevocationClient.revoke: Revocation not supported"),new Error("Revocation not supported")})},t.prototype._revoke=function(t,e,n,r){var o=this;return new Promise(function(s,u){var c=new o._XMLHttpRequestCtor;c.open("POST",t),c.onload=function(){i.Log.debug("TokenRevocationClient.revoke: HTTP response received, status",c.status),200===c.status?s():u(Error(c.statusText+" ("+c.status+")"))};var f="client_id="+encodeURIComponent(e);n&&(f+="&client_secret="+encodeURIComponent(n)),f+="&token_type_hint="+encodeURIComponent(a),f+="&token="+encodeURIComponent(r),c.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),c.send(f)})},t}()},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0}),e.CordovaPopupNavigator=void 0;var i=n(367);e.CordovaPopupNavigator=function(){function t(){r(this,t)}return t.prototype.prepare=function(t){var e=new i.CordovaPopupWindow(t);return Promise.resolve(e)},t}()},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0}),e.CordovaPopupWindow=void 0;var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),o=n(328),s="location=no,toolbar=no,zoom=no",a="_blank";e.CordovaPopupWindow=function(){function t(e){var n=this;r(this,t),this._promise=new Promise(function(t,e){n._resolve=t,n._reject=e}),this.features=e.popupWindowFeatures||s,this.target=e.popupWindowTarget||a,this.redirect_uri=e.startUrl,o.Log.debug("CordovaPopupWindow.ctor: redirect_uri: "+this.redirect_uri)}return t.prototype._isInAppBrowserInstalled=function(t){return["cordova-plugin-inappbrowser","cordova-plugin-inappbrowser.inappbrowser","org.apache.cordova.inappbrowser"].some(function(e){return t.hasOwnProperty(e)})},t.prototype.navigate=function(t){if(t&&t.url){if(!window.cordova)return this._error("cordova is undefined");var e=window.cordova.require("cordova/plugin_list").metadata;if(this._isInAppBrowserInstalled(e)===!1)return this._error("InAppBrowser plugin not found");this._popup=cordova.InAppBrowser.open(t.url,this.target,this.features),this._popup?(o.Log.debug("CordovaPopupWindow.navigate: popup successfully created"),this._exitCallbackEvent=this._exitCallback.bind(this),this._loadStartCallbackEvent=this._loadStartCallback.bind(this),this._popup.addEventListener("exit",this._exitCallbackEvent,!1),this._popup.addEventListener("loadstart",this._loadStartCallbackEvent,!1)):this._error("Error opening popup window")}else this._error("No url provided");return this.promise},t.prototype._loadStartCallback=function(t){0===t.url.indexOf(this.redirect_uri)&&this._success({url:t.url})},t.prototype._exitCallback=function(t){this._error(t)},t.prototype._success=function(t){this._cleanup(),o.Log.debug("CordovaPopupWindow: Successful response from cordova popup window"),this._resolve(t)},t.prototype._error=function(t){this._cleanup(),o.Log.error(t),this._reject(new Error(t))},t.prototype.close=function(){this._cleanup()},t.prototype._cleanup=function(){this._popup&&(o.Log.debug("CordovaPopupWindow: cleaning up popup"),this._popup.removeEventListener("exit",this._exitCallbackEvent,!1),this._popup.removeEventListener("loadstart",this._loadStartCallbackEvent,!1),this._popup.close()),this._popup=null},i(t,[{key:"promise",get:function(){return this._promise}}]),t}()},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0}),e.CordovaIFrameNavigator=void 0;var i=n(367);e.CordovaIFrameNavigator=function(){function t(){r(this,t)}return t.prototype.prepare=function(t){t.popupWindowFeatures="hidden=yes";var e=new i.CordovaPopupWindow(t);return Promise.resolve(e)},t}()}]);